From: support Date: Fri, 15 Jul 2022 06:54:27 +0000 (+0000) Subject: Built motion from commit 79c7c506.|2.6.12 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=2324d3b98fc87aee5f10dc5e9d72c83d4e970e19;p=motion2.git Built motion from commit 79c7c506.|2.6.12 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9e42dea..d08024c 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-07-13T15:30:06.967Z", + "time": "2022-07-15T06:45:48.176Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index bca3c88..7665dea 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-07-13T15:30:06.967Z", + "time": "2022-07-15T06:45:48.176Z", "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 8febba5..1957b29 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 _0x4318=['urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x167244,_0x5c43a9){var _0x263f0c=function(_0x171626){while(--_0x171626){_0x167244['push'](_0x167244['shift']());}};_0x263f0c(++_0x5c43a9);}(_0x4318,0x1a7));var _0x8431=function(_0x4d66df,_0x166a33){_0x4d66df=_0x4d66df-0x0;var _0x5781d0=_0x4318[_0x4d66df];return _0x5781d0;};'use strict';var Sequelize=require(_0x8431('0x0'));module[_0x8431('0x1')]={'name':{'type':Sequelize[_0x8431('0x2')],'get':function(_0x303346){return this[_0x8431('0x3')](_0x8431('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8431('0x5'),_0x8431('0x6'),_0x8431('0x7'),'jscripty',_0x8431('0x8'),_0x8431('0x9'),_0x8431('0xa'),_0x8431('0xb')]],'msg':_0x8431('0xc')}},'comment':_0x8431('0xc')},'data1':{'type':Sequelize[_0x8431('0xd')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x8431('0xd')](0x1000),'comment':_0x8431('0xe')},'data3':{'type':Sequelize[_0x8431('0xd')](0x1000),'comment':_0x8431('0xf')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x8431('0x10')},'data5':{'type':Sequelize[_0x8431('0xd')](0x1000),'comments':_0x8431('0x11')},'data6':{'type':Sequelize[_0x8431('0xd')],'comments':_0x8431('0x12')},'data7':{'type':Sequelize[_0x8431('0x13')],'comments':_0x8431('0x14')}}; \ No newline at end of file +var _0x7ab6=['exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','STRING','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x15b612,_0x3570c8){var _0x5bea74=function(_0x29c3db){while(--_0x29c3db){_0x15b612['push'](_0x15b612['shift']());}};_0x5bea74(++_0x3570c8);}(_0x7ab6,0x1bf));var _0x67ab=function(_0x19ad32,_0xcda39d){_0x19ad32=_0x19ad32-0x0;var _0x2d96c8=_0x7ab6[_0x19ad32];return _0x2d96c8;};'use strict';var Sequelize=require(_0x67ab('0x0'));module[_0x67ab('0x1')]={'name':{'type':Sequelize[_0x67ab('0x2')],'get':function(_0x46bb94){return this[_0x67ab('0x3')](_0x67ab('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x67ab('0x5'),_0x67ab('0x6'),_0x67ab('0x7'),'jscripty',_0x67ab('0x8'),'browser',_0x67ab('0x9'),'script']],'msg':_0x67ab('0xa')}},'comment':_0x67ab('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x67ab('0xb')},'data2':{'type':Sequelize[_0x67ab('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x67ab('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[_0x67ab('0xc')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x67ab('0xd')},'data7':{'type':Sequelize[_0x67ab('0xe')],'comments':_0x67ab('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1651060..d1bb29b 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 _0xd289=['querystring','papaparse','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','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','body','Action','params','catch','find','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0xd289,0x80));var _0x9d28=function(_0x2bdc9d,_0x5ef92b){_0x2bdc9d=_0x2bdc9d-0x0;var _0x1ac0ba=_0xd289[_0x2bdc9d];return _0x1ac0ba;};'use strict';var emlformat=require(_0x9d28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9d28('0x2'));var BPromise=require(_0x9d28('0x3'));var Mustache=require('mustache');var util=require(_0x9d28('0x4'));var path=require(_0x9d28('0x5'));var sox=require('sox');var csv=require(_0x9d28('0x6'));var ejs=require(_0x9d28('0x7'));var fs=require('fs');var fs_extra=require(_0x9d28('0x8'));var _=require(_0x9d28('0x9'));var squel=require(_0x9d28('0xa'));var crypto=require('crypto');var jsforce=require(_0x9d28('0xb'));var deskjs=require(_0x9d28('0xc'));var toCsv=require(_0x9d28('0x6'));var querystring=require(_0x9d28('0xd'));var Papa=require(_0x9d28('0xe'));var Redis=require(_0x9d28('0xf'));var authService=require(_0x9d28('0x10'));var qs=require(_0x9d28('0x11'));var as=require(_0x9d28('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d28('0x13'))('api');var utils=require(_0x9d28('0x14'));var config=require(_0x9d28('0x15'));var licenseUtil=require(_0x9d28('0x16'));var db=require(_0x9d28('0x17'))['db'];function respondWithStatusCode(_0x4e9bd8,_0x4e126c){_0x4e126c=_0x4e126c||0xcc;return function(_0x1c21c1){if(_0x1c21c1){return _0x4e9bd8[_0x9d28('0x18')](_0x4e126c);}return _0x4e9bd8[_0x9d28('0x19')](_0x4e126c)['end']();};}function respondWithResult(_0x4a2cc1,_0x153a0c){_0x153a0c=_0x153a0c||0xc8;return function(_0xebc3a7){if(_0xebc3a7){return _0x4a2cc1[_0x9d28('0x19')](_0x153a0c)[_0x9d28('0x1a')](_0xebc3a7);}};}function respondWithFilteredResult(_0x51eb9d,_0x49a1c0){return function(_0x46c889){if(_0x46c889){var _0x4aeba9=typeof _0x49a1c0[_0x9d28('0x1b')]===_0x9d28('0x1c')&&typeof _0x49a1c0[_0x9d28('0x1d')]===_0x9d28('0x1c');var _0x41b0c3=_0x46c889['count'];var _0x225976=_0x4aeba9?0x0:_0x49a1c0[_0x9d28('0x1b')];var _0x3148a9=_0x4aeba9?_0x46c889[_0x9d28('0x1e')]:_0x49a1c0[_0x9d28('0x1b')]+_0x49a1c0[_0x9d28('0x1d')];var _0x301b2d;if(_0x3148a9>=_0x41b0c3){_0x3148a9=_0x41b0c3;_0x301b2d=0xc8;}else{_0x301b2d=0xce;}_0x51eb9d['status'](_0x301b2d);return _0x51eb9d[_0x9d28('0x1f')](_0x9d28('0x20'),_0x225976+'-'+_0x3148a9+'/'+_0x41b0c3)[_0x9d28('0x1a')](_0x46c889);}return null;};}function patchUpdates(_0x22e119){return function(_0x285629){try{jsonpatch[_0x9d28('0x21')](_0x285629,_0x22e119,!![]);}catch(_0x205f7c){return BPromise['reject'](_0x205f7c);}return _0x285629[_0x9d28('0x22')]();};}function saveUpdates(_0x268e95,_0x2cfc55){return function(_0x23097a){if(_0x23097a){return _0x23097a[_0x9d28('0x23')](_0x268e95)[_0x9d28('0x24')](function(_0xc1b2d3){return _0xc1b2d3;});}return null;};}function removeEntity(_0x55b073,_0x1a607e){return function(_0x11700c){if(_0x11700c){return _0x11700c[_0x9d28('0x25')]()['then'](function(){_0x55b073[_0x9d28('0x19')](0xcc)[_0x9d28('0x26')]();});}};}function handleEntityNotFound(_0x33814e,_0x3bdd70){return function(_0x51970d){if(!_0x51970d){_0x33814e[_0x9d28('0x18')](0x194);}return _0x51970d;};}function handleError(_0x22529e,_0x162d21){_0x162d21=_0x162d21||0x1f4;return function(_0x3732a9){logger[_0x9d28('0x27')](_0x3732a9['stack']);if(_0x3732a9[_0x9d28('0x28')]){delete _0x3732a9[_0x9d28('0x28')];}_0x22529e['status'](_0x162d21)[_0x9d28('0x29')](_0x3732a9);};}exports[_0x9d28('0x23')]=function(_0x46c045,_0x2bed66){if(_0x46c045[_0x9d28('0x2a')]['id']){delete _0x46c045[_0x9d28('0x2a')]['id'];}return db[_0x9d28('0x2b')]['find']({'where':{'id':_0x46c045[_0x9d28('0x2c')]['id']}})[_0x9d28('0x24')](handleEntityNotFound(_0x2bed66,null))['then'](saveUpdates(_0x46c045[_0x9d28('0x2a')],null))[_0x9d28('0x24')](respondWithResult(_0x2bed66,null))[_0x9d28('0x2d')](handleError(_0x2bed66,null));};exports[_0x9d28('0x25')]=function(_0x20d48f,_0x32ff4a){return db[_0x9d28('0x2b')][_0x9d28('0x2e')]({'where':{'id':_0x20d48f[_0x9d28('0x2c')]['id']}})[_0x9d28('0x24')](handleEntityNotFound(_0x32ff4a,null))[_0x9d28('0x24')](removeEntity(_0x32ff4a,null))[_0x9d28('0x2d')](handleError(_0x32ff4a,null));}; \ No newline at end of file +var _0x169f=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','status','error','stack','name','body','Action','params','catch','find','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs'];(function(_0x18983d,_0x3472b3){var _0x340651=function(_0x3d8cb7){while(--_0x3d8cb7){_0x18983d['push'](_0x18983d['shift']());}};_0x340651(++_0x3472b3);}(_0x169f,0x13b));var _0xf169=function(_0x59c23e,_0x555150){_0x59c23e=_0x59c23e-0x0;var _0x1db2b4=_0x169f[_0x59c23e];return _0x1db2b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf169('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf169('0x1'));var rp=require('request-promise');var moment=require(_0xf169('0x2'));var BPromise=require(_0xf169('0x3'));var Mustache=require(_0xf169('0x4'));var util=require('util');var path=require(_0xf169('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf169('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf169('0x7'));var squel=require(_0xf169('0x8'));var crypto=require(_0xf169('0x9'));var jsforce=require(_0xf169('0xa'));var deskjs=require(_0xf169('0xb'));var toCsv=require(_0xf169('0xc'));var querystring=require(_0xf169('0xd'));var Papa=require(_0xf169('0xe'));var Redis=require(_0xf169('0xf'));var authService=require(_0xf169('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf169('0x11'));var hardwareService=require(_0xf169('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf169('0x13'));var config=require(_0xf169('0x14'));var licenseUtil=require(_0xf169('0x15'));var db=require(_0xf169('0x16'))['db'];function respondWithStatusCode(_0x5752d4,_0x1bf8b4){_0x1bf8b4=_0x1bf8b4||0xcc;return function(_0x50245a){if(_0x50245a){return _0x5752d4[_0xf169('0x17')](_0x1bf8b4);}return _0x5752d4['status'](_0x1bf8b4)[_0xf169('0x18')]();};}function respondWithResult(_0x4f1879,_0x35ca7a){_0x35ca7a=_0x35ca7a||0xc8;return function(_0x970789){if(_0x970789){return _0x4f1879['status'](_0x35ca7a)[_0xf169('0x19')](_0x970789);}};}function respondWithFilteredResult(_0x3c221c,_0x2d4eb5){return function(_0x4d3807){if(_0x4d3807){var _0x573224=typeof _0x2d4eb5[_0xf169('0x1a')]==='undefined'&&typeof _0x2d4eb5['limit']===_0xf169('0x1b');var _0x31237e=_0x4d3807[_0xf169('0x1c')];var _0x47ef98=_0x573224?0x0:_0x2d4eb5[_0xf169('0x1a')];var _0x5d6a6d=_0x573224?_0x4d3807['count']:_0x2d4eb5[_0xf169('0x1a')]+_0x2d4eb5[_0xf169('0x1d')];var _0xde4dfe;if(_0x5d6a6d>=_0x31237e){_0x5d6a6d=_0x31237e;_0xde4dfe=0xc8;}else{_0xde4dfe=0xce;}_0x3c221c['status'](_0xde4dfe);return _0x3c221c[_0xf169('0x1e')](_0xf169('0x1f'),_0x47ef98+'-'+_0x5d6a6d+'/'+_0x31237e)[_0xf169('0x19')](_0x4d3807);}return null;};}function patchUpdates(_0x5f2cf9){return function(_0x37fa8e){try{jsonpatch['apply'](_0x37fa8e,_0x5f2cf9,!![]);}catch(_0xab7a8d){return BPromise[_0xf169('0x20')](_0xab7a8d);}return _0x37fa8e[_0xf169('0x21')]();};}function saveUpdates(_0x526fa9,_0x23442c){return function(_0x56f724){if(_0x56f724){return _0x56f724[_0xf169('0x22')](_0x526fa9)[_0xf169('0x23')](function(_0x41eb0f){return _0x41eb0f;});}return null;};}function removeEntity(_0x6d6ed5,_0x580923){return function(_0x5498ed){if(_0x5498ed){return _0x5498ed[_0xf169('0x24')]()[_0xf169('0x23')](function(){_0x6d6ed5[_0xf169('0x25')](0xcc)[_0xf169('0x18')]();});}};}function handleEntityNotFound(_0x299d49,_0x14de7d){return function(_0x52ba5c){if(!_0x52ba5c){_0x299d49['sendStatus'](0x194);}return _0x52ba5c;};}function handleError(_0x40dfab,_0x463b5b){_0x463b5b=_0x463b5b||0x1f4;return function(_0x2c129f){logger[_0xf169('0x26')](_0x2c129f[_0xf169('0x27')]);if(_0x2c129f['name']){delete _0x2c129f[_0xf169('0x28')];}_0x40dfab[_0xf169('0x25')](_0x463b5b)['send'](_0x2c129f);};}exports[_0xf169('0x22')]=function(_0x2dbe30,_0x288a74){if(_0x2dbe30[_0xf169('0x29')]['id']){delete _0x2dbe30['body']['id'];}return db[_0xf169('0x2a')]['find']({'where':{'id':_0x2dbe30[_0xf169('0x2b')]['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x288a74,null))[_0xf169('0x23')](saveUpdates(_0x2dbe30[_0xf169('0x29')],null))[_0xf169('0x23')](respondWithResult(_0x288a74,null))[_0xf169('0x2c')](handleError(_0x288a74,null));};exports['destroy']=function(_0x1bf8e4,_0x13cdd0){return db[_0xf169('0x2a')][_0xf169('0x2d')]({'where':{'id':_0x1bf8e4['params']['id']}})[_0xf169('0x23')](handleEntityNotFound(_0x13cdd0,null))[_0xf169('0x23')](removeEntity(_0x13cdd0,null))[_0xf169('0x2c')](handleError(_0x13cdd0,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 91b2161..96a8f6d 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 _0x8140=['define','tools_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./action.attributes','exports'];(function(_0x26387d,_0x35c654){var _0x36c01a=function(_0x5c006d){while(--_0x5c006d){_0x26387d['push'](_0x26387d['shift']());}};_0x36c01a(++_0x35c654);}(_0x8140,0x9c));var _0x0814=function(_0x232848,_0x18384d){_0x232848=_0x232848-0x0;var _0x4540e2=_0x8140[_0x232848];return _0x4540e2;};'use strict';var _=require('lodash');var util=require(_0x0814('0x0'));var logger=require(_0x0814('0x1'))(_0x0814('0x2'));var moment=require(_0x0814('0x3'));var BPromise=require(_0x0814('0x4'));var rp=require(_0x0814('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0814('0x6'));var config=require('../../config/environment');var attributes=require(_0x0814('0x7'));module[_0x0814('0x8')]=function(_0x2e3af4,_0x1f4ef5){return _0x2e3af4[_0x0814('0x9')]('Action',attributes,{'tableName':_0x0814('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a78=['api','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','lodash','util'];(function(_0x3d220e,_0x3a67a5){var _0x421b95=function(_0x4c6a9a){while(--_0x4c6a9a){_0x3d220e['push'](_0x3d220e['shift']());}};_0x421b95(++_0x3a67a5);}(_0x0a78,0x1ab));var _0x80a7=function(_0x33a877,_0x413a2d){_0x33a877=_0x33a877-0x0;var _0x459879=_0x0a78[_0x33a877];return _0x459879;};'use strict';var _=require(_0x80a7('0x0'));var util=require(_0x80a7('0x1'));var logger=require('../../config/logger')(_0x80a7('0x2'));var moment=require('moment');var BPromise=require(_0x80a7('0x3'));var rp=require(_0x80a7('0x4'));var fs=require('fs');var path=require(_0x80a7('0x5'));var rimraf=require('rimraf');var config=require(_0x80a7('0x6'));var attributes=require('./action.attributes');module[_0x80a7('0x7')]=function(_0x38425e,_0x546c40){return _0x38425e[_0x80a7('0x8')](_0x80a7('0x9'),attributes,{'tableName':_0x80a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 2fbb33f..0627500 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x1ca48f,_0x58cb05){var _0xffa5a9=function(_0x1ba383){while(--_0x1ba383){_0x1ca48f['push'](_0x1ca48f['shift']());}};_0xffa5a9(++_0x58cb05);}(_0xe14b,0x93));var _0xbe14=function(_0xbbc401,_0x34de69){_0xbbc401=_0xbbc401-0x0;var _0x33b743=_0xe14b[_0xbbc401];return _0x33b743;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x53ec,0x192));var _0xc53e=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x53ec[_0x2bf6be];return _0x532ef4;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 6bb8e2f..3d836f9 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 _0x0380=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x305f2a,_0x489912){var _0x266f79=function(_0x12b945){while(--_0x12b945){_0x305f2a['push'](_0x305f2a['shift']());}};_0x266f79(++_0x489912);}(_0x0380,0xc4));var _0x0038=function(_0x48c8d5,_0x2eebf0){_0x48c8d5=_0x48c8d5-0x0;var _0x4dd4b1=_0x0380[_0x48c8d5];return _0x4dd4b1;};'use strict';var multer=require(_0x0038('0x0'));var util=require(_0x0038('0x1'));var path=require(_0x0038('0x2'));var timeout=require(_0x0038('0x3'));var express=require('express');var router=express[_0x0038('0x4')]();var fs_extra=require(_0x0038('0x5'));var auth=require(_0x0038('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0038('0x7'));var controller=require(_0x0038('0x8'));router[_0x0038('0x9')](_0x0038('0xa'),auth[_0x0038('0xb')](),controller[_0x0038('0xc')]);router[_0x0038('0xd')](_0x0038('0xa'),auth[_0x0038('0xb')](),controller[_0x0038('0xe')]);module[_0x0038('0xf')]=router; \ No newline at end of file +var _0xcfdf=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xcfdf,0x195));var _0xfcfd=function(_0x25147b,_0x534c37){_0x25147b=_0x25147b-0x0;var _0x12bc18=_0xcfdf[_0x25147b];return _0x12bc18;};'use strict';var multer=require('multer');var util=require(_0xfcfd('0x0'));var path=require(_0xfcfd('0x1'));var timeout=require(_0xfcfd('0x2'));var express=require(_0xfcfd('0x3'));var router=express[_0xfcfd('0x4')]();var fs_extra=require(_0xfcfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfcfd('0x6'));var config=require(_0xfcfd('0x7'));var controller=require(_0xfcfd('0x8'));router[_0xfcfd('0x9')]('/:id',auth[_0xfcfd('0xa')](),controller[_0xfcfd('0xb')]);router[_0xfcfd('0xc')](_0xfcfd('0xd'),auth[_0xfcfd('0xa')](),controller['destroy']);module[_0xfcfd('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 57d7cf2..28b25e6 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x2675,0x75));var _0x5267=function(_0x4859af,_0x22a5cc){_0x4859af=_0x4859af-0x0;var _0x5202fb=_0x2675[_0x4859af];return _0x5202fb;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +var _0xbd51=['sequelize','STRING'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5f9a43,_0x33b992){_0x5f9a43=_0x5f9a43-0x0;var _0x1bbb9e=_0xbd51[_0x5f9a43];return _0x1bbb9e;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 685a9ff..6fead9b 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 _0xdbed=['format','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','DATE(%s)','IS\x20NOT\x20NULL','MetricId','function','output','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','run','runReport','cross_join','HOUR(%s)','eml-format','rimraf','zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','get','CustomReports','error','name','send','index','map','AnalyticCustomReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body','user','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','metric','replace'];(function(_0x12ab49,_0x56a63c){var _0x8256d9=function(_0x111b31){while(--_0x111b31){_0x12ab49['push'](_0x12ab49['shift']());}};_0x8256d9(++_0x56a63c);}(_0xdbed,0xca));var _0xddbe=function(_0x7060aa,_0x31ed19){_0x7060aa=_0x7060aa-0x0;var _0x48518e=_0xdbed[_0x7060aa];return _0x48518e;};'use strict';var emlformat=require(_0xddbe('0x0'));var rimraf=require(_0xddbe('0x1'));var zipdir=require(_0xddbe('0x2'));var jsonpatch=require(_0xddbe('0x3'));var rp=require('request-promise');var moment=require(_0xddbe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xddbe('0x5'));var ejs=require(_0xddbe('0x6'));var fs=require('fs');var fs_extra=require(_0xddbe('0x7'));var _=require(_0xddbe('0x8'));var squel=require(_0xddbe('0x9'));var crypto=require(_0xddbe('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xddbe('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddbe('0xc'));var Redis=require(_0xddbe('0xd'));var authService=require(_0xddbe('0xe'));var qs=require(_0xddbe('0xf'));var as=require(_0xddbe('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xddbe('0x11'));var config=require(_0xddbe('0x12'));var licenseUtil=require(_0xddbe('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0xddbe('0x14'))[_0xddbe('0x15')];function respondWithStatusCode(_0x8ab39b,_0x246689){_0x246689=_0x246689||0xcc;return function(_0x31b039){if(_0x31b039){return _0x8ab39b[_0xddbe('0x16')](_0x246689);}return _0x8ab39b[_0xddbe('0x17')](_0x246689)[_0xddbe('0x18')]();};}function respondWithResult(_0x2eaa66,_0x2d5495){_0x2d5495=_0x2d5495||0xc8;return function(_0x226522){if(_0x226522){return _0x2eaa66['status'](_0x2d5495)[_0xddbe('0x19')](_0x226522);}};}function respondWithFilteredResult(_0x1abeea,_0xb2d0ee){return function(_0x8e82fd){if(_0x8e82fd){var _0x1e05cf=typeof _0xb2d0ee[_0xddbe('0x1a')]==='undefined'&&typeof _0xb2d0ee['limit']===_0xddbe('0x1b');var _0x449bc1=_0x8e82fd[_0xddbe('0x1c')];var _0x4a2f37=_0x1e05cf?0x0:_0xb2d0ee[_0xddbe('0x1a')];var _0x4b4be9=_0x1e05cf?_0x8e82fd[_0xddbe('0x1c')]:_0xb2d0ee[_0xddbe('0x1a')]+_0xb2d0ee['limit'];var _0x9dc713;if(_0x4b4be9>=_0x449bc1){_0x4b4be9=_0x449bc1;_0x9dc713=0xc8;}else{_0x9dc713=0xce;}_0x1abeea['status'](_0x9dc713);return _0x1abeea['set'](_0xddbe('0x1d'),_0x4a2f37+'-'+_0x4b4be9+'/'+_0x449bc1)[_0xddbe('0x19')](_0x8e82fd);}return null;};}function patchUpdates(_0x1c13de){return function(_0x5bb269){try{jsonpatch[_0xddbe('0x1e')](_0x5bb269,_0x1c13de,!![]);}catch(_0x5104bb){return BPromise[_0xddbe('0x1f')](_0x5104bb);}return _0x5bb269[_0xddbe('0x20')]();};}function saveUpdates(_0x21b2d5,_0x44da8b){return function(_0x4621aa){if(_0x4621aa){return _0x4621aa['update'](_0x21b2d5)[_0xddbe('0x21')](function(_0x2db05a){return _0x2db05a;});}return null;};}function removeEntity(_0x324d5b,_0x4ddf0b){return function(_0x47dc94){if(_0x47dc94){return _0x47dc94[_0xddbe('0x22')]()[_0xddbe('0x21')](function(){var _0x3759b6=_0x47dc94[_0xddbe('0x23')]({'plain':!![]});var _0x46f2aa=_0xddbe('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x46f2aa,'resourceId':_0x3759b6['id']}})['then'](function(){return _0x47dc94;});})[_0xddbe('0x21')](function(){_0x324d5b[_0xddbe('0x17')](0xcc)[_0xddbe('0x18')]();});}};}function handleEntityNotFound(_0x1086e4,_0x2245dc){return function(_0x577415){if(!_0x577415){_0x1086e4[_0xddbe('0x16')](0x194);}return _0x577415;};}function handleError(_0x4e5d8a,_0x5f17fd){_0x5f17fd=_0x5f17fd||0x1f4;return function(_0x2114aa){logger[_0xddbe('0x25')](_0x2114aa['stack']);if(_0x2114aa[_0xddbe('0x26')]){delete _0x2114aa[_0xddbe('0x26')];}_0x4e5d8a['status'](_0x5f17fd)[_0xddbe('0x27')](_0x2114aa);};}exports[_0xddbe('0x28')]=function(_0x1c0028,_0x2d4555){var _0x821b7f={},_0x50ce50={},_0x4336d2={'count':0x0,'rows':[]};var _0x37d21f=_[_0xddbe('0x29')](db[_0xddbe('0x2a')]['rawAttributes'],function(_0x28b31f){return{'name':_0x28b31f[_0xddbe('0x2b')],'type':_0x28b31f['type'][_0xddbe('0x2c')]};});_0x50ce50['model']=_[_0xddbe('0x29')](_0x37d21f,_0xddbe('0x26'));_0x50ce50[_0xddbe('0x2d')]=_[_0xddbe('0x2e')](_0x1c0028['query']);_0x50ce50[_0xddbe('0x2f')]=_[_0xddbe('0x30')](_0x50ce50[_0xddbe('0x31')],_0x50ce50['query']);_0x821b7f[_0xddbe('0x32')]=_[_0xddbe('0x30')](_0x50ce50[_0xddbe('0x31')],qs[_0xddbe('0x33')](_0x1c0028[_0xddbe('0x2d')]['fields']));_0x821b7f[_0xddbe('0x32')]=_0x821b7f[_0xddbe('0x32')][_0xddbe('0x34')]?_0x821b7f[_0xddbe('0x32')]:_0x50ce50['model'];if(!_0x1c0028[_0xddbe('0x2d')]['hasOwnProperty'](_0xddbe('0x35'))){_0x821b7f['limit']=qs[_0xddbe('0x36')](_0x1c0028[_0xddbe('0x2d')]['limit']);_0x821b7f['offset']=qs['offset'](_0x1c0028[_0xddbe('0x2d')][_0xddbe('0x1a')]);}_0x821b7f['order']=qs['sort'](_0x1c0028[_0xddbe('0x2d')][_0xddbe('0x37')]);_0x821b7f[_0xddbe('0x38')]=qs[_0xddbe('0x2f')](_['pick'](_0x1c0028[_0xddbe('0x2d')],_0x50ce50[_0xddbe('0x2f')]),_0x37d21f);if(_0x1c0028[_0xddbe('0x2d')][_0xddbe('0x39')]){_0x821b7f[_0xddbe('0x38')]=_[_0xddbe('0x3a')](_0x821b7f[_0xddbe('0x38')],{'$or':_[_0xddbe('0x29')](_0x37d21f,function(_0x5ad3ab){if(_0x5ad3ab[_0xddbe('0x3b')]!==_0xddbe('0x3c')){var _0x1b95b6={};_0x1b95b6[_0x5ad3ab[_0xddbe('0x26')]]={'$like':'%'+_0x1c0028[_0xddbe('0x2d')]['filter']+'%'};return _0x1b95b6;}})});}_0x821b7f=_[_0xddbe('0x3a')]({},_0x821b7f,_0x1c0028[_0xddbe('0x3d')]);var _0x7f75a3={'where':_0x821b7f[_0xddbe('0x38')]};return db[_0xddbe('0x2a')]['count'](_0x7f75a3)[_0xddbe('0x21')](function(_0x25a409){_0x4336d2[_0xddbe('0x1c')]=_0x25a409;if(_0x1c0028['query']['includeAll']){_0x821b7f[_0xddbe('0x3e')]=[{'all':!![]}];}return db[_0xddbe('0x2a')][_0xddbe('0x3f')](_0x821b7f);})[_0xddbe('0x21')](function(_0x1a9fb1){_0x4336d2['rows']=_0x1a9fb1;return _0x4336d2;})[_0xddbe('0x21')](respondWithFilteredResult(_0x2d4555,_0x821b7f))[_0xddbe('0x40')](handleError(_0x2d4555,null));};exports['show']=function(_0x178706,_0x3da74e){var _0x5b546e={'raw':![],'where':{'id':_0x178706[_0xddbe('0x41')]['id']}},_0x59c4d8={};_0x59c4d8['model']=_[_0xddbe('0x2e')](db[_0xddbe('0x2a')][_0xddbe('0x42')]);_0x59c4d8[_0xddbe('0x2d')]=_[_0xddbe('0x2e')](_0x178706[_0xddbe('0x2d')]);_0x59c4d8[_0xddbe('0x2f')]=_[_0xddbe('0x30')](_0x59c4d8[_0xddbe('0x31')],_0x59c4d8[_0xddbe('0x2d')]);_0x5b546e[_0xddbe('0x32')]=_[_0xddbe('0x30')](_0x59c4d8[_0xddbe('0x31')],qs['fields'](_0x178706[_0xddbe('0x2d')][_0xddbe('0x33')]));_0x5b546e[_0xddbe('0x32')]=_0x5b546e[_0xddbe('0x32')][_0xddbe('0x34')]?_0x5b546e['attributes']:_0x59c4d8[_0xddbe('0x31')];if(_0x178706[_0xddbe('0x2d')][_0xddbe('0x43')]){_0x5b546e[_0xddbe('0x3e')]=[{'all':!![]}];}_0x5b546e=_[_0xddbe('0x3a')]({},_0x5b546e,_0x178706[_0xddbe('0x3d')]);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x5b546e)[_0xddbe('0x21')](handleEntityNotFound(_0x3da74e,null))['then'](respondWithResult(_0x3da74e,null))[_0xddbe('0x40')](handleError(_0x3da74e,null));};exports[_0xddbe('0x45')]=function(_0x177cd7,_0xc073a4){return db[_0xddbe('0x2a')][_0xddbe('0x45')](_0x177cd7[_0xddbe('0x46')],{})[_0xddbe('0x21')](function(_0x1bd32c){var _0x2e372e=_0x177cd7[_0xddbe('0x47')]['get']({'plain':!![]});if(!_0x2e372e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e372e['role']==='user'){var _0x28ad23=_0x1bd32c['get']({'plain':!![]});var _0x4a1251=_0xddbe('0x48');return db['UserProfileSection'][_0xddbe('0x44')]({'where':{'name':_0x4a1251,'userProfileId':_0x2e372e[_0xddbe('0x49')]},'raw':!![]})['then'](function(_0x115c87){if(_0x115c87&&_0x115c87[_0xddbe('0x4a')]===0x0){return db[_0xddbe('0x4b')][_0xddbe('0x45')]({'name':_0x28ad23['name'],'resourceId':_0x28ad23['id'],'type':_0xddbe('0x24'),'sectionId':_0x115c87['id']},{})['then'](function(){return _0x1bd32c;});}else{return _0x1bd32c;}})['catch'](function(_0x3a2a33){logger[_0xddbe('0x25')](_0xddbe('0x4c'),_0x3a2a33);throw _0x3a2a33;});}return _0x1bd32c;})['then'](respondWithResult(_0xc073a4,0xc9))[_0xddbe('0x40')](handleError(_0xc073a4,null));};exports[_0xddbe('0x4d')]=function(_0x3971d9,_0x55ce8a){if(_0x3971d9['body']['id']){delete _0x3971d9[_0xddbe('0x46')]['id'];}return db[_0xddbe('0x2a')][_0xddbe('0x44')]({'where':{'id':_0x3971d9[_0xddbe('0x41')]['id']}})['then'](handleEntityNotFound(_0x55ce8a,null))[_0xddbe('0x21')](saveUpdates(_0x3971d9[_0xddbe('0x46')],null))['then'](respondWithResult(_0x55ce8a,null))[_0xddbe('0x40')](handleError(_0x55ce8a,null));};exports[_0xddbe('0x22')]=function(_0x484b9f,_0x334217){return db[_0xddbe('0x2a')]['find']({'where':{'id':_0x484b9f['params']['id']}})['then'](handleEntityNotFound(_0x334217,null))[_0xddbe('0x21')](removeEntity(_0x334217,null))[_0xddbe('0x40')](handleError(_0x334217,null));};exports[_0xddbe('0x4e')]=function(_0x12cc0c,_0x2812cf){var _0x2bdced=0xa;var _0x11bad6=[_0xddbe('0x4f'),_0xddbe('0x50'),_0xddbe('0x51'),'cross_join'];var _0x435f44={'SUM':_0xddbe('0x52'),'COUNT':_0xddbe('0x53'),'COUNT DISTINCT':_0xddbe('0x54'),'MAX':_0xddbe('0x55'),'MIN':_0xddbe('0x56'),'AVG':_0xddbe('0x57'),'GROUP_CONCAT':_0xddbe('0x58'),'GROUP_CONCAT ASC':_0xddbe('0x59'),'GROUP_CONCAT DESC':_0xddbe('0x5a')};var _0x1f7412={'SEC_TO_TIME':_0xddbe('0x5b'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xddbe('0x5c'),'UNIX_TIMESTAMP':_0xddbe('0x5d')};var _0x544a4b=function(_0x371211){return!_[_0xddbe('0x5e')]([_0xddbe('0x5f'),'IS\x20NOT\x20NULL',_0xddbe('0x60'),_0xddbe('0x61')],_0x371211);};var _0x39e09c=function(_0x3f2d27){if(!_0x3f2d27||!_0x3f2d27['rules']['length']){return'';}for(var _0x302608='(',_0x5458fc=0x0;_0x5458fc<_0x3f2d27[_0xddbe('0x62')][_0xddbe('0x34')];_0x5458fc+=0x1){_0x5458fc>0x0&&(_0x302608+='\x20'+_0x3f2d27['operator']+'\x20');_0x302608+=_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x63')]?_0x39e09c(_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x63')]):_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x64')]+'\x20'+_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x65')]+(_0x544a4b(_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x65')])?'\x20'+_0x3f2d27[_0xddbe('0x62')][_0x5458fc][_0xddbe('0x66')]:'');}return _0x302608+')';};var _0x2b72f5={'where':{'id':_0x12cc0c[_0xddbe('0x41')]['id']}},_0x38e98e,_0x1dd777,_0x16f572,_0x4df3ee,_0x5753be;_0x2b72f5=_['merge']({},_0x2b72f5,_0x12cc0c[_0xddbe('0x3d')]);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x2b72f5)[_0xddbe('0x21')](function(_0x1c667c){if(_0x1c667c){_0x38e98e=_0x1c667c;return _0x1c667c[_0xddbe('0x67')]();}return null;})[_0xddbe('0x21')](function(_0x53c804){if(_0x53c804){if(!_0x53c804[_0xddbe('0x34')]){throw new db[(_0xddbe('0x68'))][(_0xddbe('0x69'))](_0xddbe('0x6a'),0x193);}_0x1dd777=_0x53c804;return db[_0xddbe('0x6b')][_0xddbe('0x3f')]({'raw':!![]});}return null;})[_0xddbe('0x21')](function(_0x1deb68){if(_0x1deb68){_0x16f572=_[_0xddbe('0x6c')](_0x1deb68,'id');var _0xccc82c;var _0x1922e6=squel[_0xddbe('0x6d')]();_0x1922e6[_0xddbe('0x6e')](_0x38e98e[_0xddbe('0x6f')]);for(var _0x490a44=0x0;_0x490a44<_0x1dd777[_0xddbe('0x34')];_0x490a44+=0x1){_0xccc82c=_0x1dd777[_0x490a44]['MetricId']?_0x16f572[_0x1dd777[_0x490a44]['MetricId']][_0xddbe('0x70')]:_0x1dd777[_0x490a44]['field'];_0xccc82c=_0x1dd777[_0x490a44]['function']?_[_0xddbe('0x71')](_0x435f44[_0x1dd777[_0x490a44]['function']],'%s',_0xccc82c):_0xccc82c;_0xccc82c=_0x1dd777[_0x490a44][_0xddbe('0x72')]?_['replace'](_0x1f7412[_0x1dd777[_0x490a44][_0xddbe('0x72')]],'%s',_0xccc82c):_0xccc82c;if(_0x1dd777[_0x490a44][_0xddbe('0x73')]){_0x1922e6[_0xddbe('0x63')](_0xccc82c);}_0x1dd777[_0x490a44][_0xddbe('0x74')]&&_0x1922e6[_0xddbe('0x75')](_0xccc82c,_0x1dd777[_0x490a44]['orderBy']===_0xddbe('0x76')?![]:!![]);_0x1922e6['field'](_0xccc82c,_0x1dd777[_0x490a44][_0xddbe('0x77')]||_0xccc82c);}if(_0x38e98e[_0xddbe('0x78')]){_0x38e98e[_0xddbe('0x78')]=JSON[_0xddbe('0x79')](_0x38e98e[_0xddbe('0x78')]);for(var _0x21d582=0x0;_0x21d582<_0x38e98e[_0xddbe('0x78')]['length'];_0x21d582+=0x1){if(_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x3b')]&&_[_0xddbe('0x5e')](_0x11bad6,_0x38e98e[_0xddbe('0x78')][_0x21d582]['type'])&&_0x38e98e['joins'][_0x21d582][_0xddbe('0x7a')]&&_0x38e98e['joins'][_0x21d582][_0xddbe('0x7b')]&&_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x7c')]){_0x1922e6[_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x3b')]](_0x38e98e[_0xddbe('0x78')][_0x21d582]['foreignTable'],null,util[_0xddbe('0x72')](_0xddbe('0x7d'),_0x38e98e[_0xddbe('0x6f')],_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x7a')],_0x38e98e[_0xddbe('0x78')][_0x21d582]['foreignTable'],_0x38e98e[_0xddbe('0x78')][_0x21d582][_0xddbe('0x7c')]));}}}if(_0x38e98e['conditions']){_0x38e98e[_0xddbe('0x7e')]=JSON['parse'](_0x38e98e[_0xddbe('0x7e')]);_0x1922e6[_0xddbe('0x38')](_0x39e09c(_0x38e98e[_0xddbe('0x7e')]['group']));}_0x5753be=_0x1922e6[_0xddbe('0x7f')]();_0x1922e6[_0xddbe('0x36')](_0x2bdced);_0x1922e6[_0xddbe('0x1a')](0x0);logger[_0xddbe('0x80')](_0xddbe('0x81'),_0x1922e6[_0xddbe('0x82')]());return dbH[_0xddbe('0x83')][_0xddbe('0x2d')](_0x1922e6[_0xddbe('0x82')](),{'type':dbH['sequelize'][_0xddbe('0x84')][_0xddbe('0x85')]});}})[_0xddbe('0x21')](respondWithResult(_0x2812cf,null))[_0xddbe('0x40')](handleError(_0x2812cf,null));};function runReport(_0x5ac0ca,_0x5d42d2,_0x5e8a07){var _0x248a54=_0x5d42d2[_0xddbe('0x26')];var _0x3fe32c=0xa;var _0x201675=[_0xddbe('0x4f'),'left_join',_0xddbe('0x51'),'cross_join'];var _0x15690={'SUM':_0xddbe('0x52'),'COUNT':_0xddbe('0x53'),'COUNT DISTINCT':_0xddbe('0x54'),'MAX':_0xddbe('0x55'),'MIN':_0xddbe('0x56'),'AVG':_0xddbe('0x57'),'GROUP_CONCAT':_0xddbe('0x58'),'GROUP_CONCAT ASC':_0xddbe('0x59'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2225b2={'SEC_TO_TIME':_0xddbe('0x5b'),'DATE':_0xddbe('0x86'),'HOUR':'HOUR(%s)','ROUND':_0xddbe('0x5c'),'UNIX_TIMESTAMP':_0xddbe('0x5d')};var _0x5b555b=function(_0x5b9051){return!_[_0xddbe('0x5e')]([_0xddbe('0x5f'),_0xddbe('0x87'),_0xddbe('0x60'),_0xddbe('0x61')],_0x5b9051);};var _0x467dad=function(_0x570f74){if(!_0x570f74||!_0x570f74[_0xddbe('0x62')][_0xddbe('0x34')]){return'';}for(var _0x4d74ca='(',_0x4c3321=0x0;_0x4c3321<_0x570f74[_0xddbe('0x62')]['length'];_0x4c3321+=0x1){_0x4c3321>0x0&&(_0x4d74ca+='\x20'+_0x570f74['operator']+'\x20');_0x4d74ca+=_0x570f74[_0xddbe('0x62')][_0x4c3321]['group']?_0x467dad(_0x570f74[_0xddbe('0x62')][_0x4c3321]['group']):_0x570f74[_0xddbe('0x62')][_0x4c3321][_0xddbe('0x64')]+'\x20'+_0x570f74[_0xddbe('0x62')][_0x4c3321][_0xddbe('0x65')]+(_0x5b555b(_0x570f74[_0xddbe('0x62')][_0x4c3321]['condition'])?'\x20'+_0x570f74[_0xddbe('0x62')][_0x4c3321][_0xddbe('0x66')]:'');}return _0x4d74ca+')';};var _0x2f8eb4={'where':{'id':_0x5ac0ca['id']}},_0x1940fd,_0x2435f0,_0x543ada,_0x34b12f,_0x5633ba;_0x2f8eb4=_['merge']({},_0x2f8eb4,_0x5e8a07);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x2f8eb4)[_0xddbe('0x21')](function(_0xedda6f){if(_0xedda6f){_0x1940fd=_0xedda6f;return _0xedda6f[_0xddbe('0x67')]();}return null;})['then'](function(_0x577b45){if(_0x577b45){if(!_0x577b45[_0xddbe('0x34')]){throw new db[(_0xddbe('0x68'))][(_0xddbe('0x69'))](_0xddbe('0x6a'),0x193);}_0x2435f0=_0x577b45;return db[_0xddbe('0x6b')][_0xddbe('0x3f')]({'raw':!![]});}return null;})[_0xddbe('0x21')](function(_0x2fe6ac){if(_0x2fe6ac){_0x543ada=_[_0xddbe('0x6c')](_0x2fe6ac,'id');var _0x5b3383;var _0x513632=squel['select']();_0x513632[_0xddbe('0x6e')](_0x1940fd[_0xddbe('0x6f')]);for(var _0x6f45c3=0x0;_0x6f45c3<_0x2435f0['length'];_0x6f45c3+=0x1){_0x5b3383=_0x2435f0[_0x6f45c3][_0xddbe('0x88')]?_0x543ada[_0x2435f0[_0x6f45c3][_0xddbe('0x88')]]['metric']:_0x2435f0[_0x6f45c3][_0xddbe('0x64')];_0x5b3383=_0x2435f0[_0x6f45c3]['function']?_[_0xddbe('0x71')](_0x15690[_0x2435f0[_0x6f45c3][_0xddbe('0x89')]],'%s',_0x5b3383):_0x5b3383;_0x5b3383=_0x2435f0[_0x6f45c3][_0xddbe('0x72')]?_[_0xddbe('0x71')](_0x2225b2[_0x2435f0[_0x6f45c3]['format']],'%s',_0x5b3383):_0x5b3383;if(_0x2435f0[_0x6f45c3][_0xddbe('0x73')]){_0x513632[_0xddbe('0x63')](_0x5b3383);}_0x2435f0[_0x6f45c3][_0xddbe('0x74')]&&_0x513632['order'](_0x5b3383,_0x2435f0[_0x6f45c3]['orderBy']===_0xddbe('0x76')?![]:!![]);_0x513632[_0xddbe('0x64')](_0x5b3383,_0x2435f0[_0x6f45c3]['alias']||_0x5b3383);}if(_0x1940fd[_0xddbe('0x78')]){_0x1940fd[_0xddbe('0x78')]=JSON[_0xddbe('0x79')](_0x1940fd['joins']);for(var _0x69bd29=0x0;_0x69bd29<_0x1940fd[_0xddbe('0x78')]['length'];_0x69bd29+=0x1){if(_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x3b')]&&_['includes'](_0x201675,_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x3b')])&&_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7a')]&&_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7b')]&&_0x1940fd[_0xddbe('0x78')][_0x69bd29]['foreignKey']){_0x513632[_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x3b')]](_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7b')],null,util[_0xddbe('0x72')]('%s.%s\x20=\x20%s.%s',_0x1940fd['table'],_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7a')],_0x1940fd[_0xddbe('0x78')][_0x69bd29]['foreignTable'],_0x1940fd[_0xddbe('0x78')][_0x69bd29][_0xddbe('0x7c')]));}}}if(_0x1940fd[_0xddbe('0x7e')]){_0x1940fd[_0xddbe('0x7e')]=JSON['parse'](_0x1940fd[_0xddbe('0x7e')]);_0x513632['where'](_0x467dad(_0x1940fd['conditions']['group']));}_0x5633ba=_0x513632[_0xddbe('0x7f')]();_0x513632[_0xddbe('0x36')](_0x3fe32c);_0x513632['offset'](0x0);return;}})['then'](function(){if(_0x5d42d2[_0xddbe('0x8a')]==='web'){return null;}var _0x142488=_[_0xddbe('0x3a')](_0x5d42d2,{'name':_0x5d42d2['fullPath']||_0x5d42d2['name']||_0x1940fd[_0xddbe('0x26')],'basename':_0x248a54,'savename':util[_0xddbe('0x72')](_0xddbe('0x8b'),_0x5d42d2[_0xddbe('0x26')]||_0x1940fd[_0xddbe('0x26')],require(_0xddbe('0x8c'))['generate'](0x4),_0x5d42d2[_0xddbe('0x8a')]||_0xddbe('0x8d')),'reportId':_0x1940fd['id'],'reportType':'custom'});return db[_0xddbe('0x8e')][_0xddbe('0x45')](_0x142488,{'raw':!![]});})['then'](function(_0x2f0906){if(_0x1940fd['table']==='cdr'){_0x5633ba[_0xddbe('0x38')](_0x1940fd[_0xddbe('0x6f')]+_0xddbe('0x8f'),_0x5d42d2[_0xddbe('0x90')],_0x5d42d2[_0xddbe('0x91')]);}else{_0x5633ba['where'](_0x1940fd[_0xddbe('0x6f')]+_0xddbe('0x92'),_0x5d42d2['startDate'],_0x5d42d2[_0xddbe('0x91')]);}if(_0x2f0906){logger[_0xddbe('0x93')](_0xddbe('0x94'),_0x5633ba[_0xddbe('0x82')]());require(_0xddbe('0x95'))[_0xddbe('0x96')](path['join'](__dirname,_0xddbe('0x97'),_0x2f0906[_0xddbe('0x8a')]),[_0x2f0906['id'],_0x5633ba['toString'](),path[_0xddbe('0x4f')](__dirname,_0xddbe('0x98'),_0x2f0906[_0xddbe('0x99')]),_0x248a54]);return _0x2f0906;}else{var _0x5d3269=squel[_0xddbe('0x6d')]();_0x5d3269[_0xddbe('0x6e')]('('+_0x5633ba[_0xddbe('0x82')]()+')','countTable');_0x5d3269['field']('COUNT(*)','count');_0x5633ba['limit'](_0x5d42d2['limit']||_0x3fe32c);_0x5633ba['offset'](_0x5d42d2[_0xddbe('0x1a')]||0x0);return dbH['sequelize'][_0xddbe('0x2d')](_0x5d3269[_0xddbe('0x82')](),{'type':dbH[_0xddbe('0x83')][_0xddbe('0x84')]['SELECT']})['then'](function(_0x2d8ae2){if(!_0x2d8ae2[_0xddbe('0x34')]){_0x34b12f=0x0;}else{_0x34b12f=_0x2d8ae2[0x0][_0xddbe('0x1c')]||0x0;}return dbH[_0xddbe('0x83')][_0xddbe('0x2d')](_0x5633ba['toString'](),{'type':dbH[_0xddbe('0x83')][_0xddbe('0x84')]['SELECT']});})[_0xddbe('0x21')](function(_0x1df444){return{'rows':_0x1df444||[],'count':_0x34b12f};});}});}exports[_0xddbe('0x9a')]=function(_0x1d02de,_0x255df6){return runReport(_0x1d02de[_0xddbe('0x41')],_0x1d02de['query'],_0x1d02de[_0xddbe('0x3d')])['then'](respondWithResult(_0x255df6,null))[_0xddbe('0x40')](handleError(_0x255df6,null));};exports[_0xddbe('0x9b')]=runReport;exports[_0xddbe('0x2d')]=function(_0x22a8bb,_0x40d4fa){var _0x4a9ab5=0xa;var _0x20ea2a=[_0xddbe('0x4f'),_0xddbe('0x50'),_0xddbe('0x51'),_0xddbe('0x9c')];var _0x2ebb11={'SUM':_0xddbe('0x52'),'COUNT':_0xddbe('0x53'),'COUNT DISTINCT':_0xddbe('0x54'),'MAX':'MAX(%s)','MIN':_0xddbe('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xddbe('0x59'),'GROUP_CONCAT DESC':_0xddbe('0x5a')};var _0x3aa9d3={'SEC_TO_TIME':_0xddbe('0x5b'),'DATE':_0xddbe('0x86'),'HOUR':_0xddbe('0x9d'),'ROUND':_0xddbe('0x5c'),'UNIX_TIMESTAMP':_0xddbe('0x5d')};var _0x418c81=function(_0x1eff51){return!_[_0xddbe('0x5e')]([_0xddbe('0x5f'),_0xddbe('0x87'),_0xddbe('0x60'),'IS\x20NOT\x20EMPTY'],_0x1eff51);};var _0x101388=function(_0x1e9d60){if(!_0x1e9d60||!_0x1e9d60[_0xddbe('0x62')][_0xddbe('0x34')]){return'';}for(var _0x428607='(',_0x2e0211=0x0;_0x2e0211<_0x1e9d60['rules'][_0xddbe('0x34')];_0x2e0211+=0x1){_0x2e0211>0x0&&(_0x428607+='\x20'+_0x1e9d60['operator']+'\x20');_0x428607+=_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x63')]?_0x101388(_0x1e9d60[_0xddbe('0x62')][_0x2e0211]['group']):_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x64')]+'\x20'+_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x65')]+(_0x418c81(_0x1e9d60['rules'][_0x2e0211]['condition'])?'\x20'+_0x1e9d60[_0xddbe('0x62')][_0x2e0211][_0xddbe('0x66')]:'');}return _0x428607+')';};var _0x53fe2d={'where':{'id':_0x22a8bb[_0xddbe('0x41')]['id']}},_0x3dfbc1,_0x5dd3ae,_0x1ebef7,_0x4f5371,_0x10a8ac;_0x53fe2d=_[_0xddbe('0x3a')]({},_0x53fe2d,_0x22a8bb['options']);return db[_0xddbe('0x2a')][_0xddbe('0x44')](_0x53fe2d)[_0xddbe('0x21')](function(_0x363a3d){if(_0x363a3d){_0x3dfbc1=_0x363a3d;return _0x363a3d[_0xddbe('0x67')]();}return null;})[_0xddbe('0x21')](function(_0x2ef285){if(_0x2ef285){if(!_0x2ef285['length']){throw new db['Sequelize'][(_0xddbe('0x69'))](_0xddbe('0x6a'),0x193);}_0x5dd3ae=_0x2ef285;return db[_0xddbe('0x6b')][_0xddbe('0x3f')]({'raw':!![]});}return null;})[_0xddbe('0x21')](function(_0x192cf4){if(_0x192cf4){_0x1ebef7=_[_0xddbe('0x6c')](_0x192cf4,'id');var _0x273d16;var _0x2297ff=squel[_0xddbe('0x6d')]();_0x2297ff['from'](_0x3dfbc1[_0xddbe('0x6f')]);for(var _0x48207e=0x0;_0x48207e<_0x5dd3ae[_0xddbe('0x34')];_0x48207e+=0x1){_0x273d16=_0x5dd3ae[_0x48207e][_0xddbe('0x88')]?_0x1ebef7[_0x5dd3ae[_0x48207e][_0xddbe('0x88')]][_0xddbe('0x70')]:_0x5dd3ae[_0x48207e][_0xddbe('0x64')];_0x273d16=_0x5dd3ae[_0x48207e][_0xddbe('0x89')]?_[_0xddbe('0x71')](_0x2ebb11[_0x5dd3ae[_0x48207e][_0xddbe('0x89')]],'%s',_0x273d16):_0x273d16;_0x273d16=_0x5dd3ae[_0x48207e]['format']?_[_0xddbe('0x71')](_0x3aa9d3[_0x5dd3ae[_0x48207e][_0xddbe('0x72')]],'%s',_0x273d16):_0x273d16;if(_0x5dd3ae[_0x48207e][_0xddbe('0x73')]){_0x2297ff[_0xddbe('0x63')](_0x273d16);}_0x5dd3ae[_0x48207e]['orderBy']&&_0x2297ff[_0xddbe('0x75')](_0x273d16,_0x5dd3ae[_0x48207e][_0xddbe('0x74')]===_0xddbe('0x76')?![]:!![]);_0x2297ff[_0xddbe('0x64')](_0x273d16,_0x5dd3ae[_0x48207e][_0xddbe('0x77')]||_0x273d16);}if(_0x3dfbc1[_0xddbe('0x78')]){_0x3dfbc1[_0xddbe('0x78')]=JSON[_0xddbe('0x79')](_0x3dfbc1[_0xddbe('0x78')]);for(var _0x1f240f=0x0;_0x1f240f<_0x3dfbc1[_0xddbe('0x78')]['length'];_0x1f240f+=0x1){if(_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x3b')]&&_[_0xddbe('0x5e')](_0x20ea2a,_0x3dfbc1['joins'][_0x1f240f]['type'])&&_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7a')]&&_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7b')]&&_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7c')]){_0x2297ff[_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x3b')]](_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7b')],null,util[_0xddbe('0x72')](_0xddbe('0x7d'),_0x3dfbc1['table'],_0x3dfbc1[_0xddbe('0x78')][_0x1f240f]['parentKey'],_0x3dfbc1[_0xddbe('0x78')][_0x1f240f]['foreignTable'],_0x3dfbc1[_0xddbe('0x78')][_0x1f240f][_0xddbe('0x7c')]));}}}if(_0x3dfbc1[_0xddbe('0x7e')]){_0x3dfbc1[_0xddbe('0x7e')]=JSON[_0xddbe('0x79')](_0x3dfbc1[_0xddbe('0x7e')]);_0x2297ff[_0xddbe('0x38')](_0x101388(_0x3dfbc1[_0xddbe('0x7e')][_0xddbe('0x63')]));}_0x10a8ac=_0x2297ff['clone']();_0x2297ff[_0xddbe('0x36')](_0x4a9ab5);_0x2297ff[_0xddbe('0x1a')](0x0);logger[_0xddbe('0x80')]('Limited\x20Query:',_0x2297ff[_0xddbe('0x82')]());return dbH['sequelize'][_0xddbe('0x2d')](_0x2297ff[_0xddbe('0x82')](),{'type':dbH[_0xddbe('0x83')][_0xddbe('0x84')]['SELECT']});}})['then'](function(){return{'sql':_0x10a8ac[_0xddbe('0x82')]()};})[_0xddbe('0x21')](respondWithResult(_0x40d4fa,null))[_0xddbe('0x40')](handleError(_0x40d4fa,null));}; \ No newline at end of file +var _0x95c3=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','select','output','web','fullPath','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','groupBy','Limited\x20Query:','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x29ce11,_0x3887ab){var _0x255fa8=function(_0x4b5475){while(--_0x4b5475){_0x29ce11['push'](_0x29ce11['shift']());}};_0x255fa8(++_0x3887ab);}(_0x95c3,0x6d));var _0x395c=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x95c3[_0x52f1e6];return _0x21f104;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x395c('0x0'));var jsonpatch=require(_0x395c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x395c('0x2'));var Mustache=require(_0x395c('0x3'));var util=require(_0x395c('0x4'));var path=require(_0x395c('0x5'));var sox=require(_0x395c('0x6'));var csv=require('to-csv');var ejs=require(_0x395c('0x7'));var fs=require('fs');var fs_extra=require(_0x395c('0x8'));var _=require(_0x395c('0x9'));var squel=require(_0x395c('0xa'));var crypto=require(_0x395c('0xb'));var jsforce=require(_0x395c('0xc'));var deskjs=require(_0x395c('0xd'));var toCsv=require(_0x395c('0xe'));var querystring=require(_0x395c('0xf'));var Papa=require(_0x395c('0x10'));var Redis=require(_0x395c('0x11'));var authService=require(_0x395c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x395c('0x13'));var hardwareService=require(_0x395c('0x14'));var logger=require(_0x395c('0x15'))(_0x395c('0x16'));var utils=require('../../config/utils');var config=require(_0x395c('0x17'));var licenseUtil=require(_0x395c('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x395c('0x19'))[_0x395c('0x1a')];function respondWithStatusCode(_0x2d5125,_0x3cba31){_0x3cba31=_0x3cba31||0xcc;return function(_0x4ffd1f){if(_0x4ffd1f){return _0x2d5125[_0x395c('0x1b')](_0x3cba31);}return _0x2d5125['status'](_0x3cba31)['end']();};}function respondWithResult(_0x493e3b,_0x3173d9){_0x3173d9=_0x3173d9||0xc8;return function(_0x134bf5){if(_0x134bf5){return _0x493e3b[_0x395c('0x1c')](_0x3173d9)[_0x395c('0x1d')](_0x134bf5);}};}function respondWithFilteredResult(_0x2a60d6,_0x5e498e){return function(_0x24b7ba){if(_0x24b7ba){var _0x265c93=typeof _0x5e498e[_0x395c('0x1e')]===_0x395c('0x1f')&&typeof _0x5e498e[_0x395c('0x20')]===_0x395c('0x1f');var _0x55516b=_0x24b7ba['count'];var _0x202efc=_0x265c93?0x0:_0x5e498e[_0x395c('0x1e')];var _0xefe87b=_0x265c93?_0x24b7ba[_0x395c('0x21')]:_0x5e498e[_0x395c('0x1e')]+_0x5e498e['limit'];var _0x5b117e;if(_0xefe87b>=_0x55516b){_0xefe87b=_0x55516b;_0x5b117e=0xc8;}else{_0x5b117e=0xce;}_0x2a60d6[_0x395c('0x1c')](_0x5b117e);return _0x2a60d6[_0x395c('0x22')](_0x395c('0x23'),_0x202efc+'-'+_0xefe87b+'/'+_0x55516b)[_0x395c('0x1d')](_0x24b7ba);}return null;};}function patchUpdates(_0x164628){return function(_0x1c2e7a){try{jsonpatch[_0x395c('0x24')](_0x1c2e7a,_0x164628,!![]);}catch(_0x2c3882){return BPromise[_0x395c('0x25')](_0x2c3882);}return _0x1c2e7a[_0x395c('0x26')]();};}function saveUpdates(_0x160e3b,_0x30eeec){return function(_0x41d2ae){if(_0x41d2ae){return _0x41d2ae[_0x395c('0x27')](_0x160e3b)[_0x395c('0x28')](function(_0x520ee6){return _0x520ee6;});}return null;};}function removeEntity(_0x404384,_0x221350){return function(_0x56faad){if(_0x56faad){return _0x56faad[_0x395c('0x29')]()[_0x395c('0x28')](function(){var _0x6e557f=_0x56faad['get']({'plain':!![]});var _0x977443=_0x395c('0x2a');return db[_0x395c('0x2b')][_0x395c('0x29')]({'where':{'type':_0x977443,'resourceId':_0x6e557f['id']}})[_0x395c('0x28')](function(){return _0x56faad;});})['then'](function(){_0x404384[_0x395c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4b54,_0x328a2c){return function(_0xc609e5){if(!_0xc609e5){_0x2d4b54[_0x395c('0x1b')](0x194);}return _0xc609e5;};}function handleError(_0x1c33f4,_0x26343c){_0x26343c=_0x26343c||0x1f4;return function(_0x393c50){logger[_0x395c('0x2c')](_0x393c50[_0x395c('0x2d')]);if(_0x393c50['name']){delete _0x393c50[_0x395c('0x2e')];}_0x1c33f4[_0x395c('0x1c')](_0x26343c)['send'](_0x393c50);};}exports[_0x395c('0x2f')]=function(_0x2625b7,_0xdb4d05){var _0x453680={},_0x3f6a1d={},_0x3130ad={'count':0x0,'rows':[]};var _0x5159ab=_[_0x395c('0x30')](db['AnalyticCustomReport'][_0x395c('0x31')],function(_0x4189b4){return{'name':_0x4189b4[_0x395c('0x32')],'type':_0x4189b4['type']['key']};});_0x3f6a1d[_0x395c('0x33')]=_[_0x395c('0x30')](_0x5159ab,'name');_0x3f6a1d[_0x395c('0x34')]=_[_0x395c('0x35')](_0x2625b7[_0x395c('0x34')]);_0x3f6a1d[_0x395c('0x36')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],_0x3f6a1d[_0x395c('0x34')]);_0x453680[_0x395c('0x38')]=_[_0x395c('0x37')](_0x3f6a1d[_0x395c('0x33')],qs[_0x395c('0x39')](_0x2625b7[_0x395c('0x34')][_0x395c('0x39')]));_0x453680[_0x395c('0x38')]=_0x453680['attributes']['length']?_0x453680[_0x395c('0x38')]:_0x3f6a1d[_0x395c('0x33')];if(!_0x2625b7[_0x395c('0x34')][_0x395c('0x3a')](_0x395c('0x3b'))){_0x453680[_0x395c('0x20')]=qs[_0x395c('0x20')](_0x2625b7['query'][_0x395c('0x20')]);_0x453680[_0x395c('0x1e')]=qs[_0x395c('0x1e')](_0x2625b7['query'][_0x395c('0x1e')]);}_0x453680[_0x395c('0x3c')]=qs[_0x395c('0x3d')](_0x2625b7['query']['sort']);_0x453680[_0x395c('0x3e')]=qs['filters'](_[_0x395c('0x3f')](_0x2625b7[_0x395c('0x34')],_0x3f6a1d[_0x395c('0x36')]),_0x5159ab);if(_0x2625b7['query']['filter']){_0x453680[_0x395c('0x3e')]=_[_0x395c('0x40')](_0x453680['where'],{'$or':_['map'](_0x5159ab,function(_0x1028d5){if(_0x1028d5[_0x395c('0x41')]!==_0x395c('0x42')){var _0x181e33={};_0x181e33[_0x1028d5[_0x395c('0x2e')]]={'$like':'%'+_0x2625b7[_0x395c('0x34')]['filter']+'%'};return _0x181e33;}})});}_0x453680=_['merge']({},_0x453680,_0x2625b7[_0x395c('0x43')]);var _0x22d7aa={'where':_0x453680[_0x395c('0x3e')]};return db['AnalyticCustomReport'][_0x395c('0x21')](_0x22d7aa)['then'](function(_0x3421f8){_0x3130ad[_0x395c('0x21')]=_0x3421f8;if(_0x2625b7['query'][_0x395c('0x44')]){_0x453680[_0x395c('0x45')]=[{'all':!![]}];}return db[_0x395c('0x46')][_0x395c('0x47')](_0x453680);})[_0x395c('0x28')](function(_0x8474af){_0x3130ad[_0x395c('0x48')]=_0x8474af;return _0x3130ad;})[_0x395c('0x28')](respondWithFilteredResult(_0xdb4d05,_0x453680))[_0x395c('0x49')](handleError(_0xdb4d05,null));};exports[_0x395c('0x4a')]=function(_0x3c59a2,_0x5dfba4){var _0x4b47d9={'raw':![],'where':{'id':_0x3c59a2['params']['id']}},_0x596819={};_0x596819[_0x395c('0x33')]=_[_0x395c('0x35')](db[_0x395c('0x46')][_0x395c('0x31')]);_0x596819[_0x395c('0x34')]=_['keys'](_0x3c59a2['query']);_0x596819[_0x395c('0x36')]=_['intersection'](_0x596819[_0x395c('0x33')],_0x596819[_0x395c('0x34')]);_0x4b47d9[_0x395c('0x38')]=_[_0x395c('0x37')](_0x596819[_0x395c('0x33')],qs[_0x395c('0x39')](_0x3c59a2[_0x395c('0x34')][_0x395c('0x39')]));_0x4b47d9[_0x395c('0x38')]=_0x4b47d9['attributes'][_0x395c('0x4b')]?_0x4b47d9[_0x395c('0x38')]:_0x596819[_0x395c('0x33')];if(_0x3c59a2[_0x395c('0x34')][_0x395c('0x44')]){_0x4b47d9[_0x395c('0x45')]=[{'all':!![]}];}_0x4b47d9=_['merge']({},_0x4b47d9,_0x3c59a2[_0x395c('0x43')]);return db['AnalyticCustomReport'][_0x395c('0x4c')](_0x4b47d9)['then'](handleEntityNotFound(_0x5dfba4,null))['then'](respondWithResult(_0x5dfba4,null))[_0x395c('0x49')](handleError(_0x5dfba4,null));};exports[_0x395c('0x4d')]=function(_0x432cb4,_0x2a4979){return db[_0x395c('0x46')][_0x395c('0x4d')](_0x432cb4[_0x395c('0x4e')],{})[_0x395c('0x28')](function(_0x1c6520){var _0x4a053f=_0x432cb4['user']['get']({'plain':!![]});if(!_0x4a053f)throw new Error(_0x395c('0x4f'));if(_0x4a053f[_0x395c('0x50')]===_0x395c('0x51')){var _0x52f975=_0x1c6520[_0x395c('0x52')]({'plain':!![]});var _0x3710ed=_0x395c('0x53');return db['UserProfileSection'][_0x395c('0x4c')]({'where':{'name':_0x3710ed,'userProfileId':_0x4a053f['userProfileId']},'raw':!![]})[_0x395c('0x28')](function(_0x47735e){if(_0x47735e&&_0x47735e[_0x395c('0x54')]===0x0){return db[_0x395c('0x2b')]['create']({'name':_0x52f975[_0x395c('0x2e')],'resourceId':_0x52f975['id'],'type':_0x395c('0x2a'),'sectionId':_0x47735e['id']},{})['then'](function(){return _0x1c6520;});}else{return _0x1c6520;}})['catch'](function(_0x535cc1){logger['error'](_0x395c('0x55'),_0x535cc1);throw _0x535cc1;});}return _0x1c6520;})[_0x395c('0x28')](respondWithResult(_0x2a4979,0xc9))['catch'](handleError(_0x2a4979,null));};exports['update']=function(_0x5a8889,_0x31f41b){if(_0x5a8889['body']['id']){delete _0x5a8889[_0x395c('0x4e')]['id'];}return db[_0x395c('0x46')][_0x395c('0x4c')]({'where':{'id':_0x5a8889['params']['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x31f41b,null))[_0x395c('0x28')](saveUpdates(_0x5a8889[_0x395c('0x4e')],null))['then'](respondWithResult(_0x31f41b,null))['catch'](handleError(_0x31f41b,null));};exports[_0x395c('0x29')]=function(_0x4e7928,_0x5dde80){return db['AnalyticCustomReport'][_0x395c('0x4c')]({'where':{'id':_0x4e7928[_0x395c('0x56')]['id']}})[_0x395c('0x28')](handleEntityNotFound(_0x5dde80,null))[_0x395c('0x28')](removeEntity(_0x5dde80,null))[_0x395c('0x49')](handleError(_0x5dde80,null));};exports[_0x395c('0x57')]=function(_0x4a319e,_0x351f54){var _0x455648=0xa;var _0x59d63f=[_0x395c('0x58'),_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0x240f99={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x395c('0x5c'),'MAX':_0x395c('0x5d'),'MIN':_0x395c('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1cee20={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x32c356=function(_0x156ace){return!_[_0x395c('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x395c('0x66')],_0x156ace);};var _0x208d6d=function(_0xbb1a7){if(!_0xbb1a7||!_0xbb1a7['rules'][_0x395c('0x4b')]){return'';}for(var _0x272e13='(',_0x136fca=0x0;_0x136fca<_0xbb1a7[_0x395c('0x67')]['length'];_0x136fca+=0x1){_0x136fca>0x0&&(_0x272e13+='\x20'+_0xbb1a7[_0x395c('0x68')]+'\x20');_0x272e13+=_0xbb1a7[_0x395c('0x67')][_0x136fca]['group']?_0x208d6d(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x69')]):_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6a')]+'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')]+(_0x32c356(_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6b')])?'\x20'+_0xbb1a7[_0x395c('0x67')][_0x136fca][_0x395c('0x6c')]:'');}return _0x272e13+')';};var _0x3bda2a={'where':{'id':_0x4a319e[_0x395c('0x56')]['id']}},_0x227331,_0x3daee5,_0x353b19,_0x3cdb8f,_0x34f5b3;_0x3bda2a=_['merge']({},_0x3bda2a,_0x4a319e[_0x395c('0x43')]);return db[_0x395c('0x46')]['find'](_0x3bda2a)[_0x395c('0x28')](function(_0x2c02ef){if(_0x2c02ef){_0x227331=_0x2c02ef;return _0x2c02ef[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x566612){if(_0x566612){if(!_0x566612['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3daee5=_0x566612;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xd72304){if(_0xd72304){_0x353b19=_[_0x395c('0x71')](_0xd72304,'id');var _0xa8d112;var _0x21a9a=squel['select']();_0x21a9a[_0x395c('0x72')](_0x227331['table']);for(var _0xd2bef9=0x0;_0xd2bef9<_0x3daee5[_0x395c('0x4b')];_0xd2bef9+=0x1){_0xa8d112=_0x3daee5[_0xd2bef9]['MetricId']?_0x353b19[_0x3daee5[_0xd2bef9][_0x395c('0x73')]][_0x395c('0x74')]:_0x3daee5[_0xd2bef9][_0x395c('0x6a')];_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x75')]?_[_0x395c('0x76')](_0x240f99[_0x3daee5[_0xd2bef9][_0x395c('0x75')]],'%s',_0xa8d112):_0xa8d112;_0xa8d112=_0x3daee5[_0xd2bef9][_0x395c('0x77')]?_[_0x395c('0x76')](_0x1cee20[_0x3daee5[_0xd2bef9][_0x395c('0x77')]],'%s',_0xa8d112):_0xa8d112;if(_0x3daee5[_0xd2bef9]['groupBy']){_0x21a9a[_0x395c('0x69')](_0xa8d112);}_0x3daee5[_0xd2bef9]['orderBy']&&_0x21a9a[_0x395c('0x3c')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x78')]===_0x395c('0x79')?![]:!![]);_0x21a9a[_0x395c('0x6a')](_0xa8d112,_0x3daee5[_0xd2bef9][_0x395c('0x7a')]||_0xa8d112);}if(_0x227331[_0x395c('0x7b')]){_0x227331[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x7b')]);for(var _0xe4c769=0x0;_0xe4c769<_0x227331['joins'][_0x395c('0x4b')];_0xe4c769+=0x1){if(_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x59d63f,_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')])&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7d')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')]&&_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]){_0x21a9a[_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x41')]](_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x227331[_0x395c('0x81')],_0x227331['joins'][_0xe4c769][_0x395c('0x7d')],_0x227331['joins'][_0xe4c769]['foreignTable'],_0x227331[_0x395c('0x7b')][_0xe4c769][_0x395c('0x7f')]));}}}if(_0x227331[_0x395c('0x82')]){_0x227331[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x227331[_0x395c('0x82')]);_0x21a9a[_0x395c('0x3e')](_0x208d6d(_0x227331[_0x395c('0x82')][_0x395c('0x69')]));}_0x34f5b3=_0x21a9a[_0x395c('0x83')]();_0x21a9a[_0x395c('0x20')](_0x455648);_0x21a9a[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')]('Limited\x20Query:',_0x21a9a[_0x395c('0x85')]());return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x21a9a[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](respondWithResult(_0x351f54,null))[_0x395c('0x49')](handleError(_0x351f54,null));};function runReport(_0x52faf5,_0x429758,_0x30c58d){var _0x3430f0=_0x429758[_0x395c('0x2e')];var _0x355de9=0xa;var _0x2132af=[_0x395c('0x58'),_0x395c('0x59'),'right_join',_0x395c('0x5b')];var _0x5c3d60={'SUM':'SUM(%s)','COUNT':_0x395c('0x89'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x395c('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':_0x395c('0x8b')};var _0x261770={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x504672=function(_0x1c8ecb){return!_['includes'](['IS\x20NULL',_0x395c('0x8c'),'IS\x20EMPTY',_0x395c('0x66')],_0x1c8ecb);};var _0x117d2c=function(_0x2e9031){if(!_0x2e9031||!_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x5ed96f='(',_0xf2e9dd=0x0;_0xf2e9dd<_0x2e9031[_0x395c('0x67')][_0x395c('0x4b')];_0xf2e9dd+=0x1){_0xf2e9dd>0x0&&(_0x5ed96f+='\x20'+_0x2e9031['operator']+'\x20');_0x5ed96f+=_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x69')]?_0x117d2c(_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x69')]):_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6a')]+'\x20'+_0x2e9031[_0x395c('0x67')][_0xf2e9dd][_0x395c('0x6b')]+(_0x504672(_0x2e9031[_0x395c('0x67')][_0xf2e9dd]['condition'])?'\x20'+_0x2e9031['rules'][_0xf2e9dd][_0x395c('0x6c')]:'');}return _0x5ed96f+')';};var _0x706699={'where':{'id':_0x52faf5['id']}},_0x465df4,_0x2de332,_0x391be6,_0x3fa8cf,_0x20c968;_0x706699=_[_0x395c('0x40')]({},_0x706699,_0x30c58d);return db[_0x395c('0x46')][_0x395c('0x4c')](_0x706699)[_0x395c('0x28')](function(_0x10d1f8){if(_0x10d1f8){_0x465df4=_0x10d1f8;return _0x10d1f8[_0x395c('0x6d')]();}return null;})[_0x395c('0x28')](function(_0x126f6c){if(_0x126f6c){if(!_0x126f6c['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2de332=_0x126f6c;return db[_0x395c('0x70')]['findAll']({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0xe8d66c){if(_0xe8d66c){_0x391be6=_[_0x395c('0x71')](_0xe8d66c,'id');var _0x516bad;var _0x52ecbf=squel[_0x395c('0x8e')]();_0x52ecbf[_0x395c('0x72')](_0x465df4['table']);for(var _0x46a431=0x0;_0x46a431<_0x2de332['length'];_0x46a431+=0x1){_0x516bad=_0x2de332[_0x46a431][_0x395c('0x73')]?_0x391be6[_0x2de332[_0x46a431][_0x395c('0x73')]]['metric']:_0x2de332[_0x46a431][_0x395c('0x6a')];_0x516bad=_0x2de332[_0x46a431]['function']?_[_0x395c('0x76')](_0x5c3d60[_0x2de332[_0x46a431]['function']],'%s',_0x516bad):_0x516bad;_0x516bad=_0x2de332[_0x46a431][_0x395c('0x77')]?_[_0x395c('0x76')](_0x261770[_0x2de332[_0x46a431][_0x395c('0x77')]],'%s',_0x516bad):_0x516bad;if(_0x2de332[_0x46a431]['groupBy']){_0x52ecbf['group'](_0x516bad);}_0x2de332[_0x46a431][_0x395c('0x78')]&&_0x52ecbf[_0x395c('0x3c')](_0x516bad,_0x2de332[_0x46a431]['orderBy']===_0x395c('0x79')?![]:!![]);_0x52ecbf[_0x395c('0x6a')](_0x516bad,_0x2de332[_0x46a431]['alias']||_0x516bad);}if(_0x465df4['joins']){_0x465df4[_0x395c('0x7b')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x7b')]);for(var _0x38dc7b=0x0;_0x38dc7b<_0x465df4[_0x395c('0x7b')][_0x395c('0x4b')];_0x38dc7b+=0x1){if(_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]&&_[_0x395c('0x65')](_0x2132af,_0x465df4['joins'][_0x38dc7b][_0x395c('0x41')])&&_0x465df4[_0x395c('0x7b')][_0x38dc7b]['parentKey']&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')]&&_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7f')]){_0x52ecbf[_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x41')]](_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignTable'],null,util[_0x395c('0x77')]('%s.%s\x20=\x20%s.%s',_0x465df4['table'],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7d')],_0x465df4[_0x395c('0x7b')][_0x38dc7b][_0x395c('0x7e')],_0x465df4[_0x395c('0x7b')][_0x38dc7b]['foreignKey']));}}}if(_0x465df4[_0x395c('0x82')]){_0x465df4[_0x395c('0x82')]=JSON[_0x395c('0x7c')](_0x465df4[_0x395c('0x82')]);_0x52ecbf['where'](_0x117d2c(_0x465df4['conditions']['group']));}_0x20c968=_0x52ecbf['clone']();_0x52ecbf[_0x395c('0x20')](_0x355de9);_0x52ecbf[_0x395c('0x1e')](0x0);return;}})['then'](function(){if(_0x429758[_0x395c('0x8f')]===_0x395c('0x90')){return null;}var _0x67fcf4=_[_0x395c('0x40')](_0x429758,{'name':_0x429758[_0x395c('0x91')]||_0x429758[_0x395c('0x2e')]||_0x465df4['name'],'basename':_0x3430f0,'savename':util[_0x395c('0x77')]('%s-%s.%s',_0x429758['name']||_0x465df4[_0x395c('0x2e')],require(_0x395c('0x92'))['generate'](0x4),_0x429758['output']||_0x395c('0x93')),'reportId':_0x465df4['id'],'reportType':_0x395c('0x94')});return db['AnalyticExtractedReport'][_0x395c('0x4d')](_0x67fcf4,{'raw':!![]});})[_0x395c('0x28')](function(_0x28098f){if(_0x465df4['table']===_0x395c('0x95')){_0x20c968[_0x395c('0x3e')](_0x465df4[_0x395c('0x81')]+_0x395c('0x96'),_0x429758[_0x395c('0x97')],_0x429758[_0x395c('0x98')]);}else{_0x20c968['where'](_0x465df4[_0x395c('0x81')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x429758[_0x395c('0x97')],_0x429758['endDate']);}if(_0x28098f){logger[_0x395c('0x99')](_0x395c('0x9a'),_0x20c968[_0x395c('0x85')]());require(_0x395c('0x9b'))[_0x395c('0x9c')](path['join'](__dirname,_0x395c('0x9d'),_0x28098f['output']),[_0x28098f['id'],_0x20c968['toString'](),path[_0x395c('0x58')](__dirname,'../../files/reports',_0x28098f[_0x395c('0x9e')]),_0x3430f0]);return _0x28098f;}else{var _0x260ea1=squel[_0x395c('0x8e')]();_0x260ea1[_0x395c('0x72')]('('+_0x20c968[_0x395c('0x85')]()+')',_0x395c('0x9f'));_0x260ea1['field'](_0x395c('0xa0'),_0x395c('0x21'));_0x20c968['limit'](_0x429758[_0x395c('0x20')]||_0x355de9);_0x20c968['offset'](_0x429758['offset']||0x0);return dbH[_0x395c('0x86')][_0x395c('0x34')](_0x260ea1[_0x395c('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0x395c('0x88')]})[_0x395c('0x28')](function(_0x541db6){if(!_0x541db6[_0x395c('0x4b')]){_0x3fa8cf=0x0;}else{_0x3fa8cf=_0x541db6[0x0][_0x395c('0x21')]||0x0;}return dbH['sequelize'][_0x395c('0x34')](_0x20c968[_0x395c('0x85')](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')]['SELECT']});})['then'](function(_0x5f4be7){return{'rows':_0x5f4be7||[],'count':_0x3fa8cf};});}});}exports[_0x395c('0xa1')]=function(_0x4a7bf5,_0x27d594){return runReport(_0x4a7bf5[_0x395c('0x56')],_0x4a7bf5[_0x395c('0x34')],_0x4a7bf5[_0x395c('0x43')])[_0x395c('0x28')](respondWithResult(_0x27d594,null))[_0x395c('0x49')](handleError(_0x27d594,null));};exports['runReport']=runReport;exports['query']=function(_0x4bc3ab,_0x39ef20){var _0x20b9d1=0xa;var _0x23635d=['join',_0x395c('0x59'),_0x395c('0x5a'),_0x395c('0x5b')];var _0xb51bff={'SUM':_0x395c('0xa2'),'COUNT':_0x395c('0x89'),'COUNT DISTINCT':_0x395c('0x5c'),'MAX':'MAX(%s)','MIN':_0x395c('0x5e'),'AVG':_0x395c('0x8a'),'GROUP_CONCAT':_0x395c('0x5f'),'GROUP_CONCAT ASC':_0x395c('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x441b08={'SEC_TO_TIME':_0x395c('0xa3'),'DATE':_0x395c('0x61'),'HOUR':_0x395c('0x62'),'ROUND':_0x395c('0x63'),'UNIX_TIMESTAMP':_0x395c('0x64')};var _0x19fe31=function(_0x1e199c){return!_[_0x395c('0x65')]([_0x395c('0xa4'),_0x395c('0x8c'),_0x395c('0xa5'),'IS\x20NOT\x20EMPTY'],_0x1e199c);};var _0x4bd290=function(_0x1e9560){if(!_0x1e9560||!_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')]){return'';}for(var _0x57c75e='(',_0x18bae9=0x0;_0x18bae9<_0x1e9560[_0x395c('0x67')][_0x395c('0x4b')];_0x18bae9+=0x1){_0x18bae9>0x0&&(_0x57c75e+='\x20'+_0x1e9560['operator']+'\x20');_0x57c75e+=_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]?_0x4bd290(_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x69')]):_0x1e9560[_0x395c('0x67')][_0x18bae9]['field']+'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6b')]+(_0x19fe31(_0x1e9560['rules'][_0x18bae9][_0x395c('0x6b')])?'\x20'+_0x1e9560[_0x395c('0x67')][_0x18bae9][_0x395c('0x6c')]:'');}return _0x57c75e+')';};var _0x58b238={'where':{'id':_0x4bc3ab[_0x395c('0x56')]['id']}},_0x2c235b,_0x2264d9,_0x203dbd,_0x5043f9,_0x320baf;_0x58b238=_[_0x395c('0x40')]({},_0x58b238,_0x4bc3ab[_0x395c('0x43')]);return db['AnalyticCustomReport']['find'](_0x58b238)['then'](function(_0x3e90e3){if(_0x3e90e3){_0x2c235b=_0x3e90e3;return _0x3e90e3['getFields']();}return null;})[_0x395c('0x28')](function(_0xefad23){if(_0xefad23){if(!_0xefad23['length']){throw new db[(_0x395c('0x6e'))][(_0x395c('0x6f'))](_0x395c('0x8d'),0x193);}_0x2264d9=_0xefad23;return db[_0x395c('0x70')][_0x395c('0x47')]({'raw':!![]});}return null;})[_0x395c('0x28')](function(_0x468ffa){if(_0x468ffa){_0x203dbd=_[_0x395c('0x71')](_0x468ffa,'id');var _0x53f6e7;var _0x2b4696=squel[_0x395c('0x8e')]();_0x2b4696[_0x395c('0x72')](_0x2c235b[_0x395c('0x81')]);for(var _0x2ac5d5=0x0;_0x2ac5d5<_0x2264d9[_0x395c('0x4b')];_0x2ac5d5+=0x1){_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x73')]?_0x203dbd[_0x2264d9[_0x2ac5d5][_0x395c('0x73')]][_0x395c('0x74')]:_0x2264d9[_0x2ac5d5][_0x395c('0x6a')];_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x75')]?_[_0x395c('0x76')](_0xb51bff[_0x2264d9[_0x2ac5d5][_0x395c('0x75')]],'%s',_0x53f6e7):_0x53f6e7;_0x53f6e7=_0x2264d9[_0x2ac5d5][_0x395c('0x77')]?_[_0x395c('0x76')](_0x441b08[_0x2264d9[_0x2ac5d5][_0x395c('0x77')]],'%s',_0x53f6e7):_0x53f6e7;if(_0x2264d9[_0x2ac5d5][_0x395c('0xa6')]){_0x2b4696[_0x395c('0x69')](_0x53f6e7);}_0x2264d9[_0x2ac5d5][_0x395c('0x78')]&&_0x2b4696['order'](_0x53f6e7,_0x2264d9[_0x2ac5d5]['orderBy']===_0x395c('0x79')?![]:!![]);_0x2b4696[_0x395c('0x6a')](_0x53f6e7,_0x2264d9[_0x2ac5d5][_0x395c('0x7a')]||_0x53f6e7);}if(_0x2c235b[_0x395c('0x7b')]){_0x2c235b['joins']=JSON[_0x395c('0x7c')](_0x2c235b['joins']);for(var _0x84ea7f=0x0;_0x84ea7f<_0x2c235b['joins'][_0x395c('0x4b')];_0x84ea7f+=0x1){if(_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')]&&_['includes'](_0x23635d,_0x2c235b[_0x395c('0x7b')][_0x84ea7f][_0x395c('0x41')])&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey']&&_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignTable']&&_0x2c235b['joins'][_0x84ea7f]['foreignKey']){_0x2b4696[_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['type']](_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],null,util[_0x395c('0x77')](_0x395c('0x80'),_0x2c235b['table'],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['parentKey'],_0x2c235b['joins'][_0x84ea7f][_0x395c('0x7e')],_0x2c235b[_0x395c('0x7b')][_0x84ea7f]['foreignKey']));}}}if(_0x2c235b[_0x395c('0x82')]){_0x2c235b[_0x395c('0x82')]=JSON['parse'](_0x2c235b[_0x395c('0x82')]);_0x2b4696['where'](_0x4bd290(_0x2c235b[_0x395c('0x82')][_0x395c('0x69')]));}_0x320baf=_0x2b4696[_0x395c('0x83')]();_0x2b4696['limit'](_0x20b9d1);_0x2b4696[_0x395c('0x1e')](0x0);logger[_0x395c('0x84')](_0x395c('0xa7'),_0x2b4696[_0x395c('0x85')]());return dbH['sequelize']['query'](_0x2b4696['toString'](),{'type':dbH[_0x395c('0x86')][_0x395c('0x87')][_0x395c('0x88')]});}})[_0x395c('0x28')](function(){return{'sql':_0x320baf[_0x395c('0x85')]()};})[_0x395c('0x28')](respondWithResult(_0x39ef20,null))[_0x395c('0x49')](handleError(_0x39ef20,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index afef812..1e46f20 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 _0xc158=['exports','define','analytics_custom_reports','lodash','util','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes'];(function(_0x37422a,_0x44eef3){var _0x505f44=function(_0x4194f5){while(--_0x4194f5){_0x37422a['push'](_0x37422a['shift']());}};_0x505f44(++_0x44eef3);}(_0xc158,0xcb));var _0x8c15=function(_0x2c85e0,_0xe21145){_0x2c85e0=_0x2c85e0-0x0;var _0x5ec778=_0xc158[_0x2c85e0];return _0x5ec778;};'use strict';var _=require(_0x8c15('0x0'));var util=require(_0x8c15('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8c15('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c15('0x3'));var fs=require('fs');var path=require(_0x8c15('0x4'));var rimraf=require('rimraf');var config=require(_0x8c15('0x5'));var attributes=require(_0x8c15('0x6'));module[_0x8c15('0x7')]=function(_0xe23b3c,_0x1e66db){return _0xe23b3c[_0x8c15('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0x8c15('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98e8=['api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x584d2a,_0x80af2e){var _0x2929cc=function(_0xbca9e3){while(--_0xbca9e3){_0x584d2a['push'](_0x584d2a['shift']());}};_0x2929cc(++_0x80af2e);}(_0x98e8,0x10e));var _0x898e=function(_0x52c3e2,_0x332d61){_0x52c3e2=_0x52c3e2-0x0;var _0x325392=_0x98e8[_0x52c3e2];return _0x325392;};'use strict';var _=require(_0x898e('0x0'));var util=require(_0x898e('0x1'));var logger=require(_0x898e('0x2'))(_0x898e('0x3'));var moment=require('moment');var BPromise=require(_0x898e('0x4'));var rp=require(_0x898e('0x5'));var fs=require('fs');var path=require(_0x898e('0x6'));var rimraf=require('rimraf');var config=require(_0x898e('0x7'));var attributes=require(_0x898e('0x8'));module[_0x898e('0x9')]=function(_0xa016de,_0x37bb10){return _0xa016de[_0x898e('0xa')](_0x898e('0xb'),attributes,{'tableName':_0x898e('0xc'),'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 adb9432..4ed2332 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 _0xfc64=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3d15ec,_0x14827c){var _0x33e151=function(_0x14ff01){while(--_0x14ff01){_0x3d15ec['push'](_0x3d15ec['shift']());}};_0x33e151(++_0x14827c);}(_0xfc64,0x179));var _0x4fc6=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xfc64[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x4fc6('0x0'));var util=require(_0x4fc6('0x1'));var moment=require(_0x4fc6('0x2'));var BPromise=require(_0x4fc6('0x3'));var rs=require(_0x4fc6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4fc6('0x5'));var logger=require('../../config/logger')(_0x4fc6('0x6'));var config=require(_0x4fc6('0x7'));var jayson=require(_0x4fc6('0x8'));var client=jayson['client'][_0x4fc6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x155723,_0xdfd82c,_0x56f72c){return new BPromise(function(_0x52984a,_0x26bb30){return client['request'](_0x155723,_0x56f72c)[_0x4fc6('0xa')](function(_0x322cdd){logger[_0x4fc6('0xb')](_0x4fc6('0xc'),_0xdfd82c,'request\x20sent');logger[_0x4fc6('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xdfd82c,_0x4fc6('0xe'),JSON[_0x4fc6('0xf')](_0x322cdd));if(_0x322cdd[_0x4fc6('0x10')]){if(_0x322cdd[_0x4fc6('0x10')][_0x4fc6('0x11')]===0x1f4){logger[_0x4fc6('0x10')](_0x4fc6('0xc'),_0xdfd82c,_0x322cdd[_0x4fc6('0x10')]['message']);return _0x26bb30(_0x322cdd['error'][_0x4fc6('0x12')]);}logger[_0x4fc6('0x10')](_0x4fc6('0xc'),_0xdfd82c,_0x322cdd[_0x4fc6('0x10')]['message']);return _0x52984a(_0x322cdd[_0x4fc6('0x10')]['message']);}else{logger[_0x4fc6('0xb')](_0x4fc6('0xc'),_0xdfd82c,'request\x20sent');_0x52984a(_0x322cdd[_0x4fc6('0x13')][_0x4fc6('0x12')]);}})[_0x4fc6('0x14')](function(_0x730550){logger['error'](_0x4fc6('0xc'),_0xdfd82c,_0x730550);_0x26bb30(_0x730550);});});} \ No newline at end of file +var _0xebb5=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0xebb5,0xb5));var _0x5ebb=function(_0x22d9ee,_0x2f495b){_0x22d9ee=_0x22d9ee-0x0;var _0x3f66f1=_0xebb5[_0x22d9ee];return _0x3f66f1;};'use strict';var _=require(_0x5ebb('0x0'));var util=require(_0x5ebb('0x1'));var moment=require(_0x5ebb('0x2'));var BPromise=require(_0x5ebb('0x3'));var rs=require(_0x5ebb('0x4'));var fs=require('fs');var Redis=require(_0x5ebb('0x5'));var db=require(_0x5ebb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ebb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebb('0x8'));var client=jayson[_0x5ebb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b31a8,_0x2a417f,_0x1954a7){return new BPromise(function(_0x259c3d,_0x767513){return client[_0x5ebb('0xa')](_0x3b31a8,_0x1954a7)[_0x5ebb('0xb')](function(_0x34136c){logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));logger[_0x5ebb('0xe')](_0x5ebb('0xf'),_0x2a417f,_0x5ebb('0xd'),JSON[_0x5ebb('0x10')](_0x34136c));if(_0x34136c[_0x5ebb('0x11')]){if(_0x34136c['error']['code']===0x1f4){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')]['message']);return _0x767513(_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);}logger['error'](_0x5ebb('0xc'),_0x2a417f,_0x34136c[_0x5ebb('0x11')][_0x5ebb('0x12')]);return _0x259c3d(_0x34136c['error'][_0x5ebb('0x12')]);}else{logger['info'](_0x5ebb('0xc'),_0x2a417f,_0x5ebb('0xd'));_0x259c3d(_0x34136c[_0x5ebb('0x13')][_0x5ebb('0x12')]);}})['catch'](function(_0xbac4ed){logger[_0x5ebb('0x11')](_0x5ebb('0xc'),_0x2a417f,_0xbac4ed);_0x767513(_0xbac4ed);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 8106b6f..f7be351 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 _0x3660=['query','create','put','update','/:id','destroy','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id/preview','preview','/:id/run','run'];(function(_0x1bff2b,_0x174d92){var _0x4f010e=function(_0x530492){while(--_0x530492){_0x1bff2b['push'](_0x1bff2b['shift']());}};_0x4f010e(++_0x174d92);}(_0x3660,0x1a8));var _0x0366=function(_0x17451f,_0x3c86cf){_0x17451f=_0x17451f-0x0;var _0x2ad480=_0x3660[_0x17451f];return _0x2ad480;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0366('0x0'));var timeout=require(_0x0366('0x1'));var express=require(_0x0366('0x2'));var router=express[_0x0366('0x3')]();var fs_extra=require(_0x0366('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0366('0x5'));var controller=require(_0x0366('0x6'));router['get']('/',auth[_0x0366('0x7')](),controller['index']);router[_0x0366('0x8')]('/:id',auth[_0x0366('0x7')](),controller['show']);router[_0x0366('0x8')](_0x0366('0x9'),auth[_0x0366('0x7')](),controller[_0x0366('0xa')]);router[_0x0366('0x8')](_0x0366('0xb'),auth[_0x0366('0x7')](),controller[_0x0366('0xc')]);router[_0x0366('0x8')]('/:id/query',auth[_0x0366('0x7')](),controller[_0x0366('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0366('0xe')]);router[_0x0366('0xf')]('/:id',auth[_0x0366('0x7')](),controller[_0x0366('0x10')]);router['delete'](_0x0366('0x11'),auth[_0x0366('0x7')](),controller[_0x0366('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7490=['/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x5d0969,_0x15e07f){var _0x2f67aa=function(_0x59e132){while(--_0x59e132){_0x5d0969['push'](_0x5d0969['shift']());}};_0x2f67aa(++_0x15e07f);}(_0x7490,0xf4));var _0x0749=function(_0x2d9951,_0x121f23){_0x2d9951=_0x2d9951-0x0;var _0x310df9=_0x7490[_0x2d9951];return _0x310df9;};'use strict';var multer=require(_0x0749('0x0'));var util=require('util');var path=require(_0x0749('0x1'));var timeout=require(_0x0749('0x2'));var express=require(_0x0749('0x3'));var router=express[_0x0749('0x4')]();var fs_extra=require(_0x0749('0x5'));var auth=require(_0x0749('0x6'));var interaction=require(_0x0749('0x7'));var config=require(_0x0749('0x8'));var controller=require(_0x0749('0x9'));router[_0x0749('0xa')]('/',auth[_0x0749('0xb')](),controller[_0x0749('0xc')]);router['get'](_0x0749('0xd'),auth[_0x0749('0xb')](),controller['show']);router[_0x0749('0xa')](_0x0749('0xe'),auth[_0x0749('0xb')](),controller[_0x0749('0xf')]);router[_0x0749('0xa')](_0x0749('0x10'),auth[_0x0749('0xb')](),controller[_0x0749('0x11')]);router[_0x0749('0xa')](_0x0749('0x12'),auth['isAuthenticated'](),controller[_0x0749('0x13')]);router['post']('/',auth[_0x0749('0xb')](),controller[_0x0749('0x14')]);router[_0x0749('0x15')]('/:id',auth[_0x0749('0xb')](),controller[_0x0749('0x16')]);router[_0x0749('0x17')](_0x0749('0xd'),auth[_0x0749('0xb')](),controller[_0x0749('0x18')]);module[_0x0749('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 2795b13..24a0e75 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x5cb7d6,_0x5485ae){var _0x28171c=function(_0x56718b){while(--_0x56718b){_0x5cb7d6['push'](_0x5cb7d6['shift']());}};_0x28171c(++_0x5485ae);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x188b1e,_0x39cf2e){_0x188b1e=_0x188b1e-0x0;var _0x18bb05=_0x3eea[_0x188b1e];return _0x18bb05;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file +var _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x26eeaf,_0x18f26d){var _0x20a33c=function(_0xe8790e){while(--_0xe8790e){_0x26eeaf['push'](_0x26eeaf['shift']());}};_0x20a33c(++_0x18f26d);}(_0x53ec,0x192));var _0xc53e=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x53ec[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index b51bb47..5c5d1f2 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x32a6a7,_0x1aeb67){var _0x50bd2d=function(_0x19ab20){while(--_0x19ab20){_0x32a6a7['push'](_0x32a6a7['shift']());}};_0x50bd2d(++_0x1aeb67);}(_0x5fab,0x177));var _0xb5fa=function(_0x2391cf,_0x2593e9){_0x2391cf=_0x2391cf-0x0;var _0x11f9e5=_0x5fab[_0x2391cf];return _0x11f9e5;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file +var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x1868f4,_0x150266){var _0x273bf8=function(_0x596165){while(--_0x596165){_0x1868f4['push'](_0x1868f4['shift']());}};_0x273bf8(++_0x150266);}(_0xda19,0xd5));var _0x9da1=function(_0x2b6fb8,_0x13466c){_0x2b6fb8=_0x2b6fb8-0x0;var _0x3b161a=_0xda19[_0x2b6fb8];return _0x3b161a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 0daab32..c9ec0de 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 _0x6443=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','../../config/logger','api','moment'];(function(_0x585c4e,_0x25453f){var _0x458af1=function(_0x1893e3){while(--_0x1893e3){_0x585c4e['push'](_0x585c4e['shift']());}};_0x458af1(++_0x25453f);}(_0x6443,0x1a0));var _0x3644=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x6443[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0x3644('0x0'));var util=require('util');var logger=require(_0x3644('0x1'))(_0x3644('0x2'));var moment=require(_0x3644('0x3'));var BPromise=require('bluebird');var rp=require(_0x3644('0x4'));var fs=require('fs');var path=require(_0x3644('0x5'));var rimraf=require(_0x3644('0x6'));var config=require(_0x3644('0x7'));var attributes=require(_0x3644('0x8'));module[_0x3644('0x9')]=function(_0x1f0ab9,_0x2f1cf2){return _0x1f0ab9[_0x3644('0xa')](_0x3644('0xb'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7010=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','lodash','api','moment','request-promise','path'];(function(_0x4d529a,_0x317bce){var _0x5754d9=function(_0x353b20){while(--_0x353b20){_0x4d529a['push'](_0x4d529a['shift']());}};_0x5754d9(++_0x317bce);}(_0x7010,0x9b));var _0x0701=function(_0x1c6efd,_0xb2f3cd){_0x1c6efd=_0x1c6efd-0x0;var _0x53a918=_0x7010[_0x1c6efd];return _0x53a918;};'use strict';var _=require(_0x0701('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0701('0x1'));var moment=require(_0x0701('0x2'));var BPromise=require('bluebird');var rp=require(_0x0701('0x3'));var fs=require('fs');var path=require(_0x0701('0x4'));var rimraf=require(_0x0701('0x5'));var config=require(_0x0701('0x6'));var attributes=require(_0x0701('0x7'));module[_0x0701('0x8')]=function(_0x2b1ec9,_0x4d2e89){return _0x2b1ec9['define'](_0x0701('0x9'),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 5f0daf5..d91296d 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 _0x71a4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71a4,0x1db));var _0x471a=function(_0x2ce982,_0x146000){_0x2ce982=_0x2ce982-0x0;var _0x4ec5f0=_0x71a4[_0x2ce982];return _0x4ec5f0;};'use strict';var _=require(_0x471a('0x0'));var util=require(_0x471a('0x1'));var moment=require(_0x471a('0x2'));var BPromise=require(_0x471a('0x3'));var rs=require(_0x471a('0x4'));var fs=require('fs');var Redis=require(_0x471a('0x5'));var db=require(_0x471a('0x6'))['db'];var utils=require(_0x471a('0x7'));var logger=require(_0x471a('0x8'))(_0x471a('0x9'));var config=require(_0x471a('0xa'));var jayson=require(_0x471a('0xb'));var client=jayson['client'][_0x471a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x96fec4,_0xae7f15,_0x20761b){return new BPromise(function(_0x2ee266,_0x3e2841){return client[_0x471a('0xd')](_0x96fec4,_0x20761b)[_0x471a('0xe')](function(_0x17e1a7){logger[_0x471a('0xf')](_0x471a('0x10'),_0xae7f15,'request\x20sent');logger['debug'](_0x471a('0x11'),_0xae7f15,_0x471a('0x12'),JSON[_0x471a('0x13')](_0x17e1a7));if(_0x17e1a7['error']){if(_0x17e1a7[_0x471a('0x14')][_0x471a('0x15')]===0x1f4){logger[_0x471a('0x14')](_0x471a('0x10'),_0xae7f15,_0x17e1a7[_0x471a('0x14')][_0x471a('0x16')]);return _0x3e2841(_0x17e1a7[_0x471a('0x14')][_0x471a('0x16')]);}logger[_0x471a('0x14')](_0x471a('0x10'),_0xae7f15,_0x17e1a7[_0x471a('0x14')]['message']);return _0x2ee266(_0x17e1a7[_0x471a('0x14')][_0x471a('0x16')]);}else{logger[_0x471a('0xf')](_0x471a('0x10'),_0xae7f15,_0x471a('0x12'));_0x2ee266(_0x17e1a7[_0x471a('0x17')][_0x471a('0x16')]);}})['catch'](function(_0xdbcd61){logger['error'](_0x471a('0x10'),_0xae7f15,_0xdbcd61);_0x3e2841(_0xdbcd61);});});} \ No newline at end of file +var _0x1002=['client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x36ff0d,_0x4dad91){var _0x49ba07=function(_0x34352d){while(--_0x34352d){_0x36ff0d['push'](_0x36ff0d['shift']());}};_0x49ba07(++_0x4dad91);}(_0x1002,0x9e));var _0x2100=function(_0x6598bd,_0x2240d4){_0x6598bd=_0x6598bd-0x0;var _0x46b063=_0x1002[_0x6598bd];return _0x46b063;};'use strict';var _=require(_0x2100('0x0'));var util=require('util');var moment=require(_0x2100('0x1'));var BPromise=require(_0x2100('0x2'));var rs=require(_0x2100('0x3'));var fs=require('fs');var Redis=require(_0x2100('0x4'));var db=require(_0x2100('0x5'))['db'];var utils=require(_0x2100('0x6'));var logger=require(_0x2100('0x7'))(_0x2100('0x8'));var config=require('../../config/environment');var jayson=require(_0x2100('0x9'));var client=jayson[_0x2100('0xa')][_0x2100('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187b83,_0x3f011,_0x3ab061){return new BPromise(function(_0x1718dd,_0x47bab1){return client[_0x2100('0xc')](_0x187b83,_0x3ab061)[_0x2100('0xd')](function(_0x5c5c84){logger[_0x2100('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x2100('0xf'));logger[_0x2100('0x10')](_0x2100('0x11'),_0x3f011,_0x2100('0xf'),JSON[_0x2100('0x12')](_0x5c5c84));if(_0x5c5c84[_0x2100('0x13')]){if(_0x5c5c84['error']['code']===0x1f4){logger[_0x2100('0x13')](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x47bab1(_0x5c5c84['error'][_0x2100('0x15')]);}logger['error'](_0x2100('0x14'),_0x3f011,_0x5c5c84[_0x2100('0x13')][_0x2100('0x15')]);return _0x1718dd(_0x5c5c84[_0x2100('0x13')]['message']);}else{logger[_0x2100('0xe')](_0x2100('0x14'),_0x3f011,'request\x20sent');_0x1718dd(_0x5c5c84[_0x2100('0x16')]['message']);}})[_0x2100('0x17')](function(_0x895649){logger[_0x2100('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3f011,_0x895649);_0x47bab1(_0x895649);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index fe21421..2cd638e 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 _0x0045=['/:id/preview','preview','run','/:id/query','query','post','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x241c21,_0x11b64b){var _0x1ffb9e=function(_0x5e3509){while(--_0x5e3509){_0x241c21['push'](_0x241c21['shift']());}};_0x1ffb9e(++_0x11b64b);}(_0x0045,0xd8));var _0x5004=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0045[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5004('0x0'));var util=require(_0x5004('0x1'));var path=require(_0x5004('0x2'));var timeout=require(_0x5004('0x3'));var express=require(_0x5004('0x4'));var router=express['Router']();var fs_extra=require(_0x5004('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5004('0x6'));var config=require(_0x5004('0x7'));var controller=require(_0x5004('0x8'));router[_0x5004('0x9')]('/',auth[_0x5004('0xa')](),controller[_0x5004('0xb')]);router['get'](_0x5004('0xc'),auth[_0x5004('0xa')](),controller[_0x5004('0xd')]);router[_0x5004('0x9')](_0x5004('0xe'),auth[_0x5004('0xa')](),controller[_0x5004('0xf')]);router[_0x5004('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0x5004('0x10')]);router[_0x5004('0x9')](_0x5004('0x11'),auth[_0x5004('0xa')](),controller[_0x5004('0x12')]);router[_0x5004('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5004('0xc'),auth[_0x5004('0xa')](),controller[_0x5004('0x14')]);router[_0x5004('0x15')](_0x5004('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x5004('0x16')]=router; \ No newline at end of file +var _0x93a6=['/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x93a6,0x1ac));var _0x693a=function(_0x187dbd,_0x2ecf58){_0x187dbd=_0x187dbd-0x0;var _0x45d1e9=_0x93a6[_0x187dbd];return _0x45d1e9;};'use strict';var multer=require(_0x693a('0x0'));var util=require(_0x693a('0x1'));var path=require(_0x693a('0x2'));var timeout=require(_0x693a('0x3'));var express=require('express');var router=express[_0x693a('0x4')]();var fs_extra=require(_0x693a('0x5'));var auth=require(_0x693a('0x6'));var interaction=require(_0x693a('0x7'));var config=require(_0x693a('0x8'));var controller=require(_0x693a('0x9'));router[_0x693a('0xa')]('/',auth[_0x693a('0xb')](),controller['index']);router[_0x693a('0xa')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0xd')]);router[_0x693a('0xa')](_0x693a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x693a('0xa')](_0x693a('0xf'),auth['isAuthenticated'](),controller[_0x693a('0x10')]);router[_0x693a('0xa')](_0x693a('0x11'),auth[_0x693a('0xb')](),controller[_0x693a('0x12')]);router[_0x693a('0x13')]('/',auth[_0x693a('0xb')](),controller[_0x693a('0x14')]);router[_0x693a('0x15')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x16')]);router[_0x693a('0x17')](_0x693a('0xc'),auth[_0x693a('0xb')](),controller[_0x693a('0x18')]);module[_0x693a('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e4d4740..556dbef 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 _0xb038=['pdf','xlsx','Loading','ENUM','manual','INTEGER','sequelize','moment','exports','STRING','csv'];(function(_0x4f3219,_0x210f7d){var _0x1a394b=function(_0x23d682){while(--_0x23d682){_0x4f3219['push'](_0x4f3219['shift']());}};_0x1a394b(++_0x210f7d);}(_0xb038,0x1d4));var _0x8b03=function(_0x56469a,_0x4c448c){_0x56469a=_0x56469a-0x0;var _0x458cdb=_0xb038[_0x56469a];return _0x458cdb;};'use strict';var Sequelize=require(_0x8b03('0x0'));var moment=require(_0x8b03('0x1'));module[_0x8b03('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x8b03('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8b03('0x4'),_0x8b03('0x5'),_0x8b03('0x6')),'allowNull':![],'defaultValue':_0x8b03('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8b03('0x3')],'defaultValue':_0x8b03('0x7')},'type':{'type':Sequelize[_0x8b03('0x8')](_0x8b03('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x8b03('0x9')},'reportId':{'type':Sequelize[_0x8b03('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8b03('0x3')]}}; \ No newline at end of file +var _0xc293=['ENUM','csv','DATE','manual','INTEGER','UNSIGNED','sequelize','moment','STRING'];(function(_0x39db98,_0x28c7d9){var _0x5939cf=function(_0x5ed6c6){while(--_0x5ed6c6){_0x39db98['push'](_0x39db98['shift']());}};_0x5939cf(++_0x28c7d9);}(_0xc293,0xe7));var _0x3c29=function(_0x196126,_0x35ce6c){_0x196126=_0x196126-0x0;var _0xe144e9=_0xc293[_0x196126];return _0xe144e9;};'use strict';var Sequelize=require(_0x3c29('0x0'));var moment=require(_0x3c29('0x1'));module['exports']={'name':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3c29('0x3')](_0x3c29('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x3c29('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3c29('0x5')]},'endDate':{'type':Sequelize[_0x3c29('0x5')]},'status':{'type':Sequelize[_0x3c29('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x3c29('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x3c29('0x6')},'reportId':{'type':Sequelize[_0x3c29('0x7')](0xb)[_0x3c29('0x8')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 25ea08e..a0fbbe8 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 _0x1ef8=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','format','%s.%s','toLowerCase','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x1ef8,0x163));var _0x81ef=function(_0x1ac4ed,_0x45a0ac){_0x1ac4ed=_0x1ac4ed-0x0;var _0x56b836=_0x1ef8[_0x1ac4ed];return _0x56b836;};'use strict';var emlformat=require(_0x81ef('0x0'));var rimraf=require(_0x81ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x81ef('0x2'));var moment=require(_0x81ef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x81ef('0x4'));var util=require(_0x81ef('0x5'));var path=require('path');var sox=require(_0x81ef('0x6'));var csv=require(_0x81ef('0x7'));var ejs=require(_0x81ef('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81ef('0x9'));var squel=require('squel');var crypto=require(_0x81ef('0xa'));var jsforce=require(_0x81ef('0xb'));var deskjs=require(_0x81ef('0xc'));var toCsv=require('to-csv');var querystring=require(_0x81ef('0xd'));var Papa=require('papaparse');var Redis=require(_0x81ef('0xe'));var authService=require(_0x81ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x81ef('0x10'));var hardwareService=require(_0x81ef('0x11'));var logger=require(_0x81ef('0x12'))(_0x81ef('0x13'));var utils=require(_0x81ef('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x81ef('0x15'));var db=require(_0x81ef('0x16'))['db'];function respondWithStatusCode(_0x247485,_0x995c18){_0x995c18=_0x995c18||0xcc;return function(_0x1a4d3b){if(_0x1a4d3b){return _0x247485['sendStatus'](_0x995c18);}return _0x247485[_0x81ef('0x17')](_0x995c18)[_0x81ef('0x18')]();};}function respondWithResult(_0x492547,_0x41f18c){_0x41f18c=_0x41f18c||0xc8;return function(_0x332521){if(_0x332521){return _0x492547[_0x81ef('0x17')](_0x41f18c)[_0x81ef('0x19')](_0x332521);}};}function respondWithFilteredResult(_0xfcf347,_0x36b1d0){return function(_0x3725cb){if(_0x3725cb){var _0x27e9ed=typeof _0x36b1d0[_0x81ef('0x1a')]===_0x81ef('0x1b')&&typeof _0x36b1d0[_0x81ef('0x1c')]===_0x81ef('0x1b');var _0x302410=_0x3725cb[_0x81ef('0x1d')];var _0x36328d=_0x27e9ed?0x0:_0x36b1d0[_0x81ef('0x1a')];var _0x44df6a=_0x27e9ed?_0x3725cb[_0x81ef('0x1d')]:_0x36b1d0['offset']+_0x36b1d0[_0x81ef('0x1c')];var _0xcc7c6d;if(_0x44df6a>=_0x302410){_0x44df6a=_0x302410;_0xcc7c6d=0xc8;}else{_0xcc7c6d=0xce;}_0xfcf347[_0x81ef('0x17')](_0xcc7c6d);return _0xfcf347['set'](_0x81ef('0x1e'),_0x36328d+'-'+_0x44df6a+'/'+_0x302410)[_0x81ef('0x19')](_0x3725cb);}return null;};}function patchUpdates(_0x14707d){return function(_0x5e0fec){try{jsonpatch[_0x81ef('0x1f')](_0x5e0fec,_0x14707d,!![]);}catch(_0x328b09){return BPromise[_0x81ef('0x20')](_0x328b09);}return _0x5e0fec[_0x81ef('0x21')]();};}function saveUpdates(_0x64ab22,_0x3d2b12){return function(_0x596326){if(_0x596326){return _0x596326[_0x81ef('0x22')](_0x64ab22)[_0x81ef('0x23')](function(_0xbf21c9){return _0xbf21c9;});}return null;};}function removeEntity(_0x23cc0b,_0x4ec9ce){return function(_0x2a1a6c){if(_0x2a1a6c){return _0x2a1a6c['destroy']()[_0x81ef('0x23')](function(){var _0x105dfc=_0x2a1a6c[_0x81ef('0x24')]({'plain':!![]});var _0x551e47=_0x81ef('0x25');return db[_0x81ef('0x26')]['destroy']({'where':{'type':_0x551e47,'resourceId':_0x105dfc['id']}})['then'](function(){return _0x2a1a6c;});})['then'](function(){_0x23cc0b[_0x81ef('0x17')](0xcc)[_0x81ef('0x18')]();});}};}function handleEntityNotFound(_0x519828,_0x20d676){return function(_0x93bb5){if(!_0x93bb5){_0x519828[_0x81ef('0x27')](0x194);}return _0x93bb5;};}function handleError(_0x293eb9,_0x3d1c7b){_0x3d1c7b=_0x3d1c7b||0x1f4;return function(_0x57534e){logger[_0x81ef('0x28')](_0x57534e[_0x81ef('0x29')]);if(_0x57534e['name']){delete _0x57534e['name'];}_0x293eb9[_0x81ef('0x17')](_0x3d1c7b)[_0x81ef('0x2a')](_0x57534e);};}exports[_0x81ef('0x2b')]=function(_0x5be092,_0x19216b){var _0x5deb36={},_0x1d694d={},_0xdee746={'count':0x0,'rows':[]};var _0xe7a281=_[_0x81ef('0x2c')](db[_0x81ef('0x2d')][_0x81ef('0x2e')],function(_0xf8e0f2){return{'name':_0xf8e0f2['fieldName'],'type':_0xf8e0f2[_0x81ef('0x2f')][_0x81ef('0x30')]};});_0x1d694d[_0x81ef('0x31')]=_[_0x81ef('0x2c')](_0xe7a281,_0x81ef('0x32'));_0x1d694d[_0x81ef('0x33')]=_[_0x81ef('0x34')](_0x5be092[_0x81ef('0x33')]);_0x1d694d['filters']=_[_0x81ef('0x35')](_0x1d694d['model'],_0x1d694d[_0x81ef('0x33')]);_0x5deb36[_0x81ef('0x36')]=_[_0x81ef('0x35')](_0x1d694d['model'],qs[_0x81ef('0x37')](_0x5be092['query'][_0x81ef('0x37')]));_0x5deb36[_0x81ef('0x36')]=_0x5deb36[_0x81ef('0x36')][_0x81ef('0x38')]?_0x5deb36['attributes']:_0x1d694d[_0x81ef('0x31')];if(!_0x5be092[_0x81ef('0x33')][_0x81ef('0x39')]('nolimit')){_0x5deb36[_0x81ef('0x1c')]=qs[_0x81ef('0x1c')](_0x5be092[_0x81ef('0x33')]['limit']);_0x5deb36[_0x81ef('0x1a')]=qs['offset'](_0x5be092[_0x81ef('0x33')][_0x81ef('0x1a')]);}_0x5deb36[_0x81ef('0x3a')]=qs[_0x81ef('0x3b')](_0x5be092[_0x81ef('0x33')][_0x81ef('0x3b')]);_0x5deb36[_0x81ef('0x3c')]=qs[_0x81ef('0x3d')](_[_0x81ef('0x3e')](_0x5be092['query'],_0x1d694d[_0x81ef('0x3d')]),_0xe7a281);if(_0x5be092[_0x81ef('0x33')][_0x81ef('0x3f')]){_0x5deb36[_0x81ef('0x3c')]=_[_0x81ef('0x40')](_0x5deb36['where'],{'$or':_[_0x81ef('0x2c')](_0xe7a281,function(_0x3bd5ca){if(_0x3bd5ca[_0x81ef('0x2f')]!==_0x81ef('0x41')){var _0x4d1b3d={};_0x4d1b3d[_0x3bd5ca[_0x81ef('0x32')]]={'$like':'%'+_0x5be092[_0x81ef('0x33')][_0x81ef('0x3f')]+'%'};return _0x4d1b3d;}})});}_0x5deb36=_['merge']({},_0x5deb36,_0x5be092[_0x81ef('0x42')]);var _0x14ed26={'where':_0x5deb36[_0x81ef('0x3c')]};return db['AnalyticExtractedReport'][_0x81ef('0x1d')](_0x14ed26)[_0x81ef('0x23')](function(_0x1d35d6){_0xdee746[_0x81ef('0x1d')]=_0x1d35d6;if(_0x5be092[_0x81ef('0x33')]['includeAll']){_0x5deb36[_0x81ef('0x43')]=[{'all':!![]}];}return db[_0x81ef('0x2d')][_0x81ef('0x44')](_0x5deb36);})[_0x81ef('0x23')](function(_0x3d430c){_0xdee746['rows']=_0x3d430c;return _0xdee746;})[_0x81ef('0x23')](respondWithFilteredResult(_0x19216b,_0x5deb36))[_0x81ef('0x45')](handleError(_0x19216b,null));};exports[_0x81ef('0x46')]=function(_0x25c01f,_0xaa93f9){var _0x271a39={'raw':!![],'where':{'id':_0x25c01f['params']['id']}},_0x48a3f8={};_0x48a3f8[_0x81ef('0x31')]=_[_0x81ef('0x34')](db['AnalyticExtractedReport'][_0x81ef('0x2e')]);_0x48a3f8['query']=_[_0x81ef('0x34')](_0x25c01f[_0x81ef('0x33')]);_0x48a3f8[_0x81ef('0x3d')]=_[_0x81ef('0x35')](_0x48a3f8['model'],_0x48a3f8[_0x81ef('0x33')]);_0x271a39['attributes']=_[_0x81ef('0x35')](_0x48a3f8[_0x81ef('0x31')],qs[_0x81ef('0x37')](_0x25c01f[_0x81ef('0x33')][_0x81ef('0x37')]));_0x271a39[_0x81ef('0x36')]=_0x271a39[_0x81ef('0x36')][_0x81ef('0x38')]?_0x271a39[_0x81ef('0x36')]:_0x48a3f8['model'];if(_0x25c01f[_0x81ef('0x33')]['includeAll']){_0x271a39[_0x81ef('0x43')]=[{'all':!![]}];}_0x271a39=_['merge']({},_0x271a39,_0x25c01f[_0x81ef('0x42')]);return db['AnalyticExtractedReport']['find'](_0x271a39)['then'](handleEntityNotFound(_0xaa93f9,null))[_0x81ef('0x23')](respondWithResult(_0xaa93f9,null))[_0x81ef('0x45')](handleError(_0xaa93f9,null));};exports[_0x81ef('0x47')]=function(_0x234a59,_0x566abd){return db[_0x81ef('0x2d')][_0x81ef('0x47')](_0x234a59[_0x81ef('0x48')],{})['then'](function(_0x492f45){var _0x37f951=_0x234a59[_0x81ef('0x49')][_0x81ef('0x24')]({'plain':!![]});if(!_0x37f951)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37f951[_0x81ef('0x4a')]===_0x81ef('0x49')){var _0x241f8b=_0x492f45[_0x81ef('0x24')]({'plain':!![]});var _0x26bad2=_0x81ef('0x25');return db['UserProfileSection'][_0x81ef('0x4b')]({'where':{'name':_0x26bad2,'userProfileId':_0x37f951[_0x81ef('0x4c')]},'raw':!![]})[_0x81ef('0x23')](function(_0x13d8db){if(_0x13d8db&&_0x13d8db[_0x81ef('0x4d')]===0x0){return db['UserProfileResource'][_0x81ef('0x47')]({'name':_0x241f8b[_0x81ef('0x32')],'resourceId':_0x241f8b['id'],'type':_0x13d8db[_0x81ef('0x32')],'sectionId':_0x13d8db['id']},{})[_0x81ef('0x23')](function(){return _0x492f45;});}else{return _0x492f45;}})['catch'](function(_0x55eebc){logger['error'](_0x81ef('0x4e'),_0x55eebc);throw _0x55eebc;});}return _0x492f45;})[_0x81ef('0x23')](respondWithResult(_0x566abd,0xc9))[_0x81ef('0x45')](handleError(_0x566abd,null));};exports[_0x81ef('0x22')]=function(_0x6652e2,_0x5e0335){if(_0x6652e2[_0x81ef('0x48')]['id']){delete _0x6652e2[_0x81ef('0x48')]['id'];}return db[_0x81ef('0x2d')][_0x81ef('0x4b')]({'where':{'id':_0x6652e2[_0x81ef('0x4f')]['id']}})[_0x81ef('0x23')](handleEntityNotFound(_0x5e0335,null))[_0x81ef('0x23')](saveUpdates(_0x6652e2[_0x81ef('0x48')],null))[_0x81ef('0x23')](respondWithResult(_0x5e0335,null))[_0x81ef('0x45')](handleError(_0x5e0335,null));};exports[_0x81ef('0x50')]=function(_0x2339b4,_0x2e1226){return db['AnalyticExtractedReport'][_0x81ef('0x4b')]({'where':{'id':_0x2339b4[_0x81ef('0x4f')]['id']}})[_0x81ef('0x23')](handleEntityNotFound(_0x2e1226,null))[_0x81ef('0x23')](removeEntity(_0x2e1226,null))[_0x81ef('0x45')](handleError(_0x2e1226,null));};exports[_0x81ef('0x51')]=function(_0x525a98,_0x26da84,_0x3fc37c){return db['AnalyticExtractedReport'][_0x81ef('0x4b')]({'where':{'id':_0x525a98[_0x81ef('0x4f')]['id']},'attributes':[_0x81ef('0x32'),_0x81ef('0x52'),_0x81ef('0x53'),_0x81ef('0x54')],'raw':!![]})[_0x81ef('0x23')](handleEntityNotFound(_0x26da84,null))['then'](function(_0xb43fb1){if(_0xb43fb1){if(!fs[_0x81ef('0x55')](path[_0x81ef('0x56')](config['root'],_0x81ef('0x57'),_0xb43fb1[_0x81ef('0x53')]))){throw new db[(_0x81ef('0x58'))]['ValidationError'](_0x81ef('0x59'));}if(_0x525a98[_0x81ef('0x33')][_0x81ef('0x5a')]){return _0x26da84['sendStatus'](0xc8);}return _0x26da84['download'](path[_0x81ef('0x56')](config[_0x81ef('0x5b')],_0x81ef('0x57'),_0xb43fb1[_0x81ef('0x53')]),util[_0x81ef('0x5c')](_0x81ef('0x5d'),_0xb43fb1[_0x81ef('0x52')]||_0xb43fb1[_0x81ef('0x32')],_0xb43fb1[_0x81ef('0x54')][_0x81ef('0x5e')]()));}})['catch'](handleError(_0x26da84,null));}; \ No newline at end of file +var _0x2367=['sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','ExtractedReports','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x19b2fb,_0x57af95){var _0x4ecad7=function(_0x3e6806){while(--_0x3e6806){_0x19b2fb['push'](_0x19b2fb['shift']());}};_0x4ecad7(++_0x57af95);}(_0x2367,0xb5));var _0x7236=function(_0x403145,_0x3aec5e){_0x403145=_0x403145-0x0;var _0x5e1d6f=_0x2367[_0x403145];return _0x5e1d6f;};'use strict';var emlformat=require(_0x7236('0x0'));var rimraf=require(_0x7236('0x1'));var zipdir=require(_0x7236('0x2'));var jsonpatch=require(_0x7236('0x3'));var rp=require(_0x7236('0x4'));var moment=require('moment');var BPromise=require(_0x7236('0x5'));var Mustache=require(_0x7236('0x6'));var util=require(_0x7236('0x7'));var path=require(_0x7236('0x8'));var sox=require(_0x7236('0x9'));var csv=require(_0x7236('0xa'));var ejs=require(_0x7236('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7236('0xc'));var squel=require(_0x7236('0xd'));var crypto=require(_0x7236('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7236('0xa'));var querystring=require('querystring');var Papa=require(_0x7236('0xf'));var Redis=require('ioredis');var authService=require(_0x7236('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7236('0x12'))(_0x7236('0x13'));var utils=require(_0x7236('0x14'));var config=require(_0x7236('0x15'));var licenseUtil=require(_0x7236('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19066d,_0x305e05){_0x305e05=_0x305e05||0xcc;return function(_0x1489c2){if(_0x1489c2){return _0x19066d['sendStatus'](_0x305e05);}return _0x19066d[_0x7236('0x17')](_0x305e05)[_0x7236('0x18')]();};}function respondWithResult(_0x42bc5c,_0xcff778){_0xcff778=_0xcff778||0xc8;return function(_0x172fd3){if(_0x172fd3){return _0x42bc5c[_0x7236('0x17')](_0xcff778)[_0x7236('0x19')](_0x172fd3);}};}function respondWithFilteredResult(_0x4140b5,_0xb3f7e7){return function(_0x425602){if(_0x425602){var _0x435213=typeof _0xb3f7e7[_0x7236('0x1a')]===_0x7236('0x1b')&&typeof _0xb3f7e7['limit']==='undefined';var _0x2872b8=_0x425602[_0x7236('0x1c')];var _0x2d78e2=_0x435213?0x0:_0xb3f7e7[_0x7236('0x1a')];var _0x4db8f3=_0x435213?_0x425602[_0x7236('0x1c')]:_0xb3f7e7[_0x7236('0x1a')]+_0xb3f7e7[_0x7236('0x1d')];var _0x152ec4;if(_0x4db8f3>=_0x2872b8){_0x4db8f3=_0x2872b8;_0x152ec4=0xc8;}else{_0x152ec4=0xce;}_0x4140b5['status'](_0x152ec4);return _0x4140b5['set'](_0x7236('0x1e'),_0x2d78e2+'-'+_0x4db8f3+'/'+_0x2872b8)[_0x7236('0x19')](_0x425602);}return null;};}function patchUpdates(_0x1405b0){return function(_0x10af4c){try{jsonpatch[_0x7236('0x1f')](_0x10af4c,_0x1405b0,!![]);}catch(_0x479bc1){return BPromise[_0x7236('0x20')](_0x479bc1);}return _0x10af4c['save']();};}function saveUpdates(_0x309c07,_0x1f2907){return function(_0x4d47a5){if(_0x4d47a5){return _0x4d47a5[_0x7236('0x21')](_0x309c07)[_0x7236('0x22')](function(_0x17d613){return _0x17d613;});}return null;};}function removeEntity(_0xb735e1,_0x217a8e){return function(_0x5ecf0f){if(_0x5ecf0f){return _0x5ecf0f[_0x7236('0x23')]()['then'](function(){var _0x40889f=_0x5ecf0f[_0x7236('0x24')]({'plain':!![]});var _0x469f2d=_0x7236('0x25');return db['UserProfileResource'][_0x7236('0x23')]({'where':{'type':_0x469f2d,'resourceId':_0x40889f['id']}})[_0x7236('0x22')](function(){return _0x5ecf0f;});})[_0x7236('0x22')](function(){_0xb735e1[_0x7236('0x17')](0xcc)[_0x7236('0x18')]();});}};}function handleEntityNotFound(_0x57c943,_0x135dc6){return function(_0x38e710){if(!_0x38e710){_0x57c943[_0x7236('0x26')](0x194);}return _0x38e710;};}function handleError(_0x278559,_0x15e5bb){_0x15e5bb=_0x15e5bb||0x1f4;return function(_0xd999f4){logger[_0x7236('0x27')](_0xd999f4[_0x7236('0x28')]);if(_0xd999f4[_0x7236('0x29')]){delete _0xd999f4[_0x7236('0x29')];}_0x278559[_0x7236('0x17')](_0x15e5bb)[_0x7236('0x2a')](_0xd999f4);};}exports[_0x7236('0x2b')]=function(_0x4e4d69,_0x1b43de){var _0x539b84={},_0x3a193a={},_0x4b700d={'count':0x0,'rows':[]};var _0x319abf=_[_0x7236('0x2c')](db['AnalyticExtractedReport'][_0x7236('0x2d')],function(_0x284876){return{'name':_0x284876[_0x7236('0x2e')],'type':_0x284876[_0x7236('0x2f')][_0x7236('0x30')]};});_0x3a193a[_0x7236('0x31')]=_[_0x7236('0x2c')](_0x319abf,_0x7236('0x29'));_0x3a193a['query']=_[_0x7236('0x32')](_0x4e4d69[_0x7236('0x33')]);_0x3a193a[_0x7236('0x34')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],_0x3a193a[_0x7236('0x33')]);_0x539b84[_0x7236('0x36')]=_[_0x7236('0x35')](_0x3a193a[_0x7236('0x31')],qs[_0x7236('0x37')](_0x4e4d69['query'][_0x7236('0x37')]));_0x539b84['attributes']=_0x539b84[_0x7236('0x36')][_0x7236('0x38')]?_0x539b84[_0x7236('0x36')]:_0x3a193a[_0x7236('0x31')];if(!_0x4e4d69[_0x7236('0x33')][_0x7236('0x39')]('nolimit')){_0x539b84[_0x7236('0x1d')]=qs['limit'](_0x4e4d69['query'][_0x7236('0x1d')]);_0x539b84[_0x7236('0x1a')]=qs[_0x7236('0x1a')](_0x4e4d69[_0x7236('0x33')]['offset']);}_0x539b84[_0x7236('0x3a')]=qs[_0x7236('0x3b')](_0x4e4d69[_0x7236('0x33')]['sort']);_0x539b84['where']=qs[_0x7236('0x34')](_[_0x7236('0x3c')](_0x4e4d69[_0x7236('0x33')],_0x3a193a[_0x7236('0x34')]),_0x319abf);if(_0x4e4d69['query'][_0x7236('0x3d')]){_0x539b84['where']=_[_0x7236('0x3e')](_0x539b84['where'],{'$or':_[_0x7236('0x2c')](_0x319abf,function(_0x3d8d36){if(_0x3d8d36[_0x7236('0x2f')]!=='VIRTUAL'){var _0x262b97={};_0x262b97[_0x3d8d36[_0x7236('0x29')]]={'$like':'%'+_0x4e4d69[_0x7236('0x33')][_0x7236('0x3d')]+'%'};return _0x262b97;}})});}_0x539b84=_[_0x7236('0x3e')]({},_0x539b84,_0x4e4d69['options']);var _0x1a9d98={'where':_0x539b84[_0x7236('0x3f')]};return db[_0x7236('0x40')]['count'](_0x1a9d98)[_0x7236('0x22')](function(_0x4a0cb3){_0x4b700d[_0x7236('0x1c')]=_0x4a0cb3;if(_0x4e4d69[_0x7236('0x33')][_0x7236('0x41')]){_0x539b84[_0x7236('0x42')]=[{'all':!![]}];}return db[_0x7236('0x40')][_0x7236('0x43')](_0x539b84);})[_0x7236('0x22')](function(_0x19489c){_0x4b700d['rows']=_0x19489c;return _0x4b700d;})[_0x7236('0x22')](respondWithFilteredResult(_0x1b43de,_0x539b84))[_0x7236('0x44')](handleError(_0x1b43de,null));};exports[_0x7236('0x45')]=function(_0x1f25cb,_0x54aa22){var _0x2e16de={'raw':!![],'where':{'id':_0x1f25cb[_0x7236('0x46')]['id']}},_0x4d8abf={};_0x4d8abf[_0x7236('0x31')]=_['keys'](db[_0x7236('0x40')]['rawAttributes']);_0x4d8abf[_0x7236('0x33')]=_[_0x7236('0x32')](_0x1f25cb['query']);_0x4d8abf['filters']=_[_0x7236('0x35')](_0x4d8abf[_0x7236('0x31')],_0x4d8abf[_0x7236('0x33')]);_0x2e16de['attributes']=_['intersection'](_0x4d8abf[_0x7236('0x31')],qs[_0x7236('0x37')](_0x1f25cb['query'][_0x7236('0x37')]));_0x2e16de['attributes']=_0x2e16de[_0x7236('0x36')]['length']?_0x2e16de[_0x7236('0x36')]:_0x4d8abf[_0x7236('0x31')];if(_0x1f25cb['query']['includeAll']){_0x2e16de[_0x7236('0x42')]=[{'all':!![]}];}_0x2e16de=_[_0x7236('0x3e')]({},_0x2e16de,_0x1f25cb[_0x7236('0x47')]);return db['AnalyticExtractedReport'][_0x7236('0x48')](_0x2e16de)['then'](handleEntityNotFound(_0x54aa22,null))[_0x7236('0x22')](respondWithResult(_0x54aa22,null))['catch'](handleError(_0x54aa22,null));};exports[_0x7236('0x49')]=function(_0x102ebe,_0x4ebb31){return db[_0x7236('0x40')][_0x7236('0x49')](_0x102ebe['body'],{})[_0x7236('0x22')](function(_0x2f0817){var _0x372d16=_0x102ebe[_0x7236('0x4a')][_0x7236('0x24')]({'plain':!![]});if(!_0x372d16)throw new Error(_0x7236('0x4b'));if(_0x372d16[_0x7236('0x4c')]===_0x7236('0x4a')){var _0x34fc99=_0x2f0817[_0x7236('0x24')]({'plain':!![]});var _0x470f81=_0x7236('0x25');return db[_0x7236('0x4d')]['find']({'where':{'name':_0x470f81,'userProfileId':_0x372d16[_0x7236('0x4e')]},'raw':!![]})[_0x7236('0x22')](function(_0x3940aa){if(_0x3940aa&&_0x3940aa[_0x7236('0x4f')]===0x0){return db['UserProfileResource'][_0x7236('0x49')]({'name':_0x34fc99[_0x7236('0x29')],'resourceId':_0x34fc99['id'],'type':_0x3940aa[_0x7236('0x29')],'sectionId':_0x3940aa['id']},{})[_0x7236('0x22')](function(){return _0x2f0817;});}else{return _0x2f0817;}})[_0x7236('0x44')](function(_0x4ceae2){logger[_0x7236('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ceae2);throw _0x4ceae2;});}return _0x2f0817;})[_0x7236('0x22')](respondWithResult(_0x4ebb31,0xc9))[_0x7236('0x44')](handleError(_0x4ebb31,null));};exports[_0x7236('0x21')]=function(_0x5a875a,_0x3f547e){if(_0x5a875a['body']['id']){delete _0x5a875a['body']['id'];}return db[_0x7236('0x40')]['find']({'where':{'id':_0x5a875a[_0x7236('0x46')]['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x3f547e,null))[_0x7236('0x22')](saveUpdates(_0x5a875a[_0x7236('0x50')],null))['then'](respondWithResult(_0x3f547e,null))[_0x7236('0x44')](handleError(_0x3f547e,null));};exports[_0x7236('0x23')]=function(_0x1be458,_0x4031d5){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x1be458['params']['id']}})[_0x7236('0x22')](handleEntityNotFound(_0x4031d5,null))[_0x7236('0x22')](removeEntity(_0x4031d5,null))[_0x7236('0x44')](handleError(_0x4031d5,null));};exports['download']=function(_0x389089,_0x2ca120,_0x24ccf6){return db[_0x7236('0x40')][_0x7236('0x48')]({'where':{'id':_0x389089[_0x7236('0x46')]['id']},'attributes':['name',_0x7236('0x51'),_0x7236('0x52'),_0x7236('0x53')],'raw':!![]})[_0x7236('0x22')](handleEntityNotFound(_0x2ca120,null))[_0x7236('0x22')](function(_0x32684c){if(_0x32684c){if(!fs[_0x7236('0x54')](path[_0x7236('0x55')](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]))){throw new db[(_0x7236('0x58'))][(_0x7236('0x59'))](_0x7236('0x5a'));}if(_0x389089[_0x7236('0x33')][_0x7236('0x5b')]){return _0x2ca120[_0x7236('0x26')](0xc8);}return _0x2ca120[_0x7236('0x5c')](path['join'](config[_0x7236('0x56')],_0x7236('0x57'),_0x32684c[_0x7236('0x52')]),util[_0x7236('0x5d')]('%s.%s',_0x32684c['basename']||_0x32684c[_0x7236('0x29')],_0x32684c[_0x7236('0x53')][_0x7236('0x5e')]()));}})[_0x7236('0x44')](handleError(_0x2ca120,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2506fb3..f41ea23 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 _0xeb8d=['moment','bluebird','request-promise','path','rimraf','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger'];(function(_0x52a45c,_0x331b52){var _0x4ac4be=function(_0x3167dc){while(--_0x3167dc){_0x52a45c['push'](_0x52a45c['shift']());}};_0x4ac4be(++_0x331b52);}(_0xeb8d,0xce));var _0xdeb8=function(_0x1eb470,_0x52fc1a){_0x1eb470=_0x1eb470-0x0;var _0x48e20f=_0xeb8d[_0x1eb470];return _0x48e20f;};'use strict';var _=require(_0xdeb8('0x0'));var util=require(_0xdeb8('0x1'));var logger=require(_0xdeb8('0x2'))('api');var moment=require(_0xdeb8('0x3'));var BPromise=require(_0xdeb8('0x4'));var rp=require(_0xdeb8('0x5'));var fs=require('fs');var path=require(_0xdeb8('0x6'));var rimraf=require(_0xdeb8('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xdeb8('0x8')]=function(_0x20b8fa,_0x35a019){return _0x20b8fa['define'](_0xdeb8('0x9'),attributes,{'tableName':_0xdeb8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05b5=['path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','util','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x05b5,0x114));var _0x505b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x05b5[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x505b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x505b('0x1'));var BPromise=require(_0x505b('0x2'));var rp=require(_0x505b('0x3'));var fs=require('fs');var path=require(_0x505b('0x4'));var rimraf=require(_0x505b('0x5'));var config=require(_0x505b('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x505b('0x7')]=function(_0xcd07df,_0x2a0a73){return _0xcd07df['define'](_0x505b('0x8'),attributes,{'tableName':_0x505b('0x9'),'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 9351a19..0891a13 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 _0xd087=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x400767,_0x4f362e){var _0x30a53f=function(_0x16c75c){while(--_0x16c75c){_0x400767['push'](_0x400767['shift']());}};_0x30a53f(++_0x4f362e);}(_0xd087,0x1bd));var _0x7d08=function(_0x1b58b8,_0x3e1c2a){_0x1b58b8=_0x1b58b8-0x0;var _0x479502=_0xd087[_0x1b58b8];return _0x479502;};'use strict';var _=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var moment=require(_0x7d08('0x2'));var BPromise=require(_0x7d08('0x3'));var rs=require(_0x7d08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7d08('0x5'));var logger=require(_0x7d08('0x6'))('rpc');var config=require(_0x7d08('0x7'));var jayson=require(_0x7d08('0x8'));var client=jayson[_0x7d08('0x9')][_0x7d08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb977ef,_0x5bbf46,_0x57803a){return new BPromise(function(_0x2578b7,_0x2375a6){return client[_0x7d08('0xb')](_0xb977ef,_0x57803a)[_0x7d08('0xc')](function(_0x2404ce){logger[_0x7d08('0xd')](_0x7d08('0xe'),_0x5bbf46,_0x7d08('0xf'));logger[_0x7d08('0x10')](_0x7d08('0x11'),_0x5bbf46,_0x7d08('0xf'),JSON[_0x7d08('0x12')](_0x2404ce));if(_0x2404ce[_0x7d08('0x13')]){if(_0x2404ce[_0x7d08('0x13')][_0x7d08('0x14')]===0x1f4){logger[_0x7d08('0x13')](_0x7d08('0xe'),_0x5bbf46,_0x2404ce[_0x7d08('0x13')][_0x7d08('0x15')]);return _0x2375a6(_0x2404ce[_0x7d08('0x13')][_0x7d08('0x15')]);}logger[_0x7d08('0x13')](_0x7d08('0xe'),_0x5bbf46,_0x2404ce[_0x7d08('0x13')][_0x7d08('0x15')]);return _0x2578b7(_0x2404ce['error']['message']);}else{logger[_0x7d08('0xd')](_0x7d08('0xe'),_0x5bbf46,_0x7d08('0xf'));_0x2578b7(_0x2404ce[_0x7d08('0x16')][_0x7d08('0x15')]);}})[_0x7d08('0x17')](function(_0x226c4c){logger[_0x7d08('0x13')](_0x7d08('0xe'),_0x5bbf46,_0x226c4c);_0x2375a6(_0x226c4c);});});} \ No newline at end of file +var _0x5b12=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x5b12,0xa3));var _0x25b1=function(_0x1c8d0e,_0x38e48b){_0x1c8d0e=_0x1c8d0e-0x0;var _0x30f9b4=_0x5b12[_0x1c8d0e];return _0x30f9b4;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var moment=require(_0x25b1('0x2'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b1('0x4'))['db'];var utils=require(_0x25b1('0x5'));var logger=require('../../config/logger')(_0x25b1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x25b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb95b,_0x1f715d,_0x28c980){return new BPromise(function(_0x451c66,_0x2a46e0){return client[_0x25b1('0x8')](_0x5bb95b,_0x28c980)[_0x25b1('0x9')](function(_0x3346ed){logger[_0x25b1('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f715d,_0x25b1('0xb'));logger[_0x25b1('0xc')](_0x25b1('0xd'),_0x1f715d,_0x25b1('0xb'),JSON[_0x25b1('0xe')](_0x3346ed));if(_0x3346ed[_0x25b1('0xf')]){if(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x10')]===0x1f4){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);return _0x2a46e0(_0x3346ed[_0x25b1('0xf')][_0x25b1('0x12')]);}logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x3346ed['error'][_0x25b1('0x12')]);return _0x451c66(_0x3346ed[_0x25b1('0xf')]['message']);}else{logger[_0x25b1('0xa')](_0x25b1('0x11'),_0x1f715d,_0x25b1('0xb'));_0x451c66(_0x3346ed['result']['message']);}})[_0x25b1('0x13')](function(_0x573ec2){logger[_0x25b1('0xf')](_0x25b1('0x11'),_0x1f715d,_0x573ec2);_0x2a46e0(_0x573ec2);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 01e62ed..7d2088c 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 _0xfd38=['create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','post'];(function(_0xb45119,_0x90c648){var _0x469da0=function(_0x5ac700){while(--_0x5ac700){_0xb45119['push'](_0xb45119['shift']());}};_0x469da0(++_0x90c648);}(_0xfd38,0xd8));var _0x8fd3=function(_0x406f5c,_0xd2bc06){_0x406f5c=_0x406f5c-0x0;var _0x3120d9=_0xfd38[_0x406f5c];return _0x3120d9;};'use strict';var multer=require(_0x8fd3('0x0'));var util=require(_0x8fd3('0x1'));var path=require('path');var timeout=require(_0x8fd3('0x2'));var express=require(_0x8fd3('0x3'));var router=express[_0x8fd3('0x4')]();var fs_extra=require(_0x8fd3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fd3('0x6'));var config=require(_0x8fd3('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0x8fd3('0x8')]('/',auth[_0x8fd3('0x9')](),controller[_0x8fd3('0xa')]);router[_0x8fd3('0x8')](_0x8fd3('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8fd3('0xc'),auth[_0x8fd3('0x9')](),controller[_0x8fd3('0xd')]);router[_0x8fd3('0xe')]('/',auth[_0x8fd3('0x9')](),controller[_0x8fd3('0xf')]);router[_0x8fd3('0x10')]('/:id',auth[_0x8fd3('0x9')](),controller[_0x8fd3('0x11')]);router[_0x8fd3('0x12')](_0x8fd3('0xb'),auth[_0x8fd3('0x9')](),controller[_0x8fd3('0x13')]);module[_0x8fd3('0x14')]=router; \ No newline at end of file +var _0xb61b=['Router','fs-extra','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','exports','multer','util','express'];(function(_0x3a3f0c,_0x174f79){var _0x184722=function(_0x4fb5c3){while(--_0x4fb5c3){_0x3a3f0c['push'](_0x3a3f0c['shift']());}};_0x184722(++_0x174f79);}(_0xb61b,0xbd));var _0xbb61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb61b[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xbb61('0x0'));var util=require(_0xbb61('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb61('0x2'));var router=express[_0xbb61('0x3')]();var fs_extra=require(_0xbb61('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb61('0x5'));router[_0xbb61('0x6')]('/',auth[_0xbb61('0x7')](),controller[_0xbb61('0x8')]);router[_0xbb61('0x6')](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xa')]);router[_0xbb61('0x6')](_0xbb61('0xb'),auth['isAuthenticated'](),controller[_0xbb61('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbb61('0xd')]);router['put'](_0xbb61('0x9'),auth[_0xbb61('0x7')](),controller[_0xbb61('0xe')]);router['delete']('/:id',auth[_0xbb61('0x7')](),controller['destroy']);module[_0xbb61('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index b88561e..117a9d8 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 _0x7821=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x7821,0xea));var _0x1782=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x7821[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require(_0x1782('0x0'));module[_0x1782('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x1782('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1782('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1782('0x2')]},'custom':{'type':Sequelize[_0x1782('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x932a=['sequelize','exports','STRING','BOOLEAN'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x932a,0x64));var _0xa932=function(_0x247d01,_0x1851fb){_0x247d01=_0x247d01-0x0;var _0xf18e8=_0x932a[_0x247d01];return _0xf18e8;};'use strict';var Sequelize=require(_0xa932('0x0'));module[_0xa932('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa932('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa932('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa932('0x2')]},'custom':{'type':Sequelize[_0xa932('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 4596fb6..27db7ff 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 _0xd33c=['map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','bulkCreate','update','bulkDestroy','addFields','sequelize','CustomReportId','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x332c43,_0x545e88){var _0x20468e=function(_0x3ec7f9){while(--_0x3ec7f9){_0x332c43['push'](_0x332c43['shift']());}};_0x20468e(++_0x545e88);}(_0xd33c,0x7b));var _0xcd33=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xd33c[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcd33('0x0'));var rp=require(_0xcd33('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcd33('0x2'));var util=require(_0xcd33('0x3'));var path=require('path');var sox=require(_0xcd33('0x4'));var csv=require('to-csv');var ejs=require(_0xcd33('0x5'));var fs=require('fs');var fs_extra=require(_0xcd33('0x6'));var _=require('lodash');var squel=require(_0xcd33('0x7'));var crypto=require(_0xcd33('0x8'));var jsforce=require(_0xcd33('0x9'));var deskjs=require(_0xcd33('0xa'));var toCsv=require(_0xcd33('0xb'));var querystring=require(_0xcd33('0xc'));var Papa=require(_0xcd33('0xd'));var Redis=require(_0xcd33('0xe'));var authService=require(_0xcd33('0xf'));var qs=require(_0xcd33('0x10'));var as=require(_0xcd33('0x11'));var hardwareService=require(_0xcd33('0x12'));var logger=require(_0xcd33('0x13'))(_0xcd33('0x14'));var utils=require(_0xcd33('0x15'));var config=require(_0xcd33('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd33('0x17'))['db'];function respondWithStatusCode(_0x364a70,_0x38bb4c){_0x38bb4c=_0x38bb4c||0xcc;return function(_0xaa9338){if(_0xaa9338){return _0x364a70['sendStatus'](_0x38bb4c);}return _0x364a70[_0xcd33('0x18')](_0x38bb4c)[_0xcd33('0x19')]();};}function respondWithResult(_0x5f9a3,_0xe0269e){_0xe0269e=_0xe0269e||0xc8;return function(_0x4c58b6){if(_0x4c58b6){return _0x5f9a3['status'](_0xe0269e)[_0xcd33('0x1a')](_0x4c58b6);}};}function respondWithFilteredResult(_0x423d93,_0x3bcab3){return function(_0x12fed8){if(_0x12fed8){var _0x294a70=typeof _0x3bcab3[_0xcd33('0x1b')]===_0xcd33('0x1c')&&typeof _0x3bcab3[_0xcd33('0x1d')]===_0xcd33('0x1c');var _0x53eb23=_0x12fed8['count'];var _0x520899=_0x294a70?0x0:_0x3bcab3[_0xcd33('0x1b')];var _0x4dcb7e=_0x294a70?_0x12fed8[_0xcd33('0x1e')]:_0x3bcab3[_0xcd33('0x1b')]+_0x3bcab3[_0xcd33('0x1d')];var _0x17c415;if(_0x4dcb7e>=_0x53eb23){_0x4dcb7e=_0x53eb23;_0x17c415=0xc8;}else{_0x17c415=0xce;}_0x423d93['status'](_0x17c415);return _0x423d93[_0xcd33('0x1f')](_0xcd33('0x20'),_0x520899+'-'+_0x4dcb7e+'/'+_0x53eb23)['json'](_0x12fed8);}return null;};}function patchUpdates(_0x37a5f6){return function(_0x2dcb66){try{jsonpatch[_0xcd33('0x21')](_0x2dcb66,_0x37a5f6,!![]);}catch(_0x1383ee){return BPromise['reject'](_0x1383ee);}return _0x2dcb66[_0xcd33('0x22')]();};}function saveUpdates(_0x191695,_0x53724d){return function(_0x4d6b3f){if(_0x4d6b3f){return _0x4d6b3f['update'](_0x191695)[_0xcd33('0x23')](function(_0xb3ace2){return _0xb3ace2;});}return null;};}function removeEntity(_0x19bd13,_0x461610){return function(_0x38065a){if(_0x38065a){return _0x38065a[_0xcd33('0x24')]()['then'](function(){_0x19bd13[_0xcd33('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1585e3,_0x16d36c){return function(_0x244b91){if(!_0x244b91){_0x1585e3[_0xcd33('0x25')](0x194);}return _0x244b91;};}function handleError(_0xbf38bc,_0x315456){_0x315456=_0x315456||0x1f4;return function(_0x5c6466){logger[_0xcd33('0x26')](_0x5c6466[_0xcd33('0x27')]);if(_0x5c6466[_0xcd33('0x28')]){delete _0x5c6466['name'];}_0xbf38bc[_0xcd33('0x18')](_0x315456)[_0xcd33('0x29')](_0x5c6466);};}exports[_0xcd33('0x2a')]=function(_0x45a381,_0x5b6bc0){var _0x3ccc6d={},_0x45e44a={},_0x29269e={'count':0x0,'rows':[]};var _0x30ee1a=_[_0xcd33('0x2b')](db[_0xcd33('0x2c')][_0xcd33('0x2d')],function(_0x40601e){return{'name':_0x40601e[_0xcd33('0x2e')],'type':_0x40601e['type'][_0xcd33('0x2f')]};});_0x45e44a[_0xcd33('0x30')]=_['map'](_0x30ee1a,'name');_0x45e44a[_0xcd33('0x31')]=_[_0xcd33('0x32')](_0x45a381[_0xcd33('0x31')]);_0x45e44a[_0xcd33('0x33')]=_[_0xcd33('0x34')](_0x45e44a[_0xcd33('0x30')],_0x45e44a['query']);_0x3ccc6d[_0xcd33('0x35')]=_['intersection'](_0x45e44a[_0xcd33('0x30')],qs[_0xcd33('0x36')](_0x45a381[_0xcd33('0x31')]['fields']));_0x3ccc6d[_0xcd33('0x35')]=_0x3ccc6d[_0xcd33('0x35')][_0xcd33('0x37')]?_0x3ccc6d[_0xcd33('0x35')]:_0x45e44a[_0xcd33('0x30')];if(!_0x45a381['query'][_0xcd33('0x38')](_0xcd33('0x39'))){_0x3ccc6d[_0xcd33('0x1d')]=qs[_0xcd33('0x1d')](_0x45a381[_0xcd33('0x31')][_0xcd33('0x1d')]);_0x3ccc6d[_0xcd33('0x1b')]=qs[_0xcd33('0x1b')](_0x45a381['query'][_0xcd33('0x1b')]);}_0x3ccc6d[_0xcd33('0x3a')]=qs['sort'](_0x45a381[_0xcd33('0x31')][_0xcd33('0x3b')]);_0x3ccc6d[_0xcd33('0x3c')]=qs[_0xcd33('0x33')](_[_0xcd33('0x3d')](_0x45a381[_0xcd33('0x31')],_0x45e44a[_0xcd33('0x33')]),_0x30ee1a);if(_0x45a381[_0xcd33('0x31')]['filter']){_0x3ccc6d[_0xcd33('0x3c')]=_[_0xcd33('0x3e')](_0x3ccc6d[_0xcd33('0x3c')],{'$or':_['map'](_0x30ee1a,function(_0x5e77a2){if(_0x5e77a2[_0xcd33('0x3f')]!==_0xcd33('0x40')){var _0x57c52d={};_0x57c52d[_0x5e77a2[_0xcd33('0x28')]]={'$like':'%'+_0x45a381[_0xcd33('0x31')][_0xcd33('0x41')]+'%'};return _0x57c52d;}})});}_0x3ccc6d=_[_0xcd33('0x3e')]({},_0x3ccc6d,_0x45a381[_0xcd33('0x42')]);var _0x503105={'where':_0x3ccc6d[_0xcd33('0x3c')]};return db[_0xcd33('0x2c')][_0xcd33('0x1e')](_0x503105)[_0xcd33('0x23')](function(_0x574011){_0x29269e[_0xcd33('0x1e')]=_0x574011;if(_0x45a381[_0xcd33('0x31')][_0xcd33('0x43')]){_0x3ccc6d[_0xcd33('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xcd33('0x45')](_0x3ccc6d);})['then'](function(_0x43451a){_0x29269e[_0xcd33('0x46')]=_0x43451a;return _0x29269e;})[_0xcd33('0x23')](respondWithFilteredResult(_0x5b6bc0,_0x3ccc6d))['catch'](handleError(_0x5b6bc0,null));};exports[_0xcd33('0x47')]=function(_0x3da115,_0x417967){var _0x551fc7={'raw':![],'where':{'id':_0x3da115[_0xcd33('0x48')]['id']}},_0x41bb8c={};_0x41bb8c[_0xcd33('0x30')]=_[_0xcd33('0x32')](db[_0xcd33('0x2c')][_0xcd33('0x2d')]);_0x41bb8c[_0xcd33('0x31')]=_['keys'](_0x3da115['query']);_0x41bb8c[_0xcd33('0x33')]=_[_0xcd33('0x34')](_0x41bb8c[_0xcd33('0x30')],_0x41bb8c[_0xcd33('0x31')]);_0x551fc7[_0xcd33('0x35')]=_['intersection'](_0x41bb8c['model'],qs[_0xcd33('0x36')](_0x3da115[_0xcd33('0x31')][_0xcd33('0x36')]));_0x551fc7[_0xcd33('0x35')]=_0x551fc7[_0xcd33('0x35')][_0xcd33('0x37')]?_0x551fc7['attributes']:_0x41bb8c[_0xcd33('0x30')];if(_0x3da115[_0xcd33('0x31')][_0xcd33('0x43')]){_0x551fc7[_0xcd33('0x44')]=[{'all':!![]}];}_0x551fc7=_['merge']({},_0x551fc7,_0x3da115[_0xcd33('0x42')]);return db['AnalyticFieldReport'][_0xcd33('0x49')](_0x551fc7)['then'](handleEntityNotFound(_0x417967,null))[_0xcd33('0x23')](respondWithResult(_0x417967,null))[_0xcd33('0x4a')](handleError(_0x417967,null));};exports[_0xcd33('0x4b')]=function(_0x65d30d,_0x55f470){return db[_0xcd33('0x2c')]['create'](_0x65d30d[_0xcd33('0x4c')],{})['then'](respondWithResult(_0x55f470,0xc9))['catch'](handleError(_0x55f470,null));};exports[_0xcd33('0x4d')]=function(_0x3b2920,_0x27d299){return db['AnalyticFieldReport']['bulkCreate'](_0x3b2920['body'],{'raw':![],'individualHooks':!![]})[_0xcd33('0x23')](respondWithResult(_0x27d299,0xc9))[_0xcd33('0x4a')](handleError(_0x27d299,null));};exports[_0xcd33('0x4e')]=function(_0x252e53,_0x376d40){if(_0x252e53['body']['id']){delete _0x252e53[_0xcd33('0x4c')]['id'];}return db[_0xcd33('0x2c')][_0xcd33('0x49')]({'where':{'id':_0x252e53[_0xcd33('0x48')]['id']}})[_0xcd33('0x23')](handleEntityNotFound(_0x376d40,null))[_0xcd33('0x23')](saveUpdates(_0x252e53['body'],null))[_0xcd33('0x23')](respondWithResult(_0x376d40,null))[_0xcd33('0x4a')](handleError(_0x376d40,null));};exports['destroy']=function(_0x289e9e,_0x309372){return db['AnalyticFieldReport'][_0xcd33('0x49')]({'where':{'id':_0x289e9e[_0xcd33('0x48')]['id']}})[_0xcd33('0x23')](handleEntityNotFound(_0x309372,null))[_0xcd33('0x23')](removeEntity(_0x309372,null))[_0xcd33('0x4a')](handleError(_0x309372,null));};exports[_0xcd33('0x4f')]=function(_0x35262f,_0x3cc813){return db[_0xcd33('0x2c')][_0xcd33('0x24')]({'where':{'id':_0x35262f[_0xcd33('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xcd33('0x23')](respondWithResult(_0x3cc813,0xcc))['catch'](handleError(_0x3cc813,null));};exports[_0xcd33('0x50')]=function(_0x2b214c,_0x5615ec,_0xbe8b97){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2b214c[_0xcd33('0x48')]['id']}})[_0xcd33('0x23')](handleEntityNotFound(_0x5615ec,null))[_0xcd33('0x23')](function(_0x43cdb7){if(_0x43cdb7){return db[_0xcd33('0x51')]['transaction'](function(_0x3bfff7){return db['AnalyticFieldReport'][_0xcd33('0x24')]({'where':{'CustomReportId':_0x2b214c['params']['id']},'transaction':_0x3bfff7})[_0xcd33('0x23')](function(_0x28fb95){var _0x432055=_['map'](_0x2b214c[_0xcd33('0x4c')],function(_0x58a9e8){delete _0x58a9e8['id'];_0x58a9e8[_0xcd33('0x52')]=_0x2b214c[_0xcd33('0x48')]['id'];return _0x58a9e8;});return db[_0xcd33('0x2c')][_0xcd33('0x4d')](_0x432055,{'transaction':_0x3bfff7});});})[_0xcd33('0x23')](function(){return db['AnalyticFieldReport'][_0xcd33('0x45')]({'where':{'CustomReportId':_0x2b214c[_0xcd33('0x48')]['id']}});});}})['then'](respondWithResult(_0x5615ec,null))['catch'](handleError(_0x5615ec,null));}; \ No newline at end of file +var _0xb642=['fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticFieldReport','rows','catch','params','keys','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','findOne','sequelize','transaction','findAll','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb642,0x15d));var _0x2b64=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xb642[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b64('0x0'));var zipdir=require(_0x2b64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b64('0x2'));var moment=require(_0x2b64('0x3'));var BPromise=require(_0x2b64('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b64('0x5'));var sox=require('sox');var csv=require(_0x2b64('0x6'));var ejs=require(_0x2b64('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b64('0x8'));var squel=require(_0x2b64('0x9'));var crypto=require(_0x2b64('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2b64('0xb'));var toCsv=require(_0x2b64('0x6'));var querystring=require(_0x2b64('0xc'));var Papa=require('papaparse');var Redis=require(_0x2b64('0xd'));var authService=require(_0x2b64('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b64('0xf'));var logger=require(_0x2b64('0x10'))(_0x2b64('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2b64('0x12'));var db=require(_0x2b64('0x13'))['db'];function respondWithStatusCode(_0x1c8a6d,_0x1f1bfd){_0x1f1bfd=_0x1f1bfd||0xcc;return function(_0x135a8b){if(_0x135a8b){return _0x1c8a6d[_0x2b64('0x14')](_0x1f1bfd);}return _0x1c8a6d[_0x2b64('0x15')](_0x1f1bfd)[_0x2b64('0x16')]();};}function respondWithResult(_0x4a6d40,_0x3cd9c3){_0x3cd9c3=_0x3cd9c3||0xc8;return function(_0x49e0cc){if(_0x49e0cc){return _0x4a6d40[_0x2b64('0x15')](_0x3cd9c3)['json'](_0x49e0cc);}};}function respondWithFilteredResult(_0x6897a9,_0x762c03){return function(_0x272ad6){if(_0x272ad6){var _0x3e1675=typeof _0x762c03[_0x2b64('0x17')]===_0x2b64('0x18')&&typeof _0x762c03[_0x2b64('0x19')]==='undefined';var _0x49f71e=_0x272ad6['count'];var _0x356a18=_0x3e1675?0x0:_0x762c03[_0x2b64('0x17')];var _0x26a6ef=_0x3e1675?_0x272ad6[_0x2b64('0x1a')]:_0x762c03[_0x2b64('0x17')]+_0x762c03['limit'];var _0x3c6c62;if(_0x26a6ef>=_0x49f71e){_0x26a6ef=_0x49f71e;_0x3c6c62=0xc8;}else{_0x3c6c62=0xce;}_0x6897a9['status'](_0x3c6c62);return _0x6897a9[_0x2b64('0x1b')](_0x2b64('0x1c'),_0x356a18+'-'+_0x26a6ef+'/'+_0x49f71e)[_0x2b64('0x1d')](_0x272ad6);}return null;};}function patchUpdates(_0x35e8d2){return function(_0xa3c626){try{jsonpatch['apply'](_0xa3c626,_0x35e8d2,!![]);}catch(_0x322c96){return BPromise[_0x2b64('0x1e')](_0x322c96);}return _0xa3c626['save']();};}function saveUpdates(_0x37ccfa,_0x5871bc){return function(_0x14416f){if(_0x14416f){return _0x14416f[_0x2b64('0x1f')](_0x37ccfa)[_0x2b64('0x20')](function(_0xb664ce){return _0xb664ce;});}return null;};}function removeEntity(_0x4210e2,_0x39c08b){return function(_0x4be1f1){if(_0x4be1f1){return _0x4be1f1[_0x2b64('0x21')]()[_0x2b64('0x20')](function(){_0x4210e2[_0x2b64('0x15')](0xcc)[_0x2b64('0x16')]();});}};}function handleEntityNotFound(_0x30a93e,_0x4f4ec9){return function(_0xd94601){if(!_0xd94601){_0x30a93e[_0x2b64('0x14')](0x194);}return _0xd94601;};}function handleError(_0x149e97,_0xc2f3ed){_0xc2f3ed=_0xc2f3ed||0x1f4;return function(_0x2b5c19){logger[_0x2b64('0x22')](_0x2b5c19[_0x2b64('0x23')]);if(_0x2b5c19[_0x2b64('0x24')]){delete _0x2b5c19[_0x2b64('0x24')];}_0x149e97[_0x2b64('0x15')](_0xc2f3ed)[_0x2b64('0x25')](_0x2b5c19);};}exports[_0x2b64('0x26')]=function(_0x4a5188,_0x224763){var _0x3cf5fc={},_0x1ab1d2={},_0x463a0d={'count':0x0,'rows':[]};var _0x55fd7a=_[_0x2b64('0x27')](db['AnalyticFieldReport'][_0x2b64('0x28')],function(_0x234312){return{'name':_0x234312[_0x2b64('0x29')],'type':_0x234312[_0x2b64('0x2a')][_0x2b64('0x2b')]};});_0x1ab1d2['model']=_[_0x2b64('0x27')](_0x55fd7a,_0x2b64('0x24'));_0x1ab1d2[_0x2b64('0x2c')]=_['keys'](_0x4a5188['query']);_0x1ab1d2[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x1ab1d2[_0x2b64('0x2f')],_0x1ab1d2[_0x2b64('0x2c')]);_0x3cf5fc[_0x2b64('0x30')]=_['intersection'](_0x1ab1d2['model'],qs[_0x2b64('0x31')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x3cf5fc[_0x2b64('0x30')]=_0x3cf5fc[_0x2b64('0x30')][_0x2b64('0x32')]?_0x3cf5fc[_0x2b64('0x30')]:_0x1ab1d2[_0x2b64('0x2f')];if(!_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x33')](_0x2b64('0x34'))){_0x3cf5fc['limit']=qs[_0x2b64('0x19')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x19')]);_0x3cf5fc['offset']=qs['offset'](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x17')]);}_0x3cf5fc['order']=qs[_0x2b64('0x35')](_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x35')]);_0x3cf5fc[_0x2b64('0x36')]=qs[_0x2b64('0x2d')](_[_0x2b64('0x37')](_0x4a5188['query'],_0x1ab1d2[_0x2b64('0x2d')]),_0x55fd7a);if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]){_0x3cf5fc['where']=_[_0x2b64('0x39')](_0x3cf5fc['where'],{'$or':_[_0x2b64('0x27')](_0x55fd7a,function(_0x15e999){if(_0x15e999[_0x2b64('0x2a')]!==_0x2b64('0x3a')){var _0x4f21d0={};_0x4f21d0[_0x15e999[_0x2b64('0x24')]]={'$like':'%'+_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x38')]+'%'};return _0x4f21d0;}})});}_0x3cf5fc=_[_0x2b64('0x39')]({},_0x3cf5fc,_0x4a5188['options']);var _0x17603e={'where':_0x3cf5fc[_0x2b64('0x36')]};return db['AnalyticFieldReport']['count'](_0x17603e)['then'](function(_0x5aa7fb){_0x463a0d[_0x2b64('0x1a')]=_0x5aa7fb;if(_0x4a5188[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x3cf5fc[_0x2b64('0x3c')]=[{'all':!![]}];}return db[_0x2b64('0x3d')]['findAll'](_0x3cf5fc);})['then'](function(_0x340e1a){_0x463a0d[_0x2b64('0x3e')]=_0x340e1a;return _0x463a0d;})[_0x2b64('0x20')](respondWithFilteredResult(_0x224763,_0x3cf5fc))[_0x2b64('0x3f')](handleError(_0x224763,null));};exports['show']=function(_0x1da8bc,_0x5db4af){var _0x42bd9d={'raw':![],'where':{'id':_0x1da8bc[_0x2b64('0x40')]['id']}},_0x3dd6d0={};_0x3dd6d0['model']=_[_0x2b64('0x41')](db[_0x2b64('0x3d')][_0x2b64('0x28')]);_0x3dd6d0[_0x2b64('0x2c')]=_[_0x2b64('0x41')](_0x1da8bc['query']);_0x3dd6d0[_0x2b64('0x2d')]=_[_0x2b64('0x2e')](_0x3dd6d0[_0x2b64('0x2f')],_0x3dd6d0[_0x2b64('0x2c')]);_0x42bd9d[_0x2b64('0x30')]=_[_0x2b64('0x2e')](_0x3dd6d0['model'],qs[_0x2b64('0x31')](_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x31')]));_0x42bd9d[_0x2b64('0x30')]=_0x42bd9d[_0x2b64('0x30')][_0x2b64('0x32')]?_0x42bd9d[_0x2b64('0x30')]:_0x3dd6d0[_0x2b64('0x2f')];if(_0x1da8bc[_0x2b64('0x2c')][_0x2b64('0x3b')]){_0x42bd9d[_0x2b64('0x3c')]=[{'all':!![]}];}_0x42bd9d=_[_0x2b64('0x39')]({},_0x42bd9d,_0x1da8bc[_0x2b64('0x42')]);return db['AnalyticFieldReport'][_0x2b64('0x43')](_0x42bd9d)['then'](handleEntityNotFound(_0x5db4af,null))[_0x2b64('0x20')](respondWithResult(_0x5db4af,null))[_0x2b64('0x3f')](handleError(_0x5db4af,null));};exports['create']=function(_0xf652e5,_0x192fe4){return db[_0x2b64('0x3d')][_0x2b64('0x44')](_0xf652e5[_0x2b64('0x45')],{})['then'](respondWithResult(_0x192fe4,0xc9))[_0x2b64('0x3f')](handleError(_0x192fe4,null));};exports[_0x2b64('0x46')]=function(_0x49fda3,_0x45960b){return db['AnalyticFieldReport']['bulkCreate'](_0x49fda3[_0x2b64('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45960b,0xc9))[_0x2b64('0x3f')](handleError(_0x45960b,null));};exports[_0x2b64('0x1f')]=function(_0x537c60,_0x5a35f5){if(_0x537c60['body']['id']){delete _0x537c60[_0x2b64('0x45')]['id'];}return db[_0x2b64('0x3d')][_0x2b64('0x43')]({'where':{'id':_0x537c60['params']['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x5a35f5,null))[_0x2b64('0x20')](saveUpdates(_0x537c60[_0x2b64('0x45')],null))['then'](respondWithResult(_0x5a35f5,null))[_0x2b64('0x3f')](handleError(_0x5a35f5,null));};exports['destroy']=function(_0xcdfcd2,_0x58a529){return db[_0x2b64('0x3d')]['find']({'where':{'id':_0xcdfcd2[_0x2b64('0x40')]['id']}})['then'](handleEntityNotFound(_0x58a529,null))[_0x2b64('0x20')](removeEntity(_0x58a529,null))[_0x2b64('0x3f')](handleError(_0x58a529,null));};exports[_0x2b64('0x47')]=function(_0x285694,_0x10d0c7){return db[_0x2b64('0x3d')][_0x2b64('0x21')]({'where':{'id':_0x285694[_0x2b64('0x2c')][_0x2b64('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x2b64('0x20')](respondWithResult(_0x10d0c7,0xcc))['catch'](handleError(_0x10d0c7,null));};exports[_0x2b64('0x49')]=function(_0x224eea,_0x48c224,_0x40cb1e){return db['AnalyticCustomReport'][_0x2b64('0x4a')]({'where':{'id':_0x224eea[_0x2b64('0x40')]['id']}})[_0x2b64('0x20')](handleEntityNotFound(_0x48c224,null))[_0x2b64('0x20')](function(_0x75f2dd){if(_0x75f2dd){return db[_0x2b64('0x4b')][_0x2b64('0x4c')](function(_0x50300b){return db['AnalyticFieldReport'][_0x2b64('0x21')]({'where':{'CustomReportId':_0x224eea[_0x2b64('0x40')]['id']},'transaction':_0x50300b})['then'](function(_0x2b7ced){var _0x1348d7=_[_0x2b64('0x27')](_0x224eea[_0x2b64('0x45')],function(_0x3a0656){delete _0x3a0656['id'];_0x3a0656['CustomReportId']=_0x224eea['params']['id'];return _0x3a0656;});return db[_0x2b64('0x3d')]['bulkCreate'](_0x1348d7,{'transaction':_0x50300b});});})['then'](function(){return db[_0x2b64('0x3d')][_0x2b64('0x4d')]({'where':{'CustomReportId':_0x224eea['params']['id']}});});}})['then'](respondWithResult(_0x48c224,null))[_0x2b64('0x3f')](handleError(_0x48c224,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9a7a267..9f7494b 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 _0x6222=['bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x2638ea,_0x371b8b){var _0x340f66=function(_0x5f0e31){while(--_0x5f0e31){_0x2638ea['push'](_0x2638ea['shift']());}};_0x340f66(++_0x371b8b);}(_0x6222,0x1bb));var _0x2622=function(_0x124a46,_0x3fde31){_0x124a46=_0x124a46-0x0;var _0x194ec7=_0x6222[_0x124a46];return _0x194ec7;};'use strict';var _=require(_0x2622('0x0'));var util=require(_0x2622('0x1'));var logger=require(_0x2622('0x2'))(_0x2622('0x3'));var moment=require(_0x2622('0x4'));var BPromise=require(_0x2622('0x5'));var rp=require(_0x2622('0x6'));var fs=require('fs');var path=require(_0x2622('0x7'));var rimraf=require(_0x2622('0x8'));var config=require('../../config/environment');var attributes=require(_0x2622('0x9'));module[_0x2622('0xa')]=function(_0x162b52,_0x5ab5b6){return _0x162b52[_0x2622('0xb')](_0x2622('0xc'),attributes,{'tableName':_0x2622('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea85=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x58b095,_0x13df00){var _0x3cb122=function(_0x20124e){while(--_0x20124e){_0x58b095['push'](_0x58b095['shift']());}};_0x3cb122(++_0x13df00);}(_0xea85,0xec));var _0x5ea8=function(_0xeae901,_0x33afa0){_0xeae901=_0xeae901-0x0;var _0x491531=_0xea85[_0xeae901];return _0x491531;};'use strict';var _=require('lodash');var util=require(_0x5ea8('0x0'));var logger=require('../../config/logger')(_0x5ea8('0x1'));var moment=require('moment');var BPromise=require(_0x5ea8('0x2'));var rp=require(_0x5ea8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ea8('0x4'));var config=require(_0x5ea8('0x5'));var attributes=require(_0x5ea8('0x6'));module[_0x5ea8('0x7')]=function(_0x171603,_0x5aa784){return _0x171603[_0x5ea8('0x8')](_0x5ea8('0x9'),attributes,{'tableName':_0x5ea8('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 4216271..7d79d3d 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 _0x6761=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x6761,0xde));var _0x1676=function(_0x320a35,_0x8205bf){_0x320a35=_0x320a35-0x0;var _0x65836=_0x6761[_0x320a35];return _0x65836;};'use strict';var _=require(_0x1676('0x0'));var util=require(_0x1676('0x1'));var moment=require(_0x1676('0x2'));var BPromise=require('bluebird');var rs=require(_0x1676('0x3'));var fs=require('fs');var Redis=require(_0x1676('0x4'));var db=require(_0x1676('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1676('0x6'));var config=require('../../config/environment');var jayson=require(_0x1676('0x7'));var client=jayson[_0x1676('0x8')][_0x1676('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24b351,_0x279ecc,_0x46c386){return new BPromise(function(_0x5a4c9d,_0x25de52){return client[_0x1676('0xa')](_0x24b351,_0x46c386)[_0x1676('0xb')](function(_0xba3319){logger[_0x1676('0xc')](_0x1676('0xd'),_0x279ecc,'request\x20sent');logger['debug'](_0x1676('0xe'),_0x279ecc,_0x1676('0xf'),JSON[_0x1676('0x10')](_0xba3319));if(_0xba3319[_0x1676('0x11')]){if(_0xba3319[_0x1676('0x11')][_0x1676('0x12')]===0x1f4){logger[_0x1676('0x11')](_0x1676('0xd'),_0x279ecc,_0xba3319[_0x1676('0x11')][_0x1676('0x13')]);return _0x25de52(_0xba3319['error'][_0x1676('0x13')]);}logger['error'](_0x1676('0xd'),_0x279ecc,_0xba3319['error'][_0x1676('0x13')]);return _0x5a4c9d(_0xba3319[_0x1676('0x11')]['message']);}else{logger[_0x1676('0xc')](_0x1676('0xd'),_0x279ecc,_0x1676('0xf'));_0x5a4c9d(_0xba3319[_0x1676('0x14')][_0x1676('0x13')]);}})[_0x1676('0x15')](function(_0x328ebc){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x279ecc,_0x328ebc);_0x25de52(_0x328ebc);});});} \ No newline at end of file +var _0xffa8=['AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xffa8,0x170));var _0x8ffa=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xffa8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x8ffa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8ffa('0x1'));var fs=require('fs');var Redis=require(_0x8ffa('0x2'));var db=require(_0x8ffa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ffa('0x4'))(_0x8ffa('0x5'));var config=require(_0x8ffa('0x6'));var jayson=require(_0x8ffa('0x7'));var client=jayson[_0x8ffa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e5e72,_0x362fe0,_0x131e40){return new BPromise(function(_0x3fd5d2,_0x536a63){return client[_0x8ffa('0x9')](_0x1e5e72,_0x131e40)[_0x8ffa('0xa')](function(_0x364ac6){logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,'request\x20sent');logger[_0x8ffa('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x362fe0,_0x8ffa('0xe'),JSON[_0x8ffa('0xf')](_0x364ac6));if(_0x364ac6['error']){if(_0x364ac6['error'][_0x8ffa('0x10')]===0x1f4){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);return _0x536a63(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}logger[_0x8ffa('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x362fe0,_0x364ac6['error'][_0x8ffa('0x12')]);return _0x3fd5d2(_0x364ac6[_0x8ffa('0x11')][_0x8ffa('0x12')]);}else{logger[_0x8ffa('0xb')](_0x8ffa('0xc'),_0x362fe0,_0x8ffa('0xe'));_0x3fd5d2(_0x364ac6['result'][_0x8ffa('0x12')]);}})[_0x8ffa('0x13')](function(_0x39f164){logger[_0x8ffa('0x11')](_0x8ffa('0xc'),_0x362fe0,_0x39f164);_0x536a63(_0x39f164);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 804b7c6..32066f7 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(_0x5b4f63,_0x5b09ef){var _0x42f7cb=function(_0x4b52e6){while(--_0x4b52e6){_0x5b4f63['push'](_0x5b4f63['shift']());}};_0x42f7cb(++_0x5b09ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0xc153db,_0x516c10){var _0x4dc97d=function(_0x10fc05){while(--_0x10fc05){_0xc153db['push'](_0xc153db['shift']());}};_0x4dc97d(++_0x516c10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 0ccc942..9725838 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 _0xc9c3=['name','exports','STRING'];(function(_0x39aeca,_0x214a96){var _0x13856e=function(_0x1e243a){while(--_0x1e243a){_0x39aeca['push'](_0x39aeca['shift']());}};_0x13856e(++_0x214a96);}(_0xc9c3,0xd0));var _0x3c9c=function(_0x4490b8,_0xf6dbd3){_0x4490b8=_0x4490b8-0x0;var _0x326831=_0xc9c3[_0x4490b8];return _0x326831;};'use strict';var Sequelize=require('sequelize');module[_0x3c9c('0x0')]={'name':{'type':Sequelize[_0x3c9c('0x1')],'allowNull':![],'unique':_0x3c9c('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3c9c('0x1')]}}; \ No newline at end of file +var _0x7c59=['exports','STRING','name'];(function(_0x54214c,_0x278464){var _0x4b9671=function(_0x17b6d8){while(--_0x17b6d8){_0x54214c['push'](_0x54214c['shift']());}};_0x4b9671(++_0x278464);}(_0x7c59,0x147));var _0x97c5=function(_0x21b613,_0x18972f){_0x21b613=_0x21b613-0x0;var _0x266727=_0x7c59[_0x21b613];return _0x266727;};'use strict';var Sequelize=require('sequelize');module[_0x97c5('0x0')]={'name':{'type':Sequelize[_0x97c5('0x1')],'allowNull':![],'unique':_0x97c5('0x2')},'table':{'type':Sequelize[_0x97c5('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x97c5('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 9f98c3a..6f2650e 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x556bf7,_0xa7429b){var _0x97b6c5=function(_0x794986){while(--_0x794986){_0x556bf7['push'](_0x556bf7['shift']());}};_0x97b6c5(++_0xa7429b);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5bf8d1,_0x5ad31e){_0x5bf8d1=_0x5bf8d1-0x0;var _0x8d51b3=_0xdc97[_0x5bf8d1];return _0x8d51b3;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));}; \ No newline at end of file +var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x6dd3c1,_0x53cf52){var _0xdef05a=function(_0x26a262){while(--_0x26a262){_0x6dd3c1['push'](_0x6dd3c1['shift']());}};_0xdef05a(++_0x53cf52);}(_0x008c,0x188));var _0xc008=function(_0xf5b712,_0x5487bf){_0xf5b712=_0xf5b712-0x0;var _0x410413=_0x008c[_0xf5b712];return _0x410413;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 26b8329..dd0154e 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 _0x5581=['AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x5581,0x115));var _0x1558=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x5581[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x1558('0x0'));var util=require('util');var logger=require(_0x1558('0x1'))(_0x1558('0x2'));var moment=require(_0x1558('0x3'));var BPromise=require(_0x1558('0x4'));var rp=require(_0x1558('0x5'));var fs=require('fs');var path=require(_0x1558('0x6'));var rimraf=require('rimraf');var config=require(_0x1558('0x7'));var attributes=require(_0x1558('0x8'));module['exports']=function(_0x24c333,_0xcaef09){return _0x24c333['define'](_0x1558('0x9'),attributes,{'tableName':_0x1558('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd3c=['bluebird','request-promise','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x37e343,_0x5dbfea){var _0xf688dc=function(_0x3b4766){while(--_0x3b4766){_0x37e343['push'](_0x37e343['shift']());}};_0xf688dc(++_0x5dbfea);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x230be7,_0x26d232){_0x230be7=_0x230be7-0x0;var _0x10983b=_0xbd3c[_0x230be7];return _0x10983b;};'use strict';var _=require(_0xcbd3('0x0'));var util=require(_0xcbd3('0x1'));var logger=require(_0xcbd3('0x2'))('api');var moment=require(_0xcbd3('0x3'));var BPromise=require(_0xcbd3('0x4'));var rp=require(_0xcbd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbd3('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xcbd3('0x7')]=function(_0x3e5103,_0x5b27a3){return _0x3e5103[_0xcbd3('0x8')](_0xcbd3('0x9'),attributes,{'tableName':_0xcbd3('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 3fe0c9a..35f8a78 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 _0xc482=['bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0xc482,0x165));var _0x2c48=function(_0x407c65,_0x60fc4a){_0x407c65=_0x407c65-0x0;var _0x21890c=_0xc482[_0x407c65];return _0x21890c;};'use strict';var _=require(_0x2c48('0x0'));var util=require(_0x2c48('0x1'));var moment=require(_0x2c48('0x2'));var BPromise=require(_0x2c48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2c48('0x4'));var logger=require('../../config/logger')(_0x2c48('0x5'));var config=require(_0x2c48('0x6'));var jayson=require(_0x2c48('0x7'));var client=jayson['client'][_0x2c48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57644f,_0x4feaf7,_0x530cb7){return new BPromise(function(_0x4d6e99,_0x8a8dc8){return client[_0x2c48('0x9')](_0x57644f,_0x530cb7)[_0x2c48('0xa')](function(_0x5b7ae4){logger[_0x2c48('0xb')](_0x2c48('0xc'),_0x4feaf7,_0x2c48('0xd'));logger['debug'](_0x2c48('0xe'),_0x4feaf7,_0x2c48('0xd'),JSON['stringify'](_0x5b7ae4));if(_0x5b7ae4[_0x2c48('0xf')]){if(_0x5b7ae4['error']['code']===0x1f4){logger[_0x2c48('0xf')](_0x2c48('0xc'),_0x4feaf7,_0x5b7ae4[_0x2c48('0xf')][_0x2c48('0x10')]);return _0x8a8dc8(_0x5b7ae4[_0x2c48('0xf')][_0x2c48('0x10')]);}logger[_0x2c48('0xf')](_0x2c48('0xc'),_0x4feaf7,_0x5b7ae4['error'][_0x2c48('0x10')]);return _0x4d6e99(_0x5b7ae4['error'][_0x2c48('0x10')]);}else{logger[_0x2c48('0xb')](_0x2c48('0xc'),_0x4feaf7,_0x2c48('0xd'));_0x4d6e99(_0x5b7ae4['result'][_0x2c48('0x10')]);}})[_0x2c48('0x11')](function(_0x5cccd6){logger['error'](_0x2c48('0xc'),_0x4feaf7,_0x5cccd6);_0x8a8dc8(_0x5cccd6);});});} \ No newline at end of file +var _0x184f=['http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x17770a,_0xe0364f){var _0x525494=function(_0x51f212){while(--_0x51f212){_0x17770a['push'](_0x17770a['shift']());}};_0x525494(++_0xe0364f);}(_0x184f,0x17c));var _0xf184=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x184f[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0xf184('0x0'));var util=require(_0xf184('0x1'));var moment=require(_0xf184('0x2'));var BPromise=require(_0xf184('0x3'));var rs=require(_0xf184('0x4'));var fs=require('fs');var Redis=require(_0xf184('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf184('0x6'));var logger=require(_0xf184('0x7'))(_0xf184('0x8'));var config=require(_0xf184('0x9'));var jayson=require(_0xf184('0xa'));var client=jayson['client'][_0xf184('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x260323,_0x3e2615,_0x2f7242){return new BPromise(function(_0x3e8071,_0x3f34a7){return client['request'](_0x260323,_0x2f7242)[_0xf184('0xc')](function(_0x3ea5c4){logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));logger[_0xf184('0x10')](_0xf184('0x11'),_0x3e2615,_0xf184('0xf'),JSON[_0xf184('0x12')](_0x3ea5c4));if(_0x3ea5c4[_0xf184('0x13')]){if(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x14')]===0x1f4){logger['error'](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')]['message']);return _0x3f34a7(_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);}logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x3ea5c4[_0xf184('0x13')][_0xf184('0x15')]);return _0x3e8071(_0x3ea5c4['error'][_0xf184('0x15')]);}else{logger[_0xf184('0xd')](_0xf184('0xe'),_0x3e2615,_0xf184('0xf'));_0x3e8071(_0x3ea5c4['result'][_0xf184('0x15')]);}})[_0xf184('0x16')](function(_0x4a018b){logger[_0xf184('0x13')](_0xf184('0xe'),_0x3e2615,_0x4a018b);_0x3f34a7(_0x4a018b);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index bd8ef43..a8472af 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 _0xd8af=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','get','/:id','show','create','put','update','destroy'];(function(_0x29d693,_0x2daadb){var _0x1210c6=function(_0x3ba2e1){while(--_0x3ba2e1){_0x29d693['push'](_0x29d693['shift']());}};_0x1210c6(++_0x2daadb);}(_0xd8af,0x18d));var _0xfd8a=function(_0x59e5e5,_0x186659){_0x59e5e5=_0x59e5e5-0x0;var _0x2bd949=_0xd8af[_0x59e5e5];return _0x2bd949;};'use strict';var multer=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var path=require(_0xfd8a('0x2'));var timeout=require(_0xfd8a('0x3'));var express=require(_0xfd8a('0x4'));var router=express['Router']();var fs_extra=require(_0xfd8a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd8a('0x6'));var config=require(_0xfd8a('0x7'));var controller=require(_0xfd8a('0x8'));router['get']('/',auth[_0xfd8a('0x9')](),controller['index']);router[_0xfd8a('0xa')](_0xfd8a('0xb'),auth[_0xfd8a('0x9')](),controller[_0xfd8a('0xc')]);router['post']('/',auth[_0xfd8a('0x9')](),controller[_0xfd8a('0xd')]);router[_0xfd8a('0xe')](_0xfd8a('0xb'),auth[_0xfd8a('0x9')](),controller[_0xfd8a('0xf')]);router['delete']('/:id',auth[_0xfd8a('0x9')](),controller[_0xfd8a('0x10')]);module[_0xfd8a('0x11')]=router; \ No newline at end of file +var _0x24ce=['delete','destroy','util','path','connect-timeout','express','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x24ce,0x1de));var _0xe24c=function(_0xd8d721,_0x85473b){_0xd8d721=_0xd8d721-0x0;var _0x2ed4dd=_0x24ce[_0xd8d721];return _0x2ed4dd;};'use strict';var multer=require('multer');var util=require(_0xe24c('0x0'));var path=require(_0xe24c('0x1'));var timeout=require(_0xe24c('0x2'));var express=require(_0xe24c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe24c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe24c('0x5'));router[_0xe24c('0x6')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0x8')]);router[_0xe24c('0x6')]('/:id',auth[_0xe24c('0x7')](),controller[_0xe24c('0x9')]);router[_0xe24c('0xa')]('/',auth[_0xe24c('0x7')](),controller[_0xe24c('0xb')]);router[_0xe24c('0xc')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0xe')]);router[_0xe24c('0xf')](_0xe24c('0xd'),auth[_0xe24c('0x7')](),controller[_0xe24c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1733a02..928a2fe 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 _0x9836=['TEXT','sequelize','exports'];(function(_0xda19ac,_0x2facb7){var _0x46f5ad=function(_0x2793d3){while(--_0x2793d3){_0xda19ac['push'](_0xda19ac['shift']());}};_0x46f5ad(++_0x2facb7);}(_0x9836,0x1f0));var _0x6983=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x9836[_0xdd2bfa];return _0x55397e;};'use strict';var Sequelize=require(_0x6983('0x0'));module[_0x6983('0x1')]={'tree':{'type':Sequelize[_0x6983('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf906=['exports','TEXT','sequelize'];(function(_0x42e8a3,_0x341058){var _0x59524d=function(_0x132ea5){while(--_0x132ea5){_0x42e8a3['push'](_0x42e8a3['shift']());}};_0x59524d(++_0x341058);}(_0xf906,0x176));var _0x6f90=function(_0x2a7d28,_0x5cc069){_0x2a7d28=_0x2a7d28-0x0;var _0xbdd0db=_0xf906[_0x2a7d28];return _0xbdd0db;};'use strict';var Sequelize=require(_0x6f90('0x0'));module[_0x6f90('0x1')]={'tree':{'type':Sequelize[_0x6f90('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4253678..16f1766 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 _0xaf46=['fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','destroy','then','end','error','name','send','index','map','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','AnalyticTreeReport','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','rimraf','zip-dir'];(function(_0x4a408d,_0x224606){var _0x51e853=function(_0x5a4894){while(--_0x5a4894){_0x4a408d['push'](_0x4a408d['shift']());}};_0x51e853(++_0x224606);}(_0xaf46,0x170));var _0x6af4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaf46[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6af4('0x0'));var zipdir=require(_0x6af4('0x1'));var jsonpatch=require(_0x6af4('0x2'));var rp=require(_0x6af4('0x3'));var moment=require(_0x6af4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6af4('0x5'));var path=require(_0x6af4('0x6'));var sox=require(_0x6af4('0x7'));var csv=require('to-csv');var ejs=require(_0x6af4('0x8'));var fs=require('fs');var fs_extra=require(_0x6af4('0x9'));var _=require(_0x6af4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6af4('0xb'));var deskjs=require(_0x6af4('0xc'));var toCsv=require(_0x6af4('0xd'));var querystring=require(_0x6af4('0xe'));var Papa=require(_0x6af4('0xf'));var Redis=require(_0x6af4('0x10'));var authService=require(_0x6af4('0x11'));var qs=require(_0x6af4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6af4('0x13'))(_0x6af4('0x14'));var utils=require(_0x6af4('0x15'));var config=require(_0x6af4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6af4('0x17'))['db'];function respondWithStatusCode(_0xd5c3e6,_0x3cb30d){_0x3cb30d=_0x3cb30d||0xcc;return function(_0x57e1fd){if(_0x57e1fd){return _0xd5c3e6[_0x6af4('0x18')](_0x3cb30d);}return _0xd5c3e6[_0x6af4('0x19')](_0x3cb30d)['end']();};}function respondWithResult(_0x1a9f53,_0x488886){_0x488886=_0x488886||0xc8;return function(_0x19280d){if(_0x19280d){return _0x1a9f53[_0x6af4('0x19')](_0x488886)[_0x6af4('0x1a')](_0x19280d);}};}function respondWithFilteredResult(_0x2a62c6,_0x44124d){return function(_0x24f3cd){if(_0x24f3cd){var _0x349ec5=typeof _0x44124d[_0x6af4('0x1b')]===_0x6af4('0x1c')&&typeof _0x44124d[_0x6af4('0x1d')]===_0x6af4('0x1c');var _0x3bfec1=_0x24f3cd['count'];var _0x5e3c17=_0x349ec5?0x0:_0x44124d[_0x6af4('0x1b')];var _0x471cc8=_0x349ec5?_0x24f3cd[_0x6af4('0x1e')]:_0x44124d[_0x6af4('0x1b')]+_0x44124d[_0x6af4('0x1d')];var _0x5e0b3b;if(_0x471cc8>=_0x3bfec1){_0x471cc8=_0x3bfec1;_0x5e0b3b=0xc8;}else{_0x5e0b3b=0xce;}_0x2a62c6[_0x6af4('0x19')](_0x5e0b3b);return _0x2a62c6[_0x6af4('0x1f')]('Content-Range',_0x5e3c17+'-'+_0x471cc8+'/'+_0x3bfec1)['json'](_0x24f3cd);}return null;};}function patchUpdates(_0x214013){return function(_0x1c5917){try{jsonpatch[_0x6af4('0x20')](_0x1c5917,_0x214013,!![]);}catch(_0x4319f7){return BPromise['reject'](_0x4319f7);}return _0x1c5917[_0x6af4('0x21')]();};}function saveUpdates(_0x125396,_0xca2d97){return function(_0x278bab){if(_0x278bab){return _0x278bab['update'](_0x125396)['then'](function(_0xb957aa){return _0xb957aa;});}return null;};}function removeEntity(_0x239a57,_0x4f1c3b){return function(_0x548db3){if(_0x548db3){return _0x548db3[_0x6af4('0x22')]()[_0x6af4('0x23')](function(){_0x239a57[_0x6af4('0x19')](0xcc)[_0x6af4('0x24')]();});}};}function handleEntityNotFound(_0x3a3ffc,_0x5a0b24){return function(_0x1443f4){if(!_0x1443f4){_0x3a3ffc[_0x6af4('0x18')](0x194);}return _0x1443f4;};}function handleError(_0x65da5a,_0x1cfe68){_0x1cfe68=_0x1cfe68||0x1f4;return function(_0x2a03da){logger[_0x6af4('0x25')](_0x2a03da['stack']);if(_0x2a03da['name']){delete _0x2a03da[_0x6af4('0x26')];}_0x65da5a[_0x6af4('0x19')](_0x1cfe68)[_0x6af4('0x27')](_0x2a03da);};}exports[_0x6af4('0x28')]=function(_0x33c0c6,_0x5c7a74){var _0x527ae1={},_0x24b7cb={},_0x534b98={'count':0x0,'rows':[]};var _0xd5261c=_[_0x6af4('0x29')](db['AnalyticTreeReport']['rawAttributes'],function(_0x47875e){return{'name':_0x47875e[_0x6af4('0x2a')],'type':_0x47875e[_0x6af4('0x2b')][_0x6af4('0x2c')]};});_0x24b7cb['model']=_[_0x6af4('0x29')](_0xd5261c,_0x6af4('0x26'));_0x24b7cb[_0x6af4('0x2d')]=_[_0x6af4('0x2e')](_0x33c0c6['query']);_0x24b7cb['filters']=_[_0x6af4('0x2f')](_0x24b7cb['model'],_0x24b7cb[_0x6af4('0x2d')]);_0x527ae1['attributes']=_[_0x6af4('0x2f')](_0x24b7cb[_0x6af4('0x30')],qs[_0x6af4('0x31')](_0x33c0c6[_0x6af4('0x2d')]['fields']));_0x527ae1['attributes']=_0x527ae1[_0x6af4('0x32')][_0x6af4('0x33')]?_0x527ae1[_0x6af4('0x32')]:_0x24b7cb['model'];if(!_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x34')](_0x6af4('0x35'))){_0x527ae1[_0x6af4('0x1d')]=qs[_0x6af4('0x1d')](_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x1d')]);_0x527ae1['offset']=qs[_0x6af4('0x1b')](_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x1b')]);}_0x527ae1[_0x6af4('0x36')]=qs['sort'](_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x37')]);_0x527ae1[_0x6af4('0x38')]=qs[_0x6af4('0x39')](_['pick'](_0x33c0c6[_0x6af4('0x2d')],_0x24b7cb['filters']),_0xd5261c);if(_0x33c0c6['query'][_0x6af4('0x3a')]){_0x527ae1[_0x6af4('0x38')]=_[_0x6af4('0x3b')](_0x527ae1[_0x6af4('0x38')],{'$or':_[_0x6af4('0x29')](_0xd5261c,function(_0x8d56d1){if(_0x8d56d1['type']!==_0x6af4('0x3c')){var _0x352ed0={};_0x352ed0[_0x8d56d1[_0x6af4('0x26')]]={'$like':'%'+_0x33c0c6[_0x6af4('0x2d')][_0x6af4('0x3a')]+'%'};return _0x352ed0;}})});}_0x527ae1=_[_0x6af4('0x3b')]({},_0x527ae1,_0x33c0c6[_0x6af4('0x3d')]);var _0x546478={'where':_0x527ae1['where']};return db['AnalyticTreeReport']['count'](_0x546478)['then'](function(_0x2e7b35){_0x534b98[_0x6af4('0x1e')]=_0x2e7b35;if(_0x33c0c6[_0x6af4('0x2d')]['includeAll']){_0x527ae1[_0x6af4('0x3e')]=[{'all':!![]}];}return db[_0x6af4('0x3f')][_0x6af4('0x40')](_0x527ae1);})[_0x6af4('0x23')](function(_0x148e81){_0x534b98[_0x6af4('0x41')]=_0x148e81;return _0x534b98;})['then'](respondWithFilteredResult(_0x5c7a74,_0x527ae1))[_0x6af4('0x42')](handleError(_0x5c7a74,null));};exports[_0x6af4('0x43')]=function(_0x5eda9a,_0x26fae7){var _0x54496e={'raw':!![],'where':{'id':_0x5eda9a[_0x6af4('0x44')]['id']}},_0x470955={};_0x470955[_0x6af4('0x30')]=_['keys'](db['AnalyticTreeReport'][_0x6af4('0x45')]);_0x470955['query']=_['keys'](_0x5eda9a[_0x6af4('0x2d')]);_0x470955['filters']=_[_0x6af4('0x2f')](_0x470955[_0x6af4('0x30')],_0x470955[_0x6af4('0x2d')]);_0x54496e[_0x6af4('0x32')]=_['intersection'](_0x470955['model'],qs[_0x6af4('0x31')](_0x5eda9a[_0x6af4('0x2d')][_0x6af4('0x31')]));_0x54496e[_0x6af4('0x32')]=_0x54496e[_0x6af4('0x32')][_0x6af4('0x33')]?_0x54496e[_0x6af4('0x32')]:_0x470955[_0x6af4('0x30')];if(_0x5eda9a[_0x6af4('0x2d')]['includeAll']){_0x54496e[_0x6af4('0x3e')]=[{'all':!![]}];}_0x54496e=_[_0x6af4('0x3b')]({},_0x54496e,_0x5eda9a[_0x6af4('0x3d')]);return db[_0x6af4('0x3f')][_0x6af4('0x46')](_0x54496e)['then'](handleEntityNotFound(_0x26fae7,null))['then'](respondWithResult(_0x26fae7,null))[_0x6af4('0x42')](handleError(_0x26fae7,null));};exports['create']=function(_0x7d1ac9,_0x3417e2){return db[_0x6af4('0x3f')][_0x6af4('0x47')](_0x7d1ac9[_0x6af4('0x48')],{})[_0x6af4('0x23')](respondWithResult(_0x3417e2,0xc9))['catch'](handleError(_0x3417e2,null));};exports[_0x6af4('0x49')]=function(_0x27ba6e,_0x8349c2){if(_0x27ba6e['body']['id']){delete _0x27ba6e['body']['id'];}return db['AnalyticTreeReport'][_0x6af4('0x46')]({'where':{'id':_0x27ba6e[_0x6af4('0x44')]['id']}})[_0x6af4('0x23')](handleEntityNotFound(_0x8349c2,null))[_0x6af4('0x23')](saveUpdates(_0x27ba6e[_0x6af4('0x48')],null))[_0x6af4('0x23')](respondWithResult(_0x8349c2,null))[_0x6af4('0x42')](handleError(_0x8349c2,null));};exports[_0x6af4('0x22')]=function(_0x56ce38,_0x1bdb46){return db[_0x6af4('0x3f')][_0x6af4('0x46')]({'where':{'id':_0x56ce38[_0x6af4('0x44')]['id']}})[_0x6af4('0x23')](handleEntityNotFound(_0x1bdb46,null))[_0x6af4('0x23')](removeEntity(_0x1bdb46,null))[_0x6af4('0x42')](handleError(_0x1bdb46,null));}; \ No newline at end of file +var _0xf4bf=['destroy','name','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x309a3b,_0x4cb4dd){var _0x3152ac=function(_0x2c69bc){while(--_0x2c69bc){_0x309a3b['push'](_0x309a3b['shift']());}};_0x3152ac(++_0x4cb4dd);}(_0xf4bf,0xb0));var _0xff4b=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xf4bf[_0x1e081a];return _0x428209;};'use strict';var emlformat=require(_0xff4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff4b('0x1'));var jsonpatch=require(_0xff4b('0x2'));var rp=require('request-promise');var moment=require(_0xff4b('0x3'));var BPromise=require(_0xff4b('0x4'));var Mustache=require(_0xff4b('0x5'));var util=require(_0xff4b('0x6'));var path=require(_0xff4b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff4b('0x8'));var fs=require('fs');var fs_extra=require(_0xff4b('0x9'));var _=require(_0xff4b('0xa'));var squel=require(_0xff4b('0xb'));var crypto=require(_0xff4b('0xc'));var jsforce=require(_0xff4b('0xd'));var deskjs=require(_0xff4b('0xe'));var toCsv=require(_0xff4b('0xf'));var querystring=require(_0xff4b('0x10'));var Papa=require(_0xff4b('0x11'));var Redis=require(_0xff4b('0x12'));var authService=require(_0xff4b('0x13'));var qs=require(_0xff4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff4b('0x15'));var logger=require(_0xff4b('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff4b('0x17'))['db'];function respondWithStatusCode(_0x507d3c,_0x146270){_0x146270=_0x146270||0xcc;return function(_0x1b50bb){if(_0x1b50bb){return _0x507d3c[_0xff4b('0x18')](_0x146270);}return _0x507d3c[_0xff4b('0x19')](_0x146270)['end']();};}function respondWithResult(_0x2f2b22,_0x405869){_0x405869=_0x405869||0xc8;return function(_0x4f2104){if(_0x4f2104){return _0x2f2b22[_0xff4b('0x19')](_0x405869)[_0xff4b('0x1a')](_0x4f2104);}};}function respondWithFilteredResult(_0xa19e02,_0x5e0e86){return function(_0x20fd03){if(_0x20fd03){var _0x595bf4=typeof _0x5e0e86[_0xff4b('0x1b')]===_0xff4b('0x1c')&&typeof _0x5e0e86[_0xff4b('0x1d')]==='undefined';var _0x4ccba3=_0x20fd03[_0xff4b('0x1e')];var _0x5d363b=_0x595bf4?0x0:_0x5e0e86[_0xff4b('0x1b')];var _0x16f61c=_0x595bf4?_0x20fd03[_0xff4b('0x1e')]:_0x5e0e86[_0xff4b('0x1b')]+_0x5e0e86[_0xff4b('0x1d')];var _0x5e6f44;if(_0x16f61c>=_0x4ccba3){_0x16f61c=_0x4ccba3;_0x5e6f44=0xc8;}else{_0x5e6f44=0xce;}_0xa19e02['status'](_0x5e6f44);return _0xa19e02[_0xff4b('0x1f')](_0xff4b('0x20'),_0x5d363b+'-'+_0x16f61c+'/'+_0x4ccba3)[_0xff4b('0x1a')](_0x20fd03);}return null;};}function patchUpdates(_0x5ea71d){return function(_0x70849b){try{jsonpatch['apply'](_0x70849b,_0x5ea71d,!![]);}catch(_0x308bf6){return BPromise[_0xff4b('0x21')](_0x308bf6);}return _0x70849b[_0xff4b('0x22')]();};}function saveUpdates(_0x1383a1,_0x3e64ab){return function(_0x4d4172){if(_0x4d4172){return _0x4d4172[_0xff4b('0x23')](_0x1383a1)[_0xff4b('0x24')](function(_0x5709d7){return _0x5709d7;});}return null;};}function removeEntity(_0x1c1ba3,_0xe910b0){return function(_0xe790ca){if(_0xe790ca){return _0xe790ca[_0xff4b('0x25')]()['then'](function(){_0x1c1ba3[_0xff4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x167461,_0x5872d6){return function(_0x28d88a){if(!_0x28d88a){_0x167461['sendStatus'](0x194);}return _0x28d88a;};}function handleError(_0x5715ee,_0x4cf60b){_0x4cf60b=_0x4cf60b||0x1f4;return function(_0x4e6759){logger['error'](_0x4e6759['stack']);if(_0x4e6759[_0xff4b('0x26')]){delete _0x4e6759[_0xff4b('0x26')];}_0x5715ee['status'](_0x4cf60b)['send'](_0x4e6759);};}exports[_0xff4b('0x27')]=function(_0x11324a,_0x1ab691){var _0x215259={},_0x46f331={},_0xf76797={'count':0x0,'rows':[]};var _0x3ea00f=_[_0xff4b('0x28')](db['AnalyticTreeReport'][_0xff4b('0x29')],function(_0x4633d0){return{'name':_0x4633d0['fieldName'],'type':_0x4633d0[_0xff4b('0x2a')][_0xff4b('0x2b')]};});_0x46f331[_0xff4b('0x2c')]=_[_0xff4b('0x28')](_0x3ea00f,_0xff4b('0x26'));_0x46f331['query']=_[_0xff4b('0x2d')](_0x11324a[_0xff4b('0x2e')]);_0x46f331[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x46f331[_0xff4b('0x2c')],_0x46f331['query']);_0x215259[_0xff4b('0x31')]=_['intersection'](_0x46f331[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x11324a[_0xff4b('0x2e')]['fields']));_0x215259['attributes']=_0x215259[_0xff4b('0x31')][_0xff4b('0x33')]?_0x215259[_0xff4b('0x31')]:_0x46f331['model'];if(!_0x11324a[_0xff4b('0x2e')][_0xff4b('0x34')]('nolimit')){_0x215259[_0xff4b('0x1d')]=qs[_0xff4b('0x1d')](_0x11324a['query'][_0xff4b('0x1d')]);_0x215259[_0xff4b('0x1b')]=qs['offset'](_0x11324a[_0xff4b('0x2e')][_0xff4b('0x1b')]);}_0x215259[_0xff4b('0x35')]=qs[_0xff4b('0x36')](_0x11324a['query']['sort']);_0x215259['where']=qs[_0xff4b('0x2f')](_[_0xff4b('0x37')](_0x11324a['query'],_0x46f331[_0xff4b('0x2f')]),_0x3ea00f);if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x38')]){_0x215259[_0xff4b('0x39')]=_['merge'](_0x215259[_0xff4b('0x39')],{'$or':_[_0xff4b('0x28')](_0x3ea00f,function(_0x48bf4c){if(_0x48bf4c['type']!=='VIRTUAL'){var _0x4edb1c={};_0x4edb1c[_0x48bf4c[_0xff4b('0x26')]]={'$like':'%'+_0x11324a['query'][_0xff4b('0x38')]+'%'};return _0x4edb1c;}})});}_0x215259=_[_0xff4b('0x3a')]({},_0x215259,_0x11324a[_0xff4b('0x3b')]);var _0x2815b7={'where':_0x215259['where']};return db[_0xff4b('0x3c')][_0xff4b('0x1e')](_0x2815b7)[_0xff4b('0x24')](function(_0x31a962){_0xf76797['count']=_0x31a962;if(_0x11324a[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x215259['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xff4b('0x3e')](_0x215259);})[_0xff4b('0x24')](function(_0x477432){_0xf76797[_0xff4b('0x3f')]=_0x477432;return _0xf76797;})[_0xff4b('0x24')](respondWithFilteredResult(_0x1ab691,_0x215259))[_0xff4b('0x40')](handleError(_0x1ab691,null));};exports[_0xff4b('0x41')]=function(_0x18829e,_0x2d46b7){var _0x21a216={'raw':!![],'where':{'id':_0x18829e[_0xff4b('0x42')]['id']}},_0x5c0794={};_0x5c0794[_0xff4b('0x2c')]=_[_0xff4b('0x2d')](db[_0xff4b('0x3c')][_0xff4b('0x29')]);_0x5c0794['query']=_[_0xff4b('0x2d')](_0x18829e[_0xff4b('0x2e')]);_0x5c0794[_0xff4b('0x2f')]=_[_0xff4b('0x30')](_0x5c0794[_0xff4b('0x2c')],_0x5c0794[_0xff4b('0x2e')]);_0x21a216['attributes']=_['intersection'](_0x5c0794[_0xff4b('0x2c')],qs[_0xff4b('0x32')](_0x18829e['query'][_0xff4b('0x32')]));_0x21a216[_0xff4b('0x31')]=_0x21a216[_0xff4b('0x31')][_0xff4b('0x33')]?_0x21a216[_0xff4b('0x31')]:_0x5c0794[_0xff4b('0x2c')];if(_0x18829e[_0xff4b('0x2e')][_0xff4b('0x3d')]){_0x21a216[_0xff4b('0x43')]=[{'all':!![]}];}_0x21a216=_['merge']({},_0x21a216,_0x18829e['options']);return db[_0xff4b('0x3c')]['find'](_0x21a216)[_0xff4b('0x24')](handleEntityNotFound(_0x2d46b7,null))[_0xff4b('0x24')](respondWithResult(_0x2d46b7,null))[_0xff4b('0x40')](handleError(_0x2d46b7,null));};exports[_0xff4b('0x44')]=function(_0x4bab3f,_0x1e7866){return db[_0xff4b('0x3c')][_0xff4b('0x44')](_0x4bab3f[_0xff4b('0x45')],{})[_0xff4b('0x24')](respondWithResult(_0x1e7866,0xc9))[_0xff4b('0x40')](handleError(_0x1e7866,null));};exports[_0xff4b('0x23')]=function(_0x2974f5,_0x569412){if(_0x2974f5[_0xff4b('0x45')]['id']){delete _0x2974f5[_0xff4b('0x45')]['id'];}return db[_0xff4b('0x3c')][_0xff4b('0x46')]({'where':{'id':_0x2974f5[_0xff4b('0x42')]['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x569412,null))[_0xff4b('0x24')](saveUpdates(_0x2974f5[_0xff4b('0x45')],null))[_0xff4b('0x24')](respondWithResult(_0x569412,null))['catch'](handleError(_0x569412,null));};exports[_0xff4b('0x25')]=function(_0x33110,_0x4fd8c7){return db['AnalyticTreeReport']['find']({'where':{'id':_0x33110['params']['id']}})[_0xff4b('0x24')](handleEntityNotFound(_0x4fd8c7,null))['then'](removeEntity(_0x4fd8c7,null))[_0xff4b('0x40')](handleError(_0x4fd8c7,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 9ea6fd9..22de259 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 _0x9ad4=['AnalyticTreeReport','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x2436f4,_0x5077e5){var _0x540d0d=function(_0x41830c){while(--_0x41830c){_0x2436f4['push'](_0x2436f4['shift']());}};_0x540d0d(++_0x5077e5);}(_0x9ad4,0x151));var _0x49ad=function(_0x1e8dd5,_0x571f6d){_0x1e8dd5=_0x1e8dd5-0x0;var _0x9aa844=_0x9ad4[_0x1e8dd5];return _0x9aa844;};'use strict';var _=require(_0x49ad('0x0'));var util=require(_0x49ad('0x1'));var logger=require(_0x49ad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x49ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49ad('0x4'));var config=require(_0x49ad('0x5'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5433fc,_0x4c5920){return _0x5433fc['define'](_0x49ad('0x6'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33fe=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticTreeReport','lodash'];(function(_0x220256,_0x1fee31){var _0x3e8b32=function(_0x4d765f){while(--_0x4d765f){_0x220256['push'](_0x220256['shift']());}};_0x3e8b32(++_0x1fee31);}(_0x33fe,0x1cd));var _0xe33f=function(_0x1bf69b,_0x3e889c){_0x1bf69b=_0x1bf69b-0x0;var _0x252aa8=_0x33fe[_0x1bf69b];return _0x252aa8;};'use strict';var _=require(_0xe33f('0x0'));var util=require(_0xe33f('0x1'));var logger=require(_0xe33f('0x2'))('api');var moment=require(_0xe33f('0x3'));var BPromise=require(_0xe33f('0x4'));var rp=require(_0xe33f('0x5'));var fs=require('fs');var path=require(_0xe33f('0x6'));var rimraf=require(_0xe33f('0x7'));var config=require(_0xe33f('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x466059,_0x164ae0){return _0x466059[_0xe33f('0x9')](_0xe33f('0xa'),attributes,{'tableName':'analytics_report_trees','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 a42084a..8a99995 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x55d143,_0x4836e2){var _0x29c2f7=function(_0xa65606){while(--_0xa65606){_0x55d143['push'](_0x55d143['shift']());}};_0x29c2f7(++_0x4836e2);}(_0x2ef3,0xba));var _0x32ef=function(_0x4883d5,_0x1ce202){_0x4883d5=_0x4883d5-0x0;var _0x1b188e=_0x2ef3[_0x4883d5];return _0x1b188e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xbc0cdb,_0x277170){var _0x25e621=function(_0x5d66a6){while(--_0x5d66a6){_0xbc0cdb['push'](_0xbc0cdb['shift']());}};_0x25e621(++_0x277170);}(_0xdb28,0x106));var _0x8db2=function(_0x4fed3d,_0x1a5c6e){_0x4fed3d=_0x4fed3d-0x0;var _0x5bb04e=_0xdb28[_0x4fed3d];return _0x5bb04e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 931d6f5..c55a1b6 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 _0x7ca0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','/:id','isAuthenticated','show','post','put','destroy','exports','util'];(function(_0x31a119,_0x17e6ca){var _0x2d6e6a=function(_0x3faa80){while(--_0x3faa80){_0x31a119['push'](_0x31a119['shift']());}};_0x2d6e6a(++_0x17e6ca);}(_0x7ca0,0x175));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x07ca('0x0'));var path=require(_0x07ca('0x1'));var timeout=require(_0x07ca('0x2'));var express=require('express');var router=express[_0x07ca('0x3')]();var fs_extra=require(_0x07ca('0x4'));var auth=require(_0x07ca('0x5'));var interaction=require(_0x07ca('0x6'));var config=require(_0x07ca('0x7'));var controller=require(_0x07ca('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x07ca('0x9')]);router['get'](_0x07ca('0xa'),auth[_0x07ca('0xb')](),controller[_0x07ca('0xc')]);router[_0x07ca('0xd')]('/',auth[_0x07ca('0xb')](),controller['create']);router[_0x07ca('0xe')](_0x07ca('0xa'),auth[_0x07ca('0xb')](),controller['update']);router['delete']('/:id',auth[_0x07ca('0xb')](),controller[_0x07ca('0xf')]);module[_0x07ca('0x10')]=router; \ No newline at end of file +var _0x4534=['get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4534,0xc6));var _0x4453=function(_0x2cc0a0,_0x4e9c49){_0x2cc0a0=_0x2cc0a0-0x0;var _0x24e0fe=_0x4534[_0x2cc0a0];return _0x24e0fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4453('0x0'));var timeout=require(_0x4453('0x1'));var express=require('express');var router=express[_0x4453('0x2')]();var fs_extra=require(_0x4453('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4453('0x4'));var config=require('../../config/environment');var controller=require(_0x4453('0x5'));router[_0x4453('0x6')]('/',auth['isAuthenticated'](),controller[_0x4453('0x7')]);router[_0x4453('0x6')]('/:id',auth[_0x4453('0x8')](),controller[_0x4453('0x9')]);router[_0x4453('0xa')]('/',auth['isAuthenticated'](),controller[_0x4453('0xb')]);router[_0x4453('0xc')](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xe')]);router['delete'](_0x4453('0xd'),auth[_0x4453('0x8')](),controller[_0x4453('0xf')]);module[_0x4453('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 4d2387f..9451f7d 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 _0x7f90=['STRING','sequelize','exports'];(function(_0x252632,_0x2b0ece){var _0x4b6e59=function(_0x2766f4){while(--_0x2766f4){_0x252632['push'](_0x252632['shift']());}};_0x4b6e59(++_0x2b0ece);}(_0x7f90,0xf4));var _0x07f9=function(_0x1a42da,_0x511121){_0x1a42da=_0x1a42da-0x0;var _0x57301e=_0x7f90[_0x1a42da];return _0x57301e;};'use strict';var Sequelize=require(_0x07f9('0x0'));module[_0x07f9('0x1')]={'name':{'type':Sequelize[_0x07f9('0x2')]},'basename':{'type':Sequelize[_0x07f9('0x2')]},'type':{'type':Sequelize[_0x07f9('0x2')]}}; \ No newline at end of file +var _0x9649=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9649,0x19f));var _0x9964=function(_0x2a8acc,_0x150fe2){_0x2a8acc=_0x2a8acc-0x0;var _0x4c507b=_0x9649[_0x2a8acc];return _0x4c507b;};'use strict';var Sequelize=require(_0x9964('0x0'));module[_0x9964('0x1')]={'name':{'type':Sequelize[_0x9964('0x2')]},'basename':{'type':Sequelize[_0x9964('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 a345597..6f800f5 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 _0xb14d=['VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map'];(function(_0x20070d,_0x5a903e){var _0x6f9dfb=function(_0x52945b){while(--_0x52945b){_0x20070d['push'](_0x20070d['shift']());}};_0x6f9dfb(++_0x5a903e);}(_0xb14d,0x1e2));var _0xdb14=function(_0x7747e6,_0x5d1fcb){_0x7747e6=_0x7747e6-0x0;var _0x1c4204=_0xb14d[_0x7747e6];return _0x1c4204;};'use strict';var emlformat=require(_0xdb14('0x0'));var rimraf=require(_0xdb14('0x1'));var zipdir=require(_0xdb14('0x2'));var jsonpatch=require(_0xdb14('0x3'));var rp=require('request-promise');var moment=require(_0xdb14('0x4'));var BPromise=require(_0xdb14('0x5'));var Mustache=require('mustache');var util=require(_0xdb14('0x6'));var path=require(_0xdb14('0x7'));var sox=require(_0xdb14('0x8'));var csv=require(_0xdb14('0x9'));var ejs=require(_0xdb14('0xa'));var fs=require('fs');var fs_extra=require(_0xdb14('0xb'));var _=require(_0xdb14('0xc'));var squel=require(_0xdb14('0xd'));var crypto=require(_0xdb14('0xe'));var jsforce=require(_0xdb14('0xf'));var deskjs=require(_0xdb14('0x10'));var toCsv=require(_0xdb14('0x9'));var querystring=require(_0xdb14('0x11'));var Papa=require('papaparse');var Redis=require(_0xdb14('0x12'));var authService=require(_0xdb14('0x13'));var qs=require(_0xdb14('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb14('0x15'));var logger=require(_0xdb14('0x16'))(_0xdb14('0x17'));var utils=require('../../config/utils');var config=require(_0xdb14('0x18'));var licenseUtil=require(_0xdb14('0x19'));var db=require(_0xdb14('0x1a'))['db'];function respondWithStatusCode(_0x25f9ad,_0x326cce){_0x326cce=_0x326cce||0xcc;return function(_0x4d4bdd){if(_0x4d4bdd){return _0x25f9ad[_0xdb14('0x1b')](_0x326cce);}return _0x25f9ad[_0xdb14('0x1c')](_0x326cce)[_0xdb14('0x1d')]();};}function respondWithResult(_0x33536d,_0x196744){_0x196744=_0x196744||0xc8;return function(_0x1313c4){if(_0x1313c4){return _0x33536d[_0xdb14('0x1c')](_0x196744)[_0xdb14('0x1e')](_0x1313c4);}};}function respondWithFilteredResult(_0x43a43e,_0x412a14){return function(_0x2190f0){if(_0x2190f0){var _0x12e1aa=typeof _0x412a14[_0xdb14('0x1f')]===_0xdb14('0x20')&&typeof _0x412a14[_0xdb14('0x21')]===_0xdb14('0x20');var _0x475503=_0x2190f0[_0xdb14('0x22')];var _0x570dbc=_0x12e1aa?0x0:_0x412a14[_0xdb14('0x1f')];var _0x2763a7=_0x12e1aa?_0x2190f0['count']:_0x412a14[_0xdb14('0x1f')]+_0x412a14[_0xdb14('0x21')];var _0x13872c;if(_0x2763a7>=_0x475503){_0x2763a7=_0x475503;_0x13872c=0xc8;}else{_0x13872c=0xce;}_0x43a43e['status'](_0x13872c);return _0x43a43e['set']('Content-Range',_0x570dbc+'-'+_0x2763a7+'/'+_0x475503)[_0xdb14('0x1e')](_0x2190f0);}return null;};}function patchUpdates(_0xc7cb8d){return function(_0x1c31b8){try{jsonpatch[_0xdb14('0x23')](_0x1c31b8,_0xc7cb8d,!![]);}catch(_0x4b15b1){return BPromise[_0xdb14('0x24')](_0x4b15b1);}return _0x1c31b8[_0xdb14('0x25')]();};}function saveUpdates(_0x4d0f7e,_0x367802){return function(_0x5503b2){if(_0x5503b2){return _0x5503b2[_0xdb14('0x26')](_0x4d0f7e)[_0xdb14('0x27')](function(_0x2c928b){return _0x2c928b;});}return null;};}function removeEntity(_0x374d46,_0x5215c9){return function(_0x42aa0d){if(_0x42aa0d){return _0x42aa0d[_0xdb14('0x28')]()[_0xdb14('0x27')](function(){_0x374d46[_0xdb14('0x1c')](0xcc)[_0xdb14('0x1d')]();});}};}function handleEntityNotFound(_0x4fb5d3,_0x25cada){return function(_0xc1947b){if(!_0xc1947b){_0x4fb5d3[_0xdb14('0x1b')](0x194);}return _0xc1947b;};}function handleError(_0x4e2ad1,_0x217134){_0x217134=_0x217134||0x1f4;return function(_0x415d3e){logger['error'](_0x415d3e['stack']);if(_0x415d3e[_0xdb14('0x29')]){delete _0x415d3e[_0xdb14('0x29')];}_0x4e2ad1['status'](_0x217134)[_0xdb14('0x2a')](_0x415d3e);};}exports[_0xdb14('0x2b')]=function(_0xe8fe2e,_0x59d99b){var _0x4252d3={},_0x534100={},_0x1e88c0={'count':0x0,'rows':[]};var _0x515c69=_['map'](db[_0xdb14('0x2c')][_0xdb14('0x2d')],function(_0x16eea3){return{'name':_0x16eea3[_0xdb14('0x2e')],'type':_0x16eea3[_0xdb14('0x2f')][_0xdb14('0x30')]};});_0x534100[_0xdb14('0x31')]=_['map'](_0x515c69,_0xdb14('0x29'));_0x534100['query']=_[_0xdb14('0x32')](_0xe8fe2e[_0xdb14('0x33')]);_0x534100[_0xdb14('0x34')]=_['intersection'](_0x534100[_0xdb14('0x31')],_0x534100[_0xdb14('0x33')]);_0x4252d3[_0xdb14('0x35')]=_[_0xdb14('0x36')](_0x534100[_0xdb14('0x31')],qs[_0xdb14('0x37')](_0xe8fe2e[_0xdb14('0x33')]['fields']));_0x4252d3[_0xdb14('0x35')]=_0x4252d3[_0xdb14('0x35')][_0xdb14('0x38')]?_0x4252d3['attributes']:_0x534100[_0xdb14('0x31')];if(!_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x39')](_0xdb14('0x3a'))){_0x4252d3[_0xdb14('0x21')]=qs[_0xdb14('0x21')](_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x21')]);_0x4252d3[_0xdb14('0x1f')]=qs['offset'](_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x1f')]);}_0x4252d3['order']=qs['sort'](_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x3b')]);_0x4252d3[_0xdb14('0x3c')]=qs['filters'](_['pick'](_0xe8fe2e[_0xdb14('0x33')],_0x534100['filters']),_0x515c69);if(_0xe8fe2e[_0xdb14('0x33')][_0xdb14('0x3d')]){_0x4252d3[_0xdb14('0x3c')]=_[_0xdb14('0x3e')](_0x4252d3['where'],{'$or':_[_0xdb14('0x3f')](_0x515c69,function(_0x58df9b){if(_0x58df9b[_0xdb14('0x2f')]!==_0xdb14('0x40')){var _0x42596f={};_0x42596f[_0x58df9b['name']]={'$like':'%'+_0xe8fe2e['query'][_0xdb14('0x3d')]+'%'};return _0x42596f;}})});}_0x4252d3=_[_0xdb14('0x3e')]({},_0x4252d3,_0xe8fe2e[_0xdb14('0x41')]);var _0x1e3cee={'where':_0x4252d3[_0xdb14('0x3c')]};return db[_0xdb14('0x2c')][_0xdb14('0x22')](_0x1e3cee)[_0xdb14('0x27')](function(_0x92dc8d){_0x1e88c0[_0xdb14('0x22')]=_0x92dc8d;if(_0xe8fe2e['query'][_0xdb14('0x42')]){_0x4252d3[_0xdb14('0x43')]=[{'all':!![]}];}return db[_0xdb14('0x2c')][_0xdb14('0x44')](_0x4252d3);})[_0xdb14('0x27')](function(_0x202b85){_0x1e88c0[_0xdb14('0x45')]=_0x202b85;return _0x1e88c0;})[_0xdb14('0x27')](respondWithFilteredResult(_0x59d99b,_0x4252d3))['catch'](handleError(_0x59d99b,null));};exports['show']=function(_0x28400d,_0x106c2e){var _0x3a846e={'raw':!![],'where':{'id':_0x28400d[_0xdb14('0x46')]['id']}},_0x1a1412={};_0x1a1412[_0xdb14('0x31')]=_[_0xdb14('0x32')](db[_0xdb14('0x2c')][_0xdb14('0x2d')]);_0x1a1412[_0xdb14('0x33')]=_[_0xdb14('0x32')](_0x28400d[_0xdb14('0x33')]);_0x1a1412[_0xdb14('0x34')]=_[_0xdb14('0x36')](_0x1a1412['model'],_0x1a1412[_0xdb14('0x33')]);_0x3a846e[_0xdb14('0x35')]=_['intersection'](_0x1a1412[_0xdb14('0x31')],qs[_0xdb14('0x37')](_0x28400d[_0xdb14('0x33')]['fields']));_0x3a846e[_0xdb14('0x35')]=_0x3a846e['attributes'][_0xdb14('0x38')]?_0x3a846e[_0xdb14('0x35')]:_0x1a1412[_0xdb14('0x31')];if(_0x28400d[_0xdb14('0x33')][_0xdb14('0x42')]){_0x3a846e['include']=[{'all':!![]}];}_0x3a846e=_['merge']({},_0x3a846e,_0x28400d[_0xdb14('0x41')]);return db[_0xdb14('0x2c')][_0xdb14('0x47')](_0x3a846e)['then'](handleEntityNotFound(_0x106c2e,null))[_0xdb14('0x27')](respondWithResult(_0x106c2e,null))[_0xdb14('0x48')](handleError(_0x106c2e,null));};exports[_0xdb14('0x49')]=function(_0x3fd1c2,_0x3114db){var _0x48be3e={'where':{'id':_0x3fd1c2[_0xdb14('0x46')]['id']}},_0x3822b5={};_0x3822b5[_0xdb14('0x31')]=_['keys'](db[_0xdb14('0x2c')][_0xdb14('0x2d')]);_0x48be3e[_0xdb14('0x35')]=_['intersection'](_0x3822b5[_0xdb14('0x31')],qs['fields'](_0x3fd1c2[_0xdb14('0x33')]['fields']));_0x48be3e['attributes']=_0x48be3e[_0xdb14('0x35')]['length']?_0x48be3e['attributes']:_0x3822b5[_0xdb14('0x31')];if(_0x3fd1c2['query']['includeAll']){_0x48be3e[_0xdb14('0x43')]=[{'all':!![]}];}_0x48be3e=_[_0xdb14('0x3e')]({},_0x48be3e,_0x3fd1c2[_0xdb14('0x41')]);return db[_0xdb14('0x2c')]['find'](_0x48be3e)['then'](handleEntityNotFound(_0x3114db,null))[_0xdb14('0x27')](function(_0x137ee5){if(_0x137ee5){var _0xe85e33=_0x137ee5[_0xdb14('0x4a')]({'plain':!![]});_0xe85e33=qs[_0xdb14('0x4b')](_0xe85e33,['id',_0xdb14('0x4c'),_0xdb14('0x4d')]);_0x3fd1c2[_0xdb14('0x4e')]=_[_0xdb14('0x4b')](_0x3fd1c2[_0xdb14('0x4e')],['id','createdAt','updatedAt']);return db[_0xdb14('0x2c')][_0xdb14('0x4f')](_[_0xdb14('0x3e')](_0xe85e33,_0x3fd1c2[_0xdb14('0x4e')]),{'include':_0x3fd1c2[_0xdb14('0x33')][_0xdb14('0x42')]?[{'all':!![]}]:undefined});}})[_0xdb14('0x27')](respondWithResult(_0x3114db,0xc9))[_0xdb14('0x48')](handleError(_0x3114db,null));};exports[_0xdb14('0x26')]=function(_0x18dad6,_0x6f6885){if(_0x18dad6[_0xdb14('0x4e')]['id']){delete _0x18dad6['body']['id'];}return db[_0xdb14('0x2c')][_0xdb14('0x47')]({'where':{'id':_0x18dad6[_0xdb14('0x46')]['id']}})[_0xdb14('0x27')](handleEntityNotFound(_0x6f6885,null))[_0xdb14('0x27')](saveUpdates(_0x18dad6[_0xdb14('0x4e')],null))[_0xdb14('0x27')](respondWithResult(_0x6f6885,null))[_0xdb14('0x48')](handleError(_0x6f6885,null));};exports[_0xdb14('0x28')]=function(_0x45fbe6,_0x3ccd06){return db[_0xdb14('0x2c')][_0xdb14('0x47')]({'where':{'id':_0x45fbe6[_0xdb14('0x46')]['id']}})[_0xdb14('0x27')](handleEntityNotFound(_0x3ccd06,null))[_0xdb14('0x27')](removeEntity(_0x3ccd06,null))[_0xdb14('0x48')](handleError(_0x3ccd06,null));};exports['create']=function(_0xa8a55c,_0x57c64b,_0x329a3e){_0xa8a55c[_0xdb14('0x4e')][_0xdb14('0x29')]=_0xa8a55c['file'][_0xdb14('0x50')];_0xa8a55c[_0xdb14('0x4e')][_0xdb14('0x51')]=_0xa8a55c[_0xdb14('0x52')][_0xdb14('0x53')];_0xa8a55c[_0xdb14('0x4e')][_0xdb14('0x2f')]=_0xa8a55c[_0xdb14('0x52')]['mimetype'];return db[_0xdb14('0x2c')][_0xdb14('0x4f')](_0xa8a55c[_0xdb14('0x4e')])['then'](respondWithResult(_0x57c64b,0xc9))[_0xdb14('0x48')](handleError(_0x57c64b,null));};exports[_0xdb14('0x54')]=function(_0x137abc,_0x58a651,_0x29eaa2){return db['Attachment'][_0xdb14('0x55')]({'where':{'id':_0x137abc[_0xdb14('0x46')]['id']},'raw':!![]})[_0xdb14('0x27')](handleEntityNotFound(_0x58a651,null))[_0xdb14('0x27')](function(_0x143c86){if(_0x143c86){var _0x50d39b=_0x143c86[_0xdb14('0x56')]!==null;var _0x1be194=path[_0xdb14('0x57')](config[_0xdb14('0x58')],_0xdb14('0x59'));if(_0x50d39b){_0x1be194=path[_0xdb14('0x57')](_0x1be194,_0xdb14('0x5a'));}var _0x530769=path[_0xdb14('0x57')](_0x1be194,_0x143c86['basename']);return _0x58a651[_0xdb14('0x54')](_0x530769);}})[_0xdb14('0x48')](handleError(_0x58a651,null));}; \ No newline at end of file +var _0x9fb0=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','get','omit','createdAt','body','create','destroy','basename','file','filename','mimetype','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','save','update','then','error','stack','name','send','map','Attachment','rawAttributes'];(function(_0x18f8ff,_0x257e95){var _0x18de97=function(_0xc8eb68){while(--_0xc8eb68){_0x18f8ff['push'](_0x18f8ff['shift']());}};_0x18de97(++_0x257e95);}(_0x9fb0,0x1dd));var _0x09fb=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x9fb0[_0x5f0089];return _0x193892;};'use strict';var emlformat=require(_0x09fb('0x0'));var rimraf=require(_0x09fb('0x1'));var zipdir=require(_0x09fb('0x2'));var jsonpatch=require(_0x09fb('0x3'));var rp=require('request-promise');var moment=require(_0x09fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x09fb('0x5'));var util=require('util');var path=require(_0x09fb('0x6'));var sox=require(_0x09fb('0x7'));var csv=require('to-csv');var ejs=require(_0x09fb('0x8'));var fs=require('fs');var fs_extra=require(_0x09fb('0x9'));var _=require(_0x09fb('0xa'));var squel=require(_0x09fb('0xb'));var crypto=require(_0x09fb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x09fb('0xd'));var toCsv=require(_0x09fb('0xe'));var querystring=require(_0x09fb('0xf'));var Papa=require(_0x09fb('0x10'));var Redis=require(_0x09fb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x09fb('0x12'));var as=require(_0x09fb('0x13'));var hardwareService=require(_0x09fb('0x14'));var logger=require('../../config/logger')(_0x09fb('0x15'));var utils=require('../../config/utils');var config=require(_0x09fb('0x16'));var licenseUtil=require(_0x09fb('0x17'));var db=require(_0x09fb('0x18'))['db'];function respondWithStatusCode(_0x419176,_0x22569f){_0x22569f=_0x22569f||0xcc;return function(_0x530a48){if(_0x530a48){return _0x419176[_0x09fb('0x19')](_0x22569f);}return _0x419176[_0x09fb('0x1a')](_0x22569f)[_0x09fb('0x1b')]();};}function respondWithResult(_0x377287,_0x1adc74){_0x1adc74=_0x1adc74||0xc8;return function(_0x8a8bcf){if(_0x8a8bcf){return _0x377287[_0x09fb('0x1a')](_0x1adc74)[_0x09fb('0x1c')](_0x8a8bcf);}};}function respondWithFilteredResult(_0x583e69,_0x470182){return function(_0x1cebc4){if(_0x1cebc4){var _0x57d362=typeof _0x470182['offset']==='undefined'&&typeof _0x470182[_0x09fb('0x1d')]===_0x09fb('0x1e');var _0x4752f6=_0x1cebc4[_0x09fb('0x1f')];var _0x26cf1f=_0x57d362?0x0:_0x470182[_0x09fb('0x20')];var _0x1c7657=_0x57d362?_0x1cebc4[_0x09fb('0x1f')]:_0x470182[_0x09fb('0x20')]+_0x470182['limit'];var _0x2e4675;if(_0x1c7657>=_0x4752f6){_0x1c7657=_0x4752f6;_0x2e4675=0xc8;}else{_0x2e4675=0xce;}_0x583e69[_0x09fb('0x1a')](_0x2e4675);return _0x583e69[_0x09fb('0x21')](_0x09fb('0x22'),_0x26cf1f+'-'+_0x1c7657+'/'+_0x4752f6)[_0x09fb('0x1c')](_0x1cebc4);}return null;};}function patchUpdates(_0x439536){return function(_0x41920f){try{jsonpatch['apply'](_0x41920f,_0x439536,!![]);}catch(_0x4a1f7d){return BPromise['reject'](_0x4a1f7d);}return _0x41920f[_0x09fb('0x23')]();};}function saveUpdates(_0x25f8a4,_0x3f3757){return function(_0x16e812){if(_0x16e812){return _0x16e812[_0x09fb('0x24')](_0x25f8a4)[_0x09fb('0x25')](function(_0x721ecb){return _0x721ecb;});}return null;};}function removeEntity(_0x488eb0,_0x57ce77){return function(_0x2671b1){if(_0x2671b1){return _0x2671b1['destroy']()[_0x09fb('0x25')](function(){_0x488eb0['status'](0xcc)[_0x09fb('0x1b')]();});}};}function handleEntityNotFound(_0x42e590,_0x3b1e72){return function(_0x1dfa7d){if(!_0x1dfa7d){_0x42e590[_0x09fb('0x19')](0x194);}return _0x1dfa7d;};}function handleError(_0x41cfc8,_0x57861a){_0x57861a=_0x57861a||0x1f4;return function(_0xe8928a){logger[_0x09fb('0x26')](_0xe8928a[_0x09fb('0x27')]);if(_0xe8928a[_0x09fb('0x28')]){delete _0xe8928a[_0x09fb('0x28')];}_0x41cfc8[_0x09fb('0x1a')](_0x57861a)[_0x09fb('0x29')](_0xe8928a);};}exports['index']=function(_0x23119b,_0x50cbea){var _0x5f5ec={},_0x1e797c={},_0x4445cb={'count':0x0,'rows':[]};var _0x375c0d=_[_0x09fb('0x2a')](db[_0x09fb('0x2b')][_0x09fb('0x2c')],function(_0x16cc38){return{'name':_0x16cc38[_0x09fb('0x2d')],'type':_0x16cc38[_0x09fb('0x2e')][_0x09fb('0x2f')]};});_0x1e797c[_0x09fb('0x30')]=_[_0x09fb('0x2a')](_0x375c0d,_0x09fb('0x28'));_0x1e797c[_0x09fb('0x31')]=_['keys'](_0x23119b[_0x09fb('0x31')]);_0x1e797c[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],_0x1e797c[_0x09fb('0x31')]);_0x5f5ec[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x1e797c[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x23119b['query'][_0x09fb('0x35')]));_0x5f5ec[_0x09fb('0x34')]=_0x5f5ec[_0x09fb('0x34')][_0x09fb('0x36')]?_0x5f5ec[_0x09fb('0x34')]:_0x1e797c[_0x09fb('0x30')];if(!_0x23119b[_0x09fb('0x31')][_0x09fb('0x37')](_0x09fb('0x38'))){_0x5f5ec[_0x09fb('0x1d')]=qs[_0x09fb('0x1d')](_0x23119b['query'][_0x09fb('0x1d')]);_0x5f5ec[_0x09fb('0x20')]=qs[_0x09fb('0x20')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x20')]);}_0x5f5ec['order']=qs[_0x09fb('0x39')](_0x23119b[_0x09fb('0x31')][_0x09fb('0x39')]);_0x5f5ec[_0x09fb('0x3a')]=qs[_0x09fb('0x32')](_['pick'](_0x23119b[_0x09fb('0x31')],_0x1e797c[_0x09fb('0x32')]),_0x375c0d);if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3b')]){_0x5f5ec[_0x09fb('0x3a')]=_[_0x09fb('0x3c')](_0x5f5ec[_0x09fb('0x3a')],{'$or':_[_0x09fb('0x2a')](_0x375c0d,function(_0x14628f){if(_0x14628f[_0x09fb('0x2e')]!=='VIRTUAL'){var _0x59bb4f={};_0x59bb4f[_0x14628f[_0x09fb('0x28')]]={'$like':'%'+_0x23119b[_0x09fb('0x31')]['filter']+'%'};return _0x59bb4f;}})});}_0x5f5ec=_[_0x09fb('0x3c')]({},_0x5f5ec,_0x23119b[_0x09fb('0x3d')]);var _0x5d9659={'where':_0x5f5ec[_0x09fb('0x3a')]};return db[_0x09fb('0x2b')][_0x09fb('0x1f')](_0x5d9659)['then'](function(_0x28a108){_0x4445cb[_0x09fb('0x1f')]=_0x28a108;if(_0x23119b[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x5f5ec[_0x09fb('0x3f')]=[{'all':!![]}];}return db[_0x09fb('0x2b')][_0x09fb('0x40')](_0x5f5ec);})['then'](function(_0x37b1a2){_0x4445cb[_0x09fb('0x41')]=_0x37b1a2;return _0x4445cb;})['then'](respondWithFilteredResult(_0x50cbea,_0x5f5ec))[_0x09fb('0x42')](handleError(_0x50cbea,null));};exports[_0x09fb('0x43')]=function(_0x222cb9,_0x3ea311){var _0x4eca5c={'raw':!![],'where':{'id':_0x222cb9[_0x09fb('0x44')]['id']}},_0x1e90a2={};_0x1e90a2[_0x09fb('0x30')]=_['keys'](db['Attachment'][_0x09fb('0x2c')]);_0x1e90a2[_0x09fb('0x31')]=_[_0x09fb('0x45')](_0x222cb9['query']);_0x1e90a2[_0x09fb('0x32')]=_[_0x09fb('0x33')](_0x1e90a2[_0x09fb('0x30')],_0x1e90a2['query']);_0x4eca5c[_0x09fb('0x34')]=_['intersection'](_0x1e90a2['model'],qs[_0x09fb('0x35')](_0x222cb9[_0x09fb('0x31')][_0x09fb('0x35')]));_0x4eca5c[_0x09fb('0x34')]=_0x4eca5c[_0x09fb('0x34')][_0x09fb('0x36')]?_0x4eca5c['attributes']:_0x1e90a2['model'];if(_0x222cb9[_0x09fb('0x31')][_0x09fb('0x3e')]){_0x4eca5c[_0x09fb('0x3f')]=[{'all':!![]}];}_0x4eca5c=_[_0x09fb('0x3c')]({},_0x4eca5c,_0x222cb9[_0x09fb('0x3d')]);return db[_0x09fb('0x2b')]['find'](_0x4eca5c)[_0x09fb('0x25')](handleEntityNotFound(_0x3ea311,null))[_0x09fb('0x25')](respondWithResult(_0x3ea311,null))[_0x09fb('0x42')](handleError(_0x3ea311,null));};exports['clone']=function(_0x552969,_0x1ab5cb){var _0xc83c9b={'where':{'id':_0x552969[_0x09fb('0x44')]['id']}},_0x2d72e5={};_0x2d72e5[_0x09fb('0x30')]=_[_0x09fb('0x45')](db[_0x09fb('0x2b')][_0x09fb('0x2c')]);_0xc83c9b[_0x09fb('0x34')]=_[_0x09fb('0x33')](_0x2d72e5[_0x09fb('0x30')],qs[_0x09fb('0x35')](_0x552969[_0x09fb('0x31')][_0x09fb('0x35')]));_0xc83c9b[_0x09fb('0x34')]=_0xc83c9b['attributes'][_0x09fb('0x36')]?_0xc83c9b[_0x09fb('0x34')]:_0x2d72e5[_0x09fb('0x30')];if(_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]){_0xc83c9b[_0x09fb('0x3f')]=[{'all':!![]}];}_0xc83c9b=_[_0x09fb('0x3c')]({},_0xc83c9b,_0x552969['options']);return db['Attachment'][_0x09fb('0x46')](_0xc83c9b)[_0x09fb('0x25')](handleEntityNotFound(_0x1ab5cb,null))[_0x09fb('0x25')](function(_0x3e3e9a){if(_0x3e3e9a){var _0x3f5370=_0x3e3e9a[_0x09fb('0x47')]({'plain':!![]});_0x3f5370=qs[_0x09fb('0x48')](_0x3f5370,['id',_0x09fb('0x49'),'updatedAt']);_0x552969[_0x09fb('0x4a')]=_[_0x09fb('0x48')](_0x552969[_0x09fb('0x4a')],['id',_0x09fb('0x49'),'updatedAt']);return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_[_0x09fb('0x3c')](_0x3f5370,_0x552969[_0x09fb('0x4a')]),{'include':_0x552969[_0x09fb('0x31')][_0x09fb('0x3e')]?[{'all':!![]}]:undefined});}})[_0x09fb('0x25')](respondWithResult(_0x1ab5cb,0xc9))[_0x09fb('0x42')](handleError(_0x1ab5cb,null));};exports[_0x09fb('0x24')]=function(_0x337602,_0x41ed5a){if(_0x337602[_0x09fb('0x4a')]['id']){delete _0x337602[_0x09fb('0x4a')]['id'];}return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x337602[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x41ed5a,null))[_0x09fb('0x25')](saveUpdates(_0x337602[_0x09fb('0x4a')],null))[_0x09fb('0x25')](respondWithResult(_0x41ed5a,null))[_0x09fb('0x42')](handleError(_0x41ed5a,null));};exports[_0x09fb('0x4c')]=function(_0x9f686f,_0x476b2f){return db[_0x09fb('0x2b')][_0x09fb('0x46')]({'where':{'id':_0x9f686f[_0x09fb('0x44')]['id']}})['then'](handleEntityNotFound(_0x476b2f,null))[_0x09fb('0x25')](removeEntity(_0x476b2f,null))[_0x09fb('0x42')](handleError(_0x476b2f,null));};exports[_0x09fb('0x4b')]=function(_0x475e88,_0x2d138c,_0x1d0b6c){_0x475e88[_0x09fb('0x4a')][_0x09fb('0x28')]=_0x475e88['file']['originalname'];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x4d')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x4f')];_0x475e88[_0x09fb('0x4a')][_0x09fb('0x2e')]=_0x475e88[_0x09fb('0x4e')][_0x09fb('0x50')];return db[_0x09fb('0x2b')][_0x09fb('0x4b')](_0x475e88['body'])[_0x09fb('0x25')](respondWithResult(_0x2d138c,0xc9))[_0x09fb('0x42')](handleError(_0x2d138c,null));};exports[_0x09fb('0x51')]=function(_0x4ee1f8,_0x572949,_0x5a2477){return db[_0x09fb('0x2b')]['findOne']({'where':{'id':_0x4ee1f8[_0x09fb('0x44')]['id']},'raw':!![]})[_0x09fb('0x25')](handleEntityNotFound(_0x572949,null))['then'](function(_0x10e382){if(_0x10e382){var _0x4e1259=_0x10e382[_0x09fb('0x52')]!==null;var _0x3a5010=path[_0x09fb('0x53')](config[_0x09fb('0x54')],_0x09fb('0x55'));if(_0x4e1259){_0x3a5010=path[_0x09fb('0x53')](_0x3a5010,_0x09fb('0x56'));}var _0x5ce674=path['join'](_0x3a5010,_0x10e382[_0x09fb('0x4d')]);return _0x572949['download'](_0x5ce674);}})[_0x09fb('0x42')](handleError(_0x572949,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 3b3262d..daaada8 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 _0xa583=['attachments','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xa583,0x1b9));var _0x3a58=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa583[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3a58('0x0'));var util=require(_0x3a58('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3a58('0x2'));var BPromise=require(_0x3a58('0x3'));var rp=require(_0x3a58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a58('0x5'));var config=require(_0x3a58('0x6'));var attributes=require(_0x3a58('0x7'));module[_0x3a58('0x8')]=function(_0x3ee687,_0x4ae87d){return _0x3ee687[_0x3a58('0x9')]('Attachment',attributes,{'tableName':_0x3a58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebd3=['attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x451df9,_0x5e6047){var _0x59da59=function(_0x42bcd8){while(--_0x42bcd8){_0x451df9['push'](_0x451df9['shift']());}};_0x59da59(++_0x5e6047);}(_0xebd3,0x10f));var _0x3ebd=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0xebd3[_0x53f964];return _0x17be6c;};'use strict';var _=require(_0x3ebd('0x0'));var util=require(_0x3ebd('0x1'));var logger=require(_0x3ebd('0x2'))(_0x3ebd('0x3'));var moment=require(_0x3ebd('0x4'));var BPromise=require(_0x3ebd('0x5'));var rp=require(_0x3ebd('0x6'));var fs=require('fs');var path=require(_0x3ebd('0x7'));var rimraf=require(_0x3ebd('0x8'));var config=require(_0x3ebd('0x9'));var attributes=require(_0x3ebd('0xa'));module[_0x3ebd('0xb')]=function(_0xa768c7,_0x22a69f){return _0xa768c7[_0x3ebd('0xc')](_0x3ebd('0xd'),attributes,{'tableName':_0x3ebd('0xe'),'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 65e59d0..eb2aa0b 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 _0x1339=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','options','raw','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3a802d,_0x119cfc){var _0x2fd218=function(_0x46bb78){while(--_0x46bb78){_0x3a802d['push'](_0x3a802d['shift']());}};_0x2fd218(++_0x119cfc);}(_0x1339,0x1ed));var _0x9133=function(_0x4e3d96,_0x496a94){_0x4e3d96=_0x4e3d96-0x0;var _0x45a34e=_0x1339[_0x4e3d96];return _0x45a34e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('Attachment,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['CreateAttachment']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')](_0x1f3484['body'],{'raw':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5e4f0c){logger[_0x9133('0xd')]('CreateAttachment',_0x1f3484);logger[_0x9133('0x1b')]('CreateAttachment',_0x1f3484,JSON['stringify'](_0x5e4f0c));_0x3c48ef(_0x5e4f0c);})['catch'](function(_0x2e99a1){logger[_0x9133('0x12')]('CreateAttachment',_0x2e99a1[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x2e99a1[_0x9133('0x14')]));});});}; \ No newline at end of file +var _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x42cde2,_0x13f233){var _0x15c4b6=function(_0x1a3628){while(--_0x1a3628){_0x42cde2['push'](_0x42cde2['shift']());}};_0x15c4b6(++_0x13f233);}(_0xd87e,0x1bf));var _0xed87=function(_0x3b45e8,_0x628af6){_0x3b45e8=_0x3b45e8-0x0;var _0x370099=_0xd87e[_0x3b45e8];return _0x370099;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 1b5bb60..7017d93 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x35dee6,_0xe07081){var _0x38532a=function(_0x3784a6){while(--_0x3784a6){_0x35dee6['push'](_0x35dee6['shift']());}};_0x38532a(++_0xe07081);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37e97a,_0x2be2c3){_0x37e97a=_0x37e97a-0x0;var _0x436f7e=_0x5f2f[_0x37e97a];return _0x436f7e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x1621f8,_0x5d4d97){var _0xda6552=function(_0x550d95){while(--_0x550d95){_0x1621f8['push'](_0x1621f8['shift']());}};_0xda6552(++_0x5d4d97);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4dae3e,_0x343290){_0x4dae3e=_0x4dae3e-0x0;var _0x464847=_0x5f2f[_0x4dae3e];return _0x464847;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index ed22bf9..1a365b1 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 _0x392a=['then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','online','user','name','blockedAt','add','clearBlockUser','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x392a,0x11d));var _0xa392=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x392a[_0x57b54c];return _0x59cc19;};'use strict';var passport=require(_0xa392('0x0'));var LocalStrategy=require('passport-local')[_0xa392('0x1')];var moment=require(_0xa392('0x2'));var ActiveDirectory=require(_0xa392('0x3'));var BPromise=require(_0xa392('0x4'));var util=require(_0xa392('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xa392('0x6'));var utils=require('../../config/utils');var config=require(_0xa392('0x7'));var logger=require(_0xa392('0x8'))('api');function isActiveDirectoryConfigured(_0x271ac9){var _0x4c6668=![];if(typeof _0x271ac9[_0xa392('0x9')]!==_0xa392('0xa')){_0x4c6668=_0x271ac9[_0xa392('0x9')][_0xa392('0xb')]&&_0x271ac9[_0xa392('0x9')][_0xa392('0xc')]&&_0x271ac9[_0xa392('0x9')][_0xa392('0xd')];}return _0x4c6668;}function adAuthenticate(_0x3b753d,_0x1aa5e0,_0x47ec89){return new BPromise(function(_0x4bb261,_0x45051d){try{var _0x4c3c87=new ActiveDirectory(_0x3b753d);_0x4c3c87[_0xa392('0xe')](_0x1aa5e0,_0x47ec89,function(_0x1ba9c3,_0x3929d9){if(_0x1ba9c3){logger[_0xa392('0xf')](_0xa392('0x10'),_0x1aa5e0,util[_0xa392('0x11')](_0x1ba9c3,{'showHidden':![],'depth':null}));_0x45051d(_0xa392('0x12'));}else if(!_0x3929d9){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x1aa5e0);_0x45051d(_0xa392('0x12'));}else{_0x4bb261(_0x3929d9);}});}catch(_0x59052b){_0x45051d(_0x59052b);}});}function ActiveDirectoryAuthenticate(_0x211bf3,_0x554d07,_0xf8b296,_0x2b1c2c){var _0x1bf672,_0x1c5c20;if(!isActiveDirectoryConfigured(config)){logger[_0xa392('0xf')](_0xa392('0x13'),_0x554d07);return _0x2b1c2c(null,![],{'message':_0xa392('0x12')});}return db[_0xa392('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0xa392('0x15'),_0xa392('0x16')],'raw':!![]})[_0xa392('0x17')](function(_0x1a4495){_0x1bf672=_0x1a4495;if(!_0x1bf672[_0xa392('0x15')]){logger[_0xa392('0xf')](_0xa392('0x18'),_0x554d07);throw new Error(_0xa392('0x12'));}return _0x211bf3['findOne']({'attributes':['id','name',_0xa392('0x19'),_0xa392('0x1a'),'role','disabled',_0xa392('0x1b'),'blockedAt',_0xa392('0x1c')],'where':{'name':_0x554d07,'role':{'$or':['admin',_0xa392('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0xa392('0x17')](function(_0x40d2d6){if(!_0x40d2d6||_0x40d2d6&&_0x40d2d6[_0xa392('0x1e')]!==_0x554d07){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x1c5c20=_0x40d2d6;var _0x5e225a=_0x1c5c20[_0xa392('0x1e')]+'@'+config[_0xa392('0x9')][_0xa392('0xd')];return adAuthenticate(config[_0xa392('0x9')],_0x5e225a,_0xf8b296);})[_0xa392('0x17')](function(_0x4a64d8){if(_0x1c5c20['disabled']){throw new Error(_0xa392('0x12'));}if(_0x1bf672[_0xa392('0x16')]>0x0){if(_0x1c5c20[_0xa392('0x1b')]){if(moment(_0x1c5c20[_0xa392('0x1f')])[_0xa392('0x20')](_0x1bf672[_0xa392('0x16')],'minutes')>moment()){throw new Error(_0xa392('0x12'));}return utils[_0xa392('0x21')](_0x1c5c20,0x0,![],null)[_0xa392('0x17')](function(){return utils['getLicense'](_0x1c5c20);})['then'](function(){return _0x2b1c2c(null,_0x1c5c20);});}else{return utils['getLicense'](_0x1c5c20)[_0xa392('0x17')](function(){return _0x2b1c2c(null,_0x1c5c20);});}}else{return utils['getLicense'](_0x1c5c20)[_0xa392('0x17')](function(){return _0x2b1c2c(null,_0x1c5c20);});}})[_0xa392('0x22')](function(_0x5d94ec){return _0x2b1c2c(null,![],_0x5d94ec);});}function handleError(_0x5ee5a4,_0x371c97,_0x4b7d76){return _0x5ee5a4[_0xa392('0x23')](_0x371c97||0x1f4)[_0xa392('0x24')]({'message':_0x4b7d76?_0x4b7d76[_0xa392('0x25')]||_0x4b7d76:''});}exports[_0xa392('0x26')]=function(_0x45a139,_0x1d8c61,_0x1293d4){passport[_0xa392('0xe')](_0xa392('0x27'),function(_0x59f398,_0x169e14,_0x2d1d8d){var _0x23a0ad=_0x59f398||_0x2d1d8d;if(_0x23a0ad){return handleError(_0x1d8c61,0x191,_0x23a0ad);}if(!_0x169e14){return handleError(_0x1d8c61,0x194,{'message':_0xa392('0x28')});}else{var _0x5127ba={'payload':{'id':_0x169e14['id'],'role':_0x169e14['role']},'options':{'expiresIn':0x15180}};return authService[_0xa392('0x29')](_0x5127ba)[_0xa392('0x17')](function(_0x4958fb){_0x1d8c61[_0xa392('0x2a')]({'id':_0x169e14['id'],'token':_0x4958fb,'statusCall':'','isAlreadyLogged':_0x169e14[_0xa392('0x1c')]});});}})(_0x45a139,_0x1d8c61,_0x1293d4);};passport['use'](_0xa392('0x27'),new LocalStrategy({'usernameField':_0xa392('0x1e'),'passwordField':'password'},function(_0x2f8fc7,_0xee7a4e,_0x2e9284){return ActiveDirectoryAuthenticate(db[_0xa392('0x2b')],_0x2f8fc7,_0xee7a4e,_0x2e9284);})); \ No newline at end of file +var _0x8f18=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','add','minutes','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','passport-local','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error'];(function(_0x30fb4f,_0x2e4430){var _0x4ff8c8=function(_0x4a2b9a){while(--_0x4a2b9a){_0x30fb4f['push'](_0x30fb4f['shift']());}};_0x4ff8c8(++_0x2e4430);}(_0x8f18,0x108));var _0x88f1=function(_0x28fd98,_0xc2597b){_0x28fd98=_0x28fd98-0x0;var _0x2dcb8e=_0x8f18[_0x28fd98];return _0x2dcb8e;};'use strict';var passport=require(_0x88f1('0x0'));var LocalStrategy=require(_0x88f1('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x88f1('0x2'));var BPromise=require(_0x88f1('0x3'));var util=require('util');var db=require(_0x88f1('0x4'))['db'];var authService=require(_0x88f1('0x5'));var utils=require(_0x88f1('0x6'));var config=require(_0x88f1('0x7'));var logger=require('../../config/logger')(_0x88f1('0x8'));function isActiveDirectoryConfigured(_0x4fc7df){var _0x10e421=![];if(typeof _0x4fc7df[_0x88f1('0x9')]!==_0x88f1('0xa')){_0x10e421=_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xb')]&&_0x4fc7df[_0x88f1('0x9')]['url']&&_0x4fc7df[_0x88f1('0x9')][_0x88f1('0xc')];}return _0x10e421;}function adAuthenticate(_0x428129,_0x8295b0,_0x1ec829){return new BPromise(function(_0x16e857,_0x401f31){try{var _0x3aa48e=new ActiveDirectory(_0x428129);_0x3aa48e[_0x88f1('0xd')](_0x8295b0,_0x1ec829,function(_0x1b4c87,_0x35dc22){if(_0x1b4c87){logger['error'](_0x88f1('0xe'),_0x8295b0,util[_0x88f1('0xf')](_0x1b4c87,{'showHidden':![],'depth':null}));_0x401f31(_0x88f1('0x10'));}else if(!_0x35dc22){logger[_0x88f1('0x11')](_0x88f1('0x12'),_0x8295b0);_0x401f31(_0x88f1('0x10'));}else{_0x16e857(_0x35dc22);}});}catch(_0x466a70){_0x401f31(_0x466a70);}});}function ActiveDirectoryAuthenticate(_0x181acd,_0x440408,_0x34d1cc,_0x59ebb1){var _0x155369,_0x525615;if(!isActiveDirectoryConfigured(config)){logger[_0x88f1('0x11')](_0x88f1('0x13'),_0x440408);return _0x59ebb1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x88f1('0x14')][_0x88f1('0x15')]({'where':{'id':0x1},'attributes':[_0x88f1('0x16'),_0x88f1('0x17')],'raw':!![]})[_0x88f1('0x18')](function(_0x492dda){_0x155369=_0x492dda;if(!_0x155369[_0x88f1('0x16')]){logger[_0x88f1('0x11')](_0x88f1('0x19'),_0x440408);throw new Error(_0x88f1('0x10'));}return _0x181acd[_0x88f1('0x15')]({'attributes':['id',_0x88f1('0x1a'),_0x88f1('0x1b'),_0x88f1('0x1c'),_0x88f1('0x1d'),_0x88f1('0x1e'),'blocked',_0x88f1('0x1f'),_0x88f1('0x20')],'where':{'name':_0x440408,'role':{'$or':[_0x88f1('0x21'),_0x88f1('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0x88f1('0x18')](function(_0x358183){if(!_0x358183||_0x358183&&_0x358183[_0x88f1('0x1a')]!==_0x440408){throw new Error(_0x88f1('0x10'));}_0x525615=_0x358183;var _0x4a6bf8=_0x525615[_0x88f1('0x1a')]+'@'+config['activedirectory'][_0x88f1('0xc')];return adAuthenticate(config['activedirectory'],_0x4a6bf8,_0x34d1cc);})['then'](function(_0x39ec2d){if(_0x525615[_0x88f1('0x1e')]){throw new Error(_0x88f1('0x10'));}if(_0x155369[_0x88f1('0x17')]>0x0){if(_0x525615['blocked']){if(moment(_0x525615[_0x88f1('0x1f')])[_0x88f1('0x23')](_0x155369[_0x88f1('0x17')],_0x88f1('0x24'))>moment()){throw new Error(_0x88f1('0x10'));}return utils['clearBlockUser'](_0x525615,0x0,![],null)['then'](function(){return utils[_0x88f1('0x25')](_0x525615);})[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}else{return utils[_0x88f1('0x25')](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}}else{return utils['getLicense'](_0x525615)[_0x88f1('0x18')](function(){return _0x59ebb1(null,_0x525615);});}})[_0x88f1('0x26')](function(_0x218a97){return _0x59ebb1(null,![],_0x218a97);});}function handleError(_0x3ff0fd,_0x484fc6,_0x2f5dc2){return _0x3ff0fd[_0x88f1('0x27')](_0x484fc6||0x1f4)[_0x88f1('0x28')]({'message':_0x2f5dc2?_0x2f5dc2['message']||_0x2f5dc2:''});}exports[_0x88f1('0x29')]=function(_0x57c98a,_0x4ad56c,_0x29a7d5){passport['authenticate'](_0x88f1('0x2a'),function(_0x5c21ab,_0x34490c,_0x11241c){var _0x502b07=_0x5c21ab||_0x11241c;if(_0x502b07){return handleError(_0x4ad56c,0x191,_0x502b07);}if(!_0x34490c){return handleError(_0x4ad56c,0x194,{'message':_0x88f1('0x2b')});}else{var _0xeb6c40={'payload':{'id':_0x34490c['id'],'role':_0x34490c[_0x88f1('0x1d')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xeb6c40)['then'](function(_0x5c7fe8){_0x4ad56c[_0x88f1('0x2c')]({'id':_0x34490c['id'],'token':_0x5c7fe8,'statusCall':'','isAlreadyLogged':_0x34490c[_0x88f1('0x20')]});});}})(_0x57c98a,_0x4ad56c,_0x29a7d5);};passport[_0x88f1('0x2d')](_0x88f1('0x2a'),new LocalStrategy({'usernameField':_0x88f1('0x1a'),'passwordField':_0x88f1('0x1b')},function(_0x146e92,_0xf45a9b,_0xaf3a5c){return ActiveDirectoryAuthenticate(db[_0x88f1('0x2e')],_0x146e92,_0xf45a9b,_0xaf3a5c);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index f3b6866..b654bff 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 _0x8f41=['exports','./authActiveDirectory.controller','post'];(function(_0x1dc634,_0x7f73e3){var _0x40b4dc=function(_0x533fc3){while(--_0x533fc3){_0x1dc634['push'](_0x1dc634['shift']());}};_0x40b4dc(++_0x7f73e3);}(_0x8f41,0xb8));var _0x18f4=function(_0x9b74c5,_0x468f39){_0x9b74c5=_0x9b74c5-0x0;var _0x4a734c=_0x8f41[_0x9b74c5];return _0x4a734c;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x18f4('0x0'));router[_0x18f4('0x1')]('/',controller['login']);module[_0x18f4('0x2')]=router; \ No newline at end of file +var _0x5f7d=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x18c944,_0x4fbff2){var _0x472f3f=function(_0x38b93e){while(--_0x38b93e){_0x18c944['push'](_0x18c944['shift']());}};_0x472f3f(++_0x4fbff2);}(_0x5f7d,0xbb));var _0xd5f7=function(_0x2b6948,_0x548400){_0x2b6948=_0x2b6948-0x0;var _0x1fe750=_0x5f7d[_0x2b6948];return _0x1fe750;};'use strict';var express=require(_0xd5f7('0x0'));var router=express[_0xd5f7('0x1')]();var controller=require(_0xd5f7('0x2'));router[_0xd5f7('0x3')]('/',controller[_0xd5f7('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 684d4ff..d9085f4 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7a54,0x106));var _0x47a5=function(_0x3c3c81,_0xaf548){_0x3c3c81=_0x3c3c81-0x0;var _0x46edeb=_0x7a54[_0x3c3c81];return _0x46edeb;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _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(_0x24f004,_0x40f832){var _0x3f4286=function(_0x478a1a){while(--_0x478a1a){_0x24f004['push'](_0x24f004['shift']());}};_0x3f4286(++_0x40f832);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 0c1503c..b238447 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 _0x0035=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0x0035,0x14d));var _0x5003=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0x0035[_0x35e124];return _0x53c482;};'use strict';var express=require(_0x5003('0x0'));var passport=require(_0x5003('0x1'));var router=express[_0x5003('0x2')]();var controller=require(_0x5003('0x3'));var userController=require(_0x5003('0x4'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0x5003('0x5')](_0x5003('0x6'),controller[_0x5003('0x7')],authService[_0x5003('0x8')],userController['login'],authService[_0x5003('0x9')]);module[_0x5003('0xa')]=router; \ No newline at end of file +var _0x170d=['login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware'];(function(_0x3fa45b,_0x4b0ef3){var _0x251136=function(_0x5bc70a){while(--_0x5bc70a){_0x3fa45b['push'](_0x3fa45b['shift']());}};_0x251136(++_0x4b0ef3);}(_0x170d,0x13b));var _0xd170=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x170d[_0x59ee6f];return _0x4c0979;};'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 diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 32c0362..464e87e 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 _0x211e=['resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','resetPasswordExpires','send','use','User','util','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','disabled','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','find','name','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','role','json','forgot','generate','body','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x241cbc,_0x45da7b){var _0x164300=function(_0x3cba35){while(--_0x3cba35){_0x241cbc['push'](_0x241cbc['shift']());}};_0x164300(++_0x45da7b);}(_0x211e,0x1e6));var _0xe211=function(_0x204562,_0x2efa12){_0x204562=_0x204562-0x0;var _0x17558f=_0x211e[_0x204562];return _0x17558f;};'use strict';var util=require(_0xe211('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xe211('0x1')];var jayson=require(_0xe211('0x2'));var _=require(_0xe211('0x3'));var rs=require(_0xe211('0x4'));var moment=require(_0xe211('0x5'));var db=require(_0xe211('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xe211('0x7'));var client=jayson['client'][_0xe211('0x8')]({'port':0x232b});function localAuthenticate(_0x217bf6,_0x58348d,_0x5e794d,_0x1f7dd9){var _0x3d5c2,_0x315db5;return db[_0xe211('0x9')][_0xe211('0xa')]({'where':{'id':0x1},'attributes':[_0xe211('0xb'),_0xe211('0xc')],'raw':!![]})[_0xe211('0xd')](function(_0x39c4e9){_0x3d5c2=_0x39c4e9;return _0x217bf6[_0xe211('0xa')]({'attributes':['id','name',_0xe211('0xe'),_0xe211('0xf'),'role',_0xe211('0x10'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0x58348d,'role':{'$or':['admin','user',_0xe211('0x11')]}}});})[_0xe211('0xd')](function(_0x1d628f){if(!_0x1d628f||_0x1d628f&&_0x1d628f['name']!==_0x58348d){throw new Error(_0xe211('0x12'));}else{_0x315db5=_0x1d628f;return _0x315db5;}})[_0xe211('0xd')](function(){_0x315db5[_0xe211('0x13')](_0x5e794d,function(_0x5ca944,_0x36f352){var _0x4b7333=_0x315db5['loginAttempts']+0x1;if(_0x5ca944){return _0x1f7dd9(_0x5ca944);}else if(!_0x36f352){if(_0x315db5[_0xe211('0x10')]){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else if(_0x3d5c2[_0xe211('0xb')]>0x0){if(_0x315db5[_0xe211('0x14')]){if(_0x3d5c2[_0xe211('0xc')]>0x0){if(moment(_0x315db5[_0xe211('0x15')])[_0xe211('0x16')](_0x3d5c2[_0xe211('0xc')],_0xe211('0x17'))>moment()){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else{return utils[_0xe211('0x18')](_0x315db5,_0x4b7333,![],null)[_0xe211('0xd')](function(){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});});}}else{return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}}else{if(_0x4b7333>=_0x3d5c2[_0xe211('0xb')]){return utils['clearBlockUser'](_0x315db5,0x0,!![],moment())[_0xe211('0xd')](function(){return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xe211('0x18')](_0x315db5,_0x4b7333,![],null)[_0xe211('0xd')](function(){return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x315db5[_0xe211('0x10')]){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else if(_0x3d5c2[_0xe211('0xb')]>0x0){if(_0x315db5[_0xe211('0x14')]){if(_0x3d5c2[_0xe211('0xc')]>0x0){if(moment(_0x315db5['blockedAt'])[_0xe211('0x16')](_0x3d5c2[_0xe211('0xc')],_0xe211('0x17'))>moment()){return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x315db5,0x0,![],null)[_0xe211('0xd')](function(){return utils[_0xe211('0x19')](_0x315db5);})['then'](function(){return _0x1f7dd9(null,_0x315db5);});}}else{return _0x1f7dd9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x315db5,0x0,![],null)[_0xe211('0xd')](function(){return utils[_0xe211('0x19')](_0x315db5);})[_0xe211('0xd')](function(){return _0x1f7dd9(null,_0x315db5);})[_0xe211('0x1a')](function(_0x2abab6){return _0x1f7dd9(null,![],_0x2abab6);});}}else{if(_0x315db5[_0xe211('0x14')]){return _0x1f7dd9(null,![],{'message':_0xe211('0x12')});}else{return utils[_0xe211('0x19')](_0x315db5)[_0xe211('0xd')](function(){return _0x1f7dd9(null,_0x315db5);});}}}});})[_0xe211('0x1a')](function(_0x55b854){return _0x1f7dd9(null,![],_0x55b854);});}function sendServiceMail(_0x56b65f){return db['MailAccount'][_0xe211('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xe211('0x1c'),_0xe211('0x1d')],'include':[{'model':db[_0xe211('0x1e')],'as':'Smtp','include':[{'model':db[_0xe211('0x1f')],'as':'CloudProvider'}]}]})['then'](function(_0x4aec33){if(!_0x4aec33){throw new Error(_0xe211('0x20'));}var _0x3b9f30=_0x4aec33['getSmtpOptions']();var _0x574d41={'account':_0x3b9f30,'message':_[_0xe211('0x21')]({'from':util[_0xe211('0x22')]('\x22%s\x22\x20<%s>',_0x4aec33[_0xe211('0x1c')],_0x4aec33[_0xe211('0x1d')]||_0x4aec33['Smtp'][_0xe211('0x23')])},_0x56b65f)};return client[_0xe211('0x24')](_0xe211('0x25'),_0x574d41);})['then'](function(_0x268adb){if(_0x268adb[_0xe211('0x26')]){throw new Error(util[_0xe211('0x22')](_0xe211('0x27'),_0x268adb['error'][_0xe211('0x28')]||JSON[_0xe211('0x29')](_0x268adb[_0xe211('0x26')])));}return!![];});}function handleError(_0x1cd2dd,_0x2e5f3f,_0x1a1043){return _0x1cd2dd['status'](_0x2e5f3f||0x1f4)['send']({'message':_0x1a1043?_0x1a1043['message']||_0x1a1043:''});}exports[_0xe211('0x2a')]=function(_0x5e852f,_0x6e0d79,_0x22b894){passport[_0xe211('0x13')](_0xe211('0x2b'),function(_0xf3ce21,_0x11960b,_0x2c1c4f){var _0x1d517e=_0xf3ce21||_0x2c1c4f;if(_0x1d517e){return handleError(_0x6e0d79,0x191,_0x1d517e);}if(!_0x11960b){return handleError(_0x6e0d79,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xdc83d4={'payload':{'id':_0x11960b['id'],'role':_0x11960b[_0xe211('0x2c')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xdc83d4)[_0xe211('0xd')](function(_0x27b6ea){_0x6e0d79[_0xe211('0x2d')]({'id':_0x11960b['id'],'token':_0x27b6ea,'statusCall':'','isAlreadyLogged':_0x11960b['online']});});}})(_0x5e852f,_0x6e0d79,_0x22b894);};exports[_0xe211('0x2e')]=function(_0x77ad0a,_0x40e26a){if(!_0x77ad0a['body'][_0xe211('0x1d')]){return handleError(_0x40e26a,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x2cdcf0=rs[_0xe211('0x2f')]();_0x77ad0a[_0xe211('0x30')][_0xe211('0x1d')]=_0x77ad0a[_0xe211('0x30')][_0xe211('0x1d')][_0xe211('0x31')]()[_0xe211('0x32')]();var _0x1cdd98;return db[_0xe211('0x9')][_0xe211('0xa')]({'where':{'id':0x1},'attributes':[_0xe211('0xb'),_0xe211('0xc')],'raw':!![]})['then'](function(_0x2bab08){_0x1cdd98=_0x2bab08;return db['User'][_0xe211('0x1b')]({'where':{'email':_0x77ad0a['body'][_0xe211('0x1d')]}});})[_0xe211('0xd')](function(_0x479ec4){if(!_0x479ec4){throw new Error(_0xe211('0x33'));}if(_0x479ec4[_0xe211('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x479ec4[_0xe211('0x14')]){if(moment(_0x479ec4[_0xe211('0x15')])[_0xe211('0x16')](_0x1cdd98['blockDuration'],_0xe211('0x17'))>moment()){throw new Error(_0xe211('0x34'));}else{_0x479ec4[_0xe211('0x14')]=![];_0x479ec4[_0xe211('0x15')]=null;}}_0x479ec4[_0xe211('0x35')]=_0x2cdcf0;_0x479ec4['resetPasswordExpires']=Date[_0xe211('0x36')]()+0x36ee80;return _0x479ec4[_0xe211('0x37')]();})[_0xe211('0xd')](function(){return sendServiceMail({'to':_0x77ad0a[_0xe211('0x30')][_0xe211('0x1d')],'subject':_0xe211('0x38'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe211('0x39')+_0xe211('0x3a')+_0x77ad0a['headers'][_0xe211('0x3b')]+_0xe211('0x3c')+_0x2cdcf0+'\x0a\x0a'+_0xe211('0x3d')});})[_0xe211('0xd')](function(){_0x40e26a[_0xe211('0x3e')](0xc8)['send']({'message':_0xe211('0x3f')});})[_0xe211('0x1a')](function(_0x508fa8){return handleError(_0x40e26a,0x1f4,_0x508fa8);});};exports[_0xe211('0x40')]=function(_0x580875,_0x31b1f0){return db['User'][_0xe211('0x1b')]({'where':{'resetPasswordToken':_0x580875[_0xe211('0x41')][_0xe211('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xe211('0xd')](function(_0x63d174){if(!_0x63d174){throw new Error(_0xe211('0x43'));}return db[_0xe211('0x9')][_0xe211('0xa')]({'attributes':['id',_0xe211('0x44'),_0xe211('0x45'),_0xe211('0x46')]})[_0xe211('0xd')](function(_0x2f2e7e){if(_0x2f2e7e[_0xe211('0x44')])authService[_0xe211('0x47')](_0x580875[_0xe211('0x30')][_0xe211('0xe')]);if(!_0x2f2e7e['enforcePasswordHistory']||!_0x63d174[_0xe211('0x48')])return _0x63d174;authService['validatePasswordHistory'](_0x580875[_0xe211('0x30')][_0xe211('0xe')],_0x63d174['previousPasswords'],_0x2f2e7e['passwordHistoryLimit']);return _0x63d174;})['then'](function(){_0x63d174[_0xe211('0xe')]=_0x580875[_0xe211('0x30')][_0xe211('0xe')];_0x63d174['resetPasswordToken']=null;_0x63d174[_0xe211('0x49')]=null;return _0x63d174[_0xe211('0x37')]();});})[_0xe211('0xd')](function(){_0x31b1f0[_0xe211('0x3e')](0xc8)[_0xe211('0x4a')]({'message':'Password\x20reset!'});})[_0xe211('0x1a')](function(_0x277067){return handleError(_0x31b1f0,0x1f4,_0x277067);});};passport[_0xe211('0x4b')](_0xe211('0x2b'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x573bfe,_0x4e0a65,_0xa82f52){return localAuthenticate(db[_0xe211('0x4c')],_0x573bfe,_0x4e0a65,_0xa82f52);})); \ No newline at end of file +var _0xb56f=['forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','save','Password\x20reset!','use','util','passport','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','merge','format','request','SendMail','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online'];(function(_0xb050c6,_0x3ee607){var _0x7d06ee=function(_0x37d479){while(--_0x37d479){_0xb050c6['push'](_0xb050c6['shift']());}};_0x7d06ee(++_0x3ee607);}(_0xb56f,0x70));var _0xfb56=function(_0x44c35f,_0x153e3f){_0x44c35f=_0x44c35f-0x0;var _0x415a67=_0xb56f[_0x44c35f];return _0x415a67;};'use strict';var util=require(_0xfb56('0x0'));var passport=require(_0xfb56('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xfb56('0x2'));var _=require(_0xfb56('0x3'));var rs=require(_0xfb56('0x4'));var moment=require(_0xfb56('0x5'));var db=require(_0xfb56('0x6'))['db'];var authService=require(_0xfb56('0x7'));var utils=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232b});function localAuthenticate(_0x690c3a,_0x26c86b,_0xa800c0,_0x328c59){var _0x58274b,_0x1dfea8;return db[_0xfb56('0xb')][_0xfb56('0xc')]({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0x41acc9){_0x58274b=_0x41acc9;return _0x690c3a[_0xfb56('0xc')]({'attributes':['id',_0xfb56('0x10'),_0xfb56('0x11'),'salt','role',_0xfb56('0x12'),'blocked','blockedAt',_0xfb56('0x13')],'where':{'name':_0x26c86b,'role':{'$or':[_0xfb56('0x14'),_0xfb56('0x15'),_0xfb56('0x16')]}}});})[_0xfb56('0xf')](function(_0x4f4a27){if(!_0x4f4a27||_0x4f4a27&&_0x4f4a27[_0xfb56('0x10')]!==_0x26c86b){throw new Error(_0xfb56('0x17'));}else{_0x1dfea8=_0x4f4a27;return _0x1dfea8;}})[_0xfb56('0xf')](function(){_0x1dfea8[_0xfb56('0x18')](_0xa800c0,function(_0x200d89,_0x1407b6){var _0x345da0=_0x1dfea8[_0xfb56('0x13')]+0x1;if(_0x200d89){return _0x328c59(_0x200d89);}else if(!_0x1407b6){if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8['blocked']){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b['blockDuration'],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x345da0>=_0x58274b[_0xfb56('0xd')]){return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,!![],moment())[_0xfb56('0xf')](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,_0x345da0,![],null)['then'](function(){return _0x328c59(null,![],{'message':_0xfb56('0x17')});});}}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{if(_0x1dfea8['disabled']){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else if(_0x58274b[_0xfb56('0xd')]>0x0){if(_0x1dfea8[_0xfb56('0x1d')]){if(_0x58274b[_0xfb56('0xe')]>0x0){if(moment(_0x1dfea8[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x58274b[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}else{return _0x328c59(null,![],{'message':_0xfb56('0x17')});}}else{return utils[_0xfb56('0x1c')](_0x1dfea8,0x0,![],null)[_0xfb56('0xf')](function(){return utils[_0xfb56('0x1e')](_0x1dfea8);})[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);})[_0xfb56('0x1f')](function(_0x16ebfb){return _0x328c59(null,![],_0x16ebfb);});}}else{if(_0x1dfea8[_0xfb56('0x1d')]){return _0x328c59(null,![],{'message':_0xfb56('0x17')});}else{return utils[_0xfb56('0x1e')](_0x1dfea8)[_0xfb56('0xf')](function(){return _0x328c59(null,_0x1dfea8);});}}}});})[_0xfb56('0x1f')](function(_0x3a0cc5){return _0x328c59(null,![],_0x3a0cc5);});}function sendServiceMail(_0xc6f4dc){return db[_0xfb56('0x20')][_0xfb56('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0xfb56('0x22')],'include':[{'model':db['MailServerOut'],'as':_0xfb56('0x23'),'include':[{'model':db[_0xfb56('0x24')],'as':_0xfb56('0x24')}]}]})[_0xfb56('0xf')](function(_0x305503){if(!_0x305503){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3c2fc0=_0x305503[_0xfb56('0x25')]();var _0x1117d5={'account':_0x3c2fc0,'message':_[_0xfb56('0x26')]({'from':util[_0xfb56('0x27')]('\x22%s\x22\x20<%s>',_0x305503[_0xfb56('0x10')],_0x305503[_0xfb56('0x22')]||_0x305503[_0xfb56('0x23')][_0xfb56('0x15')])},_0xc6f4dc)};return client[_0xfb56('0x28')](_0xfb56('0x29'),_0x1117d5);})[_0xfb56('0xf')](function(_0x598b0d){if(_0x598b0d[_0xfb56('0x2a')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x598b0d[_0xfb56('0x2a')][_0xfb56('0x2b')]||JSON[_0xfb56('0x2c')](_0x598b0d[_0xfb56('0x2a')])));}return!![];});}function handleError(_0xefea57,_0x1e7655,_0x39323c){return _0xefea57[_0xfb56('0x2d')](_0x1e7655||0x1f4)[_0xfb56('0x2e')]({'message':_0x39323c?_0x39323c['message']||_0x39323c:''});}exports['login']=function(_0x36b3f9,_0xcdf580,_0x531c86){passport['authenticate']('local-login',function(_0x230db5,_0x597c12,_0x5381e3){var _0xad2345=_0x230db5||_0x5381e3;if(_0xad2345){return handleError(_0xcdf580,0x191,_0xad2345);}if(!_0x597c12){return handleError(_0xcdf580,0x194,{'message':_0xfb56('0x2f')});}else{var _0x559e50={'payload':{'id':_0x597c12['id'],'role':_0x597c12[_0xfb56('0x30')]},'options':{'expiresIn':0x15180}};return authService[_0xfb56('0x31')](_0x559e50)[_0xfb56('0xf')](function(_0x4a9ded){_0xcdf580[_0xfb56('0x32')]({'id':_0x597c12['id'],'token':_0x4a9ded,'statusCall':'','isAlreadyLogged':_0x597c12[_0xfb56('0x33')]});});}})(_0x36b3f9,_0xcdf580,_0x531c86);};exports[_0xfb56('0x34')]=function(_0xfe7b16,_0xc4a936){if(!_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')]){return handleError(_0xc4a936,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x40541e=rs[_0xfb56('0x36')]();_0xfe7b16[_0xfb56('0x35')]['email']=_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')][_0xfb56('0x37')]()['toLowerCase']();var _0x3e7750;return db[_0xfb56('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xfb56('0xd'),_0xfb56('0xe')],'raw':!![]})[_0xfb56('0xf')](function(_0xb9975f){_0x3e7750=_0xb9975f;return db[_0xfb56('0x38')]['find']({'where':{'email':_0xfe7b16[_0xfb56('0x35')]['email']}});})[_0xfb56('0xf')](function(_0x42be24){if(!_0x42be24){throw new Error(_0xfb56('0x39'));}if(_0x42be24[_0xfb56('0x12')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x42be24[_0xfb56('0x1d')]){if(moment(_0x42be24[_0xfb56('0x19')])[_0xfb56('0x1a')](_0x3e7750[_0xfb56('0xe')],_0xfb56('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x42be24['blocked']=![];_0x42be24[_0xfb56('0x19')]=null;}}_0x42be24['resetPasswordToken']=_0x40541e;_0x42be24['resetPasswordExpires']=Date[_0xfb56('0x3a')]()+0x36ee80;return _0x42be24['save']();})[_0xfb56('0xf')](function(){return sendServiceMail({'to':_0xfe7b16[_0xfb56('0x35')][_0xfb56('0x22')],'subject':_0xfb56('0x3b'),'text':_0xfb56('0x3c')+_0xfb56('0x3d')+_0xfb56('0x3e')+_0xfe7b16[_0xfb56('0x3f')][_0xfb56('0x40')]+'/reset/'+_0x40541e+'\x0a\x0a'+_0xfb56('0x41')});})['then'](function(){_0xc4a936[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x42')});})[_0xfb56('0x1f')](function(_0x388e31){return handleError(_0xc4a936,0x1f4,_0x388e31);});};exports[_0xfb56('0x43')]=function(_0xb452bd,_0xc094fd){return db[_0xfb56('0x38')][_0xfb56('0x21')]({'where':{'resetPasswordToken':_0xb452bd[_0xfb56('0x44')][_0xfb56('0x45')],'resetPasswordExpires':{'$gt':Date[_0xfb56('0x3a')]()}}})[_0xfb56('0xf')](function(_0x28dfc0){if(!_0x28dfc0){throw new Error(_0xfb56('0x46'));}return db[_0xfb56('0xb')]['findOne']({'attributes':['id',_0xfb56('0x47'),_0xfb56('0x48'),_0xfb56('0x49')]})[_0xfb56('0xf')](function(_0x3060a7){if(_0x3060a7[_0xfb56('0x47')])authService[_0xfb56('0x4a')](_0xb452bd[_0xfb56('0x35')][_0xfb56('0x11')]);if(!_0x3060a7[_0xfb56('0x48')]||!_0x28dfc0[_0xfb56('0x4b')])return _0x28dfc0;authService[_0xfb56('0x4c')](_0xb452bd['body'][_0xfb56('0x11')],_0x28dfc0['previousPasswords'],_0x3060a7[_0xfb56('0x49')]);return _0x28dfc0;})[_0xfb56('0xf')](function(){_0x28dfc0[_0xfb56('0x11')]=_0xb452bd[_0xfb56('0x35')]['password'];_0x28dfc0[_0xfb56('0x4d')]=null;_0x28dfc0[_0xfb56('0x4e')]=null;return _0x28dfc0[_0xfb56('0x4f')]();});})[_0xfb56('0xf')](function(){_0xc094fd[_0xfb56('0x2d')](0xc8)[_0xfb56('0x2e')]({'message':_0xfb56('0x50')});})['catch'](function(_0x432f34){return handleError(_0xc094fd,0x1f4,_0x432f34);});};passport[_0xfb56('0x51')]('local-login',new LocalStrategy({'usernameField':_0xfb56('0x10'),'passwordField':_0xfb56('0x11')},function(_0x6b1ab6,_0x4f258b,_0x54ff23){return localAuthenticate(db[_0xfb56('0x38')],_0x6b1ab6,_0x4f258b,_0x54ff23);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e6cbe90..514064e 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 _0x2268=['./authLocal.controller','login','/forgot','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x11490a,_0x325f82){var _0x37ea5e=function(_0xe68b42){while(--_0xe68b42){_0x11490a['push'](_0x11490a['shift']());}};_0x37ea5e(++_0x325f82);}(_0x2268,0x103));var _0x8226=function(_0x26758e,_0x407c00){_0x26758e=_0x26758e-0x0;var _0x3c3ac3=_0x2268[_0x26758e];return _0x3c3ac3;};'use strict';var express=require(_0x8226('0x0'));var router=express[_0x8226('0x1')]();var controller=require(_0x8226('0x2'));router['post']('/',controller[_0x8226('0x3')]);router['post'](_0x8226('0x4'),controller[_0x8226('0x5')]);router['post'](_0x8226('0x6'),controller[_0x8226('0x7')]);module[_0x8226('0x8')]=router; \ No newline at end of file +var _0x1cb4=['post','login','/forgot','forgot','/reset/:token','express','Router'];(function(_0x347ae8,_0x55e717){var _0x109fb6=function(_0x4657fc){while(--_0x4657fc){_0x347ae8['push'](_0x347ae8['shift']());}};_0x109fb6(++_0x55e717);}(_0x1cb4,0x18d));var _0x41cb=function(_0x774780,_0x3012aa){_0x774780=_0x774780-0x0;var _0x596b9a=_0x1cb4[_0x774780];return _0x596b9a;};'use strict';var express=require(_0x41cb('0x0'));var router=express[_0x41cb('0x1')]();var controller=require('./authLocal.controller');router[_0x41cb('0x2')]('/',controller[_0x41cb('0x3')]);router[_0x41cb('0x2')](_0x41cb('0x4'),controller[_0x41cb('0x5')]);router['post'](_0x41cb('0x6'),controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 8492e8d..c261b45 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 _0x3623=['INTEGER','exports','STRING','BOOLEAN'];(function(_0xefbe93,_0x486b59){var _0x348a0f=function(_0x377055){while(--_0x377055){_0xefbe93['push'](_0xefbe93['shift']());}};_0x348a0f(++_0x486b59);}(_0x3623,0x9d));var _0x3362=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x3623[_0x5a19fc];return _0x34b413;};'use strict';var Sequelize=require('sequelize');module[_0x3362('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3362('0x1')]},'description':{'type':Sequelize[_0x3362('0x1')]},'status':{'type':Sequelize[_0x3362('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3362('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x8fe8=['sequelize','exports','STRING','INTEGER'];(function(_0x21b49a,_0x4a930c){var _0x2e0492=function(_0x4fb37e){while(--_0x4fb37e){_0x21b49a['push'](_0x21b49a['shift']());}};_0x2e0492(++_0x4a930c);}(_0x8fe8,0x100));var _0x88fe=function(_0x67d9d7,_0x49b147){_0x67d9d7=_0x67d9d7-0x0;var _0x2a7c7f=_0x8fe8[_0x67d9d7];return _0x2a7c7f;};'use strict';var Sequelize=require(_0x88fe('0x0'));module[_0x88fe('0x1')]={'name':{'type':Sequelize[_0x88fe('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x88fe('0x2')]},'description':{'type':Sequelize[_0x88fe('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x88fe('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 0d39f62..44b1326 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 _0xcb46=['rawAttributes','length','find','catch','create','body','params','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','model','keys','intersection','query','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','include','Automation','findAll','rows','show'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0xcb46,0x108));var _0x6cb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb46[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6cb4('0x0'));var rimraf=require(_0x6cb4('0x1'));var zipdir=require(_0x6cb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6cb4('0x3'));var BPromise=require(_0x6cb4('0x4'));var Mustache=require('mustache');var util=require(_0x6cb4('0x5'));var path=require(_0x6cb4('0x6'));var sox=require(_0x6cb4('0x7'));var csv=require(_0x6cb4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6cb4('0x9'));var _=require(_0x6cb4('0xa'));var squel=require(_0x6cb4('0xb'));var crypto=require(_0x6cb4('0xc'));var jsforce=require(_0x6cb4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6cb4('0x8'));var querystring=require(_0x6cb4('0xe'));var Papa=require(_0x6cb4('0xf'));var Redis=require(_0x6cb4('0x10'));var authService=require(_0x6cb4('0x11'));var qs=require(_0x6cb4('0x12'));var as=require(_0x6cb4('0x13'));var hardwareService=require(_0x6cb4('0x14'));var logger=require(_0x6cb4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6cb4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cb4('0x17'))['db'];function respondWithStatusCode(_0x35bb39,_0x1de3d6){_0x1de3d6=_0x1de3d6||0xcc;return function(_0x28ae09){if(_0x28ae09){return _0x35bb39[_0x6cb4('0x18')](_0x1de3d6);}return _0x35bb39[_0x6cb4('0x19')](_0x1de3d6)[_0x6cb4('0x1a')]();};}function respondWithResult(_0x4b1543,_0x57823e){_0x57823e=_0x57823e||0xc8;return function(_0xe3a663){if(_0xe3a663){return _0x4b1543[_0x6cb4('0x19')](_0x57823e)[_0x6cb4('0x1b')](_0xe3a663);}};}function respondWithFilteredResult(_0xd15616,_0x4aece7){return function(_0xc5be13){if(_0xc5be13){var _0x4c8c0b=typeof _0x4aece7[_0x6cb4('0x1c')]==='undefined'&&typeof _0x4aece7['limit']===_0x6cb4('0x1d');var _0x452aaf=_0xc5be13['count'];var _0x5b9fea=_0x4c8c0b?0x0:_0x4aece7['offset'];var _0xbe8e5b=_0x4c8c0b?_0xc5be13[_0x6cb4('0x1e')]:_0x4aece7[_0x6cb4('0x1c')]+_0x4aece7[_0x6cb4('0x1f')];var _0x33b266;if(_0xbe8e5b>=_0x452aaf){_0xbe8e5b=_0x452aaf;_0x33b266=0xc8;}else{_0x33b266=0xce;}_0xd15616[_0x6cb4('0x19')](_0x33b266);return _0xd15616['set'](_0x6cb4('0x20'),_0x5b9fea+'-'+_0xbe8e5b+'/'+_0x452aaf)[_0x6cb4('0x1b')](_0xc5be13);}return null;};}function patchUpdates(_0x7a15d5){return function(_0x470679){try{jsonpatch['apply'](_0x470679,_0x7a15d5,!![]);}catch(_0x39c588){return BPromise[_0x6cb4('0x21')](_0x39c588);}return _0x470679[_0x6cb4('0x22')]();};}function saveUpdates(_0x2bdbcd,_0x3aca3c){return function(_0x3cfafe){if(_0x3cfafe){return _0x3cfafe[_0x6cb4('0x23')](_0x2bdbcd)[_0x6cb4('0x24')](function(_0x5f20f1){return _0x5f20f1;});}return null;};}function removeEntity(_0x12313b,_0x134d7c){return function(_0x14ac9c){if(_0x14ac9c){return _0x14ac9c['destroy']()[_0x6cb4('0x24')](function(){_0x12313b[_0x6cb4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32b4a8,_0x147529){return function(_0x156914){if(!_0x156914){_0x32b4a8[_0x6cb4('0x18')](0x194);}return _0x156914;};}function handleError(_0x11a94a,_0x5d39bf){_0x5d39bf=_0x5d39bf||0x1f4;return function(_0xc83d65){logger[_0x6cb4('0x25')](_0xc83d65[_0x6cb4('0x26')]);if(_0xc83d65[_0x6cb4('0x27')]){delete _0xc83d65[_0x6cb4('0x27')];}_0x11a94a[_0x6cb4('0x19')](_0x5d39bf)[_0x6cb4('0x28')](_0xc83d65);};}exports[_0x6cb4('0x29')]=function(_0x10af7a,_0x42d0c3){var _0x8159cc={},_0x46b057={},_0x46b0d1={'count':0x0,'rows':[]};var _0x2d92fa=_[_0x6cb4('0x2a')](db['Automation']['rawAttributes'],function(_0x19f18b){return{'name':_0x19f18b[_0x6cb4('0x2b')],'type':_0x19f18b[_0x6cb4('0x2c')]['key']};});_0x46b057[_0x6cb4('0x2d')]=_[_0x6cb4('0x2a')](_0x2d92fa,_0x6cb4('0x27'));_0x46b057['query']=_[_0x6cb4('0x2e')](_0x10af7a['query']);_0x46b057['filters']=_[_0x6cb4('0x2f')](_0x46b057[_0x6cb4('0x2d')],_0x46b057[_0x6cb4('0x30')]);_0x8159cc[_0x6cb4('0x31')]=_['intersection'](_0x46b057[_0x6cb4('0x2d')],qs[_0x6cb4('0x32')](_0x10af7a['query'][_0x6cb4('0x32')]));_0x8159cc[_0x6cb4('0x31')]=_0x8159cc[_0x6cb4('0x31')]['length']?_0x8159cc[_0x6cb4('0x31')]:_0x46b057['model'];if(!_0x10af7a[_0x6cb4('0x30')]['hasOwnProperty'](_0x6cb4('0x33'))){_0x8159cc['limit']=qs[_0x6cb4('0x1f')](_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x1f')]);_0x8159cc[_0x6cb4('0x1c')]=qs[_0x6cb4('0x1c')](_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x1c')]);}_0x8159cc['order']=qs['sort'](_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x34')]);_0x8159cc[_0x6cb4('0x35')]=qs[_0x6cb4('0x36')](_[_0x6cb4('0x37')](_0x10af7a[_0x6cb4('0x30')],_0x46b057[_0x6cb4('0x36')]),_0x2d92fa);if(_0x10af7a['query'][_0x6cb4('0x38')]){_0x8159cc[_0x6cb4('0x35')]=_[_0x6cb4('0x39')](_0x8159cc[_0x6cb4('0x35')],{'$or':_['map'](_0x2d92fa,function(_0xd622cb){if(_0xd622cb[_0x6cb4('0x2c')]!=='VIRTUAL'){var _0x4b3a36={};_0x4b3a36[_0xd622cb[_0x6cb4('0x27')]]={'$like':'%'+_0x10af7a[_0x6cb4('0x30')][_0x6cb4('0x38')]+'%'};return _0x4b3a36;}})});}_0x8159cc=_[_0x6cb4('0x39')]({},_0x8159cc,_0x10af7a[_0x6cb4('0x3a')]);var _0x243727={'where':_0x8159cc[_0x6cb4('0x35')]};return db['Automation'][_0x6cb4('0x1e')](_0x243727)[_0x6cb4('0x24')](function(_0x7d25ed){_0x46b0d1[_0x6cb4('0x1e')]=_0x7d25ed;if(_0x10af7a[_0x6cb4('0x30')]['includeAll']){_0x8159cc[_0x6cb4('0x3b')]=[{'all':!![]}];}return db[_0x6cb4('0x3c')][_0x6cb4('0x3d')](_0x8159cc);})[_0x6cb4('0x24')](function(_0x50a80b){_0x46b0d1[_0x6cb4('0x3e')]=_0x50a80b;return _0x46b0d1;})['then'](respondWithFilteredResult(_0x42d0c3,_0x8159cc))['catch'](handleError(_0x42d0c3,null));};exports[_0x6cb4('0x3f')]=function(_0x4096dd,_0x111a7a){var _0x3a16ca={'raw':![],'where':{'id':_0x4096dd['params']['id']}},_0xd942fa={};_0xd942fa['model']=_[_0x6cb4('0x2e')](db[_0x6cb4('0x3c')][_0x6cb4('0x40')]);_0xd942fa[_0x6cb4('0x30')]=_[_0x6cb4('0x2e')](_0x4096dd[_0x6cb4('0x30')]);_0xd942fa[_0x6cb4('0x36')]=_['intersection'](_0xd942fa[_0x6cb4('0x2d')],_0xd942fa[_0x6cb4('0x30')]);_0x3a16ca[_0x6cb4('0x31')]=_[_0x6cb4('0x2f')](_0xd942fa[_0x6cb4('0x2d')],qs[_0x6cb4('0x32')](_0x4096dd[_0x6cb4('0x30')][_0x6cb4('0x32')]));_0x3a16ca[_0x6cb4('0x31')]=_0x3a16ca[_0x6cb4('0x31')][_0x6cb4('0x41')]?_0x3a16ca['attributes']:_0xd942fa[_0x6cb4('0x2d')];if(_0x4096dd['query']['includeAll']){_0x3a16ca[_0x6cb4('0x3b')]=[{'all':!![]}];}_0x3a16ca=_[_0x6cb4('0x39')]({},_0x3a16ca,_0x4096dd[_0x6cb4('0x3a')]);return db[_0x6cb4('0x3c')][_0x6cb4('0x42')](_0x3a16ca)[_0x6cb4('0x24')](handleEntityNotFound(_0x111a7a,null))[_0x6cb4('0x24')](respondWithResult(_0x111a7a,null))[_0x6cb4('0x43')](handleError(_0x111a7a,null));};exports['create']=function(_0x47e2cb,_0x701a3a){return db[_0x6cb4('0x3c')][_0x6cb4('0x44')](_0x47e2cb['body'],{})[_0x6cb4('0x24')](respondWithResult(_0x701a3a,0xc9))[_0x6cb4('0x43')](handleError(_0x701a3a,null));};exports[_0x6cb4('0x23')]=function(_0x5e0d5b,_0x5dcd98){if(_0x5e0d5b[_0x6cb4('0x45')]['id']){delete _0x5e0d5b[_0x6cb4('0x45')]['id'];}return db[_0x6cb4('0x3c')][_0x6cb4('0x42')]({'where':{'id':_0x5e0d5b[_0x6cb4('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dcd98,null))[_0x6cb4('0x24')](saveUpdates(_0x5e0d5b[_0x6cb4('0x45')],null))[_0x6cb4('0x24')](respondWithResult(_0x5dcd98,null))[_0x6cb4('0x43')](handleError(_0x5dcd98,null));};exports[_0x6cb4('0x47')]=function(_0x34834a,_0x3a06ee){return db['Automation'][_0x6cb4('0x42')]({'where':{'id':_0x34834a[_0x6cb4('0x46')]['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x3a06ee,null))[_0x6cb4('0x24')](removeEntity(_0x3a06ee,null))[_0x6cb4('0x43')](handleError(_0x3a06ee,null));};exports[_0x6cb4('0x48')]=function(_0x287371,_0x32b025,_0x215b31){return db[_0x6cb4('0x49')][_0x6cb4('0x42')]({'where':{'id':_0x287371[_0x6cb4('0x46')]['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x32b025,null))[_0x6cb4('0x24')](function(_0x5a06b6){if(_0x5a06b6){return _0x5a06b6[_0x6cb4('0x48')](_0x287371['body'][_0x6cb4('0x4a')],_[_0x6cb4('0x4b')](_0x287371['body'],[_0x6cb4('0x4a'),'id'])||{});}})[_0x6cb4('0x24')](respondWithResult(_0x32b025,null))[_0x6cb4('0x43')](handleError(_0x32b025,null));};exports[_0x6cb4('0x4c')]=function(_0x39d4c1,_0x5bee07,_0x22dbf9){var _0x2d4414={};var _0x3900f0={};var _0x38d8f8;var _0x471885;return db[_0x6cb4('0x3c')][_0x6cb4('0x4d')]({'where':{'id':_0x39d4c1['params']['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x5bee07,null))[_0x6cb4('0x24')](function(_0x45c79a){if(_0x45c79a){_0x38d8f8=_0x45c79a;_0x3900f0['model']=_[_0x6cb4('0x2e')](db[_0x6cb4('0x49')][_0x6cb4('0x40')]);_0x3900f0[_0x6cb4('0x30')]=_[_0x6cb4('0x2e')](_0x39d4c1[_0x6cb4('0x30')]);_0x3900f0[_0x6cb4('0x36')]=_[_0x6cb4('0x2f')](_0x3900f0[_0x6cb4('0x2d')],_0x3900f0[_0x6cb4('0x30')]);_0x2d4414[_0x6cb4('0x31')]=_[_0x6cb4('0x2f')](_0x3900f0['model'],qs['fields'](_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x32')]));_0x2d4414[_0x6cb4('0x31')]=_0x2d4414[_0x6cb4('0x31')]['length']?_0x2d4414[_0x6cb4('0x31')]:_0x3900f0[_0x6cb4('0x2d')];_0x2d4414['order']=qs[_0x6cb4('0x34')](_0x39d4c1[_0x6cb4('0x30')]['sort']);_0x2d4414['where']=qs[_0x6cb4('0x36')](_[_0x6cb4('0x37')](_0x39d4c1[_0x6cb4('0x30')],_0x3900f0['filters']));if(_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x38')]){_0x2d4414[_0x6cb4('0x35')]=_[_0x6cb4('0x39')](_0x2d4414[_0x6cb4('0x35')],{'$or':_[_0x6cb4('0x2a')](_0x2d4414[_0x6cb4('0x31')],function(_0x4139f4){var _0x477640={};_0x477640[_0x4139f4]={'$like':'%'+_0x39d4c1['query'][_0x6cb4('0x38')]+'%'};return _0x477640;})});}_0x2d4414=_[_0x6cb4('0x39')]({},_0x2d4414,_0x39d4c1[_0x6cb4('0x3a')]);return _0x38d8f8[_0x6cb4('0x4c')](_0x2d4414);}})[_0x6cb4('0x24')](function(_0x420816){if(_0x420816){_0x471885=_0x420816[_0x6cb4('0x41')];if(!_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x4e')](_0x6cb4('0x33'))){_0x2d4414['limit']=qs['limit'](_0x39d4c1['query'][_0x6cb4('0x1f')]);_0x2d4414[_0x6cb4('0x1c')]=qs[_0x6cb4('0x1c')](_0x39d4c1[_0x6cb4('0x30')][_0x6cb4('0x1c')]);}return _0x38d8f8[_0x6cb4('0x4c')](_0x2d4414);}})[_0x6cb4('0x24')](function(_0x28d325){if(_0x28d325){return _0x28d325?{'count':_0x471885,'rows':_0x28d325}:null;}})[_0x6cb4('0x24')](respondWithResult(_0x5bee07,null))['catch'](handleError(_0x5bee07,null));};exports[_0x6cb4('0x4f')]=function(_0x13be27,_0x193e4e,_0x3ad5af){return db[_0x6cb4('0x50')][_0x6cb4('0x42')]({'where':{'id':_0x13be27[_0x6cb4('0x46')]['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x193e4e,null))['then'](function(_0x24a311){if(_0x24a311){return _0x24a311['addActions'](_0x13be27['body']['ids'],_['omit'](_0x13be27[_0x6cb4('0x45')],[_0x6cb4('0x4a'),'id'])||{});}})[_0x6cb4('0x24')](respondWithResult(_0x193e4e,null))[_0x6cb4('0x43')](handleError(_0x193e4e,null));};exports[_0x6cb4('0x51')]=function(_0xe0b3bd,_0x278c0c,_0x13068e){var _0x242859={};var _0x1d71bd={};var _0x17de7e;var _0x3ae5b3;return db[_0x6cb4('0x3c')]['findOne']({'where':{'id':_0xe0b3bd['params']['id']}})[_0x6cb4('0x24')](handleEntityNotFound(_0x278c0c,null))['then'](function(_0xaccf29){if(_0xaccf29){_0x17de7e=_0xaccf29;_0x1d71bd[_0x6cb4('0x2d')]=_[_0x6cb4('0x2e')](db[_0x6cb4('0x50')]['rawAttributes']);_0x1d71bd[_0x6cb4('0x30')]=_[_0x6cb4('0x2e')](_0xe0b3bd[_0x6cb4('0x30')]);_0x1d71bd[_0x6cb4('0x36')]=_[_0x6cb4('0x2f')](_0x1d71bd[_0x6cb4('0x2d')],_0x1d71bd[_0x6cb4('0x30')]);_0x242859['attributes']=_[_0x6cb4('0x2f')](_0x1d71bd[_0x6cb4('0x2d')],qs[_0x6cb4('0x32')](_0xe0b3bd[_0x6cb4('0x30')][_0x6cb4('0x32')]));_0x242859['attributes']=_0x242859[_0x6cb4('0x31')]['length']?_0x242859[_0x6cb4('0x31')]:_0x1d71bd[_0x6cb4('0x2d')];_0x242859['order']=qs[_0x6cb4('0x34')](_0xe0b3bd['query'][_0x6cb4('0x34')]);_0x242859['where']=qs['filters'](_['pick'](_0xe0b3bd['query'],_0x1d71bd[_0x6cb4('0x36')]));if(_0xe0b3bd[_0x6cb4('0x30')][_0x6cb4('0x38')]){_0x242859[_0x6cb4('0x35')]=_[_0x6cb4('0x39')](_0x242859[_0x6cb4('0x35')],{'$or':_[_0x6cb4('0x2a')](_0x242859[_0x6cb4('0x31')],function(_0x4ca06a){var _0x32d103={};_0x32d103[_0x4ca06a]={'$like':'%'+_0xe0b3bd[_0x6cb4('0x30')]['filter']+'%'};return _0x32d103;})});}_0x242859=_[_0x6cb4('0x39')]({},_0x242859,_0xe0b3bd['options']);return _0x17de7e[_0x6cb4('0x51')](_0x242859);}})[_0x6cb4('0x24')](function(_0xeff276){if(_0xeff276){_0x3ae5b3=_0xeff276[_0x6cb4('0x41')];if(!_0xe0b3bd['query'][_0x6cb4('0x4e')](_0x6cb4('0x33'))){_0x242859[_0x6cb4('0x1f')]=qs[_0x6cb4('0x1f')](_0xe0b3bd[_0x6cb4('0x30')][_0x6cb4('0x1f')]);_0x242859[_0x6cb4('0x1c')]=qs[_0x6cb4('0x1c')](_0xe0b3bd['query'][_0x6cb4('0x1c')]);}return _0x17de7e[_0x6cb4('0x51')](_0x242859);}})['then'](function(_0x4f4ec6){if(_0x4f4ec6){return _0x4f4ec6?{'count':_0x3ae5b3,'rows':_0x4f4ec6}:null;}})[_0x6cb4('0x24')](respondWithResult(_0x278c0c,null))[_0x6cb4('0x43')](handleError(_0x278c0c,null));}; \ No newline at end of file +var _0x7943=['Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','show','params','includeAll','catch','create','body','Condition','addConditions','ids','omit','getConditions','findOne','merge','addActions','Action','find','getActions','eml-format','zip-dir','request-promise','mustache','path','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','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7943,0x7e));var _0x3794=function(_0x831dc4,_0x1877c9){_0x831dc4=_0x831dc4-0x0;var _0x4087eb=_0x7943[_0x831dc4];return _0x4087eb;};'use strict';var emlformat=require(_0x3794('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3794('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3794('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3794('0x3'));var util=require('util');var path=require(_0x3794('0x4'));var sox=require(_0x3794('0x5'));var csv=require(_0x3794('0x6'));var ejs=require(_0x3794('0x7'));var fs=require('fs');var fs_extra=require(_0x3794('0x8'));var _=require(_0x3794('0x9'));var squel=require(_0x3794('0xa'));var crypto=require(_0x3794('0xb'));var jsforce=require(_0x3794('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3794('0x6'));var querystring=require(_0x3794('0xd'));var Papa=require(_0x3794('0xe'));var Redis=require(_0x3794('0xf'));var authService=require(_0x3794('0x10'));var qs=require(_0x3794('0x11'));var as=require(_0x3794('0x12'));var hardwareService=require(_0x3794('0x13'));var logger=require('../../config/logger')(_0x3794('0x14'));var utils=require(_0x3794('0x15'));var config=require(_0x3794('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3794('0x17'))['db'];function respondWithStatusCode(_0x22b5e5,_0x5e0a2d){_0x5e0a2d=_0x5e0a2d||0xcc;return function(_0x15dbbd){if(_0x15dbbd){return _0x22b5e5['sendStatus'](_0x5e0a2d);}return _0x22b5e5[_0x3794('0x18')](_0x5e0a2d)[_0x3794('0x19')]();};}function respondWithResult(_0x115f2c,_0xa08c4d){_0xa08c4d=_0xa08c4d||0xc8;return function(_0x1e1b64){if(_0x1e1b64){return _0x115f2c[_0x3794('0x18')](_0xa08c4d)['json'](_0x1e1b64);}};}function respondWithFilteredResult(_0x3e6f44,_0x27dcdf){return function(_0xa81d2a){if(_0xa81d2a){var _0x15a95d=typeof _0x27dcdf[_0x3794('0x1a')]==='undefined'&&typeof _0x27dcdf[_0x3794('0x1b')]===_0x3794('0x1c');var _0x315758=_0xa81d2a[_0x3794('0x1d')];var _0x1ecb34=_0x15a95d?0x0:_0x27dcdf[_0x3794('0x1a')];var _0x577fbe=_0x15a95d?_0xa81d2a[_0x3794('0x1d')]:_0x27dcdf[_0x3794('0x1a')]+_0x27dcdf[_0x3794('0x1b')];var _0x5499c2;if(_0x577fbe>=_0x315758){_0x577fbe=_0x315758;_0x5499c2=0xc8;}else{_0x5499c2=0xce;}_0x3e6f44[_0x3794('0x18')](_0x5499c2);return _0x3e6f44['set'](_0x3794('0x1e'),_0x1ecb34+'-'+_0x577fbe+'/'+_0x315758)[_0x3794('0x1f')](_0xa81d2a);}return null;};}function patchUpdates(_0x4453c1){return function(_0x130f4f){try{jsonpatch['apply'](_0x130f4f,_0x4453c1,!![]);}catch(_0x234a03){return BPromise['reject'](_0x234a03);}return _0x130f4f[_0x3794('0x20')]();};}function saveUpdates(_0x2e6b67,_0x16b26e){return function(_0x58a970){if(_0x58a970){return _0x58a970[_0x3794('0x21')](_0x2e6b67)[_0x3794('0x22')](function(_0x3f60c9){return _0x3f60c9;});}return null;};}function removeEntity(_0x49dc47,_0x2497eb){return function(_0x42f162){if(_0x42f162){return _0x42f162[_0x3794('0x23')]()['then'](function(){_0x49dc47[_0x3794('0x18')](0xcc)[_0x3794('0x19')]();});}};}function handleEntityNotFound(_0x5ee5f0,_0x2bdc0a){return function(_0x56b3dc){if(!_0x56b3dc){_0x5ee5f0[_0x3794('0x24')](0x194);}return _0x56b3dc;};}function handleError(_0x5eddd5,_0xdbe130){_0xdbe130=_0xdbe130||0x1f4;return function(_0x285eb9){logger[_0x3794('0x25')](_0x285eb9[_0x3794('0x26')]);if(_0x285eb9[_0x3794('0x27')]){delete _0x285eb9[_0x3794('0x27')];}_0x5eddd5[_0x3794('0x18')](_0xdbe130)[_0x3794('0x28')](_0x285eb9);};}exports[_0x3794('0x29')]=function(_0x44fe69,_0x2045f5){var _0x3a3c8a={},_0x5a3e70={},_0x434dc3={'count':0x0,'rows':[]};var _0x1025a0=_['map'](db[_0x3794('0x2a')][_0x3794('0x2b')],function(_0x180f9f){return{'name':_0x180f9f[_0x3794('0x2c')],'type':_0x180f9f[_0x3794('0x2d')][_0x3794('0x2e')]};});_0x5a3e70['model']=_[_0x3794('0x2f')](_0x1025a0,_0x3794('0x27'));_0x5a3e70[_0x3794('0x30')]=_[_0x3794('0x31')](_0x44fe69[_0x3794('0x30')]);_0x5a3e70[_0x3794('0x32')]=_[_0x3794('0x33')](_0x5a3e70['model'],_0x5a3e70[_0x3794('0x30')]);_0x3a3c8a['attributes']=_[_0x3794('0x33')](_0x5a3e70[_0x3794('0x34')],qs[_0x3794('0x35')](_0x44fe69[_0x3794('0x30')]['fields']));_0x3a3c8a[_0x3794('0x36')]=_0x3a3c8a[_0x3794('0x36')][_0x3794('0x37')]?_0x3a3c8a['attributes']:_0x5a3e70[_0x3794('0x34')];if(!_0x44fe69[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x3a3c8a[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x1b')]);_0x3a3c8a[_0x3794('0x1a')]=qs['offset'](_0x44fe69[_0x3794('0x30')][_0x3794('0x1a')]);}_0x3a3c8a[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x44fe69[_0x3794('0x30')][_0x3794('0x3b')]);_0x3a3c8a[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x44fe69[_0x3794('0x30')],_0x5a3e70['filters']),_0x1025a0);if(_0x44fe69[_0x3794('0x30')][_0x3794('0x3e')]){_0x3a3c8a['where']=_['merge'](_0x3a3c8a[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1025a0,function(_0x5209c1){if(_0x5209c1[_0x3794('0x2d')]!=='VIRTUAL'){var _0x44414f={};_0x44414f[_0x5209c1[_0x3794('0x27')]]={'$like':'%'+_0x44fe69['query'][_0x3794('0x3e')]+'%'};return _0x44414f;}})});}_0x3a3c8a=_['merge']({},_0x3a3c8a,_0x44fe69[_0x3794('0x3f')]);var _0x301e21={'where':_0x3a3c8a[_0x3794('0x3c')]};return db[_0x3794('0x2a')][_0x3794('0x1d')](_0x301e21)[_0x3794('0x22')](function(_0x4f3808){_0x434dc3[_0x3794('0x1d')]=_0x4f3808;if(_0x44fe69[_0x3794('0x30')]['includeAll']){_0x3a3c8a[_0x3794('0x40')]=[{'all':!![]}];}return db[_0x3794('0x2a')][_0x3794('0x41')](_0x3a3c8a);})[_0x3794('0x22')](function(_0x188785){_0x434dc3[_0x3794('0x42')]=_0x188785;return _0x434dc3;})[_0x3794('0x22')](respondWithFilteredResult(_0x2045f5,_0x3a3c8a))['catch'](handleError(_0x2045f5,null));};exports[_0x3794('0x43')]=function(_0x3b2237,_0x357d97){var _0x36f023={'raw':![],'where':{'id':_0x3b2237[_0x3794('0x44')]['id']}},_0x30cdda={};_0x30cdda[_0x3794('0x34')]=_[_0x3794('0x31')](db['Automation'][_0x3794('0x2b')]);_0x30cdda[_0x3794('0x30')]=_['keys'](_0x3b2237[_0x3794('0x30')]);_0x30cdda['filters']=_[_0x3794('0x33')](_0x30cdda[_0x3794('0x34')],_0x30cdda['query']);_0x36f023['attributes']=_['intersection'](_0x30cdda[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3b2237[_0x3794('0x30')]['fields']));_0x36f023[_0x3794('0x36')]=_0x36f023[_0x3794('0x36')]['length']?_0x36f023[_0x3794('0x36')]:_0x30cdda[_0x3794('0x34')];if(_0x3b2237['query'][_0x3794('0x45')]){_0x36f023[_0x3794('0x40')]=[{'all':!![]}];}_0x36f023=_['merge']({},_0x36f023,_0x3b2237[_0x3794('0x3f')]);return db[_0x3794('0x2a')]['find'](_0x36f023)[_0x3794('0x22')](handleEntityNotFound(_0x357d97,null))[_0x3794('0x22')](respondWithResult(_0x357d97,null))[_0x3794('0x46')](handleError(_0x357d97,null));};exports[_0x3794('0x47')]=function(_0x454149,_0x479fb1){return db['Automation'][_0x3794('0x47')](_0x454149[_0x3794('0x48')],{})[_0x3794('0x22')](respondWithResult(_0x479fb1,0xc9))[_0x3794('0x46')](handleError(_0x479fb1,null));};exports[_0x3794('0x21')]=function(_0x4f1dd5,_0x2a3a70){if(_0x4f1dd5['body']['id']){delete _0x4f1dd5[_0x3794('0x48')]['id'];}return db[_0x3794('0x2a')]['find']({'where':{'id':_0x4f1dd5[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x2a3a70,null))[_0x3794('0x22')](saveUpdates(_0x4f1dd5['body'],null))['then'](respondWithResult(_0x2a3a70,null))[_0x3794('0x46')](handleError(_0x2a3a70,null));};exports[_0x3794('0x23')]=function(_0x453b42,_0x22f277){return db['Automation']['find']({'where':{'id':_0x453b42[_0x3794('0x44')]['id']}})['then'](handleEntityNotFound(_0x22f277,null))[_0x3794('0x22')](removeEntity(_0x22f277,null))[_0x3794('0x46')](handleError(_0x22f277,null));};exports['addConditions']=function(_0x57d1dd,_0x10a779,_0x1fcf7e){return db[_0x3794('0x49')]['find']({'where':{'id':_0x57d1dd['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x10a779,null))[_0x3794('0x22')](function(_0x1f2d79){if(_0x1f2d79){return _0x1f2d79[_0x3794('0x4a')](_0x57d1dd[_0x3794('0x48')][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x57d1dd[_0x3794('0x48')],[_0x3794('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x10a779,null))['catch'](handleError(_0x10a779,null));};exports[_0x3794('0x4d')]=function(_0x541ceb,_0x4f0b1b,_0x499208){var _0x1567b8={};var _0x30ea87={};var _0x1aed29;var _0x3ac82d;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x541ceb['params']['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x4f0b1b,null))[_0x3794('0x22')](function(_0x6ca493){if(_0x6ca493){_0x1aed29=_0x6ca493;_0x30ea87[_0x3794('0x34')]=_[_0x3794('0x31')](db['Condition'][_0x3794('0x2b')]);_0x30ea87['query']=_[_0x3794('0x31')](_0x541ceb[_0x3794('0x30')]);_0x30ea87['filters']=_['intersection'](_0x30ea87[_0x3794('0x34')],_0x30ea87[_0x3794('0x30')]);_0x1567b8[_0x3794('0x36')]=_[_0x3794('0x33')](_0x30ea87[_0x3794('0x34')],qs[_0x3794('0x35')](_0x541ceb['query'][_0x3794('0x35')]));_0x1567b8['attributes']=_0x1567b8[_0x3794('0x36')][_0x3794('0x37')]?_0x1567b8[_0x3794('0x36')]:_0x30ea87[_0x3794('0x34')];_0x1567b8[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x3b')]);_0x1567b8[_0x3794('0x3c')]=qs[_0x3794('0x32')](_['pick'](_0x541ceb['query'],_0x30ea87[_0x3794('0x32')]));if(_0x541ceb[_0x3794('0x30')][_0x3794('0x3e')]){_0x1567b8['where']=_[_0x3794('0x4f')](_0x1567b8[_0x3794('0x3c')],{'$or':_[_0x3794('0x2f')](_0x1567b8[_0x3794('0x36')],function(_0x5d9fac){var _0x1a129e={};_0x1a129e[_0x5d9fac]={'$like':'%'+_0x541ceb['query'][_0x3794('0x3e')]+'%'};return _0x1a129e;})});}_0x1567b8=_[_0x3794('0x4f')]({},_0x1567b8,_0x541ceb[_0x3794('0x3f')]);return _0x1aed29[_0x3794('0x4d')](_0x1567b8);}})[_0x3794('0x22')](function(_0x43a89e){if(_0x43a89e){_0x3ac82d=_0x43a89e['length'];if(!_0x541ceb[_0x3794('0x30')][_0x3794('0x38')](_0x3794('0x39'))){_0x1567b8[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1b')]);_0x1567b8['offset']=qs[_0x3794('0x1a')](_0x541ceb[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x1aed29['getConditions'](_0x1567b8);}})[_0x3794('0x22')](function(_0xb0bb53){if(_0xb0bb53){return _0xb0bb53?{'count':_0x3ac82d,'rows':_0xb0bb53}:null;}})['then'](respondWithResult(_0x4f0b1b,null))[_0x3794('0x46')](handleError(_0x4f0b1b,null));};exports[_0x3794('0x50')]=function(_0x6b7f9c,_0x3c6579,_0x54f51e){return db[_0x3794('0x51')][_0x3794('0x52')]({'where':{'id':_0x6b7f9c[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3c6579,null))[_0x3794('0x22')](function(_0x2a9144){if(_0x2a9144){return _0x2a9144[_0x3794('0x50')](_0x6b7f9c['body'][_0x3794('0x4b')],_[_0x3794('0x4c')](_0x6b7f9c[_0x3794('0x48')],['ids','id'])||{});}})[_0x3794('0x22')](respondWithResult(_0x3c6579,null))[_0x3794('0x46')](handleError(_0x3c6579,null));};exports[_0x3794('0x53')]=function(_0x3a1fac,_0x3f0393,_0x272886){var _0x544618={};var _0xa68b2={};var _0x2ee4de;var _0x48a57a;return db[_0x3794('0x2a')][_0x3794('0x4e')]({'where':{'id':_0x3a1fac[_0x3794('0x44')]['id']}})[_0x3794('0x22')](handleEntityNotFound(_0x3f0393,null))[_0x3794('0x22')](function(_0x123dde){if(_0x123dde){_0x2ee4de=_0x123dde;_0xa68b2[_0x3794('0x34')]=_[_0x3794('0x31')](db[_0x3794('0x51')][_0x3794('0x2b')]);_0xa68b2[_0x3794('0x30')]=_[_0x3794('0x31')](_0x3a1fac[_0x3794('0x30')]);_0xa68b2[_0x3794('0x32')]=_['intersection'](_0xa68b2['model'],_0xa68b2['query']);_0x544618[_0x3794('0x36')]=_['intersection'](_0xa68b2[_0x3794('0x34')],qs[_0x3794('0x35')](_0x3a1fac['query'][_0x3794('0x35')]));_0x544618[_0x3794('0x36')]=_0x544618[_0x3794('0x36')][_0x3794('0x37')]?_0x544618[_0x3794('0x36')]:_0xa68b2[_0x3794('0x34')];_0x544618[_0x3794('0x3a')]=qs[_0x3794('0x3b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x3b')]);_0x544618[_0x3794('0x3c')]=qs[_0x3794('0x32')](_[_0x3794('0x3d')](_0x3a1fac[_0x3794('0x30')],_0xa68b2[_0x3794('0x32')]));if(_0x3a1fac[_0x3794('0x30')]['filter']){_0x544618[_0x3794('0x3c')]=_[_0x3794('0x4f')](_0x544618[_0x3794('0x3c')],{'$or':_['map'](_0x544618[_0x3794('0x36')],function(_0x4c5042){var _0x3d902d={};_0x3d902d[_0x4c5042]={'$like':'%'+_0x3a1fac[_0x3794('0x30')][_0x3794('0x3e')]+'%'};return _0x3d902d;})});}_0x544618=_[_0x3794('0x4f')]({},_0x544618,_0x3a1fac[_0x3794('0x3f')]);return _0x2ee4de[_0x3794('0x53')](_0x544618);}})[_0x3794('0x22')](function(_0x5b1a54){if(_0x5b1a54){_0x48a57a=_0x5b1a54[_0x3794('0x37')];if(!_0x3a1fac[_0x3794('0x30')]['hasOwnProperty']('nolimit')){_0x544618[_0x3794('0x1b')]=qs[_0x3794('0x1b')](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1b')]);_0x544618[_0x3794('0x1a')]=qs['offset'](_0x3a1fac[_0x3794('0x30')][_0x3794('0x1a')]);}return _0x2ee4de['getActions'](_0x544618);}})[_0x3794('0x22')](function(_0x5035cf){if(_0x5035cf){return _0x5035cf?{'count':_0x48a57a,'rows':_0x5035cf}:null;}})['then'](respondWithResult(_0x3f0393,null))[_0x3794('0x46')](handleError(_0x3f0393,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 97a871e..6f41c2b 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 _0xfb84=['Automation','lodash','util','../../config/logger','api','moment','request-promise','rimraf','exports','define'];(function(_0x5d3e47,_0x27c60e){var _0x588ff6=function(_0x3678bf){while(--_0x3678bf){_0x5d3e47['push'](_0x5d3e47['shift']());}};_0x588ff6(++_0x27c60e);}(_0xfb84,0xfb));var _0x4fb8=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0xfb84[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0x4fb8('0x0'));var util=require(_0x4fb8('0x1'));var logger=require(_0x4fb8('0x2'))(_0x4fb8('0x3'));var moment=require(_0x4fb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fb8('0x6'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0x4fb8('0x7')]=function(_0x521089,_0x4695ab){return _0x521089[_0x4fb8('0x8')](_0x4fb8('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x938a=['request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','api','bluebird'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x938a,0x14d));var _0xa938=function(_0x14a880,_0x53a466){_0x14a880=_0x14a880-0x0;var _0x259843=_0x938a[_0x14a880];return _0x259843;};'use strict';var _=require(_0xa938('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa938('0x1'));var moment=require('moment');var BPromise=require(_0xa938('0x2'));var rp=require(_0xa938('0x3'));var fs=require('fs');var path=require(_0xa938('0x4'));var rimraf=require(_0xa938('0x5'));var config=require(_0xa938('0x6'));var attributes=require(_0xa938('0x7'));module[_0xa938('0x8')]=function(_0x133c56,_0x47c77f){return _0x133c56[_0xa938('0x9')](_0xa938('0xa'),attributes,{'tableName':_0xa938('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 2fdaf61..4704225 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 _0x4ccb=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x4a85a6,_0x2bda1c){var _0x5b7080=function(_0xc4b84e){while(--_0xc4b84e){_0x4a85a6['push'](_0x4a85a6['shift']());}};_0x5b7080(++_0x2bda1c);}(_0x4ccb,0x196));var _0xb4cc=function(_0x26488f,_0x4ae4e9){_0x26488f=_0x26488f-0x0;var _0x29802a=_0x4ccb[_0x26488f];return _0x29802a;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var moment=require(_0xb4cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xb4cc('0x3'));var fs=require('fs');var Redis=require(_0xb4cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4cc('0x5'));var logger=require(_0xb4cc('0x6'))(_0xb4cc('0x7'));var config=require('../../config/environment');var jayson=require(_0xb4cc('0x8'));var client=jayson[_0xb4cc('0x9')][_0xb4cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c0bdd,_0x370b12,_0x6ba3bf){return new BPromise(function(_0x2129ef,_0x5327a4){return client[_0xb4cc('0xb')](_0x5c0bdd,_0x6ba3bf)[_0xb4cc('0xc')](function(_0xbf893){logger[_0xb4cc('0xd')](_0xb4cc('0xe'),_0x370b12,'request\x20sent');logger[_0xb4cc('0xf')](_0xb4cc('0x10'),_0x370b12,'request\x20sent',JSON[_0xb4cc('0x11')](_0xbf893));if(_0xbf893['error']){if(_0xbf893[_0xb4cc('0x12')][_0xb4cc('0x13')]===0x1f4){logger[_0xb4cc('0x12')]('Automation,\x20%s,\x20%s',_0x370b12,_0xbf893['error'][_0xb4cc('0x14')]);return _0x5327a4(_0xbf893['error']['message']);}logger[_0xb4cc('0x12')]('Automation,\x20%s,\x20%s',_0x370b12,_0xbf893['error'][_0xb4cc('0x14')]);return _0x2129ef(_0xbf893[_0xb4cc('0x12')][_0xb4cc('0x14')]);}else{logger['info'](_0xb4cc('0xe'),_0x370b12,_0xb4cc('0x15'));_0x2129ef(_0xbf893[_0xb4cc('0x16')][_0xb4cc('0x14')]);}})[_0xb4cc('0x17')](function(_0x506ef9){logger[_0xb4cc('0x12')](_0xb4cc('0xe'),_0x370b12,_0x506ef9);_0x5327a4(_0x506ef9);});});} \ No newline at end of file +var _0xb8cb=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x3d18cf,_0x285c01){_0x3d18cf=_0x3d18cf-0x0;var _0x47943a=_0xb8cb[_0x3d18cf];return _0x47943a;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var moment=require(_0xbb8c('0x2'));var BPromise=require(_0xbb8c('0x3'));var rs=require(_0xbb8c('0x4'));var fs=require('fs');var Redis=require(_0xbb8c('0x5'));var db=require(_0xbb8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb8c('0x7'))(_0xbb8c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb8c('0x9')][_0xbb8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb759,_0x497956,_0x31224b){return new BPromise(function(_0x3eda24,_0x11d365){return client[_0xbb8c('0xb')](_0x3eb759,_0x31224b)[_0xbb8c('0xc')](function(_0x2a9791){logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));logger[_0xbb8c('0x10')](_0xbb8c('0x11'),_0x497956,_0xbb8c('0xf'),JSON['stringify'](_0x2a9791));if(_0x2a9791[_0xbb8c('0x12')]){if(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x13')]===0x1f4){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791['error'][_0xbb8c('0x14')]);return _0x11d365(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);}logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);return _0x3eda24(_0x2a9791['error'][_0xbb8c('0x14')]);}else{logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));_0x3eda24(_0x2a9791[_0xbb8c('0x15')][_0xbb8c('0x14')]);}})[_0xbb8c('0x16')](function(_0x3988cf){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x3988cf);_0x11d365(_0x3988cf);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 88baf36..ff87047 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 _0x2121=['getConditions','/:id/actions','create','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x2121,0x1b4));var _0x1212=function(_0x3760a4,_0x3329f5){_0x3760a4=_0x3760a4-0x0;var _0x1f8c66=_0x2121[_0x3760a4];return _0x1f8c66;};'use strict';var multer=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1212('0x2'));var router=express[_0x1212('0x3')]();var fs_extra=require(_0x1212('0x4'));var auth=require(_0x1212('0x5'));var interaction=require(_0x1212('0x6'));var config=require('../../config/environment');var controller=require(_0x1212('0x7'));router['get']('/',auth[_0x1212('0x8')](),controller[_0x1212('0x9')]);router[_0x1212('0xa')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0xc')]);router['get'](_0x1212('0xd'),auth[_0x1212('0x8')](),controller[_0x1212('0xe')]);router[_0x1212('0xa')](_0x1212('0xf'),auth[_0x1212('0x8')](),controller['getActions']);router['post']('/',auth[_0x1212('0x8')](),controller[_0x1212('0x10')]);router[_0x1212('0x11')](_0x1212('0xd'),auth['isAuthenticated'](),controller[_0x1212('0x12')]);router[_0x1212('0x11')](_0x1212('0xf'),auth[_0x1212('0x8')](),controller[_0x1212('0x13')]);router[_0x1212('0x14')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0x15')]);router[_0x1212('0x16')](_0x1212('0xb'),auth[_0x1212('0x8')](),controller[_0x1212('0x17')]);module[_0x1212('0x18')]=router; \ No newline at end of file +var _0x5859=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x51b8eb,_0x45e664){var _0x219949=function(_0x21d965){while(--_0x21d965){_0x51b8eb['push'](_0x51b8eb['shift']());}};_0x219949(++_0x45e664);}(_0x5859,0xc4));var _0x9585=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5859[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require(_0x9585('0x0'));var util=require(_0x9585('0x1'));var path=require(_0x9585('0x2'));var timeout=require(_0x9585('0x3'));var express=require(_0x9585('0x4'));var router=express[_0x9585('0x5')]();var fs_extra=require(_0x9585('0x6'));var auth=require(_0x9585('0x7'));var interaction=require(_0x9585('0x8'));var config=require(_0x9585('0x9'));var controller=require(_0x9585('0xa'));router[_0x9585('0xb')]('/',auth[_0x9585('0xc')](),controller['index']);router[_0x9585('0xb')](_0x9585('0xd'),auth[_0x9585('0xc')](),controller['show']);router[_0x9585('0xb')](_0x9585('0xe'),auth['isAuthenticated'](),controller['getConditions']);router[_0x9585('0xb')](_0x9585('0xf'),auth[_0x9585('0xc')](),controller[_0x9585('0x10')]);router['post']('/',auth[_0x9585('0xc')](),controller['create']);router[_0x9585('0x11')](_0x9585('0xe'),auth[_0x9585('0xc')](),controller[_0x9585('0x12')]);router[_0x9585('0x11')](_0x9585('0xf'),auth['isAuthenticated'](),controller[_0x9585('0x13')]);router[_0x9585('0x14')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x15')]);router[_0x9585('0x16')](_0x9585('0xd'),auth['isAuthenticated'](),controller[_0x9585('0x17')]);module[_0x9585('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index de3e586..2b62823 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 _0xba8e=['#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','sequelize','exports','STRING','name','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x4da93f,_0x924ad7){var _0x7e1408=function(_0x51cabc){while(--_0x51cabc){_0x4da93f['push'](_0x4da93f['shift']());}};_0x7e1408(++_0x924ad7);}(_0xba8e,0xa1));var _0xeba8=function(_0x554047,_0x46ec41){_0x554047=_0x554047-0x0;var _0x5d11e4=_0xba8e[_0x554047];return _0x5d11e4;};'use strict';var Sequelize=require(_0xeba8('0x0'));module[_0xeba8('0x1')]={'name':{'type':Sequelize[_0xeba8('0x2')],'unique':_0xeba8('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xeba8('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xeba8('0x2')]},'active':{'type':Sequelize[_0xeba8('0x5')],'defaultValue':0x0,'comment':_0xeba8('0x6')},'limitCalls':{'type':Sequelize[_0xeba8('0x7')](0x4)[_0xeba8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xeba8('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xeba8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeba8('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeba8('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeba8('0x2')],'defaultValue':_0xeba8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xeba8('0x10')](_0xeba8('0x11'),'never',_0xeba8('0x12')),'defaultValue':_0xeba8('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xeba8('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xeba8('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xeba8('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeba8('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xeba8('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xeba8('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xeba8('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xeba8('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xeba8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xeba8('0x7')](0x9)[_0xeba8('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeba8('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xeba8('0x10')]('DESC',_0xeba8('0x19')),'defaultValue':_0xeba8('0x1a')},'dialPrefix':{'type':Sequelize[_0xeba8('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeba8('0x1b')},'dialCutDigit':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xeba8('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)[_0xeba8('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x21')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xeba8('0x7')](0x3)[_0xeba8('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeba8('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xeba8('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeba8('0x24')}}; \ No newline at end of file +var _0x39bb=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3754fb,_0x12ff0e){var _0x292964=function(_0x26c8f1){while(--_0x26c8f1){_0x3754fb['push'](_0x3754fb['shift']());}};_0x292964(++_0x12ff0e);}(_0x39bb,0xe7));var _0xb39b=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x39bb[_0x4f6f84];return _0x20d989;};'use strict';var Sequelize=require('sequelize');module[_0xb39b('0x0')]={'name':{'type':Sequelize[_0xb39b('0x1')],'unique':_0xb39b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x4')),'allowNull':![],'defaultValue':_0xb39b('0x4')},'description':{'type':Sequelize[_0xb39b('0x1')]},'active':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xb39b('0x6')](0x4)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb39b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb39b('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'comment':_0xb39b('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb39b('0x10')},'dialTimezone':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':_0xb39b('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x12'),_0xb39b('0x13'),_0xb39b('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb39b('0x5')],'defaultValue':0x0,'comment':_0xb39b('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xb39b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb39b('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb39b('0x6')](0x9)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb39b('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb39b('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb39b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb39b('0x3')](_0xb39b('0x19'),_0xb39b('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb39b('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1b')},'dialCutDigit':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb39b('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb39b('0x6')](0x3)[_0xb39b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb39b('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb39b('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb39b('0x6')](0x5)[_0xb39b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index c928074..f217099 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 _0xd4dc=['get','IvrCampaigns','end','error','stack','name','send','index','Campaign','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','updatedAt','omit','createdAt','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','push','sequelize','all','removeLists','destroy','getBlackLists','CmList','YYYY-MM-DD\x20HH:mm:ss','addBlackLists','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then'];(function(_0x21e574,_0x4730c3){var _0x676b77=function(_0x2c4c46){while(--_0x2c4c46){_0x21e574['push'](_0x21e574['shift']());}};_0x676b77(++_0x4730c3);}(_0xd4dc,0xff));var _0xcd4d=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xd4dc[_0x4dc7b9];return _0x3ab114;};'use strict';var emlformat=require(_0xcd4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd4d('0x1'));var jsonpatch=require(_0xcd4d('0x2'));var rp=require(_0xcd4d('0x3'));var moment=require(_0xcd4d('0x4'));var BPromise=require(_0xcd4d('0x5'));var Mustache=require(_0xcd4d('0x6'));var util=require(_0xcd4d('0x7'));var path=require('path');var sox=require(_0xcd4d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd4d('0x9'));var _=require('lodash');var squel=require(_0xcd4d('0xa'));var crypto=require(_0xcd4d('0xb'));var jsforce=require(_0xcd4d('0xc'));var deskjs=require(_0xcd4d('0xd'));var toCsv=require(_0xcd4d('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcd4d('0xf'));var authService=require(_0xcd4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcd4d('0x11'));var hardwareService=require(_0xcd4d('0x12'));var logger=require(_0xcd4d('0x13'))('api');var utils=require(_0xcd4d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd4d('0x15'));var db=require(_0xcd4d('0x16'))['db'];function respondWithStatusCode(_0x3d3019,_0x1604e3){_0x1604e3=_0x1604e3||0xcc;return function(_0x10fb9e){if(_0x10fb9e){return _0x3d3019['sendStatus'](_0x1604e3);}return _0x3d3019['status'](_0x1604e3)['end']();};}function respondWithResult(_0x316215,_0x44d095){_0x44d095=_0x44d095||0xc8;return function(_0x36afd0){if(_0x36afd0){return _0x316215[_0xcd4d('0x17')](_0x44d095)[_0xcd4d('0x18')](_0x36afd0);}};}function respondWithFilteredResult(_0x464e7,_0xc4cf9b){return function(_0x3cf713){if(_0x3cf713){var _0x27bf0c=typeof _0xc4cf9b[_0xcd4d('0x19')]==='undefined'&&typeof _0xc4cf9b[_0xcd4d('0x1a')]===_0xcd4d('0x1b');var _0x1e7b6c=_0x3cf713[_0xcd4d('0x1c')];var _0x470e42=_0x27bf0c?0x0:_0xc4cf9b[_0xcd4d('0x19')];var _0x32ac99=_0x27bf0c?_0x3cf713[_0xcd4d('0x1c')]:_0xc4cf9b[_0xcd4d('0x19')]+_0xc4cf9b[_0xcd4d('0x1a')];var _0x263172;if(_0x32ac99>=_0x1e7b6c){_0x32ac99=_0x1e7b6c;_0x263172=0xc8;}else{_0x263172=0xce;}_0x464e7[_0xcd4d('0x17')](_0x263172);return _0x464e7[_0xcd4d('0x1d')]('Content-Range',_0x470e42+'-'+_0x32ac99+'/'+_0x1e7b6c)[_0xcd4d('0x18')](_0x3cf713);}return null;};}function patchUpdates(_0x1d7cdf){return function(_0x15935b){try{jsonpatch[_0xcd4d('0x1e')](_0x15935b,_0x1d7cdf,!![]);}catch(_0x2a4ee3){return BPromise[_0xcd4d('0x1f')](_0x2a4ee3);}return _0x15935b[_0xcd4d('0x20')]();};}function saveUpdates(_0x108919,_0x42f0f9){return function(_0x1f3e88){if(_0x1f3e88){return _0x1f3e88[_0xcd4d('0x21')](_0x108919)['then'](function(_0x22b562){return _0x22b562;});}return null;};}function removeEntity(_0x4fa4ad,_0x1f7026){return function(_0x770ec6){if(_0x770ec6){return _0x770ec6['destroy']()[_0xcd4d('0x22')](function(){var _0x5e911a=_0x770ec6[_0xcd4d('0x23')]({'plain':!![]});var _0xdc7660=_0xcd4d('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0xdc7660,'resourceId':_0x5e911a['id']}})['then'](function(){return _0x770ec6;});})[_0xcd4d('0x22')](function(){_0x4fa4ad[_0xcd4d('0x17')](0xcc)[_0xcd4d('0x25')]();});}};}function handleEntityNotFound(_0xf9e37e,_0x35d7e5){return function(_0x4d5c84){if(!_0x4d5c84){_0xf9e37e['sendStatus'](0x194);}return _0x4d5c84;};}function handleError(_0x28da5c,_0x6a999c){_0x6a999c=_0x6a999c||0x1f4;return function(_0x4adcb5){logger[_0xcd4d('0x26')](_0x4adcb5[_0xcd4d('0x27')]);if(_0x4adcb5[_0xcd4d('0x28')]){delete _0x4adcb5[_0xcd4d('0x28')];}_0x28da5c[_0xcd4d('0x17')](_0x6a999c)[_0xcd4d('0x29')](_0x4adcb5);};}exports[_0xcd4d('0x2a')]=function(_0x529d48,_0x319689){var _0x10bdfa={},_0x4a2cf4={},_0xe150ec={'count':0x0,'rows':[]};var _0x490012=_['map'](db[_0xcd4d('0x2b')]['rawAttributes'],function(_0x2f1f64){return{'name':_0x2f1f64[_0xcd4d('0x2c')],'type':_0x2f1f64[_0xcd4d('0x2d')][_0xcd4d('0x2e')]};});_0x4a2cf4[_0xcd4d('0x2f')]=_[_0xcd4d('0x30')](_0x490012,_0xcd4d('0x28'));_0x4a2cf4[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x529d48[_0xcd4d('0x31')]);_0x4a2cf4[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],_0x4a2cf4[_0xcd4d('0x31')]);_0x10bdfa[_0xcd4d('0x35')]=_[_0xcd4d('0x34')](_0x4a2cf4[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x529d48['query'][_0xcd4d('0x36')]));_0x10bdfa['attributes']=_0x10bdfa[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x10bdfa[_0xcd4d('0x35')]:_0x4a2cf4['model'];if(!_0x529d48['query'][_0xcd4d('0x38')]('nolimit')){_0x10bdfa[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x10bdfa[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x529d48['query'][_0xcd4d('0x19')]);}_0x10bdfa[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x529d48['query'][_0xcd4d('0x3a')]);_0x10bdfa[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x529d48['query'],_0x4a2cf4[_0xcd4d('0x33')]),_0x490012);if(_0x529d48[_0xcd4d('0x31')]['filter']){_0x10bdfa[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x10bdfa['where'],{'$or':_['map'](_0x490012,function(_0x4353dd){if(_0x4353dd[_0xcd4d('0x2d')]!==_0xcd4d('0x3e')){var _0x3349d6={};_0x3349d6[_0x4353dd[_0xcd4d('0x28')]]={'$like':'%'+_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x3349d6;}})});}_0x10bdfa=_[_0xcd4d('0x3d')]({},_0x10bdfa,_0x529d48['options']);var _0x4cf9d2={'where':_0x10bdfa[_0xcd4d('0x3b')]};return db['Campaign'][_0xcd4d('0x1c')](_0x4cf9d2)[_0xcd4d('0x22')](function(_0x234a59){_0xe150ec[_0xcd4d('0x1c')]=_0x234a59;if(_0x529d48[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x10bdfa['include']=[{'all':!![]}];}return db[_0xcd4d('0x2b')][_0xcd4d('0x41')](_0x10bdfa);})[_0xcd4d('0x22')](function(_0x43faea){_0xe150ec[_0xcd4d('0x42')]=_0x43faea;return _0xe150ec;})[_0xcd4d('0x22')](respondWithFilteredResult(_0x319689,_0x10bdfa))[_0xcd4d('0x43')](handleError(_0x319689,null));};exports[_0xcd4d('0x44')]=function(_0x568bf3,_0x51cf1d){var _0x2e1f9a={'raw':![],'where':{'id':_0x568bf3['params']['id']}},_0x25ee24={};_0x25ee24[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x25ee24['query']=_[_0xcd4d('0x32')](_0x568bf3[_0xcd4d('0x31')]);_0x25ee24[_0xcd4d('0x33')]=_['intersection'](_0x25ee24[_0xcd4d('0x2f')],_0x25ee24['query']);_0x2e1f9a['attributes']=_[_0xcd4d('0x34')](_0x25ee24[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x568bf3[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x2e1f9a['attributes']=_0x2e1f9a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x2e1f9a[_0xcd4d('0x35')]:_0x25ee24['model'];if(_0x568bf3['query']['includeAll']){_0x2e1f9a['include']=[{'all':!![]}];}_0x2e1f9a=_[_0xcd4d('0x3d')]({},_0x2e1f9a,_0x568bf3[_0xcd4d('0x46')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x2e1f9a)[_0xcd4d('0x22')](handleEntityNotFound(_0x51cf1d,null))[_0xcd4d('0x22')](respondWithResult(_0x51cf1d,null))[_0xcd4d('0x43')](handleError(_0x51cf1d,null));};exports[_0xcd4d('0x48')]=function(_0x4a2575,_0x54f14f){return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_0x4a2575[_0xcd4d('0x49')],{})[_0xcd4d('0x22')](function(_0x2fcf40){var _0x51c6d4=_0x4a2575[_0xcd4d('0x4a')][_0xcd4d('0x23')]({'plain':!![]});if(!_0x51c6d4)throw new Error(_0xcd4d('0x4b'));if(_0x51c6d4['role']===_0xcd4d('0x4a')){var _0x2bcaef=_0x2fcf40[_0xcd4d('0x23')]({'plain':!![]});var _0x10c9a4=_0xcd4d('0x24');return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x10c9a4,'userProfileId':_0x51c6d4[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x1844cb){if(_0x1844cb&&_0x1844cb[_0xcd4d('0x4e')]===0x0){return db[_0xcd4d('0x4f')][_0xcd4d('0x48')]({'name':_0x2bcaef['name'],'resourceId':_0x2bcaef['id'],'type':_0x1844cb[_0xcd4d('0x28')],'sectionId':_0x1844cb['id']},{})['then'](function(){return _0x2fcf40;});}else{return _0x2fcf40;}})['catch'](function(_0x43a24f){logger[_0xcd4d('0x26')](_0xcd4d('0x50'),_0x43a24f);throw _0x43a24f;});}return _0x2fcf40;})[_0xcd4d('0x22')](respondWithResult(_0x54f14f,0xc9))[_0xcd4d('0x43')](handleError(_0x54f14f,null));};exports[_0xcd4d('0x51')]=function(_0x50bcfe,_0x333e8c){var _0x48a17a={'where':{'id':_0x50bcfe[_0xcd4d('0x52')]['id']}},_0x1546e0={};_0x1546e0[_0xcd4d('0x2f')]=_['keys'](db[_0xcd4d('0x2b')][_0xcd4d('0x45')]);_0x48a17a[_0xcd4d('0x35')]=_['intersection'](_0x1546e0['model'],qs[_0xcd4d('0x36')](_0x50bcfe[_0xcd4d('0x31')]['fields']));_0x48a17a[_0xcd4d('0x35')]=_0x48a17a[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x48a17a[_0xcd4d('0x35')]:_0x1546e0[_0xcd4d('0x2f')];if(_0x50bcfe[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x48a17a[_0xcd4d('0x53')]=[{'all':!![]}];}_0x48a17a=_[_0xcd4d('0x3d')]({},_0x48a17a,_0x50bcfe['options']);return db[_0xcd4d('0x2b')][_0xcd4d('0x47')](_0x48a17a)[_0xcd4d('0x22')](handleEntityNotFound(_0x333e8c,null))[_0xcd4d('0x22')](function(_0x1857f2){if(_0x1857f2){var _0x425d66=_0x1857f2['get']({'plain':!![]});_0x425d66=qs['omit'](_0x425d66,['id','createdAt',_0xcd4d('0x54')]);_0x50bcfe[_0xcd4d('0x49')]=_[_0xcd4d('0x55')](_0x50bcfe[_0xcd4d('0x49')],['id',_0xcd4d('0x56'),_0xcd4d('0x54')]);return db[_0xcd4d('0x2b')][_0xcd4d('0x48')](_[_0xcd4d('0x3d')](_0x425d66,_0x50bcfe[_0xcd4d('0x49')]),{'include':_0x50bcfe['query'][_0xcd4d('0x40')]?[{'all':!![]}]:undefined})[_0xcd4d('0x22')](function(_0x145af1){var _0x8b8ab8=_0x50bcfe['user']['get']({'plain':!![]});if(!_0x8b8ab8)throw new Error(_0xcd4d('0x4b'));if(_0x8b8ab8['role']==='user'){var _0x14ccb7=_0x145af1[_0xcd4d('0x23')]({'plain':!![]});var _0x3074d7='IvrCampaigns';return db[_0xcd4d('0x4c')][_0xcd4d('0x47')]({'where':{'name':_0x3074d7,'userProfileId':_0x8b8ab8[_0xcd4d('0x4d')]},'raw':!![]})[_0xcd4d('0x22')](function(_0x3ae722){if(_0x3ae722&&_0x3ae722['autoAssociation']===0x0){return db['UserProfileResource'][_0xcd4d('0x48')]({'name':_0x14ccb7[_0xcd4d('0x28')],'resourceId':_0x14ccb7['id'],'type':_0x3ae722['name'],'sectionId':_0x3ae722['id']},{})[_0xcd4d('0x22')](function(){return _0x145af1;});}else{return _0x145af1;}})['catch'](function(_0x1c4e46){logger['error'](_0xcd4d('0x50'),_0x1c4e46);throw _0x1c4e46;});}return _0x145af1;});}})[_0xcd4d('0x22')](respondWithResult(_0x333e8c,0xc9))[_0xcd4d('0x43')](handleError(_0x333e8c,null));};exports['update']=function(_0xfff2fb,_0x2adf9c){if(_0xfff2fb['body']['id']){delete _0xfff2fb[_0xcd4d('0x49')]['id'];}return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0xfff2fb['params']['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x2adf9c,null))[_0xcd4d('0x22')](saveUpdates(_0xfff2fb[_0xcd4d('0x49')],null))[_0xcd4d('0x22')](respondWithResult(_0x2adf9c,null))['catch'](handleError(_0x2adf9c,null));};exports['destroy']=function(_0x452e82,_0x289838){return db['Campaign']['find']({'where':{'id':_0x452e82[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x289838,null))[_0xcd4d('0x22')](removeEntity(_0x289838,null))[_0xcd4d('0x43')](handleError(_0x289838,null));};exports['getHoppers']=function(_0x409a3a,_0x1cb0a9,_0x56a0f1){var _0x25cd0c={'raw':!![],'where':{}};var _0x1a2169={};var _0x4aab35={'count':0x0,'rows':[]};return db['Campaign'][_0xcd4d('0x57')]({'where':{'id':_0x409a3a[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cb0a9,null))['then'](function(_0x502783){if(_0x502783){_0x1a2169['model']=_['keys'](db['CmHopper']['rawAttributes']);_0x1a2169[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x409a3a['query']);_0x1a2169['filters']=_[_0xcd4d('0x34')](_0x1a2169[_0xcd4d('0x2f')],_0x1a2169[_0xcd4d('0x31')]);_0x25cd0c['attributes']=_[_0xcd4d('0x34')](_0x1a2169['model'],qs[_0xcd4d('0x36')](_0x409a3a['query'][_0xcd4d('0x36')]));_0x25cd0c[_0xcd4d('0x35')]=_0x25cd0c[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x25cd0c[_0xcd4d('0x35')]:_0x1a2169[_0xcd4d('0x2f')];if(!_0x409a3a[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x25cd0c[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x409a3a['query'][_0xcd4d('0x1a')]);_0x25cd0c[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x409a3a[_0xcd4d('0x31')]['offset']);}_0x25cd0c[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x409a3a[_0xcd4d('0x31')]['sort']);_0x25cd0c[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x409a3a['query'],_0x1a2169[_0xcd4d('0x33')]));_0x25cd0c['where'][_0xcd4d('0x59')]=_0x502783['id'];if(_0x409a3a[_0xcd4d('0x31')]['filter']){_0x25cd0c[_0xcd4d('0x3b')]=_['merge'](_0x25cd0c[_0xcd4d('0x3b')],{'$or':_['map'](_0x25cd0c[_0xcd4d('0x35')],function(_0x2ae842){var _0x13e81e={};_0x13e81e[_0x2ae842]={'$like':'%'+_0x409a3a[_0xcd4d('0x31')]['filter']+'%'};return _0x13e81e;})});}_0x25cd0c=_[_0xcd4d('0x3d')]({},_0x25cd0c,_0x409a3a[_0xcd4d('0x46')]);return db[_0xcd4d('0x5a')][_0xcd4d('0x1c')]({'where':_0x25cd0c[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x10e73a){_0x4aab35[_0xcd4d('0x1c')]=_0x10e73a;if(_0x409a3a[_0xcd4d('0x31')]['includeAll']){_0x25cd0c[_0xcd4d('0x53')]=[{'all':!![]}];}return db[_0xcd4d('0x5a')][_0xcd4d('0x41')](_0x25cd0c);})[_0xcd4d('0x22')](function(_0x1d9e82){_0x4aab35[_0xcd4d('0x42')]=_0x1d9e82;return _0x4aab35;});}})['then'](respondWithFilteredResult(_0x1cb0a9,_0x25cd0c))[_0xcd4d('0x43')](handleError(_0x1cb0a9,null));};exports[_0xcd4d('0x5b')]=function(_0x4574b5,_0x5b18a2,_0x106eb5){var _0x57f68f={'raw':!![],'where':{}};var _0x4005a9={};var _0x4df240={'count':0x0,'rows':[]};return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x4574b5[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x5b18a2,null))[_0xcd4d('0x22')](function(_0x1d43dd){if(_0x1d43dd){_0x4005a9[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x5c')][_0xcd4d('0x45')]);_0x4005a9[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x4574b5[_0xcd4d('0x31')]);_0x4005a9[_0xcd4d('0x33')]=_[_0xcd4d('0x34')](_0x4005a9[_0xcd4d('0x2f')],_0x4005a9[_0xcd4d('0x31')]);_0x57f68f[_0xcd4d('0x35')]=_['intersection'](_0x4005a9[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x57f68f[_0xcd4d('0x35')]=_0x57f68f[_0xcd4d('0x35')]['length']?_0x57f68f[_0xcd4d('0x35')]:_0x4005a9[_0xcd4d('0x2f')];if(!_0x4574b5[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x57f68f[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x4574b5['query'][_0xcd4d('0x1a')]);_0x57f68f[_0xcd4d('0x19')]=qs[_0xcd4d('0x19')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x57f68f[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x57f68f[_0xcd4d('0x3b')]=qs['filters'](_[_0xcd4d('0x3c')](_0x4574b5[_0xcd4d('0x31')],_0x4005a9['filters']));_0x57f68f[_0xcd4d('0x3b')][_0xcd4d('0x59')]=_0x1d43dd['id'];if(_0x4574b5['query'][_0xcd4d('0x3f')]){_0x57f68f['where']=_['merge'](_0x57f68f['where'],{'$or':_['map'](_0x57f68f[_0xcd4d('0x35')],function(_0x422f89){var _0x27ee54={};_0x27ee54[_0x422f89]={'$like':'%'+_0x4574b5[_0xcd4d('0x31')][_0xcd4d('0x3f')]+'%'};return _0x27ee54;})});}_0x57f68f=_['merge']({},_0x57f68f,_0x4574b5[_0xcd4d('0x46')]);return db['CmHopperHistory'][_0xcd4d('0x1c')]({'where':_0x57f68f[_0xcd4d('0x3b')]})['then'](function(_0x2bc608){_0x4df240[_0xcd4d('0x1c')]=_0x2bc608;if(_0x4574b5['query']['includeAll']){_0x57f68f['include']=[{'all':!![]}];}return db[_0xcd4d('0x5c')][_0xcd4d('0x41')](_0x57f68f);})['then'](function(_0x37fc26){_0x4df240[_0xcd4d('0x42')]=_0x37fc26;return _0x4df240;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x5b18a2,_0x57f68f))[_0xcd4d('0x43')](handleError(_0x5b18a2,null));};exports['getHopperFinals']=function(_0x425d9a,_0x2fbb3a,_0x3e3f16){var _0x2206ad={'raw':!![],'where':{}};var _0x239d27={};var _0x250de2={'count':0x0,'rows':[]};return db['Campaign'][_0xcd4d('0x57')]({'where':{'id':_0x425d9a[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x2fbb3a,null))[_0xcd4d('0x22')](function(_0x41356a){if(_0x41356a){_0x239d27[_0xcd4d('0x2f')]=_['keys'](db[_0xcd4d('0x5d')]['rawAttributes']);_0x239d27[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x425d9a[_0xcd4d('0x31')]);_0x239d27[_0xcd4d('0x33')]=_['intersection'](_0x239d27[_0xcd4d('0x2f')],_0x239d27[_0xcd4d('0x31')]);_0x2206ad[_0xcd4d('0x35')]=_['intersection'](_0x239d27[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x2206ad[_0xcd4d('0x35')]=_0x2206ad[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x2206ad['attributes']:_0x239d27[_0xcd4d('0x2f')];if(!_0x425d9a[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x2206ad[_0xcd4d('0x1a')]=qs['limit'](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x2206ad['offset']=qs[_0xcd4d('0x19')](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x2206ad['order']=qs[_0xcd4d('0x3a')](_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x2206ad[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_['pick'](_0x425d9a[_0xcd4d('0x31')],_0x239d27['filters']));_0x2206ad[_0xcd4d('0x3b')][_0xcd4d('0x59')]=_0x41356a['id'];if(_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x3f')]){_0x2206ad[_0xcd4d('0x3b')]=_['merge'](_0x2206ad['where'],{'$or':_['map'](_0x2206ad[_0xcd4d('0x35')],function(_0x5d9298){var _0x5d00ef={};_0x5d00ef[_0x5d9298]={'$like':'%'+_0x425d9a[_0xcd4d('0x31')]['filter']+'%'};return _0x5d00ef;})});}_0x2206ad=_[_0xcd4d('0x3d')]({},_0x2206ad,_0x425d9a[_0xcd4d('0x46')]);return db[_0xcd4d('0x5d')][_0xcd4d('0x1c')]({'where':_0x2206ad[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x181940){_0x250de2[_0xcd4d('0x1c')]=_0x181940;if(_0x425d9a[_0xcd4d('0x31')][_0xcd4d('0x40')]){_0x2206ad[_0xcd4d('0x53')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xcd4d('0x41')](_0x2206ad);})['then'](function(_0x276fd8){_0x250de2[_0xcd4d('0x42')]=_0x276fd8;return _0x250de2;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x2fbb3a,_0x2206ad))[_0xcd4d('0x43')](handleError(_0x2fbb3a,null));};exports[_0xcd4d('0x5e')]=function(_0x49ca0b,_0x2e2818,_0x56fbc7){var _0x36e9a9={'raw':!![],'where':{}};var _0x1c41f6={};var _0x4f1a33={'count':0x0,'rows':[]};return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x49ca0b[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x2e2818,null))[_0xcd4d('0x22')](function(_0x11591b){if(_0x11591b){_0x1c41f6[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db[_0xcd4d('0x5f')][_0xcd4d('0x45')]);_0x1c41f6[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x49ca0b[_0xcd4d('0x31')]);_0x1c41f6['filters']=_[_0xcd4d('0x34')](_0x1c41f6[_0xcd4d('0x2f')],_0x1c41f6[_0xcd4d('0x31')]);_0x36e9a9['attributes']=_[_0xcd4d('0x34')](_0x1c41f6[_0xcd4d('0x2f')],qs['fields'](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x36e9a9[_0xcd4d('0x35')]=_0x36e9a9[_0xcd4d('0x35')]['length']?_0x36e9a9[_0xcd4d('0x35')]:_0x1c41f6[_0xcd4d('0x2f')];if(!_0x49ca0b['query'][_0xcd4d('0x38')](_0xcd4d('0x58'))){_0x36e9a9[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x36e9a9['offset']=qs[_0xcd4d('0x19')](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x19')]);}_0x36e9a9[_0xcd4d('0x39')]=qs['sort'](_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x36e9a9[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x49ca0b[_0xcd4d('0x31')],_0x1c41f6[_0xcd4d('0x33')]));_0x36e9a9['where'][_0xcd4d('0x59')]=_0x11591b['id'];if(_0x49ca0b[_0xcd4d('0x31')][_0xcd4d('0x3f')]){_0x36e9a9[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x36e9a9[_0xcd4d('0x3b')],{'$or':_['map'](_0x36e9a9[_0xcd4d('0x35')],function(_0x5b4d69){var _0x123d6f={};_0x123d6f[_0x5b4d69]={'$like':'%'+_0x49ca0b['query']['filter']+'%'};return _0x123d6f;})});}_0x36e9a9=_[_0xcd4d('0x3d')]({},_0x36e9a9,_0x49ca0b[_0xcd4d('0x46')]);return db[_0xcd4d('0x5f')]['count']({'where':_0x36e9a9[_0xcd4d('0x3b')]})[_0xcd4d('0x22')](function(_0x355e7f){_0x4f1a33['count']=_0x355e7f;if(_0x49ca0b['query']['includeAll']){_0x36e9a9['include']=[{'all':!![]}];}return db[_0xcd4d('0x5f')][_0xcd4d('0x41')](_0x36e9a9);})[_0xcd4d('0x22')](function(_0x1017b3){_0x4f1a33[_0xcd4d('0x42')]=_0x1017b3;return _0x4f1a33;});}})[_0xcd4d('0x22')](respondWithFilteredResult(_0x2e2818,_0x36e9a9))[_0xcd4d('0x43')](handleError(_0x2e2818,null));};exports[_0xcd4d('0x60')]=function(_0x5144c3,_0x40ea5b,_0x1a10ee){var _0x1a4b89={};var _0x99db39={};var _0x37d13f;var _0x540fbe;return db[_0xcd4d('0x2b')][_0xcd4d('0x57')]({'where':{'id':_0x5144c3[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x40ea5b,null))['then'](function(_0x1d76f7){if(_0x1d76f7){_0x37d13f=_0x1d76f7;_0x99db39[_0xcd4d('0x2f')]=_[_0xcd4d('0x32')](db['CmList'][_0xcd4d('0x45')]);_0x99db39[_0xcd4d('0x31')]=_[_0xcd4d('0x32')](_0x5144c3[_0xcd4d('0x31')]);_0x99db39['filters']=_[_0xcd4d('0x34')](_0x99db39['model'],_0x99db39['query']);_0x1a4b89[_0xcd4d('0x35')]=_[_0xcd4d('0x34')](_0x99db39[_0xcd4d('0x2f')],qs[_0xcd4d('0x36')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x36')]));_0x1a4b89[_0xcd4d('0x35')]=_0x1a4b89['attributes'][_0xcd4d('0x37')]?_0x1a4b89[_0xcd4d('0x35')]:_0x99db39['model'];_0x1a4b89[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x1a4b89[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x5144c3[_0xcd4d('0x31')],_0x99db39[_0xcd4d('0x33')]));if(_0x5144c3[_0xcd4d('0x31')]['filter']){_0x1a4b89[_0xcd4d('0x3b')]=_[_0xcd4d('0x3d')](_0x1a4b89[_0xcd4d('0x3b')],{'$or':_[_0xcd4d('0x30')](_0x1a4b89['attributes'],function(_0xcbb8fd){var _0xfa75b9={};_0xfa75b9[_0xcbb8fd]={'$like':'%'+_0x5144c3['query'][_0xcd4d('0x3f')]+'%'};return _0xfa75b9;})});}_0x1a4b89=_[_0xcd4d('0x3d')]({},_0x1a4b89,_0x5144c3[_0xcd4d('0x46')]);return _0x37d13f[_0xcd4d('0x60')](_0x1a4b89);}})[_0xcd4d('0x22')](function(_0x26f90c){if(_0x26f90c){_0x540fbe=_0x26f90c[_0xcd4d('0x37')];if(!_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x38')](_0xcd4d('0x58'))){_0x1a4b89[_0xcd4d('0x1a')]=qs[_0xcd4d('0x1a')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x1a')]);_0x1a4b89['offset']=qs[_0xcd4d('0x19')](_0x5144c3[_0xcd4d('0x31')][_0xcd4d('0x19')]);}return _0x37d13f['getLists'](_0x1a4b89);}})[_0xcd4d('0x22')](function(_0x3e956f){if(_0x3e956f){return _0x3e956f?{'count':_0x540fbe,'rows':_0x3e956f}:null;}})['then'](respondWithResult(_0x40ea5b,null))[_0xcd4d('0x43')](handleError(_0x40ea5b,null));};exports[_0xcd4d('0x61')]=function(_0x516ea3,_0x4a61ef,_0x43fa37){var _0x2a30a4,_0x5d1c7d;var _0x54c8f5=[];var _0x1b0f97=moment()[_0xcd4d('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0x516ea3[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x4a61ef,null))[_0xcd4d('0x22')](function(_0x15d3bb){if(_0x15d3bb){_0x5d1c7d=_0x15d3bb;return _0x15d3bb[_0xcd4d('0x61')](_0x516ea3[_0xcd4d('0x49')][_0xcd4d('0x63')],_['omit'](_0x516ea3[_0xcd4d('0x49')],['ids','id'])||{});}return null;})[_0xcd4d('0x64')](function(_0xc017a0){var _0x43a546;var _0x271f93;_0x2a30a4=_0xc017a0||[];var _0x5c304b=[];if(_0xc017a0){for(var _0x343a13=0x0;_0x343a13<_0xc017a0[_0xcd4d('0x37')];_0x343a13+=0x1){var _0x2efca6=_0xc017a0[_0x343a13]['get']({'plain':!![]});_0x5d1c7d[_0xcd4d('0x65')]=_0x516ea3[_0xcd4d('0x49')][_0xcd4d('0x65')]?_0x516ea3['body'][_0xcd4d('0x65')]:_0x5d1c7d['dialCheckDuplicateType'];switch(_0x5d1c7d['dialCheckDuplicateType']){case _0xcd4d('0x66'):_0x43a546=squel[_0xcd4d('0x67')]()['into'](_0xcd4d('0x68'))[_0xcd4d('0x69')]([_0xcd4d('0x6a'),_0xcd4d('0x6b'),_0xcd4d('0x6c'),_0xcd4d('0x6d'),_0xcd4d('0x59'),'createdAt',_0xcd4d('0x54')],squel['select']()[_0xcd4d('0x6e')](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x6b'))[_0xcd4d('0x6e')]('id',_0xcd4d('0x6c'))[_0xcd4d('0x6e')](_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')](),_0xcd4d('0x6d'))[_0xcd4d('0x6e')](_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),_0xcd4d('0x59'))['field']('\x27'+_0x1b0f97+'\x27','createdAt')[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x73'))[_0xcd4d('0x3b')](_0xcd4d('0x74'))[_0xcd4d('0x3b')](_0xcd4d('0x75'),_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')]())[_0xcd4d('0x3b')](_0xcd4d('0x76'))[_0xcd4d('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x78'))[_0xcd4d('0x72')](_0xcd4d('0x79'))[_0xcd4d('0x3b')](_0xcd4d('0x7a'),_0x516ea3['params']['id'][_0xcd4d('0x71')]()))[_0xcd4d('0x3b')](_0xcd4d('0x7b'),squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')]('COALESCE(phone,\x27\x27)')[_0xcd4d('0x72')](_0xcd4d('0x68'))[_0xcd4d('0x3b')](_0xcd4d('0x7a'),_0x516ea3[_0xcd4d('0x52')]['id']['toString']())))[_0xcd4d('0x71')]();break;case _0xcd4d('0x7c'):_0x43a546=squel[_0xcd4d('0x67')]()[_0xcd4d('0x7d')](_0xcd4d('0x68'))['fromQuery']([_0xcd4d('0x6a'),_0xcd4d('0x6b'),_0xcd4d('0x6c'),'ListId','CampaignId','createdAt','updatedAt'],squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),'scheduledAt')[_0xcd4d('0x6e')]('id',_0xcd4d('0x6c'))[_0xcd4d('0x6e')](_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')](),_0xcd4d('0x6d'))[_0xcd4d('0x6e')](_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),'CampaignId')[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27','createdAt')[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x73'))[_0xcd4d('0x3b')](_0xcd4d('0x74'))[_0xcd4d('0x3b')](_0xcd4d('0x75'),_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')]())[_0xcd4d('0x3b')](_0xcd4d('0x76'))[_0xcd4d('0x3b')](_0xcd4d('0x7b'),squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x7e'))[_0xcd4d('0x72')](_0xcd4d('0x68'))[_0xcd4d('0x3b')]('CampaignId\x20=\x20?',_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')]())))[_0xcd4d('0x71')]();break;default:_0x43a546=squel[_0xcd4d('0x67')]()[_0xcd4d('0x7d')](_0xcd4d('0x68'))[_0xcd4d('0x69')]([_0xcd4d('0x6a'),_0xcd4d('0x6b'),_0xcd4d('0x6c'),_0xcd4d('0x6d'),_0xcd4d('0x59'),'createdAt',_0xcd4d('0x54')],squel[_0xcd4d('0x77')]()['field'](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x6b'))['field']('id',_0xcd4d('0x6c'))[_0xcd4d('0x6e')](_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')](),_0xcd4d('0x6d'))[_0xcd4d('0x6e')](_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),_0xcd4d('0x59'))[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x56'))[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27','updatedAt')['from'](_0xcd4d('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0xcd4d('0x3b')](_0xcd4d('0x75'),_0x2efca6[_0xcd4d('0x70')][_0xcd4d('0x71')]())[_0xcd4d('0x3b')](_0xcd4d('0x76')))[_0xcd4d('0x71')]();}_0x271f93=squel['insert']()[_0xcd4d('0x7d')](_0xcd4d('0x7f'))[_0xcd4d('0x69')]([_0xcd4d('0x80'),_0xcd4d('0x6b'),'phone','OrderBy',_0xcd4d('0x56'),_0xcd4d('0x54')],squel[_0xcd4d('0x77')]()[_0xcd4d('0x6e')](_0xcd4d('0x81'),'id')[_0xcd4d('0x6e')](_0xcd4d('0x6f'),'scheduledAt')[_0xcd4d('0x6e')](_0xcd4d('0x82'),_0xcd4d('0x6a'))['field'](_0xcd4d('0x83'),_0xcd4d('0x84'))['field']('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x56'))[_0xcd4d('0x6e')]('\x27'+_0x1b0f97+'\x27',_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x85'),'ci')['join'](_0xcd4d('0x68'),'h',_0xcd4d('0x86'))[_0xcd4d('0x3b')]('h.ListId\x20=\x20?',_0x2efca6['CmListId'][_0xcd4d('0x71')]())[_0xcd4d('0x3b')]('h.CampaignId=?',_0x516ea3[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')]())[_0xcd4d('0x3b')]('h.createdAt\x20=\x20?',_0x1b0f97))[_0xcd4d('0x71')]();_0x5c304b[_0xcd4d('0x87')](db['sequelize']['query'](_0x43a546));_0x54c8f5[_0xcd4d('0x87')](db[_0xcd4d('0x88')][_0xcd4d('0x31')](_0x271f93));}return BPromise[_0xcd4d('0x89')](_0x5c304b);}})[_0xcd4d('0x22')](function(){return BPromise['all'](_0x54c8f5);})[_0xcd4d('0x22')](function(){return _0x2a30a4;})['then'](respondWithResult(_0x4a61ef,null))[_0xcd4d('0x43')](handleError(_0x4a61ef,null));};exports[_0xcd4d('0x8a')]=function(_0xf49bba,_0x5834e7,_0x5c2fff){return db[_0xcd4d('0x2b')][_0xcd4d('0x47')]({'where':{'id':_0xf49bba[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x5834e7,null))['then'](function(_0x1a3b72){if(_0x1a3b72){return _0x1a3b72[_0xcd4d('0x8a')](_0xf49bba['query']['ids']);}})[_0xcd4d('0x22')](function(_0x3b706b){if(_0x3b706b){return db['CmHopper'][_0xcd4d('0x8b')]({'where':{'ListId':_0xf49bba[_0xcd4d('0x31')]['ids'],'CampaignId':_0xf49bba[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](function(){return _0x3b706b;});}})['then'](respondWithStatusCode(_0x5834e7,null))[_0xcd4d('0x43')](handleError(_0x5834e7,null));};exports[_0xcd4d('0x8c')]=function(_0x11b223,_0x5ca9dc,_0x47f5b2){var _0x1a4233={};var _0x1b033a={};var _0x2aad65;var _0x3b1ae8;return db['Campaign'][_0xcd4d('0x57')]({'where':{'id':_0x11b223[_0xcd4d('0x52')]['id']}})['then'](handleEntityNotFound(_0x5ca9dc,null))['then'](function(_0x1fd4c2){if(_0x1fd4c2){_0x2aad65=_0x1fd4c2;_0x1b033a['model']=_[_0xcd4d('0x32')](db[_0xcd4d('0x8d')]['rawAttributes']);_0x1b033a[_0xcd4d('0x31')]=_['keys'](_0x11b223[_0xcd4d('0x31')]);_0x1b033a[_0xcd4d('0x33')]=_['intersection'](_0x1b033a[_0xcd4d('0x2f')],_0x1b033a[_0xcd4d('0x31')]);_0x1a4233['attributes']=_[_0xcd4d('0x34')](_0x1b033a['model'],qs['fields'](_0x11b223[_0xcd4d('0x31')]['fields']));_0x1a4233[_0xcd4d('0x35')]=_0x1a4233[_0xcd4d('0x35')][_0xcd4d('0x37')]?_0x1a4233[_0xcd4d('0x35')]:_0x1b033a[_0xcd4d('0x2f')];_0x1a4233[_0xcd4d('0x39')]=qs[_0xcd4d('0x3a')](_0x11b223[_0xcd4d('0x31')][_0xcd4d('0x3a')]);_0x1a4233[_0xcd4d('0x3b')]=qs[_0xcd4d('0x33')](_[_0xcd4d('0x3c')](_0x11b223['query'],_0x1b033a[_0xcd4d('0x33')]));if(_0x11b223[_0xcd4d('0x31')][_0xcd4d('0x3f')]){_0x1a4233[_0xcd4d('0x3b')]=_['merge'](_0x1a4233[_0xcd4d('0x3b')],{'$or':_[_0xcd4d('0x30')](_0x1a4233['attributes'],function(_0x22c687){var _0x7b5972={};_0x7b5972[_0x22c687]={'$like':'%'+_0x11b223[_0xcd4d('0x31')]['filter']+'%'};return _0x7b5972;})});}_0x1a4233=_[_0xcd4d('0x3d')]({},_0x1a4233,_0x11b223['options']);return _0x2aad65[_0xcd4d('0x8c')](_0x1a4233);}})[_0xcd4d('0x22')](function(_0x2789ff){if(_0x2789ff){_0x3b1ae8=_0x2789ff[_0xcd4d('0x37')];if(!_0x11b223[_0xcd4d('0x31')]['hasOwnProperty'](_0xcd4d('0x58'))){_0x1a4233['limit']=qs['limit'](_0x11b223['query']['limit']);_0x1a4233['offset']=qs[_0xcd4d('0x19')](_0x11b223[_0xcd4d('0x31')][_0xcd4d('0x19')]);}return _0x2aad65[_0xcd4d('0x8c')](_0x1a4233);}})[_0xcd4d('0x22')](function(_0x2b5e3a){if(_0x2b5e3a){return _0x2b5e3a?{'count':_0x3b1ae8,'rows':_0x2b5e3a}:null;}})[_0xcd4d('0x22')](respondWithResult(_0x5ca9dc,null))[_0xcd4d('0x43')](handleError(_0x5ca9dc,null));};exports['addBlackLists']=function(_0x285e92,_0x280154,_0x1a025b){var _0x47903f,_0x242c7f;var _0x437b16=[];var _0x4181ff=moment()[_0xcd4d('0x62')](_0xcd4d('0x8e'));return db['Campaign'][_0xcd4d('0x47')]({'where':{'id':_0x285e92[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x280154,null))[_0xcd4d('0x22')](function(_0x5e2166){if(_0x5e2166){_0x242c7f=_0x5e2166;return _0x5e2166[_0xcd4d('0x8f')](_0x285e92[_0xcd4d('0x49')]['ids'],_[_0xcd4d('0x55')](_0x285e92['body'],[_0xcd4d('0x63'),'id'])||{});}return null;})[_0xcd4d('0x64')](function(_0x176ae6){var _0x5e3714;var _0x125daa;_0x47903f=_0x176ae6||[];var _0xdadc4c=[];if(_0x176ae6){for(var _0x384d6e=0x0;_0x384d6e<_0x176ae6[_0xcd4d('0x37')];_0x384d6e+=0x1){var _0xb33b86=_0x176ae6[_0x384d6e][_0xcd4d('0x23')]({'plain':!![]});_0x5e3714=squel['insert']()[_0xcd4d('0x7d')]('cm_hopper_black')[_0xcd4d('0x69')]([_0xcd4d('0x6a'),_0xcd4d('0x6c'),_0xcd4d('0x6d'),_0xcd4d('0x59'),'createdAt',_0xcd4d('0x54')],squel[_0xcd4d('0x77')]()['field'](_0xcd4d('0x6a'),_0xcd4d('0x6a'))[_0xcd4d('0x6e')]('id',_0xcd4d('0x6c'))['field'](_0xb33b86[_0xcd4d('0x70')][_0xcd4d('0x71')](),'ListId')['field'](_0x285e92[_0xcd4d('0x52')]['id'][_0xcd4d('0x71')](),_0xcd4d('0x59'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x56'))[_0xcd4d('0x6e')](_0xcd4d('0x6f'),_0xcd4d('0x54'))[_0xcd4d('0x72')](_0xcd4d('0x73'))['where'](_0xcd4d('0x74'))[_0xcd4d('0x3b')]('ListId\x20=\x20?',_0xb33b86[_0xcd4d('0x70')]['toString']())[_0xcd4d('0x3b')](_0xcd4d('0x76')))[_0xcd4d('0x71')]();_0xdadc4c[_0xcd4d('0x87')](db['sequelize'][_0xcd4d('0x31')](_0x5e3714));}return BPromise['all'](_0xdadc4c);}})[_0xcd4d('0x22')](function(){return _0x47903f;})['then'](respondWithResult(_0x280154,null))['catch'](handleError(_0x280154,null));};exports[_0xcd4d('0x90')]=function(_0x57cc75,_0x4adf8a,_0x319795){return db[_0xcd4d('0x2b')]['find']({'where':{'id':_0x57cc75[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](handleEntityNotFound(_0x4adf8a,null))[_0xcd4d('0x22')](function(_0x3a6788){if(_0x3a6788){return _0x3a6788[_0xcd4d('0x90')](_0x57cc75['query'][_0xcd4d('0x63')]);}})[_0xcd4d('0x22')](function(_0x3bd65b){if(_0x3bd65b){return db[_0xcd4d('0x5f')]['destroy']({'where':{'ListId':_0x57cc75['query']['ids'],'CampaignId':_0x57cc75[_0xcd4d('0x52')]['id']}})[_0xcd4d('0x22')](function(){return _0x3bd65b;});}})[_0xcd4d('0x22')](respondWithStatusCode(_0x4adf8a,null))[_0xcd4d('0x43')](handleError(_0x4adf8a,null));}; \ No newline at end of file +var _0xe860=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','Campaign','includeAll','include','rows','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','error','getHoppers','findOne','pick','CmHopper','getHopperHistories','CampaignId','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x3306a2,_0x274117){var _0x54f452=function(_0x266cb5){while(--_0x266cb5){_0x3306a2['push'](_0x3306a2['shift']());}};_0x54f452(++_0x274117);}(_0xe860,0x188));var _0x0e86=function(_0x206510,_0x170973){_0x206510=_0x206510-0x0;var _0x87aba=_0xe860[_0x206510];return _0x87aba;};'use strict';var emlformat=require(_0x0e86('0x0'));var rimraf=require(_0x0e86('0x1'));var zipdir=require(_0x0e86('0x2'));var jsonpatch=require(_0x0e86('0x3'));var rp=require('request-promise');var moment=require(_0x0e86('0x4'));var BPromise=require(_0x0e86('0x5'));var Mustache=require('mustache');var util=require(_0x0e86('0x6'));var path=require(_0x0e86('0x7'));var sox=require(_0x0e86('0x8'));var csv=require(_0x0e86('0x9'));var ejs=require(_0x0e86('0xa'));var fs=require('fs');var fs_extra=require(_0x0e86('0xb'));var _=require(_0x0e86('0xc'));var squel=require(_0x0e86('0xd'));var crypto=require(_0x0e86('0xe'));var jsforce=require(_0x0e86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0e86('0x9'));var querystring=require('querystring');var Papa=require(_0x0e86('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e86('0x11'));var logger=require('../../config/logger')(_0x0e86('0x12'));var utils=require(_0x0e86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0e86('0x14'));var db=require(_0x0e86('0x15'))['db'];function respondWithStatusCode(_0x336308,_0x731e0b){_0x731e0b=_0x731e0b||0xcc;return function(_0x2ef563){if(_0x2ef563){return _0x336308[_0x0e86('0x16')](_0x731e0b);}return _0x336308[_0x0e86('0x17')](_0x731e0b)['end']();};}function respondWithResult(_0xee30a9,_0x27e093){_0x27e093=_0x27e093||0xc8;return function(_0xbd69f4){if(_0xbd69f4){return _0xee30a9[_0x0e86('0x17')](_0x27e093)[_0x0e86('0x18')](_0xbd69f4);}};}function respondWithFilteredResult(_0x39449f,_0x9964f7){return function(_0x3e4189){if(_0x3e4189){var _0x32cd00=typeof _0x9964f7[_0x0e86('0x19')]===_0x0e86('0x1a')&&typeof _0x9964f7[_0x0e86('0x1b')]===_0x0e86('0x1a');var _0x3b7933=_0x3e4189[_0x0e86('0x1c')];var _0xee60ba=_0x32cd00?0x0:_0x9964f7[_0x0e86('0x19')];var _0x1fbcd3=_0x32cd00?_0x3e4189[_0x0e86('0x1c')]:_0x9964f7['offset']+_0x9964f7['limit'];var _0x54579d;if(_0x1fbcd3>=_0x3b7933){_0x1fbcd3=_0x3b7933;_0x54579d=0xc8;}else{_0x54579d=0xce;}_0x39449f[_0x0e86('0x17')](_0x54579d);return _0x39449f[_0x0e86('0x1d')](_0x0e86('0x1e'),_0xee60ba+'-'+_0x1fbcd3+'/'+_0x3b7933)['json'](_0x3e4189);}return null;};}function patchUpdates(_0xe30ad9){return function(_0x53ceb1){try{jsonpatch[_0x0e86('0x1f')](_0x53ceb1,_0xe30ad9,!![]);}catch(_0x13008a){return BPromise[_0x0e86('0x20')](_0x13008a);}return _0x53ceb1[_0x0e86('0x21')]();};}function saveUpdates(_0x17edb4,_0x385530){return function(_0x538ef3){if(_0x538ef3){return _0x538ef3[_0x0e86('0x22')](_0x17edb4)[_0x0e86('0x23')](function(_0x340a93){return _0x340a93;});}return null;};}function removeEntity(_0x432253,_0xa24e68){return function(_0x185354){if(_0x185354){return _0x185354[_0x0e86('0x24')]()['then'](function(){var _0x7ad308=_0x185354[_0x0e86('0x25')]({'plain':!![]});var _0x1ae6fe=_0x0e86('0x26');return db[_0x0e86('0x27')][_0x0e86('0x24')]({'where':{'type':_0x1ae6fe,'resourceId':_0x7ad308['id']}})['then'](function(){return _0x185354;});})[_0x0e86('0x23')](function(){_0x432253['status'](0xcc)[_0x0e86('0x28')]();});}};}function handleEntityNotFound(_0x13a187,_0x5b483f){return function(_0x49aea3){if(!_0x49aea3){_0x13a187[_0x0e86('0x16')](0x194);}return _0x49aea3;};}function handleError(_0x580416,_0x405643){_0x405643=_0x405643||0x1f4;return function(_0x1a7f77){logger['error'](_0x1a7f77['stack']);if(_0x1a7f77[_0x0e86('0x29')]){delete _0x1a7f77[_0x0e86('0x29')];}_0x580416[_0x0e86('0x17')](_0x405643)[_0x0e86('0x2a')](_0x1a7f77);};}exports[_0x0e86('0x2b')]=function(_0x53139c,_0x2194fd){var _0x432696={},_0x2351ca={},_0x33ea18={'count':0x0,'rows':[]};var _0x5a81dd=_[_0x0e86('0x2c')](db['Campaign'][_0x0e86('0x2d')],function(_0x244808){return{'name':_0x244808[_0x0e86('0x2e')],'type':_0x244808['type'][_0x0e86('0x2f')]};});_0x2351ca[_0x0e86('0x30')]=_[_0x0e86('0x2c')](_0x5a81dd,_0x0e86('0x29'));_0x2351ca[_0x0e86('0x31')]=_['keys'](_0x53139c[_0x0e86('0x31')]);_0x2351ca[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x2351ca[_0x0e86('0x30')],_0x2351ca['query']);_0x432696[_0x0e86('0x34')]=_['intersection'](_0x2351ca[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x53139c[_0x0e86('0x31')][_0x0e86('0x35')]));_0x432696[_0x0e86('0x34')]=_0x432696[_0x0e86('0x34')][_0x0e86('0x36')]?_0x432696[_0x0e86('0x34')]:_0x2351ca['model'];if(!_0x53139c[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x432696['limit']=qs['limit'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x432696[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x53139c[_0x0e86('0x31')]['offset']);}_0x432696[_0x0e86('0x39')]=qs['sort'](_0x53139c[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x432696['where']=qs[_0x0e86('0x32')](_['pick'](_0x53139c[_0x0e86('0x31')],_0x2351ca[_0x0e86('0x32')]),_0x5a81dd);if(_0x53139c[_0x0e86('0x31')]['filter']){_0x432696[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x432696[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x5a81dd,function(_0xdd6fdb){if(_0xdd6fdb[_0x0e86('0x3d')]!==_0x0e86('0x3e')){var _0x1d8d42={};_0x1d8d42[_0xdd6fdb[_0x0e86('0x29')]]={'$like':'%'+_0x53139c[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1d8d42;}})});}_0x432696=_['merge']({},_0x432696,_0x53139c[_0x0e86('0x40')]);var _0x382d94={'where':_0x432696[_0x0e86('0x3b')]};return db[_0x0e86('0x41')][_0x0e86('0x1c')](_0x382d94)[_0x0e86('0x23')](function(_0x5fa25f){_0x33ea18['count']=_0x5fa25f;if(_0x53139c[_0x0e86('0x31')][_0x0e86('0x42')]){_0x432696[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x41')]['findAll'](_0x432696);})[_0x0e86('0x23')](function(_0x4b4a2c){_0x33ea18[_0x0e86('0x44')]=_0x4b4a2c;return _0x33ea18;})[_0x0e86('0x23')](respondWithFilteredResult(_0x2194fd,_0x432696))[_0x0e86('0x45')](handleError(_0x2194fd,null));};exports[_0x0e86('0x46')]=function(_0x1bc5cc,_0x46de02){var _0x3e9ec3={'raw':![],'where':{'id':_0x1bc5cc['params']['id']}},_0x261899={};_0x261899[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x261899[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x1bc5cc[_0x0e86('0x31')]);_0x261899[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],_0x261899[_0x0e86('0x31')]);_0x3e9ec3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x261899[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x35')]));_0x3e9ec3[_0x0e86('0x34')]=_0x3e9ec3[_0x0e86('0x34')][_0x0e86('0x36')]?_0x3e9ec3[_0x0e86('0x34')]:_0x261899[_0x0e86('0x30')];if(_0x1bc5cc[_0x0e86('0x31')][_0x0e86('0x42')]){_0x3e9ec3[_0x0e86('0x43')]=[{'all':!![]}];}_0x3e9ec3=_[_0x0e86('0x3c')]({},_0x3e9ec3,_0x1bc5cc[_0x0e86('0x40')]);return db['Campaign'][_0x0e86('0x48')](_0x3e9ec3)['then'](handleEntityNotFound(_0x46de02,null))['then'](respondWithResult(_0x46de02,null))[_0x0e86('0x45')](handleError(_0x46de02,null));};exports[_0x0e86('0x49')]=function(_0x33de57,_0x334cc2){return db['Campaign']['create'](_0x33de57[_0x0e86('0x4a')],{})[_0x0e86('0x23')](function(_0x581add){var _0x3fcf2a=_0x33de57['user'][_0x0e86('0x25')]({'plain':!![]});if(!_0x3fcf2a)throw new Error(_0x0e86('0x4b'));if(_0x3fcf2a[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x53e1b5=_0x581add['get']({'plain':!![]});var _0x119cf1='IvrCampaigns';return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x119cf1,'userProfileId':_0x3fcf2a[_0x0e86('0x4f')]},'raw':!![]})['then'](function(_0x3d792a){if(_0x3d792a&&_0x3d792a[_0x0e86('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x53e1b5[_0x0e86('0x29')],'resourceId':_0x53e1b5['id'],'type':_0x3d792a[_0x0e86('0x29')],'sectionId':_0x3d792a['id']},{})[_0x0e86('0x23')](function(){return _0x581add;});}else{return _0x581add;}})[_0x0e86('0x45')](function(_0x1a33b3){logger['error'](_0x0e86('0x51'),_0x1a33b3);throw _0x1a33b3;});}return _0x581add;})[_0x0e86('0x23')](respondWithResult(_0x334cc2,0xc9))[_0x0e86('0x45')](handleError(_0x334cc2,null));};exports[_0x0e86('0x52')]=function(_0xb80509,_0x42fb33){var _0x9049a3={'where':{'id':_0xb80509[_0x0e86('0x53')]['id']}},_0x5a813b={};_0x5a813b['model']=_[_0x0e86('0x47')](db['Campaign'][_0x0e86('0x2d')]);_0x9049a3[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x5a813b[_0x0e86('0x30')],qs['fields'](_0xb80509[_0x0e86('0x31')]['fields']));_0x9049a3[_0x0e86('0x34')]=_0x9049a3['attributes']['length']?_0x9049a3['attributes']:_0x5a813b[_0x0e86('0x30')];if(_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]){_0x9049a3[_0x0e86('0x43')]=[{'all':!![]}];}_0x9049a3=_[_0x0e86('0x3c')]({},_0x9049a3,_0xb80509[_0x0e86('0x40')]);return db['Campaign']['find'](_0x9049a3)['then'](handleEntityNotFound(_0x42fb33,null))[_0x0e86('0x23')](function(_0x1e220c){if(_0x1e220c){var _0x373ffc=_0x1e220c[_0x0e86('0x25')]({'plain':!![]});_0x373ffc=qs[_0x0e86('0x54')](_0x373ffc,['id',_0x0e86('0x55'),_0x0e86('0x56')]);_0xb80509[_0x0e86('0x4a')]=_[_0x0e86('0x54')](_0xb80509['body'],['id',_0x0e86('0x55'),_0x0e86('0x56')]);return db[_0x0e86('0x41')]['create'](_[_0x0e86('0x3c')](_0x373ffc,_0xb80509['body']),{'include':_0xb80509[_0x0e86('0x31')][_0x0e86('0x42')]?[{'all':!![]}]:undefined})[_0x0e86('0x23')](function(_0x3b3ba2){var _0x370ca6=_0xb80509[_0x0e86('0x4d')][_0x0e86('0x25')]({'plain':!![]});if(!_0x370ca6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x370ca6[_0x0e86('0x4c')]===_0x0e86('0x4d')){var _0x3424fa=_0x3b3ba2[_0x0e86('0x25')]({'plain':!![]});var _0x86558c=_0x0e86('0x26');return db[_0x0e86('0x4e')][_0x0e86('0x48')]({'where':{'name':_0x86558c,'userProfileId':_0x370ca6[_0x0e86('0x4f')]},'raw':!![]})[_0x0e86('0x23')](function(_0x3d6b76){if(_0x3d6b76&&_0x3d6b76[_0x0e86('0x50')]===0x0){return db['UserProfileResource'][_0x0e86('0x49')]({'name':_0x3424fa['name'],'resourceId':_0x3424fa['id'],'type':_0x3d6b76[_0x0e86('0x29')],'sectionId':_0x3d6b76['id']},{})[_0x0e86('0x23')](function(){return _0x3b3ba2;});}else{return _0x3b3ba2;}})[_0x0e86('0x45')](function(_0x57ee43){logger[_0x0e86('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57ee43);throw _0x57ee43;});}return _0x3b3ba2;});}})[_0x0e86('0x23')](respondWithResult(_0x42fb33,0xc9))[_0x0e86('0x45')](handleError(_0x42fb33,null));};exports[_0x0e86('0x22')]=function(_0x379a7a,_0x259cc3){if(_0x379a7a[_0x0e86('0x4a')]['id']){delete _0x379a7a[_0x0e86('0x4a')]['id'];}return db['Campaign'][_0x0e86('0x48')]({'where':{'id':_0x379a7a[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x259cc3,null))['then'](saveUpdates(_0x379a7a[_0x0e86('0x4a')],null))[_0x0e86('0x23')](respondWithResult(_0x259cc3,null))[_0x0e86('0x45')](handleError(_0x259cc3,null));};exports[_0x0e86('0x24')]=function(_0x5e3626,_0x269bab){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x5e3626[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x269bab,null))['then'](removeEntity(_0x269bab,null))[_0x0e86('0x45')](handleError(_0x269bab,null));};exports[_0x0e86('0x58')]=function(_0x14a450,_0x2e437e,_0x4b9264){var _0x492c74={'raw':!![],'where':{}};var _0x204ed0={};var _0x2ac63f={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x14a450[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x2e437e,null))[_0x0e86('0x23')](function(_0x2d8d2e){if(_0x2d8d2e){_0x204ed0[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopper'][_0x0e86('0x2d')]);_0x204ed0[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x14a450[_0x0e86('0x31')]);_0x204ed0[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],_0x204ed0['query']);_0x492c74[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x204ed0[_0x0e86('0x30')],qs['fields'](_0x14a450[_0x0e86('0x31')]['fields']));_0x492c74[_0x0e86('0x34')]=_0x492c74[_0x0e86('0x34')][_0x0e86('0x36')]?_0x492c74[_0x0e86('0x34')]:_0x204ed0['model'];if(!_0x14a450['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x492c74[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x14a450['query'][_0x0e86('0x1b')]);_0x492c74[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x14a450['query'][_0x0e86('0x19')]);}_0x492c74[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x14a450[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x492c74[_0x0e86('0x3b')]=qs['filters'](_[_0x0e86('0x5a')](_0x14a450['query'],_0x204ed0[_0x0e86('0x32')]));_0x492c74[_0x0e86('0x3b')]['CampaignId']=_0x2d8d2e['id'];if(_0x14a450[_0x0e86('0x31')]['filter']){_0x492c74[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x492c74['where'],{'$or':_[_0x0e86('0x2c')](_0x492c74['attributes'],function(_0x5ede91){var _0x4028a6={};_0x4028a6[_0x5ede91]={'$like':'%'+_0x14a450[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x4028a6;})});}_0x492c74=_['merge']({},_0x492c74,_0x14a450['options']);return db[_0x0e86('0x5b')][_0x0e86('0x1c')]({'where':_0x492c74['where']})[_0x0e86('0x23')](function(_0x474b6b){_0x2ac63f['count']=_0x474b6b;if(_0x14a450[_0x0e86('0x31')]['includeAll']){_0x492c74[_0x0e86('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x492c74);})[_0x0e86('0x23')](function(_0xec1890){_0x2ac63f[_0x0e86('0x44')]=_0xec1890;return _0x2ac63f;});}})['then'](respondWithFilteredResult(_0x2e437e,_0x492c74))['catch'](handleError(_0x2e437e,null));};exports[_0x0e86('0x5c')]=function(_0x2b8ecc,_0x1de61f,_0x2a51ee){var _0x595dab={'raw':!![],'where':{}};var _0x575a0c={};var _0x5211d6={'count':0x0,'rows':[]};return db[_0x0e86('0x41')][_0x0e86('0x59')]({'where':{'id':_0x2b8ecc['params']['id']}})['then'](handleEntityNotFound(_0x1de61f,null))[_0x0e86('0x23')](function(_0x3d52e5){if(_0x3d52e5){_0x575a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperHistory'][_0x0e86('0x2d')]);_0x575a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x2b8ecc[_0x0e86('0x31')]);_0x575a0c['filters']=_[_0x0e86('0x33')](_0x575a0c['model'],_0x575a0c['query']);_0x595dab[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x575a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x2b8ecc[_0x0e86('0x31')]['fields']));_0x595dab[_0x0e86('0x34')]=_0x595dab[_0x0e86('0x34')][_0x0e86('0x36')]?_0x595dab[_0x0e86('0x34')]:_0x575a0c[_0x0e86('0x30')];if(!_0x2b8ecc['query'][_0x0e86('0x37')](_0x0e86('0x38'))){_0x595dab[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x595dab[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x595dab[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x595dab['where']=qs['filters'](_[_0x0e86('0x5a')](_0x2b8ecc[_0x0e86('0x31')],_0x575a0c[_0x0e86('0x32')]));_0x595dab[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x3d52e5['id'];if(_0x2b8ecc[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x595dab[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x595dab[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x595dab['attributes'],function(_0x4ad45d){var _0x5ad0b3={};_0x5ad0b3[_0x4ad45d]={'$like':'%'+_0x2b8ecc[_0x0e86('0x31')]['filter']+'%'};return _0x5ad0b3;})});}_0x595dab=_[_0x0e86('0x3c')]({},_0x595dab,_0x2b8ecc['options']);return db[_0x0e86('0x5e')][_0x0e86('0x1c')]({'where':_0x595dab[_0x0e86('0x3b')]})['then'](function(_0x3254fb){_0x5211d6['count']=_0x3254fb;if(_0x2b8ecc['query']['includeAll']){_0x595dab['include']=[{'all':!![]}];}return db[_0x0e86('0x5e')][_0x0e86('0x5f')](_0x595dab);})[_0x0e86('0x23')](function(_0x14a189){_0x5211d6[_0x0e86('0x44')]=_0x14a189;return _0x5211d6;});}})['then'](respondWithFilteredResult(_0x1de61f,_0x595dab))['catch'](handleError(_0x1de61f,null));};exports[_0x0e86('0x60')]=function(_0x4bda62,_0x16ac42,_0x4d97f8){var _0x50818b={'raw':!![],'where':{}};var _0x573c6e={};var _0x172100={'count':0x0,'rows':[]};return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x4bda62[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x16ac42,null))[_0x0e86('0x23')](function(_0x644f28){if(_0x644f28){_0x573c6e['model']=_[_0x0e86('0x47')](db['CmHopperFinal'][_0x0e86('0x2d')]);_0x573c6e[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x4bda62[_0x0e86('0x31')]);_0x573c6e[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0x573c6e[_0x0e86('0x30')],_0x573c6e['query']);_0x50818b[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x573c6e['model'],qs[_0x0e86('0x35')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x35')]));_0x50818b[_0x0e86('0x34')]=_0x50818b[_0x0e86('0x34')][_0x0e86('0x36')]?_0x50818b['attributes']:_0x573c6e[_0x0e86('0x30')];if(!_0x4bda62['query']['hasOwnProperty'](_0x0e86('0x38'))){_0x50818b[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x50818b['offset']=qs['offset'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x19')]);}_0x50818b[_0x0e86('0x39')]=qs['sort'](_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x50818b[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_['pick'](_0x4bda62[_0x0e86('0x31')],_0x573c6e[_0x0e86('0x32')]));_0x50818b[_0x0e86('0x3b')][_0x0e86('0x5d')]=_0x644f28['id'];if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x50818b['where']=_[_0x0e86('0x3c')](_0x50818b['where'],{'$or':_[_0x0e86('0x2c')](_0x50818b[_0x0e86('0x34')],function(_0x1c99f4){var _0x1be099={};_0x1be099[_0x1c99f4]={'$like':'%'+_0x4bda62[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x1be099;})});}_0x50818b=_[_0x0e86('0x3c')]({},_0x50818b,_0x4bda62[_0x0e86('0x40')]);return db[_0x0e86('0x61')]['count']({'where':_0x50818b['where']})[_0x0e86('0x23')](function(_0x1a3ef2){_0x172100[_0x0e86('0x1c')]=_0x1a3ef2;if(_0x4bda62[_0x0e86('0x31')][_0x0e86('0x42')]){_0x50818b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x50818b);})[_0x0e86('0x23')](function(_0x2532f6){_0x172100[_0x0e86('0x44')]=_0x2532f6;return _0x172100;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x16ac42,_0x50818b))['catch'](handleError(_0x16ac42,null));};exports['getHopperBlacks']=function(_0x3e64a8,_0x2cd55f,_0x152961){var _0x2ae260={'raw':!![],'where':{}};var _0x108a0c={};var _0x506230={'count':0x0,'rows':[]};return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x3e64a8['params']['id']}})['then'](handleEntityNotFound(_0x2cd55f,null))[_0x0e86('0x23')](function(_0x68fb2a){if(_0x68fb2a){_0x108a0c[_0x0e86('0x30')]=_[_0x0e86('0x47')](db['CmHopperBlack'][_0x0e86('0x2d')]);_0x108a0c[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x3e64a8['query']);_0x108a0c['filters']=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],_0x108a0c[_0x0e86('0x31')]);_0x2ae260[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x108a0c[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x35')]));_0x2ae260[_0x0e86('0x34')]=_0x2ae260[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2ae260[_0x0e86('0x34')]:_0x108a0c[_0x0e86('0x30')];if(!_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x2ae260[_0x0e86('0x1b')]=qs[_0x0e86('0x1b')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2ae260[_0x0e86('0x19')]=qs[_0x0e86('0x19')](_0x3e64a8['query'][_0x0e86('0x19')]);}_0x2ae260['order']=qs[_0x0e86('0x3a')](_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2ae260['where']=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x3e64a8[_0x0e86('0x31')],_0x108a0c['filters']));_0x2ae260['where'][_0x0e86('0x5d')]=_0x68fb2a['id'];if(_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]){_0x2ae260[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2ae260['where'],{'$or':_[_0x0e86('0x2c')](_0x2ae260[_0x0e86('0x34')],function(_0x1662ad){var _0x6318ad={};_0x6318ad[_0x1662ad]={'$like':'%'+_0x3e64a8[_0x0e86('0x31')][_0x0e86('0x3f')]+'%'};return _0x6318ad;})});}_0x2ae260=_[_0x0e86('0x3c')]({},_0x2ae260,_0x3e64a8['options']);return db[_0x0e86('0x62')][_0x0e86('0x1c')]({'where':_0x2ae260['where']})[_0x0e86('0x23')](function(_0x2cd3d4){_0x506230[_0x0e86('0x1c')]=_0x2cd3d4;if(_0x3e64a8[_0x0e86('0x31')]['includeAll']){_0x2ae260[_0x0e86('0x43')]=[{'all':!![]}];}return db[_0x0e86('0x62')][_0x0e86('0x5f')](_0x2ae260);})[_0x0e86('0x23')](function(_0x806099){_0x506230[_0x0e86('0x44')]=_0x806099;return _0x506230;});}})[_0x0e86('0x23')](respondWithFilteredResult(_0x2cd55f,_0x2ae260))[_0x0e86('0x45')](handleError(_0x2cd55f,null));};exports[_0x0e86('0x63')]=function(_0x5dc45d,_0x5a52f6,_0x40741c){var _0x49064c={};var _0x3270e5={};var _0x1f3d5b;var _0x2a74e4;return db[_0x0e86('0x41')]['findOne']({'where':{'id':_0x5dc45d[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x5a52f6,null))[_0x0e86('0x23')](function(_0x2c7653){if(_0x2c7653){_0x1f3d5b=_0x2c7653;_0x3270e5[_0x0e86('0x30')]=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0x3270e5[_0x0e86('0x31')]=_['keys'](_0x5dc45d['query']);_0x3270e5[_0x0e86('0x32')]=_['intersection'](_0x3270e5['model'],_0x3270e5[_0x0e86('0x31')]);_0x49064c[_0x0e86('0x34')]=_[_0x0e86('0x33')](_0x3270e5[_0x0e86('0x30')],qs[_0x0e86('0x35')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x35')]));_0x49064c[_0x0e86('0x34')]=_0x49064c[_0x0e86('0x34')]['length']?_0x49064c[_0x0e86('0x34')]:_0x3270e5[_0x0e86('0x30')];_0x49064c['order']=qs[_0x0e86('0x3a')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x49064c[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x5dc45d[_0x0e86('0x31')],_0x3270e5[_0x0e86('0x32')]));if(_0x5dc45d['query'][_0x0e86('0x3f')]){_0x49064c['where']=_[_0x0e86('0x3c')](_0x49064c[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x49064c[_0x0e86('0x34')],function(_0x419088){var _0x2adef6={};_0x2adef6[_0x419088]={'$like':'%'+_0x5dc45d['query'][_0x0e86('0x3f')]+'%'};return _0x2adef6;})});}_0x49064c=_['merge']({},_0x49064c,_0x5dc45d['options']);return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x5754f2){if(_0x5754f2){_0x2a74e4=_0x5754f2['length'];if(!_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x37')](_0x0e86('0x38'))){_0x49064c[_0x0e86('0x1b')]=qs['limit'](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x49064c['offset']=qs[_0x0e86('0x19')](_0x5dc45d[_0x0e86('0x31')][_0x0e86('0x19')]);}return _0x1f3d5b[_0x0e86('0x63')](_0x49064c);}})[_0x0e86('0x23')](function(_0x4fc66f){if(_0x4fc66f){return _0x4fc66f?{'count':_0x2a74e4,'rows':_0x4fc66f}:null;}})[_0x0e86('0x23')](respondWithResult(_0x5a52f6,null))[_0x0e86('0x45')](handleError(_0x5a52f6,null));};exports[_0x0e86('0x65')]=function(_0x18fc81,_0xd776db,_0x361a09){var _0x634087,_0x29051c;var _0xd3638f=[];var _0x19fe5d=moment()['format'](_0x0e86('0x66'));return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x18fc81['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xd776db,null))['then'](function(_0x89b797){if(_0x89b797){_0x29051c=_0x89b797;return _0x89b797[_0x0e86('0x65')](_0x18fc81['body'][_0x0e86('0x67')],_['omit'](_0x18fc81[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x2b21c5){var _0x4ca95c;var _0x4d46d7;_0x634087=_0x2b21c5||[];var _0x1379a3=[];if(_0x2b21c5){for(var _0x4866cc=0x0;_0x4866cc<_0x2b21c5[_0x0e86('0x36')];_0x4866cc+=0x1){var _0xdc8a00=_0x2b21c5[_0x4866cc][_0x0e86('0x25')]({'plain':!![]});_0x29051c[_0x0e86('0x69')]=_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]?_0x18fc81[_0x0e86('0x4a')][_0x0e86('0x69')]:_0x29051c[_0x0e86('0x69')];switch(_0x29051c[_0x0e86('0x69')]){case _0x0e86('0x6a'):_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt',_0x0e86('0x70'),_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),'phone')['field'](_0x0e86('0x73'),_0x0e86('0x74'))['field']('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')]('cm_contacts')[_0x0e86('0x3b')](_0x0e86('0x78'))[_0x0e86('0x3b')]('ListId\x20=\x20?',_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79'))[_0x0e86('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7b'))[_0x0e86('0x77')](_0x0e86('0x7c'))['where'](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]()))[_0x0e86('0x3b')](_0x0e86('0x7e'),squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))[_0x0e86('0x77')](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id'][_0x0e86('0x76')]())))[_0x0e86('0x76')]();break;case _0x0e86('0x80'):_0x4ca95c=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),_0x0e86('0x74'),_0x0e86('0x70'),_0x0e86('0x71'),_0x0e86('0x5d'),_0x0e86('0x55'),_0x0e86('0x56')],squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')](),_0x0e86('0x71'))['field'](_0x18fc81[_0x0e86('0x53')]['id']['toString'](),_0x0e86('0x5d'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','createdAt')[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27','updatedAt')[_0x0e86('0x77')](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')]['toString']())[_0x0e86('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x0e86('0x7a')]()[_0x0e86('0x72')](_0x0e86('0x7f'))['from'](_0x0e86('0x6d'))[_0x0e86('0x3b')](_0x0e86('0x7d'),_0x18fc81[_0x0e86('0x53')]['id']['toString']())))[_0x0e86('0x76')]();break;default:_0x4ca95c=squel[_0x0e86('0x6b')]()[_0x0e86('0x6c')](_0x0e86('0x6d'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'scheduledAt','ContactId',_0x0e86('0x71'),'CampaignId',_0x0e86('0x55'),_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')](_0x0e86('0x73'),_0x0e86('0x74'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0xdc8a00['CmListId']['toString'](),_0x0e86('0x71'))['field'](_0x18fc81['params']['id']['toString'](),_0x0e86('0x5d'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))['field']('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x81'))[_0x0e86('0x3b')]('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())['where'](_0x0e86('0x79')))[_0x0e86('0x76')]();}_0x4d46d7=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x83'))[_0x0e86('0x6e')]([_0x0e86('0x84'),_0x0e86('0x74'),'phone',_0x0e86('0x85'),'createdAt',_0x0e86('0x56')],squel[_0x0e86('0x7a')]()['field']('h.id','id')[_0x0e86('0x72')]('NOW()',_0x0e86('0x74'))[_0x0e86('0x72')](_0x0e86('0x86'),_0x0e86('0x6f'))[_0x0e86('0x72')]('ci.OrderBY',_0x0e86('0x85'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x55'))[_0x0e86('0x72')]('\x27'+_0x19fe5d+'\x27',_0x0e86('0x56'))[_0x0e86('0x77')](_0x0e86('0x87'),'ci')['join']('cm_hopper','h',_0x0e86('0x88'))[_0x0e86('0x3b')](_0x0e86('0x89'),_0xdc8a00[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8a'),_0x18fc81['params']['id'][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x8b'),_0x19fe5d))[_0x0e86('0x76')]();_0x1379a3[_0x0e86('0x8c')](db[_0x0e86('0x8d')]['query'](_0x4ca95c));_0xd3638f[_0x0e86('0x8c')](db['sequelize']['query'](_0x4d46d7));}return BPromise[_0x0e86('0x8e')](_0x1379a3);}})['then'](function(){return BPromise[_0x0e86('0x8e')](_0xd3638f);})[_0x0e86('0x23')](function(){return _0x634087;})['then'](respondWithResult(_0xd776db,null))[_0x0e86('0x45')](handleError(_0xd776db,null));};exports[_0x0e86('0x8f')]=function(_0x33134e,_0x36011d,_0x2fc9f2){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33134e[_0x0e86('0x53')]['id']}})['then'](handleEntityNotFound(_0x36011d,null))['then'](function(_0x1d03d7){if(_0x1d03d7){return _0x1d03d7[_0x0e86('0x8f')](_0x33134e[_0x0e86('0x31')][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x5e07a3){if(_0x5e07a3){return db['CmHopper'][_0x0e86('0x24')]({'where':{'ListId':_0x33134e['query'][_0x0e86('0x67')],'CampaignId':_0x33134e[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](function(){return _0x5e07a3;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x36011d,null))[_0x0e86('0x45')](handleError(_0x36011d,null));};exports[_0x0e86('0x90')]=function(_0x580138,_0xb36335,_0x8aa5d){var _0x2d52af={};var _0xe18336={};var _0x43123f;var _0x52442d;return db['Campaign'][_0x0e86('0x59')]({'where':{'id':_0x580138[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0xb36335,null))[_0x0e86('0x23')](function(_0x536ed9){if(_0x536ed9){_0x43123f=_0x536ed9;_0xe18336['model']=_[_0x0e86('0x47')](db[_0x0e86('0x64')]['rawAttributes']);_0xe18336[_0x0e86('0x31')]=_[_0x0e86('0x47')](_0x580138[_0x0e86('0x31')]);_0xe18336[_0x0e86('0x32')]=_[_0x0e86('0x33')](_0xe18336[_0x0e86('0x30')],_0xe18336[_0x0e86('0x31')]);_0x2d52af['attributes']=_[_0x0e86('0x33')](_0xe18336['model'],qs[_0x0e86('0x35')](_0x580138['query'][_0x0e86('0x35')]));_0x2d52af['attributes']=_0x2d52af[_0x0e86('0x34')][_0x0e86('0x36')]?_0x2d52af[_0x0e86('0x34')]:_0xe18336[_0x0e86('0x30')];_0x2d52af[_0x0e86('0x39')]=qs[_0x0e86('0x3a')](_0x580138[_0x0e86('0x31')][_0x0e86('0x3a')]);_0x2d52af[_0x0e86('0x3b')]=qs[_0x0e86('0x32')](_[_0x0e86('0x5a')](_0x580138['query'],_0xe18336[_0x0e86('0x32')]));if(_0x580138[_0x0e86('0x31')]['filter']){_0x2d52af[_0x0e86('0x3b')]=_[_0x0e86('0x3c')](_0x2d52af[_0x0e86('0x3b')],{'$or':_[_0x0e86('0x2c')](_0x2d52af[_0x0e86('0x34')],function(_0x1df37c){var _0x1f1486={};_0x1f1486[_0x1df37c]={'$like':'%'+_0x580138['query'][_0x0e86('0x3f')]+'%'};return _0x1f1486;})});}_0x2d52af=_[_0x0e86('0x3c')]({},_0x2d52af,_0x580138[_0x0e86('0x40')]);return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x427d8c){if(_0x427d8c){_0x52442d=_0x427d8c[_0x0e86('0x36')];if(!_0x580138[_0x0e86('0x31')][_0x0e86('0x37')]('nolimit')){_0x2d52af['limit']=qs[_0x0e86('0x1b')](_0x580138[_0x0e86('0x31')][_0x0e86('0x1b')]);_0x2d52af['offset']=qs[_0x0e86('0x19')](_0x580138[_0x0e86('0x31')]['offset']);}return _0x43123f[_0x0e86('0x90')](_0x2d52af);}})[_0x0e86('0x23')](function(_0x5544cd){if(_0x5544cd){return _0x5544cd?{'count':_0x52442d,'rows':_0x5544cd}:null;}})['then'](respondWithResult(_0xb36335,null))[_0x0e86('0x45')](handleError(_0xb36335,null));};exports['addBlackLists']=function(_0x342522,_0x369a02,_0x1564e3){var _0x4e3bc0,_0x5ddc03;var _0x470a96=[];var _0x1dfe5f=moment()[_0x0e86('0x91')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0e86('0x41')]['find']({'where':{'id':_0x342522[_0x0e86('0x53')]['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x369a02,null))[_0x0e86('0x23')](function(_0x3b8ad0){if(_0x3b8ad0){_0x5ddc03=_0x3b8ad0;return _0x3b8ad0['addBlackLists'](_0x342522['body'][_0x0e86('0x67')],_['omit'](_0x342522[_0x0e86('0x4a')],[_0x0e86('0x67'),'id'])||{});}return null;})[_0x0e86('0x68')](function(_0x5a557a){var _0x4d9f1e;var _0x175419;_0x4e3bc0=_0x5a557a||[];var _0x1e9950=[];if(_0x5a557a){for(var _0x4e3bcb=0x0;_0x4e3bcb<_0x5a557a['length'];_0x4e3bcb+=0x1){var _0x496260=_0x5a557a[_0x4e3bcb][_0x0e86('0x25')]({'plain':!![]});_0x4d9f1e=squel['insert']()[_0x0e86('0x6c')](_0x0e86('0x92'))[_0x0e86('0x6e')]([_0x0e86('0x6f'),'ContactId',_0x0e86('0x71'),_0x0e86('0x5d'),'createdAt',_0x0e86('0x56')],squel['select']()[_0x0e86('0x72')](_0x0e86('0x6f'),_0x0e86('0x6f'))[_0x0e86('0x72')]('id',_0x0e86('0x70'))[_0x0e86('0x72')](_0x496260['CmListId']['toString'](),_0x0e86('0x71'))[_0x0e86('0x72')](_0x342522['params']['id']['toString'](),_0x0e86('0x5d'))['field']('NOW()',_0x0e86('0x55'))[_0x0e86('0x72')]('NOW()',_0x0e86('0x56'))['from'](_0x0e86('0x81'))['where']('deletedAt\x20IS\x20NULL')[_0x0e86('0x3b')](_0x0e86('0x82'),_0x496260[_0x0e86('0x75')][_0x0e86('0x76')]())[_0x0e86('0x3b')](_0x0e86('0x79')))['toString']();_0x1e9950['push'](db['sequelize'][_0x0e86('0x31')](_0x4d9f1e));}return BPromise['all'](_0x1e9950);}})[_0x0e86('0x23')](function(){return _0x4e3bc0;})[_0x0e86('0x23')](respondWithResult(_0x369a02,null))[_0x0e86('0x45')](handleError(_0x369a02,null));};exports['removeBlackLists']=function(_0x33c463,_0x56cd27,_0x51dc39){return db[_0x0e86('0x41')][_0x0e86('0x48')]({'where':{'id':_0x33c463['params']['id']}})[_0x0e86('0x23')](handleEntityNotFound(_0x56cd27,null))[_0x0e86('0x23')](function(_0x2d4e0c){if(_0x2d4e0c){return _0x2d4e0c[_0x0e86('0x93')](_0x33c463['query'][_0x0e86('0x67')]);}})[_0x0e86('0x23')](function(_0x468f4e){if(_0x468f4e){return db['CmHopperBlack'][_0x0e86('0x24')]({'where':{'ListId':_0x33c463['query'][_0x0e86('0x67')],'CampaignId':_0x33c463['params']['id']}})['then'](function(){return _0x468f4e;});}})[_0x0e86('0x23')](respondWithStatusCode(_0x56cd27,null))['catch'](handleError(_0x56cd27,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 43e09cb..864e1ba 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(_0x10d8ad,_0x4c10fa){var _0x212cfc=function(_0x40a5d7){while(--_0x40a5d7){_0x10d8ad['push'](_0x10d8ad['shift']());}};_0x212cfc(++_0x4c10fa);}(_0x7a54,0x106));var _0x47a5=function(_0x45512c,_0xfbed96){_0x45512c=_0x45512c-0x0;var _0xb6445f=_0x7a54[_0x45512c];return _0xb6445f;};'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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_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':'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 894b0b7..6908ffa 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 _0x37f8=['util','moment','bluebird','randomstring','../../mysqldb','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x39ac56,_0x2d111e){var _0x445a26=function(_0x25a8ec){while(--_0x25a8ec){_0x39ac56['push'](_0x39ac56['shift']());}};_0x445a26(++_0x2d111e);}(_0x37f8,0xd2));var _0x837f=function(_0x3c556d,_0x518379){_0x3c556d=_0x3c556d-0x0;var _0x2e4de5=_0x37f8[_0x3c556d];return _0x2e4de5;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var moment=require(_0x837f('0x1'));var BPromise=require(_0x837f('0x2'));var rs=require(_0x837f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x837f('0x4'))['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[_0x837f('0x5')][_0x837f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x224ad2,_0x40270f,_0x4111cb){return new BPromise(function(_0x25bbcb,_0x12c732){return client[_0x837f('0x7')](_0x224ad2,_0x4111cb)[_0x837f('0x8')](function(_0x2f1dc7){logger[_0x837f('0x9')](_0x837f('0xa'),_0x40270f,_0x837f('0xb'));logger[_0x837f('0xc')](_0x837f('0xd'),_0x40270f,'request\x20sent',JSON[_0x837f('0xe')](_0x2f1dc7));if(_0x2f1dc7[_0x837f('0xf')]){if(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x10')]===0x1f4){logger[_0x837f('0xf')]('Campaign,\x20%s,\x20%s',_0x40270f,_0x2f1dc7['error'][_0x837f('0x11')]);return _0x12c732(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x11')]);}logger[_0x837f('0xf')](_0x837f('0xa'),_0x40270f,_0x2f1dc7['error'][_0x837f('0x11')]);return _0x25bbcb(_0x2f1dc7[_0x837f('0xf')][_0x837f('0x11')]);}else{logger[_0x837f('0x9')](_0x837f('0xa'),_0x40270f,_0x837f('0xb'));_0x25bbcb(_0x2f1dc7['result'][_0x837f('0x11')]);}})[_0x837f('0x12')](function(_0x47bbe7){logger[_0x837f('0xf')](_0x837f('0xa'),_0x40270f,_0x47bbe7);_0x12c732(_0x47bbe7);});});}exports[_0x837f('0x13')]=function(_0x1d17b3){var _0x53279d=this;return new Promise(function(_0x1d974f,_0x2d5d54){return db[_0x837f('0x14')][_0x837f('0x15')]({'raw':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3['options'][_0x837f('0x17')]===undefined?!![]:![]:!![],'where':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3[_0x837f('0x16')][_0x837f('0x18')]||null:null,'attributes':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3['options'][_0x837f('0x19')]||null:null,'limit':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3[_0x837f('0x16')][_0x837f('0x1a')]||null:null,'include':_0x1d17b3[_0x837f('0x16')]?_0x1d17b3[_0x837f('0x16')][_0x837f('0x1b')]?_[_0x837f('0x1c')](_0x1d17b3[_0x837f('0x16')][_0x837f('0x1b')],function(_0x3fa18e){return{'model':db[_0x3fa18e[_0x837f('0x1d')]],'as':_0x3fa18e['as'],'attributes':_0x3fa18e[_0x837f('0x19')],'include':_0x3fa18e[_0x837f('0x1b')]?_[_0x837f('0x1c')](_0x3fa18e[_0x837f('0x1b')],function(_0x43ca7d){return{'model':db[_0x43ca7d[_0x837f('0x1d')]],'as':_0x43ca7d['as'],'attributes':_0x43ca7d[_0x837f('0x19')],'include':_0x43ca7d[_0x837f('0x1b')]?_[_0x837f('0x1c')](_0x43ca7d[_0x837f('0x1b')],function(_0x21f826){return{'model':db[_0x21f826['model']],'as':_0x21f826['as'],'attributes':_0x21f826[_0x837f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x837f('0x8')](function(_0x4290e6){logger['info']('GetCampaign',_0x1d17b3);logger[_0x837f('0xc')](_0x837f('0x13'),_0x1d17b3,JSON[_0x837f('0xe')](_0x4290e6));_0x1d974f(_0x4290e6);})[_0x837f('0x12')](function(_0x30a3d9){logger[_0x837f('0xf')](_0x837f('0x13'),_0x30a3d9['message'],_0x1d17b3);_0x2d5d54(_0x53279d[_0x837f('0xf')](0x1f4,_0x30a3d9[_0x837f('0x11')]));});});}; \ No newline at end of file +var _0x757f=['info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','raw','where','options','attributes','limit','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0x757f,0xee));var _0xf757=function(_0x3beea0,_0x416691){_0x3beea0=_0x3beea0-0x0;var _0x314eb1=_0x757f[_0x3beea0];return _0x314eb1;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('0x2'));var rs=require(_0xf757('0x3'));var fs=require('fs');var Redis=require(_0xf757('0x4'));var db=require(_0xf757('0x5'))['db'];var utils=require(_0xf757('0x6'));var logger=require(_0xf757('0x7'))(_0xf757('0x8'));var config=require(_0xf757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf757('0xa')][_0xf757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1e06,_0x2c0fcf,_0x44b312){return new BPromise(function(_0x565224,_0x5bf802){return client[_0xf757('0xc')](_0x4e1e06,_0x44b312)[_0xf757('0xd')](function(_0x1360ac){logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));logger[_0xf757('0x10')](_0xf757('0x11'),_0x2c0fcf,_0xf757('0xf'),JSON[_0xf757('0x12')](_0x1360ac));if(_0x1360ac[_0xf757('0x13')]){if(_0x1360ac[_0xf757('0x13')][_0xf757('0x14')]===0x1f4){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x5bf802(_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);}logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1360ac[_0xf757('0x13')][_0xf757('0x16')]);return _0x565224(_0x1360ac['error'][_0xf757('0x16')]);}else{logger[_0xf757('0xe')]('Campaign,\x20%s,\x20%s',_0x2c0fcf,_0xf757('0xf'));_0x565224(_0x1360ac[_0xf757('0x17')][_0xf757('0x16')]);}})['catch'](function(_0x1c5934){logger[_0xf757('0x13')](_0xf757('0x15'),_0x2c0fcf,_0x1c5934);_0x5bf802(_0x1c5934);});});}exports[_0xf757('0x18')]=function(_0x54af52){var _0x2ef7fe=this;return new Promise(function(_0x4124a0,_0x23277e){return db[_0xf757('0x19')][_0xf757('0x1a')]({'raw':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1b')]===undefined?!![]:![]:!![],'where':_0x54af52['options']?_0x54af52['options'][_0xf757('0x1c')]||null:null,'attributes':_0x54af52[_0xf757('0x1d')]?_0x54af52['options'][_0xf757('0x1e')]||null:null,'limit':_0x54af52[_0xf757('0x1d')]?_0x54af52[_0xf757('0x1d')][_0xf757('0x1f')]||null:null,'include':_0x54af52['options']?_0x54af52['options'][_0xf757('0x20')]?_[_0xf757('0x21')](_0x54af52[_0xf757('0x1d')][_0xf757('0x20')],function(_0x3d38dd){return{'model':db[_0x3d38dd[_0xf757('0x22')]],'as':_0x3d38dd['as'],'attributes':_0x3d38dd[_0xf757('0x1e')],'include':_0x3d38dd[_0xf757('0x20')]?_[_0xf757('0x21')](_0x3d38dd[_0xf757('0x20')],function(_0x4d9012){return{'model':db[_0x4d9012['model']],'as':_0x4d9012['as'],'attributes':_0x4d9012[_0xf757('0x1e')],'include':_0x4d9012[_0xf757('0x20')]?_[_0xf757('0x21')](_0x4d9012[_0xf757('0x20')],function(_0x207bae){return{'model':db[_0x207bae[_0xf757('0x22')]],'as':_0x207bae['as'],'attributes':_0x207bae[_0xf757('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf757('0xd')](function(_0x58ac7a){logger['info'](_0xf757('0x18'),_0x54af52);logger['debug'](_0xf757('0x18'),_0x54af52,JSON['stringify'](_0x58ac7a));_0x4124a0(_0x58ac7a);})[_0xf757('0x23')](function(_0x1345d6){logger['error'](_0xf757('0x18'),_0x1345d6[_0xf757('0x16')],_0x54af52);_0x23277e(_0x2ef7fe[_0xf757('0x13')](0x1f4,_0x1345d6[_0xf757('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index bdd3601..736a7eb 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 _0xb6b1=['/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/blacklists','getBlackLists','post','create','clone','/:id/lists','addLists','addBlackLists','put'];(function(_0x468602,_0x388c46){var _0x2c9203=function(_0x54ba9f){while(--_0x54ba9f){_0x468602['push'](_0x468602['shift']());}};_0x2c9203(++_0x388c46);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xb6b1[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x1b6b('0x0'));var util=require('util');var path=require(_0x1b6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6b('0x2'));var router=express[_0x1b6b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b6b('0x5'));var controller=require(_0x1b6b('0x6'));router[_0x1b6b('0x7')]('/',auth[_0x1b6b('0x8')](),controller['index']);router[_0x1b6b('0x7')]('/:id',auth[_0x1b6b('0x8')](),controller['show']);router[_0x1b6b('0x7')](_0x1b6b('0x9'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xa')]);router['get']('/:id/hopper_histories',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xb')]);router[_0x1b6b('0x7')](_0x1b6b('0xc'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xd')]);router[_0x1b6b('0x7')]('/:id/hopper_black',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0xe')]);router[_0x1b6b('0x7')]('/:id/lists',auth[_0x1b6b('0x8')](),controller['getLists']);router['get'](_0x1b6b('0xf'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x10')]);router[_0x1b6b('0x11')]('/',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x12')]);router[_0x1b6b('0x11')]('/:id/clone',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x13')]);router[_0x1b6b('0x11')](_0x1b6b('0x14'),auth['isAuthenticated'](),controller[_0x1b6b('0x15')]);router[_0x1b6b('0x11')](_0x1b6b('0xf'),auth['isAuthenticated'](),controller[_0x1b6b('0x16')]);router[_0x1b6b('0x17')](_0x1b6b('0x18'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x19')]);router[_0x1b6b('0x1a')](_0x1b6b('0x18'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x1b')]);router[_0x1b6b('0x1a')]('/:id/lists',auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x1c')]);router[_0x1b6b('0x1a')](_0x1b6b('0xf'),auth[_0x1b6b('0x8')](),controller[_0x1b6b('0x1d')]);module[_0x1b6b('0x1e')]=router; \ No newline at end of file +var _0x6208=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','get','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x47370b,_0x1c12e8){var _0x43e3e2=function(_0x52fffe){while(--_0x52fffe){_0x47370b['push'](_0x47370b['shift']());}};_0x43e3e2(++_0x1c12e8);}(_0x6208,0x15c));var _0x8620=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x6208[_0x2fbd0e];return _0x481c9f;};'use strict';var multer=require(_0x8620('0x0'));var util=require(_0x8620('0x1'));var path=require('path');var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require(_0x8620('0x4'));var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8620('0x6'));router['get']('/',auth[_0x8620('0x7')](),controller['index']);router[_0x8620('0x8')](_0x8620('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8620('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x8620('0x8')](_0x8620('0xa'),auth[_0x8620('0x7')](),controller[_0x8620('0xb')]);router[_0x8620('0x8')](_0x8620('0xc'),auth[_0x8620('0x7')](),controller[_0x8620('0xd')]);router[_0x8620('0x8')](_0x8620('0xe'),auth[_0x8620('0x7')](),controller['getHopperBlacks']);router[_0x8620('0x8')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller['getLists']);router[_0x8620('0x8')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller[_0x8620('0x11')]);router[_0x8620('0x12')]('/',auth[_0x8620('0x7')](),controller[_0x8620('0x13')]);router[_0x8620('0x12')](_0x8620('0x14'),auth[_0x8620('0x7')](),controller[_0x8620('0x15')]);router[_0x8620('0x12')](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x16')]);router[_0x8620('0x12')](_0x8620('0x10'),auth[_0x8620('0x7')](),controller['addBlackLists']);router[_0x8620('0x17')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller['update']);router[_0x8620('0x18')](_0x8620('0x9'),auth[_0x8620('0x7')](),controller[_0x8620('0x19')]);router['delete'](_0x8620('0xf'),auth[_0x8620('0x7')](),controller[_0x8620('0x1a')]);router[_0x8620('0x18')]('/:id/blacklists',auth[_0x8620('0x7')](),controller[_0x8620('0x1b')]);module[_0x8620('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 22f1f5e..e61b06c 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 _0xdfa1=['VIRTUAL','getDataValue','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdfa1,0x1b5));var _0x1dfa=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xdfa1[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0x1dfa('0x0'));module[_0x1dfa('0x1')]={'key':{'type':Sequelize[_0x1dfa('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x1dfa('0x2')]},'name':{'type':Sequelize[_0x1dfa('0x3')],'get':function(){return this[_0x1dfa('0x4')]('key');}}}; \ No newline at end of file +var _0xbc74=['exports','TEXT','STRING','VIRTUAL','getDataValue','key'];(function(_0x10d8ad,_0x4c10fa){var _0x212cfc=function(_0x40a5d7){while(--_0x40a5d7){_0x10d8ad['push'](_0x10d8ad['shift']());}};_0x212cfc(++_0x4c10fa);}(_0xbc74,0x162));var _0x4bc7=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xbc74[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0x4bc7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x4bc7('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4bc7('0x2')]},'name':{'type':Sequelize[_0x4bc7('0x3')],'get':function(){return this[_0x4bc7('0x4')](_0x4bc7('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 5d3b106..b42015a 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 _0x5cd5=['nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','find','body','params','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','get','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x4764cb,_0x15a140){var _0x3fc947=function(_0x2e1033){while(--_0x2e1033){_0x4764cb['push'](_0x4764cb['shift']());}};_0x3fc947(++_0x15a140);}(_0x5cd5,0x7f));var _0x55cd=function(_0xca550e,_0x54da07){_0xca550e=_0xca550e-0x0;var _0x48a51e=_0x5cd5[_0xca550e];return _0x48a51e;};'use strict';var emlformat=require(_0x55cd('0x0'));var rimraf=require(_0x55cd('0x1'));var zipdir=require(_0x55cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x55cd('0x3'));var util=require(_0x55cd('0x4'));var path=require(_0x55cd('0x5'));var sox=require(_0x55cd('0x6'));var csv=require(_0x55cd('0x7'));var ejs=require(_0x55cd('0x8'));var fs=require('fs');var fs_extra=require(_0x55cd('0x9'));var _=require(_0x55cd('0xa'));var squel=require('squel');var crypto=require(_0x55cd('0xb'));var jsforce=require(_0x55cd('0xc'));var deskjs=require(_0x55cd('0xd'));var toCsv=require(_0x55cd('0x7'));var querystring=require('querystring');var Papa=require(_0x55cd('0xe'));var Redis=require('ioredis');var authService=require(_0x55cd('0xf'));var qs=require(_0x55cd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55cd('0x11'));var logger=require(_0x55cd('0x12'))(_0x55cd('0x13'));var utils=require(_0x55cd('0x14'));var config=require(_0x55cd('0x15'));var licenseUtil=require(_0x55cd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dfa31,_0x3e28a9){_0x3e28a9=_0x3e28a9||0xcc;return function(_0x24316d){if(_0x24316d){return _0x3dfa31[_0x55cd('0x17')](_0x3e28a9);}return _0x3dfa31[_0x55cd('0x18')](_0x3e28a9)[_0x55cd('0x19')]();};}function respondWithResult(_0x5439e9,_0x4ed9af){_0x4ed9af=_0x4ed9af||0xc8;return function(_0x3b78e0){if(_0x3b78e0){return _0x5439e9[_0x55cd('0x18')](_0x4ed9af)[_0x55cd('0x1a')](_0x3b78e0);}};}function respondWithFilteredResult(_0x445a14,_0x3d5dea){return function(_0x3793aa){if(_0x3793aa){var _0x38e104=typeof _0x3d5dea[_0x55cd('0x1b')]==='undefined'&&typeof _0x3d5dea[_0x55cd('0x1c')]===_0x55cd('0x1d');var _0xb1a48e=_0x3793aa[_0x55cd('0x1e')];var _0x27963f=_0x38e104?0x0:_0x3d5dea['offset'];var _0x3960b9=_0x38e104?_0x3793aa['count']:_0x3d5dea[_0x55cd('0x1b')]+_0x3d5dea[_0x55cd('0x1c')];var _0x1c0cb0;if(_0x3960b9>=_0xb1a48e){_0x3960b9=_0xb1a48e;_0x1c0cb0=0xc8;}else{_0x1c0cb0=0xce;}_0x445a14['status'](_0x1c0cb0);return _0x445a14[_0x55cd('0x1f')]('Content-Range',_0x27963f+'-'+_0x3960b9+'/'+_0xb1a48e)[_0x55cd('0x1a')](_0x3793aa);}return null;};}function patchUpdates(_0x2cd970){return function(_0x4e2ffa){try{jsonpatch[_0x55cd('0x20')](_0x4e2ffa,_0x2cd970,!![]);}catch(_0x29f649){return BPromise[_0x55cd('0x21')](_0x29f649);}return _0x4e2ffa[_0x55cd('0x22')]();};}function saveUpdates(_0x19a8b5,_0x228065){return function(_0x4d0a3d){if(_0x4d0a3d){return _0x4d0a3d[_0x55cd('0x23')](_0x19a8b5)['then'](function(_0x46e16e){return _0x46e16e;});}return null;};}function removeEntity(_0x4c2f11,_0x10ad4c){return function(_0x1d63e3){if(_0x1d63e3){return _0x1d63e3[_0x55cd('0x24')]()[_0x55cd('0x25')](function(){var _0x4e5603=_0x1d63e3[_0x55cd('0x26')]({'plain':!![]});var _0x180d30='CannedAnswers';return db['UserProfileResource'][_0x55cd('0x24')]({'where':{'type':_0x180d30,'resourceId':_0x4e5603['id']}})[_0x55cd('0x25')](function(){return _0x1d63e3;});})[_0x55cd('0x25')](function(){_0x4c2f11[_0x55cd('0x18')](0xcc)[_0x55cd('0x19')]();});}};}function handleEntityNotFound(_0x35caf6,_0x5a7076){return function(_0x39ec6e){if(!_0x39ec6e){_0x35caf6[_0x55cd('0x17')](0x194);}return _0x39ec6e;};}function handleError(_0x3f9a87,_0x5cee47){_0x5cee47=_0x5cee47||0x1f4;return function(_0x194cd3){logger[_0x55cd('0x27')](_0x194cd3[_0x55cd('0x28')]);if(_0x194cd3[_0x55cd('0x29')]){delete _0x194cd3[_0x55cd('0x29')];}_0x3f9a87['status'](_0x5cee47)['send'](_0x194cd3);};}exports[_0x55cd('0x2a')]=function(_0x152f7d,_0x5d4577){var _0x3ea82d={},_0x356f4c={},_0x55478a={'count':0x0,'rows':[]};var _0x16dd0b=_[_0x55cd('0x2b')](db[_0x55cd('0x2c')][_0x55cd('0x2d')],function(_0x48bb98){return{'name':_0x48bb98[_0x55cd('0x2e')],'type':_0x48bb98[_0x55cd('0x2f')]['key']};});_0x356f4c[_0x55cd('0x30')]=_[_0x55cd('0x2b')](_0x16dd0b,_0x55cd('0x29'));_0x356f4c[_0x55cd('0x31')]=_['keys'](_0x152f7d[_0x55cd('0x31')]);_0x356f4c[_0x55cd('0x32')]=_[_0x55cd('0x33')](_0x356f4c[_0x55cd('0x30')],_0x356f4c[_0x55cd('0x31')]);_0x3ea82d[_0x55cd('0x34')]=_['intersection'](_0x356f4c[_0x55cd('0x30')],qs[_0x55cd('0x35')](_0x152f7d['query']['fields']));_0x3ea82d['attributes']=_0x3ea82d['attributes']['length']?_0x3ea82d['attributes']:_0x356f4c[_0x55cd('0x30')];if(!_0x152f7d[_0x55cd('0x31')][_0x55cd('0x36')](_0x55cd('0x37'))){_0x3ea82d[_0x55cd('0x1c')]=qs[_0x55cd('0x1c')](_0x152f7d['query'][_0x55cd('0x1c')]);_0x3ea82d[_0x55cd('0x1b')]=qs[_0x55cd('0x1b')](_0x152f7d['query'][_0x55cd('0x1b')]);}_0x3ea82d[_0x55cd('0x38')]=qs['sort'](_0x152f7d[_0x55cd('0x31')][_0x55cd('0x39')]);_0x3ea82d['where']=qs[_0x55cd('0x32')](_[_0x55cd('0x3a')](_0x152f7d[_0x55cd('0x31')],_0x356f4c[_0x55cd('0x32')]),_0x16dd0b);if(_0x152f7d[_0x55cd('0x31')][_0x55cd('0x3b')]){_0x3ea82d[_0x55cd('0x3c')]=_[_0x55cd('0x3d')](_0x3ea82d[_0x55cd('0x3c')],{'$or':[{'key':{'$like':'%'+_0x152f7d[_0x55cd('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x152f7d[_0x55cd('0x31')][_0x55cd('0x3b')]+'%'}}]});}_0x3ea82d=_['merge']({},_0x3ea82d,_0x152f7d[_0x55cd('0x3e')]);var _0x367e2b={'where':_0x3ea82d['where']};return db['CannedAnswer']['count'](_0x367e2b)['then'](function(_0x2db851){_0x55478a[_0x55cd('0x1e')]=_0x2db851;if(_0x152f7d[_0x55cd('0x31')]['includeAll']){_0x3ea82d[_0x55cd('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x55cd('0x40')](_0x3ea82d);})[_0x55cd('0x25')](function(_0x2ae856){_0x55478a[_0x55cd('0x41')]=_0x2ae856;return _0x55478a;})['then'](respondWithFilteredResult(_0x5d4577,_0x3ea82d))[_0x55cd('0x42')](handleError(_0x5d4577,null));};exports[_0x55cd('0x43')]=function(_0x12d8c9,_0x5a5f49){var _0x594adb={'raw':!![],'where':{'id':_0x12d8c9['params']['id']}},_0xe868f0={};_0xe868f0[_0x55cd('0x30')]=_['keys'](db[_0x55cd('0x2c')]['rawAttributes']);_0xe868f0['query']=_[_0x55cd('0x44')](_0x12d8c9[_0x55cd('0x31')]);_0xe868f0['filters']=_[_0x55cd('0x33')](_0xe868f0[_0x55cd('0x30')],_0xe868f0[_0x55cd('0x31')]);_0x594adb[_0x55cd('0x34')]=_['intersection'](_0xe868f0[_0x55cd('0x30')],qs[_0x55cd('0x35')](_0x12d8c9[_0x55cd('0x31')]['fields']));_0x594adb[_0x55cd('0x34')]=_0x594adb[_0x55cd('0x34')][_0x55cd('0x45')]?_0x594adb[_0x55cd('0x34')]:_0xe868f0['model'];if(_0x12d8c9[_0x55cd('0x31')][_0x55cd('0x46')]){_0x594adb['include']=[{'all':!![]}];}_0x594adb=_[_0x55cd('0x3d')]({},_0x594adb,_0x12d8c9[_0x55cd('0x3e')]);return db['CannedAnswer'][_0x55cd('0x47')](_0x594adb)[_0x55cd('0x25')](handleEntityNotFound(_0x5a5f49,null))[_0x55cd('0x25')](respondWithResult(_0x5a5f49,null))['catch'](handleError(_0x5a5f49,null));};exports[_0x55cd('0x23')]=function(_0x4cba67,_0x3477d8){if(_0x4cba67[_0x55cd('0x48')]['id']){delete _0x4cba67[_0x55cd('0x48')]['id'];}return db['CannedAnswer'][_0x55cd('0x47')]({'where':{'id':_0x4cba67[_0x55cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x3477d8,null))[_0x55cd('0x25')](saveUpdates(_0x4cba67[_0x55cd('0x48')],null))[_0x55cd('0x25')](respondWithResult(_0x3477d8,null))[_0x55cd('0x42')](handleError(_0x3477d8,null));};exports[_0x55cd('0x24')]=function(_0x860ca5,_0x8ceabf){return db[_0x55cd('0x2c')][_0x55cd('0x47')]({'where':{'id':_0x860ca5[_0x55cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x8ceabf,null))[_0x55cd('0x25')](removeEntity(_0x8ceabf,null))[_0x55cd('0x42')](handleError(_0x8ceabf,null));};exports['create']=function(_0x541a9f,_0xe9add3){var _0x505bbc={'key':_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4a')]};if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4b')]){_0x505bbc[_0x55cd('0x4b')]=_0x541a9f['body'][_0x55cd('0x4b')];}else if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4c')]){_0x505bbc[_0x55cd('0x4c')]=_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4c')];}else if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4d')]){_0x505bbc['OpenchannelAccountId']=_0x541a9f[_0x55cd('0x48')]['OpenchannelAccountId'];}else if(_0x541a9f[_0x55cd('0x48')][_0x55cd('0x4e')]){_0x505bbc[_0x55cd('0x4e')]=_0x541a9f['body']['ChatWebsiteId'];}return db[_0x55cd('0x2c')][_0x55cd('0x47')]({'where':_0x505bbc})[_0x55cd('0x25')](function(_0x4fd457){if(_0x4fd457){throw new db[(_0x55cd('0x4f'))][(_0x55cd('0x50'))](_0x55cd('0x51'));}return db[_0x55cd('0x2c')][_0x55cd('0x52')](_0x541a9f[_0x55cd('0x48')]);})[_0x55cd('0x25')](function(_0x6a47e3){var _0x59635a=_0x541a9f[_0x55cd('0x53')]['get']({'plain':!![]});if(!_0x59635a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59635a[_0x55cd('0x54')]===_0x55cd('0x53')){var _0x1816cf=_0x6a47e3[_0x55cd('0x26')]({'plain':!![]});return db[_0x55cd('0x55')][_0x55cd('0x47')]({'where':{'name':_0x55cd('0x56'),'userProfileId':_0x59635a[_0x55cd('0x57')]},'raw':!![]})[_0x55cd('0x25')](function(_0x118309){if(_0x118309&&_0x118309[_0x55cd('0x58')]===0x0){return db[_0x55cd('0x59')][_0x55cd('0x52')]({'name':_0x1816cf[_0x55cd('0x29')],'resourceId':_0x1816cf['id'],'type':_0x118309[_0x55cd('0x29')],'sectionId':_0x118309['id']},{})['then'](function(){return _0x6a47e3;});}else{return _0x6a47e3;}})['catch'](function(_0x226dad){logger[_0x55cd('0x27')](_0x55cd('0x5a'),_0x226dad);throw _0x226dad;});}return _0x6a47e3;})[_0x55cd('0x25')](respondWithResult(_0xe9add3,0xc9))['catch'](handleError(_0xe9add3,null));}; \ No newline at end of file +var _0x22f3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','eml-format','rimraf'];(function(_0x9df3d8,_0x4074e3){var _0x366da1=function(_0x5af940){while(--_0x5af940){_0x9df3d8['push'](_0x9df3d8['shift']());}};_0x366da1(++_0x4074e3);}(_0x22f3,0xae));var _0x322f=function(_0x438c82,_0xd70276){_0x438c82=_0x438c82-0x0;var _0x17073a=_0x22f3[_0x438c82];return _0x17073a;};'use strict';var emlformat=require(_0x322f('0x0'));var rimraf=require(_0x322f('0x1'));var zipdir=require(_0x322f('0x2'));var jsonpatch=require(_0x322f('0x3'));var rp=require(_0x322f('0x4'));var moment=require(_0x322f('0x5'));var BPromise=require(_0x322f('0x6'));var Mustache=require(_0x322f('0x7'));var util=require('util');var path=require(_0x322f('0x8'));var sox=require(_0x322f('0x9'));var csv=require(_0x322f('0xa'));var ejs=require(_0x322f('0xb'));var fs=require('fs');var fs_extra=require(_0x322f('0xc'));var _=require('lodash');var squel=require(_0x322f('0xd'));var crypto=require(_0x322f('0xe'));var jsforce=require(_0x322f('0xf'));var deskjs=require(_0x322f('0x10'));var toCsv=require(_0x322f('0xa'));var querystring=require(_0x322f('0x11'));var Papa=require(_0x322f('0x12'));var Redis=require(_0x322f('0x13'));var authService=require(_0x322f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x322f('0x15'));var hardwareService=require(_0x322f('0x16'));var logger=require(_0x322f('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x322f('0x18'));var licenseUtil=require(_0x322f('0x19'));var db=require(_0x322f('0x1a'))['db'];function respondWithStatusCode(_0x152be9,_0x39ad87){_0x39ad87=_0x39ad87||0xcc;return function(_0x58bfdf){if(_0x58bfdf){return _0x152be9[_0x322f('0x1b')](_0x39ad87);}return _0x152be9['status'](_0x39ad87)['end']();};}function respondWithResult(_0x497629,_0x2f7320){_0x2f7320=_0x2f7320||0xc8;return function(_0x15685f){if(_0x15685f){return _0x497629[_0x322f('0x1c')](_0x2f7320)[_0x322f('0x1d')](_0x15685f);}};}function respondWithFilteredResult(_0x2683c5,_0x4cda22){return function(_0x1fc16a){if(_0x1fc16a){var _0x452ae6=typeof _0x4cda22['offset']===_0x322f('0x1e')&&typeof _0x4cda22[_0x322f('0x1f')]===_0x322f('0x1e');var _0x1e3852=_0x1fc16a[_0x322f('0x20')];var _0x542583=_0x452ae6?0x0:_0x4cda22['offset'];var _0x171586=_0x452ae6?_0x1fc16a[_0x322f('0x20')]:_0x4cda22[_0x322f('0x21')]+_0x4cda22[_0x322f('0x1f')];var _0x3bcc9c;if(_0x171586>=_0x1e3852){_0x171586=_0x1e3852;_0x3bcc9c=0xc8;}else{_0x3bcc9c=0xce;}_0x2683c5[_0x322f('0x1c')](_0x3bcc9c);return _0x2683c5[_0x322f('0x22')](_0x322f('0x23'),_0x542583+'-'+_0x171586+'/'+_0x1e3852)[_0x322f('0x1d')](_0x1fc16a);}return null;};}function patchUpdates(_0xc9ff8){return function(_0x160c4c){try{jsonpatch[_0x322f('0x24')](_0x160c4c,_0xc9ff8,!![]);}catch(_0x298554){return BPromise[_0x322f('0x25')](_0x298554);}return _0x160c4c[_0x322f('0x26')]();};}function saveUpdates(_0x1c105d,_0x183894){return function(_0x25d529){if(_0x25d529){return _0x25d529[_0x322f('0x27')](_0x1c105d)[_0x322f('0x28')](function(_0x471712){return _0x471712;});}return null;};}function removeEntity(_0xa4cd26,_0x1967d7){return function(_0x3985fd){if(_0x3985fd){return _0x3985fd[_0x322f('0x29')]()[_0x322f('0x28')](function(){var _0x48c0e1=_0x3985fd[_0x322f('0x2a')]({'plain':!![]});var _0x5c7d99=_0x322f('0x2b');return db[_0x322f('0x2c')][_0x322f('0x29')]({'where':{'type':_0x5c7d99,'resourceId':_0x48c0e1['id']}})[_0x322f('0x28')](function(){return _0x3985fd;});})[_0x322f('0x28')](function(){_0xa4cd26[_0x322f('0x1c')](0xcc)[_0x322f('0x2d')]();});}};}function handleEntityNotFound(_0x873312,_0x64f44f){return function(_0x2e9ed3){if(!_0x2e9ed3){_0x873312[_0x322f('0x1b')](0x194);}return _0x2e9ed3;};}function handleError(_0x4ab290,_0x1f777c){_0x1f777c=_0x1f777c||0x1f4;return function(_0x4c5090){logger[_0x322f('0x2e')](_0x4c5090['stack']);if(_0x4c5090[_0x322f('0x2f')]){delete _0x4c5090[_0x322f('0x2f')];}_0x4ab290[_0x322f('0x1c')](_0x1f777c)['send'](_0x4c5090);};}exports['index']=function(_0x292ba0,_0x37b307){var _0x5d4207={},_0x200679={},_0x340fe3={'count':0x0,'rows':[]};var _0x407a4a=_['map'](db[_0x322f('0x30')][_0x322f('0x31')],function(_0xd65f1a){return{'name':_0xd65f1a[_0x322f('0x32')],'type':_0xd65f1a['type'][_0x322f('0x33')]};});_0x200679[_0x322f('0x34')]=_[_0x322f('0x35')](_0x407a4a,_0x322f('0x2f'));_0x200679[_0x322f('0x36')]=_[_0x322f('0x37')](_0x292ba0[_0x322f('0x36')]);_0x200679[_0x322f('0x38')]=_['intersection'](_0x200679[_0x322f('0x34')],_0x200679[_0x322f('0x36')]);_0x5d4207[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x200679[_0x322f('0x34')],qs[_0x322f('0x3b')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3b')]));_0x5d4207['attributes']=_0x5d4207[_0x322f('0x39')]['length']?_0x5d4207[_0x322f('0x39')]:_0x200679['model'];if(!_0x292ba0[_0x322f('0x36')]['hasOwnProperty']('nolimit')){_0x5d4207['limit']=qs['limit'](_0x292ba0[_0x322f('0x36')][_0x322f('0x1f')]);_0x5d4207[_0x322f('0x21')]=qs[_0x322f('0x21')](_0x292ba0[_0x322f('0x36')][_0x322f('0x21')]);}_0x5d4207[_0x322f('0x3c')]=qs[_0x322f('0x3d')](_0x292ba0[_0x322f('0x36')][_0x322f('0x3d')]);_0x5d4207[_0x322f('0x3e')]=qs['filters'](_[_0x322f('0x3f')](_0x292ba0[_0x322f('0x36')],_0x200679['filters']),_0x407a4a);if(_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]){_0x5d4207[_0x322f('0x3e')]=_['merge'](_0x5d4207[_0x322f('0x3e')],{'$or':[{'key':{'$like':'%'+_0x292ba0[_0x322f('0x36')]['filter']+'%'}},{'value':{'$like':'%'+_0x292ba0[_0x322f('0x36')][_0x322f('0x40')]+'%'}}]});}_0x5d4207=_[_0x322f('0x41')]({},_0x5d4207,_0x292ba0[_0x322f('0x42')]);var _0x57a041={'where':_0x5d4207[_0x322f('0x3e')]};return db[_0x322f('0x30')][_0x322f('0x20')](_0x57a041)['then'](function(_0x9ee9b8){_0x340fe3[_0x322f('0x20')]=_0x9ee9b8;if(_0x292ba0[_0x322f('0x36')][_0x322f('0x43')]){_0x5d4207[_0x322f('0x44')]=[{'all':!![]}];}return db[_0x322f('0x30')][_0x322f('0x45')](_0x5d4207);})[_0x322f('0x28')](function(_0x4228bf){_0x340fe3['rows']=_0x4228bf;return _0x340fe3;})[_0x322f('0x28')](respondWithFilteredResult(_0x37b307,_0x5d4207))[_0x322f('0x46')](handleError(_0x37b307,null));};exports[_0x322f('0x47')]=function(_0x2b3556,_0x126d2d){var _0x503f04={'raw':!![],'where':{'id':_0x2b3556[_0x322f('0x48')]['id']}},_0x358bab={};_0x358bab[_0x322f('0x34')]=_[_0x322f('0x37')](db['CannedAnswer'][_0x322f('0x31')]);_0x358bab[_0x322f('0x36')]=_[_0x322f('0x37')](_0x2b3556[_0x322f('0x36')]);_0x358bab['filters']=_[_0x322f('0x3a')](_0x358bab[_0x322f('0x34')],_0x358bab['query']);_0x503f04[_0x322f('0x39')]=_[_0x322f('0x3a')](_0x358bab['model'],qs[_0x322f('0x3b')](_0x2b3556[_0x322f('0x36')]['fields']));_0x503f04[_0x322f('0x39')]=_0x503f04['attributes'][_0x322f('0x49')]?_0x503f04[_0x322f('0x39')]:_0x358bab['model'];if(_0x2b3556[_0x322f('0x36')][_0x322f('0x43')]){_0x503f04[_0x322f('0x44')]=[{'all':!![]}];}_0x503f04=_[_0x322f('0x41')]({},_0x503f04,_0x2b3556[_0x322f('0x42')]);return db[_0x322f('0x30')][_0x322f('0x4a')](_0x503f04)['then'](handleEntityNotFound(_0x126d2d,null))[_0x322f('0x28')](respondWithResult(_0x126d2d,null))['catch'](handleError(_0x126d2d,null));};exports[_0x322f('0x27')]=function(_0x1e4bdc,_0x220b99){if(_0x1e4bdc['body']['id']){delete _0x1e4bdc['body']['id'];}return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x1e4bdc[_0x322f('0x48')]['id']}})[_0x322f('0x28')](handleEntityNotFound(_0x220b99,null))[_0x322f('0x28')](saveUpdates(_0x1e4bdc[_0x322f('0x4b')],null))['then'](respondWithResult(_0x220b99,null))[_0x322f('0x46')](handleError(_0x220b99,null));};exports[_0x322f('0x29')]=function(_0x29b876,_0x10ae12){return db[_0x322f('0x30')][_0x322f('0x4a')]({'where':{'id':_0x29b876['params']['id']}})['then'](handleEntityNotFound(_0x10ae12,null))[_0x322f('0x28')](removeEntity(_0x10ae12,null))['catch'](handleError(_0x10ae12,null));};exports['create']=function(_0x5bc13e,_0x198fa3){var _0x11b77b={'key':_0x5bc13e[_0x322f('0x4b')][_0x322f('0x33')]};if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4c')]){_0x11b77b[_0x322f('0x4c')]=_0x5bc13e[_0x322f('0x4b')]['MailAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')]){_0x11b77b[_0x322f('0x4d')]=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4d')];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4e')]){_0x11b77b[_0x322f('0x4e')]=_0x5bc13e['body']['OpenchannelAccountId'];}else if(_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')]){_0x11b77b['ChatWebsiteId']=_0x5bc13e[_0x322f('0x4b')][_0x322f('0x4f')];}return db['CannedAnswer'][_0x322f('0x4a')]({'where':_0x11b77b})['then'](function(_0x3b9e5c){if(_0x3b9e5c){throw new db[(_0x322f('0x50'))][(_0x322f('0x51'))](_0x322f('0x52'));}return db[_0x322f('0x30')][_0x322f('0x53')](_0x5bc13e['body']);})[_0x322f('0x28')](function(_0x34c816){var _0x4798e0=_0x5bc13e[_0x322f('0x54')]['get']({'plain':!![]});if(!_0x4798e0)throw new Error(_0x322f('0x55'));if(_0x4798e0[_0x322f('0x56')]===_0x322f('0x54')){var _0x28695a=_0x34c816['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x4798e0['userProfileId']},'raw':!![]})[_0x322f('0x28')](function(_0x20dd74){if(_0x20dd74&&_0x20dd74[_0x322f('0x57')]===0x0){return db[_0x322f('0x2c')][_0x322f('0x53')]({'name':_0x28695a['name'],'resourceId':_0x28695a['id'],'type':_0x20dd74[_0x322f('0x2f')],'sectionId':_0x20dd74['id']},{})['then'](function(){return _0x34c816;});}else{return _0x34c816;}})['catch'](function(_0x5e2269){logger[_0x322f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2269);throw _0x5e2269;});}return _0x34c816;})[_0x322f('0x28')](respondWithResult(_0x198fa3,0xc9))['catch'](handleError(_0x198fa3,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ff94f11..a5020c0 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 _0x1391=['bluebird','request-promise','path','./cannedAnswer.attributes','exports','define','CannedAnswer','util','moment'];(function(_0x2e62be,_0x27e972){var _0x4b113c=function(_0x14c1a1){while(--_0x14c1a1){_0x2e62be['push'](_0x2e62be['shift']());}};_0x4b113c(++_0x27e972);}(_0x1391,0xcd));var _0x1139=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1391[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x1139('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1139('0x1'));var BPromise=require(_0x1139('0x2'));var rp=require(_0x1139('0x3'));var fs=require('fs');var path=require(_0x1139('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1139('0x5'));module[_0x1139('0x6')]=function(_0x43ecaf,_0x42ea70){return _0x43ecaf[_0x1139('0x7')](_0x1139('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd0a9=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xd0a9,0x10b));var _0x9d0a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xd0a9[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x9d0a('0x0'));var logger=require(_0x9d0a('0x1'))(_0x9d0a('0x2'));var moment=require(_0x9d0a('0x3'));var BPromise=require(_0x9d0a('0x4'));var rp=require(_0x9d0a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9d0a('0x6'));var attributes=require(_0x9d0a('0x7'));module[_0x9d0a('0x8')]=function(_0x13e08f,_0x5c9aa3){return _0x13e08f['define'](_0x9d0a('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9d0a('0xa'),'collate':_0x9d0a('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index de48281..286fc0b 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(_0x567841,_0x43981d){var _0x60a14e=function(_0x14c12b){while(--_0x14c12b){_0x567841['push'](_0x567841['shift']());}};_0x60a14e(++_0x43981d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0xae0e9b,_0x209495){var _0x5dec3a=function(_0x5df799){while(--_0x5df799){_0xae0e9b['push'](_0xae0e9b['shift']());}};_0x5dec3a(++_0x209495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 da0cfb3..32ab53c 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 _0xbb64=['express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0xbb64,0xd6));var _0x4bb6=function(_0x3fe4bb,_0xf98f59){_0x3fe4bb=_0x3fe4bb-0x0;var _0x2e2a65=_0xbb64[_0x3fe4bb];return _0x2e2a65;};'use strict';var multer=require(_0x4bb6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4bb6('0x1'));var express=require(_0x4bb6('0x2'));var router=express[_0x4bb6('0x3')]();var fs_extra=require(_0x4bb6('0x4'));var auth=require(_0x4bb6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4bb6('0x6'));router[_0x4bb6('0x7')]('/',auth[_0x4bb6('0x8')](),controller[_0x4bb6('0x9')]);router[_0x4bb6('0x7')](_0x4bb6('0xa'),auth['isAuthenticated'](),controller[_0x4bb6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4bb6('0xc')]);router[_0x4bb6('0xd')]('/:id',auth[_0x4bb6('0x8')](),controller[_0x4bb6('0xe')]);router[_0x4bb6('0xf')](_0x4bb6('0xa'),auth[_0x4bb6('0x8')](),controller[_0x4bb6('0x10')]);module[_0x4bb6('0x11')]=router; \ No newline at end of file +var _0x3e28=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x4104f0,_0x489f33){var _0xe518fd=function(_0x6c75dd){while(--_0x6c75dd){_0x4104f0['push'](_0x4104f0['shift']());}};_0xe518fd(++_0x489f33);}(_0x3e28,0x142));var _0x83e2=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x3e28[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x83e2('0x0'));var util=require(_0x83e2('0x1'));var path=require(_0x83e2('0x2'));var timeout=require(_0x83e2('0x3'));var express=require('express');var router=express[_0x83e2('0x4')]();var fs_extra=require(_0x83e2('0x5'));var auth=require(_0x83e2('0x6'));var interaction=require(_0x83e2('0x7'));var config=require(_0x83e2('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xa')]);router['get'](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0xc')]);router[_0x83e2('0xd')]('/',auth[_0x83e2('0x9')](),controller[_0x83e2('0xe')]);router[_0x83e2('0xf')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x10')]);router[_0x83e2('0x11')](_0x83e2('0xb'),auth['isAuthenticated'](),controller[_0x83e2('0x12')]);module[_0x83e2('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a7f267a..5862f37 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 _0xc772=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc772,0x108));var _0x2c77=function(_0x4305f6,_0x433c71){_0x4305f6=_0x4305f6-0x0;var _0x2d4415=_0xc772[_0x4305f6];return _0x2d4415;};'use strict';var Sequelize=require(_0x2c77('0x0'));module[_0x2c77('0x1')]={'calldate':{'type':Sequelize[_0x2c77('0x2')],'allowNull':![],'defaultValue':_0x2c77('0x3')},'clid':{'type':Sequelize[_0x2c77('0x4')]},'src':{'type':Sequelize[_0x2c77('0x4')]},'dst':{'type':Sequelize[_0x2c77('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x2c77('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x2c77('0x4')]},'duration':{'type':Sequelize[_0x2c77('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x2c77('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2c77('0x4')]},'amaflags':{'type':Sequelize[_0x2c77('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x2c77('0x4')]},'userfield':{'type':Sequelize[_0x2c77('0x4')]},'uniqueid':{'type':Sequelize[_0x2c77('0x4')]},'linkedid':{'type':Sequelize[_0x2c77('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x2c77('0x4')]},'type':{'type':Sequelize[_0x2c77('0x4')]},'tag':{'type':Sequelize[_0x2c77('0x4')]}}; \ No newline at end of file +var _0xaf09=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2639fe,_0x508cb9){var _0x5148bd=function(_0x430192){while(--_0x430192){_0x2639fe['push'](_0x2639fe['shift']());}};_0x5148bd(++_0x508cb9);}(_0xaf09,0x10d));var _0x9af0=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xaf09[_0x4b26b5];return _0x4dec71;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'calldate':{'type':Sequelize[_0x9af0('0x2')],'allowNull':![],'defaultValue':_0x9af0('0x3')},'clid':{'type':Sequelize[_0x9af0('0x4')]},'src':{'type':Sequelize[_0x9af0('0x4')]},'dst':{'type':Sequelize[_0x9af0('0x4')]},'dcontext':{'type':Sequelize[_0x9af0('0x4')]},'channel':{'type':Sequelize[_0x9af0('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x9af0('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x9af0('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9af0('0x4')]},'linkedid':{'type':Sequelize[_0x9af0('0x4')]},'sequence':{'type':Sequelize[_0x9af0('0x4')]},'peeraccount':{'type':Sequelize[_0x9af0('0x4')]},'type':{'type':Sequelize[_0x9af0('0x4')]},'tag':{'type':Sequelize[_0x9af0('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ff45058..35681ce 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 _0x7579=['VIRTUAL','merge','options','includeAll','include','findAll','catch','show','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5a5a49,_0x21c835){var _0x35cba1=function(_0x4c3c82){while(--_0x4c3c82){_0x5a5a49['push'](_0x5a5a49['shift']());}};_0x35cba1(++_0x21c835);}(_0x7579,0x1e2));var _0x9757=function(_0x3bb314,_0x3a8b46){_0x3bb314=_0x3bb314-0x0;var _0x441f1f=_0x7579[_0x3bb314];return _0x441f1f;};'use strict';var emlformat=require(_0x9757('0x0'));var rimraf=require(_0x9757('0x1'));var zipdir=require(_0x9757('0x2'));var jsonpatch=require(_0x9757('0x3'));var rp=require(_0x9757('0x4'));var moment=require(_0x9757('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9757('0x6'));var util=require(_0x9757('0x7'));var path=require(_0x9757('0x8'));var sox=require(_0x9757('0x9'));var csv=require('to-csv');var ejs=require(_0x9757('0xa'));var fs=require('fs');var fs_extra=require(_0x9757('0xb'));var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xf'));var querystring=require(_0x9757('0x10'));var Papa=require('papaparse');var Redis=require(_0x9757('0x11'));var authService=require(_0x9757('0x12'));var qs=require(_0x9757('0x13'));var as=require(_0x9757('0x14'));var hardwareService=require(_0x9757('0x15'));var logger=require(_0x9757('0x16'))(_0x9757('0x17'));var utils=require(_0x9757('0x18'));var config=require(_0x9757('0x19'));var licenseUtil=require(_0x9757('0x1a'));var db=require(_0x9757('0x1b'))['db'];function respondWithStatusCode(_0x5c19c9,_0x2f2200){_0x2f2200=_0x2f2200||0xcc;return function(_0x1d32ee){if(_0x1d32ee){return _0x5c19c9[_0x9757('0x1c')](_0x2f2200);}return _0x5c19c9['status'](_0x2f2200)[_0x9757('0x1d')]();};}function respondWithResult(_0x39fa5c,_0x413d55){_0x413d55=_0x413d55||0xc8;return function(_0x14f67c){if(_0x14f67c){return _0x39fa5c[_0x9757('0x1e')](_0x413d55)[_0x9757('0x1f')](_0x14f67c);}};}function respondWithFilteredResult(_0x105e56,_0x4b994d){return function(_0x1fd6f6){if(_0x1fd6f6){var _0x55ded7=typeof _0x4b994d[_0x9757('0x20')]===_0x9757('0x21')&&typeof _0x4b994d[_0x9757('0x22')]===_0x9757('0x21');var _0x3f6be9=_0x1fd6f6[_0x9757('0x23')];var _0x57e309=_0x55ded7?0x0:_0x4b994d[_0x9757('0x20')];var _0x2aa360=_0x55ded7?_0x1fd6f6[_0x9757('0x23')]:_0x4b994d[_0x9757('0x20')]+_0x4b994d[_0x9757('0x22')];var _0xd2306b;if(_0x2aa360>=_0x3f6be9){_0x2aa360=_0x3f6be9;_0xd2306b=0xc8;}else{_0xd2306b=0xce;}_0x105e56[_0x9757('0x1e')](_0xd2306b);return _0x105e56['set'](_0x9757('0x24'),_0x57e309+'-'+_0x2aa360+'/'+_0x3f6be9)['json'](_0x1fd6f6);}return null;};}function patchUpdates(_0x517504){return function(_0x37c889){try{jsonpatch[_0x9757('0x25')](_0x37c889,_0x517504,!![]);}catch(_0x1443a9){return BPromise[_0x9757('0x26')](_0x1443a9);}return _0x37c889['save']();};}function saveUpdates(_0x4ef000,_0x53d21c){return function(_0x73dac4){if(_0x73dac4){return _0x73dac4[_0x9757('0x27')](_0x4ef000)[_0x9757('0x28')](function(_0x21435e){return _0x21435e;});}return null;};}function removeEntity(_0x5dc2fa,_0x11f5ac){return function(_0x160108){if(_0x160108){return _0x160108['destroy']()[_0x9757('0x28')](function(){_0x5dc2fa[_0x9757('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6915,_0x1a7036){return function(_0x172e8c){if(!_0x172e8c){_0x2b6915[_0x9757('0x1c')](0x194);}return _0x172e8c;};}function handleError(_0x115e33,_0x19588f){_0x19588f=_0x19588f||0x1f4;return function(_0x4e6b86){logger[_0x9757('0x29')](_0x4e6b86['stack']);if(_0x4e6b86[_0x9757('0x2a')]){delete _0x4e6b86[_0x9757('0x2a')];}_0x115e33['status'](_0x19588f)['send'](_0x4e6b86);};}exports[_0x9757('0x2b')]=function(_0x21a4bd,_0xc81976){var _0x3aae8b={},_0x4ebdb6={},_0x3dea3c={'count':0x0,'rows':[]};var _0xecf119=_[_0x9757('0x2c')](db[_0x9757('0x2d')][_0x9757('0x2e')],function(_0xa471a9){return{'name':_0xa471a9['fieldName'],'type':_0xa471a9[_0x9757('0x2f')][_0x9757('0x30')]};});_0x4ebdb6[_0x9757('0x31')]=_[_0x9757('0x2c')](_0xecf119,_0x9757('0x2a'));_0x4ebdb6[_0x9757('0x32')]=_[_0x9757('0x33')](_0x21a4bd['query']);_0x4ebdb6[_0x9757('0x34')]=_[_0x9757('0x35')](_0x4ebdb6[_0x9757('0x31')],_0x4ebdb6[_0x9757('0x32')]);_0x3aae8b[_0x9757('0x36')]=_[_0x9757('0x35')](_0x4ebdb6[_0x9757('0x31')],qs[_0x9757('0x37')](_0x21a4bd['query'][_0x9757('0x37')]));_0x3aae8b['attributes']=_0x3aae8b[_0x9757('0x36')][_0x9757('0x38')]?_0x3aae8b['attributes']:_0x4ebdb6[_0x9757('0x31')];if(!_0x21a4bd[_0x9757('0x32')][_0x9757('0x39')](_0x9757('0x3a'))){_0x3aae8b[_0x9757('0x22')]=qs[_0x9757('0x22')](_0x21a4bd[_0x9757('0x32')][_0x9757('0x22')]);_0x3aae8b[_0x9757('0x20')]=qs[_0x9757('0x20')](_0x21a4bd['query'][_0x9757('0x20')]);}_0x3aae8b[_0x9757('0x3b')]=qs[_0x9757('0x3c')](_0x21a4bd['query'][_0x9757('0x3c')]);_0x3aae8b[_0x9757('0x3d')]=qs[_0x9757('0x34')](_[_0x9757('0x3e')](_0x21a4bd[_0x9757('0x32')],_0x4ebdb6[_0x9757('0x34')]),_0xecf119);if(_0x21a4bd[_0x9757('0x32')][_0x9757('0x3f')]){_0x3aae8b[_0x9757('0x3d')]=_['merge'](_0x3aae8b['where'],{'$or':_[_0x9757('0x2c')](_0xecf119,function(_0x2d0a6e){if(_0x2d0a6e[_0x9757('0x2f')]!==_0x9757('0x40')){var _0x4f779b={};_0x4f779b[_0x2d0a6e[_0x9757('0x2a')]]={'$like':'%'+_0x21a4bd['query'][_0x9757('0x3f')]+'%'};return _0x4f779b;}})});}_0x3aae8b=_[_0x9757('0x41')]({},_0x3aae8b,_0x21a4bd[_0x9757('0x42')]);var _0x59f7ca={'where':_0x3aae8b[_0x9757('0x3d')]};return db[_0x9757('0x2d')][_0x9757('0x23')](_0x59f7ca)['then'](function(_0x37b223){_0x3dea3c['count']=_0x37b223;if(_0x21a4bd['query'][_0x9757('0x43')]){_0x3aae8b[_0x9757('0x44')]=[{'all':!![]}];}return db[_0x9757('0x2d')][_0x9757('0x45')](_0x3aae8b);})[_0x9757('0x28')](function(_0x4f30db){_0x3dea3c['rows']=_0x4f30db;return _0x3dea3c;})['then'](respondWithFilteredResult(_0xc81976,_0x3aae8b))[_0x9757('0x46')](handleError(_0xc81976,null));};exports[_0x9757('0x47')]=function(_0x23fd63,_0x596d57){var _0x2e0985={'raw':!![],'where':{'id':_0x23fd63['params']['id']}},_0x1763cd={};_0x1763cd[_0x9757('0x31')]=_[_0x9757('0x33')](db[_0x9757('0x2d')][_0x9757('0x2e')]);_0x1763cd['query']=_[_0x9757('0x33')](_0x23fd63[_0x9757('0x32')]);_0x1763cd[_0x9757('0x34')]=_[_0x9757('0x35')](_0x1763cd[_0x9757('0x31')],_0x1763cd[_0x9757('0x32')]);_0x2e0985[_0x9757('0x36')]=_[_0x9757('0x35')](_0x1763cd[_0x9757('0x31')],qs['fields'](_0x23fd63['query'][_0x9757('0x37')]));_0x2e0985[_0x9757('0x36')]=_0x2e0985[_0x9757('0x36')]['length']?_0x2e0985[_0x9757('0x36')]:_0x1763cd[_0x9757('0x31')];if(_0x23fd63[_0x9757('0x32')]['includeAll']){_0x2e0985[_0x9757('0x44')]=[{'all':!![]}];}_0x2e0985=_[_0x9757('0x41')]({},_0x2e0985,_0x23fd63['options']);return db['Cdr']['find'](_0x2e0985)[_0x9757('0x28')](handleEntityNotFound(_0x596d57,null))[_0x9757('0x28')](respondWithResult(_0x596d57,null))[_0x9757('0x46')](handleError(_0x596d57,null));};exports['create']=function(_0x279295,_0x5aaadf){return db[_0x9757('0x2d')][_0x9757('0x48')](_0x279295['body'],{})[_0x9757('0x28')](respondWithResult(_0x5aaadf,0xc9))[_0x9757('0x46')](handleError(_0x5aaadf,null));};exports[_0x9757('0x27')]=function(_0x4487a4,_0x118d02){if(_0x4487a4['body']['id']){delete _0x4487a4[_0x9757('0x49')]['id'];}return db[_0x9757('0x2d')][_0x9757('0x4a')]({'where':{'id':_0x4487a4[_0x9757('0x4b')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x118d02,null))[_0x9757('0x28')](saveUpdates(_0x4487a4[_0x9757('0x49')],null))['then'](respondWithResult(_0x118d02,null))['catch'](handleError(_0x118d02,null));};exports[_0x9757('0x4c')]=function(_0x496a8a,_0x53c910){return db[_0x9757('0x2d')]['find']({'where':{'id':_0x496a8a[_0x9757('0x4b')]['id']}})[_0x9757('0x28')](handleEntityNotFound(_0x53c910,null))['then'](removeEntity(_0x53c910,null))['catch'](handleError(_0x53c910,null));};exports[_0x9757('0x4d')]=function(_0x502321,_0x428b77){return db['Cdr'][_0x9757('0x4d')]()['then'](respondWithResult(_0x428b77,null))[_0x9757('0x46')](handleError(_0x428b77,null));}; \ No newline at end of file +var _0x79a8=['reject','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x79a8,0x1d0));var _0x879a=function(_0x2ebd68,_0x10e9cc){_0x2ebd68=_0x2ebd68-0x0;var _0x2e68d5=_0x79a8[_0x2ebd68];return _0x2e68d5;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var licenseUtil=require(_0x879a('0x15'));var db=require(_0x879a('0x16'))['db'];function respondWithStatusCode(_0x320115,_0x54a9b6){_0x54a9b6=_0x54a9b6||0xcc;return function(_0x4738b4){if(_0x4738b4){return _0x320115[_0x879a('0x17')](_0x54a9b6);}return _0x320115[_0x879a('0x18')](_0x54a9b6)[_0x879a('0x19')]();};}function respondWithResult(_0x1a20c5,_0x1c2853){_0x1c2853=_0x1c2853||0xc8;return function(_0x461f1e){if(_0x461f1e){return _0x1a20c5[_0x879a('0x18')](_0x1c2853)[_0x879a('0x1a')](_0x461f1e);}};}function respondWithFilteredResult(_0x16b649,_0x5b4dbe){return function(_0x4a1e0e){if(_0x4a1e0e){var _0x3b8680=typeof _0x5b4dbe[_0x879a('0x1b')]==='undefined'&&typeof _0x5b4dbe[_0x879a('0x1c')]===_0x879a('0x1d');var _0x149105=_0x4a1e0e[_0x879a('0x1e')];var _0x32d9f5=_0x3b8680?0x0:_0x5b4dbe[_0x879a('0x1b')];var _0x4160bd=_0x3b8680?_0x4a1e0e[_0x879a('0x1e')]:_0x5b4dbe[_0x879a('0x1b')]+_0x5b4dbe[_0x879a('0x1c')];var _0x14241a;if(_0x4160bd>=_0x149105){_0x4160bd=_0x149105;_0x14241a=0xc8;}else{_0x14241a=0xce;}_0x16b649[_0x879a('0x18')](_0x14241a);return _0x16b649[_0x879a('0x1f')](_0x879a('0x20'),_0x32d9f5+'-'+_0x4160bd+'/'+_0x149105)['json'](_0x4a1e0e);}return null;};}function patchUpdates(_0x830b36){return function(_0x326e6a){try{jsonpatch['apply'](_0x326e6a,_0x830b36,!![]);}catch(_0x25a57d){return BPromise[_0x879a('0x21')](_0x25a57d);}return _0x326e6a['save']();};}function saveUpdates(_0x56e394,_0x4ed0d6){return function(_0x28c401){if(_0x28c401){return _0x28c401[_0x879a('0x22')](_0x56e394)[_0x879a('0x23')](function(_0x38d42c){return _0x38d42c;});}return null;};}function removeEntity(_0x4c3808,_0x5c21e2){return function(_0x3674f9){if(_0x3674f9){return _0x3674f9[_0x879a('0x24')]()[_0x879a('0x23')](function(){_0x4c3808[_0x879a('0x18')](0xcc)[_0x879a('0x19')]();});}};}function handleEntityNotFound(_0x1dd818,_0x7d67ed){return function(_0x14213c){if(!_0x14213c){_0x1dd818[_0x879a('0x17')](0x194);}return _0x14213c;};}function handleError(_0x2ee375,_0x272bf9){_0x272bf9=_0x272bf9||0x1f4;return function(_0x3510cc){logger[_0x879a('0x25')](_0x3510cc['stack']);if(_0x3510cc[_0x879a('0x26')]){delete _0x3510cc[_0x879a('0x26')];}_0x2ee375[_0x879a('0x18')](_0x272bf9)[_0x879a('0x27')](_0x3510cc);};}exports[_0x879a('0x28')]=function(_0x3030e0,_0x3ef6c1){var _0x2d9ed3={},_0x3ca5cd={},_0x1b6c15={'count':0x0,'rows':[]};var _0x2605e9=_[_0x879a('0x29')](db[_0x879a('0x2a')][_0x879a('0x2b')],function(_0x99559){return{'name':_0x99559[_0x879a('0x2c')],'type':_0x99559[_0x879a('0x2d')][_0x879a('0x2e')]};});_0x3ca5cd['model']=_[_0x879a('0x29')](_0x2605e9,'name');_0x3ca5cd[_0x879a('0x2f')]=_[_0x879a('0x30')](_0x3030e0[_0x879a('0x2f')]);_0x3ca5cd['filters']=_[_0x879a('0x31')](_0x3ca5cd['model'],_0x3ca5cd['query']);_0x2d9ed3['attributes']=_['intersection'](_0x3ca5cd[_0x879a('0x32')],qs[_0x879a('0x33')](_0x3030e0['query'][_0x879a('0x33')]));_0x2d9ed3[_0x879a('0x34')]=_0x2d9ed3[_0x879a('0x34')]['length']?_0x2d9ed3[_0x879a('0x34')]:_0x3ca5cd[_0x879a('0x32')];if(!_0x3030e0[_0x879a('0x2f')][_0x879a('0x35')]('nolimit')){_0x2d9ed3[_0x879a('0x1c')]=qs[_0x879a('0x1c')](_0x3030e0[_0x879a('0x2f')][_0x879a('0x1c')]);_0x2d9ed3['offset']=qs[_0x879a('0x1b')](_0x3030e0['query'][_0x879a('0x1b')]);}_0x2d9ed3['order']=qs[_0x879a('0x36')](_0x3030e0[_0x879a('0x2f')]['sort']);_0x2d9ed3[_0x879a('0x37')]=qs[_0x879a('0x38')](_[_0x879a('0x39')](_0x3030e0[_0x879a('0x2f')],_0x3ca5cd['filters']),_0x2605e9);if(_0x3030e0[_0x879a('0x2f')][_0x879a('0x3a')]){_0x2d9ed3[_0x879a('0x37')]=_['merge'](_0x2d9ed3['where'],{'$or':_['map'](_0x2605e9,function(_0x5de17f){if(_0x5de17f['type']!==_0x879a('0x3b')){var _0x142bdc={};_0x142bdc[_0x5de17f[_0x879a('0x26')]]={'$like':'%'+_0x3030e0['query']['filter']+'%'};return _0x142bdc;}})});}_0x2d9ed3=_['merge']({},_0x2d9ed3,_0x3030e0[_0x879a('0x3c')]);var _0x5597f9={'where':_0x2d9ed3[_0x879a('0x37')]};return db[_0x879a('0x2a')][_0x879a('0x1e')](_0x5597f9)['then'](function(_0x4f9681){_0x1b6c15[_0x879a('0x1e')]=_0x4f9681;if(_0x3030e0['query'][_0x879a('0x3d')]){_0x2d9ed3[_0x879a('0x3e')]=[{'all':!![]}];}return db['Cdr'][_0x879a('0x3f')](_0x2d9ed3);})[_0x879a('0x23')](function(_0x2cc43c){_0x1b6c15['rows']=_0x2cc43c;return _0x1b6c15;})[_0x879a('0x23')](respondWithFilteredResult(_0x3ef6c1,_0x2d9ed3))[_0x879a('0x40')](handleError(_0x3ef6c1,null));};exports['show']=function(_0x7d99a0,_0x2456a4){var _0x4dedfe={'raw':!![],'where':{'id':_0x7d99a0[_0x879a('0x41')]['id']}},_0x14f8e7={};_0x14f8e7[_0x879a('0x32')]=_[_0x879a('0x30')](db['Cdr'][_0x879a('0x2b')]);_0x14f8e7['query']=_[_0x879a('0x30')](_0x7d99a0['query']);_0x14f8e7[_0x879a('0x38')]=_['intersection'](_0x14f8e7[_0x879a('0x32')],_0x14f8e7[_0x879a('0x2f')]);_0x4dedfe[_0x879a('0x34')]=_[_0x879a('0x31')](_0x14f8e7[_0x879a('0x32')],qs[_0x879a('0x33')](_0x7d99a0['query'][_0x879a('0x33')]));_0x4dedfe[_0x879a('0x34')]=_0x4dedfe[_0x879a('0x34')]['length']?_0x4dedfe[_0x879a('0x34')]:_0x14f8e7[_0x879a('0x32')];if(_0x7d99a0[_0x879a('0x2f')]['includeAll']){_0x4dedfe[_0x879a('0x3e')]=[{'all':!![]}];}_0x4dedfe=_[_0x879a('0x42')]({},_0x4dedfe,_0x7d99a0[_0x879a('0x3c')]);return db[_0x879a('0x2a')]['find'](_0x4dedfe)['then'](handleEntityNotFound(_0x2456a4,null))[_0x879a('0x23')](respondWithResult(_0x2456a4,null))[_0x879a('0x40')](handleError(_0x2456a4,null));};exports['create']=function(_0x2ff7cd,_0x4420ac){return db['Cdr'][_0x879a('0x43')](_0x2ff7cd[_0x879a('0x44')],{})[_0x879a('0x23')](respondWithResult(_0x4420ac,0xc9))[_0x879a('0x40')](handleError(_0x4420ac,null));};exports['update']=function(_0x3ffbe6,_0x32933f){if(_0x3ffbe6[_0x879a('0x44')]['id']){delete _0x3ffbe6['body']['id'];}return db['Cdr'][_0x879a('0x45')]({'where':{'id':_0x3ffbe6[_0x879a('0x41')]['id']}})['then'](handleEntityNotFound(_0x32933f,null))[_0x879a('0x23')](saveUpdates(_0x3ffbe6[_0x879a('0x44')],null))[_0x879a('0x23')](respondWithResult(_0x32933f,null))['catch'](handleError(_0x32933f,null));};exports[_0x879a('0x24')]=function(_0x677418,_0xc1c234){return db[_0x879a('0x2a')]['find']({'where':{'id':_0x677418[_0x879a('0x41')]['id']}})[_0x879a('0x23')](handleEntityNotFound(_0xc1c234,null))['then'](removeEntity(_0xc1c234,null))[_0x879a('0x40')](handleError(_0xc1c234,null));};exports[_0x879a('0x46')]=function(_0x59ff36,_0x51644c){return db[_0x879a('0x2a')]['describe']()['then'](respondWithResult(_0x51644c,null))[_0x879a('0x40')](handleError(_0x51644c,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 81ef768..9c2d328 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xd6dcf3,_0x26ffa4){var _0x4bfb7d=function(_0x3ad013){while(--_0x3ad013){_0xd6dcf3['push'](_0xd6dcf3['shift']());}};_0x4bfb7d(++_0x26ffa4);}(_0x7a54,0x106));var _0x47a5=function(_0xee2a7,_0x38b248){_0xee2a7=_0xee2a7-0x0;var _0x93c838=_0x7a54[_0xee2a7];return _0x93c838;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x801484,_0x184262){var _0x2ecd18=function(_0x4ee805){while(--_0x4ee805){_0x801484['push'](_0x801484['shift']());}};_0x2ecd18(++_0x184262);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 9b4bb2f..ca2345c 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 _0x019f=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x019f,0xfc));var _0xf019=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x019f[_0x1f3aec];return _0x409f0d;};'use strict';var _=require('lodash');var util=require(_0xf019('0x0'));var moment=require('moment');var BPromise=require(_0xf019('0x1'));var rs=require(_0xf019('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf019('0x3'));var logger=require(_0xf019('0x4'))(_0xf019('0x5'));var config=require('../../config/environment');var jayson=require(_0xf019('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdaeeb4,_0xafdd66,_0x14b502){return new BPromise(function(_0x5a360d,_0x1ac0bb){return client[_0xf019('0x7')](_0xdaeeb4,_0x14b502)['then'](function(_0x3514ba){logger[_0xf019('0x8')](_0xf019('0x9'),_0xafdd66,_0xf019('0xa'));logger[_0xf019('0xb')]('Cdr,\x20%s,\x20%s,\x20%s',_0xafdd66,_0xf019('0xa'),JSON['stringify'](_0x3514ba));if(_0x3514ba[_0xf019('0xc')]){if(_0x3514ba[_0xf019('0xc')]['code']===0x1f4){logger[_0xf019('0xc')](_0xf019('0x9'),_0xafdd66,_0x3514ba[_0xf019('0xc')][_0xf019('0xd')]);return _0x1ac0bb(_0x3514ba[_0xf019('0xc')][_0xf019('0xd')]);}logger[_0xf019('0xc')](_0xf019('0x9'),_0xafdd66,_0x3514ba['error'][_0xf019('0xd')]);return _0x5a360d(_0x3514ba[_0xf019('0xc')][_0xf019('0xd')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0xafdd66,_0xf019('0xa'));_0x5a360d(_0x3514ba['result'][_0xf019('0xd')]);}})['catch'](function(_0x2aacc9){logger['error']('Cdr,\x20%s,\x20%s',_0xafdd66,_0x2aacc9);_0x1ac0bb(_0x2aacc9);});});} \ No newline at end of file +var _0x459f=['error','code','message','Cdr,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x459f,0x1e8));var _0xf459=function(_0x5f0746,_0x88ab3d){_0x5f0746=_0x5f0746-0x0;var _0x573949=_0x459f[_0x5f0746];return _0x573949;};'use strict';var _=require(_0xf459('0x0'));var util=require(_0xf459('0x1'));var moment=require(_0xf459('0x2'));var BPromise=require(_0xf459('0x3'));var rs=require(_0xf459('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf459('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf459('0x6'));var jayson=require(_0xf459('0x7'));var client=jayson[_0xf459('0x8')][_0xf459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x363157,_0x3cd829,_0x3a989e){return new BPromise(function(_0x5ba229,_0x28a153){return client[_0xf459('0xa')](_0x363157,_0x3a989e)[_0xf459('0xb')](function(_0x599c50){logger[_0xf459('0xc')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0xf459('0xd'));logger[_0xf459('0xe')](_0xf459('0xf'),_0x3cd829,'request\x20sent',JSON['stringify'](_0x599c50));if(_0x599c50[_0xf459('0x10')]){if(_0x599c50[_0xf459('0x10')][_0xf459('0x11')]===0x1f4){logger[_0xf459('0x10')]('Cdr,\x20%s,\x20%s',_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x28a153(_0x599c50[_0xf459('0x10')][_0xf459('0x12')]);}logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x599c50[_0xf459('0x10')]['message']);return _0x5ba229(_0x599c50['error'][_0xf459('0x12')]);}else{logger['info'](_0xf459('0x13'),_0x3cd829,_0xf459('0xd'));_0x5ba229(_0x599c50[_0xf459('0x14')][_0xf459('0x12')]);}})['catch'](function(_0x2288ec){logger[_0xf459('0x10')](_0xf459('0x13'),_0x3cd829,_0x2288ec);_0x28a153(_0x2288ec);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 9812bbc..8fefaea 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(_0x3bd93d,_0x49393d){var _0x4c8680=function(_0x2f4fa6){while(--_0x2f4fa6){_0x3bd93d['push'](_0x3bd93d['shift']());}};_0x4c8680(++_0x49393d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19f727,_0x28224e){var _0x412836=function(_0x40634f){while(--_0x40634f){_0x19f727['push'](_0x19f727['shift']());}};_0x412836(++_0x28224e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 47d6b37..68ff948 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 _0x0be2=['exports','STRING','noop','*,*,*,*'];(function(_0x35d4fa,_0x5ece58){var _0xece0ba=function(_0x59278c){while(--_0x59278c){_0x35d4fa['push'](_0x35d4fa['shift']());}};_0xece0ba(++_0x5ece58);}(_0x0be2,0x198));var _0x20be=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x0be2[_0x3c4dad];return _0x1a4f49;};'use strict';var Sequelize=require('sequelize');module[_0x20be('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x20be('0x1')],'allowNull':![],'defaultValue':_0x20be('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x20be('0x1')]},'interval':{'type':Sequelize[_0x20be('0x1')],'defaultValue':_0x20be('0x3')}}; \ No newline at end of file +var _0x278a=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x278a,0x90));var _0xa278=function(_0x37c900,_0x363707){_0x37c900=_0x37c900-0x0;var _0x85741f=_0x278a[_0x37c900];return _0x85741f;};'use strict';var Sequelize=require('sequelize');module[_0xa278('0x0')]={'priority':{'type':Sequelize[_0xa278('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa278('0x2')],'allowNull':![],'defaultValue':_0xa278('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa278('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 3133e8c..9c6e455 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 _0x3c2c=['params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','length','includeAll','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','show'];(function(_0x3f3026,_0x35d62a){var _0x4e87bf=function(_0x174109){while(--_0x174109){_0x3f3026['push'](_0x3f3026['shift']());}};_0x4e87bf(++_0x35d62a);}(_0x3c2c,0x160));var _0xc3c2=function(_0x554590,_0x4cede1){_0x554590=_0x554590-0x0;var _0x461631=_0x3c2c[_0x554590];return _0x461631;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){_0x3287a3[_0xc3c2('0x16')](0xcc)[_0xc3c2('0x22')]();});}};}function handleEntityNotFound(_0x26aacc,_0x38d0b9){return function(_0x15f5f9){if(!_0x15f5f9){_0x26aacc[_0xc3c2('0x23')](0x194);}return _0x15f5f9;};}function handleError(_0x978056,_0x4b6504){_0x4b6504=_0x4b6504||0x1f4;return function(_0x48fa15){logger['error'](_0x48fa15[_0xc3c2('0x24')]);if(_0x48fa15[_0xc3c2('0x25')]){delete _0x48fa15[_0xc3c2('0x25')];}_0x978056['status'](_0x4b6504)[_0xc3c2('0x26')](_0x48fa15);};}exports[_0xc3c2('0x27')]=function(_0x2dc9ec,_0x2bc3b7){var _0x7686ac={'raw':!![],'where':{'id':_0x2dc9ec[_0xc3c2('0x28')]['id']}},_0x166f8e={};_0x166f8e[_0xc3c2('0x29')]=_['keys'](db[_0xc3c2('0x2a')][_0xc3c2('0x2b')]);_0x166f8e[_0xc3c2('0x2c')]=_[_0xc3c2('0x2d')](_0x2dc9ec[_0xc3c2('0x2c')]);_0x166f8e[_0xc3c2('0x2e')]=_['intersection'](_0x166f8e['model'],_0x166f8e[_0xc3c2('0x2c')]);_0x7686ac['attributes']=_[_0xc3c2('0x2f')](_0x166f8e[_0xc3c2('0x29')],qs[_0xc3c2('0x30')](_0x2dc9ec['query']['fields']));_0x7686ac['attributes']=_0x7686ac['attributes'][_0xc3c2('0x31')]?_0x7686ac['attributes']:_0x166f8e[_0xc3c2('0x29')];if(_0x2dc9ec['query'][_0xc3c2('0x32')]){_0x7686ac['include']=[{'all':!![]}];}_0x7686ac=_['merge']({},_0x7686ac,_0x2dc9ec[_0xc3c2('0x33')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x34')](_0x7686ac)[_0xc3c2('0x35')](handleEntityNotFound(_0x2bc3b7,null))[_0xc3c2('0x35')](respondWithResult(_0x2bc3b7,null))[_0xc3c2('0x36')](handleError(_0x2bc3b7,null));};exports[_0xc3c2('0x20')]=function(_0x434430,_0x3ee2ee){if(_0x434430['body']['id']){delete _0x434430['body']['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x34')]({'where':{'id':_0x434430[_0xc3c2('0x28')]['id']}})[_0xc3c2('0x35')](handleEntityNotFound(_0x3ee2ee,null))[_0xc3c2('0x35')](saveUpdates(_0x434430[_0xc3c2('0x37')],null))['then'](respondWithResult(_0x3ee2ee,null))[_0xc3c2('0x36')](handleError(_0x3ee2ee,null));};exports['destroy']=function(_0x2278fa,_0x227dfb){return db['ChatApplication'][_0xc3c2('0x34')]({'where':{'id':_0x2278fa[_0xc3c2('0x28')]['id']}})['then'](handleEntityNotFound(_0x227dfb,null))[_0xc3c2('0x35')](removeEntity(_0x227dfb,null))[_0xc3c2('0x36')](handleError(_0x227dfb,null));}; \ No newline at end of file +var _0x3ae9=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','show','params','model','query','filters','attributes','intersection','fields','length','includeAll','include','merge','ChatApplication','catch','body','find','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x16eadc,_0x3fc953){var _0x5b05c8=function(_0xd8b9cf){while(--_0xd8b9cf){_0x16eadc['push'](_0x16eadc['shift']());}};_0x5b05c8(++_0x3fc953);}(_0x3ae9,0xdb));var _0x93ae=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3ae9[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var hardwareService=require(_0x93ae('0x11'));var logger=require(_0x93ae('0x12'))(_0x93ae('0x13'));var utils=require(_0x93ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93ae('0x15'))['db'];function respondWithStatusCode(_0x1a23a3,_0x4a9f52){_0x4a9f52=_0x4a9f52||0xcc;return function(_0x571e5f){if(_0x571e5f){return _0x1a23a3[_0x93ae('0x16')](_0x4a9f52);}return _0x1a23a3['status'](_0x4a9f52)[_0x93ae('0x17')]();};}function respondWithResult(_0xbaf0e,_0x5b4ea1){_0x5b4ea1=_0x5b4ea1||0xc8;return function(_0x392a55){if(_0x392a55){return _0xbaf0e[_0x93ae('0x18')](_0x5b4ea1)[_0x93ae('0x19')](_0x392a55);}};}function respondWithFilteredResult(_0x1f8aa2,_0x121937){return function(_0x2d1df5){if(_0x2d1df5){var _0x5ed82a=typeof _0x121937[_0x93ae('0x1a')]===_0x93ae('0x1b')&&typeof _0x121937[_0x93ae('0x1c')]==='undefined';var _0x1a1718=_0x2d1df5['count'];var _0x54cfd0=_0x5ed82a?0x0:_0x121937[_0x93ae('0x1a')];var _0x51c77d=_0x5ed82a?_0x2d1df5[_0x93ae('0x1d')]:_0x121937[_0x93ae('0x1a')]+_0x121937['limit'];var _0x2dd19a;if(_0x51c77d>=_0x1a1718){_0x51c77d=_0x1a1718;_0x2dd19a=0xc8;}else{_0x2dd19a=0xce;}_0x1f8aa2[_0x93ae('0x18')](_0x2dd19a);return _0x1f8aa2[_0x93ae('0x1e')](_0x93ae('0x1f'),_0x54cfd0+'-'+_0x51c77d+'/'+_0x1a1718)['json'](_0x2d1df5);}return null;};}function patchUpdates(_0x128913){return function(_0x2f4187){try{jsonpatch['apply'](_0x2f4187,_0x128913,!![]);}catch(_0x3e0407){return BPromise[_0x93ae('0x20')](_0x3e0407);}return _0x2f4187[_0x93ae('0x21')]();};}function saveUpdates(_0x29922f,_0x26d5ac){return function(_0x468fdf){if(_0x468fdf){return _0x468fdf[_0x93ae('0x22')](_0x29922f)['then'](function(_0x5e7c32){return _0x5e7c32;});}return null;};}function removeEntity(_0xd33af5,_0x283e50){return function(_0x4f9f43){if(_0x4f9f43){return _0x4f9f43['destroy']()[_0x93ae('0x23')](function(){_0xd33af5[_0x93ae('0x18')](0xcc)[_0x93ae('0x17')]();});}};}function handleEntityNotFound(_0x10f6a3,_0x1abea7){return function(_0xe17086){if(!_0xe17086){_0x10f6a3[_0x93ae('0x16')](0x194);}return _0xe17086;};}function handleError(_0x32ddca,_0x542656){_0x542656=_0x542656||0x1f4;return function(_0x564c15){logger['error'](_0x564c15[_0x93ae('0x24')]);if(_0x564c15[_0x93ae('0x25')]){delete _0x564c15[_0x93ae('0x25')];}_0x32ddca[_0x93ae('0x18')](_0x542656)[_0x93ae('0x26')](_0x564c15);};}exports[_0x93ae('0x27')]=function(_0x520d6d,_0x54a37b){var _0x223f42={'raw':!![],'where':{'id':_0x520d6d[_0x93ae('0x28')]['id']}},_0x115ac5={};_0x115ac5[_0x93ae('0x29')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x115ac5[_0x93ae('0x2a')]=_['keys'](_0x520d6d[_0x93ae('0x2a')]);_0x115ac5[_0x93ae('0x2b')]=_['intersection'](_0x115ac5[_0x93ae('0x29')],_0x115ac5[_0x93ae('0x2a')]);_0x223f42[_0x93ae('0x2c')]=_[_0x93ae('0x2d')](_0x115ac5[_0x93ae('0x29')],qs[_0x93ae('0x2e')](_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x2e')]));_0x223f42['attributes']=_0x223f42[_0x93ae('0x2c')][_0x93ae('0x2f')]?_0x223f42[_0x93ae('0x2c')]:_0x115ac5[_0x93ae('0x29')];if(_0x520d6d[_0x93ae('0x2a')][_0x93ae('0x30')]){_0x223f42[_0x93ae('0x31')]=[{'all':!![]}];}_0x223f42=_[_0x93ae('0x32')]({},_0x223f42,_0x520d6d['options']);return db[_0x93ae('0x33')]['find'](_0x223f42)[_0x93ae('0x23')](handleEntityNotFound(_0x54a37b,null))[_0x93ae('0x23')](respondWithResult(_0x54a37b,null))[_0x93ae('0x34')](handleError(_0x54a37b,null));};exports[_0x93ae('0x22')]=function(_0x1778f7,_0x46ade5){if(_0x1778f7['body']['id']){delete _0x1778f7[_0x93ae('0x35')]['id'];}return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x1778f7['params']['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x46ade5,null))[_0x93ae('0x23')](saveUpdates(_0x1778f7[_0x93ae('0x35')],null))['then'](respondWithResult(_0x46ade5,null))['catch'](handleError(_0x46ade5,null));};exports[_0x93ae('0x37')]=function(_0x266126,_0x31e9b0){return db[_0x93ae('0x33')][_0x93ae('0x36')]({'where':{'id':_0x266126[_0x93ae('0x28')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x31e9b0,null))[_0x93ae('0x23')](removeEntity(_0x31e9b0,null))[_0x93ae('0x34')](handleError(_0x31e9b0,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9051f53..d5a7d1a 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 _0x9bee=['exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes'];(function(_0x539932,_0x56f147){var _0x20c961=function(_0x36adb8){while(--_0x36adb8){_0x539932['push'](_0x539932['shift']());}};_0x20c961(++_0x56f147);}(_0x9bee,0xf4));var _0xe9be=function(_0x4988d1,_0x11ce15){_0x4988d1=_0x4988d1-0x0;var _0x6640a7=_0x9bee[_0x4988d1];return _0x6640a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9be('0x0'))(_0xe9be('0x1'));var moment=require('moment');var BPromise=require(_0xe9be('0x2'));var rp=require(_0xe9be('0x3'));var fs=require('fs');var path=require(_0xe9be('0x4'));var rimraf=require(_0xe9be('0x5'));var config=require(_0xe9be('0x6'));var attributes=require(_0xe9be('0x7'));module[_0xe9be('0x8')]=function(_0x1d5c7a,_0x5bbaad){return _0x1d5c7a[_0xe9be('0x9')](_0xe9be('0xa'),attributes,{'tableName':_0xe9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe9be('0xc'),'collate':_0xe9be('0xd')});}; \ No newline at end of file +var _0x8743=['bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8743,0xa3));var _0x3874=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x8743[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var logger=require(_0x3874('0x2'))(_0x3874('0x3'));var moment=require(_0x3874('0x4'));var BPromise=require(_0x3874('0x5'));var rp=require(_0x3874('0x6'));var fs=require('fs');var path=require(_0x3874('0x7'));var rimraf=require(_0x3874('0x8'));var config=require('../../config/environment');var attributes=require(_0x3874('0x9'));module[_0x3874('0xa')]=function(_0x1de2f9,_0x4fd2de){return _0x1de2f9[_0x3874('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3874('0xc'),'collate':_0x3874('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d24e8c1..5640d0b 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 _0xe2b1=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2fb6fa,_0x447166){var _0x558b8a=function(_0x365641){while(--_0x365641){_0x2fb6fa['push'](_0x2fb6fa['shift']());}};_0x558b8a(++_0x447166);}(_0xe2b1,0x13d));var _0x1e2b=function(_0x587dee,_0x10f017){_0x587dee=_0x587dee-0x0;var _0x17d827=_0xe2b1[_0x587dee];return _0x17d827;};'use strict';var _=require(_0x1e2b('0x0'));var util=require(_0x1e2b('0x1'));var moment=require(_0x1e2b('0x2'));var BPromise=require(_0x1e2b('0x3'));var rs=require(_0x1e2b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e2b('0x5'))['db'];var utils=require(_0x1e2b('0x6'));var logger=require('../../config/logger')(_0x1e2b('0x7'));var config=require(_0x1e2b('0x8'));var jayson=require(_0x1e2b('0x9'));var client=jayson[_0x1e2b('0xa')][_0x1e2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e81e7,_0x353334,_0x24a5d5){return new BPromise(function(_0x3c0832,_0x21bb06){return client[_0x1e2b('0xc')](_0x3e81e7,_0x24a5d5)['then'](function(_0x4e86c5){logger[_0x1e2b('0xd')](_0x1e2b('0xe'),_0x353334,_0x1e2b('0xf'));logger[_0x1e2b('0x10')](_0x1e2b('0x11'),_0x353334,_0x1e2b('0xf'),JSON[_0x1e2b('0x12')](_0x4e86c5));if(_0x4e86c5['error']){if(_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x14')]===0x1f4){logger[_0x1e2b('0x13')]('ChatApplication,\x20%s,\x20%s',_0x353334,_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x15')]);return _0x21bb06(_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x15')]);}logger[_0x1e2b('0x13')](_0x1e2b('0xe'),_0x353334,_0x4e86c5['error'][_0x1e2b('0x15')]);return _0x3c0832(_0x4e86c5[_0x1e2b('0x13')][_0x1e2b('0x15')]);}else{logger[_0x1e2b('0xd')]('ChatApplication,\x20%s,\x20%s',_0x353334,_0x1e2b('0xf'));_0x3c0832(_0x4e86c5['result']['message']);}})[_0x1e2b('0x16')](function(_0x5b1a7a){logger[_0x1e2b('0x13')](_0x1e2b('0xe'),_0x353334,_0x5b1a7a);_0x21bb06(_0x5b1a7a);});});} \ No newline at end of file +var _0xa0b1=['stringify','error','message','info','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1f7f32,_0x1e0a55){var _0x47ab3a=function(_0x3d6afc){while(--_0x3d6afc){_0x1f7f32['push'](_0x1f7f32['shift']());}};_0x47ab3a(++_0x1e0a55);}(_0xa0b1,0xa5));var _0x1a0b=function(_0x49923f,_0x671404){_0x49923f=_0x49923f-0x0;var _0x560684=_0xa0b1[_0x49923f];return _0x560684;};'use strict';var _=require(_0x1a0b('0x0'));var util=require('util');var moment=require(_0x1a0b('0x1'));var BPromise=require(_0x1a0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a0b('0x3'));var logger=require(_0x1a0b('0x4'))(_0x1a0b('0x5'));var config=require(_0x1a0b('0x6'));var jayson=require(_0x1a0b('0x7'));var client=jayson[_0x1a0b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311a81,_0x52fe19,_0x34d49e){return new BPromise(function(_0x444f46,_0x40e322){return client[_0x1a0b('0x9')](_0x311a81,_0x34d49e)[_0x1a0b('0xa')](function(_0x33e882){logger['info'](_0x1a0b('0xb'),_0x52fe19,_0x1a0b('0xc'));logger[_0x1a0b('0xd')](_0x1a0b('0xe'),_0x52fe19,'request\x20sent',JSON[_0x1a0b('0xf')](_0x33e882));if(_0x33e882[_0x1a0b('0x10')]){if(_0x33e882[_0x1a0b('0x10')]['code']===0x1f4){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x33e882[_0x1a0b('0x10')]['message']);return _0x40e322(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}logger[_0x1a0b('0x10')](_0x1a0b('0xb'),_0x52fe19,_0x33e882['error'][_0x1a0b('0x11')]);return _0x444f46(_0x33e882[_0x1a0b('0x10')][_0x1a0b('0x11')]);}else{logger[_0x1a0b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x52fe19,_0x1a0b('0xc'));_0x444f46(_0x33e882['result'][_0x1a0b('0x11')]);}})[_0x1a0b('0x13')](function(_0x24d28a){logger['error'](_0x1a0b('0xb'),_0x52fe19,_0x24d28a);_0x40e322(_0x24d28a);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 1dbe37d..48d9f5e 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 _0x667e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x56761e,_0x1a5388){var _0x5ca7e8=function(_0x2e0b87){while(--_0x2e0b87){_0x56761e['push'](_0x56761e['shift']());}};_0x5ca7e8(++_0x1a5388);}(_0x667e,0x80));var _0xe667=function(_0x2ea8ed,_0x38bbf3){_0x2ea8ed=_0x2ea8ed-0x0;var _0x1283f8=_0x667e[_0x2ea8ed];return _0x1283f8;};'use strict';var multer=require(_0xe667('0x0'));var util=require(_0xe667('0x1'));var path=require(_0xe667('0x2'));var timeout=require(_0xe667('0x3'));var express=require(_0xe667('0x4'));var router=express[_0xe667('0x5')]();var fs_extra=require(_0xe667('0x6'));var auth=require(_0xe667('0x7'));var interaction=require(_0xe667('0x8'));var config=require(_0xe667('0x9'));var controller=require('./chatApplication.controller');router[_0xe667('0xa')]('/:id',auth[_0xe667('0xb')](),controller[_0xe667('0xc')]);router[_0xe667('0xd')](_0xe667('0xe'),auth[_0xe667('0xb')](),controller[_0xe667('0xf')]);router[_0xe667('0x10')](_0xe667('0xe'),auth['isAuthenticated'](),controller[_0xe667('0x11')]);module[_0xe667('0x12')]=router; \ No newline at end of file +var _0x7b1e=['fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x579d67,_0x56a6aa){var _0x826234=function(_0x270f06){while(--_0x270f06){_0x579d67['push'](_0x579d67['shift']());}};_0x826234(++_0x56a6aa);}(_0x7b1e,0xe8));var _0xe7b1=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x7b1e[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xe7b1('0x0'));var util=require(_0xe7b1('0x1'));var path=require(_0xe7b1('0x2'));var timeout=require(_0xe7b1('0x3'));var express=require(_0xe7b1('0x4'));var router=express[_0xe7b1('0x5')]();var fs_extra=require(_0xe7b1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe7b1('0x7'));var config=require(_0xe7b1('0x8'));var controller=require(_0xe7b1('0x9'));router[_0xe7b1('0xa')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe7b1('0xc')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xd')]);router[_0xe7b1('0xe')](_0xe7b1('0xb'),auth['isAuthenticated'](),controller[_0xe7b1('0xf')]);module[_0xe7b1('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index ec8f40f..dc31b56 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 _0x242e=['STRING','sequelize'];(function(_0x26edc2,_0x12a906){var _0x34489e=function(_0x227193){while(--_0x227193){_0x26edc2['push'](_0x26edc2['shift']());}};_0x34489e(++_0x12a906);}(_0x242e,0x12f));var _0xe242=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x242e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xe242('0x0'));module['exports']={'name':{'type':Sequelize[_0xe242('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe242('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x3adf=['STRING','BOOLEAN','sequelize','exports'];(function(_0xa91eed,_0x4b7c93){var _0x1c77fc=function(_0x67d2f){while(--_0x67d2f){_0xa91eed['push'](_0xa91eed['shift']());}};_0x1c77fc(++_0x4b7c93);}(_0x3adf,0x1a6));var _0xf3ad=function(_0x1193d0,_0x299caa){_0x1193d0=_0x1193d0-0x0;var _0x16d3a3=_0x3adf[_0x1193d0];return _0x16d3a3;};'use strict';var Sequelize=require(_0xf3ad('0x0'));module[_0xf3ad('0x1')]={'name':{'type':Sequelize[_0xf3ad('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf3ad('0x2')]},'write':{'type':Sequelize[_0xf3ad('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 ee0687d..df4b2c8 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 _0x93bc=['catch','params','rawAttributes','includeAll','include','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ChatGroup','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','findAll','rows'];(function(_0x14e35c,_0x42d167){var _0x2f1025=function(_0x86565a){while(--_0x86565a){_0x14e35c['push'](_0x14e35c['shift']());}};_0x2f1025(++_0x42d167);}(_0x93bc,0x195));var _0xc93b=function(_0x26f65f,_0x2d62d9){_0x26f65f=_0x26f65f-0x0;var _0x3ead39=_0x93bc[_0x26f65f];return _0x3ead39;};'use strict';var emlformat=require(_0xc93b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc93b('0x1'));var jsonpatch=require(_0xc93b('0x2'));var rp=require(_0xc93b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc93b('0x4'));var path=require('path');var sox=require(_0xc93b('0x5'));var csv=require(_0xc93b('0x6'));var ejs=require(_0xc93b('0x7'));var fs=require('fs');var fs_extra=require(_0xc93b('0x8'));var _=require(_0xc93b('0x9'));var squel=require('squel');var crypto=require(_0xc93b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc93b('0xb'));var toCsv=require(_0xc93b('0x6'));var querystring=require(_0xc93b('0xc'));var Papa=require('papaparse');var Redis=require(_0xc93b('0xd'));var authService=require(_0xc93b('0xe'));var qs=require(_0xc93b('0xf'));var as=require(_0xc93b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc93b('0x11'))(_0xc93b('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc93b('0x13'));var db=require(_0xc93b('0x14'))['db'];config[_0xc93b('0x15')]=_[_0xc93b('0x16')](config[_0xc93b('0x15')],{'host':_0xc93b('0x17'),'port':0x18eb});var socket=require(_0xc93b('0x18'))(new Redis(config[_0xc93b('0x15')]));require('./chatGroup.socket')[_0xc93b('0x19')](socket);function respondWithStatusCode(_0x5dad0e,_0x592f30){_0x592f30=_0x592f30||0xcc;return function(_0x3103ca){if(_0x3103ca){return _0x5dad0e[_0xc93b('0x1a')](_0x592f30);}return _0x5dad0e[_0xc93b('0x1b')](_0x592f30)[_0xc93b('0x1c')]();};}function respondWithResult(_0x33a86f,_0x3bc932){_0x3bc932=_0x3bc932||0xc8;return function(_0x16d1e1){if(_0x16d1e1){return _0x33a86f[_0xc93b('0x1b')](_0x3bc932)[_0xc93b('0x1d')](_0x16d1e1);}};}function respondWithFilteredResult(_0x9f910a,_0x3acefa){return function(_0x224bb7){if(_0x224bb7){var _0xbbe90b=typeof _0x3acefa['offset']===_0xc93b('0x1e')&&typeof _0x3acefa[_0xc93b('0x1f')]===_0xc93b('0x1e');var _0x4ce58a=_0x224bb7[_0xc93b('0x20')];var _0x5d0eab=_0xbbe90b?0x0:_0x3acefa[_0xc93b('0x21')];var _0x2c2e8d=_0xbbe90b?_0x224bb7[_0xc93b('0x20')]:_0x3acefa['offset']+_0x3acefa['limit'];var _0x523f22;if(_0x2c2e8d>=_0x4ce58a){_0x2c2e8d=_0x4ce58a;_0x523f22=0xc8;}else{_0x523f22=0xce;}_0x9f910a[_0xc93b('0x1b')](_0x523f22);return _0x9f910a[_0xc93b('0x22')](_0xc93b('0x23'),_0x5d0eab+'-'+_0x2c2e8d+'/'+_0x4ce58a)['json'](_0x224bb7);}return null;};}function patchUpdates(_0x49304f){return function(_0x590da6){try{jsonpatch[_0xc93b('0x24')](_0x590da6,_0x49304f,!![]);}catch(_0x377aa8){return BPromise[_0xc93b('0x25')](_0x377aa8);}return _0x590da6[_0xc93b('0x26')]();};}function saveUpdates(_0xc2a89b,_0xaf12a){return function(_0x3a63e8){if(_0x3a63e8){return _0x3a63e8[_0xc93b('0x27')](_0xc2a89b)[_0xc93b('0x28')](function(_0x2ffaa1){return _0x2ffaa1;});}return null;};}function removeEntity(_0x1a8535,_0x32a612){return function(_0x5b247d){if(_0x5b247d){return _0x5b247d[_0xc93b('0x29')]()[_0xc93b('0x28')](function(){_0x1a8535[_0xc93b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340945,_0x304b98){return function(_0x40a087){if(!_0x40a087){_0x340945[_0xc93b('0x1a')](0x194);}return _0x40a087;};}function handleError(_0x6a520,_0x55a65b){_0x55a65b=_0x55a65b||0x1f4;return function(_0x46860b){logger[_0xc93b('0x2a')](_0x46860b[_0xc93b('0x2b')]);if(_0x46860b[_0xc93b('0x2c')]){delete _0x46860b[_0xc93b('0x2c')];}_0x6a520[_0xc93b('0x1b')](_0x55a65b)[_0xc93b('0x2d')](_0x46860b);};}exports['index']=function(_0x312a43,_0x2fdce4){var _0x8b7287={},_0x57ee7d={},_0x24c6d0={'count':0x0,'rows':[]};var _0x2958b5=_['map'](db[_0xc93b('0x2e')]['rawAttributes'],function(_0x307479){return{'name':_0x307479[_0xc93b('0x2f')],'type':_0x307479[_0xc93b('0x30')][_0xc93b('0x31')]};});_0x57ee7d[_0xc93b('0x32')]=_[_0xc93b('0x33')](_0x2958b5,_0xc93b('0x2c'));_0x57ee7d[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x312a43['query']);_0x57ee7d[_0xc93b('0x36')]=_[_0xc93b('0x37')](_0x57ee7d[_0xc93b('0x32')],_0x57ee7d['query']);_0x8b7287['attributes']=_[_0xc93b('0x37')](_0x57ee7d['model'],qs[_0xc93b('0x38')](_0x312a43[_0xc93b('0x34')][_0xc93b('0x38')]));_0x8b7287[_0xc93b('0x39')]=_0x8b7287[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x8b7287[_0xc93b('0x39')]:_0x57ee7d[_0xc93b('0x32')];if(!_0x312a43['query'][_0xc93b('0x3b')]('nolimit')){_0x8b7287[_0xc93b('0x1f')]=qs[_0xc93b('0x1f')](_0x312a43['query'][_0xc93b('0x1f')]);_0x8b7287[_0xc93b('0x21')]=qs['offset'](_0x312a43[_0xc93b('0x34')][_0xc93b('0x21')]);}_0x8b7287[_0xc93b('0x3c')]=qs[_0xc93b('0x3d')](_0x312a43[_0xc93b('0x34')]['sort']);_0x8b7287['where']=qs[_0xc93b('0x36')](_[_0xc93b('0x3e')](_0x312a43[_0xc93b('0x34')],_0x57ee7d[_0xc93b('0x36')]),_0x2958b5);if(_0x312a43[_0xc93b('0x34')]['filter']){_0x8b7287['where']=_[_0xc93b('0x3f')](_0x8b7287[_0xc93b('0x40')],{'$or':_[_0xc93b('0x33')](_0x2958b5,function(_0x1a60ff){if(_0x1a60ff[_0xc93b('0x30')]!==_0xc93b('0x41')){var _0x15d011={};_0x15d011[_0x1a60ff[_0xc93b('0x2c')]]={'$like':'%'+_0x312a43[_0xc93b('0x34')][_0xc93b('0x42')]+'%'};return _0x15d011;}})});}_0x8b7287=_[_0xc93b('0x3f')]({},_0x8b7287,_0x312a43[_0xc93b('0x43')]);var _0x224d6f={'where':_0x8b7287[_0xc93b('0x40')]};return db[_0xc93b('0x2e')]['count'](_0x224d6f)[_0xc93b('0x28')](function(_0x260f6e){_0x24c6d0['count']=_0x260f6e;if(_0x312a43[_0xc93b('0x34')]['includeAll']){_0x8b7287['include']=[{'all':!![]}];}return db['ChatGroup'][_0xc93b('0x44')](_0x8b7287);})[_0xc93b('0x28')](function(_0x526479){_0x24c6d0[_0xc93b('0x45')]=_0x526479;return _0x24c6d0;})[_0xc93b('0x28')](respondWithFilteredResult(_0x2fdce4,_0x8b7287))[_0xc93b('0x46')](handleError(_0x2fdce4,null));};exports['show']=function(_0x3c9166,_0x5db3d0){var _0x532407={'raw':!![],'where':{'id':_0x3c9166[_0xc93b('0x47')]['id']}},_0x479ef5={};_0x479ef5[_0xc93b('0x32')]=_[_0xc93b('0x35')](db[_0xc93b('0x2e')][_0xc93b('0x48')]);_0x479ef5[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x3c9166['query']);_0x479ef5[_0xc93b('0x36')]=_[_0xc93b('0x37')](_0x479ef5[_0xc93b('0x32')],_0x479ef5['query']);_0x532407['attributes']=_[_0xc93b('0x37')](_0x479ef5[_0xc93b('0x32')],qs[_0xc93b('0x38')](_0x3c9166[_0xc93b('0x34')]['fields']));_0x532407[_0xc93b('0x39')]=_0x532407[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x532407[_0xc93b('0x39')]:_0x479ef5[_0xc93b('0x32')];if(_0x3c9166[_0xc93b('0x34')][_0xc93b('0x49')]){_0x532407[_0xc93b('0x4a')]=[{'all':!![]}];}_0x532407=_[_0xc93b('0x3f')]({},_0x532407,_0x3c9166['options']);return db[_0xc93b('0x2e')][_0xc93b('0x4b')](_0x532407)['then'](handleEntityNotFound(_0x5db3d0,null))[_0xc93b('0x28')](respondWithResult(_0x5db3d0,null))['catch'](handleError(_0x5db3d0,null));};exports[_0xc93b('0x4c')]=function(_0xba167d,_0x559cbc){return db[_0xc93b('0x2e')]['create'](_0xba167d[_0xc93b('0x4d')],{})[_0xc93b('0x28')](respondWithResult(_0x559cbc,0xc9))['catch'](handleError(_0x559cbc,null));};exports[_0xc93b('0x27')]=function(_0x58c1e9,_0x5ed489){if(_0x58c1e9[_0xc93b('0x4d')]['id']){delete _0x58c1e9[_0xc93b('0x4d')]['id'];}return db[_0xc93b('0x2e')]['find']({'where':{'id':_0x58c1e9[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x5ed489,null))[_0xc93b('0x28')](saveUpdates(_0x58c1e9[_0xc93b('0x4d')],null))[_0xc93b('0x28')](respondWithResult(_0x5ed489,null))[_0xc93b('0x46')](handleError(_0x5ed489,null));};exports[_0xc93b('0x29')]=function(_0x589336,_0x454a92){return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x589336[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x454a92,null))[_0xc93b('0x28')](removeEntity(_0x454a92,null))['catch'](handleError(_0x454a92,null));};exports['describe']=function(_0x5d2a5b,_0x1c5843){return db[_0xc93b('0x2e')][_0xc93b('0x4e')]()[_0xc93b('0x28')](respondWithResult(_0x1c5843,null))[_0xc93b('0x46')](handleError(_0x1c5843,null));};exports[_0xc93b('0x4f')]=function(_0x4b526a,_0x31bb47,_0x22e3a6){return db[_0xc93b('0x50')][_0xc93b('0x20')]({'where':{'ChatGroupId':_0x4b526a[_0xc93b('0x47')]['id'],'ToId':_0x4b526a[_0xc93b('0x51')]['id'],'read':![]}})[_0xc93b('0x28')](function(_0x1a2025){return{'id':_['toInteger'](_0x4b526a[_0xc93b('0x47')]['id']),'count':_0x1a2025};})[_0xc93b('0x28')](respondWithResult(_0x31bb47,null))['catch'](handleError(_0x31bb47,null));};exports['addMembers']=function(_0x1ee89d,_0xd7b057,_0x1b122c){return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x1ee89d['params']['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0xd7b057,null))[_0xc93b('0x28')](function(_0xdb5fa1){if(_0xdb5fa1){return _0xdb5fa1[_0xc93b('0x52')](_0x1ee89d['body'][_0xc93b('0x53')],_['omit'](_0x1ee89d[_0xc93b('0x4d')],[_0xc93b('0x53'),'id'])||{});}})[_0xc93b('0x28')](respondWithResult(_0xd7b057,null))[_0xc93b('0x46')](handleError(_0xd7b057,null));};exports[_0xc93b('0x54')]=function(_0x37e176,_0x2b73f4,_0x4f4bc2){var _0x41dcb3={};var _0x26bbfd={};var _0x32d34f;var _0x177805;return db[_0xc93b('0x2e')][_0xc93b('0x55')]({'where':{'id':_0x37e176[_0xc93b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b73f4,null))[_0xc93b('0x28')](function(_0x1a8a74){if(_0x1a8a74){_0x32d34f=_0x1a8a74;_0x26bbfd['model']=_[_0xc93b('0x35')](db[_0xc93b('0x56')]['rawAttributes']);_0x26bbfd[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x37e176['query']);_0x26bbfd[_0xc93b('0x36')]=_['intersection'](_0x26bbfd[_0xc93b('0x32')],_0x26bbfd['query']);_0x41dcb3['attributes']=_[_0xc93b('0x37')](_0x26bbfd[_0xc93b('0x32')],qs[_0xc93b('0x38')](_0x37e176[_0xc93b('0x34')]['fields']));_0x41dcb3['attributes']=_0x41dcb3[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x41dcb3['attributes']:_0x26bbfd[_0xc93b('0x32')];_0x41dcb3[_0xc93b('0x3c')]=qs['sort'](_0x37e176['query']['sort']);_0x41dcb3['where']=qs['filters'](_[_0xc93b('0x3e')](_0x37e176[_0xc93b('0x34')],_0x26bbfd[_0xc93b('0x36')]));if(_0x37e176['query'][_0xc93b('0x42')]){_0x41dcb3[_0xc93b('0x40')]=_[_0xc93b('0x3f')](_0x41dcb3[_0xc93b('0x40')],{'$or':_[_0xc93b('0x33')](_0x41dcb3[_0xc93b('0x39')],function(_0x4f1f41){var _0x1ccfa4={};_0x1ccfa4[_0x4f1f41]={'$like':'%'+_0x37e176['query']['filter']+'%'};return _0x1ccfa4;})});}_0x41dcb3=_[_0xc93b('0x3f')]({},_0x41dcb3,_0x37e176[_0xc93b('0x43')]);return _0x32d34f['getMembers'](_0x41dcb3);}})['then'](function(_0x22e851){if(_0x22e851){_0x177805=_0x22e851['length'];if(!_0x37e176[_0xc93b('0x34')]['hasOwnProperty'](_0xc93b('0x57'))){_0x41dcb3['limit']=qs[_0xc93b('0x1f')](_0x37e176['query'][_0xc93b('0x1f')]);_0x41dcb3[_0xc93b('0x21')]=qs[_0xc93b('0x21')](_0x37e176[_0xc93b('0x34')][_0xc93b('0x21')]);}return _0x32d34f[_0xc93b('0x54')](_0x41dcb3);}})[_0xc93b('0x28')](function(_0x4cbc34){if(_0x4cbc34){return _0x4cbc34?{'count':_0x177805,'rows':_0x4cbc34}:null;}})[_0xc93b('0x28')](respondWithResult(_0x2b73f4,null))['catch'](handleError(_0x2b73f4,null));};exports[_0xc93b('0x58')]=function(_0x4b0eb5,_0x430c09,_0x57b0ca){return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x4b0eb5[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x430c09,null))[_0xc93b('0x28')](function(_0x3ea0ac){if(_0x3ea0ac){return _0x3ea0ac[_0xc93b('0x58')](_0x4b0eb5[_0xc93b('0x34')][_0xc93b('0x53')]);}})[_0xc93b('0x28')](respondWithStatusCode(_0x430c09,null))[_0xc93b('0x46')](handleError(_0x430c09,null));};exports[_0xc93b('0x59')]=function(_0x231338,_0x346a36,_0x58deb3){if(_0x231338[_0xc93b('0x4d')]['id']){delete _0x231338[_0xc93b('0x4d')]['id'];}return db[_0xc93b('0x2e')][_0xc93b('0x4b')]({'where':{'id':_0x231338[_0xc93b('0x47')]['id']}})[_0xc93b('0x28')](handleEntityNotFound(_0x346a36,null))[_0xc93b('0x28')](function(_0x3bd8a2){if(_0x3bd8a2){_0x231338[_0xc93b('0x4d')]['ChatGroupId']=_0x3bd8a2['id'];return db[_0xc93b('0x50')][_0xc93b('0x4c')](_0x231338[_0xc93b('0x4d')]);}})['then'](respondWithResult(_0x346a36,null))[_0xc93b('0x46')](handleError(_0x346a36,null));};exports[_0xc93b('0x5a')]=function(_0x3418a9,_0x51a2f5,_0x23d38b){var _0x4752de={};var _0x3148c2={};var _0x495cb1;var _0x63caeb;return db[_0xc93b('0x2e')][_0xc93b('0x55')]({'where':{'id':_0x3418a9[_0xc93b('0x47')]['id']}})['then'](handleEntityNotFound(_0x51a2f5,null))[_0xc93b('0x28')](function(_0x14aa01){if(_0x14aa01){_0x495cb1=_0x14aa01;_0x3148c2[_0xc93b('0x32')]=_[_0xc93b('0x35')](db['ChatInternalMessage']['rawAttributes']);_0x3148c2[_0xc93b('0x34')]=_[_0xc93b('0x35')](_0x3418a9['query']);_0x3148c2[_0xc93b('0x36')]=_[_0xc93b('0x37')](_0x3148c2[_0xc93b('0x32')],_0x3148c2['query']);_0x4752de[_0xc93b('0x39')]=_[_0xc93b('0x37')](_0x3148c2[_0xc93b('0x32')],qs[_0xc93b('0x38')](_0x3418a9[_0xc93b('0x34')][_0xc93b('0x38')]));_0x4752de[_0xc93b('0x39')]=_0x4752de[_0xc93b('0x39')][_0xc93b('0x3a')]?_0x4752de[_0xc93b('0x39')]:_0x3148c2['model'];_0x4752de[_0xc93b('0x3c')]=qs[_0xc93b('0x3d')](_0x3418a9['query'][_0xc93b('0x3d')]);_0x4752de['where']=qs['filters'](_[_0xc93b('0x3e')](_0x3418a9['query'],_0x3148c2['filters']));if(_0x3418a9[_0xc93b('0x34')][_0xc93b('0x42')]){_0x4752de[_0xc93b('0x40')]=_[_0xc93b('0x3f')](_0x4752de[_0xc93b('0x40')],{'$or':_[_0xc93b('0x33')](_0x4752de[_0xc93b('0x39')],function(_0x37f0a6){var _0x136374={};_0x136374[_0x37f0a6]={'$like':'%'+_0x3418a9['query']['filter']+'%'};return _0x136374;})});}if(_0x3418a9[_0xc93b('0x34')][_0xc93b('0x5b')]){var _0x371092=_0x3418a9['query'][_0xc93b('0x5b')][_0xc93b('0x5c')](',');var _0x30d752={};_0x30d752[_0x371092[0x0]]={'$gte':moment(_0x371092[0x1])[_0xc93b('0x5d')](_0xc93b('0x5e'))};_0x4752de[_0xc93b('0x40')]=_[_0xc93b('0x3f')](_0x4752de[_0xc93b('0x40')],_0x30d752);}_0x4752de=_['merge']({},_0x4752de,_0x3418a9[_0xc93b('0x43')]);return _0x495cb1[_0xc93b('0x5a')](_0x4752de);}})['then'](function(_0x152b58){if(_0x152b58){_0x63caeb=_0x152b58['length'];if(!_0x3418a9[_0xc93b('0x34')][_0xc93b('0x3b')]('nolimit')){_0x4752de[_0xc93b('0x1f')]=qs[_0xc93b('0x1f')](_0x3418a9['query']['limit']);_0x4752de[_0xc93b('0x21')]=qs['offset'](_0x3418a9[_0xc93b('0x34')][_0xc93b('0x21')]);}return _0x495cb1[_0xc93b('0x5a')](_0x4752de);}})[_0xc93b('0x28')](function(_0x19becd){if(_0x19becd){return _0x19becd?{'count':_0x63caeb,'rows':_0x19becd}:null;}})[_0xc93b('0x28')](respondWithResult(_0x51a2f5,null))[_0xc93b('0x46')](handleError(_0x51a2f5,null));}; \ No newline at end of file +var _0x5b75=['show','params','fields','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','nolimit','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','ChatGroup','include','findAll','rows','catch'];(function(_0x405ac9,_0x2c795c){var _0x2d200f=function(_0x27ae59){while(--_0x27ae59){_0x405ac9['push'](_0x405ac9['shift']());}};_0x2d200f(++_0x2c795c);}(_0x5b75,0x137));var _0x55b7=function(_0x5211bc,_0x410051){_0x5211bc=_0x5211bc-0x0;var _0x2e5a9f=_0x5b75[_0x5211bc];return _0x2e5a9f;};'use strict';var emlformat=require(_0x55b7('0x0'));var rimraf=require(_0x55b7('0x1'));var zipdir=require(_0x55b7('0x2'));var jsonpatch=require(_0x55b7('0x3'));var rp=require('request-promise');var moment=require(_0x55b7('0x4'));var BPromise=require(_0x55b7('0x5'));var Mustache=require(_0x55b7('0x6'));var util=require('util');var path=require(_0x55b7('0x7'));var sox=require(_0x55b7('0x8'));var csv=require(_0x55b7('0x9'));var ejs=require(_0x55b7('0xa'));var fs=require('fs');var fs_extra=require(_0x55b7('0xb'));var _=require(_0x55b7('0xc'));var squel=require(_0x55b7('0xd'));var crypto=require(_0x55b7('0xe'));var jsforce=require(_0x55b7('0xf'));var deskjs=require(_0x55b7('0x10'));var toCsv=require(_0x55b7('0x9'));var querystring=require('querystring');var Papa=require(_0x55b7('0x11'));var Redis=require(_0x55b7('0x12'));var authService=require(_0x55b7('0x13'));var qs=require(_0x55b7('0x14'));var as=require(_0x55b7('0x15'));var hardwareService=require(_0x55b7('0x16'));var logger=require(_0x55b7('0x17'))(_0x55b7('0x18'));var utils=require(_0x55b7('0x19'));var config=require(_0x55b7('0x1a'));var licenseUtil=require(_0x55b7('0x1b'));var db=require(_0x55b7('0x1c'))['db'];config[_0x55b7('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x55b7('0x1e'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3feb9b,_0xa5ab){_0xa5ab=_0xa5ab||0xcc;return function(_0xd47649){if(_0xd47649){return _0x3feb9b[_0x55b7('0x1f')](_0xa5ab);}return _0x3feb9b[_0x55b7('0x20')](_0xa5ab)['end']();};}function respondWithResult(_0x44ca4c,_0x29dad5){_0x29dad5=_0x29dad5||0xc8;return function(_0x5801b1){if(_0x5801b1){return _0x44ca4c[_0x55b7('0x20')](_0x29dad5)[_0x55b7('0x21')](_0x5801b1);}};}function respondWithFilteredResult(_0x5a85d9,_0xdc2a74){return function(_0x9b18ba){if(_0x9b18ba){var _0x2efc38=typeof _0xdc2a74[_0x55b7('0x22')]===_0x55b7('0x23')&&typeof _0xdc2a74[_0x55b7('0x24')]==='undefined';var _0x4d62af=_0x9b18ba[_0x55b7('0x25')];var _0x2ce3dc=_0x2efc38?0x0:_0xdc2a74[_0x55b7('0x22')];var _0x1e3645=_0x2efc38?_0x9b18ba['count']:_0xdc2a74['offset']+_0xdc2a74[_0x55b7('0x24')];var _0x6e295c;if(_0x1e3645>=_0x4d62af){_0x1e3645=_0x4d62af;_0x6e295c=0xc8;}else{_0x6e295c=0xce;}_0x5a85d9[_0x55b7('0x20')](_0x6e295c);return _0x5a85d9[_0x55b7('0x26')](_0x55b7('0x27'),_0x2ce3dc+'-'+_0x1e3645+'/'+_0x4d62af)['json'](_0x9b18ba);}return null;};}function patchUpdates(_0x28dbfb){return function(_0xf497fc){try{jsonpatch[_0x55b7('0x28')](_0xf497fc,_0x28dbfb,!![]);}catch(_0x2332a2){return BPromise[_0x55b7('0x29')](_0x2332a2);}return _0xf497fc['save']();};}function saveUpdates(_0x5b0343,_0x472d3f){return function(_0x5e6c86){if(_0x5e6c86){return _0x5e6c86[_0x55b7('0x2a')](_0x5b0343)[_0x55b7('0x2b')](function(_0x5f0781){return _0x5f0781;});}return null;};}function removeEntity(_0x12a218,_0x1008cf){return function(_0x1b19be){if(_0x1b19be){return _0x1b19be[_0x55b7('0x2c')]()[_0x55b7('0x2b')](function(){_0x12a218[_0x55b7('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e434,_0x34aee7){return function(_0x22a246){if(!_0x22a246){_0x46e434[_0x55b7('0x1f')](0x194);}return _0x22a246;};}function handleError(_0x3af05e,_0x4b541c){_0x4b541c=_0x4b541c||0x1f4;return function(_0x16f9bb){logger['error'](_0x16f9bb[_0x55b7('0x2d')]);if(_0x16f9bb[_0x55b7('0x2e')]){delete _0x16f9bb['name'];}_0x3af05e['status'](_0x4b541c)['send'](_0x16f9bb);};}exports[_0x55b7('0x2f')]=function(_0x5f326f,_0x31d6dc){var _0x3b1935={},_0x2878a9={},_0x199fcd={'count':0x0,'rows':[]};var _0x35e1fb=_['map'](db['ChatGroup'][_0x55b7('0x30')],function(_0x3645ac){return{'name':_0x3645ac[_0x55b7('0x31')],'type':_0x3645ac[_0x55b7('0x32')][_0x55b7('0x33')]};});_0x2878a9[_0x55b7('0x34')]=_['map'](_0x35e1fb,_0x55b7('0x2e'));_0x2878a9[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x5f326f[_0x55b7('0x35')]);_0x2878a9[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],_0x2878a9['query']);_0x3b1935[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x2878a9[_0x55b7('0x34')],qs['fields'](_0x5f326f['query']['fields']));_0x3b1935[_0x55b7('0x39')]=_0x3b1935[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x3b1935[_0x55b7('0x39')]:_0x2878a9[_0x55b7('0x34')];if(!_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3b')]('nolimit')){_0x3b1935[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0x5f326f['query']['limit']);_0x3b1935['offset']=qs['offset'](_0x5f326f['query'][_0x55b7('0x22')]);}_0x3b1935[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x3b1935['where']=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0x5f326f[_0x55b7('0x35')],_0x2878a9[_0x55b7('0x37')]),_0x35e1fb);if(_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x3b1935[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x3b1935[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x35e1fb,function(_0x613a81){if(_0x613a81['type']!=='VIRTUAL'){var _0x12976b={};_0x12976b[_0x613a81['name']]={'$like':'%'+_0x5f326f[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x12976b;}})});}_0x3b1935=_[_0x55b7('0x41')]({},_0x3b1935,_0x5f326f[_0x55b7('0x43')]);var _0x25c857={'where':_0x3b1935[_0x55b7('0x40')]};return db[_0x55b7('0x44')][_0x55b7('0x25')](_0x25c857)[_0x55b7('0x2b')](function(_0x34bf78){_0x199fcd[_0x55b7('0x25')]=_0x34bf78;if(_0x5f326f[_0x55b7('0x35')]['includeAll']){_0x3b1935[_0x55b7('0x45')]=[{'all':!![]}];}return db[_0x55b7('0x44')][_0x55b7('0x46')](_0x3b1935);})[_0x55b7('0x2b')](function(_0x2c4d49){_0x199fcd[_0x55b7('0x47')]=_0x2c4d49;return _0x199fcd;})[_0x55b7('0x2b')](respondWithFilteredResult(_0x31d6dc,_0x3b1935))[_0x55b7('0x48')](handleError(_0x31d6dc,null));};exports[_0x55b7('0x49')]=function(_0x477897,_0x477982){var _0x16f80f={'raw':!![],'where':{'id':_0x477897[_0x55b7('0x4a')]['id']}},_0x52146f={};_0x52146f[_0x55b7('0x34')]=_[_0x55b7('0x36')](db[_0x55b7('0x44')][_0x55b7('0x30')]);_0x52146f[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0x477897[_0x55b7('0x35')]);_0x52146f['filters']=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],_0x52146f['query']);_0x16f80f[_0x55b7('0x39')]=_[_0x55b7('0x38')](_0x52146f[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0x477897[_0x55b7('0x35')]['fields']));_0x16f80f[_0x55b7('0x39')]=_0x16f80f[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x16f80f[_0x55b7('0x39')]:_0x52146f[_0x55b7('0x34')];if(_0x477897[_0x55b7('0x35')][_0x55b7('0x4c')]){_0x16f80f['include']=[{'all':!![]}];}_0x16f80f=_[_0x55b7('0x41')]({},_0x16f80f,_0x477897['options']);return db[_0x55b7('0x44')][_0x55b7('0x4d')](_0x16f80f)[_0x55b7('0x2b')](handleEntityNotFound(_0x477982,null))[_0x55b7('0x2b')](respondWithResult(_0x477982,null))[_0x55b7('0x48')](handleError(_0x477982,null));};exports[_0x55b7('0x4e')]=function(_0x9055df,_0x42bfad){return db[_0x55b7('0x44')]['create'](_0x9055df[_0x55b7('0x4f')],{})[_0x55b7('0x2b')](respondWithResult(_0x42bfad,0xc9))['catch'](handleError(_0x42bfad,null));};exports[_0x55b7('0x2a')]=function(_0x5b7d1e,_0x49f01c){if(_0x5b7d1e[_0x55b7('0x4f')]['id']){delete _0x5b7d1e[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5b7d1e[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x49f01c,null))[_0x55b7('0x2b')](saveUpdates(_0x5b7d1e[_0x55b7('0x4f')],null))['then'](respondWithResult(_0x49f01c,null))['catch'](handleError(_0x49f01c,null));};exports[_0x55b7('0x2c')]=function(_0x3923ad,_0x483713){return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x3923ad[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x483713,null))[_0x55b7('0x2b')](removeEntity(_0x483713,null))[_0x55b7('0x48')](handleError(_0x483713,null));};exports['describe']=function(_0x143d56,_0x156b7f){return db[_0x55b7('0x44')][_0x55b7('0x50')]()['then'](respondWithResult(_0x156b7f,null))[_0x55b7('0x48')](handleError(_0x156b7f,null));};exports[_0x55b7('0x51')]=function(_0x285a01,_0x44ede3,_0x5ea535){return db[_0x55b7('0x52')][_0x55b7('0x25')]({'where':{'ChatGroupId':_0x285a01['params']['id'],'ToId':_0x285a01[_0x55b7('0x53')]['id'],'read':![]}})[_0x55b7('0x2b')](function(_0x4017ff){return{'id':_[_0x55b7('0x54')](_0x285a01[_0x55b7('0x4a')]['id']),'count':_0x4017ff};})['then'](respondWithResult(_0x44ede3,null))[_0x55b7('0x48')](handleError(_0x44ede3,null));};exports[_0x55b7('0x55')]=function(_0x59290b,_0x996d84,_0x1cf788){return db['ChatGroup']['find']({'where':{'id':_0x59290b[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x996d84,null))[_0x55b7('0x2b')](function(_0x245df7){if(_0x245df7){return _0x245df7[_0x55b7('0x55')](_0x59290b[_0x55b7('0x4f')][_0x55b7('0x56')],_[_0x55b7('0x57')](_0x59290b['body'],[_0x55b7('0x56'),'id'])||{});}})[_0x55b7('0x2b')](respondWithResult(_0x996d84,null))[_0x55b7('0x48')](handleError(_0x996d84,null));};exports[_0x55b7('0x58')]=function(_0x1a3ead,_0x4d864e,_0x467f7e){var _0x4ff6f8={};var _0x51c814={};var _0x572af2;var _0x4b3b46;return db[_0x55b7('0x44')]['findOne']({'where':{'id':_0x1a3ead['params']['id']}})['then'](handleEntityNotFound(_0x4d864e,null))[_0x55b7('0x2b')](function(_0x4689e2){if(_0x4689e2){_0x572af2=_0x4689e2;_0x51c814['model']=_[_0x55b7('0x36')](db[_0x55b7('0x59')]['rawAttributes']);_0x51c814['query']=_[_0x55b7('0x36')](_0x1a3ead['query']);_0x51c814[_0x55b7('0x37')]=_[_0x55b7('0x38')](_0x51c814[_0x55b7('0x34')],_0x51c814['query']);_0x4ff6f8[_0x55b7('0x39')]=_['intersection'](_0x51c814['model'],qs[_0x55b7('0x4b')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x4b')]));_0x4ff6f8[_0x55b7('0x39')]=_0x4ff6f8[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x4ff6f8[_0x55b7('0x39')]:_0x51c814[_0x55b7('0x34')];_0x4ff6f8[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3d')]);_0x4ff6f8['where']=qs['filters'](_[_0x55b7('0x3e')](_0x1a3ead[_0x55b7('0x35')],_0x51c814[_0x55b7('0x37')]));if(_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x4ff6f8['where']=_[_0x55b7('0x41')](_0x4ff6f8[_0x55b7('0x40')],{'$or':_[_0x55b7('0x42')](_0x4ff6f8[_0x55b7('0x39')],function(_0x183530){var _0x3def34={};_0x3def34[_0x183530]={'$like':'%'+_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x3def34;})});}_0x4ff6f8=_['merge']({},_0x4ff6f8,_0x1a3ead[_0x55b7('0x43')]);return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})['then'](function(_0x1e9faa){if(_0x1e9faa){_0x4b3b46=_0x1e9faa[_0x55b7('0x3a')];if(!_0x1a3ead['query'][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x4ff6f8[_0x55b7('0x24')]=qs['limit'](_0x1a3ead[_0x55b7('0x35')][_0x55b7('0x24')]);_0x4ff6f8[_0x55b7('0x22')]=qs['offset'](_0x1a3ead['query'][_0x55b7('0x22')]);}return _0x572af2[_0x55b7('0x58')](_0x4ff6f8);}})[_0x55b7('0x2b')](function(_0x590669){if(_0x590669){return _0x590669?{'count':_0x4b3b46,'rows':_0x590669}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x4d864e,null))[_0x55b7('0x48')](handleError(_0x4d864e,null));};exports['removeMembers']=function(_0x150393,_0x2a5c5d,_0x50a3ea){return db[_0x55b7('0x44')]['find']({'where':{'id':_0x150393['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x2a5c5d,null))[_0x55b7('0x2b')](function(_0x5aee6c){if(_0x5aee6c){return _0x5aee6c['removeMembers'](_0x150393[_0x55b7('0x35')][_0x55b7('0x56')]);}})[_0x55b7('0x2b')](respondWithStatusCode(_0x2a5c5d,null))[_0x55b7('0x48')](handleError(_0x2a5c5d,null));};exports['addMessage']=function(_0x5520b6,_0x17c6fa,_0x55ffdd){if(_0x5520b6[_0x55b7('0x4f')]['id']){delete _0x5520b6[_0x55b7('0x4f')]['id'];}return db[_0x55b7('0x44')][_0x55b7('0x4d')]({'where':{'id':_0x5520b6[_0x55b7('0x4a')]['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x17c6fa,null))[_0x55b7('0x2b')](function(_0x3d079f){if(_0x3d079f){_0x5520b6[_0x55b7('0x4f')]['ChatGroupId']=_0x3d079f['id'];return db[_0x55b7('0x52')][_0x55b7('0x4e')](_0x5520b6['body']);}})['then'](respondWithResult(_0x17c6fa,null))[_0x55b7('0x48')](handleError(_0x17c6fa,null));};exports['getMessages']=function(_0xcde715,_0x5267b4,_0x15d434){var _0x48cdb9={};var _0x1544cc={};var _0x49ad61;var _0x1adbd9;return db['ChatGroup'][_0x55b7('0x5b')]({'where':{'id':_0xcde715['params']['id']}})[_0x55b7('0x2b')](handleEntityNotFound(_0x5267b4,null))[_0x55b7('0x2b')](function(_0x1cdaf3){if(_0x1cdaf3){_0x49ad61=_0x1cdaf3;_0x1544cc[_0x55b7('0x34')]=_[_0x55b7('0x36')](db['ChatInternalMessage'][_0x55b7('0x30')]);_0x1544cc[_0x55b7('0x35')]=_[_0x55b7('0x36')](_0xcde715['query']);_0x1544cc[_0x55b7('0x37')]=_['intersection'](_0x1544cc[_0x55b7('0x34')],_0x1544cc['query']);_0x48cdb9['attributes']=_[_0x55b7('0x38')](_0x1544cc[_0x55b7('0x34')],qs[_0x55b7('0x4b')](_0xcde715['query'][_0x55b7('0x4b')]));_0x48cdb9[_0x55b7('0x39')]=_0x48cdb9[_0x55b7('0x39')][_0x55b7('0x3a')]?_0x48cdb9[_0x55b7('0x39')]:_0x1544cc[_0x55b7('0x34')];_0x48cdb9[_0x55b7('0x3c')]=qs[_0x55b7('0x3d')](_0xcde715[_0x55b7('0x35')]['sort']);_0x48cdb9[_0x55b7('0x40')]=qs[_0x55b7('0x37')](_[_0x55b7('0x3e')](_0xcde715[_0x55b7('0x35')],_0x1544cc[_0x55b7('0x37')]));if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]){_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],{'$or':_['map'](_0x48cdb9[_0x55b7('0x39')],function(_0x469c0b){var _0x4b7b97={};_0x4b7b97[_0x469c0b]={'$like':'%'+_0xcde715[_0x55b7('0x35')][_0x55b7('0x3f')]+'%'};return _0x4b7b97;})});}if(_0xcde715[_0x55b7('0x35')][_0x55b7('0x5c')]){var _0x56e082=_0xcde715[_0x55b7('0x35')]['$gte'][_0x55b7('0x5d')](',');var _0x37f399={};_0x37f399[_0x56e082[0x0]]={'$gte':moment(_0x56e082[0x1])['format'](_0x55b7('0x5e'))};_0x48cdb9[_0x55b7('0x40')]=_[_0x55b7('0x41')](_0x48cdb9['where'],_0x37f399);}_0x48cdb9=_['merge']({},_0x48cdb9,_0xcde715['options']);return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0xc73b75){if(_0xc73b75){_0x1adbd9=_0xc73b75[_0x55b7('0x3a')];if(!_0xcde715[_0x55b7('0x35')][_0x55b7('0x3b')](_0x55b7('0x5a'))){_0x48cdb9[_0x55b7('0x24')]=qs[_0x55b7('0x24')](_0xcde715['query'][_0x55b7('0x24')]);_0x48cdb9[_0x55b7('0x22')]=qs[_0x55b7('0x22')](_0xcde715['query'][_0x55b7('0x22')]);}return _0x49ad61[_0x55b7('0x5f')](_0x48cdb9);}})[_0x55b7('0x2b')](function(_0x21f179){if(_0x21f179){return _0x21f179?{'count':_0x1adbd9,'rows':_0x21f179}:null;}})[_0x55b7('0x2b')](respondWithResult(_0x5267b4,null))[_0x55b7('0x48')](handleError(_0x5267b4,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 9bb5b04..add507f 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 _0x6dad=['save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4f0159,_0xaf2d85){var _0x2b53a8=function(_0x34e528){while(--_0x34e528){_0x4f0159['push'](_0x4f0159['shift']());}};_0x2b53a8(++_0xaf2d85);}(_0x6dad,0x77));var _0xd6da=function(_0x4a393b,_0x483444){_0x4a393b=_0x4a393b-0x0;var _0x21e53b=_0x6dad[_0x4a393b];return _0x21e53b;};'use strict';var EventEmitter=require(_0xd6da('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd6da('0x1'),'afterUpdate':_0xd6da('0x2'),'afterDestroy':_0xd6da('0x3')};function emitEvent(_0x68d591){return function(_0x4f1f58,_0x21b59c,_0x30dc10){ChatGroupEvents[_0xd6da('0x4')](_0x68d591+':'+_0x4f1f58['id'],_0x4f1f58);ChatGroupEvents[_0xd6da('0x4')](_0x68d591,_0x4f1f58);_0x30dc10(null);};}for(var e in events){if(events[_0xd6da('0x5')](e)){var event=events[e];ChatGroup[_0xd6da('0x6')](e,emitEvent(event));}}module[_0xd6da('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x9b7c=['ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9b7c,0x176));var _0xc9b7=function(_0x1ea053,_0x22aecc){_0x1ea053=_0x1ea053-0x0;var _0x444b08=_0x9b7c[_0x1ea053];return _0x444b08;};'use strict';var EventEmitter=require(_0xc9b7('0x0'));var ChatGroup=require(_0xc9b7('0x1'))['db'][_0xc9b7('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc9b7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc9b7('0x4'),'afterDestroy':_0xc9b7('0x5')};function emitEvent(_0x29399d){return function(_0xee2a38,_0x251da6,_0x4a6516){ChatGroupEvents[_0xc9b7('0x6')](_0x29399d+':'+_0xee2a38['id'],_0xee2a38);ChatGroupEvents[_0xc9b7('0x6')](_0x29399d,_0xee2a38);_0x4a6516(null);};}for(var e in events){if(events[_0xc9b7('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 304de4a..c5f6986 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 _0x13fd=['../../config/logger','moment','request-promise','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x4d1b78,_0x29e2cb){var _0x271274=function(_0x35f48c){while(--_0x35f48c){_0x4d1b78['push'](_0x4d1b78['shift']());}};_0x271274(++_0x29e2cb);}(_0x13fd,0x93));var _0xd13f=function(_0x59b252,_0x49683c){_0x59b252=_0x59b252-0x0;var _0xfc55e6=_0x13fd[_0x59b252];return _0xfc55e6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd13f('0x0'))('api');var moment=require(_0xd13f('0x1'));var BPromise=require('bluebird');var rp=require(_0xd13f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd13f('0x3'));module[_0xd13f('0x4')]=function(_0x34bb9e,_0xa61f97){return _0x34bb9e[_0xd13f('0x5')](_0xd13f('0x6'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8786=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0xdfc19,_0x48a555){var _0x1c3a65=function(_0x5dfc48){while(--_0x5dfc48){_0xdfc19['push'](_0xdfc19['shift']());}};_0x1c3a65(++_0x48a555);}(_0x8786,0x6c));var _0x6878=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8786[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var logger=require(_0x6878('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6878('0x3'));var rp=require(_0x6878('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6878('0x5'));var attributes=require(_0x6878('0x6'));module[_0x6878('0x7')]=function(_0x5851a6,_0x2c5f10){return _0x5851a6['define']('ChatGroup',attributes,{'tableName':_0x6878('0x8'),'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 613bbd9..c10d2fa 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 _0xe8a4=['debug','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0xb45a4a,_0x366c34){var _0x3d6405=function(_0x55c3b5){while(--_0x55c3b5){_0xb45a4a['push'](_0xb45a4a['shift']());}};_0x3d6405(++_0x366c34);}(_0xe8a4,0x158));var _0x4e8a=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xe8a4[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x4e8a('0x0'));var util=require('util');var moment=require(_0x4e8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e8a('0x2'));var fs=require('fs');var Redis=require(_0x4e8a('0x3'));var db=require(_0x4e8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e8a('0x5'))(_0x4e8a('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e8a('0x7'));var client=jayson[_0x4e8a('0x8')][_0x4e8a('0x9')]({'port':0x232a});config[_0x4e8a('0xa')]=_[_0x4e8a('0xb')](config[_0x4e8a('0xa')],{'host':_0x4e8a('0xc'),'port':0x18eb});var socket=require(_0x4e8a('0xd'))(new Redis(config[_0x4e8a('0xa')]));require(_0x4e8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cbdf3,_0x3904bd,_0x395889){return new BPromise(function(_0x3ebde6,_0x5beaee){return client[_0x4e8a('0xf')](_0x1cbdf3,_0x395889)[_0x4e8a('0x10')](function(_0x50469a){logger[_0x4e8a('0x11')](_0x4e8a('0x12'),_0x3904bd,_0x4e8a('0x13'));logger[_0x4e8a('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'),JSON['stringify'](_0x50469a));if(_0x50469a[_0x4e8a('0x15')]){if(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x16')]===0x1f4){logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a['error'][_0x4e8a('0x17')]);return _0x5beaee(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);}logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);return _0x3ebde6(_0x50469a[_0x4e8a('0x15')]['message']);}else{logger[_0x4e8a('0x11')]('ChatGroup,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'));_0x3ebde6(_0x50469a[_0x4e8a('0x18')][_0x4e8a('0x17')]);}})[_0x4e8a('0x19')](function(_0x2b51d5){logger[_0x4e8a('0x15')](_0x4e8a('0x12'),_0x3904bd,_0x2b51d5);_0x5beaee(_0x2b51d5);});});} \ No newline at end of file +var _0x61a5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x308119,_0x2335dd){var _0x30a8d7=function(_0x2d52ce){while(--_0x2d52ce){_0x308119['push'](_0x308119['shift']());}};_0x30a8d7(++_0x2335dd);}(_0x61a5,0xf0));var _0x561a=function(_0x131205,_0x57575c){_0x131205=_0x131205-0x0;var _0x305300=_0x61a5[_0x131205];return _0x305300;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require(_0x561a('0x3'));var fs=require('fs');var Redis=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x561a('0x6'))(_0x561a('0x7'));var config=require('../../config/environment');var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});config[_0x561a('0xb')]=_[_0x561a('0xc')](config[_0x561a('0xb')],{'host':_0x561a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x561a('0xb')]));require('./chatGroup.socket')[_0x561a('0xe')](socket);function respondWithRpcPromise(_0x5288b4,_0x5b3510,_0x34e464){return new BPromise(function(_0x4071ba,_0x522f52){return client[_0x561a('0xf')](_0x5288b4,_0x34e464)['then'](function(_0x205e99){logger[_0x561a('0x10')](_0x561a('0x11'),_0x5b3510,_0x561a('0x12'));logger[_0x561a('0x13')](_0x561a('0x14'),_0x5b3510,_0x561a('0x12'),JSON[_0x561a('0x15')](_0x205e99));if(_0x205e99[_0x561a('0x16')]){if(_0x205e99[_0x561a('0x16')][_0x561a('0x17')]===0x1f4){logger[_0x561a('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x522f52(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}logger[_0x561a('0x16')](_0x561a('0x11'),_0x5b3510,_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);return _0x4071ba(_0x205e99[_0x561a('0x16')][_0x561a('0x18')]);}else{logger[_0x561a('0x10')]('ChatGroup,\x20%s,\x20%s',_0x5b3510,_0x561a('0x12'));_0x4071ba(_0x205e99[_0x561a('0x19')]['message']);}})[_0x561a('0x1a')](function(_0x785831){logger['error'](_0x561a('0x11'),_0x5b3510,_0x785831);_0x522f52(_0x785831);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 6b86977..4667f66 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 _0x3137=['update','removeListener','chatGroup:','./chatGroup.events','save','remove'];(function(_0x4c7765,_0x40e8c2){var _0x18776f=function(_0x583711){while(--_0x583711){_0x4c7765['push'](_0x4c7765['shift']());}};_0x18776f(++_0x40e8c2);}(_0x3137,0x135));var _0x7313=function(_0x28cbb5,_0x127005){_0x28cbb5=_0x28cbb5-0x0;var _0x27c4be=_0x3137[_0x28cbb5];return _0x27c4be;};'use strict';var ChatGroupEvents=require(_0x7313('0x0'));var events=[_0x7313('0x1'),_0x7313('0x2'),_0x7313('0x3')];function createListener(_0x545dbe,_0xfa9a93){return function(_0x46245f){_0xfa9a93['emit'](_0x545dbe,_0x46245f);};}function removeListener(_0x472f4c,_0x3963cf){return function(){ChatGroupEvents[_0x7313('0x4')](_0x472f4c,_0x3963cf);};}exports['register']=function(_0x6ecfc9){for(var _0x542349=0x0,_0x226fe9=events['length'];_0x542349<_0x226fe9;_0x542349++){var _0x48e75c=events[_0x542349];var _0x578eb2=createListener(_0x7313('0x5')+_0x48e75c,_0x6ecfc9);ChatGroupEvents['on'](_0x48e75c,_0x578eb2);}}; \ No newline at end of file +var _0x0eba=['removeListener','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x0eba,0x1d1));var _0xa0eb=function(_0x5715a2,_0x17e9c0){_0x5715a2=_0x5715a2-0x0;var _0x2ebf35=_0x0eba[_0x5715a2];return _0x2ebf35;};'use strict';var ChatGroupEvents=require(_0xa0eb('0x0'));var events=[_0xa0eb('0x1'),'remove','update'];function createListener(_0x38a06c,_0x475489){return function(_0x2c2d08){_0x475489[_0xa0eb('0x2')](_0x38a06c,_0x2c2d08);};}function removeListener(_0x984986,_0x397bd6){return function(){ChatGroupEvents[_0xa0eb('0x3')](_0x984986,_0x397bd6);};}exports['register']=function(_0x255b93){for(var _0x15ed4e=0x0,_0x545d73=events[_0xa0eb('0x4')];_0x15ed4e<_0x545d73;_0x15ed4e++){var _0x3f4cfd=events[_0x15ed4e];var _0x569016=createListener(_0xa0eb('0x5')+_0x3f4cfd,_0x255b93);ChatGroupEvents['on'](_0x3f4cfd,_0x569016);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 30233be..1a4af5c 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 _0x1ca4=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','/:id','destroy'];(function(_0x4a3991,_0x412a7b){var _0x1b9f70=function(_0x4e6df3){while(--_0x4e6df3){_0x4a3991['push'](_0x4a3991['shift']());}};_0x1b9f70(++_0x412a7b);}(_0x1ca4,0x194));var _0x41ca=function(_0x59534f,_0x1c834d){_0x59534f=_0x59534f-0x0;var _0x5d252a=_0x1ca4[_0x59534f];return _0x5d252a;};'use strict';var multer=require(_0x41ca('0x0'));var util=require(_0x41ca('0x1'));var path=require(_0x41ca('0x2'));var timeout=require(_0x41ca('0x3'));var express=require(_0x41ca('0x4'));var router=express['Router']();var fs_extra=require(_0x41ca('0x5'));var auth=require(_0x41ca('0x6'));var interaction=require(_0x41ca('0x7'));var config=require(_0x41ca('0x8'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x41ca('0x9')]);router['get'](_0x41ca('0xa'),auth[_0x41ca('0xb')](),controller[_0x41ca('0xc')]);router[_0x41ca('0xd')]('/:id',auth[_0x41ca('0xb')](),controller[_0x41ca('0xe')]);router[_0x41ca('0xd')](_0x41ca('0xf'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x10')]);router[_0x41ca('0xd')](_0x41ca('0x11'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x12')]);router['get'](_0x41ca('0x13'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x14')]);router[_0x41ca('0x15')]('/',auth[_0x41ca('0xb')](),controller[_0x41ca('0x16')]);router[_0x41ca('0x15')]('/:id/members',auth[_0x41ca('0xb')](),controller[_0x41ca('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x41ca('0x18')]);router[_0x41ca('0x19')]('/:id',auth[_0x41ca('0xb')](),controller[_0x41ca('0x1a')]);router[_0x41ca('0x1b')](_0x41ca('0x1c'),auth[_0x41ca('0xb')](),controller[_0x41ca('0x1d')]);router[_0x41ca('0x1b')]('/:id/members',auth[_0x41ca('0xb')](),controller['removeMembers']);module[_0x41ca('0x1e')]=router; \ No newline at end of file +var _0x1be7=['../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/messages','post','create','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x353f81,_0x2e9105){var _0x261d52=function(_0x358e45){while(--_0x358e45){_0x353f81['push'](_0x353f81['shift']());}};_0x261d52(++_0x2e9105);}(_0x1be7,0x1d8));var _0x71be=function(_0x26f081,_0x4277f3){_0x26f081=_0x26f081-0x0;var _0x4bf032=_0x1be7[_0x26f081];return _0x4bf032;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x71be('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x71be('0x1'));var auth=require(_0x71be('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x71be('0x3'));var controller=require(_0x71be('0x4'));router[_0x71be('0x5')]('/',auth['isAuthenticated'](),controller[_0x71be('0x6')]);router[_0x71be('0x5')](_0x71be('0x7'),auth[_0x71be('0x8')](),controller[_0x71be('0x9')]);router[_0x71be('0x5')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0xb')]);router[_0x71be('0x5')]('/:id/unread',auth[_0x71be('0x8')](),controller[_0x71be('0xc')]);router['get']('/:id/members',auth[_0x71be('0x8')](),controller['getMembers']);router[_0x71be('0x5')](_0x71be('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x71be('0xe')]('/',auth['isAuthenticated'](),controller[_0x71be('0xf')]);router[_0x71be('0xe')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x11')]);router[_0x71be('0xe')](_0x71be('0xd'),auth[_0x71be('0x8')](),controller[_0x71be('0x12')]);router[_0x71be('0x13')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x14')]);router[_0x71be('0x15')](_0x71be('0xa'),auth[_0x71be('0x8')](),controller[_0x71be('0x16')]);router[_0x71be('0x15')](_0x71be('0x10'),auth['isAuthenticated'](),controller[_0x71be('0x17')]);module[_0x71be('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 4a11e8b..fbef10e 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 _0xa699=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0xa699,0x6b));var _0x9a69=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0xa699[_0x21b36c];return _0x236627;};'use strict';var Sequelize=require(_0x9a69('0x0'));module[_0x9a69('0x1')]={'closed':{'type':Sequelize[_0x9a69('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9a69('0x3')]},'ratingType':{'type':Sequelize[_0x9a69('0x4')](_0x9a69('0x5'),_0x9a69('0x6')),'defaultValue':_0x9a69('0x5')},'ratingMessage':{'type':Sequelize[_0x9a69('0x7')]},'pathTranscript':{'type':Sequelize[_0x9a69('0x7')]},'mailTranscript':{'type':Sequelize[_0x9a69('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x9a69('0x9')]},'disposition':{'type':Sequelize[_0x9a69('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9a69('0x8')]},'note':{'type':Sequelize[_0x9a69('0x8')]},'browserName':{'type':Sequelize[_0x9a69('0x8')]},'browserVersion':{'type':Sequelize[_0x9a69('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9a69('0x8')]},'deviceModel':{'type':Sequelize[_0x9a69('0x8')]},'deviceVendor':{'type':Sequelize[_0x9a69('0x8')]},'deviceType':{'type':Sequelize[_0x9a69('0x8')]},'referer':{'type':Sequelize[_0x9a69('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x9a69('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x9a69('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x9a69('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x9a69('0x8')]},'customerPort':{'type':Sequelize[_0x9a69('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9a69('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3c0d=['DATE','long','out','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x578e15,_0x8e0df0){var _0x4c547d=function(_0x3c6888){while(--_0x3c6888){_0x578e15['push'](_0x578e15['shift']());}};_0x4c547d(++_0x8e0df0);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x4e823f,_0x1eb3f9){_0x4e823f=_0x4e823f-0x0;var _0x294b36=_0x3c0d[_0x4e823f];return _0x294b36;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd3c0('0x0')]},'ratingType':{'type':Sequelize[_0xd3c0('0x1')](_0xd3c0('0x2'),_0xd3c0('0x3')),'defaultValue':_0xd3c0('0x2')},'ratingMessage':{'type':Sequelize[_0xd3c0('0x4')]},'pathTranscript':{'type':Sequelize[_0xd3c0('0x4')]},'mailTranscript':{'type':Sequelize[_0xd3c0('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd3c0('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd3c0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd3c0('0x5')]},'browserName':{'type':Sequelize[_0xd3c0('0x5')]},'browserVersion':{'type':Sequelize[_0xd3c0('0x5')]},'osName':{'type':Sequelize[_0xd3c0('0x5')]},'osVersion':{'type':Sequelize[_0xd3c0('0x5')]},'deviceModel':{'type':Sequelize[_0xd3c0('0x5')]},'deviceVendor':{'type':Sequelize[_0xd3c0('0x5')]},'deviceType':{'type':Sequelize[_0xd3c0('0x5')]},'referer':{'type':Sequelize[_0xd3c0('0x4')]},'customerIp':{'type':Sequelize[_0xd3c0('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xd3c0('0x7'))},'read1stAt':{'type':Sequelize[_0xd3c0('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd3c0('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd3c0('0x5')]},'customerPort':{'type':Sequelize[_0xd3c0('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xd3c0('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 65116b4..cdb8371 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 _0x56ee=['type','key','getOptions','findAll','chat','query','user','model','filters','intersection','attributes','fields','length','include','options','find','create','update','params','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','POST','vidaooTopic','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','server/files/chat/upload/','format','now','pathTranscript','Messages','User','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','omit','ids','getMessages','keys','rawAttributes','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','push','addTags','setTags','spread','Tag','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closed','closedAt','toString','browserName','referer','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','out','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','http','client','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','then','destroy','stack','name','send','merge','body','contact','interaction','account','map','ChatInteraction'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x56ee,0x168));var _0xe56e=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x56ee[_0x45fc6a];return _0x14bcfd;};'use strict';var rimraf=require(_0xe56e('0x0'));var zipdir=require('zip-dir');var rp=require('request-promise');var moment=require(_0xe56e('0x1'));var BPromise=require(_0xe56e('0x2'));var Mustache=require(_0xe56e('0x3'));var util=require(_0xe56e('0x4'));var path=require('path');var ejs=require(_0xe56e('0x5'));var fs=require('fs');var _=require(_0xe56e('0x6'));var Redis=require(_0xe56e('0x7'));var interaction=require(_0xe56e('0x8'));var qs=require(_0xe56e('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xe56e('0xa'));var config=require(_0xe56e('0xb'));var db=require(_0xe56e('0xc'))['db'];config[_0xe56e('0xd')]=_[_0xe56e('0xe')](config[_0xe56e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')[_0xe56e('0xf')](socket);var jayson=require(_0xe56e('0x10'));var client=jayson['client'][_0xe56e('0x11')]({'port':0x232b});var client9004=jayson[_0xe56e('0x12')][_0xe56e('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x1fabdd,_0x61e6f3,_0x510931,_0x269fb2){return new BPromise(function(_0x1776aa,_0x54beeb){var _0x58a83e=_0x269fb2||client;return _0x58a83e['request'](_0x1fabdd,_0x510931)['then'](function(_0x18518c){logger[_0xe56e('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x61e6f3,_0xe56e('0x14'));logger[_0xe56e('0x15')](_0xe56e('0x16'),_0x61e6f3,_0xe56e('0x14'),JSON[_0xe56e('0x17')](_0x18518c));if(_0x18518c[_0xe56e('0x18')]){if(_0x18518c['error']['code']===0x1f4){logger[_0xe56e('0x18')](_0xe56e('0x19'),_0x61e6f3,_0x18518c[_0xe56e('0x18')][_0xe56e('0x1a')]);return _0x54beeb(_0x18518c[_0xe56e('0x18')]['message']);}logger[_0xe56e('0x18')](_0xe56e('0x19'),_0x61e6f3,_0x18518c[_0xe56e('0x18')][_0xe56e('0x1a')]);return _0x1776aa(_0x18518c[_0xe56e('0x18')]['message']);}else{logger[_0xe56e('0x13')](_0xe56e('0x19'),_0x61e6f3,_0xe56e('0x14'));_0x1776aa(_0x18518c[_0xe56e('0x1b')][_0xe56e('0x1a')]);}})[_0xe56e('0x1c')](function(_0x4a3622){logger[_0xe56e('0x18')](_0xe56e('0x19'),_0x61e6f3,_0x4a3622);_0x54beeb(_0x4a3622);});});}function respondWithStatusCode(_0x1549cf,_0x5b6cb5){_0x5b6cb5=_0x5b6cb5||0xcc;return function(_0x52a02a){if(_0x52a02a){return _0x1549cf[_0xe56e('0x1d')](_0x5b6cb5);}return _0x1549cf[_0xe56e('0x1e')](_0x5b6cb5)['end']();};}function respondWithResult(_0x544c73,_0x2a31ae){_0x2a31ae=_0x2a31ae||0xc8;return function(_0x26f0c5){if(_0x26f0c5){return _0x544c73[_0xe56e('0x1e')](_0x2a31ae)[_0xe56e('0x1f')](_0x26f0c5);}};}function respondWithFilteredResult(_0x37cbc7,_0x1ed369){return function(_0xe721f0){if(_0xe721f0){var _0x43d38f=typeof _0x1ed369['offset']===_0xe56e('0x20')&&typeof _0x1ed369[_0xe56e('0x21')]===_0xe56e('0x20');var _0xd27c6=_0xe721f0[_0xe56e('0x22')];var _0x56b7cb=_0x43d38f?0x0:_0x1ed369[_0xe56e('0x23')];var _0x1bd92b=_0x43d38f?_0xe721f0[_0xe56e('0x22')]:_0x1ed369[_0xe56e('0x23')]+_0x1ed369[_0xe56e('0x21')];var _0x391142;if(_0x1bd92b>=_0xd27c6){_0x1bd92b=_0xd27c6;_0x391142=0xc8;}else{_0x391142=0xce;}_0x37cbc7[_0xe56e('0x1e')](_0x391142);return _0x37cbc7[_0xe56e('0x24')](_0xe56e('0x25'),_0x56b7cb+'-'+_0x1bd92b+'/'+_0xd27c6)[_0xe56e('0x1f')](_0xe721f0);}return null;};}function saveUpdates(_0x3e1afa){return function(_0x15d850){if(_0x15d850){return _0x15d850['update'](_0x3e1afa)[_0xe56e('0x26')](function(_0x4c3acf){return _0x4c3acf;});}return null;};}function removeEntity(_0x3ef156){return function(_0x9942a){if(_0x9942a){return _0x9942a[_0xe56e('0x27')]()['then'](function(){_0x3ef156[_0xe56e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49674b){return function(_0x2f9992){if(!_0x2f9992){_0x49674b['sendStatus'](0x194);}return _0x2f9992;};}function handleError(_0x25f5db,_0x1852db){_0x1852db=_0x1852db||0x1f4;return function(_0x1c1526){logger[_0xe56e('0x18')](_0x1c1526[_0xe56e('0x28')]);if(_0x1c1526[_0xe56e('0x29')]){delete _0x1c1526[_0xe56e('0x29')];}_0x25f5db['status'](_0x1852db)[_0xe56e('0x2a')](_0x1c1526);};}function getMustacheRender(_0x1ca259,_0x2acef5){return Mustache['render'](_0x1ca259,_[_0xe56e('0x2b')](_0x2acef5[_0xe56e('0x2c')],{'contact':_0x2acef5[_0xe56e('0x2d')],'message':_0x2acef5['message'],'agent':_0x2acef5['agent'],'interaction':_0x2acef5[_0xe56e('0x2e')],'account':_0x2acef5[_0xe56e('0x2f')]}))||'';}exports['index']=function(_0xbec72b,_0x3ec2ac){var _0x341d70={};var _0x47d2e0=_[_0xe56e('0x30')](db[_0xe56e('0x31')]['rawAttributes'],function(_0xea8398){return{'name':_0xea8398['fieldName'],'type':_0xea8398[_0xe56e('0x32')][_0xe56e('0x33')]};});_0x341d70=qs[_0xe56e('0x34')](_0x47d2e0,_0xbec72b);return interaction[_0xe56e('0x35')](_0xe56e('0x36'),_0xbec72b[_0xe56e('0x37')],_0xbec72b[_0xe56e('0x38')],_0x341d70,_0x47d2e0)[_0xe56e('0x26')](respondWithFilteredResult(_0x3ec2ac,_0x341d70))['catch'](handleError(_0x3ec2ac,null));};exports['show']=function(_0x47726e,_0xf49a05){var _0x5e9fe2={'raw':![],'where':{'id':_0x47726e['params']['id']}},_0x26d3c5={};_0x26d3c5[_0xe56e('0x39')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x26d3c5[_0xe56e('0x37')]=_['keys'](_0x47726e[_0xe56e('0x37')]);_0x26d3c5[_0xe56e('0x3a')]=_[_0xe56e('0x3b')](_0x26d3c5[_0xe56e('0x39')],_0x26d3c5['query']);_0x5e9fe2[_0xe56e('0x3c')]=_['intersection'](_0x26d3c5[_0xe56e('0x39')],qs['fields'](_0x47726e[_0xe56e('0x37')][_0xe56e('0x3d')]));_0x5e9fe2[_0xe56e('0x3c')]=_0x5e9fe2[_0xe56e('0x3c')][_0xe56e('0x3e')]?_0x5e9fe2[_0xe56e('0x3c')]:_0x26d3c5[_0xe56e('0x39')];if(_0x47726e[_0xe56e('0x37')]['includeAll']){_0x5e9fe2[_0xe56e('0x3f')]=[{'all':!![]}];}_0x5e9fe2=_[_0xe56e('0x2b')]({},_0x5e9fe2,_0x47726e[_0xe56e('0x40')]);return db['ChatInteraction'][_0xe56e('0x41')](_0x5e9fe2)[_0xe56e('0x26')](handleEntityNotFound(_0xf49a05,null))[_0xe56e('0x26')](respondWithResult(_0xf49a05,null))['catch'](handleError(_0xf49a05,null));};exports[_0xe56e('0x42')]=function(_0x5bca6c,_0x162ee5){return db[_0xe56e('0x31')][_0xe56e('0x42')](_0x5bca6c[_0xe56e('0x2c')],{})[_0xe56e('0x26')](respondWithResult(_0x162ee5,0xc9))[_0xe56e('0x1c')](handleError(_0x162ee5,null));};exports[_0xe56e('0x43')]=function(_0x53703a,_0x5593a9){if(_0x53703a[_0xe56e('0x2c')]['id']){delete _0x53703a[_0xe56e('0x2c')]['id'];}return db[_0xe56e('0x31')]['find']({'where':{'id':_0x53703a['params']['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x5593a9,null))[_0xe56e('0x26')](saveUpdates(_0x53703a[_0xe56e('0x2c')],null))['then'](respondWithResult(_0x5593a9,null))[_0xe56e('0x1c')](handleError(_0x5593a9,null));};exports[_0xe56e('0x27')]=function(_0x508b73,_0x1ed5f4){return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x508b73[_0xe56e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ed5f4,null))['then'](removeEntity(_0x1ed5f4,null))[_0xe56e('0x1c')](handleError(_0x1ed5f4,null));};exports[_0xe56e('0x45')]=function(_0x3f3203,_0x48ed32){return db[_0xe56e('0x31')][_0xe56e('0x45')]()[_0xe56e('0x26')](respondWithResult(_0x48ed32,null))['catch'](handleError(_0x48ed32,null));};exports[_0xe56e('0x46')]=function(_0x2c0b42,_0x3698b8){var _0x38ee5f=_0x2c0b42[_0xe56e('0x44')]['id'];var _0x70e576;var _0x43a38e;var _0x173315;return db[_0xe56e('0x31')]['findOne']({'where':{'id':_0x38ee5f}})[_0xe56e('0x26')](function(_0x2c11b8){_0x70e576=_0x2c11b8;return db[_0xe56e('0x47')][_0xe56e('0x48')]({'where':{'id':_0x2c11b8[_0xe56e('0x49')]},'attributes':['id',_0xe56e('0x4a'),_0xe56e('0x4b'),'vidaooTopic',_0xe56e('0x4c'),_0xe56e('0x4d')],'raw':!![]});})['then'](function(_0x47b464){if(_0x47b464&&_0x47b464['vidaooApiKey']&&_0x47b464[_0xe56e('0x4b')]){_0x43a38e=_0x47b464;var _0x329f3f={'interaction':{'id':_0x38ee5f},'agent':{'id':_0x2c0b42[_0xe56e('0x38')]['id'],'name':_0x2c0b42['user']['name'],'fullname':_0x2c0b42[_0xe56e('0x38')]['fullname'],'email':_0x2c0b42[_0xe56e('0x38')][_0xe56e('0x4e')]},'contact':_0x2c0b42[_0xe56e('0x2c')][_0xe56e('0x2d')],'account':_0x2c0b42[_0xe56e('0x2c')]['account']};var _0x1bd835={'rejectUnauthorized':![],'method':_0xe56e('0x4f'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x47b464[_0xe56e('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2c0b42['user'][_0xe56e('0x4e')]],'buttons':null,'topic':_0x43a38e[_0xe56e('0x50')],'note':_['isNull'](_0x43a38e[_0xe56e('0x4c')])?null:getMustacheRender(_0x43a38e['vidaooNote'],_0x329f3f),'metadata':null},'redirect':_0xe56e('0x51'),'json':!![]};try{if(!_[_0xe56e('0x52')](_0x43a38e[_0xe56e('0x4d')])){var _0x3a64fb=getMustacheRender(_0x43a38e['vidaooMetadata'],_0x329f3f);var _0x227c57=JSON['parse'](_0x3a64fb);_0x1bd835[_0xe56e('0x2c')][_0xe56e('0x53')]=_0x227c57;}}catch(_0x32359a){throw new db[(_0xe56e('0x54'))][(_0xe56e('0x55'))](_0xe56e('0x56'));}return rp(_0x1bd835);}else{throw new db[(_0xe56e('0x54'))][(_0xe56e('0x55'))](_0xe56e('0x57'));}})[_0xe56e('0x26')](function(_0x42fd38){_0x173315=_0x42fd38;if(_0x173315['id']){var _0x295752={'body':_0x173315['join_url'],'ChatWebsiteId':_0x43a38e['id'],'ChatInteractionId':_0x70e576['id'],'direction':'out','UserId':_0x2c0b42[_0xe56e('0x38')]['id']};return db[_0xe56e('0x58')]['create'](_0x295752,{});}else{throw new db['Sequelize'][(_0xe56e('0x55'))](_0xe56e('0x59'));}})[_0xe56e('0x26')](function(){return _0x70e576['updateAttributes']({'vidaooSessionId':_0x173315['id']});})[_0xe56e('0x26')](respondWithResult(_0x3698b8,null))[_0xe56e('0x1c')](handleError(_0x3698b8,null));};exports[_0xe56e('0x5a')]=function(_0x2e0055,_0x26df35){if(_0x2e0055[_0xe56e('0x2c')]['id']){delete _0x2e0055[_0xe56e('0x2c')]['id'];}return db['ChatInteraction'][_0xe56e('0x41')]({'where':{'id':_0x2e0055['params']['id']},'include':[{'model':db[_0xe56e('0x5b')],'as':_0xe56e('0x5c')}]})[_0xe56e('0x26')](handleEntityNotFound(_0x26df35,null))['then'](saveUpdates(_0x2e0055[_0xe56e('0x2c')],null))[_0xe56e('0x26')](respondWithResult(_0x26df35,null))[_0xe56e('0x1c')](handleError(_0x26df35,null));};exports['abandon']=function(_0x5ede1e,_0x2309ec){if(_0x5ede1e[_0xe56e('0x2c')]['id']){delete _0x5ede1e['body']['id'];}return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x5ede1e[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](function(_0x5bb8a9){if(!_0x5bb8a9){logger['error'](_0xe56e('0x5d'),'abandon',0x194,'entity\x20not\x20found');_0x2309ec['sendStatus'](0x194);}else{if(_0x5bb8a9['UserId']){throw new db['Sequelize'][(_0xe56e('0x55'))](_0xe56e('0x5e'));}}return _0x5bb8a9;})[_0xe56e('0x26')](function(_0x244946){if(_0x244946){return _0x244946['update']({'closed':_0x5ede1e[_0xe56e('0x2c')]['closed'],'disposition':_0x5ede1e[_0xe56e('0x2c')][_0xe56e('0x5f')]})[_0xe56e('0x26')](function(_0x14c5fd){return _0x14c5fd;});}})[_0xe56e('0x26')](function(){return respondWithRpcPromise(_0xe56e('0x60'),_0xe56e('0x61'),_0x5ede1e[_0xe56e('0x2c')],client9004);})['then'](respondWithResult(_0x2309ec,null))[_0xe56e('0x1c')](handleError(_0x2309ec,null));};exports[_0xe56e('0x62')]=function(_0x9e487a,_0x2e1634){_0x9e487a['body']['name']=_0x9e487a[_0xe56e('0x63')][_0xe56e('0x64')];_0x9e487a[_0xe56e('0x2c')][_0xe56e('0x65')]=_0x9e487a[_0xe56e('0x63')][_0xe56e('0x66')];_0x9e487a['body']['type']=_0x9e487a['file'][_0xe56e('0x67')];return db[_0xe56e('0x68')][_0xe56e('0x42')](_0x9e487a[_0xe56e('0x2c')])['then'](respondWithResult(_0x2e1634,0xc9))[_0xe56e('0x1c')](handleError(_0x2e1634,null));};exports[_0xe56e('0x69')]=function(_0x153657,_0x419fe5){return db['ChatInteraction'][_0xe56e('0x48')]({'where':{'id':_0x153657[_0xe56e('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x419fe5,null))['then'](function(_0x30160d){if(_0x30160d){if(_0x30160d['closed']){return _0x419fe5[_0xe56e('0x1e')](0x193)['json']({'status':0x193,'message':_0xe56e('0x6a')});}return db[_0xe56e('0x68')][_0xe56e('0x48')]({'where':{'id':_0x153657[_0xe56e('0x37')][_0xe56e('0x6b')]},'raw':!![]})[_0xe56e('0x26')](handleEntityNotFound(_0x419fe5,null));}})['then'](function(_0x2a10fd){if(_0x2a10fd){var _0x22ec21=_0x2a10fd[_0xe56e('0x6c')]!==null;var _0x724547=path['join'](config[_0xe56e('0x6d')],_0xe56e('0x6e'));if(_0x22ec21){_0x724547=path[_0xe56e('0x6f')](_0x724547,_0xe56e('0x70'));}var _0x53a182=path[_0xe56e('0x6f')](_0x724547,_0x2a10fd[_0xe56e('0x65')]);return _0x419fe5[_0xe56e('0x71')](_0x53a182);}})[_0xe56e('0x1c')](handleError(_0x419fe5,null));};exports[_0xe56e('0x72')]=function(_0x289b69,_0x453a9c){var _0x2b8aaa=null;var _0x1f16c4=null;var _0x44ed4d=null;if(_0x289b69[_0xe56e('0x2c')]['id']){delete _0x289b69['body']['id'];}if(_0x289b69[_0xe56e('0x2c')]['mailTranscript']){_0x44ed4d=path[_0xe56e('0x6f')](config[_0xe56e('0x6d')],_0xe56e('0x73'),util[_0xe56e('0x74')]('transcript-%s.txt',Date[_0xe56e('0x75')]()));_0x289b69[_0xe56e('0x2c')][_0xe56e('0x76')]=_0x44ed4d;}return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x289b69[_0xe56e('0x44')]['id']},'include':[{'model':db[_0xe56e('0x58')],'as':_0xe56e('0x77'),'include':[{'model':db[_0xe56e('0x78')],'as':_0xe56e('0x78')}]}]})[_0xe56e('0x26')](handleEntityNotFound(_0x453a9c,null))[_0xe56e('0x26')](saveUpdates(_0x289b69[_0xe56e('0x2c')],null))[_0xe56e('0x26')](function(_0x2ffa3b){if(_0x2ffa3b){_0x2b8aaa=_0x2ffa3b;return db[_0xe56e('0x47')][_0xe56e('0x41')]({'where':{'id':_0x2b8aaa[_0xe56e('0x49')]}});}})[_0xe56e('0x26')](function(_0x26a2e3){if(_0x26a2e3){_0x1f16c4=_0x26a2e3;return db[_0xe56e('0x5b')][_0xe56e('0x41')]({'where':{'id':_0x2b8aaa[_0xe56e('0x79')]}});}})['then'](function(_0x2cb575){if(_0x2cb575){if(_0x44ed4d){var _0x3634b6=null;for(var _0x41d24b=0x1;_0x41d24b<_0x2b8aaa[_0xe56e('0x77')][_0xe56e('0x3e')];++_0x41d24b){_0x3634b6=_0x2b8aaa['Messages'][_0x41d24b];var _0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?util['format'](_0xe56e('0x7b'),_0x1f16c4[_0xe56e('0x7c')],_0x3634b6[_0xe56e('0x7a')]):_0xe56e('0x7d');var _0x1168b7=_0x289b69['body'][_0xe56e('0x7e')]||util[_0xe56e('0x74')](_0xe56e('0x7b'),_0xe56e('0x7f'),_0x3634b6[_0xe56e('0x79')]);switch(_0x1f16c4['agentIdentifier']){case'website_alias':_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?util[_0xe56e('0x74')](_0xe56e('0x7b'),_0x1f16c4[_0xe56e('0x7c')],_0x3634b6[_0xe56e('0x7a')]):_0xe56e('0x7d');break;case'agent_alias':_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?_0x3634b6[_0xe56e('0x78')][_0xe56e('0x80')]||_0x3634b6[_0xe56e('0x78')][_0xe56e('0x81')]:_0xe56e('0x7d');break;case _0xe56e('0x82'):_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?_0x3634b6[_0xe56e('0x78')]['fullname']:_0xe56e('0x7d');break;default:_0x4c51ad=_0x3634b6[_0xe56e('0x7a')]?util[_0xe56e('0x74')](_0xe56e('0x7b'),_0x1f16c4[_0xe56e('0x7c')],_0x3634b6[_0xe56e('0x7a')]):_0xe56e('0x7d');}var _0x1f915b=util[_0xe56e('0x74')](_0xe56e('0x83'),moment(_0x3634b6[_0xe56e('0x84')])[_0xe56e('0x74')](_0xe56e('0x85')),_0x3634b6[_0xe56e('0x86')]==='in'?_0x1168b7:_0x4c51ad,_0x3634b6[_0xe56e('0x2c')]);if(!_0x3634b6['secret']){fs[_0xe56e('0x87')](_0x44ed4d,_0x1f915b);}}return db[_0xe56e('0x88')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xe56e('0x89')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe56e('0x8a')],'as':_0xe56e('0x8a'),'raw':!![]}]}]});}}})[_0xe56e('0x26')](function(_0x37d0f0){if(!_0x37d0f0||!_0x37d0f0[_0xe56e('0x8b')]||!_0x289b69[_0xe56e('0x2c')])return _0x2b8aaa;var _0x307aee=_0x37d0f0[_0xe56e('0x8c')]();return respondWithRpcPromise(_0xe56e('0x8d'),'sendMail',{'account':_0x307aee,'message':{'from':util['format'](_0xe56e('0x8e'),_0x37d0f0[_0xe56e('0x29')],_0x37d0f0[_0xe56e('0x4e')]||_0x37d0f0[_0xe56e('0x8b')][_0xe56e('0x38')]),'to':_0x289b69['body'][_0xe56e('0x8f')],'subject':_0xe56e('0x90'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x289b69['body'][_0xe56e('0x8f')]),'attachments':[{'path':_0x44ed4d}]}})[_0xe56e('0x26')](function(){return _0x2b8aaa;})[_0xe56e('0x1c')](function(_0x46f1b4){logger[_0xe56e('0x18')](_0x46f1b4);});})[_0xe56e('0x26')](respondWithStatusCode(_0x453a9c,0xc8))['catch'](handleError(_0x453a9c,null));};exports['addMessage']=function(_0x593db3,_0x3117ce){return db[_0xe56e('0x58')][_0xe56e('0x41')]({'where':{'id':_0x593db3[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x3117ce,null))['then'](function(_0x1d5d81){if(_0x1d5d81){return _0x1d5d81[_0xe56e('0x91')](_0x593db3[_0xe56e('0x2c')]['ids'],_[_0xe56e('0x92')](_0x593db3[_0xe56e('0x2c')],[_0xe56e('0x93'),'id'])||{});}})[_0xe56e('0x26')](respondWithResult(_0x3117ce,null))['catch'](handleError(_0x3117ce,null));};exports[_0xe56e('0x94')]=function(_0x2d0e3d,_0x2f70cf){var _0x58fe52={'raw':![],'where':{}};var _0x5003f4={};var _0x5648d7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe56e('0x48')]({'where':{'id':_0x2d0e3d['params']['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x2f70cf,null))[_0xe56e('0x26')](function(_0x316dde){if(_0x316dde){_0x5003f4['model']=_[_0xe56e('0x95')](db['ChatMessage'][_0xe56e('0x96')]);_0x5003f4['query']=_[_0xe56e('0x95')](_0x2d0e3d[_0xe56e('0x37')]);_0x5003f4[_0xe56e('0x3a')]=_[_0xe56e('0x3b')](_0x5003f4[_0xe56e('0x39')],_0x5003f4[_0xe56e('0x37')]);_0x58fe52[_0xe56e('0x3c')]=_[_0xe56e('0x3b')](_0x5003f4[_0xe56e('0x39')],qs[_0xe56e('0x3d')](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x3d')]));_0x58fe52[_0xe56e('0x3c')]=_0x58fe52[_0xe56e('0x3c')][_0xe56e('0x3e')]?_0x58fe52[_0xe56e('0x3c')]:_0x5003f4['model'];if(!_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x97')](_0xe56e('0x98'))){_0x58fe52[_0xe56e('0x21')]=qs[_0xe56e('0x21')](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x21')]);_0x58fe52[_0xe56e('0x23')]=qs['offset'](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x23')]);}_0x58fe52[_0xe56e('0x99')]=qs[_0xe56e('0x9a')](_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x9a')]);_0x58fe52[_0xe56e('0x9b')]=qs[_0xe56e('0x3a')](_[_0xe56e('0x9c')](_0x2d0e3d[_0xe56e('0x37')],_0x5003f4[_0xe56e('0x3a')]));_0x58fe52['where'][_0xe56e('0x9d')]=_0x316dde['id'];if(_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x9e')]){_0x58fe52[_0xe56e('0x9b')]=_[_0xe56e('0x2b')](_0x58fe52['where'],{'$or':_['map'](_0x58fe52[_0xe56e('0x3c')],function(_0x26cff0){var _0x3587db={};_0x3587db[_0x26cff0]={'$like':'%'+_0x2d0e3d[_0xe56e('0x37')]['filter']+'%'};return _0x3587db;})});}if(_0x2d0e3d['query'][_0xe56e('0x9f')]){var _0x4115ae=_0x2d0e3d[_0xe56e('0x37')][_0xe56e('0x9f')][_0xe56e('0xa0')](',');var _0x27b422={};_0x27b422[_0x4115ae[0x0]]={'$gte':moment(_0x4115ae[0x1])[_0xe56e('0x74')](_0xe56e('0xa1'))};_0x58fe52[_0xe56e('0x9b')]=_[_0xe56e('0x2b')](_0x58fe52[_0xe56e('0x9b')],_0x27b422);}_0x58fe52=_[_0xe56e('0x2b')]({},_0x58fe52,_0x2d0e3d[_0xe56e('0x40')]);return db['ChatMessage'][_0xe56e('0x22')]({'where':_0x58fe52['where']})[_0xe56e('0x26')](function(_0x48cca0){_0x5648d7[_0xe56e('0x22')]=_0x48cca0;if(_0x2d0e3d['query']['includeAll']){_0x58fe52[_0xe56e('0x3f')]=[{'all':!![]}];}return db[_0xe56e('0x58')]['findAll'](_0x58fe52);})[_0xe56e('0x26')](function(_0x11ff43){_0x5648d7[_0xe56e('0xa2')]=_0x11ff43;return _0x5648d7;});}})['then'](respondWithFilteredResult(_0x2f70cf,_0x58fe52))[_0xe56e('0x1c')](handleError(_0x2f70cf,null));};exports[_0xe56e('0xa3')]=function(_0x39165a,_0x534e53){var _0x47de3={'where':{}},_0x3db5dd={},_0x7a1683={'count':0x0,'rows':[]};return db[_0xe56e('0x31')]['findOne']({'where':{'id':_0x39165a[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0x534e53,null))[_0xe56e('0x26')](function(_0x548ffa){if(_0x548ffa){_0x3db5dd[_0xe56e('0x39')]=_[_0xe56e('0x95')](db[_0xe56e('0x58')]['rawAttributes']);_0x3db5dd[_0xe56e('0x37')]=_['keys'](_0x39165a['query']);_0x3db5dd['filters']=_[_0xe56e('0x3b')](_0x3db5dd['model'],_0x3db5dd['query']);_0x47de3[_0xe56e('0x3c')]=_['intersection'](_0x3db5dd[_0xe56e('0x39')],qs['fields'](_0x39165a[_0xe56e('0x37')][_0xe56e('0x3d')]));_0x47de3[_0xe56e('0x3c')]=_0x47de3[_0xe56e('0x3c')][_0xe56e('0x3e')]?_0x47de3[_0xe56e('0x3c')]:_0x3db5dd['model'];if(!_0x39165a[_0xe56e('0x37')]['hasOwnProperty'](_0xe56e('0x98'))){_0x47de3[_0xe56e('0x21')]=qs['limit'](_0x39165a['query'][_0xe56e('0x21')]);_0x47de3[_0xe56e('0x23')]=qs['offset'](_0x39165a['query'][_0xe56e('0x23')]);}_0x47de3[_0xe56e('0x99')]=qs[_0xe56e('0x9a')](_0x39165a['query']['sort']);_0x47de3[_0xe56e('0x9b')]=qs[_0xe56e('0x3a')](_[_0xe56e('0x9c')](_0x39165a[_0xe56e('0x37')],_0x3db5dd['filters']));_0x47de3[_0xe56e('0x9b')][_0xe56e('0x9d')]=_0x548ffa['id'];if(_0x39165a['query'][_0xe56e('0x9e')]){_0x47de3[_0xe56e('0x9b')]=_[_0xe56e('0x2b')](_0x47de3['where'],{'$or':_[_0xe56e('0x30')](_0x47de3[_0xe56e('0x3c')],function(_0x226b22){var _0x371917={};_0x371917[_0x226b22]={'$like':'%'+_0x39165a['query'][_0xe56e('0x9e')]+'%'};return _0x371917;})});}_0x47de3[_0xe56e('0x9b')][_0xe56e('0xa4')]=![];if(_0x39165a['query']['id']){_0x47de3['where']['id']={'$gt':_0x39165a[_0xe56e('0x37')]['id']};}_0x47de3=_['merge']({},_0x47de3,_0x39165a[_0xe56e('0x40')]);return db[_0xe56e('0x58')]['count']({'where':_0x47de3[_0xe56e('0x9b')]})['then'](function(_0x3fd122){_0x7a1683[_0xe56e('0x22')]=_0x3fd122;_0x47de3['include']=[];if(_0x39165a[_0xe56e('0x37')][_0xe56e('0xa5')]){_0x47de3['include'][_0xe56e('0xa6')]({'model':db[_0xe56e('0x78')],'as':_0xe56e('0x78'),'attributes':['id',_0xe56e('0x81'),_0xe56e('0x80')]});}if(_0x39165a[_0xe56e('0x37')]['includeAll']){_0x47de3['include']=[{'all':!![]}];}return db[_0xe56e('0x58')]['findAll'](_0x47de3);})[_0xe56e('0x26')](function(_0x5aa35c){_0x7a1683[_0xe56e('0xa2')]=_0x5aa35c;return _0x7a1683;});}})[_0xe56e('0x26')](respondWithFilteredResult(_0x534e53,_0x47de3))[_0xe56e('0x1c')](handleError(_0x534e53,null));};exports[_0xe56e('0xa7')]=function(_0x4ca58c,_0xfe644d){return db[_0xe56e('0x31')]['find']({'where':{'id':_0x4ca58c[_0xe56e('0x44')]['id']}})[_0xe56e('0x26')](handleEntityNotFound(_0xfe644d,null))['then'](function(_0x534198){if(_0x534198){return _0x534198[_0xe56e('0xa8')](_0x4ca58c[_0xe56e('0x2c')][_0xe56e('0x93')],_['omit'](_0x4ca58c[_0xe56e('0x2c')],[_0xe56e('0x93'),'id'])||{})[_0xe56e('0xa9')](function(){return db[_0xe56e('0xaa')][_0xe56e('0x35')]({'attributes':['id',_0xe56e('0x29'),'color'],'where':{'id':_0x4ca58c[_0xe56e('0x2c')][_0xe56e('0x93')]}});})[_0xe56e('0x26')](function(_0x4eefae){socket['emit']('chatInteractionTags:save',{'id':Number(_0x4ca58c['params']['id']),'tags':_0x4eefae||[]});return{'id':Number(_0x4ca58c['params']['id']),'tags':_0x4eefae||[]};});}})['then'](respondWithResult(_0xfe644d,null))[_0xe56e('0x1c')](handleError(_0xfe644d,null));};exports['removeTags']=function(_0x8aedea,_0x312e05){return db[_0xe56e('0x31')]['find']({'where':{'id':_0x8aedea[_0xe56e('0x44')]['id']}})['then'](handleEntityNotFound(_0x312e05,null))[_0xe56e('0x26')](function(_0x4d97a3){if(_0x4d97a3){return _0x4d97a3['removeTags'](_0x8aedea[_0xe56e('0x37')][_0xe56e('0x93')]);}})[_0xe56e('0x26')](respondWithStatusCode(_0x312e05,null))[_0xe56e('0x1c')](handleError(_0x312e05,null));};exports[_0xe56e('0x71')]=function(_0x4a04a9,_0x473d38){var _0x576f6d=moment()[_0xe56e('0xab')]()['toString']();var _0x236c04=path[_0xe56e('0x6f')](config[_0xe56e('0x6d')],'server',_0xe56e('0xac'),_0xe56e('0xad'));var _0x2a7a40=path[_0xe56e('0x6f')](config[_0xe56e('0x6d')],_0xe56e('0xae'),'files',_0xe56e('0xaf'));var _0x156990=path[_0xe56e('0x6f')](_0x236c04,_0x576f6d);var _0x8f3301=util[_0xe56e('0x74')](_0xe56e('0xb0'),_0x4a04a9['params']['id'],_0x576f6d);var _0x3958af=path[_0xe56e('0x6f')](_0x236c04,_0x8f3301);var _0x3cb92b=[];_0x3cb92b[_0xe56e('0xa6')]({'model':db[_0xe56e('0x78')],'as':_0xe56e('0x78'),'attributes':['id',_0xe56e('0x81')],'raw':!![]});_0x3cb92b['push']({'model':db[_0xe56e('0x5b')],'as':_0xe56e('0x5c'),'attributes':['id',_0xe56e('0xb1'),_0xe56e('0xb2')],'raw':!![]});if(_0x4a04a9['query'][_0xe56e('0xaf')]){_0x3cb92b[_0xe56e('0xa6')]({'model':db[_0xe56e('0x68')],'as':_0xe56e('0x68'),'raw':!![]});}var _0x3140b9=[{'model':db['ChatMessage'],'as':_0xe56e('0x77'),'attributes':['id',_0xe56e('0x2c'),_0xe56e('0x84'),_0xe56e('0x86'),_0xe56e('0xa4'),_0xe56e('0xb3')],'include':_0x3cb92b}];_0x3140b9[_0xe56e('0xa6')]({'model':db['ChatWebsite'],'as':_0xe56e('0xb4'),'attributes':['id',_0xe56e('0x29')]});_0x3140b9[_0xe56e('0xa6')]({'model':db[_0xe56e('0x78')],'as':_0xe56e('0xb5'),'attributes':['id',_0xe56e('0x81')]});return db[_0xe56e('0x31')][_0xe56e('0x41')]({'where':{'id':_0x4a04a9['params']['id']},'include':_0x3140b9})[_0xe56e('0x26')](handleEntityNotFound(_0x473d38,null))[_0xe56e('0x26')](function(_0x412fc8){if(_0x412fc8){var _0x497979=_0x412fc8[_0xe56e('0xb6')]({'plain':!![]});fs[_0xe56e('0xb7')](_0x156990);var _0x249158={'channel':_0xe56e('0xb8'),'account':_0x497979[_0xe56e('0xb4')][_0xe56e('0x29')],'agent':_0x497979[_0xe56e('0xb5')]?_0x497979[_0xe56e('0xb5')][_0xe56e('0x81')]:_0xe56e('0xb9'),'createdAt':moment(_0x497979[_0xe56e('0x84')])[_0xe56e('0x74')](_0xe56e('0xa1'))['toString'](),'closedAt':_0x497979[_0xe56e('0xba')]?moment(_0x497979[_0xe56e('0xbb')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe56e('0xbc')]():'','disposition':_0x497979[_0xe56e('0x5f')],'chatInfo':{'browser':_0x497979[_0xe56e('0xbd')],'os':_0x497979['osName'],'referer':_0x497979[_0xe56e('0xbe')],'customerIp':_0x497979[_0xe56e('0xbf')],'customerPort':_0x497979[_0xe56e('0xc0')]?_0x497979[_0xe56e('0xc0')]:_0xe56e('0xb9')},'messages':_(_0x497979[_0xe56e('0x77')])[_0xe56e('0xc1')]()[_0xe56e('0x9e')]({'secret':![]})[_0xe56e('0x30')](function(_0xc46686){if(_0xc46686[_0xe56e('0x68')]){var _0x42d3b2=path[_0xe56e('0x6f')](_0x2a7a40,_0xc46686['Attachment'][_0xe56e('0x65')]);if(fs['existsSync'](_0x42d3b2)){fs[_0xe56e('0xc2')](_0x42d3b2)[_0xe56e('0xc3')](fs[_0xe56e('0xc4')](path[_0xe56e('0x6f')](_0x156990,_0xc46686[_0xe56e('0x68')]['basename'])));}}return{'date':moment(_0xc46686['createdAt'])[_0xe56e('0x74')](_0xe56e('0xa1'))[_0xe56e('0xbc')](),'sender':_0xc46686[_0xe56e('0x86')]===_0xe56e('0xc5')?_0xc46686[_0xe56e('0x78')]?_0xc46686['User'][_0xe56e('0x81')]:_0xe56e('0x7d'):_0xc46686['Contact'][_0xe56e('0xb1')]+(_0xc46686[_0xe56e('0x5c')][_0xe56e('0xb2')]?'\x20'+_0xc46686[_0xe56e('0x5c')][_0xe56e('0xb2')]:''),'body':_0xc46686[_0xe56e('0x68')]?_0xc46686[_0xe56e('0x68')]['basename']:_0xc46686[_0xe56e('0x2c')],'direction':_0xc46686[_0xe56e('0x86')]===_0xe56e('0xc5')?'A':'C','secret':_0xc46686['secret'],'read':_0xc46686[_0xe56e('0xb3')],'attachment':_0xc46686[_0xe56e('0x68')]};})[_0xe56e('0xc6')]()};return ejs['renderFile'](path['join'](config[_0xe56e('0x6d')],_0xe56e('0xae'),'views',_0xe56e('0xc7')),{'interaction':_0x249158})[_0xe56e('0x26')](function(_0x376b50){var _0x24eb5e=path[_0xe56e('0x6f')](_0x156990,_0xe56e('0xc8')+_0x497979['id']+'-'+_0x576f6d+_0xe56e('0xc9'));var _0x23e239={'path':_0x24eb5e,'channel':'Chat','interactionId':_0x497979['id']};return pdf[_0xe56e('0xca')](_0x376b50,_0x23e239);})[_0xe56e('0x26')](function(){return new Promise(function(_0x588eed,_0x4ac2e6){zipdir(_0x156990,{'saveTo':_0x3958af},function(_0x517873,_0x50b1bc){if(_0x517873)return _0x4ac2e6(_0x517873);return _0x588eed(_0x50b1bc);});})['then'](function(){return new BPromise(function(_0x5e9fb7,_0xd34613){rimraf(_0x156990,function(_0x2116c1){if(_0x2116c1)_0xd34613(_0x2116c1);return _0x5e9fb7();});});})[_0xe56e('0x26')](function(){return _0x473d38[_0xe56e('0x71')](_0x3958af,_0x8f3301,function(_0x3604ab){if(_0x3604ab){logger[_0xe56e('0x18')](_0xe56e('0xcb'),_0x3604ab);}else{fs[_0xe56e('0xcc')](_0x3958af);}});});});}else{return _0x473d38[_0xe56e('0x1d')](0xc8);}})[_0xe56e('0x1c')](handleError(_0x473d38,null));}; \ No newline at end of file +var _0xdfd5=['order','ChatInteractionId','includeAgent','push','rows','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','files','tmp','transcript-%d-%s.zip','lastName','attachments','read','Account','mkdirSync','Chat','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createWriteStream','firstName','value','server','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','merge','body','contact','agent','interaction','map','rawAttributes','fieldName','type','key','findAll','chat','query','user','show','params','model','keys','ChatInteraction','filters','intersection','fields','attributes','includeAll','include','options','create','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooEscalation','vidaooMetadata','vidaooApiKey','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ContactId','Messages','length','agentAlias','System','customer','Visitor','website_alias','%s%d','agent_alias','alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','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','hasOwnProperty','nolimit','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMyMessages'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfd5,0x1c3));var _0x5dfd=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xdfd5[_0xc0a3d3];return _0x3386e8;};'use strict';var rimraf=require(_0x5dfd('0x0'));var zipdir=require(_0x5dfd('0x1'));var rp=require(_0x5dfd('0x2'));var moment=require(_0x5dfd('0x3'));var BPromise=require(_0x5dfd('0x4'));var Mustache=require(_0x5dfd('0x5'));var util=require(_0x5dfd('0x6'));var path=require(_0x5dfd('0x7'));var ejs=require(_0x5dfd('0x8'));var fs=require('fs');var _=require(_0x5dfd('0x9'));var Redis=require(_0x5dfd('0xa'));var interaction=require(_0x5dfd('0xb'));var qs=require('../../components/parsers/qs');var pdf=require(_0x5dfd('0xc'));var logger=require(_0x5dfd('0xd'))('api');var config=require(_0x5dfd('0xe'));var db=require('../../mysqldb')['db'];config[_0x5dfd('0xf')]=_[_0x5dfd('0x10')](config[_0x5dfd('0xf')],{'host':_0x5dfd('0x11'),'port':0x18eb});var socket=require(_0x5dfd('0x12'))(new Redis(config[_0x5dfd('0xf')]));require('./chatInteraction.socket')[_0x5dfd('0x13')](socket);var jayson=require(_0x5dfd('0x14'));var client=jayson[_0x5dfd('0x15')][_0x5dfd('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x5dfd('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x567186,_0x5e63cd,_0xa31e,_0x22c24c){return new BPromise(function(_0xbc4f07,_0x5f5342){var _0x4dfecd=_0x22c24c||client;return _0x4dfecd[_0x5dfd('0x17')](_0x567186,_0xa31e)[_0x5dfd('0x18')](function(_0x1b265e){logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));logger[_0x5dfd('0x1c')](_0x5dfd('0x1d'),_0x5e63cd,_0x5dfd('0x1b'),JSON[_0x5dfd('0x1e')](_0x1b265e));if(_0x1b265e[_0x5dfd('0x1f')]){if(_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x20')]===0x1f4){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0x5f5342(_0x1b265e['error']['message']);}logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0x1b265e[_0x5dfd('0x1f')][_0x5dfd('0x21')]);return _0xbc4f07(_0x1b265e['error']['message']);}else{logger[_0x5dfd('0x19')](_0x5dfd('0x1a'),_0x5e63cd,_0x5dfd('0x1b'));_0xbc4f07(_0x1b265e['result'][_0x5dfd('0x21')]);}})[_0x5dfd('0x22')](function(_0xa72fe0){logger[_0x5dfd('0x1f')](_0x5dfd('0x1a'),_0x5e63cd,_0xa72fe0);_0x5f5342(_0xa72fe0);});});}function respondWithStatusCode(_0x25f52d,_0x11de10){_0x11de10=_0x11de10||0xcc;return function(_0x1fe62a){if(_0x1fe62a){return _0x25f52d[_0x5dfd('0x23')](_0x11de10);}return _0x25f52d[_0x5dfd('0x24')](_0x11de10)[_0x5dfd('0x25')]();};}function respondWithResult(_0x3b2bc5,_0x1ee99f){_0x1ee99f=_0x1ee99f||0xc8;return function(_0x149c22){if(_0x149c22){return _0x3b2bc5[_0x5dfd('0x24')](_0x1ee99f)[_0x5dfd('0x26')](_0x149c22);}};}function respondWithFilteredResult(_0x5165f4,_0x5ee86b){return function(_0x1a2f90){if(_0x1a2f90){var _0x96e0aa=typeof _0x5ee86b[_0x5dfd('0x27')]===_0x5dfd('0x28')&&typeof _0x5ee86b[_0x5dfd('0x29')]===_0x5dfd('0x28');var _0x24f158=_0x1a2f90[_0x5dfd('0x2a')];var _0x350ee2=_0x96e0aa?0x0:_0x5ee86b[_0x5dfd('0x27')];var _0x3230ab=_0x96e0aa?_0x1a2f90[_0x5dfd('0x2a')]:_0x5ee86b[_0x5dfd('0x27')]+_0x5ee86b[_0x5dfd('0x29')];var _0x41a7c5;if(_0x3230ab>=_0x24f158){_0x3230ab=_0x24f158;_0x41a7c5=0xc8;}else{_0x41a7c5=0xce;}_0x5165f4[_0x5dfd('0x24')](_0x41a7c5);return _0x5165f4[_0x5dfd('0x2b')](_0x5dfd('0x2c'),_0x350ee2+'-'+_0x3230ab+'/'+_0x24f158)['json'](_0x1a2f90);}return null;};}function saveUpdates(_0x13bc15){return function(_0x3c3b30){if(_0x3c3b30){return _0x3c3b30['update'](_0x13bc15)['then'](function(_0x15b12f){return _0x15b12f;});}return null;};}function removeEntity(_0x57d752){return function(_0x286a37){if(_0x286a37){return _0x286a37[_0x5dfd('0x2d')]()[_0x5dfd('0x18')](function(){_0x57d752[_0x5dfd('0x24')](0xcc)[_0x5dfd('0x25')]();});}};}function handleEntityNotFound(_0x296624){return function(_0x40dff6){if(!_0x40dff6){_0x296624['sendStatus'](0x194);}return _0x40dff6;};}function handleError(_0x26416b,_0x11b367){_0x11b367=_0x11b367||0x1f4;return function(_0x5cd921){logger['error'](_0x5cd921[_0x5dfd('0x2e')]);if(_0x5cd921[_0x5dfd('0x2f')]){delete _0x5cd921[_0x5dfd('0x2f')];}_0x26416b[_0x5dfd('0x24')](_0x11b367)['send'](_0x5cd921);};}function getMustacheRender(_0x434eb1,_0x5b8a61){return Mustache[_0x5dfd('0x30')](_0x434eb1,_[_0x5dfd('0x31')](_0x5b8a61[_0x5dfd('0x32')],{'contact':_0x5b8a61[_0x5dfd('0x33')],'message':_0x5b8a61[_0x5dfd('0x21')],'agent':_0x5b8a61[_0x5dfd('0x34')],'interaction':_0x5b8a61[_0x5dfd('0x35')],'account':_0x5b8a61['account']}))||'';}exports['index']=function(_0x263f18,_0x13d7d3){var _0x5dc4be={};var _0x218b46=_[_0x5dfd('0x36')](db['ChatInteraction'][_0x5dfd('0x37')],function(_0x4ebc78){return{'name':_0x4ebc78[_0x5dfd('0x38')],'type':_0x4ebc78[_0x5dfd('0x39')][_0x5dfd('0x3a')]};});_0x5dc4be=qs['getOptions'](_0x218b46,_0x263f18);return interaction[_0x5dfd('0x3b')](_0x5dfd('0x3c'),_0x263f18[_0x5dfd('0x3d')],_0x263f18[_0x5dfd('0x3e')],_0x5dc4be,_0x218b46)[_0x5dfd('0x18')](respondWithFilteredResult(_0x13d7d3,_0x5dc4be))['catch'](handleError(_0x13d7d3,null));};exports[_0x5dfd('0x3f')]=function(_0x18ac03,_0x4680a4){var _0x5f153={'raw':![],'where':{'id':_0x18ac03[_0x5dfd('0x40')]['id']}},_0x5928d3={};_0x5928d3[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x43')]['rawAttributes']);_0x5928d3[_0x5dfd('0x3d')]=_['keys'](_0x18ac03[_0x5dfd('0x3d')]);_0x5928d3[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],_0x5928d3[_0x5dfd('0x3d')]);_0x5f153['attributes']=_[_0x5dfd('0x45')](_0x5928d3[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x5f153[_0x5dfd('0x47')]=_0x5f153[_0x5dfd('0x47')]['length']?_0x5f153[_0x5dfd('0x47')]:_0x5928d3[_0x5dfd('0x41')];if(_0x18ac03[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x5f153[_0x5dfd('0x49')]=[{'all':!![]}];}_0x5f153=_[_0x5dfd('0x31')]({},_0x5f153,_0x18ac03[_0x5dfd('0x4a')]);return db[_0x5dfd('0x43')]['find'](_0x5f153)[_0x5dfd('0x18')](handleEntityNotFound(_0x4680a4,null))[_0x5dfd('0x18')](respondWithResult(_0x4680a4,null))[_0x5dfd('0x22')](handleError(_0x4680a4,null));};exports[_0x5dfd('0x4b')]=function(_0x2d3aa5,_0x136f15){return db[_0x5dfd('0x43')][_0x5dfd('0x4b')](_0x2d3aa5[_0x5dfd('0x32')],{})[_0x5dfd('0x18')](respondWithResult(_0x136f15,0xc9))[_0x5dfd('0x22')](handleError(_0x136f15,null));};exports[_0x5dfd('0x4c')]=function(_0x3ce5fd,_0x24361d){if(_0x3ce5fd['body']['id']){delete _0x3ce5fd[_0x5dfd('0x32')]['id'];}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x3ce5fd['params']['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x24361d,null))[_0x5dfd('0x18')](saveUpdates(_0x3ce5fd[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x24361d,null))[_0x5dfd('0x22')](handleError(_0x24361d,null));};exports[_0x5dfd('0x2d')]=function(_0x4f57ae,_0x422706){return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x4f57ae[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x422706,null))[_0x5dfd('0x18')](removeEntity(_0x422706,null))[_0x5dfd('0x22')](handleError(_0x422706,null));};exports[_0x5dfd('0x4e')]=function(_0x2e19bb,_0x166ced){return db['ChatInteraction'][_0x5dfd('0x4e')]()[_0x5dfd('0x18')](respondWithResult(_0x166ced,null))[_0x5dfd('0x22')](handleError(_0x166ced,null));};exports['createVidaooSession']=function(_0x71ba3e,_0x32532d){var _0x3865e5=_0x71ba3e[_0x5dfd('0x40')]['id'];var _0x333035;var _0xd98c0f;var _0x40e9d7;return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x3865e5}})['then'](function(_0x28c84a){_0x333035=_0x28c84a;return db[_0x5dfd('0x50')]['findOne']({'where':{'id':_0x28c84a[_0x5dfd('0x51')]},'attributes':['id','vidaooApiKey',_0x5dfd('0x52'),'vidaooTopic','vidaooNote',_0x5dfd('0x53')],'raw':!![]});})[_0x5dfd('0x18')](function(_0x4f3af6){if(_0x4f3af6&&_0x4f3af6[_0x5dfd('0x54')]&&_0x4f3af6[_0x5dfd('0x52')]){_0xd98c0f=_0x4f3af6;var _0x2f38c5={'interaction':{'id':_0x3865e5},'agent':{'id':_0x71ba3e[_0x5dfd('0x3e')]['id'],'name':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x2f')],'fullname':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x55')],'email':_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]},'contact':_0x71ba3e['body'][_0x5dfd('0x33')],'account':_0x71ba3e[_0x5dfd('0x32')][_0x5dfd('0x57')]};var _0x2d8585={'rejectUnauthorized':![],'method':_0x5dfd('0x58'),'url':_0x5dfd('0x59'),'headers':{'X-APIKEY':_0x4f3af6[_0x5dfd('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x71ba3e[_0x5dfd('0x3e')][_0x5dfd('0x56')]],'buttons':null,'topic':_0xd98c0f[_0x5dfd('0x5a')],'note':_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x5c')])?null:getMustacheRender(_0xd98c0f[_0x5dfd('0x5c')],_0x2f38c5),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x5dfd('0x5b')](_0xd98c0f[_0x5dfd('0x53')])){var _0xe2649d=getMustacheRender(_0xd98c0f[_0x5dfd('0x53')],_0x2f38c5);var _0x5726df=JSON['parse'](_0xe2649d);_0x2d8585[_0x5dfd('0x32')][_0x5dfd('0x5d')]=_0x5726df;}}catch(_0x642260){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2d8585);}else{throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x60'));}})['then'](function(_0x11334e){_0x40e9d7=_0x11334e;if(_0x40e9d7['id']){var _0x4b8f19={'body':_0x40e9d7['join_url'],'ChatWebsiteId':_0xd98c0f['id'],'ChatInteractionId':_0x333035['id'],'direction':_0x5dfd('0x61'),'UserId':_0x71ba3e['user']['id']};return db[_0x5dfd('0x62')]['create'](_0x4b8f19,{});}else{throw new db['Sequelize'][(_0x5dfd('0x5f'))](_0x5dfd('0x63'));}})[_0x5dfd('0x18')](function(){return _0x333035[_0x5dfd('0x64')]({'vidaooSessionId':_0x40e9d7['id']});})[_0x5dfd('0x18')](respondWithResult(_0x32532d,null))['catch'](handleError(_0x32532d,null));};exports['customUpdate']=function(_0x177168,_0x476020){if(_0x177168[_0x5dfd('0x32')]['id']){delete _0x177168['body']['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x177168[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x65')],'as':_0x5dfd('0x66')}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x476020,null))['then'](saveUpdates(_0x177168[_0x5dfd('0x32')],null))[_0x5dfd('0x18')](respondWithResult(_0x476020,null))['catch'](handleError(_0x476020,null));};exports['abandon']=function(_0x4766c5,_0x34357c){if(_0x4766c5[_0x5dfd('0x32')]['id']){delete _0x4766c5[_0x5dfd('0x32')]['id'];}return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4766c5['params']['id']}})[_0x5dfd('0x18')](function(_0x355b5e){if(!_0x355b5e){logger[_0x5dfd('0x1f')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5dfd('0x67'),0x194,_0x5dfd('0x68'));_0x34357c[_0x5dfd('0x23')](0x194);}else{if(_0x355b5e[_0x5dfd('0x69')]){throw new db[(_0x5dfd('0x5e'))][(_0x5dfd('0x5f'))](_0x5dfd('0x6a'));}}return _0x355b5e;})[_0x5dfd('0x18')](function(_0x5c5583){if(_0x5c5583){return _0x5c5583[_0x5dfd('0x4c')]({'closed':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6b')],'disposition':_0x4766c5[_0x5dfd('0x32')][_0x5dfd('0x6c')]})[_0x5dfd('0x18')](function(_0x3de061){return _0x3de061;});}})[_0x5dfd('0x18')](function(){return respondWithRpcPromise(_0x5dfd('0x6d'),_0x5dfd('0x67'),_0x4766c5[_0x5dfd('0x32')],client9004);})['then'](respondWithResult(_0x34357c,null))['catch'](handleError(_0x34357c,null));};exports[_0x5dfd('0x6e')]=function(_0x3dd887,_0x2ae1fe){_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x2f')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x70')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x71')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x72')];_0x3dd887[_0x5dfd('0x32')][_0x5dfd('0x39')]=_0x3dd887[_0x5dfd('0x6f')][_0x5dfd('0x73')];return db[_0x5dfd('0x74')]['create'](_0x3dd887['body'])[_0x5dfd('0x18')](respondWithResult(_0x2ae1fe,0xc9))[_0x5dfd('0x22')](handleError(_0x2ae1fe,null));};exports['attachmentDownload']=function(_0x1d8f5f,_0x5b75e4){return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f[_0x5dfd('0x40')]['id']},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null))[_0x5dfd('0x18')](function(_0x158a97){if(_0x158a97){if(_0x158a97[_0x5dfd('0x6b')]){return _0x5b75e4[_0x5dfd('0x24')](0x193)[_0x5dfd('0x26')]({'status':0x193,'message':_0x5dfd('0x75')});}return db['Attachment'][_0x5dfd('0x4f')]({'where':{'id':_0x1d8f5f['query'][_0x5dfd('0x76')]},'raw':!![]})[_0x5dfd('0x18')](handleEntityNotFound(_0x5b75e4,null));}})['then'](function(_0xc20fa7){if(_0xc20fa7){var _0x2df00c=_0xc20fa7['ChatOfflineMessageId']!==null;var _0x522d2e=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x79'));if(_0x2df00c){_0x522d2e=path[_0x5dfd('0x77')](_0x522d2e,'offline-chat/');}var _0x35d594=path['join'](_0x522d2e,_0xc20fa7[_0x5dfd('0x71')]);return _0x5b75e4['download'](_0x35d594);}})['catch'](handleError(_0x5b75e4,null));};exports['close']=function(_0x36c9fa,_0x2bb094){var _0x4118de=null;var _0x1f57a0=null;var _0x4be4c1=null;if(_0x36c9fa[_0x5dfd('0x32')]['id']){delete _0x36c9fa['body']['id'];}if(_0x36c9fa['body'][_0x5dfd('0x7a')]){_0x4be4c1=path[_0x5dfd('0x77')](config[_0x5dfd('0x78')],_0x5dfd('0x7b'),util[_0x5dfd('0x7c')](_0x5dfd('0x7d'),Date[_0x5dfd('0x7e')]()));_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7f')]=_0x4be4c1;}return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0x36c9fa[_0x5dfd('0x40')]['id']},'include':[{'model':db[_0x5dfd('0x62')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0x5dfd('0x18')](handleEntityNotFound(_0x2bb094,null))[_0x5dfd('0x18')](saveUpdates(_0x36c9fa['body'],null))[_0x5dfd('0x18')](function(_0x20d94f){if(_0x20d94f){_0x4118de=_0x20d94f;return db[_0x5dfd('0x50')][_0x5dfd('0x4d')]({'where':{'id':_0x4118de['ChatWebsiteId']}});}})[_0x5dfd('0x18')](function(_0x1abfac){if(_0x1abfac){_0x1f57a0=_0x1abfac;return db[_0x5dfd('0x65')]['find']({'where':{'id':_0x4118de[_0x5dfd('0x80')]}});}})[_0x5dfd('0x18')](function(_0x2bd84b){if(_0x2bd84b){if(_0x4be4c1){var _0x14eec1=null;for(var _0x45a598=0x1;_0x45a598<_0x4118de[_0x5dfd('0x81')][_0x5dfd('0x82')];++_0x45a598){_0x14eec1=_0x4118de['Messages'][_0x45a598];var _0xabe737=_0x14eec1[_0x5dfd('0x69')]?util[_0x5dfd('0x7c')]('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');var _0x57c664=_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x85')]||util[_0x5dfd('0x7c')]('%s%d',_0x5dfd('0x86'),_0x14eec1[_0x5dfd('0x80')]);switch(_0x1f57a0['agentIdentifier']){case _0x5dfd('0x87'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format'](_0x5dfd('0x88'),_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');break;case _0x5dfd('0x89'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1['User'][_0x5dfd('0x8a')]||_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;case _0x5dfd('0x8c'):_0xabe737=_0x14eec1[_0x5dfd('0x69')]?_0x14eec1[_0x5dfd('0x8b')][_0x5dfd('0x55')]:_0x5dfd('0x84');break;default:_0xabe737=_0x14eec1[_0x5dfd('0x69')]?util['format']('%s%d',_0x1f57a0[_0x5dfd('0x83')],_0x14eec1[_0x5dfd('0x69')]):_0x5dfd('0x84');}var _0x27e002=util[_0x5dfd('0x7c')](_0x5dfd('0x8d'),moment(_0x14eec1[_0x5dfd('0x8e')])[_0x5dfd('0x7c')](_0x5dfd('0x8f')),_0x14eec1[_0x5dfd('0x90')]==='in'?_0x57c664:_0xabe737,_0x14eec1[_0x5dfd('0x32')]);if(!_0x14eec1[_0x5dfd('0x91')]){fs[_0x5dfd('0x92')](_0x4be4c1,_0x27e002);}}return db['MailAccount'][_0x5dfd('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0x5dfd('0x93')],'as':_0x5dfd('0x94'),'raw':!![],'include':[{'model':db[_0x5dfd('0x95')],'as':_0x5dfd('0x95'),'raw':!![]}]}]});}}})[_0x5dfd('0x18')](function(_0xea5e0){if(!_0xea5e0||!_0xea5e0[_0x5dfd('0x94')]||!_0x36c9fa[_0x5dfd('0x32')])return _0x4118de;var _0xb8a62b=_0xea5e0['getSmtpOptions']();return respondWithRpcPromise(_0x5dfd('0x96'),'sendMail',{'account':_0xb8a62b,'message':{'from':util[_0x5dfd('0x7c')](_0x5dfd('0x97'),_0xea5e0[_0x5dfd('0x2f')],_0xea5e0[_0x5dfd('0x56')]||_0xea5e0[_0x5dfd('0x94')][_0x5dfd('0x3e')]),'to':_0x36c9fa[_0x5dfd('0x32')][_0x5dfd('0x7a')],'subject':_0x5dfd('0x98'),'text':util[_0x5dfd('0x7c')](_0x5dfd('0x99'),_0x36c9fa['body'][_0x5dfd('0x7a')]),'attachments':[{'path':_0x4be4c1}]}})[_0x5dfd('0x18')](function(){return _0x4118de;})[_0x5dfd('0x22')](function(_0x421991){logger[_0x5dfd('0x1f')](_0x421991);});})[_0x5dfd('0x18')](respondWithStatusCode(_0x2bb094,0xc8))[_0x5dfd('0x22')](handleError(_0x2bb094,null));};exports[_0x5dfd('0x9a')]=function(_0x1d8b85,_0x2e4360){return db[_0x5dfd('0x62')][_0x5dfd('0x4d')]({'where':{'id':_0x1d8b85[_0x5dfd('0x40')]['id']}})['then'](handleEntityNotFound(_0x2e4360,null))[_0x5dfd('0x18')](function(_0x2fc5f6){if(_0x2fc5f6){return _0x2fc5f6[_0x5dfd('0x9a')](_0x1d8b85[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x1d8b85[_0x5dfd('0x32')],[_0x5dfd('0x9b'),'id'])||{});}})[_0x5dfd('0x18')](respondWithResult(_0x2e4360,null))[_0x5dfd('0x22')](handleError(_0x2e4360,null));};exports['getMessages']=function(_0x16d6e8,_0x29b226){var _0x253810={'raw':![],'where':{}};var _0x9bc8a2={};var _0x4fe0a7={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dfd('0x4f')]({'where':{'id':_0x16d6e8[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x29b226,null))[_0x5dfd('0x18')](function(_0x340282){if(_0x340282){_0x9bc8a2[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x9bc8a2['query']=_[_0x5dfd('0x42')](_0x16d6e8[_0x5dfd('0x3d')]);_0x9bc8a2['filters']=_[_0x5dfd('0x45')](_0x9bc8a2[_0x5dfd('0x41')],_0x9bc8a2[_0x5dfd('0x3d')]);_0x253810['attributes']=_['intersection'](_0x9bc8a2[_0x5dfd('0x41')],qs[_0x5dfd('0x46')](_0x16d6e8[_0x5dfd('0x3d')]['fields']));_0x253810['attributes']=_0x253810['attributes'][_0x5dfd('0x82')]?_0x253810['attributes']:_0x9bc8a2[_0x5dfd('0x41')];if(!_0x16d6e8['query'][_0x5dfd('0x9d')](_0x5dfd('0x9e'))){_0x253810[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x253810[_0x5dfd('0x27')]=qs[_0x5dfd('0x27')](_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x253810['order']=qs[_0x5dfd('0x9f')](_0x16d6e8[_0x5dfd('0x3d')]['sort']);_0x253810[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x16d6e8[_0x5dfd('0x3d')],_0x9bc8a2[_0x5dfd('0x44')]));_0x253810[_0x5dfd('0xa0')]['ChatInteractionId']=_0x340282['id'];if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x253810['where']=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],{'$or':_[_0x5dfd('0x36')](_0x253810[_0x5dfd('0x47')],function(_0x45e502){var _0xddded4={};_0xddded4[_0x45e502]={'$like':'%'+_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa2')]+'%'};return _0xddded4;})});}if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')]){var _0x5be9a2=_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0xa3')][_0x5dfd('0xa4')](',');var _0x4777f8={};_0x4777f8[_0x5be9a2[0x0]]={'$gte':moment(_0x5be9a2[0x1])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))};_0x253810[_0x5dfd('0xa0')]=_[_0x5dfd('0x31')](_0x253810[_0x5dfd('0xa0')],_0x4777f8);}_0x253810=_[_0x5dfd('0x31')]({},_0x253810,_0x16d6e8[_0x5dfd('0x4a')]);return db['ChatMessage']['count']({'where':_0x253810['where']})[_0x5dfd('0x18')](function(_0x55051b){_0x4fe0a7[_0x5dfd('0x2a')]=_0x55051b;if(_0x16d6e8[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x253810['include']=[{'all':!![]}];}return db[_0x5dfd('0x62')][_0x5dfd('0x3b')](_0x253810);})[_0x5dfd('0x18')](function(_0x4c2e7b){_0x4fe0a7['rows']=_0x4c2e7b;return _0x4fe0a7;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x29b226,_0x253810))['catch'](handleError(_0x29b226,null));};exports[_0x5dfd('0xa6')]=function(_0x460008,_0x28bd3b){var _0x204d36={'where':{}},_0x551579={},_0x13b2a1={'count':0x0,'rows':[]};return db[_0x5dfd('0x43')][_0x5dfd('0x4f')]({'where':{'id':_0x460008[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x28bd3b,null))[_0x5dfd('0x18')](function(_0x21c7f1){if(_0x21c7f1){_0x551579[_0x5dfd('0x41')]=_[_0x5dfd('0x42')](db[_0x5dfd('0x62')][_0x5dfd('0x37')]);_0x551579[_0x5dfd('0x3d')]=_[_0x5dfd('0x42')](_0x460008[_0x5dfd('0x3d')]);_0x551579[_0x5dfd('0x44')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],_0x551579[_0x5dfd('0x3d')]);_0x204d36[_0x5dfd('0x47')]=_[_0x5dfd('0x45')](_0x551579[_0x5dfd('0x41')],qs['fields'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x46')]));_0x204d36[_0x5dfd('0x47')]=_0x204d36[_0x5dfd('0x47')][_0x5dfd('0x82')]?_0x204d36[_0x5dfd('0x47')]:_0x551579['model'];if(!_0x460008[_0x5dfd('0x3d')]['hasOwnProperty']('nolimit')){_0x204d36[_0x5dfd('0x29')]=qs[_0x5dfd('0x29')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x29')]);_0x204d36[_0x5dfd('0x27')]=qs['offset'](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x27')]);}_0x204d36[_0x5dfd('0xa7')]=qs[_0x5dfd('0x9f')](_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x9f')]);_0x204d36[_0x5dfd('0xa0')]=qs['filters'](_[_0x5dfd('0xa1')](_0x460008[_0x5dfd('0x3d')],_0x551579[_0x5dfd('0x44')]));_0x204d36['where'][_0x5dfd('0xa8')]=_0x21c7f1['id'];if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0xa2')]){_0x204d36['where']=_[_0x5dfd('0x31')](_0x204d36[_0x5dfd('0xa0')],{'$or':_['map'](_0x204d36[_0x5dfd('0x47')],function(_0x14b098){var _0xe07a6f={};_0xe07a6f[_0x14b098]={'$like':'%'+_0x460008[_0x5dfd('0x3d')]['filter']+'%'};return _0xe07a6f;})});}_0x204d36['where'][_0x5dfd('0x91')]=![];if(_0x460008[_0x5dfd('0x3d')]['id']){_0x204d36[_0x5dfd('0xa0')]['id']={'$gt':_0x460008[_0x5dfd('0x3d')]['id']};}_0x204d36=_['merge']({},_0x204d36,_0x460008[_0x5dfd('0x4a')]);return db[_0x5dfd('0x62')][_0x5dfd('0x2a')]({'where':_0x204d36[_0x5dfd('0xa0')]})[_0x5dfd('0x18')](function(_0x1b6518){_0x13b2a1['count']=_0x1b6518;_0x204d36[_0x5dfd('0x49')]=[];if(_0x460008['query'][_0x5dfd('0xa9')]){_0x204d36['include'][_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id',_0x5dfd('0x55'),_0x5dfd('0x8a')]});}if(_0x460008[_0x5dfd('0x3d')][_0x5dfd('0x48')]){_0x204d36[_0x5dfd('0x49')]=[{'all':!![]}];}return db[_0x5dfd('0x62')]['findAll'](_0x204d36);})[_0x5dfd('0x18')](function(_0x507f08){_0x13b2a1[_0x5dfd('0xab')]=_0x507f08;return _0x13b2a1;});}})[_0x5dfd('0x18')](respondWithFilteredResult(_0x28bd3b,_0x204d36))['catch'](handleError(_0x28bd3b,null));};exports['addTags']=function(_0x4a180b,_0x4ceb2e){return db[_0x5dfd('0x43')]['find']({'where':{'id':_0x4a180b[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x4ceb2e,null))[_0x5dfd('0x18')](function(_0x3f23fd){if(_0x3f23fd){return _0x3f23fd[_0x5dfd('0xac')](_0x4a180b[_0x5dfd('0x32')][_0x5dfd('0x9b')],_[_0x5dfd('0x9c')](_0x4a180b['body'],[_0x5dfd('0x9b'),'id'])||{})[_0x5dfd('0xad')](function(){return db[_0x5dfd('0xae')]['findAll']({'attributes':['id',_0x5dfd('0x2f'),_0x5dfd('0xaf')],'where':{'id':_0x4a180b['body'][_0x5dfd('0x9b')]}});})[_0x5dfd('0x18')](function(_0x5c600c){socket[_0x5dfd('0xb0')](_0x5dfd('0xb1'),{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]});return{'id':Number(_0x4a180b[_0x5dfd('0x40')]['id']),'tags':_0x5c600c||[]};});}})[_0x5dfd('0x18')](respondWithResult(_0x4ceb2e,null))[_0x5dfd('0x22')](handleError(_0x4ceb2e,null));};exports[_0x5dfd('0xb2')]=function(_0xc7a87d,_0x2398e4){return db['ChatInteraction'][_0x5dfd('0x4d')]({'where':{'id':_0xc7a87d[_0x5dfd('0x40')]['id']}})[_0x5dfd('0x18')](handleEntityNotFound(_0x2398e4,null))['then'](function(_0x11a262){if(_0x11a262){return _0x11a262['removeTags'](_0xc7a87d[_0x5dfd('0x3d')][_0x5dfd('0x9b')]);}})[_0x5dfd('0x18')](respondWithStatusCode(_0x2398e4,null))['catch'](handleError(_0x2398e4,null));};exports[_0x5dfd('0xb3')]=function(_0x26ea70,_0x5984c5){var _0x4481f5=moment()['unix']()[_0x5dfd('0xb4')]();var _0x179265=path[_0x5dfd('0x77')](config['root'],'server',_0x5dfd('0xb5'),_0x5dfd('0xb6'));var _0x493023=path['join'](config['root'],'server','files','attachments');var _0x32ea28=path[_0x5dfd('0x77')](_0x179265,_0x4481f5);var _0x303f79=util[_0x5dfd('0x7c')](_0x5dfd('0xb7'),_0x26ea70[_0x5dfd('0x40')]['id'],_0x4481f5);var _0xaec36b=path['join'](_0x179265,_0x303f79);var _0x447e42=[];_0x447e42[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x8b')],'as':_0x5dfd('0x8b'),'attributes':['id','fullname'],'raw':!![]});_0x447e42['push']({'model':db['CmContact'],'as':_0x5dfd('0x66'),'attributes':['id','firstName',_0x5dfd('0xb8')],'raw':!![]});if(_0x26ea70[_0x5dfd('0x3d')][_0x5dfd('0xb9')]){_0x447e42['push']({'model':db['Attachment'],'as':_0x5dfd('0x74'),'raw':!![]});}var _0xf8fa16=[{'model':db[_0x5dfd('0x62')],'as':'Messages','attributes':['id',_0x5dfd('0x32'),_0x5dfd('0x8e'),'direction',_0x5dfd('0x91'),_0x5dfd('0xba')],'include':_0x447e42}];_0xf8fa16[_0x5dfd('0xaa')]({'model':db[_0x5dfd('0x50')],'as':_0x5dfd('0xbb'),'attributes':['id',_0x5dfd('0x2f')]});_0xf8fa16['push']({'model':db[_0x5dfd('0x8b')],'as':'Owner','attributes':['id',_0x5dfd('0x55')]});return db[_0x5dfd('0x43')][_0x5dfd('0x4d')]({'where':{'id':_0x26ea70[_0x5dfd('0x40')]['id']},'include':_0xf8fa16})[_0x5dfd('0x18')](handleEntityNotFound(_0x5984c5,null))['then'](function(_0x2f3704){if(_0x2f3704){var _0x2af6d0=_0x2f3704['get']({'plain':!![]});fs[_0x5dfd('0xbc')](_0x32ea28);var _0x31b0d7={'channel':_0x5dfd('0xbd'),'account':_0x2af6d0[_0x5dfd('0xbb')]['name'],'agent':_0x2af6d0['Owner']?_0x2af6d0['Owner']['fullname']:'N.A.','createdAt':moment(_0x2af6d0['createdAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')](),'closedAt':_0x2af6d0[_0x5dfd('0x6b')]?moment(_0x2af6d0['closedAt'])[_0x5dfd('0x7c')](_0x5dfd('0xa5'))[_0x5dfd('0xb4')]():'','disposition':_0x2af6d0['disposition'],'chatInfo':{'browser':_0x2af6d0[_0x5dfd('0xbe')],'os':_0x2af6d0[_0x5dfd('0xbf')],'referer':_0x2af6d0[_0x5dfd('0xc0')],'customerIp':_0x2af6d0['customerIp'],'customerPort':_0x2af6d0[_0x5dfd('0xc1')]?_0x2af6d0[_0x5dfd('0xc1')]:_0x5dfd('0xc2')},'messages':_(_0x2af6d0[_0x5dfd('0x81')])[_0x5dfd('0xc3')]()[_0x5dfd('0xa2')]({'secret':![]})['map'](function(_0xacb12a){if(_0xacb12a['Attachment']){var _0x7df070=path[_0x5dfd('0x77')](_0x493023,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]);if(fs[_0x5dfd('0xc4')](_0x7df070)){fs['createReadStream'](_0x7df070)['pipe'](fs[_0x5dfd('0xc5')](path[_0x5dfd('0x77')](_0x32ea28,_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')])));}}return{'date':moment(_0xacb12a[_0x5dfd('0x8e')])[_0x5dfd('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0xacb12a[_0x5dfd('0x90')]===_0x5dfd('0x61')?_0xacb12a[_0x5dfd('0x8b')]?_0xacb12a[_0x5dfd('0x8b')]['fullname']:'System':_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xc6')]+(_0xacb12a[_0x5dfd('0x66')][_0x5dfd('0xb8')]?'\x20'+_0xacb12a[_0x5dfd('0x66')]['lastName']:''),'body':_0xacb12a['Attachment']?_0xacb12a[_0x5dfd('0x74')][_0x5dfd('0x71')]:_0xacb12a[_0x5dfd('0x32')],'direction':_0xacb12a['direction']===_0x5dfd('0x61')?'A':'C','secret':_0xacb12a[_0x5dfd('0x91')],'read':_0xacb12a[_0x5dfd('0xba')],'attachment':_0xacb12a[_0x5dfd('0x74')]};})[_0x5dfd('0xc7')]()};return ejs['renderFile'](path[_0x5dfd('0x77')](config['root'],_0x5dfd('0xc8'),_0x5dfd('0xc9'),'downloadInteraction.ejs'),{'interaction':_0x31b0d7})[_0x5dfd('0x18')](function(_0x134519){var _0x44e4b0=path[_0x5dfd('0x77')](_0x32ea28,_0x5dfd('0xca')+_0x2af6d0['id']+'-'+_0x4481f5+_0x5dfd('0xcb'));var _0x539313={'path':_0x44e4b0,'channel':_0x5dfd('0xbd'),'interactionId':_0x2af6d0['id']};return pdf[_0x5dfd('0xcc')](_0x134519,_0x539313);})[_0x5dfd('0x18')](function(){return new Promise(function(_0x2a8266,_0x5a7422){zipdir(_0x32ea28,{'saveTo':_0xaec36b},function(_0x507fa2,_0x4ce325){if(_0x507fa2)return _0x5a7422(_0x507fa2);return _0x2a8266(_0x4ce325);});})[_0x5dfd('0x18')](function(){return new BPromise(function(_0xda5f61,_0xb60d91){rimraf(_0x32ea28,function(_0x2960bc){if(_0x2960bc)_0xb60d91(_0x2960bc);return _0xda5f61();});});})[_0x5dfd('0x18')](function(){return _0x5984c5[_0x5dfd('0xb3')](_0xaec36b,_0x303f79,function(_0x381941){if(_0x381941){logger[_0x5dfd('0x1f')]('err',_0x381941);}else{fs[_0x5dfd('0xcd')](_0xaec36b);}});});});}else{return _0x5984c5[_0x5dfd('0x23')](0xc8);}})['catch'](handleError(_0x5984c5,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4fd4117..c730afb 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 _0xc53e=['ChatMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x490f5e,_0x3325c3){var _0x175c8b=function(_0x4f8374){while(--_0x4f8374){_0x490f5e['push'](_0x490f5e['shift']());}};_0x175c8b(++_0x3325c3);}(_0xc53e,0x86));var _0xec53=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xc53e[_0x481bf7];return _0x461787;};'use strict';var EventEmitter=require(_0xec53('0x0'));var ChatInteraction=require(_0xec53('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xec53('0x1'))['db'][_0xec53('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xec53('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec53('0x4'),'afterDestroy':_0xec53('0x5')};function emitEvent(_0x4c177c){return function(_0x5d41d6,_0x46ebfb,_0x1cfe17){_0x5d41d6[_0xec53('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x116904){_0x5d41d6[_0xec53('0x7')](_0xec53('0x8'),_0x116904[_0xec53('0x9')](function(_0x26f136){return{'id':_0x26f136['id']};}));return ChatMessage[_0xec53('0xa')]({'where':{'ChatInteractionId':_0x5d41d6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x552f2c){_0x5d41d6['setDataValue'](_0xec53('0xb'),_0x552f2c[_0xec53('0xc')]);ChatInteractionEvents[_0xec53('0xd')](_0x4c177c+':'+_0x5d41d6['id'],_0x5d41d6);ChatInteractionEvents['emit'](_0x4c177c,_0x5d41d6);_0x1cfe17(null);})['catch'](_0x1cfe17(null));};}for(var e in events){if(events[_0xec53('0xe')](e)){var event=events[e];ChatInteraction[_0xec53('0xf')](e,emitEvent(event));}}module[_0xec53('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xec1a=['findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','Users','map'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xec1a,0xdb));var _0xaec1=function(_0x59e9d8,_0x5e9850){_0x59e9d8=_0x59e9d8-0x0;var _0x33ebc9=_0xec1a[_0x59e9d8];return _0x33ebc9;};'use strict';var EventEmitter=require(_0xaec1('0x0'));var ChatInteraction=require(_0xaec1('0x1'))['db'][_0xaec1('0x2')];var ChatMessage=require(_0xaec1('0x1'))['db'][_0xaec1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec1('0x4')](0x0);var events={'afterCreate':_0xaec1('0x5'),'afterUpdate':_0xaec1('0x6'),'afterDestroy':'remove'};function emitEvent(_0x1e785d){return function(_0x4d2b66,_0x3a3648,_0x2948fd){_0x4d2b66['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x1ea22b){_0x4d2b66['setDataValue'](_0xaec1('0x7'),_0x1ea22b[_0xaec1('0x8')](function(_0x282834){return{'id':_0x282834['id']};}));return ChatMessage[_0xaec1('0x9')]({'where':{'ChatInteractionId':_0x4d2b66['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec1('0xa')](function(_0x3af653){_0x4d2b66[_0xaec1('0xb')](_0xaec1('0xc'),_0x3af653[_0xaec1('0xd')]);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d+':'+_0x4d2b66['id'],_0x4d2b66);ChatInteractionEvents[_0xaec1('0xe')](_0x1e785d,_0x4d2b66);_0x2948fd(null);})[_0xaec1('0xf')](_0x2948fd(null));};}for(var e in events){if(events[_0xaec1('0x10')](e)){var event=events[e];ChatInteraction[_0xaec1('0x11')](e,emitEvent(event));}}module[_0xaec1('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index af53f9f..548e867 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 _0xa0b2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa0b2,0x18e));var _0x2a0b=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xa0b2[_0x156a0d];return _0x98a9ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a0b('0x0'))(_0x2a0b('0x1'));var moment=require(_0x2a0b('0x2'));var BPromise=require(_0x2a0b('0x3'));var rp=require(_0x2a0b('0x4'));var fs=require('fs');var path=require(_0x2a0b('0x5'));var rimraf=require(_0x2a0b('0x6'));var config=require(_0x2a0b('0x7'));var attributes=require(_0x2a0b('0x8'));module['exports']=function(_0x33cffd,_0x3f0fd4){return _0x33cffd['define'](_0x2a0b('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x80a02d,_0x48a5ff,_0x32bb39){if(_0x80a02d['changed'](_0x2a0b('0xa'))){_0x80a02d[_0x2a0b('0xb')]=moment()[_0x2a0b('0xc')](_0x2a0b('0xd'));}_0x32bb39(null,_0x80a02d);}},'charset':_0x2a0b('0xe'),'collate':_0x2a0b('0xf')});}; \ No newline at end of file +var _0xa11b=['request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xa11b,0xbf));var _0xba11=function(_0x391ff0,_0x46db5d){_0x391ff0=_0x391ff0-0x0;var _0x33fd7b=_0xa11b[_0x391ff0];return _0x33fd7b;};'use strict';var _=require('lodash');var util=require(_0xba11('0x0'));var logger=require(_0xba11('0x1'))(_0xba11('0x2'));var moment=require(_0xba11('0x3'));var BPromise=require('bluebird');var rp=require(_0xba11('0x4'));var fs=require('fs');var path=require(_0xba11('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba11('0x6'));module[_0xba11('0x7')]=function(_0x2619e7,_0x616bcb){return _0x2619e7[_0xba11('0x8')](_0xba11('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2db92e,_0x106568,_0x14db16){if(_0x2db92e[_0xba11('0xa')](_0xba11('0xb'))){_0x2db92e['closedAt']=moment()[_0xba11('0xc')](_0xba11('0xd'));}_0x14db16(null,_0x2db92e);}},'charset':'utf8mb4','collate':_0xba11('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 79de01e..fc052f3 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 _0xb44c=['stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','find','addTags','ids','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x4988ce,_0x27a3a7){var _0x786381=function(_0xd80ab7){while(--_0xd80ab7){_0x4988ce['push'](_0x4988ce['shift']());}};_0x786381(++_0x27a3a7);}(_0xb44c,0x1b7));var _0xcb44=function(_0x1d1963,_0x32cc0e){_0x1d1963=_0x1d1963-0x0;var _0x3f58bb=_0xb44c[_0x1d1963];return _0x3f58bb;};'use strict';var _=require(_0xcb44('0x0'));var util=require(_0xcb44('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb44('0x2'));var fs=require('fs');var Redis=require(_0xcb44('0x3'));var db=require(_0xcb44('0x4'))['db'];var utils=require(_0xcb44('0x5'));var logger=require('../../config/logger')(_0xcb44('0x6'));var config=require(_0xcb44('0x7'));var jayson=require(_0xcb44('0x8'));var client=jayson[_0xcb44('0x9')]['http']({'port':0x232a});config[_0xcb44('0xa')]=_[_0xcb44('0xb')](config['redis'],{'host':_0xcb44('0xc'),'port':0x18eb});var socket=require(_0xcb44('0xd'))(new Redis(config[_0xcb44('0xa')]));require(_0xcb44('0xe'))[_0xcb44('0xf')](socket);function respondWithRpcPromise(_0x17ef57,_0x56ee9e,_0x4fe99d){return new BPromise(function(_0xc84ab,_0x51fe3a){return client[_0xcb44('0x10')](_0x17ef57,_0x4fe99d)[_0xcb44('0x11')](function(_0x5668a6){logger[_0xcb44('0x12')](_0xcb44('0x13'),_0x56ee9e,_0xcb44('0x14'));logger[_0xcb44('0x15')](_0xcb44('0x16'),_0x56ee9e,_0xcb44('0x14'),JSON[_0xcb44('0x17')](_0x5668a6));if(_0x5668a6['error']){if(_0x5668a6[_0xcb44('0x18')][_0xcb44('0x19')]===0x1f4){logger[_0xcb44('0x18')](_0xcb44('0x13'),_0x56ee9e,_0x5668a6[_0xcb44('0x18')]['message']);return _0x51fe3a(_0x5668a6[_0xcb44('0x18')]['message']);}logger[_0xcb44('0x18')](_0xcb44('0x13'),_0x56ee9e,_0x5668a6[_0xcb44('0x18')][_0xcb44('0x1a')]);return _0xc84ab(_0x5668a6['error'][_0xcb44('0x1a')]);}else{logger[_0xcb44('0x12')](_0xcb44('0x13'),_0x56ee9e,_0xcb44('0x14'));_0xc84ab(_0x5668a6[_0xcb44('0x1b')][_0xcb44('0x1a')]);}})[_0xcb44('0x1c')](function(_0xcdb260){logger[_0xcb44('0x18')](_0xcb44('0x13'),_0x56ee9e,_0xcdb260);_0x51fe3a(_0xcdb260);});});}exports[_0xcb44('0x1d')]=function(_0x21016f){var _0x191d31=this;return new Promise(function(_0x26791b,_0x3fb7a4){return db[_0xcb44('0x1e')][_0xcb44('0x1f')](_0x21016f[_0xcb44('0x20')],{'raw':_0x21016f[_0xcb44('0x21')]?_0x21016f[_0xcb44('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21016f[_0xcb44('0x21')]?_0x21016f[_0xcb44('0x21')][_0xcb44('0x22')]||null:null,'attributes':_0x21016f[_0xcb44('0x21')]?_0x21016f['options'][_0xcb44('0x23')]||null:null,'limit':_0x21016f[_0xcb44('0x21')]?_0x21016f['options'][_0xcb44('0x24')]||null:null})['then'](function(_0x1cbc5a){logger[_0xcb44('0x12')](_0xcb44('0x1d'),_0x21016f);logger[_0xcb44('0x15')](_0xcb44('0x1d'),_0x21016f,JSON[_0xcb44('0x17')](_0x1cbc5a));_0x26791b(_0x1cbc5a);})[_0xcb44('0x1c')](function(_0x31c7b1){logger[_0xcb44('0x18')]('UpdateChatInteraction',_0x31c7b1[_0xcb44('0x1a')],_0x21016f);_0x3fb7a4(_0x191d31[_0xcb44('0x18')](0x1f4,_0x31c7b1['message']));});});};exports['AddTagsToChatInteraction']=function(_0x43ede3){return new Promise(function(_0x58565c,_0x5b71c3){return db['ChatInteraction'][_0xcb44('0x25')]({'where':_0x43ede3['options']?_0x43ede3[_0xcb44('0x21')][_0xcb44('0x22')]||null:null})[_0xcb44('0x11')](function(_0x10da34){if(_0x10da34){return _0x10da34[_0xcb44('0x26')](_0x43ede3[_0xcb44('0x20')][_0xcb44('0x27')],_['omit'](_0x43ede3[_0xcb44('0x20')],[_0xcb44('0x27'),'id'])||{});}})[_0xcb44('0x28')](function(_0x1cb55a){logger[_0xcb44('0x12')](_0xcb44('0x29'),_0x43ede3);logger['debug'](_0xcb44('0x29'),_0x43ede3,JSON[_0xcb44('0x17')](_0x1cb55a));_0x58565c(_0x1cb55a);})[_0xcb44('0x1c')](function(_0x1980b7){logger[_0xcb44('0x18')]('AddTags',_0x1980b7[_0xcb44('0x1a')],_0x43ede3);_0x5b71c3(_this[_0xcb44('0x18')](0x1f4,_0x1980b7['message']));});});}; \ No newline at end of file +var _0x0814=['where','attributes','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw'];(function(_0x17a23d,_0x4b6c0c){var _0x531cec=function(_0x2c10f4){while(--_0x2c10f4){_0x17a23d['push'](_0x17a23d['shift']());}};_0x531cec(++_0x4b6c0c);}(_0x0814,0x15d));var _0x4081=function(_0x41289e,_0x13bef1){_0x41289e=_0x41289e-0x0;var _0x89a172=_0x0814[_0x41289e];return _0x89a172;};'use strict';var _=require(_0x4081('0x0'));var util=require('util');var moment=require(_0x4081('0x1'));var BPromise=require('bluebird');var rs=require(_0x4081('0x2'));var fs=require('fs');var Redis=require(_0x4081('0x3'));var db=require(_0x4081('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4081('0x5'));var config=require(_0x4081('0x6'));var jayson=require(_0x4081('0x7'));var client=jayson[_0x4081('0x8')][_0x4081('0x9')]({'port':0x232a});config[_0x4081('0xa')]=_['defaults'](config[_0x4081('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4081('0xb'))(new Redis(config[_0x4081('0xa')]));require(_0x4081('0xc'))[_0x4081('0xd')](socket);function respondWithRpcPromise(_0x8584e8,_0x286a05,_0x1340c2){return new BPromise(function(_0x27023d,_0x2ea04a){return client['request'](_0x8584e8,_0x1340c2)[_0x4081('0xe')](function(_0x121ff6){logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');logger[_0x4081('0x11')](_0x4081('0x12'),_0x286a05,_0x4081('0x13'),JSON[_0x4081('0x14')](_0x121ff6));if(_0x121ff6['error']){if(_0x121ff6['error']['code']===0x1f4){logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6['error'][_0x4081('0x16')]);return _0x2ea04a(_0x121ff6[_0x4081('0x15')]['message']);}logger[_0x4081('0x15')](_0x4081('0x10'),_0x286a05,_0x121ff6[_0x4081('0x15')][_0x4081('0x16')]);return _0x27023d(_0x121ff6[_0x4081('0x15')]['message']);}else{logger[_0x4081('0xf')](_0x4081('0x10'),_0x286a05,'request\x20sent');_0x27023d(_0x121ff6[_0x4081('0x17')]['message']);}})[_0x4081('0x18')](function(_0x17541f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x286a05,_0x17541f);_0x2ea04a(_0x17541f);});});}exports[_0x4081('0x19')]=function(_0x34cfcc){var _0x2f64e7=this;return new Promise(function(_0x3f145e,_0x5f18c4){return db[_0x4081('0x1a')][_0x4081('0x1b')](_0x34cfcc[_0x4081('0x1c')],{'raw':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc['options'][_0x4081('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34cfcc[_0x4081('0x1d')]?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x1f')]||null:null,'attributes':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')][_0x4081('0x20')]||null:null,'limit':_0x34cfcc['options']?_0x34cfcc[_0x4081('0x1d')]['limit']||null:null})[_0x4081('0xe')](function(_0x45e92d){logger[_0x4081('0xf')](_0x4081('0x19'),_0x34cfcc);logger[_0x4081('0x11')](_0x4081('0x19'),_0x34cfcc,JSON[_0x4081('0x14')](_0x45e92d));_0x3f145e(_0x45e92d);})[_0x4081('0x18')](function(_0x44d6de){logger['error'](_0x4081('0x19'),_0x44d6de[_0x4081('0x16')],_0x34cfcc);_0x5f18c4(_0x2f64e7[_0x4081('0x15')](0x1f4,_0x44d6de['message']));});});};exports[_0x4081('0x21')]=function(_0x194105){return new Promise(function(_0x15ee6c,_0xa90a85){return db[_0x4081('0x1a')][_0x4081('0x22')]({'where':_0x194105[_0x4081('0x1d')]?_0x194105[_0x4081('0x1d')]['where']||null:null})['then'](function(_0x3b8ca4){if(_0x3b8ca4){return _0x3b8ca4[_0x4081('0x23')](_0x194105[_0x4081('0x1c')][_0x4081('0x24')],_['omit'](_0x194105['body'],[_0x4081('0x24'),'id'])||{});}})['spread'](function(_0xec2384){logger[_0x4081('0xf')](_0x4081('0x25'),_0x194105);logger['debug']('AddTags',_0x194105,JSON[_0x4081('0x14')](_0xec2384));_0x15ee6c(_0xec2384);})[_0x4081('0x18')](function(_0x38e89c){logger[_0x4081('0x15')](_0x4081('0x25'),_0x38e89c[_0x4081('0x16')],_0x194105);_0xa90a85(_this[_0x4081('0x15')](0x1f4,_0x38e89c[_0x4081('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f4c741a..9468218 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 _0x4276=['removeListener','register','./chatInteraction.events','save','remove','emit'];(function(_0x1f4f67,_0x4565b3){var _0x2d2f1e=function(_0x2a9dfd){while(--_0x2a9dfd){_0x1f4f67['push'](_0x1f4f67['shift']());}};_0x2d2f1e(++_0x4565b3);}(_0x4276,0x98));var _0x6427=function(_0x333106,_0x1da13a){_0x333106=_0x333106-0x0;var _0x3bc0d5=_0x4276[_0x333106];return _0x3bc0d5;};'use strict';var ChatInteractionEvents=require(_0x6427('0x0'));var events=[_0x6427('0x1'),_0x6427('0x2'),'update'];function createListener(_0x1f2eeb,_0x317abe){return function(_0x1267bf){_0x317abe[_0x6427('0x3')](_0x1f2eeb,_0x1267bf);};}function removeListener(_0x872732,_0x11dfb6){return function(){ChatInteractionEvents[_0x6427('0x4')](_0x872732,_0x11dfb6);};}exports[_0x6427('0x5')]=function(_0x42c357){for(var _0x4246a3=0x0,_0x45721d=events['length'];_0x4246a3<_0x45721d;_0x4246a3++){var _0x2a8a30=events[_0x4246a3];var _0x4982bf=createListener('chatInteraction:'+_0x2a8a30,_0x42c357);ChatInteractionEvents['on'](_0x2a8a30,_0x4982bf);}}; \ No newline at end of file +var _0xab4b=['length','chatInteraction:','save','emit','removeListener'];(function(_0x39c931,_0xce322a){var _0x4d1dbb=function(_0x31db4e){while(--_0x31db4e){_0x39c931['push'](_0x39c931['shift']());}};_0x4d1dbb(++_0xce322a);}(_0xab4b,0x156));var _0xbab4=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xab4b[_0x257841];return _0x1b87ed;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xbab4('0x0'),'remove','update'];function createListener(_0x28fe4e,_0x479e3b){return function(_0x4eac02){_0x479e3b[_0xbab4('0x1')](_0x28fe4e,_0x4eac02);};}function removeListener(_0x174b76,_0x25f747){return function(){ChatInteractionEvents[_0xbab4('0x2')](_0x174b76,_0x25f747);};}exports['register']=function(_0x365090){for(var _0x6f1a52=0x0,_0x4f1afa=events[_0xbab4('0x3')];_0x6f1a52<_0x4f1afa;_0x6f1a52++){var _0x9851c8=events[_0x6f1a52];var _0x55cdd2=createListener(_0xbab4('0x4')+_0x9851c8,_0x365090);ChatInteractionEvents['on'](_0x9851c8,_0x55cdd2);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 10e3385..c5a390e 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 _0xf205=['/:id/abandon','abandon','close','delete','tracked','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','server/files/attachments/','format','%s-%s','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xf205,0x106));var _0x5f20=function(_0x274a50,_0x5ef89a){_0x274a50=_0x274a50-0x0;var _0x10092c=_0xf205[_0x274a50];return _0x10092c;};'use strict';var multer=require(_0x5f20('0x0'));var util=require(_0x5f20('0x1'));var path=require(_0x5f20('0x2'));var timeout=require('connect-timeout');var express=require(_0x5f20('0x3'));var router=express[_0x5f20('0x4')]();var fs_extra=require(_0x5f20('0x5'));var auth=require(_0x5f20('0x6'));var interaction=require(_0x5f20('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x5f20('0x8')]('/',auth['isAuthenticated'](),controller[_0x5f20('0x9')]);router[_0x5f20('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5f20('0xa')]);router[_0x5f20('0x8')](_0x5f20('0xb'),auth[_0x5f20('0xc')](),controller['show']);router[_0x5f20('0x8')](_0x5f20('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x5f20('0xe')]);router['get'](_0x5f20('0xf'),auth[_0x5f20('0x10')](),controller[_0x5f20('0x11')]);router[_0x5f20('0x8')](_0x5f20('0x12'),auth[_0x5f20('0xc')](),controller[_0x5f20('0x13')]);router[_0x5f20('0x8')](_0x5f20('0x14'),auth[_0x5f20('0x10')](),controller[_0x5f20('0x15')]);router[_0x5f20('0x16')]('/',auth[_0x5f20('0x10')](),controller[_0x5f20('0x17')]);router['post'](_0x5f20('0x18'),auth[_0x5f20('0x10')](),controller[_0x5f20('0x19')]);var upload=multer({'storage':multer[_0x5f20('0x1a')]({'destination':function(_0x4081fe,_0x19b8c9,_0x5d583b){_0x5d583b(null,path['join'](config['root'],_0x5f20('0x1b')));},'filename':function(_0x29c949,_0x30822b,_0x666d43){_0x666d43(null,util[_0x5f20('0x1c')](_0x5f20('0x1d'),Date['now'](),_0x30822b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5f20('0x16')](_0x5f20('0x1e'),upload[_0x5f20('0x1f')](_0x5f20('0x20')),controller[_0x5f20('0x21')]);router[_0x5f20('0x16')](_0x5f20('0xf'),auth[_0x5f20('0xc')](),controller[_0x5f20('0x22')]);router[_0x5f20('0x16')](_0x5f20('0x23'),auth[_0x5f20('0x10')](),interaction['tracked'](_0x5f20('0x24'),_0x5f20('0x25')),controller[_0x5f20('0x26')]);router['put'](_0x5f20('0xb'),auth[_0x5f20('0x10')](),interaction['tracked'](_0x5f20('0x24'),_0x5f20('0x27')),controller[_0x5f20('0x28')]);router[_0x5f20('0x29')](_0x5f20('0x2a'),controller[_0x5f20('0x2b')]);router[_0x5f20('0x29')](_0x5f20('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x5f20('0x2d')]);router[_0x5f20('0x29')]('/:id/close',controller[_0x5f20('0x2e')]);router[_0x5f20('0x2f')](_0x5f20('0xb'),auth[_0x5f20('0x10')](),interaction[_0x5f20('0x30')]('chat','chatinteraction:destroy'),controller[_0x5f20('0x31')]);router[_0x5f20('0x2f')](_0x5f20('0x23'),auth[_0x5f20('0x10')](),controller['removeTags']);module[_0x5f20('0x32')]=router; \ No newline at end of file +var _0x7aae=['create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7aae,0x1b6));var _0xe7aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7aae[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe7aa('0x0'));var path=require(_0xe7aa('0x1'));var timeout=require(_0xe7aa('0x2'));var express=require('express');var router=express[_0xe7aa('0x3')]();var fs_extra=require(_0xe7aa('0x4'));var auth=require(_0xe7aa('0x5'));var interaction=require(_0xe7aa('0x6'));var config=require(_0xe7aa('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xe7aa('0x8')](),controller['index']);router['get']('/describe',auth[_0xe7aa('0x8')](),controller[_0xe7aa('0x9')]);router[_0xe7aa('0xa')](_0xe7aa('0xb'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xd')]);router['get'](_0xe7aa('0xe'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0xf')]);router[_0xe7aa('0xa')](_0xe7aa('0x10'),auth['isAuthenticated'](),controller[_0xe7aa('0x11')]);router['get'](_0xe7aa('0x12'),auth[_0xe7aa('0xc')](),controller['getMyMessages']);router[_0xe7aa('0xa')](_0xe7aa('0x13'),auth['isAuthenticated'](),controller['download']);router[_0xe7aa('0x14')]('/',auth['isAuthenticated'](),controller[_0xe7aa('0x15')]);router[_0xe7aa('0x14')](_0xe7aa('0x16'),auth['isAuthenticated'](),controller[_0xe7aa('0x17')]);var upload=multer({'storage':multer[_0xe7aa('0x18')]({'destination':function(_0x570e00,_0x2da2e4,_0x581d9e){_0x581d9e(null,path[_0xe7aa('0x19')](config[_0xe7aa('0x1a')],_0xe7aa('0x1b')));},'filename':function(_0x48a31b,_0x1a1579,_0x195e17){_0x195e17(null,util[_0xe7aa('0x1c')](_0xe7aa('0x1d'),Date[_0xe7aa('0x1e')](),_0x1a1579[_0xe7aa('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe7aa('0x14')]('/:id/attachment_upload',upload[_0xe7aa('0x20')](_0xe7aa('0x21')),controller[_0xe7aa('0x22')]);router['post'](_0xe7aa('0x10'),auth[_0xe7aa('0xc')](),controller['addMessage']);router[_0xe7aa('0x14')](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),interaction[_0xe7aa('0x24')](_0xe7aa('0x25'),_0xe7aa('0x26')),controller[_0xe7aa('0x27')]);router[_0xe7aa('0x28')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x29')),controller['update']);router[_0xe7aa('0x28')](_0xe7aa('0x2a'),controller[_0xe7aa('0x2b')]);router[_0xe7aa('0x28')](_0xe7aa('0x2c'),auth[_0xe7aa('0xc')](),controller[_0xe7aa('0x2d')]);router[_0xe7aa('0x28')]('/:id/close',controller[_0xe7aa('0x2e')]);router[_0xe7aa('0x2f')](_0xe7aa('0xb'),auth[_0xe7aa('0x8')](),interaction['tracked'](_0xe7aa('0x25'),_0xe7aa('0x30')),controller[_0xe7aa('0x31')]);router['delete'](_0xe7aa('0x23'),auth[_0xe7aa('0x8')](),controller['removeTags']);module[_0xe7aa('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d11d646..cc7cfec 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 _0x9d7a=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x156282,_0x15aa54){var _0x401672=function(_0xa571fb){while(--_0xa571fb){_0x156282['push'](_0x156282['shift']());}};_0x401672(++_0x15aa54);}(_0x9d7a,0x114));var _0xa9d7=function(_0x5d2021,_0xe50457){_0x5d2021=_0x5d2021-0x0;var _0x373566=_0x9d7a[_0x5d2021];return _0x373566;};'use strict';var Sequelize=require(_0xa9d7('0x0'));module[_0xa9d7('0x1')]={'body':{'type':Sequelize[_0xa9d7('0x2')](_0xa9d7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa9d7('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa9d7('0x5')]}}; \ No newline at end of file +var _0x4058=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x4283e9,_0x55c057){var _0x4e4c67=function(_0x3c700c){while(--_0x3c700c){_0x4283e9['push'](_0x4283e9['shift']());}};_0x4e4c67(++_0x55c057);}(_0x4058,0x1be));var _0x8405=function(_0x25c72c,_0x14f0ab){_0x25c72c=_0x25c72c-0x0;var _0x57e28b=_0x4058[_0x25c72c];return _0x57e28b;};'use strict';var Sequelize=require(_0x8405('0x0'));module[_0x8405('0x1')]={'body':{'type':Sequelize[_0x8405('0x2')](_0x8405('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8405('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8405('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c41fc01..c4db13c 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 _0x4dde=['admin','user','fullname','role','userpic','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','type','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','util','path','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent'];(function(_0x5ba74f,_0x200bf4){var _0x534d79=function(_0x50521a){while(--_0x50521a){_0x5ba74f['push'](_0x5ba74f['shift']());}};_0x534d79(++_0x200bf4);}(_0x4dde,0x15e));var _0xe4dd=function(_0x3f182f,_0x459e7){_0x3f182f=_0x3f182f-0x0;var _0x39bc35=_0x4dde[_0x3f182f];return _0x39bc35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4dd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4dd('0x1'));var rp=require(_0xe4dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe4dd('0x3'));var path=require(_0xe4dd('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4dd('0x5'));var squel=require(_0xe4dd('0x6'));var crypto=require(_0xe4dd('0x7'));var jsforce=require(_0xe4dd('0x8'));var deskjs=require(_0xe4dd('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe4dd('0xa'));var Redis=require(_0xe4dd('0xb'));var authService=require(_0xe4dd('0xc'));var qs=require(_0xe4dd('0xd'));var as=require(_0xe4dd('0xe'));var hardwareService=require(_0xe4dd('0xf'));var logger=require(_0xe4dd('0x10'))(_0xe4dd('0x11'));var utils=require(_0xe4dd('0x12'));var config=require(_0xe4dd('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4dd('0x14'))['db'];config[_0xe4dd('0x15')]=_[_0xe4dd('0x16')](config[_0xe4dd('0x15')],{'host':_0xe4dd('0x17'),'port':0x18eb});var socket=require(_0xe4dd('0x18'))(new Redis(config[_0xe4dd('0x15')]));require(_0xe4dd('0x19'))['register'](socket);function respondWithStatusCode(_0x38653c,_0x5c4e38){_0x5c4e38=_0x5c4e38||0xcc;return function(_0x4063ee){if(_0x4063ee){return _0x38653c[_0xe4dd('0x1a')](_0x5c4e38);}return _0x38653c['status'](_0x5c4e38)[_0xe4dd('0x1b')]();};}function respondWithResult(_0x1b59cc,_0x20d1ab){_0x20d1ab=_0x20d1ab||0xc8;return function(_0x22653f){if(_0x22653f){return _0x1b59cc[_0xe4dd('0x1c')](_0x20d1ab)[_0xe4dd('0x1d')](_0x22653f);}};}function respondWithFilteredResult(_0x233f3e,_0x1e92d9){return function(_0x4d9e56){if(_0x4d9e56){var _0x30a3c3=typeof _0x1e92d9[_0xe4dd('0x1e')]===_0xe4dd('0x1f')&&typeof _0x1e92d9[_0xe4dd('0x20')]==='undefined';var _0x329124=_0x4d9e56[_0xe4dd('0x21')];var _0x2454e9=_0x30a3c3?0x0:_0x1e92d9[_0xe4dd('0x1e')];var _0x440d3c=_0x30a3c3?_0x4d9e56[_0xe4dd('0x21')]:_0x1e92d9[_0xe4dd('0x1e')]+_0x1e92d9[_0xe4dd('0x20')];var _0x85960a;if(_0x440d3c>=_0x329124){_0x440d3c=_0x329124;_0x85960a=0xc8;}else{_0x85960a=0xce;}_0x233f3e[_0xe4dd('0x1c')](_0x85960a);return _0x233f3e[_0xe4dd('0x22')]('Content-Range',_0x2454e9+'-'+_0x440d3c+'/'+_0x329124)[_0xe4dd('0x1d')](_0x4d9e56);}return null;};}function patchUpdates(_0x1c8ba7){return function(_0x581249){try{jsonpatch[_0xe4dd('0x23')](_0x581249,_0x1c8ba7,!![]);}catch(_0x42e9fb){return BPromise['reject'](_0x42e9fb);}return _0x581249[_0xe4dd('0x24')]();};}function saveUpdates(_0x17c5e0,_0x37f298){return function(_0x3534ed){if(_0x3534ed){return _0x3534ed[_0xe4dd('0x25')](_0x17c5e0)['then'](function(_0x2c21b8){return _0x2c21b8;});}return null;};}function removeEntity(_0x4be101,_0x7d3ec7){return function(_0x43f795){if(_0x43f795){return _0x43f795[_0xe4dd('0x26')]()[_0xe4dd('0x27')](function(){_0x4be101[_0xe4dd('0x1c')](0xcc)[_0xe4dd('0x1b')]();});}};}function handleEntityNotFound(_0x13b033,_0x9acb7d){return function(_0x3c0ddd){if(!_0x3c0ddd){_0x13b033[_0xe4dd('0x1a')](0x194);}return _0x3c0ddd;};}function handleError(_0x32d8dc,_0x11a481){_0x11a481=_0x11a481||0x1f4;return function(_0x346997){logger[_0xe4dd('0x28')](_0x346997[_0xe4dd('0x29')]);if(_0x346997['name']){delete _0x346997[_0xe4dd('0x2a')];}_0x32d8dc[_0xe4dd('0x1c')](_0x11a481)['send'](_0x346997);};}exports[_0xe4dd('0x2b')]=function(_0x5a65b2,_0x475050){var _0x3a5426={},_0x23db8f={},_0x3b9785={'count':0x0,'rows':[]};var _0x4575c2=_[_0xe4dd('0x2c')](db[_0xe4dd('0x2d')][_0xe4dd('0x2e')],function(_0x3fdac7){return{'name':_0x3fdac7[_0xe4dd('0x2f')],'type':_0x3fdac7['type'][_0xe4dd('0x30')]};});_0x23db8f[_0xe4dd('0x31')]=_['map'](_0x4575c2,'name');_0x23db8f[_0xe4dd('0x32')]=_[_0xe4dd('0x33')](_0x5a65b2['query']);_0x23db8f[_0xe4dd('0x34')]=_[_0xe4dd('0x35')](_0x23db8f[_0xe4dd('0x31')],_0x23db8f[_0xe4dd('0x32')]);_0x3a5426[_0xe4dd('0x36')]=_[_0xe4dd('0x35')](_0x23db8f[_0xe4dd('0x31')],qs['fields'](_0x5a65b2['query'][_0xe4dd('0x37')]));_0x3a5426[_0xe4dd('0x36')]=_0x3a5426['attributes']['length']?_0x3a5426[_0xe4dd('0x36')]:_0x23db8f['model'];if(!_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x38')](_0xe4dd('0x39'))){_0x3a5426['limit']=qs[_0xe4dd('0x20')](_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x20')]);_0x3a5426[_0xe4dd('0x1e')]=qs[_0xe4dd('0x1e')](_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x1e')]);}_0x3a5426[_0xe4dd('0x3a')]=qs[_0xe4dd('0x3b')](_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x3b')]);_0x3a5426[_0xe4dd('0x3c')]=qs[_0xe4dd('0x34')](_[_0xe4dd('0x3d')](_0x5a65b2[_0xe4dd('0x32')],_0x23db8f[_0xe4dd('0x34')]),_0x4575c2);if(_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x3e')]){_0x3a5426[_0xe4dd('0x3c')]=_[_0xe4dd('0x3f')](_0x3a5426[_0xe4dd('0x3c')],{'$or':_['map'](_0x4575c2,function(_0xc9b8c4){if(_0xc9b8c4['type']!==_0xe4dd('0x40')){var _0x52182e={};_0x52182e[_0xc9b8c4['name']]={'$like':'%'+_0x5a65b2[_0xe4dd('0x32')][_0xe4dd('0x3e')]+'%'};return _0x52182e;}})});}_0x3a5426=_['merge']({},_0x3a5426,_0x5a65b2[_0xe4dd('0x41')]);var _0x37fbe8={'where':_0x3a5426[_0xe4dd('0x3c')]};return db['ChatInternalMessage'][_0xe4dd('0x21')](_0x37fbe8)['then'](function(_0x486a9f){_0x3b9785[_0xe4dd('0x21')]=_0x486a9f;if(_0x5a65b2['query'][_0xe4dd('0x42')]){_0x3a5426[_0xe4dd('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xe4dd('0x44')](_0x3a5426);})[_0xe4dd('0x27')](function(_0x2cd858){_0x3b9785[_0xe4dd('0x45')]=_0x2cd858;return _0x3b9785;})['then'](respondWithFilteredResult(_0x475050,_0x3a5426))[_0xe4dd('0x46')](handleError(_0x475050,null));};exports[_0xe4dd('0x47')]=function(_0x42023d,_0x13bf6f){var _0x393bc1={'raw':!![],'where':{'id':_0x42023d[_0xe4dd('0x48')]['id']}},_0x4f39f8={};_0x4f39f8[_0xe4dd('0x31')]=_['keys'](db[_0xe4dd('0x2d')][_0xe4dd('0x2e')]);_0x4f39f8[_0xe4dd('0x32')]=_['keys'](_0x42023d[_0xe4dd('0x32')]);_0x4f39f8[_0xe4dd('0x34')]=_[_0xe4dd('0x35')](_0x4f39f8[_0xe4dd('0x31')],_0x4f39f8['query']);_0x393bc1[_0xe4dd('0x36')]=_[_0xe4dd('0x35')](_0x4f39f8['model'],qs[_0xe4dd('0x37')](_0x42023d[_0xe4dd('0x32')][_0xe4dd('0x37')]));_0x393bc1[_0xe4dd('0x36')]=_0x393bc1[_0xe4dd('0x36')][_0xe4dd('0x49')]?_0x393bc1[_0xe4dd('0x36')]:_0x4f39f8[_0xe4dd('0x31')];if(_0x42023d[_0xe4dd('0x32')][_0xe4dd('0x42')]){_0x393bc1[_0xe4dd('0x43')]=[{'all':!![]}];}_0x393bc1=_['merge']({},_0x393bc1,_0x42023d[_0xe4dd('0x41')]);return db[_0xe4dd('0x2d')][_0xe4dd('0x4a')](_0x393bc1)[_0xe4dd('0x27')](handleEntityNotFound(_0x13bf6f,null))[_0xe4dd('0x27')](respondWithResult(_0x13bf6f,null))[_0xe4dd('0x46')](handleError(_0x13bf6f,null));};exports[_0xe4dd('0x4b')]=function(_0x3372db,_0x64f831){return db[_0xe4dd('0x2d')][_0xe4dd('0x4b')](_0x3372db['body'],{})[_0xe4dd('0x27')](respondWithResult(_0x64f831,0xc9))[_0xe4dd('0x46')](handleError(_0x64f831,null));};exports[_0xe4dd('0x25')]=function(_0x4ae1f5,_0x52bbf3){if(_0x4ae1f5[_0xe4dd('0x4c')]['id']){delete _0x4ae1f5[_0xe4dd('0x4c')]['id'];}return db[_0xe4dd('0x2d')][_0xe4dd('0x4a')]({'where':{'id':_0x4ae1f5[_0xe4dd('0x48')]['id']}})[_0xe4dd('0x27')](handleEntityNotFound(_0x52bbf3,null))['then'](saveUpdates(_0x4ae1f5[_0xe4dd('0x4c')],null))['then'](respondWithResult(_0x52bbf3,null))[_0xe4dd('0x46')](handleError(_0x52bbf3,null));};exports[_0xe4dd('0x26')]=function(_0x3faa17,_0x56dc63){return db[_0xe4dd('0x2d')]['find']({'where':{'id':_0x3faa17[_0xe4dd('0x48')]['id']}})[_0xe4dd('0x27')](handleEntityNotFound(_0x56dc63,null))[_0xe4dd('0x27')](removeEntity(_0x56dc63,null))['catch'](handleError(_0x56dc63,null));};exports['describe']=function(_0xa5815,_0x2df29f){return db[_0xe4dd('0x2d')][_0xe4dd('0x4d')]()['then'](respondWithResult(_0x2df29f,null))[_0xe4dd('0x46')](handleError(_0x2df29f,null));};function wrapUser(_0x108eee){return function(_0x4c87c7){var _0x2f5cf3=_0x108eee[_0xe4dd('0x4e')]({'plain':!![]});_0x2f5cf3['messages']=[];if(_0x4c87c7){_0x2f5cf3[_0xe4dd('0x4f')]=_0x4c87c7[_0xe4dd('0x50')];_0x2f5cf3[_0xe4dd('0x51')]=_0x4c87c7;}else{_0x2f5cf3[_0xe4dd('0x4f')]=moment(0x0)[_0xe4dd('0x52')](_0xe4dd('0x53'));_0x2f5cf3[_0xe4dd('0x51')]={};}return _0x2f5cf3;};}exports['getUsers']=function(_0x574b1d,_0x352e24,_0x4aabef){var _0x24be20=[];return db[_0xe4dd('0x54')][_0xe4dd('0x44')]({'where':{'role':[_0xe4dd('0x55'),_0xe4dd('0x56'),_0xe4dd('0x57')]},'attributes':['id',_0xe4dd('0x58'),'name',_0xe4dd('0x59'),_0xe4dd('0x5a'),'internal','online',_0xe4dd('0x5b'),'allowmessenger',_0xe4dd('0x5c')],'order':qs['sort'](_0xe4dd('0x5d')),'include':[{'model':db[_0xe4dd('0x5e')],'as':_0xe4dd('0x5f'),'attributes':['id',_0xe4dd('0x2a'),_0xe4dd('0x60')],'through':{'attributes':[]}}]})[_0xe4dd('0x27')](function(_0x46a442){if(_0x46a442){var _0x26148f=_0x574b1d['user'][_0xe4dd('0x4e')]({'plain':!![]});if(!_0x26148f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26148f[_0xe4dd('0x59')]==='user'){return db['UserProfileSection'][_0xe4dd('0x4a')]({'where':{'name':_0xe4dd('0x61'),'userProfileId':_0x26148f[_0xe4dd('0x62')]},'raw':!![]})[_0xe4dd('0x27')](function(_0x527ef0){if(_0x527ef0){if(_0x527ef0[_0xe4dd('0x63')]===0x0){return db[_0xe4dd('0x64')][_0xe4dd('0x44')]({'where':{'sectionId':_0x527ef0['id']},'raw':!![]})[_0xe4dd('0x27')](function(_0x49cdc1){var _0x5ed17f=[];if(_[_0xe4dd('0x65')](_0x49cdc1)){_0x5ed17f=_[_0xe4dd('0x3e')](_0x46a442,function(_0x5bff77){if(_0x5bff77[_0xe4dd('0x59')]!=='agent'){return _0x5bff77;}});return _0x5ed17f;}else{for(var _0x1ef16f=0x0;_0x1ef16f<_0x46a442[_0xe4dd('0x49')];_0x1ef16f++){var _0x298431=_0x46a442[_0x1ef16f];if(_0x298431[_0xe4dd('0x59')]===_0xe4dd('0x55')){var _0x37dbfa=_[_0xe4dd('0x4a')](_0x49cdc1,function(_0x117731){return _0x117731[_0xe4dd('0x66')]===_0x298431['id'];});if(_0x37dbfa)_0x5ed17f[_0xe4dd('0x67')](_0x298431);}else{_0x5ed17f[_0xe4dd('0x67')](_0x298431);}}return _0x5ed17f;}});}else{return _0x46a442;}}else{var _0x2fa63f=_[_0xe4dd('0x3e')](_0x46a442,function(_0x1fa7b4){if(_0x1fa7b4[_0xe4dd('0x59')]!==_0xe4dd('0x55')){return _0x1fa7b4;}});return _0x2fa63f;}});}else{return _0x46a442;}}})[_0xe4dd('0x27')](function(_0x53608e){var _0x4f3a56=[];if(_0x53608e){_0x24be20=_0x53608e;for(var _0x2910a7=0x0;_0x2910a7<_0x53608e[_0xe4dd('0x49')];_0x2910a7+=0x1){_0x24be20[_0x2910a7][_0xe4dd('0x68')]=[];_0x4f3a56[_0xe4dd('0x67')](db[_0xe4dd('0x2d')][_0xe4dd('0x4a')]({'where':{'FromId':[_0x574b1d[_0xe4dd('0x57')]['id'],_0x53608e[_0x2910a7]['id']],'ToId':[_0x574b1d['user']['id'],_0x53608e[_0x2910a7]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xe4dd('0x69'),_0xe4dd('0x6a'),_0xe4dd('0x4c')],'order':qs[_0xe4dd('0x3b')](_0xe4dd('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe4dd('0x27')](wrapUser(_0x53608e[_0x2910a7])));}return BPromise[_0xe4dd('0x6c')](_0x4f3a56);}return[];})[_0xe4dd('0x27')](function(_0x3fa616){return{'rows':_0x3fa616,'count':_0x3fa616[_0xe4dd('0x49')]};})[_0xe4dd('0x27')](respondWithResult(_0x352e24,null))[_0xe4dd('0x46')](handleError(_0x352e24,null));}; \ No newline at end of file +var _0x88b6=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','ChatInternalMessage','includeAll','find','create','body','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','VoiceQueues','user','Agents','userProfileId','autoAssociation','UserProfileResource','length','resourceId','push','createdAt','ToId','read','all','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset'];(function(_0x25ab29,_0x364fec){var _0x146cdf=function(_0x5a809d){while(--_0x5a809d){_0x25ab29['push'](_0x25ab29['shift']());}};_0x146cdf(++_0x364fec);}(_0x88b6,0x112));var _0x688b=function(_0x393bf6,_0x45b827){_0x393bf6=_0x393bf6-0x0;var _0x437338=_0x88b6[_0x393bf6];return _0x437338;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x688b('0x0'));var zipdir=require(_0x688b('0x1'));var jsonpatch=require(_0x688b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x688b('0x3'));var util=require(_0x688b('0x4'));var path=require(_0x688b('0x5'));var sox=require(_0x688b('0x6'));var csv=require(_0x688b('0x7'));var ejs=require(_0x688b('0x8'));var fs=require('fs');var fs_extra=require(_0x688b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x688b('0xa'));var jsforce=require(_0x688b('0xb'));var deskjs=require(_0x688b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x688b('0xd'));var Papa=require(_0x688b('0xe'));var Redis=require('ioredis');var authService=require(_0x688b('0xf'));var qs=require(_0x688b('0x10'));var as=require(_0x688b('0x11'));var hardwareService=require(_0x688b('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x688b('0x13'));var licenseUtil=require(_0x688b('0x14'));var db=require(_0x688b('0x15'))['db'];config[_0x688b('0x16')]=_[_0x688b('0x17')](config[_0x688b('0x16')],{'host':_0x688b('0x18'),'port':0x18eb});var socket=require(_0x688b('0x19'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x688b('0x1a')](socket);function respondWithStatusCode(_0x5bbc69,_0x2209c9){_0x2209c9=_0x2209c9||0xcc;return function(_0x212a13){if(_0x212a13){return _0x5bbc69[_0x688b('0x1b')](_0x2209c9);}return _0x5bbc69[_0x688b('0x1c')](_0x2209c9)[_0x688b('0x1d')]();};}function respondWithResult(_0x261823,_0x6b16c0){_0x6b16c0=_0x6b16c0||0xc8;return function(_0x1230af){if(_0x1230af){return _0x261823['status'](_0x6b16c0)[_0x688b('0x1e')](_0x1230af);}};}function respondWithFilteredResult(_0x602f7c,_0x2ca610){return function(_0x9157a){if(_0x9157a){var _0x44ca75=typeof _0x2ca610[_0x688b('0x1f')]===_0x688b('0x20')&&typeof _0x2ca610[_0x688b('0x21')]===_0x688b('0x20');var _0x26d69b=_0x9157a[_0x688b('0x22')];var _0x41fe4c=_0x44ca75?0x0:_0x2ca610[_0x688b('0x1f')];var _0x2bad4d=_0x44ca75?_0x9157a[_0x688b('0x22')]:_0x2ca610['offset']+_0x2ca610['limit'];var _0x54558e;if(_0x2bad4d>=_0x26d69b){_0x2bad4d=_0x26d69b;_0x54558e=0xc8;}else{_0x54558e=0xce;}_0x602f7c[_0x688b('0x1c')](_0x54558e);return _0x602f7c[_0x688b('0x23')](_0x688b('0x24'),_0x41fe4c+'-'+_0x2bad4d+'/'+_0x26d69b)[_0x688b('0x1e')](_0x9157a);}return null;};}function patchUpdates(_0x4ef372){return function(_0xe9f43d){try{jsonpatch[_0x688b('0x25')](_0xe9f43d,_0x4ef372,!![]);}catch(_0x270b0e){return BPromise['reject'](_0x270b0e);}return _0xe9f43d['save']();};}function saveUpdates(_0x434106,_0xa934ed){return function(_0x1827ab){if(_0x1827ab){return _0x1827ab[_0x688b('0x26')](_0x434106)[_0x688b('0x27')](function(_0x1310d6){return _0x1310d6;});}return null;};}function removeEntity(_0xa39004,_0x4b7464){return function(_0x3009b8){if(_0x3009b8){return _0x3009b8[_0x688b('0x28')]()[_0x688b('0x27')](function(){_0xa39004[_0x688b('0x1c')](0xcc)[_0x688b('0x1d')]();});}};}function handleEntityNotFound(_0x318c99,_0x4e90b8){return function(_0x327f57){if(!_0x327f57){_0x318c99[_0x688b('0x1b')](0x194);}return _0x327f57;};}function handleError(_0x594ab5,_0x306e19){_0x306e19=_0x306e19||0x1f4;return function(_0x506fe7){logger['error'](_0x506fe7[_0x688b('0x29')]);if(_0x506fe7[_0x688b('0x2a')]){delete _0x506fe7['name'];}_0x594ab5[_0x688b('0x1c')](_0x306e19)['send'](_0x506fe7);};}exports[_0x688b('0x2b')]=function(_0x1cd0a6,_0x5c4211){var _0x4d35c7={},_0x2687ab={},_0x4e3b44={'count':0x0,'rows':[]};var _0x3c1228=_[_0x688b('0x2c')](db['ChatInternalMessage'][_0x688b('0x2d')],function(_0x15e82a){return{'name':_0x15e82a['fieldName'],'type':_0x15e82a[_0x688b('0x2e')]['key']};});_0x2687ab[_0x688b('0x2f')]=_['map'](_0x3c1228,_0x688b('0x2a'));_0x2687ab[_0x688b('0x30')]=_['keys'](_0x1cd0a6[_0x688b('0x30')]);_0x2687ab[_0x688b('0x31')]=_[_0x688b('0x32')](_0x2687ab[_0x688b('0x2f')],_0x2687ab[_0x688b('0x30')]);_0x4d35c7[_0x688b('0x33')]=_[_0x688b('0x32')](_0x2687ab['model'],qs[_0x688b('0x34')](_0x1cd0a6[_0x688b('0x30')]['fields']));_0x4d35c7[_0x688b('0x33')]=_0x4d35c7['attributes']['length']?_0x4d35c7[_0x688b('0x33')]:_0x2687ab[_0x688b('0x2f')];if(!_0x1cd0a6[_0x688b('0x30')][_0x688b('0x35')]('nolimit')){_0x4d35c7[_0x688b('0x21')]=qs[_0x688b('0x21')](_0x1cd0a6[_0x688b('0x30')][_0x688b('0x21')]);_0x4d35c7[_0x688b('0x1f')]=qs[_0x688b('0x1f')](_0x1cd0a6[_0x688b('0x30')]['offset']);}_0x4d35c7['order']=qs['sort'](_0x1cd0a6['query'][_0x688b('0x36')]);_0x4d35c7[_0x688b('0x37')]=qs['filters'](_[_0x688b('0x38')](_0x1cd0a6[_0x688b('0x30')],_0x2687ab[_0x688b('0x31')]),_0x3c1228);if(_0x1cd0a6['query'][_0x688b('0x39')]){_0x4d35c7[_0x688b('0x37')]=_[_0x688b('0x3a')](_0x4d35c7['where'],{'$or':_[_0x688b('0x2c')](_0x3c1228,function(_0x47e653){if(_0x47e653[_0x688b('0x2e')]!==_0x688b('0x3b')){var _0x2c1ee4={};_0x2c1ee4[_0x47e653[_0x688b('0x2a')]]={'$like':'%'+_0x1cd0a6['query'][_0x688b('0x39')]+'%'};return _0x2c1ee4;}})});}_0x4d35c7=_['merge']({},_0x4d35c7,_0x1cd0a6[_0x688b('0x3c')]);var _0x28aa1e={'where':_0x4d35c7[_0x688b('0x37')]};return db['ChatInternalMessage']['count'](_0x28aa1e)[_0x688b('0x27')](function(_0x1fd051){_0x4e3b44[_0x688b('0x22')]=_0x1fd051;if(_0x1cd0a6['query']['includeAll']){_0x4d35c7[_0x688b('0x3d')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x688b('0x3e')](_0x4d35c7);})[_0x688b('0x27')](function(_0x105635){_0x4e3b44[_0x688b('0x3f')]=_0x105635;return _0x4e3b44;})[_0x688b('0x27')](respondWithFilteredResult(_0x5c4211,_0x4d35c7))[_0x688b('0x40')](handleError(_0x5c4211,null));};exports[_0x688b('0x41')]=function(_0x23cc30,_0x54ff7e){var _0x4bd99f={'raw':!![],'where':{'id':_0x23cc30[_0x688b('0x42')]['id']}},_0x3350be={};_0x3350be[_0x688b('0x2f')]=_[_0x688b('0x43')](db[_0x688b('0x44')]['rawAttributes']);_0x3350be[_0x688b('0x30')]=_['keys'](_0x23cc30[_0x688b('0x30')]);_0x3350be[_0x688b('0x31')]=_['intersection'](_0x3350be[_0x688b('0x2f')],_0x3350be[_0x688b('0x30')]);_0x4bd99f[_0x688b('0x33')]=_[_0x688b('0x32')](_0x3350be[_0x688b('0x2f')],qs[_0x688b('0x34')](_0x23cc30[_0x688b('0x30')][_0x688b('0x34')]));_0x4bd99f[_0x688b('0x33')]=_0x4bd99f[_0x688b('0x33')]['length']?_0x4bd99f[_0x688b('0x33')]:_0x3350be[_0x688b('0x2f')];if(_0x23cc30['query'][_0x688b('0x45')]){_0x4bd99f[_0x688b('0x3d')]=[{'all':!![]}];}_0x4bd99f=_[_0x688b('0x3a')]({},_0x4bd99f,_0x23cc30[_0x688b('0x3c')]);return db[_0x688b('0x44')][_0x688b('0x46')](_0x4bd99f)[_0x688b('0x27')](handleEntityNotFound(_0x54ff7e,null))[_0x688b('0x27')](respondWithResult(_0x54ff7e,null))[_0x688b('0x40')](handleError(_0x54ff7e,null));};exports[_0x688b('0x47')]=function(_0x14f953,_0x217a55){return db['ChatInternalMessage']['create'](_0x14f953[_0x688b('0x48')],{})[_0x688b('0x27')](respondWithResult(_0x217a55,0xc9))[_0x688b('0x40')](handleError(_0x217a55,null));};exports['update']=function(_0x3c717a,_0x1d9c55){if(_0x3c717a[_0x688b('0x48')]['id']){delete _0x3c717a['body']['id'];}return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x3c717a[_0x688b('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d9c55,null))['then'](saveUpdates(_0x3c717a[_0x688b('0x48')],null))[_0x688b('0x27')](respondWithResult(_0x1d9c55,null))['catch'](handleError(_0x1d9c55,null));};exports[_0x688b('0x28')]=function(_0x4b6b68,_0x3d9c3e){return db['ChatInternalMessage'][_0x688b('0x46')]({'where':{'id':_0x4b6b68[_0x688b('0x42')]['id']}})[_0x688b('0x27')](handleEntityNotFound(_0x3d9c3e,null))[_0x688b('0x27')](removeEntity(_0x3d9c3e,null))[_0x688b('0x40')](handleError(_0x3d9c3e,null));};exports[_0x688b('0x49')]=function(_0x1a6902,_0x213200){return db[_0x688b('0x44')][_0x688b('0x49')]()[_0x688b('0x27')](respondWithResult(_0x213200,null))['catch'](handleError(_0x213200,null));};function wrapUser(_0x25b482){return function(_0x1d7371){var _0xcde578=_0x25b482['get']({'plain':!![]});_0xcde578[_0x688b('0x4a')]=[];if(_0x1d7371){_0xcde578[_0x688b('0x4b')]=_0x1d7371['createdAt'];_0xcde578[_0x688b('0x4c')]=_0x1d7371;}else{_0xcde578[_0x688b('0x4b')]=moment(0x0)[_0x688b('0x4d')](_0x688b('0x4e'));_0xcde578[_0x688b('0x4c')]={};}return _0xcde578;};}exports[_0x688b('0x4f')]=function(_0x5bfa33,_0x5f20e5,_0x32414a){var _0x16e7b1=[];return db[_0x688b('0x50')][_0x688b('0x3e')]({'where':{'role':[_0x688b('0x51'),'admin','user']},'attributes':['id',_0x688b('0x52'),'name',_0x688b('0x53'),_0x688b('0x54'),_0x688b('0x55'),_0x688b('0x56'),_0x688b('0x57'),'allowmessenger',_0x688b('0x58')],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x688b('0x59'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x688b('0x27')](function(_0x3f79da){if(_0x3f79da){var _0x47a589=_0x5bfa33[_0x688b('0x5a')]['get']({'plain':!![]});if(!_0x47a589)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a589[_0x688b('0x53')]===_0x688b('0x5a')){return db['UserProfileSection']['find']({'where':{'name':_0x688b('0x5b'),'userProfileId':_0x47a589[_0x688b('0x5c')]},'raw':!![]})[_0x688b('0x27')](function(_0xe4b232){if(_0xe4b232){if(_0xe4b232[_0x688b('0x5d')]===0x0){return db[_0x688b('0x5e')]['findAll']({'where':{'sectionId':_0xe4b232['id']},'raw':!![]})[_0x688b('0x27')](function(_0x39bded){var _0x203d5a=[];if(_['isEmpty'](_0x39bded)){_0x203d5a=_[_0x688b('0x39')](_0x3f79da,function(_0x3d6058){if(_0x3d6058['role']!==_0x688b('0x51')){return _0x3d6058;}});return _0x203d5a;}else{for(var _0x3446d1=0x0;_0x3446d1<_0x3f79da[_0x688b('0x5f')];_0x3446d1++){var _0x3a0b80=_0x3f79da[_0x3446d1];if(_0x3a0b80[_0x688b('0x53')]==='agent'){var _0x4e4841=_[_0x688b('0x46')](_0x39bded,function(_0x553816){return _0x553816[_0x688b('0x60')]===_0x3a0b80['id'];});if(_0x4e4841)_0x203d5a[_0x688b('0x61')](_0x3a0b80);}else{_0x203d5a['push'](_0x3a0b80);}}return _0x203d5a;}});}else{return _0x3f79da;}}else{var _0x4e4ca2=_[_0x688b('0x39')](_0x3f79da,function(_0x247fd2){if(_0x247fd2['role']!=='agent'){return _0x247fd2;}});return _0x4e4ca2;}});}else{return _0x3f79da;}}})[_0x688b('0x27')](function(_0x4ba986){var _0x2ae8a2=[];if(_0x4ba986){_0x16e7b1=_0x4ba986;for(var _0x47be44=0x0;_0x47be44<_0x4ba986['length'];_0x47be44+=0x1){_0x16e7b1[_0x47be44][_0x688b('0x4a')]=[];_0x2ae8a2['push'](db[_0x688b('0x44')][_0x688b('0x46')]({'where':{'FromId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ToId':[_0x5bfa33[_0x688b('0x5a')]['id'],_0x4ba986[_0x47be44]['id']],'ChatGroupId':null},'attributes':['id',_0x688b('0x62'),'FromId',_0x688b('0x63'),_0x688b('0x64'),_0x688b('0x48')],'order':qs[_0x688b('0x36')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x688b('0x27')](wrapUser(_0x4ba986[_0x47be44])));}return BPromise[_0x688b('0x65')](_0x2ae8a2);}return[];})[_0x688b('0x27')](function(_0x4be39f){return{'rows':_0x4be39f,'count':_0x4be39f['length']};})[_0x688b('0x27')](respondWithResult(_0x5f20e5,null))['catch'](handleError(_0x5f20e5,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5772649..28676cf 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 _0x2140=['update','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x2140,0x11b));var _0x0214=function(_0x5a3cd,_0xe14e8c){_0x5a3cd=_0x5a3cd-0x0;var _0x1f8b11=_0x2140[_0x5a3cd];return _0x1f8b11;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0214('0x0'))['db'][_0x0214('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0214('0x2')](0x0);var events={'afterCreate':_0x0214('0x3'),'afterUpdate':_0x0214('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3a0344){return function(_0x40015a,_0x436133,_0x1e17a5){ChatInternalMessageEvents['emit'](_0x3a0344+':'+_0x40015a['id'],_0x40015a);ChatInternalMessageEvents['emit'](_0x3a0344,_0x40015a);_0x1e17a5(null);};}for(var e in events){if(events[_0x0214('0x5')](e)){var event=events[e];ChatInternalMessage[_0x0214('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x6d6d=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x63de62,_0xe5cc89){var _0x3daddf=function(_0x2a5d79){while(--_0x2a5d79){_0x63de62['push'](_0x63de62['shift']());}};_0x3daddf(++_0xe5cc89);}(_0x6d6d,0xd2));var _0xd6d6=function(_0x3cf0c9,_0x4e4ec8){_0x3cf0c9=_0x3cf0c9-0x0;var _0xe29f0e=_0x6d6d[_0x3cf0c9];return _0xe29f0e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd6d6('0x0'))['db'][_0xd6d6('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd6d6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd6d6('0x3'),'afterDestroy':_0xd6d6('0x4')};function emitEvent(_0x69ff42){return function(_0xccafee,_0xfb579c,_0x15102b){ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42+':'+_0xccafee['id'],_0xccafee);ChatInternalMessageEvents[_0xd6d6('0x5')](_0x69ff42,_0xccafee);_0x15102b(null);};}for(var e in events){if(events[_0xd6d6('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 91b01d3..dbf6908 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 _0x1c93=['rimraf','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x59b71f,_0x1dcbf4){var _0x99dbb0=function(_0x232bba){while(--_0x232bba){_0x59b71f['push'](_0x59b71f['shift']());}};_0x99dbb0(++_0x1dcbf4);}(_0x1c93,0x1c0));var _0x31c9=function(_0x2f5c61,_0x38800c){_0x2f5c61=_0x2f5c61-0x0;var _0x466046=_0x1c93[_0x2f5c61];return _0x466046;};'use strict';var _=require(_0x31c9('0x0'));var util=require(_0x31c9('0x1'));var logger=require('../../config/logger')(_0x31c9('0x2'));var moment=require(_0x31c9('0x3'));var BPromise=require(_0x31c9('0x4'));var rp=require(_0x31c9('0x5'));var fs=require('fs');var path=require(_0x31c9('0x6'));var rimraf=require(_0x31c9('0x7'));var config=require('../../config/environment');var attributes=require(_0x31c9('0x8'));module[_0x31c9('0x9')]=function(_0x3f7c2e,_0x2e8dcf){return _0x3f7c2e[_0x31c9('0xa')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31c9('0xb'),'collate':_0x31c9('0xc')});}; \ No newline at end of file +var _0xc8ed=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xc8ed,0x1bd));var _0xdc8e=function(_0x251ae3,_0x340452){_0x251ae3=_0x251ae3-0x0;var _0x4b6995=_0xc8ed[_0x251ae3];return _0x4b6995;};'use strict';var _=require('lodash');var util=require(_0xdc8e('0x0'));var logger=require(_0xdc8e('0x1'))('api');var moment=require(_0xdc8e('0x2'));var BPromise=require(_0xdc8e('0x3'));var rp=require(_0xdc8e('0x4'));var fs=require('fs');var path=require(_0xdc8e('0x5'));var rimraf=require('rimraf');var config=require(_0xdc8e('0x6'));var attributes=require(_0xdc8e('0x7'));module[_0xdc8e('0x8')]=function(_0x4ce6a8,_0x5494b3){return _0x4ce6a8[_0xdc8e('0x9')](_0xdc8e('0xa'),attributes,{'tableName':_0xdc8e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc8e('0xc'),'collate':_0xdc8e('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 87bf07b..6408a4d 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 _0x04cc=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info'];(function(_0x3d3709,_0x39d31a){var _0x2f6417=function(_0x440a76){while(--_0x440a76){_0x3d3709['push'](_0x3d3709['shift']());}};_0x2f6417(++_0x39d31a);}(_0x04cc,0x10d));var _0xc04c=function(_0x5cd51d,_0x20d4fa){_0x5cd51d=_0x5cd51d-0x0;var _0x444608=_0x04cc[_0x5cd51d];return _0x444608;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var moment=require(_0xc04c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc04c('0x3'));var fs=require('fs');var Redis=require(_0xc04c('0x4'));var db=require(_0xc04c('0x5'))['db'];var utils=require(_0xc04c('0x6'));var logger=require(_0xc04c('0x7'))('rpc');var config=require(_0xc04c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc04c('0x9')]['http']({'port':0x232a});config[_0xc04c('0xa')]=_['defaults'](config['redis'],{'host':_0xc04c('0xb'),'port':0x18eb});var socket=require(_0xc04c('0xc'))(new Redis(config[_0xc04c('0xa')]));require(_0xc04c('0xd'))[_0xc04c('0xe')](socket);function respondWithRpcPromise(_0x10a9e8,_0x564f9c,_0x2ac84c){return new BPromise(function(_0xa7b23a,_0x4a2e43){return client[_0xc04c('0xf')](_0x10a9e8,_0x2ac84c)['then'](function(_0xe13626){logger[_0xc04c('0x10')](_0xc04c('0x11'),_0x564f9c,_0xc04c('0x12'));logger[_0xc04c('0x13')](_0xc04c('0x14'),_0x564f9c,_0xc04c('0x12'),JSON[_0xc04c('0x15')](_0xe13626));if(_0xe13626['error']){if(_0xe13626[_0xc04c('0x16')][_0xc04c('0x17')]===0x1f4){logger[_0xc04c('0x16')](_0xc04c('0x11'),_0x564f9c,_0xe13626['error'][_0xc04c('0x18')]);return _0x4a2e43(_0xe13626[_0xc04c('0x16')][_0xc04c('0x18')]);}logger[_0xc04c('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x564f9c,_0xe13626[_0xc04c('0x16')]['message']);return _0xa7b23a(_0xe13626[_0xc04c('0x16')][_0xc04c('0x18')]);}else{logger[_0xc04c('0x10')](_0xc04c('0x11'),_0x564f9c,_0xc04c('0x12'));_0xa7b23a(_0xe13626['result'][_0xc04c('0x18')]);}})[_0xc04c('0x19')](function(_0x190918){logger[_0xc04c('0x16')](_0xc04c('0x11'),_0x564f9c,_0x190918);_0x4a2e43(_0x190918);});});} \ No newline at end of file +var _0x2982=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2db83f,_0x5754fb){var _0x1fbe86=function(_0x16272f){while(--_0x16272f){_0x2db83f['push'](_0x2db83f['shift']());}};_0x1fbe86(++_0x5754fb);}(_0x2982,0x8d));var _0x2298=function(_0x28801e,_0x3c0c42){_0x28801e=_0x28801e-0x0;var _0x56e311=_0x2982[_0x28801e];return _0x56e311;};'use strict';var _=require(_0x2298('0x0'));var util=require('util');var moment=require(_0x2298('0x1'));var BPromise=require(_0x2298('0x2'));var rs=require(_0x2298('0x3'));var fs=require('fs');var Redis=require(_0x2298('0x4'));var db=require(_0x2298('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2298('0x6'))(_0x2298('0x7'));var config=require('../../config/environment');var jayson=require(_0x2298('0x8'));var client=jayson[_0x2298('0x9')][_0x2298('0xa')]({'port':0x232a});config['redis']=_[_0x2298('0xb')](config[_0x2298('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2298('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b34b2,_0xf6e6d9,_0x123b9e){return new BPromise(function(_0x493b7b,_0x11a3f9){return client[_0x2298('0xe')](_0x1b34b2,_0x123b9e)[_0x2298('0xf')](function(_0x1636ab){logger[_0x2298('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x2298('0x11'));logger[_0x2298('0x12')](_0x2298('0x13'),_0xf6e6d9,_0x2298('0x11'),JSON[_0x2298('0x14')](_0x1636ab));if(_0x1636ab[_0x2298('0x15')]){if(_0x1636ab['error'][_0x2298('0x16')]===0x1f4){logger['error'](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x11a3f9(_0x1636ab['error'][_0x2298('0x18')]);}logger[_0x2298('0x15')](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x493b7b(_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);}else{logger[_0x2298('0x10')](_0x2298('0x17'),_0xf6e6d9,_0x2298('0x11'));_0x493b7b(_0x1636ab[_0x2298('0x19')][_0x2298('0x18')]);}})[_0x2298('0x1a')](function(_0x453862){logger[_0x2298('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x453862);_0x11a3f9(_0x453862);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index f8864ad..5283d63 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 _0x310f=['save','emit','./chatInternalMessage.events'];(function(_0x10ed87,_0x4c5f77){var _0x5763ea=function(_0x323ae5){while(--_0x323ae5){_0x10ed87['push'](_0x10ed87['shift']());}};_0x5763ea(++_0x4c5f77);}(_0x310f,0x12e));var _0xf310=function(_0x36935d,_0x6ab9d8){_0x36935d=_0x36935d-0x0;var _0x287f38=_0x310f[_0x36935d];return _0x287f38;};'use strict';var ChatInternalMessageEvents=require(_0xf310('0x0'));var events=[_0xf310('0x1'),'remove','update'];function createListener(_0x4075f0,_0x55c66e){return function(_0x1303d1){_0x55c66e[_0xf310('0x2')](_0x4075f0,_0x1303d1);};}function removeListener(_0x41fe6d,_0x238f82){return function(){ChatInternalMessageEvents['removeListener'](_0x41fe6d,_0x238f82);};}exports['register']=function(_0x1c6ce8){for(var _0x448d21=0x0,_0x38f6ad=events['length'];_0x448d21<_0x38f6ad;_0x448d21++){var _0xcc8028=events[_0x448d21];var _0x4ce604=createListener('chatInternalMessage:'+_0xcc8028,_0x1c6ce8);ChatInternalMessageEvents['on'](_0xcc8028,_0x4ce604);}}; \ No newline at end of file +var _0xbde6=['removeListener','register','length','./chatInternalMessage.events','save','update','emit'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xbde6,0xc7));var _0x6bde=function(_0x480c85,_0x291d15){_0x480c85=_0x480c85-0x0;var _0x51531c=_0xbde6[_0x480c85];return _0x51531c;};'use strict';var ChatInternalMessageEvents=require(_0x6bde('0x0'));var events=[_0x6bde('0x1'),'remove',_0x6bde('0x2')];function createListener(_0x65e0d7,_0x4c9e67){return function(_0x552583){_0x4c9e67[_0x6bde('0x3')](_0x65e0d7,_0x552583);};}function removeListener(_0x5dc36d,_0x1b6604){return function(){ChatInternalMessageEvents[_0x6bde('0x4')](_0x5dc36d,_0x1b6604);};}exports[_0x6bde('0x5')]=function(_0x22d440){for(var _0x252625=0x0,_0x244daa=events[_0x6bde('0x6')];_0x252625<_0x244daa;_0x252625++){var _0x6b2c8f=events[_0x252625];var _0x24d6a5=createListener('chatInternalMessage:'+_0x6b2c8f,_0x22d440);ChatInternalMessageEvents['on'](_0x6b2c8f,_0x24d6a5);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 99a7c3b..af64287 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 _0x1b3d=['/describe','describe','/users','getUsers','/:id','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x61318d,_0x4d8395){var _0x26995e=function(_0x306ede){while(--_0x306ede){_0x61318d['push'](_0x61318d['shift']());}};_0x26995e(++_0x4d8395);}(_0x1b3d,0xd1));var _0xd1b3=function(_0x1d2e76,_0x4fddeb){_0x1d2e76=_0x1d2e76-0x0;var _0x2cb384=_0x1b3d[_0x1d2e76];return _0x2cb384;};'use strict';var multer=require(_0xd1b3('0x0'));var util=require('util');var path=require(_0xd1b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1b3('0x2'));var router=express[_0xd1b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd1b3('0x4'));var interaction=require(_0xd1b3('0x5'));var config=require(_0xd1b3('0x6'));var controller=require(_0xd1b3('0x7'));router[_0xd1b3('0x8')]('/',auth[_0xd1b3('0x9')](),controller[_0xd1b3('0xa')]);router[_0xd1b3('0x8')](_0xd1b3('0xb'),auth[_0xd1b3('0x9')](),controller[_0xd1b3('0xc')]);router[_0xd1b3('0x8')](_0xd1b3('0xd'),auth['isAuthenticated'](),controller[_0xd1b3('0xe')]);router['get'](_0xd1b3('0xf'),auth[_0xd1b3('0x9')](),controller['show']);router['post']('/',auth[_0xd1b3('0x9')](),controller[_0xd1b3('0x10')]);router[_0xd1b3('0x11')]('/:id',controller[_0xd1b3('0x12')]);router[_0xd1b3('0x13')](_0xd1b3('0xf'),auth[_0xd1b3('0x9')](),controller[_0xd1b3('0x14')]);module[_0xd1b3('0x15')]=router; \ No newline at end of file +var _0x024c=['getUsers','/:id','show','post','create','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/users'];(function(_0x30cb3a,_0x4adc6f){var _0x32e69f=function(_0x14845e){while(--_0x14845e){_0x30cb3a['push'](_0x30cb3a['shift']());}};_0x32e69f(++_0x4adc6f);}(_0x024c,0x1c0));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc024('0x0'));var util=require(_0xc024('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc024('0x2'));var router=express[_0xc024('0x3')]();var fs_extra=require(_0xc024('0x4'));var auth=require(_0xc024('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc024('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xc024('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc024('0x7')](_0xc024('0x8'),auth[_0xc024('0x9')](),controller[_0xc024('0xa')]);router['get'](_0xc024('0xb'),auth[_0xc024('0x9')](),controller[_0xc024('0xc')]);router[_0xc024('0x7')](_0xc024('0xd'),auth['isAuthenticated'](),controller[_0xc024('0xe')]);router[_0xc024('0xf')]('/',auth[_0xc024('0x9')](),controller[_0xc024('0x10')]);router[_0xc024('0x11')]('/:id',controller['update']);router[_0xc024('0x12')](_0xc024('0xd'),auth[_0xc024('0x9')](),controller['destroy']);module[_0xc024('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2acb4b6..40e874d 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 _0xea28=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1faa61,_0x1bd7e2){var _0x3f0e58=function(_0x386cf3){while(--_0x386cf3){_0x1faa61['push'](_0x1faa61['shift']());}};_0x3f0e58(++_0x1bd7e2);}(_0xea28,0x13a));var _0x8ea2=function(_0x466d24,_0x297406){_0x466d24=_0x466d24-0x0;var _0x3ef0a0=_0xea28[_0x466d24];return _0x3ef0a0;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'body':{'type':Sequelize[_0x8ea2('0x2')](_0x8ea2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8ea2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ea2('0x5')]('in',_0x8ea2('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8ea2('0x7')]},'providerName':{'type':Sequelize[_0x8ea2('0x8')]},'providerResponse':{'type':Sequelize[_0x8ea2('0x2')]}}; \ No newline at end of file +var _0x578c=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x21929f,_0xb96182){var _0x1a6077=function(_0x209786){while(--_0x209786){_0x21929f['push'](_0x21929f['shift']());}};_0x1a6077(++_0xb96182);}(_0x578c,0x158));var _0xc578=function(_0x3e68f3,_0x1ec053){_0x3e68f3=_0x3e68f3-0x0;var _0x27ee2e=_0x578c[_0x3e68f3];return _0x27ee2e;};'use strict';var Sequelize=require(_0xc578('0x0'));module[_0xc578('0x1')]={'body':{'type':Sequelize[_0xc578('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc578('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc578('0x4')]('in','out'),'defaultValue':_0xc578('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc578('0x6')]},'providerName':{'type':Sequelize[_0xc578('0x7')]},'providerResponse':{'type':Sequelize[_0xc578('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 1682720..4faa73f 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 _0xeaf5=['User','fullname','email','interface','SIP/%s','motionChannel','channel','event','EventManager','acceptmessage','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ChatMessage','includeAll','findAll','show','include','find','create','body','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','params','get','ChatInteraction','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact'];(function(_0x4ede8b,_0x4879fa){var _0x4d45d0=function(_0x402634){while(--_0x402634){_0x4ede8b['push'](_0x4ede8b['shift']());}};_0x4d45d0(++_0x4879fa);}(_0xeaf5,0x19e));var _0x5eaf=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0xeaf5[_0x503790];return _0x388092;};'use strict';var emlformat=require(_0x5eaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5eaf('0x1'));var jsonpatch=require(_0x5eaf('0x2'));var rp=require('request-promise');var moment=require(_0x5eaf('0x3'));var BPromise=require(_0x5eaf('0x4'));var Mustache=require(_0x5eaf('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5eaf('0x6'));var csv=require(_0x5eaf('0x7'));var ejs=require(_0x5eaf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5eaf('0x9'));var squel=require(_0x5eaf('0xa'));var crypto=require('crypto');var jsforce=require(_0x5eaf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5eaf('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5eaf('0xc'));var authService=require(_0x5eaf('0xd'));var qs=require(_0x5eaf('0xe'));var as=require(_0x5eaf('0xf'));var hardwareService=require(_0x5eaf('0x10'));var logger=require(_0x5eaf('0x11'))('api');var utils=require(_0x5eaf('0x12'));var config=require(_0x5eaf('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5eaf('0x14'))['db'];config[_0x5eaf('0x15')]=_['defaults'](config[_0x5eaf('0x15')],{'host':_0x5eaf('0x16'),'port':0x18eb});var socket=require(_0x5eaf('0x17'))(new Redis(config['redis']));require(_0x5eaf('0x18'))['register'](socket);var jayson=require(_0x5eaf('0x19'));var client=jayson[_0x5eaf('0x1a')][_0x5eaf('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f00b3,_0x1a9d1c,_0x319cb2,_0x5219d6){return new BPromise(function(_0x342a4d,_0x29fcc1){var _0x49dc6d=_0x5219d6||client;return _0x49dc6d[_0x5eaf('0x1c')](_0x4f00b3,_0x319cb2)[_0x5eaf('0x1d')](function(_0x1a7eae){logger[_0x5eaf('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x1a9d1c,_0x5eaf('0x1f'));logger[_0x5eaf('0x20')](_0x5eaf('0x21'),_0x1a9d1c,_0x5eaf('0x1f'),JSON[_0x5eaf('0x22')](_0x1a7eae));if(_0x1a7eae[_0x5eaf('0x23')]){if(_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x24')]===0x1f4){logger[_0x5eaf('0x23')](_0x5eaf('0x25'),_0x1a9d1c,_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x26')]);return _0x29fcc1(_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x26')]);}logger['error'](_0x5eaf('0x25'),_0x1a9d1c,_0x1a7eae['error'][_0x5eaf('0x26')]);return _0x342a4d(_0x1a7eae[_0x5eaf('0x23')][_0x5eaf('0x26')]);}else{logger[_0x5eaf('0x1e')](_0x5eaf('0x25'),_0x1a9d1c,_0x5eaf('0x1f'));_0x342a4d(_0x1a7eae[_0x5eaf('0x27')][_0x5eaf('0x26')]);}})[_0x5eaf('0x28')](function(_0x3577f0){logger['error'](_0x5eaf('0x25'),_0x1a9d1c,_0x3577f0);_0x29fcc1(_0x3577f0);});});}function respondWithStatusCode(_0x4517bd,_0x1a58ab){_0x1a58ab=_0x1a58ab||0xcc;return function(_0x4a62ed){if(_0x4a62ed){return _0x4517bd[_0x5eaf('0x29')](_0x1a58ab);}return _0x4517bd[_0x5eaf('0x2a')](_0x1a58ab)['end']();};}function respondWithResult(_0x42469a,_0x5746f0){_0x5746f0=_0x5746f0||0xc8;return function(_0x51c02d){if(_0x51c02d){return _0x42469a[_0x5eaf('0x2a')](_0x5746f0)['json'](_0x51c02d);}};}function respondWithFilteredResult(_0x42da59,_0x41959f){return function(_0xdc1137){if(_0xdc1137){var _0x5191a6=typeof _0x41959f['offset']===_0x5eaf('0x2b')&&typeof _0x41959f[_0x5eaf('0x2c')]==='undefined';var _0x38a4de=_0xdc1137['count'];var _0x392501=_0x5191a6?0x0:_0x41959f[_0x5eaf('0x2d')];var _0x2a4e55=_0x5191a6?_0xdc1137[_0x5eaf('0x2e')]:_0x41959f['offset']+_0x41959f['limit'];var _0x201dd4;if(_0x2a4e55>=_0x38a4de){_0x2a4e55=_0x38a4de;_0x201dd4=0xc8;}else{_0x201dd4=0xce;}_0x42da59[_0x5eaf('0x2a')](_0x201dd4);return _0x42da59[_0x5eaf('0x2f')](_0x5eaf('0x30'),_0x392501+'-'+_0x2a4e55+'/'+_0x38a4de)[_0x5eaf('0x31')](_0xdc1137);}return null;};}function patchUpdates(_0x52bde3){return function(_0x352954){try{jsonpatch[_0x5eaf('0x32')](_0x352954,_0x52bde3,!![]);}catch(_0x193ae5){return BPromise[_0x5eaf('0x33')](_0x193ae5);}return _0x352954[_0x5eaf('0x34')]();};}function saveUpdates(_0x318bf0,_0x4a32a6){return function(_0x67403a){if(_0x67403a){return _0x67403a[_0x5eaf('0x35')](_0x318bf0)[_0x5eaf('0x1d')](function(_0x753158){return _0x753158;});}return null;};}function removeEntity(_0x310b10,_0x485f53){return function(_0x3d3367){if(_0x3d3367){return _0x3d3367['destroy']()[_0x5eaf('0x1d')](function(){_0x310b10[_0x5eaf('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x124d89,_0x1a52bb){return function(_0x531a1a){if(!_0x531a1a){_0x124d89[_0x5eaf('0x29')](0x194);}return _0x531a1a;};}function handleError(_0x58ce00,_0xf6e9a){_0xf6e9a=_0xf6e9a||0x1f4;return function(_0x291674){logger[_0x5eaf('0x23')](_0x291674[_0x5eaf('0x36')]);if(_0x291674['name']){delete _0x291674[_0x5eaf('0x37')];}_0x58ce00[_0x5eaf('0x2a')](_0xf6e9a)[_0x5eaf('0x38')](_0x291674);};}exports[_0x5eaf('0x39')]=function(_0x110f30,_0xe5f382){var _0x28db9e={},_0x247029={},_0x91b0a5={'count':0x0,'rows':[]};var _0x214e4d=_[_0x5eaf('0x3a')](db['ChatMessage'][_0x5eaf('0x3b')],function(_0xa7b8e4){return{'name':_0xa7b8e4[_0x5eaf('0x3c')],'type':_0xa7b8e4[_0x5eaf('0x3d')][_0x5eaf('0x3e')]};});_0x247029[_0x5eaf('0x3f')]=_['map'](_0x214e4d,_0x5eaf('0x37'));_0x247029[_0x5eaf('0x40')]=_[_0x5eaf('0x41')](_0x110f30[_0x5eaf('0x40')]);_0x247029[_0x5eaf('0x42')]=_[_0x5eaf('0x43')](_0x247029[_0x5eaf('0x3f')],_0x247029[_0x5eaf('0x40')]);_0x28db9e['attributes']=_[_0x5eaf('0x43')](_0x247029[_0x5eaf('0x3f')],qs[_0x5eaf('0x44')](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x44')]));_0x28db9e['attributes']=_0x28db9e['attributes'][_0x5eaf('0x45')]?_0x28db9e[_0x5eaf('0x46')]:_0x247029[_0x5eaf('0x3f')];if(!_0x110f30[_0x5eaf('0x40')]['hasOwnProperty'](_0x5eaf('0x47'))){_0x28db9e[_0x5eaf('0x2c')]=qs['limit'](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x2c')]);_0x28db9e[_0x5eaf('0x2d')]=qs[_0x5eaf('0x2d')](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x2d')]);}_0x28db9e[_0x5eaf('0x48')]=qs[_0x5eaf('0x49')](_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x49')]);_0x28db9e['where']=qs['filters'](_[_0x5eaf('0x4a')](_0x110f30[_0x5eaf('0x40')],_0x247029['filters']),_0x214e4d);if(_0x110f30['query'][_0x5eaf('0x4b')]){_0x28db9e[_0x5eaf('0x4c')]=_[_0x5eaf('0x4d')](_0x28db9e[_0x5eaf('0x4c')],{'$or':_[_0x5eaf('0x3a')](_0x214e4d,function(_0x2ca589){if(_0x2ca589[_0x5eaf('0x3d')]!==_0x5eaf('0x4e')){var _0x37f4e7={};_0x37f4e7[_0x2ca589['name']]={'$like':'%'+_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x4b')]+'%'};return _0x37f4e7;}})});}_0x28db9e=_[_0x5eaf('0x4d')]({},_0x28db9e,_0x110f30['options']);var _0x5f52fb={'where':_0x28db9e[_0x5eaf('0x4c')]};return db[_0x5eaf('0x4f')]['count'](_0x5f52fb)[_0x5eaf('0x1d')](function(_0x44f981){_0x91b0a5[_0x5eaf('0x2e')]=_0x44f981;if(_0x110f30[_0x5eaf('0x40')][_0x5eaf('0x50')]){_0x28db9e['include']=[{'all':!![]}];}return db[_0x5eaf('0x4f')][_0x5eaf('0x51')](_0x28db9e);})[_0x5eaf('0x1d')](function(_0x92e5b7){_0x91b0a5['rows']=_0x92e5b7;return _0x91b0a5;})[_0x5eaf('0x1d')](respondWithFilteredResult(_0xe5f382,_0x28db9e))['catch'](handleError(_0xe5f382,null));};exports[_0x5eaf('0x52')]=function(_0x49526c,_0x309b4d){var _0x553674={'raw':!![],'where':{'id':_0x49526c['params']['id']}},_0x1aa064={};_0x1aa064[_0x5eaf('0x3f')]=_[_0x5eaf('0x41')](db[_0x5eaf('0x4f')][_0x5eaf('0x3b')]);_0x1aa064[_0x5eaf('0x40')]=_['keys'](_0x49526c[_0x5eaf('0x40')]);_0x1aa064['filters']=_[_0x5eaf('0x43')](_0x1aa064[_0x5eaf('0x3f')],_0x1aa064[_0x5eaf('0x40')]);_0x553674[_0x5eaf('0x46')]=_[_0x5eaf('0x43')](_0x1aa064[_0x5eaf('0x3f')],qs[_0x5eaf('0x44')](_0x49526c[_0x5eaf('0x40')][_0x5eaf('0x44')]));_0x553674[_0x5eaf('0x46')]=_0x553674[_0x5eaf('0x46')][_0x5eaf('0x45')]?_0x553674[_0x5eaf('0x46')]:_0x1aa064[_0x5eaf('0x3f')];if(_0x49526c[_0x5eaf('0x40')][_0x5eaf('0x50')]){_0x553674[_0x5eaf('0x53')]=[{'all':!![]}];}_0x553674=_[_0x5eaf('0x4d')]({},_0x553674,_0x49526c['options']);return db['ChatMessage'][_0x5eaf('0x54')](_0x553674)[_0x5eaf('0x1d')](handleEntityNotFound(_0x309b4d,null))[_0x5eaf('0x1d')](respondWithResult(_0x309b4d,null))[_0x5eaf('0x28')](handleError(_0x309b4d,null));};exports[_0x5eaf('0x55')]=function(_0x1599e3,_0x140f0c){return db[_0x5eaf('0x4f')][_0x5eaf('0x55')](_0x1599e3[_0x5eaf('0x56')],{})['then'](respondWithResult(_0x140f0c,0xc9))[_0x5eaf('0x28')](handleError(_0x140f0c,null));};exports[_0x5eaf('0x35')]=function(_0x5a3809,_0x799a24){if(_0x5a3809[_0x5eaf('0x56')]['id']){delete _0x5a3809[_0x5eaf('0x56')]['id'];}return db[_0x5eaf('0x4f')][_0x5eaf('0x54')]({'where':{'id':_0x5a3809['params']['id']}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x799a24,null))[_0x5eaf('0x1d')](saveUpdates(_0x5a3809[_0x5eaf('0x56')],null))[_0x5eaf('0x1d')](respondWithResult(_0x799a24,null))[_0x5eaf('0x28')](handleError(_0x799a24,null));};exports[_0x5eaf('0x57')]=function(_0x3cb3dc,_0x141d9f){return db['ChatMessage']['find']({'where':{'id':_0x3cb3dc['params']['id']}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x141d9f,null))[_0x5eaf('0x1d')](removeEntity(_0x141d9f,null))[_0x5eaf('0x28')](handleError(_0x141d9f,null));};exports[_0x5eaf('0x58')]=function(_0x5eec03,_0x167ed3){return db['ChatMessage'][_0x5eaf('0x58')]()[_0x5eaf('0x1d')](respondWithResult(_0x167ed3,null))[_0x5eaf('0x28')](handleError(_0x167ed3,null));};var interaction_log=require('../../config/logger')(_0x5eaf('0x59'));exports['accept']=function(_0x16f0e7,_0x4d413b,_0x45663c){var _0x14ad0b={'agent':{},'channel':_0x5eaf('0x5a')};if(_0x16f0e7['body']['id']){delete _0x16f0e7['body']['id'];}_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5b')]=!![];_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5c')]=moment()[_0x5eaf('0x5d')](_0x5eaf('0x5e'));_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')]=_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')]||_0x16f0e7['user']['id'];_0x14ad0b[_0x5eaf('0x60')]['id']=_0x16f0e7[_0x5eaf('0x56')]['UserId'];return db[_0x5eaf('0x4f')][_0x5eaf('0x54')]({'where':{'id':_0x16f0e7[_0x5eaf('0x61')]['id'],'UserId':null}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x4d413b,null))[_0x5eaf('0x1d')](saveUpdates(_0x16f0e7[_0x5eaf('0x56')],null))['then'](function(_0x175588){if(_0x175588){_0x14ad0b[_0x5eaf('0x26')]=_0x175588[_0x5eaf('0x62')]({'plain':!![]});return db[_0x5eaf('0x63')][_0x5eaf('0x54')]({'where':{'id':_0x175588['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4d413b,null))[_0x5eaf('0x1d')](function(_0x148fc3){if(_0x148fc3){return _0x148fc3[_0x5eaf('0x35')]({'UserId':_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')],'read1stAt':_[_0x5eaf('0x64')](_0x148fc3[_0x5eaf('0x65')])?moment()[_0x5eaf('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5eaf('0x1d')](function(_0x17c96e){if(_0x17c96e){_0x14ad0b['interaction']=_0x17c96e[_0x5eaf('0x62')]({'plain':!![]});interaction_log['info'](_0x5eaf('0x66'),_0x16f0e7[_0x5eaf('0x67')]['id'],_0x16f0e7[_0x5eaf('0x67')]['name'],_0x16f0e7[_0x5eaf('0x67')][_0x5eaf('0x68')],_0x14ad0b[_0x5eaf('0x69')]['id'],_0x16f0e7[_0x5eaf('0x56')]?JSON[_0x5eaf('0x22')](_0x16f0e7[_0x5eaf('0x56')]):_0x5eaf('0x6a'));return respondWithRpcPromise(_0x5eaf('0x6b'),_0x5eaf('0x6c'),_0x14ad0b);}return null;})['then'](function(_0x2d9a40){var _0x1c9cfa=_0x5eaf('0x6d')+_0x2d9a40[_0x5eaf('0x26')][_0x5eaf('0x6e')];return db[_0x5eaf('0x6f')][_0x5eaf('0x40')](_0x1c9cfa,{'type':db['Sequelize']['QueryTypes'][_0x5eaf('0x70')],'raw':!![]})[_0x5eaf('0x1d')](function(_0x140750){return _0x140750;});})[_0x5eaf('0x1d')](function(_0x17862b){if(_0x17862b){_0x14ad0b[_0x5eaf('0x26')][_0x5eaf('0x71')]=_0x17862b[0x0];if(!_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')])return;return db[_0x5eaf('0x72')][_0x5eaf('0x54')]({'where':{'id':_0x16f0e7[_0x5eaf('0x56')][_0x5eaf('0x5f')],'role':_0x5eaf('0x60')},'attributes':['id','name',_0x5eaf('0x73'),_0x5eaf('0x74'),'internal'],'raw':!![]});}return null;})[_0x5eaf('0x1d')](function(_0x72c9ff){if(!_0x72c9ff)return null;_0x14ad0b[_0x5eaf('0x26')]['agent']=_0x72c9ff;return _0x14ad0b;})[_0x5eaf('0x1d')](function(_0x3244f9){if(_0x3244f9){if(_0x16f0e7[_0x5eaf('0x56')]['manual']){_0x14ad0b[_0x5eaf('0x26')][_0x5eaf('0x75')]=util[_0x5eaf('0x5d')](_0x5eaf('0x76'),_0x16f0e7[_0x5eaf('0x67')][_0x5eaf('0x37')]);_0x14ad0b[_0x5eaf('0x26')]['channel']=_0x14ad0b['channel'];_0x14ad0b['message'][_0x5eaf('0x77')]=_0x14ad0b[_0x5eaf('0x78')];_0x14ad0b[_0x5eaf('0x26')][_0x5eaf('0x79')]='accept';return respondWithRpcPromise('EventManager',_0x5eaf('0x7a'),{'event':_0x5eaf('0x7b'),'message':_[_0x5eaf('0x4d')](_0x14ad0b['message'],JSON[_0x5eaf('0x7c')](_0x14ad0b[_0x5eaf('0x69')][_0x5eaf('0x7d')]))},client9002)['then'](function(){return _0x14ad0b;});}return _0x14ad0b;}return null;})[_0x5eaf('0x1d')](respondWithResult(_0x4d413b,null))[_0x5eaf('0x28')](handleError(_0x4d413b,null));};var interaction_log=require(_0x5eaf('0x11'))('chat-interactions');exports[_0x5eaf('0x33')]=function(_0x55b073,_0x4b330c,_0x2987e6){var _0x38c9bc={'agent':{},'channel':_0x5eaf('0x5a')};if(_0x55b073[_0x5eaf('0x56')]['id']){delete _0x55b073['body']['id'];}_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')]=_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')]||_0x55b073[_0x5eaf('0x67')]['id'];_0x38c9bc[_0x5eaf('0x60')]['id']=_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')];return db[_0x5eaf('0x4f')][_0x5eaf('0x54')]({'where':{'id':_0x55b073[_0x5eaf('0x61')]['id'],'UserId':null}})[_0x5eaf('0x1d')](handleEntityNotFound(_0x4b330c,null))[_0x5eaf('0x1d')](function(_0x1c08eb){if(_0x1c08eb){_0x38c9bc['message']=_0x1c08eb[_0x5eaf('0x62')]({'plain':!![]});return db[_0x5eaf('0x63')][_0x5eaf('0x54')]({'where':{'id':_0x1c08eb[_0x5eaf('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x4b330c,null))[_0x5eaf('0x1d')](function(_0x2e5df8){if(_0x2e5df8){_0x38c9bc[_0x5eaf('0x69')]=_0x2e5df8['get']({'plain':!![]});interaction_log[_0x5eaf('0x1e')](_0x5eaf('0x7f'),_0x55b073[_0x5eaf('0x67')]['id'],_0x55b073[_0x5eaf('0x67')][_0x5eaf('0x37')],_0x55b073['user'][_0x5eaf('0x68')],_0x38c9bc['interaction']['id'],_0x55b073[_0x5eaf('0x56')]?JSON[_0x5eaf('0x22')](_0x55b073['body']):'null');return respondWithRpcPromise(_0x5eaf('0x80'),_0x5eaf('0x81'),_0x38c9bc);}return null;})[_0x5eaf('0x1d')](function(_0x50cdd8){var _0x2b8fb9=_0x5eaf('0x6d')+_0x50cdd8[_0x5eaf('0x26')][_0x5eaf('0x6e')];return db[_0x5eaf('0x6f')][_0x5eaf('0x40')](_0x2b8fb9,{'type':db[_0x5eaf('0x82')][_0x5eaf('0x83')][_0x5eaf('0x70')],'raw':!![]})['then'](function(_0x263c16){return _0x263c16;});})[_0x5eaf('0x1d')](function(_0x5c2a9a){if(_0x5c2a9a){_0x38c9bc['message'][_0x5eaf('0x71')]=_0x5c2a9a[0x0];if(!_0x55b073['body'][_0x5eaf('0x5f')])return;return db[_0x5eaf('0x72')][_0x5eaf('0x54')]({'where':{'id':_0x55b073[_0x5eaf('0x56')][_0x5eaf('0x5f')],'role':_0x5eaf('0x60')},'attributes':['id',_0x5eaf('0x37'),_0x5eaf('0x73'),_0x5eaf('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x6f83e){if(!_0x6f83e)return null;_0x38c9bc['message'][_0x5eaf('0x60')]=_0x6f83e;return _0x38c9bc;})[_0x5eaf('0x1d')](function(_0x112009){if(_0x112009){_0x112009[_0x5eaf('0x26')][_0x5eaf('0x75')]=util['format'](_0x5eaf('0x76'),_0x55b073[_0x5eaf('0x67')][_0x5eaf('0x37')]);_0x112009[_0x5eaf('0x26')][_0x5eaf('0x78')]=_0x38c9bc[_0x5eaf('0x78')];_0x112009[_0x5eaf('0x26')][_0x5eaf('0x77')]=_0x38c9bc[_0x5eaf('0x78')];_0x112009[_0x5eaf('0x26')][_0x5eaf('0x79')]='reject';respondWithRpcPromise(_0x5eaf('0x7a'),_0x5eaf('0x7a'),{'event':'rejectmessage','message':_[_0x5eaf('0x4d')](_0x38c9bc['message'],JSON[_0x5eaf('0x7c')](_0x38c9bc[_0x5eaf('0x69')][_0x5eaf('0x7d')]))},client9002);return _0x38c9bc;}return null;})[_0x5eaf('0x1d')](respondWithResult(_0x4b330c,null))[_0x5eaf('0x28')](handleError(_0x4b330c,null));}; \ No newline at end of file +var _0xd6e0=['../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','client','http','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','ChatMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','chat-interactions','accept','UserId','user','get','ChatInteraction','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','event','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x6c70aa,_0x14bea7){var _0x31dbf0=function(_0x1488a0){while(--_0x1488a0){_0x6c70aa['push'](_0x6c70aa['shift']());}};_0x31dbf0(++_0x14bea7);}(_0xd6e0,0x6d));var _0x0d6e=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0xd6e0[_0x1505e5];return _0x5b1dcd;};'use strict';var emlformat=require(_0x0d6e('0x0'));var rimraf=require(_0x0d6e('0x1'));var zipdir=require(_0x0d6e('0x2'));var jsonpatch=require(_0x0d6e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d6e('0x4'));var Mustache=require(_0x0d6e('0x5'));var util=require(_0x0d6e('0x6'));var path=require(_0x0d6e('0x7'));var sox=require(_0x0d6e('0x8'));var csv=require('to-csv');var ejs=require(_0x0d6e('0x9'));var fs=require('fs');var fs_extra=require(_0x0d6e('0xa'));var _=require(_0x0d6e('0xb'));var squel=require(_0x0d6e('0xc'));var crypto=require(_0x0d6e('0xd'));var jsforce=require(_0x0d6e('0xe'));var deskjs=require(_0x0d6e('0xf'));var toCsv=require(_0x0d6e('0x10'));var querystring=require(_0x0d6e('0x11'));var Papa=require('papaparse');var Redis=require(_0x0d6e('0x12'));var authService=require(_0x0d6e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0d6e('0x14'));var hardwareService=require(_0x0d6e('0x15'));var logger=require(_0x0d6e('0x16'))(_0x0d6e('0x17'));var utils=require(_0x0d6e('0x18'));var config=require(_0x0d6e('0x19'));var licenseUtil=require(_0x0d6e('0x1a'));var db=require(_0x0d6e('0x1b'))['db'];config['redis']=_[_0x0d6e('0x1c')](config['redis'],{'host':_0x0d6e('0x1d'),'port':0x18eb});var socket=require(_0x0d6e('0x1e'))(new Redis(config[_0x0d6e('0x1f')]));require(_0x0d6e('0x20'))[_0x0d6e('0x21')](socket);var jayson=require(_0x0d6e('0x22'));var client=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232c});var client9002=jayson[_0x0d6e('0x23')][_0x0d6e('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3f4a63,_0x117e93,_0x3352ac,_0x448e0b){return new BPromise(function(_0x2cff53,_0xdd2c5f){var _0x3d601a=_0x448e0b||client;return _0x3d601a['request'](_0x3f4a63,_0x3352ac)['then'](function(_0x3477c8){logger['info'](_0x0d6e('0x25'),_0x117e93,'request\x20sent');logger[_0x0d6e('0x26')](_0x0d6e('0x27'),_0x117e93,'request\x20sent',JSON[_0x0d6e('0x28')](_0x3477c8));if(_0x3477c8[_0x0d6e('0x29')]){if(_0x3477c8[_0x0d6e('0x29')]['code']===0x1f4){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);return _0xdd2c5f(_0x3477c8[_0x0d6e('0x29')][_0x0d6e('0x2a')]);}logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x3477c8['error'][_0x0d6e('0x2a')]);return _0x2cff53(_0x3477c8['error'][_0x0d6e('0x2a')]);}else{logger[_0x0d6e('0x2b')](_0x0d6e('0x25'),_0x117e93,_0x0d6e('0x2c'));_0x2cff53(_0x3477c8['result'][_0x0d6e('0x2a')]);}})['catch'](function(_0x9cf683){logger[_0x0d6e('0x29')](_0x0d6e('0x25'),_0x117e93,_0x9cf683);_0xdd2c5f(_0x9cf683);});});}function respondWithStatusCode(_0x166ec9,_0x2a7490){_0x2a7490=_0x2a7490||0xcc;return function(_0x3ae998){if(_0x3ae998){return _0x166ec9[_0x0d6e('0x2d')](_0x2a7490);}return _0x166ec9[_0x0d6e('0x2e')](_0x2a7490)[_0x0d6e('0x2f')]();};}function respondWithResult(_0x30d853,_0xe8fa){_0xe8fa=_0xe8fa||0xc8;return function(_0x5a357e){if(_0x5a357e){return _0x30d853['status'](_0xe8fa)[_0x0d6e('0x30')](_0x5a357e);}};}function respondWithFilteredResult(_0x29a0f8,_0x43cb7a){return function(_0x3bbdc4){if(_0x3bbdc4){var _0x1c38ab=typeof _0x43cb7a[_0x0d6e('0x31')]===_0x0d6e('0x32')&&typeof _0x43cb7a[_0x0d6e('0x33')]===_0x0d6e('0x32');var _0x133355=_0x3bbdc4[_0x0d6e('0x34')];var _0x5413c6=_0x1c38ab?0x0:_0x43cb7a[_0x0d6e('0x31')];var _0x384c81=_0x1c38ab?_0x3bbdc4[_0x0d6e('0x34')]:_0x43cb7a[_0x0d6e('0x31')]+_0x43cb7a[_0x0d6e('0x33')];var _0x1ce21e;if(_0x384c81>=_0x133355){_0x384c81=_0x133355;_0x1ce21e=0xc8;}else{_0x1ce21e=0xce;}_0x29a0f8[_0x0d6e('0x2e')](_0x1ce21e);return _0x29a0f8[_0x0d6e('0x35')]('Content-Range',_0x5413c6+'-'+_0x384c81+'/'+_0x133355)[_0x0d6e('0x30')](_0x3bbdc4);}return null;};}function patchUpdates(_0x255e8f){return function(_0xc4092){try{jsonpatch[_0x0d6e('0x36')](_0xc4092,_0x255e8f,!![]);}catch(_0x578061){return BPromise[_0x0d6e('0x37')](_0x578061);}return _0xc4092[_0x0d6e('0x38')]();};}function saveUpdates(_0x21576d,_0x244e22){return function(_0x42f7){if(_0x42f7){return _0x42f7['update'](_0x21576d)[_0x0d6e('0x39')](function(_0x4e0375){return _0x4e0375;});}return null;};}function removeEntity(_0x1444a9,_0x50de86){return function(_0x1b9139){if(_0x1b9139){return _0x1b9139[_0x0d6e('0x3a')]()['then'](function(){_0x1444a9[_0x0d6e('0x2e')](0xcc)[_0x0d6e('0x2f')]();});}};}function handleEntityNotFound(_0x46ba49,_0x18009e){return function(_0x5c88be){if(!_0x5c88be){_0x46ba49[_0x0d6e('0x2d')](0x194);}return _0x5c88be;};}function handleError(_0x2224c6,_0x51643f){_0x51643f=_0x51643f||0x1f4;return function(_0xbfa059){logger[_0x0d6e('0x29')](_0xbfa059[_0x0d6e('0x3b')]);if(_0xbfa059[_0x0d6e('0x3c')]){delete _0xbfa059[_0x0d6e('0x3c')];}_0x2224c6['status'](_0x51643f)[_0x0d6e('0x3d')](_0xbfa059);};}exports['index']=function(_0x6a0e02,_0x5299b9){var _0x3144e0={},_0x411942={},_0x3aee44={'count':0x0,'rows':[]};var _0xedb01e=_['map'](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')],function(_0x4bede1){return{'name':_0x4bede1[_0x0d6e('0x40')],'type':_0x4bede1[_0x0d6e('0x41')][_0x0d6e('0x42')]};});_0x411942[_0x0d6e('0x43')]=_[_0x0d6e('0x44')](_0xedb01e,_0x0d6e('0x3c'));_0x411942['query']=_[_0x0d6e('0x45')](_0x6a0e02[_0x0d6e('0x46')]);_0x411942[_0x0d6e('0x47')]=_['intersection'](_0x411942[_0x0d6e('0x43')],_0x411942[_0x0d6e('0x46')]);_0x3144e0[_0x0d6e('0x48')]=_[_0x0d6e('0x49')](_0x411942[_0x0d6e('0x43')],qs[_0x0d6e('0x4a')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x3144e0[_0x0d6e('0x48')]=_0x3144e0[_0x0d6e('0x48')][_0x0d6e('0x4b')]?_0x3144e0[_0x0d6e('0x48')]:_0x411942['model'];if(!_0x6a0e02['query'][_0x0d6e('0x4c')](_0x0d6e('0x4d'))){_0x3144e0[_0x0d6e('0x33')]=qs[_0x0d6e('0x33')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x33')]);_0x3144e0[_0x0d6e('0x31')]=qs[_0x0d6e('0x31')](_0x6a0e02[_0x0d6e('0x46')][_0x0d6e('0x31')]);}_0x3144e0[_0x0d6e('0x4e')]=qs[_0x0d6e('0x4f')](_0x6a0e02[_0x0d6e('0x46')]['sort']);_0x3144e0[_0x0d6e('0x50')]=qs['filters'](_['pick'](_0x6a0e02[_0x0d6e('0x46')],_0x411942[_0x0d6e('0x47')]),_0xedb01e);if(_0x6a0e02['query']['filter']){_0x3144e0['where']=_[_0x0d6e('0x51')](_0x3144e0[_0x0d6e('0x50')],{'$or':_[_0x0d6e('0x44')](_0xedb01e,function(_0x412f54){if(_0x412f54['type']!=='VIRTUAL'){var _0x5b114d={};_0x5b114d[_0x412f54[_0x0d6e('0x3c')]]={'$like':'%'+_0x6a0e02['query'][_0x0d6e('0x52')]+'%'};return _0x5b114d;}})});}_0x3144e0=_[_0x0d6e('0x51')]({},_0x3144e0,_0x6a0e02[_0x0d6e('0x53')]);var _0x4e5068={'where':_0x3144e0['where']};return db[_0x0d6e('0x3e')]['count'](_0x4e5068)['then'](function(_0x468e7f){_0x3aee44[_0x0d6e('0x34')]=_0x468e7f;if(_0x6a0e02['query'][_0x0d6e('0x54')]){_0x3144e0[_0x0d6e('0x55')]=[{'all':!![]}];}return db[_0x0d6e('0x3e')][_0x0d6e('0x56')](_0x3144e0);})[_0x0d6e('0x39')](function(_0x4ca73e){_0x3aee44['rows']=_0x4ca73e;return _0x3aee44;})[_0x0d6e('0x39')](respondWithFilteredResult(_0x5299b9,_0x3144e0))[_0x0d6e('0x57')](handleError(_0x5299b9,null));};exports[_0x0d6e('0x58')]=function(_0x23c04a,_0x3a46fd){var _0x396b58={'raw':!![],'where':{'id':_0x23c04a[_0x0d6e('0x59')]['id']}},_0x2a9341={};_0x2a9341['model']=_[_0x0d6e('0x45')](db[_0x0d6e('0x3e')][_0x0d6e('0x3f')]);_0x2a9341[_0x0d6e('0x46')]=_[_0x0d6e('0x45')](_0x23c04a[_0x0d6e('0x46')]);_0x2a9341[_0x0d6e('0x47')]=_[_0x0d6e('0x49')](_0x2a9341[_0x0d6e('0x43')],_0x2a9341[_0x0d6e('0x46')]);_0x396b58['attributes']=_['intersection'](_0x2a9341['model'],qs[_0x0d6e('0x4a')](_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x4a')]));_0x396b58[_0x0d6e('0x48')]=_0x396b58['attributes'][_0x0d6e('0x4b')]?_0x396b58[_0x0d6e('0x48')]:_0x2a9341[_0x0d6e('0x43')];if(_0x23c04a[_0x0d6e('0x46')][_0x0d6e('0x54')]){_0x396b58[_0x0d6e('0x55')]=[{'all':!![]}];}_0x396b58=_[_0x0d6e('0x51')]({},_0x396b58,_0x23c04a['options']);return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')](_0x396b58)[_0x0d6e('0x39')](handleEntityNotFound(_0x3a46fd,null))[_0x0d6e('0x39')](respondWithResult(_0x3a46fd,null))[_0x0d6e('0x57')](handleError(_0x3a46fd,null));};exports[_0x0d6e('0x5b')]=function(_0x956447,_0x241cea){return db[_0x0d6e('0x3e')]['create'](_0x956447[_0x0d6e('0x5c')],{})[_0x0d6e('0x39')](respondWithResult(_0x241cea,0xc9))[_0x0d6e('0x57')](handleError(_0x241cea,null));};exports[_0x0d6e('0x5d')]=function(_0x35d0f3,_0x5b0b8c){if(_0x35d0f3[_0x0d6e('0x5c')]['id']){delete _0x35d0f3[_0x0d6e('0x5c')]['id'];}return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x35d0f3['params']['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5b0b8c,null))[_0x0d6e('0x39')](saveUpdates(_0x35d0f3[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](respondWithResult(_0x5b0b8c,null))[_0x0d6e('0x57')](handleError(_0x5b0b8c,null));};exports[_0x0d6e('0x3a')]=function(_0x6f2fe9,_0x20819e){return db[_0x0d6e('0x3e')]['find']({'where':{'id':_0x6f2fe9[_0x0d6e('0x59')]['id']}})[_0x0d6e('0x39')](handleEntityNotFound(_0x20819e,null))[_0x0d6e('0x39')](removeEntity(_0x20819e,null))[_0x0d6e('0x57')](handleError(_0x20819e,null));};exports[_0x0d6e('0x5e')]=function(_0x314ca2,_0x50e9d5){return db[_0x0d6e('0x3e')][_0x0d6e('0x5e')]()[_0x0d6e('0x39')](respondWithResult(_0x50e9d5,null))[_0x0d6e('0x57')](handleError(_0x50e9d5,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x60')]=function(_0x560857,_0x5704c9,_0xfc96d1){var _0x55099b={'agent':{},'channel':'chat'};if(_0x560857[_0x0d6e('0x5c')]['id']){delete _0x560857['body']['id'];}_0x560857['body']['read']=!![];_0x560857[_0x0d6e('0x5c')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x560857['body'][_0x0d6e('0x61')]=_0x560857['body']['UserId']||_0x560857[_0x0d6e('0x62')]['id'];_0x55099b['agent']['id']=_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')];return db['ChatMessage'][_0x0d6e('0x5a')]({'where':{'id':_0x560857['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x5704c9,null))[_0x0d6e('0x39')](saveUpdates(_0x560857[_0x0d6e('0x5c')],null))[_0x0d6e('0x39')](function(_0x29988e){if(_0x29988e){_0x55099b[_0x0d6e('0x2a')]=_0x29988e[_0x0d6e('0x63')]({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x29988e[_0x0d6e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x5704c9,null))['then'](function(_0x363a9c){if(_0x363a9c){return _0x363a9c[_0x0d6e('0x5d')]({'UserId':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'read1stAt':_['isNil'](_0x363a9c[_0x0d6e('0x66')])?moment()['format'](_0x0d6e('0x67')):undefined});}return null;})['then'](function(_0x48c392){if(_0x48c392){_0x55099b['interaction']=_0x48c392['get']({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x68'),_0x560857['user']['id'],_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')],_0x560857['user'][_0x0d6e('0x69')],_0x55099b[_0x0d6e('0x6a')]['id'],_0x560857[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x560857[_0x0d6e('0x5c')]):'null');return respondWithRpcPromise(_0x0d6e('0x6b'),_0x0d6e('0x6c'),_0x55099b);}return null;})[_0x0d6e('0x39')](function(_0x43fc24){var _0x2c0d3b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x43fc24[_0x0d6e('0x2a')]['ContactId'];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x2c0d3b,{'type':db[_0x0d6e('0x6e')]['QueryTypes'][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0xe7ed40){return _0xe7ed40;});})[_0x0d6e('0x39')](function(_0x15e816){if(_0x15e816){_0x55099b['message'][_0x0d6e('0x70')]=_0x15e816[0x0];if(!_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db[_0x0d6e('0x71')][_0x0d6e('0x5a')]({'where':{'id':_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':_0x0d6e('0x72')},'attributes':['id',_0x0d6e('0x3c'),_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x33b5ba){if(!_0x33b5ba)return null;_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x33b5ba;return _0x55099b;})['then'](function(_0x2827ea){if(_0x2827ea){if(_0x560857[_0x0d6e('0x5c')][_0x0d6e('0x75')]){_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x76')]=util['format'](_0x0d6e('0x77'),_0x560857[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x55099b[_0x0d6e('0x78')];_0x55099b[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x55099b[_0x0d6e('0x78')];_0x55099b['message']['event']=_0x0d6e('0x60');return respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x7b'),'message':_[_0x0d6e('0x51')](_0x55099b[_0x0d6e('0x2a')],JSON['parse'](_0x55099b[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002)[_0x0d6e('0x39')](function(){return _0x55099b;});}return _0x55099b;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x5704c9,null))[_0x0d6e('0x57')](handleError(_0x5704c9,null));};var interaction_log=require(_0x0d6e('0x16'))(_0x0d6e('0x5f'));exports[_0x0d6e('0x37')]=function(_0x537f6b,_0x49f82f,_0x34851f){var _0x583830={'agent':{},'channel':'chat'};if(_0x537f6b[_0x0d6e('0x5c')]['id']){delete _0x537f6b['body']['id'];}_0x537f6b['body'][_0x0d6e('0x61')]=_0x537f6b[_0x0d6e('0x5c')]['UserId']||_0x537f6b[_0x0d6e('0x62')]['id'];_0x583830[_0x0d6e('0x72')]['id']=_0x537f6b['body'][_0x0d6e('0x61')];return db[_0x0d6e('0x3e')][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b['params']['id'],'UserId':null}})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))['then'](function(_0x5dc060){if(_0x5dc060){_0x583830['message']=_0x5dc060['get']({'plain':!![]});return db[_0x0d6e('0x64')][_0x0d6e('0x5a')]({'where':{'id':_0x5dc060[_0x0d6e('0x65')]}});}return null;})[_0x0d6e('0x39')](handleEntityNotFound(_0x49f82f,null))[_0x0d6e('0x39')](function(_0x3abfef){if(_0x3abfef){_0x583830[_0x0d6e('0x6a')]=_0x3abfef[_0x0d6e('0x63')]({'plain':!![]});interaction_log[_0x0d6e('0x2b')](_0x0d6e('0x7d'),_0x537f6b[_0x0d6e('0x62')]['id'],_0x537f6b['user']['name'],_0x537f6b['user'][_0x0d6e('0x69')],_0x583830[_0x0d6e('0x6a')]['id'],_0x537f6b[_0x0d6e('0x5c')]?JSON[_0x0d6e('0x28')](_0x537f6b['body']):'null');return respondWithRpcPromise(_0x0d6e('0x7e'),_0x0d6e('0x7f'),_0x583830);}return null;})[_0x0d6e('0x39')](function(_0x151510){var _0x5b6c54=_0x0d6e('0x80')+_0x151510[_0x0d6e('0x2a')][_0x0d6e('0x81')];return db[_0x0d6e('0x6d')][_0x0d6e('0x46')](_0x5b6c54,{'type':db[_0x0d6e('0x6e')][_0x0d6e('0x82')][_0x0d6e('0x6f')],'raw':!![]})['then'](function(_0x4c8f14){return _0x4c8f14;});})[_0x0d6e('0x39')](function(_0x4d0fa9){if(_0x4d0fa9){_0x583830[_0x0d6e('0x2a')]['contact']=_0x4d0fa9[0x0];if(!_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')])return;return db['User'][_0x0d6e('0x5a')]({'where':{'id':_0x537f6b[_0x0d6e('0x5c')][_0x0d6e('0x61')],'role':'agent'},'attributes':['id','name',_0x0d6e('0x73'),'email',_0x0d6e('0x74')],'raw':!![]});}return null;})[_0x0d6e('0x39')](function(_0x2114db){if(!_0x2114db)return null;_0x583830[_0x0d6e('0x2a')][_0x0d6e('0x72')]=_0x2114db;return _0x583830;})['then'](function(_0x2dafb0){if(_0x2dafb0){_0x2dafb0['message'][_0x0d6e('0x76')]=util['format']('SIP/%s',_0x537f6b[_0x0d6e('0x62')][_0x0d6e('0x3c')]);_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x78')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x79')]=_0x583830[_0x0d6e('0x78')];_0x2dafb0[_0x0d6e('0x2a')][_0x0d6e('0x83')]=_0x0d6e('0x37');respondWithRpcPromise(_0x0d6e('0x7a'),_0x0d6e('0x7a'),{'event':_0x0d6e('0x84'),'message':_['merge'](_0x583830[_0x0d6e('0x2a')],JSON[_0x0d6e('0x85')](_0x583830[_0x0d6e('0x6a')][_0x0d6e('0x7c')]))},client9002);return _0x583830;}return null;})[_0x0d6e('0x39')](respondWithResult(_0x49f82f,null))['catch'](handleError(_0x49f82f,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index cc937d4..f32bea1 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 _0xece8=['emit','exports','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xece8,0x104));var _0x8ece=function(_0x381403,_0x19fd9a){_0x381403=_0x381403-0x0;var _0x30b3b1=_0xece8[_0x381403];return _0x30b3b1;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8ece('0x0'))['db'][_0x8ece('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8ece('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ece('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cff3c){return function(_0xe3cd2b,_0x3ce82a,_0x1be42f){ChatMessageEvents['emit'](_0x3cff3c+':'+_0xe3cd2b['id'],_0xe3cd2b);ChatMessageEvents[_0x8ece('0x4')](_0x3cff3c,_0xe3cd2b);_0x1be42f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8ece('0x5')]=ChatMessageEvents; \ No newline at end of file +var _0x6108=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x6108,0x126));var _0x8610=function(_0xb276c0,_0x116692){_0xb276c0=_0xb276c0-0x0;var _0x3b5a6f=_0x6108[_0xb276c0];return _0x3b5a6f;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8610('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8610('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8610('0x2'),'afterDestroy':_0x8610('0x3')};function emitEvent(_0x454a13){return function(_0x57a33f,_0x59dc79,_0x3f3357){ChatMessageEvents[_0x8610('0x4')](_0x454a13+':'+_0x57a33f['id'],_0x57a33f);ChatMessageEvents[_0x8610('0x4')](_0x454a13,_0x57a33f);_0x3f3357(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatMessage[_0x8610('0x6')](e,emitEvent(event));}}module[_0x8610('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7fa68d5..efa6672 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 _0x17d7=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','ChatInteraction','ChatInteractionId','then'];(function(_0x453e2b,_0x4f1258){var _0x50f306=function(_0x397f14){while(--_0x397f14){_0x453e2b['push'](_0x453e2b['shift']());}};_0x50f306(++_0x4f1258);}(_0x17d7,0x15b));var _0x717d=function(_0x3c6141,_0x4a51f2){_0x3c6141=_0x3c6141-0x0;var _0x1a1e32=_0x17d7[_0x3c6141];return _0x1a1e32;};'use strict';var _=require(_0x717d('0x0'));var util=require(_0x717d('0x1'));var logger=require('../../config/logger')(_0x717d('0x2'));var moment=require(_0x717d('0x3'));var BPromise=require(_0x717d('0x4'));var rp=require(_0x717d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x717d('0x6'));var config=require(_0x717d('0x7'));var attributes=require(_0x717d('0x8'));module[_0x717d('0x9')]=function(_0x4bbb38,_0x16e3ac){return _0x4bbb38['define'](_0x717d('0xa'),attributes,{'tableName':_0x717d('0xb'),'paranoid':![],'indexes':[{'name':_0x717d('0xc'),'fields':[_0x717d('0xd')],'type':_0x717d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40843e,_0x1937f0,_0x5cfbad){var _0x69a26e=_0x4bbb38[_0x717d('0xf')];var _0x2fac9e=_0x40843e[_0x717d('0x10')]({'plain':!![]});if(_0x2fac9e[_0x717d('0x11')][_0x717d('0x12')]()==='in'||_0x2fac9e[_0x717d('0x11')][_0x717d('0x12')]()===_0x717d('0x13')&&!_0x2fac9e[_0x717d('0x14')]&&!_[_0x717d('0x15')](_0x2fac9e['UserId'])){_0x69a26e[_0x717d('0x16')]['findOne']({'where':{'id':_0x2fac9e[_0x717d('0x17')]}})[_0x717d('0x18')](function(_0x24977d){if(_0x24977d){_0x24977d[_0x717d('0x19')]({'lastMsgAt':_0x2fac9e[_0x717d('0x1a')],'lastMsgDirection':_0x2fac9e[_0x717d('0x11')][_0x717d('0x12')]()});}})[_0x717d('0x1b')](function(_0x3e327e){console[_0x717d('0x1c')](_0x3e327e);});}_0x5cfbad();}},'charset':_0x717d('0x1d'),'collate':_0x717d('0x1e')});}; \ No newline at end of file +var _0xf05b=['fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','chat_messages'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf05b,0xbd));var _0xbf05=function(_0x458ad3,_0x1cc9fe){_0x458ad3=_0x458ad3-0x0;var _0x4f9c4d=_0xf05b[_0x458ad3];return _0x4f9c4d;};'use strict';var _=require(_0xbf05('0x0'));var util=require(_0xbf05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbf05('0x2'));var BPromise=require(_0xbf05('0x3'));var rp=require(_0xbf05('0x4'));var fs=require('fs');var path=require(_0xbf05('0x5'));var rimraf=require(_0xbf05('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf05('0x7'));module[_0xbf05('0x8')]=function(_0x3f9c35,_0x3a6f09){return _0x3f9c35[_0xbf05('0x9')]('ChatMessage',attributes,{'tableName':_0xbf05('0xa'),'paranoid':![],'indexes':[{'name':_0xbf05('0xb'),'fields':['body'],'type':_0xbf05('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x403655,_0x3da244,_0x5b143c){var _0x1b108c=_0x3f9c35[_0xbf05('0xd')];var _0x381f8c=_0x403655['get']({'plain':!![]});if(_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()==='in'||_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()===_0xbf05('0x10')&&!_0x381f8c[_0xbf05('0x11')]&&!_['isNil'](_0x381f8c['UserId'])){_0x1b108c['ChatInteraction']['findOne']({'where':{'id':_0x381f8c[_0xbf05('0x12')]}})[_0xbf05('0x13')](function(_0x194a9c){if(_0x194a9c){_0x194a9c[_0xbf05('0x14')]({'lastMsgAt':_0x381f8c[_0xbf05('0x15')],'lastMsgDirection':_0x381f8c[_0xbf05('0xe')][_0xbf05('0xf')]()});}})[_0xbf05('0x16')](function(_0x15ed51){console['error'](_0x15ed51);});}_0x5b143c();}},'charset':_0xbf05('0x17'),'collate':_0xbf05('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e15cb9e..869d1db 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 _0x46fe=['http','redis','localhost','socket.io-emitter','register','request','debug','request\x20sent','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','ChatMessage','create','body','options','raw','then','info','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46fe,0x1c3));var _0xe46f=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x46fe[_0x3fe6df];return _0x372a0e;};'use strict';var _=require(_0xe46f('0x0'));var util=require(_0xe46f('0x1'));var moment=require(_0xe46f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe46f('0x3'));var fs=require('fs');var Redis=require(_0xe46f('0x4'));var db=require(_0xe46f('0x5'))['db'];var utils=require(_0xe46f('0x6'));var logger=require(_0xe46f('0x7'))('rpc');var config=require(_0xe46f('0x8'));var jayson=require(_0xe46f('0x9'));var client=jayson[_0xe46f('0xa')][_0xe46f('0xb')]({'port':0x232a});config[_0xe46f('0xc')]=_['defaults'](config[_0xe46f('0xc')],{'host':_0xe46f('0xd'),'port':0x18eb});var socket=require(_0xe46f('0xe'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xe46f('0xf')](socket);function respondWithRpcPromise(_0x3603c4,_0x15b72d,_0x4157cc){return new BPromise(function(_0xa64a1c,_0x2d214d){return client[_0xe46f('0x10')](_0x3603c4,_0x4157cc)['then'](function(_0x3d70d6){logger['info']('ChatMessage,\x20%s,\x20%s',_0x15b72d,'request\x20sent');logger[_0xe46f('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x15b72d,_0xe46f('0x12'),JSON['stringify'](_0x3d70d6));if(_0x3d70d6[_0xe46f('0x13')]){if(_0x3d70d6[_0xe46f('0x13')][_0xe46f('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x15b72d,_0x3d70d6[_0xe46f('0x13')][_0xe46f('0x15')]);return _0x2d214d(_0x3d70d6[_0xe46f('0x13')]['message']);}logger[_0xe46f('0x13')]('ChatMessage,\x20%s,\x20%s',_0x15b72d,_0x3d70d6[_0xe46f('0x13')][_0xe46f('0x15')]);return _0xa64a1c(_0x3d70d6['error'][_0xe46f('0x15')]);}else{logger['info'](_0xe46f('0x16'),_0x15b72d,_0xe46f('0x12'));_0xa64a1c(_0x3d70d6[_0xe46f('0x17')][_0xe46f('0x15')]);}})[_0xe46f('0x18')](function(_0x2241fc){logger['error'](_0xe46f('0x16'),_0x15b72d,_0x2241fc);_0x2d214d(_0x2241fc);});});}exports['CreateChatMessage']=function(_0x5eb192){var _0x3bf428=this;return new Promise(function(_0x1f2134,_0x3a3426){return db[_0xe46f('0x19')][_0xe46f('0x1a')](_0x5eb192[_0xe46f('0x1b')],{'raw':_0x5eb192[_0xe46f('0x1c')]?_0x5eb192[_0xe46f('0x1c')][_0xe46f('0x1d')]===undefined?!![]:![]:!![]})[_0xe46f('0x1e')](function(_0x31690a){logger[_0xe46f('0x1f')](_0xe46f('0x20'),_0x5eb192);logger[_0xe46f('0x11')](_0xe46f('0x20'),_0x5eb192,JSON['stringify'](_0x31690a));_0x1f2134(_0x31690a);})[_0xe46f('0x18')](function(_0x4aaef7){logger[_0xe46f('0x13')]('CreateChatMessage',_0x4aaef7[_0xe46f('0x15')],_0x5eb192);_0x3a3426(_0x3bf428[_0xe46f('0x13')](0x1f4,_0x4aaef7[_0xe46f('0x15')]));});});}; \ No newline at end of file +var _0x9f02=['register','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','create','body','options','raw','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x4394b6,_0x12357f){var _0x360244=function(_0x5689a1){while(--_0x5689a1){_0x4394b6['push'](_0x4394b6['shift']());}};_0x360244(++_0x12357f);}(_0x9f02,0x68));var _0x29f0=function(_0x4f7efa,_0x299b08){_0x4f7efa=_0x4f7efa-0x0;var _0x33d69d=_0x9f02[_0x4f7efa];return _0x33d69d;};'use strict';var _=require(_0x29f0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x29f0('0x1'));var fs=require('fs');var Redis=require(_0x29f0('0x2'));var db=require(_0x29f0('0x3'))['db'];var utils=require(_0x29f0('0x4'));var logger=require(_0x29f0('0x5'))('rpc');var config=require(_0x29f0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x29f0('0x7')][_0x29f0('0x8')]({'port':0x232a});config[_0x29f0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x29f0('0xa'))(new Redis(config['redis']));require(_0x29f0('0xb'))[_0x29f0('0xc')](socket);function respondWithRpcPromise(_0x581e4,_0x529ded,_0x48adaf){return new BPromise(function(_0x3e1eeb,_0x5a8eb2){return client['request'](_0x581e4,_0x48adaf)['then'](function(_0x488b7f){logger[_0x29f0('0xd')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x29f0('0xe'));logger['debug'](_0x29f0('0xf'),_0x529ded,_0x29f0('0xe'),JSON[_0x29f0('0x10')](_0x488b7f));if(_0x488b7f[_0x29f0('0x11')]){if(_0x488b7f['error'][_0x29f0('0x12')]===0x1f4){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x488b7f[_0x29f0('0x11')]['message']);return _0x5a8eb2(_0x488b7f[_0x29f0('0x11')]['message']);}logger[_0x29f0('0x11')](_0x29f0('0x13'),_0x529ded,_0x488b7f['error']['message']);return _0x3e1eeb(_0x488b7f['error'][_0x29f0('0x14')]);}else{logger[_0x29f0('0xd')](_0x29f0('0x13'),_0x529ded,'request\x20sent');_0x3e1eeb(_0x488b7f[_0x29f0('0x15')][_0x29f0('0x14')]);}})[_0x29f0('0x16')](function(_0x12e197){logger[_0x29f0('0x11')]('ChatMessage,\x20%s,\x20%s',_0x529ded,_0x12e197);_0x5a8eb2(_0x12e197);});});}exports[_0x29f0('0x17')]=function(_0xf7da2e){var _0x340fc0=this;return new Promise(function(_0x5a4579,_0x2fd36b){return db['ChatMessage'][_0x29f0('0x18')](_0xf7da2e[_0x29f0('0x19')],{'raw':_0xf7da2e[_0x29f0('0x1a')]?_0xf7da2e['options'][_0x29f0('0x1b')]===undefined?!![]:![]:!![]})[_0x29f0('0x1c')](function(_0x23e691){logger[_0x29f0('0xd')](_0x29f0('0x17'),_0xf7da2e);logger['debug'](_0x29f0('0x17'),_0xf7da2e,JSON[_0x29f0('0x10')](_0x23e691));_0x5a4579(_0x23e691);})[_0x29f0('0x16')](function(_0x3d9a49){logger[_0x29f0('0x11')](_0x29f0('0x17'),_0x3d9a49[_0x29f0('0x14')],_0xf7da2e);_0x2fd36b(_0x340fc0[_0x29f0('0x11')](0x1f4,_0x3d9a49[_0x29f0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2133055..8f58316 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 _0x9009=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x248f6b,_0x401324){var _0x54b829=function(_0x51ad90){while(--_0x51ad90){_0x248f6b['push'](_0x248f6b['shift']());}};_0x54b829(++_0x401324);}(_0x9009,0x1d4));var _0x9900=function(_0x1cfab8,_0x3381e7){_0x1cfab8=_0x1cfab8-0x0;var _0x24a72f=_0x9009[_0x1cfab8];return _0x24a72f;};'use strict';var ChatMessageEvents=require(_0x9900('0x0'));var events=['save',_0x9900('0x1'),_0x9900('0x2')];function createListener(_0x5d0a60,_0x12d637){return function(_0x177acf){_0x12d637[_0x9900('0x3')](_0x5d0a60,_0x177acf);};}function removeListener(_0x224abb,_0x5705f1){return function(){ChatMessageEvents[_0x9900('0x4')](_0x224abb,_0x5705f1);};}exports[_0x9900('0x5')]=function(_0x502dac){for(var _0x59dd25=0x0,_0x16de4e=events[_0x9900('0x6')];_0x59dd25<_0x16de4e;_0x59dd25++){var _0x4abe19=events[_0x59dd25];var _0x2f085b=createListener(_0x9900('0x7')+_0x4abe19,_0x502dac);ChatMessageEvents['on'](_0x4abe19,_0x2f085b);}}; \ No newline at end of file +var _0x5183=['./chatMessage.events','save','remove','emit','register','chatMessage:'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5183,0x13e));var _0x3518=function(_0x237b0d,_0x2a940c){_0x237b0d=_0x237b0d-0x0;var _0x1b0713=_0x5183[_0x237b0d];return _0x1b0713;};'use strict';var ChatMessageEvents=require(_0x3518('0x0'));var events=[_0x3518('0x1'),_0x3518('0x2'),'update'];function createListener(_0x5b6958,_0x2323f3){return function(_0x3cc276){_0x2323f3[_0x3518('0x3')](_0x5b6958,_0x3cc276);};}function removeListener(_0x421ab5,_0x5a38df){return function(){ChatMessageEvents['removeListener'](_0x421ab5,_0x5a38df);};}exports[_0x3518('0x4')]=function(_0x1031a9){for(var _0x2c019c=0x0,_0x482b2d=events['length'];_0x2c019c<_0x482b2d;_0x2c019c++){var _0x488c52=events[_0x2c019c];var _0x147b59=createListener(_0x3518('0x5')+_0x488c52,_0x1031a9);ChatMessageEvents['on'](_0x488c52,_0x147b59);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 42a3bfc..4ec6272 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 _0xc8dd=['./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','chat','chatmessage:create','update','put','/:id/accept','accept','/:id/reject','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c7299,_0xff8a76){var _0x5cf417=function(_0x3d4e34){while(--_0x3d4e34){_0x3c7299['push'](_0x3c7299['shift']());}};_0x5cf417(++_0xff8a76);}(_0xc8dd,0x191));var _0xdc8d=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xc8dd[_0xa30766];return _0x24e780;};'use strict';var multer=require('multer');var util=require(_0xdc8d('0x0'));var path=require(_0xdc8d('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc8d('0x2'));var router=express['Router']();var fs_extra=require(_0xdc8d('0x3'));var auth=require(_0xdc8d('0x4'));var interaction=require(_0xdc8d('0x5'));var config=require(_0xdc8d('0x6'));var controller=require(_0xdc8d('0x7'));router[_0xdc8d('0x8')]('/',auth[_0xdc8d('0x9')](),controller[_0xdc8d('0xa')]);router[_0xdc8d('0x8')]('/describe',auth[_0xdc8d('0x9')](),controller[_0xdc8d('0xb')]);router['get'](_0xdc8d('0xc'),auth[_0xdc8d('0x9')](),controller[_0xdc8d('0xd')]);router[_0xdc8d('0xe')]('/',auth['isAuthenticated'](),interaction[_0xdc8d('0xf')](_0xdc8d('0x10'),_0xdc8d('0x11')),controller['create']);router['put'](_0xdc8d('0xc'),controller[_0xdc8d('0x12')]);router[_0xdc8d('0x13')](_0xdc8d('0x14'),auth[_0xdc8d('0x9')](),controller[_0xdc8d('0x15')]);router[_0xdc8d('0x13')](_0xdc8d('0x16'),auth['isAuthenticated'](),controller['reject']);router[_0xdc8d('0x17')]('/:id',auth[_0xdc8d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x79b3=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','/:id/accept','accept','put','/:id/reject','reject','delete'];(function(_0x3aa4a8,_0x53044f){var _0x3968d7=function(_0x38faaf){while(--_0x38faaf){_0x3aa4a8['push'](_0x3aa4a8['shift']());}};_0x3968d7(++_0x53044f);}(_0x79b3,0xb7));var _0x379b=function(_0x1b7623,_0x5460c4){_0x1b7623=_0x1b7623-0x0;var _0xe2d267=_0x79b3[_0x1b7623];return _0xe2d267;};'use strict';var multer=require(_0x379b('0x0'));var util=require(_0x379b('0x1'));var path=require(_0x379b('0x2'));var timeout=require(_0x379b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x379b('0x4'));var auth=require(_0x379b('0x5'));var interaction=require(_0x379b('0x6'));var config=require('../../config/environment');var controller=require(_0x379b('0x7'));router[_0x379b('0x8')]('/',auth[_0x379b('0x9')](),controller['index']);router[_0x379b('0x8')]('/describe',auth[_0x379b('0x9')](),controller[_0x379b('0xa')]);router[_0x379b('0x8')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller[_0x379b('0xc')]);router[_0x379b('0xd')]('/',auth[_0x379b('0x9')](),interaction[_0x379b('0xe')](_0x379b('0xf'),_0x379b('0x10')),controller[_0x379b('0x11')]);router['put']('/:id',controller[_0x379b('0x12')]);router['put'](_0x379b('0x13'),auth[_0x379b('0x9')](),controller[_0x379b('0x14')]);router[_0x379b('0x15')](_0x379b('0x16'),auth[_0x379b('0x9')](),controller[_0x379b('0x17')]);router[_0x379b('0x18')](_0x379b('0xb'),auth[_0x379b('0x9')](),controller['destroy']);module[_0x379b('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index d44e122..8951594 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(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0x0b0e[_0x57d671];return _0x450dfe;};'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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x3f3e83,_0x425bc0){var _0x560422=function(_0x4f78ea){while(--_0x4f78ea){_0x3f3e83['push'](_0x3f3e83['shift']());}};_0x560422(++_0x425bc0);}(_0xb10b,0x12a));var _0xbb10=function(_0x4336a6,_0xc235ca){_0x4336a6=_0x4336a6-0x0;var _0x4012f3=_0xb10b[_0x4336a6];return _0x4012f3;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index dbdf64b..c0ee6f8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5b14db,_0x40e54b){var _0x449a93=function(_0x36f0e7){while(--_0x36f0e7){_0x5b14db['push'](_0x5b14db['shift']());}};_0x449a93(++_0x40e54b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _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(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0xc80b7f,_0x2a8c83){_0xc80b7f=_0xc80b7f-0x0;var _0x1ab2cb=_0x7a54[_0xc80b7f];return _0x1ab2cb;};'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 6b1d813..df290a2 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 _0x1caa=['emit','hook','events','ChatOfflineMessage','save','update','remove'];(function(_0x2c8573,_0x345465){var _0x263d3e=function(_0x4d7394){while(--_0x4d7394){_0x2c8573['push'](_0x2c8573['shift']());}};_0x263d3e(++_0x345465);}(_0x1caa,0xbf));var _0xa1ca=function(_0x31da21,_0x47cb01){_0x31da21=_0x31da21-0x0;var _0x4a8084=_0x1caa[_0x31da21];return _0x4a8084;};'use strict';var EventEmitter=require(_0xa1ca('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa1ca('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1ca('0x2'),'afterUpdate':_0xa1ca('0x3'),'afterDestroy':_0xa1ca('0x4')};function emitEvent(_0x18ad61){return function(_0xd599ba,_0x586653,_0x231a97){ChatOfflineMessageEvents[_0xa1ca('0x5')](_0x18ad61+':'+_0xd599ba['id'],_0xd599ba);ChatOfflineMessageEvents[_0xa1ca('0x5')](_0x18ad61,_0xd599ba);_0x231a97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xa1ca('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x293a=['ChatOfflineMessage','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x20711e,_0x5b61c9){var _0x173e7f=function(_0x4eabdc){while(--_0x4eabdc){_0x20711e['push'](_0x20711e['shift']());}};_0x173e7f(++_0x5b61c9);}(_0x293a,0xa6));var _0xa293=function(_0x51af8c,_0x7ae22f){_0x51af8c=_0x51af8c-0x0;var _0x170551=_0x293a[_0x51af8c];return _0x170551;};'use strict';var EventEmitter=require(_0xa293('0x0'));var ChatOfflineMessage=require(_0xa293('0x1'))['db'][_0xa293('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa293('0x3'),'afterDestroy':_0xa293('0x4')};function emitEvent(_0x1a971f){return function(_0x1bb168,_0x406ec1,_0x2626cf){ChatOfflineMessageEvents[_0xa293('0x5')](_0x1a971f+':'+_0x1bb168['id'],_0x1bb168);ChatOfflineMessageEvents['emit'](_0x1a971f,_0x1bb168);_0x2626cf(null);};}for(var e in events){if(events[_0xa293('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xa293('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 1e0d68c..18ab773 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 _0x39db=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x3a4e1f,_0x26d373){var _0x2524d1=function(_0x238b5f){while(--_0x238b5f){_0x3a4e1f['push'](_0x3a4e1f['shift']());}};_0x2524d1(++_0x26d373);}(_0x39db,0x1c4));var _0xb39d=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x39db[_0x1d558c];return _0x15767d;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xb39d('0x0')]=function(_0x3f23d2){return _0x3f23d2['define'](_0xb39d('0x1'),attributes,{'tableName':_0xb39d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb39d('0x3'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3e82=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x6e8056,_0x786ea0){var _0x5c7a56=function(_0xa43aa5){while(--_0xa43aa5){_0x6e8056['push'](_0x6e8056['shift']());}};_0x5c7a56(++_0x786ea0);}(_0x3e82,0x147));var _0x23e8=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e82[_0x40a045];return _0x1a687c;};'use strict';var attributes=require(_0x23e8('0x0'));module['exports']=function(_0x48a682){return _0x48a682[_0x23e8('0x1')](_0x23e8('0x2'),attributes,{'tableName':_0x23e8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x23e8('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ce44687..2426662 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 _0x2ae0=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result'];(function(_0xbb6084,_0x1612c1){var _0x2db4f0=function(_0x59048){while(--_0x59048){_0xbb6084['push'](_0xbb6084['shift']());}};_0x2db4f0(++_0x1612c1);}(_0x2ae0,0x161));var _0x02ae=function(_0x356c85,_0x22b9c7){_0x356c85=_0x356c85-0x0;var _0x4d6fa1=_0x2ae0[_0x356c85];return _0x4d6fa1;};'use strict';var _=require(_0x02ae('0x0'));var util=require(_0x02ae('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x02ae('0x2'));var fs=require('fs');var Redis=require(_0x02ae('0x3'));var db=require(_0x02ae('0x4'))['db'];var utils=require(_0x02ae('0x5'));var logger=require('../../config/logger')(_0x02ae('0x6'));var config=require(_0x02ae('0x7'));var jayson=require(_0x02ae('0x8'));var client=jayson[_0x02ae('0x9')][_0x02ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25edc3,_0x1edc81,_0x174329){return new BPromise(function(_0x2f4312,_0x593b65){return client[_0x02ae('0xb')](_0x25edc3,_0x174329)['then'](function(_0xfc98cb){logger[_0x02ae('0xc')](_0x02ae('0xd'),_0x1edc81,'request\x20sent');logger[_0x02ae('0xe')](_0x02ae('0xf'),_0x1edc81,'request\x20sent',JSON[_0x02ae('0x10')](_0xfc98cb));if(_0xfc98cb[_0x02ae('0x11')]){if(_0xfc98cb[_0x02ae('0x11')]['code']===0x1f4){logger[_0x02ae('0x11')](_0x02ae('0xd'),_0x1edc81,_0xfc98cb[_0x02ae('0x11')]['message']);return _0x593b65(_0xfc98cb[_0x02ae('0x11')]['message']);}logger[_0x02ae('0x11')](_0x02ae('0xd'),_0x1edc81,_0xfc98cb['error'][_0x02ae('0x12')]);return _0x2f4312(_0xfc98cb[_0x02ae('0x11')][_0x02ae('0x12')]);}else{logger[_0x02ae('0xc')](_0x02ae('0xd'),_0x1edc81,_0x02ae('0x13'));_0x2f4312(_0xfc98cb[_0x02ae('0x14')]['message']);}})[_0x02ae('0x15')](function(_0x1135cb){logger[_0x02ae('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1edc81,_0x1135cb);_0x593b65(_0x1135cb);});});} \ No newline at end of file +var _0xc507=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5aedb2,_0x41d9d5){var _0x4010a1=function(_0x233e99){while(--_0x233e99){_0x5aedb2['push'](_0x5aedb2['shift']());}};_0x4010a1(++_0x41d9d5);}(_0xc507,0x73));var _0x7c50=function(_0x40ebff,_0x1dd15e){_0x40ebff=_0x40ebff-0x0;var _0x40122a=_0xc507[_0x40ebff];return _0x40122a;};'use strict';var _=require(_0x7c50('0x0'));var util=require(_0x7c50('0x1'));var moment=require(_0x7c50('0x2'));var BPromise=require(_0x7c50('0x3'));var rs=require(_0x7c50('0x4'));var fs=require('fs');var Redis=require(_0x7c50('0x5'));var db=require(_0x7c50('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c50('0x7'))(_0x7c50('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c50('0x9'));var client=jayson[_0x7c50('0xa')][_0x7c50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eda30,_0x1ace0d,_0x815f20){return new BPromise(function(_0x5efd32,_0x909310){return client[_0x7c50('0xc')](_0x2eda30,_0x815f20)[_0x7c50('0xd')](function(_0x1df00b){logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));logger[_0x7c50('0x11')](_0x7c50('0x12'),_0x1ace0d,'request\x20sent',JSON[_0x7c50('0x13')](_0x1df00b));if(_0x1df00b[_0x7c50('0x14')]){if(_0x1df00b[_0x7c50('0x14')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);return _0x909310(_0x1df00b[_0x7c50('0x14')][_0x7c50('0x15')]);}logger[_0x7c50('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1ace0d,_0x1df00b['error'][_0x7c50('0x15')]);return _0x5efd32(_0x1df00b['error']['message']);}else{logger[_0x7c50('0xe')](_0x7c50('0xf'),_0x1ace0d,_0x7c50('0x10'));_0x5efd32(_0x1df00b[_0x7c50('0x16')][_0x7c50('0x15')]);}})[_0x7c50('0x17')](function(_0x2515d7){logger[_0x7c50('0x14')](_0x7c50('0xf'),_0x1ace0d,_0x2515d7);_0x909310(_0x2515d7);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 43a89cb..679917c 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 _0xd10c=['/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe'];(function(_0x4e4068,_0x122c31){var _0x2846a4=function(_0x1b9ab4){while(--_0x1b9ab4){_0x4e4068['push'](_0x4e4068['shift']());}};_0x2846a4(++_0x122c31);}(_0xd10c,0x1db));var _0xcd10=function(_0x3c931c,_0x16bba9){_0x3c931c=_0x3c931c-0x0;var _0x5492c4=_0xd10c[_0x3c931c];return _0x5492c4;};'use strict';var multer=require(_0xcd10('0x0'));var util=require('util');var path=require(_0xcd10('0x1'));var timeout=require(_0xcd10('0x2'));var express=require(_0xcd10('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcd10('0x4'));var interaction=require(_0xcd10('0x5'));var config=require(_0xcd10('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xcd10('0x7')]('/',auth['isAuthenticated'](),controller[_0xcd10('0x8')]);router[_0xcd10('0x7')]('/describe',auth[_0xcd10('0x9')](),controller[_0xcd10('0xa')]);router[_0xcd10('0x7')](_0xcd10('0xb'),auth[_0xcd10('0x9')](),controller[_0xcd10('0xc')]);router[_0xcd10('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcd10('0xe')](_0xcd10('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xcd10('0xf')](_0xcd10('0xb'),auth[_0xcd10('0x9')](),controller[_0xcd10('0x10')]);module[_0xcd10('0x11')]=router; \ No newline at end of file +var _0x854f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','exports'];(function(_0x3fd26c,_0x29e6d1){var _0x8b7bbe=function(_0x3217be){while(--_0x3217be){_0x3fd26c['push'](_0x3fd26c['shift']());}};_0x8b7bbe(++_0x29e6d1);}(_0x854f,0x108));var _0xf854=function(_0x52dfcf,_0x26e802){_0x52dfcf=_0x52dfcf-0x0;var _0x4d89cf=_0x854f[_0x52dfcf];return _0x4d89cf;};'use strict';var multer=require(_0xf854('0x0'));var util=require(_0xf854('0x1'));var path=require(_0xf854('0x2'));var timeout=require(_0xf854('0x3'));var express=require(_0xf854('0x4'));var router=express[_0xf854('0x5')]();var fs_extra=require(_0xf854('0x6'));var auth=require(_0xf854('0x7'));var interaction=require(_0xf854('0x8'));var config=require(_0xf854('0x9'));var controller=require(_0xf854('0xa'));router[_0xf854('0xb')]('/',auth[_0xf854('0xc')](),controller[_0xf854('0xd')]);router[_0xf854('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xf854('0xe')]);router[_0xf854('0xb')](_0xf854('0xf'),auth['isAuthenticated'](),controller[_0xf854('0x10')]);router[_0xf854('0x11')]('/',auth['isAuthenticated'](),controller[_0xf854('0x12')]);router['put'](_0xf854('0xf'),auth[_0xf854('0xc')](),controller[_0xf854('0x13')]);router[_0xf854('0x14')](_0xf854('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xf854('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 8c40783..9f2c95e 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 _0x9b3e=['mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x15c211,_0x13093b){var _0x2fc84c=function(_0x37852d){while(--_0x37852d){_0x15c211['push'](_0x15c211['shift']());}};_0x2fc84c(++_0x13093b);}(_0x9b3e,0x1a7));var _0xe9b3=function(_0x4c862c,_0x56c72a){_0x4c862c=_0x4c862c-0x0;var _0x546cf8=_0x9b3e[_0x4c862c];return _0x546cf8;};'use strict';var Sequelize=require(_0xe9b3('0x0'));module[_0xe9b3('0x1')]={'name':{'type':Sequelize[_0xe9b3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9b3('0x3'),_0xe9b3('0x4')),'defaultValue':_0xe9b3('0x3')},'selector':{'type':Sequelize[_0xe9b3('0x2')]},'timeout':{'type':Sequelize[_0xe9b3('0x5')]}}; \ No newline at end of file +var _0x7e34=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x160393,_0x4e2ea7){var _0x39865d=function(_0x14362b){while(--_0x14362b){_0x160393['push'](_0x160393['shift']());}};_0x39865d(++_0x4e2ea7);}(_0x7e34,0xb7));var _0x47e3=function(_0x5f1413,_0x4eace2){_0x5f1413=_0x5f1413-0x0;var _0x216666=_0x7e34[_0x5f1413];return _0x216666;};'use strict';var Sequelize=require(_0x47e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x47e3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x47e3('0x2')](_0x47e3('0x3'),_0x47e3('0x4')),'defaultValue':_0x47e3('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x47e3('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index f90df80..6569b43 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 _0x06f4=['sendStatus','status','end','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','show','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','length','includeAll','merge','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06f4,0x136));var _0x406f=function(_0x3ff609,_0xc1942e){_0x3ff609=_0x3ff609-0x0;var _0x120444=_0x06f4[_0x3ff609];return _0x120444;};'use strict';var emlformat=require(_0x406f('0x0'));var rimraf=require(_0x406f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x406f('0x2'));var rp=require(_0x406f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x406f('0x4'));var util=require('util');var path=require(_0x406f('0x5'));var sox=require(_0x406f('0x6'));var csv=require(_0x406f('0x7'));var ejs=require(_0x406f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x406f('0x9'));var squel=require('squel');var crypto=require(_0x406f('0xa'));var jsforce=require(_0x406f('0xb'));var deskjs=require(_0x406f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x406f('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x406f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x406f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x406f('0x10'))('api');var utils=require(_0x406f('0x11'));var config=require(_0x406f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x406f('0x13'))['db'];function respondWithStatusCode(_0x380382,_0x451592){_0x451592=_0x451592||0xcc;return function(_0x163de4){if(_0x163de4){return _0x380382[_0x406f('0x14')](_0x451592);}return _0x380382[_0x406f('0x15')](_0x451592)[_0x406f('0x16')]();};}function respondWithResult(_0xcc1d6,_0x4522b2){_0x4522b2=_0x4522b2||0xc8;return function(_0x5045e8){if(_0x5045e8){return _0xcc1d6[_0x406f('0x15')](_0x4522b2)['json'](_0x5045e8);}};}function respondWithFilteredResult(_0x1bf795,_0x28fda6){return function(_0x4498d9){if(_0x4498d9){var _0x5c80af=typeof _0x28fda6[_0x406f('0x17')]===_0x406f('0x18')&&typeof _0x28fda6['limit']==='undefined';var _0x11c759=_0x4498d9[_0x406f('0x19')];var _0x509bae=_0x5c80af?0x0:_0x28fda6[_0x406f('0x17')];var _0x57d93a=_0x5c80af?_0x4498d9[_0x406f('0x19')]:_0x28fda6[_0x406f('0x17')]+_0x28fda6[_0x406f('0x1a')];var _0x12bb0f;if(_0x57d93a>=_0x11c759){_0x57d93a=_0x11c759;_0x12bb0f=0xc8;}else{_0x12bb0f=0xce;}_0x1bf795['status'](_0x12bb0f);return _0x1bf795['set'](_0x406f('0x1b'),_0x509bae+'-'+_0x57d93a+'/'+_0x11c759)['json'](_0x4498d9);}return null;};}function patchUpdates(_0x33dd5f){return function(_0x5089b2){try{jsonpatch[_0x406f('0x1c')](_0x5089b2,_0x33dd5f,!![]);}catch(_0x3a1a36){return BPromise[_0x406f('0x1d')](_0x3a1a36);}return _0x5089b2['save']();};}function saveUpdates(_0x58c0d3,_0x518a88){return function(_0x11683){if(_0x11683){return _0x11683[_0x406f('0x1e')](_0x58c0d3)[_0x406f('0x1f')](function(_0x5ebb26){return _0x5ebb26;});}return null;};}function removeEntity(_0x102cfd,_0x5961cc){return function(_0x3dd3d1){if(_0x3dd3d1){return _0x3dd3d1[_0x406f('0x20')]()[_0x406f('0x1f')](function(){_0x102cfd[_0x406f('0x15')](0xcc)[_0x406f('0x16')]();});}};}function handleEntityNotFound(_0x51ac15,_0x55a4ee){return function(_0x81589c){if(!_0x81589c){_0x51ac15['sendStatus'](0x194);}return _0x81589c;};}function handleError(_0x467a3a,_0xa240d8){_0xa240d8=_0xa240d8||0x1f4;return function(_0x4ff1de){logger['error'](_0x4ff1de[_0x406f('0x21')]);if(_0x4ff1de['name']){delete _0x4ff1de[_0x406f('0x22')];}_0x467a3a[_0x406f('0x15')](_0xa240d8)[_0x406f('0x23')](_0x4ff1de);};}exports[_0x406f('0x24')]=function(_0x2c439b,_0x174e47){var _0x224bd0={'raw':!![],'where':{'id':_0x2c439b['params']['id']}},_0x2b41dd={};_0x2b41dd['model']=_[_0x406f('0x25')](db[_0x406f('0x26')][_0x406f('0x27')]);_0x2b41dd[_0x406f('0x28')]=_['keys'](_0x2c439b['query']);_0x2b41dd[_0x406f('0x29')]=_[_0x406f('0x2a')](_0x2b41dd['model'],_0x2b41dd['query']);_0x224bd0[_0x406f('0x2b')]=_[_0x406f('0x2a')](_0x2b41dd[_0x406f('0x2c')],qs[_0x406f('0x2d')](_0x2c439b[_0x406f('0x28')][_0x406f('0x2d')]));_0x224bd0[_0x406f('0x2b')]=_0x224bd0[_0x406f('0x2b')][_0x406f('0x2e')]?_0x224bd0[_0x406f('0x2b')]:_0x2b41dd[_0x406f('0x2c')];if(_0x2c439b[_0x406f('0x28')][_0x406f('0x2f')]){_0x224bd0['include']=[{'all':!![]}];}_0x224bd0=_[_0x406f('0x30')]({},_0x224bd0,_0x2c439b[_0x406f('0x31')]);return db[_0x406f('0x26')][_0x406f('0x32')](_0x224bd0)[_0x406f('0x1f')](handleEntityNotFound(_0x174e47,null))[_0x406f('0x1f')](respondWithResult(_0x174e47,null))[_0x406f('0x33')](handleError(_0x174e47,null));};exports[_0x406f('0x34')]=function(_0x3dc67b,_0x3fdc25){return db['ChatProactiveAction'][_0x406f('0x34')](_0x3dc67b[_0x406f('0x35')],{})[_0x406f('0x1f')](respondWithResult(_0x3fdc25,0xc9))[_0x406f('0x33')](handleError(_0x3fdc25,null));};exports[_0x406f('0x1e')]=function(_0x2a3cc1,_0x58108b){if(_0x2a3cc1['body']['id']){delete _0x2a3cc1[_0x406f('0x35')]['id'];}return db[_0x406f('0x26')]['find']({'where':{'id':_0x2a3cc1[_0x406f('0x36')]['id']}})['then'](handleEntityNotFound(_0x58108b,null))[_0x406f('0x1f')](saveUpdates(_0x2a3cc1[_0x406f('0x35')],null))[_0x406f('0x1f')](respondWithResult(_0x58108b,null))['catch'](handleError(_0x58108b,null));};exports[_0x406f('0x20')]=function(_0x147448,_0x3e3546){return db[_0x406f('0x26')][_0x406f('0x32')]({'where':{'id':_0x147448[_0x406f('0x36')]['id']}})[_0x406f('0x1f')](handleEntityNotFound(_0x3e3546,null))[_0x406f('0x1f')](removeEntity(_0x3e3546,null))[_0x406f('0x33')](handleError(_0x3e3546,null));}; \ No newline at end of file +var _0x59c3=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','filters','intersection','query','attributes','fields','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0x59c3,0x133));var _0x359c=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x59c3[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x359c('0x0'));var rimraf=require(_0x359c('0x1'));var zipdir=require(_0x359c('0x2'));var jsonpatch=require(_0x359c('0x3'));var rp=require(_0x359c('0x4'));var moment=require(_0x359c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require('squel');var crypto=require(_0x359c('0xd'));var jsforce=require(_0x359c('0xe'));var deskjs=require(_0x359c('0xf'));var toCsv=require(_0x359c('0xa'));var querystring=require('querystring');var Papa=require(_0x359c('0x10'));var Redis=require('ioredis');var authService=require(_0x359c('0x11'));var qs=require(_0x359c('0x12'));var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require('../../config/utils');var config=require(_0x359c('0x17'));var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];function respondWithStatusCode(_0x18fab2,_0x1d4d8a){_0x1d4d8a=_0x1d4d8a||0xcc;return function(_0x29d295){if(_0x29d295){return _0x18fab2[_0x359c('0x1a')](_0x1d4d8a);}return _0x18fab2[_0x359c('0x1b')](_0x1d4d8a)[_0x359c('0x1c')]();};}function respondWithResult(_0x4413ce,_0x2cf668){_0x2cf668=_0x2cf668||0xc8;return function(_0xd07946){if(_0xd07946){return _0x4413ce['status'](_0x2cf668)[_0x359c('0x1d')](_0xd07946);}};}function respondWithFilteredResult(_0x1901cc,_0x4d4860){return function(_0x80b8d8){if(_0x80b8d8){var _0x186e45=typeof _0x4d4860[_0x359c('0x1e')]===_0x359c('0x1f')&&typeof _0x4d4860[_0x359c('0x20')]===_0x359c('0x1f');var _0x42d3b5=_0x80b8d8[_0x359c('0x21')];var _0x2931eb=_0x186e45?0x0:_0x4d4860[_0x359c('0x1e')];var _0x2bdd3c=_0x186e45?_0x80b8d8[_0x359c('0x21')]:_0x4d4860[_0x359c('0x1e')]+_0x4d4860[_0x359c('0x20')];var _0x19d0da;if(_0x2bdd3c>=_0x42d3b5){_0x2bdd3c=_0x42d3b5;_0x19d0da=0xc8;}else{_0x19d0da=0xce;}_0x1901cc[_0x359c('0x1b')](_0x19d0da);return _0x1901cc[_0x359c('0x22')](_0x359c('0x23'),_0x2931eb+'-'+_0x2bdd3c+'/'+_0x42d3b5)['json'](_0x80b8d8);}return null;};}function patchUpdates(_0x395ef8){return function(_0x5b305b){try{jsonpatch[_0x359c('0x24')](_0x5b305b,_0x395ef8,!![]);}catch(_0x5df429){return BPromise[_0x359c('0x25')](_0x5df429);}return _0x5b305b[_0x359c('0x26')]();};}function saveUpdates(_0x34f747,_0x402114){return function(_0x6e731c){if(_0x6e731c){return _0x6e731c[_0x359c('0x27')](_0x34f747)[_0x359c('0x28')](function(_0x1fe73f){return _0x1fe73f;});}return null;};}function removeEntity(_0x15b7c7,_0x1d29df){return function(_0x3e9cdf){if(_0x3e9cdf){return _0x3e9cdf[_0x359c('0x29')]()[_0x359c('0x28')](function(){_0x15b7c7[_0x359c('0x1b')](0xcc)[_0x359c('0x1c')]();});}};}function handleEntityNotFound(_0xf6f24,_0x4fbc28){return function(_0xf0770b){if(!_0xf0770b){_0xf6f24[_0x359c('0x1a')](0x194);}return _0xf0770b;};}function handleError(_0x35569d,_0x540fc9){_0x540fc9=_0x540fc9||0x1f4;return function(_0x1436a8){logger[_0x359c('0x2a')](_0x1436a8[_0x359c('0x2b')]);if(_0x1436a8['name']){delete _0x1436a8[_0x359c('0x2c')];}_0x35569d['status'](_0x540fc9)[_0x359c('0x2d')](_0x1436a8);};}exports[_0x359c('0x2e')]=function(_0x1d52ac,_0x31d65c){var _0x512fc0={'raw':!![],'where':{'id':_0x1d52ac[_0x359c('0x2f')]['id']}},_0x2e42f6={};_0x2e42f6[_0x359c('0x30')]=_[_0x359c('0x31')](db[_0x359c('0x32')][_0x359c('0x33')]);_0x2e42f6['query']=_['keys'](_0x1d52ac['query']);_0x2e42f6[_0x359c('0x34')]=_[_0x359c('0x35')](_0x2e42f6['model'],_0x2e42f6[_0x359c('0x36')]);_0x512fc0[_0x359c('0x37')]=_[_0x359c('0x35')](_0x2e42f6[_0x359c('0x30')],qs[_0x359c('0x38')](_0x1d52ac['query'][_0x359c('0x38')]));_0x512fc0[_0x359c('0x37')]=_0x512fc0[_0x359c('0x37')]['length']?_0x512fc0['attributes']:_0x2e42f6['model'];if(_0x1d52ac[_0x359c('0x36')][_0x359c('0x39')]){_0x512fc0['include']=[{'all':!![]}];}_0x512fc0=_[_0x359c('0x3a')]({},_0x512fc0,_0x1d52ac[_0x359c('0x3b')]);return db[_0x359c('0x32')][_0x359c('0x3c')](_0x512fc0)[_0x359c('0x28')](handleEntityNotFound(_0x31d65c,null))[_0x359c('0x28')](respondWithResult(_0x31d65c,null))['catch'](handleError(_0x31d65c,null));};exports[_0x359c('0x3d')]=function(_0x326baa,_0xc2f4b6){return db[_0x359c('0x32')][_0x359c('0x3d')](_0x326baa[_0x359c('0x3e')],{})['then'](respondWithResult(_0xc2f4b6,0xc9))[_0x359c('0x3f')](handleError(_0xc2f4b6,null));};exports['update']=function(_0x5366e0,_0x1cf3f8){if(_0x5366e0[_0x359c('0x3e')]['id']){delete _0x5366e0['body']['id'];}return db[_0x359c('0x32')][_0x359c('0x3c')]({'where':{'id':_0x5366e0[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x1cf3f8,null))['then'](saveUpdates(_0x5366e0[_0x359c('0x3e')],null))[_0x359c('0x28')](respondWithResult(_0x1cf3f8,null))[_0x359c('0x3f')](handleError(_0x1cf3f8,null));};exports['destroy']=function(_0x16ff10,_0x56d973){return db[_0x359c('0x32')]['find']({'where':{'id':_0x16ff10[_0x359c('0x2f')]['id']}})[_0x359c('0x28')](handleEntityNotFound(_0x56d973,null))['then'](removeEntity(_0x56d973,null))['catch'](handleError(_0x56d973,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 5c97736..49e2287 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 _0x5146=['define','ChatProactiveAction','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1da7c5,_0xb292c5){var _0x575cd=function(_0x54229e){while(--_0x54229e){_0x1da7c5['push'](_0x1da7c5['shift']());}};_0x575cd(++_0xb292c5);}(_0x5146,0x1c4));var _0x6514=function(_0x560375,_0x34359d){_0x560375=_0x560375-0x0;var _0x298bbc=_0x5146[_0x560375];return _0x298bbc;};'use strict';var _=require(_0x6514('0x0'));var util=require(_0x6514('0x1'));var logger=require(_0x6514('0x2'))(_0x6514('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6514('0x4'));var fs=require('fs');var path=require(_0x6514('0x5'));var rimraf=require('rimraf');var config=require(_0x6514('0x6'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x1deb07,_0x16cfd1){return _0x1deb07[_0x6514('0x7')](_0x6514('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf68f=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api'];(function(_0x27a027,_0x7f9a8f){var _0x4fc60d=function(_0x568acc){while(--_0x568acc){_0x27a027['push'](_0x27a027['shift']());}};_0x4fc60d(++_0x7f9a8f);}(_0xf68f,0x168));var _0xff68=function(_0xa8ef70,_0x364d2f){_0xa8ef70=_0xa8ef70-0x0;var _0x447423=_0xf68f[_0xa8ef70];return _0x447423;};'use strict';var _=require(_0xff68('0x0'));var util=require(_0xff68('0x1'));var logger=require(_0xff68('0x2'))(_0xff68('0x3'));var moment=require(_0xff68('0x4'));var BPromise=require(_0xff68('0x5'));var rp=require(_0xff68('0x6'));var fs=require('fs');var path=require(_0xff68('0x7'));var rimraf=require(_0xff68('0x8'));var config=require('../../config/environment');var attributes=require(_0xff68('0x9'));module[_0xff68('0xa')]=function(_0x473cce,_0x28ea54){return _0x473cce[_0xff68('0xb')](_0xff68('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 7a5c378..bbd2714 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 _0x67c7=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x67c7,0xfa));var _0x767c=function(_0x311c35,_0x54a2b0){_0x311c35=_0x311c35-0x0;var _0x31ff65=_0x67c7[_0x311c35];return _0x31ff65;};'use strict';var _=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var moment=require('moment');var BPromise=require(_0x767c('0x2'));var rs=require(_0x767c('0x3'));var fs=require('fs');var Redis=require(_0x767c('0x4'));var db=require(_0x767c('0x5'))['db'];var utils=require(_0x767c('0x6'));var logger=require('../../config/logger')(_0x767c('0x7'));var config=require(_0x767c('0x8'));var jayson=require(_0x767c('0x9'));var client=jayson[_0x767c('0xa')][_0x767c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ef4b6,_0x3680aa,_0x475145){return new BPromise(function(_0xdea499,_0x166880){return client[_0x767c('0xc')](_0x5ef4b6,_0x475145)['then'](function(_0x138c99){logger[_0x767c('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3680aa,_0x767c('0xe'));logger['debug'](_0x767c('0xf'),_0x3680aa,_0x767c('0xe'),JSON[_0x767c('0x10')](_0x138c99));if(_0x138c99['error']){if(_0x138c99[_0x767c('0x11')][_0x767c('0x12')]===0x1f4){logger[_0x767c('0x11')](_0x767c('0x13'),_0x3680aa,_0x138c99[_0x767c('0x11')][_0x767c('0x14')]);return _0x166880(_0x138c99[_0x767c('0x11')][_0x767c('0x14')]);}logger['error'](_0x767c('0x13'),_0x3680aa,_0x138c99[_0x767c('0x11')]['message']);return _0xdea499(_0x138c99[_0x767c('0x11')][_0x767c('0x14')]);}else{logger[_0x767c('0xd')](_0x767c('0x13'),_0x3680aa,'request\x20sent');_0xdea499(_0x138c99[_0x767c('0x15')][_0x767c('0x14')]);}})[_0x767c('0x16')](function(_0x5762e8){logger[_0x767c('0x11')](_0x767c('0x13'),_0x3680aa,_0x5762e8);_0x166880(_0x5762e8);});});} \ No newline at end of file +var _0xbd40=['jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xbd40,0x98));var _0x0bd4=function(_0x975e75,_0x42b16c){_0x975e75=_0x975e75-0x0;var _0x3c6f06=_0xbd40[_0x975e75];return _0x3c6f06;};'use strict';var _=require(_0x0bd4('0x0'));var util=require(_0x0bd4('0x1'));var moment=require(_0x0bd4('0x2'));var BPromise=require(_0x0bd4('0x3'));var rs=require(_0x0bd4('0x4'));var fs=require('fs');var Redis=require(_0x0bd4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bd4('0x6'));var logger=require(_0x0bd4('0x7'))(_0x0bd4('0x8'));var config=require('../../config/environment');var jayson=require(_0x0bd4('0x9'));var client=jayson[_0x0bd4('0xa')][_0x0bd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5fed53,_0x4f12ff,_0x536b98){return new BPromise(function(_0x4980d2,_0xa06455){return client[_0x0bd4('0xc')](_0x5fed53,_0x536b98)['then'](function(_0x324dbd){logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));logger[_0x0bd4('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f12ff,'request\x20sent',JSON[_0x0bd4('0x11')](_0x324dbd));if(_0x324dbd[_0x0bd4('0x12')]){if(_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x13')]===0x1f4){logger['error'](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd['error'][_0x0bd4('0x14')]);return _0xa06455(_0x324dbd['error'][_0x0bd4('0x14')]);}logger[_0x0bd4('0x12')](_0x0bd4('0xe'),_0x4f12ff,_0x324dbd[_0x0bd4('0x12')][_0x0bd4('0x14')]);return _0x4980d2(_0x324dbd['error'][_0x0bd4('0x14')]);}else{logger[_0x0bd4('0xd')](_0x0bd4('0xe'),_0x4f12ff,_0x0bd4('0xf'));_0x4980d2(_0x324dbd[_0x0bd4('0x15')]['message']);}})[_0x0bd4('0x16')](function(_0x5e3018){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4f12ff,_0x5e3018);_0xa06455(_0x5e3018);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 267f459..d839b29 100644 --- a/server/api/chatProactiveAction/index.js +++ b/server/api/chatProactiveAction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb138,0x1dd));var _0x8b13=function(_0x44c98f,_0x17fbd0){_0x44c98f=_0x44c98f-0x0;var _0x5da512=_0xb138[_0x44c98f];return _0x5da512;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file +var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x7da7,0x10d));var _0x77da=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0x7da7[_0x1b3a5c];return _0x2ae8cb;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 2e5e1ac..9a3923a 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 _0xdb51=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x493898,_0x31c6b4){var _0x74c353=function(_0x2391b3){while(--_0x2391b3){_0x493898['push'](_0x493898['shift']());}};_0x74c353(++_0x31c6b4);}(_0xdb51,0x12c));var _0x1db5=function(_0x21e920,_0x296dc3){_0x21e920=_0x21e920-0x0;var _0x47f9c5=_0xdb51[_0x21e920];return _0x47f9c5;};'use strict';var Sequelize=require(_0x1db5('0x0'));module[_0x1db5('0x1')]={'name':{'type':Sequelize[_0x1db5('0x2')],'unique':_0x1db5('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1db5('0x2')]},'timeout':{'type':Sequelize[_0x1db5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1db5('0x5')](_0x1db5('0x6'),_0x1db5('0x7'),_0x1db5('0x8'))}}; \ No newline at end of file +var _0x26e5=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x32854c,_0x1ceeea){var _0x1b3012=function(_0x15ca7d){while(--_0x15ca7d){_0x32854c['push'](_0x32854c['shift']());}};_0x1b3012(++_0x1ceeea);}(_0x26e5,0xfb));var _0x526e=function(_0xf4f343,_0x41fe4a){_0xf4f343=_0xf4f343-0x0;var _0x4cda68=_0x26e5[_0xf4f343];return _0x4cda68;};'use strict';var Sequelize=require(_0x526e('0x0'));module['exports']={'name':{'type':Sequelize[_0x526e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x526e('0x1')]},'timeout':{'type':Sequelize[_0x526e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x526e('0x3')](_0x526e('0x4'),_0x526e('0x5'),_0x526e('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 165f0a9..e8590f4 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 _0x9a77=['addAgents','omit','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','Content-Range','reject','save','update','destroy','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','ChatQueueId','findAll','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','ids','Team','User','online','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','Agents','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userChatQueue:remove'];(function(_0x2d8e0e,_0x40cd18){var _0x3ff08f=function(_0x5e41cb){while(--_0x5e41cb){_0x2d8e0e['push'](_0x2d8e0e['shift']());}};_0x3ff08f(++_0x40cd18);}(_0x9a77,0x9b));var _0x79a7=function(_0x475eca,_0x211133){_0x475eca=_0x475eca-0x0;var _0x4d007a=_0x9a77[_0x475eca];return _0x4d007a;};'use strict';var emlformat=require(_0x79a7('0x0'));var rimraf=require(_0x79a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79a7('0x2'));var rp=require(_0x79a7('0x3'));var moment=require(_0x79a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x79a7('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x79a7('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79a7('0x7'));var squel=require(_0x79a7('0x8'));var crypto=require(_0x79a7('0x9'));var jsforce=require(_0x79a7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x79a7('0xb'));var querystring=require('querystring');var Papa=require(_0x79a7('0xc'));var Redis=require(_0x79a7('0xd'));var authService=require(_0x79a7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x79a7('0xf'));var hardwareService=require(_0x79a7('0x10'));var logger=require(_0x79a7('0x11'))(_0x79a7('0x12'));var utils=require(_0x79a7('0x13'));var config=require(_0x79a7('0x14'));var licenseUtil=require(_0x79a7('0x15'));var db=require(_0x79a7('0x16'))['db'];config[_0x79a7('0x17')]=_[_0x79a7('0x18')](config['redis'],{'host':_0x79a7('0x19'),'port':0x18eb});var socket=require(_0x79a7('0x1a'))(new Redis(config[_0x79a7('0x17')]));require(_0x79a7('0x1b'))['register'](socket);var jayson=require(_0x79a7('0x1c'));var client=jayson[_0x79a7('0x1d')][_0x79a7('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x334b03,_0x1dc46b,_0x483608,_0x5b7d49){return new BPromise(function(_0x5bc0d8,_0x7b8a9b){var _0x234b74=_0x5b7d49||client;return _0x234b74['request'](_0x334b03,_0x483608)[_0x79a7('0x1f')](function(_0x3c3d83){logger[_0x79a7('0x20')]('ChatQueue,\x20%s,\x20%s',_0x1dc46b,'request\x20sent');logger[_0x79a7('0x21')](_0x79a7('0x22'),_0x1dc46b,'request\x20sent',JSON[_0x79a7('0x23')](_0x3c3d83));if(_0x3c3d83[_0x79a7('0x24')]){if(_0x3c3d83[_0x79a7('0x24')][_0x79a7('0x25')]===0x1f4){logger[_0x79a7('0x24')](_0x79a7('0x26'),_0x1dc46b,_0x3c3d83['error']['message']);return _0x7b8a9b(_0x3c3d83[_0x79a7('0x24')]['message']);}logger[_0x79a7('0x24')](_0x79a7('0x26'),_0x1dc46b,_0x3c3d83[_0x79a7('0x24')][_0x79a7('0x27')]);return _0x5bc0d8(_0x3c3d83[_0x79a7('0x24')][_0x79a7('0x27')]);}else{logger[_0x79a7('0x20')](_0x79a7('0x26'),_0x1dc46b,'request\x20sent');_0x5bc0d8(_0x3c3d83[_0x79a7('0x28')][_0x79a7('0x27')]);}})[_0x79a7('0x29')](function(_0x3dad54){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1dc46b,_0x3dad54);_0x7b8a9b(_0x3dad54);});});}function respondWithStatusCode(_0x33e46c,_0x25f99a){_0x25f99a=_0x25f99a||0xcc;return function(_0x5d0b07){if(_0x5d0b07){return _0x33e46c[_0x79a7('0x2a')](_0x25f99a);}return _0x33e46c[_0x79a7('0x2b')](_0x25f99a)[_0x79a7('0x2c')]();};}function respondWithResult(_0x339ec7,_0x7a7e93){_0x7a7e93=_0x7a7e93||0xc8;return function(_0x499903){if(_0x499903){return _0x339ec7[_0x79a7('0x2b')](_0x7a7e93)['json'](_0x499903);}};}function respondWithFilteredResult(_0x1feda0,_0x137390){return function(_0x96bce3){if(_0x96bce3){var _0x3caffc=typeof _0x137390[_0x79a7('0x2d')]===_0x79a7('0x2e')&&typeof _0x137390['limit']===_0x79a7('0x2e');var _0x3bc6c3=_0x96bce3[_0x79a7('0x2f')];var _0x33c105=_0x3caffc?0x0:_0x137390[_0x79a7('0x2d')];var _0x24fcf4=_0x3caffc?_0x96bce3[_0x79a7('0x2f')]:_0x137390[_0x79a7('0x2d')]+_0x137390['limit'];var _0x1ba0b5;if(_0x24fcf4>=_0x3bc6c3){_0x24fcf4=_0x3bc6c3;_0x1ba0b5=0xc8;}else{_0x1ba0b5=0xce;}_0x1feda0[_0x79a7('0x2b')](_0x1ba0b5);return _0x1feda0['set'](_0x79a7('0x30'),_0x33c105+'-'+_0x24fcf4+'/'+_0x3bc6c3)['json'](_0x96bce3);}return null;};}function patchUpdates(_0x12d4f4){return function(_0x3b9c1d){try{jsonpatch['apply'](_0x3b9c1d,_0x12d4f4,!![]);}catch(_0x2d57f1){return BPromise[_0x79a7('0x31')](_0x2d57f1);}return _0x3b9c1d[_0x79a7('0x32')]();};}function saveUpdates(_0x3ede67,_0x403a51){return function(_0x29b9ae){if(_0x29b9ae){return _0x29b9ae[_0x79a7('0x33')](_0x3ede67)[_0x79a7('0x1f')](function(_0x42572e){return _0x42572e;});}return null;};}function removeEntity(_0x5cca31,_0x30dcb5){return function(_0x40f4e4){if(_0x40f4e4){return _0x40f4e4[_0x79a7('0x34')]()[_0x79a7('0x1f')](function(){var _0x5e5f1e=_0x40f4e4['get']({'plain':!![]});var _0x475a34=_0x79a7('0x35');return db['UserProfileResource'][_0x79a7('0x34')]({'where':{'type':_0x475a34,'resourceId':_0x5e5f1e['id']}})['then'](function(){return _0x40f4e4;});})[_0x79a7('0x1f')](function(){_0x5cca31[_0x79a7('0x2b')](0xcc)[_0x79a7('0x2c')]();});}};}function handleEntityNotFound(_0x213750,_0x4bfd44){return function(_0x56b4ed){if(!_0x56b4ed){_0x213750[_0x79a7('0x2a')](0x194);}return _0x56b4ed;};}function handleError(_0x1e70af,_0x5c9497){_0x5c9497=_0x5c9497||0x1f4;return function(_0xa8e97){logger[_0x79a7('0x24')](_0xa8e97[_0x79a7('0x36')]);if(_0xa8e97[_0x79a7('0x37')]){delete _0xa8e97[_0x79a7('0x37')];}_0x1e70af['status'](_0x5c9497)[_0x79a7('0x38')](_0xa8e97);};}exports[_0x79a7('0x39')]=function(_0x520a1d,_0x1e9191){var _0x25e9f6={},_0x28a0f5={},_0x2627e8={'count':0x0,'rows':[]};var _0x45aa62=_[_0x79a7('0x3a')](db[_0x79a7('0x3b')][_0x79a7('0x3c')],function(_0x5f0691){return{'name':_0x5f0691['fieldName'],'type':_0x5f0691[_0x79a7('0x3d')][_0x79a7('0x3e')]};});_0x28a0f5[_0x79a7('0x3f')]=_[_0x79a7('0x3a')](_0x45aa62,_0x79a7('0x37'));_0x28a0f5[_0x79a7('0x40')]=_['keys'](_0x520a1d[_0x79a7('0x40')]);_0x28a0f5[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x28a0f5[_0x79a7('0x3f')],_0x28a0f5['query']);_0x25e9f6[_0x79a7('0x43')]=_['intersection'](_0x28a0f5[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x520a1d[_0x79a7('0x40')][_0x79a7('0x44')]));_0x25e9f6[_0x79a7('0x43')]=_0x25e9f6['attributes'][_0x79a7('0x45')]?_0x25e9f6['attributes']:_0x28a0f5[_0x79a7('0x3f')];if(!_0x520a1d[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0x25e9f6[_0x79a7('0x48')]=qs[_0x79a7('0x48')](_0x520a1d['query'][_0x79a7('0x48')]);_0x25e9f6[_0x79a7('0x2d')]=qs['offset'](_0x520a1d[_0x79a7('0x40')][_0x79a7('0x2d')]);}_0x25e9f6[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x520a1d['query'][_0x79a7('0x4a')]);_0x25e9f6[_0x79a7('0x4b')]=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x520a1d[_0x79a7('0x40')],_0x28a0f5[_0x79a7('0x41')]),_0x45aa62);if(_0x520a1d['query'][_0x79a7('0x4d')]){_0x25e9f6[_0x79a7('0x4b')]=_[_0x79a7('0x4e')](_0x25e9f6[_0x79a7('0x4b')],{'$or':_[_0x79a7('0x3a')](_0x45aa62,function(_0xead68d){if(_0xead68d['type']!==_0x79a7('0x4f')){var _0x2ccde2={};_0x2ccde2[_0xead68d[_0x79a7('0x37')]]={'$like':'%'+_0x520a1d[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0x2ccde2;}})});}_0x25e9f6=_[_0x79a7('0x4e')]({},_0x25e9f6,_0x520a1d[_0x79a7('0x50')]);var _0x3bb8f0={'where':_0x25e9f6['where']};return db[_0x79a7('0x3b')][_0x79a7('0x2f')](_0x3bb8f0)[_0x79a7('0x1f')](function(_0x495f2c){_0x2627e8['count']=_0x495f2c;if(_0x520a1d[_0x79a7('0x40')][_0x79a7('0x51')]){_0x25e9f6[_0x79a7('0x52')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x25e9f6);})[_0x79a7('0x1f')](function(_0x19eff4){_0x2627e8['rows']=_0x19eff4;return _0x2627e8;})[_0x79a7('0x1f')](respondWithFilteredResult(_0x1e9191,_0x25e9f6))[_0x79a7('0x29')](handleError(_0x1e9191,null));};exports['show']=function(_0x386444,_0x5ab165){var _0x26073d={'raw':!![],'where':{'id':_0x386444[_0x79a7('0x53')]['id']}},_0x37427c={};_0x37427c[_0x79a7('0x3f')]=_[_0x79a7('0x54')](db[_0x79a7('0x3b')][_0x79a7('0x3c')]);_0x37427c['query']=_[_0x79a7('0x54')](_0x386444['query']);_0x37427c[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x37427c[_0x79a7('0x3f')],_0x37427c[_0x79a7('0x40')]);_0x26073d[_0x79a7('0x43')]=_['intersection'](_0x37427c[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x386444[_0x79a7('0x40')][_0x79a7('0x44')]));_0x26073d[_0x79a7('0x43')]=_0x26073d['attributes'][_0x79a7('0x45')]?_0x26073d[_0x79a7('0x43')]:_0x37427c[_0x79a7('0x3f')];if(_0x386444[_0x79a7('0x40')][_0x79a7('0x51')]){_0x26073d['include']=[{'all':!![]}];}_0x26073d=_[_0x79a7('0x4e')]({},_0x26073d,_0x386444[_0x79a7('0x50')]);return db[_0x79a7('0x3b')]['find'](_0x26073d)[_0x79a7('0x1f')](handleEntityNotFound(_0x5ab165,null))[_0x79a7('0x1f')](respondWithResult(_0x5ab165,null))[_0x79a7('0x29')](handleError(_0x5ab165,null));};exports[_0x79a7('0x55')]=function(_0x48cf93,_0x3d5eca){return db[_0x79a7('0x3b')]['create'](_0x48cf93[_0x79a7('0x56')],{})[_0x79a7('0x1f')](function(_0x4c374d){var _0x4af522=_0x48cf93[_0x79a7('0x57')]['get']({'plain':!![]});if(!_0x4af522)throw new Error(_0x79a7('0x58'));if(_0x4af522[_0x79a7('0x59')]==='user'){var _0x27cb82=_0x4c374d[_0x79a7('0x5a')]({'plain':!![]});var _0x349e68=_0x79a7('0x35');return db[_0x79a7('0x5b')][_0x79a7('0x5c')]({'where':{'name':_0x349e68,'userProfileId':_0x4af522[_0x79a7('0x5d')]},'raw':!![]})[_0x79a7('0x1f')](function(_0x9127c2){if(_0x9127c2&&_0x9127c2[_0x79a7('0x5e')]===0x0){return db[_0x79a7('0x5f')]['create']({'name':_0x27cb82[_0x79a7('0x37')],'resourceId':_0x27cb82['id'],'type':_0x9127c2['name'],'sectionId':_0x9127c2['id']},{})[_0x79a7('0x1f')](function(){return _0x4c374d;});}else{return _0x4c374d;}})['catch'](function(_0x1677e2){logger['error'](_0x79a7('0x60'),_0x1677e2);throw _0x1677e2;});}return _0x4c374d;})[_0x79a7('0x1f')](respondWithResult(_0x3d5eca,0xc9))[_0x79a7('0x29')](handleError(_0x3d5eca,null));};exports['update']=function(_0xf6274d,_0x5e3fc3){if(_0xf6274d[_0x79a7('0x56')]['id']){delete _0xf6274d[_0x79a7('0x56')]['id'];}return db['ChatQueue'][_0x79a7('0x5c')]({'where':{'id':_0xf6274d[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x5e3fc3,null))[_0x79a7('0x1f')](saveUpdates(_0xf6274d[_0x79a7('0x56')],null))['then'](respondWithResult(_0x5e3fc3,null))['catch'](handleError(_0x5e3fc3,null));};exports['destroy']=function(_0x55de53,_0x178767){return db[_0x79a7('0x3b')]['find']({'where':{'id':_0x55de53[_0x79a7('0x53')]['id']}})['then'](handleEntityNotFound(_0x178767,null))[_0x79a7('0x1f')](removeEntity(_0x178767,null))['catch'](handleError(_0x178767,null));};exports[_0x79a7('0x61')]=function(_0x244bac,_0x43092f){return db[_0x79a7('0x3b')][_0x79a7('0x61')]()[_0x79a7('0x1f')](respondWithResult(_0x43092f,null))[_0x79a7('0x29')](handleError(_0x43092f,null));};exports[_0x79a7('0x62')]=function(_0x422cf1,_0x3a3539,_0x510d8f){var _0x57520b={'raw':!![],'where':{}},_0x1d434f={},_0x1efc9c;return db[_0x79a7('0x3b')]['findOne']({'where':{'id':_0x422cf1[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x3a3539,null))[_0x79a7('0x1f')](function(_0x2410f5){if(_0x2410f5){_0x1efc9c=_0x2410f5[_0x79a7('0x5a')]({'plain':!![]});_0x1d434f[_0x79a7('0x3f')]=_['keys'](db[_0x79a7('0x63')][_0x79a7('0x3c')]);_0x1d434f[_0x79a7('0x40')]=_['keys'](_0x422cf1[_0x79a7('0x40')]);_0x1d434f[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x1d434f[_0x79a7('0x3f')],_0x1d434f[_0x79a7('0x40')]);_0x57520b['attributes']=_[_0x79a7('0x42')](_0x1d434f[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x422cf1[_0x79a7('0x40')][_0x79a7('0x44')]));_0x57520b[_0x79a7('0x43')]=_0x57520b[_0x79a7('0x43')][_0x79a7('0x45')]?_0x57520b['attributes']:_0x1d434f[_0x79a7('0x3f')];if(!_0x422cf1[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0x57520b['limit']=qs['limit'](_0x422cf1[_0x79a7('0x40')][_0x79a7('0x48')]);_0x57520b[_0x79a7('0x2d')]=qs[_0x79a7('0x2d')](_0x422cf1[_0x79a7('0x40')][_0x79a7('0x2d')]);}_0x57520b[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x422cf1[_0x79a7('0x40')]['sort']);_0x57520b['where']=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x422cf1[_0x79a7('0x40')],_0x1d434f['filters']));_0x57520b[_0x79a7('0x4b')][_0x79a7('0x64')]=_0x2410f5['id'];if(_0x422cf1['query'][_0x79a7('0x4d')]){_0x57520b[_0x79a7('0x4b')]=_[_0x79a7('0x4e')](_0x57520b[_0x79a7('0x4b')],{'$or':_['map'](_0x57520b[_0x79a7('0x43')],function(_0x38ec28){var _0xec452={};_0xec452[_0x38ec28]={'$like':'%'+_0x422cf1[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0xec452;})});}_0x57520b=_[_0x79a7('0x4e')]({},_0x57520b,_0x422cf1[_0x79a7('0x50')]);return db[_0x79a7('0x63')][_0x79a7('0x65')](_0x57520b);}})[_0x79a7('0x1f')](function(_0x1308a6){if(_0x1308a6){return db['User'][_0x79a7('0x66')]({'where':{'id':_[_0x79a7('0x3a')](_0x1308a6,_0x79a7('0x67')),'role':_0x79a7('0x68')},'attributes':['id',_0x79a7('0x37'),'chatPause',_0x79a7('0x69'),_0x79a7('0x6a')]});}})['then'](function(_0xf3d34f){if(_0xf3d34f){return{'count':_0xf3d34f[_0x79a7('0x2f')],'rows':_[_0x79a7('0x3a')](_0xf3d34f[_0x79a7('0x6b')],function(_0x33e184){return{'membername':_0x33e184['name'],'UserId':_0x33e184['id'],'queue_name':_0x1efc9c[_0x79a7('0x37')],'ChatQueueId':_0x1efc9c['id'],'interface':util[_0x79a7('0x6c')](_0x79a7('0x6d'),_0x79a7('0x6e'),_0x33e184['name']),'penalty':0x0,'paused':_0x33e184['chatPause'],'createdAt':_0x33e184[_0x79a7('0x6a')],'updatedAt':_0x33e184['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x79a7('0x1f')](respondWithFilteredResult(_0x3a3539,_0x57520b))['catch'](handleError(_0x3a3539,null));};exports[_0x79a7('0x6f')]=function(_0x58c1f4,_0x3a3c7a,_0x637184){var _0xaa6c39={};var _0x217191={};var _0x51edfa;var _0x2bb810;return db[_0x79a7('0x3b')]['findOne']({'where':{'id':_0x58c1f4[_0x79a7('0x53')]['id']}})['then'](handleEntityNotFound(_0x3a3c7a,null))['then'](function(_0x18c797){if(_0x18c797){_0x51edfa=_0x18c797;_0x217191[_0x79a7('0x3f')]=_[_0x79a7('0x54')](db['Team'][_0x79a7('0x3c')]);_0x217191[_0x79a7('0x40')]=_[_0x79a7('0x54')](_0x58c1f4[_0x79a7('0x40')]);_0x217191[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x217191[_0x79a7('0x3f')],_0x217191[_0x79a7('0x40')]);_0xaa6c39['attributes']=_[_0x79a7('0x42')](_0x217191[_0x79a7('0x3f')],qs['fields'](_0x58c1f4[_0x79a7('0x40')]['fields']));_0xaa6c39[_0x79a7('0x43')]=_0xaa6c39[_0x79a7('0x43')]['length']?_0xaa6c39[_0x79a7('0x43')]:_0x217191[_0x79a7('0x3f')];_0xaa6c39[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x4a')]);_0xaa6c39[_0x79a7('0x4b')]=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x58c1f4[_0x79a7('0x40')],_0x217191['filters']));if(_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x4d')]){_0xaa6c39['where']=_['merge'](_0xaa6c39[_0x79a7('0x4b')],{'$or':_['map'](_0xaa6c39[_0x79a7('0x43')],function(_0x4dfc3d){var _0x1b56de={};_0x1b56de[_0x4dfc3d]={'$like':'%'+_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0x1b56de;})});}_0xaa6c39=_[_0x79a7('0x4e')]({},_0xaa6c39,_0x58c1f4[_0x79a7('0x50')]);return _0x51edfa['getTeams'](_0xaa6c39);}})[_0x79a7('0x1f')](function(_0x10ee98){if(_0x10ee98){_0x2bb810=_0x10ee98['length'];if(!_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0xaa6c39[_0x79a7('0x48')]=qs[_0x79a7('0x48')](_0x58c1f4['query'][_0x79a7('0x48')]);_0xaa6c39['offset']=qs[_0x79a7('0x2d')](_0x58c1f4[_0x79a7('0x40')][_0x79a7('0x2d')]);}return _0x51edfa[_0x79a7('0x6f')](_0xaa6c39);}})[_0x79a7('0x1f')](function(_0x58b4e7){if(_0x58b4e7){return _0x58b4e7?{'count':_0x2bb810,'rows':_0x58b4e7}:null;}})[_0x79a7('0x1f')](respondWithResult(_0x3a3c7a,null))['catch'](handleError(_0x3a3c7a,null));};exports['addTeams']=function(_0x1a7a56,_0x259894,_0x295b0e){var _0x962064=_0x1a7a56['body'][_0x79a7('0x70')];return db[_0x79a7('0x71')][_0x79a7('0x65')]({'where':{'id':_0x962064},'attributes':['id'],'include':[{'model':db[_0x79a7('0x72')],'as':'Agents','attributes':['id','name',_0x79a7('0x73'),'voicePause',_0x79a7('0x74')],'raw':!![]}]})[_0x79a7('0x1f')](function(_0x413605){if(_0x413605){var _0x24f21c=_[_0x79a7('0x75')](_0x413605,function(_0x2f2bbd){var _0x5a3595=_0x2f2bbd[_0x79a7('0x5a')]({'plain':!![]});return _0x5a3595['Agents'];});return db[_0x79a7('0x3b')]['find']({'where':{'id':_0x1a7a56['params']['id']}})[_0x79a7('0x1f')](function(_0x43a458){return db[_0x79a7('0x76')][_0x79a7('0x77')](function(_0x5b6132){return _0x43a458[_0x79a7('0x78')](_0x962064,{'transaction':_0x5b6132})[_0x79a7('0x1f')](function(){return BPromise['each'](_0x24f21c,function(_0x19dc33){return db[_0x79a7('0x63')][_0x79a7('0x79')]({'where':{'UserId':_0x19dc33['id'],'ChatQueueId':_0x1a7a56[_0x79a7('0x53')]['id']},'transaction':_0x5b6132});});})[_0x79a7('0x1f')](function(){_0x24f21c[_0x79a7('0x7a')](function(_0x5bf1d1){socket[_0x79a7('0x7b')](_0x79a7('0x7c'),{'UserId':_0x5bf1d1['id'],'ChatQueueId':_0x43a458['id']});});});});});}})[_0x79a7('0x1f')](respondWithStatusCode(_0x259894,null))['catch'](handleError(_0x259894,null));};exports[_0x79a7('0x7d')]=function(_0x290fb5,_0x1f2dd1,_0x2fdb28){return db[_0x79a7('0x71')][_0x79a7('0x65')]({'where':{'id':_0x290fb5[_0x79a7('0x40')][_0x79a7('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1f2dd1,null))[_0x79a7('0x1f')](function(_0x1ff65a){var _0x4e7210=_['map'](_0x1ff65a,'id');var _0x9454be=[];var _0x1a6866=[];var _0x532c2d=squel[_0x79a7('0x7e')]();_0x532c2d[_0x79a7('0x7f')](_0x79a7('0x80'))['from'](_0x79a7('0x81'),'tq')[_0x79a7('0x82')](_0x79a7('0x83'),'ut',_0x79a7('0x84'))[_0x79a7('0x4b')](_0x79a7('0x85'),_0x290fb5[_0x79a7('0x53')]['id']);for(var _0x2457da=0x0;_0x2457da<_0x1ff65a[_0x79a7('0x45')];_0x2457da+=0x1){let _0x3d2b64=_0x1ff65a[_0x2457da];for(var _0x687281=0x0;_0x687281<_0x3d2b64['Agents'][_0x79a7('0x45')];_0x687281+=0x1){let _0x2c2a1a=_0x3d2b64[_0x79a7('0x86')][_0x687281];var _0x566507=_0x532c2d['clone']();_0x566507[_0x79a7('0x4b')]('ut.UserId\x20=\x20?',_0x2c2a1a['id']);_0x1a6866['push'](db[_0x79a7('0x76')]['query'](_0x566507[_0x79a7('0x87')](),{'type':db['sequelize'][_0x79a7('0x88')][_0x79a7('0x89')]})[_0x79a7('0x1f')](function(_0x3582d4){if(_0x3582d4[_0x79a7('0x45')]===0x1){return _0x2c2a1a['id'];}else{var _0x228b23=_[_0x79a7('0x8a')](_[_0x79a7('0x3a')](_0x3582d4,_0x79a7('0x8b')),function(_0x419b1a){return _[_0x79a7('0x8c')](_0x4e7210,_0x419b1a);});if(_0x228b23){return _0x2c2a1a['id'];}}}));}}return BPromise[_0x79a7('0x8d')](_0x1a6866)[_0x79a7('0x1f')](function(_0x5348ae){_0x9454be=_(_0x9454be)['union'](_0x5348ae)[_0x79a7('0x8e')]()[_0x79a7('0x8f')]();return db[_0x79a7('0x3b')]['find']({'where':{'id':_0x290fb5['params']['id']}})[_0x79a7('0x1f')](function(_0x2d7efd){return db[_0x79a7('0x76')][_0x79a7('0x77')](function(_0x208de6){return _0x2d7efd[_0x79a7('0x7d')](_0x290fb5[_0x79a7('0x40')]['ids'],{'transaction':_0x208de6})[_0x79a7('0x1f')](function(){if(!_[_0x79a7('0x90')](_0x9454be)){return _0x2d7efd[_0x79a7('0x91')](_0x9454be,{'transaction':_0x208de6});}})[_0x79a7('0x1f')](function(){_0x9454be['forEach'](function(_0x3f5630){socket['emit'](_0x79a7('0x92'),{'UserId':_0x3f5630,'ChatQueueId':_0x2d7efd['id']});});});});});});})[_0x79a7('0x1f')](respondWithStatusCode(_0x1f2dd1,null))[_0x79a7('0x29')](handleError(_0x1f2dd1,null));};exports['addAgents']=function(_0x541315,_0x4d9957,_0x29b1b7){return db[_0x79a7('0x3b')][_0x79a7('0x5c')]({'where':{'id':_0x541315[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x4d9957,null))[_0x79a7('0x1f')](function(_0x33218a){if(_0x33218a){return _0x33218a[_0x79a7('0x93')](_0x541315[_0x79a7('0x56')][_0x79a7('0x70')],_[_0x79a7('0x94')](_0x541315[_0x79a7('0x56')],[_0x79a7('0x70'),'id'])||{})['spread'](function(_0x506bc0){for(var _0x40ec57=0x0;_0x40ec57<_0x541315[_0x79a7('0x56')][_0x79a7('0x70')][_0x79a7('0x45')];_0x40ec57+=0x1){socket[_0x79a7('0x7b')](_0x79a7('0x7c'),{'UserId':Number(_0x541315[_0x79a7('0x56')][_0x79a7('0x70')][_0x40ec57]),'ChatQueueId':Number(_0x541315[_0x79a7('0x53')]['id'])});}return _0x506bc0;});}})[_0x79a7('0x1f')](respondWithResult(_0x4d9957,null))[_0x79a7('0x29')](handleError(_0x4d9957,null));};exports[_0x79a7('0x91')]=function(_0x1f23f6,_0x44e524,_0x55ba86){return db['ChatQueue'][_0x79a7('0x5c')]({'where':{'id':_0x1f23f6[_0x79a7('0x53')]['id']}})[_0x79a7('0x1f')](handleEntityNotFound(_0x44e524,null))['then'](function(_0xea0706){if(_0xea0706){return _0xea0706[_0x79a7('0x91')](_0x1f23f6[_0x79a7('0x40')]['ids'])[_0x79a7('0x1f')](function(){if(_['isArray'](_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')])){for(var _0xaab382=0x0;_0xaab382<_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')]['length'];_0xaab382+=0x1){socket[_0x79a7('0x7b')](_0x79a7('0x92'),{'UserId':Number(_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')][_0xaab382]),'ChatQueueId':Number(_0x1f23f6[_0x79a7('0x53')]['id'])});}}else{socket[_0x79a7('0x7b')](_0x79a7('0x92'),{'UserId':Number(_0x1f23f6[_0x79a7('0x40')][_0x79a7('0x70')]),'ChatQueueId':Number(_0x1f23f6[_0x79a7('0x53')]['id'])});}});}})[_0x79a7('0x1f')](respondWithStatusCode(_0x44e524,null))[_0x79a7('0x29')](handleError(_0x44e524,null));};exports[_0x79a7('0x95')]=function(_0x21b1eb,_0x528064,_0x49dff7){var _0x5c2398={};var _0x74542c={};var _0xf007d7;var _0x3ceb02;return db[_0x79a7('0x3b')][_0x79a7('0x96')]({'where':{'id':_0x21b1eb[_0x79a7('0x53')]['id']}})['then'](handleEntityNotFound(_0x528064,null))[_0x79a7('0x1f')](function(_0x361b7a){if(_0x361b7a){_0xf007d7=_0x361b7a;_0x74542c[_0x79a7('0x3f')]=_['keys'](db[_0x79a7('0x72')][_0x79a7('0x3c')]);_0x74542c[_0x79a7('0x40')]=_[_0x79a7('0x54')](_0x21b1eb['query']);_0x74542c[_0x79a7('0x41')]=_[_0x79a7('0x42')](_0x74542c[_0x79a7('0x3f')],_0x74542c[_0x79a7('0x40')]);_0x5c2398['attributes']=_[_0x79a7('0x42')](_0x74542c[_0x79a7('0x3f')],qs[_0x79a7('0x44')](_0x21b1eb['query'][_0x79a7('0x44')]));_0x5c2398[_0x79a7('0x43')]=_0x5c2398['attributes'][_0x79a7('0x45')]?_0x5c2398[_0x79a7('0x43')]:_0x74542c[_0x79a7('0x3f')];_0x5c2398[_0x79a7('0x49')]=qs[_0x79a7('0x4a')](_0x21b1eb[_0x79a7('0x40')]['sort']);_0x5c2398[_0x79a7('0x4b')]=qs[_0x79a7('0x41')](_[_0x79a7('0x4c')](_0x21b1eb[_0x79a7('0x40')],_0x74542c['filters']));if(_0x21b1eb['query'][_0x79a7('0x4d')]){_0x5c2398['where']=_[_0x79a7('0x4e')](_0x5c2398[_0x79a7('0x4b')],{'$or':_['map'](_0x5c2398[_0x79a7('0x43')],function(_0x328ab8){var _0x1d3b0c={};_0x1d3b0c[_0x328ab8]={'$like':'%'+_0x21b1eb[_0x79a7('0x40')][_0x79a7('0x4d')]+'%'};return _0x1d3b0c;})});}_0x5c2398=_[_0x79a7('0x4e')]({},_0x5c2398,_0x21b1eb[_0x79a7('0x50')]);return _0xf007d7['getAgents'](_0x5c2398);}})[_0x79a7('0x1f')](function(_0x318c57){if(_0x318c57){_0x3ceb02=_0x318c57[_0x79a7('0x45')];if(!_0x21b1eb[_0x79a7('0x40')][_0x79a7('0x46')](_0x79a7('0x47'))){_0x5c2398[_0x79a7('0x48')]=qs[_0x79a7('0x48')](_0x21b1eb['query'][_0x79a7('0x48')]);_0x5c2398[_0x79a7('0x2d')]=qs[_0x79a7('0x2d')](_0x21b1eb[_0x79a7('0x40')][_0x79a7('0x2d')]);}return _0xf007d7[_0x79a7('0x95')](_0x5c2398);}})['then'](function(_0x3c2014){if(_0x3c2014){return _0x3c2014?{'count':_0x3ceb02,'rows':_0x3c2014}:null;}})[_0x79a7('0x1f')](respondWithResult(_0x528064,null))['catch'](handleError(_0x528064,null));}; \ No newline at end of file +var _0xee40=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','sendStatus','end','status','json','undefined','limit','offset','set','Content-Range','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','nolimit','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','pick','addTeams','ids','Agents','online','interface','transaction','each','UserChatQueue','findOrCreate','forEach','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xee40,0x85));var _0x0ee4=function(_0x20fe76,_0x1caa47){_0x20fe76=_0x20fe76-0x0;var _0x446f73=_0xee40[_0x20fe76];return _0x446f73;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0ee4('0x0'));var jsonpatch=require(_0x0ee4('0x1'));var rp=require(_0x0ee4('0x2'));var moment=require('moment');var BPromise=require(_0x0ee4('0x3'));var Mustache=require(_0x0ee4('0x4'));var util=require(_0x0ee4('0x5'));var path=require(_0x0ee4('0x6'));var sox=require('sox');var csv=require(_0x0ee4('0x7'));var ejs=require(_0x0ee4('0x8'));var fs=require('fs');var fs_extra=require(_0x0ee4('0x9'));var _=require(_0x0ee4('0xa'));var squel=require(_0x0ee4('0xb'));var crypto=require(_0x0ee4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ee4('0x7'));var querystring=require(_0x0ee4('0xd'));var Papa=require(_0x0ee4('0xe'));var Redis=require(_0x0ee4('0xf'));var authService=require(_0x0ee4('0x10'));var qs=require(_0x0ee4('0x11'));var as=require(_0x0ee4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee4('0x13'))(_0x0ee4('0x14'));var utils=require(_0x0ee4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0ee4('0x16'));var db=require(_0x0ee4('0x17'))['db'];config[_0x0ee4('0x18')]=_['defaults'](config['redis'],{'host':_0x0ee4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ee4('0x18')]));require(_0x0ee4('0x1a'))[_0x0ee4('0x1b')](socket);var jayson=require(_0x0ee4('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34f82e,_0x5754fb,_0x5db41f,_0x4bc02d){return new BPromise(function(_0x1c0ba5,_0x4de31e){var _0x41bfee=_0x4bc02d||client;return _0x41bfee[_0x0ee4('0x1d')](_0x34f82e,_0x5db41f)[_0x0ee4('0x1e')](function(_0x3e04ce){logger[_0x0ee4('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x0ee4('0x20'));logger[_0x0ee4('0x21')](_0x0ee4('0x22'),_0x5754fb,_0x0ee4('0x20'),JSON[_0x0ee4('0x23')](_0x3e04ce));if(_0x3e04ce[_0x0ee4('0x24')]){if(_0x3e04ce[_0x0ee4('0x24')]['code']===0x1f4){logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x4de31e(_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);}logger[_0x0ee4('0x24')]('ChatQueue,\x20%s,\x20%s',_0x5754fb,_0x3e04ce[_0x0ee4('0x24')][_0x0ee4('0x25')]);return _0x1c0ba5(_0x3e04ce[_0x0ee4('0x24')]['message']);}else{logger[_0x0ee4('0x1f')](_0x0ee4('0x26'),_0x5754fb,'request\x20sent');_0x1c0ba5(_0x3e04ce['result'][_0x0ee4('0x25')]);}})['catch'](function(_0x176baf){logger[_0x0ee4('0x24')](_0x0ee4('0x26'),_0x5754fb,_0x176baf);_0x4de31e(_0x176baf);});});}function respondWithStatusCode(_0x3c00a7,_0x47383d){_0x47383d=_0x47383d||0xcc;return function(_0x318081){if(_0x318081){return _0x3c00a7[_0x0ee4('0x27')](_0x47383d);}return _0x3c00a7['status'](_0x47383d)[_0x0ee4('0x28')]();};}function respondWithResult(_0x2a8ff6,_0x146701){_0x146701=_0x146701||0xc8;return function(_0x35dbe8){if(_0x35dbe8){return _0x2a8ff6[_0x0ee4('0x29')](_0x146701)[_0x0ee4('0x2a')](_0x35dbe8);}};}function respondWithFilteredResult(_0x71541d,_0x1d4400){return function(_0x12409a){if(_0x12409a){var _0x16da09=typeof _0x1d4400['offset']===_0x0ee4('0x2b')&&typeof _0x1d4400[_0x0ee4('0x2c')]===_0x0ee4('0x2b');var _0x3c585c=_0x12409a['count'];var _0x3b515a=_0x16da09?0x0:_0x1d4400[_0x0ee4('0x2d')];var _0x2b205e=_0x16da09?_0x12409a['count']:_0x1d4400[_0x0ee4('0x2d')]+_0x1d4400[_0x0ee4('0x2c')];var _0x53efda;if(_0x2b205e>=_0x3c585c){_0x2b205e=_0x3c585c;_0x53efda=0xc8;}else{_0x53efda=0xce;}_0x71541d[_0x0ee4('0x29')](_0x53efda);return _0x71541d[_0x0ee4('0x2e')](_0x0ee4('0x2f'),_0x3b515a+'-'+_0x2b205e+'/'+_0x3c585c)[_0x0ee4('0x2a')](_0x12409a);}return null;};}function patchUpdates(_0x4798eb){return function(_0x1bf252){try{jsonpatch['apply'](_0x1bf252,_0x4798eb,!![]);}catch(_0x2cf156){return BPromise[_0x0ee4('0x30')](_0x2cf156);}return _0x1bf252['save']();};}function saveUpdates(_0x4bd549,_0x21ddc5){return function(_0x3d7759){if(_0x3d7759){return _0x3d7759[_0x0ee4('0x31')](_0x4bd549)['then'](function(_0x41bc7b){return _0x41bc7b;});}return null;};}function removeEntity(_0x57eac4,_0x2e33a7){return function(_0x4a047f){if(_0x4a047f){return _0x4a047f[_0x0ee4('0x32')]()[_0x0ee4('0x1e')](function(){var _0xb26e32=_0x4a047f[_0x0ee4('0x33')]({'plain':!![]});var _0x100784=_0x0ee4('0x34');return db[_0x0ee4('0x35')]['destroy']({'where':{'type':_0x100784,'resourceId':_0xb26e32['id']}})['then'](function(){return _0x4a047f;});})[_0x0ee4('0x1e')](function(){_0x57eac4[_0x0ee4('0x29')](0xcc)[_0x0ee4('0x28')]();});}};}function handleEntityNotFound(_0x44dd60,_0x1e27df){return function(_0x40d7c2){if(!_0x40d7c2){_0x44dd60['sendStatus'](0x194);}return _0x40d7c2;};}function handleError(_0x2998d7,_0x2e2a13){_0x2e2a13=_0x2e2a13||0x1f4;return function(_0x4f8f15){logger['error'](_0x4f8f15['stack']);if(_0x4f8f15[_0x0ee4('0x36')]){delete _0x4f8f15['name'];}_0x2998d7[_0x0ee4('0x29')](_0x2e2a13)[_0x0ee4('0x37')](_0x4f8f15);};}exports[_0x0ee4('0x38')]=function(_0xb48cf9,_0x38e8c2){var _0x355eec={},_0x454e11={},_0x4bf1ee={'count':0x0,'rows':[]};var _0x346c98=_[_0x0ee4('0x39')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')],function(_0x46c6e4){return{'name':_0x46c6e4['fieldName'],'type':_0x46c6e4['type'][_0x0ee4('0x3c')]};});_0x454e11[_0x0ee4('0x3d')]=_[_0x0ee4('0x39')](_0x346c98,_0x0ee4('0x36'));_0x454e11[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0xb48cf9['query']);_0x454e11['filters']=_[_0x0ee4('0x40')](_0x454e11['model'],_0x454e11[_0x0ee4('0x3e')]);_0x355eec[_0x0ee4('0x41')]=_['intersection'](_0x454e11[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0xb48cf9['query'][_0x0ee4('0x42')]));_0x355eec['attributes']=_0x355eec['attributes']['length']?_0x355eec['attributes']:_0x454e11[_0x0ee4('0x3d')];if(!_0xb48cf9['query'][_0x0ee4('0x43')]('nolimit')){_0x355eec[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0xb48cf9[_0x0ee4('0x3e')]['limit']);_0x355eec[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x355eec[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0xb48cf9['query'][_0x0ee4('0x45')]);_0x355eec[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_['pick'](_0xb48cf9[_0x0ee4('0x3e')],_0x454e11[_0x0ee4('0x47')]),_0x346c98);if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x355eec[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x355eec[_0x0ee4('0x46')],{'$or':_['map'](_0x346c98,function(_0x5ea9cb){if(_0x5ea9cb[_0x0ee4('0x4a')]!==_0x0ee4('0x4b')){var _0x9f3566={};_0x9f3566[_0x5ea9cb[_0x0ee4('0x36')]]={'$like':'%'+_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x9f3566;}})});}_0x355eec=_[_0x0ee4('0x49')]({},_0x355eec,_0xb48cf9[_0x0ee4('0x4c')]);var _0x52dd8e={'where':_0x355eec[_0x0ee4('0x46')]};return db['ChatQueue'][_0x0ee4('0x4d')](_0x52dd8e)['then'](function(_0x52e070){_0x4bf1ee[_0x0ee4('0x4d')]=_0x52e070;if(_0xb48cf9[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x355eec[_0x0ee4('0x4f')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x355eec);})[_0x0ee4('0x1e')](function(_0x2bf9f0){_0x4bf1ee[_0x0ee4('0x50')]=_0x2bf9f0;return _0x4bf1ee;})['then'](respondWithFilteredResult(_0x38e8c2,_0x355eec))[_0x0ee4('0x51')](handleError(_0x38e8c2,null));};exports[_0x0ee4('0x52')]=function(_0x1f4b32,_0x3d81a5){var _0x5520d3={'raw':!![],'where':{'id':_0x1f4b32[_0x0ee4('0x53')]['id']}},_0x333bea={};_0x333bea[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db[_0x0ee4('0x3a')][_0x0ee4('0x3b')]);_0x333bea[_0x0ee4('0x3e')]=_[_0x0ee4('0x3f')](_0x1f4b32[_0x0ee4('0x3e')]);_0x333bea['filters']=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],_0x333bea[_0x0ee4('0x3e')]);_0x5520d3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x333bea[_0x0ee4('0x3d')],qs['fields'](_0x1f4b32['query'][_0x0ee4('0x42')]));_0x5520d3[_0x0ee4('0x41')]=_0x5520d3['attributes'][_0x0ee4('0x54')]?_0x5520d3[_0x0ee4('0x41')]:_0x333bea[_0x0ee4('0x3d')];if(_0x1f4b32[_0x0ee4('0x3e')][_0x0ee4('0x4e')]){_0x5520d3[_0x0ee4('0x4f')]=[{'all':!![]}];}_0x5520d3=_[_0x0ee4('0x49')]({},_0x5520d3,_0x1f4b32[_0x0ee4('0x4c')]);return db[_0x0ee4('0x3a')][_0x0ee4('0x55')](_0x5520d3)['then'](handleEntityNotFound(_0x3d81a5,null))['then'](respondWithResult(_0x3d81a5,null))[_0x0ee4('0x51')](handleError(_0x3d81a5,null));};exports[_0x0ee4('0x56')]=function(_0x1a4d39,_0x459850){return db[_0x0ee4('0x3a')][_0x0ee4('0x56')](_0x1a4d39['body'],{})['then'](function(_0x3529ed){var _0x53968c=_0x1a4d39[_0x0ee4('0x57')][_0x0ee4('0x33')]({'plain':!![]});if(!_0x53968c)throw new Error(_0x0ee4('0x58'));if(_0x53968c[_0x0ee4('0x59')]===_0x0ee4('0x57')){var _0x1b53ba=_0x3529ed[_0x0ee4('0x33')]({'plain':!![]});var _0x338a17=_0x0ee4('0x34');return db[_0x0ee4('0x5a')]['find']({'where':{'name':_0x338a17,'userProfileId':_0x53968c[_0x0ee4('0x5b')]},'raw':!![]})[_0x0ee4('0x1e')](function(_0x4df7b1){if(_0x4df7b1&&_0x4df7b1['autoAssociation']===0x0){return db[_0x0ee4('0x35')][_0x0ee4('0x56')]({'name':_0x1b53ba[_0x0ee4('0x36')],'resourceId':_0x1b53ba['id'],'type':_0x4df7b1[_0x0ee4('0x36')],'sectionId':_0x4df7b1['id']},{})['then'](function(){return _0x3529ed;});}else{return _0x3529ed;}})[_0x0ee4('0x51')](function(_0x4c90c3){logger[_0x0ee4('0x24')](_0x0ee4('0x5c'),_0x4c90c3);throw _0x4c90c3;});}return _0x3529ed;})['then'](respondWithResult(_0x459850,0xc9))['catch'](handleError(_0x459850,null));};exports[_0x0ee4('0x31')]=function(_0x34c341,_0x53612f){if(_0x34c341[_0x0ee4('0x5d')]['id']){delete _0x34c341[_0x0ee4('0x5d')]['id'];}return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x34c341[_0x0ee4('0x53')]['id']}})['then'](handleEntityNotFound(_0x53612f,null))[_0x0ee4('0x1e')](saveUpdates(_0x34c341[_0x0ee4('0x5d')],null))[_0x0ee4('0x1e')](respondWithResult(_0x53612f,null))['catch'](handleError(_0x53612f,null));};exports['destroy']=function(_0x2a8503,_0x264da4){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x2a8503[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x264da4,null))[_0x0ee4('0x1e')](removeEntity(_0x264da4,null))['catch'](handleError(_0x264da4,null));};exports[_0x0ee4('0x5e')]=function(_0x21b026,_0x151142){return db[_0x0ee4('0x3a')][_0x0ee4('0x5e')]()[_0x0ee4('0x1e')](respondWithResult(_0x151142,null))[_0x0ee4('0x51')](handleError(_0x151142,null));};exports['getMembers']=function(_0x59d16f,_0x1d39cd,_0xe9e1c5){var _0x2fd9e3={'raw':!![],'where':{}},_0x378740={},_0x272901;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x59d16f['params']['id']}})['then'](handleEntityNotFound(_0x1d39cd,null))[_0x0ee4('0x1e')](function(_0x4ab152){if(_0x4ab152){_0x272901=_0x4ab152[_0x0ee4('0x33')]({'plain':!![]});_0x378740[_0x0ee4('0x3d')]=_[_0x0ee4('0x3f')](db['UserChatQueue'][_0x0ee4('0x3b')]);_0x378740['query']=_[_0x0ee4('0x3f')](_0x59d16f[_0x0ee4('0x3e')]);_0x378740['filters']=_[_0x0ee4('0x40')](_0x378740[_0x0ee4('0x3d')],_0x378740[_0x0ee4('0x3e')]);_0x2fd9e3[_0x0ee4('0x41')]=_[_0x0ee4('0x40')](_0x378740['model'],qs[_0x0ee4('0x42')](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x2fd9e3[_0x0ee4('0x41')]=_0x2fd9e3['attributes'][_0x0ee4('0x54')]?_0x2fd9e3[_0x0ee4('0x41')]:_0x378740[_0x0ee4('0x3d')];if(!_0x59d16f['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x2fd9e3[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x59d16f['query'][_0x0ee4('0x2c')]);_0x2fd9e3[_0x0ee4('0x2d')]=qs['offset'](_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}_0x2fd9e3[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x59d16f['query']['sort']);_0x2fd9e3[_0x0ee4('0x46')]=qs['filters'](_['pick'](_0x59d16f[_0x0ee4('0x3e')],_0x378740['filters']));_0x2fd9e3[_0x0ee4('0x46')][_0x0ee4('0x61')]=_0x4ab152['id'];if(_0x59d16f[_0x0ee4('0x3e')]['filter']){_0x2fd9e3[_0x0ee4('0x46')]=_[_0x0ee4('0x49')](_0x2fd9e3['where'],{'$or':_['map'](_0x2fd9e3[_0x0ee4('0x41')],function(_0x4fed59){var _0x1fa481={};_0x1fa481[_0x4fed59]={'$like':'%'+_0x59d16f[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x1fa481;})});}_0x2fd9e3=_[_0x0ee4('0x49')]({},_0x2fd9e3,_0x59d16f['options']);return db['UserChatQueue'][_0x0ee4('0x62')](_0x2fd9e3);}})['then'](function(_0x6e6259){if(_0x6e6259){return db[_0x0ee4('0x63')][_0x0ee4('0x64')]({'where':{'id':_['map'](_0x6e6259,_0x0ee4('0x65')),'role':_0x0ee4('0x66')},'attributes':['id',_0x0ee4('0x36'),_0x0ee4('0x67'),_0x0ee4('0x68'),_0x0ee4('0x69')]});}})[_0x0ee4('0x1e')](function(_0x205462){if(_0x205462){return{'count':_0x205462[_0x0ee4('0x4d')],'rows':_['map'](_0x205462['rows'],function(_0x3ed2fe){return{'membername':_0x3ed2fe[_0x0ee4('0x36')],'UserId':_0x3ed2fe['id'],'queue_name':_0x272901[_0x0ee4('0x36')],'ChatQueueId':_0x272901['id'],'interface':util['format']('%s/%s',_0x0ee4('0x6a'),_0x3ed2fe[_0x0ee4('0x36')]),'penalty':0x0,'paused':_0x3ed2fe[_0x0ee4('0x67')],'createdAt':_0x3ed2fe['createdAt'],'updatedAt':_0x3ed2fe[_0x0ee4('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ee4('0x1e')](respondWithFilteredResult(_0x1d39cd,_0x2fd9e3))[_0x0ee4('0x51')](handleError(_0x1d39cd,null));};exports[_0x0ee4('0x6b')]=function(_0x237456,_0x28aefb,_0x1f60f7){var _0x791468={};var _0x454d28={};var _0x568b6a;var _0x3ae5be;return db['ChatQueue']['findOne']({'where':{'id':_0x237456[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x28aefb,null))[_0x0ee4('0x1e')](function(_0x1b748f){if(_0x1b748f){_0x568b6a=_0x1b748f;_0x454d28['model']=_[_0x0ee4('0x3f')](db['Team'][_0x0ee4('0x3b')]);_0x454d28[_0x0ee4('0x3e')]=_['keys'](_0x237456[_0x0ee4('0x3e')]);_0x454d28[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x454d28[_0x0ee4('0x3d')],_0x454d28[_0x0ee4('0x3e')]);_0x791468['attributes']=_['intersection'](_0x454d28[_0x0ee4('0x3d')],qs[_0x0ee4('0x42')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x42')]));_0x791468['attributes']=_0x791468[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x791468[_0x0ee4('0x41')]:_0x454d28[_0x0ee4('0x3d')];_0x791468[_0x0ee4('0x44')]=qs['sort'](_0x237456['query'][_0x0ee4('0x45')]);_0x791468[_0x0ee4('0x46')]=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x237456[_0x0ee4('0x3e')],_0x454d28['filters']));if(_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]){_0x791468['where']=_[_0x0ee4('0x49')](_0x791468[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x791468['attributes'],function(_0x441e20){var _0x166885={};_0x166885[_0x441e20]={'$like':'%'+_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x166885;})});}_0x791468=_[_0x0ee4('0x49')]({},_0x791468,_0x237456[_0x0ee4('0x4c')]);return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x42a6bf){if(_0x42a6bf){_0x3ae5be=_0x42a6bf[_0x0ee4('0x54')];if(!_0x237456['query'][_0x0ee4('0x43')](_0x0ee4('0x60'))){_0x791468['limit']=qs[_0x0ee4('0x2c')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x791468[_0x0ee4('0x2d')]=qs[_0x0ee4('0x2d')](_0x237456[_0x0ee4('0x3e')][_0x0ee4('0x2d')]);}return _0x568b6a[_0x0ee4('0x6b')](_0x791468);}})[_0x0ee4('0x1e')](function(_0x20ba78){if(_0x20ba78){return _0x20ba78?{'count':_0x3ae5be,'rows':_0x20ba78}:null;}})['then'](respondWithResult(_0x28aefb,null))['catch'](handleError(_0x28aefb,null));};exports[_0x0ee4('0x6d')]=function(_0x1bc030,_0x3f4371,_0x409a53){var _0x4d57af=_0x1bc030[_0x0ee4('0x5d')][_0x0ee4('0x6e')];return db['Team'][_0x0ee4('0x62')]({'where':{'id':_0x4d57af},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ee4('0x6f'),'attributes':['id','name',_0x0ee4('0x70'),'voicePause',_0x0ee4('0x71')],'raw':!![]}]})[_0x0ee4('0x1e')](function(_0x555c47){if(_0x555c47){var _0x4b11e6=_['flatMap'](_0x555c47,function(_0x356888){var _0x283a3d=_0x356888[_0x0ee4('0x33')]({'plain':!![]});return _0x283a3d[_0x0ee4('0x6f')];});return db[_0x0ee4('0x3a')]['find']({'where':{'id':_0x1bc030[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x59dc8a){return db['sequelize'][_0x0ee4('0x72')](function(_0x3ce6a4){return _0x59dc8a[_0x0ee4('0x6d')](_0x4d57af,{'transaction':_0x3ce6a4})['then'](function(){return BPromise[_0x0ee4('0x73')](_0x4b11e6,function(_0x511cbe){return db[_0x0ee4('0x74')][_0x0ee4('0x75')]({'where':{'UserId':_0x511cbe['id'],'ChatQueueId':_0x1bc030[_0x0ee4('0x53')]['id']},'transaction':_0x3ce6a4});});})[_0x0ee4('0x1e')](function(){_0x4b11e6[_0x0ee4('0x76')](function(_0x5cdaf8){socket['emit'](_0x0ee4('0x77'),{'UserId':_0x5cdaf8['id'],'ChatQueueId':_0x59dc8a['id']});});});});});}})[_0x0ee4('0x1e')](respondWithStatusCode(_0x3f4371,null))[_0x0ee4('0x51')](handleError(_0x3f4371,null));};exports[_0x0ee4('0x78')]=function(_0x406935,_0x48a6ff,_0x900f02){return db[_0x0ee4('0x79')][_0x0ee4('0x62')]({'where':{'id':_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x0ee4('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x48a6ff,null))[_0x0ee4('0x1e')](function(_0x162bf4){var _0x4035b2=_[_0x0ee4('0x39')](_0x162bf4,'id');var _0x36bd3d=[];var _0x130b49=[];var _0xc2c7b6=squel[_0x0ee4('0x7a')]();_0xc2c7b6[_0x0ee4('0x7b')](_0x0ee4('0x7c'))[_0x0ee4('0x7d')](_0x0ee4('0x7e'),'tq')['join']('user_has_teams','ut',_0x0ee4('0x7f'))[_0x0ee4('0x46')](_0x0ee4('0x80'),_0x406935[_0x0ee4('0x53')]['id']);for(var _0x32956b=0x0;_0x32956b<_0x162bf4['length'];_0x32956b+=0x1){let _0x1e1fdb=_0x162bf4[_0x32956b];for(var _0x1f9b4d=0x0;_0x1f9b4d<_0x1e1fdb[_0x0ee4('0x6f')]['length'];_0x1f9b4d+=0x1){let _0x5663af=_0x1e1fdb[_0x0ee4('0x6f')][_0x1f9b4d];var _0x4d029a=_0xc2c7b6[_0x0ee4('0x81')]();_0x4d029a[_0x0ee4('0x46')]('ut.UserId\x20=\x20?',_0x5663af['id']);_0x130b49[_0x0ee4('0x82')](db[_0x0ee4('0x83')][_0x0ee4('0x3e')](_0x4d029a[_0x0ee4('0x84')](),{'type':db[_0x0ee4('0x83')]['QueryTypes'][_0x0ee4('0x85')]})[_0x0ee4('0x1e')](function(_0xc3e6a3){if(_0xc3e6a3[_0x0ee4('0x54')]===0x1){return _0x5663af['id'];}else{var _0x5dcddd=_[_0x0ee4('0x86')](_[_0x0ee4('0x39')](_0xc3e6a3,_0x0ee4('0x87')),function(_0x1ae871){return _[_0x0ee4('0x88')](_0x4035b2,_0x1ae871);});if(_0x5dcddd){return _0x5663af['id'];}}}));}}return BPromise[_0x0ee4('0x89')](_0x130b49)[_0x0ee4('0x1e')](function(_0x536496){_0x36bd3d=_(_0x36bd3d)[_0x0ee4('0x8a')](_0x536496)[_0x0ee4('0x8b')]()[_0x0ee4('0x8c')]();return db[_0x0ee4('0x3a')][_0x0ee4('0x55')]({'where':{'id':_0x406935[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](function(_0x264fb0){return db[_0x0ee4('0x83')][_0x0ee4('0x72')](function(_0x1bddd1){return _0x264fb0[_0x0ee4('0x78')](_0x406935[_0x0ee4('0x3e')][_0x0ee4('0x6e')],{'transaction':_0x1bddd1})[_0x0ee4('0x1e')](function(){if(!_[_0x0ee4('0x8d')](_0x36bd3d)){return _0x264fb0[_0x0ee4('0x8e')](_0x36bd3d,{'transaction':_0x1bddd1});}})['then'](function(){_0x36bd3d[_0x0ee4('0x76')](function(_0x123cb3){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':_0x123cb3,'ChatQueueId':_0x264fb0['id']});});});});});});})['then'](respondWithStatusCode(_0x48a6ff,null))[_0x0ee4('0x51')](handleError(_0x48a6ff,null));};exports['addAgents']=function(_0x4430c0,_0x17f36c,_0xf0b41c){return db['ChatQueue']['find']({'where':{'id':_0x4430c0['params']['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x17f36c,null))[_0x0ee4('0x1e')](function(_0x3a2da2){if(_0x3a2da2){return _0x3a2da2[_0x0ee4('0x91')](_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')],_[_0x0ee4('0x92')](_0x4430c0[_0x0ee4('0x5d')],[_0x0ee4('0x6e'),'id'])||{})[_0x0ee4('0x93')](function(_0x38b2f5){for(var _0x23087a=0x0;_0x23087a<_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x23087a+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x4430c0[_0x0ee4('0x5d')][_0x0ee4('0x6e')][_0x23087a]),'ChatQueueId':Number(_0x4430c0[_0x0ee4('0x53')]['id'])});}return _0x38b2f5;});}})[_0x0ee4('0x1e')](respondWithResult(_0x17f36c,null))['catch'](handleError(_0x17f36c,null));};exports[_0x0ee4('0x8e')]=function(_0x588ac7,_0xe2d58e,_0x4de398){return db['ChatQueue'][_0x0ee4('0x55')]({'where':{'id':_0x588ac7[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0xe2d58e,null))[_0x0ee4('0x1e')](function(_0x5d0071){if(_0x5d0071){return _0x5d0071[_0x0ee4('0x8e')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])[_0x0ee4('0x1e')](function(){if(_[_0x0ee4('0x94')](_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')])){for(var _0x87c05d=0x0;_0x87c05d<_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x0ee4('0x54')];_0x87c05d+=0x1){socket[_0x0ee4('0x8f')](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')][_0x0ee4('0x6e')][_0x87c05d]),'ChatQueueId':Number(_0x588ac7['params']['id'])});}}else{socket['emit'](_0x0ee4('0x90'),{'UserId':Number(_0x588ac7[_0x0ee4('0x3e')]['ids']),'ChatQueueId':Number(_0x588ac7[_0x0ee4('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0xe2d58e,null))[_0x0ee4('0x51')](handleError(_0xe2d58e,null));};exports[_0x0ee4('0x95')]=function(_0x217a7c,_0x2b5d15,_0x6657f6){var _0x4c7639={};var _0x4f65b9={};var _0x484df7;var _0x4ea576;return db[_0x0ee4('0x3a')][_0x0ee4('0x5f')]({'where':{'id':_0x217a7c[_0x0ee4('0x53')]['id']}})[_0x0ee4('0x1e')](handleEntityNotFound(_0x2b5d15,null))[_0x0ee4('0x1e')](function(_0x2a41e6){if(_0x2a41e6){_0x484df7=_0x2a41e6;_0x4f65b9['model']=_[_0x0ee4('0x3f')](db['User'][_0x0ee4('0x3b')]);_0x4f65b9['query']=_[_0x0ee4('0x3f')](_0x217a7c[_0x0ee4('0x3e')]);_0x4f65b9[_0x0ee4('0x47')]=_[_0x0ee4('0x40')](_0x4f65b9[_0x0ee4('0x3d')],_0x4f65b9['query']);_0x4c7639['attributes']=_[_0x0ee4('0x40')](_0x4f65b9['model'],qs[_0x0ee4('0x42')](_0x217a7c[_0x0ee4('0x3e')]['fields']));_0x4c7639['attributes']=_0x4c7639[_0x0ee4('0x41')][_0x0ee4('0x54')]?_0x4c7639[_0x0ee4('0x41')]:_0x4f65b9[_0x0ee4('0x3d')];_0x4c7639[_0x0ee4('0x44')]=qs[_0x0ee4('0x45')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x45')]);_0x4c7639['where']=qs[_0x0ee4('0x47')](_[_0x0ee4('0x6c')](_0x217a7c['query'],_0x4f65b9[_0x0ee4('0x47')]));if(_0x217a7c['query']['filter']){_0x4c7639[_0x0ee4('0x46')]=_['merge'](_0x4c7639[_0x0ee4('0x46')],{'$or':_[_0x0ee4('0x39')](_0x4c7639[_0x0ee4('0x41')],function(_0x173e1d){var _0x587245={};_0x587245[_0x173e1d]={'$like':'%'+_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x48')]+'%'};return _0x587245;})});}_0x4c7639=_['merge']({},_0x4c7639,_0x217a7c[_0x0ee4('0x4c')]);return _0x484df7[_0x0ee4('0x95')](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x735d87){if(_0x735d87){_0x4ea576=_0x735d87[_0x0ee4('0x54')];if(!_0x217a7c[_0x0ee4('0x3e')]['hasOwnProperty'](_0x0ee4('0x60'))){_0x4c7639[_0x0ee4('0x2c')]=qs[_0x0ee4('0x2c')](_0x217a7c[_0x0ee4('0x3e')][_0x0ee4('0x2c')]);_0x4c7639['offset']=qs[_0x0ee4('0x2d')](_0x217a7c[_0x0ee4('0x3e')]['offset']);}return _0x484df7['getAgents'](_0x4c7639);}})[_0x0ee4('0x1e')](function(_0x43084c){if(_0x43084c){return _0x43084c?{'count':_0x4ea576,'rows':_0x43084c}:null;}})['then'](respondWithResult(_0x2b5d15,null))[_0x0ee4('0x51')](handleError(_0x2b5d15,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 5520932..ae4a98c 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 _0x64c4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x372316,_0x36205b){var _0x22fc88=function(_0x1a17fe){while(--_0x1a17fe){_0x372316['push'](_0x372316['shift']());}};_0x22fc88(++_0x36205b);}(_0x64c4,0x11b));var _0x464c=function(_0x28c689,_0x4ae001){_0x28c689=_0x28c689-0x0;var _0x6a3248=_0x64c4[_0x28c689];return _0x6a3248;};'use strict';var EventEmitter=require(_0x464c('0x0'));var ChatQueue=require(_0x464c('0x1'))['db'][_0x464c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x464c('0x3')](0x0);var events={'afterCreate':_0x464c('0x4'),'afterUpdate':_0x464c('0x5'),'afterDestroy':_0x464c('0x6')};function emitEvent(_0x5ea96e){return function(_0x473755,_0x3656d6,_0x2ae690){ChatQueueEvents['emit'](_0x5ea96e+':'+_0x473755['id'],_0x473755);ChatQueueEvents['emit'](_0x5ea96e,_0x473755);_0x2ae690(null);};}for(var e in events){if(events[_0x464c('0x7')](e)){var event=events[e];ChatQueue[_0x464c('0x8')](e,emitEvent(event));}}module[_0x464c('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xf6d1=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1ab59f,_0x2d3051){var _0x234db7=function(_0x2db228){while(--_0x2db228){_0x1ab59f['push'](_0x1ab59f['shift']());}};_0x234db7(++_0x2d3051);}(_0xf6d1,0x99));var _0x1f6d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf6d1[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x1f6d('0x0'));var ChatQueue=require(_0x1f6d('0x1'))['db'][_0x1f6d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1f6d('0x3')](0x0);var events={'afterCreate':_0x1f6d('0x4'),'afterUpdate':_0x1f6d('0x5'),'afterDestroy':_0x1f6d('0x6')};function emitEvent(_0x4fa5a2){return function(_0x1b8190,_0x59e1ab,_0x1532aa){ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2+':'+_0x1b8190['id'],_0x1b8190);ChatQueueEvents[_0x1f6d('0x7')](_0x4fa5a2,_0x1b8190);_0x1532aa(null);};}for(var e in events){if(events[_0x1f6d('0x8')](e)){var event=events[e];ChatQueue[_0x1f6d('0x9')](e,emitEvent(event));}}module[_0x1f6d('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index c8156a3..6f01525 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 _0x43f5=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x3e1226,_0x4199d6){var _0x1ff634=function(_0x4dbed0){while(--_0x4dbed0){_0x3e1226['push'](_0x3e1226['shift']());}};_0x1ff634(++_0x4199d6);}(_0x43f5,0x1bc));var _0x543f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x43f5[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x543f('0x0'));var util=require('util');var logger=require(_0x543f('0x1'))('api');var moment=require(_0x543f('0x2'));var BPromise=require(_0x543f('0x3'));var rp=require(_0x543f('0x4'));var fs=require('fs');var path=require(_0x543f('0x5'));var rimraf=require(_0x543f('0x6'));var config=require('../../config/environment');var attributes=require(_0x543f('0x7'));module[_0x543f('0x8')]=function(_0x12d9f4,_0x308eb7){return _0x12d9f4[_0x543f('0x9')](_0x543f('0xa'),attributes,{'tableName':_0x543f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0244=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0xf93365,_0x26c5eb){var _0x42fa5d=function(_0x5b9aee){while(--_0x5b9aee){_0xf93365['push'](_0xf93365['shift']());}};_0x42fa5d(++_0x26c5eb);}(_0x0244,0x14b));var _0x4024=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x0244[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x4024('0x0'));var util=require(_0x4024('0x1'));var logger=require(_0x4024('0x2'))(_0x4024('0x3'));var moment=require(_0x4024('0x4'));var BPromise=require(_0x4024('0x5'));var rp=require(_0x4024('0x6'));var fs=require('fs');var path=require(_0x4024('0x7'));var rimraf=require(_0x4024('0x8'));var config=require(_0x4024('0x9'));var attributes=require('./chatQueue.attributes');module[_0x4024('0xa')]=function(_0x4aca82,_0x41efe7){return _0x4aca82[_0x4024('0xb')](_0x4024('0xc'),attributes,{'tableName':_0x4024('0xd'),'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 2e923e9..36c48fd 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 _0x2fc0=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','options','raw','attributes','include','map','model','then','debug','ShowChatQueue','util','moment','bluebird','randomstring','ioredis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2fc0,0x192));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x02fc('0x0'));var moment=require(_0x02fc('0x1'));var BPromise=require(_0x02fc('0x2'));var rs=require(_0x02fc('0x3'));var fs=require('fs');var Redis=require(_0x02fc('0x4'));var db=require(_0x02fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02fc('0x6'))(_0x02fc('0x7'));var config=require(_0x02fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x02fc('0x9')][_0x02fc('0xa')]({'port':0x232a});config[_0x02fc('0xb')]=_[_0x02fc('0xc')](config['redis'],{'host':_0x02fc('0xd'),'port':0x18eb});var socket=require(_0x02fc('0xe'))(new Redis(config[_0x02fc('0xb')]));require(_0x02fc('0xf'))['register'](socket);function respondWithRpcPromise(_0x23d777,_0x3283a3,_0xb4dbc9){return new BPromise(function(_0x588bc3,_0x3fb788){return client[_0x02fc('0x10')](_0x23d777,_0xb4dbc9)['then'](function(_0x88540d){logger[_0x02fc('0x11')](_0x02fc('0x12'),_0x3283a3,'request\x20sent');logger['debug'](_0x02fc('0x13'),_0x3283a3,_0x02fc('0x14'),JSON[_0x02fc('0x15')](_0x88540d));if(_0x88540d[_0x02fc('0x16')]){if(_0x88540d['error'][_0x02fc('0x17')]===0x1f4){logger['error'](_0x02fc('0x12'),_0x3283a3,_0x88540d[_0x02fc('0x16')]['message']);return _0x3fb788(_0x88540d[_0x02fc('0x16')][_0x02fc('0x18')]);}logger[_0x02fc('0x16')](_0x02fc('0x12'),_0x3283a3,_0x88540d['error']['message']);return _0x588bc3(_0x88540d[_0x02fc('0x16')][_0x02fc('0x18')]);}else{logger[_0x02fc('0x11')](_0x02fc('0x12'),_0x3283a3,_0x02fc('0x14'));_0x588bc3(_0x88540d[_0x02fc('0x19')][_0x02fc('0x18')]);}})[_0x02fc('0x1a')](function(_0x57d824){logger[_0x02fc('0x16')](_0x02fc('0x12'),_0x3283a3,_0x57d824);_0x3fb788(_0x57d824);});});}exports[_0x02fc('0x1b')]=function(_0x767db8){var _0x204438=this;return new Promise(function(_0xc29da2,_0x1c892d){return db['ChatQueue']['findAll']({'raw':_0x767db8[_0x02fc('0x1c')]?_0x767db8[_0x02fc('0x1c')][_0x02fc('0x1d')]===undefined?!![]:![]:!![],'where':_0x767db8['options']?_0x767db8['options']['where']||null:null,'attributes':_0x767db8['options']?_0x767db8[_0x02fc('0x1c')][_0x02fc('0x1e')]||null:null,'limit':_0x767db8[_0x02fc('0x1c')]?_0x767db8[_0x02fc('0x1c')]['limit']||null:null,'include':_0x767db8[_0x02fc('0x1c')]?_0x767db8[_0x02fc('0x1c')][_0x02fc('0x1f')]?_[_0x02fc('0x20')](_0x767db8['options'][_0x02fc('0x1f')],function(_0x3acfb6){return{'model':db[_0x3acfb6[_0x02fc('0x21')]],'as':_0x3acfb6['as'],'attributes':_0x3acfb6[_0x02fc('0x1e')],'include':_0x3acfb6[_0x02fc('0x1f')]?_[_0x02fc('0x20')](_0x3acfb6['include'],function(_0x4c2d3e){return{'model':db[_0x4c2d3e[_0x02fc('0x21')]],'as':_0x4c2d3e['as'],'attributes':_0x4c2d3e[_0x02fc('0x1e')],'include':_0x4c2d3e['include']?_[_0x02fc('0x20')](_0x4c2d3e[_0x02fc('0x1f')],function(_0x8d821e){return{'model':db[_0x8d821e['model']],'as':_0x8d821e['as'],'attributes':_0x8d821e[_0x02fc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02fc('0x22')](function(_0xb21002){logger[_0x02fc('0x11')](_0x02fc('0x1b'),_0x767db8);logger[_0x02fc('0x23')](_0x02fc('0x1b'),_0x767db8,JSON['stringify'](_0xb21002));_0xc29da2(_0xb21002);})['catch'](function(_0x289f36){logger[_0x02fc('0x16')]('GetChatQueue',_0x289f36[_0x02fc('0x18')],_0x767db8);_0x1c892d(_0x204438[_0x02fc('0x16')](0x1f4,_0x289f36[_0x02fc('0x18')]));});});};exports['ShowChatQueue']=function(_0x2fe34e){var _0x5014f8=this;return new Promise(function(_0x61c5e5,_0x5e97ba){return db['ChatQueue']['find']({'raw':_0x2fe34e['options']?_0x2fe34e[_0x02fc('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2fe34e[_0x02fc('0x1c')]?_0x2fe34e[_0x02fc('0x1c')]['where']||null:null,'attributes':_0x2fe34e['options']?_0x2fe34e[_0x02fc('0x1c')]['attributes']||null:null,'include':_0x2fe34e['options']?_0x2fe34e[_0x02fc('0x1c')]['include']?_[_0x02fc('0x20')](_0x2fe34e['options'][_0x02fc('0x1f')],function(_0x4ec08f){return{'model':db[_0x4ec08f[_0x02fc('0x21')]],'as':_0x4ec08f['as'],'attributes':_0x4ec08f[_0x02fc('0x1e')],'include':_0x4ec08f['include']?_[_0x02fc('0x20')](_0x4ec08f[_0x02fc('0x1f')],function(_0x2e622d){return{'model':db[_0x2e622d[_0x02fc('0x21')]],'as':_0x2e622d['as'],'attributes':_0x2e622d['attributes'],'include':_0x2e622d[_0x02fc('0x1f')]?_[_0x02fc('0x20')](_0x2e622d[_0x02fc('0x1f')],function(_0x57673c){return{'model':db[_0x57673c[_0x02fc('0x21')]],'as':_0x57673c['as'],'attributes':_0x57673c[_0x02fc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02fc('0x22')](function(_0x358b40){logger[_0x02fc('0x11')](_0x02fc('0x24'),_0x2fe34e);logger['debug']('ShowChatQueue',_0x2fe34e,JSON['stringify'](_0x358b40));_0x61c5e5(_0x358b40);})[_0x02fc('0x1a')](function(_0x2084a8){logger[_0x02fc('0x16')](_0x02fc('0x24'),_0x2084a8['message'],_0x2fe34e);_0x5e97ba(_0x5014f8['error'](0x1f4,_0x2084a8[_0x02fc('0x18')]));});});}; \ No newline at end of file +var _0xc584=['request\x20sent','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ChatQueue','ShowChatQueue','util','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','./chatQueue.socket','register','request','then','info','debug'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0xc584,0xa8));var _0x4c58=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xc584[_0x312abc];return _0x314298;};'use strict';var _=require('lodash');var util=require(_0x4c58('0x0'));var moment=require(_0x4c58('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c58('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c58('0x3'));var logger=require(_0x4c58('0x4'))(_0x4c58('0x5'));var config=require('../../config/environment');var jayson=require(_0x4c58('0x6'));var client=jayson[_0x4c58('0x7')][_0x4c58('0x8')]({'port':0x232a});config[_0x4c58('0x9')]=_[_0x4c58('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c58('0x9')]));require(_0x4c58('0xb'))[_0x4c58('0xc')](socket);function respondWithRpcPromise(_0x39405a,_0xb89ef4,_0x23a115){return new BPromise(function(_0x85e280,_0xd08c65){return client[_0x4c58('0xd')](_0x39405a,_0x23a115)[_0x4c58('0xe')](function(_0x2b21da){logger[_0x4c58('0xf')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,'request\x20sent');logger[_0x4c58('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xb89ef4,_0x4c58('0x11'),JSON[_0x4c58('0x12')](_0x2b21da));if(_0x2b21da[_0x4c58('0x13')]){if(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x14')]===0x1f4){logger[_0x4c58('0x13')]('ChatQueue,\x20%s,\x20%s',_0xb89ef4,_0x2b21da[_0x4c58('0x13')]['message']);return _0xd08c65(_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);}logger[_0x4c58('0x13')](_0x4c58('0x16'),_0xb89ef4,_0x2b21da[_0x4c58('0x13')][_0x4c58('0x15')]);return _0x85e280(_0x2b21da['error'][_0x4c58('0x15')]);}else{logger[_0x4c58('0xf')](_0x4c58('0x16'),_0xb89ef4,_0x4c58('0x11'));_0x85e280(_0x2b21da[_0x4c58('0x17')]['message']);}})[_0x4c58('0x18')](function(_0x45b1ab){logger['error'](_0x4c58('0x16'),_0xb89ef4,_0x45b1ab);_0xd08c65(_0x45b1ab);});});}exports[_0x4c58('0x19')]=function(_0x1a0062){var _0x2413f4=this;return new Promise(function(_0x227931,_0x46876f){return db['ChatQueue'][_0x4c58('0x1a')]({'raw':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x1d')]||null:null,'attributes':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'limit':_0x1a0062['options']?_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x1f')]||null:null,'include':_0x1a0062[_0x4c58('0x1b')]?_0x1a0062['options'][_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x1a0062[_0x4c58('0x1b')][_0x4c58('0x20')],function(_0x41bc70){return{'model':db[_0x41bc70['model']],'as':_0x41bc70['as'],'attributes':_0x41bc70[_0x4c58('0x1e')],'include':_0x41bc70[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x41bc70[_0x4c58('0x20')],function(_0x317409){return{'model':db[_0x317409[_0x4c58('0x22')]],'as':_0x317409['as'],'attributes':_0x317409[_0x4c58('0x1e')],'include':_0x317409[_0x4c58('0x20')]?_['map'](_0x317409[_0x4c58('0x20')],function(_0x10b72c){return{'model':db[_0x10b72c[_0x4c58('0x22')]],'as':_0x10b72c['as'],'attributes':_0x10b72c[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4c58('0xe')](function(_0x19ed6e){logger[_0x4c58('0xf')](_0x4c58('0x19'),_0x1a0062);logger[_0x4c58('0x10')](_0x4c58('0x19'),_0x1a0062,JSON[_0x4c58('0x12')](_0x19ed6e));_0x227931(_0x19ed6e);})[_0x4c58('0x18')](function(_0x3ec02a){logger[_0x4c58('0x13')](_0x4c58('0x19'),_0x3ec02a[_0x4c58('0x15')],_0x1a0062);_0x46876f(_0x2413f4[_0x4c58('0x13')](0x1f4,_0x3ec02a[_0x4c58('0x15')]));});});};exports['ShowChatQueue']=function(_0x540fad){var _0x5238c9=this;return new Promise(function(_0x282071,_0x50fbeb){return db[_0x4c58('0x23')]['find']({'raw':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1c')]===undefined?!![]:![]:!![],'where':_0x540fad['options']?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1d')]||null:null,'attributes':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x1e')]||null:null,'include':_0x540fad[_0x4c58('0x1b')]?_0x540fad[_0x4c58('0x1b')][_0x4c58('0x20')]?_['map'](_0x540fad['options']['include'],function(_0x284335){return{'model':db[_0x284335[_0x4c58('0x22')]],'as':_0x284335['as'],'attributes':_0x284335[_0x4c58('0x1e')],'include':_0x284335['include']?_[_0x4c58('0x21')](_0x284335[_0x4c58('0x20')],function(_0x10d420){return{'model':db[_0x10d420[_0x4c58('0x22')]],'as':_0x10d420['as'],'attributes':_0x10d420['attributes'],'include':_0x10d420[_0x4c58('0x20')]?_[_0x4c58('0x21')](_0x10d420[_0x4c58('0x20')],function(_0x4419a6){return{'model':db[_0x4419a6[_0x4c58('0x22')]],'as':_0x4419a6['as'],'attributes':_0x4419a6[_0x4c58('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf032cc){logger['info']('ShowChatQueue',_0x540fad);logger[_0x4c58('0x10')]('ShowChatQueue',_0x540fad,JSON[_0x4c58('0x12')](_0xf032cc));_0x282071(_0xf032cc);})[_0x4c58('0x18')](function(_0x3b6aeb){logger[_0x4c58('0x13')](_0x4c58('0x24'),_0x3b6aeb['message'],_0x540fad);_0x50fbeb(_0x5238c9[_0x4c58('0x13')](0x1f4,_0x3b6aeb[_0x4c58('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 5e9e73f..0967b79 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 _0x34e5=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0xe46336,_0x3b1a0d){var _0x5a9f5b=function(_0x6c06c4){while(--_0x6c06c4){_0xe46336['push'](_0xe46336['shift']());}};_0x5a9f5b(++_0x3b1a0d);}(_0x34e5,0x172));var _0x534e=function(_0xc4d9f7,_0x4a28e4){_0xc4d9f7=_0xc4d9f7-0x0;var _0x1d8214=_0x34e5[_0xc4d9f7];return _0x1d8214;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x534e('0x0'),'remove',_0x534e('0x1')];function createListener(_0x467e3e,_0x425ae8){return function(_0x246650){_0x425ae8[_0x534e('0x2')](_0x467e3e,_0x246650);};}function removeListener(_0x50b790,_0x11a158){return function(){ChatQueueEvents[_0x534e('0x3')](_0x50b790,_0x11a158);};}exports[_0x534e('0x4')]=function(_0x117f0c){for(var _0x436a92=0x0,_0x2d0370=events[_0x534e('0x5')];_0x436a92<_0x2d0370;_0x436a92++){var _0x5620d4=events[_0x436a92];var _0x24d562=createListener(_0x534e('0x6')+_0x5620d4,_0x117f0c);ChatQueueEvents['on'](_0x5620d4,_0x24d562);}}; \ No newline at end of file +var _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0xa9ac50,_0x14e3e4){var _0xfabbe7=function(_0x2b68b5){while(--_0x2b68b5){_0xa9ac50['push'](_0xa9ac50['shift']());}};_0xfabbe7(++_0x14e3e4);}(_0xec56,0x1bd));var _0x6ec5=function(_0x26e154,_0x5e8835){_0x26e154=_0x26e154-0x0;var _0x3e949d=_0xec56[_0x26e154];return _0x3e949d;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 820491f..e4b7ba2 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1beb3d,_0x410173){var _0x28894c=function(_0xa7b338){while(--_0xa7b338){_0x1beb3d['push'](_0x1beb3d['shift']());}};_0x28894c(++_0x410173);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3bec85,_0x37d590){var _0x26e51a=function(_0xd347f5){while(--_0xd347f5){_0x3bec85['push'](_0x3bec85['shift']());}};_0x26e51a(++_0x37d590);}(_0xe14b,0x93));var _0xbe14=function(_0x36cfae,_0x35dae4){_0x36cfae=_0x36cfae-0x0;var _0x297137=_0xe14b[_0x36cfae];return _0x297137;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index f1b86b3..228d3e0 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 _0x3805=['exports','STRING','DATE','moment','sequelize'];(function(_0x2a2591,_0x958577){var _0x45bde5=function(_0x581142){while(--_0x581142){_0x2a2591['push'](_0x2a2591['shift']());}};_0x45bde5(++_0x958577);}(_0x3805,0x111));var _0x5380=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x3805[_0x8c1005];return _0x175354;};'use strict';var moment=require(_0x5380('0x0'));var Sequelize=require(_0x5380('0x1'));module[_0x5380('0x2')]={'uniqueid':{'type':Sequelize[_0x5380('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5380('0x3')]},'joinAt':{'type':Sequelize[_0x5380('0x4')]},'leaveAt':{'type':Sequelize[_0x5380('0x4')]},'acceptAt':{'type':Sequelize[_0x5380('0x4')]},'exitAt':{'type':Sequelize[_0x5380('0x4')]},'reason':{'type':Sequelize[_0x5380('0x3')]}}; \ No newline at end of file +var _0xdeeb=['exports','STRING','DATE','moment'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xdeeb,0x1b3));var _0xbdee=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xdeeb[_0x9fd887];return _0x1a54ab;};'use strict';var moment=require(_0xbdee('0x0'));var Sequelize=require('sequelize');module[_0xbdee('0x1')]={'uniqueid':{'type':Sequelize[_0xbdee('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbdee('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbdee('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbdee('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 3be5cbf..15e9eed 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 _0x7dee=['fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','count','includeAll','findAll','rows','show','options','catch','create','body','find','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes'];(function(_0xd5baf1,_0x2dcaa6){var _0x47eb69=function(_0x243cd4){while(--_0x243cd4){_0xd5baf1['push'](_0xd5baf1['shift']());}};_0x47eb69(++_0x2dcaa6);}(_0x7dee,0xb0));var _0xe7de=function(_0x398500,_0x2d52b4){_0x398500=_0x398500-0x0;var _0x3a2817=_0x7dee[_0x398500];return _0x3a2817;};'use strict';var emlformat=require(_0xe7de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe7de('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7de('0x2'));var moment=require(_0xe7de('0x3'));var BPromise=require(_0xe7de('0x4'));var Mustache=require(_0xe7de('0x5'));var util=require('util');var path=require(_0xe7de('0x6'));var sox=require('sox');var csv=require(_0xe7de('0x7'));var ejs=require(_0xe7de('0x8'));var fs=require('fs');var fs_extra=require(_0xe7de('0x9'));var _=require(_0xe7de('0xa'));var squel=require(_0xe7de('0xb'));var crypto=require(_0xe7de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7de('0xd'));var toCsv=require(_0xe7de('0x7'));var querystring=require(_0xe7de('0xe'));var Papa=require(_0xe7de('0xf'));var Redis=require('ioredis');var authService=require(_0xe7de('0x10'));var qs=require(_0xe7de('0x11'));var as=require(_0xe7de('0x12'));var hardwareService=require(_0xe7de('0x13'));var logger=require(_0xe7de('0x14'))(_0xe7de('0x15'));var utils=require(_0xe7de('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe7de('0x17'));var db=require(_0xe7de('0x18'))['db'];function respondWithStatusCode(_0x38c0a1,_0x2c535c){_0x2c535c=_0x2c535c||0xcc;return function(_0x2c49d6){if(_0x2c49d6){return _0x38c0a1['sendStatus'](_0x2c535c);}return _0x38c0a1[_0xe7de('0x19')](_0x2c535c)[_0xe7de('0x1a')]();};}function respondWithResult(_0x280473,_0x41f731){_0x41f731=_0x41f731||0xc8;return function(_0xe68b48){if(_0xe68b48){return _0x280473[_0xe7de('0x19')](_0x41f731)['json'](_0xe68b48);}};}function respondWithFilteredResult(_0x4b70ab,_0x28a0c4){return function(_0x3f62e1){if(_0x3f62e1){var _0x3e49d5=typeof _0x28a0c4[_0xe7de('0x1b')]===_0xe7de('0x1c')&&typeof _0x28a0c4['limit']===_0xe7de('0x1c');var _0x4b1648=_0x3f62e1['count'];var _0x5cb629=_0x3e49d5?0x0:_0x28a0c4[_0xe7de('0x1b')];var _0x1da189=_0x3e49d5?_0x3f62e1['count']:_0x28a0c4[_0xe7de('0x1b')]+_0x28a0c4[_0xe7de('0x1d')];var _0x2850c6;if(_0x1da189>=_0x4b1648){_0x1da189=_0x4b1648;_0x2850c6=0xc8;}else{_0x2850c6=0xce;}_0x4b70ab[_0xe7de('0x19')](_0x2850c6);return _0x4b70ab[_0xe7de('0x1e')](_0xe7de('0x1f'),_0x5cb629+'-'+_0x1da189+'/'+_0x4b1648)[_0xe7de('0x20')](_0x3f62e1);}return null;};}function patchUpdates(_0xfead44){return function(_0x1c6fa6){try{jsonpatch['apply'](_0x1c6fa6,_0xfead44,!![]);}catch(_0x1120c1){return BPromise[_0xe7de('0x21')](_0x1120c1);}return _0x1c6fa6[_0xe7de('0x22')]();};}function saveUpdates(_0x4eb228,_0xc9f494){return function(_0x597346){if(_0x597346){return _0x597346[_0xe7de('0x23')](_0x4eb228)[_0xe7de('0x24')](function(_0x3b0c24){return _0x3b0c24;});}return null;};}function removeEntity(_0x5e97ec,_0x45b4e1){return function(_0x454952){if(_0x454952){return _0x454952[_0xe7de('0x25')]()[_0xe7de('0x24')](function(){_0x5e97ec[_0xe7de('0x19')](0xcc)[_0xe7de('0x1a')]();});}};}function handleEntityNotFound(_0xd7f3ca,_0x1f837e){return function(_0x4c0aff){if(!_0x4c0aff){_0xd7f3ca[_0xe7de('0x26')](0x194);}return _0x4c0aff;};}function handleError(_0x33e7f1,_0x419a94){_0x419a94=_0x419a94||0x1f4;return function(_0x248b9a){logger[_0xe7de('0x27')](_0x248b9a[_0xe7de('0x28')]);if(_0x248b9a[_0xe7de('0x29')]){delete _0x248b9a['name'];}_0x33e7f1[_0xe7de('0x19')](_0x419a94)[_0xe7de('0x2a')](_0x248b9a);};}exports[_0xe7de('0x2b')]=function(_0x3d4d63,_0x25b7cd){var _0x4ff7df={},_0x41b591={},_0x241a37={'count':0x0,'rows':[]};var _0x596cb2=_['map'](db[_0xe7de('0x2c')][_0xe7de('0x2d')],function(_0x225e8e){return{'name':_0x225e8e[_0xe7de('0x2e')],'type':_0x225e8e['type'][_0xe7de('0x2f')]};});_0x41b591[_0xe7de('0x30')]=_[_0xe7de('0x31')](_0x596cb2,_0xe7de('0x29'));_0x41b591['query']=_[_0xe7de('0x32')](_0x3d4d63[_0xe7de('0x33')]);_0x41b591[_0xe7de('0x34')]=_[_0xe7de('0x35')](_0x41b591[_0xe7de('0x30')],_0x41b591[_0xe7de('0x33')]);_0x4ff7df[_0xe7de('0x36')]=_[_0xe7de('0x35')](_0x41b591['model'],qs[_0xe7de('0x37')](_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x37')]));_0x4ff7df[_0xe7de('0x36')]=_0x4ff7df[_0xe7de('0x36')][_0xe7de('0x38')]?_0x4ff7df[_0xe7de('0x36')]:_0x41b591[_0xe7de('0x30')];if(!_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x39')]('nolimit')){_0x4ff7df['limit']=qs[_0xe7de('0x1d')](_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x1d')]);_0x4ff7df[_0xe7de('0x1b')]=qs[_0xe7de('0x1b')](_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x1b')]);}_0x4ff7df[_0xe7de('0x3a')]=qs[_0xe7de('0x3b')](_0x3d4d63[_0xe7de('0x33')]['sort']);_0x4ff7df[_0xe7de('0x3c')]=qs[_0xe7de('0x34')](_[_0xe7de('0x3d')](_0x3d4d63[_0xe7de('0x33')],_0x41b591[_0xe7de('0x34')]),_0x596cb2);if(_0x3d4d63['query']['filter']){_0x4ff7df[_0xe7de('0x3c')]=_[_0xe7de('0x3e')](_0x4ff7df[_0xe7de('0x3c')],{'$or':_[_0xe7de('0x31')](_0x596cb2,function(_0x377b89){if(_0x377b89[_0xe7de('0x3f')]!==_0xe7de('0x40')){var _0x219231={};_0x219231[_0x377b89[_0xe7de('0x29')]]={'$like':'%'+_0x3d4d63['query']['filter']+'%'};return _0x219231;}})});}_0x4ff7df=_[_0xe7de('0x3e')]({},_0x4ff7df,_0x3d4d63['options']);var _0x51ff68={'where':_0x4ff7df['where']};return db[_0xe7de('0x2c')][_0xe7de('0x41')](_0x51ff68)[_0xe7de('0x24')](function(_0x94a7c2){_0x241a37[_0xe7de('0x41')]=_0x94a7c2;if(_0x3d4d63[_0xe7de('0x33')][_0xe7de('0x42')]){_0x4ff7df['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xe7de('0x43')](_0x4ff7df);})[_0xe7de('0x24')](function(_0xa71e89){_0x241a37[_0xe7de('0x44')]=_0xa71e89;return _0x241a37;})['then'](respondWithFilteredResult(_0x25b7cd,_0x4ff7df))['catch'](handleError(_0x25b7cd,null));};exports[_0xe7de('0x45')]=function(_0x495a82,_0x1ad1ac){var _0x5ac35f={'raw':!![],'where':{'id':_0x495a82['params']['id']}},_0x3e33dc={};_0x3e33dc[_0xe7de('0x30')]=_['keys'](db[_0xe7de('0x2c')][_0xe7de('0x2d')]);_0x3e33dc[_0xe7de('0x33')]=_['keys'](_0x495a82[_0xe7de('0x33')]);_0x3e33dc[_0xe7de('0x34')]=_[_0xe7de('0x35')](_0x3e33dc['model'],_0x3e33dc[_0xe7de('0x33')]);_0x5ac35f['attributes']=_[_0xe7de('0x35')](_0x3e33dc[_0xe7de('0x30')],qs[_0xe7de('0x37')](_0x495a82[_0xe7de('0x33')][_0xe7de('0x37')]));_0x5ac35f['attributes']=_0x5ac35f['attributes'][_0xe7de('0x38')]?_0x5ac35f['attributes']:_0x3e33dc['model'];if(_0x495a82[_0xe7de('0x33')][_0xe7de('0x42')]){_0x5ac35f['include']=[{'all':!![]}];}_0x5ac35f=_[_0xe7de('0x3e')]({},_0x5ac35f,_0x495a82[_0xe7de('0x46')]);return db['ChatQueueReport']['find'](_0x5ac35f)[_0xe7de('0x24')](handleEntityNotFound(_0x1ad1ac,null))[_0xe7de('0x24')](respondWithResult(_0x1ad1ac,null))[_0xe7de('0x47')](handleError(_0x1ad1ac,null));};exports['create']=function(_0x2eef24,_0x28eef7){return db[_0xe7de('0x2c')][_0xe7de('0x48')](_0x2eef24[_0xe7de('0x49')],{})[_0xe7de('0x24')](respondWithResult(_0x28eef7,0xc9))[_0xe7de('0x47')](handleError(_0x28eef7,null));};exports[_0xe7de('0x23')]=function(_0x407582,_0x2d8a9a){if(_0x407582[_0xe7de('0x49')]['id']){delete _0x407582['body']['id'];}return db[_0xe7de('0x2c')][_0xe7de('0x4a')]({'where':{'id':_0x407582[_0xe7de('0x4b')]['id']}})[_0xe7de('0x24')](handleEntityNotFound(_0x2d8a9a,null))['then'](saveUpdates(_0x407582[_0xe7de('0x49')],null))[_0xe7de('0x24')](respondWithResult(_0x2d8a9a,null))[_0xe7de('0x47')](handleError(_0x2d8a9a,null));};exports[_0xe7de('0x25')]=function(_0x374d37,_0x427ba6){return db[_0xe7de('0x2c')][_0xe7de('0x4a')]({'where':{'id':_0x374d37[_0xe7de('0x4b')]['id']}})[_0xe7de('0x24')](handleEntityNotFound(_0x427ba6,null))['then'](removeEntity(_0x427ba6,null))[_0xe7de('0x47')](handleError(_0x427ba6,null));};exports[_0xe7de('0x4c')]=function(_0x3aac91,_0x3415a6){return db[_0xe7de('0x2c')][_0xe7de('0x4c')]()['then'](respondWithResult(_0x3415a6,null))[_0xe7de('0x47')](handleError(_0x3415a6,null));}; \ No newline at end of file +var _0x6ab9=['query','attributes','fields','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','intersection'];(function(_0x2ad5cb,_0x34bf2a){var _0x3e3b42=function(_0x2a7be2){while(--_0x2a7be2){_0x2ad5cb['push'](_0x2ad5cb['shift']());}};_0x3e3b42(++_0x34bf2a);}(_0x6ab9,0x19a));var _0x96ab=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6ab9[_0x476bf4];return _0x788ffe;};'use strict';var emlformat=require(_0x96ab('0x0'));var rimraf=require(_0x96ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96ab('0x2'));var rp=require(_0x96ab('0x3'));var moment=require(_0x96ab('0x4'));var BPromise=require(_0x96ab('0x5'));var Mustache=require(_0x96ab('0x6'));var util=require('util');var path=require('path');var sox=require(_0x96ab('0x7'));var csv=require(_0x96ab('0x8'));var ejs=require(_0x96ab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96ab('0xa'));var squel=require(_0x96ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x96ab('0xc'));var deskjs=require(_0x96ab('0xd'));var toCsv=require(_0x96ab('0x8'));var querystring=require(_0x96ab('0xe'));var Papa=require(_0x96ab('0xf'));var Redis=require(_0x96ab('0x10'));var authService=require(_0x96ab('0x11'));var qs=require(_0x96ab('0x12'));var as=require(_0x96ab('0x13'));var hardwareService=require(_0x96ab('0x14'));var logger=require(_0x96ab('0x15'))(_0x96ab('0x16'));var utils=require(_0x96ab('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x96ab('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9204,_0x1131b5){_0x1131b5=_0x1131b5||0xcc;return function(_0x2d3ec3){if(_0x2d3ec3){return _0x2c9204[_0x96ab('0x19')](_0x1131b5);}return _0x2c9204[_0x96ab('0x1a')](_0x1131b5)[_0x96ab('0x1b')]();};}function respondWithResult(_0x3ff9a9,_0x24e2c4){_0x24e2c4=_0x24e2c4||0xc8;return function(_0x126761){if(_0x126761){return _0x3ff9a9[_0x96ab('0x1a')](_0x24e2c4)[_0x96ab('0x1c')](_0x126761);}};}function respondWithFilteredResult(_0x4df67b,_0x4ec844){return function(_0x3b54cc){if(_0x3b54cc){var _0x8d5c87=typeof _0x4ec844[_0x96ab('0x1d')]==='undefined'&&typeof _0x4ec844[_0x96ab('0x1e')]===_0x96ab('0x1f');var _0x56f92b=_0x3b54cc[_0x96ab('0x20')];var _0x4eca78=_0x8d5c87?0x0:_0x4ec844[_0x96ab('0x1d')];var _0x1a502a=_0x8d5c87?_0x3b54cc[_0x96ab('0x20')]:_0x4ec844[_0x96ab('0x1d')]+_0x4ec844[_0x96ab('0x1e')];var _0x1577bb;if(_0x1a502a>=_0x56f92b){_0x1a502a=_0x56f92b;_0x1577bb=0xc8;}else{_0x1577bb=0xce;}_0x4df67b[_0x96ab('0x1a')](_0x1577bb);return _0x4df67b[_0x96ab('0x21')](_0x96ab('0x22'),_0x4eca78+'-'+_0x1a502a+'/'+_0x56f92b)[_0x96ab('0x1c')](_0x3b54cc);}return null;};}function patchUpdates(_0x2aa3c4){return function(_0x4f3bb4){try{jsonpatch['apply'](_0x4f3bb4,_0x2aa3c4,!![]);}catch(_0x347b91){return BPromise[_0x96ab('0x23')](_0x347b91);}return _0x4f3bb4[_0x96ab('0x24')]();};}function saveUpdates(_0x583be2,_0x41936c){return function(_0x5ccaaa){if(_0x5ccaaa){return _0x5ccaaa[_0x96ab('0x25')](_0x583be2)['then'](function(_0x33c140){return _0x33c140;});}return null;};}function removeEntity(_0x90fa22,_0x5a02d0){return function(_0x1deef7){if(_0x1deef7){return _0x1deef7[_0x96ab('0x26')]()[_0x96ab('0x27')](function(){_0x90fa22[_0x96ab('0x1a')](0xcc)[_0x96ab('0x1b')]();});}};}function handleEntityNotFound(_0x27d6d5,_0x9cb9b6){return function(_0x2837a7){if(!_0x2837a7){_0x27d6d5[_0x96ab('0x19')](0x194);}return _0x2837a7;};}function handleError(_0x53869e,_0x215f09){_0x215f09=_0x215f09||0x1f4;return function(_0x524e1c){logger[_0x96ab('0x28')](_0x524e1c[_0x96ab('0x29')]);if(_0x524e1c[_0x96ab('0x2a')]){delete _0x524e1c[_0x96ab('0x2a')];}_0x53869e[_0x96ab('0x1a')](_0x215f09)[_0x96ab('0x2b')](_0x524e1c);};}exports[_0x96ab('0x2c')]=function(_0x435613,_0x4f954c){var _0xefb070={},_0x269c51={},_0xa5c503={'count':0x0,'rows':[]};var _0x5a998e=_[_0x96ab('0x2d')](db[_0x96ab('0x2e')][_0x96ab('0x2f')],function(_0x575664){return{'name':_0x575664[_0x96ab('0x30')],'type':_0x575664['type'][_0x96ab('0x31')]};});_0x269c51[_0x96ab('0x32')]=_['map'](_0x5a998e,_0x96ab('0x2a'));_0x269c51['query']=_['keys'](_0x435613['query']);_0x269c51['filters']=_[_0x96ab('0x33')](_0x269c51['model'],_0x269c51[_0x96ab('0x34')]);_0xefb070[_0x96ab('0x35')]=_[_0x96ab('0x33')](_0x269c51[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x435613['query']['fields']));_0xefb070[_0x96ab('0x35')]=_0xefb070[_0x96ab('0x35')]['length']?_0xefb070[_0x96ab('0x35')]:_0x269c51[_0x96ab('0x32')];if(!_0x435613['query']['hasOwnProperty'](_0x96ab('0x37'))){_0xefb070[_0x96ab('0x1e')]=qs[_0x96ab('0x1e')](_0x435613[_0x96ab('0x34')]['limit']);_0xefb070[_0x96ab('0x1d')]=qs['offset'](_0x435613['query'][_0x96ab('0x1d')]);}_0xefb070['order']=qs[_0x96ab('0x38')](_0x435613[_0x96ab('0x34')][_0x96ab('0x38')]);_0xefb070[_0x96ab('0x39')]=qs['filters'](_[_0x96ab('0x3a')](_0x435613[_0x96ab('0x34')],_0x269c51[_0x96ab('0x3b')]),_0x5a998e);if(_0x435613[_0x96ab('0x34')][_0x96ab('0x3c')]){_0xefb070['where']=_[_0x96ab('0x3d')](_0xefb070['where'],{'$or':_[_0x96ab('0x2d')](_0x5a998e,function(_0x4dae51){if(_0x4dae51[_0x96ab('0x3e')]!==_0x96ab('0x3f')){var _0x3f2305={};_0x3f2305[_0x4dae51[_0x96ab('0x2a')]]={'$like':'%'+_0x435613['query'][_0x96ab('0x3c')]+'%'};return _0x3f2305;}})});}_0xefb070=_[_0x96ab('0x3d')]({},_0xefb070,_0x435613[_0x96ab('0x40')]);var _0x3c7e5d={'where':_0xefb070[_0x96ab('0x39')]};return db[_0x96ab('0x2e')][_0x96ab('0x20')](_0x3c7e5d)[_0x96ab('0x27')](function(_0x14bcbf){_0xa5c503[_0x96ab('0x20')]=_0x14bcbf;if(_0x435613[_0x96ab('0x34')][_0x96ab('0x41')]){_0xefb070['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x96ab('0x42')](_0xefb070);})[_0x96ab('0x27')](function(_0xb541d8){_0xa5c503[_0x96ab('0x43')]=_0xb541d8;return _0xa5c503;})[_0x96ab('0x27')](respondWithFilteredResult(_0x4f954c,_0xefb070))[_0x96ab('0x44')](handleError(_0x4f954c,null));};exports[_0x96ab('0x45')]=function(_0x4b73d7,_0x347957){var _0x53f848={'raw':!![],'where':{'id':_0x4b73d7[_0x96ab('0x46')]['id']}},_0x5e8109={};_0x5e8109[_0x96ab('0x32')]=_['keys'](db[_0x96ab('0x2e')][_0x96ab('0x2f')]);_0x5e8109[_0x96ab('0x34')]=_[_0x96ab('0x47')](_0x4b73d7[_0x96ab('0x34')]);_0x5e8109['filters']=_[_0x96ab('0x33')](_0x5e8109['model'],_0x5e8109['query']);_0x53f848[_0x96ab('0x35')]=_['intersection'](_0x5e8109[_0x96ab('0x32')],qs[_0x96ab('0x36')](_0x4b73d7[_0x96ab('0x34')]['fields']));_0x53f848[_0x96ab('0x35')]=_0x53f848[_0x96ab('0x35')][_0x96ab('0x48')]?_0x53f848[_0x96ab('0x35')]:_0x5e8109[_0x96ab('0x32')];if(_0x4b73d7['query'][_0x96ab('0x41')]){_0x53f848['include']=[{'all':!![]}];}_0x53f848=_[_0x96ab('0x3d')]({},_0x53f848,_0x4b73d7['options']);return db[_0x96ab('0x2e')]['find'](_0x53f848)[_0x96ab('0x27')](handleEntityNotFound(_0x347957,null))[_0x96ab('0x27')](respondWithResult(_0x347957,null))[_0x96ab('0x44')](handleError(_0x347957,null));};exports[_0x96ab('0x49')]=function(_0x25d387,_0x42dbd7){return db['ChatQueueReport'][_0x96ab('0x49')](_0x25d387[_0x96ab('0x4a')],{})['then'](respondWithResult(_0x42dbd7,0xc9))[_0x96ab('0x44')](handleError(_0x42dbd7,null));};exports['update']=function(_0x14b467,_0x170992){if(_0x14b467[_0x96ab('0x4a')]['id']){delete _0x14b467['body']['id'];}return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x14b467['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x170992,null))[_0x96ab('0x27')](saveUpdates(_0x14b467[_0x96ab('0x4a')],null))[_0x96ab('0x27')](respondWithResult(_0x170992,null))[_0x96ab('0x44')](handleError(_0x170992,null));};exports[_0x96ab('0x26')]=function(_0x13b865,_0x5f2521){return db[_0x96ab('0x2e')][_0x96ab('0x4b')]({'where':{'id':_0x13b865['params']['id']}})[_0x96ab('0x27')](handleEntityNotFound(_0x5f2521,null))[_0x96ab('0x27')](removeEntity(_0x5f2521,null))['catch'](handleError(_0x5f2521,null));};exports[_0x96ab('0x4c')]=function(_0x2454b4,_0x391169){return db[_0x96ab('0x2e')][_0x96ab('0x4c')]()[_0x96ab('0x27')](respondWithResult(_0x391169,null))[_0x96ab('0x44')](handleError(_0x391169,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d17c355..915a2dd 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x20b75e,_0x45b003){var _0x5cae91=function(_0xa9440e){while(--_0xa9440e){_0x20b75e['push'](_0x20b75e['shift']());}};_0x5cae91(++_0x45b003);}(_0x757a,0xde));var _0xa757=function(_0x36fdc3,_0x1e4aa8){_0x36fdc3=_0x36fdc3-0x0;var _0x1734fd=_0x757a[_0x36fdc3];return _0x1734fd;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x154940,_0x4a448a){var _0x401409=function(_0x45cdcf){while(--_0x45cdcf){_0x154940['push'](_0x154940['shift']());}};_0x401409(++_0x4a448a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f9c4c15..863fe7a 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 _0x27c2=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatQueueReport','create','options','CreateChatQueueReport','UpdateChatQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x279dd6,_0x150b12){var _0x503290=function(_0x16e440){while(--_0x16e440){_0x279dd6['push'](_0x279dd6['shift']());}};_0x503290(++_0x150b12);}(_0x27c2,0x71));var _0x227c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x27c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x227c('0x0'));var util=require(_0x227c('0x1'));var moment=require(_0x227c('0x2'));var BPromise=require(_0x227c('0x3'));var rs=require(_0x227c('0x4'));var fs=require('fs');var Redis=require(_0x227c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x227c('0x6'))(_0x227c('0x7'));var config=require('../../config/environment');var jayson=require(_0x227c('0x8'));var client=jayson[_0x227c('0x9')][_0x227c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ba86,_0x232803,_0x260dd7){return new BPromise(function(_0x591a38,_0x4c6a8f){return client['request'](_0x45ba86,_0x260dd7)[_0x227c('0xb')](function(_0x25d081){logger[_0x227c('0xc')](_0x227c('0xd'),_0x232803,_0x227c('0xe'));logger[_0x227c('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x232803,_0x227c('0xe'),JSON[_0x227c('0x10')](_0x25d081));if(_0x25d081[_0x227c('0x11')]){if(_0x25d081[_0x227c('0x11')][_0x227c('0x12')]===0x1f4){logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);return _0x4c6a8f(_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);}logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x25d081['error']['message']);return _0x591a38(_0x25d081[_0x227c('0x11')][_0x227c('0x13')]);}else{logger[_0x227c('0xc')](_0x227c('0xd'),_0x232803,_0x227c('0xe'));_0x591a38(_0x25d081[_0x227c('0x14')][_0x227c('0x13')]);}})[_0x227c('0x15')](function(_0x52e8bc){logger[_0x227c('0x11')](_0x227c('0xd'),_0x232803,_0x52e8bc);_0x4c6a8f(_0x52e8bc);});});}exports['CreateChatQueueReport']=function(_0x4a9182){var _0x2dd773=this;return new Promise(function(_0x5be9fc,_0x85a96){return db[_0x227c('0x16')][_0x227c('0x17')](_0x4a9182['body'],{'raw':_0x4a9182[_0x227c('0x18')]?_0x4a9182[_0x227c('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x227c('0xb')](function(_0x5ea6f9){logger['info'](_0x227c('0x19'),_0x4a9182);logger[_0x227c('0xf')](_0x227c('0x19'),_0x4a9182,JSON[_0x227c('0x10')](_0x5ea6f9));_0x5be9fc(_0x5ea6f9);})[_0x227c('0x15')](function(_0x168954){logger['error'](_0x227c('0x19'),_0x168954[_0x227c('0x13')],_0x4a9182);_0x85a96(_0x2dd773['error'](0x1f4,_0x168954[_0x227c('0x13')]));});});};exports[_0x227c('0x1a')]=function(_0x53bcbb){var _0x867772=this;return new Promise(function(_0x3b5cf0,_0x43c879){return db[_0x227c('0x16')][_0x227c('0x1b')](_0x53bcbb[_0x227c('0x1c')],{'raw':_0x53bcbb[_0x227c('0x18')]?_0x53bcbb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53bcbb['options']?_0x53bcbb['options'][_0x227c('0x1d')]||null:null,'attributes':_0x53bcbb['options']?_0x53bcbb[_0x227c('0x18')]['attributes']||null:null,'limit':_0x53bcbb[_0x227c('0x18')]?_0x53bcbb[_0x227c('0x18')][_0x227c('0x1e')]||null:null})[_0x227c('0xb')](function(_0x2f7b23){logger[_0x227c('0xc')](_0x227c('0x1a'),_0x53bcbb);logger[_0x227c('0xf')](_0x227c('0x1a'),_0x53bcbb,JSON['stringify'](_0x2f7b23));_0x3b5cf0(_0x2f7b23);})[_0x227c('0x15')](function(_0x458a6a){logger[_0x227c('0x11')](_0x227c('0x1a'),_0x458a6a[_0x227c('0x13')],_0x53bcbb);_0x43c879(_0x867772['error'](0x1f4,_0x458a6a[_0x227c('0x13')]));});});}; \ No newline at end of file +var _0x8748=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','body','options','raw','catch','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c7bbd,_0x5617f9){var _0x38e260=function(_0x538771){while(--_0x538771){_0x4c7bbd['push'](_0x4c7bbd['shift']());}};_0x38e260(++_0x5617f9);}(_0x8748,0x9e));var _0x8874=function(_0x471cfd,_0xe74c8c){_0x471cfd=_0x471cfd-0x0;var _0x12cf40=_0x8748[_0x471cfd];return _0x12cf40;};'use strict';var _=require(_0x8874('0x0'));var util=require(_0x8874('0x1'));var moment=require(_0x8874('0x2'));var BPromise=require(_0x8874('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8874('0x4'));var db=require(_0x8874('0x5'))['db'];var utils=require(_0x8874('0x6'));var logger=require(_0x8874('0x7'))(_0x8874('0x8'));var config=require(_0x8874('0x9'));var jayson=require(_0x8874('0xa'));var client=jayson['client'][_0x8874('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b372a,_0x1f57b3,_0x482f29){return new BPromise(function(_0x548467,_0x424872){return client['request'](_0x5b372a,_0x482f29)[_0x8874('0xc')](function(_0x21b54d){logger[_0x8874('0xd')](_0x8874('0xe'),_0x1f57b3,_0x8874('0xf'));logger[_0x8874('0x10')](_0x8874('0x11'),_0x1f57b3,_0x8874('0xf'),JSON[_0x8874('0x12')](_0x21b54d));if(_0x21b54d[_0x8874('0x13')]){if(_0x21b54d[_0x8874('0x13')][_0x8874('0x14')]===0x1f4){logger[_0x8874('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x424872(_0x21b54d['error'][_0x8874('0x15')]);}logger['error'](_0x8874('0xe'),_0x1f57b3,_0x21b54d[_0x8874('0x13')][_0x8874('0x15')]);return _0x548467(_0x21b54d[_0x8874('0x13')]['message']);}else{logger[_0x8874('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x1f57b3,_0x8874('0xf'));_0x548467(_0x21b54d[_0x8874('0x16')][_0x8874('0x15')]);}})['catch'](function(_0x1b0501){logger['error'](_0x8874('0xe'),_0x1f57b3,_0x1b0501);_0x424872(_0x1b0501);});});}exports[_0x8874('0x17')]=function(_0x1a1725){var _0x1e7138=this;return new Promise(function(_0x2122db,_0x484390){return db['ChatQueueReport'][_0x8874('0x18')](_0x1a1725[_0x8874('0x19')],{'raw':_0x1a1725[_0x8874('0x1a')]?_0x1a1725[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![]})[_0x8874('0xc')](function(_0x5e4552){logger[_0x8874('0xd')](_0x8874('0x17'),_0x1a1725);logger[_0x8874('0x10')]('CreateChatQueueReport',_0x1a1725,JSON[_0x8874('0x12')](_0x5e4552));_0x2122db(_0x5e4552);})[_0x8874('0x1c')](function(_0x18c03b){logger['error'](_0x8874('0x17'),_0x18c03b[_0x8874('0x15')],_0x1a1725);_0x484390(_0x1e7138[_0x8874('0x13')](0x1f4,_0x18c03b[_0x8874('0x15')]));});});};exports[_0x8874('0x1d')]=function(_0x55f589){var _0x38e938=this;return new Promise(function(_0x971726,_0x17665a){return db['ChatQueueReport'][_0x8874('0x1e')](_0x55f589['body'],{'raw':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f589['options']?_0x55f589[_0x8874('0x1a')][_0x8874('0x1f')]||null:null,'attributes':_0x55f589['options']?_0x55f589[_0x8874('0x1a')]['attributes']||null:null,'limit':_0x55f589[_0x8874('0x1a')]?_0x55f589[_0x8874('0x1a')][_0x8874('0x20')]||null:null})['then'](function(_0x4a80a6){logger[_0x8874('0xd')]('UpdateChatQueueReport',_0x55f589);logger[_0x8874('0x10')](_0x8874('0x1d'),_0x55f589,JSON[_0x8874('0x12')](_0x4a80a6));_0x971726(_0x4a80a6);})[_0x8874('0x1c')](function(_0x289b2d){logger[_0x8874('0x13')](_0x8874('0x1d'),_0x289b2d[_0x8874('0x15')],_0x55f589);_0x17665a(_0x38e938[_0x8874('0x13')](0x1f4,_0x289b2d[_0x8874('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 76fd442..f435140 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 _0xe31c=['index','/describe','describe','show','post','create','put','/:id','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x3a5a98,_0x5fa71e){var _0x10f6a4=function(_0x3ca66d){while(--_0x3ca66d){_0x3a5a98['push'](_0x3a5a98['shift']());}};_0x10f6a4(++_0x5fa71e);}(_0xe31c,0x172));var _0xce31=function(_0x4ac651,_0x597909){_0x4ac651=_0x4ac651-0x0;var _0x385d2f=_0xe31c[_0x4ac651];return _0x385d2f;};'use strict';var multer=require(_0xce31('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xce31('0x1'));var express=require(_0xce31('0x2'));var router=express[_0xce31('0x3')]();var fs_extra=require(_0xce31('0x4'));var auth=require(_0xce31('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xce31('0x6'));var controller=require(_0xce31('0x7'));router[_0xce31('0x8')]('/',auth[_0xce31('0x9')](),controller[_0xce31('0xa')]);router[_0xce31('0x8')](_0xce31('0xb'),auth[_0xce31('0x9')](),controller[_0xce31('0xc')]);router['get']('/:id',auth[_0xce31('0x9')](),controller[_0xce31('0xd')]);router[_0xce31('0xe')]('/',auth['isAuthenticated'](),controller[_0xce31('0xf')]);router[_0xce31('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xce31('0x11'),auth[_0xce31('0x9')](),controller[_0xce31('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9d47=['put','update','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create'];(function(_0x3423b0,_0x4eb7e8){var _0x4b13cf=function(_0x900ca7){while(--_0x900ca7){_0x3423b0['push'](_0x3423b0['shift']());}};_0x4b13cf(++_0x4eb7e8);}(_0x9d47,0xca));var _0x79d4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9d47[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0x79d4('0x0'));var util=require(_0x79d4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x79d4('0x2'));var auth=require(_0x79d4('0x3'));var interaction=require(_0x79d4('0x4'));var config=require(_0x79d4('0x5'));var controller=require(_0x79d4('0x6'));router[_0x79d4('0x7')]('/',auth['isAuthenticated'](),controller[_0x79d4('0x8')]);router['get'](_0x79d4('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0xb')]);router[_0x79d4('0xc')]('/',auth[_0x79d4('0xa')](),controller[_0x79d4('0xd')]);router[_0x79d4('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x79d4('0xf')]);router['delete']('/:id',auth[_0x79d4('0xa')](),controller[_0x79d4('0x10')]);module[_0x79d4('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index dc20421..cc31e85 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2430de,_0x40394d){var _0x30d356=function(_0x2cd79d){while(--_0x2cd79d){_0x2430de['push'](_0x2430de['shift']());}};_0x30d356(++_0x40394d);}(_0x34e8,0x12c));var _0x834e=function(_0xcdf282,_0x47bdba){_0xcdf282=_0xcdf282-0x0;var _0x2b7648=_0x34e8[_0xcdf282];return _0x2b7648;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x80d246,_0x167b6a){_0x80d246=_0x80d246-0x0;var _0x45ee56=_0xb43b[_0x80d246];return _0x45ee56;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index c1aad9d..67129a1 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 _0xc7f1=['then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','save','update'];(function(_0x348749,_0x5c3920){var _0x5b3a56=function(_0x34f37d){while(--_0x34f37d){_0x348749['push'](_0x348749['shift']());}};_0x5b3a56(++_0x5c3920);}(_0xc7f1,0x166));var _0x1c7f=function(_0x5a5633,_0x5cd289){_0x5a5633=_0x5a5633-0x0;var _0x49138e=_0xc7f1[_0x5a5633];return _0x49138e;};'use strict';var emlformat=require(_0x1c7f('0x0'));var rimraf=require(_0x1c7f('0x1'));var zipdir=require(_0x1c7f('0x2'));var jsonpatch=require(_0x1c7f('0x3'));var rp=require(_0x1c7f('0x4'));var moment=require(_0x1c7f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c7f('0x6'));var path=require(_0x1c7f('0x7'));var sox=require(_0x1c7f('0x8'));var csv=require(_0x1c7f('0x9'));var ejs=require(_0x1c7f('0xa'));var fs=require('fs');var fs_extra=require(_0x1c7f('0xb'));var _=require(_0x1c7f('0xc'));var squel=require('squel');var crypto=require(_0x1c7f('0xd'));var jsforce=require(_0x1c7f('0xe'));var deskjs=require(_0x1c7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1c7f('0x10'));var Papa=require(_0x1c7f('0x11'));var Redis=require(_0x1c7f('0x12'));var authService=require(_0x1c7f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1c7f('0x14'));var hardwareService=require(_0x1c7f('0x15'));var logger=require(_0x1c7f('0x16'))(_0x1c7f('0x17'));var utils=require('../../config/utils');var config=require(_0x1c7f('0x18'));var licenseUtil=require(_0x1c7f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x376b06,_0x50fe13){_0x50fe13=_0x50fe13||0xcc;return function(_0x2e6c3a){if(_0x2e6c3a){return _0x376b06[_0x1c7f('0x1a')](_0x50fe13);}return _0x376b06[_0x1c7f('0x1b')](_0x50fe13)['end']();};}function respondWithResult(_0x6a3400,_0x5b6f46){_0x5b6f46=_0x5b6f46||0xc8;return function(_0x1ffb07){if(_0x1ffb07){return _0x6a3400[_0x1c7f('0x1b')](_0x5b6f46)[_0x1c7f('0x1c')](_0x1ffb07);}};}function respondWithFilteredResult(_0x380614,_0x3ed59a){return function(_0x2e836a){if(_0x2e836a){var _0x21aa19=typeof _0x3ed59a['offset']==='undefined'&&typeof _0x3ed59a[_0x1c7f('0x1d')]===_0x1c7f('0x1e');var _0x2e3fa0=_0x2e836a[_0x1c7f('0x1f')];var _0xc3de62=_0x21aa19?0x0:_0x3ed59a[_0x1c7f('0x20')];var _0x1733d6=_0x21aa19?_0x2e836a[_0x1c7f('0x1f')]:_0x3ed59a[_0x1c7f('0x20')]+_0x3ed59a[_0x1c7f('0x1d')];var _0x3c6e82;if(_0x1733d6>=_0x2e3fa0){_0x1733d6=_0x2e3fa0;_0x3c6e82=0xc8;}else{_0x3c6e82=0xce;}_0x380614['status'](_0x3c6e82);return _0x380614[_0x1c7f('0x21')](_0x1c7f('0x22'),_0xc3de62+'-'+_0x1733d6+'/'+_0x2e3fa0)[_0x1c7f('0x1c')](_0x2e836a);}return null;};}function patchUpdates(_0x3c2993){return function(_0xcb5170){try{jsonpatch['apply'](_0xcb5170,_0x3c2993,!![]);}catch(_0x11cc5f){return BPromise['reject'](_0x11cc5f);}return _0xcb5170[_0x1c7f('0x23')]();};}function saveUpdates(_0x27ff1c,_0x33a89c){return function(_0x535669){if(_0x535669){return _0x535669[_0x1c7f('0x24')](_0x27ff1c)[_0x1c7f('0x25')](function(_0x3f83e4){return _0x3f83e4;});}return null;};}function removeEntity(_0xb02b2e,_0x2730ac){return function(_0x1e7377){if(_0x1e7377){return _0x1e7377[_0x1c7f('0x26')]()['then'](function(){_0xb02b2e[_0x1c7f('0x1b')](0xcc)[_0x1c7f('0x27')]();});}};}function handleEntityNotFound(_0x461907,_0x348e4a){return function(_0x499290){if(!_0x499290){_0x461907[_0x1c7f('0x1a')](0x194);}return _0x499290;};}function handleError(_0x544bdb,_0x468e25){_0x468e25=_0x468e25||0x1f4;return function(_0x3dda6d){logger[_0x1c7f('0x28')](_0x3dda6d[_0x1c7f('0x29')]);if(_0x3dda6d[_0x1c7f('0x2a')]){delete _0x3dda6d[_0x1c7f('0x2a')];}_0x544bdb[_0x1c7f('0x1b')](_0x468e25)[_0x1c7f('0x2b')](_0x3dda6d);};}exports[_0x1c7f('0x2c')]=function(_0x1cbf77,_0x2bb7c5){var _0x5a13ec={},_0x3cfd21={},_0x2cbe42={'count':0x0,'rows':[]};var _0x362b84=_[_0x1c7f('0x2d')](db[_0x1c7f('0x2e')][_0x1c7f('0x2f')],function(_0x3419a2){return{'name':_0x3419a2[_0x1c7f('0x30')],'type':_0x3419a2[_0x1c7f('0x31')][_0x1c7f('0x32')]};});_0x3cfd21['model']=_[_0x1c7f('0x2d')](_0x362b84,_0x1c7f('0x2a'));_0x3cfd21[_0x1c7f('0x33')]=_[_0x1c7f('0x34')](_0x1cbf77['query']);_0x3cfd21[_0x1c7f('0x35')]=_[_0x1c7f('0x36')](_0x3cfd21[_0x1c7f('0x37')],_0x3cfd21['query']);_0x5a13ec[_0x1c7f('0x38')]=_[_0x1c7f('0x36')](_0x3cfd21[_0x1c7f('0x37')],qs[_0x1c7f('0x39')](_0x1cbf77[_0x1c7f('0x33')][_0x1c7f('0x39')]));_0x5a13ec[_0x1c7f('0x38')]=_0x5a13ec['attributes'][_0x1c7f('0x3a')]?_0x5a13ec[_0x1c7f('0x38')]:_0x3cfd21[_0x1c7f('0x37')];if(!_0x1cbf77['query'][_0x1c7f('0x3b')](_0x1c7f('0x3c'))){_0x5a13ec[_0x1c7f('0x1d')]=qs[_0x1c7f('0x1d')](_0x1cbf77['query'][_0x1c7f('0x1d')]);_0x5a13ec[_0x1c7f('0x20')]=qs['offset'](_0x1cbf77[_0x1c7f('0x33')]['offset']);}_0x5a13ec[_0x1c7f('0x3d')]=qs[_0x1c7f('0x3e')](_0x1cbf77[_0x1c7f('0x33')]['sort']);_0x5a13ec[_0x1c7f('0x3f')]=qs[_0x1c7f('0x35')](_[_0x1c7f('0x40')](_0x1cbf77[_0x1c7f('0x33')],_0x3cfd21[_0x1c7f('0x35')]),_0x362b84);if(_0x1cbf77[_0x1c7f('0x33')][_0x1c7f('0x41')]){_0x5a13ec[_0x1c7f('0x3f')]=_['merge'](_0x5a13ec[_0x1c7f('0x3f')],{'$or':_[_0x1c7f('0x2d')](_0x362b84,function(_0x336155){if(_0x336155[_0x1c7f('0x31')]!=='VIRTUAL'){var _0x4db0b5={};_0x4db0b5[_0x336155[_0x1c7f('0x2a')]]={'$like':'%'+_0x1cbf77['query']['filter']+'%'};return _0x4db0b5;}})});}_0x5a13ec=_[_0x1c7f('0x42')]({},_0x5a13ec,_0x1cbf77[_0x1c7f('0x43')]);var _0x3b4316={'where':_0x5a13ec[_0x1c7f('0x3f')]};return db[_0x1c7f('0x2e')][_0x1c7f('0x1f')](_0x3b4316)[_0x1c7f('0x25')](function(_0x535c58){_0x2cbe42[_0x1c7f('0x1f')]=_0x535c58;if(_0x1cbf77[_0x1c7f('0x33')][_0x1c7f('0x44')]){_0x5a13ec['include']=[{'all':!![]}];}return db[_0x1c7f('0x2e')][_0x1c7f('0x45')](_0x5a13ec);})[_0x1c7f('0x25')](function(_0x1e6e8c){_0x2cbe42[_0x1c7f('0x46')]=_0x1e6e8c;return _0x2cbe42;})[_0x1c7f('0x25')](respondWithFilteredResult(_0x2bb7c5,_0x5a13ec))[_0x1c7f('0x47')](handleError(_0x2bb7c5,null));};exports[_0x1c7f('0x48')]=function(_0x68c375,_0x3c6f50){var _0x19c312={'raw':!![],'where':{'id':_0x68c375[_0x1c7f('0x49')]['id']}},_0x535eeb={};_0x535eeb[_0x1c7f('0x37')]=_[_0x1c7f('0x34')](db[_0x1c7f('0x2e')][_0x1c7f('0x2f')]);_0x535eeb[_0x1c7f('0x33')]=_['keys'](_0x68c375[_0x1c7f('0x33')]);_0x535eeb[_0x1c7f('0x35')]=_[_0x1c7f('0x36')](_0x535eeb[_0x1c7f('0x37')],_0x535eeb[_0x1c7f('0x33')]);_0x19c312['attributes']=_[_0x1c7f('0x36')](_0x535eeb[_0x1c7f('0x37')],qs[_0x1c7f('0x39')](_0x68c375['query'][_0x1c7f('0x39')]));_0x19c312['attributes']=_0x19c312[_0x1c7f('0x38')][_0x1c7f('0x3a')]?_0x19c312[_0x1c7f('0x38')]:_0x535eeb[_0x1c7f('0x37')];if(_0x68c375[_0x1c7f('0x33')][_0x1c7f('0x44')]){_0x19c312[_0x1c7f('0x4a')]=[{'all':!![]}];}_0x19c312=_['merge']({},_0x19c312,_0x68c375[_0x1c7f('0x43')]);return db[_0x1c7f('0x2e')][_0x1c7f('0x4b')](_0x19c312)[_0x1c7f('0x25')](handleEntityNotFound(_0x3c6f50,null))[_0x1c7f('0x25')](respondWithResult(_0x3c6f50,null))[_0x1c7f('0x47')](handleError(_0x3c6f50,null));};exports[_0x1c7f('0x4c')]=function(_0x2fea85,_0x2434df){return db[_0x1c7f('0x2e')][_0x1c7f('0x4c')](_0x2fea85[_0x1c7f('0x4d')],{})[_0x1c7f('0x25')](respondWithResult(_0x2434df,0xc9))[_0x1c7f('0x47')](handleError(_0x2434df,null));};exports['update']=function(_0x4f473c,_0x3ea72b){if(_0x4f473c[_0x1c7f('0x4d')]['id']){delete _0x4f473c[_0x1c7f('0x4d')]['id'];}return db[_0x1c7f('0x2e')][_0x1c7f('0x4b')]({'where':{'id':_0x4f473c['params']['id']}})['then'](handleEntityNotFound(_0x3ea72b,null))[_0x1c7f('0x25')](saveUpdates(_0x4f473c['body'],null))[_0x1c7f('0x25')](respondWithResult(_0x3ea72b,null))[_0x1c7f('0x47')](handleError(_0x3ea72b,null));};exports[_0x1c7f('0x26')]=function(_0x1d0d8f,_0x1552f1){return db[_0x1c7f('0x2e')]['find']({'where':{'id':_0x1d0d8f[_0x1c7f('0x49')]['id']}})['then'](handleEntityNotFound(_0x1552f1,null))[_0x1c7f('0x25')](removeEntity(_0x1552f1,null))[_0x1c7f('0x47')](handleError(_0x1552f1,null));};exports[_0x1c7f('0x4e')]=function(_0x1643ed,_0x52700f){return db[_0x1c7f('0x2e')][_0x1c7f('0x4e')]()[_0x1c7f('0x25')](respondWithResult(_0x52700f,null))[_0x1c7f('0x47')](handleError(_0x52700f,null));}; \ No newline at end of file +var _0xeb5d=['merge','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','stack','name','send','map','ChatTransferReport','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include'];(function(_0x44d8d1,_0x2a600e){var _0x5babcf=function(_0x5ae877){while(--_0x5ae877){_0x44d8d1['push'](_0x44d8d1['shift']());}};_0x5babcf(++_0x2a600e);}(_0xeb5d,0x126));var _0xdeb5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xeb5d[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdeb5('0x1'));var rp=require(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeb5('0x4'));var util=require(_0xdeb5('0x5'));var path=require(_0xdeb5('0x6'));var sox=require(_0xdeb5('0x7'));var csv=require(_0xdeb5('0x8'));var ejs=require(_0xdeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xdeb5('0xa'));var _=require(_0xdeb5('0xb'));var squel=require(_0xdeb5('0xc'));var crypto=require('crypto');var jsforce=require(_0xdeb5('0xd'));var deskjs=require(_0xdeb5('0xe'));var toCsv=require(_0xdeb5('0x8'));var querystring=require(_0xdeb5('0xf'));var Papa=require(_0xdeb5('0x10'));var Redis=require(_0xdeb5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdeb5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdeb5('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdeb5('0x14'));var db=require(_0xdeb5('0x15'))['db'];function respondWithStatusCode(_0x5d918f,_0x52af87){_0x52af87=_0x52af87||0xcc;return function(_0x5999b0){if(_0x5999b0){return _0x5d918f[_0xdeb5('0x16')](_0x52af87);}return _0x5d918f[_0xdeb5('0x17')](_0x52af87)[_0xdeb5('0x18')]();};}function respondWithResult(_0x1cd6d0,_0x177a38){_0x177a38=_0x177a38||0xc8;return function(_0x1a653d){if(_0x1a653d){return _0x1cd6d0[_0xdeb5('0x17')](_0x177a38)['json'](_0x1a653d);}};}function respondWithFilteredResult(_0x10a162,_0x5bc7b8){return function(_0x48f79c){if(_0x48f79c){var _0x27ceb4=typeof _0x5bc7b8[_0xdeb5('0x19')]===_0xdeb5('0x1a')&&typeof _0x5bc7b8[_0xdeb5('0x1b')]===_0xdeb5('0x1a');var _0x451bc0=_0x48f79c[_0xdeb5('0x1c')];var _0x4cb8d6=_0x27ceb4?0x0:_0x5bc7b8[_0xdeb5('0x19')];var _0x2256a8=_0x27ceb4?_0x48f79c[_0xdeb5('0x1c')]:_0x5bc7b8[_0xdeb5('0x19')]+_0x5bc7b8[_0xdeb5('0x1b')];var _0x2f3cba;if(_0x2256a8>=_0x451bc0){_0x2256a8=_0x451bc0;_0x2f3cba=0xc8;}else{_0x2f3cba=0xce;}_0x10a162[_0xdeb5('0x17')](_0x2f3cba);return _0x10a162[_0xdeb5('0x1d')](_0xdeb5('0x1e'),_0x4cb8d6+'-'+_0x2256a8+'/'+_0x451bc0)['json'](_0x48f79c);}return null;};}function patchUpdates(_0x396e62){return function(_0xc83d89){try{jsonpatch['apply'](_0xc83d89,_0x396e62,!![]);}catch(_0x3ae0d5){return BPromise[_0xdeb5('0x1f')](_0x3ae0d5);}return _0xc83d89[_0xdeb5('0x20')]();};}function saveUpdates(_0x367d18,_0x43f779){return function(_0x5ece08){if(_0x5ece08){return _0x5ece08['update'](_0x367d18)['then'](function(_0x2aeb30){return _0x2aeb30;});}return null;};}function removeEntity(_0x581e5b,_0x552295){return function(_0xd0405e){if(_0xd0405e){return _0xd0405e[_0xdeb5('0x21')]()[_0xdeb5('0x22')](function(){_0x581e5b['status'](0xcc)[_0xdeb5('0x18')]();});}};}function handleEntityNotFound(_0x38e285,_0x40aaf5){return function(_0x449638){if(!_0x449638){_0x38e285[_0xdeb5('0x16')](0x194);}return _0x449638;};}function handleError(_0xec0fc0,_0x4a0cda){_0x4a0cda=_0x4a0cda||0x1f4;return function(_0xe51ce4){logger['error'](_0xe51ce4[_0xdeb5('0x23')]);if(_0xe51ce4['name']){delete _0xe51ce4[_0xdeb5('0x24')];}_0xec0fc0[_0xdeb5('0x17')](_0x4a0cda)[_0xdeb5('0x25')](_0xe51ce4);};}exports['index']=function(_0x223d5d,_0x334711){var _0x3000f8={},_0x1ad5be={},_0xc09c1e={'count':0x0,'rows':[]};var _0x3474ba=_[_0xdeb5('0x26')](db[_0xdeb5('0x27')]['rawAttributes'],function(_0x307970){return{'name':_0x307970[_0xdeb5('0x28')],'type':_0x307970['type'][_0xdeb5('0x29')]};});_0x1ad5be['model']=_['map'](_0x3474ba,'name');_0x1ad5be[_0xdeb5('0x2a')]=_['keys'](_0x223d5d['query']);_0x1ad5be[_0xdeb5('0x2b')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],_0x1ad5be['query']);_0x3000f8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x1ad5be[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x2f')]));_0x3000f8['attributes']=_0x3000f8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3000f8[_0xdeb5('0x2e')]:_0x1ad5be[_0xdeb5('0x2d')];if(!_0x223d5d[_0xdeb5('0x2a')]['hasOwnProperty'](_0xdeb5('0x31'))){_0x3000f8[_0xdeb5('0x1b')]=qs[_0xdeb5('0x1b')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x1b')]);_0x3000f8[_0xdeb5('0x19')]=qs[_0xdeb5('0x19')](_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x19')]);}_0x3000f8[_0xdeb5('0x32')]=qs[_0xdeb5('0x33')](_0x223d5d[_0xdeb5('0x2a')]['sort']);_0x3000f8[_0xdeb5('0x34')]=qs[_0xdeb5('0x2b')](_[_0xdeb5('0x35')](_0x223d5d[_0xdeb5('0x2a')],_0x1ad5be[_0xdeb5('0x2b')]),_0x3474ba);if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x36')]){_0x3000f8[_0xdeb5('0x34')]=_['merge'](_0x3000f8['where'],{'$or':_['map'](_0x3474ba,function(_0x2ce4ef){if(_0x2ce4ef[_0xdeb5('0x37')]!==_0xdeb5('0x38')){var _0x212d5d={};_0x212d5d[_0x2ce4ef['name']]={'$like':'%'+_0x223d5d['query'][_0xdeb5('0x36')]+'%'};return _0x212d5d;}})});}_0x3000f8=_['merge']({},_0x3000f8,_0x223d5d[_0xdeb5('0x39')]);var _0x16a4d2={'where':_0x3000f8[_0xdeb5('0x34')]};return db[_0xdeb5('0x27')][_0xdeb5('0x1c')](_0x16a4d2)[_0xdeb5('0x22')](function(_0xbb9e1a){_0xc09c1e[_0xdeb5('0x1c')]=_0xbb9e1a;if(_0x223d5d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3000f8['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xdeb5('0x3b')](_0x3000f8);})[_0xdeb5('0x22')](function(_0x19ac48){_0xc09c1e[_0xdeb5('0x3c')]=_0x19ac48;return _0xc09c1e;})['then'](respondWithFilteredResult(_0x334711,_0x3000f8))['catch'](handleError(_0x334711,null));};exports[_0xdeb5('0x3d')]=function(_0x11635d,_0x42aae6){var _0x3fc6e8={'raw':!![],'where':{'id':_0x11635d[_0xdeb5('0x3e')]['id']}},_0x73ab8a={};_0x73ab8a['model']=_[_0xdeb5('0x3f')](db[_0xdeb5('0x27')][_0xdeb5('0x40')]);_0x73ab8a['query']=_[_0xdeb5('0x3f')](_0x11635d[_0xdeb5('0x2a')]);_0x73ab8a['filters']=_['intersection'](_0x73ab8a[_0xdeb5('0x2d')],_0x73ab8a['query']);_0x3fc6e8[_0xdeb5('0x2e')]=_[_0xdeb5('0x2c')](_0x73ab8a[_0xdeb5('0x2d')],qs[_0xdeb5('0x2f')](_0x11635d['query'][_0xdeb5('0x2f')]));_0x3fc6e8[_0xdeb5('0x2e')]=_0x3fc6e8[_0xdeb5('0x2e')][_0xdeb5('0x30')]?_0x3fc6e8[_0xdeb5('0x2e')]:_0x73ab8a['model'];if(_0x11635d[_0xdeb5('0x2a')][_0xdeb5('0x3a')]){_0x3fc6e8[_0xdeb5('0x41')]=[{'all':!![]}];}_0x3fc6e8=_[_0xdeb5('0x42')]({},_0x3fc6e8,_0x11635d[_0xdeb5('0x39')]);return db[_0xdeb5('0x27')][_0xdeb5('0x43')](_0x3fc6e8)[_0xdeb5('0x22')](handleEntityNotFound(_0x42aae6,null))[_0xdeb5('0x22')](respondWithResult(_0x42aae6,null))['catch'](handleError(_0x42aae6,null));};exports['create']=function(_0x159b4f,_0x486ef1){return db['ChatTransferReport'][_0xdeb5('0x44')](_0x159b4f[_0xdeb5('0x45')],{})[_0xdeb5('0x22')](respondWithResult(_0x486ef1,0xc9))['catch'](handleError(_0x486ef1,null));};exports['update']=function(_0x792656,_0x33cb4f){if(_0x792656['body']['id']){delete _0x792656[_0xdeb5('0x45')]['id'];}return db['ChatTransferReport'][_0xdeb5('0x43')]({'where':{'id':_0x792656[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x33cb4f,null))['then'](saveUpdates(_0x792656[_0xdeb5('0x45')],null))[_0xdeb5('0x22')](respondWithResult(_0x33cb4f,null))[_0xdeb5('0x46')](handleError(_0x33cb4f,null));};exports[_0xdeb5('0x21')]=function(_0x5bbfcd,_0x5d0ea5){return db[_0xdeb5('0x27')][_0xdeb5('0x43')]({'where':{'id':_0x5bbfcd[_0xdeb5('0x3e')]['id']}})[_0xdeb5('0x22')](handleEntityNotFound(_0x5d0ea5,null))[_0xdeb5('0x22')](removeEntity(_0x5d0ea5,null))[_0xdeb5('0x46')](handleError(_0x5d0ea5,null));};exports[_0xdeb5('0x47')]=function(_0x20dc06,_0x369cd7){return db['ChatTransferReport'][_0xdeb5('0x47')]()[_0xdeb5('0x22')](respondWithResult(_0x369cd7,null))['catch'](handleError(_0x369cd7,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 731011b..10ae37a 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 _0xcd47=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xcd47,0x1de));var _0x7cd4=function(_0x333b9a,_0x14ce97){_0x333b9a=_0x333b9a-0x0;var _0x18670e=_0xcd47[_0x333b9a];return _0x18670e;};'use strict';var _=require(_0x7cd4('0x0'));var util=require(_0x7cd4('0x1'));var logger=require(_0x7cd4('0x2'))(_0x7cd4('0x3'));var moment=require(_0x7cd4('0x4'));var BPromise=require('bluebird');var rp=require(_0x7cd4('0x5'));var fs=require('fs');var path=require(_0x7cd4('0x6'));var rimraf=require(_0x7cd4('0x7'));var config=require(_0x7cd4('0x8'));var attributes=require(_0x7cd4('0x9'));module[_0x7cd4('0xa')]=function(_0x490c20,_0x2b9b83){return _0x490c20[_0x7cd4('0xb')]('ChatTransferReport',attributes,{'tableName':_0x7cd4('0xc'),'paranoid':![],'indexes':[{'name':_0x7cd4('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x82c3=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x170685,_0x51edfa){var _0x5a41d8=function(_0xb1ab45){while(--_0xb1ab45){_0x170685['push'](_0x170685['shift']());}};_0x5a41d8(++_0x51edfa);}(_0x82c3,0x1ba));var _0x382c=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x82c3[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x382c('0x0'));var util=require(_0x382c('0x1'));var logger=require(_0x382c('0x2'))(_0x382c('0x3'));var moment=require(_0x382c('0x4'));var BPromise=require(_0x382c('0x5'));var rp=require(_0x382c('0x6'));var fs=require('fs');var path=require(_0x382c('0x7'));var rimraf=require(_0x382c('0x8'));var config=require('../../config/environment');var attributes=require(_0x382c('0x9'));module[_0x382c('0xa')]=function(_0x3ac2ab,_0xc14b66){return _0x3ac2ab['define'](_0x382c('0xb'),attributes,{'tableName':_0x382c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x382c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index f5c5488..b285360 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 _0x4663=['stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x4663,0x159));var _0x3466=function(_0xf4acb,_0x38403b){_0xf4acb=_0xf4acb-0x0;var _0x1ae455=_0x4663[_0xf4acb];return _0x1ae455;};'use strict';var _=require(_0x3466('0x0'));var util=require(_0x3466('0x1'));var moment=require('moment');var BPromise=require(_0x3466('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3466('0x3'));var db=require(_0x3466('0x4'))['db'];var utils=require(_0x3466('0x5'));var logger=require(_0x3466('0x6'))(_0x3466('0x7'));var config=require(_0x3466('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3466('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x353c37,_0x4428d4,_0x248e33){return new BPromise(function(_0x4d7b22,_0x3143bc){return client['request'](_0x353c37,_0x248e33)[_0x3466('0xa')](function(_0x2ed402){logger[_0x3466('0xb')](_0x3466('0xc'),_0x4428d4,_0x3466('0xd'));logger['debug'](_0x3466('0xe'),_0x4428d4,'request\x20sent',JSON[_0x3466('0xf')](_0x2ed402));if(_0x2ed402[_0x3466('0x10')]){if(_0x2ed402[_0x3466('0x10')]['code']===0x1f4){logger[_0x3466('0x10')](_0x3466('0xc'),_0x4428d4,_0x2ed402[_0x3466('0x10')][_0x3466('0x11')]);return _0x3143bc(_0x2ed402['error'][_0x3466('0x11')]);}logger[_0x3466('0x10')](_0x3466('0xc'),_0x4428d4,_0x2ed402['error']['message']);return _0x4d7b22(_0x2ed402[_0x3466('0x10')][_0x3466('0x11')]);}else{logger[_0x3466('0xb')](_0x3466('0xc'),_0x4428d4,'request\x20sent');_0x4d7b22(_0x2ed402[_0x3466('0x12')][_0x3466('0x11')]);}})[_0x3466('0x13')](function(_0xb8ac77){logger['error'](_0x3466('0xc'),_0x4428d4,_0xb8ac77);_0x3143bc(_0xb8ac77);});});} \ No newline at end of file +var _0x382c=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x14545a,_0x1ed81d){var _0x17cd82=function(_0x318cf7){while(--_0x318cf7){_0x14545a['push'](_0x14545a['shift']());}};_0x17cd82(++_0x1ed81d);}(_0x382c,0x12a));var _0xc382=function(_0x320cf5,_0x4e437d){_0x320cf5=_0x320cf5-0x0;var _0xa77006=_0x382c[_0x320cf5];return _0xa77006;};'use strict';var _=require(_0xc382('0x0'));var util=require(_0xc382('0x1'));var moment=require(_0xc382('0x2'));var BPromise=require(_0xc382('0x3'));var rs=require(_0xc382('0x4'));var fs=require('fs');var Redis=require(_0xc382('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc382('0x6'));var logger=require(_0xc382('0x7'))(_0xc382('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc382('0x9')][_0xc382('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ad7a,_0x5a40dd,_0x481d88){return new BPromise(function(_0x2d3a86,_0x3fc1bc){return client[_0xc382('0xb')](_0x27ad7a,_0x481d88)[_0xc382('0xc')](function(_0x4ec866){logger['info'](_0xc382('0xd'),_0x5a40dd,_0xc382('0xe'));logger['debug'](_0xc382('0xf'),_0x5a40dd,_0xc382('0xe'),JSON['stringify'](_0x4ec866));if(_0x4ec866[_0xc382('0x10')]){if(_0x4ec866['error']['code']===0x1f4){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x3fc1bc(_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);}logger['error'](_0xc382('0xd'),_0x5a40dd,_0x4ec866[_0xc382('0x10')][_0xc382('0x11')]);return _0x2d3a86(_0x4ec866[_0xc382('0x10')]['message']);}else{logger[_0xc382('0x12')](_0xc382('0xd'),_0x5a40dd,'request\x20sent');_0x2d3a86(_0x4ec866[_0xc382('0x13')][_0xc382('0x11')]);}})[_0xc382('0x14')](function(_0x6a6e4b){logger[_0xc382('0x10')](_0xc382('0xd'),_0x5a40dd,_0x6a6e4b);_0x3fc1bc(_0x6a6e4b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 95b9c8a..867898a 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 _0xf4e7=['get','isAuthenticated','index','/describe','show','post','put','/:id','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x16f124,_0x49a016){var _0x38cb04=function(_0x126397){while(--_0x126397){_0x16f124['push'](_0x16f124['shift']());}};_0x38cb04(++_0x49a016);}(_0xf4e7,0x149));var _0x7f4e=function(_0x2318da,_0x4b0f98){_0x2318da=_0x2318da-0x0;var _0x14c397=_0xf4e7[_0x2318da];return _0x14c397;};'use strict';var multer=require(_0x7f4e('0x0'));var util=require(_0x7f4e('0x1'));var path=require(_0x7f4e('0x2'));var timeout=require(_0x7f4e('0x3'));var express=require(_0x7f4e('0x4'));var router=express[_0x7f4e('0x5')]();var fs_extra=require(_0x7f4e('0x6'));var auth=require(_0x7f4e('0x7'));var interaction=require(_0x7f4e('0x8'));var config=require(_0x7f4e('0x9'));var controller=require(_0x7f4e('0xa'));router[_0x7f4e('0xb')]('/',auth[_0x7f4e('0xc')](),controller[_0x7f4e('0xd')]);router[_0x7f4e('0xb')](_0x7f4e('0xe'),auth[_0x7f4e('0xc')](),controller['describe']);router[_0x7f4e('0xb')]('/:id',auth[_0x7f4e('0xc')](),controller[_0x7f4e('0xf')]);router[_0x7f4e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7f4e('0x11')](_0x7f4e('0x12'),auth['isAuthenticated'](),controller[_0x7f4e('0x13')]);router['delete'](_0x7f4e('0x12'),auth[_0x7f4e('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2ce0=['describe','get','/:id','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated'];(function(_0x5eb9d2,_0x2761a2){var _0xd3174b=function(_0x26fff7){while(--_0x26fff7){_0x5eb9d2['push'](_0x5eb9d2['shift']());}};_0xd3174b(++_0x2761a2);}(_0x2ce0,0x71));var _0x02ce=function(_0x5a9aed,_0x7ff498){_0x5a9aed=_0x5a9aed-0x0;var _0x58fc5d=_0x2ce0[_0x5a9aed];return _0x58fc5d;};'use strict';var multer=require(_0x02ce('0x0'));var util=require(_0x02ce('0x1'));var path=require(_0x02ce('0x2'));var timeout=require(_0x02ce('0x3'));var express=require(_0x02ce('0x4'));var router=express[_0x02ce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x02ce('0x6'));var interaction=require(_0x02ce('0x7'));var config=require(_0x02ce('0x8'));var controller=require(_0x02ce('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x02ce('0xa')]);router['get'](_0x02ce('0xb'),auth[_0x02ce('0xc')](),controller[_0x02ce('0xd')]);router[_0x02ce('0xe')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller['show']);router[_0x02ce('0x10')]('/',auth[_0x02ce('0xc')](),controller['create']);router[_0x02ce('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x02ce('0x12')](_0x02ce('0xf'),auth[_0x02ce('0xc')](),controller[_0x02ce('0x13')]);module[_0x02ce('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 77fe7ba..8dadf85 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 _0x6f7a=['Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x28931a,_0x461726){_0x28931a=_0x28931a-0x0;var _0x234c8e=_0x6f7a[_0x28931a];return _0x234c8e;};'use strict';var Sequelize=require(_0xa6f7('0x0'));var rs=require(_0xa6f7('0x1'));module[_0xa6f7('0x2')]={'name':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa6f7('0x4')},'description':{'type':Sequelize[_0xa6f7('0x3')]},'mapKey':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x5')},'mapKeyOffline':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x5')},'key':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x6')},'customerAlias':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa6f7('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa6f7('0xa')]('rounded',_0xa6f7('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0xc')},'start_chat_button':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xf')},'download_transcript':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa6f7('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x15')},'noteTitle':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x16')},'placeholderMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0xe')},'skipMessageButton':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0xa6f7('0x19'),_0xa6f7('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa6f7('0x1b')]({'items':[{'type':_0xa6f7('0x1c'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa6f7('0x1c'),'props':{'title':_0xa6f7('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xa6f7('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xa6f7('0x1d'))?JSON['parse'](this['getDataValue'](_0xa6f7('0x1d'))):{};},'set':function(_0x5efdce){return this[_0xa6f7('0x1e')](_0xa6f7('0x1d'),JSON[_0xa6f7('0x1b')](_0x5efdce));}},'offlineForm':{'type':Sequelize[_0xa6f7('0x12')],'defaultValue':function(){return JSON[_0xa6f7('0x1b')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa6f7('0x5'),'type':_0xa6f7('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa6f7('0x1f')},'props':{'title':_0xa6f7('0x1f'),'helpText':_0xa6f7('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xa6f7('0x21')](_0xa6f7('0x22'))?JSON[_0xa6f7('0x23')](this[_0xa6f7('0x21')](_0xa6f7('0x22'))):{};},'set':function(_0x57282e){return this[_0xa6f7('0x1e')](_0xa6f7('0x22'),JSON[_0xa6f7('0x1b')](_0x57282e));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xa6f7('0x24')]();}},'autoclose':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa6f7('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x25')},'waitingMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x28')},'skipUnmanaged':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x29')},'sendUnmanaged':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa6f7('0x12')]},'showAgentAvatar':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xa6f7('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x2b')},'verticalAlignment':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':_0xa6f7('0x2c')},'defaultTitle':{'type':Sequelize[_0xa6f7('0x3')]},'customerAvatar':{'type':Sequelize[_0xa6f7('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa6f7('0x10')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa6f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa6f7('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa6f7('0x2e')},'systemAvatar':{'type':Sequelize[_0xa6f7('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa6f7('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![],'comment':_0xa6f7('0x30'),'set':function(_0x14d532){if(!_0x14d532)this[_0xa6f7('0x1e')]('mandatoryDispositionPauseId',null);this[_0xa6f7('0x1e')](_0xa6f7('0x31'),_0x14d532);}},'vidaooEscalation':{'type':Sequelize[_0xa6f7('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa6f7('0x3')]},'vidaooTopic':{'type':Sequelize[_0xa6f7('0x3')],'allowNull':![],'defaultValue':_0xa6f7('0x32')},'vidaooNote':{'type':Sequelize[_0xa6f7('0x3')],'defaultValue':function(){return _0xa6f7('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa6f7('0x12')]}}; \ No newline at end of file +var _0x0bb5=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Feedback','star','input','text','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','stringify','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x0bb5,0x148));var _0x50bb=function(_0x424e05,_0x6c6e6a){_0x424e05=_0x424e05-0x0;var _0x2a3c50=_0x0bb5[_0x424e05];return _0x2a3c50;};'use strict';var Sequelize=require(_0x50bb('0x0'));var rs=require(_0x50bb('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'unique':_0x50bb('0x3')},'description':{'type':Sequelize[_0x50bb('0x2')]},'mapKey':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'mapKeyOffline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x4')},'key':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0xa'),_0x50bb('0xb')),'defaultValue':_0x50bb('0xa')},'header_online':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0xe')},'header_offline':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x50bb('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x14')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x15')},'placeholderMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x16')},'ratingType':{'type':Sequelize[_0x50bb('0x9')](_0x50bb('0x17'),'thumb'),'defaultValue':_0x50bb('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x50bb('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x50bb('0x19'),'required':!![]},'props':{'title':_0x50bb('0x1a'),'helpText':''}},{'type':_0x50bb('0x18'),'props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x50bb('0x1b'))?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x1b'))):{};},'set':function(_0x5234d7){return this[_0x50bb('0x1e')]('onlineForm',JSON['stringify'](_0x5234d7));}},'offlineForm':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x50bb('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x50bb('0x4'),'type':_0x50bb('0x4')},'variable':null},{'type':_0x50bb('0x1f'),'config':{'placeholder':_0x50bb('0x20')},'props':{'title':_0x50bb('0x20'),'helpText':_0x50bb('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x50bb('0x1d')]('offlineForm')?JSON[_0x50bb('0x1c')](this[_0x50bb('0x1d')](_0x50bb('0x22'))):{};},'set':function(_0x1b7c0f){return this['setDataValue'](_0x50bb('0x22'),JSON[_0x50bb('0x23')](_0x1b7c0f));}},'token':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return rs[_0x50bb('0x24')]();}},'autoclose':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x50bb('0x2')]},'forwardOffline':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x50bb('0x2')]},'waitingTitle':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x27')},'offlineMessageBody':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x29')},'skipUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x50bb('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x50bb('0x2')]},'notificationTemplate':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x50bb('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2c')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':_0x50bb('0x2d')},'defaultTitle':{'type':Sequelize[_0x50bb('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x50bb('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x50bb('0x2')],'allowNull':![],'defaultValue':_0x50bb('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x50bb('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50bb('0x7')],'comment':_0x50bb('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![],'comment':_0x50bb('0x31'),'set':function(_0x3a9fe4){if(!_0x3a9fe4)this[_0x50bb('0x1e')](_0x50bb('0x32'),null);this[_0x50bb('0x1e')](_0x50bb('0x33'),_0x3a9fe4);}},'vidaooEscalation':{'type':Sequelize[_0x50bb('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50bb('0x34')},'vidaooNote':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':function(){return _0x50bb('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x50bb('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x50bb('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c2b1f3d..6ccbde3 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 _0x0586=['ChatWebsiteId','findOne','Disposition','options','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','filename','file','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','headers','user-agent','getResult','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','Applications','applications','list','asc','account','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','from\x20is\x20mandatory','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','virtual','alignment','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','ejs','fs-extra','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ChatWebsite','includeAll','include','findAll','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition'];(function(_0xc5655,_0x23027d){var _0x6bf0a1=function(_0xe7426b){while(--_0xe7426b){_0xc5655['push'](_0xc5655['shift']());}};_0x6bf0a1(++_0x23027d);}(_0x0586,0xda));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x6058('0x0'));var Mustache=require(_0x6058('0x1'));var util=require('util');var path=require(_0x6058('0x2'));var ejs=require(_0x6058('0x3'));var fs=require('fs');var fs_extra=require(_0x6058('0x4'));var _=require(_0x6058('0x5'));var querystring=require(_0x6058('0x6'));var Redis=require('ioredis');var qs=require(_0x6058('0x7'));var logger=require(_0x6058('0x8'))(_0x6058('0x9'));var config=require(_0x6058('0xa'));var url=require(_0x6058('0xb'));var db=require(_0x6058('0xc'))['db'];config[_0x6058('0xd')]=_[_0x6058('0xe')](config[_0x6058('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x6058('0xf'))(new Redis(config[_0x6058('0xd')]));require(_0x6058('0x10'))[_0x6058('0x11')](socket);var htmlToText=require(_0x6058('0x12'));var jayson=require(_0x6058('0x13'));var client=jayson[_0x6058('0x14')][_0x6058('0x15')]({'port':0x232c});var client9002=jayson[_0x6058('0x14')][_0x6058('0x15')]({'port':0x232a});var client9003=jayson[_0x6058('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x6058('0x14')][_0x6058('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x1d791d,_0x221fad,_0x283892,_0x4d07b8){return new BPromise(function(_0xdf2af6,_0x5750b8){var _0xf1cb8d=_0x4d07b8||client;return _0xf1cb8d[_0x6058('0x16')](_0x1d791d,_0x283892)[_0x6058('0x17')](function(_0xfe3834){logger[_0x6058('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x221fad,_0x6058('0x19'));logger['debug'](_0x6058('0x1a'),_0x221fad,_0x6058('0x19'),JSON['stringify'](_0xfe3834));if(_0xfe3834['error']){if(_0xfe3834[_0x6058('0x1b')][_0x6058('0x1c')]===0x1f4){logger[_0x6058('0x1b')](_0x6058('0x1d'),_0x221fad,_0xfe3834[_0x6058('0x1b')][_0x6058('0x1e')]);return _0x5750b8(_0xfe3834[_0x6058('0x1b')][_0x6058('0x1e')]);}logger[_0x6058('0x1b')](_0x6058('0x1d'),_0x221fad,_0xfe3834['error'][_0x6058('0x1e')]);return _0xdf2af6(_0xfe3834[_0x6058('0x1b')][_0x6058('0x1e')]);}else{logger['info'](_0x6058('0x1d'),_0x221fad,_0x6058('0x19'));_0xdf2af6(_0xfe3834[_0x6058('0x1f')][_0x6058('0x1e')]);}})['catch'](function(_0x2478b0){logger[_0x6058('0x1b')](_0x6058('0x1d'),_0x221fad,_0x2478b0);_0x5750b8(_0x2478b0);});});}function respondWithStatusCode(_0x305fd7,_0x7d845c){_0x7d845c=_0x7d845c||0xcc;return function(_0x4a6a87){if(_0x4a6a87){return _0x305fd7[_0x6058('0x20')](_0x7d845c);}return _0x305fd7[_0x6058('0x21')](_0x7d845c)['end']();};}function respondWithResult(_0x525b89,_0x20cb1a){_0x20cb1a=_0x20cb1a||0xc8;return function(_0x175627){if(_0x175627){return _0x525b89[_0x6058('0x21')](_0x20cb1a)[_0x6058('0x22')](_0x175627);}};}function respondWithFilteredResult(_0x2aa57b,_0x5c4cd1){return function(_0x115d0c){if(_0x115d0c){var _0x55207e=typeof _0x5c4cd1[_0x6058('0x23')]==='undefined'&&typeof _0x5c4cd1[_0x6058('0x24')]===_0x6058('0x25');var _0x4e5182=_0x115d0c['count'];var _0x1c7d5d=_0x55207e?0x0:_0x5c4cd1[_0x6058('0x23')];var _0x2e6c41=_0x55207e?_0x115d0c[_0x6058('0x26')]:_0x5c4cd1['offset']+_0x5c4cd1['limit'];var _0x4a28cf;if(_0x2e6c41>=_0x4e5182){_0x2e6c41=_0x4e5182;_0x4a28cf=0xc8;}else{_0x4a28cf=0xce;}_0x2aa57b[_0x6058('0x21')](_0x4a28cf);return _0x2aa57b[_0x6058('0x27')](_0x6058('0x28'),_0x1c7d5d+'-'+_0x2e6c41+'/'+_0x4e5182)[_0x6058('0x22')](_0x115d0c);}return null;};}function saveUpdates(_0x497717){return function(_0x2d6f84){if(_0x2d6f84){return _0x2d6f84[_0x6058('0x29')](_0x497717)[_0x6058('0x17')](function(_0x5a5e97){return _0x5a5e97;});}return null;};}function removeEntity(_0xca52de){return function(_0x3d9103){if(_0x3d9103){return _0x3d9103[_0x6058('0x2a')]()[_0x6058('0x17')](function(){var _0x34c72e=_0x3d9103[_0x6058('0x2b')]({'plain':!![]});var _0x4bfcd8=_0x6058('0x2c');return db[_0x6058('0x2d')]['destroy']({'where':{'type':_0x4bfcd8,'resourceId':_0x34c72e['id']}})[_0x6058('0x17')](function(){return _0x3d9103;});})[_0x6058('0x17')](function(){_0xca52de['status'](0xcc)[_0x6058('0x2e')]();});}};}function handleEntityNotFound(_0x4d089b){return function(_0xb0b232){if(!_0xb0b232){_0x4d089b[_0x6058('0x20')](0x194);}return _0xb0b232;};}function handleError(_0x31d89e,_0x3808ee){_0x3808ee=_0x3808ee||0x1f4;return function(_0x140bc2){logger[_0x6058('0x1b')](_0x140bc2[_0x6058('0x2f')]);if(_0x140bc2[_0x6058('0x30')]){delete _0x140bc2[_0x6058('0x30')];}_0x31d89e[_0x6058('0x21')](_0x3808ee)['send'](_0x140bc2);};}exports[_0x6058('0x31')]=function(_0x1c5ac3,_0x134382){var _0x3e9184={'include':[{'model':db[_0x6058('0x32')],'as':_0x6058('0x33')}]},_0x16ad2e={},_0x3d7ea1={'count':0x0,'rows':[]};var _0x4e8718=_[_0x6058('0x34')](db['ChatWebsite'][_0x6058('0x35')],function(_0x145b53){return{'name':_0x145b53['fieldName'],'type':_0x145b53[_0x6058('0x36')][_0x6058('0x37')]};});_0x16ad2e['model']=_['map'](_0x4e8718,_0x6058('0x30'));_0x16ad2e[_0x6058('0x38')]=_[_0x6058('0x39')](_0x1c5ac3[_0x6058('0x38')]);_0x16ad2e[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x16ad2e[_0x6058('0x3c')],_0x16ad2e[_0x6058('0x38')]);_0x3e9184[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x16ad2e[_0x6058('0x3c')],qs[_0x6058('0x3e')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x3e')]));_0x3e9184[_0x6058('0x3d')]=_0x3e9184[_0x6058('0x3d')][_0x6058('0x3f')]?_0x3e9184[_0x6058('0x3d')]:_0x16ad2e['model'];if(!_0x1c5ac3[_0x6058('0x38')][_0x6058('0x40')](_0x6058('0x41'))){_0x3e9184[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x24')]);_0x3e9184['offset']=qs[_0x6058('0x23')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x23')]);}_0x3e9184[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x1c5ac3[_0x6058('0x38')][_0x6058('0x43')]);_0x3e9184[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x1c5ac3[_0x6058('0x38')],_0x16ad2e[_0x6058('0x3a')]),_0x4e8718);if(_0x1c5ac3[_0x6058('0x38')]['filter']){_0x3e9184[_0x6058('0x44')]=_[_0x6058('0x46')](_0x3e9184[_0x6058('0x44')],{'$or':_['map'](_0x4e8718,function(_0x145155){if(_0x145155[_0x6058('0x36')]!==_0x6058('0x47')){var _0x26a090={};_0x26a090[_0x145155[_0x6058('0x30')]]={'$like':'%'+_0x1c5ac3[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x26a090;}})});}_0x3e9184=_[_0x6058('0x46')]({},_0x3e9184,_0x1c5ac3['options']);var _0x1f977d={'where':_0x3e9184[_0x6058('0x44')]};return db[_0x6058('0x49')]['count'](_0x1f977d)[_0x6058('0x17')](function(_0x410255){_0x3d7ea1[_0x6058('0x26')]=_0x410255;if(_0x1c5ac3[_0x6058('0x38')][_0x6058('0x4a')]){_0x3e9184[_0x6058('0x4b')]=[{'all':!![]}];}return db[_0x6058('0x49')][_0x6058('0x4c')](_0x3e9184);})['then'](function(_0x19a636){_0x3d7ea1[_0x6058('0x4d')]=_0x19a636;return _0x3d7ea1;})[_0x6058('0x17')](respondWithFilteredResult(_0x134382,_0x3e9184))['catch'](handleError(_0x134382,null));};exports['show']=function(_0x273eff,_0x119fac){var _0x3c3a65={'raw':![],'where':{'id':_0x273eff[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x32')],'as':_0x6058('0x33')}]},_0x4bb10f={};_0x4bb10f[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0x49')][_0x6058('0x35')]);_0x4bb10f['query']=_[_0x6058('0x39')](_0x273eff[_0x6058('0x38')]);_0x4bb10f['filters']=_[_0x6058('0x3b')](_0x4bb10f['model'],_0x4bb10f[_0x6058('0x38')]);_0x3c3a65[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x4bb10f['model'],qs['fields'](_0x273eff[_0x6058('0x38')][_0x6058('0x3e')]));_0x3c3a65[_0x6058('0x3d')]=_0x3c3a65[_0x6058('0x3d')][_0x6058('0x3f')]?_0x3c3a65[_0x6058('0x3d')]:_0x4bb10f[_0x6058('0x3c')];if(_0x273eff['query'][_0x6058('0x4a')]){_0x3c3a65['include']=[{'all':!![]}];}_0x3c3a65=_['merge']({},_0x3c3a65,_0x273eff['options']);return db[_0x6058('0x49')][_0x6058('0x4f')](_0x3c3a65)[_0x6058('0x17')](handleEntityNotFound(_0x119fac,null))[_0x6058('0x17')](respondWithResult(_0x119fac,null))[_0x6058('0x50')](handleError(_0x119fac,null));};exports[_0x6058('0x51')]=function(_0x31bfcc,_0x2e79c3){return db['ChatWebsite']['create'](_0x31bfcc[_0x6058('0x52')],{})[_0x6058('0x17')](function(_0x38d32c){var _0x27e9d9=_0x31bfcc['user'][_0x6058('0x2b')]({'plain':!![]});if(!_0x27e9d9)throw new Error(_0x6058('0x53'));if(_0x27e9d9[_0x6058('0x54')]===_0x6058('0x55')){var _0xfc3bb=_0x38d32c[_0x6058('0x2b')]({'plain':!![]});var _0x15f078=_0x6058('0x2c');return db[_0x6058('0x56')]['find']({'where':{'name':_0x15f078,'userProfileId':_0x27e9d9[_0x6058('0x57')]},'raw':!![]})[_0x6058('0x17')](function(_0x2f0e03){if(_0x2f0e03&&_0x2f0e03[_0x6058('0x58')]===0x0){return db[_0x6058('0x2d')][_0x6058('0x51')]({'name':_0xfc3bb[_0x6058('0x30')],'resourceId':_0xfc3bb['id'],'type':_0x2f0e03[_0x6058('0x30')],'sectionId':_0x2f0e03['id']},{})[_0x6058('0x17')](function(){return _0x38d32c;});}else{return _0x38d32c;}})[_0x6058('0x50')](function(_0x5cb5da){logger[_0x6058('0x1b')](_0x6058('0x59'),_0x5cb5da);throw _0x5cb5da;});}return _0x38d32c;})[_0x6058('0x17')](respondWithResult(_0x2e79c3,0xc9))['catch'](handleError(_0x2e79c3,null));};exports[_0x6058('0x29')]=function(_0x2fb1fe,_0x2702c3){if(_0x2fb1fe[_0x6058('0x52')]['id']){delete _0x2fb1fe[_0x6058('0x52')]['id'];}return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x2fb1fe[_0x6058('0x4e')]['id']},'include':[{'model':db['Pause'],'as':_0x6058('0x33')}]})[_0x6058('0x17')](handleEntityNotFound(_0x2702c3,null))['then'](saveUpdates(_0x2fb1fe['body'],null))[_0x6058('0x17')](respondWithResult(_0x2702c3,null))['catch'](handleError(_0x2702c3,null));};exports[_0x6058('0x2a')]=function(_0x184a5a,_0x2ed82b){return db[_0x6058('0x49')]['find']({'where':{'id':_0x184a5a[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2ed82b,null))[_0x6058('0x17')](removeEntity(_0x2ed82b,null))[_0x6058('0x50')](handleError(_0x2ed82b,null));};exports[_0x6058('0x5a')]=function(_0x50d0cd,_0x50338a){return db[_0x6058('0x49')][_0x6058('0x5a')]()['then'](respondWithResult(_0x50338a,null))[_0x6058('0x50')](handleError(_0x50338a,null));};exports[_0x6058('0x5b')]=function(_0xf3616b,_0x1f23bb){if(_0xf3616b['body']['id']){delete _0xf3616b[_0x6058('0x52')]['id'];}return db[_0x6058('0x49')]['find']({'where':{'id':_0xf3616b['params']['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x1f23bb,null))[_0x6058('0x17')](function(_0x29ed84){if(_0x29ed84){_0xf3616b[_0x6058('0x52')][_0x6058('0x5c')]=_0x29ed84['id'];return db['Disposition'][_0x6058('0x51')](_0xf3616b[_0x6058('0x52')]);}})[_0x6058('0x17')](respondWithResult(_0x1f23bb,null))[_0x6058('0x50')](handleError(_0x1f23bb,null));};exports['getDispositions']=function(_0x35f410,_0x520a3d){var _0x233833={'raw':![],'where':{}};var _0x27ccff={};var _0x288787={'count':0x0,'rows':[]};return db[_0x6058('0x49')][_0x6058('0x5d')]({'where':{'id':_0x35f410['params']['id']}})['then'](handleEntityNotFound(_0x520a3d,null))[_0x6058('0x17')](function(_0x13e74a){if(_0x13e74a){_0x27ccff[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0x5e')][_0x6058('0x35')]);_0x27ccff['query']=_['keys'](_0x35f410[_0x6058('0x38')]);_0x27ccff[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x27ccff[_0x6058('0x3c')],_0x27ccff[_0x6058('0x38')]);_0x233833[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x27ccff[_0x6058('0x3c')],qs[_0x6058('0x3e')](_0x35f410[_0x6058('0x38')][_0x6058('0x3e')]));_0x233833[_0x6058('0x3d')]=_0x233833[_0x6058('0x3d')][_0x6058('0x3f')]?_0x233833[_0x6058('0x3d')]:_0x27ccff['model'];if(!_0x35f410[_0x6058('0x38')]['hasOwnProperty'](_0x6058('0x41'))){_0x233833[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x35f410[_0x6058('0x38')][_0x6058('0x24')]);_0x233833[_0x6058('0x23')]=qs[_0x6058('0x23')](_0x35f410[_0x6058('0x38')][_0x6058('0x23')]);}_0x233833[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x35f410[_0x6058('0x38')][_0x6058('0x43')]);_0x233833[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x35f410[_0x6058('0x38')],_0x27ccff[_0x6058('0x3a')]));_0x233833[_0x6058('0x44')]['ChatWebsiteId']=_0x13e74a['id'];if(_0x35f410[_0x6058('0x38')][_0x6058('0x48')]){_0x233833[_0x6058('0x44')]=_[_0x6058('0x46')](_0x233833[_0x6058('0x44')],{'$or':_['map'](_0x233833[_0x6058('0x3d')],function(_0x31cd0d){var _0x2025c1={};_0x2025c1[_0x31cd0d]={'$like':'%'+_0x35f410['query'][_0x6058('0x48')]+'%'};return _0x2025c1;})});}_0x233833=_['merge']({},_0x233833,_0x35f410[_0x6058('0x5f')]);return db['Disposition']['count']({'where':_0x233833[_0x6058('0x44')]})[_0x6058('0x17')](function(_0x237402){_0x288787['count']=_0x237402;if(_0x35f410[_0x6058('0x38')][_0x6058('0x4a')]){_0x233833[_0x6058('0x4b')]=[{'all':!![]}];}return db[_0x6058('0x5e')]['findAll'](_0x233833);})['then'](function(_0x206168){_0x288787[_0x6058('0x4d')]=_0x206168;return _0x288787;});}})['then'](respondWithFilteredResult(_0x520a3d,_0x233833))['catch'](handleError(_0x520a3d,null));};exports[_0x6058('0x60')]=function(_0x53b326,_0x788c5a){return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x53b326['params']['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x788c5a,null))[_0x6058('0x17')](function(_0x39d88d){if(_0x39d88d){return _0x39d88d[_0x6058('0x60')](_0x53b326[_0x6058('0x38')]['ids']);}})[_0x6058('0x17')](respondWithStatusCode(_0x788c5a,null))[_0x6058('0x50')](handleError(_0x788c5a,null));};exports[_0x6058('0x61')]=function(_0x563a76,_0x3c7ce0){if(_0x563a76[_0x6058('0x52')]['id']){delete _0x563a76[_0x6058('0x52')]['id'];}return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x563a76[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x3c7ce0,null))[_0x6058('0x17')](function(_0x5dcb8e){if(_0x5dcb8e){_0x563a76[_0x6058('0x52')][_0x6058('0x5c')]=_0x5dcb8e['id'];return db[_0x6058('0x62')]['create'](_0x563a76[_0x6058('0x52')]);}})[_0x6058('0x17')](respondWithResult(_0x3c7ce0,null))[_0x6058('0x50')](handleError(_0x3c7ce0,null));};exports[_0x6058('0x63')]=function(_0x1b4516,_0x4d60d3){var _0xf09771={'raw':![],'where':{}};var _0xbcd27f={};var _0x58d726={'count':0x0,'rows':[]};return db[_0x6058('0x49')]['findOne']({'where':{'id':_0x1b4516[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x4d60d3,null))['then'](function(_0x54074b){if(_0x54074b){_0xbcd27f[_0x6058('0x3c')]=_[_0x6058('0x39')](db['CannedAnswer']['rawAttributes']);_0xbcd27f[_0x6058('0x38')]=_[_0x6058('0x39')](_0x1b4516[_0x6058('0x38')]);_0xbcd27f[_0x6058('0x3a')]=_['intersection'](_0xbcd27f['model'],_0xbcd27f['query']);_0xf09771[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0xbcd27f[_0x6058('0x3c')],qs[_0x6058('0x3e')](_0x1b4516['query'][_0x6058('0x3e')]));_0xf09771[_0x6058('0x3d')]=_0xf09771[_0x6058('0x3d')][_0x6058('0x3f')]?_0xf09771[_0x6058('0x3d')]:_0xbcd27f[_0x6058('0x3c')];if(!_0x1b4516['query'][_0x6058('0x40')](_0x6058('0x41'))){_0xf09771[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x1b4516[_0x6058('0x38')][_0x6058('0x24')]);_0xf09771[_0x6058('0x23')]=qs['offset'](_0x1b4516[_0x6058('0x38')][_0x6058('0x23')]);}_0xf09771[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x1b4516['query'][_0x6058('0x43')]);_0xf09771['where']=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x1b4516['query'],_0xbcd27f[_0x6058('0x3a')]));_0xf09771['where']['ChatWebsiteId']=_0x54074b['id'];if(_0x1b4516[_0x6058('0x38')][_0x6058('0x48')]){_0xf09771[_0x6058('0x44')]=_[_0x6058('0x46')](_0xf09771[_0x6058('0x44')],{'$or':_[_0x6058('0x34')](_0xf09771[_0x6058('0x3d')],function(_0x1639f6){var _0x299ef6={};_0x299ef6[_0x1639f6]={'$like':'%'+_0x1b4516[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x299ef6;})});}_0xf09771=_[_0x6058('0x46')]({},_0xf09771,_0x1b4516[_0x6058('0x5f')]);return db[_0x6058('0x62')][_0x6058('0x26')]({'where':_0xf09771[_0x6058('0x44')]})[_0x6058('0x17')](function(_0x5608a3){_0x58d726[_0x6058('0x26')]=_0x5608a3;if(_0x1b4516['query'][_0x6058('0x4a')]){_0xf09771[_0x6058('0x4b')]=[{'all':!![]}];}return db[_0x6058('0x62')][_0x6058('0x4c')](_0xf09771);})[_0x6058('0x17')](function(_0x111b1f){_0x58d726[_0x6058('0x4d')]=_0x111b1f;return _0x58d726;});}})[_0x6058('0x17')](respondWithFilteredResult(_0x4d60d3,_0xf09771))[_0x6058('0x50')](handleError(_0x4d60d3,null));};exports[_0x6058('0x64')]=function(_0x471d8c,_0x5191fd){return db[_0x6058('0x49')]['find']({'where':{'id':_0x471d8c['params']['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x5191fd,null))[_0x6058('0x17')](function(_0x98e8ac){if(_0x98e8ac){return _0x98e8ac[_0x6058('0x64')](_0x471d8c['query'][_0x6058('0x65')]);}})[_0x6058('0x17')](respondWithStatusCode(_0x5191fd,null))[_0x6058('0x50')](handleError(_0x5191fd,null));};exports[_0x6058('0x66')]=function(_0x284903,_0x11c405){_0x284903[_0x6058('0x52')]['sitepic']=_0x284903['file'][_0x6058('0x67')];return db[_0x6058('0x49')]['find']({'where':{'id':_0x284903[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x11c405,null))[_0x6058('0x17')](saveUpdates(_0x284903[_0x6058('0x52')],null))[_0x6058('0x17')](respondWithResult(_0x11c405,null))[_0x6058('0x50')](handleError(_0x11c405,null));};exports['addAvatar']=function(_0x410e7f,_0x4a7197){_0x410e7f[_0x6058('0x52')]['agentAvatar']=_0x410e7f[_0x6058('0x68')][_0x6058('0x67')];return db[_0x6058('0x49')]['find']({'where':{'id':_0x410e7f[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a7197,null))[_0x6058('0x17')](saveUpdates(_0x410e7f[_0x6058('0x52')],null))['then'](respondWithResult(_0x4a7197,null))['catch'](handleError(_0x4a7197,null));};exports['addCustomerAvatar']=function(_0x161e92,_0x20aacb){_0x161e92[_0x6058('0x52')]['customerAvatar']=_0x161e92[_0x6058('0x68')][_0x6058('0x67')];return db['ChatWebsite']['find']({'where':{'id':_0x161e92[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x20aacb,null))[_0x6058('0x17')](saveUpdates(_0x161e92['body'],null))[_0x6058('0x17')](respondWithResult(_0x20aacb,null))[_0x6058('0x50')](handleError(_0x20aacb,null));};exports[_0x6058('0x69')]=function(_0x2af4a0,_0x148d17){_0x2af4a0[_0x6058('0x52')]['systemAvatar']=_0x2af4a0[_0x6058('0x68')][_0x6058('0x67')];return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x2af4a0['params']['id']}})['then'](handleEntityNotFound(_0x148d17,null))[_0x6058('0x17')](saveUpdates(_0x2af4a0['body'],null))[_0x6058('0x17')](respondWithResult(_0x148d17,null))[_0x6058('0x50')](handleError(_0x148d17,null));};exports[_0x6058('0x6a')]=function(_0xa242d9,_0x40cb95){var _0x150abf=path['join'](config[_0x6058('0x6b')],_0x6058('0x6c'));var _0x45709e={'where':{'id':_0xa242d9[_0x6058('0x4e')]['id']},'attributes':['id',_0x6058('0x6d')],'raw':!![]};var _0x55eb34=![];return require(_0x6058('0x6e'))['getLicense']()[_0x6058('0x17')](function(_0x25d69b){if(_0x25d69b){_0x55eb34=_0x25d69b[_0x6058('0x6f')];}})[_0x6058('0x17')](function(){return db[_0x6058('0x49')][_0x6058('0x4f')](_0x45709e);})[_0x6058('0x17')](handleEntityNotFound(_0x40cb95,null))[_0x6058('0x17')](function(_0x363adc){if(_0x363adc){if(!_[_0x6058('0x70')](_0x363adc[_0x6058('0x6d')])){if(fs[_0x6058('0x71')](path[_0x6058('0x72')](config['root'],'server/files/images/logos/',_0x363adc[_0x6058('0x6d')]))&&_0x55eb34){_0x150abf=path['join'](config['root'],_0x6058('0x73'),_0x363adc[_0x6058('0x6d')]);}}return _0x40cb95[_0x6058('0x74')](_0x150abf);}})[_0x6058('0x50')](handleError(_0x40cb95,null));};exports['getAvatar']=function(_0x435f9d,_0x319d74){var _0x150ab0=path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x75'));var _0x31fea6={'where':{'id':_0x435f9d[_0x6058('0x4e')]['id']},'attributes':['id',_0x6058('0x76')],'raw':!![]};return db[_0x6058('0x49')][_0x6058('0x4f')](_0x31fea6)['then'](handleEntityNotFound(_0x319d74,null))[_0x6058('0x17')](function(_0x527ac9){if(_0x527ac9){if(!_[_0x6058('0x70')](_0x527ac9[_0x6058('0x76')])){if(fs[_0x6058('0x71')](path[_0x6058('0x72')](config[_0x6058('0x6b')],'server/files/images/avatars/',_0x527ac9[_0x6058('0x76')]))){_0x150ab0=path['join'](config['root'],'server/files/images/avatars/',_0x527ac9[_0x6058('0x76')]);}}return _0x319d74[_0x6058('0x74')](_0x150ab0);}})[_0x6058('0x50')](handleError(_0x319d74,null));};exports['getCustomerAvatar']=function(_0x24a871,_0x21ddad){var _0x4522c4=path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x77'));var _0x2685d1={'where':{'id':_0x24a871[_0x6058('0x4e')]['id']},'attributes':['id','customerAvatar',_0x6058('0x78')],'raw':!![]};return db[_0x6058('0x49')][_0x6058('0x4f')](_0x2685d1)['then'](handleEntityNotFound(_0x21ddad,null))['then'](function(_0x3c6b59){if(_0x3c6b59){if(!_['isNil'](_0x3c6b59['customerAvatar'])){if(fs['existsSync'](path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x79'),_0x3c6b59[_0x6058('0x7a')]))&&_0x3c6b59[_0x6058('0x78')]){_0x4522c4=path['join'](config[_0x6058('0x6b')],_0x6058('0x79'),_0x3c6b59[_0x6058('0x7a')]);}}return _0x21ddad['download'](_0x4522c4);}})[_0x6058('0x50')](handleError(_0x21ddad,null));};exports[_0x6058('0x7b')]=function(_0x3dae5c,_0x47b550){var _0x56defc=path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x7c'));var _0x19ad2c={'where':{'id':_0x3dae5c['params']['id']},'attributes':['id',_0x6058('0x7d')],'raw':!![]};return db[_0x6058('0x49')][_0x6058('0x4f')](_0x19ad2c)[_0x6058('0x17')](handleEntityNotFound(_0x47b550,null))[_0x6058('0x17')](function(_0x1ea53c){if(_0x1ea53c){if(!_[_0x6058('0x70')](_0x1ea53c[_0x6058('0x7d')])){if(fs[_0x6058('0x71')](path['join'](config['root'],_0x6058('0x79'),_0x1ea53c[_0x6058('0x7d')]))){_0x56defc=path[_0x6058('0x72')](config[_0x6058('0x6b')],'server/files/images/avatars/',_0x1ea53c['systemAvatar']);}}return _0x47b550['download'](_0x56defc);}})['catch'](handleError(_0x47b550,null));};exports['notify']=function(_0x2cf15d,_0x5227c3){var _0x46d1ff=require(_0x6058('0x7e'));var _0x1e909a=new _0x46d1ff();var _0x216ea7=_0x1e909a['setUA'](_0x2cf15d[_0x6058('0x7f')][_0x6058('0x80')])[_0x6058('0x81')]();var _0x5d6944={'body':_0x2cf15d[_0x6058('0x52')],'channel':'chat'};var _0x383702=[];var _0x1fde7e=[];var _0x39b62c={};var _0x597a8e=![];return db['CmContact'][_0x6058('0x5a')]()[_0x6058('0x17')](function(_0xd1d22d){if(!_0xd1d22d){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x84'));}_0x383702=_['difference'](_[_0x6058('0x39')](_0xd1d22d),['createdAt',_0x6058('0x85')]);_0x1fde7e=_[_0x6058('0x86')](_['keys'](_0xd1d22d),[_0x6058('0x87'),'updatedAt',_0x6058('0x88'),_0x6058('0x89')]);if(_0x2cf15d['body']['id']){delete _0x2cf15d[_0x6058('0x52')]['id'];}if(_[_0x6058('0x70')](_0x2cf15d[_0x6058('0x52')][_0x6058('0x8a')])){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))]('from\x20is\x20mandatory');}if(_[_0x6058('0x70')](_0x2cf15d[_0x6058('0x52')][_0x6058('0x52')])||_0x2cf15d['body'][_0x6058('0x52')]===''){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8b'));}if(_[_0x6058('0x70')](_0x2cf15d[_0x6058('0x52')][_0x6058('0x8c')])){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8d')+_0x1fde7e);}if(!_[_0x6058('0x8e')](_0x1fde7e,_0x2cf15d[_0x6058('0x52')][_0x6058('0x8c')])){throw new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8f')+_0x1fde7e);}_0x39b62c[_0x2cf15d[_0x6058('0x52')]['mapKey']]=_0x2cf15d[_0x6058('0x52')]['from'];})[_0x6058('0x17')](function(){return db[_0x6058('0x49')][_0x6058('0x4f')]({'where':{'id':_0x2cf15d[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x90')],'as':_0x6058('0x91'),'include':[{'model':db[_0x6058('0x92')],'as':_0x6058('0x93'),'where':_0x39b62c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x6058('0x94')}]});})[_0x6058('0x17')](handleEntityNotFound(_0x5227c3,null))['then'](function(_0x49da26){if(_0x49da26&&_0x49da26[_0x6058('0x91')]){_0x5d6944['account']=_0x49da26;_0x5d6944[_0x6058('0x95')]=_0x49da26[_0x6058('0x94')];_0x5d6944[_0x6058('0x96')]=_0x49da26[_0x6058('0x91')];_0x5d6944[_0x6058('0x95')]=_['orderBy'](_0x5d6944[_0x6058('0x95')],['priority'],[_0x6058('0x97')]);if(_0x5d6944[_0x6058('0x98')]['Applications']){delete _0x5d6944[_0x6058('0x98')][_0x6058('0x94')];}if(_0x5d6944[_0x6058('0x98')][_0x6058('0x91')]&&_0x5d6944[_0x6058('0x98')][_0x6058('0x91')]['Contacts'][_0x6058('0x3f')]){return _0x5d6944['account'][_0x6058('0x91')][_0x6058('0x93')][0x0];}var _0x5a9938=_[_0x6058('0xe')](_0x2cf15d['body'],{'firstName':_0x2cf15d['body']['from'],'ListId':_0x49da26[_0x6058('0x89')]});_0x5a9938[_0x2cf15d[_0x6058('0x52')]['mapKey']]=_0x2cf15d[_0x6058('0x52')][_0x6058('0x8a')];return db[_0x6058('0x92')][_0x6058('0x51')](_0x5a9938,{'fields':_0x383702,'raw':!![]});}})[_0x6058('0x17')](handleEntityNotFound(_0x5227c3,null))['then'](function(_0x3e88ab){_0x5d6944[_0x6058('0x99')]=_0x3e88ab;var _0xfb8431=_0x2cf15d[_0x6058('0x52')]['customerIp'];if(_0x2cf15d[_0x6058('0x7f')][_0x6058('0x9a')]){_0xfb8431=_0x2cf15d[_0x6058('0x7f')][_0x6058('0x9a')];}else if(_0x2cf15d[_0x6058('0x7f')][_0x6058('0x9b')]){_0xfb8431=_[_0x6058('0x9c')](_0x2cf15d['headers'][_0x6058('0x9b')][_0x6058('0x9d')](','));}if(_0x3e88ab){var _0x19c5ba={'ContactId':_0x3e88ab['id'],'ChatWebsiteId':_0x2cf15d[_0x6058('0x4e')]['id'],'from':(_0x3e88ab[_0x6058('0x9e')]||'')+'\x20'+(_0x3e88ab[_0x6058('0x9f')]||''),'customerIp':_0xfb8431,'customerPort':_0x2cf15d[_0x6058('0x7f')][_0x6058('0xa0')]?_0x2cf15d[_0x6058('0x7f')]['x-real-port']:null,'referer':_0x2cf15d['body'][_0x6058('0xa1')],'browserName':_0x216ea7[_0x6058('0xa2')][_0x6058('0x30')]&&_0x216ea7['browser'][_0x6058('0xa3')]?util[_0x6058('0xa4')]('%s\x20%s',_0x216ea7['browser'][_0x6058('0x30')],_0x216ea7[_0x6058('0xa2')][_0x6058('0xa3')]):_0x6058('0xa5'),'browserVersion':_0x216ea7[_0x6058('0xa2')][_0x6058('0xa3')]||_0x6058('0xa5'),'osName':util[_0x6058('0xa4')]('%s\x20%s',_0x216ea7['os'][_0x6058('0x30')],_0x216ea7['os']['version']),'osVersion':_0x216ea7['os']['version'],'deviceModel':_0x216ea7[_0x6058('0xa6')]['model']&&_0x216ea7[_0x6058('0xa6')][_0x6058('0xa7')]?util[_0x6058('0xa4')](_0x6058('0xa8'),_0x216ea7['device'][_0x6058('0x3c')],_0x216ea7['device']['vendor'],_0x216ea7['device'][_0x6058('0x36')]):null,'deviceVendor':_0x216ea7[_0x6058('0xa6')][_0x6058('0xa7')],'deviceType':_0x216ea7[_0x6058('0xa6')]['type'],'formData':JSON[_0x6058('0xa9')](_0x2cf15d[_0x6058('0x52')])};var _0x1342f0={'ChatWebsiteId':_0x2cf15d[_0x6058('0x4e')]['id'],'closed':![]};if(_0x2cf15d[_0x6058('0x52')][_0x6058('0xaa')]){_0x1342f0[_0x6058('0xaa')]=_0x2cf15d['body'][_0x6058('0xaa')];return db[_0x6058('0xab')][_0x6058('0x4f')]({'where':_0x1342f0})[_0x6058('0x17')](function(_0x2bf547){if(_0x2bf547){return[_0x2bf547,![]];}_0x19c5ba[_0x6058('0xaa')]=_0x2cf15d[_0x6058('0x52')][_0x6058('0xaa')];_0x19c5ba['externalUrl']=_0x2cf15d[_0x6058('0x52')][_0x6058('0xac')];return db[_0x6058('0xab')][_0x6058('0x51')](_0x19c5ba)[_0x6058('0x17')](function(_0x27c255){return[_0x27c255,!![]];});});}_0x1342f0[_0x6058('0xad')]=_0x3e88ab['id'];if(_0x2cf15d[_0x6058('0x52')][_0x6058('0xae')]&&_0x2cf15d['body'][_0x6058('0xae')]['id']){_0x1342f0['id']=_0x2cf15d[_0x6058('0x52')][_0x6058('0xae')]['id'];return db[_0x6058('0xab')][_0x6058('0x4f')]({'where':_0x1342f0})[_0x6058('0x17')](function(_0x50e5d6){if(_0x50e5d6){return[_0x50e5d6,![]];}return db[_0x6058('0xab')]['create'](_0x19c5ba)[_0x6058('0x17')](function(_0x451832){return[_0x451832,!![]];});});}return db[_0x6058('0xab')]['create'](_0x19c5ba)[_0x6058('0x17')](function(_0x32f33e){return[_0x32f33e,!![]];});}})[_0x6058('0xaf')](function(_0x3cc95f,_0x295b6){if(_0x3cc95f){_0x597a8e=_0x295b6;if(!_0x295b6){var _0x266e72={'from':(_0x5d6944['contact'][_0x6058('0x9e')]||'')+'\x20'+(_0x5d6944[_0x6058('0x99')]['lastName']||'')};if(_0x2cf15d['body']['threadId']&&_0x2cf15d['body']['messageId']&&_0x2cf15d[_0x6058('0x52')]['threadId']!=_0x2cf15d[_0x6058('0x52')][_0x6058('0xb0')]){_0x266e72[_0x6058('0xaa')]=_0x2cf15d[_0x6058('0x52')][_0x6058('0xb0')];}return _0x3cc95f[_0x6058('0x29')](_0x266e72);}else{return _0x3cc95f;}}})[_0x6058('0x17')](function(_0x153728){_0x5d6944['interaction']=_0x153728['get']({'plain':!![]});_0x5d6944[_0x6058('0xae')][_0x6058('0xb1')]=_0x597a8e;if(_0x5d6944[_0x6058('0xae')][_0x6058('0xb1')]){if(_0x5d6944['account'][_0x6058('0xb2')]){_0x5d6944[_0x6058('0x95')][_0x6058('0xb3')]({'id':0x0,'priority':_0x5d6944[_0x6058('0x95')][_0x6058('0x3f')]+0x1,'app':_0x6058('0xb4'),'appdata':_0x6058('0xb5'),'interval':_0x6058('0xb6')});}}return db[_0x6058('0xb7')][_0x6058('0x51')]({'body':_0x2cf15d[_0x6058('0x52')]['body'],'ChatWebsiteId':_0x2cf15d[_0x6058('0x4e')]['id'],'ChatInteractionId':_0x153728['id'],'direction':'in','ContactId':_0x5d6944[_0x6058('0x99')]['id'],'AttachmentId':_0x2cf15d[_0x6058('0x52')][_0x6058('0xb8')]});})[_0x6058('0x17')](function(_0x270f92){_0x5d6944[_0x6058('0x1e')]=_0x270f92;if(_0x5d6944['interaction'][_0x6058('0xb9')]){return db['User']['find']({'attributes':['id',_0x6058('0x30')],'where':{'id':_0x5d6944[_0x6058('0xae')]['UserId']}})[_0x6058('0x17')](function(_0x286f82){if(_0x286f82){_0x5d6944[_0x6058('0x95')][_0x6058('0xba')]({'id':0x0,'priority':0x0,'app':_0x6058('0xbb'),'appdata':_0x286f82['name']+','+(_0x5d6944[_0x6058('0x98')]['waitForTheAssignedAgent']||0xa),'interval':_0x6058('0xb6')});_0x5d6944[_0x6058('0xbc')]=!![];}return respondWithRpcPromise(_0x6058('0xbd'),_0x6058('0xbe'),_0x5d6944);});}return respondWithRpcPromise(_0x6058('0xbd'),'startRouting',_0x5d6944);})['then'](function(_0x2b19d6){respondWithRpcPromise(_0x6058('0xbf'),'EventManager',{'event':_0x6058('0xc0'),'message':_0x2b19d6},client9002);return _0x2b19d6;})[_0x6058('0x17')](respondWithResult(_0x5227c3,null))[_0x6058('0x50')](handleError(_0x5227c3,null));};exports[_0x6058('0xc1')]=function(_0x30f993,_0x1224a9){var _0x59542a,_0x582a57,_0x2b4a41;var _0x164cc4=[];var _0x1ac532={};var _0x539681=_0x30f993[_0x6058('0xc2')]||[];var _0x3f9199=[];var _0x426a96;return db[_0x6058('0x92')][_0x6058('0x5a')]()[_0x6058('0x17')](function(_0x2e8a14){if(!_0x2e8a14){throw new db[(_0x6058('0x82'))]['ValidationError'](_0x6058('0x84'));}_0x164cc4=_['difference'](_[_0x6058('0x39')](_0x2e8a14),[_0x6058('0x87'),_0x6058('0x85'),_0x6058('0x88'),_0x6058('0x89')]);if(_0x30f993[_0x6058('0x52')]['id']){delete _0x30f993[_0x6058('0x52')]['id'];}if(_[_0x6058('0x70')](_0x30f993[_0x6058('0x52')]['from'])){throw _0x1224a9[_0x6058('0x21')](0x1f4)['send'](new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0xc3')));}if(_[_0x6058('0x70')](_0x30f993[_0x6058('0x52')][_0x6058('0x52')])||_0x30f993[_0x6058('0x52')]['body']===''){throw _0x1224a9[_0x6058('0x21')](0x1f4)[_0x6058('0xc4')](new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0x8b')));}if(_[_0x6058('0x70')](_0x30f993['body'][_0x6058('0xc5')])){throw _0x1224a9[_0x6058('0x21')](0x1f4)[_0x6058('0xc4')](new db[(_0x6058('0x82'))][(_0x6058('0x83'))](_0x6058('0xc6')+_0x164cc4));}if(!_[_0x6058('0x8e')](_0x164cc4,_0x30f993[_0x6058('0x52')]['mapKeyOffline'])){throw _0x1224a9['status'](0x1f4)['send'](new db['Sequelize'][(_0x6058('0x83'))](_0x6058('0xc7')+_0x164cc4));}_0x1ac532[_0x30f993['body'][_0x6058('0xc5')]]=_0x30f993['body'][_0x6058('0x8a')];})[_0x6058('0x17')](function(){return db[_0x6058('0x49')]['find']({'where':{'id':_0x30f993[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x90')],'as':_0x6058('0x91')},{'model':db['MailAccount'],'as':_0x6058('0xc8')}]});})[_0x6058('0x17')](handleEntityNotFound(_0x1224a9,null))[_0x6058('0x17')](function(_0x1198aa){if(_0x1198aa&&_0x1198aa[_0x6058('0x91')]){_0x582a57=_0x1198aa;var _0x520d4e=_[_0x6058('0xe')](_0x30f993['body'],{'firstName':_0x30f993[_0x6058('0x52')]['from'],'phone':_0x30f993['body'][_0x6058('0x8a')],'ListId':_0x1198aa[_0x6058('0x89')]});_0x520d4e[_0x30f993[_0x6058('0x52')][_0x6058('0xc5')]]=_0x30f993[_0x6058('0x52')][_0x6058('0x8a')];return db[_0x6058('0x92')][_0x6058('0xc9')]({'where':_0x1ac532,'defaults':_0x520d4e});}})[_0x6058('0xaf')](function(_0x5384f0){if(_0x5384f0){_0x2b4a41=_0x5384f0;var _0x23b892=fs[_0x6058('0xca')](path[_0x6058('0x72')](config[_0x6058('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0x6058('0xcb'));var _0xf1cdab=ejs[_0x6058('0xcc')](_0x23b892,{'body':_[_0x6058('0xcd')](_0x30f993[_0x6058('0x52')][_0x6058('0x52')]),'bodyTitle':_0x582a57[_0x6058('0xce')]});return db[_0x6058('0xcf')]['create']({'body':_0xf1cdab,'plainBody':htmlToText['fromString'](_0xf1cdab),'ContactId':_0x5384f0['id'],'ChatWebsiteId':_0x582a57['id']});}})['then'](function(_0xae4061){_0x426a96=_0xae4061;if(_0x539681[_0x6058('0x3f')]){var _0x3b36d7=_0x539681[_0x6058('0x34')](function(_0x5c4bf5){return{'name':_0x5c4bf5['originalname'],'basename':_0x5c4bf5[_0x6058('0x67')],'type':_0x5c4bf5[_0x6058('0xd0')],'ChatOfflineMessageId':_0xae4061['id']};});_0x3f9199=_0x3b36d7['map'](_0xb73ce0=>{var _0x38af2d={'filename':_0xb73ce0[_0x6058('0x30')],'path':path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0xd1'),_0x6058('0xc2'),_0x6058('0xd2'),_0x6058('0xd3'),_0xb73ce0[_0x6058('0xd4')])};return _0x38af2d;});if(!_0x582a57['openNewInteraction']){return db[_0x6058('0xd5')][_0x6058('0xd6')](function(_0x30c6eb){return db['Attachment'][_0x6058('0xd7')](_0x3b36d7,{'transaction':_0x30c6eb});});}}})['then'](function(){if(_0x426a96){_0x59542a=_0x426a96;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6058('0xd8')],'as':_0x6058('0xd9'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x6058('0xda'),'raw':!![]}]}]});}})[_0x6058('0x17')](function(_0xaebce1){if(_0xaebce1&&_0xaebce1[_0x6058('0xd9')]&&_0x582a57[_0x6058('0xdb')]&&_0x582a57[_0x6058('0xdc')]){var _0x549ede=_0xaebce1['getSmtpOptions']();return respondWithRpcPromise(_0x6058('0xdd'),_0x6058('0xde'),{'account':_0x549ede,'message':{'from':util[_0x6058('0xa4')](_0x6058('0xdf'),_0xaebce1[_0x6058('0x30')],_0xaebce1[_0x6058('0xe0')]||_0xaebce1[_0x6058('0xd9')][_0x6058('0x55')]),'to':_0x582a57[_0x6058('0xdc')],'subject':_0x582a57['offlineMessageSubject'],'html':_0x59542a['body'],'attachments':_0x3f9199}},client9003)[_0x6058('0x17')](function(){return _0x59542a;})[_0x6058('0x50')](function(_0xd842a0){logger[_0x6058('0x1b')](_0xd842a0);});}})[_0x6058('0x17')](function(){if(_0x582a57&&_0x582a57['openNewInteraction']&&_0x582a57[_0x6058('0xe1')]){var _0x7979cf=[];if(_0x539681['length']){_0x7979cf=_0x539681['map'](function(_0x25e130){return{'name':_0x25e130[_0x6058('0xe2')],'basename':_0x25e130['filename'],'type':_0x25e130['mimetype'],'ChatOfflineMessageId':_0x426a96['id']};});}var _0x54cb60;if(!_[_0x6058('0x70')](_0x582a57[_0x6058('0xe3')])){var _0x1e1570=_[_0x6058('0x34')](_0x30f993['body'],function(_0x146b21){return _0x146b21;});var _0x3d8d93=_[_0x6058('0xe4')](_0x1e1570)[0x0];var _0x2272b0=_[_0x6058('0xe5')](_0x3d8d93,function(_0x233db6){return _0x233db6;});_0x54cb60=_0x2272b0[0x1][_0x582a57[_0x6058('0xe3')]];}var _0x4d8795={'from':_0x2b4a41[_0x6058('0xe0')],'firstName':_0x2b4a41[_0x6058('0x9e')],'lastName':_0x2b4a41[_0x6058('0x9f')],'mapKey':_0x6058('0xe0'),'message':{'from':_0x2b4a41['email'],'to':_0x582a57['MailAccount'][_0x6058('0xe0')],'cc':'','subject':_[_0x6058('0x70')](_0x54cb60)?_0x582a57['offlineMessageSubject']:_0x54cb60,'messageId':'','sentAt':new Date(),'attach':_0x7979cf[_0x6058('0x3f')],'attachments':_0x7979cf,'originChannel':_0x6058('0xe6'),'ChatWebsiteId':_0x582a57['id'],'ChatOfflineMessageId':_0x59542a['id'],'originTo':_0x582a57[_0x6058('0xc8')]['email']},'body':_0x59542a[_0x6058('0x52')]};var _0x45d9ef={'account':{'id':_0x582a57[_0x6058('0xe1')]},'body':_0x4d8795,'log':_0x6058('0xe7')};return respondWithRpcPromise(_0x6058('0xe7'),_0x6058('0xe8'),_0x45d9ef,client9001)[_0x6058('0x17')](function(){return _0x59542a;})['catch'](function(_0x2b0771){logger[_0x6058('0x1b')](_0x2b0771);});}return;})[_0x6058('0x17')](function(){if(_0x59542a){return _0x59542a;}})['then'](respondWithResult(_0x1224a9,null))[_0x6058('0x50')](function(_0x2e07f7){logger[_0x6058('0x1b')](_0x6058('0x50'),_0x2e07f7);for(var _0x5ed092 of _0x539681){var _0x4fefff=path[_0x6058('0x72')](config[_0x6058('0x6b')],'server',_0x6058('0xc2'),_0x6058('0xd2'),_0x6058('0xd3'),_0x5ed092[_0x6058('0x67')]);fs_extra[_0x6058('0xe9')](_0x4fefff)[_0x6058('0x50')](function(_0x273283){logger[_0x6058('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x4fefff,_0x273283);});}});};exports[_0x6058('0xea')]=function(_0x2ebd04,_0x4456d1){return db[_0x6058('0xab')][_0x6058('0x4f')]({'where':{'id':_0x2ebd04[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x4456d1,null))[_0x6058('0x17')](function(_0x2a7c90){if(_0x2a7c90){return _0x2a7c90[_0x6058('0xea')](_0x2ebd04['body']['ids'],_[_0x6058('0xeb')](_0x2ebd04['body'],[_0x6058('0x65'),'id'])||{});}})[_0x6058('0x17')](respondWithResult(_0x4456d1,null))['catch'](handleError(_0x4456d1,null));};exports[_0x6058('0xec')]=function(_0x59b4d0,_0x405965){var _0x1a01e6={'raw':![],'where':{}};var _0x42e304={};var _0x257c9c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6058('0x5d')]({'where':{'id':_0x59b4d0[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x405965,null))[_0x6058('0x17')](function(_0x218013){if(_0x218013){_0x42e304[_0x6058('0x3c')]=_[_0x6058('0x39')](db['ChatInteraction'][_0x6058('0x35')]);_0x42e304[_0x6058('0x38')]=_[_0x6058('0x39')](_0x59b4d0[_0x6058('0x38')]);_0x42e304[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x42e304[_0x6058('0x3c')],_0x42e304['query']);_0x1a01e6[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x42e304['model'],qs[_0x6058('0x3e')](_0x59b4d0[_0x6058('0x38')][_0x6058('0x3e')]));_0x1a01e6[_0x6058('0x3d')]=_0x1a01e6[_0x6058('0x3d')][_0x6058('0x3f')]?_0x1a01e6[_0x6058('0x3d')]:_0x42e304[_0x6058('0x3c')];if(!_0x59b4d0[_0x6058('0x38')][_0x6058('0x40')](_0x6058('0x41'))){_0x1a01e6['limit']=qs['limit'](_0x59b4d0[_0x6058('0x38')]['limit']);_0x1a01e6[_0x6058('0x23')]=qs['offset'](_0x59b4d0[_0x6058('0x38')][_0x6058('0x23')]);}_0x1a01e6[_0x6058('0x42')]=qs['sort'](_0x59b4d0[_0x6058('0x38')][_0x6058('0x43')]);_0x1a01e6['where']=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x59b4d0['query'],_0x42e304[_0x6058('0x3a')]));_0x1a01e6[_0x6058('0x44')][_0x6058('0x5c')]=_0x218013['id'];if(_0x59b4d0[_0x6058('0x38')][_0x6058('0x48')]){_0x1a01e6['where']=_[_0x6058('0x46')](_0x1a01e6['where'],{'$or':_[_0x6058('0x34')](_0x1a01e6['attributes'],function(_0x2ed197){var _0x39f5d8={};_0x39f5d8[_0x2ed197]={'$like':'%'+_0x59b4d0['query'][_0x6058('0x48')]+'%'};return _0x39f5d8;})});}_0x1a01e6=_[_0x6058('0x46')]({},_0x1a01e6,_0x59b4d0[_0x6058('0x5f')]);return db[_0x6058('0xab')][_0x6058('0x26')]({'where':_0x1a01e6[_0x6058('0x44')]})[_0x6058('0x17')](function(_0x379379){_0x257c9c['count']=_0x379379;if(_0x59b4d0[_0x6058('0x38')][_0x6058('0x4a')]){_0x1a01e6[_0x6058('0x4b')]=[{'model':db['CmContact'],'as':_0x6058('0xed'),'required':![]},{'model':db[_0x6058('0xee')],'as':'Owner','attributes':[_0x6058('0x30'),_0x6058('0xef'),_0x6058('0xf0')],'required':![]},{'model':db[_0x6058('0xf1')],'as':_0x6058('0xf2'),'attributes':['id',_0x6058('0x30'),_0x6058('0xf3')],'where':_0x59b4d0[_0x6058('0x38')][_0x6058('0xf4')]?{'id':_0x59b4d0[_0x6058('0x38')][_0x6058('0xf4')]}:undefined,'required':_0x59b4d0[_0x6058('0x38')][_0x6058('0xf4')]?!![]:![]}];}return db[_0x6058('0xab')]['findAll'](_0x1a01e6);})[_0x6058('0x17')](function(_0x13ba89){_0x257c9c[_0x6058('0x4d')]=_0x13ba89;return _0x257c9c;});}})[_0x6058('0x17')](respondWithFilteredResult(_0x405965,_0x1a01e6))[_0x6058('0x50')](handleError(_0x405965,null));};function iftimePromise(_0x23e9af,_0x1aaa39){return respondWithRpcPromise(_0x6058('0xf5'),'getSnippet',{'command':_0x1aaa39['timezone']?util[_0x6058('0xa4')](_0x6058('0xf6'),_0x23e9af[_0x6058('0xf7')],_0x1aaa39[_0x6058('0xf8')]):util['format'](_0x6058('0xf9'),_0x23e9af[_0x6058('0xf7')])},client9002)[_0x6058('0x17')](function(_0xc31dee){var _0x1e2c6f=_0xc31dee&&_0xc31dee[_0x6058('0xfa')](_0x6058('0xfb'))>=0x0?!![]:![];logger['info'](_0x6058('0xfc'),_0x1aaa39['id'],_0x23e9af['id'],_0x23e9af['interval'],_0x1e2c6f?_0x6058('0xfd'):_0x6058('0xfe'),_0x1aaa39[_0x6058('0xf8')]?_0x1aaa39[_0x6058('0xf8')]:_0x6058('0xff'));return _0x1e2c6f;})['catch'](function(_0x4f9197){logger[_0x6058('0x1b')](_0x6058('0xfc'),_0x1aaa39['id'],_0x23e9af['id'],_0x23e9af[_0x6058('0xf7')],util[_0x6058('0x100')](_0x4f9197,{'showHidden':![],'depth':null}),_0x1aaa39[_0x6058('0xf8')]?_0x1aaa39['timezone']:_0x6058('0xff'));return![];});}exports[_0x6058('0x101')]=function(_0x261d24,_0x99f11b){var _0x51d715=0x0;var _0x488ffc=0x0;var _0x3c28cc=![];var _0x2e3c17;var _0x16a1ac;return db['ChatWebsite']['find']({'where':{'id':_0x261d24[_0x6058('0x4e')]['id']},'include':[{'model':db[_0x6058('0x102')],'as':'Interval','include':[{'model':db[_0x6058('0x102')],'as':_0x6058('0x103'),'attributes':['id',_0x6058('0xf7')],'raw':!![]}]}]})[_0x6058('0x17')](handleEntityNotFound(_0x99f11b,null))[_0x6058('0x17')](function(_0x4be8c3){if(_0x4be8c3){_0x2e3c17=_0x4be8c3;return _0x4be8c3[_0x6058('0x104')]({'raw':!![]});}})[_0x6058('0x17')](function(_0xed9dc6){if(_0x2e3c17){if(_0xed9dc6){_0x16a1ac=_0xed9dc6;}}return require(_0x6058('0x6e'))[_0x6058('0x105')]();})['then'](function(_0x34a566){if(_0x34a566){_0x488ffc=_0x34a566['virtual'];_0x3c28cc=_0x34a566[_0x6058('0x6f')];}})[_0x6058('0x17')](function(){return db[_0x6058('0xab')][_0x6058('0x26')]({'where':{'closed':![]}});})[_0x6058('0x17')](function(_0x15d2c2){_0x51d715=_0x15d2c2;if(_0x488ffc&&_0x15d2c2>_0x488ffc){return db[_0x6058('0x106')][_0x6058('0x5d')]({'where':{'id':0x1}})['then'](function(_0x3987c4){if(_0x3987c4){_0x3987c4[_0x6058('0x107')](_0x6058('0x108'));}});}})[_0x6058('0x17')](function(){if(_0x2e3c17[_0x6058('0x102')]&&_0x2e3c17[_0x6058('0x102')][_0x6058('0x103')]){var _0x573f6d=[];for(var _0x2cd727=0x0;_0x2cd727<_0x2e3c17['Interval'][_0x6058('0x103')][_0x6058('0x3f')];_0x2cd727++){var _0x53c1cc=_0x2e3c17[_0x6058('0x102')][_0x6058('0x103')][_0x2cd727]['get']({'plain':!![]});_0x573f6d[_0x6058('0xb3')](iftimePromise(_0x53c1cc,_0x2e3c17));}return BPromise[_0x6058('0x109')](_0x573f6d)['then'](function(_0x13c4fd){return _[_0x6058('0x10a')](_0x13c4fd);});}else{return!![];}})[_0x6058('0x17')](function(_0x18c7dc){var _0x337441=fs[_0x6058('0xca')](path[_0x6058('0x72')](config[_0x6058('0x6b')],_0x6058('0x10b')),_0x6058('0xcb'));var _0x58c69e=new url[(_0x6058('0x10c'))](_0x2e3c17[_0x6058('0x10d')])[_0x6058('0x10e')];var _0x53776d=_0x6058('0x10f');var _0x52c31b=![];var _0x274ea9={'chatVersion':_0x53776d,'chatWebsiteAddressOrigin':_0x58c69e,'remote':_0x2e3c17[_0x6058('0x110')],'query':querystring[_0x6058('0xa9')](_[_0x6058('0x46')](_0x2e3c17['get']({'plain':!![]}),{'customerIp':_0x261d24[_0x6058('0x7f')]['x-forwarded-for']||_0x261d24[_0x6058('0x7f')][_0x6058('0x111')]||_0x261d24[_0x6058('0x112')][_0x6058('0x113')]||_0x261d24['ip'],'referer':_0x261d24['headers'][_0x6058('0xa1')],'openedInteractions':_0x51d715,'maxInteractions':_0x488ffc,'virtual':_0x3c28cc[_0x6058('0x114')],'online':_0x18c7dc,'custom':_0x3c28cc}))['replace'](/'/g,'\x5c\x27')};_0x99f11b[_0x6058('0xc4')](ejs[_0x6058('0xcc')](Mustache[_0x6058('0xcc')](_0x337441,_0x274ea9),{'proactiveActions':_0x16a1ac,'alignment':_0x2e3c17[_0x6058('0x115')],'verticalAlignment':_0x2e3c17['verticalAlignment'],'div_color':_0x2e3c17[_0x6058('0xf3')],'labelText':_0x2e3c17['labelText'],'text_color':_0x2e3c17[_0x6058('0x116')],'text_button_color':_0x2e3c17[_0x6058('0x117')],'button_color':_0x2e3c17[_0x6058('0x118')],'background_color':_0x2e3c17['backgroundColor'],'hideWhenOffline':_0x2e3c17[_0x6058('0x119')],'intervalId':_0x2e3c17[_0x6058('0x11a')],'isDevelopment':_0x52c31b,'chatVersion':_0x53776d}));})[_0x6058('0x50')](handleError(_0x99f11b,null));};exports[_0x6058('0x11b')]=function(_0x6f6148,_0x44ce10){var _0xf634e4=_0x6f6148[_0x6058('0x4e')]['id'];var _0xf295c0=_0x6f6148[_0x6058('0x52')];var _0x13dc7e=0xc8;var _0x3aed23=null;return db['sequelize'][_0x6058('0xd6')]({'isolationLevel':db['sequelize']['Transaction'][_0x6058('0x11c')][_0x6058('0x11d')]},function(_0x473877){return db['ChatWebsite'][_0x6058('0x5d')]({'where':{'id':_0xf634e4},'transaction':_0x473877})['then'](function(_0xc54ae5){if(_0xc54ae5){return db[_0x6058('0x11e')][_0x6058('0x2a')]({'where':{'ChatWebsiteId':_0xf634e4},'transaction':_0x473877})[_0x6058('0x17')](function(){var _0x3a50cb=_[_0x6058('0x34')](_0xf295c0,function(_0x53c34e){_0x53c34e['ChatWebsiteId']=_0xf634e4;return _0x53c34e;});return db[_0x6058('0x11e')][_0x6058('0xd7')](_0x3a50cb,{'transaction':_0x473877});});}else{_0x13dc7e=0x194;_0x3aed23=[];}});})[_0x6058('0x17')](function(){if(_0x13dc7e!==0x194){return db[_0x6058('0x11e')][_0x6058('0x11f')]({'where':{'ChatWebsiteId':_0xf634e4},'order':_0x6058('0x120')})[_0x6058('0x17')](function(_0x1d7c4a){_0x3aed23=_0x1d7c4a;});}})[_0x6058('0x50')](function(_0x4a6fff){_0x13dc7e=0x1f4;logger[_0x6058('0x1b')](_0x4a6fff[_0x6058('0x2f')]);if(_0x4a6fff[_0x6058('0x30')]){delete _0x4a6fff[_0x6058('0x30')];}_0x3aed23=_0x4a6fff;})[_0x6058('0x121')](function(){if(_0x3aed23===null){_0x44ce10[_0x6058('0x20')](_0x13dc7e);}else{if(_0x13dc7e===0x1f4){_0x44ce10['status'](_0x13dc7e)['send'](_0x3aed23);}else{_0x44ce10[_0x6058('0x21')](_0x13dc7e)[_0x6058('0x22')](_0x3aed23);}}});};exports['getApplications']=function(_0x5133e9,_0x1b6182){var _0x52aec9={};var _0x551a80={};var _0x56c582;var _0x410648;return db[_0x6058('0x49')]['findOne']({'where':{'id':_0x5133e9[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x1b6182,null))['then'](function(_0x4c85f7){if(_0x4c85f7){_0x56c582=_0x4c85f7;_0x551a80['model']=_[_0x6058('0x39')](db['ChatApplication']['rawAttributes']);_0x551a80[_0x6058('0x38')]=_[_0x6058('0x39')](_0x5133e9[_0x6058('0x38')]);_0x551a80[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x551a80[_0x6058('0x3c')],_0x551a80[_0x6058('0x38')]);_0x52aec9[_0x6058('0x3d')]=_['intersection'](_0x551a80['model'],qs[_0x6058('0x3e')](_0x5133e9[_0x6058('0x38')][_0x6058('0x3e')]));_0x52aec9[_0x6058('0x3d')]=_0x52aec9['attributes'][_0x6058('0x3f')]?_0x52aec9[_0x6058('0x3d')]:_0x551a80[_0x6058('0x3c')];_0x52aec9[_0x6058('0x42')]=qs['sort'](_0x5133e9['query'][_0x6058('0x43')]);_0x52aec9[_0x6058('0x44')]=qs[_0x6058('0x3a')](_['pick'](_0x5133e9[_0x6058('0x38')],_0x551a80[_0x6058('0x3a')]));if(_0x5133e9[_0x6058('0x38')][_0x6058('0x48')]){_0x52aec9[_0x6058('0x44')]=_[_0x6058('0x46')](_0x52aec9['where'],{'$or':_[_0x6058('0x34')](_0x52aec9[_0x6058('0x3d')],function(_0xb8a2d6){var _0x22832f={};_0x22832f[_0xb8a2d6]={'$like':'%'+_0x5133e9[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x22832f;})});}_0x52aec9=_[_0x6058('0x46')]({},_0x52aec9,_0x5133e9[_0x6058('0x5f')]);return _0x56c582[_0x6058('0x122')](_0x52aec9);}})[_0x6058('0x17')](function(_0xd9038){if(_0xd9038){_0x410648=_0xd9038[_0x6058('0x3f')];if(!_0x5133e9['query'][_0x6058('0x40')]('nolimit')){_0x52aec9[_0x6058('0x24')]=qs['limit'](_0x5133e9['query'][_0x6058('0x24')]);_0x52aec9[_0x6058('0x23')]=qs['offset'](_0x5133e9[_0x6058('0x38')][_0x6058('0x23')]);}return _0x56c582[_0x6058('0x122')](_0x52aec9);}})[_0x6058('0x17')](function(_0x2ef82c){if(_0x2ef82c){return _0x2ef82c?{'count':_0x410648,'rows':_0x2ef82c}:null;}})[_0x6058('0x17')](respondWithResult(_0x1b6182,null))[_0x6058('0x50')](handleError(_0x1b6182,null));};exports[_0x6058('0x123')]=function(_0x284ca5,_0x291ef2){return db[_0x6058('0x124')]['find']({'where':{'id':_0x284ca5[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x291ef2,null))[_0x6058('0x17')](function(_0x50a447){if(_0x50a447){return _0x50a447[_0x6058('0x123')](_0x284ca5[_0x6058('0x52')][_0x6058('0x65')],_[_0x6058('0xeb')](_0x284ca5[_0x6058('0x52')],['ids','id'])||{});}})[_0x6058('0x17')](respondWithResult(_0x291ef2,null))[_0x6058('0x50')](handleError(_0x291ef2,null));};exports[_0x6058('0x104')]=function(_0x4000c3,_0x10ac7d){var _0x4721b9={};var _0x4089ba={};var _0x13aefa;var _0x390425;return db[_0x6058('0x49')]['findOne']({'where':{'id':_0x4000c3[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x10ac7d,null))[_0x6058('0x17')](function(_0x2f736b){if(_0x2f736b){_0x13aefa=_0x2f736b;_0x4089ba[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0x125')][_0x6058('0x35')]);_0x4089ba['query']=_[_0x6058('0x39')](_0x4000c3['query']);_0x4089ba[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x4089ba[_0x6058('0x3c')],_0x4089ba['query']);_0x4721b9[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x4089ba['model'],qs[_0x6058('0x3e')](_0x4000c3[_0x6058('0x38')][_0x6058('0x3e')]));_0x4721b9[_0x6058('0x3d')]=_0x4721b9[_0x6058('0x3d')][_0x6058('0x3f')]?_0x4721b9['attributes']:_0x4089ba['model'];_0x4721b9[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x4000c3[_0x6058('0x38')][_0x6058('0x43')]);_0x4721b9[_0x6058('0x44')]=qs['filters'](_[_0x6058('0x45')](_0x4000c3['query'],_0x4089ba[_0x6058('0x3a')]));if(_0x4000c3[_0x6058('0x38')][_0x6058('0x48')]){_0x4721b9[_0x6058('0x44')]=_['merge'](_0x4721b9[_0x6058('0x44')],{'$or':_['map'](_0x4721b9[_0x6058('0x3d')],function(_0x41c014){var _0x2e3db2={};_0x2e3db2[_0x41c014]={'$like':'%'+_0x4000c3['query'][_0x6058('0x48')]+'%'};return _0x2e3db2;})});}_0x4721b9=_[_0x6058('0x46')]({},_0x4721b9,_0x4000c3[_0x6058('0x5f')]);return _0x13aefa[_0x6058('0x104')](_0x4721b9);}})['then'](function(_0x5a059b){if(_0x5a059b){_0x390425=_0x5a059b[_0x6058('0x3f')];if(!_0x4000c3[_0x6058('0x38')][_0x6058('0x40')]('nolimit')){_0x4721b9[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x4000c3[_0x6058('0x38')][_0x6058('0x24')]);_0x4721b9[_0x6058('0x23')]=qs[_0x6058('0x23')](_0x4000c3[_0x6058('0x38')][_0x6058('0x23')]);}return _0x13aefa['getProactiveActions'](_0x4721b9);}})[_0x6058('0x17')](function(_0x58ff4c){if(_0x58ff4c){return _0x58ff4c?{'count':_0x390425,'rows':_0x58ff4c}:null;}})[_0x6058('0x17')](respondWithResult(_0x10ac7d,null))[_0x6058('0x50')](handleError(_0x10ac7d,null));};exports[_0x6058('0x126')]=function(_0x527039,_0x71d1ef){var _0x3a2b0b=_0x527039[_0x6058('0x38')][_0x6058('0x127')]===_0x6058('0x128')?_0x6058('0x129'):_0x6058('0x12a');return db['ChatWebsite'][_0x6058('0x4f')]({'attributes':['id',_0x3a2b0b],'where':{'id':_0x527039['params']['id']}})['then'](handleEntityNotFound(_0x71d1ef,null))[_0x6058('0x17')](function(_0x48be4d){if(_0x48be4d){var _0x2fc690=_0x48be4d[_0x3a2b0b];var _0x1bd00b=_0x2fc690&&_0x2fc690[_0x6058('0x12b')]?_0x2fc690[_0x6058('0x12b')]:[];_0x71d1ef[_0x6058('0xc4')]({'fromKey':_[_0x6058('0x70')](_0x2fc690[_0x6058('0x12c')])?undefined:_0x2fc690[_0x6058('0x12c')],'count':_0x1bd00b['length'],'rows':_0x1bd00b});}})['catch'](handleError(_0x71d1ef,null));};exports['getOfflineMessages']=function(_0x2f63a9,_0x5e0217){var _0x5e8ec8={'raw':![],'where':{}};var _0x674b69={};var _0x3beb67={'count':0x0,'rows':[]};return db[_0x6058('0x49')][_0x6058('0x5d')]({'where':{'id':_0x2f63a9[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x5e0217,null))[_0x6058('0x17')](function(_0x3e4169){if(_0x3e4169){_0x674b69[_0x6058('0x3c')]=_[_0x6058('0x39')](db[_0x6058('0xcf')][_0x6058('0x35')]);_0x674b69[_0x6058('0x38')]=_[_0x6058('0x39')](_0x2f63a9[_0x6058('0x38')]);_0x674b69[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x674b69[_0x6058('0x3c')],_0x674b69[_0x6058('0x38')]);_0x5e8ec8[_0x6058('0x3d')]=_[_0x6058('0x3b')](_0x674b69[_0x6058('0x3c')],qs['fields'](_0x2f63a9[_0x6058('0x38')][_0x6058('0x3e')]));_0x5e8ec8['attributes']=_0x5e8ec8[_0x6058('0x3d')][_0x6058('0x3f')]?_0x5e8ec8['attributes']:_0x674b69['model'];if(!_0x2f63a9[_0x6058('0x38')][_0x6058('0x40')](_0x6058('0x41'))){_0x5e8ec8[_0x6058('0x24')]=qs[_0x6058('0x24')](_0x2f63a9[_0x6058('0x38')][_0x6058('0x24')]);_0x5e8ec8[_0x6058('0x23')]=qs[_0x6058('0x23')](_0x2f63a9[_0x6058('0x38')][_0x6058('0x23')]);}_0x5e8ec8[_0x6058('0x42')]=qs['sort'](_0x2f63a9[_0x6058('0x38')][_0x6058('0x43')]);_0x5e8ec8[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x2f63a9[_0x6058('0x38')],_0x674b69[_0x6058('0x3a')]));_0x5e8ec8[_0x6058('0x44')][_0x6058('0x5c')]=_0x3e4169['id'];if(_0x2f63a9[_0x6058('0x38')][_0x6058('0x48')]){_0x5e8ec8['where']=_['merge'](_0x5e8ec8['where'],{'$or':_[_0x6058('0x34')](_0x5e8ec8[_0x6058('0x3d')],function(_0x51d460){var _0x406c16={};_0x406c16[_0x51d460]={'$like':'%'+_0x2f63a9[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x406c16;})});}_0x5e8ec8=_[_0x6058('0x46')]({},_0x5e8ec8,_0x2f63a9[_0x6058('0x5f')]);return db['ChatOfflineMessage'][_0x6058('0x26')]({'where':_0x5e8ec8['where']})['then'](function(_0x5779ed){_0x3beb67[_0x6058('0x26')]=_0x5779ed;if(_0x2f63a9[_0x6058('0x38')][_0x6058('0x4a')]){_0x5e8ec8[_0x6058('0x4b')]=[{'all':!![]}];}else{_0x5e8ec8['include']=[{'model':db[_0x6058('0x92')],'as':'Contact','required':![]},{'model':db[_0x6058('0x12d')],'as':_0x6058('0x12e'),'required':![]}];}return db[_0x6058('0xcf')][_0x6058('0x4c')](_0x5e8ec8);})[_0x6058('0x17')](function(_0x396428){_0x3beb67[_0x6058('0x4d')]=_0x396428;return _0x3beb67;});}})[_0x6058('0x17')](respondWithFilteredResult(_0x5e0217,_0x5e8ec8))[_0x6058('0x50')](handleError(_0x5e0217,null));};exports['addAgents']=function(_0x1a7e81,_0x518bae){return db[_0x6058('0x49')]['find']({'where':{'id':_0x1a7e81[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x518bae,null))['then'](function(_0x1fe1da){if(_0x1fe1da){return _0x1fe1da[_0x6058('0x12f')](_0x1a7e81[_0x6058('0x52')][_0x6058('0x65')],_['omit'](_0x1a7e81['body'],[_0x6058('0x65'),'id'])||{})[_0x6058('0xaf')](function(_0x5df250){for(var _0x36da13=0x0;_0x36da13<_0x1a7e81[_0x6058('0x52')][_0x6058('0x65')][_0x6058('0x3f')];_0x36da13+=0x1){socket[_0x6058('0x130')](_0x6058('0x131'),{'UserId':Number(_0x1a7e81[_0x6058('0x52')][_0x6058('0x65')][_0x36da13]),'ChatWebsiteId':Number(_0x1a7e81[_0x6058('0x4e')]['id'])});}return _0x5df250;});}})[_0x6058('0x17')](respondWithResult(_0x518bae,null))[_0x6058('0x50')](handleError(_0x518bae,null));};exports[_0x6058('0x132')]=function(_0x51e7a5,_0x593d89){return db['ChatWebsite'][_0x6058('0x4f')]({'where':{'id':_0x51e7a5[_0x6058('0x4e')]['id']}})[_0x6058('0x17')](handleEntityNotFound(_0x593d89,null))['then'](function(_0x44ede4){if(_0x44ede4){return _0x44ede4[_0x6058('0x132')](_0x51e7a5['query'][_0x6058('0x65')])[_0x6058('0x17')](function(){if(_[_0x6058('0x133')](_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')])){for(var _0x1b6d02=0x0;_0x1b6d02<_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')][_0x6058('0x3f')];_0x1b6d02+=0x1){socket['emit'](_0x6058('0x134'),{'UserId':Number(_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')][_0x1b6d02]),'ChatWebsiteId':Number(_0x51e7a5[_0x6058('0x4e')]['id'])});}}else{socket[_0x6058('0x130')](_0x6058('0x134'),{'UserId':Number(_0x51e7a5[_0x6058('0x38')][_0x6058('0x65')]),'ChatWebsiteId':Number(_0x51e7a5[_0x6058('0x4e')]['id'])});}});}})[_0x6058('0x17')](respondWithStatusCode(_0x593d89,null))[_0x6058('0x50')](handleError(_0x593d89,null));};exports[_0x6058('0x135')]=function(_0x3e2e03,_0x405c21){var _0x19050c={};var _0x167eec={};var _0x52c618;var _0x5379b0;return db[_0x6058('0x49')][_0x6058('0x5d')]({'where':{'id':_0x3e2e03[_0x6058('0x4e')]['id']}})['then'](handleEntityNotFound(_0x405c21,null))[_0x6058('0x17')](function(_0x2c7be9){if(_0x2c7be9){_0x52c618=_0x2c7be9;_0x167eec['model']=_[_0x6058('0x39')](db[_0x6058('0xee')][_0x6058('0x35')]);_0x167eec['query']=_[_0x6058('0x39')](_0x3e2e03[_0x6058('0x38')]);_0x167eec[_0x6058('0x3a')]=_[_0x6058('0x3b')](_0x167eec[_0x6058('0x3c')],_0x167eec[_0x6058('0x38')]);_0x19050c[_0x6058('0x3d')]=_['intersection'](_0x167eec[_0x6058('0x3c')],qs['fields'](_0x3e2e03[_0x6058('0x38')][_0x6058('0x3e')]));_0x19050c[_0x6058('0x3d')]=_0x19050c[_0x6058('0x3d')]['length']?_0x19050c[_0x6058('0x3d')]:_0x167eec[_0x6058('0x3c')];_0x19050c[_0x6058('0x42')]=qs[_0x6058('0x43')](_0x3e2e03[_0x6058('0x38')]['sort']);_0x19050c[_0x6058('0x44')]=qs[_0x6058('0x3a')](_[_0x6058('0x45')](_0x3e2e03[_0x6058('0x38')],_0x167eec[_0x6058('0x3a')]));if(_0x3e2e03[_0x6058('0x38')][_0x6058('0x48')]){_0x19050c[_0x6058('0x44')]=_['merge'](_0x19050c[_0x6058('0x44')],{'$or':_['map'](_0x19050c[_0x6058('0x3d')],function(_0x9329b3){var _0x5f14ec={};_0x5f14ec[_0x9329b3]={'$like':'%'+_0x3e2e03[_0x6058('0x38')][_0x6058('0x48')]+'%'};return _0x5f14ec;})});}_0x19050c=_['merge']({},_0x19050c,_0x3e2e03[_0x6058('0x5f')]);return _0x52c618[_0x6058('0x135')](_0x19050c);}})[_0x6058('0x17')](function(_0xfd9991){if(_0xfd9991){_0x5379b0=_0xfd9991[_0x6058('0x3f')];if(!_0x3e2e03[_0x6058('0x38')]['hasOwnProperty'](_0x6058('0x41'))){_0x19050c[_0x6058('0x24')]=qs['limit'](_0x3e2e03[_0x6058('0x38')]['limit']);_0x19050c[_0x6058('0x23')]=qs['offset'](_0x3e2e03[_0x6058('0x38')][_0x6058('0x23')]);}return _0x52c618['getAgents'](_0x19050c);}})['then'](function(_0x2ecca9){if(_0x2ecca9){return _0x2ecca9?{'count':_0x5379b0,'rows':_0x2ecca9}:null;}})[_0x6058('0x17')](respondWithResult(_0x405c21,null))[_0x6058('0x50')](handleError(_0x405c21,null));}; \ No newline at end of file +var _0xcedc=['UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','getDispositions','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','showCustomerAvatar','customerAvatar','notify','setUA','headers','user-agent','getResult','chat','Sequelize','difference','createdAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','updatedAt','DESC','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','fromString','originalname','mimetype','server','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','Chat','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','all','some','server/files/chat/iframe.ejs','address','3.1.0','connection','remoteAddress','referer','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','hideWhenOffline','addApplications','Transaction','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','user'];(function(_0x25ac0f,_0x3e73a3){var _0x2269ef=function(_0x500298){while(--_0x500298){_0x25ac0f['push'](_0x25ac0f['shift']());}};_0x2269ef(++_0x3e73a3);}(_0xcedc,0xd8));var _0xcced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcedc[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xcced('0x0'));var Mustache=require(_0xcced('0x1'));var util=require(_0xcced('0x2'));var path=require(_0xcced('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcced('0x4'));var _=require(_0xcced('0x5'));var querystring=require(_0xcced('0x6'));var Redis=require(_0xcced('0x7'));var qs=require(_0xcced('0x8'));var logger=require(_0xcced('0x9'))('api');var config=require(_0xcced('0xa'));var url=require(_0xcced('0xb'));var db=require('../../mysqldb')['db'];config[_0xcced('0xc')]=_[_0xcced('0xd')](config[_0xcced('0xc')],{'host':_0xcced('0xe'),'port':0x18eb});var socket=require(_0xcced('0xf'))(new Redis(config[_0xcced('0xc')]));require(_0xcced('0x10'))[_0xcced('0x11')](socket);var htmlToText=require(_0xcced('0x12'));var jayson=require('jayson/promise');var client=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232c});var client9002=jayson[_0xcced('0x13')][_0xcced('0x14')]({'port':0x232a});var client9003=jayson[_0xcced('0x13')]['http']({'port':0x232b});var client9001=jayson['client'][_0xcced('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x338705,_0x2d2f4b,_0x5b15d7,_0x315c65){return new BPromise(function(_0x3afab5,_0x4e5aa0){var _0x3e7ed0=_0x315c65||client;return _0x3e7ed0['request'](_0x338705,_0x5b15d7)[_0xcced('0x15')](function(_0x542965){logger['info'](_0xcced('0x16'),_0x2d2f4b,_0xcced('0x17'));logger['debug'](_0xcced('0x18'),_0x2d2f4b,_0xcced('0x17'),JSON[_0xcced('0x19')](_0x542965));if(_0x542965[_0xcced('0x1a')]){if(_0x542965[_0xcced('0x1a')][_0xcced('0x1b')]===0x1f4){logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965['error'][_0xcced('0x1c')]);return _0x4e5aa0(_0x542965[_0xcced('0x1a')]['message']);}logger[_0xcced('0x1a')](_0xcced('0x16'),_0x2d2f4b,_0x542965[_0xcced('0x1a')]['message']);return _0x3afab5(_0x542965[_0xcced('0x1a')][_0xcced('0x1c')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0xcced('0x17'));_0x3afab5(_0x542965['result']['message']);}})[_0xcced('0x1d')](function(_0x3a88da){logger[_0xcced('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x2d2f4b,_0x3a88da);_0x4e5aa0(_0x3a88da);});});}function respondWithStatusCode(_0x36dbdf,_0xdb5c06){_0xdb5c06=_0xdb5c06||0xcc;return function(_0x58acbf){if(_0x58acbf){return _0x36dbdf[_0xcced('0x1e')](_0xdb5c06);}return _0x36dbdf[_0xcced('0x1f')](_0xdb5c06)[_0xcced('0x20')]();};}function respondWithResult(_0x4bf976,_0x4b65e0){_0x4b65e0=_0x4b65e0||0xc8;return function(_0x77182c){if(_0x77182c){return _0x4bf976[_0xcced('0x1f')](_0x4b65e0)[_0xcced('0x21')](_0x77182c);}};}function respondWithFilteredResult(_0x11add6,_0x235945){return function(_0x1198d0){if(_0x1198d0){var _0x59185c=typeof _0x235945['offset']==='undefined'&&typeof _0x235945[_0xcced('0x22')]===_0xcced('0x23');var _0x24315a=_0x1198d0[_0xcced('0x24')];var _0x832dc4=_0x59185c?0x0:_0x235945[_0xcced('0x25')];var _0x10e14e=_0x59185c?_0x1198d0[_0xcced('0x24')]:_0x235945['offset']+_0x235945[_0xcced('0x22')];var _0x101e85;if(_0x10e14e>=_0x24315a){_0x10e14e=_0x24315a;_0x101e85=0xc8;}else{_0x101e85=0xce;}_0x11add6[_0xcced('0x1f')](_0x101e85);return _0x11add6['set']('Content-Range',_0x832dc4+'-'+_0x10e14e+'/'+_0x24315a)[_0xcced('0x21')](_0x1198d0);}return null;};}function saveUpdates(_0x26b3f3){return function(_0x39032a){if(_0x39032a){return _0x39032a[_0xcced('0x26')](_0x26b3f3)['then'](function(_0x42d18a){return _0x42d18a;});}return null;};}function removeEntity(_0x526935){return function(_0x2c2df4){if(_0x2c2df4){return _0x2c2df4[_0xcced('0x27')]()[_0xcced('0x15')](function(){var _0xc010a1=_0x2c2df4[_0xcced('0x28')]({'plain':!![]});var _0x3b1a2b=_0xcced('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3b1a2b,'resourceId':_0xc010a1['id']}})[_0xcced('0x15')](function(){return _0x2c2df4;});})['then'](function(){_0x526935['status'](0xcc)[_0xcced('0x20')]();});}};}function handleEntityNotFound(_0x372c9d){return function(_0x19bb1d){if(!_0x19bb1d){_0x372c9d['sendStatus'](0x194);}return _0x19bb1d;};}function handleError(_0x22af8e,_0xab6363){_0xab6363=_0xab6363||0x1f4;return function(_0x515989){logger[_0xcced('0x1a')](_0x515989[_0xcced('0x2a')]);if(_0x515989[_0xcced('0x2b')]){delete _0x515989[_0xcced('0x2b')];}_0x22af8e['status'](_0xab6363)[_0xcced('0x2c')](_0x515989);};}exports[_0xcced('0x2d')]=function(_0x17c101,_0x25ef31){var _0x489f31={'include':[{'model':db[_0xcced('0x2e')],'as':_0xcced('0x2f')}]},_0xcde5f1={},_0x4a9143={'count':0x0,'rows':[]};var _0x30900=_[_0xcced('0x30')](db[_0xcced('0x31')][_0xcced('0x32')],function(_0x52de0b){return{'name':_0x52de0b[_0xcced('0x33')],'type':_0x52de0b['type'][_0xcced('0x34')]};});_0xcde5f1[_0xcced('0x35')]=_['map'](_0x30900,'name');_0xcde5f1[_0xcced('0x36')]=_[_0xcced('0x37')](_0x17c101[_0xcced('0x36')]);_0xcde5f1[_0xcced('0x38')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],_0xcde5f1[_0xcced('0x36')]);_0x489f31[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xcde5f1[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x17c101[_0xcced('0x36')][_0xcced('0x3b')]));_0x489f31[_0xcced('0x3a')]=_0x489f31[_0xcced('0x3a')][_0xcced('0x3c')]?_0x489f31[_0xcced('0x3a')]:_0xcde5f1[_0xcced('0x35')];if(!_0x17c101[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x489f31['limit']=qs[_0xcced('0x22')](_0x17c101[_0xcced('0x36')][_0xcced('0x22')]);_0x489f31[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x17c101[_0xcced('0x36')]['offset']);}_0x489f31[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x17c101['query'][_0xcced('0x40')]);_0x489f31[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x17c101[_0xcced('0x36')],_0xcde5f1['filters']),_0x30900);if(_0x17c101[_0xcced('0x36')][_0xcced('0x43')]){_0x489f31['where']=_['merge'](_0x489f31[_0xcced('0x41')],{'$or':_['map'](_0x30900,function(_0x84912d){if(_0x84912d[_0xcced('0x44')]!==_0xcced('0x45')){var _0x53ddad={};_0x53ddad[_0x84912d[_0xcced('0x2b')]]={'$like':'%'+_0x17c101[_0xcced('0x36')]['filter']+'%'};return _0x53ddad;}})});}_0x489f31=_[_0xcced('0x46')]({},_0x489f31,_0x17c101['options']);var _0x32d1a1={'where':_0x489f31[_0xcced('0x41')]};return db[_0xcced('0x31')]['count'](_0x32d1a1)[_0xcced('0x15')](function(_0x84dc5e){_0x4a9143['count']=_0x84dc5e;if(_0x17c101['query'][_0xcced('0x47')]){_0x489f31[_0xcced('0x48')]=[{'all':!![]}];}return db[_0xcced('0x31')][_0xcced('0x49')](_0x489f31);})['then'](function(_0x1cc32b){_0x4a9143['rows']=_0x1cc32b;return _0x4a9143;})[_0xcced('0x15')](respondWithFilteredResult(_0x25ef31,_0x489f31))['catch'](handleError(_0x25ef31,null));};exports[_0xcced('0x4a')]=function(_0x478657,_0x362227){var _0x22351d={'raw':![],'where':{'id':_0x478657[_0xcced('0x4b')]['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]},_0x302eed={};_0x302eed[_0xcced('0x35')]=_[_0xcced('0x37')](db[_0xcced('0x31')][_0xcced('0x32')]);_0x302eed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x478657[_0xcced('0x36')]);_0x302eed[_0xcced('0x38')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],_0x302eed['query']);_0x22351d[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x302eed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x478657[_0xcced('0x36')]['fields']));_0x22351d[_0xcced('0x3a')]=_0x22351d['attributes'][_0xcced('0x3c')]?_0x22351d['attributes']:_0x302eed['model'];if(_0x478657[_0xcced('0x36')]['includeAll']){_0x22351d[_0xcced('0x48')]=[{'all':!![]}];}_0x22351d=_['merge']({},_0x22351d,_0x478657[_0xcced('0x4c')]);return db[_0xcced('0x31')][_0xcced('0x4d')](_0x22351d)['then'](handleEntityNotFound(_0x362227,null))['then'](respondWithResult(_0x362227,null))['catch'](handleError(_0x362227,null));};exports[_0xcced('0x4e')]=function(_0x1b8876,_0x4eff77){return db['ChatWebsite'][_0xcced('0x4e')](_0x1b8876['body'],{})[_0xcced('0x15')](function(_0xbaf3a7){var _0x5a44c7=_0x1b8876[_0xcced('0x4f')][_0xcced('0x28')]({'plain':!![]});if(!_0x5a44c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a44c7['role']==='user'){var _0x2547cb=_0xbaf3a7[_0xcced('0x28')]({'plain':!![]});var _0x20f327=_0xcced('0x29');return db[_0xcced('0x50')]['find']({'where':{'name':_0x20f327,'userProfileId':_0x5a44c7['userProfileId']},'raw':!![]})[_0xcced('0x15')](function(_0x5b6915){if(_0x5b6915&&_0x5b6915['autoAssociation']===0x0){return db['UserProfileResource'][_0xcced('0x4e')]({'name':_0x2547cb[_0xcced('0x2b')],'resourceId':_0x2547cb['id'],'type':_0x5b6915[_0xcced('0x2b')],'sectionId':_0x5b6915['id']},{})['then'](function(){return _0xbaf3a7;});}else{return _0xbaf3a7;}})[_0xcced('0x1d')](function(_0x447918){logger['error'](_0xcced('0x51'),_0x447918);throw _0x447918;});}return _0xbaf3a7;})[_0xcced('0x15')](respondWithResult(_0x4eff77,0xc9))[_0xcced('0x1d')](handleError(_0x4eff77,null));};exports[_0xcced('0x26')]=function(_0x4fee8b,_0x5e596f){if(_0x4fee8b['body']['id']){delete _0x4fee8b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4fee8b['params']['id']},'include':[{'model':db['Pause'],'as':_0xcced('0x2f')}]})[_0xcced('0x15')](handleEntityNotFound(_0x5e596f,null))[_0xcced('0x15')](saveUpdates(_0x4fee8b['body'],null))['then'](respondWithResult(_0x5e596f,null))[_0xcced('0x1d')](handleError(_0x5e596f,null));};exports[_0xcced('0x27')]=function(_0x4a6b0e,_0x84156a){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x4a6b0e[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x84156a,null))[_0xcced('0x15')](removeEntity(_0x84156a,null))[_0xcced('0x1d')](handleError(_0x84156a,null));};exports[_0xcced('0x53')]=function(_0x99d1a7,_0x484c22){return db[_0xcced('0x31')]['describe']()[_0xcced('0x15')](respondWithResult(_0x484c22,null))[_0xcced('0x1d')](handleError(_0x484c22,null));};exports['addDisposition']=function(_0x484b01,_0x16bd00){if(_0x484b01[_0xcced('0x52')]['id']){delete _0x484b01[_0xcced('0x52')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x484b01['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16bd00,null))[_0xcced('0x15')](function(_0x203810){if(_0x203810){_0x484b01[_0xcced('0x52')][_0xcced('0x54')]=_0x203810['id'];return db['Disposition']['create'](_0x484b01[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x16bd00,null))[_0xcced('0x1d')](handleError(_0x16bd00,null));};exports[_0xcced('0x55')]=function(_0x5baa67,_0x119b43){var _0x190901={'raw':![],'where':{}};var _0x13ff3b={};var _0x259849={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x5baa67[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119b43,null))[_0xcced('0x15')](function(_0x40bb9b){if(_0x40bb9b){_0x13ff3b['model']=_['keys'](db[_0xcced('0x56')][_0xcced('0x32')]);_0x13ff3b[_0xcced('0x36')]=_[_0xcced('0x37')](_0x5baa67[_0xcced('0x36')]);_0x13ff3b['filters']=_[_0xcced('0x39')](_0x13ff3b['model'],_0x13ff3b[_0xcced('0x36')]);_0x190901[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x13ff3b[_0xcced('0x35')],qs['fields'](_0x5baa67['query'][_0xcced('0x3b')]));_0x190901[_0xcced('0x3a')]=_0x190901[_0xcced('0x3a')][_0xcced('0x3c')]?_0x190901[_0xcced('0x3a')]:_0x13ff3b['model'];if(!_0x5baa67[_0xcced('0x36')]['hasOwnProperty']('nolimit')){_0x190901[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x5baa67[_0xcced('0x36')][_0xcced('0x22')]);_0x190901[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x5baa67[_0xcced('0x36')][_0xcced('0x25')]);}_0x190901[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x5baa67['query']['sort']);_0x190901[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x5baa67[_0xcced('0x36')],_0x13ff3b[_0xcced('0x38')]));_0x190901[_0xcced('0x41')][_0xcced('0x54')]=_0x40bb9b['id'];if(_0x5baa67['query'][_0xcced('0x43')]){_0x190901[_0xcced('0x41')]=_[_0xcced('0x46')](_0x190901[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x190901['attributes'],function(_0x121add){var _0x45eb39={};_0x45eb39[_0x121add]={'$like':'%'+_0x5baa67['query'][_0xcced('0x43')]+'%'};return _0x45eb39;})});}_0x190901=_[_0xcced('0x46')]({},_0x190901,_0x5baa67[_0xcced('0x4c')]);return db[_0xcced('0x56')][_0xcced('0x24')]({'where':_0x190901[_0xcced('0x41')]})['then'](function(_0x4fed9a){_0x259849['count']=_0x4fed9a;if(_0x5baa67[_0xcced('0x36')][_0xcced('0x47')]){_0x190901[_0xcced('0x48')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x190901);})['then'](function(_0x4106a6){_0x259849['rows']=_0x4106a6;return _0x259849;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x119b43,_0x190901))[_0xcced('0x1d')](handleError(_0x119b43,null));};exports[_0xcced('0x57')]=function(_0x905c67,_0x5d9b30){return db[_0xcced('0x31')]['find']({'where':{'id':_0x905c67[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5d9b30,null))[_0xcced('0x15')](function(_0x45c2e4){if(_0x45c2e4){return _0x45c2e4[_0xcced('0x57')](_0x905c67[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x5d9b30,null))['catch'](handleError(_0x5d9b30,null));};exports[_0xcced('0x59')]=function(_0x53628b,_0x1f838a){if(_0x53628b[_0xcced('0x52')]['id']){delete _0x53628b[_0xcced('0x52')]['id'];}return db[_0xcced('0x31')]['find']({'where':{'id':_0x53628b[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x1f838a,null))['then'](function(_0x42bc2b){if(_0x42bc2b){_0x53628b[_0xcced('0x52')]['ChatWebsiteId']=_0x42bc2b['id'];return db[_0xcced('0x5a')][_0xcced('0x4e')](_0x53628b[_0xcced('0x52')]);}})[_0xcced('0x15')](respondWithResult(_0x1f838a,null))[_0xcced('0x1d')](handleError(_0x1f838a,null));};exports[_0xcced('0x5b')]=function(_0x525be4,_0x16a041){var _0x562383={'raw':![],'where':{}};var _0x32c9cf={};var _0x27da9d={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x525be4['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x16a041,null))[_0xcced('0x15')](function(_0x4f4470){if(_0x4f4470){_0x32c9cf[_0xcced('0x35')]=_[_0xcced('0x37')](db['CannedAnswer'][_0xcced('0x32')]);_0x32c9cf[_0xcced('0x36')]=_[_0xcced('0x37')](_0x525be4[_0xcced('0x36')]);_0x32c9cf[_0xcced('0x38')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],_0x32c9cf[_0xcced('0x36')]);_0x562383[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x32c9cf[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x525be4[_0xcced('0x36')][_0xcced('0x3b')]));_0x562383[_0xcced('0x3a')]=_0x562383[_0xcced('0x3a')]['length']?_0x562383[_0xcced('0x3a')]:_0x32c9cf['model'];if(!_0x525be4[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x562383[_0xcced('0x22')]=qs['limit'](_0x525be4[_0xcced('0x36')][_0xcced('0x22')]);_0x562383[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x525be4[_0xcced('0x36')]['offset']);}_0x562383[_0xcced('0x3f')]=qs[_0xcced('0x40')](_0x525be4[_0xcced('0x36')][_0xcced('0x40')]);_0x562383[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x525be4['query'],_0x32c9cf['filters']));_0x562383[_0xcced('0x41')][_0xcced('0x54')]=_0x4f4470['id'];if(_0x525be4[_0xcced('0x36')]['filter']){_0x562383[_0xcced('0x41')]=_[_0xcced('0x46')](_0x562383[_0xcced('0x41')],{'$or':_['map'](_0x562383[_0xcced('0x3a')],function(_0x3525a7){var _0xe5b610={};_0xe5b610[_0x3525a7]={'$like':'%'+_0x525be4[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0xe5b610;})});}_0x562383=_[_0xcced('0x46')]({},_0x562383,_0x525be4['options']);return db['CannedAnswer'][_0xcced('0x24')]({'where':_0x562383[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x2bfda4){_0x27da9d[_0xcced('0x24')]=_0x2bfda4;if(_0x525be4[_0xcced('0x36')]['includeAll']){_0x562383['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xcced('0x49')](_0x562383);})[_0xcced('0x15')](function(_0x59c572){_0x27da9d[_0xcced('0x5c')]=_0x59c572;return _0x27da9d;});}})['then'](respondWithFilteredResult(_0x16a041,_0x562383))[_0xcced('0x1d')](handleError(_0x16a041,null));};exports[_0xcced('0x5d')]=function(_0x38cfe7,_0x128214){return db['ChatWebsite'][_0xcced('0x4d')]({'where':{'id':_0x38cfe7[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x128214,null))['then'](function(_0x3c9f9e){if(_0x3c9f9e){return _0x3c9f9e['removeAnswers'](_0x38cfe7[_0xcced('0x36')][_0xcced('0x58')]);}})[_0xcced('0x15')](respondWithStatusCode(_0x128214,null))[_0xcced('0x1d')](handleError(_0x128214,null));};exports[_0xcced('0x5e')]=function(_0x5492d1,_0x272f80){_0x5492d1[_0xcced('0x52')][_0xcced('0x5f')]=_0x5492d1[_0xcced('0x60')][_0xcced('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x5492d1[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x272f80,null))[_0xcced('0x15')](saveUpdates(_0x5492d1[_0xcced('0x52')],null))['then'](respondWithResult(_0x272f80,null))[_0xcced('0x1d')](handleError(_0x272f80,null));};exports[_0xcced('0x62')]=function(_0x41ad57,_0x333040){_0x41ad57[_0xcced('0x52')][_0xcced('0x63')]=_0x41ad57[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x41ad57['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x333040,null))[_0xcced('0x15')](saveUpdates(_0x41ad57[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x333040,null))[_0xcced('0x1d')](handleError(_0x333040,null));};exports[_0xcced('0x64')]=function(_0x17d186,_0x19b5c0){_0x17d186[_0xcced('0x52')]['customerAvatar']=_0x17d186[_0xcced('0x60')]['filename'];return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x17d186[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19b5c0,null))[_0xcced('0x15')](saveUpdates(_0x17d186[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x19b5c0,null))[_0xcced('0x1d')](handleError(_0x19b5c0,null));};exports[_0xcced('0x65')]=function(_0x2118b8,_0x5b2f65){_0x2118b8[_0xcced('0x52')][_0xcced('0x66')]=_0x2118b8[_0xcced('0x60')][_0xcced('0x61')];return db[_0xcced('0x31')]['find']({'where':{'id':_0x2118b8[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5b2f65,null))[_0xcced('0x15')](saveUpdates(_0x2118b8[_0xcced('0x52')],null))[_0xcced('0x15')](respondWithResult(_0x5b2f65,null))['catch'](handleError(_0x5b2f65,null));};exports[_0xcced('0x67')]=function(_0xb0afae,_0x2ca256){var _0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6a'));var _0x1ac382={'where':{'id':_0xb0afae[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x5f')],'raw':!![]};var _0x720878=![];return require(_0xcced('0x6b'))['getLicense']()[_0xcced('0x15')](function(_0x1bfe9c){if(_0x1bfe9c){_0x720878=_0x1bfe9c[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db[_0xcced('0x31')][_0xcced('0x4d')](_0x1ac382);})[_0xcced('0x15')](handleEntityNotFound(_0x2ca256,null))[_0xcced('0x15')](function(_0x1b6826){if(_0x1b6826){if(!_[_0xcced('0x6d')](_0x1b6826[_0xcced('0x5f')])){if(fs['existsSync'](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]))&&_0x720878){_0x15a356=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x6e'),_0x1b6826[_0xcced('0x5f')]);}}return _0x2ca256[_0xcced('0x6f')](_0x15a356);}})[_0xcced('0x1d')](handleError(_0x2ca256,null));};exports[_0xcced('0x70')]=function(_0x14ffee,_0x4fdb0a){var _0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x71'));var _0x50550f={'where':{'id':_0x14ffee[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x63')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x50550f)[_0xcced('0x15')](handleEntityNotFound(_0x4fdb0a,null))['then'](function(_0x373667){if(_0x373667){if(!_[_0xcced('0x6d')](_0x373667[_0xcced('0x63')])){if(fs[_0xcced('0x72')](path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]))){_0x148f9b=path['join'](config[_0xcced('0x69')],_0xcced('0x73'),_0x373667[_0xcced('0x63')]);}}return _0x4fdb0a[_0xcced('0x6f')](_0x148f9b);}})['catch'](handleError(_0x4fdb0a,null));};exports['getCustomerAvatar']=function(_0x25a117,_0x33ba63){var _0x13e220=path[_0xcced('0x68')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2ba312={'where':{'id':_0x25a117[_0xcced('0x4b')]['id']},'attributes':['id','customerAvatar',_0xcced('0x74')],'raw':!![]};return db['ChatWebsite'][_0xcced('0x4d')](_0x2ba312)['then'](handleEntityNotFound(_0x33ba63,null))[_0xcced('0x15')](function(_0x2c62b1){if(_0x2c62b1){if(!_[_0xcced('0x6d')](_0x2c62b1[_0xcced('0x75')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]))&&_0x2c62b1['showCustomerAvatar']){_0x13e220=path[_0xcced('0x68')](config['root'],_0xcced('0x73'),_0x2c62b1[_0xcced('0x75')]);}}return _0x33ba63[_0xcced('0x6f')](_0x13e220);}})[_0xcced('0x1d')](handleError(_0x33ba63,null));};exports['getSystemAvatar']=function(_0x555258,_0x499f0b){var _0x1e4568=path['join'](config[_0xcced('0x69')],'server/files/images/avatars/system_avatar.png');var _0x5e19d0={'where':{'id':_0x555258[_0xcced('0x4b')]['id']},'attributes':['id',_0xcced('0x66')],'raw':!![]};return db[_0xcced('0x31')][_0xcced('0x4d')](_0x5e19d0)[_0xcced('0x15')](handleEntityNotFound(_0x499f0b,null))[_0xcced('0x15')](function(_0x5d1c05){if(_0x5d1c05){if(!_['isNil'](_0x5d1c05[_0xcced('0x66')])){if(fs[_0xcced('0x72')](path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']))){_0x1e4568=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0x73'),_0x5d1c05['systemAvatar']);}}return _0x499f0b['download'](_0x1e4568);}})['catch'](handleError(_0x499f0b,null));};exports[_0xcced('0x76')]=function(_0x5eeb8c,_0x522b3b){var _0x3feaf0=require('user-agent-parser');var _0x4ff851=new _0x3feaf0();var _0x383a05=_0x4ff851[_0xcced('0x77')](_0x5eeb8c[_0xcced('0x78')][_0xcced('0x79')])[_0xcced('0x7a')]();var _0x4459c1={'body':_0x5eeb8c[_0xcced('0x52')],'channel':_0xcced('0x7b')};var _0x5c607d=[];var _0x1d89cb=[];var _0x204b71={};var _0x3dd0a=![];return db['CmContact'][_0xcced('0x53')]()[_0xcced('0x15')](function(_0x9b5bd4){if(!_0x9b5bd4){throw new db[(_0xcced('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x5c607d=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),[_0xcced('0x7e'),'updatedAt']);_0x1d89cb=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x9b5bd4),['createdAt','updatedAt','CompanyId','ListId']);if(_0x5eeb8c['body']['id']){delete _0x5eeb8c[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x5eeb8c[_0xcced('0x52')]['from'])){throw new db['Sequelize']['ValidationError'](_0xcced('0x7f'));}if(_['isNil'](_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')])||_0x5eeb8c[_0xcced('0x52')]['body']===''){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80'));}if(_['isNil'](_0x5eeb8c['body'][_0xcced('0x81')])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x83')+_0x1d89cb);}if(!_['includes'](_0x1d89cb,_0x5eeb8c[_0xcced('0x52')]['mapKey'])){throw new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0x84')+_0x1d89cb);}_0x204b71[_0x5eeb8c['body'][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];})[_0xcced('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x5eeb8c[_0xcced('0x4b')]['id']},'include':[{'model':db['CmList'],'as':_0xcced('0x86'),'include':[{'model':db[_0xcced('0x87')],'as':_0xcced('0x88'),'where':_0x204b71,'limit':0x1,'order':[[_0xcced('0x89'),_0xcced('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0xcced('0x8b')}]});})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0xd33f51){if(_0xd33f51&&_0xd33f51[_0xcced('0x86')]){_0x4459c1[_0xcced('0x8c')]=_0xd33f51;_0x4459c1[_0xcced('0x8d')]=_0xd33f51['Applications'];_0x4459c1[_0xcced('0x8e')]=_0xd33f51['List'];_0x4459c1['applications']=_[_0xcced('0x8f')](_0x4459c1[_0xcced('0x8d')],[_0xcced('0x90')],[_0xcced('0x91')]);if(_0x4459c1[_0xcced('0x8c')]['Applications']){delete _0x4459c1['account']['Applications'];}if(_0x4459c1[_0xcced('0x8c')]['List']&&_0x4459c1[_0xcced('0x8c')][_0xcced('0x86')][_0xcced('0x88')][_0xcced('0x3c')]){return _0x4459c1[_0xcced('0x8c')][_0xcced('0x86')]['Contacts'][0x0];}var _0x4ae149=_[_0xcced('0xd')](_0x5eeb8c[_0xcced('0x52')],{'firstName':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0xd33f51[_0xcced('0x92')]});_0x4ae149[_0x5eeb8c[_0xcced('0x52')][_0xcced('0x81')]]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0x4e')](_0x4ae149,{'fields':_0x5c607d,'raw':!![]});}})[_0xcced('0x15')](handleEntityNotFound(_0x522b3b,null))[_0xcced('0x15')](function(_0x4a67e9){_0x4459c1[_0xcced('0x93')]=_0x4a67e9;var _0x3b8a26=_0x5eeb8c['body'][_0xcced('0x94')];if(_0x5eeb8c[_0xcced('0x78')][_0xcced('0x95')]){_0x3b8a26=_0x5eeb8c[_0xcced('0x78')]['cf-connecting-ip'];}else if(_0x5eeb8c['headers'][_0xcced('0x96')]){_0x3b8a26=_['first'](_0x5eeb8c[_0xcced('0x78')]['x-forwarded-for'][_0xcced('0x97')](','));}if(_0x4a67e9){var _0x4d89fe={'ContactId':_0x4a67e9['id'],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'from':(_0x4a67e9[_0xcced('0x98')]||'')+'\x20'+(_0x4a67e9[_0xcced('0x99')]||''),'customerIp':_0x3b8a26,'customerPort':_0x5eeb8c['headers']['x-real-port']?_0x5eeb8c[_0xcced('0x78')][_0xcced('0x9a')]:null,'referer':_0x5eeb8c[_0xcced('0x52')]['referer'],'browserName':_0x383a05['browser'][_0xcced('0x2b')]&&_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]?util[_0xcced('0x9d')](_0xcced('0x9e'),_0x383a05['browser']['name'],_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]):_0xcced('0x9f'),'browserVersion':_0x383a05[_0xcced('0x9b')][_0xcced('0x9c')]||'unknown','osName':util[_0xcced('0x9d')]('%s\x20%s',_0x383a05['os'][_0xcced('0x2b')],_0x383a05['os']['version']),'osVersion':_0x383a05['os'][_0xcced('0x9c')],'deviceModel':_0x383a05[_0xcced('0xa0')]['model']&&_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')]?util[_0xcced('0x9d')](_0xcced('0xa2'),_0x383a05['device'][_0xcced('0x35')],_0x383a05[_0xcced('0xa0')]['vendor'],_0x383a05[_0xcced('0xa0')][_0xcced('0x44')]):null,'deviceVendor':_0x383a05[_0xcced('0xa0')][_0xcced('0xa1')],'deviceType':_0x383a05['device'][_0xcced('0x44')],'formData':JSON['stringify'](_0x5eeb8c[_0xcced('0x52')])};var _0x2a9a47={'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'closed':![]};if(_0x5eeb8c[_0xcced('0x52')]['threadId']){_0x2a9a47['threadId']=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];return db[_0xcced('0xa4')][_0xcced('0x4d')]({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x3210d6){if(_0x3210d6){return[_0x3210d6,![]];}_0x4d89fe[_0xcced('0xa3')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')];_0x4d89fe[_0xcced('0xa5')]=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa5')];return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x107f3a){return[_0x107f3a,!![]];});});}_0x2a9a47[_0xcced('0xa6')]=_0x4a67e9['id'];if(_0x5eeb8c[_0xcced('0x52')]['interaction']&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa7')]['id']){_0x2a9a47['id']=_0x5eeb8c[_0xcced('0x52')]['interaction']['id'];return db[_0xcced('0xa4')]['find']({'where':_0x2a9a47})[_0xcced('0x15')](function(_0x5d2836){if(_0x5d2836){return[_0x5d2836,![]];}return db[_0xcced('0xa4')][_0xcced('0x4e')](_0x4d89fe)['then'](function(_0x295105){return[_0x295105,!![]];});});}return db['ChatInteraction'][_0xcced('0x4e')](_0x4d89fe)[_0xcced('0x15')](function(_0x3b04a8){return[_0x3b04a8,!![]];});}})[_0xcced('0xa8')](function(_0x36e66a,_0x4ee948){if(_0x36e66a){_0x3dd0a=_0x4ee948;if(!_0x4ee948){var _0x2481d3={'from':(_0x4459c1['contact'][_0xcced('0x98')]||'')+'\x20'+(_0x4459c1[_0xcced('0x93')][_0xcced('0x99')]||'')};if(_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa3')]&&_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]&&_0x5eeb8c['body']['threadId']!=_0x5eeb8c[_0xcced('0x52')][_0xcced('0xa9')]){_0x2481d3[_0xcced('0xa3')]=_0x5eeb8c['body'][_0xcced('0xa9')];}return _0x36e66a[_0xcced('0x26')](_0x2481d3);}else{return _0x36e66a;}}})['then'](function(_0x4d7979){_0x4459c1[_0xcced('0xa7')]=_0x4d7979['get']({'plain':!![]});_0x4459c1['interaction'][_0xcced('0xaa')]=_0x3dd0a;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xaa')]){if(_0x4459c1['account'][_0xcced('0xab')]){_0x4459c1[_0xcced('0x8d')][_0xcced('0xac')]({'id':0x0,'priority':_0x4459c1[_0xcced('0x8d')][_0xcced('0x3c')]+0x1,'app':_0xcced('0xad'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xcced('0xae')][_0xcced('0x4e')]({'body':_0x5eeb8c[_0xcced('0x52')][_0xcced('0x52')],'ChatWebsiteId':_0x5eeb8c[_0xcced('0x4b')]['id'],'ChatInteractionId':_0x4d7979['id'],'direction':'in','ContactId':_0x4459c1['contact']['id'],'AttachmentId':_0x5eeb8c['body'][_0xcced('0xaf')]});})[_0xcced('0x15')](function(_0x2d4011){_0x4459c1[_0xcced('0x1c')]=_0x2d4011;if(_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]){return db[_0xcced('0xb1')]['find']({'attributes':['id',_0xcced('0x2b')],'where':{'id':_0x4459c1[_0xcced('0xa7')][_0xcced('0xb0')]}})['then'](function(_0x5a038d){if(_0x5a038d){_0x4459c1[_0xcced('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcced('0xb2'),'appdata':_0x5a038d[_0xcced('0x2b')]+','+(_0x4459c1[_0xcced('0x8c')][_0xcced('0xb3')]||0xa),'interval':_0xcced('0xb4')});_0x4459c1[_0xcced('0xb5')]=!![];}return respondWithRpcPromise(_0xcced('0xb6'),'startRouting',_0x4459c1);});}return respondWithRpcPromise(_0xcced('0xb6'),_0xcced('0xb7'),_0x4459c1);})[_0xcced('0x15')](function(_0x272749){respondWithRpcPromise(_0xcced('0xb8'),_0xcced('0xb8'),{'event':_0xcced('0x76'),'message':_0x272749},client9002);return _0x272749;})[_0xcced('0x15')](respondWithResult(_0x522b3b,null))[_0xcced('0x1d')](handleError(_0x522b3b,null));};exports[_0xcced('0xb9')]=function(_0x1e2f2a,_0x12b3e7){var _0x59d4cc,_0x4031c4,_0x4f095a;var _0x15de88=[];var _0x11b81a={};var _0x577af7=_0x1e2f2a[_0xcced('0xba')]||[];var _0x115654=[];var _0x1849be;return db['CmContact']['describe']()[_0xcced('0x15')](function(_0x5ee873){if(!_0x5ee873){throw new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0xbb'));}_0x15de88=_[_0xcced('0x7d')](_[_0xcced('0x37')](_0x5ee873),[_0xcced('0x7e'),_0xcced('0x89'),_0xcced('0xbc'),_0xcced('0x92')]);if(_0x1e2f2a['body']['id']){delete _0x1e2f2a[_0xcced('0x52')]['id'];}if(_[_0xcced('0x6d')](_0x1e2f2a[_0xcced('0x52')]['from'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))]('from\x20is\x20mandatory'));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['body'])||_0x1e2f2a[_0xcced('0x52')][_0xcced('0x52')]===''){throw _0x12b3e7['status'](0x1f4)['send'](new db[(_0xcced('0x7c'))]['ValidationError'](_0xcced('0x80')));}if(_[_0xcced('0x6d')](_0x1e2f2a['body']['mapKeyOffline'])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbd')+_0x15de88));}if(!_['includes'](_0x15de88,_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')])){throw _0x12b3e7[_0xcced('0x1f')](0x1f4)[_0xcced('0x2c')](new db[(_0xcced('0x7c'))][(_0xcced('0x82'))](_0xcced('0xbf')+_0x15de88));}_0x11b81a[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];})['then'](function(){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x1e2f2a[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xc0')],'as':'List'},{'model':db[_0xcced('0xc1')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x12b3e7,null))['then'](function(_0x4052d4){if(_0x4052d4&&_0x4052d4[_0xcced('0x86')]){_0x4031c4=_0x4052d4;var _0x3b0a30=_['defaults'](_0x1e2f2a['body'],{'firstName':_0x1e2f2a[_0xcced('0x52')]['from'],'phone':_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')],'ListId':_0x4052d4['ListId']});_0x3b0a30[_0x1e2f2a[_0xcced('0x52')][_0xcced('0xbe')]]=_0x1e2f2a[_0xcced('0x52')][_0xcced('0x85')];return db[_0xcced('0x87')][_0xcced('0xc2')]({'where':_0x11b81a,'defaults':_0x3b0a30});}})['spread'](function(_0xeb64f){if(_0xeb64f){_0x4f095a=_0xeb64f;var _0x5781de=fs[_0xcced('0xc3')](path['join'](config[_0xcced('0x69')],_0xcced('0xc4')),_0xcced('0xc5'));var _0x4c2a79=ejs['render'](_0x5781de,{'body':_['toPairs'](_0x1e2f2a['body']['body']),'bodyTitle':_0x4031c4['offlineMessageBody']});return db['ChatOfflineMessage'][_0xcced('0x4e')]({'body':_0x4c2a79,'plainBody':htmlToText[_0xcced('0xc6')](_0x4c2a79),'ContactId':_0xeb64f['id'],'ChatWebsiteId':_0x4031c4['id']});}})[_0xcced('0x15')](function(_0x41900b){_0x1849be=_0x41900b;if(_0x577af7[_0xcced('0x3c')]){var _0xf45315=_0x577af7['map'](function(_0x5a7a57){return{'name':_0x5a7a57[_0xcced('0xc7')],'basename':_0x5a7a57[_0xcced('0x61')],'type':_0x5a7a57[_0xcced('0xc8')],'ChatOfflineMessageId':_0x41900b['id']};});_0x115654=_0xf45315[_0xcced('0x30')](_0x4712d5=>{var _0x167f79={'filename':_0x4712d5['name'],'path':path[_0xcced('0x68')](config['root'],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x4712d5[_0xcced('0xcc')])};return _0x167f79;});if(!_0x4031c4['openNewInteraction']){return db[_0xcced('0xcd')][_0xcced('0xce')](function(_0x80f9f6){return db[_0xcced('0xcf')][_0xcced('0xd0')](_0xf45315,{'transaction':_0x80f9f6});});}}})[_0xcced('0x15')](function(){if(_0x1849be){_0x59d4cc=_0x1849be;return db[_0xcced('0xc1')][_0xcced('0xd1')]({'where':{'service':!![]},'include':[{'model':db[_0xcced('0xd2')],'as':_0xcced('0xd3'),'raw':!![],'include':[{'model':db[_0xcced('0xd4')],'as':_0xcced('0xd4'),'raw':!![]}]}]});}})[_0xcced('0x15')](function(_0x5db023){if(_0x5db023&&_0x5db023[_0xcced('0xd3')]&&_0x4031c4[_0xcced('0xd5')]&&_0x4031c4[_0xcced('0xd6')]){var _0x24ea2d=_0x5db023[_0xcced('0xd7')]();return respondWithRpcPromise(_0xcced('0xd8'),'sendMail',{'account':_0x24ea2d,'message':{'from':util[_0xcced('0x9d')]('\x22%s\x22\x20<%s>',_0x5db023[_0xcced('0x2b')],_0x5db023[_0xcced('0xd9')]||_0x5db023[_0xcced('0xd3')]['user']),'to':_0x4031c4['forwardOfflineAddress'],'subject':_0x4031c4[_0xcced('0xda')],'html':_0x59d4cc[_0xcced('0x52')],'attachments':_0x115654}},client9003)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x19a6a9){logger[_0xcced('0x1a')](_0x19a6a9);});}})[_0xcced('0x15')](function(){if(_0x4031c4&&_0x4031c4['openNewInteraction']&&_0x4031c4[_0xcced('0xdb')]){var _0x463694=[];if(_0x577af7[_0xcced('0x3c')]){_0x463694=_0x577af7[_0xcced('0x30')](function(_0x57659d){return{'name':_0x57659d[_0xcced('0xc7')],'basename':_0x57659d[_0xcced('0x61')],'type':_0x57659d['mimetype'],'ChatOfflineMessageId':_0x1849be['id']};});}var _0x30b372;if(!_[_0xcced('0x6d')](_0x4031c4['subjectOffline'])){var _0x3cb87b=_['map'](_0x1e2f2a[_0xcced('0x52')],function(_0x3eac32){return _0x3eac32;});var _0x5cf6e7=_['toPairsIn'](_0x3cb87b)[0x0];var _0x314276=_[_0xcced('0xdc')](_0x5cf6e7,function(_0x5038e4){return _0x5038e4;});_0x30b372=_0x314276[0x1][_0x4031c4[_0xcced('0xdd')]];}var _0x186eb6={'from':_0x4f095a[_0xcced('0xd9')],'firstName':_0x4f095a[_0xcced('0x98')],'lastName':_0x4f095a['lastName'],'mapKey':_0xcced('0xd9'),'message':{'from':_0x4f095a['email'],'to':_0x4031c4['MailAccount'][_0xcced('0xd9')],'cc':'','subject':_[_0xcced('0x6d')](_0x30b372)?_0x4031c4[_0xcced('0xda')]:_0x30b372,'messageId':'','sentAt':new Date(),'attach':_0x463694[_0xcced('0x3c')],'attachments':_0x463694,'originChannel':_0xcced('0xde'),'ChatWebsiteId':_0x4031c4['id'],'ChatOfflineMessageId':_0x59d4cc['id'],'originTo':_0x4031c4[_0xcced('0xc1')]['email']},'body':_0x59d4cc[_0xcced('0x52')]};var _0x487548={'account':{'id':_0x4031c4[_0xcced('0xdb')]},'body':_0x186eb6,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xcced('0xdf'),_0x487548,client9001)[_0xcced('0x15')](function(){return _0x59d4cc;})[_0xcced('0x1d')](function(_0x1b0f41){logger[_0xcced('0x1a')](_0x1b0f41);});}return;})[_0xcced('0x15')](function(){if(_0x59d4cc){return _0x59d4cc;}})[_0xcced('0x15')](respondWithResult(_0x12b3e7,null))[_0xcced('0x1d')](function(_0x412ceb){logger[_0xcced('0x1a')](_0xcced('0x1d'),_0x412ceb);for(var _0x25cc19 of _0x577af7){var _0x5c565f=path[_0xcced('0x68')](config[_0xcced('0x69')],_0xcced('0xc9'),_0xcced('0xba'),_0xcced('0xca'),_0xcced('0xcb'),_0x25cc19[_0xcced('0x61')]);fs_extra[_0xcced('0xe0')](_0x5c565f)[_0xcced('0x1d')](function(_0x5af517){logger[_0xcced('0x1a')](_0xcced('0xe1'),_0x5c565f,_0x5af517);});}});};exports[_0xcced('0xe2')]=function(_0x444000,_0x20b258){return db[_0xcced('0xa4')]['find']({'where':{'id':_0x444000[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x20b258,null))[_0xcced('0x15')](function(_0x5c2028){if(_0x5c2028){return _0x5c2028[_0xcced('0xe2')](_0x444000['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x444000[_0xcced('0x52')],['ids','id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x20b258,null))[_0xcced('0x1d')](handleError(_0x20b258,null));};exports[_0xcced('0xe4')]=function(_0x4965ad,_0x523cec){var _0x1dabe1={'raw':![],'where':{}};var _0x6f026a={};var _0xcd7f43={'count':0x0,'rows':[]};return db[_0xcced('0x31')]['findOne']({'where':{'id':_0x4965ad[_0xcced('0x4b')]['id']}})['then'](handleEntityNotFound(_0x523cec,null))[_0xcced('0x15')](function(_0x16bcd9){if(_0x16bcd9){_0x6f026a[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatInteraction']['rawAttributes']);_0x6f026a[_0xcced('0x36')]=_[_0xcced('0x37')](_0x4965ad[_0xcced('0x36')]);_0x6f026a[_0xcced('0x38')]=_[_0xcced('0x39')](_0x6f026a[_0xcced('0x35')],_0x6f026a['query']);_0x1dabe1[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x6f026a['model'],qs['fields'](_0x4965ad[_0xcced('0x36')][_0xcced('0x3b')]));_0x1dabe1[_0xcced('0x3a')]=_0x1dabe1[_0xcced('0x3a')][_0xcced('0x3c')]?_0x1dabe1[_0xcced('0x3a')]:_0x6f026a[_0xcced('0x35')];if(!_0x4965ad[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x1dabe1[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x4965ad[_0xcced('0x36')][_0xcced('0x22')]);_0x1dabe1[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x4965ad[_0xcced('0x36')][_0xcced('0x25')]);}_0x1dabe1['order']=qs[_0xcced('0x40')](_0x4965ad['query'][_0xcced('0x40')]);_0x1dabe1[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x4965ad[_0xcced('0x36')],_0x6f026a[_0xcced('0x38')]));_0x1dabe1['where'][_0xcced('0x54')]=_0x16bcd9['id'];if(_0x4965ad['query'][_0xcced('0x43')]){_0x1dabe1[_0xcced('0x41')]=_[_0xcced('0x46')](_0x1dabe1[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x1dabe1[_0xcced('0x3a')],function(_0x20091f){var _0x5e623f={};_0x5e623f[_0x20091f]={'$like':'%'+_0x4965ad['query'][_0xcced('0x43')]+'%'};return _0x5e623f;})});}_0x1dabe1=_[_0xcced('0x46')]({},_0x1dabe1,_0x4965ad[_0xcced('0x4c')]);return db[_0xcced('0xa4')][_0xcced('0x24')]({'where':_0x1dabe1[_0xcced('0x41')]})[_0xcced('0x15')](function(_0x320def){_0xcd7f43[_0xcced('0x24')]=_0x320def;if(_0x4965ad[_0xcced('0x36')][_0xcced('0x47')]){_0x1dabe1[_0xcced('0x48')]=[{'model':db[_0xcced('0x87')],'as':'Contact','required':![]},{'model':db[_0xcced('0xb1')],'as':_0xcced('0xe5'),'attributes':[_0xcced('0x2b'),_0xcced('0xe6'),_0xcced('0xe7')],'required':![]},{'model':db['Tag'],'as':_0xcced('0xe8'),'attributes':['id','name',_0xcced('0xe9')],'where':_0x4965ad[_0xcced('0x36')]['tag']?{'id':_0x4965ad['query']['tag']}:undefined,'required':_0x4965ad[_0xcced('0x36')][_0xcced('0xea')]?!![]:![]}];}return db[_0xcced('0xa4')][_0xcced('0x49')](_0x1dabe1);})['then'](function(_0x397b0e){_0xcd7f43[_0xcced('0x5c')]=_0x397b0e;return _0xcd7f43;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x523cec,_0x1dabe1))[_0xcced('0x1d')](handleError(_0x523cec,null));};function iftimePromise(_0xbbf619,_0x6cf794){return respondWithRpcPromise(_0xcced('0xeb'),'getSnippet',{'command':_0x6cf794[_0xcced('0xec')]?util[_0xcced('0x9d')](_0xcced('0xed'),_0xbbf619[_0xcced('0xee')],_0x6cf794[_0xcced('0xec')]):util[_0xcced('0x9d')](_0xcced('0xef'),_0xbbf619[_0xcced('0xee')])},client9002)['then'](function(_0x2c2fe3){var _0x203b49=_0x2c2fe3&&_0x2c2fe3['indexOf'](_0xcced('0xf0'))>=0x0?!![]:![];logger[_0xcced('0xf1')](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],_0x203b49?_0xcced('0xf3'):_0xcced('0xf4'),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return _0x203b49;})[_0xcced('0x1d')](function(_0x3787f4){logger['error'](_0xcced('0xf2'),_0x6cf794['id'],_0xbbf619['id'],_0xbbf619[_0xcced('0xee')],util[_0xcced('0xf6')](_0x3787f4,{'showHidden':![],'depth':null}),_0x6cf794[_0xcced('0xec')]?_0x6cf794[_0xcced('0xec')]:_0xcced('0xf5'));return![];});}exports[_0xcced('0xf7')]=function(_0x5a9723,_0x20ae4c){var _0x413b6e=0x0;var _0xdc49da=0x0;var _0x7fc2ba=![];var _0x31a461;var _0x118083;return db[_0xcced('0x31')]['find']({'where':{'id':_0x5a9723[_0xcced('0x4b')]['id']},'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf8'),'include':[{'model':db[_0xcced('0xf8')],'as':_0xcced('0xf9'),'attributes':['id',_0xcced('0xee')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20ae4c,null))[_0xcced('0x15')](function(_0x291489){if(_0x291489){_0x31a461=_0x291489;return _0x291489[_0xcced('0xfa')]({'raw':!![]});}})['then'](function(_0x1f9241){if(_0x31a461){if(_0x1f9241){_0x118083=_0x1f9241;}}return require(_0xcced('0x6b'))[_0xcced('0xfb')]();})[_0xcced('0x15')](function(_0x42f5a6){if(_0x42f5a6){_0xdc49da=_0x42f5a6[_0xcced('0xfc')];_0x7fc2ba=_0x42f5a6[_0xcced('0x6c')];}})[_0xcced('0x15')](function(){return db['ChatInteraction'][_0xcced('0x24')]({'where':{'closed':![]}});})[_0xcced('0x15')](function(_0x50a525){_0x413b6e=_0x50a525;if(_0xdc49da&&_0x50a525>_0xdc49da){return db[_0xcced('0xfd')][_0xcced('0xd1')]({'where':{'id':0x1}})[_0xcced('0x15')](function(_0x102e65){if(_0x102e65){_0x102e65['increment']('chatLicenseExceeded');}});}})[_0xcced('0x15')](function(){if(_0x31a461[_0xcced('0xf8')]&&_0x31a461[_0xcced('0xf8')]['Intervals']){var _0x3750a2=[];for(var _0x354e7c=0x0;_0x354e7c<_0x31a461[_0xcced('0xf8')]['Intervals'][_0xcced('0x3c')];_0x354e7c++){var _0x21be6c=_0x31a461[_0xcced('0xf8')]['Intervals'][_0x354e7c][_0xcced('0x28')]({'plain':!![]});_0x3750a2[_0xcced('0xac')](iftimePromise(_0x21be6c,_0x31a461));}return BPromise[_0xcced('0xfe')](_0x3750a2)['then'](function(_0x3c11e7){return _[_0xcced('0xff')](_0x3c11e7);});}else{return!![];}})[_0xcced('0x15')](function(_0x55e362){var _0x44abed=fs[_0xcced('0xc3')](path[_0xcced('0x68')](config['root'],_0xcced('0x100')),_0xcced('0xc5'));var _0x5887b3=new url['URL'](_0x31a461[_0xcced('0x101')])['origin'];var _0x4b88ad=_0xcced('0x102');var _0xaa4b44=![];var _0x1ea1ff={'chatVersion':_0x4b88ad,'chatWebsiteAddressOrigin':_0x5887b3,'remote':_0x31a461['remote'],'query':querystring[_0xcced('0x19')](_[_0xcced('0x46')](_0x31a461['get']({'plain':!![]}),{'customerIp':_0x5a9723['headers'][_0xcced('0x96')]||_0x5a9723[_0xcced('0x78')]['x-real-ip']||_0x5a9723[_0xcced('0x103')][_0xcced('0x104')]||_0x5a9723['ip'],'referer':_0x5a9723[_0xcced('0x78')][_0xcced('0x105')],'openedInteractions':_0x413b6e,'maxInteractions':_0xdc49da,'virtual':_0x7fc2ba[_0xcced('0xfc')],'online':_0x55e362,'custom':_0x7fc2ba}))[_0xcced('0x106')](/'/g,'\x5c\x27')};_0x20ae4c[_0xcced('0x2c')](ejs[_0xcced('0x107')](Mustache['render'](_0x44abed,_0x1ea1ff),{'proactiveActions':_0x118083,'alignment':_0x31a461[_0xcced('0x108')],'verticalAlignment':_0x31a461[_0xcced('0x109')],'div_color':_0x31a461[_0xcced('0xe9')],'labelText':_0x31a461['labelText'],'text_color':_0x31a461[_0xcced('0x10a')],'text_button_color':_0x31a461['textButtonColor'],'button_color':_0x31a461[_0xcced('0x10b')],'background_color':_0x31a461[_0xcced('0x10c')],'hideWhenOffline':_0x31a461[_0xcced('0x10d')],'intervalId':_0x31a461['IntervalId'],'isDevelopment':_0xaa4b44,'chatVersion':_0x4b88ad}));})[_0xcced('0x1d')](handleError(_0x20ae4c,null));};exports[_0xcced('0x10e')]=function(_0x537fb1,_0x19cabf){var _0x1df2c1=_0x537fb1[_0xcced('0x4b')]['id'];var _0x1fba43=_0x537fb1[_0xcced('0x52')];var _0x1625a2=0xc8;var _0xba9177=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0xcced('0x10f')]['ISOLATION_LEVELS'][_0xcced('0x110')]},function(_0x483116){return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(_0xae1e6c){if(_0xae1e6c){return db['ChatApplication'][_0xcced('0x27')]({'where':{'ChatWebsiteId':_0x1df2c1},'transaction':_0x483116})[_0xcced('0x15')](function(){var _0xc4d6e1=_[_0xcced('0x30')](_0x1fba43,function(_0x424acb){_0x424acb[_0xcced('0x54')]=_0x1df2c1;return _0x424acb;});return db[_0xcced('0x111')][_0xcced('0xd0')](_0xc4d6e1,{'transaction':_0x483116});});}else{_0x1625a2=0x194;_0xba9177=[];}});})[_0xcced('0x15')](function(){if(_0x1625a2!==0x194){return db[_0xcced('0x111')][_0xcced('0x112')]({'where':{'ChatWebsiteId':_0x1df2c1},'order':_0xcced('0x90')})['then'](function(_0x6f4603){_0xba9177=_0x6f4603;});}})[_0xcced('0x1d')](function(_0x7e965b){_0x1625a2=0x1f4;logger[_0xcced('0x1a')](_0x7e965b[_0xcced('0x2a')]);if(_0x7e965b[_0xcced('0x2b')]){delete _0x7e965b[_0xcced('0x2b')];}_0xba9177=_0x7e965b;})[_0xcced('0x113')](function(){if(_0xba9177===null){_0x19cabf[_0xcced('0x1e')](_0x1625a2);}else{if(_0x1625a2===0x1f4){_0x19cabf[_0xcced('0x1f')](_0x1625a2)['send'](_0xba9177);}else{_0x19cabf[_0xcced('0x1f')](_0x1625a2)[_0xcced('0x21')](_0xba9177);}}});};exports['getApplications']=function(_0x1c0aef,_0x5752e7){var _0x508a2c={};var _0x5519d2={};var _0x5abb43;var _0x13a150;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x1c0aef[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x5752e7,null))[_0xcced('0x15')](function(_0x35b680){if(_0x35b680){_0x5abb43=_0x35b680;_0x5519d2[_0xcced('0x35')]=_[_0xcced('0x37')](db['ChatApplication']['rawAttributes']);_0x5519d2[_0xcced('0x36')]=_['keys'](_0x1c0aef[_0xcced('0x36')]);_0x5519d2['filters']=_['intersection'](_0x5519d2[_0xcced('0x35')],_0x5519d2['query']);_0x508a2c[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x5519d2[_0xcced('0x35')],qs['fields'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x3b')]));_0x508a2c['attributes']=_0x508a2c[_0xcced('0x3a')][_0xcced('0x3c')]?_0x508a2c[_0xcced('0x3a')]:_0x5519d2['model'];_0x508a2c[_0xcced('0x3f')]=qs['sort'](_0x1c0aef['query'][_0xcced('0x40')]);_0x508a2c[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x1c0aef[_0xcced('0x36')],_0x5519d2[_0xcced('0x38')]));if(_0x1c0aef[_0xcced('0x36')][_0xcced('0x43')]){_0x508a2c[_0xcced('0x41')]=_['merge'](_0x508a2c['where'],{'$or':_[_0xcced('0x30')](_0x508a2c[_0xcced('0x3a')],function(_0x5c0d5d){var _0x16ed51={};_0x16ed51[_0x5c0d5d]={'$like':'%'+_0x1c0aef['query']['filter']+'%'};return _0x16ed51;})});}_0x508a2c=_['merge']({},_0x508a2c,_0x1c0aef[_0xcced('0x4c')]);return _0x5abb43['getApplications'](_0x508a2c);}})[_0xcced('0x15')](function(_0x2360e3){if(_0x2360e3){_0x13a150=_0x2360e3[_0xcced('0x3c')];if(!_0x1c0aef[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x508a2c['limit']=qs[_0xcced('0x22')](_0x1c0aef['query'][_0xcced('0x22')]);_0x508a2c[_0xcced('0x25')]=qs['offset'](_0x1c0aef[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5abb43[_0xcced('0x114')](_0x508a2c);}})[_0xcced('0x15')](function(_0x21f992){if(_0x21f992){return _0x21f992?{'count':_0x13a150,'rows':_0x21f992}:null;}})[_0xcced('0x15')](respondWithResult(_0x5752e7,null))[_0xcced('0x1d')](handleError(_0x5752e7,null));};exports['addProactiveActions']=function(_0x475627,_0x110077){return db[_0xcced('0x115')][_0xcced('0x4d')]({'where':{'id':_0x475627['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x110077,null))['then'](function(_0x38fc70){if(_0x38fc70){return _0x38fc70['addProactiveActions'](_0x475627[_0xcced('0x52')][_0xcced('0x58')],_['omit'](_0x475627[_0xcced('0x52')],[_0xcced('0x58'),'id'])||{});}})[_0xcced('0x15')](respondWithResult(_0x110077,null))[_0xcced('0x1d')](handleError(_0x110077,null));};exports[_0xcced('0xfa')]=function(_0x23c4a0,_0x2001f5){var _0x3fa897={};var _0x2ea578={};var _0x5bcf03;var _0x4522e1;return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x23c4a0[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x2001f5,null))[_0xcced('0x15')](function(_0x250d2a){if(_0x250d2a){_0x5bcf03=_0x250d2a;_0x2ea578[_0xcced('0x35')]=_['keys'](db[_0xcced('0x116')]['rawAttributes']);_0x2ea578[_0xcced('0x36')]=_['keys'](_0x23c4a0[_0xcced('0x36')]);_0x2ea578['filters']=_['intersection'](_0x2ea578[_0xcced('0x35')],_0x2ea578[_0xcced('0x36')]);_0x3fa897[_0xcced('0x3a')]=_[_0xcced('0x39')](_0x2ea578['model'],qs[_0xcced('0x3b')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x3b')]));_0x3fa897[_0xcced('0x3a')]=_0x3fa897[_0xcced('0x3a')][_0xcced('0x3c')]?_0x3fa897[_0xcced('0x3a')]:_0x2ea578[_0xcced('0x35')];_0x3fa897['order']=qs[_0xcced('0x40')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x40')]);_0x3fa897['where']=qs[_0xcced('0x38')](_['pick'](_0x23c4a0[_0xcced('0x36')],_0x2ea578[_0xcced('0x38')]));if(_0x23c4a0['query'][_0xcced('0x43')]){_0x3fa897[_0xcced('0x41')]=_[_0xcced('0x46')](_0x3fa897[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x3fa897['attributes'],function(_0x20ee43){var _0x5201ca={};_0x5201ca[_0x20ee43]={'$like':'%'+_0x23c4a0[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x5201ca;})});}_0x3fa897=_[_0xcced('0x46')]({},_0x3fa897,_0x23c4a0[_0xcced('0x4c')]);return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})[_0xcced('0x15')](function(_0x4f74ab){if(_0x4f74ab){_0x4522e1=_0x4f74ab[_0xcced('0x3c')];if(!_0x23c4a0[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x3fa897[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x22')]);_0x3fa897[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x23c4a0[_0xcced('0x36')][_0xcced('0x25')]);}return _0x5bcf03[_0xcced('0xfa')](_0x3fa897);}})['then'](function(_0x126d2c){if(_0x126d2c){return _0x126d2c?{'count':_0x4522e1,'rows':_0x126d2c}:null;}})[_0xcced('0x15')](respondWithResult(_0x2001f5,null))[_0xcced('0x1d')](handleError(_0x2001f5,null));};exports[_0xcced('0x117')]=function(_0x541e29,_0x3d97b5){var _0x4df014=_0x541e29[_0xcced('0x36')][_0xcced('0x118')]===_0xcced('0x119')?_0xcced('0x11a'):_0xcced('0x11b');return db['ChatWebsite']['find']({'attributes':['id',_0x4df014],'where':{'id':_0x541e29['params']['id']}})['then'](handleEntityNotFound(_0x3d97b5,null))[_0xcced('0x15')](function(_0x21c43d){if(_0x21c43d){var _0x11050f=_0x21c43d[_0x4df014];var _0x1bd368=_0x11050f&&_0x11050f[_0xcced('0x11c')]?_0x11050f[_0xcced('0x11c')]:[];_0x3d97b5[_0xcced('0x2c')]({'fromKey':_[_0xcced('0x6d')](_0x11050f['fromKey'])?undefined:_0x11050f[_0xcced('0x11d')],'count':_0x1bd368[_0xcced('0x3c')],'rows':_0x1bd368});}})[_0xcced('0x1d')](handleError(_0x3d97b5,null));};exports[_0xcced('0x11e')]=function(_0x54e75f,_0x559c0f){var _0x32f99f={'raw':![],'where':{}};var _0xc4c0ed={};var _0x3410d0={'count':0x0,'rows':[]};return db[_0xcced('0x31')][_0xcced('0xd1')]({'where':{'id':_0x54e75f['params']['id']}})['then'](handleEntityNotFound(_0x559c0f,null))['then'](function(_0x18dca6){if(_0x18dca6){_0xc4c0ed['model']=_[_0xcced('0x37')](db[_0xcced('0x11f')]['rawAttributes']);_0xc4c0ed[_0xcced('0x36')]=_[_0xcced('0x37')](_0x54e75f[_0xcced('0x36')]);_0xc4c0ed[_0xcced('0x38')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],_0xc4c0ed[_0xcced('0x36')]);_0x32f99f[_0xcced('0x3a')]=_[_0xcced('0x39')](_0xc4c0ed[_0xcced('0x35')],qs[_0xcced('0x3b')](_0x54e75f[_0xcced('0x36')][_0xcced('0x3b')]));_0x32f99f[_0xcced('0x3a')]=_0x32f99f[_0xcced('0x3a')]['length']?_0x32f99f['attributes']:_0xc4c0ed[_0xcced('0x35')];if(!_0x54e75f[_0xcced('0x36')][_0xcced('0x3d')](_0xcced('0x3e'))){_0x32f99f[_0xcced('0x22')]=qs[_0xcced('0x22')](_0x54e75f[_0xcced('0x36')][_0xcced('0x22')]);_0x32f99f[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x54e75f['query']['offset']);}_0x32f99f[_0xcced('0x3f')]=qs['sort'](_0x54e75f['query'][_0xcced('0x40')]);_0x32f99f[_0xcced('0x41')]=qs['filters'](_[_0xcced('0x42')](_0x54e75f[_0xcced('0x36')],_0xc4c0ed[_0xcced('0x38')]));_0x32f99f['where'][_0xcced('0x54')]=_0x18dca6['id'];if(_0x54e75f[_0xcced('0x36')]['filter']){_0x32f99f['where']=_[_0xcced('0x46')](_0x32f99f[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x32f99f[_0xcced('0x3a')],function(_0x4f63c9){var _0x53b4b8={};_0x53b4b8[_0x4f63c9]={'$like':'%'+_0x54e75f[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x53b4b8;})});}_0x32f99f=_[_0xcced('0x46')]({},_0x32f99f,_0x54e75f[_0xcced('0x4c')]);return db[_0xcced('0x11f')]['count']({'where':_0x32f99f[_0xcced('0x41')]})[_0xcced('0x15')](function(_0xe329ab){_0x3410d0['count']=_0xe329ab;if(_0x54e75f[_0xcced('0x36')][_0xcced('0x47')]){_0x32f99f['include']=[{'all':!![]}];}else{_0x32f99f['include']=[{'model':db[_0xcced('0x87')],'as':_0xcced('0x120'),'required':![]},{'model':db[_0xcced('0xcf')],'as':_0xcced('0x121'),'required':![]}];}return db[_0xcced('0x11f')][_0xcced('0x49')](_0x32f99f);})[_0xcced('0x15')](function(_0x19f355){_0x3410d0[_0xcced('0x5c')]=_0x19f355;return _0x3410d0;});}})[_0xcced('0x15')](respondWithFilteredResult(_0x559c0f,_0x32f99f))[_0xcced('0x1d')](handleError(_0x559c0f,null));};exports[_0xcced('0x122')]=function(_0x3675f4,_0x562457){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x3675f4[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x562457,null))[_0xcced('0x15')](function(_0x3472ec){if(_0x3472ec){return _0x3472ec[_0xcced('0x122')](_0x3675f4['body'][_0xcced('0x58')],_[_0xcced('0xe3')](_0x3675f4[_0xcced('0x52')],['ids','id'])||{})[_0xcced('0xa8')](function(_0x27a447){for(var _0x14e490=0x0;_0x14e490<_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0xcced('0x3c')];_0x14e490+=0x1){socket[_0xcced('0x123')](_0xcced('0x124'),{'UserId':Number(_0x3675f4[_0xcced('0x52')][_0xcced('0x58')][_0x14e490]),'ChatWebsiteId':Number(_0x3675f4[_0xcced('0x4b')]['id'])});}return _0x27a447;});}})[_0xcced('0x15')](respondWithResult(_0x562457,null))[_0xcced('0x1d')](handleError(_0x562457,null));};exports['removeAgents']=function(_0x160764,_0x4d0d2c){return db[_0xcced('0x31')][_0xcced('0x4d')]({'where':{'id':_0x160764['params']['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x4d0d2c,null))[_0xcced('0x15')](function(_0x4abe52){if(_0x4abe52){return _0x4abe52['removeAgents'](_0x160764[_0xcced('0x36')][_0xcced('0x58')])[_0xcced('0x15')](function(){if(_[_0xcced('0x125')](_0x160764['query'][_0xcced('0x58')])){for(var _0x523a90=0x0;_0x523a90<_0x160764['query'][_0xcced('0x58')][_0xcced('0x3c')];_0x523a90+=0x1){socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')][_0x523a90]),'ChatWebsiteId':Number(_0x160764[_0xcced('0x4b')]['id'])});}}else{socket[_0xcced('0x123')](_0xcced('0x126'),{'UserId':Number(_0x160764[_0xcced('0x36')][_0xcced('0x58')]),'ChatWebsiteId':Number(_0x160764['params']['id'])});}});}})[_0xcced('0x15')](respondWithStatusCode(_0x4d0d2c,null))[_0xcced('0x1d')](handleError(_0x4d0d2c,null));};exports[_0xcced('0x127')]=function(_0x55e328,_0x340e31){var _0x58e0ee={};var _0x223776={};var _0x1781f9;var _0x2c50ad;return db['ChatWebsite'][_0xcced('0xd1')]({'where':{'id':_0x55e328[_0xcced('0x4b')]['id']}})[_0xcced('0x15')](handleEntityNotFound(_0x340e31,null))['then'](function(_0x15c9ea){if(_0x15c9ea){_0x1781f9=_0x15c9ea;_0x223776[_0xcced('0x35')]=_['keys'](db['User'][_0xcced('0x32')]);_0x223776[_0xcced('0x36')]=_[_0xcced('0x37')](_0x55e328[_0xcced('0x36')]);_0x223776['filters']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],_0x223776[_0xcced('0x36')]);_0x58e0ee['attributes']=_[_0xcced('0x39')](_0x223776[_0xcced('0x35')],qs['fields'](_0x55e328['query'][_0xcced('0x3b')]));_0x58e0ee[_0xcced('0x3a')]=_0x58e0ee[_0xcced('0x3a')]['length']?_0x58e0ee[_0xcced('0x3a')]:_0x223776[_0xcced('0x35')];_0x58e0ee['order']=qs['sort'](_0x55e328[_0xcced('0x36')][_0xcced('0x40')]);_0x58e0ee[_0xcced('0x41')]=qs[_0xcced('0x38')](_[_0xcced('0x42')](_0x55e328[_0xcced('0x36')],_0x223776[_0xcced('0x38')]));if(_0x55e328[_0xcced('0x36')][_0xcced('0x43')]){_0x58e0ee[_0xcced('0x41')]=_[_0xcced('0x46')](_0x58e0ee[_0xcced('0x41')],{'$or':_[_0xcced('0x30')](_0x58e0ee[_0xcced('0x3a')],function(_0x41f2e6){var _0x33f0a5={};_0x33f0a5[_0x41f2e6]={'$like':'%'+_0x55e328[_0xcced('0x36')][_0xcced('0x43')]+'%'};return _0x33f0a5;})});}_0x58e0ee=_[_0xcced('0x46')]({},_0x58e0ee,_0x55e328[_0xcced('0x4c')]);return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x14b2d7){if(_0x14b2d7){_0x2c50ad=_0x14b2d7[_0xcced('0x3c')];if(!_0x55e328[_0xcced('0x36')][_0xcced('0x3d')]('nolimit')){_0x58e0ee['limit']=qs[_0xcced('0x22')](_0x55e328[_0xcced('0x36')][_0xcced('0x22')]);_0x58e0ee[_0xcced('0x25')]=qs[_0xcced('0x25')](_0x55e328[_0xcced('0x36')][_0xcced('0x25')]);}return _0x1781f9['getAgents'](_0x58e0ee);}})[_0xcced('0x15')](function(_0x473792){if(_0x473792){return _0x473792?{'count':_0x2c50ad,'rows':_0x473792}:null;}})[_0xcced('0x15')](respondWithResult(_0x340e31,null))['catch'](handleError(_0x340e31,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 08eda43..98795b6 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 _0xb66c=['update','remove','emit','hook','exports','events','ChatWebsite','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb66c,0x175));var _0xcb66=function(_0x4bb5e3,_0x938d49){_0x4bb5e3=_0x4bb5e3-0x0;var _0x2d49a5=_0xb66c[_0x4bb5e3];return _0x2d49a5;};'use strict';var EventEmitter=require(_0xcb66('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xcb66('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcb66('0x2'),'afterUpdate':_0xcb66('0x3'),'afterDestroy':_0xcb66('0x4')};function emitEvent(_0x5f487c){return function(_0x35d439,_0x386241,_0x3f7cc7){ChatWebsiteEvents[_0xcb66('0x5')](_0x5f487c+':'+_0x35d439['id'],_0x35d439);ChatWebsiteEvents['emit'](_0x5f487c,_0x35d439);_0x3f7cc7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xcb66('0x6')](e,emitEvent(event));}}module[_0xcb66('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa9b1=['exports','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x1a9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1a9b('0x1')](0x0);var events={'afterCreate':_0x1a9b('0x2'),'afterUpdate':_0x1a9b('0x3'),'afterDestroy':_0x1a9b('0x4')};function emitEvent(_0x10c90c){return function(_0x52f55f,_0x57b453,_0x4914cd){ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c+':'+_0x52f55f['id'],_0x52f55f);ChatWebsiteEvents[_0x1a9b('0x5')](_0x10c90c,_0x52f55f);_0x4914cd(null);};}for(var e in events){if(events[_0x1a9b('0x6')](e)){var event=events[e];ChatWebsite[_0x1a9b('0x7')](e,emitEvent(event));}}module[_0x1a9b('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 9f5d7d8..2377bc6 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 _0x0fa8=['ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','define'];(function(_0x492b20,_0x5af7db){var _0x2416fa=function(_0x428d34){while(--_0x428d34){_0x492b20['push'](_0x492b20['shift']());}};_0x2416fa(++_0x5af7db);}(_0x0fa8,0x91));var _0x80fa=function(_0x512891,_0x46005a){_0x512891=_0x512891-0x0;var _0x1c190c=_0x0fa8[_0x512891];return _0x1c190c;};'use strict';var _=require(_0x80fa('0x0'));var util=require(_0x80fa('0x1'));var logger=require(_0x80fa('0x2'))(_0x80fa('0x3'));var moment=require(_0x80fa('0x4'));var BPromise=require(_0x80fa('0x5'));var rp=require(_0x80fa('0x6'));var fs=require('fs');var path=require(_0x80fa('0x7'));var rimraf=require('rimraf');var config=require(_0x80fa('0x8'));var attributes=require(_0x80fa('0x9'));module['exports']=function(_0x4aa7fa,_0x2c84a4){return _0x4aa7fa[_0x80fa('0xa')](_0x80fa('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3075=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x3075,0x1e3));var _0x5307=function(_0x32daf0,_0x4ea4c0){_0x32daf0=_0x32daf0-0x0;var _0x39361c=_0x3075[_0x32daf0];return _0x39361c;};'use strict';var _=require(_0x5307('0x0'));var util=require('util');var logger=require(_0x5307('0x1'))(_0x5307('0x2'));var moment=require(_0x5307('0x3'));var BPromise=require(_0x5307('0x4'));var rp=require(_0x5307('0x5'));var fs=require('fs');var path=require(_0x5307('0x6'));var rimraf=require('rimraf');var config=require(_0x5307('0x7'));var attributes=require('./chatWebsite.attributes');module[_0x5307('0x8')]=function(_0x41967b,_0xfda21){return _0x41967b[_0x5307('0x9')](_0x5307('0xa'),attributes,{'tableName':_0x5307('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 31f4a2b..8a4a296 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 _0x90c4=['then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','register'];(function(_0x18ae58,_0x242c57){var _0x37dd9e=function(_0x2b2d6f){while(--_0x2b2d6f){_0x18ae58['push'](_0x18ae58['shift']());}};_0x37dd9e(++_0x242c57);}(_0x90c4,0x186));var _0x490c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x90c4[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x490c('0x0'));var util=require(_0x490c('0x1'));var moment=require(_0x490c('0x2'));var BPromise=require('bluebird');var rs=require(_0x490c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x490c('0x4'))['db'];var utils=require(_0x490c('0x5'));var logger=require(_0x490c('0x6'))(_0x490c('0x7'));var config=require('../../config/environment');var jayson=require(_0x490c('0x8'));var client=jayson[_0x490c('0x9')][_0x490c('0xa')]({'port':0x232a});config[_0x490c('0xb')]=_['defaults'](config[_0x490c('0xb')],{'host':_0x490c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x490c('0xb')]));require(_0x490c('0xd'))[_0x490c('0xe')](socket);function respondWithRpcPromise(_0x5755f6,_0x39ab83,_0x52776f){return new BPromise(function(_0xc0e936,_0x2f3516){return client['request'](_0x5755f6,_0x52776f)[_0x490c('0xf')](function(_0x20abfd){logger[_0x490c('0x10')](_0x490c('0x11'),_0x39ab83,'request\x20sent');logger[_0x490c('0x12')](_0x490c('0x13'),_0x39ab83,_0x490c('0x14'),JSON[_0x490c('0x15')](_0x20abfd));if(_0x20abfd[_0x490c('0x16')]){if(_0x20abfd[_0x490c('0x16')][_0x490c('0x17')]===0x1f4){logger[_0x490c('0x16')](_0x490c('0x11'),_0x39ab83,_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);return _0x2f3516(_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);}logger[_0x490c('0x16')](_0x490c('0x11'),_0x39ab83,_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);return _0xc0e936(_0x20abfd[_0x490c('0x16')][_0x490c('0x18')]);}else{logger[_0x490c('0x10')](_0x490c('0x11'),_0x39ab83,'request\x20sent');_0xc0e936(_0x20abfd[_0x490c('0x19')]['message']);}})[_0x490c('0x1a')](function(_0x3b9f0b){logger['error'](_0x490c('0x11'),_0x39ab83,_0x3b9f0b);_0x2f3516(_0x3b9f0b);});});} \ No newline at end of file +var _0x421c=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','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','./chatWebsite.socket','request'];(function(_0xe256e9,_0x5f605d){var _0xc17b10=function(_0x2f0cab){while(--_0x2f0cab){_0xe256e9['push'](_0xe256e9['shift']());}};_0xc17b10(++_0x5f605d);}(_0x421c,0x190));var _0xc421=function(_0x4e0101,_0x41208b){_0x4e0101=_0x4e0101-0x0;var _0x5ba014=_0x421c[_0x4e0101];return _0x5ba014;};'use strict';var _=require(_0xc421('0x0'));var util=require(_0xc421('0x1'));var moment=require(_0xc421('0x2'));var BPromise=require(_0xc421('0x3'));var rs=require(_0xc421('0x4'));var fs=require('fs');var Redis=require(_0xc421('0x5'));var db=require(_0xc421('0x6'))['db'];var utils=require(_0xc421('0x7'));var logger=require(_0xc421('0x8'))(_0xc421('0x9'));var config=require(_0xc421('0xa'));var jayson=require(_0xc421('0xb'));var client=jayson[_0xc421('0xc')][_0xc421('0xd')]({'port':0x232a});config[_0xc421('0xe')]=_[_0xc421('0xf')](config[_0xc421('0xe')],{'host':_0xc421('0x10'),'port':0x18eb});var socket=require(_0xc421('0x11'))(new Redis(config[_0xc421('0xe')]));require(_0xc421('0x12'))['register'](socket);function respondWithRpcPromise(_0x59a090,_0x5c4bfa,_0x3cd89d){return new BPromise(function(_0x2df8f6,_0x120316){return client[_0xc421('0x13')](_0x59a090,_0x3cd89d)['then'](function(_0x2a0c0e){logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,_0xc421('0x16'));logger['debug'](_0xc421('0x17'),_0x5c4bfa,_0xc421('0x16'),JSON[_0xc421('0x18')](_0x2a0c0e));if(_0x2a0c0e[_0xc421('0x19')]){if(_0x2a0c0e[_0xc421('0x19')]['code']===0x1f4){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e[_0xc421('0x19')][_0xc421('0x1a')]);return _0x120316(_0x2a0c0e['error'][_0xc421('0x1a')]);}logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x2a0c0e['error'][_0xc421('0x1a')]);return _0x2df8f6(_0x2a0c0e[_0xc421('0x19')]['message']);}else{logger[_0xc421('0x14')](_0xc421('0x15'),_0x5c4bfa,'request\x20sent');_0x2df8f6(_0x2a0c0e[_0xc421('0x1b')]['message']);}})['catch'](function(_0x57dbca){logger[_0xc421('0x19')](_0xc421('0x15'),_0x5c4bfa,_0x57dbca);_0x120316(_0x57dbca);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 1501158..12b200d 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 _0x5068=['removeListener','register','length','./chatWebsite.events','update'];(function(_0x5b621b,_0x3df21e){var _0x8eda75=function(_0x27a64e){while(--_0x27a64e){_0x5b621b['push'](_0x5b621b['shift']());}};_0x8eda75(++_0x3df21e);}(_0x5068,0x152));var _0x8506=function(_0x5b1e8d,_0x5bcb25){_0x5b1e8d=_0x5b1e8d-0x0;var _0x51d2a9=_0x5068[_0x5b1e8d];return _0x51d2a9;};'use strict';var ChatWebsiteEvents=require(_0x8506('0x0'));var events=['save','remove',_0x8506('0x1')];function createListener(_0x499fec,_0x12d0ef){return function(_0x30867e){_0x12d0ef['emit'](_0x499fec,_0x30867e);};}function removeListener(_0x36b439,_0x13825f){return function(){ChatWebsiteEvents[_0x8506('0x2')](_0x36b439,_0x13825f);};}exports[_0x8506('0x3')]=function(_0x1c0914){for(var _0x38602f=0x0,_0x527e92=events[_0x8506('0x4')];_0x38602f<_0x527e92;_0x38602f++){var _0x387d4b=events[_0x38602f];var _0x1ec1f4=createListener('chatWebsite:'+_0x387d4b,_0x1c0914);ChatWebsiteEvents['on'](_0x387d4b,_0x1ec1f4);}}; \ No newline at end of file +var _0xe48f=['save','remove','register','length','chatWebsite:'];(function(_0xb2b806,_0x2f8113){var _0x569b6d=function(_0x5596be){while(--_0x5596be){_0xb2b806['push'](_0xb2b806['shift']());}};_0x569b6d(++_0x2f8113);}(_0xe48f,0x1e5));var _0xfe48=function(_0x5cc655,_0x4b6145){_0x5cc655=_0x5cc655-0x0;var _0x244379=_0xe48f[_0x5cc655];return _0x244379;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xfe48('0x0'),_0xfe48('0x1'),'update'];function createListener(_0x4c13ca,_0xaecdbb){return function(_0x49aa2c){_0xaecdbb['emit'](_0x4c13ca,_0x49aa2c);};}function removeListener(_0x209df9,_0x472ba1){return function(){ChatWebsiteEvents['removeListener'](_0x209df9,_0x472ba1);};}exports[_0xfe48('0x2')]=function(_0x4b7610){for(var _0x2faacb=0x0,_0x353965=events[_0xfe48('0x3')];_0x2faacb<_0x353965;_0x2faacb++){var _0x4e5dbd=events[_0x2faacb];var _0x5e011e=createListener(_0xfe48('0x4')+_0x4e5dbd,_0x4b7610);ChatWebsiteEvents['on'](_0x4e5dbd,_0x5e011e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 946614e..21550b2 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 _0x9463=['express','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','root','format','%s-%s','now','originalname','single','file','server/files/images/avatars/','join','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x9463,0x142));var _0x3946=function(_0x10fe86,_0x4e3e53){_0x10fe86=_0x10fe86-0x0;var _0x1acb8b=_0x9463[_0x10fe86];return _0x1acb8b;};'use strict';var multer=require('multer');var util=require(_0x3946('0x0'));var path=require(_0x3946('0x1'));var timeout=require(_0x3946('0x2'));var express=require(_0x3946('0x3'));var router=express['Router']();var fs_extra=require(_0x3946('0x4'));var auth=require(_0x3946('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3946('0x6'));var controller=require(_0x3946('0x7'));router[_0x3946('0x8')]('/',auth[_0x3946('0x9')](),controller['index']);router['get'](_0x3946('0xa'),auth[_0x3946('0x9')](),controller[_0x3946('0xb')]);router[_0x3946('0x8')](_0x3946('0xc'),auth['isAuthenticated'](),controller[_0x3946('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3946('0xe')]);router[_0x3946('0x8')](_0x3946('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x3946('0x8')]('/:id/logo',controller['getLogo']);router[_0x3946('0x8')](_0x3946('0x10'),controller[_0x3946('0x11')]);router[_0x3946('0x8')]('/:id/customer_avatar',controller[_0x3946('0x12')]);router[_0x3946('0x8')](_0x3946('0x13'),controller['getSystemAvatar']);router[_0x3946('0x8')](_0x3946('0x14'),auth[_0x3946('0x9')](),controller[_0x3946('0x15')]);router['get']('/:id/snippet',controller[_0x3946('0x16')]);router[_0x3946('0x8')](_0x3946('0x17'),auth[_0x3946('0x9')](),controller['getApplications']);router[_0x3946('0x8')](_0x3946('0x18'),auth[_0x3946('0x9')](),controller[_0x3946('0x19')]);router[_0x3946('0x8')](_0x3946('0x1a'),controller[_0x3946('0x1b')]);router['get']('/:id/offline_messages',auth[_0x3946('0x9')](),controller[_0x3946('0x1c')]);router['get'](_0x3946('0x1d'),auth['isAuthenticated'](),controller[_0x3946('0x1e')]);router[_0x3946('0x1f')]('/',auth[_0x3946('0x9')](),controller['create']);router['post']('/:id/dispositions',auth[_0x3946('0x9')](),controller[_0x3946('0x20')]);router[_0x3946('0x1f')](_0x3946('0xf'),auth[_0x3946('0x9')](),controller[_0x3946('0x21')]);var upload=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x145bac,_0x5dcf28,_0x11b78d){_0x11b78d(null,path['join'](config[_0x3946('0x23')],'server/files/images/logos/'));},'filename':function(_0x2dba28,_0x168feb,_0x61b715){_0x61b715(null,util[_0x3946('0x24')](_0x3946('0x25'),Date[_0x3946('0x26')](),_0x168feb[_0x3946('0x27')]));}})});router[_0x3946('0x1f')]('/:id/logo',upload[_0x3946('0x28')](_0x3946('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x14c963,_0x45e11a,_0x1ec481){_0x1ec481(null,path['join'](config['root'],_0x3946('0x2a')));},'filename':function(_0x1f1607,_0x164ff0,_0x49386e){_0x49386e(null,util['format']('%s-%s',Date['now'](),_0x164ff0[_0x3946('0x27')]));}})});router[_0x3946('0x1f')](_0x3946('0x10'),upload[_0x3946('0x28')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x34f18a,_0x4f5c35,_0x3c04ce){_0x3c04ce(null,path[_0x3946('0x2b')](config['root'],_0x3946('0x2a')));},'filename':function(_0x44da5b,_0xb92993,_0x41ca06){_0x41ca06(null,util[_0x3946('0x24')]('%s-%s',Date[_0x3946('0x26')](),_0xb92993[_0x3946('0x27')]));}})});router[_0x3946('0x1f')](_0x3946('0x2c'),upload[_0x3946('0x28')](_0x3946('0x29')),controller[_0x3946('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d1395,_0x5125f2,_0x412bc1){_0x412bc1(null,path[_0x3946('0x2b')](config[_0x3946('0x23')],_0x3946('0x2a')));},'filename':function(_0x5b8713,_0x5a9c1d,_0x196fe7){_0x196fe7(null,util[_0x3946('0x24')](_0x3946('0x25'),Date[_0x3946('0x26')](),_0x5a9c1d[_0x3946('0x27')]));}})});router[_0x3946('0x1f')]('/:id/system_avatar',upload[_0x3946('0x28')](_0x3946('0x29')),controller[_0x3946('0x2e')]);router[_0x3946('0x1f')](_0x3946('0x2f'),controller[_0x3946('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x3946('0x22')]({'destination':function(_0x3805a9,_0x118596,_0x1a7e6c){const _0x5b496c=path[_0x3946('0x2b')](config[_0x3946('0x23')],'server/files',_0x3946('0x31'),_0x3946('0x32'));fs_extra[_0x3946('0x33')](_0x5b496c,function(){_0x1a7e6c(null,_0x5b496c);});},'filename':function(_0x4e6125,_0x20438d,_0xbdd79){const _0x2afaa7=_0x20438d[_0x3946('0x27')][_0x3946('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xfc04b3=path[_0x3946('0x35')](_0x2afaa7);const _0x6f9dab=Date[_0x3946('0x26')]()+'-'+_0x2afaa7[_0x3946('0x34')](_0xfc04b3,'')+_0xfc04b3;_0xbdd79(null,_0x6f9dab);}})});router['post'](_0x3946('0x36'),offlineUploadMulter['any'](),controller['offline']);router[_0x3946('0x1f')](_0x3946('0x14'),auth[_0x3946('0x9')](),controller[_0x3946('0x37')]);router[_0x3946('0x1f')](_0x3946('0x17'),auth[_0x3946('0x9')](),controller[_0x3946('0x38')]);router[_0x3946('0x1f')](_0x3946('0x18'),auth[_0x3946('0x9')](),controller[_0x3946('0x39')]);router[_0x3946('0x1f')](_0x3946('0x1d'),auth['isAuthenticated'](),controller[_0x3946('0x3a')]);router[_0x3946('0x3b')](_0x3946('0xc'),auth[_0x3946('0x9')](),controller['update']);router[_0x3946('0x3c')](_0x3946('0xc'),auth[_0x3946('0x9')](),controller['destroy']);router[_0x3946('0x3c')](_0x3946('0x3d'),auth[_0x3946('0x9')](),controller[_0x3946('0x3e')]);router['delete'](_0x3946('0xf'),auth[_0x3946('0x9')](),controller[_0x3946('0x3f')]);router[_0x3946('0x3c')](_0x3946('0x1d'),auth[_0x3946('0x9')](),controller[_0x3946('0x40')]);module['exports']=router; \ No newline at end of file +var _0x0bfb=['/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','single','file','addLogo','server/files/images/avatars/','now','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x49c24f,_0x39766f){var _0x5a3327=function(_0x29662d){while(--_0x29662d){_0x49c24f['push'](_0x49c24f['shift']());}};_0x5a3327(++_0x39766f);}(_0x0bfb,0x87));var _0xb0bf=function(_0x160efe,_0x109650){_0x160efe=_0x160efe-0x0;var _0x25592f=_0x0bfb[_0x160efe];return _0x25592f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0bf('0x0'));var express=require(_0xb0bf('0x1'));var router=express[_0xb0bf('0x2')]();var fs_extra=require(_0xb0bf('0x3'));var auth=require(_0xb0bf('0x4'));var interaction=require(_0xb0bf('0x5'));var config=require('../../config/environment');var controller=require(_0xb0bf('0x6'));router[_0xb0bf('0x7')]('/',auth[_0xb0bf('0x8')](),controller['index']);router[_0xb0bf('0x7')](_0xb0bf('0x9'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xa')]);router[_0xb0bf('0x7')](_0xb0bf('0xb'),auth['isAuthenticated'](),controller[_0xb0bf('0xc')]);router[_0xb0bf('0x7')](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0xe')]);router['get'](_0xb0bf('0xf'),auth['isAuthenticated'](),controller[_0xb0bf('0x10')]);router[_0xb0bf('0x7')](_0xb0bf('0x11'),controller[_0xb0bf('0x12')]);router[_0xb0bf('0x7')](_0xb0bf('0x13'),controller[_0xb0bf('0x14')]);router[_0xb0bf('0x7')]('/:id/customer_avatar',controller[_0xb0bf('0x15')]);router[_0xb0bf('0x7')]('/:id/system_avatar',controller[_0xb0bf('0x16')]);router[_0xb0bf('0x7')](_0xb0bf('0x17'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x18')]);router['get'](_0xb0bf('0x19'),controller['getSnippet']);router[_0xb0bf('0x7')](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1b')]);router['get'](_0xb0bf('0x1c'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x1d')]);router['get'](_0xb0bf('0x1e'),controller[_0xb0bf('0x1f')]);router['get'](_0xb0bf('0x20'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x21')]);router[_0xb0bf('0x7')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x23')]);router[_0xb0bf('0x24')]('/',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x25')]);router['post'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x26')]);router[_0xb0bf('0x24')](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x27')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x10daca,_0x1d250e,_0x4fc431){_0x4fc431(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x2b')));},'filename':function(_0x200de6,_0x5eefbf,_0x75390b){_0x75390b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date['now'](),_0x5eefbf[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x11'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x31')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x4d9e32,_0x5a526b,_0x368936){_0x368936(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x598110,_0x19fcc2,_0x35e542){_0x35e542(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x19fcc2[_0xb0bf('0x2e')]));}})});router['post']('/:id/avatar',upload['single'](_0xb0bf('0x30')),controller[_0xb0bf('0x34')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x5e2a4c,_0x376bdb,_0x5f2691){_0x5f2691(null,path[_0xb0bf('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4f01de,_0x43fe49,_0x1dde0b){_0x1dde0b(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x43fe49['originalname']));}})});router['post'](_0xb0bf('0x35'),upload[_0xb0bf('0x2f')](_0xb0bf('0x30')),controller[_0xb0bf('0x36')]);var upload=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x497433,_0x398586,_0xe0f4e4){_0xe0f4e4(null,path[_0xb0bf('0x29')](config[_0xb0bf('0x2a')],_0xb0bf('0x32')));},'filename':function(_0x4b62a0,_0x559969,_0x629bd7){_0x629bd7(null,util[_0xb0bf('0x2c')](_0xb0bf('0x2d'),Date[_0xb0bf('0x33')](),_0x559969[_0xb0bf('0x2e')]));}})});router[_0xb0bf('0x24')](_0xb0bf('0x37'),upload[_0xb0bf('0x2f')]('file'),controller[_0xb0bf('0x38')]);router[_0xb0bf('0x24')](_0xb0bf('0x39'),controller[_0xb0bf('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0xb0bf('0x28')]({'destination':function(_0x983c1b,_0x6afb3b,_0xebfb8f){const _0x2bfa67=path['join'](config['root'],_0xb0bf('0x3b'),_0xb0bf('0x3c'),_0xb0bf('0x3d'));fs_extra['ensureDir'](_0x2bfa67,function(){_0xebfb8f(null,_0x2bfa67);});},'filename':function(_0x5e7377,_0x5b11ad,_0x4f771b){const _0x11dda6=_0x5b11ad[_0xb0bf('0x2e')][_0xb0bf('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xa5d1a5=path[_0xb0bf('0x3f')](_0x11dda6);const _0x35b942=Date['now']()+'-'+_0x11dda6['replace'](_0xa5d1a5,'')+_0xa5d1a5;_0x4f771b(null,_0x35b942);}})});router['post'](_0xb0bf('0x40'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0xb0bf('0x17'),auth['isAuthenticated'](),controller[_0xb0bf('0x41')]);router['post'](_0xb0bf('0x1a'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x42')]);router['post'](_0xb0bf('0x1c'),auth['isAuthenticated'](),controller[_0xb0bf('0x43')]);router[_0xb0bf('0x24')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x44')]);router[_0xb0bf('0x45')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x46')]);router[_0xb0bf('0x47')]('/:id',auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x48')]);router['delete'](_0xb0bf('0xd'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x49')]);router['delete'](_0xb0bf('0xf'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4a')]);router[_0xb0bf('0x47')](_0xb0bf('0x22'),auth[_0xb0bf('0x8')](),controller[_0xb0bf('0x4b')]);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 cd85d02..c05a4e4 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 _0x45fb=['Client-Side\x20logger\x20not\x20found!','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','app','get'];(function(_0x1f62e4,_0x24435f){var _0x50014b=function(_0x1b4685){while(--_0x1b4685){_0x1f62e4['push'](_0x1f62e4['shift']());}};_0x50014b(++_0x24435f);}(_0x45fb,0x1e0));var _0xb45f=function(_0x4b5f85,_0x470f26){_0x4b5f85=_0x4b5f85-0x0;var _0x18bdc3=_0x45fb[_0x4b5f85];return _0x18bdc3;};var beaverLogger=require('beaver-logger/server');var express=require(_0xb45f('0x0'));var auth=require(_0xb45f('0x1'));var config=require(_0xb45f('0x2'));var router=express[_0xb45f('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1f2fc0,_0x3097cf,_0x17e842){var _0x3bd429=_0x1f2fc0[_0xb45f('0x4')][_0xb45f('0x5')]('client-side-logger');if(!_0x3bd429){throw new Error(_0xb45f('0x6'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x3bd429,'enableCors':!isProduction})(_0x1f2fc0,_0x3097cf,_0x17e842);}router['use'](auth[_0xb45f('0x7')](),clientSideLogs);module[_0xb45f('0x8')]=router; \ No newline at end of file +var _0x38f8=['use','isAuthenticated','express','../components/auth/service','../config/environment','Router','production','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x101cad,_0x4e873c){var _0x25d010=function(_0x18a2ed){while(--_0x18a2ed){_0x101cad['push'](_0x101cad['shift']());}};_0x25d010(++_0x4e873c);}(_0x38f8,0x141));var _0x838f=function(_0x311e9b,_0x2937f4){_0x311e9b=_0x311e9b-0x0;var _0x26284c=_0x38f8[_0x311e9b];return _0x26284c;};var beaverLogger=require('beaver-logger/server');var express=require(_0x838f('0x0'));var auth=require(_0x838f('0x1'));var config=require(_0x838f('0x2'));var router=express[_0x838f('0x3')]();var isProduction=config['env']===_0x838f('0x4')||![];function clientSideLogs(_0x4f5a79,_0x35c5dd,_0x348d0d){var _0x2adfab=_0x4f5a79['app']['get'](_0x838f('0x5'));if(!_0x2adfab){throw new Error(_0x838f('0x6'));}return beaverLogger[_0x838f('0x7')]({'uri':_0x838f('0x8'),'logger':_0x2adfab,'enableCors':!isProduction})(_0x4f5a79,_0x35c5dd,_0x348d0d);}router[_0x838f('0x9')](auth[_0x838f('0xa')](),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 0af557f..e3929e7 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 _0x5bc8=['STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize'];(function(_0x17f7c3,_0x461edb){var _0x2d5d98=function(_0x34393a){while(--_0x34393a){_0x17f7c3['push'](_0x17f7c3['shift']());}};_0x2d5d98(++_0x461edb);}(_0x5bc8,0xcf));var _0x85bc=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x5bc8[_0x137d1d];return _0x485108;};'use strict';var Sequelize=require(_0x85bc('0x0'));module['exports']={'name':{'type':Sequelize[_0x85bc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x85bc('0x2')]('AmazonAWS','Google',_0x85bc('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x85bc('0x4'),_0x85bc('0x5'))},'data1':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x6')},'data2':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x7')},'data3':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x8')},'data4':{'type':Sequelize[_0x85bc('0x1')],'comment':_0x85bc('0x9')},'data5':{'type':Sequelize[_0x85bc('0xa')],'comment':_0x85bc('0xb')},'data6':{'type':Sequelize[_0x85bc('0xa')],'comment':_0x85bc('0xc')},'data7':{'type':Sequelize[_0x85bc('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x7836=['sequelize','exports','ENUM','MicrosoftAzure','Outlook365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x3b4027,_0x375f0c){var _0x17080b=function(_0x12cbbd){while(--_0x12cbbd){_0x3b4027['push'](_0x3b4027['shift']());}};_0x17080b(++_0x375f0c);}(_0x7836,0x138));var _0x6783=function(_0x1d70e6,_0x31f6eb){_0x1d70e6=_0x1d70e6-0x0;var _0x2d61cb=_0x7836[_0x1d70e6];return _0x2d61cb;};'use strict';var Sequelize=require(_0x6783('0x0'));module[_0x6783('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6783('0x2')]('AmazonAWS','Google',_0x6783('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x6783('0x2')](_0x6783('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x6')},'data3':{'type':Sequelize[_0x6783('0x5')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6783('0x5')],'comment':_0x6783('0x7')},'data5':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0x9')},'data6':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xa')},'data7':{'type':Sequelize[_0x6783('0x8')],'comment':_0x6783('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index eabc1cd..a731719 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 _0x804d=['includeAll','include','findAll','rows','service','decryptString','data3','catch','show','params','keys','fields','length','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','error','stack','slice','index','map','CloudProvider','rawAttributes','fieldName','type','name','filters','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x5305ad,_0x218c3b){var _0x494d19=function(_0x15a501){while(--_0x15a501){_0x5305ad['push'](_0x5305ad['shift']());}};_0x494d19(++_0x218c3b);}(_0x804d,0x92));var _0xd804=function(_0x58139f,_0x43bca5){_0x58139f=_0x58139f-0x0;var _0x52b78c=_0x804d[_0x58139f];return _0x52b78c;};'use strict';var _=require(_0xd804('0x0'));var Redis=require(_0xd804('0x1'));var qs=require(_0xd804('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xd804('0x3'));var logger=require(_0xd804('0x4'))(_0xd804('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xd804('0x6'));config[_0xd804('0x7')]=_[_0xd804('0x8')](config[_0xd804('0x7')],{'host':_0xd804('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd804('0x7')]));var redis=new Redis(config[_0xd804('0x7')]);function respondWithStatusCode(_0x2c32db,_0x1bc4fb){_0x1bc4fb=_0x1bc4fb||0xcc;return function(_0x50a669){if(_0x50a669){return _0x2c32db[_0xd804('0xa')](_0x1bc4fb);}return _0x2c32db[_0xd804('0xb')](_0x1bc4fb)[_0xd804('0xc')]();};}function respondWithResult(_0x1aa18e,_0x3ba37f){_0x3ba37f=_0x3ba37f||0xc8;return function(_0x4458cb){if(_0x4458cb){return _0x1aa18e[_0xd804('0xb')](_0x3ba37f)[_0xd804('0xd')](_0x4458cb);}};}function respondWithFilteredResult(_0x5840a2,_0x120088){return function(_0x42431d){if(_0x42431d){var _0x36bf91=typeof _0x120088[_0xd804('0xe')]===_0xd804('0xf')&&typeof _0x120088[_0xd804('0x10')]===_0xd804('0xf');var _0x36e27e=_0x42431d[_0xd804('0x11')];var _0x209822=_0x36bf91?0x0:_0x120088[_0xd804('0xe')];var _0x1a1123=_0x36bf91?_0x42431d[_0xd804('0x11')]:_0x120088['offset']+_0x120088[_0xd804('0x10')];var _0x1bae94;if(_0x1a1123>=_0x36e27e){_0x1a1123=_0x36e27e;_0x1bae94=0xc8;}else{_0x1bae94=0xce;}_0x5840a2[_0xd804('0xb')](_0x1bae94);return _0x5840a2['set'](_0xd804('0x12'),_0x209822+'-'+_0x1a1123+'/'+_0x36e27e)['json'](_0x42431d);}return null;};}function saveUpdates(_0x517330){return function(_0x2c0251){if(_0x2c0251){return _0x2c0251[_0xd804('0x13')](_0x517330)[_0xd804('0x14')](function(_0x56f55a){return _0x56f55a;});}return null;};}function removeEntity(_0x4258a8){return function(_0x4fce8d){if(_0x4fce8d){return _0x4fce8d['destroy']()[_0xd804('0x14')](function(){_0x4258a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31bb3e){return function(_0x1a6c14){if(!_0x1a6c14){_0x31bb3e['sendStatus'](0x194);}return _0x1a6c14;};}function handleError(_0x55240e,_0x48321f){_0x48321f=_0x48321f||0x1f4;return function(_0xab14e){logger[_0xd804('0x15')](_0xab14e[_0xd804('0x16')]);if(_0xab14e['name']){delete _0xab14e['name'];}_0x55240e[_0xd804('0xb')](_0x48321f)['send'](_0xab14e);};}function maskClientSecret(_0x44f6c2){return _['padEnd'](_0x44f6c2[_0xd804('0x17')](0x0,0x3),0x14,'*');}exports[_0xd804('0x18')]=function(_0x3fea52,_0x490e0f){var _0x33a304={},_0x3660d3={},_0x250f74={'count':0x0,'rows':[]};var _0x277796=_[_0xd804('0x19')](db[_0xd804('0x1a')][_0xd804('0x1b')],function(_0x4ce42c){return{'name':_0x4ce42c[_0xd804('0x1c')],'type':_0x4ce42c[_0xd804('0x1d')]['key']};});_0x3660d3['model']=_[_0xd804('0x19')](_0x277796,_0xd804('0x1e'));_0x3660d3['query']=_['keys'](_0x3fea52['query']);_0x3660d3[_0xd804('0x1f')]=_[_0xd804('0x20')](_0x3660d3[_0xd804('0x21')],_0x3660d3[_0xd804('0x22')]);_0x33a304[_0xd804('0x23')]=_[_0xd804('0x20')](_0x3660d3[_0xd804('0x21')],qs['fields'](_0x3fea52['query']['fields']));_0x33a304[_0xd804('0x23')]=_0x33a304[_0xd804('0x23')]['length']?_0x33a304[_0xd804('0x23')]:_0x3660d3[_0xd804('0x21')];if(!_0x3fea52['query'][_0xd804('0x24')](_0xd804('0x25'))){_0x33a304[_0xd804('0x10')]=qs[_0xd804('0x10')](_0x3fea52['query'][_0xd804('0x10')]);_0x33a304[_0xd804('0xe')]=qs[_0xd804('0xe')](_0x3fea52['query'][_0xd804('0xe')]);}_0x33a304[_0xd804('0x26')]=qs[_0xd804('0x27')](_0x3fea52[_0xd804('0x22')][_0xd804('0x27')]);_0x33a304[_0xd804('0x28')]=qs[_0xd804('0x1f')](_[_0xd804('0x29')](_0x3fea52[_0xd804('0x22')],_0x3660d3[_0xd804('0x1f')]),_0x277796);if(_0x3fea52['query'][_0xd804('0x2a')]){_0x33a304[_0xd804('0x28')]=_[_0xd804('0x2b')](_0x33a304[_0xd804('0x28')],{'$or':_[_0xd804('0x19')](_0x277796,function(_0x537a5a){if(_0x537a5a[_0xd804('0x1d')]!==_0xd804('0x2c')){var _0xf8dab3={};_0xf8dab3[_0x537a5a['name']]={'$like':'%'+_0x3fea52[_0xd804('0x22')][_0xd804('0x2a')]+'%'};return _0xf8dab3;}})});}_0x33a304=_[_0xd804('0x2b')]({},_0x33a304,_0x3fea52[_0xd804('0x2d')]);var _0x2cea0d={'where':_0x33a304[_0xd804('0x28')]};return db['CloudProvider'][_0xd804('0x11')](_0x2cea0d)['then'](function(_0x2a860b){_0x250f74['count']=_0x2a860b;if(_0x3fea52[_0xd804('0x22')][_0xd804('0x2e')]){_0x33a304[_0xd804('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xd804('0x30')](_0x33a304);})[_0xd804('0x14')](function(_0x22a1f1){_0x250f74[_0xd804('0x31')]=_['map'](_0x22a1f1,function(_0x4b8784){if(_0x4b8784[_0xd804('0x32')]==='MicrosoftAzure'){var _0x23aed7=encryptor[_0xd804('0x33')](_0x4b8784[_0xd804('0x34')]);_0x4b8784[_0xd804('0x34')]=maskClientSecret(_0x23aed7);}return _0x4b8784;});return _0x250f74;})[_0xd804('0x14')](respondWithFilteredResult(_0x490e0f,_0x33a304))[_0xd804('0x35')](handleError(_0x490e0f,null));};exports[_0xd804('0x36')]=function(_0x3ae2f3,_0x4e3a69){var _0x3c980f={'raw':!![],'where':{'id':_0x3ae2f3[_0xd804('0x37')]['id']}},_0x284851={};_0x284851[_0xd804('0x21')]=_[_0xd804('0x38')](db[_0xd804('0x1a')][_0xd804('0x1b')]);_0x284851[_0xd804('0x22')]=_[_0xd804('0x38')](_0x3ae2f3['query']);_0x284851[_0xd804('0x1f')]=_[_0xd804('0x20')](_0x284851[_0xd804('0x21')],_0x284851[_0xd804('0x22')]);_0x3c980f[_0xd804('0x23')]=_[_0xd804('0x20')](_0x284851[_0xd804('0x21')],qs[_0xd804('0x39')](_0x3ae2f3[_0xd804('0x22')][_0xd804('0x39')]));_0x3c980f[_0xd804('0x23')]=_0x3c980f[_0xd804('0x23')][_0xd804('0x3a')]?_0x3c980f['attributes']:_0x284851[_0xd804('0x21')];if(_0x3ae2f3[_0xd804('0x22')][_0xd804('0x2e')]){_0x3c980f[_0xd804('0x2f')]=[{'all':!![]}];}_0x3c980f=_[_0xd804('0x2b')]({},_0x3c980f,_0x3ae2f3[_0xd804('0x2d')]);return db[_0xd804('0x1a')][_0xd804('0x3b')](_0x3c980f)[_0xd804('0x14')](handleEntityNotFound(_0x4e3a69,null))[_0xd804('0x14')](function(_0xa368d0){if(_0xa368d0['service']===_0xd804('0x3c')){var _0x390c25=encryptor[_0xd804('0x33')](_0xa368d0[_0xd804('0x34')]);_0xa368d0[_0xd804('0x34')]=maskClientSecret(_0x390c25);}return _0xa368d0;})[_0xd804('0x14')](respondWithResult(_0x4e3a69,null))['catch'](handleError(_0x4e3a69,null));};exports[_0xd804('0x3d')]=function(_0x532e65,_0x130491){if(!_0x532e65[_0xd804('0x3e')]['name'])throw new Error(_0xd804('0x3f'));if(!_0x532e65[_0xd804('0x3e')][_0xd804('0x32')])throw new Error(_0xd804('0x40'));var _0xf7efa8=db[_0xd804('0x1a')][_0xd804('0x1b')][_0xd804('0x32')][_0xd804('0x41')];if(!_0xf7efa8['includes'](_0x532e65[_0xd804('0x3e')][_0xd804('0x32')]))throw new Error(_0xd804('0x42')+_0xf7efa8['join'](',\x20'));if(_0x532e65['body'][_0xd804('0x32')]==='MicrosoftAzure'&&_0x532e65[_0xd804('0x3e')][_0xd804('0x34')]){_0x532e65['body'][_0xd804('0x34')]=encryptor[_0xd804('0x43')](_0x532e65[_0xd804('0x3e')][_0xd804('0x34')]);}return db['CloudProvider'][_0xd804('0x3d')](_0x532e65['body'],{})['then'](respondWithResult(_0x130491,0xc9))[_0xd804('0x35')](handleError(_0x130491,null));};exports['update']=function(_0x3dbc20,_0x2a1f00){if(_0x3dbc20[_0xd804('0x3e')]['id']){delete _0x3dbc20[_0xd804('0x3e')]['id'];}return db['CloudProvider'][_0xd804('0x3b')]({'where':{'id':_0x3dbc20[_0xd804('0x37')]['id']}})[_0xd804('0x14')](handleEntityNotFound(_0x2a1f00,null))[_0xd804('0x14')](function(_0xe30001){if(_0xe30001[_0xd804('0x32')]===_0xd804('0x3c')&&_0x3dbc20[_0xd804('0x3e')]['data3']){_0x3dbc20['body'][_0xd804('0x34')]=encryptor[_0xd804('0x43')](_0x3dbc20[_0xd804('0x3e')][_0xd804('0x34')]);}return _0xe30001;})[_0xd804('0x14')](saveUpdates(_0x3dbc20['body'],null))[_0xd804('0x14')](respondWithResult(_0x2a1f00,null))[_0xd804('0x35')](handleError(_0x2a1f00,null));};exports[_0xd804('0x44')]=function(_0x55a442,_0x26e990){return db[_0xd804('0x1a')][_0xd804('0x3b')]({'where':{'id':_0x55a442[_0xd804('0x37')]['id']}})[_0xd804('0x14')](handleEntityNotFound(_0x26e990,null))['then'](removeEntity(_0x26e990,null))['catch'](handleError(_0x26e990,null));};exports[_0xd804('0x45')]=function(_0x190e54,_0x8450ef){return db[_0xd804('0x1a')][_0xd804('0x46')]({'where':{'id':_0x190e54[_0xd804('0x37')]['id']},'raw':!![]})[_0xd804('0x14')](function(_0xa72b39){if(!_0xa72b39)return _0x8450ef[_0xd804('0xa')](0x194);return{'url':oauth[_0xd804('0x47')](_0xa72b39,_0x190e54[_0xd804('0x48')]['id'])};})['then'](respondWithResult(_0x8450ef,null))[_0xd804('0x35')](handleError(_0x8450ef,null));};exports[_0xd804('0x49')]=function(_0x31cb28,_0x2d3239){var _0x1d5abd=_0x31cb28[_0xd804('0x3e')];var _0x15c214;var _0x3f4934;if(_0x1d5abd[_0xd804('0x15')])throw _0x1d5abd;redis[_0xd804('0x4a')](_0x1d5abd[_0xd804('0x4b')])[_0xd804('0x14')](function(_0x21b69a){if(!_0x21b69a)throw new Error(_0xd804('0x4c'));_0x15c214=JSON[_0xd804('0x4d')](_0x21b69a);var _0x3f18c0=Buffer[_0xd804('0x4e')](_0x1d5abd[_0xd804('0x4b')],_0xd804('0x4f'))[_0xd804('0x50')](_0xd804('0x51'));_0x3f4934=JSON[_0xd804('0x4d')](_0x3f18c0);if(!oauth[_0xd804('0x52')](_0x1d5abd['id_token'],_0x15c214[_0xd804('0x53')]))throw new Error(_0xd804('0x54'));redis['del'](_0x1d5abd['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x1d5abd[_0xd804('0x55')],_0x15c214);})[_0xd804('0x14')](function(_0xf10562){_0x15c214[_0xd804('0x56')]=_0xf10562[_0xd804('0x57')];_0x15c214[_0xd804('0x58')]=_0xf10562[_0xd804('0x59')];return db[_0xd804('0x1a')][_0xd804('0x13')]({'data5':_0x15c214['data5'],'data6':_0x15c214[_0xd804('0x58')]},{'where':{'id':_0x15c214['id']}});})[_0xd804('0x14')](function(){oauth['startRefreshInterval'](_0x15c214);socket[_0xd804('0x5a')](_0xd804('0x5b'),{'id':_0x3f4934['id']});return;})['then'](respondWithStatusCode(_0x2d3239,null))[_0xd804('0x35')](function(_0xe193aa){if(_0x3f4934){socket[_0xd804('0x5a')](_0xd804('0x5c'),{'id':_0x3f4934['id']});}if(!_0x15c214){logger[_0xd804('0x15')](_0xd804('0x5d'),_0xe193aa);return _0x2d3239[_0xd804('0xb')](0x1f4)[_0xd804('0x5e')](_0xe193aa['message']);}logger[_0xd804('0x15')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x15c214['id'],JSON[_0xd804('0x5f')](_0xe193aa));});}; \ No newline at end of file +var _0xe13a=['hasOwnProperty','nolimit','offset','sort','filters','filter','merge','where','options','CloudProvider','includeAll','findAll','MicrosoftAzure','decryptString','data3','catch','show','include','find','service','body','Name\x20parameter\x20not\x20specified','rawAttributes','values','join','encryptString','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','state','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','microsoftAuthorization:success','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','update','then','destroy','stack','name','padEnd','slice','index','fieldName','type','map','query','intersection','model','attributes','fields','length'];(function(_0x4637c9,_0x51126e){var _0x434a20=function(_0x325f90){while(--_0x325f90){_0x4637c9['push'](_0x4637c9['shift']());}};_0x434a20(++_0x51126e);}(_0xe13a,0xe9));var _0xae13=function(_0x2a5763,_0x76820e){_0x2a5763=_0x2a5763-0x0;var _0x114144=_0xe13a[_0x2a5763];return _0x114144;};'use strict';var _=require(_0xae13('0x0'));var Redis=require(_0xae13('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));var logger=require(_0xae13('0x4'))(_0xae13('0x5'));var db=require(_0xae13('0x6'))['db'];var oauth=require(_0xae13('0x7'));config[_0xae13('0x8')]=_['defaults'](config[_0xae13('0x8')],{'host':_0xae13('0x9'),'port':0x18eb});var socket=require(_0xae13('0xa'))(new Redis(config[_0xae13('0x8')]));var redis=new Redis(config[_0xae13('0x8')]);function respondWithStatusCode(_0x10a913,_0x13ae1e){_0x13ae1e=_0x13ae1e||0xcc;return function(_0x18f7b7){if(_0x18f7b7){return _0x10a913[_0xae13('0xb')](_0x13ae1e);}return _0x10a913[_0xae13('0xc')](_0x13ae1e)[_0xae13('0xd')]();};}function respondWithResult(_0x107895,_0x37f7e1){_0x37f7e1=_0x37f7e1||0xc8;return function(_0x156b99){if(_0x156b99){return _0x107895[_0xae13('0xc')](_0x37f7e1)['json'](_0x156b99);}};}function respondWithFilteredResult(_0x5af625,_0x3506f5){return function(_0x166f8c){if(_0x166f8c){var _0x7cd23e=typeof _0x3506f5['offset']===_0xae13('0xe')&&typeof _0x3506f5[_0xae13('0xf')]===_0xae13('0xe');var _0x5d1bbd=_0x166f8c[_0xae13('0x10')];var _0x56e461=_0x7cd23e?0x0:_0x3506f5['offset'];var _0x37b51c=_0x7cd23e?_0x166f8c[_0xae13('0x10')]:_0x3506f5['offset']+_0x3506f5['limit'];var _0x18bf31;if(_0x37b51c>=_0x5d1bbd){_0x37b51c=_0x5d1bbd;_0x18bf31=0xc8;}else{_0x18bf31=0xce;}_0x5af625[_0xae13('0xc')](_0x18bf31);return _0x5af625[_0xae13('0x11')](_0xae13('0x12'),_0x56e461+'-'+_0x37b51c+'/'+_0x5d1bbd)[_0xae13('0x13')](_0x166f8c);}return null;};}function saveUpdates(_0x365dbb){return function(_0x565173){if(_0x565173){return _0x565173[_0xae13('0x14')](_0x365dbb)[_0xae13('0x15')](function(_0x401037){return _0x401037;});}return null;};}function removeEntity(_0x324f49){return function(_0x37a11a){if(_0x37a11a){return _0x37a11a[_0xae13('0x16')]()[_0xae13('0x15')](function(){_0x324f49[_0xae13('0xc')](0xcc)[_0xae13('0xd')]();});}};}function handleEntityNotFound(_0x23cbc7){return function(_0x25324a){if(!_0x25324a){_0x23cbc7[_0xae13('0xb')](0x194);}return _0x25324a;};}function handleError(_0x25e8df,_0x4531c8){_0x4531c8=_0x4531c8||0x1f4;return function(_0x1f2d45){logger['error'](_0x1f2d45[_0xae13('0x17')]);if(_0x1f2d45[_0xae13('0x18')]){delete _0x1f2d45['name'];}_0x25e8df[_0xae13('0xc')](_0x4531c8)['send'](_0x1f2d45);};}function maskClientSecret(_0x4b83b9){return _[_0xae13('0x19')](_0x4b83b9[_0xae13('0x1a')](0x0,0x3),0x14,'*');}exports[_0xae13('0x1b')]=function(_0x463a9f,_0x56b368){var _0x5e9092={},_0x1068b6={},_0x15a331={'count':0x0,'rows':[]};var _0x313aa6=_['map'](db['CloudProvider']['rawAttributes'],function(_0x2111d5){return{'name':_0x2111d5[_0xae13('0x1c')],'type':_0x2111d5[_0xae13('0x1d')]['key']};});_0x1068b6['model']=_[_0xae13('0x1e')](_0x313aa6,_0xae13('0x18'));_0x1068b6['query']=_['keys'](_0x463a9f[_0xae13('0x1f')]);_0x1068b6['filters']=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],_0x1068b6[_0xae13('0x1f')]);_0x5e9092[_0xae13('0x22')]=_[_0xae13('0x20')](_0x1068b6[_0xae13('0x21')],qs[_0xae13('0x23')](_0x463a9f[_0xae13('0x1f')][_0xae13('0x23')]));_0x5e9092[_0xae13('0x22')]=_0x5e9092['attributes'][_0xae13('0x24')]?_0x5e9092[_0xae13('0x22')]:_0x1068b6[_0xae13('0x21')];if(!_0x463a9f[_0xae13('0x1f')][_0xae13('0x25')](_0xae13('0x26'))){_0x5e9092['limit']=qs[_0xae13('0xf')](_0x463a9f[_0xae13('0x1f')]['limit']);_0x5e9092[_0xae13('0x27')]=qs['offset'](_0x463a9f[_0xae13('0x1f')]['offset']);}_0x5e9092['order']=qs['sort'](_0x463a9f[_0xae13('0x1f')][_0xae13('0x28')]);_0x5e9092['where']=qs[_0xae13('0x29')](_['pick'](_0x463a9f['query'],_0x1068b6['filters']),_0x313aa6);if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]){_0x5e9092['where']=_[_0xae13('0x2b')](_0x5e9092[_0xae13('0x2c')],{'$or':_['map'](_0x313aa6,function(_0x37de1f){if(_0x37de1f['type']!=='VIRTUAL'){var _0x254bd7={};_0x254bd7[_0x37de1f[_0xae13('0x18')]]={'$like':'%'+_0x463a9f[_0xae13('0x1f')][_0xae13('0x2a')]+'%'};return _0x254bd7;}})});}_0x5e9092=_['merge']({},_0x5e9092,_0x463a9f[_0xae13('0x2d')]);var _0x168315={'where':_0x5e9092['where']};return db[_0xae13('0x2e')]['count'](_0x168315)[_0xae13('0x15')](function(_0x942c32){_0x15a331[_0xae13('0x10')]=_0x942c32;if(_0x463a9f[_0xae13('0x1f')][_0xae13('0x2f')]){_0x5e9092['include']=[{'all':!![]}];}return db[_0xae13('0x2e')][_0xae13('0x30')](_0x5e9092);})[_0xae13('0x15')](function(_0x22ae48){_0x15a331['rows']=_[_0xae13('0x1e')](_0x22ae48,function(_0x5b7e91){if(_0x5b7e91['service']===_0xae13('0x31')){var _0x5c9796=encryptor[_0xae13('0x32')](_0x5b7e91[_0xae13('0x33')]);_0x5b7e91['data3']=maskClientSecret(_0x5c9796);}return _0x5b7e91;});return _0x15a331;})[_0xae13('0x15')](respondWithFilteredResult(_0x56b368,_0x5e9092))[_0xae13('0x34')](handleError(_0x56b368,null));};exports[_0xae13('0x35')]=function(_0x5c1dcc,_0x56076e){var _0x305eef={'raw':!![],'where':{'id':_0x5c1dcc['params']['id']}},_0x56ebd5={};_0x56ebd5[_0xae13('0x21')]=_['keys'](db[_0xae13('0x2e')]['rawAttributes']);_0x56ebd5[_0xae13('0x1f')]=_['keys'](_0x5c1dcc['query']);_0x56ebd5[_0xae13('0x29')]=_['intersection'](_0x56ebd5[_0xae13('0x21')],_0x56ebd5[_0xae13('0x1f')]);_0x305eef[_0xae13('0x22')]=_[_0xae13('0x20')](_0x56ebd5[_0xae13('0x21')],qs[_0xae13('0x23')](_0x5c1dcc[_0xae13('0x1f')][_0xae13('0x23')]));_0x305eef[_0xae13('0x22')]=_0x305eef[_0xae13('0x22')]['length']?_0x305eef[_0xae13('0x22')]:_0x56ebd5[_0xae13('0x21')];if(_0x5c1dcc['query']['includeAll']){_0x305eef[_0xae13('0x36')]=[{'all':!![]}];}_0x305eef=_[_0xae13('0x2b')]({},_0x305eef,_0x5c1dcc[_0xae13('0x2d')]);return db[_0xae13('0x2e')][_0xae13('0x37')](_0x305eef)[_0xae13('0x15')](handleEntityNotFound(_0x56076e,null))[_0xae13('0x15')](function(_0x57c512){if(_0x57c512[_0xae13('0x38')]===_0xae13('0x31')){var _0x126bd8=encryptor[_0xae13('0x32')](_0x57c512[_0xae13('0x33')]);_0x57c512[_0xae13('0x33')]=maskClientSecret(_0x126bd8);}return _0x57c512;})[_0xae13('0x15')](respondWithResult(_0x56076e,null))[_0xae13('0x34')](handleError(_0x56076e,null));};exports['create']=function(_0x37338f,_0x2076f8){if(!_0x37338f[_0xae13('0x39')][_0xae13('0x18')])throw new Error(_0xae13('0x3a'));if(!_0x37338f[_0xae13('0x39')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x419c53=db['CloudProvider'][_0xae13('0x3b')][_0xae13('0x38')][_0xae13('0x3c')];if(!_0x419c53['includes'](_0x37338f[_0xae13('0x39')][_0xae13('0x38')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x419c53[_0xae13('0x3d')](',\x20'));if(_0x37338f[_0xae13('0x39')]['service']===_0xae13('0x31')&&_0x37338f['body']['data3']){_0x37338f['body'][_0xae13('0x33')]=encryptor[_0xae13('0x3e')](_0x37338f[_0xae13('0x39')]['data3']);}return db[_0xae13('0x2e')]['create'](_0x37338f[_0xae13('0x39')],{})[_0xae13('0x15')](respondWithResult(_0x2076f8,0xc9))[_0xae13('0x34')](handleError(_0x2076f8,null));};exports[_0xae13('0x14')]=function(_0x23242a,_0x2827e5){if(_0x23242a[_0xae13('0x39')]['id']){delete _0x23242a[_0xae13('0x39')]['id'];}return db['CloudProvider'][_0xae13('0x37')]({'where':{'id':_0x23242a['params']['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x2827e5,null))[_0xae13('0x15')](function(_0x3804d4){if(_0x3804d4['service']===_0xae13('0x31')&&_0x23242a[_0xae13('0x39')][_0xae13('0x33')]){_0x23242a[_0xae13('0x39')]['data3']=encryptor[_0xae13('0x3e')](_0x23242a['body'][_0xae13('0x33')]);}return _0x3804d4;})['then'](saveUpdates(_0x23242a[_0xae13('0x39')],null))[_0xae13('0x15')](respondWithResult(_0x2827e5,null))['catch'](handleError(_0x2827e5,null));};exports[_0xae13('0x16')]=function(_0x1aa1c4,_0x1742db){return db[_0xae13('0x2e')][_0xae13('0x37')]({'where':{'id':_0x1aa1c4[_0xae13('0x3f')]['id']}})[_0xae13('0x15')](handleEntityNotFound(_0x1742db,null))[_0xae13('0x15')](removeEntity(_0x1742db,null))[_0xae13('0x34')](handleError(_0x1742db,null));};exports[_0xae13('0x40')]=function(_0x180558,_0x1842a5){return db[_0xae13('0x2e')][_0xae13('0x41')]({'where':{'id':_0x180558[_0xae13('0x3f')]['id']},'raw':!![]})[_0xae13('0x15')](function(_0xd847d7){if(!_0xd847d7)return _0x1842a5['sendStatus'](0x194);return{'url':oauth[_0xae13('0x42')](_0xd847d7,_0x180558[_0xae13('0x43')]['id'])};})[_0xae13('0x15')](respondWithResult(_0x1842a5,null))['catch'](handleError(_0x1842a5,null));};exports['oauth2MicrosoftCallback']=function(_0x37c6ad,_0x220ee9){var _0x2b6634=_0x37c6ad[_0xae13('0x39')];var _0x5b04fb;var _0x61b922;if(_0x2b6634[_0xae13('0x44')])throw _0x2b6634;redis['get'](_0x2b6634[_0xae13('0x45')])[_0xae13('0x15')](function(_0x4c2614){if(!_0x4c2614)throw new Error('Invalid\x20state\x20parameter');_0x5b04fb=JSON[_0xae13('0x46')](_0x4c2614);var _0x10903c=Buffer[_0xae13('0x47')](_0x2b6634[_0xae13('0x45')],_0xae13('0x48'))[_0xae13('0x49')](_0xae13('0x4a'));_0x61b922=JSON[_0xae13('0x46')](_0x10903c);if(!oauth[_0xae13('0x4b')](_0x2b6634[_0xae13('0x4c')],_0x5b04fb[_0xae13('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xae13('0x4e')](_0x2b6634['state']);return oauth[_0xae13('0x4f')](_0x2b6634[_0xae13('0x50')],_0x5b04fb);})[_0xae13('0x15')](function(_0x3e7771){_0x5b04fb[_0xae13('0x51')]=_0x3e7771[_0xae13('0x52')];_0x5b04fb['data6']=_0x3e7771[_0xae13('0x53')];return db['CloudProvider'][_0xae13('0x14')]({'data5':_0x5b04fb[_0xae13('0x51')],'data6':_0x5b04fb['data6']},{'where':{'id':_0x5b04fb['id']}});})[_0xae13('0x15')](function(){oauth[_0xae13('0x54')](_0x5b04fb);socket['emit'](_0xae13('0x55'),{'id':_0x61b922['id']});return;})[_0xae13('0x15')](respondWithStatusCode(_0x220ee9,null))[_0xae13('0x34')](function(_0x3b3091){if(_0x61b922){socket['emit']('microsoftAuthorization:error',{'id':_0x61b922['id']});}if(!_0x5b04fb){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x3b3091);return _0x220ee9[_0xae13('0xc')](0x1f4)[_0xae13('0x56')](_0x3b3091[_0xae13('0x57')]);}logger[_0xae13('0x44')](_0xae13('0x58'),_0x5b04fb['id'],JSON[_0xae13('0x59')](_0x3b3091));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index b77faed..4a0dc2c 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 _0x12a9=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','lodash','api','moment','bluebird'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x12a9,0xba));var _0x912a=function(_0x429796,_0x4ad866){_0x429796=_0x429796-0x0;var _0x240151=_0x12a9[_0x429796];return _0x240151;};'use strict';var _=require(_0x912a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x912a('0x1'));var moment=require(_0x912a('0x2'));var BPromise=require(_0x912a('0x3'));var rp=require(_0x912a('0x4'));var fs=require('fs');var path=require(_0x912a('0x5'));var rimraf=require(_0x912a('0x6'));var config=require(_0x912a('0x7'));var attributes=require(_0x912a('0x8'));module['exports']=function(_0x3efd9f,_0x5c5a79){return _0x3efd9f['define'](_0x912a('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa64a=['lodash','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xa64a,0xc6));var _0xaa64=function(_0x18bcbf,_0x518845){_0x18bcbf=_0x18bcbf-0x0;var _0x1286e9=_0xa64a[_0x18bcbf];return _0x1286e9;};'use strict';var _=require(_0xaa64('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaa64('0x1'));var BPromise=require(_0xaa64('0x2'));var rp=require(_0xaa64('0x3'));var fs=require('fs');var path=require(_0xaa64('0x4'));var rimraf=require('rimraf');var config=require(_0xaa64('0x5'));var attributes=require(_0xaa64('0x6'));module[_0xaa64('0x7')]=function(_0x4455fa,_0x5bb598){return _0x4455fa[_0xaa64('0x8')](_0xaa64('0x9'),attributes,{'tableName':_0xaa64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 2fbf60e..390b66e 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 _0x970f=['crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','Outlook365','data7','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','randomBytes','client_id','join','redirect_uri','data4','response_mode','form_post','prompt','key','value','oauth2Claims','data1','set','stringify','decode','iss','issuer','aud','audience','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','POST','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','all','inspect','error','exports','lodash'];(function(_0x473105,_0x155107){var _0x1ce13d=function(_0x4b8c98){while(--_0x4b8c98){_0x473105['push'](_0x473105['shift']());}};_0x1ce13d(++_0x155107);}(_0x970f,0xf2));var _0xf970=function(_0x252862,_0x2040a6){_0x252862=_0x252862-0x0;var _0x3ab7e2=_0x970f[_0x252862];return _0x3ab7e2;};'use strict';var _=require(_0xf970('0x0'));var crypto=require(_0xf970('0x1'));var jwt=require(_0xf970('0x2'));var moment=require(_0xf970('0x3'));var Redis=require(_0xf970('0x4'));var rp=require(_0xf970('0x5'));var util=require(_0xf970('0x6'));var encryptor=require(_0xf970('0x7'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xf970('0x8'));var schedule=require(_0xf970('0x9'));var db=require(_0xf970('0xa'))['db'];config[_0xf970('0xb')]=_[_0xf970('0xc')](config[_0xf970('0xb')],{'host':_0xf970('0xd'),'port':0x18eb});var redis=new Redis(config[_0xf970('0xb')]);var MICROSOFT_AUTH_URL=_0xf970('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf970('0xf'),_0xf970('0x10'),_0xf970('0x11'),'offline_access',_0xf970('0x12'),_0xf970('0x13'),_0xf970('0x14')],'Dynamics365':[_0xf970('0xf'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xf970('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xf970('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x46d8f9){var _0x27b532=_[_0xf970('0x17')](AZURE_AUTH_SCOPES[_0x46d8f9['type']]);if(_0x46d8f9[_0xf970('0x18')]===_0xf970('0x19'))_0x27b532[_0xf970('0x1a')](_0x46d8f9['data7']+'/.default');return _0x27b532['join']('\x20');}function getAccessTokenScope(_0x4ad76a){if(_0x4ad76a['type']===_0xf970('0x1b'))return _0xf970('0x12');if(_0x4ad76a[_0xf970('0x18')]===_0xf970('0x19'))return _0x4ad76a[_0xf970('0x1c')]+_0xf970('0x1d');}function generateMicrosoftAuthorizationUrl(_0x1ec238,_0x4c7312){var _0xcbbb6c=MICROSOFT_AUTH_URL[_0xf970('0x1e')](_0xf970('0x1f'),_0x1ec238[_0xf970('0x20')]);var _0x59fa05=[_0xf970('0x21'),_0xf970('0x22')];var _0x3a7a85=Buffer[_0xf970('0x23')](JSON['stringify']({'id':_0x4c7312}))[_0xf970('0x24')](_0xf970('0x25'));var _0x6698c0=crypto[_0xf970('0x26')](0x10)[_0xf970('0x24')]('hex');var _0x1fd730=getAuthorizationScopes(_0x1ec238);var _0x4ab9fb=[{'key':_0xf970('0x27'),'value':_0x1ec238['data1']},{'key':'response_type','value':encodeURIComponent(_0x59fa05[_0xf970('0x28')]('\x20'))},{'key':_0xf970('0x29'),'value':_0x1ec238[_0xf970('0x2a')]},{'key':_0xf970('0x2b'),'value':_0xf970('0x2c')},{'key':'scope','value':encodeURIComponent(_0x1fd730)},{'key':'state','value':_0x3a7a85},{'key':'nonce','value':_0x6698c0},{'key':_0xf970('0x2d'),'value':'login'}];var _0x2450ce=_0xcbbb6c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf970('0x17')](_0x4ab9fb,function(_0x224866){return _0x224866[_0xf970('0x2e')]+'='+_0x224866[_0xf970('0x2f')];})[_0xf970('0x28')]('&');_0x1ec238[_0xf970('0x30')]={'issuer':_0xcbbb6c[_0xf970('0x1e')]('oauth2/',''),'audience':_0x1ec238[_0xf970('0x31')],'state':_0x3a7a85,'nonce':_0x6698c0};redis[_0xf970('0x32')](_0x3a7a85,JSON[_0xf970('0x33')](_0x1ec238));return _0x2450ce;}function isValidIdToken(_0x2400b4,_0x1f802d){try{var _0x25cd26=jwt[_0xf970('0x34')](_0x2400b4,{'complete':!![]});var _0x57ff6d=_0x25cd26['payload'];if(_0x57ff6d[_0xf970('0x35')]!==_0x1f802d[_0xf970('0x36')])return![];if(_0x57ff6d[_0xf970('0x37')]!==_0x1f802d[_0xf970('0x38')])return![];if(_0x57ff6d['nonce']!==_0x1f802d['nonce'])return![];if(moment()['isAfter'](moment[_0xf970('0x39')](_0x57ff6d[_0xf970('0x3a')])))return![];return!![];}catch(_0x258de5){throw _0x258de5;}}function refreshOauth2MicrosoftAccessToken(_0x3825cb){return Promise[_0xf970('0x3b')]()[_0xf970('0x3c')](function(){if(_0x3825cb[_0xf970('0x3d')])return _0x3825cb;return db[_0xf970('0x3e')][_0xf970('0x3f')]({'where':{'id':_0x3825cb['id']},'raw':!![]});})['then'](function(_0x5823f4){var _0xe04c11={'grant_type':_0xf970('0x40'),'refresh_token':_0x5823f4[_0xf970('0x41')],'scope':getAccessTokenScope(_0x5823f4),'redirect_uri':_0x5823f4[_0xf970('0x2a')],'client_id':_0x5823f4['data1'],'client_secret':encryptor['decryptString'](_0x5823f4[_0xf970('0x3d')])};var _0x4067c4={'method':_0xf970('0x42'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x5823f4[_0xf970('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe04c11,'json':!![]};return rp(_0x4067c4);})[_0xf970('0x3c')](function(_0xa18047){_0x3825cb[_0xf970('0x43')]=_0xa18047[_0xf970('0x44')];_0x3825cb[_0xf970('0x41')]=_0xa18047[_0xf970('0x40')];return db[_0xf970('0x3e')][_0xf970('0x45')]({'data5':_0x3825cb[_0xf970('0x43')],'data6':_0x3825cb['data6']},{'where':{'id':_0x3825cb['id']}});})[_0xf970('0x3c')](function(){return _0x3825cb;})[_0xf970('0x46')](function(_0x1cd41c){logger['error'](_0xf970('0x47'),_0x3825cb['id'],_0x1cd41c);});}function getOauth2MicrosoftAccessToken(_0x467733,_0x19c8fc){var _0xaa1163={'grant_type':_0xf970('0x48'),'code':_0x467733,'scope':getAccessTokenScope(_0x19c8fc),'redirect_uri':_0x19c8fc[_0xf970('0x2a')],'client_id':_0x19c8fc[_0xf970('0x31')],'client_secret':encryptor[_0xf970('0x49')](_0x19c8fc[_0xf970('0x3d')])};var _0x1b0d3b={'method':_0xf970('0x42'),'uri':MICROSOFT_AUTH_URL[_0xf970('0x1e')](_0xf970('0x1f'),_0x19c8fc[_0xf970('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xaa1163,'json':!![]};return rp(_0x1b0d3b);}function startRefreshInterval(_0x52cdfe){var _0x52cbd5=schedule[_0xf970('0x4a')];if(_0x52cbd5[_0x52cdfe['id']])clearInterval(_0x52cbd5[_0x52cdfe['id']]);_0x52cbd5[_0x52cdfe['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf970('0x4b')](this,{'id':_0x52cdfe['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf970('0x4a')]=_0x52cbd5;}function startAllRefreshIntervals(){return db[_0xf970('0x3e')][_0xf970('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf970('0x3c')](function(_0x1d777f){var _0x18842d=_0x1d777f[_0xf970('0x17')](function(_0x410efc){return refreshOauth2MicrosoftAccessToken(_0x410efc)[_0xf970('0x3c')](function(_0x1d5982){startRefreshInterval(_0x1d5982);});});return Promise[_0xf970('0x4d')](_0x18842d);})['catch'](function(_0x5e0e49){var _0x2cf217=_0x5e0e49?util[_0xf970('0x4e')](_0x5e0e49,{'showHidden':![],'depth':null}):'';logger[_0xf970('0x4f')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2cf217);});}module[_0xf970('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x35ae=['exp','resolve','then','data3','CloudProvider','decryptString','POST','data5','data6','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','{TENANT_ID}','intervals','findAll','map','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','data7','join','Outlook365','/.default','replace','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','response_type','redirect_uri','data4','response_mode','form_post','state','nonce','prompt','value','oauth2Claims','oauth2/','data1','set','decode','payload','iss','issuer','aud','isAfter','unix'];(function(_0x2612d6,_0x7357a2){var _0x1277b6=function(_0x1d704a){while(--_0x1d704a){_0x2612d6['push'](_0x2612d6['shift']());}};_0x1277b6(++_0x7357a2);}(_0x35ae,0x10f));var _0xe35a=function(_0xd94ba3,_0x5e2e97){_0xd94ba3=_0xd94ba3-0x0;var _0x3c5402=_0x35ae[_0xd94ba3];return _0x3c5402;};'use strict';var _=require(_0xe35a('0x0'));var crypto=require(_0xe35a('0x1'));var jwt=require(_0xe35a('0x2'));var moment=require('moment');var Redis=require(_0xe35a('0x3'));var rp=require(_0xe35a('0x4'));var util=require(_0xe35a('0x5'));var encryptor=require(_0xe35a('0x6'));var config=require(_0xe35a('0x7'));var logger=require(_0xe35a('0x8'))(_0xe35a('0x9'));var schedule=require(_0xe35a('0xa'));var db=require(_0xe35a('0xb'))['db'];config[_0xe35a('0xc')]=_[_0xe35a('0xd')](config[_0xe35a('0xc')],{'host':_0xe35a('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xe35a('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe35a('0x10'),_0xe35a('0x11'),_0xe35a('0x12'),'offline_access',_0xe35a('0x13'),_0xe35a('0x14'),_0xe35a('0x15')],'Dynamics365':[_0xe35a('0x10'),_0xe35a('0x16')]};var MICROSOFT_AUTH_ENDPOINT=_0xe35a('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xe35a('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x56e7fe){var _0x70b379=_['map'](AZURE_AUTH_SCOPES[_0x56e7fe[_0xe35a('0x19')]]);if(_0x56e7fe['type']==='Dynamics365')_0x70b379[_0xe35a('0x1a')](_0x56e7fe[_0xe35a('0x1b')]+'/.default');return _0x70b379[_0xe35a('0x1c')]('\x20');}function getAccessTokenScope(_0x58d268){if(_0x58d268[_0xe35a('0x19')]===_0xe35a('0x1d'))return _0xe35a('0x13');if(_0x58d268[_0xe35a('0x19')]==='Dynamics365')return _0x58d268['data7']+_0xe35a('0x1e');}function generateMicrosoftAuthorizationUrl(_0x539298,_0x5138a9){var _0x246154=MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x539298[_0xe35a('0x20')]);var _0x55173e=[_0xe35a('0x21'),_0xe35a('0x22')];var _0x2e59f6=Buffer[_0xe35a('0x23')](JSON[_0xe35a('0x24')]({'id':_0x5138a9}))[_0xe35a('0x25')]('base64');var _0x1e535e=crypto[_0xe35a('0x26')](0x10)[_0xe35a('0x25')](_0xe35a('0x27'));var _0x3519e3=getAuthorizationScopes(_0x539298);var _0x45352a=[{'key':_0xe35a('0x28'),'value':_0x539298['data1']},{'key':_0xe35a('0x29'),'value':encodeURIComponent(_0x55173e['join']('\x20'))},{'key':_0xe35a('0x2a'),'value':_0x539298[_0xe35a('0x2b')]},{'key':_0xe35a('0x2c'),'value':_0xe35a('0x2d')},{'key':'scope','value':encodeURIComponent(_0x3519e3)},{'key':_0xe35a('0x2e'),'value':_0x2e59f6},{'key':_0xe35a('0x2f'),'value':_0x1e535e},{'key':_0xe35a('0x30'),'value':'login'}];var _0x1d25fa=_0x246154+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x45352a,function(_0x17645c){return _0x17645c['key']+'='+_0x17645c[_0xe35a('0x31')];})[_0xe35a('0x1c')]('&');_0x539298[_0xe35a('0x32')]={'issuer':_0x246154[_0xe35a('0x1f')](_0xe35a('0x33'),''),'audience':_0x539298[_0xe35a('0x34')],'state':_0x2e59f6,'nonce':_0x1e535e};redis[_0xe35a('0x35')](_0x2e59f6,JSON[_0xe35a('0x24')](_0x539298));return _0x1d25fa;}function isValidIdToken(_0x5a33cf,_0x13f5a7){try{var _0x45173f=jwt[_0xe35a('0x36')](_0x5a33cf,{'complete':!![]});var _0x184f15=_0x45173f[_0xe35a('0x37')];if(_0x184f15[_0xe35a('0x38')]!==_0x13f5a7[_0xe35a('0x39')])return![];if(_0x184f15[_0xe35a('0x3a')]!==_0x13f5a7['audience'])return![];if(_0x184f15['nonce']!==_0x13f5a7[_0xe35a('0x2f')])return![];if(moment()[_0xe35a('0x3b')](moment[_0xe35a('0x3c')](_0x184f15[_0xe35a('0x3d')])))return![];return!![];}catch(_0x3efbcb){throw _0x3efbcb;}}function refreshOauth2MicrosoftAccessToken(_0x368b3d){return Promise[_0xe35a('0x3e')]()[_0xe35a('0x3f')](function(){if(_0x368b3d[_0xe35a('0x40')])return _0x368b3d;return db[_0xe35a('0x41')]['findOne']({'where':{'id':_0x368b3d['id']},'raw':!![]});})[_0xe35a('0x3f')](function(_0x4149fd){var _0x310fd9={'grant_type':'refresh_token','refresh_token':_0x4149fd['data6'],'scope':getAccessTokenScope(_0x4149fd),'redirect_uri':_0x4149fd[_0xe35a('0x2b')],'client_id':_0x4149fd[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x4149fd[_0xe35a('0x40')])};var _0x41a4c4={'method':_0xe35a('0x43'),'uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')]('{TENANT_ID}',_0x4149fd[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x310fd9,'json':!![]};return rp(_0x41a4c4);})['then'](function(_0x92a9d6){_0x368b3d[_0xe35a('0x44')]=_0x92a9d6['access_token'];_0x368b3d[_0xe35a('0x45')]=_0x92a9d6[_0xe35a('0x46')];return db[_0xe35a('0x41')][_0xe35a('0x47')]({'data5':_0x368b3d[_0xe35a('0x44')],'data6':_0x368b3d[_0xe35a('0x45')]},{'where':{'id':_0x368b3d['id']}});})[_0xe35a('0x3f')](function(){return _0x368b3d;})[_0xe35a('0x48')](function(_0x54fd1a){logger[_0xe35a('0x49')](_0xe35a('0x4a'),_0x368b3d['id'],_0x54fd1a);});}function getOauth2MicrosoftAccessToken(_0x1542d6,_0x3c8587){var _0x974ae={'grant_type':_0xe35a('0x4b'),'code':_0x1542d6,'scope':getAccessTokenScope(_0x3c8587),'redirect_uri':_0x3c8587[_0xe35a('0x2b')],'client_id':_0x3c8587[_0xe35a('0x34')],'client_secret':encryptor[_0xe35a('0x42')](_0x3c8587['data3'])};var _0x1a285c={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xe35a('0x1f')](_0xe35a('0x4c'),_0x3c8587[_0xe35a('0x20')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x974ae,'json':!![]};return rp(_0x1a285c);}function startRefreshInterval(_0x597c7e){var _0xcb86c8=schedule[_0xe35a('0x4d')];if(_0xcb86c8[_0x597c7e['id']])clearInterval(_0xcb86c8[_0x597c7e['id']]);_0xcb86c8[_0x597c7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x597c7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xcb86c8;}function startAllRefreshIntervals(){return db[_0xe35a('0x41')][_0xe35a('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe35a('0x3f')](function(_0x1a238b){var _0x1bf494=_0x1a238b[_0xe35a('0x4f')](function(_0x5ccbc4){return refreshOauth2MicrosoftAccessToken(_0x5ccbc4)[_0xe35a('0x3f')](function(_0x1ca80e){startRefreshInterval(_0x1ca80e);});});return Promise['all'](_0x1bf494);})[_0xe35a('0x48')](function(_0x2a0cd1){var _0x315250=_0x2a0cd1?util[_0xe35a('0x50')](_0x2a0cd1,{'showHidden':![],'depth':null}):'';logger[_0xe35a('0x49')](_0xe35a('0x51'),_0x315250);});}module[_0xe35a('0x52')]={'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 45cad73..2f666f8 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 _0x4f2f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','ioredis'];(function(_0xea6018,_0x4cf082){var _0x57b54d=function(_0x49099a){while(--_0x49099a){_0xea6018['push'](_0xea6018['shift']());}};_0x57b54d(++_0x4cf082);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x4f2f[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf4f2('0x0'));var BPromise=require(_0xf4f2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4f2('0x2'));var db=require(_0xf4f2('0x3'))['db'];var utils=require(_0xf4f2('0x4'));var logger=require(_0xf4f2('0x5'))(_0xf4f2('0x6'));var config=require(_0xf4f2('0x7'));var jayson=require(_0xf4f2('0x8'));var client=jayson[_0xf4f2('0x9')][_0xf4f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cc7c0,_0x478723,_0x5d14a9){return new BPromise(function(_0x7c1660,_0xe39952){return client['request'](_0x5cc7c0,_0x5d14a9)[_0xf4f2('0xb')](function(_0x53dc4e){logger[_0xf4f2('0xc')](_0xf4f2('0xd'),_0x478723,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x478723,'request\x20sent',JSON[_0xf4f2('0xe')](_0x53dc4e));if(_0x53dc4e[_0xf4f2('0xf')]){if(_0x53dc4e['error'][_0xf4f2('0x10')]===0x1f4){logger[_0xf4f2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x478723,_0x53dc4e[_0xf4f2('0xf')]['message']);return _0xe39952(_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);}logger[_0xf4f2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x478723,_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);return _0x7c1660(_0x53dc4e[_0xf4f2('0xf')][_0xf4f2('0x11')]);}else{logger['info'](_0xf4f2('0xd'),_0x478723,_0xf4f2('0x12'));_0x7c1660(_0x53dc4e[_0xf4f2('0x13')][_0xf4f2('0x11')]);}})[_0xf4f2('0x14')](function(_0x545b43){logger[_0xf4f2('0xf')]('CloudProvider,\x20%s,\x20%s',_0x478723,_0x545b43);_0xe39952(_0x545b43);});});} \ No newline at end of file +var _0xb515=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4ca0a1,_0x6158d8){var _0x1c26c3=function(_0x3029e5){while(--_0x3029e5){_0x4ca0a1['push'](_0x4ca0a1['shift']());}};_0x1c26c3(++_0x6158d8);}(_0xb515,0x1b8));var _0x5b51=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb515[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x5b51('0x0'));var util=require('util');var moment=require(_0x5b51('0x1'));var BPromise=require(_0x5b51('0x2'));var rs=require(_0x5b51('0x3'));var fs=require('fs');var Redis=require(_0x5b51('0x4'));var db=require(_0x5b51('0x5'))['db'];var utils=require(_0x5b51('0x6'));var logger=require(_0x5b51('0x7'))(_0x5b51('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b51('0x9'));var client=jayson[_0x5b51('0xa')][_0x5b51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x293d82,_0x396b3f,_0x2c6d86){return new BPromise(function(_0x1d5082,_0x226e9c){return client[_0x5b51('0xc')](_0x293d82,_0x2c6d86)[_0x5b51('0xd')](function(_0x1085e6){logger[_0x5b51('0xe')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x5b51('0xf'));logger[_0x5b51('0x10')](_0x5b51('0x11'),_0x396b3f,_0x5b51('0xf'),JSON[_0x5b51('0x12')](_0x1085e6));if(_0x1085e6[_0x5b51('0x13')]){if(_0x1085e6['error']['code']===0x1f4){logger['error'](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x226e9c(_0x1085e6[_0x5b51('0x13')]['message']);}logger[_0x5b51('0x13')](_0x5b51('0x14'),_0x396b3f,_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);return _0x1d5082(_0x1085e6[_0x5b51('0x13')][_0x5b51('0x15')]);}else{logger[_0x5b51('0xe')](_0x5b51('0x14'),_0x396b3f,_0x5b51('0xf'));_0x1d5082(_0x1085e6[_0x5b51('0x16')][_0x5b51('0x15')]);}})[_0x5b51('0x17')](function(_0x520686){logger[_0x5b51('0x13')]('CloudProvider,\x20%s,\x20%s',_0x396b3f,_0x520686);_0x226e9c(_0x520686);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7317bb4..8374d87 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x5f2f,0x73));var _0xf5f2=function(_0x404d14,_0x57e3c3){_0x404d14=_0x404d14-0x0;var _0x134ef5=_0x5f2f[_0x404d14];return _0x134ef5;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _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(_0x16e773,_0x8abfd7){var _0x54a3e8=function(_0x5a5f25){while(--_0x5a5f25){_0x16e773['push'](_0x16e773['shift']());}};_0x54a3e8(++_0x8abfd7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 4b26260..907de49 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 _0x207d=['name','sequelize','exports','STRING'];(function(_0x5494f1,_0x2b7c7f){var _0x5d9384=function(_0x40dcef){while(--_0x40dcef){_0x5494f1['push'](_0x5494f1['shift']());}};_0x5d9384(++_0x2b7c7f);}(_0x207d,0x10d));var _0xd207=function(_0x50d407,_0x3613ce){_0x50d407=_0x50d407-0x0;var _0x575491=_0x207d[_0x50d407];return _0x575491;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'name':{'type':Sequelize[_0xd207('0x2')],'unique':_0xd207('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xd207('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd207('0x2')]},'fax':{'type':Sequelize[_0xd207('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xd207('0x2')]},'postalCode':{'type':Sequelize[_0xd207('0x2')]},'city':{'type':Sequelize[_0xd207('0x2')]},'country':{'type':Sequelize[_0xd207('0x2')]},'email':{'type':Sequelize[_0xd207('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xd207('0x2')]},'sStreet':{'type':Sequelize[_0xd207('0x2')]},'sPostalCode':{'type':Sequelize[_0xd207('0x2')]},'sCity':{'type':Sequelize[_0xd207('0x2')]},'sCountry':{'type':Sequelize[_0xd207('0x2')]},'description':{'type':Sequelize[_0xd207('0x2')]}}; \ No newline at end of file +var _0xbd94=['STRING','sequelize','name'];(function(_0xb119da,_0x42d325){var _0x3ecb48=function(_0x361539){while(--_0x361539){_0xb119da['push'](_0xb119da['shift']());}};_0x3ecb48(++_0x42d325);}(_0xbd94,0xfd));var _0x4bd9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbd94[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4bd9('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4bd9('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4bd9('0x2')]},'website':{'type':Sequelize[_0x4bd9('0x2')]},'phone':{'type':Sequelize[_0x4bd9('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4bd9('0x2')]},'street':{'type':Sequelize[_0x4bd9('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4bd9('0x2')]},'country':{'type':Sequelize[_0x4bd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4bd9('0x2')]},'sStreet':{'type':Sequelize[_0x4bd9('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4bd9('0x2')]},'sCountry':{'type':Sequelize[_0x4bd9('0x2')]},'description':{'type':Sequelize[_0x4bd9('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index bdea565..4805c4d 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 _0x9dfe=['findOne','rawAttributes','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit'];(function(_0x3d5f5b,_0x5d81c8){var _0x1bee6c=function(_0x2c1e6c){while(--_0x2c1e6c){_0x3d5f5b['push'](_0x3d5f5b['shift']());}};_0x1bee6c(++_0x5d81c8);}(_0x9dfe,0x1c1));var _0xe9df=function(_0x2d8357,_0x463fa4){_0x2d8357=_0x2d8357-0x0;var _0x442fc9=_0x9dfe[_0x2d8357];return _0x442fc9;};'use strict';var emlformat=require(_0xe9df('0x0'));var rimraf=require(_0xe9df('0x1'));var zipdir=require(_0xe9df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe9df('0x3'));var BPromise=require(_0xe9df('0x4'));var Mustache=require(_0xe9df('0x5'));var util=require('util');var path=require(_0xe9df('0x6'));var sox=require(_0xe9df('0x7'));var csv=require('to-csv');var ejs=require(_0xe9df('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9df('0x9'));var squel=require(_0xe9df('0xa'));var crypto=require(_0xe9df('0xb'));var jsforce=require(_0xe9df('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe9df('0xd'));var querystring=require(_0xe9df('0xe'));var Papa=require(_0xe9df('0xf'));var Redis=require(_0xe9df('0x10'));var authService=require(_0xe9df('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9df('0x12'));var logger=require(_0xe9df('0x13'))(_0xe9df('0x14'));var utils=require('../../config/utils');var config=require(_0xe9df('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9df('0x16'))['db'];function respondWithStatusCode(_0x1d1154,_0x572380){_0x572380=_0x572380||0xcc;return function(_0x4aac2e){if(_0x4aac2e){return _0x1d1154[_0xe9df('0x17')](_0x572380);}return _0x1d1154['status'](_0x572380)[_0xe9df('0x18')]();};}function respondWithResult(_0x298421,_0x15f671){_0x15f671=_0x15f671||0xc8;return function(_0x3b3cdc){if(_0x3b3cdc){return _0x298421['status'](_0x15f671)['json'](_0x3b3cdc);}};}function respondWithFilteredResult(_0x494ac1,_0x161b83){return function(_0x4315e6){if(_0x4315e6){var _0x4dd78c=typeof _0x161b83[_0xe9df('0x19')]===_0xe9df('0x1a')&&typeof _0x161b83[_0xe9df('0x1b')]===_0xe9df('0x1a');var _0x3513fa=_0x4315e6['count'];var _0x109fdf=_0x4dd78c?0x0:_0x161b83[_0xe9df('0x19')];var _0x417500=_0x4dd78c?_0x4315e6[_0xe9df('0x1c')]:_0x161b83[_0xe9df('0x19')]+_0x161b83[_0xe9df('0x1b')];var _0x1e928e;if(_0x417500>=_0x3513fa){_0x417500=_0x3513fa;_0x1e928e=0xc8;}else{_0x1e928e=0xce;}_0x494ac1[_0xe9df('0x1d')](_0x1e928e);return _0x494ac1['set'](_0xe9df('0x1e'),_0x109fdf+'-'+_0x417500+'/'+_0x3513fa)[_0xe9df('0x1f')](_0x4315e6);}return null;};}function patchUpdates(_0x979983){return function(_0x3bef3a){try{jsonpatch[_0xe9df('0x20')](_0x3bef3a,_0x979983,!![]);}catch(_0xa9a07c){return BPromise[_0xe9df('0x21')](_0xa9a07c);}return _0x3bef3a[_0xe9df('0x22')]();};}function saveUpdates(_0x234f20,_0x2107cc){return function(_0x2dc83d){if(_0x2dc83d){return _0x2dc83d[_0xe9df('0x23')](_0x234f20)['then'](function(_0x26e980){return _0x26e980;});}return null;};}function removeEntity(_0x568492,_0x15eac0){return function(_0x1c3aac){if(_0x1c3aac){return _0x1c3aac[_0xe9df('0x24')]()[_0xe9df('0x25')](function(){var _0x5db09e=_0x1c3aac[_0xe9df('0x26')]({'plain':!![]});var _0x2c6e2f='Companies';return db[_0xe9df('0x27')][_0xe9df('0x24')]({'where':{'type':_0x2c6e2f,'resourceId':_0x5db09e['id']}})[_0xe9df('0x25')](function(){return _0x1c3aac;});})[_0xe9df('0x25')](function(){_0x568492[_0xe9df('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1234,_0x27df9a){return function(_0x28d6e5){if(!_0x28d6e5){_0x4e1234[_0xe9df('0x17')](0x194);}return _0x28d6e5;};}function handleError(_0x3a332a,_0x4d3dcd){_0x4d3dcd=_0x4d3dcd||0x1f4;return function(_0x2ed32f){logger[_0xe9df('0x28')](_0x2ed32f[_0xe9df('0x29')]);if(_0x2ed32f['name']){delete _0x2ed32f['name'];}_0x3a332a[_0xe9df('0x1d')](_0x4d3dcd)[_0xe9df('0x2a')](_0x2ed32f);};}exports[_0xe9df('0x2b')]=function(_0x221c95,_0x116ecc){var _0x5952c7={},_0x168487={},_0x326101={'count':0x0,'rows':[]};return db[_0xe9df('0x2c')][_0xe9df('0x2d')]()[_0xe9df('0x25')](function(_0x2cad1b){_0x168487['model']=_[_0xe9df('0x2e')](_0x2cad1b);_0x168487[_0xe9df('0x2f')]=_[_0xe9df('0x2e')](_0x221c95[_0xe9df('0x2f')]);_0x168487[_0xe9df('0x30')]=_[_0xe9df('0x31')](_0x168487[_0xe9df('0x32')],_0x168487['query']);_0x5952c7[_0xe9df('0x33')]=_[_0xe9df('0x31')](_0x168487[_0xe9df('0x32')],qs[_0xe9df('0x34')](_0x221c95[_0xe9df('0x2f')][_0xe9df('0x34')]));_0x5952c7['attributes']=_0x5952c7[_0xe9df('0x33')][_0xe9df('0x35')]?_0x5952c7[_0xe9df('0x33')]:_0x168487[_0xe9df('0x32')];if(!_0x221c95['query']['hasOwnProperty'](_0xe9df('0x36'))){_0x5952c7[_0xe9df('0x1b')]=qs['limit'](_0x221c95['query']['limit']);_0x5952c7[_0xe9df('0x19')]=qs['offset'](_0x221c95[_0xe9df('0x2f')][_0xe9df('0x19')]);}_0x5952c7[_0xe9df('0x37')]=qs[_0xe9df('0x38')](_0x221c95[_0xe9df('0x2f')][_0xe9df('0x38')]);_0x5952c7[_0xe9df('0x39')]=qs[_0xe9df('0x30')](_[_0xe9df('0x3a')](_0x221c95[_0xe9df('0x2f')],_0x168487[_0xe9df('0x30')]),_0x2cad1b);if(_0x221c95[_0xe9df('0x2f')][_0xe9df('0x3b')]){_0x5952c7['where']=_[_0xe9df('0x3c')](_0x5952c7[_0xe9df('0x39')],{'$or':_[_0xe9df('0x3d')](_0x5952c7[_0xe9df('0x33')],function(_0x28a65f){var _0x595fda={};_0x595fda[_0x28a65f]={'$like':'%'+_0x221c95['query']['filter']+'%'};return _0x595fda;})});}_0x5952c7=_[_0xe9df('0x3c')]({},_0x5952c7,_0x221c95[_0xe9df('0x3e')]);var _0x2ac1cc={'where':_0x5952c7[_0xe9df('0x39')]};return db[_0xe9df('0x2c')][_0xe9df('0x1c')](_0x2ac1cc)[_0xe9df('0x25')](function(_0x82f740){_0x326101['count']=_0x82f740;if(_0x221c95[_0xe9df('0x2f')][_0xe9df('0x3f')]){_0x5952c7['include']=[{'all':!![]}];}return db[_0xe9df('0x2c')][_0xe9df('0x40')](_0x5952c7);})[_0xe9df('0x25')](function(_0x524f48){_0x326101[_0xe9df('0x41')]=_0x524f48;return _0x326101;})[_0xe9df('0x25')](respondWithFilteredResult(_0x116ecc,_0x5952c7))[_0xe9df('0x42')](handleError(_0x116ecc,null));})[_0xe9df('0x42')](handleError(_0x116ecc,null));};exports[_0xe9df('0x43')]=function(_0x124c98,_0x5571e8){var _0xbacc4c={'raw':![],'where':{'id':_0x124c98[_0xe9df('0x44')]['id']}},_0x5144b0={};_0x5144b0[_0xe9df('0x32')]=_[_0xe9df('0x2e')](db[_0xe9df('0x2c')]['rawAttributes']);_0x5144b0[_0xe9df('0x2f')]=_[_0xe9df('0x2e')](_0x124c98[_0xe9df('0x2f')]);_0x5144b0[_0xe9df('0x30')]=_[_0xe9df('0x31')](_0x5144b0[_0xe9df('0x32')],_0x5144b0[_0xe9df('0x2f')]);_0xbacc4c[_0xe9df('0x33')]=_['intersection'](_0x5144b0['model'],qs['fields'](_0x124c98[_0xe9df('0x2f')][_0xe9df('0x34')]));_0xbacc4c[_0xe9df('0x33')]=_0xbacc4c[_0xe9df('0x33')][_0xe9df('0x35')]?_0xbacc4c[_0xe9df('0x33')]:_0x5144b0[_0xe9df('0x32')];if(_0x124c98[_0xe9df('0x2f')][_0xe9df('0x3f')]){_0xbacc4c[_0xe9df('0x45')]=[{'all':!![]}];}_0xbacc4c=_['merge']({},_0xbacc4c,_0x124c98[_0xe9df('0x3e')]);return db[_0xe9df('0x2c')]['find'](_0xbacc4c)[_0xe9df('0x25')](handleEntityNotFound(_0x5571e8,null))[_0xe9df('0x25')](respondWithResult(_0x5571e8,null))[_0xe9df('0x42')](handleError(_0x5571e8,null));};exports[_0xe9df('0x46')]=function(_0x389545,_0x628b74){return db[_0xe9df('0x2c')][_0xe9df('0x46')](_0x389545[_0xe9df('0x47')],{})[_0xe9df('0x25')](function(_0x4b81c7){var _0x2ffc73=_0x389545[_0xe9df('0x48')]['get']({'plain':!![]});if(!_0x2ffc73)throw new Error(_0xe9df('0x49'));if(_0x2ffc73[_0xe9df('0x4a')]===_0xe9df('0x48')){var _0x2d1e60=_0x4b81c7[_0xe9df('0x26')]({'plain':!![]});var _0x372a3f=_0xe9df('0x4b');return db[_0xe9df('0x4c')][_0xe9df('0x4d')]({'where':{'name':_0x372a3f,'userProfileId':_0x2ffc73[_0xe9df('0x4e')]},'raw':!![]})[_0xe9df('0x25')](function(_0x3d1ceb){if(_0x3d1ceb&&_0x3d1ceb['autoAssociation']===0x0){return db[_0xe9df('0x27')][_0xe9df('0x46')]({'name':_0x2d1e60[_0xe9df('0x4f')],'resourceId':_0x2d1e60['id'],'type':_0x3d1ceb[_0xe9df('0x4f')],'sectionId':_0x3d1ceb['id']},{})[_0xe9df('0x25')](function(){return _0x4b81c7;});}else{return _0x4b81c7;}})[_0xe9df('0x42')](function(_0x4574d4){logger[_0xe9df('0x28')](_0xe9df('0x50'),_0x4574d4);throw _0x4574d4;});}return _0x4b81c7;})[_0xe9df('0x25')](respondWithResult(_0x628b74,0xc9))[_0xe9df('0x42')](handleError(_0x628b74,null));};exports[_0xe9df('0x23')]=function(_0x33e277,_0x101945){if(_0x33e277[_0xe9df('0x47')]['id']){delete _0x33e277[_0xe9df('0x47')]['id'];}return db['CmCompany'][_0xe9df('0x4d')]({'where':{'id':_0x33e277[_0xe9df('0x44')]['id']}})[_0xe9df('0x25')](handleEntityNotFound(_0x101945,null))[_0xe9df('0x25')](saveUpdates(_0x33e277[_0xe9df('0x47')],null))['then'](respondWithResult(_0x101945,null))[_0xe9df('0x42')](handleError(_0x101945,null));};exports[_0xe9df('0x24')]=function(_0x40fb29,_0x232b4d){return db[_0xe9df('0x2c')][_0xe9df('0x4d')]({'where':{'id':_0x40fb29[_0xe9df('0x44')]['id']}})['then'](handleEntityNotFound(_0x232b4d,null))[_0xe9df('0x25')](removeEntity(_0x232b4d,null))[_0xe9df('0x42')](handleError(_0x232b4d,null));};exports['describe']=function(_0x54e3cc,_0x3b44ca){return db[_0xe9df('0x2c')][_0xe9df('0x2d')]()[_0xe9df('0x25')](respondWithResult(_0x3b44ca,null))[_0xe9df('0x42')](handleError(_0x3b44ca,null));};exports[_0xe9df('0x51')]=function(_0x4c772c,_0x55922b,_0x58497d){return db[_0xe9df('0x52')][_0xe9df('0x4d')]({'where':{'id':_0x4c772c[_0xe9df('0x44')]['id']}})['then'](handleEntityNotFound(_0x55922b,null))[_0xe9df('0x25')](function(_0x12b779){if(_0x12b779){return _0x12b779[_0xe9df('0x51')](_0x4c772c[_0xe9df('0x47')][_0xe9df('0x53')],_[_0xe9df('0x54')](_0x4c772c['body'],[_0xe9df('0x53'),'id'])||{});}})['then'](respondWithResult(_0x55922b,null))[_0xe9df('0x42')](handleError(_0x55922b,null));};exports['getContacts']=function(_0x584f48,_0x519b2a,_0x17c468){var _0x2c0a1b={};var _0x4fe784={};var _0x253f90;var _0x26b14d;return db[_0xe9df('0x2c')][_0xe9df('0x55')]({'where':{'id':_0x584f48['params']['id']}})['then'](handleEntityNotFound(_0x519b2a,null))['then'](function(_0x21e994){if(_0x21e994){_0x253f90=_0x21e994;_0x4fe784[_0xe9df('0x32')]=_[_0xe9df('0x2e')](db[_0xe9df('0x52')][_0xe9df('0x56')]);_0x4fe784[_0xe9df('0x2f')]=_[_0xe9df('0x2e')](_0x584f48[_0xe9df('0x2f')]);_0x4fe784[_0xe9df('0x30')]=_['intersection'](_0x4fe784[_0xe9df('0x32')],_0x4fe784[_0xe9df('0x2f')]);_0x2c0a1b[_0xe9df('0x33')]=_[_0xe9df('0x31')](_0x4fe784[_0xe9df('0x32')],qs[_0xe9df('0x34')](_0x584f48[_0xe9df('0x2f')][_0xe9df('0x34')]));_0x2c0a1b[_0xe9df('0x33')]=_0x2c0a1b['attributes'][_0xe9df('0x35')]?_0x2c0a1b[_0xe9df('0x33')]:_0x4fe784[_0xe9df('0x32')];_0x2c0a1b[_0xe9df('0x37')]=qs[_0xe9df('0x38')](_0x584f48[_0xe9df('0x2f')][_0xe9df('0x38')]);_0x2c0a1b['where']=qs['filters'](_[_0xe9df('0x3a')](_0x584f48[_0xe9df('0x2f')],_0x4fe784[_0xe9df('0x30')]));if(_0x584f48[_0xe9df('0x2f')][_0xe9df('0x3b')]){_0x2c0a1b[_0xe9df('0x39')]=_[_0xe9df('0x3c')](_0x2c0a1b[_0xe9df('0x39')],{'$or':_[_0xe9df('0x3d')](_0x2c0a1b[_0xe9df('0x33')],function(_0x552751){var _0x235edb={};_0x235edb[_0x552751]={'$like':'%'+_0x584f48[_0xe9df('0x2f')]['filter']+'%'};return _0x235edb;})});}_0x2c0a1b=_['merge']({},_0x2c0a1b,_0x584f48[_0xe9df('0x3e')]);return _0x253f90[_0xe9df('0x57')](_0x2c0a1b);}})[_0xe9df('0x25')](function(_0x1b1204){if(_0x1b1204){_0x26b14d=_0x1b1204[_0xe9df('0x35')];if(!_0x584f48['query'][_0xe9df('0x58')](_0xe9df('0x36'))){_0x2c0a1b[_0xe9df('0x1b')]=qs['limit'](_0x584f48['query'][_0xe9df('0x1b')]);_0x2c0a1b['offset']=qs['offset'](_0x584f48[_0xe9df('0x2f')][_0xe9df('0x19')]);}return _0x253f90[_0xe9df('0x57')](_0x2c0a1b);}})[_0xe9df('0x25')](function(_0x904500){if(_0x904500){return _0x904500?{'count':_0x26b14d,'rows':_0x904500}:null;}})['then'](respondWithResult(_0x519b2a,null))[_0xe9df('0x42')](handleError(_0x519b2a,null));}; \ No newline at end of file +var _0xa6b9=['filter','map','options','include','rows','catch','show','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addContacts','CmContact','omit','ids','getContacts','pick','merge','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x5a2c7b,_0x441265){var _0x3ad931=function(_0x3a3b19){while(--_0x3a3b19){_0x5a2c7b['push'](_0x5a2c7b['shift']());}};_0x3ad931(++_0x441265);}(_0xa6b9,0x75));var _0x9a6b=function(_0x23a2ac,_0x39d9d0){_0x23a2ac=_0x23a2ac-0x0;var _0x28bfb0=_0xa6b9[_0x23a2ac];return _0x28bfb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a6b('0x1'));var rp=require(_0x9a6b('0x2'));var moment=require(_0x9a6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a6b('0x4'));var util=require(_0x9a6b('0x5'));var path=require(_0x9a6b('0x6'));var sox=require(_0x9a6b('0x7'));var csv=require('to-csv');var ejs=require(_0x9a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x9a6b('0x9'));var _=require('lodash');var squel=require(_0x9a6b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a6b('0xb'));var toCsv=require(_0x9a6b('0xc'));var querystring=require(_0x9a6b('0xd'));var Papa=require(_0x9a6b('0xe'));var Redis=require(_0x9a6b('0xf'));var authService=require(_0x9a6b('0x10'));var qs=require(_0x9a6b('0x11'));var as=require(_0x9a6b('0x12'));var hardwareService=require(_0x9a6b('0x13'));var logger=require(_0x9a6b('0x14'))(_0x9a6b('0x15'));var utils=require(_0x9a6b('0x16'));var config=require(_0x9a6b('0x17'));var licenseUtil=require(_0x9a6b('0x18'));var db=require(_0x9a6b('0x19'))['db'];function respondWithStatusCode(_0xdb1b86,_0xa01b90){_0xa01b90=_0xa01b90||0xcc;return function(_0x33dea4){if(_0x33dea4){return _0xdb1b86[_0x9a6b('0x1a')](_0xa01b90);}return _0xdb1b86[_0x9a6b('0x1b')](_0xa01b90)[_0x9a6b('0x1c')]();};}function respondWithResult(_0x4fe70e,_0x566dff){_0x566dff=_0x566dff||0xc8;return function(_0x57001c){if(_0x57001c){return _0x4fe70e['status'](_0x566dff)[_0x9a6b('0x1d')](_0x57001c);}};}function respondWithFilteredResult(_0x1318de,_0x2badbc){return function(_0x3a65ab){if(_0x3a65ab){var _0xb54fbd=typeof _0x2badbc[_0x9a6b('0x1e')]===_0x9a6b('0x1f')&&typeof _0x2badbc[_0x9a6b('0x20')]===_0x9a6b('0x1f');var _0x1258b8=_0x3a65ab[_0x9a6b('0x21')];var _0x167cf2=_0xb54fbd?0x0:_0x2badbc[_0x9a6b('0x1e')];var _0x14d340=_0xb54fbd?_0x3a65ab[_0x9a6b('0x21')]:_0x2badbc[_0x9a6b('0x1e')]+_0x2badbc['limit'];var _0x3e25db;if(_0x14d340>=_0x1258b8){_0x14d340=_0x1258b8;_0x3e25db=0xc8;}else{_0x3e25db=0xce;}_0x1318de[_0x9a6b('0x1b')](_0x3e25db);return _0x1318de['set']('Content-Range',_0x167cf2+'-'+_0x14d340+'/'+_0x1258b8)[_0x9a6b('0x1d')](_0x3a65ab);}return null;};}function patchUpdates(_0x4ebe79){return function(_0x4aca36){try{jsonpatch[_0x9a6b('0x22')](_0x4aca36,_0x4ebe79,!![]);}catch(_0x35933a){return BPromise[_0x9a6b('0x23')](_0x35933a);}return _0x4aca36[_0x9a6b('0x24')]();};}function saveUpdates(_0x132acb,_0x1c7f84){return function(_0x498bc8){if(_0x498bc8){return _0x498bc8['update'](_0x132acb)[_0x9a6b('0x25')](function(_0x49c3ae){return _0x49c3ae;});}return null;};}function removeEntity(_0x93d18,_0xd45f86){return function(_0x5652c5){if(_0x5652c5){return _0x5652c5[_0x9a6b('0x26')]()[_0x9a6b('0x25')](function(){var _0x1ef65d=_0x5652c5[_0x9a6b('0x27')]({'plain':!![]});var _0x24a1d3=_0x9a6b('0x28');return db[_0x9a6b('0x29')]['destroy']({'where':{'type':_0x24a1d3,'resourceId':_0x1ef65d['id']}})[_0x9a6b('0x25')](function(){return _0x5652c5;});})[_0x9a6b('0x25')](function(){_0x93d18['status'](0xcc)[_0x9a6b('0x1c')]();});}};}function handleEntityNotFound(_0x4eac23,_0x327ffc){return function(_0x33fcee){if(!_0x33fcee){_0x4eac23[_0x9a6b('0x1a')](0x194);}return _0x33fcee;};}function handleError(_0x182daf,_0x3e4e4c){_0x3e4e4c=_0x3e4e4c||0x1f4;return function(_0x114042){logger['error'](_0x114042[_0x9a6b('0x2a')]);if(_0x114042[_0x9a6b('0x2b')]){delete _0x114042[_0x9a6b('0x2b')];}_0x182daf['status'](_0x3e4e4c)[_0x9a6b('0x2c')](_0x114042);};}exports[_0x9a6b('0x2d')]=function(_0x519e87,_0x86fc7d){var _0x3e6fe7={},_0x391940={},_0x290ea0={'count':0x0,'rows':[]};return db[_0x9a6b('0x2e')]['describe']()['then'](function(_0x2e9942){_0x391940[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](_0x2e9942);_0x391940[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x519e87[_0x9a6b('0x31')]);_0x391940[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x391940['model'],_0x391940[_0x9a6b('0x31')]);_0x3e6fe7[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x391940['model'],qs[_0x9a6b('0x35')](_0x519e87[_0x9a6b('0x31')]['fields']));_0x3e6fe7[_0x9a6b('0x34')]=_0x3e6fe7[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0x3e6fe7[_0x9a6b('0x34')]:_0x391940['model'];if(!_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x3e6fe7[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x3e6fe7[_0x9a6b('0x1e')]=qs['offset'](_0x519e87['query'][_0x9a6b('0x1e')]);}_0x3e6fe7['order']=qs[_0x9a6b('0x39')](_0x519e87[_0x9a6b('0x31')]['sort']);_0x3e6fe7[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_['pick'](_0x519e87[_0x9a6b('0x31')],_0x391940[_0x9a6b('0x32')]),_0x2e9942);if(_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x3e6fe7[_0x9a6b('0x3a')]=_['merge'](_0x3e6fe7[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x3e6fe7[_0x9a6b('0x34')],function(_0x554329){var _0x53034a={};_0x53034a[_0x554329]={'$like':'%'+_0x519e87[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x53034a;})});}_0x3e6fe7=_['merge']({},_0x3e6fe7,_0x519e87[_0x9a6b('0x3d')]);var _0x301b19={'where':_0x3e6fe7[_0x9a6b('0x3a')]};return db['CmCompany']['count'](_0x301b19)[_0x9a6b('0x25')](function(_0x1ed70d){_0x290ea0[_0x9a6b('0x21')]=_0x1ed70d;if(_0x519e87[_0x9a6b('0x31')]['includeAll']){_0x3e6fe7[_0x9a6b('0x3e')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x3e6fe7);})[_0x9a6b('0x25')](function(_0x1b3dc8){_0x290ea0[_0x9a6b('0x3f')]=_0x1b3dc8;return _0x290ea0;})[_0x9a6b('0x25')](respondWithFilteredResult(_0x86fc7d,_0x3e6fe7))[_0x9a6b('0x40')](handleError(_0x86fc7d,null));})[_0x9a6b('0x40')](handleError(_0x86fc7d,null));};exports[_0x9a6b('0x41')]=function(_0x4f810e,_0x5d2974){var _0xe79f8a={'raw':![],'where':{'id':_0x4f810e['params']['id']}},_0x466eb0={};_0x466eb0['model']=_[_0x9a6b('0x30')](db['CmCompany'][_0x9a6b('0x42')]);_0x466eb0[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x4f810e[_0x9a6b('0x31')]);_0x466eb0[_0x9a6b('0x32')]=_[_0x9a6b('0x33')](_0x466eb0['model'],_0x466eb0[_0x9a6b('0x31')]);_0xe79f8a['attributes']=_[_0x9a6b('0x33')](_0x466eb0['model'],qs[_0x9a6b('0x35')](_0x4f810e[_0x9a6b('0x31')]['fields']));_0xe79f8a[_0x9a6b('0x34')]=_0xe79f8a[_0x9a6b('0x34')][_0x9a6b('0x36')]?_0xe79f8a[_0x9a6b('0x34')]:_0x466eb0[_0x9a6b('0x2f')];if(_0x4f810e[_0x9a6b('0x31')][_0x9a6b('0x43')]){_0xe79f8a[_0x9a6b('0x3e')]=[{'all':!![]}];}_0xe79f8a=_['merge']({},_0xe79f8a,_0x4f810e[_0x9a6b('0x3d')]);return db[_0x9a6b('0x2e')][_0x9a6b('0x44')](_0xe79f8a)[_0x9a6b('0x25')](handleEntityNotFound(_0x5d2974,null))[_0x9a6b('0x25')](respondWithResult(_0x5d2974,null))[_0x9a6b('0x40')](handleError(_0x5d2974,null));};exports['create']=function(_0x5f5bba,_0x48b54e){return db[_0x9a6b('0x2e')][_0x9a6b('0x45')](_0x5f5bba['body'],{})[_0x9a6b('0x25')](function(_0x25f162){var _0x3f918d=_0x5f5bba[_0x9a6b('0x46')]['get']({'plain':!![]});if(!_0x3f918d)throw new Error(_0x9a6b('0x47'));if(_0x3f918d[_0x9a6b('0x48')]===_0x9a6b('0x46')){var _0x1390c2=_0x25f162[_0x9a6b('0x27')]({'plain':!![]});var _0x2d6d21=_0x9a6b('0x28');return db[_0x9a6b('0x49')][_0x9a6b('0x44')]({'where':{'name':_0x2d6d21,'userProfileId':_0x3f918d['userProfileId']},'raw':!![]})[_0x9a6b('0x25')](function(_0x5e1381){if(_0x5e1381&&_0x5e1381[_0x9a6b('0x4a')]===0x0){return db[_0x9a6b('0x29')][_0x9a6b('0x45')]({'name':_0x1390c2[_0x9a6b('0x2b')],'resourceId':_0x1390c2['id'],'type':_0x5e1381[_0x9a6b('0x2b')],'sectionId':_0x5e1381['id']},{})['then'](function(){return _0x25f162;});}else{return _0x25f162;}})[_0x9a6b('0x40')](function(_0x2882af){logger[_0x9a6b('0x4b')](_0x9a6b('0x4c'),_0x2882af);throw _0x2882af;});}return _0x25f162;})['then'](respondWithResult(_0x48b54e,0xc9))[_0x9a6b('0x40')](handleError(_0x48b54e,null));};exports[_0x9a6b('0x4d')]=function(_0x812e4d,_0x59f3e5){if(_0x812e4d[_0x9a6b('0x4e')]['id']){delete _0x812e4d[_0x9a6b('0x4e')]['id'];}return db[_0x9a6b('0x2e')][_0x9a6b('0x44')]({'where':{'id':_0x812e4d['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x59f3e5,null))['then'](saveUpdates(_0x812e4d[_0x9a6b('0x4e')],null))['then'](respondWithResult(_0x59f3e5,null))['catch'](handleError(_0x59f3e5,null));};exports[_0x9a6b('0x26')]=function(_0x8166be,_0x56c4f4){return db['CmCompany']['find']({'where':{'id':_0x8166be[_0x9a6b('0x4f')]['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x56c4f4,null))[_0x9a6b('0x25')](removeEntity(_0x56c4f4,null))[_0x9a6b('0x40')](handleError(_0x56c4f4,null));};exports['describe']=function(_0x5ae31d,_0x4ca200){return db[_0x9a6b('0x2e')][_0x9a6b('0x50')]()[_0x9a6b('0x25')](respondWithResult(_0x4ca200,null))[_0x9a6b('0x40')](handleError(_0x4ca200,null));};exports[_0x9a6b('0x51')]=function(_0x276373,_0x3f7d3b,_0x133daf){return db[_0x9a6b('0x52')][_0x9a6b('0x44')]({'where':{'id':_0x276373[_0x9a6b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f7d3b,null))[_0x9a6b('0x25')](function(_0x1dc44c){if(_0x1dc44c){return _0x1dc44c[_0x9a6b('0x51')](_0x276373['body']['ids'],_[_0x9a6b('0x53')](_0x276373[_0x9a6b('0x4e')],[_0x9a6b('0x54'),'id'])||{});}})[_0x9a6b('0x25')](respondWithResult(_0x3f7d3b,null))['catch'](handleError(_0x3f7d3b,null));};exports[_0x9a6b('0x55')]=function(_0x409253,_0x54b6ba,_0x5dfdc9){var _0x42ba25={};var _0x420732={};var _0x3572d0;var _0xd447bb;return db[_0x9a6b('0x2e')]['findOne']({'where':{'id':_0x409253['params']['id']}})[_0x9a6b('0x25')](handleEntityNotFound(_0x54b6ba,null))['then'](function(_0x57c5e4){if(_0x57c5e4){_0x3572d0=_0x57c5e4;_0x420732[_0x9a6b('0x2f')]=_[_0x9a6b('0x30')](db[_0x9a6b('0x52')][_0x9a6b('0x42')]);_0x420732[_0x9a6b('0x31')]=_[_0x9a6b('0x30')](_0x409253[_0x9a6b('0x31')]);_0x420732['filters']=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],_0x420732[_0x9a6b('0x31')]);_0x42ba25[_0x9a6b('0x34')]=_[_0x9a6b('0x33')](_0x420732[_0x9a6b('0x2f')],qs[_0x9a6b('0x35')](_0x409253[_0x9a6b('0x31')]['fields']));_0x42ba25[_0x9a6b('0x34')]=_0x42ba25['attributes']['length']?_0x42ba25[_0x9a6b('0x34')]:_0x420732[_0x9a6b('0x2f')];_0x42ba25['order']=qs[_0x9a6b('0x39')](_0x409253[_0x9a6b('0x31')]['sort']);_0x42ba25[_0x9a6b('0x3a')]=qs[_0x9a6b('0x32')](_[_0x9a6b('0x56')](_0x409253[_0x9a6b('0x31')],_0x420732[_0x9a6b('0x32')]));if(_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]){_0x42ba25[_0x9a6b('0x3a')]=_[_0x9a6b('0x57')](_0x42ba25[_0x9a6b('0x3a')],{'$or':_[_0x9a6b('0x3c')](_0x42ba25['attributes'],function(_0xe2efb){var _0x29ee00={};_0x29ee00[_0xe2efb]={'$like':'%'+_0x409253[_0x9a6b('0x31')][_0x9a6b('0x3b')]+'%'};return _0x29ee00;})});}_0x42ba25=_[_0x9a6b('0x57')]({},_0x42ba25,_0x409253[_0x9a6b('0x3d')]);return _0x3572d0['getContacts'](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x47471e){if(_0x47471e){_0xd447bb=_0x47471e['length'];if(!_0x409253[_0x9a6b('0x31')][_0x9a6b('0x37')](_0x9a6b('0x38'))){_0x42ba25[_0x9a6b('0x20')]=qs[_0x9a6b('0x20')](_0x409253[_0x9a6b('0x31')][_0x9a6b('0x20')]);_0x42ba25['offset']=qs[_0x9a6b('0x1e')](_0x409253[_0x9a6b('0x31')]['offset']);}return _0x3572d0[_0x9a6b('0x55')](_0x42ba25);}})[_0x9a6b('0x25')](function(_0x13758a){if(_0x13758a){return _0x13758a?{'count':_0xd447bb,'rows':_0x13758a}:null;}})['then'](respondWithResult(_0x54b6ba,null))[_0x9a6b('0x40')](handleError(_0x54b6ba,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index e646219..207ec88 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 _0xa947=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','util'];(function(_0x544bca,_0x1f3106){var _0xb9f6b0=function(_0x2d0de9){while(--_0x2d0de9){_0x544bca['push'](_0x544bca['shift']());}};_0xb9f6b0(++_0x1f3106);}(_0xa947,0x1cd));var _0x7a94=function(_0x1470f7,_0x3df412){_0x1470f7=_0x1470f7-0x0;var _0x5473b3=_0xa947[_0x1470f7];return _0x5473b3;};'use strict';var _=require('lodash');var util=require(_0x7a94('0x0'));var logger=require(_0x7a94('0x1'))(_0x7a94('0x2'));var moment=require(_0x7a94('0x3'));var BPromise=require(_0x7a94('0x4'));var rp=require(_0x7a94('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7a94('0x6'));var attributes=require(_0x7a94('0x7'));module[_0x7a94('0x8')]=function(_0x3faa11,_0x370f4e){return _0x3faa11[_0x7a94('0x9')]('CmCompany',attributes,{'tableName':_0x7a94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4edd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api'];(function(_0x3a450c,_0x9dced0){var _0x23a746=function(_0x34ac8a){while(--_0x34ac8a){_0x3a450c['push'](_0x3a450c['shift']());}};_0x23a746(++_0x9dced0);}(_0x4edd,0x193));var _0xd4ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4edd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4ed('0x0'));var util=require(_0xd4ed('0x1'));var logger=require('../../config/logger')(_0xd4ed('0x2'));var moment=require(_0xd4ed('0x3'));var BPromise=require(_0xd4ed('0x4'));var rp=require(_0xd4ed('0x5'));var fs=require('fs');var path=require(_0xd4ed('0x6'));var rimraf=require(_0xd4ed('0x7'));var config=require(_0xd4ed('0x8'));var attributes=require(_0xd4ed('0x9'));module[_0xd4ed('0xa')]=function(_0x56bc60,_0x27495c){return _0x56bc60[_0xd4ed('0xb')](_0xd4ed('0xc'),attributes,{'tableName':_0xd4ed('0xd'),'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 43dd8ad..ceba313 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 _0x2d50=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2d50,0x127));var _0x02d5=function(_0x4f1e5e,_0x37c2a0){_0x4f1e5e=_0x4f1e5e-0x0;var _0x354ea1=_0x2d50[_0x4f1e5e];return _0x354ea1;};'use strict';var _=require('lodash');var util=require(_0x02d5('0x0'));var moment=require(_0x02d5('0x1'));var BPromise=require(_0x02d5('0x2'));var rs=require(_0x02d5('0x3'));var fs=require('fs');var Redis=require(_0x02d5('0x4'));var db=require(_0x02d5('0x5'))['db'];var utils=require(_0x02d5('0x6'));var logger=require(_0x02d5('0x7'))(_0x02d5('0x8'));var config=require('../../config/environment');var jayson=require(_0x02d5('0x9'));var client=jayson[_0x02d5('0xa')][_0x02d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b619f,_0x5c331d,_0xdb25ce){return new BPromise(function(_0x48bf27,_0x119b1f){return client[_0x02d5('0xc')](_0x2b619f,_0xdb25ce)[_0x02d5('0xd')](function(_0x6a52b5){logger[_0x02d5('0xe')](_0x02d5('0xf'),_0x5c331d,_0x02d5('0x10'));logger[_0x02d5('0x11')](_0x02d5('0x12'),_0x5c331d,'request\x20sent',JSON['stringify'](_0x6a52b5));if(_0x6a52b5[_0x02d5('0x13')]){if(_0x6a52b5[_0x02d5('0x13')][_0x02d5('0x14')]===0x1f4){logger[_0x02d5('0x13')]('CmCompany,\x20%s,\x20%s',_0x5c331d,_0x6a52b5[_0x02d5('0x13')][_0x02d5('0x15')]);return _0x119b1f(_0x6a52b5[_0x02d5('0x13')]['message']);}logger[_0x02d5('0x13')]('CmCompany,\x20%s,\x20%s',_0x5c331d,_0x6a52b5[_0x02d5('0x13')][_0x02d5('0x15')]);return _0x48bf27(_0x6a52b5['error']['message']);}else{logger['info'](_0x02d5('0xf'),_0x5c331d,_0x02d5('0x10'));_0x48bf27(_0x6a52b5[_0x02d5('0x16')][_0x02d5('0x15')]);}})['catch'](function(_0x3dc495){logger[_0x02d5('0x13')](_0x02d5('0xf'),_0x5c331d,_0x3dc495);_0x119b1f(_0x3dc495);});});} \ No newline at end of file +var _0xafe5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','lodash'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xafe5,0x15f));var _0x5afe=function(_0x1c63b2,_0x44eb5b){_0x1c63b2=_0x1c63b2-0x0;var _0x3fa7b8=_0xafe5[_0x1c63b2];return _0x3fa7b8;};'use strict';var _=require(_0x5afe('0x0'));var util=require(_0x5afe('0x1'));var moment=require(_0x5afe('0x2'));var BPromise=require('bluebird');var rs=require(_0x5afe('0x3'));var fs=require('fs');var Redis=require(_0x5afe('0x4'));var db=require(_0x5afe('0x5'))['db'];var utils=require(_0x5afe('0x6'));var logger=require(_0x5afe('0x7'))('rpc');var config=require(_0x5afe('0x8'));var jayson=require(_0x5afe('0x9'));var client=jayson[_0x5afe('0xa')][_0x5afe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbaf35a,_0x18b10c,_0x597ad4){return new BPromise(function(_0x358b1f,_0xa7246){return client[_0x5afe('0xc')](_0xbaf35a,_0x597ad4)['then'](function(_0x723804){logger[_0x5afe('0xd')]('CmCompany,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'));logger[_0x5afe('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x18b10c,_0x5afe('0xe'),JSON[_0x5afe('0x10')](_0x723804));if(_0x723804[_0x5afe('0x11')]){if(_0x723804[_0x5afe('0x11')][_0x5afe('0x12')]===0x1f4){logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804['error']['message']);return _0xa7246(_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);}logger['error'](_0x5afe('0x13'),_0x18b10c,_0x723804[_0x5afe('0x11')][_0x5afe('0x14')]);return _0x358b1f(_0x723804[_0x5afe('0x11')]['message']);}else{logger[_0x5afe('0xd')](_0x5afe('0x13'),_0x18b10c,_0x5afe('0xe'));_0x358b1f(_0x723804[_0x5afe('0x15')][_0x5afe('0x14')]);}})['catch'](function(_0x516978){logger[_0x5afe('0x11')](_0x5afe('0x13'),_0x18b10c,_0x516978);_0xa7246(_0x516978);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 98ca966..6cb6424 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 _0xf9ab=['get','isAuthenticated','index','/describe','/:id','show','getContacts','post','/:id/contacts','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0xd9ab80,_0x1f1968){var _0x559fc7=function(_0x46504f){while(--_0x46504f){_0xd9ab80['push'](_0xd9ab80['shift']());}};_0x559fc7(++_0x1f1968);}(_0xf9ab,0x167));var _0xbf9a=function(_0x5ad04e,_0x1ab9ce){_0x5ad04e=_0x5ad04e-0x0;var _0x527186=_0xf9ab[_0x5ad04e];return _0x527186;};'use strict';var multer=require(_0xbf9a('0x0'));var util=require(_0xbf9a('0x1'));var path=require(_0xbf9a('0x2'));var timeout=require(_0xbf9a('0x3'));var express=require(_0xbf9a('0x4'));var router=express['Router']();var fs_extra=require(_0xbf9a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf9a('0x6'));var config=require(_0xbf9a('0x7'));var controller=require(_0xbf9a('0x8'));router[_0xbf9a('0x9')]('/',auth[_0xbf9a('0xa')](),controller[_0xbf9a('0xb')]);router[_0xbf9a('0x9')](_0xbf9a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xbf9a('0x9')](_0xbf9a('0xd'),auth['isAuthenticated'](),controller[_0xbf9a('0xe')]);router[_0xbf9a('0x9')]('/:id/contacts',auth[_0xbf9a('0xa')](),controller[_0xbf9a('0xf')]);router[_0xbf9a('0x10')]('/',auth[_0xbf9a('0xa')](),controller['create']);router[_0xbf9a('0x10')](_0xbf9a('0x11'),auth[_0xbf9a('0xa')](),controller[_0xbf9a('0x12')]);router[_0xbf9a('0x13')](_0xbf9a('0xd'),auth[_0xbf9a('0xa')](),controller['update']);router[_0xbf9a('0x14')](_0xbf9a('0xd'),auth['isAuthenticated'](),controller[_0xbf9a('0x15')]);module[_0xbf9a('0x16')]=router; \ No newline at end of file +var _0x63a9=['get','index','/describe','isAuthenticated','/:id','/:id/contacts','getContacts','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x1823a0,_0x38947d){var _0x2b780c=function(_0x39d289){while(--_0x39d289){_0x1823a0['push'](_0x1823a0['shift']());}};_0x2b780c(++_0x38947d);}(_0x63a9,0x14f));var _0x963a=function(_0x5649c3,_0x111ee5){_0x5649c3=_0x5649c3-0x0;var _0x4006aa=_0x63a9[_0x5649c3];return _0x4006aa;};'use strict';var multer=require(_0x963a('0x0'));var util=require('util');var path=require(_0x963a('0x1'));var timeout=require(_0x963a('0x2'));var express=require(_0x963a('0x3'));var router=express[_0x963a('0x4')]();var fs_extra=require(_0x963a('0x5'));var auth=require(_0x963a('0x6'));var interaction=require(_0x963a('0x7'));var config=require(_0x963a('0x8'));var controller=require(_0x963a('0x9'));router[_0x963a('0xa')]('/',auth['isAuthenticated'](),controller[_0x963a('0xb')]);router['get'](_0x963a('0xc'),auth[_0x963a('0xd')](),controller['describe']);router['get'](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['show']);router[_0x963a('0xa')](_0x963a('0xf'),auth['isAuthenticated'](),controller[_0x963a('0x10')]);router[_0x963a('0x11')]('/',auth[_0x963a('0xd')](),controller[_0x963a('0x12')]);router[_0x963a('0x11')]('/:id/contacts',auth[_0x963a('0xd')](),controller['addContacts']);router[_0x963a('0x13')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller['update']);router[_0x963a('0x14')](_0x963a('0xe'),auth[_0x963a('0xd')](),controller[_0x963a('0x15')]);module[_0x963a('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4179afe..b90de5b 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 _0x6a09=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x3d616d,_0x461b27){var _0x92042d=function(_0x4bcacb){while(--_0x4bcacb){_0x3d616d['push'](_0x3d616d['shift']());}};_0x92042d(++_0x461b27);}(_0x6a09,0x14a));var _0x96a0=function(_0x5db1ce,_0x57ab66){_0x5db1ce=_0x5db1ce-0x0;var _0xb62cbb=_0x6a09[_0x5db1ce];return _0xb62cbb;};'use strict';var _=require(_0x96a0('0x0'));var Sequelize=require(_0x96a0('0x1'));module[_0x96a0('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x96a0('0x3')]},'postalCode':{'type':Sequelize[_0x96a0('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x96a0('0x3')]},'dateOfBirth':{'type':Sequelize[_0x96a0('0x3')]},'description':{'type':Sequelize[_0x96a0('0x4')]},'phone':{'type':Sequelize[_0x96a0('0x3')]},'mobile':{'type':Sequelize[_0x96a0('0x3')]},'fax':{'type':Sequelize[_0x96a0('0x3')]},'email':{'type':Sequelize[_0x96a0('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x96a0('0x3')]},'fb_data':{'type':Sequelize[_0x96a0('0x3')]},'twitter':{'type':Sequelize[_0x96a0('0x3')]},'skype':{'type':Sequelize[_0x96a0('0x3')]},'teams':{'type':Sequelize[_0x96a0('0x3')]},'viber':{'type':Sequelize[_0x96a0('0x3')]},'line':{'type':Sequelize[_0x96a0('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x96a0('0x3')]},'UserId':{'type':Sequelize[_0x96a0('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x96a0('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x96a0('0x6')],'defaultValue':Sequelize[_0x96a0('0x7')]},'dialTimezone':{'type':Sequelize[_0x96a0('0x3')]},'utcOffset':{'type':Sequelize[_0x96a0('0x5')]}}; \ No newline at end of file +var _0xc43e=['INTEGER','sequelize','STRING','TEXT','UNSIGNED','DATE','NOW'];(function(_0x143bb3,_0x3b1ff9){var _0x358977=function(_0x12743d){while(--_0x12743d){_0x143bb3['push'](_0x143bb3['shift']());}};_0x358977(++_0x3b1ff9);}(_0xc43e,0x13c));var _0xec43=function(_0xdfdcec,_0x5e4bc5){_0xdfdcec=_0xdfdcec-0x0;var _0x4dfb91=_0xc43e[_0xdfdcec];return _0x4dfb91;};'use strict';var _=require('lodash');var Sequelize=require(_0xec43('0x0'));module['exports']={'firstName':{'type':Sequelize[_0xec43('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xec43('0x1')]},'street':{'type':Sequelize[_0xec43('0x1')]},'postalCode':{'type':Sequelize[_0xec43('0x1')]},'city':{'type':Sequelize[_0xec43('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xec43('0x1')]},'description':{'type':Sequelize[_0xec43('0x2')]},'phone':{'type':Sequelize[_0xec43('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xec43('0x1')]},'email':{'type':Sequelize[_0xec43('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xec43('0x1')]},'fb_data':{'type':Sequelize[_0xec43('0x1')]},'twitter':{'type':Sequelize[_0xec43('0x1')]},'skype':{'type':Sequelize[_0xec43('0x1')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xec43('0x1')]},'telegram':{'type':Sequelize[_0xec43('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xec43('0x1')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xec43('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xec43('0x4')],'defaultValue':Sequelize[_0xec43('0x5')]},'dialTimezone':{'type':Sequelize[_0xec43('0x1')]},'utcOffset':{'type':Sequelize[_0xec43('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 443ee26..e6c4b68 100644 --- a/server/api/cmContact/cmContact.controller.js +++ b/server/api/cmContact/cmContact.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 0b9883d..697f449 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 _0x61b1=['../../mysqldb','CmContact','save','update','emit','hasOwnProperty','hook','events'];(function(_0x2a5b28,_0x22bbdc){var _0x5be01f=function(_0x3ece9b){while(--_0x3ece9b){_0x2a5b28['push'](_0x2a5b28['shift']());}};_0x5be01f(++_0x22bbdc);}(_0x61b1,0x18f));var _0x161b=function(_0x3203ed,_0x3a60eb){_0x3203ed=_0x3203ed-0x0;var _0x19c17a=_0x61b1[_0x3203ed];return _0x19c17a;};'use strict';var EventEmitter=require(_0x161b('0x0'));var CmContact=require(_0x161b('0x1'))['db'][_0x161b('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x161b('0x3'),'afterUpdate':_0x161b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1499bf){return function(_0x31cf51,_0x43078c,_0x287b57){CmContactEvents['emit'](_0x1499bf+':'+_0x31cf51['id'],_0x31cf51);CmContactEvents[_0x161b('0x5')](_0x1499bf,_0x31cf51);_0x287b57(null);};}for(var e in events){if(events[_0x161b('0x6')](e)){var event=events[e];CmContact[_0x161b('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0xb243=['CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x399b76,_0x796fe7){var _0x51d0e6=function(_0x5d31e5){while(--_0x5d31e5){_0x399b76['push'](_0x399b76['shift']());}};_0x51d0e6(++_0x796fe7);}(_0xb243,0x1b6));var _0x3b24=function(_0x31fd29,_0x2586ea){_0x31fd29=_0x31fd29-0x0;var _0x3a3aef=_0xb243[_0x31fd29];return _0x3a3aef;};'use strict';var EventEmitter=require(_0x3b24('0x0'));var CmContact=require(_0x3b24('0x1'))['db'][_0x3b24('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3b24('0x3')](0x0);var events={'afterCreate':_0x3b24('0x4'),'afterUpdate':_0x3b24('0x5'),'afterDestroy':_0x3b24('0x6')};function emitEvent(_0x4dd9c6){return function(_0x264757,_0x1e40cb,_0x3c1ced){CmContactEvents[_0x3b24('0x7')](_0x4dd9c6+':'+_0x264757['id'],_0x264757);CmContactEvents[_0x3b24('0x7')](_0x4dd9c6,_0x264757);_0x3c1ced(null);};}for(var e in events){if(events[_0x3b24('0x8')](e)){var event=events[e];CmContact[_0x3b24('0x9')](e,emitEvent(event));}}module[_0x3b24('0xa')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 22a8d33..07a144c 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 _0x3d35=['../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','isNil','add','then','ret','CmHopper','cmContact,\x20afterCreate\x20','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','inspect','Campaign','timezones','utcOffset','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','create','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','CmList','length','dialCheckDuplicateType','onlyIfOpen','outbound','CmHopperBlack','Lists','always','BlackLists','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x59f72f,_0x18bbaf){var _0x169d0d=function(_0x42ec4d){while(--_0x42ec4d){_0x59f72f['push'](_0x59f72f['shift']());}};_0x169d0d(++_0x18bbaf);}(_0x3d35,0x121));var _0x53d3=function(_0x521e8d,_0x23a290){_0x521e8d=_0x521e8d-0x0;var _0x518bbd=_0x3d35[_0x521e8d];return _0x518bbd;};'use strict';var _=require(_0x53d3('0x0'));var util=require('util');var logger=require(_0x53d3('0x1'))(_0x53d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53d3('0x3'));var fs=require('fs');var path=require(_0x53d3('0x4'));var rimraf=require(_0x53d3('0x5'));var config=require(_0x53d3('0x6'));var shared=require(_0x53d3('0x7'));var attributes=require(_0x53d3('0x8'));module[_0x53d3('0x9')]=function(_0x523ee9,_0x1dc8a1){return _0x523ee9[_0x53d3('0xa')](_0x53d3('0xb'),attributes,{'tableName':_0x53d3('0xc'),'paranoid':!![],'indexes':[{'name':_0x53d3('0xd'),'fields':['phone']},{'name':_0x53d3('0xe'),'fields':['firstName',_0x53d3('0xf'),_0x53d3('0xd'),_0x53d3('0x10'),_0x53d3('0x11'),_0x53d3('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x53d3('0x13'),'collate':_0x53d3('0x14'),'hooks':{'afterCreate':function(_0x467b53,_0x2435c9,_0x3698bf){var _0x206ab1=_0x523ee9['models'];var _0x5588d8=_0x467b53[_0x53d3('0x15')]({'plain':!![]});function _0x4828ed(){return function(_0x56f92d){logger[_0x53d3('0x16')](_0x53d3('0x17'),_0x53d3('0x18'),util['inspect'](_0x56f92d,{'showHidden':![],'depth':null}));};}function _0x452ecf(_0x5d243f,_0x208e7c){var _0x36f51b=_0x208e7c[_0x53d3('0x19')]?_0x208e7c[_0x53d3('0x19')]:moment()[_0x53d3('0x1a')](_0x53d3('0x1b'));return new BPromise(function(_0x5eb6a3,_0xc0b399){if(_['isNil'](_0x208e7c[_0x53d3('0x1c')])){_0x5eb6a3({'ret':_0x36f51b});}else{_0x206ab1[_0x53d3('0x1d')]['findOne']({'where':{'id':_0x5d243f['id']}})['then'](function(_0x10ec67){if(!_['isNil'](_0x10ec67)){var _0x49dfe7=_0x10ec67['dialTimezone'];if(!_[_0x53d3('0x1e')](_0x49dfe7)){var _0x3b7693=shared['timezones'];var _0x6b6aff=_0x3b7693[_0x49dfe7];var _0x36bb62=_0x3b7693[_0x208e7c[_0x53d3('0x1c')]];if(!_[_0x53d3('0x1e')](_0x6b6aff)&&!_[_0x53d3('0x1e')](_0x36bb62)){var _0x2cb332=_0x6b6aff['utcOffset']-_0x36bb62['utcOffset'];_0x36f51b=_0x208e7c[_0x53d3('0x19')]?_0x208e7c[_0x53d3('0x19')]:moment();var _0x5567ad=moment(_0x36f51b)[_0x53d3('0x1f')](_0x2cb332,'minutes');_0x5eb6a3({'ret':_0x5567ad['format'](_0x53d3('0x1b'))});}else _0x5eb6a3({'ret':_0x36f51b});}else _0x5eb6a3({'ret':_0x36f51b});}else{_0x5eb6a3({'ret':_0x36f51b});}});}});return 0xa;}var _0x33b17e=function(_0x4e2430){return new BPromise(function(_0x55e7eb,_0x3fb388){_0x452ecf(_0x4e2430,_0x5588d8)[_0x53d3('0x20')](function(_0x6e434d){_0x5588d8[_0x53d3('0x19')]=_0x6e434d[_0x53d3('0x21')];_0x206ab1[_0x53d3('0x22')]['findOne']({'where':{'phone':_0x5588d8[_0x53d3('0xd')],'VoiceQueueId':_0x4e2430['id']}})[_0x53d3('0x20')](function(_0x437811){if(!_[_0x53d3('0x1e')](_0x437811)){throw new Error(_0x53d3('0x23')+_0x5588d8[_0x53d3('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4e2430['id']);}return _0x206ab1[_0x53d3('0x22')]['create']({'phone':_0x5588d8['phone'],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'priority':_0x5588d8[_0x53d3('0x25')]?_0x5588d8[_0x53d3('0x25')]:0x2,'scheduledat':_0x5588d8[_0x53d3('0x19')]?_0x5588d8[_0x53d3('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x5588d8[_0x53d3('0x26')]?!![]:![],'callbackuniqueid':_0x5588d8[_0x53d3('0x26')]?_0x5588d8['callbackUniqueid']:undefined,'callbackat':_0x5588d8[_0x53d3('0x26')]?moment()[_0x53d3('0x1a')](_0x53d3('0x1b')):undefined,'VoiceQueueId':_0x4e2430['id']});})[_0x53d3('0x27')](function(_0x4c8e27){_0x3fb388(_0x4c8e27);});});});};var _0x25abc6=function(_0x551bfe){return new BPromise(function(_0x3e9887,_0x411242){_0x452ecf(_0x551bfe,_0x5588d8)[_0x53d3('0x20')](function(_0x1abcad){_0x5588d8[_0x53d3('0x19')]=_0x1abcad[_0x53d3('0x21')];_0x206ab1[_0x53d3('0x22')][_0x53d3('0x28')]({'where':{'phone':_0x5588d8[_0x53d3('0xd')],'VoiceQueueId':_0x551bfe['id']}})['then'](function(_0x9500dc){if(!_[_0x53d3('0x1e')](_0x9500dc)){throw new Error(_0x53d3('0x23')+_0x5588d8['phone']+_0x53d3('0x29')+_0x551bfe['id']);}return _0x206ab1['CmHopperFinal'][_0x53d3('0x28')]({'where':{'calleridnum':_0x5588d8[_0x53d3('0xd')],'VoiceQueueId':_0x551bfe['id']}});})[_0x53d3('0x20')](function(_0x45609c){if(!_['isNil'](_0x45609c)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5588d8[_0x53d3('0xd')]+_0x53d3('0x2a')+_0x551bfe['id']);}return _0x206ab1[_0x53d3('0x22')]['create']({'phone':_0x5588d8['phone'],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'priority':_0x5588d8[_0x53d3('0x25')]?_0x5588d8['priority']:0x2,'scheduledat':_0x5588d8[_0x53d3('0x19')]?_0x5588d8[_0x53d3('0x19')]:moment()['format'](_0x53d3('0x1b')),'callback':_0x5588d8['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5588d8[_0x53d3('0x26')]?_0x5588d8['callbackUniqueid']:undefined,'callbackat':_0x5588d8[_0x53d3('0x26')]?moment()[_0x53d3('0x1a')](_0x53d3('0x1b')):undefined,'VoiceQueueId':_0x551bfe['id']});})['catch'](function(_0x357845){_0x411242(_0x357845);});});});};function _0x3d9999(){return function(_0x1b5f2a){logger[_0x53d3('0x16')](_0x53d3('0x17'),_0x53d3('0x18'),util[_0x53d3('0x2b')](_0x1b5f2a,{'showHidden':![],'depth':null}));};}function _0x2634b7(_0xc4ae88,_0x8eea51){var _0x305570=_0x8eea51[_0x53d3('0x19')]?_0x8eea51[_0x53d3('0x19')]:moment()[_0x53d3('0x1a')](_0x53d3('0x1b'));return new BPromise(function(_0x200db9,_0x3044fa){if(_['isNil'](_0x8eea51[_0x53d3('0x1c')])){_0x200db9({'ret':_0x305570});}else{_0x206ab1[_0x53d3('0x2c')][_0x53d3('0x28')]({'where':{'id':_0xc4ae88['id']}})[_0x53d3('0x20')](function(_0x43d375){if(!_['isNil'](_0x43d375)){var _0x44e198=_0x43d375[_0x53d3('0x1c')];if(!_[_0x53d3('0x1e')](_0x44e198)){var _0x12f444=shared[_0x53d3('0x2d')];var _0x5175e4=_0x12f444[_0x44e198];var _0x3d8433=_0x12f444[_0x8eea51[_0x53d3('0x1c')]];if(!_['isNil'](_0x5175e4)&&!_['isNil'](_0x3d8433)){var _0x34f17d=_0x5175e4[_0x53d3('0x2e')]-_0x3d8433[_0x53d3('0x2e')];_0x305570=_0x8eea51[_0x53d3('0x19')]?_0x8eea51[_0x53d3('0x19')]:moment();var _0x5160d9=moment(_0x305570)[_0x53d3('0x1f')](_0x34f17d,_0x53d3('0x2f'));_0x200db9({'ret':_0x5160d9[_0x53d3('0x1a')](_0x53d3('0x1b'))});}else _0x200db9({'ret':_0x305570});}else _0x200db9({'ret':_0x305570});}else{_0x200db9({'ret':_0x305570});}});}});return 0xa;}var _0x38cdbf=function(_0x473f08){return new BPromise(function(_0x366c67,_0x297e77){_0x2634b7(_0x473f08,_0x5588d8)[_0x53d3('0x20')](function(_0x585345){_0x5588d8['scheduledat']=_0x585345[_0x53d3('0x21')];_0x206ab1[_0x53d3('0x22')]['findOne']({'where':{'phone':_0x5588d8['phone'],'CampaignId':_0x473f08['id']}})[_0x53d3('0x20')](function(_0x4c871b){if(!_['isNil'](_0x4c871b)){throw new Error(_0x53d3('0x23')+_0x5588d8['phone']+_0x53d3('0x30')+_0x473f08['id']);}return _0x206ab1[_0x53d3('0x22')][_0x53d3('0x31')]({'phone':_0x5588d8['phone'],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'priority':_0x5588d8[_0x53d3('0x25')]?_0x5588d8[_0x53d3('0x25')]:0x2,'scheduledat':_0x5588d8[_0x53d3('0x19')]?_0x5588d8[_0x53d3('0x19')]:moment()[_0x53d3('0x1a')](_0x53d3('0x1b')),'callback':_0x5588d8['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5588d8[_0x53d3('0x26')]?_0x5588d8[_0x53d3('0x26')]:undefined,'callbackat':_0x5588d8[_0x53d3('0x26')]?moment()[_0x53d3('0x1a')](_0x53d3('0x1b')):undefined,'CampaignId':_0x473f08['id']});})[_0x53d3('0x27')](function(_0x21cacb){_0x297e77(_0x21cacb);});});});};var _0x2847bb=function(_0x320adc){return new BPromise(function(_0x33c68d,_0x7502b5){_0x2634b7(_0x320adc,_0x5588d8)[_0x53d3('0x20')](function(_0x1483e6){_0x5588d8[_0x53d3('0x19')]=_0x1483e6[_0x53d3('0x21')];_0x206ab1[_0x53d3('0x22')]['findOne']({'where':{'phone':_0x5588d8[_0x53d3('0xd')],'CampaignId':_0x320adc['id']}})[_0x53d3('0x20')](function(_0x181f8a){if(!_[_0x53d3('0x1e')](_0x181f8a)){throw new Error(_0x53d3('0x23')+_0x5588d8[_0x53d3('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x320adc['id']);}return _0x206ab1['CmHopperFinal'][_0x53d3('0x28')]({'where':{'calleridnum':_0x5588d8[_0x53d3('0xd')],'CampaignId':_0x320adc['id']}});})[_0x53d3('0x20')](function(_0x2aa4ca){if(!_['isNil'](_0x2aa4ca)){throw new Error(_0x53d3('0x32')+_0x5588d8[_0x53d3('0xd')]+_0x53d3('0x33')+_0x320adc['id']);}return _0x206ab1[_0x53d3('0x22')][_0x53d3('0x31')]({'phone':_0x5588d8[_0x53d3('0xd')],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'priority':_0x5588d8[_0x53d3('0x25')]?_0x5588d8['priority']:0x2,'scheduledat':_0x5588d8['scheduledat']?_0x5588d8[_0x53d3('0x19')]:moment()[_0x53d3('0x1a')](_0x53d3('0x1b')),'callback':_0x5588d8['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5588d8[_0x53d3('0x26')]?_0x5588d8[_0x53d3('0x26')]:undefined,'callbackat':_0x5588d8[_0x53d3('0x26')]?moment()[_0x53d3('0x1a')](_0x53d3('0x1b')):undefined,'CampaignId':_0x320adc['id']});})['catch'](function(_0x4d15a5){_0x7502b5(_0x4d15a5);});});});};if(_0x5588d8[_0x53d3('0x24')]){_0x206ab1[_0x53d3('0x1d')][_0x53d3('0x34')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType',_0x53d3('0x1c')],'include':[{'model':_0x206ab1[_0x53d3('0x35')],'as':'Lists','where':{'id':_0x5588d8[_0x53d3('0x24')]}}]})[_0x53d3('0x20')](function(_0x4282b7){if(_0x4282b7){var _0x4abeed=[];for(var _0x4fa85f=0x0,_0x1a195a;_0x4fa85f<_0x4282b7[_0x53d3('0x36')];_0x4fa85f+=0x1){_0x1a195a=_0x4282b7[_0x4fa85f][_0x53d3('0x15')]({'plain':!![]});switch(_0x1a195a[_0x53d3('0x37')]){case'always':_0x25abc6(_0x1a195a)[_0x53d3('0x27')](_0x4828ed());break;case _0x53d3('0x38'):_0x33b17e(_0x1a195a)['catch'](_0x4828ed());break;default:_0x2634b7(_0x1a195a,_0x5588d8)[_0x53d3('0x20')](function(_0x90dde8){_0x5588d8[_0x53d3('0x19')]=_0x90dde8[_0x53d3('0x21')];_0x206ab1[_0x53d3('0x22')][_0x53d3('0x31')]({'phone':_0x5588d8[_0x53d3('0xd')],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'scheduledat':_0x5588d8[_0x53d3('0x19')]?_0x5588d8['scheduledat']:moment()[_0x53d3('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5588d8[_0x53d3('0x25')]?_0x5588d8[_0x53d3('0x25')]:0x2,'callback':_0x5588d8['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5588d8[_0x53d3('0x26')]?_0x5588d8['callbackUniqueid']:undefined,'callbackat':_0x5588d8[_0x53d3('0x26')]?moment()['format'](_0x53d3('0x1b')):undefined,'VoiceQueueId':_0x1a195a['id']})['catch'](_0x4828ed());});}}}})[_0x53d3('0x20')](function(){return _0x206ab1[_0x53d3('0x1d')][_0x53d3('0x34')]({'where':{'type':_0x53d3('0x39')},'attributes':['id'],'include':[{'model':_0x206ab1[_0x53d3('0x35')],'as':'BlackLists','where':{'id':_0x5588d8[_0x53d3('0x24')]}}]})[_0x53d3('0x20')](function(_0x1031ea){if(_0x1031ea){var _0x51aeae=[];for(var _0x53a978=0x0,_0x5adb5d;_0x53a978<_0x1031ea[_0x53d3('0x36')];_0x53a978+=0x1){_0x5adb5d=_0x1031ea[_0x53a978]['get']({'plain':!![]});_0x206ab1[_0x53d3('0x3a')][_0x53d3('0x31')]({'phone':_0x5588d8[_0x53d3('0xd')],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'VoiceQueueId':_0x5adb5d['id']})[_0x53d3('0x27')](function(_0x5974e1){logger['error']('cmContact,\x20%s,\x20%s',_0x53d3('0x18'),_0x5974e1['message']);});}}});})[_0x53d3('0x20')](function(){return _0x206ab1[_0x53d3('0x2c')][_0x53d3('0x34')]({'attributes':['id',_0x53d3('0x37'),'dialTimezone'],'include':[{'model':_0x206ab1['CmList'],'as':_0x53d3('0x3b'),'where':{'id':_0x5588d8['ListId']}}]})[_0x53d3('0x20')](function(_0x56b30d){if(_0x56b30d){var _0x1c4a86=[];for(var _0x545aef=0x0,_0x33a7ba;_0x545aef<_0x56b30d[_0x53d3('0x36')];_0x545aef+=0x1){_0x33a7ba=_0x56b30d[_0x545aef]['get']({'plain':!![]});switch(_0x33a7ba[_0x53d3('0x37')]){case _0x53d3('0x3c'):_0x2847bb(_0x33a7ba)[_0x53d3('0x27')](_0x3d9999());break;case'onlyIfOpen':_0x38cdbf(_0x33a7ba)[_0x53d3('0x27')](_0x3d9999());break;default:_0x206ab1['CmHopper']['create']({'phone':_0x5588d8['phone'],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8['ListId'],'scheduledat':_0x5588d8[_0x53d3('0x19')]?_0x5588d8['scheduledat']:moment()[_0x53d3('0x1a')](_0x53d3('0x1b')),'priority':_0x5588d8[_0x53d3('0x25')]?_0x5588d8[_0x53d3('0x25')]:0x2,'callback':_0x5588d8[_0x53d3('0x26')]?!![]:![],'callbackuniqueid':_0x5588d8['callbackUniqueid']?_0x5588d8[_0x53d3('0x26')]:undefined,'callbackat':_0x5588d8[_0x53d3('0x26')]?moment()['format'](_0x53d3('0x1b')):undefined,'CampaignId':_0x33a7ba['id']})[_0x53d3('0x27')](_0x3d9999());}}}});})[_0x53d3('0x20')](function(){return _0x206ab1['Campaign'][_0x53d3('0x34')]({'attributes':['id'],'include':[{'model':_0x206ab1['CmList'],'as':_0x53d3('0x3d'),'where':{'id':_0x5588d8[_0x53d3('0x24')]}}]})['then'](function(_0x567a52){if(_0x567a52){var _0x3d223c=[];for(var _0x278088=0x0,_0x1f1bc0;_0x278088<_0x567a52[_0x53d3('0x36')];_0x278088+=0x1){_0x1f1bc0=_0x567a52[_0x278088][_0x53d3('0x15')]({'plain':!![]});_0x206ab1[_0x53d3('0x3a')][_0x53d3('0x31')]({'phone':_0x5588d8[_0x53d3('0xd')],'ContactId':_0x5588d8['id'],'ListId':_0x5588d8[_0x53d3('0x24')],'CampaignId':_0x1f1bc0['id']})[_0x53d3('0x27')](function(_0x17fe94){logger[_0x53d3('0x16')](_0x53d3('0x3e'),'afterCreate',_0x17fe94['message']);});}}});})[_0x53d3('0x20')](function(){_0x3698bf();})[_0x53d3('0x27')](function(_0x36422e){logger[_0x53d3('0x16')](_0x53d3('0x3e'),_0x53d3('0x18'),_0x36422e[_0x53d3('0x3f')]);_0x3698bf(_0x36422e);});}else{_0x3698bf(new Error(_0x53d3('0x40')));}},'afterDestroy':function(_0x31eeb0,_0x562d49,_0x548537){var _0x2c616a=_0x523ee9[_0x53d3('0x41')];var _0x5a1fd4=_0x31eeb0[_0x53d3('0x15')]({'plain':!![]});return _0x2c616a[_0x53d3('0x22')]['findAll']({'raw':!![],'where':{'ListId':_0x5a1fd4['ListId'],'ContactId':_0x5a1fd4['id']}})[_0x53d3('0x20')](function(_0x5a5e47){if(!_[_0x53d3('0x42')](_0x5a5e47)){var _0x1b0488=[];for(var _0x3f7794=0x0;_0x3f7794<_0x5a5e47[_0x53d3('0x36')];_0x3f7794+=0x1){var _0x1e0365=_0x2c616a[_0x53d3('0x22')][_0x53d3('0x43')]({'where':{'ListId':_0x5a5e47[_0x3f7794][_0x53d3('0x24')],'ContactId':_0x5a5e47[_0x3f7794][_0x53d3('0x44')],'VoiceQueueId':_0x5a5e47[_0x3f7794][_0x53d3('0x45')],'CampaignId':_0x5a5e47[_0x3f7794]['CampaignId']}});_0x1b0488[_0x53d3('0x46')](_0x1e0365);}return BPromise[_0x53d3('0x47')](_0x1b0488);}})[_0x53d3('0x20')](function(_0x5f5557){logger[_0x53d3('0x48')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x5f5557,{'showHidden':![],'depth':null}));_0x548537();})[_0x53d3('0x27')](function(_0x509dc9){logger[_0x53d3('0x16')](_0x53d3('0x49'),util[_0x53d3('0x2b')](_0x509dc9,{'showHidden':![],'depth':null}));_0x548537(_0x509dc9);});}}});}; \ No newline at end of file +var _0x3015=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','error','cmContact','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','CmList','always','onlyIfOpen','outbound','cmContact,\x20%s,\x20%s','message','Campaign','Lists','length','findAll','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','afterCreate','inspect','scheduledat','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','minutes','format','YYYY-MM-DD\x20HH:mm:ss','ret','CmHopper','cmContact,\x20afterCreate\x20'];(function(_0x352b44,_0x4a91a1){var _0x3e8baa=function(_0xed4bc3){while(--_0xed4bc3){_0x352b44['push'](_0x352b44['shift']());}};_0x3e8baa(++_0x4a91a1);}(_0x3015,0x69));var _0x5301=function(_0x5a1111,_0x372ebb){_0x5a1111=_0x5a1111-0x0;var _0x1e4fc9=_0x3015[_0x5a1111];return _0x1e4fc9;};'use strict';var _=require(_0x5301('0x0'));var util=require(_0x5301('0x1'));var logger=require(_0x5301('0x2'))(_0x5301('0x3'));var moment=require('moment');var BPromise=require(_0x5301('0x4'));var rp=require(_0x5301('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5301('0x6'));var config=require(_0x5301('0x7'));var shared=require(_0x5301('0x8'));var attributes=require(_0x5301('0x9'));module[_0x5301('0xa')]=function(_0x4d81b8,_0x3f7bc6){return _0x4d81b8['define'](_0x5301('0xb'),attributes,{'tableName':_0x5301('0xc'),'paranoid':!![],'indexes':[{'name':_0x5301('0xd'),'fields':['phone']},{'name':_0x5301('0xe'),'fields':[_0x5301('0xf'),_0x5301('0x10'),_0x5301('0xd'),'mobile',_0x5301('0x11'),'email'],'type':_0x5301('0x12')}],'timestamps':!![],'charset':_0x5301('0x13'),'collate':_0x5301('0x14'),'hooks':{'afterCreate':function(_0x5e0030,_0x4fb725,_0x110bbb){var _0x2df62c=_0x4d81b8[_0x5301('0x15')];var _0xbeb64b=_0x5e0030[_0x5301('0x16')]({'plain':!![]});function _0x547d76(){return function(_0x2e5d46){logger['error']('cmContact',_0x5301('0x17'),util[_0x5301('0x18')](_0x2e5d46,{'showHidden':![],'depth':null}));};}function _0x2c8fe6(_0x3f6cab,_0x433af4){var _0x1b396f=_0x433af4[_0x5301('0x19')]?_0x433af4['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2ee689,_0x1e7424){if(_[_0x5301('0x1a')](_0x433af4[_0x5301('0x1b')])){_0x2ee689({'ret':_0x1b396f});}else{_0x2df62c[_0x5301('0x1c')][_0x5301('0x1d')]({'where':{'id':_0x3f6cab['id']}})[_0x5301('0x1e')](function(_0x484d7a){if(!_[_0x5301('0x1a')](_0x484d7a)){var _0xfa2286=_0x484d7a[_0x5301('0x1b')];if(!_[_0x5301('0x1a')](_0xfa2286)){var _0x32e121=shared[_0x5301('0x1f')];var _0x2e3cf7=_0x32e121[_0xfa2286];var _0x312ed8=_0x32e121[_0x433af4[_0x5301('0x1b')]];if(!_[_0x5301('0x1a')](_0x2e3cf7)&&!_['isNil'](_0x312ed8)){var _0x15547e=_0x2e3cf7['utcOffset']-_0x312ed8[_0x5301('0x20')];_0x1b396f=_0x433af4[_0x5301('0x19')]?_0x433af4['scheduledat']:moment();var _0x56f0a3=moment(_0x1b396f)['add'](_0x15547e,_0x5301('0x21'));_0x2ee689({'ret':_0x56f0a3[_0x5301('0x22')](_0x5301('0x23'))});}else _0x2ee689({'ret':_0x1b396f});}else _0x2ee689({'ret':_0x1b396f});}else{_0x2ee689({'ret':_0x1b396f});}});}});return 0xa;}var _0x3f8219=function(_0x4cf944){return new BPromise(function(_0x2cb919,_0x441db0){_0x2c8fe6(_0x4cf944,_0xbeb64b)[_0x5301('0x1e')](function(_0x1f47ba){_0xbeb64b['scheduledat']=_0x1f47ba[_0x5301('0x24')];_0x2df62c[_0x5301('0x25')]['findOne']({'where':{'phone':_0xbeb64b[_0x5301('0xd')],'VoiceQueueId':_0x4cf944['id']}})['then'](function(_0x2a3231){if(!_[_0x5301('0x1a')](_0x2a3231)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x27')+_0x4cf944['id']);}return _0x2df62c[_0x5301('0x25')]['create']({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b['priority']:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()[_0x5301('0x22')](_0x5301('0x23')),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b[_0x5301('0x2a')]?moment()['format'](_0x5301('0x23')):undefined,'VoiceQueueId':_0x4cf944['id']});})[_0x5301('0x2b')](function(_0x574ef3){_0x441db0(_0x574ef3);});});});};var _0x32a419=function(_0x3213d3){return new BPromise(function(_0x5a202a,_0x25afd0){_0x2c8fe6(_0x3213d3,_0xbeb64b)[_0x5301('0x1e')](function(_0x4d950a){_0xbeb64b[_0x5301('0x19')]=_0x4d950a[_0x5301('0x24')];_0x2df62c[_0x5301('0x25')][_0x5301('0x1d')]({'where':{'phone':_0xbeb64b[_0x5301('0xd')],'VoiceQueueId':_0x3213d3['id']}})[_0x5301('0x1e')](function(_0xd6e8e){if(!_[_0x5301('0x1a')](_0xd6e8e)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x2c')+_0x3213d3['id']);}return _0x2df62c['CmHopperFinal'][_0x5301('0x1d')]({'where':{'calleridnum':_0xbeb64b[_0x5301('0xd')],'VoiceQueueId':_0x3213d3['id']}});})[_0x5301('0x1e')](function(_0x5d4ad3){if(!_[_0x5301('0x1a')](_0x5d4ad3)){throw new Error(_0x5301('0x2d')+_0xbeb64b['phone']+_0x5301('0x2e')+_0x3213d3['id']);}return _0x2df62c[_0x5301('0x25')][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()['format'](_0x5301('0x23')),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b['callbackUniqueid']?moment()[_0x5301('0x22')](_0x5301('0x23')):undefined,'VoiceQueueId':_0x3213d3['id']});})[_0x5301('0x2b')](function(_0x1c526c){_0x25afd0(_0x1c526c);});});});};function _0x399751(){return function(_0xb01551){logger[_0x5301('0x30')](_0x5301('0x31'),_0x5301('0x17'),util[_0x5301('0x18')](_0xb01551,{'showHidden':![],'depth':null}));};}function _0x4df74f(_0x5e7ce9,_0x1c5529){var _0x299950=_0x1c5529['scheduledat']?_0x1c5529[_0x5301('0x19')]:moment()[_0x5301('0x22')](_0x5301('0x23'));return new BPromise(function(_0x1bea1f,_0x44fde3){if(_[_0x5301('0x1a')](_0x1c5529[_0x5301('0x1b')])){_0x1bea1f({'ret':_0x299950});}else{_0x2df62c['Campaign']['findOne']({'where':{'id':_0x5e7ce9['id']}})['then'](function(_0x305a82){if(!_['isNil'](_0x305a82)){var _0x2f9d95=_0x305a82[_0x5301('0x1b')];if(!_[_0x5301('0x1a')](_0x2f9d95)){var _0x59acfb=shared[_0x5301('0x1f')];var _0x57d062=_0x59acfb[_0x2f9d95];var _0x56410c=_0x59acfb[_0x1c5529[_0x5301('0x1b')]];if(!_[_0x5301('0x1a')](_0x57d062)&&!_[_0x5301('0x1a')](_0x56410c)){var _0x3f568b=_0x57d062[_0x5301('0x20')]-_0x56410c[_0x5301('0x20')];_0x299950=_0x1c5529[_0x5301('0x19')]?_0x1c5529[_0x5301('0x19')]:moment();var _0x4aa0ff=moment(_0x299950)[_0x5301('0x32')](_0x3f568b,'minutes');_0x1bea1f({'ret':_0x4aa0ff[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1bea1f({'ret':_0x299950});}else _0x1bea1f({'ret':_0x299950});}else{_0x1bea1f({'ret':_0x299950});}});}});return 0xa;}var _0x39d0f3=function(_0x2badba){return new BPromise(function(_0x2a1b48,_0x199587){_0x4df74f(_0x2badba,_0xbeb64b)[_0x5301('0x1e')](function(_0x9a78bd){_0xbeb64b[_0x5301('0x19')]=_0x9a78bd[_0x5301('0x24')];_0x2df62c[_0x5301('0x25')][_0x5301('0x1d')]({'where':{'phone':_0xbeb64b['phone'],'CampaignId':_0x2badba['id']}})[_0x5301('0x1e')](function(_0x28bec2){if(!_[_0x5301('0x1a')](_0x28bec2)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x33')+_0x2badba['id']);}return _0x2df62c[_0x5301('0x25')][_0x5301('0x2f')]({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b['priority']:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b['scheduledat']:moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b[_0x5301('0x2a')]?moment()['format'](_0x5301('0x23')):undefined,'CampaignId':_0x2badba['id']});})[_0x5301('0x2b')](function(_0x33885c){_0x199587(_0x33885c);});});});};var _0x4516f4=function(_0x4cdf25){return new BPromise(function(_0xfa6b82,_0x49b031){_0x4df74f(_0x4cdf25,_0xbeb64b)[_0x5301('0x1e')](function(_0x1119a4){_0xbeb64b['scheduledat']=_0x1119a4['ret'];_0x2df62c[_0x5301('0x25')][_0x5301('0x1d')]({'where':{'phone':_0xbeb64b[_0x5301('0xd')],'CampaignId':_0x4cdf25['id']}})[_0x5301('0x1e')](function(_0x467cfa){if(!_[_0x5301('0x1a')](_0x467cfa)){throw new Error(_0x5301('0x26')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x34')+_0x4cdf25['id']);}return _0x2df62c['CmHopperFinal'][_0x5301('0x1d')]({'where':{'calleridnum':_0xbeb64b[_0x5301('0xd')],'CampaignId':_0x4cdf25['id']}});})[_0x5301('0x1e')](function(_0x10d4c0){if(!_[_0x5301('0x1a')](_0x10d4c0)){throw new Error(_0x5301('0x2d')+_0xbeb64b[_0x5301('0xd')]+_0x5301('0x35')+_0x4cdf25['id']);}return _0x2df62c[_0x5301('0x25')][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b['ListId'],'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b[_0x5301('0x2a')]:undefined,'callbackat':_0xbeb64b['callbackUniqueid']?moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4cdf25['id']});})[_0x5301('0x2b')](function(_0x5246ca){_0x49b031(_0x5246ca);});});});};if(_0xbeb64b['ListId']){_0x2df62c[_0x5301('0x1c')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x5301('0x36'),_0x5301('0x1b')],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':'Lists','where':{'id':_0xbeb64b['ListId']}}]})[_0x5301('0x1e')](function(_0x516ce2){if(_0x516ce2){var _0x76b815=[];for(var _0x36f54d=0x0,_0x2165de;_0x36f54d<_0x516ce2['length'];_0x36f54d+=0x1){_0x2165de=_0x516ce2[_0x36f54d][_0x5301('0x16')]({'plain':!![]});switch(_0x2165de['dialCheckDuplicateType']){case _0x5301('0x38'):_0x32a419(_0x2165de)[_0x5301('0x2b')](_0x547d76());break;case _0x5301('0x39'):_0x3f8219(_0x2165de)['catch'](_0x547d76());break;default:_0x4df74f(_0x2165de,_0xbeb64b)[_0x5301('0x1e')](function(_0x34f160){_0xbeb64b[_0x5301('0x19')]=_0x34f160[_0x5301('0x24')];_0x2df62c['CmHopper'][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b['ListId'],'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b['callbackUniqueid']?moment()[_0x5301('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2165de['id']})[_0x5301('0x2b')](_0x547d76());});}}}})[_0x5301('0x1e')](function(){return _0x2df62c[_0x5301('0x1c')]['findAll']({'where':{'type':_0x5301('0x3a')},'attributes':['id'],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':'BlackLists','where':{'id':_0xbeb64b[_0x5301('0x28')]}}]})[_0x5301('0x1e')](function(_0x10ca5d){if(_0x10ca5d){var _0x3dc9f8=[];for(var _0x1411cf=0x0,_0xe985b6;_0x1411cf<_0x10ca5d['length'];_0x1411cf+=0x1){_0xe985b6=_0x10ca5d[_0x1411cf][_0x5301('0x16')]({'plain':!![]});_0x2df62c['CmHopperBlack'][_0x5301('0x2f')]({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'VoiceQueueId':_0xe985b6['id']})[_0x5301('0x2b')](function(_0x508674){logger[_0x5301('0x30')](_0x5301('0x3b'),_0x5301('0x17'),_0x508674[_0x5301('0x3c')]);});}}});})[_0x5301('0x1e')](function(){return _0x2df62c[_0x5301('0x3d')]['findAll']({'attributes':['id',_0x5301('0x36'),_0x5301('0x1b')],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':_0x5301('0x3e'),'where':{'id':_0xbeb64b['ListId']}}]})[_0x5301('0x1e')](function(_0x446347){if(_0x446347){var _0x2ab5cc=[];for(var _0x24ae8c=0x0,_0xaefe36;_0x24ae8c<_0x446347[_0x5301('0x3f')];_0x24ae8c+=0x1){_0xaefe36=_0x446347[_0x24ae8c][_0x5301('0x16')]({'plain':!![]});switch(_0xaefe36[_0x5301('0x36')]){case _0x5301('0x38'):_0x4516f4(_0xaefe36)[_0x5301('0x2b')](_0x399751());break;case _0x5301('0x39'):_0x39d0f3(_0xaefe36)[_0x5301('0x2b')](_0x399751());break;default:_0x2df62c['CmHopper'][_0x5301('0x2f')]({'phone':_0xbeb64b[_0x5301('0xd')],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'scheduledat':_0xbeb64b[_0x5301('0x19')]?_0xbeb64b[_0x5301('0x19')]:moment()[_0x5301('0x22')](_0x5301('0x23')),'priority':_0xbeb64b[_0x5301('0x29')]?_0xbeb64b[_0x5301('0x29')]:0x2,'callback':_0xbeb64b[_0x5301('0x2a')]?!![]:![],'callbackuniqueid':_0xbeb64b[_0x5301('0x2a')]?_0xbeb64b['callbackUniqueid']:undefined,'callbackat':_0xbeb64b[_0x5301('0x2a')]?moment()[_0x5301('0x22')](_0x5301('0x23')):undefined,'CampaignId':_0xaefe36['id']})[_0x5301('0x2b')](_0x399751());}}}});})[_0x5301('0x1e')](function(){return _0x2df62c[_0x5301('0x3d')][_0x5301('0x40')]({'attributes':['id'],'include':[{'model':_0x2df62c[_0x5301('0x37')],'as':'BlackLists','where':{'id':_0xbeb64b[_0x5301('0x28')]}}]})['then'](function(_0xf28eff){if(_0xf28eff){var _0x5cb2fb=[];for(var _0x6f7302=0x0,_0x4bbc3f;_0x6f7302<_0xf28eff[_0x5301('0x3f')];_0x6f7302+=0x1){_0x4bbc3f=_0xf28eff[_0x6f7302]['get']({'plain':!![]});_0x2df62c['CmHopperBlack'][_0x5301('0x2f')]({'phone':_0xbeb64b['phone'],'ContactId':_0xbeb64b['id'],'ListId':_0xbeb64b[_0x5301('0x28')],'CampaignId':_0x4bbc3f['id']})[_0x5301('0x2b')](function(_0x309f4a){logger[_0x5301('0x30')](_0x5301('0x3b'),_0x5301('0x17'),_0x309f4a[_0x5301('0x3c')]);});}}});})[_0x5301('0x1e')](function(){_0x110bbb();})['catch'](function(_0x37d848){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x37d848[_0x5301('0x3c')]);_0x110bbb(_0x37d848);});}else{_0x110bbb(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x406dec,_0x4105b5,_0x30a19a){var _0x4cec5b=_0x4d81b8[_0x5301('0x15')];var _0x1c1dc7=_0x406dec['get']({'plain':!![]});return _0x4cec5b[_0x5301('0x25')]['findAll']({'raw':!![],'where':{'ListId':_0x1c1dc7[_0x5301('0x28')],'ContactId':_0x1c1dc7['id']}})[_0x5301('0x1e')](function(_0x1238c5){if(!_[_0x5301('0x41')](_0x1238c5)){var _0x2c8313=[];for(var _0x336e53=0x0;_0x336e53<_0x1238c5[_0x5301('0x3f')];_0x336e53+=0x1){var _0x29253f=_0x4cec5b[_0x5301('0x25')][_0x5301('0x42')]({'where':{'ListId':_0x1238c5[_0x336e53]['ListId'],'ContactId':_0x1238c5[_0x336e53][_0x5301('0x43')],'VoiceQueueId':_0x1238c5[_0x336e53][_0x5301('0x44')],'CampaignId':_0x1238c5[_0x336e53][_0x5301('0x45')]}});_0x2c8313[_0x5301('0x46')](_0x29253f);}return BPromise['all'](_0x2c8313);}})['then'](function(_0x3a23b2){logger['info'](_0x5301('0x47'),util[_0x5301('0x18')](_0x3a23b2,{'showHidden':![],'depth':null}));_0x30a19a();})['catch'](function(_0x5450a1){logger[_0x5301('0x30')]('[CmContact][afterDestroy][Error]',util[_0x5301('0x18')](_0x5450a1,{'showHidden':![],'depth':null}));_0x30a19a(_0x5450a1);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 03c1d09..a08174e 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x2a0894,_0xae8293){var _0x7978a3=function(_0x256525){while(--_0x256525){_0x2a0894['push'](_0x2a0894['shift']());}};_0x7978a3(++_0xae8293);}(_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['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 f6ce4e3..b8896d7 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 _0xc68d=['STRING','PHONE','exports','INTEGER'];(function(_0x10d44a,_0x4a421a){var _0x199e2b=function(_0x411637){while(--_0x411637){_0x10d44a['push'](_0x10d44a['shift']());}};_0x199e2b(++_0x4a421a);}(_0xc68d,0x17a));var _0xdc68=function(_0x3c7dfd,_0x30e1cb){_0x3c7dfd=_0x3c7dfd-0x0;var _0x30654e=_0xc68d[_0x3c7dfd];return _0x30654e;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'CmContactId':{'type':Sequelize[_0xdc68('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xdc68('0x2')],'defaultValue':_0xdc68('0x3')},'OrderBy':{'type':Sequelize[_0xdc68('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xdc68('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xf2cb=['INTEGER','exports','STRING'];(function(_0x20aa7d,_0x22b467){var _0x5a246a=function(_0x51ae79){while(--_0x51ae79){_0x20aa7d['push'](_0x20aa7d['shift']());}};_0x5a246a(++_0x22b467);}(_0xf2cb,0x130));var _0xbf2c=function(_0x530c3f,_0x3a59c4){_0x530c3f=_0x530c3f-0x0;var _0x24b18d=_0xf2cb[_0x530c3f];return _0x24b18d;};'use strict';var Sequelize=require('sequelize');module[_0xbf2c('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xbf2c('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xbf2c('0x1')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xbf2c('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xbf2c('0x1')],'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 1a30982..ad800e4 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 _0xa288=['key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','CmContactHasItem','rows','catch','show','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x1b2e76,_0x2fd57f){var _0x51b9af=function(_0x495908){while(--_0x495908){_0x1b2e76['push'](_0x1b2e76['shift']());}};_0x51b9af(++_0x2fd57f);}(_0xa288,0x1cc));var _0x8a28=function(_0x2eb44c,_0x3ff1ba){_0x2eb44c=_0x2eb44c-0x0;var _0x333977=_0xa288[_0x2eb44c];return _0x333977;};'use strict';var emlformat=require(_0x8a28('0x0'));var rimraf=require(_0x8a28('0x1'));var zipdir=require(_0x8a28('0x2'));var jsonpatch=require(_0x8a28('0x3'));var rp=require(_0x8a28('0x4'));var moment=require(_0x8a28('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8a28('0x6'));var path=require(_0x8a28('0x7'));var sox=require(_0x8a28('0x8'));var csv=require(_0x8a28('0x9'));var ejs=require(_0x8a28('0xa'));var fs=require('fs');var fs_extra=require(_0x8a28('0xb'));var _=require(_0x8a28('0xc'));var squel=require(_0x8a28('0xd'));var crypto=require('crypto');var jsforce=require(_0x8a28('0xe'));var deskjs=require(_0x8a28('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a28('0x10'));var Redis=require(_0x8a28('0x11'));var authService=require(_0x8a28('0x12'));var qs=require(_0x8a28('0x13'));var as=require(_0x8a28('0x14'));var hardwareService=require(_0x8a28('0x15'));var logger=require(_0x8a28('0x16'))(_0x8a28('0x17'));var utils=require('../../config/utils');var config=require(_0x8a28('0x18'));var licenseUtil=require(_0x8a28('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x198da8,_0x315980){_0x315980=_0x315980||0xcc;return function(_0x362339){if(_0x362339){return _0x198da8['sendStatus'](_0x315980);}return _0x198da8['status'](_0x315980)[_0x8a28('0x1a')]();};}function respondWithResult(_0xe9cdd7,_0x46719a){_0x46719a=_0x46719a||0xc8;return function(_0x56c3e4){if(_0x56c3e4){return _0xe9cdd7[_0x8a28('0x1b')](_0x46719a)[_0x8a28('0x1c')](_0x56c3e4);}};}function respondWithFilteredResult(_0x1e3166,_0x2359c2){return function(_0x3916e2){if(_0x3916e2){var _0x49b29e=typeof _0x2359c2['offset']===_0x8a28('0x1d')&&typeof _0x2359c2[_0x8a28('0x1e')]===_0x8a28('0x1d');var _0x18f860=_0x3916e2[_0x8a28('0x1f')];var _0x1efa96=_0x49b29e?0x0:_0x2359c2[_0x8a28('0x20')];var _0x399d36=_0x49b29e?_0x3916e2[_0x8a28('0x1f')]:_0x2359c2[_0x8a28('0x20')]+_0x2359c2[_0x8a28('0x1e')];var _0x1ef837;if(_0x399d36>=_0x18f860){_0x399d36=_0x18f860;_0x1ef837=0xc8;}else{_0x1ef837=0xce;}_0x1e3166['status'](_0x1ef837);return _0x1e3166[_0x8a28('0x21')](_0x8a28('0x22'),_0x1efa96+'-'+_0x399d36+'/'+_0x18f860)[_0x8a28('0x1c')](_0x3916e2);}return null;};}function patchUpdates(_0x2296ce){return function(_0x41bc30){try{jsonpatch[_0x8a28('0x23')](_0x41bc30,_0x2296ce,!![]);}catch(_0x4760ee){return BPromise[_0x8a28('0x24')](_0x4760ee);}return _0x41bc30['save']();};}function saveUpdates(_0x157ad6,_0x3b61d8){return function(_0x4fae3f){if(_0x4fae3f){return _0x4fae3f[_0x8a28('0x25')](_0x157ad6)[_0x8a28('0x26')](function(_0x199d1c){return _0x199d1c;});}return null;};}function removeEntity(_0x174372,_0x413925){return function(_0x415b77){if(_0x415b77){return _0x415b77[_0x8a28('0x27')]()[_0x8a28('0x26')](function(){var _0x3e3166=_0x415b77['get']({'plain':!![]});var _0x49ef49='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x49ef49,'resourceId':_0x3e3166['id']}})['then'](function(){return _0x415b77;});})['then'](function(){_0x174372['status'](0xcc)[_0x8a28('0x1a')]();});}};}function handleEntityNotFound(_0x23f16c,_0x33c7dd){return function(_0x9d804d){if(!_0x9d804d){_0x23f16c[_0x8a28('0x28')](0x194);}return _0x9d804d;};}function handleError(_0x36a193,_0x2dc4e3){_0x2dc4e3=_0x2dc4e3||0x1f4;return function(_0x474ad4){logger[_0x8a28('0x29')](_0x474ad4[_0x8a28('0x2a')]);if(_0x474ad4[_0x8a28('0x2b')]){delete _0x474ad4[_0x8a28('0x2b')];}_0x36a193['status'](_0x2dc4e3)[_0x8a28('0x2c')](_0x474ad4);};}exports[_0x8a28('0x2d')]=function(_0x27b2c3,_0x3905f7){var _0x6f22aa={},_0x2fb326={},_0x406c1d={'count':0x0,'rows':[]};var _0x4315c7=_[_0x8a28('0x2e')](db['CmContactHasItem'][_0x8a28('0x2f')],function(_0x4c7bc3){return{'name':_0x4c7bc3[_0x8a28('0x30')],'type':_0x4c7bc3[_0x8a28('0x31')][_0x8a28('0x32')]};});_0x2fb326[_0x8a28('0x33')]=_[_0x8a28('0x2e')](_0x4315c7,'name');_0x2fb326['query']=_[_0x8a28('0x34')](_0x27b2c3[_0x8a28('0x35')]);_0x2fb326['filters']=_['intersection'](_0x2fb326[_0x8a28('0x33')],_0x2fb326[_0x8a28('0x35')]);_0x6f22aa[_0x8a28('0x36')]=_[_0x8a28('0x37')](_0x2fb326[_0x8a28('0x33')],qs[_0x8a28('0x38')](_0x27b2c3['query'][_0x8a28('0x38')]));_0x6f22aa[_0x8a28('0x36')]=_0x6f22aa[_0x8a28('0x36')][_0x8a28('0x39')]?_0x6f22aa[_0x8a28('0x36')]:_0x2fb326[_0x8a28('0x33')];if(!_0x27b2c3[_0x8a28('0x35')][_0x8a28('0x3a')](_0x8a28('0x3b'))){_0x6f22aa[_0x8a28('0x1e')]=qs[_0x8a28('0x1e')](_0x27b2c3[_0x8a28('0x35')][_0x8a28('0x1e')]);_0x6f22aa[_0x8a28('0x20')]=qs[_0x8a28('0x20')](_0x27b2c3[_0x8a28('0x35')][_0x8a28('0x20')]);}_0x6f22aa[_0x8a28('0x3c')]=qs[_0x8a28('0x3d')](_0x27b2c3['query']['sort']);_0x6f22aa[_0x8a28('0x3e')]=qs['filters'](_['pick'](_0x27b2c3[_0x8a28('0x35')],_0x2fb326[_0x8a28('0x3f')]),_0x4315c7);if(_0x27b2c3[_0x8a28('0x35')]['filter']){_0x6f22aa['where']=_[_0x8a28('0x40')](_0x6f22aa[_0x8a28('0x3e')],{'$or':_[_0x8a28('0x2e')](_0x4315c7,function(_0x196af3){if(_0x196af3['type']!==_0x8a28('0x41')){var _0x3330b7={};_0x3330b7[_0x196af3[_0x8a28('0x2b')]]={'$like':'%'+_0x27b2c3[_0x8a28('0x35')][_0x8a28('0x42')]+'%'};return _0x3330b7;}})});}_0x6f22aa=_[_0x8a28('0x40')]({},_0x6f22aa,_0x27b2c3[_0x8a28('0x43')]);var _0x14c103={'where':_0x6f22aa['where']};return db[_0x8a28('0x44')][_0x8a28('0x1f')](_0x14c103)[_0x8a28('0x26')](function(_0x12595d){_0x406c1d[_0x8a28('0x1f')]=_0x12595d;if(_0x27b2c3[_0x8a28('0x35')]['includeAll']){_0x6f22aa['include']=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x6f22aa);})[_0x8a28('0x26')](function(_0x32d313){_0x406c1d[_0x8a28('0x45')]=_0x32d313;return _0x406c1d;})['then'](respondWithFilteredResult(_0x3905f7,_0x6f22aa))[_0x8a28('0x46')](handleError(_0x3905f7,null));};exports[_0x8a28('0x47')]=function(_0x58b844,_0x2c783e){var _0x45d90c={'raw':!![],'where':{'id':_0x58b844['params']['id']}},_0x1bf96f={};_0x1bf96f[_0x8a28('0x33')]=_[_0x8a28('0x34')](db[_0x8a28('0x44')][_0x8a28('0x2f')]);_0x1bf96f[_0x8a28('0x35')]=_['keys'](_0x58b844[_0x8a28('0x35')]);_0x1bf96f['filters']=_['intersection'](_0x1bf96f[_0x8a28('0x33')],_0x1bf96f['query']);_0x45d90c[_0x8a28('0x36')]=_[_0x8a28('0x37')](_0x1bf96f['model'],qs[_0x8a28('0x38')](_0x58b844['query'][_0x8a28('0x38')]));_0x45d90c[_0x8a28('0x36')]=_0x45d90c[_0x8a28('0x36')][_0x8a28('0x39')]?_0x45d90c[_0x8a28('0x36')]:_0x1bf96f[_0x8a28('0x33')];if(_0x58b844[_0x8a28('0x35')][_0x8a28('0x48')]){_0x45d90c[_0x8a28('0x49')]=[{'all':!![]}];}_0x45d90c=_[_0x8a28('0x40')]({},_0x45d90c,_0x58b844[_0x8a28('0x43')]);return db['CmContactHasItem'][_0x8a28('0x4a')](_0x45d90c)[_0x8a28('0x26')](handleEntityNotFound(_0x2c783e,null))[_0x8a28('0x26')](respondWithResult(_0x2c783e,null))[_0x8a28('0x46')](handleError(_0x2c783e,null));};exports[_0x8a28('0x4b')]=function(_0x5483c3,_0x214bf1){return db[_0x8a28('0x44')][_0x8a28('0x4b')](_0x5483c3[_0x8a28('0x4c')],{})['then'](function(_0x2d97b6){var _0x12c9f7=_0x5483c3[_0x8a28('0x4d')]['get']({'plain':!![]});if(!_0x12c9f7)throw new Error(_0x8a28('0x4e'));if(_0x12c9f7[_0x8a28('0x4f')]==='user'){var _0x2c42d7=_0x2d97b6[_0x8a28('0x50')]({'plain':!![]});var _0x2ee27a='CmContactHasItems';return db[_0x8a28('0x51')][_0x8a28('0x4a')]({'where':{'name':_0x2ee27a,'userProfileId':_0x12c9f7[_0x8a28('0x52')]},'raw':!![]})[_0x8a28('0x26')](function(_0x5dd50b){if(_0x5dd50b&&_0x5dd50b[_0x8a28('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x2c42d7[_0x8a28('0x2b')],'resourceId':_0x2c42d7['id'],'type':_0x5dd50b[_0x8a28('0x2b')],'sectionId':_0x5dd50b['id']},{})[_0x8a28('0x26')](function(){return _0x2d97b6;});}else{return _0x2d97b6;}})[_0x8a28('0x46')](function(_0x1a83c3){logger[_0x8a28('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a83c3);throw _0x1a83c3;});}return _0x2d97b6;})[_0x8a28('0x26')](respondWithResult(_0x214bf1,0xc9))[_0x8a28('0x46')](handleError(_0x214bf1,null));};exports[_0x8a28('0x25')]=function(_0x127d0b,_0x59f126){if(_0x127d0b[_0x8a28('0x4c')]['id']){delete _0x127d0b[_0x8a28('0x4c')]['id'];}return db[_0x8a28('0x44')][_0x8a28('0x4a')]({'where':{'id':_0x127d0b[_0x8a28('0x54')]['id']}})[_0x8a28('0x26')](handleEntityNotFound(_0x59f126,null))[_0x8a28('0x26')](saveUpdates(_0x127d0b['body'],null))[_0x8a28('0x26')](respondWithResult(_0x59f126,null))['catch'](handleError(_0x59f126,null));};exports[_0x8a28('0x27')]=function(_0x9a1e65,_0x5655c2){return db[_0x8a28('0x44')][_0x8a28('0x4a')]({'where':{'id':_0x9a1e65['params']['id']}})[_0x8a28('0x26')](handleEntityNotFound(_0x5655c2,null))['then'](removeEntity(_0x5655c2,null))['catch'](handleError(_0x5655c2,null));}; \ No newline at end of file +var _0x0dbb=['fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','findAll','rows','catch','show','keys','attributes','length','includeAll','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x1a04ef,_0x541e36){var _0x3b8f4c=function(_0x594dfa){while(--_0x594dfa){_0x1a04ef['push'](_0x1a04ef['shift']());}};_0x3b8f4c(++_0x541e36);}(_0x0dbb,0x181));var _0xb0db=function(_0x2fb21e,_0x2dbb82){_0x2fb21e=_0x2fb21e-0x0;var _0x22dc73=_0x0dbb[_0x2fb21e];return _0x22dc73;};'use strict';var emlformat=require(_0xb0db('0x0'));var rimraf=require(_0xb0db('0x1'));var zipdir=require(_0xb0db('0x2'));var jsonpatch=require(_0xb0db('0x3'));var rp=require(_0xb0db('0x4'));var moment=require(_0xb0db('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb0db('0x6'));var util=require(_0xb0db('0x7'));var path=require(_0xb0db('0x8'));var sox=require(_0xb0db('0x9'));var csv=require('to-csv');var ejs=require(_0xb0db('0xa'));var fs=require('fs');var fs_extra=require(_0xb0db('0xb'));var _=require(_0xb0db('0xc'));var squel=require(_0xb0db('0xd'));var crypto=require(_0xb0db('0xe'));var jsforce=require(_0xb0db('0xf'));var deskjs=require(_0xb0db('0x10'));var toCsv=require(_0xb0db('0x11'));var querystring=require('querystring');var Papa=require(_0xb0db('0x12'));var Redis=require(_0xb0db('0x13'));var authService=require(_0xb0db('0x14'));var qs=require(_0xb0db('0x15'));var as=require(_0xb0db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb0db('0x17'));var utils=require(_0xb0db('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb0db('0x19'));var db=require(_0xb0db('0x1a'))['db'];function respondWithStatusCode(_0x270745,_0x550044){_0x550044=_0x550044||0xcc;return function(_0x2a7b0c){if(_0x2a7b0c){return _0x270745[_0xb0db('0x1b')](_0x550044);}return _0x270745['status'](_0x550044)[_0xb0db('0x1c')]();};}function respondWithResult(_0x3d9d40,_0x584017){_0x584017=_0x584017||0xc8;return function(_0x11b761){if(_0x11b761){return _0x3d9d40[_0xb0db('0x1d')](_0x584017)['json'](_0x11b761);}};}function respondWithFilteredResult(_0x98d094,_0x3ff974){return function(_0x195f94){if(_0x195f94){var _0x5e12f9=typeof _0x3ff974[_0xb0db('0x1e')]===_0xb0db('0x1f')&&typeof _0x3ff974['limit']===_0xb0db('0x1f');var _0x50c723=_0x195f94['count'];var _0x1753a6=_0x5e12f9?0x0:_0x3ff974[_0xb0db('0x1e')];var _0x26dd98=_0x5e12f9?_0x195f94[_0xb0db('0x20')]:_0x3ff974['offset']+_0x3ff974[_0xb0db('0x21')];var _0x3b99f7;if(_0x26dd98>=_0x50c723){_0x26dd98=_0x50c723;_0x3b99f7=0xc8;}else{_0x3b99f7=0xce;}_0x98d094[_0xb0db('0x1d')](_0x3b99f7);return _0x98d094['set'](_0xb0db('0x22'),_0x1753a6+'-'+_0x26dd98+'/'+_0x50c723)[_0xb0db('0x23')](_0x195f94);}return null;};}function patchUpdates(_0x10dec8){return function(_0x3e138b){try{jsonpatch[_0xb0db('0x24')](_0x3e138b,_0x10dec8,!![]);}catch(_0x3692d9){return BPromise[_0xb0db('0x25')](_0x3692d9);}return _0x3e138b[_0xb0db('0x26')]();};}function saveUpdates(_0x1cab5d,_0x6a203c){return function(_0x5e691a){if(_0x5e691a){return _0x5e691a[_0xb0db('0x27')](_0x1cab5d)['then'](function(_0x10526b){return _0x10526b;});}return null;};}function removeEntity(_0x24130b,_0x3c5809){return function(_0x24eb12){if(_0x24eb12){return _0x24eb12[_0xb0db('0x28')]()[_0xb0db('0x29')](function(){var _0x3bbf55=_0x24eb12[_0xb0db('0x2a')]({'plain':!![]});var _0x8ecd69=_0xb0db('0x2b');return db[_0xb0db('0x2c')][_0xb0db('0x28')]({'where':{'type':_0x8ecd69,'resourceId':_0x3bbf55['id']}})[_0xb0db('0x29')](function(){return _0x24eb12;});})[_0xb0db('0x29')](function(){_0x24130b['status'](0xcc)[_0xb0db('0x1c')]();});}};}function handleEntityNotFound(_0x37e386,_0x57e341){return function(_0x1a3c0e){if(!_0x1a3c0e){_0x37e386['sendStatus'](0x194);}return _0x1a3c0e;};}function handleError(_0x7e93de,_0x333c05){_0x333c05=_0x333c05||0x1f4;return function(_0x5b2b2b){logger[_0xb0db('0x2d')](_0x5b2b2b[_0xb0db('0x2e')]);if(_0x5b2b2b[_0xb0db('0x2f')]){delete _0x5b2b2b[_0xb0db('0x2f')];}_0x7e93de[_0xb0db('0x1d')](_0x333c05)[_0xb0db('0x30')](_0x5b2b2b);};}exports[_0xb0db('0x31')]=function(_0x2f03cd,_0x4cf028){var _0x18db0f={},_0x16988c={},_0x33a429={'count':0x0,'rows':[]};var _0x59bf3e=_[_0xb0db('0x32')](db[_0xb0db('0x33')][_0xb0db('0x34')],function(_0x49b3ed){return{'name':_0x49b3ed[_0xb0db('0x35')],'type':_0x49b3ed[_0xb0db('0x36')][_0xb0db('0x37')]};});_0x16988c[_0xb0db('0x38')]=_[_0xb0db('0x32')](_0x59bf3e,_0xb0db('0x2f'));_0x16988c[_0xb0db('0x39')]=_['keys'](_0x2f03cd[_0xb0db('0x39')]);_0x16988c[_0xb0db('0x3a')]=_['intersection'](_0x16988c[_0xb0db('0x38')],_0x16988c['query']);_0x18db0f['attributes']=_[_0xb0db('0x3b')](_0x16988c[_0xb0db('0x38')],qs[_0xb0db('0x3c')](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x3c')]));_0x18db0f['attributes']=_0x18db0f['attributes']['length']?_0x18db0f['attributes']:_0x16988c[_0xb0db('0x38')];if(!_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x3d')]('nolimit')){_0x18db0f['limit']=qs['limit'](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x21')]);_0x18db0f['offset']=qs[_0xb0db('0x1e')](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x1e')]);}_0x18db0f[_0xb0db('0x3e')]=qs[_0xb0db('0x3f')](_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x3f')]);_0x18db0f['where']=qs[_0xb0db('0x3a')](_[_0xb0db('0x40')](_0x2f03cd[_0xb0db('0x39')],_0x16988c[_0xb0db('0x3a')]),_0x59bf3e);if(_0x2f03cd[_0xb0db('0x39')]['filter']){_0x18db0f['where']=_[_0xb0db('0x41')](_0x18db0f[_0xb0db('0x42')],{'$or':_['map'](_0x59bf3e,function(_0x19fc96){if(_0x19fc96[_0xb0db('0x36')]!==_0xb0db('0x43')){var _0x5d1a69={};_0x5d1a69[_0x19fc96[_0xb0db('0x2f')]]={'$like':'%'+_0x2f03cd[_0xb0db('0x39')][_0xb0db('0x44')]+'%'};return _0x5d1a69;}})});}_0x18db0f=_[_0xb0db('0x41')]({},_0x18db0f,_0x2f03cd['options']);var _0x469092={'where':_0x18db0f[_0xb0db('0x42')]};return db[_0xb0db('0x33')][_0xb0db('0x20')](_0x469092)[_0xb0db('0x29')](function(_0x1dc647){_0x33a429['count']=_0x1dc647;if(_0x2f03cd[_0xb0db('0x39')]['includeAll']){_0x18db0f['include']=[{'all':!![]}];}return db[_0xb0db('0x33')][_0xb0db('0x45')](_0x18db0f);})[_0xb0db('0x29')](function(_0x19d34c){_0x33a429[_0xb0db('0x46')]=_0x19d34c;return _0x33a429;})[_0xb0db('0x29')](respondWithFilteredResult(_0x4cf028,_0x18db0f))[_0xb0db('0x47')](handleError(_0x4cf028,null));};exports[_0xb0db('0x48')]=function(_0x360f2b,_0x113cfe){var _0xc2947d={'raw':!![],'where':{'id':_0x360f2b['params']['id']}},_0x47baba={};_0x47baba[_0xb0db('0x38')]=_[_0xb0db('0x49')](db[_0xb0db('0x33')]['rawAttributes']);_0x47baba['query']=_[_0xb0db('0x49')](_0x360f2b['query']);_0x47baba[_0xb0db('0x3a')]=_['intersection'](_0x47baba[_0xb0db('0x38')],_0x47baba[_0xb0db('0x39')]);_0xc2947d[_0xb0db('0x4a')]=_['intersection'](_0x47baba[_0xb0db('0x38')],qs['fields'](_0x360f2b[_0xb0db('0x39')][_0xb0db('0x3c')]));_0xc2947d[_0xb0db('0x4a')]=_0xc2947d[_0xb0db('0x4a')][_0xb0db('0x4b')]?_0xc2947d[_0xb0db('0x4a')]:_0x47baba[_0xb0db('0x38')];if(_0x360f2b['query'][_0xb0db('0x4c')]){_0xc2947d[_0xb0db('0x4d')]=[{'all':!![]}];}_0xc2947d=_[_0xb0db('0x41')]({},_0xc2947d,_0x360f2b[_0xb0db('0x4e')]);return db[_0xb0db('0x33')]['find'](_0xc2947d)[_0xb0db('0x29')](handleEntityNotFound(_0x113cfe,null))[_0xb0db('0x29')](respondWithResult(_0x113cfe,null))[_0xb0db('0x47')](handleError(_0x113cfe,null));};exports[_0xb0db('0x4f')]=function(_0xa2f68,_0x2e459b){return db[_0xb0db('0x33')]['create'](_0xa2f68['body'],{})['then'](function(_0xc08328){var _0x4892da=_0xa2f68[_0xb0db('0x50')][_0xb0db('0x2a')]({'plain':!![]});if(!_0x4892da)throw new Error(_0xb0db('0x51'));if(_0x4892da[_0xb0db('0x52')]===_0xb0db('0x50')){var _0x1810e0=_0xc08328['get']({'plain':!![]});var _0x442a36='CmContactHasItems';return db[_0xb0db('0x53')][_0xb0db('0x54')]({'where':{'name':_0x442a36,'userProfileId':_0x4892da[_0xb0db('0x55')]},'raw':!![]})[_0xb0db('0x29')](function(_0x2a09d3){if(_0x2a09d3&&_0x2a09d3[_0xb0db('0x56')]===0x0){return db[_0xb0db('0x2c')][_0xb0db('0x4f')]({'name':_0x1810e0[_0xb0db('0x2f')],'resourceId':_0x1810e0['id'],'type':_0x2a09d3['name'],'sectionId':_0x2a09d3['id']},{})[_0xb0db('0x29')](function(){return _0xc08328;});}else{return _0xc08328;}})['catch'](function(_0x2c4db5){logger[_0xb0db('0x2d')](_0xb0db('0x57'),_0x2c4db5);throw _0x2c4db5;});}return _0xc08328;})[_0xb0db('0x29')](respondWithResult(_0x2e459b,0xc9))[_0xb0db('0x47')](handleError(_0x2e459b,null));};exports[_0xb0db('0x27')]=function(_0x4d09ba,_0x1b0ea9){if(_0x4d09ba['body']['id']){delete _0x4d09ba[_0xb0db('0x58')]['id'];}return db[_0xb0db('0x33')][_0xb0db('0x54')]({'where':{'id':_0x4d09ba['params']['id']}})[_0xb0db('0x29')](handleEntityNotFound(_0x1b0ea9,null))[_0xb0db('0x29')](saveUpdates(_0x4d09ba[_0xb0db('0x58')],null))[_0xb0db('0x29')](respondWithResult(_0x1b0ea9,null))[_0xb0db('0x47')](handleError(_0x1b0ea9,null));};exports[_0xb0db('0x28')]=function(_0x21314d,_0xb5f5f3){return db[_0xb0db('0x33')][_0xb0db('0x54')]({'where':{'id':_0x21314d['params']['id']}})[_0xb0db('0x29')](handleEntityNotFound(_0xb5f5f3,null))[_0xb0db('0x29')](removeEntity(_0xb5f5f3,null))[_0xb0db('0x47')](handleError(_0xb5f5f3,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 04980fd..923fe54 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 _0x0440=['request-promise','../../config/environment','define','cm_contact_has_items','lodash','util','../../config/logger','api','moment'];(function(_0x8a912d,_0x53c52b){var _0x4fb44b=function(_0xb62428){while(--_0xb62428){_0x8a912d['push'](_0x8a912d['shift']());}};_0x4fb44b(++_0x53c52b);}(_0x0440,0x1ea));var _0x0044=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x0440[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require(_0x0044('0x0'));var util=require(_0x0044('0x1'));var logger=require(_0x0044('0x2'))(_0x0044('0x3'));var moment=require(_0x0044('0x4'));var BPromise=require('bluebird');var rp=require(_0x0044('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0044('0x6'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x32a1da,_0x3a2016){return _0x32a1da[_0x0044('0x7')]('CmContactHasItem',attributes,{'tableName':_0x0044('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdee6=['define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x5c1da5,_0x37188e){var _0x211e5e=function(_0xa41035){while(--_0xa41035){_0x5c1da5['push'](_0x5c1da5['shift']());}};_0x211e5e(++_0x37188e);}(_0xdee6,0x9f));var _0x6dee=function(_0x354e7e,_0x56aa43){_0x354e7e=_0x354e7e-0x0;var _0x3514d8=_0xdee6[_0x354e7e];return _0x3514d8;};'use strict';var _=require(_0x6dee('0x0'));var util=require(_0x6dee('0x1'));var logger=require(_0x6dee('0x2'))('api');var moment=require(_0x6dee('0x3'));var BPromise=require(_0x6dee('0x4'));var rp=require(_0x6dee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dee('0x6'));var config=require(_0x6dee('0x7'));var attributes=require(_0x6dee('0x8'));module['exports']=function(_0x11c51b,_0x5aed7b){return _0x11c51b[_0x6dee('0x9')](_0x6dee('0xa'),attributes,{'tableName':_0x6dee('0xb'),'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 c4ac44e..b1c99f4 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 _0xac34=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','bluebird'];(function(_0x5c3f98,_0x5ea7cd){var _0x5c9582=function(_0x30ee71){while(--_0x30ee71){_0x5c3f98['push'](_0x5c3f98['shift']());}};_0x5c9582(++_0x5ea7cd);}(_0xac34,0x1ae));var _0x4ac3=function(_0x5a9b11,_0x438d1e){_0x5a9b11=_0x5a9b11-0x0;var _0x524afa=_0xac34[_0x5a9b11];return _0x524afa;};'use strict';var _=require('lodash');var util=require(_0x4ac3('0x0'));var moment=require('moment');var BPromise=require(_0x4ac3('0x1'));var rs=require(_0x4ac3('0x2'));var fs=require('fs');var Redis=require(_0x4ac3('0x3'));var db=require(_0x4ac3('0x4'))['db'];var utils=require(_0x4ac3('0x5'));var logger=require('../../config/logger')(_0x4ac3('0x6'));var config=require(_0x4ac3('0x7'));var jayson=require(_0x4ac3('0x8'));var client=jayson[_0x4ac3('0x9')][_0x4ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ddd8f,_0x2e9669,_0x367490){return new BPromise(function(_0x34fced,_0x9483c9){return client[_0x4ac3('0xb')](_0x2ddd8f,_0x367490)[_0x4ac3('0xc')](function(_0x45760b){logger[_0x4ac3('0xd')](_0x4ac3('0xe'),_0x2e9669,_0x4ac3('0xf'));logger[_0x4ac3('0x10')](_0x4ac3('0x11'),_0x2e9669,_0x4ac3('0xf'),JSON[_0x4ac3('0x12')](_0x45760b));if(_0x45760b['error']){if(_0x45760b['error'][_0x4ac3('0x13')]===0x1f4){logger[_0x4ac3('0x14')](_0x4ac3('0xe'),_0x2e9669,_0x45760b[_0x4ac3('0x14')][_0x4ac3('0x15')]);return _0x9483c9(_0x45760b[_0x4ac3('0x14')][_0x4ac3('0x15')]);}logger[_0x4ac3('0x14')](_0x4ac3('0xe'),_0x2e9669,_0x45760b[_0x4ac3('0x14')]['message']);return _0x34fced(_0x45760b['error'][_0x4ac3('0x15')]);}else{logger[_0x4ac3('0xd')](_0x4ac3('0xe'),_0x2e9669,'request\x20sent');_0x34fced(_0x45760b[_0x4ac3('0x16')][_0x4ac3('0x15')]);}})[_0x4ac3('0x17')](function(_0xf838e2){logger['error'](_0x4ac3('0xe'),_0x2e9669,_0xf838e2);_0x9483c9(_0xf838e2);});});} \ No newline at end of file +var _0x2634=['debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x554a13,_0x449e15){var _0x3779bf=function(_0x15febc){while(--_0x15febc){_0x554a13['push'](_0x554a13['shift']());}};_0x3779bf(++_0x449e15);}(_0x2634,0x126));var _0x4263=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2634[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4263('0x0'));var util=require(_0x4263('0x1'));var moment=require(_0x4263('0x2'));var BPromise=require(_0x4263('0x3'));var rs=require(_0x4263('0x4'));var fs=require('fs');var Redis=require(_0x4263('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4263('0x6'))(_0x4263('0x7'));var config=require('../../config/environment');var jayson=require(_0x4263('0x8'));var client=jayson[_0x4263('0x9')][_0x4263('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x572830,_0x184532,_0x3c6fa7){return new BPromise(function(_0x18bb20,_0x450750){return client[_0x4263('0xb')](_0x572830,_0x3c6fa7)[_0x4263('0xc')](function(_0x151582){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x4263('0xd'));logger[_0x4263('0xe')](_0x4263('0xf'),_0x184532,'request\x20sent',JSON[_0x4263('0x10')](_0x151582));if(_0x151582['error']){if(_0x151582[_0x4263('0x11')][_0x4263('0x12')]===0x1f4){logger['error'](_0x4263('0x13'),_0x184532,_0x151582[_0x4263('0x11')]['message']);return _0x450750(_0x151582[_0x4263('0x11')][_0x4263('0x14')]);}logger[_0x4263('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x151582[_0x4263('0x11')][_0x4263('0x14')]);return _0x18bb20(_0x151582['error'][_0x4263('0x14')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x4263('0xd'));_0x18bb20(_0x151582[_0x4263('0x15')][_0x4263('0x14')]);}})['catch'](function(_0x15928e){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x184532,_0x15928e);_0x450750(_0x15928e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 40d1d8d..969ebad 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 _0x36b9=['exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','show','post','create','/:id','destroy'];(function(_0x1cd1f4,_0x3ebf19){var _0x14ef42=function(_0xf77e5){while(--_0xf77e5){_0x1cd1f4['push'](_0x1cd1f4['shift']());}};_0x14ef42(++_0x3ebf19);}(_0x36b9,0x169));var _0x936b=function(_0x4d31e7,_0x7a5504){_0x4d31e7=_0x4d31e7-0x0;var _0x483934=_0x36b9[_0x4d31e7];return _0x483934;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x936b('0x0'));var timeout=require(_0x936b('0x1'));var express=require(_0x936b('0x2'));var router=express[_0x936b('0x3')]();var fs_extra=require(_0x936b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x936b('0x5'));var controller=require(_0x936b('0x6'));router['get']('/',auth[_0x936b('0x7')](),controller[_0x936b('0x8')]);router['get']('/:id',auth[_0x936b('0x7')](),controller[_0x936b('0x9')]);router[_0x936b('0xa')]('/',auth['isAuthenticated'](),controller[_0x936b('0xb')]);router['put'](_0x936b('0xc'),auth[_0x936b('0x7')](),controller['update']);router['delete'](_0x936b('0xc'),auth['isAuthenticated'](),controller[_0x936b('0xd')]);module[_0x936b('0xe')]=router; \ No newline at end of file +var _0x139a=['../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','post','create','put','update','destroy','multer','util','path','fs-extra'];(function(_0x5953be,_0x4e6e20){var _0x4ecf96=function(_0x12d5f8){while(--_0x12d5f8){_0x5953be['push'](_0x5953be['shift']());}};_0x4ecf96(++_0x4e6e20);}(_0x139a,0x1a0));var _0xa139=function(_0x5ebdea,_0x5963dd){_0x5ebdea=_0x5ebdea-0x0;var _0x443a51=_0x139a[_0x5ebdea];return _0x443a51;};'use strict';var multer=require(_0xa139('0x0'));var util=require(_0xa139('0x1'));var path=require(_0xa139('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa139('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa139('0x4'));var config=require(_0xa139('0x5'));var controller=require(_0xa139('0x6'));router[_0xa139('0x7')]('/',auth[_0xa139('0x8')](),controller['index']);router['get'](_0xa139('0x9'),auth[_0xa139('0x8')](),controller['show']);router[_0xa139('0xa')]('/',auth[_0xa139('0x8')](),controller[_0xa139('0xb')]);router[_0xa139('0xc')](_0xa139('0x9'),auth[_0xa139('0x8')](),controller[_0xa139('0xd')]);router['delete'](_0xa139('0x9'),auth['isAuthenticated'](),controller[_0xa139('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d990f00..3703942 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 _0x442c=['STRING','TEXT','long','type','select','values','isArray','setDataValue','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','name'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x442c,0x71));var _0xc442=function(_0x25dba3,_0x57b675){_0x25dba3=_0x25dba3-0x0;var _0x3afb00=_0x442c[_0x25dba3];return _0x3afb00;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc442('0x0'));module[_0xc442('0x1')]={'name':{'type':Sequelize[_0xc442('0x2')],'get':function(_0x129b8b){return this[_0xc442('0x3')](_0xc442('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5cced5){this['setDataValue'](_0xc442('0x4'),_0x5cced5?_0x5cced5:this['getDataValue'](_0xc442('0x5')));}},'type':{'type':Sequelize[_0xc442('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xc442('0x7')](_0xc442('0x8')),'get':function(){if(this[_0xc442('0x3')](_0xc442('0x9'))===_0xc442('0xa')){return JSON['parse'](this[_0xc442('0x3')](_0xc442('0xb')));}else{return this[_0xc442('0x3')]('values');}},'set':function(_0x39cd65){if(Array[_0xc442('0xc')](_0x39cd65)){this[_0xc442('0xd')](_0xc442('0xb'),JSON['stringify'](_0x39cd65));}else{this[_0xc442('0xd')]('values',_0x39cd65);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc442('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc442('0xf')](_0xc442('0x10'))}}; \ No newline at end of file +var _0x4ba0=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','select','parse','values','isArray'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4ba0,0xe0));var _0x04ba=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x4ba0[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0x04ba('0x0'));var _=require(_0x04ba('0x1'));module[_0x04ba('0x2')]={'name':{'type':Sequelize[_0x04ba('0x3')],'get':function(_0x451ca0){return this[_0x04ba('0x4')](_0x04ba('0x5'));}},'alias':{'type':Sequelize[_0x04ba('0x6')],'allowNull':![],'set':function(_0x2b5ae1){this[_0x04ba('0x7')](_0x04ba('0x5'),_0x2b5ae1?_0x2b5ae1:this[_0x04ba('0x4')](_0x04ba('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x04ba('0x9')),'get':function(){if(this[_0x04ba('0x4')]('type')===_0x04ba('0xa')){return JSON[_0x04ba('0xb')](this[_0x04ba('0x4')](_0x04ba('0xc')));}else{return this['getDataValue'](_0x04ba('0xc'));}},'set':function(_0x8ea11){if(Array[_0x04ba('0xd')](_0x8ea11)){this[_0x04ba('0x7')]('values',JSON['stringify'](_0x8ea11));}else{this['setDataValue']('values',_0x8ea11);}}},'required':{'type':Sequelize[_0x04ba('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x04ba('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x04ba('0xf')](_0x04ba('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5cbad50..d8bf51e 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 _0x2214=['number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','create','Sequelize','text','TEXT'];(function(_0x4850e0,_0x3d754e){var _0x25d6a0=function(_0x14d625){while(--_0x14d625){_0x4850e0['push'](_0x4850e0['shift']());}};_0x25d6a0(++_0x3d754e);}(_0x2214,0x165));var _0x4221=function(_0x50e14b,_0x2f77ef){_0x50e14b=_0x50e14b-0x0;var _0x3194e8=_0x2214[_0x50e14b];return _0x3194e8;};'use strict';var emlformat=require(_0x4221('0x0'));var rimraf=require(_0x4221('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4221('0x2'));var rp=require(_0x4221('0x3'));var moment=require('moment');var BPromise=require(_0x4221('0x4'));var Mustache=require(_0x4221('0x5'));var util=require(_0x4221('0x6'));var path=require(_0x4221('0x7'));var sox=require(_0x4221('0x8'));var csv=require(_0x4221('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4221('0xa'));var _=require(_0x4221('0xb'));var squel=require(_0x4221('0xc'));var crypto=require(_0x4221('0xd'));var jsforce=require(_0x4221('0xe'));var deskjs=require(_0x4221('0xf'));var toCsv=require(_0x4221('0x9'));var querystring=require('querystring');var Papa=require(_0x4221('0x10'));var Redis=require(_0x4221('0x11'));var authService=require(_0x4221('0x12'));var qs=require(_0x4221('0x13'));var as=require(_0x4221('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4221('0x15'))('api');var utils=require(_0x4221('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4221('0x17'))['db'];function respondWithStatusCode(_0x12a772,_0x206b67){_0x206b67=_0x206b67||0xcc;return function(_0x5877d5){if(_0x5877d5){return _0x12a772[_0x4221('0x18')](_0x206b67);}return _0x12a772[_0x4221('0x19')](_0x206b67)['end']();};}function respondWithResult(_0x30f335,_0x5f8f9e){_0x5f8f9e=_0x5f8f9e||0xc8;return function(_0x2aa7b9){if(_0x2aa7b9){return _0x30f335[_0x4221('0x19')](_0x5f8f9e)[_0x4221('0x1a')](_0x2aa7b9);}};}function respondWithFilteredResult(_0x355a6f,_0x357fb6){return function(_0x10d220){if(_0x10d220){var _0x244ef0=typeof _0x357fb6[_0x4221('0x1b')]===_0x4221('0x1c')&&typeof _0x357fb6[_0x4221('0x1d')]===_0x4221('0x1c');var _0x455106=_0x10d220[_0x4221('0x1e')];var _0x144613=_0x244ef0?0x0:_0x357fb6[_0x4221('0x1b')];var _0x38e5a0=_0x244ef0?_0x10d220[_0x4221('0x1e')]:_0x357fb6[_0x4221('0x1b')]+_0x357fb6['limit'];var _0x5a5841;if(_0x38e5a0>=_0x455106){_0x38e5a0=_0x455106;_0x5a5841=0xc8;}else{_0x5a5841=0xce;}_0x355a6f[_0x4221('0x19')](_0x5a5841);return _0x355a6f[_0x4221('0x1f')](_0x4221('0x20'),_0x144613+'-'+_0x38e5a0+'/'+_0x455106)[_0x4221('0x1a')](_0x10d220);}return null;};}function patchUpdates(_0x43c165){return function(_0x1c9348){try{jsonpatch['apply'](_0x1c9348,_0x43c165,!![]);}catch(_0x15eaec){return BPromise[_0x4221('0x21')](_0x15eaec);}return _0x1c9348[_0x4221('0x22')]();};}function saveUpdates(_0x1ddce1,_0x2a00ed){return function(_0x21f703){if(_0x21f703){return _0x21f703[_0x4221('0x23')](_0x1ddce1)[_0x4221('0x24')](function(_0x355bb3){return _0x355bb3;});}return null;};}function removeEntity(_0x1f9bcd,_0x10bea9){return function(_0x19ed2d){if(_0x19ed2d){return _0x19ed2d[_0x4221('0x25')]()[_0x4221('0x24')](function(){_0x1f9bcd[_0x4221('0x19')](0xcc)[_0x4221('0x26')]();});}};}function handleEntityNotFound(_0x430d35,_0x1eab5b){return function(_0x3ca949){if(!_0x3ca949){_0x430d35[_0x4221('0x18')](0x194);}return _0x3ca949;};}function handleError(_0x217999,_0x5999b4){_0x5999b4=_0x5999b4||0x1f4;return function(_0x5d7b5f){logger['error'](_0x5d7b5f[_0x4221('0x27')]);if(_0x5d7b5f[_0x4221('0x28')]){delete _0x5d7b5f[_0x4221('0x28')];}_0x217999[_0x4221('0x19')](_0x5999b4)['send'](_0x5d7b5f);};}exports[_0x4221('0x29')]=function(_0x1f8ec3,_0x111065){var _0x37a419={},_0xa48aa8={},_0x5e25fe={'count':0x0,'rows':[]};var _0x1e9c98=_[_0x4221('0x2a')](db[_0x4221('0x2b')][_0x4221('0x2c')],function(_0x5a1a63){return{'name':_0x5a1a63[_0x4221('0x2d')],'type':_0x5a1a63[_0x4221('0x2e')][_0x4221('0x2f')]};});_0xa48aa8[_0x4221('0x30')]=_[_0x4221('0x31')](_[_0x4221('0x2a')](_0x1e9c98,_0x4221('0x28')),[_0x4221('0x28')]);_0xa48aa8['query']=_['keys'](_0x1f8ec3[_0x4221('0x32')]);_0xa48aa8['filters']=_['intersection'](_0xa48aa8[_0x4221('0x30')],_0xa48aa8['query']);_0x37a419[_0x4221('0x33')]=_[_0x4221('0x34')](_0xa48aa8[_0x4221('0x30')],qs['fields'](_0x1f8ec3[_0x4221('0x32')][_0x4221('0x35')]));_0x37a419['attributes']=_0x37a419['attributes']['length']?_0x37a419[_0x4221('0x33')]:_0xa48aa8[_0x4221('0x30')];if(!_0x1f8ec3[_0x4221('0x32')][_0x4221('0x36')](_0x4221('0x37'))){_0x37a419[_0x4221('0x1d')]=qs[_0x4221('0x1d')](_0x1f8ec3[_0x4221('0x32')][_0x4221('0x1d')]);_0x37a419[_0x4221('0x1b')]=qs['offset'](_0x1f8ec3[_0x4221('0x32')][_0x4221('0x1b')]);}_0x37a419['order']=qs[_0x4221('0x38')](_0x1f8ec3[_0x4221('0x32')][_0x4221('0x38')]);_0x37a419[_0x4221('0x39')]=qs[_0x4221('0x3a')](_[_0x4221('0x3b')](_0x1f8ec3[_0x4221('0x32')],_0xa48aa8['filters']),_0x1e9c98);if(_0x1f8ec3[_0x4221('0x32')][_0x4221('0x3c')]){_0x37a419[_0x4221('0x39')]=_[_0x4221('0x3d')](_0x37a419['where'],{'$or':_[_0x4221('0x2a')](_0x1e9c98,function(_0x1c7470){if(_0x1c7470['type']!==_0x4221('0x3e')){var _0xe575ff={};_0xe575ff[_0x1c7470['name']]={'$like':'%'+_0x1f8ec3['query']['filter']+'%'};return _0xe575ff;}})});}_0x37a419=_['merge']({},_0x37a419,_0x1f8ec3['options']);var _0x218605={'where':_0x37a419[_0x4221('0x39')]};return db[_0x4221('0x2b')][_0x4221('0x1e')](_0x218605)[_0x4221('0x24')](function(_0x584f21){_0x5e25fe[_0x4221('0x1e')]=_0x584f21;if(_0x1f8ec3['query'][_0x4221('0x3f')]){_0x37a419[_0x4221('0x40')]=[{'all':!![]}];}return db[_0x4221('0x2b')][_0x4221('0x41')](_0x37a419);})['then'](function(_0x36dc7e){_0x5e25fe[_0x4221('0x42')]=_0x36dc7e;return _0x5e25fe;})[_0x4221('0x24')](respondWithFilteredResult(_0x111065,_0x37a419))[_0x4221('0x43')](handleError(_0x111065,null));};exports[_0x4221('0x44')]=function(_0x5ebf2f,_0x3384b8){var _0x268b56={'raw':!![],'where':{'id':_0x5ebf2f['params']['id']}},_0xe421b8={};_0xe421b8[_0x4221('0x30')]=_['keys'](db[_0x4221('0x2b')][_0x4221('0x2c')]);_0xe421b8[_0x4221('0x32')]=_[_0x4221('0x45')](_0x5ebf2f[_0x4221('0x32')]);_0xe421b8[_0x4221('0x3a')]=_[_0x4221('0x34')](_0xe421b8[_0x4221('0x30')],_0xe421b8[_0x4221('0x32')]);_0x268b56['attributes']=_[_0x4221('0x34')](_0xe421b8[_0x4221('0x30')],qs[_0x4221('0x35')](_0x5ebf2f[_0x4221('0x32')]['fields']));_0x268b56[_0x4221('0x33')]=_0x268b56[_0x4221('0x33')][_0x4221('0x46')]?_0x268b56[_0x4221('0x33')]:_0xe421b8[_0x4221('0x30')];if(_0x5ebf2f['query']['includeAll']){_0x268b56[_0x4221('0x40')]=[{'all':!![]}];}_0x268b56=_['merge']({},_0x268b56,_0x5ebf2f['options']);return db[_0x4221('0x2b')][_0x4221('0x47')](_0x268b56)[_0x4221('0x24')](handleEntityNotFound(_0x3384b8,null))['then'](respondWithResult(_0x3384b8,null))[_0x4221('0x43')](handleError(_0x3384b8,null));};exports[_0x4221('0x23')]=function(_0x5804ea,_0x1fcdc3){if(_0x5804ea[_0x4221('0x48')]['id']){delete _0x5804ea[_0x4221('0x48')]['id'];}return db[_0x4221('0x2b')][_0x4221('0x47')]({'where':{'id':_0x5804ea[_0x4221('0x49')]['id']}})[_0x4221('0x24')](handleEntityNotFound(_0x1fcdc3,null))[_0x4221('0x24')](saveUpdates(_0x5804ea['body'],null))[_0x4221('0x24')](respondWithResult(_0x1fcdc3,null))[_0x4221('0x43')](handleError(_0x1fcdc3,null));};exports[_0x4221('0x25')]=function(_0x20681d,_0x2b65eb){return db[_0x4221('0x2b')]['find']({'where':{'id':_0x20681d['params']['id']}})[_0x4221('0x24')](handleEntityNotFound(_0x2b65eb,null))[_0x4221('0x24')](removeEntity(_0x2b65eb,null))[_0x4221('0x43')](handleError(_0x2b65eb,null));};exports['create']=function(_0xdd849d,_0xa14ad4){var _0x1e9a48;return db['sequelize']['transaction'](function(_0x47cc55){return db[_0x4221('0x2b')][_0x4221('0x4a')](_0xdd849d[_0x4221('0x48')],{'transaction':_0x47cc55})['then'](function(_0xb505d6){_0x1e9a48=_0xb505d6;var _0x1c9728={'type':db[_0x4221('0x4b')]['TEXT'],'transaction':_0x47cc55};switch(_0xdd849d['body']['type']){case _0x4221('0x4c'):_0x1c9728['type']=db['Sequelize'][_0x4221('0x4d')];break;case _0x4221('0x4e'):_0x1c9728['type']=db['Sequelize'][_0x4221('0x4f')];break;case _0x4221('0x50'):_0x1c9728[_0x4221('0x2e')]=db[_0x4221('0x4b')][_0x4221('0x51')];_0x1c9728[_0x4221('0x52')]=![];break;default:}return db[_0x4221('0x53')][_0x4221('0x54')][_0x4221('0x55')](_0x4221('0x56'),util['format']('cf_%d',_0x1e9a48['id']),_0x1c9728);})[_0x4221('0x24')](function(){return _0x1e9a48;});})[_0x4221('0x24')](respondWithResult(_0xa14ad4,0xc9))[_0x4221('0x43')](handleError(_0xa14ad4,null));}; \ No newline at end of file +var _0xd7da=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','CmCustomField','rawAttributes','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','params','sequelize','transaction','create','Sequelize','TEXT','number','switch','defaultValue','cm_contacts','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4ac187,_0x4e1f34){var _0x27ce01=function(_0x21d9ff){while(--_0x21d9ff){_0x4ac187['push'](_0x4ac187['shift']());}};_0x27ce01(++_0x4e1f34);}(_0xd7da,0xec));var _0xad7d=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0xd7da[_0x37a0ab];return _0x13ca1d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xad7d('0x0'));var jsonpatch=require(_0xad7d('0x1'));var rp=require(_0xad7d('0x2'));var moment=require(_0xad7d('0x3'));var BPromise=require(_0xad7d('0x4'));var Mustache=require(_0xad7d('0x5'));var util=require(_0xad7d('0x6'));var path=require(_0xad7d('0x7'));var sox=require('sox');var csv=require(_0xad7d('0x8'));var ejs=require(_0xad7d('0x9'));var fs=require('fs');var fs_extra=require(_0xad7d('0xa'));var _=require(_0xad7d('0xb'));var squel=require('squel');var crypto=require(_0xad7d('0xc'));var jsforce=require(_0xad7d('0xd'));var deskjs=require(_0xad7d('0xe'));var toCsv=require(_0xad7d('0x8'));var querystring=require('querystring');var Papa=require(_0xad7d('0xf'));var Redis=require(_0xad7d('0x10'));var authService=require(_0xad7d('0x11'));var qs=require(_0xad7d('0x12'));var as=require(_0xad7d('0x13'));var hardwareService=require(_0xad7d('0x14'));var logger=require(_0xad7d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xad7d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xad7d('0x17'))['db'];function respondWithStatusCode(_0x2091cb,_0x404a99){_0x404a99=_0x404a99||0xcc;return function(_0x37c581){if(_0x37c581){return _0x2091cb[_0xad7d('0x18')](_0x404a99);}return _0x2091cb[_0xad7d('0x19')](_0x404a99)[_0xad7d('0x1a')]();};}function respondWithResult(_0x1239a5,_0x123bfd){_0x123bfd=_0x123bfd||0xc8;return function(_0xf4ad94){if(_0xf4ad94){return _0x1239a5[_0xad7d('0x19')](_0x123bfd)[_0xad7d('0x1b')](_0xf4ad94);}};}function respondWithFilteredResult(_0x4884a9,_0x2ca2cf){return function(_0x432aa4){if(_0x432aa4){var _0x12e295=typeof _0x2ca2cf[_0xad7d('0x1c')]===_0xad7d('0x1d')&&typeof _0x2ca2cf[_0xad7d('0x1e')]===_0xad7d('0x1d');var _0x46b5e5=_0x432aa4[_0xad7d('0x1f')];var _0x19972b=_0x12e295?0x0:_0x2ca2cf[_0xad7d('0x1c')];var _0x383117=_0x12e295?_0x432aa4[_0xad7d('0x1f')]:_0x2ca2cf[_0xad7d('0x1c')]+_0x2ca2cf['limit'];var _0x3a8046;if(_0x383117>=_0x46b5e5){_0x383117=_0x46b5e5;_0x3a8046=0xc8;}else{_0x3a8046=0xce;}_0x4884a9[_0xad7d('0x19')](_0x3a8046);return _0x4884a9[_0xad7d('0x20')](_0xad7d('0x21'),_0x19972b+'-'+_0x383117+'/'+_0x46b5e5)['json'](_0x432aa4);}return null;};}function patchUpdates(_0x5a77fb){return function(_0x58f79c){try{jsonpatch['apply'](_0x58f79c,_0x5a77fb,!![]);}catch(_0x2981e4){return BPromise[_0xad7d('0x22')](_0x2981e4);}return _0x58f79c[_0xad7d('0x23')]();};}function saveUpdates(_0x194bd8,_0x42b353){return function(_0x2a2d6f){if(_0x2a2d6f){return _0x2a2d6f['update'](_0x194bd8)[_0xad7d('0x24')](function(_0x5707ce){return _0x5707ce;});}return null;};}function removeEntity(_0x2794cd,_0x5872ab){return function(_0x268b00){if(_0x268b00){return _0x268b00[_0xad7d('0x25')]()[_0xad7d('0x24')](function(){_0x2794cd[_0xad7d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2577b3,_0x5c6c77){return function(_0x5bdae8){if(!_0x5bdae8){_0x2577b3[_0xad7d('0x18')](0x194);}return _0x5bdae8;};}function handleError(_0x2cda55,_0x125cbc){_0x125cbc=_0x125cbc||0x1f4;return function(_0x36a8c7){logger['error'](_0x36a8c7[_0xad7d('0x26')]);if(_0x36a8c7['name']){delete _0x36a8c7[_0xad7d('0x27')];}_0x2cda55[_0xad7d('0x19')](_0x125cbc)['send'](_0x36a8c7);};}exports['index']=function(_0x5df38e,_0x4a88e4){var _0xaf0fcb={},_0x5b5ae6={},_0x879cc4={'count':0x0,'rows':[]};var _0x5250d9=_['map'](db[_0xad7d('0x28')][_0xad7d('0x29')],function(_0x18ed4a){return{'name':_0x18ed4a['fieldName'],'type':_0x18ed4a[_0xad7d('0x2a')][_0xad7d('0x2b')]};});_0x5b5ae6[_0xad7d('0x2c')]=_[_0xad7d('0x2d')](_[_0xad7d('0x2e')](_0x5250d9,_0xad7d('0x27')),[_0xad7d('0x27')]);_0x5b5ae6['query']=_[_0xad7d('0x2f')](_0x5df38e[_0xad7d('0x30')]);_0x5b5ae6[_0xad7d('0x31')]=_[_0xad7d('0x32')](_0x5b5ae6[_0xad7d('0x2c')],_0x5b5ae6['query']);_0xaf0fcb[_0xad7d('0x33')]=_[_0xad7d('0x32')](_0x5b5ae6[_0xad7d('0x2c')],qs['fields'](_0x5df38e[_0xad7d('0x30')][_0xad7d('0x34')]));_0xaf0fcb[_0xad7d('0x33')]=_0xaf0fcb[_0xad7d('0x33')][_0xad7d('0x35')]?_0xaf0fcb[_0xad7d('0x33')]:_0x5b5ae6['model'];if(!_0x5df38e[_0xad7d('0x30')][_0xad7d('0x36')]('nolimit')){_0xaf0fcb[_0xad7d('0x1e')]=qs[_0xad7d('0x1e')](_0x5df38e[_0xad7d('0x30')]['limit']);_0xaf0fcb['offset']=qs['offset'](_0x5df38e[_0xad7d('0x30')][_0xad7d('0x1c')]);}_0xaf0fcb[_0xad7d('0x37')]=qs[_0xad7d('0x38')](_0x5df38e[_0xad7d('0x30')]['sort']);_0xaf0fcb[_0xad7d('0x39')]=qs[_0xad7d('0x31')](_['pick'](_0x5df38e['query'],_0x5b5ae6[_0xad7d('0x31')]),_0x5250d9);if(_0x5df38e[_0xad7d('0x30')][_0xad7d('0x3a')]){_0xaf0fcb[_0xad7d('0x39')]=_[_0xad7d('0x3b')](_0xaf0fcb[_0xad7d('0x39')],{'$or':_['map'](_0x5250d9,function(_0x3abfcd){if(_0x3abfcd[_0xad7d('0x2a')]!==_0xad7d('0x3c')){var _0x570bee={};_0x570bee[_0x3abfcd[_0xad7d('0x27')]]={'$like':'%'+_0x5df38e['query']['filter']+'%'};return _0x570bee;}})});}_0xaf0fcb=_['merge']({},_0xaf0fcb,_0x5df38e[_0xad7d('0x3d')]);var _0x998fb={'where':_0xaf0fcb[_0xad7d('0x39')]};return db[_0xad7d('0x28')][_0xad7d('0x1f')](_0x998fb)[_0xad7d('0x24')](function(_0x4a50b1){_0x879cc4[_0xad7d('0x1f')]=_0x4a50b1;if(_0x5df38e[_0xad7d('0x30')][_0xad7d('0x3e')]){_0xaf0fcb[_0xad7d('0x3f')]=[{'all':!![]}];}return db[_0xad7d('0x28')][_0xad7d('0x40')](_0xaf0fcb);})[_0xad7d('0x24')](function(_0x54fe21){_0x879cc4[_0xad7d('0x41')]=_0x54fe21;return _0x879cc4;})[_0xad7d('0x24')](respondWithFilteredResult(_0x4a88e4,_0xaf0fcb))[_0xad7d('0x42')](handleError(_0x4a88e4,null));};exports[_0xad7d('0x43')]=function(_0x1efbbe,_0x29d58f){var _0x37b5e4={'raw':!![],'where':{'id':_0x1efbbe['params']['id']}},_0x83f3f0={};_0x83f3f0['model']=_['keys'](db[_0xad7d('0x28')][_0xad7d('0x29')]);_0x83f3f0[_0xad7d('0x30')]=_[_0xad7d('0x2f')](_0x1efbbe[_0xad7d('0x30')]);_0x83f3f0[_0xad7d('0x31')]=_[_0xad7d('0x32')](_0x83f3f0[_0xad7d('0x2c')],_0x83f3f0[_0xad7d('0x30')]);_0x37b5e4[_0xad7d('0x33')]=_[_0xad7d('0x32')](_0x83f3f0[_0xad7d('0x2c')],qs[_0xad7d('0x34')](_0x1efbbe[_0xad7d('0x30')][_0xad7d('0x34')]));_0x37b5e4['attributes']=_0x37b5e4[_0xad7d('0x33')]['length']?_0x37b5e4[_0xad7d('0x33')]:_0x83f3f0[_0xad7d('0x2c')];if(_0x1efbbe[_0xad7d('0x30')][_0xad7d('0x3e')]){_0x37b5e4['include']=[{'all':!![]}];}_0x37b5e4=_[_0xad7d('0x3b')]({},_0x37b5e4,_0x1efbbe[_0xad7d('0x3d')]);return db[_0xad7d('0x28')][_0xad7d('0x44')](_0x37b5e4)[_0xad7d('0x24')](handleEntityNotFound(_0x29d58f,null))[_0xad7d('0x24')](respondWithResult(_0x29d58f,null))[_0xad7d('0x42')](handleError(_0x29d58f,null));};exports['update']=function(_0x3e2160,_0x4cf427){if(_0x3e2160[_0xad7d('0x45')]['id']){delete _0x3e2160[_0xad7d('0x45')]['id'];}return db['CmCustomField']['find']({'where':{'id':_0x3e2160['params']['id']}})[_0xad7d('0x24')](handleEntityNotFound(_0x4cf427,null))[_0xad7d('0x24')](saveUpdates(_0x3e2160[_0xad7d('0x45')],null))[_0xad7d('0x24')](respondWithResult(_0x4cf427,null))[_0xad7d('0x42')](handleError(_0x4cf427,null));};exports[_0xad7d('0x25')]=function(_0x2c1459,_0x117f91){return db[_0xad7d('0x28')][_0xad7d('0x44')]({'where':{'id':_0x2c1459[_0xad7d('0x46')]['id']}})['then'](handleEntityNotFound(_0x117f91,null))[_0xad7d('0x24')](removeEntity(_0x117f91,null))[_0xad7d('0x42')](handleError(_0x117f91,null));};exports['create']=function(_0x485583,_0x4b1c7d){var _0x236c11;return db[_0xad7d('0x47')][_0xad7d('0x48')](function(_0x5415b5){return db[_0xad7d('0x28')][_0xad7d('0x49')](_0x485583[_0xad7d('0x45')],{'transaction':_0x5415b5})[_0xad7d('0x24')](function(_0x92e703){_0x236c11=_0x92e703;var _0x2e5320={'type':db[_0xad7d('0x4a')]['TEXT'],'transaction':_0x5415b5};switch(_0x485583['body']['type']){case'text':_0x2e5320['type']=db['Sequelize'][_0xad7d('0x4b')];break;case _0xad7d('0x4c'):_0x2e5320[_0xad7d('0x2a')]=db[_0xad7d('0x4a')]['INTEGER'];break;case _0xad7d('0x4d'):_0x2e5320[_0xad7d('0x2a')]=db[_0xad7d('0x4a')]['BOOLEAN'];_0x2e5320[_0xad7d('0x4e')]=![];break;default:}return db[_0xad7d('0x47')]['queryInterface']['addColumn'](_0xad7d('0x4f'),util['format'](_0xad7d('0x50'),_0x236c11['id']),_0x2e5320);})[_0xad7d('0x24')](function(){return _0x236c11;});})['then'](respondWithResult(_0x4b1c7d,0xc9))[_0xad7d('0x42')](handleError(_0x4b1c7d,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 68bca2f..e36bed3 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 _0x735f=['./cmCustomField.attributes','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x18dc63,_0x5c26e5){var _0x290f1e=function(_0x4b8a34){while(--_0x4b8a34){_0x18dc63['push'](_0x18dc63['shift']());}};_0x290f1e(++_0x5c26e5);}(_0x735f,0x71));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf735('0x0'));var logger=require(_0xf735('0x1'))(_0xf735('0x2'));var moment=require(_0xf735('0x3'));var BPromise=require(_0xf735('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf735('0x5'));var rimraf=require(_0xf735('0x6'));var config=require(_0xf735('0x7'));var attributes=require(_0xf735('0x8'));module['exports']=function(_0x2be043,_0x111aab){return _0x2be043['define'](_0xf735('0x9'),attributes,{'tableName':_0xf735('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d3a=['path','rimraf','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x402495,_0x4325d3){var _0x4dde60=function(_0x5a4de1){while(--_0x5a4de1){_0x402495['push'](_0x402495['shift']());}};_0x4dde60(++_0x4325d3);}(_0x8d3a,0x9f));var _0xa8d3=function(_0x5a9335,_0x41bb2d){_0x5a9335=_0x5a9335-0x0;var _0xbb5e4b=_0x8d3a[_0x5a9335];return _0xbb5e4b;};'use strict';var _=require(_0xa8d3('0x0'));var util=require(_0xa8d3('0x1'));var logger=require(_0xa8d3('0x2'))(_0xa8d3('0x3'));var moment=require('moment');var BPromise=require(_0xa8d3('0x4'));var rp=require(_0xa8d3('0x5'));var fs=require('fs');var path=require(_0xa8d3('0x6'));var rimraf=require(_0xa8d3('0x7'));var config=require(_0xa8d3('0x8'));var attributes=require(_0xa8d3('0x9'));module['exports']=function(_0x55f03a,_0x4174bd){return _0x55f03a['define'](_0xa8d3('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index c89bb77..156a063 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 _0x017e=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4875e9,_0x1d1502){var _0x49285a=function(_0x5d3798){while(--_0x5d3798){_0x4875e9['push'](_0x4875e9['shift']());}};_0x49285a(++_0x1d1502);}(_0x017e,0xb3));var _0xe017=function(_0x1e9992,_0x24a7db){_0x1e9992=_0x1e9992-0x0;var _0x4204e2=_0x017e[_0x1e9992];return _0x4204e2;};'use strict';var _=require(_0xe017('0x0'));var util=require(_0xe017('0x1'));var moment=require('moment');var BPromise=require(_0xe017('0x2'));var rs=require(_0xe017('0x3'));var fs=require('fs');var Redis=require(_0xe017('0x4'));var db=require(_0xe017('0x5'))['db'];var utils=require(_0xe017('0x6'));var logger=require('../../config/logger')(_0xe017('0x7'));var config=require(_0xe017('0x8'));var jayson=require(_0xe017('0x9'));var client=jayson['client'][_0xe017('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562bf8,_0x5132d8,_0x4eb39a){return new BPromise(function(_0x3f229e,_0x5962c5){return client[_0xe017('0xb')](_0x562bf8,_0x4eb39a)[_0xe017('0xc')](function(_0x11cec8){logger[_0xe017('0xd')](_0xe017('0xe'),_0x5132d8,_0xe017('0xf'));logger[_0xe017('0x10')](_0xe017('0x11'),_0x5132d8,_0xe017('0xf'),JSON[_0xe017('0x12')](_0x11cec8));if(_0x11cec8['error']){if(_0x11cec8['error'][_0xe017('0x13')]===0x1f4){logger[_0xe017('0x14')](_0xe017('0xe'),_0x5132d8,_0x11cec8[_0xe017('0x14')]['message']);return _0x5962c5(_0x11cec8[_0xe017('0x14')][_0xe017('0x15')]);}logger[_0xe017('0x14')](_0xe017('0xe'),_0x5132d8,_0x11cec8[_0xe017('0x14')][_0xe017('0x15')]);return _0x3f229e(_0x11cec8[_0xe017('0x14')][_0xe017('0x15')]);}else{logger[_0xe017('0xd')](_0xe017('0xe'),_0x5132d8,_0xe017('0xf'));_0x3f229e(_0x11cec8[_0xe017('0x16')][_0xe017('0x15')]);}})[_0xe017('0x17')](function(_0x4e27f1){logger[_0xe017('0x14')]('CmCustomField,\x20%s,\x20%s',_0x5132d8,_0x4e27f1);_0x5962c5(_0x4e27f1);});});} \ No newline at end of file +var _0xe306=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x440d5d,_0x3edda1){var _0x319f6f=function(_0x5d7715){while(--_0x5d7715){_0x440d5d['push'](_0x440d5d['shift']());}};_0x319f6f(++_0x3edda1);}(_0xe306,0x149));var _0x6e30=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe306[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x6e30('0x0'));var util=require(_0x6e30('0x1'));var moment=require(_0x6e30('0x2'));var BPromise=require(_0x6e30('0x3'));var rs=require(_0x6e30('0x4'));var fs=require('fs');var Redis=require(_0x6e30('0x5'));var db=require(_0x6e30('0x6'))['db'];var utils=require(_0x6e30('0x7'));var logger=require(_0x6e30('0x8'))(_0x6e30('0x9'));var config=require(_0x6e30('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e30('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46077f,_0x2ce648,_0x579509){return new BPromise(function(_0x4e820a,_0x45226a){return client[_0x6e30('0xc')](_0x46077f,_0x579509)['then'](function(_0x1661ee){logger['info'](_0x6e30('0xd'),_0x2ce648,_0x6e30('0xe'));logger[_0x6e30('0xf')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x2ce648,_0x6e30('0xe'),JSON['stringify'](_0x1661ee));if(_0x1661ee[_0x6e30('0x10')]){if(_0x1661ee[_0x6e30('0x10')][_0x6e30('0x11')]===0x1f4){logger[_0x6e30('0x10')](_0x6e30('0xd'),_0x2ce648,_0x1661ee['error'][_0x6e30('0x12')]);return _0x45226a(_0x1661ee['error']['message']);}logger['error'](_0x6e30('0xd'),_0x2ce648,_0x1661ee['error']['message']);return _0x4e820a(_0x1661ee[_0x6e30('0x10')][_0x6e30('0x12')]);}else{logger[_0x6e30('0x13')]('CmCustomField,\x20%s,\x20%s',_0x2ce648,_0x6e30('0xe'));_0x4e820a(_0x1661ee[_0x6e30('0x14')][_0x6e30('0x12')]);}})['catch'](function(_0x284b0c){logger[_0x6e30('0x10')]('CmCustomField,\x20%s,\x20%s',_0x2ce648,_0x284b0c);_0x45226a(_0x284b0c);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 49fc735..1af5e4b 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 _0x4397=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4397,0xe4));var _0x7439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4397[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7439('0x0'));var util=require(_0x7439('0x1'));var path=require(_0x7439('0x2'));var timeout=require(_0x7439('0x3'));var express=require(_0x7439('0x4'));var router=express['Router']();var fs_extra=require(_0x7439('0x5'));var auth=require(_0x7439('0x6'));var interaction=require(_0x7439('0x7'));var config=require(_0x7439('0x8'));var controller=require(_0x7439('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7439('0xa')]);router[_0x7439('0xb')]('/:id',auth[_0x7439('0xc')](),controller[_0x7439('0xd')]);router[_0x7439('0xe')]('/',auth[_0x7439('0xc')](),controller['create']);router[_0x7439('0xf')](_0x7439('0x10'),auth[_0x7439('0xc')](),controller[_0x7439('0x11')]);router[_0x7439('0x12')]('/:id',auth[_0x7439('0xc')](),controller[_0x7439('0x13')]);module[_0x7439('0x14')]=router; \ No newline at end of file +var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x5fc3,0xa8));var _0x35fc=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x5fc3[_0x492af5];return _0x59f529;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);router[_0x35fc('0x11')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8abbef7..c936e03 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 _0xf70c=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','contactListQueue','moment','sequelize'];(function(_0x21022c,_0x417232){var _0x5d8c40=function(_0x1d37dc){while(--_0x1d37dc){_0x21022c['push'](_0x21022c['shift']());}};_0x5d8c40(++_0x417232);}(_0xf70c,0xd6));var _0xcf70=function(_0x2f58ff,_0x4e4ddc){_0x2f58ff=_0x2f58ff-0x0;var _0x2d034d=_0xf70c[_0x2f58ff];return _0x2d034d;};'use strict';var moment=require(_0xcf70('0x0'));var Sequelize=require(_0xcf70('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xcf70('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xcf70('0x3')],'defaultValue':moment()[_0xcf70('0x4')](_0xcf70('0x5'))},'countbusyretry':{'type':Sequelize[_0xcf70('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xcf70('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xcf70('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xcf70('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xcf70('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xcf70('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xcf70('0x6')],'unique':_0xcf70('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xcf70('0x8')},'UserId':{'type':Sequelize[_0xcf70('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xcf70('0x8')},'CampaignId':{'type':Sequelize[_0xcf70('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xcf70('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xcf70('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xcf70('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xcf70('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xcf70('0x7')]},'recallmeNotifiedDate':{'type':Sequelize[_0xcf70('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xde29=['sequelize','exports','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xde29,0x15d));var _0x9de2=function(_0x245490,_0x40ba27){_0x245490=_0x245490-0x0;var _0x341444=_0xde29[_0x245490];return _0x341444;};'use strict';var moment=require(_0x9de2('0x0'));var Sequelize=require(_0x9de2('0x1'));module[_0x9de2('0x2')]={'phone':{'type':Sequelize[_0x9de2('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9de2('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9de2('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9de2('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9de2('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9de2('0x7')]},'priority':{'type':Sequelize[_0x9de2('0x6')](0x2)[_0x9de2('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9de2('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9de2('0x6')],'unique':_0x9de2('0x9')},'ListId':{'type':Sequelize[_0x9de2('0x6')],'unique':_0x9de2('0x9')},'UserId':{'type':Sequelize[_0x9de2('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x9de2('0x6')],'unique':_0x9de2('0x9')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9de2('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9de2('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 10ca99d..581d360 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 _0xac31=['show','find','create','body','params','describe','destroy','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','firstName','calleridname','CmHopperAdditionalPhone','end','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','List','VoiceQueue','Queue','getPreviewRecall','transaction','recallme','dialActive','getVoiceQueues','isNumber','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','offset','limit','count','status','Content-Range','json','update','then','sendStatus','error','name','index','CmHopper','rawAttributes','fieldName','model','map','query','keys','filters','intersection','concat','$and','$or','$gte','$lt','$lte','$ne','$eq','$like','$iLike','$notILike','$overlap','$contained','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x3ff37d,_0x1a4a86){var _0x522d66=function(_0x42f3bf){while(--_0x42f3bf){_0x3ff37d['push'](_0x3ff37d['shift']());}};_0x522d66(++_0x1a4a86);}(_0xac31,0xca));var _0x1ac3=function(_0xe12d1f,_0x5bdb34){_0xe12d1f=_0xe12d1f-0x0;var _0x30e6b7=_0xac31[_0xe12d1f];return _0x30e6b7;};'use strict';var moment=require(_0x1ac3('0x0'));var _=require(_0x1ac3('0x1'));var qs=require(_0x1ac3('0x2'));var logger=require(_0x1ac3('0x3'))(_0x1ac3('0x4'));var shared=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];function respondWithResult(_0x59b42c,_0x33b5ab){_0x33b5ab=_0x33b5ab||0xc8;return function(_0x434b5e){if(_0x434b5e){return _0x59b42c['status'](_0x33b5ab)['json'](_0x434b5e);}};}function respondWithFilteredResult(_0xbe22b7,_0x20027f){return function(_0x2bf9b1){if(_0x2bf9b1){var _0x1be223=typeof _0x20027f[_0x1ac3('0x7')]==='undefined'&&typeof _0x20027f[_0x1ac3('0x8')]==='undefined';var _0x1286d2=_0x2bf9b1[_0x1ac3('0x9')];var _0x344674=_0x1be223?0x0:_0x20027f['offset'];var _0xa26c88=_0x1be223?_0x2bf9b1[_0x1ac3('0x9')]:_0x20027f[_0x1ac3('0x7')]+_0x20027f[_0x1ac3('0x8')];var _0x2a8dc7;if(_0xa26c88>=_0x1286d2){_0xa26c88=_0x1286d2;_0x2a8dc7=0xc8;}else{_0x2a8dc7=0xce;}_0xbe22b7[_0x1ac3('0xa')](_0x2a8dc7);return _0xbe22b7['set'](_0x1ac3('0xb'),_0x344674+'-'+_0xa26c88+'/'+_0x1286d2)[_0x1ac3('0xc')](_0x2bf9b1);}return null;};}function saveUpdates(_0x2eeabf,_0x2338b9){return function(_0x50d3b6){if(_0x50d3b6){return _0x50d3b6[_0x1ac3('0xd')](_0x2eeabf)[_0x1ac3('0xe')](function(_0x46c0e9){return _0x46c0e9;});}return null;};}function handleEntityNotFound(_0x2def9f,_0x53cc35){return function(_0x24bb5e){if(!_0x24bb5e){_0x2def9f[_0x1ac3('0xf')](0x194);}return _0x24bb5e;};}function handleError(_0x551eac,_0x29a7b3){_0x29a7b3=_0x29a7b3||0x1f4;return function(_0x1f9641){logger[_0x1ac3('0x10')](_0x1f9641['stack']);if(_0x1f9641[_0x1ac3('0x11')]){delete _0x1f9641[_0x1ac3('0x11')];}_0x551eac[_0x1ac3('0xa')](_0x29a7b3)['send'](_0x1f9641);};}exports[_0x1ac3('0x12')]=function(_0x58000f,_0x291616){var _0x1e1280={},_0x20091d={},_0x3b7e51={'count':0x0,'rows':[]};var _0x18b985=_['map'](db[_0x1ac3('0x13')][_0x1ac3('0x14')],function(_0x296abf){return{'name':_0x296abf[_0x1ac3('0x15')],'type':_0x296abf['type']['key']};});_0x20091d[_0x1ac3('0x16')]=_[_0x1ac3('0x17')](_0x18b985,_0x1ac3('0x11'));_0x20091d[_0x1ac3('0x18')]=_[_0x1ac3('0x19')](_0x58000f[_0x1ac3('0x18')]);_0x20091d[_0x1ac3('0x1a')]=_[_0x1ac3('0x1b')](_0x20091d[_0x1ac3('0x16')],_0x20091d['query']);_0x20091d[_0x1ac3('0x1a')]=_[_0x1ac3('0x1c')](_0x20091d['filters'],[_0x1ac3('0x1d'),_0x1ac3('0x1e'),'$gt',_0x1ac3('0x1f'),_0x1ac3('0x20'),_0x1ac3('0x21'),_0x1ac3('0x22'),_0x1ac3('0x23'),'$not','$between','$notBetween','$in','$notIn',_0x1ac3('0x24'),'$notLike',_0x1ac3('0x25'),_0x1ac3('0x26'),_0x1ac3('0x24'),_0x1ac3('0x27'),'$contains',_0x1ac3('0x28'),'$any']);_0x1e1280[_0x1ac3('0x29')]=_[_0x1ac3('0x1b')](_0x20091d[_0x1ac3('0x16')],qs[_0x1ac3('0x2a')](_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x2a')]));_0x1e1280[_0x1ac3('0x29')]=_0x1e1280['attributes'][_0x1ac3('0x2b')]?_0x1e1280[_0x1ac3('0x29')]:_0x20091d[_0x1ac3('0x16')];if(!_0x58000f[_0x1ac3('0x18')]['hasOwnProperty'](_0x1ac3('0x2c'))){_0x1e1280[_0x1ac3('0x8')]=qs[_0x1ac3('0x8')](_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x8')]);_0x1e1280['offset']=qs[_0x1ac3('0x7')](_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x7')]);}_0x1e1280[_0x1ac3('0x2d')]=qs[_0x1ac3('0x2e')](_0x58000f[_0x1ac3('0x18')]['sort']);_0x1e1280[_0x1ac3('0x2f')]=qs[_0x1ac3('0x1a')](_[_0x1ac3('0x30')](_0x58000f[_0x1ac3('0x18')],_0x20091d['filters']),_0x18b985);if(_0x58000f[_0x1ac3('0x18')][_0x1ac3('0x31')]){_0x1e1280[_0x1ac3('0x2f')]=_[_0x1ac3('0x32')](_0x1e1280[_0x1ac3('0x2f')],{'$or':_[_0x1ac3('0x17')](_0x18b985,function(_0x2c171b){if(_0x2c171b[_0x1ac3('0x33')]!==_0x1ac3('0x34')){var _0x5c29c1={};_0x5c29c1[_0x2c171b[_0x1ac3('0x11')]]={'$like':'%'+_0x58000f[_0x1ac3('0x18')]['filter']+'%'};return _0x5c29c1;}})});}_0x1e1280=_[_0x1ac3('0x32')]({},_0x1e1280,_0x58000f[_0x1ac3('0x35')]);var _0x17c69e={'where':_0x1e1280[_0x1ac3('0x2f')]};return db[_0x1ac3('0x13')][_0x1ac3('0x9')](_0x17c69e)[_0x1ac3('0xe')](function(_0xa15199){_0x3b7e51['count']=_0xa15199;if(_0x58000f[_0x1ac3('0x18')]['includeAll']){_0x1e1280[_0x1ac3('0x36')]=[{'all':!![]}];}return db[_0x1ac3('0x13')][_0x1ac3('0x37')](_0x1e1280);})[_0x1ac3('0xe')](function(_0x3141ae){_0x3b7e51[_0x1ac3('0x38')]=_0x3141ae;return _0x3b7e51;})['then'](respondWithFilteredResult(_0x291616,_0x1e1280))[_0x1ac3('0x39')](handleError(_0x291616,null));};exports[_0x1ac3('0x3a')]=function(_0x43d15,_0x4e2442){var _0x34380d={'raw':!![],'where':{'id':_0x43d15['params']['id']}},_0xb1d970={};_0xb1d970[_0x1ac3('0x16')]=_[_0x1ac3('0x19')](db[_0x1ac3('0x13')][_0x1ac3('0x14')]);_0xb1d970[_0x1ac3('0x18')]=_[_0x1ac3('0x19')](_0x43d15[_0x1ac3('0x18')]);_0xb1d970[_0x1ac3('0x1a')]=_['intersection'](_0xb1d970[_0x1ac3('0x16')],_0xb1d970[_0x1ac3('0x18')]);_0x34380d[_0x1ac3('0x29')]=_[_0x1ac3('0x1b')](_0xb1d970[_0x1ac3('0x16')],qs[_0x1ac3('0x2a')](_0x43d15[_0x1ac3('0x18')]['fields']));_0x34380d['attributes']=_0x34380d[_0x1ac3('0x29')][_0x1ac3('0x2b')]?_0x34380d['attributes']:_0xb1d970[_0x1ac3('0x16')];if(_0x43d15[_0x1ac3('0x18')]['includeAll']){_0x34380d[_0x1ac3('0x36')]=[{'all':!![]}];}_0x34380d=_['merge']({},_0x34380d,_0x43d15[_0x1ac3('0x35')]);return db[_0x1ac3('0x13')][_0x1ac3('0x3b')](_0x34380d)[_0x1ac3('0xe')](handleEntityNotFound(_0x4e2442,null))['then'](respondWithResult(_0x4e2442,null))[_0x1ac3('0x39')](handleError(_0x4e2442,null));};exports[_0x1ac3('0x3c')]=function(_0x1d650b,_0x351936){return db[_0x1ac3('0x13')]['create'](_0x1d650b[_0x1ac3('0x3d')],{})[_0x1ac3('0xe')](respondWithResult(_0x351936,0xc9))[_0x1ac3('0x39')](handleError(_0x351936,null));};exports[_0x1ac3('0xd')]=function(_0x589434,_0x16d56a){if(_0x589434[_0x1ac3('0x3d')]['id']){delete _0x589434[_0x1ac3('0x3d')]['id'];}return db[_0x1ac3('0x13')]['find']({'where':{'id':_0x589434[_0x1ac3('0x3e')]['id']}})[_0x1ac3('0xe')](handleEntityNotFound(_0x16d56a,null))[_0x1ac3('0xe')](saveUpdates(_0x589434[_0x1ac3('0x3d')],null))['then'](respondWithResult(_0x16d56a,null))[_0x1ac3('0x39')](handleError(_0x16d56a,null));};exports['describe']=function(_0x290ddb,_0x10bcaf){return db[_0x1ac3('0x13')][_0x1ac3('0x3f')]()[_0x1ac3('0xe')](respondWithResult(_0x10bcaf,null))[_0x1ac3('0x39')](handleError(_0x10bcaf,null));};exports[_0x1ac3('0x40')]=function(_0x57138a,_0x517f44){var _0xe8f33c;var _0x249c2d=_0x57138a[_0x1ac3('0x3e')]['id'];return db['CmHopper']['find']({'where':{'id':_0x57138a['params']['id']}})[_0x1ac3('0xe')](handleEntityNotFound(_0x517f44,null))[_0x1ac3('0xe')](function(_0x5976f1){if(_0x5976f1){return _0x5976f1[_0x1ac3('0x40')]()[_0x1ac3('0xe')](function(_0x2fc218){return _0x2fc218;});}})[_0x1ac3('0xe')](function(_0x47bf05){_0xe8f33c=_0x47bf05;if(_0x47bf05){if(_0x47bf05['VoiceQueueId']||_0x47bf05[_0x1ac3('0x41')]){return db[_0x47bf05[_0x1ac3('0x42')]?'VoiceQueue':_0x1ac3('0x43')]['find']({'where':{'id':_0x47bf05['VoiceQueueId']?_0x47bf05[_0x1ac3('0x42')]:_0x47bf05[_0x1ac3('0x41')]},'attributes':['id','name'],'raw':!![]});}}})[_0x1ac3('0xe')](function(_0x5a2a42){var _0x267541={};if(_0x5a2a42){_[_0x1ac3('0x32')](_0x267541,_[_0x1ac3('0x44')](_0xe8f33c[_0x1ac3('0x45')],[_0x1ac3('0x46'),_0x1ac3('0x47'),'id']));_0x267541[_0x1ac3('0x48')]=0x15;_0x267541[_0x1ac3('0x49')]=_0x1ac3('0x4a');_0x267541[_0x1ac3('0x4b')]=_0x5a2a42[_0x1ac3('0x11')];_0x267541['membername']=_0x57138a['user'][_0x1ac3('0x11')];_0x267541[_0x1ac3('0x4c')]=_0x57138a[_0x1ac3('0x4d')]['id'];_0x267541[_0x1ac3('0x4a')]=!![];_0x267541[_0x1ac3('0x4e')]=moment()[_0x1ac3('0x4f')](_0x1ac3('0x50'));_0x267541[_0x1ac3('0x51')]=_0xe8f33c[_0x1ac3('0x52')];_0x267541[_0x1ac3('0x53')]=_0xe8f33c['VoiceQueueId']?_0x1ac3('0x54'):_0x1ac3('0x55');return db[_0x1ac3('0x56')][_0x1ac3('0x3b')]({'where':{'id':_0x267541[_0x1ac3('0x57')]},'attributes':['firstName',_0x1ac3('0x58')]})[_0x1ac3('0xe')](function(_0x51eaf0){if(!_['isNil'](_0x517f44)&&!_['isNil'](_0x51eaf0[_0x1ac3('0x59')])){_0x267541[_0x1ac3('0x5a')]=_0x51eaf0[_0x1ac3('0x59')];if(!_['isNil'](_0x51eaf0[_0x1ac3('0x58')])){_0x267541['calleridname']+='\x20'+_0x51eaf0['lastName'];}}})['finally'](function(){return db['CmHopperFinal'][_0x1ac3('0x3c')](_0x267541);});}})[_0x1ac3('0xe')](function(_0x42218b){return db[_0x1ac3('0x5b')][_0x1ac3('0x40')]({'where':{'CmHopperId':_0x249c2d}});})['then'](function(){return _0x517f44[_0x1ac3('0xa')](0xcc)[_0x1ac3('0x5c')]();})['catch'](handleError(_0x517f44,null));};exports[_0x1ac3('0x5d')]=function(_0x1ffbb1,_0xa3be02){var _0x2e79b2=[];return db[_0x1ac3('0x56')]['describe']()[_0x1ac3('0xe')](function(_0x40907d){_0x2e79b2=_[_0x1ac3('0x19')](_0x40907d);return _0x1ffbb1[_0x1ac3('0x4d')]['getVoiceQueues']({'where':{'type':_0x1ac3('0x5e'),'dialActive':!![],'dialMethod':_0x1ac3('0x5f')},'attributes':['id',_0x1ac3('0x60'),_0x1ac3('0x61')],'raw':!![]});})[_0x1ac3('0xe')](function(_0x1ac283){if(_0x1ac283&&_0x1ac283['length']){return db['sequelize']['transaction'](function(_0x582fe2){var _0x3b930b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x1ac3('0x50'))},'VoiceQueueId':{'$in':_[_0x1ac3('0x17')](_0x1ac283,'id')},'$or':[{'UserId':null},{'UserId':_0x1ffbb1[_0x1ac3('0x4d')]['id']}]};var _0x20fa43={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1ac283)[_0x1ac3('0x31')]([_0x1ac3('0x61'),0x0])['map']('id')[_0x1ac3('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x1ffbb1[_0x1ac3('0x4d')]['id']}]};var _0x3597cb={'$or':[_0x3b930b,_0x20fa43]};var _0x422b15=[];if(_0x1ffbb1['body'][_0x1ac3('0x63')]&&_0x1ffbb1[_0x1ac3('0x3d')][_0x1ac3('0x63')]===_0x1ac3('0x64')){if(!_[_0x1ac3('0x65')](_0x1ffbb1['body'][_0x1ac3('0x66')])){_0x3597cb['id']={'$in':_0x1ffbb1['body']['hopperIds']};}_0x422b15=[[_0x1ac3('0x67'),_0x1ac3('0x68')],[_0x1ac3('0x69'),_0x1ac283[0x0][_0x1ac3('0x60')]===_0x1ac3('0x68')?_0x1ac3('0x6a'):_0x1ac3('0x68')],db[_0x1ac3('0x6b')][_0x1ac3('0x6c')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x1ac3('0x6a')]];}else{if(!_[_0x1ac3('0x65')](_0x1ffbb1[_0x1ac3('0x3d')]['hopperIds'])){_0x3597cb['id']={'$notIn':_0x1ffbb1[_0x1ac3('0x3d')][_0x1ac3('0x66')]};}_0x422b15=[[_0x1ac3('0x67'),_0x1ac3('0x6a')],[_0x1ac3('0x69'),_0x1ac283[0x0][_0x1ac3('0x60')]],db[_0x1ac3('0x6b')][_0x1ac3('0x6c')](_0x1ac3('0x6d')),['id',_0x1ac3('0x68')]];}return db['CmHopper'][_0x1ac3('0x6e')]({'attributes':['id',_0x1ac3('0x6f'),_0x1ac3('0x52'),'recallme'],'where':_0x3597cb,'order':_0x422b15,'transaction':_0x582fe2,'lock':_0x582fe2[_0x1ac3('0x70')][_0x1ac3('0x71')],'include':[{'model':db[_0x1ac3('0x56')],'as':_0x1ac3('0x72'),'attributes':_0x2e79b2,'include':[{'model':db[_0x1ac3('0x73')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1ac3('0x74'),'attributes':['id','name']},{'model':db[_0x1ac3('0x75')],'as':_0x1ac3('0x76'),'attributes':['id',_0x1ac3('0x11'),'dialActive']}]})[_0x1ac3('0xe')](function(_0x2d5b5a){if(_0x2d5b5a){return _0x2d5b5a[_0x1ac3('0xd')]({'UserId':_0x1ffbb1[_0x1ac3('0x4d')]['id']},{'transaction':_0x582fe2});}});});}})[_0x1ac3('0xe')](handleEntityNotFound(_0xa3be02,null))['then'](respondWithResult(_0xa3be02,null))['catch'](handleError(_0xa3be02,null));};exports[_0x1ac3('0x77')]=function(_0x27f20c,_0x5b3d42,_0x29b026){var _0x476863=[];var _0x2a4316=_0x27f20c['params']['id'];var _0x175174=_0x27f20c[_0x1ac3('0x4d')]['id'];return db['CmContact'][_0x1ac3('0x3f')]()['then'](function(_0x18af8a){_0x476863=_['keys'](_0x18af8a);return db['sequelize'][_0x1ac3('0x78')](function(_0x444b04){const _0xac1654={'id':_0x2a4316};return db[_0x1ac3('0x13')][_0x1ac3('0x6e')]({'attributes':['id',_0x1ac3('0x6f'),_0x1ac3('0x79')],'where':_0xac1654,'transaction':_0x444b04,'lock':_0x444b04[_0x1ac3('0x70')][_0x1ac3('0x71')],'include':[{'model':db[_0x1ac3('0x56')],'as':_0x1ac3('0x72'),'attributes':_0x476863,'include':[{'model':db[_0x1ac3('0x73')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':_0x1ac3('0x74'),'attributes':['id',_0x1ac3('0x11')]},{'model':db['VoiceQueue'],'as':_0x1ac3('0x76'),'attributes':['id',_0x1ac3('0x11'),_0x1ac3('0x7a')]}]})[_0x1ac3('0xe')](function(_0xbadca5){if(_0xbadca5){return _0xbadca5['update']({'UserId':_0x175174},{'transaction':_0x444b04});}});});})[_0x1ac3('0xe')](handleEntityNotFound(_0x5b3d42,null))['then'](respondWithResult(_0x5b3d42,null))[_0x1ac3('0x39')](handleError(_0x5b3d42,null));};exports['getOpenContacts']=function(_0x218712,_0x50278a){return _0x218712[_0x1ac3('0x4d')][_0x1ac3('0x7b')]({'where':{'type':_0x1ac3('0x5e'),'dialActive':!![],'dialMethod':_0x1ac3('0x5f')},'attributes':['id'],'raw':!![]})[_0x1ac3('0xe')](function(_0x5bf7f1){if(_0x5bf7f1&&_0x5bf7f1['length']){return db['CmHopper'][_0x1ac3('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x1ac3('0x4f')](_0x1ac3('0x50'))},'VoiceQueueId':{'$in':_[_0x1ac3('0x17')](_0x5bf7f1,'id')},'$or':[{'UserId':null},{'UserId':_0x218712['user']['id']}]}});}return 0x0;})[_0x1ac3('0xe')](function(_0x441a73){if(!_['isNil'](_0x441a73)&&_[_0x1ac3('0x7c')](_0x441a73)){return _0x50278a['status'](0xc8)[_0x1ac3('0xc')]({'contacts':_0x441a73});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x1ac3('0x7d'));_0x50278a[_0x1ac3('0xf')](0x194);}})[_0x1ac3('0x39')](handleError(_0x50278a,null));};exports[_0x1ac3('0x7e')]=function(_0x12cbb4,_0x5bb6af){var _0x40a2b5=shared[_0x1ac3('0x7f')];var _0x16a834=[];_[_0x1ac3('0x17')](_0x40a2b5,function(_0x4a272e){_0x16a834[_0x1ac3('0x80')]({'id':_0x4a272e[_0x1ac3('0x11')],'name':_0x4a272e['name'],'utcOffset':_0x4a272e['utcOffset']});});return _0x5bb6af['status'](0xc8)[_0x1ac3('0xc')]({'tz':_0x16a834});};exports[_0x1ac3('0x81')]=function(_0x37d3cd,_0x3e1a11){var _0x582468=shared[_0x1ac3('0x7f')];var _0x135898={};if(!_['isNil'](_0x582468[_0x37d3cd[_0x1ac3('0x3d')]['id']]))_0x135898=_0x582468[_0x37d3cd[_0x1ac3('0x3d')]['id']];return _0x3e1a11[_0x1ac3('0xa')](0xc8)[_0x1ac3('0xc')](_0x135898);}; \ No newline at end of file +var _0x85d0=['$between','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','keys','includeAll','options','find','create','body','describe','destroy','VoiceQueueId','CampaignId','createdAt','state','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','scheduledAt','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getPreviewRecall','scheduledat','LOCK','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','api','../../config/environment','../../mysqldb','json','undefined','limit','count','offset','status','set','update','then','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','model','map','query','intersection','filters','concat','$or','$gt','$gte','$lte','$ne','$eq','$not'];(function(_0x306980,_0xcf2bbc){var _0xdc8123=function(_0x47e3f4){while(--_0x47e3f4){_0x306980['push'](_0x306980['shift']());}};_0xdc8123(++_0xcf2bbc);}(_0x85d0,0x164));var _0x085d=function(_0x3641d7,_0x3d167e){_0x3641d7=_0x3641d7-0x0;var _0x2cf25d=_0x85d0[_0x3641d7];return _0x2cf25d;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x085d('0x0'));var shared=require(_0x085d('0x1'));var db=require(_0x085d('0x2'))['db'];function respondWithResult(_0x313db8,_0x231765){_0x231765=_0x231765||0xc8;return function(_0x19ae4c){if(_0x19ae4c){return _0x313db8['status'](_0x231765)[_0x085d('0x3')](_0x19ae4c);}};}function respondWithFilteredResult(_0x5c917f,_0x364f09){return function(_0x9acc97){if(_0x9acc97){var _0x2a6902=typeof _0x364f09['offset']===_0x085d('0x4')&&typeof _0x364f09[_0x085d('0x5')]===_0x085d('0x4');var _0x3129a8=_0x9acc97[_0x085d('0x6')];var _0x6450ab=_0x2a6902?0x0:_0x364f09[_0x085d('0x7')];var _0x985cb3=_0x2a6902?_0x9acc97[_0x085d('0x6')]:_0x364f09['offset']+_0x364f09[_0x085d('0x5')];var _0x19b205;if(_0x985cb3>=_0x3129a8){_0x985cb3=_0x3129a8;_0x19b205=0xc8;}else{_0x19b205=0xce;}_0x5c917f[_0x085d('0x8')](_0x19b205);return _0x5c917f[_0x085d('0x9')]('Content-Range',_0x6450ab+'-'+_0x985cb3+'/'+_0x3129a8)[_0x085d('0x3')](_0x9acc97);}return null;};}function saveUpdates(_0x2bd6ae,_0x5c6c27){return function(_0x2e0714){if(_0x2e0714){return _0x2e0714[_0x085d('0xa')](_0x2bd6ae)[_0x085d('0xb')](function(_0x6b21d1){return _0x6b21d1;});}return null;};}function handleEntityNotFound(_0x5a5252,_0x4b87b9){return function(_0x19ce18){if(!_0x19ce18){_0x5a5252['sendStatus'](0x194);}return _0x19ce18;};}function handleError(_0x536f36,_0x267374){_0x267374=_0x267374||0x1f4;return function(_0x334263){logger[_0x085d('0xc')](_0x334263[_0x085d('0xd')]);if(_0x334263[_0x085d('0xe')]){delete _0x334263['name'];}_0x536f36[_0x085d('0x8')](_0x267374)[_0x085d('0xf')](_0x334263);};}exports[_0x085d('0x10')]=function(_0x1b0a6c,_0x3e566f){var _0x1c9de6={},_0x5c046e={},_0x6f7604={'count':0x0,'rows':[]};var _0x1195d5=_['map'](db[_0x085d('0x11')][_0x085d('0x12')],function(_0x159291){return{'name':_0x159291[_0x085d('0x13')],'type':_0x159291[_0x085d('0x14')]['key']};});_0x5c046e[_0x085d('0x15')]=_[_0x085d('0x16')](_0x1195d5,_0x085d('0xe'));_0x5c046e[_0x085d('0x17')]=_['keys'](_0x1b0a6c['query']);_0x5c046e['filters']=_[_0x085d('0x18')](_0x5c046e[_0x085d('0x15')],_0x5c046e[_0x085d('0x17')]);_0x5c046e[_0x085d('0x19')]=_[_0x085d('0x1a')](_0x5c046e[_0x085d('0x19')],['$and',_0x085d('0x1b'),_0x085d('0x1c'),_0x085d('0x1d'),'$lt',_0x085d('0x1e'),_0x085d('0x1f'),_0x085d('0x20'),_0x085d('0x21'),_0x085d('0x22'),'$notBetween','$in','$notIn',_0x085d('0x23'),_0x085d('0x24'),_0x085d('0x25'),'$notILike',_0x085d('0x23'),_0x085d('0x26'),_0x085d('0x27'),'$contained',_0x085d('0x28')]);_0x1c9de6[_0x085d('0x29')]=_[_0x085d('0x18')](_0x5c046e[_0x085d('0x15')],qs['fields'](_0x1b0a6c[_0x085d('0x17')][_0x085d('0x2a')]));_0x1c9de6['attributes']=_0x1c9de6[_0x085d('0x29')][_0x085d('0x2b')]?_0x1c9de6['attributes']:_0x5c046e[_0x085d('0x15')];if(!_0x1b0a6c[_0x085d('0x17')][_0x085d('0x2c')]('nolimit')){_0x1c9de6[_0x085d('0x5')]=qs[_0x085d('0x5')](_0x1b0a6c[_0x085d('0x17')]['limit']);_0x1c9de6[_0x085d('0x7')]=qs['offset'](_0x1b0a6c[_0x085d('0x17')][_0x085d('0x7')]);}_0x1c9de6[_0x085d('0x2d')]=qs[_0x085d('0x2e')](_0x1b0a6c['query'][_0x085d('0x2e')]);_0x1c9de6[_0x085d('0x2f')]=qs[_0x085d('0x19')](_[_0x085d('0x30')](_0x1b0a6c['query'],_0x5c046e['filters']),_0x1195d5);if(_0x1b0a6c[_0x085d('0x17')][_0x085d('0x31')]){_0x1c9de6[_0x085d('0x2f')]=_[_0x085d('0x32')](_0x1c9de6[_0x085d('0x2f')],{'$or':_[_0x085d('0x16')](_0x1195d5,function(_0x165eff){if(_0x165eff[_0x085d('0x14')]!==_0x085d('0x33')){var _0x596862={};_0x596862[_0x165eff[_0x085d('0xe')]]={'$like':'%'+_0x1b0a6c[_0x085d('0x17')]['filter']+'%'};return _0x596862;}})});}_0x1c9de6=_[_0x085d('0x32')]({},_0x1c9de6,_0x1b0a6c['options']);var _0x1cc755={'where':_0x1c9de6[_0x085d('0x2f')]};return db['CmHopper'][_0x085d('0x6')](_0x1cc755)[_0x085d('0xb')](function(_0x26d1f2){_0x6f7604[_0x085d('0x6')]=_0x26d1f2;if(_0x1b0a6c[_0x085d('0x17')]['includeAll']){_0x1c9de6[_0x085d('0x34')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1c9de6);})[_0x085d('0xb')](function(_0x32bf4f){_0x6f7604[_0x085d('0x35')]=_0x32bf4f;return _0x6f7604;})[_0x085d('0xb')](respondWithFilteredResult(_0x3e566f,_0x1c9de6))[_0x085d('0x36')](handleError(_0x3e566f,null));};exports['show']=function(_0x10d5cf,_0x47e1e8){var _0x3a8646={'raw':!![],'where':{'id':_0x10d5cf[_0x085d('0x37')]['id']}},_0x65ec6d={};_0x65ec6d['model']=_[_0x085d('0x38')](db['CmHopper'][_0x085d('0x12')]);_0x65ec6d[_0x085d('0x17')]=_['keys'](_0x10d5cf[_0x085d('0x17')]);_0x65ec6d[_0x085d('0x19')]=_[_0x085d('0x18')](_0x65ec6d['model'],_0x65ec6d['query']);_0x3a8646[_0x085d('0x29')]=_[_0x085d('0x18')](_0x65ec6d[_0x085d('0x15')],qs[_0x085d('0x2a')](_0x10d5cf[_0x085d('0x17')][_0x085d('0x2a')]));_0x3a8646[_0x085d('0x29')]=_0x3a8646[_0x085d('0x29')][_0x085d('0x2b')]?_0x3a8646[_0x085d('0x29')]:_0x65ec6d['model'];if(_0x10d5cf['query'][_0x085d('0x39')]){_0x3a8646[_0x085d('0x34')]=[{'all':!![]}];}_0x3a8646=_[_0x085d('0x32')]({},_0x3a8646,_0x10d5cf[_0x085d('0x3a')]);return db[_0x085d('0x11')][_0x085d('0x3b')](_0x3a8646)[_0x085d('0xb')](handleEntityNotFound(_0x47e1e8,null))[_0x085d('0xb')](respondWithResult(_0x47e1e8,null))[_0x085d('0x36')](handleError(_0x47e1e8,null));};exports[_0x085d('0x3c')]=function(_0x20a4ef,_0x4d5167){return db[_0x085d('0x11')][_0x085d('0x3c')](_0x20a4ef[_0x085d('0x3d')],{})[_0x085d('0xb')](respondWithResult(_0x4d5167,0xc9))[_0x085d('0x36')](handleError(_0x4d5167,null));};exports['update']=function(_0x13ba2d,_0x544729){if(_0x13ba2d[_0x085d('0x3d')]['id']){delete _0x13ba2d['body']['id'];}return db['CmHopper'][_0x085d('0x3b')]({'where':{'id':_0x13ba2d[_0x085d('0x37')]['id']}})[_0x085d('0xb')](handleEntityNotFound(_0x544729,null))[_0x085d('0xb')](saveUpdates(_0x13ba2d[_0x085d('0x3d')],null))['then'](respondWithResult(_0x544729,null))['catch'](handleError(_0x544729,null));};exports['describe']=function(_0x580b91,_0x5aeb4a){return db[_0x085d('0x11')][_0x085d('0x3e')]()['then'](respondWithResult(_0x5aeb4a,null))[_0x085d('0x36')](handleError(_0x5aeb4a,null));};exports['destroy']=function(_0x5df4cf,_0x415a4b){var _0x20cdcb;var _0x1da4b8=_0x5df4cf[_0x085d('0x37')]['id'];return db['CmHopper'][_0x085d('0x3b')]({'where':{'id':_0x5df4cf['params']['id']}})[_0x085d('0xb')](handleEntityNotFound(_0x415a4b,null))[_0x085d('0xb')](function(_0x5d6f22){if(_0x5d6f22){return _0x5d6f22[_0x085d('0x3f')]()[_0x085d('0xb')](function(_0x298f6f){return _0x298f6f;});}})[_0x085d('0xb')](function(_0x58955e){_0x20cdcb=_0x58955e;if(_0x58955e){if(_0x58955e[_0x085d('0x40')]||_0x58955e['CampaignId']){return db[_0x58955e[_0x085d('0x40')]?'VoiceQueue':'Campaign'][_0x085d('0x3b')]({'where':{'id':_0x58955e[_0x085d('0x40')]?_0x58955e[_0x085d('0x40')]:_0x58955e[_0x085d('0x41')]},'attributes':['id',_0x085d('0xe')],'raw':!![]});}}})[_0x085d('0xb')](function(_0x1c3081){var _0x1bac21={};if(_0x1c3081){_['merge'](_0x1bac21,_['omit'](_0x20cdcb['dataValues'],[_0x085d('0x42'),'updatedAt','id']));_0x1bac21[_0x085d('0x43')]=0x15;_0x1bac21['statedesc']=_0x085d('0x44');_0x1bac21[_0x085d('0x45')]=_0x1c3081[_0x085d('0xe')];_0x1bac21[_0x085d('0x46')]=_0x5df4cf['user']['name'];_0x1bac21[_0x085d('0x47')]=_0x5df4cf[_0x085d('0x48')]['id'];_0x1bac21['deleted']=!![];_0x1bac21[_0x085d('0x49')]=moment()[_0x085d('0x4a')](_0x085d('0x4b'));_0x1bac21[_0x085d('0x4c')]=_0x20cdcb[_0x085d('0x4d')];_0x1bac21[_0x085d('0x4e')]=_0x20cdcb[_0x085d('0x40')]?_0x085d('0x4f'):'ivr';return db[_0x085d('0x50')]['find']({'where':{'id':_0x1bac21[_0x085d('0x51')]},'attributes':['firstName',_0x085d('0x52')]})['then'](function(_0x402157){if(!_[_0x085d('0x53')](_0x415a4b)&&!_['isNil'](_0x402157['firstName'])){_0x1bac21[_0x085d('0x54')]=_0x402157[_0x085d('0x55')];if(!_[_0x085d('0x53')](_0x402157[_0x085d('0x52')])){_0x1bac21[_0x085d('0x54')]+='\x20'+_0x402157[_0x085d('0x52')];}}})[_0x085d('0x56')](function(){return db[_0x085d('0x57')][_0x085d('0x3c')](_0x1bac21);});}})[_0x085d('0xb')](function(_0x289303){return db[_0x085d('0x58')][_0x085d('0x3f')]({'where':{'CmHopperId':_0x1da4b8}});})[_0x085d('0xb')](function(){return _0x415a4b['status'](0xcc)['end']();})[_0x085d('0x36')](handleError(_0x415a4b,null));};exports[_0x085d('0x59')]=function(_0x4b606d,_0x5b89e1){var _0x4e695e=[];return db[_0x085d('0x50')][_0x085d('0x3e')]()['then'](function(_0x210f01){_0x4e695e=_[_0x085d('0x38')](_0x210f01);return _0x4b606d[_0x085d('0x48')]['getVoiceQueues']({'where':{'type':_0x085d('0x5a'),'dialActive':!![],'dialMethod':_0x085d('0x5b')},'attributes':['id',_0x085d('0x5c'),_0x085d('0x5d')],'raw':!![]});})['then'](function(_0x3fc07e){if(_0x3fc07e&&_0x3fc07e[_0x085d('0x2b')]){return db['sequelize'][_0x085d('0x5e')](function(_0x375779){var _0x1a7ddc={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x3fc07e,'id')},'$or':[{'UserId':null},{'UserId':_0x4b606d[_0x085d('0x48')]['id']}]};var _0x586569={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3fc07e)['filter']([_0x085d('0x5d'),0x0])['map']('id')[_0x085d('0x5f')]()},'$or':[{'UserId':null},{'UserId':_0x4b606d[_0x085d('0x48')]['id']}]};var _0x50fe13={'$or':[_0x1a7ddc,_0x586569]};var _0x1f23f2=[];if(_0x4b606d[_0x085d('0x3d')]['direction']&&_0x4b606d[_0x085d('0x3d')][_0x085d('0x60')]===_0x085d('0x61')){if(!_[_0x085d('0x62')](_0x4b606d['body']['hopperIds'])){_0x50fe13['id']={'$in':_0x4b606d[_0x085d('0x3d')][_0x085d('0x63')]};}_0x1f23f2=[[_0x085d('0x64'),_0x085d('0x65')],['scheduledAt',_0x3fc07e[0x0]['dialOrderByScheduledAt']==='ASC'?_0x085d('0x66'):'ASC'],db['sequelize'][_0x085d('0x67')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x085d('0x66')]];}else{if(!_[_0x085d('0x62')](_0x4b606d[_0x085d('0x3d')][_0x085d('0x63')])){_0x50fe13['id']={'$notIn':_0x4b606d['body'][_0x085d('0x63')]};}_0x1f23f2=[[_0x085d('0x64'),_0x085d('0x66')],[_0x085d('0x68'),_0x3fc07e[0x0][_0x085d('0x5c')]],db[_0x085d('0x69')][_0x085d('0x67')](_0x085d('0x6a')),['id',_0x085d('0x65')]];}return db[_0x085d('0x11')]['findOne']({'attributes':['id','scheduledat',_0x085d('0x4d'),_0x085d('0x6b')],'where':_0x50fe13,'order':_0x1f23f2,'transaction':_0x375779,'lock':_0x375779['LOCK'][_0x085d('0x6c')],'include':[{'model':db[_0x085d('0x50')],'as':_0x085d('0x6d'),'attributes':_0x4e695e,'include':[{'model':db[_0x085d('0x6e')],'as':_0x085d('0x6f'),'attributes':['id',_0x085d('0xe')]}]},{'model':db[_0x085d('0x70')],'as':_0x085d('0x71'),'attributes':['id',_0x085d('0xe')]},{'model':db[_0x085d('0x72')],'as':_0x085d('0x73'),'attributes':['id',_0x085d('0xe'),_0x085d('0x74')]}]})[_0x085d('0xb')](function(_0xf17978){if(_0xf17978){return _0xf17978[_0x085d('0xa')]({'UserId':_0x4b606d[_0x085d('0x48')]['id']},{'transaction':_0x375779});}});});}})['then'](handleEntityNotFound(_0x5b89e1,null))[_0x085d('0xb')](respondWithResult(_0x5b89e1,null))[_0x085d('0x36')](handleError(_0x5b89e1,null));};exports[_0x085d('0x75')]=function(_0x53d5ba,_0x326e94,_0x4de098){var _0x53fd1b=[];var _0x261ac7=_0x53d5ba[_0x085d('0x37')]['id'];var _0x4ba7a8=_0x53d5ba[_0x085d('0x48')]['id'];return db[_0x085d('0x50')][_0x085d('0x3e')]()[_0x085d('0xb')](function(_0x2f21c0){_0x53fd1b=_['keys'](_0x2f21c0);return db[_0x085d('0x69')][_0x085d('0x5e')](function(_0x5ada01){const _0x52cc7b={'id':_0x261ac7};return db[_0x085d('0x11')]['findOne']({'attributes':['id',_0x085d('0x76'),_0x085d('0x6b')],'where':_0x52cc7b,'transaction':_0x5ada01,'lock':_0x5ada01[_0x085d('0x77')][_0x085d('0x6c')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x53fd1b,'include':[{'model':db[_0x085d('0x6e')],'as':_0x085d('0x6f'),'attributes':['id',_0x085d('0xe')]}]},{'model':db['CmList'],'as':_0x085d('0x71'),'attributes':['id','name']},{'model':db[_0x085d('0x72')],'as':_0x085d('0x73'),'attributes':['id',_0x085d('0xe'),'dialActive']}]})[_0x085d('0xb')](function(_0x5994ec){if(_0x5994ec){return _0x5994ec[_0x085d('0xa')]({'UserId':_0x4ba7a8},{'transaction':_0x5ada01});}});});})[_0x085d('0xb')](handleEntityNotFound(_0x326e94,null))[_0x085d('0xb')](respondWithResult(_0x326e94,null))['catch'](handleError(_0x326e94,null));};exports['getOpenContacts']=function(_0x1c62e5,_0x2bc093){return _0x1c62e5[_0x085d('0x48')][_0x085d('0x78')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x143289){if(_0x143289&&_0x143289[_0x085d('0x2b')]){return db[_0x085d('0x11')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x085d('0x4b'))},'VoiceQueueId':{'$in':_[_0x085d('0x16')](_0x143289,'id')},'$or':[{'UserId':null},{'UserId':_0x1c62e5[_0x085d('0x48')]['id']}]}});}return 0x0;})['then'](function(_0x16f6e7){if(!_['isNil'](_0x16f6e7)&&_[_0x085d('0x79')](_0x16f6e7)){return _0x2bc093[_0x085d('0x8')](0xc8)['json']({'contacts':_0x16f6e7});}else{logger[_0x085d('0xc')](_0x085d('0x7a'),_0x085d('0x7b'),0x194,'entity\x20not\x20found');_0x2bc093[_0x085d('0x7c')](0x194);}})[_0x085d('0x36')](handleError(_0x2bc093,null));};exports[_0x085d('0x7d')]=function(_0x18809c,_0x2de70b){var _0x562711=shared[_0x085d('0x7e')];var _0x11a937=[];_[_0x085d('0x16')](_0x562711,function(_0x4f866b){_0x11a937[_0x085d('0x7f')]({'id':_0x4f866b[_0x085d('0xe')],'name':_0x4f866b[_0x085d('0xe')],'utcOffset':_0x4f866b[_0x085d('0x80')]});});return _0x2de70b[_0x085d('0x8')](0xc8)[_0x085d('0x3')]({'tz':_0x11a937});};exports[_0x085d('0x81')]=function(_0x32cbca,_0x57706d){var _0x1f3144=shared['timezones'];var _0x4a4e8e={};if(!_[_0x085d('0x53')](_0x1f3144[_0x32cbca[_0x085d('0x3d')]['id']]))_0x4a4e8e=_0x1f3144[_0x32cbca[_0x085d('0x3d')]['id']];return _0x57706d[_0x085d('0x8')](0xc8)[_0x085d('0x3')](_0x4a4e8e);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a3688ca..93edd52 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','../../config/logger'];(function(_0x3f7830,_0x2ef515){var _0x392bcf=function(_0x495eb3){while(--_0x495eb3){_0x3f7830['push'](_0x3f7830['shift']());}};_0x392bcf(++_0x2ef515);}(_0x1cb9,0x14e));var _0x91cb=function(_0x46f4b9,_0x3fd4e2){_0x46f4b9=_0x46f4b9-0x0;var _0x28fc27=_0x1cb9[_0x46f4b9];return _0x28fc27;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['scheduledat']},{'name':_0x91cb('0xc'),'fields':['phone']},{'name':_0x91cb('0xd'),'fields':[_0x91cb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x2f14e0,_0x57b51c){var _0x6b043d=function(_0x51a972){while(--_0x51a972){_0x2f14e0['push'](_0x2f14e0['shift']());}};_0x6b043d(++_0x57b51c);}(_0x4819,0xcd));var _0x9481=function(_0x11447e,_0x33dab2){_0x11447e=_0x11447e-0x0;var _0x45a214=_0x4819[_0x11447e];return _0x45a214;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index bd589a6..b1574be 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 _0xf637=['body','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','UserId','push','includes','all','GetContactDialer','length','ContactId','dataValues','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','then','debug','stringify','catch','message','error','ShowCmHopper','find','info','CreateCmHopper','create'];(function(_0x414af5,_0x1c5e8c){var _0x30ebf3=function(_0x18c7ef){while(--_0x18c7ef){_0x414af5['push'](_0x414af5['shift']());}};_0x30ebf3(++_0x1c5e8c);}(_0xf637,0x179));var _0x7f63=function(_0x2d486b,_0x242280){_0x2d486b=_0x2d486b-0x0;var _0x1c24ad=_0xf637[_0x2d486b];return _0x1c24ad;};'use strict';var _=require(_0x7f63('0x0'));var util=require(_0x7f63('0x1'));var moment=require(_0x7f63('0x2'));var BPromise=require(_0x7f63('0x3'));var db=require(_0x7f63('0x4'))['db'];var logger=require('../../config/logger')(_0x7f63('0x5'));exports[_0x7f63('0x6')]=function(_0x4b7bb0){var _0x33ee0c=this;return new Promise(function(_0x210224,_0x4cc83c){return db[_0x7f63('0x7')][_0x7f63('0x8')]({'raw':_0x4b7bb0['options']?_0x4b7bb0[_0x7f63('0x9')][_0x7f63('0xa')]===undefined?!![]:![]:!![],'where':_0x4b7bb0[_0x7f63('0x9')]?_0x4b7bb0[_0x7f63('0x9')][_0x7f63('0xb')]||null:null,'attributes':_0x4b7bb0[_0x7f63('0x9')]?_0x4b7bb0['options']['attributes']||null:null,'limit':_0x4b7bb0[_0x7f63('0x9')]?_0x4b7bb0[_0x7f63('0x9')][_0x7f63('0xc')]||null:null,'include':_0x4b7bb0[_0x7f63('0x9')]?_0x4b7bb0[_0x7f63('0x9')][_0x7f63('0xd')]?_[_0x7f63('0xe')](_0x4b7bb0['options'][_0x7f63('0xd')],function(_0x2d877f){return{'model':db[_0x2d877f[_0x7f63('0xf')]],'as':_0x2d877f['as'],'attributes':_0x2d877f[_0x7f63('0x10')],'include':_0x2d877f['include']?_[_0x7f63('0xe')](_0x2d877f[_0x7f63('0xd')],function(_0x41eda3){return{'model':db[_0x41eda3[_0x7f63('0xf')]],'as':_0x41eda3['as'],'attributes':_0x41eda3[_0x7f63('0x10')],'include':_0x41eda3[_0x7f63('0xd')]?_[_0x7f63('0xe')](_0x41eda3[_0x7f63('0xd')],function(_0x3f1421){return{'model':db[_0x3f1421['model']],'as':_0x3f1421['as'],'attributes':_0x3f1421[_0x7f63('0x10')]};}):[]};}):[]};}):[]:[]})[_0x7f63('0x11')](function(_0x58d979){logger['info'](_0x7f63('0x6'),_0x4b7bb0);logger[_0x7f63('0x12')](_0x7f63('0x6'),_0x4b7bb0,JSON[_0x7f63('0x13')](_0x58d979));_0x210224(_0x58d979);})[_0x7f63('0x14')](function(_0x5a7980){logger['error'](_0x7f63('0x6'),_0x5a7980[_0x7f63('0x15')],_0x4b7bb0);_0x4cc83c(_0x33ee0c[_0x7f63('0x16')](0x1f4,_0x5a7980[_0x7f63('0x15')]));});});};exports[_0x7f63('0x17')]=function(_0x4b8d89){var _0x390759=this;return new Promise(function(_0x2fc190,_0x4472b3){return db[_0x7f63('0x7')][_0x7f63('0x18')]({'raw':_0x4b8d89[_0x7f63('0x9')]?_0x4b8d89[_0x7f63('0x9')][_0x7f63('0xa')]===undefined?!![]:![]:!![],'where':_0x4b8d89[_0x7f63('0x9')]?_0x4b8d89[_0x7f63('0x9')]['where']||null:null,'attributes':_0x4b8d89['options']?_0x4b8d89['options']['attributes']||null:null,'include':_0x4b8d89[_0x7f63('0x9')]?_0x4b8d89[_0x7f63('0x9')]['include']?_[_0x7f63('0xe')](_0x4b8d89[_0x7f63('0x9')][_0x7f63('0xd')],function(_0x243dcc){return{'model':db[_0x243dcc[_0x7f63('0xf')]],'as':_0x243dcc['as'],'attributes':_0x243dcc['attributes'],'include':_0x243dcc[_0x7f63('0xd')]?_[_0x7f63('0xe')](_0x243dcc['include'],function(_0x16df7e){return{'model':db[_0x16df7e[_0x7f63('0xf')]],'as':_0x16df7e['as'],'attributes':_0x16df7e[_0x7f63('0x10')],'include':_0x16df7e['include']?_[_0x7f63('0xe')](_0x16df7e[_0x7f63('0xd')],function(_0x56d739){return{'model':db[_0x56d739[_0x7f63('0xf')]],'as':_0x56d739['as'],'attributes':_0x56d739[_0x7f63('0x10')]};}):[]};}):[]};}):[]:[]})[_0x7f63('0x11')](function(_0x2776dc){logger[_0x7f63('0x19')](_0x7f63('0x17'),_0x4b8d89);logger[_0x7f63('0x12')]('ShowCmHopper',_0x4b8d89,JSON[_0x7f63('0x13')](_0x2776dc));_0x2fc190(_0x2776dc);})[_0x7f63('0x14')](function(_0x211535){logger['error'](_0x7f63('0x17'),_0x211535[_0x7f63('0x15')],_0x4b8d89);_0x4472b3(_0x390759['error'](0x1f4,_0x211535[_0x7f63('0x15')]));});});};exports[_0x7f63('0x1a')]=function(_0x55150a){var _0xf1b572=this;return new Promise(function(_0x22af96,_0x4815a9){return db['CmHopper'][_0x7f63('0x1b')](_0x55150a[_0x7f63('0x1c')],{'raw':_0x55150a['options']?_0x55150a[_0x7f63('0x9')][_0x7f63('0xa')]===undefined?!![]:![]:!![]})[_0x7f63('0x11')](function(_0x1f6e13){logger[_0x7f63('0x19')](_0x7f63('0x1a'),_0x55150a);logger[_0x7f63('0x12')](_0x7f63('0x1a'),_0x55150a,JSON['stringify'](_0x1f6e13));_0x22af96(_0x1f6e13);})[_0x7f63('0x14')](function(_0x2ef967){logger['error'](_0x7f63('0x1a'),_0x2ef967[_0x7f63('0x15')],_0x55150a);_0x4815a9(_0xf1b572[_0x7f63('0x16')](0x1f4,_0x2ef967[_0x7f63('0x15')]));});});};exports['UpdateCmHopper']=function(_0x23c731){var _0x5e8c15=this;return new Promise(function(_0x8c86a4,_0x9a50d3){return db[_0x7f63('0x7')][_0x7f63('0x1d')](_0x23c731[_0x7f63('0x1c')],{'raw':_0x23c731[_0x7f63('0x9')]?_0x23c731[_0x7f63('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c731[_0x7f63('0x9')]?_0x23c731[_0x7f63('0x9')][_0x7f63('0xb')]||null:null,'attributes':_0x23c731[_0x7f63('0x9')]?_0x23c731[_0x7f63('0x9')][_0x7f63('0x10')]||null:null,'limit':_0x23c731[_0x7f63('0x9')]?_0x23c731[_0x7f63('0x9')][_0x7f63('0xc')]||null:null})[_0x7f63('0x11')](function(_0x3021a6){logger[_0x7f63('0x19')]('UpdateCmHopper',_0x23c731);logger['info'](_0x7f63('0x1e'),JSON[_0x7f63('0x13')](_0x23c731['options'][_0x7f63('0xb')]),_0x23c731[_0x7f63('0x1c')][_0x7f63('0x1f')]);logger[_0x7f63('0x12')](_0x7f63('0x20'),_0x23c731,JSON[_0x7f63('0x13')](_0x3021a6));_0x8c86a4(_0x3021a6);})[_0x7f63('0x14')](function(_0xf1284a){logger[_0x7f63('0x16')](_0x7f63('0x20'),_0xf1284a[_0x7f63('0x15')],_0x23c731);_0x9a50d3(_0x5e8c15[_0x7f63('0x16')](0x1f4,_0xf1284a[_0x7f63('0x15')]));});});};exports[_0x7f63('0x21')]=function(_0x18bffd){var _0x2db427=this;return new Promise(function(_0x234698,_0xc28bb9){return db['CmHopper'][_0x7f63('0x22')]({'where':_0x18bffd[_0x7f63('0x9')]?_0x18bffd[_0x7f63('0x9')][_0x7f63('0xb')]||null:null})[_0x7f63('0x11')](function(_0x18016c){logger[_0x7f63('0x19')]('DestroyCmHopper',_0x18bffd);logger[_0x7f63('0x12')](_0x7f63('0x21'),_0x18bffd,JSON[_0x7f63('0x13')](_0x18016c));_0x234698(_0x18016c);})[_0x7f63('0x14')](function(_0x4b635e){logger[_0x7f63('0x16')](_0x7f63('0x21'),_0x4b635e[_0x7f63('0x15')],_0x18bffd);_0xc28bb9(_0x2db427[_0x7f63('0x16')](0x1f4,_0x4b635e[_0x7f63('0x15')]));});});};exports['GetContactDialer']=function(_0x397e85){var _0x41fd8f=this;return new Promise(function(_0x471d90,_0x5e305c){return db[_0x7f63('0x23')][_0x7f63('0x24')]()['then'](function(_0x543e62){return db['sequelize'][_0x7f63('0x25')](function(_0x5e2beb){return db[_0x7f63('0x7')][_0x7f63('0x8')]({'where':_0x397e85[_0x7f63('0x9')]?_0x397e85[_0x7f63('0x9')][_0x7f63('0xb')]||null:null,'attributes':_0x397e85['options']?_0x397e85[_0x7f63('0x9')]['attributes']||null:null,'limit':_0x397e85['options']?_0x397e85['options'][_0x7f63('0xc')]||null:null,'order':_0x397e85['options']?_0x397e85[_0x7f63('0x9')][_0x7f63('0x26')]||null:null,'transaction':_0x5e2beb,'lock':_0x5e2beb[_0x7f63('0x27')][_0x7f63('0x28')],'include':[{'model':db[_0x7f63('0x23')],'as':_0x7f63('0x29'),'attributes':_[_0x7f63('0x2a')](_0x543e62)},{'model':db[_0x7f63('0x2b')],'as':_0x7f63('0x2c'),'attributes':['id','name',_0x7f63('0x2d')]}]})['then'](function(_0x4bee9d){var _0x260ace=[];var _0x1edd8e=[];for(var _0x4b9112=0x0;_0x4b9112<_0x4bee9d['length'];_0x4b9112+=0x1){var _0x1e078c=_0x4bee9d[_0x4b9112][_0x7f63('0x2e')];if(_0x1e078c===null){_0x260ace[_0x7f63('0x2f')](_0x4bee9d[_0x4b9112][_0x7f63('0x1d')](_0x397e85['body'],{'transaction':_0x5e2beb}));}else if(!_0x1edd8e[_0x7f63('0x30')](_0x1e078c)){_0x1edd8e[_0x7f63('0x2f')](_0x1e078c);_0x260ace[_0x7f63('0x2f')](_0x4bee9d[_0x4b9112]['update'](_0x397e85['body'],{'transaction':_0x5e2beb}));}}return BPromise[_0x7f63('0x31')](_0x260ace);});})[_0x7f63('0x11')](function(_0x20e334){logger[_0x7f63('0x19')](_0x7f63('0x32'),_0x397e85);if(_0x20e334[_0x7f63('0x33')]>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x20e334[0x0]['dataValues']['id'],_0x20e334[0x0]['dataValues'][_0x7f63('0x34')],_0x20e334[0x0][_0x7f63('0x35')][_0x7f63('0x1f')]);}logger[_0x7f63('0x12')](_0x7f63('0x32'),_0x397e85,JSON['stringify'](_0x20e334));_0x471d90(_0x20e334);})[_0x7f63('0x14')](function(_0x3eb29f){logger['error'](_0x7f63('0x32'),_0x3eb29f[_0x7f63('0x15')],_0x397e85);_0x5e305c(_0x41fd8f[_0x7f63('0x16')](0x1f4,_0x3eb29f[_0x7f63('0x15')]));});});});};exports[_0x7f63('0x36')]=function(_0x10bd51){var _0x511d2d=this;return new Promise(function(_0x43aefc,_0x4642ee){return db[_0x7f63('0x37')][_0x7f63('0x25')](function(_0x37c8aa){return db[_0x7f63('0x38')][_0x7f63('0x1b')](_0x10bd51[_0x7f63('0x1c')],{'raw':_0x10bd51[_0x7f63('0x9')]?_0x10bd51[_0x7f63('0x9')][_0x7f63('0xa')]===undefined?!![]:![]:!![],'transaction':_0x37c8aa})[_0x7f63('0x11')](function(){logger[_0x7f63('0x19')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x7f63('0x13')](_0x10bd51[_0x7f63('0x9')][_0x7f63('0xb')]),_0x10bd51[_0x7f63('0x9')]['where'][_0x7f63('0x1f')]);return db[_0x7f63('0x7')][_0x7f63('0x22')]({'where':_0x10bd51[_0x7f63('0x9')]?_0x10bd51[_0x7f63('0x9')][_0x7f63('0xb')]||null:null,'transaction':_0x37c8aa});});})[_0x7f63('0x11')](function(_0x1a102f){logger['info'](_0x7f63('0x36'),_0x10bd51);logger[_0x7f63('0x12')](_0x7f63('0x36'),_0x10bd51,JSON[_0x7f63('0x13')](_0x1a102f));_0x43aefc(_0x1a102f);})[_0x7f63('0x14')](function(_0x15c8dc){logger[_0x7f63('0x16')](_0x7f63('0x36'),_0x15c8dc[_0x7f63('0x15')],_0x10bd51);_0x4642ee(_0x511d2d[_0x7f63('0x16')](0x1f4,_0x15c8dc['message']));});});};exports[_0x7f63('0x39')]=function(_0x4cf624){var _0x827c94=this;return new Promise(function(_0x5e32a1,_0x41453e){return db['CmHopper'][_0x7f63('0x8')]({'raw':_0x4cf624['options']?_0x4cf624[_0x7f63('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4cf624[_0x7f63('0x9')]?_0x4cf624[_0x7f63('0x9')][_0x7f63('0xb')]||null:null,'attributes':[[db[_0x7f63('0x37')]['fn']('COUNT',db[_0x7f63('0x37')]['fn']('IF',db['sequelize'][_0x7f63('0x3a')](_0x7f63('0x3b')+util['format'](_0x7f63('0x3c'),moment()[_0x7f63('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x7f63('0x3e')]]})['then'](function(_0xa4655f){logger['info'](_0x7f63('0x39'),_0x4cf624);logger['debug'](_0x7f63('0x39'),_0x4cf624,JSON[_0x7f63('0x13')](_0xa4655f));_0x5e32a1(_0xa4655f);})[_0x7f63('0x14')](function(_0x2bcdf4){logger['error'](_0x7f63('0x39'),_0x2bcdf4[_0x7f63('0x15')],_0x4cf624);_0x41453e(_0x827c94[_0x7f63('0x16')](0x1f4,_0x2bcdf4[_0x7f63('0x15')]));});});};exports['GetContactRecallMe']=function(_0x204ea3){var _0x4852d5=this;return new Promise(function(_0x3a3fa8,_0x9ad393){return db[_0x7f63('0x23')][_0x7f63('0x24')]()[_0x7f63('0x11')](function(){return db[_0x7f63('0x37')][_0x7f63('0x25')](function(_0x3930a9){return db[_0x7f63('0x7')]['findAll']({'where':_0x204ea3[_0x7f63('0x9')]?_0x204ea3['options'][_0x7f63('0xb')]||null:null,'attributes':_0x204ea3[_0x7f63('0x9')]?_0x204ea3[_0x7f63('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x204ea3[_0x7f63('0x9')]?_0x204ea3[_0x7f63('0x9')][_0x7f63('0x26')]||null:null,'group':db[_0x7f63('0x7')][_0x7f63('0x2e')],'transaction':_0x3930a9,'lock':_0x3930a9[_0x7f63('0x27')][_0x7f63('0x28')],'include':_0x204ea3[_0x7f63('0x9')]?_0x204ea3['options'][_0x7f63('0xd')]?_[_0x7f63('0xe')](_0x204ea3[_0x7f63('0x9')][_0x7f63('0xd')],function(_0x5aed25){return{'model':db[_0x5aed25[_0x7f63('0xf')]],'as':_0x5aed25['as'],'attributes':_0x5aed25['attributes'],'include':_0x5aed25['include']?_['map'](_0x5aed25[_0x7f63('0xd')],function(_0x43b7fa){return{'model':db[_0x43b7fa['model']],'as':_0x43b7fa['as'],'attributes':_0x43b7fa[_0x7f63('0x10')],'include':_0x43b7fa[_0x7f63('0xd')]?_[_0x7f63('0xe')](_0x43b7fa[_0x7f63('0xd')],function(_0x30edca){return{'model':db[_0x30edca[_0x7f63('0xf')]],'as':_0x30edca['as'],'attributes':_0x30edca[_0x7f63('0x10')]};}):[]};}):[]};}):[]:[]})[_0x7f63('0x11')](function(_0x5cfeec){var _0x2d64f3=[];for(var _0x36874f=0x0;_0x36874f<_0x5cfeec[_0x7f63('0x33')];_0x36874f+=0x1){_0x2d64f3['push'](_0x5cfeec[_0x36874f][_0x7f63('0x1d')](_0x204ea3[_0x7f63('0x1c')],{'transaction':_0x3930a9}));}return BPromise['all'](_0x2d64f3);});})['then'](function(_0x4a60e5){logger['info']('GetContactRecallMe',_0x204ea3);logger[_0x7f63('0x12')]('GetContactRecallMe',_0x204ea3,JSON['stringify'](_0x4a60e5));_0x3a3fa8(_0x4a60e5);})[_0x7f63('0x14')](function(_0x559a2f){logger[_0x7f63('0x16')](_0x7f63('0x3f'),_0x559a2f[_0x7f63('0x15')],_0x204ea3);_0x9ad393(_0x4852d5[_0x7f63('0x16')](0x1f4,_0x559a2f[_0x7f63('0x15')]));});});});};exports[_0x7f63('0x40')]=function(_0x3b1cd8){var _0x58dacd=this;return new Promise(function(_0x2bb5e8,_0x696a6d){db[_0x7f63('0x23')]['describe']()['then'](function(_0x42641b){return db[_0x7f63('0x7')][_0x7f63('0x8')]({'raw':_0x3b1cd8[_0x7f63('0x9')]?_0x3b1cd8['options'][_0x7f63('0xa')]===undefined?!![]:![]:!![],'where':_0x3b1cd8[_0x7f63('0x9')]?_0x3b1cd8[_0x7f63('0x9')][_0x7f63('0xb')]||null:null,'attributes':_0x3b1cd8[_0x7f63('0x9')]?_0x3b1cd8['options'][_0x7f63('0x10')]||null:null,'limit':_0x3b1cd8[_0x7f63('0x9')]?_0x3b1cd8[_0x7f63('0x9')][_0x7f63('0xc')]||null:null,'include':_0x3b1cd8[_0x7f63('0x9')]?_0x3b1cd8[_0x7f63('0x9')][_0x7f63('0xd')]?_['map'](_0x3b1cd8[_0x7f63('0x9')][_0x7f63('0xd')],function(_0x41339c){return{'model':db[_0x41339c[_0x7f63('0xf')]],'as':_0x41339c['as'],'attributes':_0x41339c['as']===_0x7f63('0x29')?_[_0x7f63('0x2a')](_0x42641b):_0x41339c['attributes'],'include':_0x41339c[_0x7f63('0xd')]?_['map'](_0x41339c[_0x7f63('0xd')],function(_0x526f42){return{'model':db[_0x526f42[_0x7f63('0xf')]],'as':_0x526f42['as'],'attributes':_0x526f42[_0x7f63('0x10')],'include':_0x526f42['include']?_[_0x7f63('0xe')](_0x526f42[_0x7f63('0xd')],function(_0x2c66f7){return{'model':db[_0x2c66f7['model']],'as':_0x2c66f7['as'],'attributes':_0x2c66f7[_0x7f63('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49e64f){logger[_0x7f63('0x19')](_0x7f63('0x6'),_0x3b1cd8);logger[_0x7f63('0x12')]('GetCmHopper',_0x3b1cd8,JSON[_0x7f63('0x13')](_0x49e64f));_0x2bb5e8(_0x49e64f);})[_0x7f63('0x14')](function(_0x18dcea){logger[_0x7f63('0x16')](_0x7f63('0x6'),_0x18dcea['message'],_0x3b1cd8);_0x696a6d(_0x58dacd['error'](0x1f4,_0x18dcea['message']));});});});};exports[_0x7f63('0x41')]=function(_0x34a540){var _0x2a5dfb=this;return new Promise(function(_0x2f9540,_0x5602a1){return db[_0x7f63('0x23')][_0x7f63('0x42')]({'raw':!![],'where':{'phone':_0x34a540[_0x7f63('0x9')][_0x7f63('0xb')][_0x7f63('0x43')]},'attributes':['id',_0x7f63('0x44')],'order':[['id',_0x7f63('0x45')]]})[_0x7f63('0x11')](function(_0x235f27){logger[_0x7f63('0x19')]('getContactByPhone',_0x34a540);logger[_0x7f63('0x12')]('getContactByPhone',_0x34a540,JSON[_0x7f63('0x13')](_0x235f27));_0x2f9540(_0x235f27);})[_0x7f63('0x14')](function(_0x505248){logger[_0x7f63('0x16')](_0x7f63('0x46'),_0x505248['message'],_0x34a540);_0x5602a1(_0x2a5dfb[_0x7f63('0x16')](0x1f4,_0x505248[_0x7f63('0x15')]));});});};exports[_0x7f63('0x47')]=function(_0x22778e){var _0x3c91b2=this;return new Promise(function(_0x2b8a35,_0x39bacd){return db[_0x7f63('0x37')]['transaction'](function(_0x572256){var _0x5c7def=_0x22778e[_0x7f63('0x9')]&&_0x22778e[_0x7f63('0x9')][_0x7f63('0xb')]?_0x22778e[_0x7f63('0x9')][_0x7f63('0xb')]:{};return db[_0x7f63('0x7')][_0x7f63('0x1d')](_0x22778e[_0x7f63('0x1c')],{'where':_0x5c7def,'transaction':_0x572256})[_0x7f63('0x11')](function(_0x6cd064){logger['info']('ResetActiveCalls',_0x22778e);logger[_0x7f63('0x12')](_0x7f63('0x47'),_0x22778e,JSON[_0x7f63('0x13')](_0x6cd064));_0x2b8a35(_0x6cd064);})['catch'](function(_0x48d537){logger['error']('ResetActiveCalls',_0x48d537[_0x7f63('0x15')],_0x22778e);_0x39bacd(_0x3c91b2[_0x7f63('0x16')](0x1f4,_0x48d537[_0x7f63('0x15')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x41e5bf){var _0x1a517f=this;var _0x4909d0=_0x41e5bf['body'][_0x7f63('0xb')][_0x7f63('0x48')];var _0x2a8f84=_0x41e5bf[_0x7f63('0x1c')][_0x7f63('0xb')][_0x7f63('0x49')];var _0x30ef1e=_0x41e5bf[_0x7f63('0x1c')][_0x7f63('0xb')][_0x7f63('0x4a')];return new Promise(function(_0x1023fc,_0x4569c3){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x4909d0},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal'](_0x7f63('0x4b')+_0x2a8f84+_0x7f63('0x4c')),'$gt':db[_0x7f63('0x37')][_0x7f63('0x3a')](_0x7f63('0x4d'))}},'UserId':{'$in':_0x30ef1e}},'include':[{'model':db[_0x7f63('0x23')],'as':_0x7f63('0x29')},{'model':db[_0x7f63('0x2b')],'as':_0x7f63('0x2c'),'attributes':['id',_0x7f63('0x4e'),_0x7f63('0x2d')]},{'model':db[_0x7f63('0x4f')],'as':'List'}]})[_0x7f63('0x11')](function(_0x308f14){if(_0x308f14[_0x7f63('0x33')]>0x0){return db['sequelize'][_0x7f63('0x25')](function(_0x2cc201){return db[_0x7f63('0x7')][_0x7f63('0x1d')]({'recallmeNotifiedDate':db[_0x7f63('0x37')][_0x7f63('0x3a')](_0x7f63('0x4d'))},{'where':{'id':{'$in':_[_0x7f63('0xe')](_0x308f14,'id')}},'transaction':_0x2cc201})[_0x7f63('0x11')](function(){_0x1023fc(_0x308f14);})[_0x7f63('0x14')](function(_0x1fd244){logger[_0x7f63('0x16')](_0x7f63('0x50'),_0x1fd244[_0x7f63('0x15')],_0x41e5bf);_0x4569c3(_0x1a517f[_0x7f63('0x16')](0x1f4,_0x1fd244['message']));});})[_0x7f63('0x14')](function(_0x1d2b6a){logger['error'](_0x7f63('0x50'),_0x1d2b6a['message'],_0x41e5bf);_0x4569c3(_0x1a517f['error'](0x1f4,_0x1d2b6a['message']));});}else{_0x1023fc(_0x308f14);}});});}; \ No newline at end of file +var _0x0928=['keys','User','Agent','voicePause','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','length','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','raw','attributes','limit','include','map','model','then','debug','stringify','catch','message','ShowCmHopper','CmHopper','find','where','error','CreateCmHopper','create','body','info','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','UPDATE','Contact'];(function(_0x46094e,_0x4396c1){var _0x4ee7c7=function(_0x2aefef){while(--_0x2aefef){_0x46094e['push'](_0x46094e['shift']());}};_0x4ee7c7(++_0x4396c1);}(_0x0928,0x1c1));var _0x8092=function(_0x374737,_0x5e0239){_0x374737=_0x374737-0x0;var _0x209daf=_0x0928[_0x374737];return _0x209daf;};'use strict';var _=require(_0x8092('0x0'));var util=require('util');var moment=require(_0x8092('0x1'));var BPromise=require(_0x8092('0x2'));var db=require(_0x8092('0x3'))['db'];var logger=require(_0x8092('0x4'))(_0x8092('0x5'));exports[_0x8092('0x6')]=function(_0x2ebb33){var _0x1eedd9=this;return new Promise(function(_0x10cb2a,_0x2d91b6){return db['CmHopper'][_0x8092('0x7')]({'raw':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'where':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')]['where']||null:null,'attributes':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0xa')]||null:null,'limit':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0xb')]||null:null,'include':_0x2ebb33[_0x8092('0x8')]?_0x2ebb33[_0x8092('0x8')][_0x8092('0xc')]?_['map'](_0x2ebb33[_0x8092('0x8')]['include'],function(_0x369643){return{'model':db[_0x369643['model']],'as':_0x369643['as'],'attributes':_0x369643[_0x8092('0xa')],'include':_0x369643['include']?_[_0x8092('0xd')](_0x369643[_0x8092('0xc')],function(_0x502e82){return{'model':db[_0x502e82[_0x8092('0xe')]],'as':_0x502e82['as'],'attributes':_0x502e82[_0x8092('0xa')],'include':_0x502e82[_0x8092('0xc')]?_['map'](_0x502e82['include'],function(_0x1f48f6){return{'model':db[_0x1f48f6[_0x8092('0xe')]],'as':_0x1f48f6['as'],'attributes':_0x1f48f6[_0x8092('0xa')]};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0x6103d1){logger['info'](_0x8092('0x6'),_0x2ebb33);logger[_0x8092('0x10')](_0x8092('0x6'),_0x2ebb33,JSON[_0x8092('0x11')](_0x6103d1));_0x10cb2a(_0x6103d1);})[_0x8092('0x12')](function(_0x3e72d5){logger['error'](_0x8092('0x6'),_0x3e72d5[_0x8092('0x13')],_0x2ebb33);_0x2d91b6(_0x1eedd9['error'](0x1f4,_0x3e72d5['message']));});});};exports[_0x8092('0x14')]=function(_0x2097bc){var _0x3240ed=this;return new Promise(function(_0x5c9107,_0x3bf00b){return db[_0x8092('0x15')][_0x8092('0x16')]({'raw':_0x2097bc[_0x8092('0x8')]?_0x2097bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x2097bc[_0x8092('0x8')]?_0x2097bc[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x2097bc[_0x8092('0x8')]?_0x2097bc[_0x8092('0x8')][_0x8092('0xa')]||null:null,'include':_0x2097bc['options']?_0x2097bc[_0x8092('0x8')][_0x8092('0xc')]?_['map'](_0x2097bc[_0x8092('0x8')][_0x8092('0xc')],function(_0x17a98f){return{'model':db[_0x17a98f[_0x8092('0xe')]],'as':_0x17a98f['as'],'attributes':_0x17a98f['attributes'],'include':_0x17a98f[_0x8092('0xc')]?_[_0x8092('0xd')](_0x17a98f[_0x8092('0xc')],function(_0x471df7){return{'model':db[_0x471df7[_0x8092('0xe')]],'as':_0x471df7['as'],'attributes':_0x471df7['attributes'],'include':_0x471df7[_0x8092('0xc')]?_['map'](_0x471df7[_0x8092('0xc')],function(_0x1c4241){return{'model':db[_0x1c4241[_0x8092('0xe')]],'as':_0x1c4241['as'],'attributes':_0x1c4241[_0x8092('0xa')]};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0x40b02f){logger['info'](_0x8092('0x14'),_0x2097bc);logger['debug'](_0x8092('0x14'),_0x2097bc,JSON[_0x8092('0x11')](_0x40b02f));_0x5c9107(_0x40b02f);})[_0x8092('0x12')](function(_0x508f95){logger[_0x8092('0x18')](_0x8092('0x14'),_0x508f95[_0x8092('0x13')],_0x2097bc);_0x3bf00b(_0x3240ed[_0x8092('0x18')](0x1f4,_0x508f95[_0x8092('0x13')]));});});};exports[_0x8092('0x19')]=function(_0x4a56c3){var _0x5c7a83=this;return new Promise(function(_0x1fc3d4,_0x10be3f){return db[_0x8092('0x15')][_0x8092('0x1a')](_0x4a56c3[_0x8092('0x1b')],{'raw':_0x4a56c3[_0x8092('0x8')]?_0x4a56c3[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![]})['then'](function(_0xc5549c){logger[_0x8092('0x1c')](_0x8092('0x19'),_0x4a56c3);logger[_0x8092('0x10')]('CreateCmHopper',_0x4a56c3,JSON[_0x8092('0x11')](_0xc5549c));_0x1fc3d4(_0xc5549c);})[_0x8092('0x12')](function(_0x463642){logger['error'](_0x8092('0x19'),_0x463642[_0x8092('0x13')],_0x4a56c3);_0x10be3f(_0x5c7a83[_0x8092('0x18')](0x1f4,_0x463642[_0x8092('0x13')]));});});};exports[_0x8092('0x1d')]=function(_0x108d51){var _0x41dd8b=this;return new Promise(function(_0x1992e3,_0x194fa5){return db[_0x8092('0x15')][_0x8092('0x1e')](_0x108d51['body'],{'raw':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')][_0x8092('0xa')]||null:null,'limit':_0x108d51[_0x8092('0x8')]?_0x108d51[_0x8092('0x8')]['limit']||null:null})[_0x8092('0xf')](function(_0x561cb4){logger[_0x8092('0x1c')](_0x8092('0x1d'),_0x108d51);logger[_0x8092('0x1c')](_0x8092('0x1f'),JSON[_0x8092('0x11')](_0x108d51[_0x8092('0x8')][_0x8092('0x17')]),_0x108d51['body'][_0x8092('0x20')]);logger[_0x8092('0x10')](_0x8092('0x1d'),_0x108d51,JSON[_0x8092('0x11')](_0x561cb4));_0x1992e3(_0x561cb4);})[_0x8092('0x12')](function(_0x1f74fd){logger[_0x8092('0x18')]('UpdateCmHopper',_0x1f74fd['message'],_0x108d51);_0x194fa5(_0x41dd8b[_0x8092('0x18')](0x1f4,_0x1f74fd[_0x8092('0x13')]));});});};exports['DestroyCmHopper']=function(_0x250fe9){var _0x32a444=this;return new Promise(function(_0x31994a,_0xcdb23d){return db[_0x8092('0x15')][_0x8092('0x21')]({'where':_0x250fe9[_0x8092('0x8')]?_0x250fe9[_0x8092('0x8')][_0x8092('0x17')]||null:null})[_0x8092('0xf')](function(_0x1cc268){logger[_0x8092('0x1c')](_0x8092('0x22'),_0x250fe9);logger['debug'](_0x8092('0x22'),_0x250fe9,JSON[_0x8092('0x11')](_0x1cc268));_0x31994a(_0x1cc268);})[_0x8092('0x12')](function(_0x45a659){logger['error'](_0x8092('0x22'),_0x45a659['message'],_0x250fe9);_0xcdb23d(_0x32a444[_0x8092('0x18')](0x1f4,_0x45a659[_0x8092('0x13')]));});});};exports[_0x8092('0x23')]=function(_0x15aa0a){var _0x4e25f5=this;return new Promise(function(_0x105fde,_0x59354f){return db[_0x8092('0x24')][_0x8092('0x25')]()[_0x8092('0xf')](function(_0x5b142a){return db[_0x8092('0x26')][_0x8092('0x27')](function(_0x48f031){return db['CmHopper'][_0x8092('0x7')]({'where':_0x15aa0a[_0x8092('0x8')]?_0x15aa0a[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x15aa0a[_0x8092('0x8')]?_0x15aa0a[_0x8092('0x8')]['attributes']||null:null,'limit':_0x15aa0a[_0x8092('0x8')]?_0x15aa0a[_0x8092('0x8')][_0x8092('0xb')]||null:null,'order':_0x15aa0a['options']?_0x15aa0a[_0x8092('0x8')][_0x8092('0x28')]||null:null,'transaction':_0x48f031,'lock':_0x48f031['LOCK'][_0x8092('0x29')],'include':[{'model':db[_0x8092('0x24')],'as':_0x8092('0x2a'),'attributes':_[_0x8092('0x2b')](_0x5b142a)},{'model':db[_0x8092('0x2c')],'as':_0x8092('0x2d'),'attributes':['id','name',_0x8092('0x2e')]}]})[_0x8092('0xf')](function(_0x5a2ce4){var _0x207f53=[];var _0x22799e=[];for(var _0x5c57a4=0x0;_0x5c57a4<_0x5a2ce4['length'];_0x5c57a4+=0x1){var _0x37fd0c=_0x5a2ce4[_0x5c57a4][_0x8092('0x2f')];if(_0x37fd0c===null){_0x207f53[_0x8092('0x30')](_0x5a2ce4[_0x5c57a4]['update'](_0x15aa0a[_0x8092('0x1b')],{'transaction':_0x48f031}));}else if(!_0x22799e[_0x8092('0x31')](_0x37fd0c)){_0x22799e['push'](_0x37fd0c);_0x207f53[_0x8092('0x30')](_0x5a2ce4[_0x5c57a4][_0x8092('0x1e')](_0x15aa0a[_0x8092('0x1b')],{'transaction':_0x48f031}));}}return BPromise[_0x8092('0x32')](_0x207f53);});})[_0x8092('0xf')](function(_0x53112c){logger['info']('GetContactDialer',_0x15aa0a);if(_0x53112c['length']>0x0){logger[_0x8092('0x1c')](_0x8092('0x33'),_0x53112c[0x0]['dataValues']['id'],_0x53112c[0x0][_0x8092('0x34')][_0x8092('0x35')],_0x53112c[0x0][_0x8092('0x34')][_0x8092('0x20')]);}logger[_0x8092('0x10')](_0x8092('0x23'),_0x15aa0a,JSON['stringify'](_0x53112c));_0x105fde(_0x53112c);})['catch'](function(_0x19eabd){logger['error'](_0x8092('0x23'),_0x19eabd[_0x8092('0x13')],_0x15aa0a);_0x59354f(_0x4e25f5[_0x8092('0x18')](0x1f4,_0x19eabd[_0x8092('0x13')]));});});});};exports[_0x8092('0x36')]=function(_0x47ef21){var _0x5b9572=this;return new Promise(function(_0x17fd98,_0x1c000){return db[_0x8092('0x26')][_0x8092('0x27')](function(_0x2b4d19){return db[_0x8092('0x37')]['create'](_0x47ef21[_0x8092('0x1b')],{'raw':_0x47ef21[_0x8092('0x8')]?_0x47ef21[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'transaction':_0x2b4d19})[_0x8092('0xf')](function(){logger[_0x8092('0x1c')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x47ef21['options'][_0x8092('0x17')]),_0x47ef21[_0x8092('0x8')][_0x8092('0x17')][_0x8092('0x20')]);return db['CmHopper'][_0x8092('0x21')]({'where':_0x47ef21[_0x8092('0x8')]?_0x47ef21[_0x8092('0x8')][_0x8092('0x17')]||null:null,'transaction':_0x2b4d19});});})[_0x8092('0xf')](function(_0x6104a6){logger['info'](_0x8092('0x36'),_0x47ef21);logger[_0x8092('0x10')](_0x8092('0x36'),_0x47ef21,JSON[_0x8092('0x11')](_0x6104a6));_0x17fd98(_0x6104a6);})[_0x8092('0x12')](function(_0x19cfa1){logger[_0x8092('0x18')](_0x8092('0x36'),_0x19cfa1[_0x8092('0x13')],_0x47ef21);_0x1c000(_0x5b9572['error'](0x1f4,_0x19cfa1['message']));});});};exports[_0x8092('0x38')]=function(_0xfbdf6a){var _0x374222=this;return new Promise(function(_0x304f83,_0x26fd7c){return db[_0x8092('0x15')][_0x8092('0x7')]({'raw':_0xfbdf6a[_0x8092('0x8')]?_0xfbdf6a[_0x8092('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0xfbdf6a[_0x8092('0x8')]?_0xfbdf6a[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':[[db[_0x8092('0x26')]['fn'](_0x8092('0x39'),db[_0x8092('0x26')]['fn']('IF',db['sequelize'][_0x8092('0x3a')]('`scheduledat`\x20>=\x20'+util[_0x8092('0x3b')]('\x22%s\x22',moment()[_0x8092('0x3b')](_0x8092('0x3c')))+_0x8092('0x3d')))),_0x8092('0x3e')]]})[_0x8092('0xf')](function(_0x2062b6){logger['info']('CountReScheduled',_0xfbdf6a);logger['debug'](_0x8092('0x38'),_0xfbdf6a,JSON[_0x8092('0x11')](_0x2062b6));_0x304f83(_0x2062b6);})[_0x8092('0x12')](function(_0x34c865){logger['error'](_0x8092('0x38'),_0x34c865['message'],_0xfbdf6a);_0x26fd7c(_0x374222[_0x8092('0x18')](0x1f4,_0x34c865[_0x8092('0x13')]));});});};exports[_0x8092('0x3f')]=function(_0x447ac6){var _0x305408=this;return new Promise(function(_0x3b60f9,_0x40c036){return db[_0x8092('0x24')]['describe']()[_0x8092('0xf')](function(){return db[_0x8092('0x26')][_0x8092('0x27')](function(_0x429f7a){return db['CmHopper']['findAll']({'where':_0x447ac6[_0x8092('0x8')]?_0x447ac6[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x447ac6['options']?_0x447ac6[_0x8092('0x8')][_0x8092('0xa')]||null:null,'limit':0x1,'order':_0x447ac6[_0x8092('0x8')]?_0x447ac6['options'][_0x8092('0x28')]||null:null,'group':db[_0x8092('0x15')][_0x8092('0x2f')],'transaction':_0x429f7a,'lock':_0x429f7a[_0x8092('0x40')][_0x8092('0x29')],'include':_0x447ac6[_0x8092('0x8')]?_0x447ac6[_0x8092('0x8')]['include']?_[_0x8092('0xd')](_0x447ac6[_0x8092('0x8')]['include'],function(_0x1703e3){return{'model':db[_0x1703e3[_0x8092('0xe')]],'as':_0x1703e3['as'],'attributes':_0x1703e3[_0x8092('0xa')],'include':_0x1703e3['include']?_['map'](_0x1703e3[_0x8092('0xc')],function(_0x59093d){return{'model':db[_0x59093d[_0x8092('0xe')]],'as':_0x59093d['as'],'attributes':_0x59093d[_0x8092('0xa')],'include':_0x59093d[_0x8092('0xc')]?_[_0x8092('0xd')](_0x59093d[_0x8092('0xc')],function(_0x2ea414){return{'model':db[_0x2ea414['model']],'as':_0x2ea414['as'],'attributes':_0x2ea414['attributes']};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0x3eaa24){var _0x326325=[];for(var _0x29acfe=0x0;_0x29acfe<_0x3eaa24[_0x8092('0x41')];_0x29acfe+=0x1){_0x326325[_0x8092('0x30')](_0x3eaa24[_0x29acfe][_0x8092('0x1e')](_0x447ac6['body'],{'transaction':_0x429f7a}));}return BPromise['all'](_0x326325);});})[_0x8092('0xf')](function(_0x1a10e5){logger[_0x8092('0x1c')](_0x8092('0x3f'),_0x447ac6);logger[_0x8092('0x10')](_0x8092('0x3f'),_0x447ac6,JSON['stringify'](_0x1a10e5));_0x3b60f9(_0x1a10e5);})[_0x8092('0x12')](function(_0x4ea3ee){logger[_0x8092('0x18')]('GetContactRecallMe',_0x4ea3ee['message'],_0x447ac6);_0x40c036(_0x305408[_0x8092('0x18')](0x1f4,_0x4ea3ee[_0x8092('0x13')]));});});});};exports[_0x8092('0x42')]=function(_0x3473ae){var _0x195a0c=this;return new Promise(function(_0x43e8f4,_0x3c54fe){db[_0x8092('0x24')][_0x8092('0x25')]()[_0x8092('0xf')](function(_0x8ca86e){return db[_0x8092('0x15')][_0x8092('0x7')]({'raw':_0x3473ae[_0x8092('0x8')]?_0x3473ae[_0x8092('0x8')][_0x8092('0x9')]===undefined?!![]:![]:!![],'where':_0x3473ae['options']?_0x3473ae[_0x8092('0x8')][_0x8092('0x17')]||null:null,'attributes':_0x3473ae['options']?_0x3473ae['options'][_0x8092('0xa')]||null:null,'limit':_0x3473ae[_0x8092('0x8')]?_0x3473ae[_0x8092('0x8')][_0x8092('0xb')]||null:null,'include':_0x3473ae['options']?_0x3473ae[_0x8092('0x8')]['include']?_['map'](_0x3473ae[_0x8092('0x8')][_0x8092('0xc')],function(_0x1f2940){return{'model':db[_0x1f2940[_0x8092('0xe')]],'as':_0x1f2940['as'],'attributes':_0x1f2940['as']===_0x8092('0x2a')?_[_0x8092('0x2b')](_0x8ca86e):_0x1f2940[_0x8092('0xa')],'include':_0x1f2940[_0x8092('0xc')]?_[_0x8092('0xd')](_0x1f2940[_0x8092('0xc')],function(_0x5c356b){return{'model':db[_0x5c356b[_0x8092('0xe')]],'as':_0x5c356b['as'],'attributes':_0x5c356b[_0x8092('0xa')],'include':_0x5c356b['include']?_[_0x8092('0xd')](_0x5c356b['include'],function(_0x47b24d){return{'model':db[_0x47b24d[_0x8092('0xe')]],'as':_0x47b24d['as'],'attributes':_0x47b24d[_0x8092('0xa')]};}):[]};}):[]};}):[]:[]})[_0x8092('0xf')](function(_0xbb689c){logger[_0x8092('0x1c')](_0x8092('0x6'),_0x3473ae);logger[_0x8092('0x10')]('GetCmHopper',_0x3473ae,JSON[_0x8092('0x11')](_0xbb689c));_0x43e8f4(_0xbb689c);})[_0x8092('0x12')](function(_0x4eb358){logger['error']('GetCmHopper',_0x4eb358[_0x8092('0x13')],_0x3473ae);_0x3c54fe(_0x195a0c['error'](0x1f4,_0x4eb358[_0x8092('0x13')]));});});});};exports[_0x8092('0x43')]=function(_0x58f9fa){var _0x3a62c4=this;return new Promise(function(_0x5e98fa,_0x26e10c){return db[_0x8092('0x24')][_0x8092('0x44')]({'raw':!![],'where':{'phone':_0x58f9fa['options'][_0x8092('0x17')][_0x8092('0x45')]},'attributes':['id',_0x8092('0x46')],'order':[['id',_0x8092('0x47')]]})[_0x8092('0xf')](function(_0x774669){logger[_0x8092('0x1c')](_0x8092('0x48'),_0x58f9fa);logger[_0x8092('0x10')](_0x8092('0x48'),_0x58f9fa,JSON[_0x8092('0x11')](_0x774669));_0x5e98fa(_0x774669);})['catch'](function(_0x167c45){logger[_0x8092('0x18')](_0x8092('0x48'),_0x167c45[_0x8092('0x13')],_0x58f9fa);_0x26e10c(_0x3a62c4[_0x8092('0x18')](0x1f4,_0x167c45[_0x8092('0x13')]));});});};exports[_0x8092('0x49')]=function(_0x348746){var _0x4e880e=this;return new Promise(function(_0x42e08a,_0x1a037e){return db['sequelize'][_0x8092('0x27')](function(_0x4c2773){var _0x3c6cbb=_0x348746[_0x8092('0x8')]&&_0x348746[_0x8092('0x8')][_0x8092('0x17')]?_0x348746[_0x8092('0x8')][_0x8092('0x17')]:{};return db['CmHopper'][_0x8092('0x1e')](_0x348746[_0x8092('0x1b')],{'where':_0x3c6cbb,'transaction':_0x4c2773})[_0x8092('0xf')](function(_0x46462a){logger[_0x8092('0x1c')]('ResetActiveCalls',_0x348746);logger[_0x8092('0x10')](_0x8092('0x49'),_0x348746,JSON[_0x8092('0x11')](_0x46462a));_0x42e08a(_0x46462a);})[_0x8092('0x12')](function(_0x30cab3){logger[_0x8092('0x18')](_0x8092('0x49'),_0x30cab3['message'],_0x348746);_0x1a037e(_0x4e880e[_0x8092('0x18')](0x1f4,_0x30cab3[_0x8092('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x598201){var _0x597762=this;var _0x4f39e9=_0x598201[_0x8092('0x1b')][_0x8092('0x17')][_0x8092('0x4a')];var _0x363db2=_0x598201[_0x8092('0x1b')][_0x8092('0x17')]['interval'];var _0x4d7bf2=_0x598201[_0x8092('0x1b')][_0x8092('0x17')][_0x8092('0x4b')];return new Promise(function(_0x341959,_0x5a3576){return db[_0x8092('0x15')][_0x8092('0x7')]({'where':{'voiceQueueId':{'$in':_0x4f39e9},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x8092('0x26')][_0x8092('0x3a')](_0x8092('0x4c')+_0x363db2+_0x8092('0x4d')),'$gt':db[_0x8092('0x26')][_0x8092('0x3a')]('NOW()')}},'UserId':{'$in':_0x4d7bf2}},'include':[{'model':db['CmContact'],'as':_0x8092('0x2a')},{'model':db[_0x8092('0x2c')],'as':'Agent','attributes':['id',_0x8092('0x4e'),'voicePause']},{'model':db[_0x8092('0x4f')],'as':_0x8092('0x50')}]})[_0x8092('0xf')](function(_0x2d9fbc){if(_0x2d9fbc[_0x8092('0x41')]>0x0){return db[_0x8092('0x26')]['transaction'](function(_0x305095){return db[_0x8092('0x15')][_0x8092('0x1e')]({'recallmeNotifiedDate':db[_0x8092('0x26')][_0x8092('0x3a')]('NOW()')},{'where':{'id':{'$in':_[_0x8092('0xd')](_0x2d9fbc,'id')}},'transaction':_0x305095})[_0x8092('0xf')](function(){_0x341959(_0x2d9fbc);})['catch'](function(_0x272efa){logger[_0x8092('0x18')](_0x8092('0x51'),_0x272efa['message'],_0x598201);_0x5a3576(_0x597762['error'](0x1f4,_0x272efa['message']));});})['catch'](function(_0x21010e){logger[_0x8092('0x18')](_0x8092('0x51'),_0x21010e[_0x8092('0x13')],_0x598201);_0x5a3576(_0x597762[_0x8092('0x18')](0x1f4,_0x21010e[_0x8092('0x13')]));});}else{_0x341959(_0x2d9fbc);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 87507c4..e3daabc 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 _0x33c0=['get','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router','./cmHopper.controller'];(function(_0x3d8ebd,_0x261de9){var _0x579b18=function(_0x3e77f8){while(--_0x3e77f8){_0x3d8ebd['push'](_0x3d8ebd['shift']());}};_0x579b18(++_0x261de9);}(_0x33c0,0x105));var _0x033c=function(_0xf769c6,_0x405ac5){_0xf769c6=_0xf769c6-0x0;var _0x1a3985=_0x33c0[_0xf769c6];return _0x1a3985;};'use strict';var express=require(_0x033c('0x0'));var router=express[_0x033c('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x033c('0x2'));router[_0x033c('0x3')]('/',auth[_0x033c('0x4')](),controller['index']);router[_0x033c('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x033c('0x5')]);router[_0x033c('0x3')](_0x033c('0x6'),auth['isAuthenticated'](),controller[_0x033c('0x7')]);router[_0x033c('0x3')]('/timezones',auth['isAuthenticated'](),controller['getTimezones']);router[_0x033c('0x3')](_0x033c('0x8'),auth[_0x033c('0x4')](),controller[_0x033c('0x9')]);router['get'](_0x033c('0xa'),auth['isAuthenticated'](),controller[_0x033c('0xb')]);router[_0x033c('0xc')]('/',auth[_0x033c('0x4')](),controller[_0x033c('0xd')]);router['post']('/preview',auth['isAuthenticated'](),controller[_0x033c('0xe')]);router[_0x033c('0xc')](_0x033c('0xf'),auth['isAuthenticated'](),controller[_0x033c('0x10')]);router[_0x033c('0x11')](_0x033c('0x8'),auth[_0x033c('0x4')](),controller[_0x033c('0x12')]);router[_0x033c('0x13')](_0x033c('0x8'),auth['isAuthenticated'](),controller[_0x033c('0x14')]);module[_0x033c('0x15')]=router; \ No newline at end of file +var _0x4319=['getPreviewRecall','create','post','/preview','getPreview','/timezone','update','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','index','/describe','isAuthenticated','/opencontacts','/timezones','getTimezones','/:id','show','/:id/previewrecall'];(function(_0x5821f6,_0x5a40b0){var _0x1fb034=function(_0x5dcf91){while(--_0x5dcf91){_0x5821f6['push'](_0x5821f6['shift']());}};_0x1fb034(++_0x5a40b0);}(_0x4319,0x18a));var _0x9431=function(_0x577077,_0x52f056){_0x577077=_0x577077-0x0;var _0x370769=_0x4319[_0x577077];return _0x370769;};'use strict';var express=require(_0x9431('0x0'));var router=express[_0x9431('0x1')]();var auth=require(_0x9431('0x2'));var controller=require(_0x9431('0x3'));router[_0x9431('0x4')]('/',auth['isAuthenticated'](),controller[_0x9431('0x5')]);router['get'](_0x9431('0x6'),auth[_0x9431('0x7')](),controller['describe']);router[_0x9431('0x4')](_0x9431('0x8'),auth[_0x9431('0x7')](),controller['getOpenContacts']);router[_0x9431('0x4')](_0x9431('0x9'),auth[_0x9431('0x7')](),controller[_0x9431('0xa')]);router[_0x9431('0x4')](_0x9431('0xb'),auth[_0x9431('0x7')](),controller[_0x9431('0xc')]);router[_0x9431('0x4')](_0x9431('0xd'),auth[_0x9431('0x7')](),controller[_0x9431('0xe')]);router['post']('/',auth[_0x9431('0x7')](),controller[_0x9431('0xf')]);router[_0x9431('0x10')](_0x9431('0x11'),auth[_0x9431('0x7')](),controller[_0x9431('0x12')]);router[_0x9431('0x10')](_0x9431('0x13'),auth['isAuthenticated'](),controller['getTimezone']);router['put'](_0x9431('0xb'),auth[_0x9431('0x7')](),controller[_0x9431('0x14')]);router[_0x9431('0x15')](_0x9431('0xb'),auth[_0x9431('0x7')](),controller[_0x9431('0x16')]);module[_0x9431('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 5d33307..cf3ecc1 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 _0x8df3=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE','format'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8df3,0xa1));var _0x38df=function(_0x1e48e8,_0xfbf9ad){_0x1e48e8=_0x1e48e8-0x0;var _0x59c3a7=_0x8df3[_0x1e48e8];return _0x59c3a7;};'use strict';var moment=require(_0x38df('0x0'));var Sequelize=require(_0x38df('0x1'));module[_0x38df('0x2')]={'CmHopperId':{'type':Sequelize[_0x38df('0x3')]},'phone':{'type':Sequelize[_0x38df('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x38df('0x5')],'defaultValue':moment()[_0x38df('0x6')](_0x38df('0x7'))},'countbusyretry':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x38df('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf8ee=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','INTEGER'];(function(_0x2e0aef,_0x3a7819){var _0x5927a3=function(_0x17521d){while(--_0x17521d){_0x2e0aef['push'](_0x2e0aef['shift']());}};_0x5927a3(++_0x3a7819);}(_0xf8ee,0x12e));var _0xef8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf8ee[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0xef8e('0x0'));module[_0xef8e('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xef8e('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xef8e('0x4')](_0xef8e('0x5'))},'countbusyretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xef8e('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index c953cc8..a1f56b0 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 _0x7267=['UserProfileSection','autoAssociation','UserProfileResource','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','get','error','name','send','map','CmHopperAdditionalPhone','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role'];(function(_0xd3a2d4,_0x5bb765){var _0x13c744=function(_0x57fe46){while(--_0x57fe46){_0xd3a2d4['push'](_0xd3a2d4['shift']());}};_0x13c744(++_0x5bb765);}(_0x7267,0x143));var _0x7726=function(_0x4199c7,_0x10baf2){_0x4199c7=_0x4199c7-0x0;var _0x120079=_0x7267[_0x4199c7];return _0x120079;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7726('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7726('0x1'));var rp=require(_0x7726('0x2'));var moment=require(_0x7726('0x3'));var BPromise=require(_0x7726('0x4'));var Mustache=require('mustache');var util=require(_0x7726('0x5'));var path=require(_0x7726('0x6'));var sox=require(_0x7726('0x7'));var csv=require(_0x7726('0x8'));var ejs=require(_0x7726('0x9'));var fs=require('fs');var fs_extra=require(_0x7726('0xa'));var _=require(_0x7726('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7726('0xc'));var deskjs=require(_0x7726('0xd'));var toCsv=require(_0x7726('0x8'));var querystring=require(_0x7726('0xe'));var Papa=require('papaparse');var Redis=require(_0x7726('0xf'));var authService=require(_0x7726('0x10'));var qs=require(_0x7726('0x11'));var as=require(_0x7726('0x12'));var hardwareService=require(_0x7726('0x13'));var logger=require('../../config/logger')(_0x7726('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7726('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x413ecb,_0x5ac6d5){_0x5ac6d5=_0x5ac6d5||0xcc;return function(_0x5ac075){if(_0x5ac075){return _0x413ecb[_0x7726('0x16')](_0x5ac6d5);}return _0x413ecb[_0x7726('0x17')](_0x5ac6d5)[_0x7726('0x18')]();};}function respondWithResult(_0x28710d,_0xf365f6){_0xf365f6=_0xf365f6||0xc8;return function(_0x2de831){if(_0x2de831){return _0x28710d[_0x7726('0x17')](_0xf365f6)[_0x7726('0x19')](_0x2de831);}};}function respondWithFilteredResult(_0x1eec89,_0x49bd0e){return function(_0x8cee75){if(_0x8cee75){var _0x3436da=typeof _0x49bd0e[_0x7726('0x1a')]===_0x7726('0x1b')&&typeof _0x49bd0e[_0x7726('0x1c')]===_0x7726('0x1b');var _0x111ba6=_0x8cee75['count'];var _0x1b79ec=_0x3436da?0x0:_0x49bd0e['offset'];var _0x518627=_0x3436da?_0x8cee75['count']:_0x49bd0e[_0x7726('0x1a')]+_0x49bd0e['limit'];var _0x2533fb;if(_0x518627>=_0x111ba6){_0x518627=_0x111ba6;_0x2533fb=0xc8;}else{_0x2533fb=0xce;}_0x1eec89['status'](_0x2533fb);return _0x1eec89[_0x7726('0x1d')](_0x7726('0x1e'),_0x1b79ec+'-'+_0x518627+'/'+_0x111ba6)['json'](_0x8cee75);}return null;};}function patchUpdates(_0xd7d979){return function(_0x522cff){try{jsonpatch[_0x7726('0x1f')](_0x522cff,_0xd7d979,!![]);}catch(_0x3997e5){return BPromise[_0x7726('0x20')](_0x3997e5);}return _0x522cff['save']();};}function saveUpdates(_0x780347,_0x2c28f4){return function(_0x5dcdac){if(_0x5dcdac){return _0x5dcdac[_0x7726('0x21')](_0x780347)[_0x7726('0x22')](function(_0x3a5a1c){return _0x3a5a1c;});}return null;};}function removeEntity(_0x5f3e4b,_0x20deee){return function(_0x2b4cf6){if(_0x2b4cf6){return _0x2b4cf6[_0x7726('0x23')]()[_0x7726('0x22')](function(){var _0x4b5b83=_0x2b4cf6[_0x7726('0x24')]({'plain':!![]});var _0x135b1f='CmHopperAdditionalPhones';return db['UserProfileResource'][_0x7726('0x23')]({'where':{'type':_0x135b1f,'resourceId':_0x4b5b83['id']}})[_0x7726('0x22')](function(){return _0x2b4cf6;});})[_0x7726('0x22')](function(){_0x5f3e4b[_0x7726('0x17')](0xcc)[_0x7726('0x18')]();});}};}function handleEntityNotFound(_0x7f703c,_0x347560){return function(_0x3362cb){if(!_0x3362cb){_0x7f703c[_0x7726('0x16')](0x194);}return _0x3362cb;};}function handleError(_0x360aa7,_0x975963){_0x975963=_0x975963||0x1f4;return function(_0xe69c73){logger[_0x7726('0x25')](_0xe69c73['stack']);if(_0xe69c73[_0x7726('0x26')]){delete _0xe69c73[_0x7726('0x26')];}_0x360aa7[_0x7726('0x17')](_0x975963)[_0x7726('0x27')](_0xe69c73);};}exports['index']=function(_0x1d0cb5,_0x500955){var _0x903f1={},_0xf65552={},_0x59ef78={'count':0x0,'rows':[]};var _0xf4b13e=_[_0x7726('0x28')](db[_0x7726('0x29')]['rawAttributes'],function(_0x1a2cfa){return{'name':_0x1a2cfa[_0x7726('0x2a')],'type':_0x1a2cfa['type'][_0x7726('0x2b')]};});_0xf65552[_0x7726('0x2c')]=_[_0x7726('0x28')](_0xf4b13e,'name');_0xf65552['query']=_[_0x7726('0x2d')](_0x1d0cb5[_0x7726('0x2e')]);_0xf65552['filters']=_['intersection'](_0xf65552[_0x7726('0x2c')],_0xf65552[_0x7726('0x2e')]);_0x903f1[_0x7726('0x2f')]=_[_0x7726('0x30')](_0xf65552[_0x7726('0x2c')],qs[_0x7726('0x31')](_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x31')]));_0x903f1[_0x7726('0x2f')]=_0x903f1[_0x7726('0x2f')][_0x7726('0x32')]?_0x903f1[_0x7726('0x2f')]:_0xf65552[_0x7726('0x2c')];if(!_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x33')](_0x7726('0x34'))){_0x903f1[_0x7726('0x1c')]=qs['limit'](_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x1c')]);_0x903f1[_0x7726('0x1a')]=qs[_0x7726('0x1a')](_0x1d0cb5['query'][_0x7726('0x1a')]);}_0x903f1[_0x7726('0x35')]=qs[_0x7726('0x36')](_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x36')]);_0x903f1['where']=qs['filters'](_[_0x7726('0x37')](_0x1d0cb5[_0x7726('0x2e')],_0xf65552[_0x7726('0x38')]),_0xf4b13e);if(_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x39')]){_0x903f1[_0x7726('0x3a')]=_['merge'](_0x903f1[_0x7726('0x3a')],{'$or':_[_0x7726('0x28')](_0xf4b13e,function(_0x552dda){if(_0x552dda[_0x7726('0x3b')]!==_0x7726('0x3c')){var _0xc3b54c={};_0xc3b54c[_0x552dda[_0x7726('0x26')]]={'$like':'%'+_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x39')]+'%'};return _0xc3b54c;}})});}_0x903f1=_[_0x7726('0x3d')]({},_0x903f1,_0x1d0cb5[_0x7726('0x3e')]);var _0x1c02d4={'where':_0x903f1[_0x7726('0x3a')]};return db[_0x7726('0x29')][_0x7726('0x3f')](_0x1c02d4)['then'](function(_0x14531b){_0x59ef78[_0x7726('0x3f')]=_0x14531b;if(_0x1d0cb5[_0x7726('0x2e')][_0x7726('0x40')]){_0x903f1[_0x7726('0x41')]=[{'all':!![]}];}return db[_0x7726('0x29')][_0x7726('0x42')](_0x903f1);})[_0x7726('0x22')](function(_0x29be1d){_0x59ef78[_0x7726('0x43')]=_0x29be1d;return _0x59ef78;})[_0x7726('0x22')](respondWithFilteredResult(_0x500955,_0x903f1))[_0x7726('0x44')](handleError(_0x500955,null));};exports[_0x7726('0x45')]=function(_0x5b33ba,_0x4e72df){var _0x2ecbca={'raw':!![],'where':{'id':_0x5b33ba[_0x7726('0x46')]['id']}},_0x7f4464={};_0x7f4464[_0x7726('0x2c')]=_[_0x7726('0x2d')](db[_0x7726('0x29')][_0x7726('0x47')]);_0x7f4464[_0x7726('0x2e')]=_[_0x7726('0x2d')](_0x5b33ba[_0x7726('0x2e')]);_0x7f4464[_0x7726('0x38')]=_[_0x7726('0x30')](_0x7f4464[_0x7726('0x2c')],_0x7f4464[_0x7726('0x2e')]);_0x2ecbca[_0x7726('0x2f')]=_[_0x7726('0x30')](_0x7f4464[_0x7726('0x2c')],qs[_0x7726('0x31')](_0x5b33ba[_0x7726('0x2e')][_0x7726('0x31')]));_0x2ecbca[_0x7726('0x2f')]=_0x2ecbca[_0x7726('0x2f')]['length']?_0x2ecbca[_0x7726('0x2f')]:_0x7f4464['model'];if(_0x5b33ba[_0x7726('0x2e')]['includeAll']){_0x2ecbca[_0x7726('0x41')]=[{'all':!![]}];}_0x2ecbca=_[_0x7726('0x3d')]({},_0x2ecbca,_0x5b33ba[_0x7726('0x3e')]);return db['CmHopperAdditionalPhone'][_0x7726('0x48')](_0x2ecbca)[_0x7726('0x22')](handleEntityNotFound(_0x4e72df,null))['then'](respondWithResult(_0x4e72df,null))[_0x7726('0x44')](handleError(_0x4e72df,null));};exports[_0x7726('0x49')]=function(_0x17f3ee,_0x4d5e32){return db[_0x7726('0x29')]['create'](_0x17f3ee[_0x7726('0x4a')],{})[_0x7726('0x22')](function(_0x2183b3){var _0x1598b1=_0x17f3ee[_0x7726('0x4b')][_0x7726('0x24')]({'plain':!![]});if(!_0x1598b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1598b1[_0x7726('0x4c')]===_0x7726('0x4b')){var _0x2299c1=_0x2183b3[_0x7726('0x24')]({'plain':!![]});var _0x91a869='CmHopperAdditionalPhones';return db[_0x7726('0x4d')][_0x7726('0x48')]({'where':{'name':_0x91a869,'userProfileId':_0x1598b1['userProfileId']},'raw':!![]})[_0x7726('0x22')](function(_0x3443db){if(_0x3443db&&_0x3443db[_0x7726('0x4e')]===0x0){return db[_0x7726('0x4f')][_0x7726('0x49')]({'name':_0x2299c1[_0x7726('0x26')],'resourceId':_0x2299c1['id'],'type':_0x3443db[_0x7726('0x26')],'sectionId':_0x3443db['id']},{})[_0x7726('0x22')](function(){return _0x2183b3;});}else{return _0x2183b3;}})[_0x7726('0x44')](function(_0x672eb9){logger[_0x7726('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x672eb9);throw _0x672eb9;});}return _0x2183b3;})[_0x7726('0x22')](respondWithResult(_0x4d5e32,0xc9))[_0x7726('0x44')](handleError(_0x4d5e32,null));};exports[_0x7726('0x21')]=function(_0x16cc85,_0xc0e4cc){if(_0x16cc85[_0x7726('0x4a')]['id']){delete _0x16cc85[_0x7726('0x4a')]['id'];}return db[_0x7726('0x29')][_0x7726('0x48')]({'where':{'id':_0x16cc85[_0x7726('0x46')]['id']}})[_0x7726('0x22')](handleEntityNotFound(_0xc0e4cc,null))[_0x7726('0x22')](saveUpdates(_0x16cc85[_0x7726('0x4a')],null))[_0x7726('0x22')](respondWithResult(_0xc0e4cc,null))[_0x7726('0x44')](handleError(_0xc0e4cc,null));};exports['destroy']=function(_0x4090d8,_0x300ac5){return db[_0x7726('0x29')][_0x7726('0x48')]({'where':{'id':_0x4090d8[_0x7726('0x46')]['id']}})[_0x7726('0x22')](handleEntityNotFound(_0x300ac5,null))[_0x7726('0x22')](removeEntity(_0x300ac5,null))[_0x7726('0x44')](handleError(_0x300ac5,null));}; \ No newline at end of file +var _0xde7f=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','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'];(function(_0x225b38,_0x56f90c){var _0x279027=function(_0x293529){while(--_0x293529){_0x225b38['push'](_0x225b38['shift']());}};_0x279027(++_0x56f90c);}(_0xde7f,0x1a3));var _0xfde7=function(_0x4c103b,_0x289328){_0x4c103b=_0x4c103b-0x0;var _0x251473=_0xde7f[_0x4c103b];return _0x251473;};'use strict';var emlformat=require(_0xfde7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfde7('0x1'));var jsonpatch=require(_0xfde7('0x2'));var rp=require('request-promise');var moment=require(_0xfde7('0x3'));var BPromise=require(_0xfde7('0x4'));var Mustache=require(_0xfde7('0x5'));var util=require(_0xfde7('0x6'));var path=require(_0xfde7('0x7'));var sox=require(_0xfde7('0x8'));var csv=require(_0xfde7('0x9'));var ejs=require(_0xfde7('0xa'));var fs=require('fs');var fs_extra=require(_0xfde7('0xb'));var _=require(_0xfde7('0xc'));var squel=require(_0xfde7('0xd'));var crypto=require('crypto');var jsforce=require(_0xfde7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfde7('0xf'));var authService=require(_0xfde7('0x10'));var qs=require(_0xfde7('0x11'));var as=require(_0xfde7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfde7('0x13'))(_0xfde7('0x14'));var utils=require(_0xfde7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfde7('0x16'));var db=require(_0xfde7('0x17'))['db'];function respondWithStatusCode(_0x54c8cc,_0x5832cd){_0x5832cd=_0x5832cd||0xcc;return function(_0x45f4b7){if(_0x45f4b7){return _0x54c8cc[_0xfde7('0x18')](_0x5832cd);}return _0x54c8cc[_0xfde7('0x19')](_0x5832cd)[_0xfde7('0x1a')]();};}function respondWithResult(_0x31dd3c,_0x459418){_0x459418=_0x459418||0xc8;return function(_0x2ae69b){if(_0x2ae69b){return _0x31dd3c[_0xfde7('0x19')](_0x459418)[_0xfde7('0x1b')](_0x2ae69b);}};}function respondWithFilteredResult(_0x251143,_0x5b8814){return function(_0x3b5798){if(_0x3b5798){var _0x408627=typeof _0x5b8814['offset']===_0xfde7('0x1c')&&typeof _0x5b8814['limit']===_0xfde7('0x1c');var _0x5144c8=_0x3b5798[_0xfde7('0x1d')];var _0x5691f1=_0x408627?0x0:_0x5b8814[_0xfde7('0x1e')];var _0x100a4a=_0x408627?_0x3b5798['count']:_0x5b8814[_0xfde7('0x1e')]+_0x5b8814[_0xfde7('0x1f')];var _0x7c0934;if(_0x100a4a>=_0x5144c8){_0x100a4a=_0x5144c8;_0x7c0934=0xc8;}else{_0x7c0934=0xce;}_0x251143[_0xfde7('0x19')](_0x7c0934);return _0x251143['set'](_0xfde7('0x20'),_0x5691f1+'-'+_0x100a4a+'/'+_0x5144c8)[_0xfde7('0x1b')](_0x3b5798);}return null;};}function patchUpdates(_0x3cd233){return function(_0x2824be){try{jsonpatch[_0xfde7('0x21')](_0x2824be,_0x3cd233,!![]);}catch(_0x4c973a){return BPromise[_0xfde7('0x22')](_0x4c973a);}return _0x2824be[_0xfde7('0x23')]();};}function saveUpdates(_0x450d84,_0x46ca24){return function(_0x381b60){if(_0x381b60){return _0x381b60[_0xfde7('0x24')](_0x450d84)[_0xfde7('0x25')](function(_0x423aea){return _0x423aea;});}return null;};}function removeEntity(_0x4054e7,_0x3ee744){return function(_0x51c30f){if(_0x51c30f){return _0x51c30f[_0xfde7('0x26')]()[_0xfde7('0x25')](function(){var _0x280260=_0x51c30f[_0xfde7('0x27')]({'plain':!![]});var _0x50ce38=_0xfde7('0x28');return db[_0xfde7('0x29')][_0xfde7('0x26')]({'where':{'type':_0x50ce38,'resourceId':_0x280260['id']}})['then'](function(){return _0x51c30f;});})['then'](function(){_0x4054e7['status'](0xcc)[_0xfde7('0x1a')]();});}};}function handleEntityNotFound(_0x13f84d,_0x101ca1){return function(_0x48f225){if(!_0x48f225){_0x13f84d[_0xfde7('0x18')](0x194);}return _0x48f225;};}function handleError(_0x41b19c,_0x48e955){_0x48e955=_0x48e955||0x1f4;return function(_0x3ccd8f){logger[_0xfde7('0x2a')](_0x3ccd8f[_0xfde7('0x2b')]);if(_0x3ccd8f[_0xfde7('0x2c')]){delete _0x3ccd8f[_0xfde7('0x2c')];}_0x41b19c['status'](_0x48e955)[_0xfde7('0x2d')](_0x3ccd8f);};}exports[_0xfde7('0x2e')]=function(_0x2f8789,_0x15921f){var _0x3cb46c={},_0x463a8a={},_0x3cdcfd={'count':0x0,'rows':[]};var _0x50101e=_['map'](db[_0xfde7('0x2f')][_0xfde7('0x30')],function(_0x206116){return{'name':_0x206116[_0xfde7('0x31')],'type':_0x206116[_0xfde7('0x32')][_0xfde7('0x33')]};});_0x463a8a[_0xfde7('0x34')]=_[_0xfde7('0x35')](_0x50101e,_0xfde7('0x2c'));_0x463a8a['query']=_['keys'](_0x2f8789[_0xfde7('0x36')]);_0x463a8a['filters']=_['intersection'](_0x463a8a[_0xfde7('0x34')],_0x463a8a[_0xfde7('0x36')]);_0x3cb46c[_0xfde7('0x37')]=_[_0xfde7('0x38')](_0x463a8a[_0xfde7('0x34')],qs[_0xfde7('0x39')](_0x2f8789[_0xfde7('0x36')]['fields']));_0x3cb46c[_0xfde7('0x37')]=_0x3cb46c['attributes']['length']?_0x3cb46c[_0xfde7('0x37')]:_0x463a8a[_0xfde7('0x34')];if(!_0x2f8789[_0xfde7('0x36')][_0xfde7('0x3a')]('nolimit')){_0x3cb46c[_0xfde7('0x1f')]=qs['limit'](_0x2f8789[_0xfde7('0x36')][_0xfde7('0x1f')]);_0x3cb46c['offset']=qs[_0xfde7('0x1e')](_0x2f8789[_0xfde7('0x36')][_0xfde7('0x1e')]);}_0x3cb46c[_0xfde7('0x3b')]=qs[_0xfde7('0x3c')](_0x2f8789['query'][_0xfde7('0x3c')]);_0x3cb46c[_0xfde7('0x3d')]=qs[_0xfde7('0x3e')](_[_0xfde7('0x3f')](_0x2f8789[_0xfde7('0x36')],_0x463a8a[_0xfde7('0x3e')]),_0x50101e);if(_0x2f8789[_0xfde7('0x36')][_0xfde7('0x40')]){_0x3cb46c[_0xfde7('0x3d')]=_[_0xfde7('0x41')](_0x3cb46c[_0xfde7('0x3d')],{'$or':_[_0xfde7('0x35')](_0x50101e,function(_0x5e1698){if(_0x5e1698[_0xfde7('0x32')]!==_0xfde7('0x42')){var _0x4f1ed0={};_0x4f1ed0[_0x5e1698[_0xfde7('0x2c')]]={'$like':'%'+_0x2f8789['query']['filter']+'%'};return _0x4f1ed0;}})});}_0x3cb46c=_[_0xfde7('0x41')]({},_0x3cb46c,_0x2f8789[_0xfde7('0x43')]);var _0x58baa4={'where':_0x3cb46c[_0xfde7('0x3d')]};return db['CmHopperAdditionalPhone']['count'](_0x58baa4)[_0xfde7('0x25')](function(_0x20d644){_0x3cdcfd[_0xfde7('0x1d')]=_0x20d644;if(_0x2f8789[_0xfde7('0x36')][_0xfde7('0x44')]){_0x3cb46c[_0xfde7('0x45')]=[{'all':!![]}];}return db[_0xfde7('0x2f')][_0xfde7('0x46')](_0x3cb46c);})['then'](function(_0x1d75a6){_0x3cdcfd[_0xfde7('0x47')]=_0x1d75a6;return _0x3cdcfd;})[_0xfde7('0x25')](respondWithFilteredResult(_0x15921f,_0x3cb46c))[_0xfde7('0x48')](handleError(_0x15921f,null));};exports[_0xfde7('0x49')]=function(_0x2f1f25,_0x1805c1){var _0x418807={'raw':!![],'where':{'id':_0x2f1f25[_0xfde7('0x4a')]['id']}},_0x2120d5={};_0x2120d5[_0xfde7('0x34')]=_[_0xfde7('0x4b')](db[_0xfde7('0x2f')]['rawAttributes']);_0x2120d5['query']=_[_0xfde7('0x4b')](_0x2f1f25[_0xfde7('0x36')]);_0x2120d5[_0xfde7('0x3e')]=_['intersection'](_0x2120d5[_0xfde7('0x34')],_0x2120d5['query']);_0x418807[_0xfde7('0x37')]=_[_0xfde7('0x38')](_0x2120d5['model'],qs[_0xfde7('0x39')](_0x2f1f25[_0xfde7('0x36')][_0xfde7('0x39')]));_0x418807[_0xfde7('0x37')]=_0x418807[_0xfde7('0x37')]['length']?_0x418807['attributes']:_0x2120d5[_0xfde7('0x34')];if(_0x2f1f25[_0xfde7('0x36')][_0xfde7('0x44')]){_0x418807[_0xfde7('0x45')]=[{'all':!![]}];}_0x418807=_[_0xfde7('0x41')]({},_0x418807,_0x2f1f25['options']);return db[_0xfde7('0x2f')][_0xfde7('0x4c')](_0x418807)[_0xfde7('0x25')](handleEntityNotFound(_0x1805c1,null))[_0xfde7('0x25')](respondWithResult(_0x1805c1,null))[_0xfde7('0x48')](handleError(_0x1805c1,null));};exports[_0xfde7('0x4d')]=function(_0x1fbce8,_0x1640cb){return db[_0xfde7('0x2f')][_0xfde7('0x4d')](_0x1fbce8[_0xfde7('0x4e')],{})['then'](function(_0x3429d5){var _0x3c34b6=_0x1fbce8[_0xfde7('0x4f')][_0xfde7('0x27')]({'plain':!![]});if(!_0x3c34b6)throw new Error(_0xfde7('0x50'));if(_0x3c34b6[_0xfde7('0x51')]===_0xfde7('0x4f')){var _0x46f3bc=_0x3429d5['get']({'plain':!![]});var _0x4f905b='CmHopperAdditionalPhones';return db['UserProfileSection']['find']({'where':{'name':_0x4f905b,'userProfileId':_0x3c34b6['userProfileId']},'raw':!![]})[_0xfde7('0x25')](function(_0x484e71){if(_0x484e71&&_0x484e71[_0xfde7('0x52')]===0x0){return db[_0xfde7('0x29')][_0xfde7('0x4d')]({'name':_0x46f3bc[_0xfde7('0x2c')],'resourceId':_0x46f3bc['id'],'type':_0x484e71[_0xfde7('0x2c')],'sectionId':_0x484e71['id']},{})[_0xfde7('0x25')](function(){return _0x3429d5;});}else{return _0x3429d5;}})[_0xfde7('0x48')](function(_0x5487fa){logger[_0xfde7('0x2a')](_0xfde7('0x53'),_0x5487fa);throw _0x5487fa;});}return _0x3429d5;})[_0xfde7('0x25')](respondWithResult(_0x1640cb,0xc9))[_0xfde7('0x48')](handleError(_0x1640cb,null));};exports[_0xfde7('0x24')]=function(_0x5550ef,_0x188c5f){if(_0x5550ef[_0xfde7('0x4e')]['id']){delete _0x5550ef[_0xfde7('0x4e')]['id'];}return db['CmHopperAdditionalPhone'][_0xfde7('0x4c')]({'where':{'id':_0x5550ef[_0xfde7('0x4a')]['id']}})[_0xfde7('0x25')](handleEntityNotFound(_0x188c5f,null))[_0xfde7('0x25')](saveUpdates(_0x5550ef[_0xfde7('0x4e')],null))[_0xfde7('0x25')](respondWithResult(_0x188c5f,null))['catch'](handleError(_0x188c5f,null));};exports[_0xfde7('0x26')]=function(_0x904057,_0x1864e9){return db[_0xfde7('0x2f')]['find']({'where':{'id':_0x904057[_0xfde7('0x4a')]['id']}})[_0xfde7('0x25')](handleEntityNotFound(_0x1864e9,null))[_0xfde7('0x25')](removeEntity(_0x1864e9,null))[_0xfde7('0x48')](handleError(_0x1864e9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 96fe62f..3c19ed9 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 _0x78c2=['../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78c2,0xad));var _0x278c=function(_0x257074,_0x55322a){_0x257074=_0x257074-0x0;var _0x2fda44=_0x78c2[_0x257074];return _0x2fda44;};'use strict';var _=require(_0x278c('0x0'));var util=require(_0x278c('0x1'));var logger=require(_0x278c('0x2'))(_0x278c('0x3'));var moment=require(_0x278c('0x4'));var BPromise=require('bluebird');var rp=require(_0x278c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x278c('0x6'));var config=require(_0x278c('0x7'));var attributes=require(_0x278c('0x8'));module[_0x278c('0x9')]=function(_0x518ee7,_0x4b3bff){return _0x518ee7['define'](_0x278c('0xa'),attributes,{'tableName':_0x278c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7698=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','path','./cmHopperAdditionalPhone.attributes','exports'];(function(_0x1ae4ca,_0x42289d){var _0x174cd6=function(_0x21be88){while(--_0x21be88){_0x1ae4ca['push'](_0x1ae4ca['shift']());}};_0x174cd6(++_0x42289d);}(_0x7698,0x7b));var _0x8769=function(_0x778f9a,_0x109615){_0x778f9a=_0x778f9a-0x0;var _0x66d2e5=_0x7698[_0x778f9a];return _0x66d2e5;};'use strict';var _=require(_0x8769('0x0'));var util=require(_0x8769('0x1'));var logger=require(_0x8769('0x2'))(_0x8769('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8769('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8769('0x5'));module[_0x8769('0x6')]=function(_0x8c7169,_0x30cd34){return _0x8c7169[_0x8769('0x7')](_0x8769('0x8'),attributes,{'tableName':_0x8769('0x9'),'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 de6e5ac..b015d48 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 _0xb0dd=['ListId','duration','waitTime','isNil','scheduledat','add','minutes','createdAt','updatedAt','phone','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VerifyAdditionalPhones','findOne','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countnoanswerretry','countagentrejectretry','SwapAdditionalPhones','CmHopper','ContactId'];(function(_0x5d23be,_0x3b4f3c){var _0x4d60a9=function(_0x57dce7){while(--_0x57dce7){_0x5d23be['push'](_0x5d23be['shift']());}};_0x4d60a9(++_0x3b4f3c);}(_0xb0dd,0xc1));var _0xdb0d=function(_0x48d0d6,_0x23ac46){_0x48d0d6=_0x48d0d6-0x0;var _0x4ccc96=_0xb0dd[_0x48d0d6];return _0x4ccc96;};'use strict';var _=require(_0xdb0d('0x0'));var util=require(_0xdb0d('0x1'));var moment=require(_0xdb0d('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb0d('0x3'));var fs=require('fs');var Redis=require(_0xdb0d('0x4'));var db=require(_0xdb0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb0d('0x6'))('rpc');var config=require(_0xdb0d('0x7'));var jayson=require(_0xdb0d('0x8'));var client=jayson[_0xdb0d('0x9')][_0xdb0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b1c16,_0x303949,_0x3b2c6a){return new BPromise(function(_0x1a9dcd,_0x34e595){return client[_0xdb0d('0xb')](_0x2b1c16,_0x3b2c6a)[_0xdb0d('0xc')](function(_0x36b951){logger[_0xdb0d('0xd')](_0xdb0d('0xe'),_0x303949,_0xdb0d('0xf'));logger[_0xdb0d('0x10')](_0xdb0d('0x11'),_0x303949,_0xdb0d('0xf'),JSON[_0xdb0d('0x12')](_0x36b951));if(_0x36b951[_0xdb0d('0x13')]){if(_0x36b951['error']['code']===0x1f4){logger[_0xdb0d('0x13')](_0xdb0d('0xe'),_0x303949,_0x36b951['error']['message']);return _0x34e595(_0x36b951[_0xdb0d('0x13')][_0xdb0d('0x14')]);}logger['error'](_0xdb0d('0xe'),_0x303949,_0x36b951['error']['message']);return _0x1a9dcd(_0x36b951[_0xdb0d('0x13')][_0xdb0d('0x14')]);}else{logger[_0xdb0d('0xd')](_0xdb0d('0xe'),_0x303949,'request\x20sent');_0x1a9dcd(_0x36b951['result'][_0xdb0d('0x14')]);}})[_0xdb0d('0x15')](function(_0x30d03d){logger[_0xdb0d('0x13')](_0xdb0d('0xe'),_0x303949,_0x30d03d);_0x34e595(_0x30d03d);});});}exports[_0xdb0d('0x16')]=function(_0x2a5682){var _0x1b7265=this;return new Promise(function(_0x534c9d,_0x286689){return db['CmHopper'][_0xdb0d('0x17')]({'raw':!![],'where':{'ContactId':_0x2a5682['body']['ContactId'],'ListId':_0x2a5682[_0xdb0d('0x18')]['ListId'],'VoiceQueueId':_0x2a5682['body'][_0xdb0d('0x19')]===undefined?null:_0x2a5682[_0xdb0d('0x18')][_0xdb0d('0x19')],'CampaignId':_0x2a5682['body'][_0xdb0d('0x1a')]===undefined?null:_0x2a5682[_0xdb0d('0x18')][_0xdb0d('0x1a')]}})['then'](function(_0x36fbf0){if(_0x36fbf0!=null){return db[_0xdb0d('0x1b')][_0xdb0d('0x17')]({'raw':!![],'where':{'CmHopperId':_0x36fbf0['id'],'OrderBy':{'$gt':_0x36fbf0[_0xdb0d('0x1c')]}},'order':[['OrderBy',_0xdb0d('0x1d')]]})[_0xdb0d('0xc')](function(_0x19084c){var _0x539190=0x0;if(_0x19084c){if(_0x19084c[_0xdb0d('0x1e')]+_0x19084c[_0xdb0d('0x1f')]+_0x19084c['countnoanswerretry']+_0x19084c[_0xdb0d('0x20')]+_0x19084c[_0xdb0d('0x21')]+_0x19084c[_0xdb0d('0x22')]+_0x19084c[_0xdb0d('0x23')]+_0x19084c['countagentrejectretry']<_0x2a5682[_0xdb0d('0x24')][_0xdb0d('0x25')])_0x539190=0x1;_0x534c9d({'additional':_0x539190});}else{return db[_0xdb0d('0x1b')][_0xdb0d('0x17')]({'raw':!![],'where':{'CmHopperId':_0x36fbf0['id']},'order':[[_0xdb0d('0x1c'),'ASC']]})['then'](function(_0x210842){var _0x358c9b=0x0;if(_0x210842){if(_0x210842[_0xdb0d('0x1e')]+_0x210842[_0xdb0d('0x1f')]+_0x210842[_0xdb0d('0x26')]+_0x210842[_0xdb0d('0x20')]+_0x210842[_0xdb0d('0x21')]+_0x210842[_0xdb0d('0x22')]+_0x210842[_0xdb0d('0x23')]+_0x210842[_0xdb0d('0x27')]<_0x2a5682['entity'][_0xdb0d('0x25')])_0x358c9b=0x1;_0x534c9d({'additional':_0x358c9b});}else{_0x534c9d({'additional':0x0});}})[_0xdb0d('0x15')](function(_0x149e52){logger[_0xdb0d('0x13')](_0xdb0d('0x16'),_0x149e52['message']);_0x286689(_0x1b7265[_0xdb0d('0x13')](0x1f4,_0x149e52[_0xdb0d('0x14')]));});}})[_0xdb0d('0x15')](function(_0x1799c8){logger[_0xdb0d('0x13')](_0xdb0d('0x16'),_0x1799c8[_0xdb0d('0x14')]);_0x286689(_0x1b7265['error'](0x1f4,_0x1799c8[_0xdb0d('0x14')]));});}else _0x534c9d({'additional':0x0});});});};exports[_0xdb0d('0x28')]=function(_0x43c19c){var _0x36c0cf=this;return new Promise(function(_0xab267a,_0x57145d){return db[_0xdb0d('0x29')][_0xdb0d('0x17')]({'raw':!![],'where':{'ContactId':_0x43c19c['body'][_0xdb0d('0x2a')],'ListId':_0x43c19c['body'][_0xdb0d('0x2b')],'VoiceQueueId':_0x43c19c[_0xdb0d('0x18')]['VoiceQueueId']===undefined?null:_0x43c19c[_0xdb0d('0x18')][_0xdb0d('0x19')],'CampaignId':_0x43c19c[_0xdb0d('0x18')][_0xdb0d('0x1a')]===undefined?null:_0x43c19c['body'][_0xdb0d('0x1a')]}})[_0xdb0d('0xc')](function(_0x24a751){if(_0x24a751!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x24a751['id'],'OrderBy':{'$gte':_0x24a751['OrderBy']}},'order':[['OrderBy',_0xdb0d('0x1d')]]})[_0xdb0d('0xc')](function(_0x28166f){if(_0x28166f)return activateAdditionalPhone(_0x24a751,_0x43c19c[_0xdb0d('0x18')],_0x28166f,_0x43c19c[_0xdb0d('0x2c')],_0x43c19c[_0xdb0d('0x2d')])[_0xdb0d('0xc')](function(_0x3f6dfb){_0xab267a(_0x3f6dfb);});else{return db[_0xdb0d('0x1b')][_0xdb0d('0x17')]({'raw':!![],'where':{'CmHopperId':_0x24a751['id']},'order':[[_0xdb0d('0x1c'),_0xdb0d('0x1d')]]})[_0xdb0d('0xc')](function(_0x2d2bee){if(_0x2d2bee)return activateAdditionalPhone(_0x24a751,_0x43c19c['body'],_0x2d2bee,_0x43c19c[_0xdb0d('0x2c')],_0x43c19c['waitTime'])[_0xdb0d('0xc')](function(_0x34cec2){_0xab267a(_0x34cec2);});else{_0xab267a({'id':_0x24a751['id'],'phone':''});}})[_0xdb0d('0x15')](function(_0x1753e5){logger[_0xdb0d('0x13')](_0xdb0d('0x16'),_0x1753e5[_0xdb0d('0x14')]);_0x57145d(_0x36c0cf[_0xdb0d('0x13')](0x1f4,_0x1753e5['message']));});}})[_0xdb0d('0x15')](function(_0x55b69f){logger[_0xdb0d('0x13')](_0xdb0d('0x16'),_0x55b69f['message']);_0x57145d(_0x36c0cf[_0xdb0d('0x13')](0x1f4,_0x55b69f[_0xdb0d('0x14')]));});}else _0xab267a(0x1);});});};function activateAdditionalPhone(_0x552db2,_0x374180,_0xbd1d57,_0x2cce0b,_0x56f933){return new Promise(function(_0x2c212a,_0x5f1ab7){var _0x33f46a;if(_[_0xdb0d('0x2e')](_0xbd1d57[_0xdb0d('0x2f')])){_0xbd1d57[_0xdb0d('0x2f')]=moment();}if(moment()>moment(_0xbd1d57['scheduledat'])){_0x33f46a=moment()[_0xdb0d('0x30')](_0x56f933||0x3,_0xdb0d('0x31'));}else{if(_0xbd1d57['OrderBy']==0x0){_0x33f46a=moment(_0xbd1d57['scheduledat']);}else{_0x33f46a=moment()[_0xdb0d('0x30')](_0x56f933||0x3,_0xdb0d('0x31'));}}if(_[_0xdb0d('0x2e')](_0x33f46a)){_0x33f46a=moment()[_0xdb0d('0x30')](_0x56f933||0x3,_0xdb0d('0x31'));}var _0x4b32b2={'phone':_0x552db2['phone'],'active':0x0,'OrderBy':_[_0xdb0d('0x2e')](_0x552db2[_0xdb0d('0x1c')])?0x0:_0x552db2[_0xdb0d('0x1c')],'scheduledat':moment()['add'](_0x2cce0b||0x1,_0xdb0d('0x31')),'countbusyretry':_0x374180['countbusyretry'],'countcongestionretry':_0x374180[_0xdb0d('0x1f')],'countnoanswerretry':_0x374180['countnoanswerretry'],'countnosuchnumberretry':_0x374180[_0xdb0d('0x20')],'countdropretry':_0x374180['countdropretry'],'countabandonedretry':_0x374180['countabandonedretry'],'countmachineretry':_0x374180[_0xdb0d('0x23')],'countagentrejectretry':_0x374180['countagentrejectretry'],'createdAt':_0x374180[_0xdb0d('0x32')],'updatedAt':_0x374180[_0xdb0d('0x33')]};var _0x1f0b9a={'CmHopperId':_0x552db2['id'],'phone':_0xbd1d57[_0xdb0d('0x34')],'active':0x0,'OrderBy':_[_0xdb0d('0x2e')](_0xbd1d57[_0xdb0d('0x1c')])?0x0:_0xbd1d57[_0xdb0d('0x1c')],'scheduledat':_0x33f46a,'countbusyretry':_0xbd1d57[_0xdb0d('0x1e')],'countcongestionretry':_0xbd1d57[_0xdb0d('0x1f')],'countnoanswerretry':_0xbd1d57[_0xdb0d('0x26')],'countnosuchnumberretry':_0xbd1d57['countnosuchnumberretry'],'countdropretry':_0xbd1d57['countdropretry'],'countabandonedretry':_0xbd1d57['countabandonedretry'],'countmachineretry':_0xbd1d57['countmachineretry'],'countagentrejectretry':_0xbd1d57['countagentrejectretry'],'createdAt':_0xbd1d57[_0xdb0d('0x32')],'updatedAt':_0xbd1d57[_0xdb0d('0x33')]};return db[_0xdb0d('0x35')][_0xdb0d('0x36')](function(_0x48a942){return db['CmHopperAdditionalPhone'][_0xdb0d('0x37')](_0x4b32b2,{'where':{'id':_0xbd1d57['id']}},{'transaction':_0x48a942})['then'](function(){return db['CmHopper'][_0xdb0d('0x37')](_0x1f0b9a,{'where':{'id':_0x552db2['id']}},{'transaction':_0x48a942});});})[_0xdb0d('0xc')](function(_0x43b849){_0x2c212a({'id':_0x552db2['id'],'phone':_0xbd1d57[_0xdb0d('0x34')]});})['catch'](function(_0x4aa17e){logger['error'](_0xdb0d('0x38'),_0x4aa17e[_0xdb0d('0x14')]);_0x5f1ab7({'error':_0x4aa17e['message']});});});}exports[_0xdb0d('0x39')]=function(_0x506b2b){var _0x2fe0e5=this;return new Promise(function(_0x4e1655,_0x2667e6){return db[_0xdb0d('0x29')][_0xdb0d('0x37')](_0x506b2b['body'][_0xdb0d('0x3a')],{'where':{'id':_0x506b2b[_0xdb0d('0x18')]['id']}})[_0xdb0d('0xc')](function(_0x2578c0){_0x4e1655(_0x2578c0);})['catch'](function(_0x19aae8){logger['error'](_0xdb0d('0x39'),_0x19aae8[_0xdb0d('0x14')]);_0x2667e6(_0x2fe0e5[_0xdb0d('0x13')](0x1f4,_0x19aae8['message']));});});}; \ No newline at end of file +var _0x35f4=['then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','message','info','catch','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countnosuchnumberretry','VerifyAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','countbusyretry','createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x4dade6,_0x16b01d){var _0x513270=function(_0x1d4a7f){while(--_0x1d4a7f){_0x4dade6['push'](_0x4dade6['shift']());}};_0x513270(++_0x16b01d);}(_0x35f4,0x9c));var _0x435f=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x35f4[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0x435f('0x0'));var util=require(_0x435f('0x1'));var moment=require(_0x435f('0x2'));var BPromise=require(_0x435f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x435f('0x4'));var db=require(_0x435f('0x5'))['db'];var utils=require(_0x435f('0x6'));var logger=require(_0x435f('0x7'))('rpc');var config=require(_0x435f('0x8'));var jayson=require(_0x435f('0x9'));var client=jayson['client'][_0x435f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ddf,_0x1f3d4c,_0x4c8813){return new BPromise(function(_0x2f3043,_0x45a207){return client[_0x435f('0xb')](_0x3d8ddf,_0x4c8813)[_0x435f('0xc')](function(_0x2fa30b){logger['info'](_0x435f('0xd'),_0x1f3d4c,_0x435f('0xe'));logger[_0x435f('0xf')](_0x435f('0x10'),_0x1f3d4c,_0x435f('0xe'),JSON['stringify'](_0x2fa30b));if(_0x2fa30b[_0x435f('0x11')]){if(_0x2fa30b[_0x435f('0x11')]['code']===0x1f4){logger[_0x435f('0x11')](_0x435f('0xd'),_0x1f3d4c,_0x2fa30b[_0x435f('0x11')][_0x435f('0x12')]);return _0x45a207(_0x2fa30b[_0x435f('0x11')]['message']);}logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1f3d4c,_0x2fa30b[_0x435f('0x11')][_0x435f('0x12')]);return _0x2f3043(_0x2fa30b[_0x435f('0x11')]['message']);}else{logger[_0x435f('0x13')](_0x435f('0xd'),_0x1f3d4c,_0x435f('0xe'));_0x2f3043(_0x2fa30b['result'][_0x435f('0x12')]);}})[_0x435f('0x14')](function(_0x3b4b95){logger[_0x435f('0x11')](_0x435f('0xd'),_0x1f3d4c,_0x3b4b95);_0x45a207(_0x3b4b95);});});}exports['VerifyAdditionalPhones']=function(_0x5dda87){var _0x41ac15=this;return new Promise(function(_0x107dba,_0x199642){return db[_0x435f('0x15')][_0x435f('0x16')]({'raw':!![],'where':{'ContactId':_0x5dda87[_0x435f('0x17')][_0x435f('0x18')],'ListId':_0x5dda87[_0x435f('0x17')][_0x435f('0x19')],'VoiceQueueId':_0x5dda87[_0x435f('0x17')][_0x435f('0x1a')]===undefined?null:_0x5dda87[_0x435f('0x17')][_0x435f('0x1a')],'CampaignId':_0x5dda87['body'][_0x435f('0x1b')]===undefined?null:_0x5dda87[_0x435f('0x17')][_0x435f('0x1b')]}})[_0x435f('0xc')](function(_0x80bcff){if(_0x80bcff!=null){return db[_0x435f('0x1c')][_0x435f('0x16')]({'raw':!![],'where':{'CmHopperId':_0x80bcff['id'],'OrderBy':{'$gt':_0x80bcff[_0x435f('0x1d')]}},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})[_0x435f('0xc')](function(_0x4b6601){var _0x113885=0x0;if(_0x4b6601){if(_0x4b6601['countbusyretry']+_0x4b6601[_0x435f('0x1f')]+_0x4b6601[_0x435f('0x20')]+_0x4b6601['countnosuchnumberretry']+_0x4b6601[_0x435f('0x21')]+_0x4b6601[_0x435f('0x22')]+_0x4b6601[_0x435f('0x23')]+_0x4b6601[_0x435f('0x24')]<_0x5dda87[_0x435f('0x25')][_0x435f('0x26')])_0x113885=0x1;_0x107dba({'additional':_0x113885});}else{return db[_0x435f('0x1c')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x80bcff['id']},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})[_0x435f('0xc')](function(_0xda5fc3){var _0x17a8d0=0x0;if(_0xda5fc3){if(_0xda5fc3['countbusyretry']+_0xda5fc3[_0x435f('0x1f')]+_0xda5fc3['countnoanswerretry']+_0xda5fc3[_0x435f('0x27')]+_0xda5fc3[_0x435f('0x21')]+_0xda5fc3[_0x435f('0x22')]+_0xda5fc3[_0x435f('0x23')]+_0xda5fc3[_0x435f('0x24')]<_0x5dda87['entity'][_0x435f('0x26')])_0x17a8d0=0x1;_0x107dba({'additional':_0x17a8d0});}else{_0x107dba({'additional':0x0});}})[_0x435f('0x14')](function(_0x576a3f){logger[_0x435f('0x11')](_0x435f('0x28'),_0x576a3f[_0x435f('0x12')]);_0x199642(_0x41ac15[_0x435f('0x11')](0x1f4,_0x576a3f['message']));});}})[_0x435f('0x14')](function(_0x1b3a6c){logger['error'](_0x435f('0x28'),_0x1b3a6c[_0x435f('0x12')]);_0x199642(_0x41ac15[_0x435f('0x11')](0x1f4,_0x1b3a6c[_0x435f('0x12')]));});}else _0x107dba({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x16337c){var _0x340cb3=this;return new Promise(function(_0x43a1b0,_0x1e5a49){return db[_0x435f('0x15')][_0x435f('0x16')]({'raw':!![],'where':{'ContactId':_0x16337c[_0x435f('0x17')][_0x435f('0x18')],'ListId':_0x16337c[_0x435f('0x17')][_0x435f('0x19')],'VoiceQueueId':_0x16337c['body']['VoiceQueueId']===undefined?null:_0x16337c[_0x435f('0x17')][_0x435f('0x1a')],'CampaignId':_0x16337c[_0x435f('0x17')]['CampaignId']===undefined?null:_0x16337c[_0x435f('0x17')]['CampaignId']}})[_0x435f('0xc')](function(_0x35ead1){if(_0x35ead1!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x35ead1['id'],'OrderBy':{'$gte':_0x35ead1[_0x435f('0x1d')]}},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})['then'](function(_0x1747b3){if(_0x1747b3)return activateAdditionalPhone(_0x35ead1,_0x16337c['body'],_0x1747b3,_0x16337c[_0x435f('0x29')],_0x16337c['waitTime'])['then'](function(_0x58b3d2){_0x43a1b0(_0x58b3d2);});else{return db[_0x435f('0x1c')][_0x435f('0x16')]({'raw':!![],'where':{'CmHopperId':_0x35ead1['id']},'order':[[_0x435f('0x1d'),_0x435f('0x1e')]]})[_0x435f('0xc')](function(_0x40ab3e){if(_0x40ab3e)return activateAdditionalPhone(_0x35ead1,_0x16337c[_0x435f('0x17')],_0x40ab3e,_0x16337c['duration'],_0x16337c[_0x435f('0x2a')])[_0x435f('0xc')](function(_0x54de4b){_0x43a1b0(_0x54de4b);});else{_0x43a1b0({'id':_0x35ead1['id'],'phone':''});}})['catch'](function(_0x5c6e02){logger[_0x435f('0x11')](_0x435f('0x28'),_0x5c6e02[_0x435f('0x12')]);_0x1e5a49(_0x340cb3[_0x435f('0x11')](0x1f4,_0x5c6e02[_0x435f('0x12')]));});}})[_0x435f('0x14')](function(_0x423280){logger[_0x435f('0x11')](_0x435f('0x28'),_0x423280[_0x435f('0x12')]);_0x1e5a49(_0x340cb3['error'](0x1f4,_0x423280[_0x435f('0x12')]));});}else _0x43a1b0(0x1);});});};function activateAdditionalPhone(_0x53362b,_0x436a29,_0x511372,_0x2c6f9a,_0x361a32){return new Promise(function(_0x415f88,_0x11744e){var _0x4c520c;if(_[_0x435f('0x2b')](_0x511372[_0x435f('0x2c')])){_0x511372[_0x435f('0x2c')]=moment();}if(moment()>moment(_0x511372[_0x435f('0x2c')])){_0x4c520c=moment()[_0x435f('0x2d')](_0x361a32||0x3,_0x435f('0x2e'));}else{if(_0x511372[_0x435f('0x1d')]==0x0){_0x4c520c=moment(_0x511372[_0x435f('0x2c')]);}else{_0x4c520c=moment()['add'](_0x361a32||0x3,_0x435f('0x2e'));}}if(_[_0x435f('0x2b')](_0x4c520c)){_0x4c520c=moment()[_0x435f('0x2d')](_0x361a32||0x3,_0x435f('0x2e'));}var _0x2f3774={'phone':_0x53362b[_0x435f('0x2f')],'active':0x0,'OrderBy':_[_0x435f('0x2b')](_0x53362b['OrderBy'])?0x0:_0x53362b[_0x435f('0x1d')],'scheduledat':moment()[_0x435f('0x2d')](_0x2c6f9a||0x1,_0x435f('0x2e')),'countbusyretry':_0x436a29[_0x435f('0x30')],'countcongestionretry':_0x436a29[_0x435f('0x1f')],'countnoanswerretry':_0x436a29[_0x435f('0x20')],'countnosuchnumberretry':_0x436a29[_0x435f('0x27')],'countdropretry':_0x436a29[_0x435f('0x21')],'countabandonedretry':_0x436a29[_0x435f('0x22')],'countmachineretry':_0x436a29['countmachineretry'],'countagentrejectretry':_0x436a29[_0x435f('0x24')],'createdAt':_0x436a29[_0x435f('0x31')],'updatedAt':_0x436a29[_0x435f('0x32')]};var _0x11dfc4={'CmHopperId':_0x53362b['id'],'phone':_0x511372[_0x435f('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x511372[_0x435f('0x1d')])?0x0:_0x511372[_0x435f('0x1d')],'scheduledat':_0x4c520c,'countbusyretry':_0x511372[_0x435f('0x30')],'countcongestionretry':_0x511372[_0x435f('0x1f')],'countnoanswerretry':_0x511372[_0x435f('0x20')],'countnosuchnumberretry':_0x511372[_0x435f('0x27')],'countdropretry':_0x511372['countdropretry'],'countabandonedretry':_0x511372[_0x435f('0x22')],'countmachineretry':_0x511372[_0x435f('0x23')],'countagentrejectretry':_0x511372['countagentrejectretry'],'createdAt':_0x511372[_0x435f('0x31')],'updatedAt':_0x511372['updatedAt']};return db[_0x435f('0x33')][_0x435f('0x34')](function(_0x385aa3){return db['CmHopperAdditionalPhone'][_0x435f('0x35')](_0x2f3774,{'where':{'id':_0x511372['id']}},{'transaction':_0x385aa3})[_0x435f('0xc')](function(){return db[_0x435f('0x15')][_0x435f('0x35')](_0x11dfc4,{'where':{'id':_0x53362b['id']}},{'transaction':_0x385aa3});});})[_0x435f('0xc')](function(_0x37e5eb){_0x415f88({'id':_0x53362b['id'],'phone':_0x511372['phone']});})[_0x435f('0x14')](function(_0x2780dc){logger['error']('activateAdditionalPhone',_0x2780dc[_0x435f('0x12')]);_0x11744e({'error':_0x2780dc['message']});});});}exports[_0x435f('0x36')]=function(_0x43334f){var _0x595894=this;return new Promise(function(_0x597654,_0x175947){return db['CmHopper'][_0x435f('0x35')](_0x43334f[_0x435f('0x17')][_0x435f('0x37')],{'where':{'id':_0x43334f[_0x435f('0x17')]['id']}})[_0x435f('0xc')](function(_0x41d873){_0x597654(_0x41d873);})[_0x435f('0x14')](function(_0x2bd98f){logger[_0x435f('0x11')](_0x435f('0x36'),_0x2bd98f[_0x435f('0x12')]);_0x175947(_0x595894['error'](0x1f4,_0x2bd98f['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 212c89f..c71aedf 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 _0x3c45=['../../components/interaction/service','../../config/environment','get','isAuthenticated','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x575739,_0x874434){var _0x2286f6=function(_0x826c4a){while(--_0x826c4a){_0x575739['push'](_0x575739['shift']());}};_0x2286f6(++_0x874434);}(_0x3c45,0xd8));var _0x53c4=function(_0x4ae24b,_0x58c9b0){_0x4ae24b=_0x4ae24b-0x0;var _0x573d23=_0x3c45[_0x4ae24b];return _0x573d23;};'use strict';var multer=require(_0x53c4('0x0'));var util=require(_0x53c4('0x1'));var path=require(_0x53c4('0x2'));var timeout=require(_0x53c4('0x3'));var express=require(_0x53c4('0x4'));var router=express[_0x53c4('0x5')]();var fs_extra=require(_0x53c4('0x6'));var auth=require(_0x53c4('0x7'));var interaction=require(_0x53c4('0x8'));var config=require(_0x53c4('0x9'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x53c4('0xa')]('/',auth[_0x53c4('0xb')](),controller['index']);router[_0x53c4('0xa')]('/:id',auth[_0x53c4('0xb')](),controller['show']);router['post']('/',auth[_0x53c4('0xb')](),controller['create']);router[_0x53c4('0xc')](_0x53c4('0xd'),auth[_0x53c4('0xb')](),controller['update']);router[_0x53c4('0xe')](_0x53c4('0xd'),auth[_0x53c4('0xb')](),controller['destroy']);module[_0x53c4('0xf')]=router; \ No newline at end of file +var _0xe0c0=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x36ee80,_0x494184){_0x36ee80=_0x36ee80-0x0;var _0x14306c=_0xe0c0[_0x36ee80];return _0x14306c;};'use strict';var multer=require(_0x0e0c('0x0'));var util=require('util');var path=require(_0x0e0c('0x1'));var timeout=require(_0x0e0c('0x2'));var express=require(_0x0e0c('0x3'));var router=express[_0x0e0c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e0c('0x5'));var interaction=require(_0x0e0c('0x6'));var config=require(_0x0e0c('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0e0c('0x8')]('/',auth[_0x0e0c('0x9')](),controller['index']);router[_0x0e0c('0x8')](_0x0e0c('0xa'),auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xb')]);router[_0x0e0c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0e0c('0xa'),auth['isAuthenticated'](),controller[_0x0e0c('0xd')]);router[_0x0e0c('0xe')](_0x0e0c('0xa'),auth[_0x0e0c('0x9')](),controller[_0x0e0c('0xf')]);module[_0x0e0c('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 5f810a3..30abb8a 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 _0xcb04=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0xcb04,0x9a));var _0x4cb0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb04[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x4cb0('0x0'));var Sequelize=require(_0x4cb0('0x1'));module[_0x4cb0('0x2')]={'phone':{'type':Sequelize[_0x4cb0('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4cb0('0x4')],'unique':_0x4cb0('0x5')},'ListId':{'type':Sequelize[_0x4cb0('0x4')],'unique':_0x4cb0('0x5')},'VoiceQueueId':{'type':Sequelize[_0x4cb0('0x4')],'unique':_0x4cb0('0x5')}}; \ No newline at end of file +var _0xfb15=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xfb15,0x12f));var _0x5fb1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xfb15[_0x4cf98e];return _0x1623ac;};'use strict';var moment=require(_0x5fb1('0x0'));var Sequelize=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'phone':{'type':Sequelize[_0x5fb1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5fb1('0x4')],'unique':_0x5fb1('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5fb1('0x5')},'VoiceQueueId':{'type':Sequelize[_0x5fb1('0x4')],'unique':_0x5fb1('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e82875e..649ae6a 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 _0xff22=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','type','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','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','jsforce','desk.js'];(function(_0x4df793,_0x21738d){var _0x6b63d2=function(_0x49625e){while(--_0x49625e){_0x4df793['push'](_0x4df793['shift']());}};_0x6b63d2(++_0x21738d);}(_0xff22,0x135));var _0x2ff2=function(_0x1536cc,_0x1f5732){_0x1536cc=_0x1536cc-0x0;var _0x5bcc47=_0xff22[_0x1536cc];return _0x5bcc47;};'use strict';var emlformat=require(_0x2ff2('0x0'));var rimraf=require(_0x2ff2('0x1'));var zipdir=require(_0x2ff2('0x2'));var jsonpatch=require(_0x2ff2('0x3'));var rp=require(_0x2ff2('0x4'));var moment=require(_0x2ff2('0x5'));var BPromise=require(_0x2ff2('0x6'));var Mustache=require(_0x2ff2('0x7'));var util=require(_0x2ff2('0x8'));var path=require(_0x2ff2('0x9'));var sox=require(_0x2ff2('0xa'));var csv=require(_0x2ff2('0xb'));var ejs=require(_0x2ff2('0xc'));var fs=require('fs');var fs_extra=require(_0x2ff2('0xd'));var _=require(_0x2ff2('0xe'));var squel=require(_0x2ff2('0xf'));var crypto=require(_0x2ff2('0x10'));var jsforce=require(_0x2ff2('0x11'));var deskjs=require(_0x2ff2('0x12'));var toCsv=require(_0x2ff2('0xb'));var querystring=require(_0x2ff2('0x13'));var Papa=require(_0x2ff2('0x14'));var Redis=require(_0x2ff2('0x15'));var authService=require(_0x2ff2('0x16'));var qs=require(_0x2ff2('0x17'));var as=require(_0x2ff2('0x18'));var hardwareService=require(_0x2ff2('0x19'));var logger=require(_0x2ff2('0x1a'))(_0x2ff2('0x1b'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ff2('0x1c'));var db=require(_0x2ff2('0x1d'))['db'];function respondWithStatusCode(_0x298a20,_0x341e88){_0x341e88=_0x341e88||0xcc;return function(_0x5100f9){if(_0x5100f9){return _0x298a20[_0x2ff2('0x1e')](_0x341e88);}return _0x298a20[_0x2ff2('0x1f')](_0x341e88)['end']();};}function respondWithResult(_0x1f722e,_0x66f781){_0x66f781=_0x66f781||0xc8;return function(_0x3330cb){if(_0x3330cb){return _0x1f722e[_0x2ff2('0x1f')](_0x66f781)[_0x2ff2('0x20')](_0x3330cb);}};}function respondWithFilteredResult(_0x1b633f,_0x1049a1){return function(_0x35524e){if(_0x35524e){var _0x435a09=typeof _0x1049a1[_0x2ff2('0x21')]===_0x2ff2('0x22')&&typeof _0x1049a1[_0x2ff2('0x23')]==='undefined';var _0x6ad9eb=_0x35524e[_0x2ff2('0x24')];var _0x521663=_0x435a09?0x0:_0x1049a1[_0x2ff2('0x21')];var _0x286c30=_0x435a09?_0x35524e[_0x2ff2('0x24')]:_0x1049a1[_0x2ff2('0x21')]+_0x1049a1[_0x2ff2('0x23')];var _0x23dc33;if(_0x286c30>=_0x6ad9eb){_0x286c30=_0x6ad9eb;_0x23dc33=0xc8;}else{_0x23dc33=0xce;}_0x1b633f[_0x2ff2('0x1f')](_0x23dc33);return _0x1b633f[_0x2ff2('0x25')]('Content-Range',_0x521663+'-'+_0x286c30+'/'+_0x6ad9eb)[_0x2ff2('0x20')](_0x35524e);}return null;};}function patchUpdates(_0x114140){return function(_0x22b7e3){try{jsonpatch[_0x2ff2('0x26')](_0x22b7e3,_0x114140,!![]);}catch(_0x2055cd){return BPromise['reject'](_0x2055cd);}return _0x22b7e3[_0x2ff2('0x27')]();};}function saveUpdates(_0x5a2a1b,_0x3ece3e){return function(_0x15d7cd){if(_0x15d7cd){return _0x15d7cd[_0x2ff2('0x28')](_0x5a2a1b)['then'](function(_0x511268){return _0x511268;});}return null;};}function removeEntity(_0x3df4f5,_0x49cbde){return function(_0x50a4fe){if(_0x50a4fe){return _0x50a4fe[_0x2ff2('0x29')]()[_0x2ff2('0x2a')](function(){_0x3df4f5[_0x2ff2('0x1f')](0xcc)[_0x2ff2('0x2b')]();});}};}function handleEntityNotFound(_0x48b476,_0x19374b){return function(_0x2d5974){if(!_0x2d5974){_0x48b476[_0x2ff2('0x1e')](0x194);}return _0x2d5974;};}function handleError(_0x118c8c,_0x5a39a7){_0x5a39a7=_0x5a39a7||0x1f4;return function(_0x4286dc){logger[_0x2ff2('0x2c')](_0x4286dc[_0x2ff2('0x2d')]);if(_0x4286dc[_0x2ff2('0x2e')]){delete _0x4286dc[_0x2ff2('0x2e')];}_0x118c8c[_0x2ff2('0x1f')](_0x5a39a7)[_0x2ff2('0x2f')](_0x4286dc);};}exports[_0x2ff2('0x30')]=function(_0x3e640a,_0xbddbe7){var _0x516ae5={},_0x2ae4e2={},_0x5dcd4d={'count':0x0,'rows':[]};var _0x49f383=_['map'](db[_0x2ff2('0x31')][_0x2ff2('0x32')],function(_0x43ad09){return{'name':_0x43ad09[_0x2ff2('0x33')],'type':_0x43ad09['type'][_0x2ff2('0x34')]};});_0x2ae4e2[_0x2ff2('0x35')]=_[_0x2ff2('0x36')](_0x49f383,'name');_0x2ae4e2['query']=_[_0x2ff2('0x37')](_0x3e640a[_0x2ff2('0x38')]);_0x2ae4e2['filters']=_[_0x2ff2('0x39')](_0x2ae4e2[_0x2ff2('0x35')],_0x2ae4e2[_0x2ff2('0x38')]);_0x516ae5[_0x2ff2('0x3a')]=_[_0x2ff2('0x39')](_0x2ae4e2['model'],qs['fields'](_0x3e640a['query'][_0x2ff2('0x3b')]));_0x516ae5[_0x2ff2('0x3a')]=_0x516ae5[_0x2ff2('0x3a')]['length']?_0x516ae5[_0x2ff2('0x3a')]:_0x2ae4e2[_0x2ff2('0x35')];if(!_0x3e640a[_0x2ff2('0x38')][_0x2ff2('0x3c')](_0x2ff2('0x3d'))){_0x516ae5[_0x2ff2('0x23')]=qs[_0x2ff2('0x23')](_0x3e640a[_0x2ff2('0x38')][_0x2ff2('0x23')]);_0x516ae5[_0x2ff2('0x21')]=qs[_0x2ff2('0x21')](_0x3e640a[_0x2ff2('0x38')][_0x2ff2('0x21')]);}_0x516ae5[_0x2ff2('0x3e')]=qs['sort'](_0x3e640a[_0x2ff2('0x38')][_0x2ff2('0x3f')]);_0x516ae5[_0x2ff2('0x40')]=qs['filters'](_[_0x2ff2('0x41')](_0x3e640a[_0x2ff2('0x38')],_0x2ae4e2[_0x2ff2('0x42')]),_0x49f383);if(_0x3e640a[_0x2ff2('0x38')]['filter']){_0x516ae5[_0x2ff2('0x40')]=_['merge'](_0x516ae5[_0x2ff2('0x40')],{'$or':_['map'](_0x49f383,function(_0x188f5b){if(_0x188f5b[_0x2ff2('0x43')]!=='VIRTUAL'){var _0xd31520={};_0xd31520[_0x188f5b[_0x2ff2('0x2e')]]={'$like':'%'+_0x3e640a[_0x2ff2('0x38')][_0x2ff2('0x44')]+'%'};return _0xd31520;}})});}_0x516ae5=_[_0x2ff2('0x45')]({},_0x516ae5,_0x3e640a[_0x2ff2('0x46')]);var _0xa427ea={'where':_0x516ae5[_0x2ff2('0x40')]};return db['CmHopperBlack']['count'](_0xa427ea)[_0x2ff2('0x2a')](function(_0x1be094){_0x5dcd4d[_0x2ff2('0x24')]=_0x1be094;if(_0x3e640a[_0x2ff2('0x38')][_0x2ff2('0x47')]){_0x516ae5[_0x2ff2('0x48')]=[{'all':!![]}];}return db[_0x2ff2('0x31')][_0x2ff2('0x49')](_0x516ae5);})['then'](function(_0x392755){_0x5dcd4d[_0x2ff2('0x4a')]=_0x392755;return _0x5dcd4d;})['then'](respondWithFilteredResult(_0xbddbe7,_0x516ae5))[_0x2ff2('0x4b')](handleError(_0xbddbe7,null));};exports[_0x2ff2('0x4c')]=function(_0x23bec4,_0x1a8c65){var _0x3b402d={'raw':!![],'where':{'id':_0x23bec4[_0x2ff2('0x4d')]['id']}},_0x144f87={};_0x144f87[_0x2ff2('0x35')]=_[_0x2ff2('0x37')](db[_0x2ff2('0x31')][_0x2ff2('0x32')]);_0x144f87[_0x2ff2('0x38')]=_[_0x2ff2('0x37')](_0x23bec4[_0x2ff2('0x38')]);_0x144f87['filters']=_[_0x2ff2('0x39')](_0x144f87[_0x2ff2('0x35')],_0x144f87[_0x2ff2('0x38')]);_0x3b402d[_0x2ff2('0x3a')]=_['intersection'](_0x144f87[_0x2ff2('0x35')],qs[_0x2ff2('0x3b')](_0x23bec4[_0x2ff2('0x38')][_0x2ff2('0x3b')]));_0x3b402d[_0x2ff2('0x3a')]=_0x3b402d['attributes'][_0x2ff2('0x4e')]?_0x3b402d[_0x2ff2('0x3a')]:_0x144f87[_0x2ff2('0x35')];if(_0x23bec4[_0x2ff2('0x38')]['includeAll']){_0x3b402d[_0x2ff2('0x48')]=[{'all':!![]}];}_0x3b402d=_[_0x2ff2('0x45')]({},_0x3b402d,_0x23bec4[_0x2ff2('0x46')]);return db['CmHopperBlack'][_0x2ff2('0x4f')](_0x3b402d)[_0x2ff2('0x2a')](handleEntityNotFound(_0x1a8c65,null))[_0x2ff2('0x2a')](respondWithResult(_0x1a8c65,null))[_0x2ff2('0x4b')](handleError(_0x1a8c65,null));};exports['update']=function(_0x79e7f7,_0x39b7e4){if(_0x79e7f7['body']['id']){delete _0x79e7f7[_0x2ff2('0x50')]['id'];}return db[_0x2ff2('0x31')][_0x2ff2('0x4f')]({'where':{'id':_0x79e7f7[_0x2ff2('0x4d')]['id']}})[_0x2ff2('0x2a')](handleEntityNotFound(_0x39b7e4,null))[_0x2ff2('0x2a')](saveUpdates(_0x79e7f7[_0x2ff2('0x50')],null))[_0x2ff2('0x2a')](respondWithResult(_0x39b7e4,null))[_0x2ff2('0x4b')](handleError(_0x39b7e4,null));};exports[_0x2ff2('0x29')]=function(_0x615344,_0x2945ba){return db[_0x2ff2('0x31')][_0x2ff2('0x4f')]({'where':{'id':_0x615344[_0x2ff2('0x4d')]['id']}})[_0x2ff2('0x2a')](handleEntityNotFound(_0x2945ba,null))[_0x2ff2('0x2a')](removeEntity(_0x2945ba,null))[_0x2ff2('0x4b')](handleError(_0x2945ba,null));};exports[_0x2ff2('0x51')]=function(_0x3482f4,_0x15d6f5){return db['CmHopperBlack'][_0x2ff2('0x51')]()[_0x2ff2('0x2a')](respondWithResult(_0x15d6f5,null))[_0x2ff2('0x4b')](handleError(_0x15d6f5,null));}; \ No newline at end of file +var _0x8270=['VIRTUAL','filter','options','CmHopperBlack','include','findAll','rows','catch','show','params','includeAll','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type'];(function(_0x26139d,_0x12206b){var _0x1bd4a9=function(_0x9f4228){while(--_0x9f4228){_0x26139d['push'](_0x26139d['shift']());}};_0x1bd4a9(++_0x12206b);}(_0x8270,0xe3));var _0x0827=function(_0x1c16c8,_0x134fe3){_0x1c16c8=_0x1c16c8-0x0;var _0x2e9719=_0x8270[_0x1c16c8];return _0x2e9719;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0827('0x0'));var jsonpatch=require(_0x0827('0x1'));var rp=require(_0x0827('0x2'));var moment=require(_0x0827('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x0827('0x4'));var sox=require(_0x0827('0x5'));var csv=require(_0x0827('0x6'));var ejs=require(_0x0827('0x7'));var fs=require('fs');var fs_extra=require(_0x0827('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0827('0x9'));var deskjs=require(_0x0827('0xa'));var toCsv=require(_0x0827('0x6'));var querystring=require(_0x0827('0xb'));var Papa=require(_0x0827('0xc'));var Redis=require(_0x0827('0xd'));var authService=require(_0x0827('0xe'));var qs=require(_0x0827('0xf'));var as=require(_0x0827('0x10'));var hardwareService=require(_0x0827('0x11'));var logger=require(_0x0827('0x12'))(_0x0827('0x13'));var utils=require(_0x0827('0x14'));var config=require(_0x0827('0x15'));var licenseUtil=require(_0x0827('0x16'));var db=require(_0x0827('0x17'))['db'];function respondWithStatusCode(_0x1f8f18,_0x55fdac){_0x55fdac=_0x55fdac||0xcc;return function(_0x454ecf){if(_0x454ecf){return _0x1f8f18['sendStatus'](_0x55fdac);}return _0x1f8f18[_0x0827('0x18')](_0x55fdac)[_0x0827('0x19')]();};}function respondWithResult(_0x410410,_0x31e8dd){_0x31e8dd=_0x31e8dd||0xc8;return function(_0x52ebd0){if(_0x52ebd0){return _0x410410[_0x0827('0x18')](_0x31e8dd)[_0x0827('0x1a')](_0x52ebd0);}};}function respondWithFilteredResult(_0x48f6c0,_0x4dae6b){return function(_0xc0c89d){if(_0xc0c89d){var _0x48a911=typeof _0x4dae6b[_0x0827('0x1b')]===_0x0827('0x1c')&&typeof _0x4dae6b[_0x0827('0x1d')]===_0x0827('0x1c');var _0x5ba0e9=_0xc0c89d[_0x0827('0x1e')];var _0x36b91d=_0x48a911?0x0:_0x4dae6b[_0x0827('0x1b')];var _0x44626f=_0x48a911?_0xc0c89d[_0x0827('0x1e')]:_0x4dae6b['offset']+_0x4dae6b[_0x0827('0x1d')];var _0x2ad0cb;if(_0x44626f>=_0x5ba0e9){_0x44626f=_0x5ba0e9;_0x2ad0cb=0xc8;}else{_0x2ad0cb=0xce;}_0x48f6c0[_0x0827('0x18')](_0x2ad0cb);return _0x48f6c0['set'](_0x0827('0x1f'),_0x36b91d+'-'+_0x44626f+'/'+_0x5ba0e9)[_0x0827('0x1a')](_0xc0c89d);}return null;};}function patchUpdates(_0x3cbfb6){return function(_0x1793a6){try{jsonpatch[_0x0827('0x20')](_0x1793a6,_0x3cbfb6,!![]);}catch(_0x244d65){return BPromise['reject'](_0x244d65);}return _0x1793a6[_0x0827('0x21')]();};}function saveUpdates(_0x59ad84,_0x2840cd){return function(_0x156103){if(_0x156103){return _0x156103[_0x0827('0x22')](_0x59ad84)[_0x0827('0x23')](function(_0x187476){return _0x187476;});}return null;};}function removeEntity(_0x3a0087,_0x4e11a3){return function(_0x4bde4b){if(_0x4bde4b){return _0x4bde4b['destroy']()[_0x0827('0x23')](function(){_0x3a0087[_0x0827('0x18')](0xcc)[_0x0827('0x19')]();});}};}function handleEntityNotFound(_0x309219,_0x30cf94){return function(_0x3073e0){if(!_0x3073e0){_0x309219[_0x0827('0x24')](0x194);}return _0x3073e0;};}function handleError(_0x14ba93,_0x42d557){_0x42d557=_0x42d557||0x1f4;return function(_0x54c617){logger[_0x0827('0x25')](_0x54c617[_0x0827('0x26')]);if(_0x54c617['name']){delete _0x54c617[_0x0827('0x27')];}_0x14ba93[_0x0827('0x18')](_0x42d557)['send'](_0x54c617);};}exports['index']=function(_0x48937b,_0x29f70a){var _0xc86a68={},_0x527835={},_0x437426={'count':0x0,'rows':[]};var _0x4d6e05=_[_0x0827('0x28')](db['CmHopperBlack'][_0x0827('0x29')],function(_0x5aa960){return{'name':_0x5aa960['fieldName'],'type':_0x5aa960['type']['key']};});_0x527835[_0x0827('0x2a')]=_['map'](_0x4d6e05,_0x0827('0x27'));_0x527835[_0x0827('0x2b')]=_[_0x0827('0x2c')](_0x48937b[_0x0827('0x2b')]);_0x527835[_0x0827('0x2d')]=_[_0x0827('0x2e')](_0x527835[_0x0827('0x2a')],_0x527835[_0x0827('0x2b')]);_0xc86a68[_0x0827('0x2f')]=_[_0x0827('0x2e')](_0x527835['model'],qs[_0x0827('0x30')](_0x48937b[_0x0827('0x2b')]['fields']));_0xc86a68[_0x0827('0x2f')]=_0xc86a68[_0x0827('0x2f')][_0x0827('0x31')]?_0xc86a68[_0x0827('0x2f')]:_0x527835['model'];if(!_0x48937b[_0x0827('0x2b')][_0x0827('0x32')]('nolimit')){_0xc86a68[_0x0827('0x1d')]=qs[_0x0827('0x1d')](_0x48937b[_0x0827('0x2b')][_0x0827('0x1d')]);_0xc86a68['offset']=qs[_0x0827('0x1b')](_0x48937b[_0x0827('0x2b')][_0x0827('0x1b')]);}_0xc86a68[_0x0827('0x33')]=qs[_0x0827('0x34')](_0x48937b[_0x0827('0x2b')]['sort']);_0xc86a68[_0x0827('0x35')]=qs[_0x0827('0x2d')](_[_0x0827('0x36')](_0x48937b[_0x0827('0x2b')],_0x527835[_0x0827('0x2d')]),_0x4d6e05);if(_0x48937b[_0x0827('0x2b')]['filter']){_0xc86a68['where']=_[_0x0827('0x37')](_0xc86a68['where'],{'$or':_['map'](_0x4d6e05,function(_0x30df35){if(_0x30df35[_0x0827('0x38')]!==_0x0827('0x39')){var _0x5ef676={};_0x5ef676[_0x30df35[_0x0827('0x27')]]={'$like':'%'+_0x48937b['query'][_0x0827('0x3a')]+'%'};return _0x5ef676;}})});}_0xc86a68=_['merge']({},_0xc86a68,_0x48937b[_0x0827('0x3b')]);var _0xf0f355={'where':_0xc86a68[_0x0827('0x35')]};return db[_0x0827('0x3c')][_0x0827('0x1e')](_0xf0f355)[_0x0827('0x23')](function(_0x2e18b0){_0x437426[_0x0827('0x1e')]=_0x2e18b0;if(_0x48937b[_0x0827('0x2b')]['includeAll']){_0xc86a68[_0x0827('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0827('0x3e')](_0xc86a68);})[_0x0827('0x23')](function(_0x2c8fe8){_0x437426[_0x0827('0x3f')]=_0x2c8fe8;return _0x437426;})[_0x0827('0x23')](respondWithFilteredResult(_0x29f70a,_0xc86a68))[_0x0827('0x40')](handleError(_0x29f70a,null));};exports[_0x0827('0x41')]=function(_0x1a934f,_0x106fb1){var _0x57e6c3={'raw':!![],'where':{'id':_0x1a934f[_0x0827('0x42')]['id']}},_0x2eeffa={};_0x2eeffa[_0x0827('0x2a')]=_[_0x0827('0x2c')](db[_0x0827('0x3c')][_0x0827('0x29')]);_0x2eeffa[_0x0827('0x2b')]=_['keys'](_0x1a934f[_0x0827('0x2b')]);_0x2eeffa[_0x0827('0x2d')]=_[_0x0827('0x2e')](_0x2eeffa['model'],_0x2eeffa[_0x0827('0x2b')]);_0x57e6c3['attributes']=_[_0x0827('0x2e')](_0x2eeffa[_0x0827('0x2a')],qs[_0x0827('0x30')](_0x1a934f[_0x0827('0x2b')][_0x0827('0x30')]));_0x57e6c3[_0x0827('0x2f')]=_0x57e6c3['attributes']['length']?_0x57e6c3['attributes']:_0x2eeffa['model'];if(_0x1a934f[_0x0827('0x2b')][_0x0827('0x43')]){_0x57e6c3[_0x0827('0x3d')]=[{'all':!![]}];}_0x57e6c3=_[_0x0827('0x37')]({},_0x57e6c3,_0x1a934f[_0x0827('0x3b')]);return db['CmHopperBlack'][_0x0827('0x44')](_0x57e6c3)[_0x0827('0x23')](handleEntityNotFound(_0x106fb1,null))[_0x0827('0x23')](respondWithResult(_0x106fb1,null))[_0x0827('0x40')](handleError(_0x106fb1,null));};exports['update']=function(_0x4eaf06,_0x3e845e){if(_0x4eaf06[_0x0827('0x45')]['id']){delete _0x4eaf06[_0x0827('0x45')]['id'];}return db['CmHopperBlack'][_0x0827('0x44')]({'where':{'id':_0x4eaf06[_0x0827('0x42')]['id']}})[_0x0827('0x23')](handleEntityNotFound(_0x3e845e,null))[_0x0827('0x23')](saveUpdates(_0x4eaf06[_0x0827('0x45')],null))[_0x0827('0x23')](respondWithResult(_0x3e845e,null))['catch'](handleError(_0x3e845e,null));};exports['destroy']=function(_0x2d37bb,_0x419cb6){return db[_0x0827('0x3c')]['find']({'where':{'id':_0x2d37bb['params']['id']}})[_0x0827('0x23')](handleEntityNotFound(_0x419cb6,null))[_0x0827('0x23')](removeEntity(_0x419cb6,null))[_0x0827('0x40')](handleError(_0x419cb6,null));};exports[_0x0827('0x46')]=function(_0x331afe,_0x20f6e0){return db[_0x0827('0x3c')][_0x0827('0x46')]()['then'](respondWithResult(_0x20f6e0,null))[_0x0827('0x40')](handleError(_0x20f6e0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index d8c3635..f12fe92 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 _0x5417=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x5417,0x6f));var _0x7541=function(_0x200a15,_0x3ceffa){_0x200a15=_0x200a15-0x0;var _0x154644=_0x5417[_0x200a15];return _0x154644;};'use strict';var _=require(_0x7541('0x0'));var util=require(_0x7541('0x1'));var logger=require(_0x7541('0x2'))(_0x7541('0x3'));var moment=require(_0x7541('0x4'));var BPromise=require(_0x7541('0x5'));var rp=require(_0x7541('0x6'));var fs=require('fs');var path=require(_0x7541('0x7'));var rimraf=require(_0x7541('0x8'));var config=require('../../config/environment');var attributes=require(_0x7541('0x9'));module[_0x7541('0xa')]=function(_0x2f788b,_0x4a6443){return _0x2f788b[_0x7541('0xb')](_0x7541('0xc'),attributes,{'tableName':_0x7541('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68e3=['./cmHopperBlack.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x4bd563,_0x30f1b7){var _0x26a5bf=function(_0x5a3227){while(--_0x5a3227){_0x4bd563['push'](_0x4bd563['shift']());}};_0x26a5bf(++_0x30f1b7);}(_0x68e3,0x70));var _0x368e=function(_0x409d96,_0x183edb){_0x409d96=_0x409d96-0x0;var _0x12df8b=_0x68e3[_0x409d96];return _0x12df8b;};'use strict';var _=require(_0x368e('0x0'));var util=require(_0x368e('0x1'));var logger=require(_0x368e('0x2'))(_0x368e('0x3'));var moment=require(_0x368e('0x4'));var BPromise=require(_0x368e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x368e('0x6'));var rimraf=require('rimraf');var config=require(_0x368e('0x7'));var attributes=require(_0x368e('0x8'));module['exports']=function(_0xefb518,_0x52d173){return _0xefb518[_0x368e('0x9')]('CmHopperBlack',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 1b54c72..7f5839c 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 _0xa3ad=['then','info','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','include','map','model','debug','UpdateCmHopperBlack','update','body','raw','limit','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x8c1c81,_0x15b8ff){var _0x57ea38=function(_0x4b80c3){while(--_0x4b80c3){_0x8c1c81['push'](_0x8c1c81['shift']());}};_0x57ea38(++_0x15b8ff);}(_0xa3ad,0x116));var _0xda3a=function(_0x1da349,_0x8403f7){_0x1da349=_0x1da349-0x0;var _0x522aba=_0xa3ad[_0x1da349];return _0x522aba;};'use strict';var _=require(_0xda3a('0x0'));var util=require('util');var moment=require(_0xda3a('0x1'));var BPromise=require(_0xda3a('0x2'));var rs=require(_0xda3a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda3a('0x4'))['db'];var utils=require(_0xda3a('0x5'));var logger=require(_0xda3a('0x6'))('rpc');var config=require(_0xda3a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda3a('0x8')][_0xda3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55333f,_0x10b6c0,_0x3b2864){return new BPromise(function(_0x1c88a6,_0x22d9ec){return client['request'](_0x55333f,_0x3b2864)[_0xda3a('0xa')](function(_0x28a8bb){logger[_0xda3a('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x10b6c0,_0xda3a('0xc'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x10b6c0,'request\x20sent',JSON[_0xda3a('0xd')](_0x28a8bb));if(_0x28a8bb[_0xda3a('0xe')]){if(_0x28a8bb[_0xda3a('0xe')][_0xda3a('0xf')]===0x1f4){logger[_0xda3a('0xe')](_0xda3a('0x10'),_0x10b6c0,_0x28a8bb[_0xda3a('0xe')][_0xda3a('0x11')]);return _0x22d9ec(_0x28a8bb[_0xda3a('0xe')][_0xda3a('0x11')]);}logger[_0xda3a('0xe')](_0xda3a('0x10'),_0x10b6c0,_0x28a8bb['error'][_0xda3a('0x11')]);return _0x1c88a6(_0x28a8bb[_0xda3a('0xe')][_0xda3a('0x11')]);}else{logger[_0xda3a('0xb')](_0xda3a('0x10'),_0x10b6c0,_0xda3a('0xc'));_0x1c88a6(_0x28a8bb['result']['message']);}})[_0xda3a('0x12')](function(_0x2644ab){logger[_0xda3a('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x10b6c0,_0x2644ab);_0x22d9ec(_0x2644ab);});});}exports[_0xda3a('0x13')]=function(_0x3870aa){var _0x5e8e5b=this;return new Promise(function(_0x579fbf,_0x22aa7b){return db[_0xda3a('0x14')][_0xda3a('0x15')]({'raw':_0x3870aa[_0xda3a('0x16')]?_0x3870aa[_0xda3a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3870aa[_0xda3a('0x16')]?_0x3870aa[_0xda3a('0x16')][_0xda3a('0x17')]||null:null,'attributes':_0x3870aa[_0xda3a('0x16')]?_0x3870aa[_0xda3a('0x16')][_0xda3a('0x18')]||null:null,'limit':_0x3870aa[_0xda3a('0x16')]?_0x3870aa['options']['limit']||null:null,'include':_0x3870aa['options']?_0x3870aa[_0xda3a('0x16')][_0xda3a('0x19')]?_[_0xda3a('0x1a')](_0x3870aa[_0xda3a('0x16')]['include'],function(_0x4de9a2){return{'model':db[_0x4de9a2[_0xda3a('0x1b')]],'as':_0x4de9a2['as'],'attributes':_0x4de9a2['attributes'],'include':_0x4de9a2[_0xda3a('0x19')]?_[_0xda3a('0x1a')](_0x4de9a2[_0xda3a('0x19')],function(_0x1af985){return{'model':db[_0x1af985[_0xda3a('0x1b')]],'as':_0x1af985['as'],'attributes':_0x1af985[_0xda3a('0x18')],'include':_0x1af985['include']?_['map'](_0x1af985[_0xda3a('0x19')],function(_0x34d59e){return{'model':db[_0x34d59e[_0xda3a('0x1b')]],'as':_0x34d59e['as'],'attributes':_0x34d59e[_0xda3a('0x18')]};}):[]};}):[]};}):[]:[]})[_0xda3a('0xa')](function(_0x12d3b8){logger['info'](_0xda3a('0x13'),_0x3870aa);logger[_0xda3a('0x1c')](_0xda3a('0x13'),_0x3870aa,JSON[_0xda3a('0xd')](_0x12d3b8));_0x579fbf(_0x12d3b8);})[_0xda3a('0x12')](function(_0x1aceda){logger[_0xda3a('0xe')]('GetCmHopperBlack',_0x1aceda[_0xda3a('0x11')],_0x3870aa);_0x22aa7b(_0x5e8e5b['error'](0x1f4,_0x1aceda[_0xda3a('0x11')]));});});};exports[_0xda3a('0x1d')]=function(_0x2062a4){var _0x53cc65=this;return new Promise(function(_0x47e2ef,_0x298ddd){return db[_0xda3a('0x14')][_0xda3a('0x1e')](_0x2062a4[_0xda3a('0x1f')],{'raw':_0x2062a4[_0xda3a('0x16')]?_0x2062a4[_0xda3a('0x16')][_0xda3a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2062a4[_0xda3a('0x16')]?_0x2062a4[_0xda3a('0x16')]['where']||null:null,'attributes':_0x2062a4[_0xda3a('0x16')]?_0x2062a4['options'][_0xda3a('0x18')]||null:null,'limit':_0x2062a4[_0xda3a('0x16')]?_0x2062a4[_0xda3a('0x16')][_0xda3a('0x21')]||null:null})[_0xda3a('0xa')](function(_0x413374){logger['info']('UpdateCmHopperBlack',_0x2062a4);logger['debug']('UpdateCmHopperBlack',_0x2062a4,JSON[_0xda3a('0xd')](_0x413374));_0x47e2ef(_0x413374);})['catch'](function(_0x3391a7){logger[_0xda3a('0xe')](_0xda3a('0x1d'),_0x3391a7['message'],_0x2062a4);_0x298ddd(_0x53cc65[_0xda3a('0xe')](0x1f4,_0x3391a7[_0xda3a('0x11')]));});});};exports[_0xda3a('0x22')]=function(_0x36c086){var _0x3793c8=this;return new Promise(function(_0x2e16c6,_0x552845){return db[_0xda3a('0x14')][_0xda3a('0x23')]({'where':_0x36c086[_0xda3a('0x16')]?_0x36c086[_0xda3a('0x16')][_0xda3a('0x17')]||null:null})[_0xda3a('0xa')](function(_0x5b5041){logger['info'](_0xda3a('0x22'),_0x36c086);logger[_0xda3a('0x1c')](_0xda3a('0x22'),_0x36c086,JSON[_0xda3a('0xd')](_0x5b5041));_0x2e16c6(_0x5b5041);})[_0xda3a('0x12')](function(_0x27cba4){logger['error'](_0xda3a('0x22'),_0x27cba4[_0xda3a('0x11')],_0x36c086);_0x552845(_0x3793c8[_0xda3a('0xe')](0x1f4,_0x27cba4[_0xda3a('0x11')]));});});}; \ No newline at end of file +var _0xbcba=['CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map','attributes','model','stringify','update','body','where','UpdateCmHopperBlack','debug','DestroyCmHopperBlack','destroy','util','moment','ioredis','../../config/logger','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xbcba,0x15d));var _0xabcb=function(_0x5980a0,_0x285a3d){_0x5980a0=_0x5980a0-0x0;var _0x2b4a56=_0xbcba[_0x5980a0];return _0x2b4a56;};'use strict';var _=require('lodash');var util=require(_0xabcb('0x0'));var moment=require(_0xabcb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabcb('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xabcb('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xabcb('0x4'));var client=jayson[_0xabcb('0x5')][_0xabcb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x41a203,_0xf24c6a,_0x11b24c){return new BPromise(function(_0x36a582,_0xe419f2){return client[_0xabcb('0x7')](_0x41a203,_0x11b24c)[_0xabcb('0x8')](function(_0x4c01df){logger['info'](_0xabcb('0x9'),_0xf24c6a,_0xabcb('0xa'));logger['debug'](_0xabcb('0xb'),_0xf24c6a,_0xabcb('0xa'),JSON['stringify'](_0x4c01df));if(_0x4c01df[_0xabcb('0xc')]){if(_0x4c01df[_0xabcb('0xc')][_0xabcb('0xd')]===0x1f4){logger[_0xabcb('0xc')](_0xabcb('0x9'),_0xf24c6a,_0x4c01df['error']['message']);return _0xe419f2(_0x4c01df[_0xabcb('0xc')][_0xabcb('0xe')]);}logger['error'](_0xabcb('0x9'),_0xf24c6a,_0x4c01df[_0xabcb('0xc')][_0xabcb('0xe')]);return _0x36a582(_0x4c01df['error']['message']);}else{logger[_0xabcb('0xf')](_0xabcb('0x9'),_0xf24c6a,_0xabcb('0xa'));_0x36a582(_0x4c01df[_0xabcb('0x10')][_0xabcb('0xe')]);}})[_0xabcb('0x11')](function(_0x823761){logger[_0xabcb('0xc')](_0xabcb('0x9'),_0xf24c6a,_0x823761);_0xe419f2(_0x823761);});});}exports[_0xabcb('0x12')]=function(_0x2ab4af){var _0x2d5acf=this;return new Promise(function(_0x39195d,_0xd20825){return db[_0xabcb('0x13')][_0xabcb('0x14')]({'raw':_0x2ab4af[_0xabcb('0x15')]?_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x16')]===undefined?!![]:![]:!![],'where':_0x2ab4af[_0xabcb('0x15')]?_0x2ab4af[_0xabcb('0x15')]['where']||null:null,'attributes':_0x2ab4af['options']?_0x2ab4af[_0xabcb('0x15')]['attributes']||null:null,'limit':_0x2ab4af['options']?_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x17')]||null:null,'include':_0x2ab4af[_0xabcb('0x15')]?_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x18')]?_[_0xabcb('0x19')](_0x2ab4af[_0xabcb('0x15')][_0xabcb('0x18')],function(_0x562b85){return{'model':db[_0x562b85['model']],'as':_0x562b85['as'],'attributes':_0x562b85['attributes'],'include':_0x562b85[_0xabcb('0x18')]?_['map'](_0x562b85['include'],function(_0xaf217d){return{'model':db[_0xaf217d['model']],'as':_0xaf217d['as'],'attributes':_0xaf217d[_0xabcb('0x1a')],'include':_0xaf217d[_0xabcb('0x18')]?_[_0xabcb('0x19')](_0xaf217d[_0xabcb('0x18')],function(_0x54f83e){return{'model':db[_0x54f83e[_0xabcb('0x1b')]],'as':_0x54f83e['as'],'attributes':_0x54f83e[_0xabcb('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd7965f){logger[_0xabcb('0xf')](_0xabcb('0x12'),_0x2ab4af);logger['debug'](_0xabcb('0x12'),_0x2ab4af,JSON[_0xabcb('0x1c')](_0xd7965f));_0x39195d(_0xd7965f);})[_0xabcb('0x11')](function(_0x2de1c8){logger[_0xabcb('0xc')](_0xabcb('0x12'),_0x2de1c8['message'],_0x2ab4af);_0xd20825(_0x2d5acf['error'](0x1f4,_0x2de1c8[_0xabcb('0xe')]));});});};exports['UpdateCmHopperBlack']=function(_0x46ea76){var _0x407f12=this;return new Promise(function(_0x6bd534,_0x2cfa2b){return db[_0xabcb('0x13')][_0xabcb('0x1d')](_0x46ea76[_0xabcb('0x1e')],{'raw':_0x46ea76[_0xabcb('0x15')]?_0x46ea76['options'][_0xabcb('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46ea76[_0xabcb('0x15')]?_0x46ea76[_0xabcb('0x15')][_0xabcb('0x1f')]||null:null,'attributes':_0x46ea76['options']?_0x46ea76[_0xabcb('0x15')][_0xabcb('0x1a')]||null:null,'limit':_0x46ea76[_0xabcb('0x15')]?_0x46ea76[_0xabcb('0x15')][_0xabcb('0x17')]||null:null})[_0xabcb('0x8')](function(_0x383cf7){logger[_0xabcb('0xf')](_0xabcb('0x20'),_0x46ea76);logger[_0xabcb('0x21')](_0xabcb('0x20'),_0x46ea76,JSON[_0xabcb('0x1c')](_0x383cf7));_0x6bd534(_0x383cf7);})[_0xabcb('0x11')](function(_0x40db64){logger['error'](_0xabcb('0x20'),_0x40db64[_0xabcb('0xe')],_0x46ea76);_0x2cfa2b(_0x407f12[_0xabcb('0xc')](0x1f4,_0x40db64[_0xabcb('0xe')]));});});};exports[_0xabcb('0x22')]=function(_0x2c4848){var _0x34b99a=this;return new Promise(function(_0x5b327b,_0x24f85f){return db['CmHopperBlack'][_0xabcb('0x23')]({'where':_0x2c4848['options']?_0x2c4848[_0xabcb('0x15')][_0xabcb('0x1f')]||null:null})[_0xabcb('0x8')](function(_0x41f34c){logger[_0xabcb('0xf')]('DestroyCmHopperBlack',_0x2c4848);logger[_0xabcb('0x21')](_0xabcb('0x22'),_0x2c4848,JSON[_0xabcb('0x1c')](_0x41f34c));_0x5b327b(_0x41f34c);})[_0xabcb('0x11')](function(_0x1608b3){logger[_0xabcb('0xc')](_0xabcb('0x22'),_0x1608b3['message'],_0x2c4848);_0x24f85f(_0x34b99a['error'](0x1f4,_0x1608b3['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8dd6870..9dc9b42 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 _0x5fab=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x23723a,_0x593357){var _0x178d43=function(_0x3d904d){while(--_0x3d904d){_0x23723a['push'](_0x23723a['shift']());}};_0x178d43(++_0x593357);}(_0x5fab,0x177));var _0xb5fa=function(_0x5b4303,_0x225e71){_0x5b4303=_0x5b4303-0x0;var _0x1aacba=_0x5fab[_0x5b4303];return _0x1aacba;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['put']('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);module[_0xb5fa('0x13')]=router; \ No newline at end of file +var _0x1623=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x496125,_0x1a7e95){var _0x14f595=function(_0x41506d){while(--_0x41506d){_0x496125['push'](_0x496125['shift']());}};_0x14f595(++_0x1a7e95);}(_0x1623,0xab));var _0x3162=function(_0x2d4557,_0x116764){_0x2d4557=_0x2d4557-0x0;var _0x3882d1=_0x1623[_0x2d4557];return _0x3882d1;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3162('0xf')]);router[_0x3162('0x10')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x11')]);module[_0x3162('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 24aa91b..d35c2a0 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 _0xf0b2=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','BOOLEAN','sequelize'];(function(_0x2476e1,_0x5e4ce0){var _0x18b26a=function(_0x3548e2){while(--_0x3548e2){_0x2476e1['push'](_0x2476e1['shift']());}};_0x18b26a(++_0x5e4ce0);}(_0xf0b2,0xd7));var _0x2f0b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xf0b2[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x2f0b('0x0'));var moment=require(_0x2f0b('0x1'));module[_0x2f0b('0x2')]={'state':{'type':Sequelize[_0x2f0b('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x2f0b('0x4')]},'scheduledat':{'type':Sequelize[_0x2f0b('0x5')]},'countbusyretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2f0b('0x4')]},'originatecalleridname':{'type':Sequelize[_0x2f0b('0x4')]},'calleridnum':{'type':Sequelize[_0x2f0b('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2f0b('0x5')]},'answertime':{'type':Sequelize[_0x2f0b('0x5')]},'droptime':{'type':Sequelize[_0x2f0b('0x5')]},'endtime':{'type':Sequelize[_0x2f0b('0x5')]},'ringtime':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2f0b('0x4')]},'campaign':{'type':Sequelize[_0x2f0b('0x4')]},'campaigntype':{'type':Sequelize[_0x2f0b('0x4')]},'membername':{'type':Sequelize[_0x2f0b('0x4')]},'reason':{'type':Sequelize[_0x2f0b('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2f0b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2f0b('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x58b3b5){var _0x1a7dd8=this[_0x2f0b('0x6')](_0x2f0b('0x7'));if(_0x1a7dd8&&_0x58b3b5){this[_0x2f0b('0x8')](_0x2f0b('0x9'),moment(_0x58b3b5)[_0x2f0b('0xa')](moment(_0x1a7dd8),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2f0b('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2f0b('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2f0b('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2f0b('0x5')]},'deleted':{'type':Sequelize[_0x2f0b('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2f0b('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x2f0b('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2f0b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa852=['sequelize','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','seconds','BOOLEAN'];(function(_0x46c4c6,_0x24bf13){var _0x4528c2=function(_0x283dfd){while(--_0x283dfd){_0x46c4c6['push'](_0x46c4c6['shift']());}};_0x4528c2(++_0x24bf13);}(_0xa852,0x14a));var _0x2a85=function(_0x3a63ab,_0x40602f){_0x3a63ab=_0x3a63ab-0x0;var _0x3314e4=_0xa852[_0x3a63ab];return _0x3314e4;};'use strict';var Sequelize=require(_0x2a85('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x2a85('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2a85('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2a85('0x2')]},'calleridnum':{'type':Sequelize[_0x2a85('0x2')]},'calleridname':{'type':Sequelize[_0x2a85('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x2a85('0x3')]},'answertime':{'type':Sequelize[_0x2a85('0x3')]},'droptime':{'type':Sequelize[_0x2a85('0x3')]},'endtime':{'type':Sequelize[_0x2a85('0x3')]},'ringtime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2a85('0x2')]},'membername':{'type':Sequelize[_0x2a85('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x2a85('0x2')]},'secondDisposition':{'type':Sequelize[_0x2a85('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2a85('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x1e8a44){var _0x30ec51=this[_0x2a85('0x4')](_0x2a85('0x5'));if(_0x30ec51&&_0x1e8a44){this[_0x2a85('0x6')](_0x2a85('0x7'),moment(_0x1e8a44)['diff'](moment(_0x30ec51),_0x2a85('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x2a85('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2a85('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x2a85('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2a85('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2a85('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2a85('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index bdec3e3..364d372 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 _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x14634f,_0x5ed190){var _0x5021f9=function(_0x1f4a14){while(--_0x1f4a14){_0x14634f['push'](_0x14634f['shift']());}};_0x5021f9(++_0x5ed190);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));}; \ No newline at end of file +var _0x01d9=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noAnswerContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','updatedAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2bcaf7,_0x23431c){var _0x3630e9=function(_0x36e7e1){while(--_0x36e7e1){_0x2bcaf7['push'](_0x2bcaf7['shift']());}};_0x3630e9(++_0x23431c);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['CmHopperFinal'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')]()[_0x901d('0x28')](respondWithResult(_0x27459b,null))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x2cd965,_0x23f2a9){if(_0x2cd965['body']['uniqueid']){delete _0x2cd965[_0x901d('0x4c')][_0x901d('0x4d')];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'uniqueid':_0x2cd965[_0x901d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23f2a9,null))['then'](saveUpdates(_0x2cd965[_0x901d('0x4c')],null))[_0x901d('0x28')](respondWithResult(_0x23f2a9,null))['catch'](handleError(_0x23f2a9,null));};exports[_0x901d('0x4e')]=function(_0x165207,_0x4d2b2d,_0x4512e5){return db['CmHopperFinal'][_0x901d('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x165207[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),'noAnswerContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x56')))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db['sequelize']['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),'dropContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x4d2b2d,null))['then'](respondWithResult(_0x4d2b2d,null))[_0x901d('0x46')](handleError(_0x4d2b2d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xabab57,_0x219c23,_0xecc8f9){return db[_0x901d('0x2f')][_0x901d('0x4f')]({'raw':![],'where':{'CampaignId':_0xabab57[_0x901d('0x48')]['id']},'attributes':[[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x53')))),_0x901d('0x54')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x55')))),_0x901d('0x5f')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x901d('0x57')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x58')))),_0x901d('0x59')],[db[_0x901d('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5a')))),_0x901d('0x60')],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')][_0x901d('0x52')](_0x901d('0x5b')))),'abandonedContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x901d('0x52')](_0x901d('0x5c')))),'reCallContacts'],[db[_0x901d('0x50')]['fn'](_0x901d('0x51'),db[_0x901d('0x50')]['fn']('IF',db[_0x901d('0x50')]['literal'](_0x901d('0x5d')))),_0x901d('0x5e')]]})[_0x901d('0x28')](handleEntityNotFound(_0x219c23,null))[_0x901d('0x28')](respondWithResult(_0x219c23,null))[_0x901d('0x46')](handleError(_0x219c23,null));};exports[_0x901d('0x61')]=function(_0x5cff96,_0x130dfb,_0x302049){return db[_0x901d('0x62')]['find']({'where':{'id':_0x5cff96[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x130dfb,null))[_0x901d('0x28')](function(_0x4b5e3b){var _0x576d50;if(_0x4b5e3b){_0x576d50=squel['insert']()[_0x901d('0x63')](_0x901d('0x64'))['fromQuery'](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x68'),_0x901d('0x69'),'updatedAt'],squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))['field'](_0x901d('0x6e'),'scheduledAt')[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))[_0x901d('0x6b')](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x70'),_0x901d('0x68'))['field'](_0x901d('0x6e'),_0x901d('0x69'))['field'](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')['where'](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id']['toString']())[_0x901d('0x3e')](_0x901d('0x72'),_0x5cff96[_0x901d('0x4c')][_0x901d('0x73')][_0x901d('0x74')]())['where'](_0x901d('0x75'))[_0x901d('0x3e')](_0x901d('0x76'),squel['select']()[_0x901d('0x6b')](_0x901d('0x6d'))[_0x901d('0x77')](_0x901d('0x64'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x71'),_0x5cff96[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')](_0x901d('0x7a')))[_0x901d('0x7b')]('ContactId'))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x576d50);}return[];})['then'](respondWithResult(_0x130dfb,null))[_0x901d('0x46')](handleError(_0x130dfb,null));};exports[_0x901d('0x7c')]=function(_0xa14cbd,_0x34f33f,_0x785f77){return db[_0x901d('0x7d')][_0x901d('0x4a')]({'where':{'id':_0xa14cbd[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x34f33f,null))[_0x901d('0x28')](function(_0x28b640){var _0x45601a;if(_0x28b640){_0x45601a=squel[_0x901d('0x7e')]()[_0x901d('0x63')](_0x901d('0x64'))[_0x901d('0x7f')](['phone',_0x901d('0x65'),_0x901d('0x66'),_0x901d('0x67'),_0x901d('0x80'),_0x901d('0x69'),_0x901d('0x81')],squel['select']()[_0x901d('0x6b')](_0x901d('0x6c'),_0x901d('0x6d'))[_0x901d('0x6b')](_0x901d('0x6e'),_0x901d('0x65'))[_0x901d('0x6b')]('ANY_VALUE(ContactId)',_0x901d('0x66'))['field'](_0x901d('0x6f'),_0x901d('0x67'))[_0x901d('0x6b')](_0x901d('0x82'),'CampaignId')['field']('NOW()','createdAt')[_0x901d('0x6b')](_0x901d('0x6e'),'updatedAt')['from']('cm_hopper_final')[_0x901d('0x3e')]('CampaignId\x20=\x20?',_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x20?',_0xa14cbd['body'][_0x901d('0x73')][_0x901d('0x74')]())[_0x901d('0x3e')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x901d('0x6a')]()[_0x901d('0x6b')]('phone')[_0x901d('0x77')]('cm_hopper')['where'](_0x901d('0x83'),_0xa14cbd['params']['id'][_0x901d('0x74')]()))[_0x901d('0x3e')](_0x901d('0x76'),squel[_0x901d('0x6a')]()[_0x901d('0x6b')](_0x901d('0x78'))['from'](_0x901d('0x79'))[_0x901d('0x3e')](_0x901d('0x83'),_0xa14cbd[_0x901d('0x48')]['id'][_0x901d('0x74')]())[_0x901d('0x3e')]('state\x20=\x204'))['group'](_0x901d('0x66')))[_0x901d('0x74')]();return db[_0x901d('0x50')][_0x901d('0x35')](_0x45601a);}return[];})[_0x901d('0x28')](respondWithResult(_0x34f33f,null))[_0x901d('0x46')](handleError(_0x34f33f,null));};exports[_0x901d('0x84')]=function(_0x306491,_0x3cb399,_0x101067){return db['CmHopper'][_0x901d('0x85')]({'where':{'VoiceQueueId':_0x306491[_0x901d('0x4c')][_0x901d('0x68')],'CampaignId':_0x306491[_0x901d('0x4c')][_0x901d('0x80')],'ContactId':_0x306491[_0x901d('0x4c')][_0x901d('0x66')]}})[_0x901d('0x28')](handleEntityNotFound(_0x3cb399,null))[_0x901d('0x28')](function(_0x17b7ef){if(_0x17b7ef){return _0x17b7ef;}return null;})[_0x901d('0x28')](respondWithResult(_0x3cb399,null))[_0x901d('0x46')](handleError(_0x3cb399,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 4041e88..89ab159 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 _0x8415=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','uniqueid','../../config/logger'];(function(_0x209511,_0x231622){var _0x39b937=function(_0x4005a3){while(--_0x4005a3){_0x209511['push'](_0x209511['shift']());}};_0x39b937(++_0x231622);}(_0x8415,0x180));var _0x5841=function(_0x16d068,_0x3be4e3){_0x16d068=_0x16d068-0x0;var _0x1c17ad=_0x8415[_0x16d068];return _0x1c17ad;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5841('0x0'))(_0x5841('0x1'));var moment=require(_0x5841('0x2'));var BPromise=require(_0x5841('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5841('0x4'));var rimraf=require(_0x5841('0x5'));var config=require(_0x5841('0x6'));var attributes=require(_0x5841('0x7'));module[_0x5841('0x8')]=function(_0x42fd63,_0x514315){return _0x42fd63['define'](_0x5841('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x5841('0xa'),'fields':[_0x5841('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1417=['path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3076b5,_0x6bc9df){var _0x5ef5da=function(_0xac1ad1){while(--_0xac1ad1){_0x3076b5['push'](_0x3076b5['shift']());}};_0x5ef5da(++_0x6bc9df);}(_0x1417,0xcc));var _0x7141=function(_0x11dbb9,_0x2c5980){_0x11dbb9=_0x11dbb9-0x0;var _0x23d35d=_0x1417[_0x11dbb9];return _0x23d35d;};'use strict';var _=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var logger=require(_0x7141('0x2'))('api');var moment=require(_0x7141('0x3'));var BPromise=require(_0x7141('0x4'));var rp=require(_0x7141('0x5'));var fs=require('fs');var path=require(_0x7141('0x6'));var rimraf=require(_0x7141('0x7'));var config=require('../../config/environment');var attributes=require(_0x7141('0x8'));module[_0x7141('0x9')]=function(_0x38d372,_0x482c1d){return _0x38d372[_0x7141('0xa')](_0x7141('0xb'),attributes,{'tableName':_0x7141('0xc'),'paranoid':![],'indexes':[{'name':_0x7141('0xd'),'fields':['calleridnum']},{'name':_0x7141('0xe'),'fields':[_0x7141('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 f1be91a..f8d58f3 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(_0x1c958b,_0x25cec4){var _0x2b7657=function(_0x2690be){while(--_0x2690be){_0x1c958b['push'](_0x1c958b['shift']());}};_0x2b7657(++_0x25cec4);}(_0x7a54,0x106));var _0x47a5=function(_0x2bbc93,_0x3dafd0){_0x2bbc93=_0x2bbc93-0x0;var _0x3c821d=_0x7a54[_0x2bbc93];return _0x3c821d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x52ac0e,_0x25833e){var _0x59f8a9=function(_0x25b2ad){while(--_0x25b2ad){_0x52ac0e['push'](_0x52ac0e['shift']());}};_0x59f8a9(++_0x25833e);}(_0xb10b,0x12a));var _0xbb10=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0xb10b[_0x426dd2];return _0x4bc76c;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index fbf4149..9bc19c0 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 _0x32de=['fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x32de,0x7d));var _0xe32d=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x32de[_0x152aa1];return _0x1bc01a;};'use strict';var multer=require(_0xe32d('0x0'));var util=require(_0xe32d('0x1'));var path=require(_0xe32d('0x2'));var timeout=require(_0xe32d('0x3'));var express=require('express');var router=express[_0xe32d('0x4')]();var fs_extra=require(_0xe32d('0x5'));var auth=require(_0xe32d('0x6'));var interaction=require(_0xe32d('0x7'));var config=require('../../config/environment');var controller=require(_0xe32d('0x8'));router[_0xe32d('0x9')]('/',auth[_0xe32d('0xa')](),controller['index']);router[_0xe32d('0x9')]('/describe',auth[_0xe32d('0xa')](),controller[_0xe32d('0xb')]);router[_0xe32d('0x9')](_0xe32d('0xc'),auth[_0xe32d('0xa')](),controller[_0xe32d('0xd')]);router[_0xe32d('0x9')](_0xe32d('0xe'),auth['isAuthenticated'](),controller[_0xe32d('0xf')]);router['get']('/campaign/countAttributes/:id',auth[_0xe32d('0xa')](),controller[_0xe32d('0x10')]);router[_0xe32d('0x11')](_0xe32d('0x12'),auth[_0xe32d('0xa')](),controller[_0xe32d('0x13')]);router['post']('/voice/campaign/moveContacts/:id',auth[_0xe32d('0xa')](),controller[_0xe32d('0x14')]);router[_0xe32d('0x11')](_0xe32d('0x15'),auth[_0xe32d('0xa')](),controller[_0xe32d('0x16')]);router[_0xe32d('0x17')]('/:id',auth[_0xe32d('0xa')](),controller[_0xe32d('0x18')]);module[_0xe32d('0x19')]=router; \ No newline at end of file +var _0x5f4d=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','express','Router','../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe'];(function(_0x21ac50,_0x2256ed){var _0x29744b=function(_0x560a6d){while(--_0x560a6d){_0x21ac50['push'](_0x21ac50['shift']());}};_0x29744b(++_0x2256ed);}(_0x5f4d,0x91));var _0xd5f4=function(_0x28e196,_0x55ea66){_0x28e196=_0x28e196-0x0;var _0xebe98e=_0x5f4d[_0x28e196];return _0xebe98e;};'use strict';var multer=require(_0xd5f4('0x0'));var util=require(_0xd5f4('0x1'));var path=require(_0xd5f4('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5f4('0x3'));var router=express[_0xd5f4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd5f4('0x5'));var config=require('../../config/environment');var controller=require(_0xd5f4('0x6'));router[_0xd5f4('0x7')]('/',auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x9')]);router[_0xd5f4('0x7')](_0xd5f4('0xa'),auth[_0xd5f4('0x8')](),controller['describe']);router[_0xd5f4('0x7')](_0xd5f4('0xb'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0xc')]);router['get'](_0xd5f4('0xd'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0xe')]);router['get'](_0xd5f4('0xf'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x10')]);router[_0xd5f4('0x11')](_0xd5f4('0x12'),auth['isAuthenticated'](),controller[_0xd5f4('0x13')]);router[_0xd5f4('0x11')](_0xd5f4('0x14'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x15')]);router['post']('/checkContactHopper',auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x16')]);router[_0xd5f4('0x17')](_0xd5f4('0xb'),auth[_0xd5f4('0x8')](),controller[_0xd5f4('0x18')]);module[_0xd5f4('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 d80985d..220e1a6 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 _0x219d=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x52bbab,_0x2de274){var _0x2cc661=function(_0x4d4de6){while(--_0x4d4de6){_0x52bbab['push'](_0x52bbab['shift']());}};_0x2cc661(++_0x2de274);}(_0x219d,0xa4));var _0xd219=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x219d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd219('0x0'));module[_0xd219('0x1')]={'state':{'type':Sequelize[_0xd219('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd219('0x3')]},'scheduledat':{'type':Sequelize[_0xd219('0x4')]},'countbusyretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd219('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xd219('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd219('0x3')]},'starttime':{'type':Sequelize[_0xd219('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xd219('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd219('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd219('0x3')]},'campaign':{'type':Sequelize[_0xd219('0x3')]},'campaigntype':{'type':Sequelize[_0xd219('0x3')]},'membername':{'type':Sequelize[_0xd219('0x3')]},'reason':{'type':Sequelize[_0xd219('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd219('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd219('0x4')]},'recallme':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd219('0x4')]},'edited':{'type':Sequelize[_0xd219('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd219('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd219('0x3')]}}; \ No newline at end of file +var _0x4aef=['BOOLEAN','exports','INTEGER','STRING','DATE'];(function(_0x50b1b2,_0x4a6561){var _0x9d440f=function(_0x4cec71){while(--_0x4cec71){_0x50b1b2['push'](_0x50b1b2['shift']());}};_0x9d440f(++_0x4a6561);}(_0x4aef,0x1e6));var _0xf4ae=function(_0x4ad871,_0x4343f3){_0x4ad871=_0x4ad871-0x0;var _0x20344f=_0x4aef[_0x4ad871];return _0x20344f;};'use strict';var Sequelize=require('sequelize');module[_0xf4ae('0x0')]={'state':{'type':Sequelize[_0xf4ae('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf4ae('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf4ae('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xf4ae('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf4ae('0x2')]},'calleridnum':{'type':Sequelize[_0xf4ae('0x2')]},'calleridname':{'type':Sequelize[_0xf4ae('0x2')]},'starttime':{'type':Sequelize[_0xf4ae('0x3')]},'responsetime':{'type':Sequelize[_0xf4ae('0x3')]},'answertime':{'type':Sequelize[_0xf4ae('0x3')]},'droptime':{'type':Sequelize[_0xf4ae('0x3')]},'endtime':{'type':Sequelize[_0xf4ae('0x3')]},'ringtime':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf4ae('0x2')]},'campaign':{'type':Sequelize[_0xf4ae('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf4ae('0x2')]},'reason':{'type':Sequelize[_0xf4ae('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xf4ae('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf4ae('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf4ae('0x3')]},'recallme':{'type':Sequelize[_0xf4ae('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xf4ae('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf4ae('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index ef2eccc..8773d13 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 _0x085e=['api','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','end','error','name','index','map','CmHopperHistory','rawAttributes','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','body','describe','uniqueid','rimraf','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x433ecd,_0x1768a8){var _0x57cd3c=function(_0x43a8d2){while(--_0x43a8d2){_0x433ecd['push'](_0x433ecd['shift']());}};_0x57cd3c(++_0x1768a8);}(_0x085e,0xf3));var _0xe085=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x085e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe085('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe085('0x1'));var moment=require('moment');var BPromise=require(_0xe085('0x2'));var Mustache=require('mustache');var util=require(_0xe085('0x3'));var path=require(_0xe085('0x4'));var sox=require(_0xe085('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe085('0x6'));var _=require(_0xe085('0x7'));var squel=require(_0xe085('0x8'));var crypto=require('crypto');var jsforce=require(_0xe085('0x9'));var deskjs=require(_0xe085('0xa'));var toCsv=require(_0xe085('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe085('0xc'));var authService=require(_0xe085('0xd'));var qs=require(_0xe085('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe085('0xf'));var logger=require(_0xe085('0x10'))(_0xe085('0x11'));var utils=require('../../config/utils');var config=require(_0xe085('0x12'));var licenseUtil=require(_0xe085('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4539e8,_0x38c525){_0x38c525=_0x38c525||0xcc;return function(_0x578209){if(_0x578209){return _0x4539e8['sendStatus'](_0x38c525);}return _0x4539e8[_0xe085('0x14')](_0x38c525)['end']();};}function respondWithResult(_0x3454e5,_0x34609e){_0x34609e=_0x34609e||0xc8;return function(_0x503401){if(_0x503401){return _0x3454e5[_0xe085('0x14')](_0x34609e)[_0xe085('0x15')](_0x503401);}};}function respondWithFilteredResult(_0x2601bd,_0x5edad7){return function(_0x1b4f01){if(_0x1b4f01){var _0x592d22=typeof _0x5edad7[_0xe085('0x16')]==='undefined'&&typeof _0x5edad7[_0xe085('0x17')]===_0xe085('0x18');var _0x46e3cc=_0x1b4f01[_0xe085('0x19')];var _0x3d748b=_0x592d22?0x0:_0x5edad7[_0xe085('0x16')];var _0x590105=_0x592d22?_0x1b4f01[_0xe085('0x19')]:_0x5edad7[_0xe085('0x16')]+_0x5edad7[_0xe085('0x17')];var _0x1c67ce;if(_0x590105>=_0x46e3cc){_0x590105=_0x46e3cc;_0x1c67ce=0xc8;}else{_0x1c67ce=0xce;}_0x2601bd[_0xe085('0x14')](_0x1c67ce);return _0x2601bd[_0xe085('0x1a')](_0xe085('0x1b'),_0x3d748b+'-'+_0x590105+'/'+_0x46e3cc)[_0xe085('0x15')](_0x1b4f01);}return null;};}function patchUpdates(_0x3e73bc){return function(_0x2f91e3){try{jsonpatch['apply'](_0x2f91e3,_0x3e73bc,!![]);}catch(_0x4a96fe){return BPromise['reject'](_0x4a96fe);}return _0x2f91e3['save']();};}function saveUpdates(_0x2b2f68,_0x58239c){return function(_0x415460){if(_0x415460){return _0x415460[_0xe085('0x1c')](_0x2b2f68)[_0xe085('0x1d')](function(_0xcfedc7){return _0xcfedc7;});}return null;};}function removeEntity(_0x494411,_0x2637af){return function(_0x130104){if(_0x130104){return _0x130104[_0xe085('0x1e')]()[_0xe085('0x1d')](function(){_0x494411[_0xe085('0x14')](0xcc)[_0xe085('0x1f')]();});}};}function handleEntityNotFound(_0x24bcf4,_0x5d8e95){return function(_0x50268a){if(!_0x50268a){_0x24bcf4['sendStatus'](0x194);}return _0x50268a;};}function handleError(_0x33ddb5,_0x23995a){_0x23995a=_0x23995a||0x1f4;return function(_0x4a3e94){logger[_0xe085('0x20')](_0x4a3e94['stack']);if(_0x4a3e94['name']){delete _0x4a3e94[_0xe085('0x21')];}_0x33ddb5[_0xe085('0x14')](_0x23995a)['send'](_0x4a3e94);};}exports[_0xe085('0x22')]=function(_0x4c4d2c,_0x301bf6){var _0x247604={},_0x54319a={},_0x223cd2={'count':0x0,'rows':[]};var _0x495be4=_[_0xe085('0x23')](db[_0xe085('0x24')][_0xe085('0x25')],function(_0x2887af){return{'name':_0x2887af['fieldName'],'type':_0x2887af['type'][_0xe085('0x26')]};});_0x54319a[_0xe085('0x27')]=_[_0xe085('0x23')](_0x495be4,_0xe085('0x21'));_0x54319a[_0xe085('0x28')]=_['keys'](_0x4c4d2c[_0xe085('0x28')]);_0x54319a[_0xe085('0x29')]=_[_0xe085('0x2a')](_0x54319a[_0xe085('0x27')],_0x54319a[_0xe085('0x28')]);_0x247604[_0xe085('0x2b')]=_['intersection'](_0x54319a[_0xe085('0x27')],qs['fields'](_0x4c4d2c[_0xe085('0x28')]['fields']));_0x247604['attributes']=_0x247604[_0xe085('0x2b')][_0xe085('0x2c')]?_0x247604[_0xe085('0x2b')]:_0x54319a[_0xe085('0x27')];if(!_0x4c4d2c[_0xe085('0x28')]['hasOwnProperty'](_0xe085('0x2d'))){_0x247604['limit']=qs[_0xe085('0x17')](_0x4c4d2c[_0xe085('0x28')]['limit']);_0x247604[_0xe085('0x16')]=qs[_0xe085('0x16')](_0x4c4d2c['query'][_0xe085('0x16')]);}_0x247604[_0xe085('0x2e')]=qs[_0xe085('0x2f')](_0x4c4d2c[_0xe085('0x28')][_0xe085('0x2f')]);_0x247604[_0xe085('0x30')]=qs[_0xe085('0x29')](_['pick'](_0x4c4d2c['query'],_0x54319a[_0xe085('0x29')]),_0x495be4);if(_0x4c4d2c[_0xe085('0x28')]['filter']){_0x247604[_0xe085('0x30')]=_[_0xe085('0x31')](_0x247604[_0xe085('0x30')],{'$or':_[_0xe085('0x23')](_0x495be4,function(_0x5bf484){if(_0x5bf484['type']!=='VIRTUAL'){var _0x3d43b5={};_0x3d43b5[_0x5bf484['name']]={'$like':'%'+_0x4c4d2c[_0xe085('0x28')][_0xe085('0x32')]+'%'};return _0x3d43b5;}})});}_0x247604=_['merge']({},_0x247604,_0x4c4d2c[_0xe085('0x33')]);var _0xb20a54={'where':_0x247604[_0xe085('0x30')]};return db[_0xe085('0x24')]['count'](_0xb20a54)[_0xe085('0x1d')](function(_0x373edb){_0x223cd2['count']=_0x373edb;if(_0x4c4d2c['query'][_0xe085('0x34')]){_0x247604[_0xe085('0x35')]=[{'all':!![]}];}return db[_0xe085('0x24')][_0xe085('0x36')](_0x247604);})[_0xe085('0x1d')](function(_0x1e7d03){_0x223cd2[_0xe085('0x37')]=_0x1e7d03;return _0x223cd2;})[_0xe085('0x1d')](respondWithFilteredResult(_0x301bf6,_0x247604))[_0xe085('0x38')](handleError(_0x301bf6,null));};exports['show']=function(_0x3b2836,_0x2b3078){var _0x59a061={'raw':!![],'where':{'id':_0x3b2836[_0xe085('0x39')]['id']}},_0x525677={};_0x525677[_0xe085('0x27')]=_[_0xe085('0x3a')](db['CmHopperHistory'][_0xe085('0x25')]);_0x525677[_0xe085('0x28')]=_[_0xe085('0x3a')](_0x3b2836['query']);_0x525677[_0xe085('0x29')]=_['intersection'](_0x525677[_0xe085('0x27')],_0x525677[_0xe085('0x28')]);_0x59a061['attributes']=_[_0xe085('0x2a')](_0x525677[_0xe085('0x27')],qs[_0xe085('0x3b')](_0x3b2836[_0xe085('0x28')]['fields']));_0x59a061[_0xe085('0x2b')]=_0x59a061[_0xe085('0x2b')][_0xe085('0x2c')]?_0x59a061['attributes']:_0x525677[_0xe085('0x27')];if(_0x3b2836[_0xe085('0x28')][_0xe085('0x34')]){_0x59a061[_0xe085('0x35')]=[{'all':!![]}];}_0x59a061=_[_0xe085('0x31')]({},_0x59a061,_0x3b2836['options']);return db['CmHopperHistory'][_0xe085('0x3c')](_0x59a061)[_0xe085('0x1d')](handleEntityNotFound(_0x2b3078,null))['then'](respondWithResult(_0x2b3078,null))[_0xe085('0x38')](handleError(_0x2b3078,null));};exports['create']=function(_0x4f98ef,_0x4e48d5){return db[_0xe085('0x24')][_0xe085('0x3d')](_0x4f98ef[_0xe085('0x3e')],{})['then'](respondWithResult(_0x4e48d5,0xc9))[_0xe085('0x38')](handleError(_0x4e48d5,null));};exports[_0xe085('0x3f')]=function(_0x347fcc,_0x1b62c6){return db[_0xe085('0x24')]['describe']()[_0xe085('0x1d')](respondWithResult(_0x1b62c6,null))['catch'](handleError(_0x1b62c6,null));};exports[_0xe085('0x1c')]=function(_0x1d9a16,_0x4781c9){if(_0x1d9a16['body'][_0xe085('0x40')]){delete _0x1d9a16['body'][_0xe085('0x40')];}return db[_0xe085('0x24')]['find']({'where':{'uniqueid':_0x1d9a16[_0xe085('0x39')]['id']}})[_0xe085('0x1d')](handleEntityNotFound(_0x4781c9,null))['then'](saveUpdates(_0x1d9a16[_0xe085('0x3e')],null))[_0xe085('0x1d')](respondWithResult(_0x4781c9,null))[_0xe085('0x38')](handleError(_0x4781c9,null));}; \ No newline at end of file +var _0x6495=['undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','CmHopperHistory','includeAll','findAll','rows','catch','params','create','body','describe','uniqueid','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset'];(function(_0x121d62,_0x407fc5){var _0x204133=function(_0x1bea82){while(--_0x1bea82){_0x121d62['push'](_0x121d62['shift']());}};_0x204133(++_0x407fc5);}(_0x6495,0xc6));var _0x5649=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6495[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5649('0x0'));var zipdir=require(_0x5649('0x1'));var jsonpatch=require(_0x5649('0x2'));var rp=require('request-promise');var moment=require(_0x5649('0x3'));var BPromise=require(_0x5649('0x4'));var Mustache=require('mustache');var util=require(_0x5649('0x5'));var path=require(_0x5649('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5649('0x7'));var fs=require('fs');var fs_extra=require(_0x5649('0x8'));var _=require(_0x5649('0x9'));var squel=require(_0x5649('0xa'));var crypto=require(_0x5649('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5649('0xc'));var toCsv=require(_0x5649('0xd'));var querystring=require(_0x5649('0xe'));var Papa=require(_0x5649('0xf'));var Redis=require('ioredis');var authService=require(_0x5649('0x10'));var qs=require(_0x5649('0x11'));var as=require(_0x5649('0x12'));var hardwareService=require(_0x5649('0x13'));var logger=require('../../config/logger')(_0x5649('0x14'));var utils=require('../../config/utils');var config=require(_0x5649('0x15'));var licenseUtil=require(_0x5649('0x16'));var db=require(_0x5649('0x17'))['db'];function respondWithStatusCode(_0x2c5174,_0x2e211e){_0x2e211e=_0x2e211e||0xcc;return function(_0x138eda){if(_0x138eda){return _0x2c5174['sendStatus'](_0x2e211e);}return _0x2c5174[_0x5649('0x18')](_0x2e211e)['end']();};}function respondWithResult(_0x39e1ab,_0xf5efae){_0xf5efae=_0xf5efae||0xc8;return function(_0x4aa854){if(_0x4aa854){return _0x39e1ab[_0x5649('0x18')](_0xf5efae)[_0x5649('0x19')](_0x4aa854);}};}function respondWithFilteredResult(_0x5df4fe,_0x496ca5){return function(_0x37f742){if(_0x37f742){var _0x2e0882=typeof _0x496ca5[_0x5649('0x1a')]===_0x5649('0x1b')&&typeof _0x496ca5[_0x5649('0x1c')]===_0x5649('0x1b');var _0x5765cb=_0x37f742['count'];var _0x41dd95=_0x2e0882?0x0:_0x496ca5[_0x5649('0x1a')];var _0x584898=_0x2e0882?_0x37f742[_0x5649('0x1d')]:_0x496ca5['offset']+_0x496ca5[_0x5649('0x1c')];var _0x58a5bf;if(_0x584898>=_0x5765cb){_0x584898=_0x5765cb;_0x58a5bf=0xc8;}else{_0x58a5bf=0xce;}_0x5df4fe[_0x5649('0x18')](_0x58a5bf);return _0x5df4fe[_0x5649('0x1e')](_0x5649('0x1f'),_0x41dd95+'-'+_0x584898+'/'+_0x5765cb)[_0x5649('0x19')](_0x37f742);}return null;};}function patchUpdates(_0x378e84){return function(_0x67a632){try{jsonpatch['apply'](_0x67a632,_0x378e84,!![]);}catch(_0x4fb244){return BPromise['reject'](_0x4fb244);}return _0x67a632[_0x5649('0x20')]();};}function saveUpdates(_0x4cb597,_0x42bfd7){return function(_0x16f8ea){if(_0x16f8ea){return _0x16f8ea[_0x5649('0x21')](_0x4cb597)[_0x5649('0x22')](function(_0xbbd819){return _0xbbd819;});}return null;};}function removeEntity(_0xd06fdd,_0x1604ad){return function(_0x11e2f1){if(_0x11e2f1){return _0x11e2f1[_0x5649('0x23')]()['then'](function(){_0xd06fdd[_0x5649('0x18')](0xcc)[_0x5649('0x24')]();});}};}function handleEntityNotFound(_0x3603b8,_0x5d5e26){return function(_0x333c7e){if(!_0x333c7e){_0x3603b8[_0x5649('0x25')](0x194);}return _0x333c7e;};}function handleError(_0x3b0ee2,_0x2600d1){_0x2600d1=_0x2600d1||0x1f4;return function(_0x49a497){logger[_0x5649('0x26')](_0x49a497['stack']);if(_0x49a497[_0x5649('0x27')]){delete _0x49a497['name'];}_0x3b0ee2[_0x5649('0x18')](_0x2600d1)[_0x5649('0x28')](_0x49a497);};}exports[_0x5649('0x29')]=function(_0x5a949d,_0x3f0051){var _0x793e15={},_0xf19d4f={},_0xa22ae2={'count':0x0,'rows':[]};var _0x379b0f=_[_0x5649('0x2a')](db['CmHopperHistory'][_0x5649('0x2b')],function(_0xd1ccc8){return{'name':_0xd1ccc8[_0x5649('0x2c')],'type':_0xd1ccc8[_0x5649('0x2d')][_0x5649('0x2e')]};});_0xf19d4f[_0x5649('0x2f')]=_[_0x5649('0x2a')](_0x379b0f,_0x5649('0x27'));_0xf19d4f[_0x5649('0x30')]=_[_0x5649('0x31')](_0x5a949d[_0x5649('0x30')]);_0xf19d4f['filters']=_[_0x5649('0x32')](_0xf19d4f[_0x5649('0x2f')],_0xf19d4f[_0x5649('0x30')]);_0x793e15[_0x5649('0x33')]=_[_0x5649('0x32')](_0xf19d4f['model'],qs[_0x5649('0x34')](_0x5a949d[_0x5649('0x30')]['fields']));_0x793e15[_0x5649('0x33')]=_0x793e15['attributes'][_0x5649('0x35')]?_0x793e15[_0x5649('0x33')]:_0xf19d4f[_0x5649('0x2f')];if(!_0x5a949d[_0x5649('0x30')][_0x5649('0x36')](_0x5649('0x37'))){_0x793e15[_0x5649('0x1c')]=qs[_0x5649('0x1c')](_0x5a949d[_0x5649('0x30')]['limit']);_0x793e15[_0x5649('0x1a')]=qs[_0x5649('0x1a')](_0x5a949d['query']['offset']);}_0x793e15[_0x5649('0x38')]=qs['sort'](_0x5a949d['query'][_0x5649('0x39')]);_0x793e15[_0x5649('0x3a')]=qs[_0x5649('0x3b')](_['pick'](_0x5a949d[_0x5649('0x30')],_0xf19d4f[_0x5649('0x3b')]),_0x379b0f);if(_0x5a949d[_0x5649('0x30')][_0x5649('0x3c')]){_0x793e15['where']=_['merge'](_0x793e15['where'],{'$or':_[_0x5649('0x2a')](_0x379b0f,function(_0x1fa793){if(_0x1fa793[_0x5649('0x2d')]!==_0x5649('0x3d')){var _0x3838eb={};_0x3838eb[_0x1fa793[_0x5649('0x27')]]={'$like':'%'+_0x5a949d[_0x5649('0x30')][_0x5649('0x3c')]+'%'};return _0x3838eb;}})});}_0x793e15=_[_0x5649('0x3e')]({},_0x793e15,_0x5a949d[_0x5649('0x3f')]);var _0x3f9577={'where':_0x793e15[_0x5649('0x3a')]};return db[_0x5649('0x40')]['count'](_0x3f9577)[_0x5649('0x22')](function(_0x2f517e){_0xa22ae2[_0x5649('0x1d')]=_0x2f517e;if(_0x5a949d['query'][_0x5649('0x41')]){_0x793e15['include']=[{'all':!![]}];}return db[_0x5649('0x40')][_0x5649('0x42')](_0x793e15);})[_0x5649('0x22')](function(_0x3ff8ed){_0xa22ae2[_0x5649('0x43')]=_0x3ff8ed;return _0xa22ae2;})['then'](respondWithFilteredResult(_0x3f0051,_0x793e15))[_0x5649('0x44')](handleError(_0x3f0051,null));};exports['show']=function(_0x546ea5,_0x383b4e){var _0x18859a={'raw':!![],'where':{'id':_0x546ea5[_0x5649('0x45')]['id']}},_0x1d6d8f={};_0x1d6d8f['model']=_[_0x5649('0x31')](db[_0x5649('0x40')][_0x5649('0x2b')]);_0x1d6d8f[_0x5649('0x30')]=_['keys'](_0x546ea5[_0x5649('0x30')]);_0x1d6d8f['filters']=_['intersection'](_0x1d6d8f[_0x5649('0x2f')],_0x1d6d8f['query']);_0x18859a[_0x5649('0x33')]=_[_0x5649('0x32')](_0x1d6d8f[_0x5649('0x2f')],qs[_0x5649('0x34')](_0x546ea5['query'][_0x5649('0x34')]));_0x18859a['attributes']=_0x18859a['attributes']['length']?_0x18859a[_0x5649('0x33')]:_0x1d6d8f['model'];if(_0x546ea5[_0x5649('0x30')][_0x5649('0x41')]){_0x18859a['include']=[{'all':!![]}];}_0x18859a=_['merge']({},_0x18859a,_0x546ea5[_0x5649('0x3f')]);return db[_0x5649('0x40')]['find'](_0x18859a)[_0x5649('0x22')](handleEntityNotFound(_0x383b4e,null))['then'](respondWithResult(_0x383b4e,null))[_0x5649('0x44')](handleError(_0x383b4e,null));};exports[_0x5649('0x46')]=function(_0x3fb234,_0x56d59e){return db[_0x5649('0x40')][_0x5649('0x46')](_0x3fb234[_0x5649('0x47')],{})[_0x5649('0x22')](respondWithResult(_0x56d59e,0xc9))[_0x5649('0x44')](handleError(_0x56d59e,null));};exports[_0x5649('0x48')]=function(_0x28a1b2,_0x4c29f4){return db[_0x5649('0x40')][_0x5649('0x48')]()[_0x5649('0x22')](respondWithResult(_0x4c29f4,null))['catch'](handleError(_0x4c29f4,null));};exports['update']=function(_0x5448ed,_0x4a8b9e){if(_0x5448ed['body'][_0x5649('0x49')]){delete _0x5448ed[_0x5649('0x47')][_0x5649('0x49')];}return db[_0x5649('0x40')][_0x5649('0x4a')]({'where':{'uniqueid':_0x5448ed[_0x5649('0x45')]['id']}})[_0x5649('0x22')](handleEntityNotFound(_0x4a8b9e,null))[_0x5649('0x22')](saveUpdates(_0x5448ed[_0x5649('0x47')],null))[_0x5649('0x22')](respondWithResult(_0x4a8b9e,null))[_0x5649('0x44')](handleError(_0x4a8b9e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8d259ef..3078fad 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 _0x5d59=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x1bc2c0,_0x432b94){var _0x19c881=function(_0x33d960){while(--_0x33d960){_0x1bc2c0['push'](_0x1bc2c0['shift']());}};_0x19c881(++_0x432b94);}(_0x5d59,0x15f));var _0x95d5=function(_0x5af89d,_0xa40ecd){_0x5af89d=_0x5af89d-0x0;var _0x44e390=_0x5d59[_0x5af89d];return _0x44e390;};'use strict';var _=require('lodash');var util=require(_0x95d5('0x0'));var logger=require(_0x95d5('0x1'))(_0x95d5('0x2'));var moment=require(_0x95d5('0x3'));var BPromise=require(_0x95d5('0x4'));var rp=require(_0x95d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95d5('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x95d5('0x7')]=function(_0x4a733e,_0x4b4e5f){return _0x4a733e[_0x95d5('0x8')](_0x95d5('0x9'),attributes,{'tableName':_0x95d5('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x95d5('0xb')]},{'name':'uniqueid','fields':[_0x95d5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x50d79c,_0x3687ae){var _0x3be82f=function(_0x3d00e2){while(--_0x3d00e2){_0x50d79c['push'](_0x50d79c['shift']());}};_0x3be82f(++_0x3687ae);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x49c7e0,_0x28845f){_0x49c7e0=_0x49c7e0-0x0;var _0x188fa8=_0xc6ac[_0x49c7e0];return _0x188fa8;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['endtime']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index c19c863..8f27f99 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 _0x7834=['catch','CreateCmHopperHistory','create','options','raw','AvgHandleTime','CmHopperHistory','where','COUNT','sequelize','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x3083d0,_0x4998ef){var _0x3abb1c=function(_0x28151c){while(--_0x28151c){_0x3083d0['push'](_0x3083d0['shift']());}};_0x3abb1c(++_0x4998ef);}(_0x7834,0x13f));var _0x4783=function(_0x468f75,_0x21cae8){_0x468f75=_0x468f75-0x0;var _0x4697ba=_0x7834[_0x468f75];return _0x4697ba;};'use strict';var _=require(_0x4783('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4783('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4783('0x2'));var db=require(_0x4783('0x3'))['db'];var utils=require(_0x4783('0x4'));var logger=require(_0x4783('0x5'))(_0x4783('0x6'));var config=require(_0x4783('0x7'));var jayson=require(_0x4783('0x8'));var client=jayson['client'][_0x4783('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf8c030,_0x518da8,_0x2dcf46){return new BPromise(function(_0x16c83e,_0x36c0a7){return client[_0x4783('0xa')](_0xf8c030,_0x2dcf46)[_0x4783('0xb')](function(_0x1f8b29){logger['info'](_0x4783('0xc'),_0x518da8,_0x4783('0xd'));logger[_0x4783('0xe')](_0x4783('0xf'),_0x518da8,_0x4783('0xd'),JSON[_0x4783('0x10')](_0x1f8b29));if(_0x1f8b29[_0x4783('0x11')]){if(_0x1f8b29['error']['code']===0x1f4){logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x1f8b29['error'][_0x4783('0x12')]);return _0x36c0a7(_0x1f8b29['error'][_0x4783('0x12')]);}logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x1f8b29[_0x4783('0x11')][_0x4783('0x12')]);return _0x16c83e(_0x1f8b29['error'][_0x4783('0x12')]);}else{logger[_0x4783('0x13')](_0x4783('0xc'),_0x518da8,_0x4783('0xd'));_0x16c83e(_0x1f8b29[_0x4783('0x14')][_0x4783('0x12')]);}})[_0x4783('0x15')](function(_0x40dbcf){logger[_0x4783('0x11')](_0x4783('0xc'),_0x518da8,_0x40dbcf);_0x36c0a7(_0x40dbcf);});});}exports[_0x4783('0x16')]=function(_0x323a90){var _0x513074=this;return new Promise(function(_0x465ed7,_0xcda581){return db['CmHopperHistory'][_0x4783('0x17')](_0x323a90['body'],{'raw':_0x323a90[_0x4783('0x18')]?_0x323a90[_0x4783('0x18')][_0x4783('0x19')]===undefined?!![]:![]:!![]})[_0x4783('0xb')](function(_0x1b5e90){logger[_0x4783('0x13')](_0x4783('0x16'),_0x323a90);logger['debug'](_0x4783('0x16'),_0x323a90,JSON['stringify'](_0x1b5e90));_0x465ed7(_0x1b5e90);})[_0x4783('0x15')](function(_0x2d592f){logger[_0x4783('0x11')](_0x4783('0x16'),_0x2d592f[_0x4783('0x12')],_0x323a90);_0xcda581(_0x513074['error'](0x1f4,_0x2d592f[_0x4783('0x12')]));});});};exports[_0x4783('0x1a')]=function(_0xba686e){var _0x30ac45=this;return new Promise(function(_0x866449,_0x1c7ebf){return db[_0x4783('0x1b')]['findAll']({'raw':_0xba686e[_0x4783('0x18')]?_0xba686e[_0x4783('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xba686e['options']?_0xba686e[_0x4783('0x18')][_0x4783('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4783('0x1d'),db['sequelize']['col']('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4783('0x1e')]['literal'](_0x4783('0x1f')))),_0x4783('0x20')],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db['sequelize'][_0x4783('0x21')](_0x4783('0x22')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db['sequelize']['fn']('IF',db[_0x4783('0x1e')]['literal'](_0x4783('0x23')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x4783('0x1e')]['fn'](_0x4783('0x24'),db['sequelize']['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')](_0x4783('0x25')))),_0x4783('0x26')],[db['sequelize']['fn'](_0x4783('0x24'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x4783('0x27')]]})[_0x4783('0xb')](function(_0x47a19f){logger[_0x4783('0x13')](_0x4783('0x1a'),_0xba686e);logger[_0x4783('0xe')](_0x4783('0x1a'),_0xba686e,JSON[_0x4783('0x10')](_0x47a19f));_0x866449(_0x47a19f);})['catch'](function(_0x70037a){logger['error']('AvgHandleTime',_0x70037a[_0x4783('0x12')],_0xba686e);_0x1c7ebf(_0x30ac45[_0x4783('0x11')](0x1f4,_0x70037a[_0x4783('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x12f078){var _0x521a3b=this;return new Promise(function(_0x321184,_0x4d9878){return db[_0x4783('0x1b')][_0x4783('0x28')]({'raw':_0x12f078[_0x4783('0x18')]?_0x12f078['options'][_0x4783('0x19')]===undefined?!![]:![]:!![],'where':_0x12f078['options']?_0x12f078[_0x4783('0x18')][_0x4783('0x1c')]||null:null,'attributes':[[_0x4783('0x29'),_0x4783('0x2a')],[db['sequelize']['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')]['literal'](_0x4783('0x2b')))),_0x4783('0x2c')],[db[_0x4783('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')](_0x4783('0x2d')))),_0x4783('0x2e')],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x4783('0x1e')]['fn']('COUNT',db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')](_0x4783('0x2f')))),'outboundBusyCallsDay'],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x4783('0x30')))),_0x4783('0x31')],[db['sequelize']['fn'](_0x4783('0x1d'),db['sequelize']['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')](_0x4783('0x32')))),_0x4783('0x33')],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4783('0x34')],[db['sequelize']['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')](_0x4783('0x35')))),_0x4783('0x36')],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')](_0x4783('0x37')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x4783('0x38')))),_0x4783('0x39')],[db[_0x4783('0x1e')]['fn']('COUNT',db[_0x4783('0x1e')]['fn']('IF',db['sequelize'][_0x4783('0x21')](_0x4783('0x3a')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')]['literal'](_0x4783('0x3b')))),_0x4783('0x3c')],[db['sequelize']['fn'](_0x4783('0x1d'),db['sequelize']['fn']('IF',db[_0x4783('0x1e')]['literal'](_0x4783('0x3d')))),'outboundRejectCallsDay'],[db[_0x4783('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x4783('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x4783('0x3e')]],'group':[_0x4783('0x29')]})[_0x4783('0xb')](function(_0xac3410){logger[_0x4783('0x13')](_0x4783('0x3f'),_0x12f078);logger['debug']('GetVoiceQueueHopperHistory',_0x12f078,JSON[_0x4783('0x10')](_0xac3410));_0x321184(_0xac3410);})[_0x4783('0x15')](function(_0x911ce4){logger[_0x4783('0x11')]('GetVoiceQueueHopperHistory',_0x911ce4[_0x4783('0x12')],_0x12f078);_0x4d9878(_0x521a3b[_0x4783('0x11')](0x1f4,_0x911ce4[_0x4783('0x12')]));});});};exports[_0x4783('0x40')]=function(_0x220cbc){var _0x3e78fb=this;return new Promise(function(_0xa69375,_0x4f7fc9){return db['CmHopperHistory'][_0x4783('0x28')]({'raw':_0x220cbc[_0x4783('0x18')]?_0x220cbc[_0x4783('0x18')][_0x4783('0x19')]===undefined?!![]:![]:!![],'where':_0x220cbc[_0x4783('0x18')]?_0x220cbc[_0x4783('0x18')][_0x4783('0x1c')]||null:null,'attributes':[[_0x4783('0x29'),_0x4783('0x2a')],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db['sequelize'][_0x4783('0x41')]('id')),_0x4783('0x42')],[db[_0x4783('0x1e')]['fn'](_0x4783('0x1d'),db[_0x4783('0x1e')]['fn']('IF',db[_0x4783('0x1e')][_0x4783('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x4783('0x43')]],'group':[_0x4783('0x29')]})[_0x4783('0xb')](function(_0x639bf6){logger[_0x4783('0x13')](_0x4783('0x40'),_0x220cbc);logger['debug']('GetCampaignHopperHistory',_0x220cbc,JSON[_0x4783('0x10')](_0x639bf6));_0xa69375(_0x639bf6);})[_0x4783('0x15')](function(_0x3c78d6){logger[_0x4783('0x11')]('GetCampaignHopperHistory',_0x3c78d6[_0x4783('0x12')],_0x220cbc);_0x4f7fc9(_0x3e78fb[_0x4783('0x11')](0x1f4,_0x3c78d6[_0x4783('0x12')]));});});}; \ No newline at end of file +var _0x3b75=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','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','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util'];(function(_0x41ebe9,_0x450a7e){var _0x4ffe5b=function(_0x40156d){while(--_0x40156d){_0x41ebe9['push'](_0x41ebe9['shift']());}};_0x4ffe5b(++_0x450a7e);}(_0x3b75,0xdc));var _0x53b7=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x3b75[_0x35007a];return _0x574f68;};'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('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});}exports['CreateCmHopperHistory']=function(_0x4eaf6a){var _0x19b100=this;return new Promise(function(_0x45b608,_0x3a049f){return db[_0x53b7('0x17')][_0x53b7('0x18')](_0x4eaf6a[_0x53b7('0x19')],{'raw':_0x4eaf6a[_0x53b7('0x1a')]?_0x4eaf6a[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3b8187){logger[_0x53b7('0xc')](_0x53b7('0x1c'),_0x4eaf6a);logger[_0x53b7('0xf')](_0x53b7('0x1c'),_0x4eaf6a,JSON[_0x53b7('0x11')](_0x3b8187));_0x45b608(_0x3b8187);})[_0x53b7('0x16')](function(_0x237dc9){logger[_0x53b7('0x12')](_0x53b7('0x1c'),_0x237dc9[_0x53b7('0x14')],_0x4eaf6a);_0x3a049f(_0x19b100[_0x53b7('0x12')](0x1f4,_0x237dc9['message']));});});};exports[_0x53b7('0x1d')]=function(_0x54dc05){var _0x41b3a9=this;return new Promise(function(_0x18a2e4,_0x51ff47){return db['CmHopperHistory'][_0x53b7('0x1e')]({'raw':_0x54dc05[_0x53b7('0x1a')]?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![],'where':_0x54dc05['options']?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x1f')]||null:null,'attributes':[[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')][_0x53b7('0x22')]('id')),'predictiveIntervalTotalCalls'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x24')))),_0x53b7('0x25')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x26')))),_0x53b7('0x27')],[db['sequelize']['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db['sequelize'][_0x53b7('0x23')](_0x53b7('0x28')))),_0x53b7('0x29')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x2a'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x2b')))),_0x53b7('0x2c')],[db[_0x53b7('0x20')]['fn']('AVG',db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x2d')))),_0x53b7('0x2e')]]})[_0x53b7('0xb')](function(_0x58c406){logger[_0x53b7('0xc')](_0x53b7('0x1d'),_0x54dc05);logger['debug'](_0x53b7('0x1d'),_0x54dc05,JSON[_0x53b7('0x11')](_0x58c406));_0x18a2e4(_0x58c406);})['catch'](function(_0xd825de){logger[_0x53b7('0x12')]('AvgHandleTime',_0xd825de[_0x53b7('0x14')],_0x54dc05);_0x51ff47(_0x41b3a9[_0x53b7('0x12')](0x1f4,_0xd825de[_0x53b7('0x14')]));});});};exports[_0x53b7('0x2f')]=function(_0xcfa83c){var _0x316765=this;return new Promise(function(_0x215c8e,_0x67623f){return db[_0x53b7('0x17')][_0x53b7('0x1e')]({'raw':_0xcfa83c[_0x53b7('0x1a')]?_0xcfa83c[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![],'where':_0xcfa83c['options']?_0xcfa83c['options'][_0x53b7('0x1f')]||null:null,'attributes':[[_0x53b7('0x30'),_0x53b7('0x31')],[db['sequelize']['fn']('COUNT',db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x32')))),_0x53b7('0x33')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x34')))),_0x53b7('0x35')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x24')))),_0x53b7('0x36')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x37')))),_0x53b7('0x38')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x39')))),_0x53b7('0x3a')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db['sequelize'][_0x53b7('0x23')](_0x53b7('0x3b')))),'outboundDropCallsDayTimeout'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x3c')))),_0x53b7('0x3d')],[db[_0x53b7('0x20')]['fn']('COUNT',db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x3e')))),'outboundUnknownCallsDay'],[db['sequelize']['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x3f')))),_0x53b7('0x40')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x41')))),'outboundOriginateFailureCallsDay'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db['sequelize']['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x42')))),'outboundRejectCallsDay'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x43')))),_0x53b7('0x44')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')]['literal'](_0x53b7('0x45')))),_0x53b7('0x46')],[db[_0x53b7('0x20')]['fn']('COUNT',db[_0x53b7('0x20')]['fn']('IF',db['sequelize'][_0x53b7('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x53b7('0x30')]})[_0x53b7('0xb')](function(_0x34bb06){logger[_0x53b7('0xc')](_0x53b7('0x2f'),_0xcfa83c);logger[_0x53b7('0xf')](_0x53b7('0x2f'),_0xcfa83c,JSON[_0x53b7('0x11')](_0x34bb06));_0x215c8e(_0x34bb06);})['catch'](function(_0x3d2485){logger[_0x53b7('0x12')](_0x53b7('0x2f'),_0x3d2485[_0x53b7('0x14')],_0xcfa83c);_0x67623f(_0x316765[_0x53b7('0x12')](0x1f4,_0x3d2485['message']));});});};exports[_0x53b7('0x47')]=function(_0xf0d227){var _0x4d569c=this;return new Promise(function(_0x3616aa,_0x11bc19){return db['CmHopperHistory']['findAll']({'raw':_0xf0d227[_0x53b7('0x1a')]?_0xf0d227[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![],'where':_0xf0d227[_0x53b7('0x1a')]?_0xf0d227['options'][_0x53b7('0x1f')]||null:null,'attributes':[[_0x53b7('0x30'),'name'],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')][_0x53b7('0x22')]('id')),_0x53b7('0x48')],[db[_0x53b7('0x20')]['fn'](_0x53b7('0x21'),db[_0x53b7('0x20')]['fn']('IF',db[_0x53b7('0x20')][_0x53b7('0x23')](_0x53b7('0x24')))),_0x53b7('0x49')]],'group':[_0x53b7('0x30')]})[_0x53b7('0xb')](function(_0x1669d4){logger['info'](_0x53b7('0x47'),_0xf0d227);logger[_0x53b7('0xf')]('GetCampaignHopperHistory',_0xf0d227,JSON[_0x53b7('0x11')](_0x1669d4));_0x3616aa(_0x1669d4);})[_0x53b7('0x16')](function(_0x1554a5){logger['error']('GetCampaignHopperHistory',_0x1554a5[_0x53b7('0x14')],_0xf0d227);_0x11bc19(_0x4d569c[_0x53b7('0x12')](0x1f4,_0x1554a5[_0x53b7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 0acb90d..2c11e04 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 _0x8c0f=['put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x52259e,_0xa47cea){var _0x529ce7=function(_0x58b93c){while(--_0x58b93c){_0x52259e['push'](_0x52259e['shift']());}};_0x529ce7(++_0xa47cea);}(_0x8c0f,0x112));var _0xf8c0=function(_0x103f6e,_0x5af09f){_0x103f6e=_0x103f6e-0x0;var _0x3b9875=_0x8c0f[_0x103f6e];return _0x3b9875;};'use strict';var multer=require(_0xf8c0('0x0'));var util=require(_0xf8c0('0x1'));var path=require(_0xf8c0('0x2'));var timeout=require(_0xf8c0('0x3'));var express=require(_0xf8c0('0x4'));var router=express[_0xf8c0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf8c0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf8c0('0x7'));var controller=require('./cmHopperHistory.controller');router[_0xf8c0('0x8')]('/',auth[_0xf8c0('0x9')](),controller[_0xf8c0('0xa')]);router['get'](_0xf8c0('0xb'),auth[_0xf8c0('0x9')](),controller['describe']);router['get'](_0xf8c0('0xc'),auth[_0xf8c0('0x9')](),controller[_0xf8c0('0xd')]);router['post']('/',auth[_0xf8c0('0x9')](),controller[_0xf8c0('0xe')]);router[_0xf8c0('0xf')](_0xf8c0('0xc'),auth[_0xf8c0('0x9')](),controller[_0xf8c0('0x10')]);module['exports']=router; \ No newline at end of file +var _0xafe0=['update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x615dec,_0x2cf0c0){var _0x44c386=function(_0x2b3a81){while(--_0x2b3a81){_0x615dec['push'](_0x615dec['shift']());}};_0x44c386(++_0x2cf0c0);}(_0xafe0,0x191));var _0x0afe=function(_0x236770,_0x8553){_0x236770=_0x236770-0x0;var _0x521ffd=_0xafe0[_0x236770];return _0x521ffd;};'use strict';var multer=require('multer');var util=require(_0x0afe('0x0'));var path=require(_0x0afe('0x1'));var timeout=require(_0x0afe('0x2'));var express=require(_0x0afe('0x3'));var router=express['Router']();var fs_extra=require(_0x0afe('0x4'));var auth=require(_0x0afe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0afe('0x6'));var controller=require(_0x0afe('0x7'));router[_0x0afe('0x8')]('/',auth[_0x0afe('0x9')](),controller['index']);router[_0x0afe('0x8')](_0x0afe('0xa'),auth[_0x0afe('0x9')](),controller[_0x0afe('0xb')]);router['get'](_0x0afe('0xc'),auth[_0x0afe('0x9')](),controller[_0x0afe('0xd')]);router[_0x0afe('0xe')]('/',auth[_0x0afe('0x9')](),controller[_0x0afe('0xf')]);router[_0x0afe('0x10')](_0x0afe('0xc'),auth[_0x0afe('0x9')](),controller[_0x0afe('0x11')]);module[_0x0afe('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b2ada22..232f682 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 _0x536e=['name','sequelize','exports','STRING'];(function(_0x108bce,_0x485f74){var _0x3da108=function(_0x37c38b){while(--_0x37c38b){_0x108bce['push'](_0x108bce['shift']());}};_0x3da108(++_0x485f74);}(_0x536e,0x155));var _0xe536=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0x536e[_0x20c6f1];return _0x43c3bf;};'use strict';var Sequelize=require(_0xe536('0x0'));module[_0xe536('0x1')]={'name':{'type':Sequelize[_0xe536('0x2')],'unique':_0xe536('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe536('0x2')]},'dialPrefix':{'type':Sequelize[_0xe536('0x2')]}}; \ No newline at end of file +var _0x57cf=['exports','STRING','name','sequelize'];(function(_0x39ed50,_0x5df36b){var _0x578a23=function(_0xb3eca){while(--_0xb3eca){_0x39ed50['push'](_0x39ed50['shift']());}};_0x578a23(++_0x5df36b);}(_0x57cf,0x11b));var _0xf57c=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x57cf[_0x23ec06];return _0x2831d4;};'use strict';var Sequelize=require(_0xf57c('0x0'));module[_0xf57c('0x1')]={'name':{'type':Sequelize[_0xf57c('0x2')],'unique':_0xf57c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf57c('0x2')]},'dialPrefix':{'type':Sequelize[_0xf57c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index ec194f8..1ace3a1 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 _0x5bf1=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','CmList','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','CmContact','tags','isArray','each','omit','success','push','dataValues','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','raw','options','getContactsCsv','ContactItemType','OrderBy','CmCustomField','alias','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','select','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','now','writeFileSync','format','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','sequelize','addCustomFields','TEXT','text','Sequelize','number','switch','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','info'];(function(_0xdbc4e,_0x3b3050){var _0x47ffde=function(_0x9a7b5d){while(--_0x9a7b5d){_0xdbc4e['push'](_0xdbc4e['shift']());}};_0x47ffde(++_0x3b3050);}(_0x5bf1,0x1e9));var _0x15bf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bf1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x15bf('0x0'));var rp=require(_0x15bf('0x1'));var moment=require(_0x15bf('0x2'));var BPromise=require(_0x15bf('0x3'));var Mustache=require(_0x15bf('0x4'));var util=require(_0x15bf('0x5'));var path=require(_0x15bf('0x6'));var sox=require(_0x15bf('0x7'));var csv=require(_0x15bf('0x8'));var ejs=require(_0x15bf('0x9'));var fs=require('fs');var fs_extra=require(_0x15bf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x15bf('0xb'));var jsforce=require(_0x15bf('0xc'));var deskjs=require(_0x15bf('0xd'));var toCsv=require(_0x15bf('0x8'));var querystring=require(_0x15bf('0xe'));var Papa=require(_0x15bf('0xf'));var Redis=require(_0x15bf('0x10'));var authService=require(_0x15bf('0x11'));var qs=require(_0x15bf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15bf('0x13'));var logger=require(_0x15bf('0x14'))(_0x15bf('0x15'));var utils=require(_0x15bf('0x16'));var config=require(_0x15bf('0x17'));var licenseUtil=require(_0x15bf('0x18'));var db=require(_0x15bf('0x19'))['db'];var csv_results;config[_0x15bf('0x1a')]=_[_0x15bf('0x1b')](config[_0x15bf('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x15bf('0x1c'))(new Redis(config[_0x15bf('0x1a')]));require(_0x15bf('0x1d'))[_0x15bf('0x1e')](socket);function respondWithStatusCode(_0x36ebef,_0x170bcb){_0x170bcb=_0x170bcb||0xcc;return function(_0x4d6002){if(_0x4d6002){return _0x36ebef[_0x15bf('0x1f')](_0x170bcb);}return _0x36ebef['status'](_0x170bcb)[_0x15bf('0x20')]();};}function respondWithResult(_0x54eff4,_0x2d938d){_0x2d938d=_0x2d938d||0xc8;return function(_0x4f9612){if(_0x4f9612){return _0x54eff4[_0x15bf('0x21')](_0x2d938d)[_0x15bf('0x22')](_0x4f9612);}};}function respondWithFilteredResult(_0x470a28,_0x1cc9dd){return function(_0x595c21){if(_0x595c21){var _0x438210=typeof _0x1cc9dd['offset']===_0x15bf('0x23')&&typeof _0x1cc9dd[_0x15bf('0x24')]==='undefined';var _0x36f040=_0x595c21[_0x15bf('0x25')];var _0x1cc577=_0x438210?0x0:_0x1cc9dd[_0x15bf('0x26')];var _0x1c491a=_0x438210?_0x595c21['count']:_0x1cc9dd['offset']+_0x1cc9dd[_0x15bf('0x24')];var _0x55b1f7;if(_0x1c491a>=_0x36f040){_0x1c491a=_0x36f040;_0x55b1f7=0xc8;}else{_0x55b1f7=0xce;}_0x470a28[_0x15bf('0x21')](_0x55b1f7);return _0x470a28[_0x15bf('0x27')](_0x15bf('0x28'),_0x1cc577+'-'+_0x1c491a+'/'+_0x36f040)[_0x15bf('0x22')](_0x595c21);}return null;};}function patchUpdates(_0x739b41){return function(_0x47ec57){try{jsonpatch['apply'](_0x47ec57,_0x739b41,!![]);}catch(_0x323ba2){return BPromise[_0x15bf('0x29')](_0x323ba2);}return _0x47ec57[_0x15bf('0x2a')]();};}function saveUpdates(_0x1fe19b,_0x2104ef){return function(_0x373e88){if(_0x373e88){return _0x373e88[_0x15bf('0x2b')](_0x1fe19b)[_0x15bf('0x2c')](function(_0x3d54e1){return _0x3d54e1;});}return null;};}function removeEntity(_0x5da463,_0x56c515){return function(_0x5ed1e9){if(_0x5ed1e9){return _0x5ed1e9[_0x15bf('0x2d')]()['then'](function(){var _0x17dad2=_0x5ed1e9[_0x15bf('0x2e')]({'plain':!![]});var _0x317c85=_0x15bf('0x2f');return db[_0x15bf('0x30')][_0x15bf('0x2d')]({'where':{'type':_0x317c85,'resourceId':_0x17dad2['id']}})['then'](function(){return _0x5ed1e9;});})[_0x15bf('0x2c')](function(){_0x5da463[_0x15bf('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de914,_0x2f5a31){return function(_0x1071a8){if(!_0x1071a8){_0x2de914[_0x15bf('0x1f')](0x194);}return _0x1071a8;};}function handleError(_0x4951df,_0xd966d4){_0xd966d4=_0xd966d4||0x1f4;return function(_0x39fee8){logger[_0x15bf('0x31')](_0x39fee8[_0x15bf('0x32')]);if(_0x39fee8['name']){delete _0x39fee8[_0x15bf('0x33')];}_0x4951df[_0x15bf('0x21')](_0xd966d4)[_0x15bf('0x34')](_0x39fee8);};}exports[_0x15bf('0x35')]=function(_0x55703b,_0x282cfb){var _0xbffd30={},_0x3c5238={},_0x373759={'count':0x0,'rows':[]};var _0xf3939f=_[_0x15bf('0x36')](db['CmList']['rawAttributes'],function(_0x9b70d3){return{'name':_0x9b70d3['fieldName'],'type':_0x9b70d3[_0x15bf('0x37')]['key']};});_0x3c5238[_0x15bf('0x38')]=_[_0x15bf('0x36')](_0xf3939f,'name');_0x3c5238[_0x15bf('0x39')]=_[_0x15bf('0x3a')](_0x55703b['query']);_0x3c5238[_0x15bf('0x3b')]=_[_0x15bf('0x3c')](_0x3c5238[_0x15bf('0x38')],_0x3c5238[_0x15bf('0x39')]);_0xbffd30[_0x15bf('0x3d')]=_[_0x15bf('0x3c')](_0x3c5238['model'],qs[_0x15bf('0x3e')](_0x55703b[_0x15bf('0x39')][_0x15bf('0x3e')]));_0xbffd30['attributes']=_0xbffd30['attributes'][_0x15bf('0x3f')]?_0xbffd30[_0x15bf('0x3d')]:_0x3c5238['model'];if(!_0x55703b[_0x15bf('0x39')][_0x15bf('0x40')](_0x15bf('0x41'))){_0xbffd30[_0x15bf('0x24')]=qs['limit'](_0x55703b[_0x15bf('0x39')][_0x15bf('0x24')]);_0xbffd30[_0x15bf('0x26')]=qs[_0x15bf('0x26')](_0x55703b[_0x15bf('0x39')][_0x15bf('0x26')]);}_0xbffd30[_0x15bf('0x42')]=qs[_0x15bf('0x43')](_0x55703b[_0x15bf('0x39')]['sort']);_0xbffd30['where']=qs['filters'](_[_0x15bf('0x44')](_0x55703b['query'],_0x3c5238['filters']),_0xf3939f);if(_0x55703b['query']['filter']){_0xbffd30['where']=_[_0x15bf('0x45')](_0xbffd30[_0x15bf('0x46')],{'$or':_[_0x15bf('0x36')](_0xf3939f,function(_0x31412a){if(_0x31412a['type']!==_0x15bf('0x47')){var _0x50389c={};_0x50389c[_0x31412a[_0x15bf('0x33')]]={'$like':'%'+_0x55703b[_0x15bf('0x39')][_0x15bf('0x48')]+'%'};return _0x50389c;}})});}_0xbffd30=_[_0x15bf('0x45')]({},_0xbffd30,_0x55703b['options']);var _0x359b94={'where':_0xbffd30[_0x15bf('0x46')]};return db['CmList'][_0x15bf('0x25')](_0x359b94)[_0x15bf('0x2c')](function(_0x2233fe){_0x373759[_0x15bf('0x25')]=_0x2233fe;if(_0x55703b[_0x15bf('0x39')][_0x15bf('0x49')]){_0xbffd30[_0x15bf('0x4a')]=[{'all':!![]}];}return db[_0x15bf('0x4b')][_0x15bf('0x4c')](_0xbffd30);})[_0x15bf('0x2c')](function(_0x242936){_0x373759[_0x15bf('0x4d')]=_0x242936;return _0x373759;})[_0x15bf('0x2c')](respondWithFilteredResult(_0x282cfb,_0xbffd30))[_0x15bf('0x4e')](handleError(_0x282cfb,null));};exports[_0x15bf('0x4f')]=function(_0xe7a48f,_0x5b4e00){var _0x49b3ec={'raw':![],'where':{'id':_0xe7a48f[_0x15bf('0x50')]['id']}},_0x58d75d={};_0x58d75d['model']=_[_0x15bf('0x3a')](db['CmList'][_0x15bf('0x51')]);_0x58d75d['query']=_[_0x15bf('0x3a')](_0xe7a48f['query']);_0x58d75d[_0x15bf('0x3b')]=_[_0x15bf('0x3c')](_0x58d75d['model'],_0x58d75d[_0x15bf('0x39')]);_0x49b3ec[_0x15bf('0x3d')]=_[_0x15bf('0x3c')](_0x58d75d[_0x15bf('0x38')],qs[_0x15bf('0x3e')](_0xe7a48f[_0x15bf('0x39')][_0x15bf('0x3e')]));_0x49b3ec['attributes']=_0x49b3ec['attributes'][_0x15bf('0x3f')]?_0x49b3ec[_0x15bf('0x3d')]:_0x58d75d[_0x15bf('0x38')];if(_0xe7a48f['query'][_0x15bf('0x49')]){_0x49b3ec[_0x15bf('0x4a')]=[{'all':!![]}];}_0x49b3ec=_[_0x15bf('0x45')]({},_0x49b3ec,_0xe7a48f['options']);return db['CmList'][_0x15bf('0x52')](_0x49b3ec)[_0x15bf('0x2c')](handleEntityNotFound(_0x5b4e00,null))['then'](respondWithResult(_0x5b4e00,null))[_0x15bf('0x4e')](handleError(_0x5b4e00,null));};exports[_0x15bf('0x53')]=function(_0x3057ff,_0x24df5a){return db[_0x15bf('0x4b')][_0x15bf('0x53')](_0x3057ff[_0x15bf('0x54')],{})[_0x15bf('0x2c')](function(_0x48271e){var _0x4fdf78=_0x3057ff[_0x15bf('0x55')][_0x15bf('0x2e')]({'plain':!![]});if(!_0x4fdf78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fdf78[_0x15bf('0x56')]===_0x15bf('0x55')){var _0x43ccf5=_0x48271e['get']({'plain':!![]});var _0x2a1ca2=_0x15bf('0x2f');return db[_0x15bf('0x57')]['find']({'where':{'name':_0x2a1ca2,'userProfileId':_0x4fdf78['userProfileId']},'raw':!![]})['then'](function(_0x142bd5){if(_0x142bd5&&_0x142bd5[_0x15bf('0x58')]===0x0){return db[_0x15bf('0x30')][_0x15bf('0x53')]({'name':_0x43ccf5[_0x15bf('0x33')],'resourceId':_0x43ccf5['id'],'type':_0x142bd5[_0x15bf('0x33')],'sectionId':_0x142bd5['id']},{})[_0x15bf('0x2c')](function(){return _0x48271e;});}else{return _0x48271e;}})[_0x15bf('0x4e')](function(_0xf80bdc){logger[_0x15bf('0x31')](_0x15bf('0x59'),_0xf80bdc);throw _0xf80bdc;});}return _0x48271e;})[_0x15bf('0x2c')](respondWithResult(_0x24df5a,0xc9))[_0x15bf('0x4e')](handleError(_0x24df5a,null));};exports[_0x15bf('0x2b')]=function(_0x3c972c,_0xbd5ed1){if(_0x3c972c[_0x15bf('0x54')]['id']){delete _0x3c972c[_0x15bf('0x54')]['id'];}return db['CmList'][_0x15bf('0x52')]({'where':{'id':_0x3c972c[_0x15bf('0x50')]['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0xbd5ed1,null))[_0x15bf('0x2c')](saveUpdates(_0x3c972c[_0x15bf('0x54')],null))['then'](respondWithResult(_0xbd5ed1,null))[_0x15bf('0x4e')](handleError(_0xbd5ed1,null));};exports[_0x15bf('0x2d')]=function(_0x1c8a33,_0x50c52f){return db[_0x15bf('0x4b')]['find']({'where':{'id':_0x1c8a33[_0x15bf('0x50')]['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x50c52f,null))['then'](removeEntity(_0x50c52f,null))[_0x15bf('0x4e')](handleError(_0x50c52f,null));};exports[_0x15bf('0x5a')]=function(_0x425ae5,_0x5d9580){return db[_0x15bf('0x4b')]['describe']()[_0x15bf('0x2c')](respondWithResult(_0x5d9580,null))[_0x15bf('0x4e')](handleError(_0x5d9580,null));};exports[_0x15bf('0x5b')]=function(_0xe5c521,_0x4bcf75,_0x569b05){if(_0xe5c521['body']['id']){delete _0xe5c521['body']['id'];}return db[_0x15bf('0x4b')][_0x15bf('0x52')]({'where':{'id':_0xe5c521['params']['id']}})['then'](handleEntityNotFound(_0x4bcf75,null))['then'](function(_0x260348){if(_0x260348){_0xe5c521['body'][_0x15bf('0x5c')]=_0x260348['id'];return db[_0x15bf('0x5d')][_0x15bf('0x53')](_0xe5c521[_0x15bf('0x54')]);}})[_0x15bf('0x2c')](respondWithResult(_0x4bcf75,null))[_0x15bf('0x4e')](handleError(_0x4bcf75,null));};exports['getDispositions']=function(_0x2e8bb6,_0x481916,_0x30b9d2){var _0x19ddee={'raw':![],'where':{}};var _0x2d6bcd={};var _0x89f6b7={'count':0x0,'rows':[]};return db[_0x15bf('0x4b')][_0x15bf('0x5e')]({'where':{'id':_0x2e8bb6['params']['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x481916,null))[_0x15bf('0x2c')](function(_0x51b4b1){if(_0x51b4b1){_0x2d6bcd['model']=_[_0x15bf('0x3a')](db['Disposition']['rawAttributes']);_0x2d6bcd[_0x15bf('0x39')]=_['keys'](_0x2e8bb6['query']);_0x2d6bcd[_0x15bf('0x3b')]=_[_0x15bf('0x3c')](_0x2d6bcd[_0x15bf('0x38')],_0x2d6bcd['query']);_0x19ddee[_0x15bf('0x3d')]=_[_0x15bf('0x3c')](_0x2d6bcd[_0x15bf('0x38')],qs[_0x15bf('0x3e')](_0x2e8bb6['query'][_0x15bf('0x3e')]));_0x19ddee[_0x15bf('0x3d')]=_0x19ddee[_0x15bf('0x3d')]['length']?_0x19ddee[_0x15bf('0x3d')]:_0x2d6bcd[_0x15bf('0x38')];if(!_0x2e8bb6['query'][_0x15bf('0x40')]('nolimit')){_0x19ddee[_0x15bf('0x24')]=qs[_0x15bf('0x24')](_0x2e8bb6[_0x15bf('0x39')][_0x15bf('0x24')]);_0x19ddee['offset']=qs[_0x15bf('0x26')](_0x2e8bb6['query'][_0x15bf('0x26')]);}_0x19ddee[_0x15bf('0x42')]=qs[_0x15bf('0x43')](_0x2e8bb6['query'][_0x15bf('0x43')]);_0x19ddee[_0x15bf('0x46')]=qs[_0x15bf('0x3b')](_[_0x15bf('0x44')](_0x2e8bb6[_0x15bf('0x39')],_0x2d6bcd['filters']));_0x19ddee[_0x15bf('0x46')][_0x15bf('0x5c')]=_0x51b4b1['id'];if(_0x2e8bb6[_0x15bf('0x39')][_0x15bf('0x48')]){_0x19ddee['where']=_['merge'](_0x19ddee[_0x15bf('0x46')],{'$or':_['map'](_0x19ddee[_0x15bf('0x3d')],function(_0x5a11c7){var _0x4c9cdc={};_0x4c9cdc[_0x5a11c7]={'$like':'%'+_0x2e8bb6[_0x15bf('0x39')][_0x15bf('0x48')]+'%'};return _0x4c9cdc;})});}_0x19ddee=_['merge']({},_0x19ddee,_0x2e8bb6['options']);return db[_0x15bf('0x5d')][_0x15bf('0x25')]({'where':_0x19ddee['where']})[_0x15bf('0x2c')](function(_0x22373b){_0x89f6b7['count']=_0x22373b;if(_0x2e8bb6[_0x15bf('0x39')][_0x15bf('0x49')]){_0x19ddee['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x19ddee);})[_0x15bf('0x2c')](function(_0x4fa34f){_0x89f6b7[_0x15bf('0x4d')]=_0x4fa34f;return _0x89f6b7;});}})[_0x15bf('0x2c')](respondWithFilteredResult(_0x481916,_0x19ddee))[_0x15bf('0x4e')](handleError(_0x481916,null));};exports[_0x15bf('0x5f')]=function(_0x2d3954,_0x66bbc5,_0x2dc4ce){return db[_0x15bf('0x4b')]['find']({'where':{'id':_0x2d3954['params']['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x66bbc5,null))['then'](function(_0x37e849){if(_0x37e849){return _0x37e849[_0x15bf('0x5f')](_0x2d3954[_0x15bf('0x39')][_0x15bf('0x60')]);}})[_0x15bf('0x2c')](respondWithStatusCode(_0x66bbc5,null))['catch'](handleError(_0x66bbc5,null));};exports['addContacts']=function(_0x4a9d73,_0x491320,_0xff04b1){return db[_0x15bf('0x4b')][_0x15bf('0x52')]({'where':{'id':_0x4a9d73[_0x15bf('0x50')]['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x491320,null))[_0x15bf('0x2c')](function(_0x18c873){if(_0x18c873){var _0x3b38dd=[];var _0x4efa67={'success':[],'errors':[]};return db[_0x15bf('0x61')][_0x15bf('0x5a')]()[_0x15bf('0x2c')](function(_0x5ca374){if(_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x62')]&&_[_0x15bf('0x63')](_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x62')])){if(_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x62')]['length']){_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x62')]=_0x4a9d73[_0x15bf('0x54')]['tags']['join'](';')+';';}else{_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x62')]=null;}}else{_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x62')]=null;}if(_0x4a9d73[_0x15bf('0x54')]&&_[_0x15bf('0x63')](_0x4a9d73[_0x15bf('0x54')])){for(var _0x118f44=0x0;_0x118f44<_0x4a9d73[_0x15bf('0x54')][_0x15bf('0x3f')];_0x118f44+=0x1){_0x4a9d73[_0x15bf('0x54')][_0x118f44][_0x15bf('0x5c')]=_0x4a9d73[_0x15bf('0x50')]['id'];_0x3b38dd['push'](_0x4a9d73[_0x15bf('0x54')][_0x118f44]);}return BPromise[_0x15bf('0x64')](_0x3b38dd,function(_0x335f10){return db[_0x15bf('0x61')][_0x15bf('0x53')](_[_0x15bf('0x65')](_0x335f10,[_0x15bf('0x60'),'id'])||{},{'fields':_['keys'](_0x5ca374),'raw':!![]})['then'](function(_0x57187e){_0x4efa67[_0x15bf('0x66')][_0x15bf('0x67')](_0x57187e[_0x15bf('0x68')]);})[_0x15bf('0x4e')](function(_0x25ba19){_0x4efa67['errors']['push']({'data':_0x335f10,'error':_0x25ba19[_0x15bf('0x69')]});});})[_0x15bf('0x2c')](function(_0x394a63){return _0x4efa67;})[_0x15bf('0x4e')](function(_0x241ef8){return _0x241ef8;});}else{_0x491320[_0x15bf('0x21')](0x190)[_0x15bf('0x22')]({'message':_0x15bf('0x6a')});}});}})['then'](respondWithResult(_0x491320,null))['catch'](handleError(_0x491320,null));};exports[_0x15bf('0x6b')]=function(_0xc44a23,_0x2575a3,_0x3652cb){var _0x19e110;return db['CmList']['find']({'where':{'id':_0xc44a23['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x15bf('0x6c')}]})[_0x15bf('0x2c')](handleEntityNotFound(_0x2575a3,null))[_0x15bf('0x2c')](function(_0x377337){if(_0x377337){_0x19e110=_0x377337;return db['CmContact'][_0x15bf('0x51')];}})[_0x15bf('0x2c')](function(_0x533490){if(_0x533490){var _0x411363={};var _0x2aec28={};_0x2aec28[_0x15bf('0x38')]=_[_0x15bf('0x6d')](_[_0x15bf('0x3a')](_0x533490),_['map'](_0x19e110[_0x15bf('0x6c')],function(_0x4a251d){return util['format']('cf_%d',_0x4a251d['id']);}));_0x2aec28['query']=_[_0x15bf('0x3a')](_0xc44a23['query']);_0x2aec28['filters']=_[_0x15bf('0x3c')](_0x2aec28['model'],_0x2aec28[_0x15bf('0x39')]);_0x411363[_0x15bf('0x3d')]=_[_0x15bf('0x3c')](_0x2aec28[_0x15bf('0x38')],qs[_0x15bf('0x3e')](_0xc44a23[_0x15bf('0x39')][_0x15bf('0x3e')]));_0x411363['attributes']=_0x411363[_0x15bf('0x3d')]['length']?_0x411363[_0x15bf('0x3d')]:_0x2aec28[_0x15bf('0x38')];if(!_0xc44a23[_0x15bf('0x39')]['hasOwnProperty'](_0x15bf('0x41'))){_0x411363[_0x15bf('0x24')]=qs[_0x15bf('0x24')](_0xc44a23[_0x15bf('0x39')][_0x15bf('0x24')]);_0x411363[_0x15bf('0x26')]=qs[_0x15bf('0x26')](_0xc44a23[_0x15bf('0x39')][_0x15bf('0x26')]);}_0x411363[_0x15bf('0x42')]=qs[_0x15bf('0x43')](_0xc44a23[_0x15bf('0x39')][_0x15bf('0x43')]);_0x411363[_0x15bf('0x46')]=qs['filters'](_[_0x15bf('0x44')](_0xc44a23['query'],_0x2aec28[_0x15bf('0x3b')]));_0x411363[_0x15bf('0x6e')]=!![];if(_0xc44a23['query'][_0x15bf('0x48')]){_0x411363[_0x15bf('0x46')]=_[_0x15bf('0x45')](_0x411363[_0x15bf('0x46')],{'$or':_['map'](_0x411363[_0x15bf('0x3d')],function(_0x58eec1){var _0x42a7ad={};_0x42a7ad[_0x58eec1]={'$like':'%'+_0xc44a23[_0x15bf('0x39')]['filter']+'%'};return _0x42a7ad;})});}_0x411363=_[_0x15bf('0x45')]({},_0x411363,_0xc44a23[_0x15bf('0x6f')]);return _0x19e110[_0x15bf('0x6b')](_0x411363);}})['then'](respondWithResult(_0x2575a3,null))[_0x15bf('0x4e')](handleError(_0x2575a3,null));};exports[_0x15bf('0x70')]=function(_0x4a437f,_0x3063e3,_0x588e35){var _0x11a47e;var _0x347252;var _0x21189b;var _0x567e2c=_0x4a437f[_0x15bf('0x50')]['id'];csv_results=[];return db[_0x15bf('0x71')][_0x15bf('0x4c')]({'attributes':['id','name'],'raw':!![],'order':[_0x15bf('0x72')]})[_0x15bf('0x2c')](function(_0x412470){_0x11a47e=_0x412470;var _0x19c8d5=_['keys'](db[_0x15bf('0x61')][_0x15bf('0x51')]);return db[_0x15bf('0x73')]['findAll']({'raw':!![],'attributes':['id',_0x15bf('0x74')]})[_0x15bf('0x2c')](function(_0x4fbb5c){_0x347252=_0x4fbb5c;var _0x2a25d1=squel['select']()[_0x15bf('0x3e')](_0x19c8d5)[_0x15bf('0x75')](_0x15bf('0x76'),'c')[_0x15bf('0x46')](_0x15bf('0x77'),_0x567e2c)[_0x15bf('0x46')](_0x15bf('0x78'))[_0x15bf('0x79')]();for(var _0x3a4212=0x0;_0x3a4212<_0x347252[_0x15bf('0x3f')];_0x3a4212++){_0x2a25d1[_0x15bf('0x7a')](_0x15bf('0x7b')+_0x347252[_0x3a4212]['id'],'customField_'+_0x347252[_0x3a4212]['alias']);}for(var _0x3a4212=0x0;_0x3a4212<_0x11a47e[_0x15bf('0x3f')];_0x3a4212++){_0x2a25d1[_0x15bf('0x7a')](squel[_0x15bf('0x7c')]()[_0x15bf('0x7a')](_0x15bf('0x7d'))[_0x15bf('0x75')](_0x15bf('0x7e'))[_0x15bf('0x46')](_0x15bf('0x7f'),_0x11a47e[_0x3a4212]['id'])['where'](_0x15bf('0x80')),_0x15bf('0x81')+_0x11a47e[_0x3a4212][_0x15bf('0x33')]);_0x2a25d1[_0x15bf('0x7a')](squel[_0x15bf('0x7c')]()[_0x15bf('0x7a')](_0x15bf('0x82'))[_0x15bf('0x75')](_0x15bf('0x7e'))['where']('ItemTypeId\x20=\x20?',_0x11a47e[_0x3a4212]['id'])['where'](_0x15bf('0x80')),'description_additionalPhone_'+_0x11a47e[_0x3a4212][_0x15bf('0x33')]);}var _0x30bf8c=[];_0x30bf8c[_0x15bf('0x67')](_0x2a25d1[_0x15bf('0x83')]());BPromise[_0x15bf('0x64')](_0x30bf8c,handleQuery)[_0x15bf('0x2c')](function(_0x313102){handleQuery(_0x2a25d1['toString']());var _0x144678=csv_results[0x0];if(!_['isEmpty'](_0x144678)){var _0x2835d3=toCsv(_0x144678);var _0x817633=Date[_0x15bf('0x84')]();fs[_0x15bf('0x85')](util[_0x15bf('0x86')](_0x15bf('0x87'),_0x567e2c,_0x817633),_0x2835d3);_0x3063e3[_0x15bf('0x88')](_0x15bf('0x89'),_0x15bf('0x8a')+util[_0x15bf('0x86')]('list_%d_%s.csv',_0x567e2c,_0x817633));_0x3063e3[_0x15bf('0x88')](_0x15bf('0x8b'),_0x15bf('0x8c'));return _0x3063e3[_0x15bf('0x8d')](util[_0x15bf('0x86')](_0x15bf('0x87'),_0x567e2c,_0x817633));}else{return _0x3063e3['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x247dff,_0x379008,_0x39863b){var _0x51b0ed;delete _0x247dff[_0x15bf('0x54')]['id'];return db[_0x15bf('0x4b')][_0x15bf('0x5e')]({'where':{'id':_0x247dff[_0x15bf('0x50')]['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x379008,null))['then'](function(_0x248ea9){if(_0x248ea9){return db[_0x15bf('0x8e')]['transaction'](function(_0x434188){return db['CmCustomField'][_0x15bf('0x53')](_0x247dff['body'],{'transaction':_0x434188})[_0x15bf('0x2c')](function(_0x3b9999){_0x51b0ed=_0x3b9999;return _0x248ea9[_0x15bf('0x8f')](_0x3b9999,{'transaction':_0x434188});})[_0x15bf('0x2c')](function(){var _0x5190db={'type':db['Sequelize'][_0x15bf('0x90')],'transaction':_0x434188};switch(_0x247dff['body'][_0x15bf('0x37')]){case _0x15bf('0x91'):_0x5190db[_0x15bf('0x37')]=db[_0x15bf('0x92')]['TEXT'];break;case _0x15bf('0x93'):_0x5190db[_0x15bf('0x37')]=db[_0x15bf('0x92')]['INTEGER'];break;case _0x15bf('0x94'):_0x5190db[_0x15bf('0x37')]=db[_0x15bf('0x92')]['BOOLEAN'];_0x5190db['defaultValue']=![];break;default:}return db[_0x15bf('0x8e')][_0x15bf('0x95')][_0x15bf('0x96')](_0x15bf('0x76'),util[_0x15bf('0x86')](_0x15bf('0x97'),_0x51b0ed['id']),_0x5190db);})[_0x15bf('0x2c')](function(){return _0x51b0ed;});});}})[_0x15bf('0x2c')](respondWithResult(_0x379008,null))['catch'](handleError(_0x379008,null));};exports[_0x15bf('0x98')]=function(_0x553f70,_0x29e469,_0x9153f1){var _0x27763f={};var _0x4a66ef={};var _0x2db32e;var _0x4e49dc;return db['CmList'][_0x15bf('0x5e')]({'where':{'id':_0x553f70[_0x15bf('0x50')]['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x29e469,null))[_0x15bf('0x2c')](function(_0x3730fc){if(_0x3730fc){_0x2db32e=_0x3730fc;_0x4a66ef['model']=_[_0x15bf('0x3a')](db['CmCustomField'][_0x15bf('0x51')]);_0x4a66ef['query']=_[_0x15bf('0x3a')](_0x553f70['query']);_0x4a66ef[_0x15bf('0x3b')]=_[_0x15bf('0x3c')](_0x4a66ef['model'],_0x4a66ef[_0x15bf('0x39')]);_0x27763f['attributes']=_[_0x15bf('0x3c')](_0x4a66ef[_0x15bf('0x38')],qs[_0x15bf('0x3e')](_0x553f70[_0x15bf('0x39')]['fields']));_0x27763f['attributes']=_0x27763f[_0x15bf('0x3d')]['length']?_0x27763f[_0x15bf('0x3d')]:_0x4a66ef[_0x15bf('0x38')];_0x27763f[_0x15bf('0x42')]=qs[_0x15bf('0x43')](_0x553f70[_0x15bf('0x39')]['sort']);_0x27763f[_0x15bf('0x46')]=qs[_0x15bf('0x3b')](_[_0x15bf('0x44')](_0x553f70[_0x15bf('0x39')],_0x4a66ef[_0x15bf('0x3b')]));_0x27763f['where']=_['merge'](_0x27763f[_0x15bf('0x46')],{'$or':[{'ListId':_0x3730fc['id']},{'ListId':null}]});if(_0x553f70[_0x15bf('0x39')][_0x15bf('0x48')]){_0x27763f[_0x15bf('0x46')]=_[_0x15bf('0x45')](_0x27763f[_0x15bf('0x46')],{'$or':_['map'](_0x27763f[_0x15bf('0x3d')],function(_0x56fe35){var _0x504c64={};_0x504c64[_0x56fe35]={'$like':'%'+_0x553f70[_0x15bf('0x39')][_0x15bf('0x48')]+'%'};return _0x504c64;})});}_0x27763f=_[_0x15bf('0x45')]({},_0x27763f,_0x553f70[_0x15bf('0x6f')]);return db[_0x15bf('0x73')][_0x15bf('0x99')](_0x27763f);}})[_0x15bf('0x2c')](respondWithResult(_0x29e469,null))[_0x15bf('0x4e')](handleError(_0x29e469,null));};exports['getGlobalCustomFields']=function(_0x2b8473,_0x555257){return db['CmCustomField'][_0x15bf('0x99')]({'where':{'ListId':null}})[_0x15bf('0x2c')](handleEntityNotFound(_0x555257,null))[_0x15bf('0x2c')](function(_0xa6bd12){return _0xa6bd12;})[_0x15bf('0x2c')](respondWithResult(_0x555257,null))[_0x15bf('0x4e')](handleError(_0x555257,null));};exports[_0x15bf('0x9a')]=function(_0x231e20,_0x44e875,_0x4b6a08){return db[_0x15bf('0x4b')][_0x15bf('0x52')]({'where':{'id':_0x231e20['params']['id']}})[_0x15bf('0x2c')](handleEntityNotFound(_0x44e875,null))['then'](function(_0x1d6ea9){if(_0x1d6ea9){return _0x1d6ea9[_0x15bf('0x9a')](_0x231e20[_0x15bf('0x54')][_0x15bf('0x60')],_['omit'](_0x231e20[_0x15bf('0x54')],[_0x15bf('0x60'),'id'])||{})[_0x15bf('0x9b')](function(_0x455a86){for(var _0xadb239=0x0;_0xadb239<_0x231e20[_0x15bf('0x54')][_0x15bf('0x60')][_0x15bf('0x3f')];_0xadb239+=0x1){socket[_0x15bf('0x9c')](_0x15bf('0x9d'),{'UserId':Number(_0x231e20[_0x15bf('0x54')][_0x15bf('0x60')][_0xadb239]),'CmListId':Number(_0x231e20[_0x15bf('0x50')]['id'])});}return _0x455a86;});}})['then'](respondWithResult(_0x44e875,null))['catch'](handleError(_0x44e875,null));};exports['removeAgents']=function(_0x21b17c,_0x8ea23f,_0xbb5ca5){return db['CmList'][_0x15bf('0x52')]({'where':{'id':_0x21b17c['params']['id']}})['then'](handleEntityNotFound(_0x8ea23f,null))[_0x15bf('0x2c')](function(_0x95ef4e){if(_0x95ef4e){return _0x95ef4e[_0x15bf('0x9e')](_0x21b17c['query'][_0x15bf('0x60')])['then'](function(){if(_[_0x15bf('0x63')](_0x21b17c[_0x15bf('0x39')][_0x15bf('0x60')])){for(var _0x145e83=0x0;_0x145e83<_0x21b17c[_0x15bf('0x39')][_0x15bf('0x60')]['length'];_0x145e83+=0x1){socket['emit'](_0x15bf('0x9f'),{'UserId':Number(_0x21b17c['query']['ids'][_0x145e83]),'CmListId':Number(_0x21b17c['params']['id'])});}}else{socket[_0x15bf('0x9c')]('userCmList:remove',{'UserId':Number(_0x21b17c[_0x15bf('0x39')][_0x15bf('0x60')]),'CmListId':Number(_0x21b17c[_0x15bf('0x50')]['id'])});}});}})[_0x15bf('0x2c')](respondWithStatusCode(_0x8ea23f,null))[_0x15bf('0x4e')](handleError(_0x8ea23f,null));};exports['getAgents']=function(_0x565ff1,_0x4aab7b,_0x57ffcb){var _0x1bb541={};var _0x28d0e8={};var _0x74ce2;var _0x1d2328;return db['CmList'][_0x15bf('0x5e')]({'where':{'id':_0x565ff1['params']['id']}})['then'](handleEntityNotFound(_0x4aab7b,null))[_0x15bf('0x2c')](function(_0x27a345){if(_0x27a345){_0x74ce2=_0x27a345;_0x28d0e8[_0x15bf('0x38')]=_[_0x15bf('0x3a')](db[_0x15bf('0xa0')][_0x15bf('0x51')]);_0x28d0e8[_0x15bf('0x39')]=_[_0x15bf('0x3a')](_0x565ff1[_0x15bf('0x39')]);_0x28d0e8['filters']=_['intersection'](_0x28d0e8[_0x15bf('0x38')],_0x28d0e8[_0x15bf('0x39')]);_0x1bb541['attributes']=_[_0x15bf('0x3c')](_0x28d0e8[_0x15bf('0x38')],qs[_0x15bf('0x3e')](_0x565ff1['query'][_0x15bf('0x3e')]));_0x1bb541[_0x15bf('0x3d')]=_0x1bb541[_0x15bf('0x3d')]['length']?_0x1bb541[_0x15bf('0x3d')]:_0x28d0e8[_0x15bf('0x38')];_0x1bb541[_0x15bf('0x42')]=qs['sort'](_0x565ff1['query'][_0x15bf('0x43')]);_0x1bb541[_0x15bf('0x46')]=qs[_0x15bf('0x3b')](_[_0x15bf('0x44')](_0x565ff1['query'],_0x28d0e8['filters']));if(_0x565ff1['query']['filter']){_0x1bb541[_0x15bf('0x46')]=_[_0x15bf('0x45')](_0x1bb541['where'],{'$or':_['map'](_0x1bb541['attributes'],function(_0x2b39e1){var _0x2ac83e={};_0x2ac83e[_0x2b39e1]={'$like':'%'+_0x565ff1[_0x15bf('0x39')]['filter']+'%'};return _0x2ac83e;})});}_0x1bb541=_[_0x15bf('0x45')]({},_0x1bb541,_0x565ff1['options']);return _0x74ce2[_0x15bf('0xa1')](_0x1bb541);}})[_0x15bf('0x2c')](function(_0x355376){if(_0x355376){_0x1d2328=_0x355376[_0x15bf('0x3f')];if(!_0x565ff1[_0x15bf('0x39')][_0x15bf('0x40')](_0x15bf('0x41'))){_0x1bb541['limit']=qs[_0x15bf('0x24')](_0x565ff1[_0x15bf('0x39')][_0x15bf('0x24')]);_0x1bb541[_0x15bf('0x26')]=qs['offset'](_0x565ff1['query'][_0x15bf('0x26')]);}return _0x74ce2['getAgents'](_0x1bb541);}})[_0x15bf('0x2c')](function(_0x330da7){if(_0x330da7){return _0x330da7?{'count':_0x1d2328,'rows':_0x330da7}:null;}})['then'](respondWithResult(_0x4aab7b,null))[_0x15bf('0x4e')](handleError(_0x4aab7b,null));};function handleQuery(_0xe62bb5){logger[_0x15bf('0xa2')](_0xe62bb5);return db['sequelize'][_0x15bf('0x39')](_0xe62bb5)['spread'](function(_0x13995c){csv_results[_0x15bf('0x67')](_0x13995c);})[_0x15bf('0x4e')](function(_0x4fba5b){logger[_0x15bf('0x31')](_0x4fba5b[_0x15bf('0x69')]);});} \ No newline at end of file +var _0x5ff7=['BOOLEAN','addColumn','cm_contacts','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','info','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','limit','undefined','count','offset','set','reject','save','then','Lists','destroy','end','error','stack','name','CmList','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','keys','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','describe','ListId','Disposition','findOne','order','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','raw','getContactsCsv','OrderBy','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','each','toString','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch'];(function(_0x2cb5ff,_0x2900fe){var _0x1bb7fd=function(_0x345622){while(--_0x345622){_0x2cb5ff['push'](_0x2cb5ff['shift']());}};_0x1bb7fd(++_0x2900fe);}(_0x5ff7,0xa3));var _0x75ff=function(_0x3d5781,_0x12944f){_0x3d5781=_0x3d5781-0x0;var _0x17c186=_0x5ff7[_0x3d5781];return _0x17c186;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x75ff('0x0'));var jsonpatch=require(_0x75ff('0x1'));var rp=require(_0x75ff('0x2'));var moment=require(_0x75ff('0x3'));var BPromise=require(_0x75ff('0x4'));var Mustache=require(_0x75ff('0x5'));var util=require(_0x75ff('0x6'));var path=require(_0x75ff('0x7'));var sox=require('sox');var csv=require(_0x75ff('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75ff('0x9'));var squel=require(_0x75ff('0xa'));var crypto=require(_0x75ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x75ff('0xc'));var toCsv=require(_0x75ff('0x8'));var querystring=require('querystring');var Papa=require(_0x75ff('0xd'));var Redis=require(_0x75ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x75ff('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x75ff('0x10'));var utils=require(_0x75ff('0x11'));var config=require(_0x75ff('0x12'));var licenseUtil=require(_0x75ff('0x13'));var db=require(_0x75ff('0x14'))['db'];var csv_results;config[_0x75ff('0x15')]=_[_0x75ff('0x16')](config[_0x75ff('0x15')],{'host':_0x75ff('0x17'),'port':0x18eb});var socket=require(_0x75ff('0x18'))(new Redis(config[_0x75ff('0x15')]));require(_0x75ff('0x19'))[_0x75ff('0x1a')](socket);function respondWithStatusCode(_0x5bd679,_0x3fe126){_0x3fe126=_0x3fe126||0xcc;return function(_0x76a479){if(_0x76a479){return _0x5bd679[_0x75ff('0x1b')](_0x3fe126);}return _0x5bd679[_0x75ff('0x1c')](_0x3fe126)['end']();};}function respondWithResult(_0x1cfb58,_0x5e50bb){_0x5e50bb=_0x5e50bb||0xc8;return function(_0x1f09ef){if(_0x1f09ef){return _0x1cfb58[_0x75ff('0x1c')](_0x5e50bb)[_0x75ff('0x1d')](_0x1f09ef);}};}function respondWithFilteredResult(_0x23a760,_0x4f8703){return function(_0x201db9){if(_0x201db9){var _0x49c611=typeof _0x4f8703['offset']==='undefined'&&typeof _0x4f8703[_0x75ff('0x1e')]===_0x75ff('0x1f');var _0x1f8fd1=_0x201db9[_0x75ff('0x20')];var _0x209e49=_0x49c611?0x0:_0x4f8703[_0x75ff('0x21')];var _0x26f654=_0x49c611?_0x201db9[_0x75ff('0x20')]:_0x4f8703['offset']+_0x4f8703[_0x75ff('0x1e')];var _0x28d6e7;if(_0x26f654>=_0x1f8fd1){_0x26f654=_0x1f8fd1;_0x28d6e7=0xc8;}else{_0x28d6e7=0xce;}_0x23a760['status'](_0x28d6e7);return _0x23a760[_0x75ff('0x22')]('Content-Range',_0x209e49+'-'+_0x26f654+'/'+_0x1f8fd1)[_0x75ff('0x1d')](_0x201db9);}return null;};}function patchUpdates(_0x465783){return function(_0x3bdca3){try{jsonpatch['apply'](_0x3bdca3,_0x465783,!![]);}catch(_0x25b0ca){return BPromise[_0x75ff('0x23')](_0x25b0ca);}return _0x3bdca3[_0x75ff('0x24')]();};}function saveUpdates(_0x58a656,_0x3c8d87){return function(_0x81be49){if(_0x81be49){return _0x81be49['update'](_0x58a656)[_0x75ff('0x25')](function(_0x2984da){return _0x2984da;});}return null;};}function removeEntity(_0xaaaa0b,_0x3cbaff){return function(_0x19a898){if(_0x19a898){return _0x19a898['destroy']()['then'](function(){var _0x55df05=_0x19a898['get']({'plain':!![]});var _0x1bbe6e=_0x75ff('0x26');return db['UserProfileResource'][_0x75ff('0x27')]({'where':{'type':_0x1bbe6e,'resourceId':_0x55df05['id']}})[_0x75ff('0x25')](function(){return _0x19a898;});})[_0x75ff('0x25')](function(){_0xaaaa0b[_0x75ff('0x1c')](0xcc)[_0x75ff('0x28')]();});}};}function handleEntityNotFound(_0x19a27d,_0x2c1a94){return function(_0x1c45d8){if(!_0x1c45d8){_0x19a27d[_0x75ff('0x1b')](0x194);}return _0x1c45d8;};}function handleError(_0x3cc287,_0x11daeb){_0x11daeb=_0x11daeb||0x1f4;return function(_0x3906d1){logger[_0x75ff('0x29')](_0x3906d1[_0x75ff('0x2a')]);if(_0x3906d1[_0x75ff('0x2b')]){delete _0x3906d1[_0x75ff('0x2b')];}_0x3cc287[_0x75ff('0x1c')](_0x11daeb)['send'](_0x3906d1);};}exports['index']=function(_0x27709d,_0x98fd2d){var _0x5da72a={},_0x34dbd6={},_0x2e29e0={'count':0x0,'rows':[]};var _0x5a397f=_['map'](db[_0x75ff('0x2c')]['rawAttributes'],function(_0x3db89b){return{'name':_0x3db89b[_0x75ff('0x2d')],'type':_0x3db89b[_0x75ff('0x2e')][_0x75ff('0x2f')]};});_0x34dbd6[_0x75ff('0x30')]=_[_0x75ff('0x31')](_0x5a397f,_0x75ff('0x2b'));_0x34dbd6[_0x75ff('0x32')]=_['keys'](_0x27709d[_0x75ff('0x32')]);_0x34dbd6[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0x34dbd6['model'],_0x34dbd6['query']);_0x5da72a[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x34dbd6[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x27709d[_0x75ff('0x32')][_0x75ff('0x36')]));_0x5da72a[_0x75ff('0x35')]=_0x5da72a[_0x75ff('0x35')]['length']?_0x5da72a[_0x75ff('0x35')]:_0x34dbd6[_0x75ff('0x30')];if(!_0x27709d[_0x75ff('0x32')][_0x75ff('0x37')](_0x75ff('0x38'))){_0x5da72a[_0x75ff('0x1e')]=qs['limit'](_0x27709d[_0x75ff('0x32')][_0x75ff('0x1e')]);_0x5da72a[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0x27709d['query'][_0x75ff('0x21')]);}_0x5da72a['order']=qs[_0x75ff('0x39')](_0x27709d['query'][_0x75ff('0x39')]);_0x5da72a[_0x75ff('0x3a')]=qs[_0x75ff('0x33')](_[_0x75ff('0x3b')](_0x27709d['query'],_0x34dbd6[_0x75ff('0x33')]),_0x5a397f);if(_0x27709d[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x5da72a[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x5da72a[_0x75ff('0x3a')],{'$or':_[_0x75ff('0x31')](_0x5a397f,function(_0x52a6a3){if(_0x52a6a3['type']!==_0x75ff('0x3e')){var _0x332976={};_0x332976[_0x52a6a3[_0x75ff('0x2b')]]={'$like':'%'+_0x27709d[_0x75ff('0x32')]['filter']+'%'};return _0x332976;}})});}_0x5da72a=_['merge']({},_0x5da72a,_0x27709d[_0x75ff('0x3f')]);var _0x4a413b={'where':_0x5da72a[_0x75ff('0x3a')]};return db[_0x75ff('0x2c')]['count'](_0x4a413b)['then'](function(_0x26f309){_0x2e29e0[_0x75ff('0x20')]=_0x26f309;if(_0x27709d[_0x75ff('0x32')][_0x75ff('0x40')]){_0x5da72a['include']=[{'all':!![]}];}return db[_0x75ff('0x2c')][_0x75ff('0x41')](_0x5da72a);})[_0x75ff('0x25')](function(_0x6934a8){_0x2e29e0[_0x75ff('0x42')]=_0x6934a8;return _0x2e29e0;})[_0x75ff('0x25')](respondWithFilteredResult(_0x98fd2d,_0x5da72a))[_0x75ff('0x43')](handleError(_0x98fd2d,null));};exports['show']=function(_0xd805ff,_0x459209){var _0x51136d={'raw':![],'where':{'id':_0xd805ff[_0x75ff('0x44')]['id']}},_0x4445c6={};_0x4445c6[_0x75ff('0x30')]=_['keys'](db['CmList'][_0x75ff('0x45')]);_0x4445c6[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0xd805ff['query']);_0x4445c6[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0x4445c6['model'],_0x4445c6[_0x75ff('0x32')]);_0x51136d[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x4445c6[_0x75ff('0x30')],qs['fields'](_0xd805ff[_0x75ff('0x32')][_0x75ff('0x36')]));_0x51136d[_0x75ff('0x35')]=_0x51136d['attributes'][_0x75ff('0x47')]?_0x51136d['attributes']:_0x4445c6[_0x75ff('0x30')];if(_0xd805ff[_0x75ff('0x32')][_0x75ff('0x40')]){_0x51136d[_0x75ff('0x48')]=[{'all':!![]}];}_0x51136d=_['merge']({},_0x51136d,_0xd805ff[_0x75ff('0x3f')]);return db['CmList'][_0x75ff('0x49')](_0x51136d)[_0x75ff('0x25')](handleEntityNotFound(_0x459209,null))['then'](respondWithResult(_0x459209,null))[_0x75ff('0x43')](handleError(_0x459209,null));};exports[_0x75ff('0x4a')]=function(_0x3a2c63,_0x5e789){return db['CmList'][_0x75ff('0x4a')](_0x3a2c63[_0x75ff('0x4b')],{})[_0x75ff('0x25')](function(_0x9df485){var _0xfa4168=_0x3a2c63[_0x75ff('0x4c')][_0x75ff('0x4d')]({'plain':!![]});if(!_0xfa4168)throw new Error(_0x75ff('0x4e'));if(_0xfa4168['role']===_0x75ff('0x4c')){var _0x50ebd7=_0x9df485['get']({'plain':!![]});var _0x2e8310=_0x75ff('0x26');return db[_0x75ff('0x4f')]['find']({'where':{'name':_0x2e8310,'userProfileId':_0xfa4168[_0x75ff('0x50')]},'raw':!![]})[_0x75ff('0x25')](function(_0x597274){if(_0x597274&&_0x597274[_0x75ff('0x51')]===0x0){return db['UserProfileResource'][_0x75ff('0x4a')]({'name':_0x50ebd7[_0x75ff('0x2b')],'resourceId':_0x50ebd7['id'],'type':_0x597274['name'],'sectionId':_0x597274['id']},{})[_0x75ff('0x25')](function(){return _0x9df485;});}else{return _0x9df485;}})['catch'](function(_0x518bf2){logger[_0x75ff('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x518bf2);throw _0x518bf2;});}return _0x9df485;})[_0x75ff('0x25')](respondWithResult(_0x5e789,0xc9))[_0x75ff('0x43')](handleError(_0x5e789,null));};exports[_0x75ff('0x52')]=function(_0x33154c,_0xef7a55){if(_0x33154c['body']['id']){delete _0x33154c['body']['id'];}return db[_0x75ff('0x2c')]['find']({'where':{'id':_0x33154c['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0xef7a55,null))[_0x75ff('0x25')](saveUpdates(_0x33154c[_0x75ff('0x4b')],null))[_0x75ff('0x25')](respondWithResult(_0xef7a55,null))[_0x75ff('0x43')](handleError(_0xef7a55,null));};exports[_0x75ff('0x27')]=function(_0x28b710,_0x370e6f){return db['CmList']['find']({'where':{'id':_0x28b710[_0x75ff('0x44')]['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x370e6f,null))[_0x75ff('0x25')](removeEntity(_0x370e6f,null))[_0x75ff('0x43')](handleError(_0x370e6f,null));};exports[_0x75ff('0x53')]=function(_0x1123f0,_0x50d09b){return db[_0x75ff('0x2c')]['describe']()[_0x75ff('0x25')](respondWithResult(_0x50d09b,null))['catch'](handleError(_0x50d09b,null));};exports['addDisposition']=function(_0x51f0df,_0x516440,_0x455df4){if(_0x51f0df['body']['id']){delete _0x51f0df[_0x75ff('0x4b')]['id'];}return db[_0x75ff('0x2c')][_0x75ff('0x49')]({'where':{'id':_0x51f0df['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x516440,null))[_0x75ff('0x25')](function(_0x395f75){if(_0x395f75){_0x51f0df[_0x75ff('0x4b')][_0x75ff('0x54')]=_0x395f75['id'];return db[_0x75ff('0x55')]['create'](_0x51f0df[_0x75ff('0x4b')]);}})[_0x75ff('0x25')](respondWithResult(_0x516440,null))[_0x75ff('0x43')](handleError(_0x516440,null));};exports['getDispositions']=function(_0x4b98ac,_0x5975af,_0x578d90){var _0x1b622b={'raw':![],'where':{}};var _0x22ce28={};var _0x3f25f0={'count':0x0,'rows':[]};return db[_0x75ff('0x2c')][_0x75ff('0x56')]({'where':{'id':_0x4b98ac[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x5975af,null))['then'](function(_0x533154){if(_0x533154){_0x22ce28[_0x75ff('0x30')]=_[_0x75ff('0x46')](db[_0x75ff('0x55')]['rawAttributes']);_0x22ce28[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0x4b98ac[_0x75ff('0x32')]);_0x22ce28[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0x22ce28[_0x75ff('0x30')],_0x22ce28[_0x75ff('0x32')]);_0x1b622b[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x22ce28[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x4b98ac[_0x75ff('0x32')]['fields']));_0x1b622b[_0x75ff('0x35')]=_0x1b622b[_0x75ff('0x35')]['length']?_0x1b622b[_0x75ff('0x35')]:_0x22ce28[_0x75ff('0x30')];if(!_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x37')](_0x75ff('0x38'))){_0x1b622b['limit']=qs[_0x75ff('0x1e')](_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x1e')]);_0x1b622b[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0x4b98ac[_0x75ff('0x32')]['offset']);}_0x1b622b[_0x75ff('0x57')]=qs['sort'](_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x39')]);_0x1b622b[_0x75ff('0x3a')]=qs[_0x75ff('0x33')](_[_0x75ff('0x3b')](_0x4b98ac['query'],_0x22ce28['filters']));_0x1b622b['where'][_0x75ff('0x54')]=_0x533154['id'];if(_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x1b622b[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x1b622b[_0x75ff('0x3a')],{'$or':_[_0x75ff('0x31')](_0x1b622b[_0x75ff('0x35')],function(_0x5d3aad){var _0x1d7462={};_0x1d7462[_0x5d3aad]={'$like':'%'+_0x4b98ac[_0x75ff('0x32')][_0x75ff('0x3c')]+'%'};return _0x1d7462;})});}_0x1b622b=_[_0x75ff('0x3d')]({},_0x1b622b,_0x4b98ac[_0x75ff('0x3f')]);return db[_0x75ff('0x55')][_0x75ff('0x20')]({'where':_0x1b622b['where']})[_0x75ff('0x25')](function(_0x439ed5){_0x3f25f0[_0x75ff('0x20')]=_0x439ed5;if(_0x4b98ac['query'][_0x75ff('0x40')]){_0x1b622b[_0x75ff('0x48')]=[{'all':!![]}];}return db[_0x75ff('0x55')][_0x75ff('0x41')](_0x1b622b);})[_0x75ff('0x25')](function(_0x594132){_0x3f25f0[_0x75ff('0x42')]=_0x594132;return _0x3f25f0;});}})[_0x75ff('0x25')](respondWithFilteredResult(_0x5975af,_0x1b622b))[_0x75ff('0x43')](handleError(_0x5975af,null));};exports[_0x75ff('0x58')]=function(_0x22244a,_0x516bfe,_0x15d367){return db['CmList']['find']({'where':{'id':_0x22244a['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x516bfe,null))[_0x75ff('0x25')](function(_0x18676a){if(_0x18676a){return _0x18676a[_0x75ff('0x58')](_0x22244a[_0x75ff('0x32')][_0x75ff('0x59')]);}})[_0x75ff('0x25')](respondWithStatusCode(_0x516bfe,null))['catch'](handleError(_0x516bfe,null));};exports[_0x75ff('0x5a')]=function(_0x7c6815,_0xf1a5cf,_0x1542f5){return db[_0x75ff('0x2c')][_0x75ff('0x49')]({'where':{'id':_0x7c6815[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0xf1a5cf,null))[_0x75ff('0x25')](function(_0x512369){if(_0x512369){var _0xe18a2f=[];var _0xadafee={'success':[],'errors':[]};return db[_0x75ff('0x5b')]['describe']()['then'](function(_0x53b997){if(_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')]&&_[_0x75ff('0x5d')](_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')])){if(_0x7c6815['body']['tags']['length']){_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')]=_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x5c')][_0x75ff('0x5e')](';')+';';}else{_0x7c6815['body'][_0x75ff('0x5c')]=null;}}else{_0x7c6815['body'][_0x75ff('0x5c')]=null;}if(_0x7c6815[_0x75ff('0x4b')]&&_[_0x75ff('0x5d')](_0x7c6815[_0x75ff('0x4b')])){for(var _0x545c8c=0x0;_0x545c8c<_0x7c6815[_0x75ff('0x4b')][_0x75ff('0x47')];_0x545c8c+=0x1){_0x7c6815['body'][_0x545c8c][_0x75ff('0x54')]=_0x7c6815['params']['id'];_0xe18a2f[_0x75ff('0x5f')](_0x7c6815['body'][_0x545c8c]);}return BPromise['each'](_0xe18a2f,function(_0x5c0262){return db[_0x75ff('0x5b')][_0x75ff('0x4a')](_[_0x75ff('0x60')](_0x5c0262,['ids','id'])||{},{'fields':_[_0x75ff('0x46')](_0x53b997),'raw':!![]})[_0x75ff('0x25')](function(_0x1b55ac){_0xadafee[_0x75ff('0x61')][_0x75ff('0x5f')](_0x1b55ac[_0x75ff('0x62')]);})['catch'](function(_0x491977){_0xadafee[_0x75ff('0x63')][_0x75ff('0x5f')]({'data':_0x5c0262,'error':_0x491977[_0x75ff('0x64')]});});})[_0x75ff('0x25')](function(_0xf77933){return _0xadafee;})[_0x75ff('0x43')](function(_0x29aa12){return _0x29aa12;});}else{_0xf1a5cf[_0x75ff('0x1c')](0x190)['json']({'message':_0x75ff('0x65')});}});}})[_0x75ff('0x25')](respondWithResult(_0xf1a5cf,null))[_0x75ff('0x43')](handleError(_0xf1a5cf,null));};exports[_0x75ff('0x66')]=function(_0x1a62ed,_0x57d33b,_0x548d7b){var _0x751459;return db[_0x75ff('0x2c')][_0x75ff('0x49')]({'where':{'id':_0x1a62ed[_0x75ff('0x44')]['id']},'include':[{'model':db[_0x75ff('0x67')],'as':'CustomFields'}]})[_0x75ff('0x25')](handleEntityNotFound(_0x57d33b,null))['then'](function(_0x363f30){if(_0x363f30){_0x751459=_0x363f30;return db['CmContact'][_0x75ff('0x45')];}})['then'](function(_0x2db968){if(_0x2db968){var _0x3b54f0={};var _0xf2e1d8={};_0xf2e1d8[_0x75ff('0x30')]=_[_0x75ff('0x68')](_[_0x75ff('0x46')](_0x2db968),_[_0x75ff('0x31')](_0x751459[_0x75ff('0x69')],function(_0x1f69be){return util[_0x75ff('0x6a')]('cf_%d',_0x1f69be['id']);}));_0xf2e1d8[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0x1a62ed[_0x75ff('0x32')]);_0xf2e1d8[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0xf2e1d8[_0x75ff('0x30')],_0xf2e1d8[_0x75ff('0x32')]);_0x3b54f0['attributes']=_[_0x75ff('0x34')](_0xf2e1d8[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x1a62ed['query'][_0x75ff('0x36')]));_0x3b54f0[_0x75ff('0x35')]=_0x3b54f0[_0x75ff('0x35')][_0x75ff('0x47')]?_0x3b54f0[_0x75ff('0x35')]:_0xf2e1d8[_0x75ff('0x30')];if(!_0x1a62ed['query']['hasOwnProperty'](_0x75ff('0x38'))){_0x3b54f0[_0x75ff('0x1e')]=qs['limit'](_0x1a62ed['query'][_0x75ff('0x1e')]);_0x3b54f0[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0x1a62ed[_0x75ff('0x32')]['offset']);}_0x3b54f0['order']=qs[_0x75ff('0x39')](_0x1a62ed[_0x75ff('0x32')][_0x75ff('0x39')]);_0x3b54f0[_0x75ff('0x3a')]=qs['filters'](_[_0x75ff('0x3b')](_0x1a62ed['query'],_0xf2e1d8[_0x75ff('0x33')]));_0x3b54f0[_0x75ff('0x6b')]=!![];if(_0x1a62ed[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x3b54f0[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x3b54f0[_0x75ff('0x3a')],{'$or':_['map'](_0x3b54f0['attributes'],function(_0x46b9e3){var _0x40bd46={};_0x40bd46[_0x46b9e3]={'$like':'%'+_0x1a62ed['query']['filter']+'%'};return _0x40bd46;})});}_0x3b54f0=_['merge']({},_0x3b54f0,_0x1a62ed['options']);return _0x751459['getContacts'](_0x3b54f0);}})[_0x75ff('0x25')](respondWithResult(_0x57d33b,null))[_0x75ff('0x43')](handleError(_0x57d33b,null));};exports[_0x75ff('0x6c')]=function(_0x471e33,_0x336936,_0x316dc9){var _0x16e46f;var _0x53d8a9;var _0x5f5e05;var _0x583710=_0x471e33[_0x75ff('0x44')]['id'];csv_results=[];return db['ContactItemType'][_0x75ff('0x41')]({'attributes':['id',_0x75ff('0x2b')],'raw':!![],'order':[_0x75ff('0x6d')]})[_0x75ff('0x25')](function(_0x104fc2){_0x16e46f=_0x104fc2;var _0x10823c=_[_0x75ff('0x46')](db[_0x75ff('0x5b')][_0x75ff('0x45')]);return db['CmCustomField'][_0x75ff('0x41')]({'raw':!![],'attributes':['id','alias']})['then'](function(_0x43910b){_0x53d8a9=_0x43910b;var _0x1a2574=squel[_0x75ff('0x6e')]()[_0x75ff('0x36')](_0x10823c)[_0x75ff('0x6f')]('cm_contacts','c')[_0x75ff('0x3a')](_0x75ff('0x70'),_0x583710)['where'](_0x75ff('0x71'))[_0x75ff('0x72')]();for(var _0x1af4c0=0x0;_0x1af4c0<_0x53d8a9['length'];_0x1af4c0++){_0x1a2574[_0x75ff('0x73')](_0x75ff('0x74')+_0x53d8a9[_0x1af4c0]['id'],_0x75ff('0x75')+_0x53d8a9[_0x1af4c0][_0x75ff('0x76')]);}for(var _0x1af4c0=0x0;_0x1af4c0<_0x16e46f[_0x75ff('0x47')];_0x1af4c0++){_0x1a2574['field'](squel[_0x75ff('0x6e')]()[_0x75ff('0x73')]('item')[_0x75ff('0x6f')](_0x75ff('0x77'))['where'](_0x75ff('0x78'),_0x16e46f[_0x1af4c0]['id'])['where']('CmContactId\x20=\x20c.id'),_0x75ff('0x79')+_0x16e46f[_0x1af4c0][_0x75ff('0x2b')]);_0x1a2574[_0x75ff('0x73')](squel[_0x75ff('0x6e')]()[_0x75ff('0x73')](_0x75ff('0x7a'))[_0x75ff('0x6f')](_0x75ff('0x77'))['where'](_0x75ff('0x78'),_0x16e46f[_0x1af4c0]['id'])['where']('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x16e46f[_0x1af4c0][_0x75ff('0x2b')]);}var _0x2348b1=[];_0x2348b1[_0x75ff('0x5f')](_0x1a2574['toString']());BPromise[_0x75ff('0x7b')](_0x2348b1,handleQuery)[_0x75ff('0x25')](function(_0x325fa1){handleQuery(_0x1a2574[_0x75ff('0x7c')]());var _0x3217c2=csv_results[0x0];if(!_['isEmpty'](_0x3217c2)){var _0x71c036=toCsv(_0x3217c2);var _0xb4d3af=Date[_0x75ff('0x7d')]();fs['writeFileSync'](util[_0x75ff('0x6a')](_0x75ff('0x7e'),_0x583710,_0xb4d3af),_0x71c036);_0x336936['setHeader'](_0x75ff('0x7f'),_0x75ff('0x80')+util[_0x75ff('0x6a')]('list_%d_%s.csv',_0x583710,_0xb4d3af));_0x336936[_0x75ff('0x81')](_0x75ff('0x82'),_0x75ff('0x83'));return _0x336936[_0x75ff('0x84')](util['format'](_0x75ff('0x7e'),_0x583710,_0xb4d3af));}else{return _0x336936[_0x75ff('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x56854d,_0x50f409,_0x48a82f){var _0xe9174;delete _0x56854d[_0x75ff('0x4b')]['id'];return db[_0x75ff('0x2c')][_0x75ff('0x56')]({'where':{'id':_0x56854d[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x50f409,null))[_0x75ff('0x25')](function(_0xa51ca7){if(_0xa51ca7){return db[_0x75ff('0x85')][_0x75ff('0x86')](function(_0x1a9888){return db[_0x75ff('0x67')]['create'](_0x56854d[_0x75ff('0x4b')],{'transaction':_0x1a9888})['then'](function(_0x12eb59){_0xe9174=_0x12eb59;return _0xa51ca7[_0x75ff('0x87')](_0x12eb59,{'transaction':_0x1a9888});})[_0x75ff('0x25')](function(){var _0x158dd4={'type':db[_0x75ff('0x88')][_0x75ff('0x89')],'transaction':_0x1a9888};switch(_0x56854d[_0x75ff('0x4b')]['type']){case'text':_0x158dd4['type']=db[_0x75ff('0x88')][_0x75ff('0x89')];break;case _0x75ff('0x8a'):_0x158dd4[_0x75ff('0x2e')]=db['Sequelize'][_0x75ff('0x8b')];break;case _0x75ff('0x8c'):_0x158dd4['type']=db['Sequelize'][_0x75ff('0x8d')];_0x158dd4['defaultValue']=![];break;default:}return db[_0x75ff('0x85')]['queryInterface'][_0x75ff('0x8e')](_0x75ff('0x8f'),util[_0x75ff('0x6a')]('cf_%s',_0xe9174['id']),_0x158dd4);})[_0x75ff('0x25')](function(){return _0xe9174;});});}})[_0x75ff('0x25')](respondWithResult(_0x50f409,null))[_0x75ff('0x43')](handleError(_0x50f409,null));};exports[_0x75ff('0x90')]=function(_0x5adbf3,_0x3615db,_0x3af767){var _0x5bf841={};var _0x1ae981={};var _0x5c3f0c;var _0x3cb757;return db[_0x75ff('0x2c')][_0x75ff('0x56')]({'where':{'id':_0x5adbf3[_0x75ff('0x44')]['id']}})['then'](handleEntityNotFound(_0x3615db,null))[_0x75ff('0x25')](function(_0x1079f4){if(_0x1079f4){_0x5c3f0c=_0x1079f4;_0x1ae981[_0x75ff('0x30')]=_[_0x75ff('0x46')](db['CmCustomField']['rawAttributes']);_0x1ae981[_0x75ff('0x32')]=_[_0x75ff('0x46')](_0x5adbf3[_0x75ff('0x32')]);_0x1ae981['filters']=_[_0x75ff('0x34')](_0x1ae981['model'],_0x1ae981[_0x75ff('0x32')]);_0x5bf841[_0x75ff('0x35')]=_[_0x75ff('0x34')](_0x1ae981[_0x75ff('0x30')],qs[_0x75ff('0x36')](_0x5adbf3['query'][_0x75ff('0x36')]));_0x5bf841[_0x75ff('0x35')]=_0x5bf841[_0x75ff('0x35')][_0x75ff('0x47')]?_0x5bf841[_0x75ff('0x35')]:_0x1ae981[_0x75ff('0x30')];_0x5bf841[_0x75ff('0x57')]=qs[_0x75ff('0x39')](_0x5adbf3['query']['sort']);_0x5bf841[_0x75ff('0x3a')]=qs['filters'](_['pick'](_0x5adbf3[_0x75ff('0x32')],_0x1ae981['filters']));_0x5bf841['where']=_[_0x75ff('0x3d')](_0x5bf841[_0x75ff('0x3a')],{'$or':[{'ListId':_0x1079f4['id']},{'ListId':null}]});if(_0x5adbf3[_0x75ff('0x32')][_0x75ff('0x3c')]){_0x5bf841[_0x75ff('0x3a')]=_[_0x75ff('0x3d')](_0x5bf841[_0x75ff('0x3a')],{'$or':_['map'](_0x5bf841[_0x75ff('0x35')],function(_0x18a99d){var _0x54fee9={};_0x54fee9[_0x18a99d]={'$like':'%'+_0x5adbf3[_0x75ff('0x32')][_0x75ff('0x3c')]+'%'};return _0x54fee9;})});}_0x5bf841=_[_0x75ff('0x3d')]({},_0x5bf841,_0x5adbf3[_0x75ff('0x3f')]);return db[_0x75ff('0x67')]['findAndCountAll'](_0x5bf841);}})[_0x75ff('0x25')](respondWithResult(_0x3615db,null))[_0x75ff('0x43')](handleError(_0x3615db,null));};exports['getGlobalCustomFields']=function(_0x5af566,_0x145ecb){return db[_0x75ff('0x67')]['findAndCountAll']({'where':{'ListId':null}})[_0x75ff('0x25')](handleEntityNotFound(_0x145ecb,null))[_0x75ff('0x25')](function(_0x466f35){return _0x466f35;})[_0x75ff('0x25')](respondWithResult(_0x145ecb,null))[_0x75ff('0x43')](handleError(_0x145ecb,null));};exports[_0x75ff('0x91')]=function(_0x53e3bf,_0x544875,_0x216594){return db['CmList'][_0x75ff('0x49')]({'where':{'id':_0x53e3bf[_0x75ff('0x44')]['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x544875,null))['then'](function(_0x19cefc){if(_0x19cefc){return _0x19cefc[_0x75ff('0x91')](_0x53e3bf[_0x75ff('0x4b')][_0x75ff('0x59')],_[_0x75ff('0x60')](_0x53e3bf[_0x75ff('0x4b')],[_0x75ff('0x59'),'id'])||{})[_0x75ff('0x92')](function(_0xe73311){for(var _0x45197e=0x0;_0x45197e<_0x53e3bf[_0x75ff('0x4b')][_0x75ff('0x59')]['length'];_0x45197e+=0x1){socket[_0x75ff('0x93')]('userCmList:save',{'UserId':Number(_0x53e3bf[_0x75ff('0x4b')][_0x75ff('0x59')][_0x45197e]),'CmListId':Number(_0x53e3bf[_0x75ff('0x44')]['id'])});}return _0xe73311;});}})[_0x75ff('0x25')](respondWithResult(_0x544875,null))[_0x75ff('0x43')](handleError(_0x544875,null));};exports[_0x75ff('0x94')]=function(_0xeb8a1a,_0x1c76b4,_0x2d2399){return db['CmList'][_0x75ff('0x49')]({'where':{'id':_0xeb8a1a['params']['id']}})[_0x75ff('0x25')](handleEntityNotFound(_0x1c76b4,null))[_0x75ff('0x25')](function(_0x391a06){if(_0x391a06){return _0x391a06['removeAgents'](_0xeb8a1a[_0x75ff('0x32')]['ids'])[_0x75ff('0x25')](function(){if(_[_0x75ff('0x5d')](_0xeb8a1a[_0x75ff('0x32')][_0x75ff('0x59')])){for(var _0x171e62=0x0;_0x171e62<_0xeb8a1a['query'][_0x75ff('0x59')][_0x75ff('0x47')];_0x171e62+=0x1){socket['emit'](_0x75ff('0x95'),{'UserId':Number(_0xeb8a1a['query'][_0x75ff('0x59')][_0x171e62]),'CmListId':Number(_0xeb8a1a[_0x75ff('0x44')]['id'])});}}else{socket[_0x75ff('0x93')](_0x75ff('0x95'),{'UserId':Number(_0xeb8a1a[_0x75ff('0x32')][_0x75ff('0x59')]),'CmListId':Number(_0xeb8a1a[_0x75ff('0x44')]['id'])});}});}})[_0x75ff('0x25')](respondWithStatusCode(_0x1c76b4,null))[_0x75ff('0x43')](handleError(_0x1c76b4,null));};exports['getAgents']=function(_0xbca4f2,_0x53f412,_0x43d67c){var _0x3f3e0f={};var _0xfe5865={};var _0x1d880f;var _0x2bb963;return db['CmList'][_0x75ff('0x56')]({'where':{'id':_0xbca4f2['params']['id']}})['then'](handleEntityNotFound(_0x53f412,null))[_0x75ff('0x25')](function(_0x551e0c){if(_0x551e0c){_0x1d880f=_0x551e0c;_0xfe5865[_0x75ff('0x30')]=_['keys'](db['User']['rawAttributes']);_0xfe5865['query']=_['keys'](_0xbca4f2[_0x75ff('0x32')]);_0xfe5865[_0x75ff('0x33')]=_[_0x75ff('0x34')](_0xfe5865[_0x75ff('0x30')],_0xfe5865[_0x75ff('0x32')]);_0x3f3e0f['attributes']=_['intersection'](_0xfe5865['model'],qs[_0x75ff('0x36')](_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x36')]));_0x3f3e0f[_0x75ff('0x35')]=_0x3f3e0f[_0x75ff('0x35')]['length']?_0x3f3e0f[_0x75ff('0x35')]:_0xfe5865['model'];_0x3f3e0f[_0x75ff('0x57')]=qs[_0x75ff('0x39')](_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x39')]);_0x3f3e0f['where']=qs[_0x75ff('0x33')](_[_0x75ff('0x3b')](_0xbca4f2[_0x75ff('0x32')],_0xfe5865['filters']));if(_0xbca4f2['query'][_0x75ff('0x3c')]){_0x3f3e0f[_0x75ff('0x3a')]=_['merge'](_0x3f3e0f[_0x75ff('0x3a')],{'$or':_[_0x75ff('0x31')](_0x3f3e0f[_0x75ff('0x35')],function(_0x2c6500){var _0x14b956={};_0x14b956[_0x2c6500]={'$like':'%'+_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x3c')]+'%'};return _0x14b956;})});}_0x3f3e0f=_[_0x75ff('0x3d')]({},_0x3f3e0f,_0xbca4f2[_0x75ff('0x3f')]);return _0x1d880f[_0x75ff('0x96')](_0x3f3e0f);}})[_0x75ff('0x25')](function(_0x1d4848){if(_0x1d4848){_0x2bb963=_0x1d4848[_0x75ff('0x47')];if(!_0xbca4f2[_0x75ff('0x32')][_0x75ff('0x37')]('nolimit')){_0x3f3e0f[_0x75ff('0x1e')]=qs[_0x75ff('0x1e')](_0xbca4f2[_0x75ff('0x32')]['limit']);_0x3f3e0f[_0x75ff('0x21')]=qs[_0x75ff('0x21')](_0xbca4f2['query'][_0x75ff('0x21')]);}return _0x1d880f[_0x75ff('0x96')](_0x3f3e0f);}})['then'](function(_0x427fa1){if(_0x427fa1){return _0x427fa1?{'count':_0x2bb963,'rows':_0x427fa1}:null;}})[_0x75ff('0x25')](respondWithResult(_0x53f412,null))[_0x75ff('0x43')](handleError(_0x53f412,null));};function handleQuery(_0x443e2d){logger[_0x75ff('0x97')](_0x443e2d);return db[_0x75ff('0x85')][_0x75ff('0x32')](_0x443e2d)[_0x75ff('0x92')](function(_0x5d3c31){csv_results['push'](_0x5d3c31);})['catch'](function(_0x4e6daf){logger[_0x75ff('0x29')](_0x4e6daf['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1119d52..d91dcf7 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x149f3d,_0x1c36b8){var _0x1775b8=function(_0x224c05){while(--_0x224c05){_0x149f3d['push'](_0x149f3d['shift']());}};_0x1775b8(++_0x1c36b8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x518bbd,_0x5b73f3){_0x518bbd=_0x518bbd-0x0;var _0x1fb92d=_0x3e74[_0x518bbd];return _0x1fb92d;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4fca68d..ee1e5de 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 _0xb4e6=['path','rimraf','./cmList.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4071bc,_0x1e1430){var _0x54c49f=function(_0x496dbe){while(--_0x496dbe){_0x4071bc['push'](_0x4071bc['shift']());}};_0x54c49f(++_0x1e1430);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0xb4e6[_0x258919];return _0xfbd68b;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55e0=['./cmList.attributes','exports','define','cm_lists','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x55e0,0xdc));var _0x055e=function(_0x39f9e8,_0x4edccf){_0x39f9e8=_0x39f9e8-0x0;var _0x2d37f6=_0x55e0[_0x39f9e8];return _0x2d37f6;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('CmList',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index b9275a5..50430a5 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 _0x3d1c=['info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','./cmList.socket','request'];(function(_0x3cf612,_0xc8f119){var _0xc3981f=function(_0x56e798){while(--_0x56e798){_0x3cf612['push'](_0x3cf612['shift']());}};_0xc3981f(++_0xc8f119);}(_0x3d1c,0x1ed));var _0xc3d1=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x3d1c[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0xc3d1('0x0'));var util=require(_0xc3d1('0x1'));var moment=require(_0xc3d1('0x2'));var BPromise=require(_0xc3d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3d1('0x5'))(_0xc3d1('0x6'));var config=require(_0xc3d1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3d1('0x8')]['http']({'port':0x232a});config[_0xc3d1('0x9')]=_[_0xc3d1('0xa')](config[_0xc3d1('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3d1('0x9')]));require(_0xc3d1('0xb'))['register'](socket);function respondWithRpcPromise(_0x224319,_0x324eb3,_0xee4393){return new BPromise(function(_0x29ba89,_0x380089){return client[_0xc3d1('0xc')](_0x224319,_0xee4393)['then'](function(_0x5edfaa){logger[_0xc3d1('0xd')](_0xc3d1('0xe'),_0x324eb3,'request\x20sent');logger[_0xc3d1('0xf')](_0xc3d1('0x10'),_0x324eb3,_0xc3d1('0x11'),JSON[_0xc3d1('0x12')](_0x5edfaa));if(_0x5edfaa['error']){if(_0x5edfaa[_0xc3d1('0x13')]['code']===0x1f4){logger['error'](_0xc3d1('0xe'),_0x324eb3,_0x5edfaa[_0xc3d1('0x13')][_0xc3d1('0x14')]);return _0x380089(_0x5edfaa[_0xc3d1('0x13')][_0xc3d1('0x14')]);}logger[_0xc3d1('0x13')](_0xc3d1('0xe'),_0x324eb3,_0x5edfaa[_0xc3d1('0x13')]['message']);return _0x29ba89(_0x5edfaa[_0xc3d1('0x13')][_0xc3d1('0x14')]);}else{logger[_0xc3d1('0xd')]('CmList,\x20%s,\x20%s',_0x324eb3,_0xc3d1('0x11'));_0x29ba89(_0x5edfaa[_0xc3d1('0x15')]['message']);}})[_0xc3d1('0x16')](function(_0x273d2a){logger['error']('CmList,\x20%s,\x20%s',_0x324eb3,_0x273d2a);_0x380089(_0x273d2a);});});} \ No newline at end of file +var _0x9f3b=['./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','localhost','socket.io-emitter'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0x9f3b,0x16c));var _0xb9f3=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0x9f3b[_0x12aba8];return _0x2aac66;};'use strict';var _=require('lodash');var util=require(_0xb9f3('0x0'));var moment=require(_0xb9f3('0x1'));var BPromise=require(_0xb9f3('0x2'));var rs=require(_0xb9f3('0x3'));var fs=require('fs');var Redis=require(_0xb9f3('0x4'));var db=require(_0xb9f3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9f3('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb9f3('0x7')]({'port':0x232a});config[_0xb9f3('0x8')]=_['defaults'](config[_0xb9f3('0x8')],{'host':_0xb9f3('0x9'),'port':0x18eb});var socket=require(_0xb9f3('0xa'))(new Redis(config[_0xb9f3('0x8')]));require(_0xb9f3('0xb'))[_0xb9f3('0xc')](socket);function respondWithRpcPromise(_0xa613eb,_0x5216df,_0x2c1a66){return new BPromise(function(_0x43f37e,_0x481d1f){return client[_0xb9f3('0xd')](_0xa613eb,_0x2c1a66)[_0xb9f3('0xe')](function(_0x23e7bc){logger[_0xb9f3('0xf')](_0xb9f3('0x10'),_0x5216df,_0xb9f3('0x11'));logger[_0xb9f3('0x12')](_0xb9f3('0x13'),_0x5216df,_0xb9f3('0x11'),JSON[_0xb9f3('0x14')](_0x23e7bc));if(_0x23e7bc['error']){if(_0x23e7bc['error'][_0xb9f3('0x15')]===0x1f4){logger[_0xb9f3('0x16')]('CmList,\x20%s,\x20%s',_0x5216df,_0x23e7bc['error'][_0xb9f3('0x17')]);return _0x481d1f(_0x23e7bc[_0xb9f3('0x16')][_0xb9f3('0x17')]);}logger[_0xb9f3('0x16')](_0xb9f3('0x10'),_0x5216df,_0x23e7bc[_0xb9f3('0x16')]['message']);return _0x43f37e(_0x23e7bc[_0xb9f3('0x16')][_0xb9f3('0x17')]);}else{logger[_0xb9f3('0xf')](_0xb9f3('0x10'),_0x5216df,_0xb9f3('0x11'));_0x43f37e(_0x23e7bc[_0xb9f3('0x18')][_0xb9f3('0x17')]);}})['catch'](function(_0x21ce7c){logger[_0xb9f3('0x16')](_0xb9f3('0x10'),_0x5216df,_0x21ce7c);_0x481d1f(_0x21ce7c);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 1025f7a..dca0f40 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 _0xd595=['remove','update','emit','removeListener','register','length','cmList:','./cmList.events'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xd595,0x147));var _0x5d59=function(_0x5cee76,_0x511b2a){_0x5cee76=_0x5cee76-0x0;var _0x32426f=_0xd595[_0x5cee76];return _0x32426f;};'use strict';var CmListEvents=require(_0x5d59('0x0'));var events=['save',_0x5d59('0x1'),_0x5d59('0x2')];function createListener(_0x2d893f,_0x2c17e9){return function(_0x478143){_0x2c17e9[_0x5d59('0x3')](_0x2d893f,_0x478143);};}function removeListener(_0x138949,_0x4660e9){return function(){CmListEvents[_0x5d59('0x4')](_0x138949,_0x4660e9);};}exports[_0x5d59('0x5')]=function(_0x35d63a){for(var _0x21d955=0x0,_0x1d6b5d=events[_0x5d59('0x6')];_0x21d955<_0x1d6b5d;_0x21d955++){var _0xcaccba=events[_0x21d955];var _0x11abe7=createListener(_0x5d59('0x7')+_0xcaccba,_0x35d63a);CmListEvents['on'](_0xcaccba,_0x11abe7);}}; \ No newline at end of file +var _0xa07d=['./cmList.events','save','remove','update','removeListener','register','length','cmList:'];(function(_0x2c16c5,_0x12a02b){var _0x455e0d=function(_0x361e53){while(--_0x361e53){_0x2c16c5['push'](_0x2c16c5['shift']());}};_0x455e0d(++_0x12a02b);}(_0xa07d,0x150));var _0xda07=function(_0x916ccc,_0x19734f){_0x916ccc=_0x916ccc-0x0;var _0xfd449b=_0xa07d[_0x916ccc];return _0xfd449b;};'use strict';var CmListEvents=require(_0xda07('0x0'));var events=[_0xda07('0x1'),_0xda07('0x2'),_0xda07('0x3')];function createListener(_0x1cccb4,_0x2fd6b8){return function(_0x4408c3){_0x2fd6b8['emit'](_0x1cccb4,_0x4408c3);};}function removeListener(_0x437038,_0x281bc2){return function(){CmListEvents[_0xda07('0x4')](_0x437038,_0x281bc2);};}exports[_0xda07('0x5')]=function(_0x54645b){for(var _0x31afbe=0x0,_0x3ad6a3=events[_0xda07('0x6')];_0x31afbe<_0x3ad6a3;_0x31afbe++){var _0x1d7afb=events[_0x31afbe];var _0x37345d=createListener(_0xda07('0x7')+_0x1d7afb,_0x54645b);CmListEvents['on'](_0x1d7afb,_0x37345d);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3ce2688..b23f075 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 _0x11cd=['fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','create','post','/:id/dispositions','addDisposition','/:id/fields','addCustomField','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x5bb592,_0x279a9f){var _0x2a84d2=function(_0x218a9e){while(--_0x218a9e){_0x5bb592['push'](_0x5bb592['shift']());}};_0x2a84d2(++_0x279a9f);}(_0x11cd,0x194));var _0xd11c=function(_0x87f64b,_0x146e71){_0x87f64b=_0x87f64b-0x0;var _0x426a73=_0x11cd[_0x87f64b];return _0x426a73;};'use strict';var multer=require('multer');var util=require(_0xd11c('0x0'));var path=require('path');var timeout=require(_0xd11c('0x1'));var express=require(_0xd11c('0x2'));var router=express[_0xd11c('0x3')]();var fs_extra=require(_0xd11c('0x4'));var auth=require(_0xd11c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd11c('0x6'));var controller=require(_0xd11c('0x7'));router[_0xd11c('0x8')]('/',auth['isAuthenticated'](),controller[_0xd11c('0x9')]);router['get'](_0xd11c('0xa'),auth[_0xd11c('0xb')](),controller[_0xd11c('0xc')]);router[_0xd11c('0x8')](_0xd11c('0xd'),auth[_0xd11c('0xb')](),controller['getGlobalCustomFields']);router[_0xd11c('0x8')](_0xd11c('0xe'),auth[_0xd11c('0xb')](),controller[_0xd11c('0xf')]);router[_0xd11c('0x8')]('/:id/dispositions',auth[_0xd11c('0xb')](),controller[_0xd11c('0x10')]);router[_0xd11c('0x8')](_0xd11c('0x11'),auth['isAuthenticated'](),controller[_0xd11c('0x12')]);router[_0xd11c('0x8')](_0xd11c('0x13'),auth['isAuthenticated'](),controller[_0xd11c('0x14')]);router[_0xd11c('0x8')]('/:id/fields',auth[_0xd11c('0xb')](),controller[_0xd11c('0x15')]);router[_0xd11c('0x8')](_0xd11c('0x16'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xd11c('0xb')](),controller[_0xd11c('0x17')]);router[_0xd11c('0x18')](_0xd11c('0x19'),auth[_0xd11c('0xb')](),controller[_0xd11c('0x1a')]);router['post'](_0xd11c('0x11'),auth[_0xd11c('0xb')](),controller['addContacts']);router[_0xd11c('0x18')](_0xd11c('0x1b'),auth['isAuthenticated'](),controller[_0xd11c('0x1c')]);router[_0xd11c('0x18')]('/:id/users',auth[_0xd11c('0xb')](),controller['addAgents']);router[_0xd11c('0x1d')](_0xd11c('0xe'),auth[_0xd11c('0xb')](),controller[_0xd11c('0x1e')]);router[_0xd11c('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xd11c('0x20')]);router[_0xd11c('0x1f')](_0xd11c('0x19'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xd11c('0x16'),auth[_0xd11c('0xb')](),controller['removeAgents']);module[_0xd11c('0x21')]=router; \ No newline at end of file +var _0x591a=['/:id/contacts/csv','getContactsCsv','getAgents','post','/:id/contacts','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','/global_fields','getGlobalCustomFields','show','/:id/dispositions','getDispositions'];(function(_0x2c4f3f,_0x266947){var _0x3d0234=function(_0x31495c){while(--_0x31495c){_0x2c4f3f['push'](_0x2c4f3f['shift']());}};_0x3d0234(++_0x266947);}(_0x591a,0xf8));var _0xa591=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x591a[_0xd7b0a4];return _0x184e9e;};'use strict';var multer=require(_0xa591('0x0'));var util=require('util');var path=require(_0xa591('0x1'));var timeout=require('connect-timeout');var express=require(_0xa591('0x2'));var router=express['Router']();var fs_extra=require(_0xa591('0x3'));var auth=require(_0xa591('0x4'));var interaction=require(_0xa591('0x5'));var config=require('../../config/environment');var controller=require(_0xa591('0x6'));router[_0xa591('0x7')]('/',auth[_0xa591('0x8')](),controller[_0xa591('0x9')]);router['get'](_0xa591('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa591('0x7')](_0xa591('0xb'),auth[_0xa591('0x8')](),controller[_0xa591('0xc')]);router[_0xa591('0x7')]('/:id',auth[_0xa591('0x8')](),controller[_0xa591('0xd')]);router[_0xa591('0x7')](_0xa591('0xe'),auth[_0xa591('0x8')](),controller[_0xa591('0xf')]);router[_0xa591('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xa591('0x7')](_0xa591('0x10'),auth[_0xa591('0x8')](),controller[_0xa591('0x11')]);router[_0xa591('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0xa591('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xa591('0x12')]);router[_0xa591('0x13')]('/',auth[_0xa591('0x8')](),controller['create']);router[_0xa591('0x13')](_0xa591('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xa591('0x13')](_0xa591('0x14'),auth[_0xa591('0x8')](),controller[_0xa591('0x15')]);router['post'](_0xa591('0x16'),auth[_0xa591('0x8')](),controller[_0xa591('0x17')]);router[_0xa591('0x13')](_0xa591('0x18'),auth[_0xa591('0x8')](),controller[_0xa591('0x19')]);router[_0xa591('0x1a')](_0xa591('0x1b'),auth[_0xa591('0x8')](),controller[_0xa591('0x1c')]);router[_0xa591('0x1d')](_0xa591('0x1b'),auth['isAuthenticated'](),controller[_0xa591('0x1e')]);router[_0xa591('0x1d')](_0xa591('0xe'),auth['isAuthenticated'](),controller[_0xa591('0x1f')]);router[_0xa591('0x1d')]('/:id/users',auth[_0xa591('0x8')](),controller[_0xa591('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index dbd25da..10c9f69 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 _0x9af6=['getDataValue','field','STRING','sequelize','VIRTUAL'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x9af6,0x120));var _0x69af=function(_0x445df1,_0x348a49){_0x445df1=_0x445df1-0x0;var _0x3babc4=_0x9af6[_0x445df1];return _0x3babc4;};'use strict';var Sequelize=require(_0x69af('0x0'));module['exports']={'name':{'type':Sequelize[_0x69af('0x1')],'get':function(_0x43eb11){return this[_0x69af('0x2')](_0x69af('0x3'));}},'field':{'type':Sequelize[_0x69af('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x69af('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xe543=['sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xe543,0x13c));var _0x3e54=function(_0x526820,_0x1f4676){_0x526820=_0x526820-0x0;var _0x32e399=_0xe543[_0x526820];return _0x32e399;};'use strict';var Sequelize=require(_0x3e54('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e54('0x1')],'get':function(_0x2dc0ae){return this[_0x3e54('0x2')]('field');}},'field':{'type':Sequelize[_0x3e54('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x3e54('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x3e54('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 7f815b8..48d4b2a 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x3f33af,_0x215054){var _0x1190c4=function(_0x20d2cc){while(--_0x20d2cc){_0x3f33af['push'](_0x3f33af['shift']());}};_0x1190c4(++_0x215054);}(_0x7a54,0x106));var _0x47a5=function(_0x45941e,_0x5b54b0){_0x45941e=_0x45941e-0x0;var _0x220f60=_0x7a54[_0x45941e];return _0x220f60;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x59c98,_0x50ef55){var _0x365bac=function(_0x59bc00){while(--_0x59bc00){_0x59c98['push'](_0x59c98['shift']());}};_0x365bac(++_0x50ef55);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index f4b307e..656946b 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 _0x6ce0=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x48c5f6,_0x467809){var _0x5517a4=function(_0x48d762){while(--_0x48d762){_0x48c5f6['push'](_0x48c5f6['shift']());}};_0x5517a4(++_0x467809);}(_0x6ce0,0xf1));var _0x06ce=function(_0xf43cb,_0x465374){_0xf43cb=_0xf43cb-0x0;var _0x14e869=_0x6ce0[_0xf43cb];return _0x14e869;};'use strict';var _=require(_0x06ce('0x0'));var util=require('util');var logger=require(_0x06ce('0x1'))(_0x06ce('0x2'));var moment=require(_0x06ce('0x3'));var BPromise=require(_0x06ce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x06ce('0x5'));var rimraf=require(_0x06ce('0x6'));var config=require(_0x06ce('0x7'));var attributes=require(_0x06ce('0x8'));module[_0x06ce('0x9')]=function(_0x3174fd,_0x215d1b){return _0x3174fd[_0x06ce('0xa')](_0x06ce('0xb'),attributes,{'tableName':_0x06ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a61=['util','moment','bluebird','request-promise','path','./condition.attributes','exports','define','lodash'];(function(_0x10a62b,_0x3d7f54){var _0x3af3f8=function(_0x341690){while(--_0x341690){_0x10a62b['push'](_0x10a62b['shift']());}};_0x3af3f8(++_0x3d7f54);}(_0x4a61,0x182));var _0x14a6=function(_0x50ff61,_0x311e41){_0x50ff61=_0x50ff61-0x0;var _0x242d76=_0x4a61[_0x50ff61];return _0x242d76;};'use strict';var _=require(_0x14a6('0x0'));var util=require(_0x14a6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x14a6('0x2'));var BPromise=require(_0x14a6('0x3'));var rp=require(_0x14a6('0x4'));var fs=require('fs');var path=require(_0x14a6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14a6('0x6'));module[_0x14a6('0x7')]=function(_0x2bd54b,_0x1d204a){return _0x2bd54b[_0x14a6('0x8')]('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 e454101..1257973 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 _0x997a=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x997a,0x165));var _0xa997=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x997a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa997('0x0'));var util=require(_0xa997('0x1'));var moment=require(_0xa997('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa997('0x3'));var db=require(_0xa997('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa997('0x5'))(_0xa997('0x6'));var config=require('../../config/environment');var jayson=require(_0xa997('0x7'));var client=jayson['client'][_0xa997('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b7510,_0x5f362c,_0x2da65d){return new BPromise(function(_0x5f0321,_0x5d2df0){return client[_0xa997('0x9')](_0x2b7510,_0x2da65d)[_0xa997('0xa')](function(_0x5aa5df){logger['info'](_0xa997('0xb'),_0x5f362c,_0xa997('0xc'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x5f362c,_0xa997('0xc'),JSON[_0xa997('0xd')](_0x5aa5df));if(_0x5aa5df[_0xa997('0xe')]){if(_0x5aa5df[_0xa997('0xe')][_0xa997('0xf')]===0x1f4){logger['error'](_0xa997('0xb'),_0x5f362c,_0x5aa5df[_0xa997('0xe')]['message']);return _0x5d2df0(_0x5aa5df[_0xa997('0xe')][_0xa997('0x10')]);}logger[_0xa997('0xe')](_0xa997('0xb'),_0x5f362c,_0x5aa5df[_0xa997('0xe')][_0xa997('0x10')]);return _0x5f0321(_0x5aa5df[_0xa997('0xe')][_0xa997('0x10')]);}else{logger['info'](_0xa997('0xb'),_0x5f362c,_0xa997('0xc'));_0x5f0321(_0x5aa5df[_0xa997('0x11')][_0xa997('0x10')]);}})[_0xa997('0x12')](function(_0x2561e0){logger[_0xa997('0xe')](_0xa997('0xb'),_0x5f362c,_0x2561e0);_0x5d2df0(_0x2561e0);});});} \ No newline at end of file +var _0x434e=['Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent'];(function(_0x54e8e1,_0x48c25a){var _0x5944fe=function(_0x489f0c){while(--_0x489f0c){_0x54e8e1['push'](_0x54e8e1['shift']());}};_0x5944fe(++_0x48c25a);}(_0x434e,0x16b));var _0xe434=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x434e[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0xe434('0x0'));var util=require(_0xe434('0x1'));var moment=require(_0xe434('0x2'));var BPromise=require(_0xe434('0x3'));var rs=require(_0xe434('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe434('0x5'))(_0xe434('0x6'));var config=require(_0xe434('0x7'));var jayson=require(_0xe434('0x8'));var client=jayson[_0xe434('0x9')][_0xe434('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1222de,_0x538a4b,_0x240cd3){return new BPromise(function(_0x41f978,_0x2c6817){return client[_0xe434('0xb')](_0x1222de,_0x240cd3)[_0xe434('0xc')](function(_0x1001c6){logger['info'](_0xe434('0xd'),_0x538a4b,_0xe434('0xe'));logger['debug'](_0xe434('0xf'),_0x538a4b,_0xe434('0xe'),JSON[_0xe434('0x10')](_0x1001c6));if(_0x1001c6['error']){if(_0x1001c6[_0xe434('0x11')]['code']===0x1f4){logger[_0xe434('0x11')](_0xe434('0xd'),_0x538a4b,_0x1001c6[_0xe434('0x11')][_0xe434('0x12')]);return _0x2c6817(_0x1001c6[_0xe434('0x11')][_0xe434('0x12')]);}logger[_0xe434('0x11')]('Condition,\x20%s,\x20%s',_0x538a4b,_0x1001c6[_0xe434('0x11')]['message']);return _0x41f978(_0x1001c6[_0xe434('0x11')][_0xe434('0x12')]);}else{logger[_0xe434('0x13')](_0xe434('0xd'),_0x538a4b,'request\x20sent');_0x41f978(_0x1001c6[_0xe434('0x14')][_0xe434('0x12')]);}})['catch'](function(_0x2d6c67){logger[_0xe434('0x11')]('Condition,\x20%s,\x20%s',_0x538a4b,_0x2d6c67);_0x2c6817(_0x2d6c67);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 331159b..6ec246f 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 _0x1305=['isAuthenticated','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','/:id'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x1305,0xef));var _0x5130=function(_0x75b04b,_0x35aaa9){_0x75b04b=_0x75b04b-0x0;var _0x3d0b6a=_0x1305[_0x75b04b];return _0x3d0b6a;};'use strict';var multer=require(_0x5130('0x0'));var util=require(_0x5130('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5130('0x2'));var router=express[_0x5130('0x3')]();var fs_extra=require(_0x5130('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5130('0x5'));var config=require(_0x5130('0x6'));var controller=require('./condition.controller');router['put'](_0x5130('0x7'),auth[_0x5130('0x8')](),controller[_0x5130('0x9')]);router[_0x5130('0xa')](_0x5130('0x7'),auth['isAuthenticated'](),controller[_0x5130('0xb')]);module[_0x5130('0xc')]=router; \ No newline at end of file +var _0xa2a6=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x5bbc18,_0x4c7f09){var _0x205cb2=function(_0x221438){while(--_0x221438){_0x5bbc18['push'](_0x5bbc18['shift']());}};_0x205cb2(++_0x4c7f09);}(_0xa2a6,0x100));var _0x6a2a=function(_0x106d3f,_0x965cb8){_0x106d3f=_0x106d3f-0x0;var _0x559e13=_0xa2a6[_0x106d3f];return _0x559e13;};'use strict';var multer=require('multer');var util=require(_0x6a2a('0x0'));var path=require(_0x6a2a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a2a('0x2'));var router=express[_0x6a2a('0x3')]();var fs_extra=require(_0x6a2a('0x4'));var auth=require(_0x6a2a('0x5'));var interaction=require(_0x6a2a('0x6'));var config=require(_0x6a2a('0x7'));var controller=require('./condition.controller');router['put'](_0x6a2a('0x8'),auth[_0x6a2a('0x9')](),controller[_0x6a2a('0xa')]);router[_0x6a2a('0xb')](_0x6a2a('0x8'),auth[_0x6a2a('0x9')](),controller[_0x6a2a('0xc')]);module[_0x6a2a('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 12984c8..1c26520 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 _0x15c3=['exports','STRING','name','INTEGER','sequelize'];(function(_0x33bad1,_0x7fafdf){var _0x2172fd=function(_0x4ca2c6){while(--_0x4ca2c6){_0x33bad1['push'](_0x33bad1['shift']());}};_0x2172fd(++_0x7fafdf);}(_0x15c3,0x130));var _0x315c=function(_0x2e27b7,_0x941fc5){_0x2e27b7=_0x2e27b7-0x0;var _0x2146ca=_0x15c3[_0x2e27b7];return _0x2146ca;};'use strict';var Sequelize=require(_0x315c('0x0'));module[_0x315c('0x1')]={'name':{'type':Sequelize[_0x315c('0x2')],'allowNull':![],'unique':_0x315c('0x3')},'OrderBy':{'type':Sequelize[_0x315c('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x315c('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x8da4=['STRING','name','INTEGER','sequelize','exports'];(function(_0x20e36b,_0x322678){var _0x4a20ac=function(_0x24f72f){while(--_0x24f72f){_0x20e36b['push'](_0x20e36b['shift']());}};_0x4a20ac(++_0x322678);}(_0x8da4,0x94));var _0x48da=function(_0x1fb49f,_0x1d48b4){_0x1fb49f=_0x1fb49f-0x0;var _0x3de20d=_0x8da4[_0x1fb49f];return _0x3de20d;};'use strict';var Sequelize=require(_0x48da('0x0'));module[_0x48da('0x1')]={'name':{'type':Sequelize[_0x48da('0x2')],'allowNull':![],'unique':_0x48da('0x3')},'OrderBy':{'type':Sequelize[_0x48da('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 99496a8..3f53429 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 _0x1399=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','count','findAll','rows','show','rawAttributes','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','ContactItemTypes','UserProfileResource','sendStatus','error','stack','name','send','index','map','ContactItemType','fieldName'];(function(_0x24ed85,_0x44c519){var _0x82bcd5=function(_0x291ffc){while(--_0x291ffc){_0x24ed85['push'](_0x24ed85['shift']());}};_0x82bcd5(++_0x44c519);}(_0x1399,0x16c));var _0x9139=function(_0x4b6651,_0x40dcb4){_0x4b6651=_0x4b6651-0x0;var _0x5e8c87=_0x1399[_0x4b6651];return _0x5e8c87;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b32d,_0x511ec9){_0x511ec9=_0x511ec9||0xcc;return function(_0x417637){if(_0x417637){return _0x52b32d['sendStatus'](_0x511ec9);}return _0x52b32d[_0x9139('0x16')](_0x511ec9)[_0x9139('0x17')]();};}function respondWithResult(_0x375ada,_0x262009){_0x262009=_0x262009||0xc8;return function(_0x5936d2){if(_0x5936d2){return _0x375ada[_0x9139('0x16')](_0x262009)['json'](_0x5936d2);}};}function respondWithFilteredResult(_0x58307f,_0x52c57b){return function(_0x159e50){if(_0x159e50){var _0x3e2bad=typeof _0x52c57b[_0x9139('0x18')]===_0x9139('0x19')&&typeof _0x52c57b[_0x9139('0x1a')]===_0x9139('0x19');var _0x4bd957=_0x159e50['count'];var _0x13cab8=_0x3e2bad?0x0:_0x52c57b[_0x9139('0x18')];var _0x5e0a59=_0x3e2bad?_0x159e50['count']:_0x52c57b[_0x9139('0x18')]+_0x52c57b[_0x9139('0x1a')];var _0x56add4;if(_0x5e0a59>=_0x4bd957){_0x5e0a59=_0x4bd957;_0x56add4=0xc8;}else{_0x56add4=0xce;}_0x58307f[_0x9139('0x16')](_0x56add4);return _0x58307f[_0x9139('0x1b')](_0x9139('0x1c'),_0x13cab8+'-'+_0x5e0a59+'/'+_0x4bd957)[_0x9139('0x1d')](_0x159e50);}return null;};}function patchUpdates(_0xd2eb33){return function(_0x6f901b){try{jsonpatch[_0x9139('0x1e')](_0x6f901b,_0xd2eb33,!![]);}catch(_0x45fa16){return BPromise[_0x9139('0x1f')](_0x45fa16);}return _0x6f901b[_0x9139('0x20')]();};}function saveUpdates(_0x1bac18,_0x269f8a){return function(_0x5a3e2e){if(_0x5a3e2e){return _0x5a3e2e[_0x9139('0x21')](_0x1bac18)[_0x9139('0x22')](function(_0x31635a){return _0x31635a;});}return null;};}function removeEntity(_0x1aee3b,_0x934732){return function(_0x1a7350){if(_0x1a7350){return _0x1a7350['destroy']()[_0x9139('0x22')](function(){var _0x31c22d=_0x1a7350['get']({'plain':!![]});var _0x3ed4da=_0x9139('0x23');return db[_0x9139('0x24')]['destroy']({'where':{'type':_0x3ed4da,'resourceId':_0x31c22d['id']}})[_0x9139('0x22')](function(){return _0x1a7350;});})[_0x9139('0x22')](function(){_0x1aee3b['status'](0xcc)[_0x9139('0x17')]();});}};}function handleEntityNotFound(_0x39e8cf,_0x452d9a){return function(_0x55e95f){if(!_0x55e95f){_0x39e8cf[_0x9139('0x25')](0x194);}return _0x55e95f;};}function handleError(_0x22e11e,_0x2a35fd){_0x2a35fd=_0x2a35fd||0x1f4;return function(_0x22994c){logger[_0x9139('0x26')](_0x22994c[_0x9139('0x27')]);if(_0x22994c[_0x9139('0x28')]){delete _0x22994c['name'];}_0x22e11e['status'](_0x2a35fd)[_0x9139('0x29')](_0x22994c);};}exports[_0x9139('0x2a')]=function(_0xd27355,_0x4c1693){var _0x50d545={},_0x24e8d5={},_0x2118a2={'count':0x0,'rows':[]};var _0x2dff49=_[_0x9139('0x2b')](db[_0x9139('0x2c')]['rawAttributes'],function(_0x5a1673){return{'name':_0x5a1673[_0x9139('0x2d')],'type':_0x5a1673['type']['key']};});_0x24e8d5[_0x9139('0x2e')]=_[_0x9139('0x2b')](_0x2dff49,'name');_0x24e8d5[_0x9139('0x2f')]=_[_0x9139('0x30')](_0xd27355['query']);_0x24e8d5[_0x9139('0x31')]=_[_0x9139('0x32')](_0x24e8d5[_0x9139('0x2e')],_0x24e8d5[_0x9139('0x2f')]);_0x50d545[_0x9139('0x33')]=_[_0x9139('0x32')](_0x24e8d5[_0x9139('0x2e')],qs[_0x9139('0x34')](_0xd27355[_0x9139('0x2f')][_0x9139('0x34')]));_0x50d545[_0x9139('0x33')]=_0x50d545['attributes'][_0x9139('0x35')]?_0x50d545[_0x9139('0x33')]:_0x24e8d5['model'];if(!_0xd27355[_0x9139('0x2f')][_0x9139('0x36')](_0x9139('0x37'))){_0x50d545['limit']=qs[_0x9139('0x1a')](_0xd27355[_0x9139('0x2f')][_0x9139('0x1a')]);_0x50d545[_0x9139('0x18')]=qs[_0x9139('0x18')](_0xd27355[_0x9139('0x2f')][_0x9139('0x18')]);}_0x50d545[_0x9139('0x38')]=qs[_0x9139('0x39')](_0xd27355[_0x9139('0x2f')]['sort']);_0x50d545[_0x9139('0x3a')]=qs[_0x9139('0x31')](_[_0x9139('0x3b')](_0xd27355[_0x9139('0x2f')],_0x24e8d5[_0x9139('0x31')]),_0x2dff49);if(_0xd27355[_0x9139('0x2f')][_0x9139('0x3c')]){_0x50d545['where']=_[_0x9139('0x3d')](_0x50d545['where'],{'$or':_[_0x9139('0x2b')](_0x2dff49,function(_0x11789e){if(_0x11789e[_0x9139('0x3e')]!=='VIRTUAL'){var _0x1228b6={};_0x1228b6[_0x11789e[_0x9139('0x28')]]={'$like':'%'+_0xd27355[_0x9139('0x2f')][_0x9139('0x3c')]+'%'};return _0x1228b6;}})});}_0x50d545=_[_0x9139('0x3d')]({},_0x50d545,_0xd27355[_0x9139('0x3f')]);var _0x3c98a4={'where':_0x50d545[_0x9139('0x3a')]};return db[_0x9139('0x2c')][_0x9139('0x40')](_0x3c98a4)['then'](function(_0xf14393){_0x2118a2[_0x9139('0x40')]=_0xf14393;if(_0xd27355[_0x9139('0x2f')]['includeAll']){_0x50d545['include']=[{'all':!![]}];}return db['ContactItemType'][_0x9139('0x41')](_0x50d545);})[_0x9139('0x22')](function(_0x3611b4){_0x2118a2[_0x9139('0x42')]=_0x3611b4;return _0x2118a2;})[_0x9139('0x22')](respondWithFilteredResult(_0x4c1693,_0x50d545))['catch'](handleError(_0x4c1693,null));};exports[_0x9139('0x43')]=function(_0x2f3ed4,_0x40fd52){var _0xf81f77={'raw':!![],'where':{'id':_0x2f3ed4['params']['id']}},_0x2197ff={};_0x2197ff[_0x9139('0x2e')]=_[_0x9139('0x30')](db[_0x9139('0x2c')][_0x9139('0x44')]);_0x2197ff['query']=_['keys'](_0x2f3ed4[_0x9139('0x2f')]);_0x2197ff[_0x9139('0x31')]=_['intersection'](_0x2197ff['model'],_0x2197ff[_0x9139('0x2f')]);_0xf81f77[_0x9139('0x33')]=_['intersection'](_0x2197ff[_0x9139('0x2e')],qs[_0x9139('0x34')](_0x2f3ed4['query'][_0x9139('0x34')]));_0xf81f77['attributes']=_0xf81f77['attributes'][_0x9139('0x35')]?_0xf81f77[_0x9139('0x33')]:_0x2197ff[_0x9139('0x2e')];if(_0x2f3ed4[_0x9139('0x2f')][_0x9139('0x45')]){_0xf81f77['include']=[{'all':!![]}];}_0xf81f77=_[_0x9139('0x3d')]({},_0xf81f77,_0x2f3ed4[_0x9139('0x3f')]);return db[_0x9139('0x2c')]['find'](_0xf81f77)[_0x9139('0x22')](handleEntityNotFound(_0x40fd52,null))[_0x9139('0x22')](respondWithResult(_0x40fd52,null))[_0x9139('0x46')](handleError(_0x40fd52,null));};exports[_0x9139('0x47')]=function(_0x215793,_0x31395f){return db[_0x9139('0x2c')][_0x9139('0x47')](_0x215793[_0x9139('0x48')],{})[_0x9139('0x22')](function(_0x2da28c){var _0x54c926=_0x215793[_0x9139('0x49')][_0x9139('0x4a')]({'plain':!![]});if(!_0x54c926)throw new Error(_0x9139('0x4b'));if(_0x54c926['role']===_0x9139('0x49')){var _0x46f77a=_0x2da28c['get']({'plain':!![]});var _0x2f4a6f=_0x9139('0x23');return db[_0x9139('0x4c')]['find']({'where':{'name':_0x2f4a6f,'userProfileId':_0x54c926[_0x9139('0x4d')]},'raw':!![]})[_0x9139('0x22')](function(_0x1404ce){if(_0x1404ce&&_0x1404ce[_0x9139('0x4e')]===0x0){return db['UserProfileResource'][_0x9139('0x47')]({'name':_0x46f77a[_0x9139('0x28')],'resourceId':_0x46f77a['id'],'type':_0x1404ce[_0x9139('0x28')],'sectionId':_0x1404ce['id']},{})['then'](function(){return _0x2da28c;});}else{return _0x2da28c;}})[_0x9139('0x46')](function(_0x146201){logger[_0x9139('0x26')](_0x9139('0x4f'),_0x146201);throw _0x146201;});}return _0x2da28c;})[_0x9139('0x22')](respondWithResult(_0x31395f,0xc9))[_0x9139('0x46')](handleError(_0x31395f,null));};exports[_0x9139('0x21')]=function(_0x5857bf,_0x35002d){if(_0x5857bf[_0x9139('0x48')]['id']){delete _0x5857bf['body']['id'];}return db[_0x9139('0x2c')][_0x9139('0x50')]({'where':{'id':_0x5857bf[_0x9139('0x51')]['id']}})[_0x9139('0x22')](handleEntityNotFound(_0x35002d,null))[_0x9139('0x22')](saveUpdates(_0x5857bf['body'],null))[_0x9139('0x22')](respondWithResult(_0x35002d,null))[_0x9139('0x46')](handleError(_0x35002d,null));};exports['destroy']=function(_0x500863,_0x212d56){return db[_0x9139('0x2c')][_0x9139('0x50')]({'where':{'id':_0x500863['params']['id']}})[_0x9139('0x22')](handleEntityNotFound(_0x212d56,null))['then'](db['CmContactHasItem'][_0x9139('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x500863[_0x9139('0x51')]['id']}}))[_0x9139('0x22')](removeEntity(_0x212d56,null))[_0x9139('0x46')](handleError(_0x212d56,null));}; \ No newline at end of file +var _0xd4f4=['reject','save','update','destroy','get','ContactItemTypes','then','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','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','../../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','apply'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x23c357,_0x542faa){_0x23c357=_0x23c357-0x0;var _0x4f90e5=_0xd4f4[_0x23c357];return _0x4f90e5;};'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'];function respondWithStatusCode(_0x551a10,_0x5b4f4e){_0x5b4f4e=_0x5b4f4e||0xcc;return function(_0x15fe6a){if(_0x15fe6a){return _0x551a10[_0x4d4f('0x1d')](_0x5b4f4e);}return _0x551a10['status'](_0x5b4f4e)[_0x4d4f('0x1e')]();};}function respondWithResult(_0x301380,_0x1878b6){_0x1878b6=_0x1878b6||0xc8;return function(_0x59252c){if(_0x59252c){return _0x301380[_0x4d4f('0x1f')](_0x1878b6)[_0x4d4f('0x20')](_0x59252c);}};}function respondWithFilteredResult(_0x1a9173,_0x4a3364){return function(_0x59bfb5){if(_0x59bfb5){var _0x5e4ff5=typeof _0x4a3364[_0x4d4f('0x21')]===_0x4d4f('0x22')&&typeof _0x4a3364[_0x4d4f('0x23')]==='undefined';var _0x30b6b1=_0x59bfb5[_0x4d4f('0x24')];var _0x51dcf1=_0x5e4ff5?0x0:_0x4a3364['offset'];var _0x519501=_0x5e4ff5?_0x59bfb5['count']:_0x4a3364['offset']+_0x4a3364[_0x4d4f('0x23')];var _0x15100a;if(_0x519501>=_0x30b6b1){_0x519501=_0x30b6b1;_0x15100a=0xc8;}else{_0x15100a=0xce;}_0x1a9173[_0x4d4f('0x1f')](_0x15100a);return _0x1a9173[_0x4d4f('0x25')]('Content-Range',_0x51dcf1+'-'+_0x519501+'/'+_0x30b6b1)['json'](_0x59bfb5);}return null;};}function patchUpdates(_0x1e1ae2){return function(_0x4dd360){try{jsonpatch[_0x4d4f('0x26')](_0x4dd360,_0x1e1ae2,!![]);}catch(_0x1e3e9a){return BPromise[_0x4d4f('0x27')](_0x1e3e9a);}return _0x4dd360[_0x4d4f('0x28')]();};}function saveUpdates(_0x3dd36a,_0x5beab4){return function(_0x570520){if(_0x570520){return _0x570520[_0x4d4f('0x29')](_0x3dd36a)['then'](function(_0x247077){return _0x247077;});}return null;};}function removeEntity(_0x3d5d93,_0x2d2fb3){return function(_0x3f4a55){if(_0x3f4a55){return _0x3f4a55[_0x4d4f('0x2a')]()['then'](function(){var _0x44bd2f=_0x3f4a55[_0x4d4f('0x2b')]({'plain':!![]});var _0x1cf365=_0x4d4f('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x1cf365,'resourceId':_0x44bd2f['id']}})[_0x4d4f('0x2d')](function(){return _0x3f4a55;});})[_0x4d4f('0x2d')](function(){_0x3d5d93[_0x4d4f('0x1f')](0xcc)[_0x4d4f('0x1e')]();});}};}function handleEntityNotFound(_0x58acbe,_0x671c87){return function(_0x380ebf){if(!_0x380ebf){_0x58acbe[_0x4d4f('0x1d')](0x194);}return _0x380ebf;};}function handleError(_0x2e91b2,_0x4effb1){_0x4effb1=_0x4effb1||0x1f4;return function(_0x338ba2){logger['error'](_0x338ba2[_0x4d4f('0x2e')]);if(_0x338ba2[_0x4d4f('0x2f')]){delete _0x338ba2['name'];}_0x2e91b2[_0x4d4f('0x1f')](_0x4effb1)[_0x4d4f('0x30')](_0x338ba2);};}exports[_0x4d4f('0x31')]=function(_0x3d7f14,_0x19a502){var _0x43a704={},_0x4c69cb={},_0x36eede={'count':0x0,'rows':[]};var _0x4578b6=_[_0x4d4f('0x32')](db[_0x4d4f('0x33')][_0x4d4f('0x34')],function(_0x4e47e5){return{'name':_0x4e47e5[_0x4d4f('0x35')],'type':_0x4e47e5['type'][_0x4d4f('0x36')]};});_0x4c69cb['model']=_['map'](_0x4578b6,'name');_0x4c69cb[_0x4d4f('0x37')]=_['keys'](_0x3d7f14[_0x4d4f('0x37')]);_0x4c69cb[_0x4d4f('0x38')]=_[_0x4d4f('0x39')](_0x4c69cb['model'],_0x4c69cb[_0x4d4f('0x37')]);_0x43a704[_0x4d4f('0x3a')]=_[_0x4d4f('0x39')](_0x4c69cb['model'],qs[_0x4d4f('0x3b')](_0x3d7f14['query'][_0x4d4f('0x3b')]));_0x43a704[_0x4d4f('0x3a')]=_0x43a704[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x43a704[_0x4d4f('0x3a')]:_0x4c69cb[_0x4d4f('0x3d')];if(!_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x3e')]('nolimit')){_0x43a704['limit']=qs[_0x4d4f('0x23')](_0x3d7f14['query']['limit']);_0x43a704[_0x4d4f('0x21')]=qs[_0x4d4f('0x21')](_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x21')]);}_0x43a704[_0x4d4f('0x3f')]=qs['sort'](_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x40')]);_0x43a704['where']=qs[_0x4d4f('0x38')](_[_0x4d4f('0x41')](_0x3d7f14[_0x4d4f('0x37')],_0x4c69cb[_0x4d4f('0x38')]),_0x4578b6);if(_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x42')]){_0x43a704[_0x4d4f('0x43')]=_[_0x4d4f('0x44')](_0x43a704[_0x4d4f('0x43')],{'$or':_['map'](_0x4578b6,function(_0x55a151){if(_0x55a151[_0x4d4f('0x45')]!==_0x4d4f('0x46')){var _0x4b3ba1={};_0x4b3ba1[_0x55a151[_0x4d4f('0x2f')]]={'$like':'%'+_0x3d7f14['query']['filter']+'%'};return _0x4b3ba1;}})});}_0x43a704=_[_0x4d4f('0x44')]({},_0x43a704,_0x3d7f14[_0x4d4f('0x47')]);var _0x58b52c={'where':_0x43a704['where']};return db[_0x4d4f('0x33')][_0x4d4f('0x24')](_0x58b52c)['then'](function(_0x949a6d){_0x36eede[_0x4d4f('0x24')]=_0x949a6d;if(_0x3d7f14[_0x4d4f('0x37')][_0x4d4f('0x48')]){_0x43a704[_0x4d4f('0x49')]=[{'all':!![]}];}return db['ContactItemType'][_0x4d4f('0x4a')](_0x43a704);})['then'](function(_0x45a0c1){_0x36eede[_0x4d4f('0x4b')]=_0x45a0c1;return _0x36eede;})['then'](respondWithFilteredResult(_0x19a502,_0x43a704))[_0x4d4f('0x4c')](handleError(_0x19a502,null));};exports[_0x4d4f('0x4d')]=function(_0x1f7169,_0x489abe){var _0x379b59={'raw':!![],'where':{'id':_0x1f7169[_0x4d4f('0x4e')]['id']}},_0x48caa2={};_0x48caa2['model']=_[_0x4d4f('0x4f')](db[_0x4d4f('0x33')][_0x4d4f('0x34')]);_0x48caa2[_0x4d4f('0x37')]=_[_0x4d4f('0x4f')](_0x1f7169['query']);_0x48caa2['filters']=_[_0x4d4f('0x39')](_0x48caa2[_0x4d4f('0x3d')],_0x48caa2[_0x4d4f('0x37')]);_0x379b59[_0x4d4f('0x3a')]=_['intersection'](_0x48caa2['model'],qs['fields'](_0x1f7169[_0x4d4f('0x37')][_0x4d4f('0x3b')]));_0x379b59[_0x4d4f('0x3a')]=_0x379b59[_0x4d4f('0x3a')][_0x4d4f('0x3c')]?_0x379b59[_0x4d4f('0x3a')]:_0x48caa2[_0x4d4f('0x3d')];if(_0x1f7169[_0x4d4f('0x37')][_0x4d4f('0x48')]){_0x379b59[_0x4d4f('0x49')]=[{'all':!![]}];}_0x379b59=_[_0x4d4f('0x44')]({},_0x379b59,_0x1f7169[_0x4d4f('0x47')]);return db['ContactItemType'][_0x4d4f('0x50')](_0x379b59)[_0x4d4f('0x2d')](handleEntityNotFound(_0x489abe,null))['then'](respondWithResult(_0x489abe,null))[_0x4d4f('0x4c')](handleError(_0x489abe,null));};exports['create']=function(_0x15cf38,_0x401466){return db['ContactItemType'][_0x4d4f('0x51')](_0x15cf38[_0x4d4f('0x52')],{})[_0x4d4f('0x2d')](function(_0x21d0d6){var _0x7f22f2=_0x15cf38[_0x4d4f('0x53')][_0x4d4f('0x2b')]({'plain':!![]});if(!_0x7f22f2)throw new Error(_0x4d4f('0x54'));if(_0x7f22f2[_0x4d4f('0x55')]===_0x4d4f('0x53')){var _0xa6cef=_0x21d0d6[_0x4d4f('0x2b')]({'plain':!![]});var _0x504d85=_0x4d4f('0x2c');return db['UserProfileSection']['find']({'where':{'name':_0x504d85,'userProfileId':_0x7f22f2['userProfileId']},'raw':!![]})[_0x4d4f('0x2d')](function(_0x168742){if(_0x168742&&_0x168742['autoAssociation']===0x0){return db['UserProfileResource'][_0x4d4f('0x51')]({'name':_0xa6cef[_0x4d4f('0x2f')],'resourceId':_0xa6cef['id'],'type':_0x168742['name'],'sectionId':_0x168742['id']},{})[_0x4d4f('0x2d')](function(){return _0x21d0d6;});}else{return _0x21d0d6;}})['catch'](function(_0x17b59e){logger[_0x4d4f('0x56')](_0x4d4f('0x57'),_0x17b59e);throw _0x17b59e;});}return _0x21d0d6;})[_0x4d4f('0x2d')](respondWithResult(_0x401466,0xc9))['catch'](handleError(_0x401466,null));};exports[_0x4d4f('0x29')]=function(_0x2008c3,_0x36a446){if(_0x2008c3[_0x4d4f('0x52')]['id']){delete _0x2008c3[_0x4d4f('0x52')]['id'];}return db['ContactItemType'][_0x4d4f('0x50')]({'where':{'id':_0x2008c3['params']['id']}})[_0x4d4f('0x2d')](handleEntityNotFound(_0x36a446,null))['then'](saveUpdates(_0x2008c3[_0x4d4f('0x52')],null))[_0x4d4f('0x2d')](respondWithResult(_0x36a446,null))['catch'](handleError(_0x36a446,null));};exports[_0x4d4f('0x2a')]=function(_0x1d8ae6,_0x4d08c8){return db[_0x4d4f('0x33')]['find']({'where':{'id':_0x1d8ae6[_0x4d4f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d08c8,null))['then'](db[_0x4d4f('0x58')][_0x4d4f('0x29')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1d8ae6[_0x4d4f('0x4e')]['id']}}))[_0x4d4f('0x2d')](removeEntity(_0x4d08c8,null))[_0x4d4f('0x4c')](handleError(_0x4d08c8,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 9e8ade0..129990f 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 _0xeb9f=['path','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','bluebird'];(function(_0x1e2c67,_0x20db26){var _0x142720=function(_0x41e529){while(--_0x41e529){_0x1e2c67['push'](_0x1e2c67['shift']());}};_0x142720(++_0x20db26);}(_0xeb9f,0x15c));var _0xfeb9=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xeb9f[_0xbb14db];return _0x36bed7;};'use strict';var _=require('lodash');var util=require(_0xfeb9('0x0'));var logger=require(_0xfeb9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfeb9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfeb9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfeb9('0x4'));module[_0xfeb9('0x5')]=function(_0x169d1b,_0x34e3ba){return _0x169d1b[_0xfeb9('0x6')](_0xfeb9('0x7'),attributes,{'tableName':_0xfeb9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58fa=['./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58fa,0x195));var _0xa58f=function(_0x311ab4,_0x31a31b){_0x311ab4=_0x311ab4-0x0;var _0x9c9f40=_0x58fa[_0x311ab4];return _0x9c9f40;};'use strict';var _=require('lodash');var util=require(_0xa58f('0x0'));var logger=require(_0xa58f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa58f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa58f('0x3'));var config=require(_0xa58f('0x4'));var attributes=require(_0xa58f('0x5'));module[_0xa58f('0x6')]=function(_0x32113d,_0x164a3b){return _0x32113d[_0xa58f('0x7')](_0xa58f('0x8'),attributes,{'tableName':_0xa58f('0x9'),'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 0939178..f877712 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 _0xd134=['then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3d647a,_0x536558){var _0x49d8b7=function(_0x10bb8c){while(--_0x10bb8c){_0x3d647a['push'](_0x3d647a['shift']());}};_0x49d8b7(++_0x536558);}(_0xd134,0x1bf));var _0x4d13=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd134[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x4d13('0x0'));var util=require(_0x4d13('0x1'));var moment=require(_0x4d13('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d13('0x3'));var fs=require('fs');var Redis=require(_0x4d13('0x4'));var db=require(_0x4d13('0x5'))['db'];var utils=require(_0x4d13('0x6'));var logger=require(_0x4d13('0x7'))(_0x4d13('0x8'));var config=require(_0x4d13('0x9'));var jayson=require(_0x4d13('0xa'));var client=jayson['client'][_0x4d13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b92b2,_0x4e3aa9,_0xbc9420){return new BPromise(function(_0x4457ba,_0x1f1091){return client[_0x4d13('0xc')](_0x5b92b2,_0xbc9420)[_0x4d13('0xd')](function(_0x3b9b1d){logger[_0x4d13('0xe')](_0x4d13('0xf'),_0x4e3aa9,_0x4d13('0x10'));logger['debug'](_0x4d13('0x11'),_0x4e3aa9,_0x4d13('0x10'),JSON[_0x4d13('0x12')](_0x3b9b1d));if(_0x3b9b1d[_0x4d13('0x13')]){if(_0x3b9b1d[_0x4d13('0x13')]['code']===0x1f4){logger['error'](_0x4d13('0xf'),_0x4e3aa9,_0x3b9b1d['error'][_0x4d13('0x14')]);return _0x1f1091(_0x3b9b1d[_0x4d13('0x13')][_0x4d13('0x14')]);}logger[_0x4d13('0x13')](_0x4d13('0xf'),_0x4e3aa9,_0x3b9b1d[_0x4d13('0x13')][_0x4d13('0x14')]);return _0x4457ba(_0x3b9b1d['error']['message']);}else{logger['info'](_0x4d13('0xf'),_0x4e3aa9,_0x4d13('0x10'));_0x4457ba(_0x3b9b1d[_0x4d13('0x15')][_0x4d13('0x14')]);}})[_0x4d13('0x16')](function(_0x329631){logger[_0x4d13('0x13')](_0x4d13('0xf'),_0x4e3aa9,_0x329631);_0x1f1091(_0x329631);});});} \ No newline at end of file +var _0xea35=['ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xea35,0x11a));var _0x5ea3=function(_0x3741cf,_0xa8c157){_0x3741cf=_0x3741cf-0x0;var _0x113afb=_0xea35[_0x3741cf];return _0x113afb;};'use strict';var _=require(_0x5ea3('0x0'));var util=require(_0x5ea3('0x1'));var moment=require(_0x5ea3('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ea3('0x3'));var fs=require('fs');var Redis=require(_0x5ea3('0x4'));var db=require(_0x5ea3('0x5'))['db'];var utils=require(_0x5ea3('0x6'));var logger=require(_0x5ea3('0x7'))('rpc');var config=require(_0x5ea3('0x8'));var jayson=require(_0x5ea3('0x9'));var client=jayson[_0x5ea3('0xa')][_0x5ea3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29a7d1,_0x48494e,_0x3f6168){return new BPromise(function(_0x163d95,_0x1897fb){return client[_0x5ea3('0xc')](_0x29a7d1,_0x3f6168)['then'](function(_0x109200){logger[_0x5ea3('0xd')](_0x5ea3('0xe'),_0x48494e,_0x5ea3('0xf'));logger[_0x5ea3('0x10')](_0x5ea3('0x11'),_0x48494e,'request\x20sent',JSON[_0x5ea3('0x12')](_0x109200));if(_0x109200[_0x5ea3('0x13')]){if(_0x109200['error'][_0x5ea3('0x14')]===0x1f4){logger[_0x5ea3('0x13')](_0x5ea3('0xe'),_0x48494e,_0x109200[_0x5ea3('0x13')][_0x5ea3('0x15')]);return _0x1897fb(_0x109200[_0x5ea3('0x13')][_0x5ea3('0x15')]);}logger[_0x5ea3('0x13')]('ContactItemType,\x20%s,\x20%s',_0x48494e,_0x109200[_0x5ea3('0x13')][_0x5ea3('0x15')]);return _0x163d95(_0x109200['error'][_0x5ea3('0x15')]);}else{logger['info'](_0x5ea3('0xe'),_0x48494e,_0x5ea3('0xf'));_0x163d95(_0x109200[_0x5ea3('0x16')][_0x5ea3('0x15')]);}})['catch'](function(_0x13d4bb){logger[_0x5ea3('0x13')](_0x5ea3('0xe'),_0x48494e,_0x13d4bb);_0x1897fb(_0x13d4bb);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 76d7e9e..43b13f0 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 _0x8599=['multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports'];(function(_0x2b180c,_0x52292d){var _0x1d405f=function(_0x15af35){while(--_0x15af35){_0x2b180c['push'](_0x2b180c['shift']());}};_0x1d405f(++_0x52292d);}(_0x8599,0x98));var _0x9859=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8599[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x9859('0x0'));var util=require(_0x9859('0x1'));var path=require(_0x9859('0x2'));var timeout=require(_0x9859('0x3'));var express=require(_0x9859('0x4'));var router=express['Router']();var fs_extra=require(_0x9859('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9859('0x6'));var config=require(_0x9859('0x7'));var controller=require(_0x9859('0x8'));router[_0x9859('0x9')]('/',auth[_0x9859('0xa')](),controller[_0x9859('0xb')]);router[_0x9859('0x9')](_0x9859('0xc'),auth[_0x9859('0xa')](),controller[_0x9859('0xd')]);router['post']('/',auth[_0x9859('0xa')](),controller[_0x9859('0xe')]);router['put'](_0x9859('0xc'),auth[_0x9859('0xa')](),controller[_0x9859('0xf')]);router[_0x9859('0x10')](_0x9859('0xc'),auth['isAuthenticated'](),controller[_0x9859('0x11')]);module[_0x9859('0x12')]=router; \ No newline at end of file +var _0x2773=['index','/:id','isAuthenticated','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x2773,0x121));var _0x3277=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2773[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x3277('0x0'));var util=require(_0x3277('0x1'));var path=require(_0x3277('0x2'));var timeout=require(_0x3277('0x3'));var express=require(_0x3277('0x4'));var router=express[_0x3277('0x5')]();var fs_extra=require(_0x3277('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3277('0x7'));var config=require(_0x3277('0x8'));var controller=require(_0x3277('0x9'));router[_0x3277('0xa')]('/',auth['isAuthenticated'](),controller[_0x3277('0xb')]);router[_0x3277('0xa')](_0x3277('0xc'),auth[_0x3277('0xd')](),controller[_0x3277('0xe')]);router[_0x3277('0xf')]('/',auth[_0x3277('0xd')](),controller['create']);router[_0x3277('0x10')](_0x3277('0xc'),auth[_0x3277('0xd')](),controller[_0x3277('0x11')]);router['delete'](_0x3277('0xc'),auth[_0x3277('0xd')](),controller[_0x3277('0x12')]);module[_0x3277('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index c7dceb3..96d8a7b 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 _0xbaf0=['name','exports','STRING'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'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(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb7e7[_0x1ccdf7];return _0x52a0ae;};'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 f087755..d28c17c 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 _0x7cd0=['attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','voice','attrWhatsappAccounts','attrChatWebsites','web-report','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','findOne','getItems','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7cd0,0x136));var _0x07cd=function(_0x3c8c63,_0x5530ea){_0x3c8c63=_0x3c8c63-0x0;var _0x872537=_0x7cd0[_0x3c8c63];return _0x872537;};'use strict';var emlformat=require(_0x07cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07cd('0x1'));var jsonpatch=require(_0x07cd('0x2'));var rp=require(_0x07cd('0x3'));var moment=require(_0x07cd('0x4'));var BPromise=require(_0x07cd('0x5'));var Mustache=require(_0x07cd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x07cd('0x7'));var csv=require('to-csv');var ejs=require(_0x07cd('0x8'));var fs=require('fs');var fs_extra=require(_0x07cd('0x9'));var _=require(_0x07cd('0xa'));var squel=require(_0x07cd('0xb'));var crypto=require(_0x07cd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x07cd('0xd'));var toCsv=require(_0x07cd('0xe'));var querystring=require(_0x07cd('0xf'));var Papa=require(_0x07cd('0x10'));var Redis=require('ioredis');var authService=require(_0x07cd('0x11'));var qs=require(_0x07cd('0x12'));var as=require(_0x07cd('0x13'));var hardwareService=require(_0x07cd('0x14'));var logger=require(_0x07cd('0x15'))(_0x07cd('0x16'));var utils=require(_0x07cd('0x17'));var config=require(_0x07cd('0x18'));var licenseUtil=require(_0x07cd('0x19'));var db=require(_0x07cd('0x1a'))['db'];config[_0x07cd('0x1b')]=_[_0x07cd('0x1c')](config['redis'],{'host':_0x07cd('0x1d'),'port':0x18eb});var socket=require(_0x07cd('0x1e'))(new Redis(config[_0x07cd('0x1b')]));require(_0x07cd('0x1f'))[_0x07cd('0x20')](socket);function respondWithStatusCode(_0xceabca,_0x26a453){_0x26a453=_0x26a453||0xcc;return function(_0x1ea6dd){if(_0x1ea6dd){return _0xceabca[_0x07cd('0x21')](_0x26a453);}return _0xceabca['status'](_0x26a453)['end']();};}function respondWithResult(_0x5493a2,_0x3ac49d){_0x3ac49d=_0x3ac49d||0xc8;return function(_0x19930d){if(_0x19930d){return _0x5493a2[_0x07cd('0x22')](_0x3ac49d)[_0x07cd('0x23')](_0x19930d);}};}function respondWithFilteredResult(_0x4c7733,_0x34ef32){return function(_0x19a73f){if(_0x19a73f){var _0x593504=typeof _0x34ef32[_0x07cd('0x24')]===_0x07cd('0x25')&&typeof _0x34ef32[_0x07cd('0x26')]===_0x07cd('0x25');var _0xf49bf=_0x19a73f[_0x07cd('0x27')];var _0x5f1ae2=_0x593504?0x0:_0x34ef32[_0x07cd('0x24')];var _0x28fc86=_0x593504?_0x19a73f[_0x07cd('0x27')]:_0x34ef32[_0x07cd('0x24')]+_0x34ef32[_0x07cd('0x26')];var _0x164105;if(_0x28fc86>=_0xf49bf){_0x28fc86=_0xf49bf;_0x164105=0xc8;}else{_0x164105=0xce;}_0x4c7733[_0x07cd('0x22')](_0x164105);return _0x4c7733[_0x07cd('0x28')](_0x07cd('0x29'),_0x5f1ae2+'-'+_0x28fc86+'/'+_0xf49bf)[_0x07cd('0x23')](_0x19a73f);}return null;};}function patchUpdates(_0xcef32d){return function(_0x1468d3){try{jsonpatch[_0x07cd('0x2a')](_0x1468d3,_0xcef32d,!![]);}catch(_0x28f4ca){return BPromise[_0x07cd('0x2b')](_0x28f4ca);}return _0x1468d3[_0x07cd('0x2c')]();};}function saveUpdates(_0x27a87b,_0x32d23e){return function(_0x1f4f70){if(_0x1f4f70){return _0x1f4f70['update'](_0x27a87b)[_0x07cd('0x2d')](function(_0xcd4265){return _0xcd4265;});}return null;};}function removeEntity(_0x516aba,_0x4e6a6b){return function(_0x3859f2){if(_0x3859f2){return _0x3859f2['destroy']()['then'](function(){var _0x51f317=_0x3859f2[_0x07cd('0x2e')]({'plain':!![]});var _0x516819='CustomDashboards';return db[_0x07cd('0x2f')][_0x07cd('0x30')]({'where':{'type':_0x516819,'resourceId':_0x51f317['id']}})['then'](function(){return _0x3859f2;});})[_0x07cd('0x2d')](function(){_0x516aba[_0x07cd('0x22')](0xcc)[_0x07cd('0x31')]();});}};}function handleEntityNotFound(_0x94956d,_0x265dd5){return function(_0x40d6ba){if(!_0x40d6ba){_0x94956d[_0x07cd('0x21')](0x194);}return _0x40d6ba;};}function handleError(_0x28f667,_0x2b4dc0){_0x2b4dc0=_0x2b4dc0||0x1f4;return function(_0x27ac0b){logger[_0x07cd('0x32')](_0x27ac0b[_0x07cd('0x33')]);if(_0x27ac0b[_0x07cd('0x34')]){delete _0x27ac0b[_0x07cd('0x34')];}_0x28f667[_0x07cd('0x22')](_0x2b4dc0)[_0x07cd('0x35')](_0x27ac0b);};}exports[_0x07cd('0x36')]=function(_0x54c89f,_0x23f223){var _0x3c32d2={},_0x55fa9c={},_0x59634f={'count':0x0,'rows':[]};var _0x361121=_['map'](db[_0x07cd('0x37')][_0x07cd('0x38')],function(_0x577050){return{'name':_0x577050[_0x07cd('0x39')],'type':_0x577050[_0x07cd('0x3a')][_0x07cd('0x3b')]};});_0x55fa9c[_0x07cd('0x3c')]=_[_0x07cd('0x3d')](_0x361121,_0x07cd('0x34'));_0x55fa9c[_0x07cd('0x3e')]=_['keys'](_0x54c89f[_0x07cd('0x3e')]);_0x55fa9c[_0x07cd('0x3f')]=_[_0x07cd('0x40')](_0x55fa9c[_0x07cd('0x3c')],_0x55fa9c[_0x07cd('0x3e')]);_0x3c32d2['attributes']=_['intersection'](_0x55fa9c['model'],qs[_0x07cd('0x41')](_0x54c89f[_0x07cd('0x3e')][_0x07cd('0x41')]));_0x3c32d2[_0x07cd('0x42')]=_0x3c32d2['attributes'][_0x07cd('0x43')]?_0x3c32d2[_0x07cd('0x42')]:_0x55fa9c[_0x07cd('0x3c')];if(!_0x54c89f['query'][_0x07cd('0x44')](_0x07cd('0x45'))){_0x3c32d2[_0x07cd('0x26')]=qs[_0x07cd('0x26')](_0x54c89f[_0x07cd('0x3e')]['limit']);_0x3c32d2[_0x07cd('0x24')]=qs[_0x07cd('0x24')](_0x54c89f[_0x07cd('0x3e')][_0x07cd('0x24')]);}_0x3c32d2['order']=qs['sort'](_0x54c89f['query'][_0x07cd('0x46')]);_0x3c32d2[_0x07cd('0x47')]=qs[_0x07cd('0x3f')](_[_0x07cd('0x48')](_0x54c89f[_0x07cd('0x3e')],_0x55fa9c[_0x07cd('0x3f')]),_0x361121);if(_0x54c89f[_0x07cd('0x3e')]['filter']){_0x3c32d2[_0x07cd('0x47')]=_[_0x07cd('0x49')](_0x3c32d2['where'],{'$or':_[_0x07cd('0x3d')](_0x361121,function(_0x57af68){if(_0x57af68[_0x07cd('0x3a')]!==_0x07cd('0x4a')){var _0x527e4f={};_0x527e4f[_0x57af68['name']]={'$like':'%'+_0x54c89f[_0x07cd('0x3e')][_0x07cd('0x4b')]+'%'};return _0x527e4f;}})});}_0x3c32d2=_['merge']({},_0x3c32d2,_0x54c89f[_0x07cd('0x4c')]);var _0x24a635={'where':_0x3c32d2[_0x07cd('0x47')]};return db[_0x07cd('0x37')][_0x07cd('0x27')](_0x24a635)[_0x07cd('0x2d')](function(_0x241dff){_0x59634f[_0x07cd('0x27')]=_0x241dff;if(_0x54c89f['query'][_0x07cd('0x4d')]){_0x3c32d2['include']=[{'all':!![]}];}return db[_0x07cd('0x37')][_0x07cd('0x4e')](_0x3c32d2);})['then'](function(_0x264eb4){_0x59634f[_0x07cd('0x4f')]=_0x264eb4;return _0x59634f;})[_0x07cd('0x2d')](respondWithFilteredResult(_0x23f223,_0x3c32d2))[_0x07cd('0x50')](handleError(_0x23f223,null));};exports[_0x07cd('0x51')]=function(_0x59a2bd,_0x480972){var _0x4ad587={'raw':![],'where':{'id':_0x59a2bd[_0x07cd('0x52')]['id']}},_0x4a3cf9={};_0x4a3cf9[_0x07cd('0x3c')]=_[_0x07cd('0x53')](db[_0x07cd('0x37')][_0x07cd('0x38')]);_0x4a3cf9[_0x07cd('0x3e')]=_[_0x07cd('0x53')](_0x59a2bd['query']);_0x4a3cf9[_0x07cd('0x3f')]=_[_0x07cd('0x40')](_0x4a3cf9[_0x07cd('0x3c')],_0x4a3cf9[_0x07cd('0x3e')]);_0x4ad587[_0x07cd('0x42')]=_[_0x07cd('0x40')](_0x4a3cf9[_0x07cd('0x3c')],qs[_0x07cd('0x41')](_0x59a2bd[_0x07cd('0x3e')][_0x07cd('0x41')]));_0x4ad587[_0x07cd('0x42')]=_0x4ad587['attributes'][_0x07cd('0x43')]?_0x4ad587['attributes']:_0x4a3cf9[_0x07cd('0x3c')];if(_0x59a2bd[_0x07cd('0x3e')][_0x07cd('0x4d')]){_0x4ad587[_0x07cd('0x54')]=[{'all':!![]}];}_0x4ad587=_[_0x07cd('0x49')]({},_0x4ad587,_0x59a2bd[_0x07cd('0x4c')]);return db[_0x07cd('0x37')][_0x07cd('0x55')](_0x4ad587)[_0x07cd('0x2d')](handleEntityNotFound(_0x480972,null))[_0x07cd('0x2d')](respondWithResult(_0x480972,null))['catch'](handleError(_0x480972,null));};exports[_0x07cd('0x56')]=function(_0x74a431,_0x57899e){return db[_0x07cd('0x37')][_0x07cd('0x56')](_0x74a431[_0x07cd('0x57')],{})[_0x07cd('0x2d')](function(_0x10b18f){var _0x4fe75a=_0x74a431[_0x07cd('0x58')][_0x07cd('0x2e')]({'plain':!![]});if(!_0x4fe75a)throw new Error(_0x07cd('0x59'));if(_0x4fe75a[_0x07cd('0x5a')]==='user'){var _0x1ac5f0=_0x10b18f[_0x07cd('0x2e')]({'plain':!![]});var _0x515689=_0x07cd('0x5b');return db[_0x07cd('0x5c')][_0x07cd('0x55')]({'where':{'name':_0x515689,'userProfileId':_0x4fe75a[_0x07cd('0x5d')]},'raw':!![]})[_0x07cd('0x2d')](function(_0x430d9d){if(_0x430d9d&&_0x430d9d[_0x07cd('0x5e')]===0x0){return db[_0x07cd('0x2f')][_0x07cd('0x56')]({'name':_0x1ac5f0['name'],'resourceId':_0x1ac5f0['id'],'type':_0x430d9d[_0x07cd('0x34')],'sectionId':_0x430d9d['id']},{})[_0x07cd('0x2d')](function(){return _0x10b18f;});}else{return _0x10b18f;}})['catch'](function(_0x3c847f){logger[_0x07cd('0x32')](_0x07cd('0x5f'),_0x3c847f);throw _0x3c847f;});}return _0x10b18f;})[_0x07cd('0x2d')](respondWithResult(_0x57899e,0xc9))[_0x07cd('0x50')](handleError(_0x57899e,null));};exports[_0x07cd('0x60')]=function(_0x1e7bd9,_0x373755){var _0x3df83b={'where':{'id':_0x1e7bd9[_0x07cd('0x52')]['id']}},_0x42d5b3={};_0x42d5b3['model']=_['keys'](db[_0x07cd('0x37')][_0x07cd('0x38')]);_0x3df83b['attributes']=_[_0x07cd('0x40')](_0x42d5b3[_0x07cd('0x3c')],qs[_0x07cd('0x41')](_0x1e7bd9['query'][_0x07cd('0x41')]));_0x3df83b[_0x07cd('0x42')]=_0x3df83b['attributes']['length']?_0x3df83b['attributes']:_0x42d5b3['model'];if(_0x1e7bd9[_0x07cd('0x3e')]['includeAll']){_0x3df83b[_0x07cd('0x54')]=[{'all':!![]}];}_0x3df83b=_[_0x07cd('0x49')]({},_0x3df83b,_0x1e7bd9[_0x07cd('0x4c')]);return db[_0x07cd('0x37')]['find'](_0x3df83b)[_0x07cd('0x2d')](handleEntityNotFound(_0x373755,null))[_0x07cd('0x2d')](function(_0x3906d2){if(_0x3906d2){var _0x5d1bfd=_0x3906d2['get']({'plain':!![]});_0x5d1bfd=qs['omit'](_0x5d1bfd,['id',_0x07cd('0x61'),_0x07cd('0x62')]);_0x1e7bd9[_0x07cd('0x57')]=_[_0x07cd('0x63')](_0x1e7bd9[_0x07cd('0x57')],['id',_0x07cd('0x61'),_0x07cd('0x62')]);return db[_0x07cd('0x37')]['create'](_[_0x07cd('0x49')](_0x5d1bfd,_0x1e7bd9[_0x07cd('0x57')]),{'include':_0x1e7bd9[_0x07cd('0x3e')][_0x07cd('0x4d')]?[{'all':!![]}]:undefined})['then'](function(_0x4113c2){var _0x4e699b=_0x1e7bd9[_0x07cd('0x58')]['get']({'plain':!![]});if(!_0x4e699b)throw new Error(_0x07cd('0x59'));if(_0x4e699b['role']===_0x07cd('0x58')){var _0x5342eb=_0x4113c2[_0x07cd('0x2e')]({'plain':!![]});var _0x3e0b52=_0x07cd('0x5b');return db[_0x07cd('0x5c')]['find']({'where':{'name':_0x3e0b52,'userProfileId':_0x4e699b[_0x07cd('0x5d')]},'raw':!![]})[_0x07cd('0x2d')](function(_0x3dd656){if(_0x3dd656&&_0x3dd656[_0x07cd('0x5e')]===0x0){return db[_0x07cd('0x2f')]['create']({'name':_0x5342eb[_0x07cd('0x34')],'resourceId':_0x5342eb['id'],'type':_0x3dd656[_0x07cd('0x34')],'sectionId':_0x3dd656['id']},{})[_0x07cd('0x2d')](function(){return _0x4113c2;});}else{return _0x4113c2;}})[_0x07cd('0x50')](function(_0x2b2b8b){logger['error'](_0x07cd('0x5f'),_0x2b2b8b);throw _0x2b2b8b;});}return _0x4113c2;});}})[_0x07cd('0x2d')](respondWithResult(_0x373755,0xc9))[_0x07cd('0x50')](handleError(_0x373755,null));};exports[_0x07cd('0x64')]=function(_0x145afe,_0x66e450){if(_0x145afe[_0x07cd('0x57')]['id']){delete _0x145afe[_0x07cd('0x57')]['id'];}return db[_0x07cd('0x37')][_0x07cd('0x55')]({'where':{'id':_0x145afe[_0x07cd('0x52')]['id']}})['then'](handleEntityNotFound(_0x66e450,null))['then'](saveUpdates(_0x145afe[_0x07cd('0x57')],null))['then'](respondWithResult(_0x66e450,null))[_0x07cd('0x50')](handleError(_0x66e450,null));};exports['destroy']=function(_0x3a8acd,_0x2263b0){return db['Dashboard'][_0x07cd('0x55')]({'where':{'id':_0x3a8acd[_0x07cd('0x52')]['id']}})['then'](handleEntityNotFound(_0x2263b0,null))['then'](removeEntity(_0x2263b0,null))['catch'](handleError(_0x2263b0,null));};function widgetAttributes(_0x5f9edd){try{switch(_0x5f9edd[_0x07cd('0x3a')]){case'iframe':return[{'name':_0x07cd('0x65'),'value':_0x5f9edd[_0x07cd('0x65')]||(_0x5f9edd['attrs']&&_0x5f9edd[_0x07cd('0x66')][0x0]?_0x5f9edd['attrs'][0x0][_0x07cd('0x67')]:undefined)||_0x07cd('0x68')}];case'custom':return[{'name':_0x07cd('0x69'),'value':_0x5f9edd[_0x07cd('0x69')]||(_0x5f9edd['attrs']&&_0x5f9edd[_0x07cd('0x66')][0x0]?_0x5f9edd['attrs'][0x0]['value']:undefined)||''}];case _0x07cd('0x6a'):return[{'name':_0x07cd('0x6b'),'value':_0x5f9edd[_0x07cd('0x6b')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x0]?_0x5f9edd[_0x07cd('0x66')][0x0]['value']:undefined)||_0x07cd('0x6c')},{'name':_0x07cd('0x6d'),'value':_0x5f9edd[_0x07cd('0x6d')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x1]?_0x5f9edd['attrs'][0x1]['value']:undefined)||_0x07cd('0x6e')},{'name':_0x07cd('0x6f'),'value':_0x5f9edd['attrFontSize']||(_0x5f9edd['attrs']&&_0x5f9edd[_0x07cd('0x66')][0x2]?_0x5f9edd[_0x07cd('0x66')][0x2][_0x07cd('0x67')]:undefined)||0xc}];case _0x07cd('0x70'):return[{'name':_0x07cd('0x71'),'value':_0x5f9edd[_0x07cd('0x71')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x0]?_0x5f9edd[_0x07cd('0x66')][0x0]['value']:undefined)||_0x07cd('0x72')},{'name':'attrVoiceQueues','value':_0x5f9edd['attrVoiceQueues']||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x1]?_0x5f9edd[_0x07cd('0x66')][0x1][_0x07cd('0x67')]:undefined)||[]},{'name':'attrFontSize','value':_0x5f9edd[_0x07cd('0x6f')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x2]?_0x5f9edd[_0x07cd('0x66')][0x2][_0x07cd('0x67')]:undefined)||0x14},{'name':'attrChannel','value':_0x5f9edd[_0x07cd('0x73')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x3]?_0x5f9edd['attrs'][0x3][_0x07cd('0x67')]:undefined)||'voice'},{'name':_0x07cd('0x74'),'value':_0x5f9edd['attrEmailAccounts']||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x4]?_0x5f9edd[_0x07cd('0x66')][0x4][_0x07cd('0x67')]:undefined)||''},{'name':_0x07cd('0x75'),'value':_0x5f9edd[_0x07cd('0x75')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x5]?_0x5f9edd[_0x07cd('0x66')][0x5][_0x07cd('0x67')]:undefined)||''},{'name':_0x07cd('0x76'),'value':_0x5f9edd[_0x07cd('0x76')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd['attrs'][0x6]?_0x5f9edd[_0x07cd('0x66')][0x6]['value']:undefined)||''},{'name':_0x07cd('0x77'),'value':_0x5f9edd['attrOpenchannelAccounts']||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x7]?_0x5f9edd[_0x07cd('0x66')][0x7][_0x07cd('0x67')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x5f9edd['attrWhatsappAccounts']||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x8]?_0x5f9edd[_0x07cd('0x66')][0x8][_0x07cd('0x67')]:undefined)||''},{'name':'attrChatWebsites','value':_0x5f9edd['attrChatWebsites']||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x9]?_0x5f9edd['attrs'][0x9][_0x07cd('0x67')]:undefined)||''}];case _0x07cd('0x78'):case _0x07cd('0x79'):return[{'name':_0x07cd('0x7a'),'value':_0x5f9edd[_0x07cd('0x7a')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x0]?_0x5f9edd[_0x07cd('0x66')][0x0]['value']:undefined)||_0x07cd('0x72')},{'name':_0x07cd('0x7b'),'value':_0x5f9edd[_0x07cd('0x7b')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd['attrs'][0x1]?_0x5f9edd['attrs'][0x1]['value']:undefined)||null},{'name':_0x07cd('0x7c'),'value':_0x5f9edd[_0x07cd('0x7c')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x2]?_0x5f9edd[_0x07cd('0x66')][0x2][_0x07cd('0x67')]:undefined)||null},{'name':_0x07cd('0x7d'),'value':_0x5f9edd[_0x07cd('0x7d')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x3]?_0x5f9edd[_0x07cd('0x66')][0x3]['value']:undefined)||[]},{'name':_0x07cd('0x73'),'value':_0x5f9edd[_0x07cd('0x73')]||(_0x5f9edd['attrs']&&_0x5f9edd[_0x07cd('0x66')][0x4]?_0x5f9edd['attrs'][0x4][_0x07cd('0x67')]:undefined)||_0x07cd('0x7e')},{'name':_0x07cd('0x74'),'value':_0x5f9edd[_0x07cd('0x74')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x5]?_0x5f9edd['attrs'][0x5]['value']:undefined)||''},{'name':_0x07cd('0x75'),'value':_0x5f9edd[_0x07cd('0x75')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x6]?_0x5f9edd[_0x07cd('0x66')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x5f9edd[_0x07cd('0x76')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x7]?_0x5f9edd[_0x07cd('0x66')][0x7][_0x07cd('0x67')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x5f9edd[_0x07cd('0x77')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x8]?_0x5f9edd[_0x07cd('0x66')][0x8]['value']:undefined)||''},{'name':_0x07cd('0x7f'),'value':_0x5f9edd[_0x07cd('0x7f')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x9]?_0x5f9edd[_0x07cd('0x66')][0x9][_0x07cd('0x67')]:undefined)||''},{'name':_0x07cd('0x80'),'value':_0x5f9edd[_0x07cd('0x80')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0xa]?_0x5f9edd['attrs'][0xa][_0x07cd('0x67')]:undefined)||''}];case _0x07cd('0x81'):return[{'name':_0x07cd('0x82'),'type':_0x5f9edd['reportType']||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd[_0x07cd('0x66')][0x0]?_0x5f9edd[_0x07cd('0x66')][0x0]['type']:undefined)||null,'value':_0x5f9edd[_0x07cd('0x82')]||(_0x5f9edd[_0x07cd('0x66')]&&_0x5f9edd['attrs'][0x0]?_0x5f9edd['attrs'][0x0][_0x07cd('0x67')]:undefined)||null},{'name':_0x07cd('0x83'),'value':_0x5f9edd[_0x07cd('0x83')]||(_0x5f9edd['attrs']&&_0x5f9edd['attrs'][0x1]?_0x5f9edd[_0x07cd('0x66')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x17c576){logger[_0x07cd('0x32')]('widgetAttributes:\x20%s',JSON[_0x07cd('0x84')](_0x17c576));return[];}}exports['addItem']=function(_0x27bcbd,_0x3d8d12,_0xace620){if(_0x27bcbd[_0x07cd('0x57')]['id']){delete _0x27bcbd[_0x07cd('0x57')]['id'];}return db[_0x07cd('0x37')][_0x07cd('0x55')]({'where':{'id':_0x27bcbd[_0x07cd('0x52')]['id']}})[_0x07cd('0x2d')](handleEntityNotFound(_0x3d8d12,null))['then'](function(_0x5acd9b){if(_0x5acd9b){_0x27bcbd['body'][_0x07cd('0x85')]=_0x5acd9b['id'];_0x27bcbd[_0x07cd('0x57')][_0x07cd('0x66')]=widgetAttributes(_0x27bcbd[_0x07cd('0x57')]);return db[_0x07cd('0x86')][_0x07cd('0x56')](_0x27bcbd[_0x07cd('0x57')]);}})[_0x07cd('0x2d')](respondWithResult(_0x3d8d12,null))['catch'](handleError(_0x3d8d12,null));};exports['getItems']=function(_0x2ec993,_0x337f94,_0x38a91c){var _0x3aba3f={};var _0x321f11={};var _0x25c2e1;var _0x25ec8f;return db[_0x07cd('0x37')][_0x07cd('0x87')]({'where':{'id':_0x2ec993[_0x07cd('0x52')]['id']}})[_0x07cd('0x2d')](handleEntityNotFound(_0x337f94,null))[_0x07cd('0x2d')](function(_0xab43a4){if(_0xab43a4){_0x25c2e1=_0xab43a4;_0x321f11[_0x07cd('0x3c')]=_[_0x07cd('0x53')](db['DashboardItem'][_0x07cd('0x38')]);_0x321f11[_0x07cd('0x3e')]=_[_0x07cd('0x53')](_0x2ec993['query']);_0x321f11[_0x07cd('0x3f')]=_[_0x07cd('0x40')](_0x321f11['model'],_0x321f11['query']);_0x3aba3f[_0x07cd('0x42')]=_[_0x07cd('0x40')](_0x321f11[_0x07cd('0x3c')],qs[_0x07cd('0x41')](_0x2ec993['query']['fields']));_0x3aba3f['attributes']=_0x3aba3f['attributes']['length']?_0x3aba3f[_0x07cd('0x42')]:_0x321f11[_0x07cd('0x3c')];_0x3aba3f['order']=qs[_0x07cd('0x46')](_0x2ec993[_0x07cd('0x3e')]['sort']);_0x3aba3f['where']=qs['filters'](_[_0x07cd('0x48')](_0x2ec993[_0x07cd('0x3e')],_0x321f11[_0x07cd('0x3f')]));if(_0x2ec993['query'][_0x07cd('0x4b')]){_0x3aba3f[_0x07cd('0x47')]=_[_0x07cd('0x49')](_0x3aba3f['where'],{'$or':_[_0x07cd('0x3d')](_0x3aba3f[_0x07cd('0x42')],function(_0x1422a3){var _0x38af82={};_0x38af82[_0x1422a3]={'$like':'%'+_0x2ec993['query'][_0x07cd('0x4b')]+'%'};return _0x38af82;})});}_0x3aba3f=_[_0x07cd('0x49')]({},_0x3aba3f,_0x2ec993[_0x07cd('0x4c')]);return _0x25c2e1[_0x07cd('0x88')](_0x3aba3f);}})[_0x07cd('0x2d')](function(_0x56641f){if(_0x56641f){_0x25ec8f=_0x56641f['length'];if(!_0x2ec993[_0x07cd('0x3e')][_0x07cd('0x44')](_0x07cd('0x45'))){_0x3aba3f['limit']=qs[_0x07cd('0x26')](_0x2ec993[_0x07cd('0x3e')][_0x07cd('0x26')]);_0x3aba3f['offset']=qs[_0x07cd('0x24')](_0x2ec993[_0x07cd('0x3e')][_0x07cd('0x24')]);}return _0x25c2e1[_0x07cd('0x88')](_0x3aba3f);}})[_0x07cd('0x2d')](function(_0x2fd594){if(_0x2fd594){return _0x2fd594?{'count':_0x25ec8f,'rows':_0x2fd594}:null;}})[_0x07cd('0x2d')](respondWithResult(_0x337f94,null))['catch'](handleError(_0x337f94,null));}; \ No newline at end of file +var _0x1ff7=['error','name','index','Dashboard','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','clone','rawAttributes','omit','createdAt','updatedAt','includeAll','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','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','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','CustomDashboards','destroy','end'];(function(_0x2c2e68,_0x4bdb36){var _0x177829=function(_0x15911a){while(--_0x15911a){_0x2c2e68['push'](_0x2c2e68['shift']());}};_0x177829(++_0x4bdb36);}(_0x1ff7,0x1ea));var _0x71ff=function(_0x5844c9,_0x12e53b){_0x5844c9=_0x5844c9-0x0;var _0x24834e=_0x1ff7[_0x5844c9];return _0x24834e;};'use strict';var emlformat=require(_0x71ff('0x0'));var rimraf=require(_0x71ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x71ff('0x2'));var rp=require(_0x71ff('0x3'));var moment=require(_0x71ff('0x4'));var BPromise=require(_0x71ff('0x5'));var Mustache=require(_0x71ff('0x6'));var util=require(_0x71ff('0x7'));var path=require('path');var sox=require(_0x71ff('0x8'));var csv=require(_0x71ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71ff('0xa'));var _=require('lodash');var squel=require(_0x71ff('0xb'));var crypto=require(_0x71ff('0xc'));var jsforce=require(_0x71ff('0xd'));var deskjs=require(_0x71ff('0xe'));var toCsv=require(_0x71ff('0x9'));var querystring=require(_0x71ff('0xf'));var Papa=require(_0x71ff('0x10'));var Redis=require(_0x71ff('0x11'));var authService=require(_0x71ff('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x71ff('0x13'));var hardwareService=require(_0x71ff('0x14'));var logger=require(_0x71ff('0x15'))(_0x71ff('0x16'));var utils=require(_0x71ff('0x17'));var config=require(_0x71ff('0x18'));var licenseUtil=require(_0x71ff('0x19'));var db=require(_0x71ff('0x1a'))['db'];config['redis']=_[_0x71ff('0x1b')](config[_0x71ff('0x1c')],{'host':_0x71ff('0x1d'),'port':0x18eb});var socket=require(_0x71ff('0x1e'))(new Redis(config[_0x71ff('0x1c')]));require(_0x71ff('0x1f'))[_0x71ff('0x20')](socket);function respondWithStatusCode(_0x47932a,_0x16ff0e){_0x16ff0e=_0x16ff0e||0xcc;return function(_0x490941){if(_0x490941){return _0x47932a[_0x71ff('0x21')](_0x16ff0e);}return _0x47932a['status'](_0x16ff0e)['end']();};}function respondWithResult(_0x5599c4,_0x36772f){_0x36772f=_0x36772f||0xc8;return function(_0x361933){if(_0x361933){return _0x5599c4[_0x71ff('0x22')](_0x36772f)[_0x71ff('0x23')](_0x361933);}};}function respondWithFilteredResult(_0x9716fe,_0x6f675a){return function(_0x3bce37){if(_0x3bce37){var _0x910fdd=typeof _0x6f675a[_0x71ff('0x24')]===_0x71ff('0x25')&&typeof _0x6f675a['limit']==='undefined';var _0x9a2658=_0x3bce37[_0x71ff('0x26')];var _0x5d1370=_0x910fdd?0x0:_0x6f675a[_0x71ff('0x24')];var _0x95710c=_0x910fdd?_0x3bce37[_0x71ff('0x26')]:_0x6f675a[_0x71ff('0x24')]+_0x6f675a[_0x71ff('0x27')];var _0x240b3c;if(_0x95710c>=_0x9a2658){_0x95710c=_0x9a2658;_0x240b3c=0xc8;}else{_0x240b3c=0xce;}_0x9716fe[_0x71ff('0x22')](_0x240b3c);return _0x9716fe[_0x71ff('0x28')](_0x71ff('0x29'),_0x5d1370+'-'+_0x95710c+'/'+_0x9a2658)[_0x71ff('0x23')](_0x3bce37);}return null;};}function patchUpdates(_0x4240c7){return function(_0x391fb5){try{jsonpatch[_0x71ff('0x2a')](_0x391fb5,_0x4240c7,!![]);}catch(_0x5918e4){return BPromise[_0x71ff('0x2b')](_0x5918e4);}return _0x391fb5['save']();};}function saveUpdates(_0x1657cd,_0x3e2be2){return function(_0x210eac){if(_0x210eac){return _0x210eac[_0x71ff('0x2c')](_0x1657cd)[_0x71ff('0x2d')](function(_0x514f94){return _0x514f94;});}return null;};}function removeEntity(_0x46e884,_0x59d4f4){return function(_0x3ef0bc){if(_0x3ef0bc){return _0x3ef0bc['destroy']()['then'](function(){var _0x4709e9=_0x3ef0bc[_0x71ff('0x2e')]({'plain':!![]});var _0xae90ec=_0x71ff('0x2f');return db['UserProfileResource'][_0x71ff('0x30')]({'where':{'type':_0xae90ec,'resourceId':_0x4709e9['id']}})[_0x71ff('0x2d')](function(){return _0x3ef0bc;});})['then'](function(){_0x46e884[_0x71ff('0x22')](0xcc)[_0x71ff('0x31')]();});}};}function handleEntityNotFound(_0x3eb6d7,_0x5a9ce2){return function(_0x11ac7f){if(!_0x11ac7f){_0x3eb6d7[_0x71ff('0x21')](0x194);}return _0x11ac7f;};}function handleError(_0x4a55ec,_0x31dca3){_0x31dca3=_0x31dca3||0x1f4;return function(_0x4ba9a7){logger[_0x71ff('0x32')](_0x4ba9a7['stack']);if(_0x4ba9a7['name']){delete _0x4ba9a7[_0x71ff('0x33')];}_0x4a55ec[_0x71ff('0x22')](_0x31dca3)['send'](_0x4ba9a7);};}exports[_0x71ff('0x34')]=function(_0x34c4fa,_0x481d45){var _0x3f16d6={},_0x5bf7fa={},_0x2c3894={'count':0x0,'rows':[]};var _0x296098=_['map'](db[_0x71ff('0x35')]['rawAttributes'],function(_0x516e86){return{'name':_0x516e86[_0x71ff('0x36')],'type':_0x516e86[_0x71ff('0x37')][_0x71ff('0x38')]};});_0x5bf7fa['model']=_[_0x71ff('0x39')](_0x296098,_0x71ff('0x33'));_0x5bf7fa['query']=_[_0x71ff('0x3a')](_0x34c4fa[_0x71ff('0x3b')]);_0x5bf7fa['filters']=_[_0x71ff('0x3c')](_0x5bf7fa[_0x71ff('0x3d')],_0x5bf7fa['query']);_0x3f16d6[_0x71ff('0x3e')]=_[_0x71ff('0x3c')](_0x5bf7fa[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x3f')]));_0x3f16d6['attributes']=_0x3f16d6['attributes'][_0x71ff('0x40')]?_0x3f16d6[_0x71ff('0x3e')]:_0x5bf7fa[_0x71ff('0x3d')];if(!_0x34c4fa[_0x71ff('0x3b')]['hasOwnProperty']('nolimit')){_0x3f16d6[_0x71ff('0x27')]=qs[_0x71ff('0x27')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x27')]);_0x3f16d6[_0x71ff('0x24')]=qs[_0x71ff('0x24')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x24')]);}_0x3f16d6['order']=qs[_0x71ff('0x41')](_0x34c4fa[_0x71ff('0x3b')][_0x71ff('0x41')]);_0x3f16d6['where']=qs[_0x71ff('0x42')](_[_0x71ff('0x43')](_0x34c4fa['query'],_0x5bf7fa[_0x71ff('0x42')]),_0x296098);if(_0x34c4fa[_0x71ff('0x3b')]['filter']){_0x3f16d6[_0x71ff('0x44')]=_[_0x71ff('0x45')](_0x3f16d6[_0x71ff('0x44')],{'$or':_['map'](_0x296098,function(_0x1ff80f){if(_0x1ff80f['type']!==_0x71ff('0x46')){var _0x345c0b={};_0x345c0b[_0x1ff80f[_0x71ff('0x33')]]={'$like':'%'+_0x34c4fa['query'][_0x71ff('0x47')]+'%'};return _0x345c0b;}})});}_0x3f16d6=_[_0x71ff('0x45')]({},_0x3f16d6,_0x34c4fa[_0x71ff('0x48')]);var _0x33edb2={'where':_0x3f16d6['where']};return db[_0x71ff('0x35')]['count'](_0x33edb2)['then'](function(_0x1d8756){_0x2c3894[_0x71ff('0x26')]=_0x1d8756;if(_0x34c4fa[_0x71ff('0x3b')]['includeAll']){_0x3f16d6[_0x71ff('0x49')]=[{'all':!![]}];}return db[_0x71ff('0x35')][_0x71ff('0x4a')](_0x3f16d6);})['then'](function(_0xb44ff0){_0x2c3894[_0x71ff('0x4b')]=_0xb44ff0;return _0x2c3894;})[_0x71ff('0x2d')](respondWithFilteredResult(_0x481d45,_0x3f16d6))[_0x71ff('0x4c')](handleError(_0x481d45,null));};exports[_0x71ff('0x4d')]=function(_0x3e342f,_0x530733){var _0x3eea66={'raw':![],'where':{'id':_0x3e342f[_0x71ff('0x4e')]['id']}},_0x5567cf={};_0x5567cf[_0x71ff('0x3d')]=_['keys'](db[_0x71ff('0x35')]['rawAttributes']);_0x5567cf['query']=_[_0x71ff('0x3a')](_0x3e342f[_0x71ff('0x3b')]);_0x5567cf[_0x71ff('0x42')]=_[_0x71ff('0x3c')](_0x5567cf['model'],_0x5567cf[_0x71ff('0x3b')]);_0x3eea66[_0x71ff('0x3e')]=_[_0x71ff('0x3c')](_0x5567cf[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x3e342f[_0x71ff('0x3b')][_0x71ff('0x3f')]));_0x3eea66[_0x71ff('0x3e')]=_0x3eea66[_0x71ff('0x3e')][_0x71ff('0x40')]?_0x3eea66[_0x71ff('0x3e')]:_0x5567cf['model'];if(_0x3e342f['query']['includeAll']){_0x3eea66['include']=[{'all':!![]}];}_0x3eea66=_[_0x71ff('0x45')]({},_0x3eea66,_0x3e342f['options']);return db[_0x71ff('0x35')]['find'](_0x3eea66)[_0x71ff('0x2d')](handleEntityNotFound(_0x530733,null))[_0x71ff('0x2d')](respondWithResult(_0x530733,null))[_0x71ff('0x4c')](handleError(_0x530733,null));};exports[_0x71ff('0x4f')]=function(_0x2f2b9d,_0x2661a0){return db['Dashboard'][_0x71ff('0x4f')](_0x2f2b9d[_0x71ff('0x50')],{})[_0x71ff('0x2d')](function(_0x112aa3){var _0x3c7729=_0x2f2b9d[_0x71ff('0x51')][_0x71ff('0x2e')]({'plain':!![]});if(!_0x3c7729)throw new Error(_0x71ff('0x52'));if(_0x3c7729[_0x71ff('0x53')]==='user'){var _0x17fce4=_0x112aa3[_0x71ff('0x2e')]({'plain':!![]});var _0x4786ee=_0x71ff('0x2f');return db['UserProfileSection'][_0x71ff('0x54')]({'where':{'name':_0x4786ee,'userProfileId':_0x3c7729[_0x71ff('0x55')]},'raw':!![]})[_0x71ff('0x2d')](function(_0x381447){if(_0x381447&&_0x381447[_0x71ff('0x56')]===0x0){return db[_0x71ff('0x57')][_0x71ff('0x4f')]({'name':_0x17fce4[_0x71ff('0x33')],'resourceId':_0x17fce4['id'],'type':_0x381447['name'],'sectionId':_0x381447['id']},{})[_0x71ff('0x2d')](function(){return _0x112aa3;});}else{return _0x112aa3;}})[_0x71ff('0x4c')](function(_0x3d1426){logger[_0x71ff('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d1426);throw _0x3d1426;});}return _0x112aa3;})[_0x71ff('0x2d')](respondWithResult(_0x2661a0,0xc9))[_0x71ff('0x4c')](handleError(_0x2661a0,null));};exports[_0x71ff('0x58')]=function(_0x3d46ea,_0x13f2eb){var _0x2daf94={'where':{'id':_0x3d46ea['params']['id']}},_0x22657c={};_0x22657c[_0x71ff('0x3d')]=_[_0x71ff('0x3a')](db[_0x71ff('0x35')][_0x71ff('0x59')]);_0x2daf94['attributes']=_[_0x71ff('0x3c')](_0x22657c[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x3d46ea[_0x71ff('0x3b')]['fields']));_0x2daf94[_0x71ff('0x3e')]=_0x2daf94[_0x71ff('0x3e')]['length']?_0x2daf94['attributes']:_0x22657c[_0x71ff('0x3d')];if(_0x3d46ea[_0x71ff('0x3b')]['includeAll']){_0x2daf94[_0x71ff('0x49')]=[{'all':!![]}];}_0x2daf94=_[_0x71ff('0x45')]({},_0x2daf94,_0x3d46ea['options']);return db['Dashboard']['find'](_0x2daf94)[_0x71ff('0x2d')](handleEntityNotFound(_0x13f2eb,null))[_0x71ff('0x2d')](function(_0xbbede5){if(_0xbbede5){var _0x52a078=_0xbbede5[_0x71ff('0x2e')]({'plain':!![]});_0x52a078=qs[_0x71ff('0x5a')](_0x52a078,['id',_0x71ff('0x5b'),_0x71ff('0x5c')]);_0x3d46ea[_0x71ff('0x50')]=_[_0x71ff('0x5a')](_0x3d46ea[_0x71ff('0x50')],['id',_0x71ff('0x5b'),_0x71ff('0x5c')]);return db['Dashboard']['create'](_[_0x71ff('0x45')](_0x52a078,_0x3d46ea['body']),{'include':_0x3d46ea[_0x71ff('0x3b')][_0x71ff('0x5d')]?[{'all':!![]}]:undefined})[_0x71ff('0x2d')](function(_0x384e6e){var _0x247f93=_0x3d46ea[_0x71ff('0x51')][_0x71ff('0x2e')]({'plain':!![]});if(!_0x247f93)throw new Error(_0x71ff('0x52'));if(_0x247f93['role']===_0x71ff('0x51')){var _0x2d7562=_0x384e6e['get']({'plain':!![]});var _0x30458c='CustomDashboards';return db[_0x71ff('0x5e')][_0x71ff('0x54')]({'where':{'name':_0x30458c,'userProfileId':_0x247f93['userProfileId']},'raw':!![]})[_0x71ff('0x2d')](function(_0x19e00b){if(_0x19e00b&&_0x19e00b[_0x71ff('0x56')]===0x0){return db['UserProfileResource'][_0x71ff('0x4f')]({'name':_0x2d7562['name'],'resourceId':_0x2d7562['id'],'type':_0x19e00b[_0x71ff('0x33')],'sectionId':_0x19e00b['id']},{})[_0x71ff('0x2d')](function(){return _0x384e6e;});}else{return _0x384e6e;}})['catch'](function(_0x45a8a2){logger[_0x71ff('0x32')](_0x71ff('0x5f'),_0x45a8a2);throw _0x45a8a2;});}return _0x384e6e;});}})[_0x71ff('0x2d')](respondWithResult(_0x13f2eb,0xc9))[_0x71ff('0x4c')](handleError(_0x13f2eb,null));};exports[_0x71ff('0x2c')]=function(_0x145e81,_0x56dfe8){if(_0x145e81['body']['id']){delete _0x145e81[_0x71ff('0x50')]['id'];}return db['Dashboard'][_0x71ff('0x54')]({'where':{'id':_0x145e81['params']['id']}})['then'](handleEntityNotFound(_0x56dfe8,null))['then'](saveUpdates(_0x145e81[_0x71ff('0x50')],null))[_0x71ff('0x2d')](respondWithResult(_0x56dfe8,null))[_0x71ff('0x4c')](handleError(_0x56dfe8,null));};exports['destroy']=function(_0x5a3aad,_0x4c4f45){return db['Dashboard'][_0x71ff('0x54')]({'where':{'id':_0x5a3aad[_0x71ff('0x4e')]['id']}})[_0x71ff('0x2d')](handleEntityNotFound(_0x4c4f45,null))[_0x71ff('0x2d')](removeEntity(_0x4c4f45,null))['catch'](handleError(_0x4c4f45,null));};function widgetAttributes(_0x566270){try{switch(_0x566270['type']){case'iframe':return[{'name':_0x71ff('0x60'),'value':_0x566270[_0x71ff('0x60')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0][_0x71ff('0x62')]:undefined)||_0x71ff('0x63')}];case _0x71ff('0x64'):return[{'name':_0x71ff('0x65'),'value':_0x566270[_0x71ff('0x65')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0]['value']:undefined)||''}];case _0x71ff('0x66'):return[{'name':_0x71ff('0x67'),'value':_0x566270[_0x71ff('0x67')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0][_0x71ff('0x62')]:undefined)||'HH:mm:ss'},{'name':_0x71ff('0x68'),'value':_0x566270[_0x71ff('0x68')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x1]?_0x566270[_0x71ff('0x61')][0x1]['value']:undefined)||'0.00'},{'name':_0x71ff('0x69'),'value':_0x566270['attrFontSize']||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x2]?_0x566270['attrs'][0x2][_0x71ff('0x62')]:undefined)||0xc}];case _0x71ff('0x6a'):return[{'name':'attrMetric','value':_0x566270[_0x71ff('0x6b')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270['attrs'][0x0]['value']:undefined)||_0x71ff('0x6c')},{'name':_0x71ff('0x6d'),'value':_0x566270['attrVoiceQueues']||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x1]?_0x566270[_0x71ff('0x61')][0x1]['value']:undefined)||[]},{'name':_0x71ff('0x69'),'value':_0x566270[_0x71ff('0x69')]||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x2]?_0x566270[_0x71ff('0x61')][0x2][_0x71ff('0x62')]:undefined)||0x14},{'name':_0x71ff('0x6e'),'value':_0x566270[_0x71ff('0x6e')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x3]?_0x566270[_0x71ff('0x61')][0x3]['value']:undefined)||_0x71ff('0x6f')},{'name':'attrEmailAccounts','value':_0x566270[_0x71ff('0x70')]||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x4]?_0x566270[_0x71ff('0x61')][0x4][_0x71ff('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x566270[_0x71ff('0x71')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x5]?_0x566270[_0x71ff('0x61')][0x5][_0x71ff('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x566270[_0x71ff('0x72')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x6]?_0x566270['attrs'][0x6][_0x71ff('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x566270[_0x71ff('0x73')]||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x7]?_0x566270[_0x71ff('0x61')][0x7]['value']:undefined)||''},{'name':_0x71ff('0x74'),'value':_0x566270[_0x71ff('0x74')]||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x8]?_0x566270['attrs'][0x8][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x75'),'value':_0x566270['attrChatWebsites']||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x9]?_0x566270['attrs'][0x9][_0x71ff('0x62')]:undefined)||''}];case _0x71ff('0x76'):case'pie-chart':return[{'name':_0x71ff('0x77'),'value':_0x566270[_0x71ff('0x77')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270['attrs'][0x0][_0x71ff('0x62')]:undefined)||_0x71ff('0x6c')},{'name':_0x71ff('0x78'),'value':_0x566270[_0x71ff('0x78')]||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x1]?_0x566270[_0x71ff('0x61')][0x1][_0x71ff('0x62')]:undefined)||null},{'name':_0x71ff('0x79'),'value':_0x566270[_0x71ff('0x79')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x2]?_0x566270['attrs'][0x2][_0x71ff('0x62')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x566270[_0x71ff('0x6d')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x3]?_0x566270['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x566270[_0x71ff('0x6e')]||(_0x566270['attrs']&&_0x566270['attrs'][0x4]?_0x566270[_0x71ff('0x61')][0x4]['value']:undefined)||'voice'},{'name':_0x71ff('0x70'),'value':_0x566270[_0x71ff('0x70')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x5]?_0x566270[_0x71ff('0x61')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x566270[_0x71ff('0x71')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x6]?_0x566270[_0x71ff('0x61')][0x6][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x72'),'value':_0x566270[_0x71ff('0x72')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x7]?_0x566270[_0x71ff('0x61')][0x7][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x73'),'value':_0x566270[_0x71ff('0x73')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x8]?_0x566270['attrs'][0x8][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x74'),'value':_0x566270[_0x71ff('0x74')]||(_0x566270['attrs']&&_0x566270['attrs'][0x9]?_0x566270[_0x71ff('0x61')][0x9][_0x71ff('0x62')]:undefined)||''},{'name':_0x71ff('0x75'),'value':_0x566270[_0x71ff('0x75')]||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0xa]?_0x566270[_0x71ff('0x61')][0xa][_0x71ff('0x62')]:undefined)||''}];case _0x71ff('0x7a'):return[{'name':_0x71ff('0x7b'),'type':_0x566270['reportType']||(_0x566270['attrs']&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0]['type']:undefined)||null,'value':_0x566270['attrReport']||(_0x566270[_0x71ff('0x61')]&&_0x566270[_0x71ff('0x61')][0x0]?_0x566270[_0x71ff('0x61')][0x0][_0x71ff('0x62')]:undefined)||null},{'name':_0x71ff('0x7c'),'value':_0x566270['attrRefresh']||(_0x566270[_0x71ff('0x61')]&&_0x566270['attrs'][0x1]?_0x566270[_0x71ff('0x61')][0x1][_0x71ff('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x9cbc49){logger['error'](_0x71ff('0x7d'),JSON[_0x71ff('0x7e')](_0x9cbc49));return[];}}exports[_0x71ff('0x7f')]=function(_0x116415,_0x24d8c2,_0x1d0b7d){if(_0x116415['body']['id']){delete _0x116415[_0x71ff('0x50')]['id'];}return db[_0x71ff('0x35')][_0x71ff('0x54')]({'where':{'id':_0x116415['params']['id']}})['then'](handleEntityNotFound(_0x24d8c2,null))[_0x71ff('0x2d')](function(_0x346e8f){if(_0x346e8f){_0x116415[_0x71ff('0x50')][_0x71ff('0x80')]=_0x346e8f['id'];_0x116415[_0x71ff('0x50')][_0x71ff('0x61')]=widgetAttributes(_0x116415[_0x71ff('0x50')]);return db[_0x71ff('0x81')]['create'](_0x116415[_0x71ff('0x50')]);}})['then'](respondWithResult(_0x24d8c2,null))['catch'](handleError(_0x24d8c2,null));};exports[_0x71ff('0x82')]=function(_0x35a7df,_0x2d1dc5,_0x8ad9b0){var _0x47843b={};var _0x404806={};var _0x1d3903;var _0x4d2d03;return db[_0x71ff('0x35')][_0x71ff('0x83')]({'where':{'id':_0x35a7df[_0x71ff('0x4e')]['id']}})[_0x71ff('0x2d')](handleEntityNotFound(_0x2d1dc5,null))['then'](function(_0xa6ecc7){if(_0xa6ecc7){_0x1d3903=_0xa6ecc7;_0x404806[_0x71ff('0x3d')]=_[_0x71ff('0x3a')](db['DashboardItem'][_0x71ff('0x59')]);_0x404806['query']=_[_0x71ff('0x3a')](_0x35a7df[_0x71ff('0x3b')]);_0x404806[_0x71ff('0x42')]=_['intersection'](_0x404806[_0x71ff('0x3d')],_0x404806[_0x71ff('0x3b')]);_0x47843b[_0x71ff('0x3e')]=_['intersection'](_0x404806[_0x71ff('0x3d')],qs[_0x71ff('0x3f')](_0x35a7df['query'][_0x71ff('0x3f')]));_0x47843b['attributes']=_0x47843b[_0x71ff('0x3e')][_0x71ff('0x40')]?_0x47843b['attributes']:_0x404806[_0x71ff('0x3d')];_0x47843b[_0x71ff('0x84')]=qs[_0x71ff('0x41')](_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x41')]);_0x47843b[_0x71ff('0x44')]=qs[_0x71ff('0x42')](_['pick'](_0x35a7df[_0x71ff('0x3b')],_0x404806[_0x71ff('0x42')]));if(_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x47')]){_0x47843b[_0x71ff('0x44')]=_[_0x71ff('0x45')](_0x47843b[_0x71ff('0x44')],{'$or':_[_0x71ff('0x39')](_0x47843b[_0x71ff('0x3e')],function(_0x181dcc){var _0x16f76c={};_0x16f76c[_0x181dcc]={'$like':'%'+_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x47')]+'%'};return _0x16f76c;})});}_0x47843b=_[_0x71ff('0x45')]({},_0x47843b,_0x35a7df[_0x71ff('0x48')]);return _0x1d3903[_0x71ff('0x82')](_0x47843b);}})['then'](function(_0x48d18b){if(_0x48d18b){_0x4d2d03=_0x48d18b[_0x71ff('0x40')];if(!_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x85')](_0x71ff('0x86'))){_0x47843b['limit']=qs['limit'](_0x35a7df[_0x71ff('0x3b')][_0x71ff('0x27')]);_0x47843b[_0x71ff('0x24')]=qs[_0x71ff('0x24')](_0x35a7df['query'][_0x71ff('0x24')]);}return _0x1d3903[_0x71ff('0x82')](_0x47843b);}})[_0x71ff('0x2d')](function(_0x384ca9){if(_0x384ca9){return _0x384ca9?{'count':_0x4d2d03,'rows':_0x384ca9}:null;}})[_0x71ff('0x2d')](respondWithResult(_0x2d1dc5,null))[_0x71ff('0x4c')](handleError(_0x2d1dc5,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 1e7fef2..ad750d9 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 _0x6a3b=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x4da7f8,_0x5d836d){var _0x4968d0=function(_0x2bdd0b){while(--_0x2bdd0b){_0x4da7f8['push'](_0x4da7f8['shift']());}};_0x4968d0(++_0x5d836d);}(_0x6a3b,0x16b));var _0xb6a3=function(_0xc4a1e4,_0x517d5d){_0xc4a1e4=_0xc4a1e4-0x0;var _0x30c83f=_0x6a3b[_0xc4a1e4];return _0x30c83f;};'use strict';var EventEmitter=require(_0xb6a3('0x0'));var Dashboard=require(_0xb6a3('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb6a3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6a3('0x3'),'afterDestroy':_0xb6a3('0x4')};function emitEvent(_0x4667d6){return function(_0xd4b460,_0x63928b,_0x4ddab3){DashboardEvents[_0xb6a3('0x5')](_0x4667d6+':'+_0xd4b460['id'],_0xd4b460);DashboardEvents['emit'](_0x4667d6,_0xd4b460);_0x4ddab3(null);};}for(var e in events){if(events[_0xb6a3('0x6')](e)){var event=events[e];Dashboard[_0xb6a3('0x7')](e,emitEvent(event));}}module[_0xb6a3('0x8')]=DashboardEvents; \ No newline at end of file +var _0xbbe5=['save','remove','emit','events','../../mysqldb','Dashboard'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xbbe5,0x171));var _0x5bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x5bbe('0x0'));var Dashboard=require(_0x5bbe('0x1'))['db'][_0x5bbe('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5bbe('0x3'),'afterUpdate':'update','afterDestroy':_0x5bbe('0x4')};function emitEvent(_0x3f3116){return function(_0x34cf98,_0x3dcd91,_0xbc183a){DashboardEvents[_0x5bbe('0x5')](_0x3f3116+':'+_0x34cf98['id'],_0x34cf98);DashboardEvents[_0x5bbe('0x5')](_0x3f3116,_0x34cf98);_0xbc183a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index d5ea8e0..73c2e58 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 _0xed26=['dashboards','lodash','api','moment','bluebird','request-promise','path','./dashboard.attributes','Dashboard'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xed26,0x64));var _0x6ed2=function(_0x42ea17,_0x41fb08){_0x42ea17=_0x42ea17-0x0;var _0x1bbcc0=_0xed26[_0x42ea17];return _0x1bbcc0;};'use strict';var _=require(_0x6ed2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ed2('0x1'));var moment=require(_0x6ed2('0x2'));var BPromise=require(_0x6ed2('0x3'));var rp=require(_0x6ed2('0x4'));var fs=require('fs');var path=require(_0x6ed2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ed2('0x6'));module['exports']=function(_0xde0c81,_0x55189f){return _0xde0c81['define'](_0x6ed2('0x7'),attributes,{'tableName':_0x6ed2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48eb=['define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x48eb,0x17a));var _0xb48e=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0x48eb[_0x557f5f];return _0x196eba;};'use strict';var _=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var logger=require(_0xb48e('0x2'))(_0xb48e('0x3'));var moment=require(_0xb48e('0x4'));var BPromise=require(_0xb48e('0x5'));var rp=require(_0xb48e('0x6'));var fs=require('fs');var path=require(_0xb48e('0x7'));var rimraf=require(_0xb48e('0x8'));var config=require(_0xb48e('0x9'));var attributes=require(_0xb48e('0xa'));module[_0xb48e('0xb')]=function(_0x48ade9,_0xac1be2){return _0x48ade9[_0xb48e('0xc')](_0xb48e('0xd'),attributes,{'tableName':_0xb48e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 430f2ac..df2beed 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 _0xd50e=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x5878ee,_0x406ff5){var _0x2068a0=function(_0x345719){while(--_0x345719){_0x5878ee['push'](_0x5878ee['shift']());}};_0x2068a0(++_0x406ff5);}(_0xd50e,0x10b));var _0xed50=function(_0x46628a,_0x2ef7ca){_0x46628a=_0x46628a-0x0;var _0x50eb21=_0xd50e[_0x46628a];return _0x50eb21;};'use strict';var _=require(_0xed50('0x0'));var util=require('util');var moment=require(_0xed50('0x1'));var BPromise=require(_0xed50('0x2'));var rs=require(_0xed50('0x3'));var fs=require('fs');var Redis=require(_0xed50('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed50('0x5'))(_0xed50('0x6'));var config=require(_0xed50('0x7'));var jayson=require(_0xed50('0x8'));var client=jayson[_0xed50('0x9')][_0xed50('0xa')]({'port':0x232a});config[_0xed50('0xb')]=_['defaults'](config[_0xed50('0xb')],{'host':_0xed50('0xc'),'port':0x18eb});var socket=require(_0xed50('0xd'))(new Redis(config[_0xed50('0xb')]));require(_0xed50('0xe'))[_0xed50('0xf')](socket);function respondWithRpcPromise(_0x248756,_0x29bc00,_0xefca73){return new BPromise(function(_0x41d475,_0x1310e1){return client[_0xed50('0x10')](_0x248756,_0xefca73)[_0xed50('0x11')](function(_0x184a91){logger[_0xed50('0x12')](_0xed50('0x13'),_0x29bc00,_0xed50('0x14'));logger[_0xed50('0x15')](_0xed50('0x16'),_0x29bc00,_0xed50('0x14'),JSON[_0xed50('0x17')](_0x184a91));if(_0x184a91[_0xed50('0x18')]){if(_0x184a91[_0xed50('0x18')][_0xed50('0x19')]===0x1f4){logger[_0xed50('0x18')](_0xed50('0x13'),_0x29bc00,_0x184a91[_0xed50('0x18')]['message']);return _0x1310e1(_0x184a91[_0xed50('0x18')][_0xed50('0x1a')]);}logger[_0xed50('0x18')](_0xed50('0x13'),_0x29bc00,_0x184a91['error']['message']);return _0x41d475(_0x184a91[_0xed50('0x18')][_0xed50('0x1a')]);}else{logger[_0xed50('0x12')](_0xed50('0x13'),_0x29bc00,_0xed50('0x14'));_0x41d475(_0x184a91[_0xed50('0x1b')][_0xed50('0x1a')]);}})[_0xed50('0x1c')](function(_0x2cdbd4){logger[_0xed50('0x18')](_0xed50('0x13'),_0x29bc00,_0x2cdbd4);_0x1310e1(_0x2cdbd4);});});} \ No newline at end of file +var _0x6eea=['defaults','localhost','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis'];(function(_0x57fba0,_0x34fc27){var _0x14de31=function(_0x1b3bbc){while(--_0x1b3bbc){_0x57fba0['push'](_0x57fba0['shift']());}};_0x14de31(++_0x34fc27);}(_0x6eea,0x12d));var _0xa6ee=function(_0x4d672c,_0x15a6e0){_0x4d672c=_0x4d672c-0x0;var _0x22dc61=_0x6eea[_0x4d672c];return _0x22dc61;};'use strict';var _=require(_0xa6ee('0x0'));var util=require('util');var moment=require(_0xa6ee('0x1'));var BPromise=require(_0xa6ee('0x2'));var rs=require(_0xa6ee('0x3'));var fs=require('fs');var Redis=require(_0xa6ee('0x4'));var db=require(_0xa6ee('0x5'))['db'];var utils=require(_0xa6ee('0x6'));var logger=require('../../config/logger')(_0xa6ee('0x7'));var config=require(_0xa6ee('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa6ee('0x9')]({'port':0x232a});config[_0xa6ee('0xa')]=_[_0xa6ee('0xb')](config[_0xa6ee('0xa')],{'host':_0xa6ee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa6ee('0xd'))[_0xa6ee('0xe')](socket);function respondWithRpcPromise(_0x3a2d4c,_0x5a57a1,_0x148b28){return new BPromise(function(_0x3cd69a,_0x5be69f){return client[_0xa6ee('0xf')](_0x3a2d4c,_0x148b28)[_0xa6ee('0x10')](function(_0x2c08c3){logger['info'](_0xa6ee('0x11'),_0x5a57a1,_0xa6ee('0x12'));logger[_0xa6ee('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x5a57a1,_0xa6ee('0x12'),JSON[_0xa6ee('0x14')](_0x2c08c3));if(_0x2c08c3['error']){if(_0x2c08c3[_0xa6ee('0x15')][_0xa6ee('0x16')]===0x1f4){logger['error'](_0xa6ee('0x11'),_0x5a57a1,_0x2c08c3[_0xa6ee('0x15')]['message']);return _0x5be69f(_0x2c08c3[_0xa6ee('0x15')]['message']);}logger[_0xa6ee('0x15')]('Dashboard,\x20%s,\x20%s',_0x5a57a1,_0x2c08c3[_0xa6ee('0x15')][_0xa6ee('0x17')]);return _0x3cd69a(_0x2c08c3[_0xa6ee('0x15')][_0xa6ee('0x17')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x5a57a1,_0xa6ee('0x12'));_0x3cd69a(_0x2c08c3[_0xa6ee('0x18')]['message']);}})[_0xa6ee('0x19')](function(_0x3fa023){logger[_0xa6ee('0x15')](_0xa6ee('0x11'),_0x5a57a1,_0x3fa023);_0x5be69f(_0x3fa023);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index fee3fa6..0ccacfe 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 _0x961f=['./dashboard.events','update','emit','removeListener','register','dashboard:'];(function(_0x27ed41,_0xb780a1){var _0x507934=function(_0x1f09ab){while(--_0x1f09ab){_0x27ed41['push'](_0x27ed41['shift']());}};_0x507934(++_0xb780a1);}(_0x961f,0x1c8));var _0xf961=function(_0x105c50,_0x29ba3e){_0x105c50=_0x105c50-0x0;var _0x570327=_0x961f[_0x105c50];return _0x570327;};'use strict';var DashboardEvents=require(_0xf961('0x0'));var events=['save','remove',_0xf961('0x1')];function createListener(_0x488ce2,_0x2a1b6b){return function(_0x5a51e6){_0x2a1b6b[_0xf961('0x2')](_0x488ce2,_0x5a51e6);};}function removeListener(_0x580276,_0x177ac9){return function(){DashboardEvents[_0xf961('0x3')](_0x580276,_0x177ac9);};}exports[_0xf961('0x4')]=function(_0x535556){for(var _0x2885e7=0x0,_0x2de062=events['length'];_0x2885e7<_0x2de062;_0x2885e7++){var _0x5bb833=events[_0x2885e7];var _0x4b15c9=createListener(_0xf961('0x5')+_0x5bb833,_0x535556);DashboardEvents['on'](_0x5bb833,_0x4b15c9);}}; \ No newline at end of file +var _0x1c4e=['update','emit','removeListener','register','length','dashboard:','save'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x1c4e,0x76));var _0xe1c4=function(_0x5ced8b,_0x5f0335){_0x5ced8b=_0x5ced8b-0x0;var _0x535973=_0x1c4e[_0x5ced8b];return _0x535973;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xe1c4('0x0'),'remove',_0xe1c4('0x1')];function createListener(_0x4e1726,_0x425a46){return function(_0x36220f){_0x425a46[_0xe1c4('0x2')](_0x4e1726,_0x36220f);};}function removeListener(_0x57118e,_0x130ec4){return function(){DashboardEvents[_0xe1c4('0x3')](_0x57118e,_0x130ec4);};}exports[_0xe1c4('0x4')]=function(_0x5f4a13){for(var _0x174131=0x0,_0x4bdef2=events[_0xe1c4('0x5')];_0x174131<_0x4bdef2;_0x174131++){var _0x17cc88=events[_0x174131];var _0x5e1bdb=createListener(_0xe1c4('0x6')+_0x17cc88,_0x5f4a13);DashboardEvents['on'](_0x17cc88,_0x5e1bdb);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1cadaaf..888cc1f 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 _0x24f2=['../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/items','post','/:id/clone','clone','addItem','update','delete','destroy','path','connect-timeout','express'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x24f2,0x85));var _0x224f=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x24f2[_0x11946c];return _0x383935;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x224f('0x0'));var timeout=require(_0x224f('0x1'));var express=require(_0x224f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x224f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x224f('0x4'));var controller=require('./dashboard.controller');router[_0x224f('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x224f('0x5')](_0x224f('0x6'),auth[_0x224f('0x7')](),controller[_0x224f('0x8')]);router[_0x224f('0x5')](_0x224f('0x9'),auth[_0x224f('0x7')](),controller['getItems']);router[_0x224f('0xa')]('/',auth[_0x224f('0x7')](),controller['create']);router[_0x224f('0xa')](_0x224f('0xb'),auth[_0x224f('0x7')](),controller[_0x224f('0xc')]);router['post'](_0x224f('0x9'),auth['isAuthenticated'](),controller[_0x224f('0xd')]);router['put'](_0x224f('0x6'),auth['isAuthenticated'](),controller[_0x224f('0xe')]);router[_0x224f('0xf')](_0x224f('0x6'),auth[_0x224f('0x7')](),controller[_0x224f('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdfcd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','getItems','post','create','/:id/clone','/:id/items','addItem','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x308838,_0x2ca31b){var _0x3eeaec=function(_0x5d9a4b){while(--_0x5d9a4b){_0x308838['push'](_0x308838['shift']());}};_0x3eeaec(++_0x2ca31b);}(_0xdfcd,0x8b));var _0xddfc=function(_0x2b7969,_0x34e312){_0x2b7969=_0x2b7969-0x0;var _0x1c8e22=_0xdfcd[_0x2b7969];return _0x1c8e22;};'use strict';var multer=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var path=require(_0xddfc('0x2'));var timeout=require('connect-timeout');var express=require(_0xddfc('0x3'));var router=express[_0xddfc('0x4')]();var fs_extra=require(_0xddfc('0x5'));var auth=require(_0xddfc('0x6'));var interaction=require(_0xddfc('0x7'));var config=require(_0xddfc('0x8'));var controller=require(_0xddfc('0x9'));router[_0xddfc('0xa')]('/',auth['isAuthenticated'](),controller[_0xddfc('0xb')]);router[_0xddfc('0xa')](_0xddfc('0xc'),auth[_0xddfc('0xd')](),controller[_0xddfc('0xe')]);router[_0xddfc('0xa')]('/:id/items',auth[_0xddfc('0xd')](),controller[_0xddfc('0xf')]);router[_0xddfc('0x10')]('/',auth['isAuthenticated'](),controller[_0xddfc('0x11')]);router[_0xddfc('0x10')](_0xddfc('0x12'),auth[_0xddfc('0xd')](),controller['clone']);router[_0xddfc('0x10')](_0xddfc('0x13'),auth[_0xddfc('0xd')](),controller[_0xddfc('0x14')]);router['put'](_0xddfc('0xc'),auth[_0xddfc('0xd')](),controller['update']);router[_0xddfc('0x15')](_0xddfc('0xc'),auth[_0xddfc('0xd')](),controller[_0xddfc('0x16')]);module[_0xddfc('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 396e8fe..8a31d48 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 _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x480369,_0x21cc0d){var _0x3d90d5=function(_0x137fa2){while(--_0x137fa2){_0x480369['push'](_0x480369['shift']());}};_0x3d90d5(++_0x21cc0d);}(_0xafc4,0x69));var _0x4afc=function(_0x52bea8,_0x35814f){_0x52bea8=_0x52bea8-0x0;var _0x211f07=_0xafc4[_0x52bea8];return _0x211f07;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5d17=['#ffffff','sequelize','squel','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x5d17,0x114));var _0x75d1=function(_0x2badac,_0x4b93fa){_0x2badac=_0x2badac-0x0;var _0x28276c=_0x5d17[_0x2badac];return _0x28276c;};'use strict';var Sequelize=require(_0x75d1('0x0'));var squel=require(_0x75d1('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75d1('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x75d1('0x3')]('long'),'get':function(){try{return JSON[_0x75d1('0x4')](this[_0x75d1('0x5')](_0x75d1('0x6')));}catch(_0x32bd45){return[];}},'set':function(_0x56ac0a){try{this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')](_0x56ac0a));}catch(_0x1ee61b){this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x75d1('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x75d1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x75d1('0x2')]},'titleFontSize':{'type':Sequelize[_0x75d1('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 91fb7ae..8aba2e5 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 _0xd47f=['sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','reject','save','then','destroy','error','stack','name','send','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','options','DashboardItem','find','catch','iframe','attrUrl','attrs','https://','attrPath','attrHourFormat','value','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','socket.io-emitter','./dashboardItem.socket'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0xd47f,0x1bd));var _0xfd47=function(_0x2f421,_0x5144c4){_0x2f421=_0x2f421-0x0;var _0x27b4af=_0xd47f[_0x2f421];return _0x27b4af;};'use strict';var emlformat=require(_0xfd47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd47('0x1'));var jsonpatch=require(_0xfd47('0x2'));var rp=require(_0xfd47('0x3'));var moment=require(_0xfd47('0x4'));var BPromise=require(_0xfd47('0x5'));var Mustache=require(_0xfd47('0x6'));var util=require(_0xfd47('0x7'));var path=require(_0xfd47('0x8'));var sox=require(_0xfd47('0x9'));var csv=require(_0xfd47('0xa'));var ejs=require(_0xfd47('0xb'));var fs=require('fs');var fs_extra=require(_0xfd47('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfd47('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd47('0xe'));var Papa=require(_0xfd47('0xf'));var Redis=require(_0xfd47('0x10'));var authService=require(_0xfd47('0x11'));var qs=require(_0xfd47('0x12'));var as=require(_0xfd47('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd47('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd47('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xfd47('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd47('0x17'))(new Redis(config[_0xfd47('0x16')]));require(_0xfd47('0x18'))['register'](socket);function respondWithStatusCode(_0x1cd77f,_0x13fc51){_0x13fc51=_0x13fc51||0xcc;return function(_0x6e24f5){if(_0x6e24f5){return _0x1cd77f[_0xfd47('0x19')](_0x13fc51);}return _0x1cd77f['status'](_0x13fc51)[_0xfd47('0x1a')]();};}function respondWithResult(_0x1011a3,_0x11300b){_0x11300b=_0x11300b||0xc8;return function(_0x502836){if(_0x502836){return _0x1011a3['status'](_0x11300b)[_0xfd47('0x1b')](_0x502836);}};}function respondWithFilteredResult(_0xf8e74b,_0x413fa3){return function(_0xf1bbb){if(_0xf1bbb){var _0x1903c8=typeof _0x413fa3['offset']===_0xfd47('0x1c')&&typeof _0x413fa3[_0xfd47('0x1d')]===_0xfd47('0x1c');var _0x231106=_0xf1bbb[_0xfd47('0x1e')];var _0x3e2d03=_0x1903c8?0x0:_0x413fa3['offset'];var _0x1af7bf=_0x1903c8?_0xf1bbb['count']:_0x413fa3[_0xfd47('0x1f')]+_0x413fa3[_0xfd47('0x1d')];var _0x4153f6;if(_0x1af7bf>=_0x231106){_0x1af7bf=_0x231106;_0x4153f6=0xc8;}else{_0x4153f6=0xce;}_0xf8e74b[_0xfd47('0x20')](_0x4153f6);return _0xf8e74b['set'](_0xfd47('0x21'),_0x3e2d03+'-'+_0x1af7bf+'/'+_0x231106)[_0xfd47('0x1b')](_0xf1bbb);}return null;};}function patchUpdates(_0x943c8a){return function(_0x1c4458){try{jsonpatch['apply'](_0x1c4458,_0x943c8a,!![]);}catch(_0x511dbd){return BPromise[_0xfd47('0x22')](_0x511dbd);}return _0x1c4458[_0xfd47('0x23')]();};}function saveUpdates(_0x4395ba,_0x42105a){return function(_0x1e3361){if(_0x1e3361){return _0x1e3361['update'](_0x4395ba)[_0xfd47('0x24')](function(_0x5ca823){return _0x5ca823;});}return null;};}function removeEntity(_0x48ec3a,_0x26e5fa){return function(_0x1071e6){if(_0x1071e6){return _0x1071e6[_0xfd47('0x25')]()[_0xfd47('0x24')](function(){_0x48ec3a[_0xfd47('0x20')](0xcc)[_0xfd47('0x1a')]();});}};}function handleEntityNotFound(_0x504ce5,_0x392669){return function(_0x33072e){if(!_0x33072e){_0x504ce5[_0xfd47('0x19')](0x194);}return _0x33072e;};}function handleError(_0x36a482,_0x847192){_0x847192=_0x847192||0x1f4;return function(_0x4c9a78){logger[_0xfd47('0x26')](_0x4c9a78[_0xfd47('0x27')]);if(_0x4c9a78[_0xfd47('0x28')]){delete _0x4c9a78[_0xfd47('0x28')];}_0x36a482[_0xfd47('0x20')](_0x847192)[_0xfd47('0x29')](_0x4c9a78);};}exports['show']=function(_0x30da0b,_0x3d415b){var _0x148b9f={'raw':![],'where':{'id':_0x30da0b[_0xfd47('0x2a')]['id']}},_0x55bc70={};_0x55bc70['model']=_[_0xfd47('0x2b')](db['DashboardItem'][_0xfd47('0x2c')]);_0x55bc70[_0xfd47('0x2d')]=_['keys'](_0x30da0b[_0xfd47('0x2d')]);_0x55bc70[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x55bc70[_0xfd47('0x30')],_0x55bc70[_0xfd47('0x2d')]);_0x148b9f[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x55bc70['model'],qs[_0xfd47('0x32')](_0x30da0b[_0xfd47('0x2d')]['fields']));_0x148b9f[_0xfd47('0x31')]=_0x148b9f[_0xfd47('0x31')][_0xfd47('0x33')]?_0x148b9f['attributes']:_0x55bc70[_0xfd47('0x30')];if(_0x30da0b['query'][_0xfd47('0x34')]){_0x148b9f[_0xfd47('0x35')]=[{'all':!![]}];}_0x148b9f=_['merge']({},_0x148b9f,_0x30da0b[_0xfd47('0x36')]);return db[_0xfd47('0x37')][_0xfd47('0x38')](_0x148b9f)['then'](handleEntityNotFound(_0x3d415b,null))[_0xfd47('0x24')](respondWithResult(_0x3d415b,null))[_0xfd47('0x39')](handleError(_0x3d415b,null));};exports[_0xfd47('0x25')]=function(_0x55ac41,_0xd8e9fe){return db[_0xfd47('0x37')]['find']({'where':{'id':_0x55ac41[_0xfd47('0x2a')]['id']}})[_0xfd47('0x24')](handleEntityNotFound(_0xd8e9fe,null))['then'](removeEntity(_0xd8e9fe,null))['catch'](handleError(_0xd8e9fe,null));};function widgetAttributes(_0x114050){try{switch(_0x114050['type']){case _0xfd47('0x3a'):return[{'name':'attrUrl','value':_0x114050[_0xfd47('0x3b')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050['attrs'][0x0]?_0x114050[_0xfd47('0x3c')][0x0]['value']:undefined)||_0xfd47('0x3d')}];case'custom':return[{'name':_0xfd47('0x3e'),'value':_0x114050['attrPath']||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x0]?_0x114050[_0xfd47('0x3c')][0x0]['value']:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x114050[_0xfd47('0x3f')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x0]?_0x114050[_0xfd47('0x3c')][0x0][_0xfd47('0x40')]:undefined)||'HH:mm:ss'},{'name':_0xfd47('0x41'),'value':_0x114050[_0xfd47('0x41')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x1]?_0x114050[_0xfd47('0x3c')][0x1][_0xfd47('0x40')]:undefined)||_0xfd47('0x42')},{'name':_0xfd47('0x43'),'value':_0x114050[_0xfd47('0x43')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x2]?_0x114050[_0xfd47('0x3c')][0x2]['value']:undefined)||0xc}];case _0xfd47('0x44'):return[{'name':_0xfd47('0x45'),'value':_0x114050[_0xfd47('0x45')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x0]?_0x114050[_0xfd47('0x3c')][0x0]['value']:undefined)||_0xfd47('0x46')},{'name':_0xfd47('0x47'),'value':_0x114050[_0xfd47('0x47')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x1]?_0x114050[_0xfd47('0x3c')][0x1][_0xfd47('0x40')]:undefined)||[]},{'name':_0xfd47('0x43'),'value':_0x114050[_0xfd47('0x43')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x2]?_0x114050['attrs'][0x2][_0xfd47('0x40')]:undefined)||0x14},{'name':_0xfd47('0x48'),'value':_0x114050[_0xfd47('0x48')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x3]?_0x114050['attrs'][0x3][_0xfd47('0x40')]:undefined)||_0xfd47('0x49')},{'name':'attrEmailAccounts','value':_0x114050[_0xfd47('0x4a')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x4]?_0x114050[_0xfd47('0x3c')][0x4]['value']:undefined)||''},{'name':_0xfd47('0x4b'),'value':_0x114050['attrFaxAccounts']||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x5]?_0x114050[_0xfd47('0x3c')][0x5]['value']:undefined)||''},{'name':_0xfd47('0x4c'),'value':_0x114050[_0xfd47('0x4c')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x6]?_0x114050[_0xfd47('0x3c')][0x6][_0xfd47('0x40')]:undefined)||''},{'name':_0xfd47('0x4d'),'value':_0x114050[_0xfd47('0x4d')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x7]?_0x114050[_0xfd47('0x3c')][0x7][_0xfd47('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x114050['attrWhatsappAccounts']||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x8]?_0x114050['attrs'][0x8][_0xfd47('0x40')]:undefined)||''},{'name':_0xfd47('0x4e'),'value':_0x114050[_0xfd47('0x4e')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050['attrs'][0x9]?_0x114050[_0xfd47('0x3c')][0x9][_0xfd47('0x40')]:undefined)||''}];case _0xfd47('0x4f'):case'pie-chart':return[{'name':_0xfd47('0x50'),'value':_0x114050[_0xfd47('0x50')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x0]?_0x114050['attrs'][0x0][_0xfd47('0x40')]:undefined)||_0xfd47('0x46')},{'name':_0xfd47('0x51'),'value':_0x114050['attrSerie2']||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x1]?_0x114050[_0xfd47('0x3c')][0x1][_0xfd47('0x40')]:undefined)||null},{'name':_0xfd47('0x52'),'value':_0x114050[_0xfd47('0x52')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x2]?_0x114050[_0xfd47('0x3c')][0x2][_0xfd47('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x114050['attrVoiceQueues']||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x3]?_0x114050[_0xfd47('0x3c')][0x3][_0xfd47('0x40')]:undefined)||[]},{'name':_0xfd47('0x48'),'value':_0x114050[_0xfd47('0x48')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x4]?_0x114050[_0xfd47('0x3c')][0x4][_0xfd47('0x40')]:undefined)||_0xfd47('0x49')},{'name':_0xfd47('0x4a'),'value':_0x114050['attrEmailAccounts']||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x5]?_0x114050[_0xfd47('0x3c')][0x5]['value']:undefined)||''},{'name':_0xfd47('0x4b'),'value':_0x114050['attrFaxAccounts']||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x6]?_0x114050[_0xfd47('0x3c')][0x6][_0xfd47('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x114050[_0xfd47('0x4c')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x7]?_0x114050[_0xfd47('0x3c')][0x7][_0xfd47('0x40')]:undefined)||''},{'name':_0xfd47('0x4d'),'value':_0x114050[_0xfd47('0x4d')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x8]?_0x114050[_0xfd47('0x3c')][0x8][_0xfd47('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x114050[_0xfd47('0x53')]||(_0x114050['attrs']&&_0x114050[_0xfd47('0x3c')][0x9]?_0x114050[_0xfd47('0x3c')][0x9][_0xfd47('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x114050[_0xfd47('0x4e')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0xa]?_0x114050[_0xfd47('0x3c')][0xa]['value']:undefined)||''}];case _0xfd47('0x54'):return[{'name':_0xfd47('0x55'),'type':_0x114050[_0xfd47('0x56')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050[_0xfd47('0x3c')][0x0]?_0x114050[_0xfd47('0x3c')][0x0][_0xfd47('0x57')]:undefined)||null,'value':_0x114050[_0xfd47('0x55')]||(_0x114050[_0xfd47('0x3c')]&&_0x114050['attrs'][0x0]?_0x114050[_0xfd47('0x3c')][0x0][_0xfd47('0x40')]:undefined)||null},{'name':_0xfd47('0x58'),'value':_0x114050[_0xfd47('0x58')]||(_0x114050['attrs']&&_0x114050['attrs'][0x1]?_0x114050[_0xfd47('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x326ec5){logger[_0xfd47('0x26')](_0xfd47('0x59'),JSON[_0xfd47('0x5a')](_0x326ec5));return[];}}exports[_0xfd47('0x5b')]=function(_0x3b347a,_0x260ee4){if(_0x3b347a[_0xfd47('0x5c')]){_0x3b347a['body']['attrs']=widgetAttributes(_0x3b347a[_0xfd47('0x5c')]);}return db[_0xfd47('0x37')][_0xfd47('0x5b')](_0x3b347a[_0xfd47('0x5c')],{})[_0xfd47('0x24')](respondWithResult(_0x260ee4,0xc9))[_0xfd47('0x39')](handleError(_0x260ee4,null));};exports[_0xfd47('0x5d')]=function(_0x3dd930,_0x1514a7){if(_0x3dd930[_0xfd47('0x5c')]['id']){delete _0x3dd930[_0xfd47('0x5c')]['id'];}_0x3dd930[_0xfd47('0x5c')][_0xfd47('0x3c')]=widgetAttributes(_0x3dd930['body']);return db['DashboardItem'][_0xfd47('0x38')]({'where':{'id':_0x3dd930['params']['id']}})[_0xfd47('0x24')](handleEntityNotFound(_0x1514a7,null))[_0xfd47('0x24')](saveUpdates(_0x3dd930['body'],null))['then'](respondWithResult(_0x1514a7,null))[_0xfd47('0x39')](handleError(_0x1514a7,null));}; \ No newline at end of file +var _0x1c75=['attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','attrFaxAccounts','web-report','attrReport','reportType','attrRefresh','stringify','create','body','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','DashboardItem','find','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x22a835,_0x7e1873){var _0x894890=function(_0x274b0a){while(--_0x274b0a){_0x22a835['push'](_0x22a835['shift']());}};_0x894890(++_0x7e1873);}(_0x1c75,0xce));var _0x51c7=function(_0xa1f3d9,_0x2a0fa4){_0xa1f3d9=_0xa1f3d9-0x0;var _0x5dcb0a=_0x1c75[_0xa1f3d9];return _0x5dcb0a;};'use strict';var emlformat=require(_0x51c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51c7('0x1'));var moment=require(_0x51c7('0x2'));var BPromise=require(_0x51c7('0x3'));var Mustache=require(_0x51c7('0x4'));var util=require(_0x51c7('0x5'));var path=require(_0x51c7('0x6'));var sox=require(_0x51c7('0x7'));var csv=require(_0x51c7('0x8'));var ejs=require(_0x51c7('0x9'));var fs=require('fs');var fs_extra=require(_0x51c7('0xa'));var _=require(_0x51c7('0xb'));var squel=require('squel');var crypto=require(_0x51c7('0xc'));var jsforce=require(_0x51c7('0xd'));var deskjs=require(_0x51c7('0xe'));var toCsv=require(_0x51c7('0x8'));var querystring=require('querystring');var Papa=require(_0x51c7('0xf'));var Redis=require('ioredis');var authService=require(_0x51c7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x51c7('0x11'));var hardwareService=require(_0x51c7('0x12'));var logger=require('../../config/logger')(_0x51c7('0x13'));var utils=require(_0x51c7('0x14'));var config=require(_0x51c7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x51c7('0x16')](config[_0x51c7('0x17')],{'host':_0x51c7('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x51c7('0x17')]));require('./dashboardItem.socket')[_0x51c7('0x19')](socket);function respondWithStatusCode(_0x5a5ea9,_0x2e54af){_0x2e54af=_0x2e54af||0xcc;return function(_0x48f08a){if(_0x48f08a){return _0x5a5ea9[_0x51c7('0x1a')](_0x2e54af);}return _0x5a5ea9[_0x51c7('0x1b')](_0x2e54af)[_0x51c7('0x1c')]();};}function respondWithResult(_0x39da99,_0x521d8a){_0x521d8a=_0x521d8a||0xc8;return function(_0x177e14){if(_0x177e14){return _0x39da99[_0x51c7('0x1b')](_0x521d8a)[_0x51c7('0x1d')](_0x177e14);}};}function respondWithFilteredResult(_0x3079b7,_0x209ab3){return function(_0x36b29a){if(_0x36b29a){var _0x4a64e4=typeof _0x209ab3[_0x51c7('0x1e')]===_0x51c7('0x1f')&&typeof _0x209ab3[_0x51c7('0x20')]==='undefined';var _0x3c1f43=_0x36b29a[_0x51c7('0x21')];var _0x51f751=_0x4a64e4?0x0:_0x209ab3['offset'];var _0x1fa9d5=_0x4a64e4?_0x36b29a[_0x51c7('0x21')]:_0x209ab3[_0x51c7('0x1e')]+_0x209ab3[_0x51c7('0x20')];var _0x4072b9;if(_0x1fa9d5>=_0x3c1f43){_0x1fa9d5=_0x3c1f43;_0x4072b9=0xc8;}else{_0x4072b9=0xce;}_0x3079b7[_0x51c7('0x1b')](_0x4072b9);return _0x3079b7[_0x51c7('0x22')]('Content-Range',_0x51f751+'-'+_0x1fa9d5+'/'+_0x3c1f43)[_0x51c7('0x1d')](_0x36b29a);}return null;};}function patchUpdates(_0x11c83d){return function(_0x4e0108){try{jsonpatch[_0x51c7('0x23')](_0x4e0108,_0x11c83d,!![]);}catch(_0x48b259){return BPromise[_0x51c7('0x24')](_0x48b259);}return _0x4e0108[_0x51c7('0x25')]();};}function saveUpdates(_0x414de0,_0x48e6e6){return function(_0x11f01f){if(_0x11f01f){return _0x11f01f[_0x51c7('0x26')](_0x414de0)[_0x51c7('0x27')](function(_0x13a3ad){return _0x13a3ad;});}return null;};}function removeEntity(_0x44de99,_0x1c3935){return function(_0x57fe70){if(_0x57fe70){return _0x57fe70[_0x51c7('0x28')]()['then'](function(){_0x44de99[_0x51c7('0x1b')](0xcc)[_0x51c7('0x1c')]();});}};}function handleEntityNotFound(_0x331ad9,_0x1c29fb){return function(_0x375a70){if(!_0x375a70){_0x331ad9[_0x51c7('0x1a')](0x194);}return _0x375a70;};}function handleError(_0x32ac6e,_0x198465){_0x198465=_0x198465||0x1f4;return function(_0x42745b){logger[_0x51c7('0x29')](_0x42745b[_0x51c7('0x2a')]);if(_0x42745b[_0x51c7('0x2b')]){delete _0x42745b['name'];}_0x32ac6e[_0x51c7('0x1b')](_0x198465)[_0x51c7('0x2c')](_0x42745b);};}exports[_0x51c7('0x2d')]=function(_0x2eebb4,_0x588fbb){var _0x21ff27={'raw':![],'where':{'id':_0x2eebb4[_0x51c7('0x2e')]['id']}},_0x5e90bc={};_0x5e90bc[_0x51c7('0x2f')]=_[_0x51c7('0x30')](db['DashboardItem'][_0x51c7('0x31')]);_0x5e90bc['query']=_[_0x51c7('0x30')](_0x2eebb4[_0x51c7('0x32')]);_0x5e90bc[_0x51c7('0x33')]=_[_0x51c7('0x34')](_0x5e90bc[_0x51c7('0x2f')],_0x5e90bc[_0x51c7('0x32')]);_0x21ff27[_0x51c7('0x35')]=_[_0x51c7('0x34')](_0x5e90bc[_0x51c7('0x2f')],qs[_0x51c7('0x36')](_0x2eebb4['query'][_0x51c7('0x36')]));_0x21ff27['attributes']=_0x21ff27[_0x51c7('0x35')][_0x51c7('0x37')]?_0x21ff27['attributes']:_0x5e90bc[_0x51c7('0x2f')];if(_0x2eebb4[_0x51c7('0x32')][_0x51c7('0x38')]){_0x21ff27[_0x51c7('0x39')]=[{'all':!![]}];}_0x21ff27=_['merge']({},_0x21ff27,_0x2eebb4[_0x51c7('0x3a')]);return db[_0x51c7('0x3b')][_0x51c7('0x3c')](_0x21ff27)[_0x51c7('0x27')](handleEntityNotFound(_0x588fbb,null))['then'](respondWithResult(_0x588fbb,null))[_0x51c7('0x3d')](handleError(_0x588fbb,null));};exports[_0x51c7('0x28')]=function(_0x13fa10,_0x39ba1e){return db[_0x51c7('0x3b')]['find']({'where':{'id':_0x13fa10[_0x51c7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x39ba1e,null))[_0x51c7('0x27')](removeEntity(_0x39ba1e,null))['catch'](handleError(_0x39ba1e,null));};function widgetAttributes(_0x12f54c){try{switch(_0x12f54c[_0x51c7('0x3e')]){case'iframe':return[{'name':_0x51c7('0x3f'),'value':_0x12f54c[_0x51c7('0x3f')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c['attrs'][0x0]['value']:undefined)||_0x51c7('0x41')}];case _0x51c7('0x42'):return[{'name':_0x51c7('0x43'),'value':_0x12f54c[_0x51c7('0x43')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c['attrs'][0x0][_0x51c7('0x44')]:undefined)||''}];case _0x51c7('0x45'):return[{'name':_0x51c7('0x46'),'value':_0x12f54c[_0x51c7('0x46')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x47')},{'name':_0x51c7('0x48'),'value':_0x12f54c[_0x51c7('0x48')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||'0.00'},{'name':_0x51c7('0x49'),'value':_0x12f54c[_0x51c7('0x49')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||0xc}];case _0x51c7('0x4a'):return[{'name':_0x51c7('0x4b'),'value':_0x12f54c[_0x51c7('0x4b')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x0]?_0x12f54c['attrs'][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x4c')},{'name':_0x51c7('0x4d'),'value':_0x12f54c[_0x51c7('0x4d')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||[]},{'name':_0x51c7('0x49'),'value':_0x12f54c['attrFontSize']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x12f54c[_0x51c7('0x4e')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x3]?_0x12f54c[_0x51c7('0x40')][0x3][_0x51c7('0x44')]:undefined)||_0x51c7('0x4f')},{'name':'attrEmailAccounts','value':_0x12f54c['attrEmailAccounts']||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x4]?_0x12f54c[_0x51c7('0x40')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x12f54c['attrFaxAccounts']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x5]?_0x12f54c[_0x51c7('0x40')][0x5][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x50'),'value':_0x12f54c[_0x51c7('0x50')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x6]?_0x12f54c[_0x51c7('0x40')][0x6][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x51'),'value':_0x12f54c[_0x51c7('0x51')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x7]?_0x12f54c[_0x51c7('0x40')][0x7]['value']:undefined)||''},{'name':_0x51c7('0x52'),'value':_0x12f54c[_0x51c7('0x52')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x8]?_0x12f54c[_0x51c7('0x40')][0x8]['value']:undefined)||''},{'name':_0x51c7('0x53'),'value':_0x12f54c[_0x51c7('0x53')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x9]?_0x12f54c[_0x51c7('0x40')][0x9][_0x51c7('0x44')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x51c7('0x54'),'value':_0x12f54c[_0x51c7('0x54')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||_0x51c7('0x4c')},{'name':_0x51c7('0x55'),'value':_0x12f54c[_0x51c7('0x55')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x1]?_0x12f54c[_0x51c7('0x40')][0x1][_0x51c7('0x44')]:undefined)||null},{'name':_0x51c7('0x56'),'value':_0x12f54c[_0x51c7('0x56')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x2]?_0x12f54c[_0x51c7('0x40')][0x2][_0x51c7('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x12f54c['attrVoiceQueues']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x3]?_0x12f54c[_0x51c7('0x40')][0x3][_0x51c7('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x12f54c[_0x51c7('0x4e')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x4]?_0x12f54c[_0x51c7('0x40')][0x4][_0x51c7('0x44')]:undefined)||'voice'},{'name':_0x51c7('0x57'),'value':_0x12f54c[_0x51c7('0x57')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x5]?_0x12f54c['attrs'][0x5]['value']:undefined)||''},{'name':_0x51c7('0x58'),'value':_0x12f54c[_0x51c7('0x58')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x6]?_0x12f54c[_0x51c7('0x40')][0x6][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x50'),'value':_0x12f54c[_0x51c7('0x50')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x7]?_0x12f54c['attrs'][0x7]['value']:undefined)||''},{'name':_0x51c7('0x51'),'value':_0x12f54c['attrOpenchannelAccounts']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x8]?_0x12f54c[_0x51c7('0x40')][0x8][_0x51c7('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x12f54c[_0x51c7('0x52')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c['attrs'][0x9]?_0x12f54c['attrs'][0x9][_0x51c7('0x44')]:undefined)||''},{'name':_0x51c7('0x53'),'value':_0x12f54c['attrChatWebsites']||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0xa]?_0x12f54c[_0x51c7('0x40')][0xa]['value']:undefined)||''}];case _0x51c7('0x59'):return[{'name':_0x51c7('0x5a'),'type':_0x12f54c[_0x51c7('0x5b')]||(_0x12f54c['attrs']&&_0x12f54c['attrs'][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x3e')]:undefined)||null,'value':_0x12f54c[_0x51c7('0x5a')]||(_0x12f54c[_0x51c7('0x40')]&&_0x12f54c[_0x51c7('0x40')][0x0]?_0x12f54c[_0x51c7('0x40')][0x0][_0x51c7('0x44')]:undefined)||null},{'name':_0x51c7('0x5c'),'value':_0x12f54c[_0x51c7('0x5c')]||(_0x12f54c['attrs']&&_0x12f54c[_0x51c7('0x40')][0x1]?_0x12f54c['attrs'][0x1][_0x51c7('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3dabf1){logger[_0x51c7('0x29')]('widgetAttributes:\x20%s',JSON[_0x51c7('0x5d')](_0x3dabf1));return[];}}exports[_0x51c7('0x5e')]=function(_0x354a96,_0x5470b7){if(_0x354a96[_0x51c7('0x5f')]){_0x354a96['body'][_0x51c7('0x40')]=widgetAttributes(_0x354a96[_0x51c7('0x5f')]);}return db['DashboardItem']['create'](_0x354a96['body'],{})[_0x51c7('0x27')](respondWithResult(_0x5470b7,0xc9))[_0x51c7('0x3d')](handleError(_0x5470b7,null));};exports[_0x51c7('0x26')]=function(_0x175bd1,_0x438e7f){if(_0x175bd1[_0x51c7('0x5f')]['id']){delete _0x175bd1[_0x51c7('0x5f')]['id'];}_0x175bd1[_0x51c7('0x5f')][_0x51c7('0x40')]=widgetAttributes(_0x175bd1['body']);return db[_0x51c7('0x3b')][_0x51c7('0x3c')]({'where':{'id':_0x175bd1['params']['id']}})[_0x51c7('0x27')](handleEntityNotFound(_0x438e7f,null))[_0x51c7('0x27')](saveUpdates(_0x175bd1[_0x51c7('0x5f')],null))['then'](respondWithResult(_0x438e7f,null))[_0x51c7('0x3d')](handleError(_0x438e7f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index ddc5559..6db7472 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 _0x45bb=['update','remove','emit','hook','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x45bb,0x79));var _0xb45b=function(_0x4d67e0,_0x5a82fd){_0x4d67e0=_0x4d67e0-0x0;var _0x3b22e9=_0x45bb[_0x4d67e0];return _0x3b22e9;};'use strict';var EventEmitter=require(_0xb45b('0x0'));var DashboardItem=require(_0xb45b('0x1'))['db'][_0xb45b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb45b('0x3')](0x0);var events={'afterCreate':_0xb45b('0x4'),'afterUpdate':_0xb45b('0x5'),'afterDestroy':_0xb45b('0x6')};function emitEvent(_0x431dea){return function(_0xac5ee2,_0x145e7a,_0x2802b0){DashboardItemEvents[_0xb45b('0x7')](_0x431dea+':'+_0xac5ee2['id'],_0xac5ee2);DashboardItemEvents['emit'](_0x431dea,_0xac5ee2);_0x2802b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xb45b('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x3169=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save','update','remove','emit'];(function(_0x35ea2f,_0x285af4){var _0x12962c=function(_0x229a7b){while(--_0x229a7b){_0x35ea2f['push'](_0x35ea2f['shift']());}};_0x12962c(++_0x285af4);}(_0x3169,0x14f));var _0x9316=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0x3169[_0x42e4d7];return _0x346cd8;};'use strict';var EventEmitter=require(_0x9316('0x0'));var DashboardItem=require(_0x9316('0x1'))['db'][_0x9316('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9316('0x3'),'afterUpdate':_0x9316('0x4'),'afterDestroy':_0x9316('0x5')};function emitEvent(_0x469ce6){return function(_0x2b613e,_0x5a9fa8,_0x30b11d){DashboardItemEvents[_0x9316('0x6')](_0x469ce6+':'+_0x2b613e['id'],_0x2b613e);DashboardItemEvents[_0x9316('0x6')](_0x469ce6,_0x2b613e);_0x30b11d(null);};}for(var e in events){if(events[_0x9316('0x7')](e)){var event=events[e];DashboardItem[_0x9316('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index c1b1659..4692dc9 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 _0x46a7=['exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0xd45377,_0x11a82d){var _0x561e5d=function(_0x5a62b6){while(--_0x5a62b6){_0xd45377['push'](_0xd45377['shift']());}};_0x561e5d(++_0x11a82d);}(_0x46a7,0x138));var _0x746a=function(_0x5a11a6,_0x9a46f3){_0x5a11a6=_0x5a11a6-0x0;var _0x3ad743=_0x46a7[_0x5a11a6];return _0x3ad743;};'use strict';var _=require(_0x746a('0x0'));var util=require(_0x746a('0x1'));var logger=require(_0x746a('0x2'))('api');var moment=require(_0x746a('0x3'));var BPromise=require(_0x746a('0x4'));var rp=require(_0x746a('0x5'));var fs=require('fs');var path=require(_0x746a('0x6'));var rimraf=require(_0x746a('0x7'));var config=require(_0x746a('0x8'));var attributes=require(_0x746a('0x9'));module[_0x746a('0xa')]=function(_0x3beda8,_0x18c2b2){return _0x3beda8[_0x746a('0xb')](_0x746a('0xc'),attributes,{'tableName':_0x746a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa85=['api','moment','request-promise','./dashboardItem.attributes','DashboardItem','dashboard_items','util','../../config/logger'];(function(_0x1aec82,_0x5980ba){var _0x10bd0d=function(_0x198be5){while(--_0x198be5){_0x1aec82['push'](_0x1aec82['shift']());}};_0x10bd0d(++_0x5980ba);}(_0xaa85,0x186));var _0x5aa8=function(_0x88c82f,_0x5496a7){_0x88c82f=_0x88c82f-0x0;var _0x4c6256=_0xaa85[_0x88c82f];return _0x4c6256;};'use strict';var _=require('lodash');var util=require(_0x5aa8('0x0'));var logger=require(_0x5aa8('0x1'))(_0x5aa8('0x2'));var moment=require(_0x5aa8('0x3'));var BPromise=require('bluebird');var rp=require(_0x5aa8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5aa8('0x5'));module['exports']=function(_0x89abe1,_0x1c20ab){return _0x89abe1['define'](_0x5aa8('0x6'),attributes,{'tableName':_0x5aa8('0x7'),'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 fc4226a..4b39914 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 _0x56ba=['defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','redis'];(function(_0xd1fbe6,_0x184f7a){var _0x284720=function(_0x3d532c){while(--_0x3d532c){_0xd1fbe6['push'](_0xd1fbe6['shift']());}};_0x284720(++_0x184f7a);}(_0x56ba,0xe0));var _0xa56b=function(_0x538312,_0x512285){_0x538312=_0x538312-0x0;var _0x1619b3=_0x56ba[_0x538312];return _0x1619b3;};'use strict';var _=require(_0xa56b('0x0'));var util=require(_0xa56b('0x1'));var moment=require(_0xa56b('0x2'));var BPromise=require(_0xa56b('0x3'));var rs=require(_0xa56b('0x4'));var fs=require('fs');var Redis=require(_0xa56b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa56b('0x6'));var logger=require(_0xa56b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa56b('0x8')]({'port':0x232a});config[_0xa56b('0x9')]=_[_0xa56b('0xa')](config[_0xa56b('0x9')],{'host':_0xa56b('0xb'),'port':0x18eb});var socket=require(_0xa56b('0xc'))(new Redis(config[_0xa56b('0x9')]));require(_0xa56b('0xd'))[_0xa56b('0xe')](socket);function respondWithRpcPromise(_0x409a54,_0x5ecc28,_0x180ef9){return new BPromise(function(_0x30f85d,_0x229654){return client['request'](_0x409a54,_0x180ef9)[_0xa56b('0xf')](function(_0x560152){logger[_0xa56b('0x10')](_0xa56b('0x11'),_0x5ecc28,_0xa56b('0x12'));logger[_0xa56b('0x13')](_0xa56b('0x14'),_0x5ecc28,_0xa56b('0x12'),JSON['stringify'](_0x560152));if(_0x560152[_0xa56b('0x15')]){if(_0x560152['error'][_0xa56b('0x16')]===0x1f4){logger[_0xa56b('0x15')](_0xa56b('0x11'),_0x5ecc28,_0x560152['error'][_0xa56b('0x17')]);return _0x229654(_0x560152['error'][_0xa56b('0x17')]);}logger[_0xa56b('0x15')](_0xa56b('0x11'),_0x5ecc28,_0x560152[_0xa56b('0x15')][_0xa56b('0x17')]);return _0x30f85d(_0x560152[_0xa56b('0x15')][_0xa56b('0x17')]);}else{logger['info'](_0xa56b('0x11'),_0x5ecc28,_0xa56b('0x12'));_0x30f85d(_0x560152[_0xa56b('0x18')][_0xa56b('0x17')]);}})[_0xa56b('0x19')](function(_0x51ac78){logger['error']('DashboardItem,\x20%s,\x20%s',_0x5ecc28,_0x51ac78);_0x229654(_0x51ac78);});});} \ No newline at end of file +var _0x6534=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x56a964,_0x4e0409){var _0x1538b6=function(_0x104008){while(--_0x104008){_0x56a964['push'](_0x56a964['shift']());}};_0x1538b6(++_0x4e0409);}(_0x6534,0x1f0));var _0x4653=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6534[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4653('0x0'));var util=require(_0x4653('0x1'));var moment=require('moment');var BPromise=require(_0x4653('0x2'));var rs=require(_0x4653('0x3'));var fs=require('fs');var Redis=require(_0x4653('0x4'));var db=require(_0x4653('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4653('0x6'))(_0x4653('0x7'));var config=require(_0x4653('0x8'));var jayson=require(_0x4653('0x9'));var client=jayson[_0x4653('0xa')][_0x4653('0xb')]({'port':0x232a});config[_0x4653('0xc')]=_[_0x4653('0xd')](config[_0x4653('0xc')],{'host':_0x4653('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4653('0xc')]));require('./dashboardItem.socket')[_0x4653('0xf')](socket);function respondWithRpcPromise(_0x3962d0,_0x2c0aa9,_0x57dce6){return new BPromise(function(_0x19e7d1,_0x12ba85){return client[_0x4653('0x10')](_0x3962d0,_0x57dce6)[_0x4653('0x11')](function(_0x130a2d){logger[_0x4653('0x12')](_0x4653('0x13'),_0x2c0aa9,_0x4653('0x14'));logger[_0x4653('0x15')](_0x4653('0x16'),_0x2c0aa9,_0x4653('0x14'),JSON[_0x4653('0x17')](_0x130a2d));if(_0x130a2d[_0x4653('0x18')]){if(_0x130a2d[_0x4653('0x18')][_0x4653('0x19')]===0x1f4){logger[_0x4653('0x18')](_0x4653('0x13'),_0x2c0aa9,_0x130a2d[_0x4653('0x18')][_0x4653('0x1a')]);return _0x12ba85(_0x130a2d[_0x4653('0x18')][_0x4653('0x1a')]);}logger[_0x4653('0x18')](_0x4653('0x13'),_0x2c0aa9,_0x130a2d[_0x4653('0x18')][_0x4653('0x1a')]);return _0x19e7d1(_0x130a2d[_0x4653('0x18')]['message']);}else{logger['info'](_0x4653('0x13'),_0x2c0aa9,_0x4653('0x14'));_0x19e7d1(_0x130a2d[_0x4653('0x1b')][_0x4653('0x1a')]);}})[_0x4653('0x1c')](function(_0x16e215){logger[_0x4653('0x18')](_0x4653('0x13'),_0x2c0aa9,_0x16e215);_0x12ba85(_0x16e215);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 6e88fcb..cca683f 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 _0xece2=['register','length','./dashboardItem.events','remove','emit','removeListener'];(function(_0x1eb7d0,_0x298541){var _0x572da5=function(_0x27d36f){while(--_0x27d36f){_0x1eb7d0['push'](_0x1eb7d0['shift']());}};_0x572da5(++_0x298541);}(_0xece2,0xec));var _0x2ece=function(_0xbb411d,_0x114344){_0xbb411d=_0xbb411d-0x0;var _0x5e16e7=_0xece2[_0xbb411d];return _0x5e16e7;};'use strict';var DashboardItemEvents=require(_0x2ece('0x0'));var events=['save',_0x2ece('0x1'),'update'];function createListener(_0x5e2e37,_0x247616){return function(_0x529998){_0x247616[_0x2ece('0x2')](_0x5e2e37,_0x529998);};}function removeListener(_0x4d9dbf,_0x4e8ee7){return function(){DashboardItemEvents[_0x2ece('0x3')](_0x4d9dbf,_0x4e8ee7);};}exports[_0x2ece('0x4')]=function(_0xad4981){for(var _0x5a0e46=0x0,_0x1dd7c0=events[_0x2ece('0x5')];_0x5a0e46<_0x1dd7c0;_0x5a0e46++){var _0x2dc587=events[_0x5a0e46];var _0xbcf030=createListener('dashboardItem:'+_0x2dc587,_0xad4981);DashboardItemEvents['on'](_0x2dc587,_0xbcf030);}}; \ No newline at end of file +var _0x555d=['./dashboardItem.events','remove','update','removeListener','register'];(function(_0x3ee573,_0xc9a7f4){var _0x335d5d=function(_0x2a48ed){while(--_0x2a48ed){_0x3ee573['push'](_0x3ee573['shift']());}};_0x335d5d(++_0xc9a7f4);}(_0x555d,0x172));var _0xd555=function(_0x2efbaa,_0x5e7e15){_0x2efbaa=_0x2efbaa-0x0;var _0x284c8e=_0x555d[_0x2efbaa];return _0x284c8e;};'use strict';var DashboardItemEvents=require(_0xd555('0x0'));var events=['save',_0xd555('0x1'),_0xd555('0x2')];function createListener(_0xc1ac7,_0xa5f905){return function(_0x57bf18){_0xa5f905['emit'](_0xc1ac7,_0x57bf18);};}function removeListener(_0x4ccec3,_0x2b0406){return function(){DashboardItemEvents[_0xd555('0x3')](_0x4ccec3,_0x2b0406);};}exports[_0xd555('0x4')]=function(_0x475281){for(var _0x1cb49d=0x0,_0x5a8656=events['length'];_0x1cb49d<_0x5a8656;_0x1cb49d++){var _0x201698=events[_0x1cb49d];var _0x41d8e3=createListener('dashboardItem:'+_0x201698,_0x475281);DashboardItemEvents['on'](_0x201698,_0x41d8e3);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 1053514..b7bdf15 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 _0xfc98=['Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x68eb93,_0x5710e7){var _0x1268fa=function(_0x5b6d10){while(--_0x5b6d10){_0x68eb93['push'](_0x68eb93['shift']());}};_0x1268fa(++_0x5710e7);}(_0xfc98,0xda));var _0x8fc9=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xfc98[_0x31ced5];return _0x10d9e5;};'use strict';var multer=require(_0x8fc9('0x0'));var util=require('util');var path=require(_0x8fc9('0x1'));var timeout=require(_0x8fc9('0x2'));var express=require('express');var router=express[_0x8fc9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8fc9('0x4'));var config=require(_0x8fc9('0x5'));var controller=require(_0x8fc9('0x6'));router[_0x8fc9('0x7')](_0x8fc9('0x8'),auth[_0x8fc9('0x9')](),controller[_0x8fc9('0xa')]);router[_0x8fc9('0xb')]('/',auth[_0x8fc9('0x9')](),controller[_0x8fc9('0xc')]);router[_0x8fc9('0xd')](_0x8fc9('0x8'),auth[_0x8fc9('0x9')](),controller[_0x8fc9('0xe')]);router['delete'](_0x8fc9('0x8'),auth['isAuthenticated'](),controller[_0x8fc9('0xf')]);module[_0x8fc9('0x10')]=router; \ No newline at end of file +var _0xd118=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x7beee0,_0x276758){var _0x2f92bc=function(_0xef1085){while(--_0xef1085){_0x7beee0['push'](_0x7beee0['shift']());}};_0x2f92bc(++_0x276758);}(_0xd118,0x141));var _0x8d11=function(_0x5a6b2c,_0x59263a){_0x5a6b2c=_0x5a6b2c-0x0;var _0x5abdba=_0xd118[_0x5a6b2c];return _0x5abdba;};'use strict';var multer=require(_0x8d11('0x0'));var util=require(_0x8d11('0x1'));var path=require('path');var timeout=require(_0x8d11('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d11('0x3'));var auth=require(_0x8d11('0x4'));var interaction=require(_0x8d11('0x5'));var config=require(_0x8d11('0x6'));var controller=require(_0x8d11('0x7'));router[_0x8d11('0x8')](_0x8d11('0x9'),auth[_0x8d11('0xa')](),controller[_0x8d11('0xb')]);router[_0x8d11('0xc')]('/',auth[_0x8d11('0xa')](),controller[_0x8d11('0xd')]);router[_0x8d11('0xe')](_0x8d11('0x9'),auth[_0x8d11('0xa')](),controller['update']);router[_0x8d11('0xf')]('/:id',auth[_0x8d11('0xa')](),controller[_0x8d11('0x10')]);module[_0x8d11('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d0307ec..e35dc6c 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 _0x8c4c=['first','second','sequelize','exports','STRING','ENUM'];(function(_0x4276f6,_0x4d2756){var _0x53aaf9=function(_0x26e349){while(--_0x26e349){_0x4276f6['push'](_0x4276f6['shift']());}};_0x53aaf9(++_0x4d2756);}(_0x8c4c,0x110));var _0xc8c4=function(_0x460039,_0x5e8332){_0x460039=_0x460039-0x0;var _0x10e84e=_0x8c4c[_0x460039];return _0x10e84e;};'use strict';var Sequelize=require(_0xc8c4('0x0'));module[_0xc8c4('0x1')]={'name':{'type':Sequelize[_0xc8c4('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xc8c4('0x3')](_0xc8c4('0x4'),_0xc8c4('0x5'),'third'),'allowNull':![],'defaultValue':_0xc8c4('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7fb2=['sequelize','exports','STRING','ENUM','first','second','third'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x7fb2,0xc4));var _0x27fb=function(_0x143833,_0x227cc4){_0x143833=_0x143833-0x0;var _0x5f564d=_0x7fb2[_0x143833];return _0x5f564d;};'use strict';var Sequelize=require(_0x27fb('0x0'));module[_0x27fb('0x1')]={'name':{'type':Sequelize[_0x27fb('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x27fb('0x3')](_0x27fb('0x4'),_0x27fb('0x5'),_0x27fb('0x6')),'allowNull':![],'defaultValue':_0x27fb('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 925684f..af6d2a3 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 _0x4e09=['keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Disposition','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','query'];(function(_0x182cd0,_0x6c8215){var _0x4f0571=function(_0x5b88ce){while(--_0x5b88ce){_0x182cd0['push'](_0x182cd0['shift']());}};_0x4f0571(++_0x6c8215);}(_0x4e09,0x166));var _0x94e0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4e09[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94e0('0x0'));var zipdir=require(_0x94e0('0x1'));var jsonpatch=require(_0x94e0('0x2'));var rp=require(_0x94e0('0x3'));var moment=require(_0x94e0('0x4'));var BPromise=require(_0x94e0('0x5'));var Mustache=require('mustache');var util=require(_0x94e0('0x6'));var path=require(_0x94e0('0x7'));var sox=require(_0x94e0('0x8'));var csv=require(_0x94e0('0x9'));var ejs=require(_0x94e0('0xa'));var fs=require('fs');var fs_extra=require(_0x94e0('0xb'));var _=require(_0x94e0('0xc'));var squel=require(_0x94e0('0xd'));var crypto=require(_0x94e0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x94e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x94e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x94e0('0x11'));var authService=require(_0x94e0('0x12'));var qs=require(_0x94e0('0x13'));var as=require(_0x94e0('0x14'));var hardwareService=require(_0x94e0('0x15'));var logger=require(_0x94e0('0x16'))(_0x94e0('0x17'));var utils=require(_0x94e0('0x18'));var config=require(_0x94e0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x94e0('0x1a'))['db'];function respondWithStatusCode(_0xf4a00d,_0x41b47b){_0x41b47b=_0x41b47b||0xcc;return function(_0x51dae0){if(_0x51dae0){return _0xf4a00d[_0x94e0('0x1b')](_0x41b47b);}return _0xf4a00d[_0x94e0('0x1c')](_0x41b47b)[_0x94e0('0x1d')]();};}function respondWithResult(_0x3a066a,_0x284312){_0x284312=_0x284312||0xc8;return function(_0x308afb){if(_0x308afb){return _0x3a066a[_0x94e0('0x1c')](_0x284312)['json'](_0x308afb);}};}function respondWithFilteredResult(_0x166154,_0x2b7347){return function(_0x29b5c7){if(_0x29b5c7){var _0x2dbf8c=typeof _0x2b7347[_0x94e0('0x1e')]===_0x94e0('0x1f')&&typeof _0x2b7347[_0x94e0('0x20')]===_0x94e0('0x1f');var _0x1f5624=_0x29b5c7[_0x94e0('0x21')];var _0x5479dd=_0x2dbf8c?0x0:_0x2b7347['offset'];var _0x39cec8=_0x2dbf8c?_0x29b5c7['count']:_0x2b7347['offset']+_0x2b7347[_0x94e0('0x20')];var _0x2580c7;if(_0x39cec8>=_0x1f5624){_0x39cec8=_0x1f5624;_0x2580c7=0xc8;}else{_0x2580c7=0xce;}_0x166154[_0x94e0('0x1c')](_0x2580c7);return _0x166154[_0x94e0('0x22')]('Content-Range',_0x5479dd+'-'+_0x39cec8+'/'+_0x1f5624)['json'](_0x29b5c7);}return null;};}function patchUpdates(_0xc42d73){return function(_0x264a43){try{jsonpatch['apply'](_0x264a43,_0xc42d73,!![]);}catch(_0x5475dc){return BPromise[_0x94e0('0x23')](_0x5475dc);}return _0x264a43[_0x94e0('0x24')]();};}function saveUpdates(_0x38fefb,_0x541099){return function(_0xaf882d){if(_0xaf882d){return _0xaf882d[_0x94e0('0x25')](_0x38fefb)[_0x94e0('0x26')](function(_0x56052d){return _0x56052d;});}return null;};}function removeEntity(_0x361b85,_0x516855){return function(_0x119b94){if(_0x119b94){return _0x119b94[_0x94e0('0x27')]()[_0x94e0('0x26')](function(){var _0x2cda7c=_0x119b94[_0x94e0('0x28')]({'plain':!![]});var _0x4199f7=_0x94e0('0x29');return db[_0x94e0('0x2a')][_0x94e0('0x27')]({'where':{'type':_0x4199f7,'resourceId':_0x2cda7c['id']}})[_0x94e0('0x26')](function(){return _0x119b94;});})[_0x94e0('0x26')](function(){_0x361b85[_0x94e0('0x1c')](0xcc)[_0x94e0('0x1d')]();});}};}function handleEntityNotFound(_0x290808,_0x494151){return function(_0x4d9309){if(!_0x4d9309){_0x290808['sendStatus'](0x194);}return _0x4d9309;};}function handleError(_0x3a2197,_0x11b3c4){_0x11b3c4=_0x11b3c4||0x1f4;return function(_0x58ac99){logger[_0x94e0('0x2b')](_0x58ac99['stack']);if(_0x58ac99[_0x94e0('0x2c')]){delete _0x58ac99[_0x94e0('0x2c')];}_0x3a2197[_0x94e0('0x1c')](_0x11b3c4)[_0x94e0('0x2d')](_0x58ac99);};}exports[_0x94e0('0x2e')]=function(_0x589c52,_0xb05e36){var _0x17e18f={},_0x9136={},_0x5d901e={'count':0x0,'rows':[]};var _0x5ba979=_[_0x94e0('0x2f')](db['Disposition'][_0x94e0('0x30')],function(_0x3be8f8){return{'name':_0x3be8f8[_0x94e0('0x31')],'type':_0x3be8f8[_0x94e0('0x32')]['key']};});_0x9136['model']=_[_0x94e0('0x2f')](_0x5ba979,_0x94e0('0x2c'));_0x9136[_0x94e0('0x33')]=_[_0x94e0('0x34')](_0x589c52[_0x94e0('0x33')]);_0x9136['filters']=_[_0x94e0('0x35')](_0x9136[_0x94e0('0x36')],_0x9136[_0x94e0('0x33')]);_0x17e18f[_0x94e0('0x37')]=_[_0x94e0('0x35')](_0x9136[_0x94e0('0x36')],qs[_0x94e0('0x38')](_0x589c52['query'][_0x94e0('0x38')]));_0x17e18f[_0x94e0('0x37')]=_0x17e18f[_0x94e0('0x37')]['length']?_0x17e18f[_0x94e0('0x37')]:_0x9136[_0x94e0('0x36')];if(!_0x589c52[_0x94e0('0x33')][_0x94e0('0x39')](_0x94e0('0x3a'))){_0x17e18f[_0x94e0('0x20')]=qs[_0x94e0('0x20')](_0x589c52[_0x94e0('0x33')][_0x94e0('0x20')]);_0x17e18f[_0x94e0('0x1e')]=qs[_0x94e0('0x1e')](_0x589c52[_0x94e0('0x33')]['offset']);}_0x17e18f['order']=qs[_0x94e0('0x3b')](_0x589c52[_0x94e0('0x33')][_0x94e0('0x3b')]);_0x17e18f[_0x94e0('0x3c')]=qs['filters'](_['pick'](_0x589c52[_0x94e0('0x33')],_0x9136['filters']),_0x5ba979);if(_0x589c52['query'][_0x94e0('0x3d')]){_0x17e18f[_0x94e0('0x3c')]=_[_0x94e0('0x3e')](_0x17e18f[_0x94e0('0x3c')],{'$or':_['map'](_0x5ba979,function(_0x459a22){if(_0x459a22['type']!==_0x94e0('0x3f')){var _0x196319={};_0x196319[_0x459a22['name']]={'$like':'%'+_0x589c52[_0x94e0('0x33')][_0x94e0('0x3d')]+'%'};return _0x196319;}})});}_0x17e18f=_[_0x94e0('0x3e')]({},_0x17e18f,_0x589c52[_0x94e0('0x40')]);var _0x34f4ad={'where':_0x17e18f[_0x94e0('0x3c')]};return db['Disposition'][_0x94e0('0x21')](_0x34f4ad)[_0x94e0('0x26')](function(_0xe926c0){_0x5d901e[_0x94e0('0x21')]=_0xe926c0;if(_0x589c52[_0x94e0('0x33')][_0x94e0('0x41')]){_0x17e18f[_0x94e0('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x94e0('0x43')](_0x17e18f);})[_0x94e0('0x26')](function(_0x2d08f6){_0x5d901e[_0x94e0('0x44')]=_0x2d08f6;return _0x5d901e;})[_0x94e0('0x26')](respondWithFilteredResult(_0xb05e36,_0x17e18f))['catch'](handleError(_0xb05e36,null));};exports[_0x94e0('0x45')]=function(_0x44ad26,_0x9e62d4){var _0x201783={'raw':!![],'where':{'id':_0x44ad26[_0x94e0('0x46')]['id']}},_0x5b0a19={};_0x5b0a19[_0x94e0('0x36')]=_['keys'](db[_0x94e0('0x47')][_0x94e0('0x30')]);_0x5b0a19['query']=_[_0x94e0('0x34')](_0x44ad26[_0x94e0('0x33')]);_0x5b0a19['filters']=_[_0x94e0('0x35')](_0x5b0a19[_0x94e0('0x36')],_0x5b0a19['query']);_0x201783[_0x94e0('0x37')]=_[_0x94e0('0x35')](_0x5b0a19[_0x94e0('0x36')],qs[_0x94e0('0x38')](_0x44ad26['query'][_0x94e0('0x38')]));_0x201783['attributes']=_0x201783['attributes']['length']?_0x201783[_0x94e0('0x37')]:_0x5b0a19[_0x94e0('0x36')];if(_0x44ad26[_0x94e0('0x33')][_0x94e0('0x41')]){_0x201783['include']=[{'all':!![]}];}_0x201783=_[_0x94e0('0x3e')]({},_0x201783,_0x44ad26[_0x94e0('0x40')]);return db[_0x94e0('0x47')][_0x94e0('0x48')](_0x201783)[_0x94e0('0x26')](handleEntityNotFound(_0x9e62d4,null))[_0x94e0('0x26')](respondWithResult(_0x9e62d4,null))[_0x94e0('0x49')](handleError(_0x9e62d4,null));};exports[_0x94e0('0x4a')]=function(_0x78734a,_0x1e2aa9){return db[_0x94e0('0x47')][_0x94e0('0x4a')](_0x78734a['body'],{})[_0x94e0('0x26')](function(_0x18102e){var _0x374569=_0x78734a[_0x94e0('0x4b')]['get']({'plain':!![]});if(!_0x374569)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x374569[_0x94e0('0x4c')]===_0x94e0('0x4b')){var _0x3f6aa4=_0x18102e[_0x94e0('0x28')]({'plain':!![]});var _0x299660=_0x94e0('0x29');return db[_0x94e0('0x4d')][_0x94e0('0x48')]({'where':{'name':_0x299660,'userProfileId':_0x374569[_0x94e0('0x4e')]},'raw':!![]})[_0x94e0('0x26')](function(_0xfecbf0){if(_0xfecbf0&&_0xfecbf0[_0x94e0('0x4f')]===0x0){return db[_0x94e0('0x2a')][_0x94e0('0x4a')]({'name':_0x3f6aa4[_0x94e0('0x2c')],'resourceId':_0x3f6aa4['id'],'type':_0xfecbf0['name'],'sectionId':_0xfecbf0['id']},{})[_0x94e0('0x26')](function(){return _0x18102e;});}else{return _0x18102e;}})[_0x94e0('0x49')](function(_0x3e0936){logger['error'](_0x94e0('0x50'),_0x3e0936);throw _0x3e0936;});}return _0x18102e;})['then'](respondWithResult(_0x1e2aa9,0xc9))[_0x94e0('0x49')](handleError(_0x1e2aa9,null));};exports['update']=function(_0x1f41a6,_0x5d2a6c){if(_0x1f41a6[_0x94e0('0x51')]['id']){delete _0x1f41a6[_0x94e0('0x51')]['id'];}return db[_0x94e0('0x47')][_0x94e0('0x48')]({'where':{'id':_0x1f41a6[_0x94e0('0x46')]['id']}})[_0x94e0('0x26')](handleEntityNotFound(_0x5d2a6c,null))[_0x94e0('0x26')](saveUpdates(_0x1f41a6[_0x94e0('0x51')],null))[_0x94e0('0x26')](respondWithResult(_0x5d2a6c,null))[_0x94e0('0x49')](handleError(_0x5d2a6c,null));};exports[_0x94e0('0x27')]=function(_0x55d1cc,_0x19bc98){return db[_0x94e0('0x47')][_0x94e0('0x48')]({'where':{'id':_0x55d1cc[_0x94e0('0x46')]['id']}})['then'](handleEntityNotFound(_0x19bc98,null))[_0x94e0('0x26')](removeEntity(_0x19bc98,null))[_0x94e0('0x49')](handleError(_0x19bc98,null));}; \ No newline at end of file +var _0xb0b0=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','sendStatus','error','stack','name','send','index','map','Disposition','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5d9244,_0x497732){var _0x44f1eb=function(_0x3e9f4b){while(--_0x3e9f4b){_0x5d9244['push'](_0x5d9244['shift']());}};_0x44f1eb(++_0x497732);}(_0xb0b0,0x196));var _0x0b0b=function(_0x1f4af2,_0x1d0e3f){_0x1f4af2=_0x1f4af2-0x0;var _0x585c30=_0xb0b0[_0x1f4af2];return _0x585c30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0b0b('0x0'));var jsonpatch=require(_0x0b0b('0x1'));var rp=require(_0x0b0b('0x2'));var moment=require(_0x0b0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0b0b('0x4'));var util=require(_0x0b0b('0x5'));var path=require(_0x0b0b('0x6'));var sox=require('sox');var csv=require(_0x0b0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b0b('0x8'));var _=require(_0x0b0b('0x9'));var squel=require(_0x0b0b('0xa'));var crypto=require(_0x0b0b('0xb'));var jsforce=require(_0x0b0b('0xc'));var deskjs=require(_0x0b0b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b0b('0xe'));var Papa=require(_0x0b0b('0xf'));var Redis=require(_0x0b0b('0x10'));var authService=require(_0x0b0b('0x11'));var qs=require(_0x0b0b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b0b('0x13'))(_0x0b0b('0x14'));var utils=require(_0x0b0b('0x15'));var config=require(_0x0b0b('0x16'));var licenseUtil=require(_0x0b0b('0x17'));var db=require(_0x0b0b('0x18'))['db'];function respondWithStatusCode(_0x28b5b0,_0x14ddb6){_0x14ddb6=_0x14ddb6||0xcc;return function(_0x4ba9ce){if(_0x4ba9ce){return _0x28b5b0['sendStatus'](_0x14ddb6);}return _0x28b5b0[_0x0b0b('0x19')](_0x14ddb6)[_0x0b0b('0x1a')]();};}function respondWithResult(_0x47885a,_0x5a1594){_0x5a1594=_0x5a1594||0xc8;return function(_0x1006e9){if(_0x1006e9){return _0x47885a[_0x0b0b('0x19')](_0x5a1594)[_0x0b0b('0x1b')](_0x1006e9);}};}function respondWithFilteredResult(_0x14c2b5,_0x5d4b0c){return function(_0x4a2fab){if(_0x4a2fab){var _0x33b749=typeof _0x5d4b0c[_0x0b0b('0x1c')]==='undefined'&&typeof _0x5d4b0c[_0x0b0b('0x1d')]==='undefined';var _0x5d5c3b=_0x4a2fab[_0x0b0b('0x1e')];var _0x287a17=_0x33b749?0x0:_0x5d4b0c[_0x0b0b('0x1c')];var _0x1503a2=_0x33b749?_0x4a2fab[_0x0b0b('0x1e')]:_0x5d4b0c[_0x0b0b('0x1c')]+_0x5d4b0c[_0x0b0b('0x1d')];var _0x5b2876;if(_0x1503a2>=_0x5d5c3b){_0x1503a2=_0x5d5c3b;_0x5b2876=0xc8;}else{_0x5b2876=0xce;}_0x14c2b5['status'](_0x5b2876);return _0x14c2b5[_0x0b0b('0x1f')](_0x0b0b('0x20'),_0x287a17+'-'+_0x1503a2+'/'+_0x5d5c3b)['json'](_0x4a2fab);}return null;};}function patchUpdates(_0x1bb627){return function(_0x151002){try{jsonpatch[_0x0b0b('0x21')](_0x151002,_0x1bb627,!![]);}catch(_0x355df0){return BPromise[_0x0b0b('0x22')](_0x355df0);}return _0x151002[_0x0b0b('0x23')]();};}function saveUpdates(_0x1e445f,_0x53391d){return function(_0x4fcba6){if(_0x4fcba6){return _0x4fcba6[_0x0b0b('0x24')](_0x1e445f)[_0x0b0b('0x25')](function(_0x1edf75){return _0x1edf75;});}return null;};}function removeEntity(_0x4adcda,_0x31c938){return function(_0x313323){if(_0x313323){return _0x313323[_0x0b0b('0x26')]()[_0x0b0b('0x25')](function(){var _0x2a2600=_0x313323['get']({'plain':!![]});var _0x3e964e=_0x0b0b('0x27');return db[_0x0b0b('0x28')][_0x0b0b('0x26')]({'where':{'type':_0x3e964e,'resourceId':_0x2a2600['id']}})[_0x0b0b('0x25')](function(){return _0x313323;});})[_0x0b0b('0x25')](function(){_0x4adcda[_0x0b0b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161be7,_0x5d3c9a){return function(_0x5136f0){if(!_0x5136f0){_0x161be7[_0x0b0b('0x29')](0x194);}return _0x5136f0;};}function handleError(_0x2e019d,_0x1ac79e){_0x1ac79e=_0x1ac79e||0x1f4;return function(_0x3f6c03){logger[_0x0b0b('0x2a')](_0x3f6c03[_0x0b0b('0x2b')]);if(_0x3f6c03['name']){delete _0x3f6c03[_0x0b0b('0x2c')];}_0x2e019d[_0x0b0b('0x19')](_0x1ac79e)[_0x0b0b('0x2d')](_0x3f6c03);};}exports[_0x0b0b('0x2e')]=function(_0x425d0a,_0x22413b){var _0x223077={},_0x32196b={},_0xde84e1={'count':0x0,'rows':[]};var _0x1f4090=_[_0x0b0b('0x2f')](db[_0x0b0b('0x30')]['rawAttributes'],function(_0x36a101){return{'name':_0x36a101['fieldName'],'type':_0x36a101[_0x0b0b('0x31')]['key']};});_0x32196b[_0x0b0b('0x32')]=_[_0x0b0b('0x2f')](_0x1f4090,'name');_0x32196b[_0x0b0b('0x33')]=_[_0x0b0b('0x34')](_0x425d0a['query']);_0x32196b[_0x0b0b('0x35')]=_[_0x0b0b('0x36')](_0x32196b[_0x0b0b('0x32')],_0x32196b[_0x0b0b('0x33')]);_0x223077[_0x0b0b('0x37')]=_['intersection'](_0x32196b['model'],qs[_0x0b0b('0x38')](_0x425d0a[_0x0b0b('0x33')]['fields']));_0x223077['attributes']=_0x223077[_0x0b0b('0x37')]['length']?_0x223077[_0x0b0b('0x37')]:_0x32196b[_0x0b0b('0x32')];if(!_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x39')]('nolimit')){_0x223077['limit']=qs[_0x0b0b('0x1d')](_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x1d')]);_0x223077[_0x0b0b('0x1c')]=qs[_0x0b0b('0x1c')](_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x1c')]);}_0x223077[_0x0b0b('0x3a')]=qs[_0x0b0b('0x3b')](_0x425d0a[_0x0b0b('0x33')]['sort']);_0x223077[_0x0b0b('0x3c')]=qs[_0x0b0b('0x35')](_[_0x0b0b('0x3d')](_0x425d0a[_0x0b0b('0x33')],_0x32196b['filters']),_0x1f4090);if(_0x425d0a[_0x0b0b('0x33')]['filter']){_0x223077[_0x0b0b('0x3c')]=_[_0x0b0b('0x3e')](_0x223077[_0x0b0b('0x3c')],{'$or':_[_0x0b0b('0x2f')](_0x1f4090,function(_0x20215b){if(_0x20215b[_0x0b0b('0x31')]!==_0x0b0b('0x3f')){var _0x4b0353={};_0x4b0353[_0x20215b['name']]={'$like':'%'+_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x40')]+'%'};return _0x4b0353;}})});}_0x223077=_[_0x0b0b('0x3e')]({},_0x223077,_0x425d0a['options']);var _0x2d4253={'where':_0x223077['where']};return db[_0x0b0b('0x30')][_0x0b0b('0x1e')](_0x2d4253)['then'](function(_0x485a42){_0xde84e1['count']=_0x485a42;if(_0x425d0a[_0x0b0b('0x33')][_0x0b0b('0x41')]){_0x223077['include']=[{'all':!![]}];}return db[_0x0b0b('0x30')][_0x0b0b('0x42')](_0x223077);})[_0x0b0b('0x25')](function(_0x21e640){_0xde84e1[_0x0b0b('0x43')]=_0x21e640;return _0xde84e1;})[_0x0b0b('0x25')](respondWithFilteredResult(_0x22413b,_0x223077))[_0x0b0b('0x44')](handleError(_0x22413b,null));};exports[_0x0b0b('0x45')]=function(_0x58c90e,_0xbd5166){var _0x576df1={'raw':!![],'where':{'id':_0x58c90e[_0x0b0b('0x46')]['id']}},_0x54bc11={};_0x54bc11['model']=_[_0x0b0b('0x34')](db['Disposition'][_0x0b0b('0x47')]);_0x54bc11['query']=_[_0x0b0b('0x34')](_0x58c90e[_0x0b0b('0x33')]);_0x54bc11[_0x0b0b('0x35')]=_[_0x0b0b('0x36')](_0x54bc11[_0x0b0b('0x32')],_0x54bc11[_0x0b0b('0x33')]);_0x576df1['attributes']=_[_0x0b0b('0x36')](_0x54bc11[_0x0b0b('0x32')],qs[_0x0b0b('0x38')](_0x58c90e['query'][_0x0b0b('0x38')]));_0x576df1[_0x0b0b('0x37')]=_0x576df1['attributes']['length']?_0x576df1[_0x0b0b('0x37')]:_0x54bc11['model'];if(_0x58c90e[_0x0b0b('0x33')][_0x0b0b('0x41')]){_0x576df1[_0x0b0b('0x48')]=[{'all':!![]}];}_0x576df1=_[_0x0b0b('0x3e')]({},_0x576df1,_0x58c90e[_0x0b0b('0x49')]);return db['Disposition'][_0x0b0b('0x4a')](_0x576df1)[_0x0b0b('0x25')](handleEntityNotFound(_0xbd5166,null))[_0x0b0b('0x25')](respondWithResult(_0xbd5166,null))[_0x0b0b('0x44')](handleError(_0xbd5166,null));};exports[_0x0b0b('0x4b')]=function(_0x799496,_0x2dfa05){return db['Disposition'][_0x0b0b('0x4b')](_0x799496[_0x0b0b('0x4c')],{})['then'](function(_0x404d45){var _0x2761f0=_0x799496[_0x0b0b('0x4d')][_0x0b0b('0x4e')]({'plain':!![]});if(!_0x2761f0)throw new Error(_0x0b0b('0x4f'));if(_0x2761f0[_0x0b0b('0x50')]==='user'){var _0x412416=_0x404d45[_0x0b0b('0x4e')]({'plain':!![]});var _0x45bc43=_0x0b0b('0x27');return db[_0x0b0b('0x51')][_0x0b0b('0x4a')]({'where':{'name':_0x45bc43,'userProfileId':_0x2761f0[_0x0b0b('0x52')]},'raw':!![]})[_0x0b0b('0x25')](function(_0x34c33a){if(_0x34c33a&&_0x34c33a['autoAssociation']===0x0){return db[_0x0b0b('0x28')][_0x0b0b('0x4b')]({'name':_0x412416['name'],'resourceId':_0x412416['id'],'type':_0x34c33a[_0x0b0b('0x2c')],'sectionId':_0x34c33a['id']},{})['then'](function(){return _0x404d45;});}else{return _0x404d45;}})[_0x0b0b('0x44')](function(_0x153788){logger['error'](_0x0b0b('0x53'),_0x153788);throw _0x153788;});}return _0x404d45;})[_0x0b0b('0x25')](respondWithResult(_0x2dfa05,0xc9))['catch'](handleError(_0x2dfa05,null));};exports['update']=function(_0x12cabf,_0x49287e){if(_0x12cabf['body']['id']){delete _0x12cabf['body']['id'];}return db['Disposition'][_0x0b0b('0x4a')]({'where':{'id':_0x12cabf[_0x0b0b('0x46')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x49287e,null))[_0x0b0b('0x25')](saveUpdates(_0x12cabf[_0x0b0b('0x4c')],null))['then'](respondWithResult(_0x49287e,null))['catch'](handleError(_0x49287e,null));};exports['destroy']=function(_0x14e3cf,_0x4522c6){return db['Disposition']['find']({'where':{'id':_0x14e3cf[_0x0b0b('0x46')]['id']}})[_0x0b0b('0x25')](handleEntityNotFound(_0x4522c6,null))[_0x0b0b('0x25')](removeEntity(_0x4522c6,null))[_0x0b0b('0x44')](handleError(_0x4522c6,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index f158e2c..183b476 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 _0x6da0=['name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','SmsAccountId','name_openchannel','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define'];(function(_0x158d63,_0x5c9d3b){var _0x3c05b2=function(_0x12d65d){while(--_0x12d65d){_0x158d63['push'](_0x158d63['shift']());}};_0x3c05b2(++_0x5c9d3b);}(_0x6da0,0x80));var _0x06da=function(_0x5b1c5d,_0x181e69){_0x5b1c5d=_0x5b1c5d-0x0;var _0x30fa80=_0x6da0[_0x5b1c5d];return _0x30fa80;};'use strict';var _=require('lodash');var util=require(_0x06da('0x0'));var logger=require(_0x06da('0x1'))(_0x06da('0x2'));var moment=require(_0x06da('0x3'));var BPromise=require(_0x06da('0x4'));var rp=require(_0x06da('0x5'));var fs=require('fs');var path=require(_0x06da('0x6'));var rimraf=require(_0x06da('0x7'));var config=require(_0x06da('0x8'));var attributes=require(_0x06da('0x9'));module[_0x06da('0xa')]=function(_0x466255,_0x472b80){return _0x466255[_0x06da('0xb')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x06da('0xc'),'fields':[_0x06da('0xd'),_0x06da('0xe')]},{'unique':!![],'name':_0x06da('0xf'),'fields':[_0x06da('0xd'),_0x06da('0x10')]},{'unique':!![],'name':_0x06da('0x11'),'fields':[_0x06da('0xd'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':['name',_0x06da('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0x06da('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x06da('0x13'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd4bf=['bluebird','path','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd4bf,0x74));var _0xfd4b=function(_0x3c00e5,_0x32fb35){_0x3c00e5=_0x3c00e5-0x0;var _0x172ffd=_0xd4bf[_0x3c00e5];return _0x172ffd;};'use strict';var _=require('lodash');var util=require(_0xfd4b('0x0'));var logger=require(_0xfd4b('0x1'))(_0xfd4b('0x2'));var moment=require(_0xfd4b('0x3'));var BPromise=require(_0xfd4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd4b('0x6'));module[_0xfd4b('0x7')]=function(_0x1cb792,_0x3dac56){return _0x1cb792[_0xfd4b('0x8')](_0xfd4b('0x9'),attributes,{'tableName':_0xfd4b('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfd4b('0xb'),'fields':['name',_0xfd4b('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0xfd4b('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0xfd4b('0xe'),'fields':[_0xfd4b('0xd'),_0xfd4b('0xf')]},{'unique':!![],'name':_0xfd4b('0x10'),'fields':[_0xfd4b('0xd'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xfd4b('0xd'),_0xfd4b('0x11')]},{'unique':!![],'name':_0xfd4b('0x12'),'fields':[_0xfd4b('0xd'),_0xfd4b('0x13')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 35e8147..7d2e27b 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(_0x504080,_0x30d511){var _0x28e409=function(_0x2b6bc0){while(--_0x2b6bc0){_0x504080['push'](_0x504080['shift']());}};_0x28e409(++_0x30d511);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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(_0x21cbc9,_0xfbfbe4){var _0x5504f2=function(_0x5ebe28){while(--_0x5ebe28){_0x21cbc9['push'](_0x21cbc9['shift']());}};_0x5504f2(++_0xfbfbe4);}(_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 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 0b307d5..2f27189 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 _0x2336=['/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','get','isAuthenticated','index'];(function(_0x31586a,_0x38f1b4){var _0x2cc006=function(_0x52abdf){while(--_0x52abdf){_0x31586a['push'](_0x31586a['shift']());}};_0x2cc006(++_0x38f1b4);}(_0x2336,0x1c8));var _0x6233=function(_0x9bcc0b,_0x120f6c){_0x9bcc0b=_0x9bcc0b-0x0;var _0x195399=_0x2336[_0x9bcc0b];return _0x195399;};'use strict';var multer=require(_0x6233('0x0'));var util=require(_0x6233('0x1'));var path=require(_0x6233('0x2'));var timeout=require(_0x6233('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6233('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6233('0x5'));var controller=require('./disposition.controller');router[_0x6233('0x6')]('/',auth[_0x6233('0x7')](),controller[_0x6233('0x8')]);router['get'](_0x6233('0x9'),auth['isAuthenticated'](),controller[_0x6233('0xa')]);router[_0x6233('0xb')]('/',auth[_0x6233('0x7')](),controller[_0x6233('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6233('0xd')](_0x6233('0x9'),auth[_0x6233('0x7')](),controller['destroy']);module[_0x6233('0xe')]=router; \ No newline at end of file +var _0x31b2=['isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get'];(function(_0x67d81c,_0x3cd587){var _0x3a7dc5=function(_0x54b8a3){while(--_0x54b8a3){_0x67d81c['push'](_0x67d81c['shift']());}};_0x3a7dc5(++_0x3cd587);}(_0x31b2,0xa4));var _0x231b=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0x31b2[_0xc8a02c];return _0x3d89da;};'use strict';var multer=require(_0x231b('0x0'));var util=require(_0x231b('0x1'));var path=require(_0x231b('0x2'));var timeout=require(_0x231b('0x3'));var express=require(_0x231b('0x4'));var router=express[_0x231b('0x5')]();var fs_extra=require(_0x231b('0x6'));var auth=require(_0x231b('0x7'));var interaction=require(_0x231b('0x8'));var config=require(_0x231b('0x9'));var controller=require(_0x231b('0xa'));router[_0x231b('0xb')]('/',auth[_0x231b('0xc')](),controller[_0x231b('0xd')]);router[_0x231b('0xb')]('/:id',auth[_0x231b('0xc')](),controller[_0x231b('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x231b('0xf')]);router[_0x231b('0x10')](_0x231b('0x11'),auth[_0x231b('0xc')](),controller[_0x231b('0x12')]);router[_0x231b('0x13')](_0x231b('0x11'),auth['isAuthenticated'](),controller[_0x231b('0x14')]);module[_0x231b('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 9911871..f199a85 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 _0x2d27=['xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','14400','v17,v27,v29','INTEGER','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d27,0x13e));var _0x72d2=function(_0x4df017,_0x2a0aa4){_0x4df017=_0x4df017-0x0;var _0x42c215=_0x2d27[_0x4df017];return _0x42c215;};'use strict';var Sequelize=require(_0x72d2('0x0'));module['exports']={'name':{'type':Sequelize[_0x72d2('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x72d2('0x1')]},'ecm':{'type':Sequelize[_0x72d2('0x2')](_0x72d2('0x3'),'no'),'defaultValue':_0x72d2('0x3')},'headerinfo':{'type':Sequelize[_0x72d2('0x1')],'defaultValue':_0x72d2('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x72d2('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x72d2('0x6'),_0x72d2('0x7'),_0x72d2('0x8'),'9600',_0x72d2('0x9'),_0x72d2('0xa')),'defaultValue':_0x72d2('0x7')},'maxrate':{'type':Sequelize[_0x72d2('0x2')](_0x72d2('0x6'),_0x72d2('0x7'),_0x72d2('0x8'),'9600',_0x72d2('0x9'),_0x72d2('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x72d2('0x1')],'defaultValue':_0x72d2('0xb')},'gateway':{'type':Sequelize[_0x72d2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x72d2('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x72d2('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x72d2('0x2')]('SIP','IAX',_0x72d2('0xd'),_0x72d2('0xe')),'defaultValue':_0x72d2('0xf')},'key':{'type':Sequelize[_0x72d2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x72d2('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x72d2('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x72d2('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x72d2('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x72d2('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x72d2('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x72d2('0x11')],'defaultValue':![],'comment':_0x72d2('0x13'),'set':function(_0x3874d0){if(!_0x3874d0)this[_0x72d2('0x14')](_0x72d2('0x15'),null);this['setDataValue'](_0x72d2('0x16'),_0x3874d0);}}}; \ No newline at end of file +var _0x2d48=['mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','12000','14400','4800','9600','v17,v27,v29','SIP','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x2d48,0x143));var _0x82d4=function(_0x2586df,_0x17558e){_0x2586df=_0x2586df-0x0;var _0x5bc581=_0x2d48[_0x2586df];return _0x5bc581;};'use strict';var Sequelize=require(_0x82d4('0x0'));module[_0x82d4('0x1')]={'name':{'type':Sequelize[_0x82d4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x82d4('0x2')]},'ecm':{'type':Sequelize[_0x82d4('0x3')](_0x82d4('0x4'),'no'),'defaultValue':_0x82d4('0x4')},'headerinfo':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':_0x82d4('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x82d4('0x6')},'minrate':{'type':Sequelize[_0x82d4('0x3')](_0x82d4('0x7'),'4800',_0x82d4('0x8'),'9600',_0x82d4('0x9'),_0x82d4('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x82d4('0x7'),_0x82d4('0xb'),'7200',_0x82d4('0xc'),_0x82d4('0x9'),_0x82d4('0xa')),'defaultValue':_0x82d4('0xa')},'modem':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':_0x82d4('0xd')},'gateway':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x82d4('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x82d4('0x3')](_0x82d4('0xe'),'IAX',_0x82d4('0xf'),_0x82d4('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x82d4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x82d4('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x82d4('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x82d4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x82d4('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x82d4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x82d4('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x82d4('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x82d4('0x12')],'defaultValue':![],'comment':_0x82d4('0x14'),'set':function(_0x4dfaa0){if(!_0x4dfaa0)this[_0x82d4('0x15')](_0x82d4('0x16'),null);this[_0x82d4('0x15')]('mandatoryDisposition',_0x4dfaa0);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 935fefd..44bd69e 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 _0xe7e7=['save','update','UserProfileResource','destroy','status','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','user','role','FaxAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','pick','removeDispositions','ids','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','User','Owner','fullname','internal','Tag','Tags','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','Set','gateway','faxdetect','headerinfo','modem','FAXOPT(','push','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','get','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxAccount.socket','register','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject'];(function(_0x212315,_0x1b14fb){var _0x2f87da=function(_0xc74753){while(--_0xc74753){_0x212315['push'](_0x212315['shift']());}};_0x2f87da(++_0x1b14fb);}(_0xe7e7,0x14c));var _0x7e7e=function(_0x1a5875,_0x2ae8bc){_0x1a5875=_0x1a5875-0x0;var _0xda53e6=_0xe7e7[_0x1a5875];return _0xda53e6;};'use strict';var emlformat=require(_0x7e7e('0x0'));var rimraf=require(_0x7e7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e7e('0x2'));var rp=require('request-promise');var moment=require(_0x7e7e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7e7e('0x4'));var sox=require(_0x7e7e('0x5'));var csv=require(_0x7e7e('0x6'));var ejs=require(_0x7e7e('0x7'));var fs=require('fs');var fs_extra=require(_0x7e7e('0x8'));var _=require(_0x7e7e('0x9'));var squel=require(_0x7e7e('0xa'));var crypto=require(_0x7e7e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e7e('0x6'));var querystring=require(_0x7e7e('0xc'));var Papa=require(_0x7e7e('0xd'));var Redis=require(_0x7e7e('0xe'));var authService=require(_0x7e7e('0xf'));var qs=require(_0x7e7e('0x10'));var as=require(_0x7e7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7e7e('0x12'));var config=require(_0x7e7e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e7e('0x14'))['db'];config[_0x7e7e('0x15')]=_[_0x7e7e('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e7e('0x15')]));require(_0x7e7e('0x17'))[_0x7e7e('0x18')](socket);var jayson=require(_0x7e7e('0x19'));var client=jayson[_0x7e7e('0x1a')][_0x7e7e('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x7e7e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xa39db9,_0x56fce8,_0x47b426,_0x1fdc49){return new BPromise(function(_0x5932bf,_0x100565){var _0x310d03=_0x1fdc49||client;return _0x310d03[_0x7e7e('0x1c')](_0xa39db9,_0x47b426)[_0x7e7e('0x1d')](function(_0x488bb6){logger['info'](_0x7e7e('0x1e'),_0x56fce8,_0x7e7e('0x1f'));logger[_0x7e7e('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x56fce8,_0x7e7e('0x1f'),JSON[_0x7e7e('0x21')](_0x488bb6));if(_0x488bb6[_0x7e7e('0x22')]){if(_0x488bb6['error'][_0x7e7e('0x23')]===0x1f4){logger['error'](_0x7e7e('0x1e'),_0x56fce8,_0x488bb6[_0x7e7e('0x22')][_0x7e7e('0x24')]);return _0x100565(_0x488bb6[_0x7e7e('0x22')][_0x7e7e('0x24')]);}logger[_0x7e7e('0x22')](_0x7e7e('0x1e'),_0x56fce8,_0x488bb6[_0x7e7e('0x22')][_0x7e7e('0x24')]);return _0x5932bf(_0x488bb6[_0x7e7e('0x22')]['message']);}else{logger[_0x7e7e('0x25')](_0x7e7e('0x1e'),_0x56fce8,_0x7e7e('0x1f'));_0x5932bf(_0x488bb6['result']['message']);}})[_0x7e7e('0x26')](function(_0x2f9697){logger[_0x7e7e('0x22')](_0x7e7e('0x1e'),_0x56fce8,_0x2f9697);_0x100565(_0x2f9697);});});}function respondWithStatusCode(_0x1e94e0,_0x22dd7d){_0x22dd7d=_0x22dd7d||0xcc;return function(_0x34c27e){if(_0x34c27e){return _0x1e94e0[_0x7e7e('0x27')](_0x22dd7d);}return _0x1e94e0['status'](_0x22dd7d)[_0x7e7e('0x28')]();};}function respondWithResult(_0x3ead94,_0x5603c0){_0x5603c0=_0x5603c0||0xc8;return function(_0xe08471){if(_0xe08471){return _0x3ead94['status'](_0x5603c0)[_0x7e7e('0x29')](_0xe08471);}};}function respondWithFilteredResult(_0x3e841f,_0x36ebbb){return function(_0x47fa0c){if(_0x47fa0c){var _0x2ef926=typeof _0x36ebbb['offset']===_0x7e7e('0x2a')&&typeof _0x36ebbb[_0x7e7e('0x2b')]===_0x7e7e('0x2a');var _0x405123=_0x47fa0c['count'];var _0x54b78=_0x2ef926?0x0:_0x36ebbb[_0x7e7e('0x2c')];var _0x11b1f0=_0x2ef926?_0x47fa0c[_0x7e7e('0x2d')]:_0x36ebbb[_0x7e7e('0x2c')]+_0x36ebbb[_0x7e7e('0x2b')];var _0x41c774;if(_0x11b1f0>=_0x405123){_0x11b1f0=_0x405123;_0x41c774=0xc8;}else{_0x41c774=0xce;}_0x3e841f['status'](_0x41c774);return _0x3e841f[_0x7e7e('0x2e')](_0x7e7e('0x2f'),_0x54b78+'-'+_0x11b1f0+'/'+_0x405123)[_0x7e7e('0x29')](_0x47fa0c);}return null;};}function patchUpdates(_0x2d0f77){return function(_0x3ae6f6){try{jsonpatch[_0x7e7e('0x30')](_0x3ae6f6,_0x2d0f77,!![]);}catch(_0x1c823e){return BPromise[_0x7e7e('0x31')](_0x1c823e);}return _0x3ae6f6[_0x7e7e('0x32')]();};}function saveUpdates(_0x3be50f,_0x549724){return function(_0xddaab0){if(_0xddaab0){return _0xddaab0[_0x7e7e('0x33')](_0x3be50f)[_0x7e7e('0x1d')](function(_0x48f658){return _0x48f658;});}return null;};}function removeEntity(_0x351432,_0x5bf1db){return function(_0x46aa9c){if(_0x46aa9c){return _0x46aa9c['destroy']()['then'](function(){var _0x4864e3=_0x46aa9c['get']({'plain':!![]});var _0x5bb699='FaxAccounts';return db[_0x7e7e('0x34')][_0x7e7e('0x35')]({'where':{'type':_0x5bb699,'resourceId':_0x4864e3['id']}})[_0x7e7e('0x1d')](function(){return _0x46aa9c;});})['then'](function(){_0x351432[_0x7e7e('0x36')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd4af,_0x1d065d){return function(_0x5d6165){if(!_0x5d6165){_0x4fd4af[_0x7e7e('0x27')](0x194);}return _0x5d6165;};}function handleError(_0x57b4c6,_0x2084d5){_0x2084d5=_0x2084d5||0x1f4;return function(_0x479933){logger['error'](_0x479933[_0x7e7e('0x37')]);if(_0x479933[_0x7e7e('0x38')]){delete _0x479933[_0x7e7e('0x38')];}_0x57b4c6[_0x7e7e('0x36')](_0x2084d5)[_0x7e7e('0x39')](_0x479933);};}exports[_0x7e7e('0x3a')]=function(_0x1e3132,_0x5501c0){var _0x133c4b={'include':[{'model':db[_0x7e7e('0x3b')],'as':_0x7e7e('0x3c')}]},_0xb55558={},_0x59990a={'count':0x0,'rows':[]};var _0x1f77a8=_[_0x7e7e('0x3d')](db[_0x7e7e('0x3e')][_0x7e7e('0x3f')],function(_0x16ea63){return{'name':_0x16ea63[_0x7e7e('0x40')],'type':_0x16ea63[_0x7e7e('0x41')]['key']};});_0xb55558[_0x7e7e('0x42')]=_[_0x7e7e('0x3d')](_0x1f77a8,'name');_0xb55558[_0x7e7e('0x43')]=_[_0x7e7e('0x44')](_0x1e3132[_0x7e7e('0x43')]);_0xb55558[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0xb55558[_0x7e7e('0x42')],_0xb55558['query']);_0x133c4b[_0x7e7e('0x47')]=_[_0x7e7e('0x46')](_0xb55558['model'],qs['fields'](_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x48')]));_0x133c4b[_0x7e7e('0x47')]=_0x133c4b[_0x7e7e('0x47')]['length']?_0x133c4b[_0x7e7e('0x47')]:_0xb55558[_0x7e7e('0x42')];if(!_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x49')](_0x7e7e('0x4a'))){_0x133c4b[_0x7e7e('0x2b')]=qs['limit'](_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x2b')]);_0x133c4b[_0x7e7e('0x2c')]=qs[_0x7e7e('0x2c')](_0x1e3132['query'][_0x7e7e('0x2c')]);}_0x133c4b[_0x7e7e('0x4b')]=qs[_0x7e7e('0x4c')](_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x4c')]);_0x133c4b[_0x7e7e('0x4d')]=qs['filters'](_['pick'](_0x1e3132[_0x7e7e('0x43')],_0xb55558[_0x7e7e('0x45')]),_0x1f77a8);if(_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x4e')]){_0x133c4b['where']=_[_0x7e7e('0x4f')](_0x133c4b[_0x7e7e('0x4d')],{'$or':_['map'](_0x1f77a8,function(_0x2e9edb){if(_0x2e9edb[_0x7e7e('0x41')]!==_0x7e7e('0x50')){var _0x595965={};_0x595965[_0x2e9edb[_0x7e7e('0x38')]]={'$like':'%'+_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x4e')]+'%'};return _0x595965;}})});}_0x133c4b=_[_0x7e7e('0x4f')]({},_0x133c4b,_0x1e3132[_0x7e7e('0x51')]);var _0x48c93e={'where':_0x133c4b['where']};return db[_0x7e7e('0x3e')][_0x7e7e('0x2d')](_0x48c93e)['then'](function(_0x3574b0){_0x59990a['count']=_0x3574b0;if(_0x1e3132[_0x7e7e('0x43')][_0x7e7e('0x52')]){_0x133c4b[_0x7e7e('0x53')]=[{'all':!![]}];}return db['FaxAccount'][_0x7e7e('0x54')](_0x133c4b);})['then'](function(_0xe4f733){_0x59990a[_0x7e7e('0x55')]=_0xe4f733;return _0x59990a;})[_0x7e7e('0x1d')](respondWithFilteredResult(_0x5501c0,_0x133c4b))[_0x7e7e('0x26')](handleError(_0x5501c0,null));};exports['show']=function(_0x485cd7,_0x46507a){var _0x5307ad={'raw':![],'where':{'id':_0x485cd7[_0x7e7e('0x56')]['id']},'include':[{'model':db[_0x7e7e('0x3b')],'as':'mandatoryDispositionPause'}]},_0x388dec={};_0x388dec[_0x7e7e('0x42')]=_[_0x7e7e('0x44')](db['FaxAccount'][_0x7e7e('0x3f')]);_0x388dec[_0x7e7e('0x43')]=_[_0x7e7e('0x44')](_0x485cd7['query']);_0x388dec[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0x388dec['model'],_0x388dec['query']);_0x5307ad[_0x7e7e('0x47')]=_[_0x7e7e('0x46')](_0x388dec[_0x7e7e('0x42')],qs[_0x7e7e('0x48')](_0x485cd7[_0x7e7e('0x43')][_0x7e7e('0x48')]));_0x5307ad[_0x7e7e('0x47')]=_0x5307ad['attributes']['length']?_0x5307ad[_0x7e7e('0x47')]:_0x388dec[_0x7e7e('0x42')];if(_0x485cd7[_0x7e7e('0x43')][_0x7e7e('0x52')]){_0x5307ad[_0x7e7e('0x53')]=[{'all':!![]}];}_0x5307ad=_[_0x7e7e('0x4f')]({},_0x5307ad,_0x485cd7['options']);return db['FaxAccount'][_0x7e7e('0x57')](_0x5307ad)[_0x7e7e('0x1d')](handleEntityNotFound(_0x46507a,null))[_0x7e7e('0x1d')](respondWithResult(_0x46507a,null))['catch'](handleError(_0x46507a,null));};exports[_0x7e7e('0x58')]=function(_0x3050cc,_0x8faac8){return db[_0x7e7e('0x3e')][_0x7e7e('0x58')](_0x3050cc['body'],{})[_0x7e7e('0x1d')](function(_0x406dca){var _0x1777de=_0x3050cc[_0x7e7e('0x59')]['get']({'plain':!![]});if(!_0x1777de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1777de[_0x7e7e('0x5a')]===_0x7e7e('0x59')){var _0x5f2128=_0x406dca['get']({'plain':!![]});var _0x1ec4c4=_0x7e7e('0x5b');return db[_0x7e7e('0x5c')]['find']({'where':{'name':_0x1ec4c4,'userProfileId':_0x1777de[_0x7e7e('0x5d')]},'raw':!![]})[_0x7e7e('0x1d')](function(_0x2614fc){if(_0x2614fc&&_0x2614fc['autoAssociation']===0x0){return db[_0x7e7e('0x34')][_0x7e7e('0x58')]({'name':_0x5f2128[_0x7e7e('0x38')],'resourceId':_0x5f2128['id'],'type':_0x2614fc[_0x7e7e('0x38')],'sectionId':_0x2614fc['id']},{})['then'](function(){return _0x406dca;});}else{return _0x406dca;}})[_0x7e7e('0x26')](function(_0x3155fd){logger[_0x7e7e('0x22')](_0x7e7e('0x5e'),_0x3155fd);throw _0x3155fd;});}return _0x406dca;})[_0x7e7e('0x1d')](respondWithResult(_0x8faac8,0xc9))[_0x7e7e('0x26')](handleError(_0x8faac8,null));};exports[_0x7e7e('0x33')]=function(_0x1d8c2c,_0x36a2de){if(_0x1d8c2c[_0x7e7e('0x5f')]['id']){delete _0x1d8c2c[_0x7e7e('0x5f')]['id'];}return db['FaxAccount'][_0x7e7e('0x57')]({'where':{'id':_0x1d8c2c['params']['id']},'include':[{'model':db[_0x7e7e('0x3b')],'as':_0x7e7e('0x3c')}]})['then'](handleEntityNotFound(_0x36a2de,null))[_0x7e7e('0x1d')](saveUpdates(_0x1d8c2c[_0x7e7e('0x5f')],null))[_0x7e7e('0x1d')](respondWithResult(_0x36a2de,null))[_0x7e7e('0x26')](handleError(_0x36a2de,null));};exports[_0x7e7e('0x35')]=function(_0x4e9dcb,_0x20488c){return db[_0x7e7e('0x3e')][_0x7e7e('0x57')]({'where':{'id':_0x4e9dcb[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x20488c,null))[_0x7e7e('0x1d')](removeEntity(_0x20488c,null))['catch'](handleError(_0x20488c,null));};exports['describe']=function(_0x3b791b,_0x583b0f){return db[_0x7e7e('0x3e')]['describe']()[_0x7e7e('0x1d')](respondWithResult(_0x583b0f,null))[_0x7e7e('0x26')](handleError(_0x583b0f,null));};exports[_0x7e7e('0x60')]=function(_0x54f28e,_0x27ee77,_0x226ffc){if(_0x54f28e[_0x7e7e('0x5f')]['id']){delete _0x54f28e[_0x7e7e('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x54f28e[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x27ee77,null))[_0x7e7e('0x1d')](function(_0x11d386){if(_0x11d386){_0x54f28e[_0x7e7e('0x5f')][_0x7e7e('0x61')]=_0x11d386['id'];return db[_0x7e7e('0x62')]['create'](_0x54f28e[_0x7e7e('0x5f')]);}})[_0x7e7e('0x1d')](respondWithResult(_0x27ee77,null))[_0x7e7e('0x26')](handleError(_0x27ee77,null));};exports[_0x7e7e('0x63')]=function(_0x4d2269,_0x37cae5,_0x311562){var _0x1396de={'raw':![],'where':{}};var _0x12c89b={};var _0x4746a0={'count':0x0,'rows':[]};return db[_0x7e7e('0x3e')][_0x7e7e('0x64')]({'where':{'id':_0x4d2269[_0x7e7e('0x56')]['id']}})['then'](handleEntityNotFound(_0x37cae5,null))['then'](function(_0x299ae2){if(_0x299ae2){_0x12c89b[_0x7e7e('0x42')]=_['keys'](db[_0x7e7e('0x62')][_0x7e7e('0x3f')]);_0x12c89b[_0x7e7e('0x43')]=_[_0x7e7e('0x44')](_0x4d2269[_0x7e7e('0x43')]);_0x12c89b[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0x12c89b[_0x7e7e('0x42')],_0x12c89b[_0x7e7e('0x43')]);_0x1396de[_0x7e7e('0x47')]=_[_0x7e7e('0x46')](_0x12c89b['model'],qs['fields'](_0x4d2269[_0x7e7e('0x43')][_0x7e7e('0x48')]));_0x1396de[_0x7e7e('0x47')]=_0x1396de[_0x7e7e('0x47')][_0x7e7e('0x65')]?_0x1396de[_0x7e7e('0x47')]:_0x12c89b[_0x7e7e('0x42')];if(!_0x4d2269[_0x7e7e('0x43')][_0x7e7e('0x49')](_0x7e7e('0x4a'))){_0x1396de[_0x7e7e('0x2b')]=qs[_0x7e7e('0x2b')](_0x4d2269[_0x7e7e('0x43')][_0x7e7e('0x2b')]);_0x1396de[_0x7e7e('0x2c')]=qs[_0x7e7e('0x2c')](_0x4d2269[_0x7e7e('0x43')][_0x7e7e('0x2c')]);}_0x1396de[_0x7e7e('0x4b')]=qs[_0x7e7e('0x4c')](_0x4d2269[_0x7e7e('0x43')][_0x7e7e('0x4c')]);_0x1396de['where']=qs[_0x7e7e('0x45')](_[_0x7e7e('0x66')](_0x4d2269[_0x7e7e('0x43')],_0x12c89b['filters']));_0x1396de[_0x7e7e('0x4d')]['FaxAccountId']=_0x299ae2['id'];if(_0x4d2269['query'][_0x7e7e('0x4e')]){_0x1396de[_0x7e7e('0x4d')]=_[_0x7e7e('0x4f')](_0x1396de[_0x7e7e('0x4d')],{'$or':_['map'](_0x1396de[_0x7e7e('0x47')],function(_0x53fafc){var _0x56e78c={};_0x56e78c[_0x53fafc]={'$like':'%'+_0x4d2269[_0x7e7e('0x43')][_0x7e7e('0x4e')]+'%'};return _0x56e78c;})});}_0x1396de=_[_0x7e7e('0x4f')]({},_0x1396de,_0x4d2269[_0x7e7e('0x51')]);return db['Disposition']['count']({'where':_0x1396de['where']})[_0x7e7e('0x1d')](function(_0x2b4b6b){_0x4746a0['count']=_0x2b4b6b;if(_0x4d2269['query'][_0x7e7e('0x52')]){_0x1396de[_0x7e7e('0x53')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1396de);})['then'](function(_0x560e47){_0x4746a0[_0x7e7e('0x55')]=_0x560e47;return _0x4746a0;});}})['then'](respondWithFilteredResult(_0x37cae5,_0x1396de))['catch'](handleError(_0x37cae5,null));};exports[_0x7e7e('0x67')]=function(_0x2b4409,_0x4963ae,_0x3577f7){return db['FaxAccount'][_0x7e7e('0x57')]({'where':{'id':_0x2b4409['params']['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x4963ae,null))['then'](function(_0x516327){if(_0x516327){return _0x516327['removeDispositions'](_0x2b4409[_0x7e7e('0x43')][_0x7e7e('0x68')]);}})['then'](respondWithStatusCode(_0x4963ae,null))[_0x7e7e('0x26')](handleError(_0x4963ae,null));};exports['addAnswer']=function(_0x4e2854,_0x342ea0,_0xb9d669){if(_0x4e2854[_0x7e7e('0x5f')]['id']){delete _0x4e2854[_0x7e7e('0x5f')]['id'];}return db[_0x7e7e('0x3e')]['find']({'where':{'id':_0x4e2854['params']['id']}})['then'](handleEntityNotFound(_0x342ea0,null))[_0x7e7e('0x1d')](function(_0x18b7a9){if(_0x18b7a9){_0x4e2854[_0x7e7e('0x5f')]['FaxAccountId']=_0x18b7a9['id'];return db[_0x7e7e('0x69')]['create'](_0x4e2854[_0x7e7e('0x5f')]);}})[_0x7e7e('0x1d')](respondWithResult(_0x342ea0,null))[_0x7e7e('0x26')](handleError(_0x342ea0,null));};exports['getAnswers']=function(_0xeeeab,_0x415aa2,_0x15d04c){var _0x19ab3b={'raw':![],'where':{}};var _0x49ec76={};var _0x1417b9={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7e7e('0x64')]({'where':{'id':_0xeeeab['params']['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x415aa2,null))['then'](function(_0x31858a){if(_0x31858a){_0x49ec76[_0x7e7e('0x42')]=_['keys'](db['CannedAnswer'][_0x7e7e('0x3f')]);_0x49ec76[_0x7e7e('0x43')]=_[_0x7e7e('0x44')](_0xeeeab['query']);_0x49ec76[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0x49ec76[_0x7e7e('0x42')],_0x49ec76[_0x7e7e('0x43')]);_0x19ab3b[_0x7e7e('0x47')]=_['intersection'](_0x49ec76[_0x7e7e('0x42')],qs[_0x7e7e('0x48')](_0xeeeab[_0x7e7e('0x43')][_0x7e7e('0x48')]));_0x19ab3b[_0x7e7e('0x47')]=_0x19ab3b[_0x7e7e('0x47')]['length']?_0x19ab3b['attributes']:_0x49ec76[_0x7e7e('0x42')];if(!_0xeeeab[_0x7e7e('0x43')][_0x7e7e('0x49')](_0x7e7e('0x4a'))){_0x19ab3b['limit']=qs[_0x7e7e('0x2b')](_0xeeeab['query'][_0x7e7e('0x2b')]);_0x19ab3b['offset']=qs[_0x7e7e('0x2c')](_0xeeeab[_0x7e7e('0x43')][_0x7e7e('0x2c')]);}_0x19ab3b['order']=qs[_0x7e7e('0x4c')](_0xeeeab[_0x7e7e('0x43')][_0x7e7e('0x4c')]);_0x19ab3b[_0x7e7e('0x4d')]=qs['filters'](_[_0x7e7e('0x66')](_0xeeeab[_0x7e7e('0x43')],_0x49ec76[_0x7e7e('0x45')]));_0x19ab3b[_0x7e7e('0x4d')][_0x7e7e('0x61')]=_0x31858a['id'];if(_0xeeeab[_0x7e7e('0x43')][_0x7e7e('0x4e')]){_0x19ab3b[_0x7e7e('0x4d')]=_[_0x7e7e('0x4f')](_0x19ab3b[_0x7e7e('0x4d')],{'$or':_[_0x7e7e('0x3d')](_0x19ab3b['attributes'],function(_0xcf9d48){var _0x42ec3e={};_0x42ec3e[_0xcf9d48]={'$like':'%'+_0xeeeab['query'][_0x7e7e('0x4e')]+'%'};return _0x42ec3e;})});}_0x19ab3b=_[_0x7e7e('0x4f')]({},_0x19ab3b,_0xeeeab['options']);return db[_0x7e7e('0x69')][_0x7e7e('0x2d')]({'where':_0x19ab3b['where']})['then'](function(_0x3f65ae){_0x1417b9[_0x7e7e('0x2d')]=_0x3f65ae;if(_0xeeeab[_0x7e7e('0x43')][_0x7e7e('0x52')]){_0x19ab3b['include']=[{'all':!![]}];}return db[_0x7e7e('0x69')]['findAll'](_0x19ab3b);})[_0x7e7e('0x1d')](function(_0x34fd6f){_0x1417b9[_0x7e7e('0x55')]=_0x34fd6f;return _0x1417b9;});}})['then'](respondWithFilteredResult(_0x415aa2,_0x19ab3b))[_0x7e7e('0x26')](handleError(_0x415aa2,null));};exports['removeAnswers']=function(_0x255814,_0x29d5cd,_0x589a1c){return db[_0x7e7e('0x3e')][_0x7e7e('0x57')]({'where':{'id':_0x255814[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x29d5cd,null))[_0x7e7e('0x1d')](function(_0x5df76e){if(_0x5df76e){return _0x5df76e[_0x7e7e('0x6a')](_0x255814['query'][_0x7e7e('0x68')]);}})[_0x7e7e('0x1d')](respondWithStatusCode(_0x29d5cd,null))[_0x7e7e('0x26')](handleError(_0x29d5cd,null));};exports['addInteraction']=function(_0x3650aa,_0x217c5c,_0x4ed409){return db['FaxInteraction']['find']({'where':{'id':_0x3650aa[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x217c5c,null))[_0x7e7e('0x1d')](function(_0x32d78d){if(_0x32d78d){return _0x32d78d[_0x7e7e('0x6b')](_0x3650aa[_0x7e7e('0x5f')][_0x7e7e('0x68')],_[_0x7e7e('0x6c')](_0x3650aa['body'],[_0x7e7e('0x68'),'id'])||{});}})[_0x7e7e('0x1d')](respondWithResult(_0x217c5c,null))['catch'](handleError(_0x217c5c,null));};exports[_0x7e7e('0x6d')]=function(_0x357cf0,_0x2bbe7c,_0x186d18){var _0x57e92b={'raw':![],'where':{}};var _0x3cca0f={};var _0x3c3663={'count':0x0,'rows':[]};return db[_0x7e7e('0x3e')]['findOne']({'where':{'id':_0x357cf0[_0x7e7e('0x56')]['id']}})['then'](handleEntityNotFound(_0x2bbe7c,null))[_0x7e7e('0x1d')](function(_0x397de0){if(_0x397de0){_0x3cca0f[_0x7e7e('0x42')]=_['keys'](db[_0x7e7e('0x6e')][_0x7e7e('0x3f')]);_0x3cca0f[_0x7e7e('0x43')]=_['keys'](_0x357cf0[_0x7e7e('0x43')]);_0x3cca0f['filters']=_['intersection'](_0x3cca0f[_0x7e7e('0x42')],_0x3cca0f[_0x7e7e('0x43')]);_0x57e92b[_0x7e7e('0x47')]=_['intersection'](_0x3cca0f[_0x7e7e('0x42')],qs[_0x7e7e('0x48')](_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x48')]));_0x57e92b[_0x7e7e('0x47')]=_0x57e92b[_0x7e7e('0x47')]['length']?_0x57e92b['attributes']:_0x3cca0f['model'];if(!_0x357cf0['query'][_0x7e7e('0x49')]('nolimit')){_0x57e92b[_0x7e7e('0x2b')]=qs[_0x7e7e('0x2b')](_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x2b')]);_0x57e92b[_0x7e7e('0x2c')]=qs[_0x7e7e('0x2c')](_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x2c')]);}_0x57e92b[_0x7e7e('0x4b')]=qs[_0x7e7e('0x4c')](_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x4c')]);_0x57e92b[_0x7e7e('0x4d')]=qs[_0x7e7e('0x45')](_[_0x7e7e('0x66')](_0x357cf0[_0x7e7e('0x43')],_0x3cca0f[_0x7e7e('0x45')]));_0x57e92b['where'][_0x7e7e('0x61')]=_0x397de0['id'];if(_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x4e')]){_0x57e92b['where']=_['merge'](_0x57e92b[_0x7e7e('0x4d')],{'$or':_[_0x7e7e('0x3d')](_0x57e92b[_0x7e7e('0x47')],function(_0x56c797){var _0x8ae8fa={};_0x8ae8fa[_0x56c797]={'$like':'%'+_0x357cf0['query']['filter']+'%'};return _0x8ae8fa;})});}_0x57e92b=_['merge']({},_0x57e92b,_0x357cf0[_0x7e7e('0x51')]);return db[_0x7e7e('0x6e')][_0x7e7e('0x2d')]({'where':_0x57e92b['where']})['then'](function(_0x3c1a93){_0x3c3663[_0x7e7e('0x2d')]=_0x3c1a93;if(_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x52')]){_0x57e92b[_0x7e7e('0x53')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x7e7e('0x6f')],'as':_0x7e7e('0x70'),'attributes':[_0x7e7e('0x38'),_0x7e7e('0x71'),_0x7e7e('0x72')],'required':![]},{'model':db[_0x7e7e('0x73')],'as':_0x7e7e('0x74'),'attributes':['id','name','color'],'where':_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x75')]?{'id':_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x75')]}:undefined,'required':_0x357cf0[_0x7e7e('0x43')][_0x7e7e('0x75')]?!![]:![]}];}return db[_0x7e7e('0x6e')][_0x7e7e('0x54')](_0x57e92b);})['then'](function(_0x2c252a){_0x3c3663[_0x7e7e('0x55')]=_0x2c252a;return _0x3c3663;});}})[_0x7e7e('0x1d')](respondWithFilteredResult(_0x2bbe7c,_0x57e92b))[_0x7e7e('0x26')](handleError(_0x2bbe7c,null));};exports['addApplications']=function(_0x14f76f,_0xb50156){var _0xda34f4=_0x14f76f[_0x7e7e('0x56')]['id'];var _0x36b220=_0x14f76f[_0x7e7e('0x5f')];var _0x28fd88=0xc8;var _0x3d6fdc=null;return db[_0x7e7e('0x76')][_0x7e7e('0x77')]({'isolationLevel':db[_0x7e7e('0x76')][_0x7e7e('0x78')][_0x7e7e('0x79')][_0x7e7e('0x7a')]},function(_0x56aab5){return db['FaxAccount'][_0x7e7e('0x64')]({'where':{'id':_0xda34f4},'transaction':_0x56aab5})['then'](function(_0x2dd062){if(_0x2dd062){return db[_0x7e7e('0x7b')][_0x7e7e('0x35')]({'where':{'FaxAccountId':_0xda34f4},'transaction':_0x56aab5})[_0x7e7e('0x1d')](function(){var _0x8237d2=_['map'](_0x36b220,function(_0x20a82a){_0x20a82a[_0x7e7e('0x61')]=_0xda34f4;return _0x20a82a;});return db[_0x7e7e('0x7b')][_0x7e7e('0x7c')](_0x8237d2,{'transaction':_0x56aab5});});}else{_0x28fd88=0x194;_0x3d6fdc=[];}});})['then'](function(){if(_0x28fd88!==0x194){return db['FaxApplication'][_0x7e7e('0x7d')]({'where':{'FaxAccountId':_0xda34f4},'order':_0x7e7e('0x7e')})['then'](function(_0x2668c9){_0x3d6fdc=_0x2668c9;});}})['catch'](function(_0x42a091){_0x28fd88=0x1f4;logger[_0x7e7e('0x22')](_0x42a091[_0x7e7e('0x37')]);if(_0x42a091['name']){delete _0x42a091[_0x7e7e('0x38')];}_0x3d6fdc=_0x42a091;})[_0x7e7e('0x7f')](function(){if(_0x3d6fdc===null){_0xb50156[_0x7e7e('0x27')](_0x28fd88);}else{if(_0x28fd88===0x1f4){_0xb50156[_0x7e7e('0x36')](_0x28fd88)[_0x7e7e('0x39')](_0x3d6fdc);}else{_0xb50156[_0x7e7e('0x36')](_0x28fd88)[_0x7e7e('0x29')](_0x3d6fdc);}}});};exports['getApplications']=function(_0x5c5bc8,_0xc1707b,_0x2bf183){var _0x5d5b82={};var _0x1b502f={};var _0x5f284e;var _0x571259;return db[_0x7e7e('0x3e')]['findOne']({'where':{'id':_0x5c5bc8['params']['id']}})['then'](handleEntityNotFound(_0xc1707b,null))[_0x7e7e('0x1d')](function(_0x2c3651){if(_0x2c3651){_0x5f284e=_0x2c3651;_0x1b502f[_0x7e7e('0x42')]=_[_0x7e7e('0x44')](db['FaxApplication'][_0x7e7e('0x3f')]);_0x1b502f[_0x7e7e('0x43')]=_[_0x7e7e('0x44')](_0x5c5bc8['query']);_0x1b502f[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0x1b502f[_0x7e7e('0x42')],_0x1b502f['query']);_0x5d5b82['attributes']=_[_0x7e7e('0x46')](_0x1b502f[_0x7e7e('0x42')],qs[_0x7e7e('0x48')](_0x5c5bc8['query'][_0x7e7e('0x48')]));_0x5d5b82['attributes']=_0x5d5b82[_0x7e7e('0x47')][_0x7e7e('0x65')]?_0x5d5b82[_0x7e7e('0x47')]:_0x1b502f[_0x7e7e('0x42')];_0x5d5b82[_0x7e7e('0x4b')]=qs['sort'](_0x5c5bc8['query'][_0x7e7e('0x4c')]);_0x5d5b82[_0x7e7e('0x4d')]=qs[_0x7e7e('0x45')](_[_0x7e7e('0x66')](_0x5c5bc8['query'],_0x1b502f[_0x7e7e('0x45')]));if(_0x5c5bc8[_0x7e7e('0x43')][_0x7e7e('0x4e')]){_0x5d5b82[_0x7e7e('0x4d')]=_[_0x7e7e('0x4f')](_0x5d5b82[_0x7e7e('0x4d')],{'$or':_['map'](_0x5d5b82[_0x7e7e('0x47')],function(_0x259a5e){var _0x14ecf7={};_0x14ecf7[_0x259a5e]={'$like':'%'+_0x5c5bc8[_0x7e7e('0x43')][_0x7e7e('0x4e')]+'%'};return _0x14ecf7;})});}_0x5d5b82=_['merge']({},_0x5d5b82,_0x5c5bc8[_0x7e7e('0x51')]);return _0x5f284e[_0x7e7e('0x80')](_0x5d5b82);}})[_0x7e7e('0x1d')](function(_0x1c537a){if(_0x1c537a){_0x571259=_0x1c537a[_0x7e7e('0x65')];if(!_0x5c5bc8[_0x7e7e('0x43')][_0x7e7e('0x49')](_0x7e7e('0x4a'))){_0x5d5b82[_0x7e7e('0x2b')]=qs[_0x7e7e('0x2b')](_0x5c5bc8[_0x7e7e('0x43')][_0x7e7e('0x2b')]);_0x5d5b82[_0x7e7e('0x2c')]=qs[_0x7e7e('0x2c')](_0x5c5bc8['query'][_0x7e7e('0x2c')]);}return _0x5f284e[_0x7e7e('0x80')](_0x5d5b82);}})[_0x7e7e('0x1d')](function(_0x52ac43){if(_0x52ac43){return _0x52ac43?{'count':_0x571259,'rows':_0x52ac43}:null;}})[_0x7e7e('0x1d')](respondWithResult(_0xc1707b,null))[_0x7e7e('0x26')](handleError(_0xc1707b,null));};function Extension(_0x2728f0,_0x4f495d,_0x255ddb,_0x42d359){this[_0x7e7e('0x81')]=_0x7e7e('0x82');this[_0x7e7e('0x83')]=_0x2728f0[_0x7e7e('0x84')];this[_0x7e7e('0x85')]=_0x42d359;this[_0x7e7e('0x41')]=_0x7e7e('0x86');this['description']=_0x7e7e('0x87');this[_0x7e7e('0x61')]=_0x2728f0['id'];this[_0x7e7e('0x7e')]=_0x4f495d;this[_0x7e7e('0x88')]=_0x255ddb;}function createExtensionsReciveFax(_0x989a35){var _0x185672=0x1;var _0x58fdb9=[];_0x58fdb9['push'](new Extension(_0x989a35,_0x185672,'','Answer'));_0x185672+=0x1;_0x58fdb9['push'](new Extension(_0x989a35,_0x185672,'CDR(type)=inbound-fax',_0x7e7e('0x89')));_0x185672+=0x1;for(var _0x15ced0 in _0x989a35){if(_0x989a35[_0x7e7e('0x49')](_0x15ced0)&&(_0x15ced0==='ecm'||_0x15ced0===_0x7e7e('0x84')||_0x15ced0===_0x7e7e('0x8a')||_0x15ced0===_0x7e7e('0x8b')||_0x15ced0===_0x7e7e('0x8c')||_0x15ced0==='maxrate'||_0x15ced0==='minrate'||_0x15ced0===_0x7e7e('0x8d')||_0x15ced0==='t38timeout')){_0x58fdb9['push'](new Extension(_0x989a35,_0x185672,_0x7e7e('0x8e')+_0x15ced0+')='+_0x989a35[_0x15ced0],'Set'));_0x185672+=0x1;}}_0x58fdb9[_0x7e7e('0x8f')](new Extension(_0x989a35,_0x185672,'6',_0x7e7e('0x90')));_0x185672+=0x1;_0x58fdb9[_0x7e7e('0x8f')](new Extension(_0x989a35,_0x185672,_0x7e7e('0x91'),_0x7e7e('0x92')));_0x185672=0x0;return _0x58fdb9;}exports[_0x7e7e('0x93')]=function(_0x2d9932,_0x2a98fb,_0x463031){var _0x4fc825;return db['sequelize'][_0x7e7e('0x77')](function(_0xe47fc2){return db[_0x7e7e('0x3e')][_0x7e7e('0x58')](_0x2d9932[_0x7e7e('0x5f')],{'transaction':_0xe47fc2})[_0x7e7e('0x1d')](function(_0x5e91d1){_0x4fc825=_0x5e91d1[_0x7e7e('0x94')]({'plain':!![]});return db[_0x7e7e('0x95')][_0x7e7e('0x7c')](createExtensionsReciveFax(_0x4fc825),{'transaction':_0xe47fc2});});})[_0x7e7e('0x1d')](function(){return _0x4fc825;})[_0x7e7e('0x1d')](respondWithResult(_0x2a98fb,null))[_0x7e7e('0x26')](handleError(_0x2a98fb,null));};exports[_0x7e7e('0x96')]=function(_0x379999,_0x385e61,_0xdcbf55){var _0x2ae9ac;return db[_0x7e7e('0x76')][_0x7e7e('0x77')](function(_0x1dee53){return db[_0x7e7e('0x3e')][_0x7e7e('0x33')](_0x379999[_0x7e7e('0x5f')],{'where':{'id':_0x379999['body']['id']},'transaction':_0x1dee53})[_0x7e7e('0x1d')](function(_0x5ac1ff){return db['VoiceExtension'][_0x7e7e('0x35')]({'where':{'FaxAccountId':_0x379999[_0x7e7e('0x5f')]['id']},'transaction':_0x1dee53})[_0x7e7e('0x1d')](function(_0x5decf2){return db[_0x7e7e('0x95')][_0x7e7e('0x7c')](createExtensionsReciveFax(_['omit'](_0x379999['body'],[_0x7e7e('0x97'),_0x7e7e('0x98'),_0x7e7e('0x99'),_0x7e7e('0x9a'),_0x7e7e('0x9b'),'ListId'])),{'transaction':_0x1dee53});});});})[_0x7e7e('0x1d')](function(){return db[_0x7e7e('0x3e')][_0x7e7e('0x9c')](_0x379999[_0x7e7e('0x5f')]['id']);})['then'](respondWithResult(_0x385e61,null))[_0x7e7e('0x26')](handleError(_0x385e61,null));};exports[_0x7e7e('0x9d')]=function(_0x3072d8,_0x1a446b,_0x1609ab){var _0x2367a3={'raw':!![],'where':{}};var _0x93dd05={};var _0x26d27a={'count':0x0,'rows':[]};return db[_0x7e7e('0x3e')][_0x7e7e('0x64')]({'where':{'id':_0x3072d8[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x1a446b,null))[_0x7e7e('0x1d')](function(_0xf454d7){if(_0xf454d7){_0x93dd05['model']=_[_0x7e7e('0x44')](db[_0x7e7e('0x9e')]['rawAttributes']);_0x93dd05[_0x7e7e('0x43')]=_[_0x7e7e('0x44')](_0x3072d8[_0x7e7e('0x43')]);_0x93dd05[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0x93dd05[_0x7e7e('0x42')],_0x93dd05['query']);_0x2367a3['attributes']=_[_0x7e7e('0x46')](_0x93dd05[_0x7e7e('0x42')],qs['fields'](_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x48')]));_0x2367a3[_0x7e7e('0x47')]=_0x2367a3[_0x7e7e('0x47')]['length']?_0x2367a3[_0x7e7e('0x47')]:_0x93dd05[_0x7e7e('0x42')];if(!_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x49')](_0x7e7e('0x4a'))){_0x2367a3[_0x7e7e('0x2b')]=qs[_0x7e7e('0x2b')](_0x3072d8['query'][_0x7e7e('0x2b')]);_0x2367a3[_0x7e7e('0x2c')]=qs['offset'](_0x3072d8[_0x7e7e('0x43')]['offset']);}_0x2367a3['order']=qs[_0x7e7e('0x4c')](_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x4c')]);_0x2367a3['where']=qs['filters'](_[_0x7e7e('0x66')](_0x3072d8[_0x7e7e('0x43')],_0x93dd05[_0x7e7e('0x45')]));_0x2367a3[_0x7e7e('0x4d')][_0x7e7e('0x61')]=_0xf454d7['id'];if(_0x3072d8['query'][_0x7e7e('0x4e')]){_0x2367a3[_0x7e7e('0x4d')]=_[_0x7e7e('0x4f')](_0x2367a3['where'],{'$or':_['map'](_0x2367a3[_0x7e7e('0x47')],function(_0x1d2438){var _0x1d8e64={};_0x1d8e64[_0x1d2438]={'$like':'%'+_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x4e')]+'%'};return _0x1d8e64;})});}if(_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x9f')]){var _0x24128b=_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x9f')][_0x7e7e('0xa0')](',');var _0x3e3632={};_0x3e3632[_0x24128b[0x0]]={'$gte':moment(_0x24128b[0x1])[_0x7e7e('0xa1')](_0x7e7e('0xa2'))};_0x2367a3[_0x7e7e('0x4d')]=_['merge'](_0x2367a3[_0x7e7e('0x4d')],_0x3e3632);}_0x2367a3=_[_0x7e7e('0x4f')]({},_0x2367a3,_0x3072d8[_0x7e7e('0x51')]);return db['FaxMessage'][_0x7e7e('0x2d')]({'where':_0x2367a3['where']})[_0x7e7e('0x1d')](function(_0x109043){_0x26d27a['count']=_0x109043;if(_0x3072d8[_0x7e7e('0x43')][_0x7e7e('0x52')]){_0x2367a3[_0x7e7e('0x53')]=[{'all':!![]}];}return db[_0x7e7e('0x9e')]['findAll'](_0x2367a3);})[_0x7e7e('0x1d')](function(_0x22ec55){_0x26d27a['rows']=_0x22ec55;return _0x26d27a;});}})[_0x7e7e('0x1d')](respondWithFilteredResult(_0x1a446b,_0x2367a3))[_0x7e7e('0x26')](handleError(_0x1a446b,null));};exports['send']=function(_0x581dcf,_0x293dc6,_0xf00be0){var _0x4e21f1,_0x560619={},_0x3d0e41;if(_0x581dcf[_0x7e7e('0x5f')]['to']){_0x3d0e41=_0x581dcf['body']['to'][0x0];}return db[_0x7e7e('0x3e')]['find']({'where':{'id':_0x581dcf[_0x7e7e('0x56')]['id']},'include':[{'model':db[_0x7e7e('0xa3')],'as':_0x7e7e('0xa4'),'include':[{'model':db[_0x7e7e('0xa5')],'as':'Contacts','where':{'fax':_0x3d0e41},'limit':0x1,'order':[['updatedAt',_0x7e7e('0xa6')]]}]}]})[_0x7e7e('0x1d')](handleEntityNotFound(_0x293dc6,null))['then'](function(_0x471d3d){_0x4e21f1=_0x471d3d;if(_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')]&&_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][_0x7e7e('0x65')]){for(var _0x30f0a7=0x0;_0x30f0a7<_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][_0x7e7e('0x65')];_0x30f0a7+=0x1){_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][_0x30f0a7]={'filename':_0x581dcf['body'][_0x7e7e('0xa7')][_0x30f0a7][_0x7e7e('0x38')],'id':_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][_0x30f0a7]['id'],'path':path['join'](config['root'],_0x7e7e('0xa8'),_0x581dcf[_0x7e7e('0x5f')]['attachments'][_0x30f0a7][_0x7e7e('0xa9')])};}}return respondWithRpcPromise(_0x7e7e('0xaa'),'CheckAfterSend',{'FaxAccountId':_[_0x7e7e('0xab')](_0x581dcf[_0x7e7e('0x56')]['id'])?undefined:_0x581dcf[_0x7e7e('0x56')]['id'],'path':_[_0x7e7e('0xab')](_0x581dcf['body']['attachments'][0x0]['path'])?undefined:_0x581dcf['body'][_0x7e7e('0xa7')][0x0][_0x7e7e('0x4')],'fax':_[_0x7e7e('0xab')](_0x581dcf[_0x7e7e('0x5f')]['to'][0x0])?undefined:_0x581dcf['body']['to'][0x0]},client9002);})[_0x7e7e('0x1d')](function(){if(_0x4e21f1){if(_['isNil'](_0x581dcf['body'][_0x7e7e('0xac')])){_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xac')]=util[_0x7e7e('0xa1')](_0x7e7e('0xad'),_0x4e21f1[_0x7e7e('0x38')],_0x4e21f1[_0x7e7e('0xae')]);}if(_0x4e21f1[_0x7e7e('0xa4')]){if(_0x4e21f1[_0x7e7e('0xa4')][_0x7e7e('0xaf')][_0x7e7e('0x65')]){return _0x4e21f1[_0x7e7e('0xa4')][_0x7e7e('0xaf')][0x0];}else{return db[_0x7e7e('0xa5')]['create'](_['defaults'](_0x581dcf['body'],{'firstName':_0x581dcf[_0x7e7e('0x5f')]['to'][0x0],'phone':_0x581dcf[_0x7e7e('0x5f')]['to'][0x0],'fax':_0x581dcf[_0x7e7e('0x5f')]['to'][0x0],'ListId':_0x4e21f1['ListId']}));}}else{throw new Error(_0x7e7e('0xb0'));}}else{throw new Error(_0x7e7e('0xb1'));}})[_0x7e7e('0x1d')](function(_0x18338f){if(_0x18338f){return db[_0x7e7e('0x6e')][_0x7e7e('0x57')]({'where':{'ContactId':_0x18338f['id'],'closed':![],'FaxAccountId':_0x4e21f1['id']}})[_0x7e7e('0x1d')](function(_0x1abd82){if(_0x1abd82){return[_0x1abd82,![]];}return db['FaxInteraction'][_0x7e7e('0x58')]({'UserId':_0x581dcf[_0x7e7e('0x59')]['id'],'ContactId':_0x18338f['id'],'FaxAccountId':_0x4e21f1['id'],'fax':_0x581dcf[_0x7e7e('0x5f')]['to'][0x0],'firstMsgDirection':_0x7e7e('0xb2'),'Messages':[_[_0x7e7e('0x4f')](_0x581dcf[_0x7e7e('0x5f')],{'read':![],'body':_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][0x0][_0x7e7e('0xb3')],'FaxAccountId':_0x4e21f1['id'],'UserId':_0x581dcf[_0x7e7e('0x59')]['id'],'ContactId':_0x18338f['id'],'AttachmentId':_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x7e7e('0x9e')],'as':_0x7e7e('0xb4')}]})[_0x7e7e('0x1d')](function(_0x331792){return[_0x331792,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7e7e('0xb5')](function(_0x5d7806,_0x53e18d){if(_0x53e18d){return _0x5d7806;}return db['FaxMessage'][_0x7e7e('0x58')]({'direction':_0x7e7e('0xb2'),'read':![],'body':_0x581dcf['body']['attachments'][0x0][_0x7e7e('0xb3')],'FaxAccountId':_0x4e21f1['id'],'FaxInteractionId':_0x5d7806['id'],'UserId':_0x581dcf['user']['id'],'ContactId':_0x5d7806['ContactId'],'AttachmentId':_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][0x0]['id']})[_0x7e7e('0x1d')](function(_0x440cac){_0x5d7806[_0x7e7e('0xb6')]['Messages']=[];_0x5d7806['dataValues'][_0x7e7e('0xb4')][_0x7e7e('0x8f')](_0x440cac['dataValues']);return _0x5d7806;});})[_0x7e7e('0x1d')](function(_0x2f9b6f){respondWithRpcPromise(_0x7e7e('0xb7'),_0x7e7e('0xb7'),{'FaxAccountId':_[_0x7e7e('0xab')](_0x581dcf[_0x7e7e('0x56')]['id'])?undefined:_0x581dcf[_0x7e7e('0x56')]['id'],'path':_[_0x7e7e('0xab')](_0x581dcf[_0x7e7e('0x5f')]['attachments'][0x0]['path'])?undefined:_0x581dcf[_0x7e7e('0x5f')][_0x7e7e('0xa7')][0x0]['path'],'fax':_[_0x7e7e('0xab')](_0x581dcf['body']['to'][0x0])?undefined:_0x581dcf[_0x7e7e('0x5f')]['to'][0x0],'AttachmentId':_0x581dcf['body'][_0x7e7e('0xa7')][0x0]['id']},client9002)[_0x7e7e('0x1d')](function(_0x1634ce){logger[_0x7e7e('0x25')](_0x7e7e('0xb8'),_0x1634ce);})[_0x7e7e('0x26')](function(_0x4204a0){logger[_0x7e7e('0x25')](_0x7e7e('0xb8'),_0x4204a0);});return _0x2f9b6f;})[_0x7e7e('0x1d')](respondWithResult(_0x293dc6,null))[_0x7e7e('0x26')](handleError(_0x293dc6,null));};exports[_0x7e7e('0xb9')]=function(_0x5b9ba7,_0x45d339,_0xd9386){return db[_0x7e7e('0x3e')]['find']({'where':{'id':_0x5b9ba7['params']['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x45d339,null))[_0x7e7e('0x1d')](function(_0x15b35a){if(_0x15b35a){return _0x15b35a['addAgents'](_0x5b9ba7[_0x7e7e('0x5f')][_0x7e7e('0x68')],_[_0x7e7e('0x6c')](_0x5b9ba7[_0x7e7e('0x5f')],['ids','id'])||{})[_0x7e7e('0xb5')](function(_0x4a79f3){for(var _0xb72e27=0x0;_0xb72e27<_0x5b9ba7[_0x7e7e('0x5f')][_0x7e7e('0x68')][_0x7e7e('0x65')];_0xb72e27+=0x1){socket[_0x7e7e('0xba')]('userFaxAccount:save',{'UserId':Number(_0x5b9ba7[_0x7e7e('0x5f')][_0x7e7e('0x68')][_0xb72e27]),'FaxAccountId':Number(_0x5b9ba7[_0x7e7e('0x56')]['id'])});}return _0x4a79f3;});}})[_0x7e7e('0x1d')](respondWithResult(_0x45d339,null))[_0x7e7e('0x26')](handleError(_0x45d339,null));};exports[_0x7e7e('0xbb')]=function(_0x5e2f64,_0x5a63a1,_0x2c53aa){return db[_0x7e7e('0x3e')][_0x7e7e('0x57')]({'where':{'id':_0x5e2f64[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x5a63a1,null))[_0x7e7e('0x1d')](function(_0x3bdd2a){if(_0x3bdd2a){return _0x3bdd2a[_0x7e7e('0xbb')](_0x5e2f64[_0x7e7e('0x43')][_0x7e7e('0x68')])[_0x7e7e('0x1d')](function(){if(_[_0x7e7e('0xbc')](_0x5e2f64['query']['ids'])){for(var _0x3f0209=0x0;_0x3f0209<_0x5e2f64[_0x7e7e('0x43')][_0x7e7e('0x68')][_0x7e7e('0x65')];_0x3f0209+=0x1){socket['emit'](_0x7e7e('0xbd'),{'UserId':Number(_0x5e2f64[_0x7e7e('0x43')][_0x7e7e('0x68')][_0x3f0209]),'FaxAccountId':Number(_0x5e2f64[_0x7e7e('0x56')]['id'])});}}else{socket[_0x7e7e('0xba')](_0x7e7e('0xbd'),{'UserId':Number(_0x5e2f64[_0x7e7e('0x43')][_0x7e7e('0x68')]),'FaxAccountId':Number(_0x5e2f64[_0x7e7e('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a63a1,null))[_0x7e7e('0x26')](handleError(_0x5a63a1,null));};exports['getAgents']=function(_0x157531,_0x1f393f,_0x119641){var _0x4546cd={};var _0x2df266={};var _0x5e542b;var _0x18a643;return db['FaxAccount'][_0x7e7e('0x64')]({'where':{'id':_0x157531[_0x7e7e('0x56')]['id']}})[_0x7e7e('0x1d')](handleEntityNotFound(_0x1f393f,null))[_0x7e7e('0x1d')](function(_0x4b2292){if(_0x4b2292){_0x5e542b=_0x4b2292;_0x2df266[_0x7e7e('0x42')]=_[_0x7e7e('0x44')](db[_0x7e7e('0x6f')]['rawAttributes']);_0x2df266[_0x7e7e('0x43')]=_['keys'](_0x157531[_0x7e7e('0x43')]);_0x2df266[_0x7e7e('0x45')]=_[_0x7e7e('0x46')](_0x2df266[_0x7e7e('0x42')],_0x2df266[_0x7e7e('0x43')]);_0x4546cd[_0x7e7e('0x47')]=_[_0x7e7e('0x46')](_0x2df266[_0x7e7e('0x42')],qs['fields'](_0x157531['query'][_0x7e7e('0x48')]));_0x4546cd[_0x7e7e('0x47')]=_0x4546cd[_0x7e7e('0x47')]['length']?_0x4546cd[_0x7e7e('0x47')]:_0x2df266[_0x7e7e('0x42')];_0x4546cd['order']=qs[_0x7e7e('0x4c')](_0x157531['query'][_0x7e7e('0x4c')]);_0x4546cd['where']=qs['filters'](_[_0x7e7e('0x66')](_0x157531[_0x7e7e('0x43')],_0x2df266['filters']));if(_0x157531[_0x7e7e('0x43')][_0x7e7e('0x4e')]){_0x4546cd[_0x7e7e('0x4d')]=_[_0x7e7e('0x4f')](_0x4546cd[_0x7e7e('0x4d')],{'$or':_[_0x7e7e('0x3d')](_0x4546cd[_0x7e7e('0x47')],function(_0x175c1e){var _0x4a7a45={};_0x4a7a45[_0x175c1e]={'$like':'%'+_0x157531['query']['filter']+'%'};return _0x4a7a45;})});}_0x4546cd=_[_0x7e7e('0x4f')]({},_0x4546cd,_0x157531[_0x7e7e('0x51')]);return _0x5e542b[_0x7e7e('0xbe')](_0x4546cd);}})['then'](function(_0xa7b6ad){if(_0xa7b6ad){_0x18a643=_0xa7b6ad['length'];if(!_0x157531[_0x7e7e('0x43')][_0x7e7e('0x49')](_0x7e7e('0x4a'))){_0x4546cd[_0x7e7e('0x2b')]=qs[_0x7e7e('0x2b')](_0x157531['query'][_0x7e7e('0x2b')]);_0x4546cd[_0x7e7e('0x2c')]=qs['offset'](_0x157531[_0x7e7e('0x43')][_0x7e7e('0x2c')]);}return _0x5e542b[_0x7e7e('0xbe')](_0x4546cd);}})[_0x7e7e('0x1d')](function(_0x515a1a){if(_0x515a1a){return _0x515a1a?{'count':_0x18a643,'rows':_0x515a1a}:null;}})['then'](respondWithResult(_0x1f393f,null))[_0x7e7e('0x26')](handleError(_0x1f393f,null));}; \ No newline at end of file +var _0xdfee=['User','Owner','Tags','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll','priority','getApplications','context','exten','localstationid','app','system','description','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','VoiceExtension','bulkCreate','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','Contacts','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','end','sendStatus','name','index','mandatoryDispositionPause','map','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','CmContact','Contact'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xdfee,0x10f));var _0xedfe=function(_0x466db8,_0x2b2105){_0x466db8=_0x466db8-0x0;var _0x5e5366=_0xdfee[_0x466db8];return _0x5e5366;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedfe('0x0'));var zipdir=require(_0xedfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedfe('0x2'));var moment=require('moment');var BPromise=require(_0xedfe('0x3'));var Mustache=require(_0xedfe('0x4'));var util=require(_0xedfe('0x5'));var path=require(_0xedfe('0x6'));var sox=require(_0xedfe('0x7'));var csv=require(_0xedfe('0x8'));var ejs=require(_0xedfe('0x9'));var fs=require('fs');var fs_extra=require(_0xedfe('0xa'));var _=require(_0xedfe('0xb'));var squel=require(_0xedfe('0xc'));var crypto=require('crypto');var jsforce=require(_0xedfe('0xd'));var deskjs=require(_0xedfe('0xe'));var toCsv=require(_0xedfe('0x8'));var querystring=require(_0xedfe('0xf'));var Papa=require(_0xedfe('0x10'));var Redis=require(_0xedfe('0x11'));var authService=require(_0xedfe('0x12'));var qs=require(_0xedfe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedfe('0x14'));var logger=require(_0xedfe('0x15'))(_0xedfe('0x16'));var utils=require('../../config/utils');var config=require(_0xedfe('0x17'));var licenseUtil=require(_0xedfe('0x18'));var db=require(_0xedfe('0x19'))['db'];config['redis']=_[_0xedfe('0x1a')](config[_0xedfe('0x1b')],{'host':_0xedfe('0x1c'),'port':0x18eb});var socket=require(_0xedfe('0x1d'))(new Redis(config['redis']));require(_0xedfe('0x1e'))[_0xedfe('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xedfe('0x20')][_0xedfe('0x21')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f19ac,_0x199ab8,_0x90a044,_0x32618c){return new BPromise(function(_0x11415f,_0x1f8123){var _0x3df4e1=_0x32618c||client;return _0x3df4e1[_0xedfe('0x22')](_0x5f19ac,_0x90a044)['then'](function(_0x20df4d){logger[_0xedfe('0x23')](_0xedfe('0x24'),_0x199ab8,_0xedfe('0x25'));logger[_0xedfe('0x26')](_0xedfe('0x27'),_0x199ab8,_0xedfe('0x25'),JSON['stringify'](_0x20df4d));if(_0x20df4d['error']){if(_0x20df4d[_0xedfe('0x28')]['code']===0x1f4){logger[_0xedfe('0x28')](_0xedfe('0x24'),_0x199ab8,_0x20df4d[_0xedfe('0x28')][_0xedfe('0x29')]);return _0x1f8123(_0x20df4d['error'][_0xedfe('0x29')]);}logger[_0xedfe('0x28')](_0xedfe('0x24'),_0x199ab8,_0x20df4d[_0xedfe('0x28')][_0xedfe('0x29')]);return _0x11415f(_0x20df4d[_0xedfe('0x28')][_0xedfe('0x29')]);}else{logger['info'](_0xedfe('0x24'),_0x199ab8,'request\x20sent');_0x11415f(_0x20df4d[_0xedfe('0x2a')][_0xedfe('0x29')]);}})[_0xedfe('0x2b')](function(_0xcd9efa){logger[_0xedfe('0x28')]('FaxAccount,\x20%s,\x20%s',_0x199ab8,_0xcd9efa);_0x1f8123(_0xcd9efa);});});}function respondWithStatusCode(_0x2c2a80,_0x306049){_0x306049=_0x306049||0xcc;return function(_0x20c56a){if(_0x20c56a){return _0x2c2a80['sendStatus'](_0x306049);}return _0x2c2a80['status'](_0x306049)['end']();};}function respondWithResult(_0x2b02c9,_0x30b0cd){_0x30b0cd=_0x30b0cd||0xc8;return function(_0xe193c1){if(_0xe193c1){return _0x2b02c9[_0xedfe('0x2c')](_0x30b0cd)[_0xedfe('0x2d')](_0xe193c1);}};}function respondWithFilteredResult(_0x1b0fbd,_0xf31f24){return function(_0x383d23){if(_0x383d23){var _0x9f237e=typeof _0xf31f24[_0xedfe('0x2e')]==='undefined'&&typeof _0xf31f24[_0xedfe('0x2f')]==='undefined';var _0x30d7c2=_0x383d23[_0xedfe('0x30')];var _0x3edbee=_0x9f237e?0x0:_0xf31f24[_0xedfe('0x2e')];var _0x96c8cc=_0x9f237e?_0x383d23['count']:_0xf31f24['offset']+_0xf31f24[_0xedfe('0x2f')];var _0x5935e2;if(_0x96c8cc>=_0x30d7c2){_0x96c8cc=_0x30d7c2;_0x5935e2=0xc8;}else{_0x5935e2=0xce;}_0x1b0fbd[_0xedfe('0x2c')](_0x5935e2);return _0x1b0fbd[_0xedfe('0x31')]('Content-Range',_0x3edbee+'-'+_0x96c8cc+'/'+_0x30d7c2)[_0xedfe('0x2d')](_0x383d23);}return null;};}function patchUpdates(_0xe056ed){return function(_0x571941){try{jsonpatch[_0xedfe('0x32')](_0x571941,_0xe056ed,!![]);}catch(_0x39e38f){return BPromise[_0xedfe('0x33')](_0x39e38f);}return _0x571941[_0xedfe('0x34')]();};}function saveUpdates(_0x114009,_0x57cb40){return function(_0x30c0f3){if(_0x30c0f3){return _0x30c0f3[_0xedfe('0x35')](_0x114009)[_0xedfe('0x36')](function(_0x5af6e6){return _0x5af6e6;});}return null;};}function removeEntity(_0x4c0ec4,_0x282df7){return function(_0x240944){if(_0x240944){return _0x240944[_0xedfe('0x37')]()[_0xedfe('0x36')](function(){var _0xfb9a6a=_0x240944[_0xedfe('0x38')]({'plain':!![]});var _0x59b15f=_0xedfe('0x39');return db[_0xedfe('0x3a')][_0xedfe('0x37')]({'where':{'type':_0x59b15f,'resourceId':_0xfb9a6a['id']}})[_0xedfe('0x36')](function(){return _0x240944;});})[_0xedfe('0x36')](function(){_0x4c0ec4[_0xedfe('0x2c')](0xcc)[_0xedfe('0x3b')]();});}};}function handleEntityNotFound(_0x3dcb26,_0x1045d5){return function(_0x406028){if(!_0x406028){_0x3dcb26[_0xedfe('0x3c')](0x194);}return _0x406028;};}function handleError(_0x293de9,_0x455c65){_0x455c65=_0x455c65||0x1f4;return function(_0x67172){logger[_0xedfe('0x28')](_0x67172['stack']);if(_0x67172[_0xedfe('0x3d')]){delete _0x67172[_0xedfe('0x3d')];}_0x293de9[_0xedfe('0x2c')](_0x455c65)['send'](_0x67172);};}exports[_0xedfe('0x3e')]=function(_0x3711fd,_0x52c902){var _0x1623fd={'include':[{'model':db['Pause'],'as':_0xedfe('0x3f')}]},_0x58c56a={},_0x5080ea={'count':0x0,'rows':[]};var _0x3be232=_[_0xedfe('0x40')](db['FaxAccount']['rawAttributes'],function(_0x4eac6d){return{'name':_0x4eac6d[_0xedfe('0x41')],'type':_0x4eac6d[_0xedfe('0x42')][_0xedfe('0x43')]};});_0x58c56a[_0xedfe('0x44')]=_[_0xedfe('0x40')](_0x3be232,_0xedfe('0x3d'));_0x58c56a['query']=_['keys'](_0x3711fd[_0xedfe('0x45')]);_0x58c56a['filters']=_[_0xedfe('0x46')](_0x58c56a['model'],_0x58c56a[_0xedfe('0x45')]);_0x1623fd[_0xedfe('0x47')]=_[_0xedfe('0x46')](_0x58c56a['model'],qs[_0xedfe('0x48')](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x48')]));_0x1623fd['attributes']=_0x1623fd[_0xedfe('0x47')][_0xedfe('0x49')]?_0x1623fd[_0xedfe('0x47')]:_0x58c56a[_0xedfe('0x44')];if(!_0x3711fd[_0xedfe('0x45')][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x1623fd[_0xedfe('0x2f')]=qs[_0xedfe('0x2f')](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x2f')]);_0x1623fd['offset']=qs['offset'](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x1623fd[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x3711fd[_0xedfe('0x45')][_0xedfe('0x4d')]);_0x1623fd[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x3711fd['query'],_0x58c56a[_0xedfe('0x4f')]),_0x3be232);if(_0x3711fd[_0xedfe('0x45')][_0xedfe('0x51')]){_0x1623fd['where']=_[_0xedfe('0x52')](_0x1623fd[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x3be232,function(_0x3069af){if(_0x3069af[_0xedfe('0x42')]!==_0xedfe('0x53')){var _0x193561={};_0x193561[_0x3069af['name']]={'$like':'%'+_0x3711fd['query'][_0xedfe('0x51')]+'%'};return _0x193561;}})});}_0x1623fd=_[_0xedfe('0x52')]({},_0x1623fd,_0x3711fd[_0xedfe('0x54')]);var _0x14c350={'where':_0x1623fd[_0xedfe('0x4e')]};return db[_0xedfe('0x55')]['count'](_0x14c350)[_0xedfe('0x36')](function(_0x2695a2){_0x5080ea[_0xedfe('0x30')]=_0x2695a2;if(_0x3711fd[_0xedfe('0x45')][_0xedfe('0x56')]){_0x1623fd['include']=[{'all':!![]}];}return db[_0xedfe('0x55')][_0xedfe('0x57')](_0x1623fd);})[_0xedfe('0x36')](function(_0x5bdc09){_0x5080ea[_0xedfe('0x58')]=_0x5bdc09;return _0x5080ea;})[_0xedfe('0x36')](respondWithFilteredResult(_0x52c902,_0x1623fd))[_0xedfe('0x2b')](handleError(_0x52c902,null));};exports[_0xedfe('0x59')]=function(_0x305692,_0x4c3e53){var _0x31d1be={'raw':![],'where':{'id':_0x305692[_0xedfe('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0xedfe('0x3f')}]},_0x680f46={};_0x680f46[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0x55')][_0xedfe('0x5c')]);_0x680f46[_0xedfe('0x45')]=_['keys'](_0x305692[_0xedfe('0x45')]);_0x680f46[_0xedfe('0x4f')]=_['intersection'](_0x680f46['model'],_0x680f46[_0xedfe('0x45')]);_0x31d1be[_0xedfe('0x47')]=_['intersection'](_0x680f46[_0xedfe('0x44')],qs['fields'](_0x305692['query']['fields']));_0x31d1be[_0xedfe('0x47')]=_0x31d1be[_0xedfe('0x47')][_0xedfe('0x49')]?_0x31d1be[_0xedfe('0x47')]:_0x680f46[_0xedfe('0x44')];if(_0x305692[_0xedfe('0x45')][_0xedfe('0x56')]){_0x31d1be[_0xedfe('0x5d')]=[{'all':!![]}];}_0x31d1be=_[_0xedfe('0x52')]({},_0x31d1be,_0x305692[_0xedfe('0x54')]);return db[_0xedfe('0x55')][_0xedfe('0x5e')](_0x31d1be)[_0xedfe('0x36')](handleEntityNotFound(_0x4c3e53,null))[_0xedfe('0x36')](respondWithResult(_0x4c3e53,null))['catch'](handleError(_0x4c3e53,null));};exports[_0xedfe('0x5f')]=function(_0xc17bdc,_0x3c1f83){return db[_0xedfe('0x55')]['create'](_0xc17bdc['body'],{})['then'](function(_0x7909bf){var _0x24f21d=_0xc17bdc['user'][_0xedfe('0x38')]({'plain':!![]});if(!_0x24f21d)throw new Error(_0xedfe('0x60'));if(_0x24f21d[_0xedfe('0x61')]===_0xedfe('0x62')){var _0x1b6764=_0x7909bf[_0xedfe('0x38')]({'plain':!![]});var _0x39f538=_0xedfe('0x39');return db[_0xedfe('0x63')][_0xedfe('0x5e')]({'where':{'name':_0x39f538,'userProfileId':_0x24f21d[_0xedfe('0x64')]},'raw':!![]})[_0xedfe('0x36')](function(_0x56f5e4){if(_0x56f5e4&&_0x56f5e4[_0xedfe('0x65')]===0x0){return db['UserProfileResource'][_0xedfe('0x5f')]({'name':_0x1b6764['name'],'resourceId':_0x1b6764['id'],'type':_0x56f5e4[_0xedfe('0x3d')],'sectionId':_0x56f5e4['id']},{})[_0xedfe('0x36')](function(){return _0x7909bf;});}else{return _0x7909bf;}})[_0xedfe('0x2b')](function(_0x4718c3){logger['error'](_0xedfe('0x66'),_0x4718c3);throw _0x4718c3;});}return _0x7909bf;})[_0xedfe('0x36')](respondWithResult(_0x3c1f83,0xc9))[_0xedfe('0x2b')](handleError(_0x3c1f83,null));};exports[_0xedfe('0x35')]=function(_0x4716a3,_0x14c48b){if(_0x4716a3[_0xedfe('0x67')]['id']){delete _0x4716a3[_0xedfe('0x67')]['id'];}return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x4716a3['params']['id']},'include':[{'model':db[_0xedfe('0x68')],'as':_0xedfe('0x3f')}]})[_0xedfe('0x36')](handleEntityNotFound(_0x14c48b,null))[_0xedfe('0x36')](saveUpdates(_0x4716a3[_0xedfe('0x67')],null))[_0xedfe('0x36')](respondWithResult(_0x14c48b,null))[_0xedfe('0x2b')](handleError(_0x14c48b,null));};exports[_0xedfe('0x37')]=function(_0x2ff90f,_0x15cb55){return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x2ff90f[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x15cb55,null))['then'](removeEntity(_0x15cb55,null))[_0xedfe('0x2b')](handleError(_0x15cb55,null));};exports[_0xedfe('0x69')]=function(_0x43b75b,_0x5d1a67){return db[_0xedfe('0x55')][_0xedfe('0x69')]()[_0xedfe('0x36')](respondWithResult(_0x5d1a67,null))[_0xedfe('0x2b')](handleError(_0x5d1a67,null));};exports[_0xedfe('0x6a')]=function(_0x1dc7c0,_0x3be0a8,_0x3a4f8a){if(_0x1dc7c0[_0xedfe('0x67')]['id']){delete _0x1dc7c0['body']['id'];}return db[_0xedfe('0x55')]['find']({'where':{'id':_0x1dc7c0[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x3be0a8,null))[_0xedfe('0x36')](function(_0x596009){if(_0x596009){_0x1dc7c0[_0xedfe('0x67')][_0xedfe('0x6b')]=_0x596009['id'];return db[_0xedfe('0x6c')][_0xedfe('0x5f')](_0x1dc7c0['body']);}})['then'](respondWithResult(_0x3be0a8,null))[_0xedfe('0x2b')](handleError(_0x3be0a8,null));};exports[_0xedfe('0x6d')]=function(_0x14070c,_0x261e29,_0x143c8d){var _0x19f762={'raw':![],'where':{}};var _0x2d57e1={};var _0x136701={'count':0x0,'rows':[]};return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x14070c[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x261e29,null))['then'](function(_0x18fe42){if(_0x18fe42){_0x2d57e1[_0xedfe('0x44')]=_['keys'](db['Disposition']['rawAttributes']);_0x2d57e1[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x14070c[_0xedfe('0x45')]);_0x2d57e1[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x2d57e1[_0xedfe('0x44')],_0x2d57e1['query']);_0x19f762['attributes']=_['intersection'](_0x2d57e1[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x14070c[_0xedfe('0x45')][_0xedfe('0x48')]));_0x19f762[_0xedfe('0x47')]=_0x19f762[_0xedfe('0x47')][_0xedfe('0x49')]?_0x19f762[_0xedfe('0x47')]:_0x2d57e1[_0xedfe('0x44')];if(!_0x14070c['query'][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x19f762['limit']=qs['limit'](_0x14070c[_0xedfe('0x45')][_0xedfe('0x2f')]);_0x19f762[_0xedfe('0x2e')]=qs[_0xedfe('0x2e')](_0x14070c[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x19f762[_0xedfe('0x4c')]=qs['sort'](_0x14070c[_0xedfe('0x45')]['sort']);_0x19f762[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x14070c[_0xedfe('0x45')],_0x2d57e1[_0xedfe('0x4f')]));_0x19f762[_0xedfe('0x4e')]['FaxAccountId']=_0x18fe42['id'];if(_0x14070c[_0xedfe('0x45')][_0xedfe('0x51')]){_0x19f762[_0xedfe('0x4e')]=_[_0xedfe('0x52')](_0x19f762['where'],{'$or':_[_0xedfe('0x40')](_0x19f762[_0xedfe('0x47')],function(_0x4456d4){var _0x3d7926={};_0x3d7926[_0x4456d4]={'$like':'%'+_0x14070c[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x3d7926;})});}_0x19f762=_[_0xedfe('0x52')]({},_0x19f762,_0x14070c[_0xedfe('0x54')]);return db['Disposition']['count']({'where':_0x19f762['where']})['then'](function(_0x3e2296){_0x136701[_0xedfe('0x30')]=_0x3e2296;if(_0x14070c[_0xedfe('0x45')][_0xedfe('0x56')]){_0x19f762['include']=[{'all':!![]}];}return db['Disposition'][_0xedfe('0x57')](_0x19f762);})['then'](function(_0x525dbc){_0x136701[_0xedfe('0x58')]=_0x525dbc;return _0x136701;});}})[_0xedfe('0x36')](respondWithFilteredResult(_0x261e29,_0x19f762))['catch'](handleError(_0x261e29,null));};exports[_0xedfe('0x6f')]=function(_0x4e4e3e,_0x3ca231,_0x28cf23){return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x4e4e3e[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ca231,null))['then'](function(_0x3f751d){if(_0x3f751d){return _0x3f751d[_0xedfe('0x6f')](_0x4e4e3e[_0xedfe('0x45')][_0xedfe('0x70')]);}})[_0xedfe('0x36')](respondWithStatusCode(_0x3ca231,null))['catch'](handleError(_0x3ca231,null));};exports[_0xedfe('0x71')]=function(_0xe773c5,_0x15c17a,_0x877dee){if(_0xe773c5[_0xedfe('0x67')]['id']){delete _0xe773c5['body']['id'];}return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0xe773c5[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x15c17a,null))[_0xedfe('0x36')](function(_0x18b0c6){if(_0x18b0c6){_0xe773c5['body']['FaxAccountId']=_0x18b0c6['id'];return db[_0xedfe('0x72')][_0xedfe('0x5f')](_0xe773c5[_0xedfe('0x67')]);}})['then'](respondWithResult(_0x15c17a,null))[_0xedfe('0x2b')](handleError(_0x15c17a,null));};exports[_0xedfe('0x73')]=function(_0x58c568,_0x35191b,_0x30b2cb){var _0x3280be={'raw':![],'where':{}};var _0x1d7a6d={};var _0x496b39={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x58c568['params']['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x35191b,null))['then'](function(_0x5e1c73){if(_0x5e1c73){_0x1d7a6d[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0x72')][_0xedfe('0x5c')]);_0x1d7a6d[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x58c568[_0xedfe('0x45')]);_0x1d7a6d['filters']=_[_0xedfe('0x46')](_0x1d7a6d['model'],_0x1d7a6d[_0xedfe('0x45')]);_0x3280be['attributes']=_[_0xedfe('0x46')](_0x1d7a6d[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x58c568[_0xedfe('0x45')][_0xedfe('0x48')]));_0x3280be[_0xedfe('0x47')]=_0x3280be[_0xedfe('0x47')][_0xedfe('0x49')]?_0x3280be['attributes']:_0x1d7a6d[_0xedfe('0x44')];if(!_0x58c568['query']['hasOwnProperty']('nolimit')){_0x3280be['limit']=qs['limit'](_0x58c568['query']['limit']);_0x3280be['offset']=qs[_0xedfe('0x2e')](_0x58c568[_0xedfe('0x45')]['offset']);}_0x3280be['order']=qs[_0xedfe('0x4d')](_0x58c568[_0xedfe('0x45')][_0xedfe('0x4d')]);_0x3280be[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_['pick'](_0x58c568['query'],_0x1d7a6d[_0xedfe('0x4f')]));_0x3280be[_0xedfe('0x4e')][_0xedfe('0x6b')]=_0x5e1c73['id'];if(_0x58c568[_0xedfe('0x45')][_0xedfe('0x51')]){_0x3280be['where']=_[_0xedfe('0x52')](_0x3280be[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x3280be['attributes'],function(_0xf8d7d0){var _0x33ef20={};_0x33ef20[_0xf8d7d0]={'$like':'%'+_0x58c568['query'][_0xedfe('0x51')]+'%'};return _0x33ef20;})});}_0x3280be=_[_0xedfe('0x52')]({},_0x3280be,_0x58c568[_0xedfe('0x54')]);return db[_0xedfe('0x72')][_0xedfe('0x30')]({'where':_0x3280be['where']})['then'](function(_0x466b85){_0x496b39[_0xedfe('0x30')]=_0x466b85;if(_0x58c568[_0xedfe('0x45')]['includeAll']){_0x3280be[_0xedfe('0x5d')]=[{'all':!![]}];}return db[_0xedfe('0x72')][_0xedfe('0x57')](_0x3280be);})[_0xedfe('0x36')](function(_0x199adb){_0x496b39[_0xedfe('0x58')]=_0x199adb;return _0x496b39;});}})[_0xedfe('0x36')](respondWithFilteredResult(_0x35191b,_0x3280be))[_0xedfe('0x2b')](handleError(_0x35191b,null));};exports[_0xedfe('0x74')]=function(_0x401f83,_0x31049a,_0x32083e){return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x401f83[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x31049a,null))[_0xedfe('0x36')](function(_0x4fda01){if(_0x4fda01){return _0x4fda01[_0xedfe('0x74')](_0x401f83[_0xedfe('0x45')][_0xedfe('0x70')]);}})[_0xedfe('0x36')](respondWithStatusCode(_0x31049a,null))[_0xedfe('0x2b')](handleError(_0x31049a,null));};exports['addInteraction']=function(_0x24182e,_0x40f95e,_0x1681f4){return db[_0xedfe('0x75')][_0xedfe('0x5e')]({'where':{'id':_0x24182e[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x40f95e,null))['then'](function(_0x41e611){if(_0x41e611){return _0x41e611['addInteraction'](_0x24182e['body'][_0xedfe('0x70')],_[_0xedfe('0x76')](_0x24182e['body'],[_0xedfe('0x70'),'id'])||{});}})['then'](respondWithResult(_0x40f95e,null))[_0xedfe('0x2b')](handleError(_0x40f95e,null));};exports['getInteractions']=function(_0x5e3865,_0x5de3ea,_0x1b81e3){var _0x34a189={'raw':![],'where':{}};var _0xe6cbca={};var _0x2f86e6={'count':0x0,'rows':[]};return db['FaxAccount'][_0xedfe('0x6e')]({'where':{'id':_0x5e3865[_0xedfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5de3ea,null))['then'](function(_0x334572){if(_0x334572){_0xe6cbca['model']=_['keys'](db[_0xedfe('0x75')][_0xedfe('0x5c')]);_0xe6cbca['query']=_[_0xedfe('0x5b')](_0x5e3865[_0xedfe('0x45')]);_0xe6cbca[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0xe6cbca[_0xedfe('0x44')],_0xe6cbca[_0xedfe('0x45')]);_0x34a189['attributes']=_[_0xedfe('0x46')](_0xe6cbca[_0xedfe('0x44')],qs['fields'](_0x5e3865['query'][_0xedfe('0x48')]));_0x34a189[_0xedfe('0x47')]=_0x34a189[_0xedfe('0x47')]['length']?_0x34a189['attributes']:_0xe6cbca[_0xedfe('0x44')];if(!_0x5e3865['query'][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x34a189['limit']=qs[_0xedfe('0x2f')](_0x5e3865[_0xedfe('0x45')][_0xedfe('0x2f')]);_0x34a189['offset']=qs[_0xedfe('0x2e')](_0x5e3865[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x34a189[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x5e3865[_0xedfe('0x45')]['sort']);_0x34a189[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x5e3865[_0xedfe('0x45')],_0xe6cbca[_0xedfe('0x4f')]));_0x34a189[_0xedfe('0x4e')][_0xedfe('0x6b')]=_0x334572['id'];if(_0x5e3865[_0xedfe('0x45')][_0xedfe('0x51')]){_0x34a189['where']=_['merge'](_0x34a189[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x34a189[_0xedfe('0x47')],function(_0x3f97c4){var _0x49ce5c={};_0x49ce5c[_0x3f97c4]={'$like':'%'+_0x5e3865[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x49ce5c;})});}_0x34a189=_['merge']({},_0x34a189,_0x5e3865[_0xedfe('0x54')]);return db[_0xedfe('0x75')][_0xedfe('0x30')]({'where':_0x34a189[_0xedfe('0x4e')]})[_0xedfe('0x36')](function(_0x449c48){_0x2f86e6[_0xedfe('0x30')]=_0x449c48;if(_0x5e3865[_0xedfe('0x45')]['includeAll']){_0x34a189['include']=[{'model':db[_0xedfe('0x77')],'as':_0xedfe('0x78'),'required':![]},{'model':db[_0xedfe('0x79')],'as':_0xedfe('0x7a'),'attributes':[_0xedfe('0x3d'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xedfe('0x7b'),'attributes':['id','name','color'],'where':_0x5e3865[_0xedfe('0x45')][_0xedfe('0x7c')]?{'id':_0x5e3865[_0xedfe('0x45')]['tag']}:undefined,'required':_0x5e3865[_0xedfe('0x45')][_0xedfe('0x7c')]?!![]:![]}];}return db[_0xedfe('0x75')][_0xedfe('0x57')](_0x34a189);})[_0xedfe('0x36')](function(_0x46adab){_0x2f86e6[_0xedfe('0x58')]=_0x46adab;return _0x2f86e6;});}})[_0xedfe('0x36')](respondWithFilteredResult(_0x5de3ea,_0x34a189))['catch'](handleError(_0x5de3ea,null));};exports[_0xedfe('0x7d')]=function(_0x57e2be,_0x3bea5e){var _0x4f170e=_0x57e2be[_0xedfe('0x5a')]['id'];var _0x93f18f=_0x57e2be[_0xedfe('0x67')];var _0x51d3f8=0xc8;var _0x1ba443=null;return db[_0xedfe('0x7e')]['transaction']({'isolationLevel':db[_0xedfe('0x7e')][_0xedfe('0x7f')][_0xedfe('0x80')]['READ_COMMITTED']},function(_0x21bade){return db[_0xedfe('0x55')]['findOne']({'where':{'id':_0x4f170e},'transaction':_0x21bade})['then'](function(_0x3cb23c){if(_0x3cb23c){return db[_0xedfe('0x81')]['destroy']({'where':{'FaxAccountId':_0x4f170e},'transaction':_0x21bade})[_0xedfe('0x36')](function(){var _0x3afa72=_[_0xedfe('0x40')](_0x93f18f,function(_0x213b35){_0x213b35[_0xedfe('0x6b')]=_0x4f170e;return _0x213b35;});return db['FaxApplication']['bulkCreate'](_0x3afa72,{'transaction':_0x21bade});});}else{_0x51d3f8=0x194;_0x1ba443=[];}});})[_0xedfe('0x36')](function(){if(_0x51d3f8!==0x194){return db[_0xedfe('0x81')][_0xedfe('0x82')]({'where':{'FaxAccountId':_0x4f170e},'order':_0xedfe('0x83')})[_0xedfe('0x36')](function(_0x20a0ad){_0x1ba443=_0x20a0ad;});}})['catch'](function(_0x1e9d36){_0x51d3f8=0x1f4;logger[_0xedfe('0x28')](_0x1e9d36['stack']);if(_0x1e9d36['name']){delete _0x1e9d36[_0xedfe('0x3d')];}_0x1ba443=_0x1e9d36;})['finally'](function(){if(_0x1ba443===null){_0x3bea5e[_0xedfe('0x3c')](_0x51d3f8);}else{if(_0x51d3f8===0x1f4){_0x3bea5e[_0xedfe('0x2c')](_0x51d3f8)['send'](_0x1ba443);}else{_0x3bea5e[_0xedfe('0x2c')](_0x51d3f8)['json'](_0x1ba443);}}});};exports[_0xedfe('0x84')]=function(_0x4fd62b,_0x104dee,_0xab716a){var _0x1a26d4={};var _0x4fc0d1={};var _0x26d18a;var _0x1a1ad2;return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x4fd62b['params']['id']}})['then'](handleEntityNotFound(_0x104dee,null))[_0xedfe('0x36')](function(_0x18d5ca){if(_0x18d5ca){_0x26d18a=_0x18d5ca;_0x4fc0d1[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0x81')][_0xedfe('0x5c')]);_0x4fc0d1[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x4fd62b[_0xedfe('0x45')]);_0x4fc0d1[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x4fc0d1['model'],_0x4fc0d1[_0xedfe('0x45')]);_0x1a26d4[_0xedfe('0x47')]=_['intersection'](_0x4fc0d1['model'],qs[_0xedfe('0x48')](_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x48')]));_0x1a26d4[_0xedfe('0x47')]=_0x1a26d4[_0xedfe('0x47')][_0xedfe('0x49')]?_0x1a26d4[_0xedfe('0x47')]:_0x4fc0d1['model'];_0x1a26d4[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x4fd62b['query']['sort']);_0x1a26d4[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_[_0xedfe('0x50')](_0x4fd62b[_0xedfe('0x45')],_0x4fc0d1['filters']));if(_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x51')]){_0x1a26d4[_0xedfe('0x4e')]=_[_0xedfe('0x52')](_0x1a26d4[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x1a26d4['attributes'],function(_0x2f5b53){var _0x3d58fb={};_0x3d58fb[_0x2f5b53]={'$like':'%'+_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x3d58fb;})});}_0x1a26d4=_['merge']({},_0x1a26d4,_0x4fd62b[_0xedfe('0x54')]);return _0x26d18a[_0xedfe('0x84')](_0x1a26d4);}})[_0xedfe('0x36')](function(_0x21519f){if(_0x21519f){_0x1a1ad2=_0x21519f['length'];if(!_0x4fd62b[_0xedfe('0x45')]['hasOwnProperty'](_0xedfe('0x4b'))){_0x1a26d4[_0xedfe('0x2f')]=qs[_0xedfe('0x2f')](_0x4fd62b['query'][_0xedfe('0x2f')]);_0x1a26d4[_0xedfe('0x2e')]=qs[_0xedfe('0x2e')](_0x4fd62b[_0xedfe('0x45')][_0xedfe('0x2e')]);}return _0x26d18a[_0xedfe('0x84')](_0x1a26d4);}})[_0xedfe('0x36')](function(_0x19d7a9){if(_0x19d7a9){return _0x19d7a9?{'count':_0x1a1ad2,'rows':_0x19d7a9}:null;}})[_0xedfe('0x36')](respondWithResult(_0x104dee,null))[_0xedfe('0x2b')](handleError(_0x104dee,null));};function Extension(_0x43ad9b,_0x1d80ec,_0x581ef1,_0xf2b17b){this[_0xedfe('0x85')]='from-voip-provider';this[_0xedfe('0x86')]=_0x43ad9b[_0xedfe('0x87')];this[_0xedfe('0x88')]=_0xf2b17b;this[_0xedfe('0x42')]=_0xedfe('0x89');this[_0xedfe('0x8a')]='Fax\x20Extension';this[_0xedfe('0x6b')]=_0x43ad9b['id'];this[_0xedfe('0x83')]=_0x1d80ec;this[_0xedfe('0x8b')]=_0x581ef1;}function createExtensionsReciveFax(_0x3b89b2){var _0x51cda2=0x1;var _0x2e6375=[];_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,'','Answer'));_0x51cda2+=0x1;_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,_0xedfe('0x8d'),_0xedfe('0x8e')));_0x51cda2+=0x1;for(var _0x5b32f0 in _0x3b89b2){if(_0x3b89b2[_0xedfe('0x4a')](_0x5b32f0)&&(_0x5b32f0===_0xedfe('0x8f')||_0x5b32f0===_0xedfe('0x87')||_0x5b32f0===_0xedfe('0x90')||_0x5b32f0===_0xedfe('0x91')||_0x5b32f0===_0xedfe('0x92')||_0x5b32f0===_0xedfe('0x93')||_0x5b32f0===_0xedfe('0x94')||_0x5b32f0===_0xedfe('0x95')||_0x5b32f0===_0xedfe('0x96'))){_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,_0xedfe('0x97')+_0x5b32f0+')='+_0x3b89b2[_0x5b32f0],_0xedfe('0x8e')));_0x51cda2+=0x1;}}_0x2e6375['push'](new Extension(_0x3b89b2,_0x51cda2,'6',_0xedfe('0x98')));_0x51cda2+=0x1;_0x2e6375[_0xedfe('0x8c')](new Extension(_0x3b89b2,_0x51cda2,_0xedfe('0x99'),'ReceiveFax'));_0x51cda2=0x0;return _0x2e6375;}exports['addAccountApplications']=function(_0x15dc55,_0x1071de,_0x3e8982){var _0x4d607e;return db[_0xedfe('0x7e')]['transaction'](function(_0x5ae3d5){return db[_0xedfe('0x55')]['create'](_0x15dc55[_0xedfe('0x67')],{'transaction':_0x5ae3d5})[_0xedfe('0x36')](function(_0x7600cf){_0x4d607e=_0x7600cf[_0xedfe('0x38')]({'plain':!![]});return db[_0xedfe('0x9a')][_0xedfe('0x9b')](createExtensionsReciveFax(_0x4d607e),{'transaction':_0x5ae3d5});});})[_0xedfe('0x36')](function(){return _0x4d607e;})[_0xedfe('0x36')](respondWithResult(_0x1071de,null))[_0xedfe('0x2b')](handleError(_0x1071de,null));};exports['updateAccountApplications']=function(_0x4c2e84,_0xe8b2b4,_0x447692){var _0x59b663;return db[_0xedfe('0x7e')]['transaction'](function(_0x13f950){return db[_0xedfe('0x55')]['update'](_0x4c2e84['body'],{'where':{'id':_0x4c2e84[_0xedfe('0x67')]['id']},'transaction':_0x13f950})[_0xedfe('0x36')](function(_0x3b8223){return db[_0xedfe('0x9a')][_0xedfe('0x37')]({'where':{'FaxAccountId':_0x4c2e84[_0xedfe('0x67')]['id']},'transaction':_0x13f950})[_0xedfe('0x36')](function(_0x19414f){return db['VoiceExtension'][_0xedfe('0x9b')](createExtensionsReciveFax(_[_0xedfe('0x76')](_0x4c2e84[_0xedfe('0x67')],['tech','key',_0xedfe('0x9c'),_0xedfe('0x9d'),_0xedfe('0x9e'),_0xedfe('0x9f')])),{'transaction':_0x13f950});});});})[_0xedfe('0x36')](function(){return db[_0xedfe('0x55')][_0xedfe('0xa0')](_0x4c2e84[_0xedfe('0x67')]['id']);})[_0xedfe('0x36')](respondWithResult(_0xe8b2b4,null))[_0xedfe('0x2b')](handleError(_0xe8b2b4,null));};exports[_0xedfe('0xa1')]=function(_0x20ce57,_0x2d6b8f,_0x1951c7){var _0x67f223={'raw':!![],'where':{}};var _0x27adc9={};var _0x559f33={'count':0x0,'rows':[]};return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x20ce57['params']['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x2d6b8f,null))[_0xedfe('0x36')](function(_0x39121e){if(_0x39121e){_0x27adc9[_0xedfe('0x44')]=_[_0xedfe('0x5b')](db[_0xedfe('0xa2')][_0xedfe('0x5c')]);_0x27adc9['query']=_[_0xedfe('0x5b')](_0x20ce57[_0xedfe('0x45')]);_0x27adc9[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x27adc9[_0xedfe('0x44')],_0x27adc9[_0xedfe('0x45')]);_0x67f223[_0xedfe('0x47')]=_[_0xedfe('0x46')](_0x27adc9[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x20ce57[_0xedfe('0x45')]['fields']));_0x67f223[_0xedfe('0x47')]=_0x67f223[_0xedfe('0x47')][_0xedfe('0x49')]?_0x67f223['attributes']:_0x27adc9[_0xedfe('0x44')];if(!_0x20ce57[_0xedfe('0x45')][_0xedfe('0x4a')]('nolimit')){_0x67f223[_0xedfe('0x2f')]=qs[_0xedfe('0x2f')](_0x20ce57['query']['limit']);_0x67f223[_0xedfe('0x2e')]=qs['offset'](_0x20ce57[_0xedfe('0x45')][_0xedfe('0x2e')]);}_0x67f223[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x20ce57['query']['sort']);_0x67f223[_0xedfe('0x4e')]=qs[_0xedfe('0x4f')](_['pick'](_0x20ce57[_0xedfe('0x45')],_0x27adc9[_0xedfe('0x4f')]));_0x67f223['where'][_0xedfe('0x6b')]=_0x39121e['id'];if(_0x20ce57[_0xedfe('0x45')][_0xedfe('0x51')]){_0x67f223[_0xedfe('0x4e')]=_['merge'](_0x67f223['where'],{'$or':_['map'](_0x67f223[_0xedfe('0x47')],function(_0x4af27f){var _0x554b7f={};_0x554b7f[_0x4af27f]={'$like':'%'+_0x20ce57[_0xedfe('0x45')][_0xedfe('0x51')]+'%'};return _0x554b7f;})});}if(_0x20ce57['query']['$gte']){var _0xbf6979=_0x20ce57[_0xedfe('0x45')][_0xedfe('0xa3')]['split'](',');var _0x1a4c5d={};_0x1a4c5d[_0xbf6979[0x0]]={'$gte':moment(_0xbf6979[0x1])[_0xedfe('0xa4')](_0xedfe('0xa5'))};_0x67f223[_0xedfe('0x4e')]=_[_0xedfe('0x52')](_0x67f223[_0xedfe('0x4e')],_0x1a4c5d);}_0x67f223=_[_0xedfe('0x52')]({},_0x67f223,_0x20ce57[_0xedfe('0x54')]);return db[_0xedfe('0xa2')]['count']({'where':_0x67f223['where']})[_0xedfe('0x36')](function(_0x540543){_0x559f33['count']=_0x540543;if(_0x20ce57['query'][_0xedfe('0x56')]){_0x67f223[_0xedfe('0x5d')]=[{'all':!![]}];}return db['FaxMessage'][_0xedfe('0x57')](_0x67f223);})[_0xedfe('0x36')](function(_0x407b6a){_0x559f33['rows']=_0x407b6a;return _0x559f33;});}})['then'](respondWithFilteredResult(_0x2d6b8f,_0x67f223))['catch'](handleError(_0x2d6b8f,null));};exports[_0xedfe('0xa6')]=function(_0x48a3b7,_0x46a6ba,_0x52634d){var _0x332fd0,_0x2c2de7={},_0xd2570e;if(_0x48a3b7[_0xedfe('0x67')]['to']){_0xd2570e=_0x48a3b7[_0xedfe('0x67')]['to'][0x0];}return db[_0xedfe('0x55')][_0xedfe('0x5e')]({'where':{'id':_0x48a3b7[_0xedfe('0x5a')]['id']},'include':[{'model':db[_0xedfe('0xa7')],'as':_0xedfe('0xa8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0xd2570e},'limit':0x1,'order':[[_0xedfe('0x9d'),_0xedfe('0xa9')]]}]}]})[_0xedfe('0x36')](handleEntityNotFound(_0x46a6ba,null))[_0xedfe('0x36')](function(_0x37488d){_0x332fd0=_0x37488d;if(_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')]&&_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0xedfe('0x49')]){for(var _0x5ecbf1=0x0;_0x5ecbf1<_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0xedfe('0x49')];_0x5ecbf1+=0x1){_0x48a3b7['body'][_0xedfe('0xaa')][_0x5ecbf1]={'filename':_0x48a3b7[_0xedfe('0x67')]['attachments'][_0x5ecbf1]['name'],'id':_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0x5ecbf1]['id'],'path':path[_0xedfe('0xab')](config[_0xedfe('0xac')],_0xedfe('0xad'),_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][_0x5ecbf1]['basename'])};}}return respondWithRpcPromise(_0xedfe('0xae'),_0xedfe('0xae'),{'FaxAccountId':_['isNil'](_0x48a3b7[_0xedfe('0x5a')]['id'])?undefined:_0x48a3b7[_0xedfe('0x5a')]['id'],'path':_['isNil'](_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['path'])?undefined:_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['path'],'fax':_[_0xedfe('0xaf')](_0x48a3b7[_0xedfe('0x67')]['to'][0x0])?undefined:_0x48a3b7[_0xedfe('0x67')]['to'][0x0]},client9002);})[_0xedfe('0x36')](function(){if(_0x332fd0){if(_[_0xedfe('0xaf')](_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xb0')])){_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xb0')]=util['format']('\x22%s\x22\x20<%s>',_0x332fd0['name'],_0x332fd0[_0xedfe('0xb1')]);}if(_0x332fd0[_0xedfe('0xa8')]){if(_0x332fd0[_0xedfe('0xa8')][_0xedfe('0xb2')][_0xedfe('0x49')]){return _0x332fd0[_0xedfe('0xa8')][_0xedfe('0xb2')][0x0];}else{return db[_0xedfe('0x77')][_0xedfe('0x5f')](_['defaults'](_0x48a3b7['body'],{'firstName':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'phone':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'fax':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'ListId':_0x332fd0[_0xedfe('0x9f')]}));}}else{throw new Error(_0xedfe('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xedfe('0x36')](function(_0x109ed8){if(_0x109ed8){return db[_0xedfe('0x75')]['find']({'where':{'ContactId':_0x109ed8['id'],'closed':![],'FaxAccountId':_0x332fd0['id']}})[_0xedfe('0x36')](function(_0x139b19){if(_0x139b19){return[_0x139b19,![]];}return db[_0xedfe('0x75')][_0xedfe('0x5f')]({'UserId':_0x48a3b7[_0xedfe('0x62')]['id'],'ContactId':_0x109ed8['id'],'FaxAccountId':_0x332fd0['id'],'fax':_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'firstMsgDirection':_0xedfe('0xb4'),'Messages':[_[_0xedfe('0x52')](_0x48a3b7[_0xedfe('0x67')],{'read':![],'body':_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][0x0][_0xedfe('0xb5')],'FaxAccountId':_0x332fd0['id'],'UserId':_0x48a3b7[_0xedfe('0x62')]['id'],'ContactId':_0x109ed8['id'],'AttachmentId':_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xedfe('0xa2')],'as':_0xedfe('0xb6')}]})[_0xedfe('0x36')](function(_0x4c7927){return[_0x4c7927,!![]];});});}else{throw new Error(_0xedfe('0xb7'));}})[_0xedfe('0xb8')](function(_0x3520fb,_0x576568){if(_0x576568){return _0x3520fb;}return db[_0xedfe('0xa2')][_0xedfe('0x5f')]({'direction':_0xedfe('0xb4'),'read':![],'body':_0x48a3b7['body'][_0xedfe('0xaa')][0x0]['filename'],'FaxAccountId':_0x332fd0['id'],'FaxInteractionId':_0x3520fb['id'],'UserId':_0x48a3b7[_0xedfe('0x62')]['id'],'ContactId':_0x3520fb[_0xedfe('0xb9')],'AttachmentId':_0x48a3b7[_0xedfe('0x67')]['attachments'][0x0]['id']})[_0xedfe('0x36')](function(_0x3d63e4){_0x3520fb[_0xedfe('0xba')][_0xedfe('0xb6')]=[];_0x3520fb['dataValues'][_0xedfe('0xb6')]['push'](_0x3d63e4[_0xedfe('0xba')]);return _0x3520fb;});})[_0xedfe('0x36')](function(_0x70be2c){respondWithRpcPromise(_0xedfe('0xbb'),_0xedfe('0xbb'),{'FaxAccountId':_[_0xedfe('0xaf')](_0x48a3b7[_0xedfe('0x5a')]['id'])?undefined:_0x48a3b7[_0xedfe('0x5a')]['id'],'path':_[_0xedfe('0xaf')](_0x48a3b7['body'][_0xedfe('0xaa')][0x0][_0xedfe('0x6')])?undefined:_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][0x0][_0xedfe('0x6')],'fax':_[_0xedfe('0xaf')](_0x48a3b7['body']['to'][0x0])?undefined:_0x48a3b7[_0xedfe('0x67')]['to'][0x0],'AttachmentId':_0x48a3b7[_0xedfe('0x67')][_0xedfe('0xaa')][0x0]['id']},client9002)[_0xedfe('0x36')](function(_0x3f1493){logger[_0xedfe('0x23')](_0xedfe('0xbc'),_0x3f1493);})[_0xedfe('0x2b')](function(_0x2734b5){logger[_0xedfe('0x23')](_0xedfe('0xbc'),_0x2734b5);});return _0x70be2c;})[_0xedfe('0x36')](respondWithResult(_0x46a6ba,null))[_0xedfe('0x2b')](handleError(_0x46a6ba,null));};exports[_0xedfe('0xbd')]=function(_0x12b6b4,_0x390d97,_0x2b70ed){return db[_0xedfe('0x55')]['find']({'where':{'id':_0x12b6b4['params']['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x390d97,null))[_0xedfe('0x36')](function(_0x2b6263){if(_0x2b6263){return _0x2b6263[_0xedfe('0xbd')](_0x12b6b4[_0xedfe('0x67')][_0xedfe('0x70')],_['omit'](_0x12b6b4[_0xedfe('0x67')],['ids','id'])||{})[_0xedfe('0xb8')](function(_0x37bc68){for(var _0xcb5b05=0x0;_0xcb5b05<_0x12b6b4[_0xedfe('0x67')][_0xedfe('0x70')][_0xedfe('0x49')];_0xcb5b05+=0x1){socket[_0xedfe('0xbe')](_0xedfe('0xbf'),{'UserId':Number(_0x12b6b4[_0xedfe('0x67')][_0xedfe('0x70')][_0xcb5b05]),'FaxAccountId':Number(_0x12b6b4[_0xedfe('0x5a')]['id'])});}return _0x37bc68;});}})[_0xedfe('0x36')](respondWithResult(_0x390d97,null))['catch'](handleError(_0x390d97,null));};exports[_0xedfe('0xc0')]=function(_0x3813ba,_0x274d04,_0x84341){return db['FaxAccount'][_0xedfe('0x5e')]({'where':{'id':_0x3813ba[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x274d04,null))[_0xedfe('0x36')](function(_0xfee9cd){if(_0xfee9cd){return _0xfee9cd[_0xedfe('0xc0')](_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')])[_0xedfe('0x36')](function(){if(_[_0xedfe('0xc1')](_0x3813ba['query'][_0xedfe('0x70')])){for(var _0x3514eb=0x0;_0x3514eb<_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')][_0xedfe('0x49')];_0x3514eb+=0x1){socket[_0xedfe('0xbe')](_0xedfe('0xc2'),{'UserId':Number(_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')][_0x3514eb]),'FaxAccountId':Number(_0x3813ba['params']['id'])});}}else{socket[_0xedfe('0xbe')](_0xedfe('0xc2'),{'UserId':Number(_0x3813ba[_0xedfe('0x45')][_0xedfe('0x70')]),'FaxAccountId':Number(_0x3813ba['params']['id'])});}});}})[_0xedfe('0x36')](respondWithStatusCode(_0x274d04,null))[_0xedfe('0x2b')](handleError(_0x274d04,null));};exports[_0xedfe('0xc3')]=function(_0x3622aa,_0x1faa6d,_0x10215b){var _0x8d17b6={};var _0x420760={};var _0x102c0c;var _0x3b0560;return db[_0xedfe('0x55')][_0xedfe('0x6e')]({'where':{'id':_0x3622aa[_0xedfe('0x5a')]['id']}})[_0xedfe('0x36')](handleEntityNotFound(_0x1faa6d,null))[_0xedfe('0x36')](function(_0x269061){if(_0x269061){_0x102c0c=_0x269061;_0x420760[_0xedfe('0x44')]=_['keys'](db[_0xedfe('0x79')]['rawAttributes']);_0x420760[_0xedfe('0x45')]=_[_0xedfe('0x5b')](_0x3622aa[_0xedfe('0x45')]);_0x420760[_0xedfe('0x4f')]=_[_0xedfe('0x46')](_0x420760[_0xedfe('0x44')],_0x420760[_0xedfe('0x45')]);_0x8d17b6[_0xedfe('0x47')]=_['intersection'](_0x420760[_0xedfe('0x44')],qs[_0xedfe('0x48')](_0x3622aa['query'][_0xedfe('0x48')]));_0x8d17b6[_0xedfe('0x47')]=_0x8d17b6['attributes']['length']?_0x8d17b6[_0xedfe('0x47')]:_0x420760[_0xedfe('0x44')];_0x8d17b6[_0xedfe('0x4c')]=qs[_0xedfe('0x4d')](_0x3622aa['query'][_0xedfe('0x4d')]);_0x8d17b6[_0xedfe('0x4e')]=qs['filters'](_[_0xedfe('0x50')](_0x3622aa[_0xedfe('0x45')],_0x420760[_0xedfe('0x4f')]));if(_0x3622aa[_0xedfe('0x45')][_0xedfe('0x51')]){_0x8d17b6[_0xedfe('0x4e')]=_['merge'](_0x8d17b6[_0xedfe('0x4e')],{'$or':_[_0xedfe('0x40')](_0x8d17b6[_0xedfe('0x47')],function(_0x24aa5f){var _0x6603b8={};_0x6603b8[_0x24aa5f]={'$like':'%'+_0x3622aa[_0xedfe('0x45')]['filter']+'%'};return _0x6603b8;})});}_0x8d17b6=_[_0xedfe('0x52')]({},_0x8d17b6,_0x3622aa[_0xedfe('0x54')]);return _0x102c0c['getAgents'](_0x8d17b6);}})[_0xedfe('0x36')](function(_0x5d3f9e){if(_0x5d3f9e){_0x3b0560=_0x5d3f9e[_0xedfe('0x49')];if(!_0x3622aa['query'][_0xedfe('0x4a')](_0xedfe('0x4b'))){_0x8d17b6['limit']=qs[_0xedfe('0x2f')](_0x3622aa[_0xedfe('0x45')]['limit']);_0x8d17b6['offset']=qs[_0xedfe('0x2e')](_0x3622aa[_0xedfe('0x45')][_0xedfe('0x2e')]);}return _0x102c0c['getAgents'](_0x8d17b6);}})[_0xedfe('0x36')](function(_0x5868c1){if(_0x5868c1){return _0x5868c1?{'count':_0x3b0560,'rows':_0x5868c1}:null;}})['then'](respondWithResult(_0x1faa6d,null))[_0xedfe('0x2b')](handleError(_0x1faa6d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 28a7a6e..b6b1ab7 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 _0xf67e=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x21ffa8,_0x35d876){var _0xa9a65d=function(_0x1f9226){while(--_0x1f9226){_0x21ffa8['push'](_0x21ffa8['shift']());}};_0xa9a65d(++_0x35d876);}(_0xf67e,0x107));var _0xef67=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf67e[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xef67('0x0'));var FaxAccount=require(_0xef67('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xef67('0x2')](0x0);var events={'afterCreate':_0xef67('0x3'),'afterUpdate':_0xef67('0x4'),'afterDestroy':_0xef67('0x5')};function emitEvent(_0x4e451f){return function(_0x1ca3ac,_0x301a3e,_0x3fa026){FaxAccountEvents[_0xef67('0x6')](_0x4e451f+':'+_0x1ca3ac['id'],_0x1ca3ac);FaxAccountEvents[_0xef67('0x6')](_0x4e451f,_0x1ca3ac);_0x3fa026(null);};}for(var e in events){if(events[_0xef67('0x7')](e)){var event=events[e];FaxAccount[_0xef67('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xbb29=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xbb29,0x6d));var _0x9bb2=function(_0x4f7398,_0x1713f0){_0x4f7398=_0x4f7398-0x0;var _0x27f5a7=_0xbb29[_0x4f7398];return _0x27f5a7;};'use strict';var EventEmitter=require(_0x9bb2('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9bb2('0x1')](0x0);var events={'afterCreate':_0x9bb2('0x2'),'afterUpdate':_0x9bb2('0x3'),'afterDestroy':_0x9bb2('0x4')};function emitEvent(_0x5d2206){return function(_0x45ab7c,_0x3707d,_0x2fda2d){FaxAccountEvents[_0x9bb2('0x5')](_0x5d2206+':'+_0x45ab7c['id'],_0x45ab7c);FaxAccountEvents[_0x9bb2('0x5')](_0x5d2206,_0x45ab7c);_0x2fda2d(null);};}for(var e in events){if(events[_0x9bb2('0x6')](e)){var event=events[e];FaxAccount[_0x9bb2('0x7')](e,emitEvent(event));}}module[_0x9bb2('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 0ec7b6a..6a9160f 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 _0x45f7=['fax_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount'];(function(_0x1f2c2c,_0xa36f89){var _0x1441b6=function(_0x295d5c){while(--_0x295d5c){_0x1f2c2c['push'](_0x1f2c2c['shift']());}};_0x1441b6(++_0xa36f89);}(_0x45f7,0x151));var _0x745f=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x45f7[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x745f('0x0'));var util=require(_0x745f('0x1'));var logger=require(_0x745f('0x2'))('api');var moment=require(_0x745f('0x3'));var BPromise=require(_0x745f('0x4'));var rp=require(_0x745f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x745f('0x6'));var config=require(_0x745f('0x7'));var attributes=require(_0x745f('0x8'));module['exports']=function(_0xb85f26,_0x312d81){return _0xb85f26[_0x745f('0x9')](_0x745f('0xa'),attributes,{'tableName':_0x745f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e89=['bluebird','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','../../config/logger','api','moment'];(function(_0x5d1292,_0x4bb67c){var _0x296667=function(_0x216d6b){while(--_0x216d6b){_0x5d1292['push'](_0x5d1292['shift']());}};_0x296667(++_0x4bb67c);}(_0x3e89,0xa4));var _0x93e8=function(_0x4aed73,_0xe214a5){_0x4aed73=_0x4aed73-0x0;var _0x39f0bb=_0x3e89[_0x4aed73];return _0x39f0bb;};'use strict';var _=require('lodash');var util=require(_0x93e8('0x0'));var logger=require(_0x93e8('0x1'))(_0x93e8('0x2'));var moment=require(_0x93e8('0x3'));var BPromise=require(_0x93e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93e8('0x5'));var config=require(_0x93e8('0x6'));var attributes=require(_0x93e8('0x7'));module[_0x93e8('0x8')]=function(_0x31b78f,_0x6a815f){return _0x31b78f[_0x93e8('0x9')](_0x93e8('0xa'),attributes,{'tableName':_0x93e8('0xb'),'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 c52b3f7..0c23eb2 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 _0xc2ef=['AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','startRouting','util','bluebird','ioredis','../../mysqldb','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','map','model','include','debug','NotifyFaxAccount','body','describe','Sequelize','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','isNil','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','Contacts','DESC','Applications','get','list','List','applications','priority','length','ListId','CmContact','create','contact','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId'];(function(_0x267b0d,_0x1855c2){var _0x3d3710=function(_0x2aa6d8){while(--_0x2aa6d8){_0x267b0d['push'](_0x267b0d['shift']());}};_0x3d3710(++_0x1855c2);}(_0xc2ef,0xb1));var _0xfc2e=function(_0x145699,_0x23e389){_0x145699=_0x145699-0x0;var _0x483c55=_0xc2ef[_0x145699];return _0x483c55;};'use strict';var _=require('lodash');var util=require(_0xfc2e('0x0'));var moment=require('moment');var BPromise=require(_0xfc2e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc2e('0x2'));var db=require(_0xfc2e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfc2e('0x4'));var client=jayson['client'][_0xfc2e('0x5')]({'port':0x232c});config['redis']=_[_0xfc2e('0x6')](config['redis'],{'host':_0xfc2e('0x7'),'port':0x18eb});var socket=require(_0xfc2e('0x8'))(new Redis(config[_0xfc2e('0x9')]));require('./faxAccount.socket')[_0xfc2e('0xa')](socket);function respondWithRpcPromise(_0x1ce6a9,_0x9960f2,_0x51a8f7){return new BPromise(function(_0x56a624,_0x41e717){return client[_0xfc2e('0xb')](_0x1ce6a9,_0x51a8f7)[_0xfc2e('0xc')](function(_0x588d3e){logger[_0xfc2e('0xd')](_0xfc2e('0xe'),_0x9960f2,'request\x20sent');logger['debug'](_0xfc2e('0xf'),_0x9960f2,_0xfc2e('0x10'),JSON[_0xfc2e('0x11')](_0x588d3e));if(_0x588d3e[_0xfc2e('0x12')]){if(_0x588d3e[_0xfc2e('0x12')][_0xfc2e('0x13')]===0x1f4){logger[_0xfc2e('0x12')](_0xfc2e('0xe'),_0x9960f2,_0x588d3e[_0xfc2e('0x12')][_0xfc2e('0x14')]);return _0x41e717(_0x588d3e[_0xfc2e('0x12')]['message']);}logger[_0xfc2e('0x12')]('FaxAccount,\x20%s,\x20%s',_0x9960f2,_0x588d3e['error'][_0xfc2e('0x14')]);return _0x56a624(_0x588d3e[_0xfc2e('0x12')][_0xfc2e('0x14')]);}else{logger['info'](_0xfc2e('0xe'),_0x9960f2,_0xfc2e('0x10'));_0x56a624(_0x588d3e[_0xfc2e('0x15')][_0xfc2e('0x14')]);}})[_0xfc2e('0x16')](function(_0x2f317a){logger[_0xfc2e('0x12')]('FaxAccount,\x20%s,\x20%s',_0x9960f2,_0x2f317a);_0x41e717(_0x2f317a);});});}exports[_0xfc2e('0x17')]=function(_0x424c5c){var _0x4a7ab5=this;return new Promise(function(_0x43b56d,_0x24ad15){return db[_0xfc2e('0x18')]['findAll']({'raw':_0x424c5c[_0xfc2e('0x19')]?_0x424c5c['options'][_0xfc2e('0x1a')]===undefined?!![]:![]:!![],'where':_0x424c5c[_0xfc2e('0x19')]?_0x424c5c[_0xfc2e('0x19')][_0xfc2e('0x1b')]||null:null,'attributes':_0x424c5c[_0xfc2e('0x19')]?_0x424c5c[_0xfc2e('0x19')][_0xfc2e('0x1c')]||null:null,'limit':_0x424c5c[_0xfc2e('0x19')]?_0x424c5c[_0xfc2e('0x19')][_0xfc2e('0x1d')]||null:null,'include':_0x424c5c[_0xfc2e('0x19')]?_0x424c5c[_0xfc2e('0x19')]['include']?_[_0xfc2e('0x1e')](_0x424c5c[_0xfc2e('0x19')]['include'],function(_0x9d7121){return{'model':db[_0x9d7121[_0xfc2e('0x1f')]],'as':_0x9d7121['as'],'attributes':_0x9d7121['attributes'],'include':_0x9d7121[_0xfc2e('0x20')]?_[_0xfc2e('0x1e')](_0x9d7121[_0xfc2e('0x20')],function(_0x4d93e7){return{'model':db[_0x4d93e7[_0xfc2e('0x1f')]],'as':_0x4d93e7['as'],'attributes':_0x4d93e7[_0xfc2e('0x1c')],'include':_0x4d93e7[_0xfc2e('0x20')]?_[_0xfc2e('0x1e')](_0x4d93e7['include'],function(_0x212035){return{'model':db[_0x212035[_0xfc2e('0x1f')]],'as':_0x212035['as'],'attributes':_0x212035['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc2e('0xc')](function(_0x38e6cc){logger[_0xfc2e('0xd')]('GetFaxAccount',_0x424c5c);logger[_0xfc2e('0x21')](_0xfc2e('0x17'),_0x424c5c,JSON[_0xfc2e('0x11')](_0x38e6cc));_0x43b56d(_0x38e6cc);})[_0xfc2e('0x16')](function(_0x43e357){logger['error'](_0xfc2e('0x17'),_0x43e357[_0xfc2e('0x14')],_0x424c5c);_0x24ad15(_0x4a7ab5[_0xfc2e('0x12')](0x1f4,_0x43e357['message']));});});};exports[_0xfc2e('0x22')]=function(_0x4635dd,_0x339e0c,_0x4e1175){var _0x16b12e=this;return new Promise(function(_0x4d6d07,_0x14a00f){var _0x2a171c={'body':_0x4635dd[_0xfc2e('0x23')],'channel':'fax'};var _0x4cf709=[];var _0x727c6e=[];var _0x4acc5d={};return db['CmContact'][_0xfc2e('0x24')]()[_0xfc2e('0xc')](function(_0x514f11){if(!_0x514f11){throw new db[(_0xfc2e('0x25'))]['ValidationError'](_0xfc2e('0x26'));}_0x4cf709=_['difference'](_['keys'](_0x514f11),['createdAt',_0xfc2e('0x27')]);_0x727c6e=_['difference'](_['keys'](_0x514f11),[_0xfc2e('0x28'),_0xfc2e('0x27'),_0xfc2e('0x29'),'ListId']);if(_0x4635dd['body']['id']){delete _0x4635dd[_0xfc2e('0x23')]['id'];}if(_[_0xfc2e('0x2a')](_0x4635dd['body']['from'])){throw new db[(_0xfc2e('0x25'))]['ValidationError'](_0xfc2e('0x2b'));}if(_[_0xfc2e('0x2a')](_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x23')])||_0x4635dd['body'][_0xfc2e('0x23')]===''){throw new db[(_0xfc2e('0x25'))][(_0xfc2e('0x2c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfc2e('0x2a')](_0x4635dd['body'][_0xfc2e('0x2d')])){throw new db[(_0xfc2e('0x25'))][(_0xfc2e('0x2c'))](_0xfc2e('0x2e')+_0x727c6e);}if(!_['includes'](_0x727c6e,_0x4635dd[_0xfc2e('0x23')]['mapKey'])){throw new db[(_0xfc2e('0x25'))][(_0xfc2e('0x2c'))](_0xfc2e('0x2f')+_0x727c6e);}_0x4acc5d[_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x2d')]]=_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x30')];})['then'](function(){return db[_0xfc2e('0x18')][_0xfc2e('0x31')]({'where':{'id':_0x4635dd[_0xfc2e('0x32')]['id']},'include':[{'model':db[_0xfc2e('0x33')],'as':'List','include':[{'model':db['CmContact'],'as':_0xfc2e('0x34'),'where':_0x4acc5d,'limit':0x1,'order':[[_0xfc2e('0x27'),_0xfc2e('0x35')]]}]},{'model':db['FaxApplication'],'as':_0xfc2e('0x36')}]});})[_0xfc2e('0xc')](function(_0x479710){if(_0x479710&&_0x479710['List']){var _0x269719=_0x479710[_0xfc2e('0x37')]({'plain':!![]});_0x2a171c[_0xfc2e('0x32')]=_0x269719;_0x2a171c['applications']=_0x269719[_0xfc2e('0x36')];_0x2a171c[_0xfc2e('0x38')]=_0x269719[_0xfc2e('0x39')];_0x2a171c['applications']=_['orderBy'](_0x2a171c[_0xfc2e('0x3a')],[_0xfc2e('0x3b')],['asc']);if(_0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x36')]){delete _0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x36')];}if(_0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x39')]&&_0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x39')]['Contacts'][_0xfc2e('0x3c')]){return _0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x39')][_0xfc2e('0x34')][0x0];}var _0x446be4=_[_0xfc2e('0x6')](_0x4635dd['body'],{'firstName':_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x30')],'ListId':_0x269719[_0xfc2e('0x3d')]});_0x446be4[_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x2d')]]=_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x30')];return db[_0xfc2e('0x3e')][_0xfc2e('0x3f')](_0x446be4,{'fields':_0x4cf709,'raw':!![]});}})[_0xfc2e('0xc')](function(_0x20e138){_0x2a171c[_0xfc2e('0x40')]=_0x20e138;if(_0x20e138){var _0x2f929b={'ContactId':_0x20e138['id'],'FaxAccountId':_0x4635dd[_0xfc2e('0x32')]['id'],'fax':_0x20e138[_0xfc2e('0x41')]};return db['FaxInteraction'][_0xfc2e('0x31')]({'where':{'ContactId':_0x20e138['id'],'closed':![],'FaxAccountId':_0x4635dd[_0xfc2e('0x32')]['id']}})[_0xfc2e('0xc')](function(_0x44f933){if(_0x44f933){return[_0x44f933,![]];}return db[_0xfc2e('0x42')]['create'](_0x2f929b)[_0xfc2e('0xc')](function(_0x28dcb4){return[_0x28dcb4,!![]];});});}else{throw new Error(_0xfc2e('0x43'));}})[_0xfc2e('0x44')](function(_0x3eb66f,_0x30f43d){var _0x4a0917=_0x3eb66f[_0xfc2e('0x37')]({'plain':!![]});if(_0x30f43d){if(_0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x45')]){_0x2a171c[_0xfc2e('0x3a')][_0xfc2e('0x46')]({'id':0x0,'priority':_0x2a171c['applications'][_0xfc2e('0x3c')]+0x1,'app':_0xfc2e('0x47'),'appdata':_0xfc2e('0x48'),'interval':_0xfc2e('0x49')});}_0x4a0917['created']=!![];}else{_0x4a0917[_0xfc2e('0x4a')]=![];}_0x2a171c[_0xfc2e('0x4b')]=_0x4a0917;return db[_0xfc2e('0x4c')]['create']({'body':_0x4635dd[_0xfc2e('0x23')]['body'],'FaxAccountId':_0x4635dd[_0xfc2e('0x32')]['id'],'FaxInteractionId':_0x3eb66f['id'],'direction':'in','ContactId':_0x3eb66f[_0xfc2e('0x4d')],'AttachmentId':_0x4635dd[_0xfc2e('0x23')][_0xfc2e('0x4e')]});})[_0xfc2e('0xc')](function(_0x55f4bb){_0x2a171c['message']=_0x55f4bb;if(_0x2a171c[_0xfc2e('0x4b')][_0xfc2e('0x4f')]){return db[_0xfc2e('0x50')]['find']({'attributes':['id','name'],'where':{'id':_0x2a171c[_0xfc2e('0x4b')]['UserId']}})[_0xfc2e('0xc')](function(_0x2b7f0a){if(_0x2b7f0a){_0x2a171c[_0xfc2e('0x3a')][_0xfc2e('0x51')]({'id':0x0,'priority':0x0,'app':_0xfc2e('0x52'),'appdata':_0x2b7f0a['name']+','+(_0x2a171c[_0xfc2e('0x32')][_0xfc2e('0x53')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xfc2e('0x54'),_0x2a171c);});}return respondWithRpcPromise('Start','startRouting',_0x2a171c);})[_0xfc2e('0xc')](function(_0x13e6c0){_0x4d6d07(_0x13e6c0);})[_0xfc2e('0x16')](function(_0x5184b9){_0x14a00f(_0x16b12e[_0xfc2e('0x12')](0x1f4,_0x5184b9[_0xfc2e('0x14')]));});});}; \ No newline at end of file +var _0x4a6a=['contact','FaxInteraction','Contact\x20not\x20found','spread','get','push','close','*,*,*,*','created','interaction','FaxMessage','ContactId','unshift','name','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','then','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','applications','Applications','list','orderBy','priority','asc','length','ListId','create'];(function(_0x3da2f8,_0x50e1f6){var _0xefcb74=function(_0x54fc44){while(--_0x54fc44){_0x3da2f8['push'](_0x3da2f8['shift']());}};_0xefcb74(++_0x50e1f6);}(_0x4a6a,0xc9));var _0xa4a6=function(_0x2de209,_0x5527de){_0x2de209=_0x2de209-0x0;var _0x783a78=_0x4a6a[_0x2de209];return _0x783a78;};'use strict';var _=require(_0xa4a6('0x0'));var util=require(_0xa4a6('0x1'));var moment=require(_0xa4a6('0x2'));var BPromise=require(_0xa4a6('0x3'));var rs=require(_0xa4a6('0x4'));var fs=require('fs');var Redis=require(_0xa4a6('0x5'));var db=require(_0xa4a6('0x6'))['db'];var utils=require(_0xa4a6('0x7'));var logger=require(_0xa4a6('0x8'))(_0xa4a6('0x9'));var config=require(_0xa4a6('0xa'));var jayson=require(_0xa4a6('0xb'));var client=jayson[_0xa4a6('0xc')][_0xa4a6('0xd')]({'port':0x232c});config[_0xa4a6('0xe')]=_[_0xa4a6('0xf')](config[_0xa4a6('0xe')],{'host':_0xa4a6('0x10'),'port':0x18eb});var socket=require(_0xa4a6('0x11'))(new Redis(config[_0xa4a6('0xe')]));require(_0xa4a6('0x12'))[_0xa4a6('0x13')](socket);function respondWithRpcPromise(_0x388ff7,_0x292f7d,_0x18c029){return new BPromise(function(_0x37aa01,_0x237b49){return client[_0xa4a6('0x14')](_0x388ff7,_0x18c029)['then'](function(_0x347403){logger[_0xa4a6('0x15')](_0xa4a6('0x16'),_0x292f7d,_0xa4a6('0x17'));logger[_0xa4a6('0x18')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x292f7d,'request\x20sent',JSON[_0xa4a6('0x19')](_0x347403));if(_0x347403[_0xa4a6('0x1a')]){if(_0x347403[_0xa4a6('0x1a')]['code']===0x1f4){logger['error'](_0xa4a6('0x16'),_0x292f7d,_0x347403['error']['message']);return _0x237b49(_0x347403['error']['message']);}logger[_0xa4a6('0x1a')](_0xa4a6('0x16'),_0x292f7d,_0x347403['error'][_0xa4a6('0x1b')]);return _0x37aa01(_0x347403[_0xa4a6('0x1a')]['message']);}else{logger[_0xa4a6('0x15')](_0xa4a6('0x16'),_0x292f7d,_0xa4a6('0x17'));_0x37aa01(_0x347403[_0xa4a6('0x1c')][_0xa4a6('0x1b')]);}})[_0xa4a6('0x1d')](function(_0x169e0a){logger[_0xa4a6('0x1a')](_0xa4a6('0x16'),_0x292f7d,_0x169e0a);_0x237b49(_0x169e0a);});});}exports[_0xa4a6('0x1e')]=function(_0x15c9bf){var _0x1a5919=this;return new Promise(function(_0x2eea42,_0x252805){return db[_0xa4a6('0x1f')]['findAll']({'raw':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf['options'][_0xa4a6('0x21')]===undefined?!![]:![]:!![],'where':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x22')]||null:null,'attributes':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x23')]||null:null,'limit':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf['options'][_0xa4a6('0x24')]||null:null,'include':_0x15c9bf[_0xa4a6('0x20')]?_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x25')]?_[_0xa4a6('0x26')](_0x15c9bf[_0xa4a6('0x20')][_0xa4a6('0x25')],function(_0x2cdfa9){return{'model':db[_0x2cdfa9['model']],'as':_0x2cdfa9['as'],'attributes':_0x2cdfa9['attributes'],'include':_0x2cdfa9[_0xa4a6('0x25')]?_['map'](_0x2cdfa9[_0xa4a6('0x25')],function(_0x63bad3){return{'model':db[_0x63bad3['model']],'as':_0x63bad3['as'],'attributes':_0x63bad3[_0xa4a6('0x23')],'include':_0x63bad3[_0xa4a6('0x25')]?_['map'](_0x63bad3[_0xa4a6('0x25')],function(_0xdaab91){return{'model':db[_0xdaab91['model']],'as':_0xdaab91['as'],'attributes':_0xdaab91[_0xa4a6('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa4a6('0x27')](function(_0x54fcb2){logger['info'](_0xa4a6('0x1e'),_0x15c9bf);logger[_0xa4a6('0x18')](_0xa4a6('0x1e'),_0x15c9bf,JSON['stringify'](_0x54fcb2));_0x2eea42(_0x54fcb2);})[_0xa4a6('0x1d')](function(_0x5cd479){logger[_0xa4a6('0x1a')](_0xa4a6('0x1e'),_0x5cd479[_0xa4a6('0x1b')],_0x15c9bf);_0x252805(_0x1a5919[_0xa4a6('0x1a')](0x1f4,_0x5cd479[_0xa4a6('0x1b')]));});});};exports[_0xa4a6('0x28')]=function(_0x494869,_0x5302ce,_0x27b48f){var _0x459b01=this;return new Promise(function(_0xd3d82,_0x1c6969){var _0x36dfd7={'body':_0x494869['body'],'channel':_0xa4a6('0x29')};var _0x5217fe=[];var _0x21d07e=[];var _0x344154={};return db[_0xa4a6('0x2a')]['describe']()['then'](function(_0x47cff3){if(!_0x47cff3){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x2d'));}_0x5217fe=_['difference'](_[_0xa4a6('0x2e')](_0x47cff3),[_0xa4a6('0x2f'),_0xa4a6('0x30')]);_0x21d07e=_[_0xa4a6('0x31')](_[_0xa4a6('0x2e')](_0x47cff3),[_0xa4a6('0x2f'),_0xa4a6('0x30'),_0xa4a6('0x32'),'ListId']);if(_0x494869[_0xa4a6('0x33')]['id']){delete _0x494869['body']['id'];}if(_[_0xa4a6('0x34')](_0x494869[_0xa4a6('0x33')][_0xa4a6('0x35')])){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x36'));}if(_['isNil'](_0x494869[_0xa4a6('0x33')][_0xa4a6('0x33')])||_0x494869[_0xa4a6('0x33')][_0xa4a6('0x33')]===''){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x37'));}if(_[_0xa4a6('0x34')](_0x494869['body']['mapKey'])){throw new db['Sequelize'][(_0xa4a6('0x2c'))](_0xa4a6('0x38')+_0x21d07e);}if(!_['includes'](_0x21d07e,_0x494869[_0xa4a6('0x33')][_0xa4a6('0x39')])){throw new db[(_0xa4a6('0x2b'))][(_0xa4a6('0x2c'))](_0xa4a6('0x3a')+_0x21d07e);}_0x344154[_0x494869[_0xa4a6('0x33')][_0xa4a6('0x39')]]=_0x494869[_0xa4a6('0x33')][_0xa4a6('0x35')];})[_0xa4a6('0x27')](function(){return db[_0xa4a6('0x1f')][_0xa4a6('0x3b')]({'where':{'id':_0x494869[_0xa4a6('0x3c')]['id']},'include':[{'model':db[_0xa4a6('0x3d')],'as':_0xa4a6('0x3e'),'include':[{'model':db[_0xa4a6('0x2a')],'as':_0xa4a6('0x3f'),'where':_0x344154,'limit':0x1,'order':[[_0xa4a6('0x30'),_0xa4a6('0x40')]]}]},{'model':db[_0xa4a6('0x41')],'as':'Applications'}]});})[_0xa4a6('0x27')](function(_0x5e63d5){if(_0x5e63d5&&_0x5e63d5['List']){var _0x46c035=_0x5e63d5['get']({'plain':!![]});_0x36dfd7['account']=_0x46c035;_0x36dfd7[_0xa4a6('0x42')]=_0x46c035[_0xa4a6('0x43')];_0x36dfd7[_0xa4a6('0x44')]=_0x46c035[_0xa4a6('0x3e')];_0x36dfd7[_0xa4a6('0x42')]=_[_0xa4a6('0x45')](_0x36dfd7[_0xa4a6('0x42')],[_0xa4a6('0x46')],[_0xa4a6('0x47')]);if(_0x36dfd7[_0xa4a6('0x3c')]['Applications']){delete _0x36dfd7['account']['Applications'];}if(_0x36dfd7[_0xa4a6('0x3c')]['List']&&_0x36dfd7[_0xa4a6('0x3c')]['List']['Contacts'][_0xa4a6('0x48')]){return _0x36dfd7['account']['List'][_0xa4a6('0x3f')][0x0];}var _0x189aa3=_[_0xa4a6('0xf')](_0x494869[_0xa4a6('0x33')],{'firstName':_0x494869['body'][_0xa4a6('0x35')],'ListId':_0x46c035[_0xa4a6('0x49')]});_0x189aa3[_0x494869[_0xa4a6('0x33')][_0xa4a6('0x39')]]=_0x494869[_0xa4a6('0x33')][_0xa4a6('0x35')];return db[_0xa4a6('0x2a')][_0xa4a6('0x4a')](_0x189aa3,{'fields':_0x5217fe,'raw':!![]});}})[_0xa4a6('0x27')](function(_0x3754c2){_0x36dfd7[_0xa4a6('0x4b')]=_0x3754c2;if(_0x3754c2){var _0x5d755d={'ContactId':_0x3754c2['id'],'FaxAccountId':_0x494869[_0xa4a6('0x3c')]['id'],'fax':_0x3754c2[_0xa4a6('0x29')]};return db[_0xa4a6('0x4c')][_0xa4a6('0x3b')]({'where':{'ContactId':_0x3754c2['id'],'closed':![],'FaxAccountId':_0x494869[_0xa4a6('0x3c')]['id']}})['then'](function(_0x4ff385){if(_0x4ff385){return[_0x4ff385,![]];}return db[_0xa4a6('0x4c')][_0xa4a6('0x4a')](_0x5d755d)[_0xa4a6('0x27')](function(_0xc568e7){return[_0xc568e7,!![]];});});}else{throw new Error(_0xa4a6('0x4d'));}})[_0xa4a6('0x4e')](function(_0x1ea63b,_0x287a92){var _0x3a6a5d=_0x1ea63b[_0xa4a6('0x4f')]({'plain':!![]});if(_0x287a92){if(_0x36dfd7['account']['autoclose']){_0x36dfd7[_0xa4a6('0x42')][_0xa4a6('0x50')]({'id':0x0,'priority':_0x36dfd7[_0xa4a6('0x42')][_0xa4a6('0x48')]+0x1,'app':_0xa4a6('0x51'),'appdata':'unmanaged','interval':_0xa4a6('0x52')});}_0x3a6a5d[_0xa4a6('0x53')]=!![];}else{_0x3a6a5d[_0xa4a6('0x53')]=![];}_0x36dfd7[_0xa4a6('0x54')]=_0x3a6a5d;return db[_0xa4a6('0x55')]['create']({'body':_0x494869[_0xa4a6('0x33')][_0xa4a6('0x33')],'FaxAccountId':_0x494869[_0xa4a6('0x3c')]['id'],'FaxInteractionId':_0x1ea63b['id'],'direction':'in','ContactId':_0x1ea63b[_0xa4a6('0x56')],'AttachmentId':_0x494869[_0xa4a6('0x33')]['AttachmentId']});})[_0xa4a6('0x27')](function(_0x4fef9f){_0x36dfd7[_0xa4a6('0x1b')]=_0x4fef9f;if(_0x36dfd7['interaction']['UserId']){return db['User'][_0xa4a6('0x3b')]({'attributes':['id','name'],'where':{'id':_0x36dfd7['interaction']['UserId']}})[_0xa4a6('0x27')](function(_0x5cea6c){if(_0x5cea6c){_0x36dfd7[_0xa4a6('0x42')][_0xa4a6('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5cea6c[_0xa4a6('0x58')]+','+(_0x36dfd7['account'][_0xa4a6('0x59')]||0xa),'interval':_0xa4a6('0x52')});}return respondWithRpcPromise('Start',_0xa4a6('0x5a'),_0x36dfd7);});}return respondWithRpcPromise(_0xa4a6('0x5b'),_0xa4a6('0x5a'),_0x36dfd7);})[_0xa4a6('0x27')](function(_0x592d28){_0xd3d82(_0x592d28);})['catch'](function(_0x5efe40){_0x1c6969(_0x459b01['error'](0x1f4,_0x5efe40[_0xa4a6('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 89b2b64..fe30f3d 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 _0x8a07=['remove','update','emit','removeListener','length','faxAccount:','./faxAccount.events','save'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x8a07,0xee));var _0x78a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8a07[_0x321bb2];return _0x9c12ed;};'use strict';var FaxAccountEvents=require(_0x78a0('0x0'));var events=[_0x78a0('0x1'),_0x78a0('0x2'),_0x78a0('0x3')];function createListener(_0x322be6,_0x26305c){return function(_0xa21bb0){_0x26305c[_0x78a0('0x4')](_0x322be6,_0xa21bb0);};}function removeListener(_0x1f6719,_0x2f5547){return function(){FaxAccountEvents[_0x78a0('0x5')](_0x1f6719,_0x2f5547);};}exports['register']=function(_0x2cc934){for(var _0x40926c=0x0,_0x35bafb=events[_0x78a0('0x6')];_0x40926c<_0x35bafb;_0x40926c++){var _0x1edae2=events[_0x40926c];var _0xfdb2c2=createListener(_0x78a0('0x7')+_0x1edae2,_0x2cc934);FaxAccountEvents['on'](_0x1edae2,_0xfdb2c2);}}; \ No newline at end of file +var _0x1695=['removeListener','register','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0xe924a5,_0x1bf7f2){var _0x5e464f=function(_0x4fbeb5){while(--_0x4fbeb5){_0xe924a5['push'](_0xe924a5['shift']());}};_0x5e464f(++_0x1bf7f2);}(_0x1695,0xac));var _0x5169=function(_0x4c2f7d,_0x13bded){_0x4c2f7d=_0x4c2f7d-0x0;var _0x1d20fc=_0x1695[_0x4c2f7d];return _0x1d20fc;};'use strict';var FaxAccountEvents=require(_0x5169('0x0'));var events=['save',_0x5169('0x1'),_0x5169('0x2')];function createListener(_0x505221,_0x5ddf7a){return function(_0x572df0){_0x5ddf7a['emit'](_0x505221,_0x572df0);};}function removeListener(_0xc04684,_0x2cc0bc){return function(){FaxAccountEvents[_0x5169('0x3')](_0xc04684,_0x2cc0bc);};}exports[_0x5169('0x4')]=function(_0x470f6c){for(var _0x6f04e2=0x0,_0x2423f1=events[_0x5169('0x5')];_0x6f04e2<_0x2423f1;_0x6f04e2++){var _0x182abd=events[_0x6f04e2];var _0x44c446=createListener(_0x5169('0x6')+_0x182abd,_0x470f6c);FaxAccountEvents['on'](_0x182abd,_0x44c446);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 32c3bb2..ec7d0b4 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x10a96c,_0xd8e7f2){var _0x53e738=function(_0x17009d){while(--_0x17009d){_0x10a96c['push'](_0x10a96c['shift']());}};_0x53e738(++_0xd8e7f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x360206,_0x7c26ef){var _0x48eaad=function(_0x8bbd62){while(--_0x8bbd62){_0x360206['push'](_0x360206['shift']());}};_0x48eaad(++_0x7c26ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 14378e0..7cb6041 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 _0x24c5=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xf84870,_0x4dc38f){var _0x4541a4=function(_0x3ff5d5){while(--_0x3ff5d5){_0xf84870['push'](_0xf84870['shift']());}};_0x4541a4(++_0x4dc38f);}(_0x24c5,0x13a));var _0x524c=function(_0x10bac4,_0x444b8d){_0x10bac4=_0x10bac4-0x0;var _0x1d0653=_0x24c5[_0x10bac4];return _0x1d0653;};'use strict';var Sequelize=require(_0x524c('0x0'));module[_0x524c('0x1')]={'priority':{'type':Sequelize[_0x524c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x524c('0x3')],'allowNull':![],'defaultValue':_0x524c('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x524c('0x3')]},'interval':{'type':Sequelize[_0x524c('0x3')],'defaultValue':_0x524c('0x5')}}; \ No newline at end of file +var _0x9845=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9845,0x15a));var _0x5984=function(_0x2815d5,_0x3530be){_0x2815d5=_0x2815d5-0x0;var _0x2969bc=_0x9845[_0x2815d5];return _0x2969bc;};'use strict';var Sequelize=require(_0x5984('0x0'));module[_0x5984('0x1')]={'priority':{'type':Sequelize[_0x5984('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5984('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5984('0x4')]()},'description':{'type':Sequelize[_0x5984('0x3')]},'interval':{'type':Sequelize[_0x5984('0x3')],'defaultValue':_0x5984('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9a0e536..c4eeed1 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 _0xa9b5=['status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','then','catch','params','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x33bcdb,_0x11846b){var _0x18a9bf=function(_0x34417a){while(--_0x34417a){_0x33bcdb['push'](_0x33bcdb['shift']());}};_0x18a9bf(++_0x11846b);}(_0xa9b5,0x71));var _0x5a9b=function(_0x41c400,_0x29b582){_0x41c400=_0x41c400-0x0;var _0x58c42f=_0xa9b5[_0x41c400];return _0x58c42f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5a9b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a9b('0x1'));var moment=require(_0x5a9b('0x2'));var BPromise=require(_0x5a9b('0x3'));var Mustache=require(_0x5a9b('0x4'));var util=require(_0x5a9b('0x5'));var path=require(_0x5a9b('0x6'));var sox=require(_0x5a9b('0x7'));var csv=require(_0x5a9b('0x8'));var ejs=require(_0x5a9b('0x9'));var fs=require('fs');var fs_extra=require(_0x5a9b('0xa'));var _=require('lodash');var squel=require(_0x5a9b('0xb'));var crypto=require(_0x5a9b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a9b('0x8'));var querystring=require(_0x5a9b('0xd'));var Papa=require('papaparse');var Redis=require(_0x5a9b('0xe'));var authService=require(_0x5a9b('0xf'));var qs=require(_0x5a9b('0x10'));var as=require(_0x5a9b('0x11'));var hardwareService=require(_0x5a9b('0x12'));var logger=require('../../config/logger')(_0x5a9b('0x13'));var utils=require('../../config/utils');var config=require(_0x5a9b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a9b('0x15'))['db'];function respondWithStatusCode(_0x106614,_0x21d237){_0x21d237=_0x21d237||0xcc;return function(_0x152066){if(_0x152066){return _0x106614[_0x5a9b('0x16')](_0x21d237);}return _0x106614[_0x5a9b('0x17')](_0x21d237)['end']();};}function respondWithResult(_0x322c1b,_0x48086a){_0x48086a=_0x48086a||0xc8;return function(_0x272e7f){if(_0x272e7f){return _0x322c1b[_0x5a9b('0x17')](_0x48086a)[_0x5a9b('0x18')](_0x272e7f);}};}function respondWithFilteredResult(_0x40757d,_0x834cf){return function(_0x9a7f6d){if(_0x9a7f6d){var _0x38195c=typeof _0x834cf[_0x5a9b('0x19')]==='undefined'&&typeof _0x834cf[_0x5a9b('0x1a')]===_0x5a9b('0x1b');var _0x30d915=_0x9a7f6d[_0x5a9b('0x1c')];var _0x725cc7=_0x38195c?0x0:_0x834cf['offset'];var _0x315478=_0x38195c?_0x9a7f6d[_0x5a9b('0x1c')]:_0x834cf[_0x5a9b('0x19')]+_0x834cf['limit'];var _0x1692de;if(_0x315478>=_0x30d915){_0x315478=_0x30d915;_0x1692de=0xc8;}else{_0x1692de=0xce;}_0x40757d['status'](_0x1692de);return _0x40757d['set'](_0x5a9b('0x1d'),_0x725cc7+'-'+_0x315478+'/'+_0x30d915)[_0x5a9b('0x18')](_0x9a7f6d);}return null;};}function patchUpdates(_0x2ef8a6){return function(_0xa33626){try{jsonpatch[_0x5a9b('0x1e')](_0xa33626,_0x2ef8a6,!![]);}catch(_0x2d10fb){return BPromise[_0x5a9b('0x1f')](_0x2d10fb);}return _0xa33626['save']();};}function saveUpdates(_0x1cc092,_0xe7745c){return function(_0x125f67){if(_0x125f67){return _0x125f67[_0x5a9b('0x20')](_0x1cc092)['then'](function(_0x42da3a){return _0x42da3a;});}return null;};}function removeEntity(_0x5716a0,_0x251721){return function(_0x4e489c){if(_0x4e489c){return _0x4e489c['destroy']()['then'](function(){_0x5716a0[_0x5a9b('0x17')](0xcc)[_0x5a9b('0x21')]();});}};}function handleEntityNotFound(_0x1a1fcb,_0x412c3c){return function(_0x380c59){if(!_0x380c59){_0x1a1fcb[_0x5a9b('0x16')](0x194);}return _0x380c59;};}function handleError(_0x1f1f8d,_0x53ba9b){_0x53ba9b=_0x53ba9b||0x1f4;return function(_0x3f4be3){logger[_0x5a9b('0x22')](_0x3f4be3[_0x5a9b('0x23')]);if(_0x3f4be3[_0x5a9b('0x24')]){delete _0x3f4be3[_0x5a9b('0x24')];}_0x1f1f8d[_0x5a9b('0x17')](_0x53ba9b)[_0x5a9b('0x25')](_0x3f4be3);};}exports[_0x5a9b('0x26')]=function(_0x35e0e8,_0x5692e9){var _0x3ad788={},_0x1498ce={},_0x308a1f={'count':0x0,'rows':[]};var _0x37a53a=_[_0x5a9b('0x27')](db[_0x5a9b('0x28')][_0x5a9b('0x29')],function(_0xe110b1){return{'name':_0xe110b1[_0x5a9b('0x2a')],'type':_0xe110b1[_0x5a9b('0x2b')][_0x5a9b('0x2c')]};});_0x1498ce['model']=_[_0x5a9b('0x27')](_0x37a53a,_0x5a9b('0x24'));_0x1498ce['query']=_[_0x5a9b('0x2d')](_0x35e0e8[_0x5a9b('0x2e')]);_0x1498ce[_0x5a9b('0x2f')]=_[_0x5a9b('0x30')](_0x1498ce[_0x5a9b('0x31')],_0x1498ce[_0x5a9b('0x2e')]);_0x3ad788['attributes']=_[_0x5a9b('0x30')](_0x1498ce[_0x5a9b('0x31')],qs[_0x5a9b('0x32')](_0x35e0e8[_0x5a9b('0x2e')]['fields']));_0x3ad788['attributes']=_0x3ad788[_0x5a9b('0x33')][_0x5a9b('0x34')]?_0x3ad788[_0x5a9b('0x33')]:_0x1498ce[_0x5a9b('0x31')];if(!_0x35e0e8[_0x5a9b('0x2e')][_0x5a9b('0x35')](_0x5a9b('0x36'))){_0x3ad788[_0x5a9b('0x1a')]=qs[_0x5a9b('0x1a')](_0x35e0e8[_0x5a9b('0x2e')][_0x5a9b('0x1a')]);_0x3ad788[_0x5a9b('0x19')]=qs[_0x5a9b('0x19')](_0x35e0e8['query'][_0x5a9b('0x19')]);}_0x3ad788['order']=qs[_0x5a9b('0x37')](_0x35e0e8['query'][_0x5a9b('0x37')]);_0x3ad788['where']=qs[_0x5a9b('0x2f')](_['pick'](_0x35e0e8['query'],_0x1498ce['filters']),_0x37a53a);if(_0x35e0e8['query']['filter']){_0x3ad788['where']=_['merge'](_0x3ad788[_0x5a9b('0x38')],{'$or':_['map'](_0x37a53a,function(_0x5461c7){if(_0x5461c7[_0x5a9b('0x2b')]!==_0x5a9b('0x39')){var _0x8074a3={};_0x8074a3[_0x5461c7[_0x5a9b('0x24')]]={'$like':'%'+_0x35e0e8[_0x5a9b('0x2e')]['filter']+'%'};return _0x8074a3;}})});}_0x3ad788=_[_0x5a9b('0x3a')]({},_0x3ad788,_0x35e0e8[_0x5a9b('0x3b')]);var _0x513621={'where':_0x3ad788[_0x5a9b('0x38')]};return db[_0x5a9b('0x28')][_0x5a9b('0x1c')](_0x513621)['then'](function(_0x146021){_0x308a1f[_0x5a9b('0x1c')]=_0x146021;if(_0x35e0e8[_0x5a9b('0x2e')][_0x5a9b('0x3c')]){_0x3ad788[_0x5a9b('0x3d')]=[{'all':!![]}];}return db[_0x5a9b('0x28')]['findAll'](_0x3ad788);})[_0x5a9b('0x3e')](function(_0x880d7c){_0x308a1f['rows']=_0x880d7c;return _0x308a1f;})[_0x5a9b('0x3e')](respondWithFilteredResult(_0x5692e9,_0x3ad788))[_0x5a9b('0x3f')](handleError(_0x5692e9,null));};exports['show']=function(_0x3523b,_0x5d16e9){var _0x3c4af1={'raw':!![],'where':{'id':_0x3523b[_0x5a9b('0x40')]['id']}},_0x10be51={};_0x10be51[_0x5a9b('0x31')]=_[_0x5a9b('0x2d')](db['FaxApplication'][_0x5a9b('0x29')]);_0x10be51['query']=_['keys'](_0x3523b[_0x5a9b('0x2e')]);_0x10be51[_0x5a9b('0x2f')]=_[_0x5a9b('0x30')](_0x10be51[_0x5a9b('0x31')],_0x10be51[_0x5a9b('0x2e')]);_0x3c4af1[_0x5a9b('0x33')]=_[_0x5a9b('0x30')](_0x10be51['model'],qs[_0x5a9b('0x32')](_0x3523b[_0x5a9b('0x2e')]['fields']));_0x3c4af1[_0x5a9b('0x33')]=_0x3c4af1[_0x5a9b('0x33')]['length']?_0x3c4af1['attributes']:_0x10be51[_0x5a9b('0x31')];if(_0x3523b[_0x5a9b('0x2e')][_0x5a9b('0x3c')]){_0x3c4af1[_0x5a9b('0x3d')]=[{'all':!![]}];}_0x3c4af1=_[_0x5a9b('0x3a')]({},_0x3c4af1,_0x3523b['options']);return db[_0x5a9b('0x28')][_0x5a9b('0x41')](_0x3c4af1)[_0x5a9b('0x3e')](handleEntityNotFound(_0x5d16e9,null))[_0x5a9b('0x3e')](respondWithResult(_0x5d16e9,null))[_0x5a9b('0x3f')](handleError(_0x5d16e9,null));};exports['create']=function(_0x493bd4,_0x155bbb){return db[_0x5a9b('0x28')][_0x5a9b('0x42')](_0x493bd4[_0x5a9b('0x43')],{})[_0x5a9b('0x3e')](respondWithResult(_0x155bbb,0xc9))[_0x5a9b('0x3f')](handleError(_0x155bbb,null));};exports[_0x5a9b('0x20')]=function(_0x5d5e70,_0x443929){if(_0x5d5e70[_0x5a9b('0x43')]['id']){delete _0x5d5e70[_0x5a9b('0x43')]['id'];}return db[_0x5a9b('0x28')][_0x5a9b('0x41')]({'where':{'id':_0x5d5e70[_0x5a9b('0x40')]['id']}})[_0x5a9b('0x3e')](handleEntityNotFound(_0x443929,null))[_0x5a9b('0x3e')](saveUpdates(_0x5d5e70[_0x5a9b('0x43')],null))['then'](respondWithResult(_0x443929,null))[_0x5a9b('0x3f')](handleError(_0x443929,null));};exports['destroy']=function(_0x498337,_0x1f1d73){return db[_0x5a9b('0x28')]['find']({'where':{'id':_0x498337[_0x5a9b('0x40')]['id']}})[_0x5a9b('0x3e')](handleEntityNotFound(_0x1f1d73,null))[_0x5a9b('0x3e')](removeEntity(_0x1f1d73,null))[_0x5a9b('0x3f')](handleError(_0x1f1d73,null));}; \ No newline at end of file +var _0x8ab0=['find','params','destroy','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','order','merge','VIRTUAL','options','where','includeAll','findAll','catch','show','include','create','body'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x8ab0,0xc6));var _0x08ab=function(_0x442bd4,_0x4b51a9){_0x442bd4=_0x442bd4-0x0;var _0x36822e=_0x8ab0[_0x442bd4];return _0x36822e;};'use strict';var emlformat=require(_0x08ab('0x0'));var rimraf=require(_0x08ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x08ab('0x2'));var moment=require(_0x08ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x08ab('0x4'));var util=require(_0x08ab('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x08ab('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x08ab('0x7'));var crypto=require(_0x08ab('0x8'));var jsforce=require(_0x08ab('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08ab('0xa'));var Papa=require('papaparse');var Redis=require(_0x08ab('0xb'));var authService=require(_0x08ab('0xc'));var qs=require(_0x08ab('0xd'));var as=require(_0x08ab('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08ab('0xf'));var utils=require('../../config/utils');var config=require(_0x08ab('0x10'));var licenseUtil=require(_0x08ab('0x11'));var db=require(_0x08ab('0x12'))['db'];function respondWithStatusCode(_0x41dccc,_0x3c4171){_0x3c4171=_0x3c4171||0xcc;return function(_0x5265f1){if(_0x5265f1){return _0x41dccc[_0x08ab('0x13')](_0x3c4171);}return _0x41dccc[_0x08ab('0x14')](_0x3c4171)[_0x08ab('0x15')]();};}function respondWithResult(_0x2c8235,_0x205abc){_0x205abc=_0x205abc||0xc8;return function(_0x99d68d){if(_0x99d68d){return _0x2c8235[_0x08ab('0x14')](_0x205abc)[_0x08ab('0x16')](_0x99d68d);}};}function respondWithFilteredResult(_0x587fed,_0x93c53c){return function(_0x170ef7){if(_0x170ef7){var _0x4335aa=typeof _0x93c53c['offset']===_0x08ab('0x17')&&typeof _0x93c53c['limit']===_0x08ab('0x17');var _0xee9db6=_0x170ef7[_0x08ab('0x18')];var _0x377203=_0x4335aa?0x0:_0x93c53c[_0x08ab('0x19')];var _0x435c6e=_0x4335aa?_0x170ef7[_0x08ab('0x18')]:_0x93c53c[_0x08ab('0x19')]+_0x93c53c[_0x08ab('0x1a')];var _0x54de95;if(_0x435c6e>=_0xee9db6){_0x435c6e=_0xee9db6;_0x54de95=0xc8;}else{_0x54de95=0xce;}_0x587fed[_0x08ab('0x14')](_0x54de95);return _0x587fed[_0x08ab('0x1b')](_0x08ab('0x1c'),_0x377203+'-'+_0x435c6e+'/'+_0xee9db6)['json'](_0x170ef7);}return null;};}function patchUpdates(_0x2bf3a8){return function(_0xed999e){try{jsonpatch[_0x08ab('0x1d')](_0xed999e,_0x2bf3a8,!![]);}catch(_0x244208){return BPromise['reject'](_0x244208);}return _0xed999e['save']();};}function saveUpdates(_0x202daa,_0x409b8e){return function(_0x5ae99e){if(_0x5ae99e){return _0x5ae99e[_0x08ab('0x1e')](_0x202daa)[_0x08ab('0x1f')](function(_0x290900){return _0x290900;});}return null;};}function removeEntity(_0x153bed,_0x3591e2){return function(_0xd3e9f9){if(_0xd3e9f9){return _0xd3e9f9['destroy']()[_0x08ab('0x1f')](function(){_0x153bed[_0x08ab('0x14')](0xcc)[_0x08ab('0x15')]();});}};}function handleEntityNotFound(_0x428aaf,_0xc7aff5){return function(_0x44059c){if(!_0x44059c){_0x428aaf[_0x08ab('0x13')](0x194);}return _0x44059c;};}function handleError(_0x2ad948,_0x595b45){_0x595b45=_0x595b45||0x1f4;return function(_0x10a06c){logger[_0x08ab('0x20')](_0x10a06c[_0x08ab('0x21')]);if(_0x10a06c[_0x08ab('0x22')]){delete _0x10a06c['name'];}_0x2ad948[_0x08ab('0x14')](_0x595b45)[_0x08ab('0x23')](_0x10a06c);};}exports[_0x08ab('0x24')]=function(_0x1660c5,_0x439108){var _0x2c1233={},_0x50835c={},_0x57e484={'count':0x0,'rows':[]};var _0x1c319c=_[_0x08ab('0x25')](db[_0x08ab('0x26')][_0x08ab('0x27')],function(_0x2c9010){return{'name':_0x2c9010[_0x08ab('0x28')],'type':_0x2c9010[_0x08ab('0x29')]['key']};});_0x50835c[_0x08ab('0x2a')]=_[_0x08ab('0x25')](_0x1c319c,_0x08ab('0x22'));_0x50835c['query']=_[_0x08ab('0x2b')](_0x1660c5[_0x08ab('0x2c')]);_0x50835c[_0x08ab('0x2d')]=_[_0x08ab('0x2e')](_0x50835c[_0x08ab('0x2a')],_0x50835c[_0x08ab('0x2c')]);_0x2c1233['attributes']=_[_0x08ab('0x2e')](_0x50835c[_0x08ab('0x2a')],qs[_0x08ab('0x2f')](_0x1660c5[_0x08ab('0x2c')][_0x08ab('0x2f')]));_0x2c1233[_0x08ab('0x30')]=_0x2c1233['attributes'][_0x08ab('0x31')]?_0x2c1233[_0x08ab('0x30')]:_0x50835c['model'];if(!_0x1660c5['query']['hasOwnProperty']('nolimit')){_0x2c1233['limit']=qs[_0x08ab('0x1a')](_0x1660c5[_0x08ab('0x2c')][_0x08ab('0x1a')]);_0x2c1233['offset']=qs['offset'](_0x1660c5['query'][_0x08ab('0x19')]);}_0x2c1233[_0x08ab('0x32')]=qs['sort'](_0x1660c5['query']['sort']);_0x2c1233['where']=qs[_0x08ab('0x2d')](_['pick'](_0x1660c5['query'],_0x50835c[_0x08ab('0x2d')]),_0x1c319c);if(_0x1660c5[_0x08ab('0x2c')]['filter']){_0x2c1233['where']=_[_0x08ab('0x33')](_0x2c1233['where'],{'$or':_['map'](_0x1c319c,function(_0x46d8a2){if(_0x46d8a2[_0x08ab('0x29')]!==_0x08ab('0x34')){var _0x53537a={};_0x53537a[_0x46d8a2[_0x08ab('0x22')]]={'$like':'%'+_0x1660c5[_0x08ab('0x2c')]['filter']+'%'};return _0x53537a;}})});}_0x2c1233=_[_0x08ab('0x33')]({},_0x2c1233,_0x1660c5[_0x08ab('0x35')]);var _0x23d386={'where':_0x2c1233[_0x08ab('0x36')]};return db[_0x08ab('0x26')][_0x08ab('0x18')](_0x23d386)['then'](function(_0x47722b){_0x57e484[_0x08ab('0x18')]=_0x47722b;if(_0x1660c5[_0x08ab('0x2c')][_0x08ab('0x37')]){_0x2c1233['include']=[{'all':!![]}];}return db[_0x08ab('0x26')][_0x08ab('0x38')](_0x2c1233);})['then'](function(_0x469ead){_0x57e484['rows']=_0x469ead;return _0x57e484;})[_0x08ab('0x1f')](respondWithFilteredResult(_0x439108,_0x2c1233))[_0x08ab('0x39')](handleError(_0x439108,null));};exports[_0x08ab('0x3a')]=function(_0x1b3b6c,_0x8c7334){var _0x52dbea={'raw':!![],'where':{'id':_0x1b3b6c['params']['id']}},_0x18a7dc={};_0x18a7dc[_0x08ab('0x2a')]=_['keys'](db[_0x08ab('0x26')][_0x08ab('0x27')]);_0x18a7dc[_0x08ab('0x2c')]=_[_0x08ab('0x2b')](_0x1b3b6c['query']);_0x18a7dc[_0x08ab('0x2d')]=_[_0x08ab('0x2e')](_0x18a7dc['model'],_0x18a7dc[_0x08ab('0x2c')]);_0x52dbea['attributes']=_[_0x08ab('0x2e')](_0x18a7dc[_0x08ab('0x2a')],qs[_0x08ab('0x2f')](_0x1b3b6c[_0x08ab('0x2c')][_0x08ab('0x2f')]));_0x52dbea[_0x08ab('0x30')]=_0x52dbea[_0x08ab('0x30')][_0x08ab('0x31')]?_0x52dbea[_0x08ab('0x30')]:_0x18a7dc['model'];if(_0x1b3b6c[_0x08ab('0x2c')][_0x08ab('0x37')]){_0x52dbea[_0x08ab('0x3b')]=[{'all':!![]}];}_0x52dbea=_[_0x08ab('0x33')]({},_0x52dbea,_0x1b3b6c[_0x08ab('0x35')]);return db['FaxApplication']['find'](_0x52dbea)[_0x08ab('0x1f')](handleEntityNotFound(_0x8c7334,null))['then'](respondWithResult(_0x8c7334,null))[_0x08ab('0x39')](handleError(_0x8c7334,null));};exports[_0x08ab('0x3c')]=function(_0x31fe8b,_0x11a5dd){return db['FaxApplication'][_0x08ab('0x3c')](_0x31fe8b['body'],{})[_0x08ab('0x1f')](respondWithResult(_0x11a5dd,0xc9))[_0x08ab('0x39')](handleError(_0x11a5dd,null));};exports[_0x08ab('0x1e')]=function(_0x27360c,_0x16b27e){if(_0x27360c[_0x08ab('0x3d')]['id']){delete _0x27360c[_0x08ab('0x3d')]['id'];}return db[_0x08ab('0x26')][_0x08ab('0x3e')]({'where':{'id':_0x27360c[_0x08ab('0x3f')]['id']}})['then'](handleEntityNotFound(_0x16b27e,null))[_0x08ab('0x1f')](saveUpdates(_0x27360c['body'],null))[_0x08ab('0x1f')](respondWithResult(_0x16b27e,null))[_0x08ab('0x39')](handleError(_0x16b27e,null));};exports[_0x08ab('0x40')]=function(_0x18806d,_0x28ad38){return db[_0x08ab('0x26')][_0x08ab('0x3e')]({'where':{'id':_0x18806d['params']['id']}})[_0x08ab('0x1f')](handleEntityNotFound(_0x28ad38,null))[_0x08ab('0x1f')](removeEntity(_0x28ad38,null))[_0x08ab('0x39')](handleError(_0x28ad38,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index fd9276b..4f24728 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 _0x183f=['moment','bluebird','request-promise','rimraf','./faxApplication.attributes','define','FaxApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x155af3,_0x4b7f9a){var _0x15a675=function(_0xec0188){while(--_0xec0188){_0x155af3['push'](_0x155af3['shift']());}};_0x15a675(++_0x4b7f9a);}(_0x183f,0x98));var _0xf183=function(_0x55d92e,_0x32fbd5){_0x55d92e=_0x55d92e-0x0;var _0x3054d5=_0x183f[_0x55d92e];return _0x3054d5;};'use strict';var _=require(_0xf183('0x0'));var util=require(_0xf183('0x1'));var logger=require(_0xf183('0x2'))(_0xf183('0x3'));var moment=require(_0xf183('0x4'));var BPromise=require(_0xf183('0x5'));var rp=require(_0xf183('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf183('0x7'));var config=require('../../config/environment');var attributes=require(_0xf183('0x8'));module['exports']=function(_0x413a0d,_0x1b9327){return _0x413a0d[_0xf183('0x9')](_0xf183('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf183('0xb')});}; \ No newline at end of file +var _0xa9ab=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment','./faxApplication.attributes','exports'];(function(_0x4b0104,_0x308249){var _0x32df6e=function(_0x364a08){while(--_0x364a08){_0x4b0104['push'](_0x4b0104['shift']());}};_0x32df6e(++_0x308249);}(_0xa9ab,0x157));var _0xba9a=function(_0x3ddf88,_0x4cff2e){_0x3ddf88=_0x3ddf88-0x0;var _0x4649e3=_0xa9ab[_0x3ddf88];return _0x4649e3;};'use strict';var _=require(_0xba9a('0x0'));var util=require(_0xba9a('0x1'));var logger=require(_0xba9a('0x2'))('api');var moment=require(_0xba9a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba9a('0x4'));var rimraf=require('rimraf');var config=require(_0xba9a('0x5'));var attributes=require(_0xba9a('0x6'));module[_0xba9a('0x7')]=function(_0x1bc97f,_0xc76e37){return _0x1bc97f[_0xba9a('0x8')](_0xba9a('0x9'),attributes,{'tableName':_0xba9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba9a('0xb'),'collate':_0xba9a('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 733869d..acbd5c4 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 _0x3f5b=['then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','options','raw','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http'];(function(_0xbfe501,_0x279390){var _0xab1f4=function(_0x19ad00){while(--_0x19ad00){_0xbfe501['push'](_0xbfe501['shift']());}};_0xab1f4(++_0x279390);}(_0x3f5b,0x18c));var _0xb3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb3f5('0x0'));var util=require(_0xb3f5('0x1'));var moment=require(_0xb3f5('0x2'));var BPromise=require(_0xb3f5('0x3'));var rs=require(_0xb3f5('0x4'));var fs=require('fs');var Redis=require(_0xb3f5('0x5'));var db=require(_0xb3f5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb3f5('0x7'));var config=require('../../config/environment');var jayson=require(_0xb3f5('0x8'));var client=jayson['client'][_0xb3f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53dff8,_0x3a92f1,_0x391bb2){return new BPromise(function(_0x1f6ed8,_0x33cf4d){return client['request'](_0x53dff8,_0x391bb2)[_0xb3f5('0xa')](function(_0x10ef36){logger[_0xb3f5('0xb')](_0xb3f5('0xc'),_0x3a92f1,_0xb3f5('0xd'));logger[_0xb3f5('0xe')](_0xb3f5('0xf'),_0x3a92f1,_0xb3f5('0xd'),JSON[_0xb3f5('0x10')](_0x10ef36));if(_0x10ef36['error']){if(_0x10ef36[_0xb3f5('0x11')][_0xb3f5('0x12')]===0x1f4){logger[_0xb3f5('0x11')](_0xb3f5('0xc'),_0x3a92f1,_0x10ef36[_0xb3f5('0x11')][_0xb3f5('0x13')]);return _0x33cf4d(_0x10ef36[_0xb3f5('0x11')]['message']);}logger[_0xb3f5('0x11')](_0xb3f5('0xc'),_0x3a92f1,_0x10ef36['error'][_0xb3f5('0x13')]);return _0x1f6ed8(_0x10ef36['error'][_0xb3f5('0x13')]);}else{logger[_0xb3f5('0xb')]('FaxApplication,\x20%s,\x20%s',_0x3a92f1,_0xb3f5('0xd'));_0x1f6ed8(_0x10ef36[_0xb3f5('0x14')][_0xb3f5('0x13')]);}})[_0xb3f5('0x15')](function(_0x51c55b){logger[_0xb3f5('0x11')](_0xb3f5('0xc'),_0x3a92f1,_0x51c55b);_0x33cf4d(_0x51c55b);});});}exports[_0xb3f5('0x16')]=function(_0x4dc2dd){var _0x541786=this;return new Promise(function(_0x959f22,_0x253322){return db[_0xb3f5('0x17')][_0xb3f5('0x18')](_0x4dc2dd['body'],{'raw':_0x4dc2dd[_0xb3f5('0x19')]?_0x4dc2dd[_0xb3f5('0x19')][_0xb3f5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dc2dd[_0xb3f5('0x19')]?_0x4dc2dd['options']['where']||null:null,'attributes':_0x4dc2dd[_0xb3f5('0x19')]?_0x4dc2dd['options'][_0xb3f5('0x1b')]||null:null,'limit':_0x4dc2dd['options']?_0x4dc2dd[_0xb3f5('0x19')][_0xb3f5('0x1c')]||null:null})['then'](function(_0x21d2fe){logger[_0xb3f5('0xb')](_0xb3f5('0x16'),_0x4dc2dd);logger[_0xb3f5('0xe')](_0xb3f5('0x16'),_0x4dc2dd,JSON[_0xb3f5('0x10')](_0x21d2fe));_0x959f22(_0x21d2fe);})['catch'](function(_0x5bf755){logger[_0xb3f5('0x11')](_0xb3f5('0x16'),_0x5bf755[_0xb3f5('0x13')],_0x4dc2dd);_0x253322(_0x541786[_0xb3f5('0x11')](0x1f4,_0x5bf755[_0xb3f5('0x13')]));});});}; \ No newline at end of file +var _0x28fa=['jayson/promise','client','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','options','raw','where','attributes','limit','UpdateFaxApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x434ec1,_0x16624f){var _0x2b6848=function(_0x53cbd5){while(--_0x53cbd5){_0x434ec1['push'](_0x434ec1['shift']());}};_0x2b6848(++_0x16624f);}(_0x28fa,0x12e));var _0xa28f=function(_0x1e12f1,_0x1ac9e6){_0x1e12f1=_0x1e12f1-0x0;var _0x1f8237=_0x28fa[_0x1e12f1];return _0x1f8237;};'use strict';var _=require(_0xa28f('0x0'));var util=require(_0xa28f('0x1'));var moment=require('moment');var BPromise=require(_0xa28f('0x2'));var rs=require(_0xa28f('0x3'));var fs=require('fs');var Redis=require(_0xa28f('0x4'));var db=require(_0xa28f('0x5'))['db'];var utils=require(_0xa28f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa28f('0x7'));var jayson=require(_0xa28f('0x8'));var client=jayson[_0xa28f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd24a,_0x49730c,_0x40dbc7){return new BPromise(function(_0x1e2189,_0x2290a2){return client[_0xa28f('0xa')](_0x2cd24a,_0x40dbc7)[_0xa28f('0xb')](function(_0x433e3f){logger[_0xa28f('0xc')](_0xa28f('0xd'),_0x49730c,_0xa28f('0xe'));logger[_0xa28f('0xf')](_0xa28f('0x10'),_0x49730c,_0xa28f('0xe'),JSON[_0xa28f('0x11')](_0x433e3f));if(_0x433e3f[_0xa28f('0x12')]){if(_0x433e3f['error'][_0xa28f('0x13')]===0x1f4){logger[_0xa28f('0x12')](_0xa28f('0xd'),_0x49730c,_0x433e3f['error'][_0xa28f('0x14')]);return _0x2290a2(_0x433e3f[_0xa28f('0x12')][_0xa28f('0x14')]);}logger[_0xa28f('0x12')](_0xa28f('0xd'),_0x49730c,_0x433e3f[_0xa28f('0x12')][_0xa28f('0x14')]);return _0x1e2189(_0x433e3f[_0xa28f('0x12')]['message']);}else{logger[_0xa28f('0xc')](_0xa28f('0xd'),_0x49730c,_0xa28f('0xe'));_0x1e2189(_0x433e3f[_0xa28f('0x15')][_0xa28f('0x14')]);}})[_0xa28f('0x16')](function(_0x36ba66){logger[_0xa28f('0x12')]('FaxApplication,\x20%s,\x20%s',_0x49730c,_0x36ba66);_0x2290a2(_0x36ba66);});});}exports['UpdateFaxApplication']=function(_0x3bf5fd){var _0x4c6cf9=this;return new Promise(function(_0x1fac00,_0x2ff087){return db[_0xa28f('0x17')][_0xa28f('0x18')](_0x3bf5fd['body'],{'raw':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd['options'][_0xa28f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd['options'][_0xa28f('0x1b')]||null:null,'attributes':_0x3bf5fd['options']?_0x3bf5fd[_0xa28f('0x19')][_0xa28f('0x1c')]||null:null,'limit':_0x3bf5fd[_0xa28f('0x19')]?_0x3bf5fd[_0xa28f('0x19')][_0xa28f('0x1d')]||null:null})[_0xa28f('0xb')](function(_0x516037){logger[_0xa28f('0xc')](_0xa28f('0x1e'),_0x3bf5fd);logger[_0xa28f('0xf')](_0xa28f('0x1e'),_0x3bf5fd,JSON[_0xa28f('0x11')](_0x516037));_0x1fac00(_0x516037);})['catch'](function(_0x5ecd86){logger['error'](_0xa28f('0x1e'),_0x5ecd86[_0xa28f('0x14')],_0x3bf5fd);_0x2ff087(_0x4c6cf9[_0xa28f('0x12')](0x1f4,_0x5ecd86[_0xa28f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 962a799..0069b7e 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 _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxApplication.controller'];(function(_0xf702b,_0x4c3e15){var _0x294380=function(_0x41658a){while(--_0x41658a){_0xf702b['push'](_0xf702b['shift']());}};_0x294380(++_0x4c3e15);}(_0x14a0,0x8e));var _0x014a=function(_0x24ddf0,_0x4ef5a2){_0x24ddf0=_0x24ddf0-0x0;var _0x1d454e=_0x14a0[_0x24ddf0];return _0x1d454e;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxApplication.controller','get'];(function(_0x5009bb,_0x40380c){var _0x48ec0d=function(_0x1ebd8b){while(--_0x1ebd8b){_0x5009bb['push'](_0x5009bb['shift']());}};_0x48ec0d(++_0x40380c);}(_0xda2d,0x102));var _0xdda2=function(_0x3597e0,_0x410575){_0x3597e0=_0x3597e0-0x0;var _0x4192a8=_0xda2d[_0x3597e0];return _0x4192a8;};'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('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('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 0a99eaa..7dc2a27 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 _0xd495=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x524fa5,_0xcfc736){var _0x3a41f0=function(_0x5c7c5e){while(--_0x5c7c5e){_0x524fa5['push'](_0x524fa5['shift']());}};_0x3a41f0(++_0xcfc736);}(_0xd495,0x9f));var _0x5d49=function(_0x2afb44,_0x249a57){_0x2afb44=_0x2afb44-0x0;var _0x15ccc2=_0xd495[_0x2afb44];return _0x15ccc2;};'use strict';var Sequelize=require(_0x5d49('0x0'));module[_0x5d49('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5d49('0x2')]},'disposition':{'type':Sequelize[_0x5d49('0x3')]},'secondDisposition':{'type':Sequelize[_0x5d49('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5d49('0x3')]},'note':{'type':Sequelize[_0x5d49('0x3')]},'read1stAt':{'type':Sequelize[_0x5d49('0x2')]},'fax':{'type':Sequelize[_0x5d49('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5d49('0x4')]('in',_0x5d49('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5d49('0x4')]('in',_0x5d49('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x71a5=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x71a5,0x151));var _0x571a=function(_0x1b2dd0,_0x3a1913){_0x1b2dd0=_0x1b2dd0-0x0;var _0x53e12c=_0x71a5[_0x1b2dd0];return _0x53e12c;};'use strict';var Sequelize=require(_0x571a('0x0'));module[_0x571a('0x1')]={'closed':{'type':Sequelize[_0x571a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x571a('0x3')]},'note':{'type':Sequelize[_0x571a('0x3')]},'read1stAt':{'type':Sequelize[_0x571a('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x571a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x571a('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x571a('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f961881..6380d47 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 _0x7be3=['filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','format','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','existsSync','createReadStream','createWriteStream','basename','resolve','log','err','unlinkSync','zip-dir','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','json','undefined','offset','count','status','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxInteraction','fieldName','getOptions','findAll','fax','query','catch','show','params','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','body','describe','addMessage','FaxMessage','ids','omit','hasOwnProperty','limit','sort','where','pick','FaxInteractionId'];(function(_0x4b29f5,_0xc75f94){var _0x19813d=function(_0x5c7951){while(--_0x5c7951){_0x4b29f5['push'](_0x4b29f5['shift']());}};_0x19813d(++_0xc75f94);}(_0x7be3,0x14e));var _0x37be=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0x7be3[_0x79b649];return _0x1af9b1;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x37be('0x0'));var moment=require(_0x37be('0x1'));var BPromise=require(_0x37be('0x2'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x37be('0x3'));var Redis=require(_0x37be('0x4'));var interaction=require(_0x37be('0x5'));var qs=require(_0x37be('0x6'));var logger=require('../../config/logger')(_0x37be('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x37be('0x8')]=_[_0x37be('0x9')](config[_0x37be('0x8')],{'host':_0x37be('0xa'),'port':0x18eb});var socket=require(_0x37be('0xb'))(new Redis(config['redis']));require(_0x37be('0xc'))[_0x37be('0xd')](socket);function respondWithStatusCode(_0x220b38,_0x49a6fd){_0x49a6fd=_0x49a6fd||0xcc;return function(_0x11464b){if(_0x11464b){return _0x220b38[_0x37be('0xe')](_0x49a6fd);}return _0x220b38['status'](_0x49a6fd)[_0x37be('0xf')]();};}function respondWithResult(_0x1f85c0,_0x21c786){_0x21c786=_0x21c786||0xc8;return function(_0x4e57dd){if(_0x4e57dd){return _0x1f85c0['status'](_0x21c786)[_0x37be('0x10')](_0x4e57dd);}};}function respondWithFilteredResult(_0x455b5a,_0x4018a3){return function(_0x633237){if(_0x633237){var _0x29acf5=typeof _0x4018a3['offset']===_0x37be('0x11')&&typeof _0x4018a3['limit']===_0x37be('0x11');var _0x412cf9=_0x633237['count'];var _0x48528c=_0x29acf5?0x0:_0x4018a3[_0x37be('0x12')];var _0x5813cf=_0x29acf5?_0x633237[_0x37be('0x13')]:_0x4018a3[_0x37be('0x12')]+_0x4018a3['limit'];var _0x150a7a;if(_0x5813cf>=_0x412cf9){_0x5813cf=_0x412cf9;_0x150a7a=0xc8;}else{_0x150a7a=0xce;}_0x455b5a[_0x37be('0x14')](_0x150a7a);return _0x455b5a[_0x37be('0x15')](_0x37be('0x16'),_0x48528c+'-'+_0x5813cf+'/'+_0x412cf9)[_0x37be('0x10')](_0x633237);}return null;};}function saveUpdates(_0xa7c70d){return function(_0x59c737){if(_0x59c737){return _0x59c737[_0x37be('0x17')](_0xa7c70d)[_0x37be('0x18')](function(_0x411350){return _0x411350;});}return null;};}function removeEntity(_0x22e77b){return function(_0x20ee98){if(_0x20ee98){return _0x20ee98[_0x37be('0x19')]()[_0x37be('0x18')](function(){_0x22e77b[_0x37be('0x14')](0xcc)[_0x37be('0xf')]();});}};}function handleEntityNotFound(_0x200573){return function(_0x3a7a88){if(!_0x3a7a88){_0x200573['sendStatus'](0x194);}return _0x3a7a88;};}function handleError(_0xa081eb,_0x115d55){_0x115d55=_0x115d55||0x1f4;return function(_0x37cb13){logger[_0x37be('0x1a')](_0x37cb13[_0x37be('0x1b')]);if(_0x37cb13[_0x37be('0x1c')]){delete _0x37cb13[_0x37be('0x1c')];}_0xa081eb['status'](_0x115d55)[_0x37be('0x1d')](_0x37cb13);};}exports[_0x37be('0x1e')]=function(_0x21ec71,_0x1c0468){var _0x2bbb6c={};var _0x356187=_[_0x37be('0x1f')](db[_0x37be('0x20')]['rawAttributes'],function(_0x139fa1){return{'name':_0x139fa1[_0x37be('0x21')],'type':_0x139fa1['type']['key']};});_0x2bbb6c=qs[_0x37be('0x22')](_0x356187,_0x21ec71);return interaction[_0x37be('0x23')](_0x37be('0x24'),_0x21ec71[_0x37be('0x25')],_0x21ec71['user'],_0x2bbb6c,_0x356187)[_0x37be('0x18')](respondWithFilteredResult(_0x1c0468,_0x2bbb6c))[_0x37be('0x26')](handleError(_0x1c0468,null));};exports[_0x37be('0x27')]=function(_0x1bdd46,_0xc85763){var _0x543885={'raw':![],'where':{'id':_0x1bdd46[_0x37be('0x28')]['id']}},_0x24b11d={};_0x24b11d[_0x37be('0x29')]=_[_0x37be('0x2a')](db[_0x37be('0x20')][_0x37be('0x2b')]);_0x24b11d[_0x37be('0x25')]=_[_0x37be('0x2a')](_0x1bdd46[_0x37be('0x25')]);_0x24b11d[_0x37be('0x2c')]=_[_0x37be('0x2d')](_0x24b11d['model'],_0x24b11d[_0x37be('0x25')]);_0x543885['attributes']=_['intersection'](_0x24b11d['model'],qs[_0x37be('0x2e')](_0x1bdd46[_0x37be('0x25')][_0x37be('0x2e')]));_0x543885[_0x37be('0x2f')]=_0x543885[_0x37be('0x2f')][_0x37be('0x30')]?_0x543885[_0x37be('0x2f')]:_0x24b11d['model'];if(_0x1bdd46[_0x37be('0x25')][_0x37be('0x31')]){_0x543885[_0x37be('0x32')]=[{'all':!![]}];}_0x543885=_[_0x37be('0x33')]({},_0x543885,_0x1bdd46[_0x37be('0x34')]);return db['FaxInteraction'][_0x37be('0x35')](_0x543885)[_0x37be('0x18')](handleEntityNotFound(_0xc85763,null))[_0x37be('0x18')](respondWithResult(_0xc85763,null))[_0x37be('0x26')](handleError(_0xc85763,null));};exports['create']=function(_0x4dbf45,_0x44514e){return db[_0x37be('0x20')]['create'](_0x4dbf45[_0x37be('0x36')],{})['then'](respondWithResult(_0x44514e,0xc9))[_0x37be('0x26')](handleError(_0x44514e,null));};exports[_0x37be('0x17')]=function(_0x146a5d,_0x32b481){if(_0x146a5d['body']['id']){delete _0x146a5d[_0x37be('0x36')]['id'];}return db['FaxInteraction'][_0x37be('0x35')]({'where':{'id':_0x146a5d['params']['id']}})[_0x37be('0x18')](handleEntityNotFound(_0x32b481,null))[_0x37be('0x18')](saveUpdates(_0x146a5d[_0x37be('0x36')],null))[_0x37be('0x18')](respondWithResult(_0x32b481,null))[_0x37be('0x26')](handleError(_0x32b481,null));};exports[_0x37be('0x19')]=function(_0xead6c3,_0x3fba74){return db['FaxInteraction'][_0x37be('0x35')]({'where':{'id':_0xead6c3[_0x37be('0x28')]['id']}})[_0x37be('0x18')](handleEntityNotFound(_0x3fba74,null))['then'](removeEntity(_0x3fba74,null))[_0x37be('0x26')](handleError(_0x3fba74,null));};exports[_0x37be('0x37')]=function(_0x1c0977,_0x25706c){return db[_0x37be('0x20')][_0x37be('0x37')]()['then'](respondWithResult(_0x25706c,null))[_0x37be('0x26')](handleError(_0x25706c,null));};exports[_0x37be('0x38')]=function(_0xadd366,_0x2abb5f){return db[_0x37be('0x39')]['find']({'where':{'id':_0xadd366['params']['id']}})[_0x37be('0x18')](handleEntityNotFound(_0x2abb5f,null))[_0x37be('0x18')](function(_0x4b3a0a){if(_0x4b3a0a){return _0x4b3a0a['addMessage'](_0xadd366[_0x37be('0x36')][_0x37be('0x3a')],_[_0x37be('0x3b')](_0xadd366[_0x37be('0x36')],[_0x37be('0x3a'),'id'])||{});}})[_0x37be('0x18')](respondWithResult(_0x2abb5f,null))[_0x37be('0x26')](handleError(_0x2abb5f,null));};exports['getMessages']=function(_0x17cc80,_0x53b6f1){var _0x3fb2c6={'raw':![],'where':{}};var _0x47b04c={};var _0x11414b={'count':0x0,'rows':[]};return db[_0x37be('0x20')]['findOne']({'where':{'id':_0x17cc80['params']['id']}})['then'](handleEntityNotFound(_0x53b6f1,null))[_0x37be('0x18')](function(_0x3f46d7){if(_0x3f46d7){_0x47b04c['model']=_[_0x37be('0x2a')](db[_0x37be('0x39')]['rawAttributes']);_0x47b04c[_0x37be('0x25')]=_[_0x37be('0x2a')](_0x17cc80['query']);_0x47b04c['filters']=_[_0x37be('0x2d')](_0x47b04c[_0x37be('0x29')],_0x47b04c['query']);_0x3fb2c6[_0x37be('0x2f')]=_[_0x37be('0x2d')](_0x47b04c[_0x37be('0x29')],qs['fields'](_0x17cc80[_0x37be('0x25')][_0x37be('0x2e')]));_0x3fb2c6[_0x37be('0x2f')]=_0x3fb2c6[_0x37be('0x2f')][_0x37be('0x30')]?_0x3fb2c6['attributes']:_0x47b04c['model'];if(!_0x17cc80[_0x37be('0x25')][_0x37be('0x3c')]('nolimit')){_0x3fb2c6[_0x37be('0x3d')]=qs[_0x37be('0x3d')](_0x17cc80['query'][_0x37be('0x3d')]);_0x3fb2c6[_0x37be('0x12')]=qs[_0x37be('0x12')](_0x17cc80[_0x37be('0x25')][_0x37be('0x12')]);}_0x3fb2c6['order']=qs[_0x37be('0x3e')](_0x17cc80['query'][_0x37be('0x3e')]);_0x3fb2c6[_0x37be('0x3f')]=qs[_0x37be('0x2c')](_[_0x37be('0x40')](_0x17cc80[_0x37be('0x25')],_0x47b04c[_0x37be('0x2c')]));_0x3fb2c6[_0x37be('0x3f')][_0x37be('0x41')]=_0x3f46d7['id'];if(_0x17cc80[_0x37be('0x25')]['filter']){_0x3fb2c6[_0x37be('0x3f')]=_['merge'](_0x3fb2c6[_0x37be('0x3f')],{'$or':_[_0x37be('0x1f')](_0x3fb2c6[_0x37be('0x2f')],function(_0x14cbcb){var _0x514546={};_0x514546[_0x14cbcb]={'$like':'%'+_0x17cc80[_0x37be('0x25')][_0x37be('0x42')]+'%'};return _0x514546;})});}if(_0x17cc80[_0x37be('0x25')][_0x37be('0x43')]){var _0x4e23ab=_0x17cc80[_0x37be('0x25')]['$gte']['split'](',');var _0x2bd32c={};_0x2bd32c[_0x4e23ab[0x0]]={'$gte':moment(_0x4e23ab[0x1])['format'](_0x37be('0x44'))};_0x3fb2c6['where']=_[_0x37be('0x33')](_0x3fb2c6[_0x37be('0x3f')],_0x2bd32c);}_0x3fb2c6=_[_0x37be('0x33')]({},_0x3fb2c6,_0x17cc80[_0x37be('0x34')]);return db[_0x37be('0x39')][_0x37be('0x13')]({'where':_0x3fb2c6[_0x37be('0x3f')]})[_0x37be('0x18')](function(_0x46906b){_0x11414b[_0x37be('0x13')]=_0x46906b;if(_0x17cc80[_0x37be('0x25')][_0x37be('0x31')]){_0x3fb2c6[_0x37be('0x32')]=[{'all':!![]}];}return db[_0x37be('0x39')][_0x37be('0x23')](_0x3fb2c6);})[_0x37be('0x18')](function(_0x40bdc1){_0x11414b[_0x37be('0x45')]=_0x40bdc1;return _0x11414b;});}})[_0x37be('0x18')](respondWithFilteredResult(_0x53b6f1,_0x3fb2c6))['catch'](handleError(_0x53b6f1,null));};exports['addTags']=function(_0x47124d,_0x2f6f4b){return db[_0x37be('0x20')][_0x37be('0x35')]({'where':{'id':_0x47124d[_0x37be('0x28')]['id']}})[_0x37be('0x18')](handleEntityNotFound(_0x2f6f4b,null))[_0x37be('0x18')](function(_0x2308bb){if(_0x2308bb){return _0x2308bb[_0x37be('0x46')](_0x47124d[_0x37be('0x36')]['ids'],_[_0x37be('0x3b')](_0x47124d[_0x37be('0x36')],[_0x37be('0x3a'),'id'])||{})[_0x37be('0x47')](function(){return db[_0x37be('0x48')][_0x37be('0x23')]({'attributes':['id',_0x37be('0x1c'),_0x37be('0x49')],'where':{'id':_0x47124d[_0x37be('0x36')][_0x37be('0x3a')]}});})[_0x37be('0x18')](function(_0x338c16){socket[_0x37be('0x4a')](_0x37be('0x4b'),{'id':Number(_0x47124d[_0x37be('0x28')]['id']),'tags':_0x338c16||[]});return{'id':Number(_0x47124d[_0x37be('0x28')]['id']),'tags':_0x338c16||[]};});}})[_0x37be('0x18')](respondWithResult(_0x2f6f4b,null))[_0x37be('0x26')](handleError(_0x2f6f4b,null));};exports['removeTags']=function(_0x4731f3,_0x26e1cb){return db[_0x37be('0x20')][_0x37be('0x35')]({'where':{'id':_0x4731f3[_0x37be('0x28')]['id']}})['then'](handleEntityNotFound(_0x26e1cb,null))[_0x37be('0x18')](function(_0x59a59d){if(_0x59a59d){return _0x59a59d[_0x37be('0x4c')](_0x4731f3[_0x37be('0x25')][_0x37be('0x3a')]);}})['then'](respondWithStatusCode(_0x26e1cb,null))[_0x37be('0x26')](handleError(_0x26e1cb,null));};exports[_0x37be('0x4d')]=function(_0x5b7f4a,_0x5cf51a){var _0x59725e=moment()[_0x37be('0x4e')]()[_0x37be('0x4f')]();var _0x1af7f5=path[_0x37be('0x50')](config[_0x37be('0x51')],'server',_0x37be('0x52'),_0x37be('0x53'));var _0x5d2322=path[_0x37be('0x50')](config['root'],_0x37be('0x54'),'files',_0x37be('0x55'));var _0x4f7966=path[_0x37be('0x50')](_0x1af7f5,_0x59725e);var _0x364ed3=util[_0x37be('0x56')](_0x37be('0x57'),_0x5b7f4a[_0x37be('0x28')]['id'],_0x59725e);var _0x2d1c8c=path[_0x37be('0x50')](_0x1af7f5,_0x364ed3);var _0x4bcae5=[];_0x4bcae5['push']({'model':db['Attachment'],'as':_0x37be('0x58'),'raw':!![]});var _0x52e1d2=[{'model':db['FaxMessage'],'as':_0x37be('0x59'),'attributes':['id',_0x37be('0x36'),_0x37be('0x5a')],'include':_0x4bcae5}];return db[_0x37be('0x20')]['find']({'where':{'id':_0x5b7f4a[_0x37be('0x28')]['id']},'include':_0x52e1d2})[_0x37be('0x18')](handleEntityNotFound(_0x5cf51a,null))[_0x37be('0x18')](function(_0x29b345){if(_0x29b345&&_0x29b345[_0x37be('0x59')]){var _0x2fba2b=_0x29b345[_0x37be('0x5b')]({'plain':!![]});fs['mkdirSync'](_0x4f7966);for(var _0x4872be=0x0;_0x4872be<_0x2fba2b[_0x37be('0x59')]['length'];_0x4872be++){var _0x2967c1=_0x2fba2b[_0x37be('0x59')][_0x4872be][_0x37be('0x58')];if(_0x2967c1){var _0x354ccd=path[_0x37be('0x50')](_0x5d2322,_0x2967c1['basename']);if(fs[_0x37be('0x5c')](_0x354ccd)){fs[_0x37be('0x5d')](_0x354ccd)['pipe'](fs[_0x37be('0x5e')](path[_0x37be('0x50')](_0x4f7966,_0x2967c1[_0x37be('0x5f')])));}}}return BPromise[_0x37be('0x60')]()['then'](function(){return new BPromise(function(_0x847af,_0x21bfcb){zipdir(_0x4f7966,{'saveTo':_0x2d1c8c},function(_0x15febd,_0x5f3b2a){if(_0x15febd)return _0x21bfcb(_0x15febd);return _0x847af(_0x5f3b2a);});})[_0x37be('0x18')](function(){return new BPromise(function(_0x427380,_0x7b237){rimraf(_0x4f7966,function(_0x513589){if(_0x513589)_0x7b237(_0x513589);return _0x427380();});});})[_0x37be('0x18')](function(){return _0x5cf51a['download'](_0x2d1c8c,_0x364ed3,function(_0x98e952){if(_0x98e952){console[_0x37be('0x61')](_0x37be('0x62'),_0x98e952);}else{fs[_0x37be('0x63')](_0x2d1c8c);}});});});}else{return _0x5cf51a['sendStatus'](0xc8);}})['catch'](handleError(_0x5cf51a,null));}; \ No newline at end of file +var _0xb004=['keys','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','body','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','fields','hasOwnProperty','limit','order','sort','where','pick','FaxInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','faxInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','format','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','log','err','unlinkSync','zip-dir','path','lodash','ioredis','../../components/interaction/service','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','count','set','json','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','findAll','catch','show','model'];(function(_0x45a4f7,_0x4e5edb){var _0x548dc5=function(_0x380083){while(--_0x380083){_0x45a4f7['push'](_0x45a4f7['shift']());}};_0x548dc5(++_0x4e5edb);}(_0xb004,0x1a8));var _0x4b00=function(_0xf3a48c,_0x39f486){_0xf3a48c=_0xf3a48c-0x0;var _0x1e5a07=_0xb004[_0xf3a48c];return _0x1e5a07;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4b00('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x4b00('0x1'));var fs=require('fs');var _=require(_0x4b00('0x2'));var Redis=require(_0x4b00('0x3'));var interaction=require(_0x4b00('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x4b00('0x5'));var db=require(_0x4b00('0x6'))['db'];config[_0x4b00('0x7')]=_['defaults'](config[_0x4b00('0x7')],{'host':_0x4b00('0x8'),'port':0x18eb});var socket=require(_0x4b00('0x9'))(new Redis(config[_0x4b00('0x7')]));require('./faxInteraction.socket')[_0x4b00('0xa')](socket);function respondWithStatusCode(_0x699b44,_0x3f82a7){_0x3f82a7=_0x3f82a7||0xcc;return function(_0x4b30b8){if(_0x4b30b8){return _0x699b44[_0x4b00('0xb')](_0x3f82a7);}return _0x699b44['status'](_0x3f82a7)[_0x4b00('0xc')]();};}function respondWithResult(_0x460076,_0x229728){_0x229728=_0x229728||0xc8;return function(_0x92ad40){if(_0x92ad40){return _0x460076[_0x4b00('0xd')](_0x229728)['json'](_0x92ad40);}};}function respondWithFilteredResult(_0x55a60a,_0x5eb306){return function(_0x42dbba){if(_0x42dbba){var _0x2fcbac=typeof _0x5eb306[_0x4b00('0xe')]===_0x4b00('0xf')&&typeof _0x5eb306['limit']===_0x4b00('0xf');var _0x2dca86=_0x42dbba['count'];var _0x8b7ef7=_0x2fcbac?0x0:_0x5eb306['offset'];var _0x3c7e3e=_0x2fcbac?_0x42dbba[_0x4b00('0x10')]:_0x5eb306[_0x4b00('0xe')]+_0x5eb306['limit'];var _0x111cda;if(_0x3c7e3e>=_0x2dca86){_0x3c7e3e=_0x2dca86;_0x111cda=0xc8;}else{_0x111cda=0xce;}_0x55a60a['status'](_0x111cda);return _0x55a60a[_0x4b00('0x11')]('Content-Range',_0x8b7ef7+'-'+_0x3c7e3e+'/'+_0x2dca86)[_0x4b00('0x12')](_0x42dbba);}return null;};}function saveUpdates(_0x4456de){return function(_0x5acabf){if(_0x5acabf){return _0x5acabf['update'](_0x4456de)[_0x4b00('0x13')](function(_0x7b65af){return _0x7b65af;});}return null;};}function removeEntity(_0x100a22){return function(_0x25ab08){if(_0x25ab08){return _0x25ab08[_0x4b00('0x14')]()[_0x4b00('0x13')](function(){_0x100a22[_0x4b00('0xd')](0xcc)[_0x4b00('0xc')]();});}};}function handleEntityNotFound(_0x3b544c){return function(_0x1a9dd2){if(!_0x1a9dd2){_0x3b544c[_0x4b00('0xb')](0x194);}return _0x1a9dd2;};}function handleError(_0x5a8d63,_0x2f2023){_0x2f2023=_0x2f2023||0x1f4;return function(_0x1980b6){logger[_0x4b00('0x15')](_0x1980b6[_0x4b00('0x16')]);if(_0x1980b6[_0x4b00('0x17')]){delete _0x1980b6[_0x4b00('0x17')];}_0x5a8d63[_0x4b00('0xd')](_0x2f2023)[_0x4b00('0x18')](_0x1980b6);};}exports[_0x4b00('0x19')]=function(_0x2c95a8,_0x3e15ff){var _0x3ddb04={};var _0x923ce7=_[_0x4b00('0x1a')](db[_0x4b00('0x1b')][_0x4b00('0x1c')],function(_0x4708e2){return{'name':_0x4708e2[_0x4b00('0x1d')],'type':_0x4708e2[_0x4b00('0x1e')][_0x4b00('0x1f')]};});_0x3ddb04=qs['getOptions'](_0x923ce7,_0x2c95a8);return interaction[_0x4b00('0x20')]('fax',_0x2c95a8['query'],_0x2c95a8['user'],_0x3ddb04,_0x923ce7)[_0x4b00('0x13')](respondWithFilteredResult(_0x3e15ff,_0x3ddb04))[_0x4b00('0x21')](handleError(_0x3e15ff,null));};exports[_0x4b00('0x22')]=function(_0x26707f,_0x3ebc65){var _0x1b29f0={'raw':![],'where':{'id':_0x26707f['params']['id']}},_0x1882ce={};_0x1882ce[_0x4b00('0x23')]=_[_0x4b00('0x24')](db[_0x4b00('0x1b')][_0x4b00('0x1c')]);_0x1882ce[_0x4b00('0x25')]=_['keys'](_0x26707f[_0x4b00('0x25')]);_0x1882ce[_0x4b00('0x26')]=_[_0x4b00('0x27')](_0x1882ce['model'],_0x1882ce[_0x4b00('0x25')]);_0x1b29f0[_0x4b00('0x28')]=_[_0x4b00('0x27')](_0x1882ce[_0x4b00('0x23')],qs['fields'](_0x26707f[_0x4b00('0x25')]['fields']));_0x1b29f0['attributes']=_0x1b29f0[_0x4b00('0x28')][_0x4b00('0x29')]?_0x1b29f0[_0x4b00('0x28')]:_0x1882ce[_0x4b00('0x23')];if(_0x26707f[_0x4b00('0x25')][_0x4b00('0x2a')]){_0x1b29f0[_0x4b00('0x2b')]=[{'all':!![]}];}_0x1b29f0=_[_0x4b00('0x2c')]({},_0x1b29f0,_0x26707f[_0x4b00('0x2d')]);return db[_0x4b00('0x1b')][_0x4b00('0x2e')](_0x1b29f0)[_0x4b00('0x13')](handleEntityNotFound(_0x3ebc65,null))[_0x4b00('0x13')](respondWithResult(_0x3ebc65,null))[_0x4b00('0x21')](handleError(_0x3ebc65,null));};exports['create']=function(_0x547b77,_0x5ebbde){return db[_0x4b00('0x1b')]['create'](_0x547b77[_0x4b00('0x2f')],{})[_0x4b00('0x13')](respondWithResult(_0x5ebbde,0xc9))[_0x4b00('0x21')](handleError(_0x5ebbde,null));};exports['update']=function(_0x138ac8,_0x48c2d4){if(_0x138ac8['body']['id']){delete _0x138ac8['body']['id'];}return db[_0x4b00('0x1b')]['find']({'where':{'id':_0x138ac8[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x48c2d4,null))[_0x4b00('0x13')](saveUpdates(_0x138ac8[_0x4b00('0x2f')],null))[_0x4b00('0x13')](respondWithResult(_0x48c2d4,null))[_0x4b00('0x21')](handleError(_0x48c2d4,null));};exports[_0x4b00('0x14')]=function(_0x1c43e,_0x30932e){return db['FaxInteraction'][_0x4b00('0x2e')]({'where':{'id':_0x1c43e[_0x4b00('0x30')]['id']}})['then'](handleEntityNotFound(_0x30932e,null))[_0x4b00('0x13')](removeEntity(_0x30932e,null))[_0x4b00('0x21')](handleError(_0x30932e,null));};exports[_0x4b00('0x31')]=function(_0x26d53f,_0x37c5a4){return db[_0x4b00('0x1b')]['describe']()[_0x4b00('0x13')](respondWithResult(_0x37c5a4,null))[_0x4b00('0x21')](handleError(_0x37c5a4,null));};exports[_0x4b00('0x32')]=function(_0xb26c0d,_0x44bf3a){return db[_0x4b00('0x33')][_0x4b00('0x2e')]({'where':{'id':_0xb26c0d[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x44bf3a,null))['then'](function(_0x1991bd){if(_0x1991bd){return _0x1991bd['addMessage'](_0xb26c0d[_0x4b00('0x2f')][_0x4b00('0x34')],_[_0x4b00('0x35')](_0xb26c0d[_0x4b00('0x2f')],['ids','id'])||{});}})['then'](respondWithResult(_0x44bf3a,null))[_0x4b00('0x21')](handleError(_0x44bf3a,null));};exports[_0x4b00('0x36')]=function(_0x432a7d,_0x57e145){var _0x45e2fe={'raw':![],'where':{}};var _0x4ebb94={};var _0x5c9940={'count':0x0,'rows':[]};return db[_0x4b00('0x1b')][_0x4b00('0x37')]({'where':{'id':_0x432a7d[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x57e145,null))['then'](function(_0x154a54){if(_0x154a54){_0x4ebb94['model']=_['keys'](db['FaxMessage'][_0x4b00('0x1c')]);_0x4ebb94[_0x4b00('0x25')]=_[_0x4b00('0x24')](_0x432a7d[_0x4b00('0x25')]);_0x4ebb94[_0x4b00('0x26')]=_[_0x4b00('0x27')](_0x4ebb94['model'],_0x4ebb94[_0x4b00('0x25')]);_0x45e2fe[_0x4b00('0x28')]=_[_0x4b00('0x27')](_0x4ebb94['model'],qs['fields'](_0x432a7d['query'][_0x4b00('0x38')]));_0x45e2fe[_0x4b00('0x28')]=_0x45e2fe[_0x4b00('0x28')]['length']?_0x45e2fe['attributes']:_0x4ebb94[_0x4b00('0x23')];if(!_0x432a7d[_0x4b00('0x25')][_0x4b00('0x39')]('nolimit')){_0x45e2fe['limit']=qs[_0x4b00('0x3a')](_0x432a7d['query']['limit']);_0x45e2fe[_0x4b00('0xe')]=qs[_0x4b00('0xe')](_0x432a7d[_0x4b00('0x25')][_0x4b00('0xe')]);}_0x45e2fe[_0x4b00('0x3b')]=qs[_0x4b00('0x3c')](_0x432a7d[_0x4b00('0x25')][_0x4b00('0x3c')]);_0x45e2fe[_0x4b00('0x3d')]=qs[_0x4b00('0x26')](_[_0x4b00('0x3e')](_0x432a7d['query'],_0x4ebb94['filters']));_0x45e2fe[_0x4b00('0x3d')][_0x4b00('0x3f')]=_0x154a54['id'];if(_0x432a7d[_0x4b00('0x25')][_0x4b00('0x40')]){_0x45e2fe[_0x4b00('0x3d')]=_['merge'](_0x45e2fe[_0x4b00('0x3d')],{'$or':_['map'](_0x45e2fe[_0x4b00('0x28')],function(_0x49871b){var _0x40df75={};_0x40df75[_0x49871b]={'$like':'%'+_0x432a7d['query']['filter']+'%'};return _0x40df75;})});}if(_0x432a7d[_0x4b00('0x25')]['$gte']){var _0x3eb507=_0x432a7d[_0x4b00('0x25')][_0x4b00('0x41')]['split'](',');var _0x9d677e={};_0x9d677e[_0x3eb507[0x0]]={'$gte':moment(_0x3eb507[0x1])['format'](_0x4b00('0x42'))};_0x45e2fe['where']=_[_0x4b00('0x2c')](_0x45e2fe['where'],_0x9d677e);}_0x45e2fe=_['merge']({},_0x45e2fe,_0x432a7d[_0x4b00('0x2d')]);return db[_0x4b00('0x33')][_0x4b00('0x10')]({'where':_0x45e2fe[_0x4b00('0x3d')]})[_0x4b00('0x13')](function(_0x2311e2){_0x5c9940[_0x4b00('0x10')]=_0x2311e2;if(_0x432a7d[_0x4b00('0x25')][_0x4b00('0x2a')]){_0x45e2fe['include']=[{'all':!![]}];}return db[_0x4b00('0x33')][_0x4b00('0x20')](_0x45e2fe);})[_0x4b00('0x13')](function(_0x23468c){_0x5c9940[_0x4b00('0x43')]=_0x23468c;return _0x5c9940;});}})[_0x4b00('0x13')](respondWithFilteredResult(_0x57e145,_0x45e2fe))[_0x4b00('0x21')](handleError(_0x57e145,null));};exports[_0x4b00('0x44')]=function(_0x895df8,_0x2af96b){return db[_0x4b00('0x1b')]['find']({'where':{'id':_0x895df8['params']['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x2af96b,null))[_0x4b00('0x13')](function(_0x1d30a4){if(_0x1d30a4){return _0x1d30a4[_0x4b00('0x45')](_0x895df8[_0x4b00('0x2f')][_0x4b00('0x34')],_['omit'](_0x895df8[_0x4b00('0x2f')],[_0x4b00('0x34'),'id'])||{})['spread'](function(){return db['Tag'][_0x4b00('0x20')]({'attributes':['id','name','color'],'where':{'id':_0x895df8[_0x4b00('0x2f')][_0x4b00('0x34')]}});})[_0x4b00('0x13')](function(_0x1520fc){socket['emit'](_0x4b00('0x46'),{'id':Number(_0x895df8[_0x4b00('0x30')]['id']),'tags':_0x1520fc||[]});return{'id':Number(_0x895df8[_0x4b00('0x30')]['id']),'tags':_0x1520fc||[]};});}})[_0x4b00('0x13')](respondWithResult(_0x2af96b,null))['catch'](handleError(_0x2af96b,null));};exports['removeTags']=function(_0x184397,_0x427b01){return db[_0x4b00('0x1b')]['find']({'where':{'id':_0x184397[_0x4b00('0x30')]['id']}})[_0x4b00('0x13')](handleEntityNotFound(_0x427b01,null))[_0x4b00('0x13')](function(_0x202d7c){if(_0x202d7c){return _0x202d7c[_0x4b00('0x47')](_0x184397[_0x4b00('0x25')]['ids']);}})[_0x4b00('0x13')](respondWithStatusCode(_0x427b01,null))['catch'](handleError(_0x427b01,null));};exports[_0x4b00('0x48')]=function(_0x224423,_0x19fcf0){var _0x2126c6=moment()[_0x4b00('0x49')]()[_0x4b00('0x4a')]();var _0x281251=path[_0x4b00('0x4b')](config['root'],_0x4b00('0x4c'),_0x4b00('0x4d'),_0x4b00('0x4e'));var _0x350f00=path[_0x4b00('0x4b')](config[_0x4b00('0x4f')],_0x4b00('0x4c'),_0x4b00('0x4d'),_0x4b00('0x50'));var _0x561991=path[_0x4b00('0x4b')](_0x281251,_0x2126c6);var _0x55c53e=util[_0x4b00('0x51')]('transcript-%d-%s.zip',_0x224423[_0x4b00('0x30')]['id'],_0x2126c6);var _0x14949e=path[_0x4b00('0x4b')](_0x281251,_0x55c53e);var _0x29a7c1=[];_0x29a7c1['push']({'model':db[_0x4b00('0x52')],'as':'Attachment','raw':!![]});var _0x41f1b3=[{'model':db[_0x4b00('0x33')],'as':_0x4b00('0x53'),'attributes':['id',_0x4b00('0x2f'),_0x4b00('0x54')],'include':_0x29a7c1}];return db[_0x4b00('0x1b')][_0x4b00('0x2e')]({'where':{'id':_0x224423['params']['id']},'include':_0x41f1b3})[_0x4b00('0x13')](handleEntityNotFound(_0x19fcf0,null))[_0x4b00('0x13')](function(_0x33486d){if(_0x33486d&&_0x33486d[_0x4b00('0x53')]){var _0x742094=_0x33486d[_0x4b00('0x55')]({'plain':!![]});fs['mkdirSync'](_0x561991);for(var _0x3a731a=0x0;_0x3a731a<_0x742094[_0x4b00('0x53')][_0x4b00('0x29')];_0x3a731a++){var _0x4706a1=_0x742094[_0x4b00('0x53')][_0x3a731a][_0x4b00('0x52')];if(_0x4706a1){var _0x274371=path['join'](_0x350f00,_0x4706a1[_0x4b00('0x56')]);if(fs[_0x4b00('0x57')](_0x274371)){fs[_0x4b00('0x58')](_0x274371)['pipe'](fs['createWriteStream'](path[_0x4b00('0x4b')](_0x561991,_0x4706a1[_0x4b00('0x56')])));}}}return BPromise['resolve']()[_0x4b00('0x13')](function(){return new BPromise(function(_0xc7e74a,_0x474c7a){zipdir(_0x561991,{'saveTo':_0x14949e},function(_0x56aece,_0x52611c){if(_0x56aece)return _0x474c7a(_0x56aece);return _0xc7e74a(_0x52611c);});})[_0x4b00('0x13')](function(){return new BPromise(function(_0x19da68,_0xd55431){rimraf(_0x561991,function(_0x2b6b8a){if(_0x2b6b8a)_0xd55431(_0x2b6b8a);return _0x19da68();});});})[_0x4b00('0x13')](function(){return _0x19fcf0['download'](_0x14949e,_0x55c53e,function(_0x2c05c0){if(_0x2c05c0){console[_0x4b00('0x59')](_0x4b00('0x5a'),_0x2c05c0);}else{fs[_0x4b00('0x5b')](_0x14949e);}});});});}else{return _0x19fcf0['sendStatus'](0xc8);}})['catch'](handleError(_0x19fcf0,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 286a911..4a71b77 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 _0x871a=['remove','then','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0x871a,0x13d));var _0xa871=function(_0xd0e677,_0x42939d){_0xd0e677=_0xd0e677-0x0;var _0x18aeb9=_0x871a[_0xd0e677];return _0x18aeb9;};'use strict';var EventEmitter=require(_0xa871('0x0'));var FaxInteraction=require(_0xa871('0x1'))['db'][_0xa871('0x2')];var FaxMessage=require(_0xa871('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa871('0x3')](0x0);var events={'afterCreate':_0xa871('0x4'),'afterUpdate':_0xa871('0x5'),'afterDestroy':_0xa871('0x6')};function emitEvent(_0x466f7b){return function(_0x4f95f5,_0x13ec9b,_0x33b059){_0x4f95f5['getUsers']({'attributes':['id'],'raw':!![]})[_0xa871('0x7')](function(_0x33ad17){_0x4f95f5['setDataValue']('Users',_0x33ad17[_0xa871('0x8')](function(_0x4e9c2a){return{'id':_0x4e9c2a['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4f95f5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa871('0x7')](function(_0x5ad2bb){_0x4f95f5[_0xa871('0x9')](_0xa871('0xa'),_0x5ad2bb[_0xa871('0xb')]);FaxInteractionEvents[_0xa871('0xc')](_0x466f7b+':'+_0x4f95f5['id'],_0x4f95f5);FaxInteractionEvents[_0xa871('0xc')](_0x466f7b,_0x4f95f5);_0x33b059(null);})[_0xa871('0xd')](_0x33b059(null));};}for(var e in events){if(events[_0xa871('0xe')](e)){var event=events[e];FaxInteraction[_0xa871('0xf')](e,emitEvent(event));}}module[_0xa871('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x159d=['FaxMessage','save','update','remove','getUsers','findAll','setDataValue','emit','catch','hook','exports','../../mysqldb'];(function(_0x3cac01,_0x471c3e){var _0x2d3dbe=function(_0x4f267c){while(--_0x4f267c){_0x3cac01['push'](_0x3cac01['shift']());}};_0x2d3dbe(++_0x471c3e);}(_0x159d,0x77));var _0xd159=function(_0x426fb9,_0x73b8ed){_0x426fb9=_0x426fb9-0x0;var _0x2d1760=_0x159d[_0x426fb9];return _0x2d1760;};'use strict';var EventEmitter=require('events');var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xd159('0x0'))['db'][_0xd159('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd159('0x2'),'afterUpdate':_0xd159('0x3'),'afterDestroy':_0xd159('0x4')};function emitEvent(_0x32f5db){return function(_0x4a9d4f,_0x1aeffc,_0x58cff4){_0x4a9d4f[_0xd159('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x486609){_0x4a9d4f['setDataValue']('Users',_0x486609['map'](function(_0x48b505){return{'id':_0x48b505['id']};}));return FaxMessage[_0xd159('0x6')]({'where':{'FaxInteractionId':_0x4a9d4f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16c1d1){_0x4a9d4f[_0xd159('0x7')]('unreadMessages',_0x16c1d1['length']);FaxInteractionEvents[_0xd159('0x8')](_0x32f5db+':'+_0x4a9d4f['id'],_0x4a9d4f);FaxInteractionEvents[_0xd159('0x8')](_0x32f5db,_0x4a9d4f);_0x58cff4(null);})[_0xd159('0x9')](_0x58cff4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xd159('0xa')](e,emitEvent(event));}}module[_0xd159('0xb')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index bc21026..daf91b4 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 _0x4c97=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closed','format','lodash','util'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x4c97,0xd0));var _0x74c9=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x4c97[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x74c9('0x0'));var util=require(_0x74c9('0x1'));var logger=require('../../config/logger')(_0x74c9('0x2'));var moment=require(_0x74c9('0x3'));var BPromise=require(_0x74c9('0x4'));var rp=require(_0x74c9('0x5'));var fs=require('fs');var path=require(_0x74c9('0x6'));var rimraf=require(_0x74c9('0x7'));var config=require(_0x74c9('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x58ec52,_0x2b06c5){return _0x58ec52[_0x74c9('0x9')](_0x74c9('0xa'),attributes,{'tableName':_0x74c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x485249,_0x3a1bfd,_0x162139){if(_0x485249[_0x74c9('0xc')](_0x74c9('0xd'))){_0x485249['closedAt']=moment()[_0x74c9('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x162139(null,_0x485249);}}});}; \ No newline at end of file +var _0xf5ac=['FaxInteraction','fax_interactions','closed','closedAt','format','lodash','../../config/logger','moment','bluebird','path','rimraf','./faxInteraction.attributes','exports','define'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf5ac,0x1a9));var _0xcf5a=function(_0x3a1880,_0x465dc1){_0x3a1880=_0x3a1880-0x0;var _0x448f25=_0xf5ac[_0x3a1880];return _0x448f25;};'use strict';var _=require(_0xcf5a('0x0'));var util=require('util');var logger=require(_0xcf5a('0x1'))('api');var moment=require(_0xcf5a('0x2'));var BPromise=require(_0xcf5a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf5a('0x4'));var rimraf=require(_0xcf5a('0x5'));var config=require('../../config/environment');var attributes=require(_0xcf5a('0x6'));module[_0xcf5a('0x7')]=function(_0x2bfa6f,_0x529b50){return _0x2bfa6f[_0xcf5a('0x8')](_0xcf5a('0x9'),attributes,{'tableName':_0xcf5a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x66dde,_0x267a93,_0x2660b6){if(_0x66dde['changed'](_0xcf5a('0xb'))){_0x66dde[_0xcf5a('0xc')]=moment()[_0xcf5a('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2660b6(null,_0x66dde);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 69d7a1d..5fa6f37 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 _0x986d=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','stringify','AddTagsToFaxInteraction','find','where','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x136290,_0x3e6b8f){var _0x290e92=function(_0x4095d6){while(--_0x4095d6){_0x136290['push'](_0x136290['shift']());}};_0x290e92(++_0x3e6b8f);}(_0x986d,0x6f));var _0xd986=function(_0x67667e,_0x424f72){_0x67667e=_0x67667e-0x0;var _0xa8ec1e=_0x986d[_0x67667e];return _0xa8ec1e;};'use strict';var _=require(_0xd986('0x0'));var util=require(_0xd986('0x1'));var moment=require(_0xd986('0x2'));var BPromise=require(_0xd986('0x3'));var rs=require(_0xd986('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd986('0x5'));var logger=require(_0xd986('0x6'))(_0xd986('0x7'));var config=require(_0xd986('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd986('0x9')][_0xd986('0xa')]({'port':0x232a});config[_0xd986('0xb')]=_['defaults'](config[_0xd986('0xb')],{'host':_0xd986('0xc'),'port':0x18eb});var socket=require(_0xd986('0xd'))(new Redis(config[_0xd986('0xb')]));require('./faxInteraction.socket')[_0xd986('0xe')](socket);function respondWithRpcPromise(_0x3e31f3,_0x485e48,_0x4ef385){return new BPromise(function(_0x5d33a3,_0x54ae70){return client[_0xd986('0xf')](_0x3e31f3,_0x4ef385)['then'](function(_0x245ee3){logger[_0xd986('0x10')](_0xd986('0x11'),_0x485e48,'request\x20sent');logger[_0xd986('0x12')](_0xd986('0x13'),_0x485e48,'request\x20sent',JSON['stringify'](_0x245ee3));if(_0x245ee3[_0xd986('0x14')]){if(_0x245ee3[_0xd986('0x14')][_0xd986('0x15')]===0x1f4){logger['error'](_0xd986('0x11'),_0x485e48,_0x245ee3[_0xd986('0x14')][_0xd986('0x16')]);return _0x54ae70(_0x245ee3['error'][_0xd986('0x16')]);}logger['error'](_0xd986('0x11'),_0x485e48,_0x245ee3[_0xd986('0x14')][_0xd986('0x16')]);return _0x5d33a3(_0x245ee3['error'][_0xd986('0x16')]);}else{logger[_0xd986('0x10')](_0xd986('0x11'),_0x485e48,_0xd986('0x17'));_0x5d33a3(_0x245ee3['result'][_0xd986('0x16')]);}})[_0xd986('0x18')](function(_0x2b8969){logger[_0xd986('0x14')](_0xd986('0x11'),_0x485e48,_0x2b8969);_0x54ae70(_0x2b8969);});});}exports[_0xd986('0x19')]=function(_0x2d7aed){var _0x298e94=this;return new Promise(function(_0x3b97a9,_0x1f8093){return db[_0xd986('0x1a')][_0xd986('0x1b')](_0x2d7aed[_0xd986('0x1c')],{'raw':_0x2d7aed[_0xd986('0x1d')]?_0x2d7aed[_0xd986('0x1d')][_0xd986('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d7aed[_0xd986('0x1d')]?_0x2d7aed[_0xd986('0x1d')]['where']||null:null,'attributes':_0x2d7aed[_0xd986('0x1d')]?_0x2d7aed['options']['attributes']||null:null,'limit':_0x2d7aed[_0xd986('0x1d')]?_0x2d7aed[_0xd986('0x1d')][_0xd986('0x1f')]||null:null})['then'](function(_0x2f4b6){logger[_0xd986('0x10')](_0xd986('0x19'),_0x2d7aed);logger[_0xd986('0x12')](_0xd986('0x19'),_0x2d7aed,JSON[_0xd986('0x20')](_0x2f4b6));_0x3b97a9(_0x2f4b6);})[_0xd986('0x18')](function(_0xefee3b){logger[_0xd986('0x14')](_0xd986('0x19'),_0xefee3b[_0xd986('0x16')],_0x2d7aed);_0x1f8093(_0x298e94['error'](0x1f4,_0xefee3b['message']));});});};exports[_0xd986('0x21')]=function(_0x4cbf86){return new Promise(function(_0x37abc8,_0xee0dab){return db[_0xd986('0x1a')][_0xd986('0x22')]({'where':_0x4cbf86[_0xd986('0x1d')]?_0x4cbf86[_0xd986('0x1d')][_0xd986('0x23')]||null:null})['then'](function(_0x41599a){if(_0x41599a){return _0x41599a[_0xd986('0x24')](_0x4cbf86[_0xd986('0x1c')][_0xd986('0x25')],_['omit'](_0x4cbf86[_0xd986('0x1c')],[_0xd986('0x25'),'id'])||{});}})['spread'](function(_0x124d4c){logger[_0xd986('0x10')](_0xd986('0x26'),_0x4cbf86);logger[_0xd986('0x12')](_0xd986('0x26'),_0x4cbf86,JSON[_0xd986('0x20')](_0x124d4c));_0x37abc8(_0x124d4c);})[_0xd986('0x18')](function(_0x2812ad){logger[_0xd986('0x14')](_0xd986('0x26'),_0x2812ad['message'],_0x4cbf86);_0xee0dab(_this[_0xd986('0x14')](0x1f4,_0x2812ad[_0xd986('0x16')]));});});}; \ No newline at end of file +var _0xc059=['find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','then','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','options','raw','limit','info','stringify','catch','AddTagsToFaxInteraction'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0xc059,0x1a1));var _0x9c05=function(_0x19c55c,_0x1323fe){_0x19c55c=_0x19c55c-0x0;var _0x140dc4=_0xc059[_0x19c55c];return _0x140dc4;};'use strict';var _=require(_0x9c05('0x0'));var util=require('util');var moment=require(_0x9c05('0x1'));var BPromise=require(_0x9c05('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c05('0x3'));var db=require(_0x9c05('0x4'))['db'];var utils=require(_0x9c05('0x5'));var logger=require(_0x9c05('0x6'))('rpc');var config=require(_0x9c05('0x7'));var jayson=require(_0x9c05('0x8'));var client=jayson[_0x9c05('0x9')][_0x9c05('0xa')]({'port':0x232a});config[_0x9c05('0xb')]=_[_0x9c05('0xc')](config[_0x9c05('0xb')],{'host':_0x9c05('0xd'),'port':0x18eb});var socket=require(_0x9c05('0xe'))(new Redis(config[_0x9c05('0xb')]));require(_0x9c05('0xf'))['register'](socket);function respondWithRpcPromise(_0x130e02,_0x40e40d,_0x2297d4){return new BPromise(function(_0x2c1da3,_0x4bc70d){return client['request'](_0x130e02,_0x2297d4)[_0x9c05('0x10')](function(_0x5f30cc){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x40e40d,_0x9c05('0x11'));logger[_0x9c05('0x12')](_0x9c05('0x13'),_0x40e40d,_0x9c05('0x11'),JSON['stringify'](_0x5f30cc));if(_0x5f30cc[_0x9c05('0x14')]){if(_0x5f30cc[_0x9c05('0x14')][_0x9c05('0x15')]===0x1f4){logger[_0x9c05('0x14')](_0x9c05('0x16'),_0x40e40d,_0x5f30cc[_0x9c05('0x14')]['message']);return _0x4bc70d(_0x5f30cc[_0x9c05('0x14')][_0x9c05('0x17')]);}logger[_0x9c05('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x40e40d,_0x5f30cc['error'][_0x9c05('0x17')]);return _0x2c1da3(_0x5f30cc['error'][_0x9c05('0x17')]);}else{logger['info'](_0x9c05('0x16'),_0x40e40d,_0x9c05('0x11'));_0x2c1da3(_0x5f30cc['result'][_0x9c05('0x17')]);}})['catch'](function(_0x1dcfb6){logger[_0x9c05('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x40e40d,_0x1dcfb6);_0x4bc70d(_0x1dcfb6);});});}exports[_0x9c05('0x18')]=function(_0x58ce69){var _0x1536fc=this;return new Promise(function(_0x57265e,_0x3463f2){return db[_0x9c05('0x19')][_0x9c05('0x1a')](_0x58ce69['body'],{'raw':_0x58ce69['options']?_0x58ce69[_0x9c05('0x1b')][_0x9c05('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58ce69[_0x9c05('0x1b')]?_0x58ce69[_0x9c05('0x1b')]['where']||null:null,'attributes':_0x58ce69[_0x9c05('0x1b')]?_0x58ce69[_0x9c05('0x1b')]['attributes']||null:null,'limit':_0x58ce69['options']?_0x58ce69[_0x9c05('0x1b')][_0x9c05('0x1d')]||null:null})[_0x9c05('0x10')](function(_0x1fccd8){logger[_0x9c05('0x1e')](_0x9c05('0x18'),_0x58ce69);logger[_0x9c05('0x12')](_0x9c05('0x18'),_0x58ce69,JSON[_0x9c05('0x1f')](_0x1fccd8));_0x57265e(_0x1fccd8);})[_0x9c05('0x20')](function(_0x40b174){logger[_0x9c05('0x14')]('UpdateFaxInteraction',_0x40b174[_0x9c05('0x17')],_0x58ce69);_0x3463f2(_0x1536fc[_0x9c05('0x14')](0x1f4,_0x40b174[_0x9c05('0x17')]));});});};exports[_0x9c05('0x21')]=function(_0x3082c3){return new Promise(function(_0x2a99d8,_0x4421b3){return db[_0x9c05('0x19')][_0x9c05('0x22')]({'where':_0x3082c3[_0x9c05('0x1b')]?_0x3082c3[_0x9c05('0x1b')]['where']||null:null})[_0x9c05('0x10')](function(_0x2ff5c1){if(_0x2ff5c1){return _0x2ff5c1[_0x9c05('0x23')](_0x3082c3[_0x9c05('0x24')][_0x9c05('0x25')],_[_0x9c05('0x26')](_0x3082c3[_0x9c05('0x24')],[_0x9c05('0x25'),'id'])||{});}})[_0x9c05('0x27')](function(_0x3a60b5){logger[_0x9c05('0x1e')](_0x9c05('0x28'),_0x3082c3);logger['debug']('AddTags',_0x3082c3,JSON[_0x9c05('0x1f')](_0x3a60b5));_0x2a99d8(_0x3a60b5);})[_0x9c05('0x20')](function(_0x2ae2f1){logger[_0x9c05('0x14')](_0x9c05('0x28'),_0x2ae2f1[_0x9c05('0x17')],_0x3082c3);_0x4421b3(_this['error'](0x1f4,_0x2ae2f1[_0x9c05('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index f164adf..0fa3cd9 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 _0x4c12=['length','faxInteraction:','save','remove','update','emit','removeListener'];(function(_0x114356,_0x561b7a){var _0xd46fa7=function(_0x4b93ef){while(--_0x4b93ef){_0x114356['push'](_0x114356['shift']());}};_0xd46fa7(++_0x561b7a);}(_0x4c12,0x79));var _0x24c1=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x4c12[_0x28aea5];return _0x6a55f9;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x24c1('0x0'),_0x24c1('0x1'),_0x24c1('0x2')];function createListener(_0x4dad00,_0x55481b){return function(_0x295ff1){_0x55481b[_0x24c1('0x3')](_0x4dad00,_0x295ff1);};}function removeListener(_0x2e1085,_0x5c2132){return function(){FaxInteractionEvents[_0x24c1('0x4')](_0x2e1085,_0x5c2132);};}exports['register']=function(_0x24b166){for(var _0x20adf1=0x0,_0x38f761=events[_0x24c1('0x5')];_0x20adf1<_0x38f761;_0x20adf1++){var _0x624b42=events[_0x20adf1];var _0x4da8bc=createListener(_0x24c1('0x6')+_0x624b42,_0x24b166);FaxInteractionEvents['on'](_0x624b42,_0x4da8bc);}}; \ No newline at end of file +var _0x3f41=['removeListener','faxInteraction:','./faxInteraction.events','save','remove','emit'];(function(_0x1f24d1,_0x519091){var _0x171019=function(_0x60d560){while(--_0x60d560){_0x1f24d1['push'](_0x1f24d1['shift']());}};_0x171019(++_0x519091);}(_0x3f41,0x9e));var _0x13f4=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x3f41[_0xbf8ebe];return _0x1e25e8;};'use strict';var FaxInteractionEvents=require(_0x13f4('0x0'));var events=[_0x13f4('0x1'),_0x13f4('0x2'),'update'];function createListener(_0x3bf0b4,_0x2d8631){return function(_0x4a2069){_0x2d8631[_0x13f4('0x3')](_0x3bf0b4,_0x4a2069);};}function removeListener(_0x9cefb3,_0x10b130){return function(){FaxInteractionEvents[_0x13f4('0x4')](_0x9cefb3,_0x10b130);};}exports['register']=function(_0x15d3ac){for(var _0xf2464=0x0,_0x87a258=events['length'];_0xf2464<_0x87a258;_0xf2464++){var _0x4cdfe4=events[_0xf2464];var _0x583dc8=createListener(_0x13f4('0x5')+_0x4cdfe4,_0x15d3ac);FaxInteractionEvents['on'](_0x4cdfe4,_0x583dc8);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index da7caa0..5e00d3e 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 _0x4156=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','download','create','post','addMessage','/:id/tags','tracked','fax','put','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','path'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x4156,0x1eb));var _0x6415=function(_0x112bcc,_0x410b59){_0x112bcc=_0x112bcc-0x0;var _0x21e1e7=_0x4156[_0x112bcc];return _0x21e1e7;};'use strict';var multer=require(_0x6415('0x0'));var util=require('util');var path=require(_0x6415('0x1'));var timeout=require('connect-timeout');var express=require(_0x6415('0x2'));var router=express[_0x6415('0x3')]();var fs_extra=require(_0x6415('0x4'));var auth=require(_0x6415('0x5'));var interaction=require(_0x6415('0x6'));var config=require(_0x6415('0x7'));var controller=require('./faxInteraction.controller');router[_0x6415('0x8')]('/',auth[_0x6415('0x9')](),controller[_0x6415('0xa')]);router[_0x6415('0x8')](_0x6415('0xb'),auth[_0x6415('0x9')](),controller['describe']);router[_0x6415('0x8')]('/:id',auth[_0x6415('0x9')](),controller[_0x6415('0xc')]);router[_0x6415('0x8')]('/:id/messages',auth[_0x6415('0x9')](),controller['getMessages']);router['get']('/:id/download',auth[_0x6415('0x9')](),controller[_0x6415('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6415('0xe')]);router[_0x6415('0xf')]('/:id/messages',auth[_0x6415('0x9')](),controller[_0x6415('0x10')]);router[_0x6415('0xf')](_0x6415('0x11'),auth['isAuthenticated'](),interaction[_0x6415('0x12')](_0x6415('0x13'),'faxinteraction:addtags'),controller['addTags']);router[_0x6415('0x14')](_0x6415('0x15'),auth[_0x6415('0x9')](),interaction['tracked']('fax',_0x6415('0x16')),controller[_0x6415('0x17')]);router[_0x6415('0x18')](_0x6415('0x15'),auth['isAuthenticated'](),interaction[_0x6415('0x12')](_0x6415('0x13'),_0x6415('0x19')),controller[_0x6415('0x1a')]);router[_0x6415('0x18')](_0x6415('0x11'),auth[_0x6415('0x9')](),controller[_0x6415('0x1b')]);module[_0x6415('0x1c')]=router; \ No newline at end of file +var _0x30e9=['post','create','/:id/messages','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','/:id/download','download'];(function(_0x1ea729,_0x3552bb){var _0x3576c4=function(_0xb12275){while(--_0xb12275){_0x1ea729['push'](_0x1ea729['shift']());}};_0x3576c4(++_0x3552bb);}(_0x30e9,0x158));var _0x930e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x30e9[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x930e('0x0'));var util=require(_0x930e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x930e('0x2'));var router=express[_0x930e('0x3')]();var fs_extra=require(_0x930e('0x4'));var auth=require(_0x930e('0x5'));var interaction=require(_0x930e('0x6'));var config=require(_0x930e('0x7'));var controller=require(_0x930e('0x8'));router[_0x930e('0x9')]('/',auth[_0x930e('0xa')](),controller[_0x930e('0xb')]);router[_0x930e('0x9')](_0x930e('0xc'),auth[_0x930e('0xa')](),controller[_0x930e('0xd')]);router[_0x930e('0x9')](_0x930e('0xe'),auth[_0x930e('0xa')](),controller[_0x930e('0xf')]);router['get']('/:id/messages',auth[_0x930e('0xa')](),controller[_0x930e('0x10')]);router[_0x930e('0x9')](_0x930e('0x11'),auth[_0x930e('0xa')](),controller[_0x930e('0x12')]);router[_0x930e('0x13')]('/',auth[_0x930e('0xa')](),controller[_0x930e('0x14')]);router[_0x930e('0x13')](_0x930e('0x15'),auth[_0x930e('0xa')](),controller['addMessage']);router['post'](_0x930e('0x16'),auth['isAuthenticated'](),interaction[_0x930e('0x17')]('fax',_0x930e('0x18')),controller[_0x930e('0x19')]);router['put']('/:id',auth[_0x930e('0xa')](),interaction['tracked'](_0x930e('0x1a'),_0x930e('0x1b')),controller[_0x930e('0x1c')]);router['delete'](_0x930e('0xe'),auth[_0x930e('0xa')](),interaction[_0x930e('0x17')](_0x930e('0x1a'),_0x930e('0x1d')),controller[_0x930e('0x1e')]);router[_0x930e('0x1f')](_0x930e('0x16'),auth[_0x930e('0xa')](),controller['removeTags']);module[_0x930e('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 3267c85..78da86b 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 _0x0faf=['medium','BOOLEAN','ENUM','out','DATE','sequelize','TEXT'];(function(_0x33587f,_0x274343){var _0x4b089f=function(_0x38a318){while(--_0x38a318){_0x33587f['push'](_0x33587f['shift']());}};_0x4b089f(++_0x274343);}(_0x0faf,0x132));var _0xf0fa=function(_0x225b4e,_0x179ee4){_0x225b4e=_0x225b4e-0x0;var _0x24237a=_0x0faf[_0x225b4e];return _0x24237a;};'use strict';var Sequelize=require(_0xf0fa('0x0'));module['exports']={'body':{'type':Sequelize[_0xf0fa('0x1')](_0xf0fa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf0fa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf0fa('0x4')]('in',_0xf0fa('0x5')),'defaultValue':_0xf0fa('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xf0fa('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xf0fa('0x6')]}}; \ No newline at end of file +var _0x383d=['medium','BOOLEAN','out','DATE','TEXT'];(function(_0x23ad48,_0x104b01){var _0x199a20=function(_0x4805d0){while(--_0x4805d0){_0x23ad48['push'](_0x23ad48['shift']());}};_0x199a20(++_0x104b01);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd383('0x0')](_0xd383('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xd383('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd383('0x3')),'defaultValue':_0xd383('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd383('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd383('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 1f5374a..417da1f 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 _0xdef6=['api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','FaxMessage','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','rawAttributes','find','body','../../config/logger','fax-interactions','accept','fax','format','UserId','user','FaxInteraction','update','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','get','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x133b05,_0xe1b399){var _0x2dc51a=function(_0x15c480){while(--_0x15c480){_0x133b05['push'](_0x133b05['shift']());}};_0x2dc51a(++_0xe1b399);}(_0xdef6,0x7c));var _0x6def=function(_0x137815,_0x78dd4b){_0x137815=_0x137815-0x0;var _0x29ded1=_0xdef6[_0x137815];return _0x29ded1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6def('0x0'));var zipdir=require(_0x6def('0x1'));var jsonpatch=require(_0x6def('0x2'));var rp=require(_0x6def('0x3'));var moment=require('moment');var BPromise=require(_0x6def('0x4'));var Mustache=require(_0x6def('0x5'));var util=require('util');var path=require(_0x6def('0x6'));var sox=require(_0x6def('0x7'));var csv=require('to-csv');var ejs=require(_0x6def('0x8'));var fs=require('fs');var fs_extra=require(_0x6def('0x9'));var _=require(_0x6def('0xa'));var squel=require(_0x6def('0xb'));var crypto=require('crypto');var jsforce=require(_0x6def('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6def('0xd'));var querystring=require(_0x6def('0xe'));var Papa=require('papaparse');var Redis=require(_0x6def('0xf'));var authService=require(_0x6def('0x10'));var qs=require(_0x6def('0x11'));var as=require(_0x6def('0x12'));var hardwareService=require(_0x6def('0x13'));var logger=require('../../config/logger')(_0x6def('0x14'));var utils=require('../../config/utils');var config=require(_0x6def('0x15'));var licenseUtil=require(_0x6def('0x16'));var db=require(_0x6def('0x17'))['db'];config[_0x6def('0x18')]=_[_0x6def('0x19')](config[_0x6def('0x18')],{'host':_0x6def('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6def('0x18')]));require('./faxMessage.socket')[_0x6def('0x1b')](socket);var jayson=require(_0x6def('0x1c'));var client=jayson[_0x6def('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6def('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x121677,_0x449feb,_0x59b12e,_0x237d91){return new BPromise(function(_0x4399c4,_0x1bd02e){var _0x1581f3=_0x237d91||client;return _0x1581f3[_0x6def('0x1f')](_0x121677,_0x59b12e)[_0x6def('0x20')](function(_0x105a70){logger['info'](_0x6def('0x21'),_0x449feb,_0x6def('0x22'));logger[_0x6def('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x449feb,_0x6def('0x22'),JSON[_0x6def('0x24')](_0x105a70));if(_0x105a70['error']){if(_0x105a70[_0x6def('0x25')][_0x6def('0x26')]===0x1f4){logger['error'](_0x6def('0x21'),_0x449feb,_0x105a70['error'][_0x6def('0x27')]);return _0x1bd02e(_0x105a70[_0x6def('0x25')][_0x6def('0x27')]);}logger[_0x6def('0x25')]('FaxMessage,\x20%s,\x20%s',_0x449feb,_0x105a70['error'][_0x6def('0x27')]);return _0x4399c4(_0x105a70[_0x6def('0x25')]['message']);}else{logger[_0x6def('0x28')](_0x6def('0x21'),_0x449feb,'request\x20sent');_0x4399c4(_0x105a70[_0x6def('0x29')][_0x6def('0x27')]);}})[_0x6def('0x2a')](function(_0xafdfbc){logger[_0x6def('0x25')](_0x6def('0x21'),_0x449feb,_0xafdfbc);_0x1bd02e(_0xafdfbc);});});}function respondWithStatusCode(_0x34c8a4,_0x42669a){_0x42669a=_0x42669a||0xcc;return function(_0x2390a4){if(_0x2390a4){return _0x34c8a4[_0x6def('0x2b')](_0x42669a);}return _0x34c8a4[_0x6def('0x2c')](_0x42669a)[_0x6def('0x2d')]();};}function respondWithResult(_0x5f1f34,_0x4d98ce){_0x4d98ce=_0x4d98ce||0xc8;return function(_0x3da1c4){if(_0x3da1c4){return _0x5f1f34['status'](_0x4d98ce)[_0x6def('0x2e')](_0x3da1c4);}};}function respondWithFilteredResult(_0x25f510,_0x52449f){return function(_0x562b73){if(_0x562b73){var _0x1e8c80=typeof _0x52449f[_0x6def('0x2f')]===_0x6def('0x30')&&typeof _0x52449f[_0x6def('0x31')]===_0x6def('0x30');var _0x382d91=_0x562b73[_0x6def('0x32')];var _0x265d3d=_0x1e8c80?0x0:_0x52449f[_0x6def('0x2f')];var _0x4c6864=_0x1e8c80?_0x562b73[_0x6def('0x32')]:_0x52449f['offset']+_0x52449f[_0x6def('0x31')];var _0x2c31f4;if(_0x4c6864>=_0x382d91){_0x4c6864=_0x382d91;_0x2c31f4=0xc8;}else{_0x2c31f4=0xce;}_0x25f510[_0x6def('0x2c')](_0x2c31f4);return _0x25f510[_0x6def('0x33')](_0x6def('0x34'),_0x265d3d+'-'+_0x4c6864+'/'+_0x382d91)[_0x6def('0x2e')](_0x562b73);}return null;};}function patchUpdates(_0x3dc4ec){return function(_0x4549ba){try{jsonpatch[_0x6def('0x35')](_0x4549ba,_0x3dc4ec,!![]);}catch(_0x523cd8){return BPromise[_0x6def('0x36')](_0x523cd8);}return _0x4549ba[_0x6def('0x37')]();};}function saveUpdates(_0x930ac1,_0x1e5361){return function(_0x2990db){if(_0x2990db){return _0x2990db['update'](_0x930ac1)[_0x6def('0x20')](function(_0x1b2c78){return _0x1b2c78;});}return null;};}function removeEntity(_0x36d5c6,_0x25d431){return function(_0x119c8d){if(_0x119c8d){return _0x119c8d[_0x6def('0x38')]()['then'](function(){_0x36d5c6[_0x6def('0x2c')](0xcc)[_0x6def('0x2d')]();});}};}function handleEntityNotFound(_0x40386b,_0x8f7f42){return function(_0x3df7e7){if(!_0x3df7e7){_0x40386b['sendStatus'](0x194);}return _0x3df7e7;};}function handleError(_0x288b27,_0x305a84){_0x305a84=_0x305a84||0x1f4;return function(_0x3c4cdd){logger[_0x6def('0x25')](_0x3c4cdd[_0x6def('0x39')]);if(_0x3c4cdd[_0x6def('0x3a')]){delete _0x3c4cdd['name'];}_0x288b27['status'](_0x305a84)[_0x6def('0x3b')](_0x3c4cdd);};}exports['index']=function(_0xe01abd,_0x2bb467){var _0x58ee4e={},_0xa182ef={},_0x2342b5={'count':0x0,'rows':[]};var _0x235b8a=_['map'](db[_0x6def('0x3c')]['rawAttributes'],function(_0xb37eab){return{'name':_0xb37eab['fieldName'],'type':_0xb37eab[_0x6def('0x3d')][_0x6def('0x3e')]};});_0xa182ef[_0x6def('0x3f')]=_[_0x6def('0x40')](_0x235b8a,_0x6def('0x3a'));_0xa182ef['query']=_[_0x6def('0x41')](_0xe01abd[_0x6def('0x42')]);_0xa182ef[_0x6def('0x43')]=_[_0x6def('0x44')](_0xa182ef[_0x6def('0x3f')],_0xa182ef[_0x6def('0x42')]);_0x58ee4e['attributes']=_[_0x6def('0x44')](_0xa182ef[_0x6def('0x3f')],qs[_0x6def('0x45')](_0xe01abd[_0x6def('0x42')][_0x6def('0x45')]));_0x58ee4e[_0x6def('0x46')]=_0x58ee4e[_0x6def('0x46')][_0x6def('0x47')]?_0x58ee4e[_0x6def('0x46')]:_0xa182ef['model'];if(!_0xe01abd['query'][_0x6def('0x48')](_0x6def('0x49'))){_0x58ee4e[_0x6def('0x31')]=qs[_0x6def('0x31')](_0xe01abd[_0x6def('0x42')][_0x6def('0x31')]);_0x58ee4e[_0x6def('0x2f')]=qs[_0x6def('0x2f')](_0xe01abd[_0x6def('0x42')][_0x6def('0x2f')]);}_0x58ee4e[_0x6def('0x4a')]=qs[_0x6def('0x4b')](_0xe01abd[_0x6def('0x42')][_0x6def('0x4b')]);_0x58ee4e[_0x6def('0x4c')]=qs['filters'](_['pick'](_0xe01abd[_0x6def('0x42')],_0xa182ef['filters']),_0x235b8a);if(_0xe01abd[_0x6def('0x42')]['filter']){_0x58ee4e['where']=_[_0x6def('0x4d')](_0x58ee4e[_0x6def('0x4c')],{'$or':_['map'](_0x235b8a,function(_0x94ee82){if(_0x94ee82[_0x6def('0x3d')]!==_0x6def('0x4e')){var _0x1ed23d={};_0x1ed23d[_0x94ee82[_0x6def('0x3a')]]={'$like':'%'+_0xe01abd['query'][_0x6def('0x4f')]+'%'};return _0x1ed23d;}})});}_0x58ee4e=_[_0x6def('0x4d')]({},_0x58ee4e,_0xe01abd[_0x6def('0x50')]);var _0x50f604={'where':_0x58ee4e['where']};return db[_0x6def('0x3c')]['count'](_0x50f604)[_0x6def('0x20')](function(_0x32e495){_0x2342b5['count']=_0x32e495;if(_0xe01abd[_0x6def('0x42')][_0x6def('0x51')]){_0x58ee4e[_0x6def('0x52')]=[{'all':!![]}];}return db[_0x6def('0x3c')][_0x6def('0x53')](_0x58ee4e);})[_0x6def('0x20')](function(_0x4d22a9){_0x2342b5[_0x6def('0x54')]=_0x4d22a9;return _0x2342b5;})[_0x6def('0x20')](respondWithFilteredResult(_0x2bb467,_0x58ee4e))['catch'](handleError(_0x2bb467,null));};exports['show']=function(_0x1b7b0d,_0x252bc6){var _0x658b26={'raw':!![],'where':{'id':_0x1b7b0d[_0x6def('0x55')]['id']}},_0x1bc12b={};_0x1bc12b[_0x6def('0x3f')]=_['keys'](db[_0x6def('0x3c')][_0x6def('0x56')]);_0x1bc12b[_0x6def('0x42')]=_[_0x6def('0x41')](_0x1b7b0d[_0x6def('0x42')]);_0x1bc12b['filters']=_['intersection'](_0x1bc12b[_0x6def('0x3f')],_0x1bc12b['query']);_0x658b26[_0x6def('0x46')]=_[_0x6def('0x44')](_0x1bc12b[_0x6def('0x3f')],qs[_0x6def('0x45')](_0x1b7b0d[_0x6def('0x42')][_0x6def('0x45')]));_0x658b26[_0x6def('0x46')]=_0x658b26[_0x6def('0x46')][_0x6def('0x47')]?_0x658b26[_0x6def('0x46')]:_0x1bc12b[_0x6def('0x3f')];if(_0x1b7b0d[_0x6def('0x42')][_0x6def('0x51')]){_0x658b26[_0x6def('0x52')]=[{'all':!![]}];}_0x658b26=_[_0x6def('0x4d')]({},_0x658b26,_0x1b7b0d[_0x6def('0x50')]);return db['FaxMessage'][_0x6def('0x57')](_0x658b26)[_0x6def('0x20')](handleEntityNotFound(_0x252bc6,null))[_0x6def('0x20')](respondWithResult(_0x252bc6,null))[_0x6def('0x2a')](handleError(_0x252bc6,null));};exports['update']=function(_0x14749a,_0x2f1399){if(_0x14749a[_0x6def('0x58')]['id']){delete _0x14749a[_0x6def('0x58')]['id'];}return db[_0x6def('0x3c')][_0x6def('0x57')]({'where':{'id':_0x14749a[_0x6def('0x55')]['id']}})[_0x6def('0x20')](handleEntityNotFound(_0x2f1399,null))[_0x6def('0x20')](saveUpdates(_0x14749a[_0x6def('0x58')],null))['then'](respondWithResult(_0x2f1399,null))['catch'](handleError(_0x2f1399,null));};exports['destroy']=function(_0x50fdc2,_0x436f40){return db[_0x6def('0x3c')][_0x6def('0x57')]({'where':{'id':_0x50fdc2[_0x6def('0x55')]['id']}})[_0x6def('0x20')](handleEntityNotFound(_0x436f40,null))['then'](removeEntity(_0x436f40,null))['catch'](handleError(_0x436f40,null));};exports['describe']=function(_0x52f518,_0x10a8f2){return db[_0x6def('0x3c')]['describe']()[_0x6def('0x20')](respondWithResult(_0x10a8f2,null))[_0x6def('0x2a')](handleError(_0x10a8f2,null));};var interaction_log=require(_0x6def('0x59'))(_0x6def('0x5a'));exports[_0x6def('0x5b')]=function(_0x137727,_0x2cd9ec,_0x3098e5){var _0x3f8583={'agent':{},'channel':_0x6def('0x5c')};if(_0x137727[_0x6def('0x58')]['id']){delete _0x137727[_0x6def('0x58')]['id'];}_0x137727[_0x6def('0x58')]['read']=!![];_0x137727[_0x6def('0x58')]['readAt']=moment()[_0x6def('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x137727[_0x6def('0x58')][_0x6def('0x5e')]=_0x137727[_0x6def('0x58')]['UserId']||_0x137727[_0x6def('0x5f')]['id'];_0x3f8583['agent']['id']=_0x137727[_0x6def('0x58')]['UserId'];return db[_0x6def('0x3c')][_0x6def('0x57')]({'where':{'id':_0x137727[_0x6def('0x55')]['id'],'UserId':null}})[_0x6def('0x20')](handleEntityNotFound(_0x2cd9ec,null))['then'](saveUpdates(_0x137727['body'],null))['then'](function(_0x15a477){if(_0x15a477){_0x3f8583['message']=_0x15a477['get']({'plain':!![]});return db[_0x6def('0x60')][_0x6def('0x57')]({'where':{'id':_0x15a477['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2cd9ec,null))[_0x6def('0x20')](function(_0xdf3df8){if(_0xdf3df8){return _0xdf3df8[_0x6def('0x61')]({'UserId':_0x137727[_0x6def('0x58')][_0x6def('0x5e')],'read1stAt':_[_0x6def('0x62')](_0xdf3df8[_0x6def('0x63')])?moment()[_0x6def('0x5d')](_0x6def('0x64')):undefined});}return null;})['then'](function(_0x330116){if(_0x330116){_0x3f8583[_0x6def('0x65')]=_0x330116['get']({'plain':!![]});interaction_log['info'](_0x6def('0x66'),_0x137727[_0x6def('0x5f')]['id'],_0x137727[_0x6def('0x5f')][_0x6def('0x3a')],_0x137727['user']['role'],_0x3f8583[_0x6def('0x65')]['id'],_0x137727[_0x6def('0x58')]?JSON[_0x6def('0x24')](_0x137727[_0x6def('0x58')]):_0x6def('0x67'));return respondWithRpcPromise(_0x6def('0x68'),'acceptMessage',_0x3f8583);}return null;})[_0x6def('0x20')](function(_0x298b8c){var _0x811764=_0x6def('0x69')+_0x298b8c[_0x6def('0x27')][_0x6def('0x6a')];return db[_0x6def('0x6b')][_0x6def('0x42')](_0x811764,{'type':db[_0x6def('0x6c')][_0x6def('0x6d')][_0x6def('0x6e')],'raw':!![]})['then'](function(_0x19c74d){return _0x19c74d;});})[_0x6def('0x20')](function(_0x4ff2df){if(_0x4ff2df){_0x3f8583[_0x6def('0x27')][_0x6def('0x6f')]=_0x4ff2df[0x0];if(!_0x137727['body'][_0x6def('0x5e')])return;return db[_0x6def('0x70')][_0x6def('0x57')]({'where':{'id':_0x137727[_0x6def('0x58')][_0x6def('0x5e')],'role':_0x6def('0x71')},'attributes':['id',_0x6def('0x3a'),_0x6def('0x72'),_0x6def('0x73'),_0x6def('0x74')],'raw':!![]});}return null;})['then'](function(_0x46a6fc){if(!_0x46a6fc)return null;_0x3f8583['message'][_0x6def('0x71')]=_0x46a6fc;return _0x3f8583;})[_0x6def('0x20')](function(_0x1f9563){if(_0x1f9563){if(_0x137727[_0x6def('0x58')]['manual']){_0x3f8583[_0x6def('0x27')][_0x6def('0x75')]=util[_0x6def('0x5d')]('SIP/%s',_0x137727[_0x6def('0x5f')][_0x6def('0x3a')]);_0x3f8583[_0x6def('0x27')][_0x6def('0x76')]=_0x3f8583[_0x6def('0x76')];_0x3f8583['message'][_0x6def('0x77')]=_0x3f8583[_0x6def('0x76')];_0x3f8583[_0x6def('0x27')][_0x6def('0x78')]='accept';return respondWithRpcPromise(_0x6def('0x79'),_0x6def('0x79'),{'event':_0x6def('0x7a'),'message':_0x3f8583[_0x6def('0x27')]},client9002)[_0x6def('0x20')](function(){return _0x3f8583;});}return _0x3f8583;}return null;})[_0x6def('0x20')](respondWithResult(_0x2cd9ec,null))[_0x6def('0x2a')](handleError(_0x2cd9ec,null));};var interaction_log=require(_0x6def('0x59'))('fax-interactions');exports[_0x6def('0x36')]=function(_0x7be07d,_0x5465b0,_0x16dd4e){var _0x3ca159={'agent':{},'channel':_0x6def('0x5c')};if(_0x7be07d['body']['id']){delete _0x7be07d[_0x6def('0x58')]['id'];}_0x7be07d[_0x6def('0x58')][_0x6def('0x5e')]=_0x7be07d[_0x6def('0x58')][_0x6def('0x5e')]||_0x7be07d['user']['id'];_0x3ca159[_0x6def('0x71')]['id']=_0x7be07d[_0x6def('0x58')][_0x6def('0x5e')];return db[_0x6def('0x3c')][_0x6def('0x57')]({'where':{'id':_0x7be07d[_0x6def('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5465b0,null))['then'](function(_0x4c0f73){if(_0x4c0f73){_0x3ca159[_0x6def('0x27')]=_0x4c0f73[_0x6def('0x7b')]({'plain':!![]});return db['FaxInteraction'][_0x6def('0x57')]({'where':{'id':_0x4c0f73[_0x6def('0x7c')]}});}return null;})[_0x6def('0x20')](handleEntityNotFound(_0x5465b0,null))['then'](function(_0x3c5079){if(_0x3c5079){_0x3ca159['interaction']=_0x3c5079[_0x6def('0x7b')]({'plain':!![]});interaction_log[_0x6def('0x28')](_0x6def('0x7d'),_0x7be07d['user']['id'],_0x7be07d['user'][_0x6def('0x3a')],_0x7be07d['user'][_0x6def('0x7e')],_0x3ca159[_0x6def('0x65')]['id'],_0x7be07d[_0x6def('0x58')]?JSON[_0x6def('0x24')](_0x7be07d[_0x6def('0x58')]):_0x6def('0x67'));return respondWithRpcPromise(_0x6def('0x7f'),_0x6def('0x80'),_0x3ca159);}return null;})[_0x6def('0x20')](function(_0x1d802d){var _0x3d1307=_0x6def('0x69')+_0x1d802d[_0x6def('0x27')][_0x6def('0x6a')];return db[_0x6def('0x6b')][_0x6def('0x42')](_0x3d1307,{'type':db[_0x6def('0x6c')][_0x6def('0x6d')][_0x6def('0x6e')],'raw':!![]})[_0x6def('0x20')](function(_0x20c481){return _0x20c481;});})['then'](function(_0x45d7f2){if(_0x45d7f2){_0x3ca159[_0x6def('0x27')][_0x6def('0x6f')]=_0x45d7f2[0x0];if(!_0x7be07d[_0x6def('0x58')][_0x6def('0x5e')])return;return db[_0x6def('0x70')][_0x6def('0x57')]({'where':{'id':_0x7be07d[_0x6def('0x58')][_0x6def('0x5e')],'role':_0x6def('0x71')},'attributes':['id','name','fullname',_0x6def('0x73'),'internal'],'raw':!![]});}return null;})[_0x6def('0x20')](function(_0x39c640){if(!_0x39c640)return null;_0x3ca159[_0x6def('0x27')][_0x6def('0x71')]=_0x39c640;return _0x3ca159;})[_0x6def('0x20')](function(_0x4caf20){if(_0x4caf20){_0x4caf20[_0x6def('0x27')][_0x6def('0x75')]=util[_0x6def('0x5d')](_0x6def('0x81'),_0x7be07d[_0x6def('0x5f')][_0x6def('0x3a')]);_0x4caf20[_0x6def('0x27')][_0x6def('0x76')]=_0x3ca159[_0x6def('0x76')];_0x4caf20['message'][_0x6def('0x77')]=_0x3ca159['channel'];_0x4caf20[_0x6def('0x27')][_0x6def('0x78')]=_0x6def('0x36');respondWithRpcPromise(_0x6def('0x79'),_0x6def('0x79'),{'event':'rejectmessage','message':_0x4caf20[_0x6def('0x27')]},client9002);return _0x3ca159;}return null;})['then'](respondWithResult(_0x5465b0,null))[_0x6def('0x2a')](handleError(_0x5465b0,null));};exports['create']=function(_0x2b72e5,_0x10cd66){var _0x18c74e;return db[_0x6def('0x3c')][_0x6def('0x82')](_0x2b72e5[_0x6def('0x58')],{})[_0x6def('0x20')](function(_0x491b9e){_0x18c74e=_0x491b9e;return db[_0x6def('0x83')][_0x6def('0x84')]({'where':{'id':_0x18c74e[_0x6def('0x6a')]}});})[_0x6def('0x20')](function(_0x26ffc4){if(_[_0x6def('0x62')](_0x26ffc4)){return;}else{_0x18c74e[_0x6def('0x5c')]=_0x26ffc4[_0x6def('0x5c')];return db[_0x6def('0x85')][_0x6def('0x84')]({'where':{'id':_0x18c74e[_0x6def('0x86')]}});}})[_0x6def('0x20')](function(_0x175b9e){return respondWithRpcPromise(_0x6def('0x87'),'SendFax',{'FaxAccountId':_[_0x6def('0x62')](_0x2b72e5[_0x6def('0x58')])?undefined:_0x2b72e5[_0x6def('0x58')][_0x6def('0x88')],'path':_[_0x6def('0x62')](_0x175b9e)?undefined:util[_0x6def('0x5d')](_0x6def('0x89'),_0x175b9e[_0x6def('0x8a')]),'fax':_[_0x6def('0x62')](_0x18c74e[_0x6def('0x5c')])?undefined:_0x18c74e[_0x6def('0x5c')],'AttachmentId':_0x18c74e['AttachmentId']},client9002);})[_0x6def('0x20')](respondWithResult(_0x10cd66,0xc9))[_0x6def('0x2a')](handleError(_0x10cd66,null));};exports[_0x6def('0x8b')]=function(_0xab46ef,_0x31d050){var _0x4c8fef=path[_0x6def('0x8c')](config[_0x6def('0x8d')],_0x6def('0x8e'),_0x6def('0x8f'),'attachments');return db[_0x6def('0x3c')]['find']({'where':{'id':_0xab46ef[_0x6def('0x55')]['id']},'include':[{'model':db[_0x6def('0x85')],'as':_0x6def('0x85')}]})[_0x6def('0x20')](handleEntityNotFound(_0x31d050,null))[_0x6def('0x20')](function(_0x44b579){if(_0x44b579){return _0x31d050['download'](path[_0x6def('0x8c')](_0x4c8fef,_0x44b579['Attachment'][_0x6def('0x8a')]));}})[_0x6def('0x2a')](handleError(_0x31d050,null));}; \ No newline at end of file +var _0x29e2=['destroy','status','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','include','body','find','params','describe','fax-interactions','fax','read','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','agent','email','internal','manual','interface','event','accept','acceptmessage','RejectMessage','SELECT','SIP/%s','channel','motionChannel','EventManager','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','attachments','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x48849d,_0x174b98){var _0x424fe8=function(_0x1fc561){while(--_0x1fc561){_0x48849d['push'](_0x48849d['shift']());}};_0x424fe8(++_0x174b98);}(_0x29e2,0x1f0));var _0x229e=function(_0x394cc7,_0x34a8a2){_0x394cc7=_0x394cc7-0x0;var _0x15f617=_0x29e2[_0x394cc7];return _0x15f617;};'use strict';var emlformat=require(_0x229e('0x0'));var rimraf=require(_0x229e('0x1'));var zipdir=require(_0x229e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x229e('0x3'));var moment=require('moment');var BPromise=require(_0x229e('0x4'));var Mustache=require(_0x229e('0x5'));var util=require(_0x229e('0x6'));var path=require('path');var sox=require(_0x229e('0x7'));var csv=require(_0x229e('0x8'));var ejs=require(_0x229e('0x9'));var fs=require('fs');var fs_extra=require(_0x229e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x229e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x229e('0xc'));var toCsv=require(_0x229e('0x8'));var querystring=require('querystring');var Papa=require(_0x229e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x229e('0xe'));var logger=require(_0x229e('0xf'))('api');var utils=require(_0x229e('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x229e('0x11'));var db=require('../../mysqldb')['db'];config[_0x229e('0x12')]=_[_0x229e('0x13')](config['redis'],{'host':_0x229e('0x14'),'port':0x18eb});var socket=require(_0x229e('0x15'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x229e('0x16')](socket);var jayson=require(_0x229e('0x17'));var client=jayson[_0x229e('0x18')][_0x229e('0x19')]({'port':0x232c});var client9002=jayson[_0x229e('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6af2b,_0x1c34d1,_0x28be6d,_0x3b1920){return new BPromise(function(_0x18d737,_0x2189c1){var _0x4f4a95=_0x3b1920||client;return _0x4f4a95[_0x229e('0x1a')](_0xe6af2b,_0x28be6d)['then'](function(_0x4480db){logger[_0x229e('0x1b')](_0x229e('0x1c'),_0x1c34d1,_0x229e('0x1d'));logger[_0x229e('0x1e')](_0x229e('0x1f'),_0x1c34d1,_0x229e('0x1d'),JSON[_0x229e('0x20')](_0x4480db));if(_0x4480db[_0x229e('0x21')]){if(_0x4480db[_0x229e('0x21')][_0x229e('0x22')]===0x1f4){logger['error'](_0x229e('0x1c'),_0x1c34d1,_0x4480db[_0x229e('0x21')][_0x229e('0x23')]);return _0x2189c1(_0x4480db[_0x229e('0x21')]['message']);}logger[_0x229e('0x21')](_0x229e('0x1c'),_0x1c34d1,_0x4480db[_0x229e('0x21')]['message']);return _0x18d737(_0x4480db[_0x229e('0x21')][_0x229e('0x23')]);}else{logger[_0x229e('0x1b')](_0x229e('0x1c'),_0x1c34d1,_0x229e('0x1d'));_0x18d737(_0x4480db[_0x229e('0x24')]['message']);}})[_0x229e('0x25')](function(_0x3cbe27){logger[_0x229e('0x21')]('FaxMessage,\x20%s,\x20%s',_0x1c34d1,_0x3cbe27);_0x2189c1(_0x3cbe27);});});}function respondWithStatusCode(_0x592741,_0x1df24d){_0x1df24d=_0x1df24d||0xcc;return function(_0x5854fa){if(_0x5854fa){return _0x592741[_0x229e('0x26')](_0x1df24d);}return _0x592741['status'](_0x1df24d)[_0x229e('0x27')]();};}function respondWithResult(_0x37778e,_0x23a56e){_0x23a56e=_0x23a56e||0xc8;return function(_0x19dea9){if(_0x19dea9){return _0x37778e['status'](_0x23a56e)['json'](_0x19dea9);}};}function respondWithFilteredResult(_0x48f9a4,_0x364f37){return function(_0x1676be){if(_0x1676be){var _0x561639=typeof _0x364f37[_0x229e('0x28')]===_0x229e('0x29')&&typeof _0x364f37[_0x229e('0x2a')]===_0x229e('0x29');var _0x3ede17=_0x1676be[_0x229e('0x2b')];var _0x5df649=_0x561639?0x0:_0x364f37[_0x229e('0x28')];var _0x4e9659=_0x561639?_0x1676be['count']:_0x364f37[_0x229e('0x28')]+_0x364f37[_0x229e('0x2a')];var _0x3480d2;if(_0x4e9659>=_0x3ede17){_0x4e9659=_0x3ede17;_0x3480d2=0xc8;}else{_0x3480d2=0xce;}_0x48f9a4['status'](_0x3480d2);return _0x48f9a4[_0x229e('0x2c')](_0x229e('0x2d'),_0x5df649+'-'+_0x4e9659+'/'+_0x3ede17)[_0x229e('0x2e')](_0x1676be);}return null;};}function patchUpdates(_0x443e65){return function(_0x3b6385){try{jsonpatch[_0x229e('0x2f')](_0x3b6385,_0x443e65,!![]);}catch(_0x1e2aa7){return BPromise[_0x229e('0x30')](_0x1e2aa7);}return _0x3b6385[_0x229e('0x31')]();};}function saveUpdates(_0x11a489,_0x20c41f){return function(_0x9bac98){if(_0x9bac98){return _0x9bac98[_0x229e('0x32')](_0x11a489)[_0x229e('0x33')](function(_0x5c5abd){return _0x5c5abd;});}return null;};}function removeEntity(_0x2d8c52,_0x565665){return function(_0x508c65){if(_0x508c65){return _0x508c65[_0x229e('0x34')]()[_0x229e('0x33')](function(){_0x2d8c52[_0x229e('0x35')](0xcc)[_0x229e('0x27')]();});}};}function handleEntityNotFound(_0x45792c,_0x5928ad){return function(_0xd2091f){if(!_0xd2091f){_0x45792c[_0x229e('0x26')](0x194);}return _0xd2091f;};}function handleError(_0x18044b,_0x554a73){_0x554a73=_0x554a73||0x1f4;return function(_0x3f5d70){logger[_0x229e('0x21')](_0x3f5d70[_0x229e('0x36')]);if(_0x3f5d70['name']){delete _0x3f5d70[_0x229e('0x37')];}_0x18044b[_0x229e('0x35')](_0x554a73)[_0x229e('0x38')](_0x3f5d70);};}exports[_0x229e('0x39')]=function(_0x14c8c7,_0x16d9db){var _0x4ab028={},_0x2e49b8={},_0x24a474={'count':0x0,'rows':[]};var _0x39a8bd=_[_0x229e('0x3a')](db[_0x229e('0x3b')][_0x229e('0x3c')],function(_0x50c571){return{'name':_0x50c571[_0x229e('0x3d')],'type':_0x50c571[_0x229e('0x3e')][_0x229e('0x3f')]};});_0x2e49b8[_0x229e('0x40')]=_[_0x229e('0x3a')](_0x39a8bd,'name');_0x2e49b8['query']=_[_0x229e('0x41')](_0x14c8c7[_0x229e('0x42')]);_0x2e49b8[_0x229e('0x43')]=_['intersection'](_0x2e49b8[_0x229e('0x40')],_0x2e49b8[_0x229e('0x42')]);_0x4ab028['attributes']=_[_0x229e('0x44')](_0x2e49b8['model'],qs['fields'](_0x14c8c7['query'][_0x229e('0x45')]));_0x4ab028['attributes']=_0x4ab028[_0x229e('0x46')][_0x229e('0x47')]?_0x4ab028[_0x229e('0x46')]:_0x2e49b8['model'];if(!_0x14c8c7['query'][_0x229e('0x48')]('nolimit')){_0x4ab028['limit']=qs[_0x229e('0x2a')](_0x14c8c7[_0x229e('0x42')]['limit']);_0x4ab028['offset']=qs['offset'](_0x14c8c7[_0x229e('0x42')]['offset']);}_0x4ab028[_0x229e('0x49')]=qs[_0x229e('0x4a')](_0x14c8c7[_0x229e('0x42')][_0x229e('0x4a')]);_0x4ab028[_0x229e('0x4b')]=qs[_0x229e('0x43')](_['pick'](_0x14c8c7['query'],_0x2e49b8[_0x229e('0x43')]),_0x39a8bd);if(_0x14c8c7[_0x229e('0x42')][_0x229e('0x4c')]){_0x4ab028[_0x229e('0x4b')]=_[_0x229e('0x4d')](_0x4ab028[_0x229e('0x4b')],{'$or':_[_0x229e('0x3a')](_0x39a8bd,function(_0xf6300a){if(_0xf6300a[_0x229e('0x3e')]!==_0x229e('0x4e')){var _0x3b989d={};_0x3b989d[_0xf6300a[_0x229e('0x37')]]={'$like':'%'+_0x14c8c7['query']['filter']+'%'};return _0x3b989d;}})});}_0x4ab028=_[_0x229e('0x4d')]({},_0x4ab028,_0x14c8c7[_0x229e('0x4f')]);var _0x483a7b={'where':_0x4ab028['where']};return db[_0x229e('0x3b')][_0x229e('0x2b')](_0x483a7b)[_0x229e('0x33')](function(_0x35ba4c){_0x24a474[_0x229e('0x2b')]=_0x35ba4c;if(_0x14c8c7['query'][_0x229e('0x50')]){_0x4ab028['include']=[{'all':!![]}];}return db['FaxMessage'][_0x229e('0x51')](_0x4ab028);})[_0x229e('0x33')](function(_0x25991e){_0x24a474[_0x229e('0x52')]=_0x25991e;return _0x24a474;})[_0x229e('0x33')](respondWithFilteredResult(_0x16d9db,_0x4ab028))[_0x229e('0x25')](handleError(_0x16d9db,null));};exports['show']=function(_0x3efc6,_0x3e623a){var _0x1f4aed={'raw':!![],'where':{'id':_0x3efc6['params']['id']}},_0x35ccdd={};_0x35ccdd['model']=_[_0x229e('0x41')](db['FaxMessage'][_0x229e('0x3c')]);_0x35ccdd[_0x229e('0x42')]=_[_0x229e('0x41')](_0x3efc6[_0x229e('0x42')]);_0x35ccdd[_0x229e('0x43')]=_[_0x229e('0x44')](_0x35ccdd[_0x229e('0x40')],_0x35ccdd['query']);_0x1f4aed[_0x229e('0x46')]=_[_0x229e('0x44')](_0x35ccdd[_0x229e('0x40')],qs[_0x229e('0x45')](_0x3efc6['query'][_0x229e('0x45')]));_0x1f4aed[_0x229e('0x46')]=_0x1f4aed['attributes'][_0x229e('0x47')]?_0x1f4aed[_0x229e('0x46')]:_0x35ccdd[_0x229e('0x40')];if(_0x3efc6[_0x229e('0x42')]['includeAll']){_0x1f4aed[_0x229e('0x53')]=[{'all':!![]}];}_0x1f4aed=_[_0x229e('0x4d')]({},_0x1f4aed,_0x3efc6[_0x229e('0x4f')]);return db['FaxMessage']['find'](_0x1f4aed)['then'](handleEntityNotFound(_0x3e623a,null))[_0x229e('0x33')](respondWithResult(_0x3e623a,null))[_0x229e('0x25')](handleError(_0x3e623a,null));};exports[_0x229e('0x32')]=function(_0xdf5b20,_0x121e38){if(_0xdf5b20[_0x229e('0x54')]['id']){delete _0xdf5b20[_0x229e('0x54')]['id'];}return db[_0x229e('0x3b')][_0x229e('0x55')]({'where':{'id':_0xdf5b20[_0x229e('0x56')]['id']}})[_0x229e('0x33')](handleEntityNotFound(_0x121e38,null))[_0x229e('0x33')](saveUpdates(_0xdf5b20['body'],null))[_0x229e('0x33')](respondWithResult(_0x121e38,null))[_0x229e('0x25')](handleError(_0x121e38,null));};exports['destroy']=function(_0x1c4d06,_0x8a1ce4){return db[_0x229e('0x3b')][_0x229e('0x55')]({'where':{'id':_0x1c4d06['params']['id']}})[_0x229e('0x33')](handleEntityNotFound(_0x8a1ce4,null))[_0x229e('0x33')](removeEntity(_0x8a1ce4,null))['catch'](handleError(_0x8a1ce4,null));};exports[_0x229e('0x57')]=function(_0x28bba0,_0xbb20e3){return db[_0x229e('0x3b')]['describe']()[_0x229e('0x33')](respondWithResult(_0xbb20e3,null))[_0x229e('0x25')](handleError(_0xbb20e3,null));};var interaction_log=require('../../config/logger')(_0x229e('0x58'));exports['accept']=function(_0x4c3a25,_0x1dd5cb,_0x289773){var _0x38ba48={'agent':{},'channel':_0x229e('0x59')};if(_0x4c3a25[_0x229e('0x54')]['id']){delete _0x4c3a25['body']['id'];}_0x4c3a25[_0x229e('0x54')][_0x229e('0x5a')]=!![];_0x4c3a25['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')]=_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')]||_0x4c3a25[_0x229e('0x5c')]['id'];_0x38ba48['agent']['id']=_0x4c3a25['body'][_0x229e('0x5b')];return db[_0x229e('0x3b')]['find']({'where':{'id':_0x4c3a25[_0x229e('0x56')]['id'],'UserId':null}})[_0x229e('0x33')](handleEntityNotFound(_0x1dd5cb,null))['then'](saveUpdates(_0x4c3a25[_0x229e('0x54')],null))[_0x229e('0x33')](function(_0x307fbd){if(_0x307fbd){_0x38ba48['message']=_0x307fbd[_0x229e('0x5d')]({'plain':!![]});return db[_0x229e('0x5e')][_0x229e('0x55')]({'where':{'id':_0x307fbd[_0x229e('0x5f')]}});}return null;})[_0x229e('0x33')](handleEntityNotFound(_0x1dd5cb,null))[_0x229e('0x33')](function(_0x34ba16){if(_0x34ba16){return _0x34ba16['update']({'UserId':_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')],'read1stAt':_[_0x229e('0x60')](_0x34ba16[_0x229e('0x61')])?moment()[_0x229e('0x62')](_0x229e('0x63')):undefined});}return null;})['then'](function(_0x270510){if(_0x270510){_0x38ba48[_0x229e('0x64')]=_0x270510['get']({'plain':!![]});interaction_log['info'](_0x229e('0x65'),_0x4c3a25[_0x229e('0x5c')]['id'],_0x4c3a25[_0x229e('0x5c')][_0x229e('0x37')],_0x4c3a25[_0x229e('0x5c')][_0x229e('0x66')],_0x38ba48[_0x229e('0x64')]['id'],_0x4c3a25[_0x229e('0x54')]?JSON['stringify'](_0x4c3a25[_0x229e('0x54')]):_0x229e('0x67'));return respondWithRpcPromise('AcceptMessage',_0x229e('0x68'),_0x38ba48);}return null;})['then'](function(_0x44d960){var _0x1f9dbc=_0x229e('0x69')+_0x44d960[_0x229e('0x23')][_0x229e('0x6a')];return db[_0x229e('0x6b')][_0x229e('0x42')](_0x1f9dbc,{'type':db[_0x229e('0x6c')][_0x229e('0x6d')]['SELECT'],'raw':!![]})[_0x229e('0x33')](function(_0x4cdba2){return _0x4cdba2;});})[_0x229e('0x33')](function(_0x671a94){if(_0x671a94){_0x38ba48['message'][_0x229e('0x6e')]=_0x671a94[0x0];if(!_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')])return;return db['User']['find']({'where':{'id':_0x4c3a25[_0x229e('0x54')][_0x229e('0x5b')],'role':_0x229e('0x6f')},'attributes':['id',_0x229e('0x37'),'fullname',_0x229e('0x70'),_0x229e('0x71')],'raw':!![]});}return null;})[_0x229e('0x33')](function(_0x3b5b6a){if(!_0x3b5b6a)return null;_0x38ba48[_0x229e('0x23')]['agent']=_0x3b5b6a;return _0x38ba48;})['then'](function(_0x12dc18){if(_0x12dc18){if(_0x4c3a25[_0x229e('0x54')][_0x229e('0x72')]){_0x38ba48[_0x229e('0x23')][_0x229e('0x73')]=util['format']('SIP/%s',_0x4c3a25[_0x229e('0x5c')][_0x229e('0x37')]);_0x38ba48[_0x229e('0x23')]['channel']=_0x38ba48['channel'];_0x38ba48[_0x229e('0x23')]['motionChannel']=_0x38ba48['channel'];_0x38ba48[_0x229e('0x23')][_0x229e('0x74')]=_0x229e('0x75');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x229e('0x76'),'message':_0x38ba48[_0x229e('0x23')]},client9002)[_0x229e('0x33')](function(){return _0x38ba48;});}return _0x38ba48;}return null;})['then'](respondWithResult(_0x1dd5cb,null))[_0x229e('0x25')](handleError(_0x1dd5cb,null));};var interaction_log=require(_0x229e('0xf'))('fax-interactions');exports[_0x229e('0x30')]=function(_0x2d12d2,_0x4eae2d,_0x4c0771){var _0x42b10f={'agent':{},'channel':'fax'};if(_0x2d12d2[_0x229e('0x54')]['id']){delete _0x2d12d2[_0x229e('0x54')]['id'];}_0x2d12d2['body'][_0x229e('0x5b')]=_0x2d12d2['body']['UserId']||_0x2d12d2[_0x229e('0x5c')]['id'];_0x42b10f[_0x229e('0x6f')]['id']=_0x2d12d2['body'][_0x229e('0x5b')];return db['FaxMessage']['find']({'where':{'id':_0x2d12d2[_0x229e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4eae2d,null))['then'](function(_0xd3ae61){if(_0xd3ae61){_0x42b10f['message']=_0xd3ae61[_0x229e('0x5d')]({'plain':!![]});return db[_0x229e('0x5e')][_0x229e('0x55')]({'where':{'id':_0xd3ae61[_0x229e('0x5f')]}});}return null;})[_0x229e('0x33')](handleEntityNotFound(_0x4eae2d,null))[_0x229e('0x33')](function(_0x5d6825){if(_0x5d6825){_0x42b10f['interaction']=_0x5d6825['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d12d2[_0x229e('0x5c')]['id'],_0x2d12d2[_0x229e('0x5c')]['name'],_0x2d12d2[_0x229e('0x5c')][_0x229e('0x66')],_0x42b10f[_0x229e('0x64')]['id'],_0x2d12d2[_0x229e('0x54')]?JSON[_0x229e('0x20')](_0x2d12d2[_0x229e('0x54')]):_0x229e('0x67'));return respondWithRpcPromise(_0x229e('0x77'),'rejectMessage',_0x42b10f);}return null;})['then'](function(_0x1c53ac){var _0x1a8e62='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c53ac['message'][_0x229e('0x6a')];return db[_0x229e('0x6b')][_0x229e('0x42')](_0x1a8e62,{'type':db['Sequelize'][_0x229e('0x6d')][_0x229e('0x78')],'raw':!![]})[_0x229e('0x33')](function(_0xfad688){return _0xfad688;});})[_0x229e('0x33')](function(_0x533598){if(_0x533598){_0x42b10f[_0x229e('0x23')][_0x229e('0x6e')]=_0x533598[0x0];if(!_0x2d12d2[_0x229e('0x54')][_0x229e('0x5b')])return;return db['User'][_0x229e('0x55')]({'where':{'id':_0x2d12d2['body'][_0x229e('0x5b')],'role':'agent'},'attributes':['id',_0x229e('0x37'),'fullname',_0x229e('0x70'),_0x229e('0x71')],'raw':!![]});}return null;})['then'](function(_0x121bd1){if(!_0x121bd1)return null;_0x42b10f[_0x229e('0x23')][_0x229e('0x6f')]=_0x121bd1;return _0x42b10f;})[_0x229e('0x33')](function(_0x369084){if(_0x369084){_0x369084['message'][_0x229e('0x73')]=util[_0x229e('0x62')](_0x229e('0x79'),_0x2d12d2[_0x229e('0x5c')]['name']);_0x369084['message'][_0x229e('0x7a')]=_0x42b10f[_0x229e('0x7a')];_0x369084[_0x229e('0x23')][_0x229e('0x7b')]=_0x42b10f[_0x229e('0x7a')];_0x369084[_0x229e('0x23')][_0x229e('0x74')]=_0x229e('0x30');respondWithRpcPromise(_0x229e('0x7c'),_0x229e('0x7c'),{'event':'rejectmessage','message':_0x369084['message']},client9002);return _0x42b10f;}return null;})['then'](respondWithResult(_0x4eae2d,null))[_0x229e('0x25')](handleError(_0x4eae2d,null));};exports['create']=function(_0xd2d79c,_0x57660a){var _0x5d6fa1;return db['FaxMessage'][_0x229e('0x7d')](_0xd2d79c['body'],{})['then'](function(_0x2ff4f9){_0x5d6fa1=_0x2ff4f9;return db[_0x229e('0x7e')][_0x229e('0x7f')]({'where':{'id':_0x5d6fa1[_0x229e('0x6a')]}});})['then'](function(_0x51749c){if(_[_0x229e('0x60')](_0x51749c)){return;}else{_0x5d6fa1['fax']=_0x51749c['fax'];return db[_0x229e('0x80')][_0x229e('0x7f')]({'where':{'id':_0x5d6fa1[_0x229e('0x81')]}});}})[_0x229e('0x33')](function(_0x1f8beb){return respondWithRpcPromise(_0x229e('0x82'),_0x229e('0x82'),{'FaxAccountId':_[_0x229e('0x60')](_0xd2d79c[_0x229e('0x54')])?undefined:_0xd2d79c[_0x229e('0x54')]['FaxAccountId'],'path':_['isNil'](_0x1f8beb)?undefined:util[_0x229e('0x62')](_0x229e('0x83'),_0x1f8beb[_0x229e('0x84')]),'fax':_[_0x229e('0x60')](_0x5d6fa1[_0x229e('0x59')])?undefined:_0x5d6fa1[_0x229e('0x59')],'AttachmentId':_0x5d6fa1[_0x229e('0x81')]},client9002);})[_0x229e('0x33')](respondWithResult(_0x57660a,0xc9))[_0x229e('0x25')](handleError(_0x57660a,null));};exports[_0x229e('0x85')]=function(_0x1969c6,_0x3c3a0f){var _0x5549a0=path[_0x229e('0x86')](config[_0x229e('0x87')],'server','files',_0x229e('0x88'));return db[_0x229e('0x3b')][_0x229e('0x55')]({'where':{'id':_0x1969c6[_0x229e('0x56')]['id']},'include':[{'model':db[_0x229e('0x80')],'as':_0x229e('0x80')}]})[_0x229e('0x33')](handleEntityNotFound(_0x3c3a0f,null))[_0x229e('0x33')](function(_0x341085){if(_0x341085){return _0x3c3a0f['download'](path['join'](_0x5549a0,_0x341085[_0x229e('0x80')]['basename']));}})[_0x229e('0x25')](handleError(_0x3c3a0f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3f2e062..06f6793 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 _0xe3da=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x32d336,_0x5e8457){var _0x3b7c23=function(_0x4e7e53){while(--_0x4e7e53){_0x32d336['push'](_0x32d336['shift']());}};_0x3b7c23(++_0x5e8457);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xae3d('0x0'));var FaxMessage=require(_0xae3d('0x1'))['db'][_0xae3d('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xae3d('0x3')](0x0);var events={'afterCreate':_0xae3d('0x4'),'afterUpdate':_0xae3d('0x5'),'afterDestroy':_0xae3d('0x6')};function emitEvent(_0x17952f){return function(_0xb2dfd3,_0x22bacf,_0x1b9397){FaxMessageEvents[_0xae3d('0x7')](_0x17952f+':'+_0xb2dfd3['id'],_0xb2dfd3);FaxMessageEvents[_0xae3d('0x7')](_0x17952f,_0xb2dfd3);_0x1b9397(null);};}for(var e in events){if(events[_0xae3d('0x8')](e)){var event=events[e];FaxMessage[_0xae3d('0x9')](e,emitEvent(event));}}module[_0xae3d('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0x39e6=['update','remove','emit','hasOwnProperty','hook','exports','events','FaxMessage'];(function(_0x39e8dc,_0x426c31){var _0x164cd0=function(_0x65f16e){while(--_0x65f16e){_0x39e8dc['push'](_0x39e8dc['shift']());}};_0x164cd0(++_0x426c31);}(_0x39e6,0x9e));var _0x639e=function(_0x30d828,_0x1b5074){_0x30d828=_0x30d828-0x0;var _0x2e21fb=_0x39e6[_0x30d828];return _0x2e21fb;};'use strict';var EventEmitter=require(_0x639e('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x639e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x639e('0x2'),'afterDestroy':_0x639e('0x3')};function emitEvent(_0x529394){return function(_0x467229,_0x207d6a,_0x199e72){FaxMessageEvents[_0x639e('0x4')](_0x529394+':'+_0x467229['id'],_0x467229);FaxMessageEvents[_0x639e('0x4')](_0x529394,_0x467229);_0x199e72(null);};}for(var e in events){if(events[_0x639e('0x5')](e)){var event=events[e];FaxMessage[_0x639e('0x6')](e,emitEvent(event));}}module[_0x639e('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 9604e10..216bf40 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 _0x7265=['define','fax_messages','fti_fax_messages','models','get','direction','toLowerCase','out','isNil','findOne','FaxInteractionId','update','createdAt','error','utf8mb4_unicode_ci','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x7265,0xc3));var _0x5726=function(_0x7b928d,_0xcee97e){_0x7b928d=_0x7b928d-0x0;var _0x399323=_0x7265[_0x7b928d];return _0x399323;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5726('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5726('0x1'));var rp=require(_0x5726('0x2'));var fs=require('fs');var path=require(_0x5726('0x3'));var rimraf=require('rimraf');var config=require(_0x5726('0x4'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x1b1bd8,_0x296872){return _0x1b1bd8[_0x5726('0x5')]('FaxMessage',attributes,{'tableName':_0x5726('0x6'),'paranoid':![],'indexes':[{'name':_0x5726('0x7'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50b900,_0x1a0be7,_0x35d8f8){var _0x34155f=_0x1b1bd8[_0x5726('0x8')];var _0x85f44c=_0x50b900[_0x5726('0x9')]({'plain':!![]});if(_0x85f44c[_0x5726('0xa')][_0x5726('0xb')]()==='in'||_0x85f44c[_0x5726('0xa')]['toLowerCase']()===_0x5726('0xc')&&!_0x85f44c['secret']&&!_[_0x5726('0xd')](_0x85f44c['UserId'])){_0x34155f['FaxInteraction'][_0x5726('0xe')]({'where':{'id':_0x85f44c[_0x5726('0xf')]}})['then'](function(_0x29ebba){if(_0x29ebba){_0x29ebba[_0x5726('0x10')]({'lastMsgAt':_0x85f44c[_0x5726('0x11')],'lastMsgDirection':_0x85f44c[_0x5726('0xa')][_0x5726('0xb')]()});}})['catch'](function(_0x5b9a3a){console[_0x5726('0x12')](_0x5b9a3a);});}_0x35d8f8();}},'charset':'utf8mb4','collate':_0x5726('0x13')});}; \ No newline at end of file +var _0xa3c8=['then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','exports','define','FaxMessage','FULLTEXT','get','toLowerCase','direction','secret','isNil','UserId','findOne'];(function(_0xb5d30c,_0x53fda0){var _0x3c984f=function(_0x16f51d){while(--_0x16f51d){_0xb5d30c['push'](_0xb5d30c['shift']());}};_0x3c984f(++_0x53fda0);}(_0xa3c8,0x14f));var _0x8a3c=function(_0x554a0c,_0x2dc98e){_0x554a0c=_0x554a0c-0x0;var _0x3aff34=_0xa3c8[_0x554a0c];return _0x3aff34;};'use strict';var _=require(_0x8a3c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8a3c('0x1'));var moment=require('moment');var BPromise=require(_0x8a3c('0x2'));var rp=require(_0x8a3c('0x3'));var fs=require('fs');var path=require(_0x8a3c('0x4'));var rimraf=require(_0x8a3c('0x5'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x8a3c('0x6')]=function(_0x594f37,_0x4d83f6){return _0x594f37[_0x8a3c('0x7')](_0x8a3c('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x8a3c('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9b5f1d,_0x1c9f73,_0x158d9f){var _0x4b052e=_0x594f37['models'];var _0x3febcc=_0x9b5f1d[_0x8a3c('0xa')]({'plain':!![]});if(_0x3febcc['direction'][_0x8a3c('0xb')]()==='in'||_0x3febcc[_0x8a3c('0xc')][_0x8a3c('0xb')]()==='out'&&!_0x3febcc[_0x8a3c('0xd')]&&!_[_0x8a3c('0xe')](_0x3febcc[_0x8a3c('0xf')])){_0x4b052e['FaxInteraction'][_0x8a3c('0x10')]({'where':{'id':_0x3febcc['FaxInteractionId']}})[_0x8a3c('0x11')](function(_0x59f469){if(_0x59f469){_0x59f469['update']({'lastMsgAt':_0x3febcc['createdAt'],'lastMsgDirection':_0x3febcc['direction'][_0x8a3c('0xb')]()});}})[_0x8a3c('0x12')](function(_0x178aac){console[_0x8a3c('0x13')](_0x178aac);});}_0x158d9f();}},'charset':_0x8a3c('0x14'),'collate':_0x8a3c('0x15')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 64842f4..06e1665 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 _0x22fb=['request','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','then','debug','UpdateFaxMessage','update','body','attributes','limit','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22fb,0x192));var _0xb22f=function(_0x3cad09,_0x3a6e4){_0x3cad09=_0x3cad09-0x0;var _0x1d3dc3=_0x22fb[_0x3cad09];return _0x1d3dc3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});config[_0xb22f('0xa')]=_[_0xb22f('0xb')](config['redis'],{'host':_0xb22f('0xc'),'port':0x18eb});var socket=require(_0xb22f('0xd'))(new Redis(config[_0xb22f('0xa')]));require(_0xb22f('0xe'))[_0xb22f('0xf')](socket);function respondWithRpcPromise(_0x3593fb,_0x188cea,_0x2ca6dd){return new BPromise(function(_0x26cf79,_0x2676f3){return client[_0xb22f('0x10')](_0x3593fb,_0x2ca6dd)['then'](function(_0x4b9e56){logger['info'](_0xb22f('0x11'),_0x188cea,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x188cea,_0xb22f('0x12'),JSON[_0xb22f('0x13')](_0x4b9e56));if(_0x4b9e56[_0xb22f('0x14')]){if(_0x4b9e56[_0xb22f('0x14')][_0xb22f('0x15')]===0x1f4){logger[_0xb22f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0x4b9e56[_0xb22f('0x14')]['message']);return _0x2676f3(_0x4b9e56[_0xb22f('0x14')]['message']);}logger[_0xb22f('0x14')](_0xb22f('0x11'),_0x188cea,_0x4b9e56[_0xb22f('0x14')][_0xb22f('0x16')]);return _0x26cf79(_0x4b9e56[_0xb22f('0x14')]['message']);}else{logger[_0xb22f('0x17')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0xb22f('0x12'));_0x26cf79(_0x4b9e56[_0xb22f('0x18')][_0xb22f('0x16')]);}})[_0xb22f('0x19')](function(_0x139bb6){logger[_0xb22f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0x139bb6);_0x2676f3(_0x139bb6);});});}exports[_0xb22f('0x1a')]=function(_0x4b4510){var _0x3e05ce=this;return new Promise(function(_0x3878d8,_0x316f11){return db[_0xb22f('0x1b')][_0xb22f('0x1c')](_0x4b4510['body'],{'raw':_0x4b4510['options']?_0x4b4510[_0xb22f('0x1d')][_0xb22f('0x1e')]===undefined?!![]:![]:!![]})[_0xb22f('0x1f')](function(_0x16e465){logger[_0xb22f('0x17')](_0xb22f('0x1a'),_0x4b4510);logger[_0xb22f('0x20')](_0xb22f('0x1a'),_0x4b4510,JSON['stringify'](_0x16e465));_0x3878d8(_0x16e465);})['catch'](function(_0x3ab1d8){logger[_0xb22f('0x14')]('CreateFaxMessage',_0x3ab1d8[_0xb22f('0x16')],_0x4b4510);_0x316f11(_0x3e05ce[_0xb22f('0x14')](0x1f4,_0x3ab1d8['message']));});});};exports[_0xb22f('0x21')]=function(_0x2918be){var _0x4dfb62=this;return new Promise(function(_0x3e471f,_0x2c4a9e){return db[_0xb22f('0x1b')][_0xb22f('0x22')](_0x2918be[_0xb22f('0x23')],{'raw':_0x2918be[_0xb22f('0x1d')]?_0x2918be[_0xb22f('0x1d')][_0xb22f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2918be['options']?_0x2918be['options']['where']||null:null,'attributes':_0x2918be[_0xb22f('0x1d')]?_0x2918be['options'][_0xb22f('0x24')]||null:null,'limit':_0x2918be[_0xb22f('0x1d')]?_0x2918be[_0xb22f('0x1d')][_0xb22f('0x25')]||null:null})[_0xb22f('0x1f')](function(_0x5b2a42){logger['info'](_0xb22f('0x21'),_0x2918be);logger[_0xb22f('0x20')](_0xb22f('0x21'),_0x2918be,JSON[_0xb22f('0x13')](_0x5b2a42));_0x3e471f(_0x5b2a42);})['catch'](function(_0x176133){logger[_0xb22f('0x14')]('UpdateFaxMessage',_0x176133[_0xb22f('0x16')],_0x2918be);_0x2c4a9e(_0x4dfb62[_0xb22f('0x14')](0x1f4,_0x176133[_0xb22f('0x16')]));});});}; \ No newline at end of file +var _0xac9d=['then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxMessage','body','options','raw','CreateFaxMessage','UpdateFaxMessage','update','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request'];(function(_0x3e19d7,_0x369ea2){var _0x33f967=function(_0x512abf){while(--_0x512abf){_0x3e19d7['push'](_0x3e19d7['shift']());}};_0x33f967(++_0x369ea2);}(_0xac9d,0x14d));var _0xdac9=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0xac9d[_0x4e4061];return _0x371dbd;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('FaxMessage,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});}exports['CreateFaxMessage']=function(_0x520369){var _0x4029fc=this;return new Promise(function(_0x20ece3,_0x2b9d91){return db[_0xdac9('0x1d')]['create'](_0x520369[_0xdac9('0x1e')],{'raw':_0x520369[_0xdac9('0x1f')]?_0x520369[_0xdac9('0x1f')][_0xdac9('0x20')]===undefined?!![]:![]:!![]})[_0xdac9('0x12')](function(_0x42317c){logger[_0xdac9('0x13')](_0xdac9('0x21'),_0x520369);logger[_0xdac9('0x15')](_0xdac9('0x21'),_0x520369,JSON['stringify'](_0x42317c));_0x20ece3(_0x42317c);})[_0xdac9('0x1c')](function(_0x11f4fd){logger[_0xdac9('0x18')](_0xdac9('0x21'),_0x11f4fd['message'],_0x520369);_0x2b9d91(_0x4029fc[_0xdac9('0x18')](0x1f4,_0x11f4fd['message']));});});};exports[_0xdac9('0x22')]=function(_0x2fce71){var _0x566d8c=this;return new Promise(function(_0x433be9,_0x5105f1){return db[_0xdac9('0x1d')][_0xdac9('0x23')](_0x2fce71[_0xdac9('0x1e')],{'raw':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')]['where']||null:null,'attributes':_0x2fce71['options']?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x24')]||null:null,'limit':_0x2fce71[_0xdac9('0x1f')]?_0x2fce71[_0xdac9('0x1f')][_0xdac9('0x25')]||null:null})[_0xdac9('0x12')](function(_0xed99f9){logger[_0xdac9('0x13')](_0xdac9('0x22'),_0x2fce71);logger[_0xdac9('0x15')](_0xdac9('0x22'),_0x2fce71,JSON[_0xdac9('0x26')](_0xed99f9));_0x433be9(_0xed99f9);})[_0xdac9('0x1c')](function(_0x336fd5){logger[_0xdac9('0x18')](_0xdac9('0x22'),_0x336fd5[_0xdac9('0x1a')],_0x2fce71);_0x5105f1(_0x566d8c[_0xdac9('0x18')](0x1f4,_0x336fd5[_0xdac9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index e835d8e..453fa9e 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 _0xd19d=['save','remove','update','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x24a6bc,_0x4074a6){var _0xb06138=function(_0x21ed79){while(--_0x21ed79){_0x24a6bc['push'](_0x24a6bc['shift']());}};_0xb06138(++_0x4074a6);}(_0xd19d,0xe7));var _0xdd19=function(_0x482490,_0x1783f1){_0x482490=_0x482490-0x0;var _0xe33c42=_0xd19d[_0x482490];return _0xe33c42;};'use strict';var FaxMessageEvents=require(_0xdd19('0x0'));var events=[_0xdd19('0x1'),_0xdd19('0x2'),_0xdd19('0x3')];function createListener(_0x2d2cc7,_0x14c0ba){return function(_0x4a8628){_0x14c0ba[_0xdd19('0x4')](_0x2d2cc7,_0x4a8628);};}function removeListener(_0x2b057d,_0x285883){return function(){FaxMessageEvents[_0xdd19('0x5')](_0x2b057d,_0x285883);};}exports[_0xdd19('0x6')]=function(_0xc5d25f){for(var _0x319d9=0x0,_0x3983ad=events['length'];_0x319d9<_0x3983ad;_0x319d9++){var _0x3287f9=events[_0x319d9];var _0x57cfb8=createListener(_0xdd19('0x7')+_0x3287f9,_0xc5d25f);FaxMessageEvents['on'](_0x3287f9,_0x57cfb8);}}; \ No newline at end of file +var _0xe516=['removeListener','length','./faxMessage.events','save','remove','update'];(function(_0x2d8d12,_0x5ec696){var _0x3c2473=function(_0x26fb3a){while(--_0x26fb3a){_0x2d8d12['push'](_0x2d8d12['shift']());}};_0x3c2473(++_0x5ec696);}(_0xe516,0x6e));var _0x6e51=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0xe516[_0x21090b];return _0x3c68d7;};'use strict';var FaxMessageEvents=require(_0x6e51('0x0'));var events=[_0x6e51('0x1'),_0x6e51('0x2'),_0x6e51('0x3')];function createListener(_0x87a1fa,_0x258b54){return function(_0x2dd363){_0x258b54['emit'](_0x87a1fa,_0x2dd363);};}function removeListener(_0x569c34,_0x4d2e64){return function(){FaxMessageEvents[_0x6e51('0x4')](_0x569c34,_0x4d2e64);};}exports['register']=function(_0x2f6189){for(var _0x19504b=0x0,_0x1ed2a9=events[_0x6e51('0x5')];_0x19504b<_0x1ed2a9;_0x19504b++){var _0x43d4ae=events[_0x19504b];var _0xb52d79=createListener('faxMessage:'+_0x43d4ae,_0x2f6189);FaxMessageEvents['on'](_0x43d4ae,_0xb52d79);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e20df48..c632edd 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 _0x04b8=['/:id','update','put','/:id/accept','/:id/reject','reject','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','index','/describe','describe','isAuthenticated','show','/:id/download','post','tracked','fax','faxmessage:create','create'];(function(_0x2c335c,_0x10cdd2){var _0x5b392a=function(_0x51de13){while(--_0x51de13){_0x2c335c['push'](_0x2c335c['shift']());}};_0x5b392a(++_0x10cdd2);}(_0x04b8,0x159));var _0x804b=function(_0x5eff3e,_0x1d140e){_0x5eff3e=_0x5eff3e-0x0;var _0x5f3e5e=_0x04b8[_0x5eff3e];return _0x5f3e5e;};'use strict';var multer=require('multer');var util=require(_0x804b('0x0'));var path=require('path');var timeout=require(_0x804b('0x1'));var express=require(_0x804b('0x2'));var router=express['Router']();var fs_extra=require(_0x804b('0x3'));var auth=require(_0x804b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x804b('0x5'));var controller=require(_0x804b('0x6'));router[_0x804b('0x7')]('/',auth['isAuthenticated'](),controller[_0x804b('0x8')]);router[_0x804b('0x7')](_0x804b('0x9'),auth['isAuthenticated'](),controller[_0x804b('0xa')]);router[_0x804b('0x7')]('/:id',auth[_0x804b('0xb')](),controller[_0x804b('0xc')]);router[_0x804b('0x7')](_0x804b('0xd'),auth[_0x804b('0xb')](),controller['download']);router[_0x804b('0xe')]('/',auth[_0x804b('0xb')](),interaction[_0x804b('0xf')](_0x804b('0x10'),_0x804b('0x11')),controller[_0x804b('0x12')]);router['put'](_0x804b('0x13'),auth['isAuthenticated'](),controller[_0x804b('0x14')]);router[_0x804b('0x15')](_0x804b('0x16'),auth[_0x804b('0xb')](),controller['accept']);router[_0x804b('0x15')](_0x804b('0x17'),auth[_0x804b('0xb')](),controller[_0x804b('0x18')]);router['delete'](_0x804b('0x13'),auth[_0x804b('0xb')](),controller['destroy']);module[_0x804b('0x19')]=router; \ No newline at end of file +var _0xd87e=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxMessage.controller','isAuthenticated','/describe','describe','get','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','multer'];(function(_0x192678,_0x133fdb){var _0x5e0531=function(_0x2b4e88){while(--_0x2b4e88){_0x192678['push'](_0x192678['shift']());}};_0x5e0531(++_0x133fdb);}(_0xd87e,0x1bf));var _0xed87=function(_0x5a0b42,_0x35c33f){_0x5a0b42=_0x5a0b42-0x0;var _0x2558df=_0xd87e[_0x5a0b42];return _0x2558df;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),interaction[_0xed87('0x10')](_0xed87('0x11'),'faxmessage:create'),controller[_0xed87('0x12')]);router[_0xed87('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed87('0x14')]);router[_0xed87('0x13')](_0xed87('0x15'),auth[_0xed87('0x8')](),controller[_0xed87('0x16')]);router[_0xed87('0x13')]('/:id/reject',auth[_0xed87('0x8')](),controller[_0xed87('0x17')]);router[_0xed87('0x18')](_0xed87('0x19'),auth[_0xed87('0x8')](),controller[_0xed87('0x1a')]);module[_0xed87('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 526ece2..4648658 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 _0x8a2a=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x2605dc,_0x50cf7e){var _0x4568c9=function(_0x447f7c){while(--_0x447f7c){_0x2605dc['push'](_0x2605dc['shift']());}};_0x4568c9(++_0x50cf7e);}(_0x8a2a,0x11f));var _0xa8a2=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x8a2a[_0x101e7b];return _0x4995c0;};'use strict';var Sequelize=require('sequelize');module[_0xa8a2('0x0')]={'name':{'type':Sequelize[_0xa8a2('0x1')],'unique':_0xa8a2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa8a2('0x1')]},'timeout':{'type':Sequelize[_0xa8a2('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa8a2('0x4'),_0xa8a2('0x5'),_0xa8a2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa8a2('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0aaa=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x37abd0,_0x1b4681){var _0x19a705=function(_0x4df7dd){while(--_0x4df7dd){_0x37abd0['push'](_0x37abd0['shift']());}};_0x19a705(++_0x1b4681);}(_0x0aaa,0x160));var _0xa0aa=function(_0x1dac7a,_0x1828ce){_0x1dac7a=_0x1dac7a-0x0;var _0x4cb363=_0x0aaa[_0x1dac7a];return _0x4cb363;};'use strict';var Sequelize=require(_0xa0aa('0x0'));module[_0xa0aa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa0aa('0x2')]},'timeout':{'type':Sequelize[_0xa0aa('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa0aa('0x4')](_0xa0aa('0x5'),_0xa0aa('0x6'),_0xa0aa('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa0aa('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 2063f41..a455cd3 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 _0x36da=['online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','value','removeAgents','emit','userFaxQueue:remove','omit','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','UserProfileResource','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','findOne','UserFaxQueue','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents'];(function(_0x1d2520,_0x105606){var _0x22fd54=function(_0x2c3123){while(--_0x2c3123){_0x1d2520['push'](_0x1d2520['shift']());}};_0x22fd54(++_0x105606);}(_0x36da,0xac));var _0xa36d=function(_0x28fe57,_0x1702bb){_0x28fe57=_0x28fe57-0x0;var _0x543e71=_0x36da[_0x28fe57];return _0x543e71;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa36d('0x0'));var jsonpatch=require(_0xa36d('0x1'));var rp=require(_0xa36d('0x2'));var moment=require(_0xa36d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa36d('0x4'));var util=require(_0xa36d('0x5'));var path=require(_0xa36d('0x6'));var sox=require(_0xa36d('0x7'));var csv=require(_0xa36d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa36d('0x9'));var _=require(_0xa36d('0xa'));var squel=require(_0xa36d('0xb'));var crypto=require(_0xa36d('0xc'));var jsforce=require(_0xa36d('0xd'));var deskjs=require(_0xa36d('0xe'));var toCsv=require(_0xa36d('0x8'));var querystring=require(_0xa36d('0xf'));var Papa=require(_0xa36d('0x10'));var Redis=require('ioredis');var authService=require(_0xa36d('0x11'));var qs=require(_0xa36d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa36d('0x13'));var logger=require(_0xa36d('0x14'))(_0xa36d('0x15'));var utils=require(_0xa36d('0x16'));var config=require(_0xa36d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa36d('0x18'))['db'];config[_0xa36d('0x19')]=_[_0xa36d('0x1a')](config[_0xa36d('0x19')],{'host':_0xa36d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa36d('0x19')]));require('./faxQueue.socket')[_0xa36d('0x1c')](socket);function respondWithStatusCode(_0x2d6c8f,_0x214d80){_0x214d80=_0x214d80||0xcc;return function(_0x47de18){if(_0x47de18){return _0x2d6c8f[_0xa36d('0x1d')](_0x214d80);}return _0x2d6c8f[_0xa36d('0x1e')](_0x214d80)[_0xa36d('0x1f')]();};}function respondWithResult(_0x36a9bc,_0x591f58){_0x591f58=_0x591f58||0xc8;return function(_0x496616){if(_0x496616){return _0x36a9bc['status'](_0x591f58)[_0xa36d('0x20')](_0x496616);}};}function respondWithFilteredResult(_0x205707,_0x3dff05){return function(_0x504b83){if(_0x504b83){var _0x26bfe5=typeof _0x3dff05[_0xa36d('0x21')]===_0xa36d('0x22')&&typeof _0x3dff05['limit']==='undefined';var _0x4d29d6=_0x504b83['count'];var _0x5eae2b=_0x26bfe5?0x0:_0x3dff05[_0xa36d('0x21')];var _0x3dc9e2=_0x26bfe5?_0x504b83[_0xa36d('0x23')]:_0x3dff05[_0xa36d('0x21')]+_0x3dff05[_0xa36d('0x24')];var _0x1fff1b;if(_0x3dc9e2>=_0x4d29d6){_0x3dc9e2=_0x4d29d6;_0x1fff1b=0xc8;}else{_0x1fff1b=0xce;}_0x205707[_0xa36d('0x1e')](_0x1fff1b);return _0x205707[_0xa36d('0x25')](_0xa36d('0x26'),_0x5eae2b+'-'+_0x3dc9e2+'/'+_0x4d29d6)['json'](_0x504b83);}return null;};}function patchUpdates(_0x8edbe7){return function(_0x3fc123){try{jsonpatch[_0xa36d('0x27')](_0x3fc123,_0x8edbe7,!![]);}catch(_0x4ede58){return BPromise[_0xa36d('0x28')](_0x4ede58);}return _0x3fc123[_0xa36d('0x29')]();};}function saveUpdates(_0x5066ad,_0x668e5){return function(_0x3f9e25){if(_0x3f9e25){return _0x3f9e25['update'](_0x5066ad)[_0xa36d('0x2a')](function(_0x207b26){return _0x207b26;});}return null;};}function removeEntity(_0x586051,_0x4ddbfd){return function(_0x277e7d){if(_0x277e7d){return _0x277e7d['destroy']()['then'](function(){var _0x921249=_0x277e7d['get']({'plain':!![]});var _0x4704f9='FaxQueues';return db[_0xa36d('0x2b')]['destroy']({'where':{'type':_0x4704f9,'resourceId':_0x921249['id']}})[_0xa36d('0x2a')](function(){return _0x277e7d;});})[_0xa36d('0x2a')](function(){_0x586051[_0xa36d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5523c0,_0x3c9bd6){return function(_0x5df9d7){if(!_0x5df9d7){_0x5523c0[_0xa36d('0x1d')](0x194);}return _0x5df9d7;};}function handleError(_0x29ad6f,_0x36ce48){_0x36ce48=_0x36ce48||0x1f4;return function(_0x393947){logger['error'](_0x393947[_0xa36d('0x2c')]);if(_0x393947[_0xa36d('0x2d')]){delete _0x393947[_0xa36d('0x2d')];}_0x29ad6f[_0xa36d('0x1e')](_0x36ce48)[_0xa36d('0x2e')](_0x393947);};}exports[_0xa36d('0x2f')]=function(_0x4d2146,_0x2e9a2f){var _0x2ba630={},_0x545d72={},_0x4852db={'count':0x0,'rows':[]};var _0x1b351c=_[_0xa36d('0x30')](db[_0xa36d('0x31')][_0xa36d('0x32')],function(_0x4cea18){return{'name':_0x4cea18[_0xa36d('0x33')],'type':_0x4cea18[_0xa36d('0x34')]['key']};});_0x545d72[_0xa36d('0x35')]=_[_0xa36d('0x30')](_0x1b351c,_0xa36d('0x2d'));_0x545d72[_0xa36d('0x36')]=_[_0xa36d('0x37')](_0x4d2146['query']);_0x545d72[_0xa36d('0x38')]=_[_0xa36d('0x39')](_0x545d72[_0xa36d('0x35')],_0x545d72[_0xa36d('0x36')]);_0x2ba630[_0xa36d('0x3a')]=_[_0xa36d('0x39')](_0x545d72[_0xa36d('0x35')],qs[_0xa36d('0x3b')](_0x4d2146[_0xa36d('0x36')]['fields']));_0x2ba630['attributes']=_0x2ba630[_0xa36d('0x3a')][_0xa36d('0x3c')]?_0x2ba630[_0xa36d('0x3a')]:_0x545d72[_0xa36d('0x35')];if(!_0x4d2146['query'][_0xa36d('0x3d')](_0xa36d('0x3e'))){_0x2ba630[_0xa36d('0x24')]=qs['limit'](_0x4d2146[_0xa36d('0x36')][_0xa36d('0x24')]);_0x2ba630[_0xa36d('0x21')]=qs[_0xa36d('0x21')](_0x4d2146['query'][_0xa36d('0x21')]);}_0x2ba630['order']=qs[_0xa36d('0x3f')](_0x4d2146[_0xa36d('0x36')][_0xa36d('0x3f')]);_0x2ba630['where']=qs[_0xa36d('0x38')](_[_0xa36d('0x40')](_0x4d2146['query'],_0x545d72[_0xa36d('0x38')]),_0x1b351c);if(_0x4d2146[_0xa36d('0x36')][_0xa36d('0x41')]){_0x2ba630[_0xa36d('0x42')]=_['merge'](_0x2ba630[_0xa36d('0x42')],{'$or':_[_0xa36d('0x30')](_0x1b351c,function(_0x390019){if(_0x390019['type']!==_0xa36d('0x43')){var _0x4b57a3={};_0x4b57a3[_0x390019[_0xa36d('0x2d')]]={'$like':'%'+_0x4d2146[_0xa36d('0x36')][_0xa36d('0x41')]+'%'};return _0x4b57a3;}})});}_0x2ba630=_[_0xa36d('0x44')]({},_0x2ba630,_0x4d2146[_0xa36d('0x45')]);var _0x4890fa={'where':_0x2ba630['where']};return db[_0xa36d('0x31')]['count'](_0x4890fa)[_0xa36d('0x2a')](function(_0x37a719){_0x4852db['count']=_0x37a719;if(_0x4d2146[_0xa36d('0x36')][_0xa36d('0x46')]){_0x2ba630[_0xa36d('0x47')]=[{'all':!![]}];}return db[_0xa36d('0x31')]['findAll'](_0x2ba630);})[_0xa36d('0x2a')](function(_0x3a2e3d){_0x4852db[_0xa36d('0x48')]=_0x3a2e3d;return _0x4852db;})[_0xa36d('0x2a')](respondWithFilteredResult(_0x2e9a2f,_0x2ba630))[_0xa36d('0x49')](handleError(_0x2e9a2f,null));};exports[_0xa36d('0x4a')]=function(_0x3db9fb,_0x2bef3d){var _0x2c7433={'raw':!![],'where':{'id':_0x3db9fb[_0xa36d('0x4b')]['id']}},_0x425b48={};_0x425b48[_0xa36d('0x35')]=_[_0xa36d('0x37')](db['FaxQueue'][_0xa36d('0x32')]);_0x425b48[_0xa36d('0x36')]=_[_0xa36d('0x37')](_0x3db9fb[_0xa36d('0x36')]);_0x425b48[_0xa36d('0x38')]=_[_0xa36d('0x39')](_0x425b48[_0xa36d('0x35')],_0x425b48['query']);_0x2c7433[_0xa36d('0x3a')]=_[_0xa36d('0x39')](_0x425b48[_0xa36d('0x35')],qs['fields'](_0x3db9fb[_0xa36d('0x36')]['fields']));_0x2c7433[_0xa36d('0x3a')]=_0x2c7433[_0xa36d('0x3a')]['length']?_0x2c7433[_0xa36d('0x3a')]:_0x425b48['model'];if(_0x3db9fb[_0xa36d('0x36')][_0xa36d('0x46')]){_0x2c7433[_0xa36d('0x47')]=[{'all':!![]}];}_0x2c7433=_[_0xa36d('0x44')]({},_0x2c7433,_0x3db9fb['options']);return db[_0xa36d('0x31')][_0xa36d('0x4c')](_0x2c7433)['then'](handleEntityNotFound(_0x2bef3d,null))['then'](respondWithResult(_0x2bef3d,null))[_0xa36d('0x49')](handleError(_0x2bef3d,null));};exports[_0xa36d('0x4d')]=function(_0x494eac,_0x40618c){return db[_0xa36d('0x31')][_0xa36d('0x4d')](_0x494eac[_0xa36d('0x4e')],{})[_0xa36d('0x2a')](function(_0x3f6c89){var _0x315f3b=_0x494eac[_0xa36d('0x4f')][_0xa36d('0x50')]({'plain':!![]});if(!_0x315f3b)throw new Error(_0xa36d('0x51'));if(_0x315f3b['role']===_0xa36d('0x4f')){var _0x10eb67=_0x3f6c89['get']({'plain':!![]});var _0x1f957a=_0xa36d('0x52');return db[_0xa36d('0x53')][_0xa36d('0x4c')]({'where':{'name':_0x1f957a,'userProfileId':_0x315f3b['userProfileId']},'raw':!![]})['then'](function(_0x49ac88){if(_0x49ac88&&_0x49ac88[_0xa36d('0x54')]===0x0){return db[_0xa36d('0x2b')][_0xa36d('0x4d')]({'name':_0x10eb67['name'],'resourceId':_0x10eb67['id'],'type':_0x49ac88[_0xa36d('0x2d')],'sectionId':_0x49ac88['id']},{})[_0xa36d('0x2a')](function(){return _0x3f6c89;});}else{return _0x3f6c89;}})[_0xa36d('0x49')](function(_0x15cd49){logger[_0xa36d('0x55')](_0xa36d('0x56'),_0x15cd49);throw _0x15cd49;});}return _0x3f6c89;})[_0xa36d('0x2a')](respondWithResult(_0x40618c,0xc9))['catch'](handleError(_0x40618c,null));};exports['update']=function(_0x115165,_0x54ac71){if(_0x115165[_0xa36d('0x4e')]['id']){delete _0x115165[_0xa36d('0x4e')]['id'];}return db[_0xa36d('0x31')]['find']({'where':{'id':_0x115165[_0xa36d('0x4b')]['id']}})[_0xa36d('0x2a')](handleEntityNotFound(_0x54ac71,null))['then'](saveUpdates(_0x115165[_0xa36d('0x4e')],null))[_0xa36d('0x2a')](respondWithResult(_0x54ac71,null))['catch'](handleError(_0x54ac71,null));};exports[_0xa36d('0x57')]=function(_0xbaca0d,_0x1e5d5d){return db[_0xa36d('0x31')]['find']({'where':{'id':_0xbaca0d[_0xa36d('0x4b')]['id']}})[_0xa36d('0x2a')](handleEntityNotFound(_0x1e5d5d,null))[_0xa36d('0x2a')](removeEntity(_0x1e5d5d,null))['catch'](handleError(_0x1e5d5d,null));};exports[_0xa36d('0x58')]=function(_0x47b88a,_0x2a6df8){return db[_0xa36d('0x31')][_0xa36d('0x58')]()[_0xa36d('0x2a')](respondWithResult(_0x2a6df8,null))[_0xa36d('0x49')](handleError(_0x2a6df8,null));};exports['getMembers']=function(_0xcd8027,_0x52cf15,_0x355523){var _0x49a5fc={'raw':!![],'where':{}},_0x157c8b={},_0x57ba90;return db[_0xa36d('0x31')][_0xa36d('0x59')]({'where':{'id':_0xcd8027['params']['id']}})[_0xa36d('0x2a')](handleEntityNotFound(_0x52cf15,null))[_0xa36d('0x2a')](function(_0x37beb3){if(_0x37beb3){_0x57ba90=_0x37beb3[_0xa36d('0x50')]({'plain':!![]});_0x157c8b[_0xa36d('0x35')]=_[_0xa36d('0x37')](db[_0xa36d('0x5a')][_0xa36d('0x32')]);_0x157c8b['query']=_[_0xa36d('0x37')](_0xcd8027[_0xa36d('0x36')]);_0x157c8b['filters']=_[_0xa36d('0x39')](_0x157c8b[_0xa36d('0x35')],_0x157c8b[_0xa36d('0x36')]);_0x49a5fc[_0xa36d('0x3a')]=_[_0xa36d('0x39')](_0x157c8b[_0xa36d('0x35')],qs[_0xa36d('0x3b')](_0xcd8027['query']['fields']));_0x49a5fc[_0xa36d('0x3a')]=_0x49a5fc[_0xa36d('0x3a')]['length']?_0x49a5fc[_0xa36d('0x3a')]:_0x157c8b[_0xa36d('0x35')];if(!_0xcd8027[_0xa36d('0x36')][_0xa36d('0x3d')](_0xa36d('0x3e'))){_0x49a5fc[_0xa36d('0x24')]=qs[_0xa36d('0x24')](_0xcd8027['query'][_0xa36d('0x24')]);_0x49a5fc[_0xa36d('0x21')]=qs[_0xa36d('0x21')](_0xcd8027['query'][_0xa36d('0x21')]);}_0x49a5fc['order']=qs[_0xa36d('0x3f')](_0xcd8027[_0xa36d('0x36')]['sort']);_0x49a5fc[_0xa36d('0x42')]=qs[_0xa36d('0x38')](_[_0xa36d('0x40')](_0xcd8027[_0xa36d('0x36')],_0x157c8b[_0xa36d('0x38')]));_0x49a5fc[_0xa36d('0x42')][_0xa36d('0x5b')]=_0x37beb3['id'];if(_0xcd8027['query'][_0xa36d('0x41')]){_0x49a5fc[_0xa36d('0x42')]=_[_0xa36d('0x44')](_0x49a5fc[_0xa36d('0x42')],{'$or':_['map'](_0x49a5fc['attributes'],function(_0x42aaa7){var _0x105ed8={};_0x105ed8[_0x42aaa7]={'$like':'%'+_0xcd8027[_0xa36d('0x36')]['filter']+'%'};return _0x105ed8;})});}_0x49a5fc=_['merge']({},_0x49a5fc,_0xcd8027['options']);return db[_0xa36d('0x5a')][_0xa36d('0x5c')](_0x49a5fc);}})[_0xa36d('0x2a')](function(_0x5e2ff4){if(_0x5e2ff4){return db[_0xa36d('0x5d')][_0xa36d('0x5e')]({'where':{'id':_['map'](_0x5e2ff4,_0xa36d('0x5f')),'role':_0xa36d('0x60')},'attributes':['id',_0xa36d('0x2d'),_0xa36d('0x61'),_0xa36d('0x62'),_0xa36d('0x63')]});}})[_0xa36d('0x2a')](function(_0x45a736){if(_0x45a736){return{'count':_0x45a736['count'],'rows':_[_0xa36d('0x30')](_0x45a736['rows'],function(_0x3a187e){return{'membername':_0x3a187e[_0xa36d('0x2d')],'UserId':_0x3a187e['id'],'queue_name':_0x57ba90[_0xa36d('0x2d')],'FaxQueueId':_0x57ba90['id'],'interface':util['format'](_0xa36d('0x64'),_0xa36d('0x65'),_0x3a187e[_0xa36d('0x2d')]),'penalty':0x0,'paused':_0x3a187e[_0xa36d('0x61')],'createdAt':_0x3a187e['createdAt'],'updatedAt':_0x3a187e[_0xa36d('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa36d('0x2a')](respondWithFilteredResult(_0x52cf15,_0x49a5fc))[_0xa36d('0x49')](handleError(_0x52cf15,null));};exports[_0xa36d('0x66')]=function(_0x100ed2,_0x405295,_0x116677){var _0xe676e8={};var _0x30ca1d={};var _0x2b35fd;var _0x530063;return db[_0xa36d('0x31')][_0xa36d('0x59')]({'where':{'id':_0x100ed2[_0xa36d('0x4b')]['id']}})[_0xa36d('0x2a')](handleEntityNotFound(_0x405295,null))['then'](function(_0xa59b0b){if(_0xa59b0b){_0x2b35fd=_0xa59b0b;_0x30ca1d[_0xa36d('0x35')]=_[_0xa36d('0x37')](db[_0xa36d('0x67')][_0xa36d('0x32')]);_0x30ca1d[_0xa36d('0x36')]=_[_0xa36d('0x37')](_0x100ed2[_0xa36d('0x36')]);_0x30ca1d[_0xa36d('0x38')]=_[_0xa36d('0x39')](_0x30ca1d[_0xa36d('0x35')],_0x30ca1d['query']);_0xe676e8[_0xa36d('0x3a')]=_[_0xa36d('0x39')](_0x30ca1d[_0xa36d('0x35')],qs['fields'](_0x100ed2[_0xa36d('0x36')][_0xa36d('0x3b')]));_0xe676e8['attributes']=_0xe676e8[_0xa36d('0x3a')][_0xa36d('0x3c')]?_0xe676e8[_0xa36d('0x3a')]:_0x30ca1d[_0xa36d('0x35')];_0xe676e8[_0xa36d('0x68')]=qs[_0xa36d('0x3f')](_0x100ed2[_0xa36d('0x36')]['sort']);_0xe676e8['where']=qs[_0xa36d('0x38')](_[_0xa36d('0x40')](_0x100ed2[_0xa36d('0x36')],_0x30ca1d[_0xa36d('0x38')]));if(_0x100ed2[_0xa36d('0x36')][_0xa36d('0x41')]){_0xe676e8[_0xa36d('0x42')]=_[_0xa36d('0x44')](_0xe676e8['where'],{'$or':_['map'](_0xe676e8[_0xa36d('0x3a')],function(_0x32f92b){var _0xff1a59={};_0xff1a59[_0x32f92b]={'$like':'%'+_0x100ed2['query'][_0xa36d('0x41')]+'%'};return _0xff1a59;})});}_0xe676e8=_[_0xa36d('0x44')]({},_0xe676e8,_0x100ed2[_0xa36d('0x45')]);return _0x2b35fd[_0xa36d('0x66')](_0xe676e8);}})['then'](function(_0x45a013){if(_0x45a013){_0x530063=_0x45a013[_0xa36d('0x3c')];if(!_0x100ed2[_0xa36d('0x36')][_0xa36d('0x3d')](_0xa36d('0x3e'))){_0xe676e8[_0xa36d('0x24')]=qs[_0xa36d('0x24')](_0x100ed2[_0xa36d('0x36')]['limit']);_0xe676e8[_0xa36d('0x21')]=qs[_0xa36d('0x21')](_0x100ed2[_0xa36d('0x36')]['offset']);}return _0x2b35fd[_0xa36d('0x66')](_0xe676e8);}})[_0xa36d('0x2a')](function(_0x32db37){if(_0x32db37){return _0x32db37?{'count':_0x530063,'rows':_0x32db37}:null;}})['then'](respondWithResult(_0x405295,null))[_0xa36d('0x49')](handleError(_0x405295,null));};exports[_0xa36d('0x69')]=function(_0x3e8f8e,_0x47f8e0,_0x3ee212){var _0x47d2ff=_0x3e8f8e[_0xa36d('0x4e')][_0xa36d('0x6a')];return db[_0xa36d('0x67')][_0xa36d('0x5c')]({'where':{'id':_0x47d2ff},'attributes':['id'],'include':[{'model':db[_0xa36d('0x5d')],'as':_0xa36d('0x6b'),'attributes':['id',_0xa36d('0x2d'),_0xa36d('0x6c'),_0xa36d('0x6d'),_0xa36d('0x6e')],'raw':!![]}]})[_0xa36d('0x2a')](function(_0x4038b5){if(_0x4038b5){var _0x2f5893=_['flatMap'](_0x4038b5,function(_0xb76762){var _0x208991=_0xb76762[_0xa36d('0x50')]({'plain':!![]});return _0x208991[_0xa36d('0x6b')];});return db[_0xa36d('0x31')][_0xa36d('0x4c')]({'where':{'id':_0x3e8f8e[_0xa36d('0x4b')]['id']}})['then'](function(_0x460e04){return db[_0xa36d('0x6f')][_0xa36d('0x70')](function(_0x384e41){return _0x460e04[_0xa36d('0x69')](_0x47d2ff,{'transaction':_0x384e41})[_0xa36d('0x2a')](function(){return BPromise[_0xa36d('0x71')](_0x2f5893,function(_0x411a2a){return db[_0xa36d('0x5a')][_0xa36d('0x72')]({'where':{'UserId':_0x411a2a['id'],'FaxQueueId':_0x3e8f8e[_0xa36d('0x4b')]['id']},'transaction':_0x384e41});});})[_0xa36d('0x2a')](function(){_0x2f5893[_0xa36d('0x73')](function(_0x54c097){socket['emit'](_0xa36d('0x74'),{'UserId':_0x54c097['id'],'FaxQueueId':_0x460e04['id']});});});});});}})['then'](respondWithStatusCode(_0x47f8e0,null))[_0xa36d('0x49')](handleError(_0x47f8e0,null));};exports[_0xa36d('0x75')]=function(_0x3a8308,_0xccc0d6,_0x2fff3c){return db[_0xa36d('0x67')][_0xa36d('0x5c')]({'where':{'id':_0x3a8308['query'][_0xa36d('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xa36d('0x5d')],'as':_0xa36d('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xa36d('0x2a')](handleEntityNotFound(_0xccc0d6,null))[_0xa36d('0x2a')](function(_0x104117){var _0x2b8911=_[_0xa36d('0x30')](_0x104117,'id');var _0x2e1e33=[];var _0x3e3c30=[];var _0xa51437=squel[_0xa36d('0x76')]();_0xa51437[_0xa36d('0x77')](_0xa36d('0x78'))['from'](_0xa36d('0x79'),'tq')[_0xa36d('0x7a')](_0xa36d('0x7b'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa36d('0x7c'),_0x3a8308['params']['id']);for(var _0x202822=0x0;_0x202822<_0x104117[_0xa36d('0x3c')];_0x202822+=0x1){let _0x35f89d=_0x104117[_0x202822];for(var _0xe4a0da=0x0;_0xe4a0da<_0x35f89d['Agents']['length'];_0xe4a0da+=0x1){let _0x14a8cd=_0x35f89d[_0xa36d('0x6b')][_0xe4a0da];var _0x417111=_0xa51437[_0xa36d('0x7d')]();_0x417111[_0xa36d('0x42')](_0xa36d('0x7e'),_0x14a8cd['id']);_0x3e3c30[_0xa36d('0x7f')](db[_0xa36d('0x6f')][_0xa36d('0x36')](_0x417111[_0xa36d('0x80')](),{'type':db[_0xa36d('0x6f')][_0xa36d('0x81')][_0xa36d('0x82')]})[_0xa36d('0x2a')](function(_0x21fbca){if(_0x21fbca[_0xa36d('0x3c')]===0x1){return _0x14a8cd['id'];}else{var _0x3a0b69=_['every'](_[_0xa36d('0x30')](_0x21fbca,_0xa36d('0x83')),function(_0x58269){return _[_0xa36d('0x84')](_0x2b8911,_0x58269);});if(_0x3a0b69){return _0x14a8cd['id'];}}}));}}return BPromise['all'](_0x3e3c30)[_0xa36d('0x2a')](function(_0x36fec8){_0x2e1e33=_(_0x2e1e33)['union'](_0x36fec8)[_0xa36d('0x85')]()[_0xa36d('0x86')]();return db[_0xa36d('0x31')][_0xa36d('0x4c')]({'where':{'id':_0x3a8308[_0xa36d('0x4b')]['id']}})[_0xa36d('0x2a')](function(_0x437273){return db[_0xa36d('0x6f')][_0xa36d('0x70')](function(_0x2c6d13){return _0x437273['removeTeams'](_0x3a8308['query'][_0xa36d('0x6a')],{'transaction':_0x2c6d13})[_0xa36d('0x2a')](function(){if(!_['isEmpty'](_0x2e1e33)){return _0x437273[_0xa36d('0x87')](_0x2e1e33,{'transaction':_0x2c6d13});}})[_0xa36d('0x2a')](function(){_0x2e1e33[_0xa36d('0x73')](function(_0x64ed6){socket[_0xa36d('0x88')](_0xa36d('0x89'),{'UserId':_0x64ed6,'FaxQueueId':_0x437273['id']});});});});});});})['then'](respondWithStatusCode(_0xccc0d6,null))[_0xa36d('0x49')](handleError(_0xccc0d6,null));};exports['addAgents']=function(_0x2fae53,_0x26661c,_0x29a521){return db[_0xa36d('0x31')][_0xa36d('0x4c')]({'where':{'id':_0x2fae53[_0xa36d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26661c,null))[_0xa36d('0x2a')](function(_0x2abb9c){if(_0x2abb9c){return _0x2abb9c['addAgents'](_0x2fae53['body'][_0xa36d('0x6a')],_[_0xa36d('0x8a')](_0x2fae53[_0xa36d('0x4e')],[_0xa36d('0x6a'),'id'])||{})['spread'](function(_0x2ce82c){for(var _0x1af61a=0x0;_0x1af61a<_0x2fae53[_0xa36d('0x4e')][_0xa36d('0x6a')][_0xa36d('0x3c')];_0x1af61a+=0x1){socket['emit'](_0xa36d('0x74'),{'UserId':Number(_0x2fae53[_0xa36d('0x4e')][_0xa36d('0x6a')][_0x1af61a]),'FaxQueueId':Number(_0x2fae53[_0xa36d('0x4b')]['id'])});}return _0x2ce82c;});}})['then'](respondWithResult(_0x26661c,null))[_0xa36d('0x49')](handleError(_0x26661c,null));};exports[_0xa36d('0x87')]=function(_0x5d0edf,_0x594b0a,_0x4ade82){return db[_0xa36d('0x31')][_0xa36d('0x4c')]({'where':{'id':_0x5d0edf[_0xa36d('0x4b')]['id']}})[_0xa36d('0x2a')](handleEntityNotFound(_0x594b0a,null))['then'](function(_0x4a0e70){if(_0x4a0e70){return _0x4a0e70[_0xa36d('0x87')](_0x5d0edf[_0xa36d('0x36')][_0xa36d('0x6a')])[_0xa36d('0x2a')](function(){if(_['isArray'](_0x5d0edf[_0xa36d('0x36')][_0xa36d('0x6a')])){for(var _0x2b7266=0x0;_0x2b7266<_0x5d0edf[_0xa36d('0x36')][_0xa36d('0x6a')][_0xa36d('0x3c')];_0x2b7266+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x5d0edf[_0xa36d('0x36')][_0xa36d('0x6a')][_0x2b7266]),'FaxQueueId':Number(_0x5d0edf[_0xa36d('0x4b')]['id'])});}}else{socket[_0xa36d('0x88')](_0xa36d('0x89'),{'UserId':Number(_0x5d0edf[_0xa36d('0x36')]['ids']),'FaxQueueId':Number(_0x5d0edf[_0xa36d('0x4b')]['id'])});}});}})[_0xa36d('0x2a')](respondWithStatusCode(_0x594b0a,null))['catch'](handleError(_0x594b0a,null));};exports[_0xa36d('0x8b')]=function(_0x358799,_0x5eb8fe,_0x17f049){var _0x2f054a={};var _0x190793={};var _0xcf9e32;var _0x5b4572;return db[_0xa36d('0x31')][_0xa36d('0x59')]({'where':{'id':_0x358799[_0xa36d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5eb8fe,null))[_0xa36d('0x2a')](function(_0x451b84){if(_0x451b84){_0xcf9e32=_0x451b84;_0x190793['model']=_[_0xa36d('0x37')](db[_0xa36d('0x5d')]['rawAttributes']);_0x190793[_0xa36d('0x36')]=_[_0xa36d('0x37')](_0x358799['query']);_0x190793['filters']=_['intersection'](_0x190793[_0xa36d('0x35')],_0x190793[_0xa36d('0x36')]);_0x2f054a[_0xa36d('0x3a')]=_['intersection'](_0x190793[_0xa36d('0x35')],qs[_0xa36d('0x3b')](_0x358799[_0xa36d('0x36')]['fields']));_0x2f054a['attributes']=_0x2f054a[_0xa36d('0x3a')][_0xa36d('0x3c')]?_0x2f054a[_0xa36d('0x3a')]:_0x190793[_0xa36d('0x35')];_0x2f054a[_0xa36d('0x68')]=qs[_0xa36d('0x3f')](_0x358799[_0xa36d('0x36')]['sort']);_0x2f054a[_0xa36d('0x42')]=qs['filters'](_[_0xa36d('0x40')](_0x358799[_0xa36d('0x36')],_0x190793['filters']));if(_0x358799[_0xa36d('0x36')][_0xa36d('0x41')]){_0x2f054a[_0xa36d('0x42')]=_[_0xa36d('0x44')](_0x2f054a[_0xa36d('0x42')],{'$or':_[_0xa36d('0x30')](_0x2f054a[_0xa36d('0x3a')],function(_0x488771){var _0x4f8b5e={};_0x4f8b5e[_0x488771]={'$like':'%'+_0x358799[_0xa36d('0x36')][_0xa36d('0x41')]+'%'};return _0x4f8b5e;})});}_0x2f054a=_[_0xa36d('0x44')]({},_0x2f054a,_0x358799[_0xa36d('0x45')]);return _0xcf9e32[_0xa36d('0x8b')](_0x2f054a);}})[_0xa36d('0x2a')](function(_0x2f3852){if(_0x2f3852){_0x5b4572=_0x2f3852[_0xa36d('0x3c')];if(!_0x358799[_0xa36d('0x36')][_0xa36d('0x3d')]('nolimit')){_0x2f054a[_0xa36d('0x24')]=qs[_0xa36d('0x24')](_0x358799['query']['limit']);_0x2f054a[_0xa36d('0x21')]=qs['offset'](_0x358799[_0xa36d('0x36')][_0xa36d('0x21')]);}return _0xcf9e32[_0xa36d('0x8b')](_0x2f054a);}})['then'](function(_0x3461fe){if(_0x3461fe){return _0x3461fe?{'count':_0x5b4572,'rows':_0x3461fe}:null;}})[_0xa36d('0x2a')](respondWithResult(_0x5eb8fe,null))[_0xa36d('0x49')](handleError(_0x5eb8fe,null));}; \ No newline at end of file +var _0xab00=['ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','getAgents','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./faxQueue.socket','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','FaxQueue','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','findAll','catch','rawAttributes','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserFaxQueue','order','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone'];(function(_0x5605ed,_0x55fc17){var _0x166563=function(_0xcf7b6c){while(--_0xcf7b6c){_0x5605ed['push'](_0x5605ed['shift']());}};_0x166563(++_0x55fc17);}(_0xab00,0x98));var _0x0ab0=function(_0x25b6ac,_0x61b3d8){_0x25b6ac=_0x25b6ac-0x0;var _0x5dedb1=_0xab00[_0x25b6ac];return _0x5dedb1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0ab0('0x0'));var rp=require('request-promise');var moment=require(_0x0ab0('0x1'));var BPromise=require(_0x0ab0('0x2'));var Mustache=require(_0x0ab0('0x3'));var util=require(_0x0ab0('0x4'));var path=require(_0x0ab0('0x5'));var sox=require(_0x0ab0('0x6'));var csv=require(_0x0ab0('0x7'));var ejs=require(_0x0ab0('0x8'));var fs=require('fs');var fs_extra=require(_0x0ab0('0x9'));var _=require(_0x0ab0('0xa'));var squel=require(_0x0ab0('0xb'));var crypto=require(_0x0ab0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0ab0('0xd'));var toCsv=require(_0x0ab0('0x7'));var querystring=require(_0x0ab0('0xe'));var Papa=require(_0x0ab0('0xf'));var Redis=require(_0x0ab0('0x10'));var authService=require(_0x0ab0('0x11'));var qs=require(_0x0ab0('0x12'));var as=require(_0x0ab0('0x13'));var hardwareService=require(_0x0ab0('0x14'));var logger=require('../../config/logger')(_0x0ab0('0x15'));var utils=require('../../config/utils');var config=require(_0x0ab0('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0ab0('0x17')]=_['defaults'](config[_0x0ab0('0x17')],{'host':_0x0ab0('0x18'),'port':0x18eb});var socket=require(_0x0ab0('0x19'))(new Redis(config[_0x0ab0('0x17')]));require(_0x0ab0('0x1a'))['register'](socket);function respondWithStatusCode(_0x1b0a64,_0x572931){_0x572931=_0x572931||0xcc;return function(_0x49f6e8){if(_0x49f6e8){return _0x1b0a64['sendStatus'](_0x572931);}return _0x1b0a64['status'](_0x572931)['end']();};}function respondWithResult(_0x3f50ee,_0x32b815){_0x32b815=_0x32b815||0xc8;return function(_0x5144d5){if(_0x5144d5){return _0x3f50ee[_0x0ab0('0x1b')](_0x32b815)['json'](_0x5144d5);}};}function respondWithFilteredResult(_0x1f6724,_0x3cb311){return function(_0x2af9b0){if(_0x2af9b0){var _0xfea88b=typeof _0x3cb311[_0x0ab0('0x1c')]==='undefined'&&typeof _0x3cb311[_0x0ab0('0x1d')]==='undefined';var _0x33caf7=_0x2af9b0['count'];var _0x464a0e=_0xfea88b?0x0:_0x3cb311[_0x0ab0('0x1c')];var _0x2f0f8c=_0xfea88b?_0x2af9b0['count']:_0x3cb311[_0x0ab0('0x1c')]+_0x3cb311['limit'];var _0x378b00;if(_0x2f0f8c>=_0x33caf7){_0x2f0f8c=_0x33caf7;_0x378b00=0xc8;}else{_0x378b00=0xce;}_0x1f6724['status'](_0x378b00);return _0x1f6724[_0x0ab0('0x1e')](_0x0ab0('0x1f'),_0x464a0e+'-'+_0x2f0f8c+'/'+_0x33caf7)[_0x0ab0('0x20')](_0x2af9b0);}return null;};}function patchUpdates(_0x4a6d69){return function(_0x1aa60f){try{jsonpatch[_0x0ab0('0x21')](_0x1aa60f,_0x4a6d69,!![]);}catch(_0x467d00){return BPromise[_0x0ab0('0x22')](_0x467d00);}return _0x1aa60f[_0x0ab0('0x23')]();};}function saveUpdates(_0x1e00a4,_0x52de87){return function(_0x38acab){if(_0x38acab){return _0x38acab[_0x0ab0('0x24')](_0x1e00a4)[_0x0ab0('0x25')](function(_0x3610cd){return _0x3610cd;});}return null;};}function removeEntity(_0xa990e1,_0x584574){return function(_0x57750c){if(_0x57750c){return _0x57750c[_0x0ab0('0x26')]()[_0x0ab0('0x25')](function(){var _0x35ed7c=_0x57750c[_0x0ab0('0x27')]({'plain':!![]});var _0x9ff681=_0x0ab0('0x28');return db[_0x0ab0('0x29')][_0x0ab0('0x26')]({'where':{'type':_0x9ff681,'resourceId':_0x35ed7c['id']}})['then'](function(){return _0x57750c;});})[_0x0ab0('0x25')](function(){_0xa990e1['status'](0xcc)[_0x0ab0('0x2a')]();});}};}function handleEntityNotFound(_0x512bbb,_0x254014){return function(_0x1b3ad7){if(!_0x1b3ad7){_0x512bbb[_0x0ab0('0x2b')](0x194);}return _0x1b3ad7;};}function handleError(_0x519d3c,_0x5bc300){_0x5bc300=_0x5bc300||0x1f4;return function(_0x5a679a){logger[_0x0ab0('0x2c')](_0x5a679a[_0x0ab0('0x2d')]);if(_0x5a679a['name']){delete _0x5a679a[_0x0ab0('0x2e')];}_0x519d3c[_0x0ab0('0x1b')](_0x5bc300)[_0x0ab0('0x2f')](_0x5a679a);};}exports[_0x0ab0('0x30')]=function(_0x57bbcf,_0x115647){var _0x33127c={},_0x30aeab={},_0x1fe85a={'count':0x0,'rows':[]};var _0x311a7b=_[_0x0ab0('0x31')](db[_0x0ab0('0x32')]['rawAttributes'],function(_0x2157ad){return{'name':_0x2157ad['fieldName'],'type':_0x2157ad[_0x0ab0('0x33')]['key']};});_0x30aeab[_0x0ab0('0x34')]=_[_0x0ab0('0x31')](_0x311a7b,_0x0ab0('0x2e'));_0x30aeab[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0x57bbcf[_0x0ab0('0x35')]);_0x30aeab[_0x0ab0('0x37')]=_['intersection'](_0x30aeab[_0x0ab0('0x34')],_0x30aeab[_0x0ab0('0x35')]);_0x33127c['attributes']=_[_0x0ab0('0x38')](_0x30aeab[_0x0ab0('0x34')],qs['fields'](_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x33127c[_0x0ab0('0x3a')]=_0x33127c[_0x0ab0('0x3a')][_0x0ab0('0x3b')]?_0x33127c[_0x0ab0('0x3a')]:_0x30aeab[_0x0ab0('0x34')];if(!_0x57bbcf['query'][_0x0ab0('0x3c')](_0x0ab0('0x3d'))){_0x33127c[_0x0ab0('0x1d')]=qs[_0x0ab0('0x1d')](_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x1d')]);_0x33127c[_0x0ab0('0x1c')]=qs['offset'](_0x57bbcf[_0x0ab0('0x35')]['offset']);}_0x33127c['order']=qs['sort'](_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x33127c[_0x0ab0('0x3f')]=qs[_0x0ab0('0x37')](_[_0x0ab0('0x40')](_0x57bbcf[_0x0ab0('0x35')],_0x30aeab['filters']),_0x311a7b);if(_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x41')]){_0x33127c[_0x0ab0('0x3f')]=_['merge'](_0x33127c[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x311a7b,function(_0x1c4434){if(_0x1c4434[_0x0ab0('0x33')]!=='VIRTUAL'){var _0x1e1e8f={};_0x1e1e8f[_0x1c4434[_0x0ab0('0x2e')]]={'$like':'%'+_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0x1e1e8f;}})});}_0x33127c=_[_0x0ab0('0x42')]({},_0x33127c,_0x57bbcf[_0x0ab0('0x43')]);var _0x5e59a4={'where':_0x33127c[_0x0ab0('0x3f')]};return db[_0x0ab0('0x32')][_0x0ab0('0x44')](_0x5e59a4)[_0x0ab0('0x25')](function(_0x5ecb20){_0x1fe85a[_0x0ab0('0x44')]=_0x5ecb20;if(_0x57bbcf[_0x0ab0('0x35')][_0x0ab0('0x45')]){_0x33127c['include']=[{'all':!![]}];}return db[_0x0ab0('0x32')][_0x0ab0('0x46')](_0x33127c);})[_0x0ab0('0x25')](function(_0x48e471){_0x1fe85a['rows']=_0x48e471;return _0x1fe85a;})[_0x0ab0('0x25')](respondWithFilteredResult(_0x115647,_0x33127c))[_0x0ab0('0x47')](handleError(_0x115647,null));};exports['show']=function(_0x4e3d67,_0x11bfcb){var _0x3b200d={'raw':!![],'where':{'id':_0x4e3d67['params']['id']}},_0x22c2c3={};_0x22c2c3['model']=_['keys'](db['FaxQueue'][_0x0ab0('0x48')]);_0x22c2c3[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0x4e3d67[_0x0ab0('0x35')]);_0x22c2c3[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x22c2c3[_0x0ab0('0x34')],_0x22c2c3[_0x0ab0('0x35')]);_0x3b200d[_0x0ab0('0x3a')]=_[_0x0ab0('0x38')](_0x22c2c3['model'],qs[_0x0ab0('0x39')](_0x4e3d67[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x3b200d[_0x0ab0('0x3a')]=_0x3b200d[_0x0ab0('0x3a')][_0x0ab0('0x3b')]?_0x3b200d[_0x0ab0('0x3a')]:_0x22c2c3['model'];if(_0x4e3d67[_0x0ab0('0x35')][_0x0ab0('0x45')]){_0x3b200d['include']=[{'all':!![]}];}_0x3b200d=_[_0x0ab0('0x42')]({},_0x3b200d,_0x4e3d67[_0x0ab0('0x43')]);return db[_0x0ab0('0x32')][_0x0ab0('0x49')](_0x3b200d)[_0x0ab0('0x25')](handleEntityNotFound(_0x11bfcb,null))[_0x0ab0('0x25')](respondWithResult(_0x11bfcb,null))['catch'](handleError(_0x11bfcb,null));};exports[_0x0ab0('0x4a')]=function(_0x4fda6e,_0x268282){return db[_0x0ab0('0x32')][_0x0ab0('0x4a')](_0x4fda6e['body'],{})[_0x0ab0('0x25')](function(_0x2c115b){var _0x32bd5e=_0x4fda6e[_0x0ab0('0x4b')][_0x0ab0('0x27')]({'plain':!![]});if(!_0x32bd5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32bd5e[_0x0ab0('0x4c')]===_0x0ab0('0x4b')){var _0x2bcf25=_0x2c115b[_0x0ab0('0x27')]({'plain':!![]});var _0x359de4=_0x0ab0('0x28');return db[_0x0ab0('0x4d')][_0x0ab0('0x49')]({'where':{'name':_0x359de4,'userProfileId':_0x32bd5e[_0x0ab0('0x4e')]},'raw':!![]})[_0x0ab0('0x25')](function(_0x4621c2){if(_0x4621c2&&_0x4621c2[_0x0ab0('0x4f')]===0x0){return db[_0x0ab0('0x29')][_0x0ab0('0x4a')]({'name':_0x2bcf25[_0x0ab0('0x2e')],'resourceId':_0x2bcf25['id'],'type':_0x4621c2['name'],'sectionId':_0x4621c2['id']},{})[_0x0ab0('0x25')](function(){return _0x2c115b;});}else{return _0x2c115b;}})[_0x0ab0('0x47')](function(_0xbdd28){logger[_0x0ab0('0x2c')](_0x0ab0('0x50'),_0xbdd28);throw _0xbdd28;});}return _0x2c115b;})[_0x0ab0('0x25')](respondWithResult(_0x268282,0xc9))['catch'](handleError(_0x268282,null));};exports[_0x0ab0('0x24')]=function(_0x30913d,_0x425e7f){if(_0x30913d[_0x0ab0('0x51')]['id']){delete _0x30913d[_0x0ab0('0x51')]['id'];}return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x30913d[_0x0ab0('0x52')]['id']}})['then'](handleEntityNotFound(_0x425e7f,null))[_0x0ab0('0x25')](saveUpdates(_0x30913d[_0x0ab0('0x51')],null))[_0x0ab0('0x25')](respondWithResult(_0x425e7f,null))[_0x0ab0('0x47')](handleError(_0x425e7f,null));};exports[_0x0ab0('0x26')]=function(_0x117661,_0x5666a5){return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x117661[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x5666a5,null))['then'](removeEntity(_0x5666a5,null))[_0x0ab0('0x47')](handleError(_0x5666a5,null));};exports[_0x0ab0('0x53')]=function(_0x4eee3f,_0x111f9d){return db[_0x0ab0('0x32')][_0x0ab0('0x53')]()[_0x0ab0('0x25')](respondWithResult(_0x111f9d,null))['catch'](handleError(_0x111f9d,null));};exports[_0x0ab0('0x54')]=function(_0xb04d46,_0x171f2f,_0x494c22){var _0x15948={'raw':!![],'where':{}},_0x198042={},_0x1317e5;return db[_0x0ab0('0x32')][_0x0ab0('0x55')]({'where':{'id':_0xb04d46[_0x0ab0('0x52')]['id']}})['then'](handleEntityNotFound(_0x171f2f,null))[_0x0ab0('0x25')](function(_0x11006e){if(_0x11006e){_0x1317e5=_0x11006e[_0x0ab0('0x27')]({'plain':!![]});_0x198042['model']=_['keys'](db[_0x0ab0('0x56')]['rawAttributes']);_0x198042[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0xb04d46[_0x0ab0('0x35')]);_0x198042[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x198042[_0x0ab0('0x34')],_0x198042[_0x0ab0('0x35')]);_0x15948['attributes']=_[_0x0ab0('0x38')](_0x198042['model'],qs[_0x0ab0('0x39')](_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x15948[_0x0ab0('0x3a')]=_0x15948['attributes'][_0x0ab0('0x3b')]?_0x15948[_0x0ab0('0x3a')]:_0x198042[_0x0ab0('0x34')];if(!_0xb04d46['query'][_0x0ab0('0x3c')](_0x0ab0('0x3d'))){_0x15948['limit']=qs[_0x0ab0('0x1d')](_0xb04d46[_0x0ab0('0x35')]['limit']);_0x15948[_0x0ab0('0x1c')]=qs['offset'](_0xb04d46[_0x0ab0('0x35')]['offset']);}_0x15948[_0x0ab0('0x57')]=qs['sort'](_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x15948[_0x0ab0('0x3f')]=qs[_0x0ab0('0x37')](_[_0x0ab0('0x40')](_0xb04d46['query'],_0x198042[_0x0ab0('0x37')]));_0x15948[_0x0ab0('0x3f')][_0x0ab0('0x58')]=_0x11006e['id'];if(_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x41')]){_0x15948[_0x0ab0('0x3f')]=_[_0x0ab0('0x42')](_0x15948[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x15948[_0x0ab0('0x3a')],function(_0x56c1b4){var _0xbbd896={};_0xbbd896[_0x56c1b4]={'$like':'%'+_0xb04d46[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0xbbd896;})});}_0x15948=_[_0x0ab0('0x42')]({},_0x15948,_0xb04d46[_0x0ab0('0x43')]);return db[_0x0ab0('0x56')][_0x0ab0('0x46')](_0x15948);}})['then'](function(_0x437081){if(_0x437081){return db['User'][_0x0ab0('0x59')]({'where':{'id':_[_0x0ab0('0x31')](_0x437081,_0x0ab0('0x5a')),'role':_0x0ab0('0x5b')},'attributes':['id',_0x0ab0('0x2e'),_0x0ab0('0x5c'),_0x0ab0('0x5d'),_0x0ab0('0x5e')]});}})[_0x0ab0('0x25')](function(_0x2a00d6){if(_0x2a00d6){return{'count':_0x2a00d6[_0x0ab0('0x44')],'rows':_[_0x0ab0('0x31')](_0x2a00d6['rows'],function(_0x58951d){return{'membername':_0x58951d[_0x0ab0('0x2e')],'UserId':_0x58951d['id'],'queue_name':_0x1317e5[_0x0ab0('0x2e')],'FaxQueueId':_0x1317e5['id'],'interface':util['format']('%s/%s',_0x0ab0('0x5f'),_0x58951d[_0x0ab0('0x2e')]),'penalty':0x0,'paused':_0x58951d[_0x0ab0('0x5c')],'createdAt':_0x58951d[_0x0ab0('0x5e')],'updatedAt':_0x58951d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ab0('0x25')](respondWithFilteredResult(_0x171f2f,_0x15948))[_0x0ab0('0x47')](handleError(_0x171f2f,null));};exports[_0x0ab0('0x60')]=function(_0x33c27f,_0x518bd2,_0x442b87){var _0x44ad4f={};var _0x1c8f09={};var _0x38b480;var _0xbed607;return db[_0x0ab0('0x32')][_0x0ab0('0x55')]({'where':{'id':_0x33c27f[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x518bd2,null))[_0x0ab0('0x25')](function(_0x5e7062){if(_0x5e7062){_0x38b480=_0x5e7062;_0x1c8f09['model']=_[_0x0ab0('0x36')](db['Team'][_0x0ab0('0x48')]);_0x1c8f09[_0x0ab0('0x35')]=_[_0x0ab0('0x36')](_0x33c27f[_0x0ab0('0x35')]);_0x1c8f09[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x1c8f09['model'],_0x1c8f09[_0x0ab0('0x35')]);_0x44ad4f[_0x0ab0('0x3a')]=_[_0x0ab0('0x38')](_0x1c8f09[_0x0ab0('0x34')],qs[_0x0ab0('0x39')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x39')]));_0x44ad4f[_0x0ab0('0x3a')]=_0x44ad4f[_0x0ab0('0x3a')][_0x0ab0('0x3b')]?_0x44ad4f['attributes']:_0x1c8f09[_0x0ab0('0x34')];_0x44ad4f[_0x0ab0('0x57')]=qs[_0x0ab0('0x3e')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x44ad4f[_0x0ab0('0x3f')]=qs['filters'](_['pick'](_0x33c27f[_0x0ab0('0x35')],_0x1c8f09['filters']));if(_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x41')]){_0x44ad4f[_0x0ab0('0x3f')]=_[_0x0ab0('0x42')](_0x44ad4f[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x44ad4f[_0x0ab0('0x3a')],function(_0x3bab0a){var _0x236798={};_0x236798[_0x3bab0a]={'$like':'%'+_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0x236798;})});}_0x44ad4f=_['merge']({},_0x44ad4f,_0x33c27f[_0x0ab0('0x43')]);return _0x38b480[_0x0ab0('0x60')](_0x44ad4f);}})[_0x0ab0('0x25')](function(_0x2f40f2){if(_0x2f40f2){_0xbed607=_0x2f40f2[_0x0ab0('0x3b')];if(!_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x3c')]('nolimit')){_0x44ad4f['limit']=qs[_0x0ab0('0x1d')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x1d')]);_0x44ad4f[_0x0ab0('0x1c')]=qs[_0x0ab0('0x1c')](_0x33c27f[_0x0ab0('0x35')][_0x0ab0('0x1c')]);}return _0x38b480['getTeams'](_0x44ad4f);}})[_0x0ab0('0x25')](function(_0x3f757b){if(_0x3f757b){return _0x3f757b?{'count':_0xbed607,'rows':_0x3f757b}:null;}})['then'](respondWithResult(_0x518bd2,null))[_0x0ab0('0x47')](handleError(_0x518bd2,null));};exports[_0x0ab0('0x61')]=function(_0x71c3f,_0x169b39,_0x1697ae){var _0x438905=_0x71c3f[_0x0ab0('0x51')][_0x0ab0('0x62')];return db[_0x0ab0('0x63')][_0x0ab0('0x46')]({'where':{'id':_0x438905},'attributes':['id'],'include':[{'model':db[_0x0ab0('0x64')],'as':_0x0ab0('0x65'),'attributes':['id',_0x0ab0('0x2e'),_0x0ab0('0x66'),_0x0ab0('0x67'),'interface'],'raw':!![]}]})[_0x0ab0('0x25')](function(_0x533be0){if(_0x533be0){var _0x4ad5fd=_[_0x0ab0('0x68')](_0x533be0,function(_0x3baf83){var _0x10ba1e=_0x3baf83['get']({'plain':!![]});return _0x10ba1e[_0x0ab0('0x65')];});return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x71c3f['params']['id']}})[_0x0ab0('0x25')](function(_0x2199f2){return db[_0x0ab0('0x69')][_0x0ab0('0x6a')](function(_0x522791){return _0x2199f2[_0x0ab0('0x61')](_0x438905,{'transaction':_0x522791})['then'](function(){return BPromise[_0x0ab0('0x6b')](_0x4ad5fd,function(_0x25ac73){return db[_0x0ab0('0x56')][_0x0ab0('0x6c')]({'where':{'UserId':_0x25ac73['id'],'FaxQueueId':_0x71c3f[_0x0ab0('0x52')]['id']},'transaction':_0x522791});});})[_0x0ab0('0x25')](function(){_0x4ad5fd[_0x0ab0('0x6d')](function(_0x5e4375){socket[_0x0ab0('0x6e')](_0x0ab0('0x6f'),{'UserId':_0x5e4375['id'],'FaxQueueId':_0x2199f2['id']});});});});});}})[_0x0ab0('0x25')](respondWithStatusCode(_0x169b39,null))[_0x0ab0('0x47')](handleError(_0x169b39,null));};exports['removeTeams']=function(_0x4801a2,_0x23a197,_0x25eddf){return db[_0x0ab0('0x63')]['findAll']({'where':{'id':_0x4801a2[_0x0ab0('0x35')][_0x0ab0('0x62')]},'attributes':['id'],'include':[{'model':db[_0x0ab0('0x64')],'as':_0x0ab0('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x23a197,null))[_0x0ab0('0x25')](function(_0x577c6d){var _0x408f8d=_['map'](_0x577c6d,'id');var _0x2f5a32=[];var _0x5bf586=[];var _0x3010d4=squel['select']();_0x3010d4[_0x0ab0('0x70')](_0x0ab0('0x71'))['from']('team_has_fax_queues','tq')['join'](_0x0ab0('0x72'),'ut',_0x0ab0('0x73'))['where'](_0x0ab0('0x74'),_0x4801a2[_0x0ab0('0x52')]['id']);for(var _0x17b4a4=0x0;_0x17b4a4<_0x577c6d[_0x0ab0('0x3b')];_0x17b4a4+=0x1){let _0x1aff04=_0x577c6d[_0x17b4a4];for(var _0x37e42a=0x0;_0x37e42a<_0x1aff04['Agents'][_0x0ab0('0x3b')];_0x37e42a+=0x1){let _0x16557e=_0x1aff04[_0x0ab0('0x65')][_0x37e42a];var _0x34b1ea=_0x3010d4[_0x0ab0('0x75')]();_0x34b1ea[_0x0ab0('0x3f')](_0x0ab0('0x76'),_0x16557e['id']);_0x5bf586[_0x0ab0('0x77')](db[_0x0ab0('0x69')]['query'](_0x34b1ea[_0x0ab0('0x78')](),{'type':db[_0x0ab0('0x69')][_0x0ab0('0x79')][_0x0ab0('0x7a')]})['then'](function(_0x2d8823){if(_0x2d8823[_0x0ab0('0x3b')]===0x1){return _0x16557e['id'];}else{var _0x1dc2f4=_[_0x0ab0('0x7b')](_[_0x0ab0('0x31')](_0x2d8823,_0x0ab0('0x7c')),function(_0x44555e){return _[_0x0ab0('0x7d')](_0x408f8d,_0x44555e);});if(_0x1dc2f4){return _0x16557e['id'];}}}));}}return BPromise['all'](_0x5bf586)[_0x0ab0('0x25')](function(_0x51fa74){_0x2f5a32=_(_0x2f5a32)['union'](_0x51fa74)['compact']()[_0x0ab0('0x7e')]();return db[_0x0ab0('0x32')]['find']({'where':{'id':_0x4801a2[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](function(_0x38818c){return db[_0x0ab0('0x69')][_0x0ab0('0x6a')](function(_0xd28695){return _0x38818c[_0x0ab0('0x7f')](_0x4801a2[_0x0ab0('0x35')][_0x0ab0('0x62')],{'transaction':_0xd28695})[_0x0ab0('0x25')](function(){if(!_[_0x0ab0('0x80')](_0x2f5a32)){return _0x38818c[_0x0ab0('0x81')](_0x2f5a32,{'transaction':_0xd28695});}})['then'](function(){_0x2f5a32[_0x0ab0('0x6d')](function(_0x129fb0){socket['emit'](_0x0ab0('0x82'),{'UserId':_0x129fb0,'FaxQueueId':_0x38818c['id']});});});});});});})[_0x0ab0('0x25')](respondWithStatusCode(_0x23a197,null))[_0x0ab0('0x47')](handleError(_0x23a197,null));};exports['addAgents']=function(_0x235f3d,_0x3ee578,_0x139378){return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x235f3d[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x3ee578,null))[_0x0ab0('0x25')](function(_0x1836bb){if(_0x1836bb){return _0x1836bb[_0x0ab0('0x83')](_0x235f3d[_0x0ab0('0x51')][_0x0ab0('0x62')],_[_0x0ab0('0x84')](_0x235f3d[_0x0ab0('0x51')],[_0x0ab0('0x62'),'id'])||{})[_0x0ab0('0x85')](function(_0x23bf08){for(var _0x499b4d=0x0;_0x499b4d<_0x235f3d['body']['ids'][_0x0ab0('0x3b')];_0x499b4d+=0x1){socket[_0x0ab0('0x6e')]('userFaxQueue:save',{'UserId':Number(_0x235f3d[_0x0ab0('0x51')][_0x0ab0('0x62')][_0x499b4d]),'FaxQueueId':Number(_0x235f3d[_0x0ab0('0x52')]['id'])});}return _0x23bf08;});}})[_0x0ab0('0x25')](respondWithResult(_0x3ee578,null))[_0x0ab0('0x47')](handleError(_0x3ee578,null));};exports[_0x0ab0('0x81')]=function(_0x29e874,_0x4e91ea,_0x7eeb4c){return db[_0x0ab0('0x32')][_0x0ab0('0x49')]({'where':{'id':_0x29e874[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x4e91ea,null))[_0x0ab0('0x25')](function(_0x267eb4){if(_0x267eb4){return _0x267eb4['removeAgents'](_0x29e874['query'][_0x0ab0('0x62')])['then'](function(){if(_['isArray'](_0x29e874[_0x0ab0('0x35')]['ids'])){for(var _0x42589e=0x0;_0x42589e<_0x29e874[_0x0ab0('0x35')][_0x0ab0('0x62')]['length'];_0x42589e+=0x1){socket[_0x0ab0('0x6e')](_0x0ab0('0x82'),{'UserId':Number(_0x29e874[_0x0ab0('0x35')][_0x0ab0('0x62')][_0x42589e]),'FaxQueueId':Number(_0x29e874[_0x0ab0('0x52')]['id'])});}}else{socket[_0x0ab0('0x6e')](_0x0ab0('0x82'),{'UserId':Number(_0x29e874[_0x0ab0('0x35')][_0x0ab0('0x62')]),'FaxQueueId':Number(_0x29e874[_0x0ab0('0x52')]['id'])});}});}})[_0x0ab0('0x25')](respondWithStatusCode(_0x4e91ea,null))['catch'](handleError(_0x4e91ea,null));};exports[_0x0ab0('0x86')]=function(_0x49c5f4,_0x30f59f,_0x493b62){var _0x2d0210={};var _0x1e8fde={};var _0x138a5;var _0x569be3;return db['FaxQueue'][_0x0ab0('0x55')]({'where':{'id':_0x49c5f4[_0x0ab0('0x52')]['id']}})[_0x0ab0('0x25')](handleEntityNotFound(_0x30f59f,null))[_0x0ab0('0x25')](function(_0x2397b6){if(_0x2397b6){_0x138a5=_0x2397b6;_0x1e8fde['model']=_['keys'](db['User'][_0x0ab0('0x48')]);_0x1e8fde[_0x0ab0('0x35')]=_['keys'](_0x49c5f4[_0x0ab0('0x35')]);_0x1e8fde[_0x0ab0('0x37')]=_[_0x0ab0('0x38')](_0x1e8fde[_0x0ab0('0x34')],_0x1e8fde[_0x0ab0('0x35')]);_0x2d0210[_0x0ab0('0x3a')]=_[_0x0ab0('0x38')](_0x1e8fde[_0x0ab0('0x34')],qs[_0x0ab0('0x39')](_0x49c5f4[_0x0ab0('0x35')]['fields']));_0x2d0210[_0x0ab0('0x3a')]=_0x2d0210['attributes'][_0x0ab0('0x3b')]?_0x2d0210[_0x0ab0('0x3a')]:_0x1e8fde[_0x0ab0('0x34')];_0x2d0210[_0x0ab0('0x57')]=qs[_0x0ab0('0x3e')](_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x3e')]);_0x2d0210['where']=qs[_0x0ab0('0x37')](_['pick'](_0x49c5f4['query'],_0x1e8fde[_0x0ab0('0x37')]));if(_0x49c5f4[_0x0ab0('0x35')]['filter']){_0x2d0210['where']=_[_0x0ab0('0x42')](_0x2d0210[_0x0ab0('0x3f')],{'$or':_[_0x0ab0('0x31')](_0x2d0210[_0x0ab0('0x3a')],function(_0x5034e0){var _0x5b48e0={};_0x5b48e0[_0x5034e0]={'$like':'%'+_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x41')]+'%'};return _0x5b48e0;})});}_0x2d0210=_[_0x0ab0('0x42')]({},_0x2d0210,_0x49c5f4[_0x0ab0('0x43')]);return _0x138a5[_0x0ab0('0x86')](_0x2d0210);}})[_0x0ab0('0x25')](function(_0x3ae346){if(_0x3ae346){_0x569be3=_0x3ae346[_0x0ab0('0x3b')];if(!_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x3c')]('nolimit')){_0x2d0210[_0x0ab0('0x1d')]=qs[_0x0ab0('0x1d')](_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x1d')]);_0x2d0210[_0x0ab0('0x1c')]=qs[_0x0ab0('0x1c')](_0x49c5f4[_0x0ab0('0x35')][_0x0ab0('0x1c')]);}return _0x138a5['getAgents'](_0x2d0210);}})[_0x0ab0('0x25')](function(_0x551d17){if(_0x551d17){return _0x551d17?{'count':_0x569be3,'rows':_0x551d17}:null;}})[_0x0ab0('0x25')](respondWithResult(_0x30f59f,null))[_0x0ab0('0x47')](handleError(_0x30f59f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 4d6d381..97c17ed 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 _0x962a=['update','remove','emit','hasOwnProperty','hook','FaxQueue','save'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x962a,0x108));var _0xa962=function(_0x425313,_0x67ab22){_0x425313=_0x425313-0x0;var _0x5b73b9=_0x962a[_0x425313];return _0x5b73b9;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0xa962('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa962('0x1'),'afterUpdate':_0xa962('0x2'),'afterDestroy':_0xa962('0x3')};function emitEvent(_0x594898){return function(_0x28cb52,_0x20e607,_0x4767d9){FaxQueueEvents[_0xa962('0x4')](_0x594898+':'+_0x28cb52['id'],_0x28cb52);FaxQueueEvents['emit'](_0x594898,_0x28cb52);_0x4767d9(null);};}for(var e in events){if(events[_0xa962('0x5')](e)){var event=events[e];FaxQueue[_0xa962('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xe4e8=['setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x348a2b,_0x4a94aa){var _0x504bb1=function(_0x5ec614){while(--_0x5ec614){_0x348a2b['push'](_0x348a2b['shift']());}};_0x504bb1(++_0x4a94aa);}(_0xe4e8,0x14d));var _0x8e4e=function(_0x1c7b72,_0xa118a4){_0x1c7b72=_0x1c7b72-0x0;var _0x3ddd28=_0xe4e8[_0x1c7b72];return _0x3ddd28;};'use strict';var EventEmitter=require(_0x8e4e('0x0'));var FaxQueue=require(_0x8e4e('0x1'))['db'][_0x8e4e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8e4e('0x3')](0x0);var events={'afterCreate':_0x8e4e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x86b2f4){return function(_0x520232,_0x3edf01,_0x270b6a){FaxQueueEvents[_0x8e4e('0x5')](_0x86b2f4+':'+_0x520232['id'],_0x520232);FaxQueueEvents['emit'](_0x86b2f4,_0x520232);_0x270b6a(null);};}for(var e in events){if(events[_0x8e4e('0x6')](e)){var event=events[e];FaxQueue[_0x8e4e('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 37f6ba6..e64259b 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 _0x24ca=['define','FaxQueue','fax_queues','util','moment','bluebird','request-promise','path','../../config/environment','./faxQueue.attributes','exports'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x24ca,0xbe));var _0xa24c=function(_0x354164,_0x4c30de){_0x354164=_0x354164-0x0;var _0x5db9a8=_0x24ca[_0x354164];return _0x5db9a8;};'use strict';var _=require('lodash');var util=require(_0xa24c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var fs=require('fs');var path=require(_0xa24c('0x4'));var rimraf=require('rimraf');var config=require(_0xa24c('0x5'));var attributes=require(_0xa24c('0x6'));module[_0xa24c('0x7')]=function(_0x421bf5,_0x1c1ca7){return _0x421bf5[_0xa24c('0x8')](_0xa24c('0x9'),attributes,{'tableName':_0xa24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7346=['path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1bd92d,_0x5a3707){var _0x628149=function(_0x74e0ef){while(--_0x74e0ef){_0x1bd92d['push'](_0x1bd92d['shift']());}};_0x628149(++_0x5a3707);}(_0x7346,0xc1));var _0x6734=function(_0x4d3a0b,_0x22b4c1){_0x4d3a0b=_0x4d3a0b-0x0;var _0x319e48=_0x7346[_0x4d3a0b];return _0x319e48;};'use strict';var _=require('lodash');var util=require(_0x6734('0x0'));var logger=require(_0x6734('0x1'))(_0x6734('0x2'));var moment=require('moment');var BPromise=require(_0x6734('0x3'));var rp=require(_0x6734('0x4'));var fs=require('fs');var path=require(_0x6734('0x5'));var rimraf=require(_0x6734('0x6'));var config=require('../../config/environment');var attributes=require(_0x6734('0x7'));module[_0x6734('0x8')]=function(_0x5f08e9,_0x1871d5){return _0x5f08e9[_0x6734('0x9')](_0x6734('0xa'),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 827aaac..f33dc83 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 _0x1923=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFaxQueue','findAll','raw','options','where','limit','include','map','model','attributes','ShowFaxQueue','FaxQueue','find','stringify','util'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x1923,0xf5));var _0x3192=function(_0x580017,_0x3d6be8){_0x580017=_0x580017-0x0;var _0x28546a=_0x1923[_0x580017];return _0x28546a;};'use strict';var _=require('lodash');var util=require(_0x3192('0x0'));var moment=require(_0x3192('0x1'));var BPromise=require(_0x3192('0x2'));var rs=require(_0x3192('0x3'));var fs=require('fs');var Redis=require(_0x3192('0x4'));var db=require(_0x3192('0x5'))['db'];var utils=require(_0x3192('0x6'));var logger=require('../../config/logger')(_0x3192('0x7'));var config=require(_0x3192('0x8'));var jayson=require(_0x3192('0x9'));var client=jayson['client'][_0x3192('0xa')]({'port':0x232a});config[_0x3192('0xb')]=_[_0x3192('0xc')](config[_0x3192('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3192('0xd'))(new Redis(config[_0x3192('0xb')]));require(_0x3192('0xe'))[_0x3192('0xf')](socket);function respondWithRpcPromise(_0x420232,_0xcdf7d3,_0x11cbf6){return new BPromise(function(_0x1ac300,_0x3696ea){return client[_0x3192('0x10')](_0x420232,_0x11cbf6)[_0x3192('0x11')](function(_0x32170b){logger[_0x3192('0x12')](_0x3192('0x13'),_0xcdf7d3,_0x3192('0x14'));logger[_0x3192('0x15')](_0x3192('0x16'),_0xcdf7d3,'request\x20sent',JSON['stringify'](_0x32170b));if(_0x32170b[_0x3192('0x17')]){if(_0x32170b['error']['code']===0x1f4){logger[_0x3192('0x17')]('FaxQueue,\x20%s,\x20%s',_0xcdf7d3,_0x32170b['error'][_0x3192('0x18')]);return _0x3696ea(_0x32170b['error'][_0x3192('0x18')]);}logger[_0x3192('0x17')]('FaxQueue,\x20%s,\x20%s',_0xcdf7d3,_0x32170b[_0x3192('0x17')][_0x3192('0x18')]);return _0x1ac300(_0x32170b[_0x3192('0x17')]['message']);}else{logger[_0x3192('0x12')](_0x3192('0x13'),_0xcdf7d3,_0x3192('0x14'));_0x1ac300(_0x32170b[_0x3192('0x19')][_0x3192('0x18')]);}})[_0x3192('0x1a')](function(_0x400b92){logger[_0x3192('0x17')](_0x3192('0x13'),_0xcdf7d3,_0x400b92);_0x3696ea(_0x400b92);});});}exports[_0x3192('0x1b')]=function(_0x275129){var _0x56359b=this;return new Promise(function(_0x47b211,_0x5cdca5){return db['FaxQueue'][_0x3192('0x1c')]({'raw':_0x275129['options']?_0x275129['options'][_0x3192('0x1d')]===undefined?!![]:![]:!![],'where':_0x275129[_0x3192('0x1e')]?_0x275129[_0x3192('0x1e')][_0x3192('0x1f')]||null:null,'attributes':_0x275129[_0x3192('0x1e')]?_0x275129[_0x3192('0x1e')]['attributes']||null:null,'limit':_0x275129['options']?_0x275129[_0x3192('0x1e')][_0x3192('0x20')]||null:null,'include':_0x275129[_0x3192('0x1e')]?_0x275129[_0x3192('0x1e')][_0x3192('0x21')]?_[_0x3192('0x22')](_0x275129[_0x3192('0x1e')]['include'],function(_0x2901a3){return{'model':db[_0x2901a3[_0x3192('0x23')]],'as':_0x2901a3['as'],'attributes':_0x2901a3['attributes'],'include':_0x2901a3[_0x3192('0x21')]?_[_0x3192('0x22')](_0x2901a3['include'],function(_0x1fc0b1){return{'model':db[_0x1fc0b1[_0x3192('0x23')]],'as':_0x1fc0b1['as'],'attributes':_0x1fc0b1[_0x3192('0x24')],'include':_0x1fc0b1[_0x3192('0x21')]?_['map'](_0x1fc0b1['include'],function(_0x12795d){return{'model':db[_0x12795d[_0x3192('0x23')]],'as':_0x12795d['as'],'attributes':_0x12795d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x678556){logger[_0x3192('0x12')](_0x3192('0x1b'),_0x275129);logger['debug'](_0x3192('0x1b'),_0x275129,JSON['stringify'](_0x678556));_0x47b211(_0x678556);})['catch'](function(_0x59197c){logger[_0x3192('0x17')](_0x3192('0x1b'),_0x59197c[_0x3192('0x18')],_0x275129);_0x5cdca5(_0x56359b[_0x3192('0x17')](0x1f4,_0x59197c[_0x3192('0x18')]));});});};exports[_0x3192('0x25')]=function(_0x437143){var _0x460d3d=this;return new Promise(function(_0x5c44c9,_0x5e5c8d){return db[_0x3192('0x26')][_0x3192('0x27')]({'raw':_0x437143['options']?_0x437143[_0x3192('0x1e')][_0x3192('0x1d')]===undefined?!![]:![]:!![],'where':_0x437143[_0x3192('0x1e')]?_0x437143[_0x3192('0x1e')][_0x3192('0x1f')]||null:null,'attributes':_0x437143[_0x3192('0x1e')]?_0x437143['options'][_0x3192('0x24')]||null:null,'include':_0x437143[_0x3192('0x1e')]?_0x437143[_0x3192('0x1e')][_0x3192('0x21')]?_[_0x3192('0x22')](_0x437143[_0x3192('0x1e')]['include'],function(_0x5f5292){return{'model':db[_0x5f5292['model']],'as':_0x5f5292['as'],'attributes':_0x5f5292[_0x3192('0x24')],'include':_0x5f5292[_0x3192('0x21')]?_[_0x3192('0x22')](_0x5f5292[_0x3192('0x21')],function(_0x18da7d){return{'model':db[_0x18da7d[_0x3192('0x23')]],'as':_0x18da7d['as'],'attributes':_0x18da7d['attributes'],'include':_0x18da7d[_0x3192('0x21')]?_['map'](_0x18da7d[_0x3192('0x21')],function(_0x3084b6){return{'model':db[_0x3084b6[_0x3192('0x23')]],'as':_0x3084b6['as'],'attributes':_0x3084b6[_0x3192('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b8b07){logger[_0x3192('0x12')](_0x3192('0x25'),_0x437143);logger[_0x3192('0x15')](_0x3192('0x25'),_0x437143,JSON[_0x3192('0x28')](_0x2b8b07));_0x5c44c9(_0x2b8b07);})[_0x3192('0x1a')](function(_0x28c025){logger['error'](_0x3192('0x25'),_0x28c025[_0x3192('0x18')],_0x437143);_0x5e5c8d(_0x460d3d[_0x3192('0x17')](0x1f4,_0x28c025['message']));});});}; \ No newline at end of file +var _0x4f5a=['FaxQueue','options','where','attributes','limit','include','model','map','debug','catch','ShowFaxQueue','find','raw','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxQueue'];(function(_0x1cd216,_0x2a8f58){var _0x5b9d23=function(_0x34a4b4){while(--_0x34a4b4){_0x1cd216['push'](_0x1cd216['shift']());}};_0x5b9d23(++_0x2a8f58);}(_0x4f5a,0xa9));var _0xa4f5=function(_0x399d5e,_0x51b93a){_0x399d5e=_0x399d5e-0x0;var _0x428186=_0x4f5a[_0x399d5e];return _0x428186;};'use strict';var _=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var moment=require('moment');var BPromise=require(_0xa4f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa4f5('0x4'));var logger=require(_0xa4f5('0x5'))(_0xa4f5('0x6'));var config=require(_0xa4f5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa4f5('0x8')][_0xa4f5('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa4f5('0xa')],{'host':_0xa4f5('0xb'),'port':0x18eb});var socket=require(_0xa4f5('0xc'))(new Redis(config[_0xa4f5('0xa')]));require(_0xa4f5('0xd'))[_0xa4f5('0xe')](socket);function respondWithRpcPromise(_0x3ba156,_0x3b604f,_0x158cca){return new BPromise(function(_0x235d91,_0x361052){return client[_0xa4f5('0xf')](_0x3ba156,_0x158cca)[_0xa4f5('0x10')](function(_0x12ed61){logger[_0xa4f5('0x11')](_0xa4f5('0x12'),_0x3b604f,_0xa4f5('0x13'));logger['debug'](_0xa4f5('0x14'),_0x3b604f,_0xa4f5('0x13'),JSON['stringify'](_0x12ed61));if(_0x12ed61['error']){if(_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x16')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x3b604f,_0x12ed61[_0xa4f5('0x15')]['message']);return _0x361052(_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x17')]);}logger[_0xa4f5('0x15')](_0xa4f5('0x12'),_0x3b604f,_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x17')]);return _0x235d91(_0x12ed61[_0xa4f5('0x15')][_0xa4f5('0x17')]);}else{logger[_0xa4f5('0x11')]('FaxQueue,\x20%s,\x20%s',_0x3b604f,_0xa4f5('0x13'));_0x235d91(_0x12ed61[_0xa4f5('0x18')][_0xa4f5('0x17')]);}})['catch'](function(_0x4b7879){logger[_0xa4f5('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3b604f,_0x4b7879);_0x361052(_0x4b7879);});});}exports[_0xa4f5('0x19')]=function(_0x310c34){var _0x5acbbc=this;return new Promise(function(_0x42ba08,_0x30a316){return db[_0xa4f5('0x1a')]['findAll']({'raw':_0x310c34['options']?_0x310c34[_0xa4f5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x310c34[_0xa4f5('0x1b')]?_0x310c34['options'][_0xa4f5('0x1c')]||null:null,'attributes':_0x310c34[_0xa4f5('0x1b')]?_0x310c34['options'][_0xa4f5('0x1d')]||null:null,'limit':_0x310c34[_0xa4f5('0x1b')]?_0x310c34[_0xa4f5('0x1b')][_0xa4f5('0x1e')]||null:null,'include':_0x310c34[_0xa4f5('0x1b')]?_0x310c34[_0xa4f5('0x1b')]['include']?_['map'](_0x310c34[_0xa4f5('0x1b')][_0xa4f5('0x1f')],function(_0x5e4ab2){return{'model':db[_0x5e4ab2[_0xa4f5('0x20')]],'as':_0x5e4ab2['as'],'attributes':_0x5e4ab2[_0xa4f5('0x1d')],'include':_0x5e4ab2[_0xa4f5('0x1f')]?_[_0xa4f5('0x21')](_0x5e4ab2[_0xa4f5('0x1f')],function(_0x26a75f){return{'model':db[_0x26a75f[_0xa4f5('0x20')]],'as':_0x26a75f['as'],'attributes':_0x26a75f['attributes'],'include':_0x26a75f['include']?_[_0xa4f5('0x21')](_0x26a75f[_0xa4f5('0x1f')],function(_0x472323){return{'model':db[_0x472323['model']],'as':_0x472323['as'],'attributes':_0x472323[_0xa4f5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa4f5('0x10')](function(_0x3810b8){logger[_0xa4f5('0x11')](_0xa4f5('0x19'),_0x310c34);logger[_0xa4f5('0x22')](_0xa4f5('0x19'),_0x310c34,JSON['stringify'](_0x3810b8));_0x42ba08(_0x3810b8);})[_0xa4f5('0x23')](function(_0x3b14fa){logger['error'](_0xa4f5('0x19'),_0x3b14fa[_0xa4f5('0x17')],_0x310c34);_0x30a316(_0x5acbbc['error'](0x1f4,_0x3b14fa['message']));});});};exports[_0xa4f5('0x24')]=function(_0x305a31){var _0x32a747=this;return new Promise(function(_0x5978e2,_0x22af4b){return db['FaxQueue'][_0xa4f5('0x25')]({'raw':_0x305a31['options']?_0x305a31['options'][_0xa4f5('0x26')]===undefined?!![]:![]:!![],'where':_0x305a31[_0xa4f5('0x1b')]?_0x305a31[_0xa4f5('0x1b')][_0xa4f5('0x1c')]||null:null,'attributes':_0x305a31[_0xa4f5('0x1b')]?_0x305a31[_0xa4f5('0x1b')][_0xa4f5('0x1d')]||null:null,'include':_0x305a31[_0xa4f5('0x1b')]?_0x305a31['options']['include']?_[_0xa4f5('0x21')](_0x305a31[_0xa4f5('0x1b')][_0xa4f5('0x1f')],function(_0x305539){return{'model':db[_0x305539['model']],'as':_0x305539['as'],'attributes':_0x305539[_0xa4f5('0x1d')],'include':_0x305539['include']?_[_0xa4f5('0x21')](_0x305539[_0xa4f5('0x1f')],function(_0x15e937){return{'model':db[_0x15e937[_0xa4f5('0x20')]],'as':_0x15e937['as'],'attributes':_0x15e937[_0xa4f5('0x1d')],'include':_0x15e937['include']?_[_0xa4f5('0x21')](_0x15e937[_0xa4f5('0x1f')],function(_0x204acf){return{'model':db[_0x204acf[_0xa4f5('0x20')]],'as':_0x204acf['as'],'attributes':_0x204acf[_0xa4f5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa4f5('0x10')](function(_0x58b06a){logger['info'](_0xa4f5('0x24'),_0x305a31);logger['debug'](_0xa4f5('0x24'),_0x305a31,JSON['stringify'](_0x58b06a));_0x5978e2(_0x58b06a);})[_0xa4f5('0x23')](function(_0x1f406d){logger[_0xa4f5('0x15')](_0xa4f5('0x24'),_0x1f406d['message'],_0x305a31);_0x22af4b(_0x32a747[_0xa4f5('0x15')](0x1f4,_0x1f406d['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 42da116..9dad162 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 _0x5aae=['length','./faxQueue.events','save','remove','emit','removeListener'];(function(_0x1153ab,_0x2701ad){var _0x52bcf2=function(_0x24f99f){while(--_0x24f99f){_0x1153ab['push'](_0x1153ab['shift']());}};_0x52bcf2(++_0x2701ad);}(_0x5aae,0xe5));var _0xe5aa=function(_0x503be0,_0x254ab5){_0x503be0=_0x503be0-0x0;var _0x2300f6=_0x5aae[_0x503be0];return _0x2300f6;};'use strict';var FaxQueueEvents=require(_0xe5aa('0x0'));var events=[_0xe5aa('0x1'),_0xe5aa('0x2'),'update'];function createListener(_0x4fe0a8,_0x496b52){return function(_0x2d37cc){_0x496b52[_0xe5aa('0x3')](_0x4fe0a8,_0x2d37cc);};}function removeListener(_0x564f1e,_0x5128f9){return function(){FaxQueueEvents[_0xe5aa('0x4')](_0x564f1e,_0x5128f9);};}exports['register']=function(_0x11eb0b){for(var _0x9d4d8b=0x0,_0x4e6a8e=events[_0xe5aa('0x5')];_0x9d4d8b<_0x4e6a8e;_0x9d4d8b++){var _0x4f7830=events[_0x9d4d8b];var _0x438b1a=createListener('faxQueue:'+_0x4f7830,_0x11eb0b);FaxQueueEvents['on'](_0x4f7830,_0x438b1a);}}; \ No newline at end of file +var _0x322d=['length','faxQueue:','./faxQueue.events','remove','emit','removeListener','register'];(function(_0x444d88,_0x56205b){var _0x7e70e3=function(_0x367ab7){while(--_0x367ab7){_0x444d88['push'](_0x444d88['shift']());}};_0x7e70e3(++_0x56205b);}(_0x322d,0x121));var _0xd322=function(_0xe5e3fb,_0x2fa636){_0xe5e3fb=_0xe5e3fb-0x0;var _0xdc5834=_0x322d[_0xe5e3fb];return _0xdc5834;};'use strict';var FaxQueueEvents=require(_0xd322('0x0'));var events=['save',_0xd322('0x1'),'update'];function createListener(_0x2cde9b,_0x1fd902){return function(_0x43661b){_0x1fd902[_0xd322('0x2')](_0x2cde9b,_0x43661b);};}function removeListener(_0x126439,_0x2124bc){return function(){FaxQueueEvents[_0xd322('0x3')](_0x126439,_0x2124bc);};}exports[_0xd322('0x4')]=function(_0x582a6d){for(var _0x11c722=0x0,_0x5343c5=events[_0xd322('0x5')];_0x11c722<_0x5343c5;_0x11c722++){var _0x3caf12=events[_0x11c722];var _0x416c8b=createListener(_0xd322('0x6')+_0x3caf12,_0x582a6d);FaxQueueEvents['on'](_0x3caf12,_0x416c8b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c991cb1..2c4ab76 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 _0x3d04=['/:id','show','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put','destroy','removeTeams','delete','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','describe'];(function(_0x27f818,_0x5cf04a){var _0x1ed76c=function(_0x171958){while(--_0x171958){_0x27f818['push'](_0x27f818['shift']());}};_0x1ed76c(++_0x5cf04a);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['get']('/:id/members',auth[_0x43d0('0xb')](),controller['getMembers']);router['get'](_0x43d0('0xf'),auth[_0x43d0('0xb')](),controller[_0x43d0('0x10')]);router[_0x43d0('0xa')]('/:id/users',auth[_0x43d0('0xb')](),controller[_0x43d0('0x11')]);router['post']('/',auth[_0x43d0('0xb')](),controller[_0x43d0('0x12')]);router[_0x43d0('0x13')]('/:id/teams',auth[_0x43d0('0xb')](),controller[_0x43d0('0x14')]);router[_0x43d0('0x13')]('/:id/users',auth[_0x43d0('0xb')](),controller[_0x43d0('0x15')]);router[_0x43d0('0x16')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller['update']);router['delete'](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0x17')]);router['delete'](_0x43d0('0xf'),auth['isAuthenticated'](),controller[_0x43d0('0x18')]);router[_0x43d0('0x19')](_0x43d0('0x1a'),auth['isAuthenticated'](),controller[_0x43d0('0x1b')]);module[_0x43d0('0x1c')]=router; \ No newline at end of file +var _0x0a6b=['update','destroy','delete','removeTeams','removeAgents','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','index','/describe','describe','show','get','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id'];(function(_0xa4c85,_0x2b52a7){var _0x172c1f=function(_0x149473){while(--_0x149473){_0xa4c85['push'](_0xa4c85['shift']());}};_0x172c1f(++_0x2b52a7);}(_0x0a6b,0x18e));var _0xb0a6=function(_0xbe2b03,_0xb1f12e){_0xbe2b03=_0xbe2b03-0x0;var _0x50cfb7=_0x0a6b[_0xbe2b03];return _0x50cfb7;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var fs_extra=require(_0xb0a6('0x2'));var auth=require(_0xb0a6('0x3'));var interaction=require(_0xb0a6('0x4'));var config=require('../../config/environment');var controller=require(_0xb0a6('0x5'));router['get']('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x7')]);router['get'](_0xb0a6('0x8'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0a6('0xa')]);router[_0xb0a6('0xb')](_0xb0a6('0xc'),auth[_0xb0a6('0x6')](),controller['getMembers']);router[_0xb0a6('0xb')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0xe')]);router[_0xb0a6('0xb')](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x10')]);router[_0xb0a6('0x11')]('/',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x12')]);router[_0xb0a6('0x11')](_0xb0a6('0xd'),auth['isAuthenticated'](),controller[_0xb0a6('0x13')]);router['post'](_0xb0a6('0xf'),auth['isAuthenticated'](),controller[_0xb0a6('0x14')]);router['put'](_0xb0a6('0x15'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x16')]);router['delete']('/:id',auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x17')]);router[_0xb0a6('0x18')](_0xb0a6('0xd'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x19')]);router['delete'](_0xb0a6('0xf'),auth[_0xb0a6('0x6')](),controller[_0xb0a6('0x1a')]);module[_0xb0a6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 629bf3e..3d4e7f8 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 _0x7117=['exports','STRING','DATE','moment','sequelize'];(function(_0x36432f,_0xe7e8e9){var _0x4e69b3=function(_0x520b53){while(--_0x520b53){_0x36432f['push'](_0x36432f['shift']());}};_0x4e69b3(++_0xe7e8e9);}(_0x7117,0x71));var _0x7711=function(_0x3f0801,_0x2412c4){_0x3f0801=_0x3f0801-0x0;var _0x5ad368=_0x7117[_0x3f0801];return _0x5ad368;};'use strict';var moment=require(_0x7711('0x0'));var Sequelize=require(_0x7711('0x1'));module[_0x7711('0x2')]={'uniqueid':{'type':Sequelize[_0x7711('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7711('0x4')]},'leaveAt':{'type':Sequelize[_0x7711('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7711('0x4')]},'reason':{'type':Sequelize[_0x7711('0x3')]}}; \ No newline at end of file +var _0x1961=['STRING','DATE','moment','sequelize','exports'];(function(_0x1a7536,_0x30c791){var _0x4660d9=function(_0x1db222){while(--_0x1db222){_0x1a7536['push'](_0x1a7536['shift']());}};_0x4660d9(++_0x30c791);}(_0x1961,0x15b));var _0x1196=function(_0x25cfdb,_0x4e0360){_0x25cfdb=_0x25cfdb-0x0;var _0x36811a=_0x1961[_0x25cfdb];return _0x36811a;};'use strict';var moment=require(_0x1196('0x0'));var Sequelize=require(_0x1196('0x1'));module[_0x1196('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1196('0x3')]},'joinAt':{'type':Sequelize[_0x1196('0x4')]},'leaveAt':{'type':Sequelize[_0x1196('0x4')]},'acceptAt':{'type':Sequelize[_0x1196('0x4')]},'exitAt':{'type':Sequelize[_0x1196('0x4')]},'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 efa1af9..2717075 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 _0xd66c=['index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','fields','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','count','status','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x3dfc1d,_0x2e7f29){var _0x570ddd=function(_0xec83a2){while(--_0xec83a2){_0x3dfc1d['push'](_0x3dfc1d['shift']());}};_0x570ddd(++_0x2e7f29);}(_0xd66c,0x106));var _0xcd66=function(_0x497a42,_0x2534a6){_0x497a42=_0x497a42-0x0;var _0x263206=_0xd66c[_0x497a42];return _0x263206;};'use strict';var emlformat=require(_0xcd66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd66('0x1'));var jsonpatch=require(_0xcd66('0x2'));var rp=require(_0xcd66('0x3'));var moment=require(_0xcd66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcd66('0x5'));var util=require(_0xcd66('0x6'));var path=require(_0xcd66('0x7'));var sox=require(_0xcd66('0x8'));var csv=require(_0xcd66('0x9'));var ejs=require(_0xcd66('0xa'));var fs=require('fs');var fs_extra=require(_0xcd66('0xb'));var _=require(_0xcd66('0xc'));var squel=require('squel');var crypto=require(_0xcd66('0xd'));var jsforce=require(_0xcd66('0xe'));var deskjs=require(_0xcd66('0xf'));var toCsv=require(_0xcd66('0x9'));var querystring=require(_0xcd66('0x10'));var Papa=require(_0xcd66('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcd66('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd66('0x13'));var logger=require(_0xcd66('0x14'))('api');var utils=require(_0xcd66('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcd66('0x16'));var db=require(_0xcd66('0x17'))['db'];function respondWithStatusCode(_0x1cb4a9,_0x3e4e92){_0x3e4e92=_0x3e4e92||0xcc;return function(_0x35479d){if(_0x35479d){return _0x1cb4a9['sendStatus'](_0x3e4e92);}return _0x1cb4a9['status'](_0x3e4e92)[_0xcd66('0x18')]();};}function respondWithResult(_0x5d9bb4,_0x28ae0c){_0x28ae0c=_0x28ae0c||0xc8;return function(_0x588b46){if(_0x588b46){return _0x5d9bb4['status'](_0x28ae0c)[_0xcd66('0x19')](_0x588b46);}};}function respondWithFilteredResult(_0x1fafad,_0x4df4df){return function(_0x3178a7){if(_0x3178a7){var _0x3ed659=typeof _0x4df4df[_0xcd66('0x1a')]==='undefined'&&typeof _0x4df4df[_0xcd66('0x1b')]==='undefined';var _0x1268db=_0x3178a7[_0xcd66('0x1c')];var _0x191f8e=_0x3ed659?0x0:_0x4df4df[_0xcd66('0x1a')];var _0x35d431=_0x3ed659?_0x3178a7[_0xcd66('0x1c')]:_0x4df4df[_0xcd66('0x1a')]+_0x4df4df[_0xcd66('0x1b')];var _0x417907;if(_0x35d431>=_0x1268db){_0x35d431=_0x1268db;_0x417907=0xc8;}else{_0x417907=0xce;}_0x1fafad[_0xcd66('0x1d')](_0x417907);return _0x1fafad[_0xcd66('0x1e')](_0xcd66('0x1f'),_0x191f8e+'-'+_0x35d431+'/'+_0x1268db)[_0xcd66('0x19')](_0x3178a7);}return null;};}function patchUpdates(_0x2d3819){return function(_0x842033){try{jsonpatch['apply'](_0x842033,_0x2d3819,!![]);}catch(_0x3e3bea){return BPromise[_0xcd66('0x20')](_0x3e3bea);}return _0x842033[_0xcd66('0x21')]();};}function saveUpdates(_0x11c75c,_0x1cc184){return function(_0x1f8a04){if(_0x1f8a04){return _0x1f8a04[_0xcd66('0x22')](_0x11c75c)[_0xcd66('0x23')](function(_0x64424a){return _0x64424a;});}return null;};}function removeEntity(_0x35e19e,_0x5ec2d5){return function(_0x2ab69e){if(_0x2ab69e){return _0x2ab69e[_0xcd66('0x24')]()['then'](function(){_0x35e19e[_0xcd66('0x1d')](0xcc)[_0xcd66('0x18')]();});}};}function handleEntityNotFound(_0xb37e77,_0x526e13){return function(_0x141a64){if(!_0x141a64){_0xb37e77[_0xcd66('0x25')](0x194);}return _0x141a64;};}function handleError(_0x3de898,_0x54ac81){_0x54ac81=_0x54ac81||0x1f4;return function(_0x12891d){logger[_0xcd66('0x26')](_0x12891d[_0xcd66('0x27')]);if(_0x12891d[_0xcd66('0x28')]){delete _0x12891d[_0xcd66('0x28')];}_0x3de898[_0xcd66('0x1d')](_0x54ac81)[_0xcd66('0x29')](_0x12891d);};}exports[_0xcd66('0x2a')]=function(_0x51201f,_0xb6d828){var _0x51a7f6={},_0x2506d3={},_0x851a5c={'count':0x0,'rows':[]};var _0x2dfa40=_[_0xcd66('0x2b')](db[_0xcd66('0x2c')][_0xcd66('0x2d')],function(_0x54597e){return{'name':_0x54597e[_0xcd66('0x2e')],'type':_0x54597e[_0xcd66('0x2f')][_0xcd66('0x30')]};});_0x2506d3[_0xcd66('0x31')]=_['map'](_0x2dfa40,_0xcd66('0x28'));_0x2506d3[_0xcd66('0x32')]=_[_0xcd66('0x33')](_0x51201f[_0xcd66('0x32')]);_0x2506d3[_0xcd66('0x34')]=_['intersection'](_0x2506d3[_0xcd66('0x31')],_0x2506d3[_0xcd66('0x32')]);_0x51a7f6[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x2506d3['model'],qs['fields'](_0x51201f[_0xcd66('0x32')]['fields']));_0x51a7f6[_0xcd66('0x35')]=_0x51a7f6[_0xcd66('0x35')][_0xcd66('0x37')]?_0x51a7f6[_0xcd66('0x35')]:_0x2506d3[_0xcd66('0x31')];if(!_0x51201f[_0xcd66('0x32')][_0xcd66('0x38')]('nolimit')){_0x51a7f6[_0xcd66('0x1b')]=qs[_0xcd66('0x1b')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1b')]);_0x51a7f6['offset']=qs[_0xcd66('0x1a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x1a')]);}_0x51a7f6[_0xcd66('0x39')]=qs[_0xcd66('0x3a')](_0x51201f[_0xcd66('0x32')][_0xcd66('0x3a')]);_0x51a7f6[_0xcd66('0x3b')]=qs[_0xcd66('0x34')](_[_0xcd66('0x3c')](_0x51201f[_0xcd66('0x32')],_0x2506d3[_0xcd66('0x34')]),_0x2dfa40);if(_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]){_0x51a7f6[_0xcd66('0x3b')]=_[_0xcd66('0x3e')](_0x51a7f6[_0xcd66('0x3b')],{'$or':_[_0xcd66('0x2b')](_0x2dfa40,function(_0x17a327){if(_0x17a327['type']!=='VIRTUAL'){var _0x8e55c6={};_0x8e55c6[_0x17a327['name']]={'$like':'%'+_0x51201f[_0xcd66('0x32')][_0xcd66('0x3d')]+'%'};return _0x8e55c6;}})});}_0x51a7f6=_[_0xcd66('0x3e')]({},_0x51a7f6,_0x51201f[_0xcd66('0x3f')]);var _0x2bfb26={'where':_0x51a7f6['where']};return db[_0xcd66('0x2c')][_0xcd66('0x1c')](_0x2bfb26)['then'](function(_0xd6bd6f){_0x851a5c[_0xcd66('0x1c')]=_0xd6bd6f;if(_0x51201f['query'][_0xcd66('0x40')]){_0x51a7f6[_0xcd66('0x41')]=[{'all':!![]}];}return db[_0xcd66('0x2c')][_0xcd66('0x42')](_0x51a7f6);})[_0xcd66('0x23')](function(_0x285ef4){_0x851a5c[_0xcd66('0x43')]=_0x285ef4;return _0x851a5c;})['then'](respondWithFilteredResult(_0xb6d828,_0x51a7f6))[_0xcd66('0x44')](handleError(_0xb6d828,null));};exports[_0xcd66('0x45')]=function(_0x2bb778,_0x333ee1){var _0x62802e={'raw':!![],'where':{'id':_0x2bb778['params']['id']}},_0x7e904d={};_0x7e904d[_0xcd66('0x31')]=_[_0xcd66('0x33')](db[_0xcd66('0x2c')][_0xcd66('0x2d')]);_0x7e904d['query']=_[_0xcd66('0x33')](_0x2bb778[_0xcd66('0x32')]);_0x7e904d[_0xcd66('0x34')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],_0x7e904d[_0xcd66('0x32')]);_0x62802e[_0xcd66('0x35')]=_[_0xcd66('0x36')](_0x7e904d[_0xcd66('0x31')],qs[_0xcd66('0x46')](_0x2bb778[_0xcd66('0x32')][_0xcd66('0x46')]));_0x62802e[_0xcd66('0x35')]=_0x62802e[_0xcd66('0x35')][_0xcd66('0x37')]?_0x62802e[_0xcd66('0x35')]:_0x7e904d[_0xcd66('0x31')];if(_0x2bb778['query'][_0xcd66('0x40')]){_0x62802e[_0xcd66('0x41')]=[{'all':!![]}];}_0x62802e=_[_0xcd66('0x3e')]({},_0x62802e,_0x2bb778[_0xcd66('0x3f')]);return db[_0xcd66('0x2c')]['find'](_0x62802e)[_0xcd66('0x23')](handleEntityNotFound(_0x333ee1,null))[_0xcd66('0x23')](respondWithResult(_0x333ee1,null))['catch'](handleError(_0x333ee1,null));};exports['create']=function(_0x533289,_0x11079c){return db[_0xcd66('0x2c')][_0xcd66('0x47')](_0x533289[_0xcd66('0x48')],{})[_0xcd66('0x23')](respondWithResult(_0x11079c,0xc9))[_0xcd66('0x44')](handleError(_0x11079c,null));};exports['update']=function(_0x2efa27,_0x558f09){if(_0x2efa27[_0xcd66('0x48')]['id']){delete _0x2efa27[_0xcd66('0x48')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x2efa27[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x558f09,null))['then'](saveUpdates(_0x2efa27[_0xcd66('0x48')],null))['then'](respondWithResult(_0x558f09,null))[_0xcd66('0x44')](handleError(_0x558f09,null));};exports[_0xcd66('0x24')]=function(_0xb9051d,_0x52496f){return db[_0xcd66('0x2c')][_0xcd66('0x4a')]({'where':{'id':_0xb9051d[_0xcd66('0x49')]['id']}})[_0xcd66('0x23')](handleEntityNotFound(_0x52496f,null))[_0xcd66('0x23')](removeEntity(_0x52496f,null))['catch'](handleError(_0x52496f,null));};exports[_0xcd66('0x4b')]=function(_0x5e5da3,_0x5bef71){return db[_0xcd66('0x2c')]['describe']()['then'](respondWithResult(_0x5bef71,null))[_0xcd66('0x44')](handleError(_0x5bef71,null));}; \ No newline at end of file +var _0x3cd1=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','then','stack','name','index','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','options','include','findAll','show','params','length','includeAll','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1d91b7,_0x6115d7){var _0x2b9c36=function(_0x187849){while(--_0x187849){_0x1d91b7['push'](_0x1d91b7['shift']());}};_0x2b9c36(++_0x6115d7);}(_0x3cd1,0x112));var _0x13cd=function(_0x3c009e,_0x24a891){_0x3c009e=_0x3c009e-0x0;var _0x244222=_0x3cd1[_0x3c009e];return _0x244222;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13cd('0x0'));var zipdir=require(_0x13cd('0x1'));var jsonpatch=require(_0x13cd('0x2'));var rp=require(_0x13cd('0x3'));var moment=require(_0x13cd('0x4'));var BPromise=require(_0x13cd('0x5'));var Mustache=require(_0x13cd('0x6'));var util=require(_0x13cd('0x7'));var path=require('path');var sox=require(_0x13cd('0x8'));var csv=require(_0x13cd('0x9'));var ejs=require(_0x13cd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x13cd('0xb'));var crypto=require(_0x13cd('0xc'));var jsforce=require(_0x13cd('0xd'));var deskjs=require(_0x13cd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x13cd('0xf'));var Papa=require(_0x13cd('0x10'));var Redis=require(_0x13cd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x13cd('0x12'));var hardwareService=require(_0x13cd('0x13'));var logger=require(_0x13cd('0x14'))(_0x13cd('0x15'));var utils=require(_0x13cd('0x16'));var config=require(_0x13cd('0x17'));var licenseUtil=require(_0x13cd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da3a7,_0x2fe1a0){_0x2fe1a0=_0x2fe1a0||0xcc;return function(_0x4bab73){if(_0x4bab73){return _0x1da3a7[_0x13cd('0x19')](_0x2fe1a0);}return _0x1da3a7[_0x13cd('0x1a')](_0x2fe1a0)[_0x13cd('0x1b')]();};}function respondWithResult(_0xfff1f2,_0x29e672){_0x29e672=_0x29e672||0xc8;return function(_0x473e50){if(_0x473e50){return _0xfff1f2[_0x13cd('0x1a')](_0x29e672)[_0x13cd('0x1c')](_0x473e50);}};}function respondWithFilteredResult(_0x5cf7a4,_0x24b647){return function(_0x4afa7a){if(_0x4afa7a){var _0x3d790d=typeof _0x24b647[_0x13cd('0x1d')]==='undefined'&&typeof _0x24b647[_0x13cd('0x1e')]===_0x13cd('0x1f');var _0x1af3e3=_0x4afa7a[_0x13cd('0x20')];var _0x1442eb=_0x3d790d?0x0:_0x24b647[_0x13cd('0x1d')];var _0x45b9de=_0x3d790d?_0x4afa7a[_0x13cd('0x20')]:_0x24b647['offset']+_0x24b647[_0x13cd('0x1e')];var _0x4dc631;if(_0x45b9de>=_0x1af3e3){_0x45b9de=_0x1af3e3;_0x4dc631=0xc8;}else{_0x4dc631=0xce;}_0x5cf7a4[_0x13cd('0x1a')](_0x4dc631);return _0x5cf7a4[_0x13cd('0x21')](_0x13cd('0x22'),_0x1442eb+'-'+_0x45b9de+'/'+_0x1af3e3)[_0x13cd('0x1c')](_0x4afa7a);}return null;};}function patchUpdates(_0x5d12b8){return function(_0x2f4368){try{jsonpatch['apply'](_0x2f4368,_0x5d12b8,!![]);}catch(_0x3d4eca){return BPromise[_0x13cd('0x23')](_0x3d4eca);}return _0x2f4368[_0x13cd('0x24')]();};}function saveUpdates(_0x10f682,_0x439ba1){return function(_0x17cfb3){if(_0x17cfb3){return _0x17cfb3['update'](_0x10f682)['then'](function(_0x2c3925){return _0x2c3925;});}return null;};}function removeEntity(_0x4fc1c2,_0x5144cc){return function(_0xc0503f){if(_0xc0503f){return _0xc0503f[_0x13cd('0x25')]()[_0x13cd('0x26')](function(){_0x4fc1c2['status'](0xcc)[_0x13cd('0x1b')]();});}};}function handleEntityNotFound(_0x11124f,_0x20f110){return function(_0x167fa1){if(!_0x167fa1){_0x11124f[_0x13cd('0x19')](0x194);}return _0x167fa1;};}function handleError(_0x1701a3,_0x190876){_0x190876=_0x190876||0x1f4;return function(_0x23019d){logger['error'](_0x23019d[_0x13cd('0x27')]);if(_0x23019d['name']){delete _0x23019d[_0x13cd('0x28')];}_0x1701a3[_0x13cd('0x1a')](_0x190876)['send'](_0x23019d);};}exports[_0x13cd('0x29')]=function(_0x136825,_0x256628){var _0x1f726b={},_0x3fd1f6={},_0x2079d1={'count':0x0,'rows':[]};var _0x115cfc=_['map'](db[_0x13cd('0x2a')]['rawAttributes'],function(_0x5ace47){return{'name':_0x5ace47[_0x13cd('0x2b')],'type':_0x5ace47['type']['key']};});_0x3fd1f6[_0x13cd('0x2c')]=_['map'](_0x115cfc,_0x13cd('0x28'));_0x3fd1f6[_0x13cd('0x2d')]=_[_0x13cd('0x2e')](_0x136825[_0x13cd('0x2d')]);_0x3fd1f6[_0x13cd('0x2f')]=_[_0x13cd('0x30')](_0x3fd1f6[_0x13cd('0x2c')],_0x3fd1f6[_0x13cd('0x2d')]);_0x1f726b[_0x13cd('0x31')]=_[_0x13cd('0x30')](_0x3fd1f6['model'],qs['fields'](_0x136825['query'][_0x13cd('0x32')]));_0x1f726b[_0x13cd('0x31')]=_0x1f726b[_0x13cd('0x31')]['length']?_0x1f726b[_0x13cd('0x31')]:_0x3fd1f6[_0x13cd('0x2c')];if(!_0x136825[_0x13cd('0x2d')][_0x13cd('0x33')](_0x13cd('0x34'))){_0x1f726b['limit']=qs[_0x13cd('0x1e')](_0x136825[_0x13cd('0x2d')][_0x13cd('0x1e')]);_0x1f726b[_0x13cd('0x1d')]=qs[_0x13cd('0x1d')](_0x136825[_0x13cd('0x2d')][_0x13cd('0x1d')]);}_0x1f726b[_0x13cd('0x35')]=qs[_0x13cd('0x36')](_0x136825['query']['sort']);_0x1f726b['where']=qs[_0x13cd('0x2f')](_['pick'](_0x136825[_0x13cd('0x2d')],_0x3fd1f6[_0x13cd('0x2f')]),_0x115cfc);if(_0x136825[_0x13cd('0x2d')][_0x13cd('0x37')]){_0x1f726b[_0x13cd('0x38')]=_[_0x13cd('0x39')](_0x1f726b[_0x13cd('0x38')],{'$or':_[_0x13cd('0x3a')](_0x115cfc,function(_0x1950a4){if(_0x1950a4[_0x13cd('0x3b')]!=='VIRTUAL'){var _0x5eb9ed={};_0x5eb9ed[_0x1950a4[_0x13cd('0x28')]]={'$like':'%'+_0x136825[_0x13cd('0x2d')][_0x13cd('0x37')]+'%'};return _0x5eb9ed;}})});}_0x1f726b=_[_0x13cd('0x39')]({},_0x1f726b,_0x136825[_0x13cd('0x3c')]);var _0x4ea248={'where':_0x1f726b[_0x13cd('0x38')]};return db[_0x13cd('0x2a')][_0x13cd('0x20')](_0x4ea248)[_0x13cd('0x26')](function(_0x1bec66){_0x2079d1[_0x13cd('0x20')]=_0x1bec66;if(_0x136825[_0x13cd('0x2d')]['includeAll']){_0x1f726b[_0x13cd('0x3d')]=[{'all':!![]}];}return db[_0x13cd('0x2a')][_0x13cd('0x3e')](_0x1f726b);})[_0x13cd('0x26')](function(_0x4ba5f6){_0x2079d1['rows']=_0x4ba5f6;return _0x2079d1;})[_0x13cd('0x26')](respondWithFilteredResult(_0x256628,_0x1f726b))['catch'](handleError(_0x256628,null));};exports[_0x13cd('0x3f')]=function(_0x48d843,_0x4ab83c){var _0x200367={'raw':!![],'where':{'id':_0x48d843[_0x13cd('0x40')]['id']}},_0x10bd80={};_0x10bd80[_0x13cd('0x2c')]=_[_0x13cd('0x2e')](db[_0x13cd('0x2a')]['rawAttributes']);_0x10bd80[_0x13cd('0x2d')]=_[_0x13cd('0x2e')](_0x48d843['query']);_0x10bd80[_0x13cd('0x2f')]=_[_0x13cd('0x30')](_0x10bd80[_0x13cd('0x2c')],_0x10bd80['query']);_0x200367[_0x13cd('0x31')]=_[_0x13cd('0x30')](_0x10bd80['model'],qs['fields'](_0x48d843[_0x13cd('0x2d')][_0x13cd('0x32')]));_0x200367[_0x13cd('0x31')]=_0x200367[_0x13cd('0x31')][_0x13cd('0x41')]?_0x200367[_0x13cd('0x31')]:_0x10bd80[_0x13cd('0x2c')];if(_0x48d843[_0x13cd('0x2d')][_0x13cd('0x42')]){_0x200367['include']=[{'all':!![]}];}_0x200367=_['merge']({},_0x200367,_0x48d843[_0x13cd('0x3c')]);return db[_0x13cd('0x2a')][_0x13cd('0x43')](_0x200367)[_0x13cd('0x26')](handleEntityNotFound(_0x4ab83c,null))['then'](respondWithResult(_0x4ab83c,null))[_0x13cd('0x44')](handleError(_0x4ab83c,null));};exports[_0x13cd('0x45')]=function(_0x45c0f6,_0x478538){return db['FaxQueueReport']['create'](_0x45c0f6[_0x13cd('0x46')],{})['then'](respondWithResult(_0x478538,0xc9))[_0x13cd('0x44')](handleError(_0x478538,null));};exports[_0x13cd('0x47')]=function(_0x10f94a,_0x5810ad){if(_0x10f94a[_0x13cd('0x46')]['id']){delete _0x10f94a['body']['id'];}return db[_0x13cd('0x2a')]['find']({'where':{'id':_0x10f94a[_0x13cd('0x40')]['id']}})['then'](handleEntityNotFound(_0x5810ad,null))[_0x13cd('0x26')](saveUpdates(_0x10f94a[_0x13cd('0x46')],null))[_0x13cd('0x26')](respondWithResult(_0x5810ad,null))['catch'](handleError(_0x5810ad,null));};exports[_0x13cd('0x25')]=function(_0x12af6d,_0x37287e){return db['FaxQueueReport']['find']({'where':{'id':_0x12af6d[_0x13cd('0x40')]['id']}})[_0x13cd('0x26')](handleEntityNotFound(_0x37287e,null))['then'](removeEntity(_0x37287e,null))[_0x13cd('0x44')](handleError(_0x37287e,null));};exports[_0x13cd('0x48')]=function(_0x14310e,_0x451746){return db['FaxQueueReport'][_0x13cd('0x48')]()[_0x13cd('0x26')](respondWithResult(_0x451746,null))['catch'](handleError(_0x451746,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b37be7d..2d317af 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x504b45,_0xecb959){var _0x36ba1c=function(_0x1fd0f2){while(--_0x1fd0f2){_0x504b45['push'](_0x504b45['shift']());}};_0x36ba1c(++_0xecb959);}(_0x5fab,0x177));var _0xb5fa=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x5fab[_0x13b330];return _0x1f666c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x56740a,_0x568894){var _0x257144=function(_0x2b8cc5){while(--_0x2b8cc5){_0x56740a['push'](_0x56740a['shift']());}};_0x257144(++_0x568894);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3b50b3,_0xfe3923){_0x3b50b3=_0x3b50b3-0x0;var _0x529085=_0x1cb9[_0x3b50b3];return _0x529085;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 918ea02..408fe24 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 _0xf411=['catch','FaxQueueReport','create','body','options','raw','then','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1b81ef,_0x18e030){var _0x2a3a64=function(_0x1b07e3){while(--_0x1b07e3){_0x1b81ef['push'](_0x1b81ef['shift']());}};_0x2a3a64(++_0x18e030);}(_0xf411,0x1cd));var _0x1f41=function(_0x4c0ca7,_0x267486){_0x4c0ca7=_0x4c0ca7-0x0;var _0x198a33=_0xf411[_0x4c0ca7];return _0x198a33;};'use strict';var _=require(_0x1f41('0x0'));var util=require(_0x1f41('0x1'));var moment=require('moment');var BPromise=require(_0x1f41('0x2'));var rs=require(_0x1f41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f41('0x4'))(_0x1f41('0x5'));var config=require('../../config/environment');var jayson=require(_0x1f41('0x6'));var client=jayson[_0x1f41('0x7')][_0x1f41('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bc630,_0x44426a,_0x834d8){return new BPromise(function(_0x11fcd0,_0x1bc502){return client[_0x1f41('0x9')](_0x4bc630,_0x834d8)['then'](function(_0x388ed3){logger[_0x1f41('0xa')](_0x1f41('0xb'),_0x44426a,_0x1f41('0xc'));logger[_0x1f41('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x44426a,_0x1f41('0xc'),JSON[_0x1f41('0xe')](_0x388ed3));if(_0x388ed3[_0x1f41('0xf')]){if(_0x388ed3[_0x1f41('0xf')][_0x1f41('0x10')]===0x1f4){logger[_0x1f41('0xf')](_0x1f41('0xb'),_0x44426a,_0x388ed3['error'][_0x1f41('0x11')]);return _0x1bc502(_0x388ed3['error'][_0x1f41('0x11')]);}logger[_0x1f41('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x44426a,_0x388ed3['error']['message']);return _0x11fcd0(_0x388ed3[_0x1f41('0xf')][_0x1f41('0x11')]);}else{logger['info'](_0x1f41('0xb'),_0x44426a,_0x1f41('0xc'));_0x11fcd0(_0x388ed3[_0x1f41('0x12')][_0x1f41('0x11')]);}})[_0x1f41('0x13')](function(_0x964bd2){logger[_0x1f41('0xf')](_0x1f41('0xb'),_0x44426a,_0x964bd2);_0x1bc502(_0x964bd2);});});}exports['CreateFaxQueueReport']=function(_0x15e9c5){var _0x123f22=this;return new Promise(function(_0x5e0069,_0x58b35e){return db[_0x1f41('0x14')][_0x1f41('0x15')](_0x15e9c5[_0x1f41('0x16')],{'raw':_0x15e9c5[_0x1f41('0x17')]?_0x15e9c5[_0x1f41('0x17')][_0x1f41('0x18')]===undefined?!![]:![]:!![]})[_0x1f41('0x19')](function(_0x2cb8f4){logger[_0x1f41('0xa')](_0x1f41('0x1a'),_0x15e9c5);logger[_0x1f41('0xd')]('CreateFaxQueueReport',_0x15e9c5,JSON[_0x1f41('0xe')](_0x2cb8f4));_0x5e0069(_0x2cb8f4);})['catch'](function(_0x3a8807){logger['error']('CreateFaxQueueReport',_0x3a8807[_0x1f41('0x11')],_0x15e9c5);_0x58b35e(_0x123f22[_0x1f41('0xf')](0x1f4,_0x3a8807['message']));});});};exports[_0x1f41('0x1b')]=function(_0x18e6b0){var _0x1ebaf7=this;return new Promise(function(_0x7cd312,_0x5480c3){return db['FaxQueueReport'][_0x1f41('0x1c')](_0x18e6b0[_0x1f41('0x16')],{'raw':_0x18e6b0[_0x1f41('0x17')]?_0x18e6b0[_0x1f41('0x17')][_0x1f41('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18e6b0['options']?_0x18e6b0[_0x1f41('0x17')][_0x1f41('0x1d')]||null:null,'attributes':_0x18e6b0[_0x1f41('0x17')]?_0x18e6b0['options'][_0x1f41('0x1e')]||null:null,'limit':_0x18e6b0[_0x1f41('0x17')]?_0x18e6b0[_0x1f41('0x17')][_0x1f41('0x1f')]||null:null})['then'](function(_0xbb9ac1){logger['info']('UpdateFaxQueueReport',_0x18e6b0);logger[_0x1f41('0xd')](_0x1f41('0x1b'),_0x18e6b0,JSON[_0x1f41('0xe')](_0xbb9ac1));_0x7cd312(_0xbb9ac1);})['catch'](function(_0x53adb2){logger[_0x1f41('0xf')]('UpdateFaxQueueReport',_0x53adb2[_0x1f41('0x11')],_0x18e6b0);_0x5480c3(_0x1ebaf7[_0x1f41('0xf')](0x1f4,_0x53adb2[_0x1f41('0x11')]));});});}; \ No newline at end of file +var _0x1f4c=['raw','then','UpdateFaxQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options'];(function(_0x225b4e,_0x179ee4){var _0x24237a=function(_0x4ac970){while(--_0x4ac970){_0x225b4e['push'](_0x225b4e['shift']());}};_0x24237a(++_0x179ee4);}(_0x1f4c,0xd2));var _0xc1f4=function(_0x22e9dc,_0x58aad7){_0x22e9dc=_0x22e9dc-0x0;var _0x32c871=_0x1f4c[_0x22e9dc];return _0x32c871;};'use strict';var _=require('lodash');var util=require(_0xc1f4('0x0'));var moment=require(_0xc1f4('0x1'));var BPromise=require(_0xc1f4('0x2'));var rs=require(_0xc1f4('0x3'));var fs=require('fs');var Redis=require(_0xc1f4('0x4'));var db=require(_0xc1f4('0x5'))['db'];var utils=require(_0xc1f4('0x6'));var logger=require('../../config/logger')(_0xc1f4('0x7'));var config=require(_0xc1f4('0x8'));var jayson=require(_0xc1f4('0x9'));var client=jayson[_0xc1f4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x278098,_0x12d98c,_0xaa6c19){return new BPromise(function(_0xa6df28,_0x137424){return client[_0xc1f4('0xb')](_0x278098,_0xaa6c19)['then'](function(_0xdf926f){logger[_0xc1f4('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x12d98c,_0xc1f4('0xd'));logger[_0xc1f4('0xe')](_0xc1f4('0xf'),_0x12d98c,'request\x20sent',JSON[_0xc1f4('0x10')](_0xdf926f));if(_0xdf926f[_0xc1f4('0x11')]){if(_0xdf926f[_0xc1f4('0x11')][_0xc1f4('0x12')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x12d98c,_0xdf926f['error'][_0xc1f4('0x13')]);return _0x137424(_0xdf926f[_0xc1f4('0x11')][_0xc1f4('0x13')]);}logger[_0xc1f4('0x11')](_0xc1f4('0x14'),_0x12d98c,_0xdf926f[_0xc1f4('0x11')][_0xc1f4('0x13')]);return _0xa6df28(_0xdf926f[_0xc1f4('0x11')]['message']);}else{logger[_0xc1f4('0xc')](_0xc1f4('0x14'),_0x12d98c,_0xc1f4('0xd'));_0xa6df28(_0xdf926f[_0xc1f4('0x15')][_0xc1f4('0x13')]);}})[_0xc1f4('0x16')](function(_0x40341b){logger[_0xc1f4('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x12d98c,_0x40341b);_0x137424(_0x40341b);});});}exports[_0xc1f4('0x17')]=function(_0x5db000){var _0x5d94da=this;return new Promise(function(_0x370574,_0xfa785a){return db[_0xc1f4('0x18')][_0xc1f4('0x19')](_0x5db000[_0xc1f4('0x1a')],{'raw':_0x5db000[_0xc1f4('0x1b')]?_0x5db000[_0xc1f4('0x1b')][_0xc1f4('0x1c')]===undefined?!![]:![]:!![]})[_0xc1f4('0x1d')](function(_0x508891){logger['info'](_0xc1f4('0x17'),_0x5db000);logger[_0xc1f4('0xe')](_0xc1f4('0x17'),_0x5db000,JSON['stringify'](_0x508891));_0x370574(_0x508891);})['catch'](function(_0x1cc565){logger[_0xc1f4('0x11')]('CreateFaxQueueReport',_0x1cc565[_0xc1f4('0x13')],_0x5db000);_0xfa785a(_0x5d94da[_0xc1f4('0x11')](0x1f4,_0x1cc565['message']));});});};exports[_0xc1f4('0x1e')]=function(_0xf8ab4e){var _0x306006=this;return new Promise(function(_0x1721d6,_0x1a2fcc){return db[_0xc1f4('0x18')][_0xc1f4('0x1f')](_0xf8ab4e[_0xc1f4('0x1a')],{'raw':_0xf8ab4e[_0xc1f4('0x1b')]?_0xf8ab4e[_0xc1f4('0x1b')][_0xc1f4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf8ab4e[_0xc1f4('0x1b')]?_0xf8ab4e['options']['where']||null:null,'attributes':_0xf8ab4e['options']?_0xf8ab4e['options'][_0xc1f4('0x20')]||null:null,'limit':_0xf8ab4e[_0xc1f4('0x1b')]?_0xf8ab4e[_0xc1f4('0x1b')][_0xc1f4('0x21')]||null:null})[_0xc1f4('0x1d')](function(_0x2cdea3){logger[_0xc1f4('0xc')](_0xc1f4('0x1e'),_0xf8ab4e);logger['debug'](_0xc1f4('0x1e'),_0xf8ab4e,JSON[_0xc1f4('0x10')](_0x2cdea3));_0x1721d6(_0x2cdea3);})[_0xc1f4('0x16')](function(_0x2b39a8){logger['error'](_0xc1f4('0x1e'),_0x2b39a8['message'],_0xf8ab4e);_0x1a2fcc(_0x306006[_0xc1f4('0x11')](0x1f4,_0x2b39a8[_0xc1f4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 09cf853..cfa0f08 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 _0x3f5e=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x3f5e,0x18f));var _0xe3f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f5e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe3f5('0x0'));var util=require(_0xe3f5('0x1'));var path=require(_0xe3f5('0x2'));var timeout=require(_0xe3f5('0x3'));var express=require('express');var router=express[_0xe3f5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe3f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe3f5('0x6'));var controller=require(_0xe3f5('0x7'));router[_0xe3f5('0x8')]('/',auth[_0xe3f5('0x9')](),controller['index']);router[_0xe3f5('0x8')](_0xe3f5('0xa'),auth['isAuthenticated'](),controller[_0xe3f5('0xb')]);router[_0xe3f5('0x8')](_0xe3f5('0xc'),auth[_0xe3f5('0x9')](),controller[_0xe3f5('0xd')]);router[_0xe3f5('0xe')]('/',auth[_0xe3f5('0x9')](),controller[_0xe3f5('0xf')]);router['put'](_0xe3f5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe3f5('0x10')](_0xe3f5('0xc'),auth[_0xe3f5('0x9')](),controller[_0xe3f5('0x11')]);module[_0xe3f5('0x12')]=router; \ No newline at end of file +var _0xfa9d=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x16bfbf,_0x1ffa04){var _0x15a45d=function(_0x359b47){while(--_0x359b47){_0x16bfbf['push'](_0x16bfbf['shift']());}};_0x15a45d(++_0x1ffa04);}(_0xfa9d,0x1d4));var _0xdfa9=function(_0x2ccbb5,_0x4140e3){_0x2ccbb5=_0x2ccbb5-0x0;var _0x193b18=_0xfa9d[_0x2ccbb5];return _0x193b18;};'use strict';var multer=require(_0xdfa9('0x0'));var util=require(_0xdfa9('0x1'));var path=require(_0xdfa9('0x2'));var timeout=require(_0xdfa9('0x3'));var express=require('express');var router=express[_0xdfa9('0x4')]();var fs_extra=require(_0xdfa9('0x5'));var auth=require(_0xdfa9('0x6'));var interaction=require(_0xdfa9('0x7'));var config=require(_0xdfa9('0x8'));var controller=require(_0xdfa9('0x9'));router[_0xdfa9('0xa')]('/',auth[_0xdfa9('0xb')](),controller[_0xdfa9('0xc')]);router[_0xdfa9('0xa')](_0xdfa9('0xd'),auth['isAuthenticated'](),controller[_0xdfa9('0xe')]);router[_0xdfa9('0xa')](_0xdfa9('0xf'),auth['isAuthenticated'](),controller[_0xdfa9('0x10')]);router[_0xdfa9('0x11')]('/',auth[_0xdfa9('0xb')](),controller[_0xdfa9('0x12')]);router[_0xdfa9('0x13')](_0xdfa9('0xf'),auth['isAuthenticated'](),controller[_0xdfa9('0x14')]);router[_0xdfa9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xdfa9('0x16')]);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 6ac41db..3c4d84b 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(_0x3bf1d9,_0x45314a){var _0x36ea8d=function(_0x1942cb){while(--_0x1942cb){_0x3bf1d9['push'](_0x3bf1d9['shift']());}};_0x36ea8d(++_0x45314a);}(_0xaa88,0x137));var _0x8aa8=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xaa88[_0x4ed1d4];return _0x28e363;};'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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1e196f,_0x533b2d){var _0x5e2791=function(_0x17198b){while(--_0x17198b){_0x1e196f['push'](_0x1e196f['shift']());}};_0x5e2791(++_0x533b2d);}(_0x70e0,0x17b));var _0x070e=function(_0x39424b,_0x148626){_0x39424b=_0x39424b-0x0;var _0x38ffc3=_0x70e0[_0x39424b];return _0x38ffc3;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f90b274..08cac06 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 _0xd4c0=['send','index','FaxTransferReport','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','error','name'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd4c0,0x6c));var _0x0d4c=function(_0x3102b7,_0x4a4063){_0x3102b7=_0x3102b7-0x0;var _0x22e16e=_0xd4c0[_0x3102b7];return _0x22e16e;};'use strict';var emlformat=require(_0x0d4c('0x0'));var rimraf=require(_0x0d4c('0x1'));var zipdir=require(_0x0d4c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d4c('0x3'));var BPromise=require(_0x0d4c('0x4'));var Mustache=require(_0x0d4c('0x5'));var util=require(_0x0d4c('0x6'));var path=require(_0x0d4c('0x7'));var sox=require(_0x0d4c('0x8'));var csv=require(_0x0d4c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d4c('0xa'));var _=require(_0x0d4c('0xb'));var squel=require(_0x0d4c('0xc'));var crypto=require(_0x0d4c('0xd'));var jsforce=require(_0x0d4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0d4c('0x9'));var querystring=require('querystring');var Papa=require(_0x0d4c('0xf'));var Redis=require(_0x0d4c('0x10'));var authService=require(_0x0d4c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d4c('0x12'));var hardwareService=require(_0x0d4c('0x13'));var logger=require(_0x0d4c('0x14'))(_0x0d4c('0x15'));var utils=require('../../config/utils');var config=require(_0x0d4c('0x16'));var licenseUtil=require(_0x0d4c('0x17'));var db=require(_0x0d4c('0x18'))['db'];function respondWithStatusCode(_0x49a319,_0x8819a0){_0x8819a0=_0x8819a0||0xcc;return function(_0x2541a0){if(_0x2541a0){return _0x49a319[_0x0d4c('0x19')](_0x8819a0);}return _0x49a319['status'](_0x8819a0)[_0x0d4c('0x1a')]();};}function respondWithResult(_0x552d28,_0x42045d){_0x42045d=_0x42045d||0xc8;return function(_0x58611c){if(_0x58611c){return _0x552d28[_0x0d4c('0x1b')](_0x42045d)['json'](_0x58611c);}};}function respondWithFilteredResult(_0x1e4319,_0x1008a4){return function(_0x2f6fef){if(_0x2f6fef){var _0x23675d=typeof _0x1008a4[_0x0d4c('0x1c')]===_0x0d4c('0x1d')&&typeof _0x1008a4['limit']===_0x0d4c('0x1d');var _0xd9f5bd=_0x2f6fef[_0x0d4c('0x1e')];var _0x14ed91=_0x23675d?0x0:_0x1008a4[_0x0d4c('0x1c')];var _0x2e00a9=_0x23675d?_0x2f6fef[_0x0d4c('0x1e')]:_0x1008a4[_0x0d4c('0x1c')]+_0x1008a4[_0x0d4c('0x1f')];var _0x7b752c;if(_0x2e00a9>=_0xd9f5bd){_0x2e00a9=_0xd9f5bd;_0x7b752c=0xc8;}else{_0x7b752c=0xce;}_0x1e4319[_0x0d4c('0x1b')](_0x7b752c);return _0x1e4319['set'](_0x0d4c('0x20'),_0x14ed91+'-'+_0x2e00a9+'/'+_0xd9f5bd)[_0x0d4c('0x21')](_0x2f6fef);}return null;};}function patchUpdates(_0x3a22d2){return function(_0x493d74){try{jsonpatch[_0x0d4c('0x22')](_0x493d74,_0x3a22d2,!![]);}catch(_0x1be674){return BPromise[_0x0d4c('0x23')](_0x1be674);}return _0x493d74[_0x0d4c('0x24')]();};}function saveUpdates(_0x18c61b,_0x17d287){return function(_0x3e37e3){if(_0x3e37e3){return _0x3e37e3[_0x0d4c('0x25')](_0x18c61b)['then'](function(_0x4ab0ca){return _0x4ab0ca;});}return null;};}function removeEntity(_0x5bd41e,_0x1e6595){return function(_0x4c9f8f){if(_0x4c9f8f){return _0x4c9f8f[_0x0d4c('0x26')]()[_0x0d4c('0x27')](function(){_0x5bd41e[_0x0d4c('0x1b')](0xcc)[_0x0d4c('0x1a')]();});}};}function handleEntityNotFound(_0xe6c37b,_0x1f1af9){return function(_0x5db18a){if(!_0x5db18a){_0xe6c37b[_0x0d4c('0x19')](0x194);}return _0x5db18a;};}function handleError(_0x5e7d6c,_0x219f6f){_0x219f6f=_0x219f6f||0x1f4;return function(_0x4a976a){logger[_0x0d4c('0x28')](_0x4a976a['stack']);if(_0x4a976a['name']){delete _0x4a976a[_0x0d4c('0x29')];}_0x5e7d6c[_0x0d4c('0x1b')](_0x219f6f)[_0x0d4c('0x2a')](_0x4a976a);};}exports[_0x0d4c('0x2b')]=function(_0x34b280,_0x1823b0){var _0x15c70d={},_0xdaf2d0={},_0x460a41={'count':0x0,'rows':[]};var _0x2b434f=_['map'](db[_0x0d4c('0x2c')][_0x0d4c('0x2d')],function(_0x1ea668){return{'name':_0x1ea668['fieldName'],'type':_0x1ea668[_0x0d4c('0x2e')][_0x0d4c('0x2f')]};});_0xdaf2d0['model']=_[_0x0d4c('0x30')](_0x2b434f,_0x0d4c('0x29'));_0xdaf2d0[_0x0d4c('0x31')]=_[_0x0d4c('0x32')](_0x34b280[_0x0d4c('0x31')]);_0xdaf2d0[_0x0d4c('0x33')]=_[_0x0d4c('0x34')](_0xdaf2d0['model'],_0xdaf2d0[_0x0d4c('0x31')]);_0x15c70d[_0x0d4c('0x35')]=_[_0x0d4c('0x34')](_0xdaf2d0[_0x0d4c('0x36')],qs['fields'](_0x34b280[_0x0d4c('0x31')][_0x0d4c('0x37')]));_0x15c70d['attributes']=_0x15c70d[_0x0d4c('0x35')][_0x0d4c('0x38')]?_0x15c70d['attributes']:_0xdaf2d0[_0x0d4c('0x36')];if(!_0x34b280[_0x0d4c('0x31')]['hasOwnProperty'](_0x0d4c('0x39'))){_0x15c70d[_0x0d4c('0x1f')]=qs[_0x0d4c('0x1f')](_0x34b280[_0x0d4c('0x31')][_0x0d4c('0x1f')]);_0x15c70d['offset']=qs[_0x0d4c('0x1c')](_0x34b280[_0x0d4c('0x31')]['offset']);}_0x15c70d[_0x0d4c('0x3a')]=qs[_0x0d4c('0x3b')](_0x34b280['query'][_0x0d4c('0x3b')]);_0x15c70d[_0x0d4c('0x3c')]=qs[_0x0d4c('0x33')](_['pick'](_0x34b280['query'],_0xdaf2d0[_0x0d4c('0x33')]),_0x2b434f);if(_0x34b280[_0x0d4c('0x31')][_0x0d4c('0x3d')]){_0x15c70d['where']=_[_0x0d4c('0x3e')](_0x15c70d[_0x0d4c('0x3c')],{'$or':_[_0x0d4c('0x30')](_0x2b434f,function(_0x36f7e3){if(_0x36f7e3[_0x0d4c('0x2e')]!==_0x0d4c('0x3f')){var _0x166b7b={};_0x166b7b[_0x36f7e3[_0x0d4c('0x29')]]={'$like':'%'+_0x34b280[_0x0d4c('0x31')][_0x0d4c('0x3d')]+'%'};return _0x166b7b;}})});}_0x15c70d=_[_0x0d4c('0x3e')]({},_0x15c70d,_0x34b280[_0x0d4c('0x40')]);var _0x563b11={'where':_0x15c70d['where']};return db[_0x0d4c('0x2c')]['count'](_0x563b11)['then'](function(_0x3a4f1d){_0x460a41[_0x0d4c('0x1e')]=_0x3a4f1d;if(_0x34b280[_0x0d4c('0x31')][_0x0d4c('0x41')]){_0x15c70d[_0x0d4c('0x42')]=[{'all':!![]}];}return db[_0x0d4c('0x2c')][_0x0d4c('0x43')](_0x15c70d);})[_0x0d4c('0x27')](function(_0x45d3ff){_0x460a41[_0x0d4c('0x44')]=_0x45d3ff;return _0x460a41;})['then'](respondWithFilteredResult(_0x1823b0,_0x15c70d))[_0x0d4c('0x45')](handleError(_0x1823b0,null));};exports['show']=function(_0x21695d,_0x47d837){var _0x48b16a={'raw':!![],'where':{'id':_0x21695d[_0x0d4c('0x46')]['id']}},_0x16209d={};_0x16209d[_0x0d4c('0x36')]=_[_0x0d4c('0x32')](db[_0x0d4c('0x2c')][_0x0d4c('0x2d')]);_0x16209d[_0x0d4c('0x31')]=_[_0x0d4c('0x32')](_0x21695d[_0x0d4c('0x31')]);_0x16209d[_0x0d4c('0x33')]=_[_0x0d4c('0x34')](_0x16209d['model'],_0x16209d['query']);_0x48b16a['attributes']=_['intersection'](_0x16209d['model'],qs[_0x0d4c('0x37')](_0x21695d[_0x0d4c('0x31')][_0x0d4c('0x37')]));_0x48b16a['attributes']=_0x48b16a[_0x0d4c('0x35')][_0x0d4c('0x38')]?_0x48b16a[_0x0d4c('0x35')]:_0x16209d[_0x0d4c('0x36')];if(_0x21695d[_0x0d4c('0x31')][_0x0d4c('0x41')]){_0x48b16a[_0x0d4c('0x42')]=[{'all':!![]}];}_0x48b16a=_[_0x0d4c('0x3e')]({},_0x48b16a,_0x21695d['options']);return db[_0x0d4c('0x2c')][_0x0d4c('0x47')](_0x48b16a)[_0x0d4c('0x27')](handleEntityNotFound(_0x47d837,null))[_0x0d4c('0x27')](respondWithResult(_0x47d837,null))[_0x0d4c('0x45')](handleError(_0x47d837,null));};exports['create']=function(_0x51ec3e,_0x3b53e8){return db[_0x0d4c('0x2c')][_0x0d4c('0x48')](_0x51ec3e[_0x0d4c('0x49')],{})[_0x0d4c('0x27')](respondWithResult(_0x3b53e8,0xc9))[_0x0d4c('0x45')](handleError(_0x3b53e8,null));};exports['update']=function(_0x4a04e2,_0x43daef){if(_0x4a04e2[_0x0d4c('0x49')]['id']){delete _0x4a04e2[_0x0d4c('0x49')]['id'];}return db[_0x0d4c('0x2c')]['find']({'where':{'id':_0x4a04e2[_0x0d4c('0x46')]['id']}})[_0x0d4c('0x27')](handleEntityNotFound(_0x43daef,null))[_0x0d4c('0x27')](saveUpdates(_0x4a04e2[_0x0d4c('0x49')],null))[_0x0d4c('0x27')](respondWithResult(_0x43daef,null))[_0x0d4c('0x45')](handleError(_0x43daef,null));};exports[_0x0d4c('0x26')]=function(_0x1e5559,_0x28eb19){return db['FaxTransferReport'][_0x0d4c('0x47')]({'where':{'id':_0x1e5559[_0x0d4c('0x46')]['id']}})[_0x0d4c('0x27')](handleEntityNotFound(_0x28eb19,null))[_0x0d4c('0x27')](removeEntity(_0x28eb19,null))[_0x0d4c('0x45')](handleError(_0x28eb19,null));};exports[_0x0d4c('0x4a')]=function(_0x512dae,_0x556df3){return db[_0x0d4c('0x2c')][_0x0d4c('0x4a')]()[_0x0d4c('0x27')](respondWithResult(_0x556df3,null))[_0x0d4c('0x45')](handleError(_0x556df3,null));}; \ No newline at end of file +var _0x85ce=['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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','create','body','find','params','describe'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0x85ce,0x138));var _0xe85c=function(_0x7e8014,_0x3513e9){_0x7e8014=_0x7e8014-0x0;var _0x4393c2=_0x85ce[_0x7e8014];return _0x4393c2;};'use strict';var emlformat=require(_0xe85c('0x0'));var rimraf=require(_0xe85c('0x1'));var zipdir=require(_0xe85c('0x2'));var jsonpatch=require(_0xe85c('0x3'));var rp=require(_0xe85c('0x4'));var moment=require(_0xe85c('0x5'));var BPromise=require(_0xe85c('0x6'));var Mustache=require(_0xe85c('0x7'));var util=require(_0xe85c('0x8'));var path=require(_0xe85c('0x9'));var sox=require(_0xe85c('0xa'));var csv=require(_0xe85c('0xb'));var ejs=require(_0xe85c('0xc'));var fs=require('fs');var fs_extra=require(_0xe85c('0xd'));var _=require(_0xe85c('0xe'));var squel=require('squel');var crypto=require(_0xe85c('0xf'));var jsforce=require(_0xe85c('0x10'));var deskjs=require(_0xe85c('0x11'));var toCsv=require(_0xe85c('0xb'));var querystring=require(_0xe85c('0x12'));var Papa=require(_0xe85c('0x13'));var Redis=require(_0xe85c('0x14'));var authService=require(_0xe85c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xe85c('0x16'));var hardwareService=require(_0xe85c('0x17'));var logger=require(_0xe85c('0x18'))(_0xe85c('0x19'));var utils=require(_0xe85c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xe85c('0x1b'));var db=require(_0xe85c('0x1c'))['db'];function respondWithStatusCode(_0xd745d2,_0x41d681){_0x41d681=_0x41d681||0xcc;return function(_0x165aeb){if(_0x165aeb){return _0xd745d2[_0xe85c('0x1d')](_0x41d681);}return _0xd745d2['status'](_0x41d681)['end']();};}function respondWithResult(_0x344ed1,_0x2a9020){_0x2a9020=_0x2a9020||0xc8;return function(_0x4c5caa){if(_0x4c5caa){return _0x344ed1[_0xe85c('0x1e')](_0x2a9020)[_0xe85c('0x1f')](_0x4c5caa);}};}function respondWithFilteredResult(_0x3b6f79,_0x37d7ac){return function(_0x38e292){if(_0x38e292){var _0x86e655=typeof _0x37d7ac[_0xe85c('0x20')]==='undefined'&&typeof _0x37d7ac[_0xe85c('0x21')]==='undefined';var _0x291510=_0x38e292['count'];var _0x273f69=_0x86e655?0x0:_0x37d7ac[_0xe85c('0x20')];var _0x45c928=_0x86e655?_0x38e292[_0xe85c('0x22')]:_0x37d7ac['offset']+_0x37d7ac['limit'];var _0x5a2d6d;if(_0x45c928>=_0x291510){_0x45c928=_0x291510;_0x5a2d6d=0xc8;}else{_0x5a2d6d=0xce;}_0x3b6f79[_0xe85c('0x1e')](_0x5a2d6d);return _0x3b6f79[_0xe85c('0x23')](_0xe85c('0x24'),_0x273f69+'-'+_0x45c928+'/'+_0x291510)[_0xe85c('0x1f')](_0x38e292);}return null;};}function patchUpdates(_0x38a2ec){return function(_0x2d80ef){try{jsonpatch[_0xe85c('0x25')](_0x2d80ef,_0x38a2ec,!![]);}catch(_0x237415){return BPromise[_0xe85c('0x26')](_0x237415);}return _0x2d80ef[_0xe85c('0x27')]();};}function saveUpdates(_0x3b7b33,_0x243ad6){return function(_0xdcd791){if(_0xdcd791){return _0xdcd791[_0xe85c('0x28')](_0x3b7b33)[_0xe85c('0x29')](function(_0x222a3c){return _0x222a3c;});}return null;};}function removeEntity(_0x206c90,_0x27110f){return function(_0x35a461){if(_0x35a461){return _0x35a461['destroy']()[_0xe85c('0x29')](function(){_0x206c90[_0xe85c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc4351,_0x30bfb8){return function(_0x40bfc6){if(!_0x40bfc6){_0xbc4351[_0xe85c('0x1d')](0x194);}return _0x40bfc6;};}function handleError(_0x44feeb,_0x500b25){_0x500b25=_0x500b25||0x1f4;return function(_0x275d67){logger['error'](_0x275d67[_0xe85c('0x2a')]);if(_0x275d67[_0xe85c('0x2b')]){delete _0x275d67[_0xe85c('0x2b')];}_0x44feeb[_0xe85c('0x1e')](_0x500b25)['send'](_0x275d67);};}exports[_0xe85c('0x2c')]=function(_0x313d7a,_0x188b05){var _0x43f420={},_0x3e4aa0={},_0x424359={'count':0x0,'rows':[]};var _0x5143b9=_[_0xe85c('0x2d')](db[_0xe85c('0x2e')][_0xe85c('0x2f')],function(_0x2e8cb3){return{'name':_0x2e8cb3[_0xe85c('0x30')],'type':_0x2e8cb3['type'][_0xe85c('0x31')]};});_0x3e4aa0[_0xe85c('0x32')]=_[_0xe85c('0x2d')](_0x5143b9,_0xe85c('0x2b'));_0x3e4aa0['query']=_[_0xe85c('0x33')](_0x313d7a[_0xe85c('0x34')]);_0x3e4aa0[_0xe85c('0x35')]=_[_0xe85c('0x36')](_0x3e4aa0[_0xe85c('0x32')],_0x3e4aa0['query']);_0x43f420[_0xe85c('0x37')]=_['intersection'](_0x3e4aa0[_0xe85c('0x32')],qs['fields'](_0x313d7a[_0xe85c('0x34')]['fields']));_0x43f420[_0xe85c('0x37')]=_0x43f420[_0xe85c('0x37')][_0xe85c('0x38')]?_0x43f420[_0xe85c('0x37')]:_0x3e4aa0[_0xe85c('0x32')];if(!_0x313d7a[_0xe85c('0x34')]['hasOwnProperty'](_0xe85c('0x39'))){_0x43f420['limit']=qs[_0xe85c('0x21')](_0x313d7a[_0xe85c('0x34')][_0xe85c('0x21')]);_0x43f420['offset']=qs[_0xe85c('0x20')](_0x313d7a[_0xe85c('0x34')]['offset']);}_0x43f420[_0xe85c('0x3a')]=qs[_0xe85c('0x3b')](_0x313d7a[_0xe85c('0x34')][_0xe85c('0x3b')]);_0x43f420[_0xe85c('0x3c')]=qs[_0xe85c('0x35')](_['pick'](_0x313d7a['query'],_0x3e4aa0[_0xe85c('0x35')]),_0x5143b9);if(_0x313d7a[_0xe85c('0x34')][_0xe85c('0x3d')]){_0x43f420[_0xe85c('0x3c')]=_[_0xe85c('0x3e')](_0x43f420[_0xe85c('0x3c')],{'$or':_[_0xe85c('0x2d')](_0x5143b9,function(_0xeb311f){if(_0xeb311f[_0xe85c('0x3f')]!==_0xe85c('0x40')){var _0xf63a41={};_0xf63a41[_0xeb311f[_0xe85c('0x2b')]]={'$like':'%'+_0x313d7a[_0xe85c('0x34')][_0xe85c('0x3d')]+'%'};return _0xf63a41;}})});}_0x43f420=_['merge']({},_0x43f420,_0x313d7a[_0xe85c('0x41')]);var _0x4be18d={'where':_0x43f420[_0xe85c('0x3c')]};return db['FaxTransferReport']['count'](_0x4be18d)['then'](function(_0x13d5d6){_0x424359[_0xe85c('0x22')]=_0x13d5d6;if(_0x313d7a[_0xe85c('0x34')][_0xe85c('0x42')]){_0x43f420[_0xe85c('0x43')]=[{'all':!![]}];}return db[_0xe85c('0x2e')][_0xe85c('0x44')](_0x43f420);})[_0xe85c('0x29')](function(_0x4370bd){_0x424359[_0xe85c('0x45')]=_0x4370bd;return _0x424359;})['then'](respondWithFilteredResult(_0x188b05,_0x43f420))[_0xe85c('0x46')](handleError(_0x188b05,null));};exports[_0xe85c('0x47')]=function(_0x11e8f2,_0x30c4ae){var _0x50564e={'raw':!![],'where':{'id':_0x11e8f2['params']['id']}},_0x41c8af={};_0x41c8af[_0xe85c('0x32')]=_[_0xe85c('0x33')](db['FaxTransferReport'][_0xe85c('0x2f')]);_0x41c8af['query']=_[_0xe85c('0x33')](_0x11e8f2[_0xe85c('0x34')]);_0x41c8af[_0xe85c('0x35')]=_[_0xe85c('0x36')](_0x41c8af['model'],_0x41c8af['query']);_0x50564e['attributes']=_[_0xe85c('0x36')](_0x41c8af[_0xe85c('0x32')],qs[_0xe85c('0x48')](_0x11e8f2['query'][_0xe85c('0x48')]));_0x50564e[_0xe85c('0x37')]=_0x50564e[_0xe85c('0x37')][_0xe85c('0x38')]?_0x50564e[_0xe85c('0x37')]:_0x41c8af['model'];if(_0x11e8f2[_0xe85c('0x34')][_0xe85c('0x42')]){_0x50564e[_0xe85c('0x43')]=[{'all':!![]}];}_0x50564e=_[_0xe85c('0x3e')]({},_0x50564e,_0x11e8f2[_0xe85c('0x41')]);return db[_0xe85c('0x2e')]['find'](_0x50564e)[_0xe85c('0x29')](handleEntityNotFound(_0x30c4ae,null))[_0xe85c('0x29')](respondWithResult(_0x30c4ae,null))['catch'](handleError(_0x30c4ae,null));};exports[_0xe85c('0x49')]=function(_0x1fbd2f,_0x2734d6){return db[_0xe85c('0x2e')]['create'](_0x1fbd2f[_0xe85c('0x4a')],{})[_0xe85c('0x29')](respondWithResult(_0x2734d6,0xc9))[_0xe85c('0x46')](handleError(_0x2734d6,null));};exports[_0xe85c('0x28')]=function(_0x237be9,_0x16ce79){if(_0x237be9[_0xe85c('0x4a')]['id']){delete _0x237be9[_0xe85c('0x4a')]['id'];}return db[_0xe85c('0x2e')]['find']({'where':{'id':_0x237be9['params']['id']}})['then'](handleEntityNotFound(_0x16ce79,null))[_0xe85c('0x29')](saveUpdates(_0x237be9[_0xe85c('0x4a')],null))[_0xe85c('0x29')](respondWithResult(_0x16ce79,null))['catch'](handleError(_0x16ce79,null));};exports['destroy']=function(_0xde8c15,_0x52eb69){return db[_0xe85c('0x2e')][_0xe85c('0x4b')]({'where':{'id':_0xde8c15[_0xe85c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x52eb69,null))[_0xe85c('0x29')](removeEntity(_0x52eb69,null))[_0xe85c('0x46')](handleError(_0x52eb69,null));};exports[_0xe85c('0x4d')]=function(_0x5451f9,_0xe5838d){return db[_0xe85c('0x2e')][_0xe85c('0x4d')]()[_0xe85c('0x29')](respondWithResult(_0xe5838d,null))[_0xe85c('0x46')](handleError(_0xe5838d,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 862a085..5fbab19 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 _0x4123=['bluebird','request-promise','path','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x133776,_0x8efc1a){var _0x34e130=function(_0x565987){while(--_0x565987){_0x133776['push'](_0x133776['shift']());}};_0x34e130(++_0x8efc1a);}(_0x4123,0x87));var _0x3412=function(_0x5528bc,_0x3fbeca){_0x5528bc=_0x5528bc-0x0;var _0x592eea=_0x4123[_0x5528bc];return _0x592eea;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var logger=require(_0x3412('0x2'))(_0x3412('0x3'));var moment=require(_0x3412('0x4'));var BPromise=require(_0x3412('0x5'));var rp=require(_0x3412('0x6'));var fs=require('fs');var path=require(_0x3412('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3412('0x8'));module[_0x3412('0x9')]=function(_0x48eb88,_0x11aa67){return _0x48eb88[_0x3412('0xa')](_0x3412('0xb'),attributes,{'tableName':_0x3412('0xc'),'paranoid':![],'indexes':[{'name':_0x3412('0xd'),'fields':[_0x3412('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac0d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x427b10,_0x345b56){var _0x52618c=function(_0x5bf9aa){while(--_0x5bf9aa){_0x427b10['push'](_0x427b10['shift']());}};_0x52618c(++_0x345b56);}(_0xac0d,0xb2));var _0xdac0=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xac0d[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xdac0('0x0'));var util=require(_0xdac0('0x1'));var logger=require(_0xdac0('0x2'))('api');var moment=require(_0xdac0('0x3'));var BPromise=require(_0xdac0('0x4'));var rp=require(_0xdac0('0x5'));var fs=require('fs');var path=require(_0xdac0('0x6'));var rimraf=require(_0xdac0('0x7'));var config=require(_0xdac0('0x8'));var attributes=require(_0xdac0('0x9'));module[_0xdac0('0xa')]=function(_0xce252c,_0x22ad56){return _0xce252c[_0xdac0('0xb')](_0xdac0('0xc'),attributes,{'tableName':_0xdac0('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdac0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index cb8186f..14c25db 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 _0x8222=['../../config/environment','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','ioredis','../../config/logger'];(function(_0x40f52c,_0x43aebb){var _0x3b9fa9=function(_0x492866){while(--_0x492866){_0x40f52c['push'](_0x40f52c['shift']());}};_0x3b9fa9(++_0x43aebb);}(_0x8222,0xeb));var _0x2822=function(_0x263d9c,_0x406b44){_0x263d9c=_0x263d9c-0x0;var _0x165ff6=_0x8222[_0x263d9c];return _0x165ff6;};'use strict';var _=require(_0x2822('0x0'));var util=require(_0x2822('0x1'));var moment=require(_0x2822('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2822('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2822('0x4'))('rpc');var config=require(_0x2822('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2822('0x6')][_0x2822('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x904d52,_0x360a86,_0x4bd754){return new BPromise(function(_0x59eecb,_0x7f6480){return client[_0x2822('0x8')](_0x904d52,_0x4bd754)[_0x2822('0x9')](function(_0x1b8f7f){logger['info'](_0x2822('0xa'),_0x360a86,'request\x20sent');logger[_0x2822('0xb')](_0x2822('0xc'),_0x360a86,'request\x20sent',JSON[_0x2822('0xd')](_0x1b8f7f));if(_0x1b8f7f[_0x2822('0xe')]){if(_0x1b8f7f[_0x2822('0xe')]['code']===0x1f4){logger['error'](_0x2822('0xa'),_0x360a86,_0x1b8f7f[_0x2822('0xe')]['message']);return _0x7f6480(_0x1b8f7f[_0x2822('0xe')][_0x2822('0xf')]);}logger[_0x2822('0xe')](_0x2822('0xa'),_0x360a86,_0x1b8f7f[_0x2822('0xe')][_0x2822('0xf')]);return _0x59eecb(_0x1b8f7f['error'][_0x2822('0xf')]);}else{logger[_0x2822('0x10')](_0x2822('0xa'),_0x360a86,_0x2822('0x11'));_0x59eecb(_0x1b8f7f[_0x2822('0x12')][_0x2822('0xf')]);}})[_0x2822('0x13')](function(_0x18139b){logger[_0x2822('0xe')](_0x2822('0xa'),_0x360a86,_0x18139b);_0x7f6480(_0x18139b);});});} \ No newline at end of file +var _0x90a0=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x90a0,0x168));var _0x090a=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x90a0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x090a('0x0'));var util=require(_0x090a('0x1'));var moment=require(_0x090a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x090a('0x3'));var db=require(_0x090a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x090a('0x5'));var config=require(_0x090a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x090a('0x7')][_0x090a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2202ac,_0x3db7b2,_0x2758c2){return new BPromise(function(_0xa3cd71,_0xe1752d){return client['request'](_0x2202ac,_0x2758c2)[_0x090a('0x9')](function(_0x491512){logger[_0x090a('0xa')](_0x090a('0xb'),_0x3db7b2,_0x090a('0xc'));logger[_0x090a('0xd')](_0x090a('0xe'),_0x3db7b2,'request\x20sent',JSON[_0x090a('0xf')](_0x491512));if(_0x491512[_0x090a('0x10')]){if(_0x491512['error'][_0x090a('0x11')]===0x1f4){logger['error'](_0x090a('0xb'),_0x3db7b2,_0x491512['error'][_0x090a('0x12')]);return _0xe1752d(_0x491512[_0x090a('0x10')]['message']);}logger[_0x090a('0x10')](_0x090a('0xb'),_0x3db7b2,_0x491512[_0x090a('0x10')]['message']);return _0xa3cd71(_0x491512[_0x090a('0x10')][_0x090a('0x12')]);}else{logger[_0x090a('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x3db7b2,'request\x20sent');_0xa3cd71(_0x491512[_0x090a('0x13')][_0x090a('0x12')]);}})[_0x090a('0x14')](function(_0xc88861){logger[_0x090a('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x3db7b2,_0xc88861);_0xe1752d(_0xc88861);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 738a90d..c713ce8 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 _0x048c=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2263d7,_0x3e5cad){var _0x23e823=function(_0x352a4b){while(--_0x352a4b){_0x2263d7['push'](_0x2263d7['shift']());}};_0x23e823(++_0x3e5cad);}(_0x048c,0x98));var _0xc048=function(_0x3740c1,_0x44772b){_0x3740c1=_0x3740c1-0x0;var _0x43b862=_0x048c[_0x3740c1];return _0x43b862;};'use strict';var multer=require(_0xc048('0x0'));var util=require(_0xc048('0x1'));var path=require(_0xc048('0x2'));var timeout=require(_0xc048('0x3'));var express=require(_0xc048('0x4'));var router=express[_0xc048('0x5')]();var fs_extra=require(_0xc048('0x6'));var auth=require(_0xc048('0x7'));var interaction=require(_0xc048('0x8'));var config=require(_0xc048('0x9'));var controller=require(_0xc048('0xa'));router[_0xc048('0xb')]('/',auth[_0xc048('0xc')](),controller[_0xc048('0xd')]);router['get'](_0xc048('0xe'),auth[_0xc048('0xc')](),controller[_0xc048('0xf')]);router[_0xc048('0xb')](_0xc048('0x10'),auth[_0xc048('0xc')](),controller[_0xc048('0x11')]);router[_0xc048('0x12')]('/',auth[_0xc048('0xc')](),controller[_0xc048('0x13')]);router[_0xc048('0x14')]('/:id',auth[_0xc048('0xc')](),controller[_0xc048('0x15')]);router[_0xc048('0x16')](_0xc048('0x10'),auth[_0xc048('0xc')](),controller['destroy']);module[_0xc048('0x17')]=router; \ No newline at end of file +var _0x4b7d=['get','index','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x56f63f,_0x59b821){var _0x1930b5=function(_0x1c4e31){while(--_0x1c4e31){_0x56f63f['push'](_0x56f63f['shift']());}};_0x1930b5(++_0x59b821);}(_0x4b7d,0x1df));var _0xd4b7=function(_0x342022,_0x1ee0f7){_0x342022=_0x342022-0x0;var _0x2065d3=_0x4b7d[_0x342022];return _0x2065d3;};'use strict';var multer=require('multer');var util=require(_0xd4b7('0x0'));var path=require('path');var timeout=require(_0xd4b7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd4b7('0x2'));var auth=require(_0xd4b7('0x3'));var interaction=require(_0xd4b7('0x4'));var config=require(_0xd4b7('0x5'));var controller=require(_0xd4b7('0x6'));router[_0xd4b7('0x7')]('/',auth['isAuthenticated'](),controller[_0xd4b7('0x8')]);router[_0xd4b7('0x7')]('/describe',auth[_0xd4b7('0x9')](),controller[_0xd4b7('0xa')]);router[_0xd4b7('0x7')](_0xd4b7('0xb'),auth[_0xd4b7('0x9')](),controller[_0xd4b7('0xc')]);router[_0xd4b7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd4b7('0xe')](_0xd4b7('0xb'),auth['isAuthenticated'](),controller[_0xd4b7('0xf')]);router[_0xd4b7('0x10')]('/:id',auth[_0xd4b7('0x9')](),controller[_0xd4b7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 4fffce1..6838ea5 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 _0x7e4f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','path','connect-timeout'];(function(_0xaf00d4,_0x1babea){var _0x955f2d=function(_0x5caab5){while(--_0x5caab5){_0xaf00d4['push'](_0xaf00d4['shift']());}};_0x955f2d(++_0x1babea);}(_0x7e4f,0xee));var _0xf7e4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7e4f[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf7e4('0x0'));var timeout=require(_0xf7e4('0x1'));var express=require(_0xf7e4('0x2'));var router=express['Router']();var fs_extra=require(_0xf7e4('0x3'));var auth=require(_0xf7e4('0x4'));var interaction=require(_0xf7e4('0x5'));var config=require(_0xf7e4('0x6'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xf7e4('0x7')](),controller[_0xf7e4('0x8')]);router[_0xf7e4('0x9')](_0xf7e4('0xa'),auth[_0xf7e4('0x7')](),controller[_0xf7e4('0xb')]);router[_0xf7e4('0x9')](_0xf7e4('0xc'),auth['isAuthenticated'](),controller[_0xf7e4('0xd')]);router[_0xf7e4('0x9')](_0xf7e4('0xe'),auth[_0xf7e4('0x7')](),controller[_0xf7e4('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf7e4('0x10')]);router[_0xf7e4('0x11')](_0xf7e4('0xc'),auth[_0xf7e4('0x7')](),controller[_0xf7e4('0x12')]);router['put'](_0xf7e4('0xa'),auth[_0xf7e4('0x7')](),controller[_0xf7e4('0x13')]);router['delete'](_0xf7e4('0xa'),auth[_0xf7e4('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x110d=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x110d,0x12b));var _0xd110=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0x110d[_0x1460ab];return _0x1eeb5c;};'use strict';var multer=require('multer');var util=require(_0xd110('0x0'));var path=require('path');var timeout=require(_0xd110('0x1'));var express=require(_0xd110('0x2'));var router=express[_0xd110('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd110('0x4'));var interaction=require(_0xd110('0x5'));var config=require(_0xd110('0x6'));var controller=require(_0xd110('0x7'));router[_0xd110('0x8')]('/',auth[_0xd110('0x9')](),controller[_0xd110('0xa')]);router[_0xd110('0x8')](_0xd110('0xb'),auth[_0xd110('0x9')](),controller['show']);router[_0xd110('0x8')](_0xd110('0xc'),auth[_0xd110('0x9')](),controller[_0xd110('0xd')]);router[_0xd110('0x8')](_0xd110('0xe'),auth['isAuthenticated'](),controller[_0xd110('0xf')]);router[_0xd110('0x10')]('/',auth[_0xd110('0x9')](),controller['create']);router[_0xd110('0x10')]('/:id/configurations',auth[_0xd110('0x9')](),controller[_0xd110('0x11')]);router[_0xd110('0x12')](_0xd110('0xb'),auth[_0xd110('0x9')](),controller[_0xd110('0x13')]);router[_0xd110('0x14')](_0xd110('0xb'),auth[_0xd110('0x9')](),controller[_0xd110('0x15')]);module[_0xd110('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5fbd225..6aaf186 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 _0x8f0d=['sequelize','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x1a3875,_0x593b5b){var _0x2de814=function(_0x169316){while(--_0x169316){_0x1a3875['push'](_0x1a3875['shift']());}};_0x2de814(++_0x593b5b);}(_0x8f0d,0xd8));var _0xd8f0=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x8f0d[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0xd8f0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd8f0('0x1')]},'description':{'type':Sequelize[_0xd8f0('0x1')]},'username':{'type':Sequelize[_0xd8f0('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xd8f0('0x2')]('basic'),'defaultValue':_0xd8f0('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0xd8f0('0x1')]},'consumerSecret':{'type':Sequelize[_0xd8f0('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd8f0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd8f0('0x2')](_0xd8f0('0x4'),_0xd8f0('0x5')),'defaultValue':_0xd8f0('0x4')}}; \ No newline at end of file +var _0x54d6=['newTab','sequelize','exports','STRING','ENUM'];(function(_0x45bbde,_0x5395ba){var _0x461478=function(_0x4093bf){while(--_0x4093bf){_0x45bbde['push'](_0x45bbde['shift']());}};_0x461478(++_0x5395ba);}(_0x54d6,0xc9));var _0x654d=function(_0x2a4219,_0x308999){_0x2a4219=_0x2a4219-0x0;var _0x331879=_0x54d6[_0x2a4219];return _0x331879;};'use strict';var Sequelize=require(_0x654d('0x0'));module[_0x654d('0x1')]={'name':{'type':Sequelize[_0x654d('0x2')]},'description':{'type':Sequelize[_0x654d('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x654d('0x2')]},'authType':{'type':Sequelize[_0x654d('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x654d('0x2')]},'consumerKey':{'type':Sequelize[_0x654d('0x2')]},'consumerSecret':{'type':Sequelize[_0x654d('0x2')]},'token':{'type':Sequelize[_0x654d('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x654d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x654d('0x3')]('integrationTab',_0x654d('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9ec980e..afd9207 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 _0xd443=['label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','update','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskConfiguration','getFields','priority','remoteUri','authType','username','password','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','application/json','basic','Authorization','%s:%s','base64','_embedded','entries'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xd443,0x1cf));var _0x3d44=function(_0x2c97ff,_0xafecc3){_0x2c97ff=_0x2c97ff-0x0;var _0x3a5bfb=_0xd443[_0x2c97ff];return _0x3a5bfb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d44('0x0'));var zipdir=require(_0x3d44('0x1'));var jsonpatch=require(_0x3d44('0x2'));var rp=require('request-promise');var moment=require(_0x3d44('0x3'));var BPromise=require(_0x3d44('0x4'));var Mustache=require(_0x3d44('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3d44('0x6'));var csv=require(_0x3d44('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d44('0x8'));var _=require(_0x3d44('0x9'));var squel=require(_0x3d44('0xa'));var crypto=require(_0x3d44('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3d44('0xc'));var toCsv=require(_0x3d44('0x7'));var querystring=require('querystring');var Papa=require(_0x3d44('0xd'));var Redis=require(_0x3d44('0xe'));var authService=require(_0x3d44('0xf'));var qs=require(_0x3d44('0x10'));var as=require(_0x3d44('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d44('0x12'))(_0x3d44('0x13'));var utils=require(_0x3d44('0x14'));var config=require(_0x3d44('0x15'));var licenseUtil=require(_0x3d44('0x16'));var db=require(_0x3d44('0x17'))['db'];var integrations=require(_0x3d44('0x18'));function respondWithStatusCode(_0x28d16e,_0x58c166){_0x58c166=_0x58c166||0xcc;return function(_0x820a6a){if(_0x820a6a){return _0x28d16e['sendStatus'](_0x58c166);}return _0x28d16e[_0x3d44('0x19')](_0x58c166)[_0x3d44('0x1a')]();};}function respondWithResult(_0x2be17b,_0x445792){_0x445792=_0x445792||0xc8;return function(_0x160ed3){if(_0x160ed3){return _0x2be17b[_0x3d44('0x19')](_0x445792)['json'](_0x160ed3);}};}function respondWithFilteredResult(_0x1f7f07,_0x387d05){return function(_0x5164da){if(_0x5164da){var _0x56bc1f=typeof _0x387d05[_0x3d44('0x1b')]==='undefined'&&typeof _0x387d05[_0x3d44('0x1c')]===_0x3d44('0x1d');var _0x243f26=_0x5164da[_0x3d44('0x1e')];var _0x3e7242=_0x56bc1f?0x0:_0x387d05[_0x3d44('0x1b')];var _0x44e823=_0x56bc1f?_0x5164da[_0x3d44('0x1e')]:_0x387d05[_0x3d44('0x1b')]+_0x387d05[_0x3d44('0x1c')];var _0x1d1226;if(_0x44e823>=_0x243f26){_0x44e823=_0x243f26;_0x1d1226=0xc8;}else{_0x1d1226=0xce;}_0x1f7f07[_0x3d44('0x19')](_0x1d1226);return _0x1f7f07[_0x3d44('0x1f')]('Content-Range',_0x3e7242+'-'+_0x44e823+'/'+_0x243f26)[_0x3d44('0x20')](_0x5164da);}return null;};}function patchUpdates(_0x41ca10){return function(_0x4d443b){try{jsonpatch[_0x3d44('0x21')](_0x4d443b,_0x41ca10,!![]);}catch(_0x166e27){return BPromise[_0x3d44('0x22')](_0x166e27);}return _0x4d443b[_0x3d44('0x23')]();};}function saveUpdates(_0x1fe493,_0xee3586){return function(_0x61bc09){if(_0x61bc09){return _0x61bc09['update'](_0x1fe493)[_0x3d44('0x24')](function(_0x3a8c3e){return _0x3a8c3e;});}return null;};}function removeEntity(_0x3d80b0,_0x43ca0a){return function(_0x2f975d){if(_0x2f975d){return _0x2f975d[_0x3d44('0x25')]()[_0x3d44('0x24')](function(){_0x3d80b0[_0x3d44('0x19')](0xcc)[_0x3d44('0x1a')]();});}};}function handleEntityNotFound(_0x20391d,_0xd554){return function(_0x201760){if(!_0x201760){_0x20391d[_0x3d44('0x26')](0x194);}return _0x201760;};}function handleError(_0x589c39,_0x43a4fa){_0x43a4fa=_0x43a4fa||0x1f4;return function(_0x2c93ec){logger[_0x3d44('0x27')](_0x2c93ec[_0x3d44('0x28')]);if(_0x2c93ec[_0x3d44('0x29')]){delete _0x2c93ec[_0x3d44('0x29')];}_0x589c39['status'](_0x43a4fa)['send'](_0x2c93ec);};}exports[_0x3d44('0x2a')]=function(_0x5978bd,_0x156db4){var _0x66fca9={},_0x399ee2={},_0x44758f={'count':0x0,'rows':[]};var _0x16e328=_['map'](db[_0x3d44('0x2b')][_0x3d44('0x2c')],function(_0x3fa58b){return{'name':_0x3fa58b[_0x3d44('0x2d')],'type':_0x3fa58b[_0x3d44('0x2e')][_0x3d44('0x2f')]};});_0x399ee2[_0x3d44('0x30')]=_['map'](_0x16e328,_0x3d44('0x29'));_0x399ee2[_0x3d44('0x31')]=_[_0x3d44('0x32')](_0x5978bd[_0x3d44('0x31')]);_0x399ee2[_0x3d44('0x33')]=_['intersection'](_0x399ee2[_0x3d44('0x30')],_0x399ee2['query']);_0x66fca9[_0x3d44('0x34')]=_[_0x3d44('0x35')](_0x399ee2[_0x3d44('0x30')],qs[_0x3d44('0x36')](_0x5978bd[_0x3d44('0x31')][_0x3d44('0x36')]));_0x66fca9['attributes']=_0x66fca9[_0x3d44('0x34')][_0x3d44('0x37')]?_0x66fca9[_0x3d44('0x34')]:_0x399ee2[_0x3d44('0x30')];if(!_0x5978bd[_0x3d44('0x31')][_0x3d44('0x38')](_0x3d44('0x39'))){_0x66fca9[_0x3d44('0x1c')]=qs[_0x3d44('0x1c')](_0x5978bd[_0x3d44('0x31')][_0x3d44('0x1c')]);_0x66fca9[_0x3d44('0x1b')]=qs[_0x3d44('0x1b')](_0x5978bd[_0x3d44('0x31')][_0x3d44('0x1b')]);}_0x66fca9['order']=qs[_0x3d44('0x3a')](_0x5978bd[_0x3d44('0x31')][_0x3d44('0x3a')]);_0x66fca9[_0x3d44('0x3b')]=qs[_0x3d44('0x33')](_[_0x3d44('0x3c')](_0x5978bd['query'],_0x399ee2['filters']),_0x16e328);if(_0x5978bd[_0x3d44('0x31')]['filter']){_0x66fca9[_0x3d44('0x3b')]=_['merge'](_0x66fca9[_0x3d44('0x3b')],{'$or':_[_0x3d44('0x3d')](_0x16e328,function(_0x4edbfe){if(_0x4edbfe[_0x3d44('0x2e')]!=='VIRTUAL'){var _0x4f0b64={};_0x4f0b64[_0x4edbfe[_0x3d44('0x29')]]={'$like':'%'+_0x5978bd[_0x3d44('0x31')][_0x3d44('0x3e')]+'%'};return _0x4f0b64;}})});}_0x66fca9=_['merge']({},_0x66fca9,_0x5978bd[_0x3d44('0x3f')]);var _0xc7447={'where':_0x66fca9[_0x3d44('0x3b')]};return db[_0x3d44('0x2b')]['count'](_0xc7447)['then'](function(_0x477db7){_0x44758f[_0x3d44('0x1e')]=_0x477db7;if(_0x5978bd[_0x3d44('0x31')][_0x3d44('0x40')]){_0x66fca9[_0x3d44('0x41')]=[{'all':!![]}];}return db[_0x3d44('0x2b')][_0x3d44('0x42')](_0x66fca9);})[_0x3d44('0x24')](function(_0x22b542){_0x44758f[_0x3d44('0x43')]=_0x22b542;return _0x44758f;})[_0x3d44('0x24')](respondWithFilteredResult(_0x156db4,_0x66fca9))[_0x3d44('0x44')](handleError(_0x156db4,null));};exports[_0x3d44('0x45')]=function(_0x1418ec,_0x5428e6){var _0x5a30ff={'raw':![],'where':{'id':_0x1418ec[_0x3d44('0x46')]['id']}},_0xc070a2={};_0xc070a2['model']=_[_0x3d44('0x32')](db[_0x3d44('0x2b')][_0x3d44('0x2c')]);_0xc070a2[_0x3d44('0x31')]=_[_0x3d44('0x32')](_0x1418ec[_0x3d44('0x31')]);_0xc070a2[_0x3d44('0x33')]=_['intersection'](_0xc070a2[_0x3d44('0x30')],_0xc070a2[_0x3d44('0x31')]);_0x5a30ff[_0x3d44('0x34')]=_[_0x3d44('0x35')](_0xc070a2[_0x3d44('0x30')],qs[_0x3d44('0x36')](_0x1418ec[_0x3d44('0x31')][_0x3d44('0x36')]));_0x5a30ff[_0x3d44('0x34')]=_0x5a30ff['attributes']['length']?_0x5a30ff[_0x3d44('0x34')]:_0xc070a2[_0x3d44('0x30')];if(_0x1418ec[_0x3d44('0x31')][_0x3d44('0x40')]){_0x5a30ff[_0x3d44('0x41')]=[{'all':!![]}];}_0x5a30ff=_[_0x3d44('0x47')]({},_0x5a30ff,_0x1418ec[_0x3d44('0x3f')]);return db[_0x3d44('0x2b')][_0x3d44('0x48')](_0x5a30ff)['then'](handleEntityNotFound(_0x5428e6,null))[_0x3d44('0x24')](respondWithResult(_0x5428e6,null))['catch'](handleError(_0x5428e6,null));};exports[_0x3d44('0x49')]=function(_0x24d875,_0x193740){return db[_0x3d44('0x2b')]['create'](_0x24d875['body'],{})[_0x3d44('0x24')](respondWithResult(_0x193740,0xc9))['catch'](handleError(_0x193740,null));};exports[_0x3d44('0x4a')]=function(_0x45c3fa,_0x1ee307){if(_0x45c3fa['body']['id']){delete _0x45c3fa[_0x3d44('0x4b')]['id'];}return db[_0x3d44('0x2b')]['find']({'where':{'id':_0x45c3fa[_0x3d44('0x46')]['id']}})[_0x3d44('0x24')](handleEntityNotFound(_0x1ee307,null))['then'](saveUpdates(_0x45c3fa['body'],null))[_0x3d44('0x24')](respondWithResult(_0x1ee307,null))[_0x3d44('0x44')](handleError(_0x1ee307,null));};exports[_0x3d44('0x25')]=function(_0x3199d4,_0x23e550){return db[_0x3d44('0x2b')]['find']({'where':{'id':_0x3199d4[_0x3d44('0x46')]['id']}})[_0x3d44('0x24')](handleEntityNotFound(_0x23e550,null))[_0x3d44('0x24')](removeEntity(_0x23e550,null))[_0x3d44('0x44')](handleError(_0x23e550,null));};exports[_0x3d44('0x4c')]=function(_0x29e2e4,_0x5329a6,_0xf8a2f5){var _0x1cd413={};var _0x1da35b={};var _0x39bf56;var _0x561bd1;return db[_0x3d44('0x2b')][_0x3d44('0x4d')]({'where':{'id':_0x29e2e4[_0x3d44('0x46')]['id']}})[_0x3d44('0x24')](handleEntityNotFound(_0x5329a6,null))['then'](function(_0x3ab567){if(_0x3ab567){_0x39bf56=_0x3ab567;_0x1da35b[_0x3d44('0x30')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x1da35b[_0x3d44('0x31')]=_[_0x3d44('0x32')](_0x29e2e4['query']);_0x1da35b[_0x3d44('0x33')]=_[_0x3d44('0x35')](_0x1da35b['model'],_0x1da35b['query']);_0x1cd413['attributes']=_['intersection'](_0x1da35b['model'],qs[_0x3d44('0x36')](_0x29e2e4[_0x3d44('0x31')][_0x3d44('0x36')]));_0x1cd413[_0x3d44('0x34')]=_0x1cd413[_0x3d44('0x34')]['length']?_0x1cd413['attributes']:_0x1da35b[_0x3d44('0x30')];_0x1cd413[_0x3d44('0x4e')]=qs['sort'](_0x29e2e4['query']['sort']);_0x1cd413[_0x3d44('0x3b')]=qs[_0x3d44('0x33')](_['pick'](_0x29e2e4[_0x3d44('0x31')],_0x1da35b[_0x3d44('0x33')]));if(_0x29e2e4[_0x3d44('0x31')][_0x3d44('0x3e')]){_0x1cd413[_0x3d44('0x3b')]=_['merge'](_0x1cd413[_0x3d44('0x3b')],{'$or':_[_0x3d44('0x3d')](_0x1cd413['attributes'],function(_0x51be7d){var _0xc5fd9a={};_0xc5fd9a[_0x51be7d]={'$like':'%'+_0x29e2e4[_0x3d44('0x31')][_0x3d44('0x3e')]+'%'};return _0xc5fd9a;})});}_0x1cd413=_[_0x3d44('0x47')]({},_0x1cd413,_0x29e2e4[_0x3d44('0x3f')]);return _0x39bf56[_0x3d44('0x4c')](_0x1cd413);}})[_0x3d44('0x24')](function(_0x3423ed){if(_0x3423ed){_0x561bd1=_0x3423ed[_0x3d44('0x37')];if(!_0x29e2e4[_0x3d44('0x31')][_0x3d44('0x38')](_0x3d44('0x39'))){_0x1cd413[_0x3d44('0x1c')]=qs['limit'](_0x29e2e4['query']['limit']);_0x1cd413[_0x3d44('0x1b')]=qs[_0x3d44('0x1b')](_0x29e2e4[_0x3d44('0x31')][_0x3d44('0x1b')]);}return _0x39bf56[_0x3d44('0x4c')](_0x1cd413);}})[_0x3d44('0x24')](function(_0x263e78){if(_0x263e78){return _0x263e78?{'count':_0x561bd1,'rows':_0x263e78}:null;}})[_0x3d44('0x24')](respondWithResult(_0x5329a6,null))[_0x3d44('0x44')](handleError(_0x5329a6,null));};exports[_0x3d44('0x4f')]=function(_0x265328,_0x365c54,_0x4286a3){if(_0x265328[_0x3d44('0x4b')]['id']){delete _0x265328[_0x3d44('0x4b')]['id'];}return db[_0x3d44('0x2b')][_0x3d44('0x4d')]({'where':{'id':_0x265328['params']['id']}})[_0x3d44('0x24')](handleEntityNotFound(_0x365c54,null))[_0x3d44('0x24')](function(_0x277b42){if(_0x277b42){_0x265328[_0x3d44('0x4b')][_0x3d44('0x50')]=_0x277b42['id'];_0x265328[_0x3d44('0x4b')][_0x3d44('0x51')]=integrations[_0x3d44('0x52')](_0x265328[_0x3d44('0x4b')][_0x3d44('0x53')],_0x265328[_0x3d44('0x4b')]['type']);_0x265328['body'][_0x3d44('0x54')]=integrations['getDescriptions'](_0x265328[_0x3d44('0x4b')][_0x3d44('0x53')],_0x265328[_0x3d44('0x4b')][_0x3d44('0x2e')]);return db[_0x3d44('0x55')][_0x3d44('0x49')](_0x265328['body'],{'include':[{'model':db['DeskField'],'as':_0x3d44('0x51')},{'model':db['DeskField'],'as':_0x3d44('0x54')}]});}return null;})[_0x3d44('0x24')](respondWithResult(_0x365c54,null))[_0x3d44('0x44')](handleError(_0x365c54,null));};exports[_0x3d44('0x56')]=function(_0x1987a0,_0x339ec0,_0x3b8996){var _0x227cc9=[{'name':'priority','label':_0x3d44('0x57'),'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 _0x16058d='';return db['DeskAccount'][_0x3d44('0x4d')]({'where':{'id':_0x1987a0[_0x3d44('0x46')]['id']},'attributes':['id',_0x3d44('0x58'),_0x3d44('0x59'),_0x3d44('0x5a'),_0x3d44('0x5b'),_0x3d44('0x5c'),'consumerSecret',_0x3d44('0x5d'),_0x3d44('0x5e')]})[_0x3d44('0x24')](handleEntityNotFound(_0x339ec0,null))[_0x3d44('0x24')](function(_0x1f32bb){if(_0x1f32bb){_0x16058d=_0x1f32bb[_0x3d44('0x58')];var _0x4db10e=_0x16058d[_0x3d44('0x5f')](-0x1);if(_0x4db10e==='/'){_0x16058d=_0x16058d[_0x3d44('0x60')](0x0,_0x16058d[_0x3d44('0x61')](_0x4db10e));}var _0x13cb35={'method':_0x3d44('0x62'),'uri':util[_0x3d44('0x63')]('%s/custom_fields',_0x16058d),'headers':{'Content-Type':_0x3d44('0x64'),'Accept':_0x3d44('0x64')},'json':!![]};if(_0x1f32bb[_0x3d44('0x59')]===_0x3d44('0x65')){_0x13cb35['headers'][_0x3d44('0x66')]=util[_0x3d44('0x63')]('Basic\x20%s',new Buffer(util[_0x3d44('0x63')](_0x3d44('0x67'),_0x1f32bb[_0x3d44('0x5a')],_0x1f32bb[_0x3d44('0x5b')]))['toString'](_0x3d44('0x68')));}return rp(_0x13cb35)[_0x3d44('0x24')](function(_0x448579){return _0x227cc9['concat'](_[_0x3d44('0x3d')](_0x448579[_0x3d44('0x69')][_0x3d44('0x6a')],function(_0x3f46ec){return{'id':_0x3f46ec['name'],'name':_0x3f46ec[_0x3d44('0x29')],'type':_0x3f46ec[_0x3d44('0x2e')],'active':_0x3f46ec['active'],'label':_0x3f46ec[_0x3d44('0x6b')],'custom':!![]};}));});}})[_0x3d44('0x24')](function(_0xc4cfb3){return{'count':_0xc4cfb3['length'],'rows':_0xc4cfb3};})['then'](respondWithResult(_0x339ec0,null))['catch'](function(_0x576b9b){var _0x520f4a=_0x1987a0[_0x3d44('0x31')][_0x3d44('0x6c')]?0x1f4:_0x576b9b['statusCode']||0x1f4;logger[_0x3d44('0x27')](_0x3d44('0x6d'),_0x3d44('0x56'),_0x520f4a,JSON[_0x3d44('0x6e')](_0x576b9b));delete _0x576b9b['name'];if(_0x520f4a===0x191){_0x520f4a=0x190;}_0x339ec0[_0x3d44('0x19')](_0x520f4a)[_0x3d44('0x6f')](_0x1987a0[_0x3d44('0x31')][_0x3d44('0x6c')]?{'message':_0x3d44('0x70'),'statusCode':_0x576b9b[_0x3d44('0x71')]}:_0x576b9b);});}; \ No newline at end of file +var _0x500c=['Authorization','Basic\x20%s','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','username','password','consumerKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers'];(function(_0x4e06c6,_0x5cffa0){var _0x1dccb6=function(_0x543f7c){while(--_0x543f7c){_0x4e06c6['push'](_0x4e06c6['shift']());}};_0x1dccb6(++_0x5cffa0);}(_0x500c,0x1c5));var _0xc500=function(_0x19ab18,_0x1f2b1d){_0x19ab18=_0x19ab18-0x0;var _0x1e353a=_0x500c[_0x19ab18];return _0x1e353a;};'use strict';var emlformat=require(_0xc500('0x0'));var rimraf=require(_0xc500('0x1'));var zipdir=require(_0xc500('0x2'));var jsonpatch=require(_0xc500('0x3'));var rp=require(_0xc500('0x4'));var moment=require('moment');var BPromise=require(_0xc500('0x5'));var Mustache=require(_0xc500('0x6'));var util=require(_0xc500('0x7'));var path=require(_0xc500('0x8'));var sox=require('sox');var csv=require(_0xc500('0x9'));var ejs=require(_0xc500('0xa'));var fs=require('fs');var fs_extra=require(_0xc500('0xb'));var _=require(_0xc500('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc500('0xd'));var deskjs=require(_0xc500('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc500('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc500('0x10'));var qs=require(_0xc500('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc500('0x12'));var utils=require(_0xc500('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc500('0x14'));var db=require(_0xc500('0x15'))['db'];var integrations=require(_0xc500('0x16'));function respondWithStatusCode(_0x5a0276,_0x470373){_0x470373=_0x470373||0xcc;return function(_0x10ab24){if(_0x10ab24){return _0x5a0276[_0xc500('0x17')](_0x470373);}return _0x5a0276[_0xc500('0x18')](_0x470373)[_0xc500('0x19')]();};}function respondWithResult(_0x547633,_0x2516c4){_0x2516c4=_0x2516c4||0xc8;return function(_0x4edef7){if(_0x4edef7){return _0x547633['status'](_0x2516c4)[_0xc500('0x1a')](_0x4edef7);}};}function respondWithFilteredResult(_0x50aea3,_0x3f79b7){return function(_0x25eb89){if(_0x25eb89){var _0x27b516=typeof _0x3f79b7[_0xc500('0x1b')]==='undefined'&&typeof _0x3f79b7[_0xc500('0x1c')]===_0xc500('0x1d');var _0x1ca6e4=_0x25eb89['count'];var _0x50943b=_0x27b516?0x0:_0x3f79b7['offset'];var _0x103adc=_0x27b516?_0x25eb89[_0xc500('0x1e')]:_0x3f79b7[_0xc500('0x1b')]+_0x3f79b7[_0xc500('0x1c')];var _0x23b7c7;if(_0x103adc>=_0x1ca6e4){_0x103adc=_0x1ca6e4;_0x23b7c7=0xc8;}else{_0x23b7c7=0xce;}_0x50aea3[_0xc500('0x18')](_0x23b7c7);return _0x50aea3['set'](_0xc500('0x1f'),_0x50943b+'-'+_0x103adc+'/'+_0x1ca6e4)[_0xc500('0x1a')](_0x25eb89);}return null;};}function patchUpdates(_0x54a619){return function(_0x5f2381){try{jsonpatch[_0xc500('0x20')](_0x5f2381,_0x54a619,!![]);}catch(_0x20a918){return BPromise[_0xc500('0x21')](_0x20a918);}return _0x5f2381[_0xc500('0x22')]();};}function saveUpdates(_0x342e2c,_0x5c8361){return function(_0x4b20c1){if(_0x4b20c1){return _0x4b20c1[_0xc500('0x23')](_0x342e2c)[_0xc500('0x24')](function(_0x664929){return _0x664929;});}return null;};}function removeEntity(_0x54cf0b,_0x1f496f){return function(_0x1c790d){if(_0x1c790d){return _0x1c790d[_0xc500('0x25')]()[_0xc500('0x24')](function(){_0x54cf0b[_0xc500('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b846e,_0x504cc5){return function(_0x5cff95){if(!_0x5cff95){_0x5b846e[_0xc500('0x17')](0x194);}return _0x5cff95;};}function handleError(_0xac53e3,_0x1800d9){_0x1800d9=_0x1800d9||0x1f4;return function(_0x385643){logger[_0xc500('0x26')](_0x385643['stack']);if(_0x385643[_0xc500('0x27')]){delete _0x385643[_0xc500('0x27')];}_0xac53e3[_0xc500('0x18')](_0x1800d9)[_0xc500('0x28')](_0x385643);};}exports[_0xc500('0x29')]=function(_0x2f9e18,_0x29f8d1){var _0x189e85={},_0x572b4e={},_0x55bae1={'count':0x0,'rows':[]};var _0x58331c=_[_0xc500('0x2a')](db[_0xc500('0x2b')][_0xc500('0x2c')],function(_0x8b3b73){return{'name':_0x8b3b73[_0xc500('0x2d')],'type':_0x8b3b73[_0xc500('0x2e')][_0xc500('0x2f')]};});_0x572b4e['model']=_[_0xc500('0x2a')](_0x58331c,_0xc500('0x27'));_0x572b4e[_0xc500('0x30')]=_[_0xc500('0x31')](_0x2f9e18['query']);_0x572b4e[_0xc500('0x32')]=_[_0xc500('0x33')](_0x572b4e[_0xc500('0x34')],_0x572b4e[_0xc500('0x30')]);_0x189e85[_0xc500('0x35')]=_[_0xc500('0x33')](_0x572b4e['model'],qs[_0xc500('0x36')](_0x2f9e18[_0xc500('0x30')][_0xc500('0x36')]));_0x189e85[_0xc500('0x35')]=_0x189e85[_0xc500('0x35')][_0xc500('0x37')]?_0x189e85[_0xc500('0x35')]:_0x572b4e[_0xc500('0x34')];if(!_0x2f9e18[_0xc500('0x30')][_0xc500('0x38')]('nolimit')){_0x189e85['limit']=qs['limit'](_0x2f9e18[_0xc500('0x30')][_0xc500('0x1c')]);_0x189e85['offset']=qs[_0xc500('0x1b')](_0x2f9e18[_0xc500('0x30')]['offset']);}_0x189e85[_0xc500('0x39')]=qs[_0xc500('0x3a')](_0x2f9e18[_0xc500('0x30')][_0xc500('0x3a')]);_0x189e85['where']=qs[_0xc500('0x32')](_[_0xc500('0x3b')](_0x2f9e18[_0xc500('0x30')],_0x572b4e[_0xc500('0x32')]),_0x58331c);if(_0x2f9e18[_0xc500('0x30')][_0xc500('0x3c')]){_0x189e85[_0xc500('0x3d')]=_['merge'](_0x189e85[_0xc500('0x3d')],{'$or':_[_0xc500('0x2a')](_0x58331c,function(_0x134b7c){if(_0x134b7c['type']!=='VIRTUAL'){var _0x2102d8={};_0x2102d8[_0x134b7c[_0xc500('0x27')]]={'$like':'%'+_0x2f9e18[_0xc500('0x30')][_0xc500('0x3c')]+'%'};return _0x2102d8;}})});}_0x189e85=_[_0xc500('0x3e')]({},_0x189e85,_0x2f9e18[_0xc500('0x3f')]);var _0x5af122={'where':_0x189e85[_0xc500('0x3d')]};return db[_0xc500('0x2b')][_0xc500('0x1e')](_0x5af122)[_0xc500('0x24')](function(_0x4e0b84){_0x55bae1[_0xc500('0x1e')]=_0x4e0b84;if(_0x2f9e18[_0xc500('0x30')][_0xc500('0x40')]){_0x189e85[_0xc500('0x41')]=[{'all':!![]}];}return db[_0xc500('0x2b')][_0xc500('0x42')](_0x189e85);})[_0xc500('0x24')](function(_0x112f4b){_0x55bae1['rows']=_0x112f4b;return _0x55bae1;})[_0xc500('0x24')](respondWithFilteredResult(_0x29f8d1,_0x189e85))[_0xc500('0x43')](handleError(_0x29f8d1,null));};exports[_0xc500('0x44')]=function(_0x557922,_0x5df759){var _0x124c3c={'raw':![],'where':{'id':_0x557922['params']['id']}},_0x1700e4={};_0x1700e4['model']=_[_0xc500('0x31')](db[_0xc500('0x2b')][_0xc500('0x2c')]);_0x1700e4['query']=_[_0xc500('0x31')](_0x557922['query']);_0x1700e4[_0xc500('0x32')]=_[_0xc500('0x33')](_0x1700e4[_0xc500('0x34')],_0x1700e4[_0xc500('0x30')]);_0x124c3c['attributes']=_[_0xc500('0x33')](_0x1700e4[_0xc500('0x34')],qs[_0xc500('0x36')](_0x557922['query'][_0xc500('0x36')]));_0x124c3c[_0xc500('0x35')]=_0x124c3c[_0xc500('0x35')][_0xc500('0x37')]?_0x124c3c[_0xc500('0x35')]:_0x1700e4['model'];if(_0x557922[_0xc500('0x30')][_0xc500('0x40')]){_0x124c3c[_0xc500('0x41')]=[{'all':!![]}];}_0x124c3c=_['merge']({},_0x124c3c,_0x557922[_0xc500('0x3f')]);return db[_0xc500('0x2b')][_0xc500('0x45')](_0x124c3c)[_0xc500('0x24')](handleEntityNotFound(_0x5df759,null))['then'](respondWithResult(_0x5df759,null))['catch'](handleError(_0x5df759,null));};exports[_0xc500('0x46')]=function(_0x996edf,_0xb0e695){return db[_0xc500('0x2b')]['create'](_0x996edf[_0xc500('0x47')],{})[_0xc500('0x24')](respondWithResult(_0xb0e695,0xc9))[_0xc500('0x43')](handleError(_0xb0e695,null));};exports['update']=function(_0xae7bbd,_0x23b8cc){if(_0xae7bbd[_0xc500('0x47')]['id']){delete _0xae7bbd[_0xc500('0x47')]['id'];}return db[_0xc500('0x2b')][_0xc500('0x45')]({'where':{'id':_0xae7bbd['params']['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x23b8cc,null))['then'](saveUpdates(_0xae7bbd['body'],null))['then'](respondWithResult(_0x23b8cc,null))[_0xc500('0x43')](handleError(_0x23b8cc,null));};exports['destroy']=function(_0x5c32fc,_0x659d68){return db[_0xc500('0x2b')][_0xc500('0x45')]({'where':{'id':_0x5c32fc[_0xc500('0x48')]['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x659d68,null))[_0xc500('0x24')](removeEntity(_0x659d68,null))['catch'](handleError(_0x659d68,null));};exports['getConfigurations']=function(_0x4ac8fc,_0x5a850c,_0x5a15d0){var _0x5cf801={};var _0x1b14cc={};var _0x58221a;var _0x4b9712;return db[_0xc500('0x2b')][_0xc500('0x49')]({'where':{'id':_0x4ac8fc[_0xc500('0x48')]['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x5a850c,null))[_0xc500('0x24')](function(_0x23a86c){if(_0x23a86c){_0x58221a=_0x23a86c;_0x1b14cc[_0xc500('0x34')]=_[_0xc500('0x31')](db[_0xc500('0x4a')][_0xc500('0x2c')]);_0x1b14cc[_0xc500('0x30')]=_[_0xc500('0x31')](_0x4ac8fc[_0xc500('0x30')]);_0x1b14cc['filters']=_[_0xc500('0x33')](_0x1b14cc['model'],_0x1b14cc['query']);_0x5cf801[_0xc500('0x35')]=_[_0xc500('0x33')](_0x1b14cc[_0xc500('0x34')],qs[_0xc500('0x36')](_0x4ac8fc['query'][_0xc500('0x36')]));_0x5cf801['attributes']=_0x5cf801[_0xc500('0x35')][_0xc500('0x37')]?_0x5cf801[_0xc500('0x35')]:_0x1b14cc[_0xc500('0x34')];_0x5cf801[_0xc500('0x39')]=qs['sort'](_0x4ac8fc[_0xc500('0x30')]['sort']);_0x5cf801[_0xc500('0x3d')]=qs[_0xc500('0x32')](_[_0xc500('0x3b')](_0x4ac8fc[_0xc500('0x30')],_0x1b14cc[_0xc500('0x32')]));if(_0x4ac8fc[_0xc500('0x30')][_0xc500('0x3c')]){_0x5cf801[_0xc500('0x3d')]=_[_0xc500('0x3e')](_0x5cf801[_0xc500('0x3d')],{'$or':_[_0xc500('0x2a')](_0x5cf801[_0xc500('0x35')],function(_0x4ae6e0){var _0x5a4c0d={};_0x5a4c0d[_0x4ae6e0]={'$like':'%'+_0x4ac8fc[_0xc500('0x30')]['filter']+'%'};return _0x5a4c0d;})});}_0x5cf801=_['merge']({},_0x5cf801,_0x4ac8fc[_0xc500('0x3f')]);return _0x58221a['getConfigurations'](_0x5cf801);}})[_0xc500('0x24')](function(_0x1238e3){if(_0x1238e3){_0x4b9712=_0x1238e3[_0xc500('0x37')];if(!_0x4ac8fc[_0xc500('0x30')][_0xc500('0x38')]('nolimit')){_0x5cf801[_0xc500('0x1c')]=qs[_0xc500('0x1c')](_0x4ac8fc[_0xc500('0x30')][_0xc500('0x1c')]);_0x5cf801[_0xc500('0x1b')]=qs[_0xc500('0x1b')](_0x4ac8fc[_0xc500('0x30')]['offset']);}return _0x58221a['getConfigurations'](_0x5cf801);}})[_0xc500('0x24')](function(_0x1a9eae){if(_0x1a9eae){return _0x1a9eae?{'count':_0x4b9712,'rows':_0x1a9eae}:null;}})['then'](respondWithResult(_0x5a850c,null))[_0xc500('0x43')](handleError(_0x5a850c,null));};exports[_0xc500('0x4b')]=function(_0x183df0,_0x3b725a,_0x42e687){if(_0x183df0[_0xc500('0x47')]['id']){delete _0x183df0[_0xc500('0x47')]['id'];}return db[_0xc500('0x2b')]['findOne']({'where':{'id':_0x183df0[_0xc500('0x48')]['id']}})[_0xc500('0x24')](handleEntityNotFound(_0x3b725a,null))[_0xc500('0x24')](function(_0x3d4460){if(_0x3d4460){_0x183df0['body']['AccountId']=_0x3d4460['id'];_0x183df0[_0xc500('0x47')][_0xc500('0x4c')]=integrations[_0xc500('0x4d')](_0x183df0[_0xc500('0x47')][_0xc500('0x4e')],_0x183df0[_0xc500('0x47')]['type']);_0x183df0[_0xc500('0x47')]['Descriptions']=integrations[_0xc500('0x4f')](_0x183df0[_0xc500('0x47')][_0xc500('0x4e')],_0x183df0[_0xc500('0x47')][_0xc500('0x2e')]);return db['DeskConfiguration'][_0xc500('0x46')](_0x183df0[_0xc500('0x47')],{'include':[{'model':db[_0xc500('0x50')],'as':'Subjects'},{'model':db[_0xc500('0x50')],'as':_0xc500('0x51')}]});}return null;})[_0xc500('0x24')](respondWithResult(_0x3b725a,null))[_0xc500('0x43')](handleError(_0x3b725a,null));};exports['getFields']=function(_0x405024,_0x4ee438,_0x430e91){var _0x5af52d=[{'name':_0xc500('0x52'),'label':_0xc500('0x52'),'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 _0x5df220='';return db[_0xc500('0x2b')][_0xc500('0x49')]({'where':{'id':_0x405024[_0xc500('0x48')]['id']},'attributes':['id','remoteUri','authType',_0xc500('0x53'),_0xc500('0x54'),_0xc500('0x55'),'consumerSecret','token','tokenSecret']})[_0xc500('0x24')](handleEntityNotFound(_0x4ee438,null))[_0xc500('0x24')](function(_0x81c735){if(_0x81c735){_0x5df220=_0x81c735[_0xc500('0x56')];var _0x50dfa9=_0x5df220[_0xc500('0x57')](-0x1);if(_0x50dfa9==='/'){_0x5df220=_0x5df220[_0xc500('0x58')](0x0,_0x5df220[_0xc500('0x59')](_0x50dfa9));}var _0xac5bab={'method':_0xc500('0x5a'),'uri':util[_0xc500('0x5b')](_0xc500('0x5c'),_0x5df220),'headers':{'Content-Type':'application/json','Accept':_0xc500('0x5d')},'json':!![]};if(_0x81c735[_0xc500('0x5e')]===_0xc500('0x5f')){_0xac5bab[_0xc500('0x60')][_0xc500('0x61')]=util[_0xc500('0x5b')](_0xc500('0x62'),new Buffer(util[_0xc500('0x5b')]('%s:%s',_0x81c735[_0xc500('0x53')],_0x81c735[_0xc500('0x54')]))['toString'](_0xc500('0x63')));}return rp(_0xac5bab)['then'](function(_0x33d9a8){return _0x5af52d[_0xc500('0x64')](_[_0xc500('0x2a')](_0x33d9a8['_embedded'][_0xc500('0x65')],function(_0x1d77d3){return{'id':_0x1d77d3[_0xc500('0x27')],'name':_0x1d77d3[_0xc500('0x27')],'type':_0x1d77d3[_0xc500('0x2e')],'active':_0x1d77d3[_0xc500('0x66')],'label':_0x1d77d3[_0xc500('0x67')],'custom':!![]};}));});}})[_0xc500('0x24')](function(_0x58a6d0){return{'count':_0x58a6d0[_0xc500('0x37')],'rows':_0x58a6d0};})[_0xc500('0x24')](respondWithResult(_0x4ee438,null))['catch'](function(_0x11a15b){var _0x21dd85=_0x405024[_0xc500('0x30')][_0xc500('0x68')]?0x1f4:_0x11a15b[_0xc500('0x69')]||0x1f4;logger['error'](_0xc500('0x6a'),_0xc500('0x6b'),_0x21dd85,JSON[_0xc500('0x6c')](_0x11a15b));delete _0x11a15b[_0xc500('0x27')];if(_0x21dd85===0x191){_0x21dd85=0x190;}_0x4ee438[_0xc500('0x18')](_0x21dd85)['send'](_0x405024[_0xc500('0x30')][_0xc500('0x68')]?{'message':_0xc500('0x6d'),'statusCode':_0x11a15b[_0xc500('0x69')]}:_0x11a15b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index f078f4a..b498633 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 _0x0197=['int_desk_accounts','lodash','util','../../config/logger','moment','request-promise','path','exports','define'];(function(_0x1ca486,_0x1aae74){var _0x2c4e2f=function(_0x1b2bde){while(--_0x1b2bde){_0x1ca486['push'](_0x1ca486['shift']());}};_0x2c4e2f(++_0x1aae74);}(_0x0197,0x133));var _0x7019=function(_0x20b256,_0x51743d){_0x20b256=_0x20b256-0x0;var _0x5e103a=_0x0197[_0x20b256];return _0x5e103a;};'use strict';var _=require(_0x7019('0x0'));var util=require(_0x7019('0x1'));var logger=require(_0x7019('0x2'))('api');var moment=require(_0x7019('0x3'));var BPromise=require('bluebird');var rp=require(_0x7019('0x4'));var fs=require('fs');var path=require(_0x7019('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x7019('0x6')]=function(_0x285d70,_0x249f65){return _0x285d70[_0x7019('0x7')]('DeskAccount',attributes,{'tableName':_0x7019('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ddc=['../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x3a65d5,_0x4454de){var _0xc94b8d=function(_0x180edf){while(--_0x180edf){_0x3a65d5['push'](_0x3a65d5['shift']());}};_0xc94b8d(++_0x4454de);}(_0x2ddc,0x1cd));var _0xc2dd=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x2ddc[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xc2dd('0x0'));var util=require(_0xc2dd('0x1'));var logger=require(_0xc2dd('0x2'))(_0xc2dd('0x3'));var moment=require('moment');var BPromise=require(_0xc2dd('0x4'));var rp=require(_0xc2dd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2dd('0x6'));var config=require(_0xc2dd('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xc2dd('0x8'));module[_0xc2dd('0x9')]=function(_0x3aee54,_0x8ad96c){return _0x3aee54[_0xc2dd('0xa')](_0xc2dd('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index e5c11e8..cd90073 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 _0x60e1=['result','DeskAccount','findAll','options','where','attributes','limit','include','map','model','GetDeskAccount','catch','ShowDeskAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x60e1,0x1e2));var _0x160e=function(_0x93d0d8,_0xd3c8be){_0x93d0d8=_0x93d0d8-0x0;var _0x23b335=_0x60e1[_0x93d0d8];return _0x23b335;};'use strict';var _=require(_0x160e('0x0'));var util=require('util');var moment=require(_0x160e('0x1'));var BPromise=require(_0x160e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x160e('0x3'));var db=require(_0x160e('0x4'))['db'];var utils=require(_0x160e('0x5'));var logger=require(_0x160e('0x6'))(_0x160e('0x7'));var config=require(_0x160e('0x8'));var jayson=require(_0x160e('0x9'));var client=jayson[_0x160e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1e8f,_0x12acb4,_0x4213f3){return new BPromise(function(_0x568eb4,_0x5d12e8){return client[_0x160e('0xb')](_0x1e1e8f,_0x4213f3)[_0x160e('0xc')](function(_0x977332){logger[_0x160e('0xd')]('DeskAccount,\x20%s,\x20%s',_0x12acb4,_0x160e('0xe'));logger[_0x160e('0xf')](_0x160e('0x10'),_0x12acb4,_0x160e('0xe'),JSON[_0x160e('0x11')](_0x977332));if(_0x977332[_0x160e('0x12')]){if(_0x977332['error'][_0x160e('0x13')]===0x1f4){logger[_0x160e('0x12')](_0x160e('0x14'),_0x12acb4,_0x977332['error'][_0x160e('0x15')]);return _0x5d12e8(_0x977332['error'][_0x160e('0x15')]);}logger[_0x160e('0x12')]('DeskAccount,\x20%s,\x20%s',_0x12acb4,_0x977332[_0x160e('0x12')][_0x160e('0x15')]);return _0x568eb4(_0x977332[_0x160e('0x12')][_0x160e('0x15')]);}else{logger[_0x160e('0xd')](_0x160e('0x14'),_0x12acb4,_0x160e('0xe'));_0x568eb4(_0x977332[_0x160e('0x16')][_0x160e('0x15')]);}})['catch'](function(_0x45a2ac){logger[_0x160e('0x12')](_0x160e('0x14'),_0x12acb4,_0x45a2ac);_0x5d12e8(_0x45a2ac);});});}exports['GetDeskAccount']=function(_0x5a5394){var _0x484d80=this;return new Promise(function(_0x5a30b2,_0x274f7f){return db[_0x160e('0x17')][_0x160e('0x18')]({'raw':_0x5a5394['options']?_0x5a5394[_0x160e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5a5394['options']?_0x5a5394[_0x160e('0x19')][_0x160e('0x1a')]||null:null,'attributes':_0x5a5394[_0x160e('0x19')]?_0x5a5394[_0x160e('0x19')][_0x160e('0x1b')]||null:null,'limit':_0x5a5394['options']?_0x5a5394[_0x160e('0x19')][_0x160e('0x1c')]||null:null,'include':_0x5a5394[_0x160e('0x19')]?_0x5a5394['options'][_0x160e('0x1d')]?_[_0x160e('0x1e')](_0x5a5394['options'][_0x160e('0x1d')],function(_0x24e8fc){return{'model':db[_0x24e8fc[_0x160e('0x1f')]],'as':_0x24e8fc['as'],'attributes':_0x24e8fc[_0x160e('0x1b')],'include':_0x24e8fc[_0x160e('0x1d')]?_['map'](_0x24e8fc['include'],function(_0x48021){return{'model':db[_0x48021[_0x160e('0x1f')]],'as':_0x48021['as'],'attributes':_0x48021[_0x160e('0x1b')],'include':_0x48021[_0x160e('0x1d')]?_[_0x160e('0x1e')](_0x48021['include'],function(_0x507014){return{'model':db[_0x507014[_0x160e('0x1f')]],'as':_0x507014['as'],'attributes':_0x507014[_0x160e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x160e('0xc')](function(_0x104c1d){logger[_0x160e('0xd')](_0x160e('0x20'),_0x5a5394);logger[_0x160e('0xf')](_0x160e('0x20'),_0x5a5394,JSON['stringify'](_0x104c1d));_0x5a30b2(_0x104c1d);})[_0x160e('0x21')](function(_0x4a6ccd){logger[_0x160e('0x12')]('GetDeskAccount',_0x4a6ccd[_0x160e('0x15')],_0x5a5394);_0x274f7f(_0x484d80['error'](0x1f4,_0x4a6ccd[_0x160e('0x15')]));});});};exports[_0x160e('0x22')]=function(_0x2b14b1){var _0x4c7347=this;return new Promise(function(_0x1ad5d1,_0x1b7a1c){return db[_0x160e('0x17')][_0x160e('0x23')]({'raw':_0x2b14b1[_0x160e('0x19')]?_0x2b14b1[_0x160e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2b14b1[_0x160e('0x19')]?_0x2b14b1[_0x160e('0x19')][_0x160e('0x1a')]||null:null,'attributes':_0x2b14b1[_0x160e('0x19')]?_0x2b14b1['options']['attributes']||null:null,'include':_0x2b14b1[_0x160e('0x19')]?_0x2b14b1['options'][_0x160e('0x1d')]?_['map'](_0x2b14b1[_0x160e('0x19')]['include'],function(_0x21904d){return{'model':db[_0x21904d[_0x160e('0x1f')]],'as':_0x21904d['as'],'attributes':_0x21904d[_0x160e('0x1b')],'include':_0x21904d[_0x160e('0x1d')]?_[_0x160e('0x1e')](_0x21904d[_0x160e('0x1d')],function(_0x360095){return{'model':db[_0x360095['model']],'as':_0x360095['as'],'attributes':_0x360095[_0x160e('0x1b')],'include':_0x360095['include']?_['map'](_0x360095[_0x160e('0x1d')],function(_0x48732e){return{'model':db[_0x48732e[_0x160e('0x1f')]],'as':_0x48732e['as'],'attributes':_0x48732e[_0x160e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x160e('0xc')](function(_0x39cee2){logger[_0x160e('0xd')]('ShowDeskAccount',_0x2b14b1);logger[_0x160e('0xf')](_0x160e('0x22'),_0x2b14b1,JSON[_0x160e('0x11')](_0x39cee2));_0x1ad5d1(_0x39cee2);})[_0x160e('0x21')](function(_0x252ccf){logger[_0x160e('0x12')](_0x160e('0x22'),_0x252ccf['message'],_0x2b14b1);_0x1b7a1c(_0x4c7347[_0x160e('0x12')](0x1f4,_0x252ccf[_0x160e('0x15')]));});});}; \ No newline at end of file +var _0x7c57=['message','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x7c57,0x177));var _0x77c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c57[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x77c5('0x0'));var util=require(_0x77c5('0x1'));var moment=require(_0x77c5('0x2'));var BPromise=require(_0x77c5('0x3'));var rs=require(_0x77c5('0x4'));var fs=require('fs');var Redis=require(_0x77c5('0x5'));var db=require(_0x77c5('0x6'))['db'];var utils=require(_0x77c5('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x77c5('0x8'));var jayson=require(_0x77c5('0x9'));var client=jayson[_0x77c5('0xa')][_0x77c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6d2816,_0xb7f1de,_0x4ef96b){return new BPromise(function(_0xec118f,_0x1e6e2c){return client[_0x77c5('0xc')](_0x6d2816,_0x4ef96b)[_0x77c5('0xd')](function(_0x10f071){logger[_0x77c5('0xe')](_0x77c5('0xf'),_0xb7f1de,_0x77c5('0x10'));logger[_0x77c5('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xb7f1de,'request\x20sent',JSON[_0x77c5('0x12')](_0x10f071));if(_0x10f071['error']){if(_0x10f071[_0x77c5('0x13')][_0x77c5('0x14')]===0x1f4){logger[_0x77c5('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x10f071['error'][_0x77c5('0x15')]);return _0x1e6e2c(_0x10f071['error']['message']);}logger[_0x77c5('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x10f071['error'][_0x77c5('0x15')]);return _0xec118f(_0x10f071['error'][_0x77c5('0x15')]);}else{logger[_0x77c5('0xe')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x77c5('0x10'));_0xec118f(_0x10f071['result']['message']);}})['catch'](function(_0x1aa4c0){logger[_0x77c5('0x13')]('DeskAccount,\x20%s,\x20%s',_0xb7f1de,_0x1aa4c0);_0x1e6e2c(_0x1aa4c0);});});}exports[_0x77c5('0x16')]=function(_0x5194a4){var _0x384244=this;return new Promise(function(_0x39e6f3,_0xfe0423){return db[_0x77c5('0x17')][_0x77c5('0x18')]({'raw':_0x5194a4[_0x77c5('0x19')]?_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x5194a4['options']?_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1b')]||null:null,'attributes':_0x5194a4['options']?_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1c')]||null:null,'limit':_0x5194a4[_0x77c5('0x19')]?_0x5194a4['options'][_0x77c5('0x1d')]||null:null,'include':_0x5194a4[_0x77c5('0x19')]?_0x5194a4['options'][_0x77c5('0x1e')]?_[_0x77c5('0x1f')](_0x5194a4[_0x77c5('0x19')][_0x77c5('0x1e')],function(_0x17c458){return{'model':db[_0x17c458[_0x77c5('0x20')]],'as':_0x17c458['as'],'attributes':_0x17c458[_0x77c5('0x1c')],'include':_0x17c458[_0x77c5('0x1e')]?_['map'](_0x17c458['include'],function(_0x1cddec){return{'model':db[_0x1cddec[_0x77c5('0x20')]],'as':_0x1cddec['as'],'attributes':_0x1cddec[_0x77c5('0x1c')],'include':_0x1cddec['include']?_[_0x77c5('0x1f')](_0x1cddec[_0x77c5('0x1e')],function(_0x361702){return{'model':db[_0x361702['model']],'as':_0x361702['as'],'attributes':_0x361702[_0x77c5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a84f1){logger[_0x77c5('0xe')]('GetDeskAccount',_0x5194a4);logger[_0x77c5('0x11')](_0x77c5('0x16'),_0x5194a4,JSON[_0x77c5('0x12')](_0x5a84f1));_0x39e6f3(_0x5a84f1);})[_0x77c5('0x21')](function(_0x14b46f){logger['error']('GetDeskAccount',_0x14b46f['message'],_0x5194a4);_0xfe0423(_0x384244[_0x77c5('0x13')](0x1f4,_0x14b46f['message']));});});};exports[_0x77c5('0x22')]=function(_0x1c4f18){var _0x4d9671=this;return new Promise(function(_0x31c93b,_0x4e5c85){return db[_0x77c5('0x17')][_0x77c5('0x23')]({'raw':_0x1c4f18[_0x77c5('0x19')]?_0x1c4f18['options'][_0x77c5('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c4f18['options']?_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1b')]||null:null,'attributes':_0x1c4f18['options']?_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1c')]||null:null,'include':_0x1c4f18[_0x77c5('0x19')]?_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1e')]?_[_0x77c5('0x1f')](_0x1c4f18[_0x77c5('0x19')][_0x77c5('0x1e')],function(_0x5960c5){return{'model':db[_0x5960c5[_0x77c5('0x20')]],'as':_0x5960c5['as'],'attributes':_0x5960c5[_0x77c5('0x1c')],'include':_0x5960c5['include']?_[_0x77c5('0x1f')](_0x5960c5[_0x77c5('0x1e')],function(_0x5a1b06){return{'model':db[_0x5a1b06['model']],'as':_0x5a1b06['as'],'attributes':_0x5a1b06['attributes'],'include':_0x5a1b06[_0x77c5('0x1e')]?_[_0x77c5('0x1f')](_0x5a1b06[_0x77c5('0x1e')],function(_0xabbc1f){return{'model':db[_0xabbc1f[_0x77c5('0x20')]],'as':_0xabbc1f['as'],'attributes':_0xabbc1f[_0x77c5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x77c5('0xd')](function(_0x105558){logger[_0x77c5('0xe')](_0x77c5('0x22'),_0x1c4f18);logger[_0x77c5('0x11')](_0x77c5('0x22'),_0x1c4f18,JSON[_0x77c5('0x12')](_0x105558));_0x31c93b(_0x105558);})[_0x77c5('0x21')](function(_0x482ec8){logger['error'](_0x77c5('0x22'),_0x482ec8[_0x77c5('0x15')],_0x1c4f18);_0x4e5c85(_0x4d9671[_0x77c5('0x13')](0x1f4,_0x482ec8['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index c630186..0cad84d 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x891196,_0x4364d8){var _0x5bb4d7=function(_0x4efc6c){while(--_0x4efc6c){_0x891196['push'](_0x891196['shift']());}};_0x5bb4d7(++_0x4364d8);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a9111,_0x53b637){_0x3a9111=_0x3a9111-0x0;var _0x4e13ca=_0xedd9[_0x3a9111];return _0x4e13ca;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x175c2c,_0x13e3d6){var _0x49d665=function(_0x348e8a){while(--_0x348e8a){_0x175c2c['push'](_0x175c2c['shift']());}};_0x49d665(++_0x13e3d6);}(_0x7217,0x19e));var _0x7721=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7217[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ee030b5..1252692 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 _0x3723=['STRING'];(function(_0x344173,_0x5d5ef5){var _0x505f40=function(_0x5a8123){while(--_0x5a8123){_0x344173['push'](_0x344173['shift']());}};_0x505f40(++_0x5d5ef5);}(_0x3723,0x16c));var _0x3372=function(_0x5ce880,_0x3f9c34){_0x5ce880=_0x5ce880-0x0;var _0x3289af=_0x3723[_0x5ce880];return _0x3289af;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3372('0x0')]},'description':{'type':Sequelize[_0x3372('0x0')]}}; \ No newline at end of file +var _0xfa76=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa76,0x160));var _0x6fa7=function(_0x550b4b,_0x204779){_0x550b4b=_0x550b4b-0x0;var _0x5dc3a3=_0xfa76[_0x550b4b];return _0x5dc3a3;};'use strict';var Sequelize=require(_0x6fa7('0x0'));module[_0x6fa7('0x1')]={'name':{'type':Sequelize[_0x6fa7('0x2')]},'description':{'type':Sequelize[_0x6fa7('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index db65fb6..b9c20b7 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 _0xdd9e=['send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','update','body','getFields','DeskField','getSubjects','findOne','getDescriptions','Tag','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','then','destroy','error','name'];(function(_0x369c0c,_0x14b05b){var _0x49e19f=function(_0x4fb407){while(--_0x4fb407){_0x369c0c['push'](_0x369c0c['shift']());}};_0x49e19f(++_0x14b05b);}(_0xdd9e,0x12c));var _0xedd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd9e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xedd9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedd9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedd9('0x2'));var moment=require(_0xedd9('0x3'));var BPromise=require(_0xedd9('0x4'));var Mustache=require('mustache');var util=require(_0xedd9('0x5'));var path=require(_0xedd9('0x6'));var sox=require(_0xedd9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedd9('0x8'));var _=require(_0xedd9('0x9'));var squel=require(_0xedd9('0xa'));var crypto=require(_0xedd9('0xb'));var jsforce=require(_0xedd9('0xc'));var deskjs=require(_0xedd9('0xd'));var toCsv=require(_0xedd9('0xe'));var querystring=require(_0xedd9('0xf'));var Papa=require(_0xedd9('0x10'));var Redis=require(_0xedd9('0x11'));var authService=require(_0xedd9('0x12'));var qs=require(_0xedd9('0x13'));var as=require(_0xedd9('0x14'));var hardwareService=require(_0xedd9('0x15'));var logger=require(_0xedd9('0x16'))(_0xedd9('0x17'));var utils=require('../../config/utils');var config=require(_0xedd9('0x18'));var licenseUtil=require(_0xedd9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a0b99,_0x516c1e){_0x516c1e=_0x516c1e||0xcc;return function(_0x37ff1c){if(_0x37ff1c){return _0x5a0b99[_0xedd9('0x1a')](_0x516c1e);}return _0x5a0b99['status'](_0x516c1e)[_0xedd9('0x1b')]();};}function respondWithResult(_0x32656d,_0x288b48){_0x288b48=_0x288b48||0xc8;return function(_0x22e848){if(_0x22e848){return _0x32656d[_0xedd9('0x1c')](_0x288b48)[_0xedd9('0x1d')](_0x22e848);}};}function respondWithFilteredResult(_0x19a419,_0x4b20e8){return function(_0x27727f){if(_0x27727f){var _0x4c8248=typeof _0x4b20e8[_0xedd9('0x1e')]===_0xedd9('0x1f')&&typeof _0x4b20e8[_0xedd9('0x20')]==='undefined';var _0x2ab6a9=_0x27727f[_0xedd9('0x21')];var _0x228f60=_0x4c8248?0x0:_0x4b20e8[_0xedd9('0x1e')];var _0x67ac2b=_0x4c8248?_0x27727f[_0xedd9('0x21')]:_0x4b20e8[_0xedd9('0x1e')]+_0x4b20e8['limit'];var _0x430fe7;if(_0x67ac2b>=_0x2ab6a9){_0x67ac2b=_0x2ab6a9;_0x430fe7=0xc8;}else{_0x430fe7=0xce;}_0x19a419[_0xedd9('0x1c')](_0x430fe7);return _0x19a419['set']('Content-Range',_0x228f60+'-'+_0x67ac2b+'/'+_0x2ab6a9)[_0xedd9('0x1d')](_0x27727f);}return null;};}function patchUpdates(_0x47afc5){return function(_0x36b26b){try{jsonpatch[_0xedd9('0x22')](_0x36b26b,_0x47afc5,!![]);}catch(_0x1c0bbf){return BPromise[_0xedd9('0x23')](_0x1c0bbf);}return _0x36b26b['save']();};}function saveUpdates(_0x23aba0,_0x2e8b97){return function(_0x5c8ca3){if(_0x5c8ca3){return _0x5c8ca3['update'](_0x23aba0)[_0xedd9('0x24')](function(_0x4d6678){return _0x4d6678;});}return null;};}function removeEntity(_0x58e0bb,_0xa90c88){return function(_0x4ef427){if(_0x4ef427){return _0x4ef427[_0xedd9('0x25')]()['then'](function(){_0x58e0bb[_0xedd9('0x1c')](0xcc)[_0xedd9('0x1b')]();});}};}function handleEntityNotFound(_0x30edb6,_0x29473b){return function(_0x4b487f){if(!_0x4b487f){_0x30edb6['sendStatus'](0x194);}return _0x4b487f;};}function handleError(_0x103414,_0x4edec3){_0x4edec3=_0x4edec3||0x1f4;return function(_0x4549a1){logger[_0xedd9('0x26')](_0x4549a1['stack']);if(_0x4549a1[_0xedd9('0x27')]){delete _0x4549a1[_0xedd9('0x27')];}_0x103414[_0xedd9('0x1c')](_0x4edec3)[_0xedd9('0x28')](_0x4549a1);};}exports[_0xedd9('0x29')]=function(_0x352ed1,_0x28b6f7){var _0x10fe3d={},_0xce6c35={},_0x394463={'count':0x0,'rows':[]};var _0x4021c0=_['map'](db[_0xedd9('0x2a')][_0xedd9('0x2b')],function(_0x479bff){return{'name':_0x479bff[_0xedd9('0x2c')],'type':_0x479bff[_0xedd9('0x2d')][_0xedd9('0x2e')]};});_0xce6c35[_0xedd9('0x2f')]=_[_0xedd9('0x30')](_0x4021c0,'name');_0xce6c35[_0xedd9('0x31')]=_['keys'](_0x352ed1['query']);_0xce6c35['filters']=_[_0xedd9('0x32')](_0xce6c35[_0xedd9('0x2f')],_0xce6c35[_0xedd9('0x31')]);_0x10fe3d[_0xedd9('0x33')]=_[_0xedd9('0x32')](_0xce6c35[_0xedd9('0x2f')],qs[_0xedd9('0x34')](_0x352ed1[_0xedd9('0x31')][_0xedd9('0x34')]));_0x10fe3d['attributes']=_0x10fe3d['attributes'][_0xedd9('0x35')]?_0x10fe3d[_0xedd9('0x33')]:_0xce6c35['model'];if(!_0x352ed1['query'][_0xedd9('0x36')](_0xedd9('0x37'))){_0x10fe3d[_0xedd9('0x20')]=qs['limit'](_0x352ed1[_0xedd9('0x31')][_0xedd9('0x20')]);_0x10fe3d[_0xedd9('0x1e')]=qs[_0xedd9('0x1e')](_0x352ed1[_0xedd9('0x31')][_0xedd9('0x1e')]);}_0x10fe3d[_0xedd9('0x38')]=qs[_0xedd9('0x39')](_0x352ed1[_0xedd9('0x31')][_0xedd9('0x39')]);_0x10fe3d[_0xedd9('0x3a')]=qs[_0xedd9('0x3b')](_[_0xedd9('0x3c')](_0x352ed1[_0xedd9('0x31')],_0xce6c35[_0xedd9('0x3b')]),_0x4021c0);if(_0x352ed1[_0xedd9('0x31')][_0xedd9('0x3d')]){_0x10fe3d['where']=_[_0xedd9('0x3e')](_0x10fe3d[_0xedd9('0x3a')],{'$or':_[_0xedd9('0x30')](_0x4021c0,function(_0x5c87d2){if(_0x5c87d2[_0xedd9('0x2d')]!==_0xedd9('0x3f')){var _0x44f253={};_0x44f253[_0x5c87d2['name']]={'$like':'%'+_0x352ed1[_0xedd9('0x31')]['filter']+'%'};return _0x44f253;}})});}_0x10fe3d=_[_0xedd9('0x3e')]({},_0x10fe3d,_0x352ed1[_0xedd9('0x40')]);var _0x4448a3={'where':_0x10fe3d['where']};return db[_0xedd9('0x2a')][_0xedd9('0x21')](_0x4448a3)[_0xedd9('0x24')](function(_0x372cb1){_0x394463['count']=_0x372cb1;if(_0x352ed1[_0xedd9('0x31')][_0xedd9('0x41')]){_0x10fe3d[_0xedd9('0x42')]=[{'all':!![]}];}return db[_0xedd9('0x2a')][_0xedd9('0x43')](_0x10fe3d);})[_0xedd9('0x24')](function(_0x17da99){_0x394463[_0xedd9('0x44')]=_0x17da99;return _0x394463;})[_0xedd9('0x24')](respondWithFilteredResult(_0x28b6f7,_0x10fe3d))[_0xedd9('0x45')](handleError(_0x28b6f7,null));};exports['show']=function(_0x172777,_0x26dfec){var _0x3a120a={'raw':![],'where':{'id':_0x172777[_0xedd9('0x46')]['id']}},_0x392bb9={};_0x392bb9[_0xedd9('0x2f')]=_[_0xedd9('0x47')](db[_0xedd9('0x2a')]['rawAttributes']);_0x392bb9[_0xedd9('0x31')]=_[_0xedd9('0x47')](_0x172777[_0xedd9('0x31')]);_0x392bb9['filters']=_['intersection'](_0x392bb9['model'],_0x392bb9[_0xedd9('0x31')]);_0x3a120a[_0xedd9('0x33')]=_[_0xedd9('0x32')](_0x392bb9[_0xedd9('0x2f')],qs[_0xedd9('0x34')](_0x172777[_0xedd9('0x31')][_0xedd9('0x34')]));_0x3a120a['attributes']=_0x3a120a[_0xedd9('0x33')]['length']?_0x3a120a[_0xedd9('0x33')]:_0x392bb9[_0xedd9('0x2f')];if(_0x172777[_0xedd9('0x31')][_0xedd9('0x41')]){_0x3a120a[_0xedd9('0x42')]=[{'all':!![]}];}_0x3a120a=_[_0xedd9('0x3e')]({},_0x3a120a,_0x172777[_0xedd9('0x40')]);return db[_0xedd9('0x2a')][_0xedd9('0x48')](_0x3a120a)[_0xedd9('0x24')](handleEntityNotFound(_0x26dfec,null))[_0xedd9('0x24')](respondWithResult(_0x26dfec,null))[_0xedd9('0x45')](handleError(_0x26dfec,null));};exports[_0xedd9('0x49')]=function(_0x36ecd5,_0x2e4cd9){return db[_0xedd9('0x2a')]['create'](_0x36ecd5['body'],{})[_0xedd9('0x24')](respondWithResult(_0x2e4cd9,0xc9))[_0xedd9('0x45')](handleError(_0x2e4cd9,null));};exports[_0xedd9('0x4a')]=function(_0x384519,_0x32bc72){if(_0x384519[_0xedd9('0x4b')]['id']){delete _0x384519[_0xedd9('0x4b')]['id'];}return db[_0xedd9('0x2a')][_0xedd9('0x48')]({'where':{'id':_0x384519[_0xedd9('0x46')]['id']}})[_0xedd9('0x24')](handleEntityNotFound(_0x32bc72,null))[_0xedd9('0x24')](saveUpdates(_0x384519[_0xedd9('0x4b')],null))[_0xedd9('0x24')](respondWithResult(_0x32bc72,null))['catch'](handleError(_0x32bc72,null));};exports['destroy']=function(_0x37100e,_0x5b0004){return db[_0xedd9('0x2a')][_0xedd9('0x48')]({'where':{'id':_0x37100e[_0xedd9('0x46')]['id']}})[_0xedd9('0x24')](handleEntityNotFound(_0x5b0004,null))[_0xedd9('0x24')](removeEntity(_0x5b0004,null))[_0xedd9('0x45')](handleError(_0x5b0004,null));};exports[_0xedd9('0x4c')]=function(_0x3a8c9c,_0x1f7aa7,_0x157d1a){var _0x42e7d5={};var _0x2f3eb4={};var _0x561c8f;var _0x37f659;return db[_0xedd9('0x2a')]['findOne']({'where':{'id':_0x3a8c9c[_0xedd9('0x46')]['id']}})[_0xedd9('0x24')](handleEntityNotFound(_0x1f7aa7,null))['then'](function(_0x5de63a){if(_0x5de63a){_0x561c8f=_0x5de63a;_0x2f3eb4['model']=_[_0xedd9('0x47')](db[_0xedd9('0x4d')]['rawAttributes']);_0x2f3eb4[_0xedd9('0x31')]=_[_0xedd9('0x47')](_0x3a8c9c[_0xedd9('0x31')]);_0x2f3eb4['filters']=_[_0xedd9('0x32')](_0x2f3eb4['model'],_0x2f3eb4[_0xedd9('0x31')]);_0x42e7d5['attributes']=_[_0xedd9('0x32')](_0x2f3eb4[_0xedd9('0x2f')],qs['fields'](_0x3a8c9c[_0xedd9('0x31')][_0xedd9('0x34')]));_0x42e7d5[_0xedd9('0x33')]=_0x42e7d5[_0xedd9('0x33')][_0xedd9('0x35')]?_0x42e7d5[_0xedd9('0x33')]:_0x2f3eb4[_0xedd9('0x2f')];_0x42e7d5[_0xedd9('0x38')]=qs[_0xedd9('0x39')](_0x3a8c9c[_0xedd9('0x31')][_0xedd9('0x39')]);_0x42e7d5['where']=qs[_0xedd9('0x3b')](_[_0xedd9('0x3c')](_0x3a8c9c['query'],_0x2f3eb4['filters']));if(_0x3a8c9c[_0xedd9('0x31')][_0xedd9('0x3d')]){_0x42e7d5[_0xedd9('0x3a')]=_['merge'](_0x42e7d5[_0xedd9('0x3a')],{'$or':_['map'](_0x42e7d5['attributes'],function(_0x4d4feb){var _0x578b50={};_0x578b50[_0x4d4feb]={'$like':'%'+_0x3a8c9c[_0xedd9('0x31')]['filter']+'%'};return _0x578b50;})});}_0x42e7d5=_[_0xedd9('0x3e')]({},_0x42e7d5,_0x3a8c9c[_0xedd9('0x40')]);return _0x561c8f[_0xedd9('0x4c')](_0x42e7d5);}})['then'](function(_0x495740){if(_0x495740){_0x37f659=_0x495740[_0xedd9('0x35')];if(!_0x3a8c9c[_0xedd9('0x31')][_0xedd9('0x36')]('nolimit')){_0x42e7d5['limit']=qs[_0xedd9('0x20')](_0x3a8c9c['query'][_0xedd9('0x20')]);_0x42e7d5['offset']=qs[_0xedd9('0x1e')](_0x3a8c9c['query'][_0xedd9('0x1e')]);}return _0x561c8f[_0xedd9('0x4c')](_0x42e7d5);}})[_0xedd9('0x24')](function(_0x37ebd4){if(_0x37ebd4){return _0x37ebd4?{'count':_0x37f659,'rows':_0x37ebd4}:null;}})[_0xedd9('0x24')](respondWithResult(_0x1f7aa7,null))['catch'](handleError(_0x1f7aa7,null));};exports[_0xedd9('0x4e')]=function(_0x435b2e,_0x3c3ec7,_0x455fe2){var _0x5f2456={};var _0x1044c1={};var _0x5ca4da;var _0x38c8b8;return db['DeskConfiguration']['findOne']({'where':{'id':_0x435b2e['params']['id']}})[_0xedd9('0x24')](handleEntityNotFound(_0x3c3ec7,null))['then'](function(_0x3116a7){if(_0x3116a7){_0x5ca4da=_0x3116a7;_0x1044c1[_0xedd9('0x2f')]=_[_0xedd9('0x47')](db['DeskField'][_0xedd9('0x2b')]);_0x1044c1['query']=_[_0xedd9('0x47')](_0x435b2e[_0xedd9('0x31')]);_0x1044c1['filters']=_['intersection'](_0x1044c1[_0xedd9('0x2f')],_0x1044c1['query']);_0x5f2456['attributes']=_[_0xedd9('0x32')](_0x1044c1['model'],qs['fields'](_0x435b2e[_0xedd9('0x31')][_0xedd9('0x34')]));_0x5f2456[_0xedd9('0x33')]=_0x5f2456[_0xedd9('0x33')]['length']?_0x5f2456[_0xedd9('0x33')]:_0x1044c1['model'];_0x5f2456[_0xedd9('0x38')]=qs[_0xedd9('0x39')](_0x435b2e[_0xedd9('0x31')][_0xedd9('0x39')]);_0x5f2456[_0xedd9('0x3a')]=qs[_0xedd9('0x3b')](_['pick'](_0x435b2e[_0xedd9('0x31')],_0x1044c1[_0xedd9('0x3b')]));if(_0x435b2e[_0xedd9('0x31')][_0xedd9('0x3d')]){_0x5f2456[_0xedd9('0x3a')]=_[_0xedd9('0x3e')](_0x5f2456[_0xedd9('0x3a')],{'$or':_[_0xedd9('0x30')](_0x5f2456[_0xedd9('0x33')],function(_0x3f1258){var _0x1f1268={};_0x1f1268[_0x3f1258]={'$like':'%'+_0x435b2e['query'][_0xedd9('0x3d')]+'%'};return _0x1f1268;})});}_0x5f2456=_[_0xedd9('0x3e')]({},_0x5f2456,_0x435b2e[_0xedd9('0x40')]);return _0x5ca4da[_0xedd9('0x4e')](_0x5f2456);}})[_0xedd9('0x24')](function(_0x61b1a4){if(_0x61b1a4){_0x38c8b8=_0x61b1a4[_0xedd9('0x35')];if(!_0x435b2e[_0xedd9('0x31')][_0xedd9('0x36')](_0xedd9('0x37'))){_0x5f2456[_0xedd9('0x20')]=qs[_0xedd9('0x20')](_0x435b2e[_0xedd9('0x31')]['limit']);_0x5f2456['offset']=qs[_0xedd9('0x1e')](_0x435b2e[_0xedd9('0x31')][_0xedd9('0x1e')]);}return _0x5ca4da[_0xedd9('0x4e')](_0x5f2456);}})[_0xedd9('0x24')](function(_0x3d9eb5){if(_0x3d9eb5){return _0x3d9eb5?{'count':_0x38c8b8,'rows':_0x3d9eb5}:null;}})['then'](respondWithResult(_0x3c3ec7,null))['catch'](handleError(_0x3c3ec7,null));};exports['getDescriptions']=function(_0x5e6f2c,_0x1f0042,_0x2627b3){var _0x17caa3={};var _0x575f48={};var _0x3071bf;var _0x589590;return db['DeskConfiguration'][_0xedd9('0x4f')]({'where':{'id':_0x5e6f2c[_0xedd9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f0042,null))[_0xedd9('0x24')](function(_0x59cbe4){if(_0x59cbe4){_0x3071bf=_0x59cbe4;_0x575f48['model']=_[_0xedd9('0x47')](db[_0xedd9('0x4d')][_0xedd9('0x2b')]);_0x575f48['query']=_[_0xedd9('0x47')](_0x5e6f2c['query']);_0x575f48[_0xedd9('0x3b')]=_['intersection'](_0x575f48[_0xedd9('0x2f')],_0x575f48['query']);_0x17caa3[_0xedd9('0x33')]=_[_0xedd9('0x32')](_0x575f48[_0xedd9('0x2f')],qs[_0xedd9('0x34')](_0x5e6f2c[_0xedd9('0x31')][_0xedd9('0x34')]));_0x17caa3['attributes']=_0x17caa3['attributes'][_0xedd9('0x35')]?_0x17caa3[_0xedd9('0x33')]:_0x575f48[_0xedd9('0x2f')];_0x17caa3['order']=qs[_0xedd9('0x39')](_0x5e6f2c['query'][_0xedd9('0x39')]);_0x17caa3[_0xedd9('0x3a')]=qs['filters'](_[_0xedd9('0x3c')](_0x5e6f2c[_0xedd9('0x31')],_0x575f48[_0xedd9('0x3b')]));if(_0x5e6f2c['query']['filter']){_0x17caa3[_0xedd9('0x3a')]=_['merge'](_0x17caa3[_0xedd9('0x3a')],{'$or':_['map'](_0x17caa3[_0xedd9('0x33')],function(_0x45c604){var _0x279c91={};_0x279c91[_0x45c604]={'$like':'%'+_0x5e6f2c[_0xedd9('0x31')][_0xedd9('0x3d')]+'%'};return _0x279c91;})});}_0x17caa3=_[_0xedd9('0x3e')]({},_0x17caa3,_0x5e6f2c[_0xedd9('0x40')]);return _0x3071bf[_0xedd9('0x50')](_0x17caa3);}})[_0xedd9('0x24')](function(_0xa4ab89){if(_0xa4ab89){_0x589590=_0xa4ab89[_0xedd9('0x35')];if(!_0x5e6f2c['query'][_0xedd9('0x36')](_0xedd9('0x37'))){_0x17caa3['limit']=qs[_0xedd9('0x20')](_0x5e6f2c[_0xedd9('0x31')]['limit']);_0x17caa3[_0xedd9('0x1e')]=qs[_0xedd9('0x1e')](_0x5e6f2c[_0xedd9('0x31')][_0xedd9('0x1e')]);}return _0x3071bf[_0xedd9('0x50')](_0x17caa3);}})[_0xedd9('0x24')](function(_0xeda195){if(_0xeda195){return _0xeda195?{'count':_0x589590,'rows':_0xeda195}:null;}})[_0xedd9('0x24')](respondWithResult(_0x1f0042,null))[_0xedd9('0x45')](handleError(_0x1f0042,null));};exports['getTags']=function(_0x54fbeb,_0x2bdaba,_0x17b750){var _0x12ac5b={};var _0x237264={};var _0x2b8c76;var _0x49f0d4;return db[_0xedd9('0x2a')][_0xedd9('0x4f')]({'where':{'id':_0x54fbeb[_0xedd9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bdaba,null))['then'](function(_0x5b2e96){if(_0x5b2e96){_0x2b8c76=_0x5b2e96;_0x237264[_0xedd9('0x2f')]=_[_0xedd9('0x47')](db[_0xedd9('0x51')][_0xedd9('0x2b')]);_0x237264[_0xedd9('0x31')]=_[_0xedd9('0x47')](_0x54fbeb[_0xedd9('0x31')]);_0x237264[_0xedd9('0x3b')]=_['intersection'](_0x237264['model'],_0x237264[_0xedd9('0x31')]);_0x12ac5b['attributes']=_[_0xedd9('0x32')](_0x237264[_0xedd9('0x2f')],qs['fields'](_0x54fbeb['query'][_0xedd9('0x34')]));_0x12ac5b[_0xedd9('0x33')]=_0x12ac5b[_0xedd9('0x33')][_0xedd9('0x35')]?_0x12ac5b[_0xedd9('0x33')]:_0x237264['model'];_0x12ac5b[_0xedd9('0x38')]=qs[_0xedd9('0x39')](_0x54fbeb[_0xedd9('0x31')][_0xedd9('0x39')]);_0x12ac5b[_0xedd9('0x3a')]=qs[_0xedd9('0x3b')](_[_0xedd9('0x3c')](_0x54fbeb[_0xedd9('0x31')],_0x237264[_0xedd9('0x3b')]));if(_0x54fbeb[_0xedd9('0x31')][_0xedd9('0x3d')]){_0x12ac5b[_0xedd9('0x3a')]=_['merge'](_0x12ac5b[_0xedd9('0x3a')],{'$or':_[_0xedd9('0x30')](_0x12ac5b['attributes'],function(_0x5377cf){var _0x3d9289={};_0x3d9289[_0x5377cf]={'$like':'%'+_0x54fbeb[_0xedd9('0x31')][_0xedd9('0x3d')]+'%'};return _0x3d9289;})});}_0x12ac5b=_['merge']({},_0x12ac5b,_0x54fbeb['options']);return _0x2b8c76[_0xedd9('0x52')](_0x12ac5b);}})['then'](function(_0x5a37cc){if(_0x5a37cc){_0x49f0d4=_0x5a37cc[_0xedd9('0x35')];if(!_0x54fbeb[_0xedd9('0x31')]['hasOwnProperty'](_0xedd9('0x37'))){_0x12ac5b[_0xedd9('0x20')]=qs[_0xedd9('0x20')](_0x54fbeb['query'][_0xedd9('0x20')]);_0x12ac5b[_0xedd9('0x1e')]=qs[_0xedd9('0x1e')](_0x54fbeb[_0xedd9('0x31')][_0xedd9('0x1e')]);}return _0x2b8c76[_0xedd9('0x52')](_0x12ac5b);}})['then'](function(_0x4bcee5){if(_0x4bcee5){return _0x4bcee5?{'count':_0x49f0d4,'rows':_0x4bcee5}:null;}})[_0xedd9('0x24')](respondWithResult(_0x2bdaba,null))[_0xedd9('0x45')](handleError(_0x2bdaba,null));};exports[_0xedd9('0x53')]=function(_0x17160c,_0x79eed3,_0x566096){if(_0x17160c[_0xedd9('0x4b')]['id']){delete _0x17160c['body']['id'];}return db[_0xedd9('0x2a')][_0xedd9('0x4f')]({'where':{'id':_0x17160c[_0xedd9('0x46')]['id']}})['then'](handleEntityNotFound(_0x79eed3,null))[_0xedd9('0x24')](function(_0x249c18){if(_0x249c18){return _0x249c18[_0xedd9('0x53')](_0x17160c[_0xedd9('0x4b')][_0xedd9('0x54')]||[]);}return null;})['then'](respondWithResult(_0x79eed3,null))['catch'](handleError(_0x79eed3,null));}; \ No newline at end of file +var _0x7d92=['keys','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','rawAttributes','intersection','options','find','create','body','getFields','DeskField','getSubjects','nolimit','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','fieldName','key','model','query'];(function(_0x42e726,_0x567864){var _0x22610f=function(_0x31329f){while(--_0x31329f){_0x42e726['push'](_0x42e726['shift']());}};_0x22610f(++_0x567864);}(_0x7d92,0xcb));var _0x27d9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x7d92[_0x4164f2];return _0x2575c7;};'use strict';var emlformat=require(_0x27d9('0x0'));var rimraf=require(_0x27d9('0x1'));var zipdir=require(_0x27d9('0x2'));var jsonpatch=require(_0x27d9('0x3'));var rp=require(_0x27d9('0x4'));var moment=require(_0x27d9('0x5'));var BPromise=require(_0x27d9('0x6'));var Mustache=require(_0x27d9('0x7'));var util=require(_0x27d9('0x8'));var path=require(_0x27d9('0x9'));var sox=require(_0x27d9('0xa'));var csv=require(_0x27d9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x27d9('0xc'));var deskjs=require(_0x27d9('0xd'));var toCsv=require(_0x27d9('0xb'));var querystring=require(_0x27d9('0xe'));var Papa=require('papaparse');var Redis=require(_0x27d9('0xf'));var authService=require(_0x27d9('0x10'));var qs=require(_0x27d9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27d9('0x12'))(_0x27d9('0x13'));var utils=require(_0x27d9('0x14'));var config=require(_0x27d9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27d9('0x16'))['db'];function respondWithStatusCode(_0x1d2d88,_0x45cb15){_0x45cb15=_0x45cb15||0xcc;return function(_0x5af9e1){if(_0x5af9e1){return _0x1d2d88[_0x27d9('0x17')](_0x45cb15);}return _0x1d2d88[_0x27d9('0x18')](_0x45cb15)[_0x27d9('0x19')]();};}function respondWithResult(_0x103355,_0x2f6680){_0x2f6680=_0x2f6680||0xc8;return function(_0x509c2b){if(_0x509c2b){return _0x103355[_0x27d9('0x18')](_0x2f6680)[_0x27d9('0x1a')](_0x509c2b);}};}function respondWithFilteredResult(_0x5e7d79,_0x96f1d4){return function(_0xbfd9ae){if(_0xbfd9ae){var _0x103e00=typeof _0x96f1d4['offset']==='undefined'&&typeof _0x96f1d4[_0x27d9('0x1b')]===_0x27d9('0x1c');var _0x549045=_0xbfd9ae[_0x27d9('0x1d')];var _0x4f2daf=_0x103e00?0x0:_0x96f1d4[_0x27d9('0x1e')];var _0xb6c5ae=_0x103e00?_0xbfd9ae[_0x27d9('0x1d')]:_0x96f1d4['offset']+_0x96f1d4[_0x27d9('0x1b')];var _0x13e3d8;if(_0xb6c5ae>=_0x549045){_0xb6c5ae=_0x549045;_0x13e3d8=0xc8;}else{_0x13e3d8=0xce;}_0x5e7d79[_0x27d9('0x18')](_0x13e3d8);return _0x5e7d79[_0x27d9('0x1f')](_0x27d9('0x20'),_0x4f2daf+'-'+_0xb6c5ae+'/'+_0x549045)[_0x27d9('0x1a')](_0xbfd9ae);}return null;};}function patchUpdates(_0x3d5427){return function(_0x145525){try{jsonpatch[_0x27d9('0x21')](_0x145525,_0x3d5427,!![]);}catch(_0x50d1a2){return BPromise[_0x27d9('0x22')](_0x50d1a2);}return _0x145525['save']();};}function saveUpdates(_0x2f36ea,_0x4d6fa5){return function(_0x15b04e){if(_0x15b04e){return _0x15b04e[_0x27d9('0x23')](_0x2f36ea)[_0x27d9('0x24')](function(_0x5509b7){return _0x5509b7;});}return null;};}function removeEntity(_0x3b742f,_0x2671aa){return function(_0x410dd3){if(_0x410dd3){return _0x410dd3[_0x27d9('0x25')]()[_0x27d9('0x24')](function(){_0x3b742f['status'](0xcc)[_0x27d9('0x19')]();});}};}function handleEntityNotFound(_0x55e78f,_0xa00bb3){return function(_0x37b68d){if(!_0x37b68d){_0x55e78f[_0x27d9('0x17')](0x194);}return _0x37b68d;};}function handleError(_0x15f921,_0x12c17b){_0x12c17b=_0x12c17b||0x1f4;return function(_0x551f58){logger[_0x27d9('0x26')](_0x551f58[_0x27d9('0x27')]);if(_0x551f58[_0x27d9('0x28')]){delete _0x551f58[_0x27d9('0x28')];}_0x15f921[_0x27d9('0x18')](_0x12c17b)[_0x27d9('0x29')](_0x551f58);};}exports[_0x27d9('0x2a')]=function(_0x234d34,_0x344d38){var _0x2736b4={},_0x4bd40e={},_0x13cd60={'count':0x0,'rows':[]};var _0x3109d6=_[_0x27d9('0x2b')](db[_0x27d9('0x2c')]['rawAttributes'],function(_0x3e8ee2){return{'name':_0x3e8ee2[_0x27d9('0x2d')],'type':_0x3e8ee2['type'][_0x27d9('0x2e')]};});_0x4bd40e[_0x27d9('0x2f')]=_[_0x27d9('0x2b')](_0x3109d6,'name');_0x4bd40e[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x234d34[_0x27d9('0x30')]);_0x4bd40e['filters']=_['intersection'](_0x4bd40e[_0x27d9('0x2f')],_0x4bd40e[_0x27d9('0x30')]);_0x2736b4[_0x27d9('0x32')]=_['intersection'](_0x4bd40e[_0x27d9('0x2f')],qs['fields'](_0x234d34[_0x27d9('0x30')][_0x27d9('0x33')]));_0x2736b4[_0x27d9('0x32')]=_0x2736b4[_0x27d9('0x32')][_0x27d9('0x34')]?_0x2736b4[_0x27d9('0x32')]:_0x4bd40e[_0x27d9('0x2f')];if(!_0x234d34['query'][_0x27d9('0x35')]('nolimit')){_0x2736b4[_0x27d9('0x1b')]=qs[_0x27d9('0x1b')](_0x234d34[_0x27d9('0x30')]['limit']);_0x2736b4[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x234d34['query'][_0x27d9('0x1e')]);}_0x2736b4[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x234d34[_0x27d9('0x30')][_0x27d9('0x37')]);_0x2736b4[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x234d34[_0x27d9('0x30')],_0x4bd40e[_0x27d9('0x39')]),_0x3109d6);if(_0x234d34[_0x27d9('0x30')][_0x27d9('0x3b')]){_0x2736b4[_0x27d9('0x38')]=_[_0x27d9('0x3c')](_0x2736b4['where'],{'$or':_[_0x27d9('0x2b')](_0x3109d6,function(_0x3e78f0){if(_0x3e78f0[_0x27d9('0x3d')]!==_0x27d9('0x3e')){var _0x20e7f8={};_0x20e7f8[_0x3e78f0[_0x27d9('0x28')]]={'$like':'%'+_0x234d34[_0x27d9('0x30')]['filter']+'%'};return _0x20e7f8;}})});}_0x2736b4=_[_0x27d9('0x3c')]({},_0x2736b4,_0x234d34['options']);var _0x902902={'where':_0x2736b4['where']};return db[_0x27d9('0x2c')][_0x27d9('0x1d')](_0x902902)[_0x27d9('0x24')](function(_0x5369d6){_0x13cd60['count']=_0x5369d6;if(_0x234d34[_0x27d9('0x30')][_0x27d9('0x3f')]){_0x2736b4['include']=[{'all':!![]}];}return db[_0x27d9('0x2c')][_0x27d9('0x40')](_0x2736b4);})[_0x27d9('0x24')](function(_0x2ee87b){_0x13cd60[_0x27d9('0x41')]=_0x2ee87b;return _0x13cd60;})['then'](respondWithFilteredResult(_0x344d38,_0x2736b4))[_0x27d9('0x42')](handleError(_0x344d38,null));};exports['show']=function(_0x142046,_0x7c8af5){var _0x50af02={'raw':![],'where':{'id':_0x142046[_0x27d9('0x43')]['id']}},_0x4addff={};_0x4addff['model']=_['keys'](db[_0x27d9('0x2c')][_0x27d9('0x44')]);_0x4addff[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x142046[_0x27d9('0x30')]);_0x4addff[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x4addff['model'],_0x4addff[_0x27d9('0x30')]);_0x50af02[_0x27d9('0x32')]=_[_0x27d9('0x45')](_0x4addff[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x142046[_0x27d9('0x30')]['fields']));_0x50af02[_0x27d9('0x32')]=_0x50af02[_0x27d9('0x32')]['length']?_0x50af02['attributes']:_0x4addff[_0x27d9('0x2f')];if(_0x142046['query'][_0x27d9('0x3f')]){_0x50af02['include']=[{'all':!![]}];}_0x50af02=_[_0x27d9('0x3c')]({},_0x50af02,_0x142046[_0x27d9('0x46')]);return db[_0x27d9('0x2c')][_0x27d9('0x47')](_0x50af02)[_0x27d9('0x24')](handleEntityNotFound(_0x7c8af5,null))['then'](respondWithResult(_0x7c8af5,null))[_0x27d9('0x42')](handleError(_0x7c8af5,null));};exports[_0x27d9('0x48')]=function(_0x4b0402,_0x4efebd){return db[_0x27d9('0x2c')][_0x27d9('0x48')](_0x4b0402[_0x27d9('0x49')],{})[_0x27d9('0x24')](respondWithResult(_0x4efebd,0xc9))[_0x27d9('0x42')](handleError(_0x4efebd,null));};exports[_0x27d9('0x23')]=function(_0x388e85,_0x31430d){if(_0x388e85[_0x27d9('0x49')]['id']){delete _0x388e85['body']['id'];}return db[_0x27d9('0x2c')][_0x27d9('0x47')]({'where':{'id':_0x388e85[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x31430d,null))[_0x27d9('0x24')](saveUpdates(_0x388e85[_0x27d9('0x49')],null))[_0x27d9('0x24')](respondWithResult(_0x31430d,null))['catch'](handleError(_0x31430d,null));};exports[_0x27d9('0x25')]=function(_0x2f8d32,_0x3168da){return db['DeskConfiguration']['find']({'where':{'id':_0x2f8d32[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x3168da,null))[_0x27d9('0x24')](removeEntity(_0x3168da,null))[_0x27d9('0x42')](handleError(_0x3168da,null));};exports[_0x27d9('0x4a')]=function(_0x2184af,_0x428e0b,_0x45acd6){var _0x50a28f={};var _0x69f9aa={};var _0x30d6f1;var _0x32bf01;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2184af[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x428e0b,null))['then'](function(_0x8d432){if(_0x8d432){_0x30d6f1=_0x8d432;_0x69f9aa['model']=_[_0x27d9('0x31')](db[_0x27d9('0x4b')][_0x27d9('0x44')]);_0x69f9aa['query']=_['keys'](_0x2184af[_0x27d9('0x30')]);_0x69f9aa[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x69f9aa[_0x27d9('0x2f')],_0x69f9aa[_0x27d9('0x30')]);_0x50a28f['attributes']=_[_0x27d9('0x45')](_0x69f9aa[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x2184af[_0x27d9('0x30')]['fields']));_0x50a28f[_0x27d9('0x32')]=_0x50a28f[_0x27d9('0x32')]['length']?_0x50a28f[_0x27d9('0x32')]:_0x69f9aa[_0x27d9('0x2f')];_0x50a28f[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x2184af[_0x27d9('0x30')]['sort']);_0x50a28f[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x2184af[_0x27d9('0x30')],_0x69f9aa['filters']));if(_0x2184af[_0x27d9('0x30')]['filter']){_0x50a28f[_0x27d9('0x38')]=_['merge'](_0x50a28f[_0x27d9('0x38')],{'$or':_['map'](_0x50a28f[_0x27d9('0x32')],function(_0xee49d7){var _0xd2e4fa={};_0xd2e4fa[_0xee49d7]={'$like':'%'+_0x2184af['query'][_0x27d9('0x3b')]+'%'};return _0xd2e4fa;})});}_0x50a28f=_[_0x27d9('0x3c')]({},_0x50a28f,_0x2184af[_0x27d9('0x46')]);return _0x30d6f1['getFields'](_0x50a28f);}})[_0x27d9('0x24')](function(_0x40c03d){if(_0x40c03d){_0x32bf01=_0x40c03d['length'];if(!_0x2184af['query'][_0x27d9('0x35')]('nolimit')){_0x50a28f[_0x27d9('0x1b')]=qs[_0x27d9('0x1b')](_0x2184af[_0x27d9('0x30')][_0x27d9('0x1b')]);_0x50a28f['offset']=qs[_0x27d9('0x1e')](_0x2184af['query']['offset']);}return _0x30d6f1[_0x27d9('0x4a')](_0x50a28f);}})[_0x27d9('0x24')](function(_0x114806){if(_0x114806){return _0x114806?{'count':_0x32bf01,'rows':_0x114806}:null;}})['then'](respondWithResult(_0x428e0b,null))[_0x27d9('0x42')](handleError(_0x428e0b,null));};exports[_0x27d9('0x4c')]=function(_0x38c702,_0x4fe176,_0x411c67){var _0x1e35e5={};var _0x8b71e9={};var _0x40ba32;var _0x3d6b79;return db[_0x27d9('0x2c')]['findOne']({'where':{'id':_0x38c702[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x4fe176,null))[_0x27d9('0x24')](function(_0xa13214){if(_0xa13214){_0x40ba32=_0xa13214;_0x8b71e9[_0x27d9('0x2f')]=_[_0x27d9('0x31')](db[_0x27d9('0x4b')][_0x27d9('0x44')]);_0x8b71e9[_0x27d9('0x30')]=_['keys'](_0x38c702[_0x27d9('0x30')]);_0x8b71e9[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x8b71e9[_0x27d9('0x2f')],_0x8b71e9[_0x27d9('0x30')]);_0x1e35e5[_0x27d9('0x32')]=_[_0x27d9('0x45')](_0x8b71e9[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x38c702[_0x27d9('0x30')]['fields']));_0x1e35e5[_0x27d9('0x32')]=_0x1e35e5[_0x27d9('0x32')][_0x27d9('0x34')]?_0x1e35e5[_0x27d9('0x32')]:_0x8b71e9[_0x27d9('0x2f')];_0x1e35e5[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x38c702[_0x27d9('0x30')][_0x27d9('0x37')]);_0x1e35e5['where']=qs['filters'](_[_0x27d9('0x3a')](_0x38c702[_0x27d9('0x30')],_0x8b71e9[_0x27d9('0x39')]));if(_0x38c702['query'][_0x27d9('0x3b')]){_0x1e35e5[_0x27d9('0x38')]=_[_0x27d9('0x3c')](_0x1e35e5['where'],{'$or':_['map'](_0x1e35e5['attributes'],function(_0x2bdba8){var _0x10c799={};_0x10c799[_0x2bdba8]={'$like':'%'+_0x38c702[_0x27d9('0x30')][_0x27d9('0x3b')]+'%'};return _0x10c799;})});}_0x1e35e5=_[_0x27d9('0x3c')]({},_0x1e35e5,_0x38c702['options']);return _0x40ba32[_0x27d9('0x4c')](_0x1e35e5);}})[_0x27d9('0x24')](function(_0xa86efe){if(_0xa86efe){_0x3d6b79=_0xa86efe[_0x27d9('0x34')];if(!_0x38c702[_0x27d9('0x30')][_0x27d9('0x35')](_0x27d9('0x4d'))){_0x1e35e5['limit']=qs[_0x27d9('0x1b')](_0x38c702[_0x27d9('0x30')][_0x27d9('0x1b')]);_0x1e35e5[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x38c702['query'][_0x27d9('0x1e')]);}return _0x40ba32[_0x27d9('0x4c')](_0x1e35e5);}})[_0x27d9('0x24')](function(_0x3491f5){if(_0x3491f5){return _0x3491f5?{'count':_0x3d6b79,'rows':_0x3491f5}:null;}})['then'](respondWithResult(_0x4fe176,null))[_0x27d9('0x42')](handleError(_0x4fe176,null));};exports['getDescriptions']=function(_0x4adfc3,_0x10e788,_0x3c1966){var _0x27fcdd={};var _0x3d314f={};var _0x46927f;var _0x2964bc;return db[_0x27d9('0x2c')][_0x27d9('0x4e')]({'where':{'id':_0x4adfc3[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x10e788,null))[_0x27d9('0x24')](function(_0x4ce260){if(_0x4ce260){_0x46927f=_0x4ce260;_0x3d314f[_0x27d9('0x2f')]=_[_0x27d9('0x31')](db[_0x27d9('0x4b')][_0x27d9('0x44')]);_0x3d314f[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x4adfc3[_0x27d9('0x30')]);_0x3d314f[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0x3d314f[_0x27d9('0x2f')],_0x3d314f[_0x27d9('0x30')]);_0x27fcdd[_0x27d9('0x32')]=_[_0x27d9('0x45')](_0x3d314f[_0x27d9('0x2f')],qs[_0x27d9('0x33')](_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x33')]));_0x27fcdd[_0x27d9('0x32')]=_0x27fcdd[_0x27d9('0x32')][_0x27d9('0x34')]?_0x27fcdd[_0x27d9('0x32')]:_0x3d314f[_0x27d9('0x2f')];_0x27fcdd['order']=qs[_0x27d9('0x37')](_0x4adfc3['query'][_0x27d9('0x37')]);_0x27fcdd[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x4adfc3['query'],_0x3d314f[_0x27d9('0x39')]));if(_0x4adfc3[_0x27d9('0x30')]['filter']){_0x27fcdd[_0x27d9('0x38')]=_[_0x27d9('0x3c')](_0x27fcdd[_0x27d9('0x38')],{'$or':_['map'](_0x27fcdd['attributes'],function(_0x39bc3e){var _0x502162={};_0x502162[_0x39bc3e]={'$like':'%'+_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x3b')]+'%'};return _0x502162;})});}_0x27fcdd=_[_0x27d9('0x3c')]({},_0x27fcdd,_0x4adfc3[_0x27d9('0x46')]);return _0x46927f[_0x27d9('0x4f')](_0x27fcdd);}})[_0x27d9('0x24')](function(_0x407e92){if(_0x407e92){_0x2964bc=_0x407e92['length'];if(!_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x35')]('nolimit')){_0x27fcdd[_0x27d9('0x1b')]=qs[_0x27d9('0x1b')](_0x4adfc3[_0x27d9('0x30')]['limit']);_0x27fcdd[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x4adfc3[_0x27d9('0x30')][_0x27d9('0x1e')]);}return _0x46927f[_0x27d9('0x4f')](_0x27fcdd);}})['then'](function(_0x564049){if(_0x564049){return _0x564049?{'count':_0x2964bc,'rows':_0x564049}:null;}})['then'](respondWithResult(_0x10e788,null))[_0x27d9('0x42')](handleError(_0x10e788,null));};exports[_0x27d9('0x50')]=function(_0x1f02d9,_0x22db81,_0x31deee){var _0x4cc4b0={};var _0xd65920={};var _0x407cd1;var _0x370fad;return db[_0x27d9('0x2c')]['findOne']({'where':{'id':_0x1f02d9[_0x27d9('0x43')]['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x22db81,null))[_0x27d9('0x24')](function(_0x336d0c){if(_0x336d0c){_0x407cd1=_0x336d0c;_0xd65920[_0x27d9('0x2f')]=_[_0x27d9('0x31')](db[_0x27d9('0x51')][_0x27d9('0x44')]);_0xd65920[_0x27d9('0x30')]=_[_0x27d9('0x31')](_0x1f02d9['query']);_0xd65920[_0x27d9('0x39')]=_[_0x27d9('0x45')](_0xd65920[_0x27d9('0x2f')],_0xd65920['query']);_0x4cc4b0['attributes']=_['intersection'](_0xd65920[_0x27d9('0x2f')],qs['fields'](_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x33')]));_0x4cc4b0[_0x27d9('0x32')]=_0x4cc4b0[_0x27d9('0x32')][_0x27d9('0x34')]?_0x4cc4b0[_0x27d9('0x32')]:_0xd65920[_0x27d9('0x2f')];_0x4cc4b0[_0x27d9('0x36')]=qs[_0x27d9('0x37')](_0x1f02d9['query'][_0x27d9('0x37')]);_0x4cc4b0[_0x27d9('0x38')]=qs[_0x27d9('0x39')](_[_0x27d9('0x3a')](_0x1f02d9[_0x27d9('0x30')],_0xd65920[_0x27d9('0x39')]));if(_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x3b')]){_0x4cc4b0['where']=_['merge'](_0x4cc4b0[_0x27d9('0x38')],{'$or':_[_0x27d9('0x2b')](_0x4cc4b0[_0x27d9('0x32')],function(_0x553b29){var _0x1a4521={};_0x1a4521[_0x553b29]={'$like':'%'+_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x3b')]+'%'};return _0x1a4521;})});}_0x4cc4b0=_[_0x27d9('0x3c')]({},_0x4cc4b0,_0x1f02d9[_0x27d9('0x46')]);return _0x407cd1[_0x27d9('0x50')](_0x4cc4b0);}})[_0x27d9('0x24')](function(_0x728e2f){if(_0x728e2f){_0x370fad=_0x728e2f[_0x27d9('0x34')];if(!_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x35')](_0x27d9('0x4d'))){_0x4cc4b0[_0x27d9('0x1b')]=qs['limit'](_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x1b')]);_0x4cc4b0[_0x27d9('0x1e')]=qs[_0x27d9('0x1e')](_0x1f02d9[_0x27d9('0x30')][_0x27d9('0x1e')]);}return _0x407cd1[_0x27d9('0x50')](_0x4cc4b0);}})['then'](function(_0x5b99d7){if(_0x5b99d7){return _0x5b99d7?{'count':_0x370fad,'rows':_0x5b99d7}:null;}})['then'](respondWithResult(_0x22db81,null))['catch'](handleError(_0x22db81,null));};exports[_0x27d9('0x52')]=function(_0x487fce,_0x443ca4,_0x374bc9){if(_0x487fce[_0x27d9('0x49')]['id']){delete _0x487fce['body']['id'];}return db[_0x27d9('0x2c')]['findOne']({'where':{'id':_0x487fce['params']['id']}})[_0x27d9('0x24')](handleEntityNotFound(_0x443ca4,null))[_0x27d9('0x24')](function(_0x212285){if(_0x212285){return _0x212285['setTags'](_0x487fce[_0x27d9('0x49')][_0x27d9('0x53')]||[]);}return null;})[_0x27d9('0x24')](respondWithResult(_0x443ca4,null))['catch'](handleError(_0x443ca4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 3440118..5ea16fc 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 _0x765e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x5a91a5,_0x1eb099){var _0x8f99de=function(_0x579b28){while(--_0x579b28){_0x5a91a5['push'](_0x5a91a5['shift']());}};_0x8f99de(++_0x1eb099);}(_0x765e,0x131));var _0xe765=function(_0x46d7d2,_0x389d38){_0x46d7d2=_0x46d7d2-0x0;var _0x2178d6=_0x765e[_0x46d7d2];return _0x2178d6;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var logger=require(_0xe765('0x2'))(_0xe765('0x3'));var moment=require(_0xe765('0x4'));var BPromise=require(_0xe765('0x5'));var rp=require(_0xe765('0x6'));var fs=require('fs');var path=require(_0xe765('0x7'));var rimraf=require(_0xe765('0x8'));var config=require(_0xe765('0x9'));var attributes=require(_0xe765('0xa'));module[_0xe765('0xb')]=function(_0x40ac5e,_0xdcac86){return _0x40ac5e[_0xe765('0xc')]('DeskConfiguration',attributes,{'tableName':_0xe765('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x925b=['int_desk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x301ea6,_0x202cf3){var _0x3bd1ae=function(_0xc27c01){while(--_0xc27c01){_0x301ea6['push'](_0x301ea6['shift']());}};_0x3bd1ae(++_0x202cf3);}(_0x925b,0x169));var _0xb925=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0x925b[_0x5f746f];return _0x198d15;};'use strict';var _=require(_0xb925('0x0'));var util=require(_0xb925('0x1'));var logger=require(_0xb925('0x2'))('api');var moment=require(_0xb925('0x3'));var BPromise=require(_0xb925('0x4'));var rp=require(_0xb925('0x5'));var fs=require('fs');var path=require(_0xb925('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb925('0x7'));module[_0xb925('0x8')]=function(_0x15328b,_0x11216e){return _0x15328b[_0xb925('0x9')](_0xb925('0xa'),attributes,{'tableName':_0xb925('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index a0f9027..d72a5d7 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 _0x34a5=['stringify','error','message','info','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x34a5,0xc2));var _0x534a=function(_0x42ee23,_0x3e0acb){_0x42ee23=_0x42ee23-0x0;var _0x18d3e5=_0x34a5[_0x42ee23];return _0x18d3e5;};'use strict';var _=require(_0x534a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x534a('0x1'));var fs=require('fs');var Redis=require(_0x534a('0x2'));var db=require(_0x534a('0x3'))['db'];var utils=require(_0x534a('0x4'));var logger=require(_0x534a('0x5'))(_0x534a('0x6'));var config=require(_0x534a('0x7'));var jayson=require(_0x534a('0x8'));var client=jayson[_0x534a('0x9')][_0x534a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27b2cd,_0x31a4e7,_0x167ea5){return new BPromise(function(_0x3c85e8,_0x10ebcc){return client['request'](_0x27b2cd,_0x167ea5)[_0x534a('0xb')](function(_0x3d86ff){logger['info'](_0x534a('0xc'),_0x31a4e7,_0x534a('0xd'));logger[_0x534a('0xe')](_0x534a('0xf'),_0x31a4e7,_0x534a('0xd'),JSON[_0x534a('0x10')](_0x3d86ff));if(_0x3d86ff[_0x534a('0x11')]){if(_0x3d86ff[_0x534a('0x11')]['code']===0x1f4){logger[_0x534a('0x11')](_0x534a('0xc'),_0x31a4e7,_0x3d86ff['error'][_0x534a('0x12')]);return _0x10ebcc(_0x3d86ff[_0x534a('0x11')][_0x534a('0x12')]);}logger[_0x534a('0x11')](_0x534a('0xc'),_0x31a4e7,_0x3d86ff['error'][_0x534a('0x12')]);return _0x3c85e8(_0x3d86ff[_0x534a('0x11')][_0x534a('0x12')]);}else{logger[_0x534a('0x13')](_0x534a('0xc'),_0x31a4e7,_0x534a('0xd'));_0x3c85e8(_0x3d86ff[_0x534a('0x14')][_0x534a('0x12')]);}})['catch'](function(_0x4f2a7d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x31a4e7,_0x4f2a7d);_0x10ebcc(_0x4f2a7d);});});} \ No newline at end of file +var _0x29f4=['error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2797bd,_0x4a1dc1){var _0x3fd47b=function(_0x4542c0){while(--_0x4542c0){_0x2797bd['push'](_0x2797bd['shift']());}};_0x3fd47b(++_0x4a1dc1);}(_0x29f4,0x1d1));var _0x429f=function(_0x29b2c0,_0x585b05){_0x29b2c0=_0x29b2c0-0x0;var _0x569e08=_0x29f4[_0x29b2c0];return _0x569e08;};'use strict';var _=require(_0x429f('0x0'));var util=require(_0x429f('0x1'));var moment=require(_0x429f('0x2'));var BPromise=require(_0x429f('0x3'));var rs=require(_0x429f('0x4'));var fs=require('fs');var Redis=require(_0x429f('0x5'));var db=require(_0x429f('0x6'))['db'];var utils=require(_0x429f('0x7'));var logger=require(_0x429f('0x8'))(_0x429f('0x9'));var config=require(_0x429f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x429f('0xb')][_0x429f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b5bbc,_0x155c27,_0x4c7fcb){return new BPromise(function(_0x31780f,_0x550aeb){return client[_0x429f('0xd')](_0x3b5bbc,_0x4c7fcb)['then'](function(_0x35bbf6){logger['info'](_0x429f('0xe'),_0x155c27,_0x429f('0xf'));logger['debug'](_0x429f('0x10'),_0x155c27,'request\x20sent',JSON[_0x429f('0x11')](_0x35bbf6));if(_0x35bbf6[_0x429f('0x12')]){if(_0x35bbf6['error']['code']===0x1f4){logger[_0x429f('0x12')](_0x429f('0xe'),_0x155c27,_0x35bbf6[_0x429f('0x12')][_0x429f('0x13')]);return _0x550aeb(_0x35bbf6[_0x429f('0x12')][_0x429f('0x13')]);}logger[_0x429f('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x155c27,_0x35bbf6[_0x429f('0x12')][_0x429f('0x13')]);return _0x31780f(_0x35bbf6['error']['message']);}else{logger[_0x429f('0x14')](_0x429f('0xe'),_0x155c27,_0x429f('0xf'));_0x31780f(_0x35bbf6[_0x429f('0x15')][_0x429f('0x13')]);}})[_0x429f('0x16')](function(_0x39e8dd){logger[_0x429f('0x12')](_0x429f('0xe'),_0x155c27,_0x39e8dd);_0x550aeb(_0x39e8dd);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 88be8f1..7a01833 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 _0x8069=['multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intDeskField.controller','isAuthenticated','index','post','create','update','delete','/:id','destroy','exports'];(function(_0x15759d,_0x3efc98){var _0xd57956=function(_0x162327){while(--_0x162327){_0x15759d['push'](_0x15759d['shift']());}};_0xd57956(++_0x3efc98);}(_0x8069,0xbb));var _0x9806=function(_0xe4df7e,_0xd5726f){_0xe4df7e=_0xe4df7e-0x0;var _0x241acb=_0x8069[_0xe4df7e];return _0x241acb;};'use strict';var multer=require(_0x9806('0x0'));var util=require(_0x9806('0x1'));var path=require(_0x9806('0x2'));var timeout=require(_0x9806('0x3'));var express=require('express');var router=express[_0x9806('0x4')]();var fs_extra=require(_0x9806('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9806('0x6'));var controller=require(_0x9806('0x7'));router['get']('/',auth[_0x9806('0x8')](),controller[_0x9806('0x9')]);router['get']('/:id',auth[_0x9806('0x8')](),controller['show']);router[_0x9806('0xa')]('/',auth[_0x9806('0x8')](),controller[_0x9806('0xb')]);router['put']('/:id',auth[_0x9806('0x8')](),controller[_0x9806('0xc')]);router[_0x9806('0xd')](_0x9806('0xe'),auth['isAuthenticated'](),controller[_0x9806('0xf')]);module[_0x9806('0x10')]=router; \ No newline at end of file +var _0xb9f7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x587c0f,_0x4e548a){var _0x4931b5=function(_0x960fb4){while(--_0x960fb4){_0x587c0f['push'](_0x587c0f['shift']());}};_0x4931b5(++_0x4e548a);}(_0xb9f7,0x18b));var _0x7b9f=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb9f7[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0x7b9f('0x0'));var util=require(_0x7b9f('0x1'));var path=require(_0x7b9f('0x2'));var timeout=require(_0x7b9f('0x3'));var express=require('express');var router=express[_0x7b9f('0x4')]();var fs_extra=require(_0x7b9f('0x5'));var auth=require(_0x7b9f('0x6'));var interaction=require(_0x7b9f('0x7'));var config=require(_0x7b9f('0x8'));var controller=require(_0x7b9f('0x9'));router['get']('/',auth[_0x7b9f('0xa')](),controller[_0x7b9f('0xb')]);router[_0x7b9f('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x7b9f('0xd')]);router[_0x7b9f('0xe')]('/',auth[_0x7b9f('0xa')](),controller[_0x7b9f('0xf')]);router[_0x7b9f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7b9f('0x11')]);router['delete']('/:id',auth[_0x7b9f('0xa')](),controller['destroy']);module[_0x7b9f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 79f46d6..3c5e6b9 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 _0xe755=['string','variable','customVariable','picklist','STRING','exports','ENUM'];(function(_0x215658,_0x2d73ea){var _0x52ddf1=function(_0x2ed252){while(--_0x2ed252){_0x215658['push'](_0x215658['shift']());}};_0x52ddf1(++_0x2d73ea);}(_0xe755,0x11d));var _0x5e75=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xe755[_0x685346];return _0x52e15b;};'use strict';var Sequelize=require('sequelize');module[_0x5e75('0x0')]={'type':{'type':Sequelize[_0x5e75('0x1')](_0x5e75('0x2'),_0x5e75('0x3'),_0x5e75('0x4'),'keyValue',_0x5e75('0x5')),'defaultValue':_0x5e75('0x2')},'content':{'type':Sequelize[_0x5e75('0x6')]},'key':{'type':Sequelize[_0x5e75('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5e75('0x2'),'variable',_0x5e75('0x4'))},'keyContent':{'type':Sequelize[_0x5e75('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5e75('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5e75('0x6')]}}; \ No newline at end of file +var _0x52bc=['STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0x52bc,0x122));var _0xc52b=function(_0x22cec8,_0x1eea85){_0x22cec8=_0x22cec8-0x0;var _0x56aeba=_0x52bc[_0x22cec8];return _0x56aeba;};'use strict';var Sequelize=require(_0xc52b('0x0'));module['exports']={'type':{'type':Sequelize[_0xc52b('0x1')]('string',_0xc52b('0x2'),_0xc52b('0x3'),_0xc52b('0x4'),_0xc52b('0x5')),'defaultValue':_0xc52b('0x6')},'content':{'type':Sequelize[_0xc52b('0x7')]},'key':{'type':Sequelize[_0xc52b('0x7')]},'keyType':{'type':Sequelize[_0xc52b('0x1')]('string',_0xc52b('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xc52b('0x7')]},'idField':{'type':Sequelize[_0xc52b('0x7')]},'nameField':{'type':Sequelize[_0xc52b('0x7')]},'customField':{'type':Sequelize[_0xc52b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7a19f94..a95c327 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 _0xfcf0=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','type','key','model','map','keys','query','filters'];(function(_0x4209ef,_0x278719){var _0x5ee849=function(_0x1c4d8c){while(--_0x1c4d8c){_0x4209ef['push'](_0x4209ef['shift']());}};_0x5ee849(++_0x278719);}(_0xfcf0,0x138));var _0x0fcf=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xfcf0[_0xb66df];return _0x42a702;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':!![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));}; \ No newline at end of file +var _0x2a8b=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','options','include','findAll','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','sox'];(function(_0x3c3195,_0x595377){var _0x2ee24e=function(_0x1e9457){while(--_0x1e9457){_0x3c3195['push'](_0x3c3195['shift']());}};_0x2ee24e(++_0x595377);}(_0x2a8b,0x10a));var _0xb2a8=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x2a8b[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require(_0xb2a8('0x0'));var rimraf=require(_0xb2a8('0x1'));var zipdir=require(_0xb2a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2a8('0x3'));var moment=require(_0xb2a8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb2a8('0x5'));var csv=require('to-csv');var ejs=require(_0xb2a8('0x6'));var fs=require('fs');var fs_extra=require(_0xb2a8('0x7'));var _=require(_0xb2a8('0x8'));var squel=require(_0xb2a8('0x9'));var crypto=require(_0xb2a8('0xa'));var jsforce=require(_0xb2a8('0xb'));var deskjs=require(_0xb2a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb2a8('0xd'));var Papa=require('papaparse');var Redis=require(_0xb2a8('0xe'));var authService=require(_0xb2a8('0xf'));var qs=require(_0xb2a8('0x10'));var as=require(_0xb2a8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2a8('0x12'))(_0xb2a8('0x13'));var utils=require(_0xb2a8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb2a8('0x15'));var db=require(_0xb2a8('0x16'))['db'];function respondWithStatusCode(_0x48f264,_0x40141e){_0x40141e=_0x40141e||0xcc;return function(_0x2de735){if(_0x2de735){return _0x48f264[_0xb2a8('0x17')](_0x40141e);}return _0x48f264[_0xb2a8('0x18')](_0x40141e)[_0xb2a8('0x19')]();};}function respondWithResult(_0x3f38c5,_0x367ce7){_0x367ce7=_0x367ce7||0xc8;return function(_0x235950){if(_0x235950){return _0x3f38c5[_0xb2a8('0x18')](_0x367ce7)['json'](_0x235950);}};}function respondWithFilteredResult(_0x217188,_0x3837c3){return function(_0x45c19d){if(_0x45c19d){var _0xc05b9e=typeof _0x3837c3['offset']===_0xb2a8('0x1a')&&typeof _0x3837c3[_0xb2a8('0x1b')]===_0xb2a8('0x1a');var _0x110037=_0x45c19d['count'];var _0x2c80da=_0xc05b9e?0x0:_0x3837c3[_0xb2a8('0x1c')];var _0x38a3f5=_0xc05b9e?_0x45c19d[_0xb2a8('0x1d')]:_0x3837c3[_0xb2a8('0x1c')]+_0x3837c3[_0xb2a8('0x1b')];var _0x2bb137;if(_0x38a3f5>=_0x110037){_0x38a3f5=_0x110037;_0x2bb137=0xc8;}else{_0x2bb137=0xce;}_0x217188[_0xb2a8('0x18')](_0x2bb137);return _0x217188[_0xb2a8('0x1e')](_0xb2a8('0x1f'),_0x2c80da+'-'+_0x38a3f5+'/'+_0x110037)['json'](_0x45c19d);}return null;};}function patchUpdates(_0x159c10){return function(_0x248dc0){try{jsonpatch[_0xb2a8('0x20')](_0x248dc0,_0x159c10,!![]);}catch(_0x59d801){return BPromise[_0xb2a8('0x21')](_0x59d801);}return _0x248dc0['save']();};}function saveUpdates(_0x332679,_0x130e27){return function(_0x450e16){if(_0x450e16){return _0x450e16[_0xb2a8('0x22')](_0x332679)[_0xb2a8('0x23')](function(_0x530624){return _0x530624;});}return null;};}function removeEntity(_0x65a1d2,_0x379753){return function(_0x29c446){if(_0x29c446){return _0x29c446['destroy']()[_0xb2a8('0x23')](function(){_0x65a1d2[_0xb2a8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339582,_0x28add4){return function(_0x5f08b7){if(!_0x5f08b7){_0x339582[_0xb2a8('0x17')](0x194);}return _0x5f08b7;};}function handleError(_0x5f09ee,_0x251151){_0x251151=_0x251151||0x1f4;return function(_0x2906b5){logger['error'](_0x2906b5[_0xb2a8('0x24')]);if(_0x2906b5[_0xb2a8('0x25')]){delete _0x2906b5['name'];}_0x5f09ee['status'](_0x251151)[_0xb2a8('0x26')](_0x2906b5);};}exports[_0xb2a8('0x27')]=function(_0x567be7,_0x10b336){var _0x3d8e67={},_0x133619={},_0x10ac5e={'count':0x0,'rows':[]};var _0x1998a3=_[_0xb2a8('0x28')](db[_0xb2a8('0x29')][_0xb2a8('0x2a')],function(_0x5f0deb){return{'name':_0x5f0deb[_0xb2a8('0x2b')],'type':_0x5f0deb[_0xb2a8('0x2c')][_0xb2a8('0x2d')]};});_0x133619[_0xb2a8('0x2e')]=_[_0xb2a8('0x28')](_0x1998a3,_0xb2a8('0x25'));_0x133619['query']=_[_0xb2a8('0x2f')](_0x567be7[_0xb2a8('0x30')]);_0x133619['filters']=_['intersection'](_0x133619['model'],_0x133619[_0xb2a8('0x30')]);_0x3d8e67['attributes']=_['intersection'](_0x133619['model'],qs['fields'](_0x567be7[_0xb2a8('0x30')][_0xb2a8('0x31')]));_0x3d8e67[_0xb2a8('0x32')]=_0x3d8e67[_0xb2a8('0x32')][_0xb2a8('0x33')]?_0x3d8e67['attributes']:_0x133619[_0xb2a8('0x2e')];if(!_0x567be7[_0xb2a8('0x30')][_0xb2a8('0x34')]('nolimit')){_0x3d8e67[_0xb2a8('0x1b')]=qs['limit'](_0x567be7['query'][_0xb2a8('0x1b')]);_0x3d8e67[_0xb2a8('0x1c')]=qs[_0xb2a8('0x1c')](_0x567be7[_0xb2a8('0x30')][_0xb2a8('0x1c')]);}_0x3d8e67['order']=qs[_0xb2a8('0x35')](_0x567be7[_0xb2a8('0x30')]['sort']);_0x3d8e67[_0xb2a8('0x36')]=qs[_0xb2a8('0x37')](_[_0xb2a8('0x38')](_0x567be7[_0xb2a8('0x30')],_0x133619[_0xb2a8('0x37')]),_0x1998a3);if(_0x567be7[_0xb2a8('0x30')]['filter']){_0x3d8e67[_0xb2a8('0x36')]=_[_0xb2a8('0x39')](_0x3d8e67[_0xb2a8('0x36')],{'$or':_[_0xb2a8('0x28')](_0x1998a3,function(_0x49a695){if(_0x49a695[_0xb2a8('0x2c')]!==_0xb2a8('0x3a')){var _0x1841ae={};_0x1841ae[_0x49a695[_0xb2a8('0x25')]]={'$like':'%'+_0x567be7['query']['filter']+'%'};return _0x1841ae;}})});}_0x3d8e67=_[_0xb2a8('0x39')]({},_0x3d8e67,_0x567be7[_0xb2a8('0x3b')]);var _0x25ffad={'where':_0x3d8e67['where']};return db[_0xb2a8('0x29')][_0xb2a8('0x1d')](_0x25ffad)['then'](function(_0x3629df){_0x10ac5e[_0xb2a8('0x1d')]=_0x3629df;if(_0x567be7['query']['includeAll']){_0x3d8e67[_0xb2a8('0x3c')]=[{'all':!![]}];}return db[_0xb2a8('0x29')][_0xb2a8('0x3d')](_0x3d8e67);})[_0xb2a8('0x23')](function(_0x17e0d6){_0x10ac5e['rows']=_0x17e0d6;return _0x10ac5e;})[_0xb2a8('0x23')](respondWithFilteredResult(_0x10b336,_0x3d8e67))['catch'](handleError(_0x10b336,null));};exports[_0xb2a8('0x3e')]=function(_0x39f745,_0x137f9a){var _0x1f1004={'raw':!![],'where':{'id':_0x39f745[_0xb2a8('0x3f')]['id']}},_0x5d2679={};_0x5d2679[_0xb2a8('0x2e')]=_[_0xb2a8('0x2f')](db['DeskField'][_0xb2a8('0x2a')]);_0x5d2679[_0xb2a8('0x30')]=_[_0xb2a8('0x2f')](_0x39f745[_0xb2a8('0x30')]);_0x5d2679['filters']=_['intersection'](_0x5d2679[_0xb2a8('0x2e')],_0x5d2679[_0xb2a8('0x30')]);_0x1f1004[_0xb2a8('0x32')]=_['intersection'](_0x5d2679[_0xb2a8('0x2e')],qs[_0xb2a8('0x31')](_0x39f745[_0xb2a8('0x30')][_0xb2a8('0x31')]));_0x1f1004[_0xb2a8('0x32')]=_0x1f1004[_0xb2a8('0x32')]['length']?_0x1f1004[_0xb2a8('0x32')]:_0x5d2679[_0xb2a8('0x2e')];if(_0x39f745['query']['includeAll']){_0x1f1004[_0xb2a8('0x3c')]=[{'all':!![]}];}_0x1f1004=_[_0xb2a8('0x39')]({},_0x1f1004,_0x39f745['options']);return db[_0xb2a8('0x29')][_0xb2a8('0x40')](_0x1f1004)[_0xb2a8('0x23')](handleEntityNotFound(_0x137f9a,null))['then'](respondWithResult(_0x137f9a,null))[_0xb2a8('0x41')](handleError(_0x137f9a,null));};exports['create']=function(_0x200709,_0x3b9574){return db['DeskField'][_0xb2a8('0x42')](_0x200709[_0xb2a8('0x43')],{})[_0xb2a8('0x23')](respondWithResult(_0x3b9574,0xc9))['catch'](handleError(_0x3b9574,null));};exports['update']=function(_0x6a57e5,_0x598b6e){if(_0x6a57e5[_0xb2a8('0x43')]['id']){delete _0x6a57e5[_0xb2a8('0x43')]['id'];}return db['DeskField'][_0xb2a8('0x40')]({'where':{'id':_0x6a57e5[_0xb2a8('0x3f')]['id']}})[_0xb2a8('0x23')](handleEntityNotFound(_0x598b6e,null))[_0xb2a8('0x23')](saveUpdates(_0x6a57e5[_0xb2a8('0x43')],null))[_0xb2a8('0x23')](respondWithResult(_0x598b6e,null))[_0xb2a8('0x41')](handleError(_0x598b6e,null));};exports['destroy']=function(_0x19cc9f,_0xddc0e4){return db[_0xb2a8('0x29')][_0xb2a8('0x40')]({'where':{'id':_0x19cc9f[_0xb2a8('0x3f')]['id']}})[_0xb2a8('0x23')](handleEntityNotFound(_0xddc0e4,null))[_0xb2a8('0x23')](removeEntity(_0xddc0e4,null))[_0xb2a8('0x41')](handleError(_0xddc0e4,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6358ce7..73b019c 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 _0x50d1=['exports','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x7cce92,_0x5d5534){var _0x11b474=function(_0x3b2e4e){while(--_0x3b2e4e){_0x7cce92['push'](_0x7cce92['shift']());}};_0x11b474(++_0x5d5534);}(_0x50d1,0x17c));var _0x150d=function(_0x444092,_0x10f858){_0x444092=_0x444092-0x0;var _0x3f1209=_0x50d1[_0x444092];return _0x3f1209;};'use strict';var _=require(_0x150d('0x0'));var util=require(_0x150d('0x1'));var logger=require(_0x150d('0x2'))('api');var moment=require(_0x150d('0x3'));var BPromise=require(_0x150d('0x4'));var rp=require(_0x150d('0x5'));var fs=require('fs');var path=require(_0x150d('0x6'));var rimraf=require(_0x150d('0x7'));var config=require(_0x150d('0x8'));var attributes=require(_0x150d('0x9'));module[_0x150d('0xa')]=function(_0x56fd5c,_0x5107ff){return _0x56fd5c['define']('DeskField',attributes,{'tableName':_0x150d('0xb'),'paranoid':![],'indexes':[{'name':_0x150d('0xc'),'fields':[_0x150d('0xd'),_0x150d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe99d=['rimraf','exports','define','DeskField','int_desk_fields','desk_unique_index','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x20d30c,_0x455489){var _0x4fefc1=function(_0x307e3d){while(--_0x307e3d){_0x20d30c['push'](_0x20d30c['shift']());}};_0x4fefc1(++_0x455489);}(_0xe99d,0x156));var _0xde99=function(_0xf4897b,_0xc219a){_0xf4897b=_0xf4897b-0x0;var _0x3a1a7d=_0xe99d[_0xf4897b];return _0x3a1a7d;};'use strict';var _=require(_0xde99('0x0'));var util=require(_0xde99('0x1'));var logger=require(_0xde99('0x2'))('api');var moment=require('moment');var BPromise=require(_0xde99('0x3'));var rp=require(_0xde99('0x4'));var fs=require('fs');var path=require(_0xde99('0x5'));var rimraf=require(_0xde99('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xde99('0x7')]=function(_0x6752fc,_0x218587){return _0x6752fc[_0xde99('0x8')](_0xde99('0x9'),attributes,{'tableName':_0xde99('0xa'),'paranoid':![],'indexes':[{'name':_0xde99('0xb'),'fields':['idField','FieldId'],'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 402dcd3..e0059a6 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 _0x5c1e=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','request\x20sent','catch','util','bluebird'];(function(_0x411f3b,_0x87a543){var _0x4bc446=function(_0x40170b){while(--_0x40170b){_0x411f3b['push'](_0x411f3b['shift']());}};_0x4bc446(++_0x87a543);}(_0x5c1e,0x1a2));var _0xe5c1=function(_0x88c82f,_0x5496a7){_0x88c82f=_0x88c82f-0x0;var _0x4c6256=_0x5c1e[_0x88c82f];return _0x4c6256;};'use strict';var _=require('lodash');var util=require(_0xe5c1('0x0'));var moment=require('moment');var BPromise=require(_0xe5c1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5c1('0x2'));var db=require(_0xe5c1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5c1('0x4'))('rpc');var config=require(_0xe5c1('0x5'));var jayson=require(_0xe5c1('0x6'));var client=jayson[_0xe5c1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x563ef1,_0x2dbe0f,_0x504a4c){return new BPromise(function(_0x10c1bb,_0x19a17a){return client[_0xe5c1('0x8')](_0x563ef1,_0x504a4c)[_0xe5c1('0x9')](function(_0x1398bc){logger[_0xe5c1('0xa')]('DeskField,\x20%s,\x20%s',_0x2dbe0f,'request\x20sent');logger[_0xe5c1('0xb')](_0xe5c1('0xc'),_0x2dbe0f,'request\x20sent',JSON[_0xe5c1('0xd')](_0x1398bc));if(_0x1398bc[_0xe5c1('0xe')]){if(_0x1398bc[_0xe5c1('0xe')][_0xe5c1('0xf')]===0x1f4){logger['error'](_0xe5c1('0x10'),_0x2dbe0f,_0x1398bc[_0xe5c1('0xe')][_0xe5c1('0x11')]);return _0x19a17a(_0x1398bc[_0xe5c1('0xe')][_0xe5c1('0x11')]);}logger[_0xe5c1('0xe')](_0xe5c1('0x10'),_0x2dbe0f,_0x1398bc[_0xe5c1('0xe')]['message']);return _0x10c1bb(_0x1398bc[_0xe5c1('0xe')][_0xe5c1('0x11')]);}else{logger[_0xe5c1('0xa')](_0xe5c1('0x10'),_0x2dbe0f,_0xe5c1('0x12'));_0x10c1bb(_0x1398bc['result'][_0xe5c1('0x11')]);}})[_0xe5c1('0x13')](function(_0x283502){logger[_0xe5c1('0xe')](_0xe5c1('0x10'),_0x2dbe0f,_0x283502);_0x19a17a(_0x283502);});});} \ No newline at end of file +var _0x6d5f=['info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0x6d5f,0x9f));var _0xf6d5=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x6d5f[_0x4688f3];return _0x470c84;};'use strict';var _=require(_0xf6d5('0x0'));var util=require(_0xf6d5('0x1'));var moment=require(_0xf6d5('0x2'));var BPromise=require(_0xf6d5('0x3'));var rs=require(_0xf6d5('0x4'));var fs=require('fs');var Redis=require(_0xf6d5('0x5'));var db=require(_0xf6d5('0x6'))['db'];var utils=require(_0xf6d5('0x7'));var logger=require(_0xf6d5('0x8'))(_0xf6d5('0x9'));var config=require(_0xf6d5('0xa'));var jayson=require(_0xf6d5('0xb'));var client=jayson[_0xf6d5('0xc')][_0xf6d5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1a96da,_0x158529,_0x31641d){return new BPromise(function(_0x16da18,_0x2abb3e){return client[_0xf6d5('0xe')](_0x1a96da,_0x31641d)[_0xf6d5('0xf')](function(_0x2f4fa1){logger[_0xf6d5('0x10')](_0xf6d5('0x11'),_0x158529,_0xf6d5('0x12'));logger['debug'](_0xf6d5('0x13'),_0x158529,_0xf6d5('0x12'),JSON['stringify'](_0x2f4fa1));if(_0x2f4fa1[_0xf6d5('0x14')]){if(_0x2f4fa1['error'][_0xf6d5('0x15')]===0x1f4){logger[_0xf6d5('0x14')]('DeskField,\x20%s,\x20%s',_0x158529,_0x2f4fa1[_0xf6d5('0x14')]['message']);return _0x2abb3e(_0x2f4fa1[_0xf6d5('0x14')][_0xf6d5('0x16')]);}logger[_0xf6d5('0x14')](_0xf6d5('0x11'),_0x158529,_0x2f4fa1[_0xf6d5('0x14')][_0xf6d5('0x16')]);return _0x16da18(_0x2f4fa1[_0xf6d5('0x14')][_0xf6d5('0x16')]);}else{logger[_0xf6d5('0x10')](_0xf6d5('0x11'),_0x158529,_0xf6d5('0x12'));_0x16da18(_0x2f4fa1[_0xf6d5('0x17')]['message']);}})[_0xf6d5('0x18')](function(_0x2396ac){logger['error'](_0xf6d5('0x11'),_0x158529,_0x2396ac);_0x2abb3e(_0x2396ac);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index eba9337..109df1e 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 _0xc078=['addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create'];(function(_0x4962a6,_0x5e2c1b){var _0x2bbdc3=function(_0x956b4f){while(--_0x956b4f){_0x4962a6['push'](_0x4962a6['shift']());}};_0x2bbdc3(++_0x5e2c1b);}(_0xc078,0x10e));var _0x8c07=function(_0x3f443b,_0x33ff4d){_0x3f443b=_0x3f443b-0x0;var _0x5a02f3=_0xc078[_0x3f443b];return _0x5a02f3;};'use strict';var multer=require(_0x8c07('0x0'));var util=require(_0x8c07('0x1'));var path=require(_0x8c07('0x2'));var timeout=require(_0x8c07('0x3'));var express=require('express');var router=express[_0x8c07('0x4')]();var fs_extra=require(_0x8c07('0x5'));var auth=require(_0x8c07('0x6'));var interaction=require(_0x8c07('0x7'));var config=require(_0x8c07('0x8'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x8c07('0x9')](),controller[_0x8c07('0xa')]);router[_0x8c07('0xb')](_0x8c07('0xc'),auth[_0x8c07('0x9')](),controller[_0x8c07('0xd')]);router[_0x8c07('0xb')](_0x8c07('0xe'),auth[_0x8c07('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x8c07('0xf')]);router[_0x8c07('0x10')]('/',auth['isAuthenticated'](),controller[_0x8c07('0x11')]);router[_0x8c07('0x10')](_0x8c07('0xe'),auth[_0x8c07('0x9')](),controller[_0x8c07('0x12')]);router[_0x8c07('0x13')](_0x8c07('0xc'),auth['isAuthenticated'](),controller[_0x8c07('0x14')]);router[_0x8c07('0x15')](_0x8c07('0xc'),auth[_0x8c07('0x9')](),controller[_0x8c07('0x16')]);module[_0x8c07('0x17')]=router; \ No newline at end of file +var _0xab6b=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','getConfigurations','getFields','post'];(function(_0x3a39ad,_0xd1c4aa){var _0x14ff9c=function(_0x987341){while(--_0x987341){_0x3a39ad['push'](_0x3a39ad['shift']());}};_0x14ff9c(++_0xd1c4aa);}(_0xab6b,0x104));var _0xbab6=function(_0x594de,_0x44f5fa){_0x594de=_0x594de-0x0;var _0x28dbf5=_0xab6b[_0x594de];return _0x28dbf5;};'use strict';var multer=require(_0xbab6('0x0'));var util=require(_0xbab6('0x1'));var path=require(_0xbab6('0x2'));var timeout=require(_0xbab6('0x3'));var express=require('express');var router=express[_0xbab6('0x4')]();var fs_extra=require(_0xbab6('0x5'));var auth=require(_0xbab6('0x6'));var interaction=require(_0xbab6('0x7'));var config=require('../../config/environment');var controller=require(_0xbab6('0x8'));router[_0xbab6('0x9')]('/',auth[_0xbab6('0xa')](),controller[_0xbab6('0xb')]);router[_0xbab6('0x9')](_0xbab6('0xc'),auth[_0xbab6('0xa')](),controller['show']);router[_0xbab6('0x9')]('/:id/configurations',auth[_0xbab6('0xa')](),controller[_0xbab6('0xd')]);router[_0xbab6('0x9')]('/:id/fields',auth[_0xbab6('0xa')](),controller[_0xbab6('0xe')]);router[_0xbab6('0xf')]('/',auth['isAuthenticated'](),controller[_0xbab6('0x10')]);router[_0xbab6('0xf')]('/:id/configurations',auth[_0xbab6('0xa')](),controller[_0xbab6('0x11')]);router[_0xbab6('0x12')](_0xbab6('0xc'),auth[_0xbab6('0xa')](),controller[_0xbab6('0x13')]);router[_0xbab6('0x14')](_0xbab6('0xc'),auth['isAuthenticated'](),controller[_0xbab6('0x15')]);module[_0xbab6('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index fe2b459..497590d 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 _0x1052=['sequelize','exports','STRING','BOOLEAN'];(function(_0x45fef4,_0x42abe8){var _0x135d44=function(_0x5b6086){while(--_0x5b6086){_0x45fef4['push'](_0x45fef4['shift']());}};_0x135d44(++_0x42abe8);}(_0x1052,0xf4));var _0x2105=function(_0x361475,_0x32ecc5){_0x361475=_0x361475-0x0;var _0x317cf1=_0x1052[_0x361475];return _0x317cf1;};'use strict';var Sequelize=require(_0x2105('0x0'));module[_0x2105('0x1')]={'name':{'type':Sequelize[_0x2105('0x2')]},'username':{'type':Sequelize[_0x2105('0x2')]},'password':{'type':Sequelize[_0x2105('0x2')]},'remoteUri':{'type':Sequelize[_0x2105('0x2')]},'tenantId':{'type':Sequelize[_0x2105('0x2')]},'clientId':{'type':Sequelize[_0x2105('0x2')]},'clientSecret':{'type':Sequelize[_0x2105('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x2105('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x448b=['BOOLEAN','sequelize','exports','STRING'];(function(_0xc465f5,_0xa9c358){var _0x3dd839=function(_0x45aa86){while(--_0x45aa86){_0xc465f5['push'](_0xc465f5['shift']());}};_0x3dd839(++_0xa9c358);}(_0x448b,0x125));var _0xb448=function(_0x1a074f,_0x3a121e){_0x1a074f=_0x1a074f-0x0;var _0x4ebcb4=_0x448b[_0x1a074f];return _0x4ebcb4;};'use strict';var Sequelize=require(_0xb448('0x0'));module[_0xb448('0x1')]={'name':{'type':Sequelize[_0xb448('0x2')]},'username':{'type':Sequelize[_0xb448('0x2')]},'password':{'type':Sequelize[_0xb448('0x2')]},'remoteUri':{'type':Sequelize[_0xb448('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb448('0x2')]},'clientSecret':{'type':Sequelize[_0xb448('0x2')]},'serverUrl':{'type':Sequelize[_0xb448('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb448('0x2')]},'modernAuthentication':{'type':Sequelize[_0xb448('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 82a7fdc..1efe39b 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 _0x5c7c=['/oauth2/token','clientId','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','stack','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','OptionSet','Label','UserLocalizedLabel','Value','LogicalName','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','json','offset','undefined','limit','status','set','Content-Range','update','destroy','then','end','sendStatus','error','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','fields','includeAll','body','find','params','findOne','Dynamics365Configuration','getConfigurations','nolimit','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','title','description','customerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','tenantId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/'];(function(_0x26f192,_0x167b46){var _0x53c3e6=function(_0x4fd228){while(--_0x4fd228){_0x26f192['push'](_0x26f192['shift']());}};_0x53c3e6(++_0x167b46);}(_0x5c7c,0xe2));var _0xc5c7=function(_0x2bf3ef,_0x1f97a8){_0x2bf3ef=_0x2bf3ef-0x0;var _0x2315ce=_0x5c7c[_0x2bf3ef];return _0x2315ce;};'use strict';var rp=require(_0xc5c7('0x0'));var util=require('util');var _=require(_0xc5c7('0x1'));var qs=require(_0xc5c7('0x2'));var logger=require(_0xc5c7('0x3'))(_0xc5c7('0x4'));var db=require(_0xc5c7('0x5'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x3d76a7,_0x1a0549){_0x1a0549=_0x1a0549||0xc8;return function(_0x375c0d){if(_0x375c0d){return _0x3d76a7['status'](_0x1a0549)[_0xc5c7('0x6')](_0x375c0d);}};}function respondWithFilteredResult(_0x25a852,_0x3d70c1){return function(_0x18ba87){if(_0x18ba87){var _0x1c0e31=typeof _0x3d70c1[_0xc5c7('0x7')]===_0xc5c7('0x8')&&typeof _0x3d70c1[_0xc5c7('0x9')]===_0xc5c7('0x8');var _0x335360=_0x18ba87['count'];var _0x588b4c=_0x1c0e31?0x0:_0x3d70c1[_0xc5c7('0x7')];var _0x21c436=_0x1c0e31?_0x18ba87['count']:_0x3d70c1['offset']+_0x3d70c1['limit'];var _0x172f9b;if(_0x21c436>=_0x335360){_0x21c436=_0x335360;_0x172f9b=0xc8;}else{_0x172f9b=0xce;}_0x25a852[_0xc5c7('0xa')](_0x172f9b);return _0x25a852[_0xc5c7('0xb')](_0xc5c7('0xc'),_0x588b4c+'-'+_0x21c436+'/'+_0x335360)[_0xc5c7('0x6')](_0x18ba87);}return null;};}function saveUpdates(_0x129ce2){return function(_0x11bfe0){if(_0x11bfe0){return _0x11bfe0[_0xc5c7('0xd')](_0x129ce2)['then'](function(_0x293623){return _0x293623;});}return null;};}function removeEntity(_0x4f7285){return function(_0x1d708b){if(_0x1d708b){return _0x1d708b[_0xc5c7('0xe')]()[_0xc5c7('0xf')](function(){_0x4f7285[_0xc5c7('0xa')](0xcc)[_0xc5c7('0x10')]();});}};}function handleEntityNotFound(_0x262e56){return function(_0x2cdc96){if(!_0x2cdc96){_0x262e56[_0xc5c7('0x11')](0x194);}return _0x2cdc96;};}function handleError(_0x4cb1fc,_0x8229c2){_0x8229c2=_0x8229c2||0x1f4;return function(_0x16826b){logger[_0xc5c7('0x12')](_0x16826b['stack']);if(_0x16826b['name']){delete _0x16826b[_0xc5c7('0x13')];}_0x4cb1fc[_0xc5c7('0xa')](_0x8229c2)[_0xc5c7('0x14')](_0x16826b);};}exports['index']=function(_0x43c04c,_0x1e25d6){var _0x1edcde={},_0x5dda60={},_0xb28d48={'count':0x0,'rows':[]};var _0x1907be=_[_0xc5c7('0x15')](db[_0xc5c7('0x16')][_0xc5c7('0x17')],function(_0x5094aa){return{'name':_0x5094aa[_0xc5c7('0x18')],'type':_0x5094aa[_0xc5c7('0x19')]['key']};});_0x5dda60[_0xc5c7('0x1a')]=_['map'](_0x1907be,_0xc5c7('0x13'));_0x5dda60[_0xc5c7('0x1b')]=_[_0xc5c7('0x1c')](_0x43c04c[_0xc5c7('0x1b')]);_0x5dda60['filters']=_[_0xc5c7('0x1d')](_0x5dda60[_0xc5c7('0x1a')],_0x5dda60[_0xc5c7('0x1b')]);_0x1edcde[_0xc5c7('0x1e')]=_[_0xc5c7('0x1d')](_0x5dda60[_0xc5c7('0x1a')],qs['fields'](_0x43c04c['query']['fields']));_0x1edcde[_0xc5c7('0x1e')]=_0x1edcde[_0xc5c7('0x1e')][_0xc5c7('0x1f')]?_0x1edcde['attributes']:_0x5dda60[_0xc5c7('0x1a')];if(!_0x43c04c[_0xc5c7('0x1b')][_0xc5c7('0x20')]('nolimit')){_0x1edcde[_0xc5c7('0x9')]=qs[_0xc5c7('0x9')](_0x43c04c[_0xc5c7('0x1b')][_0xc5c7('0x9')]);_0x1edcde['offset']=qs['offset'](_0x43c04c[_0xc5c7('0x1b')][_0xc5c7('0x7')]);}_0x1edcde[_0xc5c7('0x21')]=qs['sort'](_0x43c04c[_0xc5c7('0x1b')][_0xc5c7('0x22')]);_0x1edcde[_0xc5c7('0x23')]=qs[_0xc5c7('0x24')](_[_0xc5c7('0x25')](_0x43c04c[_0xc5c7('0x1b')],_0x5dda60[_0xc5c7('0x24')]),_0x1907be);if(_0x43c04c[_0xc5c7('0x1b')][_0xc5c7('0x26')]){_0x1edcde[_0xc5c7('0x23')]=_[_0xc5c7('0x27')](_0x1edcde[_0xc5c7('0x23')],{'$or':_[_0xc5c7('0x15')](_0x1907be,function(_0x475187){if(_0x475187[_0xc5c7('0x19')]!==_0xc5c7('0x28')){var _0x5b0423={};_0x5b0423[_0x475187[_0xc5c7('0x13')]]={'$like':'%'+_0x43c04c['query'][_0xc5c7('0x26')]+'%'};return _0x5b0423;}})});}_0x1edcde=_[_0xc5c7('0x27')]({},_0x1edcde,_0x43c04c[_0xc5c7('0x29')]);var _0x55807f={'where':_0x1edcde[_0xc5c7('0x23')]};return db[_0xc5c7('0x16')]['count'](_0x55807f)[_0xc5c7('0xf')](function(_0x253618){_0xb28d48[_0xc5c7('0x2a')]=_0x253618;if(_0x43c04c[_0xc5c7('0x1b')]['includeAll']){_0x1edcde[_0xc5c7('0x2b')]=[{'all':!![]}];}return db[_0xc5c7('0x16')]['findAll'](_0x1edcde);})[_0xc5c7('0xf')](function(_0x2b1e02){_0xb28d48[_0xc5c7('0x2c')]=_0x2b1e02;return _0xb28d48;})[_0xc5c7('0xf')](respondWithFilteredResult(_0x1e25d6,_0x1edcde))[_0xc5c7('0x2d')](handleError(_0x1e25d6,null));};exports[_0xc5c7('0x2e')]=function(_0x45a9f1,_0x392c3c){var _0x1536d8={'raw':![],'where':{'id':_0x45a9f1['params']['id']}},_0x59a284={};_0x59a284[_0xc5c7('0x1a')]=_[_0xc5c7('0x1c')](db['Dynamics365Account'][_0xc5c7('0x17')]);_0x59a284[_0xc5c7('0x1b')]=_[_0xc5c7('0x1c')](_0x45a9f1['query']);_0x59a284['filters']=_[_0xc5c7('0x1d')](_0x59a284[_0xc5c7('0x1a')],_0x59a284['query']);_0x1536d8[_0xc5c7('0x1e')]=_['intersection'](_0x59a284[_0xc5c7('0x1a')],qs[_0xc5c7('0x2f')](_0x45a9f1[_0xc5c7('0x1b')][_0xc5c7('0x2f')]));_0x1536d8[_0xc5c7('0x1e')]=_0x1536d8[_0xc5c7('0x1e')][_0xc5c7('0x1f')]?_0x1536d8[_0xc5c7('0x1e')]:_0x59a284[_0xc5c7('0x1a')];if(_0x45a9f1[_0xc5c7('0x1b')][_0xc5c7('0x30')]){_0x1536d8[_0xc5c7('0x2b')]=[{'all':!![]}];}_0x1536d8=_[_0xc5c7('0x27')]({},_0x1536d8,_0x45a9f1[_0xc5c7('0x29')]);return db[_0xc5c7('0x16')]['find'](_0x1536d8)[_0xc5c7('0xf')](handleEntityNotFound(_0x392c3c,null))[_0xc5c7('0xf')](respondWithResult(_0x392c3c,null))[_0xc5c7('0x2d')](handleError(_0x392c3c,null));};exports['create']=function(_0x7bf271,_0x5c9f36){return db[_0xc5c7('0x16')]['create'](_0x7bf271[_0xc5c7('0x31')],{})[_0xc5c7('0xf')](respondWithResult(_0x5c9f36,0xc9))[_0xc5c7('0x2d')](handleError(_0x5c9f36,null));};exports[_0xc5c7('0xd')]=function(_0xd11bbd,_0x29616b){if(_0xd11bbd[_0xc5c7('0x31')]['id']){delete _0xd11bbd[_0xc5c7('0x31')]['id'];}return db['Dynamics365Account'][_0xc5c7('0x32')]({'where':{'id':_0xd11bbd[_0xc5c7('0x33')]['id']}})['then'](handleEntityNotFound(_0x29616b,null))[_0xc5c7('0xf')](saveUpdates(_0xd11bbd[_0xc5c7('0x31')],null))['then'](respondWithResult(_0x29616b,null))[_0xc5c7('0x2d')](handleError(_0x29616b,null));};exports[_0xc5c7('0xe')]=function(_0x1e5fc1,_0x5a6869){return db[_0xc5c7('0x16')][_0xc5c7('0x32')]({'where':{'id':_0x1e5fc1[_0xc5c7('0x33')]['id']}})['then'](handleEntityNotFound(_0x5a6869,null))[_0xc5c7('0xf')](removeEntity(_0x5a6869,null))[_0xc5c7('0x2d')](handleError(_0x5a6869,null));};exports['getConfigurations']=function(_0xba1b68,_0x57ad48){var _0x5ec1f0={};var _0x71f65d={};var _0x502a05;var _0xbc36a5;return db[_0xc5c7('0x16')][_0xc5c7('0x34')]({'where':{'id':_0xba1b68[_0xc5c7('0x33')]['id']}})[_0xc5c7('0xf')](handleEntityNotFound(_0x57ad48,null))['then'](function(_0x4e8cac){if(_0x4e8cac){_0x502a05=_0x4e8cac;_0x71f65d[_0xc5c7('0x1a')]=_[_0xc5c7('0x1c')](db[_0xc5c7('0x35')]['rawAttributes']);_0x71f65d[_0xc5c7('0x1b')]=_[_0xc5c7('0x1c')](_0xba1b68[_0xc5c7('0x1b')]);_0x71f65d[_0xc5c7('0x24')]=_['intersection'](_0x71f65d[_0xc5c7('0x1a')],_0x71f65d[_0xc5c7('0x1b')]);_0x5ec1f0[_0xc5c7('0x1e')]=_[_0xc5c7('0x1d')](_0x71f65d['model'],qs['fields'](_0xba1b68['query'][_0xc5c7('0x2f')]));_0x5ec1f0[_0xc5c7('0x1e')]=_0x5ec1f0[_0xc5c7('0x1e')][_0xc5c7('0x1f')]?_0x5ec1f0['attributes']:_0x71f65d[_0xc5c7('0x1a')];_0x5ec1f0[_0xc5c7('0x21')]=qs['sort'](_0xba1b68[_0xc5c7('0x1b')]['sort']);_0x5ec1f0[_0xc5c7('0x23')]=qs[_0xc5c7('0x24')](_['pick'](_0xba1b68['query'],_0x71f65d['filters']));if(_0xba1b68['query'][_0xc5c7('0x26')]){_0x5ec1f0[_0xc5c7('0x23')]=_['merge'](_0x5ec1f0[_0xc5c7('0x23')],{'$or':_[_0xc5c7('0x15')](_0x5ec1f0[_0xc5c7('0x1e')],function(_0x54177b){var _0xf93c78={};_0xf93c78[_0x54177b]={'$like':'%'+_0xba1b68[_0xc5c7('0x1b')][_0xc5c7('0x26')]+'%'};return _0xf93c78;})});}_0x5ec1f0=_[_0xc5c7('0x27')]({},_0x5ec1f0,_0xba1b68['options']);return _0x502a05[_0xc5c7('0x36')](_0x5ec1f0);}})[_0xc5c7('0xf')](function(_0x11fa51){if(_0x11fa51){_0xbc36a5=_0x11fa51[_0xc5c7('0x1f')];if(!_0xba1b68[_0xc5c7('0x1b')][_0xc5c7('0x20')](_0xc5c7('0x37'))){_0x5ec1f0[_0xc5c7('0x9')]=qs[_0xc5c7('0x9')](_0xba1b68[_0xc5c7('0x1b')]['limit']);_0x5ec1f0[_0xc5c7('0x7')]=qs[_0xc5c7('0x7')](_0xba1b68['query'][_0xc5c7('0x7')]);}return _0x502a05[_0xc5c7('0x36')](_0x5ec1f0);}})['then'](function(_0x315e6e){if(_0x315e6e){return _0x315e6e?{'count':_0xbc36a5,'rows':_0x315e6e}:null;}})[_0xc5c7('0xf')](respondWithResult(_0x57ad48,null))[_0xc5c7('0x2d')](handleError(_0x57ad48,null));};exports['addConfiguration']=function(_0x2fb6c1,_0x1fffba){if(_0x2fb6c1[_0xc5c7('0x31')]['id']){delete _0x2fb6c1[_0xc5c7('0x31')]['id'];}return db[_0xc5c7('0x16')][_0xc5c7('0x34')]({'where':{'id':_0x2fb6c1[_0xc5c7('0x33')]['id']}})[_0xc5c7('0xf')](handleEntityNotFound(_0x1fffba,null))[_0xc5c7('0xf')](function(_0x552ef7){if(_0x552ef7){_0x2fb6c1[_0xc5c7('0x31')]['AccountId']=_0x552ef7['id'];_0x2fb6c1['body']['Subjects']=integrations['getSubjects'](_0x2fb6c1['body'][_0xc5c7('0x38')],_0x2fb6c1[_0xc5c7('0x31')][_0xc5c7('0x19')]);_0x2fb6c1[_0xc5c7('0x31')][_0xc5c7('0x39')]=integrations[_0xc5c7('0x3a')](_0x2fb6c1[_0xc5c7('0x31')][_0xc5c7('0x38')],_0x2fb6c1[_0xc5c7('0x31')]['type']);return db[_0xc5c7('0x35')]['create'](_0x2fb6c1[_0xc5c7('0x31')],{'include':[{'model':db[_0xc5c7('0x3b')],'as':_0xc5c7('0x3c')},{'model':db[_0xc5c7('0x3b')],'as':_0xc5c7('0x39')}]});}return null;})['then'](respondWithResult(_0x1fffba,null))[_0xc5c7('0x2d')](handleError(_0x1fffba,null));};function sanitizeRemoteUri(_0x4cfe1a){var _0x3ac286=_0x4cfe1a[_0xc5c7('0x3d')](-0x1);if(_0x3ac286==='/')return _0x4cfe1a[_0xc5c7('0x3e')](0x0,_0x4cfe1a[_0xc5c7('0x3f')](_0x3ac286));return _0x4cfe1a;}function getWebApiUrl(_0x43b249){return util[_0xc5c7('0x40')](_0xc5c7('0x41'),_0x43b249);}exports[_0xc5c7('0x42')]=function(_0x5f5d05,_0x2c56cb){var _0xe462df=_0x5f5d05[_0xc5c7('0x1b')][_0xc5c7('0x43')];var _0x3b0303=_0xe462df===_0xc5c7('0x44')?'Incident':'PhoneCall';var _0x11b4bd='';var _0x2a673d='';var _0x24b827='';var _0x4ff9e3='';var _0x1c639d='';var _0x19be66='';var _0x2c4834='';var _0x58f082='';var _0x69cf1e=[_0xc5c7('0x45'),_0xc5c7('0x46'),_0xc5c7('0x47'),'ownerid','caseorigincode',_0xc5c7('0x48'),_0xc5c7('0x49'),_0xc5c7('0x4a'),_0xc5c7('0x4b'),_0xc5c7('0x4c')];var _0x5da8a9=[_0xc5c7('0x4d'),'accountidyominame',_0xc5c7('0x4e'),_0xc5c7('0x4f'),_0xc5c7('0x50'),_0xc5c7('0x51'),_0xc5c7('0x52'),_0xc5c7('0x53'),_0xc5c7('0x54'),_0xc5c7('0x55'),'createdbyname','createdbyyominame',_0xc5c7('0x56'),'createdonbehalfbyname',_0xc5c7('0x57'),_0xc5c7('0x58'),'customeridtype',_0xc5c7('0x59'),_0xc5c7('0x5a'),_0xc5c7('0x5b'),'entityimage_timestamp',_0xc5c7('0x5c'),_0xc5c7('0x5d'),_0xc5c7('0x5e'),_0xc5c7('0x5f'),_0xc5c7('0x60'),'importsequencenumber','influencescore',_0xc5c7('0x61'),_0xc5c7('0x62'),_0xc5c7('0x63'),_0xc5c7('0x64'),_0xc5c7('0x65'),_0xc5c7('0x66'),'modifiedbyyominame','modifiedon','modifiedonbehalfbyname',_0xc5c7('0x67'),_0xc5c7('0x68'),_0xc5c7('0x69'),_0xc5c7('0x6a'),'onholdtime',_0xc5c7('0x6b'),_0xc5c7('0x6c'),'owneridtype','owneridyominame',_0xc5c7('0x6d'),_0xc5c7('0x6e'),_0xc5c7('0x6f'),_0xc5c7('0x70'),_0xc5c7('0x71'),_0xc5c7('0x72'),_0xc5c7('0x73'),'resolvebykpiidname',_0xc5c7('0x74'),_0xc5c7('0x75'),_0xc5c7('0x76'),_0xc5c7('0x77'),_0xc5c7('0x78'),_0xc5c7('0x79'),_0xc5c7('0x7a'),'statecode',_0xc5c7('0x7b'),'subjectidname',_0xc5c7('0x7c'),_0xc5c7('0x7d'),_0xc5c7('0x7e'),_0xc5c7('0x7f'),_0xc5c7('0x80'),'versionnumber'];var _0xad0612=_0x69cf1e[_0xc5c7('0x81')](_0x5da8a9);return db['Dynamics365Account'][_0xc5c7('0x34')]({'where':{'id':_0x5f5d05['params']['id']},'attributes':['id',_0xc5c7('0x82'),'password','remoteUri',_0xc5c7('0x83'),'clientId',_0xc5c7('0x84'),_0xc5c7('0x85')],'include':[{'model':db[_0xc5c7('0x86')],'as':_0xc5c7('0x86'),'attributes':['id','data5',_0xc5c7('0x87')]}]})[_0xc5c7('0xf')](handleEntityNotFound(_0x2c56cb,null))['then'](function(_0x48b1cc){if(_0x48b1cc){if(_0x48b1cc[_0xc5c7('0x85')]){_0x48b1cc[_0xc5c7('0x88')]=_0x48b1cc[_0xc5c7('0x86')][_0xc5c7('0x89')];_0x58f082=sanitizeRemoteUri(_0x48b1cc[_0xc5c7('0x86')][_0xc5c7('0x87')]);_0x2c4834=getWebApiUrl(_0x58f082);return _0x48b1cc;}_0x58f082=sanitizeRemoteUri(_0x48b1cc['remoteUri']);_0x2c4834=getWebApiUrl(_0x58f082);var _0x2bd754={'method':_0xc5c7('0x8a'),'uri':_0xc5c7('0x8b')+_0x48b1cc['tenantId']+_0xc5c7('0x8c'),'form':{'client_id':_0x48b1cc[_0xc5c7('0x8d')],'resource':_0x58f082,'username':_0x48b1cc[_0xc5c7('0x82')],'password':_0x48b1cc[_0xc5c7('0x8e')],'grant_type':'password','client_secret':_0x48b1cc['clientSecret']},'json':!![]};return rp(_0x2bd754);}})[_0xc5c7('0xf')](function(_0xa9e21d){_0x19be66=_0xa9e21d['access_token'];var _0x88dcf={'method':_0xc5c7('0x8f'),'uri':encodeURI(_0x2c4834+_0xc5c7('0x90')+_0x3b0303+'\x27'),'headers':{'Authorization':_0xc5c7('0x91')+_0x19be66,'If-None-Match':null,'OData-Version':_0xc5c7('0x92')},'json':!![]};return rp(_0x88dcf);})[_0xc5c7('0xf')](function(_0xe8651a){var _0x50d11f=_0xe8651a[_0xc5c7('0x93')][0x0];var _0x345d73=_0x50d11f[_0xc5c7('0x94')];var _0xb4d27={'method':_0xc5c7('0x8f'),'uri':_0x2c4834+'EntityDefinitions('+_0x345d73+_0xc5c7('0x95'),'headers':{'Authorization':_0xc5c7('0x91')+_0x19be66,'If-None-Match':null,'OData-Version':_0xc5c7('0x92')},'json':!![]};return rp(_0xb4d27);})[_0xc5c7('0xf')](function(_0x2c8326){_0x11b4bd=_0x2c8326;_0x2a673d=_0x11b4bd['Attributes'];_0x2a673d=_[_0xc5c7('0x96')](_0x2a673d,function(_0x1e922f){return!_0xad0612['includes'](_0x1e922f['LogicalName']);});var _0x5d41b3=[];var _0x5e3bf4=[];_0x2a673d[_0xc5c7('0x97')](function(_0x18ad0b){if(_0x18ad0b[_0xc5c7('0x98')]){var _0x35c00c=_0x18ad0b[_0xc5c7('0x98')][_0xc5c7('0x3e')](_0x18ad0b[_0xc5c7('0x98')][_0xc5c7('0x3f')]('.')+0x1);if(_0x35c00c===_0xc5c7('0x99')){_0x5d41b3[_0xc5c7('0x9a')](getSelectList(_0x2c4834,_0xe462df,_0x5e3bf4,_0x11b4bd['MetadataId'],_0x18ad0b[_0xc5c7('0x94')],_0x19be66));}}});return Promise[_0xc5c7('0x9b')](_0x5d41b3);})[_0xc5c7('0xf')](function(_0x15cf84){_0x24b827=_0x15cf84[0x0];var _0x659161=[];var _0x21ee69=[];_0x2a673d[_0xc5c7('0x97')](function(_0x2c914e){if(!_['isNil'](_0x2c914e[_0xc5c7('0x98')])){var _0x4a4d18=_0x2c914e[_0xc5c7('0x98')]['substring'](_0x2c914e[_0xc5c7('0x98')][_0xc5c7('0x3f')]('.')+0x1);if(_0x4a4d18===_0xc5c7('0x9c')){_0x659161[_0xc5c7('0x9a')](getBooleanList(_0x2c4834,_0xe462df,_0x21ee69,_0x11b4bd[_0xc5c7('0x94')],_0x2c914e[_0xc5c7('0x94')],_0x19be66));}}});return Promise[_0xc5c7('0x9b')](_0x659161);})['then'](function(_0x52e98d){_0x4ff9e3=_0x52e98d[0x0];var _0x53bd6d=[];var _0x52b942=[];_0x2a673d['forEach'](function(_0x1de2de){if(_0x1de2de[_0xc5c7('0x98')]){var _0x31d352=_0x1de2de[_0xc5c7('0x98')][_0xc5c7('0x3e')](_0x1de2de[_0xc5c7('0x98')][_0xc5c7('0x3f')]('.')+0x1);if(_0x31d352===_0xc5c7('0x9d')||_0x31d352===_0xc5c7('0x9e')||_0x31d352==='BigIntAttributeMetadata'||_0x31d352===_0xc5c7('0x9f')||_0x31d352===_0xc5c7('0xa0')||_0x31d352===_0xc5c7('0xa1')||_0x31d352===_0xc5c7('0xa2')||_0x31d352===_0xc5c7('0xa3')||_0x31d352===_0xc5c7('0xa4')||_0x31d352===_0xc5c7('0xa5')){_0x53bd6d['push'](getInputList(_0x2c4834,_0xe462df,_0x31d352,_0x52b942,_0x11b4bd['MetadataId'],_0x1de2de[_0xc5c7('0x94')],_0x19be66));}}});return Promise['all'](_0x53bd6d);})[_0xc5c7('0xf')](function(_0x4b1865){_0x1c639d=_0x4b1865[0x0];var _0x5e98ec=_0x24b827[_0xc5c7('0x81')](_0x4ff9e3)[_0xc5c7('0x81')](_0x1c639d);var _0x1f7378={'count':_0x5e98ec['length'],'rows':_0x5e98ec};return _0x1f7378;})[_0xc5c7('0xf')](respondWithResult(_0x2c56cb,null))[_0xc5c7('0x2d')](function(_0x336cf5){var _0x867a41=_0x5f5d05[_0xc5c7('0x1b')]['test']?0x1f4:_0x336cf5[_0xc5c7('0xa6')]||0x1f4;logger['error'](_0x336cf5[_0xc5c7('0xa7')]);delete _0x336cf5['name'];if(_0x867a41===0x191){_0x867a41=0x190;}_0x2c56cb[_0xc5c7('0xa')](_0x867a41)[_0xc5c7('0x14')](_0x5f5d05[_0xc5c7('0x1b')][_0xc5c7('0xa8')]?{'message':_0xc5c7('0xa9'),'statusCode':_0x336cf5['statusCode']}:_0x336cf5);});};function getSelectList(_0x3d5b0a,_0x24edff,_0x27d328,_0x8728e4,_0x120298,_0x36aa7e){var _0x87c805={'method':_0xc5c7('0x8f'),'uri':_0x3d5b0a+_0xc5c7('0xaa')+_0x8728e4+_0xc5c7('0xab')+_0x120298+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xc5c7('0x91')+_0x36aa7e,'If-None-Match':null,'OData-Version':_0xc5c7('0x92')},'json':!![]};return rp(_0x87c805)['then'](function(_0x331604){var _0x218139=[];var _0x43129c=_0x331604[_0xc5c7('0xac')]['Options'];_0x43129c[_0xc5c7('0x97')](function(_0x544e4d){_0x218139[_0xc5c7('0x9a')]({'name':_0x544e4d[_0xc5c7('0xad')][_0xc5c7('0xae')]['Label'],'value':String(_0x544e4d[_0xc5c7('0xaf')])});});var _0x35b498={'id':_0x24edff+'_'+_0x331604[_0xc5c7('0xb0')],'name':_0x331604['DisplayName'][_0xc5c7('0xae')][_0xc5c7('0xad')],'custom':![],'options':_0x218139};_0x27d328[_0xc5c7('0x9a')](_0x35b498);return _0x27d328;});}function getBooleanList(_0x368487,_0x313d3a,_0x3feac7,_0x3dba2b,_0x8870d9,_0x4dc3d1){var _0x2ef419={'method':_0xc5c7('0x8f'),'uri':_0x368487+_0xc5c7('0xaa')+_0x3dba2b+_0xc5c7('0xab')+_0x8870d9+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x4dc3d1,'If-None-Match':null,'OData-Version':_0xc5c7('0x92')},'json':!![]};return rp(_0x2ef419)['then'](function(_0x10f4aa){var _0x11d61e=[];_0x11d61e[_0xc5c7('0x9a')]({'name':_0x10f4aa[_0xc5c7('0xac')][_0xc5c7('0xb1')][_0xc5c7('0xad')]['UserLocalizedLabel']['Label'],'value':_0xc5c7('0xb2')},{'name':_0x10f4aa[_0xc5c7('0xac')][_0xc5c7('0xb3')]['Label'][_0xc5c7('0xae')][_0xc5c7('0xad')],'value':_0xc5c7('0xb4')});var _0x460d60={'id':_0x313d3a+'_'+_0x10f4aa[_0xc5c7('0xb0')],'name':_0x10f4aa[_0xc5c7('0xb5')][_0xc5c7('0xae')][_0xc5c7('0xad')],'custom':![],'options':_0x11d61e};_0x3feac7['push'](_0x460d60);return _0x3feac7;});}function getInputList(_0x33a308,_0x75449d,_0x19b1d0,_0x284757,_0x153f67,_0x585a05,_0x5bb444){var _0x2f6c31={'method':'GET','uri':_0x33a308+_0xc5c7('0xaa')+_0x153f67+_0xc5c7('0xab')+_0x585a05+_0xc5c7('0xb6')+_0x19b1d0+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xc5c7('0x91')+_0x5bb444,'If-None-Match':null,'OData-Version':_0xc5c7('0x92')},'json':!![]};return rp(_0x2f6c31)['then'](function(_0x297c5e){var _0x3304be={'id':_0x75449d+'_'+_0x297c5e[_0xc5c7('0xb0')],'name':_0x297c5e[_0xc5c7('0xb5')][_0xc5c7('0xae')]?_0x297c5e[_0xc5c7('0xb5')]['UserLocalizedLabel'][_0xc5c7('0xad')]:_0x297c5e[_0xc5c7('0xb0')],'custom':![],'options':[]};_0x284757['push'](_0x3304be);return _0x284757;});} \ No newline at end of file +var _0x864e=['body','getConfigurations','Dynamics365Configuration','length','addConfiguration','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','resolvebykpiidname','responseby','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','CloudProvider','data5','data7','modernAuthentication','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','EntityDefinitions(','Bearer\x20','remove','includes','LogicalName','@odata.type','push','MetadataId','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','lodash','../../components/parsers/qs','api','../../mysqldb','status','json','offset','undefined','limit','count','update','then','destroy','end','error','stack','name','index','map','Dynamics365Account','fieldName','type','keys','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','rawAttributes','includeAll','find','catch','create'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x864e,0x13b));var _0xe864=function(_0x2af981,_0x116a02){_0x2af981=_0x2af981-0x0;var _0x13d5f3=_0x864e[_0x2af981];return _0x13d5f3;};'use strict';var rp=require(_0xe864('0x0'));var util=require('util');var _=require(_0xe864('0x1'));var qs=require(_0xe864('0x2'));var logger=require('../../config/logger')(_0xe864('0x3'));var db=require(_0xe864('0x4'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x26cb42,_0x16483e){_0x16483e=_0x16483e||0xc8;return function(_0x3b9b1d){if(_0x3b9b1d){return _0x26cb42[_0xe864('0x5')](_0x16483e)[_0xe864('0x6')](_0x3b9b1d);}};}function respondWithFilteredResult(_0x4114a8,_0x192b78){return function(_0x566236){if(_0x566236){var _0x141284=typeof _0x192b78[_0xe864('0x7')]===_0xe864('0x8')&&typeof _0x192b78[_0xe864('0x9')]===_0xe864('0x8');var _0x460d2e=_0x566236[_0xe864('0xa')];var _0x3a6b2e=_0x141284?0x0:_0x192b78['offset'];var _0xd8ed48=_0x141284?_0x566236['count']:_0x192b78['offset']+_0x192b78['limit'];var _0x1facfb;if(_0xd8ed48>=_0x460d2e){_0xd8ed48=_0x460d2e;_0x1facfb=0xc8;}else{_0x1facfb=0xce;}_0x4114a8[_0xe864('0x5')](_0x1facfb);return _0x4114a8['set']('Content-Range',_0x3a6b2e+'-'+_0xd8ed48+'/'+_0x460d2e)[_0xe864('0x6')](_0x566236);}return null;};}function saveUpdates(_0x4aaaa9){return function(_0x3bc12c){if(_0x3bc12c){return _0x3bc12c[_0xe864('0xb')](_0x4aaaa9)[_0xe864('0xc')](function(_0x299a8e){return _0x299a8e;});}return null;};}function removeEntity(_0x4c6b5c){return function(_0x4ffcb6){if(_0x4ffcb6){return _0x4ffcb6[_0xe864('0xd')]()['then'](function(){_0x4c6b5c[_0xe864('0x5')](0xcc)[_0xe864('0xe')]();});}};}function handleEntityNotFound(_0x56b241){return function(_0x12eb97){if(!_0x12eb97){_0x56b241['sendStatus'](0x194);}return _0x12eb97;};}function handleError(_0x508192,_0x183e4c){_0x183e4c=_0x183e4c||0x1f4;return function(_0x580342){logger[_0xe864('0xf')](_0x580342[_0xe864('0x10')]);if(_0x580342[_0xe864('0x11')]){delete _0x580342['name'];}_0x508192[_0xe864('0x5')](_0x183e4c)['send'](_0x580342);};}exports[_0xe864('0x12')]=function(_0x51ce1b,_0x593fde){var _0x4c4cb3={},_0x59b6d2={},_0x17b67a={'count':0x0,'rows':[]};var _0xcf122e=_[_0xe864('0x13')](db[_0xe864('0x14')]['rawAttributes'],function(_0x47474d){return{'name':_0x47474d[_0xe864('0x15')],'type':_0x47474d[_0xe864('0x16')]['key']};});_0x59b6d2['model']=_[_0xe864('0x13')](_0xcf122e,_0xe864('0x11'));_0x59b6d2['query']=_[_0xe864('0x17')](_0x51ce1b['query']);_0x59b6d2['filters']=_[_0xe864('0x18')](_0x59b6d2[_0xe864('0x19')],_0x59b6d2[_0xe864('0x1a')]);_0x4c4cb3[_0xe864('0x1b')]=_[_0xe864('0x18')](_0x59b6d2[_0xe864('0x19')],qs[_0xe864('0x1c')](_0x51ce1b[_0xe864('0x1a')][_0xe864('0x1c')]));_0x4c4cb3[_0xe864('0x1b')]=_0x4c4cb3[_0xe864('0x1b')]['length']?_0x4c4cb3['attributes']:_0x59b6d2[_0xe864('0x19')];if(!_0x51ce1b['query'][_0xe864('0x1d')](_0xe864('0x1e'))){_0x4c4cb3[_0xe864('0x9')]=qs[_0xe864('0x9')](_0x51ce1b[_0xe864('0x1a')][_0xe864('0x9')]);_0x4c4cb3[_0xe864('0x7')]=qs[_0xe864('0x7')](_0x51ce1b['query'][_0xe864('0x7')]);}_0x4c4cb3[_0xe864('0x1f')]=qs[_0xe864('0x20')](_0x51ce1b[_0xe864('0x1a')][_0xe864('0x20')]);_0x4c4cb3[_0xe864('0x21')]=qs[_0xe864('0x22')](_[_0xe864('0x23')](_0x51ce1b['query'],_0x59b6d2[_0xe864('0x22')]),_0xcf122e);if(_0x51ce1b['query'][_0xe864('0x24')]){_0x4c4cb3[_0xe864('0x21')]=_['merge'](_0x4c4cb3[_0xe864('0x21')],{'$or':_[_0xe864('0x13')](_0xcf122e,function(_0x258bf0){if(_0x258bf0[_0xe864('0x16')]!==_0xe864('0x25')){var _0x39ab4b={};_0x39ab4b[_0x258bf0[_0xe864('0x11')]]={'$like':'%'+_0x51ce1b[_0xe864('0x1a')][_0xe864('0x24')]+'%'};return _0x39ab4b;}})});}_0x4c4cb3=_[_0xe864('0x26')]({},_0x4c4cb3,_0x51ce1b[_0xe864('0x27')]);var _0x15fa8e={'where':_0x4c4cb3['where']};return db['Dynamics365Account'][_0xe864('0xa')](_0x15fa8e)[_0xe864('0xc')](function(_0x2fcb1d){_0x17b67a[_0xe864('0xa')]=_0x2fcb1d;if(_0x51ce1b[_0xe864('0x1a')]['includeAll']){_0x4c4cb3[_0xe864('0x28')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xe864('0x29')](_0x4c4cb3);})[_0xe864('0xc')](function(_0x5529d8){_0x17b67a['rows']=_0x5529d8;return _0x17b67a;})[_0xe864('0xc')](respondWithFilteredResult(_0x593fde,_0x4c4cb3))['catch'](handleError(_0x593fde,null));};exports[_0xe864('0x2a')]=function(_0x3179fa,_0x4ce0ef){var _0x2a4e8a={'raw':![],'where':{'id':_0x3179fa[_0xe864('0x2b')]['id']}},_0x5c75ad={};_0x5c75ad[_0xe864('0x19')]=_[_0xe864('0x17')](db[_0xe864('0x14')][_0xe864('0x2c')]);_0x5c75ad[_0xe864('0x1a')]=_[_0xe864('0x17')](_0x3179fa[_0xe864('0x1a')]);_0x5c75ad[_0xe864('0x22')]=_['intersection'](_0x5c75ad[_0xe864('0x19')],_0x5c75ad[_0xe864('0x1a')]);_0x2a4e8a[_0xe864('0x1b')]=_[_0xe864('0x18')](_0x5c75ad['model'],qs[_0xe864('0x1c')](_0x3179fa[_0xe864('0x1a')][_0xe864('0x1c')]));_0x2a4e8a[_0xe864('0x1b')]=_0x2a4e8a[_0xe864('0x1b')]['length']?_0x2a4e8a[_0xe864('0x1b')]:_0x5c75ad[_0xe864('0x19')];if(_0x3179fa[_0xe864('0x1a')][_0xe864('0x2d')]){_0x2a4e8a['include']=[{'all':!![]}];}_0x2a4e8a=_['merge']({},_0x2a4e8a,_0x3179fa['options']);return db[_0xe864('0x14')][_0xe864('0x2e')](_0x2a4e8a)[_0xe864('0xc')](handleEntityNotFound(_0x4ce0ef,null))['then'](respondWithResult(_0x4ce0ef,null))[_0xe864('0x2f')](handleError(_0x4ce0ef,null));};exports[_0xe864('0x30')]=function(_0x407648,_0x32eb0c){return db['Dynamics365Account'][_0xe864('0x30')](_0x407648['body'],{})[_0xe864('0xc')](respondWithResult(_0x32eb0c,0xc9))[_0xe864('0x2f')](handleError(_0x32eb0c,null));};exports['update']=function(_0x2d4654,_0x5a758c){if(_0x2d4654[_0xe864('0x31')]['id']){delete _0x2d4654[_0xe864('0x31')]['id'];}return db[_0xe864('0x14')][_0xe864('0x2e')]({'where':{'id':_0x2d4654[_0xe864('0x2b')]['id']}})[_0xe864('0xc')](handleEntityNotFound(_0x5a758c,null))[_0xe864('0xc')](saveUpdates(_0x2d4654[_0xe864('0x31')],null))[_0xe864('0xc')](respondWithResult(_0x5a758c,null))[_0xe864('0x2f')](handleError(_0x5a758c,null));};exports[_0xe864('0xd')]=function(_0x3c5de7,_0x1d498b){return db[_0xe864('0x14')][_0xe864('0x2e')]({'where':{'id':_0x3c5de7[_0xe864('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1d498b,null))[_0xe864('0xc')](removeEntity(_0x1d498b,null))[_0xe864('0x2f')](handleError(_0x1d498b,null));};exports[_0xe864('0x32')]=function(_0x35e7fb,_0x3d52d8){var _0x47b1cf={};var _0x4b65aa={};var _0x1923e7;var _0x5edad5;return db[_0xe864('0x14')]['findOne']({'where':{'id':_0x35e7fb['params']['id']}})[_0xe864('0xc')](handleEntityNotFound(_0x3d52d8,null))[_0xe864('0xc')](function(_0x377dc2){if(_0x377dc2){_0x1923e7=_0x377dc2;_0x4b65aa[_0xe864('0x19')]=_[_0xe864('0x17')](db[_0xe864('0x33')][_0xe864('0x2c')]);_0x4b65aa['query']=_[_0xe864('0x17')](_0x35e7fb[_0xe864('0x1a')]);_0x4b65aa[_0xe864('0x22')]=_[_0xe864('0x18')](_0x4b65aa[_0xe864('0x19')],_0x4b65aa[_0xe864('0x1a')]);_0x47b1cf[_0xe864('0x1b')]=_[_0xe864('0x18')](_0x4b65aa[_0xe864('0x19')],qs[_0xe864('0x1c')](_0x35e7fb[_0xe864('0x1a')]['fields']));_0x47b1cf[_0xe864('0x1b')]=_0x47b1cf['attributes'][_0xe864('0x34')]?_0x47b1cf[_0xe864('0x1b')]:_0x4b65aa[_0xe864('0x19')];_0x47b1cf[_0xe864('0x1f')]=qs[_0xe864('0x20')](_0x35e7fb[_0xe864('0x1a')][_0xe864('0x20')]);_0x47b1cf['where']=qs[_0xe864('0x22')](_[_0xe864('0x23')](_0x35e7fb[_0xe864('0x1a')],_0x4b65aa[_0xe864('0x22')]));if(_0x35e7fb['query']['filter']){_0x47b1cf[_0xe864('0x21')]=_['merge'](_0x47b1cf[_0xe864('0x21')],{'$or':_[_0xe864('0x13')](_0x47b1cf[_0xe864('0x1b')],function(_0x42082c){var _0x4df318={};_0x4df318[_0x42082c]={'$like':'%'+_0x35e7fb[_0xe864('0x1a')][_0xe864('0x24')]+'%'};return _0x4df318;})});}_0x47b1cf=_[_0xe864('0x26')]({},_0x47b1cf,_0x35e7fb[_0xe864('0x27')]);return _0x1923e7[_0xe864('0x32')](_0x47b1cf);}})[_0xe864('0xc')](function(_0x333b3){if(_0x333b3){_0x5edad5=_0x333b3[_0xe864('0x34')];if(!_0x35e7fb[_0xe864('0x1a')][_0xe864('0x1d')](_0xe864('0x1e'))){_0x47b1cf[_0xe864('0x9')]=qs['limit'](_0x35e7fb['query'][_0xe864('0x9')]);_0x47b1cf[_0xe864('0x7')]=qs[_0xe864('0x7')](_0x35e7fb['query'][_0xe864('0x7')]);}return _0x1923e7[_0xe864('0x32')](_0x47b1cf);}})[_0xe864('0xc')](function(_0x44141b){if(_0x44141b){return _0x44141b?{'count':_0x5edad5,'rows':_0x44141b}:null;}})[_0xe864('0xc')](respondWithResult(_0x3d52d8,null))[_0xe864('0x2f')](handleError(_0x3d52d8,null));};exports[_0xe864('0x35')]=function(_0x59433c,_0x271726){if(_0x59433c[_0xe864('0x31')]['id']){delete _0x59433c['body']['id'];}return db['Dynamics365Account']['findOne']({'where':{'id':_0x59433c[_0xe864('0x2b')]['id']}})[_0xe864('0xc')](handleEntityNotFound(_0x271726,null))['then'](function(_0x536368){if(_0x536368){_0x59433c[_0xe864('0x31')][_0xe864('0x36')]=_0x536368['id'];_0x59433c['body'][_0xe864('0x37')]=integrations['getSubjects'](_0x59433c[_0xe864('0x31')][_0xe864('0x38')],_0x59433c['body']['type']);_0x59433c['body']['Descriptions']=integrations[_0xe864('0x39')](_0x59433c[_0xe864('0x31')][_0xe864('0x38')],_0x59433c[_0xe864('0x31')][_0xe864('0x16')]);return db[_0xe864('0x33')]['create'](_0x59433c[_0xe864('0x31')],{'include':[{'model':db[_0xe864('0x3a')],'as':_0xe864('0x37')},{'model':db[_0xe864('0x3a')],'as':_0xe864('0x3b')}]});}return null;})[_0xe864('0xc')](respondWithResult(_0x271726,null))[_0xe864('0x2f')](handleError(_0x271726,null));};function sanitizeRemoteUri(_0x210603){var _0x42ae3a=_0x210603[_0xe864('0x3c')](-0x1);if(_0x42ae3a==='/')return _0x210603[_0xe864('0x3d')](0x0,_0x210603[_0xe864('0x3e')](_0x42ae3a));return _0x210603;}function getWebApiUrl(_0x4d1a6d){return util[_0xe864('0x3f')](_0xe864('0x40'),_0x4d1a6d);}exports[_0xe864('0x41')]=function(_0x21f9d4,_0x51b5b1){var _0x55a37c=_0x21f9d4[_0xe864('0x1a')]['ticketType'];var _0x28fef7=_0x55a37c===_0xe864('0x42')?_0xe864('0x43'):_0xe864('0x44');var _0x534d67='';var _0x11a287='';var _0x4fbd8b='';var _0x133387='';var _0x590af4='';var _0x2817b6='';var _0x538c7e='';var _0x1e602e='';var _0x5496af=[_0xe864('0x45'),'description',_0xe864('0x46'),_0xe864('0x47'),_0xe864('0x48'),_0xe864('0x49'),'phonenumber',_0xe864('0x4a'),_0xe864('0x4b'),_0xe864('0x4c')];var _0x3612bb=['accountidname','accountidyominame',_0xe864('0x4d'),_0xe864('0x4e'),_0xe864('0x4f'),_0xe864('0x50'),_0xe864('0x51'),_0xe864('0x52'),_0xe864('0x53'),_0xe864('0x54'),_0xe864('0x55'),_0xe864('0x56'),_0xe864('0x57'),_0xe864('0x58'),'createdonbehalfbyyominame',_0xe864('0x59'),'customeridtype','customeridyominame',_0xe864('0x5a'),_0xe864('0x5b'),_0xe864('0x5c'),_0xe864('0x5d'),_0xe864('0x5e'),_0xe864('0x5f'),'firstresponsebykpiidname',_0xe864('0x60'),_0xe864('0x61'),_0xe864('0x62'),_0xe864('0x63'),_0xe864('0x64'),_0xe864('0x65'),_0xe864('0x66'),_0xe864('0x67'),'modifiedbyname',_0xe864('0x68'),'modifiedon','modifiedonbehalfbyname',_0xe864('0x69'),_0xe864('0x6a'),_0xe864('0x6b'),_0xe864('0x6c'),'onholdtime',_0xe864('0x6d'),_0xe864('0x6e'),_0xe864('0x6f'),_0xe864('0x70'),_0xe864('0x71'),_0xe864('0x72'),'primarycontactidyominame','prioritycodename',_0xe864('0x73'),'productserialnumber','resolveby',_0xe864('0x74'),_0xe864('0x75'),'responsiblecontactidname',_0xe864('0x76'),'sentimentvalue','slainvokedidname',_0xe864('0x77'),_0xe864('0x78'),_0xe864('0x79'),_0xe864('0x7a'),_0xe864('0x7b'),_0xe864('0x7c'),_0xe864('0x7d'),'transactioncurrencyidname',_0xe864('0x7e'),_0xe864('0x7f'),_0xe864('0x80')];var _0x56ca9c=_0x5496af[_0xe864('0x81')](_0x3612bb);return db['Dynamics365Account']['findOne']({'where':{'id':_0x21f9d4[_0xe864('0x2b')]['id']},'attributes':['id',_0xe864('0x82'),_0xe864('0x83'),_0xe864('0x84'),'tenantId','clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0xe864('0x85')],'as':_0xe864('0x85'),'attributes':['id',_0xe864('0x86'),_0xe864('0x87')]}]})[_0xe864('0xc')](handleEntityNotFound(_0x51b5b1,null))[_0xe864('0xc')](function(_0x4fb652){if(_0x4fb652){if(_0x4fb652[_0xe864('0x88')]){_0x4fb652['access_token']=_0x4fb652['CloudProvider'][_0xe864('0x86')];_0x1e602e=sanitizeRemoteUri(_0x4fb652[_0xe864('0x85')][_0xe864('0x87')]);_0x538c7e=getWebApiUrl(_0x1e602e);return _0x4fb652;}_0x1e602e=sanitizeRemoteUri(_0x4fb652[_0xe864('0x84')]);_0x538c7e=getWebApiUrl(_0x1e602e);var _0x492716={'method':_0xe864('0x89'),'uri':_0xe864('0x8a')+_0x4fb652[_0xe864('0x8b')]+_0xe864('0x8c'),'form':{'client_id':_0x4fb652[_0xe864('0x8d')],'resource':_0x1e602e,'username':_0x4fb652['username'],'password':_0x4fb652['password'],'grant_type':_0xe864('0x83'),'client_secret':_0x4fb652['clientSecret']},'json':!![]};return rp(_0x492716);}})[_0xe864('0xc')](function(_0x320fe){_0x2817b6=_0x320fe['access_token'];var _0x4e727f={'method':_0xe864('0x8e'),'uri':encodeURI(_0x538c7e+_0xe864('0x8f')+_0x28fef7+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x2817b6,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x4e727f);})[_0xe864('0xc')](function(_0x29e282){var _0x3dcc16=_0x29e282['value'][0x0];var _0x5ba0a4=_0x3dcc16['MetadataId'];var _0x47ccf2={'method':_0xe864('0x8e'),'uri':_0x538c7e+_0xe864('0x91')+_0x5ba0a4+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xe864('0x92')+_0x2817b6,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x47ccf2);})['then'](function(_0x1c8820){_0x534d67=_0x1c8820;_0x11a287=_0x534d67['Attributes'];_0x11a287=_[_0xe864('0x93')](_0x11a287,function(_0x59278c){return!_0x56ca9c[_0xe864('0x94')](_0x59278c[_0xe864('0x95')]);});var _0x5c1d70=[];var _0xa078b3=[];_0x11a287['forEach'](function(_0x38cfd3){if(_0x38cfd3[_0xe864('0x96')]){var _0x50a388=_0x38cfd3[_0xe864('0x96')][_0xe864('0x3d')](_0x38cfd3[_0xe864('0x96')][_0xe864('0x3e')]('.')+0x1);if(_0x50a388==='PicklistAttributeMetadata'){_0x5c1d70[_0xe864('0x97')](getSelectList(_0x538c7e,_0x55a37c,_0xa078b3,_0x534d67['MetadataId'],_0x38cfd3[_0xe864('0x98')],_0x2817b6));}}});return Promise[_0xe864('0x99')](_0x5c1d70);})[_0xe864('0xc')](function(_0x2b3e47){_0x4fbd8b=_0x2b3e47[0x0];var _0x27143a=[];var _0x503fea=[];_0x11a287[_0xe864('0x9a')](function(_0x548af2){if(!_[_0xe864('0x9b')](_0x548af2[_0xe864('0x96')])){var _0x35ddef=_0x548af2[_0xe864('0x96')][_0xe864('0x3d')](_0x548af2['@odata.type'][_0xe864('0x3e')]('.')+0x1);if(_0x35ddef===_0xe864('0x9c')){_0x27143a[_0xe864('0x97')](getBooleanList(_0x538c7e,_0x55a37c,_0x503fea,_0x534d67[_0xe864('0x98')],_0x548af2[_0xe864('0x98')],_0x2817b6));}}});return Promise['all'](_0x27143a);})[_0xe864('0xc')](function(_0x439f62){_0x133387=_0x439f62[0x0];var _0x1cbe4b=[];var _0x2d6328=[];_0x11a287[_0xe864('0x9a')](function(_0x80e65d){if(_0x80e65d[_0xe864('0x96')]){var _0x3e0b60=_0x80e65d[_0xe864('0x96')][_0xe864('0x3d')](_0x80e65d[_0xe864('0x96')][_0xe864('0x3e')]('.')+0x1);if(_0x3e0b60===_0xe864('0x9d')||_0x3e0b60===_0xe864('0x9e')||_0x3e0b60==='BigIntAttributeMetadata'||_0x3e0b60===_0xe864('0x9f')||_0x3e0b60===_0xe864('0xa0')||_0x3e0b60==='DateTimeAttributeMetadata'||_0x3e0b60===_0xe864('0xa1')||_0x3e0b60===_0xe864('0xa2')||_0x3e0b60===_0xe864('0xa3')||_0x3e0b60==='DecimalAttributeMetadata'){_0x1cbe4b[_0xe864('0x97')](getInputList(_0x538c7e,_0x55a37c,_0x3e0b60,_0x2d6328,_0x534d67[_0xe864('0x98')],_0x80e65d[_0xe864('0x98')],_0x2817b6));}}});return Promise[_0xe864('0x99')](_0x1cbe4b);})[_0xe864('0xc')](function(_0x4eafe5){_0x590af4=_0x4eafe5[0x0];var _0x3bf62b=_0x4fbd8b[_0xe864('0x81')](_0x133387)[_0xe864('0x81')](_0x590af4);var _0x218c59={'count':_0x3bf62b[_0xe864('0x34')],'rows':_0x3bf62b};return _0x218c59;})[_0xe864('0xc')](respondWithResult(_0x51b5b1,null))['catch'](function(_0x33c9e0){var _0x533b2b=_0x21f9d4[_0xe864('0x1a')][_0xe864('0xa4')]?0x1f4:_0x33c9e0[_0xe864('0xa5')]||0x1f4;logger['error'](_0x33c9e0[_0xe864('0x10')]);delete _0x33c9e0['name'];if(_0x533b2b===0x191){_0x533b2b=0x190;}_0x51b5b1['status'](_0x533b2b)['send'](_0x21f9d4[_0xe864('0x1a')][_0xe864('0xa4')]?{'message':_0xe864('0xa6'),'statusCode':_0x33c9e0[_0xe864('0xa5')]}:_0x33c9e0);});};function getSelectList(_0x20c2ca,_0x2d6511,_0x2116a0,_0x589e52,_0x3df1cb,_0x4c93a4){var _0x5bc0c3={'method':'GET','uri':_0x20c2ca+_0xe864('0x91')+_0x589e52+_0xe864('0xa7')+_0x3df1cb+_0xe864('0xa8')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xe864('0x92')+_0x4c93a4,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x5bc0c3)[_0xe864('0xc')](function(_0x40ab44){var _0x8f0d05=[];var _0x5e1ecf=_0x40ab44['OptionSet'][_0xe864('0xa9')];_0x5e1ecf[_0xe864('0x9a')](function(_0x4f4005){_0x8f0d05['push']({'name':_0x4f4005[_0xe864('0xaa')][_0xe864('0xab')][_0xe864('0xaa')],'value':String(_0x4f4005[_0xe864('0xac')])});});var _0x342b1e={'id':_0x2d6511+'_'+_0x40ab44[_0xe864('0x95')],'name':_0x40ab44[_0xe864('0xad')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x8f0d05};_0x2116a0[_0xe864('0x97')](_0x342b1e);return _0x2116a0;});}function getBooleanList(_0x460d93,_0x333464,_0x5175e9,_0x122f33,_0x16b940,_0x28a858){var _0x352161={'method':'GET','uri':_0x460d93+'EntityDefinitions('+_0x122f33+')/Attributes('+_0x16b940+_0xe864('0xae'),'headers':{'Authorization':_0xe864('0x92')+_0x28a858,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0x352161)[_0xe864('0xc')](function(_0x2aefa6){var _0x22a94d=[];_0x22a94d[_0xe864('0x97')]({'name':_0x2aefa6['OptionSet'][_0xe864('0xaf')][_0xe864('0xaa')][_0xe864('0xab')][_0xe864('0xaa')],'value':_0xe864('0xb0')},{'name':_0x2aefa6[_0xe864('0xb1')][_0xe864('0xb2')][_0xe864('0xaa')][_0xe864('0xab')]['Label'],'value':_0xe864('0xb3')});var _0x3dd599={'id':_0x333464+'_'+_0x2aefa6[_0xe864('0x95')],'name':_0x2aefa6[_0xe864('0xad')][_0xe864('0xab')]['Label'],'custom':![],'options':_0x22a94d};_0x5175e9['push'](_0x3dd599);return _0x5175e9;});}function getInputList(_0x5192f1,_0x13deba,_0x674686,_0x2502dc,_0x157a60,_0x435ec7,_0x3f7da2){var _0xa674bf={'method':_0xe864('0x8e'),'uri':_0x5192f1+_0xe864('0x91')+_0x157a60+')/Attributes('+_0x435ec7+_0xe864('0xb4')+_0x674686+_0xe864('0xb5'),'headers':{'Authorization':_0xe864('0x92')+_0x3f7da2,'If-None-Match':null,'OData-Version':_0xe864('0x90')},'json':!![]};return rp(_0xa674bf)[_0xe864('0xc')](function(_0x55a92c){var _0x2dcc82={'id':_0x13deba+'_'+_0x55a92c[_0xe864('0x95')],'name':_0x55a92c[_0xe864('0xad')][_0xe864('0xab')]?_0x55a92c['DisplayName'][_0xe864('0xab')][_0xe864('0xaa')]:_0x55a92c[_0xe864('0x95')],'custom':![],'options':[]};_0x2502dc[_0xe864('0x97')](_0x2dcc82);return _0x2502dc;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index d753f37..c6a209a 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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x520052,_0x1ecb05){var _0x414031=function(_0x529d1e){while(--_0x529d1e){_0x520052['push'](_0x520052['shift']());}};_0x414031(++_0x1ecb05);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c6089,_0x3816e2){_0x1c6089=_0x1c6089-0x0;var _0x4d97c1=_0xcb91[_0x1c6089];return _0x4d97c1;};'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'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index c66387b..180a6e9 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 _0x8f3a=['model','map','catch','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x8f3a,0xb9));var _0xa8f3=function(_0xece223,_0x1b18d2){_0xece223=_0xece223-0x0;var _0x1b25a9=_0x8f3a[_0xece223];return _0x1b25a9;};'use strict';var _=require(_0xa8f3('0x0'));var util=require(_0xa8f3('0x1'));var moment=require(_0xa8f3('0x2'));var BPromise=require(_0xa8f3('0x3'));var rs=require(_0xa8f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa8f3('0x5'));var logger=require(_0xa8f3('0x6'))('rpc');var config=require(_0xa8f3('0x7'));var jayson=require(_0xa8f3('0x8'));var client=jayson[_0xa8f3('0x9')][_0xa8f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x408a52,_0x124006,_0xe8cc98){return new BPromise(function(_0x2f9a3b,_0x6a144f){return client[_0xa8f3('0xb')](_0x408a52,_0xe8cc98)[_0xa8f3('0xc')](function(_0x4792d6){logger[_0xa8f3('0xd')](_0xa8f3('0xe'),_0x124006,_0xa8f3('0xf'));logger[_0xa8f3('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x124006,_0xa8f3('0xf'),JSON[_0xa8f3('0x11')](_0x4792d6));if(_0x4792d6[_0xa8f3('0x12')]){if(_0x4792d6[_0xa8f3('0x12')][_0xa8f3('0x13')]===0x1f4){logger[_0xa8f3('0x12')](_0xa8f3('0xe'),_0x124006,_0x4792d6[_0xa8f3('0x12')][_0xa8f3('0x14')]);return _0x6a144f(_0x4792d6[_0xa8f3('0x12')][_0xa8f3('0x14')]);}logger['error'](_0xa8f3('0xe'),_0x124006,_0x4792d6[_0xa8f3('0x12')][_0xa8f3('0x14')]);return _0x2f9a3b(_0x4792d6[_0xa8f3('0x12')][_0xa8f3('0x14')]);}else{logger[_0xa8f3('0xd')](_0xa8f3('0xe'),_0x124006,_0xa8f3('0xf'));_0x2f9a3b(_0x4792d6[_0xa8f3('0x15')][_0xa8f3('0x14')]);}})['catch'](function(_0x18d896){logger['error'](_0xa8f3('0xe'),_0x124006,_0x18d896);_0x6a144f(_0x18d896);});});}exports[_0xa8f3('0x16')]=function(_0x3b7069){var _0x3b5c39=this;return new Promise(function(_0x2c37a6,_0x21631d){return db[_0xa8f3('0x17')][_0xa8f3('0x18')]({'raw':_0x3b7069[_0xa8f3('0x19')]?_0x3b7069[_0xa8f3('0x19')][_0xa8f3('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b7069[_0xa8f3('0x19')]?_0x3b7069[_0xa8f3('0x19')][_0xa8f3('0x1b')]||null:null,'attributes':_0x3b7069[_0xa8f3('0x19')]?_0x3b7069[_0xa8f3('0x19')][_0xa8f3('0x1c')]||null:null,'limit':_0x3b7069[_0xa8f3('0x19')]?_0x3b7069[_0xa8f3('0x19')][_0xa8f3('0x1d')]||null:null,'include':_0x3b7069[_0xa8f3('0x19')]?_0x3b7069[_0xa8f3('0x19')][_0xa8f3('0x1e')]?_['map'](_0x3b7069[_0xa8f3('0x19')]['include'],function(_0x370f5c){return{'model':db[_0x370f5c[_0xa8f3('0x1f')]],'as':_0x370f5c['as'],'attributes':_0x370f5c[_0xa8f3('0x1c')],'include':_0x370f5c['include']?_[_0xa8f3('0x20')](_0x370f5c[_0xa8f3('0x1e')],function(_0x402b34){return{'model':db[_0x402b34['model']],'as':_0x402b34['as'],'attributes':_0x402b34[_0xa8f3('0x1c')],'include':_0x402b34['include']?_[_0xa8f3('0x20')](_0x402b34[_0xa8f3('0x1e')],function(_0x432dbe){return{'model':db[_0x432dbe[_0xa8f3('0x1f')]],'as':_0x432dbe['as'],'attributes':_0x432dbe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x306850){logger[_0xa8f3('0xd')](_0xa8f3('0x16'),_0x3b7069);logger[_0xa8f3('0x10')]('GetDynamics365Account',_0x3b7069,JSON[_0xa8f3('0x11')](_0x306850));_0x2c37a6(_0x306850);})[_0xa8f3('0x21')](function(_0x5dac09){logger[_0xa8f3('0x12')](_0xa8f3('0x16'),_0x5dac09[_0xa8f3('0x14')],_0x3b7069);_0x21631d(_0x3b5c39[_0xa8f3('0x12')](0x1f4,_0x5dac09[_0xa8f3('0x14')]));});});};exports[_0xa8f3('0x22')]=function(_0x373aa6){var _0x3090d4=this;return new Promise(function(_0x1cc887,_0x44cd75){return db[_0xa8f3('0x17')][_0xa8f3('0x23')]({'raw':_0x373aa6[_0xa8f3('0x19')]?_0x373aa6[_0xa8f3('0x19')][_0xa8f3('0x1a')]===undefined?!![]:![]:!![],'where':_0x373aa6[_0xa8f3('0x19')]?_0x373aa6[_0xa8f3('0x19')][_0xa8f3('0x1b')]||null:null,'attributes':_0x373aa6['options']?_0x373aa6['options'][_0xa8f3('0x1c')]||null:null,'include':_0x373aa6[_0xa8f3('0x19')]?_0x373aa6['options'][_0xa8f3('0x1e')]?_['map'](_0x373aa6[_0xa8f3('0x19')][_0xa8f3('0x1e')],function(_0x5de36e){return{'model':db[_0x5de36e[_0xa8f3('0x1f')]],'as':_0x5de36e['as'],'attributes':_0x5de36e[_0xa8f3('0x1c')],'include':_0x5de36e[_0xa8f3('0x1e')]?_[_0xa8f3('0x20')](_0x5de36e[_0xa8f3('0x1e')],function(_0x4eebdc){return{'model':db[_0x4eebdc[_0xa8f3('0x1f')]],'as':_0x4eebdc['as'],'attributes':_0x4eebdc[_0xa8f3('0x1c')],'include':_0x4eebdc[_0xa8f3('0x1e')]?_[_0xa8f3('0x20')](_0x4eebdc[_0xa8f3('0x1e')],function(_0x5c9a1b){return{'model':db[_0x5c9a1b[_0xa8f3('0x1f')]],'as':_0x5c9a1b['as'],'attributes':_0x5c9a1b[_0xa8f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa8f3('0xc')](function(_0x2d1f33){logger[_0xa8f3('0xd')](_0xa8f3('0x22'),_0x373aa6);logger['debug'](_0xa8f3('0x22'),_0x373aa6,JSON[_0xa8f3('0x11')](_0x2d1f33));_0x1cc887(_0x2d1f33);})[_0xa8f3('0x21')](function(_0x33fc3a){logger['error'](_0xa8f3('0x22'),_0x33fc3a[_0xa8f3('0x14')],_0x373aa6);_0x44cd75(_0x3090d4['error'](0x1f4,_0x33fc3a[_0xa8f3('0x14')]));});});}; \ No newline at end of file +var _0xbd4b=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','Dynamics365Account','findAll','options','raw','where','attributes','include','model','map','GetDynamics365Account','then','ShowDynamics365Account','stringify','lodash','util','moment','bluebird'];(function(_0x58ddca,_0x93f4e){var _0x9ca931=function(_0x148e0d){while(--_0x148e0d){_0x58ddca['push'](_0x58ddca['shift']());}};_0x9ca931(++_0x93f4e);}(_0xbd4b,0xff));var _0xbbd4=function(_0x3818f9,_0x22664f){_0x3818f9=_0x3818f9-0x0;var _0x4d40cb=_0xbd4b[_0x3818f9];return _0x4d40cb;};'use strict';var _=require(_0xbbd4('0x0'));var util=require(_0xbbd4('0x1'));var moment=require(_0xbbd4('0x2'));var BPromise=require(_0xbbd4('0x3'));var rs=require(_0xbbd4('0x4'));var fs=require('fs');var Redis=require(_0xbbd4('0x5'));var db=require(_0xbbd4('0x6'))['db'];var utils=require(_0xbbd4('0x7'));var logger=require('../../config/logger')(_0xbbd4('0x8'));var config=require(_0xbbd4('0x9'));var jayson=require(_0xbbd4('0xa'));var client=jayson[_0xbbd4('0xb')][_0xbbd4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c4346,_0x5c5bd8,_0x4f9600){return new BPromise(function(_0xad26d3,_0x45d58e){return client[_0xbbd4('0xd')](_0x2c4346,_0x4f9600)['then'](function(_0x153796){logger['info'](_0xbbd4('0xe'),_0x5c5bd8,_0xbbd4('0xf'));logger[_0xbbd4('0x10')](_0xbbd4('0x11'),_0x5c5bd8,_0xbbd4('0xf'),JSON['stringify'](_0x153796));if(_0x153796['error']){if(_0x153796['error'][_0xbbd4('0x12')]===0x1f4){logger[_0xbbd4('0x13')](_0xbbd4('0xe'),_0x5c5bd8,_0x153796[_0xbbd4('0x13')]['message']);return _0x45d58e(_0x153796[_0xbbd4('0x13')]['message']);}logger[_0xbbd4('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x5c5bd8,_0x153796[_0xbbd4('0x13')][_0xbbd4('0x14')]);return _0xad26d3(_0x153796['error'][_0xbbd4('0x14')]);}else{logger[_0xbbd4('0x15')](_0xbbd4('0xe'),_0x5c5bd8,_0xbbd4('0xf'));_0xad26d3(_0x153796[_0xbbd4('0x16')][_0xbbd4('0x14')]);}})[_0xbbd4('0x17')](function(_0x72ddda){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5c5bd8,_0x72ddda);_0x45d58e(_0x72ddda);});});}exports['GetDynamics365Account']=function(_0x3ca0be){var _0x12a4dc=this;return new Promise(function(_0x46689c,_0x34978a){return db[_0xbbd4('0x18')][_0xbbd4('0x19')]({'raw':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be[_0xbbd4('0x1a')][_0xbbd4('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be['options'][_0xbbd4('0x1c')]||null:null,'attributes':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be['options'][_0xbbd4('0x1d')]||null:null,'limit':_0x3ca0be[_0xbbd4('0x1a')]?_0x3ca0be[_0xbbd4('0x1a')]['limit']||null:null,'include':_0x3ca0be['options']?_0x3ca0be[_0xbbd4('0x1a')][_0xbbd4('0x1e')]?_['map'](_0x3ca0be[_0xbbd4('0x1a')][_0xbbd4('0x1e')],function(_0x1d8425){return{'model':db[_0x1d8425[_0xbbd4('0x1f')]],'as':_0x1d8425['as'],'attributes':_0x1d8425['attributes'],'include':_0x1d8425[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x1d8425['include'],function(_0x2adf17){return{'model':db[_0x2adf17[_0xbbd4('0x1f')]],'as':_0x2adf17['as'],'attributes':_0x2adf17[_0xbbd4('0x1d')],'include':_0x2adf17[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x2adf17[_0xbbd4('0x1e')],function(_0x3e84b6){return{'model':db[_0x3e84b6[_0xbbd4('0x1f')]],'as':_0x3e84b6['as'],'attributes':_0x3e84b6[_0xbbd4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45d610){logger[_0xbbd4('0x15')](_0xbbd4('0x21'),_0x3ca0be);logger[_0xbbd4('0x10')](_0xbbd4('0x21'),_0x3ca0be,JSON['stringify'](_0x45d610));_0x46689c(_0x45d610);})[_0xbbd4('0x17')](function(_0x36e01d){logger['error']('GetDynamics365Account',_0x36e01d[_0xbbd4('0x14')],_0x3ca0be);_0x34978a(_0x12a4dc[_0xbbd4('0x13')](0x1f4,_0x36e01d['message']));});});};exports['ShowDynamics365Account']=function(_0x1e15ad){var _0x484c80=this;return new Promise(function(_0x3e4e06,_0x40eb22){return db[_0xbbd4('0x18')]['find']({'raw':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1c')]||null:null,'attributes':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1d')]||null:null,'include':_0x1e15ad[_0xbbd4('0x1a')]?_0x1e15ad[_0xbbd4('0x1a')]['include']?_[_0xbbd4('0x20')](_0x1e15ad[_0xbbd4('0x1a')][_0xbbd4('0x1e')],function(_0x4d9ec4){return{'model':db[_0x4d9ec4[_0xbbd4('0x1f')]],'as':_0x4d9ec4['as'],'attributes':_0x4d9ec4[_0xbbd4('0x1d')],'include':_0x4d9ec4[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x4d9ec4['include'],function(_0x2e997d){return{'model':db[_0x2e997d[_0xbbd4('0x1f')]],'as':_0x2e997d['as'],'attributes':_0x2e997d[_0xbbd4('0x1d')],'include':_0x2e997d[_0xbbd4('0x1e')]?_[_0xbbd4('0x20')](_0x2e997d[_0xbbd4('0x1e')],function(_0x27934a){return{'model':db[_0x27934a[_0xbbd4('0x1f')]],'as':_0x27934a['as'],'attributes':_0x27934a[_0xbbd4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x22')](function(_0x55660a){logger['info']('ShowDynamics365Account',_0x1e15ad);logger[_0xbbd4('0x10')](_0xbbd4('0x23'),_0x1e15ad,JSON[_0xbbd4('0x24')](_0x55660a));_0x3e4e06(_0x55660a);})[_0xbbd4('0x17')](function(_0x48b0e5){logger[_0xbbd4('0x13')](_0xbbd4('0x23'),_0x48b0e5[_0xbbd4('0x14')],_0x1e15ad);_0x40eb22(_0x484c80[_0xbbd4('0x13')](0x1f4,_0x48b0e5[_0xbbd4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 89d91e6..3b8d5b0 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 _0x927e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','multer','util','express','Router','fs-extra'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x927e,0x1ab));var _0xe927=function(_0x432044,_0x35d99b){_0x432044=_0x432044-0x0;var _0x108d8d=_0x927e[_0x432044];return _0x108d8d;};'use strict';var multer=require(_0xe927('0x0'));var util=require(_0xe927('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe927('0x2'));var router=express[_0xe927('0x3')]();var fs_extra=require(_0xe927('0x4'));var auth=require(_0xe927('0x5'));var interaction=require(_0xe927('0x6'));var config=require(_0xe927('0x7'));var controller=require(_0xe927('0x8'));router[_0xe927('0x9')]('/',auth[_0xe927('0xa')](),controller[_0xe927('0xb')]);router[_0xe927('0x9')](_0xe927('0xc'),auth[_0xe927('0xa')](),controller[_0xe927('0xd')]);router['get'](_0xe927('0xe'),auth[_0xe927('0xa')](),controller[_0xe927('0xf')]);router[_0xe927('0x9')](_0xe927('0x10'),auth[_0xe927('0xa')](),controller[_0xe927('0x11')]);router[_0xe927('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe927('0x12')]);router[_0xe927('0x13')]('/',auth['isAuthenticated'](),controller[_0xe927('0x14')]);router[_0xe927('0x15')]('/:id',auth[_0xe927('0xa')](),controller[_0xe927('0x16')]);router[_0xe927('0x17')](_0xe927('0xc'),auth[_0xe927('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6d2d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','path','connect-timeout','express','fs-extra'];(function(_0x56dd7e,_0x2df7ed){var _0x238da6=function(_0x156191){while(--_0x156191){_0x56dd7e['push'](_0x56dd7e['shift']());}};_0x238da6(++_0x2df7ed);}(_0x6d2d,0xbc));var _0xd6d2=function(_0xf2d715,_0x46b278){_0xf2d715=_0xf2d715-0x0;var _0x3f84b4=_0x6d2d[_0xf2d715];return _0x3f84b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd6d2('0x0'));var timeout=require(_0xd6d2('0x1'));var express=require(_0xd6d2('0x2'));var router=express['Router']();var fs_extra=require(_0xd6d2('0x3'));var auth=require(_0xd6d2('0x4'));var interaction=require(_0xd6d2('0x5'));var config=require(_0xd6d2('0x6'));var controller=require(_0xd6d2('0x7'));router[_0xd6d2('0x8')]('/',auth[_0xd6d2('0x9')](),controller[_0xd6d2('0xa')]);router['get'](_0xd6d2('0xb'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0xc')]);router['get'](_0xd6d2('0xd'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0xe')]);router[_0xd6d2('0x8')](_0xd6d2('0xf'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x10')]);router[_0xd6d2('0x8')]('/:id/descriptions',auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x11')]);router[_0xd6d2('0x12')]('/',auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x13')]);router[_0xd6d2('0x14')](_0xd6d2('0xb'),auth['isAuthenticated'](),controller[_0xd6d2('0x15')]);router[_0xd6d2('0x16')](_0xd6d2('0xb'),auth[_0xd6d2('0x9')](),controller[_0xd6d2('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index c8a479e..ce6d7b4 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 _0x1c35=['exports','STRING','ENUM','incident','phonecall','contact','nothing','sequelize'];(function(_0x18ae8f,_0x25f684){var _0x43e219=function(_0x1cb733){while(--_0x1cb733){_0x18ae8f['push'](_0x18ae8f['shift']());}};_0x43e219(++_0x25f684);}(_0x1c35,0x187));var _0x51c3=function(_0x4b3cec,_0x3acd12){_0x4b3cec=_0x4b3cec-0x0;var _0x4b3c6d=_0x1c35[_0x4b3cec];return _0x4b3c6d;};'use strict';var Sequelize=require(_0x51c3('0x0'));module[_0x51c3('0x1')]={'name':{'type':Sequelize[_0x51c3('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x51c3('0x3')](_0x51c3('0x4'),_0x51c3('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x51c3('0x3')](_0x51c3('0x6'),_0x51c3('0x7')),'defaultValue':_0x51c3('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x51c3('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x15f5=['ENUM','incident','contact','nothing','STRING'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x15f5,0x1cb));var _0x515f=function(_0x2576fb,_0x3fea61){_0x2576fb=_0x2576fb-0x0;var _0x1e07f4=_0x15f5[_0x2576fb];return _0x1e07f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x515f('0x0')]},'description':{'type':Sequelize[_0x515f('0x0')]},'ticketType':{'type':Sequelize[_0x515f('0x1')](_0x515f('0x2'),'phonecall'),'defaultValue':_0x515f('0x2')},'moduleCreate':{'type':Sequelize[_0x515f('0x1')](_0x515f('0x3'),_0x515f('0x4')),'defaultValue':_0x515f('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 6217447..5e765fa 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 _0xb152=['moment','bluebird','path','sox','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','status','end','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','fast-json-patch'];(function(_0x7c7cd8,_0x215d30){var _0x31e062=function(_0xd577e7){while(--_0xd577e7){_0x7c7cd8['push'](_0x7c7cd8['shift']());}};_0x31e062(++_0x215d30);}(_0xb152,0x16b));var _0x2b15=function(_0xc9b323,_0x22c243){_0xc9b323=_0xc9b323-0x0;var _0x28f7bc=_0xb152[_0xc9b323];return _0x28f7bc;};'use strict';var emlformat=require(_0x2b15('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b15('0x1'));var rp=require('request-promise');var moment=require(_0x2b15('0x2'));var BPromise=require(_0x2b15('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2b15('0x4'));var sox=require(_0x2b15('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b15('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b15('0x7'));var jsforce=require(_0x2b15('0x8'));var deskjs=require(_0x2b15('0x9'));var toCsv=require('to-csv');var querystring=require(_0x2b15('0xa'));var Papa=require(_0x2b15('0xb'));var Redis=require(_0x2b15('0xc'));var authService=require(_0x2b15('0xd'));var qs=require(_0x2b15('0xe'));var as=require(_0x2b15('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2b15('0x10'));var config=require(_0x2b15('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dc1a9,_0x419315){_0x419315=_0x419315||0xcc;return function(_0x5d38ce){if(_0x5d38ce){return _0x3dc1a9[_0x2b15('0x12')](_0x419315);}return _0x3dc1a9[_0x2b15('0x13')](_0x419315)[_0x2b15('0x14')]();};}function respondWithResult(_0x6d30bf,_0x30f044){_0x30f044=_0x30f044||0xc8;return function(_0x185826){if(_0x185826){return _0x6d30bf[_0x2b15('0x13')](_0x30f044)['json'](_0x185826);}};}function respondWithFilteredResult(_0x402f33,_0x6f4653){return function(_0xa974cc){if(_0xa974cc){var _0x92ac48=typeof _0x6f4653['offset']==='undefined'&&typeof _0x6f4653[_0x2b15('0x15')]==='undefined';var _0x335fc3=_0xa974cc[_0x2b15('0x16')];var _0x179c54=_0x92ac48?0x0:_0x6f4653[_0x2b15('0x17')];var _0x1c73ce=_0x92ac48?_0xa974cc[_0x2b15('0x16')]:_0x6f4653[_0x2b15('0x17')]+_0x6f4653[_0x2b15('0x15')];var _0xedf91c;if(_0x1c73ce>=_0x335fc3){_0x1c73ce=_0x335fc3;_0xedf91c=0xc8;}else{_0xedf91c=0xce;}_0x402f33['status'](_0xedf91c);return _0x402f33['set'](_0x2b15('0x18'),_0x179c54+'-'+_0x1c73ce+'/'+_0x335fc3)['json'](_0xa974cc);}return null;};}function patchUpdates(_0x5db7e1){return function(_0x21fa2b){try{jsonpatch[_0x2b15('0x19')](_0x21fa2b,_0x5db7e1,!![]);}catch(_0xae5734){return BPromise[_0x2b15('0x1a')](_0xae5734);}return _0x21fa2b[_0x2b15('0x1b')]();};}function saveUpdates(_0x16e4bb,_0x3851a4){return function(_0x5cc9b3){if(_0x5cc9b3){return _0x5cc9b3[_0x2b15('0x1c')](_0x16e4bb)[_0x2b15('0x1d')](function(_0x3c2ab7){return _0x3c2ab7;});}return null;};}function removeEntity(_0x1a2085,_0x351d4b){return function(_0x4ace7a){if(_0x4ace7a){return _0x4ace7a['destroy']()[_0x2b15('0x1d')](function(){_0x1a2085[_0x2b15('0x13')](0xcc)[_0x2b15('0x14')]();});}};}function handleEntityNotFound(_0x5dc527,_0x3ea986){return function(_0x243d9e){if(!_0x243d9e){_0x5dc527[_0x2b15('0x12')](0x194);}return _0x243d9e;};}function handleError(_0x139824,_0x5a9a88){_0x5a9a88=_0x5a9a88||0x1f4;return function(_0x35e2c6){logger[_0x2b15('0x1e')](_0x35e2c6[_0x2b15('0x1f')]);if(_0x35e2c6[_0x2b15('0x20')]){delete _0x35e2c6[_0x2b15('0x20')];}_0x139824[_0x2b15('0x13')](_0x5a9a88)['send'](_0x35e2c6);};}exports[_0x2b15('0x21')]=function(_0x3a959b,_0x968c9){var _0x5c607b={},_0x37d64a={},_0x178d7c={'count':0x0,'rows':[]};var _0x10390c=_[_0x2b15('0x22')](db[_0x2b15('0x23')][_0x2b15('0x24')],function(_0x44c8df){return{'name':_0x44c8df['fieldName'],'type':_0x44c8df[_0x2b15('0x25')][_0x2b15('0x26')]};});_0x37d64a[_0x2b15('0x27')]=_[_0x2b15('0x22')](_0x10390c,_0x2b15('0x20'));_0x37d64a[_0x2b15('0x28')]=_['keys'](_0x3a959b['query']);_0x37d64a[_0x2b15('0x29')]=_['intersection'](_0x37d64a[_0x2b15('0x27')],_0x37d64a['query']);_0x5c607b[_0x2b15('0x2a')]=_[_0x2b15('0x2b')](_0x37d64a[_0x2b15('0x27')],qs['fields'](_0x3a959b[_0x2b15('0x28')][_0x2b15('0x2c')]));_0x5c607b[_0x2b15('0x2a')]=_0x5c607b['attributes'][_0x2b15('0x2d')]?_0x5c607b[_0x2b15('0x2a')]:_0x37d64a[_0x2b15('0x27')];if(!_0x3a959b[_0x2b15('0x28')][_0x2b15('0x2e')](_0x2b15('0x2f'))){_0x5c607b[_0x2b15('0x15')]=qs['limit'](_0x3a959b[_0x2b15('0x28')][_0x2b15('0x15')]);_0x5c607b[_0x2b15('0x17')]=qs['offset'](_0x3a959b[_0x2b15('0x28')][_0x2b15('0x17')]);}_0x5c607b[_0x2b15('0x30')]=qs[_0x2b15('0x31')](_0x3a959b[_0x2b15('0x28')][_0x2b15('0x31')]);_0x5c607b['where']=qs['filters'](_[_0x2b15('0x32')](_0x3a959b[_0x2b15('0x28')],_0x37d64a['filters']),_0x10390c);if(_0x3a959b['query'][_0x2b15('0x33')]){_0x5c607b[_0x2b15('0x34')]=_['merge'](_0x5c607b[_0x2b15('0x34')],{'$or':_[_0x2b15('0x22')](_0x10390c,function(_0xf4b833){if(_0xf4b833['type']!==_0x2b15('0x35')){var _0x3bba7b={};_0x3bba7b[_0xf4b833[_0x2b15('0x20')]]={'$like':'%'+_0x3a959b[_0x2b15('0x28')][_0x2b15('0x33')]+'%'};return _0x3bba7b;}})});}_0x5c607b=_[_0x2b15('0x36')]({},_0x5c607b,_0x3a959b['options']);var _0x402600={'where':_0x5c607b[_0x2b15('0x34')]};return db[_0x2b15('0x23')]['count'](_0x402600)['then'](function(_0x44c1a1){_0x178d7c['count']=_0x44c1a1;if(_0x3a959b[_0x2b15('0x28')][_0x2b15('0x37')]){_0x5c607b[_0x2b15('0x38')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x2b15('0x39')](_0x5c607b);})[_0x2b15('0x1d')](function(_0x467f27){_0x178d7c[_0x2b15('0x3a')]=_0x467f27;return _0x178d7c;})[_0x2b15('0x1d')](respondWithFilteredResult(_0x968c9,_0x5c607b))[_0x2b15('0x3b')](handleError(_0x968c9,null));};exports[_0x2b15('0x3c')]=function(_0x4e4670,_0x2650c6){var _0x168abc={'raw':![],'where':{'id':_0x4e4670[_0x2b15('0x3d')]['id']}},_0x2434e1={};_0x2434e1[_0x2b15('0x27')]=_[_0x2b15('0x3e')](db[_0x2b15('0x23')][_0x2b15('0x24')]);_0x2434e1['query']=_[_0x2b15('0x3e')](_0x4e4670[_0x2b15('0x28')]);_0x2434e1[_0x2b15('0x29')]=_[_0x2b15('0x2b')](_0x2434e1['model'],_0x2434e1['query']);_0x168abc['attributes']=_[_0x2b15('0x2b')](_0x2434e1[_0x2b15('0x27')],qs[_0x2b15('0x2c')](_0x4e4670[_0x2b15('0x28')][_0x2b15('0x2c')]));_0x168abc['attributes']=_0x168abc['attributes'][_0x2b15('0x2d')]?_0x168abc[_0x2b15('0x2a')]:_0x2434e1['model'];if(_0x4e4670[_0x2b15('0x28')]['includeAll']){_0x168abc[_0x2b15('0x38')]=[{'all':!![]}];}_0x168abc=_[_0x2b15('0x36')]({},_0x168abc,_0x4e4670[_0x2b15('0x3f')]);return db[_0x2b15('0x23')][_0x2b15('0x40')](_0x168abc)[_0x2b15('0x1d')](handleEntityNotFound(_0x2650c6,null))[_0x2b15('0x1d')](respondWithResult(_0x2650c6,null))['catch'](handleError(_0x2650c6,null));};exports[_0x2b15('0x41')]=function(_0x4580f0,_0x2eeb96){return db[_0x2b15('0x23')][_0x2b15('0x41')](_0x4580f0[_0x2b15('0x42')],{})[_0x2b15('0x1d')](respondWithResult(_0x2eeb96,0xc9))[_0x2b15('0x3b')](handleError(_0x2eeb96,null));};exports['update']=function(_0x596906,_0x3ff3a6){if(_0x596906['body']['id']){delete _0x596906[_0x2b15('0x42')]['id'];}return db[_0x2b15('0x23')][_0x2b15('0x40')]({'where':{'id':_0x596906['params']['id']}})[_0x2b15('0x1d')](handleEntityNotFound(_0x3ff3a6,null))['then'](saveUpdates(_0x596906[_0x2b15('0x42')],null))[_0x2b15('0x1d')](respondWithResult(_0x3ff3a6,null))[_0x2b15('0x3b')](handleError(_0x3ff3a6,null));};exports[_0x2b15('0x43')]=function(_0x5257be,_0x27c59d){return db['Dynamics365Configuration'][_0x2b15('0x40')]({'where':{'id':_0x5257be[_0x2b15('0x3d')]['id']}})[_0x2b15('0x1d')](handleEntityNotFound(_0x27c59d,null))[_0x2b15('0x1d')](removeEntity(_0x27c59d,null))[_0x2b15('0x3b')](handleError(_0x27c59d,null));};exports[_0x2b15('0x44')]=function(_0x13d450,_0x33bd1e,_0x20bf52){var _0x46f9cf={};var _0x5b35cb={};var _0x1deac1;var _0x26ee74;return db[_0x2b15('0x23')][_0x2b15('0x45')]({'where':{'id':_0x13d450['params']['id']}})[_0x2b15('0x1d')](handleEntityNotFound(_0x33bd1e,null))['then'](function(_0x1d5473){if(_0x1d5473){_0x1deac1=_0x1d5473;_0x5b35cb['model']=_[_0x2b15('0x3e')](db['Dynamics365Field']['rawAttributes']);_0x5b35cb['query']=_[_0x2b15('0x3e')](_0x13d450[_0x2b15('0x28')]);_0x5b35cb[_0x2b15('0x29')]=_[_0x2b15('0x2b')](_0x5b35cb['model'],_0x5b35cb[_0x2b15('0x28')]);_0x46f9cf[_0x2b15('0x2a')]=_['intersection'](_0x5b35cb[_0x2b15('0x27')],qs[_0x2b15('0x2c')](_0x13d450['query'][_0x2b15('0x2c')]));_0x46f9cf[_0x2b15('0x2a')]=_0x46f9cf[_0x2b15('0x2a')][_0x2b15('0x2d')]?_0x46f9cf[_0x2b15('0x2a')]:_0x5b35cb[_0x2b15('0x27')];_0x46f9cf[_0x2b15('0x30')]=qs[_0x2b15('0x31')](_0x13d450['query']['sort']);_0x46f9cf[_0x2b15('0x34')]=qs[_0x2b15('0x29')](_['pick'](_0x13d450['query'],_0x5b35cb[_0x2b15('0x29')]));if(_0x13d450[_0x2b15('0x28')][_0x2b15('0x33')]){_0x46f9cf[_0x2b15('0x34')]=_['merge'](_0x46f9cf[_0x2b15('0x34')],{'$or':_[_0x2b15('0x22')](_0x46f9cf[_0x2b15('0x2a')],function(_0x2fddb1){var _0x87263e={};_0x87263e[_0x2fddb1]={'$like':'%'+_0x13d450['query'][_0x2b15('0x33')]+'%'};return _0x87263e;})});}_0x46f9cf=_[_0x2b15('0x36')]({},_0x46f9cf,_0x13d450[_0x2b15('0x3f')]);return _0x1deac1[_0x2b15('0x44')](_0x46f9cf);}})[_0x2b15('0x1d')](function(_0x13fce8){if(_0x13fce8){_0x26ee74=_0x13fce8[_0x2b15('0x2d')];if(!_0x13d450['query'][_0x2b15('0x2e')]('nolimit')){_0x46f9cf['limit']=qs[_0x2b15('0x15')](_0x13d450[_0x2b15('0x28')][_0x2b15('0x15')]);_0x46f9cf['offset']=qs[_0x2b15('0x17')](_0x13d450[_0x2b15('0x28')][_0x2b15('0x17')]);}return _0x1deac1[_0x2b15('0x44')](_0x46f9cf);}})[_0x2b15('0x1d')](function(_0x4d3d6f){if(_0x4d3d6f){return _0x4d3d6f?{'count':_0x26ee74,'rows':_0x4d3d6f}:null;}})[_0x2b15('0x1d')](respondWithResult(_0x33bd1e,null))[_0x2b15('0x3b')](handleError(_0x33bd1e,null));};exports['getSubjects']=function(_0x26678e,_0x3d7ff5,_0x275bda){var _0x54fd1c={};var _0x251ab4={};var _0x308794;var _0x56e714;return db[_0x2b15('0x23')][_0x2b15('0x45')]({'where':{'id':_0x26678e[_0x2b15('0x3d')]['id']}})[_0x2b15('0x1d')](handleEntityNotFound(_0x3d7ff5,null))['then'](function(_0x2c159e){if(_0x2c159e){_0x308794=_0x2c159e;_0x251ab4[_0x2b15('0x27')]=_[_0x2b15('0x3e')](db[_0x2b15('0x46')][_0x2b15('0x24')]);_0x251ab4['query']=_[_0x2b15('0x3e')](_0x26678e[_0x2b15('0x28')]);_0x251ab4['filters']=_['intersection'](_0x251ab4[_0x2b15('0x27')],_0x251ab4[_0x2b15('0x28')]);_0x54fd1c['attributes']=_['intersection'](_0x251ab4['model'],qs[_0x2b15('0x2c')](_0x26678e[_0x2b15('0x28')]['fields']));_0x54fd1c[_0x2b15('0x2a')]=_0x54fd1c[_0x2b15('0x2a')][_0x2b15('0x2d')]?_0x54fd1c[_0x2b15('0x2a')]:_0x251ab4[_0x2b15('0x27')];_0x54fd1c[_0x2b15('0x30')]=qs[_0x2b15('0x31')](_0x26678e[_0x2b15('0x28')]['sort']);_0x54fd1c['where']=qs[_0x2b15('0x29')](_['pick'](_0x26678e['query'],_0x251ab4[_0x2b15('0x29')]));if(_0x26678e[_0x2b15('0x28')][_0x2b15('0x33')]){_0x54fd1c[_0x2b15('0x34')]=_[_0x2b15('0x36')](_0x54fd1c['where'],{'$or':_[_0x2b15('0x22')](_0x54fd1c['attributes'],function(_0x4aa359){var _0xfe45b8={};_0xfe45b8[_0x4aa359]={'$like':'%'+_0x26678e[_0x2b15('0x28')]['filter']+'%'};return _0xfe45b8;})});}_0x54fd1c=_[_0x2b15('0x36')]({},_0x54fd1c,_0x26678e[_0x2b15('0x3f')]);return _0x308794[_0x2b15('0x47')](_0x54fd1c);}})[_0x2b15('0x1d')](function(_0x35a7fd){if(_0x35a7fd){_0x56e714=_0x35a7fd[_0x2b15('0x2d')];if(!_0x26678e[_0x2b15('0x28')]['hasOwnProperty'](_0x2b15('0x2f'))){_0x54fd1c[_0x2b15('0x15')]=qs[_0x2b15('0x15')](_0x26678e[_0x2b15('0x28')][_0x2b15('0x15')]);_0x54fd1c[_0x2b15('0x17')]=qs[_0x2b15('0x17')](_0x26678e[_0x2b15('0x28')]['offset']);}return _0x308794[_0x2b15('0x47')](_0x54fd1c);}})['then'](function(_0x44f209){if(_0x44f209){return _0x44f209?{'count':_0x56e714,'rows':_0x44f209}:null;}})[_0x2b15('0x1d')](respondWithResult(_0x3d7ff5,null))['catch'](handleError(_0x3d7ff5,null));};exports[_0x2b15('0x48')]=function(_0x3168cf,_0x5cfa25,_0x5b8080){var _0x26c8d1={};var _0x5f5dba={};var _0x59622d;var _0x2bfcca;return db['Dynamics365Configuration'][_0x2b15('0x45')]({'where':{'id':_0x3168cf[_0x2b15('0x3d')]['id']}})[_0x2b15('0x1d')](handleEntityNotFound(_0x5cfa25,null))[_0x2b15('0x1d')](function(_0x4e4a80){if(_0x4e4a80){_0x59622d=_0x4e4a80;_0x5f5dba[_0x2b15('0x27')]=_[_0x2b15('0x3e')](db[_0x2b15('0x46')][_0x2b15('0x24')]);_0x5f5dba['query']=_[_0x2b15('0x3e')](_0x3168cf['query']);_0x5f5dba['filters']=_[_0x2b15('0x2b')](_0x5f5dba['model'],_0x5f5dba['query']);_0x26c8d1[_0x2b15('0x2a')]=_[_0x2b15('0x2b')](_0x5f5dba['model'],qs[_0x2b15('0x2c')](_0x3168cf['query']['fields']));_0x26c8d1[_0x2b15('0x2a')]=_0x26c8d1[_0x2b15('0x2a')][_0x2b15('0x2d')]?_0x26c8d1[_0x2b15('0x2a')]:_0x5f5dba[_0x2b15('0x27')];_0x26c8d1[_0x2b15('0x30')]=qs[_0x2b15('0x31')](_0x3168cf[_0x2b15('0x28')][_0x2b15('0x31')]);_0x26c8d1[_0x2b15('0x34')]=qs['filters'](_[_0x2b15('0x32')](_0x3168cf[_0x2b15('0x28')],_0x5f5dba[_0x2b15('0x29')]));if(_0x3168cf[_0x2b15('0x28')][_0x2b15('0x33')]){_0x26c8d1['where']=_[_0x2b15('0x36')](_0x26c8d1['where'],{'$or':_[_0x2b15('0x22')](_0x26c8d1['attributes'],function(_0x12b26e){var _0x2136bd={};_0x2136bd[_0x12b26e]={'$like':'%'+_0x3168cf['query'][_0x2b15('0x33')]+'%'};return _0x2136bd;})});}_0x26c8d1=_[_0x2b15('0x36')]({},_0x26c8d1,_0x3168cf['options']);return _0x59622d[_0x2b15('0x48')](_0x26c8d1);}})['then'](function(_0xfaa8d2){if(_0xfaa8d2){_0x2bfcca=_0xfaa8d2[_0x2b15('0x2d')];if(!_0x3168cf[_0x2b15('0x28')][_0x2b15('0x2e')](_0x2b15('0x2f'))){_0x26c8d1[_0x2b15('0x15')]=qs['limit'](_0x3168cf[_0x2b15('0x28')]['limit']);_0x26c8d1[_0x2b15('0x17')]=qs[_0x2b15('0x17')](_0x3168cf[_0x2b15('0x28')][_0x2b15('0x17')]);}return _0x59622d[_0x2b15('0x48')](_0x26c8d1);}})[_0x2b15('0x1d')](function(_0x316e3a){if(_0x316e3a){return _0x316e3a?{'count':_0x2bfcca,'rows':_0x316e3a}:null;}})[_0x2b15('0x1d')](respondWithResult(_0x5cfa25,null))['catch'](handleError(_0x5cfa25,null));}; \ No newline at end of file +var _0xf476=['api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','then','rows','catch','show','params','intersection','include','find','create','body','getFields','Dynamics365Field','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','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/logger'];(function(_0x4f912d,_0x85fc6){var _0x4ab3a2=function(_0x156fdd){while(--_0x156fdd){_0x4f912d['push'](_0x4f912d['shift']());}};_0x4ab3a2(++_0x85fc6);}(_0xf476,0x1d0));var _0x6f47=function(_0x596837,_0x211bd3){_0x596837=_0x596837-0x0;var _0x3835c4=_0xf476[_0x596837];return _0x3835c4;};'use strict';var emlformat=require(_0x6f47('0x0'));var rimraf=require(_0x6f47('0x1'));var zipdir=require(_0x6f47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f47('0x3'));var moment=require(_0x6f47('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6f47('0x5'));var path=require(_0x6f47('0x6'));var sox=require(_0x6f47('0x7'));var csv=require(_0x6f47('0x8'));var ejs=require(_0x6f47('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f47('0xa'));var squel=require(_0x6f47('0xb'));var crypto=require(_0x6f47('0xc'));var jsforce=require(_0x6f47('0xd'));var deskjs=require(_0x6f47('0xe'));var toCsv=require(_0x6f47('0x8'));var querystring=require(_0x6f47('0xf'));var Papa=require(_0x6f47('0x10'));var Redis=require(_0x6f47('0x11'));var authService=require(_0x6f47('0x12'));var qs=require(_0x6f47('0x13'));var as=require(_0x6f47('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f47('0x15'))(_0x6f47('0x16'));var utils=require(_0x6f47('0x17'));var config=require(_0x6f47('0x18'));var licenseUtil=require(_0x6f47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49839c,_0x4ad1a5){_0x4ad1a5=_0x4ad1a5||0xcc;return function(_0x49ac79){if(_0x49ac79){return _0x49839c['sendStatus'](_0x4ad1a5);}return _0x49839c[_0x6f47('0x1a')](_0x4ad1a5)[_0x6f47('0x1b')]();};}function respondWithResult(_0x30ea6f,_0x382fa1){_0x382fa1=_0x382fa1||0xc8;return function(_0xfb372b){if(_0xfb372b){return _0x30ea6f['status'](_0x382fa1)['json'](_0xfb372b);}};}function respondWithFilteredResult(_0x534467,_0x64a019){return function(_0x50e5bd){if(_0x50e5bd){var _0x525532=typeof _0x64a019['offset']===_0x6f47('0x1c')&&typeof _0x64a019[_0x6f47('0x1d')]==='undefined';var _0x2f395d=_0x50e5bd[_0x6f47('0x1e')];var _0x5f5a89=_0x525532?0x0:_0x64a019['offset'];var _0x30443d=_0x525532?_0x50e5bd[_0x6f47('0x1e')]:_0x64a019[_0x6f47('0x1f')]+_0x64a019['limit'];var _0x36f549;if(_0x30443d>=_0x2f395d){_0x30443d=_0x2f395d;_0x36f549=0xc8;}else{_0x36f549=0xce;}_0x534467[_0x6f47('0x1a')](_0x36f549);return _0x534467['set'](_0x6f47('0x20'),_0x5f5a89+'-'+_0x30443d+'/'+_0x2f395d)['json'](_0x50e5bd);}return null;};}function patchUpdates(_0x413745){return function(_0x13ca98){try{jsonpatch[_0x6f47('0x21')](_0x13ca98,_0x413745,!![]);}catch(_0x5ef92b){return BPromise[_0x6f47('0x22')](_0x5ef92b);}return _0x13ca98[_0x6f47('0x23')]();};}function saveUpdates(_0x114803,_0x456af3){return function(_0x870af3){if(_0x870af3){return _0x870af3[_0x6f47('0x24')](_0x114803)['then'](function(_0x23b695){return _0x23b695;});}return null;};}function removeEntity(_0x32a4cb,_0x28ecc8){return function(_0x4a0cd9){if(_0x4a0cd9){return _0x4a0cd9[_0x6f47('0x25')]()['then'](function(){_0x32a4cb[_0x6f47('0x1a')](0xcc)[_0x6f47('0x1b')]();});}};}function handleEntityNotFound(_0x3b57fc,_0x13897c){return function(_0x40fd2a){if(!_0x40fd2a){_0x3b57fc[_0x6f47('0x26')](0x194);}return _0x40fd2a;};}function handleError(_0x17b356,_0x2fea4a){_0x2fea4a=_0x2fea4a||0x1f4;return function(_0xe3540c){logger[_0x6f47('0x27')](_0xe3540c['stack']);if(_0xe3540c['name']){delete _0xe3540c[_0x6f47('0x28')];}_0x17b356[_0x6f47('0x1a')](_0x2fea4a)[_0x6f47('0x29')](_0xe3540c);};}exports[_0x6f47('0x2a')]=function(_0x378e8e,_0x624c7f){var _0xf9ff13={},_0x55a1e6={},_0x4f238a={'count':0x0,'rows':[]};var _0x46e22e=_['map'](db[_0x6f47('0x2b')][_0x6f47('0x2c')],function(_0x40637f){return{'name':_0x40637f[_0x6f47('0x2d')],'type':_0x40637f[_0x6f47('0x2e')]['key']};});_0x55a1e6[_0x6f47('0x2f')]=_[_0x6f47('0x30')](_0x46e22e,_0x6f47('0x28'));_0x55a1e6[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x378e8e['query']);_0x55a1e6[_0x6f47('0x33')]=_['intersection'](_0x55a1e6[_0x6f47('0x2f')],_0x55a1e6[_0x6f47('0x31')]);_0xf9ff13[_0x6f47('0x34')]=_['intersection'](_0x55a1e6[_0x6f47('0x2f')],qs[_0x6f47('0x35')](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x35')]));_0xf9ff13[_0x6f47('0x34')]=_0xf9ff13[_0x6f47('0x34')][_0x6f47('0x36')]?_0xf9ff13['attributes']:_0x55a1e6[_0x6f47('0x2f')];if(!_0x378e8e[_0x6f47('0x31')][_0x6f47('0x37')](_0x6f47('0x38'))){_0xf9ff13[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x1d')]);_0xf9ff13[_0x6f47('0x1f')]=qs[_0x6f47('0x1f')](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x1f')]);}_0xf9ff13[_0x6f47('0x39')]=qs['sort'](_0x378e8e[_0x6f47('0x31')][_0x6f47('0x3a')]);_0xf9ff13[_0x6f47('0x3b')]=qs[_0x6f47('0x33')](_['pick'](_0x378e8e[_0x6f47('0x31')],_0x55a1e6[_0x6f47('0x33')]),_0x46e22e);if(_0x378e8e[_0x6f47('0x31')][_0x6f47('0x3c')]){_0xf9ff13[_0x6f47('0x3b')]=_['merge'](_0xf9ff13[_0x6f47('0x3b')],{'$or':_['map'](_0x46e22e,function(_0x56e0a4){if(_0x56e0a4[_0x6f47('0x2e')]!==_0x6f47('0x3d')){var _0x2c47d8={};_0x2c47d8[_0x56e0a4['name']]={'$like':'%'+_0x378e8e['query'][_0x6f47('0x3c')]+'%'};return _0x2c47d8;}})});}_0xf9ff13=_[_0x6f47('0x3e')]({},_0xf9ff13,_0x378e8e[_0x6f47('0x3f')]);var _0x35e64f={'where':_0xf9ff13[_0x6f47('0x3b')]};return db[_0x6f47('0x2b')]['count'](_0x35e64f)['then'](function(_0x453a30){_0x4f238a[_0x6f47('0x1e')]=_0x453a30;if(_0x378e8e[_0x6f47('0x31')][_0x6f47('0x40')]){_0xf9ff13['include']=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0xf9ff13);})[_0x6f47('0x41')](function(_0x814b38){_0x4f238a[_0x6f47('0x42')]=_0x814b38;return _0x4f238a;})[_0x6f47('0x41')](respondWithFilteredResult(_0x624c7f,_0xf9ff13))[_0x6f47('0x43')](handleError(_0x624c7f,null));};exports[_0x6f47('0x44')]=function(_0x5d3aaf,_0x4bd161){var _0x140d95={'raw':![],'where':{'id':_0x5d3aaf[_0x6f47('0x45')]['id']}},_0x5b127d={};_0x5b127d[_0x6f47('0x2f')]=_[_0x6f47('0x32')](db[_0x6f47('0x2b')][_0x6f47('0x2c')]);_0x5b127d[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x5d3aaf[_0x6f47('0x31')]);_0x5b127d[_0x6f47('0x33')]=_[_0x6f47('0x46')](_0x5b127d['model'],_0x5b127d[_0x6f47('0x31')]);_0x140d95[_0x6f47('0x34')]=_[_0x6f47('0x46')](_0x5b127d[_0x6f47('0x2f')],qs['fields'](_0x5d3aaf[_0x6f47('0x31')][_0x6f47('0x35')]));_0x140d95['attributes']=_0x140d95[_0x6f47('0x34')][_0x6f47('0x36')]?_0x140d95[_0x6f47('0x34')]:_0x5b127d[_0x6f47('0x2f')];if(_0x5d3aaf[_0x6f47('0x31')][_0x6f47('0x40')]){_0x140d95[_0x6f47('0x47')]=[{'all':!![]}];}_0x140d95=_['merge']({},_0x140d95,_0x5d3aaf[_0x6f47('0x3f')]);return db[_0x6f47('0x2b')][_0x6f47('0x48')](_0x140d95)[_0x6f47('0x41')](handleEntityNotFound(_0x4bd161,null))[_0x6f47('0x41')](respondWithResult(_0x4bd161,null))[_0x6f47('0x43')](handleError(_0x4bd161,null));};exports[_0x6f47('0x49')]=function(_0x3659ef,_0x483333){return db['Dynamics365Configuration'][_0x6f47('0x49')](_0x3659ef[_0x6f47('0x4a')],{})[_0x6f47('0x41')](respondWithResult(_0x483333,0xc9))['catch'](handleError(_0x483333,null));};exports['update']=function(_0x3984a4,_0x23d684){if(_0x3984a4[_0x6f47('0x4a')]['id']){delete _0x3984a4[_0x6f47('0x4a')]['id'];}return db['Dynamics365Configuration'][_0x6f47('0x48')]({'where':{'id':_0x3984a4[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x23d684,null))[_0x6f47('0x41')](saveUpdates(_0x3984a4[_0x6f47('0x4a')],null))[_0x6f47('0x41')](respondWithResult(_0x23d684,null))['catch'](handleError(_0x23d684,null));};exports[_0x6f47('0x25')]=function(_0x10213d,_0x4da3f7){return db[_0x6f47('0x2b')][_0x6f47('0x48')]({'where':{'id':_0x10213d[_0x6f47('0x45')]['id']}})['then'](handleEntityNotFound(_0x4da3f7,null))[_0x6f47('0x41')](removeEntity(_0x4da3f7,null))[_0x6f47('0x43')](handleError(_0x4da3f7,null));};exports[_0x6f47('0x4b')]=function(_0xe06365,_0x2e65e1,_0x3df2c0){var _0x3066e1={};var _0x44d6bc={};var _0x186ebe;var _0x13ef17;return db[_0x6f47('0x2b')]['findOne']({'where':{'id':_0xe06365[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x2e65e1,null))[_0x6f47('0x41')](function(_0x51450c){if(_0x51450c){_0x186ebe=_0x51450c;_0x44d6bc[_0x6f47('0x2f')]=_[_0x6f47('0x32')](db[_0x6f47('0x4c')][_0x6f47('0x2c')]);_0x44d6bc['query']=_[_0x6f47('0x32')](_0xe06365[_0x6f47('0x31')]);_0x44d6bc[_0x6f47('0x33')]=_[_0x6f47('0x46')](_0x44d6bc[_0x6f47('0x2f')],_0x44d6bc[_0x6f47('0x31')]);_0x3066e1[_0x6f47('0x34')]=_[_0x6f47('0x46')](_0x44d6bc[_0x6f47('0x2f')],qs[_0x6f47('0x35')](_0xe06365[_0x6f47('0x31')][_0x6f47('0x35')]));_0x3066e1[_0x6f47('0x34')]=_0x3066e1['attributes'][_0x6f47('0x36')]?_0x3066e1[_0x6f47('0x34')]:_0x44d6bc['model'];_0x3066e1[_0x6f47('0x39')]=qs[_0x6f47('0x3a')](_0xe06365[_0x6f47('0x31')][_0x6f47('0x3a')]);_0x3066e1[_0x6f47('0x3b')]=qs[_0x6f47('0x33')](_['pick'](_0xe06365['query'],_0x44d6bc[_0x6f47('0x33')]));if(_0xe06365[_0x6f47('0x31')]['filter']){_0x3066e1['where']=_['merge'](_0x3066e1['where'],{'$or':_[_0x6f47('0x30')](_0x3066e1[_0x6f47('0x34')],function(_0x571f8c){var _0x29610e={};_0x29610e[_0x571f8c]={'$like':'%'+_0xe06365[_0x6f47('0x31')][_0x6f47('0x3c')]+'%'};return _0x29610e;})});}_0x3066e1=_[_0x6f47('0x3e')]({},_0x3066e1,_0xe06365[_0x6f47('0x3f')]);return _0x186ebe[_0x6f47('0x4b')](_0x3066e1);}})[_0x6f47('0x41')](function(_0x5eb7ec){if(_0x5eb7ec){_0x13ef17=_0x5eb7ec[_0x6f47('0x36')];if(!_0xe06365[_0x6f47('0x31')][_0x6f47('0x37')]('nolimit')){_0x3066e1[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0xe06365[_0x6f47('0x31')][_0x6f47('0x1d')]);_0x3066e1[_0x6f47('0x1f')]=qs[_0x6f47('0x1f')](_0xe06365['query'][_0x6f47('0x1f')]);}return _0x186ebe[_0x6f47('0x4b')](_0x3066e1);}})[_0x6f47('0x41')](function(_0x444a85){if(_0x444a85){return _0x444a85?{'count':_0x13ef17,'rows':_0x444a85}:null;}})[_0x6f47('0x41')](respondWithResult(_0x2e65e1,null))[_0x6f47('0x43')](handleError(_0x2e65e1,null));};exports[_0x6f47('0x4d')]=function(_0x1a2ad1,_0x36b6e1,_0x3ddb98){var _0x320a3c={};var _0x2b253d={};var _0x50c9f7;var _0x2c181a;return db[_0x6f47('0x2b')][_0x6f47('0x4e')]({'where':{'id':_0x1a2ad1[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x36b6e1,null))[_0x6f47('0x41')](function(_0x1b1ad7){if(_0x1b1ad7){_0x50c9f7=_0x1b1ad7;_0x2b253d[_0x6f47('0x2f')]=_['keys'](db[_0x6f47('0x4c')][_0x6f47('0x2c')]);_0x2b253d[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x1a2ad1[_0x6f47('0x31')]);_0x2b253d['filters']=_[_0x6f47('0x46')](_0x2b253d[_0x6f47('0x2f')],_0x2b253d['query']);_0x320a3c[_0x6f47('0x34')]=_['intersection'](_0x2b253d[_0x6f47('0x2f')],qs['fields'](_0x1a2ad1[_0x6f47('0x31')]['fields']));_0x320a3c[_0x6f47('0x34')]=_0x320a3c[_0x6f47('0x34')][_0x6f47('0x36')]?_0x320a3c[_0x6f47('0x34')]:_0x2b253d[_0x6f47('0x2f')];_0x320a3c['order']=qs['sort'](_0x1a2ad1[_0x6f47('0x31')][_0x6f47('0x3a')]);_0x320a3c[_0x6f47('0x3b')]=qs['filters'](_[_0x6f47('0x4f')](_0x1a2ad1[_0x6f47('0x31')],_0x2b253d[_0x6f47('0x33')]));if(_0x1a2ad1[_0x6f47('0x31')]['filter']){_0x320a3c[_0x6f47('0x3b')]=_['merge'](_0x320a3c[_0x6f47('0x3b')],{'$or':_['map'](_0x320a3c[_0x6f47('0x34')],function(_0x1a8356){var _0x13e430={};_0x13e430[_0x1a8356]={'$like':'%'+_0x1a2ad1[_0x6f47('0x31')][_0x6f47('0x3c')]+'%'};return _0x13e430;})});}_0x320a3c=_[_0x6f47('0x3e')]({},_0x320a3c,_0x1a2ad1['options']);return _0x50c9f7[_0x6f47('0x4d')](_0x320a3c);}})['then'](function(_0x25352d){if(_0x25352d){_0x2c181a=_0x25352d[_0x6f47('0x36')];if(!_0x1a2ad1[_0x6f47('0x31')][_0x6f47('0x37')](_0x6f47('0x38'))){_0x320a3c[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0x1a2ad1['query']['limit']);_0x320a3c['offset']=qs[_0x6f47('0x1f')](_0x1a2ad1[_0x6f47('0x31')]['offset']);}return _0x50c9f7[_0x6f47('0x4d')](_0x320a3c);}})[_0x6f47('0x41')](function(_0x3ae69e){if(_0x3ae69e){return _0x3ae69e?{'count':_0x2c181a,'rows':_0x3ae69e}:null;}})[_0x6f47('0x41')](respondWithResult(_0x36b6e1,null))[_0x6f47('0x43')](handleError(_0x36b6e1,null));};exports['getDescriptions']=function(_0x178174,_0x56f725,_0x300018){var _0x480758={};var _0x1bbd70={};var _0x34cc79;var _0x306e3f;return db[_0x6f47('0x2b')][_0x6f47('0x4e')]({'where':{'id':_0x178174[_0x6f47('0x45')]['id']}})[_0x6f47('0x41')](handleEntityNotFound(_0x56f725,null))[_0x6f47('0x41')](function(_0x2c3f7d){if(_0x2c3f7d){_0x34cc79=_0x2c3f7d;_0x1bbd70[_0x6f47('0x2f')]=_['keys'](db[_0x6f47('0x4c')][_0x6f47('0x2c')]);_0x1bbd70[_0x6f47('0x31')]=_[_0x6f47('0x32')](_0x178174[_0x6f47('0x31')]);_0x1bbd70[_0x6f47('0x33')]=_['intersection'](_0x1bbd70[_0x6f47('0x2f')],_0x1bbd70['query']);_0x480758[_0x6f47('0x34')]=_[_0x6f47('0x46')](_0x1bbd70[_0x6f47('0x2f')],qs[_0x6f47('0x35')](_0x178174['query'][_0x6f47('0x35')]));_0x480758[_0x6f47('0x34')]=_0x480758[_0x6f47('0x34')][_0x6f47('0x36')]?_0x480758[_0x6f47('0x34')]:_0x1bbd70[_0x6f47('0x2f')];_0x480758[_0x6f47('0x39')]=qs['sort'](_0x178174[_0x6f47('0x31')][_0x6f47('0x3a')]);_0x480758[_0x6f47('0x3b')]=qs[_0x6f47('0x33')](_['pick'](_0x178174[_0x6f47('0x31')],_0x1bbd70[_0x6f47('0x33')]));if(_0x178174[_0x6f47('0x31')][_0x6f47('0x3c')]){_0x480758[_0x6f47('0x3b')]=_[_0x6f47('0x3e')](_0x480758[_0x6f47('0x3b')],{'$or':_[_0x6f47('0x30')](_0x480758[_0x6f47('0x34')],function(_0x10ed74){var _0x83ffe6={};_0x83ffe6[_0x10ed74]={'$like':'%'+_0x178174[_0x6f47('0x31')][_0x6f47('0x3c')]+'%'};return _0x83ffe6;})});}_0x480758=_['merge']({},_0x480758,_0x178174[_0x6f47('0x3f')]);return _0x34cc79[_0x6f47('0x50')](_0x480758);}})[_0x6f47('0x41')](function(_0x1cb9b9){if(_0x1cb9b9){_0x306e3f=_0x1cb9b9[_0x6f47('0x36')];if(!_0x178174[_0x6f47('0x31')][_0x6f47('0x37')](_0x6f47('0x38'))){_0x480758[_0x6f47('0x1d')]=qs[_0x6f47('0x1d')](_0x178174[_0x6f47('0x31')][_0x6f47('0x1d')]);_0x480758[_0x6f47('0x1f')]=qs['offset'](_0x178174[_0x6f47('0x31')][_0x6f47('0x1f')]);}return _0x34cc79[_0x6f47('0x50')](_0x480758);}})[_0x6f47('0x41')](function(_0x2538ae){if(_0x2538ae){return _0x2538ae?{'count':_0x306e3f,'rows':_0x2538ae}:null;}})[_0x6f47('0x41')](respondWithResult(_0x56f725,null))[_0x6f47('0x43')](handleError(_0x56f725,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 621064c..4d2e2f4 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x272802,_0x47424b){var _0x5c912a=function(_0x2c056c){while(--_0x2c056c){_0x272802['push'](_0x272802['shift']());}};_0x5c912a(++_0x47424b);}(_0xedd9,0xfc));var _0x9edd=function(_0x167c12,_0x1318e2){_0x167c12=_0x167c12-0x0;var _0x9e5f03=_0xedd9[_0x167c12];return _0x9e5f03;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x42f1e6,_0x372465){var _0xea2816=function(_0x20050e){while(--_0x20050e){_0x42f1e6['push'](_0x42f1e6['shift']());}};_0xea2816(++_0x372465);}(_0x008c,0x188));var _0xc008=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x008c[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'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 924b9f5..60a4c74 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 _0x3723=['jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1ae42d,_0x112a5b){var _0x86919c=function(_0x5e8d8f){while(--_0x5e8d8f){_0x1ae42d['push'](_0x1ae42d['shift']());}};_0x86919c(++_0x112a5b);}(_0x3723,0x1e6));var _0x3372=function(_0x2e1f3b,_0x1feb3f){_0x2e1f3b=_0x2e1f3b-0x0;var _0x47ae2a=_0x3723[_0x2e1f3b];return _0x47ae2a;};'use strict';var _=require(_0x3372('0x0'));var util=require(_0x3372('0x1'));var moment=require(_0x3372('0x2'));var BPromise=require(_0x3372('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3372('0x4'));var db=require(_0x3372('0x5'))['db'];var utils=require(_0x3372('0x6'));var logger=require('../../config/logger')(_0x3372('0x7'));var config=require('../../config/environment');var jayson=require(_0x3372('0x8'));var client=jayson[_0x3372('0x9')][_0x3372('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x129828,_0x582d0f,_0x41f9b6){return new BPromise(function(_0x2f4041,_0x5d8eff){return client['request'](_0x129828,_0x41f9b6)[_0x3372('0xb')](function(_0x2c86ff){logger['info'](_0x3372('0xc'),_0x582d0f,_0x3372('0xd'));logger['debug'](_0x3372('0xe'),_0x582d0f,_0x3372('0xd'),JSON[_0x3372('0xf')](_0x2c86ff));if(_0x2c86ff['error']){if(_0x2c86ff[_0x3372('0x10')]['code']===0x1f4){logger[_0x3372('0x10')](_0x3372('0xc'),_0x582d0f,_0x2c86ff[_0x3372('0x10')][_0x3372('0x11')]);return _0x5d8eff(_0x2c86ff[_0x3372('0x10')]['message']);}logger['error'](_0x3372('0xc'),_0x582d0f,_0x2c86ff[_0x3372('0x10')][_0x3372('0x11')]);return _0x2f4041(_0x2c86ff[_0x3372('0x10')][_0x3372('0x11')]);}else{logger[_0x3372('0x12')](_0x3372('0xc'),_0x582d0f,_0x3372('0xd'));_0x2f4041(_0x2c86ff['result']['message']);}})['catch'](function(_0x4a0337){logger[_0x3372('0x10')](_0x3372('0xc'),_0x582d0f,_0x4a0337);_0x5d8eff(_0x4a0337);});});} \ No newline at end of file +var _0x31e6=['../../config/environment','jayson/promise','client','request','then','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x380c0d,_0x1ce546){var _0x122154=function(_0xf655e0){while(--_0xf655e0){_0x380c0d['push'](_0x380c0d['shift']());}};_0x122154(++_0x1ce546);}(_0x31e6,0x19d));var _0x631e=function(_0x2b9bf2,_0x4696e5){_0x2b9bf2=_0x2b9bf2-0x0;var _0x2740a3=_0x31e6[_0x2b9bf2];return _0x2740a3;};'use strict';var _=require(_0x631e('0x0'));var util=require('util');var moment=require(_0x631e('0x1'));var BPromise=require(_0x631e('0x2'));var rs=require(_0x631e('0x3'));var fs=require('fs');var Redis=require(_0x631e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x631e('0x5'));var logger=require('../../config/logger')(_0x631e('0x6'));var config=require(_0x631e('0x7'));var jayson=require(_0x631e('0x8'));var client=jayson[_0x631e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36d41e,_0x275d9d,_0x4f581f){return new BPromise(function(_0x1d092e,_0x2ef34a){return client[_0x631e('0xa')](_0x36d41e,_0x4f581f)[_0x631e('0xb')](function(_0x504155){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x275d9d,_0x631e('0xc'));logger['debug'](_0x631e('0xd'),_0x275d9d,_0x631e('0xc'),JSON[_0x631e('0xe')](_0x504155));if(_0x504155[_0x631e('0xf')]){if(_0x504155[_0x631e('0xf')][_0x631e('0x10')]===0x1f4){logger['error'](_0x631e('0x11'),_0x275d9d,_0x504155['error'][_0x631e('0x12')]);return _0x2ef34a(_0x504155['error'][_0x631e('0x12')]);}logger['error'](_0x631e('0x11'),_0x275d9d,_0x504155['error'][_0x631e('0x12')]);return _0x1d092e(_0x504155[_0x631e('0xf')][_0x631e('0x12')]);}else{logger['info'](_0x631e('0x11'),_0x275d9d,_0x631e('0xc'));_0x1d092e(_0x504155[_0x631e('0x13')][_0x631e('0x12')]);}})[_0x631e('0x14')](function(_0x116920){logger[_0x631e('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x275d9d,_0x116920);_0x2ef34a(_0x116920);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 7f4c373..c3d3053 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 _0xbc8b=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0xfea7b9,_0x216901){var _0x10897a=function(_0xa969a8){while(--_0xa969a8){_0xfea7b9['push'](_0xfea7b9['shift']());}};_0x10897a(++_0x216901);}(_0xbc8b,0x1bf));var _0xbbc8=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0xbc8b[_0x2e7a43];return _0x52e9e1;};'use strict';var multer=require(_0xbbc8('0x0'));var util=require(_0xbbc8('0x1'));var path=require(_0xbbc8('0x2'));var timeout=require(_0xbbc8('0x3'));var express=require(_0xbbc8('0x4'));var router=express[_0xbbc8('0x5')]();var fs_extra=require(_0xbbc8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbbc8('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xbbc8('0x8')]('/',auth[_0xbbc8('0x9')](),controller[_0xbbc8('0xa')]);router[_0xbbc8('0x8')](_0xbbc8('0xb'),auth[_0xbbc8('0x9')](),controller[_0xbbc8('0xc')]);router[_0xbbc8('0xd')]('/',auth[_0xbbc8('0x9')](),controller[_0xbbc8('0xe')]);router[_0xbbc8('0xf')](_0xbbc8('0xb'),auth[_0xbbc8('0x9')](),controller[_0xbbc8('0x10')]);router[_0xbbc8('0x11')]('/:id',auth[_0xbbc8('0x9')](),controller[_0xbbc8('0x12')]);module[_0xbbc8('0x13')]=router; \ No newline at end of file +var _0x1de7=['isAuthenticated','show','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','/:id'];(function(_0x47e772,_0xd1354a){var _0x541905=function(_0x558b74){while(--_0x558b74){_0x47e772['push'](_0x47e772['shift']());}};_0x541905(++_0xd1354a);}(_0x1de7,0x14b));var _0x71de=function(_0x40d400,_0x15376c){_0x40d400=_0x40d400-0x0;var _0x1a31a8=_0x1de7[_0x40d400];return _0x1a31a8;};'use strict';var multer=require('multer');var util=require(_0x71de('0x0'));var path=require('path');var timeout=require(_0x71de('0x1'));var express=require(_0x71de('0x2'));var router=express[_0x71de('0x3')]();var fs_extra=require(_0x71de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x71de('0x5'));var config=require('../../config/environment');var controller=require(_0x71de('0x6'));router[_0x71de('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x71de('0x7')](_0x71de('0x8'),auth[_0x71de('0x9')](),controller[_0x71de('0xa')]);router[_0x71de('0xb')]('/',auth[_0x71de('0x9')](),controller[_0x71de('0xc')]);router[_0x71de('0xd')](_0x71de('0x8'),auth[_0x71de('0x9')](),controller[_0x71de('0xe')]);router[_0x71de('0xf')](_0x71de('0x8'),auth['isAuthenticated'](),controller[_0x71de('0x10')]);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 07e59b0..f5a8c8f 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 _0x7e77=['string','variable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x1e2b86,_0x103e82){var _0x523308=function(_0x49e9c0){while(--_0x49e9c0){_0x1e2b86['push'](_0x1e2b86['shift']());}};_0x523308(++_0x103e82);}(_0x7e77,0x131));var _0x77e7=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0x7e77[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require(_0x77e7('0x0'));module[_0x77e7('0x1')]={'type':{'type':Sequelize[_0x77e7('0x2')](_0x77e7('0x3'),_0x77e7('0x4'),'customVariable',_0x77e7('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x77e7('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x77e7('0x2')](_0x77e7('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x77e7('0x6')]},'idField':{'type':Sequelize[_0x77e7('0x6')]},'nameField':{'type':Sequelize[_0x77e7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x77e7('0x6')]}}; \ No newline at end of file +var _0x65bd=['STRING','BOOLEAN','string','variable','customVariable','picklist'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x65bd,0x170));var _0xd65b=function(_0x257d91,_0x32ec73){_0x257d91=_0x257d91-0x0;var _0x2acf5c=_0x65bd[_0x257d91];return _0x2acf5c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xd65b('0x0'),_0xd65b('0x1'),_0xd65b('0x2'),'keyValue',_0xd65b('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd65b('0x4')]},'key':{'type':Sequelize[_0xd65b('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xd65b('0x0'),'variable',_0xd65b('0x2'))},'keyContent':{'type':Sequelize[_0xd65b('0x4')]},'idField':{'type':Sequelize[_0xd65b('0x4')]},'nameField':{'type':Sequelize[_0xd65b('0x4')]},'customField':{'type':Sequelize[_0xd65b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3a7a730..acf005e 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 _0xc7fc=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','eml-format','rimraf'];(function(_0x4776ba,_0x250658){var _0x354c17=function(_0x42b420){while(--_0x42b420){_0x4776ba['push'](_0x4776ba['shift']());}};_0x354c17(++_0x250658);}(_0xc7fc,0xe5));var _0xcc7f=function(_0x4de702,_0x75c15a){_0x4de702=_0x4de702-0x0;var _0x4f0379=_0xc7fc[_0x4de702];return _0x4f0379;};'use strict';var emlformat=require(_0xcc7f('0x0'));var rimraf=require(_0xcc7f('0x1'));var zipdir=require(_0xcc7f('0x2'));var jsonpatch=require(_0xcc7f('0x3'));var rp=require(_0xcc7f('0x4'));var moment=require(_0xcc7f('0x5'));var BPromise=require(_0xcc7f('0x6'));var Mustache=require(_0xcc7f('0x7'));var util=require(_0xcc7f('0x8'));var path=require('path');var sox=require(_0xcc7f('0x9'));var csv=require('to-csv');var ejs=require(_0xcc7f('0xa'));var fs=require('fs');var fs_extra=require(_0xcc7f('0xb'));var _=require(_0xcc7f('0xc'));var squel=require(_0xcc7f('0xd'));var crypto=require(_0xcc7f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcc7f('0xf'));var Papa=require(_0xcc7f('0x10'));var Redis=require('ioredis');var authService=require(_0xcc7f('0x11'));var qs=require(_0xcc7f('0x12'));var as=require(_0xcc7f('0x13'));var hardwareService=require(_0xcc7f('0x14'));var logger=require(_0xcc7f('0x15'))('api');var utils=require(_0xcc7f('0x16'));var config=require(_0xcc7f('0x17'));var licenseUtil=require(_0xcc7f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43728b,_0x41b5d2){_0x41b5d2=_0x41b5d2||0xcc;return function(_0x5c3c38){if(_0x5c3c38){return _0x43728b[_0xcc7f('0x19')](_0x41b5d2);}return _0x43728b[_0xcc7f('0x1a')](_0x41b5d2)[_0xcc7f('0x1b')]();};}function respondWithResult(_0x2277d4,_0x55ada3){_0x55ada3=_0x55ada3||0xc8;return function(_0x4a9d7f){if(_0x4a9d7f){return _0x2277d4['status'](_0x55ada3)[_0xcc7f('0x1c')](_0x4a9d7f);}};}function respondWithFilteredResult(_0x399c8a,_0xefa159){return function(_0x514dfd){if(_0x514dfd){var _0x18a2dc=typeof _0xefa159[_0xcc7f('0x1d')]===_0xcc7f('0x1e')&&typeof _0xefa159[_0xcc7f('0x1f')]===_0xcc7f('0x1e');var _0x181225=_0x514dfd[_0xcc7f('0x20')];var _0x4cb862=_0x18a2dc?0x0:_0xefa159[_0xcc7f('0x1d')];var _0x19bfd1=_0x18a2dc?_0x514dfd[_0xcc7f('0x20')]:_0xefa159[_0xcc7f('0x1d')]+_0xefa159['limit'];var _0x537b2f;if(_0x19bfd1>=_0x181225){_0x19bfd1=_0x181225;_0x537b2f=0xc8;}else{_0x537b2f=0xce;}_0x399c8a[_0xcc7f('0x1a')](_0x537b2f);return _0x399c8a[_0xcc7f('0x21')](_0xcc7f('0x22'),_0x4cb862+'-'+_0x19bfd1+'/'+_0x181225)[_0xcc7f('0x1c')](_0x514dfd);}return null;};}function patchUpdates(_0x2d0593){return function(_0xc743a9){try{jsonpatch['apply'](_0xc743a9,_0x2d0593,!![]);}catch(_0x20d03d){return BPromise['reject'](_0x20d03d);}return _0xc743a9[_0xcc7f('0x23')]();};}function saveUpdates(_0x2b6e35,_0x3fcd98){return function(_0x65bc66){if(_0x65bc66){return _0x65bc66[_0xcc7f('0x24')](_0x2b6e35)[_0xcc7f('0x25')](function(_0x4fd413){return _0x4fd413;});}return null;};}function removeEntity(_0x5cab04,_0x5e28b6){return function(_0x1c5334){if(_0x1c5334){return _0x1c5334[_0xcc7f('0x26')]()['then'](function(){_0x5cab04[_0xcc7f('0x1a')](0xcc)[_0xcc7f('0x1b')]();});}};}function handleEntityNotFound(_0x4d8042,_0xce3dbd){return function(_0x3cda05){if(!_0x3cda05){_0x4d8042[_0xcc7f('0x19')](0x194);}return _0x3cda05;};}function handleError(_0x1086a0,_0x388279){_0x388279=_0x388279||0x1f4;return function(_0x3c1e8e){logger[_0xcc7f('0x27')](_0x3c1e8e[_0xcc7f('0x28')]);if(_0x3c1e8e[_0xcc7f('0x29')]){delete _0x3c1e8e['name'];}_0x1086a0[_0xcc7f('0x1a')](_0x388279)[_0xcc7f('0x2a')](_0x3c1e8e);};}exports[_0xcc7f('0x2b')]=function(_0x3774d5,_0x3f7d06){var _0x917d51={},_0x50b3e0={},_0x15e9ae={'count':0x0,'rows':[]};var _0x245038=_[_0xcc7f('0x2c')](db[_0xcc7f('0x2d')]['rawAttributes'],function(_0x50eced){return{'name':_0x50eced[_0xcc7f('0x2e')],'type':_0x50eced[_0xcc7f('0x2f')][_0xcc7f('0x30')]};});_0x50b3e0[_0xcc7f('0x31')]=_[_0xcc7f('0x2c')](_0x245038,_0xcc7f('0x29'));_0x50b3e0[_0xcc7f('0x32')]=_['keys'](_0x3774d5[_0xcc7f('0x32')]);_0x50b3e0['filters']=_['intersection'](_0x50b3e0[_0xcc7f('0x31')],_0x50b3e0[_0xcc7f('0x32')]);_0x917d51[_0xcc7f('0x33')]=_[_0xcc7f('0x34')](_0x50b3e0[_0xcc7f('0x31')],qs[_0xcc7f('0x35')](_0x3774d5[_0xcc7f('0x32')][_0xcc7f('0x35')]));_0x917d51['attributes']=_0x917d51[_0xcc7f('0x33')][_0xcc7f('0x36')]?_0x917d51['attributes']:_0x50b3e0[_0xcc7f('0x31')];if(!_0x3774d5['query'][_0xcc7f('0x37')]('nolimit')){_0x917d51[_0xcc7f('0x1f')]=qs[_0xcc7f('0x1f')](_0x3774d5[_0xcc7f('0x32')][_0xcc7f('0x1f')]);_0x917d51[_0xcc7f('0x1d')]=qs[_0xcc7f('0x1d')](_0x3774d5[_0xcc7f('0x32')][_0xcc7f('0x1d')]);}_0x917d51[_0xcc7f('0x38')]=qs[_0xcc7f('0x39')](_0x3774d5['query'][_0xcc7f('0x39')]);_0x917d51[_0xcc7f('0x3a')]=qs[_0xcc7f('0x3b')](_[_0xcc7f('0x3c')](_0x3774d5['query'],_0x50b3e0['filters']),_0x245038);if(_0x3774d5[_0xcc7f('0x32')][_0xcc7f('0x3d')]){_0x917d51[_0xcc7f('0x3a')]=_[_0xcc7f('0x3e')](_0x917d51[_0xcc7f('0x3a')],{'$or':_[_0xcc7f('0x2c')](_0x245038,function(_0x1ad5f5){if(_0x1ad5f5[_0xcc7f('0x2f')]!==_0xcc7f('0x3f')){var _0x73c451={};_0x73c451[_0x1ad5f5[_0xcc7f('0x29')]]={'$like':'%'+_0x3774d5['query']['filter']+'%'};return _0x73c451;}})});}_0x917d51=_[_0xcc7f('0x3e')]({},_0x917d51,_0x3774d5[_0xcc7f('0x40')]);var _0x150377={'where':_0x917d51[_0xcc7f('0x3a')]};return db[_0xcc7f('0x2d')]['count'](_0x150377)[_0xcc7f('0x25')](function(_0x467de5){_0x15e9ae['count']=_0x467de5;if(_0x3774d5['query'][_0xcc7f('0x41')]){_0x917d51[_0xcc7f('0x42')]=[{'all':!![]}];}return db[_0xcc7f('0x2d')][_0xcc7f('0x43')](_0x917d51);})[_0xcc7f('0x25')](function(_0x307452){_0x15e9ae[_0xcc7f('0x44')]=_0x307452;return _0x15e9ae;})[_0xcc7f('0x25')](respondWithFilteredResult(_0x3f7d06,_0x917d51))[_0xcc7f('0x45')](handleError(_0x3f7d06,null));};exports[_0xcc7f('0x46')]=function(_0x1aba24,_0x1ac955){var _0x39fb0f={'raw':!![],'where':{'id':_0x1aba24[_0xcc7f('0x47')]['id']}},_0x12f7a3={};_0x12f7a3[_0xcc7f('0x31')]=_[_0xcc7f('0x48')](db[_0xcc7f('0x2d')][_0xcc7f('0x49')]);_0x12f7a3[_0xcc7f('0x32')]=_[_0xcc7f('0x48')](_0x1aba24[_0xcc7f('0x32')]);_0x12f7a3[_0xcc7f('0x3b')]=_[_0xcc7f('0x34')](_0x12f7a3[_0xcc7f('0x31')],_0x12f7a3[_0xcc7f('0x32')]);_0x39fb0f[_0xcc7f('0x33')]=_[_0xcc7f('0x34')](_0x12f7a3[_0xcc7f('0x31')],qs[_0xcc7f('0x35')](_0x1aba24['query'][_0xcc7f('0x35')]));_0x39fb0f[_0xcc7f('0x33')]=_0x39fb0f[_0xcc7f('0x33')]['length']?_0x39fb0f[_0xcc7f('0x33')]:_0x12f7a3[_0xcc7f('0x31')];if(_0x1aba24[_0xcc7f('0x32')][_0xcc7f('0x41')]){_0x39fb0f[_0xcc7f('0x42')]=[{'all':!![]}];}_0x39fb0f=_[_0xcc7f('0x3e')]({},_0x39fb0f,_0x1aba24[_0xcc7f('0x40')]);return db[_0xcc7f('0x2d')][_0xcc7f('0x4a')](_0x39fb0f)[_0xcc7f('0x25')](handleEntityNotFound(_0x1ac955,null))['then'](respondWithResult(_0x1ac955,null))[_0xcc7f('0x45')](handleError(_0x1ac955,null));};exports[_0xcc7f('0x4b')]=function(_0x5492a5,_0x11a94b){return db[_0xcc7f('0x2d')][_0xcc7f('0x4b')](_0x5492a5[_0xcc7f('0x4c')],{})['then'](respondWithResult(_0x11a94b,0xc9))[_0xcc7f('0x45')](handleError(_0x11a94b,null));};exports[_0xcc7f('0x24')]=function(_0x5e7082,_0x4e9d88){if(_0x5e7082[_0xcc7f('0x4c')]['id']){delete _0x5e7082[_0xcc7f('0x4c')]['id'];}return db[_0xcc7f('0x2d')][_0xcc7f('0x4a')]({'where':{'id':_0x5e7082[_0xcc7f('0x47')]['id']}})[_0xcc7f('0x25')](handleEntityNotFound(_0x4e9d88,null))[_0xcc7f('0x25')](saveUpdates(_0x5e7082[_0xcc7f('0x4c')],null))['then'](respondWithResult(_0x4e9d88,null))[_0xcc7f('0x45')](handleError(_0x4e9d88,null));};exports[_0xcc7f('0x26')]=function(_0xeda4cb,_0x460742){return db[_0xcc7f('0x2d')][_0xcc7f('0x4a')]({'where':{'id':_0xeda4cb['params']['id']}})[_0xcc7f('0x25')](handleEntityNotFound(_0x460742,null))[_0xcc7f('0x25')](removeEntity(_0x460742,null))[_0xcc7f('0x45')](handleError(_0x460742,null));}; \ No newline at end of file +var _0xcb39=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','rows','show','params','options','find','catch','create','body','destroy'];(function(_0x55796b,_0x1ac546){var _0x1cb038=function(_0x59e366){while(--_0x59e366){_0x55796b['push'](_0x55796b['shift']());}};_0x1cb038(++_0x1ac546);}(_0xcb39,0x1f1));var _0x9cb3=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0xcb39[_0x5b47d9];return _0x4151f0;};'use strict';var emlformat=require(_0x9cb3('0x0'));var rimraf=require(_0x9cb3('0x1'));var zipdir=require(_0x9cb3('0x2'));var jsonpatch=require(_0x9cb3('0x3'));var rp=require(_0x9cb3('0x4'));var moment=require(_0x9cb3('0x5'));var BPromise=require(_0x9cb3('0x6'));var Mustache=require(_0x9cb3('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9cb3('0x8'));var ejs=require(_0x9cb3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9cb3('0xa'));var deskjs=require(_0x9cb3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9cb3('0xc'));var Papa=require(_0x9cb3('0xd'));var Redis=require(_0x9cb3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9cb3('0xf'));var as=require(_0x9cb3('0x10'));var hardwareService=require(_0x9cb3('0x11'));var logger=require(_0x9cb3('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9cb3('0x13'));var licenseUtil=require(_0x9cb3('0x14'));var db=require(_0x9cb3('0x15'))['db'];function respondWithStatusCode(_0xe8de90,_0x35fd77){_0x35fd77=_0x35fd77||0xcc;return function(_0x1724bf){if(_0x1724bf){return _0xe8de90[_0x9cb3('0x16')](_0x35fd77);}return _0xe8de90[_0x9cb3('0x17')](_0x35fd77)[_0x9cb3('0x18')]();};}function respondWithResult(_0x2d57fd,_0x3336ce){_0x3336ce=_0x3336ce||0xc8;return function(_0x547707){if(_0x547707){return _0x2d57fd[_0x9cb3('0x17')](_0x3336ce)[_0x9cb3('0x19')](_0x547707);}};}function respondWithFilteredResult(_0x5c6b36,_0x1a49ea){return function(_0x38414f){if(_0x38414f){var _0x5d0cd1=typeof _0x1a49ea[_0x9cb3('0x1a')]===_0x9cb3('0x1b')&&typeof _0x1a49ea[_0x9cb3('0x1c')]===_0x9cb3('0x1b');var _0x15d657=_0x38414f[_0x9cb3('0x1d')];var _0x53edfc=_0x5d0cd1?0x0:_0x1a49ea['offset'];var _0xff7d34=_0x5d0cd1?_0x38414f[_0x9cb3('0x1d')]:_0x1a49ea[_0x9cb3('0x1a')]+_0x1a49ea[_0x9cb3('0x1c')];var _0x295ccd;if(_0xff7d34>=_0x15d657){_0xff7d34=_0x15d657;_0x295ccd=0xc8;}else{_0x295ccd=0xce;}_0x5c6b36[_0x9cb3('0x17')](_0x295ccd);return _0x5c6b36[_0x9cb3('0x1e')](_0x9cb3('0x1f'),_0x53edfc+'-'+_0xff7d34+'/'+_0x15d657)[_0x9cb3('0x19')](_0x38414f);}return null;};}function patchUpdates(_0x43c17f){return function(_0x1dd809){try{jsonpatch['apply'](_0x1dd809,_0x43c17f,!![]);}catch(_0x453e5f){return BPromise[_0x9cb3('0x20')](_0x453e5f);}return _0x1dd809[_0x9cb3('0x21')]();};}function saveUpdates(_0x3f5208,_0x3ef825){return function(_0x258d12){if(_0x258d12){return _0x258d12[_0x9cb3('0x22')](_0x3f5208)[_0x9cb3('0x23')](function(_0x22ddb9){return _0x22ddb9;});}return null;};}function removeEntity(_0x9c391f,_0x2ac425){return function(_0x3bed23){if(_0x3bed23){return _0x3bed23['destroy']()['then'](function(){_0x9c391f['status'](0xcc)[_0x9cb3('0x18')]();});}};}function handleEntityNotFound(_0x4dfba6,_0x3f56db){return function(_0x9e76d9){if(!_0x9e76d9){_0x4dfba6['sendStatus'](0x194);}return _0x9e76d9;};}function handleError(_0x31de89,_0x2448c4){_0x2448c4=_0x2448c4||0x1f4;return function(_0x513c1b){logger[_0x9cb3('0x24')](_0x513c1b[_0x9cb3('0x25')]);if(_0x513c1b[_0x9cb3('0x26')]){delete _0x513c1b[_0x9cb3('0x26')];}_0x31de89[_0x9cb3('0x17')](_0x2448c4)[_0x9cb3('0x27')](_0x513c1b);};}exports[_0x9cb3('0x28')]=function(_0xbea1a1,_0x9c43ec){var _0x10f2ad={},_0xe79261={},_0x2d5a6c={'count':0x0,'rows':[]};var _0xeb23e7=_[_0x9cb3('0x29')](db[_0x9cb3('0x2a')][_0x9cb3('0x2b')],function(_0x1bfc15){return{'name':_0x1bfc15[_0x9cb3('0x2c')],'type':_0x1bfc15['type']['key']};});_0xe79261[_0x9cb3('0x2d')]=_[_0x9cb3('0x29')](_0xeb23e7,_0x9cb3('0x26'));_0xe79261['query']=_[_0x9cb3('0x2e')](_0xbea1a1[_0x9cb3('0x2f')]);_0xe79261[_0x9cb3('0x30')]=_[_0x9cb3('0x31')](_0xe79261[_0x9cb3('0x2d')],_0xe79261[_0x9cb3('0x2f')]);_0x10f2ad[_0x9cb3('0x32')]=_['intersection'](_0xe79261[_0x9cb3('0x2d')],qs[_0x9cb3('0x33')](_0xbea1a1['query']['fields']));_0x10f2ad[_0x9cb3('0x32')]=_0x10f2ad[_0x9cb3('0x32')][_0x9cb3('0x34')]?_0x10f2ad[_0x9cb3('0x32')]:_0xe79261['model'];if(!_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x35')]('nolimit')){_0x10f2ad[_0x9cb3('0x1c')]=qs[_0x9cb3('0x1c')](_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x1c')]);_0x10f2ad[_0x9cb3('0x1a')]=qs['offset'](_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x1a')]);}_0x10f2ad[_0x9cb3('0x36')]=qs['sort'](_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x37')]);_0x10f2ad[_0x9cb3('0x38')]=qs[_0x9cb3('0x30')](_[_0x9cb3('0x39')](_0xbea1a1['query'],_0xe79261['filters']),_0xeb23e7);if(_0xbea1a1['query'][_0x9cb3('0x3a')]){_0x10f2ad['where']=_[_0x9cb3('0x3b')](_0x10f2ad[_0x9cb3('0x38')],{'$or':_[_0x9cb3('0x29')](_0xeb23e7,function(_0xa056c){if(_0xa056c['type']!=='VIRTUAL'){var _0x5a7459={};_0x5a7459[_0xa056c[_0x9cb3('0x26')]]={'$like':'%'+_0xbea1a1[_0x9cb3('0x2f')]['filter']+'%'};return _0x5a7459;}})});}_0x10f2ad=_['merge']({},_0x10f2ad,_0xbea1a1['options']);var _0x934462={'where':_0x10f2ad['where']};return db[_0x9cb3('0x2a')][_0x9cb3('0x1d')](_0x934462)['then'](function(_0x2920a0){_0x2d5a6c[_0x9cb3('0x1d')]=_0x2920a0;if(_0xbea1a1[_0x9cb3('0x2f')][_0x9cb3('0x3c')]){_0x10f2ad[_0x9cb3('0x3d')]=[{'all':!![]}];}return db[_0x9cb3('0x2a')]['findAll'](_0x10f2ad);})[_0x9cb3('0x23')](function(_0x3cad57){_0x2d5a6c[_0x9cb3('0x3e')]=_0x3cad57;return _0x2d5a6c;})[_0x9cb3('0x23')](respondWithFilteredResult(_0x9c43ec,_0x10f2ad))['catch'](handleError(_0x9c43ec,null));};exports[_0x9cb3('0x3f')]=function(_0x2f68a6,_0x48a35f){var _0x23b3f4={'raw':!![],'where':{'id':_0x2f68a6[_0x9cb3('0x40')]['id']}},_0x5b0919={};_0x5b0919['model']=_[_0x9cb3('0x2e')](db[_0x9cb3('0x2a')][_0x9cb3('0x2b')]);_0x5b0919[_0x9cb3('0x2f')]=_['keys'](_0x2f68a6[_0x9cb3('0x2f')]);_0x5b0919['filters']=_['intersection'](_0x5b0919[_0x9cb3('0x2d')],_0x5b0919[_0x9cb3('0x2f')]);_0x23b3f4[_0x9cb3('0x32')]=_['intersection'](_0x5b0919[_0x9cb3('0x2d')],qs[_0x9cb3('0x33')](_0x2f68a6[_0x9cb3('0x2f')]['fields']));_0x23b3f4['attributes']=_0x23b3f4['attributes']['length']?_0x23b3f4['attributes']:_0x5b0919[_0x9cb3('0x2d')];if(_0x2f68a6[_0x9cb3('0x2f')][_0x9cb3('0x3c')]){_0x23b3f4[_0x9cb3('0x3d')]=[{'all':!![]}];}_0x23b3f4=_['merge']({},_0x23b3f4,_0x2f68a6[_0x9cb3('0x41')]);return db[_0x9cb3('0x2a')][_0x9cb3('0x42')](_0x23b3f4)[_0x9cb3('0x23')](handleEntityNotFound(_0x48a35f,null))[_0x9cb3('0x23')](respondWithResult(_0x48a35f,null))[_0x9cb3('0x43')](handleError(_0x48a35f,null));};exports[_0x9cb3('0x44')]=function(_0x220d2b,_0x10f8b9){return db[_0x9cb3('0x2a')][_0x9cb3('0x44')](_0x220d2b[_0x9cb3('0x45')],{})['then'](respondWithResult(_0x10f8b9,0xc9))[_0x9cb3('0x43')](handleError(_0x10f8b9,null));};exports[_0x9cb3('0x22')]=function(_0x33636d,_0x3bbbf6){if(_0x33636d['body']['id']){delete _0x33636d[_0x9cb3('0x45')]['id'];}return db[_0x9cb3('0x2a')][_0x9cb3('0x42')]({'where':{'id':_0x33636d[_0x9cb3('0x40')]['id']}})[_0x9cb3('0x23')](handleEntityNotFound(_0x3bbbf6,null))[_0x9cb3('0x23')](saveUpdates(_0x33636d[_0x9cb3('0x45')],null))['then'](respondWithResult(_0x3bbbf6,null))[_0x9cb3('0x43')](handleError(_0x3bbbf6,null));};exports[_0x9cb3('0x46')]=function(_0x17301a,_0x84e251){return db[_0x9cb3('0x2a')][_0x9cb3('0x42')]({'where':{'id':_0x17301a['params']['id']}})['then'](handleEntityNotFound(_0x84e251,null))[_0x9cb3('0x23')](removeEntity(_0x84e251,null))['catch'](handleError(_0x84e251,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 830ba59..543ceee 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 _0xc5a2=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x40cd61,_0x36162c){var _0x120ce8=function(_0x59c7cc){while(--_0x59c7cc){_0x40cd61['push'](_0x40cd61['shift']());}};_0x120ce8(++_0x36162c);}(_0xc5a2,0xf3));var _0x2c5a=function(_0x3ff76c,_0x925dc1){_0x3ff76c=_0x3ff76c-0x0;var _0x5b4121=_0xc5a2[_0x3ff76c];return _0x5b4121;};'use strict';var _=require(_0x2c5a('0x0'));var util=require(_0x2c5a('0x1'));var logger=require(_0x2c5a('0x2'))('api');var moment=require(_0x2c5a('0x3'));var BPromise=require('bluebird');var rp=require(_0x2c5a('0x4'));var fs=require('fs');var path=require(_0x2c5a('0x5'));var rimraf=require('rimraf');var config=require(_0x2c5a('0x6'));var attributes=require(_0x2c5a('0x7'));module[_0x2c5a('0x8')]=function(_0x512e92,_0x26d055){return _0x512e92['define'](_0x2c5a('0x9'),attributes,{'tableName':_0x2c5a('0xa'),'paranoid':![],'indexes':[{'name':_0x2c5a('0xb'),'fields':[_0x2c5a('0xc'),_0x2c5a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c05=['./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','bluebird','path','../../config/environment'];(function(_0xa5d69f,_0xf23994){var _0x41f9ff=function(_0xb01611){while(--_0xb01611){_0xa5d69f['push'](_0xa5d69f['shift']());}};_0x41f9ff(++_0xf23994);}(_0x6c05,0x73));var _0x56c0=function(_0x3e24b7,_0x54ec5d){_0x3e24b7=_0x3e24b7-0x0;var _0x601f2a=_0x6c05[_0x3e24b7];return _0x601f2a;};'use strict';var _=require(_0x56c0('0x0'));var util=require(_0x56c0('0x1'));var logger=require(_0x56c0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x56c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56c0('0x4'));var rimraf=require('rimraf');var config=require(_0x56c0('0x5'));var attributes=require(_0x56c0('0x6'));module['exports']=function(_0xec7b3b,_0x8dac62){return _0xec7b3b['define'](_0x56c0('0x7'),attributes,{'tableName':_0x56c0('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x56c0('0x9'),_0x56c0('0xa')],'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 d274fb1..76a9c8b 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 _0x034d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','bluebird','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x034d,0xb1));var _0xd034=function(_0x1393ff,_0x23ffbc){_0x1393ff=_0x1393ff-0x0;var _0x35baf3=_0x034d[_0x1393ff];return _0x35baf3;};'use strict';var _=require('lodash');var util=require(_0xd034('0x0'));var moment=require('moment');var BPromise=require(_0xd034('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd034('0x2'))['db'];var utils=require(_0xd034('0x3'));var logger=require(_0xd034('0x4'))(_0xd034('0x5'));var config=require(_0xd034('0x6'));var jayson=require(_0xd034('0x7'));var client=jayson[_0xd034('0x8')][_0xd034('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x414ee4,_0x5a90cf,_0x13c4d6){return new BPromise(function(_0x13678e,_0x50cec0){return client['request'](_0x414ee4,_0x13c4d6)[_0xd034('0xa')](function(_0x3dd82a){logger[_0xd034('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5a90cf,'request\x20sent');logger[_0xd034('0xc')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5a90cf,_0xd034('0xd'),JSON[_0xd034('0xe')](_0x3dd82a));if(_0x3dd82a['error']){if(_0x3dd82a[_0xd034('0xf')]['code']===0x1f4){logger[_0xd034('0xf')](_0xd034('0x10'),_0x5a90cf,_0x3dd82a[_0xd034('0xf')][_0xd034('0x11')]);return _0x50cec0(_0x3dd82a[_0xd034('0xf')][_0xd034('0x11')]);}logger[_0xd034('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x5a90cf,_0x3dd82a[_0xd034('0xf')][_0xd034('0x11')]);return _0x13678e(_0x3dd82a[_0xd034('0xf')]['message']);}else{logger[_0xd034('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5a90cf,_0xd034('0xd'));_0x13678e(_0x3dd82a[_0xd034('0x12')][_0xd034('0x11')]);}})[_0xd034('0x13')](function(_0x5c174a){logger[_0xd034('0xf')](_0xd034('0x10'),_0x5a90cf,_0x5c174a);_0x50cec0(_0x5c174a);});});} \ No newline at end of file +var _0x1ce8=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Dynamics365Field,\x20%s,\x20%s','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x1ce8,0x17a));var _0x81ce=function(_0x4687aa,_0x52ce79){_0x4687aa=_0x4687aa-0x0;var _0x129611=_0x1ce8[_0x4687aa];return _0x129611;};'use strict';var _=require('lodash');var util=require(_0x81ce('0x0'));var moment=require(_0x81ce('0x1'));var BPromise=require(_0x81ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81ce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x81ce('0x4'));var logger=require('../../config/logger')(_0x81ce('0x5'));var config=require(_0x81ce('0x6'));var jayson=require(_0x81ce('0x7'));var client=jayson[_0x81ce('0x8')][_0x81ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31f726,_0x2d522f,_0x34461a){return new BPromise(function(_0x447333,_0x3096e4){return client[_0x81ce('0xa')](_0x31f726,_0x34461a)[_0x81ce('0xb')](function(_0xff8418){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,_0x81ce('0xc'));logger[_0x81ce('0xd')](_0x81ce('0xe'),_0x2d522f,_0x81ce('0xc'),JSON[_0x81ce('0xf')](_0xff8418));if(_0xff8418[_0x81ce('0x10')]){if(_0xff8418[_0x81ce('0x10')][_0x81ce('0x11')]===0x1f4){logger[_0x81ce('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,_0xff8418[_0x81ce('0x10')][_0x81ce('0x12')]);return _0x3096e4(_0xff8418[_0x81ce('0x10')]['message']);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,_0xff8418['error'][_0x81ce('0x12')]);return _0x447333(_0xff8418[_0x81ce('0x10')][_0x81ce('0x12')]);}else{logger[_0x81ce('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x2d522f,'request\x20sent');_0x447333(_0xff8418[_0x81ce('0x14')]['message']);}})[_0x81ce('0x15')](function(_0x475ff0){logger[_0x81ce('0x10')](_0x81ce('0x16'),_0x2d522f,_0x475ff0);_0x3096e4(_0x475ff0);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b4c3220..e22279a 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 _0xaa95=['/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','/:id','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','getConfigurations'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xaa95,0x88));var _0x5aa9=function(_0x192ff0,_0x10d98f){_0x192ff0=_0x192ff0-0x0;var _0x4070b1=_0xaa95[_0x192ff0];return _0x4070b1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5aa9('0x0'));var timeout=require(_0x5aa9('0x1'));var express=require(_0x5aa9('0x2'));var router=express[_0x5aa9('0x3')]();var fs_extra=require(_0x5aa9('0x4'));var auth=require(_0x5aa9('0x5'));var interaction=require(_0x5aa9('0x6'));var config=require(_0x5aa9('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x5aa9('0x8')]('/',auth[_0x5aa9('0x9')](),controller['index']);router[_0x5aa9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5aa9('0x8')]('/:id/configurations',auth[_0x5aa9('0x9')](),controller[_0x5aa9('0xa')]);router[_0x5aa9('0x8')](_0x5aa9('0xb'),auth[_0x5aa9('0x9')](),controller[_0x5aa9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5aa9('0xd')]);router[_0x5aa9('0xe')](_0x5aa9('0xf'),auth[_0x5aa9('0x9')](),controller[_0x5aa9('0x10')]);router['put'](_0x5aa9('0x11'),auth[_0x5aa9('0x9')](),controller['update']);router[_0x5aa9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5aa9('0x13')]);module[_0x5aa9('0x14')]=router; \ No newline at end of file +var _0xc462=['getFields','post','create','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x2bbc6b,_0x292271){var _0x26f31a=function(_0x335c89){while(--_0x335c89){_0x2bbc6b['push'](_0x2bbc6b['shift']());}};_0x26f31a(++_0x292271);}(_0xc462,0x8b));var _0x2c46=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc462[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0x2c46('0x0'));var util=require('util');var path=require(_0x2c46('0x1'));var timeout=require(_0x2c46('0x2'));var express=require(_0x2c46('0x3'));var router=express[_0x2c46('0x4')]();var fs_extra=require(_0x2c46('0x5'));var auth=require(_0x2c46('0x6'));var interaction=require(_0x2c46('0x7'));var config=require(_0x2c46('0x8'));var controller=require(_0x2c46('0x9'));router[_0x2c46('0xa')]('/',auth[_0x2c46('0xb')](),controller[_0x2c46('0xc')]);router[_0x2c46('0xa')]('/:id',auth[_0x2c46('0xb')](),controller[_0x2c46('0xd')]);router['get'](_0x2c46('0xe'),auth[_0x2c46('0xb')](),controller['getConfigurations']);router[_0x2c46('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2c46('0xf')]);router[_0x2c46('0x10')]('/',auth[_0x2c46('0xb')](),controller[_0x2c46('0x11')]);router['post'](_0x2c46('0xe'),auth[_0x2c46('0xb')](),controller['addConfiguration']);router[_0x2c46('0x12')](_0x2c46('0x13'),auth[_0x2c46('0xb')](),controller['update']);router[_0x2c46('0x14')]('/:id',auth[_0x2c46('0xb')](),controller[_0x2c46('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index d6e27f7..0f7c1e9 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(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x5430,0x10c));var _0x0543=function(_0xee2057,_0x43dbcd){_0xee2057=_0xee2057-0x0;var _0x1d7d5e=_0x5430[_0xee2057];return _0x1d7d5e;};'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 _0x6343=['STRING','remoteUri'];(function(_0x1961e6,_0x1de8a9){var _0x537a34=function(_0x24975c){while(--_0x24975c){_0x1961e6['push'](_0x1961e6['shift']());}};_0x537a34(++_0x1de8a9);}(_0x6343,0x168));var _0x3634=function(_0x4b00ef,_0x360253){_0x4b00ef=_0x4b00ef-0x0;var _0x5994e8=_0x6343[_0x4b00ef];return _0x5994e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 0e1578c..3e2eed9 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 _0x2621=['sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','FreshdeskAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','create','body','find','destroy','getConfigurations','findOne','params','FreshdeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','default','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x2f31ea,_0x351d88){var _0x5b6a5d=function(_0xf990d6){while(--_0xf990d6){_0x2f31ea['push'](_0x2f31ea['shift']());}};_0x5b6a5d(++_0x351d88);}(_0x2621,0x1d2));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x1262('0x0'));var rimraf=require(_0x1262('0x1'));var zipdir=require(_0x1262('0x2'));var jsonpatch=require(_0x1262('0x3'));var rp=require(_0x1262('0x4'));var moment=require(_0x1262('0x5'));var BPromise=require(_0x1262('0x6'));var Mustache=require(_0x1262('0x7'));var util=require(_0x1262('0x8'));var path=require(_0x1262('0x9'));var sox=require(_0x1262('0xa'));var csv=require(_0x1262('0xb'));var ejs=require(_0x1262('0xc'));var fs=require('fs');var fs_extra=require(_0x1262('0xd'));var _=require('lodash');var squel=require(_0x1262('0xe'));var crypto=require('crypto');var jsforce=require(_0x1262('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1262('0xb'));var querystring=require(_0x1262('0x10'));var Papa=require(_0x1262('0x11'));var Redis=require('ioredis');var authService=require(_0x1262('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1262('0x13'));var hardwareService=require(_0x1262('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1262('0x15'));var config=require(_0x1262('0x16'));var licenseUtil=require(_0x1262('0x17'));var db=require(_0x1262('0x18'))['db'];var integrations=require(_0x1262('0x19'));function respondWithStatusCode(_0x278fdb,_0x4d90df){_0x4d90df=_0x4d90df||0xcc;return function(_0x384890){if(_0x384890){return _0x278fdb[_0x1262('0x1a')](_0x4d90df);}return _0x278fdb[_0x1262('0x1b')](_0x4d90df)['end']();};}function respondWithResult(_0x36b4ee,_0x3a66b0){_0x3a66b0=_0x3a66b0||0xc8;return function(_0x4bb535){if(_0x4bb535){return _0x36b4ee['status'](_0x3a66b0)[_0x1262('0x1c')](_0x4bb535);}};}function respondWithFilteredResult(_0x4435c7,_0x5a91b7){return function(_0x66e634){if(_0x66e634){var _0x520454=typeof _0x5a91b7[_0x1262('0x1d')]===_0x1262('0x1e')&&typeof _0x5a91b7[_0x1262('0x1f')]===_0x1262('0x1e');var _0x34129f=_0x66e634[_0x1262('0x20')];var _0x100d32=_0x520454?0x0:_0x5a91b7['offset'];var _0x504bd8=_0x520454?_0x66e634['count']:_0x5a91b7[_0x1262('0x1d')]+_0x5a91b7[_0x1262('0x1f')];var _0x4b39ce;if(_0x504bd8>=_0x34129f){_0x504bd8=_0x34129f;_0x4b39ce=0xc8;}else{_0x4b39ce=0xce;}_0x4435c7['status'](_0x4b39ce);return _0x4435c7[_0x1262('0x21')](_0x1262('0x22'),_0x100d32+'-'+_0x504bd8+'/'+_0x34129f)['json'](_0x66e634);}return null;};}function patchUpdates(_0x2e7e16){return function(_0x1a0bd4){try{jsonpatch[_0x1262('0x23')](_0x1a0bd4,_0x2e7e16,!![]);}catch(_0x569359){return BPromise['reject'](_0x569359);}return _0x1a0bd4[_0x1262('0x24')]();};}function saveUpdates(_0x5b3e00,_0x4db04d){return function(_0x49fad7){if(_0x49fad7){return _0x49fad7[_0x1262('0x25')](_0x5b3e00)['then'](function(_0x5a8279){return _0x5a8279;});}return null;};}function removeEntity(_0x2aa124,_0x386b91){return function(_0x5b6786){if(_0x5b6786){return _0x5b6786['destroy']()[_0x1262('0x26')](function(){_0x2aa124['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x343bd1,_0x4e285e){return function(_0x188427){if(!_0x188427){_0x343bd1[_0x1262('0x1a')](0x194);}return _0x188427;};}function handleError(_0x167db1,_0xac1fb6){_0xac1fb6=_0xac1fb6||0x1f4;return function(_0x26af44){logger[_0x1262('0x27')](_0x26af44[_0x1262('0x28')]);if(_0x26af44[_0x1262('0x29')]){delete _0x26af44[_0x1262('0x29')];}_0x167db1[_0x1262('0x1b')](_0xac1fb6)[_0x1262('0x2a')](_0x26af44);};}exports[_0x1262('0x2b')]=function(_0x2174a7,_0x3116c4){var _0xef4120={},_0x49adef={},_0x2952d4={'count':0x0,'rows':[]};var _0x179b32=_['map'](db[_0x1262('0x2c')]['rawAttributes'],function(_0x17f972){return{'name':_0x17f972[_0x1262('0x2d')],'type':_0x17f972[_0x1262('0x2e')][_0x1262('0x2f')]};});_0x49adef[_0x1262('0x30')]=_[_0x1262('0x31')](_0x179b32,_0x1262('0x29'));_0x49adef[_0x1262('0x32')]=_[_0x1262('0x33')](_0x2174a7['query']);_0x49adef[_0x1262('0x34')]=_[_0x1262('0x35')](_0x49adef['model'],_0x49adef[_0x1262('0x32')]);_0xef4120[_0x1262('0x36')]=_[_0x1262('0x35')](_0x49adef[_0x1262('0x30')],qs['fields'](_0x2174a7[_0x1262('0x32')][_0x1262('0x37')]));_0xef4120[_0x1262('0x36')]=_0xef4120['attributes'][_0x1262('0x38')]?_0xef4120['attributes']:_0x49adef['model'];if(!_0x2174a7['query'][_0x1262('0x39')](_0x1262('0x3a'))){_0xef4120[_0x1262('0x1f')]=qs['limit'](_0x2174a7['query'][_0x1262('0x1f')]);_0xef4120[_0x1262('0x1d')]=qs[_0x1262('0x1d')](_0x2174a7[_0x1262('0x32')][_0x1262('0x1d')]);}_0xef4120[_0x1262('0x3b')]=qs[_0x1262('0x3c')](_0x2174a7[_0x1262('0x32')]['sort']);_0xef4120['where']=qs[_0x1262('0x34')](_[_0x1262('0x3d')](_0x2174a7[_0x1262('0x32')],_0x49adef['filters']),_0x179b32);if(_0x2174a7[_0x1262('0x32')]['filter']){_0xef4120[_0x1262('0x3e')]=_['merge'](_0xef4120['where'],{'$or':_['map'](_0x179b32,function(_0x4736cc){if(_0x4736cc[_0x1262('0x2e')]!=='VIRTUAL'){var _0x42625d={};_0x42625d[_0x4736cc['name']]={'$like':'%'+_0x2174a7[_0x1262('0x32')][_0x1262('0x3f')]+'%'};return _0x42625d;}})});}_0xef4120=_['merge']({},_0xef4120,_0x2174a7[_0x1262('0x40')]);var _0x5ba952={'where':_0xef4120[_0x1262('0x3e')]};return db[_0x1262('0x2c')][_0x1262('0x20')](_0x5ba952)['then'](function(_0x5eaa10){_0x2952d4['count']=_0x5eaa10;if(_0x2174a7[_0x1262('0x32')][_0x1262('0x41')]){_0xef4120[_0x1262('0x42')]=[{'all':!![]}];}return db[_0x1262('0x2c')][_0x1262('0x43')](_0xef4120);})[_0x1262('0x26')](function(_0x20efec){_0x2952d4[_0x1262('0x44')]=_0x20efec;return _0x2952d4;})[_0x1262('0x26')](respondWithFilteredResult(_0x3116c4,_0xef4120))[_0x1262('0x45')](handleError(_0x3116c4,null));};exports[_0x1262('0x46')]=function(_0x3732dd,_0x2322fa){var _0x541e56={'raw':![],'where':{'id':_0x3732dd['params']['id']}},_0x5a0e49={};_0x5a0e49['model']=_['keys'](db['FreshdeskAccount'][_0x1262('0x47')]);_0x5a0e49[_0x1262('0x32')]=_['keys'](_0x3732dd['query']);_0x5a0e49[_0x1262('0x34')]=_[_0x1262('0x35')](_0x5a0e49[_0x1262('0x30')],_0x5a0e49['query']);_0x541e56[_0x1262('0x36')]=_[_0x1262('0x35')](_0x5a0e49[_0x1262('0x30')],qs[_0x1262('0x37')](_0x3732dd[_0x1262('0x32')][_0x1262('0x37')]));_0x541e56[_0x1262('0x36')]=_0x541e56['attributes'][_0x1262('0x38')]?_0x541e56[_0x1262('0x36')]:_0x5a0e49[_0x1262('0x30')];if(_0x3732dd[_0x1262('0x32')][_0x1262('0x41')]){_0x541e56[_0x1262('0x42')]=[{'all':!![]}];}_0x541e56=_[_0x1262('0x48')]({},_0x541e56,_0x3732dd[_0x1262('0x40')]);return db[_0x1262('0x2c')]['find'](_0x541e56)[_0x1262('0x26')](handleEntityNotFound(_0x2322fa,null))[_0x1262('0x26')](respondWithResult(_0x2322fa,null))[_0x1262('0x45')](handleError(_0x2322fa,null));};exports[_0x1262('0x49')]=function(_0x3a232c,_0x24185b){return db['FreshdeskAccount']['create'](_0x3a232c['body'],{})[_0x1262('0x26')](respondWithResult(_0x24185b,0xc9))[_0x1262('0x45')](handleError(_0x24185b,null));};exports[_0x1262('0x25')]=function(_0x61deec,_0x3079c2){if(_0x61deec[_0x1262('0x4a')]['id']){delete _0x61deec[_0x1262('0x4a')]['id'];}return db[_0x1262('0x2c')][_0x1262('0x4b')]({'where':{'id':_0x61deec['params']['id']}})[_0x1262('0x26')](handleEntityNotFound(_0x3079c2,null))[_0x1262('0x26')](saveUpdates(_0x61deec['body'],null))[_0x1262('0x26')](respondWithResult(_0x3079c2,null))[_0x1262('0x45')](handleError(_0x3079c2,null));};exports[_0x1262('0x4c')]=function(_0x3ed8ec,_0xa819c6){return db[_0x1262('0x2c')]['find']({'where':{'id':_0x3ed8ec['params']['id']}})[_0x1262('0x26')](handleEntityNotFound(_0xa819c6,null))['then'](removeEntity(_0xa819c6,null))[_0x1262('0x45')](handleError(_0xa819c6,null));};exports[_0x1262('0x4d')]=function(_0x4c57f9,_0x22f060,_0x61037a){var _0x43faae={};var _0x1a4095={};var _0x257a90;var _0x166cd0;return db[_0x1262('0x2c')][_0x1262('0x4e')]({'where':{'id':_0x4c57f9[_0x1262('0x4f')]['id']}})[_0x1262('0x26')](handleEntityNotFound(_0x22f060,null))[_0x1262('0x26')](function(_0x871365){if(_0x871365){_0x257a90=_0x871365;_0x1a4095[_0x1262('0x30')]=_[_0x1262('0x33')](db[_0x1262('0x50')]['rawAttributes']);_0x1a4095[_0x1262('0x32')]=_['keys'](_0x4c57f9['query']);_0x1a4095[_0x1262('0x34')]=_[_0x1262('0x35')](_0x1a4095[_0x1262('0x30')],_0x1a4095[_0x1262('0x32')]);_0x43faae['attributes']=_['intersection'](_0x1a4095[_0x1262('0x30')],qs[_0x1262('0x37')](_0x4c57f9[_0x1262('0x32')][_0x1262('0x37')]));_0x43faae[_0x1262('0x36')]=_0x43faae['attributes'][_0x1262('0x38')]?_0x43faae[_0x1262('0x36')]:_0x1a4095[_0x1262('0x30')];_0x43faae[_0x1262('0x3b')]=qs[_0x1262('0x3c')](_0x4c57f9[_0x1262('0x32')][_0x1262('0x3c')]);_0x43faae[_0x1262('0x3e')]=qs[_0x1262('0x34')](_[_0x1262('0x3d')](_0x4c57f9['query'],_0x1a4095[_0x1262('0x34')]));if(_0x4c57f9[_0x1262('0x32')][_0x1262('0x3f')]){_0x43faae[_0x1262('0x3e')]=_['merge'](_0x43faae[_0x1262('0x3e')],{'$or':_[_0x1262('0x31')](_0x43faae[_0x1262('0x36')],function(_0x370cb6){var _0x47a286={};_0x47a286[_0x370cb6]={'$like':'%'+_0x4c57f9[_0x1262('0x32')]['filter']+'%'};return _0x47a286;})});}_0x43faae=_[_0x1262('0x48')]({},_0x43faae,_0x4c57f9[_0x1262('0x40')]);return _0x257a90[_0x1262('0x4d')](_0x43faae);}})['then'](function(_0xa27e08){if(_0xa27e08){_0x166cd0=_0xa27e08[_0x1262('0x38')];if(!_0x4c57f9['query'][_0x1262('0x39')]('nolimit')){_0x43faae[_0x1262('0x1f')]=qs['limit'](_0x4c57f9[_0x1262('0x32')][_0x1262('0x1f')]);_0x43faae[_0x1262('0x1d')]=qs[_0x1262('0x1d')](_0x4c57f9[_0x1262('0x32')][_0x1262('0x1d')]);}return _0x257a90[_0x1262('0x4d')](_0x43faae);}})[_0x1262('0x26')](function(_0x342947){if(_0x342947){return _0x342947?{'count':_0x166cd0,'rows':_0x342947}:null;}})['then'](respondWithResult(_0x22f060,null))[_0x1262('0x45')](handleError(_0x22f060,null));};exports[_0x1262('0x51')]=function(_0x1abe43,_0x2da316,_0x5ef3a8){if(_0x1abe43[_0x1262('0x4a')]['id']){delete _0x1abe43[_0x1262('0x4a')]['id'];}return db[_0x1262('0x2c')][_0x1262('0x4e')]({'where':{'id':_0x1abe43[_0x1262('0x4f')]['id']}})[_0x1262('0x26')](handleEntityNotFound(_0x2da316,null))['then'](function(_0x41ba5d){if(_0x41ba5d){_0x1abe43['body']['AccountId']=_0x41ba5d['id'];_0x1abe43[_0x1262('0x4a')][_0x1262('0x52')]=integrations[_0x1262('0x53')](_0x1abe43[_0x1262('0x4a')][_0x1262('0x54')],_0x1abe43[_0x1262('0x4a')][_0x1262('0x2e')]);_0x1abe43[_0x1262('0x4a')][_0x1262('0x55')]=integrations[_0x1262('0x56')](_0x1abe43['body'][_0x1262('0x54')],_0x1abe43[_0x1262('0x4a')][_0x1262('0x2e')]);return db['FreshdeskConfiguration'][_0x1262('0x49')](_0x1abe43[_0x1262('0x4a')],{'include':[{'model':db[_0x1262('0x57')],'as':'Subjects'},{'model':db[_0x1262('0x57')],'as':_0x1262('0x55')}]});}return null;})[_0x1262('0x26')](respondWithResult(_0x2da316,null))['catch'](handleError(_0x2da316,null));};exports[_0x1262('0x58')]=function(_0x1bd427,_0x565b2a,_0x34e0d8){var _0x2eb8ad='';return db[_0x1262('0x2c')][_0x1262('0x4e')]({'where':{'id':_0x1bd427['params']['id']},'attributes':['id','remoteUri',_0x1262('0x59')]})[_0x1262('0x26')](handleEntityNotFound(_0x565b2a,null))[_0x1262('0x26')](function(_0x39f951){if(_0x39f951){_0x2eb8ad=_0x39f951[_0x1262('0x5a')];var _0x5853e2=_0x2eb8ad[_0x1262('0x5b')](-0x1);if(_0x5853e2==='/'){_0x2eb8ad=_0x2eb8ad[_0x1262('0x5c')](0x0,_0x2eb8ad['lastIndexOf'](_0x5853e2));}return rp({'method':_0x1262('0x5d'),'uri':util[_0x1262('0x5e')](_0x1262('0x5f'),_0x2eb8ad,_0x1262('0x60')),'headers':{'Authorization':util['format'](_0x1262('0x61'),new Buffer(util[_0x1262('0x5e')]('%s:X',_0x39f951[_0x1262('0x59')]))['toString'](_0x1262('0x62')))},'json':!![]});}})[_0x1262('0x26')](function(_0x21ac64){if(_0x21ac64){var _0x38b065=[_0x1262('0x63'),_0x1262('0x64'),_0x1262('0x65'),_0x1262('0x66'),_0x1262('0x1b'),_0x1262('0x67'),'group',_0x1262('0x68'),_0x1262('0x69'),_0x1262('0x6a'),_0x1262('0x6b')];_['remove'](_0x21ac64,function(_0xfbee06){return _0x38b065[_0x1262('0x6c')](_0xfbee06[_0x1262('0x29')])||!_0xfbee06[_0x1262('0x6d')]&&_0xfbee06[_0x1262('0x2e')]!==_0x1262('0x6e')&&_0xfbee06[_0x1262('0x2e')]!==_0x1262('0x6f');});return{'count':_0x21ac64[_0x1262('0x38')],'rows':_[_0x1262('0x31')](_0x21ac64,function(_0x57b6c1){return{'id':_0x57b6c1[_0x1262('0x29')],'name':_0x57b6c1[_0x1262('0x70')],'custom':!_0x57b6c1[_0x1262('0x6d')],'options':_0x57b6c1[_0x1262('0x71')]?_[_0x1262('0x31')](_0x57b6c1[_0x1262('0x71')],function(_0x10efa){return{'name':_['capitalize'](_0x10efa),'value':_0x10efa};}):[]};})};}})[_0x1262('0x26')](respondWithResult(_0x565b2a,null))[_0x1262('0x45')](function(_0x328de9){var _0x17ed4e=_0x1bd427[_0x1262('0x32')]['test']?0x1f4:_0x328de9[_0x1262('0x72')]||0x1f4;logger[_0x1262('0x27')](_0x1262('0x73'),_0x1262('0x58'),_0x17ed4e,JSON[_0x1262('0x74')](_0x328de9));delete _0x328de9[_0x1262('0x29')];if(_0x17ed4e===0x191){_0x17ed4e=0x190;}_0x565b2a['status'](_0x17ed4e)[_0x1262('0x2a')](_0x1bd427['query'][_0x1262('0x75')]?{'message':_0x1262('0x76'),'statusCode':_0x328de9[_0x1262('0x72')]}:_0x328de9);});}; \ No newline at end of file +var _0xa788=['fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','nolimit','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','stringify','send','test','statusCode','eml-format','rimraf','zip-dir'];(function(_0x34cac9,_0x46cf35){var _0x1d52f6=function(_0x31d548){while(--_0x31d548){_0x34cac9['push'](_0x34cac9['shift']());}};_0x1d52f6(++_0x46cf35);}(_0xa788,0x70));var _0x8a78=function(_0xa43652,_0x9b0235){_0xa43652=_0xa43652-0x0;var _0x11408e=_0xa788[_0xa43652];return _0x11408e;};'use strict';var emlformat=require(_0x8a78('0x0'));var rimraf=require(_0x8a78('0x1'));var zipdir=require(_0x8a78('0x2'));var jsonpatch=require(_0x8a78('0x3'));var rp=require('request-promise');var moment=require(_0x8a78('0x4'));var BPromise=require(_0x8a78('0x5'));var Mustache=require('mustache');var util=require(_0x8a78('0x6'));var path=require(_0x8a78('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a78('0x8'));var _=require(_0x8a78('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a78('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a78('0xb'));var Papa=require(_0x8a78('0xc'));var Redis=require('ioredis');var authService=require(_0x8a78('0xd'));var qs=require(_0x8a78('0xe'));var as=require(_0x8a78('0xf'));var hardwareService=require(_0x8a78('0x10'));var logger=require(_0x8a78('0x11'))(_0x8a78('0x12'));var utils=require(_0x8a78('0x13'));var config=require(_0x8a78('0x14'));var licenseUtil=require(_0x8a78('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8a78('0x16'));function respondWithStatusCode(_0x294b34,_0x31b77e){_0x31b77e=_0x31b77e||0xcc;return function(_0x4b4bc8){if(_0x4b4bc8){return _0x294b34[_0x8a78('0x17')](_0x31b77e);}return _0x294b34[_0x8a78('0x18')](_0x31b77e)[_0x8a78('0x19')]();};}function respondWithResult(_0x4b073b,_0x423787){_0x423787=_0x423787||0xc8;return function(_0x5bf8a4){if(_0x5bf8a4){return _0x4b073b[_0x8a78('0x18')](_0x423787)['json'](_0x5bf8a4);}};}function respondWithFilteredResult(_0x429b2c,_0x586d47){return function(_0x57212b){if(_0x57212b){var _0x580cf9=typeof _0x586d47[_0x8a78('0x1a')]===_0x8a78('0x1b')&&typeof _0x586d47[_0x8a78('0x1c')]===_0x8a78('0x1b');var _0x303aab=_0x57212b[_0x8a78('0x1d')];var _0x9ce954=_0x580cf9?0x0:_0x586d47[_0x8a78('0x1a')];var _0x20343b=_0x580cf9?_0x57212b[_0x8a78('0x1d')]:_0x586d47[_0x8a78('0x1a')]+_0x586d47[_0x8a78('0x1c')];var _0x23721b;if(_0x20343b>=_0x303aab){_0x20343b=_0x303aab;_0x23721b=0xc8;}else{_0x23721b=0xce;}_0x429b2c[_0x8a78('0x18')](_0x23721b);return _0x429b2c['set'](_0x8a78('0x1e'),_0x9ce954+'-'+_0x20343b+'/'+_0x303aab)['json'](_0x57212b);}return null;};}function patchUpdates(_0xa6f4b8){return function(_0x1dd032){try{jsonpatch['apply'](_0x1dd032,_0xa6f4b8,!![]);}catch(_0x1389e8){return BPromise[_0x8a78('0x1f')](_0x1389e8);}return _0x1dd032[_0x8a78('0x20')]();};}function saveUpdates(_0x43b3b8,_0x2d7d03){return function(_0x530446){if(_0x530446){return _0x530446[_0x8a78('0x21')](_0x43b3b8)['then'](function(_0x3532d1){return _0x3532d1;});}return null;};}function removeEntity(_0x43305f,_0x118357){return function(_0x381795){if(_0x381795){return _0x381795[_0x8a78('0x22')]()[_0x8a78('0x23')](function(){_0x43305f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21908e,_0x2737d0){return function(_0x30fbe9){if(!_0x30fbe9){_0x21908e['sendStatus'](0x194);}return _0x30fbe9;};}function handleError(_0x10e6b6,_0x43f182){_0x43f182=_0x43f182||0x1f4;return function(_0x3c51db){logger[_0x8a78('0x24')](_0x3c51db[_0x8a78('0x25')]);if(_0x3c51db[_0x8a78('0x26')]){delete _0x3c51db[_0x8a78('0x26')];}_0x10e6b6['status'](_0x43f182)['send'](_0x3c51db);};}exports[_0x8a78('0x27')]=function(_0x370927,_0x2c26d0){var _0x19c208={},_0x5138ad={},_0x1561d8={'count':0x0,'rows':[]};var _0x27c5d1=_['map'](db[_0x8a78('0x28')][_0x8a78('0x29')],function(_0x2fbc0e){return{'name':_0x2fbc0e[_0x8a78('0x2a')],'type':_0x2fbc0e[_0x8a78('0x2b')][_0x8a78('0x2c')]};});_0x5138ad[_0x8a78('0x2d')]=_[_0x8a78('0x2e')](_0x27c5d1,_0x8a78('0x26'));_0x5138ad[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x370927['query']);_0x5138ad[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0x5138ad['model'],_0x5138ad[_0x8a78('0x2f')]);_0x19c208['attributes']=_[_0x8a78('0x32')](_0x5138ad[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x370927['query']['fields']));_0x19c208[_0x8a78('0x34')]=_0x19c208['attributes'][_0x8a78('0x35')]?_0x19c208[_0x8a78('0x34')]:_0x5138ad[_0x8a78('0x2d')];if(!_0x370927[_0x8a78('0x2f')][_0x8a78('0x36')]('nolimit')){_0x19c208[_0x8a78('0x1c')]=qs[_0x8a78('0x1c')](_0x370927[_0x8a78('0x2f')][_0x8a78('0x1c')]);_0x19c208[_0x8a78('0x1a')]=qs['offset'](_0x370927[_0x8a78('0x2f')][_0x8a78('0x1a')]);}_0x19c208[_0x8a78('0x37')]=qs['sort'](_0x370927[_0x8a78('0x2f')][_0x8a78('0x38')]);_0x19c208[_0x8a78('0x39')]=qs['filters'](_['pick'](_0x370927['query'],_0x5138ad['filters']),_0x27c5d1);if(_0x370927[_0x8a78('0x2f')][_0x8a78('0x3a')]){_0x19c208[_0x8a78('0x39')]=_[_0x8a78('0x3b')](_0x19c208[_0x8a78('0x39')],{'$or':_[_0x8a78('0x2e')](_0x27c5d1,function(_0x1d5423){if(_0x1d5423['type']!==_0x8a78('0x3c')){var _0x3655d3={};_0x3655d3[_0x1d5423['name']]={'$like':'%'+_0x370927[_0x8a78('0x2f')][_0x8a78('0x3a')]+'%'};return _0x3655d3;}})});}_0x19c208=_[_0x8a78('0x3b')]({},_0x19c208,_0x370927[_0x8a78('0x3d')]);var _0x321519={'where':_0x19c208[_0x8a78('0x39')]};return db[_0x8a78('0x28')][_0x8a78('0x1d')](_0x321519)[_0x8a78('0x23')](function(_0x329ba1){_0x1561d8[_0x8a78('0x1d')]=_0x329ba1;if(_0x370927[_0x8a78('0x2f')][_0x8a78('0x3e')]){_0x19c208[_0x8a78('0x3f')]=[{'all':!![]}];}return db[_0x8a78('0x28')][_0x8a78('0x40')](_0x19c208);})[_0x8a78('0x23')](function(_0x1d87dd){_0x1561d8[_0x8a78('0x41')]=_0x1d87dd;return _0x1561d8;})[_0x8a78('0x23')](respondWithFilteredResult(_0x2c26d0,_0x19c208))[_0x8a78('0x42')](handleError(_0x2c26d0,null));};exports['show']=function(_0x5b894c,_0x2ed20a){var _0x12bbf8={'raw':![],'where':{'id':_0x5b894c[_0x8a78('0x43')]['id']}},_0xb0eea6={};_0xb0eea6[_0x8a78('0x2d')]=_[_0x8a78('0x30')](db['FreshdeskAccount'][_0x8a78('0x29')]);_0xb0eea6[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x5b894c[_0x8a78('0x2f')]);_0xb0eea6[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0xb0eea6[_0x8a78('0x2d')],_0xb0eea6[_0x8a78('0x2f')]);_0x12bbf8[_0x8a78('0x34')]=_[_0x8a78('0x32')](_0xb0eea6[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x5b894c[_0x8a78('0x2f')][_0x8a78('0x33')]));_0x12bbf8[_0x8a78('0x34')]=_0x12bbf8[_0x8a78('0x34')][_0x8a78('0x35')]?_0x12bbf8[_0x8a78('0x34')]:_0xb0eea6[_0x8a78('0x2d')];if(_0x5b894c[_0x8a78('0x2f')]['includeAll']){_0x12bbf8[_0x8a78('0x3f')]=[{'all':!![]}];}_0x12bbf8=_[_0x8a78('0x3b')]({},_0x12bbf8,_0x5b894c[_0x8a78('0x3d')]);return db['FreshdeskAccount'][_0x8a78('0x44')](_0x12bbf8)[_0x8a78('0x23')](handleEntityNotFound(_0x2ed20a,null))[_0x8a78('0x23')](respondWithResult(_0x2ed20a,null))[_0x8a78('0x42')](handleError(_0x2ed20a,null));};exports[_0x8a78('0x45')]=function(_0x32b165,_0x16d46f){return db['FreshdeskAccount'][_0x8a78('0x45')](_0x32b165['body'],{})[_0x8a78('0x23')](respondWithResult(_0x16d46f,0xc9))['catch'](handleError(_0x16d46f,null));};exports['update']=function(_0x568924,_0x2f1542){if(_0x568924[_0x8a78('0x46')]['id']){delete _0x568924[_0x8a78('0x46')]['id'];}return db[_0x8a78('0x28')][_0x8a78('0x44')]({'where':{'id':_0x568924[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f1542,null))['then'](saveUpdates(_0x568924[_0x8a78('0x46')],null))['then'](respondWithResult(_0x2f1542,null))['catch'](handleError(_0x2f1542,null));};exports[_0x8a78('0x22')]=function(_0x1eba19,_0x424400){return db[_0x8a78('0x28')][_0x8a78('0x44')]({'where':{'id':_0x1eba19[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x424400,null))[_0x8a78('0x23')](removeEntity(_0x424400,null))[_0x8a78('0x42')](handleError(_0x424400,null));};exports[_0x8a78('0x47')]=function(_0x18b2a4,_0x445cc9,_0x25709b){var _0xca898d={};var _0x22b554={};var _0x35b5b4;var _0x49e5e4;return db[_0x8a78('0x28')][_0x8a78('0x48')]({'where':{'id':_0x18b2a4[_0x8a78('0x43')]['id']}})['then'](handleEntityNotFound(_0x445cc9,null))['then'](function(_0x2fb809){if(_0x2fb809){_0x35b5b4=_0x2fb809;_0x22b554['model']=_[_0x8a78('0x30')](db[_0x8a78('0x49')]['rawAttributes']);_0x22b554[_0x8a78('0x2f')]=_[_0x8a78('0x30')](_0x18b2a4['query']);_0x22b554[_0x8a78('0x31')]=_[_0x8a78('0x32')](_0x22b554[_0x8a78('0x2d')],_0x22b554[_0x8a78('0x2f')]);_0xca898d[_0x8a78('0x34')]=_[_0x8a78('0x32')](_0x22b554[_0x8a78('0x2d')],qs[_0x8a78('0x33')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x33')]));_0xca898d[_0x8a78('0x34')]=_0xca898d[_0x8a78('0x34')][_0x8a78('0x35')]?_0xca898d['attributes']:_0x22b554[_0x8a78('0x2d')];_0xca898d[_0x8a78('0x37')]=qs[_0x8a78('0x38')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x38')]);_0xca898d[_0x8a78('0x39')]=qs[_0x8a78('0x31')](_[_0x8a78('0x4a')](_0x18b2a4[_0x8a78('0x2f')],_0x22b554[_0x8a78('0x31')]));if(_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x3a')]){_0xca898d[_0x8a78('0x39')]=_[_0x8a78('0x3b')](_0xca898d[_0x8a78('0x39')],{'$or':_[_0x8a78('0x2e')](_0xca898d['attributes'],function(_0x402aed){var _0xe3b592={};_0xe3b592[_0x402aed]={'$like':'%'+_0x18b2a4['query'][_0x8a78('0x3a')]+'%'};return _0xe3b592;})});}_0xca898d=_[_0x8a78('0x3b')]({},_0xca898d,_0x18b2a4[_0x8a78('0x3d')]);return _0x35b5b4['getConfigurations'](_0xca898d);}})[_0x8a78('0x23')](function(_0x471b1d){if(_0x471b1d){_0x49e5e4=_0x471b1d[_0x8a78('0x35')];if(!_0x18b2a4[_0x8a78('0x2f')]['hasOwnProperty'](_0x8a78('0x4b'))){_0xca898d[_0x8a78('0x1c')]=qs[_0x8a78('0x1c')](_0x18b2a4[_0x8a78('0x2f')][_0x8a78('0x1c')]);_0xca898d[_0x8a78('0x1a')]=qs[_0x8a78('0x1a')](_0x18b2a4[_0x8a78('0x2f')]['offset']);}return _0x35b5b4[_0x8a78('0x47')](_0xca898d);}})[_0x8a78('0x23')](function(_0x524785){if(_0x524785){return _0x524785?{'count':_0x49e5e4,'rows':_0x524785}:null;}})['then'](respondWithResult(_0x445cc9,null))[_0x8a78('0x42')](handleError(_0x445cc9,null));};exports[_0x8a78('0x4c')]=function(_0xc9b8af,_0x30f0eb,_0x21129d){if(_0xc9b8af[_0x8a78('0x46')]['id']){delete _0xc9b8af[_0x8a78('0x46')]['id'];}return db[_0x8a78('0x28')][_0x8a78('0x48')]({'where':{'id':_0xc9b8af['params']['id']}})['then'](handleEntityNotFound(_0x30f0eb,null))['then'](function(_0x180e32){if(_0x180e32){_0xc9b8af[_0x8a78('0x46')]['AccountId']=_0x180e32['id'];_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x4d')]=integrations[_0x8a78('0x4e')](_0xc9b8af[_0x8a78('0x46')]['channel'],_0xc9b8af[_0x8a78('0x46')]['type']);_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x4f')]=integrations[_0x8a78('0x50')](_0xc9b8af['body'][_0x8a78('0x51')],_0xc9b8af[_0x8a78('0x46')][_0x8a78('0x2b')]);return db[_0x8a78('0x49')][_0x8a78('0x45')](_0xc9b8af[_0x8a78('0x46')],{'include':[{'model':db[_0x8a78('0x52')],'as':_0x8a78('0x4d')},{'model':db['FreshdeskField'],'as':_0x8a78('0x4f')}]});}return null;})[_0x8a78('0x23')](respondWithResult(_0x30f0eb,null))['catch'](handleError(_0x30f0eb,null));};exports[_0x8a78('0x53')]=function(_0x379db5,_0x3df0b4,_0x4850ac){var _0x11ce80='';return db['FreshdeskAccount'][_0x8a78('0x48')]({'where':{'id':_0x379db5[_0x8a78('0x43')]['id']},'attributes':['id','remoteUri','apiKey']})['then'](handleEntityNotFound(_0x3df0b4,null))[_0x8a78('0x23')](function(_0x5d5c29){if(_0x5d5c29){_0x11ce80=_0x5d5c29['remoteUri'];var _0x52c94c=_0x11ce80[_0x8a78('0x54')](-0x1);if(_0x52c94c==='/'){_0x11ce80=_0x11ce80[_0x8a78('0x55')](0x0,_0x11ce80[_0x8a78('0x56')](_0x52c94c));}return rp({'method':_0x8a78('0x57'),'uri':util[_0x8a78('0x58')](_0x8a78('0x59'),_0x11ce80,_0x8a78('0x5a')),'headers':{'Authorization':util[_0x8a78('0x58')](_0x8a78('0x5b'),new Buffer(util[_0x8a78('0x58')]('%s:X',_0x5d5c29[_0x8a78('0x5c')]))[_0x8a78('0x5d')](_0x8a78('0x5e')))},'json':!![]});}})[_0x8a78('0x23')](function(_0x20c2e8){if(_0x20c2e8){var _0x1b43cd=[_0x8a78('0x5f'),_0x8a78('0x60'),_0x8a78('0x61'),_0x8a78('0x62'),_0x8a78('0x18'),_0x8a78('0x63'),_0x8a78('0x64'),_0x8a78('0x65'),_0x8a78('0x66'),'group','company'];_[_0x8a78('0x67')](_0x20c2e8,function(_0x5a506d){return _0x1b43cd[_0x8a78('0x68')](_0x5a506d[_0x8a78('0x26')])||!_0x5a506d[_0x8a78('0x69')]&&_0x5a506d[_0x8a78('0x2b')]!==_0x8a78('0x6a')&&_0x5a506d[_0x8a78('0x2b')]!==_0x8a78('0x6b');});return{'count':_0x20c2e8[_0x8a78('0x35')],'rows':_[_0x8a78('0x2e')](_0x20c2e8,function(_0x4f46bb){return{'id':_0x4f46bb[_0x8a78('0x26')],'name':_0x4f46bb[_0x8a78('0x6c')],'custom':!_0x4f46bb[_0x8a78('0x69')],'options':_0x4f46bb[_0x8a78('0x6d')]?_['map'](_0x4f46bb[_0x8a78('0x6d')],function(_0x22a759){return{'name':_[_0x8a78('0x6e')](_0x22a759),'value':_0x22a759};}):[]};})};}})[_0x8a78('0x23')](respondWithResult(_0x3df0b4,null))[_0x8a78('0x42')](function(_0x1f85fb){var _0x1d059d=_0x379db5['query']['test']?0x1f4:_0x1f85fb['statusCode']||0x1f4;logger[_0x8a78('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x8a78('0x53'),_0x1d059d,JSON[_0x8a78('0x6f')](_0x1f85fb));delete _0x1f85fb[_0x8a78('0x26')];if(_0x1d059d===0x191){_0x1d059d=0x190;}_0x3df0b4['status'](_0x1d059d)[_0x8a78('0x70')](_0x379db5['query'][_0x8a78('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x1f85fb[_0x8a78('0x72')]}:_0x1f85fb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 7254ad4..9a8a5c8 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 _0x74fa=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2923b5,_0x3e2783){var _0x5e8b2e=function(_0x3de085){while(--_0x3de085){_0x2923b5['push'](_0x2923b5['shift']());}};_0x5e8b2e(++_0x3e2783);}(_0x74fa,0xd7));var _0xa74f=function(_0x278137,_0x286be4){_0x278137=_0x278137-0x0;var _0x3ca5bb=_0x74fa[_0x278137];return _0x3ca5bb;};'use strict';var _=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var logger=require(_0xa74f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa74f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa74f('0x4'));var rimraf=require(_0xa74f('0x5'));var config=require(_0xa74f('0x6'));var attributes=require(_0xa74f('0x7'));var integrations=require(_0xa74f('0x8'));module[_0xa74f('0x9')]=function(_0x4a1f1f,_0x2124d3){return _0x4a1f1f[_0xa74f('0xa')](_0xa74f('0xb'),attributes,{'tableName':_0xa74f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80e0=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x80e0,0xd2));var _0x080e=function(_0x58b067,_0x3cdf3b){_0x58b067=_0x58b067-0x0;var _0x3c4775=_0x80e0[_0x58b067];return _0x3c4775;};'use strict';var _=require(_0x080e('0x0'));var util=require(_0x080e('0x1'));var logger=require('../../config/logger')(_0x080e('0x2'));var moment=require(_0x080e('0x3'));var BPromise=require(_0x080e('0x4'));var rp=require(_0x080e('0x5'));var fs=require('fs');var path=require(_0x080e('0x6'));var rimraf=require(_0x080e('0x7'));var config=require(_0x080e('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x080e('0x9'));module['exports']=function(_0x52ad5e,_0x2c54b3){return _0x52ad5e[_0x080e('0xa')](_0x080e('0xb'),attributes,{'tableName':_0x080e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index a1dba26..e25a5ab 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 _0xe644=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','findAll','options','raw','where','limit','map','include','model','attributes','then','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1d4c13,_0x310103){var _0x4d83ff=function(_0x238d5b){while(--_0x238d5b){_0x1d4c13['push'](_0x1d4c13['shift']());}};_0x4d83ff(++_0x310103);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66faf,_0x12c40d,_0x5cce6e){return new BPromise(function(_0x4d5aa6,_0x8573c1){return client['request'](_0x66faf,_0x5cce6e)['then'](function(_0x2ebcfe){logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));logger[_0x4e64('0xf')](_0x4e64('0x10'),_0x12c40d,'request\x20sent',JSON[_0x4e64('0x11')](_0x2ebcfe));if(_0x2ebcfe[_0x4e64('0x12')]){if(_0x2ebcfe['error'][_0x4e64('0x13')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x12c40d,_0x2ebcfe[_0x4e64('0x12')]['message']);return _0x8573c1(_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);}logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x2ebcfe[_0x4e64('0x12')][_0x4e64('0x14')]);return _0x4d5aa6(_0x2ebcfe[_0x4e64('0x12')]['message']);}else{logger[_0x4e64('0xc')](_0x4e64('0xd'),_0x12c40d,_0x4e64('0xe'));_0x4d5aa6(_0x2ebcfe['result'][_0x4e64('0x14')]);}})[_0x4e64('0x15')](function(_0x452f34){logger[_0x4e64('0x12')](_0x4e64('0xd'),_0x12c40d,_0x452f34);_0x8573c1(_0x452f34);});});}exports[_0x4e64('0x16')]=function(_0x135ffb){var _0x3961c5=this;return new Promise(function(_0x1be196,_0x2df16a){return db['FreshdeskAccount'][_0x4e64('0x17')]({'raw':_0x135ffb[_0x4e64('0x18')]?_0x135ffb['options'][_0x4e64('0x19')]===undefined?!![]:![]:!![],'where':_0x135ffb['options']?_0x135ffb['options'][_0x4e64('0x1a')]||null:null,'attributes':_0x135ffb[_0x4e64('0x18')]?_0x135ffb[_0x4e64('0x18')]['attributes']||null:null,'limit':_0x135ffb[_0x4e64('0x18')]?_0x135ffb['options'][_0x4e64('0x1b')]||null:null,'include':_0x135ffb[_0x4e64('0x18')]?_0x135ffb[_0x4e64('0x18')]['include']?_[_0x4e64('0x1c')](_0x135ffb[_0x4e64('0x18')][_0x4e64('0x1d')],function(_0x27d33e){return{'model':db[_0x27d33e[_0x4e64('0x1e')]],'as':_0x27d33e['as'],'attributes':_0x27d33e[_0x4e64('0x1f')],'include':_0x27d33e[_0x4e64('0x1d')]?_['map'](_0x27d33e[_0x4e64('0x1d')],function(_0x29b4f8){return{'model':db[_0x29b4f8[_0x4e64('0x1e')]],'as':_0x29b4f8['as'],'attributes':_0x29b4f8['attributes'],'include':_0x29b4f8[_0x4e64('0x1d')]?_[_0x4e64('0x1c')](_0x29b4f8[_0x4e64('0x1d')],function(_0x457023){return{'model':db[_0x457023[_0x4e64('0x1e')]],'as':_0x457023['as'],'attributes':_0x457023['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e64('0x20')](function(_0x2b1f2b){logger[_0x4e64('0xc')](_0x4e64('0x16'),_0x135ffb);logger[_0x4e64('0xf')](_0x4e64('0x16'),_0x135ffb,JSON[_0x4e64('0x11')](_0x2b1f2b));_0x1be196(_0x2b1f2b);})[_0x4e64('0x15')](function(_0x5467a5){logger[_0x4e64('0x12')](_0x4e64('0x16'),_0x5467a5[_0x4e64('0x14')],_0x135ffb);_0x2df16a(_0x3961c5[_0x4e64('0x12')](0x1f4,_0x5467a5[_0x4e64('0x14')]));});});};exports[_0x4e64('0x21')]=function(_0x439b2f){var _0x4c4559=this;return new Promise(function(_0x67698d,_0x13c3e2){return db[_0x4e64('0x22')][_0x4e64('0x23')]({'raw':_0x439b2f[_0x4e64('0x18')]?_0x439b2f[_0x4e64('0x18')][_0x4e64('0x19')]===undefined?!![]:![]:!![],'where':_0x439b2f['options']?_0x439b2f[_0x4e64('0x18')][_0x4e64('0x1a')]||null:null,'attributes':_0x439b2f[_0x4e64('0x18')]?_0x439b2f['options'][_0x4e64('0x1f')]||null:null,'include':_0x439b2f['options']?_0x439b2f[_0x4e64('0x18')][_0x4e64('0x1d')]?_['map'](_0x439b2f['options']['include'],function(_0x1b40ed){return{'model':db[_0x1b40ed['model']],'as':_0x1b40ed['as'],'attributes':_0x1b40ed[_0x4e64('0x1f')],'include':_0x1b40ed[_0x4e64('0x1d')]?_[_0x4e64('0x1c')](_0x1b40ed[_0x4e64('0x1d')],function(_0x33b453){return{'model':db[_0x33b453[_0x4e64('0x1e')]],'as':_0x33b453['as'],'attributes':_0x33b453[_0x4e64('0x1f')],'include':_0x33b453['include']?_[_0x4e64('0x1c')](_0x33b453['include'],function(_0x1d00bb){return{'model':db[_0x1d00bb['model']],'as':_0x1d00bb['as'],'attributes':_0x1d00bb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14b80){logger['info']('ShowFreshdeskAccount',_0x439b2f);logger[_0x4e64('0xf')](_0x4e64('0x21'),_0x439b2f,JSON[_0x4e64('0x11')](_0x14b80));_0x67698d(_0x14b80);})[_0x4e64('0x15')](function(_0x1757a2){logger[_0x4e64('0x12')](_0x4e64('0x21'),_0x1757a2['message'],_0x439b2f);_0x13c3e2(_0x4c4559['error'](0x1f4,_0x1757a2['message']));});});}; \ No newline at end of file +var _0x9658=['find','raw','where','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9658,0x6f));var _0x8965=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0x9658[_0x813d0a];return _0x241352;};'use strict';var _=require(_0x8965('0x0'));var util=require('util');var moment=require(_0x8965('0x1'));var BPromise=require(_0x8965('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8965('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8965('0x4'));var logger=require(_0x8965('0x5'))(_0x8965('0x6'));var config=require('../../config/environment');var jayson=require(_0x8965('0x7'));var client=jayson[_0x8965('0x8')][_0x8965('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x290f30,_0x271060,_0x27b334){return new BPromise(function(_0x1e7d61,_0xe14503){return client[_0x8965('0xa')](_0x290f30,_0x27b334)[_0x8965('0xb')](function(_0x214249){logger[_0x8965('0xc')](_0x8965('0xd'),_0x271060,_0x8965('0xe'));logger[_0x8965('0xf')](_0x8965('0x10'),_0x271060,_0x8965('0xe'),JSON[_0x8965('0x11')](_0x214249));if(_0x214249[_0x8965('0x12')]){if(_0x214249['error'][_0x8965('0x13')]===0x1f4){logger[_0x8965('0x12')](_0x8965('0xd'),_0x271060,_0x214249[_0x8965('0x12')][_0x8965('0x14')]);return _0xe14503(_0x214249[_0x8965('0x12')][_0x8965('0x14')]);}logger[_0x8965('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x271060,_0x214249[_0x8965('0x12')][_0x8965('0x14')]);return _0x1e7d61(_0x214249[_0x8965('0x12')][_0x8965('0x14')]);}else{logger[_0x8965('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x271060,_0x8965('0xe'));_0x1e7d61(_0x214249[_0x8965('0x15')][_0x8965('0x14')]);}})[_0x8965('0x16')](function(_0x5c7d55){logger[_0x8965('0x12')](_0x8965('0xd'),_0x271060,_0x5c7d55);_0xe14503(_0x5c7d55);});});}exports[_0x8965('0x17')]=function(_0x2e6851){var _0x2b4f64=this;return new Promise(function(_0x927a0a,_0x579fe6){return db['FreshdeskAccount'][_0x8965('0x18')]({'raw':_0x2e6851[_0x8965('0x19')]?_0x2e6851['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e6851['options']?_0x2e6851['options']['where']||null:null,'attributes':_0x2e6851[_0x8965('0x19')]?_0x2e6851['options'][_0x8965('0x1a')]||null:null,'limit':_0x2e6851[_0x8965('0x19')]?_0x2e6851[_0x8965('0x19')][_0x8965('0x1b')]||null:null,'include':_0x2e6851['options']?_0x2e6851[_0x8965('0x19')][_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x2e6851[_0x8965('0x19')][_0x8965('0x1c')],function(_0x33c208){return{'model':db[_0x33c208[_0x8965('0x1e')]],'as':_0x33c208['as'],'attributes':_0x33c208[_0x8965('0x1a')],'include':_0x33c208[_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x33c208['include'],function(_0x279402){return{'model':db[_0x279402[_0x8965('0x1e')]],'as':_0x279402['as'],'attributes':_0x279402['attributes'],'include':_0x279402[_0x8965('0x1c')]?_['map'](_0x279402['include'],function(_0x1955c1){return{'model':db[_0x1955c1[_0x8965('0x1e')]],'as':_0x1955c1['as'],'attributes':_0x1955c1[_0x8965('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8965('0xb')](function(_0x5abd14){logger['info'](_0x8965('0x17'),_0x2e6851);logger[_0x8965('0xf')](_0x8965('0x17'),_0x2e6851,JSON[_0x8965('0x11')](_0x5abd14));_0x927a0a(_0x5abd14);})[_0x8965('0x16')](function(_0x454748){logger['error']('GetFreshdeskAccount',_0x454748[_0x8965('0x14')],_0x2e6851);_0x579fe6(_0x2b4f64['error'](0x1f4,_0x454748['message']));});});};exports[_0x8965('0x1f')]=function(_0x58df71){var _0x5d169=this;return new Promise(function(_0x4c6c05,_0x4ad940){return db[_0x8965('0x20')][_0x8965('0x21')]({'raw':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')][_0x8965('0x22')]===undefined?!![]:![]:!![],'where':_0x58df71[_0x8965('0x19')]?_0x58df71['options'][_0x8965('0x23')]||null:null,'attributes':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')]['attributes']||null:null,'include':_0x58df71[_0x8965('0x19')]?_0x58df71[_0x8965('0x19')][_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x58df71[_0x8965('0x19')][_0x8965('0x1c')],function(_0x30ce7d){return{'model':db[_0x30ce7d[_0x8965('0x1e')]],'as':_0x30ce7d['as'],'attributes':_0x30ce7d[_0x8965('0x1a')],'include':_0x30ce7d[_0x8965('0x1c')]?_[_0x8965('0x1d')](_0x30ce7d[_0x8965('0x1c')],function(_0x333f70){return{'model':db[_0x333f70['model']],'as':_0x333f70['as'],'attributes':_0x333f70[_0x8965('0x1a')],'include':_0x333f70[_0x8965('0x1c')]?_['map'](_0x333f70['include'],function(_0x4149f1){return{'model':db[_0x4149f1[_0x8965('0x1e')]],'as':_0x4149f1['as'],'attributes':_0x4149f1[_0x8965('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8965('0xb')](function(_0x584e46){logger['info'](_0x8965('0x1f'),_0x58df71);logger['debug'](_0x8965('0x1f'),_0x58df71,JSON[_0x8965('0x11')](_0x584e46));_0x4c6c05(_0x584e46);})[_0x8965('0x16')](function(_0x5eac49){logger[_0x8965('0x12')]('ShowFreshdeskAccount',_0x5eac49[_0x8965('0x14')],_0x58df71);_0x4ad940(_0x5d169['error'](0x1f4,_0x5eac49[_0x8965('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6b876fc..2fcac76 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 _0xf194=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put','update'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xf194,0x12b));var _0x4f19=function(_0x4eb13d,_0x553664){_0x4eb13d=_0x4eb13d-0x0;var _0x1c61e2=_0xf194[_0x4eb13d];return _0x1c61e2;};'use strict';var multer=require(_0x4f19('0x0'));var util=require(_0x4f19('0x1'));var path=require('path');var timeout=require(_0x4f19('0x2'));var express=require(_0x4f19('0x3'));var router=express[_0x4f19('0x4')]();var fs_extra=require(_0x4f19('0x5'));var auth=require(_0x4f19('0x6'));var interaction=require(_0x4f19('0x7'));var config=require(_0x4f19('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x4f19('0x9')]('/',auth['isAuthenticated'](),controller[_0x4f19('0xa')]);router[_0x4f19('0x9')](_0x4f19('0xb'),auth[_0x4f19('0xc')](),controller['show']);router['get'](_0x4f19('0xd'),auth[_0x4f19('0xc')](),controller[_0x4f19('0xe')]);router[_0x4f19('0x9')](_0x4f19('0xf'),auth['isAuthenticated'](),controller[_0x4f19('0x10')]);router[_0x4f19('0x9')](_0x4f19('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0x4f19('0x12'),auth[_0x4f19('0xc')](),controller[_0x4f19('0x13')]);router[_0x4f19('0x14')]('/',auth[_0x4f19('0xc')](),controller[_0x4f19('0x15')]);router[_0x4f19('0x14')](_0x4f19('0x12'),auth[_0x4f19('0xc')](),controller[_0x4f19('0x16')]);router[_0x4f19('0x17')]('/:id',auth[_0x4f19('0xc')](),controller[_0x4f19('0x18')]);router[_0x4f19('0x19')](_0x4f19('0xb'),auth[_0x4f19('0xc')](),controller[_0x4f19('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x1347=['Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getTags','post','create','setTags','put','update','delete','/:id','destroy','util','path','connect-timeout'];(function(_0x10a9f3,_0x3f6e77){var _0x1d1a7e=function(_0x36bb17){while(--_0x36bb17){_0x10a9f3['push'](_0x10a9f3['shift']());}};_0x1d1a7e(++_0x3f6e77);}(_0x1347,0x15b));var _0x7134=function(_0x14e4cf,_0x5ab1da){_0x14e4cf=_0x14e4cf-0x0;var _0x2770b=_0x1347[_0x14e4cf];return _0x2770b;};'use strict';var multer=require('multer');var util=require(_0x7134('0x0'));var path=require(_0x7134('0x1'));var timeout=require(_0x7134('0x2'));var express=require('express');var router=express[_0x7134('0x3')]();var fs_extra=require(_0x7134('0x4'));var auth=require(_0x7134('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7134('0x6'));var controller=require(_0x7134('0x7'));router[_0x7134('0x8')]('/',auth[_0x7134('0x9')](),controller[_0x7134('0xa')]);router[_0x7134('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7134('0x8')](_0x7134('0xb'),auth[_0x7134('0x9')](),controller[_0x7134('0xc')]);router[_0x7134('0x8')](_0x7134('0xd'),auth[_0x7134('0x9')](),controller[_0x7134('0xe')]);router['get'](_0x7134('0xf'),auth[_0x7134('0x9')](),controller['getDescriptions']);router[_0x7134('0x8')]('/:id/tags',auth[_0x7134('0x9')](),controller[_0x7134('0x10')]);router[_0x7134('0x11')]('/',auth[_0x7134('0x9')](),controller[_0x7134('0x12')]);router['post']('/:id/tags',auth[_0x7134('0x9')](),controller[_0x7134('0x13')]);router[_0x7134('0x14')]('/:id',auth[_0x7134('0x9')](),controller[_0x7134('0x15')]);router[_0x7134('0x16')](_0x7134('0x17'),auth[_0x7134('0x9')](),controller[_0x7134('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 04ab758..abf2082 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 _0x0c7e=['sequelize','STRING'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x0c7e,0x154));var _0xe0c7=function(_0x114967,_0xea9a59){_0x114967=_0x114967-0x0;var _0x5ca25f=_0x0c7e[_0x114967];return _0x5ca25f;};'use strict';var Sequelize=require(_0xe0c7('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe0c7('0x1')]}}; \ No newline at end of file +var _0x24b6=['exports','STRING'];(function(_0x348ae6,_0x86aac0){var _0x189205=function(_0x565a75){while(--_0x565a75){_0x348ae6['push'](_0x348ae6['shift']());}};_0x189205(++_0x86aac0);}(_0x24b6,0x124));var _0x624b=function(_0x21c521,_0x441100){_0x21c521=_0x21c521-0x0;var _0x13ae59=_0x24b6[_0x21c521];return _0x13ae59;};'use strict';var Sequelize=require('sequelize');module[_0x624b('0x0')]={'name':{'type':Sequelize[_0x624b('0x1')]},'description':{'type':Sequelize[_0x624b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 2716ba0..389a470 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 _0x223e=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getFields','FreshdeskField','sort','getSubjects','getDescriptions','getTags','findOne','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','where','pick','filter','merge'];(function(_0x1057a3,_0x28d9b7){var _0x131cdb=function(_0x47a386){while(--_0x47a386){_0x1057a3['push'](_0x1057a3['shift']());}};_0x131cdb(++_0x28d9b7);}(_0x223e,0x16a));var _0xe223=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x223e[_0xe8129c];return _0x709fc5;};'use strict';var emlformat=require(_0xe223('0x0'));var rimraf=require(_0xe223('0x1'));var zipdir=require(_0xe223('0x2'));var jsonpatch=require(_0xe223('0x3'));var rp=require(_0xe223('0x4'));var moment=require(_0xe223('0x5'));var BPromise=require(_0xe223('0x6'));var Mustache=require(_0xe223('0x7'));var util=require(_0xe223('0x8'));var path=require('path');var sox=require(_0xe223('0x9'));var csv=require('to-csv');var ejs=require(_0xe223('0xa'));var fs=require('fs');var fs_extra=require(_0xe223('0xb'));var _=require(_0xe223('0xc'));var squel=require(_0xe223('0xd'));var crypto=require(_0xe223('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe223('0xf'));var Papa=require(_0xe223('0x10'));var Redis=require('ioredis');var authService=require(_0xe223('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe223('0x12'));var logger=require(_0xe223('0x13'))(_0xe223('0x14'));var utils=require(_0xe223('0x15'));var config=require(_0xe223('0x16'));var licenseUtil=require(_0xe223('0x17'));var db=require(_0xe223('0x18'))['db'];function respondWithStatusCode(_0x524a61,_0x34e981){_0x34e981=_0x34e981||0xcc;return function(_0x397770){if(_0x397770){return _0x524a61['sendStatus'](_0x34e981);}return _0x524a61[_0xe223('0x19')](_0x34e981)['end']();};}function respondWithResult(_0x2983ec,_0x455fca){_0x455fca=_0x455fca||0xc8;return function(_0x52a162){if(_0x52a162){return _0x2983ec[_0xe223('0x19')](_0x455fca)[_0xe223('0x1a')](_0x52a162);}};}function respondWithFilteredResult(_0x31b028,_0x4046e9){return function(_0x292537){if(_0x292537){var _0x32c9b5=typeof _0x4046e9['offset']==='undefined'&&typeof _0x4046e9['limit']===_0xe223('0x1b');var _0x52059f=_0x292537[_0xe223('0x1c')];var _0x3254b8=_0x32c9b5?0x0:_0x4046e9[_0xe223('0x1d')];var _0x2464ce=_0x32c9b5?_0x292537['count']:_0x4046e9['offset']+_0x4046e9[_0xe223('0x1e')];var _0x4d6004;if(_0x2464ce>=_0x52059f){_0x2464ce=_0x52059f;_0x4d6004=0xc8;}else{_0x4d6004=0xce;}_0x31b028[_0xe223('0x19')](_0x4d6004);return _0x31b028[_0xe223('0x1f')](_0xe223('0x20'),_0x3254b8+'-'+_0x2464ce+'/'+_0x52059f)[_0xe223('0x1a')](_0x292537);}return null;};}function patchUpdates(_0x301e50){return function(_0x54d709){try{jsonpatch[_0xe223('0x21')](_0x54d709,_0x301e50,!![]);}catch(_0x6d9f9c){return BPromise[_0xe223('0x22')](_0x6d9f9c);}return _0x54d709[_0xe223('0x23')]();};}function saveUpdates(_0x426820,_0x7a9ff9){return function(_0x434115){if(_0x434115){return _0x434115['update'](_0x426820)[_0xe223('0x24')](function(_0x16f04a){return _0x16f04a;});}return null;};}function removeEntity(_0x590131,_0x1e22a3){return function(_0x26e7a5){if(_0x26e7a5){return _0x26e7a5[_0xe223('0x25')]()[_0xe223('0x24')](function(){_0x590131[_0xe223('0x19')](0xcc)[_0xe223('0x26')]();});}};}function handleEntityNotFound(_0x3d7ad9,_0x2a409e){return function(_0x49c51f){if(!_0x49c51f){_0x3d7ad9[_0xe223('0x27')](0x194);}return _0x49c51f;};}function handleError(_0x1766d2,_0x4f00cd){_0x4f00cd=_0x4f00cd||0x1f4;return function(_0x44641b){logger['error'](_0x44641b['stack']);if(_0x44641b[_0xe223('0x28')]){delete _0x44641b[_0xe223('0x28')];}_0x1766d2['status'](_0x4f00cd)['send'](_0x44641b);};}exports[_0xe223('0x29')]=function(_0x18dbaf,_0x23ed84){var _0x1edcf5={},_0x2392b3={},_0x431132={'count':0x0,'rows':[]};var _0x4a3990=_[_0xe223('0x2a')](db[_0xe223('0x2b')][_0xe223('0x2c')],function(_0xf85e97){return{'name':_0xf85e97[_0xe223('0x2d')],'type':_0xf85e97[_0xe223('0x2e')][_0xe223('0x2f')]};});_0x2392b3['model']=_['map'](_0x4a3990,_0xe223('0x28'));_0x2392b3[_0xe223('0x30')]=_[_0xe223('0x31')](_0x18dbaf[_0xe223('0x30')]);_0x2392b3[_0xe223('0x32')]=_[_0xe223('0x33')](_0x2392b3['model'],_0x2392b3[_0xe223('0x30')]);_0x1edcf5[_0xe223('0x34')]=_[_0xe223('0x33')](_0x2392b3['model'],qs['fields'](_0x18dbaf[_0xe223('0x30')][_0xe223('0x35')]));_0x1edcf5['attributes']=_0x1edcf5[_0xe223('0x34')][_0xe223('0x36')]?_0x1edcf5[_0xe223('0x34')]:_0x2392b3[_0xe223('0x37')];if(!_0x18dbaf[_0xe223('0x30')][_0xe223('0x38')](_0xe223('0x39'))){_0x1edcf5[_0xe223('0x1e')]=qs[_0xe223('0x1e')](_0x18dbaf['query'][_0xe223('0x1e')]);_0x1edcf5['offset']=qs['offset'](_0x18dbaf[_0xe223('0x30')]['offset']);}_0x1edcf5[_0xe223('0x3a')]=qs['sort'](_0x18dbaf['query']['sort']);_0x1edcf5[_0xe223('0x3b')]=qs[_0xe223('0x32')](_[_0xe223('0x3c')](_0x18dbaf[_0xe223('0x30')],_0x2392b3['filters']),_0x4a3990);if(_0x18dbaf[_0xe223('0x30')][_0xe223('0x3d')]){_0x1edcf5[_0xe223('0x3b')]=_[_0xe223('0x3e')](_0x1edcf5[_0xe223('0x3b')],{'$or':_[_0xe223('0x2a')](_0x4a3990,function(_0x3688c6){if(_0x3688c6[_0xe223('0x2e')]!=='VIRTUAL'){var _0x1990f={};_0x1990f[_0x3688c6[_0xe223('0x28')]]={'$like':'%'+_0x18dbaf[_0xe223('0x30')][_0xe223('0x3d')]+'%'};return _0x1990f;}})});}_0x1edcf5=_['merge']({},_0x1edcf5,_0x18dbaf[_0xe223('0x3f')]);var _0x35e4ca={'where':_0x1edcf5['where']};return db[_0xe223('0x2b')][_0xe223('0x1c')](_0x35e4ca)[_0xe223('0x24')](function(_0x2b5580){_0x431132[_0xe223('0x1c')]=_0x2b5580;if(_0x18dbaf[_0xe223('0x30')][_0xe223('0x40')]){_0x1edcf5[_0xe223('0x41')]=[{'all':!![]}];}return db[_0xe223('0x2b')][_0xe223('0x42')](_0x1edcf5);})[_0xe223('0x24')](function(_0x4ad4bc){_0x431132[_0xe223('0x43')]=_0x4ad4bc;return _0x431132;})[_0xe223('0x24')](respondWithFilteredResult(_0x23ed84,_0x1edcf5))[_0xe223('0x44')](handleError(_0x23ed84,null));};exports[_0xe223('0x45')]=function(_0x9b1b42,_0x57f494){var _0x12aeff={'raw':![],'where':{'id':_0x9b1b42[_0xe223('0x46')]['id']}},_0x5c778a={};_0x5c778a[_0xe223('0x37')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x5c778a['query']=_[_0xe223('0x31')](_0x9b1b42[_0xe223('0x30')]);_0x5c778a[_0xe223('0x32')]=_[_0xe223('0x33')](_0x5c778a[_0xe223('0x37')],_0x5c778a[_0xe223('0x30')]);_0x12aeff[_0xe223('0x34')]=_['intersection'](_0x5c778a[_0xe223('0x37')],qs[_0xe223('0x35')](_0x9b1b42[_0xe223('0x30')][_0xe223('0x35')]));_0x12aeff[_0xe223('0x34')]=_0x12aeff['attributes']['length']?_0x12aeff[_0xe223('0x34')]:_0x5c778a[_0xe223('0x37')];if(_0x9b1b42[_0xe223('0x30')]['includeAll']){_0x12aeff['include']=[{'all':!![]}];}_0x12aeff=_['merge']({},_0x12aeff,_0x9b1b42[_0xe223('0x3f')]);return db[_0xe223('0x2b')][_0xe223('0x47')](_0x12aeff)[_0xe223('0x24')](handleEntityNotFound(_0x57f494,null))[_0xe223('0x24')](respondWithResult(_0x57f494,null))[_0xe223('0x44')](handleError(_0x57f494,null));};exports['create']=function(_0x272132,_0x1485bc){return db[_0xe223('0x2b')][_0xe223('0x48')](_0x272132[_0xe223('0x49')],{})[_0xe223('0x24')](respondWithResult(_0x1485bc,0xc9))['catch'](handleError(_0x1485bc,null));};exports[_0xe223('0x4a')]=function(_0x55678a,_0x40a432){if(_0x55678a[_0xe223('0x49')]['id']){delete _0x55678a[_0xe223('0x49')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x55678a['params']['id']}})['then'](handleEntityNotFound(_0x40a432,null))[_0xe223('0x24')](saveUpdates(_0x55678a['body'],null))[_0xe223('0x24')](respondWithResult(_0x40a432,null))[_0xe223('0x44')](handleError(_0x40a432,null));};exports[_0xe223('0x25')]=function(_0x22b425,_0x46398e){return db[_0xe223('0x2b')][_0xe223('0x47')]({'where':{'id':_0x22b425[_0xe223('0x46')]['id']}})[_0xe223('0x24')](handleEntityNotFound(_0x46398e,null))[_0xe223('0x24')](removeEntity(_0x46398e,null))[_0xe223('0x44')](handleError(_0x46398e,null));};exports[_0xe223('0x4b')]=function(_0x462774,_0x46f1cf,_0x4d6d95){var _0xa5cca7={};var _0x1e6cac={};var _0x4a059b;var _0x3005fe;return db[_0xe223('0x2b')]['findOne']({'where':{'id':_0x462774[_0xe223('0x46')]['id']}})[_0xe223('0x24')](handleEntityNotFound(_0x46f1cf,null))['then'](function(_0x3f60d8){if(_0x3f60d8){_0x4a059b=_0x3f60d8;_0x1e6cac[_0xe223('0x37')]=_[_0xe223('0x31')](db[_0xe223('0x4c')][_0xe223('0x2c')]);_0x1e6cac['query']=_['keys'](_0x462774['query']);_0x1e6cac[_0xe223('0x32')]=_[_0xe223('0x33')](_0x1e6cac[_0xe223('0x37')],_0x1e6cac[_0xe223('0x30')]);_0xa5cca7[_0xe223('0x34')]=_[_0xe223('0x33')](_0x1e6cac[_0xe223('0x37')],qs[_0xe223('0x35')](_0x462774[_0xe223('0x30')][_0xe223('0x35')]));_0xa5cca7[_0xe223('0x34')]=_0xa5cca7[_0xe223('0x34')][_0xe223('0x36')]?_0xa5cca7[_0xe223('0x34')]:_0x1e6cac[_0xe223('0x37')];_0xa5cca7[_0xe223('0x3a')]=qs[_0xe223('0x4d')](_0x462774[_0xe223('0x30')][_0xe223('0x4d')]);_0xa5cca7[_0xe223('0x3b')]=qs[_0xe223('0x32')](_['pick'](_0x462774[_0xe223('0x30')],_0x1e6cac[_0xe223('0x32')]));if(_0x462774[_0xe223('0x30')]['filter']){_0xa5cca7[_0xe223('0x3b')]=_[_0xe223('0x3e')](_0xa5cca7[_0xe223('0x3b')],{'$or':_['map'](_0xa5cca7[_0xe223('0x34')],function(_0x3547ff){var _0x3a2cdc={};_0x3a2cdc[_0x3547ff]={'$like':'%'+_0x462774[_0xe223('0x30')]['filter']+'%'};return _0x3a2cdc;})});}_0xa5cca7=_[_0xe223('0x3e')]({},_0xa5cca7,_0x462774['options']);return _0x4a059b[_0xe223('0x4b')](_0xa5cca7);}})[_0xe223('0x24')](function(_0xe1717e){if(_0xe1717e){_0x3005fe=_0xe1717e[_0xe223('0x36')];if(!_0x462774[_0xe223('0x30')][_0xe223('0x38')](_0xe223('0x39'))){_0xa5cca7[_0xe223('0x1e')]=qs[_0xe223('0x1e')](_0x462774[_0xe223('0x30')]['limit']);_0xa5cca7[_0xe223('0x1d')]=qs[_0xe223('0x1d')](_0x462774[_0xe223('0x30')]['offset']);}return _0x4a059b[_0xe223('0x4b')](_0xa5cca7);}})[_0xe223('0x24')](function(_0x1bbeec){if(_0x1bbeec){return _0x1bbeec?{'count':_0x3005fe,'rows':_0x1bbeec}:null;}})[_0xe223('0x24')](respondWithResult(_0x46f1cf,null))[_0xe223('0x44')](handleError(_0x46f1cf,null));};exports[_0xe223('0x4e')]=function(_0x2f1967,_0x7d2d51,_0xa435b6){var _0x1d3906={};var _0x1fae89={};var _0x253baf;var _0x503d10;return db[_0xe223('0x2b')]['findOne']({'where':{'id':_0x2f1967[_0xe223('0x46')]['id']}})['then'](handleEntityNotFound(_0x7d2d51,null))[_0xe223('0x24')](function(_0x53e321){if(_0x53e321){_0x253baf=_0x53e321;_0x1fae89['model']=_[_0xe223('0x31')](db[_0xe223('0x4c')][_0xe223('0x2c')]);_0x1fae89[_0xe223('0x30')]=_[_0xe223('0x31')](_0x2f1967[_0xe223('0x30')]);_0x1fae89[_0xe223('0x32')]=_[_0xe223('0x33')](_0x1fae89[_0xe223('0x37')],_0x1fae89[_0xe223('0x30')]);_0x1d3906['attributes']=_[_0xe223('0x33')](_0x1fae89[_0xe223('0x37')],qs[_0xe223('0x35')](_0x2f1967[_0xe223('0x30')][_0xe223('0x35')]));_0x1d3906[_0xe223('0x34')]=_0x1d3906[_0xe223('0x34')][_0xe223('0x36')]?_0x1d3906[_0xe223('0x34')]:_0x1fae89[_0xe223('0x37')];_0x1d3906[_0xe223('0x3a')]=qs[_0xe223('0x4d')](_0x2f1967[_0xe223('0x30')][_0xe223('0x4d')]);_0x1d3906[_0xe223('0x3b')]=qs['filters'](_[_0xe223('0x3c')](_0x2f1967[_0xe223('0x30')],_0x1fae89['filters']));if(_0x2f1967['query'][_0xe223('0x3d')]){_0x1d3906[_0xe223('0x3b')]=_['merge'](_0x1d3906['where'],{'$or':_['map'](_0x1d3906[_0xe223('0x34')],function(_0x29cfa9){var _0x3d1bb8={};_0x3d1bb8[_0x29cfa9]={'$like':'%'+_0x2f1967[_0xe223('0x30')][_0xe223('0x3d')]+'%'};return _0x3d1bb8;})});}_0x1d3906=_[_0xe223('0x3e')]({},_0x1d3906,_0x2f1967[_0xe223('0x3f')]);return _0x253baf[_0xe223('0x4e')](_0x1d3906);}})[_0xe223('0x24')](function(_0x4bba3b){if(_0x4bba3b){_0x503d10=_0x4bba3b[_0xe223('0x36')];if(!_0x2f1967['query'][_0xe223('0x38')](_0xe223('0x39'))){_0x1d3906[_0xe223('0x1e')]=qs[_0xe223('0x1e')](_0x2f1967[_0xe223('0x30')][_0xe223('0x1e')]);_0x1d3906[_0xe223('0x1d')]=qs[_0xe223('0x1d')](_0x2f1967['query'][_0xe223('0x1d')]);}return _0x253baf[_0xe223('0x4e')](_0x1d3906);}})[_0xe223('0x24')](function(_0x3a7d21){if(_0x3a7d21){return _0x3a7d21?{'count':_0x503d10,'rows':_0x3a7d21}:null;}})['then'](respondWithResult(_0x7d2d51,null))[_0xe223('0x44')](handleError(_0x7d2d51,null));};exports['getDescriptions']=function(_0x226c9d,_0x5bc876,_0x565d8e){var _0x1557a5={};var _0x54a2c9={};var _0xc7527a;var _0x3b1bd9;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x226c9d['params']['id']}})[_0xe223('0x24')](handleEntityNotFound(_0x5bc876,null))['then'](function(_0xefaed2){if(_0xefaed2){_0xc7527a=_0xefaed2;_0x54a2c9[_0xe223('0x37')]=_[_0xe223('0x31')](db[_0xe223('0x4c')][_0xe223('0x2c')]);_0x54a2c9[_0xe223('0x30')]=_[_0xe223('0x31')](_0x226c9d['query']);_0x54a2c9[_0xe223('0x32')]=_[_0xe223('0x33')](_0x54a2c9[_0xe223('0x37')],_0x54a2c9['query']);_0x1557a5[_0xe223('0x34')]=_['intersection'](_0x54a2c9[_0xe223('0x37')],qs[_0xe223('0x35')](_0x226c9d[_0xe223('0x30')][_0xe223('0x35')]));_0x1557a5['attributes']=_0x1557a5[_0xe223('0x34')][_0xe223('0x36')]?_0x1557a5[_0xe223('0x34')]:_0x54a2c9[_0xe223('0x37')];_0x1557a5[_0xe223('0x3a')]=qs['sort'](_0x226c9d[_0xe223('0x30')][_0xe223('0x4d')]);_0x1557a5['where']=qs[_0xe223('0x32')](_[_0xe223('0x3c')](_0x226c9d[_0xe223('0x30')],_0x54a2c9[_0xe223('0x32')]));if(_0x226c9d[_0xe223('0x30')][_0xe223('0x3d')]){_0x1557a5[_0xe223('0x3b')]=_[_0xe223('0x3e')](_0x1557a5[_0xe223('0x3b')],{'$or':_[_0xe223('0x2a')](_0x1557a5[_0xe223('0x34')],function(_0x269a8f){var _0xa1c551={};_0xa1c551[_0x269a8f]={'$like':'%'+_0x226c9d[_0xe223('0x30')]['filter']+'%'};return _0xa1c551;})});}_0x1557a5=_[_0xe223('0x3e')]({},_0x1557a5,_0x226c9d['options']);return _0xc7527a['getDescriptions'](_0x1557a5);}})[_0xe223('0x24')](function(_0x2ece49){if(_0x2ece49){_0x3b1bd9=_0x2ece49['length'];if(!_0x226c9d[_0xe223('0x30')][_0xe223('0x38')](_0xe223('0x39'))){_0x1557a5[_0xe223('0x1e')]=qs['limit'](_0x226c9d[_0xe223('0x30')][_0xe223('0x1e')]);_0x1557a5[_0xe223('0x1d')]=qs[_0xe223('0x1d')](_0x226c9d[_0xe223('0x30')]['offset']);}return _0xc7527a[_0xe223('0x4f')](_0x1557a5);}})[_0xe223('0x24')](function(_0x1a8024){if(_0x1a8024){return _0x1a8024?{'count':_0x3b1bd9,'rows':_0x1a8024}:null;}})[_0xe223('0x24')](respondWithResult(_0x5bc876,null))[_0xe223('0x44')](handleError(_0x5bc876,null));};exports[_0xe223('0x50')]=function(_0x2469a0,_0x317b73,_0x1103be){var _0x24613e={};var _0x1d0016={};var _0x23008f;var _0x143abc;return db[_0xe223('0x2b')][_0xe223('0x51')]({'where':{'id':_0x2469a0[_0xe223('0x46')]['id']}})[_0xe223('0x24')](handleEntityNotFound(_0x317b73,null))[_0xe223('0x24')](function(_0x1af037){if(_0x1af037){_0x23008f=_0x1af037;_0x1d0016[_0xe223('0x37')]=_['keys'](db[_0xe223('0x52')][_0xe223('0x2c')]);_0x1d0016[_0xe223('0x30')]=_[_0xe223('0x31')](_0x2469a0[_0xe223('0x30')]);_0x1d0016[_0xe223('0x32')]=_['intersection'](_0x1d0016[_0xe223('0x37')],_0x1d0016[_0xe223('0x30')]);_0x24613e[_0xe223('0x34')]=_[_0xe223('0x33')](_0x1d0016[_0xe223('0x37')],qs[_0xe223('0x35')](_0x2469a0[_0xe223('0x30')][_0xe223('0x35')]));_0x24613e[_0xe223('0x34')]=_0x24613e[_0xe223('0x34')][_0xe223('0x36')]?_0x24613e['attributes']:_0x1d0016[_0xe223('0x37')];_0x24613e[_0xe223('0x3a')]=qs['sort'](_0x2469a0['query']['sort']);_0x24613e['where']=qs[_0xe223('0x32')](_[_0xe223('0x3c')](_0x2469a0[_0xe223('0x30')],_0x1d0016['filters']));if(_0x2469a0['query'][_0xe223('0x3d')]){_0x24613e[_0xe223('0x3b')]=_['merge'](_0x24613e[_0xe223('0x3b')],{'$or':_[_0xe223('0x2a')](_0x24613e[_0xe223('0x34')],function(_0x292787){var _0x255380={};_0x255380[_0x292787]={'$like':'%'+_0x2469a0[_0xe223('0x30')][_0xe223('0x3d')]+'%'};return _0x255380;})});}_0x24613e=_[_0xe223('0x3e')]({},_0x24613e,_0x2469a0['options']);return _0x23008f[_0xe223('0x50')](_0x24613e);}})[_0xe223('0x24')](function(_0xaefa28){if(_0xaefa28){_0x143abc=_0xaefa28[_0xe223('0x36')];if(!_0x2469a0['query'][_0xe223('0x38')](_0xe223('0x39'))){_0x24613e['limit']=qs['limit'](_0x2469a0[_0xe223('0x30')][_0xe223('0x1e')]);_0x24613e[_0xe223('0x1d')]=qs[_0xe223('0x1d')](_0x2469a0[_0xe223('0x30')][_0xe223('0x1d')]);}return _0x23008f[_0xe223('0x50')](_0x24613e);}})['then'](function(_0x2cf2a3){if(_0x2cf2a3){return _0x2cf2a3?{'count':_0x143abc,'rows':_0x2cf2a3}:null;}})[_0xe223('0x24')](respondWithResult(_0x317b73,null))[_0xe223('0x44')](handleError(_0x317b73,null));};exports[_0xe223('0x53')]=function(_0x1e8eb0,_0x346164,_0x37ff60){if(_0x1e8eb0[_0xe223('0x49')]['id']){delete _0x1e8eb0[_0xe223('0x49')]['id'];}return db[_0xe223('0x2b')][_0xe223('0x51')]({'where':{'id':_0x1e8eb0[_0xe223('0x46')]['id']}})[_0xe223('0x24')](handleEntityNotFound(_0x346164,null))['then'](function(_0x14dcbb){if(_0x14dcbb){return _0x14dcbb[_0xe223('0x53')](_0x1e8eb0['body'][_0xe223('0x54')]||[]);}return null;})['then'](respondWithResult(_0x346164,null))[_0xe223('0x44')](handleError(_0x346164,null));}; \ No newline at end of file +var _0x7641=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','length','options','find','create','body','update','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x319889,_0x13d5bf){var _0x4376e9=function(_0xfdf57c){while(--_0xfdf57c){_0x319889['push'](_0x319889['shift']());}};_0x4376e9(++_0x13d5bf);}(_0x7641,0x153));var _0x1764=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x7641[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require(_0x1764('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1764('0x1'));var jsonpatch=require(_0x1764('0x2'));var rp=require(_0x1764('0x3'));var moment=require(_0x1764('0x4'));var BPromise=require(_0x1764('0x5'));var Mustache=require(_0x1764('0x6'));var util=require(_0x1764('0x7'));var path=require(_0x1764('0x8'));var sox=require(_0x1764('0x9'));var csv=require(_0x1764('0xa'));var ejs=require(_0x1764('0xb'));var fs=require('fs');var fs_extra=require(_0x1764('0xc'));var _=require(_0x1764('0xd'));var squel=require('squel');var crypto=require(_0x1764('0xe'));var jsforce=require(_0x1764('0xf'));var deskjs=require(_0x1764('0x10'));var toCsv=require(_0x1764('0xa'));var querystring=require(_0x1764('0x11'));var Papa=require(_0x1764('0x12'));var Redis=require(_0x1764('0x13'));var authService=require(_0x1764('0x14'));var qs=require(_0x1764('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1764('0x16'));var logger=require(_0x1764('0x17'))(_0x1764('0x18'));var utils=require(_0x1764('0x19'));var config=require(_0x1764('0x1a'));var licenseUtil=require(_0x1764('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53f72f,_0x4d3bec){_0x4d3bec=_0x4d3bec||0xcc;return function(_0xe1abe9){if(_0xe1abe9){return _0x53f72f[_0x1764('0x1c')](_0x4d3bec);}return _0x53f72f['status'](_0x4d3bec)[_0x1764('0x1d')]();};}function respondWithResult(_0x421f2f,_0x459014){_0x459014=_0x459014||0xc8;return function(_0x3298bb){if(_0x3298bb){return _0x421f2f[_0x1764('0x1e')](_0x459014)[_0x1764('0x1f')](_0x3298bb);}};}function respondWithFilteredResult(_0x429877,_0x2bfb62){return function(_0x1ad53d){if(_0x1ad53d){var _0xe77604=typeof _0x2bfb62['offset']===_0x1764('0x20')&&typeof _0x2bfb62[_0x1764('0x21')]==='undefined';var _0x56ce4b=_0x1ad53d[_0x1764('0x22')];var _0x220e22=_0xe77604?0x0:_0x2bfb62[_0x1764('0x23')];var _0x9a67bc=_0xe77604?_0x1ad53d[_0x1764('0x22')]:_0x2bfb62['offset']+_0x2bfb62[_0x1764('0x21')];var _0x2a6d19;if(_0x9a67bc>=_0x56ce4b){_0x9a67bc=_0x56ce4b;_0x2a6d19=0xc8;}else{_0x2a6d19=0xce;}_0x429877[_0x1764('0x1e')](_0x2a6d19);return _0x429877[_0x1764('0x24')](_0x1764('0x25'),_0x220e22+'-'+_0x9a67bc+'/'+_0x56ce4b)[_0x1764('0x1f')](_0x1ad53d);}return null;};}function patchUpdates(_0x1aa81f){return function(_0x29b446){try{jsonpatch[_0x1764('0x26')](_0x29b446,_0x1aa81f,!![]);}catch(_0x29482c){return BPromise['reject'](_0x29482c);}return _0x29b446[_0x1764('0x27')]();};}function saveUpdates(_0x5e4467,_0x3e4782){return function(_0x5eceda){if(_0x5eceda){return _0x5eceda['update'](_0x5e4467)[_0x1764('0x28')](function(_0x5ed137){return _0x5ed137;});}return null;};}function removeEntity(_0xd51343,_0x370d9e){return function(_0x4cd659){if(_0x4cd659){return _0x4cd659[_0x1764('0x29')]()['then'](function(){_0xd51343[_0x1764('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aade1,_0x77853b){return function(_0x45ab7f){if(!_0x45ab7f){_0x5aade1[_0x1764('0x1c')](0x194);}return _0x45ab7f;};}function handleError(_0x37cabf,_0x4928e6){_0x4928e6=_0x4928e6||0x1f4;return function(_0x460e55){logger[_0x1764('0x2a')](_0x460e55[_0x1764('0x2b')]);if(_0x460e55[_0x1764('0x2c')]){delete _0x460e55['name'];}_0x37cabf[_0x1764('0x1e')](_0x4928e6)[_0x1764('0x2d')](_0x460e55);};}exports['index']=function(_0x1f4d6b,_0x32c9dd){var _0x336bb3={},_0x2b9d87={},_0x45ebb8={'count':0x0,'rows':[]};var _0x353643=_[_0x1764('0x2e')](db[_0x1764('0x2f')][_0x1764('0x30')],function(_0x10453d){return{'name':_0x10453d[_0x1764('0x31')],'type':_0x10453d[_0x1764('0x32')][_0x1764('0x33')]};});_0x2b9d87[_0x1764('0x34')]=_['map'](_0x353643,_0x1764('0x2c'));_0x2b9d87['query']=_[_0x1764('0x35')](_0x1f4d6b[_0x1764('0x36')]);_0x2b9d87[_0x1764('0x37')]=_[_0x1764('0x38')](_0x2b9d87[_0x1764('0x34')],_0x2b9d87[_0x1764('0x36')]);_0x336bb3['attributes']=_[_0x1764('0x38')](_0x2b9d87[_0x1764('0x34')],qs[_0x1764('0x39')](_0x1f4d6b['query'][_0x1764('0x39')]));_0x336bb3[_0x1764('0x3a')]=_0x336bb3['attributes']['length']?_0x336bb3[_0x1764('0x3a')]:_0x2b9d87[_0x1764('0x34')];if(!_0x1f4d6b[_0x1764('0x36')][_0x1764('0x3b')](_0x1764('0x3c'))){_0x336bb3[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x1f4d6b[_0x1764('0x36')][_0x1764('0x21')]);_0x336bb3[_0x1764('0x23')]=qs[_0x1764('0x23')](_0x1f4d6b['query'][_0x1764('0x23')]);}_0x336bb3[_0x1764('0x3d')]=qs[_0x1764('0x3e')](_0x1f4d6b[_0x1764('0x36')][_0x1764('0x3e')]);_0x336bb3[_0x1764('0x3f')]=qs[_0x1764('0x37')](_[_0x1764('0x40')](_0x1f4d6b[_0x1764('0x36')],_0x2b9d87[_0x1764('0x37')]),_0x353643);if(_0x1f4d6b[_0x1764('0x36')][_0x1764('0x41')]){_0x336bb3[_0x1764('0x3f')]=_[_0x1764('0x42')](_0x336bb3[_0x1764('0x3f')],{'$or':_['map'](_0x353643,function(_0x11209c){if(_0x11209c['type']!==_0x1764('0x43')){var _0x1e7ec4={};_0x1e7ec4[_0x11209c[_0x1764('0x2c')]]={'$like':'%'+_0x1f4d6b[_0x1764('0x36')][_0x1764('0x41')]+'%'};return _0x1e7ec4;}})});}_0x336bb3=_[_0x1764('0x42')]({},_0x336bb3,_0x1f4d6b['options']);var _0x2c5a2e={'where':_0x336bb3['where']};return db[_0x1764('0x2f')][_0x1764('0x22')](_0x2c5a2e)[_0x1764('0x28')](function(_0x51d8e9){_0x45ebb8[_0x1764('0x22')]=_0x51d8e9;if(_0x1f4d6b[_0x1764('0x36')][_0x1764('0x44')]){_0x336bb3[_0x1764('0x45')]=[{'all':!![]}];}return db[_0x1764('0x2f')]['findAll'](_0x336bb3);})[_0x1764('0x28')](function(_0x51a038){_0x45ebb8[_0x1764('0x46')]=_0x51a038;return _0x45ebb8;})[_0x1764('0x28')](respondWithFilteredResult(_0x32c9dd,_0x336bb3))[_0x1764('0x47')](handleError(_0x32c9dd,null));};exports['show']=function(_0x50316f,_0x207dad){var _0xddf06c={'raw':![],'where':{'id':_0x50316f[_0x1764('0x48')]['id']}},_0x1aac08={};_0x1aac08[_0x1764('0x34')]=_[_0x1764('0x35')](db['FreshdeskConfiguration'][_0x1764('0x30')]);_0x1aac08[_0x1764('0x36')]=_[_0x1764('0x35')](_0x50316f[_0x1764('0x36')]);_0x1aac08['filters']=_[_0x1764('0x38')](_0x1aac08[_0x1764('0x34')],_0x1aac08[_0x1764('0x36')]);_0xddf06c[_0x1764('0x3a')]=_['intersection'](_0x1aac08[_0x1764('0x34')],qs[_0x1764('0x39')](_0x50316f[_0x1764('0x36')][_0x1764('0x39')]));_0xddf06c[_0x1764('0x3a')]=_0xddf06c['attributes'][_0x1764('0x49')]?_0xddf06c[_0x1764('0x3a')]:_0x1aac08[_0x1764('0x34')];if(_0x50316f[_0x1764('0x36')]['includeAll']){_0xddf06c[_0x1764('0x45')]=[{'all':!![]}];}_0xddf06c=_[_0x1764('0x42')]({},_0xddf06c,_0x50316f[_0x1764('0x4a')]);return db['FreshdeskConfiguration'][_0x1764('0x4b')](_0xddf06c)[_0x1764('0x28')](handleEntityNotFound(_0x207dad,null))['then'](respondWithResult(_0x207dad,null))[_0x1764('0x47')](handleError(_0x207dad,null));};exports[_0x1764('0x4c')]=function(_0x1b308e,_0x104d83){return db[_0x1764('0x2f')][_0x1764('0x4c')](_0x1b308e[_0x1764('0x4d')],{})[_0x1764('0x28')](respondWithResult(_0x104d83,0xc9))[_0x1764('0x47')](handleError(_0x104d83,null));};exports[_0x1764('0x4e')]=function(_0x48882a,_0x12fe7e){if(_0x48882a[_0x1764('0x4d')]['id']){delete _0x48882a[_0x1764('0x4d')]['id'];}return db[_0x1764('0x2f')][_0x1764('0x4b')]({'where':{'id':_0x48882a[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x12fe7e,null))[_0x1764('0x28')](saveUpdates(_0x48882a['body'],null))[_0x1764('0x28')](respondWithResult(_0x12fe7e,null))[_0x1764('0x47')](handleError(_0x12fe7e,null));};exports['destroy']=function(_0x2f1d3e,_0x256d19){return db['FreshdeskConfiguration'][_0x1764('0x4b')]({'where':{'id':_0x2f1d3e[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x256d19,null))['then'](removeEntity(_0x256d19,null))[_0x1764('0x47')](handleError(_0x256d19,null));};exports[_0x1764('0x4f')]=function(_0x1d562f,_0x545d9b,_0x49b976){var _0xc29e9f={};var _0x137215={};var _0x526e29;var _0x89aa63;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x1d562f[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x545d9b,null))[_0x1764('0x28')](function(_0x2ad0fd){if(_0x2ad0fd){_0x526e29=_0x2ad0fd;_0x137215[_0x1764('0x34')]=_[_0x1764('0x35')](db[_0x1764('0x51')][_0x1764('0x30')]);_0x137215['query']=_['keys'](_0x1d562f[_0x1764('0x36')]);_0x137215[_0x1764('0x37')]=_['intersection'](_0x137215['model'],_0x137215['query']);_0xc29e9f[_0x1764('0x3a')]=_[_0x1764('0x38')](_0x137215[_0x1764('0x34')],qs[_0x1764('0x39')](_0x1d562f['query'][_0x1764('0x39')]));_0xc29e9f[_0x1764('0x3a')]=_0xc29e9f['attributes']['length']?_0xc29e9f[_0x1764('0x3a')]:_0x137215[_0x1764('0x34')];_0xc29e9f[_0x1764('0x3d')]=qs['sort'](_0x1d562f[_0x1764('0x36')][_0x1764('0x3e')]);_0xc29e9f['where']=qs[_0x1764('0x37')](_['pick'](_0x1d562f[_0x1764('0x36')],_0x137215[_0x1764('0x37')]));if(_0x1d562f['query'][_0x1764('0x41')]){_0xc29e9f[_0x1764('0x3f')]=_[_0x1764('0x42')](_0xc29e9f['where'],{'$or':_[_0x1764('0x2e')](_0xc29e9f[_0x1764('0x3a')],function(_0x2a10aa){var _0x4ea327={};_0x4ea327[_0x2a10aa]={'$like':'%'+_0x1d562f[_0x1764('0x36')]['filter']+'%'};return _0x4ea327;})});}_0xc29e9f=_['merge']({},_0xc29e9f,_0x1d562f[_0x1764('0x4a')]);return _0x526e29[_0x1764('0x4f')](_0xc29e9f);}})[_0x1764('0x28')](function(_0x169ab6){if(_0x169ab6){_0x89aa63=_0x169ab6['length'];if(!_0x1d562f[_0x1764('0x36')][_0x1764('0x3b')](_0x1764('0x3c'))){_0xc29e9f[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x1d562f[_0x1764('0x36')][_0x1764('0x21')]);_0xc29e9f[_0x1764('0x23')]=qs['offset'](_0x1d562f['query'][_0x1764('0x23')]);}return _0x526e29['getFields'](_0xc29e9f);}})[_0x1764('0x28')](function(_0x3c2540){if(_0x3c2540){return _0x3c2540?{'count':_0x89aa63,'rows':_0x3c2540}:null;}})[_0x1764('0x28')](respondWithResult(_0x545d9b,null))[_0x1764('0x47')](handleError(_0x545d9b,null));};exports[_0x1764('0x52')]=function(_0x2a6ca7,_0x57dfe8,_0x40b264){var _0x456cab={};var _0x2859c5={};var _0x38aa04;var _0x5d7bba;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x2a6ca7[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x57dfe8,null))[_0x1764('0x28')](function(_0x598240){if(_0x598240){_0x38aa04=_0x598240;_0x2859c5[_0x1764('0x34')]=_['keys'](db[_0x1764('0x51')][_0x1764('0x30')]);_0x2859c5[_0x1764('0x36')]=_[_0x1764('0x35')](_0x2a6ca7[_0x1764('0x36')]);_0x2859c5[_0x1764('0x37')]=_[_0x1764('0x38')](_0x2859c5['model'],_0x2859c5[_0x1764('0x36')]);_0x456cab['attributes']=_[_0x1764('0x38')](_0x2859c5[_0x1764('0x34')],qs['fields'](_0x2a6ca7[_0x1764('0x36')][_0x1764('0x39')]));_0x456cab['attributes']=_0x456cab[_0x1764('0x3a')][_0x1764('0x49')]?_0x456cab[_0x1764('0x3a')]:_0x2859c5[_0x1764('0x34')];_0x456cab[_0x1764('0x3d')]=qs[_0x1764('0x3e')](_0x2a6ca7[_0x1764('0x36')][_0x1764('0x3e')]);_0x456cab[_0x1764('0x3f')]=qs['filters'](_[_0x1764('0x40')](_0x2a6ca7[_0x1764('0x36')],_0x2859c5['filters']));if(_0x2a6ca7['query'][_0x1764('0x41')]){_0x456cab['where']=_[_0x1764('0x42')](_0x456cab[_0x1764('0x3f')],{'$or':_[_0x1764('0x2e')](_0x456cab[_0x1764('0x3a')],function(_0x3763b5){var _0x2d181d={};_0x2d181d[_0x3763b5]={'$like':'%'+_0x2a6ca7['query'][_0x1764('0x41')]+'%'};return _0x2d181d;})});}_0x456cab=_['merge']({},_0x456cab,_0x2a6ca7['options']);return _0x38aa04['getSubjects'](_0x456cab);}})['then'](function(_0x38d3d9){if(_0x38d3d9){_0x5d7bba=_0x38d3d9['length'];if(!_0x2a6ca7['query'][_0x1764('0x3b')](_0x1764('0x3c'))){_0x456cab[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x2a6ca7[_0x1764('0x36')][_0x1764('0x21')]);_0x456cab[_0x1764('0x23')]=qs[_0x1764('0x23')](_0x2a6ca7[_0x1764('0x36')]['offset']);}return _0x38aa04['getSubjects'](_0x456cab);}})[_0x1764('0x28')](function(_0x3752f1){if(_0x3752f1){return _0x3752f1?{'count':_0x5d7bba,'rows':_0x3752f1}:null;}})[_0x1764('0x28')](respondWithResult(_0x57dfe8,null))[_0x1764('0x47')](handleError(_0x57dfe8,null));};exports[_0x1764('0x53')]=function(_0x5d9e60,_0x34ab8f,_0x18c002){var _0x3747a7={};var _0x847962={};var _0x266b0b;var _0x3c8aeb;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x5d9e60[_0x1764('0x48')]['id']}})[_0x1764('0x28')](handleEntityNotFound(_0x34ab8f,null))[_0x1764('0x28')](function(_0x27dfa9){if(_0x27dfa9){_0x266b0b=_0x27dfa9;_0x847962[_0x1764('0x34')]=_[_0x1764('0x35')](db[_0x1764('0x51')][_0x1764('0x30')]);_0x847962['query']=_[_0x1764('0x35')](_0x5d9e60[_0x1764('0x36')]);_0x847962[_0x1764('0x37')]=_[_0x1764('0x38')](_0x847962[_0x1764('0x34')],_0x847962[_0x1764('0x36')]);_0x3747a7['attributes']=_[_0x1764('0x38')](_0x847962[_0x1764('0x34')],qs[_0x1764('0x39')](_0x5d9e60[_0x1764('0x36')]['fields']));_0x3747a7[_0x1764('0x3a')]=_0x3747a7[_0x1764('0x3a')][_0x1764('0x49')]?_0x3747a7[_0x1764('0x3a')]:_0x847962['model'];_0x3747a7['order']=qs[_0x1764('0x3e')](_0x5d9e60[_0x1764('0x36')][_0x1764('0x3e')]);_0x3747a7[_0x1764('0x3f')]=qs[_0x1764('0x37')](_[_0x1764('0x40')](_0x5d9e60[_0x1764('0x36')],_0x847962['filters']));if(_0x5d9e60[_0x1764('0x36')]['filter']){_0x3747a7[_0x1764('0x3f')]=_['merge'](_0x3747a7['where'],{'$or':_[_0x1764('0x2e')](_0x3747a7[_0x1764('0x3a')],function(_0x46739b){var _0x3d9458={};_0x3d9458[_0x46739b]={'$like':'%'+_0x5d9e60[_0x1764('0x36')][_0x1764('0x41')]+'%'};return _0x3d9458;})});}_0x3747a7=_[_0x1764('0x42')]({},_0x3747a7,_0x5d9e60[_0x1764('0x4a')]);return _0x266b0b[_0x1764('0x53')](_0x3747a7);}})[_0x1764('0x28')](function(_0x530793){if(_0x530793){_0x3c8aeb=_0x530793[_0x1764('0x49')];if(!_0x5d9e60[_0x1764('0x36')][_0x1764('0x3b')]('nolimit')){_0x3747a7[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x5d9e60[_0x1764('0x36')][_0x1764('0x21')]);_0x3747a7[_0x1764('0x23')]=qs['offset'](_0x5d9e60[_0x1764('0x36')][_0x1764('0x23')]);}return _0x266b0b['getDescriptions'](_0x3747a7);}})[_0x1764('0x28')](function(_0xd5b4a9){if(_0xd5b4a9){return _0xd5b4a9?{'count':_0x3c8aeb,'rows':_0xd5b4a9}:null;}})[_0x1764('0x28')](respondWithResult(_0x34ab8f,null))[_0x1764('0x47')](handleError(_0x34ab8f,null));};exports[_0x1764('0x54')]=function(_0x43107e,_0x2a0fd8,_0x6d6154){var _0x4d6afb={};var _0x262546={};var _0x3b9587;var _0xaf1d01;return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x43107e[_0x1764('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a0fd8,null))['then'](function(_0x30faaf){if(_0x30faaf){_0x3b9587=_0x30faaf;_0x262546[_0x1764('0x34')]=_['keys'](db[_0x1764('0x55')][_0x1764('0x30')]);_0x262546['query']=_[_0x1764('0x35')](_0x43107e['query']);_0x262546[_0x1764('0x37')]=_['intersection'](_0x262546[_0x1764('0x34')],_0x262546[_0x1764('0x36')]);_0x4d6afb[_0x1764('0x3a')]=_[_0x1764('0x38')](_0x262546['model'],qs[_0x1764('0x39')](_0x43107e[_0x1764('0x36')][_0x1764('0x39')]));_0x4d6afb[_0x1764('0x3a')]=_0x4d6afb[_0x1764('0x3a')]['length']?_0x4d6afb['attributes']:_0x262546['model'];_0x4d6afb[_0x1764('0x3d')]=qs[_0x1764('0x3e')](_0x43107e['query']['sort']);_0x4d6afb[_0x1764('0x3f')]=qs[_0x1764('0x37')](_['pick'](_0x43107e[_0x1764('0x36')],_0x262546['filters']));if(_0x43107e['query'][_0x1764('0x41')]){_0x4d6afb[_0x1764('0x3f')]=_[_0x1764('0x42')](_0x4d6afb[_0x1764('0x3f')],{'$or':_[_0x1764('0x2e')](_0x4d6afb['attributes'],function(_0xf14f65){var _0xe7f383={};_0xe7f383[_0xf14f65]={'$like':'%'+_0x43107e['query'][_0x1764('0x41')]+'%'};return _0xe7f383;})});}_0x4d6afb=_[_0x1764('0x42')]({},_0x4d6afb,_0x43107e['options']);return _0x3b9587['getTags'](_0x4d6afb);}})[_0x1764('0x28')](function(_0x5745a6){if(_0x5745a6){_0xaf1d01=_0x5745a6[_0x1764('0x49')];if(!_0x43107e[_0x1764('0x36')][_0x1764('0x3b')](_0x1764('0x3c'))){_0x4d6afb[_0x1764('0x21')]=qs[_0x1764('0x21')](_0x43107e['query']['limit']);_0x4d6afb[_0x1764('0x23')]=qs[_0x1764('0x23')](_0x43107e[_0x1764('0x36')]['offset']);}return _0x3b9587[_0x1764('0x54')](_0x4d6afb);}})[_0x1764('0x28')](function(_0x51b8db){if(_0x51b8db){return _0x51b8db?{'count':_0xaf1d01,'rows':_0x51b8db}:null;}})['then'](respondWithResult(_0x2a0fd8,null))[_0x1764('0x47')](handleError(_0x2a0fd8,null));};exports[_0x1764('0x56')]=function(_0x59c1c3,_0x2cedb4,_0x4fff65){if(_0x59c1c3[_0x1764('0x4d')]['id']){delete _0x59c1c3['body']['id'];}return db[_0x1764('0x2f')][_0x1764('0x50')]({'where':{'id':_0x59c1c3[_0x1764('0x48')]['id']}})[_0x1764('0x28')](handleEntityNotFound(_0x2cedb4,null))['then'](function(_0x448fda){if(_0x448fda){return _0x448fda['setTags'](_0x59c1c3[_0x1764('0x4d')][_0x1764('0x57')]||[]);}return null;})[_0x1764('0x28')](respondWithResult(_0x2cedb4,null))['catch'](handleError(_0x2cedb4,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index aef1537..74ecb85 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 _0xd9b8=['bluebird','request-promise','path','rimraf','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment'];(function(_0x153a5d,_0x2d4fe2){var _0x33c47c=function(_0x40ba82){while(--_0x40ba82){_0x153a5d['push'](_0x153a5d['shift']());}};_0x33c47c(++_0x2d4fe2);}(_0xd9b8,0x146));var _0x8d9b=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0xd9b8[_0x1af5b2];return _0xf1aa2d;};'use strict';var _=require(_0x8d9b('0x0'));var util=require(_0x8d9b('0x1'));var logger=require('../../config/logger')(_0x8d9b('0x2'));var moment=require(_0x8d9b('0x3'));var BPromise=require(_0x8d9b('0x4'));var rp=require(_0x8d9b('0x5'));var fs=require('fs');var path=require(_0x8d9b('0x6'));var rimraf=require(_0x8d9b('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x8d9b('0x8')]=function(_0x4fd631,_0x55f5d3){return _0x4fd631['define'](_0x8d9b('0x9'),attributes,{'tableName':_0x8d9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42e9=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util'];(function(_0x3b0c93,_0x1d4e5d){var _0x14fd4a=function(_0x22ed7c){while(--_0x22ed7c){_0x3b0c93['push'](_0x3b0c93['shift']());}};_0x14fd4a(++_0x1d4e5d);}(_0x42e9,0x106));var _0x942e=function(_0x88164c,_0xc9afd4){_0x88164c=_0x88164c-0x0;var _0x1ef9a1=_0x42e9[_0x88164c];return _0x1ef9a1;};'use strict';var _=require(_0x942e('0x0'));var util=require(_0x942e('0x1'));var logger=require('../../config/logger')(_0x942e('0x2'));var moment=require(_0x942e('0x3'));var BPromise=require(_0x942e('0x4'));var rp=require(_0x942e('0x5'));var fs=require('fs');var path=require(_0x942e('0x6'));var rimraf=require('rimraf');var config=require(_0x942e('0x7'));var attributes=require(_0x942e('0x8'));module[_0x942e('0x9')]=function(_0x32904d,_0x5eff64){return _0x32904d[_0x942e('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0x942e('0xb'),'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 4b73942..aed6008 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 _0xef8d=['error','code','message','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xef8d,0x97));var _0xdef8=function(_0x182891,_0x4716b0){_0x182891=_0x182891-0x0;var _0x166fb5=_0xef8d[_0x182891];return _0x166fb5;};'use strict';var _=require(_0xdef8('0x0'));var util=require(_0xdef8('0x1'));var moment=require('moment');var BPromise=require(_0xdef8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdef8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdef8('0x4'));var logger=require('../../config/logger')(_0xdef8('0x5'));var config=require(_0xdef8('0x6'));var jayson=require(_0xdef8('0x7'));var client=jayson[_0xdef8('0x8')][_0xdef8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3890d7,_0xbc8147,_0x2f2b87){return new BPromise(function(_0x13d3cf,_0x1b3610){return client[_0xdef8('0xa')](_0x3890d7,_0x2f2b87)[_0xdef8('0xb')](function(_0x77801f){logger[_0xdef8('0xc')](_0xdef8('0xd'),_0xbc8147,_0xdef8('0xe'));logger['debug'](_0xdef8('0xf'),_0xbc8147,_0xdef8('0xe'),JSON[_0xdef8('0x10')](_0x77801f));if(_0x77801f[_0xdef8('0x11')]){if(_0x77801f[_0xdef8('0x11')][_0xdef8('0x12')]===0x1f4){logger[_0xdef8('0x11')](_0xdef8('0xd'),_0xbc8147,_0x77801f['error']['message']);return _0x1b3610(_0x77801f[_0xdef8('0x11')]['message']);}logger[_0xdef8('0x11')](_0xdef8('0xd'),_0xbc8147,_0x77801f[_0xdef8('0x11')][_0xdef8('0x13')]);return _0x13d3cf(_0x77801f[_0xdef8('0x11')]['message']);}else{logger[_0xdef8('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xbc8147,'request\x20sent');_0x13d3cf(_0x77801f['result']['message']);}})[_0xdef8('0x14')](function(_0x296448){logger[_0xdef8('0x11')](_0xdef8('0xd'),_0xbc8147,_0x296448);_0x1b3610(_0x296448);});});} \ No newline at end of file +var _0xf982=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x48b2cb,_0x5da5e7){var _0x3ad90f=function(_0x432a1e){while(--_0x432a1e){_0x48b2cb['push'](_0x48b2cb['shift']());}};_0x3ad90f(++_0x5da5e7);}(_0xf982,0xf6));var _0x2f98=function(_0x275594,_0x1c7994){_0x275594=_0x275594-0x0;var _0x3f4f9b=_0xf982[_0x275594];return _0x3f4f9b;};'use strict';var _=require(_0x2f98('0x0'));var util=require(_0x2f98('0x1'));var moment=require(_0x2f98('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f98('0x3'));var fs=require('fs');var Redis=require(_0x2f98('0x4'));var db=require(_0x2f98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f98('0x6'))(_0x2f98('0x7'));var config=require(_0x2f98('0x8'));var jayson=require(_0x2f98('0x9'));var client=jayson[_0x2f98('0xa')][_0x2f98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487c46,_0x107ce7,_0x33e449){return new BPromise(function(_0x5067fe,_0x325299){return client[_0x2f98('0xc')](_0x487c46,_0x33e449)[_0x2f98('0xd')](function(_0x4039b2){logger[_0x2f98('0xe')](_0x2f98('0xf'),_0x107ce7,_0x2f98('0x10'));logger[_0x2f98('0x11')](_0x2f98('0x12'),_0x107ce7,_0x2f98('0x10'),JSON[_0x2f98('0x13')](_0x4039b2));if(_0x4039b2[_0x2f98('0x14')]){if(_0x4039b2[_0x2f98('0x14')][_0x2f98('0x15')]===0x1f4){logger[_0x2f98('0x14')](_0x2f98('0xf'),_0x107ce7,_0x4039b2[_0x2f98('0x14')][_0x2f98('0x16')]);return _0x325299(_0x4039b2['error'][_0x2f98('0x16')]);}logger[_0x2f98('0x14')](_0x2f98('0xf'),_0x107ce7,_0x4039b2[_0x2f98('0x14')][_0x2f98('0x16')]);return _0x5067fe(_0x4039b2[_0x2f98('0x14')][_0x2f98('0x16')]);}else{logger[_0x2f98('0xe')](_0x2f98('0xf'),_0x107ce7,'request\x20sent');_0x5067fe(_0x4039b2[_0x2f98('0x17')][_0x2f98('0x16')]);}})[_0x2f98('0x18')](function(_0x34b903){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x107ce7,_0x34b903);_0x325299(_0x34b903);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 15bd411..6f67b5b 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 _0x48eb=['../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra'];(function(_0x4e85f2,_0x1cf40b){var _0x3ac183=function(_0x11d3a6){while(--_0x11d3a6){_0x4e85f2['push'](_0x4e85f2['shift']());}};_0x3ac183(++_0x1cf40b);}(_0x48eb,0x12d));var _0xb48e=function(_0x4f1a01,_0x42ff0c){_0x4f1a01=_0x4f1a01-0x0;var _0x1220db=_0x48eb[_0x4f1a01];return _0x1220db;};'use strict';var multer=require(_0xb48e('0x0'));var util=require('util');var path=require(_0xb48e('0x1'));var timeout=require(_0xb48e('0x2'));var express=require(_0xb48e('0x3'));var router=express['Router']();var fs_extra=require(_0xb48e('0x4'));var auth=require(_0xb48e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb48e('0x6'));var controller=require(_0xb48e('0x7'));router[_0xb48e('0x8')]('/',auth[_0xb48e('0x9')](),controller['index']);router['get'](_0xb48e('0xa'),auth[_0xb48e('0x9')](),controller[_0xb48e('0xb')]);router[_0xb48e('0xc')]('/',auth[_0xb48e('0x9')](),controller['create']);router[_0xb48e('0xd')](_0xb48e('0xa'),auth[_0xb48e('0x9')](),controller[_0xb48e('0xe')]);router[_0xb48e('0xf')](_0xb48e('0xa'),auth[_0xb48e('0x9')](),controller[_0xb48e('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa51f=['./intFreshdeskField.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa51f,0x19b));var _0xfa51=function(_0x3e6647,_0x2c0d09){_0x3e6647=_0x3e6647-0x0;var _0x46bddd=_0xa51f[_0x3e6647];return _0x46bddd;};'use strict';var multer=require(_0xfa51('0x0'));var util=require(_0xfa51('0x1'));var path=require(_0xfa51('0x2'));var timeout=require(_0xfa51('0x3'));var express=require(_0xfa51('0x4'));var router=express['Router']();var fs_extra=require(_0xfa51('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa51('0x6'));var config=require('../../config/environment');var controller=require(_0xfa51('0x7'));router[_0xfa51('0x8')]('/',auth[_0xfa51('0x9')](),controller[_0xfa51('0xa')]);router[_0xfa51('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfa51('0xb')]('/',auth[_0xfa51('0x9')](),controller[_0xfa51('0xc')]);router[_0xfa51('0xd')](_0xfa51('0xe'),auth['isAuthenticated'](),controller[_0xfa51('0xf')]);router[_0xfa51('0x10')](_0xfa51('0xe'),auth[_0xfa51('0x9')](),controller[_0xfa51('0x11')]);module[_0xfa51('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index f71bfd3..bf69a49 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 _0x7421=['customVariable','picklist','STRING','ENUM','BOOLEAN','string','variable'];(function(_0x488042,_0x2bd4f2){var _0x5c75ff=function(_0xfc3d37){while(--_0xfc3d37){_0x488042['push'](_0x488042['shift']());}};_0x5c75ff(++_0x2bd4f2);}(_0x7421,0xf3));var _0x1742=function(_0x978037,_0x731e6b){_0x978037=_0x978037-0x0;var _0xed75c9=_0x7421[_0x978037];return _0xed75c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x1742('0x0'),_0x1742('0x1'),_0x1742('0x2'),'keyValue',_0x1742('0x3')),'defaultValue':_0x1742('0x0')},'content':{'type':Sequelize[_0x1742('0x4')]},'key':{'type':Sequelize[_0x1742('0x4')]},'keyType':{'type':Sequelize[_0x1742('0x5')]('string',_0x1742('0x1'),_0x1742('0x2'))},'keyContent':{'type':Sequelize[_0x1742('0x4')]},'idField':{'type':Sequelize[_0x1742('0x4')]},'nameField':{'type':Sequelize[_0x1742('0x4')]},'customField':{'type':Sequelize[_0x1742('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3c7e=['sequelize','exports','ENUM','string','variable','customVariable','STRING','BOOLEAN'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x3c7e,0x1e0));var _0xe3c7=function(_0x1c7502,_0x5d2c70){_0x1c7502=_0x1c7502-0x0;var _0x2165fa=_0x3c7e[_0x1c7502];return _0x2165fa;};'use strict';var Sequelize=require(_0xe3c7('0x0'));module[_0xe3c7('0x1')]={'type':{'type':Sequelize[_0xe3c7('0x2')](_0xe3c7('0x3'),_0xe3c7('0x4'),_0xe3c7('0x5'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe3c7('0x6')]},'key':{'type':Sequelize[_0xe3c7('0x6')]},'keyType':{'type':Sequelize[_0xe3c7('0x2')](_0xe3c7('0x3'),_0xe3c7('0x4'),_0xe3c7('0x5'))},'keyContent':{'type':Sequelize[_0xe3c7('0x6')]},'idField':{'type':Sequelize[_0xe3c7('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe3c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe3c7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 999a7b5..ca1d540 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 _0x702d=['nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','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','limit','undefined','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x482abe,_0x3821b9){var _0x359377=function(_0x10c62f){while(--_0x10c62f){_0x482abe['push'](_0x482abe['shift']());}};_0x359377(++_0x3821b9);}(_0x702d,0x147));var _0xd702=function(_0x257bd0,_0x37b28b){_0x257bd0=_0x257bd0-0x0;var _0x118b8c=_0x702d[_0x257bd0];return _0x118b8c;};'use strict';var emlformat=require(_0xd702('0x0'));var rimraf=require(_0xd702('0x1'));var zipdir=require(_0xd702('0x2'));var jsonpatch=require(_0xd702('0x3'));var rp=require(_0xd702('0x4'));var moment=require('moment');var BPromise=require(_0xd702('0x5'));var Mustache=require(_0xd702('0x6'));var util=require(_0xd702('0x7'));var path=require(_0xd702('0x8'));var sox=require('sox');var csv=require(_0xd702('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd702('0xa'));var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0x9'));var querystring=require(_0xd702('0xe'));var Papa=require(_0xd702('0xf'));var Redis=require(_0xd702('0x10'));var authService=require(_0xd702('0x11'));var qs=require(_0xd702('0x12'));var as=require(_0xd702('0x13'));var hardwareService=require(_0xd702('0x14'));var logger=require(_0xd702('0x15'))(_0xd702('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd702('0x17'));var db=require(_0xd702('0x18'))['db'];function respondWithStatusCode(_0x273577,_0x5c0dad){_0x5c0dad=_0x5c0dad||0xcc;return function(_0x13ee5a){if(_0x13ee5a){return _0x273577[_0xd702('0x19')](_0x5c0dad);}return _0x273577[_0xd702('0x1a')](_0x5c0dad)[_0xd702('0x1b')]();};}function respondWithResult(_0x3948f8,_0x181ff2){_0x181ff2=_0x181ff2||0xc8;return function(_0x59dd33){if(_0x59dd33){return _0x3948f8[_0xd702('0x1a')](_0x181ff2)[_0xd702('0x1c')](_0x59dd33);}};}function respondWithFilteredResult(_0x5d7978,_0x707b9){return function(_0x4922f8){if(_0x4922f8){var _0x268c66=typeof _0x707b9[_0xd702('0x1d')]==='undefined'&&typeof _0x707b9[_0xd702('0x1e')]===_0xd702('0x1f');var _0x2a87f2=_0x4922f8['count'];var _0x5b3b1d=_0x268c66?0x0:_0x707b9[_0xd702('0x1d')];var _0x5a296e=_0x268c66?_0x4922f8[_0xd702('0x20')]:_0x707b9[_0xd702('0x1d')]+_0x707b9[_0xd702('0x1e')];var _0x265b1b;if(_0x5a296e>=_0x2a87f2){_0x5a296e=_0x2a87f2;_0x265b1b=0xc8;}else{_0x265b1b=0xce;}_0x5d7978[_0xd702('0x1a')](_0x265b1b);return _0x5d7978[_0xd702('0x21')](_0xd702('0x22'),_0x5b3b1d+'-'+_0x5a296e+'/'+_0x2a87f2)['json'](_0x4922f8);}return null;};}function patchUpdates(_0x4be140){return function(_0x536ca8){try{jsonpatch[_0xd702('0x23')](_0x536ca8,_0x4be140,!![]);}catch(_0x109284){return BPromise['reject'](_0x109284);}return _0x536ca8[_0xd702('0x24')]();};}function saveUpdates(_0x5d91fd,_0xc4c246){return function(_0x5824ec){if(_0x5824ec){return _0x5824ec['update'](_0x5d91fd)['then'](function(_0x21c00e){return _0x21c00e;});}return null;};}function removeEntity(_0xeec2e4,_0x459184){return function(_0x49761c){if(_0x49761c){return _0x49761c[_0xd702('0x25')]()[_0xd702('0x26')](function(){_0xeec2e4[_0xd702('0x1a')](0xcc)[_0xd702('0x1b')]();});}};}function handleEntityNotFound(_0x1200ed,_0x146f35){return function(_0x94c58d){if(!_0x94c58d){_0x1200ed[_0xd702('0x19')](0x194);}return _0x94c58d;};}function handleError(_0x22328a,_0x50d7ad){_0x50d7ad=_0x50d7ad||0x1f4;return function(_0x116b2f){logger[_0xd702('0x27')](_0x116b2f[_0xd702('0x28')]);if(_0x116b2f[_0xd702('0x29')]){delete _0x116b2f[_0xd702('0x29')];}_0x22328a[_0xd702('0x1a')](_0x50d7ad)[_0xd702('0x2a')](_0x116b2f);};}exports[_0xd702('0x2b')]=function(_0x5f1084,_0x47c9a2){var _0x1870b7={},_0x43cd38={},_0x56bc8d={'count':0x0,'rows':[]};var _0x45cd22=_[_0xd702('0x2c')](db[_0xd702('0x2d')][_0xd702('0x2e')],function(_0x56e9cd){return{'name':_0x56e9cd[_0xd702('0x2f')],'type':_0x56e9cd[_0xd702('0x30')][_0xd702('0x31')]};});_0x43cd38[_0xd702('0x32')]=_[_0xd702('0x2c')](_0x45cd22,'name');_0x43cd38[_0xd702('0x33')]=_[_0xd702('0x34')](_0x5f1084[_0xd702('0x33')]);_0x43cd38['filters']=_[_0xd702('0x35')](_0x43cd38['model'],_0x43cd38['query']);_0x1870b7[_0xd702('0x36')]=_[_0xd702('0x35')](_0x43cd38[_0xd702('0x32')],qs['fields'](_0x5f1084[_0xd702('0x33')][_0xd702('0x37')]));_0x1870b7['attributes']=_0x1870b7[_0xd702('0x36')][_0xd702('0x38')]?_0x1870b7[_0xd702('0x36')]:_0x43cd38[_0xd702('0x32')];if(!_0x5f1084[_0xd702('0x33')][_0xd702('0x39')](_0xd702('0x3a'))){_0x1870b7[_0xd702('0x1e')]=qs[_0xd702('0x1e')](_0x5f1084[_0xd702('0x33')][_0xd702('0x1e')]);_0x1870b7[_0xd702('0x1d')]=qs[_0xd702('0x1d')](_0x5f1084['query'][_0xd702('0x1d')]);}_0x1870b7[_0xd702('0x3b')]=qs[_0xd702('0x3c')](_0x5f1084[_0xd702('0x33')][_0xd702('0x3c')]);_0x1870b7[_0xd702('0x3d')]=qs[_0xd702('0x3e')](_['pick'](_0x5f1084['query'],_0x43cd38[_0xd702('0x3e')]),_0x45cd22);if(_0x5f1084[_0xd702('0x33')]['filter']){_0x1870b7['where']=_[_0xd702('0x3f')](_0x1870b7[_0xd702('0x3d')],{'$or':_['map'](_0x45cd22,function(_0x3a7aee){if(_0x3a7aee[_0xd702('0x30')]!==_0xd702('0x40')){var _0x4822d9={};_0x4822d9[_0x3a7aee[_0xd702('0x29')]]={'$like':'%'+_0x5f1084[_0xd702('0x33')][_0xd702('0x41')]+'%'};return _0x4822d9;}})});}_0x1870b7=_['merge']({},_0x1870b7,_0x5f1084[_0xd702('0x42')]);var _0x512854={'where':_0x1870b7[_0xd702('0x3d')]};return db[_0xd702('0x2d')][_0xd702('0x20')](_0x512854)[_0xd702('0x26')](function(_0x6af8d6){_0x56bc8d[_0xd702('0x20')]=_0x6af8d6;if(_0x5f1084[_0xd702('0x33')][_0xd702('0x43')]){_0x1870b7['include']=[{'all':!![]}];}return db[_0xd702('0x2d')][_0xd702('0x44')](_0x1870b7);})[_0xd702('0x26')](function(_0x3d703e){_0x56bc8d[_0xd702('0x45')]=_0x3d703e;return _0x56bc8d;})['then'](respondWithFilteredResult(_0x47c9a2,_0x1870b7))[_0xd702('0x46')](handleError(_0x47c9a2,null));};exports[_0xd702('0x47')]=function(_0x3424a3,_0x4c56ae){var _0xd48ad0={'raw':!![],'where':{'id':_0x3424a3[_0xd702('0x48')]['id']}},_0x3a1ed5={};_0x3a1ed5[_0xd702('0x32')]=_['keys'](db[_0xd702('0x2d')][_0xd702('0x2e')]);_0x3a1ed5[_0xd702('0x33')]=_[_0xd702('0x34')](_0x3424a3[_0xd702('0x33')]);_0x3a1ed5['filters']=_[_0xd702('0x35')](_0x3a1ed5[_0xd702('0x32')],_0x3a1ed5['query']);_0xd48ad0['attributes']=_[_0xd702('0x35')](_0x3a1ed5[_0xd702('0x32')],qs[_0xd702('0x37')](_0x3424a3[_0xd702('0x33')][_0xd702('0x37')]));_0xd48ad0[_0xd702('0x36')]=_0xd48ad0[_0xd702('0x36')][_0xd702('0x38')]?_0xd48ad0[_0xd702('0x36')]:_0x3a1ed5['model'];if(_0x3424a3['query'][_0xd702('0x43')]){_0xd48ad0['include']=[{'all':!![]}];}_0xd48ad0=_[_0xd702('0x3f')]({},_0xd48ad0,_0x3424a3['options']);return db[_0xd702('0x2d')]['find'](_0xd48ad0)[_0xd702('0x26')](handleEntityNotFound(_0x4c56ae,null))['then'](respondWithResult(_0x4c56ae,null))[_0xd702('0x46')](handleError(_0x4c56ae,null));};exports[_0xd702('0x49')]=function(_0x543b8f,_0x160f5e){return db[_0xd702('0x2d')][_0xd702('0x49')](_0x543b8f[_0xd702('0x4a')],{})[_0xd702('0x26')](respondWithResult(_0x160f5e,0xc9))['catch'](handleError(_0x160f5e,null));};exports[_0xd702('0x4b')]=function(_0x14c1db,_0x2d09be){if(_0x14c1db['body']['id']){delete _0x14c1db[_0xd702('0x4a')]['id'];}return db['FreshdeskField'][_0xd702('0x4c')]({'where':{'id':_0x14c1db[_0xd702('0x48')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x2d09be,null))['then'](saveUpdates(_0x14c1db['body'],null))[_0xd702('0x26')](respondWithResult(_0x2d09be,null))[_0xd702('0x46')](handleError(_0x2d09be,null));};exports[_0xd702('0x25')]=function(_0x397e91,_0x16e59b){return db[_0xd702('0x2d')][_0xd702('0x4c')]({'where':{'id':_0x397e91[_0xd702('0x48')]['id']}})[_0xd702('0x26')](handleEntityNotFound(_0x16e59b,null))[_0xd702('0x26')](removeEntity(_0x16e59b,null))['catch'](handleError(_0x16e59b,null));}; \ No newline at end of file +var _0xa25c=['map','FreshdeskField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index'];(function(_0x58f067,_0x38135b){var _0x550170=function(_0x1c8551){while(--_0x1c8551){_0x58f067['push'](_0x58f067['shift']());}};_0x550170(++_0x38135b);}(_0xa25c,0x13f));var _0xca25=function(_0x33c102,_0x22faa7){_0x33c102=_0x33c102-0x0;var _0x5921e9=_0xa25c[_0x33c102];return _0x5921e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];function respondWithStatusCode(_0x5697aa,_0x534bca){_0x534bca=_0x534bca||0xcc;return function(_0x2a7a97){if(_0x2a7a97){return _0x5697aa['sendStatus'](_0x534bca);}return _0x5697aa[_0xca25('0x16')](_0x534bca)[_0xca25('0x17')]();};}function respondWithResult(_0x35093c,_0x1a3207){_0x1a3207=_0x1a3207||0xc8;return function(_0x307e9e){if(_0x307e9e){return _0x35093c[_0xca25('0x16')](_0x1a3207)[_0xca25('0x18')](_0x307e9e);}};}function respondWithFilteredResult(_0x33aa25,_0x2a1af3){return function(_0x42bc1e){if(_0x42bc1e){var _0x2b5cef=typeof _0x2a1af3['offset']===_0xca25('0x19')&&typeof _0x2a1af3[_0xca25('0x1a')]==='undefined';var _0x411230=_0x42bc1e[_0xca25('0x1b')];var _0x3705a0=_0x2b5cef?0x0:_0x2a1af3[_0xca25('0x1c')];var _0x155cf2=_0x2b5cef?_0x42bc1e['count']:_0x2a1af3[_0xca25('0x1c')]+_0x2a1af3[_0xca25('0x1a')];var _0x143243;if(_0x155cf2>=_0x411230){_0x155cf2=_0x411230;_0x143243=0xc8;}else{_0x143243=0xce;}_0x33aa25[_0xca25('0x16')](_0x143243);return _0x33aa25[_0xca25('0x1d')]('Content-Range',_0x3705a0+'-'+_0x155cf2+'/'+_0x411230)[_0xca25('0x18')](_0x42bc1e);}return null;};}function patchUpdates(_0x3598c7){return function(_0x235d92){try{jsonpatch[_0xca25('0x1e')](_0x235d92,_0x3598c7,!![]);}catch(_0x327719){return BPromise[_0xca25('0x1f')](_0x327719);}return _0x235d92[_0xca25('0x20')]();};}function saveUpdates(_0x54c91a,_0x48fdf5){return function(_0x23f69a){if(_0x23f69a){return _0x23f69a[_0xca25('0x21')](_0x54c91a)[_0xca25('0x22')](function(_0x1596dd){return _0x1596dd;});}return null;};}function removeEntity(_0x2615d4,_0x40e5e2){return function(_0x8cec43){if(_0x8cec43){return _0x8cec43[_0xca25('0x23')]()[_0xca25('0x22')](function(){_0x2615d4[_0xca25('0x16')](0xcc)[_0xca25('0x17')]();});}};}function handleEntityNotFound(_0x20dc6d,_0x4dffad){return function(_0x1aa848){if(!_0x1aa848){_0x20dc6d[_0xca25('0x24')](0x194);}return _0x1aa848;};}function handleError(_0x7ceacb,_0x374cde){_0x374cde=_0x374cde||0x1f4;return function(_0x220546){logger['error'](_0x220546[_0xca25('0x25')]);if(_0x220546[_0xca25('0x26')]){delete _0x220546[_0xca25('0x26')];}_0x7ceacb[_0xca25('0x16')](_0x374cde)[_0xca25('0x27')](_0x220546);};}exports[_0xca25('0x28')]=function(_0xfd888c,_0x1660a5){var _0x3e72cb={},_0x7b67f4={},_0x190f27={'count':0x0,'rows':[]};var _0x315f76=_[_0xca25('0x29')](db[_0xca25('0x2a')][_0xca25('0x2b')],function(_0x2433bb){return{'name':_0x2433bb[_0xca25('0x2c')],'type':_0x2433bb[_0xca25('0x2d')]['key']};});_0x7b67f4[_0xca25('0x2e')]=_[_0xca25('0x29')](_0x315f76,_0xca25('0x26'));_0x7b67f4['query']=_[_0xca25('0x2f')](_0xfd888c[_0xca25('0x30')]);_0x7b67f4[_0xca25('0x31')]=_[_0xca25('0x32')](_0x7b67f4[_0xca25('0x2e')],_0x7b67f4[_0xca25('0x30')]);_0x3e72cb['attributes']=_[_0xca25('0x32')](_0x7b67f4['model'],qs[_0xca25('0x33')](_0xfd888c[_0xca25('0x30')][_0xca25('0x33')]));_0x3e72cb['attributes']=_0x3e72cb[_0xca25('0x34')][_0xca25('0x35')]?_0x3e72cb[_0xca25('0x34')]:_0x7b67f4[_0xca25('0x2e')];if(!_0xfd888c[_0xca25('0x30')]['hasOwnProperty'](_0xca25('0x36'))){_0x3e72cb[_0xca25('0x1a')]=qs[_0xca25('0x1a')](_0xfd888c[_0xca25('0x30')][_0xca25('0x1a')]);_0x3e72cb[_0xca25('0x1c')]=qs[_0xca25('0x1c')](_0xfd888c['query']['offset']);}_0x3e72cb[_0xca25('0x37')]=qs[_0xca25('0x38')](_0xfd888c['query']['sort']);_0x3e72cb[_0xca25('0x39')]=qs[_0xca25('0x31')](_[_0xca25('0x3a')](_0xfd888c['query'],_0x7b67f4[_0xca25('0x31')]),_0x315f76);if(_0xfd888c[_0xca25('0x30')][_0xca25('0x3b')]){_0x3e72cb[_0xca25('0x39')]=_[_0xca25('0x3c')](_0x3e72cb[_0xca25('0x39')],{'$or':_['map'](_0x315f76,function(_0x290537){if(_0x290537['type']!==_0xca25('0x3d')){var _0x25880f={};_0x25880f[_0x290537[_0xca25('0x26')]]={'$like':'%'+_0xfd888c[_0xca25('0x30')][_0xca25('0x3b')]+'%'};return _0x25880f;}})});}_0x3e72cb=_[_0xca25('0x3c')]({},_0x3e72cb,_0xfd888c[_0xca25('0x3e')]);var _0x19984f={'where':_0x3e72cb[_0xca25('0x39')]};return db['FreshdeskField'][_0xca25('0x1b')](_0x19984f)['then'](function(_0x2d6f27){_0x190f27['count']=_0x2d6f27;if(_0xfd888c[_0xca25('0x30')][_0xca25('0x3f')]){_0x3e72cb[_0xca25('0x40')]=[{'all':!![]}];}return db[_0xca25('0x2a')]['findAll'](_0x3e72cb);})[_0xca25('0x22')](function(_0x5aafa5){_0x190f27[_0xca25('0x41')]=_0x5aafa5;return _0x190f27;})[_0xca25('0x22')](respondWithFilteredResult(_0x1660a5,_0x3e72cb))['catch'](handleError(_0x1660a5,null));};exports[_0xca25('0x42')]=function(_0x183135,_0x52799a){var _0x2ff9c2={'raw':!![],'where':{'id':_0x183135[_0xca25('0x43')]['id']}},_0x1068c9={};_0x1068c9[_0xca25('0x2e')]=_['keys'](db[_0xca25('0x2a')][_0xca25('0x2b')]);_0x1068c9['query']=_['keys'](_0x183135['query']);_0x1068c9['filters']=_[_0xca25('0x32')](_0x1068c9[_0xca25('0x2e')],_0x1068c9[_0xca25('0x30')]);_0x2ff9c2[_0xca25('0x34')]=_['intersection'](_0x1068c9[_0xca25('0x2e')],qs[_0xca25('0x33')](_0x183135[_0xca25('0x30')][_0xca25('0x33')]));_0x2ff9c2['attributes']=_0x2ff9c2[_0xca25('0x34')]['length']?_0x2ff9c2[_0xca25('0x34')]:_0x1068c9[_0xca25('0x2e')];if(_0x183135[_0xca25('0x30')][_0xca25('0x3f')]){_0x2ff9c2[_0xca25('0x40')]=[{'all':!![]}];}_0x2ff9c2=_[_0xca25('0x3c')]({},_0x2ff9c2,_0x183135['options']);return db[_0xca25('0x2a')][_0xca25('0x44')](_0x2ff9c2)[_0xca25('0x22')](handleEntityNotFound(_0x52799a,null))[_0xca25('0x22')](respondWithResult(_0x52799a,null))[_0xca25('0x45')](handleError(_0x52799a,null));};exports[_0xca25('0x46')]=function(_0x1ad2d0,_0x352a17){return db[_0xca25('0x2a')][_0xca25('0x46')](_0x1ad2d0[_0xca25('0x47')],{})[_0xca25('0x22')](respondWithResult(_0x352a17,0xc9))[_0xca25('0x45')](handleError(_0x352a17,null));};exports[_0xca25('0x21')]=function(_0x3279e0,_0x1fba32){if(_0x3279e0[_0xca25('0x47')]['id']){delete _0x3279e0[_0xca25('0x47')]['id'];}return db['FreshdeskField'][_0xca25('0x44')]({'where':{'id':_0x3279e0[_0xca25('0x43')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x1fba32,null))[_0xca25('0x22')](saveUpdates(_0x3279e0['body'],null))[_0xca25('0x22')](respondWithResult(_0x1fba32,null))[_0xca25('0x45')](handleError(_0x1fba32,null));};exports['destroy']=function(_0x2bc528,_0x10692f){return db[_0xca25('0x2a')][_0xca25('0x44')]({'where':{'id':_0x2bc528['params']['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x10692f,null))['then'](removeEntity(_0x10692f,null))[_0xca25('0x45')](handleError(_0x10692f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 96443a2..0440fff 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 _0x4ea3=['path','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ea3,0x70));var _0x34ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ea3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x34ea('0xb'),_0x34ea('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4b8f=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField'];(function(_0x301ada,_0x40e847){var _0x45e1e4=function(_0xe153d6){while(--_0xe153d6){_0x301ada['push'](_0x301ada['shift']());}};_0x45e1e4(++_0x40e847);}(_0x4b8f,0x103));var _0xf4b8=function(_0x4ef6e9,_0x140c4c){_0x4ef6e9=_0x4ef6e9-0x0;var _0x28270c=_0x4b8f[_0x4ef6e9];return _0x28270c;};'use strict';var _=require('lodash');var util=require(_0xf4b8('0x0'));var logger=require(_0xf4b8('0x1'))(_0xf4b8('0x2'));var moment=require(_0xf4b8('0x3'));var BPromise=require('bluebird');var rp=require(_0xf4b8('0x4'));var fs=require('fs');var path=require(_0xf4b8('0x5'));var rimraf=require(_0xf4b8('0x6'));var config=require('../../config/environment');var attributes=require(_0xf4b8('0x7'));module[_0xf4b8('0x8')]=function(_0x1dd55a,_0x18622b){return _0x1dd55a[_0xf4b8('0x9')](_0xf4b8('0xa'),attributes,{'tableName':_0xf4b8('0xb'),'paranoid':![],'indexes':[{'name':_0xf4b8('0xc'),'fields':[_0xf4b8('0xd'),_0xf4b8('0xe')],'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 fede49d..07aa323 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 _0x2d60=['moment','bluebird','ioredis','../../config/utils','jayson/promise','client','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util'];(function(_0x53de13,_0x28f32d){var _0x37695=function(_0x22e650){while(--_0x22e650){_0x53de13['push'](_0x53de13['shift']());}};_0x37695(++_0x28f32d);}(_0x2d60,0x152));var _0x02d6=function(_0xa0cdb7,_0x445e1d){_0xa0cdb7=_0xa0cdb7-0x0;var _0x953337=_0x2d60[_0xa0cdb7];return _0x953337;};'use strict';var _=require(_0x02d6('0x0'));var util=require(_0x02d6('0x1'));var moment=require(_0x02d6('0x2'));var BPromise=require(_0x02d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x02d6('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x02d6('0x6'));var client=jayson[_0x02d6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b2b59,_0x3d8da6,_0x34b3c0){return new BPromise(function(_0xef0c9f,_0x11598c){return client['request'](_0x4b2b59,_0x34b3c0)[_0x02d6('0x8')](function(_0x148c03){logger['info'](_0x02d6('0x9'),_0x3d8da6,_0x02d6('0xa'));logger[_0x02d6('0xb')](_0x02d6('0xc'),_0x3d8da6,_0x02d6('0xa'),JSON['stringify'](_0x148c03));if(_0x148c03['error']){if(_0x148c03[_0x02d6('0xd')][_0x02d6('0xe')]===0x1f4){logger[_0x02d6('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x3d8da6,_0x148c03[_0x02d6('0xd')][_0x02d6('0xf')]);return _0x11598c(_0x148c03[_0x02d6('0xd')]['message']);}logger[_0x02d6('0xd')](_0x02d6('0x9'),_0x3d8da6,_0x148c03[_0x02d6('0xd')]['message']);return _0xef0c9f(_0x148c03[_0x02d6('0xd')][_0x02d6('0xf')]);}else{logger[_0x02d6('0x10')](_0x02d6('0x9'),_0x3d8da6,_0x02d6('0xa'));_0xef0c9f(_0x148c03['result'][_0x02d6('0xf')]);}})['catch'](function(_0x17286f){logger['error'](_0x02d6('0x9'),_0x3d8da6,_0x17286f);_0x11598c(_0x17286f);});});} \ No newline at end of file +var _0xd064=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xd064,0x91));var _0x4d06=function(_0xd29892,_0x2b67b9){_0xd29892=_0xd29892-0x0;var _0x293dfd=_0xd064[_0xd29892];return _0x293dfd;};'use strict';var _=require(_0x4d06('0x0'));var util=require(_0x4d06('0x1'));var moment=require(_0x4d06('0x2'));var BPromise=require(_0x4d06('0x3'));var rs=require(_0x4d06('0x4'));var fs=require('fs');var Redis=require(_0x4d06('0x5'));var db=require(_0x4d06('0x6'))['db'];var utils=require(_0x4d06('0x7'));var logger=require(_0x4d06('0x8'))('rpc');var config=require(_0x4d06('0x9'));var jayson=require(_0x4d06('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e79a2,_0x38c85c,_0x1bb49a){return new BPromise(function(_0x1fe214,_0x81e64c){return client['request'](_0x4e79a2,_0x1bb49a)[_0x4d06('0xb')](function(_0x3d1aa9){logger[_0x4d06('0xc')](_0x4d06('0xd'),_0x38c85c,_0x4d06('0xe'));logger[_0x4d06('0xf')](_0x4d06('0x10'),_0x38c85c,_0x4d06('0xe'),JSON['stringify'](_0x3d1aa9));if(_0x3d1aa9[_0x4d06('0x11')]){if(_0x3d1aa9[_0x4d06('0x11')][_0x4d06('0x12')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x38c85c,_0x3d1aa9[_0x4d06('0x11')][_0x4d06('0x13')]);return _0x81e64c(_0x3d1aa9['error'][_0x4d06('0x13')]);}logger['error'](_0x4d06('0xd'),_0x38c85c,_0x3d1aa9[_0x4d06('0x11')]['message']);return _0x1fe214(_0x3d1aa9['error'][_0x4d06('0x13')]);}else{logger[_0x4d06('0xc')](_0x4d06('0xd'),_0x38c85c,_0x4d06('0xe'));_0x1fe214(_0x3d1aa9[_0x4d06('0x14')][_0x4d06('0x13')]);}})['catch'](function(_0x4733c3){logger['error'](_0x4d06('0xd'),_0x38c85c,_0x4733c3);_0x81e64c(_0x4733c3);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 2bf9f13..1ae3e24 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 _0x44a3=['getFields','post','addConfiguration','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations'];(function(_0x41911e,_0x25533a){var _0x594570=function(_0x542e0d){while(--_0x542e0d){_0x41911e['push'](_0x41911e['shift']());}};_0x594570(++_0x25533a);}(_0x44a3,0x1a9));var _0x344a=function(_0xb08b54,_0x149ec4){_0xb08b54=_0xb08b54-0x0;var _0x353ed9=_0x44a3[_0xb08b54];return _0x353ed9;};'use strict';var multer=require(_0x344a('0x0'));var util=require(_0x344a('0x1'));var path=require(_0x344a('0x2'));var timeout=require(_0x344a('0x3'));var express=require(_0x344a('0x4'));var router=express[_0x344a('0x5')]();var fs_extra=require(_0x344a('0x6'));var auth=require(_0x344a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x344a('0x8'));var controller=require(_0x344a('0x9'));router[_0x344a('0xa')]('/',auth[_0x344a('0xb')](),controller[_0x344a('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x344a('0xa')](_0x344a('0xd'),auth[_0x344a('0xb')](),controller[_0x344a('0xe')]);router[_0x344a('0xa')]('/:id/fields',auth[_0x344a('0xb')](),controller[_0x344a('0xf')]);router['post']('/',auth[_0x344a('0xb')](),controller['create']);router[_0x344a('0x10')]('/:id/configurations',auth[_0x344a('0xb')](),controller[_0x344a('0x11')]);router['put']('/:id',auth[_0x344a('0xb')](),controller[_0x344a('0x12')]);router[_0x344a('0x13')](_0x344a('0x14'),auth[_0x344a('0xb')](),controller[_0x344a('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0102=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','destroy','exports','util','path','connect-timeout','express','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0x0102,0x186));var _0x2010=function(_0x4aed79,_0x54a8a4){_0x4aed79=_0x4aed79-0x0;var _0x24c3af=_0x0102[_0x4aed79];return _0x24c3af;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2010('0x4'));router[_0x2010('0x5')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0x7')]);router['get'](_0x2010('0x8'),auth['isAuthenticated'](),controller[_0x2010('0x9')]);router[_0x2010('0x5')]('/:id/configurations',auth[_0x2010('0x6')](),controller[_0x2010('0xa')]);router[_0x2010('0x5')](_0x2010('0xb'),auth[_0x2010('0x6')](),controller[_0x2010('0xc')]);router[_0x2010('0xd')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0xe')]);router[_0x2010('0xd')](_0x2010('0xf'),auth[_0x2010('0x6')](),controller[_0x2010('0x10')]);router[_0x2010('0x11')](_0x2010('0x8'),auth[_0x2010('0x6')](),controller['update']);router['delete'](_0x2010('0x8'),auth[_0x2010('0x6')](),controller[_0x2010('0x12')]);module[_0x2010('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 8bdb77f..f61005c 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 _0x2a07=['sequelize','exports','STRING','remoteUri'];(function(_0x99e075,_0x211213){var _0x1a81ba=function(_0x216dcd){while(--_0x216dcd){_0x99e075['push'](_0x99e075['shift']());}};_0x1a81ba(++_0x211213);}(_0x2a07,0x74));var _0x72a0=function(_0x478de7,_0x3deb50){_0x478de7=_0x478de7-0x0;var _0x290cbd=_0x2a07[_0x478de7];return _0x290cbd;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'name':{'type':Sequelize[_0x72a0('0x2')]},'description':{'type':Sequelize[_0x72a0('0x2')]},'username':{'type':Sequelize[_0x72a0('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x72a0('0x2')]},'remoteUri':{'type':Sequelize[_0x72a0('0x2')],'unique':_0x72a0('0x3')},'serverUrl':{'type':Sequelize[_0x72a0('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x430c=['sequelize','STRING','username'];(function(_0x43465e,_0x55bc4e){var _0x6c0a31=function(_0x160d19){while(--_0x160d19){_0x43465e['push'](_0x43465e['shift']());}};_0x6c0a31(++_0x55bc4e);}(_0x430c,0x1a1));var _0xc430=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x430c[_0x2bc1fe];return _0x1a47a5;};'use strict';var Sequelize=require(_0xc430('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc430('0x1')]},'username':{'type':Sequelize[_0xc430('0x1')],'unique':_0xc430('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 678e672..aace803 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 _0x7c94=['users','email','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','save','update','then','error','stack','name','map','FreshsalesAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','length','find','catch','body','destroy','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','findOne','username','remoteUri','slice','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token='];(function(_0x455e00,_0x29577f){var _0x568400=function(_0x6dd5c9){while(--_0x6dd5c9){_0x455e00['push'](_0x455e00['shift']());}};_0x568400(++_0x29577f);}(_0x7c94,0x18c));var _0x47c9=function(_0x2a5d90,_0x36f5d0){_0x2a5d90=_0x2a5d90-0x0;var _0x1c4700=_0x7c94[_0x2a5d90];return _0x1c4700;};'use strict';var emlformat=require(_0x47c9('0x0'));var rimraf=require(_0x47c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x47c9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x47c9('0x3'));var util=require(_0x47c9('0x4'));var path=require(_0x47c9('0x5'));var sox=require('sox');var csv=require(_0x47c9('0x6'));var ejs=require(_0x47c9('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x47c9('0x8'));var crypto=require(_0x47c9('0x9'));var jsforce=require(_0x47c9('0xa'));var deskjs=require(_0x47c9('0xb'));var toCsv=require(_0x47c9('0x6'));var querystring=require(_0x47c9('0xc'));var Papa=require(_0x47c9('0xd'));var Redis=require('ioredis');var authService=require(_0x47c9('0xe'));var qs=require(_0x47c9('0xf'));var as=require(_0x47c9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47c9('0x11'));var utils=require(_0x47c9('0x12'));var config=require(_0x47c9('0x13'));var licenseUtil=require(_0x47c9('0x14'));var db=require(_0x47c9('0x15'))['db'];var integrations=require(_0x47c9('0x16'));function respondWithStatusCode(_0x37474b,_0x4a1120){_0x4a1120=_0x4a1120||0xcc;return function(_0x146d4e){if(_0x146d4e){return _0x37474b[_0x47c9('0x17')](_0x4a1120);}return _0x37474b[_0x47c9('0x18')](_0x4a1120)[_0x47c9('0x19')]();};}function respondWithResult(_0x3c18b6,_0xe71ef4){_0xe71ef4=_0xe71ef4||0xc8;return function(_0x13e802){if(_0x13e802){return _0x3c18b6[_0x47c9('0x18')](_0xe71ef4)[_0x47c9('0x1a')](_0x13e802);}};}function respondWithFilteredResult(_0xf1af47,_0x597095){return function(_0x57dd27){if(_0x57dd27){var _0x2fc868=typeof _0x597095[_0x47c9('0x1b')]==='undefined'&&typeof _0x597095[_0x47c9('0x1c')]==='undefined';var _0x5621c6=_0x57dd27[_0x47c9('0x1d')];var _0xd38cc2=_0x2fc868?0x0:_0x597095[_0x47c9('0x1b')];var _0x37cc7a=_0x2fc868?_0x57dd27['count']:_0x597095[_0x47c9('0x1b')]+_0x597095[_0x47c9('0x1c')];var _0xcffa60;if(_0x37cc7a>=_0x5621c6){_0x37cc7a=_0x5621c6;_0xcffa60=0xc8;}else{_0xcffa60=0xce;}_0xf1af47[_0x47c9('0x18')](_0xcffa60);return _0xf1af47[_0x47c9('0x1e')]('Content-Range',_0xd38cc2+'-'+_0x37cc7a+'/'+_0x5621c6)[_0x47c9('0x1a')](_0x57dd27);}return null;};}function patchUpdates(_0x309618){return function(_0x109579){try{jsonpatch['apply'](_0x109579,_0x309618,!![]);}catch(_0x584b63){return BPromise['reject'](_0x584b63);}return _0x109579[_0x47c9('0x1f')]();};}function saveUpdates(_0xe9e937,_0x4e37b0){return function(_0x4968ef){if(_0x4968ef){return _0x4968ef[_0x47c9('0x20')](_0xe9e937)['then'](function(_0x29b5bb){return _0x29b5bb;});}return null;};}function removeEntity(_0x325af8,_0x562ef3){return function(_0x20e378){if(_0x20e378){return _0x20e378['destroy']()[_0x47c9('0x21')](function(){_0x325af8['status'](0xcc)[_0x47c9('0x19')]();});}};}function handleEntityNotFound(_0xe91b01,_0x136cdc){return function(_0x1384d6){if(!_0x1384d6){_0xe91b01['sendStatus'](0x194);}return _0x1384d6;};}function handleError(_0x4ac682,_0x4c59b2){_0x4c59b2=_0x4c59b2||0x1f4;return function(_0xb4ddca){logger[_0x47c9('0x22')](_0xb4ddca[_0x47c9('0x23')]);if(_0xb4ddca[_0x47c9('0x24')]){delete _0xb4ddca[_0x47c9('0x24')];}_0x4ac682[_0x47c9('0x18')](_0x4c59b2)['send'](_0xb4ddca);};}exports['index']=function(_0x21890e,_0x15aeb5){var _0x5240bd={},_0xef5381={},_0x47285b={'count':0x0,'rows':[]};var _0x4f2825=_[_0x47c9('0x25')](db[_0x47c9('0x26')]['rawAttributes'],function(_0x573cd8){return{'name':_0x573cd8[_0x47c9('0x27')],'type':_0x573cd8[_0x47c9('0x28')]['key']};});_0xef5381[_0x47c9('0x29')]=_[_0x47c9('0x25')](_0x4f2825,'name');_0xef5381[_0x47c9('0x2a')]=_[_0x47c9('0x2b')](_0x21890e[_0x47c9('0x2a')]);_0xef5381[_0x47c9('0x2c')]=_[_0x47c9('0x2d')](_0xef5381['model'],_0xef5381[_0x47c9('0x2a')]);_0x5240bd[_0x47c9('0x2e')]=_['intersection'](_0xef5381[_0x47c9('0x29')],qs[_0x47c9('0x2f')](_0x21890e[_0x47c9('0x2a')]['fields']));_0x5240bd[_0x47c9('0x2e')]=_0x5240bd[_0x47c9('0x2e')]['length']?_0x5240bd[_0x47c9('0x2e')]:_0xef5381[_0x47c9('0x29')];if(!_0x21890e[_0x47c9('0x2a')][_0x47c9('0x30')](_0x47c9('0x31'))){_0x5240bd[_0x47c9('0x1c')]=qs[_0x47c9('0x1c')](_0x21890e[_0x47c9('0x2a')]['limit']);_0x5240bd[_0x47c9('0x1b')]=qs[_0x47c9('0x1b')](_0x21890e['query'][_0x47c9('0x1b')]);}_0x5240bd[_0x47c9('0x32')]=qs[_0x47c9('0x33')](_0x21890e[_0x47c9('0x2a')][_0x47c9('0x33')]);_0x5240bd[_0x47c9('0x34')]=qs[_0x47c9('0x2c')](_[_0x47c9('0x35')](_0x21890e[_0x47c9('0x2a')],_0xef5381[_0x47c9('0x2c')]),_0x4f2825);if(_0x21890e[_0x47c9('0x2a')][_0x47c9('0x36')]){_0x5240bd[_0x47c9('0x34')]=_[_0x47c9('0x37')](_0x5240bd[_0x47c9('0x34')],{'$or':_[_0x47c9('0x25')](_0x4f2825,function(_0x29a7f3){if(_0x29a7f3['type']!==_0x47c9('0x38')){var _0x341de1={};_0x341de1[_0x29a7f3[_0x47c9('0x24')]]={'$like':'%'+_0x21890e[_0x47c9('0x2a')][_0x47c9('0x36')]+'%'};return _0x341de1;}})});}_0x5240bd=_[_0x47c9('0x37')]({},_0x5240bd,_0x21890e[_0x47c9('0x39')]);var _0x2dcfab={'where':_0x5240bd[_0x47c9('0x34')]};return db[_0x47c9('0x26')][_0x47c9('0x1d')](_0x2dcfab)['then'](function(_0x2002ee){_0x47285b[_0x47c9('0x1d')]=_0x2002ee;if(_0x21890e[_0x47c9('0x2a')][_0x47c9('0x3a')]){_0x5240bd[_0x47c9('0x3b')]=[{'all':!![]}];}return db[_0x47c9('0x26')]['findAll'](_0x5240bd);})[_0x47c9('0x21')](function(_0x5d6572){_0x47285b[_0x47c9('0x3c')]=_0x5d6572;return _0x47285b;})['then'](respondWithFilteredResult(_0x15aeb5,_0x5240bd))['catch'](handleError(_0x15aeb5,null));};exports['show']=function(_0xd78e83,_0x40a008){var _0x1f8097={'raw':![],'where':{'id':_0xd78e83[_0x47c9('0x3d')]['id']}},_0xbf63={};_0xbf63[_0x47c9('0x29')]=_[_0x47c9('0x2b')](db[_0x47c9('0x26')][_0x47c9('0x3e')]);_0xbf63[_0x47c9('0x2a')]=_[_0x47c9('0x2b')](_0xd78e83[_0x47c9('0x2a')]);_0xbf63[_0x47c9('0x2c')]=_['intersection'](_0xbf63[_0x47c9('0x29')],_0xbf63[_0x47c9('0x2a')]);_0x1f8097[_0x47c9('0x2e')]=_[_0x47c9('0x2d')](_0xbf63[_0x47c9('0x29')],qs[_0x47c9('0x2f')](_0xd78e83['query'][_0x47c9('0x2f')]));_0x1f8097[_0x47c9('0x2e')]=_0x1f8097[_0x47c9('0x2e')][_0x47c9('0x3f')]?_0x1f8097[_0x47c9('0x2e')]:_0xbf63[_0x47c9('0x29')];if(_0xd78e83[_0x47c9('0x2a')][_0x47c9('0x3a')]){_0x1f8097[_0x47c9('0x3b')]=[{'all':!![]}];}_0x1f8097=_[_0x47c9('0x37')]({},_0x1f8097,_0xd78e83[_0x47c9('0x39')]);return db['FreshsalesAccount'][_0x47c9('0x40')](_0x1f8097)['then'](handleEntityNotFound(_0x40a008,null))[_0x47c9('0x21')](respondWithResult(_0x40a008,null))[_0x47c9('0x41')](handleError(_0x40a008,null));};exports['create']=function(_0xa694ba,_0x234c8f){return db[_0x47c9('0x26')]['create'](_0xa694ba['body'],{})[_0x47c9('0x21')](respondWithResult(_0x234c8f,0xc9))[_0x47c9('0x41')](handleError(_0x234c8f,null));};exports['update']=function(_0x46f6d1,_0xd4d469){if(_0x46f6d1[_0x47c9('0x42')]['id']){delete _0x46f6d1[_0x47c9('0x42')]['id'];}return db['FreshsalesAccount'][_0x47c9('0x40')]({'where':{'id':_0x46f6d1[_0x47c9('0x3d')]['id']}})[_0x47c9('0x21')](handleEntityNotFound(_0xd4d469,null))[_0x47c9('0x21')](saveUpdates(_0x46f6d1[_0x47c9('0x42')],null))['then'](respondWithResult(_0xd4d469,null))['catch'](handleError(_0xd4d469,null));};exports[_0x47c9('0x43')]=function(_0x2499a8,_0x541d46){return db[_0x47c9('0x26')]['find']({'where':{'id':_0x2499a8[_0x47c9('0x3d')]['id']}})[_0x47c9('0x21')](handleEntityNotFound(_0x541d46,null))[_0x47c9('0x21')](removeEntity(_0x541d46,null))[_0x47c9('0x41')](handleError(_0x541d46,null));};exports['getConfigurations']=function(_0x165734,_0x4b89ef,_0x145d2e){var _0x341d21={};var _0x54d56a={};var _0x1b2cbb;var _0x7a5f42;return db[_0x47c9('0x26')]['findOne']({'where':{'id':_0x165734[_0x47c9('0x3d')]['id']}})[_0x47c9('0x21')](handleEntityNotFound(_0x4b89ef,null))['then'](function(_0x3c2c82){if(_0x3c2c82){_0x1b2cbb=_0x3c2c82;_0x54d56a[_0x47c9('0x29')]=_[_0x47c9('0x2b')](db[_0x47c9('0x44')][_0x47c9('0x3e')]);_0x54d56a[_0x47c9('0x2a')]=_[_0x47c9('0x2b')](_0x165734['query']);_0x54d56a[_0x47c9('0x2c')]=_['intersection'](_0x54d56a[_0x47c9('0x29')],_0x54d56a[_0x47c9('0x2a')]);_0x341d21[_0x47c9('0x2e')]=_[_0x47c9('0x2d')](_0x54d56a[_0x47c9('0x29')],qs[_0x47c9('0x2f')](_0x165734[_0x47c9('0x2a')]['fields']));_0x341d21['attributes']=_0x341d21[_0x47c9('0x2e')]['length']?_0x341d21[_0x47c9('0x2e')]:_0x54d56a[_0x47c9('0x29')];_0x341d21[_0x47c9('0x32')]=qs['sort'](_0x165734[_0x47c9('0x2a')][_0x47c9('0x33')]);_0x341d21[_0x47c9('0x34')]=qs[_0x47c9('0x2c')](_[_0x47c9('0x35')](_0x165734[_0x47c9('0x2a')],_0x54d56a[_0x47c9('0x2c')]));if(_0x165734[_0x47c9('0x2a')][_0x47c9('0x36')]){_0x341d21['where']=_[_0x47c9('0x37')](_0x341d21['where'],{'$or':_[_0x47c9('0x25')](_0x341d21[_0x47c9('0x2e')],function(_0x44fe74){var _0x4e0734={};_0x4e0734[_0x44fe74]={'$like':'%'+_0x165734[_0x47c9('0x2a')][_0x47c9('0x36')]+'%'};return _0x4e0734;})});}_0x341d21=_[_0x47c9('0x37')]({},_0x341d21,_0x165734['options']);return _0x1b2cbb[_0x47c9('0x45')](_0x341d21);}})[_0x47c9('0x21')](function(_0x39de4e){if(_0x39de4e){_0x7a5f42=_0x39de4e['length'];if(!_0x165734[_0x47c9('0x2a')][_0x47c9('0x30')](_0x47c9('0x31'))){_0x341d21[_0x47c9('0x1c')]=qs[_0x47c9('0x1c')](_0x165734['query']['limit']);_0x341d21[_0x47c9('0x1b')]=qs['offset'](_0x165734[_0x47c9('0x2a')][_0x47c9('0x1b')]);}return _0x1b2cbb['getConfigurations'](_0x341d21);}})[_0x47c9('0x21')](function(_0x2c4694){if(_0x2c4694){return _0x2c4694?{'count':_0x7a5f42,'rows':_0x2c4694}:null;}})[_0x47c9('0x21')](respondWithResult(_0x4b89ef,null))[_0x47c9('0x41')](handleError(_0x4b89ef,null));};exports[_0x47c9('0x46')]=function(_0x26822d,_0x46467f,_0x4196b3){if(_0x26822d['body']['id']){delete _0x26822d['body']['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x26822d[_0x47c9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x46467f,null))[_0x47c9('0x21')](function(_0x29ce0d){if(_0x29ce0d){_0x26822d[_0x47c9('0x42')][_0x47c9('0x47')]=_0x29ce0d['id'];_0x26822d[_0x47c9('0x42')]['Subjects']=integrations[_0x47c9('0x48')](_0x26822d[_0x47c9('0x42')][_0x47c9('0x49')],_0x26822d[_0x47c9('0x42')][_0x47c9('0x28')]);_0x26822d['body'][_0x47c9('0x4a')]=integrations[_0x47c9('0x4b')](_0x26822d[_0x47c9('0x42')][_0x47c9('0x49')],_0x26822d[_0x47c9('0x42')]['type']);return db[_0x47c9('0x44')]['create'](_0x26822d['body'],{'include':[{'model':db[_0x47c9('0x4c')],'as':_0x47c9('0x4d')},{'model':db[_0x47c9('0x4c')],'as':_0x47c9('0x4a')}]});}return null;})['then'](respondWithResult(_0x46467f,null))[_0x47c9('0x41')](handleError(_0x46467f,null));};exports[_0x47c9('0x4e')]=function(_0x406034,_0x45f896,_0x423bc1){var _0x101fd6='';var _0x2a7ed5='';return db[_0x47c9('0x26')][_0x47c9('0x4f')]({'where':{'id':_0x406034[_0x47c9('0x3d')]['id']},'attributes':['id',_0x47c9('0x50'),_0x47c9('0x51'),'apiKey']})[_0x47c9('0x21')](handleEntityNotFound(_0x45f896,null))[_0x47c9('0x21')](function(_0xdb32e6){if(_0xdb32e6){_0x2a7ed5=_0xdb32e6[_0x47c9('0x50')];_0x101fd6=_0xdb32e6[_0x47c9('0x51')];var _0x29cf37=_0xdb32e6[_0x47c9('0x51')][_0x47c9('0x52')](-0x1);if(_0x29cf37==='/'){_0x101fd6=_0x101fd6[_0x47c9('0x53')](0x0,_0x101fd6[_0x47c9('0x54')](_0x29cf37));}return rp({'method':_0x47c9('0x55'),'uri':util[_0x47c9('0x56')]('%s%s',_0x101fd6,_0x47c9('0x57')),'headers':{'Authorization':_0x47c9('0x58')+_0xdb32e6['apiKey']},'json':!![]});}})[_0x47c9('0x21')](function(_0xebc133){if(_0xebc133){var _0x5d9fe2=_0xebc133[_0x47c9('0x59')];var _0x1975e0=![];var _0x45f5ad=null;for(_0x45f5ad=0x0;_0x45f5ad<_0x5d9fe2[_0x47c9('0x3f')];_0x45f5ad++){if(_0x5d9fe2[_0x45f5ad][_0x47c9('0x5a')]===_0x2a7ed5){_0x1975e0=!![];}}if(_0x1975e0){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x47c9('0x21')](respondWithResult(_0x45f896,null))['catch'](function(_0xb029e5){var _0x177998=_0x406034[_0x47c9('0x2a')][_0x47c9('0x5b')]?0x1f4:_0xb029e5['statusCode']||0x1f4;logger['error'](_0x47c9('0x5c'),'getFields',_0x177998,JSON[_0x47c9('0x5d')](_0xb029e5));delete _0xb029e5[_0x47c9('0x24')];if(_0x177998===0x191){_0x177998=0x190;}_0x45f896['status'](_0x177998)[_0x47c9('0x5e')](_0x406034['query'][_0x47c9('0x5b')]?{'message':_0x47c9('0x5f'),'statusCode':_0xb029e5[_0x47c9('0x60')]}:_0xb029e5);});}; \ No newline at end of file +var _0x9884=['request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','find','create','body','destroy','getConfigurations','FreshsalesConfiguration','filter','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','remoteUri','username','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch'];(function(_0x45a528,_0xdb424c){var _0x326a53=function(_0xf8a555){while(--_0xf8a555){_0x45a528['push'](_0x45a528['shift']());}};_0x326a53(++_0xdb424c);}(_0x9884,0x191));var _0x4988=function(_0x53548d,_0x47b8d8){_0x53548d=_0x53548d-0x0;var _0x2cea1b=_0x9884[_0x53548d];return _0x2cea1b;};'use strict';var emlformat=require(_0x4988('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4988('0x1'));var jsonpatch=require(_0x4988('0x2'));var rp=require(_0x4988('0x3'));var moment=require(_0x4988('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4988('0x5'));var path=require(_0x4988('0x6'));var sox=require(_0x4988('0x7'));var csv=require(_0x4988('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4988('0x9'));var _=require(_0x4988('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4988('0xb'));var toCsv=require(_0x4988('0x8'));var querystring=require('querystring');var Papa=require(_0x4988('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4988('0xd'));var hardwareService=require(_0x4988('0xe'));var logger=require(_0x4988('0xf'))(_0x4988('0x10'));var utils=require(_0x4988('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4988('0x12'));var db=require(_0x4988('0x13'))['db'];var integrations=require(_0x4988('0x14'));function respondWithStatusCode(_0x56084e,_0x207a80){_0x207a80=_0x207a80||0xcc;return function(_0x12f4c5){if(_0x12f4c5){return _0x56084e[_0x4988('0x15')](_0x207a80);}return _0x56084e[_0x4988('0x16')](_0x207a80)[_0x4988('0x17')]();};}function respondWithResult(_0x2887d8,_0x219532){_0x219532=_0x219532||0xc8;return function(_0x2e2903){if(_0x2e2903){return _0x2887d8[_0x4988('0x16')](_0x219532)[_0x4988('0x18')](_0x2e2903);}};}function respondWithFilteredResult(_0x2ed68e,_0x5537dc){return function(_0x649606){if(_0x649606){var _0xb6ae63=typeof _0x5537dc[_0x4988('0x19')]===_0x4988('0x1a')&&typeof _0x5537dc[_0x4988('0x1b')]===_0x4988('0x1a');var _0x1351db=_0x649606[_0x4988('0x1c')];var _0x3ad946=_0xb6ae63?0x0:_0x5537dc['offset'];var _0x42f35c=_0xb6ae63?_0x649606[_0x4988('0x1c')]:_0x5537dc[_0x4988('0x19')]+_0x5537dc[_0x4988('0x1b')];var _0x527b55;if(_0x42f35c>=_0x1351db){_0x42f35c=_0x1351db;_0x527b55=0xc8;}else{_0x527b55=0xce;}_0x2ed68e[_0x4988('0x16')](_0x527b55);return _0x2ed68e[_0x4988('0x1d')](_0x4988('0x1e'),_0x3ad946+'-'+_0x42f35c+'/'+_0x1351db)[_0x4988('0x18')](_0x649606);}return null;};}function patchUpdates(_0x212139){return function(_0x356f27){try{jsonpatch['apply'](_0x356f27,_0x212139,!![]);}catch(_0x53e56f){return BPromise[_0x4988('0x1f')](_0x53e56f);}return _0x356f27['save']();};}function saveUpdates(_0x390f16,_0x1c130e){return function(_0x1e8f06){if(_0x1e8f06){return _0x1e8f06[_0x4988('0x20')](_0x390f16)[_0x4988('0x21')](function(_0x3b1fbe){return _0x3b1fbe;});}return null;};}function removeEntity(_0x1155f1,_0xf414a1){return function(_0x5b9124){if(_0x5b9124){return _0x5b9124['destroy']()[_0x4988('0x21')](function(){_0x1155f1[_0x4988('0x16')](0xcc)[_0x4988('0x17')]();});}};}function handleEntityNotFound(_0x1d1e53,_0x3d5c0e){return function(_0x2e5213){if(!_0x2e5213){_0x1d1e53[_0x4988('0x15')](0x194);}return _0x2e5213;};}function handleError(_0x2c5a30,_0x54fa71){_0x54fa71=_0x54fa71||0x1f4;return function(_0x2dfbed){logger[_0x4988('0x22')](_0x2dfbed['stack']);if(_0x2dfbed[_0x4988('0x23')]){delete _0x2dfbed[_0x4988('0x23')];}_0x2c5a30['status'](_0x54fa71)[_0x4988('0x24')](_0x2dfbed);};}exports[_0x4988('0x25')]=function(_0xc951f3,_0x367f40){var _0x2e1c80={},_0x3fbe8a={},_0x39cfb9={'count':0x0,'rows':[]};var _0x58b053=_[_0x4988('0x26')](db[_0x4988('0x27')][_0x4988('0x28')],function(_0x5a6d64){return{'name':_0x5a6d64[_0x4988('0x29')],'type':_0x5a6d64[_0x4988('0x2a')][_0x4988('0x2b')]};});_0x3fbe8a[_0x4988('0x2c')]=_[_0x4988('0x26')](_0x58b053,_0x4988('0x23'));_0x3fbe8a[_0x4988('0x2d')]=_[_0x4988('0x2e')](_0xc951f3[_0x4988('0x2d')]);_0x3fbe8a[_0x4988('0x2f')]=_[_0x4988('0x30')](_0x3fbe8a['model'],_0x3fbe8a[_0x4988('0x2d')]);_0x2e1c80[_0x4988('0x31')]=_['intersection'](_0x3fbe8a[_0x4988('0x2c')],qs[_0x4988('0x32')](_0xc951f3[_0x4988('0x2d')][_0x4988('0x32')]));_0x2e1c80[_0x4988('0x31')]=_0x2e1c80[_0x4988('0x31')][_0x4988('0x33')]?_0x2e1c80['attributes']:_0x3fbe8a['model'];if(!_0xc951f3['query'][_0x4988('0x34')](_0x4988('0x35'))){_0x2e1c80['limit']=qs['limit'](_0xc951f3['query'][_0x4988('0x1b')]);_0x2e1c80[_0x4988('0x19')]=qs[_0x4988('0x19')](_0xc951f3[_0x4988('0x2d')][_0x4988('0x19')]);}_0x2e1c80[_0x4988('0x36')]=qs[_0x4988('0x37')](_0xc951f3[_0x4988('0x2d')][_0x4988('0x37')]);_0x2e1c80[_0x4988('0x38')]=qs[_0x4988('0x2f')](_[_0x4988('0x39')](_0xc951f3[_0x4988('0x2d')],_0x3fbe8a[_0x4988('0x2f')]),_0x58b053);if(_0xc951f3['query']['filter']){_0x2e1c80[_0x4988('0x38')]=_['merge'](_0x2e1c80[_0x4988('0x38')],{'$or':_[_0x4988('0x26')](_0x58b053,function(_0x5094da){if(_0x5094da['type']!==_0x4988('0x3a')){var _0xbdddb1={};_0xbdddb1[_0x5094da[_0x4988('0x23')]]={'$like':'%'+_0xc951f3[_0x4988('0x2d')]['filter']+'%'};return _0xbdddb1;}})});}_0x2e1c80=_['merge']({},_0x2e1c80,_0xc951f3[_0x4988('0x3b')]);var _0x33ee9a={'where':_0x2e1c80[_0x4988('0x38')]};return db['FreshsalesAccount'][_0x4988('0x1c')](_0x33ee9a)[_0x4988('0x21')](function(_0x23acb0){_0x39cfb9['count']=_0x23acb0;if(_0xc951f3[_0x4988('0x2d')][_0x4988('0x3c')]){_0x2e1c80[_0x4988('0x3d')]=[{'all':!![]}];}return db[_0x4988('0x27')][_0x4988('0x3e')](_0x2e1c80);})['then'](function(_0x50d440){_0x39cfb9['rows']=_0x50d440;return _0x39cfb9;})['then'](respondWithFilteredResult(_0x367f40,_0x2e1c80))[_0x4988('0x3f')](handleError(_0x367f40,null));};exports[_0x4988('0x40')]=function(_0x29a89f,_0x1c0aea){var _0x3bc47c={'raw':![],'where':{'id':_0x29a89f[_0x4988('0x41')]['id']}},_0x12ee65={};_0x12ee65['model']=_[_0x4988('0x2e')](db[_0x4988('0x27')][_0x4988('0x28')]);_0x12ee65[_0x4988('0x2d')]=_[_0x4988('0x2e')](_0x29a89f['query']);_0x12ee65['filters']=_[_0x4988('0x30')](_0x12ee65[_0x4988('0x2c')],_0x12ee65[_0x4988('0x2d')]);_0x3bc47c['attributes']=_[_0x4988('0x30')](_0x12ee65[_0x4988('0x2c')],qs[_0x4988('0x32')](_0x29a89f[_0x4988('0x2d')][_0x4988('0x32')]));_0x3bc47c[_0x4988('0x31')]=_0x3bc47c[_0x4988('0x31')][_0x4988('0x33')]?_0x3bc47c['attributes']:_0x12ee65[_0x4988('0x2c')];if(_0x29a89f[_0x4988('0x2d')][_0x4988('0x3c')]){_0x3bc47c[_0x4988('0x3d')]=[{'all':!![]}];}_0x3bc47c=_[_0x4988('0x42')]({},_0x3bc47c,_0x29a89f['options']);return db[_0x4988('0x27')][_0x4988('0x43')](_0x3bc47c)[_0x4988('0x21')](handleEntityNotFound(_0x1c0aea,null))['then'](respondWithResult(_0x1c0aea,null))[_0x4988('0x3f')](handleError(_0x1c0aea,null));};exports[_0x4988('0x44')]=function(_0x2da5f5,_0x300e59){return db[_0x4988('0x27')][_0x4988('0x44')](_0x2da5f5[_0x4988('0x45')],{})[_0x4988('0x21')](respondWithResult(_0x300e59,0xc9))[_0x4988('0x3f')](handleError(_0x300e59,null));};exports[_0x4988('0x20')]=function(_0x2ac8b0,_0x191784){if(_0x2ac8b0['body']['id']){delete _0x2ac8b0[_0x4988('0x45')]['id'];}return db[_0x4988('0x27')][_0x4988('0x43')]({'where':{'id':_0x2ac8b0['params']['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x191784,null))['then'](saveUpdates(_0x2ac8b0[_0x4988('0x45')],null))[_0x4988('0x21')](respondWithResult(_0x191784,null))[_0x4988('0x3f')](handleError(_0x191784,null));};exports[_0x4988('0x46')]=function(_0x2f9ba0,_0x289b25){return db[_0x4988('0x27')][_0x4988('0x43')]({'where':{'id':_0x2f9ba0['params']['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x289b25,null))[_0x4988('0x21')](removeEntity(_0x289b25,null))[_0x4988('0x3f')](handleError(_0x289b25,null));};exports[_0x4988('0x47')]=function(_0xdbc452,_0x1e6e70,_0x1375c8){var _0x46212f={};var _0x17a757={};var _0x1e99b2;var _0x3fd6fd;return db[_0x4988('0x27')]['findOne']({'where':{'id':_0xdbc452[_0x4988('0x41')]['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x1e6e70,null))[_0x4988('0x21')](function(_0x13a447){if(_0x13a447){_0x1e99b2=_0x13a447;_0x17a757['model']=_[_0x4988('0x2e')](db[_0x4988('0x48')][_0x4988('0x28')]);_0x17a757[_0x4988('0x2d')]=_[_0x4988('0x2e')](_0xdbc452[_0x4988('0x2d')]);_0x17a757[_0x4988('0x2f')]=_[_0x4988('0x30')](_0x17a757['model'],_0x17a757[_0x4988('0x2d')]);_0x46212f[_0x4988('0x31')]=_[_0x4988('0x30')](_0x17a757[_0x4988('0x2c')],qs[_0x4988('0x32')](_0xdbc452['query'][_0x4988('0x32')]));_0x46212f['attributes']=_0x46212f[_0x4988('0x31')]['length']?_0x46212f[_0x4988('0x31')]:_0x17a757[_0x4988('0x2c')];_0x46212f[_0x4988('0x36')]=qs[_0x4988('0x37')](_0xdbc452[_0x4988('0x2d')][_0x4988('0x37')]);_0x46212f[_0x4988('0x38')]=qs[_0x4988('0x2f')](_[_0x4988('0x39')](_0xdbc452[_0x4988('0x2d')],_0x17a757[_0x4988('0x2f')]));if(_0xdbc452['query'][_0x4988('0x49')]){_0x46212f[_0x4988('0x38')]=_[_0x4988('0x42')](_0x46212f[_0x4988('0x38')],{'$or':_['map'](_0x46212f['attributes'],function(_0x111feb){var _0x2bc08f={};_0x2bc08f[_0x111feb]={'$like':'%'+_0xdbc452['query'][_0x4988('0x49')]+'%'};return _0x2bc08f;})});}_0x46212f=_[_0x4988('0x42')]({},_0x46212f,_0xdbc452[_0x4988('0x3b')]);return _0x1e99b2[_0x4988('0x47')](_0x46212f);}})[_0x4988('0x21')](function(_0x5e86f3){if(_0x5e86f3){_0x3fd6fd=_0x5e86f3[_0x4988('0x33')];if(!_0xdbc452[_0x4988('0x2d')][_0x4988('0x34')](_0x4988('0x35'))){_0x46212f['limit']=qs[_0x4988('0x1b')](_0xdbc452['query'][_0x4988('0x1b')]);_0x46212f['offset']=qs[_0x4988('0x19')](_0xdbc452[_0x4988('0x2d')][_0x4988('0x19')]);}return _0x1e99b2[_0x4988('0x47')](_0x46212f);}})[_0x4988('0x21')](function(_0x1b31c4){if(_0x1b31c4){return _0x1b31c4?{'count':_0x3fd6fd,'rows':_0x1b31c4}:null;}})['then'](respondWithResult(_0x1e6e70,null))[_0x4988('0x3f')](handleError(_0x1e6e70,null));};exports['addConfiguration']=function(_0x32e6a8,_0x1fe48c,_0x15165e){if(_0x32e6a8[_0x4988('0x45')]['id']){delete _0x32e6a8[_0x4988('0x45')]['id'];}return db[_0x4988('0x27')][_0x4988('0x4a')]({'where':{'id':_0x32e6a8[_0x4988('0x41')]['id']}})[_0x4988('0x21')](handleEntityNotFound(_0x1fe48c,null))['then'](function(_0x376ea7){if(_0x376ea7){_0x32e6a8['body'][_0x4988('0x4b')]=_0x376ea7['id'];_0x32e6a8[_0x4988('0x45')][_0x4988('0x4c')]=integrations[_0x4988('0x4d')](_0x32e6a8['body']['channel'],_0x32e6a8['body'][_0x4988('0x2a')]);_0x32e6a8[_0x4988('0x45')][_0x4988('0x4e')]=integrations[_0x4988('0x4f')](_0x32e6a8[_0x4988('0x45')][_0x4988('0x50')],_0x32e6a8[_0x4988('0x45')]['type']);return db[_0x4988('0x48')][_0x4988('0x44')](_0x32e6a8['body'],{'include':[{'model':db[_0x4988('0x51')],'as':_0x4988('0x4c')},{'model':db[_0x4988('0x51')],'as':_0x4988('0x4e')}]});}return null;})['then'](respondWithResult(_0x1fe48c,null))[_0x4988('0x3f')](handleError(_0x1fe48c,null));};exports[_0x4988('0x52')]=function(_0x297ba4,_0x486b6c,_0xa3801a){var _0x7b510d='';var _0x327bb2='';return db[_0x4988('0x27')][_0x4988('0x4a')]({'where':{'id':_0x297ba4[_0x4988('0x41')]['id']},'attributes':['id','username',_0x4988('0x53'),'apiKey']})[_0x4988('0x21')](handleEntityNotFound(_0x486b6c,null))[_0x4988('0x21')](function(_0x256daf){if(_0x256daf){_0x327bb2=_0x256daf[_0x4988('0x54')];_0x7b510d=_0x256daf['remoteUri'];var _0xddaedf=_0x256daf[_0x4988('0x53')][_0x4988('0x55')](-0x1);if(_0xddaedf==='/'){_0x7b510d=_0x7b510d[_0x4988('0x56')](0x0,_0x7b510d[_0x4988('0x57')](_0xddaedf));}return rp({'method':'GET','uri':util[_0x4988('0x58')](_0x4988('0x59'),_0x7b510d,_0x4988('0x5a')),'headers':{'Authorization':_0x4988('0x5b')+_0x256daf[_0x4988('0x5c')]},'json':!![]});}})[_0x4988('0x21')](function(_0xef778f){if(_0xef778f){var _0x3dc8c7=_0xef778f[_0x4988('0x5d')];var _0x47c1c3=![];var _0x45bf4b=null;for(_0x45bf4b=0x0;_0x45bf4b<_0x3dc8c7['length'];_0x45bf4b++){if(_0x3dc8c7[_0x45bf4b][_0x4988('0x5e')]===_0x327bb2){_0x47c1c3=!![];}}if(_0x47c1c3){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4988('0x5f')});}}})['then'](respondWithResult(_0x486b6c,null))['catch'](function(_0x579515){var _0x2e125d=_0x297ba4[_0x4988('0x2d')][_0x4988('0x60')]?0x1f4:_0x579515['statusCode']||0x1f4;logger[_0x4988('0x22')](_0x4988('0x61'),'getFields',_0x2e125d,JSON[_0x4988('0x62')](_0x579515));delete _0x579515[_0x4988('0x23')];if(_0x2e125d===0x191){_0x2e125d=0x190;}_0x486b6c[_0x4988('0x16')](_0x2e125d)[_0x4988('0x24')](_0x297ba4[_0x4988('0x2d')][_0x4988('0x60')]?{'message':_0x4988('0x63'),'statusCode':_0x579515[_0x4988('0x64')]}:_0x579515);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 4108089..ed3a324 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 _0x3d04=['bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var logger=require(_0x43d0('0x2'))(_0x43d0('0x3'));var moment=require(_0x43d0('0x4'));var BPromise=require(_0x43d0('0x5'));var rp=require(_0x43d0('0x6'));var fs=require('fs');var path=require(_0x43d0('0x7'));var rimraf=require('rimraf');var config=require(_0x43d0('0x8'));var attributes=require(_0x43d0('0x9'));var integrations=require(_0x43d0('0xa'));module[_0x43d0('0xb')]=function(_0x5e284f,_0x484271){return _0x5e284f['define']('FreshsalesAccount',attributes,{'tableName':_0x43d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x1ca282,_0x38ad9b){var _0x3c92eb=function(_0x1a3a63){while(--_0x1a3a63){_0x1ca282['push'](_0x1ca282['shift']());}};_0x3c92eb(++_0x38ad9b);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('FreshsalesAccount',attributes,{'tableName':_0xae3d('0xe'),'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 f7415ae..7454ce2 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 _0x5204=['catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','include','model','map','then','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5204,0xdf));var _0x4520=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x5204[_0x2c7b86];return _0x256735;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')]({'raw':_0x2e00f4[_0x4520('0x1a')]?_0x2e00f4['options'][_0x4520('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e00f4['options']?_0x2e00f4['options']['where']||null:null,'attributes':_0x2e00f4[_0x4520('0x1a')]?_0x2e00f4['options'][_0x4520('0x1c')]||null:null,'limit':_0x2e00f4[_0x4520('0x1a')]?_0x2e00f4[_0x4520('0x1a')]['limit']||null:null,'include':_0x2e00f4[_0x4520('0x1a')]?_0x2e00f4[_0x4520('0x1a')][_0x4520('0x1d')]?_['map'](_0x2e00f4[_0x4520('0x1a')][_0x4520('0x1d')],function(_0x24eacd){return{'model':db[_0x24eacd[_0x4520('0x1e')]],'as':_0x24eacd['as'],'attributes':_0x24eacd[_0x4520('0x1c')],'include':_0x24eacd['include']?_[_0x4520('0x1f')](_0x24eacd[_0x4520('0x1d')],function(_0x3532aa){return{'model':db[_0x3532aa[_0x4520('0x1e')]],'as':_0x3532aa['as'],'attributes':_0x3532aa['attributes'],'include':_0x3532aa[_0x4520('0x1d')]?_[_0x4520('0x1f')](_0x3532aa[_0x4520('0x1d')],function(_0x21e1f3){return{'model':db[_0x21e1f3[_0x4520('0x1e')]],'as':_0x21e1f3['as'],'attributes':_0x21e1f3[_0x4520('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4520('0x20')](function(_0x195c58){logger[_0x4520('0xc')](_0x4520('0x17'),_0x2e00f4);logger['debug'](_0x4520('0x17'),_0x2e00f4,JSON['stringify'](_0x195c58));_0x4ba69f(_0x195c58);})[_0x4520('0x16')](function(_0x14778a){logger[_0x4520('0x12')](_0x4520('0x17'),_0x14778a[_0x4520('0x14')],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x14778a['message']));});});};exports[_0x4520('0x21')]=function(_0x508c05){var _0x2585eb=this;return new Promise(function(_0x4a6755,_0xf6caff){return db['FreshsalesAccount'][_0x4520('0x22')]({'raw':_0x508c05['options']?_0x508c05['options'][_0x4520('0x1b')]===undefined?!![]:![]:!![],'where':_0x508c05[_0x4520('0x1a')]?_0x508c05[_0x4520('0x1a')]['where']||null:null,'attributes':_0x508c05[_0x4520('0x1a')]?_0x508c05[_0x4520('0x1a')][_0x4520('0x1c')]||null:null,'include':_0x508c05[_0x4520('0x1a')]?_0x508c05['options']['include']?_[_0x4520('0x1f')](_0x508c05[_0x4520('0x1a')]['include'],function(_0x779e94){return{'model':db[_0x779e94[_0x4520('0x1e')]],'as':_0x779e94['as'],'attributes':_0x779e94[_0x4520('0x1c')],'include':_0x779e94[_0x4520('0x1d')]?_[_0x4520('0x1f')](_0x779e94[_0x4520('0x1d')],function(_0x550a0f){return{'model':db[_0x550a0f[_0x4520('0x1e')]],'as':_0x550a0f['as'],'attributes':_0x550a0f[_0x4520('0x1c')],'include':_0x550a0f['include']?_[_0x4520('0x1f')](_0x550a0f['include'],function(_0x8bf557){return{'model':db[_0x8bf557[_0x4520('0x1e')]],'as':_0x8bf557['as'],'attributes':_0x8bf557['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5527a6){logger[_0x4520('0xc')](_0x4520('0x21'),_0x508c05);logger[_0x4520('0xf')](_0x4520('0x21'),_0x508c05,JSON[_0x4520('0x11')](_0x5527a6));_0x4a6755(_0x5527a6);})[_0x4520('0x16')](function(_0x3bfc83){logger['error'](_0x4520('0x21'),_0x3bfc83[_0x4520('0x14')],_0x508c05);_0xf6caff(_0x2585eb[_0x4520('0x12')](0x1f4,_0x3bfc83['message']));});});}; \ No newline at end of file +var _0x323f=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','options','where','attributes','include','map','model','catch','ShowFreshsalesAccount','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x401726,_0x174058){var _0x5610ff=function(_0x363bfb){while(--_0x363bfb){_0x401726['push'](_0x401726['shift']());}};_0x5610ff(++_0x174058);}(_0x323f,0x1ee));var _0xf323=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x323f[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});}exports[_0xf323('0x16')]=function(_0x49b115){var _0x2db977=this;return new Promise(function(_0x272aec,_0x1a459d){return db[_0xf323('0x17')]['findAll']({'raw':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')][_0xf323('0x19')]||null:null,'attributes':_0x49b115[_0xf323('0x18')]?_0x49b115['options'][_0xf323('0x1a')]||null:null,'limit':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')]['limit']||null:null,'include':_0x49b115[_0xf323('0x18')]?_0x49b115[_0xf323('0x18')][_0xf323('0x1b')]?_[_0xf323('0x1c')](_0x49b115[_0xf323('0x18')][_0xf323('0x1b')],function(_0x189b23){return{'model':db[_0x189b23[_0xf323('0x1d')]],'as':_0x189b23['as'],'attributes':_0x189b23[_0xf323('0x1a')],'include':_0x189b23['include']?_[_0xf323('0x1c')](_0x189b23[_0xf323('0x1b')],function(_0x33dc52){return{'model':db[_0x33dc52[_0xf323('0x1d')]],'as':_0x33dc52['as'],'attributes':_0x33dc52[_0xf323('0x1a')],'include':_0x33dc52[_0xf323('0x1b')]?_['map'](_0x33dc52[_0xf323('0x1b')],function(_0x56ce33){return{'model':db[_0x56ce33[_0xf323('0x1d')]],'as':_0x56ce33['as'],'attributes':_0x56ce33[_0xf323('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46663b){logger[_0xf323('0xd')](_0xf323('0x16'),_0x49b115);logger[_0xf323('0x10')](_0xf323('0x16'),_0x49b115,JSON['stringify'](_0x46663b));_0x272aec(_0x46663b);})[_0xf323('0x1e')](function(_0x34b536){logger[_0xf323('0x13')](_0xf323('0x16'),_0x34b536[_0xf323('0x14')],_0x49b115);_0x1a459d(_0x2db977[_0xf323('0x13')](0x1f4,_0x34b536[_0xf323('0x14')]));});});};exports[_0xf323('0x1f')]=function(_0x139adc){var _0x52300b=this;return new Promise(function(_0x3f23cf,_0x15187c){return db[_0xf323('0x17')][_0xf323('0x20')]({'raw':_0x139adc[_0xf323('0x18')]?_0x139adc['options'][_0xf323('0x21')]===undefined?!![]:![]:!![],'where':_0x139adc[_0xf323('0x18')]?_0x139adc[_0xf323('0x18')][_0xf323('0x19')]||null:null,'attributes':_0x139adc[_0xf323('0x18')]?_0x139adc['options'][_0xf323('0x1a')]||null:null,'include':_0x139adc[_0xf323('0x18')]?_0x139adc[_0xf323('0x18')][_0xf323('0x1b')]?_['map'](_0x139adc[_0xf323('0x18')]['include'],function(_0x372c47){return{'model':db[_0x372c47[_0xf323('0x1d')]],'as':_0x372c47['as'],'attributes':_0x372c47['attributes'],'include':_0x372c47[_0xf323('0x1b')]?_['map'](_0x372c47[_0xf323('0x1b')],function(_0x4a49d2){return{'model':db[_0x4a49d2[_0xf323('0x1d')]],'as':_0x4a49d2['as'],'attributes':_0x4a49d2['attributes'],'include':_0x4a49d2[_0xf323('0x1b')]?_[_0xf323('0x1c')](_0x4a49d2['include'],function(_0x4964a5){return{'model':db[_0x4964a5['model']],'as':_0x4964a5['as'],'attributes':_0x4964a5[_0xf323('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf323('0xc')](function(_0x79e636){logger[_0xf323('0xd')](_0xf323('0x1f'),_0x139adc);logger['debug']('ShowFreshsalesAccount',_0x139adc,JSON['stringify'](_0x79e636));_0x3f23cf(_0x79e636);})[_0xf323('0x1e')](function(_0x59fee2){logger[_0xf323('0x13')]('ShowFreshsalesAccount',_0x59fee2[_0xf323('0x14')],_0x139adc);_0x15187c(_0x52300b[_0xf323('0x13')](0x1f4,_0x59fee2[_0xf323('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6c847dd..10e4ce8 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 _0x26a1=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3911a0,_0x399077){var _0xf3dd14=function(_0x40561d){while(--_0x40561d){_0x3911a0['push'](_0x3911a0['shift']());}};_0xf3dd14(++_0x399077);}(_0x26a1,0xf8));var _0x126a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x26a1[_0x28d18d];return _0x470640;};'use strict';var multer=require(_0x126a('0x0'));var util=require(_0x126a('0x1'));var path=require(_0x126a('0x2'));var timeout=require(_0x126a('0x3'));var express=require(_0x126a('0x4'));var router=express[_0x126a('0x5')]();var fs_extra=require(_0x126a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x126a('0x7'));var config=require(_0x126a('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x126a('0x9')](),controller[_0x126a('0xa')]);router[_0x126a('0xb')](_0x126a('0xc'),auth['isAuthenticated'](),controller[_0x126a('0xd')]);router['get'](_0x126a('0xe'),auth[_0x126a('0x9')](),controller[_0x126a('0xf')]);router[_0x126a('0xb')](_0x126a('0x10'),auth[_0x126a('0x9')](),controller['getDescriptions']);router[_0x126a('0xb')](_0x126a('0x11'),auth[_0x126a('0x9')](),controller[_0x126a('0x12')]);router[_0x126a('0x13')]('/',auth['isAuthenticated'](),controller[_0x126a('0x14')]);router['put'](_0x126a('0xc'),auth[_0x126a('0x9')](),controller[_0x126a('0x15')]);router[_0x126a('0x16')]('/:id',auth[_0x126a('0x9')](),controller[_0x126a('0x17')]);module[_0x126a('0x18')]=router; \ No newline at end of file +var _0xf0d8=['/:id','getSubjects','/:id/descriptions','/:id/fields','post','create','put','delete','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x3aa89b,_0xcbfb73){var _0x2cd5b8=function(_0x4ac1f8){while(--_0x4ac1f8){_0x3aa89b['push'](_0x3aa89b['shift']());}};_0x2cd5b8(++_0xcbfb73);}(_0xf0d8,0x198));var _0x8f0d=function(_0x46966b,_0x58bcfb){_0x46966b=_0x46966b-0x0;var _0x2ef00c=_0xf0d8[_0x46966b];return _0x2ef00c;};'use strict';var multer=require('multer');var util=require(_0x8f0d('0x0'));var path=require(_0x8f0d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8f0d('0x2'));var router=express[_0x8f0d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8f0d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8f0d('0x5'));var controller=require(_0x8f0d('0x6'));router[_0x8f0d('0x7')]('/',auth[_0x8f0d('0x8')](),controller[_0x8f0d('0x9')]);router[_0x8f0d('0x7')](_0x8f0d('0xa'),auth[_0x8f0d('0x8')](),controller['show']);router[_0x8f0d('0x7')]('/:id/subjects',auth[_0x8f0d('0x8')](),controller[_0x8f0d('0xb')]);router[_0x8f0d('0x7')](_0x8f0d('0xc'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x8f0d('0x7')](_0x8f0d('0xd'),auth[_0x8f0d('0x8')](),controller['getFields']);router[_0x8f0d('0xe')]('/',auth[_0x8f0d('0x8')](),controller[_0x8f0d('0xf')]);router[_0x8f0d('0x10')](_0x8f0d('0xa'),auth[_0x8f0d('0x8')](),controller['update']);router[_0x8f0d('0x11')](_0x8f0d('0xa'),auth[_0x8f0d('0x8')](),controller['destroy']);module[_0x8f0d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 7464b51..f3ceb62 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 _0x5827=['exports','STRING'];(function(_0x548eae,_0xad69de){var _0x5b1a01=function(_0x358051){while(--_0x358051){_0x548eae['push'](_0x548eae['shift']());}};_0x5b1a01(++_0xad69de);}(_0x5827,0x17c));var _0x7582=function(_0x538b7e,_0x4a2d5e){_0x538b7e=_0x538b7e-0x0;var _0xf2eea5=_0x5827[_0x538b7e];return _0xf2eea5;};'use strict';var Sequelize=require('sequelize');module[_0x7582('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7582('0x1')]}}; \ No newline at end of file +var _0xaea8=['sequelize','exports','STRING'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0xaea8,0x99));var _0x8aea=function(_0x18ccee,_0x3e2257){_0x18ccee=_0x18ccee-0x0;var _0x37ae47=_0xaea8[_0x18ccee];return _0x37ae47;};'use strict';var Sequelize=require(_0x8aea('0x0'));module[_0x8aea('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8aea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d60b4fd..cf38845 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 _0xe6c5=['filter','merge','options','includeAll','include','show','params','keys','rawAttributes','length','find','catch','create','body','getSubjects','findOne','FreshsalesField','order','getDescriptions','hasOwnProperty','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','query','filters','intersection','model','fields','attributes','nolimit','sort','where','pick'];(function(_0x3a8fb2,_0x2dc3ef){var _0x1abcd9=function(_0x239183){while(--_0x239183){_0x3a8fb2['push'](_0x3a8fb2['shift']());}};_0x1abcd9(++_0x2dc3ef);}(_0xe6c5,0x155));var _0x5e6c=function(_0x138741,_0x219b17){_0x138741=_0x138741-0x0;var _0x29fdeb=_0xe6c5[_0x138741];return _0x29fdeb;};'use strict';var emlformat=require(_0x5e6c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e6c('0x1'));var rp=require(_0x5e6c('0x2'));var moment=require(_0x5e6c('0x3'));var BPromise=require(_0x5e6c('0x4'));var Mustache=require('mustache');var util=require(_0x5e6c('0x5'));var path=require(_0x5e6c('0x6'));var sox=require(_0x5e6c('0x7'));var csv=require(_0x5e6c('0x8'));var ejs=require(_0x5e6c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e6c('0xa'));var crypto=require(_0x5e6c('0xb'));var jsforce=require(_0x5e6c('0xc'));var deskjs=require(_0x5e6c('0xd'));var toCsv=require(_0x5e6c('0x8'));var querystring=require(_0x5e6c('0xe'));var Papa=require(_0x5e6c('0xf'));var Redis=require('ioredis');var authService=require(_0x5e6c('0x10'));var qs=require(_0x5e6c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e6c('0x12'));var logger=require(_0x5e6c('0x13'))(_0x5e6c('0x14'));var utils=require(_0x5e6c('0x15'));var config=require(_0x5e6c('0x16'));var licenseUtil=require(_0x5e6c('0x17'));var db=require(_0x5e6c('0x18'))['db'];function respondWithStatusCode(_0x4a202e,_0x40f827){_0x40f827=_0x40f827||0xcc;return function(_0xff9826){if(_0xff9826){return _0x4a202e[_0x5e6c('0x19')](_0x40f827);}return _0x4a202e[_0x5e6c('0x1a')](_0x40f827)[_0x5e6c('0x1b')]();};}function respondWithResult(_0x70c550,_0xfab85f){_0xfab85f=_0xfab85f||0xc8;return function(_0x481a63){if(_0x481a63){return _0x70c550[_0x5e6c('0x1a')](_0xfab85f)[_0x5e6c('0x1c')](_0x481a63);}};}function respondWithFilteredResult(_0x528556,_0x62ed7f){return function(_0x9244d9){if(_0x9244d9){var _0x5be190=typeof _0x62ed7f['offset']===_0x5e6c('0x1d')&&typeof _0x62ed7f[_0x5e6c('0x1e')]===_0x5e6c('0x1d');var _0xcfc557=_0x9244d9[_0x5e6c('0x1f')];var _0x39ce22=_0x5be190?0x0:_0x62ed7f[_0x5e6c('0x20')];var _0x20f44f=_0x5be190?_0x9244d9[_0x5e6c('0x1f')]:_0x62ed7f[_0x5e6c('0x20')]+_0x62ed7f[_0x5e6c('0x1e')];var _0x44c374;if(_0x20f44f>=_0xcfc557){_0x20f44f=_0xcfc557;_0x44c374=0xc8;}else{_0x44c374=0xce;}_0x528556['status'](_0x44c374);return _0x528556[_0x5e6c('0x21')](_0x5e6c('0x22'),_0x39ce22+'-'+_0x20f44f+'/'+_0xcfc557)['json'](_0x9244d9);}return null;};}function patchUpdates(_0x1447f8){return function(_0x4317aa){try{jsonpatch['apply'](_0x4317aa,_0x1447f8,!![]);}catch(_0x5167a9){return BPromise[_0x5e6c('0x23')](_0x5167a9);}return _0x4317aa[_0x5e6c('0x24')]();};}function saveUpdates(_0x1feae5,_0x570556){return function(_0x1ce49c){if(_0x1ce49c){return _0x1ce49c[_0x5e6c('0x25')](_0x1feae5)[_0x5e6c('0x26')](function(_0x4afebc){return _0x4afebc;});}return null;};}function removeEntity(_0x29d6d9,_0x419d68){return function(_0x41be5c){if(_0x41be5c){return _0x41be5c[_0x5e6c('0x27')]()['then'](function(){_0x29d6d9[_0x5e6c('0x1a')](0xcc)[_0x5e6c('0x1b')]();});}};}function handleEntityNotFound(_0x356779,_0x3fd7b1){return function(_0x31c9a3){if(!_0x31c9a3){_0x356779['sendStatus'](0x194);}return _0x31c9a3;};}function handleError(_0x53085c,_0x2d28c2){_0x2d28c2=_0x2d28c2||0x1f4;return function(_0x455b81){logger[_0x5e6c('0x28')](_0x455b81[_0x5e6c('0x29')]);if(_0x455b81['name']){delete _0x455b81[_0x5e6c('0x2a')];}_0x53085c[_0x5e6c('0x1a')](_0x2d28c2)[_0x5e6c('0x2b')](_0x455b81);};}exports[_0x5e6c('0x2c')]=function(_0x19d25c,_0x44bc4e){var _0x313b10={},_0x2e76cd={},_0x1e08f5={'count':0x0,'rows':[]};var _0x2ea161=_[_0x5e6c('0x2d')](db[_0x5e6c('0x2e')]['rawAttributes'],function(_0x583ec7){return{'name':_0x583ec7[_0x5e6c('0x2f')],'type':_0x583ec7[_0x5e6c('0x30')]['key']};});_0x2e76cd['model']=_['map'](_0x2ea161,_0x5e6c('0x2a'));_0x2e76cd[_0x5e6c('0x31')]=_['keys'](_0x19d25c[_0x5e6c('0x31')]);_0x2e76cd[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x2e76cd[_0x5e6c('0x34')],_0x2e76cd[_0x5e6c('0x31')]);_0x313b10['attributes']=_[_0x5e6c('0x33')](_0x2e76cd['model'],qs[_0x5e6c('0x35')](_0x19d25c['query']['fields']));_0x313b10[_0x5e6c('0x36')]=_0x313b10[_0x5e6c('0x36')]['length']?_0x313b10[_0x5e6c('0x36')]:_0x2e76cd[_0x5e6c('0x34')];if(!_0x19d25c[_0x5e6c('0x31')]['hasOwnProperty'](_0x5e6c('0x37'))){_0x313b10['limit']=qs['limit'](_0x19d25c[_0x5e6c('0x31')]['limit']);_0x313b10[_0x5e6c('0x20')]=qs[_0x5e6c('0x20')](_0x19d25c[_0x5e6c('0x31')]['offset']);}_0x313b10['order']=qs[_0x5e6c('0x38')](_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x38')]);_0x313b10[_0x5e6c('0x39')]=qs[_0x5e6c('0x32')](_[_0x5e6c('0x3a')](_0x19d25c['query'],_0x2e76cd[_0x5e6c('0x32')]),_0x2ea161);if(_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3b')]){_0x313b10[_0x5e6c('0x39')]=_[_0x5e6c('0x3c')](_0x313b10[_0x5e6c('0x39')],{'$or':_[_0x5e6c('0x2d')](_0x2ea161,function(_0x304085){if(_0x304085[_0x5e6c('0x30')]!=='VIRTUAL'){var _0x399736={};_0x399736[_0x304085['name']]={'$like':'%'+_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3b')]+'%'};return _0x399736;}})});}_0x313b10=_['merge']({},_0x313b10,_0x19d25c[_0x5e6c('0x3d')]);var _0x3fb303={'where':_0x313b10[_0x5e6c('0x39')]};return db[_0x5e6c('0x2e')][_0x5e6c('0x1f')](_0x3fb303)[_0x5e6c('0x26')](function(_0x5beb6b){_0x1e08f5[_0x5e6c('0x1f')]=_0x5beb6b;if(_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3e')]){_0x313b10[_0x5e6c('0x3f')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x313b10);})[_0x5e6c('0x26')](function(_0x2e79e0){_0x1e08f5['rows']=_0x2e79e0;return _0x1e08f5;})[_0x5e6c('0x26')](respondWithFilteredResult(_0x44bc4e,_0x313b10))['catch'](handleError(_0x44bc4e,null));};exports[_0x5e6c('0x40')]=function(_0x22a3cb,_0xb2025f){var _0x57b0e0={'raw':![],'where':{'id':_0x22a3cb[_0x5e6c('0x41')]['id']}},_0x2b5162={};_0x2b5162[_0x5e6c('0x34')]=_[_0x5e6c('0x42')](db[_0x5e6c('0x2e')][_0x5e6c('0x43')]);_0x2b5162[_0x5e6c('0x31')]=_['keys'](_0x22a3cb[_0x5e6c('0x31')]);_0x2b5162[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x2b5162[_0x5e6c('0x34')],_0x2b5162['query']);_0x57b0e0['attributes']=_[_0x5e6c('0x33')](_0x2b5162[_0x5e6c('0x34')],qs[_0x5e6c('0x35')](_0x22a3cb[_0x5e6c('0x31')][_0x5e6c('0x35')]));_0x57b0e0['attributes']=_0x57b0e0[_0x5e6c('0x36')][_0x5e6c('0x44')]?_0x57b0e0[_0x5e6c('0x36')]:_0x2b5162[_0x5e6c('0x34')];if(_0x22a3cb[_0x5e6c('0x31')][_0x5e6c('0x3e')]){_0x57b0e0[_0x5e6c('0x3f')]=[{'all':!![]}];}_0x57b0e0=_[_0x5e6c('0x3c')]({},_0x57b0e0,_0x22a3cb[_0x5e6c('0x3d')]);return db[_0x5e6c('0x2e')][_0x5e6c('0x45')](_0x57b0e0)[_0x5e6c('0x26')](handleEntityNotFound(_0xb2025f,null))['then'](respondWithResult(_0xb2025f,null))[_0x5e6c('0x46')](handleError(_0xb2025f,null));};exports['create']=function(_0x37ec14,_0x20858a){return db['FreshsalesConfiguration'][_0x5e6c('0x47')](_0x37ec14['body'],{})[_0x5e6c('0x26')](respondWithResult(_0x20858a,0xc9))['catch'](handleError(_0x20858a,null));};exports['update']=function(_0x35b5f9,_0x284f96){if(_0x35b5f9[_0x5e6c('0x48')]['id']){delete _0x35b5f9[_0x5e6c('0x48')]['id'];}return db[_0x5e6c('0x2e')][_0x5e6c('0x45')]({'where':{'id':_0x35b5f9[_0x5e6c('0x41')]['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x284f96,null))[_0x5e6c('0x26')](saveUpdates(_0x35b5f9[_0x5e6c('0x48')],null))[_0x5e6c('0x26')](respondWithResult(_0x284f96,null))[_0x5e6c('0x46')](handleError(_0x284f96,null));};exports[_0x5e6c('0x27')]=function(_0xa0bf68,_0x2230af){return db[_0x5e6c('0x2e')][_0x5e6c('0x45')]({'where':{'id':_0xa0bf68['params']['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x2230af,null))[_0x5e6c('0x26')](removeEntity(_0x2230af,null))[_0x5e6c('0x46')](handleError(_0x2230af,null));};exports[_0x5e6c('0x49')]=function(_0x29ed91,_0x577e56,_0x16cee6){var _0x1baef9={};var _0x4809a4={};var _0x476278;var _0x1ae897;return db[_0x5e6c('0x2e')][_0x5e6c('0x4a')]({'where':{'id':_0x29ed91[_0x5e6c('0x41')]['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x577e56,null))[_0x5e6c('0x26')](function(_0x3b3d2b){if(_0x3b3d2b){_0x476278=_0x3b3d2b;_0x4809a4[_0x5e6c('0x34')]=_[_0x5e6c('0x42')](db[_0x5e6c('0x4b')]['rawAttributes']);_0x4809a4[_0x5e6c('0x31')]=_[_0x5e6c('0x42')](_0x29ed91[_0x5e6c('0x31')]);_0x4809a4[_0x5e6c('0x32')]=_['intersection'](_0x4809a4[_0x5e6c('0x34')],_0x4809a4['query']);_0x1baef9[_0x5e6c('0x36')]=_[_0x5e6c('0x33')](_0x4809a4[_0x5e6c('0x34')],qs[_0x5e6c('0x35')](_0x29ed91[_0x5e6c('0x31')][_0x5e6c('0x35')]));_0x1baef9['attributes']=_0x1baef9['attributes'][_0x5e6c('0x44')]?_0x1baef9['attributes']:_0x4809a4[_0x5e6c('0x34')];_0x1baef9['order']=qs[_0x5e6c('0x38')](_0x29ed91[_0x5e6c('0x31')]['sort']);_0x1baef9['where']=qs[_0x5e6c('0x32')](_[_0x5e6c('0x3a')](_0x29ed91['query'],_0x4809a4['filters']));if(_0x29ed91['query']['filter']){_0x1baef9[_0x5e6c('0x39')]=_[_0x5e6c('0x3c')](_0x1baef9[_0x5e6c('0x39')],{'$or':_[_0x5e6c('0x2d')](_0x1baef9['attributes'],function(_0x40ef35){var _0x3263f6={};_0x3263f6[_0x40ef35]={'$like':'%'+_0x29ed91['query']['filter']+'%'};return _0x3263f6;})});}_0x1baef9=_[_0x5e6c('0x3c')]({},_0x1baef9,_0x29ed91[_0x5e6c('0x3d')]);return _0x476278['getSubjects'](_0x1baef9);}})[_0x5e6c('0x26')](function(_0x3394af){if(_0x3394af){_0x1ae897=_0x3394af[_0x5e6c('0x44')];if(!_0x29ed91[_0x5e6c('0x31')]['hasOwnProperty'](_0x5e6c('0x37'))){_0x1baef9['limit']=qs[_0x5e6c('0x1e')](_0x29ed91['query']['limit']);_0x1baef9[_0x5e6c('0x20')]=qs[_0x5e6c('0x20')](_0x29ed91[_0x5e6c('0x31')][_0x5e6c('0x20')]);}return _0x476278[_0x5e6c('0x49')](_0x1baef9);}})['then'](function(_0x39b47b){if(_0x39b47b){return _0x39b47b?{'count':_0x1ae897,'rows':_0x39b47b}:null;}})[_0x5e6c('0x26')](respondWithResult(_0x577e56,null))[_0x5e6c('0x46')](handleError(_0x577e56,null));};exports['getDescriptions']=function(_0x19f937,_0x50a6a4,_0x1e9e5a){var _0x22e360={};var _0x3a69b1={};var _0x191fd6;var _0x5b72fb;return db[_0x5e6c('0x2e')]['findOne']({'where':{'id':_0x19f937[_0x5e6c('0x41')]['id']}})['then'](handleEntityNotFound(_0x50a6a4,null))[_0x5e6c('0x26')](function(_0x35fd20){if(_0x35fd20){_0x191fd6=_0x35fd20;_0x3a69b1[_0x5e6c('0x34')]=_[_0x5e6c('0x42')](db[_0x5e6c('0x4b')]['rawAttributes']);_0x3a69b1['query']=_[_0x5e6c('0x42')](_0x19f937[_0x5e6c('0x31')]);_0x3a69b1[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x3a69b1[_0x5e6c('0x34')],_0x3a69b1[_0x5e6c('0x31')]);_0x22e360[_0x5e6c('0x36')]=_['intersection'](_0x3a69b1[_0x5e6c('0x34')],qs['fields'](_0x19f937[_0x5e6c('0x31')][_0x5e6c('0x35')]));_0x22e360[_0x5e6c('0x36')]=_0x22e360[_0x5e6c('0x36')][_0x5e6c('0x44')]?_0x22e360['attributes']:_0x3a69b1[_0x5e6c('0x34')];_0x22e360[_0x5e6c('0x4c')]=qs['sort'](_0x19f937[_0x5e6c('0x31')][_0x5e6c('0x38')]);_0x22e360[_0x5e6c('0x39')]=qs[_0x5e6c('0x32')](_[_0x5e6c('0x3a')](_0x19f937['query'],_0x3a69b1[_0x5e6c('0x32')]));if(_0x19f937[_0x5e6c('0x31')][_0x5e6c('0x3b')]){_0x22e360[_0x5e6c('0x39')]=_[_0x5e6c('0x3c')](_0x22e360[_0x5e6c('0x39')],{'$or':_['map'](_0x22e360[_0x5e6c('0x36')],function(_0x1c2df3){var _0x44d3f6={};_0x44d3f6[_0x1c2df3]={'$like':'%'+_0x19f937['query'][_0x5e6c('0x3b')]+'%'};return _0x44d3f6;})});}_0x22e360=_[_0x5e6c('0x3c')]({},_0x22e360,_0x19f937[_0x5e6c('0x3d')]);return _0x191fd6[_0x5e6c('0x4d')](_0x22e360);}})[_0x5e6c('0x26')](function(_0x24e536){if(_0x24e536){_0x5b72fb=_0x24e536['length'];if(!_0x19f937[_0x5e6c('0x31')][_0x5e6c('0x4e')](_0x5e6c('0x37'))){_0x22e360[_0x5e6c('0x1e')]=qs['limit'](_0x19f937[_0x5e6c('0x31')][_0x5e6c('0x1e')]);_0x22e360[_0x5e6c('0x20')]=qs[_0x5e6c('0x20')](_0x19f937[_0x5e6c('0x31')][_0x5e6c('0x20')]);}return _0x191fd6['getDescriptions'](_0x22e360);}})[_0x5e6c('0x26')](function(_0x4de7c1){if(_0x4de7c1){return _0x4de7c1?{'count':_0x5b72fb,'rows':_0x4de7c1}:null;}})[_0x5e6c('0x26')](respondWithResult(_0x50a6a4,null))[_0x5e6c('0x46')](handleError(_0x50a6a4,null));};exports[_0x5e6c('0x4f')]=function(_0x27eb69,_0x33298a,_0x189952){var _0x69fe66={};var _0x596e93={};var _0x4ac26e;var _0x340e20;return db[_0x5e6c('0x2e')][_0x5e6c('0x4a')]({'where':{'id':_0x27eb69['params']['id']}})['then'](handleEntityNotFound(_0x33298a,null))[_0x5e6c('0x26')](function(_0x34a929){if(_0x34a929){_0x4ac26e=_0x34a929;_0x596e93[_0x5e6c('0x34')]=_[_0x5e6c('0x42')](db[_0x5e6c('0x4b')][_0x5e6c('0x43')]);_0x596e93[_0x5e6c('0x31')]=_[_0x5e6c('0x42')](_0x27eb69[_0x5e6c('0x31')]);_0x596e93[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x596e93[_0x5e6c('0x34')],_0x596e93[_0x5e6c('0x31')]);_0x69fe66[_0x5e6c('0x36')]=_['intersection'](_0x596e93['model'],qs['fields'](_0x27eb69[_0x5e6c('0x31')][_0x5e6c('0x35')]));_0x69fe66[_0x5e6c('0x36')]=_0x69fe66[_0x5e6c('0x36')][_0x5e6c('0x44')]?_0x69fe66[_0x5e6c('0x36')]:_0x596e93[_0x5e6c('0x34')];_0x69fe66[_0x5e6c('0x4c')]=qs[_0x5e6c('0x38')](_0x27eb69['query'][_0x5e6c('0x38')]);_0x69fe66['where']=qs['filters'](_[_0x5e6c('0x3a')](_0x27eb69[_0x5e6c('0x31')],_0x596e93[_0x5e6c('0x32')]));if(_0x27eb69['query'][_0x5e6c('0x3b')]){_0x69fe66[_0x5e6c('0x39')]=_[_0x5e6c('0x3c')](_0x69fe66[_0x5e6c('0x39')],{'$or':_['map'](_0x69fe66['attributes'],function(_0x47baba){var _0xa34ac4={};_0xa34ac4[_0x47baba]={'$like':'%'+_0x27eb69['query'][_0x5e6c('0x3b')]+'%'};return _0xa34ac4;})});}_0x69fe66=_[_0x5e6c('0x3c')]({},_0x69fe66,_0x27eb69[_0x5e6c('0x3d')]);return _0x4ac26e[_0x5e6c('0x4f')](_0x69fe66);}})[_0x5e6c('0x26')](function(_0x539f93){if(_0x539f93){_0x340e20=_0x539f93[_0x5e6c('0x44')];if(!_0x27eb69['query'][_0x5e6c('0x4e')]('nolimit')){_0x69fe66[_0x5e6c('0x1e')]=qs[_0x5e6c('0x1e')](_0x27eb69['query']['limit']);_0x69fe66['offset']=qs[_0x5e6c('0x20')](_0x27eb69[_0x5e6c('0x31')][_0x5e6c('0x20')]);}return _0x4ac26e[_0x5e6c('0x4f')](_0x69fe66);}})['then'](function(_0xfdd14f){if(_0xfdd14f){return _0xfdd14f?{'count':_0x340e20,'rows':_0xfdd14f}:null;}})[_0x5e6c('0x26')](respondWithResult(_0x33298a,null))[_0x5e6c('0x46')](handleError(_0x33298a,null));}; \ No newline at end of file +var _0x8752=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','count','json','apply','reject','then','end','error','stack','name','index','FreshsalesConfiguration','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','body','destroy','findOne','order','getSubjects','nolimit','getDescriptions','FreshsalesField','getFields','eml-format'];(function(_0x34d3c3,_0x92d2bc){var _0x223195=function(_0x4adc4c){while(--_0x4adc4c){_0x34d3c3['push'](_0x34d3c3['shift']());}};_0x223195(++_0x92d2bc);}(_0x8752,0x1c1));var _0x2875=function(_0x2f42d8,_0x72bc12){_0x2f42d8=_0x2f42d8-0x0;var _0xc66ff6=_0x8752[_0x2f42d8];return _0xc66ff6;};'use strict';var emlformat=require(_0x2875('0x0'));var rimraf=require(_0x2875('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2875('0x2'));var rp=require(_0x2875('0x3'));var moment=require(_0x2875('0x4'));var BPromise=require(_0x2875('0x5'));var Mustache=require(_0x2875('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2875('0x7'));var csv=require(_0x2875('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2875('0x9'));var _=require(_0x2875('0xa'));var squel=require(_0x2875('0xb'));var crypto=require('crypto');var jsforce=require(_0x2875('0xc'));var deskjs=require(_0x2875('0xd'));var toCsv=require(_0x2875('0x8'));var querystring=require('querystring');var Papa=require(_0x2875('0xe'));var Redis=require(_0x2875('0xf'));var authService=require(_0x2875('0x10'));var qs=require(_0x2875('0x11'));var as=require(_0x2875('0x12'));var hardwareService=require(_0x2875('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2875('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2875('0x15'))['db'];function respondWithStatusCode(_0x104d6e,_0x2026d3){_0x2026d3=_0x2026d3||0xcc;return function(_0x518682){if(_0x518682){return _0x104d6e[_0x2875('0x16')](_0x2026d3);}return _0x104d6e[_0x2875('0x17')](_0x2026d3)['end']();};}function respondWithResult(_0x3bf87d,_0x1fe913){_0x1fe913=_0x1fe913||0xc8;return function(_0xaadf45){if(_0xaadf45){return _0x3bf87d[_0x2875('0x17')](_0x1fe913)['json'](_0xaadf45);}};}function respondWithFilteredResult(_0x3d91f0,_0x332449){return function(_0xfc2c4d){if(_0xfc2c4d){var _0x444936=typeof _0x332449[_0x2875('0x18')]==='undefined'&&typeof _0x332449[_0x2875('0x19')]==='undefined';var _0x3fede5=_0xfc2c4d[_0x2875('0x1a')];var _0x130957=_0x444936?0x0:_0x332449[_0x2875('0x18')];var _0x4ea887=_0x444936?_0xfc2c4d['count']:_0x332449['offset']+_0x332449[_0x2875('0x19')];var _0x11e45b;if(_0x4ea887>=_0x3fede5){_0x4ea887=_0x3fede5;_0x11e45b=0xc8;}else{_0x11e45b=0xce;}_0x3d91f0['status'](_0x11e45b);return _0x3d91f0['set']('Content-Range',_0x130957+'-'+_0x4ea887+'/'+_0x3fede5)[_0x2875('0x1b')](_0xfc2c4d);}return null;};}function patchUpdates(_0x376a6e){return function(_0x54ae71){try{jsonpatch[_0x2875('0x1c')](_0x54ae71,_0x376a6e,!![]);}catch(_0x93217){return BPromise[_0x2875('0x1d')](_0x93217);}return _0x54ae71['save']();};}function saveUpdates(_0x3584be,_0x44cfbc){return function(_0x1ed8cb){if(_0x1ed8cb){return _0x1ed8cb['update'](_0x3584be)['then'](function(_0x342f2c){return _0x342f2c;});}return null;};}function removeEntity(_0x374bd6,_0x4435e7){return function(_0xfc0a4d){if(_0xfc0a4d){return _0xfc0a4d['destroy']()[_0x2875('0x1e')](function(){_0x374bd6[_0x2875('0x17')](0xcc)[_0x2875('0x1f')]();});}};}function handleEntityNotFound(_0x436f0a,_0x4961cc){return function(_0x21b778){if(!_0x21b778){_0x436f0a[_0x2875('0x16')](0x194);}return _0x21b778;};}function handleError(_0x17b956,_0xb5a77a){_0xb5a77a=_0xb5a77a||0x1f4;return function(_0x5f586c){logger[_0x2875('0x20')](_0x5f586c[_0x2875('0x21')]);if(_0x5f586c[_0x2875('0x22')]){delete _0x5f586c[_0x2875('0x22')];}_0x17b956[_0x2875('0x17')](_0xb5a77a)['send'](_0x5f586c);};}exports[_0x2875('0x23')]=function(_0x5d9d08,_0x5b3b55){var _0x41c3e2={},_0x1ea84a={},_0xcdeb8b={'count':0x0,'rows':[]};var _0x1f82eb=_['map'](db[_0x2875('0x24')][_0x2875('0x25')],function(_0x178c2){return{'name':_0x178c2[_0x2875('0x26')],'type':_0x178c2[_0x2875('0x27')]['key']};});_0x1ea84a['model']=_[_0x2875('0x28')](_0x1f82eb,_0x2875('0x22'));_0x1ea84a[_0x2875('0x29')]=_['keys'](_0x5d9d08[_0x2875('0x29')]);_0x1ea84a[_0x2875('0x2a')]=_[_0x2875('0x2b')](_0x1ea84a[_0x2875('0x2c')],_0x1ea84a[_0x2875('0x29')]);_0x41c3e2['attributes']=_[_0x2875('0x2b')](_0x1ea84a[_0x2875('0x2c')],qs['fields'](_0x5d9d08[_0x2875('0x29')]['fields']));_0x41c3e2['attributes']=_0x41c3e2[_0x2875('0x2d')][_0x2875('0x2e')]?_0x41c3e2[_0x2875('0x2d')]:_0x1ea84a[_0x2875('0x2c')];if(!_0x5d9d08['query'][_0x2875('0x2f')]('nolimit')){_0x41c3e2[_0x2875('0x19')]=qs['limit'](_0x5d9d08['query'][_0x2875('0x19')]);_0x41c3e2[_0x2875('0x18')]=qs[_0x2875('0x18')](_0x5d9d08[_0x2875('0x29')]['offset']);}_0x41c3e2['order']=qs[_0x2875('0x30')](_0x5d9d08[_0x2875('0x29')][_0x2875('0x30')]);_0x41c3e2[_0x2875('0x31')]=qs[_0x2875('0x2a')](_[_0x2875('0x32')](_0x5d9d08[_0x2875('0x29')],_0x1ea84a[_0x2875('0x2a')]),_0x1f82eb);if(_0x5d9d08[_0x2875('0x29')]['filter']){_0x41c3e2[_0x2875('0x31')]=_[_0x2875('0x33')](_0x41c3e2[_0x2875('0x31')],{'$or':_[_0x2875('0x28')](_0x1f82eb,function(_0x447f94){if(_0x447f94[_0x2875('0x27')]!==_0x2875('0x34')){var _0xfc5bb1={};_0xfc5bb1[_0x447f94['name']]={'$like':'%'+_0x5d9d08[_0x2875('0x29')][_0x2875('0x35')]+'%'};return _0xfc5bb1;}})});}_0x41c3e2=_['merge']({},_0x41c3e2,_0x5d9d08[_0x2875('0x36')]);var _0x530efd={'where':_0x41c3e2[_0x2875('0x31')]};return db[_0x2875('0x24')][_0x2875('0x1a')](_0x530efd)[_0x2875('0x1e')](function(_0x1b1f48){_0xcdeb8b[_0x2875('0x1a')]=_0x1b1f48;if(_0x5d9d08['query']['includeAll']){_0x41c3e2[_0x2875('0x37')]=[{'all':!![]}];}return db[_0x2875('0x24')][_0x2875('0x38')](_0x41c3e2);})['then'](function(_0x430856){_0xcdeb8b[_0x2875('0x39')]=_0x430856;return _0xcdeb8b;})[_0x2875('0x1e')](respondWithFilteredResult(_0x5b3b55,_0x41c3e2))[_0x2875('0x3a')](handleError(_0x5b3b55,null));};exports[_0x2875('0x3b')]=function(_0x47f4f1,_0xd56ebd){var _0x5899c2={'raw':![],'where':{'id':_0x47f4f1[_0x2875('0x3c')]['id']}},_0x1f38dc={};_0x1f38dc[_0x2875('0x2c')]=_[_0x2875('0x3d')](db[_0x2875('0x24')][_0x2875('0x25')]);_0x1f38dc['query']=_[_0x2875('0x3d')](_0x47f4f1[_0x2875('0x29')]);_0x1f38dc['filters']=_[_0x2875('0x2b')](_0x1f38dc[_0x2875('0x2c')],_0x1f38dc['query']);_0x5899c2[_0x2875('0x2d')]=_[_0x2875('0x2b')](_0x1f38dc[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x47f4f1[_0x2875('0x29')][_0x2875('0x3e')]));_0x5899c2[_0x2875('0x2d')]=_0x5899c2[_0x2875('0x2d')][_0x2875('0x2e')]?_0x5899c2['attributes']:_0x1f38dc[_0x2875('0x2c')];if(_0x47f4f1[_0x2875('0x29')][_0x2875('0x3f')]){_0x5899c2['include']=[{'all':!![]}];}_0x5899c2=_[_0x2875('0x33')]({},_0x5899c2,_0x47f4f1['options']);return db[_0x2875('0x24')][_0x2875('0x40')](_0x5899c2)[_0x2875('0x1e')](handleEntityNotFound(_0xd56ebd,null))[_0x2875('0x1e')](respondWithResult(_0xd56ebd,null))[_0x2875('0x3a')](handleError(_0xd56ebd,null));};exports['create']=function(_0x2d969c,_0x3c4ad2){return db[_0x2875('0x24')][_0x2875('0x41')](_0x2d969c[_0x2875('0x42')],{})['then'](respondWithResult(_0x3c4ad2,0xc9))[_0x2875('0x3a')](handleError(_0x3c4ad2,null));};exports['update']=function(_0x182451,_0x35b20c){if(_0x182451[_0x2875('0x42')]['id']){delete _0x182451['body']['id'];}return db['FreshsalesConfiguration'][_0x2875('0x40')]({'where':{'id':_0x182451[_0x2875('0x3c')]['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x35b20c,null))[_0x2875('0x1e')](saveUpdates(_0x182451[_0x2875('0x42')],null))[_0x2875('0x1e')](respondWithResult(_0x35b20c,null))[_0x2875('0x3a')](handleError(_0x35b20c,null));};exports[_0x2875('0x43')]=function(_0x467f95,_0x404c57){return db[_0x2875('0x24')][_0x2875('0x40')]({'where':{'id':_0x467f95[_0x2875('0x3c')]['id']}})['then'](handleEntityNotFound(_0x404c57,null))[_0x2875('0x1e')](removeEntity(_0x404c57,null))[_0x2875('0x3a')](handleError(_0x404c57,null));};exports['getSubjects']=function(_0x5b1cd4,_0x38c1c3,_0x5154c2){var _0xb0785e={};var _0x49ee9a={};var _0x41d3da;var _0x6abf2e;return db['FreshsalesConfiguration'][_0x2875('0x44')]({'where':{'id':_0x5b1cd4['params']['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x38c1c3,null))[_0x2875('0x1e')](function(_0x513eff){if(_0x513eff){_0x41d3da=_0x513eff;_0x49ee9a[_0x2875('0x2c')]=_[_0x2875('0x3d')](db['FreshsalesField'][_0x2875('0x25')]);_0x49ee9a['query']=_[_0x2875('0x3d')](_0x5b1cd4[_0x2875('0x29')]);_0x49ee9a[_0x2875('0x2a')]=_[_0x2875('0x2b')](_0x49ee9a[_0x2875('0x2c')],_0x49ee9a['query']);_0xb0785e[_0x2875('0x2d')]=_[_0x2875('0x2b')](_0x49ee9a[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x5b1cd4[_0x2875('0x29')]['fields']));_0xb0785e[_0x2875('0x2d')]=_0xb0785e['attributes'][_0x2875('0x2e')]?_0xb0785e[_0x2875('0x2d')]:_0x49ee9a[_0x2875('0x2c')];_0xb0785e[_0x2875('0x45')]=qs[_0x2875('0x30')](_0x5b1cd4[_0x2875('0x29')][_0x2875('0x30')]);_0xb0785e[_0x2875('0x31')]=qs[_0x2875('0x2a')](_[_0x2875('0x32')](_0x5b1cd4[_0x2875('0x29')],_0x49ee9a[_0x2875('0x2a')]));if(_0x5b1cd4['query'][_0x2875('0x35')]){_0xb0785e['where']=_[_0x2875('0x33')](_0xb0785e[_0x2875('0x31')],{'$or':_[_0x2875('0x28')](_0xb0785e[_0x2875('0x2d')],function(_0x2d6087){var _0x35ea5a={};_0x35ea5a[_0x2d6087]={'$like':'%'+_0x5b1cd4[_0x2875('0x29')][_0x2875('0x35')]+'%'};return _0x35ea5a;})});}_0xb0785e=_[_0x2875('0x33')]({},_0xb0785e,_0x5b1cd4['options']);return _0x41d3da[_0x2875('0x46')](_0xb0785e);}})[_0x2875('0x1e')](function(_0x348dff){if(_0x348dff){_0x6abf2e=_0x348dff[_0x2875('0x2e')];if(!_0x5b1cd4[_0x2875('0x29')][_0x2875('0x2f')](_0x2875('0x47'))){_0xb0785e['limit']=qs['limit'](_0x5b1cd4[_0x2875('0x29')]['limit']);_0xb0785e[_0x2875('0x18')]=qs[_0x2875('0x18')](_0x5b1cd4[_0x2875('0x29')]['offset']);}return _0x41d3da['getSubjects'](_0xb0785e);}})[_0x2875('0x1e')](function(_0x1069ba){if(_0x1069ba){return _0x1069ba?{'count':_0x6abf2e,'rows':_0x1069ba}:null;}})[_0x2875('0x1e')](respondWithResult(_0x38c1c3,null))['catch'](handleError(_0x38c1c3,null));};exports[_0x2875('0x48')]=function(_0x3ab555,_0x4b0627,_0xa47121){var _0x2f2bdb={};var _0x26601c={};var _0x4ce7c1;var _0x43650f;return db[_0x2875('0x24')][_0x2875('0x44')]({'where':{'id':_0x3ab555[_0x2875('0x3c')]['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x4b0627,null))[_0x2875('0x1e')](function(_0x4568fc){if(_0x4568fc){_0x4ce7c1=_0x4568fc;_0x26601c['model']=_['keys'](db[_0x2875('0x49')][_0x2875('0x25')]);_0x26601c[_0x2875('0x29')]=_[_0x2875('0x3d')](_0x3ab555[_0x2875('0x29')]);_0x26601c[_0x2875('0x2a')]=_['intersection'](_0x26601c[_0x2875('0x2c')],_0x26601c[_0x2875('0x29')]);_0x2f2bdb['attributes']=_[_0x2875('0x2b')](_0x26601c[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x3ab555[_0x2875('0x29')][_0x2875('0x3e')]));_0x2f2bdb[_0x2875('0x2d')]=_0x2f2bdb['attributes'][_0x2875('0x2e')]?_0x2f2bdb[_0x2875('0x2d')]:_0x26601c['model'];_0x2f2bdb[_0x2875('0x45')]=qs[_0x2875('0x30')](_0x3ab555[_0x2875('0x29')]['sort']);_0x2f2bdb[_0x2875('0x31')]=qs[_0x2875('0x2a')](_[_0x2875('0x32')](_0x3ab555[_0x2875('0x29')],_0x26601c[_0x2875('0x2a')]));if(_0x3ab555['query'][_0x2875('0x35')]){_0x2f2bdb[_0x2875('0x31')]=_[_0x2875('0x33')](_0x2f2bdb['where'],{'$or':_[_0x2875('0x28')](_0x2f2bdb['attributes'],function(_0x243405){var _0x54a22c={};_0x54a22c[_0x243405]={'$like':'%'+_0x3ab555[_0x2875('0x29')][_0x2875('0x35')]+'%'};return _0x54a22c;})});}_0x2f2bdb=_[_0x2875('0x33')]({},_0x2f2bdb,_0x3ab555['options']);return _0x4ce7c1[_0x2875('0x48')](_0x2f2bdb);}})[_0x2875('0x1e')](function(_0x3c48f4){if(_0x3c48f4){_0x43650f=_0x3c48f4[_0x2875('0x2e')];if(!_0x3ab555['query'][_0x2875('0x2f')](_0x2875('0x47'))){_0x2f2bdb[_0x2875('0x19')]=qs[_0x2875('0x19')](_0x3ab555[_0x2875('0x29')][_0x2875('0x19')]);_0x2f2bdb['offset']=qs[_0x2875('0x18')](_0x3ab555[_0x2875('0x29')]['offset']);}return _0x4ce7c1[_0x2875('0x48')](_0x2f2bdb);}})[_0x2875('0x1e')](function(_0x5c8734){if(_0x5c8734){return _0x5c8734?{'count':_0x43650f,'rows':_0x5c8734}:null;}})[_0x2875('0x1e')](respondWithResult(_0x4b0627,null))[_0x2875('0x3a')](handleError(_0x4b0627,null));};exports[_0x2875('0x4a')]=function(_0x357571,_0x1fdcb0,_0x4602eb){var _0xcc1ae9={};var _0x36b584={};var _0x23ec5c;var _0x180439;return db[_0x2875('0x24')][_0x2875('0x44')]({'where':{'id':_0x357571[_0x2875('0x3c')]['id']}})[_0x2875('0x1e')](handleEntityNotFound(_0x1fdcb0,null))['then'](function(_0x571842){if(_0x571842){_0x23ec5c=_0x571842;_0x36b584[_0x2875('0x2c')]=_[_0x2875('0x3d')](db[_0x2875('0x49')][_0x2875('0x25')]);_0x36b584['query']=_[_0x2875('0x3d')](_0x357571[_0x2875('0x29')]);_0x36b584['filters']=_[_0x2875('0x2b')](_0x36b584[_0x2875('0x2c')],_0x36b584[_0x2875('0x29')]);_0xcc1ae9[_0x2875('0x2d')]=_['intersection'](_0x36b584[_0x2875('0x2c')],qs[_0x2875('0x3e')](_0x357571['query'][_0x2875('0x3e')]));_0xcc1ae9[_0x2875('0x2d')]=_0xcc1ae9['attributes'][_0x2875('0x2e')]?_0xcc1ae9['attributes']:_0x36b584[_0x2875('0x2c')];_0xcc1ae9['order']=qs[_0x2875('0x30')](_0x357571['query'][_0x2875('0x30')]);_0xcc1ae9[_0x2875('0x31')]=qs[_0x2875('0x2a')](_['pick'](_0x357571[_0x2875('0x29')],_0x36b584[_0x2875('0x2a')]));if(_0x357571[_0x2875('0x29')]['filter']){_0xcc1ae9[_0x2875('0x31')]=_[_0x2875('0x33')](_0xcc1ae9[_0x2875('0x31')],{'$or':_[_0x2875('0x28')](_0xcc1ae9['attributes'],function(_0x567c84){var _0x5a86d3={};_0x5a86d3[_0x567c84]={'$like':'%'+_0x357571['query'][_0x2875('0x35')]+'%'};return _0x5a86d3;})});}_0xcc1ae9=_[_0x2875('0x33')]({},_0xcc1ae9,_0x357571['options']);return _0x23ec5c['getFields'](_0xcc1ae9);}})[_0x2875('0x1e')](function(_0x55b794){if(_0x55b794){_0x180439=_0x55b794[_0x2875('0x2e')];if(!_0x357571['query'][_0x2875('0x2f')](_0x2875('0x47'))){_0xcc1ae9[_0x2875('0x19')]=qs['limit'](_0x357571[_0x2875('0x29')]['limit']);_0xcc1ae9['offset']=qs[_0x2875('0x18')](_0x357571[_0x2875('0x29')]['offset']);}return _0x23ec5c[_0x2875('0x4a')](_0xcc1ae9);}})[_0x2875('0x1e')](function(_0x55e02d){if(_0x55e02d){return _0x55e02d?{'count':_0x180439,'rows':_0x55e02d}:null;}})[_0x2875('0x1e')](respondWithResult(_0x1fdcb0,null))[_0x2875('0x3a')](handleError(_0x1fdcb0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 49e89ed..9da62fa 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 _0x33bb=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0x33bb,0xde));var _0xb33b=function(_0x2d0243,_0x2f549e){_0x2d0243=_0x2d0243-0x0;var _0x4cc1b4=_0x33bb[_0x2d0243];return _0x4cc1b4;};'use strict';var _=require(_0xb33b('0x0'));var util=require(_0xb33b('0x1'));var logger=require(_0xb33b('0x2'))(_0xb33b('0x3'));var moment=require(_0xb33b('0x4'));var BPromise=require(_0xb33b('0x5'));var rp=require(_0xb33b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb33b('0x7'));var config=require(_0xb33b('0x8'));var attributes=require(_0xb33b('0x9'));module[_0xb33b('0xa')]=function(_0x3a8531,_0x390c31){return _0x3a8531[_0xb33b('0xb')](_0xb33b('0xc'),attributes,{'tableName':_0xb33b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52df=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0xdf3958,_0x4c702f){var _0x5e365c=function(_0x9ec942){while(--_0x9ec942){_0xdf3958['push'](_0xdf3958['shift']());}};_0x5e365c(++_0x4c702f);}(_0x52df,0x99));var _0xf52d=function(_0x3734ad,_0x2d4105){_0x3734ad=_0x3734ad-0x0;var _0x4acb9c=_0x52df[_0x3734ad];return _0x4acb9c;};'use strict';var _=require(_0xf52d('0x0'));var util=require(_0xf52d('0x1'));var logger=require(_0xf52d('0x2'))(_0xf52d('0x3'));var moment=require(_0xf52d('0x4'));var BPromise=require(_0xf52d('0x5'));var rp=require(_0xf52d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf52d('0x7'));var config=require(_0xf52d('0x8'));var attributes=require(_0xf52d('0x9'));module['exports']=function(_0x52a9a5,_0x498cd3){return _0x52a9a5['define'](_0xf52d('0xa'),attributes,{'tableName':_0xf52d('0xb'),'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 8be1964..94def8c 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 _0x1c86=['catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x1c86,0x85));var _0x61c8=function(_0x5d0e97,_0xbe642c){_0x5d0e97=_0x5d0e97-0x0;var _0x2bfaac=_0x1c86[_0x5d0e97];return _0x2bfaac;};'use strict';var _=require('lodash');var util=require(_0x61c8('0x0'));var moment=require('moment');var BPromise=require(_0x61c8('0x1'));var rs=require(_0x61c8('0x2'));var fs=require('fs');var Redis=require(_0x61c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61c8('0x4'))(_0x61c8('0x5'));var config=require(_0x61c8('0x6'));var jayson=require(_0x61c8('0x7'));var client=jayson[_0x61c8('0x8')][_0x61c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12956d,_0x5abdb8,_0x3d28e5){return new BPromise(function(_0x945a13,_0x49616a){return client['request'](_0x12956d,_0x3d28e5)[_0x61c8('0xa')](function(_0x519cd7){logger[_0x61c8('0xb')](_0x61c8('0xc'),_0x5abdb8,_0x61c8('0xd'));logger[_0x61c8('0xe')](_0x61c8('0xf'),_0x5abdb8,'request\x20sent',JSON[_0x61c8('0x10')](_0x519cd7));if(_0x519cd7[_0x61c8('0x11')]){if(_0x519cd7[_0x61c8('0x11')][_0x61c8('0x12')]===0x1f4){logger[_0x61c8('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5abdb8,_0x519cd7[_0x61c8('0x11')][_0x61c8('0x13')]);return _0x49616a(_0x519cd7['error'][_0x61c8('0x13')]);}logger[_0x61c8('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5abdb8,_0x519cd7[_0x61c8('0x11')][_0x61c8('0x13')]);return _0x945a13(_0x519cd7['error']['message']);}else{logger[_0x61c8('0xb')](_0x61c8('0xc'),_0x5abdb8,_0x61c8('0xd'));_0x945a13(_0x519cd7[_0x61c8('0x14')]['message']);}})[_0x61c8('0x15')](function(_0x2f2614){logger[_0x61c8('0x11')](_0x61c8('0xc'),_0x5abdb8,_0x2f2614);_0x49616a(_0x2f2614);});});} \ No newline at end of file +var _0x0575=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x22f327,_0x43035f){var _0x2c42f0=function(_0x21c8fc){while(--_0x21c8fc){_0x22f327['push'](_0x22f327['shift']());}};_0x2c42f0(++_0x43035f);}(_0x0575,0x125));var _0x5057=function(_0x201d02,_0x164c77){_0x201d02=_0x201d02-0x0;var _0x49e2d7=_0x0575[_0x201d02];return _0x49e2d7;};'use strict';var _=require(_0x5057('0x0'));var util=require(_0x5057('0x1'));var moment=require('moment');var BPromise=require(_0x5057('0x2'));var rs=require(_0x5057('0x3'));var fs=require('fs');var Redis=require(_0x5057('0x4'));var db=require(_0x5057('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5057('0x6'))(_0x5057('0x7'));var config=require(_0x5057('0x8'));var jayson=require(_0x5057('0x9'));var client=jayson['client'][_0x5057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e129a,_0x99c709,_0x109ea9){return new BPromise(function(_0x83b4d3,_0x1af39f){return client[_0x5057('0xb')](_0x5e129a,_0x109ea9)['then'](function(_0x2b5d92){logger[_0x5057('0xc')](_0x5057('0xd'),_0x99c709,_0x5057('0xe'));logger[_0x5057('0xf')](_0x5057('0x10'),_0x99c709,_0x5057('0xe'),JSON[_0x5057('0x11')](_0x2b5d92));if(_0x2b5d92[_0x5057('0x12')]){if(_0x2b5d92[_0x5057('0x12')][_0x5057('0x13')]===0x1f4){logger[_0x5057('0x12')](_0x5057('0xd'),_0x99c709,_0x2b5d92[_0x5057('0x12')]['message']);return _0x1af39f(_0x2b5d92['error']['message']);}logger[_0x5057('0x12')](_0x5057('0xd'),_0x99c709,_0x2b5d92[_0x5057('0x12')][_0x5057('0x14')]);return _0x83b4d3(_0x2b5d92['error'][_0x5057('0x14')]);}else{logger[_0x5057('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x99c709,'request\x20sent');_0x83b4d3(_0x2b5d92[_0x5057('0x15')]['message']);}})['catch'](function(_0x51cea1){logger[_0x5057('0x12')](_0x5057('0xd'),_0x99c709,_0x51cea1);_0x1af39f(_0x51cea1);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index cb705d1..10206f4 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 _0xf822=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xf822,0x19e));var _0x2f82=function(_0x58acaa,_0x584173){_0x58acaa=_0x58acaa-0x0;var _0x372f23=_0xf822[_0x58acaa];return _0x372f23;};'use strict';var multer=require(_0x2f82('0x0'));var util=require('util');var path=require(_0x2f82('0x1'));var timeout=require(_0x2f82('0x2'));var express=require(_0x2f82('0x3'));var router=express[_0x2f82('0x4')]();var fs_extra=require(_0x2f82('0x5'));var auth=require(_0x2f82('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f82('0x7'));var controller=require(_0x2f82('0x8'));router[_0x2f82('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f82('0xa')]);router['get'](_0x2f82('0xb'),auth[_0x2f82('0xc')](),controller[_0x2f82('0xd')]);router[_0x2f82('0xe')]('/',auth[_0x2f82('0xc')](),controller[_0x2f82('0xf')]);router['put'](_0x2f82('0xb'),auth[_0x2f82('0xc')](),controller[_0x2f82('0x10')]);router[_0x2f82('0x11')](_0x2f82('0xb'),auth[_0x2f82('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf0cc=['fs-extra','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x57e858,_0xcb95cd){var _0x30a837=function(_0x54d6cd){while(--_0x54d6cd){_0x57e858['push'](_0x57e858['shift']());}};_0x30a837(++_0xcb95cd);}(_0xf0cc,0xa7));var _0xcf0c=function(_0xd8506e,_0x3a4b75){_0xd8506e=_0xd8506e-0x0;var _0x28e5c8=_0xf0cc[_0xd8506e];return _0x28e5c8;};'use strict';var multer=require(_0xcf0c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf0c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xcf0c('0x2'));var auth=require(_0xcf0c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcf0c('0x4'));router[_0xcf0c('0x5')]('/',auth[_0xcf0c('0x6')](),controller['index']);router[_0xcf0c('0x5')](_0xcf0c('0x7'),auth[_0xcf0c('0x6')](),controller['show']);router['post']('/',auth[_0xcf0c('0x6')](),controller['create']);router[_0xcf0c('0x8')]('/:id',auth[_0xcf0c('0x6')](),controller[_0xcf0c('0x9')]);router[_0xcf0c('0xa')](_0xcf0c('0x7'),auth[_0xcf0c('0x6')](),controller[_0xcf0c('0xb')]);module[_0xcf0c('0xc')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 47d5a96..3e96c50 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 _0xce09=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x31078a,_0x2a2d4a){var _0x4c8017=function(_0x3d8fbc){while(--_0x3d8fbc){_0x31078a['push'](_0x31078a['shift']());}};_0x4c8017(++_0x2a2d4a);}(_0xce09,0x153));var _0x9ce0=function(_0xd2e51d,_0x1936d2){_0xd2e51d=_0xd2e51d-0x0;var _0x919ffc=_0xce09[_0xd2e51d];return _0x919ffc;};'use strict';var Sequelize=require(_0x9ce0('0x0'));module[_0x9ce0('0x1')]={'type':{'type':Sequelize[_0x9ce0('0x2')](_0x9ce0('0x3'),_0x9ce0('0x4'),_0x9ce0('0x5'),_0x9ce0('0x6'),'picklist'),'defaultValue':_0x9ce0('0x3')},'content':{'type':Sequelize[_0x9ce0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9ce0('0x2')](_0x9ce0('0x3'),'variable',_0x9ce0('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9ce0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9ce0('0x7')]}}; \ No newline at end of file +var _0x3d32=['sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x1c88e7,_0x154945){var _0x5afee3=function(_0x2a31f5){while(--_0x2a31f5){_0x1c88e7['push'](_0x1c88e7['shift']());}};_0x5afee3(++_0x154945);}(_0x3d32,0x75));var _0x23d3=function(_0xe3d30,_0x346dca){_0xe3d30=_0xe3d30-0x0;var _0xd2b70a=_0x3d32[_0xe3d30];return _0xd2b70a;};'use strict';var Sequelize=require(_0x23d3('0x0'));module[_0x23d3('0x1')]={'type':{'type':Sequelize[_0x23d3('0x2')]('string',_0x23d3('0x3'),_0x23d3('0x4'),_0x23d3('0x5'),_0x23d3('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x23d3('0x7')]},'key':{'type':Sequelize[_0x23d3('0x7')]},'keyType':{'type':Sequelize[_0x23d3('0x2')]('string',_0x23d3('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x23d3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x23d3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x23d3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 2958cca..b43033f 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 _0xfab8=['apply','save','update','then','destroy','error','name','send','FreshsalesField','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','filters','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x586c1e,_0x2002ae){var _0x1b75fa=function(_0x314355){while(--_0x314355){_0x586c1e['push'](_0x586c1e['shift']());}};_0x1b75fa(++_0x2002ae);}(_0xfab8,0x101));var _0x8fab=function(_0x23aeb4,_0x149d54){_0x23aeb4=_0x23aeb4-0x0;var _0x259003=_0xfab8[_0x23aeb4];return _0x259003;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fab('0x0'));var zipdir=require(_0x8fab('0x1'));var jsonpatch=require(_0x8fab('0x2'));var rp=require(_0x8fab('0x3'));var moment=require(_0x8fab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8fab('0x5'));var util=require('util');var path=require(_0x8fab('0x6'));var sox=require(_0x8fab('0x7'));var csv=require('to-csv');var ejs=require(_0x8fab('0x8'));var fs=require('fs');var fs_extra=require(_0x8fab('0x9'));var _=require(_0x8fab('0xa'));var squel=require(_0x8fab('0xb'));var crypto=require('crypto');var jsforce=require(_0x8fab('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8fab('0xd'));var querystring=require(_0x8fab('0xe'));var Papa=require(_0x8fab('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8fab('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fab('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x8fab('0x12'));var licenseUtil=require(_0x8fab('0x13'));var db=require(_0x8fab('0x14'))['db'];function respondWithStatusCode(_0x507344,_0x3c2e80){_0x3c2e80=_0x3c2e80||0xcc;return function(_0x10663a){if(_0x10663a){return _0x507344[_0x8fab('0x15')](_0x3c2e80);}return _0x507344[_0x8fab('0x16')](_0x3c2e80)[_0x8fab('0x17')]();};}function respondWithResult(_0x17052f,_0x2c5684){_0x2c5684=_0x2c5684||0xc8;return function(_0x56444d){if(_0x56444d){return _0x17052f[_0x8fab('0x16')](_0x2c5684)[_0x8fab('0x18')](_0x56444d);}};}function respondWithFilteredResult(_0x4f6715,_0x452258){return function(_0x40cce3){if(_0x40cce3){var _0x43ccb5=typeof _0x452258[_0x8fab('0x19')]===_0x8fab('0x1a')&&typeof _0x452258[_0x8fab('0x1b')]===_0x8fab('0x1a');var _0x2208c2=_0x40cce3[_0x8fab('0x1c')];var _0x100cd8=_0x43ccb5?0x0:_0x452258[_0x8fab('0x19')];var _0x14975f=_0x43ccb5?_0x40cce3[_0x8fab('0x1c')]:_0x452258[_0x8fab('0x19')]+_0x452258[_0x8fab('0x1b')];var _0x1623e5;if(_0x14975f>=_0x2208c2){_0x14975f=_0x2208c2;_0x1623e5=0xc8;}else{_0x1623e5=0xce;}_0x4f6715[_0x8fab('0x16')](_0x1623e5);return _0x4f6715[_0x8fab('0x1d')](_0x8fab('0x1e'),_0x100cd8+'-'+_0x14975f+'/'+_0x2208c2)[_0x8fab('0x18')](_0x40cce3);}return null;};}function patchUpdates(_0x37d113){return function(_0x5ccdc2){try{jsonpatch[_0x8fab('0x1f')](_0x5ccdc2,_0x37d113,!![]);}catch(_0x5118b6){return BPromise['reject'](_0x5118b6);}return _0x5ccdc2[_0x8fab('0x20')]();};}function saveUpdates(_0x443369,_0x4e4b28){return function(_0xb3c6d1){if(_0xb3c6d1){return _0xb3c6d1[_0x8fab('0x21')](_0x443369)[_0x8fab('0x22')](function(_0x51f354){return _0x51f354;});}return null;};}function removeEntity(_0x15f3c3,_0xf59959){return function(_0x4cab07){if(_0x4cab07){return _0x4cab07[_0x8fab('0x23')]()[_0x8fab('0x22')](function(){_0x15f3c3['status'](0xcc)[_0x8fab('0x17')]();});}};}function handleEntityNotFound(_0x1bd5b8,_0x1fede9){return function(_0x79cc63){if(!_0x79cc63){_0x1bd5b8[_0x8fab('0x15')](0x194);}return _0x79cc63;};}function handleError(_0x518715,_0x4734e5){_0x4734e5=_0x4734e5||0x1f4;return function(_0x46dfe9){logger[_0x8fab('0x24')](_0x46dfe9['stack']);if(_0x46dfe9['name']){delete _0x46dfe9[_0x8fab('0x25')];}_0x518715[_0x8fab('0x16')](_0x4734e5)[_0x8fab('0x26')](_0x46dfe9);};}exports['index']=function(_0x3f6def,_0x4b2f93){var _0x17fda0={},_0x3d93ef={},_0x152818={'count':0x0,'rows':[]};var _0x5c3088=_['map'](db[_0x8fab('0x27')][_0x8fab('0x28')],function(_0x1e80cc){return{'name':_0x1e80cc[_0x8fab('0x29')],'type':_0x1e80cc[_0x8fab('0x2a')][_0x8fab('0x2b')]};});_0x3d93ef['model']=_[_0x8fab('0x2c')](_0x5c3088,_0x8fab('0x25'));_0x3d93ef['query']=_['keys'](_0x3f6def[_0x8fab('0x2d')]);_0x3d93ef['filters']=_[_0x8fab('0x2e')](_0x3d93ef[_0x8fab('0x2f')],_0x3d93ef[_0x8fab('0x2d')]);_0x17fda0['attributes']=_[_0x8fab('0x2e')](_0x3d93ef[_0x8fab('0x2f')],qs[_0x8fab('0x30')](_0x3f6def[_0x8fab('0x2d')]['fields']));_0x17fda0[_0x8fab('0x31')]=_0x17fda0[_0x8fab('0x31')][_0x8fab('0x32')]?_0x17fda0[_0x8fab('0x31')]:_0x3d93ef[_0x8fab('0x2f')];if(!_0x3f6def[_0x8fab('0x2d')][_0x8fab('0x33')](_0x8fab('0x34'))){_0x17fda0[_0x8fab('0x1b')]=qs['limit'](_0x3f6def[_0x8fab('0x2d')][_0x8fab('0x1b')]);_0x17fda0['offset']=qs[_0x8fab('0x19')](_0x3f6def[_0x8fab('0x2d')][_0x8fab('0x19')]);}_0x17fda0[_0x8fab('0x35')]=qs[_0x8fab('0x36')](_0x3f6def[_0x8fab('0x2d')][_0x8fab('0x36')]);_0x17fda0[_0x8fab('0x37')]=qs['filters'](_[_0x8fab('0x38')](_0x3f6def[_0x8fab('0x2d')],_0x3d93ef['filters']),_0x5c3088);if(_0x3f6def['query'][_0x8fab('0x39')]){_0x17fda0[_0x8fab('0x37')]=_[_0x8fab('0x3a')](_0x17fda0[_0x8fab('0x37')],{'$or':_[_0x8fab('0x2c')](_0x5c3088,function(_0x2076e3){if(_0x2076e3['type']!=='VIRTUAL'){var _0x50e369={};_0x50e369[_0x2076e3[_0x8fab('0x25')]]={'$like':'%'+_0x3f6def['query'][_0x8fab('0x39')]+'%'};return _0x50e369;}})});}_0x17fda0=_[_0x8fab('0x3a')]({},_0x17fda0,_0x3f6def[_0x8fab('0x3b')]);var _0x1cbbf0={'where':_0x17fda0['where']};return db[_0x8fab('0x27')]['count'](_0x1cbbf0)['then'](function(_0x335253){_0x152818[_0x8fab('0x1c')]=_0x335253;if(_0x3f6def['query'][_0x8fab('0x3c')]){_0x17fda0[_0x8fab('0x3d')]=[{'all':!![]}];}return db['FreshsalesField'][_0x8fab('0x3e')](_0x17fda0);})[_0x8fab('0x22')](function(_0x461138){_0x152818[_0x8fab('0x3f')]=_0x461138;return _0x152818;})[_0x8fab('0x22')](respondWithFilteredResult(_0x4b2f93,_0x17fda0))['catch'](handleError(_0x4b2f93,null));};exports[_0x8fab('0x40')]=function(_0x3d1a86,_0x1ebcef){var _0x305275={'raw':!![],'where':{'id':_0x3d1a86[_0x8fab('0x41')]['id']}},_0x151a98={};_0x151a98[_0x8fab('0x2f')]=_[_0x8fab('0x42')](db['FreshsalesField'][_0x8fab('0x28')]);_0x151a98[_0x8fab('0x2d')]=_[_0x8fab('0x42')](_0x3d1a86[_0x8fab('0x2d')]);_0x151a98[_0x8fab('0x43')]=_[_0x8fab('0x2e')](_0x151a98[_0x8fab('0x2f')],_0x151a98[_0x8fab('0x2d')]);_0x305275[_0x8fab('0x31')]=_[_0x8fab('0x2e')](_0x151a98[_0x8fab('0x2f')],qs['fields'](_0x3d1a86[_0x8fab('0x2d')][_0x8fab('0x30')]));_0x305275[_0x8fab('0x31')]=_0x305275['attributes']['length']?_0x305275['attributes']:_0x151a98[_0x8fab('0x2f')];if(_0x3d1a86[_0x8fab('0x2d')]['includeAll']){_0x305275[_0x8fab('0x3d')]=[{'all':!![]}];}_0x305275=_[_0x8fab('0x3a')]({},_0x305275,_0x3d1a86['options']);return db['FreshsalesField'][_0x8fab('0x44')](_0x305275)[_0x8fab('0x22')](handleEntityNotFound(_0x1ebcef,null))[_0x8fab('0x22')](respondWithResult(_0x1ebcef,null))[_0x8fab('0x45')](handleError(_0x1ebcef,null));};exports[_0x8fab('0x46')]=function(_0x592f35,_0x585b36){return db[_0x8fab('0x27')]['create'](_0x592f35[_0x8fab('0x47')],{})[_0x8fab('0x22')](respondWithResult(_0x585b36,0xc9))['catch'](handleError(_0x585b36,null));};exports[_0x8fab('0x21')]=function(_0x199848,_0x423d2c){if(_0x199848[_0x8fab('0x47')]['id']){delete _0x199848[_0x8fab('0x47')]['id'];}return db[_0x8fab('0x27')]['find']({'where':{'id':_0x199848[_0x8fab('0x41')]['id']}})[_0x8fab('0x22')](handleEntityNotFound(_0x423d2c,null))[_0x8fab('0x22')](saveUpdates(_0x199848['body'],null))[_0x8fab('0x22')](respondWithResult(_0x423d2c,null))['catch'](handleError(_0x423d2c,null));};exports[_0x8fab('0x23')]=function(_0x4f0d1e,_0x3cb769){return db[_0x8fab('0x27')]['find']({'where':{'id':_0x4f0d1e[_0x8fab('0x41')]['id']}})[_0x8fab('0x22')](handleEntityNotFound(_0x3cb769,null))[_0x8fab('0x22')](removeEntity(_0x3cb769,null))[_0x8fab('0x45')](handleError(_0x3cb769,null));}; \ No newline at end of file +var _0x5e58=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','FreshsalesField','includeAll','include','findAll','catch','show','params','length','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x6f41f7,_0x1806aa){var _0x4e1fb0=function(_0x2e6700){while(--_0x2e6700){_0x6f41f7['push'](_0x6f41f7['shift']());}};_0x4e1fb0(++_0x1806aa);}(_0x5e58,0xcd));var _0x85e5=function(_0x28770f,_0x5cff78){_0x28770f=_0x28770f-0x0;var _0x51bfe2=_0x5e58[_0x28770f];return _0x51bfe2;};'use strict';var emlformat=require(_0x85e5('0x0'));var rimraf=require(_0x85e5('0x1'));var zipdir=require(_0x85e5('0x2'));var jsonpatch=require(_0x85e5('0x3'));var rp=require(_0x85e5('0x4'));var moment=require(_0x85e5('0x5'));var BPromise=require(_0x85e5('0x6'));var Mustache=require('mustache');var util=require(_0x85e5('0x7'));var path=require('path');var sox=require(_0x85e5('0x8'));var csv=require(_0x85e5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85e5('0xa'));var _=require(_0x85e5('0xb'));var squel=require(_0x85e5('0xc'));var crypto=require(_0x85e5('0xd'));var jsforce=require(_0x85e5('0xe'));var deskjs=require(_0x85e5('0xf'));var toCsv=require(_0x85e5('0x9'));var querystring=require('querystring');var Papa=require(_0x85e5('0x10'));var Redis=require(_0x85e5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x85e5('0x12'));var as=require(_0x85e5('0x13'));var hardwareService=require(_0x85e5('0x14'));var logger=require(_0x85e5('0x15'))(_0x85e5('0x16'));var utils=require(_0x85e5('0x17'));var config=require(_0x85e5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x85e5('0x19'))['db'];function respondWithStatusCode(_0x529b42,_0x2f1e81){_0x2f1e81=_0x2f1e81||0xcc;return function(_0x4c019d){if(_0x4c019d){return _0x529b42[_0x85e5('0x1a')](_0x2f1e81);}return _0x529b42[_0x85e5('0x1b')](_0x2f1e81)[_0x85e5('0x1c')]();};}function respondWithResult(_0xb083b9,_0x1a1d81){_0x1a1d81=_0x1a1d81||0xc8;return function(_0x4a2bb1){if(_0x4a2bb1){return _0xb083b9[_0x85e5('0x1b')](_0x1a1d81)[_0x85e5('0x1d')](_0x4a2bb1);}};}function respondWithFilteredResult(_0x3541ca,_0x1aef93){return function(_0x533b99){if(_0x533b99){var _0x17eacc=typeof _0x1aef93[_0x85e5('0x1e')]===_0x85e5('0x1f')&&typeof _0x1aef93[_0x85e5('0x20')]===_0x85e5('0x1f');var _0x90c5=_0x533b99['count'];var _0x3b1391=_0x17eacc?0x0:_0x1aef93['offset'];var _0x239587=_0x17eacc?_0x533b99[_0x85e5('0x21')]:_0x1aef93['offset']+_0x1aef93[_0x85e5('0x20')];var _0x3a8df9;if(_0x239587>=_0x90c5){_0x239587=_0x90c5;_0x3a8df9=0xc8;}else{_0x3a8df9=0xce;}_0x3541ca['status'](_0x3a8df9);return _0x3541ca[_0x85e5('0x22')](_0x85e5('0x23'),_0x3b1391+'-'+_0x239587+'/'+_0x90c5)[_0x85e5('0x1d')](_0x533b99);}return null;};}function patchUpdates(_0x4c8a64){return function(_0x44b1ef){try{jsonpatch['apply'](_0x44b1ef,_0x4c8a64,!![]);}catch(_0x17ba67){return BPromise[_0x85e5('0x24')](_0x17ba67);}return _0x44b1ef['save']();};}function saveUpdates(_0x357d86,_0x3d8501){return function(_0x103014){if(_0x103014){return _0x103014['update'](_0x357d86)[_0x85e5('0x25')](function(_0x347033){return _0x347033;});}return null;};}function removeEntity(_0x38e9d0,_0x557dc2){return function(_0x1a219f){if(_0x1a219f){return _0x1a219f['destroy']()[_0x85e5('0x25')](function(){_0x38e9d0[_0x85e5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x71cd9c,_0x53a287){return function(_0x57e0d8){if(!_0x57e0d8){_0x71cd9c[_0x85e5('0x1a')](0x194);}return _0x57e0d8;};}function handleError(_0x5a8df5,_0x201081){_0x201081=_0x201081||0x1f4;return function(_0x508a76){logger['error'](_0x508a76[_0x85e5('0x26')]);if(_0x508a76['name']){delete _0x508a76[_0x85e5('0x27')];}_0x5a8df5[_0x85e5('0x1b')](_0x201081)[_0x85e5('0x28')](_0x508a76);};}exports[_0x85e5('0x29')]=function(_0x40a111,_0x9d6d0b){var _0x70d8f3={},_0x367616={},_0x118959={'count':0x0,'rows':[]};var _0x2cffb2=_[_0x85e5('0x2a')](db['FreshsalesField'][_0x85e5('0x2b')],function(_0x367a44){return{'name':_0x367a44[_0x85e5('0x2c')],'type':_0x367a44[_0x85e5('0x2d')][_0x85e5('0x2e')]};});_0x367616['model']=_[_0x85e5('0x2a')](_0x2cffb2,'name');_0x367616[_0x85e5('0x2f')]=_[_0x85e5('0x30')](_0x40a111[_0x85e5('0x2f')]);_0x367616[_0x85e5('0x31')]=_[_0x85e5('0x32')](_0x367616[_0x85e5('0x33')],_0x367616[_0x85e5('0x2f')]);_0x70d8f3[_0x85e5('0x34')]=_[_0x85e5('0x32')](_0x367616[_0x85e5('0x33')],qs[_0x85e5('0x35')](_0x40a111[_0x85e5('0x2f')]['fields']));_0x70d8f3['attributes']=_0x70d8f3[_0x85e5('0x34')]['length']?_0x70d8f3[_0x85e5('0x34')]:_0x367616['model'];if(!_0x40a111[_0x85e5('0x2f')]['hasOwnProperty'](_0x85e5('0x36'))){_0x70d8f3[_0x85e5('0x20')]=qs[_0x85e5('0x20')](_0x40a111[_0x85e5('0x2f')][_0x85e5('0x20')]);_0x70d8f3[_0x85e5('0x1e')]=qs[_0x85e5('0x1e')](_0x40a111[_0x85e5('0x2f')][_0x85e5('0x1e')]);}_0x70d8f3['order']=qs[_0x85e5('0x37')](_0x40a111[_0x85e5('0x2f')]['sort']);_0x70d8f3[_0x85e5('0x38')]=qs[_0x85e5('0x31')](_[_0x85e5('0x39')](_0x40a111[_0x85e5('0x2f')],_0x367616[_0x85e5('0x31')]),_0x2cffb2);if(_0x40a111['query'][_0x85e5('0x3a')]){_0x70d8f3[_0x85e5('0x38')]=_['merge'](_0x70d8f3['where'],{'$or':_[_0x85e5('0x2a')](_0x2cffb2,function(_0xe31a77){if(_0xe31a77[_0x85e5('0x2d')]!==_0x85e5('0x3b')){var _0x4920f3={};_0x4920f3[_0xe31a77[_0x85e5('0x27')]]={'$like':'%'+_0x40a111['query'][_0x85e5('0x3a')]+'%'};return _0x4920f3;}})});}_0x70d8f3=_[_0x85e5('0x3c')]({},_0x70d8f3,_0x40a111[_0x85e5('0x3d')]);var _0x4f2e98={'where':_0x70d8f3[_0x85e5('0x38')]};return db[_0x85e5('0x3e')]['count'](_0x4f2e98)[_0x85e5('0x25')](function(_0x3ea4bb){_0x118959[_0x85e5('0x21')]=_0x3ea4bb;if(_0x40a111['query'][_0x85e5('0x3f')]){_0x70d8f3[_0x85e5('0x40')]=[{'all':!![]}];}return db[_0x85e5('0x3e')][_0x85e5('0x41')](_0x70d8f3);})[_0x85e5('0x25')](function(_0x114486){_0x118959['rows']=_0x114486;return _0x118959;})[_0x85e5('0x25')](respondWithFilteredResult(_0x9d6d0b,_0x70d8f3))[_0x85e5('0x42')](handleError(_0x9d6d0b,null));};exports[_0x85e5('0x43')]=function(_0x524989,_0x42ad71){var _0x523e27={'raw':!![],'where':{'id':_0x524989[_0x85e5('0x44')]['id']}},_0x1288cf={};_0x1288cf[_0x85e5('0x33')]=_[_0x85e5('0x30')](db[_0x85e5('0x3e')]['rawAttributes']);_0x1288cf[_0x85e5('0x2f')]=_['keys'](_0x524989['query']);_0x1288cf[_0x85e5('0x31')]=_[_0x85e5('0x32')](_0x1288cf['model'],_0x1288cf[_0x85e5('0x2f')]);_0x523e27[_0x85e5('0x34')]=_[_0x85e5('0x32')](_0x1288cf[_0x85e5('0x33')],qs[_0x85e5('0x35')](_0x524989[_0x85e5('0x2f')][_0x85e5('0x35')]));_0x523e27[_0x85e5('0x34')]=_0x523e27['attributes'][_0x85e5('0x45')]?_0x523e27[_0x85e5('0x34')]:_0x1288cf[_0x85e5('0x33')];if(_0x524989['query'][_0x85e5('0x3f')]){_0x523e27[_0x85e5('0x40')]=[{'all':!![]}];}_0x523e27=_['merge']({},_0x523e27,_0x524989[_0x85e5('0x3d')]);return db[_0x85e5('0x3e')]['find'](_0x523e27)[_0x85e5('0x25')](handleEntityNotFound(_0x42ad71,null))['then'](respondWithResult(_0x42ad71,null))[_0x85e5('0x42')](handleError(_0x42ad71,null));};exports['create']=function(_0x2119b9,_0x24aa67){return db[_0x85e5('0x3e')][_0x85e5('0x46')](_0x2119b9[_0x85e5('0x47')],{})[_0x85e5('0x25')](respondWithResult(_0x24aa67,0xc9))[_0x85e5('0x42')](handleError(_0x24aa67,null));};exports[_0x85e5('0x48')]=function(_0x46c66b,_0x516760){if(_0x46c66b[_0x85e5('0x47')]['id']){delete _0x46c66b[_0x85e5('0x47')]['id'];}return db[_0x85e5('0x3e')][_0x85e5('0x49')]({'where':{'id':_0x46c66b[_0x85e5('0x44')]['id']}})[_0x85e5('0x25')](handleEntityNotFound(_0x516760,null))['then'](saveUpdates(_0x46c66b[_0x85e5('0x47')],null))[_0x85e5('0x25')](respondWithResult(_0x516760,null))[_0x85e5('0x42')](handleError(_0x516760,null));};exports[_0x85e5('0x4a')]=function(_0x291717,_0x395691){return db[_0x85e5('0x3e')]['find']({'where':{'id':_0x291717[_0x85e5('0x44')]['id']}})[_0x85e5('0x25')](handleEntityNotFound(_0x395691,null))[_0x85e5('0x25')](removeEntity(_0x395691,null))[_0x85e5('0x42')](handleError(_0x395691,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 2e7bb7e..95fd966 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 _0xa35e=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x230547,_0x5d4fa2){var _0x4ca52b=function(_0x363ed6){while(--_0x363ed6){_0x230547['push'](_0x230547['shift']());}};_0x4ca52b(++_0x5d4fa2);}(_0xa35e,0x111));var _0xea35=function(_0x3d03d3,_0x97e7d4){_0x3d03d3=_0x3d03d3-0x0;var _0x209717=_0xa35e[_0x3d03d3];return _0x209717;};'use strict';var _=require(_0xea35('0x0'));var util=require('util');var logger=require(_0xea35('0x1'))(_0xea35('0x2'));var moment=require(_0xea35('0x3'));var BPromise=require(_0xea35('0x4'));var rp=require(_0xea35('0x5'));var fs=require('fs');var path=require(_0xea35('0x6'));var rimraf=require(_0xea35('0x7'));var config=require(_0xea35('0x8'));var attributes=require(_0xea35('0x9'));module[_0xea35('0xa')]=function(_0x3d2b41,_0x3dc645){return _0x3d2b41[_0xea35('0xb')](_0xea35('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xea35('0xd'),'fields':[_0xea35('0xe'),_0xea35('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ac0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','util'];(function(_0x47f36a,_0x5612b7){var _0x120eb8=function(_0x4e2e3f){while(--_0x4e2e3f){_0x47f36a['push'](_0x47f36a['shift']());}};_0x120eb8(++_0x5612b7);}(_0x0ac0,0x130));var _0x00ac=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x0ac0[_0x3ba422];return _0x20b5dd;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var logger=require(_0x00ac('0x2'))('api');var moment=require(_0x00ac('0x3'));var BPromise=require(_0x00ac('0x4'));var rp=require(_0x00ac('0x5'));var fs=require('fs');var path=require(_0x00ac('0x6'));var rimraf=require(_0x00ac('0x7'));var config=require(_0x00ac('0x8'));var attributes=require(_0x00ac('0x9'));module[_0x00ac('0xa')]=function(_0x4caaa8,_0x464817){return _0x4caaa8[_0x00ac('0xb')](_0x00ac('0xc'),attributes,{'tableName':_0x00ac('0xd'),'paranoid':![],'indexes':[{'name':_0x00ac('0xe'),'fields':[_0x00ac('0xf'),_0x00ac('0x10')],'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 6aa9371..ed8f5e5 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 _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x12e184,_0x3ef9ff){var _0x2404dd=function(_0x297b56){while(--_0x297b56){_0x12e184['push'](_0x12e184['shift']());}};_0x2404dd(++_0x3ef9ff);}(_0xeda8,0x104));var _0x8eda=function(_0x21db1a,_0x50d5bd){_0x21db1a=_0x21db1a-0x0;var _0x1d116f=_0xeda8[_0x21db1a];return _0x1d116f;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file +var _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x561975,_0x1d64fc){var _0x15b7f5=function(_0x43bfc1){while(--_0x43bfc1){_0x561975['push'](_0x561975['shift']());}};_0x15b7f5(++_0x1d64fc);}(_0x7c09,0x102));var _0x97c0=function(_0x55bb90,_0x51e305){_0x55bb90=_0x55bb90-0x0;var _0x595f13=_0x7c09[_0x55bb90];return _0x595f13;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 656507a..471f908 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(_0x1e7d80,_0x28ea35){var _0x1fb199=function(_0x5a6353){while(--_0x5a6353){_0x1e7d80['push'](_0x1e7d80['shift']());}};_0x1fb199(++_0x28ea35);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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(_0x284cb4,_0x5713d2){var _0xc3724c=function(_0x39c403){while(--_0x39c403){_0x284cb4['push'](_0x284cb4['shift']());}};_0xc3724c(++_0x5713d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 9f84910..b9239ce 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 _0x598a=['integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x2ddfbd,_0x26f97d){var _0x59b3d7=function(_0xcd9c84){while(--_0xcd9c84){_0x2ddfbd['push'](_0x2ddfbd['shift']());}};_0x59b3d7(++_0x26f97d);}(_0x598a,0x1c9));var _0xa598=function(_0x335934,_0x527852){_0x335934=_0x335934-0x0;var _0xf6ad48=_0x598a[_0x335934];return _0xf6ad48;};'use strict';var Sequelize=require(_0xa598('0x0'));module[_0xa598('0x1')]={'name':{'type':Sequelize[_0xa598('0x2')]},'description':{'type':Sequelize[_0xa598('0x2')]},'username':{'type':Sequelize[_0xa598('0x2')],'unique':_0xa598('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa598('0x2')]},'clientId':{'type':Sequelize[_0xa598('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xa598('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa598('0x4')](_0xa598('0x5'),'newTab'),'defaultValue':_0xa598('0x5')}}; \ No newline at end of file +var _0x7f59=['newTab','integrationTab','sequelize','exports','STRING','username'];(function(_0x4ad3be,_0x1ec00d){var _0x1efe95=function(_0x361d46){while(--_0x361d46){_0x4ad3be['push'](_0x4ad3be['shift']());}};_0x1efe95(++_0x1ec00d);}(_0x7f59,0x12e));var _0x97f5=function(_0x517677,_0x5949ab){_0x517677=_0x517677-0x0;var _0x43746d=_0x7f59[_0x517677];return _0x43746d;};'use strict';var Sequelize=require(_0x97f5('0x0'));module[_0x97f5('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x97f5('0x2')]},'username':{'type':Sequelize[_0x97f5('0x2')],'unique':_0x97f5('0x3')},'remoteUri':{'type':Sequelize[_0x97f5('0x2')]},'password':{'type':Sequelize[_0x97f5('0x2')]},'clientId':{'type':Sequelize[_0x97f5('0x2')]},'clientSecret':{'type':Sequelize[_0x97f5('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x97f5('0x4')),'defaultValue':_0x97f5('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index fe55288..fa46cd1 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 _0xd780=['count','Content-Range','json','save','update','then','sendStatus','error','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','find','create','body','getConfigurations','findOne','params','SalesforceConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','username','password','securityToken','slice','substring','Connection','clientId','clientSecret','login','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Subject','Description','string','int','boolean','email','textarea','phone','includes','label','custom','value','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit'];(function(_0x1bffd0,_0x5c57f3){var _0x15893a=function(_0x11cd75){while(--_0x11cd75){_0x1bffd0['push'](_0x1bffd0['shift']());}};_0x15893a(++_0x5c57f3);}(_0xd780,0x148));var _0x0d78=function(_0x4d684d,_0x19bdbc){_0x4d684d=_0x4d684d-0x0;var _0x380e63=_0xd780[_0x4d684d];return _0x380e63;};'use strict';var emlformat=require(_0x0d78('0x0'));var rimraf=require(_0x0d78('0x1'));var zipdir=require(_0x0d78('0x2'));var jsonpatch=require(_0x0d78('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0d78('0x4'));var Mustache=require(_0x0d78('0x5'));var util=require(_0x0d78('0x6'));var path=require(_0x0d78('0x7'));var sox=require(_0x0d78('0x8'));var csv=require(_0x0d78('0x9'));var ejs=require(_0x0d78('0xa'));var fs=require('fs');var fs_extra=require(_0x0d78('0xb'));var _=require('lodash');var squel=require(_0x0d78('0xc'));var crypto=require('crypto');var jsforce=require(_0x0d78('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0d78('0x9'));var querystring=require(_0x0d78('0xe'));var Papa=require(_0x0d78('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0d78('0x10'));var as=require(_0x0d78('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d78('0x12'))(_0x0d78('0x13'));var utils=require(_0x0d78('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0d78('0x15'));var db=require(_0x0d78('0x16'))['db'];var integrations=require(_0x0d78('0x17'));function respondWithStatusCode(_0x17c194,_0x2633b0){_0x2633b0=_0x2633b0||0xcc;return function(_0x2c8afe){if(_0x2c8afe){return _0x17c194['sendStatus'](_0x2633b0);}return _0x17c194[_0x0d78('0x18')](_0x2633b0)[_0x0d78('0x19')]();};}function respondWithResult(_0x350f9c,_0x362d1f){_0x362d1f=_0x362d1f||0xc8;return function(_0x54d1dc){if(_0x54d1dc){return _0x350f9c[_0x0d78('0x18')](_0x362d1f)['json'](_0x54d1dc);}};}function respondWithFilteredResult(_0x4a6fb2,_0x3f2364){return function(_0xd3508){if(_0xd3508){var _0x55612f=typeof _0x3f2364[_0x0d78('0x1a')]===_0x0d78('0x1b')&&typeof _0x3f2364[_0x0d78('0x1c')]===_0x0d78('0x1b');var _0x201b66=_0xd3508[_0x0d78('0x1d')];var _0x1edc55=_0x55612f?0x0:_0x3f2364['offset'];var _0x295b41=_0x55612f?_0xd3508[_0x0d78('0x1d')]:_0x3f2364[_0x0d78('0x1a')]+_0x3f2364[_0x0d78('0x1c')];var _0x328daa;if(_0x295b41>=_0x201b66){_0x295b41=_0x201b66;_0x328daa=0xc8;}else{_0x328daa=0xce;}_0x4a6fb2['status'](_0x328daa);return _0x4a6fb2['set'](_0x0d78('0x1e'),_0x1edc55+'-'+_0x295b41+'/'+_0x201b66)[_0x0d78('0x1f')](_0xd3508);}return null;};}function patchUpdates(_0x1542b8){return function(_0x386366){try{jsonpatch['apply'](_0x386366,_0x1542b8,!![]);}catch(_0x5b7daf){return BPromise['reject'](_0x5b7daf);}return _0x386366[_0x0d78('0x20')]();};}function saveUpdates(_0x419a14,_0x177e1e){return function(_0x15aced){if(_0x15aced){return _0x15aced[_0x0d78('0x21')](_0x419a14)[_0x0d78('0x22')](function(_0x128945){return _0x128945;});}return null;};}function removeEntity(_0x2c1c99,_0x27752b){return function(_0x5b3ab9){if(_0x5b3ab9){return _0x5b3ab9['destroy']()['then'](function(){_0x2c1c99[_0x0d78('0x18')](0xcc)[_0x0d78('0x19')]();});}};}function handleEntityNotFound(_0x48c1c6,_0x386042){return function(_0x187ea6){if(!_0x187ea6){_0x48c1c6[_0x0d78('0x23')](0x194);}return _0x187ea6;};}function handleError(_0x4d1a13,_0x4df53b){_0x4df53b=_0x4df53b||0x1f4;return function(_0x386797){logger[_0x0d78('0x24')](_0x386797['stack']);if(_0x386797['name']){delete _0x386797[_0x0d78('0x25')];}_0x4d1a13['status'](_0x4df53b)[_0x0d78('0x26')](_0x386797);};}exports[_0x0d78('0x27')]=function(_0x15f526,_0x16df17){var _0x2f4bff={},_0x45e5e4={},_0x1e0d86={'count':0x0,'rows':[]};var _0x47b22f=_[_0x0d78('0x28')](db[_0x0d78('0x29')][_0x0d78('0x2a')],function(_0x2023fe){return{'name':_0x2023fe[_0x0d78('0x2b')],'type':_0x2023fe[_0x0d78('0x2c')]['key']};});_0x45e5e4[_0x0d78('0x2d')]=_['map'](_0x47b22f,_0x0d78('0x25'));_0x45e5e4[_0x0d78('0x2e')]=_[_0x0d78('0x2f')](_0x15f526[_0x0d78('0x2e')]);_0x45e5e4[_0x0d78('0x30')]=_[_0x0d78('0x31')](_0x45e5e4[_0x0d78('0x2d')],_0x45e5e4[_0x0d78('0x2e')]);_0x2f4bff[_0x0d78('0x32')]=_['intersection'](_0x45e5e4[_0x0d78('0x2d')],qs[_0x0d78('0x33')](_0x15f526[_0x0d78('0x2e')][_0x0d78('0x33')]));_0x2f4bff[_0x0d78('0x32')]=_0x2f4bff[_0x0d78('0x32')][_0x0d78('0x34')]?_0x2f4bff[_0x0d78('0x32')]:_0x45e5e4[_0x0d78('0x2d')];if(!_0x15f526[_0x0d78('0x2e')][_0x0d78('0x35')](_0x0d78('0x36'))){_0x2f4bff[_0x0d78('0x1c')]=qs['limit'](_0x15f526[_0x0d78('0x2e')]['limit']);_0x2f4bff[_0x0d78('0x1a')]=qs[_0x0d78('0x1a')](_0x15f526[_0x0d78('0x2e')][_0x0d78('0x1a')]);}_0x2f4bff[_0x0d78('0x37')]=qs[_0x0d78('0x38')](_0x15f526[_0x0d78('0x2e')]['sort']);_0x2f4bff[_0x0d78('0x39')]=qs[_0x0d78('0x30')](_['pick'](_0x15f526[_0x0d78('0x2e')],_0x45e5e4[_0x0d78('0x30')]),_0x47b22f);if(_0x15f526['query'][_0x0d78('0x3a')]){_0x2f4bff[_0x0d78('0x39')]=_['merge'](_0x2f4bff['where'],{'$or':_[_0x0d78('0x28')](_0x47b22f,function(_0x3951da){if(_0x3951da['type']!==_0x0d78('0x3b')){var _0x393044={};_0x393044[_0x3951da[_0x0d78('0x25')]]={'$like':'%'+_0x15f526['query'][_0x0d78('0x3a')]+'%'};return _0x393044;}})});}_0x2f4bff=_[_0x0d78('0x3c')]({},_0x2f4bff,_0x15f526[_0x0d78('0x3d')]);var _0x4614b0={'where':_0x2f4bff[_0x0d78('0x39')]};return db['SalesforceAccount'][_0x0d78('0x1d')](_0x4614b0)[_0x0d78('0x22')](function(_0x34c84d){_0x1e0d86[_0x0d78('0x1d')]=_0x34c84d;if(_0x15f526[_0x0d78('0x2e')][_0x0d78('0x3e')]){_0x2f4bff[_0x0d78('0x3f')]=[{'all':!![]}];}return db[_0x0d78('0x29')]['findAll'](_0x2f4bff);})[_0x0d78('0x22')](function(_0x91dc7f){_0x1e0d86['rows']=_0x91dc7f;return _0x1e0d86;})[_0x0d78('0x22')](respondWithFilteredResult(_0x16df17,_0x2f4bff))[_0x0d78('0x40')](handleError(_0x16df17,null));};exports[_0x0d78('0x41')]=function(_0x1f3b8f,_0x34286f){var _0x238474={'raw':![],'where':{'id':_0x1f3b8f['params']['id']}},_0x19be58={};_0x19be58[_0x0d78('0x2d')]=_[_0x0d78('0x2f')](db[_0x0d78('0x29')]['rawAttributes']);_0x19be58[_0x0d78('0x2e')]=_[_0x0d78('0x2f')](_0x1f3b8f[_0x0d78('0x2e')]);_0x19be58['filters']=_[_0x0d78('0x31')](_0x19be58['model'],_0x19be58['query']);_0x238474[_0x0d78('0x32')]=_['intersection'](_0x19be58['model'],qs[_0x0d78('0x33')](_0x1f3b8f[_0x0d78('0x2e')][_0x0d78('0x33')]));_0x238474[_0x0d78('0x32')]=_0x238474['attributes'][_0x0d78('0x34')]?_0x238474['attributes']:_0x19be58[_0x0d78('0x2d')];if(_0x1f3b8f['query']['includeAll']){_0x238474[_0x0d78('0x3f')]=[{'all':!![]}];}_0x238474=_[_0x0d78('0x3c')]({},_0x238474,_0x1f3b8f[_0x0d78('0x3d')]);return db[_0x0d78('0x29')][_0x0d78('0x42')](_0x238474)['then'](handleEntityNotFound(_0x34286f,null))[_0x0d78('0x22')](respondWithResult(_0x34286f,null))[_0x0d78('0x40')](handleError(_0x34286f,null));};exports[_0x0d78('0x43')]=function(_0x203616,_0x41dcbb){return db[_0x0d78('0x29')][_0x0d78('0x43')](_0x203616[_0x0d78('0x44')],{})[_0x0d78('0x22')](respondWithResult(_0x41dcbb,0xc9))[_0x0d78('0x40')](handleError(_0x41dcbb,null));};exports['update']=function(_0x201e0d,_0x28bd5e){if(_0x201e0d[_0x0d78('0x44')]['id']){delete _0x201e0d[_0x0d78('0x44')]['id'];}return db['SalesforceAccount'][_0x0d78('0x42')]({'where':{'id':_0x201e0d['params']['id']}})['then'](handleEntityNotFound(_0x28bd5e,null))[_0x0d78('0x22')](saveUpdates(_0x201e0d[_0x0d78('0x44')],null))[_0x0d78('0x22')](respondWithResult(_0x28bd5e,null))[_0x0d78('0x40')](handleError(_0x28bd5e,null));};exports['destroy']=function(_0xd8fa73,_0x192635){return db[_0x0d78('0x29')][_0x0d78('0x42')]({'where':{'id':_0xd8fa73['params']['id']}})['then'](handleEntityNotFound(_0x192635,null))[_0x0d78('0x22')](removeEntity(_0x192635,null))['catch'](handleError(_0x192635,null));};exports[_0x0d78('0x45')]=function(_0x76b2a,_0x10ad46,_0x1e9bc9){var _0x1bfd1e={};var _0x88182c={};var _0x1800c9;var _0xe8cd65;return db['SalesforceAccount'][_0x0d78('0x46')]({'where':{'id':_0x76b2a[_0x0d78('0x47')]['id']}})[_0x0d78('0x22')](handleEntityNotFound(_0x10ad46,null))[_0x0d78('0x22')](function(_0x157ba7){if(_0x157ba7){_0x1800c9=_0x157ba7;_0x88182c[_0x0d78('0x2d')]=_['keys'](db[_0x0d78('0x48')]['rawAttributes']);_0x88182c[_0x0d78('0x2e')]=_[_0x0d78('0x2f')](_0x76b2a[_0x0d78('0x2e')]);_0x88182c[_0x0d78('0x30')]=_[_0x0d78('0x31')](_0x88182c[_0x0d78('0x2d')],_0x88182c[_0x0d78('0x2e')]);_0x1bfd1e[_0x0d78('0x32')]=_[_0x0d78('0x31')](_0x88182c[_0x0d78('0x2d')],qs[_0x0d78('0x33')](_0x76b2a[_0x0d78('0x2e')][_0x0d78('0x33')]));_0x1bfd1e[_0x0d78('0x32')]=_0x1bfd1e[_0x0d78('0x32')][_0x0d78('0x34')]?_0x1bfd1e['attributes']:_0x88182c[_0x0d78('0x2d')];_0x1bfd1e[_0x0d78('0x37')]=qs['sort'](_0x76b2a[_0x0d78('0x2e')][_0x0d78('0x38')]);_0x1bfd1e[_0x0d78('0x39')]=qs[_0x0d78('0x30')](_[_0x0d78('0x49')](_0x76b2a[_0x0d78('0x2e')],_0x88182c[_0x0d78('0x30')]));if(_0x76b2a[_0x0d78('0x2e')][_0x0d78('0x3a')]){_0x1bfd1e[_0x0d78('0x39')]=_['merge'](_0x1bfd1e[_0x0d78('0x39')],{'$or':_['map'](_0x1bfd1e[_0x0d78('0x32')],function(_0x146633){var _0x142b22={};_0x142b22[_0x146633]={'$like':'%'+_0x76b2a[_0x0d78('0x2e')]['filter']+'%'};return _0x142b22;})});}_0x1bfd1e=_[_0x0d78('0x3c')]({},_0x1bfd1e,_0x76b2a[_0x0d78('0x3d')]);return _0x1800c9[_0x0d78('0x45')](_0x1bfd1e);}})[_0x0d78('0x22')](function(_0x548b2d){if(_0x548b2d){_0xe8cd65=_0x548b2d['length'];if(!_0x76b2a[_0x0d78('0x2e')][_0x0d78('0x35')](_0x0d78('0x36'))){_0x1bfd1e[_0x0d78('0x1c')]=qs['limit'](_0x76b2a[_0x0d78('0x2e')]['limit']);_0x1bfd1e[_0x0d78('0x1a')]=qs['offset'](_0x76b2a[_0x0d78('0x2e')][_0x0d78('0x1a')]);}return _0x1800c9[_0x0d78('0x45')](_0x1bfd1e);}})[_0x0d78('0x22')](function(_0x561342){if(_0x561342){return _0x561342?{'count':_0xe8cd65,'rows':_0x561342}:null;}})[_0x0d78('0x22')](respondWithResult(_0x10ad46,null))[_0x0d78('0x40')](handleError(_0x10ad46,null));};exports[_0x0d78('0x4a')]=function(_0x5370ec,_0x65677d,_0x2df85b){if(_0x5370ec['body']['id']){delete _0x5370ec['body']['id'];}return db[_0x0d78('0x29')][_0x0d78('0x46')]({'where':{'id':_0x5370ec[_0x0d78('0x47')]['id']}})[_0x0d78('0x22')](handleEntityNotFound(_0x65677d,null))[_0x0d78('0x22')](function(_0x52f7ed){if(_0x52f7ed){_0x5370ec[_0x0d78('0x44')][_0x0d78('0x4b')]=_0x52f7ed['id'];_0x5370ec[_0x0d78('0x44')][_0x0d78('0x4c')]=integrations[_0x0d78('0x4d')](_0x5370ec[_0x0d78('0x44')][_0x0d78('0x4e')],_0x5370ec[_0x0d78('0x44')][_0x0d78('0x2c')]);_0x5370ec['body'][_0x0d78('0x4f')]=integrations[_0x0d78('0x50')](_0x5370ec[_0x0d78('0x44')][_0x0d78('0x4e')],_0x5370ec[_0x0d78('0x44')]['type']);return db[_0x0d78('0x48')][_0x0d78('0x43')](_0x5370ec[_0x0d78('0x44')],{'include':[{'model':db[_0x0d78('0x51')],'as':_0x0d78('0x4c')},{'model':db[_0x0d78('0x51')],'as':'Descriptions'}]});}return null;})[_0x0d78('0x22')](respondWithResult(_0x65677d,null))[_0x0d78('0x40')](handleError(_0x65677d,null));};exports[_0x0d78('0x52')]=function(_0x34b9e4,_0x3528a9,_0x110ad0){var _0x5aa237;var _0xd44bfb='';var _0x3387e3=_0x0d78('0x53');return db[_0x0d78('0x29')][_0x0d78('0x46')]({'where':{'id':_0x34b9e4['params']['id']},'attributes':['id',_0x0d78('0x54'),'clientId','clientSecret',_0x0d78('0x55'),_0x0d78('0x56'),_0x0d78('0x57')]})[_0x0d78('0x22')](handleEntityNotFound(_0x3528a9,null))[_0x0d78('0x22')](function(_0x3c9277){if(_0x3c9277){_0xd44bfb=_0x3c9277[_0x0d78('0x54')];var _0x5c0a1a=_0xd44bfb[_0x0d78('0x58')](-0x1);if(_0x5c0a1a==='/'){_0xd44bfb=_0xd44bfb[_0x0d78('0x59')](0x0,_0xd44bfb['lastIndexOf'](_0x5c0a1a));}_0x5aa237=new jsforce[(_0x0d78('0x5a'))]({'oauth2':{'loginUrl':_0xd44bfb,'clientId':_0x3c9277[_0x0d78('0x5b')],'clientSecret':_0x3c9277[_0x0d78('0x5c')]}});return _0x5aa237[_0x0d78('0x5d')](_0x3c9277['username'],_0x3c9277[_0x0d78('0x56')][_0x0d78('0x5e')](_0x3c9277[_0x0d78('0x57')]));}})['then'](function(_0xdbdc41){if(_0xdbdc41){if(!_[_0x0d78('0x5f')](_0x34b9e4['query'][_0x0d78('0x60')])){_0x3387e3=_0x34b9e4[_0x0d78('0x2e')][_0x0d78('0x60')];}return _0x5aa237[_0x0d78('0x61')](_0x3387e3)[_0x0d78('0x62')]();}})[_0x0d78('0x22')](function(_0x1d0324){var _0x4b09ad=['OwnerId',_0x0d78('0x63'),_0x0d78('0x64'),'IsRecurrence',_0x0d78('0x65'),_0x0d78('0x66')];var _0x3baa6e=[_0x0d78('0x67'),_0x0d78('0x68'),'picklist',_0x0d78('0x69'),_0x0d78('0x6a'),_0x0d78('0x6b'),_0x0d78('0x6c')];if(_0x1d0324){_['remove'](_0x1d0324[_0x0d78('0x33')],function(_0x40f552){return _0x4b09ad[_0x0d78('0x6d')](_0x40f552['name'])||!_0x3baa6e[_0x0d78('0x6d')](_0x40f552[_0x0d78('0x2c')]);});return{'count':_0x1d0324[_0x0d78('0x33')]['length'],'rows':_['map'](_0x1d0324[_0x0d78('0x33')],function(_0x2aaa18){return{'id':_0x2aaa18[_0x0d78('0x25')],'name':_0x2aaa18[_0x0d78('0x6e')],'custom':_0x2aaa18[_0x0d78('0x6f')],'options':_0x2aaa18['picklistValues'][_0x0d78('0x34')]>0x0?_['map'](_0x2aaa18['picklistValues'],function(_0x4342b2){return{'name':_0x4342b2[_0x0d78('0x6e')],'value':_0x4342b2[_0x0d78('0x70')]};}):_0x2aaa18['type']==_0x0d78('0x69')?[{'name':'True','value':_0x0d78('0x71')},{'name':_0x0d78('0x72'),'value':'false'}]:[]};})};}})[_0x0d78('0x22')](respondWithResult(_0x3528a9,null))['catch'](function(_0x5d8ab5){var _0x4546d4=_0x34b9e4[_0x0d78('0x2e')][_0x0d78('0x73')]?0x1f4:_0x5d8ab5['statusCode']||0x1f4;logger[_0x0d78('0x24')](_0x0d78('0x74'),_0x0d78('0x52'),_0x4546d4,JSON[_0x0d78('0x75')](_0x5d8ab5));delete _0x5d8ab5['name'];if(_0x4546d4===0x191){_0x4546d4=0x190;}_0x3528a9[_0x0d78('0x18')](_0x4546d4)[_0x0d78('0x26')](_0x34b9e4['query'][_0x0d78('0x73')]?{'message':_0x0d78('0x76'),'statusCode':_0x5d8ab5['statusCode']}:_0x5d8ab5);});}; \ No newline at end of file +var _0x8939=['login','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value','True','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','params','keys','length','find','create','body','catch','update','getConfigurations','findOne','pick','options','getSubjects','channel','getDescriptions','SalesforceConfiguration','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','clientId'];(function(_0x4821df,_0x50df79){var _0x4b05da=function(_0x59e886){while(--_0x59e886){_0x4821df['push'](_0x4821df['shift']());}};_0x4b05da(++_0x50df79);}(_0x8939,0x116));var _0x9893=function(_0x1690d6,_0x25e4fb){_0x1690d6=_0x1690d6-0x0;var _0xe9bab4=_0x8939[_0x1690d6];return _0xe9bab4;};'use strict';var emlformat=require(_0x9893('0x0'));var rimraf=require(_0x9893('0x1'));var zipdir=require(_0x9893('0x2'));var jsonpatch=require(_0x9893('0x3'));var rp=require(_0x9893('0x4'));var moment=require(_0x9893('0x5'));var BPromise=require(_0x9893('0x6'));var Mustache=require('mustache');var util=require(_0x9893('0x7'));var path=require(_0x9893('0x8'));var sox=require(_0x9893('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9893('0xa'));var _=require(_0x9893('0xb'));var squel=require(_0x9893('0xc'));var crypto=require(_0x9893('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9893('0xe'));var querystring=require(_0x9893('0xf'));var Papa=require(_0x9893('0x10'));var Redis=require(_0x9893('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9893('0x12'));var as=require(_0x9893('0x13'));var hardwareService=require(_0x9893('0x14'));var logger=require('../../config/logger')(_0x9893('0x15'));var utils=require(_0x9893('0x16'));var config=require(_0x9893('0x17'));var licenseUtil=require(_0x9893('0x18'));var db=require(_0x9893('0x19'))['db'];var integrations=require(_0x9893('0x1a'));function respondWithStatusCode(_0x4df5ba,_0x2f4c6b){_0x2f4c6b=_0x2f4c6b||0xcc;return function(_0x143142){if(_0x143142){return _0x4df5ba['sendStatus'](_0x2f4c6b);}return _0x4df5ba[_0x9893('0x1b')](_0x2f4c6b)[_0x9893('0x1c')]();};}function respondWithResult(_0x37ac1b,_0x3e67b2){_0x3e67b2=_0x3e67b2||0xc8;return function(_0x171c46){if(_0x171c46){return _0x37ac1b[_0x9893('0x1b')](_0x3e67b2)[_0x9893('0x1d')](_0x171c46);}};}function respondWithFilteredResult(_0x1bed44,_0x2477bd){return function(_0x4bec2f){if(_0x4bec2f){var _0x42a353=typeof _0x2477bd['offset']==='undefined'&&typeof _0x2477bd[_0x9893('0x1e')]===_0x9893('0x1f');var _0x1d29d2=_0x4bec2f[_0x9893('0x20')];var _0x5255c9=_0x42a353?0x0:_0x2477bd[_0x9893('0x21')];var _0x4bfb67=_0x42a353?_0x4bec2f['count']:_0x2477bd[_0x9893('0x21')]+_0x2477bd[_0x9893('0x1e')];var _0x349bde;if(_0x4bfb67>=_0x1d29d2){_0x4bfb67=_0x1d29d2;_0x349bde=0xc8;}else{_0x349bde=0xce;}_0x1bed44[_0x9893('0x1b')](_0x349bde);return _0x1bed44['set'](_0x9893('0x22'),_0x5255c9+'-'+_0x4bfb67+'/'+_0x1d29d2)[_0x9893('0x1d')](_0x4bec2f);}return null;};}function patchUpdates(_0x935b58){return function(_0x2e2edb){try{jsonpatch[_0x9893('0x23')](_0x2e2edb,_0x935b58,!![]);}catch(_0xf894cc){return BPromise['reject'](_0xf894cc);}return _0x2e2edb[_0x9893('0x24')]();};}function saveUpdates(_0x42a057,_0x38f5be){return function(_0x1cfb23){if(_0x1cfb23){return _0x1cfb23['update'](_0x42a057)[_0x9893('0x25')](function(_0x21e7a8){return _0x21e7a8;});}return null;};}function removeEntity(_0x4ff813,_0x43f9b1){return function(_0x590283){if(_0x590283){return _0x590283[_0x9893('0x26')]()[_0x9893('0x25')](function(){_0x4ff813['status'](0xcc)[_0x9893('0x1c')]();});}};}function handleEntityNotFound(_0x5a3861,_0x42ea65){return function(_0x3a9c83){if(!_0x3a9c83){_0x5a3861[_0x9893('0x27')](0x194);}return _0x3a9c83;};}function handleError(_0xe504b3,_0x168049){_0x168049=_0x168049||0x1f4;return function(_0x41f200){logger[_0x9893('0x28')](_0x41f200[_0x9893('0x29')]);if(_0x41f200[_0x9893('0x2a')]){delete _0x41f200[_0x9893('0x2a')];}_0xe504b3[_0x9893('0x1b')](_0x168049)[_0x9893('0x2b')](_0x41f200);};}exports[_0x9893('0x2c')]=function(_0x2c2767,_0x12f4ae){var _0x293a0a={},_0x10d4c8={},_0x3c97ef={'count':0x0,'rows':[]};var _0x3125ab=_[_0x9893('0x2d')](db[_0x9893('0x2e')][_0x9893('0x2f')],function(_0x3dd433){return{'name':_0x3dd433['fieldName'],'type':_0x3dd433[_0x9893('0x30')][_0x9893('0x31')]};});_0x10d4c8[_0x9893('0x32')]=_[_0x9893('0x2d')](_0x3125ab,'name');_0x10d4c8[_0x9893('0x33')]=_['keys'](_0x2c2767['query']);_0x10d4c8[_0x9893('0x34')]=_[_0x9893('0x35')](_0x10d4c8[_0x9893('0x32')],_0x10d4c8[_0x9893('0x33')]);_0x293a0a[_0x9893('0x36')]=_[_0x9893('0x35')](_0x10d4c8['model'],qs[_0x9893('0x37')](_0x2c2767[_0x9893('0x33')][_0x9893('0x37')]));_0x293a0a[_0x9893('0x36')]=_0x293a0a[_0x9893('0x36')]['length']?_0x293a0a['attributes']:_0x10d4c8[_0x9893('0x32')];if(!_0x2c2767[_0x9893('0x33')][_0x9893('0x38')](_0x9893('0x39'))){_0x293a0a[_0x9893('0x1e')]=qs[_0x9893('0x1e')](_0x2c2767[_0x9893('0x33')][_0x9893('0x1e')]);_0x293a0a['offset']=qs[_0x9893('0x21')](_0x2c2767['query'][_0x9893('0x21')]);}_0x293a0a[_0x9893('0x3a')]=qs[_0x9893('0x3b')](_0x2c2767['query'][_0x9893('0x3b')]);_0x293a0a['where']=qs[_0x9893('0x34')](_['pick'](_0x2c2767[_0x9893('0x33')],_0x10d4c8[_0x9893('0x34')]),_0x3125ab);if(_0x2c2767['query']['filter']){_0x293a0a[_0x9893('0x3c')]=_[_0x9893('0x3d')](_0x293a0a[_0x9893('0x3c')],{'$or':_[_0x9893('0x2d')](_0x3125ab,function(_0x1e7357){if(_0x1e7357['type']!==_0x9893('0x3e')){var _0x3f1c5e={};_0x3f1c5e[_0x1e7357[_0x9893('0x2a')]]={'$like':'%'+_0x2c2767['query'][_0x9893('0x3f')]+'%'};return _0x3f1c5e;}})});}_0x293a0a=_[_0x9893('0x3d')]({},_0x293a0a,_0x2c2767['options']);var _0x489fb6={'where':_0x293a0a[_0x9893('0x3c')]};return db[_0x9893('0x2e')]['count'](_0x489fb6)[_0x9893('0x25')](function(_0x1cfa09){_0x3c97ef[_0x9893('0x20')]=_0x1cfa09;if(_0x2c2767[_0x9893('0x33')][_0x9893('0x40')]){_0x293a0a['include']=[{'all':!![]}];}return db[_0x9893('0x2e')][_0x9893('0x41')](_0x293a0a);})['then'](function(_0x481208){_0x3c97ef[_0x9893('0x42')]=_0x481208;return _0x3c97ef;})['then'](respondWithFilteredResult(_0x12f4ae,_0x293a0a))['catch'](handleError(_0x12f4ae,null));};exports['show']=function(_0x2237f5,_0x27fa09){var _0x1000ae={'raw':![],'where':{'id':_0x2237f5[_0x9893('0x43')]['id']}},_0xc2b565={};_0xc2b565['model']=_[_0x9893('0x44')](db[_0x9893('0x2e')]['rawAttributes']);_0xc2b565[_0x9893('0x33')]=_[_0x9893('0x44')](_0x2237f5[_0x9893('0x33')]);_0xc2b565[_0x9893('0x34')]=_[_0x9893('0x35')](_0xc2b565['model'],_0xc2b565[_0x9893('0x33')]);_0x1000ae[_0x9893('0x36')]=_[_0x9893('0x35')](_0xc2b565['model'],qs['fields'](_0x2237f5['query'][_0x9893('0x37')]));_0x1000ae[_0x9893('0x36')]=_0x1000ae[_0x9893('0x36')][_0x9893('0x45')]?_0x1000ae[_0x9893('0x36')]:_0xc2b565[_0x9893('0x32')];if(_0x2237f5[_0x9893('0x33')][_0x9893('0x40')]){_0x1000ae['include']=[{'all':!![]}];}_0x1000ae=_['merge']({},_0x1000ae,_0x2237f5['options']);return db['SalesforceAccount'][_0x9893('0x46')](_0x1000ae)['then'](handleEntityNotFound(_0x27fa09,null))['then'](respondWithResult(_0x27fa09,null))['catch'](handleError(_0x27fa09,null));};exports[_0x9893('0x47')]=function(_0x23a223,_0x589c53){return db[_0x9893('0x2e')]['create'](_0x23a223[_0x9893('0x48')],{})[_0x9893('0x25')](respondWithResult(_0x589c53,0xc9))[_0x9893('0x49')](handleError(_0x589c53,null));};exports[_0x9893('0x4a')]=function(_0x291072,_0x4fc0b9){if(_0x291072[_0x9893('0x48')]['id']){delete _0x291072['body']['id'];}return db[_0x9893('0x2e')][_0x9893('0x46')]({'where':{'id':_0x291072[_0x9893('0x43')]['id']}})[_0x9893('0x25')](handleEntityNotFound(_0x4fc0b9,null))[_0x9893('0x25')](saveUpdates(_0x291072[_0x9893('0x48')],null))[_0x9893('0x25')](respondWithResult(_0x4fc0b9,null))['catch'](handleError(_0x4fc0b9,null));};exports[_0x9893('0x26')]=function(_0x4cba9a,_0x38dc53){return db['SalesforceAccount'][_0x9893('0x46')]({'where':{'id':_0x4cba9a[_0x9893('0x43')]['id']}})['then'](handleEntityNotFound(_0x38dc53,null))['then'](removeEntity(_0x38dc53,null))['catch'](handleError(_0x38dc53,null));};exports[_0x9893('0x4b')]=function(_0xd9721e,_0x27090d,_0x11077f){var _0x501e67={};var _0x43c512={};var _0x223d1;var _0x2686b7;return db['SalesforceAccount'][_0x9893('0x4c')]({'where':{'id':_0xd9721e[_0x9893('0x43')]['id']}})[_0x9893('0x25')](handleEntityNotFound(_0x27090d,null))[_0x9893('0x25')](function(_0x36c337){if(_0x36c337){_0x223d1=_0x36c337;_0x43c512[_0x9893('0x32')]=_[_0x9893('0x44')](db['SalesforceConfiguration']['rawAttributes']);_0x43c512[_0x9893('0x33')]=_[_0x9893('0x44')](_0xd9721e['query']);_0x43c512[_0x9893('0x34')]=_[_0x9893('0x35')](_0x43c512[_0x9893('0x32')],_0x43c512['query']);_0x501e67['attributes']=_[_0x9893('0x35')](_0x43c512[_0x9893('0x32')],qs[_0x9893('0x37')](_0xd9721e['query'][_0x9893('0x37')]));_0x501e67[_0x9893('0x36')]=_0x501e67[_0x9893('0x36')]['length']?_0x501e67['attributes']:_0x43c512[_0x9893('0x32')];_0x501e67[_0x9893('0x3a')]=qs[_0x9893('0x3b')](_0xd9721e[_0x9893('0x33')][_0x9893('0x3b')]);_0x501e67[_0x9893('0x3c')]=qs[_0x9893('0x34')](_[_0x9893('0x4d')](_0xd9721e[_0x9893('0x33')],_0x43c512['filters']));if(_0xd9721e[_0x9893('0x33')]['filter']){_0x501e67[_0x9893('0x3c')]=_[_0x9893('0x3d')](_0x501e67[_0x9893('0x3c')],{'$or':_[_0x9893('0x2d')](_0x501e67['attributes'],function(_0x249a94){var _0x2a76e2={};_0x2a76e2[_0x249a94]={'$like':'%'+_0xd9721e['query']['filter']+'%'};return _0x2a76e2;})});}_0x501e67=_['merge']({},_0x501e67,_0xd9721e[_0x9893('0x4e')]);return _0x223d1[_0x9893('0x4b')](_0x501e67);}})['then'](function(_0x179544){if(_0x179544){_0x2686b7=_0x179544[_0x9893('0x45')];if(!_0xd9721e['query'][_0x9893('0x38')](_0x9893('0x39'))){_0x501e67['limit']=qs[_0x9893('0x1e')](_0xd9721e['query'][_0x9893('0x1e')]);_0x501e67[_0x9893('0x21')]=qs[_0x9893('0x21')](_0xd9721e[_0x9893('0x33')][_0x9893('0x21')]);}return _0x223d1['getConfigurations'](_0x501e67);}})[_0x9893('0x25')](function(_0x1a00bf){if(_0x1a00bf){return _0x1a00bf?{'count':_0x2686b7,'rows':_0x1a00bf}:null;}})['then'](respondWithResult(_0x27090d,null))[_0x9893('0x49')](handleError(_0x27090d,null));};exports['addConfiguration']=function(_0x459029,_0x1bded0,_0x5e4bea){if(_0x459029[_0x9893('0x48')]['id']){delete _0x459029[_0x9893('0x48')]['id'];}return db[_0x9893('0x2e')][_0x9893('0x4c')]({'where':{'id':_0x459029[_0x9893('0x43')]['id']}})[_0x9893('0x25')](handleEntityNotFound(_0x1bded0,null))[_0x9893('0x25')](function(_0x2e816b){if(_0x2e816b){_0x459029[_0x9893('0x48')]['AccountId']=_0x2e816b['id'];_0x459029['body']['Subjects']=integrations[_0x9893('0x4f')](_0x459029['body'][_0x9893('0x50')],_0x459029[_0x9893('0x48')][_0x9893('0x30')]);_0x459029[_0x9893('0x48')]['Descriptions']=integrations[_0x9893('0x51')](_0x459029['body'][_0x9893('0x50')],_0x459029[_0x9893('0x48')][_0x9893('0x30')]);return db[_0x9893('0x52')][_0x9893('0x47')](_0x459029[_0x9893('0x48')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x9893('0x53')],'as':_0x9893('0x54')}]});}return null;})[_0x9893('0x25')](respondWithResult(_0x1bded0,null))[_0x9893('0x49')](handleError(_0x1bded0,null));};exports[_0x9893('0x55')]=function(_0x3fff9e,_0xa42202,_0x2c032c){var _0x2faf96;var _0x5dbb27='';var _0x4a01c3=_0x9893('0x56');return db[_0x9893('0x2e')][_0x9893('0x4c')]({'where':{'id':_0x3fff9e[_0x9893('0x43')]['id']},'attributes':['id',_0x9893('0x57'),'clientId',_0x9893('0x58'),_0x9893('0x59'),_0x9893('0x5a'),_0x9893('0x5b')]})['then'](handleEntityNotFound(_0xa42202,null))[_0x9893('0x25')](function(_0x1a1883){if(_0x1a1883){_0x5dbb27=_0x1a1883['remoteUri'];var _0x498a4e=_0x5dbb27[_0x9893('0x5c')](-0x1);if(_0x498a4e==='/'){_0x5dbb27=_0x5dbb27[_0x9893('0x5d')](0x0,_0x5dbb27[_0x9893('0x5e')](_0x498a4e));}_0x2faf96=new jsforce[(_0x9893('0x5f'))]({'oauth2':{'loginUrl':_0x5dbb27,'clientId':_0x1a1883[_0x9893('0x60')],'clientSecret':_0x1a1883[_0x9893('0x58')]}});return _0x2faf96[_0x9893('0x61')](_0x1a1883[_0x9893('0x59')],_0x1a1883[_0x9893('0x5a')][_0x9893('0x62')](_0x1a1883[_0x9893('0x5b')]));}})['then'](function(_0x4433d5){if(_0x4433d5){if(!_[_0x9893('0x63')](_0x3fff9e[_0x9893('0x33')][_0x9893('0x64')])){_0x4a01c3=_0x3fff9e[_0x9893('0x33')][_0x9893('0x64')];}return _0x2faf96[_0x9893('0x65')](_0x4a01c3)['describe']();}})[_0x9893('0x25')](function(_0xd2e8f6){var _0x25d26f=['OwnerId',_0x9893('0x66'),_0x9893('0x67'),_0x9893('0x68'),_0x9893('0x69'),_0x9893('0x6a')];var _0x43a852=[_0x9893('0x6b'),_0x9893('0x6c'),'picklist',_0x9893('0x6d'),'email',_0x9893('0x6e'),_0x9893('0x6f')];if(_0xd2e8f6){_[_0x9893('0x70')](_0xd2e8f6[_0x9893('0x37')],function(_0x2ededb){return _0x25d26f['includes'](_0x2ededb[_0x9893('0x2a')])||!_0x43a852[_0x9893('0x71')](_0x2ededb[_0x9893('0x30')]);});return{'count':_0xd2e8f6['fields']['length'],'rows':_[_0x9893('0x2d')](_0xd2e8f6['fields'],function(_0x1fd019){return{'id':_0x1fd019[_0x9893('0x2a')],'name':_0x1fd019[_0x9893('0x72')],'custom':_0x1fd019[_0x9893('0x73')],'options':_0x1fd019[_0x9893('0x74')][_0x9893('0x45')]>0x0?_[_0x9893('0x2d')](_0x1fd019[_0x9893('0x74')],function(_0x41de90){return{'name':_0x41de90[_0x9893('0x72')],'value':_0x41de90[_0x9893('0x75')]};}):_0x1fd019[_0x9893('0x30')]=='boolean'?[{'name':_0x9893('0x76'),'value':'true'},{'name':'False','value':_0x9893('0x77')}]:[]};})};}})[_0x9893('0x25')](respondWithResult(_0xa42202,null))[_0x9893('0x49')](function(_0x5d6e3a){var _0x1193ba=_0x3fff9e[_0x9893('0x33')][_0x9893('0x78')]?0x1f4:_0x5d6e3a[_0x9893('0x79')]||0x1f4;logger['error'](_0x9893('0x7a'),_0x9893('0x55'),_0x1193ba,JSON[_0x9893('0x7b')](_0x5d6e3a));delete _0x5d6e3a[_0x9893('0x2a')];if(_0x1193ba===0x191){_0x1193ba=0x190;}_0xa42202[_0x9893('0x1b')](_0x1193ba)[_0x9893('0x2b')](_0x3fff9e['query'][_0x9893('0x78')]?{'message':_0x9893('0x7c'),'statusCode':_0x5d6e3a['statusCode']}:_0x5d6e3a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index c44dfb3..88ae929 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 _0x3d4f=['SalesforceAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x25cd2c,_0x57498e){var _0x1e364c=function(_0x35ac2e){while(--_0x35ac2e){_0x25cd2c['push'](_0x25cd2c['shift']());}};_0x1e364c(++_0x57498e);}(_0x3d4f,0x1bb));var _0xf3d4=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x3d4f[_0x29d623];return _0x242e59;};'use strict';var _=require(_0xf3d4('0x0'));var util=require(_0xf3d4('0x1'));var logger=require(_0xf3d4('0x2'))(_0xf3d4('0x3'));var moment=require(_0xf3d4('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3d4('0x5'));var fs=require('fs');var path=require(_0xf3d4('0x6'));var rimraf=require(_0xf3d4('0x7'));var config=require(_0xf3d4('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0xf3d4('0x9'));module[_0xf3d4('0xa')]=function(_0x2c1afc,_0x53c2ef){return _0x2c1afc[_0xf3d4('0xb')](_0xf3d4('0xc'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e73=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x48cd7c,_0x1682e9){var _0xca7662=function(_0x2b1504){while(--_0x2b1504){_0x48cd7c['push'](_0x48cd7c['shift']());}};_0xca7662(++_0x1682e9);}(_0x6e73,0x110));var _0x36e7=function(_0x202490,_0x28ded8){_0x202490=_0x202490-0x0;var _0x3c49b3=_0x6e73[_0x202490];return _0x3c49b3;};'use strict';var _=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var logger=require(_0x36e7('0x2'))(_0x36e7('0x3'));var moment=require(_0x36e7('0x4'));var BPromise=require(_0x36e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36e7('0x6'));var rimraf=require(_0x36e7('0x7'));var config=require(_0x36e7('0x8'));var attributes=require(_0x36e7('0x9'));var integrations=require(_0x36e7('0xa'));module['exports']=function(_0x4e5059,_0x41cb53){return _0x4e5059[_0x36e7('0xb')](_0x36e7('0xc'),attributes,{'tableName':_0x36e7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index ae5deeb..304ea50 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 _0xc41f=['include','map','model','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','raw','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','catch','findAll','options','where','attributes','limit'];(function(_0x6ea938,_0x361c8a){var _0x30002c=function(_0x1dd7d8){while(--_0x1dd7d8){_0x6ea938['push'](_0x6ea938['shift']());}};_0x30002c(++_0x361c8a);}(_0xc41f,0xb6));var _0xfc41=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0xc41f[_0x255ac0];return _0x437bf1;};'use strict';var _=require('lodash');var util=require(_0xfc41('0x0'));var moment=require('moment');var BPromise=require(_0xfc41('0x1'));var rs=require(_0xfc41('0x2'));var fs=require('fs');var Redis=require(_0xfc41('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc41('0x4'));var logger=require(_0xfc41('0x5'))(_0xfc41('0x6'));var config=require(_0xfc41('0x7'));var jayson=require(_0xfc41('0x8'));var client=jayson[_0xfc41('0x9')][_0xfc41('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14a7f0,_0x5d079c,_0x20e6f2){return new BPromise(function(_0x83ad69,_0x5f3478){return client[_0xfc41('0xb')](_0x14a7f0,_0x20e6f2)[_0xfc41('0xc')](function(_0x5ad7b5){logger[_0xfc41('0xd')](_0xfc41('0xe'),_0x5d079c,'request\x20sent');logger[_0xfc41('0xf')](_0xfc41('0x10'),_0x5d079c,_0xfc41('0x11'),JSON[_0xfc41('0x12')](_0x5ad7b5));if(_0x5ad7b5[_0xfc41('0x13')]){if(_0x5ad7b5['error'][_0xfc41('0x14')]===0x1f4){logger[_0xfc41('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x5d079c,_0x5ad7b5[_0xfc41('0x13')]['message']);return _0x5f3478(_0x5ad7b5['error']['message']);}logger[_0xfc41('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x5d079c,_0x5ad7b5[_0xfc41('0x13')]['message']);return _0x83ad69(_0x5ad7b5['error']['message']);}else{logger[_0xfc41('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x5d079c,_0xfc41('0x11'));_0x83ad69(_0x5ad7b5[_0xfc41('0x15')]['message']);}})[_0xfc41('0x16')](function(_0xbe3613){logger['error'](_0xfc41('0xe'),_0x5d079c,_0xbe3613);_0x5f3478(_0xbe3613);});});}exports['GetSalesforceAccount']=function(_0x10b8f3){var _0x47a1dd=this;return new Promise(function(_0x274ad9,_0x54c841){return db['SalesforceAccount'][_0xfc41('0x17')]({'raw':_0x10b8f3[_0xfc41('0x18')]?_0x10b8f3['options']['raw']===undefined?!![]:![]:!![],'where':_0x10b8f3[_0xfc41('0x18')]?_0x10b8f3[_0xfc41('0x18')][_0xfc41('0x19')]||null:null,'attributes':_0x10b8f3[_0xfc41('0x18')]?_0x10b8f3[_0xfc41('0x18')][_0xfc41('0x1a')]||null:null,'limit':_0x10b8f3[_0xfc41('0x18')]?_0x10b8f3[_0xfc41('0x18')][_0xfc41('0x1b')]||null:null,'include':_0x10b8f3[_0xfc41('0x18')]?_0x10b8f3[_0xfc41('0x18')][_0xfc41('0x1c')]?_[_0xfc41('0x1d')](_0x10b8f3[_0xfc41('0x18')][_0xfc41('0x1c')],function(_0x564dc5){return{'model':db[_0x564dc5[_0xfc41('0x1e')]],'as':_0x564dc5['as'],'attributes':_0x564dc5[_0xfc41('0x1a')],'include':_0x564dc5['include']?_['map'](_0x564dc5[_0xfc41('0x1c')],function(_0x2df0e2){return{'model':db[_0x2df0e2[_0xfc41('0x1e')]],'as':_0x2df0e2['as'],'attributes':_0x2df0e2[_0xfc41('0x1a')],'include':_0x2df0e2[_0xfc41('0x1c')]?_['map'](_0x2df0e2[_0xfc41('0x1c')],function(_0x4523d2){return{'model':db[_0x4523d2['model']],'as':_0x4523d2['as'],'attributes':_0x4523d2[_0xfc41('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfc41('0xc')](function(_0x2af633){logger[_0xfc41('0xd')](_0xfc41('0x1f'),_0x10b8f3);logger['debug'](_0xfc41('0x1f'),_0x10b8f3,JSON['stringify'](_0x2af633));_0x274ad9(_0x2af633);})[_0xfc41('0x16')](function(_0xfb220a){logger[_0xfc41('0x13')](_0xfc41('0x1f'),_0xfb220a['message'],_0x10b8f3);_0x54c841(_0x47a1dd[_0xfc41('0x13')](0x1f4,_0xfb220a['message']));});});};exports[_0xfc41('0x20')]=function(_0x43b075){var _0x3cdc57=this;return new Promise(function(_0x3d37dc,_0x20af3e){return db[_0xfc41('0x21')]['find']({'raw':_0x43b075[_0xfc41('0x18')]?_0x43b075[_0xfc41('0x18')][_0xfc41('0x22')]===undefined?!![]:![]:!![],'where':_0x43b075[_0xfc41('0x18')]?_0x43b075[_0xfc41('0x18')]['where']||null:null,'attributes':_0x43b075[_0xfc41('0x18')]?_0x43b075[_0xfc41('0x18')]['attributes']||null:null,'include':_0x43b075[_0xfc41('0x18')]?_0x43b075[_0xfc41('0x18')][_0xfc41('0x1c')]?_[_0xfc41('0x1d')](_0x43b075['options']['include'],function(_0x458a16){return{'model':db[_0x458a16[_0xfc41('0x1e')]],'as':_0x458a16['as'],'attributes':_0x458a16[_0xfc41('0x1a')],'include':_0x458a16[_0xfc41('0x1c')]?_['map'](_0x458a16['include'],function(_0x2178bc){return{'model':db[_0x2178bc[_0xfc41('0x1e')]],'as':_0x2178bc['as'],'attributes':_0x2178bc['attributes'],'include':_0x2178bc[_0xfc41('0x1c')]?_['map'](_0x2178bc[_0xfc41('0x1c')],function(_0x19333a){return{'model':db[_0x19333a[_0xfc41('0x1e')]],'as':_0x19333a['as'],'attributes':_0x19333a[_0xfc41('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfc41('0xc')](function(_0x419abe){logger[_0xfc41('0xd')](_0xfc41('0x20'),_0x43b075);logger[_0xfc41('0xf')]('ShowSalesforceAccount',_0x43b075,JSON[_0xfc41('0x12')](_0x419abe));_0x3d37dc(_0x419abe);})[_0xfc41('0x16')](function(_0x9ade21){logger[_0xfc41('0x13')](_0xfc41('0x20'),_0x9ade21['message'],_0x43b075);_0x20af3e(_0x3cdc57[_0xfc41('0x13')](0x1f4,_0x9ade21['message']));});});}; \ No newline at end of file +var _0xe27a=['include','map','model','stringify','ShowSalesforceAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','debug','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit'];(function(_0x5d240d,_0x22e0e0){var _0x59701e=function(_0x47df1d){while(--_0x47df1d){_0x5d240d['push'](_0x5d240d['shift']());}};_0x59701e(++_0x22e0e0);}(_0xe27a,0x1e2));var _0xae27=function(_0x46ee51,_0x2a81b0){_0x46ee51=_0x46ee51-0x0;var _0x2c7f1b=_0xe27a[_0x46ee51];return _0x2c7f1b;};'use strict';var _=require(_0xae27('0x0'));var util=require(_0xae27('0x1'));var moment=require('moment');var BPromise=require(_0xae27('0x2'));var rs=require(_0xae27('0x3'));var fs=require('fs');var Redis=require(_0xae27('0x4'));var db=require(_0xae27('0x5'))['db'];var utils=require(_0xae27('0x6'));var logger=require(_0xae27('0x7'))('rpc');var config=require(_0xae27('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xae27('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22bcb1,_0x1ea458,_0x2fd614){return new BPromise(function(_0x4bba54,_0x554965){return client[_0xae27('0xa')](_0x22bcb1,_0x2fd614)[_0xae27('0xb')](function(_0x3d10aa){logger[_0xae27('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x1ea458,_0xae27('0xd'));logger[_0xae27('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x1ea458,_0xae27('0xd'),JSON['stringify'](_0x3d10aa));if(_0x3d10aa['error']){if(_0x3d10aa[_0xae27('0xf')][_0xae27('0x10')]===0x1f4){logger[_0xae27('0xf')](_0xae27('0x11'),_0x1ea458,_0x3d10aa[_0xae27('0xf')][_0xae27('0x12')]);return _0x554965(_0x3d10aa[_0xae27('0xf')]['message']);}logger[_0xae27('0xf')](_0xae27('0x11'),_0x1ea458,_0x3d10aa['error'][_0xae27('0x12')]);return _0x4bba54(_0x3d10aa['error']['message']);}else{logger[_0xae27('0xc')](_0xae27('0x11'),_0x1ea458,_0xae27('0xd'));_0x4bba54(_0x3d10aa[_0xae27('0x13')][_0xae27('0x12')]);}})[_0xae27('0x14')](function(_0x4f71c8){logger[_0xae27('0xf')](_0xae27('0x11'),_0x1ea458,_0x4f71c8);_0x554965(_0x4f71c8);});});}exports[_0xae27('0x15')]=function(_0x4dee1f){var _0x18ca30=this;return new Promise(function(_0x1f04d6,_0x2f1684){return db[_0xae27('0x16')]['findAll']({'raw':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x18')]===undefined?!![]:![]:!![],'where':_0x4dee1f[_0xae27('0x17')]?_0x4dee1f[_0xae27('0x17')][_0xae27('0x19')]||null:null,'attributes':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x1a')]||null:null,'limit':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x1b')]||null:null,'include':_0x4dee1f['options']?_0x4dee1f[_0xae27('0x17')][_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x4dee1f[_0xae27('0x17')][_0xae27('0x1c')],function(_0x2cf928){return{'model':db[_0x2cf928[_0xae27('0x1e')]],'as':_0x2cf928['as'],'attributes':_0x2cf928[_0xae27('0x1a')],'include':_0x2cf928[_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x2cf928[_0xae27('0x1c')],function(_0x561f87){return{'model':db[_0x561f87[_0xae27('0x1e')]],'as':_0x561f87['as'],'attributes':_0x561f87[_0xae27('0x1a')],'include':_0x561f87[_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x561f87[_0xae27('0x1c')],function(_0x4dcaf4){return{'model':db[_0x4dcaf4[_0xae27('0x1e')]],'as':_0x4dcaf4['as'],'attributes':_0x4dcaf4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x444414){logger[_0xae27('0xc')](_0xae27('0x15'),_0x4dee1f);logger[_0xae27('0xe')](_0xae27('0x15'),_0x4dee1f,JSON[_0xae27('0x1f')](_0x444414));_0x1f04d6(_0x444414);})[_0xae27('0x14')](function(_0x5f3bbf){logger[_0xae27('0xf')](_0xae27('0x15'),_0x5f3bbf[_0xae27('0x12')],_0x4dee1f);_0x2f1684(_0x18ca30[_0xae27('0xf')](0x1f4,_0x5f3bbf['message']));});});};exports[_0xae27('0x20')]=function(_0x255967){var _0x1fb88c=this;return new Promise(function(_0x41e07c,_0x34b7b3){return db[_0xae27('0x16')][_0xae27('0x21')]({'raw':_0x255967['options']?_0x255967[_0xae27('0x17')][_0xae27('0x18')]===undefined?!![]:![]:!![],'where':_0x255967[_0xae27('0x17')]?_0x255967[_0xae27('0x17')]['where']||null:null,'attributes':_0x255967['options']?_0x255967['options'][_0xae27('0x1a')]||null:null,'include':_0x255967[_0xae27('0x17')]?_0x255967[_0xae27('0x17')][_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x255967[_0xae27('0x17')]['include'],function(_0x6b35df){return{'model':db[_0x6b35df[_0xae27('0x1e')]],'as':_0x6b35df['as'],'attributes':_0x6b35df[_0xae27('0x1a')],'include':_0x6b35df[_0xae27('0x1c')]?_[_0xae27('0x1d')](_0x6b35df[_0xae27('0x1c')],function(_0x149bd2){return{'model':db[_0x149bd2[_0xae27('0x1e')]],'as':_0x149bd2['as'],'attributes':_0x149bd2[_0xae27('0x1a')],'include':_0x149bd2[_0xae27('0x1c')]?_['map'](_0x149bd2[_0xae27('0x1c')],function(_0x2eaa8c){return{'model':db[_0x2eaa8c['model']],'as':_0x2eaa8c['as'],'attributes':_0x2eaa8c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1210e3){logger['info'](_0xae27('0x20'),_0x255967);logger[_0xae27('0xe')]('ShowSalesforceAccount',_0x255967,JSON[_0xae27('0x1f')](_0x1210e3));_0x41e07c(_0x1210e3);})[_0xae27('0x14')](function(_0x5da733){logger[_0xae27('0xf')]('ShowSalesforceAccount',_0x5da733['message'],_0x255967);_0x34b7b3(_0x1fb88c[_0xae27('0xf')](0x1f4,_0x5da733[_0xae27('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 50dc5d5..977f51b 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x2c9a7d,_0x2c1943){var _0x30404a=function(_0x5b4fc7){while(--_0x5b4fc7){_0x2c9a7d['push'](_0x2c9a7d['shift']());}};_0x30404a(++_0x2c1943);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fa64b,_0x3ff701){_0x3fa64b=_0x3fa64b-0x0;var _0x103e68=_0x2ef3[_0x3fa64b];return _0x103e68;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _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(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x0b0e,0x187));var _0xe0b0=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x0b0e[_0xc8db6b];return _0x12cb81;};'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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4c47a17..9d2a921 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 _0x7adc=['account_contact_lead','account','contact_lead','contact','lead','sequelize','exports','STRING','ENUM','Case'];(function(_0x495123,_0x2bf158){var _0x39e1ee=function(_0x226778){while(--_0x226778){_0x495123['push'](_0x495123['shift']());}};_0x39e1ee(++_0x2bf158);}(_0x7adc,0x13b));var _0xc7ad=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x7adc[_0x5e6cb8];return _0x3faeb3;};'use strict';var Sequelize=require(_0xc7ad('0x0'));module[_0xc7ad('0x1')]={'name':{'type':Sequelize[_0xc7ad('0x2')]},'description':{'type':Sequelize[_0xc7ad('0x2')]},'ticketType':{'type':Sequelize[_0xc7ad('0x3')]('Task',_0xc7ad('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact','lead',_0xc7ad('0x5'),_0xc7ad('0x6')),'defaultValue':_0xc7ad('0x7')},'moduleCreate':{'type':Sequelize[_0xc7ad('0x3')]('nothing',_0xc7ad('0x8'),_0xc7ad('0x9'),'account'),'defaultValue':_0xc7ad('0x9')},'leadId':{'type':Sequelize[_0xc7ad('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xc7ad('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xc7ad('0x2')]}}; \ No newline at end of file +var _0x3fc3=['contact_lead','contact','lead','account_contact_lead','account','nothing','STRING','ENUM','Task','Case'];(function(_0x56be6a,_0x4b3fb9){var _0x273b32=function(_0xbfcc38){while(--_0xbfcc38){_0x56be6a['push'](_0x56be6a['shift']());}};_0x273b32(++_0x4b3fb9);}(_0x3fc3,0x150));var _0x33fc=function(_0x2655e6,_0x37a236){_0x2655e6=_0x2655e6-0x0;var _0x4bbd2c=_0x3fc3[_0x2655e6];return _0x4bbd2c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x33fc('0x0')]},'description':{'type':Sequelize[_0x33fc('0x0')]},'ticketType':{'type':Sequelize[_0x33fc('0x1')](_0x33fc('0x2'),_0x33fc('0x3')),'defaultValue':_0x33fc('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x33fc('0x4'),_0x33fc('0x5'),_0x33fc('0x6'),_0x33fc('0x7'),_0x33fc('0x8')),'defaultValue':_0x33fc('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x33fc('0x9'),_0x33fc('0x5'),'lead','account'),'defaultValue':_0x33fc('0x6')},'leadId':{'type':Sequelize[_0x33fc('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x33fc('0x0')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x33fc('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index ee95e11..9192be7 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 _0xe4b8=['show','params','includeAll','find','create','body','getFields','findOne','SalesforceField','pick','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','reject','update','then','destroy','end','name','send','map','SalesforceConfiguration','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','filter','merge','where','type','options','count','include','findAll','rows','catch'];(function(_0x345d48,_0x34cf80){var _0x5ded67=function(_0x5e5a4c){while(--_0x5e5a4c){_0x345d48['push'](_0x345d48['shift']());}};_0x5ded67(++_0x34cf80);}(_0xe4b8,0x179));var _0x8e4b=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xe4b8[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0x8e4b('0x0'));var rimraf=require(_0x8e4b('0x1'));var zipdir=require(_0x8e4b('0x2'));var jsonpatch=require(_0x8e4b('0x3'));var rp=require(_0x8e4b('0x4'));var moment=require(_0x8e4b('0x5'));var BPromise=require(_0x8e4b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8e4b('0x7'));var sox=require(_0x8e4b('0x8'));var csv=require(_0x8e4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e4b('0xa'));var _=require('lodash');var squel=require(_0x8e4b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e4b('0xc'));var Redis=require('ioredis');var authService=require(_0x8e4b('0xd'));var qs=require(_0x8e4b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e4b('0xf'));var logger=require(_0x8e4b('0x10'))(_0x8e4b('0x11'));var utils=require('../../config/utils');var config=require(_0x8e4b('0x12'));var licenseUtil=require(_0x8e4b('0x13'));var db=require(_0x8e4b('0x14'))['db'];function respondWithStatusCode(_0x13f8a6,_0x30b1c8){_0x30b1c8=_0x30b1c8||0xcc;return function(_0x30d9d1){if(_0x30d9d1){return _0x13f8a6[_0x8e4b('0x15')](_0x30b1c8);}return _0x13f8a6[_0x8e4b('0x16')](_0x30b1c8)['end']();};}function respondWithResult(_0x5f56fb,_0x2e8e71){_0x2e8e71=_0x2e8e71||0xc8;return function(_0x261e76){if(_0x261e76){return _0x5f56fb[_0x8e4b('0x16')](_0x2e8e71)[_0x8e4b('0x17')](_0x261e76);}};}function respondWithFilteredResult(_0x276d96,_0x4d10fd){return function(_0x4b0197){if(_0x4b0197){var _0xfff6b=typeof _0x4d10fd['offset']==='undefined'&&typeof _0x4d10fd[_0x8e4b('0x18')]==='undefined';var _0x38cbf5=_0x4b0197['count'];var _0x444c19=_0xfff6b?0x0:_0x4d10fd[_0x8e4b('0x19')];var _0x4b2458=_0xfff6b?_0x4b0197['count']:_0x4d10fd[_0x8e4b('0x19')]+_0x4d10fd[_0x8e4b('0x18')];var _0x38d4a7;if(_0x4b2458>=_0x38cbf5){_0x4b2458=_0x38cbf5;_0x38d4a7=0xc8;}else{_0x38d4a7=0xce;}_0x276d96[_0x8e4b('0x16')](_0x38d4a7);return _0x276d96[_0x8e4b('0x1a')](_0x8e4b('0x1b'),_0x444c19+'-'+_0x4b2458+'/'+_0x38cbf5)[_0x8e4b('0x17')](_0x4b0197);}return null;};}function patchUpdates(_0x27f816){return function(_0x9eeb68){try{jsonpatch[_0x8e4b('0x1c')](_0x9eeb68,_0x27f816,!![]);}catch(_0x123017){return BPromise[_0x8e4b('0x1d')](_0x123017);}return _0x9eeb68['save']();};}function saveUpdates(_0xa4c5ad,_0x16ff18){return function(_0x5f3043){if(_0x5f3043){return _0x5f3043[_0x8e4b('0x1e')](_0xa4c5ad)[_0x8e4b('0x1f')](function(_0x54b17e){return _0x54b17e;});}return null;};}function removeEntity(_0x2bd4e7,_0x719300){return function(_0x5e8915){if(_0x5e8915){return _0x5e8915[_0x8e4b('0x20')]()[_0x8e4b('0x1f')](function(){_0x2bd4e7['status'](0xcc)[_0x8e4b('0x21')]();});}};}function handleEntityNotFound(_0x2b29a4,_0xbd7008){return function(_0x376202){if(!_0x376202){_0x2b29a4[_0x8e4b('0x15')](0x194);}return _0x376202;};}function handleError(_0x43a92d,_0x535f71){_0x535f71=_0x535f71||0x1f4;return function(_0x395927){logger['error'](_0x395927['stack']);if(_0x395927[_0x8e4b('0x22')]){delete _0x395927[_0x8e4b('0x22')];}_0x43a92d['status'](_0x535f71)[_0x8e4b('0x23')](_0x395927);};}exports['index']=function(_0x6d7fbd,_0x5c5c34){var _0x2fd8da={},_0xe991c2={},_0x1b2759={'count':0x0,'rows':[]};var _0x36d657=_[_0x8e4b('0x24')](db[_0x8e4b('0x25')][_0x8e4b('0x26')],function(_0x3573d8){return{'name':_0x3573d8['fieldName'],'type':_0x3573d8['type'][_0x8e4b('0x27')]};});_0xe991c2[_0x8e4b('0x28')]=_[_0x8e4b('0x24')](_0x36d657,_0x8e4b('0x22'));_0xe991c2[_0x8e4b('0x29')]=_[_0x8e4b('0x2a')](_0x6d7fbd[_0x8e4b('0x29')]);_0xe991c2[_0x8e4b('0x2b')]=_['intersection'](_0xe991c2[_0x8e4b('0x28')],_0xe991c2[_0x8e4b('0x29')]);_0x2fd8da[_0x8e4b('0x2c')]=_[_0x8e4b('0x2d')](_0xe991c2[_0x8e4b('0x28')],qs['fields'](_0x6d7fbd[_0x8e4b('0x29')][_0x8e4b('0x2e')]));_0x2fd8da[_0x8e4b('0x2c')]=_0x2fd8da[_0x8e4b('0x2c')][_0x8e4b('0x2f')]?_0x2fd8da[_0x8e4b('0x2c')]:_0xe991c2[_0x8e4b('0x28')];if(!_0x6d7fbd[_0x8e4b('0x29')]['hasOwnProperty'](_0x8e4b('0x30'))){_0x2fd8da[_0x8e4b('0x18')]=qs[_0x8e4b('0x18')](_0x6d7fbd[_0x8e4b('0x29')][_0x8e4b('0x18')]);_0x2fd8da[_0x8e4b('0x19')]=qs[_0x8e4b('0x19')](_0x6d7fbd[_0x8e4b('0x29')][_0x8e4b('0x19')]);}_0x2fd8da[_0x8e4b('0x31')]=qs[_0x8e4b('0x32')](_0x6d7fbd[_0x8e4b('0x29')][_0x8e4b('0x32')]);_0x2fd8da['where']=qs[_0x8e4b('0x2b')](_['pick'](_0x6d7fbd[_0x8e4b('0x29')],_0xe991c2[_0x8e4b('0x2b')]),_0x36d657);if(_0x6d7fbd['query'][_0x8e4b('0x33')]){_0x2fd8da['where']=_[_0x8e4b('0x34')](_0x2fd8da[_0x8e4b('0x35')],{'$or':_[_0x8e4b('0x24')](_0x36d657,function(_0x15a82f){if(_0x15a82f[_0x8e4b('0x36')]!=='VIRTUAL'){var _0x548c84={};_0x548c84[_0x15a82f[_0x8e4b('0x22')]]={'$like':'%'+_0x6d7fbd[_0x8e4b('0x29')][_0x8e4b('0x33')]+'%'};return _0x548c84;}})});}_0x2fd8da=_[_0x8e4b('0x34')]({},_0x2fd8da,_0x6d7fbd[_0x8e4b('0x37')]);var _0x2f289a={'where':_0x2fd8da[_0x8e4b('0x35')]};return db['SalesforceConfiguration'][_0x8e4b('0x38')](_0x2f289a)['then'](function(_0x98159c){_0x1b2759['count']=_0x98159c;if(_0x6d7fbd[_0x8e4b('0x29')]['includeAll']){_0x2fd8da[_0x8e4b('0x39')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x8e4b('0x3a')](_0x2fd8da);})[_0x8e4b('0x1f')](function(_0x3995e1){_0x1b2759[_0x8e4b('0x3b')]=_0x3995e1;return _0x1b2759;})['then'](respondWithFilteredResult(_0x5c5c34,_0x2fd8da))[_0x8e4b('0x3c')](handleError(_0x5c5c34,null));};exports[_0x8e4b('0x3d')]=function(_0x2e2096,_0x38574d){var _0x27fafa={'raw':![],'where':{'id':_0x2e2096[_0x8e4b('0x3e')]['id']}},_0x2a850f={};_0x2a850f[_0x8e4b('0x28')]=_[_0x8e4b('0x2a')](db[_0x8e4b('0x25')][_0x8e4b('0x26')]);_0x2a850f['query']=_[_0x8e4b('0x2a')](_0x2e2096[_0x8e4b('0x29')]);_0x2a850f[_0x8e4b('0x2b')]=_[_0x8e4b('0x2d')](_0x2a850f[_0x8e4b('0x28')],_0x2a850f[_0x8e4b('0x29')]);_0x27fafa[_0x8e4b('0x2c')]=_['intersection'](_0x2a850f[_0x8e4b('0x28')],qs[_0x8e4b('0x2e')](_0x2e2096[_0x8e4b('0x29')][_0x8e4b('0x2e')]));_0x27fafa[_0x8e4b('0x2c')]=_0x27fafa[_0x8e4b('0x2c')][_0x8e4b('0x2f')]?_0x27fafa[_0x8e4b('0x2c')]:_0x2a850f[_0x8e4b('0x28')];if(_0x2e2096[_0x8e4b('0x29')][_0x8e4b('0x3f')]){_0x27fafa[_0x8e4b('0x39')]=[{'all':!![]}];}_0x27fafa=_[_0x8e4b('0x34')]({},_0x27fafa,_0x2e2096[_0x8e4b('0x37')]);return db[_0x8e4b('0x25')][_0x8e4b('0x40')](_0x27fafa)[_0x8e4b('0x1f')](handleEntityNotFound(_0x38574d,null))[_0x8e4b('0x1f')](respondWithResult(_0x38574d,null))[_0x8e4b('0x3c')](handleError(_0x38574d,null));};exports[_0x8e4b('0x41')]=function(_0x3fe596,_0x460653){return db['SalesforceConfiguration'][_0x8e4b('0x41')](_0x3fe596[_0x8e4b('0x42')],{})[_0x8e4b('0x1f')](respondWithResult(_0x460653,0xc9))[_0x8e4b('0x3c')](handleError(_0x460653,null));};exports[_0x8e4b('0x1e')]=function(_0x31bac2,_0x3b7447){if(_0x31bac2[_0x8e4b('0x42')]['id']){delete _0x31bac2[_0x8e4b('0x42')]['id'];}return db[_0x8e4b('0x25')][_0x8e4b('0x40')]({'where':{'id':_0x31bac2[_0x8e4b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3b7447,null))[_0x8e4b('0x1f')](saveUpdates(_0x31bac2[_0x8e4b('0x42')],null))[_0x8e4b('0x1f')](respondWithResult(_0x3b7447,null))[_0x8e4b('0x3c')](handleError(_0x3b7447,null));};exports['destroy']=function(_0x28bf23,_0x89059a){return db[_0x8e4b('0x25')]['find']({'where':{'id':_0x28bf23[_0x8e4b('0x3e')]['id']}})[_0x8e4b('0x1f')](handleEntityNotFound(_0x89059a,null))[_0x8e4b('0x1f')](removeEntity(_0x89059a,null))[_0x8e4b('0x3c')](handleError(_0x89059a,null));};exports[_0x8e4b('0x43')]=function(_0x25194b,_0x20aa6a,_0x5eea7c){var _0x2e35a8={};var _0x17da38={};var _0x3e694c;var _0x22a3f8;return db[_0x8e4b('0x25')][_0x8e4b('0x44')]({'where':{'id':_0x25194b[_0x8e4b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x20aa6a,null))[_0x8e4b('0x1f')](function(_0x3e3e37){if(_0x3e3e37){_0x3e694c=_0x3e3e37;_0x17da38[_0x8e4b('0x28')]=_[_0x8e4b('0x2a')](db[_0x8e4b('0x45')][_0x8e4b('0x26')]);_0x17da38['query']=_['keys'](_0x25194b['query']);_0x17da38['filters']=_[_0x8e4b('0x2d')](_0x17da38[_0x8e4b('0x28')],_0x17da38[_0x8e4b('0x29')]);_0x2e35a8[_0x8e4b('0x2c')]=_['intersection'](_0x17da38['model'],qs[_0x8e4b('0x2e')](_0x25194b[_0x8e4b('0x29')][_0x8e4b('0x2e')]));_0x2e35a8[_0x8e4b('0x2c')]=_0x2e35a8[_0x8e4b('0x2c')]['length']?_0x2e35a8[_0x8e4b('0x2c')]:_0x17da38['model'];_0x2e35a8['order']=qs['sort'](_0x25194b['query'][_0x8e4b('0x32')]);_0x2e35a8[_0x8e4b('0x35')]=qs[_0x8e4b('0x2b')](_[_0x8e4b('0x46')](_0x25194b[_0x8e4b('0x29')],_0x17da38['filters']));if(_0x25194b[_0x8e4b('0x29')]['filter']){_0x2e35a8[_0x8e4b('0x35')]=_[_0x8e4b('0x34')](_0x2e35a8[_0x8e4b('0x35')],{'$or':_[_0x8e4b('0x24')](_0x2e35a8['attributes'],function(_0x523ec1){var _0x3ded9a={};_0x3ded9a[_0x523ec1]={'$like':'%'+_0x25194b['query'][_0x8e4b('0x33')]+'%'};return _0x3ded9a;})});}_0x2e35a8=_[_0x8e4b('0x34')]({},_0x2e35a8,_0x25194b['options']);return _0x3e694c[_0x8e4b('0x43')](_0x2e35a8);}})[_0x8e4b('0x1f')](function(_0x4393b3){if(_0x4393b3){_0x22a3f8=_0x4393b3[_0x8e4b('0x2f')];if(!_0x25194b[_0x8e4b('0x29')][_0x8e4b('0x47')](_0x8e4b('0x30'))){_0x2e35a8[_0x8e4b('0x18')]=qs[_0x8e4b('0x18')](_0x25194b[_0x8e4b('0x29')][_0x8e4b('0x18')]);_0x2e35a8[_0x8e4b('0x19')]=qs['offset'](_0x25194b[_0x8e4b('0x29')]['offset']);}return _0x3e694c['getFields'](_0x2e35a8);}})[_0x8e4b('0x1f')](function(_0x5f0fa8){if(_0x5f0fa8){return _0x5f0fa8?{'count':_0x22a3f8,'rows':_0x5f0fa8}:null;}})['then'](respondWithResult(_0x20aa6a,null))[_0x8e4b('0x3c')](handleError(_0x20aa6a,null));};exports['getSubjects']=function(_0x43ae0d,_0x3cb072,_0x16e0f9){var _0x30bee6={};var _0x42b7f9={};var _0x59b979;var _0x4c67b1;return db[_0x8e4b('0x25')][_0x8e4b('0x44')]({'where':{'id':_0x43ae0d['params']['id']}})[_0x8e4b('0x1f')](handleEntityNotFound(_0x3cb072,null))[_0x8e4b('0x1f')](function(_0x25154b){if(_0x25154b){_0x59b979=_0x25154b;_0x42b7f9['model']=_[_0x8e4b('0x2a')](db[_0x8e4b('0x45')]['rawAttributes']);_0x42b7f9[_0x8e4b('0x29')]=_[_0x8e4b('0x2a')](_0x43ae0d[_0x8e4b('0x29')]);_0x42b7f9[_0x8e4b('0x2b')]=_[_0x8e4b('0x2d')](_0x42b7f9['model'],_0x42b7f9['query']);_0x30bee6[_0x8e4b('0x2c')]=_['intersection'](_0x42b7f9[_0x8e4b('0x28')],qs['fields'](_0x43ae0d[_0x8e4b('0x29')]['fields']));_0x30bee6[_0x8e4b('0x2c')]=_0x30bee6[_0x8e4b('0x2c')][_0x8e4b('0x2f')]?_0x30bee6['attributes']:_0x42b7f9[_0x8e4b('0x28')];_0x30bee6[_0x8e4b('0x31')]=qs[_0x8e4b('0x32')](_0x43ae0d[_0x8e4b('0x29')][_0x8e4b('0x32')]);_0x30bee6[_0x8e4b('0x35')]=qs[_0x8e4b('0x2b')](_[_0x8e4b('0x46')](_0x43ae0d[_0x8e4b('0x29')],_0x42b7f9[_0x8e4b('0x2b')]));if(_0x43ae0d[_0x8e4b('0x29')][_0x8e4b('0x33')]){_0x30bee6['where']=_['merge'](_0x30bee6['where'],{'$or':_[_0x8e4b('0x24')](_0x30bee6[_0x8e4b('0x2c')],function(_0x32c515){var _0x2f421d={};_0x2f421d[_0x32c515]={'$like':'%'+_0x43ae0d[_0x8e4b('0x29')][_0x8e4b('0x33')]+'%'};return _0x2f421d;})});}_0x30bee6=_[_0x8e4b('0x34')]({},_0x30bee6,_0x43ae0d[_0x8e4b('0x37')]);return _0x59b979['getSubjects'](_0x30bee6);}})[_0x8e4b('0x1f')](function(_0x3d7ed0){if(_0x3d7ed0){_0x4c67b1=_0x3d7ed0['length'];if(!_0x43ae0d['query']['hasOwnProperty'](_0x8e4b('0x30'))){_0x30bee6['limit']=qs['limit'](_0x43ae0d['query'][_0x8e4b('0x18')]);_0x30bee6['offset']=qs['offset'](_0x43ae0d[_0x8e4b('0x29')][_0x8e4b('0x19')]);}return _0x59b979['getSubjects'](_0x30bee6);}})[_0x8e4b('0x1f')](function(_0x2c9158){if(_0x2c9158){return _0x2c9158?{'count':_0x4c67b1,'rows':_0x2c9158}:null;}})[_0x8e4b('0x1f')](respondWithResult(_0x3cb072,null))[_0x8e4b('0x3c')](handleError(_0x3cb072,null));};exports[_0x8e4b('0x48')]=function(_0x3a0915,_0x4c897d,_0x3ed09e){var _0x58d25b={};var _0x32ae39={};var _0x245cb0;var _0x22b086;return db[_0x8e4b('0x25')]['findOne']({'where':{'id':_0x3a0915[_0x8e4b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4c897d,null))['then'](function(_0x3e9e45){if(_0x3e9e45){_0x245cb0=_0x3e9e45;_0x32ae39[_0x8e4b('0x28')]=_[_0x8e4b('0x2a')](db[_0x8e4b('0x45')][_0x8e4b('0x26')]);_0x32ae39[_0x8e4b('0x29')]=_[_0x8e4b('0x2a')](_0x3a0915[_0x8e4b('0x29')]);_0x32ae39[_0x8e4b('0x2b')]=_['intersection'](_0x32ae39[_0x8e4b('0x28')],_0x32ae39[_0x8e4b('0x29')]);_0x58d25b['attributes']=_[_0x8e4b('0x2d')](_0x32ae39[_0x8e4b('0x28')],qs['fields'](_0x3a0915['query'][_0x8e4b('0x2e')]));_0x58d25b[_0x8e4b('0x2c')]=_0x58d25b[_0x8e4b('0x2c')][_0x8e4b('0x2f')]?_0x58d25b[_0x8e4b('0x2c')]:_0x32ae39[_0x8e4b('0x28')];_0x58d25b[_0x8e4b('0x31')]=qs['sort'](_0x3a0915[_0x8e4b('0x29')][_0x8e4b('0x32')]);_0x58d25b[_0x8e4b('0x35')]=qs[_0x8e4b('0x2b')](_[_0x8e4b('0x46')](_0x3a0915['query'],_0x32ae39[_0x8e4b('0x2b')]));if(_0x3a0915[_0x8e4b('0x29')]['filter']){_0x58d25b[_0x8e4b('0x35')]=_[_0x8e4b('0x34')](_0x58d25b[_0x8e4b('0x35')],{'$or':_['map'](_0x58d25b[_0x8e4b('0x2c')],function(_0x3d4e79){var _0x26fc6e={};_0x26fc6e[_0x3d4e79]={'$like':'%'+_0x3a0915[_0x8e4b('0x29')][_0x8e4b('0x33')]+'%'};return _0x26fc6e;})});}_0x58d25b=_[_0x8e4b('0x34')]({},_0x58d25b,_0x3a0915['options']);return _0x245cb0['getDescriptions'](_0x58d25b);}})[_0x8e4b('0x1f')](function(_0x14c41e){if(_0x14c41e){_0x22b086=_0x14c41e[_0x8e4b('0x2f')];if(!_0x3a0915[_0x8e4b('0x29')]['hasOwnProperty'](_0x8e4b('0x30'))){_0x58d25b['limit']=qs[_0x8e4b('0x18')](_0x3a0915[_0x8e4b('0x29')][_0x8e4b('0x18')]);_0x58d25b['offset']=qs[_0x8e4b('0x19')](_0x3a0915[_0x8e4b('0x29')][_0x8e4b('0x19')]);}return _0x245cb0[_0x8e4b('0x48')](_0x58d25b);}})[_0x8e4b('0x1f')](function(_0x5b4fa9){if(_0x5b4fa9){return _0x5b4fa9?{'count':_0x22b086,'rows':_0x5b4fa9}:null;}})['then'](respondWithResult(_0x4c897d,null))['catch'](handleError(_0x4c897d,null));}; \ No newline at end of file +var _0x5139=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','SalesforceConfiguration','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','show','rawAttributes','includeAll','find','create','body','catch','destroy','params','SalesforceField','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5c956b,_0xa87d11){var _0xaff46a=function(_0x463d89){while(--_0x463d89){_0x5c956b['push'](_0x5c956b['shift']());}};_0xaff46a(++_0xa87d11);}(_0x5139,0x8c));var _0x9513=function(_0x4a5182,_0x135866){_0x4a5182=_0x4a5182-0x0;var _0x5c1ae5=_0x5139[_0x4a5182];return _0x5c1ae5;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require(_0x9513('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9513('0x2'));var rp=require(_0x9513('0x3'));var moment=require(_0x9513('0x4'));var BPromise=require(_0x9513('0x5'));var Mustache=require(_0x9513('0x6'));var util=require(_0x9513('0x7'));var path=require(_0x9513('0x8'));var sox=require('sox');var csv=require(_0x9513('0x9'));var ejs=require(_0x9513('0xa'));var fs=require('fs');var fs_extra=require(_0x9513('0xb'));var _=require(_0x9513('0xc'));var squel=require('squel');var crypto=require(_0x9513('0xd'));var jsforce=require(_0x9513('0xe'));var deskjs=require(_0x9513('0xf'));var toCsv=require(_0x9513('0x9'));var querystring=require(_0x9513('0x10'));var Papa=require(_0x9513('0x11'));var Redis=require(_0x9513('0x12'));var authService=require(_0x9513('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9513('0x14'));var hardwareService=require(_0x9513('0x15'));var logger=require(_0x9513('0x16'))(_0x9513('0x17'));var utils=require(_0x9513('0x18'));var config=require(_0x9513('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9513('0x1a'))['db'];function respondWithStatusCode(_0x892d5a,_0x2ffb1c){_0x2ffb1c=_0x2ffb1c||0xcc;return function(_0x56407e){if(_0x56407e){return _0x892d5a['sendStatus'](_0x2ffb1c);}return _0x892d5a['status'](_0x2ffb1c)[_0x9513('0x1b')]();};}function respondWithResult(_0x3616ac,_0x2dba56){_0x2dba56=_0x2dba56||0xc8;return function(_0xbb1d3c){if(_0xbb1d3c){return _0x3616ac[_0x9513('0x1c')](_0x2dba56)[_0x9513('0x1d')](_0xbb1d3c);}};}function respondWithFilteredResult(_0x50c21a,_0x1a6589){return function(_0x2c9670){if(_0x2c9670){var _0x2e4ca4=typeof _0x1a6589[_0x9513('0x1e')]==='undefined'&&typeof _0x1a6589['limit']===_0x9513('0x1f');var _0x535a41=_0x2c9670[_0x9513('0x20')];var _0x2e4e36=_0x2e4ca4?0x0:_0x1a6589[_0x9513('0x1e')];var _0x3bca3a=_0x2e4ca4?_0x2c9670['count']:_0x1a6589['offset']+_0x1a6589[_0x9513('0x21')];var _0x418b4d;if(_0x3bca3a>=_0x535a41){_0x3bca3a=_0x535a41;_0x418b4d=0xc8;}else{_0x418b4d=0xce;}_0x50c21a[_0x9513('0x1c')](_0x418b4d);return _0x50c21a[_0x9513('0x22')](_0x9513('0x23'),_0x2e4e36+'-'+_0x3bca3a+'/'+_0x535a41)[_0x9513('0x1d')](_0x2c9670);}return null;};}function patchUpdates(_0x14c998){return function(_0x16d946){try{jsonpatch[_0x9513('0x24')](_0x16d946,_0x14c998,!![]);}catch(_0x27426e){return BPromise[_0x9513('0x25')](_0x27426e);}return _0x16d946[_0x9513('0x26')]();};}function saveUpdates(_0x2510f8,_0x33b2df){return function(_0x1918d0){if(_0x1918d0){return _0x1918d0[_0x9513('0x27')](_0x2510f8)[_0x9513('0x28')](function(_0x414fcb){return _0x414fcb;});}return null;};}function removeEntity(_0x4f1570,_0x39adcc){return function(_0x4b8503){if(_0x4b8503){return _0x4b8503['destroy']()[_0x9513('0x28')](function(){_0x4f1570['status'](0xcc)[_0x9513('0x1b')]();});}};}function handleEntityNotFound(_0x2f64c2,_0x14b598){return function(_0x20a5fd){if(!_0x20a5fd){_0x2f64c2[_0x9513('0x29')](0x194);}return _0x20a5fd;};}function handleError(_0x589213,_0x5f37ef){_0x5f37ef=_0x5f37ef||0x1f4;return function(_0x21fe18){logger[_0x9513('0x2a')](_0x21fe18['stack']);if(_0x21fe18[_0x9513('0x2b')]){delete _0x21fe18['name'];}_0x589213[_0x9513('0x1c')](_0x5f37ef)[_0x9513('0x2c')](_0x21fe18);};}exports[_0x9513('0x2d')]=function(_0x41c2f3,_0x3ec7dc){var _0x40d6d0={},_0x152587={},_0x53f769={'count':0x0,'rows':[]};var _0x1d6c48=_['map'](db[_0x9513('0x2e')]['rawAttributes'],function(_0x58d93b){return{'name':_0x58d93b['fieldName'],'type':_0x58d93b[_0x9513('0x2f')]['key']};});_0x152587[_0x9513('0x30')]=_[_0x9513('0x31')](_0x1d6c48,_0x9513('0x2b'));_0x152587[_0x9513('0x32')]=_[_0x9513('0x33')](_0x41c2f3[_0x9513('0x32')]);_0x152587[_0x9513('0x34')]=_[_0x9513('0x35')](_0x152587[_0x9513('0x30')],_0x152587['query']);_0x40d6d0['attributes']=_[_0x9513('0x35')](_0x152587[_0x9513('0x30')],qs[_0x9513('0x36')](_0x41c2f3[_0x9513('0x32')][_0x9513('0x36')]));_0x40d6d0[_0x9513('0x37')]=_0x40d6d0[_0x9513('0x37')][_0x9513('0x38')]?_0x40d6d0[_0x9513('0x37')]:_0x152587[_0x9513('0x30')];if(!_0x41c2f3[_0x9513('0x32')][_0x9513('0x39')](_0x9513('0x3a'))){_0x40d6d0[_0x9513('0x21')]=qs['limit'](_0x41c2f3[_0x9513('0x32')][_0x9513('0x21')]);_0x40d6d0[_0x9513('0x1e')]=qs[_0x9513('0x1e')](_0x41c2f3['query']['offset']);}_0x40d6d0[_0x9513('0x3b')]=qs[_0x9513('0x3c')](_0x41c2f3[_0x9513('0x32')][_0x9513('0x3c')]);_0x40d6d0['where']=qs[_0x9513('0x34')](_[_0x9513('0x3d')](_0x41c2f3[_0x9513('0x32')],_0x152587[_0x9513('0x34')]),_0x1d6c48);if(_0x41c2f3[_0x9513('0x32')][_0x9513('0x3e')]){_0x40d6d0['where']=_[_0x9513('0x3f')](_0x40d6d0[_0x9513('0x40')],{'$or':_['map'](_0x1d6c48,function(_0x47eef6){if(_0x47eef6[_0x9513('0x2f')]!==_0x9513('0x41')){var _0x549e0f={};_0x549e0f[_0x47eef6['name']]={'$like':'%'+_0x41c2f3['query'][_0x9513('0x3e')]+'%'};return _0x549e0f;}})});}_0x40d6d0=_[_0x9513('0x3f')]({},_0x40d6d0,_0x41c2f3[_0x9513('0x42')]);var _0x6a74d3={'where':_0x40d6d0[_0x9513('0x40')]};return db['SalesforceConfiguration']['count'](_0x6a74d3)['then'](function(_0x189751){_0x53f769[_0x9513('0x20')]=_0x189751;if(_0x41c2f3[_0x9513('0x32')]['includeAll']){_0x40d6d0['include']=[{'all':!![]}];}return db[_0x9513('0x2e')]['findAll'](_0x40d6d0);})['then'](function(_0x3d7ea7){_0x53f769['rows']=_0x3d7ea7;return _0x53f769;})[_0x9513('0x28')](respondWithFilteredResult(_0x3ec7dc,_0x40d6d0))['catch'](handleError(_0x3ec7dc,null));};exports[_0x9513('0x43')]=function(_0x185fd1,_0x2517e3){var _0x3ed689={'raw':![],'where':{'id':_0x185fd1['params']['id']}},_0x178757={};_0x178757[_0x9513('0x30')]=_[_0x9513('0x33')](db[_0x9513('0x2e')][_0x9513('0x44')]);_0x178757[_0x9513('0x32')]=_['keys'](_0x185fd1['query']);_0x178757['filters']=_[_0x9513('0x35')](_0x178757[_0x9513('0x30')],_0x178757[_0x9513('0x32')]);_0x3ed689[_0x9513('0x37')]=_[_0x9513('0x35')](_0x178757[_0x9513('0x30')],qs[_0x9513('0x36')](_0x185fd1[_0x9513('0x32')]['fields']));_0x3ed689['attributes']=_0x3ed689[_0x9513('0x37')][_0x9513('0x38')]?_0x3ed689[_0x9513('0x37')]:_0x178757['model'];if(_0x185fd1['query'][_0x9513('0x45')]){_0x3ed689['include']=[{'all':!![]}];}_0x3ed689=_['merge']({},_0x3ed689,_0x185fd1[_0x9513('0x42')]);return db[_0x9513('0x2e')][_0x9513('0x46')](_0x3ed689)[_0x9513('0x28')](handleEntityNotFound(_0x2517e3,null))['then'](respondWithResult(_0x2517e3,null))['catch'](handleError(_0x2517e3,null));};exports[_0x9513('0x47')]=function(_0x2f2bbb,_0x1e961b){return db['SalesforceConfiguration'][_0x9513('0x47')](_0x2f2bbb[_0x9513('0x48')],{})[_0x9513('0x28')](respondWithResult(_0x1e961b,0xc9))[_0x9513('0x49')](handleError(_0x1e961b,null));};exports[_0x9513('0x27')]=function(_0x1ee3a7,_0x49f108){if(_0x1ee3a7[_0x9513('0x48')]['id']){delete _0x1ee3a7[_0x9513('0x48')]['id'];}return db[_0x9513('0x2e')]['find']({'where':{'id':_0x1ee3a7['params']['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x49f108,null))['then'](saveUpdates(_0x1ee3a7[_0x9513('0x48')],null))[_0x9513('0x28')](respondWithResult(_0x49f108,null))[_0x9513('0x49')](handleError(_0x49f108,null));};exports[_0x9513('0x4a')]=function(_0x394aff,_0x4b3fdb){return db[_0x9513('0x2e')][_0x9513('0x46')]({'where':{'id':_0x394aff[_0x9513('0x4b')]['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x4b3fdb,null))[_0x9513('0x28')](removeEntity(_0x4b3fdb,null))[_0x9513('0x49')](handleError(_0x4b3fdb,null));};exports['getFields']=function(_0x1b3f4b,_0x755fce,_0x476566){var _0x2766f2={};var _0x4ddc0f={};var _0x1dc8da;var _0x38e75e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1b3f4b[_0x9513('0x4b')]['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x755fce,null))['then'](function(_0x28fdd8){if(_0x28fdd8){_0x1dc8da=_0x28fdd8;_0x4ddc0f[_0x9513('0x30')]=_[_0x9513('0x33')](db[_0x9513('0x4c')][_0x9513('0x44')]);_0x4ddc0f[_0x9513('0x32')]=_[_0x9513('0x33')](_0x1b3f4b[_0x9513('0x32')]);_0x4ddc0f[_0x9513('0x34')]=_['intersection'](_0x4ddc0f[_0x9513('0x30')],_0x4ddc0f[_0x9513('0x32')]);_0x2766f2[_0x9513('0x37')]=_[_0x9513('0x35')](_0x4ddc0f[_0x9513('0x30')],qs[_0x9513('0x36')](_0x1b3f4b[_0x9513('0x32')][_0x9513('0x36')]));_0x2766f2[_0x9513('0x37')]=_0x2766f2['attributes'][_0x9513('0x38')]?_0x2766f2[_0x9513('0x37')]:_0x4ddc0f['model'];_0x2766f2[_0x9513('0x3b')]=qs[_0x9513('0x3c')](_0x1b3f4b[_0x9513('0x32')][_0x9513('0x3c')]);_0x2766f2[_0x9513('0x40')]=qs[_0x9513('0x34')](_[_0x9513('0x3d')](_0x1b3f4b[_0x9513('0x32')],_0x4ddc0f[_0x9513('0x34')]));if(_0x1b3f4b[_0x9513('0x32')]['filter']){_0x2766f2[_0x9513('0x40')]=_['merge'](_0x2766f2[_0x9513('0x40')],{'$or':_[_0x9513('0x31')](_0x2766f2[_0x9513('0x37')],function(_0x4a5ba8){var _0x48a74a={};_0x48a74a[_0x4a5ba8]={'$like':'%'+_0x1b3f4b[_0x9513('0x32')][_0x9513('0x3e')]+'%'};return _0x48a74a;})});}_0x2766f2=_[_0x9513('0x3f')]({},_0x2766f2,_0x1b3f4b[_0x9513('0x42')]);return _0x1dc8da[_0x9513('0x4d')](_0x2766f2);}})[_0x9513('0x28')](function(_0x303845){if(_0x303845){_0x38e75e=_0x303845[_0x9513('0x38')];if(!_0x1b3f4b[_0x9513('0x32')]['hasOwnProperty'](_0x9513('0x3a'))){_0x2766f2[_0x9513('0x21')]=qs[_0x9513('0x21')](_0x1b3f4b['query'][_0x9513('0x21')]);_0x2766f2[_0x9513('0x1e')]=qs[_0x9513('0x1e')](_0x1b3f4b['query'][_0x9513('0x1e')]);}return _0x1dc8da['getFields'](_0x2766f2);}})[_0x9513('0x28')](function(_0x453738){if(_0x453738){return _0x453738?{'count':_0x38e75e,'rows':_0x453738}:null;}})[_0x9513('0x28')](respondWithResult(_0x755fce,null))[_0x9513('0x49')](handleError(_0x755fce,null));};exports[_0x9513('0x4e')]=function(_0x28d2b3,_0x596248,_0x44240a){var _0x13e540={};var _0x27cb70={};var _0x43b19e;var _0x5acfb4;return db[_0x9513('0x2e')][_0x9513('0x4f')]({'where':{'id':_0x28d2b3['params']['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x596248,null))[_0x9513('0x28')](function(_0xaed8fe){if(_0xaed8fe){_0x43b19e=_0xaed8fe;_0x27cb70[_0x9513('0x30')]=_['keys'](db[_0x9513('0x4c')][_0x9513('0x44')]);_0x27cb70[_0x9513('0x32')]=_[_0x9513('0x33')](_0x28d2b3[_0x9513('0x32')]);_0x27cb70['filters']=_['intersection'](_0x27cb70[_0x9513('0x30')],_0x27cb70[_0x9513('0x32')]);_0x13e540[_0x9513('0x37')]=_[_0x9513('0x35')](_0x27cb70[_0x9513('0x30')],qs[_0x9513('0x36')](_0x28d2b3[_0x9513('0x32')][_0x9513('0x36')]));_0x13e540[_0x9513('0x37')]=_0x13e540[_0x9513('0x37')]['length']?_0x13e540[_0x9513('0x37')]:_0x27cb70[_0x9513('0x30')];_0x13e540[_0x9513('0x3b')]=qs[_0x9513('0x3c')](_0x28d2b3['query'][_0x9513('0x3c')]);_0x13e540[_0x9513('0x40')]=qs[_0x9513('0x34')](_['pick'](_0x28d2b3[_0x9513('0x32')],_0x27cb70[_0x9513('0x34')]));if(_0x28d2b3['query'][_0x9513('0x3e')]){_0x13e540['where']=_[_0x9513('0x3f')](_0x13e540['where'],{'$or':_['map'](_0x13e540[_0x9513('0x37')],function(_0x45e7ed){var _0x2128bf={};_0x2128bf[_0x45e7ed]={'$like':'%'+_0x28d2b3[_0x9513('0x32')]['filter']+'%'};return _0x2128bf;})});}_0x13e540=_[_0x9513('0x3f')]({},_0x13e540,_0x28d2b3[_0x9513('0x42')]);return _0x43b19e[_0x9513('0x4e')](_0x13e540);}})[_0x9513('0x28')](function(_0x39b5c9){if(_0x39b5c9){_0x5acfb4=_0x39b5c9[_0x9513('0x38')];if(!_0x28d2b3[_0x9513('0x32')][_0x9513('0x39')](_0x9513('0x3a'))){_0x13e540[_0x9513('0x21')]=qs[_0x9513('0x21')](_0x28d2b3['query']['limit']);_0x13e540[_0x9513('0x1e')]=qs['offset'](_0x28d2b3[_0x9513('0x32')]['offset']);}return _0x43b19e[_0x9513('0x4e')](_0x13e540);}})[_0x9513('0x28')](function(_0x4bfe16){if(_0x4bfe16){return _0x4bfe16?{'count':_0x5acfb4,'rows':_0x4bfe16}:null;}})[_0x9513('0x28')](respondWithResult(_0x596248,null))['catch'](handleError(_0x596248,null));};exports['getDescriptions']=function(_0x49b439,_0x2a66df,_0x5e3f69){var _0x405a3e={};var _0x1ded5f={};var _0x2a6c6b;var _0x9d7031;return db['SalesforceConfiguration'][_0x9513('0x4f')]({'where':{'id':_0x49b439[_0x9513('0x4b')]['id']}})[_0x9513('0x28')](handleEntityNotFound(_0x2a66df,null))[_0x9513('0x28')](function(_0x251199){if(_0x251199){_0x2a6c6b=_0x251199;_0x1ded5f['model']=_[_0x9513('0x33')](db['SalesforceField']['rawAttributes']);_0x1ded5f['query']=_[_0x9513('0x33')](_0x49b439[_0x9513('0x32')]);_0x1ded5f[_0x9513('0x34')]=_['intersection'](_0x1ded5f[_0x9513('0x30')],_0x1ded5f[_0x9513('0x32')]);_0x405a3e['attributes']=_[_0x9513('0x35')](_0x1ded5f[_0x9513('0x30')],qs[_0x9513('0x36')](_0x49b439[_0x9513('0x32')]['fields']));_0x405a3e[_0x9513('0x37')]=_0x405a3e[_0x9513('0x37')][_0x9513('0x38')]?_0x405a3e[_0x9513('0x37')]:_0x1ded5f[_0x9513('0x30')];_0x405a3e['order']=qs[_0x9513('0x3c')](_0x49b439[_0x9513('0x32')][_0x9513('0x3c')]);_0x405a3e[_0x9513('0x40')]=qs[_0x9513('0x34')](_['pick'](_0x49b439['query'],_0x1ded5f[_0x9513('0x34')]));if(_0x49b439[_0x9513('0x32')][_0x9513('0x3e')]){_0x405a3e[_0x9513('0x40')]=_[_0x9513('0x3f')](_0x405a3e[_0x9513('0x40')],{'$or':_[_0x9513('0x31')](_0x405a3e['attributes'],function(_0x97e43e){var _0x58f920={};_0x58f920[_0x97e43e]={'$like':'%'+_0x49b439[_0x9513('0x32')]['filter']+'%'};return _0x58f920;})});}_0x405a3e=_[_0x9513('0x3f')]({},_0x405a3e,_0x49b439[_0x9513('0x42')]);return _0x2a6c6b[_0x9513('0x50')](_0x405a3e);}})[_0x9513('0x28')](function(_0x4fc977){if(_0x4fc977){_0x9d7031=_0x4fc977[_0x9513('0x38')];if(!_0x49b439[_0x9513('0x32')][_0x9513('0x39')](_0x9513('0x3a'))){_0x405a3e[_0x9513('0x21')]=qs['limit'](_0x49b439[_0x9513('0x32')][_0x9513('0x21')]);_0x405a3e[_0x9513('0x1e')]=qs[_0x9513('0x1e')](_0x49b439[_0x9513('0x32')][_0x9513('0x1e')]);}return _0x2a6c6b[_0x9513('0x50')](_0x405a3e);}})[_0x9513('0x28')](function(_0x504d4d){if(_0x504d4d){return _0x504d4d?{'count':_0x9d7031,'rows':_0x504d4d}:null;}})[_0x9513('0x28')](respondWithResult(_0x2a66df,null))[_0x9513('0x49')](handleError(_0x2a66df,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 27a3273..6d54786 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 _0xcf7b=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','path','rimraf'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xcf7b,0x19e));var _0xbcf7=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xcf7b[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0xbcf7('0x0'));var logger=require(_0xbcf7('0x1'))(_0xbcf7('0x2'));var moment=require(_0xbcf7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcf7('0x4'));var rimraf=require(_0xbcf7('0x5'));var config=require(_0xbcf7('0x6'));var attributes=require(_0xbcf7('0x7'));module[_0xbcf7('0x8')]=function(_0x523317,_0x5eea31){return _0x523317[_0xbcf7('0x9')](_0xbcf7('0xa'),attributes,{'tableName':_0xbcf7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe9f=['../../config/environment','./intSalesforceConfiguration.attributes','exports','int_salesforce_configurations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3f001b,_0x49b405){var _0x45c596=function(_0x8bde5a){while(--_0x8bde5a){_0x3f001b['push'](_0x3f001b['shift']());}};_0x45c596(++_0x49b405);}(_0xfe9f,0x13a));var _0xffe9=function(_0x39bb1c,_0x32dc1d){_0x39bb1c=_0x39bb1c-0x0;var _0x538669=_0xfe9f[_0x39bb1c];return _0x538669;};'use strict';var _=require(_0xffe9('0x0'));var util=require('util');var logger=require(_0xffe9('0x1'))('api');var moment=require(_0xffe9('0x2'));var BPromise=require(_0xffe9('0x3'));var rp=require(_0xffe9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffe9('0x5'));var config=require(_0xffe9('0x6'));var attributes=require(_0xffe9('0x7'));module[_0xffe9('0x8')]=function(_0x2c53b7,_0x337908){return _0x2c53b7['define']('SalesforceConfiguration',attributes,{'tableName':_0xffe9('0x9'),'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 c3bf7d9..8a1a55e 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 _0xef14=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xdbb962,_0x523201){var _0xf4675b=function(_0x460eb7){while(--_0x460eb7){_0xdbb962['push'](_0xdbb962['shift']());}};_0xf4675b(++_0x523201);}(_0xef14,0x13b));var _0x4ef1=function(_0x650a19,_0x3d1ab9){_0x650a19=_0x650a19-0x0;var _0x5e8e61=_0xef14[_0x650a19];return _0x5e8e61;};'use strict';var _=require(_0x4ef1('0x0'));var util=require(_0x4ef1('0x1'));var moment=require(_0x4ef1('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ef1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ef1('0x4'))['db'];var utils=require(_0x4ef1('0x5'));var logger=require(_0x4ef1('0x6'))(_0x4ef1('0x7'));var config=require(_0x4ef1('0x8'));var jayson=require(_0x4ef1('0x9'));var client=jayson['client'][_0x4ef1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1547,_0x5ce290,_0x1930f7){return new BPromise(function(_0x15df6b,_0x52d483){return client[_0x4ef1('0xb')](_0x5c1547,_0x1930f7)[_0x4ef1('0xc')](function(_0x5cc53f){logger[_0x4ef1('0xd')](_0x4ef1('0xe'),_0x5ce290,_0x4ef1('0xf'));logger[_0x4ef1('0x10')](_0x4ef1('0x11'),_0x5ce290,_0x4ef1('0xf'),JSON[_0x4ef1('0x12')](_0x5cc53f));if(_0x5cc53f['error']){if(_0x5cc53f[_0x4ef1('0x13')][_0x4ef1('0x14')]===0x1f4){logger[_0x4ef1('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5ce290,_0x5cc53f[_0x4ef1('0x13')][_0x4ef1('0x15')]);return _0x52d483(_0x5cc53f[_0x4ef1('0x13')]['message']);}logger[_0x4ef1('0x13')](_0x4ef1('0xe'),_0x5ce290,_0x5cc53f[_0x4ef1('0x13')]['message']);return _0x15df6b(_0x5cc53f[_0x4ef1('0x13')]['message']);}else{logger[_0x4ef1('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5ce290,'request\x20sent');_0x15df6b(_0x5cc53f[_0x4ef1('0x16')]['message']);}})[_0x4ef1('0x17')](function(_0x4e315c){logger[_0x4ef1('0x13')](_0x4ef1('0xe'),_0x5ce290,_0x4e315c);_0x52d483(_0x4e315c);});});} \ No newline at end of file +var _0x5870=['request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0xa5227,_0x58cf43){var _0x450d7a=function(_0x3f6190){while(--_0x3f6190){_0xa5227['push'](_0xa5227['shift']());}};_0x450d7a(++_0x58cf43);}(_0x5870,0x180));var _0x0587=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5870[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x0587('0x0'));var util=require(_0x0587('0x1'));var moment=require(_0x0587('0x2'));var BPromise=require(_0x0587('0x3'));var rs=require(_0x0587('0x4'));var fs=require('fs');var Redis=require(_0x0587('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0587('0x6'));var logger=require(_0x0587('0x7'))(_0x0587('0x8'));var config=require(_0x0587('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0587('0xa')][_0x0587('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27a603,_0x184a13,_0xe7713){return new BPromise(function(_0x312106,_0x1fedfa){return client[_0x0587('0xc')](_0x27a603,_0xe7713)[_0x0587('0xd')](function(_0x19980c){logger['info'](_0x0587('0xe'),_0x184a13,_0x0587('0xf'));logger['debug'](_0x0587('0x10'),_0x184a13,_0x0587('0xf'),JSON[_0x0587('0x11')](_0x19980c));if(_0x19980c[_0x0587('0x12')]){if(_0x19980c[_0x0587('0x12')][_0x0587('0x13')]===0x1f4){logger[_0x0587('0x12')](_0x0587('0xe'),_0x184a13,_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);return _0x1fedfa(_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);}logger[_0x0587('0x12')](_0x0587('0xe'),_0x184a13,_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);return _0x312106(_0x19980c[_0x0587('0x12')][_0x0587('0x14')]);}else{logger['info'](_0x0587('0xe'),_0x184a13,_0x0587('0xf'));_0x312106(_0x19980c[_0x0587('0x15')][_0x0587('0x14')]);}})['catch'](function(_0x1b9d10){logger['error'](_0x0587('0xe'),_0x184a13,_0x1b9d10);_0x1fedfa(_0x1b9d10);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index bc43423..a7edfe1 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 _0x3be5=['isAuthenticated','/:id','show','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x5c8b10,_0x4fe472){var _0x24c179=function(_0x555ddd){while(--_0x555ddd){_0x5c8b10['push'](_0x5c8b10['shift']());}};_0x24c179(++_0x4fe472);}(_0x3be5,0xc8));var _0x53be=function(_0x275af2,_0x12a07e){_0x275af2=_0x275af2-0x0;var _0x35caa0=_0x3be5[_0x275af2];return _0x35caa0;};'use strict';var multer=require(_0x53be('0x0'));var util=require(_0x53be('0x1'));var path=require(_0x53be('0x2'));var timeout=require(_0x53be('0x3'));var express=require(_0x53be('0x4'));var router=express['Router']();var fs_extra=require(_0x53be('0x5'));var auth=require(_0x53be('0x6'));var interaction=require(_0x53be('0x7'));var config=require(_0x53be('0x8'));var controller=require(_0x53be('0x9'));router['get']('/',auth[_0x53be('0xa')](),controller['index']);router['get'](_0x53be('0xb'),auth[_0x53be('0xa')](),controller[_0x53be('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x53be('0xb'),auth[_0x53be('0xa')](),controller['update']);router[_0x53be('0xd')](_0x53be('0xb'),auth[_0x53be('0xa')](),controller['destroy']);module[_0x53be('0xe')]=router; \ No newline at end of file +var _0xc9e3=['get','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated'];(function(_0xdbd240,_0x288e71){var _0x50d6aa=function(_0x402219){while(--_0x402219){_0xdbd240['push'](_0xdbd240['shift']());}};_0x50d6aa(++_0x288e71);}(_0xc9e3,0x81));var _0x3c9e=function(_0x2f6a89,_0x41b125){_0x2f6a89=_0x2f6a89-0x0;var _0x501132=_0xc9e3[_0x2f6a89];return _0x501132;};'use strict';var multer=require(_0x3c9e('0x0'));var util=require(_0x3c9e('0x1'));var path=require(_0x3c9e('0x2'));var timeout=require(_0x3c9e('0x3'));var express=require('express');var router=express[_0x3c9e('0x4')]();var fs_extra=require(_0x3c9e('0x5'));var auth=require(_0x3c9e('0x6'));var interaction=require(_0x3c9e('0x7'));var config=require(_0x3c9e('0x8'));var controller=require(_0x3c9e('0x9'));router['get']('/',auth[_0x3c9e('0xa')](),controller['index']);router[_0x3c9e('0xb')](_0x3c9e('0xc'),auth[_0x3c9e('0xa')](),controller[_0x3c9e('0xd')]);router[_0x3c9e('0xe')]('/',auth[_0x3c9e('0xa')](),controller[_0x3c9e('0xf')]);router[_0x3c9e('0x10')](_0x3c9e('0xc'),auth['isAuthenticated'](),controller[_0x3c9e('0x11')]);router[_0x3c9e('0x12')](_0x3c9e('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c9e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index abd862b..7c7416f 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 _0x720c=['sequelize','exports','ENUM','string','customVariable','STRING'];(function(_0xf43e5c,_0x2034ed){var _0x2454c5=function(_0x403100){while(--_0x403100){_0xf43e5c['push'](_0xf43e5c['shift']());}};_0x2454c5(++_0x2034ed);}(_0x720c,0x72));var _0xc720=function(_0x5499ce,_0x3908fe){_0x5499ce=_0x5499ce-0x0;var _0xb9a0c2=_0x720c[_0x5499ce];return _0xb9a0c2;};'use strict';var Sequelize=require(_0xc720('0x0'));module[_0xc720('0x1')]={'type':{'type':Sequelize[_0xc720('0x2')](_0xc720('0x3'),'variable',_0xc720('0x4'),'keyValue','picklist'),'defaultValue':_0xc720('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xc720('0x3'),'variable',_0xc720('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc720('0x5')]},'variableName':{'type':Sequelize[_0xc720('0x5')]}}; \ No newline at end of file +var _0x8b77=['string','variable','customVariable','keyValue','STRING','ENUM','exports'];(function(_0x24d560,_0x2e0e7b){var _0x18f7b3=function(_0x564a93){while(--_0x564a93){_0x24d560['push'](_0x24d560['shift']());}};_0x18f7b3(++_0x2e0e7b);}(_0x8b77,0x110));var _0x78b7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8b77[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x78b7('0x0')]={'type':{'type':Sequelize['ENUM'](_0x78b7('0x1'),_0x78b7('0x2'),_0x78b7('0x3'),_0x78b7('0x4'),'picklist'),'defaultValue':_0x78b7('0x1')},'content':{'type':Sequelize[_0x78b7('0x5')]},'key':{'type':Sequelize[_0x78b7('0x5')]},'keyType':{'type':Sequelize[_0x78b7('0x6')](_0x78b7('0x1'),_0x78b7('0x2'),_0x78b7('0x3'))},'keyContent':{'type':Sequelize[_0x78b7('0x5')]},'idField':{'type':Sequelize[_0x78b7('0x5')]},'variableName':{'type':Sequelize[_0x78b7('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index decba2f..3710919 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 _0xa59e=['include','findAll','rows','catch','show','params','intersection','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','pick','filter','merge','where','options','includeAll'];(function(_0x29da85,_0x414981){var _0x19bfde=function(_0x821e8d){while(--_0x821e8d){_0x29da85['push'](_0x29da85['shift']());}};_0x19bfde(++_0x414981);}(_0xa59e,0xfc));var _0xea59=function(_0x39a42a,_0xb67525){_0x39a42a=_0x39a42a-0x0;var _0x462ec5=_0xa59e[_0x39a42a];return _0x462ec5;};'use strict';var emlformat=require(_0xea59('0x0'));var rimraf=require(_0xea59('0x1'));var zipdir=require(_0xea59('0x2'));var jsonpatch=require(_0xea59('0x3'));var rp=require(_0xea59('0x4'));var moment=require(_0xea59('0x5'));var BPromise=require(_0xea59('0x6'));var Mustache=require(_0xea59('0x7'));var util=require(_0xea59('0x8'));var path=require(_0xea59('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea59('0xa'));var fs=require('fs');var fs_extra=require(_0xea59('0xb'));var _=require(_0xea59('0xc'));var squel=require(_0xea59('0xd'));var crypto=require(_0xea59('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xea59('0xf'));var toCsv=require(_0xea59('0x10'));var querystring=require('querystring');var Papa=require(_0xea59('0x11'));var Redis=require(_0xea59('0x12'));var authService=require(_0xea59('0x13'));var qs=require(_0xea59('0x14'));var as=require(_0xea59('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea59('0x16'))(_0xea59('0x17'));var utils=require(_0xea59('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xea59('0x19'));var db=require(_0xea59('0x1a'))['db'];function respondWithStatusCode(_0x40df00,_0x155ad9){_0x155ad9=_0x155ad9||0xcc;return function(_0x36b195){if(_0x36b195){return _0x40df00[_0xea59('0x1b')](_0x155ad9);}return _0x40df00[_0xea59('0x1c')](_0x155ad9)[_0xea59('0x1d')]();};}function respondWithResult(_0x571f6d,_0x378864){_0x378864=_0x378864||0xc8;return function(_0x50827d){if(_0x50827d){return _0x571f6d['status'](_0x378864)[_0xea59('0x1e')](_0x50827d);}};}function respondWithFilteredResult(_0xd8e6ca,_0x534e75){return function(_0x17cf58){if(_0x17cf58){var _0x46666b=typeof _0x534e75[_0xea59('0x1f')]===_0xea59('0x20')&&typeof _0x534e75['limit']===_0xea59('0x20');var _0x363c76=_0x17cf58[_0xea59('0x21')];var _0x115437=_0x46666b?0x0:_0x534e75[_0xea59('0x1f')];var _0x488562=_0x46666b?_0x17cf58[_0xea59('0x21')]:_0x534e75[_0xea59('0x1f')]+_0x534e75['limit'];var _0x5d6637;if(_0x488562>=_0x363c76){_0x488562=_0x363c76;_0x5d6637=0xc8;}else{_0x5d6637=0xce;}_0xd8e6ca['status'](_0x5d6637);return _0xd8e6ca[_0xea59('0x22')](_0xea59('0x23'),_0x115437+'-'+_0x488562+'/'+_0x363c76)[_0xea59('0x1e')](_0x17cf58);}return null;};}function patchUpdates(_0x1c30a2){return function(_0x53a551){try{jsonpatch[_0xea59('0x24')](_0x53a551,_0x1c30a2,!![]);}catch(_0x318807){return BPromise[_0xea59('0x25')](_0x318807);}return _0x53a551[_0xea59('0x26')]();};}function saveUpdates(_0x5c3f98,_0x43def8){return function(_0x5c714d){if(_0x5c714d){return _0x5c714d['update'](_0x5c3f98)[_0xea59('0x27')](function(_0x3dda61){return _0x3dda61;});}return null;};}function removeEntity(_0x55fb31,_0x341162){return function(_0x38866c){if(_0x38866c){return _0x38866c['destroy']()['then'](function(){_0x55fb31['status'](0xcc)[_0xea59('0x1d')]();});}};}function handleEntityNotFound(_0x379b39,_0x5f3b78){return function(_0x21d7c7){if(!_0x21d7c7){_0x379b39[_0xea59('0x1b')](0x194);}return _0x21d7c7;};}function handleError(_0x1fc2ba,_0x1a5b26){_0x1a5b26=_0x1a5b26||0x1f4;return function(_0x48ced3){logger[_0xea59('0x28')](_0x48ced3[_0xea59('0x29')]);if(_0x48ced3[_0xea59('0x2a')]){delete _0x48ced3[_0xea59('0x2a')];}_0x1fc2ba['status'](_0x1a5b26)[_0xea59('0x2b')](_0x48ced3);};}exports[_0xea59('0x2c')]=function(_0x5b4ea8,_0x235b58){var _0x1b4f40={},_0x361cda={},_0x480043={'count':0x0,'rows':[]};var _0x4294bb=_[_0xea59('0x2d')](db[_0xea59('0x2e')][_0xea59('0x2f')],function(_0x1db1f1){return{'name':_0x1db1f1[_0xea59('0x30')],'type':_0x1db1f1[_0xea59('0x31')][_0xea59('0x32')]};});_0x361cda[_0xea59('0x33')]=_[_0xea59('0x2d')](_0x4294bb,'name');_0x361cda[_0xea59('0x34')]=_[_0xea59('0x35')](_0x5b4ea8[_0xea59('0x34')]);_0x361cda[_0xea59('0x36')]=_['intersection'](_0x361cda[_0xea59('0x33')],_0x361cda[_0xea59('0x34')]);_0x1b4f40[_0xea59('0x37')]=_['intersection'](_0x361cda['model'],qs[_0xea59('0x38')](_0x5b4ea8[_0xea59('0x34')][_0xea59('0x38')]));_0x1b4f40['attributes']=_0x1b4f40[_0xea59('0x37')][_0xea59('0x39')]?_0x1b4f40[_0xea59('0x37')]:_0x361cda[_0xea59('0x33')];if(!_0x5b4ea8['query']['hasOwnProperty'](_0xea59('0x3a'))){_0x1b4f40[_0xea59('0x3b')]=qs[_0xea59('0x3b')](_0x5b4ea8['query']['limit']);_0x1b4f40[_0xea59('0x1f')]=qs[_0xea59('0x1f')](_0x5b4ea8[_0xea59('0x34')][_0xea59('0x1f')]);}_0x1b4f40[_0xea59('0x3c')]=qs[_0xea59('0x3d')](_0x5b4ea8[_0xea59('0x34')][_0xea59('0x3d')]);_0x1b4f40['where']=qs[_0xea59('0x36')](_[_0xea59('0x3e')](_0x5b4ea8[_0xea59('0x34')],_0x361cda[_0xea59('0x36')]),_0x4294bb);if(_0x5b4ea8[_0xea59('0x34')][_0xea59('0x3f')]){_0x1b4f40['where']=_[_0xea59('0x40')](_0x1b4f40[_0xea59('0x41')],{'$or':_[_0xea59('0x2d')](_0x4294bb,function(_0x3f66f4){if(_0x3f66f4[_0xea59('0x31')]!=='VIRTUAL'){var _0x3abb6c={};_0x3abb6c[_0x3f66f4['name']]={'$like':'%'+_0x5b4ea8[_0xea59('0x34')]['filter']+'%'};return _0x3abb6c;}})});}_0x1b4f40=_[_0xea59('0x40')]({},_0x1b4f40,_0x5b4ea8[_0xea59('0x42')]);var _0x3ae37c={'where':_0x1b4f40[_0xea59('0x41')]};return db[_0xea59('0x2e')][_0xea59('0x21')](_0x3ae37c)[_0xea59('0x27')](function(_0x1a1b7d){_0x480043[_0xea59('0x21')]=_0x1a1b7d;if(_0x5b4ea8['query'][_0xea59('0x43')]){_0x1b4f40[_0xea59('0x44')]=[{'all':!![]}];}return db[_0xea59('0x2e')][_0xea59('0x45')](_0x1b4f40);})[_0xea59('0x27')](function(_0x300cad){_0x480043[_0xea59('0x46')]=_0x300cad;return _0x480043;})[_0xea59('0x27')](respondWithFilteredResult(_0x235b58,_0x1b4f40))[_0xea59('0x47')](handleError(_0x235b58,null));};exports[_0xea59('0x48')]=function(_0x5a4b6d,_0x172ac6){var _0x20901c={'raw':!![],'where':{'id':_0x5a4b6d[_0xea59('0x49')]['id']}},_0x451082={};_0x451082[_0xea59('0x33')]=_[_0xea59('0x35')](db[_0xea59('0x2e')][_0xea59('0x2f')]);_0x451082[_0xea59('0x34')]=_['keys'](_0x5a4b6d[_0xea59('0x34')]);_0x451082[_0xea59('0x36')]=_['intersection'](_0x451082[_0xea59('0x33')],_0x451082[_0xea59('0x34')]);_0x20901c[_0xea59('0x37')]=_[_0xea59('0x4a')](_0x451082['model'],qs[_0xea59('0x38')](_0x5a4b6d[_0xea59('0x34')]['fields']));_0x20901c['attributes']=_0x20901c[_0xea59('0x37')][_0xea59('0x39')]?_0x20901c[_0xea59('0x37')]:_0x451082['model'];if(_0x5a4b6d[_0xea59('0x34')]['includeAll']){_0x20901c[_0xea59('0x44')]=[{'all':!![]}];}_0x20901c=_[_0xea59('0x40')]({},_0x20901c,_0x5a4b6d['options']);return db['SalesforceField'][_0xea59('0x4b')](_0x20901c)[_0xea59('0x27')](handleEntityNotFound(_0x172ac6,null))[_0xea59('0x27')](respondWithResult(_0x172ac6,null))['catch'](handleError(_0x172ac6,null));};exports[_0xea59('0x4c')]=function(_0x62a312,_0x24c746){return db['SalesforceField'][_0xea59('0x4c')](_0x62a312[_0xea59('0x4d')],{})['then'](respondWithResult(_0x24c746,0xc9))[_0xea59('0x47')](handleError(_0x24c746,null));};exports[_0xea59('0x4e')]=function(_0x336b10,_0x419916){if(_0x336b10[_0xea59('0x4d')]['id']){delete _0x336b10[_0xea59('0x4d')]['id'];}return db[_0xea59('0x2e')]['find']({'where':{'id':_0x336b10['params']['id']}})['then'](handleEntityNotFound(_0x419916,null))['then'](saveUpdates(_0x336b10[_0xea59('0x4d')],null))['then'](respondWithResult(_0x419916,null))[_0xea59('0x47')](handleError(_0x419916,null));};exports[_0xea59('0x4f')]=function(_0x5bb5d6,_0x4da6b6){return db['SalesforceField'][_0xea59('0x4b')]({'where':{'id':_0x5bb5d6[_0xea59('0x49')]['id']}})[_0xea59('0x27')](handleEntityNotFound(_0x4da6b6,null))[_0xea59('0x27')](removeEntity(_0x4da6b6,null))[_0xea59('0x47')](handleError(_0x4da6b6,null));}; \ No newline at end of file +var _0x050c=['catch','show','keys','rawAttributes','includeAll','create','body','params','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceField','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','include','rows'];(function(_0x39fd37,_0x4bce58){var _0x3a2086=function(_0x372a58){while(--_0x372a58){_0x39fd37['push'](_0x39fd37['shift']());}};_0x3a2086(++_0x4bce58);}(_0x050c,0x185));var _0xc050=function(_0x27eda2,_0x678082){_0x27eda2=_0x27eda2-0x0;var _0x373fd6=_0x050c[_0x27eda2];return _0x373fd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc050('0x0'));var zipdir=require(_0xc050('0x1'));var jsonpatch=require(_0xc050('0x2'));var rp=require(_0xc050('0x3'));var moment=require(_0xc050('0x4'));var BPromise=require(_0xc050('0x5'));var Mustache=require(_0xc050('0x6'));var util=require('util');var path=require(_0xc050('0x7'));var sox=require(_0xc050('0x8'));var csv=require(_0xc050('0x9'));var ejs=require(_0xc050('0xa'));var fs=require('fs');var fs_extra=require(_0xc050('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc050('0xc'));var jsforce=require(_0xc050('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc050('0x9'));var querystring=require(_0xc050('0xe'));var Papa=require(_0xc050('0xf'));var Redis=require(_0xc050('0x10'));var authService=require(_0xc050('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc050('0x12'));var hardwareService=require(_0xc050('0x13'));var logger=require(_0xc050('0x14'))(_0xc050('0x15'));var utils=require(_0xc050('0x16'));var config=require(_0xc050('0x17'));var licenseUtil=require(_0xc050('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39bfb5,_0x13fef3){_0x13fef3=_0x13fef3||0xcc;return function(_0x582a51){if(_0x582a51){return _0x39bfb5[_0xc050('0x19')](_0x13fef3);}return _0x39bfb5['status'](_0x13fef3)['end']();};}function respondWithResult(_0x5b6f23,_0x3c6527){_0x3c6527=_0x3c6527||0xc8;return function(_0x42da14){if(_0x42da14){return _0x5b6f23[_0xc050('0x1a')](_0x3c6527)[_0xc050('0x1b')](_0x42da14);}};}function respondWithFilteredResult(_0x720883,_0x14b198){return function(_0x796987){if(_0x796987){var _0x1196ad=typeof _0x14b198[_0xc050('0x1c')]===_0xc050('0x1d')&&typeof _0x14b198[_0xc050('0x1e')]==='undefined';var _0x429f61=_0x796987[_0xc050('0x1f')];var _0x51f0bb=_0x1196ad?0x0:_0x14b198[_0xc050('0x1c')];var _0x21bbc1=_0x1196ad?_0x796987[_0xc050('0x1f')]:_0x14b198['offset']+_0x14b198[_0xc050('0x1e')];var _0x5beb20;if(_0x21bbc1>=_0x429f61){_0x21bbc1=_0x429f61;_0x5beb20=0xc8;}else{_0x5beb20=0xce;}_0x720883['status'](_0x5beb20);return _0x720883[_0xc050('0x20')](_0xc050('0x21'),_0x51f0bb+'-'+_0x21bbc1+'/'+_0x429f61)[_0xc050('0x1b')](_0x796987);}return null;};}function patchUpdates(_0xf85f1){return function(_0x3bc00b){try{jsonpatch[_0xc050('0x22')](_0x3bc00b,_0xf85f1,!![]);}catch(_0x1073b7){return BPromise[_0xc050('0x23')](_0x1073b7);}return _0x3bc00b[_0xc050('0x24')]();};}function saveUpdates(_0x4befbb,_0x315299){return function(_0x2b3d2f){if(_0x2b3d2f){return _0x2b3d2f[_0xc050('0x25')](_0x4befbb)[_0xc050('0x26')](function(_0x66ee25){return _0x66ee25;});}return null;};}function removeEntity(_0x4e62dd,_0x1ddbee){return function(_0x3cf09a){if(_0x3cf09a){return _0x3cf09a[_0xc050('0x27')]()[_0xc050('0x26')](function(){_0x4e62dd[_0xc050('0x1a')](0xcc)[_0xc050('0x28')]();});}};}function handleEntityNotFound(_0x9a26ed,_0x38e7d0){return function(_0x2052fa){if(!_0x2052fa){_0x9a26ed['sendStatus'](0x194);}return _0x2052fa;};}function handleError(_0x2d4d07,_0x32195a){_0x32195a=_0x32195a||0x1f4;return function(_0x5d767a){logger[_0xc050('0x29')](_0x5d767a[_0xc050('0x2a')]);if(_0x5d767a[_0xc050('0x2b')]){delete _0x5d767a[_0xc050('0x2b')];}_0x2d4d07[_0xc050('0x1a')](_0x32195a)[_0xc050('0x2c')](_0x5d767a);};}exports[_0xc050('0x2d')]=function(_0x95dff7,_0x3a4140){var _0x222dab={},_0x53c5ff={},_0x3c47fd={'count':0x0,'rows':[]};var _0x32812d=_[_0xc050('0x2e')](db[_0xc050('0x2f')]['rawAttributes'],function(_0x20873f){return{'name':_0x20873f[_0xc050('0x30')],'type':_0x20873f[_0xc050('0x31')][_0xc050('0x32')]};});_0x53c5ff['model']=_[_0xc050('0x2e')](_0x32812d,_0xc050('0x2b'));_0x53c5ff['query']=_['keys'](_0x95dff7[_0xc050('0x33')]);_0x53c5ff[_0xc050('0x34')]=_['intersection'](_0x53c5ff[_0xc050('0x35')],_0x53c5ff[_0xc050('0x33')]);_0x222dab[_0xc050('0x36')]=_[_0xc050('0x37')](_0x53c5ff['model'],qs[_0xc050('0x38')](_0x95dff7[_0xc050('0x33')][_0xc050('0x38')]));_0x222dab[_0xc050('0x36')]=_0x222dab[_0xc050('0x36')][_0xc050('0x39')]?_0x222dab[_0xc050('0x36')]:_0x53c5ff[_0xc050('0x35')];if(!_0x95dff7['query']['hasOwnProperty']('nolimit')){_0x222dab[_0xc050('0x1e')]=qs[_0xc050('0x1e')](_0x95dff7[_0xc050('0x33')][_0xc050('0x1e')]);_0x222dab[_0xc050('0x1c')]=qs[_0xc050('0x1c')](_0x95dff7[_0xc050('0x33')]['offset']);}_0x222dab[_0xc050('0x3a')]=qs['sort'](_0x95dff7['query'][_0xc050('0x3b')]);_0x222dab[_0xc050('0x3c')]=qs['filters'](_['pick'](_0x95dff7[_0xc050('0x33')],_0x53c5ff[_0xc050('0x34')]),_0x32812d);if(_0x95dff7['query'][_0xc050('0x3d')]){_0x222dab[_0xc050('0x3c')]=_[_0xc050('0x3e')](_0x222dab[_0xc050('0x3c')],{'$or':_[_0xc050('0x2e')](_0x32812d,function(_0x775b6d){if(_0x775b6d[_0xc050('0x31')]!==_0xc050('0x3f')){var _0x1181be={};_0x1181be[_0x775b6d[_0xc050('0x2b')]]={'$like':'%'+_0x95dff7[_0xc050('0x33')][_0xc050('0x3d')]+'%'};return _0x1181be;}})});}_0x222dab=_[_0xc050('0x3e')]({},_0x222dab,_0x95dff7[_0xc050('0x40')]);var _0x4ed97b={'where':_0x222dab['where']};return db[_0xc050('0x2f')][_0xc050('0x1f')](_0x4ed97b)[_0xc050('0x26')](function(_0x1b118f){_0x3c47fd['count']=_0x1b118f;if(_0x95dff7[_0xc050('0x33')]['includeAll']){_0x222dab[_0xc050('0x41')]=[{'all':!![]}];}return db[_0xc050('0x2f')]['findAll'](_0x222dab);})['then'](function(_0xce907e){_0x3c47fd[_0xc050('0x42')]=_0xce907e;return _0x3c47fd;})[_0xc050('0x26')](respondWithFilteredResult(_0x3a4140,_0x222dab))[_0xc050('0x43')](handleError(_0x3a4140,null));};exports[_0xc050('0x44')]=function(_0x337ed2,_0x3b3e76){var _0x38d8d9={'raw':!![],'where':{'id':_0x337ed2['params']['id']}},_0x37c87c={};_0x37c87c[_0xc050('0x35')]=_[_0xc050('0x45')](db[_0xc050('0x2f')][_0xc050('0x46')]);_0x37c87c[_0xc050('0x33')]=_[_0xc050('0x45')](_0x337ed2[_0xc050('0x33')]);_0x37c87c['filters']=_[_0xc050('0x37')](_0x37c87c['model'],_0x37c87c[_0xc050('0x33')]);_0x38d8d9[_0xc050('0x36')]=_[_0xc050('0x37')](_0x37c87c[_0xc050('0x35')],qs[_0xc050('0x38')](_0x337ed2[_0xc050('0x33')]['fields']));_0x38d8d9[_0xc050('0x36')]=_0x38d8d9['attributes']['length']?_0x38d8d9[_0xc050('0x36')]:_0x37c87c['model'];if(_0x337ed2['query'][_0xc050('0x47')]){_0x38d8d9['include']=[{'all':!![]}];}_0x38d8d9=_[_0xc050('0x3e')]({},_0x38d8d9,_0x337ed2[_0xc050('0x40')]);return db[_0xc050('0x2f')]['find'](_0x38d8d9)[_0xc050('0x26')](handleEntityNotFound(_0x3b3e76,null))[_0xc050('0x26')](respondWithResult(_0x3b3e76,null))[_0xc050('0x43')](handleError(_0x3b3e76,null));};exports[_0xc050('0x48')]=function(_0x5ed389,_0x2f15c7){return db['SalesforceField'][_0xc050('0x48')](_0x5ed389[_0xc050('0x49')],{})[_0xc050('0x26')](respondWithResult(_0x2f15c7,0xc9))[_0xc050('0x43')](handleError(_0x2f15c7,null));};exports[_0xc050('0x25')]=function(_0x36c25a,_0x310255){if(_0x36c25a[_0xc050('0x49')]['id']){delete _0x36c25a[_0xc050('0x49')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x36c25a[_0xc050('0x4a')]['id']}})['then'](handleEntityNotFound(_0x310255,null))['then'](saveUpdates(_0x36c25a[_0xc050('0x49')],null))['then'](respondWithResult(_0x310255,null))[_0xc050('0x43')](handleError(_0x310255,null));};exports['destroy']=function(_0x1f9d03,_0x2d1d23){return db['SalesforceField'][_0xc050('0x4b')]({'where':{'id':_0x1f9d03[_0xc050('0x4a')]['id']}})[_0xc050('0x26')](handleEntityNotFound(_0x2d1d23,null))['then'](removeEntity(_0x2d1d23,null))[_0xc050('0x43')](handleError(_0x2d1d23,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f5e58e0..43fefb5 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 _0xc03d=['path','exports','define','SalesforceField','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ea971,_0x174234){var _0x86b88d=function(_0x549b7e){while(--_0x549b7e){_0x4ea971['push'](_0x4ea971['shift']());}};_0x86b88d(++_0x174234);}(_0xc03d,0x1db));var _0xdc03=function(_0x3f6104,_0x30a8d5){_0x3f6104=_0x3f6104-0x0;var _0x5086f3=_0xc03d[_0x3f6104];return _0x5086f3;};'use strict';var _=require('lodash');var util=require(_0xdc03('0x0'));var logger=require(_0xdc03('0x1'))(_0xdc03('0x2'));var moment=require(_0xdc03('0x3'));var BPromise=require(_0xdc03('0x4'));var rp=require(_0xdc03('0x5'));var fs=require('fs');var path=require(_0xdc03('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0xdc03('0x7')]=function(_0x2ff623,_0x4984e8){return _0x2ff623[_0xdc03('0x8')](_0xdc03('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xdc03('0xa'),'fields':[_0xdc03('0xb'),_0xdc03('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd750=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','FieldId','lodash'];(function(_0x2b83ff,_0x5a825e){var _0x20a065=function(_0x4c85d5){while(--_0x4c85d5){_0x2b83ff['push'](_0x2b83ff['shift']());}};_0x20a065(++_0x5a825e);}(_0xd750,0x103));var _0x0d75=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0xd750[_0x36da00];return _0x4b72c5;};'use strict';var _=require(_0x0d75('0x0'));var util=require('util');var logger=require(_0x0d75('0x1'))(_0x0d75('0x2'));var moment=require(_0x0d75('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d75('0x4'));var fs=require('fs');var path=require(_0x0d75('0x5'));var rimraf=require(_0x0d75('0x6'));var config=require(_0x0d75('0x7'));var attributes=require(_0x0d75('0x8'));module[_0x0d75('0x9')]=function(_0x3b6f81,_0x5001fd){return _0x3b6f81[_0x0d75('0xa')]('SalesforceField',attributes,{'tableName':_0x0d75('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x0d75('0xc')],'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 e82f776..399f469 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 _0x708d=['../../config/environment','jayson/promise','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x708d,0x1c7));var _0xd708=function(_0x35e124,_0x1d85e2){_0x35e124=_0x35e124-0x0;var _0x53c482=_0x708d[_0x35e124];return _0x53c482;};'use strict';var _=require(_0xd708('0x0'));var util=require('util');var moment=require(_0xd708('0x1'));var BPromise=require(_0xd708('0x2'));var rs=require(_0xd708('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd708('0x4'))['db'];var utils=require(_0xd708('0x5'));var logger=require(_0xd708('0x6'))('rpc');var config=require(_0xd708('0x7'));var jayson=require(_0xd708('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x466097,_0x44fb01,_0x399bc){return new BPromise(function(_0x5bf056,_0x314c37){return client[_0xd708('0x9')](_0x466097,_0x399bc)[_0xd708('0xa')](function(_0x2f02ed){logger[_0xd708('0xb')](_0xd708('0xc'),_0x44fb01,_0xd708('0xd'));logger['debug'](_0xd708('0xe'),_0x44fb01,_0xd708('0xd'),JSON[_0xd708('0xf')](_0x2f02ed));if(_0x2f02ed[_0xd708('0x10')]){if(_0x2f02ed[_0xd708('0x10')][_0xd708('0x11')]===0x1f4){logger[_0xd708('0x10')](_0xd708('0xc'),_0x44fb01,_0x2f02ed[_0xd708('0x10')][_0xd708('0x12')]);return _0x314c37(_0x2f02ed['error']['message']);}logger[_0xd708('0x10')]('SalesforceField,\x20%s,\x20%s',_0x44fb01,_0x2f02ed[_0xd708('0x10')][_0xd708('0x12')]);return _0x5bf056(_0x2f02ed[_0xd708('0x10')][_0xd708('0x12')]);}else{logger[_0xd708('0xb')](_0xd708('0xc'),_0x44fb01,_0xd708('0xd'));_0x5bf056(_0x2f02ed[_0xd708('0x13')][_0xd708('0x12')]);}})[_0xd708('0x14')](function(_0x33129c){logger['error'](_0xd708('0xc'),_0x44fb01,_0x33129c);_0x314c37(_0x33129c);});});} \ No newline at end of file +var _0xbc7c=['jayson/promise','client','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x223371,_0x501e73){var _0x2e7f3a=function(_0x3f1294){while(--_0x3f1294){_0x223371['push'](_0x223371['shift']());}};_0x2e7f3a(++_0x501e73);}(_0xbc7c,0x1f0));var _0xcbc7=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0xbc7c[_0x1daaa9];return _0x1dd221;};'use strict';var _=require(_0xcbc7('0x0'));var util=require(_0xcbc7('0x1'));var moment=require(_0xcbc7('0x2'));var BPromise=require(_0xcbc7('0x3'));var rs=require(_0xcbc7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbc7('0x6'))(_0xcbc7('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbc7('0x8'));var client=jayson[_0xcbc7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5de767,_0x1627b3,_0x1670a7){return new BPromise(function(_0x2704a0,_0x140fe1){return client[_0xcbc7('0xa')](_0x5de767,_0x1670a7)[_0xcbc7('0xb')](function(_0x229635){logger['info'](_0xcbc7('0xc'),_0x1627b3,_0xcbc7('0xd'));logger['debug'](_0xcbc7('0xe'),_0x1627b3,_0xcbc7('0xd'),JSON[_0xcbc7('0xf')](_0x229635));if(_0x229635[_0xcbc7('0x10')]){if(_0x229635[_0xcbc7('0x10')][_0xcbc7('0x11')]===0x1f4){logger[_0xcbc7('0x10')](_0xcbc7('0xc'),_0x1627b3,_0x229635[_0xcbc7('0x10')]['message']);return _0x140fe1(_0x229635[_0xcbc7('0x10')][_0xcbc7('0x12')]);}logger[_0xcbc7('0x10')](_0xcbc7('0xc'),_0x1627b3,_0x229635[_0xcbc7('0x10')][_0xcbc7('0x12')]);return _0x2704a0(_0x229635[_0xcbc7('0x10')]['message']);}else{logger[_0xcbc7('0x13')](_0xcbc7('0xc'),_0x1627b3,'request\x20sent');_0x2704a0(_0x229635['result']['message']);}})[_0xcbc7('0x14')](function(_0x55b36d){logger['error'](_0xcbc7('0xc'),_0x1627b3,_0x55b36d);_0x140fe1(_0x55b36d);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 091b643..738e276 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 _0xf9f7=['../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3eb47a,_0x1b5fa9){var _0x35be86=function(_0xb69905){while(--_0xb69905){_0x3eb47a['push'](_0x3eb47a['shift']());}};_0x35be86(++_0x1b5fa9);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x1f063b,_0x321a3c){_0x1f063b=_0x1f063b-0x0;var _0x4d864b=_0xf9f7[_0x1f063b];return _0x4d864b;};'use strict';var multer=require(_0x7f9f('0x0'));var util=require(_0x7f9f('0x1'));var path=require(_0x7f9f('0x2'));var timeout=require(_0x7f9f('0x3'));var express=require(_0x7f9f('0x4'));var router=express[_0x7f9f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7f9f('0x6'));var config=require(_0x7f9f('0x7'));var controller=require(_0x7f9f('0x8'));router[_0x7f9f('0x9')]('/',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0xb')]);router['get'](_0x7f9f('0xc'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0xd')]);router[_0x7f9f('0x9')](_0x7f9f('0xe'),auth['isAuthenticated'](),controller[_0x7f9f('0xf')]);router[_0x7f9f('0x9')](_0x7f9f('0x10'),auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x11')]);router[_0x7f9f('0x12')]('/',auth[_0x7f9f('0xa')](),controller['create']);router[_0x7f9f('0x12')](_0x7f9f('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x7f9f('0x13')]('/:id',auth[_0x7f9f('0xa')](),controller[_0x7f9f('0x14')]);router['delete'](_0x7f9f('0xc'),auth['isAuthenticated'](),controller[_0x7f9f('0x15')]);module[_0x7f9f('0x16')]=router; \ No newline at end of file +var _0x5044=['update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0xfe7a7d,_0x407b42){var _0x5baa5a=function(_0x3cac03){while(--_0x3cac03){_0xfe7a7d['push'](_0xfe7a7d['shift']());}};_0x5baa5a(++_0x407b42);}(_0x5044,0xc8));var _0x4504=function(_0x3aee28,_0x56710a){_0x3aee28=_0x3aee28-0x0;var _0x5b0726=_0x5044[_0x3aee28];return _0x5b0726;};'use strict';var multer=require('multer');var util=require(_0x4504('0x0'));var path=require('path');var timeout=require(_0x4504('0x1'));var express=require(_0x4504('0x2'));var router=express[_0x4504('0x3')]();var fs_extra=require(_0x4504('0x4'));var auth=require(_0x4504('0x5'));var interaction=require(_0x4504('0x6'));var config=require(_0x4504('0x7'));var controller=require(_0x4504('0x8'));router['get']('/',auth[_0x4504('0x9')](),controller[_0x4504('0xa')]);router[_0x4504('0xb')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0xd')]);router[_0x4504('0xb')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller['getConfigurations']);router[_0x4504('0xb')]('/:id/fields',auth[_0x4504('0x9')](),controller[_0x4504('0xf')]);router[_0x4504('0x10')]('/',auth[_0x4504('0x9')](),controller[_0x4504('0x11')]);router[_0x4504('0x10')](_0x4504('0xe'),auth[_0x4504('0x9')](),controller[_0x4504('0x12')]);router[_0x4504('0x13')](_0x4504('0xc'),auth[_0x4504('0x9')](),controller[_0x4504('0x14')]);router['delete'](_0x4504('0xc'),auth[_0x4504('0x9')](),controller['destroy']);module[_0x4504('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 4ca0d0d..f4738d3 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 _0x1dd1=['STRING','username','remoteUri','sequelize'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x1dd1,0xf3));var _0x11dd=function(_0xb64e9e,_0x519fb2){_0xb64e9e=_0xb64e9e-0x0;var _0x1c63f4=_0x1dd1[_0xb64e9e];return _0x1c63f4;};'use strict';var Sequelize=require(_0x11dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x11dd('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x11dd('0x1')],'unique':_0x11dd('0x2')},'password':{'type':Sequelize[_0x11dd('0x1')]},'email':{'type':Sequelize[_0x11dd('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x11dd('0x3')},'serverUrl':{'type':Sequelize[_0x11dd('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1ab7=['remoteUri','sequelize','exports','STRING','username'];(function(_0x597aff,_0x2054ac){var _0x55193a=function(_0x22edda){while(--_0x22edda){_0x597aff['push'](_0x597aff['shift']());}};_0x55193a(++_0x2054ac);}(_0x1ab7,0x6a));var _0x71ab=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0x1ab7[_0xcda377];return _0x1c024f;};'use strict';var Sequelize=require(_0x71ab('0x0'));module[_0x71ab('0x1')]={'name':{'type':Sequelize[_0x71ab('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x71ab('0x2')],'unique':_0x71ab('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x71ab('0x2')]},'remoteUri':{'type':Sequelize[_0x71ab('0x2')],'unique':_0x71ab('0x4')},'serverUrl':{'type':Sequelize[_0x71ab('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 8770363..dace65f 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 _0x3205=['remoteUri','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','password','GET','result','log','remove','includes','forEach','internalType','push','all','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','send','Wrong\x20credentials','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','label','value','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','then','status','error','stack','name','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ServicenowAccount','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','ServicenowConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','made_sla','hold_reason','subcategory','notify','incident_state','severity','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','closed_at','delivery_plan','work_notes_list','priority','sys_domain_path','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','assigned_to','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','category','email'];(function(_0x1a048d,_0x186b58){var _0x196ff4=function(_0x249410){while(--_0x249410){_0x1a048d['push'](_0x1a048d['shift']());}};_0x196ff4(++_0x186b58);}(_0x3205,0x183));var _0x5320=function(_0x340862,_0x81d165){_0x340862=_0x340862-0x0;var _0x25c04b=_0x3205[_0x340862];return _0x25c04b;};'use strict';var emlformat=require(_0x5320('0x0'));var rimraf=require(_0x5320('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5320('0x2'));var rp=require(_0x5320('0x3'));var moment=require('moment');var BPromise=require(_0x5320('0x4'));var Mustache=require(_0x5320('0x5'));var util=require(_0x5320('0x6'));var path=require(_0x5320('0x7'));var sox=require('sox');var csv=require(_0x5320('0x8'));var ejs=require(_0x5320('0x9'));var fs=require('fs');var fs_extra=require(_0x5320('0xa'));var _=require(_0x5320('0xb'));var squel=require(_0x5320('0xc'));var crypto=require(_0x5320('0xd'));var jsforce=require(_0x5320('0xe'));var deskjs=require(_0x5320('0xf'));var toCsv=require(_0x5320('0x8'));var querystring=require('querystring');var Papa=require(_0x5320('0x10'));var Redis=require(_0x5320('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5320('0x12'));var as=require(_0x5320('0x13'));var hardwareService=require(_0x5320('0x14'));var logger=require(_0x5320('0x15'))(_0x5320('0x16'));var utils=require(_0x5320('0x17'));var config=require(_0x5320('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5320('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2bad1e,_0x20a94d){_0x20a94d=_0x20a94d||0xcc;return function(_0x5bab17){if(_0x5bab17){return _0x2bad1e[_0x5320('0x1a')](_0x20a94d);}return _0x2bad1e['status'](_0x20a94d)['end']();};}function respondWithResult(_0x1b0ebc,_0x24bf46){_0x24bf46=_0x24bf46||0xc8;return function(_0xab5e53){if(_0xab5e53){return _0x1b0ebc['status'](_0x24bf46)[_0x5320('0x1b')](_0xab5e53);}};}function respondWithFilteredResult(_0x5efc01,_0x18ac6b){return function(_0x52276c){if(_0x52276c){var _0x1e9a02=typeof _0x18ac6b[_0x5320('0x1c')]===_0x5320('0x1d')&&typeof _0x18ac6b[_0x5320('0x1e')]===_0x5320('0x1d');var _0x4f8466=_0x52276c[_0x5320('0x1f')];var _0x263dca=_0x1e9a02?0x0:_0x18ac6b[_0x5320('0x1c')];var _0x1c98c9=_0x1e9a02?_0x52276c[_0x5320('0x1f')]:_0x18ac6b[_0x5320('0x1c')]+_0x18ac6b[_0x5320('0x1e')];var _0x5b65c2;if(_0x1c98c9>=_0x4f8466){_0x1c98c9=_0x4f8466;_0x5b65c2=0xc8;}else{_0x5b65c2=0xce;}_0x5efc01['status'](_0x5b65c2);return _0x5efc01[_0x5320('0x20')](_0x5320('0x21'),_0x263dca+'-'+_0x1c98c9+'/'+_0x4f8466)[_0x5320('0x1b')](_0x52276c);}return null;};}function patchUpdates(_0x4d9e70){return function(_0x3e5ff0){try{jsonpatch['apply'](_0x3e5ff0,_0x4d9e70,!![]);}catch(_0x1fb23b){return BPromise['reject'](_0x1fb23b);}return _0x3e5ff0['save']();};}function saveUpdates(_0x5a8fa9,_0x437c45){return function(_0x46017f){if(_0x46017f){return _0x46017f['update'](_0x5a8fa9)[_0x5320('0x22')](function(_0x44b6a1){return _0x44b6a1;});}return null;};}function removeEntity(_0x2de09a,_0x5cf16d){return function(_0x50f799){if(_0x50f799){return _0x50f799['destroy']()[_0x5320('0x22')](function(){_0x2de09a[_0x5320('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x335125,_0x77f4a2){return function(_0x4b0d67){if(!_0x4b0d67){_0x335125[_0x5320('0x1a')](0x194);}return _0x4b0d67;};}function handleError(_0x374e19,_0xf162a3){_0xf162a3=_0xf162a3||0x1f4;return function(_0x61100a){logger[_0x5320('0x24')](_0x61100a[_0x5320('0x25')]);if(_0x61100a[_0x5320('0x26')]){delete _0x61100a[_0x5320('0x26')];}_0x374e19[_0x5320('0x23')](_0xf162a3)['send'](_0x61100a);};}exports[_0x5320('0x27')]=function(_0xe85920,_0x40a454){var _0x13b5a8={},_0x345970={},_0x3d6908={'count':0x0,'rows':[]};var _0x3e487e=_[_0x5320('0x28')](db['ServicenowAccount'][_0x5320('0x29')],function(_0x3fed72){return{'name':_0x3fed72[_0x5320('0x2a')],'type':_0x3fed72[_0x5320('0x2b')]['key']};});_0x345970[_0x5320('0x2c')]=_[_0x5320('0x28')](_0x3e487e,'name');_0x345970['query']=_[_0x5320('0x2d')](_0xe85920[_0x5320('0x2e')]);_0x345970['filters']=_[_0x5320('0x2f')](_0x345970[_0x5320('0x2c')],_0x345970['query']);_0x13b5a8['attributes']=_[_0x5320('0x2f')](_0x345970['model'],qs['fields'](_0xe85920['query'][_0x5320('0x30')]));_0x13b5a8[_0x5320('0x31')]=_0x13b5a8[_0x5320('0x31')][_0x5320('0x32')]?_0x13b5a8[_0x5320('0x31')]:_0x345970['model'];if(!_0xe85920[_0x5320('0x2e')][_0x5320('0x33')](_0x5320('0x34'))){_0x13b5a8['limit']=qs[_0x5320('0x1e')](_0xe85920[_0x5320('0x2e')][_0x5320('0x1e')]);_0x13b5a8[_0x5320('0x1c')]=qs[_0x5320('0x1c')](_0xe85920[_0x5320('0x2e')][_0x5320('0x1c')]);}_0x13b5a8[_0x5320('0x35')]=qs['sort'](_0xe85920[_0x5320('0x2e')][_0x5320('0x36')]);_0x13b5a8[_0x5320('0x37')]=qs[_0x5320('0x38')](_[_0x5320('0x39')](_0xe85920[_0x5320('0x2e')],_0x345970['filters']),_0x3e487e);if(_0xe85920[_0x5320('0x2e')][_0x5320('0x3a')]){_0x13b5a8['where']=_[_0x5320('0x3b')](_0x13b5a8[_0x5320('0x37')],{'$or':_[_0x5320('0x28')](_0x3e487e,function(_0x4c9424){if(_0x4c9424[_0x5320('0x2b')]!==_0x5320('0x3c')){var _0x502853={};_0x502853[_0x4c9424[_0x5320('0x26')]]={'$like':'%'+_0xe85920[_0x5320('0x2e')]['filter']+'%'};return _0x502853;}})});}_0x13b5a8=_[_0x5320('0x3b')]({},_0x13b5a8,_0xe85920[_0x5320('0x3d')]);var _0x1b697c={'where':_0x13b5a8[_0x5320('0x37')]};return db[_0x5320('0x3e')][_0x5320('0x1f')](_0x1b697c)[_0x5320('0x22')](function(_0x423c29){_0x3d6908[_0x5320('0x1f')]=_0x423c29;if(_0xe85920[_0x5320('0x2e')]['includeAll']){_0x13b5a8[_0x5320('0x3f')]=[{'all':!![]}];}return db[_0x5320('0x3e')][_0x5320('0x40')](_0x13b5a8);})[_0x5320('0x22')](function(_0x4ccbb9){_0x3d6908[_0x5320('0x41')]=_0x4ccbb9;return _0x3d6908;})[_0x5320('0x22')](respondWithFilteredResult(_0x40a454,_0x13b5a8))[_0x5320('0x42')](handleError(_0x40a454,null));};exports[_0x5320('0x43')]=function(_0x8be089,_0x3b2cff){var _0x5bc123={'raw':![],'where':{'id':_0x8be089[_0x5320('0x44')]['id']}},_0x5bdda1={};_0x5bdda1[_0x5320('0x2c')]=_[_0x5320('0x2d')](db[_0x5320('0x3e')][_0x5320('0x29')]);_0x5bdda1[_0x5320('0x2e')]=_['keys'](_0x8be089[_0x5320('0x2e')]);_0x5bdda1[_0x5320('0x38')]=_[_0x5320('0x2f')](_0x5bdda1[_0x5320('0x2c')],_0x5bdda1['query']);_0x5bc123[_0x5320('0x31')]=_[_0x5320('0x2f')](_0x5bdda1[_0x5320('0x2c')],qs['fields'](_0x8be089['query'][_0x5320('0x30')]));_0x5bc123[_0x5320('0x31')]=_0x5bc123[_0x5320('0x31')][_0x5320('0x32')]?_0x5bc123[_0x5320('0x31')]:_0x5bdda1['model'];if(_0x8be089[_0x5320('0x2e')][_0x5320('0x45')]){_0x5bc123['include']=[{'all':!![]}];}_0x5bc123=_['merge']({},_0x5bc123,_0x8be089[_0x5320('0x3d')]);return db[_0x5320('0x3e')][_0x5320('0x46')](_0x5bc123)[_0x5320('0x22')](handleEntityNotFound(_0x3b2cff,null))[_0x5320('0x22')](respondWithResult(_0x3b2cff,null))[_0x5320('0x42')](handleError(_0x3b2cff,null));};exports[_0x5320('0x47')]=function(_0x3b6b42,_0x2156e4){return db[_0x5320('0x3e')][_0x5320('0x47')](_0x3b6b42[_0x5320('0x48')],{})['then'](respondWithResult(_0x2156e4,0xc9))[_0x5320('0x42')](handleError(_0x2156e4,null));};exports['update']=function(_0xf8e7ee,_0x4bca39){if(_0xf8e7ee[_0x5320('0x48')]['id']){delete _0xf8e7ee[_0x5320('0x48')]['id'];}return db[_0x5320('0x3e')][_0x5320('0x46')]({'where':{'id':_0xf8e7ee[_0x5320('0x44')]['id']}})[_0x5320('0x22')](handleEntityNotFound(_0x4bca39,null))[_0x5320('0x22')](saveUpdates(_0xf8e7ee[_0x5320('0x48')],null))[_0x5320('0x22')](respondWithResult(_0x4bca39,null))[_0x5320('0x42')](handleError(_0x4bca39,null));};exports['destroy']=function(_0x258349,_0x162404){return db['ServicenowAccount'][_0x5320('0x46')]({'where':{'id':_0x258349['params']['id']}})['then'](handleEntityNotFound(_0x162404,null))[_0x5320('0x22')](removeEntity(_0x162404,null))['catch'](handleError(_0x162404,null));};exports[_0x5320('0x49')]=function(_0x535017,_0x83e758,_0x3bdc16){var _0x5756c6={};var _0xa63557={};var _0xf46c5d;var _0x41e8ce;return db[_0x5320('0x3e')]['findOne']({'where':{'id':_0x535017[_0x5320('0x44')]['id']}})[_0x5320('0x22')](handleEntityNotFound(_0x83e758,null))[_0x5320('0x22')](function(_0x3b5e17){if(_0x3b5e17){_0xf46c5d=_0x3b5e17;_0xa63557[_0x5320('0x2c')]=_[_0x5320('0x2d')](db[_0x5320('0x4a')][_0x5320('0x29')]);_0xa63557[_0x5320('0x2e')]=_['keys'](_0x535017['query']);_0xa63557[_0x5320('0x38')]=_[_0x5320('0x2f')](_0xa63557[_0x5320('0x2c')],_0xa63557['query']);_0x5756c6['attributes']=_[_0x5320('0x2f')](_0xa63557[_0x5320('0x2c')],qs[_0x5320('0x30')](_0x535017[_0x5320('0x2e')][_0x5320('0x30')]));_0x5756c6['attributes']=_0x5756c6[_0x5320('0x31')][_0x5320('0x32')]?_0x5756c6[_0x5320('0x31')]:_0xa63557[_0x5320('0x2c')];_0x5756c6[_0x5320('0x35')]=qs[_0x5320('0x36')](_0x535017['query'][_0x5320('0x36')]);_0x5756c6[_0x5320('0x37')]=qs[_0x5320('0x38')](_[_0x5320('0x39')](_0x535017[_0x5320('0x2e')],_0xa63557['filters']));if(_0x535017['query'][_0x5320('0x3a')]){_0x5756c6[_0x5320('0x37')]=_[_0x5320('0x3b')](_0x5756c6[_0x5320('0x37')],{'$or':_[_0x5320('0x28')](_0x5756c6['attributes'],function(_0x59c9f5){var _0x5846ab={};_0x5846ab[_0x59c9f5]={'$like':'%'+_0x535017[_0x5320('0x2e')][_0x5320('0x3a')]+'%'};return _0x5846ab;})});}_0x5756c6=_[_0x5320('0x3b')]({},_0x5756c6,_0x535017[_0x5320('0x3d')]);return _0xf46c5d[_0x5320('0x49')](_0x5756c6);}})[_0x5320('0x22')](function(_0x3425dd){if(_0x3425dd){_0x41e8ce=_0x3425dd[_0x5320('0x32')];if(!_0x535017[_0x5320('0x2e')][_0x5320('0x33')]('nolimit')){_0x5756c6[_0x5320('0x1e')]=qs[_0x5320('0x1e')](_0x535017[_0x5320('0x2e')][_0x5320('0x1e')]);_0x5756c6[_0x5320('0x1c')]=qs[_0x5320('0x1c')](_0x535017[_0x5320('0x2e')][_0x5320('0x1c')]);}return _0xf46c5d[_0x5320('0x49')](_0x5756c6);}})[_0x5320('0x22')](function(_0x81093d){if(_0x81093d){return _0x81093d?{'count':_0x41e8ce,'rows':_0x81093d}:null;}})['then'](respondWithResult(_0x83e758,null))[_0x5320('0x42')](handleError(_0x83e758,null));};exports['addConfiguration']=function(_0x11582d,_0x198e69,_0x128cd9){if(_0x11582d[_0x5320('0x48')]['id']){delete _0x11582d['body']['id'];}return db[_0x5320('0x3e')][_0x5320('0x4b')]({'where':{'id':_0x11582d[_0x5320('0x44')]['id']}})['then'](handleEntityNotFound(_0x198e69,null))[_0x5320('0x22')](function(_0x56768f){if(_0x56768f){_0x11582d[_0x5320('0x48')][_0x5320('0x4c')]=_0x56768f['id'];_0x11582d[_0x5320('0x48')][_0x5320('0x4d')]=integrations[_0x5320('0x4e')](_0x11582d[_0x5320('0x48')][_0x5320('0x4f')],_0x11582d[_0x5320('0x48')][_0x5320('0x2b')]);_0x11582d[_0x5320('0x48')]['Descriptions']=integrations[_0x5320('0x50')](_0x11582d[_0x5320('0x48')]['channel'],_0x11582d[_0x5320('0x48')]['type']);return db[_0x5320('0x4a')][_0x5320('0x47')](_0x11582d['body'],{'include':[{'model':db[_0x5320('0x51')],'as':_0x5320('0x4d')},{'model':db[_0x5320('0x51')],'as':_0x5320('0x52')}]});}return null;})[_0x5320('0x22')](respondWithResult(_0x198e69,null))[_0x5320('0x42')](handleError(_0x198e69,null));};exports['getFields']=function(_0x59440e,_0x503df9,_0x1e938a){var _0x310318=[_0x5320('0x53'),_0x5320('0x54'),'knowledge',_0x5320('0x55'),'close_code',_0x5320('0x56'),_0x5320('0x57'),_0x5320('0x58'),'category'];var _0x4dd89f=[_0x5320('0x59'),'made_sla','caused_by',_0x5320('0x5a'),_0x5320('0x5b'),_0x5320('0x5c'),_0x5320('0x5d'),_0x5320('0x54'),_0x5320('0x5e'),_0x5320('0x5f'),_0x5320('0x60'),_0x5320('0x61'),_0x5320('0x62'),'user_input',_0x5320('0x63'),_0x5320('0x64'),_0x5320('0x65'),_0x5320('0x66'),'knowledge',_0x5320('0x35'),'calendar_stc',_0x5320('0x67'),'cmdb_ci',_0x5320('0x68'),'impact','active',_0x5320('0x69'),'business_service',_0x5320('0x6a'),_0x5320('0x6b'),'rfc','time_worked',_0x5320('0x6c'),_0x5320('0x6d'),_0x5320('0x6e'),_0x5320('0x6f'),_0x5320('0x70'),_0x5320('0x71'),_0x5320('0x72'),'caller_id',_0x5320('0x73'),_0x5320('0x55'),_0x5320('0x74'),_0x5320('0x75'),'close_code',_0x5320('0x76'),_0x5320('0x77'),_0x5320('0x78'),_0x5320('0x79'),'business_stc',_0x5320('0x7a'),_0x5320('0x7b'),_0x5320('0x7c'),_0x5320('0x56'),'sys_class_name',_0x5320('0x7d'),_0x5320('0x7e'),_0x5320('0x7f'),_0x5320('0x80'),_0x5320('0x81'),_0x5320('0x82'),'reopened_by',_0x5320('0x57'),_0x5320('0x83'),_0x5320('0x84'),_0x5320('0x85'),_0x5320('0x86'),'activity_due',_0x5320('0x87'),_0x5320('0x58'),'comments',_0x5320('0x88'),'approval',_0x5320('0x89'),_0x5320('0x8a'),_0x5320('0x8b'),_0x5320('0x8c'),_0x5320('0x8d'),'escalation',_0x5320('0x8e'),_0x5320('0x8f'),_0x5320('0x90'),_0x5320('0x91')];var _0x4ed63b='';var _0xf2e382='';var _0x22c5b5=[];var _0x325ed7='';var _0x19cc5f='';var _0x2de0d8=[];var _0x467851='';var _0x533dd5='';var _0x48a754={};var _0x3217fe='';return db[_0x5320('0x3e')][_0x5320('0x4b')]({'where':{'id':_0x59440e['params']['id']},'attributes':['id','username','password',_0x5320('0x92'),_0x5320('0x93'),'serverUrl']})[_0x5320('0x22')](handleEntityNotFound(_0x503df9,null))[_0x5320('0x22')](function(_0x54ba91){if(_0x54ba91){_0x3217fe=_0x54ba91[_0x5320('0x93')];var _0x40520b=_0x3217fe['slice'](-0x1);if(_0x40520b==='/'){_0x3217fe=_0x3217fe['substring'](0x0,_0x3217fe['lastIndexOf'](_0x40520b));}_0x533dd5=util[_0x5320('0x94')](_0x5320('0x95'),_0x3217fe);_0x467851=util[_0x5320('0x94')](_0x5320('0x96'),_0x3217fe);_0x48a754={'user':_0x54ba91[_0x5320('0x97')],'pass':_0x54ba91[_0x5320('0x98')]};var _0x406f1c={'method':_0x5320('0x99'),'uri':_0x533dd5+'incident?sysparm_display_value=all','auth':_0x48a754,'json':!![]};return rp(_0x406f1c);}})[_0x5320('0x22')](function(_0x2fa907){if(_0x2fa907[_0x5320('0x9a')][_0x5320('0x32')]>0x0){_0x4ed63b=_0x2fa907[_0x5320('0x9a')];}console[_0x5320('0x9b')]('incident\x20table\x20objects',_0x4ed63b);_0x2de0d8=[];_0xf2e382=Object['assign']([],_0x4ed63b);_[_0x5320('0x9c')](_0xf2e382,function(_0x47891b){return!_0x310318[_0x5320('0x9d')](_0x47891b[_0x5320('0x26')]);});_0xf2e382[_0x5320('0x9e')](function(_0x4275d6){var _0x39692a=createFieldObject(_0x467851,_0x48a754,_0x4275d6[_0x5320('0x9f')],_0x4275d6[_0x5320('0x26')],_0x4275d6['label'],![]);_0x2de0d8[_0x5320('0xa0')](_0x39692a);});return Promise[_0x5320('0xa1')](_0x2de0d8);})['then'](function(_0x421c07){_0x22c5b5=_0x421c07;_0x325ed7=Object['assign']([],_0x4ed63b);console[_0x5320('0x9b')](_0x5320('0xa2'),_0x4ed63b);_[_0x5320('0x9c')](_0x325ed7,function(_0x1e3d50){return _0x4dd89f[_0x5320('0x9d')](_0x1e3d50[_0x5320('0x26')]);});console[_0x5320('0x9b')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x325ed7);_0x2de0d8=[];_0x325ed7[_0x5320('0x9e')](function(_0x56ee24){var _0xd588fd=createFieldObject(_0x467851,_0x48a754,_0x56ee24[_0x5320('0x9f')],_0x56ee24[_0x5320('0x26')],_0x56ee24['label'],!![]);_0x2de0d8['push'](_0xd588fd);});return Promise['all'](_0x2de0d8);})['then'](function(_0x535b48){_0x19cc5f=_0x535b48;var _0x29a439=_0x22c5b5[_0x5320('0xa3')](_0x19cc5f);return{'count':_0x29a439['length'],'rows':_0x29a439};})[_0x5320('0x22')](respondWithResult(_0x503df9,null))[_0x5320('0x42')](function(_0x5dcfe5){console[_0x5320('0x9b')](_0x5320('0xa4')+_0x5dcfe5);var _0x38245c=_0x59440e['query'][_0x5320('0xa5')]?0x1f4:_0x5dcfe5['statusCode']||0x1f4;logger[_0x5320('0x24')](_0x5dcfe5[_0x5320('0x25')]);delete _0x5dcfe5[_0x5320('0x26')];if(_0x38245c===0x191){_0x38245c=0x190;}_0x503df9['status'](_0x38245c)[_0x5320('0xa6')](_0x59440e['query']['test']?{'message':_0x5320('0xa7'),'statusCode':_0x5dcfe5[_0x5320('0xa8')]}:_0x5dcfe5);});};function createFieldObject(_0x4545e0,_0x178a7a,_0x126d07,_0xe056e1,_0x17c074,_0x1fc805){return new Promise(function(_0x4a34c4,_0x404590){var _0x5ba197={'id':_0xe056e1,'name':_0x17c074,'custom':_0x1fc805};if(_0x126d07===_0x5320('0xa9')){_0x5ba197['options']=[{'name':_0x5320('0xaa'),'value':_0x5320('0xab')},{'name':_0x5320('0xac'),'value':'false'}];_0x4a34c4(_0x5ba197);}else{var _0x168988={'method':_0x5320('0x99'),'uri':_0x4545e0+_0x5320('0xad')+_0xe056e1,'auth':_0x178a7a,'json':!![]};return rp(_0x168988)['then'](function(_0x3fbcc5){var _0x72dc79=[];if(_0x3fbcc5[_0x5320('0x9a')][_0x5320('0x32')]>0x0){_0x3fbcc5[_0x5320('0x9a')][_0x5320('0x9e')](function(_0x5cff5a){if(_0x5cff5a[_0x5320('0xae')]===_0x5320('0xaf')){var _0x246739={'name':_0x5cff5a[_0x5320('0xb0')],'value':_0x5cff5a[_0x5320('0xb1')]};_0x72dc79[_0x5320('0xa0')](_0x246739);}});}_0x5ba197['options']=_0x72dc79;if(_0x5ba197[_0x5320('0x3d')]['length']>0x0){_0x4a34c4(_0x5ba197);}else{if(_0x1fc805==![]){_0x4a34c4();}else{_0x4a34c4(_0x5ba197);}}});}});} \ No newline at end of file +var _0x97be=['TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','push','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','severity','parent','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','reopened_time','caller_id','short_description','correlation_display','assignment_group','additional_assignee_list','description','calendar_duration','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','approval','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','label','all','TCL:\x20_object','remove'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x97be,0xc6));var _0xe97b=function(_0x5d1a4b,_0x159c1c){_0x5d1a4b=_0x5d1a4b-0x0;var _0x443d37=_0x97be[_0x5d1a4b];return _0x443d37;};'use strict';var emlformat=require(_0xe97b('0x0'));var rimraf=require(_0xe97b('0x1'));var zipdir=require(_0xe97b('0x2'));var jsonpatch=require(_0xe97b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe97b('0x4'));var Mustache=require('mustache');var util=require(_0xe97b('0x5'));var path=require('path');var sox=require(_0xe97b('0x6'));var csv=require('to-csv');var ejs=require(_0xe97b('0x7'));var fs=require('fs');var fs_extra=require(_0xe97b('0x8'));var _=require(_0xe97b('0x9'));var squel=require('squel');var crypto=require(_0xe97b('0xa'));var jsforce=require(_0xe97b('0xb'));var deskjs=require(_0xe97b('0xc'));var toCsv=require(_0xe97b('0xd'));var querystring=require(_0xe97b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe97b('0xf'));var qs=require(_0xe97b('0x10'));var as=require(_0xe97b('0x11'));var hardwareService=require(_0xe97b('0x12'));var logger=require(_0xe97b('0x13'))('api');var utils=require(_0xe97b('0x14'));var config=require(_0xe97b('0x15'));var licenseUtil=require(_0xe97b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe97b('0x17'));function respondWithStatusCode(_0x3d0ebb,_0x21bba5){_0x21bba5=_0x21bba5||0xcc;return function(_0x1ca77c){if(_0x1ca77c){return _0x3d0ebb['sendStatus'](_0x21bba5);}return _0x3d0ebb[_0xe97b('0x18')](_0x21bba5)[_0xe97b('0x19')]();};}function respondWithResult(_0x163cc4,_0xcc365f){_0xcc365f=_0xcc365f||0xc8;return function(_0x3e08e6){if(_0x3e08e6){return _0x163cc4['status'](_0xcc365f)['json'](_0x3e08e6);}};}function respondWithFilteredResult(_0x5a3170,_0x25bed9){return function(_0x4ceaba){if(_0x4ceaba){var _0x79f207=typeof _0x25bed9[_0xe97b('0x1a')]===_0xe97b('0x1b')&&typeof _0x25bed9[_0xe97b('0x1c')]==='undefined';var _0x30e2b6=_0x4ceaba[_0xe97b('0x1d')];var _0x116ce6=_0x79f207?0x0:_0x25bed9[_0xe97b('0x1a')];var _0x57595f=_0x79f207?_0x4ceaba[_0xe97b('0x1d')]:_0x25bed9[_0xe97b('0x1a')]+_0x25bed9[_0xe97b('0x1c')];var _0x476b38;if(_0x57595f>=_0x30e2b6){_0x57595f=_0x30e2b6;_0x476b38=0xc8;}else{_0x476b38=0xce;}_0x5a3170[_0xe97b('0x18')](_0x476b38);return _0x5a3170[_0xe97b('0x1e')](_0xe97b('0x1f'),_0x116ce6+'-'+_0x57595f+'/'+_0x30e2b6)[_0xe97b('0x20')](_0x4ceaba);}return null;};}function patchUpdates(_0x58ec4f){return function(_0x54c504){try{jsonpatch[_0xe97b('0x21')](_0x54c504,_0x58ec4f,!![]);}catch(_0x193623){return BPromise[_0xe97b('0x22')](_0x193623);}return _0x54c504[_0xe97b('0x23')]();};}function saveUpdates(_0x2afc02,_0x2ab809){return function(_0x329114){if(_0x329114){return _0x329114[_0xe97b('0x24')](_0x2afc02)[_0xe97b('0x25')](function(_0x2dcb23){return _0x2dcb23;});}return null;};}function removeEntity(_0x1333a4,_0x335abd){return function(_0x34103b){if(_0x34103b){return _0x34103b['destroy']()[_0xe97b('0x25')](function(){_0x1333a4['status'](0xcc)[_0xe97b('0x19')]();});}};}function handleEntityNotFound(_0x735d11,_0x19f8c8){return function(_0x34a10f){if(!_0x34a10f){_0x735d11['sendStatus'](0x194);}return _0x34a10f;};}function handleError(_0x55aad9,_0x260577){_0x260577=_0x260577||0x1f4;return function(_0x53642e){logger[_0xe97b('0x26')](_0x53642e[_0xe97b('0x27')]);if(_0x53642e['name']){delete _0x53642e[_0xe97b('0x28')];}_0x55aad9[_0xe97b('0x18')](_0x260577)[_0xe97b('0x29')](_0x53642e);};}exports[_0xe97b('0x2a')]=function(_0x513bd3,_0x282d16){var _0x49e8a4={},_0x44ec72={},_0x48e4fc={'count':0x0,'rows':[]};var _0x55736b=_[_0xe97b('0x2b')](db[_0xe97b('0x2c')][_0xe97b('0x2d')],function(_0x545983){return{'name':_0x545983[_0xe97b('0x2e')],'type':_0x545983[_0xe97b('0x2f')][_0xe97b('0x30')]};});_0x44ec72[_0xe97b('0x31')]=_[_0xe97b('0x2b')](_0x55736b,_0xe97b('0x28'));_0x44ec72[_0xe97b('0x32')]=_['keys'](_0x513bd3['query']);_0x44ec72[_0xe97b('0x33')]=_[_0xe97b('0x34')](_0x44ec72[_0xe97b('0x31')],_0x44ec72[_0xe97b('0x32')]);_0x49e8a4['attributes']=_[_0xe97b('0x34')](_0x44ec72[_0xe97b('0x31')],qs[_0xe97b('0x35')](_0x513bd3['query'][_0xe97b('0x35')]));_0x49e8a4[_0xe97b('0x36')]=_0x49e8a4[_0xe97b('0x36')][_0xe97b('0x37')]?_0x49e8a4[_0xe97b('0x36')]:_0x44ec72[_0xe97b('0x31')];if(!_0x513bd3[_0xe97b('0x32')]['hasOwnProperty']('nolimit')){_0x49e8a4[_0xe97b('0x1c')]=qs[_0xe97b('0x1c')](_0x513bd3[_0xe97b('0x32')][_0xe97b('0x1c')]);_0x49e8a4[_0xe97b('0x1a')]=qs[_0xe97b('0x1a')](_0x513bd3[_0xe97b('0x32')]['offset']);}_0x49e8a4[_0xe97b('0x38')]=qs[_0xe97b('0x39')](_0x513bd3[_0xe97b('0x32')][_0xe97b('0x39')]);_0x49e8a4[_0xe97b('0x3a')]=qs[_0xe97b('0x33')](_[_0xe97b('0x3b')](_0x513bd3[_0xe97b('0x32')],_0x44ec72[_0xe97b('0x33')]),_0x55736b);if(_0x513bd3[_0xe97b('0x32')][_0xe97b('0x3c')]){_0x49e8a4[_0xe97b('0x3a')]=_[_0xe97b('0x3d')](_0x49e8a4[_0xe97b('0x3a')],{'$or':_[_0xe97b('0x2b')](_0x55736b,function(_0x42af50){if(_0x42af50['type']!==_0xe97b('0x3e')){var _0xd2e23={};_0xd2e23[_0x42af50['name']]={'$like':'%'+_0x513bd3['query'][_0xe97b('0x3c')]+'%'};return _0xd2e23;}})});}_0x49e8a4=_['merge']({},_0x49e8a4,_0x513bd3['options']);var _0x59228a={'where':_0x49e8a4['where']};return db[_0xe97b('0x2c')]['count'](_0x59228a)['then'](function(_0x3765be){_0x48e4fc[_0xe97b('0x1d')]=_0x3765be;if(_0x513bd3[_0xe97b('0x32')]['includeAll']){_0x49e8a4[_0xe97b('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xe97b('0x40')](_0x49e8a4);})[_0xe97b('0x25')](function(_0x43e0b8){_0x48e4fc[_0xe97b('0x41')]=_0x43e0b8;return _0x48e4fc;})[_0xe97b('0x25')](respondWithFilteredResult(_0x282d16,_0x49e8a4))[_0xe97b('0x42')](handleError(_0x282d16,null));};exports[_0xe97b('0x43')]=function(_0x15f107,_0x321797){var _0x49734d={'raw':![],'where':{'id':_0x15f107[_0xe97b('0x44')]['id']}},_0x259f70={};_0x259f70['model']=_['keys'](db['ServicenowAccount'][_0xe97b('0x2d')]);_0x259f70[_0xe97b('0x32')]=_[_0xe97b('0x45')](_0x15f107['query']);_0x259f70[_0xe97b('0x33')]=_[_0xe97b('0x34')](_0x259f70[_0xe97b('0x31')],_0x259f70[_0xe97b('0x32')]);_0x49734d[_0xe97b('0x36')]=_[_0xe97b('0x34')](_0x259f70[_0xe97b('0x31')],qs['fields'](_0x15f107[_0xe97b('0x32')][_0xe97b('0x35')]));_0x49734d[_0xe97b('0x36')]=_0x49734d['attributes'][_0xe97b('0x37')]?_0x49734d[_0xe97b('0x36')]:_0x259f70[_0xe97b('0x31')];if(_0x15f107[_0xe97b('0x32')][_0xe97b('0x46')]){_0x49734d[_0xe97b('0x3f')]=[{'all':!![]}];}_0x49734d=_[_0xe97b('0x3d')]({},_0x49734d,_0x15f107[_0xe97b('0x47')]);return db['ServicenowAccount']['find'](_0x49734d)['then'](handleEntityNotFound(_0x321797,null))[_0xe97b('0x25')](respondWithResult(_0x321797,null))[_0xe97b('0x42')](handleError(_0x321797,null));};exports[_0xe97b('0x48')]=function(_0x5cfebe,_0x2a484b){return db['ServicenowAccount'][_0xe97b('0x48')](_0x5cfebe[_0xe97b('0x49')],{})['then'](respondWithResult(_0x2a484b,0xc9))[_0xe97b('0x42')](handleError(_0x2a484b,null));};exports[_0xe97b('0x24')]=function(_0x3d5275,_0x253f5d){if(_0x3d5275['body']['id']){delete _0x3d5275[_0xe97b('0x49')]['id'];}return db[_0xe97b('0x2c')]['find']({'where':{'id':_0x3d5275[_0xe97b('0x44')]['id']}})['then'](handleEntityNotFound(_0x253f5d,null))[_0xe97b('0x25')](saveUpdates(_0x3d5275[_0xe97b('0x49')],null))[_0xe97b('0x25')](respondWithResult(_0x253f5d,null))[_0xe97b('0x42')](handleError(_0x253f5d,null));};exports[_0xe97b('0x4a')]=function(_0x3b7414,_0x279e45){return db[_0xe97b('0x2c')]['find']({'where':{'id':_0x3b7414['params']['id']}})[_0xe97b('0x25')](handleEntityNotFound(_0x279e45,null))['then'](removeEntity(_0x279e45,null))['catch'](handleError(_0x279e45,null));};exports[_0xe97b('0x4b')]=function(_0x50dbc8,_0x5b7327,_0x465c74){var _0x1697f6={};var _0x51cccb={};var _0x46926b;var _0x154dc6;return db['ServicenowAccount'][_0xe97b('0x4c')]({'where':{'id':_0x50dbc8[_0xe97b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b7327,null))[_0xe97b('0x25')](function(_0x584576){if(_0x584576){_0x46926b=_0x584576;_0x51cccb[_0xe97b('0x31')]=_[_0xe97b('0x45')](db['ServicenowConfiguration'][_0xe97b('0x2d')]);_0x51cccb[_0xe97b('0x32')]=_[_0xe97b('0x45')](_0x50dbc8[_0xe97b('0x32')]);_0x51cccb[_0xe97b('0x33')]=_[_0xe97b('0x34')](_0x51cccb['model'],_0x51cccb[_0xe97b('0x32')]);_0x1697f6[_0xe97b('0x36')]=_[_0xe97b('0x34')](_0x51cccb[_0xe97b('0x31')],qs[_0xe97b('0x35')](_0x50dbc8['query'][_0xe97b('0x35')]));_0x1697f6[_0xe97b('0x36')]=_0x1697f6[_0xe97b('0x36')]['length']?_0x1697f6[_0xe97b('0x36')]:_0x51cccb[_0xe97b('0x31')];_0x1697f6['order']=qs[_0xe97b('0x39')](_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x39')]);_0x1697f6[_0xe97b('0x3a')]=qs['filters'](_[_0xe97b('0x3b')](_0x50dbc8[_0xe97b('0x32')],_0x51cccb[_0xe97b('0x33')]));if(_0x50dbc8[_0xe97b('0x32')]['filter']){_0x1697f6[_0xe97b('0x3a')]=_[_0xe97b('0x3d')](_0x1697f6[_0xe97b('0x3a')],{'$or':_[_0xe97b('0x2b')](_0x1697f6['attributes'],function(_0x2a4f93){var _0x210c75={};_0x210c75[_0x2a4f93]={'$like':'%'+_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x3c')]+'%'};return _0x210c75;})});}_0x1697f6=_[_0xe97b('0x3d')]({},_0x1697f6,_0x50dbc8[_0xe97b('0x47')]);return _0x46926b[_0xe97b('0x4b')](_0x1697f6);}})[_0xe97b('0x25')](function(_0x29db96){if(_0x29db96){_0x154dc6=_0x29db96[_0xe97b('0x37')];if(!_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x4d')]('nolimit')){_0x1697f6['limit']=qs[_0xe97b('0x1c')](_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x1c')]);_0x1697f6['offset']=qs['offset'](_0x50dbc8[_0xe97b('0x32')][_0xe97b('0x1a')]);}return _0x46926b[_0xe97b('0x4b')](_0x1697f6);}})[_0xe97b('0x25')](function(_0x5b8160){if(_0x5b8160){return _0x5b8160?{'count':_0x154dc6,'rows':_0x5b8160}:null;}})[_0xe97b('0x25')](respondWithResult(_0x5b7327,null))[_0xe97b('0x42')](handleError(_0x5b7327,null));};exports[_0xe97b('0x4e')]=function(_0x10316c,_0x3e0aa4,_0x4f1631){if(_0x10316c[_0xe97b('0x49')]['id']){delete _0x10316c[_0xe97b('0x49')]['id'];}return db[_0xe97b('0x2c')][_0xe97b('0x4c')]({'where':{'id':_0x10316c[_0xe97b('0x44')]['id']}})[_0xe97b('0x25')](handleEntityNotFound(_0x3e0aa4,null))[_0xe97b('0x25')](function(_0x3758a6){if(_0x3758a6){_0x10316c[_0xe97b('0x49')][_0xe97b('0x4f')]=_0x3758a6['id'];_0x10316c[_0xe97b('0x49')][_0xe97b('0x50')]=integrations[_0xe97b('0x51')](_0x10316c[_0xe97b('0x49')][_0xe97b('0x52')],_0x10316c['body']['type']);_0x10316c[_0xe97b('0x49')][_0xe97b('0x53')]=integrations[_0xe97b('0x54')](_0x10316c[_0xe97b('0x49')][_0xe97b('0x52')],_0x10316c[_0xe97b('0x49')][_0xe97b('0x2f')]);return db['ServicenowConfiguration'][_0xe97b('0x48')](_0x10316c[_0xe97b('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0xe97b('0x50')},{'model':db[_0xe97b('0x55')],'as':_0xe97b('0x53')}]});}return null;})[_0xe97b('0x25')](respondWithResult(_0x3e0aa4,null))[_0xe97b('0x42')](handleError(_0x3e0aa4,null));};exports[_0xe97b('0x56')]=function(_0x94e062,_0x45acd9,_0x3b8c11){var _0x14a91b=[_0xe97b('0x57'),_0xe97b('0x58'),'knowledge',_0xe97b('0x59'),_0xe97b('0x5a'),'notify',_0xe97b('0x5b'),_0xe97b('0x5c'),'category'];var _0x1009c1=[_0xe97b('0x5d'),_0xe97b('0x57'),'caused_by','watch_list',_0xe97b('0x5e'),_0xe97b('0x5f'),_0xe97b('0x60'),_0xe97b('0x58'),_0xe97b('0x61'),_0xe97b('0x62'),_0xe97b('0x63'),_0xe97b('0x64'),'opened_by',_0xe97b('0x65'),'sys_created_on',_0xe97b('0x66'),'state',_0xe97b('0x67'),'knowledge',_0xe97b('0x38'),_0xe97b('0x68'),_0xe97b('0x69'),_0xe97b('0x6a'),_0xe97b('0x6b'),_0xe97b('0x6c'),_0xe97b('0x6d'),_0xe97b('0x6e'),_0xe97b('0x6f'),_0xe97b('0x70'),_0xe97b('0x71'),_0xe97b('0x72'),_0xe97b('0x73'),_0xe97b('0x74'),_0xe97b('0x75'),'business_duration',_0xe97b('0x76'),'work_end',_0xe97b('0x77'),'resolved_at',_0xe97b('0x78'),'approval_set',_0xe97b('0x59'),'work_notes',_0xe97b('0x79'),_0xe97b('0x5a'),_0xe97b('0x7a'),'delivery_task','work_start',_0xe97b('0x7b'),'business_stc',_0xe97b('0x7c'),_0xe97b('0x7d'),_0xe97b('0x7e'),'notify','sys_class_name',_0xe97b('0x7f'),_0xe97b('0x80'),'follow_up',_0xe97b('0x81'),_0xe97b('0x82'),_0xe97b('0x83'),_0xe97b('0x84'),_0xe97b('0x5b'),_0xe97b('0x85'),_0xe97b('0x86'),_0xe97b('0x87'),_0xe97b('0x88'),_0xe97b('0x89'),'assigned_to',_0xe97b('0x5c'),_0xe97b('0x8a'),'sla_due',_0xe97b('0x8b'),'comments_and_work_notes',_0xe97b('0x8c'),_0xe97b('0x8d'),_0xe97b('0x8e'),_0xe97b('0x8f'),'escalation',_0xe97b('0x90'),_0xe97b('0x91'),_0xe97b('0x92'),'category'];var _0x3b678d='';var _0x1feb92='';var _0x2dd3fa=[];var _0x46f7d2='';var _0x496a1d='';var _0x145505=[];var _0x473cd7='';var _0x1f288d='';var _0x3da186={};var _0x485a23='';return db[_0xe97b('0x2c')]['findOne']({'where':{'id':_0x94e062[_0xe97b('0x44')]['id']},'attributes':['id',_0xe97b('0x93'),_0xe97b('0x94'),_0xe97b('0x95'),_0xe97b('0x96'),_0xe97b('0x97')]})[_0xe97b('0x25')](handleEntityNotFound(_0x45acd9,null))[_0xe97b('0x25')](function(_0x1be4c4){if(_0x1be4c4){_0x485a23=_0x1be4c4[_0xe97b('0x96')];var _0x189367=_0x485a23['slice'](-0x1);if(_0x189367==='/'){_0x485a23=_0x485a23[_0xe97b('0x98')](0x0,_0x485a23[_0xe97b('0x99')](_0x189367));}_0x1f288d=util[_0xe97b('0x9a')](_0xe97b('0x9b'),_0x485a23);_0x473cd7=util[_0xe97b('0x9a')](_0xe97b('0x9c'),_0x485a23);_0x3da186={'user':_0x1be4c4['username'],'pass':_0x1be4c4[_0xe97b('0x94')]};var _0x57ed74={'method':'GET','uri':_0x1f288d+_0xe97b('0x9d'),'auth':_0x3da186,'json':!![]};return rp(_0x57ed74);}})['then'](function(_0xa44593){if(_0xa44593['result'][_0xe97b('0x37')]>0x0){_0x3b678d=_0xa44593[_0xe97b('0x9e')];}console[_0xe97b('0x9f')](_0xe97b('0xa0'),_0x3b678d);_0x145505=[];_0x1feb92=Object[_0xe97b('0xa1')]([],_0x3b678d);_['remove'](_0x1feb92,function(_0x1d723f){return!_0x14a91b[_0xe97b('0xa2')](_0x1d723f['name']);});_0x1feb92[_0xe97b('0xa3')](function(_0x4b9b0d){var _0xa6b973=createFieldObject(_0x473cd7,_0x3da186,_0x4b9b0d['internalType'],_0x4b9b0d[_0xe97b('0x28')],_0x4b9b0d[_0xe97b('0xa4')],![]);_0x145505['push'](_0xa6b973);});return Promise[_0xe97b('0xa5')](_0x145505);})[_0xe97b('0x25')](function(_0x327b85){_0x2dd3fa=_0x327b85;_0x46f7d2=Object[_0xe97b('0xa1')]([],_0x3b678d);console['log'](_0xe97b('0xa6'),_0x3b678d);_[_0xe97b('0xa7')](_0x46f7d2,function(_0x36dfd0){return _0x1009c1['includes'](_0x36dfd0[_0xe97b('0x28')]);});console['log'](_0xe97b('0xa8'),_0x46f7d2);_0x145505=[];_0x46f7d2['forEach'](function(_0x2ff6b2){var _0xf5406e=createFieldObject(_0x473cd7,_0x3da186,_0x2ff6b2[_0xe97b('0xa9')],_0x2ff6b2[_0xe97b('0x28')],_0x2ff6b2[_0xe97b('0xa4')],!![]);_0x145505[_0xe97b('0xaa')](_0xf5406e);});return Promise['all'](_0x145505);})['then'](function(_0x385f84){_0x496a1d=_0x385f84;var _0x10a2b6=_0x2dd3fa['concat'](_0x496a1d);return{'count':_0x10a2b6[_0xe97b('0x37')],'rows':_0x10a2b6};})['then'](respondWithResult(_0x45acd9,null))[_0xe97b('0x42')](function(_0x55f060){console['log'](_0xe97b('0xab')+_0x55f060);var _0x53648c=_0x94e062[_0xe97b('0x32')][_0xe97b('0xac')]?0x1f4:_0x55f060[_0xe97b('0xad')]||0x1f4;logger[_0xe97b('0x26')](_0x55f060[_0xe97b('0x27')]);delete _0x55f060[_0xe97b('0x28')];if(_0x53648c===0x191){_0x53648c=0x190;}_0x45acd9['status'](_0x53648c)['send'](_0x94e062['query'][_0xe97b('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x55f060['statusCode']}:_0x55f060);});};function createFieldObject(_0x325ea5,_0x4ed037,_0x382405,_0xf78009,_0x13bd51,_0x23647f){return new Promise(function(_0x49d7a0,_0x52c62d){var _0x34d826={'id':_0xf78009,'name':_0x13bd51,'custom':_0x23647f};if(_0x382405===_0xe97b('0xae')){_0x34d826[_0xe97b('0x47')]=[{'name':_0xe97b('0xaf'),'value':_0xe97b('0xb0')},{'name':_0xe97b('0xb1'),'value':_0xe97b('0xb2')}];_0x49d7a0(_0x34d826);}else{var _0x160717={'method':_0xe97b('0xb3'),'uri':_0x325ea5+_0xe97b('0xb4')+_0xf78009,'auth':_0x4ed037,'json':!![]};return rp(_0x160717)[_0xe97b('0x25')](function(_0x25a453){var _0x5f369d=[];if(_0x25a453['result'][_0xe97b('0x37')]>0x0){_0x25a453[_0xe97b('0x9e')][_0xe97b('0xa3')](function(_0x249ff3){if(_0x249ff3[_0xe97b('0xb5')]===_0xe97b('0xb2')){var _0x2882df={'name':_0x249ff3['label'],'value':_0x249ff3[_0xe97b('0xb6')]};_0x5f369d[_0xe97b('0xaa')](_0x2882df);}});}_0x34d826['options']=_0x5f369d;if(_0x34d826[_0xe97b('0x47')]['length']>0x0){_0x49d7a0(_0x34d826);}else{if(_0x23647f==![]){_0x49d7a0();}else{_0x49d7a0(_0x34d826);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 94e4e29..80cdcbb 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 _0x3eea=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x283413,_0x4b7911){_0x283413=_0x283413-0x0;var _0x398348=_0x3eea[_0x283413];return _0x398348;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));var integrations=require(_0xa3ee('0xa'));module[_0xa3ee('0xb')]=function(_0x5776bb,_0x538bf9){return _0x5776bb[_0xa3ee('0xc')]('ServicenowAccount',attributes,{'tableName':_0xa3ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x5358cd,_0x3e94d4){var _0xe31351=function(_0x259d92){while(--_0x259d92){_0x5358cd['push'](_0x5358cd['shift']());}};_0xe31351(++_0x3e94d4);}(_0xd8fb,0x99));var _0xbd8f=function(_0x50e42c,_0x2e6839){_0x50e42c=_0x50e42c-0x0;var _0x22b944=_0xd8fb[_0x50e42c];return _0x22b944;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index b3f97eb..c7cfe31 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 _0xb97b=['ServicenowAccount','findAll','options','raw','attributes','limit','map','include','model','debug','stringify','ShowServicenowAccount','where','lodash','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','GetServicenowAccount'];(function(_0x2915c4,_0x562595){var _0x250ba5=function(_0x57928d){while(--_0x57928d){_0x2915c4['push'](_0x2915c4['shift']());}};_0x250ba5(++_0x562595);}(_0xb97b,0x178));var _0xbb97=function(_0x37b936,_0x5ecb7e){_0x37b936=_0x37b936-0x0;var _0x39c20f=_0xb97b[_0x37b936];return _0x39c20f;};'use strict';var _=require(_0xbb97('0x0'));var util=require('util');var moment=require(_0xbb97('0x1'));var BPromise=require(_0xbb97('0x2'));var rs=require(_0xbb97('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb97('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbb97('0x5'));var jayson=require(_0xbb97('0x6'));var client=jayson[_0xbb97('0x7')][_0xbb97('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x337228,_0x491396,_0x13ec38){return new BPromise(function(_0x3fd4b1,_0x865d16){return client[_0xbb97('0x9')](_0x337228,_0x13ec38)[_0xbb97('0xa')](function(_0x27ffc2){logger[_0xbb97('0xb')](_0xbb97('0xc'),_0x491396,'request\x20sent');logger['debug'](_0xbb97('0xd'),_0x491396,'request\x20sent',JSON['stringify'](_0x27ffc2));if(_0x27ffc2[_0xbb97('0xe')]){if(_0x27ffc2[_0xbb97('0xe')][_0xbb97('0xf')]===0x1f4){logger[_0xbb97('0xe')](_0xbb97('0xc'),_0x491396,_0x27ffc2[_0xbb97('0xe')]['message']);return _0x865d16(_0x27ffc2[_0xbb97('0xe')][_0xbb97('0x10')]);}logger[_0xbb97('0xe')](_0xbb97('0xc'),_0x491396,_0x27ffc2[_0xbb97('0xe')][_0xbb97('0x10')]);return _0x3fd4b1(_0x27ffc2['error'][_0xbb97('0x10')]);}else{logger[_0xbb97('0xb')](_0xbb97('0xc'),_0x491396,_0xbb97('0x11'));_0x3fd4b1(_0x27ffc2['result']['message']);}})[_0xbb97('0x12')](function(_0x4b2354){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x491396,_0x4b2354);_0x865d16(_0x4b2354);});});}exports[_0xbb97('0x13')]=function(_0xa55702){var _0x3b6b51=this;return new Promise(function(_0x4d7bde,_0x559708){return db[_0xbb97('0x14')][_0xbb97('0x15')]({'raw':_0xa55702['options']?_0xa55702[_0xbb97('0x16')][_0xbb97('0x17')]===undefined?!![]:![]:!![],'where':_0xa55702[_0xbb97('0x16')]?_0xa55702[_0xbb97('0x16')]['where']||null:null,'attributes':_0xa55702[_0xbb97('0x16')]?_0xa55702[_0xbb97('0x16')][_0xbb97('0x18')]||null:null,'limit':_0xa55702['options']?_0xa55702[_0xbb97('0x16')][_0xbb97('0x19')]||null:null,'include':_0xa55702[_0xbb97('0x16')]?_0xa55702[_0xbb97('0x16')]['include']?_[_0xbb97('0x1a')](_0xa55702[_0xbb97('0x16')][_0xbb97('0x1b')],function(_0x28c7d8){return{'model':db[_0x28c7d8['model']],'as':_0x28c7d8['as'],'attributes':_0x28c7d8[_0xbb97('0x18')],'include':_0x28c7d8[_0xbb97('0x1b')]?_[_0xbb97('0x1a')](_0x28c7d8['include'],function(_0x12fb33){return{'model':db[_0x12fb33['model']],'as':_0x12fb33['as'],'attributes':_0x12fb33[_0xbb97('0x18')],'include':_0x12fb33['include']?_['map'](_0x12fb33[_0xbb97('0x1b')],function(_0x12da99){return{'model':db[_0x12da99[_0xbb97('0x1c')]],'as':_0x12da99['as'],'attributes':_0x12da99['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb97('0xa')](function(_0x2bc81d){logger[_0xbb97('0xb')](_0xbb97('0x13'),_0xa55702);logger[_0xbb97('0x1d')](_0xbb97('0x13'),_0xa55702,JSON[_0xbb97('0x1e')](_0x2bc81d));_0x4d7bde(_0x2bc81d);})[_0xbb97('0x12')](function(_0x57dc5c){logger['error'](_0xbb97('0x13'),_0x57dc5c[_0xbb97('0x10')],_0xa55702);_0x559708(_0x3b6b51['error'](0x1f4,_0x57dc5c[_0xbb97('0x10')]));});});};exports[_0xbb97('0x1f')]=function(_0x554105){var _0xab74d0=this;return new Promise(function(_0x722491,_0x1ebb75){return db[_0xbb97('0x14')]['find']({'raw':_0x554105[_0xbb97('0x16')]?_0x554105[_0xbb97('0x16')][_0xbb97('0x17')]===undefined?!![]:![]:!![],'where':_0x554105['options']?_0x554105[_0xbb97('0x16')][_0xbb97('0x20')]||null:null,'attributes':_0x554105['options']?_0x554105[_0xbb97('0x16')][_0xbb97('0x18')]||null:null,'include':_0x554105[_0xbb97('0x16')]?_0x554105['options'][_0xbb97('0x1b')]?_[_0xbb97('0x1a')](_0x554105[_0xbb97('0x16')][_0xbb97('0x1b')],function(_0x2bb2ab){return{'model':db[_0x2bb2ab[_0xbb97('0x1c')]],'as':_0x2bb2ab['as'],'attributes':_0x2bb2ab[_0xbb97('0x18')],'include':_0x2bb2ab['include']?_[_0xbb97('0x1a')](_0x2bb2ab['include'],function(_0x2b4cff){return{'model':db[_0x2b4cff[_0xbb97('0x1c')]],'as':_0x2b4cff['as'],'attributes':_0x2b4cff[_0xbb97('0x18')],'include':_0x2b4cff[_0xbb97('0x1b')]?_[_0xbb97('0x1a')](_0x2b4cff[_0xbb97('0x1b')],function(_0x48a69b){return{'model':db[_0x48a69b[_0xbb97('0x1c')]],'as':_0x48a69b['as'],'attributes':_0x48a69b[_0xbb97('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbb97('0xa')](function(_0x30977d){logger[_0xbb97('0xb')](_0xbb97('0x1f'),_0x554105);logger[_0xbb97('0x1d')](_0xbb97('0x1f'),_0x554105,JSON[_0xbb97('0x1e')](_0x30977d));_0x722491(_0x30977d);})[_0xbb97('0x12')](function(_0x5ca7be){logger['error'](_0xbb97('0x1f'),_0x5ca7be[_0xbb97('0x10')],_0x554105);_0x1ebb75(_0xab74d0[_0xbb97('0xe')](0x1f4,_0x5ca7be[_0xbb97('0x10')]));});});}; \ No newline at end of file +var _0xf55f=['options','raw','where','limit','include','model','attributes','map','then','find','ShowServicenowAccount','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x3f506a,_0x535543){var _0x563580=function(_0x4eca33){while(--_0x4eca33){_0x3f506a['push'](_0x3f506a['shift']());}};_0x563580(++_0x535543);}(_0xf55f,0xc4));var _0xff55=function(_0x4e2272,_0x2e1ae0){_0x4e2272=_0x4e2272-0x0;var _0x45511c=_0xf55f[_0x4e2272];return _0x45511c;};'use strict';var _=require(_0xff55('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xff55('0x1'));var fs=require('fs');var Redis=require(_0xff55('0x2'));var db=require(_0xff55('0x3'))['db'];var utils=require(_0xff55('0x4'));var logger=require(_0xff55('0x5'))(_0xff55('0x6'));var config=require(_0xff55('0x7'));var jayson=require(_0xff55('0x8'));var client=jayson[_0xff55('0x9')][_0xff55('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47845d,_0x4b2f0c,_0x374305){return new BPromise(function(_0xd1629e,_0x88255d){return client[_0xff55('0xb')](_0x47845d,_0x374305)['then'](function(_0x39367d){logger[_0xff55('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x4b2f0c,_0xff55('0xd'));logger[_0xff55('0xe')](_0xff55('0xf'),_0x4b2f0c,'request\x20sent',JSON[_0xff55('0x10')](_0x39367d));if(_0x39367d['error']){if(_0x39367d[_0xff55('0x11')][_0xff55('0x12')]===0x1f4){logger[_0xff55('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x4b2f0c,_0x39367d[_0xff55('0x11')]['message']);return _0x88255d(_0x39367d['error'][_0xff55('0x13')]);}logger[_0xff55('0x11')](_0xff55('0x14'),_0x4b2f0c,_0x39367d[_0xff55('0x11')][_0xff55('0x13')]);return _0xd1629e(_0x39367d[_0xff55('0x11')][_0xff55('0x13')]);}else{logger[_0xff55('0xc')](_0xff55('0x14'),_0x4b2f0c,_0xff55('0xd'));_0xd1629e(_0x39367d[_0xff55('0x15')][_0xff55('0x13')]);}})[_0xff55('0x16')](function(_0x286d73){logger[_0xff55('0x11')](_0xff55('0x14'),_0x4b2f0c,_0x286d73);_0x88255d(_0x286d73);});});}exports[_0xff55('0x17')]=function(_0x3ebafb){var _0x2ce12e=this;return new Promise(function(_0x5d0c95,_0x425ee6){return db[_0xff55('0x18')][_0xff55('0x19')]({'raw':_0x3ebafb[_0xff55('0x1a')]?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ebafb['options']?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1c')]||null:null,'attributes':_0x3ebafb[_0xff55('0x1a')]?_0x3ebafb[_0xff55('0x1a')]['attributes']||null:null,'limit':_0x3ebafb[_0xff55('0x1a')]?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1d')]||null:null,'include':_0x3ebafb['options']?_0x3ebafb[_0xff55('0x1a')][_0xff55('0x1e')]?_['map'](_0x3ebafb['options'][_0xff55('0x1e')],function(_0x144bc8){return{'model':db[_0x144bc8[_0xff55('0x1f')]],'as':_0x144bc8['as'],'attributes':_0x144bc8[_0xff55('0x20')],'include':_0x144bc8[_0xff55('0x1e')]?_[_0xff55('0x21')](_0x144bc8[_0xff55('0x1e')],function(_0x169241){return{'model':db[_0x169241['model']],'as':_0x169241['as'],'attributes':_0x169241[_0xff55('0x20')],'include':_0x169241[_0xff55('0x1e')]?_[_0xff55('0x21')](_0x169241[_0xff55('0x1e')],function(_0x271d1b){return{'model':db[_0x271d1b[_0xff55('0x1f')]],'as':_0x271d1b['as'],'attributes':_0x271d1b[_0xff55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff55('0x22')](function(_0x30946d){logger['info']('GetServicenowAccount',_0x3ebafb);logger[_0xff55('0xe')](_0xff55('0x17'),_0x3ebafb,JSON[_0xff55('0x10')](_0x30946d));_0x5d0c95(_0x30946d);})[_0xff55('0x16')](function(_0x37d2e3){logger[_0xff55('0x11')](_0xff55('0x17'),_0x37d2e3['message'],_0x3ebafb);_0x425ee6(_0x2ce12e[_0xff55('0x11')](0x1f4,_0x37d2e3[_0xff55('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x43a21a){var _0xb2a9d0=this;return new Promise(function(_0x1f637c,_0x22f1a9){return db[_0xff55('0x18')][_0xff55('0x23')]({'raw':_0x43a21a[_0xff55('0x1a')]?_0x43a21a[_0xff55('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x43a21a['options']?_0x43a21a[_0xff55('0x1a')]['where']||null:null,'attributes':_0x43a21a[_0xff55('0x1a')]?_0x43a21a[_0xff55('0x1a')][_0xff55('0x20')]||null:null,'include':_0x43a21a[_0xff55('0x1a')]?_0x43a21a[_0xff55('0x1a')][_0xff55('0x1e')]?_['map'](_0x43a21a[_0xff55('0x1a')]['include'],function(_0x4eb1aa){return{'model':db[_0x4eb1aa[_0xff55('0x1f')]],'as':_0x4eb1aa['as'],'attributes':_0x4eb1aa[_0xff55('0x20')],'include':_0x4eb1aa['include']?_[_0xff55('0x21')](_0x4eb1aa[_0xff55('0x1e')],function(_0x5954fc){return{'model':db[_0x5954fc['model']],'as':_0x5954fc['as'],'attributes':_0x5954fc[_0xff55('0x20')],'include':_0x5954fc[_0xff55('0x1e')]?_['map'](_0x5954fc['include'],function(_0x1a16d3){return{'model':db[_0x1a16d3[_0xff55('0x1f')]],'as':_0x1a16d3['as'],'attributes':_0x1a16d3[_0xff55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff55('0x22')](function(_0x5860ed){logger['info'](_0xff55('0x24'),_0x43a21a);logger[_0xff55('0xe')](_0xff55('0x24'),_0x43a21a,JSON[_0xff55('0x10')](_0x5860ed));_0x1f637c(_0x5860ed);})[_0xff55('0x16')](function(_0x3c4bc2){logger[_0xff55('0x11')]('ShowServicenowAccount',_0x3c4bc2[_0xff55('0x13')],_0x43a21a);_0x22f1a9(_0xb2a9d0[_0xff55('0x11')](0x1f4,_0x3c4bc2[_0xff55('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f71248a..a30bd42 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 _0x64c6=['destroy','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create'];(function(_0x54def5,_0x4b0d6d){var _0x3e5568=function(_0x355243){while(--_0x355243){_0x54def5['push'](_0x54def5['shift']());}};_0x3e5568(++_0x4b0d6d);}(_0x64c6,0x181));var _0x664c=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x64c6[_0x290fa6];return _0x47f1f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x664c('0x0'));var timeout=require(_0x664c('0x1'));var express=require(_0x664c('0x2'));var router=express[_0x664c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x664c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x664c('0x5')](),controller[_0x664c('0x6')]);router[_0x664c('0x7')](_0x664c('0x8'),auth['isAuthenticated'](),controller[_0x664c('0x9')]);router[_0x664c('0x7')]('/:id/fields',auth[_0x664c('0x5')](),controller['getFields']);router[_0x664c('0x7')](_0x664c('0xa'),auth[_0x664c('0x5')](),controller[_0x664c('0xb')]);router[_0x664c('0x7')](_0x664c('0xc'),auth[_0x664c('0x5')](),controller[_0x664c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x664c('0xe')]);router['put'](_0x664c('0x8'),auth[_0x664c('0x5')](),controller['update']);router['delete'](_0x664c('0x8'),auth[_0x664c('0x5')](),controller[_0x664c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x753c=['isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','post','create','/:id','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x753c,0x15f));var _0xc753=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x753c[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xc753('0x0'));var path=require(_0xc753('0x1'));var timeout=require(_0xc753('0x2'));var express=require(_0xc753('0x3'));var router=express[_0xc753('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc753('0x5'));var interaction=require(_0xc753('0x6'));var config=require(_0xc753('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xc753('0x8')]('/',auth[_0xc753('0x9')](),controller[_0xc753('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc753('0xb')]);router[_0xc753('0x8')]('/:id/fields',auth[_0xc753('0x9')](),controller[_0xc753('0xc')]);router[_0xc753('0x8')](_0xc753('0xd'),auth['isAuthenticated'](),controller[_0xc753('0xe')]);router[_0xc753('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc753('0xf')]('/',auth[_0xc753('0x9')](),controller[_0xc753('0x10')]);router['put'](_0xc753('0x11'),auth[_0xc753('0x9')](),controller[_0xc753('0x12')]);router['delete'](_0xc753('0x11'),auth[_0xc753('0x9')](),controller['destroy']);module[_0xc753('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index cc1cf35..8804b67 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 _0xe849=['STRING','sequelize','exports'];(function(_0x3b2255,_0x588ab8){var _0x9a21ba=function(_0x53b112){while(--_0x53b112){_0x3b2255['push'](_0x3b2255['shift']());}};_0x9a21ba(++_0x588ab8);}(_0xe849,0xaf));var _0x9e84=function(_0x1f338e,_0x39837a){_0x1f338e=_0x1f338e-0x0;var _0x22a788=_0xe849[_0x1f338e];return _0x22a788;};'use strict';var Sequelize=require(_0x9e84('0x0'));module[_0x9e84('0x1')]={'name':{'type':Sequelize[_0x9e84('0x2')]},'description':{'type':Sequelize[_0x9e84('0x2')]}}; \ No newline at end of file +var _0x1c4d=['exports','STRING','sequelize'];(function(_0x2d2746,_0xaac75f){var _0x1735f7=function(_0x57b441){while(--_0x57b441){_0x2d2746['push'](_0x2d2746['shift']());}};_0x1735f7(++_0xaac75f);}(_0x1c4d,0x197));var _0xd1c4=function(_0x3f2f63,_0x339ed8){_0x3f2f63=_0x3f2f63-0x0;var _0x4c5fd9=_0x1c4d[_0x3f2f63];return _0x4c5fd9;};'use strict';var Sequelize=require(_0xd1c4('0x0'));module[_0xd1c4('0x1')]={'name':{'type':Sequelize[_0xd1c4('0x2')]},'description':{'type':Sequelize[_0xd1c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 3bff5c5..946e896 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 _0x370e=['rows','show','params','includeAll','catch','create','update','body','find','getFields','findOne','ServicenowField','length','sort','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll'];(function(_0x580862,_0x431508){var _0x28caa3=function(_0x229bc7){while(--_0x229bc7){_0x580862['push'](_0x580862['shift']());}};_0x28caa3(++_0x431508);}(_0x370e,0x10a));var _0xe370=function(_0x49bebb,_0xfe2353){_0x49bebb=_0x49bebb-0x0;var _0x3d6f9a=_0x370e[_0x49bebb];return _0x3d6f9a;};'use strict';var emlformat=require(_0xe370('0x0'));var rimraf=require(_0xe370('0x1'));var zipdir=require(_0xe370('0x2'));var jsonpatch=require(_0xe370('0x3'));var rp=require(_0xe370('0x4'));var moment=require(_0xe370('0x5'));var BPromise=require(_0xe370('0x6'));var Mustache=require(_0xe370('0x7'));var util=require('util');var path=require(_0xe370('0x8'));var sox=require(_0xe370('0x9'));var csv=require(_0xe370('0xa'));var ejs=require(_0xe370('0xb'));var fs=require('fs');var fs_extra=require(_0xe370('0xc'));var _=require(_0xe370('0xd'));var squel=require(_0xe370('0xe'));var crypto=require(_0xe370('0xf'));var jsforce=require(_0xe370('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe370('0x11'));var Papa=require('papaparse');var Redis=require(_0xe370('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe370('0x13'));var as=require(_0xe370('0x14'));var hardwareService=require(_0xe370('0x15'));var logger=require(_0xe370('0x16'))(_0xe370('0x17'));var utils=require(_0xe370('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe370('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe8c25b,_0x1edd73){_0x1edd73=_0x1edd73||0xcc;return function(_0x32301f){if(_0x32301f){return _0xe8c25b[_0xe370('0x1a')](_0x1edd73);}return _0xe8c25b[_0xe370('0x1b')](_0x1edd73)[_0xe370('0x1c')]();};}function respondWithResult(_0x6b5517,_0x54cafb){_0x54cafb=_0x54cafb||0xc8;return function(_0x2584f8){if(_0x2584f8){return _0x6b5517[_0xe370('0x1b')](_0x54cafb)['json'](_0x2584f8);}};}function respondWithFilteredResult(_0x2dfed0,_0x4aa1cf){return function(_0x297da6){if(_0x297da6){var _0x56eac1=typeof _0x4aa1cf['offset']===_0xe370('0x1d')&&typeof _0x4aa1cf[_0xe370('0x1e')]===_0xe370('0x1d');var _0x39682b=_0x297da6[_0xe370('0x1f')];var _0x1d84de=_0x56eac1?0x0:_0x4aa1cf['offset'];var _0xb5010=_0x56eac1?_0x297da6[_0xe370('0x1f')]:_0x4aa1cf[_0xe370('0x20')]+_0x4aa1cf[_0xe370('0x1e')];var _0x5cd81d;if(_0xb5010>=_0x39682b){_0xb5010=_0x39682b;_0x5cd81d=0xc8;}else{_0x5cd81d=0xce;}_0x2dfed0['status'](_0x5cd81d);return _0x2dfed0[_0xe370('0x21')](_0xe370('0x22'),_0x1d84de+'-'+_0xb5010+'/'+_0x39682b)[_0xe370('0x23')](_0x297da6);}return null;};}function patchUpdates(_0x66b8c1){return function(_0x3d7a7e){try{jsonpatch[_0xe370('0x24')](_0x3d7a7e,_0x66b8c1,!![]);}catch(_0x379887){return BPromise['reject'](_0x379887);}return _0x3d7a7e['save']();};}function saveUpdates(_0x33b2f4,_0x51195b){return function(_0x44a1f5){if(_0x44a1f5){return _0x44a1f5['update'](_0x33b2f4)[_0xe370('0x25')](function(_0x1a39c2){return _0x1a39c2;});}return null;};}function removeEntity(_0x48f8db,_0x1490e6){return function(_0xb1095b){if(_0xb1095b){return _0xb1095b[_0xe370('0x26')]()[_0xe370('0x25')](function(){_0x48f8db[_0xe370('0x1b')](0xcc)[_0xe370('0x1c')]();});}};}function handleEntityNotFound(_0x306989,_0xc27248){return function(_0x3b80fb){if(!_0x3b80fb){_0x306989[_0xe370('0x1a')](0x194);}return _0x3b80fb;};}function handleError(_0x612b8c,_0x24d182){_0x24d182=_0x24d182||0x1f4;return function(_0x431900){logger[_0xe370('0x27')](_0x431900[_0xe370('0x28')]);if(_0x431900[_0xe370('0x29')]){delete _0x431900[_0xe370('0x29')];}_0x612b8c[_0xe370('0x1b')](_0x24d182)[_0xe370('0x2a')](_0x431900);};}exports[_0xe370('0x2b')]=function(_0x327724,_0x4688d1){var _0xfdc9e2={},_0x534a63={},_0x51dc9b={'count':0x0,'rows':[]};var _0x475136=_['map'](db[_0xe370('0x2c')][_0xe370('0x2d')],function(_0x5473c9){return{'name':_0x5473c9[_0xe370('0x2e')],'type':_0x5473c9[_0xe370('0x2f')]['key']};});_0x534a63['model']=_[_0xe370('0x30')](_0x475136,'name');_0x534a63[_0xe370('0x31')]=_[_0xe370('0x32')](_0x327724[_0xe370('0x31')]);_0x534a63[_0xe370('0x33')]=_[_0xe370('0x34')](_0x534a63[_0xe370('0x35')],_0x534a63[_0xe370('0x31')]);_0xfdc9e2[_0xe370('0x36')]=_[_0xe370('0x34')](_0x534a63[_0xe370('0x35')],qs[_0xe370('0x37')](_0x327724[_0xe370('0x31')][_0xe370('0x37')]));_0xfdc9e2['attributes']=_0xfdc9e2[_0xe370('0x36')]['length']?_0xfdc9e2[_0xe370('0x36')]:_0x534a63[_0xe370('0x35')];if(!_0x327724[_0xe370('0x31')]['hasOwnProperty'](_0xe370('0x38'))){_0xfdc9e2[_0xe370('0x1e')]=qs['limit'](_0x327724[_0xe370('0x31')]['limit']);_0xfdc9e2[_0xe370('0x20')]=qs[_0xe370('0x20')](_0x327724[_0xe370('0x31')]['offset']);}_0xfdc9e2[_0xe370('0x39')]=qs['sort'](_0x327724[_0xe370('0x31')]['sort']);_0xfdc9e2[_0xe370('0x3a')]=qs[_0xe370('0x33')](_[_0xe370('0x3b')](_0x327724['query'],_0x534a63[_0xe370('0x33')]),_0x475136);if(_0x327724[_0xe370('0x31')][_0xe370('0x3c')]){_0xfdc9e2[_0xe370('0x3a')]=_['merge'](_0xfdc9e2[_0xe370('0x3a')],{'$or':_['map'](_0x475136,function(_0x3601d1){if(_0x3601d1[_0xe370('0x2f')]!==_0xe370('0x3d')){var _0x1102ce={};_0x1102ce[_0x3601d1['name']]={'$like':'%'+_0x327724[_0xe370('0x31')][_0xe370('0x3c')]+'%'};return _0x1102ce;}})});}_0xfdc9e2=_[_0xe370('0x3e')]({},_0xfdc9e2,_0x327724[_0xe370('0x3f')]);var _0x357ddb={'where':_0xfdc9e2[_0xe370('0x3a')]};return db[_0xe370('0x2c')][_0xe370('0x1f')](_0x357ddb)[_0xe370('0x25')](function(_0x4346fa){_0x51dc9b[_0xe370('0x1f')]=_0x4346fa;if(_0x327724[_0xe370('0x31')]['includeAll']){_0xfdc9e2[_0xe370('0x40')]=[{'all':!![]}];}return db[_0xe370('0x2c')][_0xe370('0x41')](_0xfdc9e2);})[_0xe370('0x25')](function(_0x1f8e53){_0x51dc9b[_0xe370('0x42')]=_0x1f8e53;return _0x51dc9b;})['then'](respondWithFilteredResult(_0x4688d1,_0xfdc9e2))['catch'](handleError(_0x4688d1,null));};exports[_0xe370('0x43')]=function(_0x8bb364,_0x181f7d){var _0x3402a3={'raw':![],'where':{'id':_0x8bb364[_0xe370('0x44')]['id']}},_0x199851={};_0x199851['model']=_[_0xe370('0x32')](db[_0xe370('0x2c')][_0xe370('0x2d')]);_0x199851['query']=_['keys'](_0x8bb364[_0xe370('0x31')]);_0x199851[_0xe370('0x33')]=_[_0xe370('0x34')](_0x199851[_0xe370('0x35')],_0x199851[_0xe370('0x31')]);_0x3402a3[_0xe370('0x36')]=_[_0xe370('0x34')](_0x199851['model'],qs[_0xe370('0x37')](_0x8bb364['query'][_0xe370('0x37')]));_0x3402a3[_0xe370('0x36')]=_0x3402a3[_0xe370('0x36')]['length']?_0x3402a3[_0xe370('0x36')]:_0x199851[_0xe370('0x35')];if(_0x8bb364[_0xe370('0x31')][_0xe370('0x45')]){_0x3402a3[_0xe370('0x40')]=[{'all':!![]}];}_0x3402a3=_[_0xe370('0x3e')]({},_0x3402a3,_0x8bb364[_0xe370('0x3f')]);return db[_0xe370('0x2c')]['find'](_0x3402a3)[_0xe370('0x25')](handleEntityNotFound(_0x181f7d,null))[_0xe370('0x25')](respondWithResult(_0x181f7d,null))[_0xe370('0x46')](handleError(_0x181f7d,null));};exports[_0xe370('0x47')]=function(_0x104d7c,_0x37ade6){return db[_0xe370('0x2c')][_0xe370('0x47')](_0x104d7c['body'],{})[_0xe370('0x25')](respondWithResult(_0x37ade6,0xc9))[_0xe370('0x46')](handleError(_0x37ade6,null));};exports[_0xe370('0x48')]=function(_0x49b118,_0x35450b){if(_0x49b118[_0xe370('0x49')]['id']){delete _0x49b118[_0xe370('0x49')]['id'];}return db[_0xe370('0x2c')][_0xe370('0x4a')]({'where':{'id':_0x49b118['params']['id']}})[_0xe370('0x25')](handleEntityNotFound(_0x35450b,null))[_0xe370('0x25')](saveUpdates(_0x49b118[_0xe370('0x49')],null))['then'](respondWithResult(_0x35450b,null))[_0xe370('0x46')](handleError(_0x35450b,null));};exports[_0xe370('0x26')]=function(_0x38f0fc,_0x501376){return db[_0xe370('0x2c')][_0xe370('0x4a')]({'where':{'id':_0x38f0fc[_0xe370('0x44')]['id']}})[_0xe370('0x25')](handleEntityNotFound(_0x501376,null))[_0xe370('0x25')](removeEntity(_0x501376,null))[_0xe370('0x46')](handleError(_0x501376,null));};exports[_0xe370('0x4b')]=function(_0x421083,_0x3bb25e,_0x4361cd){var _0x1f4243={};var _0x1e8689={};var _0x20c541;var _0x5451b3;return db['ServicenowConfiguration'][_0xe370('0x4c')]({'where':{'id':_0x421083[_0xe370('0x44')]['id']}})[_0xe370('0x25')](handleEntityNotFound(_0x3bb25e,null))[_0xe370('0x25')](function(_0x27accc){if(_0x27accc){_0x20c541=_0x27accc;_0x1e8689['model']=_[_0xe370('0x32')](db[_0xe370('0x4d')][_0xe370('0x2d')]);_0x1e8689[_0xe370('0x31')]=_['keys'](_0x421083[_0xe370('0x31')]);_0x1e8689[_0xe370('0x33')]=_[_0xe370('0x34')](_0x1e8689[_0xe370('0x35')],_0x1e8689[_0xe370('0x31')]);_0x1f4243[_0xe370('0x36')]=_[_0xe370('0x34')](_0x1e8689[_0xe370('0x35')],qs[_0xe370('0x37')](_0x421083[_0xe370('0x31')]['fields']));_0x1f4243[_0xe370('0x36')]=_0x1f4243[_0xe370('0x36')][_0xe370('0x4e')]?_0x1f4243[_0xe370('0x36')]:_0x1e8689['model'];_0x1f4243[_0xe370('0x39')]=qs[_0xe370('0x4f')](_0x421083[_0xe370('0x31')][_0xe370('0x4f')]);_0x1f4243[_0xe370('0x3a')]=qs[_0xe370('0x33')](_['pick'](_0x421083[_0xe370('0x31')],_0x1e8689[_0xe370('0x33')]));if(_0x421083['query'][_0xe370('0x3c')]){_0x1f4243['where']=_[_0xe370('0x3e')](_0x1f4243[_0xe370('0x3a')],{'$or':_[_0xe370('0x30')](_0x1f4243[_0xe370('0x36')],function(_0x48b92b){var _0xa16cea={};_0xa16cea[_0x48b92b]={'$like':'%'+_0x421083['query'][_0xe370('0x3c')]+'%'};return _0xa16cea;})});}_0x1f4243=_[_0xe370('0x3e')]({},_0x1f4243,_0x421083[_0xe370('0x3f')]);return _0x20c541[_0xe370('0x4b')](_0x1f4243);}})[_0xe370('0x25')](function(_0x1a22d7){if(_0x1a22d7){_0x5451b3=_0x1a22d7[_0xe370('0x4e')];if(!_0x421083[_0xe370('0x31')][_0xe370('0x50')](_0xe370('0x38'))){_0x1f4243[_0xe370('0x1e')]=qs[_0xe370('0x1e')](_0x421083[_0xe370('0x31')][_0xe370('0x1e')]);_0x1f4243['offset']=qs[_0xe370('0x20')](_0x421083[_0xe370('0x31')][_0xe370('0x20')]);}return _0x20c541[_0xe370('0x4b')](_0x1f4243);}})['then'](function(_0x33bf20){if(_0x33bf20){return _0x33bf20?{'count':_0x5451b3,'rows':_0x33bf20}:null;}})[_0xe370('0x25')](respondWithResult(_0x3bb25e,null))[_0xe370('0x46')](handleError(_0x3bb25e,null));};exports[_0xe370('0x51')]=function(_0xa85ad4,_0x3c5892,_0x3009b0){var _0x20bc82={};var _0x24846b={};var _0x4cc82a;var _0x3a318f;return db[_0xe370('0x2c')][_0xe370('0x4c')]({'where':{'id':_0xa85ad4[_0xe370('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c5892,null))[_0xe370('0x25')](function(_0x3e89fc){if(_0x3e89fc){_0x4cc82a=_0x3e89fc;_0x24846b[_0xe370('0x35')]=_[_0xe370('0x32')](db[_0xe370('0x4d')]['rawAttributes']);_0x24846b[_0xe370('0x31')]=_[_0xe370('0x32')](_0xa85ad4[_0xe370('0x31')]);_0x24846b[_0xe370('0x33')]=_['intersection'](_0x24846b[_0xe370('0x35')],_0x24846b[_0xe370('0x31')]);_0x20bc82[_0xe370('0x36')]=_[_0xe370('0x34')](_0x24846b[_0xe370('0x35')],qs[_0xe370('0x37')](_0xa85ad4[_0xe370('0x31')][_0xe370('0x37')]));_0x20bc82[_0xe370('0x36')]=_0x20bc82[_0xe370('0x36')][_0xe370('0x4e')]?_0x20bc82[_0xe370('0x36')]:_0x24846b[_0xe370('0x35')];_0x20bc82[_0xe370('0x39')]=qs[_0xe370('0x4f')](_0xa85ad4['query'][_0xe370('0x4f')]);_0x20bc82[_0xe370('0x3a')]=qs[_0xe370('0x33')](_[_0xe370('0x3b')](_0xa85ad4[_0xe370('0x31')],_0x24846b[_0xe370('0x33')]));if(_0xa85ad4[_0xe370('0x31')][_0xe370('0x3c')]){_0x20bc82[_0xe370('0x3a')]=_[_0xe370('0x3e')](_0x20bc82[_0xe370('0x3a')],{'$or':_['map'](_0x20bc82[_0xe370('0x36')],function(_0x12d8b6){var _0x2183d3={};_0x2183d3[_0x12d8b6]={'$like':'%'+_0xa85ad4[_0xe370('0x31')][_0xe370('0x3c')]+'%'};return _0x2183d3;})});}_0x20bc82=_['merge']({},_0x20bc82,_0xa85ad4['options']);return _0x4cc82a[_0xe370('0x51')](_0x20bc82);}})['then'](function(_0x396c94){if(_0x396c94){_0x3a318f=_0x396c94[_0xe370('0x4e')];if(!_0xa85ad4['query'][_0xe370('0x50')]('nolimit')){_0x20bc82[_0xe370('0x1e')]=qs[_0xe370('0x1e')](_0xa85ad4['query'][_0xe370('0x1e')]);_0x20bc82[_0xe370('0x20')]=qs[_0xe370('0x20')](_0xa85ad4['query']['offset']);}return _0x4cc82a[_0xe370('0x51')](_0x20bc82);}})[_0xe370('0x25')](function(_0x48617f){if(_0x48617f){return _0x48617f?{'count':_0x3a318f,'rows':_0x48617f}:null;}})[_0xe370('0x25')](respondWithResult(_0x3c5892,null))['catch'](handleError(_0x3c5892,null));};exports['getDescriptions']=function(_0x3be3d9,_0x4b525b,_0x1311ed){var _0x2673aa={};var _0x5444aa={};var _0xe8ea90;var _0x1a1b20;return db[_0xe370('0x2c')][_0xe370('0x4c')]({'where':{'id':_0x3be3d9[_0xe370('0x44')]['id']}})[_0xe370('0x25')](handleEntityNotFound(_0x4b525b,null))[_0xe370('0x25')](function(_0x222c71){if(_0x222c71){_0xe8ea90=_0x222c71;_0x5444aa[_0xe370('0x35')]=_[_0xe370('0x32')](db[_0xe370('0x4d')][_0xe370('0x2d')]);_0x5444aa[_0xe370('0x31')]=_[_0xe370('0x32')](_0x3be3d9[_0xe370('0x31')]);_0x5444aa[_0xe370('0x33')]=_[_0xe370('0x34')](_0x5444aa[_0xe370('0x35')],_0x5444aa[_0xe370('0x31')]);_0x2673aa[_0xe370('0x36')]=_[_0xe370('0x34')](_0x5444aa[_0xe370('0x35')],qs[_0xe370('0x37')](_0x3be3d9[_0xe370('0x31')][_0xe370('0x37')]));_0x2673aa[_0xe370('0x36')]=_0x2673aa[_0xe370('0x36')][_0xe370('0x4e')]?_0x2673aa[_0xe370('0x36')]:_0x5444aa[_0xe370('0x35')];_0x2673aa[_0xe370('0x39')]=qs[_0xe370('0x4f')](_0x3be3d9[_0xe370('0x31')][_0xe370('0x4f')]);_0x2673aa[_0xe370('0x3a')]=qs[_0xe370('0x33')](_[_0xe370('0x3b')](_0x3be3d9[_0xe370('0x31')],_0x5444aa[_0xe370('0x33')]));if(_0x3be3d9[_0xe370('0x31')][_0xe370('0x3c')]){_0x2673aa[_0xe370('0x3a')]=_[_0xe370('0x3e')](_0x2673aa[_0xe370('0x3a')],{'$or':_[_0xe370('0x30')](_0x2673aa[_0xe370('0x36')],function(_0x12ab86){var _0x1c2b56={};_0x1c2b56[_0x12ab86]={'$like':'%'+_0x3be3d9[_0xe370('0x31')][_0xe370('0x3c')]+'%'};return _0x1c2b56;})});}_0x2673aa=_['merge']({},_0x2673aa,_0x3be3d9[_0xe370('0x3f')]);return _0xe8ea90['getDescriptions'](_0x2673aa);}})[_0xe370('0x25')](function(_0x143266){if(_0x143266){_0x1a1b20=_0x143266[_0xe370('0x4e')];if(!_0x3be3d9[_0xe370('0x31')]['hasOwnProperty']('nolimit')){_0x2673aa[_0xe370('0x1e')]=qs['limit'](_0x3be3d9[_0xe370('0x31')]['limit']);_0x2673aa[_0xe370('0x20')]=qs[_0xe370('0x20')](_0x3be3d9[_0xe370('0x31')]['offset']);}return _0xe8ea90[_0xe370('0x52')](_0x2673aa);}})[_0xe370('0x25')](function(_0x36f0af){if(_0x36f0af){return _0x36f0af?{'count':_0x1a1b20,'rows':_0x36f0af}:null;}})['then'](respondWithResult(_0x4b525b,null))[_0xe370('0x46')](handleError(_0x4b525b,null));}; \ No newline at end of file +var _0xb877=['length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','ServicenowField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x4994cc,_0x5b4d81){var _0x579f1d=function(_0x2e5d71){while(--_0x2e5d71){_0x4994cc['push'](_0x4994cc['shift']());}};_0x579f1d(++_0x5b4d81);}(_0xb877,0xa9));var _0x7b87=function(_0x28a5b0,_0x155361){_0x28a5b0=_0x28a5b0-0x0;var _0x30ba6a=_0xb877[_0x28a5b0];return _0x30ba6a;};'use strict';var emlformat=require(_0x7b87('0x0'));var rimraf=require(_0x7b87('0x1'));var zipdir=require(_0x7b87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b87('0x3'));var path=require(_0x7b87('0x4'));var sox=require(_0x7b87('0x5'));var csv=require(_0x7b87('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b87('0x7'));var squel=require(_0x7b87('0x8'));var crypto=require(_0x7b87('0x9'));var jsforce=require(_0x7b87('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7b87('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b87('0xc'));var qs=require(_0x7b87('0xd'));var as=require(_0x7b87('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b87('0xf'))(_0x7b87('0x10'));var utils=require('../../config/utils');var config=require(_0x7b87('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x204bde,_0x2ac25c){_0x2ac25c=_0x2ac25c||0xcc;return function(_0xfcfbab){if(_0xfcfbab){return _0x204bde[_0x7b87('0x12')](_0x2ac25c);}return _0x204bde[_0x7b87('0x13')](_0x2ac25c)['end']();};}function respondWithResult(_0x467f5a,_0x2d099f){_0x2d099f=_0x2d099f||0xc8;return function(_0x6e300e){if(_0x6e300e){return _0x467f5a[_0x7b87('0x13')](_0x2d099f)[_0x7b87('0x14')](_0x6e300e);}};}function respondWithFilteredResult(_0x7d4f9d,_0x494620){return function(_0x926e4f){if(_0x926e4f){var _0x4077ae=typeof _0x494620['offset']===_0x7b87('0x15')&&typeof _0x494620[_0x7b87('0x16')]===_0x7b87('0x15');var _0xb95eae=_0x926e4f[_0x7b87('0x17')];var _0x283dec=_0x4077ae?0x0:_0x494620[_0x7b87('0x18')];var _0x1a19e4=_0x4077ae?_0x926e4f[_0x7b87('0x17')]:_0x494620[_0x7b87('0x18')]+_0x494620[_0x7b87('0x16')];var _0x5472d8;if(_0x1a19e4>=_0xb95eae){_0x1a19e4=_0xb95eae;_0x5472d8=0xc8;}else{_0x5472d8=0xce;}_0x7d4f9d['status'](_0x5472d8);return _0x7d4f9d[_0x7b87('0x19')](_0x7b87('0x1a'),_0x283dec+'-'+_0x1a19e4+'/'+_0xb95eae)['json'](_0x926e4f);}return null;};}function patchUpdates(_0x424740){return function(_0x3e390b){try{jsonpatch['apply'](_0x3e390b,_0x424740,!![]);}catch(_0x5b83fc){return BPromise[_0x7b87('0x1b')](_0x5b83fc);}return _0x3e390b['save']();};}function saveUpdates(_0x3e5135,_0x1787c7){return function(_0x13cd16){if(_0x13cd16){return _0x13cd16[_0x7b87('0x1c')](_0x3e5135)[_0x7b87('0x1d')](function(_0x43ecc2){return _0x43ecc2;});}return null;};}function removeEntity(_0x1fcc85,_0x16be5d){return function(_0x4ab092){if(_0x4ab092){return _0x4ab092[_0x7b87('0x1e')]()[_0x7b87('0x1d')](function(){_0x1fcc85[_0x7b87('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58ccdf,_0x27d37d){return function(_0x4ae5e5){if(!_0x4ae5e5){_0x58ccdf['sendStatus'](0x194);}return _0x4ae5e5;};}function handleError(_0x5585c6,_0x47a997){_0x47a997=_0x47a997||0x1f4;return function(_0x453c44){logger['error'](_0x453c44['stack']);if(_0x453c44[_0x7b87('0x1f')]){delete _0x453c44['name'];}_0x5585c6[_0x7b87('0x13')](_0x47a997)['send'](_0x453c44);};}exports[_0x7b87('0x20')]=function(_0x4a0873,_0x4e5156){var _0x3a2f75={},_0x1d1d38={},_0x5aebc8={'count':0x0,'rows':[]};var _0x1c6be0=_[_0x7b87('0x21')](db['ServicenowConfiguration']['rawAttributes'],function(_0x2333c7){return{'name':_0x2333c7[_0x7b87('0x22')],'type':_0x2333c7[_0x7b87('0x23')][_0x7b87('0x24')]};});_0x1d1d38['model']=_['map'](_0x1c6be0,_0x7b87('0x1f'));_0x1d1d38[_0x7b87('0x25')]=_[_0x7b87('0x26')](_0x4a0873[_0x7b87('0x25')]);_0x1d1d38[_0x7b87('0x27')]=_[_0x7b87('0x28')](_0x1d1d38[_0x7b87('0x29')],_0x1d1d38[_0x7b87('0x25')]);_0x3a2f75[_0x7b87('0x2a')]=_[_0x7b87('0x28')](_0x1d1d38['model'],qs[_0x7b87('0x2b')](_0x4a0873[_0x7b87('0x25')]['fields']));_0x3a2f75[_0x7b87('0x2a')]=_0x3a2f75['attributes'][_0x7b87('0x2c')]?_0x3a2f75[_0x7b87('0x2a')]:_0x1d1d38[_0x7b87('0x29')];if(!_0x4a0873[_0x7b87('0x25')]['hasOwnProperty'](_0x7b87('0x2d'))){_0x3a2f75['limit']=qs['limit'](_0x4a0873[_0x7b87('0x25')][_0x7b87('0x16')]);_0x3a2f75[_0x7b87('0x18')]=qs[_0x7b87('0x18')](_0x4a0873[_0x7b87('0x25')][_0x7b87('0x18')]);}_0x3a2f75['order']=qs[_0x7b87('0x2e')](_0x4a0873[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x3a2f75[_0x7b87('0x2f')]=qs['filters'](_[_0x7b87('0x30')](_0x4a0873[_0x7b87('0x25')],_0x1d1d38['filters']),_0x1c6be0);if(_0x4a0873[_0x7b87('0x25')][_0x7b87('0x31')]){_0x3a2f75['where']=_[_0x7b87('0x32')](_0x3a2f75[_0x7b87('0x2f')],{'$or':_[_0x7b87('0x21')](_0x1c6be0,function(_0x1d7793){if(_0x1d7793[_0x7b87('0x23')]!==_0x7b87('0x33')){var _0x3d984c={};_0x3d984c[_0x1d7793[_0x7b87('0x1f')]]={'$like':'%'+_0x4a0873['query'][_0x7b87('0x31')]+'%'};return _0x3d984c;}})});}_0x3a2f75=_[_0x7b87('0x32')]({},_0x3a2f75,_0x4a0873[_0x7b87('0x34')]);var _0xf00a82={'where':_0x3a2f75[_0x7b87('0x2f')]};return db[_0x7b87('0x35')][_0x7b87('0x17')](_0xf00a82)['then'](function(_0x4540ab){_0x5aebc8[_0x7b87('0x17')]=_0x4540ab;if(_0x4a0873['query'][_0x7b87('0x36')]){_0x3a2f75['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x7b87('0x37')](_0x3a2f75);})['then'](function(_0x4227b5){_0x5aebc8[_0x7b87('0x38')]=_0x4227b5;return _0x5aebc8;})[_0x7b87('0x1d')](respondWithFilteredResult(_0x4e5156,_0x3a2f75))[_0x7b87('0x39')](handleError(_0x4e5156,null));};exports[_0x7b87('0x3a')]=function(_0x31c016,_0x172181){var _0x372b7c={'raw':![],'where':{'id':_0x31c016[_0x7b87('0x3b')]['id']}},_0x1b5bdd={};_0x1b5bdd[_0x7b87('0x29')]=_[_0x7b87('0x26')](db['ServicenowConfiguration'][_0x7b87('0x3c')]);_0x1b5bdd[_0x7b87('0x25')]=_[_0x7b87('0x26')](_0x31c016[_0x7b87('0x25')]);_0x1b5bdd[_0x7b87('0x27')]=_[_0x7b87('0x28')](_0x1b5bdd[_0x7b87('0x29')],_0x1b5bdd[_0x7b87('0x25')]);_0x372b7c['attributes']=_[_0x7b87('0x28')](_0x1b5bdd[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x31c016[_0x7b87('0x25')]['fields']));_0x372b7c[_0x7b87('0x2a')]=_0x372b7c[_0x7b87('0x2a')][_0x7b87('0x2c')]?_0x372b7c[_0x7b87('0x2a')]:_0x1b5bdd[_0x7b87('0x29')];if(_0x31c016[_0x7b87('0x25')]['includeAll']){_0x372b7c['include']=[{'all':!![]}];}_0x372b7c=_['merge']({},_0x372b7c,_0x31c016[_0x7b87('0x34')]);return db[_0x7b87('0x35')][_0x7b87('0x3d')](_0x372b7c)[_0x7b87('0x1d')](handleEntityNotFound(_0x172181,null))[_0x7b87('0x1d')](respondWithResult(_0x172181,null))[_0x7b87('0x39')](handleError(_0x172181,null));};exports[_0x7b87('0x3e')]=function(_0x13904d,_0x2143e3){return db[_0x7b87('0x35')]['create'](_0x13904d[_0x7b87('0x3f')],{})[_0x7b87('0x1d')](respondWithResult(_0x2143e3,0xc9))[_0x7b87('0x39')](handleError(_0x2143e3,null));};exports['update']=function(_0x59605b,_0x262e7a){if(_0x59605b[_0x7b87('0x3f')]['id']){delete _0x59605b[_0x7b87('0x3f')]['id'];}return db[_0x7b87('0x35')][_0x7b87('0x3d')]({'where':{'id':_0x59605b[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x262e7a,null))[_0x7b87('0x1d')](saveUpdates(_0x59605b['body'],null))[_0x7b87('0x1d')](respondWithResult(_0x262e7a,null))[_0x7b87('0x39')](handleError(_0x262e7a,null));};exports['destroy']=function(_0x501ce6,_0x3457f5){return db[_0x7b87('0x35')][_0x7b87('0x3d')]({'where':{'id':_0x501ce6[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x3457f5,null))[_0x7b87('0x1d')](removeEntity(_0x3457f5,null))[_0x7b87('0x39')](handleError(_0x3457f5,null));};exports[_0x7b87('0x40')]=function(_0x164483,_0x4a0a5a,_0x3b03bd){var _0x155161={};var _0x76c49b={};var _0x356642;var _0x458b7d;return db[_0x7b87('0x35')][_0x7b87('0x41')]({'where':{'id':_0x164483[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x4a0a5a,null))[_0x7b87('0x1d')](function(_0x4d075a){if(_0x4d075a){_0x356642=_0x4d075a;_0x76c49b[_0x7b87('0x29')]=_[_0x7b87('0x26')](db[_0x7b87('0x42')][_0x7b87('0x3c')]);_0x76c49b[_0x7b87('0x25')]=_[_0x7b87('0x26')](_0x164483[_0x7b87('0x25')]);_0x76c49b[_0x7b87('0x27')]=_['intersection'](_0x76c49b['model'],_0x76c49b[_0x7b87('0x25')]);_0x155161['attributes']=_[_0x7b87('0x28')](_0x76c49b[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x164483['query'][_0x7b87('0x2b')]));_0x155161[_0x7b87('0x2a')]=_0x155161['attributes']['length']?_0x155161[_0x7b87('0x2a')]:_0x76c49b['model'];_0x155161[_0x7b87('0x43')]=qs[_0x7b87('0x2e')](_0x164483[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x155161[_0x7b87('0x2f')]=qs['filters'](_[_0x7b87('0x30')](_0x164483['query'],_0x76c49b[_0x7b87('0x27')]));if(_0x164483['query'][_0x7b87('0x31')]){_0x155161[_0x7b87('0x2f')]=_[_0x7b87('0x32')](_0x155161[_0x7b87('0x2f')],{'$or':_[_0x7b87('0x21')](_0x155161['attributes'],function(_0x4cc68e){var _0x5d6979={};_0x5d6979[_0x4cc68e]={'$like':'%'+_0x164483[_0x7b87('0x25')][_0x7b87('0x31')]+'%'};return _0x5d6979;})});}_0x155161=_['merge']({},_0x155161,_0x164483['options']);return _0x356642[_0x7b87('0x40')](_0x155161);}})[_0x7b87('0x1d')](function(_0x5a3446){if(_0x5a3446){_0x458b7d=_0x5a3446[_0x7b87('0x2c')];if(!_0x164483[_0x7b87('0x25')][_0x7b87('0x44')](_0x7b87('0x2d'))){_0x155161['limit']=qs[_0x7b87('0x16')](_0x164483[_0x7b87('0x25')][_0x7b87('0x16')]);_0x155161[_0x7b87('0x18')]=qs[_0x7b87('0x18')](_0x164483['query'][_0x7b87('0x18')]);}return _0x356642[_0x7b87('0x40')](_0x155161);}})[_0x7b87('0x1d')](function(_0x4f1fcd){if(_0x4f1fcd){return _0x4f1fcd?{'count':_0x458b7d,'rows':_0x4f1fcd}:null;}})[_0x7b87('0x1d')](respondWithResult(_0x4a0a5a,null))[_0x7b87('0x39')](handleError(_0x4a0a5a,null));};exports[_0x7b87('0x45')]=function(_0x5c2122,_0x282217,_0xafbdbe){var _0x39fbc1={};var _0x2e4c8f={};var _0x109e3c;var _0x366fe0;return db[_0x7b87('0x35')][_0x7b87('0x41')]({'where':{'id':_0x5c2122[_0x7b87('0x3b')]['id']}})['then'](handleEntityNotFound(_0x282217,null))[_0x7b87('0x1d')](function(_0x8ff101){if(_0x8ff101){_0x109e3c=_0x8ff101;_0x2e4c8f[_0x7b87('0x29')]=_[_0x7b87('0x26')](db['ServicenowField'][_0x7b87('0x3c')]);_0x2e4c8f['query']=_['keys'](_0x5c2122[_0x7b87('0x25')]);_0x2e4c8f[_0x7b87('0x27')]=_['intersection'](_0x2e4c8f[_0x7b87('0x29')],_0x2e4c8f[_0x7b87('0x25')]);_0x39fbc1[_0x7b87('0x2a')]=_['intersection'](_0x2e4c8f[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x5c2122[_0x7b87('0x25')][_0x7b87('0x2b')]));_0x39fbc1['attributes']=_0x39fbc1['attributes'][_0x7b87('0x2c')]?_0x39fbc1[_0x7b87('0x2a')]:_0x2e4c8f[_0x7b87('0x29')];_0x39fbc1[_0x7b87('0x43')]=qs[_0x7b87('0x2e')](_0x5c2122[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x39fbc1['where']=qs[_0x7b87('0x27')](_[_0x7b87('0x30')](_0x5c2122[_0x7b87('0x25')],_0x2e4c8f['filters']));if(_0x5c2122[_0x7b87('0x25')][_0x7b87('0x31')]){_0x39fbc1[_0x7b87('0x2f')]=_[_0x7b87('0x32')](_0x39fbc1[_0x7b87('0x2f')],{'$or':_[_0x7b87('0x21')](_0x39fbc1[_0x7b87('0x2a')],function(_0x195549){var _0x54b024={};_0x54b024[_0x195549]={'$like':'%'+_0x5c2122['query'][_0x7b87('0x31')]+'%'};return _0x54b024;})});}_0x39fbc1=_[_0x7b87('0x32')]({},_0x39fbc1,_0x5c2122[_0x7b87('0x34')]);return _0x109e3c[_0x7b87('0x45')](_0x39fbc1);}})[_0x7b87('0x1d')](function(_0x339c08){if(_0x339c08){_0x366fe0=_0x339c08['length'];if(!_0x5c2122[_0x7b87('0x25')][_0x7b87('0x44')](_0x7b87('0x2d'))){_0x39fbc1[_0x7b87('0x16')]=qs[_0x7b87('0x16')](_0x5c2122[_0x7b87('0x25')][_0x7b87('0x16')]);_0x39fbc1['offset']=qs['offset'](_0x5c2122['query'][_0x7b87('0x18')]);}return _0x109e3c[_0x7b87('0x45')](_0x39fbc1);}})[_0x7b87('0x1d')](function(_0x402818){if(_0x402818){return _0x402818?{'count':_0x366fe0,'rows':_0x402818}:null;}})[_0x7b87('0x1d')](respondWithResult(_0x282217,null))[_0x7b87('0x39')](handleError(_0x282217,null));};exports[_0x7b87('0x46')]=function(_0x286c37,_0x2a73a0,_0x4ab3b0){var _0x45ecda={};var _0x3ae33f={};var _0x28c1b8;var _0x252208;return db[_0x7b87('0x35')][_0x7b87('0x41')]({'where':{'id':_0x286c37[_0x7b87('0x3b')]['id']}})[_0x7b87('0x1d')](handleEntityNotFound(_0x2a73a0,null))[_0x7b87('0x1d')](function(_0x2d9d77){if(_0x2d9d77){_0x28c1b8=_0x2d9d77;_0x3ae33f['model']=_[_0x7b87('0x26')](db[_0x7b87('0x42')][_0x7b87('0x3c')]);_0x3ae33f['query']=_[_0x7b87('0x26')](_0x286c37[_0x7b87('0x25')]);_0x3ae33f[_0x7b87('0x27')]=_[_0x7b87('0x28')](_0x3ae33f['model'],_0x3ae33f[_0x7b87('0x25')]);_0x45ecda[_0x7b87('0x2a')]=_['intersection'](_0x3ae33f[_0x7b87('0x29')],qs[_0x7b87('0x2b')](_0x286c37['query']['fields']));_0x45ecda[_0x7b87('0x2a')]=_0x45ecda[_0x7b87('0x2a')][_0x7b87('0x2c')]?_0x45ecda['attributes']:_0x3ae33f[_0x7b87('0x29')];_0x45ecda['order']=qs[_0x7b87('0x2e')](_0x286c37[_0x7b87('0x25')][_0x7b87('0x2e')]);_0x45ecda['where']=qs[_0x7b87('0x27')](_[_0x7b87('0x30')](_0x286c37['query'],_0x3ae33f[_0x7b87('0x27')]));if(_0x286c37['query'][_0x7b87('0x31')]){_0x45ecda[_0x7b87('0x2f')]=_['merge'](_0x45ecda[_0x7b87('0x2f')],{'$or':_['map'](_0x45ecda[_0x7b87('0x2a')],function(_0x5d5d54){var _0x3ff7cc={};_0x3ff7cc[_0x5d5d54]={'$like':'%'+_0x286c37[_0x7b87('0x25')][_0x7b87('0x31')]+'%'};return _0x3ff7cc;})});}_0x45ecda=_[_0x7b87('0x32')]({},_0x45ecda,_0x286c37[_0x7b87('0x34')]);return _0x28c1b8[_0x7b87('0x46')](_0x45ecda);}})[_0x7b87('0x1d')](function(_0x2aec52){if(_0x2aec52){_0x252208=_0x2aec52[_0x7b87('0x2c')];if(!_0x286c37[_0x7b87('0x25')][_0x7b87('0x44')](_0x7b87('0x2d'))){_0x45ecda['limit']=qs[_0x7b87('0x16')](_0x286c37['query'][_0x7b87('0x16')]);_0x45ecda['offset']=qs['offset'](_0x286c37[_0x7b87('0x25')]['offset']);}return _0x28c1b8[_0x7b87('0x46')](_0x45ecda);}})['then'](function(_0x374105){if(_0x374105){return _0x374105?{'count':_0x252208,'rows':_0x374105}:null;}})[_0x7b87('0x1d')](respondWithResult(_0x2a73a0,null))[_0x7b87('0x39')](handleError(_0x2a73a0,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index bf9c202..6d9b624 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 _0xf08c=['int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x394b15,_0x45c841){var _0x1dea0e=function(_0x5d0fce){while(--_0x5d0fce){_0x394b15['push'](_0x394b15['shift']());}};_0x1dea0e(++_0x45c841);}(_0xf08c,0xb5));var _0xcf08=function(_0x270ca3,_0x58ea9b){_0x270ca3=_0x270ca3-0x0;var _0x3c7cba=_0xf08c[_0x270ca3];return _0x3c7cba;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var logger=require(_0xcf08('0x2'))('api');var moment=require(_0xcf08('0x3'));var BPromise=require(_0xcf08('0x4'));var rp=require(_0xcf08('0x5'));var fs=require('fs');var path=require(_0xcf08('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf08('0x7'));module[_0xcf08('0x8')]=function(_0x5f1020,_0x346b93){return _0x5f1020[_0xcf08('0x9')](_0xcf08('0xa'),attributes,{'tableName':_0xcf08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20df=['../../config/environment','exports','define','int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x310784,_0x2cf41a){var _0x1d9552=function(_0x43c5d9){while(--_0x43c5d9){_0x310784['push'](_0x310784['shift']());}};_0x1d9552(++_0x2cf41a);}(_0x20df,0x7c));var _0xf20d=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0x20df[_0x5e77db];return _0x34b675;};'use strict';var _=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var logger=require(_0xf20d('0x2'))(_0xf20d('0x3'));var moment=require('moment');var BPromise=require(_0xf20d('0x4'));var rp=require(_0xf20d('0x5'));var fs=require('fs');var path=require(_0xf20d('0x6'));var rimraf=require(_0xf20d('0x7'));var config=require(_0xf20d('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xf20d('0x9')]=function(_0x48d4f2,_0x397065){return _0x48d4f2[_0xf20d('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0xf20d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 613ee90..c5e17bf 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 _0x7aee=['../../config/logger','../../config/environment','jayson/promise','http','request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7aee,0x9c));var _0xe7ae=function(_0x5987fa,_0x78598){_0x5987fa=_0x5987fa-0x0;var _0x48cc73=_0x7aee[_0x5987fa];return _0x48cc73;};'use strict';var _=require('lodash');var util=require(_0xe7ae('0x0'));var moment=require(_0xe7ae('0x1'));var BPromise=require(_0xe7ae('0x2'));var rs=require(_0xe7ae('0x3'));var fs=require('fs');var Redis=require(_0xe7ae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ae('0x5'));var logger=require(_0xe7ae('0x6'))('rpc');var config=require(_0xe7ae('0x7'));var jayson=require(_0xe7ae('0x8'));var client=jayson['client'][_0xe7ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f1f15,_0x91f4e4,_0x33c152){return new BPromise(function(_0x384cbc,_0x222e37){return client[_0xe7ae('0xa')](_0x4f1f15,_0x33c152)['then'](function(_0x1a4824){logger['info'](_0xe7ae('0xb'),_0x91f4e4,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x91f4e4,_0xe7ae('0xc'),JSON[_0xe7ae('0xd')](_0x1a4824));if(_0x1a4824[_0xe7ae('0xe')]){if(_0x1a4824['error']['code']===0x1f4){logger[_0xe7ae('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x91f4e4,_0x1a4824['error'][_0xe7ae('0xf')]);return _0x222e37(_0x1a4824[_0xe7ae('0xe')][_0xe7ae('0xf')]);}logger[_0xe7ae('0xe')](_0xe7ae('0xb'),_0x91f4e4,_0x1a4824[_0xe7ae('0xe')][_0xe7ae('0xf')]);return _0x384cbc(_0x1a4824[_0xe7ae('0xe')][_0xe7ae('0xf')]);}else{logger[_0xe7ae('0x10')](_0xe7ae('0xb'),_0x91f4e4,_0xe7ae('0xc'));_0x384cbc(_0x1a4824['result'][_0xe7ae('0xf')]);}})[_0xe7ae('0x11')](function(_0x2617fb){logger['error'](_0xe7ae('0xb'),_0x91f4e4,_0x2617fb);_0x222e37(_0x2617fb);});});} \ No newline at end of file +var _0x29d0=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xf96040,_0x3e93b4){var _0x1194ea=function(_0x5ce9aa){while(--_0x5ce9aa){_0xf96040['push'](_0xf96040['shift']());}};_0x1194ea(++_0x3e93b4);}(_0x29d0,0x1c2));var _0x029d=function(_0x3b207f,_0x268403){_0x3b207f=_0x3b207f-0x0;var _0x51bedb=_0x29d0[_0x3b207f];return _0x51bedb;};'use strict';var _=require(_0x029d('0x0'));var util=require(_0x029d('0x1'));var moment=require(_0x029d('0x2'));var BPromise=require(_0x029d('0x3'));var rs=require(_0x029d('0x4'));var fs=require('fs');var Redis=require(_0x029d('0x5'));var db=require(_0x029d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x029d('0x7'));var config=require(_0x029d('0x8'));var jayson=require(_0x029d('0x9'));var client=jayson[_0x029d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24de85,_0x3cfde1,_0x496821){return new BPromise(function(_0x1b52ab,_0x68eb10){return client[_0x029d('0xb')](_0x24de85,_0x496821)[_0x029d('0xc')](function(_0x5f24bd){logger[_0x029d('0xd')](_0x029d('0xe'),_0x3cfde1,_0x029d('0xf'));logger[_0x029d('0x10')](_0x029d('0x11'),_0x3cfde1,_0x029d('0xf'),JSON[_0x029d('0x12')](_0x5f24bd));if(_0x5f24bd['error']){if(_0x5f24bd[_0x029d('0x13')][_0x029d('0x14')]===0x1f4){logger[_0x029d('0x13')](_0x029d('0xe'),_0x3cfde1,_0x5f24bd[_0x029d('0x13')]['message']);return _0x68eb10(_0x5f24bd[_0x029d('0x13')][_0x029d('0x15')]);}logger['error'](_0x029d('0xe'),_0x3cfde1,_0x5f24bd[_0x029d('0x13')][_0x029d('0x15')]);return _0x1b52ab(_0x5f24bd[_0x029d('0x13')][_0x029d('0x15')]);}else{logger['info'](_0x029d('0xe'),_0x3cfde1,_0x029d('0xf'));_0x1b52ab(_0x5f24bd['result'][_0x029d('0x15')]);}})['catch'](function(_0x29eb5f){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3cfde1,_0x29eb5f);_0x68eb10(_0x29eb5f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 828ff30..cf65661 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 _0x2aed=['post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show'];(function(_0x1f9122,_0x1102b0){var _0x31dce4=function(_0x430dba){while(--_0x430dba){_0x1f9122['push'](_0x1f9122['shift']());}};_0x31dce4(++_0x1102b0);}(_0x2aed,0x9e));var _0xd2ae=function(_0x7081fe,_0x33b493){_0x7081fe=_0x7081fe-0x0;var _0x2967ff=_0x2aed[_0x7081fe];return _0x2967ff;};'use strict';var multer=require(_0xd2ae('0x0'));var util=require(_0xd2ae('0x1'));var path=require(_0xd2ae('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2ae('0x3'));var router=express[_0xd2ae('0x4')]();var fs_extra=require(_0xd2ae('0x5'));var auth=require(_0xd2ae('0x6'));var interaction=require(_0xd2ae('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router['get']('/',auth[_0xd2ae('0x8')](),controller[_0xd2ae('0x9')]);router[_0xd2ae('0xa')](_0xd2ae('0xb'),auth[_0xd2ae('0x8')](),controller[_0xd2ae('0xc')]);router[_0xd2ae('0xd')]('/',auth[_0xd2ae('0x8')](),controller[_0xd2ae('0xe')]);router[_0xd2ae('0xf')](_0xd2ae('0xb'),auth[_0xd2ae('0x8')](),controller[_0xd2ae('0x10')]);router[_0xd2ae('0x11')](_0xd2ae('0xb'),auth[_0xd2ae('0x8')](),controller['destroy']);module[_0xd2ae('0x12')]=router; \ No newline at end of file +var _0x5106=['isAuthenticated','get','show','post','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0x5106,0x118));var _0x6510=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5106[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x6510('0x0'));var util=require(_0x6510('0x1'));var path=require(_0x6510('0x2'));var timeout=require(_0x6510('0x3'));var express=require('express');var router=express[_0x6510('0x4')]();var fs_extra=require(_0x6510('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6510('0x6'));var config=require(_0x6510('0x7'));var controller=require(_0x6510('0x8'));router['get']('/',auth[_0x6510('0x9')](),controller['index']);router[_0x6510('0xa')]('/:id',auth[_0x6510('0x9')](),controller[_0x6510('0xb')]);router[_0x6510('0xc')]('/',auth[_0x6510('0x9')](),controller['create']);router[_0x6510('0xd')](_0x6510('0xe'),auth[_0x6510('0x9')](),controller['update']);router[_0x6510('0xf')](_0x6510('0xe'),auth[_0x6510('0x9')](),controller[_0x6510('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index de183c4..0ed027b 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 _0x37ac=['STRING','BOOLEAN','ENUM','customVariable','keyValue','string'];(function(_0xdb9fca,_0x5c695c){var _0x4d125a=function(_0x5518f4){while(--_0x5518f4){_0xdb9fca['push'](_0xdb9fca['shift']());}};_0x4d125a(++_0x5c695c);}(_0x37ac,0x1be));var _0xc37a=function(_0x1070c9,_0x529ddb){_0x1070c9=_0x1070c9-0x0;var _0x1aa5c4=_0x37ac[_0x1070c9];return _0x1aa5c4;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc37a('0x0')]('string','variable',_0xc37a('0x1'),_0xc37a('0x2'),'picklist'),'defaultValue':_0xc37a('0x3')},'content':{'type':Sequelize[_0xc37a('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc37a('0x0')](_0xc37a('0x3'),'variable',_0xc37a('0x1'))},'keyContent':{'type':Sequelize[_0xc37a('0x4')]},'idField':{'type':Sequelize[_0xc37a('0x4')]},'nameField':{'type':Sequelize[_0xc37a('0x4')]},'customField':{'type':Sequelize[_0xc37a('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc37a('0x4')]}}; \ No newline at end of file +var _0x3c54=['BOOLEAN','sequelize','exports','string','customVariable','keyValue','picklist','STRING','ENUM','variable'];(function(_0x5cf3a3,_0x29327c){var _0x349b78=function(_0x465240){while(--_0x465240){_0x5cf3a3['push'](_0x5cf3a3['shift']());}};_0x349b78(++_0x29327c);}(_0x3c54,0x17d));var _0x43c5=function(_0x142366,_0x36f37a){_0x142366=_0x142366-0x0;var _0x3349d7=_0x3c54[_0x142366];return _0x3349d7;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x43c5('0x2'),'variable',_0x43c5('0x3'),_0x43c5('0x4'),_0x43c5('0x5')),'defaultValue':_0x43c5('0x2')},'content':{'type':Sequelize[_0x43c5('0x6')]},'key':{'type':Sequelize[_0x43c5('0x6')]},'keyType':{'type':Sequelize[_0x43c5('0x7')](_0x43c5('0x2'),_0x43c5('0x8'),_0x43c5('0x3'))},'keyContent':{'type':Sequelize[_0x43c5('0x6')]},'idField':{'type':Sequelize[_0x43c5('0x6')]},'nameField':{'type':Sequelize[_0x43c5('0x6')]},'customField':{'type':Sequelize[_0x43c5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x43c5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index abea037..c82a6bc 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 _0xad90=['length','include','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','name','send','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','ServicenowField','findAll','then','rows','catch','show','params','keys','rawAttributes'];(function(_0x3f4d5b,_0x43692c){var _0x52d32b=function(_0x38a298){while(--_0x38a298){_0x3f4d5b['push'](_0x3f4d5b['shift']());}};_0x52d32b(++_0x43692c);}(_0xad90,0x9c));var _0x0ad9=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xad90[_0x187ee1];return _0x388160;};'use strict';var emlformat=require(_0x0ad9('0x0'));var rimraf=require(_0x0ad9('0x1'));var zipdir=require(_0x0ad9('0x2'));var jsonpatch=require(_0x0ad9('0x3'));var rp=require(_0x0ad9('0x4'));var moment=require('moment');var BPromise=require(_0x0ad9('0x5'));var Mustache=require(_0x0ad9('0x6'));var util=require(_0x0ad9('0x7'));var path=require('path');var sox=require(_0x0ad9('0x8'));var csv=require(_0x0ad9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ad9('0xa'));var _=require(_0x0ad9('0xb'));var squel=require('squel');var crypto=require(_0x0ad9('0xc'));var jsforce=require(_0x0ad9('0xd'));var deskjs=require(_0x0ad9('0xe'));var toCsv=require(_0x0ad9('0x9'));var querystring=require(_0x0ad9('0xf'));var Papa=require(_0x0ad9('0x10'));var Redis=require(_0x0ad9('0x11'));var authService=require(_0x0ad9('0x12'));var qs=require(_0x0ad9('0x13'));var as=require(_0x0ad9('0x14'));var hardwareService=require(_0x0ad9('0x15'));var logger=require(_0x0ad9('0x16'))(_0x0ad9('0x17'));var utils=require(_0x0ad9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0ad9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1284e6,_0x2ece43){_0x2ece43=_0x2ece43||0xcc;return function(_0x3c17d9){if(_0x3c17d9){return _0x1284e6[_0x0ad9('0x1a')](_0x2ece43);}return _0x1284e6[_0x0ad9('0x1b')](_0x2ece43)[_0x0ad9('0x1c')]();};}function respondWithResult(_0x3bb6fd,_0x4905e4){_0x4905e4=_0x4905e4||0xc8;return function(_0x12b0db){if(_0x12b0db){return _0x3bb6fd[_0x0ad9('0x1b')](_0x4905e4)['json'](_0x12b0db);}};}function respondWithFilteredResult(_0x4bd41a,_0x15d15b){return function(_0x332ba9){if(_0x332ba9){var _0xc53a7d=typeof _0x15d15b[_0x0ad9('0x1d')]===_0x0ad9('0x1e')&&typeof _0x15d15b[_0x0ad9('0x1f')]===_0x0ad9('0x1e');var _0x170339=_0x332ba9[_0x0ad9('0x20')];var _0x1ff20e=_0xc53a7d?0x0:_0x15d15b[_0x0ad9('0x1d')];var _0x29e66a=_0xc53a7d?_0x332ba9['count']:_0x15d15b[_0x0ad9('0x1d')]+_0x15d15b[_0x0ad9('0x1f')];var _0x379d2e;if(_0x29e66a>=_0x170339){_0x29e66a=_0x170339;_0x379d2e=0xc8;}else{_0x379d2e=0xce;}_0x4bd41a[_0x0ad9('0x1b')](_0x379d2e);return _0x4bd41a[_0x0ad9('0x21')](_0x0ad9('0x22'),_0x1ff20e+'-'+_0x29e66a+'/'+_0x170339)[_0x0ad9('0x23')](_0x332ba9);}return null;};}function patchUpdates(_0x33a135){return function(_0x20f6ed){try{jsonpatch[_0x0ad9('0x24')](_0x20f6ed,_0x33a135,!![]);}catch(_0x194901){return BPromise[_0x0ad9('0x25')](_0x194901);}return _0x20f6ed[_0x0ad9('0x26')]();};}function saveUpdates(_0x3d0e8a,_0x475be3){return function(_0x38c725){if(_0x38c725){return _0x38c725[_0x0ad9('0x27')](_0x3d0e8a)['then'](function(_0x4a1acf){return _0x4a1acf;});}return null;};}function removeEntity(_0x21f51a,_0x562b4c){return function(_0x3af107){if(_0x3af107){return _0x3af107['destroy']()['then'](function(){_0x21f51a[_0x0ad9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe40088,_0x6ae68){return function(_0x3492e0){if(!_0x3492e0){_0xe40088[_0x0ad9('0x1a')](0x194);}return _0x3492e0;};}function handleError(_0x36ae52,_0x2fbba6){_0x2fbba6=_0x2fbba6||0x1f4;return function(_0x1c4125){logger['error'](_0x1c4125['stack']);if(_0x1c4125[_0x0ad9('0x28')]){delete _0x1c4125[_0x0ad9('0x28')];}_0x36ae52[_0x0ad9('0x1b')](_0x2fbba6)[_0x0ad9('0x29')](_0x1c4125);};}exports[_0x0ad9('0x2a')]=function(_0x174a38,_0x7c9fde){var _0x3084f2={},_0x2ee202={},_0x5bb717={'count':0x0,'rows':[]};var _0x580b84=_['map'](db['ServicenowField']['rawAttributes'],function(_0x2414f3){return{'name':_0x2414f3[_0x0ad9('0x2b')],'type':_0x2414f3[_0x0ad9('0x2c')][_0x0ad9('0x2d')]};});_0x2ee202[_0x0ad9('0x2e')]=_[_0x0ad9('0x2f')](_0x580b84,_0x0ad9('0x28'));_0x2ee202[_0x0ad9('0x30')]=_['keys'](_0x174a38[_0x0ad9('0x30')]);_0x2ee202[_0x0ad9('0x31')]=_[_0x0ad9('0x32')](_0x2ee202[_0x0ad9('0x2e')],_0x2ee202[_0x0ad9('0x30')]);_0x3084f2['attributes']=_[_0x0ad9('0x32')](_0x2ee202[_0x0ad9('0x2e')],qs['fields'](_0x174a38[_0x0ad9('0x30')][_0x0ad9('0x33')]));_0x3084f2[_0x0ad9('0x34')]=_0x3084f2['attributes']['length']?_0x3084f2[_0x0ad9('0x34')]:_0x2ee202[_0x0ad9('0x2e')];if(!_0x174a38[_0x0ad9('0x30')][_0x0ad9('0x35')](_0x0ad9('0x36'))){_0x3084f2['limit']=qs[_0x0ad9('0x1f')](_0x174a38['query'][_0x0ad9('0x1f')]);_0x3084f2['offset']=qs[_0x0ad9('0x1d')](_0x174a38['query'][_0x0ad9('0x1d')]);}_0x3084f2[_0x0ad9('0x37')]=qs[_0x0ad9('0x38')](_0x174a38['query'][_0x0ad9('0x38')]);_0x3084f2['where']=qs[_0x0ad9('0x31')](_[_0x0ad9('0x39')](_0x174a38['query'],_0x2ee202['filters']),_0x580b84);if(_0x174a38[_0x0ad9('0x30')]['filter']){_0x3084f2[_0x0ad9('0x3a')]=_['merge'](_0x3084f2[_0x0ad9('0x3a')],{'$or':_[_0x0ad9('0x2f')](_0x580b84,function(_0x506fa6){if(_0x506fa6[_0x0ad9('0x2c')]!==_0x0ad9('0x3b')){var _0x4a489c={};_0x4a489c[_0x506fa6[_0x0ad9('0x28')]]={'$like':'%'+_0x174a38['query'][_0x0ad9('0x3c')]+'%'};return _0x4a489c;}})});}_0x3084f2=_[_0x0ad9('0x3d')]({},_0x3084f2,_0x174a38['options']);var _0x1f2547={'where':_0x3084f2[_0x0ad9('0x3a')]};return db['ServicenowField'][_0x0ad9('0x20')](_0x1f2547)['then'](function(_0x37284b){_0x5bb717[_0x0ad9('0x20')]=_0x37284b;if(_0x174a38[_0x0ad9('0x30')][_0x0ad9('0x3e')]){_0x3084f2['include']=[{'all':!![]}];}return db[_0x0ad9('0x3f')][_0x0ad9('0x40')](_0x3084f2);})[_0x0ad9('0x41')](function(_0x1dbe86){_0x5bb717[_0x0ad9('0x42')]=_0x1dbe86;return _0x5bb717;})[_0x0ad9('0x41')](respondWithFilteredResult(_0x7c9fde,_0x3084f2))[_0x0ad9('0x43')](handleError(_0x7c9fde,null));};exports[_0x0ad9('0x44')]=function(_0x2924c0,_0xe91edb){var _0x20ad56={'raw':!![],'where':{'id':_0x2924c0[_0x0ad9('0x45')]['id']}},_0x4ff690={};_0x4ff690[_0x0ad9('0x2e')]=_[_0x0ad9('0x46')](db[_0x0ad9('0x3f')][_0x0ad9('0x47')]);_0x4ff690[_0x0ad9('0x30')]=_[_0x0ad9('0x46')](_0x2924c0[_0x0ad9('0x30')]);_0x4ff690[_0x0ad9('0x31')]=_[_0x0ad9('0x32')](_0x4ff690['model'],_0x4ff690['query']);_0x20ad56['attributes']=_[_0x0ad9('0x32')](_0x4ff690[_0x0ad9('0x2e')],qs[_0x0ad9('0x33')](_0x2924c0[_0x0ad9('0x30')]['fields']));_0x20ad56[_0x0ad9('0x34')]=_0x20ad56[_0x0ad9('0x34')][_0x0ad9('0x48')]?_0x20ad56[_0x0ad9('0x34')]:_0x4ff690[_0x0ad9('0x2e')];if(_0x2924c0[_0x0ad9('0x30')][_0x0ad9('0x3e')]){_0x20ad56[_0x0ad9('0x49')]=[{'all':!![]}];}_0x20ad56=_[_0x0ad9('0x3d')]({},_0x20ad56,_0x2924c0['options']);return db[_0x0ad9('0x3f')]['find'](_0x20ad56)[_0x0ad9('0x41')](handleEntityNotFound(_0xe91edb,null))[_0x0ad9('0x41')](respondWithResult(_0xe91edb,null))[_0x0ad9('0x43')](handleError(_0xe91edb,null));};exports['create']=function(_0x5b146c,_0x205ab2){return db['ServicenowField']['create'](_0x5b146c[_0x0ad9('0x4a')],{})[_0x0ad9('0x41')](respondWithResult(_0x205ab2,0xc9))[_0x0ad9('0x43')](handleError(_0x205ab2,null));};exports[_0x0ad9('0x27')]=function(_0x132846,_0x19000c){if(_0x132846[_0x0ad9('0x4a')]['id']){delete _0x132846[_0x0ad9('0x4a')]['id'];}return db[_0x0ad9('0x3f')]['find']({'where':{'id':_0x132846[_0x0ad9('0x45')]['id']}})[_0x0ad9('0x41')](handleEntityNotFound(_0x19000c,null))[_0x0ad9('0x41')](saveUpdates(_0x132846[_0x0ad9('0x4a')],null))[_0x0ad9('0x41')](respondWithResult(_0x19000c,null))[_0x0ad9('0x43')](handleError(_0x19000c,null));};exports['destroy']=function(_0x22e97b,_0x23021d){return db[_0x0ad9('0x3f')][_0x0ad9('0x4b')]({'where':{'id':_0x22e97b[_0x0ad9('0x45')]['id']}})[_0x0ad9('0x41')](handleEntityNotFound(_0x23021d,null))[_0x0ad9('0x41')](removeEntity(_0x23021d,null))[_0x0ad9('0x43')](handleError(_0x23021d,null));}; \ No newline at end of file +var _0x66b4=['type','key','name','keys','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','ServicenowField','findAll','catch','show','intersection','include','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName'];(function(_0x1250c9,_0x4034c2){var _0x6fbaa=function(_0x368ea0){while(--_0x368ea0){_0x1250c9['push'](_0x1250c9['shift']());}};_0x6fbaa(++_0x4034c2);}(_0x66b4,0x153));var _0x466b=function(_0x240362,_0x2bd6b3){_0x240362=_0x240362-0x0;var _0x54a9db=_0x66b4[_0x240362];return _0x54a9db;};'use strict';var emlformat=require(_0x466b('0x0'));var rimraf=require(_0x466b('0x1'));var zipdir=require(_0x466b('0x2'));var jsonpatch=require(_0x466b('0x3'));var rp=require(_0x466b('0x4'));var moment=require(_0x466b('0x5'));var BPromise=require(_0x466b('0x6'));var Mustache=require(_0x466b('0x7'));var util=require(_0x466b('0x8'));var path=require('path');var sox=require(_0x466b('0x9'));var csv=require(_0x466b('0xa'));var ejs=require(_0x466b('0xb'));var fs=require('fs');var fs_extra=require(_0x466b('0xc'));var _=require(_0x466b('0xd'));var squel=require('squel');var crypto=require(_0x466b('0xe'));var jsforce=require(_0x466b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x466b('0xa'));var querystring=require(_0x466b('0x10'));var Papa=require('papaparse');var Redis=require(_0x466b('0x11'));var authService=require(_0x466b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x466b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x466b('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x466b('0x15'));var licenseUtil=require(_0x466b('0x16'));var db=require(_0x466b('0x17'))['db'];function respondWithStatusCode(_0x346aab,_0x1e6091){_0x1e6091=_0x1e6091||0xcc;return function(_0x1046a5){if(_0x1046a5){return _0x346aab[_0x466b('0x18')](_0x1e6091);}return _0x346aab[_0x466b('0x19')](_0x1e6091)[_0x466b('0x1a')]();};}function respondWithResult(_0x97f019,_0x35c6af){_0x35c6af=_0x35c6af||0xc8;return function(_0xaf87ae){if(_0xaf87ae){return _0x97f019[_0x466b('0x19')](_0x35c6af)['json'](_0xaf87ae);}};}function respondWithFilteredResult(_0x44d846,_0x12f0fd){return function(_0xe06bc1){if(_0xe06bc1){var _0xaf0c16=typeof _0x12f0fd[_0x466b('0x1b')]==='undefined'&&typeof _0x12f0fd['limit']===_0x466b('0x1c');var _0x404fce=_0xe06bc1[_0x466b('0x1d')];var _0x4d79ef=_0xaf0c16?0x0:_0x12f0fd[_0x466b('0x1b')];var _0x113154=_0xaf0c16?_0xe06bc1[_0x466b('0x1d')]:_0x12f0fd[_0x466b('0x1b')]+_0x12f0fd[_0x466b('0x1e')];var _0x3a23c5;if(_0x113154>=_0x404fce){_0x113154=_0x404fce;_0x3a23c5=0xc8;}else{_0x3a23c5=0xce;}_0x44d846[_0x466b('0x19')](_0x3a23c5);return _0x44d846[_0x466b('0x1f')](_0x466b('0x20'),_0x4d79ef+'-'+_0x113154+'/'+_0x404fce)[_0x466b('0x21')](_0xe06bc1);}return null;};}function patchUpdates(_0x2b7de0){return function(_0x598318){try{jsonpatch[_0x466b('0x22')](_0x598318,_0x2b7de0,!![]);}catch(_0x286e0e){return BPromise[_0x466b('0x23')](_0x286e0e);}return _0x598318[_0x466b('0x24')]();};}function saveUpdates(_0x28241c,_0x5bab23){return function(_0x479802){if(_0x479802){return _0x479802[_0x466b('0x25')](_0x28241c)[_0x466b('0x26')](function(_0x4b427c){return _0x4b427c;});}return null;};}function removeEntity(_0x247086,_0x183051){return function(_0x197b17){if(_0x197b17){return _0x197b17[_0x466b('0x27')]()['then'](function(){_0x247086['status'](0xcc)[_0x466b('0x1a')]();});}};}function handleEntityNotFound(_0x55cf1a,_0xb9f7a2){return function(_0x2d8ec8){if(!_0x2d8ec8){_0x55cf1a[_0x466b('0x18')](0x194);}return _0x2d8ec8;};}function handleError(_0x334d2d,_0xcd8b17){_0xcd8b17=_0xcd8b17||0x1f4;return function(_0x4c0452){logger[_0x466b('0x28')](_0x4c0452[_0x466b('0x29')]);if(_0x4c0452['name']){delete _0x4c0452['name'];}_0x334d2d[_0x466b('0x19')](_0xcd8b17)['send'](_0x4c0452);};}exports[_0x466b('0x2a')]=function(_0xa6475,_0x4cd1fb){var _0x5aa156={},_0x42613d={},_0x439c15={'count':0x0,'rows':[]};var _0x4b9600=_[_0x466b('0x2b')](db['ServicenowField'][_0x466b('0x2c')],function(_0x12671d){return{'name':_0x12671d[_0x466b('0x2d')],'type':_0x12671d[_0x466b('0x2e')][_0x466b('0x2f')]};});_0x42613d['model']=_['map'](_0x4b9600,_0x466b('0x30'));_0x42613d['query']=_[_0x466b('0x31')](_0xa6475[_0x466b('0x32')]);_0x42613d[_0x466b('0x33')]=_['intersection'](_0x42613d[_0x466b('0x34')],_0x42613d['query']);_0x5aa156['attributes']=_['intersection'](_0x42613d['model'],qs[_0x466b('0x35')](_0xa6475[_0x466b('0x32')][_0x466b('0x35')]));_0x5aa156[_0x466b('0x36')]=_0x5aa156[_0x466b('0x36')][_0x466b('0x37')]?_0x5aa156['attributes']:_0x42613d[_0x466b('0x34')];if(!_0xa6475[_0x466b('0x32')][_0x466b('0x38')](_0x466b('0x39'))){_0x5aa156[_0x466b('0x1e')]=qs['limit'](_0xa6475[_0x466b('0x32')]['limit']);_0x5aa156[_0x466b('0x1b')]=qs[_0x466b('0x1b')](_0xa6475[_0x466b('0x32')][_0x466b('0x1b')]);}_0x5aa156[_0x466b('0x3a')]=qs['sort'](_0xa6475[_0x466b('0x32')][_0x466b('0x3b')]);_0x5aa156[_0x466b('0x3c')]=qs[_0x466b('0x33')](_[_0x466b('0x3d')](_0xa6475[_0x466b('0x32')],_0x42613d['filters']),_0x4b9600);if(_0xa6475[_0x466b('0x32')]['filter']){_0x5aa156[_0x466b('0x3c')]=_[_0x466b('0x3e')](_0x5aa156[_0x466b('0x3c')],{'$or':_[_0x466b('0x2b')](_0x4b9600,function(_0x27307d){if(_0x27307d[_0x466b('0x2e')]!==_0x466b('0x3f')){var _0x1266b3={};_0x1266b3[_0x27307d['name']]={'$like':'%'+_0xa6475[_0x466b('0x32')][_0x466b('0x40')]+'%'};return _0x1266b3;}})});}_0x5aa156=_[_0x466b('0x3e')]({},_0x5aa156,_0xa6475['options']);var _0x1c3286={'where':_0x5aa156[_0x466b('0x3c')]};return db['ServicenowField'][_0x466b('0x1d')](_0x1c3286)[_0x466b('0x26')](function(_0xa1e685){_0x439c15[_0x466b('0x1d')]=_0xa1e685;if(_0xa6475['query'][_0x466b('0x41')]){_0x5aa156['include']=[{'all':!![]}];}return db[_0x466b('0x42')][_0x466b('0x43')](_0x5aa156);})['then'](function(_0x58781f){_0x439c15['rows']=_0x58781f;return _0x439c15;})['then'](respondWithFilteredResult(_0x4cd1fb,_0x5aa156))[_0x466b('0x44')](handleError(_0x4cd1fb,null));};exports[_0x466b('0x45')]=function(_0x35eacd,_0x18fe6e){var _0xb5b98f={'raw':!![],'where':{'id':_0x35eacd['params']['id']}},_0xa7f3e6={};_0xa7f3e6[_0x466b('0x34')]=_[_0x466b('0x31')](db[_0x466b('0x42')][_0x466b('0x2c')]);_0xa7f3e6[_0x466b('0x32')]=_['keys'](_0x35eacd[_0x466b('0x32')]);_0xa7f3e6[_0x466b('0x33')]=_[_0x466b('0x46')](_0xa7f3e6[_0x466b('0x34')],_0xa7f3e6['query']);_0xb5b98f[_0x466b('0x36')]=_[_0x466b('0x46')](_0xa7f3e6[_0x466b('0x34')],qs[_0x466b('0x35')](_0x35eacd[_0x466b('0x32')]['fields']));_0xb5b98f[_0x466b('0x36')]=_0xb5b98f[_0x466b('0x36')]['length']?_0xb5b98f['attributes']:_0xa7f3e6['model'];if(_0x35eacd['query'][_0x466b('0x41')]){_0xb5b98f[_0x466b('0x47')]=[{'all':!![]}];}_0xb5b98f=_[_0x466b('0x3e')]({},_0xb5b98f,_0x35eacd[_0x466b('0x48')]);return db['ServicenowField']['find'](_0xb5b98f)[_0x466b('0x26')](handleEntityNotFound(_0x18fe6e,null))[_0x466b('0x26')](respondWithResult(_0x18fe6e,null))['catch'](handleError(_0x18fe6e,null));};exports[_0x466b('0x49')]=function(_0x4ceffb,_0x4c4345){return db[_0x466b('0x42')][_0x466b('0x49')](_0x4ceffb[_0x466b('0x4a')],{})[_0x466b('0x26')](respondWithResult(_0x4c4345,0xc9))[_0x466b('0x44')](handleError(_0x4c4345,null));};exports['update']=function(_0x334594,_0x5a19bd){if(_0x334594['body']['id']){delete _0x334594[_0x466b('0x4a')]['id'];}return db[_0x466b('0x42')][_0x466b('0x4b')]({'where':{'id':_0x334594[_0x466b('0x4c')]['id']}})[_0x466b('0x26')](handleEntityNotFound(_0x5a19bd,null))[_0x466b('0x26')](saveUpdates(_0x334594[_0x466b('0x4a')],null))['then'](respondWithResult(_0x5a19bd,null))[_0x466b('0x44')](handleError(_0x5a19bd,null));};exports[_0x466b('0x27')]=function(_0x2c371c,_0x1a1d9e){return db[_0x466b('0x42')][_0x466b('0x4b')]({'where':{'id':_0x2c371c[_0x466b('0x4c')]['id']}})[_0x466b('0x26')](handleEntityNotFound(_0x1a1d9e,null))['then'](removeEntity(_0x1a1d9e,null))['catch'](handleError(_0x1a1d9e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 3b00e9b..8245e66 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 _0x490c=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId'];(function(_0x55a6ef,_0x3c992b){var _0x3cb2df=function(_0x325a08){while(--_0x325a08){_0x55a6ef['push'](_0x55a6ef['shift']());}};_0x3cb2df(++_0x3c992b);}(_0x490c,0x186));var _0xc490=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x490c[_0x72a33d];return _0x2621d5;};'use strict';var _=require(_0xc490('0x0'));var util=require('util');var logger=require(_0xc490('0x1'))(_0xc490('0x2'));var moment=require(_0xc490('0x3'));var BPromise=require(_0xc490('0x4'));var rp=require(_0xc490('0x5'));var fs=require('fs');var path=require(_0xc490('0x6'));var rimraf=require(_0xc490('0x7'));var config=require(_0xc490('0x8'));var attributes=require('./intServicenowField.attributes');module[_0xc490('0x9')]=function(_0x5359f5,_0x432ae9){return _0x5359f5[_0xc490('0xa')](_0xc490('0xb'),attributes,{'tableName':_0xc490('0xc'),'paranoid':![],'indexes':[{'name':_0xc490('0xd'),'fields':['idField',_0xc490('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf443=['idField','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x4f0080,_0x5221d2){var _0x1c5234=function(_0x2d6b57){while(--_0x2d6b57){_0x4f0080['push'](_0x4f0080['shift']());}};_0x1c5234(++_0x5221d2);}(_0xf443,0xc4));var _0x3f44=function(_0x555431,_0x5c80ee){_0x555431=_0x555431-0x0;var _0x50bfd8=_0xf443[_0x555431];return _0x50bfd8;};'use strict';var _=require(_0x3f44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f44('0x1'));var moment=require('moment');var BPromise=require(_0x3f44('0x2'));var rp=require(_0x3f44('0x3'));var fs=require('fs');var path=require(_0x3f44('0x4'));var rimraf=require(_0x3f44('0x5'));var config=require(_0x3f44('0x6'));var attributes=require(_0x3f44('0x7'));module[_0x3f44('0x8')]=function(_0x34e8a8,_0x6a529c){return _0x34e8a8['define'](_0x3f44('0x9'),attributes,{'tableName':_0x3f44('0xa'),'paranoid':![],'indexes':[{'name':_0x3f44('0xb'),'fields':[_0x3f44('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index fd8ed8c..2626550 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 _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x565a7b,_0x398183){var _0x532f6d=function(_0x42ca7d){while(--_0x42ca7d){_0x565a7b['push'](_0x565a7b['shift']());}};_0x532f6d(++_0x398183);}(_0x9bde,0xe1));var _0xe9bd=function(_0x55159a,_0x2e58eb){_0x55159a=_0x55159a-0x0;var _0x3c4eea=_0x9bde[_0x55159a];return _0x3c4eea;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xbab33a,_0x1d65cd){var _0x142d57=function(_0x4f6b29){while(--_0x4f6b29){_0xbab33a['push'](_0xbab33a['shift']());}};_0x142d57(++_0x1d65cd);}(_0xf4eb,0xec));var _0xbf4e=function(_0x388b15,_0x4c9a87){_0x388b15=_0x388b15-0x0;var _0x5d4b7a=_0xf4eb[_0x388b15];return _0x5d4b7a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index dd4538d..5bd761c 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xfcd32e,_0x158184){var _0x330c0d=function(_0x24fd37){while(--_0x24fd37){_0xfcd32e['push'](_0xfcd32e['shift']());}};_0x330c0d(++_0x158184);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2018e2,_0x9f7e76){var _0xb52669=function(_0x1fb636){while(--_0x1fb636){_0x2018e2['push'](_0x2018e2['shift']());}};_0xb52669(++_0x9f7e76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 5d8acb5..5ebb49a 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(_0x36c552,_0x52238f){var _0x2a00d6=function(_0x5251a1){while(--_0x5251a1){_0x36c552['push'](_0x36c552['shift']());}};_0x2a00d6(++_0x52238f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0xc415d0,_0x279bb8){var _0x200069=function(_0x4429ff){while(--_0x4429ff){_0xc415d0['push'](_0xc415d0['shift']());}};_0x200069(++_0x279bb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 7f627d2..9387311 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 _0xfe17=['type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','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','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName'];(function(_0x10abfe,_0x7a9ad6){var _0x473c1b=function(_0x392758){while(--_0x392758){_0x10abfe['push'](_0x10abfe['shift']());}};_0x473c1b(++_0x7a9ad6);}(_0xfe17,0x147));var _0x7fe1=function(_0x43f07a,_0x293f15){_0x43f07a=_0x43f07a-0x0;var _0x2d065c=_0xfe17[_0x43f07a];return _0x2d065c;};'use strict';var emlformat=require(_0x7fe1('0x0'));var rimraf=require(_0x7fe1('0x1'));var zipdir=require(_0x7fe1('0x2'));var jsonpatch=require(_0x7fe1('0x3'));var rp=require(_0x7fe1('0x4'));var moment=require(_0x7fe1('0x5'));var BPromise=require(_0x7fe1('0x6'));var Mustache=require('mustache');var util=require(_0x7fe1('0x7'));var path=require(_0x7fe1('0x8'));var sox=require(_0x7fe1('0x9'));var csv=require(_0x7fe1('0xa'));var ejs=require(_0x7fe1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fe1('0xc'));var squel=require(_0x7fe1('0xd'));var crypto=require(_0x7fe1('0xe'));var jsforce=require(_0x7fe1('0xf'));var deskjs=require(_0x7fe1('0x10'));var toCsv=require(_0x7fe1('0xa'));var querystring=require(_0x7fe1('0x11'));var Papa=require(_0x7fe1('0x12'));var Redis=require(_0x7fe1('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7fe1('0x14'));var hardwareService=require(_0x7fe1('0x15'));var logger=require(_0x7fe1('0x16'))(_0x7fe1('0x17'));var utils=require(_0x7fe1('0x18'));var config=require(_0x7fe1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7fe1('0x1a'))['db'];var integrations=require(_0x7fe1('0x1b'));function respondWithStatusCode(_0x6ce6ed,_0xf17ae6){_0xf17ae6=_0xf17ae6||0xcc;return function(_0x555fd6){if(_0x555fd6){return _0x6ce6ed['sendStatus'](_0xf17ae6);}return _0x6ce6ed[_0x7fe1('0x1c')](_0xf17ae6)['end']();};}function respondWithResult(_0x4d30a3,_0x4df588){_0x4df588=_0x4df588||0xc8;return function(_0x4b9d59){if(_0x4b9d59){return _0x4d30a3[_0x7fe1('0x1c')](_0x4df588)['json'](_0x4b9d59);}};}function respondWithFilteredResult(_0x2a544d,_0x208ca2){return function(_0x42a49b){if(_0x42a49b){var _0xefabe9=typeof _0x208ca2[_0x7fe1('0x1d')]===_0x7fe1('0x1e')&&typeof _0x208ca2[_0x7fe1('0x1f')]===_0x7fe1('0x1e');var _0x2debed=_0x42a49b[_0x7fe1('0x20')];var _0x1296ff=_0xefabe9?0x0:_0x208ca2['offset'];var _0x3a63d7=_0xefabe9?_0x42a49b[_0x7fe1('0x20')]:_0x208ca2[_0x7fe1('0x1d')]+_0x208ca2[_0x7fe1('0x1f')];var _0x9e8d09;if(_0x3a63d7>=_0x2debed){_0x3a63d7=_0x2debed;_0x9e8d09=0xc8;}else{_0x9e8d09=0xce;}_0x2a544d[_0x7fe1('0x1c')](_0x9e8d09);return _0x2a544d[_0x7fe1('0x21')](_0x7fe1('0x22'),_0x1296ff+'-'+_0x3a63d7+'/'+_0x2debed)[_0x7fe1('0x23')](_0x42a49b);}return null;};}function patchUpdates(_0x286a0f){return function(_0x4264d6){try{jsonpatch['apply'](_0x4264d6,_0x286a0f,!![]);}catch(_0x92797d){return BPromise[_0x7fe1('0x24')](_0x92797d);}return _0x4264d6[_0x7fe1('0x25')]();};}function saveUpdates(_0x248a65,_0x18af2e){return function(_0x1bf1f1){if(_0x1bf1f1){return _0x1bf1f1[_0x7fe1('0x26')](_0x248a65)[_0x7fe1('0x27')](function(_0x2d021a){return _0x2d021a;});}return null;};}function removeEntity(_0x4814cb,_0x29a099){return function(_0x3f1153){if(_0x3f1153){return _0x3f1153[_0x7fe1('0x28')]()['then'](function(){_0x4814cb[_0x7fe1('0x1c')](0xcc)[_0x7fe1('0x29')]();});}};}function handleEntityNotFound(_0x4380df,_0x37e8f0){return function(_0x207c90){if(!_0x207c90){_0x4380df[_0x7fe1('0x2a')](0x194);}return _0x207c90;};}function handleError(_0x410e13,_0x311c88){_0x311c88=_0x311c88||0x1f4;return function(_0x13a2f8){logger[_0x7fe1('0x2b')](_0x13a2f8[_0x7fe1('0x2c')]);if(_0x13a2f8[_0x7fe1('0x2d')]){delete _0x13a2f8['name'];}_0x410e13['status'](_0x311c88)[_0x7fe1('0x2e')](_0x13a2f8);};}exports['index']=function(_0x44616b,_0x95ec28){var _0x599b02={},_0x1e8a08={},_0x3a1372={'count':0x0,'rows':[]};var _0xbb82dc=_[_0x7fe1('0x2f')](db[_0x7fe1('0x30')][_0x7fe1('0x31')],function(_0x1ba493){return{'name':_0x1ba493[_0x7fe1('0x32')],'type':_0x1ba493[_0x7fe1('0x33')]['key']};});_0x1e8a08[_0x7fe1('0x34')]=_[_0x7fe1('0x2f')](_0xbb82dc,_0x7fe1('0x2d'));_0x1e8a08[_0x7fe1('0x35')]=_[_0x7fe1('0x36')](_0x44616b[_0x7fe1('0x35')]);_0x1e8a08[_0x7fe1('0x37')]=_[_0x7fe1('0x38')](_0x1e8a08['model'],_0x1e8a08[_0x7fe1('0x35')]);_0x599b02[_0x7fe1('0x39')]=_[_0x7fe1('0x38')](_0x1e8a08[_0x7fe1('0x34')],qs[_0x7fe1('0x3a')](_0x44616b[_0x7fe1('0x35')][_0x7fe1('0x3a')]));_0x599b02[_0x7fe1('0x39')]=_0x599b02[_0x7fe1('0x39')]['length']?_0x599b02[_0x7fe1('0x39')]:_0x1e8a08['model'];if(!_0x44616b[_0x7fe1('0x35')][_0x7fe1('0x3b')](_0x7fe1('0x3c'))){_0x599b02[_0x7fe1('0x1f')]=qs['limit'](_0x44616b[_0x7fe1('0x35')][_0x7fe1('0x1f')]);_0x599b02[_0x7fe1('0x1d')]=qs['offset'](_0x44616b[_0x7fe1('0x35')][_0x7fe1('0x1d')]);}_0x599b02['order']=qs[_0x7fe1('0x3d')](_0x44616b[_0x7fe1('0x35')]['sort']);_0x599b02[_0x7fe1('0x3e')]=qs[_0x7fe1('0x37')](_[_0x7fe1('0x3f')](_0x44616b[_0x7fe1('0x35')],_0x1e8a08['filters']),_0xbb82dc);if(_0x44616b['query'][_0x7fe1('0x40')]){_0x599b02[_0x7fe1('0x3e')]=_[_0x7fe1('0x41')](_0x599b02[_0x7fe1('0x3e')],{'$or':_[_0x7fe1('0x2f')](_0xbb82dc,function(_0x41d7d1){if(_0x41d7d1[_0x7fe1('0x33')]!==_0x7fe1('0x42')){var _0x1ec7e5={};_0x1ec7e5[_0x41d7d1['name']]={'$like':'%'+_0x44616b[_0x7fe1('0x35')][_0x7fe1('0x40')]+'%'};return _0x1ec7e5;}})});}_0x599b02=_[_0x7fe1('0x41')]({},_0x599b02,_0x44616b[_0x7fe1('0x43')]);var _0x5eeced={'where':_0x599b02[_0x7fe1('0x3e')]};return db[_0x7fe1('0x30')][_0x7fe1('0x20')](_0x5eeced)['then'](function(_0x5ceba0){_0x3a1372['count']=_0x5ceba0;if(_0x44616b['query'][_0x7fe1('0x44')]){_0x599b02[_0x7fe1('0x45')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x7fe1('0x46')](_0x599b02);})[_0x7fe1('0x27')](function(_0x339e52){_0x3a1372[_0x7fe1('0x47')]=_0x339e52;return _0x3a1372;})['then'](respondWithFilteredResult(_0x95ec28,_0x599b02))[_0x7fe1('0x48')](handleError(_0x95ec28,null));};exports[_0x7fe1('0x49')]=function(_0x5a731f,_0x279cec){var _0xa24eaa={'raw':![],'where':{'id':_0x5a731f[_0x7fe1('0x4a')]['id']}},_0x1d041c={};_0x1d041c['model']=_['keys'](db[_0x7fe1('0x30')][_0x7fe1('0x31')]);_0x1d041c['query']=_[_0x7fe1('0x36')](_0x5a731f[_0x7fe1('0x35')]);_0x1d041c[_0x7fe1('0x37')]=_[_0x7fe1('0x38')](_0x1d041c[_0x7fe1('0x34')],_0x1d041c[_0x7fe1('0x35')]);_0xa24eaa['attributes']=_[_0x7fe1('0x38')](_0x1d041c[_0x7fe1('0x34')],qs[_0x7fe1('0x3a')](_0x5a731f[_0x7fe1('0x35')][_0x7fe1('0x3a')]));_0xa24eaa[_0x7fe1('0x39')]=_0xa24eaa['attributes'][_0x7fe1('0x4b')]?_0xa24eaa['attributes']:_0x1d041c[_0x7fe1('0x34')];if(_0x5a731f[_0x7fe1('0x35')][_0x7fe1('0x44')]){_0xa24eaa[_0x7fe1('0x45')]=[{'all':!![]}];}_0xa24eaa=_[_0x7fe1('0x41')]({},_0xa24eaa,_0x5a731f['options']);return db['SugarcrmAccount'][_0x7fe1('0x4c')](_0xa24eaa)['then'](handleEntityNotFound(_0x279cec,null))[_0x7fe1('0x27')](respondWithResult(_0x279cec,null))[_0x7fe1('0x48')](handleError(_0x279cec,null));};exports['create']=function(_0x36a048,_0x5007cd){return db[_0x7fe1('0x30')][_0x7fe1('0x4d')](_0x36a048[_0x7fe1('0x4e')],{})[_0x7fe1('0x27')](respondWithResult(_0x5007cd,0xc9))[_0x7fe1('0x48')](handleError(_0x5007cd,null));};exports['update']=function(_0x186583,_0x2799dc){if(_0x186583[_0x7fe1('0x4e')]['id']){delete _0x186583[_0x7fe1('0x4e')]['id'];}return db[_0x7fe1('0x30')][_0x7fe1('0x4c')]({'where':{'id':_0x186583['params']['id']}})[_0x7fe1('0x27')](handleEntityNotFound(_0x2799dc,null))['then'](saveUpdates(_0x186583[_0x7fe1('0x4e')],null))[_0x7fe1('0x27')](respondWithResult(_0x2799dc,null))['catch'](handleError(_0x2799dc,null));};exports[_0x7fe1('0x28')]=function(_0x43f6a0,_0x13ed6f){return db[_0x7fe1('0x30')][_0x7fe1('0x4c')]({'where':{'id':_0x43f6a0[_0x7fe1('0x4a')]['id']}})[_0x7fe1('0x27')](handleEntityNotFound(_0x13ed6f,null))[_0x7fe1('0x27')](removeEntity(_0x13ed6f,null))[_0x7fe1('0x48')](handleError(_0x13ed6f,null));};exports[_0x7fe1('0x4f')]=function(_0x14cb28,_0x562475,_0x1fb904){var _0x1892a2={};var _0x532b32={};var _0x55b90d;var _0x305c78;return db[_0x7fe1('0x30')][_0x7fe1('0x50')]({'where':{'id':_0x14cb28[_0x7fe1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x562475,null))['then'](function(_0x1afc31){if(_0x1afc31){_0x55b90d=_0x1afc31;_0x532b32[_0x7fe1('0x34')]=_[_0x7fe1('0x36')](db[_0x7fe1('0x51')][_0x7fe1('0x31')]);_0x532b32[_0x7fe1('0x35')]=_['keys'](_0x14cb28[_0x7fe1('0x35')]);_0x532b32[_0x7fe1('0x37')]=_['intersection'](_0x532b32['model'],_0x532b32['query']);_0x1892a2[_0x7fe1('0x39')]=_['intersection'](_0x532b32[_0x7fe1('0x34')],qs['fields'](_0x14cb28['query'][_0x7fe1('0x3a')]));_0x1892a2[_0x7fe1('0x39')]=_0x1892a2['attributes'][_0x7fe1('0x4b')]?_0x1892a2['attributes']:_0x532b32[_0x7fe1('0x34')];_0x1892a2[_0x7fe1('0x52')]=qs[_0x7fe1('0x3d')](_0x14cb28['query'][_0x7fe1('0x3d')]);_0x1892a2[_0x7fe1('0x3e')]=qs['filters'](_['pick'](_0x14cb28[_0x7fe1('0x35')],_0x532b32[_0x7fe1('0x37')]));if(_0x14cb28[_0x7fe1('0x35')][_0x7fe1('0x40')]){_0x1892a2[_0x7fe1('0x3e')]=_[_0x7fe1('0x41')](_0x1892a2[_0x7fe1('0x3e')],{'$or':_[_0x7fe1('0x2f')](_0x1892a2[_0x7fe1('0x39')],function(_0x481ec6){var _0x4b4b88={};_0x4b4b88[_0x481ec6]={'$like':'%'+_0x14cb28[_0x7fe1('0x35')][_0x7fe1('0x40')]+'%'};return _0x4b4b88;})});}_0x1892a2=_[_0x7fe1('0x41')]({},_0x1892a2,_0x14cb28[_0x7fe1('0x43')]);return _0x55b90d[_0x7fe1('0x4f')](_0x1892a2);}})[_0x7fe1('0x27')](function(_0x5d7831){if(_0x5d7831){_0x305c78=_0x5d7831[_0x7fe1('0x4b')];if(!_0x14cb28[_0x7fe1('0x35')][_0x7fe1('0x3b')](_0x7fe1('0x3c'))){_0x1892a2['limit']=qs['limit'](_0x14cb28[_0x7fe1('0x35')]['limit']);_0x1892a2[_0x7fe1('0x1d')]=qs['offset'](_0x14cb28[_0x7fe1('0x35')][_0x7fe1('0x1d')]);}return _0x55b90d[_0x7fe1('0x4f')](_0x1892a2);}})[_0x7fe1('0x27')](function(_0x144fec){if(_0x144fec){return _0x144fec?{'count':_0x305c78,'rows':_0x144fec}:null;}})[_0x7fe1('0x27')](respondWithResult(_0x562475,null))[_0x7fe1('0x48')](handleError(_0x562475,null));};exports[_0x7fe1('0x53')]=function(_0x21b697,_0x504b05,_0x2c07ed){if(_0x21b697[_0x7fe1('0x4e')]['id']){delete _0x21b697['body']['id'];}return db[_0x7fe1('0x30')][_0x7fe1('0x50')]({'where':{'id':_0x21b697[_0x7fe1('0x4a')]['id']}})[_0x7fe1('0x27')](handleEntityNotFound(_0x504b05,null))[_0x7fe1('0x27')](function(_0x2c546a){if(_0x2c546a){_0x21b697[_0x7fe1('0x4e')]['AccountId']=_0x2c546a['id'];_0x21b697['body'][_0x7fe1('0x54')]=integrations[_0x7fe1('0x55')](_0x21b697[_0x7fe1('0x4e')]['channel'],_0x21b697[_0x7fe1('0x4e')][_0x7fe1('0x33')]);_0x21b697[_0x7fe1('0x4e')][_0x7fe1('0x56')]=integrations[_0x7fe1('0x57')](_0x21b697[_0x7fe1('0x4e')][_0x7fe1('0x58')],_0x21b697[_0x7fe1('0x4e')][_0x7fe1('0x33')]);return db['SugarcrmConfiguration'][_0x7fe1('0x4d')](_0x21b697[_0x7fe1('0x4e')],{'include':[{'model':db[_0x7fe1('0x59')],'as':_0x7fe1('0x54')},{'model':db[_0x7fe1('0x59')],'as':_0x7fe1('0x56')}]});}return null;})[_0x7fe1('0x27')](respondWithResult(_0x504b05,null))[_0x7fe1('0x48')](handleError(_0x504b05,null));};exports[_0x7fe1('0x5a')]=function(_0x250e4f,_0x3a3036,_0x43d9d3){var _0x2e5d0b='';var _0x261b91=['id','name',_0x7fe1('0x5b'),_0x7fe1('0x5c'),_0x7fe1('0x5d'),_0x7fe1('0x5e'),_0x7fe1('0x5f'),_0x7fe1('0x60'),_0x7fe1('0x61'),_0x7fe1('0x62'),_0x7fe1('0x63'),_0x7fe1('0x64')];return db[_0x7fe1('0x30')][_0x7fe1('0x50')]({'where':{'id':_0x250e4f[_0x7fe1('0x4a')]['id']},'attributes':['id',_0x7fe1('0x65'),_0x7fe1('0x66'),'remoteUri']})['then'](handleEntityNotFound(_0x3a3036,null))[_0x7fe1('0x27')](function(_0x564b46){if(_0x564b46){_0x2e5d0b=_0x564b46[_0x7fe1('0x67')];var _0x2238b2=_0x2e5d0b[_0x7fe1('0x68')](-0x1);if(_0x2238b2==='/'){_0x2e5d0b=_0x2e5d0b[_0x7fe1('0x69')](0x0,_0x2e5d0b[_0x7fe1('0x6a')](_0x2238b2));}return rp({'method':'POST','uri':util[_0x7fe1('0x6b')]('%s%s',_0x2e5d0b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x7fe1('0x6c'),'input_type':'JSON','response_type':_0x7fe1('0x6d'),'rest_data':JSON[_0x7fe1('0x6e')]({'user_auth':{'user_name':_0x564b46[_0x7fe1('0x65')],'password':_0x564b46['password'],'encryption':'PLAIN'},'application':_0x7fe1('0x6f')})}});}})[_0x7fe1('0x27')](function(_0x553c9c){if(_0x553c9c&&_0x553c9c['name']!==_0x7fe1('0x70')&&_0x553c9c[_0x7fe1('0x2d')]!==_0x7fe1('0x71')){return rp({'method':'POST','uri':util[_0x7fe1('0x6b')]('%s%s',_0x2e5d0b,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x7fe1('0x72'),'input_type':_0x7fe1('0x6d'),'response_type':_0x7fe1('0x6d'),'rest_data':JSON[_0x7fe1('0x6e')]({'session':_0x553c9c['id'],'module_name':_0x7fe1('0x73')})}})[_0x7fe1('0x27')](function(_0x3dc43a){if(_0x3dc43a){var _0x3c3c58=_[_0x7fe1('0x74')](_0x3dc43a[_0x7fe1('0x75')]);_[_0x7fe1('0x76')](_0x3c3c58,function(_0xb52198){return _0x261b91[_0x7fe1('0x77')](_0xb52198[_0x7fe1('0x2d')]);});return{'count':_0x3c3c58[_0x7fe1('0x4b')],'rows':_['map'](_0x3c3c58,function(_0x55e564){return{'id':_0x55e564[_0x7fe1('0x2d')],'name':_0x55e564[_0x7fe1('0x78')],'custom':_[_0x7fe1('0x79')](_0x55e564[_0x7fe1('0x2d')],'_c')?!![]:![],'options':_0x55e564[_0x7fe1('0x43')]?_['map'](_['values'](_0x55e564[_0x7fe1('0x43')]),function(_0x530dd4){return{'name':_0x530dd4[_0x7fe1('0x7a')],'value':_0x530dd4[_0x7fe1('0x2d')]};}):[]};})};}})[_0x7fe1('0x27')](respondWithResult(_0x3a3036,null))[_0x7fe1('0x48')](function(_0x355f99){var _0x5607fd=_0x250e4f[_0x7fe1('0x35')][_0x7fe1('0x7b')]?0x1f4:_0x355f99['statusCode']||0x1f4;logger[_0x7fe1('0x2b')](_0x7fe1('0x7c'),_0x7fe1('0x5a'),_0x5607fd,JSON['stringify'](_0x355f99));delete _0x355f99[_0x7fe1('0x2d')];if(_0x5607fd===0x191){_0x5607fd=0x190;}_0x3a3036['status'](_0x5607fd)[_0x7fe1('0x2e')](_0x250e4f[_0x7fe1('0x35')][_0x7fe1('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x355f99['statusCode']}:_0x355f99);});}else{var _0x439ef1=0x1f4;_0x3a3036['status'](_0x439ef1)[_0x7fe1('0x2e')]({'message':_0x7fe1('0x7d'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xc74e=['statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','error','name','send','index','SugarcrmAccount','fieldName','map','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','update','getConfigurations','findOne','SugarcrmConfiguration','length','pick','addConfiguration','AccountId','channel','Descriptions','SugarcrmField','Subjects','assigned_user_id','created_by','description','duration_hours','parent_type','parent_name','username','remoteUri','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Calls','values','module_fields','remove','includes','endsWith','value','test'];(function(_0xef792f,_0x22b25e){var _0x2c6714=function(_0x129ea2){while(--_0x129ea2){_0xef792f['push'](_0xef792f['shift']());}};_0x2c6714(++_0x22b25e);}(_0xc74e,0x159));var _0xec74=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc74e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xec74('0x0'));var rimraf=require(_0xec74('0x1'));var zipdir=require(_0xec74('0x2'));var jsonpatch=require(_0xec74('0x3'));var rp=require(_0xec74('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xec74('0x5'));var util=require(_0xec74('0x6'));var path=require(_0xec74('0x7'));var sox=require(_0xec74('0x8'));var csv=require(_0xec74('0x9'));var ejs=require(_0xec74('0xa'));var fs=require('fs');var fs_extra=require(_0xec74('0xb'));var _=require(_0xec74('0xc'));var squel=require(_0xec74('0xd'));var crypto=require(_0xec74('0xe'));var jsforce=require(_0xec74('0xf'));var deskjs=require(_0xec74('0x10'));var toCsv=require('to-csv');var querystring=require(_0xec74('0x11'));var Papa=require('papaparse');var Redis=require(_0xec74('0x12'));var authService=require(_0xec74('0x13'));var qs=require(_0xec74('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec74('0x15'));var logger=require(_0xec74('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xec74('0x17'));var licenseUtil=require(_0xec74('0x18'));var db=require(_0xec74('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x21257d,_0x5f5dd9){_0x5f5dd9=_0x5f5dd9||0xcc;return function(_0x31e99a){if(_0x31e99a){return _0x21257d[_0xec74('0x1a')](_0x5f5dd9);}return _0x21257d['status'](_0x5f5dd9)[_0xec74('0x1b')]();};}function respondWithResult(_0x43ced2,_0x2752ed){_0x2752ed=_0x2752ed||0xc8;return function(_0x3c7784){if(_0x3c7784){return _0x43ced2[_0xec74('0x1c')](_0x2752ed)['json'](_0x3c7784);}};}function respondWithFilteredResult(_0x5bb31e,_0x3cd6ee){return function(_0x515652){if(_0x515652){var _0x3faef2=typeof _0x3cd6ee[_0xec74('0x1d')]===_0xec74('0x1e')&&typeof _0x3cd6ee['limit']===_0xec74('0x1e');var _0x5cdf3b=_0x515652['count'];var _0xcb7d5a=_0x3faef2?0x0:_0x3cd6ee[_0xec74('0x1d')];var _0x1809a6=_0x3faef2?_0x515652[_0xec74('0x1f')]:_0x3cd6ee[_0xec74('0x1d')]+_0x3cd6ee[_0xec74('0x20')];var _0x770394;if(_0x1809a6>=_0x5cdf3b){_0x1809a6=_0x5cdf3b;_0x770394=0xc8;}else{_0x770394=0xce;}_0x5bb31e[_0xec74('0x1c')](_0x770394);return _0x5bb31e[_0xec74('0x21')](_0xec74('0x22'),_0xcb7d5a+'-'+_0x1809a6+'/'+_0x5cdf3b)[_0xec74('0x23')](_0x515652);}return null;};}function patchUpdates(_0x3d3a45){return function(_0x2a5aab){try{jsonpatch[_0xec74('0x24')](_0x2a5aab,_0x3d3a45,!![]);}catch(_0x1381bb){return BPromise['reject'](_0x1381bb);}return _0x2a5aab[_0xec74('0x25')]();};}function saveUpdates(_0x36e3da,_0x2870cc){return function(_0x135992){if(_0x135992){return _0x135992['update'](_0x36e3da)[_0xec74('0x26')](function(_0x28f4d0){return _0x28f4d0;});}return null;};}function removeEntity(_0x4aae27,_0x5071da){return function(_0x34ab25){if(_0x34ab25){return _0x34ab25['destroy']()[_0xec74('0x26')](function(){_0x4aae27[_0xec74('0x1c')](0xcc)[_0xec74('0x1b')]();});}};}function handleEntityNotFound(_0x3b094b,_0x53b1c7){return function(_0x14d3f7){if(!_0x14d3f7){_0x3b094b['sendStatus'](0x194);}return _0x14d3f7;};}function handleError(_0x5c72ea,_0x37a418){_0x37a418=_0x37a418||0x1f4;return function(_0x1a1ff2){logger[_0xec74('0x27')](_0x1a1ff2['stack']);if(_0x1a1ff2[_0xec74('0x28')]){delete _0x1a1ff2['name'];}_0x5c72ea[_0xec74('0x1c')](_0x37a418)[_0xec74('0x29')](_0x1a1ff2);};}exports[_0xec74('0x2a')]=function(_0x3d484e,_0x27f6e7){var _0xf8da16={},_0x1e231f={},_0x195def={'count':0x0,'rows':[]};var _0x44a018=_['map'](db[_0xec74('0x2b')]['rawAttributes'],function(_0xd2c360){return{'name':_0xd2c360[_0xec74('0x2c')],'type':_0xd2c360['type']['key']};});_0x1e231f['model']=_[_0xec74('0x2d')](_0x44a018,'name');_0x1e231f['query']=_['keys'](_0x3d484e[_0xec74('0x2e')]);_0x1e231f[_0xec74('0x2f')]=_['intersection'](_0x1e231f[_0xec74('0x30')],_0x1e231f[_0xec74('0x2e')]);_0xf8da16[_0xec74('0x31')]=_[_0xec74('0x32')](_0x1e231f[_0xec74('0x30')],qs[_0xec74('0x33')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x33')]));_0xf8da16[_0xec74('0x31')]=_0xf8da16[_0xec74('0x31')]['length']?_0xf8da16[_0xec74('0x31')]:_0x1e231f[_0xec74('0x30')];if(!_0x3d484e[_0xec74('0x2e')][_0xec74('0x34')](_0xec74('0x35'))){_0xf8da16['limit']=qs[_0xec74('0x20')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x20')]);_0xf8da16['offset']=qs[_0xec74('0x1d')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x1d')]);}_0xf8da16[_0xec74('0x36')]=qs[_0xec74('0x37')](_0x3d484e[_0xec74('0x2e')][_0xec74('0x37')]);_0xf8da16[_0xec74('0x38')]=qs[_0xec74('0x2f')](_['pick'](_0x3d484e[_0xec74('0x2e')],_0x1e231f[_0xec74('0x2f')]),_0x44a018);if(_0x3d484e['query'][_0xec74('0x39')]){_0xf8da16['where']=_[_0xec74('0x3a')](_0xf8da16[_0xec74('0x38')],{'$or':_[_0xec74('0x2d')](_0x44a018,function(_0x16b972){if(_0x16b972[_0xec74('0x3b')]!=='VIRTUAL'){var _0x29ea31={};_0x29ea31[_0x16b972[_0xec74('0x28')]]={'$like':'%'+_0x3d484e[_0xec74('0x2e')]['filter']+'%'};return _0x29ea31;}})});}_0xf8da16=_[_0xec74('0x3a')]({},_0xf8da16,_0x3d484e[_0xec74('0x3c')]);var _0x217026={'where':_0xf8da16[_0xec74('0x38')]};return db[_0xec74('0x2b')][_0xec74('0x1f')](_0x217026)[_0xec74('0x26')](function(_0x52fecc){_0x195def[_0xec74('0x1f')]=_0x52fecc;if(_0x3d484e['query'][_0xec74('0x3d')]){_0xf8da16[_0xec74('0x3e')]=[{'all':!![]}];}return db[_0xec74('0x2b')][_0xec74('0x3f')](_0xf8da16);})['then'](function(_0x215fe0){_0x195def[_0xec74('0x40')]=_0x215fe0;return _0x195def;})[_0xec74('0x26')](respondWithFilteredResult(_0x27f6e7,_0xf8da16))[_0xec74('0x41')](handleError(_0x27f6e7,null));};exports['show']=function(_0x427fcd,_0x3e5390){var _0x1d145d={'raw':![],'where':{'id':_0x427fcd[_0xec74('0x42')]['id']}},_0x788406={};_0x788406[_0xec74('0x30')]=_[_0xec74('0x43')](db[_0xec74('0x2b')][_0xec74('0x44')]);_0x788406[_0xec74('0x2e')]=_[_0xec74('0x43')](_0x427fcd[_0xec74('0x2e')]);_0x788406[_0xec74('0x2f')]=_[_0xec74('0x32')](_0x788406[_0xec74('0x30')],_0x788406[_0xec74('0x2e')]);_0x1d145d[_0xec74('0x31')]=_[_0xec74('0x32')](_0x788406['model'],qs[_0xec74('0x33')](_0x427fcd[_0xec74('0x2e')]['fields']));_0x1d145d['attributes']=_0x1d145d[_0xec74('0x31')]['length']?_0x1d145d[_0xec74('0x31')]:_0x788406['model'];if(_0x427fcd[_0xec74('0x2e')][_0xec74('0x3d')]){_0x1d145d[_0xec74('0x3e')]=[{'all':!![]}];}_0x1d145d=_[_0xec74('0x3a')]({},_0x1d145d,_0x427fcd[_0xec74('0x3c')]);return db[_0xec74('0x2b')][_0xec74('0x45')](_0x1d145d)[_0xec74('0x26')](handleEntityNotFound(_0x3e5390,null))[_0xec74('0x26')](respondWithResult(_0x3e5390,null))['catch'](handleError(_0x3e5390,null));};exports[_0xec74('0x46')]=function(_0x8ffe49,_0xa395a){return db[_0xec74('0x2b')]['create'](_0x8ffe49[_0xec74('0x47')],{})['then'](respondWithResult(_0xa395a,0xc9))[_0xec74('0x41')](handleError(_0xa395a,null));};exports[_0xec74('0x48')]=function(_0x3a0677,_0x5ae83a){if(_0x3a0677['body']['id']){delete _0x3a0677[_0xec74('0x47')]['id'];}return db['SugarcrmAccount'][_0xec74('0x45')]({'where':{'id':_0x3a0677['params']['id']}})[_0xec74('0x26')](handleEntityNotFound(_0x5ae83a,null))[_0xec74('0x26')](saveUpdates(_0x3a0677[_0xec74('0x47')],null))['then'](respondWithResult(_0x5ae83a,null))[_0xec74('0x41')](handleError(_0x5ae83a,null));};exports['destroy']=function(_0xc3aa84,_0x1341c9){return db[_0xec74('0x2b')][_0xec74('0x45')]({'where':{'id':_0xc3aa84[_0xec74('0x42')]['id']}})[_0xec74('0x26')](handleEntityNotFound(_0x1341c9,null))[_0xec74('0x26')](removeEntity(_0x1341c9,null))[_0xec74('0x41')](handleError(_0x1341c9,null));};exports[_0xec74('0x49')]=function(_0x562277,_0x522b64,_0x47478c){var _0x216181={};var _0x7fec05={};var _0xd7ebf3;var _0x3418f0;return db[_0xec74('0x2b')][_0xec74('0x4a')]({'where':{'id':_0x562277['params']['id']}})['then'](handleEntityNotFound(_0x522b64,null))['then'](function(_0x429f9a){if(_0x429f9a){_0xd7ebf3=_0x429f9a;_0x7fec05['model']=_[_0xec74('0x43')](db[_0xec74('0x4b')][_0xec74('0x44')]);_0x7fec05['query']=_[_0xec74('0x43')](_0x562277[_0xec74('0x2e')]);_0x7fec05['filters']=_['intersection'](_0x7fec05[_0xec74('0x30')],_0x7fec05[_0xec74('0x2e')]);_0x216181[_0xec74('0x31')]=_[_0xec74('0x32')](_0x7fec05[_0xec74('0x30')],qs[_0xec74('0x33')](_0x562277[_0xec74('0x2e')]['fields']));_0x216181[_0xec74('0x31')]=_0x216181[_0xec74('0x31')][_0xec74('0x4c')]?_0x216181[_0xec74('0x31')]:_0x7fec05['model'];_0x216181[_0xec74('0x36')]=qs[_0xec74('0x37')](_0x562277[_0xec74('0x2e')]['sort']);_0x216181[_0xec74('0x38')]=qs['filters'](_[_0xec74('0x4d')](_0x562277[_0xec74('0x2e')],_0x7fec05['filters']));if(_0x562277[_0xec74('0x2e')]['filter']){_0x216181[_0xec74('0x38')]=_[_0xec74('0x3a')](_0x216181[_0xec74('0x38')],{'$or':_[_0xec74('0x2d')](_0x216181[_0xec74('0x31')],function(_0x897b1f){var _0x2999c7={};_0x2999c7[_0x897b1f]={'$like':'%'+_0x562277[_0xec74('0x2e')][_0xec74('0x39')]+'%'};return _0x2999c7;})});}_0x216181=_[_0xec74('0x3a')]({},_0x216181,_0x562277[_0xec74('0x3c')]);return _0xd7ebf3['getConfigurations'](_0x216181);}})[_0xec74('0x26')](function(_0x21ee9e){if(_0x21ee9e){_0x3418f0=_0x21ee9e[_0xec74('0x4c')];if(!_0x562277[_0xec74('0x2e')][_0xec74('0x34')](_0xec74('0x35'))){_0x216181[_0xec74('0x20')]=qs[_0xec74('0x20')](_0x562277['query'][_0xec74('0x20')]);_0x216181[_0xec74('0x1d')]=qs['offset'](_0x562277[_0xec74('0x2e')][_0xec74('0x1d')]);}return _0xd7ebf3[_0xec74('0x49')](_0x216181);}})[_0xec74('0x26')](function(_0x175844){if(_0x175844){return _0x175844?{'count':_0x3418f0,'rows':_0x175844}:null;}})['then'](respondWithResult(_0x522b64,null))[_0xec74('0x41')](handleError(_0x522b64,null));};exports[_0xec74('0x4e')]=function(_0x22b7d9,_0x3e3025,_0x499fe1){if(_0x22b7d9[_0xec74('0x47')]['id']){delete _0x22b7d9[_0xec74('0x47')]['id'];}return db[_0xec74('0x2b')][_0xec74('0x4a')]({'where':{'id':_0x22b7d9['params']['id']}})[_0xec74('0x26')](handleEntityNotFound(_0x3e3025,null))['then'](function(_0x5c1cea){if(_0x5c1cea){_0x22b7d9[_0xec74('0x47')][_0xec74('0x4f')]=_0x5c1cea['id'];_0x22b7d9[_0xec74('0x47')]['Subjects']=integrations['getSubjects'](_0x22b7d9[_0xec74('0x47')][_0xec74('0x50')],_0x22b7d9[_0xec74('0x47')][_0xec74('0x3b')]);_0x22b7d9['body'][_0xec74('0x51')]=integrations['getDescriptions'](_0x22b7d9[_0xec74('0x47')][_0xec74('0x50')],_0x22b7d9[_0xec74('0x47')][_0xec74('0x3b')]);return db['SugarcrmConfiguration'][_0xec74('0x46')](_0x22b7d9['body'],{'include':[{'model':db[_0xec74('0x52')],'as':_0xec74('0x53')},{'model':db[_0xec74('0x52')],'as':_0xec74('0x51')}]});}return null;})[_0xec74('0x26')](respondWithResult(_0x3e3025,null))['catch'](handleError(_0x3e3025,null));};exports['getFields']=function(_0x2f4b79,_0x661e37,_0x9ca542){var _0x919581='';var _0x41e323=['id','name',_0xec74('0x54'),_0xec74('0x55'),_0xec74('0x56'),'date_start',_0xec74('0x57'),'duration_minutes','parent_id',_0xec74('0x58'),_0xec74('0x59'),'direction'];return db[_0xec74('0x2b')][_0xec74('0x4a')]({'where':{'id':_0x2f4b79[_0xec74('0x42')]['id']},'attributes':['id',_0xec74('0x5a'),'password',_0xec74('0x5b')]})[_0xec74('0x26')](handleEntityNotFound(_0x661e37,null))[_0xec74('0x26')](function(_0x30a55f){if(_0x30a55f){_0x919581=_0x30a55f[_0xec74('0x5b')];var _0x5ea06c=_0x919581['slice'](-0x1);if(_0x5ea06c==='/'){_0x919581=_0x919581['substring'](0x0,_0x919581[_0xec74('0x5c')](_0x5ea06c));}return rp({'method':_0xec74('0x5d'),'uri':util[_0xec74('0x5e')](_0xec74('0x5f'),_0x919581,_0xec74('0x60')),'json':!![],'form':{'method':_0xec74('0x61'),'input_type':_0xec74('0x62'),'response_type':'JSON','rest_data':JSON[_0xec74('0x63')]({'user_auth':{'user_name':_0x30a55f['username'],'password':_0x30a55f[_0xec74('0x64')],'encryption':'PLAIN'},'application':_0xec74('0x65')})}});}})['then'](function(_0x266354){if(_0x266354&&_0x266354['name']!==_0xec74('0x66')&&_0x266354[_0xec74('0x28')]!=='Password\x20Expired'){return rp({'method':_0xec74('0x5d'),'uri':util['format'](_0xec74('0x5f'),_0x919581,_0xec74('0x60')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xec74('0x62'),'response_type':_0xec74('0x62'),'rest_data':JSON[_0xec74('0x63')]({'session':_0x266354['id'],'module_name':_0xec74('0x67')})}})[_0xec74('0x26')](function(_0x47c248){if(_0x47c248){var _0x591b74=_[_0xec74('0x68')](_0x47c248[_0xec74('0x69')]);_[_0xec74('0x6a')](_0x591b74,function(_0x1a81bc){return _0x41e323[_0xec74('0x6b')](_0x1a81bc[_0xec74('0x28')]);});return{'count':_0x591b74[_0xec74('0x4c')],'rows':_[_0xec74('0x2d')](_0x591b74,function(_0x443365){return{'id':_0x443365['name'],'name':_0x443365['label'],'custom':_[_0xec74('0x6c')](_0x443365['name'],'_c')?!![]:![],'options':_0x443365['options']?_[_0xec74('0x2d')](_[_0xec74('0x68')](_0x443365[_0xec74('0x3c')]),function(_0xdaa52a){return{'name':_0xdaa52a[_0xec74('0x6d')],'value':_0xdaa52a['name']};}):[]};})};}})[_0xec74('0x26')](respondWithResult(_0x661e37,null))[_0xec74('0x41')](function(_0xb11622){var _0x4ac628=_0x2f4b79[_0xec74('0x2e')][_0xec74('0x6e')]?0x1f4:_0xb11622[_0xec74('0x6f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xec74('0x70'),_0x4ac628,JSON[_0xec74('0x63')](_0xb11622));delete _0xb11622[_0xec74('0x28')];if(_0x4ac628===0x191){_0x4ac628=0x190;}_0x661e37['status'](_0x4ac628)['send'](_0x2f4b79['query'][_0xec74('0x6e')]?{'message':_0xec74('0x71'),'statusCode':_0xb11622[_0xec74('0x6f')]}:_0xb11622);});}else{var _0x14a812=0x1f4;_0x661e37[_0xec74('0x1c')](_0x14a812)[_0xec74('0x29')]({'message':_0xec74('0x71'),'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 a9d4c25..6d2bc58 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 _0x351d=['SugarcrmAccount','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x94c8bc,_0x2aa406){var _0x4237ca=function(_0x23e7db){while(--_0x23e7db){_0x94c8bc['push'](_0x94c8bc['shift']());}};_0x4237ca(++_0x2aa406);}(_0x351d,0x90));var _0xd351=function(_0x57ded1,_0x2f3500){_0x57ded1=_0x57ded1-0x0;var _0x146f67=_0x351d[_0x57ded1];return _0x146f67;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xd351('0x7'));module[_0xd351('0x8')]=function(_0x88bd2b,_0x5318b2){return _0x88bd2b[_0xd351('0x9')](_0xd351('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0830=['int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount'];(function(_0x2212fc,_0x4652dd){var _0x572da4=function(_0x138747){while(--_0x138747){_0x2212fc['push'](_0x2212fc['shift']());}};_0x572da4(++_0x4652dd);}(_0x0830,0x1a5));var _0x0083=function(_0x2d15c6,_0x2489f9){_0x2d15c6=_0x2d15c6-0x0;var _0x2ecfdf=_0x0830[_0x2d15c6];return _0x2ecfdf;};'use strict';var _=require(_0x0083('0x0'));var util=require(_0x0083('0x1'));var logger=require('../../config/logger')(_0x0083('0x2'));var moment=require(_0x0083('0x3'));var BPromise=require(_0x0083('0x4'));var rp=require(_0x0083('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0083('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x0083('0x7'));module[_0x0083('0x8')]=function(_0x5576d5,_0x3109fb){return _0x5576d5[_0x0083('0x9')](_0x0083('0xa'),attributes,{'tableName':_0x0083('0xb'),'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 238b7dc..fcbc56f 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 _0xa973=['client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','model','include','map','debug','GetSugarcrmAccount','ShowSugarcrmAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0xa973,0xdf));var _0x3a97=function(_0x42d58c,_0x1a757a){_0x42d58c=_0x42d58c-0x0;var _0x3c3ce5=_0xa973[_0x42d58c];return _0x3c3ce5;};'use strict';var _=require(_0x3a97('0x0'));var util=require('util');var moment=require(_0x3a97('0x1'));var BPromise=require(_0x3a97('0x2'));var rs=require(_0x3a97('0x3'));var fs=require('fs');var Redis=require(_0x3a97('0x4'));var db=require(_0x3a97('0x5'))['db'];var utils=require(_0x3a97('0x6'));var logger=require(_0x3a97('0x7'))(_0x3a97('0x8'));var config=require(_0x3a97('0x9'));var jayson=require(_0x3a97('0xa'));var client=jayson[_0x3a97('0xb')][_0x3a97('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58d8e2,_0x1ff3d1,_0xfa5a43){return new BPromise(function(_0x4f94a8,_0x5254cb){return client[_0x3a97('0xd')](_0x58d8e2,_0xfa5a43)[_0x3a97('0xe')](function(_0x184ddc){logger['info'](_0x3a97('0xf'),_0x1ff3d1,'request\x20sent');logger['debug'](_0x3a97('0x10'),_0x1ff3d1,'request\x20sent',JSON[_0x3a97('0x11')](_0x184ddc));if(_0x184ddc[_0x3a97('0x12')]){if(_0x184ddc['error'][_0x3a97('0x13')]===0x1f4){logger[_0x3a97('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ff3d1,_0x184ddc[_0x3a97('0x12')]['message']);return _0x5254cb(_0x184ddc[_0x3a97('0x12')][_0x3a97('0x14')]);}logger[_0x3a97('0x12')](_0x3a97('0xf'),_0x1ff3d1,_0x184ddc[_0x3a97('0x12')][_0x3a97('0x14')]);return _0x4f94a8(_0x184ddc[_0x3a97('0x12')]['message']);}else{logger[_0x3a97('0x15')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ff3d1,_0x3a97('0x16'));_0x4f94a8(_0x184ddc[_0x3a97('0x17')][_0x3a97('0x14')]);}})[_0x3a97('0x18')](function(_0x4eb995){logger[_0x3a97('0x12')](_0x3a97('0xf'),_0x1ff3d1,_0x4eb995);_0x5254cb(_0x4eb995);});});}exports['GetSugarcrmAccount']=function(_0x51a66d){var _0x552f9c=this;return new Promise(function(_0x2e03fd,_0x5542fa){return db[_0x3a97('0x19')][_0x3a97('0x1a')]({'raw':_0x51a66d[_0x3a97('0x1b')]?_0x51a66d[_0x3a97('0x1b')][_0x3a97('0x1c')]===undefined?!![]:![]:!![],'where':_0x51a66d[_0x3a97('0x1b')]?_0x51a66d['options']['where']||null:null,'attributes':_0x51a66d[_0x3a97('0x1b')]?_0x51a66d[_0x3a97('0x1b')][_0x3a97('0x1d')]||null:null,'limit':_0x51a66d['options']?_0x51a66d[_0x3a97('0x1b')][_0x3a97('0x1e')]||null:null,'include':_0x51a66d[_0x3a97('0x1b')]?_0x51a66d['options']['include']?_['map'](_0x51a66d['options']['include'],function(_0x8656c){return{'model':db[_0x8656c[_0x3a97('0x1f')]],'as':_0x8656c['as'],'attributes':_0x8656c[_0x3a97('0x1d')],'include':_0x8656c[_0x3a97('0x20')]?_['map'](_0x8656c['include'],function(_0x5c98b3){return{'model':db[_0x5c98b3['model']],'as':_0x5c98b3['as'],'attributes':_0x5c98b3[_0x3a97('0x1d')],'include':_0x5c98b3['include']?_[_0x3a97('0x21')](_0x5c98b3[_0x3a97('0x20')],function(_0x225339){return{'model':db[_0x225339[_0x3a97('0x1f')]],'as':_0x225339['as'],'attributes':_0x225339[_0x3a97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3a97('0xe')](function(_0x376fb5){logger['info']('GetSugarcrmAccount',_0x51a66d);logger[_0x3a97('0x22')](_0x3a97('0x23'),_0x51a66d,JSON[_0x3a97('0x11')](_0x376fb5));_0x2e03fd(_0x376fb5);})[_0x3a97('0x18')](function(_0x5d20f3){logger[_0x3a97('0x12')](_0x3a97('0x23'),_0x5d20f3[_0x3a97('0x14')],_0x51a66d);_0x5542fa(_0x552f9c[_0x3a97('0x12')](0x1f4,_0x5d20f3[_0x3a97('0x14')]));});});};exports[_0x3a97('0x24')]=function(_0x20b286){var _0x383819=this;return new Promise(function(_0x38b8ec,_0x4c6ba8){return db[_0x3a97('0x19')][_0x3a97('0x25')]({'raw':_0x20b286[_0x3a97('0x1b')]?_0x20b286[_0x3a97('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x20b286[_0x3a97('0x1b')]?_0x20b286[_0x3a97('0x1b')][_0x3a97('0x26')]||null:null,'attributes':_0x20b286[_0x3a97('0x1b')]?_0x20b286['options'][_0x3a97('0x1d')]||null:null,'include':_0x20b286[_0x3a97('0x1b')]?_0x20b286['options'][_0x3a97('0x20')]?_['map'](_0x20b286['options'][_0x3a97('0x20')],function(_0x573bf1){return{'model':db[_0x573bf1['model']],'as':_0x573bf1['as'],'attributes':_0x573bf1['attributes'],'include':_0x573bf1[_0x3a97('0x20')]?_['map'](_0x573bf1['include'],function(_0x4477e0){return{'model':db[_0x4477e0['model']],'as':_0x4477e0['as'],'attributes':_0x4477e0[_0x3a97('0x1d')],'include':_0x4477e0[_0x3a97('0x20')]?_[_0x3a97('0x21')](_0x4477e0['include'],function(_0x2cd96e){return{'model':db[_0x2cd96e['model']],'as':_0x2cd96e['as'],'attributes':_0x2cd96e[_0x3a97('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3a97('0xe')](function(_0x468e49){logger[_0x3a97('0x15')]('ShowSugarcrmAccount',_0x20b286);logger[_0x3a97('0x22')](_0x3a97('0x24'),_0x20b286,JSON[_0x3a97('0x11')](_0x468e49));_0x38b8ec(_0x468e49);})[_0x3a97('0x18')](function(_0x3bac56){logger['error'](_0x3a97('0x24'),_0x3bac56[_0x3a97('0x14')],_0x20b286);_0x4c6ba8(_0x383819[_0x3a97('0x12')](0x1f4,_0x3bac56['message']));});});}; \ No newline at end of file +var _0x1542=['model','catch','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x560b5c,_0x314575){var _0x5d648f=function(_0x51000a){while(--_0x51000a){_0x560b5c['push'](_0x560b5c['shift']());}};_0x5d648f(++_0x314575);}(_0x1542,0x134));var _0x2154=function(_0x57f85b,_0x2e9f16){_0x57f85b=_0x57f85b-0x0;var _0x1c368d=_0x1542[_0x57f85b];return _0x1c368d;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var moment=require(_0x2154('0x2'));var BPromise=require(_0x2154('0x3'));var rs=require(_0x2154('0x4'));var fs=require('fs');var Redis=require(_0x2154('0x5'));var db=require(_0x2154('0x6'))['db'];var utils=require(_0x2154('0x7'));var logger=require(_0x2154('0x8'))('rpc');var config=require(_0x2154('0x9'));var jayson=require(_0x2154('0xa'));var client=jayson[_0x2154('0xb')][_0x2154('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a0b58,_0x26d209,_0x42491a){return new BPromise(function(_0x2d0694,_0x507ef9){return client[_0x2154('0xd')](_0x4a0b58,_0x42491a)[_0x2154('0xe')](function(_0x123c0f){logger[_0x2154('0xf')](_0x2154('0x10'),_0x26d209,_0x2154('0x11'));logger[_0x2154('0x12')](_0x2154('0x13'),_0x26d209,'request\x20sent',JSON[_0x2154('0x14')](_0x123c0f));if(_0x123c0f['error']){if(_0x123c0f[_0x2154('0x15')][_0x2154('0x16')]===0x1f4){logger[_0x2154('0x15')](_0x2154('0x10'),_0x26d209,_0x123c0f['error'][_0x2154('0x17')]);return _0x507ef9(_0x123c0f[_0x2154('0x15')]['message']);}logger[_0x2154('0x15')](_0x2154('0x10'),_0x26d209,_0x123c0f[_0x2154('0x15')][_0x2154('0x17')]);return _0x2d0694(_0x123c0f[_0x2154('0x15')][_0x2154('0x17')]);}else{logger[_0x2154('0xf')](_0x2154('0x10'),_0x26d209,_0x2154('0x11'));_0x2d0694(_0x123c0f[_0x2154('0x18')][_0x2154('0x17')]);}})['catch'](function(_0x78f8c){logger[_0x2154('0x15')](_0x2154('0x10'),_0x26d209,_0x78f8c);_0x507ef9(_0x78f8c);});});}exports[_0x2154('0x19')]=function(_0x486836){var _0xe22feb=this;return new Promise(function(_0x3d680a,_0xf3dff4){return db[_0x2154('0x1a')][_0x2154('0x1b')]({'raw':_0x486836['options']?_0x486836[_0x2154('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x486836[_0x2154('0x1c')]?_0x486836[_0x2154('0x1c')][_0x2154('0x1d')]||null:null,'attributes':_0x486836[_0x2154('0x1c')]?_0x486836['options'][_0x2154('0x1e')]||null:null,'limit':_0x486836[_0x2154('0x1c')]?_0x486836[_0x2154('0x1c')][_0x2154('0x1f')]||null:null,'include':_0x486836[_0x2154('0x1c')]?_0x486836[_0x2154('0x1c')][_0x2154('0x20')]?_['map'](_0x486836[_0x2154('0x1c')][_0x2154('0x20')],function(_0x3f1212){return{'model':db[_0x3f1212['model']],'as':_0x3f1212['as'],'attributes':_0x3f1212['attributes'],'include':_0x3f1212[_0x2154('0x20')]?_[_0x2154('0x21')](_0x3f1212[_0x2154('0x20')],function(_0xe1f9db){return{'model':db[_0xe1f9db[_0x2154('0x22')]],'as':_0xe1f9db['as'],'attributes':_0xe1f9db[_0x2154('0x1e')],'include':_0xe1f9db[_0x2154('0x20')]?_[_0x2154('0x21')](_0xe1f9db[_0x2154('0x20')],function(_0xbe1f90){return{'model':db[_0xbe1f90[_0x2154('0x22')]],'as':_0xbe1f90['as'],'attributes':_0xbe1f90[_0x2154('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2154('0xe')](function(_0x38b3ec){logger[_0x2154('0xf')](_0x2154('0x19'),_0x486836);logger[_0x2154('0x12')](_0x2154('0x19'),_0x486836,JSON[_0x2154('0x14')](_0x38b3ec));_0x3d680a(_0x38b3ec);})[_0x2154('0x23')](function(_0x10199d){logger[_0x2154('0x15')](_0x2154('0x19'),_0x10199d[_0x2154('0x17')],_0x486836);_0xf3dff4(_0xe22feb[_0x2154('0x15')](0x1f4,_0x10199d['message']));});});};exports['ShowSugarcrmAccount']=function(_0x122881){var _0xfd83ef=this;return new Promise(function(_0xdd491d,_0x580be8){return db[_0x2154('0x1a')][_0x2154('0x24')]({'raw':_0x122881[_0x2154('0x1c')]?_0x122881[_0x2154('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x122881[_0x2154('0x1c')]?_0x122881['options'][_0x2154('0x1d')]||null:null,'attributes':_0x122881[_0x2154('0x1c')]?_0x122881[_0x2154('0x1c')]['attributes']||null:null,'include':_0x122881[_0x2154('0x1c')]?_0x122881['options']['include']?_[_0x2154('0x21')](_0x122881[_0x2154('0x1c')][_0x2154('0x20')],function(_0x3f94ff){return{'model':db[_0x3f94ff['model']],'as':_0x3f94ff['as'],'attributes':_0x3f94ff[_0x2154('0x1e')],'include':_0x3f94ff[_0x2154('0x20')]?_[_0x2154('0x21')](_0x3f94ff[_0x2154('0x20')],function(_0x45a64c){return{'model':db[_0x45a64c[_0x2154('0x22')]],'as':_0x45a64c['as'],'attributes':_0x45a64c[_0x2154('0x1e')],'include':_0x45a64c[_0x2154('0x20')]?_[_0x2154('0x21')](_0x45a64c[_0x2154('0x20')],function(_0x41955c){return{'model':db[_0x41955c[_0x2154('0x22')]],'as':_0x41955c['as'],'attributes':_0x41955c[_0x2154('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x295b7a){logger[_0x2154('0xf')](_0x2154('0x25'),_0x122881);logger['debug'](_0x2154('0x25'),_0x122881,JSON[_0x2154('0x14')](_0x295b7a));_0xdd491d(_0x295b7a);})[_0x2154('0x23')](function(_0x5794d3){logger['error']('ShowSugarcrmAccount',_0x5794d3[_0x2154('0x17')],_0x122881);_0x580be8(_0xfd83ef[_0x2154('0x15')](0x1f4,_0x5794d3['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index cc53d79..6cb4e1c 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 _0x7867=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','/:id','isAuthenticated','get','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create'];(function(_0x41da36,_0x9f76a8){var _0x102941=function(_0x586050){while(--_0x586050){_0x41da36['push'](_0x41da36['shift']());}};_0x102941(++_0x9f76a8);}(_0x7867,0x19c));var _0x7786=function(_0x3a1a4e,_0x3e73b1){_0x3a1a4e=_0x3a1a4e-0x0;var _0x154abe=_0x7867[_0x3a1a4e];return _0x154abe;};'use strict';var multer=require(_0x7786('0x0'));var util=require('util');var path=require(_0x7786('0x1'));var timeout=require(_0x7786('0x2'));var express=require(_0x7786('0x3'));var router=express[_0x7786('0x4')]();var fs_extra=require(_0x7786('0x5'));var auth=require(_0x7786('0x6'));var interaction=require(_0x7786('0x7'));var config=require(_0x7786('0x8'));var controller=require(_0x7786('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7786('0xa')]);router['get'](_0x7786('0xb'),auth[_0x7786('0xc')](),controller['show']);router[_0x7786('0xd')](_0x7786('0xe'),auth[_0x7786('0xc')](),controller[_0x7786('0xf')]);router[_0x7786('0xd')]('/:id/subjects',auth[_0x7786('0xc')](),controller[_0x7786('0x10')]);router[_0x7786('0xd')](_0x7786('0x11'),auth[_0x7786('0xc')](),controller['getDescriptions']);router[_0x7786('0x12')]('/',auth[_0x7786('0xc')](),controller[_0x7786('0x13')]);router[_0x7786('0x14')](_0x7786('0xb'),auth['isAuthenticated'](),controller[_0x7786('0x15')]);router[_0x7786('0x16')](_0x7786('0xb'),auth['isAuthenticated'](),controller[_0x7786('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5fa3=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id'];(function(_0x3e233a,_0x127c27){var _0x59277d=function(_0x257555){while(--_0x257555){_0x3e233a['push'](_0x3e233a['shift']());}};_0x59277d(++_0x127c27);}(_0x5fa3,0x8a));var _0x35fa=function(_0x5e9d76,_0x11e845){_0x5e9d76=_0x5e9d76-0x0;var _0x3ede40=_0x5fa3[_0x5e9d76];return _0x3ede40;};'use strict';var multer=require(_0x35fa('0x0'));var util=require(_0x35fa('0x1'));var path=require('path');var timeout=require(_0x35fa('0x2'));var express=require(_0x35fa('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x35fa('0x4'));var controller=require(_0x35fa('0x5'));router['get']('/',auth[_0x35fa('0x6')](),controller['index']);router[_0x35fa('0x7')](_0x35fa('0x8'),auth[_0x35fa('0x6')](),controller[_0x35fa('0x9')]);router[_0x35fa('0x7')](_0x35fa('0xa'),auth[_0x35fa('0x6')](),controller[_0x35fa('0xb')]);router['get'](_0x35fa('0xc'),auth[_0x35fa('0x6')](),controller['getSubjects']);router[_0x35fa('0x7')](_0x35fa('0xd'),auth[_0x35fa('0x6')](),controller[_0x35fa('0xe')]);router[_0x35fa('0xf')]('/',auth[_0x35fa('0x6')](),controller[_0x35fa('0x10')]);router[_0x35fa('0x11')](_0x35fa('0x8'),auth['isAuthenticated'](),controller[_0x35fa('0x12')]);router[_0x35fa('0x13')](_0x35fa('0x8'),auth[_0x35fa('0x6')](),controller[_0x35fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index a688135..346b8c1 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6c82=['STRING','sequelize','exports'];(function(_0x3d7cc6,_0x2f929b){var _0x49bb95=function(_0x2ad666){while(--_0x2ad666){_0x3d7cc6['push'](_0x3d7cc6['shift']());}};_0x49bb95(++_0x2f929b);}(_0x6c82,0xd6));var _0x26c8=function(_0x433fdf,_0x5f99a0){_0x433fdf=_0x433fdf-0x0;var _0x522aea=_0x6c82[_0x433fdf];return _0x522aea;};'use strict';var Sequelize=require(_0x26c8('0x0'));module[_0x26c8('0x1')]={'name':{'type':Sequelize[_0x26c8('0x2')]},'description':{'type':Sequelize[_0x26c8('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4d4ced6..bb0d411 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 _0x197b=['getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','end','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','then','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','SugarcrmField','getSubjects'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x197b,0xe8));var _0xb197=function(_0x336231,_0x5fd660){_0x336231=_0x336231-0x0;var _0x461263=_0x197b[_0x336231];return _0x461263;};'use strict';var emlformat=require(_0xb197('0x0'));var rimraf=require(_0xb197('0x1'));var zipdir=require(_0xb197('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb197('0x3'));var moment=require(_0xb197('0x4'));var BPromise=require(_0xb197('0x5'));var Mustache=require('mustache');var util=require(_0xb197('0x6'));var path=require(_0xb197('0x7'));var sox=require('sox');var csv=require(_0xb197('0x8'));var ejs=require(_0xb197('0x9'));var fs=require('fs');var fs_extra=require(_0xb197('0xa'));var _=require(_0xb197('0xb'));var squel=require(_0xb197('0xc'));var crypto=require('crypto');var jsforce=require(_0xb197('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb197('0x8'));var querystring=require(_0xb197('0xe'));var Papa=require(_0xb197('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb197('0x10'));var as=require(_0xb197('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb197('0x12'))(_0xb197('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb197('0x14'));var db=require(_0xb197('0x15'))['db'];function respondWithStatusCode(_0x3c88e4,_0x2e2661){_0x2e2661=_0x2e2661||0xcc;return function(_0x5434cd){if(_0x5434cd){return _0x3c88e4['sendStatus'](_0x2e2661);}return _0x3c88e4[_0xb197('0x16')](_0x2e2661)['end']();};}function respondWithResult(_0x285421,_0x630a6f){_0x630a6f=_0x630a6f||0xc8;return function(_0x52f121){if(_0x52f121){return _0x285421[_0xb197('0x16')](_0x630a6f)['json'](_0x52f121);}};}function respondWithFilteredResult(_0x28fe52,_0x2ab40d){return function(_0x79b58e){if(_0x79b58e){var _0xb76c97=typeof _0x2ab40d['offset']===_0xb197('0x17')&&typeof _0x2ab40d[_0xb197('0x18')]===_0xb197('0x17');var _0x540a2b=_0x79b58e[_0xb197('0x19')];var _0x24ed7f=_0xb76c97?0x0:_0x2ab40d[_0xb197('0x1a')];var _0x116889=_0xb76c97?_0x79b58e[_0xb197('0x19')]:_0x2ab40d[_0xb197('0x1a')]+_0x2ab40d[_0xb197('0x18')];var _0x28af85;if(_0x116889>=_0x540a2b){_0x116889=_0x540a2b;_0x28af85=0xc8;}else{_0x28af85=0xce;}_0x28fe52[_0xb197('0x16')](_0x28af85);return _0x28fe52[_0xb197('0x1b')](_0xb197('0x1c'),_0x24ed7f+'-'+_0x116889+'/'+_0x540a2b)[_0xb197('0x1d')](_0x79b58e);}return null;};}function patchUpdates(_0x182093){return function(_0x1281dc){try{jsonpatch[_0xb197('0x1e')](_0x1281dc,_0x182093,!![]);}catch(_0x94d571){return BPromise['reject'](_0x94d571);}return _0x1281dc[_0xb197('0x1f')]();};}function saveUpdates(_0x590891,_0x30896e){return function(_0x36c008){if(_0x36c008){return _0x36c008[_0xb197('0x20')](_0x590891)['then'](function(_0x470220){return _0x470220;});}return null;};}function removeEntity(_0x3f2db5,_0x2946f4){return function(_0x33b748){if(_0x33b748){return _0x33b748[_0xb197('0x21')]()['then'](function(){_0x3f2db5[_0xb197('0x16')](0xcc)[_0xb197('0x22')]();});}};}function handleEntityNotFound(_0x52a03e,_0x20aed0){return function(_0x147529){if(!_0x147529){_0x52a03e['sendStatus'](0x194);}return _0x147529;};}function handleError(_0x4a8279,_0xfebaaa){_0xfebaaa=_0xfebaaa||0x1f4;return function(_0x5b8ce2){logger['error'](_0x5b8ce2[_0xb197('0x23')]);if(_0x5b8ce2[_0xb197('0x24')]){delete _0x5b8ce2[_0xb197('0x24')];}_0x4a8279[_0xb197('0x16')](_0xfebaaa)[_0xb197('0x25')](_0x5b8ce2);};}exports[_0xb197('0x26')]=function(_0x4e7089,_0x33bc4e){var _0x27be53={},_0x4d66d8={},_0x3f8c1={'count':0x0,'rows':[]};var _0x21ab9c=_['map'](db[_0xb197('0x27')][_0xb197('0x28')],function(_0x2c5b06){return{'name':_0x2c5b06[_0xb197('0x29')],'type':_0x2c5b06[_0xb197('0x2a')][_0xb197('0x2b')]};});_0x4d66d8[_0xb197('0x2c')]=_['map'](_0x21ab9c,_0xb197('0x24'));_0x4d66d8['query']=_[_0xb197('0x2d')](_0x4e7089[_0xb197('0x2e')]);_0x4d66d8['filters']=_[_0xb197('0x2f')](_0x4d66d8[_0xb197('0x2c')],_0x4d66d8[_0xb197('0x2e')]);_0x27be53['attributes']=_[_0xb197('0x2f')](_0x4d66d8[_0xb197('0x2c')],qs[_0xb197('0x30')](_0x4e7089['query'][_0xb197('0x30')]));_0x27be53[_0xb197('0x31')]=_0x27be53['attributes'][_0xb197('0x32')]?_0x27be53[_0xb197('0x31')]:_0x4d66d8[_0xb197('0x2c')];if(!_0x4e7089['query'][_0xb197('0x33')](_0xb197('0x34'))){_0x27be53[_0xb197('0x18')]=qs[_0xb197('0x18')](_0x4e7089['query'][_0xb197('0x18')]);_0x27be53['offset']=qs[_0xb197('0x1a')](_0x4e7089[_0xb197('0x2e')][_0xb197('0x1a')]);}_0x27be53[_0xb197('0x35')]=qs[_0xb197('0x36')](_0x4e7089[_0xb197('0x2e')][_0xb197('0x36')]);_0x27be53[_0xb197('0x37')]=qs[_0xb197('0x38')](_[_0xb197('0x39')](_0x4e7089[_0xb197('0x2e')],_0x4d66d8[_0xb197('0x38')]),_0x21ab9c);if(_0x4e7089[_0xb197('0x2e')][_0xb197('0x3a')]){_0x27be53[_0xb197('0x37')]=_[_0xb197('0x3b')](_0x27be53[_0xb197('0x37')],{'$or':_[_0xb197('0x3c')](_0x21ab9c,function(_0xb1d45f){if(_0xb1d45f[_0xb197('0x2a')]!=='VIRTUAL'){var _0x38951f={};_0x38951f[_0xb1d45f[_0xb197('0x24')]]={'$like':'%'+_0x4e7089[_0xb197('0x2e')][_0xb197('0x3a')]+'%'};return _0x38951f;}})});}_0x27be53=_['merge']({},_0x27be53,_0x4e7089[_0xb197('0x3d')]);var _0xf7f2cc={'where':_0x27be53['where']};return db[_0xb197('0x27')][_0xb197('0x19')](_0xf7f2cc)[_0xb197('0x3e')](function(_0x3e5028){_0x3f8c1[_0xb197('0x19')]=_0x3e5028;if(_0x4e7089[_0xb197('0x2e')][_0xb197('0x3f')]){_0x27be53[_0xb197('0x40')]=[{'all':!![]}];}return db[_0xb197('0x27')]['findAll'](_0x27be53);})[_0xb197('0x3e')](function(_0x1346ed){_0x3f8c1[_0xb197('0x41')]=_0x1346ed;return _0x3f8c1;})[_0xb197('0x3e')](respondWithFilteredResult(_0x33bc4e,_0x27be53))[_0xb197('0x42')](handleError(_0x33bc4e,null));};exports[_0xb197('0x43')]=function(_0xb4470a,_0x1013a5){var _0x1c19d9={'raw':![],'where':{'id':_0xb4470a[_0xb197('0x44')]['id']}},_0x48091e={};_0x48091e['model']=_[_0xb197('0x2d')](db['SugarcrmConfiguration'][_0xb197('0x28')]);_0x48091e[_0xb197('0x2e')]=_[_0xb197('0x2d')](_0xb4470a[_0xb197('0x2e')]);_0x48091e[_0xb197('0x38')]=_[_0xb197('0x2f')](_0x48091e[_0xb197('0x2c')],_0x48091e['query']);_0x1c19d9[_0xb197('0x31')]=_['intersection'](_0x48091e[_0xb197('0x2c')],qs[_0xb197('0x30')](_0xb4470a[_0xb197('0x2e')][_0xb197('0x30')]));_0x1c19d9['attributes']=_0x1c19d9[_0xb197('0x31')][_0xb197('0x32')]?_0x1c19d9[_0xb197('0x31')]:_0x48091e[_0xb197('0x2c')];if(_0xb4470a[_0xb197('0x2e')][_0xb197('0x3f')]){_0x1c19d9[_0xb197('0x40')]=[{'all':!![]}];}_0x1c19d9=_[_0xb197('0x3b')]({},_0x1c19d9,_0xb4470a[_0xb197('0x3d')]);return db[_0xb197('0x27')][_0xb197('0x45')](_0x1c19d9)['then'](handleEntityNotFound(_0x1013a5,null))[_0xb197('0x3e')](respondWithResult(_0x1013a5,null))['catch'](handleError(_0x1013a5,null));};exports[_0xb197('0x46')]=function(_0x3c9f7e,_0x2d4299){return db[_0xb197('0x27')][_0xb197('0x46')](_0x3c9f7e[_0xb197('0x47')],{})[_0xb197('0x3e')](respondWithResult(_0x2d4299,0xc9))[_0xb197('0x42')](handleError(_0x2d4299,null));};exports['update']=function(_0x8c77f1,_0xe64b9){if(_0x8c77f1[_0xb197('0x47')]['id']){delete _0x8c77f1['body']['id'];}return db['SugarcrmConfiguration'][_0xb197('0x45')]({'where':{'id':_0x8c77f1[_0xb197('0x44')]['id']}})[_0xb197('0x3e')](handleEntityNotFound(_0xe64b9,null))[_0xb197('0x3e')](saveUpdates(_0x8c77f1[_0xb197('0x47')],null))[_0xb197('0x3e')](respondWithResult(_0xe64b9,null))['catch'](handleError(_0xe64b9,null));};exports[_0xb197('0x21')]=function(_0x4b5adb,_0x340b70){return db[_0xb197('0x27')][_0xb197('0x45')]({'where':{'id':_0x4b5adb['params']['id']}})[_0xb197('0x3e')](handleEntityNotFound(_0x340b70,null))['then'](removeEntity(_0x340b70,null))[_0xb197('0x42')](handleError(_0x340b70,null));};exports[_0xb197('0x48')]=function(_0x8bb9af,_0x5c7b10,_0x15f76f){var _0xa2cf={};var _0x8205ae={};var _0x212742;var _0x1a0187;return db[_0xb197('0x27')][_0xb197('0x49')]({'where':{'id':_0x8bb9af[_0xb197('0x44')]['id']}})[_0xb197('0x3e')](handleEntityNotFound(_0x5c7b10,null))[_0xb197('0x3e')](function(_0x641be1){if(_0x641be1){_0x212742=_0x641be1;_0x8205ae[_0xb197('0x2c')]=_[_0xb197('0x2d')](db[_0xb197('0x4a')][_0xb197('0x28')]);_0x8205ae[_0xb197('0x2e')]=_[_0xb197('0x2d')](_0x8bb9af[_0xb197('0x2e')]);_0x8205ae[_0xb197('0x38')]=_['intersection'](_0x8205ae[_0xb197('0x2c')],_0x8205ae['query']);_0xa2cf['attributes']=_['intersection'](_0x8205ae[_0xb197('0x2c')],qs['fields'](_0x8bb9af[_0xb197('0x2e')]['fields']));_0xa2cf['attributes']=_0xa2cf[_0xb197('0x31')]['length']?_0xa2cf[_0xb197('0x31')]:_0x8205ae['model'];_0xa2cf[_0xb197('0x35')]=qs[_0xb197('0x36')](_0x8bb9af[_0xb197('0x2e')]['sort']);_0xa2cf[_0xb197('0x37')]=qs[_0xb197('0x38')](_[_0xb197('0x39')](_0x8bb9af['query'],_0x8205ae[_0xb197('0x38')]));if(_0x8bb9af[_0xb197('0x2e')]['filter']){_0xa2cf[_0xb197('0x37')]=_[_0xb197('0x3b')](_0xa2cf[_0xb197('0x37')],{'$or':_['map'](_0xa2cf['attributes'],function(_0x595868){var _0x4c0ac6={};_0x4c0ac6[_0x595868]={'$like':'%'+_0x8bb9af[_0xb197('0x2e')]['filter']+'%'};return _0x4c0ac6;})});}_0xa2cf=_[_0xb197('0x3b')]({},_0xa2cf,_0x8bb9af[_0xb197('0x3d')]);return _0x212742[_0xb197('0x48')](_0xa2cf);}})['then'](function(_0x2a4cd2){if(_0x2a4cd2){_0x1a0187=_0x2a4cd2[_0xb197('0x32')];if(!_0x8bb9af[_0xb197('0x2e')][_0xb197('0x33')]('nolimit')){_0xa2cf[_0xb197('0x18')]=qs['limit'](_0x8bb9af['query'][_0xb197('0x18')]);_0xa2cf[_0xb197('0x1a')]=qs[_0xb197('0x1a')](_0x8bb9af[_0xb197('0x2e')]['offset']);}return _0x212742['getFields'](_0xa2cf);}})[_0xb197('0x3e')](function(_0x4c79a2){if(_0x4c79a2){return _0x4c79a2?{'count':_0x1a0187,'rows':_0x4c79a2}:null;}})[_0xb197('0x3e')](respondWithResult(_0x5c7b10,null))[_0xb197('0x42')](handleError(_0x5c7b10,null));};exports['getSubjects']=function(_0x3aa7be,_0x22405a,_0x408948){var _0x3c9d86={};var _0x3915c7={};var _0x987bbf;var _0x2dba4d;return db[_0xb197('0x27')][_0xb197('0x49')]({'where':{'id':_0x3aa7be[_0xb197('0x44')]['id']}})[_0xb197('0x3e')](handleEntityNotFound(_0x22405a,null))[_0xb197('0x3e')](function(_0x3e070b){if(_0x3e070b){_0x987bbf=_0x3e070b;_0x3915c7[_0xb197('0x2c')]=_[_0xb197('0x2d')](db[_0xb197('0x4a')][_0xb197('0x28')]);_0x3915c7[_0xb197('0x2e')]=_[_0xb197('0x2d')](_0x3aa7be['query']);_0x3915c7[_0xb197('0x38')]=_[_0xb197('0x2f')](_0x3915c7[_0xb197('0x2c')],_0x3915c7[_0xb197('0x2e')]);_0x3c9d86[_0xb197('0x31')]=_[_0xb197('0x2f')](_0x3915c7[_0xb197('0x2c')],qs[_0xb197('0x30')](_0x3aa7be[_0xb197('0x2e')]['fields']));_0x3c9d86[_0xb197('0x31')]=_0x3c9d86[_0xb197('0x31')]['length']?_0x3c9d86[_0xb197('0x31')]:_0x3915c7['model'];_0x3c9d86[_0xb197('0x35')]=qs[_0xb197('0x36')](_0x3aa7be[_0xb197('0x2e')][_0xb197('0x36')]);_0x3c9d86['where']=qs['filters'](_[_0xb197('0x39')](_0x3aa7be['query'],_0x3915c7[_0xb197('0x38')]));if(_0x3aa7be[_0xb197('0x2e')][_0xb197('0x3a')]){_0x3c9d86['where']=_[_0xb197('0x3b')](_0x3c9d86[_0xb197('0x37')],{'$or':_[_0xb197('0x3c')](_0x3c9d86['attributes'],function(_0x1e39ab){var _0x293657={};_0x293657[_0x1e39ab]={'$like':'%'+_0x3aa7be[_0xb197('0x2e')][_0xb197('0x3a')]+'%'};return _0x293657;})});}_0x3c9d86=_['merge']({},_0x3c9d86,_0x3aa7be[_0xb197('0x3d')]);return _0x987bbf['getSubjects'](_0x3c9d86);}})[_0xb197('0x3e')](function(_0x36a1bc){if(_0x36a1bc){_0x2dba4d=_0x36a1bc[_0xb197('0x32')];if(!_0x3aa7be[_0xb197('0x2e')][_0xb197('0x33')](_0xb197('0x34'))){_0x3c9d86[_0xb197('0x18')]=qs[_0xb197('0x18')](_0x3aa7be['query']['limit']);_0x3c9d86[_0xb197('0x1a')]=qs['offset'](_0x3aa7be[_0xb197('0x2e')][_0xb197('0x1a')]);}return _0x987bbf[_0xb197('0x4b')](_0x3c9d86);}})[_0xb197('0x3e')](function(_0x3e365f){if(_0x3e365f){return _0x3e365f?{'count':_0x2dba4d,'rows':_0x3e365f}:null;}})['then'](respondWithResult(_0x22405a,null))['catch'](handleError(_0x22405a,null));};exports[_0xb197('0x4c')]=function(_0x3035d6,_0x2f7e57,_0x21cd19){var _0x36f4e5={};var _0x6d58f9={};var _0x45e636;var _0x1b9fa6;return db['SugarcrmConfiguration'][_0xb197('0x49')]({'where':{'id':_0x3035d6[_0xb197('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f7e57,null))[_0xb197('0x3e')](function(_0x4a7b1a){if(_0x4a7b1a){_0x45e636=_0x4a7b1a;_0x6d58f9[_0xb197('0x2c')]=_[_0xb197('0x2d')](db[_0xb197('0x4a')][_0xb197('0x28')]);_0x6d58f9[_0xb197('0x2e')]=_['keys'](_0x3035d6['query']);_0x6d58f9[_0xb197('0x38')]=_[_0xb197('0x2f')](_0x6d58f9[_0xb197('0x2c')],_0x6d58f9[_0xb197('0x2e')]);_0x36f4e5['attributes']=_['intersection'](_0x6d58f9[_0xb197('0x2c')],qs[_0xb197('0x30')](_0x3035d6[_0xb197('0x2e')][_0xb197('0x30')]));_0x36f4e5[_0xb197('0x31')]=_0x36f4e5[_0xb197('0x31')][_0xb197('0x32')]?_0x36f4e5[_0xb197('0x31')]:_0x6d58f9['model'];_0x36f4e5[_0xb197('0x35')]=qs[_0xb197('0x36')](_0x3035d6[_0xb197('0x2e')]['sort']);_0x36f4e5[_0xb197('0x37')]=qs[_0xb197('0x38')](_[_0xb197('0x39')](_0x3035d6[_0xb197('0x2e')],_0x6d58f9[_0xb197('0x38')]));if(_0x3035d6['query'][_0xb197('0x3a')]){_0x36f4e5['where']=_[_0xb197('0x3b')](_0x36f4e5[_0xb197('0x37')],{'$or':_[_0xb197('0x3c')](_0x36f4e5[_0xb197('0x31')],function(_0x1fd199){var _0x4a8516={};_0x4a8516[_0x1fd199]={'$like':'%'+_0x3035d6[_0xb197('0x2e')]['filter']+'%'};return _0x4a8516;})});}_0x36f4e5=_[_0xb197('0x3b')]({},_0x36f4e5,_0x3035d6['options']);return _0x45e636[_0xb197('0x4c')](_0x36f4e5);}})['then'](function(_0x3774db){if(_0x3774db){_0x1b9fa6=_0x3774db[_0xb197('0x32')];if(!_0x3035d6['query']['hasOwnProperty']('nolimit')){_0x36f4e5[_0xb197('0x18')]=qs[_0xb197('0x18')](_0x3035d6[_0xb197('0x2e')][_0xb197('0x18')]);_0x36f4e5[_0xb197('0x1a')]=qs[_0xb197('0x1a')](_0x3035d6[_0xb197('0x2e')][_0xb197('0x1a')]);}return _0x45e636['getDescriptions'](_0x36f4e5);}})['then'](function(_0x24549b){if(_0x24549b){return _0x24549b?{'count':_0x1b9fa6,'rows':_0x24549b}:null;}})[_0xb197('0x3e')](respondWithResult(_0x2f7e57,null))[_0xb197('0x42')](handleError(_0x2f7e57,null));}; \ No newline at end of file +var _0xf2b4=['request-promise','moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','catch','show','params','keys','merge','find','create','body','getFields','SugarcrmField','pick','getSubjects','getDescriptions','findOne','rimraf','zip-dir','fast-json-patch'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xf2b4,0x139));var _0x4f2b=function(_0xc6f1a0,_0x2f9bc5){_0xc6f1a0=_0xc6f1a0-0x0;var _0x38a80a=_0xf2b4[_0xc6f1a0];return _0x38a80a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f2b('0x0'));var zipdir=require(_0x4f2b('0x1'));var jsonpatch=require(_0x4f2b('0x2'));var rp=require(_0x4f2b('0x3'));var moment=require(_0x4f2b('0x4'));var BPromise=require(_0x4f2b('0x5'));var Mustache=require(_0x4f2b('0x6'));var util=require(_0x4f2b('0x7'));var path=require('path');var sox=require(_0x4f2b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f2b('0x9'));var squel=require(_0x4f2b('0xa'));var crypto=require('crypto');var jsforce=require(_0x4f2b('0xb'));var deskjs=require(_0x4f2b('0xc'));var toCsv=require(_0x4f2b('0xd'));var querystring=require(_0x4f2b('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f2b('0xf'));var authService=require(_0x4f2b('0x10'));var qs=require(_0x4f2b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f2b('0x12'));var logger=require(_0x4f2b('0x13'))(_0x4f2b('0x14'));var utils=require(_0x4f2b('0x15'));var config=require(_0x4f2b('0x16'));var licenseUtil=require(_0x4f2b('0x17'));var db=require(_0x4f2b('0x18'))['db'];function respondWithStatusCode(_0x30e743,_0x31ccc5){_0x31ccc5=_0x31ccc5||0xcc;return function(_0x20e7df){if(_0x20e7df){return _0x30e743[_0x4f2b('0x19')](_0x31ccc5);}return _0x30e743[_0x4f2b('0x1a')](_0x31ccc5)[_0x4f2b('0x1b')]();};}function respondWithResult(_0x434b6b,_0x332124){_0x332124=_0x332124||0xc8;return function(_0x1b4fa6){if(_0x1b4fa6){return _0x434b6b['status'](_0x332124)[_0x4f2b('0x1c')](_0x1b4fa6);}};}function respondWithFilteredResult(_0x505929,_0x35a908){return function(_0x42bd4c){if(_0x42bd4c){var _0x4f5308=typeof _0x35a908['offset']===_0x4f2b('0x1d')&&typeof _0x35a908[_0x4f2b('0x1e')]===_0x4f2b('0x1d');var _0x1551b4=_0x42bd4c[_0x4f2b('0x1f')];var _0x5d4de4=_0x4f5308?0x0:_0x35a908['offset'];var _0x4b0107=_0x4f5308?_0x42bd4c[_0x4f2b('0x1f')]:_0x35a908[_0x4f2b('0x20')]+_0x35a908[_0x4f2b('0x1e')];var _0x178aca;if(_0x4b0107>=_0x1551b4){_0x4b0107=_0x1551b4;_0x178aca=0xc8;}else{_0x178aca=0xce;}_0x505929[_0x4f2b('0x1a')](_0x178aca);return _0x505929[_0x4f2b('0x21')](_0x4f2b('0x22'),_0x5d4de4+'-'+_0x4b0107+'/'+_0x1551b4)['json'](_0x42bd4c);}return null;};}function patchUpdates(_0x308b5e){return function(_0x419c24){try{jsonpatch[_0x4f2b('0x23')](_0x419c24,_0x308b5e,!![]);}catch(_0x3ad967){return BPromise['reject'](_0x3ad967);}return _0x419c24[_0x4f2b('0x24')]();};}function saveUpdates(_0x41bd71,_0x5a9d11){return function(_0x10449e){if(_0x10449e){return _0x10449e[_0x4f2b('0x25')](_0x41bd71)[_0x4f2b('0x26')](function(_0x4e9e55){return _0x4e9e55;});}return null;};}function removeEntity(_0x5001f7,_0x11d4d7){return function(_0x279362){if(_0x279362){return _0x279362[_0x4f2b('0x27')]()[_0x4f2b('0x26')](function(){_0x5001f7[_0x4f2b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff8ac,_0x1109bc){return function(_0x3e2db0){if(!_0x3e2db0){_0x4ff8ac[_0x4f2b('0x19')](0x194);}return _0x3e2db0;};}function handleError(_0xc0911e,_0x257cef){_0x257cef=_0x257cef||0x1f4;return function(_0x396d09){logger[_0x4f2b('0x28')](_0x396d09['stack']);if(_0x396d09[_0x4f2b('0x29')]){delete _0x396d09[_0x4f2b('0x29')];}_0xc0911e[_0x4f2b('0x1a')](_0x257cef)[_0x4f2b('0x2a')](_0x396d09);};}exports[_0x4f2b('0x2b')]=function(_0x30ba15,_0x13a31a){var _0x19a3e5={},_0x52d43d={},_0x5d5903={'count':0x0,'rows':[]};var _0x27e6d2=_[_0x4f2b('0x2c')](db[_0x4f2b('0x2d')][_0x4f2b('0x2e')],function(_0x4c9924){return{'name':_0x4c9924['fieldName'],'type':_0x4c9924[_0x4f2b('0x2f')]['key']};});_0x52d43d[_0x4f2b('0x30')]=_[_0x4f2b('0x2c')](_0x27e6d2,_0x4f2b('0x29'));_0x52d43d[_0x4f2b('0x31')]=_['keys'](_0x30ba15[_0x4f2b('0x31')]);_0x52d43d[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x52d43d['model'],_0x52d43d['query']);_0x19a3e5[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x52d43d['model'],qs[_0x4f2b('0x35')](_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x19a3e5[_0x4f2b('0x34')]=_0x19a3e5['attributes'][_0x4f2b('0x36')]?_0x19a3e5[_0x4f2b('0x34')]:_0x52d43d[_0x4f2b('0x30')];if(!_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x37')](_0x4f2b('0x38'))){_0x19a3e5['limit']=qs['limit'](_0x30ba15['query']['limit']);_0x19a3e5[_0x4f2b('0x20')]=qs[_0x4f2b('0x20')](_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x20')]);}_0x19a3e5[_0x4f2b('0x39')]=qs[_0x4f2b('0x3a')](_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x3a')]);_0x19a3e5[_0x4f2b('0x3b')]=qs['filters'](_['pick'](_0x30ba15['query'],_0x52d43d['filters']),_0x27e6d2);if(_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x3c')]){_0x19a3e5[_0x4f2b('0x3b')]=_['merge'](_0x19a3e5[_0x4f2b('0x3b')],{'$or':_['map'](_0x27e6d2,function(_0x433c78){if(_0x433c78[_0x4f2b('0x2f')]!==_0x4f2b('0x3d')){var _0x8b0b00={};_0x8b0b00[_0x433c78[_0x4f2b('0x29')]]={'$like':'%'+_0x30ba15['query']['filter']+'%'};return _0x8b0b00;}})});}_0x19a3e5=_['merge']({},_0x19a3e5,_0x30ba15[_0x4f2b('0x3e')]);var _0x456ffb={'where':_0x19a3e5['where']};return db['SugarcrmConfiguration']['count'](_0x456ffb)['then'](function(_0x4f7c67){_0x5d5903[_0x4f2b('0x1f')]=_0x4f7c67;if(_0x30ba15[_0x4f2b('0x31')][_0x4f2b('0x3f')]){_0x19a3e5[_0x4f2b('0x40')]=[{'all':!![]}];}return db[_0x4f2b('0x2d')]['findAll'](_0x19a3e5);})[_0x4f2b('0x26')](function(_0x4a9c0f){_0x5d5903['rows']=_0x4a9c0f;return _0x5d5903;})[_0x4f2b('0x26')](respondWithFilteredResult(_0x13a31a,_0x19a3e5))[_0x4f2b('0x41')](handleError(_0x13a31a,null));};exports[_0x4f2b('0x42')]=function(_0x2fa2ef,_0x286682){var _0x2edcd3={'raw':![],'where':{'id':_0x2fa2ef[_0x4f2b('0x43')]['id']}},_0x41638d={};_0x41638d[_0x4f2b('0x30')]=_[_0x4f2b('0x44')](db[_0x4f2b('0x2d')][_0x4f2b('0x2e')]);_0x41638d[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x2fa2ef['query']);_0x41638d[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x41638d['model'],_0x41638d[_0x4f2b('0x31')]);_0x2edcd3['attributes']=_['intersection'](_0x41638d[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x2fa2ef[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x2edcd3['attributes']=_0x2edcd3[_0x4f2b('0x34')]['length']?_0x2edcd3['attributes']:_0x41638d[_0x4f2b('0x30')];if(_0x2fa2ef['query'][_0x4f2b('0x3f')]){_0x2edcd3[_0x4f2b('0x40')]=[{'all':!![]}];}_0x2edcd3=_[_0x4f2b('0x45')]({},_0x2edcd3,_0x2fa2ef[_0x4f2b('0x3e')]);return db[_0x4f2b('0x2d')][_0x4f2b('0x46')](_0x2edcd3)['then'](handleEntityNotFound(_0x286682,null))[_0x4f2b('0x26')](respondWithResult(_0x286682,null))[_0x4f2b('0x41')](handleError(_0x286682,null));};exports[_0x4f2b('0x47')]=function(_0x4b0de0,_0x200369){return db['SugarcrmConfiguration'][_0x4f2b('0x47')](_0x4b0de0['body'],{})[_0x4f2b('0x26')](respondWithResult(_0x200369,0xc9))[_0x4f2b('0x41')](handleError(_0x200369,null));};exports[_0x4f2b('0x25')]=function(_0x4d397d,_0x110ef6){if(_0x4d397d[_0x4f2b('0x48')]['id']){delete _0x4d397d['body']['id'];}return db[_0x4f2b('0x2d')][_0x4f2b('0x46')]({'where':{'id':_0x4d397d[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x110ef6,null))[_0x4f2b('0x26')](saveUpdates(_0x4d397d[_0x4f2b('0x48')],null))[_0x4f2b('0x26')](respondWithResult(_0x110ef6,null))[_0x4f2b('0x41')](handleError(_0x110ef6,null));};exports[_0x4f2b('0x27')]=function(_0x4189cf,_0x2b58e5){return db[_0x4f2b('0x2d')][_0x4f2b('0x46')]({'where':{'id':_0x4189cf[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x2b58e5,null))['then'](removeEntity(_0x2b58e5,null))['catch'](handleError(_0x2b58e5,null));};exports[_0x4f2b('0x49')]=function(_0x51f0b2,_0x13aea8,_0x21a7f8){var _0x2ac6fd={};var _0x5eaede={};var _0x550e4a;var _0x214af0;return db[_0x4f2b('0x2d')]['findOne']({'where':{'id':_0x51f0b2[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x13aea8,null))[_0x4f2b('0x26')](function(_0x14472c){if(_0x14472c){_0x550e4a=_0x14472c;_0x5eaede['model']=_['keys'](db[_0x4f2b('0x4a')]['rawAttributes']);_0x5eaede[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x51f0b2[_0x4f2b('0x31')]);_0x5eaede[_0x4f2b('0x32')]=_['intersection'](_0x5eaede[_0x4f2b('0x30')],_0x5eaede['query']);_0x2ac6fd[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x5eaede[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x2ac6fd[_0x4f2b('0x34')]=_0x2ac6fd['attributes'][_0x4f2b('0x36')]?_0x2ac6fd[_0x4f2b('0x34')]:_0x5eaede[_0x4f2b('0x30')];_0x2ac6fd[_0x4f2b('0x39')]=qs['sort'](_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x3a')]);_0x2ac6fd['where']=qs[_0x4f2b('0x32')](_[_0x4f2b('0x4b')](_0x51f0b2['query'],_0x5eaede[_0x4f2b('0x32')]));if(_0x51f0b2['query'][_0x4f2b('0x3c')]){_0x2ac6fd[_0x4f2b('0x3b')]=_[_0x4f2b('0x45')](_0x2ac6fd['where'],{'$or':_[_0x4f2b('0x2c')](_0x2ac6fd[_0x4f2b('0x34')],function(_0x38bf18){var _0x70453f={};_0x70453f[_0x38bf18]={'$like':'%'+_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x3c')]+'%'};return _0x70453f;})});}_0x2ac6fd=_[_0x4f2b('0x45')]({},_0x2ac6fd,_0x51f0b2[_0x4f2b('0x3e')]);return _0x550e4a[_0x4f2b('0x49')](_0x2ac6fd);}})[_0x4f2b('0x26')](function(_0x4339c6){if(_0x4339c6){_0x214af0=_0x4339c6[_0x4f2b('0x36')];if(!_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x37')](_0x4f2b('0x38'))){_0x2ac6fd['limit']=qs[_0x4f2b('0x1e')](_0x51f0b2['query']['limit']);_0x2ac6fd[_0x4f2b('0x20')]=qs[_0x4f2b('0x20')](_0x51f0b2[_0x4f2b('0x31')][_0x4f2b('0x20')]);}return _0x550e4a[_0x4f2b('0x49')](_0x2ac6fd);}})[_0x4f2b('0x26')](function(_0x5b86ea){if(_0x5b86ea){return _0x5b86ea?{'count':_0x214af0,'rows':_0x5b86ea}:null;}})[_0x4f2b('0x26')](respondWithResult(_0x13aea8,null))[_0x4f2b('0x41')](handleError(_0x13aea8,null));};exports[_0x4f2b('0x4c')]=function(_0x24386e,_0x5e1d9c,_0x535afa){var _0x213229={};var _0x24b36b={};var _0x48d757;var _0x4dff9b;return db[_0x4f2b('0x2d')]['findOne']({'where':{'id':_0x24386e['params']['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x5e1d9c,null))[_0x4f2b('0x26')](function(_0x4e6fd8){if(_0x4e6fd8){_0x48d757=_0x4e6fd8;_0x24b36b[_0x4f2b('0x30')]=_['keys'](db[_0x4f2b('0x4a')][_0x4f2b('0x2e')]);_0x24b36b[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x24386e[_0x4f2b('0x31')]);_0x24b36b[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x24b36b[_0x4f2b('0x30')],_0x24b36b['query']);_0x213229[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x24b36b[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x35')]));_0x213229[_0x4f2b('0x34')]=_0x213229[_0x4f2b('0x34')][_0x4f2b('0x36')]?_0x213229[_0x4f2b('0x34')]:_0x24b36b['model'];_0x213229[_0x4f2b('0x39')]=qs['sort'](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x3a')]);_0x213229[_0x4f2b('0x3b')]=qs['filters'](_[_0x4f2b('0x4b')](_0x24386e['query'],_0x24b36b[_0x4f2b('0x32')]));if(_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x3c')]){_0x213229[_0x4f2b('0x3b')]=_[_0x4f2b('0x45')](_0x213229[_0x4f2b('0x3b')],{'$or':_[_0x4f2b('0x2c')](_0x213229['attributes'],function(_0x2ed911){var _0x3f5956={};_0x3f5956[_0x2ed911]={'$like':'%'+_0x24386e['query'][_0x4f2b('0x3c')]+'%'};return _0x3f5956;})});}_0x213229=_[_0x4f2b('0x45')]({},_0x213229,_0x24386e[_0x4f2b('0x3e')]);return _0x48d757[_0x4f2b('0x4c')](_0x213229);}})[_0x4f2b('0x26')](function(_0x170ab6){if(_0x170ab6){_0x4dff9b=_0x170ab6['length'];if(!_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x37')](_0x4f2b('0x38'))){_0x213229['limit']=qs[_0x4f2b('0x1e')](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x1e')]);_0x213229[_0x4f2b('0x20')]=qs[_0x4f2b('0x20')](_0x24386e[_0x4f2b('0x31')][_0x4f2b('0x20')]);}return _0x48d757[_0x4f2b('0x4c')](_0x213229);}})[_0x4f2b('0x26')](function(_0x6a59ea){if(_0x6a59ea){return _0x6a59ea?{'count':_0x4dff9b,'rows':_0x6a59ea}:null;}})[_0x4f2b('0x26')](respondWithResult(_0x5e1d9c,null))[_0x4f2b('0x41')](handleError(_0x5e1d9c,null));};exports[_0x4f2b('0x4d')]=function(_0x4206bb,_0x56a59f,_0x3464a0){var _0x1684ca={};var _0x185a04={};var _0x1d8506;var _0x437b44;return db[_0x4f2b('0x2d')][_0x4f2b('0x4e')]({'where':{'id':_0x4206bb[_0x4f2b('0x43')]['id']}})[_0x4f2b('0x26')](handleEntityNotFound(_0x56a59f,null))[_0x4f2b('0x26')](function(_0x436c4c){if(_0x436c4c){_0x1d8506=_0x436c4c;_0x185a04[_0x4f2b('0x30')]=_[_0x4f2b('0x44')](db['SugarcrmField'][_0x4f2b('0x2e')]);_0x185a04[_0x4f2b('0x31')]=_[_0x4f2b('0x44')](_0x4206bb[_0x4f2b('0x31')]);_0x185a04[_0x4f2b('0x32')]=_[_0x4f2b('0x33')](_0x185a04[_0x4f2b('0x30')],_0x185a04[_0x4f2b('0x31')]);_0x1684ca[_0x4f2b('0x34')]=_[_0x4f2b('0x33')](_0x185a04[_0x4f2b('0x30')],qs[_0x4f2b('0x35')](_0x4206bb['query'][_0x4f2b('0x35')]));_0x1684ca['attributes']=_0x1684ca[_0x4f2b('0x34')][_0x4f2b('0x36')]?_0x1684ca['attributes']:_0x185a04[_0x4f2b('0x30')];_0x1684ca['order']=qs['sort'](_0x4206bb['query'][_0x4f2b('0x3a')]);_0x1684ca[_0x4f2b('0x3b')]=qs['filters'](_[_0x4f2b('0x4b')](_0x4206bb['query'],_0x185a04[_0x4f2b('0x32')]));if(_0x4206bb[_0x4f2b('0x31')][_0x4f2b('0x3c')]){_0x1684ca['where']=_[_0x4f2b('0x45')](_0x1684ca['where'],{'$or':_[_0x4f2b('0x2c')](_0x1684ca[_0x4f2b('0x34')],function(_0x31ce7e){var _0x3b2b72={};_0x3b2b72[_0x31ce7e]={'$like':'%'+_0x4206bb['query'][_0x4f2b('0x3c')]+'%'};return _0x3b2b72;})});}_0x1684ca=_[_0x4f2b('0x45')]({},_0x1684ca,_0x4206bb[_0x4f2b('0x3e')]);return _0x1d8506[_0x4f2b('0x4d')](_0x1684ca);}})[_0x4f2b('0x26')](function(_0x3638d3){if(_0x3638d3){_0x437b44=_0x3638d3[_0x4f2b('0x36')];if(!_0x4206bb[_0x4f2b('0x31')]['hasOwnProperty'](_0x4f2b('0x38'))){_0x1684ca[_0x4f2b('0x1e')]=qs[_0x4f2b('0x1e')](_0x4206bb[_0x4f2b('0x31')][_0x4f2b('0x1e')]);_0x1684ca['offset']=qs[_0x4f2b('0x20')](_0x4206bb['query'][_0x4f2b('0x20')]);}return _0x1d8506['getDescriptions'](_0x1684ca);}})[_0x4f2b('0x26')](function(_0x17a1e8){if(_0x17a1e8){return _0x17a1e8?{'count':_0x437b44,'rows':_0x17a1e8}:null;}})['then'](respondWithResult(_0x56a59f,null))[_0x4f2b('0x41')](handleError(_0x56a59f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 62433f0..23a1d14 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 _0xcc1a=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','int_sugarcrm_configurations'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0xcc1a,0xf0));var _0xacc1=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0xcc1a[_0x5ef55a];return _0x20ae40;};'use strict';var _=require(_0xacc1('0x0'));var util=require(_0xacc1('0x1'));var logger=require(_0xacc1('0x2'))(_0xacc1('0x3'));var moment=require(_0xacc1('0x4'));var BPromise=require(_0xacc1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xacc1('0x6'));var config=require(_0xacc1('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x3315dc,_0x157949){return _0x3315dc[_0xacc1('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xacc1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ff4=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x4ff4,0x13b));var _0x44ff=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x4ff4[_0x2bbc07];return _0x6879e4;};'use strict';var _=require(_0x44ff('0x0'));var util=require(_0x44ff('0x1'));var logger=require(_0x44ff('0x2'))(_0x44ff('0x3'));var moment=require(_0x44ff('0x4'));var BPromise=require('bluebird');var rp=require(_0x44ff('0x5'));var fs=require('fs');var path=require(_0x44ff('0x6'));var rimraf=require('rimraf');var config=require(_0x44ff('0x7'));var attributes=require(_0x44ff('0x8'));module[_0x44ff('0x9')]=function(_0x33975b,_0x5cd962){return _0x33975b[_0x44ff('0xa')](_0x44ff('0xb'),attributes,{'tableName':_0x44ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 440f598..f5ab9f7 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 _0x6aa1=['result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','SugarcrmConfiguration,\x20%s,\x20%s','message'];(function(_0x2fc76c,_0x5e0657){var _0x26b26a=function(_0x3129e0){while(--_0x3129e0){_0x2fc76c['push'](_0x2fc76c['shift']());}};_0x26b26a(++_0x5e0657);}(_0x6aa1,0x136));var _0x16aa=function(_0x391dfa,_0x26bea7){_0x391dfa=_0x391dfa-0x0;var _0x86a6e=_0x6aa1[_0x391dfa];return _0x86a6e;};'use strict';var _=require(_0x16aa('0x0'));var util=require(_0x16aa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x16aa('0x2'));var fs=require('fs');var Redis=require(_0x16aa('0x3'));var db=require(_0x16aa('0x4'))['db'];var utils=require(_0x16aa('0x5'));var logger=require(_0x16aa('0x6'))(_0x16aa('0x7'));var config=require(_0x16aa('0x8'));var jayson=require(_0x16aa('0x9'));var client=jayson[_0x16aa('0xa')][_0x16aa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30030,_0x3f151c,_0x579cd0){return new BPromise(function(_0x1cbc4c,_0x131fae){return client[_0x16aa('0xc')](_0x30030,_0x579cd0)[_0x16aa('0xd')](function(_0x720235){logger[_0x16aa('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3f151c,_0x16aa('0xf'));logger[_0x16aa('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3f151c,_0x16aa('0xf'),JSON['stringify'](_0x720235));if(_0x720235[_0x16aa('0x11')]){if(_0x720235[_0x16aa('0x11')]['code']===0x1f4){logger['error'](_0x16aa('0x12'),_0x3f151c,_0x720235[_0x16aa('0x11')]['message']);return _0x131fae(_0x720235[_0x16aa('0x11')]['message']);}logger[_0x16aa('0x11')](_0x16aa('0x12'),_0x3f151c,_0x720235[_0x16aa('0x11')][_0x16aa('0x13')]);return _0x1cbc4c(_0x720235['error'][_0x16aa('0x13')]);}else{logger['info'](_0x16aa('0x12'),_0x3f151c,'request\x20sent');_0x1cbc4c(_0x720235[_0x16aa('0x14')][_0x16aa('0x13')]);}})[_0x16aa('0x15')](function(_0x1f8a17){logger['error'](_0x16aa('0x12'),_0x3f151c,_0x1f8a17);_0x131fae(_0x1f8a17);});});} \ No newline at end of file +var _0x69de=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x69de,0x1f4));var _0xe69d=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x69de[_0x1cfe2e];return _0x39233f;};'use strict';var _=require(_0xe69d('0x0'));var util=require(_0xe69d('0x1'));var moment=require(_0xe69d('0x2'));var BPromise=require(_0xe69d('0x3'));var rs=require(_0xe69d('0x4'));var fs=require('fs');var Redis=require(_0xe69d('0x5'));var db=require(_0xe69d('0x6'))['db'];var utils=require(_0xe69d('0x7'));var logger=require(_0xe69d('0x8'))(_0xe69d('0x9'));var config=require(_0xe69d('0xa'));var jayson=require(_0xe69d('0xb'));var client=jayson[_0xe69d('0xc')][_0xe69d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x14309a,_0x4e89fe,_0x56fcd7){return new BPromise(function(_0x4f7d88,_0x507f49){return client['request'](_0x14309a,_0x56fcd7)[_0xe69d('0xe')](function(_0x224627){logger[_0xe69d('0xf')](_0xe69d('0x10'),_0x4e89fe,_0xe69d('0x11'));logger[_0xe69d('0x12')](_0xe69d('0x13'),_0x4e89fe,_0xe69d('0x11'),JSON[_0xe69d('0x14')](_0x224627));if(_0x224627[_0xe69d('0x15')]){if(_0x224627[_0xe69d('0x15')]['code']===0x1f4){logger[_0xe69d('0x15')](_0xe69d('0x10'),_0x4e89fe,_0x224627['error']['message']);return _0x507f49(_0x224627[_0xe69d('0x15')][_0xe69d('0x16')]);}logger[_0xe69d('0x15')](_0xe69d('0x10'),_0x4e89fe,_0x224627[_0xe69d('0x15')][_0xe69d('0x16')]);return _0x4f7d88(_0x224627['error'][_0xe69d('0x16')]);}else{logger[_0xe69d('0xf')](_0xe69d('0x10'),_0x4e89fe,_0xe69d('0x11'));_0x4f7d88(_0x224627['result']['message']);}})[_0xe69d('0x17')](function(_0x1410b6){logger['error'](_0xe69d('0x10'),_0x4e89fe,_0x1410b6);_0x507f49(_0x1410b6);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index ae8e986..cb113d6 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 _0x277a=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x277a,0x181));var _0xa277=function(_0x1fe819,_0x5983ee){_0x1fe819=_0x1fe819-0x0;var _0x3b4c7d=_0x277a[_0x1fe819];return _0x3b4c7d;};'use strict';var multer=require(_0xa277('0x0'));var util=require(_0xa277('0x1'));var path=require('path');var timeout=require(_0xa277('0x2'));var express=require('express');var router=express[_0xa277('0x3')]();var fs_extra=require(_0xa277('0x4'));var auth=require(_0xa277('0x5'));var interaction=require(_0xa277('0x6'));var config=require(_0xa277('0x7'));var controller=require(_0xa277('0x8'));router[_0xa277('0x9')]('/',auth[_0xa277('0xa')](),controller[_0xa277('0xb')]);router[_0xa277('0x9')](_0xa277('0xc'),auth[_0xa277('0xa')](),controller[_0xa277('0xd')]);router[_0xa277('0xe')]('/',auth[_0xa277('0xa')](),controller[_0xa277('0xf')]);router[_0xa277('0x10')](_0xa277('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa277('0xc'),auth[_0xa277('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2af5=['index','get','/:id','post','create','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated'];(function(_0x6fa59b,_0x3e0ca5){var _0x269256=function(_0x1d1534){while(--_0x1d1534){_0x6fa59b['push'](_0x6fa59b['shift']());}};_0x269256(++_0x3e0ca5);}(_0x2af5,0x17e));var _0x52af=function(_0x4b74d3,_0x607c2c){_0x4b74d3=_0x4b74d3-0x0;var _0x3b38bb=_0x2af5[_0x4b74d3];return _0x3b38bb;};'use strict';var multer=require(_0x52af('0x0'));var util=require(_0x52af('0x1'));var path=require('path');var timeout=require(_0x52af('0x2'));var express=require(_0x52af('0x3'));var router=express['Router']();var fs_extra=require(_0x52af('0x4'));var auth=require(_0x52af('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x52af('0x6'));var controller=require(_0x52af('0x7'));router['get']('/',auth[_0x52af('0x8')](),controller[_0x52af('0x9')]);router[_0x52af('0xa')](_0x52af('0xb'),auth[_0x52af('0x8')](),controller['show']);router[_0x52af('0xc')]('/',auth[_0x52af('0x8')](),controller[_0x52af('0xd')]);router['put'](_0x52af('0xb'),auth[_0x52af('0x8')](),controller[_0x52af('0xe')]);router['delete'](_0x52af('0xb'),auth[_0x52af('0x8')](),controller[_0x52af('0xf')]);module[_0x52af('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 929ca3e..00706d1 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 _0xbf96=['keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0xbf96,0x69));var _0x6bf9=function(_0x598641,_0x495230){_0x598641=_0x598641-0x0;var _0x5e7f08=_0xbf96[_0x598641];return _0x5e7f08;};'use strict';var Sequelize=require(_0x6bf9('0x0'));module[_0x6bf9('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6bf9('0x2'),_0x6bf9('0x3'),_0x6bf9('0x4'),_0x6bf9('0x5'),_0x6bf9('0x6')),'defaultValue':_0x6bf9('0x2')},'content':{'type':Sequelize[_0x6bf9('0x7')]},'key':{'type':Sequelize[_0x6bf9('0x7')]},'keyType':{'type':Sequelize[_0x6bf9('0x8')](_0x6bf9('0x2'),_0x6bf9('0x3'),_0x6bf9('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6bf9('0x7')]},'nameField':{'type':Sequelize[_0x6bf9('0x7')]},'customField':{'type':Sequelize[_0x6bf9('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd9d5=['ENUM','customVariable','BOOLEAN','exports','string','variable','picklist','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd9d5,0xeb));var _0x5d9d=function(_0x524b71,_0xae0ecc){_0x524b71=_0x524b71-0x0;var _0x38413f=_0xd9d5[_0x524b71];return _0x38413f;};'use strict';var Sequelize=require('sequelize');module[_0x5d9d('0x0')]={'type':{'type':Sequelize['ENUM'](_0x5d9d('0x1'),_0x5d9d('0x2'),'customVariable','keyValue',_0x5d9d('0x3')),'defaultValue':_0x5d9d('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5d9d('0x4')]},'keyType':{'type':Sequelize[_0x5d9d('0x5')]('string',_0x5d9d('0x2'),_0x5d9d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5d9d('0x4')]},'customField':{'type':Sequelize[_0x5d9d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5d9d('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 5c95993..99b45a4 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 _0xa8c0=['util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache'];(function(_0x84847d,_0x2d9e2b){var _0x1abffa=function(_0x3c112f){while(--_0x3c112f){_0x84847d['push'](_0x84847d['shift']());}};_0x1abffa(++_0x2d9e2b);}(_0xa8c0,0xe5));var _0x0a8c=function(_0x395bfe,_0x4db521){_0x395bfe=_0x395bfe-0x0;var _0x35c81c=_0xa8c0[_0x395bfe];return _0x35c81c;};'use strict';var emlformat=require(_0x0a8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a8c('0x1'));var jsonpatch=require(_0x0a8c('0x2'));var rp=require(_0x0a8c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a8c('0x4'));var util=require(_0x0a8c('0x5'));var path=require('path');var sox=require(_0x0a8c('0x6'));var csv=require(_0x0a8c('0x7'));var ejs=require(_0x0a8c('0x8'));var fs=require('fs');var fs_extra=require(_0x0a8c('0x9'));var _=require(_0x0a8c('0xa'));var squel=require('squel');var crypto=require(_0x0a8c('0xb'));var jsforce=require(_0x0a8c('0xc'));var deskjs=require(_0x0a8c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0a8c('0xe'));var Papa=require(_0x0a8c('0xf'));var Redis=require(_0x0a8c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0a8c('0x11'));var as=require(_0x0a8c('0x12'));var hardwareService=require(_0x0a8c('0x13'));var logger=require(_0x0a8c('0x14'))(_0x0a8c('0x15'));var utils=require(_0x0a8c('0x16'));var config=require(_0x0a8c('0x17'));var licenseUtil=require(_0x0a8c('0x18'));var db=require(_0x0a8c('0x19'))['db'];function respondWithStatusCode(_0x49e203,_0x57fd7b){_0x57fd7b=_0x57fd7b||0xcc;return function(_0x4288ca){if(_0x4288ca){return _0x49e203[_0x0a8c('0x1a')](_0x57fd7b);}return _0x49e203[_0x0a8c('0x1b')](_0x57fd7b)[_0x0a8c('0x1c')]();};}function respondWithResult(_0x99f2df,_0x4f9ae){_0x4f9ae=_0x4f9ae||0xc8;return function(_0xb1e742){if(_0xb1e742){return _0x99f2df['status'](_0x4f9ae)[_0x0a8c('0x1d')](_0xb1e742);}};}function respondWithFilteredResult(_0x5d0bc9,_0x59a9c8){return function(_0x3b18ae){if(_0x3b18ae){var _0x38bf57=typeof _0x59a9c8[_0x0a8c('0x1e')]===_0x0a8c('0x1f')&&typeof _0x59a9c8[_0x0a8c('0x20')]===_0x0a8c('0x1f');var _0x452d38=_0x3b18ae[_0x0a8c('0x21')];var _0xb6ca6a=_0x38bf57?0x0:_0x59a9c8[_0x0a8c('0x1e')];var _0x4ad8b4=_0x38bf57?_0x3b18ae[_0x0a8c('0x21')]:_0x59a9c8['offset']+_0x59a9c8[_0x0a8c('0x20')];var _0x258712;if(_0x4ad8b4>=_0x452d38){_0x4ad8b4=_0x452d38;_0x258712=0xc8;}else{_0x258712=0xce;}_0x5d0bc9[_0x0a8c('0x1b')](_0x258712);return _0x5d0bc9['set'](_0x0a8c('0x22'),_0xb6ca6a+'-'+_0x4ad8b4+'/'+_0x452d38)[_0x0a8c('0x1d')](_0x3b18ae);}return null;};}function patchUpdates(_0x151e56){return function(_0xdeadad){try{jsonpatch[_0x0a8c('0x23')](_0xdeadad,_0x151e56,!![]);}catch(_0x53895b){return BPromise[_0x0a8c('0x24')](_0x53895b);}return _0xdeadad[_0x0a8c('0x25')]();};}function saveUpdates(_0x5e3444,_0x459c3f){return function(_0x4ba3bd){if(_0x4ba3bd){return _0x4ba3bd[_0x0a8c('0x26')](_0x5e3444)[_0x0a8c('0x27')](function(_0x15f150){return _0x15f150;});}return null;};}function removeEntity(_0x1382f8,_0x190c42){return function(_0x341f8e){if(_0x341f8e){return _0x341f8e[_0x0a8c('0x28')]()['then'](function(){_0x1382f8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dcced,_0x4dcd43){return function(_0x4206a8){if(!_0x4206a8){_0x5dcced[_0x0a8c('0x1a')](0x194);}return _0x4206a8;};}function handleError(_0x5b20f1,_0x54a8a6){_0x54a8a6=_0x54a8a6||0x1f4;return function(_0x57607b){logger['error'](_0x57607b['stack']);if(_0x57607b[_0x0a8c('0x29')]){delete _0x57607b[_0x0a8c('0x29')];}_0x5b20f1[_0x0a8c('0x1b')](_0x54a8a6)[_0x0a8c('0x2a')](_0x57607b);};}exports[_0x0a8c('0x2b')]=function(_0x2f380c,_0x33a219){var _0x4bbfa9={},_0x168188={},_0x44437c={'count':0x0,'rows':[]};var _0x350927=_[_0x0a8c('0x2c')](db[_0x0a8c('0x2d')][_0x0a8c('0x2e')],function(_0x20bd0d){return{'name':_0x20bd0d[_0x0a8c('0x2f')],'type':_0x20bd0d['type'][_0x0a8c('0x30')]};});_0x168188['model']=_[_0x0a8c('0x2c')](_0x350927,_0x0a8c('0x29'));_0x168188[_0x0a8c('0x31')]=_[_0x0a8c('0x32')](_0x2f380c[_0x0a8c('0x31')]);_0x168188['filters']=_[_0x0a8c('0x33')](_0x168188[_0x0a8c('0x34')],_0x168188[_0x0a8c('0x31')]);_0x4bbfa9[_0x0a8c('0x35')]=_[_0x0a8c('0x33')](_0x168188[_0x0a8c('0x34')],qs[_0x0a8c('0x36')](_0x2f380c[_0x0a8c('0x31')]['fields']));_0x4bbfa9[_0x0a8c('0x35')]=_0x4bbfa9['attributes']['length']?_0x4bbfa9[_0x0a8c('0x35')]:_0x168188[_0x0a8c('0x34')];if(!_0x2f380c['query'][_0x0a8c('0x37')](_0x0a8c('0x38'))){_0x4bbfa9[_0x0a8c('0x20')]=qs[_0x0a8c('0x20')](_0x2f380c[_0x0a8c('0x31')][_0x0a8c('0x20')]);_0x4bbfa9[_0x0a8c('0x1e')]=qs[_0x0a8c('0x1e')](_0x2f380c['query']['offset']);}_0x4bbfa9[_0x0a8c('0x39')]=qs[_0x0a8c('0x3a')](_0x2f380c['query'][_0x0a8c('0x3a')]);_0x4bbfa9['where']=qs[_0x0a8c('0x3b')](_[_0x0a8c('0x3c')](_0x2f380c[_0x0a8c('0x31')],_0x168188['filters']),_0x350927);if(_0x2f380c[_0x0a8c('0x31')][_0x0a8c('0x3d')]){_0x4bbfa9[_0x0a8c('0x3e')]=_[_0x0a8c('0x3f')](_0x4bbfa9[_0x0a8c('0x3e')],{'$or':_['map'](_0x350927,function(_0x160cff){if(_0x160cff[_0x0a8c('0x40')]!==_0x0a8c('0x41')){var _0x5eba62={};_0x5eba62[_0x160cff[_0x0a8c('0x29')]]={'$like':'%'+_0x2f380c[_0x0a8c('0x31')][_0x0a8c('0x3d')]+'%'};return _0x5eba62;}})});}_0x4bbfa9=_['merge']({},_0x4bbfa9,_0x2f380c[_0x0a8c('0x42')]);var _0x3e8737={'where':_0x4bbfa9[_0x0a8c('0x3e')]};return db['SugarcrmField']['count'](_0x3e8737)['then'](function(_0x2a83a8){_0x44437c['count']=_0x2a83a8;if(_0x2f380c[_0x0a8c('0x31')]['includeAll']){_0x4bbfa9[_0x0a8c('0x43')]=[{'all':!![]}];}return db['SugarcrmField'][_0x0a8c('0x44')](_0x4bbfa9);})[_0x0a8c('0x27')](function(_0x5aeeb1){_0x44437c[_0x0a8c('0x45')]=_0x5aeeb1;return _0x44437c;})['then'](respondWithFilteredResult(_0x33a219,_0x4bbfa9))[_0x0a8c('0x46')](handleError(_0x33a219,null));};exports[_0x0a8c('0x47')]=function(_0x29746c,_0x40d705){var _0x4a0535={'raw':!![],'where':{'id':_0x29746c[_0x0a8c('0x48')]['id']}},_0x5e294a={};_0x5e294a['model']=_[_0x0a8c('0x32')](db[_0x0a8c('0x2d')][_0x0a8c('0x2e')]);_0x5e294a[_0x0a8c('0x31')]=_[_0x0a8c('0x32')](_0x29746c['query']);_0x5e294a[_0x0a8c('0x3b')]=_[_0x0a8c('0x33')](_0x5e294a['model'],_0x5e294a[_0x0a8c('0x31')]);_0x4a0535[_0x0a8c('0x35')]=_[_0x0a8c('0x33')](_0x5e294a[_0x0a8c('0x34')],qs[_0x0a8c('0x36')](_0x29746c['query']['fields']));_0x4a0535[_0x0a8c('0x35')]=_0x4a0535[_0x0a8c('0x35')][_0x0a8c('0x49')]?_0x4a0535[_0x0a8c('0x35')]:_0x5e294a[_0x0a8c('0x34')];if(_0x29746c[_0x0a8c('0x31')][_0x0a8c('0x4a')]){_0x4a0535[_0x0a8c('0x43')]=[{'all':!![]}];}_0x4a0535=_['merge']({},_0x4a0535,_0x29746c[_0x0a8c('0x42')]);return db[_0x0a8c('0x2d')][_0x0a8c('0x4b')](_0x4a0535)[_0x0a8c('0x27')](handleEntityNotFound(_0x40d705,null))[_0x0a8c('0x27')](respondWithResult(_0x40d705,null))[_0x0a8c('0x46')](handleError(_0x40d705,null));};exports[_0x0a8c('0x4c')]=function(_0x4f3346,_0x5df4d9){return db[_0x0a8c('0x2d')][_0x0a8c('0x4c')](_0x4f3346[_0x0a8c('0x4d')],{})[_0x0a8c('0x27')](respondWithResult(_0x5df4d9,0xc9))[_0x0a8c('0x46')](handleError(_0x5df4d9,null));};exports[_0x0a8c('0x26')]=function(_0x49a3a0,_0x4095bd){if(_0x49a3a0[_0x0a8c('0x4d')]['id']){delete _0x49a3a0['body']['id'];}return db[_0x0a8c('0x2d')][_0x0a8c('0x4b')]({'where':{'id':_0x49a3a0[_0x0a8c('0x48')]['id']}})[_0x0a8c('0x27')](handleEntityNotFound(_0x4095bd,null))[_0x0a8c('0x27')](saveUpdates(_0x49a3a0[_0x0a8c('0x4d')],null))['then'](respondWithResult(_0x4095bd,null))['catch'](handleError(_0x4095bd,null));};exports[_0x0a8c('0x28')]=function(_0x29202c,_0xd6a18b){return db[_0x0a8c('0x2d')][_0x0a8c('0x4b')]({'where':{'id':_0x29202c[_0x0a8c('0x48')]['id']}})['then'](handleEntityNotFound(_0xd6a18b,null))['then'](removeEntity(_0xd6a18b,null))[_0x0a8c('0x46')](handleError(_0xd6a18b,null));}; \ No newline at end of file +var _0xa6e3=['../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','include','options','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa6e3,0x111));var _0x3a6e=function(_0x533b5f,_0x238373){_0x533b5f=_0x533b5f-0x0;var _0x4b40a3=_0xa6e3[_0x533b5f];return _0x4b40a3;};'use strict';var emlformat=require(_0x3a6e('0x0'));var rimraf=require(_0x3a6e('0x1'));var zipdir=require(_0x3a6e('0x2'));var jsonpatch=require(_0x3a6e('0x3'));var rp=require('request-promise');var moment=require(_0x3a6e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a6e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3a6e('0x6'));var csv=require('to-csv');var ejs=require(_0x3a6e('0x7'));var fs=require('fs');var fs_extra=require(_0x3a6e('0x8'));var _=require(_0x3a6e('0x9'));var squel=require(_0x3a6e('0xa'));var crypto=require(_0x3a6e('0xb'));var jsforce=require(_0x3a6e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3a6e('0xd'));var querystring=require(_0x3a6e('0xe'));var Papa=require(_0x3a6e('0xf'));var Redis=require(_0x3a6e('0x10'));var authService=require(_0x3a6e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3a6e('0x12'));var hardwareService=require(_0x3a6e('0x13'));var logger=require(_0x3a6e('0x14'))(_0x3a6e('0x15'));var utils=require('../../config/utils');var config=require(_0x3a6e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x71c00d,_0x13e374){_0x13e374=_0x13e374||0xcc;return function(_0x55b84a){if(_0x55b84a){return _0x71c00d[_0x3a6e('0x17')](_0x13e374);}return _0x71c00d['status'](_0x13e374)[_0x3a6e('0x18')]();};}function respondWithResult(_0x47a0c1,_0x59ab6d){_0x59ab6d=_0x59ab6d||0xc8;return function(_0x91ea65){if(_0x91ea65){return _0x47a0c1[_0x3a6e('0x19')](_0x59ab6d)['json'](_0x91ea65);}};}function respondWithFilteredResult(_0x4d77ce,_0x7ec5f1){return function(_0x536ae2){if(_0x536ae2){var _0xec1bc4=typeof _0x7ec5f1['offset']===_0x3a6e('0x1a')&&typeof _0x7ec5f1['limit']==='undefined';var _0x3fe7dc=_0x536ae2[_0x3a6e('0x1b')];var _0x22df93=_0xec1bc4?0x0:_0x7ec5f1[_0x3a6e('0x1c')];var _0x17b39f=_0xec1bc4?_0x536ae2['count']:_0x7ec5f1[_0x3a6e('0x1c')]+_0x7ec5f1[_0x3a6e('0x1d')];var _0x258a71;if(_0x17b39f>=_0x3fe7dc){_0x17b39f=_0x3fe7dc;_0x258a71=0xc8;}else{_0x258a71=0xce;}_0x4d77ce['status'](_0x258a71);return _0x4d77ce['set'](_0x3a6e('0x1e'),_0x22df93+'-'+_0x17b39f+'/'+_0x3fe7dc)[_0x3a6e('0x1f')](_0x536ae2);}return null;};}function patchUpdates(_0x40b608){return function(_0x27f2d9){try{jsonpatch[_0x3a6e('0x20')](_0x27f2d9,_0x40b608,!![]);}catch(_0x3e70d5){return BPromise[_0x3a6e('0x21')](_0x3e70d5);}return _0x27f2d9[_0x3a6e('0x22')]();};}function saveUpdates(_0x14f55b,_0x195191){return function(_0xdfe71a){if(_0xdfe71a){return _0xdfe71a['update'](_0x14f55b)[_0x3a6e('0x23')](function(_0x3e264a){return _0x3e264a;});}return null;};}function removeEntity(_0x2af145,_0x177c66){return function(_0x29721e){if(_0x29721e){return _0x29721e[_0x3a6e('0x24')]()[_0x3a6e('0x23')](function(){_0x2af145[_0x3a6e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x299700,_0x2282cd){return function(_0x1a0bb7){if(!_0x1a0bb7){_0x299700[_0x3a6e('0x17')](0x194);}return _0x1a0bb7;};}function handleError(_0x48bfee,_0x16b19c){_0x16b19c=_0x16b19c||0x1f4;return function(_0x196e36){logger[_0x3a6e('0x25')](_0x196e36[_0x3a6e('0x26')]);if(_0x196e36[_0x3a6e('0x27')]){delete _0x196e36[_0x3a6e('0x27')];}_0x48bfee[_0x3a6e('0x19')](_0x16b19c)[_0x3a6e('0x28')](_0x196e36);};}exports['index']=function(_0x531068,_0x4ce658){var _0x5bb701={},_0x5be06={},_0x15d171={'count':0x0,'rows':[]};var _0x5074f1=_[_0x3a6e('0x29')](db[_0x3a6e('0x2a')][_0x3a6e('0x2b')],function(_0x4a0e61){return{'name':_0x4a0e61[_0x3a6e('0x2c')],'type':_0x4a0e61[_0x3a6e('0x2d')][_0x3a6e('0x2e')]};});_0x5be06[_0x3a6e('0x2f')]=_[_0x3a6e('0x29')](_0x5074f1,_0x3a6e('0x27'));_0x5be06[_0x3a6e('0x30')]=_[_0x3a6e('0x31')](_0x531068['query']);_0x5be06[_0x3a6e('0x32')]=_['intersection'](_0x5be06[_0x3a6e('0x2f')],_0x5be06[_0x3a6e('0x30')]);_0x5bb701['attributes']=_[_0x3a6e('0x33')](_0x5be06[_0x3a6e('0x2f')],qs['fields'](_0x531068['query'][_0x3a6e('0x34')]));_0x5bb701[_0x3a6e('0x35')]=_0x5bb701[_0x3a6e('0x35')]['length']?_0x5bb701[_0x3a6e('0x35')]:_0x5be06[_0x3a6e('0x2f')];if(!_0x531068[_0x3a6e('0x30')][_0x3a6e('0x36')](_0x3a6e('0x37'))){_0x5bb701[_0x3a6e('0x1d')]=qs[_0x3a6e('0x1d')](_0x531068['query']['limit']);_0x5bb701[_0x3a6e('0x1c')]=qs['offset'](_0x531068['query'][_0x3a6e('0x1c')]);}_0x5bb701['order']=qs[_0x3a6e('0x38')](_0x531068[_0x3a6e('0x30')][_0x3a6e('0x38')]);_0x5bb701['where']=qs[_0x3a6e('0x32')](_[_0x3a6e('0x39')](_0x531068[_0x3a6e('0x30')],_0x5be06[_0x3a6e('0x32')]),_0x5074f1);if(_0x531068[_0x3a6e('0x30')][_0x3a6e('0x3a')]){_0x5bb701[_0x3a6e('0x3b')]=_[_0x3a6e('0x3c')](_0x5bb701[_0x3a6e('0x3b')],{'$or':_[_0x3a6e('0x29')](_0x5074f1,function(_0x2f7359){if(_0x2f7359[_0x3a6e('0x2d')]!==_0x3a6e('0x3d')){var _0x4802e1={};_0x4802e1[_0x2f7359[_0x3a6e('0x27')]]={'$like':'%'+_0x531068[_0x3a6e('0x30')]['filter']+'%'};return _0x4802e1;}})});}_0x5bb701=_[_0x3a6e('0x3c')]({},_0x5bb701,_0x531068['options']);var _0x3e682b={'where':_0x5bb701['where']};return db[_0x3a6e('0x2a')][_0x3a6e('0x1b')](_0x3e682b)['then'](function(_0x264403){_0x15d171['count']=_0x264403;if(_0x531068['query'][_0x3a6e('0x3e')]){_0x5bb701['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x5bb701);})[_0x3a6e('0x23')](function(_0x1e2a5){_0x15d171[_0x3a6e('0x3f')]=_0x1e2a5;return _0x15d171;})[_0x3a6e('0x23')](respondWithFilteredResult(_0x4ce658,_0x5bb701))[_0x3a6e('0x40')](handleError(_0x4ce658,null));};exports[_0x3a6e('0x41')]=function(_0x328c57,_0x12e4f2){var _0x570dee={'raw':!![],'where':{'id':_0x328c57['params']['id']}},_0xa8b543={};_0xa8b543[_0x3a6e('0x2f')]=_[_0x3a6e('0x31')](db[_0x3a6e('0x2a')][_0x3a6e('0x2b')]);_0xa8b543[_0x3a6e('0x30')]=_[_0x3a6e('0x31')](_0x328c57[_0x3a6e('0x30')]);_0xa8b543[_0x3a6e('0x32')]=_[_0x3a6e('0x33')](_0xa8b543['model'],_0xa8b543[_0x3a6e('0x30')]);_0x570dee[_0x3a6e('0x35')]=_[_0x3a6e('0x33')](_0xa8b543[_0x3a6e('0x2f')],qs['fields'](_0x328c57[_0x3a6e('0x30')]['fields']));_0x570dee[_0x3a6e('0x35')]=_0x570dee[_0x3a6e('0x35')]['length']?_0x570dee[_0x3a6e('0x35')]:_0xa8b543['model'];if(_0x328c57[_0x3a6e('0x30')]['includeAll']){_0x570dee[_0x3a6e('0x42')]=[{'all':!![]}];}_0x570dee=_['merge']({},_0x570dee,_0x328c57[_0x3a6e('0x43')]);return db[_0x3a6e('0x2a')][_0x3a6e('0x44')](_0x570dee)[_0x3a6e('0x23')](handleEntityNotFound(_0x12e4f2,null))['then'](respondWithResult(_0x12e4f2,null))[_0x3a6e('0x40')](handleError(_0x12e4f2,null));};exports[_0x3a6e('0x45')]=function(_0x38768b,_0x52d710){return db['SugarcrmField']['create'](_0x38768b['body'],{})['then'](respondWithResult(_0x52d710,0xc9))[_0x3a6e('0x40')](handleError(_0x52d710,null));};exports[_0x3a6e('0x46')]=function(_0x52e528,_0x4bdbda){if(_0x52e528[_0x3a6e('0x47')]['id']){delete _0x52e528[_0x3a6e('0x47')]['id'];}return db[_0x3a6e('0x2a')]['find']({'where':{'id':_0x52e528[_0x3a6e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bdbda,null))[_0x3a6e('0x23')](saveUpdates(_0x52e528['body'],null))[_0x3a6e('0x23')](respondWithResult(_0x4bdbda,null))[_0x3a6e('0x40')](handleError(_0x4bdbda,null));};exports[_0x3a6e('0x24')]=function(_0x3f8f2f,_0x34678e){return db[_0x3a6e('0x2a')][_0x3a6e('0x44')]({'where':{'id':_0x3f8f2f[_0x3a6e('0x48')]['id']}})[_0x3a6e('0x23')](handleEntityNotFound(_0x34678e,null))['then'](removeEntity(_0x34678e,null))[_0x3a6e('0x40')](handleError(_0x34678e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 44272e0..a95854c 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 _0xc917=['moment','bluebird','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x26132e,_0x5c7869){var _0x7cca72=function(_0xfbae52){while(--_0xfbae52){_0x26132e['push'](_0x26132e['shift']());}};_0x7cca72(++_0x5c7869);}(_0xc917,0x155));var _0x7c91=function(_0x2b1552,_0x17993f){_0x2b1552=_0x2b1552-0x0;var _0x4cd48e=_0xc917[_0x2b1552];return _0x4cd48e;};'use strict';var _=require(_0x7c91('0x0'));var util=require(_0x7c91('0x1'));var logger=require(_0x7c91('0x2'))(_0x7c91('0x3'));var moment=require(_0x7c91('0x4'));var BPromise=require(_0x7c91('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c91('0x6'));var rimraf=require(_0x7c91('0x7'));var config=require('../../config/environment');var attributes=require(_0x7c91('0x8'));module[_0x7c91('0x9')]=function(_0x206fb4,_0x3956f6){return _0x206fb4[_0x7c91('0xa')](_0x7c91('0xb'),attributes,{'tableName':_0x7c91('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x7c91('0xd'),_0x7c91('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe21a=['path','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','FieldId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3494bb,_0x1d966d){var _0x2b78c6=function(_0x37e6df){while(--_0x37e6df){_0x3494bb['push'](_0x3494bb['shift']());}};_0x2b78c6(++_0x1d966d);}(_0xe21a,0xe8));var _0xae21=function(_0x137762,_0x6da614){_0x137762=_0x137762-0x0;var _0x2493d8=_0xe21a[_0x137762];return _0x2493d8;};'use strict';var _=require('lodash');var util=require(_0xae21('0x0'));var logger=require(_0xae21('0x1'))(_0xae21('0x2'));var moment=require(_0xae21('0x3'));var BPromise=require(_0xae21('0x4'));var rp=require(_0xae21('0x5'));var fs=require('fs');var path=require(_0xae21('0x6'));var rimraf=require('rimraf');var config=require(_0xae21('0x7'));var attributes=require(_0xae21('0x8'));module[_0xae21('0x9')]=function(_0x235f9b,_0xcdd519){return _0x235f9b[_0xae21('0xa')](_0xae21('0xb'),attributes,{'tableName':_0xae21('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xae21('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index e4d6b88..704d35d 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 _0xdae7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x5d9f69,_0x467313){var _0x3d7763=function(_0x59d9e9){while(--_0x59d9e9){_0x5d9f69['push'](_0x5d9f69['shift']());}};_0x3d7763(++_0x467313);}(_0xdae7,0xa5));var _0x7dae=function(_0x1f97e8,_0x445a4a){_0x1f97e8=_0x1f97e8-0x0;var _0x1ed77c=_0xdae7[_0x1f97e8];return _0x1ed77c;};'use strict';var _=require('lodash');var util=require(_0x7dae('0x0'));var moment=require('moment');var BPromise=require(_0x7dae('0x1'));var rs=require(_0x7dae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dae('0x3'))['db'];var utils=require(_0x7dae('0x4'));var logger=require(_0x7dae('0x5'))(_0x7dae('0x6'));var config=require(_0x7dae('0x7'));var jayson=require(_0x7dae('0x8'));var client=jayson['client'][_0x7dae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x276413,_0x12db10,_0x3f7f52){return new BPromise(function(_0x3622b3,_0x40eecc){return client[_0x7dae('0xa')](_0x276413,_0x3f7f52)[_0x7dae('0xb')](function(_0x16fb33){logger[_0x7dae('0xc')](_0x7dae('0xd'),_0x12db10,_0x7dae('0xe'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x12db10,'request\x20sent',JSON[_0x7dae('0xf')](_0x16fb33));if(_0x16fb33['error']){if(_0x16fb33[_0x7dae('0x10')][_0x7dae('0x11')]===0x1f4){logger[_0x7dae('0x10')](_0x7dae('0xd'),_0x12db10,_0x16fb33[_0x7dae('0x10')][_0x7dae('0x12')]);return _0x40eecc(_0x16fb33[_0x7dae('0x10')][_0x7dae('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x12db10,_0x16fb33[_0x7dae('0x10')][_0x7dae('0x12')]);return _0x3622b3(_0x16fb33[_0x7dae('0x10')][_0x7dae('0x12')]);}else{logger[_0x7dae('0xc')](_0x7dae('0xd'),_0x12db10,'request\x20sent');_0x3622b3(_0x16fb33[_0x7dae('0x13')][_0x7dae('0x12')]);}})[_0x7dae('0x14')](function(_0x5ba234){logger['error'](_0x7dae('0xd'),_0x12db10,_0x5ba234);_0x40eecc(_0x5ba234);});});} \ No newline at end of file +var _0xdc8f=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0xdc8f,0x168));var _0xfdc8=function(_0x3f9a64,_0x224930){_0x3f9a64=_0x3f9a64-0x0;var _0x353b88=_0xdc8f[_0x3f9a64];return _0x353b88;};'use strict';var _=require(_0xfdc8('0x0'));var util=require(_0xfdc8('0x1'));var moment=require(_0xfdc8('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdc8('0x3'));var fs=require('fs');var Redis=require(_0xfdc8('0x4'));var db=require(_0xfdc8('0x5'))['db'];var utils=require(_0xfdc8('0x6'));var logger=require(_0xfdc8('0x7'))(_0xfdc8('0x8'));var config=require('../../config/environment');var jayson=require(_0xfdc8('0x9'));var client=jayson['client'][_0xfdc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e8d8c,_0x194de9,_0x1eb884){return new BPromise(function(_0x1d862d,_0x1332e9){return client['request'](_0x3e8d8c,_0x1eb884)[_0xfdc8('0xb')](function(_0x2d5cd4){logger[_0xfdc8('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x194de9,_0xfdc8('0xd'));logger[_0xfdc8('0xe')](_0xfdc8('0xf'),_0x194de9,'request\x20sent',JSON[_0xfdc8('0x10')](_0x2d5cd4));if(_0x2d5cd4[_0xfdc8('0x11')]){if(_0x2d5cd4['error'][_0xfdc8('0x12')]===0x1f4){logger[_0xfdc8('0x11')](_0xfdc8('0x13'),_0x194de9,_0x2d5cd4[_0xfdc8('0x11')][_0xfdc8('0x14')]);return _0x1332e9(_0x2d5cd4[_0xfdc8('0x11')]['message']);}logger[_0xfdc8('0x11')](_0xfdc8('0x13'),_0x194de9,_0x2d5cd4[_0xfdc8('0x11')][_0xfdc8('0x14')]);return _0x1d862d(_0x2d5cd4['error'][_0xfdc8('0x14')]);}else{logger[_0xfdc8('0xc')](_0xfdc8('0x13'),_0x194de9,'request\x20sent');_0x1d862d(_0x2d5cd4[_0xfdc8('0x15')][_0xfdc8('0x14')]);}})['catch'](function(_0x26e3e1){logger[_0xfdc8('0x11')](_0xfdc8('0x13'),_0x194de9,_0x26e3e1);_0x1332e9(_0x26e3e1);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 71b0d7d..d66c1cd 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 _0x8a1b=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x1e4870,_0x470ac0){var _0x243d39=function(_0x4d0465){while(--_0x4d0465){_0x1e4870['push'](_0x1e4870['shift']());}};_0x243d39(++_0x470ac0);}(_0x8a1b,0xf8));var _0xb8a1=function(_0x3b4eb1,_0x2cf8ed){_0x3b4eb1=_0x3b4eb1-0x0;var _0x181984=_0x8a1b[_0x3b4eb1];return _0x181984;};'use strict';var multer=require(_0xb8a1('0x0'));var util=require(_0xb8a1('0x1'));var path=require('path');var timeout=require(_0xb8a1('0x2'));var express=require(_0xb8a1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb8a1('0x4'));var interaction=require(_0xb8a1('0x5'));var config=require(_0xb8a1('0x6'));var controller=require(_0xb8a1('0x7'));router[_0xb8a1('0x8')]('/',auth['isAuthenticated'](),controller[_0xb8a1('0x9')]);router[_0xb8a1('0x8')](_0xb8a1('0xa'),auth[_0xb8a1('0xb')](),controller[_0xb8a1('0xc')]);router['get'](_0xb8a1('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb8a1('0x8')](_0xb8a1('0xe'),auth['isAuthenticated'](),controller[_0xb8a1('0xf')]);router['post']('/',auth[_0xb8a1('0xb')](),controller[_0xb8a1('0x10')]);router[_0xb8a1('0x11')](_0xb8a1('0xd'),auth['isAuthenticated'](),controller[_0xb8a1('0x12')]);router[_0xb8a1('0x13')](_0xb8a1('0xa'),auth[_0xb8a1('0xb')](),controller['update']);router[_0xb8a1('0x14')](_0xb8a1('0xa'),auth[_0xb8a1('0xb')](),controller[_0xb8a1('0x15')]);module[_0xb8a1('0x16')]=router; \ No newline at end of file +var _0x7e81=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration'];(function(_0x24e69f,_0x29f5ee){var _0x96891e=function(_0x391be1){while(--_0x391be1){_0x24e69f['push'](_0x24e69f['shift']());}};_0x96891e(++_0x29f5ee);}(_0x7e81,0xc5));var _0x17e8=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x7e81[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x17e8('0x0'));var util=require(_0x17e8('0x1'));var path=require(_0x17e8('0x2'));var timeout=require(_0x17e8('0x3'));var express=require(_0x17e8('0x4'));var router=express[_0x17e8('0x5')]();var fs_extra=require(_0x17e8('0x6'));var auth=require(_0x17e8('0x7'));var interaction=require(_0x17e8('0x8'));var config=require(_0x17e8('0x9'));var controller=require('./intVtigerAccount.controller');router[_0x17e8('0xa')]('/',auth[_0x17e8('0xb')](),controller[_0x17e8('0xc')]);router[_0x17e8('0xa')](_0x17e8('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x17e8('0xa')](_0x17e8('0xe'),auth[_0x17e8('0xb')](),controller['getConfigurations']);router['get'](_0x17e8('0xf'),auth[_0x17e8('0xb')](),controller[_0x17e8('0x10')]);router[_0x17e8('0x11')]('/',auth[_0x17e8('0xb')](),controller['create']);router[_0x17e8('0x11')](_0x17e8('0xe'),auth['isAuthenticated'](),controller[_0x17e8('0x12')]);router[_0x17e8('0x13')](_0x17e8('0xd'),auth[_0x17e8('0xb')](),controller[_0x17e8('0x14')]);router[_0x17e8('0x15')](_0x17e8('0xd'),auth[_0x17e8('0xb')](),controller[_0x17e8('0x16')]);module[_0x17e8('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 db7f6cb..90d86fa 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 _0x2507=['HelpDesk','sequelize','exports','STRING'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x2507,0x1d9));var _0x7250=function(_0x3de0d5,_0x44516d){_0x3de0d5=_0x3de0d5-0x0;var _0x29aaf8=_0x2507[_0x3de0d5];return _0x29aaf8;};'use strict';var Sequelize=require(_0x7250('0x0'));module[_0x7250('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7250('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7250('0x2')],'allowNull':![],'defaultValue':_0x7250('0x3')},'remoteUri':{'type':Sequelize[_0x7250('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x7250('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x4e98=['exports','STRING'];(function(_0x41ef85,_0x32cd86){var _0xaf835=function(_0x3b6452){while(--_0x3b6452){_0x41ef85['push'](_0x41ef85['shift']());}};_0xaf835(++_0x32cd86);}(_0x4e98,0x1a4));var _0x84e9=function(_0x277d21,_0x217cc0){_0x277d21=_0x277d21-0x0;var _0x90d12e=_0x4e98[_0x277d21];return _0x90d12e;};'use strict';var Sequelize=require('sequelize');module[_0x84e9('0x0')]={'name':{'type':Sequelize[_0x84e9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x84e9('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x84e9('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 041e175..caee6b4 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 _0x6206=['md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','reference','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','log','test','statusCode','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','model','keys','filters','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','channel','VtigerConfiguration','VtigerField','Subjects'];(function(_0xd46396,_0x1eb704){var _0x491eb0=function(_0x5010c1){while(--_0x5010c1){_0xd46396['push'](_0xd46396['shift']());}};_0x491eb0(++_0x1eb704);}(_0x6206,0x182));var _0x6620=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x6206[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0x6620('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6620('0x1'));var jsonpatch=require(_0x6620('0x2'));var rp=require(_0x6620('0x3'));var moment=require(_0x6620('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6620('0x5'));var util=require('util');var path=require(_0x6620('0x6'));var sox=require(_0x6620('0x7'));var csv=require('to-csv');var ejs=require(_0x6620('0x8'));var fs=require('fs');var fs_extra=require(_0x6620('0x9'));var _=require(_0x6620('0xa'));var squel=require(_0x6620('0xb'));var crypto=require(_0x6620('0xc'));var jsforce=require(_0x6620('0xd'));var deskjs=require(_0x6620('0xe'));var toCsv=require(_0x6620('0xf'));var querystring=require(_0x6620('0x10'));var Papa=require(_0x6620('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6620('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6620('0x13'));var logger=require(_0x6620('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6620('0x15'));var licenseUtil=require(_0x6620('0x16'));var db=require(_0x6620('0x17'))['db'];var integrations=require(_0x6620('0x18'));function respondWithStatusCode(_0x583fee,_0x161451){_0x161451=_0x161451||0xcc;return function(_0x2511b6){if(_0x2511b6){return _0x583fee[_0x6620('0x19')](_0x161451);}return _0x583fee[_0x6620('0x1a')](_0x161451)[_0x6620('0x1b')]();};}function respondWithResult(_0x1451aa,_0x1d45af){_0x1d45af=_0x1d45af||0xc8;return function(_0x531239){if(_0x531239){return _0x1451aa[_0x6620('0x1a')](_0x1d45af)[_0x6620('0x1c')](_0x531239);}};}function respondWithFilteredResult(_0x4975be,_0x1b91f0){return function(_0xedbb5b){if(_0xedbb5b){var _0x1cfbfc=typeof _0x1b91f0['offset']===_0x6620('0x1d')&&typeof _0x1b91f0['limit']===_0x6620('0x1d');var _0x3e9892=_0xedbb5b[_0x6620('0x1e')];var _0x101892=_0x1cfbfc?0x0:_0x1b91f0[_0x6620('0x1f')];var _0x229308=_0x1cfbfc?_0xedbb5b[_0x6620('0x1e')]:_0x1b91f0[_0x6620('0x1f')]+_0x1b91f0['limit'];var _0x5f0b23;if(_0x229308>=_0x3e9892){_0x229308=_0x3e9892;_0x5f0b23=0xc8;}else{_0x5f0b23=0xce;}_0x4975be[_0x6620('0x1a')](_0x5f0b23);return _0x4975be[_0x6620('0x20')]('Content-Range',_0x101892+'-'+_0x229308+'/'+_0x3e9892)[_0x6620('0x1c')](_0xedbb5b);}return null;};}function patchUpdates(_0x5cf249){return function(_0x9c7074){try{jsonpatch['apply'](_0x9c7074,_0x5cf249,!![]);}catch(_0x3dc292){return BPromise[_0x6620('0x21')](_0x3dc292);}return _0x9c7074[_0x6620('0x22')]();};}function saveUpdates(_0x455bed,_0x5aa625){return function(_0x116f68){if(_0x116f68){return _0x116f68[_0x6620('0x23')](_0x455bed)[_0x6620('0x24')](function(_0x21e3a6){return _0x21e3a6;});}return null;};}function removeEntity(_0x127c8e,_0x3e3776){return function(_0x17a965){if(_0x17a965){return _0x17a965[_0x6620('0x25')]()[_0x6620('0x24')](function(){_0x127c8e[_0x6620('0x1a')](0xcc)[_0x6620('0x1b')]();});}};}function handleEntityNotFound(_0x282a1f,_0x2c52d5){return function(_0x52788f){if(!_0x52788f){_0x282a1f['sendStatus'](0x194);}return _0x52788f;};}function handleError(_0x16064e,_0x3c647c){_0x3c647c=_0x3c647c||0x1f4;return function(_0x54fea0){logger[_0x6620('0x26')](_0x54fea0[_0x6620('0x27')]);if(_0x54fea0[_0x6620('0x28')]){delete _0x54fea0['name'];}_0x16064e[_0x6620('0x1a')](_0x3c647c)[_0x6620('0x29')](_0x54fea0);};}exports[_0x6620('0x2a')]=function(_0x17fb6a,_0xb7bf3b){var _0x303380={},_0x514671={},_0x59c9e3={'count':0x0,'rows':[]};var _0x2bb9d6=_[_0x6620('0x2b')](db['VtigerAccount'][_0x6620('0x2c')],function(_0x405f59){return{'name':_0x405f59['fieldName'],'type':_0x405f59[_0x6620('0x2d')]['key']};});_0x514671[_0x6620('0x2e')]=_[_0x6620('0x2b')](_0x2bb9d6,_0x6620('0x28'));_0x514671['query']=_[_0x6620('0x2f')](_0x17fb6a['query']);_0x514671[_0x6620('0x30')]=_['intersection'](_0x514671['model'],_0x514671[_0x6620('0x31')]);_0x303380[_0x6620('0x32')]=_[_0x6620('0x33')](_0x514671[_0x6620('0x2e')],qs[_0x6620('0x34')](_0x17fb6a['query'][_0x6620('0x34')]));_0x303380[_0x6620('0x32')]=_0x303380[_0x6620('0x32')][_0x6620('0x35')]?_0x303380[_0x6620('0x32')]:_0x514671[_0x6620('0x2e')];if(!_0x17fb6a[_0x6620('0x31')]['hasOwnProperty'](_0x6620('0x36'))){_0x303380[_0x6620('0x37')]=qs['limit'](_0x17fb6a[_0x6620('0x31')][_0x6620('0x37')]);_0x303380['offset']=qs[_0x6620('0x1f')](_0x17fb6a['query'][_0x6620('0x1f')]);}_0x303380[_0x6620('0x38')]=qs[_0x6620('0x39')](_0x17fb6a[_0x6620('0x31')][_0x6620('0x39')]);_0x303380[_0x6620('0x3a')]=qs['filters'](_[_0x6620('0x3b')](_0x17fb6a[_0x6620('0x31')],_0x514671['filters']),_0x2bb9d6);if(_0x17fb6a[_0x6620('0x31')][_0x6620('0x3c')]){_0x303380[_0x6620('0x3a')]=_[_0x6620('0x3d')](_0x303380[_0x6620('0x3a')],{'$or':_['map'](_0x2bb9d6,function(_0x44e04c){if(_0x44e04c[_0x6620('0x2d')]!==_0x6620('0x3e')){var _0x402ec2={};_0x402ec2[_0x44e04c[_0x6620('0x28')]]={'$like':'%'+_0x17fb6a[_0x6620('0x31')]['filter']+'%'};return _0x402ec2;}})});}_0x303380=_[_0x6620('0x3d')]({},_0x303380,_0x17fb6a['options']);var _0x408d53={'where':_0x303380[_0x6620('0x3a')]};return db[_0x6620('0x3f')][_0x6620('0x1e')](_0x408d53)[_0x6620('0x24')](function(_0x1546ec){_0x59c9e3[_0x6620('0x1e')]=_0x1546ec;if(_0x17fb6a[_0x6620('0x31')][_0x6620('0x40')]){_0x303380[_0x6620('0x41')]=[{'all':!![]}];}return db['VtigerAccount'][_0x6620('0x42')](_0x303380);})[_0x6620('0x24')](function(_0x2e0f2d){_0x59c9e3[_0x6620('0x43')]=_0x2e0f2d;return _0x59c9e3;})['then'](respondWithFilteredResult(_0xb7bf3b,_0x303380))[_0x6620('0x44')](handleError(_0xb7bf3b,null));};exports[_0x6620('0x45')]=function(_0x5655e0,_0x239486){var _0x24c130={'raw':![],'where':{'id':_0x5655e0[_0x6620('0x46')]['id']}},_0xe18211={};_0xe18211[_0x6620('0x2e')]=_['keys'](db[_0x6620('0x3f')][_0x6620('0x2c')]);_0xe18211[_0x6620('0x31')]=_[_0x6620('0x2f')](_0x5655e0[_0x6620('0x31')]);_0xe18211[_0x6620('0x30')]=_[_0x6620('0x33')](_0xe18211['model'],_0xe18211[_0x6620('0x31')]);_0x24c130[_0x6620('0x32')]=_[_0x6620('0x33')](_0xe18211[_0x6620('0x2e')],qs[_0x6620('0x34')](_0x5655e0[_0x6620('0x31')]['fields']));_0x24c130[_0x6620('0x32')]=_0x24c130['attributes'][_0x6620('0x35')]?_0x24c130[_0x6620('0x32')]:_0xe18211[_0x6620('0x2e')];if(_0x5655e0['query'][_0x6620('0x40')]){_0x24c130[_0x6620('0x41')]=[{'all':!![]}];}_0x24c130=_[_0x6620('0x3d')]({},_0x24c130,_0x5655e0[_0x6620('0x47')]);return db['VtigerAccount'][_0x6620('0x48')](_0x24c130)[_0x6620('0x24')](handleEntityNotFound(_0x239486,null))[_0x6620('0x24')](respondWithResult(_0x239486,null))['catch'](handleError(_0x239486,null));};exports[_0x6620('0x49')]=function(_0x3d2cd2,_0x4e44af){return db[_0x6620('0x3f')][_0x6620('0x49')](_0x3d2cd2[_0x6620('0x4a')],{})[_0x6620('0x24')](respondWithResult(_0x4e44af,0xc9))[_0x6620('0x44')](handleError(_0x4e44af,null));};exports[_0x6620('0x23')]=function(_0x134816,_0x3b82f0){if(_0x134816[_0x6620('0x4a')]['id']){delete _0x134816['body']['id'];}return db[_0x6620('0x3f')][_0x6620('0x48')]({'where':{'id':_0x134816[_0x6620('0x46')]['id']}})[_0x6620('0x24')](handleEntityNotFound(_0x3b82f0,null))[_0x6620('0x24')](saveUpdates(_0x134816[_0x6620('0x4a')],null))[_0x6620('0x24')](respondWithResult(_0x3b82f0,null))['catch'](handleError(_0x3b82f0,null));};exports[_0x6620('0x25')]=function(_0x4c4f42,_0x91b4c1){return db['VtigerAccount']['find']({'where':{'id':_0x4c4f42[_0x6620('0x46')]['id']}})[_0x6620('0x24')](handleEntityNotFound(_0x91b4c1,null))[_0x6620('0x24')](removeEntity(_0x91b4c1,null))[_0x6620('0x44')](handleError(_0x91b4c1,null));};exports[_0x6620('0x4b')]=function(_0x408b2a,_0x270407,_0x174e5f){var _0x35f88a={};var _0x76a76a={};var _0x5841bc;var _0x5c8ba6;return db[_0x6620('0x3f')][_0x6620('0x4c')]({'where':{'id':_0x408b2a[_0x6620('0x46')]['id']}})[_0x6620('0x24')](handleEntityNotFound(_0x270407,null))[_0x6620('0x24')](function(_0x483740){if(_0x483740){_0x5841bc=_0x483740;_0x76a76a[_0x6620('0x2e')]=_[_0x6620('0x2f')](db['VtigerConfiguration'][_0x6620('0x2c')]);_0x76a76a[_0x6620('0x31')]=_[_0x6620('0x2f')](_0x408b2a['query']);_0x76a76a['filters']=_[_0x6620('0x33')](_0x76a76a['model'],_0x76a76a[_0x6620('0x31')]);_0x35f88a['attributes']=_['intersection'](_0x76a76a[_0x6620('0x2e')],qs[_0x6620('0x34')](_0x408b2a[_0x6620('0x31')][_0x6620('0x34')]));_0x35f88a[_0x6620('0x32')]=_0x35f88a[_0x6620('0x32')][_0x6620('0x35')]?_0x35f88a['attributes']:_0x76a76a['model'];_0x35f88a['order']=qs[_0x6620('0x39')](_0x408b2a['query']['sort']);_0x35f88a['where']=qs['filters'](_['pick'](_0x408b2a[_0x6620('0x31')],_0x76a76a[_0x6620('0x30')]));if(_0x408b2a[_0x6620('0x31')][_0x6620('0x3c')]){_0x35f88a[_0x6620('0x3a')]=_[_0x6620('0x3d')](_0x35f88a[_0x6620('0x3a')],{'$or':_[_0x6620('0x2b')](_0x35f88a[_0x6620('0x32')],function(_0x228f64){var _0x534c60={};_0x534c60[_0x228f64]={'$like':'%'+_0x408b2a['query'][_0x6620('0x3c')]+'%'};return _0x534c60;})});}_0x35f88a=_[_0x6620('0x3d')]({},_0x35f88a,_0x408b2a['options']);return _0x5841bc[_0x6620('0x4b')](_0x35f88a);}})[_0x6620('0x24')](function(_0x1e10d8){if(_0x1e10d8){_0x5c8ba6=_0x1e10d8['length'];if(!_0x408b2a[_0x6620('0x31')][_0x6620('0x4d')](_0x6620('0x36'))){_0x35f88a[_0x6620('0x37')]=qs[_0x6620('0x37')](_0x408b2a[_0x6620('0x31')][_0x6620('0x37')]);_0x35f88a[_0x6620('0x1f')]=qs['offset'](_0x408b2a[_0x6620('0x31')][_0x6620('0x1f')]);}return _0x5841bc[_0x6620('0x4b')](_0x35f88a);}})['then'](function(_0x21f1e9){if(_0x21f1e9){return _0x21f1e9?{'count':_0x5c8ba6,'rows':_0x21f1e9}:null;}})[_0x6620('0x24')](respondWithResult(_0x270407,null))[_0x6620('0x44')](handleError(_0x270407,null));};exports[_0x6620('0x4e')]=function(_0x3515a7,_0x2c59d0,_0x4ad8f9){if(_0x3515a7[_0x6620('0x4a')]['id']){delete _0x3515a7[_0x6620('0x4a')]['id'];}return db[_0x6620('0x3f')][_0x6620('0x4c')]({'where':{'id':_0x3515a7[_0x6620('0x46')]['id']}})[_0x6620('0x24')](handleEntityNotFound(_0x2c59d0,null))[_0x6620('0x24')](function(_0x40f1b6){if(_0x40f1b6){_0x3515a7[_0x6620('0x4a')][_0x6620('0x4f')]=_0x40f1b6['id'];_0x3515a7[_0x6620('0x4a')]['Subjects']=integrations[_0x6620('0x50')](_0x3515a7[_0x6620('0x4a')]['channel'],_0x3515a7['body']['type']);_0x3515a7[_0x6620('0x4a')][_0x6620('0x51')]=integrations['getDescriptions'](_0x3515a7[_0x6620('0x4a')][_0x6620('0x52')],_0x3515a7[_0x6620('0x4a')][_0x6620('0x2d')]);return db[_0x6620('0x53')][_0x6620('0x49')](_0x3515a7[_0x6620('0x4a')],{'include':[{'model':db[_0x6620('0x54')],'as':_0x6620('0x55')},{'model':db[_0x6620('0x54')],'as':_0x6620('0x51')}]});}return null;})[_0x6620('0x24')](respondWithResult(_0x2c59d0,null))[_0x6620('0x44')](handleError(_0x2c59d0,null));};var md5=require(_0x6620('0x56'));exports[_0x6620('0x57')]=function(_0x402500,_0x19a08a,_0x1757fa){var _0x4b8aea=null;var _0x1115ff=null;var _0x5cceba=null;var _0x463ca2=null;var _0x12fb60='';return db[_0x6620('0x3f')][_0x6620('0x4c')]({'where':{'id':_0x402500[_0x6620('0x46')]['id']},'attributes':['id',_0x6620('0x28'),_0x6620('0x58'),'description',_0x6620('0x59'),_0x6620('0x5a'),_0x6620('0x5b'),_0x6620('0x5c')]})[_0x6620('0x24')](handleEntityNotFound(_0x19a08a,null))[_0x6620('0x24')](function(_0x413dc4){if(_0x413dc4){_0x4b8aea=_0x413dc4['username'];_0x1115ff=_0x413dc4[_0x6620('0x5c')];_0x5cceba=_0x413dc4[_0x6620('0x59')];_0x12fb60=_0x413dc4['remoteUri'];var _0x4e0953=_0x12fb60[_0x6620('0x5d')](-0x1);if(_0x4e0953==='/'){_0x12fb60=_0x12fb60[_0x6620('0x5e')](0x0,_0x12fb60[_0x6620('0x5f')](_0x4e0953));}_0x463ca2=util['format'](_0x6620('0x60'),_0x12fb60);var _0x555749={'method':_0x6620('0x61'),'uri':_0x463ca2,'qs':{'operation':_0x6620('0x62'),'username':_0x413dc4[_0x6620('0x58')]},'json':!![]};return rp(_0x555749);}})[_0x6620('0x24')](function(_0x1c9fa8){if(_0x1c9fa8[_0x6620('0x63')]){var _0x4d956e={'method':_0x6620('0x64'),'uri':_0x463ca2,'form':{'operation':_0x6620('0x65'),'username':_0x4b8aea,'accessKey':md5(_0x1c9fa8[_0x6620('0x66')]['token']+_0x1115ff)},'json':!![]};return rp(_0x4d956e);}})[_0x6620('0x24')](function(_0x4d3108){if(_0x4d3108[_0x6620('0x63')]){var _0x1b2914={'method':_0x6620('0x61'),'uri':_0x463ca2,'qs':{'operation':'describe','username':_0x4b8aea,'sessionName':_0x4d3108[_0x6620('0x66')]['sessionName'],'elementType':_0x5cceba},'json':!![]};return rp(_0x1b2914);}})[_0x6620('0x24')](function(_0x25cbd4){if(_0x25cbd4[_0x6620('0x63')]){var _0x2d19c8=['autogenerated',_0x6620('0x67'),_0x6620('0x68')];_[_0x6620('0x69')](_0x25cbd4['result'][_0x6620('0x34')],function(_0x2f15eb){return _0x2d19c8[_0x6620('0x6a')](_0x2f15eb[_0x6620('0x2d')][_0x6620('0x28')]);});_[_0x6620('0x69')](_0x25cbd4[_0x6620('0x66')][_0x6620('0x34')],function(_0x19b368){return _0x19b368[_0x6620('0x6b')]===_0x6620('0x6c');});return{'count':_0x25cbd4[_0x6620('0x66')]['fields'][_0x6620('0x35')],'rows':_[_0x6620('0x2b')](_0x25cbd4[_0x6620('0x66')][_0x6620('0x34')],function(_0x516a87){return{'id':_0x516a87['name'],'name':_0x516a87[_0x6620('0x6d')],'custom':_[_0x6620('0x6e')](_0x516a87['name'],'cf_')?!![]:![],'options':_0x516a87[_0x6620('0x2d')]['name']===_0x6620('0x6f')&&_0x516a87[_0x6620('0x2d')]['picklistValues'][_0x6620('0x35')]>0x0?_[_0x6620('0x2b')](_0x516a87[_0x6620('0x2d')][_0x6620('0x70')],function(_0x28f3eb){return{'name':_0x28f3eb[_0x6620('0x6d')],'value':_0x28f3eb[_0x6620('0x71')]};}):[]};})};}})[_0x6620('0x24')](respondWithResult(_0x19a08a,null))['catch'](function(_0x3dff5b){console[_0x6620('0x72')]('vTiger\x20error:\x20'+_0x3dff5b);var _0x5c2bc5=_0x402500['query'][_0x6620('0x73')]?0x1f4:_0x3dff5b[_0x6620('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x6620('0x57'),_0x5c2bc5,JSON[_0x6620('0x75')](_0x3dff5b));delete _0x3dff5b[_0x6620('0x28')];if(_0x5c2bc5===0x191){_0x5c2bc5=0x190;}_0x19a08a['status'](_0x5c2bc5)[_0x6620('0x29')](_0x402500[_0x6620('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3dff5b['statusCode']}:_0x3dff5b);});}; \ No newline at end of file +var _0xdc23=['startsWith','cf_','picklist','value','log','test','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','VtigerAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','pick','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','format','GET','getchallenge','success','POST','login','result','token','sessionName','reference','owner','remove','includes','false','label'];(function(_0x352f33,_0x500444){var _0x42feae=function(_0x1a64f0){while(--_0x1a64f0){_0x352f33['push'](_0x352f33['shift']());}};_0x42feae(++_0x500444);}(_0xdc23,0x1d2));var _0x3dc2=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0xdc23[_0xb24fad];return _0x173226;};'use strict';var emlformat=require(_0x3dc2('0x0'));var rimraf=require(_0x3dc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dc2('0x2'));var rp=require('request-promise');var moment=require(_0x3dc2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3dc2('0x4'));var util=require('util');var path=require(_0x3dc2('0x5'));var sox=require(_0x3dc2('0x6'));var csv=require(_0x3dc2('0x7'));var ejs=require(_0x3dc2('0x8'));var fs=require('fs');var fs_extra=require(_0x3dc2('0x9'));var _=require(_0x3dc2('0xa'));var squel=require(_0x3dc2('0xb'));var crypto=require(_0x3dc2('0xc'));var jsforce=require(_0x3dc2('0xd'));var deskjs=require(_0x3dc2('0xe'));var toCsv=require(_0x3dc2('0x7'));var querystring=require('querystring');var Papa=require(_0x3dc2('0xf'));var Redis=require('ioredis');var authService=require(_0x3dc2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3dc2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3dc2('0x12'));var utils=require(_0x3dc2('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3dc2('0x14'));function respondWithStatusCode(_0x470562,_0x551fde){_0x551fde=_0x551fde||0xcc;return function(_0x4accc9){if(_0x4accc9){return _0x470562[_0x3dc2('0x15')](_0x551fde);}return _0x470562[_0x3dc2('0x16')](_0x551fde)[_0x3dc2('0x17')]();};}function respondWithResult(_0x446f5d,_0x321378){_0x321378=_0x321378||0xc8;return function(_0x5bfacc){if(_0x5bfacc){return _0x446f5d[_0x3dc2('0x16')](_0x321378)[_0x3dc2('0x18')](_0x5bfacc);}};}function respondWithFilteredResult(_0x272d5d,_0x4148da){return function(_0x5bfe5f){if(_0x5bfe5f){var _0x335418=typeof _0x4148da['offset']===_0x3dc2('0x19')&&typeof _0x4148da['limit']===_0x3dc2('0x19');var _0xe9261c=_0x5bfe5f[_0x3dc2('0x1a')];var _0x38540b=_0x335418?0x0:_0x4148da[_0x3dc2('0x1b')];var _0x3309d8=_0x335418?_0x5bfe5f[_0x3dc2('0x1a')]:_0x4148da[_0x3dc2('0x1b')]+_0x4148da[_0x3dc2('0x1c')];var _0x320151;if(_0x3309d8>=_0xe9261c){_0x3309d8=_0xe9261c;_0x320151=0xc8;}else{_0x320151=0xce;}_0x272d5d['status'](_0x320151);return _0x272d5d[_0x3dc2('0x1d')](_0x3dc2('0x1e'),_0x38540b+'-'+_0x3309d8+'/'+_0xe9261c)[_0x3dc2('0x18')](_0x5bfe5f);}return null;};}function patchUpdates(_0x2db1d1){return function(_0x12481f){try{jsonpatch[_0x3dc2('0x1f')](_0x12481f,_0x2db1d1,!![]);}catch(_0x397c1e){return BPromise[_0x3dc2('0x20')](_0x397c1e);}return _0x12481f['save']();};}function saveUpdates(_0xeaf004,_0x2405a2){return function(_0x3c3848){if(_0x3c3848){return _0x3c3848[_0x3dc2('0x21')](_0xeaf004)[_0x3dc2('0x22')](function(_0x334732){return _0x334732;});}return null;};}function removeEntity(_0x292d54,_0x160779){return function(_0x9aed77){if(_0x9aed77){return _0x9aed77[_0x3dc2('0x23')]()['then'](function(){_0x292d54[_0x3dc2('0x16')](0xcc)[_0x3dc2('0x17')]();});}};}function handleEntityNotFound(_0x225d3e,_0x1de704){return function(_0xfe9a7c){if(!_0xfe9a7c){_0x225d3e[_0x3dc2('0x15')](0x194);}return _0xfe9a7c;};}function handleError(_0x1bf172,_0x257286){_0x257286=_0x257286||0x1f4;return function(_0x3e8b2a){logger['error'](_0x3e8b2a[_0x3dc2('0x24')]);if(_0x3e8b2a['name']){delete _0x3e8b2a[_0x3dc2('0x25')];}_0x1bf172[_0x3dc2('0x16')](_0x257286)['send'](_0x3e8b2a);};}exports[_0x3dc2('0x26')]=function(_0x349c9c,_0x44a9ab){var _0x4e5408={},_0x5662e1={},_0x510969={'count':0x0,'rows':[]};var _0x48429c=_[_0x3dc2('0x27')](db[_0x3dc2('0x28')][_0x3dc2('0x29')],function(_0x335e03){return{'name':_0x335e03['fieldName'],'type':_0x335e03[_0x3dc2('0x2a')][_0x3dc2('0x2b')]};});_0x5662e1[_0x3dc2('0x2c')]=_[_0x3dc2('0x27')](_0x48429c,_0x3dc2('0x25'));_0x5662e1[_0x3dc2('0x2d')]=_[_0x3dc2('0x2e')](_0x349c9c[_0x3dc2('0x2d')]);_0x5662e1[_0x3dc2('0x2f')]=_[_0x3dc2('0x30')](_0x5662e1[_0x3dc2('0x2c')],_0x5662e1[_0x3dc2('0x2d')]);_0x4e5408[_0x3dc2('0x31')]=_[_0x3dc2('0x30')](_0x5662e1[_0x3dc2('0x2c')],qs[_0x3dc2('0x32')](_0x349c9c['query'][_0x3dc2('0x32')]));_0x4e5408[_0x3dc2('0x31')]=_0x4e5408[_0x3dc2('0x31')][_0x3dc2('0x33')]?_0x4e5408[_0x3dc2('0x31')]:_0x5662e1[_0x3dc2('0x2c')];if(!_0x349c9c['query'][_0x3dc2('0x34')](_0x3dc2('0x35'))){_0x4e5408[_0x3dc2('0x1c')]=qs[_0x3dc2('0x1c')](_0x349c9c[_0x3dc2('0x2d')][_0x3dc2('0x1c')]);_0x4e5408[_0x3dc2('0x1b')]=qs[_0x3dc2('0x1b')](_0x349c9c['query']['offset']);}_0x4e5408[_0x3dc2('0x36')]=qs[_0x3dc2('0x37')](_0x349c9c[_0x3dc2('0x2d')][_0x3dc2('0x37')]);_0x4e5408[_0x3dc2('0x38')]=qs[_0x3dc2('0x2f')](_['pick'](_0x349c9c['query'],_0x5662e1[_0x3dc2('0x2f')]),_0x48429c);if(_0x349c9c['query'][_0x3dc2('0x39')]){_0x4e5408[_0x3dc2('0x38')]=_['merge'](_0x4e5408[_0x3dc2('0x38')],{'$or':_[_0x3dc2('0x27')](_0x48429c,function(_0x2f8af4){if(_0x2f8af4[_0x3dc2('0x2a')]!==_0x3dc2('0x3a')){var _0x527a58={};_0x527a58[_0x2f8af4[_0x3dc2('0x25')]]={'$like':'%'+_0x349c9c['query'][_0x3dc2('0x39')]+'%'};return _0x527a58;}})});}_0x4e5408=_[_0x3dc2('0x3b')]({},_0x4e5408,_0x349c9c[_0x3dc2('0x3c')]);var _0x221e2b={'where':_0x4e5408[_0x3dc2('0x38')]};return db[_0x3dc2('0x28')]['count'](_0x221e2b)[_0x3dc2('0x22')](function(_0x5627d2){_0x510969[_0x3dc2('0x1a')]=_0x5627d2;if(_0x349c9c[_0x3dc2('0x2d')][_0x3dc2('0x3d')]){_0x4e5408[_0x3dc2('0x3e')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x4e5408);})['then'](function(_0x5d5af0){_0x510969['rows']=_0x5d5af0;return _0x510969;})[_0x3dc2('0x22')](respondWithFilteredResult(_0x44a9ab,_0x4e5408))[_0x3dc2('0x3f')](handleError(_0x44a9ab,null));};exports[_0x3dc2('0x40')]=function(_0x4a871c,_0x565a4d){var _0x5d896d={'raw':![],'where':{'id':_0x4a871c[_0x3dc2('0x41')]['id']}},_0x528191={};_0x528191[_0x3dc2('0x2c')]=_['keys'](db[_0x3dc2('0x28')][_0x3dc2('0x29')]);_0x528191[_0x3dc2('0x2d')]=_['keys'](_0x4a871c['query']);_0x528191[_0x3dc2('0x2f')]=_['intersection'](_0x528191['model'],_0x528191[_0x3dc2('0x2d')]);_0x5d896d[_0x3dc2('0x31')]=_[_0x3dc2('0x30')](_0x528191[_0x3dc2('0x2c')],qs[_0x3dc2('0x32')](_0x4a871c[_0x3dc2('0x2d')][_0x3dc2('0x32')]));_0x5d896d['attributes']=_0x5d896d[_0x3dc2('0x31')]['length']?_0x5d896d['attributes']:_0x528191['model'];if(_0x4a871c[_0x3dc2('0x2d')][_0x3dc2('0x3d')]){_0x5d896d[_0x3dc2('0x3e')]=[{'all':!![]}];}_0x5d896d=_['merge']({},_0x5d896d,_0x4a871c[_0x3dc2('0x3c')]);return db['VtigerAccount']['find'](_0x5d896d)[_0x3dc2('0x22')](handleEntityNotFound(_0x565a4d,null))[_0x3dc2('0x22')](respondWithResult(_0x565a4d,null))[_0x3dc2('0x3f')](handleError(_0x565a4d,null));};exports[_0x3dc2('0x42')]=function(_0xc13aef,_0x1b5475){return db['VtigerAccount']['create'](_0xc13aef[_0x3dc2('0x43')],{})[_0x3dc2('0x22')](respondWithResult(_0x1b5475,0xc9))[_0x3dc2('0x3f')](handleError(_0x1b5475,null));};exports[_0x3dc2('0x21')]=function(_0x3a36cd,_0x1ee235){if(_0x3a36cd[_0x3dc2('0x43')]['id']){delete _0x3a36cd['body']['id'];}return db[_0x3dc2('0x28')][_0x3dc2('0x44')]({'where':{'id':_0x3a36cd[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0x1ee235,null))[_0x3dc2('0x22')](saveUpdates(_0x3a36cd[_0x3dc2('0x43')],null))[_0x3dc2('0x22')](respondWithResult(_0x1ee235,null))[_0x3dc2('0x3f')](handleError(_0x1ee235,null));};exports['destroy']=function(_0x4dd57e,_0x667c28){return db[_0x3dc2('0x28')]['find']({'where':{'id':_0x4dd57e[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0x667c28,null))[_0x3dc2('0x22')](removeEntity(_0x667c28,null))[_0x3dc2('0x3f')](handleError(_0x667c28,null));};exports[_0x3dc2('0x45')]=function(_0x334aa6,_0xef51ad,_0x2bc57f){var _0x49b74e={};var _0xdfed03={};var _0x3288e2;var _0x79d076;return db[_0x3dc2('0x28')][_0x3dc2('0x46')]({'where':{'id':_0x334aa6[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0xef51ad,null))[_0x3dc2('0x22')](function(_0x21bf75){if(_0x21bf75){_0x3288e2=_0x21bf75;_0xdfed03[_0x3dc2('0x2c')]=_[_0x3dc2('0x2e')](db[_0x3dc2('0x47')]['rawAttributes']);_0xdfed03[_0x3dc2('0x2d')]=_['keys'](_0x334aa6['query']);_0xdfed03[_0x3dc2('0x2f')]=_[_0x3dc2('0x30')](_0xdfed03[_0x3dc2('0x2c')],_0xdfed03[_0x3dc2('0x2d')]);_0x49b74e[_0x3dc2('0x31')]=_[_0x3dc2('0x30')](_0xdfed03[_0x3dc2('0x2c')],qs[_0x3dc2('0x32')](_0x334aa6['query'][_0x3dc2('0x32')]));_0x49b74e[_0x3dc2('0x31')]=_0x49b74e[_0x3dc2('0x31')][_0x3dc2('0x33')]?_0x49b74e[_0x3dc2('0x31')]:_0xdfed03['model'];_0x49b74e['order']=qs['sort'](_0x334aa6['query'][_0x3dc2('0x37')]);_0x49b74e[_0x3dc2('0x38')]=qs['filters'](_[_0x3dc2('0x48')](_0x334aa6[_0x3dc2('0x2d')],_0xdfed03['filters']));if(_0x334aa6[_0x3dc2('0x2d')][_0x3dc2('0x39')]){_0x49b74e['where']=_[_0x3dc2('0x3b')](_0x49b74e['where'],{'$or':_[_0x3dc2('0x27')](_0x49b74e[_0x3dc2('0x31')],function(_0x1b72f6){var _0xc1a067={};_0xc1a067[_0x1b72f6]={'$like':'%'+_0x334aa6[_0x3dc2('0x2d')]['filter']+'%'};return _0xc1a067;})});}_0x49b74e=_[_0x3dc2('0x3b')]({},_0x49b74e,_0x334aa6[_0x3dc2('0x3c')]);return _0x3288e2[_0x3dc2('0x45')](_0x49b74e);}})[_0x3dc2('0x22')](function(_0x221bfc){if(_0x221bfc){_0x79d076=_0x221bfc[_0x3dc2('0x33')];if(!_0x334aa6[_0x3dc2('0x2d')]['hasOwnProperty']('nolimit')){_0x49b74e[_0x3dc2('0x1c')]=qs['limit'](_0x334aa6['query'][_0x3dc2('0x1c')]);_0x49b74e[_0x3dc2('0x1b')]=qs[_0x3dc2('0x1b')](_0x334aa6['query'][_0x3dc2('0x1b')]);}return _0x3288e2[_0x3dc2('0x45')](_0x49b74e);}})[_0x3dc2('0x22')](function(_0x31d6f1){if(_0x31d6f1){return _0x31d6f1?{'count':_0x79d076,'rows':_0x31d6f1}:null;}})[_0x3dc2('0x22')](respondWithResult(_0xef51ad,null))[_0x3dc2('0x3f')](handleError(_0xef51ad,null));};exports['addConfiguration']=function(_0x460e9f,_0x236726,_0x30cf97){if(_0x460e9f[_0x3dc2('0x43')]['id']){delete _0x460e9f['body']['id'];}return db[_0x3dc2('0x28')]['findOne']({'where':{'id':_0x460e9f[_0x3dc2('0x41')]['id']}})[_0x3dc2('0x22')](handleEntityNotFound(_0x236726,null))[_0x3dc2('0x22')](function(_0x46a7e6){if(_0x46a7e6){_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x49')]=_0x46a7e6['id'];_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4a')]=integrations[_0x3dc2('0x4b')](_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4c')],_0x460e9f[_0x3dc2('0x43')]['type']);_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4d')]=integrations[_0x3dc2('0x4e')](_0x460e9f[_0x3dc2('0x43')][_0x3dc2('0x4c')],_0x460e9f['body'][_0x3dc2('0x2a')]);return db['VtigerConfiguration'][_0x3dc2('0x42')](_0x460e9f[_0x3dc2('0x43')],{'include':[{'model':db[_0x3dc2('0x4f')],'as':_0x3dc2('0x4a')},{'model':db[_0x3dc2('0x4f')],'as':_0x3dc2('0x4d')}]});}return null;})['then'](respondWithResult(_0x236726,null))['catch'](handleError(_0x236726,null));};var md5=require('md5');exports[_0x3dc2('0x50')]=function(_0xac2abf,_0x1b9e5b,_0xb3ab34){var _0x12f046=null;var _0x2cec50=null;var _0x26d4cd=null;var _0x483971=null;var _0x448219='';return db[_0x3dc2('0x28')][_0x3dc2('0x46')]({'where':{'id':_0xac2abf[_0x3dc2('0x41')]['id']},'attributes':['id',_0x3dc2('0x25'),'username',_0x3dc2('0x51'),_0x3dc2('0x52'),_0x3dc2('0x53'),_0x3dc2('0x54'),_0x3dc2('0x55')]})['then'](handleEntityNotFound(_0x1b9e5b,null))[_0x3dc2('0x22')](function(_0x31789f){if(_0x31789f){_0x12f046=_0x31789f[_0x3dc2('0x56')];_0x2cec50=_0x31789f[_0x3dc2('0x55')];_0x26d4cd=_0x31789f[_0x3dc2('0x52')];_0x448219=_0x31789f[_0x3dc2('0x53')];var _0x422665=_0x448219[_0x3dc2('0x57')](-0x1);if(_0x422665==='/'){_0x448219=_0x448219[_0x3dc2('0x58')](0x0,_0x448219['lastIndexOf'](_0x422665));}_0x483971=util[_0x3dc2('0x59')]('%s/webservice.php',_0x448219);var _0xabf144={'method':_0x3dc2('0x5a'),'uri':_0x483971,'qs':{'operation':_0x3dc2('0x5b'),'username':_0x31789f['username']},'json':!![]};return rp(_0xabf144);}})[_0x3dc2('0x22')](function(_0x1b19e4){if(_0x1b19e4[_0x3dc2('0x5c')]){var _0x24ee54={'method':_0x3dc2('0x5d'),'uri':_0x483971,'form':{'operation':_0x3dc2('0x5e'),'username':_0x12f046,'accessKey':md5(_0x1b19e4[_0x3dc2('0x5f')][_0x3dc2('0x60')]+_0x2cec50)},'json':!![]};return rp(_0x24ee54);}})[_0x3dc2('0x22')](function(_0x3e7692){if(_0x3e7692[_0x3dc2('0x5c')]){var _0x3f5157={'method':_0x3dc2('0x5a'),'uri':_0x483971,'qs':{'operation':'describe','username':_0x12f046,'sessionName':_0x3e7692[_0x3dc2('0x5f')][_0x3dc2('0x61')],'elementType':_0x26d4cd},'json':!![]};return rp(_0x3f5157);}})[_0x3dc2('0x22')](function(_0x579bbc){if(_0x579bbc['success']){var _0x4c5b60=['autogenerated',_0x3dc2('0x62'),_0x3dc2('0x63')];_[_0x3dc2('0x64')](_0x579bbc[_0x3dc2('0x5f')][_0x3dc2('0x32')],function(_0x5a965c){return _0x4c5b60[_0x3dc2('0x65')](_0x5a965c[_0x3dc2('0x2a')][_0x3dc2('0x25')]);});_[_0x3dc2('0x64')](_0x579bbc[_0x3dc2('0x5f')][_0x3dc2('0x32')],function(_0x5cbc55){return _0x5cbc55['editable']===_0x3dc2('0x66');});return{'count':_0x579bbc[_0x3dc2('0x5f')][_0x3dc2('0x32')][_0x3dc2('0x33')],'rows':_[_0x3dc2('0x27')](_0x579bbc['result'][_0x3dc2('0x32')],function(_0x2c68ba){return{'id':_0x2c68ba[_0x3dc2('0x25')],'name':_0x2c68ba[_0x3dc2('0x67')],'custom':_[_0x3dc2('0x68')](_0x2c68ba['name'],_0x3dc2('0x69'))?!![]:![],'options':_0x2c68ba[_0x3dc2('0x2a')]['name']===_0x3dc2('0x6a')&&_0x2c68ba[_0x3dc2('0x2a')]['picklistValues']['length']>0x0?_[_0x3dc2('0x27')](_0x2c68ba['type']['picklistValues'],function(_0xc251af){return{'name':_0xc251af[_0x3dc2('0x67')],'value':_0xc251af[_0x3dc2('0x6b')]};}):[]};})};}})[_0x3dc2('0x22')](respondWithResult(_0x1b9e5b,null))[_0x3dc2('0x3f')](function(_0xf021b9){console[_0x3dc2('0x6c')]('vTiger\x20error:\x20'+_0xf021b9);var _0x2e6d56=_0xac2abf[_0x3dc2('0x2d')][_0x3dc2('0x6d')]?0x1f4:_0xf021b9['statusCode']||0x1f4;logger['error'](_0x3dc2('0x6e'),'getFields',_0x2e6d56,JSON['stringify'](_0xf021b9));delete _0xf021b9['name'];if(_0x2e6d56===0x191){_0x2e6d56=0x190;}_0x1b9e5b[_0x3dc2('0x16')](_0x2e6d56)[_0x3dc2('0x6f')](_0xac2abf[_0x3dc2('0x2d')][_0x3dc2('0x6d')]?{'message':_0x3dc2('0x70'),'statusCode':_0xf021b9[_0x3dc2('0x71')]}:_0xf021b9);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 70ffc3f..fdc3e65 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 _0xca4c=['define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1667d8,_0x327b9e){var _0x125051=function(_0x293e3d){while(--_0x293e3d){_0x1667d8['push'](_0x1667d8['shift']());}};_0x125051(++_0x327b9e);}(_0xca4c,0x12e));var _0xcca4=function(_0x863408,_0x24a94f){_0x863408=_0x863408-0x0;var _0x298beb=_0xca4c[_0x863408];return _0x298beb;};'use strict';var _=require('lodash');var util=require(_0xcca4('0x0'));var logger=require(_0xcca4('0x1'))(_0xcca4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcca4('0x3'));var fs=require('fs');var path=require(_0xcca4('0x4'));var rimraf=require(_0xcca4('0x5'));var config=require(_0xcca4('0x6'));var attributes=require(_0xcca4('0x7'));var integrations=require(_0xcca4('0x8'));module[_0xcca4('0x9')]=function(_0x41f1eb,_0x30bc5f){return _0x41f1eb[_0xcca4('0xa')](_0xcca4('0xb'),attributes,{'tableName':_0xcca4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a34=['exports','define','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x541a30,_0x2006f3){var _0x157eed=function(_0x196e6a){while(--_0x196e6a){_0x541a30['push'](_0x541a30['shift']());}};_0x157eed(++_0x2006f3);}(_0x4a34,0x196));var _0x44a3=function(_0x1a357d,_0x4c24f2){_0x1a357d=_0x1a357d-0x0;var _0x1f220d=_0x4a34[_0x1a357d];return _0x1f220d;};'use strict';var _=require('lodash');var util=require(_0x44a3('0x0'));var logger=require(_0x44a3('0x1'))(_0x44a3('0x2'));var moment=require(_0x44a3('0x3'));var BPromise=require(_0x44a3('0x4'));var rp=require(_0x44a3('0x5'));var fs=require('fs');var path=require(_0x44a3('0x6'));var rimraf=require(_0x44a3('0x7'));var config=require(_0x44a3('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x44a3('0x9'));module[_0x44a3('0xa')]=function(_0x21a64c,_0x36020a){return _0x21a64c[_0x44a3('0xb')]('VtigerAccount',attributes,{'tableName':_0x44a3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index d1f3cf6..7146756 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 _0x373d=['VtigerAccount','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','options','raw','where','attributes','limit','include','map','model','then','GetVtigerAccount'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x373d,0x1e2));var _0xd373=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0x373d[_0x35c97a];return _0x388917;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var moment=require(_0xd373('0x1'));var BPromise=require(_0xd373('0x2'));var rs=require(_0xd373('0x3'));var fs=require('fs');var Redis=require(_0xd373('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x8')][_0xd373('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446be6,_0x4008c5,_0x48d977){return new BPromise(function(_0xe79819,_0x51c074){return client['request'](_0x446be6,_0x48d977)['then'](function(_0x14472a){logger[_0xd373('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0xd373('0xb'));logger[_0xd373('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x4008c5,'request\x20sent',JSON[_0xd373('0xd')](_0x14472a));if(_0x14472a[_0xd373('0xe')]){if(_0x14472a[_0xd373('0xe')][_0xd373('0xf')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4008c5,_0x14472a['error'][_0xd373('0x10')]);return _0x51c074(_0x14472a[_0xd373('0xe')]['message']);}logger[_0xd373('0xe')](_0xd373('0x11'),_0x4008c5,_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);return _0xe79819(_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);}else{logger[_0xd373('0xa')](_0xd373('0x11'),_0x4008c5,_0xd373('0xb'));_0xe79819(_0x14472a[_0xd373('0x12')][_0xd373('0x10')]);}})[_0xd373('0x13')](function(_0x1921dd){logger['error'](_0xd373('0x11'),_0x4008c5,_0x1921dd);_0x51c074(_0x1921dd);});});}exports['GetVtigerAccount']=function(_0x460259){var _0x36d47a=this;return new Promise(function(_0x55c5c7,_0x1bbdbd){return db['VtigerAccount']['findAll']({'raw':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x15')]===undefined?!![]:![]:!![],'where':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0x460259['options']?_0x460259[_0xd373('0x14')][_0xd373('0x17')]||null:null,'limit':_0x460259[_0xd373('0x14')]?_0x460259[_0xd373('0x14')][_0xd373('0x18')]||null:null,'include':_0x460259[_0xd373('0x14')]?_0x460259['options'][_0xd373('0x19')]?_[_0xd373('0x1a')](_0x460259[_0xd373('0x14')][_0xd373('0x19')],function(_0x217ee7){return{'model':db[_0x217ee7[_0xd373('0x1b')]],'as':_0x217ee7['as'],'attributes':_0x217ee7[_0xd373('0x17')],'include':_0x217ee7[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x217ee7[_0xd373('0x19')],function(_0x437110){return{'model':db[_0x437110[_0xd373('0x1b')]],'as':_0x437110['as'],'attributes':_0x437110[_0xd373('0x17')],'include':_0x437110[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x437110[_0xd373('0x19')],function(_0x50b987){return{'model':db[_0x50b987[_0xd373('0x1b')]],'as':_0x50b987['as'],'attributes':_0x50b987[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x45ee58){logger[_0xd373('0xa')](_0xd373('0x1d'),_0x460259);logger[_0xd373('0xc')](_0xd373('0x1d'),_0x460259,JSON[_0xd373('0xd')](_0x45ee58));_0x55c5c7(_0x45ee58);})[_0xd373('0x13')](function(_0xbc420b){logger[_0xd373('0xe')](_0xd373('0x1d'),_0xbc420b['message'],_0x460259);_0x1bbdbd(_0x36d47a[_0xd373('0xe')](0x1f4,_0xbc420b['message']));});});};exports['ShowVtigerAccount']=function(_0xedc8f3){var _0x15da6c=this;return new Promise(function(_0x25e016,_0x23024c){return db[_0xd373('0x1e')]['find']({'raw':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x16')]||null:null,'attributes':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x17')]||null:null,'include':_0xedc8f3[_0xd373('0x14')]?_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')]?_['map'](_0xedc8f3[_0xd373('0x14')][_0xd373('0x19')],function(_0x420c73){return{'model':db[_0x420c73[_0xd373('0x1b')]],'as':_0x420c73['as'],'attributes':_0x420c73[_0xd373('0x17')],'include':_0x420c73[_0xd373('0x19')]?_[_0xd373('0x1a')](_0x420c73[_0xd373('0x19')],function(_0xaa62aa){return{'model':db[_0xaa62aa[_0xd373('0x1b')]],'as':_0xaa62aa['as'],'attributes':_0xaa62aa[_0xd373('0x17')],'include':_0xaa62aa[_0xd373('0x19')]?_[_0xd373('0x1a')](_0xaa62aa[_0xd373('0x19')],function(_0x22429c){return{'model':db[_0x22429c['model']],'as':_0x22429c['as'],'attributes':_0x22429c[_0xd373('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd373('0x1c')](function(_0x186e39){logger[_0xd373('0xa')]('ShowVtigerAccount',_0xedc8f3);logger[_0xd373('0xc')](_0xd373('0x1f'),_0xedc8f3,JSON[_0xd373('0xd')](_0x186e39));_0x25e016(_0x186e39);})[_0xd373('0x13')](function(_0x38d8ec){logger[_0xd373('0xe')]('ShowVtigerAccount',_0x38d8ec['message'],_0xedc8f3);_0x23024c(_0x15da6c[_0xd373('0xe')](0x1f4,_0x38d8ec['message']));});});}; \ No newline at end of file +var _0x6e6c=['where','limit','include','map','attributes','model','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','VtigerAccount','findAll','options','raw'];(function(_0x2da046,_0x235efb){var _0x1fa52c=function(_0x4620ce){while(--_0x4620ce){_0x2da046['push'](_0x2da046['shift']());}};_0x1fa52c(++_0x235efb);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});}exports['GetVtigerAccount']=function(_0x3a1ccc){var _0x554262=this;return new Promise(function(_0x46e58f,_0x2069e4){return db[_0xc6e6('0x12')][_0xc6e6('0x13')]({'raw':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x15')]===undefined?!![]:![]:!![],'where':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x16')]||null:null,'attributes':_0x3a1ccc['options']?_0x3a1ccc[_0xc6e6('0x14')]['attributes']||null:null,'limit':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x17')]||null:null,'include':_0x3a1ccc[_0xc6e6('0x14')]?_0x3a1ccc['options'][_0xc6e6('0x18')]?_[_0xc6e6('0x19')](_0x3a1ccc[_0xc6e6('0x14')][_0xc6e6('0x18')],function(_0x107561){return{'model':db[_0x107561['model']],'as':_0x107561['as'],'attributes':_0x107561[_0xc6e6('0x1a')],'include':_0x107561['include']?_[_0xc6e6('0x19')](_0x107561[_0xc6e6('0x18')],function(_0x2e5e0e){return{'model':db[_0x2e5e0e[_0xc6e6('0x1b')]],'as':_0x2e5e0e['as'],'attributes':_0x2e5e0e['attributes'],'include':_0x2e5e0e[_0xc6e6('0x18')]?_['map'](_0x2e5e0e[_0xc6e6('0x18')],function(_0x534745){return{'model':db[_0x534745[_0xc6e6('0x1b')]],'as':_0x534745['as'],'attributes':_0x534745[_0xc6e6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc6e6('0x8')](function(_0x41e7c2){logger[_0xc6e6('0x9')]('GetVtigerAccount',_0x3a1ccc);logger[_0xc6e6('0xc')](_0xc6e6('0x1c'),_0x3a1ccc,JSON[_0xc6e6('0xe')](_0x41e7c2));_0x46e58f(_0x41e7c2);})[_0xc6e6('0x11')](function(_0x4d1284){logger[_0xc6e6('0xf')]('GetVtigerAccount',_0x4d1284[_0xc6e6('0x10')],_0x3a1ccc);_0x2069e4(_0x554262[_0xc6e6('0xf')](0x1f4,_0x4d1284[_0xc6e6('0x10')]));});});};exports[_0xc6e6('0x1d')]=function(_0xd3b63){var _0x402598=this;return new Promise(function(_0x43ff9c,_0x337442){return db[_0xc6e6('0x12')][_0xc6e6('0x1e')]({'raw':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63[_0xc6e6('0x14')][_0xc6e6('0x15')]===undefined?!![]:![]:!![],'where':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63[_0xc6e6('0x14')][_0xc6e6('0x16')]||null:null,'attributes':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63['options'][_0xc6e6('0x1a')]||null:null,'include':_0xd3b63[_0xc6e6('0x14')]?_0xd3b63['options']['include']?_[_0xc6e6('0x19')](_0xd3b63[_0xc6e6('0x14')][_0xc6e6('0x18')],function(_0x152e45){return{'model':db[_0x152e45[_0xc6e6('0x1b')]],'as':_0x152e45['as'],'attributes':_0x152e45[_0xc6e6('0x1a')],'include':_0x152e45['include']?_[_0xc6e6('0x19')](_0x152e45[_0xc6e6('0x18')],function(_0x1fff39){return{'model':db[_0x1fff39['model']],'as':_0x1fff39['as'],'attributes':_0x1fff39['attributes'],'include':_0x1fff39[_0xc6e6('0x18')]?_[_0xc6e6('0x19')](_0x1fff39[_0xc6e6('0x18')],function(_0x2db0a2){return{'model':db[_0x2db0a2['model']],'as':_0x2db0a2['as'],'attributes':_0x2db0a2['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6e6('0x8')](function(_0x4e94ea){logger[_0xc6e6('0x9')]('ShowVtigerAccount',_0xd3b63);logger[_0xc6e6('0xc')](_0xc6e6('0x1d'),_0xd3b63,JSON[_0xc6e6('0xe')](_0x4e94ea));_0x43ff9c(_0x4e94ea);})[_0xc6e6('0x11')](function(_0x58b972){logger['error'](_0xc6e6('0x1d'),_0x58b972[_0xc6e6('0x10')],_0xd3b63);_0x337442(_0x402598[_0xc6e6('0xf')](0x1f4,_0x58b972[_0xc6e6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 280b880..94e57c5 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 _0xa516=['/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','create','put'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0xa516,0xd2));var _0x6a51=function(_0x3887ba,_0x4b3259){_0x3887ba=_0x3887ba-0x0;var _0x3bc630=_0xa516[_0x3887ba];return _0x3bc630;};'use strict';var multer=require(_0x6a51('0x0'));var util=require(_0x6a51('0x1'));var path=require(_0x6a51('0x2'));var timeout=require(_0x6a51('0x3'));var express=require('express');var router=express[_0x6a51('0x4')]();var fs_extra=require(_0x6a51('0x5'));var auth=require(_0x6a51('0x6'));var interaction=require(_0x6a51('0x7'));var config=require(_0x6a51('0x8'));var controller=require(_0x6a51('0x9'));router[_0x6a51('0xa')]('/',auth[_0x6a51('0xb')](),controller[_0x6a51('0xc')]);router[_0x6a51('0xa')]('/:id',auth[_0x6a51('0xb')](),controller[_0x6a51('0xd')]);router[_0x6a51('0xa')](_0x6a51('0xe'),auth[_0x6a51('0xb')](),controller['getFields']);router[_0x6a51('0xa')]('/:id/subjects',auth[_0x6a51('0xb')](),controller[_0x6a51('0xf')]);router[_0x6a51('0xa')](_0x6a51('0x10'),auth[_0x6a51('0xb')](),controller[_0x6a51('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6a51('0x12')]);router[_0x6a51('0x13')](_0x6a51('0x14'),auth[_0x6a51('0xb')](),controller['update']);router[_0x6a51('0x15')](_0x6a51('0x14'),auth[_0x6a51('0xb')](),controller['destroy']);module[_0x6a51('0x16')]=router; \ No newline at end of file +var _0x119e=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete'];(function(_0x33d0e9,_0x104dda){var _0x32dbf9=function(_0x29193e){while(--_0x29193e){_0x33d0e9['push'](_0x33d0e9['shift']());}};_0x32dbf9(++_0x104dda);}(_0x119e,0x115));var _0xe119=function(_0x45c63e,_0x4aa4e3){_0x45c63e=_0x45c63e-0x0;var _0x42d7c0=_0x119e[_0x45c63e];return _0x42d7c0;};'use strict';var multer=require('multer');var util=require(_0xe119('0x0'));var path=require(_0xe119('0x1'));var timeout=require('connect-timeout');var express=require(_0xe119('0x2'));var router=express[_0xe119('0x3')]();var fs_extra=require(_0xe119('0x4'));var auth=require(_0xe119('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe119('0x6'));var controller=require(_0xe119('0x7'));router[_0xe119('0x8')]('/',auth['isAuthenticated'](),controller[_0xe119('0x9')]);router['get'](_0xe119('0xa'),auth['isAuthenticated'](),controller[_0xe119('0xb')]);router[_0xe119('0x8')](_0xe119('0xc'),auth[_0xe119('0xd')](),controller[_0xe119('0xe')]);router[_0xe119('0x8')](_0xe119('0xf'),auth[_0xe119('0xd')](),controller[_0xe119('0x10')]);router['get'](_0xe119('0x11'),auth[_0xe119('0xd')](),controller[_0xe119('0x12')]);router['post']('/',auth[_0xe119('0xd')](),controller['create']);router[_0xe119('0x13')](_0xe119('0xa'),auth[_0xe119('0xd')](),controller[_0xe119('0x14')]);router[_0xe119('0x15')]('/:id',auth[_0xe119('0xd')](),controller['destroy']);module[_0xe119('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 4d87789..1cfbe6a 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 _0x5802=['sequelize','exports'];(function(_0xfc42be,_0x55e477){var _0x3404fa=function(_0x5f210a){while(--_0x5f210a){_0xfc42be['push'](_0xfc42be['shift']());}};_0x3404fa(++_0x55e477);}(_0x5802,0x128));var _0x2580=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0x5802[_0x2d8434];return _0x26b9e4;};'use strict';var Sequelize=require(_0x2580('0x0'));module[_0x2580('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd9ae=['sequelize','exports','STRING'];(function(_0x1f8a69,_0x123ece){var _0x3fb9be=function(_0x318372){while(--_0x318372){_0x1f8a69['push'](_0x1f8a69['shift']());}};_0x3fb9be(++_0x123ece);}(_0xd9ae,0x141));var _0xed9a=function(_0x1d2748,_0x34cd7d){_0x1d2748=_0x1d2748-0x0;var _0x433356=_0xd9ae[_0x1d2748];return _0x433356;};'use strict';var Sequelize=require(_0xed9a('0x0'));module[_0xed9a('0x1')]={'name':{'type':Sequelize[_0xed9a('0x2')]},'description':{'type':Sequelize[_0xed9a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 3c9e0f9..7e1598f 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 _0xb88f=['merge','where','type','options','includeAll','include','findAll','catch','show','keys','length','find','create','body','params','getFields','findOne','VtigerField','sort','filter','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','set','save','update','then','destroy','end','error','stack','name','index','map','VtigerConfiguration','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb88f,0x18d));var _0xfb88=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xb88f[_0x5805d7];return _0x170fe4;};'use strict';var emlformat=require(_0xfb88('0x0'));var rimraf=require(_0xfb88('0x1'));var zipdir=require(_0xfb88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb88('0x3'));var moment=require(_0xfb88('0x4'));var BPromise=require(_0xfb88('0x5'));var Mustache=require(_0xfb88('0x6'));var util=require(_0xfb88('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfb88('0x8'));var ejs=require(_0xfb88('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb88('0xa'));var squel=require(_0xfb88('0xb'));var crypto=require(_0xfb88('0xc'));var jsforce=require(_0xfb88('0xd'));var deskjs=require(_0xfb88('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfb88('0xf'));var Redis=require(_0xfb88('0x10'));var authService=require(_0xfb88('0x11'));var qs=require(_0xfb88('0x12'));var as=require(_0xfb88('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfb88('0x14'));var db=require(_0xfb88('0x15'))['db'];function respondWithStatusCode(_0x246b46,_0x52d917){_0x52d917=_0x52d917||0xcc;return function(_0x5f08cb){if(_0x5f08cb){return _0x246b46[_0xfb88('0x16')](_0x52d917);}return _0x246b46['status'](_0x52d917)['end']();};}function respondWithResult(_0x2fa507,_0x4bb3b5){_0x4bb3b5=_0x4bb3b5||0xc8;return function(_0xa5c2a6){if(_0xa5c2a6){return _0x2fa507['status'](_0x4bb3b5)[_0xfb88('0x17')](_0xa5c2a6);}};}function respondWithFilteredResult(_0x15b6df,_0x58a978){return function(_0x3b46c7){if(_0x3b46c7){var _0x4448e8=typeof _0x58a978[_0xfb88('0x18')]==='undefined'&&typeof _0x58a978['limit']===_0xfb88('0x19');var _0x2bb6aa=_0x3b46c7[_0xfb88('0x1a')];var _0x304664=_0x4448e8?0x0:_0x58a978['offset'];var _0x49fa64=_0x4448e8?_0x3b46c7[_0xfb88('0x1a')]:_0x58a978[_0xfb88('0x18')]+_0x58a978[_0xfb88('0x1b')];var _0x4adb29;if(_0x49fa64>=_0x2bb6aa){_0x49fa64=_0x2bb6aa;_0x4adb29=0xc8;}else{_0x4adb29=0xce;}_0x15b6df[_0xfb88('0x1c')](_0x4adb29);return _0x15b6df[_0xfb88('0x1d')]('Content-Range',_0x304664+'-'+_0x49fa64+'/'+_0x2bb6aa)[_0xfb88('0x17')](_0x3b46c7);}return null;};}function patchUpdates(_0x533271){return function(_0x5ba210){try{jsonpatch['apply'](_0x5ba210,_0x533271,!![]);}catch(_0x29f5de){return BPromise['reject'](_0x29f5de);}return _0x5ba210[_0xfb88('0x1e')]();};}function saveUpdates(_0x217516,_0x12035c){return function(_0x43a4aa){if(_0x43a4aa){return _0x43a4aa[_0xfb88('0x1f')](_0x217516)[_0xfb88('0x20')](function(_0x1740bb){return _0x1740bb;});}return null;};}function removeEntity(_0x469385,_0x193d9a){return function(_0xb4be9){if(_0xb4be9){return _0xb4be9[_0xfb88('0x21')]()[_0xfb88('0x20')](function(){_0x469385[_0xfb88('0x1c')](0xcc)[_0xfb88('0x22')]();});}};}function handleEntityNotFound(_0x1a70de,_0x415bc2){return function(_0x4e3178){if(!_0x4e3178){_0x1a70de['sendStatus'](0x194);}return _0x4e3178;};}function handleError(_0x383cdb,_0x2c42ac){_0x2c42ac=_0x2c42ac||0x1f4;return function(_0x376e20){logger[_0xfb88('0x23')](_0x376e20[_0xfb88('0x24')]);if(_0x376e20[_0xfb88('0x25')]){delete _0x376e20['name'];}_0x383cdb['status'](_0x2c42ac)['send'](_0x376e20);};}exports[_0xfb88('0x26')]=function(_0x2cd3d4,_0x29d77d){var _0x328c3a={},_0x50ce8d={},_0x8132a3={'count':0x0,'rows':[]};var _0x57bf56=_[_0xfb88('0x27')](db[_0xfb88('0x28')][_0xfb88('0x29')],function(_0x27ed3e){return{'name':_0x27ed3e['fieldName'],'type':_0x27ed3e['type'][_0xfb88('0x2a')]};});_0x50ce8d[_0xfb88('0x2b')]=_[_0xfb88('0x27')](_0x57bf56,_0xfb88('0x25'));_0x50ce8d[_0xfb88('0x2c')]=_['keys'](_0x2cd3d4[_0xfb88('0x2c')]);_0x50ce8d[_0xfb88('0x2d')]=_[_0xfb88('0x2e')](_0x50ce8d[_0xfb88('0x2b')],_0x50ce8d[_0xfb88('0x2c')]);_0x328c3a[_0xfb88('0x2f')]=_[_0xfb88('0x2e')](_0x50ce8d[_0xfb88('0x2b')],qs[_0xfb88('0x30')](_0x2cd3d4[_0xfb88('0x2c')]['fields']));_0x328c3a[_0xfb88('0x2f')]=_0x328c3a[_0xfb88('0x2f')]['length']?_0x328c3a[_0xfb88('0x2f')]:_0x50ce8d['model'];if(!_0x2cd3d4[_0xfb88('0x2c')][_0xfb88('0x31')](_0xfb88('0x32'))){_0x328c3a[_0xfb88('0x1b')]=qs[_0xfb88('0x1b')](_0x2cd3d4['query'][_0xfb88('0x1b')]);_0x328c3a[_0xfb88('0x18')]=qs['offset'](_0x2cd3d4[_0xfb88('0x2c')][_0xfb88('0x18')]);}_0x328c3a[_0xfb88('0x33')]=qs['sort'](_0x2cd3d4['query']['sort']);_0x328c3a['where']=qs['filters'](_[_0xfb88('0x34')](_0x2cd3d4[_0xfb88('0x2c')],_0x50ce8d[_0xfb88('0x2d')]),_0x57bf56);if(_0x2cd3d4['query']['filter']){_0x328c3a['where']=_[_0xfb88('0x35')](_0x328c3a[_0xfb88('0x36')],{'$or':_[_0xfb88('0x27')](_0x57bf56,function(_0x2082b1){if(_0x2082b1[_0xfb88('0x37')]!=='VIRTUAL'){var _0x45e57f={};_0x45e57f[_0x2082b1['name']]={'$like':'%'+_0x2cd3d4[_0xfb88('0x2c')]['filter']+'%'};return _0x45e57f;}})});}_0x328c3a=_['merge']({},_0x328c3a,_0x2cd3d4[_0xfb88('0x38')]);var _0x107441={'where':_0x328c3a[_0xfb88('0x36')]};return db[_0xfb88('0x28')][_0xfb88('0x1a')](_0x107441)['then'](function(_0x4796b9){_0x8132a3[_0xfb88('0x1a')]=_0x4796b9;if(_0x2cd3d4['query'][_0xfb88('0x39')]){_0x328c3a[_0xfb88('0x3a')]=[{'all':!![]}];}return db[_0xfb88('0x28')][_0xfb88('0x3b')](_0x328c3a);})[_0xfb88('0x20')](function(_0x30623c){_0x8132a3['rows']=_0x30623c;return _0x8132a3;})[_0xfb88('0x20')](respondWithFilteredResult(_0x29d77d,_0x328c3a))[_0xfb88('0x3c')](handleError(_0x29d77d,null));};exports[_0xfb88('0x3d')]=function(_0x3754c5,_0x5a38c3){var _0x3c451e={'raw':![],'where':{'id':_0x3754c5['params']['id']}},_0x4b9cde={};_0x4b9cde[_0xfb88('0x2b')]=_[_0xfb88('0x3e')](db[_0xfb88('0x28')][_0xfb88('0x29')]);_0x4b9cde[_0xfb88('0x2c')]=_[_0xfb88('0x3e')](_0x3754c5['query']);_0x4b9cde['filters']=_['intersection'](_0x4b9cde[_0xfb88('0x2b')],_0x4b9cde[_0xfb88('0x2c')]);_0x3c451e[_0xfb88('0x2f')]=_['intersection'](_0x4b9cde[_0xfb88('0x2b')],qs[_0xfb88('0x30')](_0x3754c5[_0xfb88('0x2c')][_0xfb88('0x30')]));_0x3c451e[_0xfb88('0x2f')]=_0x3c451e[_0xfb88('0x2f')][_0xfb88('0x3f')]?_0x3c451e[_0xfb88('0x2f')]:_0x4b9cde['model'];if(_0x3754c5[_0xfb88('0x2c')]['includeAll']){_0x3c451e[_0xfb88('0x3a')]=[{'all':!![]}];}_0x3c451e=_[_0xfb88('0x35')]({},_0x3c451e,_0x3754c5['options']);return db['VtigerConfiguration'][_0xfb88('0x40')](_0x3c451e)[_0xfb88('0x20')](handleEntityNotFound(_0x5a38c3,null))[_0xfb88('0x20')](respondWithResult(_0x5a38c3,null))[_0xfb88('0x3c')](handleError(_0x5a38c3,null));};exports[_0xfb88('0x41')]=function(_0x454d43,_0x1ea013){return db[_0xfb88('0x28')]['create'](_0x454d43['body'],{})['then'](respondWithResult(_0x1ea013,0xc9))['catch'](handleError(_0x1ea013,null));};exports[_0xfb88('0x1f')]=function(_0x2e19e6,_0x9d1703){if(_0x2e19e6[_0xfb88('0x42')]['id']){delete _0x2e19e6[_0xfb88('0x42')]['id'];}return db['VtigerConfiguration'][_0xfb88('0x40')]({'where':{'id':_0x2e19e6['params']['id']}})['then'](handleEntityNotFound(_0x9d1703,null))[_0xfb88('0x20')](saveUpdates(_0x2e19e6[_0xfb88('0x42')],null))[_0xfb88('0x20')](respondWithResult(_0x9d1703,null))[_0xfb88('0x3c')](handleError(_0x9d1703,null));};exports[_0xfb88('0x21')]=function(_0x56acc7,_0x435e57){return db['VtigerConfiguration'][_0xfb88('0x40')]({'where':{'id':_0x56acc7[_0xfb88('0x43')]['id']}})['then'](handleEntityNotFound(_0x435e57,null))[_0xfb88('0x20')](removeEntity(_0x435e57,null))[_0xfb88('0x3c')](handleError(_0x435e57,null));};exports[_0xfb88('0x44')]=function(_0x5b81f1,_0x44dd2d,_0x393778){var _0x452337={};var _0x3bba49={};var _0x30644a;var _0x318840;return db[_0xfb88('0x28')][_0xfb88('0x45')]({'where':{'id':_0x5b81f1[_0xfb88('0x43')]['id']}})[_0xfb88('0x20')](handleEntityNotFound(_0x44dd2d,null))['then'](function(_0x576c6e){if(_0x576c6e){_0x30644a=_0x576c6e;_0x3bba49[_0xfb88('0x2b')]=_[_0xfb88('0x3e')](db[_0xfb88('0x46')][_0xfb88('0x29')]);_0x3bba49['query']=_[_0xfb88('0x3e')](_0x5b81f1[_0xfb88('0x2c')]);_0x3bba49[_0xfb88('0x2d')]=_[_0xfb88('0x2e')](_0x3bba49[_0xfb88('0x2b')],_0x3bba49['query']);_0x452337['attributes']=_['intersection'](_0x3bba49[_0xfb88('0x2b')],qs[_0xfb88('0x30')](_0x5b81f1[_0xfb88('0x2c')][_0xfb88('0x30')]));_0x452337[_0xfb88('0x2f')]=_0x452337[_0xfb88('0x2f')][_0xfb88('0x3f')]?_0x452337[_0xfb88('0x2f')]:_0x3bba49[_0xfb88('0x2b')];_0x452337['order']=qs[_0xfb88('0x47')](_0x5b81f1[_0xfb88('0x2c')][_0xfb88('0x47')]);_0x452337[_0xfb88('0x36')]=qs[_0xfb88('0x2d')](_[_0xfb88('0x34')](_0x5b81f1['query'],_0x3bba49[_0xfb88('0x2d')]));if(_0x5b81f1[_0xfb88('0x2c')]['filter']){_0x452337['where']=_[_0xfb88('0x35')](_0x452337[_0xfb88('0x36')],{'$or':_[_0xfb88('0x27')](_0x452337['attributes'],function(_0x20ac11){var _0x5d6186={};_0x5d6186[_0x20ac11]={'$like':'%'+_0x5b81f1[_0xfb88('0x2c')][_0xfb88('0x48')]+'%'};return _0x5d6186;})});}_0x452337=_[_0xfb88('0x35')]({},_0x452337,_0x5b81f1[_0xfb88('0x38')]);return _0x30644a[_0xfb88('0x44')](_0x452337);}})['then'](function(_0x23653c){if(_0x23653c){_0x318840=_0x23653c[_0xfb88('0x3f')];if(!_0x5b81f1['query'][_0xfb88('0x31')]('nolimit')){_0x452337[_0xfb88('0x1b')]=qs[_0xfb88('0x1b')](_0x5b81f1[_0xfb88('0x2c')][_0xfb88('0x1b')]);_0x452337['offset']=qs[_0xfb88('0x18')](_0x5b81f1[_0xfb88('0x2c')][_0xfb88('0x18')]);}return _0x30644a[_0xfb88('0x44')](_0x452337);}})['then'](function(_0x5aeab5){if(_0x5aeab5){return _0x5aeab5?{'count':_0x318840,'rows':_0x5aeab5}:null;}})[_0xfb88('0x20')](respondWithResult(_0x44dd2d,null))[_0xfb88('0x3c')](handleError(_0x44dd2d,null));};exports['getSubjects']=function(_0x2051dc,_0x5e82d9,_0x597fee){var _0x46a47f={};var _0x5ee34e={};var _0x22e8ce;var _0x47ae4a;return db['VtigerConfiguration'][_0xfb88('0x45')]({'where':{'id':_0x2051dc['params']['id']}})[_0xfb88('0x20')](handleEntityNotFound(_0x5e82d9,null))['then'](function(_0x4e8894){if(_0x4e8894){_0x22e8ce=_0x4e8894;_0x5ee34e[_0xfb88('0x2b')]=_[_0xfb88('0x3e')](db['VtigerField'][_0xfb88('0x29')]);_0x5ee34e[_0xfb88('0x2c')]=_[_0xfb88('0x3e')](_0x2051dc[_0xfb88('0x2c')]);_0x5ee34e[_0xfb88('0x2d')]=_[_0xfb88('0x2e')](_0x5ee34e[_0xfb88('0x2b')],_0x5ee34e[_0xfb88('0x2c')]);_0x46a47f[_0xfb88('0x2f')]=_[_0xfb88('0x2e')](_0x5ee34e[_0xfb88('0x2b')],qs['fields'](_0x2051dc[_0xfb88('0x2c')][_0xfb88('0x30')]));_0x46a47f['attributes']=_0x46a47f[_0xfb88('0x2f')][_0xfb88('0x3f')]?_0x46a47f[_0xfb88('0x2f')]:_0x5ee34e[_0xfb88('0x2b')];_0x46a47f[_0xfb88('0x33')]=qs[_0xfb88('0x47')](_0x2051dc[_0xfb88('0x2c')]['sort']);_0x46a47f[_0xfb88('0x36')]=qs[_0xfb88('0x2d')](_[_0xfb88('0x34')](_0x2051dc['query'],_0x5ee34e[_0xfb88('0x2d')]));if(_0x2051dc[_0xfb88('0x2c')][_0xfb88('0x48')]){_0x46a47f[_0xfb88('0x36')]=_[_0xfb88('0x35')](_0x46a47f[_0xfb88('0x36')],{'$or':_[_0xfb88('0x27')](_0x46a47f[_0xfb88('0x2f')],function(_0x3c9aa0){var _0x356be8={};_0x356be8[_0x3c9aa0]={'$like':'%'+_0x2051dc['query']['filter']+'%'};return _0x356be8;})});}_0x46a47f=_[_0xfb88('0x35')]({},_0x46a47f,_0x2051dc[_0xfb88('0x38')]);return _0x22e8ce['getSubjects'](_0x46a47f);}})['then'](function(_0xa5188f){if(_0xa5188f){_0x47ae4a=_0xa5188f[_0xfb88('0x3f')];if(!_0x2051dc[_0xfb88('0x2c')][_0xfb88('0x31')](_0xfb88('0x32'))){_0x46a47f[_0xfb88('0x1b')]=qs[_0xfb88('0x1b')](_0x2051dc[_0xfb88('0x2c')][_0xfb88('0x1b')]);_0x46a47f[_0xfb88('0x18')]=qs['offset'](_0x2051dc[_0xfb88('0x2c')]['offset']);}return _0x22e8ce[_0xfb88('0x49')](_0x46a47f);}})[_0xfb88('0x20')](function(_0x28d65a){if(_0x28d65a){return _0x28d65a?{'count':_0x47ae4a,'rows':_0x28d65a}:null;}})[_0xfb88('0x20')](respondWithResult(_0x5e82d9,null))[_0xfb88('0x3c')](handleError(_0x5e82d9,null));};exports['getDescriptions']=function(_0x58cb97,_0xd5702,_0xdc67bf){var _0xc94d77={};var _0x4d528b={};var _0x52bccc;var _0x304db2;return db[_0xfb88('0x28')][_0xfb88('0x45')]({'where':{'id':_0x58cb97[_0xfb88('0x43')]['id']}})[_0xfb88('0x20')](handleEntityNotFound(_0xd5702,null))['then'](function(_0x5e1253){if(_0x5e1253){_0x52bccc=_0x5e1253;_0x4d528b[_0xfb88('0x2b')]=_[_0xfb88('0x3e')](db[_0xfb88('0x46')][_0xfb88('0x29')]);_0x4d528b[_0xfb88('0x2c')]=_['keys'](_0x58cb97[_0xfb88('0x2c')]);_0x4d528b[_0xfb88('0x2d')]=_['intersection'](_0x4d528b['model'],_0x4d528b[_0xfb88('0x2c')]);_0xc94d77[_0xfb88('0x2f')]=_['intersection'](_0x4d528b[_0xfb88('0x2b')],qs[_0xfb88('0x30')](_0x58cb97['query'][_0xfb88('0x30')]));_0xc94d77[_0xfb88('0x2f')]=_0xc94d77[_0xfb88('0x2f')][_0xfb88('0x3f')]?_0xc94d77['attributes']:_0x4d528b[_0xfb88('0x2b')];_0xc94d77[_0xfb88('0x33')]=qs[_0xfb88('0x47')](_0x58cb97[_0xfb88('0x2c')][_0xfb88('0x47')]);_0xc94d77['where']=qs[_0xfb88('0x2d')](_[_0xfb88('0x34')](_0x58cb97[_0xfb88('0x2c')],_0x4d528b[_0xfb88('0x2d')]));if(_0x58cb97['query']['filter']){_0xc94d77[_0xfb88('0x36')]=_[_0xfb88('0x35')](_0xc94d77[_0xfb88('0x36')],{'$or':_[_0xfb88('0x27')](_0xc94d77[_0xfb88('0x2f')],function(_0x1b1e53){var _0x1e3cc8={};_0x1e3cc8[_0x1b1e53]={'$like':'%'+_0x58cb97['query'][_0xfb88('0x48')]+'%'};return _0x1e3cc8;})});}_0xc94d77=_[_0xfb88('0x35')]({},_0xc94d77,_0x58cb97['options']);return _0x52bccc[_0xfb88('0x4a')](_0xc94d77);}})[_0xfb88('0x20')](function(_0x181750){if(_0x181750){_0x304db2=_0x181750[_0xfb88('0x3f')];if(!_0x58cb97['query']['hasOwnProperty'](_0xfb88('0x32'))){_0xc94d77[_0xfb88('0x1b')]=qs[_0xfb88('0x1b')](_0x58cb97['query'][_0xfb88('0x1b')]);_0xc94d77[_0xfb88('0x18')]=qs[_0xfb88('0x18')](_0x58cb97['query']['offset']);}return _0x52bccc[_0xfb88('0x4a')](_0xc94d77);}})[_0xfb88('0x20')](function(_0x3923d5){if(_0x3923d5){return _0x3923d5?{'count':_0x304db2,'rows':_0x3923d5}:null;}})[_0xfb88('0x20')](respondWithResult(_0xd5702,null))[_0xfb88('0x3c')](handleError(_0xd5702,null));}; \ No newline at end of file +var _0x8d08=['index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','catch','update','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','end','name','send'];(function(_0xff4cb1,_0x1156ea){var _0x3b6feb=function(_0x277294){while(--_0x277294){_0xff4cb1['push'](_0xff4cb1['shift']());}};_0x3b6feb(++_0x1156ea);}(_0x8d08,0x118));var _0x88d0=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0x8d08[_0x1633e9];return _0x549ace;};'use strict';var emlformat=require(_0x88d0('0x0'));var rimraf=require(_0x88d0('0x1'));var zipdir=require(_0x88d0('0x2'));var jsonpatch=require(_0x88d0('0x3'));var rp=require(_0x88d0('0x4'));var moment=require(_0x88d0('0x5'));var BPromise=require(_0x88d0('0x6'));var Mustache=require(_0x88d0('0x7'));var util=require(_0x88d0('0x8'));var path=require(_0x88d0('0x9'));var sox=require(_0x88d0('0xa'));var csv=require(_0x88d0('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x88d0('0xc'));var _=require(_0x88d0('0xd'));var squel=require('squel');var crypto=require(_0x88d0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x88d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x88d0('0x10'));var Papa=require(_0x88d0('0x11'));var Redis=require(_0x88d0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x88d0('0x13'));var as=require(_0x88d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88d0('0x15'))('api');var utils=require(_0x88d0('0x16'));var config=require(_0x88d0('0x17'));var licenseUtil=require(_0x88d0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5de471,_0x5da161){_0x5da161=_0x5da161||0xcc;return function(_0x2854a5){if(_0x2854a5){return _0x5de471[_0x88d0('0x19')](_0x5da161);}return _0x5de471[_0x88d0('0x1a')](_0x5da161)['end']();};}function respondWithResult(_0x47a572,_0x57b18e){_0x57b18e=_0x57b18e||0xc8;return function(_0x461ae6){if(_0x461ae6){return _0x47a572[_0x88d0('0x1a')](_0x57b18e)['json'](_0x461ae6);}};}function respondWithFilteredResult(_0x2bba74,_0x189ea6){return function(_0x2b3ebd){if(_0x2b3ebd){var _0x37083a=typeof _0x189ea6['offset']===_0x88d0('0x1b')&&typeof _0x189ea6[_0x88d0('0x1c')]===_0x88d0('0x1b');var _0x3fe6b8=_0x2b3ebd['count'];var _0x100727=_0x37083a?0x0:_0x189ea6[_0x88d0('0x1d')];var _0x5862d1=_0x37083a?_0x2b3ebd[_0x88d0('0x1e')]:_0x189ea6[_0x88d0('0x1d')]+_0x189ea6['limit'];var _0x1212a7;if(_0x5862d1>=_0x3fe6b8){_0x5862d1=_0x3fe6b8;_0x1212a7=0xc8;}else{_0x1212a7=0xce;}_0x2bba74['status'](_0x1212a7);return _0x2bba74[_0x88d0('0x1f')](_0x88d0('0x20'),_0x100727+'-'+_0x5862d1+'/'+_0x3fe6b8)['json'](_0x2b3ebd);}return null;};}function patchUpdates(_0x463d67){return function(_0x46aabb){try{jsonpatch[_0x88d0('0x21')](_0x46aabb,_0x463d67,!![]);}catch(_0x2c2f73){return BPromise['reject'](_0x2c2f73);}return _0x46aabb[_0x88d0('0x22')]();};}function saveUpdates(_0xbeb2f9,_0x40155e){return function(_0x4e8b5a){if(_0x4e8b5a){return _0x4e8b5a['update'](_0xbeb2f9)[_0x88d0('0x23')](function(_0x124525){return _0x124525;});}return null;};}function removeEntity(_0x5d6d85,_0x3bd137){return function(_0x2d2aac){if(_0x2d2aac){return _0x2d2aac[_0x88d0('0x24')]()[_0x88d0('0x23')](function(){_0x5d6d85[_0x88d0('0x1a')](0xcc)[_0x88d0('0x25')]();});}};}function handleEntityNotFound(_0x481a86,_0x2499a1){return function(_0x4d20ae){if(!_0x4d20ae){_0x481a86[_0x88d0('0x19')](0x194);}return _0x4d20ae;};}function handleError(_0x2b5adb,_0x1daaf1){_0x1daaf1=_0x1daaf1||0x1f4;return function(_0x3aa683){logger['error'](_0x3aa683['stack']);if(_0x3aa683[_0x88d0('0x26')]){delete _0x3aa683[_0x88d0('0x26')];}_0x2b5adb[_0x88d0('0x1a')](_0x1daaf1)[_0x88d0('0x27')](_0x3aa683);};}exports[_0x88d0('0x28')]=function(_0xa17c71,_0x32782e){var _0x5bab64={},_0x28f306={},_0x1031ce={'count':0x0,'rows':[]};var _0x39fa16=_[_0x88d0('0x29')](db[_0x88d0('0x2a')][_0x88d0('0x2b')],function(_0x2e2fa5){return{'name':_0x2e2fa5[_0x88d0('0x2c')],'type':_0x2e2fa5[_0x88d0('0x2d')][_0x88d0('0x2e')]};});_0x28f306[_0x88d0('0x2f')]=_[_0x88d0('0x29')](_0x39fa16,_0x88d0('0x26'));_0x28f306[_0x88d0('0x30')]=_['keys'](_0xa17c71[_0x88d0('0x30')]);_0x28f306[_0x88d0('0x31')]=_[_0x88d0('0x32')](_0x28f306[_0x88d0('0x2f')],_0x28f306[_0x88d0('0x30')]);_0x5bab64[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x28f306[_0x88d0('0x2f')],qs[_0x88d0('0x34')](_0xa17c71['query'][_0x88d0('0x34')]));_0x5bab64[_0x88d0('0x33')]=_0x5bab64[_0x88d0('0x33')][_0x88d0('0x35')]?_0x5bab64[_0x88d0('0x33')]:_0x28f306['model'];if(!_0xa17c71[_0x88d0('0x30')][_0x88d0('0x36')](_0x88d0('0x37'))){_0x5bab64[_0x88d0('0x1c')]=qs[_0x88d0('0x1c')](_0xa17c71[_0x88d0('0x30')][_0x88d0('0x1c')]);_0x5bab64[_0x88d0('0x1d')]=qs[_0x88d0('0x1d')](_0xa17c71[_0x88d0('0x30')][_0x88d0('0x1d')]);}_0x5bab64[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0xa17c71[_0x88d0('0x30')]['sort']);_0x5bab64[_0x88d0('0x3a')]=qs['filters'](_[_0x88d0('0x3b')](_0xa17c71['query'],_0x28f306[_0x88d0('0x31')]),_0x39fa16);if(_0xa17c71[_0x88d0('0x30')][_0x88d0('0x3c')]){_0x5bab64['where']=_[_0x88d0('0x3d')](_0x5bab64[_0x88d0('0x3a')],{'$or':_[_0x88d0('0x29')](_0x39fa16,function(_0x274028){if(_0x274028[_0x88d0('0x2d')]!=='VIRTUAL'){var _0x3f7d74={};_0x3f7d74[_0x274028[_0x88d0('0x26')]]={'$like':'%'+_0xa17c71[_0x88d0('0x30')][_0x88d0('0x3c')]+'%'};return _0x3f7d74;}})});}_0x5bab64=_[_0x88d0('0x3d')]({},_0x5bab64,_0xa17c71[_0x88d0('0x3e')]);var _0x49f906={'where':_0x5bab64[_0x88d0('0x3a')]};return db['VtigerConfiguration'][_0x88d0('0x1e')](_0x49f906)['then'](function(_0x25c2ed){_0x1031ce['count']=_0x25c2ed;if(_0xa17c71[_0x88d0('0x30')][_0x88d0('0x3f')]){_0x5bab64[_0x88d0('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x88d0('0x41')](_0x5bab64);})[_0x88d0('0x23')](function(_0xa7bccb){_0x1031ce[_0x88d0('0x42')]=_0xa7bccb;return _0x1031ce;})[_0x88d0('0x23')](respondWithFilteredResult(_0x32782e,_0x5bab64))['catch'](handleError(_0x32782e,null));};exports[_0x88d0('0x43')]=function(_0x430b1a,_0x1d07b7){var _0x18d85d={'raw':![],'where':{'id':_0x430b1a[_0x88d0('0x44')]['id']}},_0x19fcf8={};_0x19fcf8[_0x88d0('0x2f')]=_[_0x88d0('0x45')](db[_0x88d0('0x2a')][_0x88d0('0x2b')]);_0x19fcf8[_0x88d0('0x30')]=_['keys'](_0x430b1a[_0x88d0('0x30')]);_0x19fcf8['filters']=_[_0x88d0('0x32')](_0x19fcf8['model'],_0x19fcf8[_0x88d0('0x30')]);_0x18d85d[_0x88d0('0x33')]=_['intersection'](_0x19fcf8[_0x88d0('0x2f')],qs['fields'](_0x430b1a[_0x88d0('0x30')]['fields']));_0x18d85d[_0x88d0('0x33')]=_0x18d85d[_0x88d0('0x33')]['length']?_0x18d85d[_0x88d0('0x33')]:_0x19fcf8[_0x88d0('0x2f')];if(_0x430b1a['query'][_0x88d0('0x3f')]){_0x18d85d['include']=[{'all':!![]}];}_0x18d85d=_[_0x88d0('0x3d')]({},_0x18d85d,_0x430b1a['options']);return db[_0x88d0('0x2a')][_0x88d0('0x46')](_0x18d85d)[_0x88d0('0x23')](handleEntityNotFound(_0x1d07b7,null))['then'](respondWithResult(_0x1d07b7,null))['catch'](handleError(_0x1d07b7,null));};exports[_0x88d0('0x47')]=function(_0x19dd54,_0x2b7660){return db[_0x88d0('0x2a')]['create'](_0x19dd54['body'],{})[_0x88d0('0x23')](respondWithResult(_0x2b7660,0xc9))[_0x88d0('0x48')](handleError(_0x2b7660,null));};exports[_0x88d0('0x49')]=function(_0x353ecb,_0xd436d3){if(_0x353ecb[_0x88d0('0x4a')]['id']){delete _0x353ecb['body']['id'];}return db['VtigerConfiguration'][_0x88d0('0x46')]({'where':{'id':_0x353ecb['params']['id']}})[_0x88d0('0x23')](handleEntityNotFound(_0xd436d3,null))[_0x88d0('0x23')](saveUpdates(_0x353ecb[_0x88d0('0x4a')],null))['then'](respondWithResult(_0xd436d3,null))[_0x88d0('0x48')](handleError(_0xd436d3,null));};exports[_0x88d0('0x24')]=function(_0x3700b0,_0xfd9205){return db[_0x88d0('0x2a')]['find']({'where':{'id':_0x3700b0[_0x88d0('0x44')]['id']}})[_0x88d0('0x23')](handleEntityNotFound(_0xfd9205,null))[_0x88d0('0x23')](removeEntity(_0xfd9205,null))[_0x88d0('0x48')](handleError(_0xfd9205,null));};exports[_0x88d0('0x4b')]=function(_0x3e6b53,_0x3027d1,_0x315743){var _0xa5c9db={};var _0x336a34={};var _0x1bd51f;var _0x32c374;return db[_0x88d0('0x2a')][_0x88d0('0x4c')]({'where':{'id':_0x3e6b53[_0x88d0('0x44')]['id']}})['then'](handleEntityNotFound(_0x3027d1,null))['then'](function(_0x120270){if(_0x120270){_0x1bd51f=_0x120270;_0x336a34['model']=_[_0x88d0('0x45')](db[_0x88d0('0x4d')][_0x88d0('0x2b')]);_0x336a34['query']=_[_0x88d0('0x45')](_0x3e6b53[_0x88d0('0x30')]);_0x336a34[_0x88d0('0x31')]=_[_0x88d0('0x32')](_0x336a34[_0x88d0('0x2f')],_0x336a34['query']);_0xa5c9db[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x336a34[_0x88d0('0x2f')],qs['fields'](_0x3e6b53[_0x88d0('0x30')]['fields']));_0xa5c9db[_0x88d0('0x33')]=_0xa5c9db[_0x88d0('0x33')][_0x88d0('0x35')]?_0xa5c9db['attributes']:_0x336a34['model'];_0xa5c9db[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0x3e6b53['query']['sort']);_0xa5c9db['where']=qs[_0x88d0('0x31')](_[_0x88d0('0x3b')](_0x3e6b53['query'],_0x336a34['filters']));if(_0x3e6b53[_0x88d0('0x30')]['filter']){_0xa5c9db[_0x88d0('0x3a')]=_[_0x88d0('0x3d')](_0xa5c9db[_0x88d0('0x3a')],{'$or':_[_0x88d0('0x29')](_0xa5c9db[_0x88d0('0x33')],function(_0x27e048){var _0x40ec13={};_0x40ec13[_0x27e048]={'$like':'%'+_0x3e6b53[_0x88d0('0x30')][_0x88d0('0x3c')]+'%'};return _0x40ec13;})});}_0xa5c9db=_[_0x88d0('0x3d')]({},_0xa5c9db,_0x3e6b53[_0x88d0('0x3e')]);return _0x1bd51f[_0x88d0('0x4b')](_0xa5c9db);}})[_0x88d0('0x23')](function(_0xaa92f7){if(_0xaa92f7){_0x32c374=_0xaa92f7[_0x88d0('0x35')];if(!_0x3e6b53['query'][_0x88d0('0x36')]('nolimit')){_0xa5c9db[_0x88d0('0x1c')]=qs['limit'](_0x3e6b53['query'][_0x88d0('0x1c')]);_0xa5c9db[_0x88d0('0x1d')]=qs[_0x88d0('0x1d')](_0x3e6b53['query']['offset']);}return _0x1bd51f['getFields'](_0xa5c9db);}})[_0x88d0('0x23')](function(_0x95b4ac){if(_0x95b4ac){return _0x95b4ac?{'count':_0x32c374,'rows':_0x95b4ac}:null;}})['then'](respondWithResult(_0x3027d1,null))[_0x88d0('0x48')](handleError(_0x3027d1,null));};exports[_0x88d0('0x4e')]=function(_0x5d77c2,_0x2de113,_0x49da23){var _0x55d7cc={};var _0x52c9c1={};var _0x58b3a7;var _0x493c55;return db[_0x88d0('0x2a')][_0x88d0('0x4c')]({'where':{'id':_0x5d77c2[_0x88d0('0x44')]['id']}})[_0x88d0('0x23')](handleEntityNotFound(_0x2de113,null))[_0x88d0('0x23')](function(_0x11de76){if(_0x11de76){_0x58b3a7=_0x11de76;_0x52c9c1[_0x88d0('0x2f')]=_[_0x88d0('0x45')](db[_0x88d0('0x4d')][_0x88d0('0x2b')]);_0x52c9c1[_0x88d0('0x30')]=_[_0x88d0('0x45')](_0x5d77c2[_0x88d0('0x30')]);_0x52c9c1['filters']=_[_0x88d0('0x32')](_0x52c9c1['model'],_0x52c9c1[_0x88d0('0x30')]);_0x55d7cc[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x52c9c1[_0x88d0('0x2f')],qs[_0x88d0('0x34')](_0x5d77c2['query']['fields']));_0x55d7cc[_0x88d0('0x33')]=_0x55d7cc['attributes']['length']?_0x55d7cc[_0x88d0('0x33')]:_0x52c9c1['model'];_0x55d7cc[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0x5d77c2['query'][_0x88d0('0x39')]);_0x55d7cc['where']=qs[_0x88d0('0x31')](_['pick'](_0x5d77c2[_0x88d0('0x30')],_0x52c9c1[_0x88d0('0x31')]));if(_0x5d77c2[_0x88d0('0x30')]['filter']){_0x55d7cc[_0x88d0('0x3a')]=_[_0x88d0('0x3d')](_0x55d7cc[_0x88d0('0x3a')],{'$or':_['map'](_0x55d7cc['attributes'],function(_0x792de){var _0x24a10e={};_0x24a10e[_0x792de]={'$like':'%'+_0x5d77c2[_0x88d0('0x30')]['filter']+'%'};return _0x24a10e;})});}_0x55d7cc=_[_0x88d0('0x3d')]({},_0x55d7cc,_0x5d77c2[_0x88d0('0x3e')]);return _0x58b3a7['getSubjects'](_0x55d7cc);}})[_0x88d0('0x23')](function(_0x42be3c){if(_0x42be3c){_0x493c55=_0x42be3c[_0x88d0('0x35')];if(!_0x5d77c2[_0x88d0('0x30')][_0x88d0('0x36')](_0x88d0('0x37'))){_0x55d7cc[_0x88d0('0x1c')]=qs['limit'](_0x5d77c2[_0x88d0('0x30')][_0x88d0('0x1c')]);_0x55d7cc[_0x88d0('0x1d')]=qs['offset'](_0x5d77c2[_0x88d0('0x30')]['offset']);}return _0x58b3a7[_0x88d0('0x4e')](_0x55d7cc);}})[_0x88d0('0x23')](function(_0x5794ec){if(_0x5794ec){return _0x5794ec?{'count':_0x493c55,'rows':_0x5794ec}:null;}})[_0x88d0('0x23')](respondWithResult(_0x2de113,null))[_0x88d0('0x48')](handleError(_0x2de113,null));};exports['getDescriptions']=function(_0x16a54b,_0x1d57df,_0x261a45){var _0x4450fa={};var _0x48585a={};var _0x254840;var _0x5ea91a;return db[_0x88d0('0x2a')]['findOne']({'where':{'id':_0x16a54b[_0x88d0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1d57df,null))[_0x88d0('0x23')](function(_0x54caaf){if(_0x54caaf){_0x254840=_0x54caaf;_0x48585a['model']=_['keys'](db[_0x88d0('0x4d')][_0x88d0('0x2b')]);_0x48585a['query']=_[_0x88d0('0x45')](_0x16a54b[_0x88d0('0x30')]);_0x48585a['filters']=_[_0x88d0('0x32')](_0x48585a['model'],_0x48585a['query']);_0x4450fa[_0x88d0('0x33')]=_[_0x88d0('0x32')](_0x48585a[_0x88d0('0x2f')],qs[_0x88d0('0x34')](_0x16a54b[_0x88d0('0x30')][_0x88d0('0x34')]));_0x4450fa['attributes']=_0x4450fa[_0x88d0('0x33')]['length']?_0x4450fa[_0x88d0('0x33')]:_0x48585a[_0x88d0('0x2f')];_0x4450fa[_0x88d0('0x38')]=qs[_0x88d0('0x39')](_0x16a54b[_0x88d0('0x30')][_0x88d0('0x39')]);_0x4450fa[_0x88d0('0x3a')]=qs[_0x88d0('0x31')](_[_0x88d0('0x3b')](_0x16a54b[_0x88d0('0x30')],_0x48585a[_0x88d0('0x31')]));if(_0x16a54b[_0x88d0('0x30')][_0x88d0('0x3c')]){_0x4450fa[_0x88d0('0x3a')]=_[_0x88d0('0x3d')](_0x4450fa['where'],{'$or':_[_0x88d0('0x29')](_0x4450fa['attributes'],function(_0x58d92d){var _0x969804={};_0x969804[_0x58d92d]={'$like':'%'+_0x16a54b[_0x88d0('0x30')][_0x88d0('0x3c')]+'%'};return _0x969804;})});}_0x4450fa=_['merge']({},_0x4450fa,_0x16a54b[_0x88d0('0x3e')]);return _0x254840['getDescriptions'](_0x4450fa);}})[_0x88d0('0x23')](function(_0x44b3d3){if(_0x44b3d3){_0x5ea91a=_0x44b3d3[_0x88d0('0x35')];if(!_0x16a54b[_0x88d0('0x30')][_0x88d0('0x36')](_0x88d0('0x37'))){_0x4450fa[_0x88d0('0x1c')]=qs[_0x88d0('0x1c')](_0x16a54b[_0x88d0('0x30')][_0x88d0('0x1c')]);_0x4450fa[_0x88d0('0x1d')]=qs[_0x88d0('0x1d')](_0x16a54b[_0x88d0('0x30')]['offset']);}return _0x254840[_0x88d0('0x4f')](_0x4450fa);}})[_0x88d0('0x23')](function(_0x4f43e2){if(_0x4f43e2){return _0x4f43e2?{'count':_0x5ea91a,'rows':_0x4f43e2}:null;}})[_0x88d0('0x23')](respondWithResult(_0x1d57df,null))[_0x88d0('0x48')](handleError(_0x1d57df,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6c75cfe..b9422e3 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 _0xc570=['lodash','util','api','bluebird','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xc570,0x160));var _0x0c57=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xc570[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0c57('0x0'));var util=require(_0x0c57('0x1'));var logger=require('../../config/logger')(_0x0c57('0x2'));var moment=require('moment');var BPromise=require(_0x0c57('0x3'));var rp=require(_0x0c57('0x4'));var fs=require('fs');var path=require(_0x0c57('0x5'));var rimraf=require(_0x0c57('0x6'));var config=require('../../config/environment');var attributes=require(_0x0c57('0x7'));module[_0x0c57('0x8')]=function(_0x945665,_0x3440ae){return _0x945665['define'](_0x0c57('0x9'),attributes,{'tableName':_0x0c57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b3f=['api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x4724dd,_0x499243){var _0x3af2bf=function(_0x233565){while(--_0x233565){_0x4724dd['push'](_0x4724dd['shift']());}};_0x3af2bf(++_0x499243);}(_0x8b3f,0x128));var _0xf8b3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8b3f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xf8b3('0x0'));var util=require(_0xf8b3('0x1'));var logger=require(_0xf8b3('0x2'))(_0xf8b3('0x3'));var moment=require(_0xf8b3('0x4'));var BPromise=require(_0xf8b3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8b3('0x6'));var rimraf=require(_0xf8b3('0x7'));var config=require(_0xf8b3('0x8'));var attributes=require(_0xf8b3('0x9'));module[_0xf8b3('0xa')]=function(_0x195e8e,_0x1d879f){return _0x195e8e[_0xf8b3('0xb')](_0xf8b3('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 163cd3e..123e1ec 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 _0x2c73=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x2c73,0x126));var _0x32c7=function(_0x121619,_0x293a7a){_0x121619=_0x121619-0x0;var _0x37ba1f=_0x2c73[_0x121619];return _0x37ba1f;};'use strict';var _=require(_0x32c7('0x0'));var util=require('util');var moment=require(_0x32c7('0x1'));var BPromise=require(_0x32c7('0x2'));var rs=require(_0x32c7('0x3'));var fs=require('fs');var Redis=require(_0x32c7('0x4'));var db=require(_0x32c7('0x5'))['db'];var utils=require(_0x32c7('0x6'));var logger=require(_0x32c7('0x7'))(_0x32c7('0x8'));var config=require(_0x32c7('0x9'));var jayson=require(_0x32c7('0xa'));var client=jayson[_0x32c7('0xb')][_0x32c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fd06,_0x4e343d,_0x344838){return new BPromise(function(_0x413d5f,_0x553bf4){return client[_0x32c7('0xd')](_0x2fd06,_0x344838)['then'](function(_0x274813){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4e343d,_0x32c7('0xe'));logger[_0x32c7('0xf')](_0x32c7('0x10'),_0x4e343d,_0x32c7('0xe'),JSON[_0x32c7('0x11')](_0x274813));if(_0x274813[_0x32c7('0x12')]){if(_0x274813[_0x32c7('0x12')]['code']===0x1f4){logger[_0x32c7('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x4e343d,_0x274813[_0x32c7('0x12')][_0x32c7('0x13')]);return _0x553bf4(_0x274813[_0x32c7('0x12')][_0x32c7('0x13')]);}logger[_0x32c7('0x12')](_0x32c7('0x14'),_0x4e343d,_0x274813[_0x32c7('0x12')][_0x32c7('0x13')]);return _0x413d5f(_0x274813[_0x32c7('0x12')][_0x32c7('0x13')]);}else{logger['info'](_0x32c7('0x14'),_0x4e343d,_0x32c7('0xe'));_0x413d5f(_0x274813[_0x32c7('0x15')][_0x32c7('0x13')]);}})[_0x32c7('0x16')](function(_0x8ad8c3){logger[_0x32c7('0x12')](_0x32c7('0x14'),_0x4e343d,_0x8ad8c3);_0x553bf4(_0x8ad8c3);});});} \ No newline at end of file +var _0xcb4a=['client','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa53e56,_0x216856){var _0x361bd2=function(_0x592ca2){while(--_0x592ca2){_0xa53e56['push'](_0xa53e56['shift']());}};_0x361bd2(++_0x216856);}(_0xcb4a,0x182));var _0xacb4=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xcb4a[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xacb4('0x0'));var util=require(_0xacb4('0x1'));var moment=require(_0xacb4('0x2'));var BPromise=require('bluebird');var rs=require(_0xacb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacb4('0x4'))['db'];var utils=require(_0xacb4('0x5'));var logger=require(_0xacb4('0x6'))(_0xacb4('0x7'));var config=require(_0xacb4('0x8'));var jayson=require(_0xacb4('0x9'));var client=jayson[_0xacb4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c123f,_0x4a06ad,_0x5ab195){return new BPromise(function(_0x2bf325,_0x3e93c8){return client[_0xacb4('0xb')](_0x4c123f,_0x5ab195)[_0xacb4('0xc')](function(_0x4e3462){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4a06ad,_0xacb4('0xd'));logger[_0xacb4('0xe')](_0xacb4('0xf'),_0x4a06ad,_0xacb4('0xd'),JSON['stringify'](_0x4e3462));if(_0x4e3462[_0xacb4('0x10')]){if(_0x4e3462[_0xacb4('0x10')][_0xacb4('0x11')]===0x1f4){logger[_0xacb4('0x10')](_0xacb4('0x12'),_0x4a06ad,_0x4e3462['error'][_0xacb4('0x13')]);return _0x3e93c8(_0x4e3462[_0xacb4('0x10')][_0xacb4('0x13')]);}logger[_0xacb4('0x10')](_0xacb4('0x12'),_0x4a06ad,_0x4e3462[_0xacb4('0x10')][_0xacb4('0x13')]);return _0x2bf325(_0x4e3462['error'][_0xacb4('0x13')]);}else{logger['info'](_0xacb4('0x12'),_0x4a06ad,'request\x20sent');_0x2bf325(_0x4e3462[_0xacb4('0x14')][_0xacb4('0x13')]);}})[_0xacb4('0x15')](function(_0x13c37d){logger[_0xacb4('0x10')](_0xacb4('0x12'),_0x4a06ad,_0x13c37d);_0x3e93c8(_0x13c37d);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 92ae8b6..b143577 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 _0x058e=['get','isAuthenticated','index','show','post','put','/:id','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller'];(function(_0x5472e4,_0x2bd849){var _0x3a42d4=function(_0x72af0c){while(--_0x72af0c){_0x5472e4['push'](_0x5472e4['shift']());}};_0x3a42d4(++_0x2bd849);}(_0x058e,0xa2));var _0xe058=function(_0x2fe725,_0x319046){_0x2fe725=_0x2fe725-0x0;var _0x4f297f=_0x058e[_0x2fe725];return _0x4f297f;};'use strict';var multer=require(_0xe058('0x0'));var util=require('util');var path=require(_0xe058('0x1'));var timeout=require('connect-timeout');var express=require(_0xe058('0x2'));var router=express[_0xe058('0x3')]();var fs_extra=require(_0xe058('0x4'));var auth=require(_0xe058('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe058('0x6'));var controller=require(_0xe058('0x7'));router[_0xe058('0x8')]('/',auth[_0xe058('0x9')](),controller[_0xe058('0xa')]);router[_0xe058('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe058('0xb')]);router[_0xe058('0xc')]('/',auth[_0xe058('0x9')](),controller['create']);router[_0xe058('0xd')](_0xe058('0xe'),auth[_0xe058('0x9')](),controller[_0xe058('0xf')]);router['delete'](_0xe058('0xe'),auth[_0xe058('0x9')](),controller['destroy']);module[_0xe058('0x10')]=router; \ No newline at end of file +var _0x97aa=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index'];(function(_0x2c5d55,_0x48d195){var _0x283683=function(_0x31671f){while(--_0x31671f){_0x2c5d55['push'](_0x2c5d55['shift']());}};_0x283683(++_0x48d195);}(_0x97aa,0xf0));var _0xa97a=function(_0x54803f,_0x17195a){_0x54803f=_0x54803f-0x0;var _0x42a2e2=_0x97aa[_0x54803f];return _0x42a2e2;};'use strict';var multer=require('multer');var util=require(_0xa97a('0x0'));var path=require(_0xa97a('0x1'));var timeout=require(_0xa97a('0x2'));var express=require(_0xa97a('0x3'));var router=express[_0xa97a('0x4')]();var fs_extra=require(_0xa97a('0x5'));var auth=require(_0xa97a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa97a('0x7'));var controller=require(_0xa97a('0x8'));router[_0xa97a('0x9')]('/',auth[_0xa97a('0xa')](),controller[_0xa97a('0xb')]);router[_0xa97a('0x9')](_0xa97a('0xc'),auth[_0xa97a('0xa')](),controller[_0xa97a('0xd')]);router[_0xa97a('0xe')]('/',auth[_0xa97a('0xa')](),controller[_0xa97a('0xf')]);router[_0xa97a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa97a('0x11')]);router[_0xa97a('0x12')]('/:id',auth[_0xa97a('0xa')](),controller[_0xa97a('0x13')]);module[_0xa97a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 3d93784..163b4f4 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 _0x431c=['STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x3fcb69,_0x2ecb49){var _0x44cad5=function(_0x309205){while(--_0x309205){_0x3fcb69['push'](_0x3fcb69['shift']());}};_0x44cad5(++_0x2ecb49);}(_0x431c,0x14f));var _0xc431=function(_0x1e3192,_0x4566ee){_0x1e3192=_0x1e3192-0x0;var _0x16f912=_0x431c[_0x1e3192];return _0x16f912;};'use strict';var Sequelize=require('sequelize');module[_0xc431('0x0')]={'type':{'type':Sequelize[_0xc431('0x1')](_0xc431('0x2'),_0xc431('0x3'),_0xc431('0x4'),_0xc431('0x5'),_0xc431('0x6')),'defaultValue':_0xc431('0x2')},'content':{'type':Sequelize[_0xc431('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc431('0x1')](_0xc431('0x2'),'variable',_0xc431('0x4'))},'keyContent':{'type':Sequelize[_0xc431('0x7')]},'idField':{'type':Sequelize[_0xc431('0x7')]},'nameField':{'type':Sequelize[_0xc431('0x7')]},'customField':{'type':Sequelize[_0xc431('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc431('0x7')]}}; \ No newline at end of file +var _0xf243=['sequelize','exports','ENUM','variable','picklist','string','STRING','customVariable','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf243,0x10e));var _0x3f24=function(_0x4ccf96,_0x34978e){_0x4ccf96=_0x4ccf96-0x0;var _0xd103b7=_0xf243[_0x4ccf96];return _0xd103b7;};'use strict';var Sequelize=require(_0x3f24('0x0'));module[_0x3f24('0x1')]={'type':{'type':Sequelize[_0x3f24('0x2')]('string',_0x3f24('0x3'),'customVariable','keyValue',_0x3f24('0x4')),'defaultValue':_0x3f24('0x5')},'content':{'type':Sequelize[_0x3f24('0x6')]},'key':{'type':Sequelize[_0x3f24('0x6')]},'keyType':{'type':Sequelize[_0x3f24('0x2')](_0x3f24('0x5'),'variable',_0x3f24('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3f24('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3f24('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f24('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 5ffb006..b991150 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 _0x4435=['destroy','error','name','send','index','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','apply','reject','update','then'];(function(_0x48a98d,_0x331904){var _0x4d4e34=function(_0x19dfb5){while(--_0x19dfb5){_0x48a98d['push'](_0x48a98d['shift']());}};_0x4d4e34(++_0x331904);}(_0x4435,0x1ef));var _0x5443=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4435[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require(_0x5443('0x0'));var rimraf=require(_0x5443('0x1'));var zipdir=require(_0x5443('0x2'));var jsonpatch=require(_0x5443('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5443('0x4'));var util=require(_0x5443('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5443('0x6'));var ejs=require(_0x5443('0x7'));var fs=require('fs');var fs_extra=require(_0x5443('0x8'));var _=require(_0x5443('0x9'));var squel=require(_0x5443('0xa'));var crypto=require(_0x5443('0xb'));var jsforce=require(_0x5443('0xc'));var deskjs=require(_0x5443('0xd'));var toCsv=require(_0x5443('0x6'));var querystring=require(_0x5443('0xe'));var Papa=require(_0x5443('0xf'));var Redis=require(_0x5443('0x10'));var authService=require(_0x5443('0x11'));var qs=require(_0x5443('0x12'));var as=require(_0x5443('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5443('0x14'))(_0x5443('0x15'));var utils=require('../../config/utils');var config=require(_0x5443('0x16'));var licenseUtil=require(_0x5443('0x17'));var db=require(_0x5443('0x18'))['db'];function respondWithStatusCode(_0x300f73,_0x387f46){_0x387f46=_0x387f46||0xcc;return function(_0x46e90a){if(_0x46e90a){return _0x300f73[_0x5443('0x19')](_0x387f46);}return _0x300f73[_0x5443('0x1a')](_0x387f46)[_0x5443('0x1b')]();};}function respondWithResult(_0x156e5a,_0x2a1b28){_0x2a1b28=_0x2a1b28||0xc8;return function(_0x51c266){if(_0x51c266){return _0x156e5a[_0x5443('0x1a')](_0x2a1b28)[_0x5443('0x1c')](_0x51c266);}};}function respondWithFilteredResult(_0x12fe6f,_0x2b0692){return function(_0x1d04e4){if(_0x1d04e4){var _0x37aca4=typeof _0x2b0692['offset']===_0x5443('0x1d')&&typeof _0x2b0692[_0x5443('0x1e')]===_0x5443('0x1d');var _0x5b00b7=_0x1d04e4['count'];var _0x39e875=_0x37aca4?0x0:_0x2b0692[_0x5443('0x1f')];var _0x422977=_0x37aca4?_0x1d04e4['count']:_0x2b0692[_0x5443('0x1f')]+_0x2b0692['limit'];var _0x5dc08c;if(_0x422977>=_0x5b00b7){_0x422977=_0x5b00b7;_0x5dc08c=0xc8;}else{_0x5dc08c=0xce;}_0x12fe6f[_0x5443('0x1a')](_0x5dc08c);return _0x12fe6f[_0x5443('0x20')]('Content-Range',_0x39e875+'-'+_0x422977+'/'+_0x5b00b7)[_0x5443('0x1c')](_0x1d04e4);}return null;};}function patchUpdates(_0x39ae5b){return function(_0x13dc0d){try{jsonpatch[_0x5443('0x21')](_0x13dc0d,_0x39ae5b,!![]);}catch(_0x3c9433){return BPromise[_0x5443('0x22')](_0x3c9433);}return _0x13dc0d['save']();};}function saveUpdates(_0x10438c,_0x2502b9){return function(_0x541a54){if(_0x541a54){return _0x541a54[_0x5443('0x23')](_0x10438c)[_0x5443('0x24')](function(_0x92f4c6){return _0x92f4c6;});}return null;};}function removeEntity(_0x3a644b,_0x452e18){return function(_0x14a21c){if(_0x14a21c){return _0x14a21c[_0x5443('0x25')]()[_0x5443('0x24')](function(){_0x3a644b['status'](0xcc)[_0x5443('0x1b')]();});}};}function handleEntityNotFound(_0x44eb2c,_0x12c90f){return function(_0x323f0d){if(!_0x323f0d){_0x44eb2c[_0x5443('0x19')](0x194);}return _0x323f0d;};}function handleError(_0x54cf56,_0x10c5ec){_0x10c5ec=_0x10c5ec||0x1f4;return function(_0x4941f4){logger[_0x5443('0x26')](_0x4941f4['stack']);if(_0x4941f4[_0x5443('0x27')]){delete _0x4941f4[_0x5443('0x27')];}_0x54cf56['status'](_0x10c5ec)[_0x5443('0x28')](_0x4941f4);};}exports[_0x5443('0x29')]=function(_0x153025,_0x3d5add){var _0xd37132={},_0x33bbd9={},_0x27429f={'count':0x0,'rows':[]};var _0x2486bb=_['map'](db[_0x5443('0x2a')][_0x5443('0x2b')],function(_0x16983f){return{'name':_0x16983f[_0x5443('0x2c')],'type':_0x16983f[_0x5443('0x2d')][_0x5443('0x2e')]};});_0x33bbd9[_0x5443('0x2f')]=_[_0x5443('0x30')](_0x2486bb,_0x5443('0x27'));_0x33bbd9[_0x5443('0x31')]=_[_0x5443('0x32')](_0x153025[_0x5443('0x31')]);_0x33bbd9[_0x5443('0x33')]=_['intersection'](_0x33bbd9['model'],_0x33bbd9[_0x5443('0x31')]);_0xd37132['attributes']=_[_0x5443('0x34')](_0x33bbd9[_0x5443('0x2f')],qs[_0x5443('0x35')](_0x153025['query'][_0x5443('0x35')]));_0xd37132[_0x5443('0x36')]=_0xd37132[_0x5443('0x36')][_0x5443('0x37')]?_0xd37132[_0x5443('0x36')]:_0x33bbd9['model'];if(!_0x153025[_0x5443('0x31')]['hasOwnProperty'](_0x5443('0x38'))){_0xd37132['limit']=qs['limit'](_0x153025[_0x5443('0x31')][_0x5443('0x1e')]);_0xd37132[_0x5443('0x1f')]=qs[_0x5443('0x1f')](_0x153025[_0x5443('0x31')]['offset']);}_0xd37132[_0x5443('0x39')]=qs['sort'](_0x153025[_0x5443('0x31')][_0x5443('0x3a')]);_0xd37132[_0x5443('0x3b')]=qs[_0x5443('0x33')](_[_0x5443('0x3c')](_0x153025[_0x5443('0x31')],_0x33bbd9[_0x5443('0x33')]),_0x2486bb);if(_0x153025[_0x5443('0x31')]['filter']){_0xd37132[_0x5443('0x3b')]=_['merge'](_0xd37132[_0x5443('0x3b')],{'$or':_[_0x5443('0x30')](_0x2486bb,function(_0x26843a){if(_0x26843a[_0x5443('0x2d')]!==_0x5443('0x3d')){var _0x45f75c={};_0x45f75c[_0x26843a['name']]={'$like':'%'+_0x153025[_0x5443('0x31')][_0x5443('0x3e')]+'%'};return _0x45f75c;}})});}_0xd37132=_[_0x5443('0x3f')]({},_0xd37132,_0x153025[_0x5443('0x40')]);var _0x14c59b={'where':_0xd37132[_0x5443('0x3b')]};return db['VtigerField']['count'](_0x14c59b)[_0x5443('0x24')](function(_0x226289){_0x27429f[_0x5443('0x41')]=_0x226289;if(_0x153025[_0x5443('0x31')][_0x5443('0x42')]){_0xd37132[_0x5443('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0x5443('0x44')](_0xd37132);})['then'](function(_0x2b43a9){_0x27429f[_0x5443('0x45')]=_0x2b43a9;return _0x27429f;})[_0x5443('0x24')](respondWithFilteredResult(_0x3d5add,_0xd37132))[_0x5443('0x46')](handleError(_0x3d5add,null));};exports[_0x5443('0x47')]=function(_0x3dde6f,_0x5bebe9){var _0x30d24c={'raw':!![],'where':{'id':_0x3dde6f[_0x5443('0x48')]['id']}},_0xc4af8e={};_0xc4af8e[_0x5443('0x2f')]=_[_0x5443('0x32')](db[_0x5443('0x2a')][_0x5443('0x2b')]);_0xc4af8e['query']=_['keys'](_0x3dde6f[_0x5443('0x31')]);_0xc4af8e[_0x5443('0x33')]=_[_0x5443('0x34')](_0xc4af8e[_0x5443('0x2f')],_0xc4af8e[_0x5443('0x31')]);_0x30d24c['attributes']=_[_0x5443('0x34')](_0xc4af8e[_0x5443('0x2f')],qs[_0x5443('0x35')](_0x3dde6f[_0x5443('0x31')]['fields']));_0x30d24c[_0x5443('0x36')]=_0x30d24c[_0x5443('0x36')][_0x5443('0x37')]?_0x30d24c['attributes']:_0xc4af8e[_0x5443('0x2f')];if(_0x3dde6f[_0x5443('0x31')][_0x5443('0x42')]){_0x30d24c[_0x5443('0x43')]=[{'all':!![]}];}_0x30d24c=_['merge']({},_0x30d24c,_0x3dde6f[_0x5443('0x40')]);return db[_0x5443('0x2a')][_0x5443('0x49')](_0x30d24c)[_0x5443('0x24')](handleEntityNotFound(_0x5bebe9,null))['then'](respondWithResult(_0x5bebe9,null))[_0x5443('0x46')](handleError(_0x5bebe9,null));};exports[_0x5443('0x4a')]=function(_0x471482,_0x31e0b9){return db[_0x5443('0x2a')][_0x5443('0x4a')](_0x471482[_0x5443('0x4b')],{})['then'](respondWithResult(_0x31e0b9,0xc9))['catch'](handleError(_0x31e0b9,null));};exports['update']=function(_0x18379f,_0x5c2b5d){if(_0x18379f[_0x5443('0x4b')]['id']){delete _0x18379f[_0x5443('0x4b')]['id'];}return db['VtigerField'][_0x5443('0x49')]({'where':{'id':_0x18379f[_0x5443('0x48')]['id']}})[_0x5443('0x24')](handleEntityNotFound(_0x5c2b5d,null))['then'](saveUpdates(_0x18379f['body'],null))[_0x5443('0x24')](respondWithResult(_0x5c2b5d,null))[_0x5443('0x46')](handleError(_0x5c2b5d,null));};exports[_0x5443('0x25')]=function(_0xa98d99,_0x52a382){return db[_0x5443('0x2a')]['find']({'where':{'id':_0xa98d99[_0x5443('0x48')]['id']}})[_0x5443('0x24')](handleEntityNotFound(_0x52a382,null))[_0x5443('0x24')](removeEntity(_0x52a382,null))[_0x5443('0x46')](handleError(_0x52a382,null));}; \ No newline at end of file +var _0xa56d=['filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','params','attributes','merge','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys'];(function(_0x1a6e1c,_0x21f20f){var _0x4a8025=function(_0x152b2a){while(--_0x152b2a){_0x1a6e1c['push'](_0x1a6e1c['shift']());}};_0x4a8025(++_0x21f20f);}(_0xa56d,0x1e0));var _0xda56=function(_0x3c7056,_0x4fc530){_0x3c7056=_0x3c7056-0x0;var _0x4f9b36=_0xa56d[_0x3c7056];return _0x4f9b36;};'use strict';var emlformat=require(_0xda56('0x0'));var rimraf=require(_0xda56('0x1'));var zipdir=require(_0xda56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xda56('0x4'));var util=require(_0xda56('0x5'));var path=require(_0xda56('0x6'));var sox=require(_0xda56('0x7'));var csv=require(_0xda56('0x8'));var ejs=require(_0xda56('0x9'));var fs=require('fs');var fs_extra=require(_0xda56('0xa'));var _=require(_0xda56('0xb'));var squel=require(_0xda56('0xc'));var crypto=require('crypto');var jsforce=require(_0xda56('0xd'));var deskjs=require(_0xda56('0xe'));var toCsv=require(_0xda56('0x8'));var querystring=require(_0xda56('0xf'));var Papa=require(_0xda56('0x10'));var Redis=require(_0xda56('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xda56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda56('0x13'));var logger=require(_0xda56('0x14'))(_0xda56('0x15'));var utils=require(_0xda56('0x16'));var config=require(_0xda56('0x17'));var licenseUtil=require(_0xda56('0x18'));var db=require(_0xda56('0x19'))['db'];function respondWithStatusCode(_0x393f0b,_0x4df8b7){_0x4df8b7=_0x4df8b7||0xcc;return function(_0x2823d2){if(_0x2823d2){return _0x393f0b[_0xda56('0x1a')](_0x4df8b7);}return _0x393f0b[_0xda56('0x1b')](_0x4df8b7)[_0xda56('0x1c')]();};}function respondWithResult(_0x311546,_0x5645cd){_0x5645cd=_0x5645cd||0xc8;return function(_0x3c47bd){if(_0x3c47bd){return _0x311546[_0xda56('0x1b')](_0x5645cd)[_0xda56('0x1d')](_0x3c47bd);}};}function respondWithFilteredResult(_0x39aa82,_0x3d7454){return function(_0x30a379){if(_0x30a379){var _0x1019e1=typeof _0x3d7454[_0xda56('0x1e')]==='undefined'&&typeof _0x3d7454['limit']===_0xda56('0x1f');var _0x420e22=_0x30a379[_0xda56('0x20')];var _0x4726a5=_0x1019e1?0x0:_0x3d7454[_0xda56('0x1e')];var _0xe7c6f8=_0x1019e1?_0x30a379[_0xda56('0x20')]:_0x3d7454[_0xda56('0x1e')]+_0x3d7454[_0xda56('0x21')];var _0x3dbb08;if(_0xe7c6f8>=_0x420e22){_0xe7c6f8=_0x420e22;_0x3dbb08=0xc8;}else{_0x3dbb08=0xce;}_0x39aa82[_0xda56('0x1b')](_0x3dbb08);return _0x39aa82[_0xda56('0x22')](_0xda56('0x23'),_0x4726a5+'-'+_0xe7c6f8+'/'+_0x420e22)[_0xda56('0x1d')](_0x30a379);}return null;};}function patchUpdates(_0x54e576){return function(_0x36eda8){try{jsonpatch[_0xda56('0x24')](_0x36eda8,_0x54e576,!![]);}catch(_0x1aff93){return BPromise[_0xda56('0x25')](_0x1aff93);}return _0x36eda8['save']();};}function saveUpdates(_0x4292d4,_0x3237c5){return function(_0x2dfc2e){if(_0x2dfc2e){return _0x2dfc2e[_0xda56('0x26')](_0x4292d4)['then'](function(_0x5c3f1e){return _0x5c3f1e;});}return null;};}function removeEntity(_0x4a3ea5,_0x13de4a){return function(_0x1669e2){if(_0x1669e2){return _0x1669e2[_0xda56('0x27')]()[_0xda56('0x28')](function(){_0x4a3ea5[_0xda56('0x1b')](0xcc)[_0xda56('0x1c')]();});}};}function handleEntityNotFound(_0x4670fd,_0x538783){return function(_0x1a6694){if(!_0x1a6694){_0x4670fd['sendStatus'](0x194);}return _0x1a6694;};}function handleError(_0x2a4150,_0x3755f2){_0x3755f2=_0x3755f2||0x1f4;return function(_0x1c45d8){logger['error'](_0x1c45d8[_0xda56('0x29')]);if(_0x1c45d8[_0xda56('0x2a')]){delete _0x1c45d8[_0xda56('0x2a')];}_0x2a4150[_0xda56('0x1b')](_0x3755f2)['send'](_0x1c45d8);};}exports[_0xda56('0x2b')]=function(_0x13b914,_0x5dc8f4){var _0x229927={},_0x2545bf={},_0x4cbf3c={'count':0x0,'rows':[]};var _0x111d60=_[_0xda56('0x2c')](db[_0xda56('0x2d')][_0xda56('0x2e')],function(_0x120df4){return{'name':_0x120df4[_0xda56('0x2f')],'type':_0x120df4[_0xda56('0x30')]['key']};});_0x2545bf[_0xda56('0x31')]=_[_0xda56('0x2c')](_0x111d60,_0xda56('0x2a'));_0x2545bf[_0xda56('0x32')]=_[_0xda56('0x33')](_0x13b914[_0xda56('0x32')]);_0x2545bf[_0xda56('0x34')]=_[_0xda56('0x35')](_0x2545bf[_0xda56('0x31')],_0x2545bf[_0xda56('0x32')]);_0x229927['attributes']=_[_0xda56('0x35')](_0x2545bf[_0xda56('0x31')],qs[_0xda56('0x36')](_0x13b914['query'][_0xda56('0x36')]));_0x229927['attributes']=_0x229927['attributes'][_0xda56('0x37')]?_0x229927['attributes']:_0x2545bf[_0xda56('0x31')];if(!_0x13b914[_0xda56('0x32')][_0xda56('0x38')](_0xda56('0x39'))){_0x229927[_0xda56('0x21')]=qs[_0xda56('0x21')](_0x13b914['query'][_0xda56('0x21')]);_0x229927[_0xda56('0x1e')]=qs[_0xda56('0x1e')](_0x13b914[_0xda56('0x32')][_0xda56('0x1e')]);}_0x229927[_0xda56('0x3a')]=qs['sort'](_0x13b914[_0xda56('0x32')][_0xda56('0x3b')]);_0x229927['where']=qs[_0xda56('0x34')](_[_0xda56('0x3c')](_0x13b914[_0xda56('0x32')],_0x2545bf[_0xda56('0x34')]),_0x111d60);if(_0x13b914[_0xda56('0x32')][_0xda56('0x3d')]){_0x229927[_0xda56('0x3e')]=_['merge'](_0x229927['where'],{'$or':_[_0xda56('0x2c')](_0x111d60,function(_0x3a15b1){if(_0x3a15b1[_0xda56('0x30')]!==_0xda56('0x3f')){var _0x16faae={};_0x16faae[_0x3a15b1[_0xda56('0x2a')]]={'$like':'%'+_0x13b914[_0xda56('0x32')]['filter']+'%'};return _0x16faae;}})});}_0x229927=_['merge']({},_0x229927,_0x13b914[_0xda56('0x40')]);var _0x3cf30f={'where':_0x229927[_0xda56('0x3e')]};return db[_0xda56('0x2d')]['count'](_0x3cf30f)[_0xda56('0x28')](function(_0x509bcb){_0x4cbf3c[_0xda56('0x20')]=_0x509bcb;if(_0x13b914[_0xda56('0x32')][_0xda56('0x41')]){_0x229927[_0xda56('0x42')]=[{'all':!![]}];}return db[_0xda56('0x2d')][_0xda56('0x43')](_0x229927);})[_0xda56('0x28')](function(_0x43c231){_0x4cbf3c[_0xda56('0x44')]=_0x43c231;return _0x4cbf3c;})['then'](respondWithFilteredResult(_0x5dc8f4,_0x229927))['catch'](handleError(_0x5dc8f4,null));};exports['show']=function(_0xa1faca,_0x37a1a3){var _0x10b70b={'raw':!![],'where':{'id':_0xa1faca[_0xda56('0x45')]['id']}},_0x4ae0c5={};_0x4ae0c5[_0xda56('0x31')]=_[_0xda56('0x33')](db[_0xda56('0x2d')][_0xda56('0x2e')]);_0x4ae0c5['query']=_[_0xda56('0x33')](_0xa1faca[_0xda56('0x32')]);_0x4ae0c5[_0xda56('0x34')]=_['intersection'](_0x4ae0c5[_0xda56('0x31')],_0x4ae0c5[_0xda56('0x32')]);_0x10b70b[_0xda56('0x46')]=_[_0xda56('0x35')](_0x4ae0c5[_0xda56('0x31')],qs['fields'](_0xa1faca[_0xda56('0x32')][_0xda56('0x36')]));_0x10b70b[_0xda56('0x46')]=_0x10b70b[_0xda56('0x46')][_0xda56('0x37')]?_0x10b70b['attributes']:_0x4ae0c5[_0xda56('0x31')];if(_0xa1faca['query'][_0xda56('0x41')]){_0x10b70b[_0xda56('0x42')]=[{'all':!![]}];}_0x10b70b=_[_0xda56('0x47')]({},_0x10b70b,_0xa1faca[_0xda56('0x40')]);return db[_0xda56('0x2d')][_0xda56('0x48')](_0x10b70b)['then'](handleEntityNotFound(_0x37a1a3,null))[_0xda56('0x28')](respondWithResult(_0x37a1a3,null))[_0xda56('0x49')](handleError(_0x37a1a3,null));};exports['create']=function(_0x211537,_0x24a79c){return db['VtigerField'][_0xda56('0x4a')](_0x211537['body'],{})['then'](respondWithResult(_0x24a79c,0xc9))[_0xda56('0x49')](handleError(_0x24a79c,null));};exports[_0xda56('0x26')]=function(_0x39354b,_0x574fd8){if(_0x39354b['body']['id']){delete _0x39354b['body']['id'];}return db[_0xda56('0x2d')]['find']({'where':{'id':_0x39354b['params']['id']}})[_0xda56('0x28')](handleEntityNotFound(_0x574fd8,null))['then'](saveUpdates(_0x39354b[_0xda56('0x4b')],null))[_0xda56('0x28')](respondWithResult(_0x574fd8,null))['catch'](handleError(_0x574fd8,null));};exports[_0xda56('0x27')]=function(_0x4ebb5b,_0x5e2eb1){return db[_0xda56('0x2d')][_0xda56('0x48')]({'where':{'id':_0x4ebb5b[_0xda56('0x45')]['id']}})[_0xda56('0x28')](handleEntityNotFound(_0x5e2eb1,null))['then'](removeEntity(_0x5e2eb1,null))[_0xda56('0x49')](handleError(_0x5e2eb1,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c4066d7..a51cdba 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 _0x0743=['idField','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0743,0x197));var _0x3074=function(_0x2eda59,_0x50c938){_0x2eda59=_0x2eda59-0x0;var _0x3e0b2a=_0x0743[_0x2eda59];return _0x3e0b2a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3074('0x0'));var moment=require(_0x3074('0x1'));var BPromise=require(_0x3074('0x2'));var rp=require(_0x3074('0x3'));var fs=require('fs');var path=require(_0x3074('0x4'));var rimraf=require(_0x3074('0x5'));var config=require(_0x3074('0x6'));var attributes=require(_0x3074('0x7'));module[_0x3074('0x8')]=function(_0x216c75,_0x1e99f9){return _0x216c75[_0x3074('0x9')](_0x3074('0xa'),attributes,{'tableName':_0x3074('0xb'),'paranoid':![],'indexes':[{'name':_0x3074('0xc'),'fields':[_0x3074('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae0d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3794ab,_0xb9bf66){var _0x422ba3=function(_0xadbcbe){while(--_0xadbcbe){_0x3794ab['push'](_0x3794ab['shift']());}};_0x422ba3(++_0xb9bf66);}(_0xae0d,0x66));var _0xdae0=function(_0x113f04,_0x1ca16f){_0x113f04=_0x113f04-0x0;var _0x19892b=_0xae0d[_0x113f04];return _0x19892b;};'use strict';var _=require(_0xdae0('0x0'));var util=require(_0xdae0('0x1'));var logger=require(_0xdae0('0x2'))(_0xdae0('0x3'));var moment=require(_0xdae0('0x4'));var BPromise=require(_0xdae0('0x5'));var rp=require(_0xdae0('0x6'));var fs=require('fs');var path=require(_0xdae0('0x7'));var rimraf=require(_0xdae0('0x8'));var config=require(_0xdae0('0x9'));var attributes=require('./intVtigerField.attributes');module[_0xdae0('0xa')]=function(_0xb7662e,_0x536ec6){return _0xb7662e['define'](_0xdae0('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xdae0('0xc'),'fields':[_0xdae0('0xd'),_0xdae0('0xe')],'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 c81ffb8..4a3bd80 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 _0x9ff9=['../../config/logger','rpc','http','request','then','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3d462e,_0x390b38){var _0x172e1e=function(_0x413b59){while(--_0x413b59){_0x3d462e['push'](_0x3d462e['shift']());}};_0x172e1e(++_0x390b38);}(_0x9ff9,0xd5));var _0x99ff=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x9ff9[_0x28d18d];return _0x470640;};'use strict';var _=require(_0x99ff('0x0'));var util=require(_0x99ff('0x1'));var moment=require(_0x99ff('0x2'));var BPromise=require(_0x99ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99ff('0x4'));var db=require(_0x99ff('0x5'))['db'];var utils=require(_0x99ff('0x6'));var logger=require(_0x99ff('0x7'))(_0x99ff('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x99ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33bfdf,_0xe8e9fe,_0x405680){return new BPromise(function(_0x5120d5,_0x422f0e){return client[_0x99ff('0xa')](_0x33bfdf,_0x405680)[_0x99ff('0xb')](function(_0x3fc360){logger['info'](_0x99ff('0xc'),_0xe8e9fe,'request\x20sent');logger[_0x99ff('0xd')](_0x99ff('0xe'),_0xe8e9fe,_0x99ff('0xf'),JSON[_0x99ff('0x10')](_0x3fc360));if(_0x3fc360[_0x99ff('0x11')]){if(_0x3fc360['error'][_0x99ff('0x12')]===0x1f4){logger[_0x99ff('0x11')]('VtigerField,\x20%s,\x20%s',_0xe8e9fe,_0x3fc360[_0x99ff('0x11')][_0x99ff('0x13')]);return _0x422f0e(_0x3fc360[_0x99ff('0x11')][_0x99ff('0x13')]);}logger[_0x99ff('0x11')](_0x99ff('0xc'),_0xe8e9fe,_0x3fc360[_0x99ff('0x11')][_0x99ff('0x13')]);return _0x5120d5(_0x3fc360[_0x99ff('0x11')][_0x99ff('0x13')]);}else{logger[_0x99ff('0x14')]('VtigerField,\x20%s,\x20%s',_0xe8e9fe,'request\x20sent');_0x5120d5(_0x3fc360['result'][_0x99ff('0x13')]);}})[_0x99ff('0x15')](function(_0x5fab78){logger[_0x99ff('0x11')]('VtigerField,\x20%s,\x20%s',_0xe8e9fe,_0x5fab78);_0x422f0e(_0x5fab78);});});} \ No newline at end of file +var _0x4804=['../../config/logger','rpc','jayson/promise','http','request','then','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x781950,_0x51b25d){var _0x5cdb4a=function(_0x45cdc8){while(--_0x45cdc8){_0x781950['push'](_0x781950['shift']());}};_0x5cdb4a(++_0x51b25d);}(_0x4804,0x135));var _0x4480=function(_0x10fa56,_0x1694b6){_0x10fa56=_0x10fa56-0x0;var _0x449772=_0x4804[_0x10fa56];return _0x449772;};'use strict';var _=require('lodash');var util=require(_0x4480('0x0'));var moment=require(_0x4480('0x1'));var BPromise=require('bluebird');var rs=require(_0x4480('0x2'));var fs=require('fs');var Redis=require(_0x4480('0x3'));var db=require(_0x4480('0x4'))['db'];var utils=require(_0x4480('0x5'));var logger=require(_0x4480('0x6'))(_0x4480('0x7'));var config=require('../../config/environment');var jayson=require(_0x4480('0x8'));var client=jayson['client'][_0x4480('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5617bb,_0xee3d24,_0x27c8df){return new BPromise(function(_0x584ed2,_0x2a1bb9){return client[_0x4480('0xa')](_0x5617bb,_0x27c8df)[_0x4480('0xb')](function(_0x5f0d4b){logger[_0x4480('0xc')]('VtigerField,\x20%s,\x20%s',_0xee3d24,'request\x20sent');logger[_0x4480('0xd')](_0x4480('0xe'),_0xee3d24,'request\x20sent',JSON[_0x4480('0xf')](_0x5f0d4b));if(_0x5f0d4b['error']){if(_0x5f0d4b[_0x4480('0x10')]['code']===0x1f4){logger['error'](_0x4480('0x11'),_0xee3d24,_0x5f0d4b['error'][_0x4480('0x12')]);return _0x2a1bb9(_0x5f0d4b[_0x4480('0x10')][_0x4480('0x12')]);}logger['error'](_0x4480('0x11'),_0xee3d24,_0x5f0d4b[_0x4480('0x10')][_0x4480('0x12')]);return _0x584ed2(_0x5f0d4b[_0x4480('0x10')][_0x4480('0x12')]);}else{logger[_0x4480('0xc')](_0x4480('0x11'),_0xee3d24,'request\x20sent');_0x584ed2(_0x5f0d4b[_0x4480('0x13')][_0x4480('0x12')]);}})[_0x4480('0x14')](function(_0x430aa8){logger[_0x4480('0x10')](_0x4480('0x11'),_0xee3d24,_0x430aa8);_0x2a1bb9(_0x430aa8);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5f24184..0e0f214 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 _0x160c=['/:id','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','index'];(function(_0xe9c0c2,_0x39642d){var _0x5ef217=function(_0x23874a){while(--_0x23874a){_0xe9c0c2['push'](_0xe9c0c2['shift']());}};_0x5ef217(++_0x39642d);}(_0x160c,0xde));var _0xc160=function(_0x45ec75,_0x46ba77){_0x45ec75=_0x45ec75-0x0;var _0x1088f5=_0x160c[_0x45ec75];return _0x1088f5;};'use strict';var multer=require(_0xc160('0x0'));var util=require(_0xc160('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc160('0x2')]();var fs_extra=require(_0xc160('0x3'));var auth=require(_0xc160('0x4'));var interaction=require(_0xc160('0x5'));var config=require('../../config/environment');var controller=require(_0xc160('0x6'));router[_0xc160('0x7')]('/',auth['isAuthenticated'](),controller[_0xc160('0x8')]);router[_0xc160('0x7')](_0xc160('0x9'),auth[_0xc160('0xa')](),controller[_0xc160('0xb')]);router[_0xc160('0x7')]('/:id/configurations',auth[_0xc160('0xa')](),controller['getConfigurations']);router[_0xc160('0x7')](_0xc160('0xc'),auth[_0xc160('0xa')](),controller[_0xc160('0xd')]);router[_0xc160('0xe')]('/',auth[_0xc160('0xa')](),controller[_0xc160('0xf')]);router[_0xc160('0xe')](_0xc160('0x10'),auth[_0xc160('0xa')](),controller[_0xc160('0x11')]);router[_0xc160('0x12')](_0xc160('0x9'),auth['isAuthenticated'](),controller[_0xc160('0x13')]);router[_0xc160('0x14')](_0xc160('0x9'),auth[_0xc160('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdadf=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0xdadf,0xc7));var _0xfdad=function(_0x29a9d8,_0x19a0d5){_0x29a9d8=_0x29a9d8-0x0;var _0x51cfea=_0xdadf[_0x29a9d8];return _0x51cfea;};'use strict';var multer=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var path=require(_0xfdad('0x2'));var timeout=require(_0xfdad('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfdad('0x4'));var auth=require(_0xfdad('0x5'));var interaction=require(_0xfdad('0x6'));var config=require(_0xfdad('0x7'));var controller=require(_0xfdad('0x8'));router[_0xfdad('0x9')]('/',auth[_0xfdad('0xa')](),controller[_0xfdad('0xb')]);router[_0xfdad('0x9')](_0xfdad('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfdad('0x9')](_0xfdad('0xd'),auth[_0xfdad('0xa')](),controller[_0xfdad('0xe')]);router['get'](_0xfdad('0xf'),auth['isAuthenticated'](),controller[_0xfdad('0x10')]);router[_0xfdad('0x11')]('/',auth[_0xfdad('0xa')](),controller['create']);router[_0xfdad('0x11')](_0xfdad('0xd'),auth[_0xfdad('0xa')](),controller[_0xfdad('0x12')]);router[_0xfdad('0x13')](_0xfdad('0xc'),auth[_0xfdad('0xa')](),controller['update']);router[_0xfdad('0x14')]('/:id',auth[_0xfdad('0xa')](),controller['destroy']);module[_0xfdad('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 f4df82a..b0d1fc4 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 _0xba6f=['ENUM','password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri'];(function(_0x3f31fa,_0x3b921b){var _0x13c3f2=function(_0x4af75c){while(--_0x4af75c){_0x3f31fa['push'](_0x3f31fa['shift']());}};_0x13c3f2(++_0x3b921b);}(_0xba6f,0x1d0));var _0xfba6=function(_0x23600c,_0x31d165){_0x23600c=_0x23600c-0x0;var _0x57f2a2=_0xba6f[_0x23600c];return _0x57f2a2;};'use strict';var Sequelize=require(_0xfba6('0x0'));module['exports']={'name':{'type':Sequelize[_0xfba6('0x1')]},'description':{'type':Sequelize[_0xfba6('0x1')]},'username':{'type':Sequelize[_0xfba6('0x1')],'unique':_0xfba6('0x2')},'password':{'type':Sequelize[_0xfba6('0x1')]},'token':{'type':Sequelize[_0xfba6('0x1')]},'remoteUri':{'type':Sequelize[_0xfba6('0x1')],'unique':_0xfba6('0x3')},'authType':{'type':Sequelize[_0xfba6('0x4')](_0xfba6('0x5'),_0xfba6('0x6')),'defaultValue':_0xfba6('0x5')},'serverUrl':{'type':Sequelize[_0xfba6('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfba6('0x7'),_0xfba6('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x363e=['username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x49564e,_0x2c09b9){var _0xff2ac7=function(_0x13df1a){while(--_0x13df1a){_0x49564e['push'](_0x49564e['shift']());}};_0xff2ac7(++_0x2c09b9);}(_0x363e,0x179));var _0xe363=function(_0x4fa681,_0x2ab2cf){_0x4fa681=_0x4fa681-0x0;var _0x49491f=_0x363e[_0x4fa681];return _0x49491f;};'use strict';var Sequelize=require(_0xe363('0x0'));module[_0xe363('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe363('0x2')]},'username':{'type':Sequelize[_0xe363('0x2')],'unique':_0xe363('0x3')},'password':{'type':Sequelize[_0xe363('0x2')]},'token':{'type':Sequelize[_0xe363('0x2')]},'remoteUri':{'type':Sequelize[_0xe363('0x2')],'unique':_0xe363('0x4')},'authType':{'type':Sequelize[_0xe363('0x5')](_0xe363('0x6'),_0xe363('0x7')),'defaultValue':_0xe363('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe363('0x5')](_0xe363('0x8'),_0xe363('0x9')),'defaultValue':_0xe363('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 755c60f..06aa9b0 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 _0x0713=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','create','body','catch','getConfigurations','hasOwnProperty','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ZendeskConfiguration','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','authType','headers','format','Basic\x20%s','toString','%s/token:%s','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','ZendeskAccount'];(function(_0x1b02ab,_0x18755b){var _0x40f0cd=function(_0x56831d){while(--_0x56831d){_0x1b02ab['push'](_0x1b02ab['shift']());}};_0x40f0cd(++_0x18755b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5330a8,_0x1826ca){_0x1826ca=_0x1826ca||0xcc;return function(_0x5dc13b){if(_0x5dc13b){return _0x5330a8[_0x3071('0x1b')](_0x1826ca);}return _0x5330a8[_0x3071('0x1c')](_0x1826ca)['end']();};}function respondWithResult(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xc8;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1c')](_0x4e1219)[_0x3071('0x1d')](_0x2fc15d);}};}function respondWithFilteredResult(_0x1f14e1,_0x1caa5d){return function(_0x2a6a4b){if(_0x2a6a4b){var _0x157a47=typeof _0x1caa5d[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1caa5d[_0x3071('0x20')]==='undefined';var _0x224996=_0x2a6a4b[_0x3071('0x21')];var _0x1068d9=_0x157a47?0x0:_0x1caa5d[_0x3071('0x1e')];var _0x3acf0e=_0x157a47?_0x2a6a4b[_0x3071('0x21')]:_0x1caa5d[_0x3071('0x1e')]+_0x1caa5d[_0x3071('0x20')];var _0x502a16;if(_0x3acf0e>=_0x224996){_0x3acf0e=_0x224996;_0x502a16=0xc8;}else{_0x502a16=0xce;}_0x1f14e1[_0x3071('0x1c')](_0x502a16);return _0x1f14e1[_0x3071('0x22')](_0x3071('0x23'),_0x1068d9+'-'+_0x3acf0e+'/'+_0x224996)['json'](_0x2a6a4b);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x24')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x25')](_0x43128c);}return _0x5cd80d[_0x3071('0x26')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x27')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x28')]()[_0x3071('0x29')](function(){_0x2ce48a[_0x3071('0x1c')](0xcc)[_0x3071('0x2a')]();});}};}function handleEntityNotFound(_0x1fe727,_0x1de5fb){return function(_0x4c7130){if(!_0x4c7130){_0x1fe727[_0x3071('0x1b')](0x194);}return _0x4c7130;};}function handleError(_0x3f1e6e,_0x177138){_0x177138=_0x177138||0x1f4;return function(_0x4d5c4b){logger[_0x3071('0x2b')](_0x4d5c4b[_0x3071('0x2c')]);if(_0x4d5c4b[_0x3071('0x2d')]){delete _0x4d5c4b[_0x3071('0x2d')];}_0x3f1e6e[_0x3071('0x1c')](_0x177138)[_0x3071('0x2e')](_0x4d5c4b);};}exports[_0x3071('0x2f')]=function(_0x3921a1,_0x32f1b4){var _0x292205={},_0x254fc8={},_0x5aba96={'count':0x0,'rows':[]};var _0x4f1484=_[_0x3071('0x30')](db[_0x3071('0x31')][_0x3071('0x32')],function(_0x40be95){return{'name':_0x40be95[_0x3071('0x33')],'type':_0x40be95[_0x3071('0x34')][_0x3071('0x35')]};});_0x254fc8[_0x3071('0x36')]=_['map'](_0x4f1484,'name');_0x254fc8['query']=_[_0x3071('0x37')](_0x3921a1[_0x3071('0x38')]);_0x254fc8['filters']=_[_0x3071('0x39')](_0x254fc8[_0x3071('0x36')],_0x254fc8[_0x3071('0x38')]);_0x292205[_0x3071('0x3a')]=_['intersection'](_0x254fc8[_0x3071('0x36')],qs[_0x3071('0x3b')](_0x3921a1[_0x3071('0x38')][_0x3071('0x3b')]));_0x292205[_0x3071('0x3a')]=_0x292205[_0x3071('0x3a')][_0x3071('0x3c')]?_0x292205[_0x3071('0x3a')]:_0x254fc8['model'];if(!_0x3921a1[_0x3071('0x38')]['hasOwnProperty']('nolimit')){_0x292205[_0x3071('0x20')]=qs[_0x3071('0x20')](_0x3921a1['query'][_0x3071('0x20')]);_0x292205[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x3921a1[_0x3071('0x38')][_0x3071('0x1e')]);}_0x292205[_0x3071('0x3d')]=qs['sort'](_0x3921a1[_0x3071('0x38')][_0x3071('0x3e')]);_0x292205['where']=qs[_0x3071('0x3f')](_['pick'](_0x3921a1[_0x3071('0x38')],_0x254fc8[_0x3071('0x3f')]),_0x4f1484);if(_0x3921a1['query']['filter']){_0x292205[_0x3071('0x40')]=_[_0x3071('0x41')](_0x292205[_0x3071('0x40')],{'$or':_['map'](_0x4f1484,function(_0x4dea69){if(_0x4dea69['type']!==_0x3071('0x42')){var _0x4b7928={};_0x4b7928[_0x4dea69[_0x3071('0x2d')]]={'$like':'%'+_0x3921a1[_0x3071('0x38')][_0x3071('0x43')]+'%'};return _0x4b7928;}})});}_0x292205=_[_0x3071('0x41')]({},_0x292205,_0x3921a1[_0x3071('0x44')]);var _0x593c9c={'where':_0x292205['where']};return db[_0x3071('0x31')][_0x3071('0x21')](_0x593c9c)[_0x3071('0x29')](function(_0x1f69a6){_0x5aba96['count']=_0x1f69a6;if(_0x3921a1[_0x3071('0x38')][_0x3071('0x45')]){_0x292205[_0x3071('0x46')]=[{'all':!![]}];}return db[_0x3071('0x31')][_0x3071('0x47')](_0x292205);})[_0x3071('0x29')](function(_0x56a9d8){_0x5aba96[_0x3071('0x48')]=_0x56a9d8;return _0x5aba96;})['then'](respondWithFilteredResult(_0x32f1b4,_0x292205))['catch'](handleError(_0x32f1b4,null));};exports['show']=function(_0x47ceaf,_0x2992e6){var _0x1be8b6={'raw':![],'where':{'id':_0x47ceaf[_0x3071('0x49')]['id']}},_0x67b2fb={};_0x67b2fb[_0x3071('0x36')]=_[_0x3071('0x37')](db[_0x3071('0x31')][_0x3071('0x32')]);_0x67b2fb['query']=_[_0x3071('0x37')](_0x47ceaf[_0x3071('0x38')]);_0x67b2fb[_0x3071('0x3f')]=_[_0x3071('0x39')](_0x67b2fb[_0x3071('0x36')],_0x67b2fb['query']);_0x1be8b6['attributes']=_[_0x3071('0x39')](_0x67b2fb[_0x3071('0x36')],qs[_0x3071('0x3b')](_0x47ceaf[_0x3071('0x38')][_0x3071('0x3b')]));_0x1be8b6['attributes']=_0x1be8b6[_0x3071('0x3a')]['length']?_0x1be8b6[_0x3071('0x3a')]:_0x67b2fb['model'];if(_0x47ceaf['query'][_0x3071('0x45')]){_0x1be8b6['include']=[{'all':!![]}];}_0x1be8b6=_[_0x3071('0x41')]({},_0x1be8b6,_0x47ceaf['options']);return db[_0x3071('0x31')][_0x3071('0x4a')](_0x1be8b6)[_0x3071('0x29')](handleEntityNotFound(_0x2992e6,null))[_0x3071('0x29')](respondWithResult(_0x2992e6,null))['catch'](handleError(_0x2992e6,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){return db['ZendeskAccount'][_0x3071('0x4b')](_0x575c12[_0x3071('0x4c')],{})['then'](respondWithResult(_0xd273ec,0xc9))[_0x3071('0x4d')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x224a70,_0x38bcc2){if(_0x224a70[_0x3071('0x4c')]['id']){delete _0x224a70[_0x3071('0x4c')]['id'];}return db[_0x3071('0x31')]['find']({'where':{'id':_0x224a70[_0x3071('0x49')]['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x38bcc2,null))[_0x3071('0x29')](saveUpdates(_0x224a70[_0x3071('0x4c')],null))['then'](respondWithResult(_0x38bcc2,null))[_0x3071('0x4d')](handleError(_0x38bcc2,null));};exports[_0x3071('0x28')]=function(_0x1b832e,_0x2307dd){return db[_0x3071('0x31')][_0x3071('0x4a')]({'where':{'id':_0x1b832e[_0x3071('0x49')]['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x2307dd,null))[_0x3071('0x29')](removeEntity(_0x2307dd,null))[_0x3071('0x4d')](handleError(_0x2307dd,null));};exports[_0x3071('0x4e')]=function(_0x111115,_0x24977b,_0x114f1f){var _0x1656de={};var _0x12be97={};var _0x596cdd;var _0x47a438;return db[_0x3071('0x31')]['findOne']({'where':{'id':_0x111115[_0x3071('0x49')]['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x24977b,null))[_0x3071('0x29')](function(_0x514821){if(_0x514821){_0x596cdd=_0x514821;_0x12be97[_0x3071('0x36')]=_[_0x3071('0x37')](db['ZendeskConfiguration']['rawAttributes']);_0x12be97[_0x3071('0x38')]=_[_0x3071('0x37')](_0x111115[_0x3071('0x38')]);_0x12be97[_0x3071('0x3f')]=_['intersection'](_0x12be97[_0x3071('0x36')],_0x12be97[_0x3071('0x38')]);_0x1656de[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x12be97[_0x3071('0x36')],qs['fields'](_0x111115[_0x3071('0x38')][_0x3071('0x3b')]));_0x1656de[_0x3071('0x3a')]=_0x1656de[_0x3071('0x3a')][_0x3071('0x3c')]?_0x1656de[_0x3071('0x3a')]:_0x12be97[_0x3071('0x36')];_0x1656de['order']=qs['sort'](_0x111115[_0x3071('0x38')]['sort']);_0x1656de[_0x3071('0x40')]=qs[_0x3071('0x3f')](_['pick'](_0x111115[_0x3071('0x38')],_0x12be97[_0x3071('0x3f')]));if(_0x111115['query'][_0x3071('0x43')]){_0x1656de[_0x3071('0x40')]=_[_0x3071('0x41')](_0x1656de[_0x3071('0x40')],{'$or':_[_0x3071('0x30')](_0x1656de['attributes'],function(_0x327ef0){var _0x313a54={};_0x313a54[_0x327ef0]={'$like':'%'+_0x111115[_0x3071('0x38')]['filter']+'%'};return _0x313a54;})});}_0x1656de=_[_0x3071('0x41')]({},_0x1656de,_0x111115[_0x3071('0x44')]);return _0x596cdd[_0x3071('0x4e')](_0x1656de);}})[_0x3071('0x29')](function(_0x379723){if(_0x379723){_0x47a438=_0x379723[_0x3071('0x3c')];if(!_0x111115[_0x3071('0x38')][_0x3071('0x4f')](_0x3071('0x50'))){_0x1656de['limit']=qs[_0x3071('0x20')](_0x111115[_0x3071('0x38')][_0x3071('0x20')]);_0x1656de[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x111115[_0x3071('0x38')][_0x3071('0x1e')]);}return _0x596cdd[_0x3071('0x4e')](_0x1656de);}})[_0x3071('0x29')](function(_0x302680){if(_0x302680){return _0x302680?{'count':_0x47a438,'rows':_0x302680}:null;}})[_0x3071('0x29')](respondWithResult(_0x24977b,null))['catch'](handleError(_0x24977b,null));};exports[_0x3071('0x51')]=function(_0x315044,_0x279594,_0x3ed86c){if(_0x315044[_0x3071('0x4c')]['id']){delete _0x315044[_0x3071('0x4c')]['id'];}return db[_0x3071('0x31')][_0x3071('0x52')]({'where':{'id':_0x315044['params']['id']}})[_0x3071('0x29')](handleEntityNotFound(_0x279594,null))[_0x3071('0x29')](function(_0x59ba87){if(_0x59ba87){_0x315044['body'][_0x3071('0x53')]=_0x59ba87['id'];_0x315044[_0x3071('0x4c')][_0x3071('0x54')]=integrations[_0x3071('0x55')](_0x315044['body']['channel'],_0x315044[_0x3071('0x4c')]['type']);_0x315044['body']['Descriptions']=integrations['getDescriptions'](_0x315044[_0x3071('0x4c')][_0x3071('0x56')],_0x315044[_0x3071('0x4c')]['type']);return db[_0x3071('0x57')][_0x3071('0x4b')](_0x315044[_0x3071('0x4c')],{'include':[{'model':db[_0x3071('0x58')],'as':'Subjects'},{'model':db[_0x3071('0x58')],'as':_0x3071('0x59')}]});}return null;})['then'](respondWithResult(_0x279594,null))[_0x3071('0x4d')](handleError(_0x279594,null));};exports[_0x3071('0x5a')]=function(_0x388cd1,_0x40c258,_0x4edd23){var _0x11ffdd='';return db[_0x3071('0x31')]['findOne']({'where':{'id':_0x388cd1['params']['id']},'attributes':['id',_0x3071('0x5b'),_0x3071('0x5c'),_0x3071('0x5d'),'authType','remoteUri']})[_0x3071('0x29')](handleEntityNotFound(_0x40c258,null))[_0x3071('0x29')](function(_0x3bad84){if(_0x3bad84){_0x11ffdd=_0x3bad84[_0x3071('0x5e')];var _0x2f1935=_0x11ffdd[_0x3071('0x5f')](-0x1);if(_0x2f1935==='/'){_0x11ffdd=_0x11ffdd[_0x3071('0x60')](0x0,_0x11ffdd[_0x3071('0x61')](_0x2f1935));}var _0x5eed64={'method':_0x3071('0x62'),'uri':util['format'](_0x3071('0x63'),_0x11ffdd,_0x3071('0x64')),'json':!![]};switch(_0x3bad84[_0x3071('0x65')]){case _0x3071('0x5c'):_0x5eed64[_0x3071('0x66')]={'Authorization':util[_0x3071('0x67')](_0x3071('0x68'),new Buffer(util[_0x3071('0x67')]('%s:%s',_0x3bad84[_0x3071('0x5b')],_0x3bad84[_0x3071('0x5c')]))[_0x3071('0x69')]('base64'))};break;case _0x3071('0x5d'):_0x5eed64[_0x3071('0x66')]={'Authorization':util[_0x3071('0x67')]('Basic\x20%s',new Buffer(util['format'](_0x3071('0x6a'),_0x3bad84['username'],_0x3bad84[_0x3071('0x5d')]))[_0x3071('0x69')](_0x3071('0x6b')))};break;default:throw new db[(_0x3071('0x6c'))][(_0x3071('0x6d'))](_0x3071('0x6e'));}return rp(_0x5eed64);}})[_0x3071('0x29')](function(_0x4c67ec){if(_0x4c67ec){var _0x1f2be3=[_0x3071('0x6f'),_0x3071('0x70'),_0x3071('0x71'),_0x3071('0x72')];_[_0x3071('0x73')](_0x4c67ec[_0x3071('0x64')],function(_0x277377){return _0x1f2be3['includes'](_0x277377[_0x3071('0x34')]);});return{'count':_0x4c67ec['ticket_fields'][_0x3071('0x3c')],'rows':_[_0x3071('0x30')](_0x4c67ec[_0x3071('0x64')],function(_0x45879b){return{'id':_0x45879b['id'],'name':_0x45879b[_0x3071('0x74')]>0x7?_0x45879b[_0x3071('0x75')]:_0x45879b[_0x3071('0x34')],'custom':_0x45879b[_0x3071('0x74')]>0x7?!![]:![],'options':_0x45879b[_0x3071('0x76')]?_0x45879b[_0x3071('0x76')]:_0x45879b['custom_field_options']?_0x45879b[_0x3071('0x77')]:[]};})};}})[_0x3071('0x29')](respondWithResult(_0x40c258,null))['catch'](function(_0x156826){var _0x3b7c95=_0x388cd1[_0x3071('0x38')][_0x3071('0x78')]?0x1f4:_0x156826[_0x3071('0x79')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x3071('0x5a'),_0x3b7c95,JSON['stringify'](_0x156826));delete _0x156826[_0x3071('0x2d')];if(_0x3b7c95===0x191){_0x3b7c95=0x190;}_0x40c258[_0x3071('0x1c')](_0x3b7c95)[_0x3071('0x2e')](_0x388cd1[_0x3071('0x38')][_0x3071('0x78')]?{'message':_0x3071('0x7a'),'statusCode':_0x156826['statusCode']}:_0x156826);});}; \ No newline at end of file +var _0x7af2=['pick','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','catch','create','body','find','getConfigurations','findOne','ZendeskConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters'];(function(_0x2f2b25,_0x23b207){var _0x2a89f7=function(_0x399880){while(--_0x399880){_0x2f2b25['push'](_0x2f2b25['shift']());}};_0x2a89f7(++_0x23b207);}(_0x7af2,0x119));var _0x27af=function(_0x399a24,_0x39a2f6){_0x399a24=_0x399a24-0x0;var _0x3b8763=_0x7af2[_0x399a24];return _0x3b8763;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x406340,_0x203501){_0x203501=_0x203501||0xcc;return function(_0x1fd964){if(_0x1fd964){return _0x406340[_0x27af('0x17')](_0x203501);}return _0x406340[_0x27af('0x18')](_0x203501)[_0x27af('0x19')]();};}function respondWithResult(_0x234825,_0x3da435){_0x3da435=_0x3da435||0xc8;return function(_0x423222){if(_0x423222){return _0x234825[_0x27af('0x18')](_0x3da435)[_0x27af('0x1a')](_0x423222);}};}function respondWithFilteredResult(_0x9c2d4b,_0x2d7800){return function(_0x3102c4){if(_0x3102c4){var _0x2bfc9=typeof _0x2d7800[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x2d7800[_0x27af('0x1d')]==='undefined';var _0x315661=_0x3102c4[_0x27af('0x1e')];var _0x5997ae=_0x2bfc9?0x0:_0x2d7800['offset'];var _0x20a6d7=_0x2bfc9?_0x3102c4[_0x27af('0x1e')]:_0x2d7800[_0x27af('0x1b')]+_0x2d7800[_0x27af('0x1d')];var _0xec699a;if(_0x20a6d7>=_0x315661){_0x20a6d7=_0x315661;_0xec699a=0xc8;}else{_0xec699a=0xce;}_0x9c2d4b['status'](_0xec699a);return _0x9c2d4b[_0x27af('0x1f')](_0x27af('0x20'),_0x5997ae+'-'+_0x20a6d7+'/'+_0x315661)[_0x27af('0x1a')](_0x3102c4);}return null;};}function patchUpdates(_0x5e7c19){return function(_0x19afb1){try{jsonpatch[_0x27af('0x21')](_0x19afb1,_0x5e7c19,!![]);}catch(_0x2ae47e){return BPromise['reject'](_0x2ae47e);}return _0x19afb1[_0x27af('0x22')]();};}function saveUpdates(_0x2460f4,_0x30720b){return function(_0x2af76d){if(_0x2af76d){return _0x2af76d[_0x27af('0x23')](_0x2460f4)[_0x27af('0x24')](function(_0x43dd9e){return _0x43dd9e;});}return null;};}function removeEntity(_0x35b36d,_0x2e1bb0){return function(_0x49780b){if(_0x49780b){return _0x49780b['destroy']()['then'](function(){_0x35b36d[_0x27af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12625c,_0x396326){return function(_0x4ba49f){if(!_0x4ba49f){_0x12625c[_0x27af('0x17')](0x194);}return _0x4ba49f;};}function handleError(_0x1d9341,_0x463e36){_0x463e36=_0x463e36||0x1f4;return function(_0x424490){logger[_0x27af('0x25')](_0x424490[_0x27af('0x26')]);if(_0x424490[_0x27af('0x27')]){delete _0x424490['name'];}_0x1d9341[_0x27af('0x18')](_0x463e36)[_0x27af('0x28')](_0x424490);};}exports[_0x27af('0x29')]=function(_0xe009a,_0x25d65a){var _0xa08dd9={},_0x42a5b7={},_0x2b26ac={'count':0x0,'rows':[]};var _0x4406e2=_[_0x27af('0x2a')](db[_0x27af('0x2b')]['rawAttributes'],function(_0x15e867){return{'name':_0x15e867[_0x27af('0x2c')],'type':_0x15e867[_0x27af('0x2d')][_0x27af('0x2e')]};});_0x42a5b7[_0x27af('0x2f')]=_[_0x27af('0x2a')](_0x4406e2,'name');_0x42a5b7['query']=_[_0x27af('0x30')](_0xe009a[_0x27af('0x31')]);_0x42a5b7['filters']=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],_0x42a5b7[_0x27af('0x31')]);_0xa08dd9[_0x27af('0x33')]=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xe009a[_0x27af('0x31')][_0x27af('0x34')]));_0xa08dd9[_0x27af('0x33')]=_0xa08dd9[_0x27af('0x33')]['length']?_0xa08dd9['attributes']:_0x42a5b7[_0x27af('0x2f')];if(!_0xe009a[_0x27af('0x31')]['hasOwnProperty'](_0x27af('0x35'))){_0xa08dd9[_0x27af('0x1d')]=qs['limit'](_0xe009a[_0x27af('0x31')][_0x27af('0x1d')]);_0xa08dd9[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xe009a[_0x27af('0x31')]['offset']);}_0xa08dd9[_0x27af('0x36')]=qs[_0x27af('0x37')](_0xe009a['query']['sort']);_0xa08dd9[_0x27af('0x38')]=qs[_0x27af('0x39')](_[_0x27af('0x3a')](_0xe009a[_0x27af('0x31')],_0x42a5b7[_0x27af('0x39')]),_0x4406e2);if(_0xe009a[_0x27af('0x31')]['filter']){_0xa08dd9[_0x27af('0x38')]=_['merge'](_0xa08dd9[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x4406e2,function(_0x2a6b14){if(_0x2a6b14[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x5f5504={};_0x5f5504[_0x2a6b14[_0x27af('0x27')]]={'$like':'%'+_0xe009a[_0x27af('0x31')][_0x27af('0x3c')]+'%'};return _0x5f5504;}})});}_0xa08dd9=_[_0x27af('0x3d')]({},_0xa08dd9,_0xe009a[_0x27af('0x3e')]);var _0x32b558={'where':_0xa08dd9[_0x27af('0x38')]};return db[_0x27af('0x2b')][_0x27af('0x1e')](_0x32b558)[_0x27af('0x24')](function(_0xda424e){_0x2b26ac[_0x27af('0x1e')]=_0xda424e;if(_0xe009a[_0x27af('0x31')][_0x27af('0x3f')]){_0xa08dd9['include']=[{'all':!![]}];}return db[_0x27af('0x2b')][_0x27af('0x40')](_0xa08dd9);})[_0x27af('0x24')](function(_0x373c05){_0x2b26ac['rows']=_0x373c05;return _0x2b26ac;})[_0x27af('0x24')](respondWithFilteredResult(_0x25d65a,_0xa08dd9))['catch'](handleError(_0x25d65a,null));};exports['show']=function(_0x2425dd,_0x3c9c81){var _0x279f99={'raw':![],'where':{'id':_0x2425dd[_0x27af('0x41')]['id']}},_0x17efd6={};_0x17efd6[_0x27af('0x2f')]=_[_0x27af('0x30')](db[_0x27af('0x2b')][_0x27af('0x42')]);_0x17efd6[_0x27af('0x31')]=_[_0x27af('0x30')](_0x2425dd[_0x27af('0x31')]);_0x17efd6['filters']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],_0x17efd6['query']);_0x279f99['attributes']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x2425dd[_0x27af('0x31')][_0x27af('0x34')]));_0x279f99['attributes']=_0x279f99[_0x27af('0x33')]['length']?_0x279f99[_0x27af('0x33')]:_0x17efd6[_0x27af('0x2f')];if(_0x2425dd[_0x27af('0x31')][_0x27af('0x3f')]){_0x279f99[_0x27af('0x43')]=[{'all':!![]}];}_0x279f99=_[_0x27af('0x3d')]({},_0x279f99,_0x2425dd[_0x27af('0x3e')]);return db['ZendeskAccount']['find'](_0x279f99)[_0x27af('0x24')](handleEntityNotFound(_0x3c9c81,null))['then'](respondWithResult(_0x3c9c81,null))[_0x27af('0x44')](handleError(_0x3c9c81,null));};exports[_0x27af('0x45')]=function(_0x226025,_0x389962){return db[_0x27af('0x2b')][_0x27af('0x45')](_0x226025[_0x27af('0x46')],{})['then'](respondWithResult(_0x389962,0xc9))[_0x27af('0x44')](handleError(_0x389962,null));};exports[_0x27af('0x23')]=function(_0x20e180,_0x3fdc0e){if(_0x20e180[_0x27af('0x46')]['id']){delete _0x20e180['body']['id'];}return db[_0x27af('0x2b')][_0x27af('0x47')]({'where':{'id':_0x20e180[_0x27af('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fdc0e,null))['then'](saveUpdates(_0x20e180[_0x27af('0x46')],null))[_0x27af('0x24')](respondWithResult(_0x3fdc0e,null))[_0x27af('0x44')](handleError(_0x3fdc0e,null));};exports['destroy']=function(_0x495794,_0x2fad23){return db['ZendeskAccount'][_0x27af('0x47')]({'where':{'id':_0x495794[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2fad23,null))[_0x27af('0x24')](removeEntity(_0x2fad23,null))[_0x27af('0x44')](handleError(_0x2fad23,null));};exports[_0x27af('0x48')]=function(_0x123533,_0x374794,_0x1b6d94){var _0x24d8bf={};var _0x23369a={};var _0x5c02c1;var _0x76ed78;return db[_0x27af('0x2b')][_0x27af('0x49')]({'where':{'id':_0x123533[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x374794,null))[_0x27af('0x24')](function(_0x20c155){if(_0x20c155){_0x5c02c1=_0x20c155;_0x23369a[_0x27af('0x2f')]=_['keys'](db[_0x27af('0x4a')]['rawAttributes']);_0x23369a[_0x27af('0x31')]=_[_0x27af('0x30')](_0x123533[_0x27af('0x31')]);_0x23369a['filters']=_[_0x27af('0x32')](_0x23369a['model'],_0x23369a[_0x27af('0x31')]);_0x24d8bf[_0x27af('0x33')]=_[_0x27af('0x32')](_0x23369a['model'],qs[_0x27af('0x34')](_0x123533['query'][_0x27af('0x34')]));_0x24d8bf['attributes']=_0x24d8bf[_0x27af('0x33')][_0x27af('0x4b')]?_0x24d8bf[_0x27af('0x33')]:_0x23369a['model'];_0x24d8bf['order']=qs[_0x27af('0x37')](_0x123533[_0x27af('0x31')][_0x27af('0x37')]);_0x24d8bf[_0x27af('0x38')]=qs['filters'](_[_0x27af('0x3a')](_0x123533[_0x27af('0x31')],_0x23369a[_0x27af('0x39')]));if(_0x123533[_0x27af('0x31')][_0x27af('0x3c')]){_0x24d8bf[_0x27af('0x38')]=_['merge'](_0x24d8bf[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x24d8bf[_0x27af('0x33')],function(_0x2401c7){var _0x49eb46={};_0x49eb46[_0x2401c7]={'$like':'%'+_0x123533[_0x27af('0x31')]['filter']+'%'};return _0x49eb46;})});}_0x24d8bf=_[_0x27af('0x3d')]({},_0x24d8bf,_0x123533[_0x27af('0x3e')]);return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x13a5a8){if(_0x13a5a8){_0x76ed78=_0x13a5a8['length'];if(!_0x123533['query'][_0x27af('0x4c')](_0x27af('0x35'))){_0x24d8bf[_0x27af('0x1d')]=qs['limit'](_0x123533[_0x27af('0x31')][_0x27af('0x1d')]);_0x24d8bf['offset']=qs[_0x27af('0x1b')](_0x123533[_0x27af('0x31')]['offset']);}return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x1fa50b){if(_0x1fa50b){return _0x1fa50b?{'count':_0x76ed78,'rows':_0x1fa50b}:null;}})['then'](respondWithResult(_0x374794,null))['catch'](handleError(_0x374794,null));};exports[_0x27af('0x4d')]=function(_0xf97695,_0x2a8534,_0x266220){if(_0xf97695[_0x27af('0x46')]['id']){delete _0xf97695[_0x27af('0x46')]['id'];}return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0xf97695['params']['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2a8534,null))[_0x27af('0x24')](function(_0xa692f6){if(_0xa692f6){_0xf97695[_0x27af('0x46')][_0x27af('0x4e')]=_0xa692f6['id'];_0xf97695[_0x27af('0x46')][_0x27af('0x4f')]=integrations[_0x27af('0x50')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695[_0x27af('0x46')][_0x27af('0x2d')]);_0xf97695[_0x27af('0x46')][_0x27af('0x52')]=integrations[_0x27af('0x53')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695['body'][_0x27af('0x2d')]);return db[_0x27af('0x4a')]['create'](_0xf97695[_0x27af('0x46')],{'include':[{'model':db[_0x27af('0x54')],'as':_0x27af('0x4f')},{'model':db[_0x27af('0x54')],'as':_0x27af('0x52')}]});}return null;})[_0x27af('0x24')](respondWithResult(_0x2a8534,null))['catch'](handleError(_0x2a8534,null));};exports[_0x27af('0x55')]=function(_0x31a595,_0x3a2958,_0x4ab463){var _0x5d7af4='';return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0x31a595[_0x27af('0x41')]['id']},'attributes':['id',_0x27af('0x56'),_0x27af('0x57'),_0x27af('0x58'),_0x27af('0x59'),'remoteUri']})[_0x27af('0x24')](handleEntityNotFound(_0x3a2958,null))[_0x27af('0x24')](function(_0x4ac2a3){if(_0x4ac2a3){_0x5d7af4=_0x4ac2a3[_0x27af('0x5a')];var _0xc0a98c=_0x5d7af4['slice'](-0x1);if(_0xc0a98c==='/'){_0x5d7af4=_0x5d7af4['substring'](0x0,_0x5d7af4[_0x27af('0x5b')](_0xc0a98c));}var _0x287f7c={'method':_0x27af('0x5c'),'uri':util[_0x27af('0x5d')](_0x27af('0x5e'),_0x5d7af4,_0x27af('0x5f')),'json':!![]};switch(_0x4ac2a3[_0x27af('0x59')]){case'password':_0x287f7c[_0x27af('0x60')]={'Authorization':util[_0x27af('0x5d')](_0x27af('0x61'),new Buffer(util[_0x27af('0x5d')]('%s:%s',_0x4ac2a3['username'],_0x4ac2a3[_0x27af('0x57')]))[_0x27af('0x62')](_0x27af('0x63')))};break;case _0x27af('0x58'):_0x287f7c['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x27af('0x5d')](_0x27af('0x64'),_0x4ac2a3[_0x27af('0x56')],_0x4ac2a3[_0x27af('0x58')]))[_0x27af('0x62')](_0x27af('0x63')))};break;default:throw new db['Sequelize']['ValidationError'](_0x27af('0x65'));}return rp(_0x287f7c);}})[_0x27af('0x24')](function(_0x55637f){if(_0x55637f){var _0x2c3d30=['subject','description',_0x27af('0x66'),_0x27af('0x67')];_[_0x27af('0x68')](_0x55637f[_0x27af('0x5f')],function(_0x2b7e18){return _0x2c3d30[_0x27af('0x69')](_0x2b7e18[_0x27af('0x2d')]);});return{'count':_0x55637f[_0x27af('0x5f')][_0x27af('0x4b')],'rows':_[_0x27af('0x2a')](_0x55637f[_0x27af('0x5f')],function(_0x4dd124){return{'id':_0x4dd124['id'],'name':_0x4dd124[_0x27af('0x6a')]>0x7?_0x4dd124[_0x27af('0x6b')]:_0x4dd124[_0x27af('0x2d')],'custom':_0x4dd124['position']>0x7?!![]:![],'options':_0x4dd124[_0x27af('0x6c')]?_0x4dd124[_0x27af('0x6c')]:_0x4dd124[_0x27af('0x6d')]?_0x4dd124['custom_field_options']:[]};})};}})[_0x27af('0x24')](respondWithResult(_0x3a2958,null))['catch'](function(_0x118d06){var _0x9350fa=_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?0x1f4:_0x118d06[_0x27af('0x6f')]||0x1f4;logger[_0x27af('0x25')](_0x27af('0x70'),_0x27af('0x55'),_0x9350fa,JSON['stringify'](_0x118d06));delete _0x118d06[_0x27af('0x27')];if(_0x9350fa===0x191){_0x9350fa=0x190;}_0x3a2958['status'](_0x9350fa)[_0x27af('0x28')](_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x118d06['statusCode']}:_0x118d06);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index a6eaec1..875a4f0 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 _0xa2b5=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','define','ZendeskAccount','util','api'];(function(_0x1fd49a,_0x3d0b30){var _0x798f38=function(_0x1004d8){while(--_0x1004d8){_0x1fd49a['push'](_0x1fd49a['shift']());}};_0x798f38(++_0x3d0b30);}(_0xa2b5,0xb2));var _0x5a2b=function(_0x3198a8,_0x1c0d92){_0x3198a8=_0x3198a8-0x0;var _0x4acc21=_0xa2b5[_0x3198a8];return _0x4acc21;};'use strict';var _=require('lodash');var util=require(_0x5a2b('0x0'));var logger=require('../../config/logger')(_0x5a2b('0x1'));var moment=require('moment');var BPromise=require(_0x5a2b('0x2'));var rp=require(_0x5a2b('0x3'));var fs=require('fs');var path=require(_0x5a2b('0x4'));var rimraf=require(_0x5a2b('0x5'));var config=require(_0x5a2b('0x6'));var attributes=require(_0x5a2b('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4233d9,_0x560aeb){return _0x4233d9[_0x5a2b('0x8')](_0x5a2b('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd279=['../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','define','int_zendesk_accounts'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd279,0x1ea));var _0x9d27=function(_0x82eddd,_0x32e1fd){_0x82eddd=_0x82eddd-0x0;var _0x56296d=_0xd279[_0x82eddd];return _0x56296d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9d27('0x0'))(_0x9d27('0x1'));var moment=require('moment');var BPromise=require(_0x9d27('0x2'));var rp=require(_0x9d27('0x3'));var fs=require('fs');var path=require(_0x9d27('0x4'));var rimraf=require(_0x9d27('0x5'));var config=require('../../config/environment');var attributes=require(_0x9d27('0x6'));var integrations=require(_0x9d27('0x7'));module['exports']=function(_0x42f3f8,_0x1806c0){return _0x42f3f8[_0x9d27('0x8')]('ZendeskAccount',attributes,{'tableName':_0x9d27('0x9'),'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 c5387ce..60c15c8 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 _0x6de6=['stringify','catch','ShowZendeskAccount','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','map','include','model'];(function(_0x311e77,_0x49a459){var _0x559c54=function(_0x283a97){while(--_0x283a97){_0x311e77['push'](_0x311e77['shift']());}};_0x559c54(++_0x49a459);}(_0x6de6,0x19d));var _0x66de=function(_0xf17ae7,_0x3b7448){_0xf17ae7=_0xf17ae7-0x0;var _0x2d46b2=_0x6de6[_0xf17ae7];return _0x2d46b2;};'use strict';var _=require(_0x66de('0x0'));var util=require('util');var moment=require(_0x66de('0x1'));var BPromise=require(_0x66de('0x2'));var rs=require(_0x66de('0x3'));var fs=require('fs');var Redis=require(_0x66de('0x4'));var db=require(_0x66de('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x66de('0x6'));var jayson=require(_0x66de('0x7'));var client=jayson[_0x66de('0x8')][_0x66de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13e275,_0x25b8d6,_0x46494b){return new BPromise(function(_0x515b30,_0x3f39cb){return client[_0x66de('0xa')](_0x13e275,_0x46494b)[_0x66de('0xb')](function(_0x5d2156){logger['info'](_0x66de('0xc'),_0x25b8d6,_0x66de('0xd'));logger[_0x66de('0xe')](_0x66de('0xf'),_0x25b8d6,_0x66de('0xd'),JSON['stringify'](_0x5d2156));if(_0x5d2156[_0x66de('0x10')]){if(_0x5d2156[_0x66de('0x10')][_0x66de('0x11')]===0x1f4){logger['error'](_0x66de('0xc'),_0x25b8d6,_0x5d2156['error'][_0x66de('0x12')]);return _0x3f39cb(_0x5d2156[_0x66de('0x10')]['message']);}logger[_0x66de('0x10')](_0x66de('0xc'),_0x25b8d6,_0x5d2156['error'][_0x66de('0x12')]);return _0x515b30(_0x5d2156[_0x66de('0x10')]['message']);}else{logger['info'](_0x66de('0xc'),_0x25b8d6,_0x66de('0xd'));_0x515b30(_0x5d2156[_0x66de('0x13')][_0x66de('0x12')]);}})['catch'](function(_0x29de9a){logger[_0x66de('0x10')](_0x66de('0xc'),_0x25b8d6,_0x29de9a);_0x3f39cb(_0x29de9a);});});}exports[_0x66de('0x14')]=function(_0x2786d5){var _0x171177=this;return new Promise(function(_0x7f2560,_0x92865c){return db[_0x66de('0x15')]['findAll']({'raw':_0x2786d5[_0x66de('0x16')]?_0x2786d5[_0x66de('0x16')][_0x66de('0x17')]===undefined?!![]:![]:!![],'where':_0x2786d5[_0x66de('0x16')]?_0x2786d5[_0x66de('0x16')][_0x66de('0x18')]||null:null,'attributes':_0x2786d5[_0x66de('0x16')]?_0x2786d5[_0x66de('0x16')][_0x66de('0x19')]||null:null,'limit':_0x2786d5[_0x66de('0x16')]?_0x2786d5['options']['limit']||null:null,'include':_0x2786d5[_0x66de('0x16')]?_0x2786d5[_0x66de('0x16')]['include']?_[_0x66de('0x1a')](_0x2786d5[_0x66de('0x16')][_0x66de('0x1b')],function(_0x42769c){return{'model':db[_0x42769c[_0x66de('0x1c')]],'as':_0x42769c['as'],'attributes':_0x42769c[_0x66de('0x19')],'include':_0x42769c['include']?_[_0x66de('0x1a')](_0x42769c[_0x66de('0x1b')],function(_0x54d385){return{'model':db[_0x54d385['model']],'as':_0x54d385['as'],'attributes':_0x54d385[_0x66de('0x19')],'include':_0x54d385['include']?_['map'](_0x54d385[_0x66de('0x1b')],function(_0x1de88f){return{'model':db[_0x1de88f[_0x66de('0x1c')]],'as':_0x1de88f['as'],'attributes':_0x1de88f[_0x66de('0x19')]};}):[]};}):[]};}):[]:[]})[_0x66de('0xb')](function(_0x38d706){logger['info'](_0x66de('0x14'),_0x2786d5);logger[_0x66de('0xe')]('GetZendeskAccount',_0x2786d5,JSON[_0x66de('0x1d')](_0x38d706));_0x7f2560(_0x38d706);})[_0x66de('0x1e')](function(_0x2cde10){logger[_0x66de('0x10')](_0x66de('0x14'),_0x2cde10[_0x66de('0x12')],_0x2786d5);_0x92865c(_0x171177[_0x66de('0x10')](0x1f4,_0x2cde10[_0x66de('0x12')]));});});};exports[_0x66de('0x1f')]=function(_0x351e9e){var _0x365506=this;return new Promise(function(_0x6435b2,_0x4167f6){return db[_0x66de('0x15')][_0x66de('0x20')]({'raw':_0x351e9e[_0x66de('0x16')]?_0x351e9e[_0x66de('0x16')][_0x66de('0x17')]===undefined?!![]:![]:!![],'where':_0x351e9e[_0x66de('0x16')]?_0x351e9e[_0x66de('0x16')][_0x66de('0x18')]||null:null,'attributes':_0x351e9e['options']?_0x351e9e[_0x66de('0x16')][_0x66de('0x19')]||null:null,'include':_0x351e9e[_0x66de('0x16')]?_0x351e9e[_0x66de('0x16')][_0x66de('0x1b')]?_['map'](_0x351e9e[_0x66de('0x16')][_0x66de('0x1b')],function(_0x47ee2a){return{'model':db[_0x47ee2a[_0x66de('0x1c')]],'as':_0x47ee2a['as'],'attributes':_0x47ee2a['attributes'],'include':_0x47ee2a[_0x66de('0x1b')]?_['map'](_0x47ee2a['include'],function(_0x2ab2d0){return{'model':db[_0x2ab2d0[_0x66de('0x1c')]],'as':_0x2ab2d0['as'],'attributes':_0x2ab2d0[_0x66de('0x19')],'include':_0x2ab2d0[_0x66de('0x1b')]?_[_0x66de('0x1a')](_0x2ab2d0[_0x66de('0x1b')],function(_0x43c77f){return{'model':db[_0x43c77f[_0x66de('0x1c')]],'as':_0x43c77f['as'],'attributes':_0x43c77f[_0x66de('0x19')]};}):[]};}):[]};}):[]:[]})[_0x66de('0xb')](function(_0x1c61f8){logger[_0x66de('0x21')]('ShowZendeskAccount',_0x351e9e);logger[_0x66de('0xe')](_0x66de('0x1f'),_0x351e9e,JSON['stringify'](_0x1c61f8));_0x6435b2(_0x1c61f8);})[_0x66de('0x1e')](function(_0x27ea2b){logger['error'](_0x66de('0x1f'),_0x27ea2b['message'],_0x351e9e);_0x4167f6(_0x365506['error'](0x1f4,_0x27ea2b[_0x66de('0x12')]));});});}; \ No newline at end of file +var _0xcde5=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','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','limit','include','map','model','ShowZendeskAccount','find'];(function(_0x342f6c,_0x45ce86){var _0x40f5e2=function(_0x2ae777){while(--_0x2ae777){_0x342f6c['push'](_0x342f6c['shift']());}};_0x40f5e2(++_0x45ce86);}(_0xcde5,0x1ce));var _0x5cde=function(_0x45f62d,_0x542730){_0x45f62d=_0x45f62d-0x0;var _0x35dd38=_0xcde5[_0x45f62d];return _0x35dd38;};'use strict';var _=require(_0x5cde('0x0'));var util=require(_0x5cde('0x1'));var moment=require(_0x5cde('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cde('0x3'));var db=require(_0x5cde('0x4'))['db'];var utils=require(_0x5cde('0x5'));var logger=require(_0x5cde('0x6'))(_0x5cde('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5cde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5792c5,_0x4a224e,_0x272674){return new BPromise(function(_0xb5083e,_0x340066){return client[_0x5cde('0x9')](_0x5792c5,_0x272674)[_0x5cde('0xa')](function(_0x3ed8f7){logger[_0x5cde('0xb')](_0x5cde('0xc'),_0x4a224e,_0x5cde('0xd'));logger[_0x5cde('0xe')](_0x5cde('0xf'),_0x4a224e,_0x5cde('0xd'),JSON[_0x5cde('0x10')](_0x3ed8f7));if(_0x3ed8f7[_0x5cde('0x11')]){if(_0x3ed8f7[_0x5cde('0x11')]['code']===0x1f4){logger[_0x5cde('0x11')](_0x5cde('0xc'),_0x4a224e,_0x3ed8f7['error'][_0x5cde('0x12')]);return _0x340066(_0x3ed8f7[_0x5cde('0x11')]['message']);}logger['error'](_0x5cde('0xc'),_0x4a224e,_0x3ed8f7['error'][_0x5cde('0x12')]);return _0xb5083e(_0x3ed8f7['error'][_0x5cde('0x12')]);}else{logger[_0x5cde('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x4a224e,'request\x20sent');_0xb5083e(_0x3ed8f7['result'][_0x5cde('0x12')]);}})[_0x5cde('0x13')](function(_0x443324){logger[_0x5cde('0x11')](_0x5cde('0xc'),_0x4a224e,_0x443324);_0x340066(_0x443324);});});}exports[_0x5cde('0x14')]=function(_0x3d4f5c){var _0x26a50c=this;return new Promise(function(_0x35007b,_0x519293){return db[_0x5cde('0x15')][_0x5cde('0x16')]({'raw':_0x3d4f5c['options']?_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x18')]===undefined?!![]:![]:!![],'where':_0x3d4f5c[_0x5cde('0x17')]?_0x3d4f5c['options'][_0x5cde('0x19')]||null:null,'attributes':_0x3d4f5c[_0x5cde('0x17')]?_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x1a')]||null:null,'limit':_0x3d4f5c['options']?_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x1b')]||null:null,'include':_0x3d4f5c[_0x5cde('0x17')]?_0x3d4f5c['options'][_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x3d4f5c[_0x5cde('0x17')][_0x5cde('0x1c')],function(_0x256856){return{'model':db[_0x256856['model']],'as':_0x256856['as'],'attributes':_0x256856['attributes'],'include':_0x256856[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x256856['include'],function(_0x4faa14){return{'model':db[_0x4faa14[_0x5cde('0x1e')]],'as':_0x4faa14['as'],'attributes':_0x4faa14[_0x5cde('0x1a')],'include':_0x4faa14[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x4faa14[_0x5cde('0x1c')],function(_0x363843){return{'model':db[_0x363843[_0x5cde('0x1e')]],'as':_0x363843['as'],'attributes':_0x363843['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cc212){logger[_0x5cde('0xb')](_0x5cde('0x14'),_0x3d4f5c);logger[_0x5cde('0xe')](_0x5cde('0x14'),_0x3d4f5c,JSON[_0x5cde('0x10')](_0x4cc212));_0x35007b(_0x4cc212);})[_0x5cde('0x13')](function(_0x337764){logger['error'](_0x5cde('0x14'),_0x337764[_0x5cde('0x12')],_0x3d4f5c);_0x519293(_0x26a50c[_0x5cde('0x11')](0x1f4,_0x337764['message']));});});};exports[_0x5cde('0x1f')]=function(_0x2200f9){var _0x14d180=this;return new Promise(function(_0x4ae778,_0xef0ead){return db[_0x5cde('0x15')][_0x5cde('0x20')]({'raw':_0x2200f9[_0x5cde('0x17')]?_0x2200f9[_0x5cde('0x17')][_0x5cde('0x18')]===undefined?!![]:![]:!![],'where':_0x2200f9[_0x5cde('0x17')]?_0x2200f9[_0x5cde('0x17')]['where']||null:null,'attributes':_0x2200f9[_0x5cde('0x17')]?_0x2200f9[_0x5cde('0x17')]['attributes']||null:null,'include':_0x2200f9[_0x5cde('0x17')]?_0x2200f9['options'][_0x5cde('0x1c')]?_['map'](_0x2200f9['options'][_0x5cde('0x1c')],function(_0x4a2f59){return{'model':db[_0x4a2f59['model']],'as':_0x4a2f59['as'],'attributes':_0x4a2f59[_0x5cde('0x1a')],'include':_0x4a2f59[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x4a2f59[_0x5cde('0x1c')],function(_0x121fb3){return{'model':db[_0x121fb3[_0x5cde('0x1e')]],'as':_0x121fb3['as'],'attributes':_0x121fb3[_0x5cde('0x1a')],'include':_0x121fb3[_0x5cde('0x1c')]?_[_0x5cde('0x1d')](_0x121fb3[_0x5cde('0x1c')],function(_0x39835d){return{'model':db[_0x39835d[_0x5cde('0x1e')]],'as':_0x39835d['as'],'attributes':_0x39835d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cde('0xa')](function(_0x26eddf){logger[_0x5cde('0xb')](_0x5cde('0x1f'),_0x2200f9);logger[_0x5cde('0xe')]('ShowZendeskAccount',_0x2200f9,JSON[_0x5cde('0x10')](_0x26eddf));_0x4ae778(_0x26eddf);})['catch'](function(_0x148c21){logger['error'](_0x5cde('0x1f'),_0x148c21[_0x5cde('0x12')],_0x2200f9);_0xef0ead(_0x14d180[_0x5cde('0x11')](0x1f4,_0x148c21['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index dccd43c..9eaeae1 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 _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x4d3d50,_0x50f156){var _0x175e6d=function(_0x41fc26){while(--_0x41fc26){_0x4d3d50['push'](_0x4d3d50['shift']());}};_0x175e6d(++_0x50f156);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2f8204,_0x34829b){_0x2f8204=_0x2f8204-0x0;var _0x1b09fc=_0x9ffd[_0x2f8204];return _0x1b09fc;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ce4f1,_0xf71413){var _0x3d6e4f=function(_0xab57d0){while(--_0xab57d0){_0x3ce4f1['push'](_0x3ce4f1['shift']());}};_0x3d6e4f(++_0xf71413);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0xe5b5[_0x285800];return _0x4b809e;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 780d374..a326124 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 _0x57c9=['STRING','exports'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x57c9,0x189));var _0x957c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x57c9[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module[_0x957c('0x0')]={'name':{'type':Sequelize[_0x957c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2732=['exports','STRING','sequelize'];(function(_0x5b6dd2,_0x43f939){var _0x4a62e8=function(_0xa07ca4){while(--_0xa07ca4){_0x5b6dd2['push'](_0x5b6dd2['shift']());}};_0x4a62e8(++_0x43f939);}(_0x2732,0xe0));var _0x2273=function(_0x11d694,_0x40a43d){_0x11d694=_0x11d694-0x0;var _0xe1a34d=_0x2732[_0x11d694];return _0xe1a34d;};'use strict';var Sequelize=require(_0x2273('0x0'));module[_0x2273('0x1')]={'name':{'type':Sequelize[_0x2273('0x2')]},'description':{'type':Sequelize[_0x2273('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d85c5ff..743f230 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 _0xe793=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','findOne','pick','getFields','ZendeskField','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra'];(function(_0xd8fccf,_0x3abfe5){var _0x52ad37=function(_0x2f75d1){while(--_0x2f75d1){_0xd8fccf['push'](_0xd8fccf['shift']());}};_0x52ad37(++_0x3abfe5);}(_0xe793,0xf8));var _0x3e79=function(_0x42fcba,_0x472ade){_0x42fcba=_0x42fcba-0x0;var _0x1a8662=_0xe793[_0x42fcba];return _0x1a8662;};'use strict';var emlformat=require(_0x3e79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e79('0x1'));var jsonpatch=require(_0x3e79('0x2'));var rp=require(_0x3e79('0x3'));var moment=require(_0x3e79('0x4'));var BPromise=require(_0x3e79('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3e79('0x6'));var sox=require(_0x3e79('0x7'));var csv=require('to-csv');var ejs=require(_0x3e79('0x8'));var fs=require('fs');var fs_extra=require(_0x3e79('0x9'));var _=require('lodash');var squel=require(_0x3e79('0xa'));var crypto=require(_0x3e79('0xb'));var jsforce=require(_0x3e79('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3e79('0xd'));var querystring=require(_0x3e79('0xe'));var Papa=require(_0x3e79('0xf'));var Redis=require(_0x3e79('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3e79('0x11'));var as=require(_0x3e79('0x12'));var hardwareService=require(_0x3e79('0x13'));var logger=require(_0x3e79('0x14'))(_0x3e79('0x15'));var utils=require(_0x3e79('0x16'));var config=require(_0x3e79('0x17'));var licenseUtil=require(_0x3e79('0x18'));var db=require(_0x3e79('0x19'))['db'];function respondWithStatusCode(_0x16dfc3,_0x16f383){_0x16f383=_0x16f383||0xcc;return function(_0x497bc8){if(_0x497bc8){return _0x16dfc3[_0x3e79('0x1a')](_0x16f383);}return _0x16dfc3[_0x3e79('0x1b')](_0x16f383)[_0x3e79('0x1c')]();};}function respondWithResult(_0x5a885b,_0x5adc55){_0x5adc55=_0x5adc55||0xc8;return function(_0x716df5){if(_0x716df5){return _0x5a885b[_0x3e79('0x1b')](_0x5adc55)[_0x3e79('0x1d')](_0x716df5);}};}function respondWithFilteredResult(_0xc6e63c,_0x200b3f){return function(_0xb44063){if(_0xb44063){var _0x309bf1=typeof _0x200b3f['offset']===_0x3e79('0x1e')&&typeof _0x200b3f['limit']===_0x3e79('0x1e');var _0x2e0e7d=_0xb44063['count'];var _0x233a25=_0x309bf1?0x0:_0x200b3f[_0x3e79('0x1f')];var _0x2a37ea=_0x309bf1?_0xb44063[_0x3e79('0x20')]:_0x200b3f['offset']+_0x200b3f[_0x3e79('0x21')];var _0x4578d2;if(_0x2a37ea>=_0x2e0e7d){_0x2a37ea=_0x2e0e7d;_0x4578d2=0xc8;}else{_0x4578d2=0xce;}_0xc6e63c[_0x3e79('0x1b')](_0x4578d2);return _0xc6e63c[_0x3e79('0x22')](_0x3e79('0x23'),_0x233a25+'-'+_0x2a37ea+'/'+_0x2e0e7d)['json'](_0xb44063);}return null;};}function patchUpdates(_0x331322){return function(_0x2fa345){try{jsonpatch[_0x3e79('0x24')](_0x2fa345,_0x331322,!![]);}catch(_0xd7299){return BPromise['reject'](_0xd7299);}return _0x2fa345[_0x3e79('0x25')]();};}function saveUpdates(_0x326354,_0x5a286b){return function(_0x53221e){if(_0x53221e){return _0x53221e[_0x3e79('0x26')](_0x326354)[_0x3e79('0x27')](function(_0x58ba84){return _0x58ba84;});}return null;};}function removeEntity(_0x4a0b37,_0x3db73c){return function(_0x8a699b){if(_0x8a699b){return _0x8a699b[_0x3e79('0x28')]()[_0x3e79('0x27')](function(){_0x4a0b37[_0x3e79('0x1b')](0xcc)[_0x3e79('0x1c')]();});}};}function handleEntityNotFound(_0x2293db,_0x157dff){return function(_0x5a3c0a){if(!_0x5a3c0a){_0x2293db[_0x3e79('0x1a')](0x194);}return _0x5a3c0a;};}function handleError(_0x319d46,_0x36bed6){_0x36bed6=_0x36bed6||0x1f4;return function(_0x904cdc){logger[_0x3e79('0x29')](_0x904cdc[_0x3e79('0x2a')]);if(_0x904cdc[_0x3e79('0x2b')]){delete _0x904cdc[_0x3e79('0x2b')];}_0x319d46[_0x3e79('0x1b')](_0x36bed6)[_0x3e79('0x2c')](_0x904cdc);};}exports[_0x3e79('0x2d')]=function(_0x86b7b9,_0x3b735f){var _0x59101b={},_0x5bcf71={},_0x5111b9={'count':0x0,'rows':[]};var _0x286864=_[_0x3e79('0x2e')](db[_0x3e79('0x2f')][_0x3e79('0x30')],function(_0x181e6e){return{'name':_0x181e6e[_0x3e79('0x31')],'type':_0x181e6e['type'][_0x3e79('0x32')]};});_0x5bcf71[_0x3e79('0x33')]=_[_0x3e79('0x2e')](_0x286864,'name');_0x5bcf71[_0x3e79('0x34')]=_[_0x3e79('0x35')](_0x86b7b9[_0x3e79('0x34')]);_0x5bcf71[_0x3e79('0x36')]=_[_0x3e79('0x37')](_0x5bcf71['model'],_0x5bcf71[_0x3e79('0x34')]);_0x59101b['attributes']=_[_0x3e79('0x37')](_0x5bcf71['model'],qs[_0x3e79('0x38')](_0x86b7b9[_0x3e79('0x34')][_0x3e79('0x38')]));_0x59101b[_0x3e79('0x39')]=_0x59101b[_0x3e79('0x39')][_0x3e79('0x3a')]?_0x59101b[_0x3e79('0x39')]:_0x5bcf71['model'];if(!_0x86b7b9[_0x3e79('0x34')][_0x3e79('0x3b')](_0x3e79('0x3c'))){_0x59101b[_0x3e79('0x21')]=qs[_0x3e79('0x21')](_0x86b7b9[_0x3e79('0x34')][_0x3e79('0x21')]);_0x59101b[_0x3e79('0x1f')]=qs[_0x3e79('0x1f')](_0x86b7b9[_0x3e79('0x34')]['offset']);}_0x59101b[_0x3e79('0x3d')]=qs[_0x3e79('0x3e')](_0x86b7b9['query']['sort']);_0x59101b[_0x3e79('0x3f')]=qs[_0x3e79('0x36')](_['pick'](_0x86b7b9[_0x3e79('0x34')],_0x5bcf71['filters']),_0x286864);if(_0x86b7b9[_0x3e79('0x34')][_0x3e79('0x40')]){_0x59101b[_0x3e79('0x3f')]=_['merge'](_0x59101b[_0x3e79('0x3f')],{'$or':_['map'](_0x286864,function(_0x1ac0fe){if(_0x1ac0fe[_0x3e79('0x41')]!==_0x3e79('0x42')){var _0x25921c={};_0x25921c[_0x1ac0fe[_0x3e79('0x2b')]]={'$like':'%'+_0x86b7b9[_0x3e79('0x34')][_0x3e79('0x40')]+'%'};return _0x25921c;}})});}_0x59101b=_[_0x3e79('0x43')]({},_0x59101b,_0x86b7b9['options']);var _0x474816={'where':_0x59101b[_0x3e79('0x3f')]};return db[_0x3e79('0x2f')][_0x3e79('0x20')](_0x474816)['then'](function(_0x45544e){_0x5111b9[_0x3e79('0x20')]=_0x45544e;if(_0x86b7b9[_0x3e79('0x34')]['includeAll']){_0x59101b[_0x3e79('0x44')]=[{'all':!![]}];}return db[_0x3e79('0x2f')][_0x3e79('0x45')](_0x59101b);})[_0x3e79('0x27')](function(_0x10b9f4){_0x5111b9[_0x3e79('0x46')]=_0x10b9f4;return _0x5111b9;})[_0x3e79('0x27')](respondWithFilteredResult(_0x3b735f,_0x59101b))[_0x3e79('0x47')](handleError(_0x3b735f,null));};exports['show']=function(_0x4f04d9,_0x3e7b52){var _0x34acd6={'raw':![],'where':{'id':_0x4f04d9[_0x3e79('0x48')]['id']}},_0x4e7d89={};_0x4e7d89[_0x3e79('0x33')]=_[_0x3e79('0x35')](db[_0x3e79('0x2f')][_0x3e79('0x30')]);_0x4e7d89[_0x3e79('0x34')]=_[_0x3e79('0x35')](_0x4f04d9['query']);_0x4e7d89[_0x3e79('0x36')]=_['intersection'](_0x4e7d89[_0x3e79('0x33')],_0x4e7d89[_0x3e79('0x34')]);_0x34acd6['attributes']=_[_0x3e79('0x37')](_0x4e7d89[_0x3e79('0x33')],qs[_0x3e79('0x38')](_0x4f04d9[_0x3e79('0x34')][_0x3e79('0x38')]));_0x34acd6[_0x3e79('0x39')]=_0x34acd6[_0x3e79('0x39')]['length']?_0x34acd6[_0x3e79('0x39')]:_0x4e7d89[_0x3e79('0x33')];if(_0x4f04d9['query'][_0x3e79('0x49')]){_0x34acd6[_0x3e79('0x44')]=[{'all':!![]}];}_0x34acd6=_['merge']({},_0x34acd6,_0x4f04d9[_0x3e79('0x4a')]);return db['ZendeskConfiguration'][_0x3e79('0x4b')](_0x34acd6)[_0x3e79('0x27')](handleEntityNotFound(_0x3e7b52,null))[_0x3e79('0x27')](respondWithResult(_0x3e7b52,null))[_0x3e79('0x47')](handleError(_0x3e7b52,null));};exports[_0x3e79('0x4c')]=function(_0x2b35c0,_0x15eb93){return db[_0x3e79('0x2f')]['create'](_0x2b35c0[_0x3e79('0x4d')],{})[_0x3e79('0x27')](respondWithResult(_0x15eb93,0xc9))[_0x3e79('0x47')](handleError(_0x15eb93,null));};exports[_0x3e79('0x26')]=function(_0x49dffd,_0x1567b3){if(_0x49dffd['body']['id']){delete _0x49dffd[_0x3e79('0x4d')]['id'];}return db[_0x3e79('0x2f')][_0x3e79('0x4b')]({'where':{'id':_0x49dffd[_0x3e79('0x48')]['id']}})[_0x3e79('0x27')](handleEntityNotFound(_0x1567b3,null))['then'](saveUpdates(_0x49dffd['body'],null))[_0x3e79('0x27')](respondWithResult(_0x1567b3,null))[_0x3e79('0x47')](handleError(_0x1567b3,null));};exports[_0x3e79('0x28')]=function(_0x331b6f,_0xc6cba4){return db['ZendeskConfiguration'][_0x3e79('0x4b')]({'where':{'id':_0x331b6f[_0x3e79('0x48')]['id']}})[_0x3e79('0x27')](handleEntityNotFound(_0xc6cba4,null))[_0x3e79('0x27')](removeEntity(_0xc6cba4,null))['catch'](handleError(_0xc6cba4,null));};exports['getFields']=function(_0x27b2d8,_0x5c0bab,_0xa10e38){var _0x4bd404={};var _0x4b1564={};var _0x240df3;var _0x570da7;return db[_0x3e79('0x2f')][_0x3e79('0x4e')]({'where':{'id':_0x27b2d8['params']['id']}})['then'](handleEntityNotFound(_0x5c0bab,null))['then'](function(_0x43f3a1){if(_0x43f3a1){_0x240df3=_0x43f3a1;_0x4b1564[_0x3e79('0x33')]=_['keys'](db['ZendeskField'][_0x3e79('0x30')]);_0x4b1564[_0x3e79('0x34')]=_['keys'](_0x27b2d8[_0x3e79('0x34')]);_0x4b1564[_0x3e79('0x36')]=_[_0x3e79('0x37')](_0x4b1564[_0x3e79('0x33')],_0x4b1564[_0x3e79('0x34')]);_0x4bd404[_0x3e79('0x39')]=_[_0x3e79('0x37')](_0x4b1564[_0x3e79('0x33')],qs[_0x3e79('0x38')](_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x38')]));_0x4bd404['attributes']=_0x4bd404[_0x3e79('0x39')][_0x3e79('0x3a')]?_0x4bd404[_0x3e79('0x39')]:_0x4b1564[_0x3e79('0x33')];_0x4bd404[_0x3e79('0x3d')]=qs[_0x3e79('0x3e')](_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x3e')]);_0x4bd404[_0x3e79('0x3f')]=qs['filters'](_[_0x3e79('0x4f')](_0x27b2d8[_0x3e79('0x34')],_0x4b1564[_0x3e79('0x36')]));if(_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x40')]){_0x4bd404['where']=_[_0x3e79('0x43')](_0x4bd404[_0x3e79('0x3f')],{'$or':_['map'](_0x4bd404['attributes'],function(_0x1ab096){var _0x159bd1={};_0x159bd1[_0x1ab096]={'$like':'%'+_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x40')]+'%'};return _0x159bd1;})});}_0x4bd404=_[_0x3e79('0x43')]({},_0x4bd404,_0x27b2d8['options']);return _0x240df3[_0x3e79('0x50')](_0x4bd404);}})[_0x3e79('0x27')](function(_0x306766){if(_0x306766){_0x570da7=_0x306766[_0x3e79('0x3a')];if(!_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x3b')](_0x3e79('0x3c'))){_0x4bd404['limit']=qs[_0x3e79('0x21')](_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x21')]);_0x4bd404['offset']=qs[_0x3e79('0x1f')](_0x27b2d8[_0x3e79('0x34')][_0x3e79('0x1f')]);}return _0x240df3[_0x3e79('0x50')](_0x4bd404);}})[_0x3e79('0x27')](function(_0xdd0fbd){if(_0xdd0fbd){return _0xdd0fbd?{'count':_0x570da7,'rows':_0xdd0fbd}:null;}})[_0x3e79('0x27')](respondWithResult(_0x5c0bab,null))[_0x3e79('0x47')](handleError(_0x5c0bab,null));};exports['getSubjects']=function(_0x376ae2,_0x349ea3,_0x5f3b1f){var _0x1522fc={};var _0x360768={};var _0x37fa3d;var _0x59971a;return db[_0x3e79('0x2f')][_0x3e79('0x4e')]({'where':{'id':_0x376ae2['params']['id']}})[_0x3e79('0x27')](handleEntityNotFound(_0x349ea3,null))['then'](function(_0xf13606){if(_0xf13606){_0x37fa3d=_0xf13606;_0x360768[_0x3e79('0x33')]=_[_0x3e79('0x35')](db[_0x3e79('0x51')][_0x3e79('0x30')]);_0x360768[_0x3e79('0x34')]=_[_0x3e79('0x35')](_0x376ae2['query']);_0x360768['filters']=_[_0x3e79('0x37')](_0x360768[_0x3e79('0x33')],_0x360768[_0x3e79('0x34')]);_0x1522fc[_0x3e79('0x39')]=_[_0x3e79('0x37')](_0x360768['model'],qs['fields'](_0x376ae2[_0x3e79('0x34')]['fields']));_0x1522fc['attributes']=_0x1522fc[_0x3e79('0x39')][_0x3e79('0x3a')]?_0x1522fc[_0x3e79('0x39')]:_0x360768['model'];_0x1522fc[_0x3e79('0x3d')]=qs[_0x3e79('0x3e')](_0x376ae2[_0x3e79('0x34')][_0x3e79('0x3e')]);_0x1522fc[_0x3e79('0x3f')]=qs[_0x3e79('0x36')](_[_0x3e79('0x4f')](_0x376ae2['query'],_0x360768[_0x3e79('0x36')]));if(_0x376ae2[_0x3e79('0x34')]['filter']){_0x1522fc[_0x3e79('0x3f')]=_['merge'](_0x1522fc[_0x3e79('0x3f')],{'$or':_[_0x3e79('0x2e')](_0x1522fc[_0x3e79('0x39')],function(_0x290dfe){var _0x56cd6f={};_0x56cd6f[_0x290dfe]={'$like':'%'+_0x376ae2[_0x3e79('0x34')][_0x3e79('0x40')]+'%'};return _0x56cd6f;})});}_0x1522fc=_[_0x3e79('0x43')]({},_0x1522fc,_0x376ae2[_0x3e79('0x4a')]);return _0x37fa3d['getSubjects'](_0x1522fc);}})[_0x3e79('0x27')](function(_0x592198){if(_0x592198){_0x59971a=_0x592198[_0x3e79('0x3a')];if(!_0x376ae2[_0x3e79('0x34')][_0x3e79('0x3b')]('nolimit')){_0x1522fc[_0x3e79('0x21')]=qs[_0x3e79('0x21')](_0x376ae2['query'][_0x3e79('0x21')]);_0x1522fc['offset']=qs[_0x3e79('0x1f')](_0x376ae2['query']['offset']);}return _0x37fa3d['getSubjects'](_0x1522fc);}})[_0x3e79('0x27')](function(_0x98de9e){if(_0x98de9e){return _0x98de9e?{'count':_0x59971a,'rows':_0x98de9e}:null;}})[_0x3e79('0x27')](respondWithResult(_0x349ea3,null))['catch'](handleError(_0x349ea3,null));};exports['getDescriptions']=function(_0x14e79c,_0x4a737c,_0x3d9615){var _0x8fd52={};var _0x4cadac={};var _0xd8908c;var _0x14936f;return db[_0x3e79('0x2f')][_0x3e79('0x4e')]({'where':{'id':_0x14e79c[_0x3e79('0x48')]['id']}})[_0x3e79('0x27')](handleEntityNotFound(_0x4a737c,null))[_0x3e79('0x27')](function(_0x11e49){if(_0x11e49){_0xd8908c=_0x11e49;_0x4cadac[_0x3e79('0x33')]=_['keys'](db[_0x3e79('0x51')][_0x3e79('0x30')]);_0x4cadac[_0x3e79('0x34')]=_[_0x3e79('0x35')](_0x14e79c[_0x3e79('0x34')]);_0x4cadac['filters']=_['intersection'](_0x4cadac[_0x3e79('0x33')],_0x4cadac[_0x3e79('0x34')]);_0x8fd52[_0x3e79('0x39')]=_[_0x3e79('0x37')](_0x4cadac[_0x3e79('0x33')],qs[_0x3e79('0x38')](_0x14e79c[_0x3e79('0x34')][_0x3e79('0x38')]));_0x8fd52[_0x3e79('0x39')]=_0x8fd52[_0x3e79('0x39')][_0x3e79('0x3a')]?_0x8fd52[_0x3e79('0x39')]:_0x4cadac[_0x3e79('0x33')];_0x8fd52['order']=qs[_0x3e79('0x3e')](_0x14e79c[_0x3e79('0x34')]['sort']);_0x8fd52[_0x3e79('0x3f')]=qs[_0x3e79('0x36')](_['pick'](_0x14e79c[_0x3e79('0x34')],_0x4cadac[_0x3e79('0x36')]));if(_0x14e79c[_0x3e79('0x34')][_0x3e79('0x40')]){_0x8fd52[_0x3e79('0x3f')]=_['merge'](_0x8fd52['where'],{'$or':_[_0x3e79('0x2e')](_0x8fd52[_0x3e79('0x39')],function(_0x1164ed){var _0x56de64={};_0x56de64[_0x1164ed]={'$like':'%'+_0x14e79c[_0x3e79('0x34')][_0x3e79('0x40')]+'%'};return _0x56de64;})});}_0x8fd52=_[_0x3e79('0x43')]({},_0x8fd52,_0x14e79c[_0x3e79('0x4a')]);return _0xd8908c[_0x3e79('0x52')](_0x8fd52);}})[_0x3e79('0x27')](function(_0x5f3f7b){if(_0x5f3f7b){_0x14936f=_0x5f3f7b[_0x3e79('0x3a')];if(!_0x14e79c[_0x3e79('0x34')][_0x3e79('0x3b')](_0x3e79('0x3c'))){_0x8fd52[_0x3e79('0x21')]=qs['limit'](_0x14e79c[_0x3e79('0x34')][_0x3e79('0x21')]);_0x8fd52['offset']=qs[_0x3e79('0x1f')](_0x14e79c[_0x3e79('0x34')][_0x3e79('0x1f')]);}return _0xd8908c[_0x3e79('0x52')](_0x8fd52);}})[_0x3e79('0x27')](function(_0x46767f){if(_0x46767f){return _0x46767f?{'count':_0x14936f,'rows':_0x46767f}:null;}})['then'](respondWithResult(_0x4a737c,null))['catch'](handleError(_0x4a737c,null));};exports[_0x3e79('0x53')]=function(_0x2b57f7,_0x758d75,_0xf1cc3){var _0x109012={};var _0x3a41c2={};var _0x3e736d;var _0x273901;return db[_0x3e79('0x2f')]['findOne']({'where':{'id':_0x2b57f7[_0x3e79('0x48')]['id']}})['then'](handleEntityNotFound(_0x758d75,null))[_0x3e79('0x27')](function(_0x327e23){if(_0x327e23){_0x3e736d=_0x327e23;_0x3a41c2[_0x3e79('0x33')]=_[_0x3e79('0x35')](db['Tag'][_0x3e79('0x30')]);_0x3a41c2[_0x3e79('0x34')]=_[_0x3e79('0x35')](_0x2b57f7[_0x3e79('0x34')]);_0x3a41c2[_0x3e79('0x36')]=_[_0x3e79('0x37')](_0x3a41c2['model'],_0x3a41c2[_0x3e79('0x34')]);_0x109012[_0x3e79('0x39')]=_['intersection'](_0x3a41c2[_0x3e79('0x33')],qs[_0x3e79('0x38')](_0x2b57f7[_0x3e79('0x34')][_0x3e79('0x38')]));_0x109012[_0x3e79('0x39')]=_0x109012['attributes'][_0x3e79('0x3a')]?_0x109012['attributes']:_0x3a41c2[_0x3e79('0x33')];_0x109012[_0x3e79('0x3d')]=qs['sort'](_0x2b57f7[_0x3e79('0x34')]['sort']);_0x109012['where']=qs[_0x3e79('0x36')](_['pick'](_0x2b57f7[_0x3e79('0x34')],_0x3a41c2[_0x3e79('0x36')]));if(_0x2b57f7[_0x3e79('0x34')][_0x3e79('0x40')]){_0x109012[_0x3e79('0x3f')]=_['merge'](_0x109012[_0x3e79('0x3f')],{'$or':_[_0x3e79('0x2e')](_0x109012['attributes'],function(_0x3ad2b8){var _0x47761e={};_0x47761e[_0x3ad2b8]={'$like':'%'+_0x2b57f7[_0x3e79('0x34')]['filter']+'%'};return _0x47761e;})});}_0x109012=_['merge']({},_0x109012,_0x2b57f7[_0x3e79('0x4a')]);return _0x3e736d[_0x3e79('0x53')](_0x109012);}})[_0x3e79('0x27')](function(_0x46aff6){if(_0x46aff6){_0x273901=_0x46aff6['length'];if(!_0x2b57f7[_0x3e79('0x34')]['hasOwnProperty'](_0x3e79('0x3c'))){_0x109012['limit']=qs['limit'](_0x2b57f7[_0x3e79('0x34')][_0x3e79('0x21')]);_0x109012[_0x3e79('0x1f')]=qs[_0x3e79('0x1f')](_0x2b57f7[_0x3e79('0x34')][_0x3e79('0x1f')]);}return _0x3e736d[_0x3e79('0x53')](_0x109012);}})[_0x3e79('0x27')](function(_0x10aedf){if(_0x10aedf){return _0x10aedf?{'count':_0x273901,'rows':_0x10aedf}:null;}})['then'](respondWithResult(_0x758d75,null))[_0x3e79('0x47')](handleError(_0x758d75,null));};exports[_0x3e79('0x54')]=function(_0x3c8ee5,_0x5deffb,_0x5e5497){if(_0x3c8ee5[_0x3e79('0x4d')]['id']){delete _0x3c8ee5[_0x3e79('0x4d')]['id'];}return db[_0x3e79('0x2f')]['findOne']({'where':{'id':_0x3c8ee5['params']['id']}})[_0x3e79('0x27')](handleEntityNotFound(_0x5deffb,null))[_0x3e79('0x27')](function(_0x3ec670){if(_0x3ec670){return _0x3ec670['setTags'](_0x3c8ee5['body'][_0x3e79('0x55')]||[]);}return null;})[_0x3e79('0x27')](respondWithResult(_0x5deffb,null))[_0x3e79('0x47')](handleError(_0x5deffb,null));}; \ No newline at end of file +var _0x0a8c=['includeAll','include','findAll','rows','catch','length','find','create','body','params','getFields','findOne','ZendeskField','rawAttributes','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ZendeskConfiguration','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0a8c,0xc5));var _0xc0a8=function(_0x345bd5,_0x2c7ae2){_0x345bd5=_0x345bd5-0x0;var _0x4c32a1=_0x0a8c[_0x345bd5];return _0x4c32a1;};'use strict';var emlformat=require(_0xc0a8('0x0'));var rimraf=require(_0xc0a8('0x1'));var zipdir=require(_0xc0a8('0x2'));var jsonpatch=require(_0xc0a8('0x3'));var rp=require('request-promise');var moment=require(_0xc0a8('0x4'));var BPromise=require(_0xc0a8('0x5'));var Mustache=require(_0xc0a8('0x6'));var util=require(_0xc0a8('0x7'));var path=require(_0xc0a8('0x8'));var sox=require(_0xc0a8('0x9'));var csv=require(_0xc0a8('0xa'));var ejs=require(_0xc0a8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0a8('0xc'));var squel=require(_0xc0a8('0xd'));var crypto=require(_0xc0a8('0xe'));var jsforce=require(_0xc0a8('0xf'));var deskjs=require(_0xc0a8('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0a8('0x11'));var Papa=require(_0xc0a8('0x12'));var Redis=require('ioredis');var authService=require(_0xc0a8('0x13'));var qs=require(_0xc0a8('0x14'));var as=require(_0xc0a8('0x15'));var hardwareService=require(_0xc0a8('0x16'));var logger=require(_0xc0a8('0x17'))(_0xc0a8('0x18'));var utils=require('../../config/utils');var config=require(_0xc0a8('0x19'));var licenseUtil=require(_0xc0a8('0x1a'));var db=require(_0xc0a8('0x1b'))['db'];function respondWithStatusCode(_0x5898ea,_0x54cfb7){_0x54cfb7=_0x54cfb7||0xcc;return function(_0x576f48){if(_0x576f48){return _0x5898ea[_0xc0a8('0x1c')](_0x54cfb7);}return _0x5898ea[_0xc0a8('0x1d')](_0x54cfb7)[_0xc0a8('0x1e')]();};}function respondWithResult(_0x394f71,_0x154707){_0x154707=_0x154707||0xc8;return function(_0x5a82f7){if(_0x5a82f7){return _0x394f71[_0xc0a8('0x1d')](_0x154707)[_0xc0a8('0x1f')](_0x5a82f7);}};}function respondWithFilteredResult(_0x41625a,_0x3f12e4){return function(_0x4e734f){if(_0x4e734f){var _0x3d20be=typeof _0x3f12e4[_0xc0a8('0x20')]===_0xc0a8('0x21')&&typeof _0x3f12e4['limit']==='undefined';var _0x5ac664=_0x4e734f[_0xc0a8('0x22')];var _0x4c9378=_0x3d20be?0x0:_0x3f12e4[_0xc0a8('0x20')];var _0x4adf14=_0x3d20be?_0x4e734f[_0xc0a8('0x22')]:_0x3f12e4[_0xc0a8('0x20')]+_0x3f12e4[_0xc0a8('0x23')];var _0x333fb3;if(_0x4adf14>=_0x5ac664){_0x4adf14=_0x5ac664;_0x333fb3=0xc8;}else{_0x333fb3=0xce;}_0x41625a[_0xc0a8('0x1d')](_0x333fb3);return _0x41625a[_0xc0a8('0x24')](_0xc0a8('0x25'),_0x4c9378+'-'+_0x4adf14+'/'+_0x5ac664)[_0xc0a8('0x1f')](_0x4e734f);}return null;};}function patchUpdates(_0x13fb4e){return function(_0x1af003){try{jsonpatch[_0xc0a8('0x26')](_0x1af003,_0x13fb4e,!![]);}catch(_0x340a9f){return BPromise[_0xc0a8('0x27')](_0x340a9f);}return _0x1af003[_0xc0a8('0x28')]();};}function saveUpdates(_0x332cfd,_0x31a0f5){return function(_0x33f528){if(_0x33f528){return _0x33f528[_0xc0a8('0x29')](_0x332cfd)['then'](function(_0x5e83a4){return _0x5e83a4;});}return null;};}function removeEntity(_0x598133,_0x1b81a5){return function(_0x57c985){if(_0x57c985){return _0x57c985[_0xc0a8('0x2a')]()[_0xc0a8('0x2b')](function(){_0x598133['status'](0xcc)[_0xc0a8('0x1e')]();});}};}function handleEntityNotFound(_0x4f71bf,_0x233c59){return function(_0x44e204){if(!_0x44e204){_0x4f71bf[_0xc0a8('0x1c')](0x194);}return _0x44e204;};}function handleError(_0x26866c,_0x47e71f){_0x47e71f=_0x47e71f||0x1f4;return function(_0x504b05){logger['error'](_0x504b05[_0xc0a8('0x2c')]);if(_0x504b05[_0xc0a8('0x2d')]){delete _0x504b05[_0xc0a8('0x2d')];}_0x26866c[_0xc0a8('0x1d')](_0x47e71f)[_0xc0a8('0x2e')](_0x504b05);};}exports[_0xc0a8('0x2f')]=function(_0x543497,_0x388a6f){var _0x1b46a3={},_0x312494={},_0x220a3e={'count':0x0,'rows':[]};var _0xaba55b=_['map'](db[_0xc0a8('0x30')]['rawAttributes'],function(_0x5e8174){return{'name':_0x5e8174[_0xc0a8('0x31')],'type':_0x5e8174[_0xc0a8('0x32')][_0xc0a8('0x33')]};});_0x312494[_0xc0a8('0x34')]=_['map'](_0xaba55b,_0xc0a8('0x2d'));_0x312494['query']=_[_0xc0a8('0x35')](_0x543497['query']);_0x312494[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x312494[_0xc0a8('0x34')],_0x312494[_0xc0a8('0x38')]);_0x1b46a3[_0xc0a8('0x39')]=_[_0xc0a8('0x37')](_0x312494[_0xc0a8('0x34')],qs['fields'](_0x543497[_0xc0a8('0x38')][_0xc0a8('0x3a')]));_0x1b46a3['attributes']=_0x1b46a3['attributes']['length']?_0x1b46a3[_0xc0a8('0x39')]:_0x312494[_0xc0a8('0x34')];if(!_0x543497[_0xc0a8('0x38')][_0xc0a8('0x3b')](_0xc0a8('0x3c'))){_0x1b46a3[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x543497['query'][_0xc0a8('0x23')]);_0x1b46a3[_0xc0a8('0x20')]=qs['offset'](_0x543497[_0xc0a8('0x38')][_0xc0a8('0x20')]);}_0x1b46a3[_0xc0a8('0x3d')]=qs[_0xc0a8('0x3e')](_0x543497['query'][_0xc0a8('0x3e')]);_0x1b46a3[_0xc0a8('0x3f')]=qs[_0xc0a8('0x36')](_[_0xc0a8('0x40')](_0x543497[_0xc0a8('0x38')],_0x312494['filters']),_0xaba55b);if(_0x543497[_0xc0a8('0x38')][_0xc0a8('0x41')]){_0x1b46a3[_0xc0a8('0x3f')]=_[_0xc0a8('0x42')](_0x1b46a3[_0xc0a8('0x3f')],{'$or':_[_0xc0a8('0x43')](_0xaba55b,function(_0x2feab3){if(_0x2feab3[_0xc0a8('0x32')]!==_0xc0a8('0x44')){var _0x4dffac={};_0x4dffac[_0x2feab3['name']]={'$like':'%'+_0x543497[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x4dffac;}})});}_0x1b46a3=_[_0xc0a8('0x42')]({},_0x1b46a3,_0x543497[_0xc0a8('0x45')]);var _0x58a933={'where':_0x1b46a3['where']};return db[_0xc0a8('0x30')][_0xc0a8('0x22')](_0x58a933)[_0xc0a8('0x2b')](function(_0x2c4cc5){_0x220a3e[_0xc0a8('0x22')]=_0x2c4cc5;if(_0x543497[_0xc0a8('0x38')][_0xc0a8('0x46')]){_0x1b46a3[_0xc0a8('0x47')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xc0a8('0x48')](_0x1b46a3);})[_0xc0a8('0x2b')](function(_0x4766f1){_0x220a3e[_0xc0a8('0x49')]=_0x4766f1;return _0x220a3e;})[_0xc0a8('0x2b')](respondWithFilteredResult(_0x388a6f,_0x1b46a3))[_0xc0a8('0x4a')](handleError(_0x388a6f,null));};exports['show']=function(_0xef4627,_0x5bef75){var _0x20a29a={'raw':![],'where':{'id':_0xef4627['params']['id']}},_0x16833d={};_0x16833d[_0xc0a8('0x34')]=_[_0xc0a8('0x35')](db[_0xc0a8('0x30')]['rawAttributes']);_0x16833d['query']=_[_0xc0a8('0x35')](_0xef4627['query']);_0x16833d[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x16833d['model'],_0x16833d['query']);_0x20a29a[_0xc0a8('0x39')]=_['intersection'](_0x16833d[_0xc0a8('0x34')],qs[_0xc0a8('0x3a')](_0xef4627['query'][_0xc0a8('0x3a')]));_0x20a29a[_0xc0a8('0x39')]=_0x20a29a['attributes'][_0xc0a8('0x4b')]?_0x20a29a[_0xc0a8('0x39')]:_0x16833d['model'];if(_0xef4627[_0xc0a8('0x38')]['includeAll']){_0x20a29a['include']=[{'all':!![]}];}_0x20a29a=_[_0xc0a8('0x42')]({},_0x20a29a,_0xef4627[_0xc0a8('0x45')]);return db[_0xc0a8('0x30')][_0xc0a8('0x4c')](_0x20a29a)[_0xc0a8('0x2b')](handleEntityNotFound(_0x5bef75,null))[_0xc0a8('0x2b')](respondWithResult(_0x5bef75,null))[_0xc0a8('0x4a')](handleError(_0x5bef75,null));};exports[_0xc0a8('0x4d')]=function(_0x149c2a,_0x2133e9){return db['ZendeskConfiguration']['create'](_0x149c2a[_0xc0a8('0x4e')],{})[_0xc0a8('0x2b')](respondWithResult(_0x2133e9,0xc9))[_0xc0a8('0x4a')](handleError(_0x2133e9,null));};exports[_0xc0a8('0x29')]=function(_0x1d73f6,_0x2a666f){if(_0x1d73f6[_0xc0a8('0x4e')]['id']){delete _0x1d73f6[_0xc0a8('0x4e')]['id'];}return db[_0xc0a8('0x30')]['find']({'where':{'id':_0x1d73f6[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x2a666f,null))['then'](saveUpdates(_0x1d73f6[_0xc0a8('0x4e')],null))[_0xc0a8('0x2b')](respondWithResult(_0x2a666f,null))['catch'](handleError(_0x2a666f,null));};exports['destroy']=function(_0x3124af,_0x5c07ae){return db[_0xc0a8('0x30')][_0xc0a8('0x4c')]({'where':{'id':_0x3124af[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x5c07ae,null))['then'](removeEntity(_0x5c07ae,null))[_0xc0a8('0x4a')](handleError(_0x5c07ae,null));};exports[_0xc0a8('0x50')]=function(_0xe76f8a,_0x285a55,_0x2877d8){var _0x5f1b0b={};var _0x5bf5e8={};var _0x2754a4;var _0x4b722e;return db['ZendeskConfiguration'][_0xc0a8('0x51')]({'where':{'id':_0xe76f8a['params']['id']}})['then'](handleEntityNotFound(_0x285a55,null))[_0xc0a8('0x2b')](function(_0x24258c){if(_0x24258c){_0x2754a4=_0x24258c;_0x5bf5e8['model']=_[_0xc0a8('0x35')](db[_0xc0a8('0x52')][_0xc0a8('0x53')]);_0x5bf5e8['query']=_[_0xc0a8('0x35')](_0xe76f8a[_0xc0a8('0x38')]);_0x5bf5e8[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x5bf5e8[_0xc0a8('0x34')],_0x5bf5e8[_0xc0a8('0x38')]);_0x5f1b0b['attributes']=_[_0xc0a8('0x37')](_0x5bf5e8[_0xc0a8('0x34')],qs[_0xc0a8('0x3a')](_0xe76f8a[_0xc0a8('0x38')][_0xc0a8('0x3a')]));_0x5f1b0b[_0xc0a8('0x39')]=_0x5f1b0b['attributes'][_0xc0a8('0x4b')]?_0x5f1b0b[_0xc0a8('0x39')]:_0x5bf5e8[_0xc0a8('0x34')];_0x5f1b0b['order']=qs['sort'](_0xe76f8a['query'][_0xc0a8('0x3e')]);_0x5f1b0b[_0xc0a8('0x3f')]=qs[_0xc0a8('0x36')](_[_0xc0a8('0x40')](_0xe76f8a['query'],_0x5bf5e8[_0xc0a8('0x36')]));if(_0xe76f8a['query'][_0xc0a8('0x41')]){_0x5f1b0b['where']=_['merge'](_0x5f1b0b['where'],{'$or':_[_0xc0a8('0x43')](_0x5f1b0b['attributes'],function(_0x2b2aa4){var _0x89966c={};_0x89966c[_0x2b2aa4]={'$like':'%'+_0xe76f8a[_0xc0a8('0x38')]['filter']+'%'};return _0x89966c;})});}_0x5f1b0b=_[_0xc0a8('0x42')]({},_0x5f1b0b,_0xe76f8a['options']);return _0x2754a4[_0xc0a8('0x50')](_0x5f1b0b);}})[_0xc0a8('0x2b')](function(_0x23d5f6){if(_0x23d5f6){_0x4b722e=_0x23d5f6[_0xc0a8('0x4b')];if(!_0xe76f8a[_0xc0a8('0x38')]['hasOwnProperty'](_0xc0a8('0x3c'))){_0x5f1b0b[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0xe76f8a[_0xc0a8('0x38')][_0xc0a8('0x23')]);_0x5f1b0b[_0xc0a8('0x20')]=qs['offset'](_0xe76f8a[_0xc0a8('0x38')][_0xc0a8('0x20')]);}return _0x2754a4['getFields'](_0x5f1b0b);}})['then'](function(_0x3fcdd2){if(_0x3fcdd2){return _0x3fcdd2?{'count':_0x4b722e,'rows':_0x3fcdd2}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0x285a55,null))[_0xc0a8('0x4a')](handleError(_0x285a55,null));};exports[_0xc0a8('0x54')]=function(_0x47b5c6,_0x438b02,_0x1ae448){var _0x1bb684={};var _0x456649={};var _0x411e60;var _0x3101dd;return db[_0xc0a8('0x30')][_0xc0a8('0x51')]({'where':{'id':_0x47b5c6[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x438b02,null))[_0xc0a8('0x2b')](function(_0x21089a){if(_0x21089a){_0x411e60=_0x21089a;_0x456649['model']=_[_0xc0a8('0x35')](db[_0xc0a8('0x52')][_0xc0a8('0x53')]);_0x456649[_0xc0a8('0x38')]=_[_0xc0a8('0x35')](_0x47b5c6[_0xc0a8('0x38')]);_0x456649[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x456649[_0xc0a8('0x34')],_0x456649[_0xc0a8('0x38')]);_0x1bb684['attributes']=_[_0xc0a8('0x37')](_0x456649['model'],qs[_0xc0a8('0x3a')](_0x47b5c6['query'][_0xc0a8('0x3a')]));_0x1bb684['attributes']=_0x1bb684['attributes']['length']?_0x1bb684[_0xc0a8('0x39')]:_0x456649[_0xc0a8('0x34')];_0x1bb684[_0xc0a8('0x3d')]=qs[_0xc0a8('0x3e')](_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x3e')]);_0x1bb684[_0xc0a8('0x3f')]=qs['filters'](_[_0xc0a8('0x40')](_0x47b5c6[_0xc0a8('0x38')],_0x456649[_0xc0a8('0x36')]));if(_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x41')]){_0x1bb684[_0xc0a8('0x3f')]=_[_0xc0a8('0x42')](_0x1bb684[_0xc0a8('0x3f')],{'$or':_[_0xc0a8('0x43')](_0x1bb684[_0xc0a8('0x39')],function(_0x14d2ed){var _0x569fe0={};_0x569fe0[_0x14d2ed]={'$like':'%'+_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x569fe0;})});}_0x1bb684=_['merge']({},_0x1bb684,_0x47b5c6[_0xc0a8('0x45')]);return _0x411e60['getSubjects'](_0x1bb684);}})[_0xc0a8('0x2b')](function(_0x29ac78){if(_0x29ac78){_0x3101dd=_0x29ac78[_0xc0a8('0x4b')];if(!_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x3b')](_0xc0a8('0x3c'))){_0x1bb684[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x47b5c6['query'][_0xc0a8('0x23')]);_0x1bb684[_0xc0a8('0x20')]=qs[_0xc0a8('0x20')](_0x47b5c6[_0xc0a8('0x38')][_0xc0a8('0x20')]);}return _0x411e60[_0xc0a8('0x54')](_0x1bb684);}})[_0xc0a8('0x2b')](function(_0x350874){if(_0x350874){return _0x350874?{'count':_0x3101dd,'rows':_0x350874}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0x438b02,null))['catch'](handleError(_0x438b02,null));};exports['getDescriptions']=function(_0x490cb9,_0x4375ba,_0x14479a){var _0x4d533a={};var _0x4a22de={};var _0x432825;var _0xfd6e65;return db['ZendeskConfiguration'][_0xc0a8('0x51')]({'where':{'id':_0x490cb9[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x4375ba,null))[_0xc0a8('0x2b')](function(_0x16ba0f){if(_0x16ba0f){_0x432825=_0x16ba0f;_0x4a22de['model']=_[_0xc0a8('0x35')](db[_0xc0a8('0x52')][_0xc0a8('0x53')]);_0x4a22de['query']=_['keys'](_0x490cb9[_0xc0a8('0x38')]);_0x4a22de[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x4a22de[_0xc0a8('0x34')],_0x4a22de[_0xc0a8('0x38')]);_0x4d533a[_0xc0a8('0x39')]=_[_0xc0a8('0x37')](_0x4a22de[_0xc0a8('0x34')],qs[_0xc0a8('0x3a')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x3a')]));_0x4d533a[_0xc0a8('0x39')]=_0x4d533a[_0xc0a8('0x39')]['length']?_0x4d533a[_0xc0a8('0x39')]:_0x4a22de[_0xc0a8('0x34')];_0x4d533a['order']=qs[_0xc0a8('0x3e')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x3e')]);_0x4d533a['where']=qs[_0xc0a8('0x36')](_[_0xc0a8('0x40')](_0x490cb9['query'],_0x4a22de['filters']));if(_0x490cb9['query'][_0xc0a8('0x41')]){_0x4d533a['where']=_[_0xc0a8('0x42')](_0x4d533a[_0xc0a8('0x3f')],{'$or':_['map'](_0x4d533a[_0xc0a8('0x39')],function(_0x5ced14){var _0x41b287={};_0x41b287[_0x5ced14]={'$like':'%'+_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x41b287;})});}_0x4d533a=_[_0xc0a8('0x42')]({},_0x4d533a,_0x490cb9[_0xc0a8('0x45')]);return _0x432825['getDescriptions'](_0x4d533a);}})[_0xc0a8('0x2b')](function(_0x9f4f1a){if(_0x9f4f1a){_0xfd6e65=_0x9f4f1a[_0xc0a8('0x4b')];if(!_0x490cb9['query']['hasOwnProperty'](_0xc0a8('0x3c'))){_0x4d533a[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x23')]);_0x4d533a['offset']=qs[_0xc0a8('0x20')](_0x490cb9[_0xc0a8('0x38')][_0xc0a8('0x20')]);}return _0x432825[_0xc0a8('0x55')](_0x4d533a);}})[_0xc0a8('0x2b')](function(_0x4a53bb){if(_0x4a53bb){return _0x4a53bb?{'count':_0xfd6e65,'rows':_0x4a53bb}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0x4375ba,null))[_0xc0a8('0x4a')](handleError(_0x4375ba,null));};exports[_0xc0a8('0x56')]=function(_0x5c05f4,_0xeddfd2,_0x8be369){var _0x4abbe8={};var _0x1980a0={};var _0x5b2d40;var _0x13bec5;return db[_0xc0a8('0x30')][_0xc0a8('0x51')]({'where':{'id':_0x5c05f4[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0xeddfd2,null))[_0xc0a8('0x2b')](function(_0x581bb0){if(_0x581bb0){_0x5b2d40=_0x581bb0;_0x1980a0[_0xc0a8('0x34')]=_[_0xc0a8('0x35')](db['Tag'][_0xc0a8('0x53')]);_0x1980a0['query']=_[_0xc0a8('0x35')](_0x5c05f4[_0xc0a8('0x38')]);_0x1980a0[_0xc0a8('0x36')]=_[_0xc0a8('0x37')](_0x1980a0['model'],_0x1980a0[_0xc0a8('0x38')]);_0x4abbe8['attributes']=_[_0xc0a8('0x37')](_0x1980a0['model'],qs['fields'](_0x5c05f4['query'][_0xc0a8('0x3a')]));_0x4abbe8[_0xc0a8('0x39')]=_0x4abbe8[_0xc0a8('0x39')][_0xc0a8('0x4b')]?_0x4abbe8[_0xc0a8('0x39')]:_0x1980a0['model'];_0x4abbe8[_0xc0a8('0x3d')]=qs['sort'](_0x5c05f4[_0xc0a8('0x38')]['sort']);_0x4abbe8['where']=qs['filters'](_[_0xc0a8('0x40')](_0x5c05f4['query'],_0x1980a0['filters']));if(_0x5c05f4[_0xc0a8('0x38')][_0xc0a8('0x41')]){_0x4abbe8['where']=_[_0xc0a8('0x42')](_0x4abbe8['where'],{'$or':_[_0xc0a8('0x43')](_0x4abbe8[_0xc0a8('0x39')],function(_0x2db23b){var _0x25b110={};_0x25b110[_0x2db23b]={'$like':'%'+_0x5c05f4[_0xc0a8('0x38')][_0xc0a8('0x41')]+'%'};return _0x25b110;})});}_0x4abbe8=_[_0xc0a8('0x42')]({},_0x4abbe8,_0x5c05f4[_0xc0a8('0x45')]);return _0x5b2d40['getTags'](_0x4abbe8);}})['then'](function(_0xae8254){if(_0xae8254){_0x13bec5=_0xae8254['length'];if(!_0x5c05f4['query'][_0xc0a8('0x3b')](_0xc0a8('0x3c'))){_0x4abbe8[_0xc0a8('0x23')]=qs[_0xc0a8('0x23')](_0x5c05f4['query'][_0xc0a8('0x23')]);_0x4abbe8[_0xc0a8('0x20')]=qs['offset'](_0x5c05f4['query'][_0xc0a8('0x20')]);}return _0x5b2d40['getTags'](_0x4abbe8);}})[_0xc0a8('0x2b')](function(_0x23d7dc){if(_0x23d7dc){return _0x23d7dc?{'count':_0x13bec5,'rows':_0x23d7dc}:null;}})[_0xc0a8('0x2b')](respondWithResult(_0xeddfd2,null))['catch'](handleError(_0xeddfd2,null));};exports[_0xc0a8('0x57')]=function(_0x5b947d,_0x518a5d,_0x2c0cf0){if(_0x5b947d[_0xc0a8('0x4e')]['id']){delete _0x5b947d[_0xc0a8('0x4e')]['id'];}return db[_0xc0a8('0x30')][_0xc0a8('0x51')]({'where':{'id':_0x5b947d[_0xc0a8('0x4f')]['id']}})[_0xc0a8('0x2b')](handleEntityNotFound(_0x518a5d,null))[_0xc0a8('0x2b')](function(_0x11717d){if(_0x11717d){return _0x11717d[_0xc0a8('0x57')](_0x5b947d[_0xc0a8('0x4e')][_0xc0a8('0x58')]||[]);}return null;})[_0xc0a8('0x2b')](respondWithResult(_0x518a5d,null))['catch'](handleError(_0x518a5d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 0e22137..cc05fd8 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 _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x6807e8,_0x3a7fc7){_0x6807e8=_0x6807e8-0x0;var _0x32de50=_0xd7d1[_0x6807e8];return _0x32de50;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x531b06,_0x2fee07){var _0x113250=function(_0x50627b){while(--_0x50627b){_0x531b06['push'](_0x531b06['shift']());}};_0x113250(++_0x2fee07);}(_0xda2d,0x102));var _0xdda2=function(_0x38fdd9,_0xf59bf5){_0x38fdd9=_0x38fdd9-0x0;var _0x1776cf=_0xda2d[_0x38fdd9];return _0x1776cf;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index b3317a8..08c4c00 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 _0xc0c3=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x5d81bf,_0x3d908a){var _0x7f1cf5=function(_0x332ce6){while(--_0x332ce6){_0x5d81bf['push'](_0x5d81bf['shift']());}};_0x7f1cf5(++_0x3d908a);}(_0xc0c3,0x145));var _0x3c0c=function(_0x44e900,_0x1c6f2a){_0x44e900=_0x44e900-0x0;var _0xbb0c70=_0xc0c3[_0x44e900];return _0xbb0c70;};'use strict';var _=require(_0x3c0c('0x0'));var util=require(_0x3c0c('0x1'));var moment=require(_0x3c0c('0x2'));var BPromise=require(_0x3c0c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c0c('0x4'))['db'];var utils=require(_0x3c0c('0x5'));var logger=require(_0x3c0c('0x6'))(_0x3c0c('0x7'));var config=require('../../config/environment');var jayson=require(_0x3c0c('0x8'));var client=jayson['client'][_0x3c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xac47d5,_0x1db296,_0x4d020a){return new BPromise(function(_0x84daf1,_0x1b3def){return client[_0x3c0c('0xa')](_0xac47d5,_0x4d020a)['then'](function(_0x1e9b05){logger[_0x3c0c('0xb')](_0x3c0c('0xc'),_0x1db296,_0x3c0c('0xd'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1db296,_0x3c0c('0xd'),JSON['stringify'](_0x1e9b05));if(_0x1e9b05['error']){if(_0x1e9b05[_0x3c0c('0xe')][_0x3c0c('0xf')]===0x1f4){logger['error'](_0x3c0c('0xc'),_0x1db296,_0x1e9b05[_0x3c0c('0xe')]['message']);return _0x1b3def(_0x1e9b05[_0x3c0c('0xe')][_0x3c0c('0x10')]);}logger[_0x3c0c('0xe')](_0x3c0c('0xc'),_0x1db296,_0x1e9b05[_0x3c0c('0xe')][_0x3c0c('0x10')]);return _0x84daf1(_0x1e9b05[_0x3c0c('0xe')][_0x3c0c('0x10')]);}else{logger['info'](_0x3c0c('0xc'),_0x1db296,_0x3c0c('0xd'));_0x84daf1(_0x1e9b05['result'][_0x3c0c('0x10')]);}})[_0x3c0c('0x11')](function(_0x2a7209){logger[_0x3c0c('0xe')](_0x3c0c('0xc'),_0x1db296,_0x2a7209);_0x1b3def(_0x2a7209);});});} \ No newline at end of file +var _0x65fe=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2c4aef,_0x116fe2){var _0x3deaed=function(_0x131052){while(--_0x131052){_0x2c4aef['push'](_0x2c4aef['shift']());}};_0x3deaed(++_0x116fe2);}(_0x65fe,0x1ce));var _0xe65f=function(_0x2cbe40,_0x569020){_0x2cbe40=_0x2cbe40-0x0;var _0x4b9e5c=_0x65fe[_0x2cbe40];return _0x4b9e5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe65f('0x0'));var BPromise=require(_0xe65f('0x1'));var rs=require(_0xe65f('0x2'));var fs=require('fs');var Redis=require(_0xe65f('0x3'));var db=require(_0xe65f('0x4'))['db'];var utils=require(_0xe65f('0x5'));var logger=require('../../config/logger')(_0xe65f('0x6'));var config=require(_0xe65f('0x7'));var jayson=require(_0xe65f('0x8'));var client=jayson[_0xe65f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bfe8d,_0x373c87,_0x3b9fad){return new BPromise(function(_0x5a8122,_0xb5dbdb){return client[_0xe65f('0xa')](_0x4bfe8d,_0x3b9fad)[_0xe65f('0xb')](function(_0x2eac8d){logger[_0xe65f('0xc')](_0xe65f('0xd'),_0x373c87,_0xe65f('0xe'));logger[_0xe65f('0xf')](_0xe65f('0x10'),_0x373c87,_0xe65f('0xe'),JSON[_0xe65f('0x11')](_0x2eac8d));if(_0x2eac8d[_0xe65f('0x12')]){if(_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x13')]===0x1f4){logger[_0xe65f('0x12')](_0xe65f('0xd'),_0x373c87,_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x14')]);return _0xb5dbdb(_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x14')]);}logger[_0xe65f('0x12')](_0xe65f('0xd'),_0x373c87,_0x2eac8d['error'][_0xe65f('0x14')]);return _0x5a8122(_0x2eac8d[_0xe65f('0x12')][_0xe65f('0x14')]);}else{logger[_0xe65f('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x373c87,_0xe65f('0xe'));_0x5a8122(_0x2eac8d[_0xe65f('0x15')][_0xe65f('0x14')]);}})['catch'](function(_0x4ef183){logger[_0xe65f('0x12')](_0xe65f('0xd'),_0x373c87,_0x4ef183);_0xb5dbdb(_0x4ef183);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ff5f446..0eb20b4 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 _0x73ff=['/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x73ff,0xf8));var _0xf73f=function(_0x4cc5ee,_0x20cffd){_0x4cc5ee=_0x4cc5ee-0x0;var _0x198ddf=_0x73ff[_0x4cc5ee];return _0x198ddf;};'use strict';var multer=require(_0xf73f('0x0'));var util=require(_0xf73f('0x1'));var path=require(_0xf73f('0x2'));var timeout=require(_0xf73f('0x3'));var express=require(_0xf73f('0x4'));var router=express[_0xf73f('0x5')]();var fs_extra=require(_0xf73f('0x6'));var auth=require(_0xf73f('0x7'));var interaction=require(_0xf73f('0x8'));var config=require(_0xf73f('0x9'));var controller=require('./intZendeskField.controller');router['get']('/',auth[_0xf73f('0xa')](),controller[_0xf73f('0xb')]);router['get'](_0xf73f('0xc'),auth[_0xf73f('0xa')](),controller[_0xf73f('0xd')]);router[_0xf73f('0xe')]('/',auth['isAuthenticated'](),controller[_0xf73f('0xf')]);router[_0xf73f('0x10')](_0xf73f('0xc'),auth[_0xf73f('0xa')](),controller[_0xf73f('0x11')]);router['delete'](_0xf73f('0xc'),auth[_0xf73f('0xa')](),controller[_0xf73f('0x12')]);module[_0xf73f('0x13')]=router; \ No newline at end of file +var _0x696d=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x696d,0x65));var _0xd696=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x696d[_0x1694f5];return _0x5b4321;};'use strict';var multer=require(_0xd696('0x0'));var util=require('util');var path=require(_0xd696('0x1'));var timeout=require(_0xd696('0x2'));var express=require(_0xd696('0x3'));var router=express[_0xd696('0x4')]();var fs_extra=require(_0xd696('0x5'));var auth=require(_0xd696('0x6'));var interaction=require(_0xd696('0x7'));var config=require(_0xd696('0x8'));var controller=require(_0xd696('0x9'));router[_0xd696('0xa')]('/',auth[_0xd696('0xb')](),controller['index']);router[_0xd696('0xa')](_0xd696('0xc'),auth[_0xd696('0xb')](),controller[_0xd696('0xd')]);router['post']('/',auth[_0xd696('0xb')](),controller['create']);router[_0xd696('0xe')](_0xd696('0xc'),auth['isAuthenticated'](),controller[_0xd696('0xf')]);router[_0xd696('0x10')](_0xd696('0xc'),auth['isAuthenticated'](),controller[_0xd696('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 9ed7ed7..f2f3dd7 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 _0x5dce=['keyValue','variable','STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x19354e,_0x495207){var _0x4fca07=function(_0x4de3e8){while(--_0x4de3e8){_0x19354e['push'](_0x19354e['shift']());}};_0x4fca07(++_0x495207);}(_0x5dce,0x109));var _0xe5dc=function(_0x174c19,_0x258975){_0x174c19=_0x174c19-0x0;var _0x6d2778=_0x5dce[_0x174c19];return _0x6d2778;};'use strict';var Sequelize=require(_0xe5dc('0x0'));module[_0xe5dc('0x1')]={'type':{'type':Sequelize[_0xe5dc('0x2')](_0xe5dc('0x3'),'variable',_0xe5dc('0x4'),_0xe5dc('0x5'),'picklist'),'defaultValue':_0xe5dc('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe5dc('0x2')](_0xe5dc('0x3'),_0xe5dc('0x6'),_0xe5dc('0x4'))},'keyContent':{'type':Sequelize[_0xe5dc('0x7')]},'idField':{'type':Sequelize[_0xe5dc('0x7')]},'nameField':{'type':Sequelize[_0xe5dc('0x7')]},'customField':{'type':Sequelize[_0xe5dc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xead6=['exports','ENUM','string','keyValue','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0xead6,0x8f));var _0x6ead=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xead6[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x6ead('0x0'));module[_0x6ead('0x1')]={'type':{'type':Sequelize[_0x6ead('0x2')](_0x6ead('0x3'),'variable','customVariable',_0x6ead('0x4'),_0x6ead('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6ead('0x6')]},'key':{'type':Sequelize[_0x6ead('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x6ead('0x3'),_0x6ead('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x6ead('0x6')]},'idField':{'type':Sequelize[_0x6ead('0x6')]},'nameField':{'type':Sequelize[_0x6ead('0x6')]},'customField':{'type':Sequelize[_0x6ead('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ead('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 6181a0c..dc39ccd 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 _0x85b5=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','ZendeskField','includeAll','findAll','rows','catch','params','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x406613,_0x1b9bfd){var _0x1baa65=function(_0x3fc655){while(--_0x3fc655){_0x406613['push'](_0x406613['shift']());}};_0x1baa65(++_0x1b9bfd);}(_0x85b5,0x7f));var _0x585b=function(_0x1a4dbe,_0x5ecb46){_0x1a4dbe=_0x1a4dbe-0x0;var _0x4902d5=_0x85b5[_0x1a4dbe];return _0x4902d5;};'use strict';var emlformat=require(_0x585b('0x0'));var rimraf=require(_0x585b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x585b('0x2'));var rp=require('request-promise');var moment=require(_0x585b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x585b('0x4'));var path=require('path');var sox=require(_0x585b('0x5'));var csv=require(_0x585b('0x6'));var ejs=require(_0x585b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x585b('0x8'));var squel=require('squel');var crypto=require(_0x585b('0x9'));var jsforce=require(_0x585b('0xa'));var deskjs=require(_0x585b('0xb'));var toCsv=require(_0x585b('0x6'));var querystring=require('querystring');var Papa=require(_0x585b('0xc'));var Redis=require(_0x585b('0xd'));var authService=require(_0x585b('0xe'));var qs=require(_0x585b('0xf'));var as=require(_0x585b('0x10'));var hardwareService=require(_0x585b('0x11'));var logger=require(_0x585b('0x12'))('api');var utils=require(_0x585b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x585b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16d608,_0x35bda0){_0x35bda0=_0x35bda0||0xcc;return function(_0x19336c){if(_0x19336c){return _0x16d608['sendStatus'](_0x35bda0);}return _0x16d608[_0x585b('0x15')](_0x35bda0)[_0x585b('0x16')]();};}function respondWithResult(_0x3d15ed,_0x299ee4){_0x299ee4=_0x299ee4||0xc8;return function(_0x3dcc28){if(_0x3dcc28){return _0x3d15ed[_0x585b('0x15')](_0x299ee4)[_0x585b('0x17')](_0x3dcc28);}};}function respondWithFilteredResult(_0x5ebc1a,_0x2f827f){return function(_0x41f50d){if(_0x41f50d){var _0x4c094e=typeof _0x2f827f['offset']===_0x585b('0x18')&&typeof _0x2f827f['limit']==='undefined';var _0x2f840e=_0x41f50d[_0x585b('0x19')];var _0x20c4ba=_0x4c094e?0x0:_0x2f827f['offset'];var _0x72fdc4=_0x4c094e?_0x41f50d[_0x585b('0x19')]:_0x2f827f[_0x585b('0x1a')]+_0x2f827f[_0x585b('0x1b')];var _0x562886;if(_0x72fdc4>=_0x2f840e){_0x72fdc4=_0x2f840e;_0x562886=0xc8;}else{_0x562886=0xce;}_0x5ebc1a[_0x585b('0x15')](_0x562886);return _0x5ebc1a[_0x585b('0x1c')](_0x585b('0x1d'),_0x20c4ba+'-'+_0x72fdc4+'/'+_0x2f840e)['json'](_0x41f50d);}return null;};}function patchUpdates(_0x5200ec){return function(_0x6bea29){try{jsonpatch['apply'](_0x6bea29,_0x5200ec,!![]);}catch(_0x484157){return BPromise[_0x585b('0x1e')](_0x484157);}return _0x6bea29[_0x585b('0x1f')]();};}function saveUpdates(_0x48d9f8,_0x183308){return function(_0x272a8d){if(_0x272a8d){return _0x272a8d['update'](_0x48d9f8)[_0x585b('0x20')](function(_0xe50751){return _0xe50751;});}return null;};}function removeEntity(_0x2122e0,_0x5bf9e4){return function(_0x1c8a7b){if(_0x1c8a7b){return _0x1c8a7b['destroy']()[_0x585b('0x20')](function(){_0x2122e0[_0x585b('0x15')](0xcc)[_0x585b('0x16')]();});}};}function handleEntityNotFound(_0x428a9a,_0x1b06a2){return function(_0x1b1241){if(!_0x1b1241){_0x428a9a[_0x585b('0x21')](0x194);}return _0x1b1241;};}function handleError(_0x799947,_0x100189){_0x100189=_0x100189||0x1f4;return function(_0x47099f){logger[_0x585b('0x22')](_0x47099f[_0x585b('0x23')]);if(_0x47099f[_0x585b('0x24')]){delete _0x47099f[_0x585b('0x24')];}_0x799947[_0x585b('0x15')](_0x100189)['send'](_0x47099f);};}exports[_0x585b('0x25')]=function(_0x205ffe,_0x19786){var _0x2cf48a={},_0x5dad9a={},_0x4e9fc8={'count':0x0,'rows':[]};var _0xedf913=_[_0x585b('0x26')](db['ZendeskField'][_0x585b('0x27')],function(_0x112fb5){return{'name':_0x112fb5['fieldName'],'type':_0x112fb5[_0x585b('0x28')][_0x585b('0x29')]};});_0x5dad9a[_0x585b('0x2a')]=_[_0x585b('0x26')](_0xedf913,_0x585b('0x24'));_0x5dad9a[_0x585b('0x2b')]=_[_0x585b('0x2c')](_0x205ffe[_0x585b('0x2b')]);_0x5dad9a[_0x585b('0x2d')]=_[_0x585b('0x2e')](_0x5dad9a['model'],_0x5dad9a[_0x585b('0x2b')]);_0x2cf48a[_0x585b('0x2f')]=_[_0x585b('0x2e')](_0x5dad9a['model'],qs[_0x585b('0x30')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x30')]));_0x2cf48a['attributes']=_0x2cf48a[_0x585b('0x2f')][_0x585b('0x31')]?_0x2cf48a[_0x585b('0x2f')]:_0x5dad9a[_0x585b('0x2a')];if(!_0x205ffe['query']['hasOwnProperty'](_0x585b('0x32'))){_0x2cf48a[_0x585b('0x1b')]=qs[_0x585b('0x1b')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x1b')]);_0x2cf48a['offset']=qs[_0x585b('0x1a')](_0x205ffe[_0x585b('0x2b')][_0x585b('0x1a')]);}_0x2cf48a[_0x585b('0x33')]=qs[_0x585b('0x34')](_0x205ffe['query']['sort']);_0x2cf48a['where']=qs[_0x585b('0x2d')](_[_0x585b('0x35')](_0x205ffe[_0x585b('0x2b')],_0x5dad9a[_0x585b('0x2d')]),_0xedf913);if(_0x205ffe[_0x585b('0x2b')][_0x585b('0x36')]){_0x2cf48a[_0x585b('0x37')]=_[_0x585b('0x38')](_0x2cf48a[_0x585b('0x37')],{'$or':_['map'](_0xedf913,function(_0x434768){if(_0x434768[_0x585b('0x28')]!=='VIRTUAL'){var _0x368fb0={};_0x368fb0[_0x434768[_0x585b('0x24')]]={'$like':'%'+_0x205ffe[_0x585b('0x2b')][_0x585b('0x36')]+'%'};return _0x368fb0;}})});}_0x2cf48a=_[_0x585b('0x38')]({},_0x2cf48a,_0x205ffe[_0x585b('0x39')]);var _0x58bf4c={'where':_0x2cf48a[_0x585b('0x37')]};return db[_0x585b('0x3a')][_0x585b('0x19')](_0x58bf4c)[_0x585b('0x20')](function(_0xfa9f00){_0x4e9fc8[_0x585b('0x19')]=_0xfa9f00;if(_0x205ffe[_0x585b('0x2b')][_0x585b('0x3b')]){_0x2cf48a['include']=[{'all':!![]}];}return db[_0x585b('0x3a')][_0x585b('0x3c')](_0x2cf48a);})[_0x585b('0x20')](function(_0x4c5a14){_0x4e9fc8[_0x585b('0x3d')]=_0x4c5a14;return _0x4e9fc8;})[_0x585b('0x20')](respondWithFilteredResult(_0x19786,_0x2cf48a))[_0x585b('0x3e')](handleError(_0x19786,null));};exports['show']=function(_0x1240e2,_0x2310e3){var _0x5112f5={'raw':!![],'where':{'id':_0x1240e2[_0x585b('0x3f')]['id']}},_0x4edd57={};_0x4edd57['model']=_[_0x585b('0x2c')](db['ZendeskField'][_0x585b('0x27')]);_0x4edd57[_0x585b('0x2b')]=_['keys'](_0x1240e2[_0x585b('0x2b')]);_0x4edd57['filters']=_['intersection'](_0x4edd57['model'],_0x4edd57[_0x585b('0x2b')]);_0x5112f5['attributes']=_[_0x585b('0x2e')](_0x4edd57[_0x585b('0x2a')],qs['fields'](_0x1240e2[_0x585b('0x2b')][_0x585b('0x30')]));_0x5112f5[_0x585b('0x2f')]=_0x5112f5['attributes']['length']?_0x5112f5['attributes']:_0x4edd57[_0x585b('0x2a')];if(_0x1240e2[_0x585b('0x2b')][_0x585b('0x3b')]){_0x5112f5[_0x585b('0x40')]=[{'all':!![]}];}_0x5112f5=_['merge']({},_0x5112f5,_0x1240e2[_0x585b('0x39')]);return db[_0x585b('0x3a')][_0x585b('0x41')](_0x5112f5)[_0x585b('0x20')](handleEntityNotFound(_0x2310e3,null))['then'](respondWithResult(_0x2310e3,null))[_0x585b('0x3e')](handleError(_0x2310e3,null));};exports[_0x585b('0x42')]=function(_0x36eb61,_0x5bf8b4){return db[_0x585b('0x3a')]['create'](_0x36eb61['body'],{})['then'](respondWithResult(_0x5bf8b4,0xc9))[_0x585b('0x3e')](handleError(_0x5bf8b4,null));};exports['update']=function(_0x1f8ae0,_0x54ab6f){if(_0x1f8ae0['body']['id']){delete _0x1f8ae0['body']['id'];}return db[_0x585b('0x3a')][_0x585b('0x41')]({'where':{'id':_0x1f8ae0['params']['id']}})['then'](handleEntityNotFound(_0x54ab6f,null))[_0x585b('0x20')](saveUpdates(_0x1f8ae0[_0x585b('0x43')],null))[_0x585b('0x20')](respondWithResult(_0x54ab6f,null))['catch'](handleError(_0x54ab6f,null));};exports[_0x585b('0x44')]=function(_0x4ca120,_0x44234e){return db['ZendeskField'][_0x585b('0x41')]({'where':{'id':_0x4ca120['params']['id']}})[_0x585b('0x20')](handleEntityNotFound(_0x44234e,null))['then'](removeEntity(_0x44234e,null))[_0x585b('0x3e')](handleError(_0x44234e,null));}; \ No newline at end of file +var _0x2ac4=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','update','destroy','then','end','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params'];(function(_0x2110b2,_0x3fdd30){var _0x3d63ab=function(_0x569beb){while(--_0x569beb){_0x2110b2['push'](_0x2110b2['shift']());}};_0x3d63ab(++_0x3fdd30);}(_0x2ac4,0x130));var _0x42ac=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x2ac4[_0x11c573];return _0x6b72de;};'use strict';var emlformat=require(_0x42ac('0x0'));var rimraf=require(_0x42ac('0x1'));var zipdir=require(_0x42ac('0x2'));var jsonpatch=require(_0x42ac('0x3'));var rp=require(_0x42ac('0x4'));var moment=require(_0x42ac('0x5'));var BPromise=require(_0x42ac('0x6'));var Mustache=require(_0x42ac('0x7'));var util=require('util');var path=require(_0x42ac('0x8'));var sox=require(_0x42ac('0x9'));var csv=require(_0x42ac('0xa'));var ejs=require(_0x42ac('0xb'));var fs=require('fs');var fs_extra=require(_0x42ac('0xc'));var _=require(_0x42ac('0xd'));var squel=require(_0x42ac('0xe'));var crypto=require(_0x42ac('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x42ac('0xa'));var querystring=require('querystring');var Papa=require(_0x42ac('0x10'));var Redis=require('ioredis');var authService=require(_0x42ac('0x11'));var qs=require(_0x42ac('0x12'));var as=require(_0x42ac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x42ac('0x14'));var utils=require(_0x42ac('0x15'));var config=require(_0x42ac('0x16'));var licenseUtil=require(_0x42ac('0x17'));var db=require(_0x42ac('0x18'))['db'];function respondWithStatusCode(_0x4d9bd2,_0x571ed6){_0x571ed6=_0x571ed6||0xcc;return function(_0x253645){if(_0x253645){return _0x4d9bd2[_0x42ac('0x19')](_0x571ed6);}return _0x4d9bd2[_0x42ac('0x1a')](_0x571ed6)['end']();};}function respondWithResult(_0xabac7b,_0x5a2c8e){_0x5a2c8e=_0x5a2c8e||0xc8;return function(_0x146908){if(_0x146908){return _0xabac7b['status'](_0x5a2c8e)[_0x42ac('0x1b')](_0x146908);}};}function respondWithFilteredResult(_0x2cfa4d,_0x13354b){return function(_0x5d5f0c){if(_0x5d5f0c){var _0x5dce61=typeof _0x13354b['offset']===_0x42ac('0x1c')&&typeof _0x13354b[_0x42ac('0x1d')]===_0x42ac('0x1c');var _0x230e9a=_0x5d5f0c['count'];var _0x261b89=_0x5dce61?0x0:_0x13354b[_0x42ac('0x1e')];var _0x295073=_0x5dce61?_0x5d5f0c[_0x42ac('0x1f')]:_0x13354b[_0x42ac('0x1e')]+_0x13354b[_0x42ac('0x1d')];var _0x384a1a;if(_0x295073>=_0x230e9a){_0x295073=_0x230e9a;_0x384a1a=0xc8;}else{_0x384a1a=0xce;}_0x2cfa4d[_0x42ac('0x1a')](_0x384a1a);return _0x2cfa4d[_0x42ac('0x20')](_0x42ac('0x21'),_0x261b89+'-'+_0x295073+'/'+_0x230e9a)[_0x42ac('0x1b')](_0x5d5f0c);}return null;};}function patchUpdates(_0x33a912){return function(_0x13df2e){try{jsonpatch['apply'](_0x13df2e,_0x33a912,!![]);}catch(_0x2965ca){return BPromise['reject'](_0x2965ca);}return _0x13df2e['save']();};}function saveUpdates(_0x21cbd1,_0x50e256){return function(_0xe2a905){if(_0xe2a905){return _0xe2a905[_0x42ac('0x22')](_0x21cbd1)['then'](function(_0xcb9c69){return _0xcb9c69;});}return null;};}function removeEntity(_0x206cea,_0x4a62a2){return function(_0x1d91ac){if(_0x1d91ac){return _0x1d91ac[_0x42ac('0x23')]()[_0x42ac('0x24')](function(){_0x206cea[_0x42ac('0x1a')](0xcc)[_0x42ac('0x25')]();});}};}function handleEntityNotFound(_0xaa0835,_0x3368ae){return function(_0x33d0c2){if(!_0x33d0c2){_0xaa0835['sendStatus'](0x194);}return _0x33d0c2;};}function handleError(_0x5549e7,_0x8f89c){_0x8f89c=_0x8f89c||0x1f4;return function(_0x36814a){logger[_0x42ac('0x26')](_0x36814a[_0x42ac('0x27')]);if(_0x36814a[_0x42ac('0x28')]){delete _0x36814a[_0x42ac('0x28')];}_0x5549e7[_0x42ac('0x1a')](_0x8f89c)[_0x42ac('0x29')](_0x36814a);};}exports[_0x42ac('0x2a')]=function(_0x1625d7,_0x56011d){var _0x2dcfa6={},_0x60148d={},_0x52dd82={'count':0x0,'rows':[]};var _0x1034c9=_[_0x42ac('0x2b')](db[_0x42ac('0x2c')][_0x42ac('0x2d')],function(_0x71d698){return{'name':_0x71d698[_0x42ac('0x2e')],'type':_0x71d698['type'][_0x42ac('0x2f')]};});_0x60148d[_0x42ac('0x30')]=_['map'](_0x1034c9,_0x42ac('0x28'));_0x60148d[_0x42ac('0x31')]=_[_0x42ac('0x32')](_0x1625d7[_0x42ac('0x31')]);_0x60148d[_0x42ac('0x33')]=_[_0x42ac('0x34')](_0x60148d[_0x42ac('0x30')],_0x60148d[_0x42ac('0x31')]);_0x2dcfa6[_0x42ac('0x35')]=_['intersection'](_0x60148d[_0x42ac('0x30')],qs[_0x42ac('0x36')](_0x1625d7[_0x42ac('0x31')][_0x42ac('0x36')]));_0x2dcfa6[_0x42ac('0x35')]=_0x2dcfa6['attributes']['length']?_0x2dcfa6['attributes']:_0x60148d[_0x42ac('0x30')];if(!_0x1625d7['query']['hasOwnProperty'](_0x42ac('0x37'))){_0x2dcfa6[_0x42ac('0x1d')]=qs['limit'](_0x1625d7['query'][_0x42ac('0x1d')]);_0x2dcfa6['offset']=qs[_0x42ac('0x1e')](_0x1625d7[_0x42ac('0x31')]['offset']);}_0x2dcfa6[_0x42ac('0x38')]=qs[_0x42ac('0x39')](_0x1625d7[_0x42ac('0x31')][_0x42ac('0x39')]);_0x2dcfa6[_0x42ac('0x3a')]=qs[_0x42ac('0x33')](_[_0x42ac('0x3b')](_0x1625d7[_0x42ac('0x31')],_0x60148d[_0x42ac('0x33')]),_0x1034c9);if(_0x1625d7[_0x42ac('0x31')][_0x42ac('0x3c')]){_0x2dcfa6[_0x42ac('0x3a')]=_[_0x42ac('0x3d')](_0x2dcfa6['where'],{'$or':_[_0x42ac('0x2b')](_0x1034c9,function(_0x3da407){if(_0x3da407[_0x42ac('0x3e')]!==_0x42ac('0x3f')){var _0xf8b69b={};_0xf8b69b[_0x3da407[_0x42ac('0x28')]]={'$like':'%'+_0x1625d7[_0x42ac('0x31')][_0x42ac('0x3c')]+'%'};return _0xf8b69b;}})});}_0x2dcfa6=_['merge']({},_0x2dcfa6,_0x1625d7['options']);var _0xcf56de={'where':_0x2dcfa6['where']};return db[_0x42ac('0x2c')]['count'](_0xcf56de)[_0x42ac('0x24')](function(_0x1db7c2){_0x52dd82[_0x42ac('0x1f')]=_0x1db7c2;if(_0x1625d7[_0x42ac('0x31')][_0x42ac('0x40')]){_0x2dcfa6[_0x42ac('0x41')]=[{'all':!![]}];}return db[_0x42ac('0x2c')][_0x42ac('0x42')](_0x2dcfa6);})[_0x42ac('0x24')](function(_0x1e241d){_0x52dd82[_0x42ac('0x43')]=_0x1e241d;return _0x52dd82;})[_0x42ac('0x24')](respondWithFilteredResult(_0x56011d,_0x2dcfa6))[_0x42ac('0x44')](handleError(_0x56011d,null));};exports[_0x42ac('0x45')]=function(_0x3c14d2,_0xf03051){var _0x2fa4a6={'raw':!![],'where':{'id':_0x3c14d2['params']['id']}},_0x12e098={};_0x12e098['model']=_[_0x42ac('0x32')](db[_0x42ac('0x2c')][_0x42ac('0x2d')]);_0x12e098[_0x42ac('0x31')]=_[_0x42ac('0x32')](_0x3c14d2[_0x42ac('0x31')]);_0x12e098[_0x42ac('0x33')]=_[_0x42ac('0x34')](_0x12e098['model'],_0x12e098[_0x42ac('0x31')]);_0x2fa4a6[_0x42ac('0x35')]=_[_0x42ac('0x34')](_0x12e098[_0x42ac('0x30')],qs[_0x42ac('0x36')](_0x3c14d2[_0x42ac('0x31')][_0x42ac('0x36')]));_0x2fa4a6[_0x42ac('0x35')]=_0x2fa4a6[_0x42ac('0x35')][_0x42ac('0x46')]?_0x2fa4a6['attributes']:_0x12e098['model'];if(_0x3c14d2[_0x42ac('0x31')][_0x42ac('0x40')]){_0x2fa4a6[_0x42ac('0x41')]=[{'all':!![]}];}_0x2fa4a6=_[_0x42ac('0x3d')]({},_0x2fa4a6,_0x3c14d2[_0x42ac('0x47')]);return db['ZendeskField']['find'](_0x2fa4a6)[_0x42ac('0x24')](handleEntityNotFound(_0xf03051,null))[_0x42ac('0x24')](respondWithResult(_0xf03051,null))[_0x42ac('0x44')](handleError(_0xf03051,null));};exports[_0x42ac('0x48')]=function(_0x40a9c8,_0x1d0235){return db['ZendeskField'][_0x42ac('0x48')](_0x40a9c8['body'],{})['then'](respondWithResult(_0x1d0235,0xc9))['catch'](handleError(_0x1d0235,null));};exports[_0x42ac('0x22')]=function(_0x45b9c5,_0x4c3687){if(_0x45b9c5[_0x42ac('0x49')]['id']){delete _0x45b9c5[_0x42ac('0x49')]['id'];}return db[_0x42ac('0x2c')][_0x42ac('0x4a')]({'where':{'id':_0x45b9c5[_0x42ac('0x4b')]['id']}})[_0x42ac('0x24')](handleEntityNotFound(_0x4c3687,null))['then'](saveUpdates(_0x45b9c5[_0x42ac('0x49')],null))[_0x42ac('0x24')](respondWithResult(_0x4c3687,null))[_0x42ac('0x44')](handleError(_0x4c3687,null));};exports[_0x42ac('0x23')]=function(_0x431be0,_0x2f63b3){return db[_0x42ac('0x2c')][_0x42ac('0x4a')]({'where':{'id':_0x431be0['params']['id']}})[_0x42ac('0x24')](handleEntityNotFound(_0x2f63b3,null))[_0x42ac('0x24')](removeEntity(_0x2f63b3,null))[_0x42ac('0x44')](handleError(_0x2f63b3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8e83204..00219c5 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 _0xd4fd=['int_zendesk_fields','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField'];(function(_0x2e555a,_0x422d25){var _0x22cf87=function(_0x2929ac){while(--_0x2929ac){_0x2e555a['push'](_0x2e555a['shift']());}};_0x22cf87(++_0x422d25);}(_0xd4fd,0xf4));var _0xdd4f=function(_0x2ad13b,_0x50f582){_0x2ad13b=_0x2ad13b-0x0;var _0x25c499=_0xd4fd[_0x2ad13b];return _0x25c499;};'use strict';var _=require('lodash');var util=require(_0xdd4f('0x0'));var logger=require(_0xdd4f('0x1'))(_0xdd4f('0x2'));var moment=require(_0xdd4f('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd4f('0x4'));var fs=require('fs');var path=require(_0xdd4f('0x5'));var rimraf=require(_0xdd4f('0x6'));var config=require(_0xdd4f('0x7'));var attributes=require(_0xdd4f('0x8'));module[_0xdd4f('0x9')]=function(_0x5ced34,_0x3decdb){return _0x5ced34['define'](_0xdd4f('0xa'),attributes,{'tableName':_0xdd4f('0xb'),'paranoid':![],'indexes':[{'name':_0xdd4f('0xc'),'fields':[_0xdd4f('0xd'),_0xdd4f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x09b1=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields'];(function(_0x136b8d,_0x428d95){var _0x32ee8a=function(_0xa7c348){while(--_0xa7c348){_0x136b8d['push'](_0x136b8d['shift']());}};_0x32ee8a(++_0x428d95);}(_0x09b1,0x9c));var _0x109b=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x09b1[_0x62c958];return _0x57ec61;};'use strict';var _=require(_0x109b('0x0'));var util=require(_0x109b('0x1'));var logger=require(_0x109b('0x2'))(_0x109b('0x3'));var moment=require(_0x109b('0x4'));var BPromise=require(_0x109b('0x5'));var rp=require(_0x109b('0x6'));var fs=require('fs');var path=require(_0x109b('0x7'));var rimraf=require(_0x109b('0x8'));var config=require(_0x109b('0x9'));var attributes=require(_0x109b('0xa'));module[_0x109b('0xb')]=function(_0x462cb6,_0x3dc611){return _0x462cb6['define'](_0x109b('0xc'),attributes,{'tableName':_0x109b('0xd'),'paranoid':![],'indexes':[{'name':_0x109b('0xe'),'fields':[_0x109b('0xf'),_0x109b('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 094d681..27b3e4b 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 _0x666a=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x94bc3,_0x71d86c){var _0x28c5f5=function(_0x1984eb){while(--_0x1984eb){_0x94bc3['push'](_0x94bc3['shift']());}};_0x28c5f5(++_0x71d86c);}(_0x666a,0x1eb));var _0xa666=function(_0x5c36a1,_0x308449){_0x5c36a1=_0x5c36a1-0x0;var _0x54ae1d=_0x666a[_0x5c36a1];return _0x54ae1d;};'use strict';var _=require('lodash');var util=require(_0xa666('0x0'));var moment=require(_0xa666('0x1'));var BPromise=require(_0xa666('0x2'));var rs=require(_0xa666('0x3'));var fs=require('fs');var Redis=require(_0xa666('0x4'));var db=require(_0xa666('0x5'))['db'];var utils=require(_0xa666('0x6'));var logger=require(_0xa666('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa666('0x8'));var client=jayson[_0xa666('0x9')][_0xa666('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14742f,_0x59661f,_0x5eec7f){return new BPromise(function(_0x21e6f7,_0x299707){return client[_0xa666('0xb')](_0x14742f,_0x5eec7f)[_0xa666('0xc')](function(_0x53df1e){logger[_0xa666('0xd')](_0xa666('0xe'),_0x59661f,'request\x20sent');logger[_0xa666('0xf')](_0xa666('0x10'),_0x59661f,_0xa666('0x11'),JSON[_0xa666('0x12')](_0x53df1e));if(_0x53df1e['error']){if(_0x53df1e['error'][_0xa666('0x13')]===0x1f4){logger['error'](_0xa666('0xe'),_0x59661f,_0x53df1e[_0xa666('0x14')]['message']);return _0x299707(_0x53df1e[_0xa666('0x14')][_0xa666('0x15')]);}logger['error'](_0xa666('0xe'),_0x59661f,_0x53df1e['error'][_0xa666('0x15')]);return _0x21e6f7(_0x53df1e['error']['message']);}else{logger['info'](_0xa666('0xe'),_0x59661f,_0xa666('0x11'));_0x21e6f7(_0x53df1e['result'][_0xa666('0x15')]);}})[_0xa666('0x16')](function(_0x5852e0){logger[_0xa666('0x14')](_0xa666('0xe'),_0x59661f,_0x5852e0);_0x299707(_0x5852e0);});});} \ No newline at end of file +var _0xa0ce=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x2e5bd9,_0x1bc893){var _0x44be4b=function(_0x545d5f){while(--_0x545d5f){_0x2e5bd9['push'](_0x2e5bd9['shift']());}};_0x44be4b(++_0x1bc893);}(_0xa0ce,0x195));var _0xea0c=function(_0x5b4917,_0x2f9906){_0x5b4917=_0x5b4917-0x0;var _0x387825=_0xa0ce[_0x5b4917];return _0x387825;};'use strict';var _=require(_0xea0c('0x0'));var util=require('util');var moment=require(_0xea0c('0x1'));var BPromise=require(_0xea0c('0x2'));var rs=require(_0xea0c('0x3'));var fs=require('fs');var Redis=require(_0xea0c('0x4'));var db=require(_0xea0c('0x5'))['db'];var utils=require(_0xea0c('0x6'));var logger=require(_0xea0c('0x7'))(_0xea0c('0x8'));var config=require(_0xea0c('0x9'));var jayson=require(_0xea0c('0xa'));var client=jayson['client'][_0xea0c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a58b6,_0x3f7aff,_0x241b52){return new BPromise(function(_0x50eb46,_0x1d5bc7){return client['request'](_0x2a58b6,_0x241b52)[_0xea0c('0xc')](function(_0x359152){logger[_0xea0c('0xd')](_0xea0c('0xe'),_0x3f7aff,_0xea0c('0xf'));logger['debug'](_0xea0c('0x10'),_0x3f7aff,_0xea0c('0xf'),JSON[_0xea0c('0x11')](_0x359152));if(_0x359152[_0xea0c('0x12')]){if(_0x359152['error']['code']===0x1f4){logger[_0xea0c('0x12')](_0xea0c('0xe'),_0x3f7aff,_0x359152[_0xea0c('0x12')][_0xea0c('0x13')]);return _0x1d5bc7(_0x359152['error']['message']);}logger['error'](_0xea0c('0xe'),_0x3f7aff,_0x359152[_0xea0c('0x12')]['message']);return _0x50eb46(_0x359152[_0xea0c('0x12')][_0xea0c('0x13')]);}else{logger['info'](_0xea0c('0xe'),_0x3f7aff,_0xea0c('0xf'));_0x50eb46(_0x359152[_0xea0c('0x14')][_0xea0c('0x13')]);}})[_0xea0c('0x15')](function(_0x3281a1){logger[_0xea0c('0x12')](_0xea0c('0xe'),_0x3f7aff,_0x3281a1);_0x1d5bc7(_0x3281a1);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 19591ff..5c38319 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 _0xcecc=['/:id/fields','post','addConfiguration','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/configurations'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcecc,0xcd));var _0xccec=function(_0x316087,_0x56789f){_0x316087=_0x316087-0x0;var _0x1c4515=_0xcecc[_0x316087];return _0x1c4515;};'use strict';var multer=require('multer');var util=require(_0xccec('0x0'));var path=require('path');var timeout=require(_0xccec('0x1'));var express=require(_0xccec('0x2'));var router=express[_0xccec('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xccec('0x4'));var interaction=require(_0xccec('0x5'));var config=require(_0xccec('0x6'));var controller=require('./intZohoAccount.controller');router[_0xccec('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xccec('0x7')](_0xccec('0x8'),auth[_0xccec('0x9')](),controller['show']);router[_0xccec('0x7')](_0xccec('0xa'),auth[_0xccec('0x9')](),controller['getConfigurations']);router['get'](_0xccec('0xb'),auth[_0xccec('0x9')](),controller['getFields']);router[_0xccec('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xccec('0xc')](_0xccec('0xa'),auth[_0xccec('0x9')](),controller[_0xccec('0xd')]);router[_0xccec('0xe')]('/:id',auth[_0xccec('0x9')](),controller[_0xccec('0xf')]);router[_0xccec('0x10')](_0xccec('0x8'),auth['isAuthenticated'](),controller[_0xccec('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7f9f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x43fb15,_0x4b3f5b){var _0x42d47a=function(_0x27859b){while(--_0x27859b){_0x43fb15['push'](_0x43fb15['shift']());}};_0x42d47a(++_0x4b3f5b);}(_0x7f9f,0x1ae));var _0xf7f9=function(_0xc16f38,_0x22cdb9){_0xc16f38=_0xc16f38-0x0;var _0x11a838=_0x7f9f[_0xc16f38];return _0x11a838;};'use strict';var multer=require(_0xf7f9('0x0'));var util=require('util');var path=require(_0xf7f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xf7f9('0x2'));var router=express['Router']();var fs_extra=require(_0xf7f9('0x3'));var auth=require(_0xf7f9('0x4'));var interaction=require(_0xf7f9('0x5'));var config=require(_0xf7f9('0x6'));var controller=require(_0xf7f9('0x7'));router[_0xf7f9('0x8')]('/',auth[_0xf7f9('0x9')](),controller[_0xf7f9('0xa')]);router[_0xf7f9('0x8')](_0xf7f9('0xb'),auth[_0xf7f9('0x9')](),controller[_0xf7f9('0xc')]);router['get'](_0xf7f9('0xd'),auth[_0xf7f9('0x9')](),controller[_0xf7f9('0xe')]);router['get'](_0xf7f9('0xf'),auth['isAuthenticated'](),controller[_0xf7f9('0x10')]);router[_0xf7f9('0x11')]('/',auth['isAuthenticated'](),controller[_0xf7f9('0x12')]);router[_0xf7f9('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xf7f9('0x13')](_0xf7f9('0xb'),auth[_0xf7f9('0x9')](),controller[_0xf7f9('0x14')]);router[_0xf7f9('0x15')](_0xf7f9('0xb'),auth['isAuthenticated'](),controller[_0xf7f9('0x16')]);module[_0xf7f9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ed225ef..970e492 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 _0x91a7=['STRING','exports'];(function(_0x59d322,_0x3716bb){var _0x1dece5=function(_0x140d09){while(--_0x140d09){_0x59d322['push'](_0x59d322['shift']());}};_0x1dece5(++_0x3716bb);}(_0x91a7,0xe7));var _0x791a=function(_0x26620b,_0x4e0e1b){_0x26620b=_0x26620b-0x0;var _0x5f3fce=_0x91a7[_0x26620b];return _0x5f3fce;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x791a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x791a('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file +var _0x668b=['exports','STRING','sequelize'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x668b,0x140));var _0xb668=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0x668b[_0x65d12e];return _0x4274e0;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb668('0x2')]},'host':{'type':Sequelize[_0xb668('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb668('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb668('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xb668('0x2')]},'refreshToken':{'type':Sequelize[_0xb668('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 8f46110..f789105 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 _0x9468=['json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','ZohoAccount','rawAttributes','length','find','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','zoho.eu','com','serverUrl','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','remove','includes','api_name','system_mandatory','display_label','custom_field','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','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','../../mysqldb','../../components/integrations/configuration','status','end'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9468,0x165));var _0x8946=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x9468[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require(_0x8946('0x0'));var rimraf=require(_0x8946('0x1'));var zipdir=require(_0x8946('0x2'));var jsonpatch=require(_0x8946('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8946('0x4'));var util=require(_0x8946('0x5'));var path=require(_0x8946('0x6'));var sox=require('sox');var csv=require(_0x8946('0x7'));var ejs=require(_0x8946('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8946('0x9'));var crypto=require(_0x8946('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8946('0xb'));var toCsv=require(_0x8946('0x7'));var querystring=require('querystring');var Papa=require(_0x8946('0xc'));var Redis=require(_0x8946('0xd'));var authService=require(_0x8946('0xe'));var qs=require(_0x8946('0xf'));var as=require(_0x8946('0x10'));var hardwareService=require(_0x8946('0x11'));var logger=require(_0x8946('0x12'))(_0x8946('0x13'));var utils=require(_0x8946('0x14'));var config=require(_0x8946('0x15'));var licenseUtil=require(_0x8946('0x16'));var db=require(_0x8946('0x17'))['db'];var integrations=require(_0x8946('0x18'));function respondWithStatusCode(_0x518afa,_0x277262){_0x277262=_0x277262||0xcc;return function(_0xf4df5e){if(_0xf4df5e){return _0x518afa['sendStatus'](_0x277262);}return _0x518afa[_0x8946('0x19')](_0x277262)[_0x8946('0x1a')]();};}function respondWithResult(_0x1c58c7,_0x46d42c){_0x46d42c=_0x46d42c||0xc8;return function(_0xde4cd7){if(_0xde4cd7){return _0x1c58c7[_0x8946('0x19')](_0x46d42c)[_0x8946('0x1b')](_0xde4cd7);}};}function respondWithFilteredResult(_0xe9c334,_0x1daee9){return function(_0x684e69){if(_0x684e69){var _0x59d00b=typeof _0x1daee9[_0x8946('0x1c')]===_0x8946('0x1d')&&typeof _0x1daee9['limit']===_0x8946('0x1d');var _0x4e7695=_0x684e69[_0x8946('0x1e')];var _0x8bb63=_0x59d00b?0x0:_0x1daee9['offset'];var _0x4b2c2a=_0x59d00b?_0x684e69[_0x8946('0x1e')]:_0x1daee9[_0x8946('0x1c')]+_0x1daee9[_0x8946('0x1f')];var _0x3a1520;if(_0x4b2c2a>=_0x4e7695){_0x4b2c2a=_0x4e7695;_0x3a1520=0xc8;}else{_0x3a1520=0xce;}_0xe9c334[_0x8946('0x19')](_0x3a1520);return _0xe9c334['set'](_0x8946('0x20'),_0x8bb63+'-'+_0x4b2c2a+'/'+_0x4e7695)[_0x8946('0x1b')](_0x684e69);}return null;};}function patchUpdates(_0x2d44cc){return function(_0x2c0a90){try{jsonpatch[_0x8946('0x21')](_0x2c0a90,_0x2d44cc,!![]);}catch(_0xe4d285){return BPromise[_0x8946('0x22')](_0xe4d285);}return _0x2c0a90[_0x8946('0x23')]();};}function saveUpdates(_0x2effcd,_0x296151){return function(_0x258a44){if(_0x258a44){return _0x258a44[_0x8946('0x24')](_0x2effcd)[_0x8946('0x25')](function(_0x490aa6){return _0x490aa6;});}return null;};}function removeEntity(_0x3f82e3,_0x2a664e){return function(_0x443e64){if(_0x443e64){return _0x443e64[_0x8946('0x26')]()['then'](function(){_0x3f82e3[_0x8946('0x19')](0xcc)[_0x8946('0x1a')]();});}};}function handleEntityNotFound(_0x4d7af6,_0x463037){return function(_0x1bcbda){if(!_0x1bcbda){_0x4d7af6[_0x8946('0x27')](0x194);}return _0x1bcbda;};}function handleError(_0x41082c,_0xb6df58){_0xb6df58=_0xb6df58||0x1f4;return function(_0x4ee20a){logger[_0x8946('0x28')](_0x4ee20a['stack']);if(_0x4ee20a['name']){delete _0x4ee20a[_0x8946('0x29')];}_0x41082c['status'](_0xb6df58)[_0x8946('0x2a')](_0x4ee20a);};}exports[_0x8946('0x2b')]=function(_0xf5ebd3,_0xd9a556){var _0x46efa0={},_0x750ca7={},_0x979723={'count':0x0,'rows':[]};var _0x494a17=_[_0x8946('0x2c')](db['ZohoAccount']['rawAttributes'],function(_0x3d26f2){return{'name':_0x3d26f2[_0x8946('0x2d')],'type':_0x3d26f2[_0x8946('0x2e')][_0x8946('0x2f')]};});_0x750ca7[_0x8946('0x30')]=_['map'](_0x494a17,_0x8946('0x29'));_0x750ca7[_0x8946('0x31')]=_[_0x8946('0x32')](_0xf5ebd3[_0x8946('0x31')]);_0x750ca7['filters']=_[_0x8946('0x33')](_0x750ca7[_0x8946('0x30')],_0x750ca7[_0x8946('0x31')]);_0x46efa0['attributes']=_[_0x8946('0x33')](_0x750ca7[_0x8946('0x30')],qs[_0x8946('0x34')](_0xf5ebd3[_0x8946('0x31')][_0x8946('0x34')]));_0x46efa0[_0x8946('0x35')]=_0x46efa0['attributes']['length']?_0x46efa0[_0x8946('0x35')]:_0x750ca7[_0x8946('0x30')];if(!_0xf5ebd3['query']['hasOwnProperty'](_0x8946('0x36'))){_0x46efa0[_0x8946('0x1f')]=qs[_0x8946('0x1f')](_0xf5ebd3[_0x8946('0x31')][_0x8946('0x1f')]);_0x46efa0[_0x8946('0x1c')]=qs[_0x8946('0x1c')](_0xf5ebd3[_0x8946('0x31')][_0x8946('0x1c')]);}_0x46efa0['order']=qs['sort'](_0xf5ebd3['query'][_0x8946('0x37')]);_0x46efa0[_0x8946('0x38')]=qs[_0x8946('0x39')](_[_0x8946('0x3a')](_0xf5ebd3[_0x8946('0x31')],_0x750ca7[_0x8946('0x39')]),_0x494a17);if(_0xf5ebd3[_0x8946('0x31')][_0x8946('0x3b')]){_0x46efa0[_0x8946('0x38')]=_[_0x8946('0x3c')](_0x46efa0['where'],{'$or':_[_0x8946('0x2c')](_0x494a17,function(_0x1280b0){if(_0x1280b0[_0x8946('0x2e')]!==_0x8946('0x3d')){var _0x1ab4dc={};_0x1ab4dc[_0x1280b0[_0x8946('0x29')]]={'$like':'%'+_0xf5ebd3['query'][_0x8946('0x3b')]+'%'};return _0x1ab4dc;}})});}_0x46efa0=_[_0x8946('0x3c')]({},_0x46efa0,_0xf5ebd3[_0x8946('0x3e')]);var _0x3da23c={'where':_0x46efa0['where']};return db['ZohoAccount'][_0x8946('0x1e')](_0x3da23c)[_0x8946('0x25')](function(_0xab2d65){_0x979723[_0x8946('0x1e')]=_0xab2d65;if(_0xf5ebd3[_0x8946('0x31')][_0x8946('0x3f')]){_0x46efa0[_0x8946('0x40')]=[{'all':!![]}];}return db['ZohoAccount'][_0x8946('0x41')](_0x46efa0);})[_0x8946('0x25')](function(_0x28c8d3){_0x979723['rows']=_0x28c8d3;return _0x979723;})['then'](respondWithFilteredResult(_0xd9a556,_0x46efa0))[_0x8946('0x42')](handleError(_0xd9a556,null));};exports['show']=function(_0x4643c3,_0x7f39b2){var _0x563a97={'raw':![],'where':{'id':_0x4643c3[_0x8946('0x43')]['id']}},_0x3202c7={};_0x3202c7[_0x8946('0x30')]=_[_0x8946('0x32')](db[_0x8946('0x44')][_0x8946('0x45')]);_0x3202c7[_0x8946('0x31')]=_[_0x8946('0x32')](_0x4643c3[_0x8946('0x31')]);_0x3202c7[_0x8946('0x39')]=_[_0x8946('0x33')](_0x3202c7[_0x8946('0x30')],_0x3202c7[_0x8946('0x31')]);_0x563a97[_0x8946('0x35')]=_[_0x8946('0x33')](_0x3202c7['model'],qs[_0x8946('0x34')](_0x4643c3['query'][_0x8946('0x34')]));_0x563a97['attributes']=_0x563a97[_0x8946('0x35')][_0x8946('0x46')]?_0x563a97[_0x8946('0x35')]:_0x3202c7[_0x8946('0x30')];if(_0x4643c3[_0x8946('0x31')][_0x8946('0x3f')]){_0x563a97[_0x8946('0x40')]=[{'all':!![]}];}_0x563a97=_['merge']({},_0x563a97,_0x4643c3['options']);return db[_0x8946('0x44')][_0x8946('0x47')](_0x563a97)[_0x8946('0x25')](handleEntityNotFound(_0x7f39b2,null))[_0x8946('0x25')](respondWithResult(_0x7f39b2,null))[_0x8946('0x42')](handleError(_0x7f39b2,null));};exports['create']=function(_0xb409ae,_0x59d61a){return db[_0x8946('0x44')][_0x8946('0x48')](_0xb409ae[_0x8946('0x49')],{})[_0x8946('0x25')](respondWithResult(_0x59d61a,0xc9))[_0x8946('0x42')](handleError(_0x59d61a,null));};exports[_0x8946('0x24')]=function(_0x357f56,_0x12ca71){if(_0x357f56['body']['id']){delete _0x357f56[_0x8946('0x49')]['id'];}return db[_0x8946('0x44')][_0x8946('0x47')]({'where':{'id':_0x357f56[_0x8946('0x43')]['id']}})[_0x8946('0x25')](handleEntityNotFound(_0x12ca71,null))[_0x8946('0x25')](saveUpdates(_0x357f56[_0x8946('0x49')],null))[_0x8946('0x25')](respondWithResult(_0x12ca71,null))[_0x8946('0x42')](handleError(_0x12ca71,null));};exports[_0x8946('0x26')]=function(_0x3f6f1f,_0x348350){return db[_0x8946('0x44')][_0x8946('0x47')]({'where':{'id':_0x3f6f1f[_0x8946('0x43')]['id']}})[_0x8946('0x25')](handleEntityNotFound(_0x348350,null))['then'](removeEntity(_0x348350,null))[_0x8946('0x42')](handleError(_0x348350,null));};exports[_0x8946('0x4a')]=function(_0x556185,_0x89ac52,_0x15dbb7){var _0x203537={};var _0x563ff4={};var _0x4e1c86;var _0x5bc27c;return db[_0x8946('0x44')][_0x8946('0x4b')]({'where':{'id':_0x556185['params']['id']}})[_0x8946('0x25')](handleEntityNotFound(_0x89ac52,null))[_0x8946('0x25')](function(_0x92539b){if(_0x92539b){_0x4e1c86=_0x92539b;_0x563ff4['model']=_[_0x8946('0x32')](db[_0x8946('0x4c')][_0x8946('0x45')]);_0x563ff4['query']=_['keys'](_0x556185[_0x8946('0x31')]);_0x563ff4[_0x8946('0x39')]=_[_0x8946('0x33')](_0x563ff4[_0x8946('0x30')],_0x563ff4[_0x8946('0x31')]);_0x203537[_0x8946('0x35')]=_[_0x8946('0x33')](_0x563ff4[_0x8946('0x30')],qs[_0x8946('0x34')](_0x556185[_0x8946('0x31')][_0x8946('0x34')]));_0x203537[_0x8946('0x35')]=_0x203537[_0x8946('0x35')][_0x8946('0x46')]?_0x203537[_0x8946('0x35')]:_0x563ff4[_0x8946('0x30')];_0x203537['order']=qs[_0x8946('0x37')](_0x556185[_0x8946('0x31')]['sort']);_0x203537[_0x8946('0x38')]=qs[_0x8946('0x39')](_[_0x8946('0x3a')](_0x556185[_0x8946('0x31')],_0x563ff4[_0x8946('0x39')]));if(_0x556185[_0x8946('0x31')][_0x8946('0x3b')]){_0x203537[_0x8946('0x38')]=_[_0x8946('0x3c')](_0x203537[_0x8946('0x38')],{'$or':_[_0x8946('0x2c')](_0x203537[_0x8946('0x35')],function(_0x4c656c){var _0x31830c={};_0x31830c[_0x4c656c]={'$like':'%'+_0x556185[_0x8946('0x31')][_0x8946('0x3b')]+'%'};return _0x31830c;})});}_0x203537=_[_0x8946('0x3c')]({},_0x203537,_0x556185[_0x8946('0x3e')]);return _0x4e1c86[_0x8946('0x4a')](_0x203537);}})[_0x8946('0x25')](function(_0x3af642){if(_0x3af642){_0x5bc27c=_0x3af642[_0x8946('0x46')];if(!_0x556185[_0x8946('0x31')][_0x8946('0x4d')](_0x8946('0x36'))){_0x203537[_0x8946('0x1f')]=qs['limit'](_0x556185['query'][_0x8946('0x1f')]);_0x203537[_0x8946('0x1c')]=qs[_0x8946('0x1c')](_0x556185['query'][_0x8946('0x1c')]);}return _0x4e1c86[_0x8946('0x4a')](_0x203537);}})['then'](function(_0x106f8f){if(_0x106f8f){return _0x106f8f?{'count':_0x5bc27c,'rows':_0x106f8f}:null;}})['then'](respondWithResult(_0x89ac52,null))['catch'](handleError(_0x89ac52,null));};exports[_0x8946('0x4e')]=function(_0x4fb7f3,_0x74722f,_0x1d9a77){if(_0x4fb7f3[_0x8946('0x49')]['id']){delete _0x4fb7f3['body']['id'];}return db[_0x8946('0x44')]['findOne']({'where':{'id':_0x4fb7f3[_0x8946('0x43')]['id']}})[_0x8946('0x25')](handleEntityNotFound(_0x74722f,null))[_0x8946('0x25')](function(_0x5100a9){if(_0x5100a9){_0x4fb7f3[_0x8946('0x49')][_0x8946('0x4f')]=_0x5100a9['id'];_0x4fb7f3['body'][_0x8946('0x50')]=integrations['getSubjects'](_0x4fb7f3['body'][_0x8946('0x51')],_0x4fb7f3['body'][_0x8946('0x2e')]);_0x4fb7f3[_0x8946('0x49')][_0x8946('0x52')]=integrations[_0x8946('0x53')](_0x4fb7f3[_0x8946('0x49')][_0x8946('0x51')],_0x4fb7f3[_0x8946('0x49')][_0x8946('0x2e')]);return db[_0x8946('0x4c')][_0x8946('0x48')](_0x4fb7f3['body'],{'include':[{'model':db[_0x8946('0x54')],'as':_0x8946('0x50')},{'model':db[_0x8946('0x54')],'as':_0x8946('0x52')}]});}return null;})[_0x8946('0x25')](respondWithResult(_0x74722f,null))['catch'](handleError(_0x74722f,null));};function getAccessToken(_0x275b24){return new Promise(function(_0x5b89af,_0x145eb7){var _0x5c43be;switch(_0x275b24[_0x8946('0x55')]){case'US':_0x5c43be=_0x8946('0x56');break;case'AU':_0x5c43be=_0x8946('0x57');break;case'EU':_0x5c43be='https://accounts.zoho.eu';break;case'IN':_0x5c43be=_0x8946('0x58');break;case'CN':_0x5c43be=_0x8946('0x59');break;default:_0x5c43be=_0x8946('0x5a');break;}var _0x2d0a25={'method':'POST','uri':_0x5c43be+_0x8946('0x5b'),'qs':{'refresh_token':_0x275b24[_0x8946('0x5c')],'client_id':_0x275b24[_0x8946('0x5d')],'client_secret':_0x275b24[_0x8946('0x5e')],'grant_type':_0x8946('0x5f')},'json':!![]};return rp(_0x2d0a25)[_0x8946('0x25')](function(_0x35fc56){if(_0x35fc56[_0x8946('0x60')]){_0x5b89af(_0x35fc56[_0x8946('0x60')]);}else{_0x145eb7(_0x8946('0x61'));}})[_0x8946('0x42')](function(_0x13c775){_0x145eb7(_0x13c775);});});}exports[_0x8946('0x62')]=function(_0x52bd7b,_0x400323,_0x4c2e19){var _0x52dbfd,_0x20531b,_0x4885cf,_0xae4da7,_0x2acacb;return db[_0x8946('0x44')]['findOne']({'where':{'id':_0x52bd7b[_0x8946('0x43')]['id']},'attributes':['id',_0x8946('0x63'),_0x8946('0x55'),_0x8946('0x5d'),'clientSecret','serverUrl',_0x8946('0x64'),_0x8946('0x5c')]})[_0x8946('0x25')](handleEntityNotFound(_0x400323,null))[_0x8946('0x25')](function(_0x2028dd){_0x2acacb=_0x2028dd;_0x52dbfd=_0x2acacb[_0x8946('0x63')];_0x20531b=_0x52dbfd===_0x8946('0x65')?'eu':_0x8946('0x66');_0x4885cf=_0x2acacb[_0x8946('0x67')];var _0x2bb34c=_0x4885cf['slice'](-0x1);if(_0x2bb34c==='/'||_0x2bb34c==='\x5c'||_0x2bb34c===':'){_0x4885cf=_0x4885cf[_0x8946('0x68')](0x0,_0x4885cf['lastIndexOf'](_0x2bb34c));}if(!_0x2acacb[_0x8946('0x5c')]){throw new Error(_0x8946('0x69'));}return getAccessToken(_0x2acacb);})[_0x8946('0x25')](function(_0x56b789){if(_0x56b789){return rp({'method':_0x8946('0x6a'),'uri':util[_0x8946('0x6b')](_0x8946('0x6c'),_0x20531b),'qs':{'module':_0x8946('0x6d')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x56b789},'json':!![]});}})[_0x8946('0x25')](function(_0x32bbbb){if(_0x32bbbb){if(_0x32bbbb[_0x8946('0x6e')]&&_0x32bbbb[_0x8946('0x6e')]['error']){throw new Error(_0x32bbbb['response'][_0x8946('0x28')][_0x8946('0x6f')]);}var _0x3a760e=[];var _0x218f0d=[];var _0x2ebbd6=['Owner',_0x8946('0x70'),_0x8946('0x71'),_0x8946('0x72'),_0x8946('0x73'),_0x8946('0x74'),'Call_Start_Time','Call_Type'];_0x218f0d=_[_0x8946('0x75')](_0x32bbbb[_0x8946('0x34')],function(_0x1785ab){return _0x2ebbd6[_0x8946('0x76')](_0x1785ab[_0x8946('0x77')]);});for(var _0x46e276=0x0;_0x46e276<_0x218f0d[_0x8946('0x46')];_0x46e276++){if(_0x218f0d[_0x46e276][_0x8946('0x78')]===![]){_0x3a760e['push']({'id':_0x218f0d[_0x46e276]['id'],'name':_0x218f0d[_0x46e276][_0x8946('0x79')],'custom':_0x218f0d[_0x46e276][_0x8946('0x7a')],'options':_0x218f0d[_0x46e276]['data_type']==='picklist'&&_0x218f0d[_0x46e276][_0x8946('0x7b')][_0x8946('0x46')]>-0x1?_[_0x8946('0x2c')](_0x218f0d[_0x46e276][_0x8946('0x7b')],function(_0x577bf7){return{'name':_0x577bf7,'value':_0x577bf7};}):[]});}}return{'count':_0x3a760e[_0x8946('0x46')],'rows':_0x3a760e};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x400323,null))[_0x8946('0x42')](function(_0x50be02){var _0x227f7=_0x52bd7b[_0x8946('0x31')]['test']?0x1f4:_0x50be02[_0x8946('0x7c')]||0x1f4;logger[_0x8946('0x28')](_0x8946('0x7d'),_0x8946('0x62'),_0x227f7,JSON[_0x8946('0x7e')](_0x50be02));delete _0x50be02[_0x8946('0x29')];if(_0x227f7===0x191){_0x227f7=0x190;}_0x400323['status'](_0x227f7)[_0x8946('0x2a')](_0x52bd7b[_0x8946('0x31')][_0x8946('0x7f')]?{'message':'Wrong\x20credentials','statusCode':_0x50be02[_0x8946('0x7c')]}:_0x50be02);});}; \ No newline at end of file +var _0x0c44=['zoho.eu','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','response','error','message','Subject','Description','WhoId','Call_Duration','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','Content-Range','apply','reject','update','then','sendStatus','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','offset','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','body','params','destroy','getConfigurations','findOne','ZohoConfiguration','length','sort','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken'];(function(_0x281353,_0x5d53a9){var _0x4f4e7b=function(_0x43ade6){while(--_0x43ade6){_0x281353['push'](_0x281353['shift']());}};_0x4f4e7b(++_0x5d53a9);}(_0x0c44,0x182));var _0x40c4=function(_0x5c5231,_0x47847e){_0x5c5231=_0x5c5231-0x0;var _0x47c48c=_0x0c44[_0x5c5231];return _0x47c48c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x40c4('0x0'));var zipdir=require(_0x40c4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40c4('0x2'));var moment=require(_0x40c4('0x3'));var BPromise=require(_0x40c4('0x4'));var Mustache=require(_0x40c4('0x5'));var util=require('util');var path=require(_0x40c4('0x6'));var sox=require('sox');var csv=require(_0x40c4('0x7'));var ejs=require(_0x40c4('0x8'));var fs=require('fs');var fs_extra=require(_0x40c4('0x9'));var _=require('lodash');var squel=require(_0x40c4('0xa'));var crypto=require(_0x40c4('0xb'));var jsforce=require(_0x40c4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x40c4('0x7'));var querystring=require('querystring');var Papa=require(_0x40c4('0xd'));var Redis=require(_0x40c4('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x40c4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x40c4('0x10'));var logger=require(_0x40c4('0x11'))(_0x40c4('0x12'));var utils=require(_0x40c4('0x13'));var config=require(_0x40c4('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x40c4('0x15'));function respondWithStatusCode(_0x519904,_0x390e96){_0x390e96=_0x390e96||0xcc;return function(_0x349471){if(_0x349471){return _0x519904['sendStatus'](_0x390e96);}return _0x519904[_0x40c4('0x16')](_0x390e96)[_0x40c4('0x17')]();};}function respondWithResult(_0x1cd12e,_0x4b8eba){_0x4b8eba=_0x4b8eba||0xc8;return function(_0x363ec2){if(_0x363ec2){return _0x1cd12e[_0x40c4('0x16')](_0x4b8eba)[_0x40c4('0x18')](_0x363ec2);}};}function respondWithFilteredResult(_0x372b47,_0x164037){return function(_0x15955b){if(_0x15955b){var _0x177111=typeof _0x164037['offset']===_0x40c4('0x19')&&typeof _0x164037['limit']===_0x40c4('0x19');var _0x5f374c=_0x15955b[_0x40c4('0x1a')];var _0x38ad94=_0x177111?0x0:_0x164037['offset'];var _0x4630e4=_0x177111?_0x15955b['count']:_0x164037['offset']+_0x164037['limit'];var _0x3af19b;if(_0x4630e4>=_0x5f374c){_0x4630e4=_0x5f374c;_0x3af19b=0xc8;}else{_0x3af19b=0xce;}_0x372b47[_0x40c4('0x16')](_0x3af19b);return _0x372b47['set'](_0x40c4('0x1b'),_0x38ad94+'-'+_0x4630e4+'/'+_0x5f374c)['json'](_0x15955b);}return null;};}function patchUpdates(_0x5ac346){return function(_0x533784){try{jsonpatch[_0x40c4('0x1c')](_0x533784,_0x5ac346,!![]);}catch(_0x1df5b7){return BPromise[_0x40c4('0x1d')](_0x1df5b7);}return _0x533784['save']();};}function saveUpdates(_0x52be01,_0x4dd26e){return function(_0x107916){if(_0x107916){return _0x107916[_0x40c4('0x1e')](_0x52be01)[_0x40c4('0x1f')](function(_0x221dad){return _0x221dad;});}return null;};}function removeEntity(_0x3f95c2,_0x5cdb47){return function(_0x307cf5){if(_0x307cf5){return _0x307cf5['destroy']()[_0x40c4('0x1f')](function(){_0x3f95c2[_0x40c4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17cb94,_0x13c5b4){return function(_0x13237d){if(!_0x13237d){_0x17cb94[_0x40c4('0x20')](0x194);}return _0x13237d;};}function handleError(_0x2ed78d,_0x2b30df){_0x2b30df=_0x2b30df||0x1f4;return function(_0x434c85){logger['error'](_0x434c85['stack']);if(_0x434c85[_0x40c4('0x21')]){delete _0x434c85[_0x40c4('0x21')];}_0x2ed78d[_0x40c4('0x16')](_0x2b30df)['send'](_0x434c85);};}exports[_0x40c4('0x22')]=function(_0x2ea7c2,_0x251801){var _0x21330a={},_0x4ba584={},_0x14658d={'count':0x0,'rows':[]};var _0x4523bb=_[_0x40c4('0x23')](db[_0x40c4('0x24')][_0x40c4('0x25')],function(_0x27bcf1){return{'name':_0x27bcf1[_0x40c4('0x26')],'type':_0x27bcf1[_0x40c4('0x27')][_0x40c4('0x28')]};});_0x4ba584['model']=_[_0x40c4('0x23')](_0x4523bb,_0x40c4('0x21'));_0x4ba584['query']=_[_0x40c4('0x29')](_0x2ea7c2[_0x40c4('0x2a')]);_0x4ba584[_0x40c4('0x2b')]=_['intersection'](_0x4ba584[_0x40c4('0x2c')],_0x4ba584['query']);_0x21330a[_0x40c4('0x2d')]=_[_0x40c4('0x2e')](_0x4ba584[_0x40c4('0x2c')],qs[_0x40c4('0x2f')](_0x2ea7c2['query'][_0x40c4('0x2f')]));_0x21330a[_0x40c4('0x2d')]=_0x21330a[_0x40c4('0x2d')]['length']?_0x21330a['attributes']:_0x4ba584[_0x40c4('0x2c')];if(!_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x30')](_0x40c4('0x31'))){_0x21330a[_0x40c4('0x32')]=qs['limit'](_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x32')]);_0x21330a[_0x40c4('0x33')]=qs[_0x40c4('0x33')](_0x2ea7c2[_0x40c4('0x2a')]['offset']);}_0x21330a[_0x40c4('0x34')]=qs['sort'](_0x2ea7c2[_0x40c4('0x2a')]['sort']);_0x21330a[_0x40c4('0x35')]=qs[_0x40c4('0x2b')](_[_0x40c4('0x36')](_0x2ea7c2['query'],_0x4ba584[_0x40c4('0x2b')]),_0x4523bb);if(_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x37')]){_0x21330a['where']=_[_0x40c4('0x38')](_0x21330a[_0x40c4('0x35')],{'$or':_[_0x40c4('0x23')](_0x4523bb,function(_0x3ed9b0){if(_0x3ed9b0[_0x40c4('0x27')]!==_0x40c4('0x39')){var _0x37cc04={};_0x37cc04[_0x3ed9b0['name']]={'$like':'%'+_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x37')]+'%'};return _0x37cc04;}})});}_0x21330a=_[_0x40c4('0x38')]({},_0x21330a,_0x2ea7c2['options']);var _0x1541b0={'where':_0x21330a[_0x40c4('0x35')]};return db[_0x40c4('0x24')]['count'](_0x1541b0)[_0x40c4('0x1f')](function(_0x24e3e9){_0x14658d[_0x40c4('0x1a')]=_0x24e3e9;if(_0x2ea7c2[_0x40c4('0x2a')][_0x40c4('0x3a')]){_0x21330a[_0x40c4('0x3b')]=[{'all':!![]}];}return db[_0x40c4('0x24')][_0x40c4('0x3c')](_0x21330a);})[_0x40c4('0x1f')](function(_0x45e50c){_0x14658d[_0x40c4('0x3d')]=_0x45e50c;return _0x14658d;})['then'](respondWithFilteredResult(_0x251801,_0x21330a))[_0x40c4('0x3e')](handleError(_0x251801,null));};exports['show']=function(_0x4533ab,_0x4ce31f){var _0x1d7a9a={'raw':![],'where':{'id':_0x4533ab['params']['id']}},_0x2a9c10={};_0x2a9c10[_0x40c4('0x2c')]=_['keys'](db['ZohoAccount'][_0x40c4('0x25')]);_0x2a9c10[_0x40c4('0x2a')]=_[_0x40c4('0x29')](_0x4533ab[_0x40c4('0x2a')]);_0x2a9c10[_0x40c4('0x2b')]=_[_0x40c4('0x2e')](_0x2a9c10[_0x40c4('0x2c')],_0x2a9c10[_0x40c4('0x2a')]);_0x1d7a9a[_0x40c4('0x2d')]=_[_0x40c4('0x2e')](_0x2a9c10[_0x40c4('0x2c')],qs['fields'](_0x4533ab[_0x40c4('0x2a')][_0x40c4('0x2f')]));_0x1d7a9a[_0x40c4('0x2d')]=_0x1d7a9a[_0x40c4('0x2d')]['length']?_0x1d7a9a[_0x40c4('0x2d')]:_0x2a9c10[_0x40c4('0x2c')];if(_0x4533ab[_0x40c4('0x2a')][_0x40c4('0x3a')]){_0x1d7a9a[_0x40c4('0x3b')]=[{'all':!![]}];}_0x1d7a9a=_[_0x40c4('0x38')]({},_0x1d7a9a,_0x4533ab[_0x40c4('0x3f')]);return db[_0x40c4('0x24')]['find'](_0x1d7a9a)['then'](handleEntityNotFound(_0x4ce31f,null))[_0x40c4('0x1f')](respondWithResult(_0x4ce31f,null))[_0x40c4('0x3e')](handleError(_0x4ce31f,null));};exports['create']=function(_0x30364f,_0x62f4c3){return db[_0x40c4('0x24')]['create'](_0x30364f[_0x40c4('0x40')],{})[_0x40c4('0x1f')](respondWithResult(_0x62f4c3,0xc9))[_0x40c4('0x3e')](handleError(_0x62f4c3,null));};exports[_0x40c4('0x1e')]=function(_0x3f8b3b,_0x5d99d5){if(_0x3f8b3b[_0x40c4('0x40')]['id']){delete _0x3f8b3b[_0x40c4('0x40')]['id'];}return db[_0x40c4('0x24')]['find']({'where':{'id':_0x3f8b3b[_0x40c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5d99d5,null))[_0x40c4('0x1f')](saveUpdates(_0x3f8b3b['body'],null))[_0x40c4('0x1f')](respondWithResult(_0x5d99d5,null))[_0x40c4('0x3e')](handleError(_0x5d99d5,null));};exports[_0x40c4('0x42')]=function(_0xeca72f,_0x50141a){return db[_0x40c4('0x24')]['find']({'where':{'id':_0xeca72f['params']['id']}})[_0x40c4('0x1f')](handleEntityNotFound(_0x50141a,null))[_0x40c4('0x1f')](removeEntity(_0x50141a,null))[_0x40c4('0x3e')](handleError(_0x50141a,null));};exports[_0x40c4('0x43')]=function(_0x19a139,_0x3c867b,_0x1854c0){var _0xd8549a={};var _0x22df57={};var _0x38cafc;var _0x5d2bf7;return db['ZohoAccount'][_0x40c4('0x44')]({'where':{'id':_0x19a139[_0x40c4('0x41')]['id']}})[_0x40c4('0x1f')](handleEntityNotFound(_0x3c867b,null))[_0x40c4('0x1f')](function(_0x5bb26e){if(_0x5bb26e){_0x38cafc=_0x5bb26e;_0x22df57['model']=_[_0x40c4('0x29')](db[_0x40c4('0x45')]['rawAttributes']);_0x22df57[_0x40c4('0x2a')]=_[_0x40c4('0x29')](_0x19a139[_0x40c4('0x2a')]);_0x22df57[_0x40c4('0x2b')]=_[_0x40c4('0x2e')](_0x22df57['model'],_0x22df57[_0x40c4('0x2a')]);_0xd8549a['attributes']=_[_0x40c4('0x2e')](_0x22df57[_0x40c4('0x2c')],qs[_0x40c4('0x2f')](_0x19a139['query'][_0x40c4('0x2f')]));_0xd8549a['attributes']=_0xd8549a[_0x40c4('0x2d')][_0x40c4('0x46')]?_0xd8549a[_0x40c4('0x2d')]:_0x22df57[_0x40c4('0x2c')];_0xd8549a[_0x40c4('0x34')]=qs[_0x40c4('0x47')](_0x19a139[_0x40c4('0x2a')][_0x40c4('0x47')]);_0xd8549a[_0x40c4('0x35')]=qs[_0x40c4('0x2b')](_[_0x40c4('0x36')](_0x19a139[_0x40c4('0x2a')],_0x22df57[_0x40c4('0x2b')]));if(_0x19a139[_0x40c4('0x2a')]['filter']){_0xd8549a[_0x40c4('0x35')]=_[_0x40c4('0x38')](_0xd8549a[_0x40c4('0x35')],{'$or':_[_0x40c4('0x23')](_0xd8549a[_0x40c4('0x2d')],function(_0x32fa0f){var _0x16d5ad={};_0x16d5ad[_0x32fa0f]={'$like':'%'+_0x19a139['query']['filter']+'%'};return _0x16d5ad;})});}_0xd8549a=_['merge']({},_0xd8549a,_0x19a139[_0x40c4('0x3f')]);return _0x38cafc[_0x40c4('0x43')](_0xd8549a);}})[_0x40c4('0x1f')](function(_0x1ee889){if(_0x1ee889){_0x5d2bf7=_0x1ee889['length'];if(!_0x19a139[_0x40c4('0x2a')][_0x40c4('0x30')](_0x40c4('0x31'))){_0xd8549a[_0x40c4('0x32')]=qs[_0x40c4('0x32')](_0x19a139['query'][_0x40c4('0x32')]);_0xd8549a[_0x40c4('0x33')]=qs[_0x40c4('0x33')](_0x19a139[_0x40c4('0x2a')][_0x40c4('0x33')]);}return _0x38cafc[_0x40c4('0x43')](_0xd8549a);}})[_0x40c4('0x1f')](function(_0xe71f1){if(_0xe71f1){return _0xe71f1?{'count':_0x5d2bf7,'rows':_0xe71f1}:null;}})[_0x40c4('0x1f')](respondWithResult(_0x3c867b,null))[_0x40c4('0x3e')](handleError(_0x3c867b,null));};exports['addConfiguration']=function(_0x54d62a,_0xcc6730,_0x3d68ac){if(_0x54d62a[_0x40c4('0x40')]['id']){delete _0x54d62a[_0x40c4('0x40')]['id'];}return db[_0x40c4('0x24')][_0x40c4('0x44')]({'where':{'id':_0x54d62a[_0x40c4('0x41')]['id']}})[_0x40c4('0x1f')](handleEntityNotFound(_0xcc6730,null))[_0x40c4('0x1f')](function(_0x13a7a2){if(_0x13a7a2){_0x54d62a[_0x40c4('0x40')][_0x40c4('0x48')]=_0x13a7a2['id'];_0x54d62a['body'][_0x40c4('0x49')]=integrations[_0x40c4('0x4a')](_0x54d62a[_0x40c4('0x40')][_0x40c4('0x4b')],_0x54d62a[_0x40c4('0x40')][_0x40c4('0x27')]);_0x54d62a[_0x40c4('0x40')][_0x40c4('0x4c')]=integrations[_0x40c4('0x4d')](_0x54d62a[_0x40c4('0x40')]['channel'],_0x54d62a[_0x40c4('0x40')][_0x40c4('0x27')]);return db[_0x40c4('0x45')][_0x40c4('0x4e')](_0x54d62a[_0x40c4('0x40')],{'include':[{'model':db['ZohoField'],'as':_0x40c4('0x49')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x40c4('0x1f')](respondWithResult(_0xcc6730,null))[_0x40c4('0x3e')](handleError(_0xcc6730,null));};function getAccessToken(_0x1c12a7){return new Promise(function(_0x556317,_0x1f8480){var _0x1b1cb1;switch(_0x1c12a7[_0x40c4('0x4f')]){case'US':_0x1b1cb1=_0x40c4('0x50');break;case'AU':_0x1b1cb1=_0x40c4('0x51');break;case'EU':_0x1b1cb1='https://accounts.zoho.eu';break;case'IN':_0x1b1cb1=_0x40c4('0x52');break;case'CN':_0x1b1cb1=_0x40c4('0x53');break;default:_0x1b1cb1=_0x40c4('0x54');break;}var _0x386588={'method':_0x40c4('0x55'),'uri':_0x1b1cb1+'/oauth/v2/token','qs':{'refresh_token':_0x1c12a7['refreshToken'],'client_id':_0x1c12a7[_0x40c4('0x56')],'client_secret':_0x1c12a7[_0x40c4('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x386588)[_0x40c4('0x1f')](function(_0x1d0812){if(_0x1d0812[_0x40c4('0x58')]){_0x556317(_0x1d0812[_0x40c4('0x58')]);}else{_0x1f8480(_0x40c4('0x59'));}})[_0x40c4('0x3e')](function(_0xd30099){_0x1f8480(_0xd30099);});});}exports['getFields']=function(_0x5d6618,_0x565c1a,_0x22822c){var _0x5f2d89,_0x28db88,_0xafb8d2,_0x1eafd3,_0x3677ea;return db['ZohoAccount']['findOne']({'where':{'id':_0x5d6618[_0x40c4('0x41')]['id']},'attributes':['id',_0x40c4('0x5a'),_0x40c4('0x4f'),_0x40c4('0x56'),_0x40c4('0x57'),_0x40c4('0x5b'),_0x40c4('0x5c'),_0x40c4('0x5d')]})[_0x40c4('0x1f')](handleEntityNotFound(_0x565c1a,null))[_0x40c4('0x1f')](function(_0x3fedef){_0x3677ea=_0x3fedef;_0x5f2d89=_0x3677ea[_0x40c4('0x5a')];_0x28db88=_0x5f2d89===_0x40c4('0x5e')?'eu':'com';_0xafb8d2=_0x3677ea[_0x40c4('0x5b')];var _0x2485c7=_0xafb8d2[_0x40c4('0x5f')](-0x1);if(_0x2485c7==='/'||_0x2485c7==='\x5c'||_0x2485c7===':'){_0xafb8d2=_0xafb8d2['substring'](0x0,_0xafb8d2[_0x40c4('0x60')](_0x2485c7));}if(!_0x3677ea['refreshToken']){throw new Error(_0x40c4('0x61'));}return getAccessToken(_0x3677ea);})['then'](function(_0x38b0e2){if(_0x38b0e2){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x28db88),'qs':{'module':_0x40c4('0x62')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x38b0e2},'json':!![]});}})[_0x40c4('0x1f')](function(_0xa9d22d){if(_0xa9d22d){if(_0xa9d22d[_0x40c4('0x63')]&&_0xa9d22d[_0x40c4('0x63')][_0x40c4('0x64')]){throw new Error(_0xa9d22d[_0x40c4('0x63')][_0x40c4('0x64')][_0x40c4('0x65')]);}var _0x374e17=[];var _0xd792a8=[];var _0x56f381=['Owner',_0x40c4('0x66'),_0x40c4('0x67'),_0x40c4('0x68'),_0x40c4('0x69'),'Call_Result','Call_Start_Time',_0x40c4('0x6a')];_0xd792a8=_[_0x40c4('0x6b')](_0xa9d22d[_0x40c4('0x2f')],function(_0x57e534){return _0x56f381['includes'](_0x57e534[_0x40c4('0x6c')]);});for(var _0x59ef38=0x0;_0x59ef38<_0xd792a8[_0x40c4('0x46')];_0x59ef38++){if(_0xd792a8[_0x59ef38][_0x40c4('0x6d')]===![]){_0x374e17[_0x40c4('0x6e')]({'id':_0xd792a8[_0x59ef38]['id'],'name':_0xd792a8[_0x59ef38][_0x40c4('0x6f')],'custom':_0xd792a8[_0x59ef38][_0x40c4('0x70')],'options':_0xd792a8[_0x59ef38]['data_type']===_0x40c4('0x71')&&_0xd792a8[_0x59ef38][_0x40c4('0x72')][_0x40c4('0x46')]>-0x1?_[_0x40c4('0x23')](_0xd792a8[_0x59ef38]['pick_list_values'],function(_0x236eff){return{'name':_0x236eff,'value':_0x236eff};}):[]});}}return{'count':_0x374e17['length'],'rows':_0x374e17};}else{return{'count':0x0,'rows':[]};}})[_0x40c4('0x1f')](respondWithResult(_0x565c1a,null))['catch'](function(_0x1ee4bf){var _0x1daa0c=_0x5d6618[_0x40c4('0x2a')][_0x40c4('0x73')]?0x1f4:_0x1ee4bf[_0x40c4('0x74')]||0x1f4;logger[_0x40c4('0x64')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1daa0c,JSON[_0x40c4('0x75')](_0x1ee4bf));delete _0x1ee4bf['name'];if(_0x1daa0c===0x191){_0x1daa0c=0x190;}_0x565c1a[_0x40c4('0x16')](_0x1daa0c)[_0x40c4('0x76')](_0x5d6618[_0x40c4('0x2a')][_0x40c4('0x73')]?{'message':_0x40c4('0x77'),'statusCode':_0x1ee4bf[_0x40c4('0x74')]}:_0x1ee4bf);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 9cc9417..73d0813 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 _0xf750=['serverUrl','clientId','clientSecret','code','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','slice','https://accounts.zoho.com.au','application/x-www-form-urlencoded','catch','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','ZohoAccount','changed'];(function(_0x3359b0,_0x13700a){var _0x2e823b=function(_0x187257){while(--_0x187257){_0x3359b0['push'](_0x3359b0['shift']());}};_0x2e823b(++_0x13700a);}(_0xf750,0x11a));var _0x0f75=function(_0x1137ac,_0x353892){_0x1137ac=_0x1137ac-0x0;var _0x2ac89b=_0xf750[_0x1137ac];return _0x2ac89b;};'use strict';var _=require(_0x0f75('0x0'));var util=require(_0x0f75('0x1'));var logger=require(_0x0f75('0x2'))(_0x0f75('0x3'));var moment=require(_0x0f75('0x4'));var BPromise=require(_0x0f75('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f75('0x6'));var rimraf=require(_0x0f75('0x7'));var config=require(_0x0f75('0x8'));var attributes=require(_0x0f75('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x28e7a7,_0x3cc7bc){return _0x28e7a7['define'](_0x0f75('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2935b0,_0x44b461,_0x523b9f){if(_0x2935b0[_0x0f75('0xb')]('zone')||_0x2935b0['changed'](_0x0f75('0xc'))||_0x2935b0[_0x0f75('0xb')](_0x0f75('0xd'))||_0x2935b0['changed'](_0x0f75('0xe'))||_0x2935b0[_0x0f75('0xb')](_0x0f75('0xf'))||_0x2935b0[_0x0f75('0xb')](_0x0f75('0x10'))){var _0x5a4a2b,_0x179312;_0x5a4a2b=_0x2935b0['serverUrl'];var _0x4e22f5=_0x5a4a2b['slice'](-0x1);if(_0x4e22f5==='/'||_0x4e22f5==='\x5c'||_0x4e22f5===':'){_0x5a4a2b=_0x5a4a2b[_0x0f75('0x11')](0x0,_0x5a4a2b[_0x0f75('0x12')](_0x4e22f5));}switch(_0x2935b0[_0x0f75('0x13')]){case'US':_0x179312=_0x0f75('0x14');break;case'AU':_0x179312='https://accounts.zoho.com.au';break;case'IN':_0x179312=_0x0f75('0x15');break;case'CN':_0x179312=_0x0f75('0x16');break;default:_0x179312=_0x0f75('0x17');break;}var _0x2db429={'method':_0x0f75('0x18'),'uri':_0x179312+_0x0f75('0x19'),'form':{'grant_type':_0x0f75('0x1a'),'client_id':_0x2935b0[_0x0f75('0xd')],'client_secret':_0x2935b0[_0x0f75('0xe')],'redirect_uri':_0x2935b0[_0x0f75('0xc')],'code':_0x2935b0[_0x0f75('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2db429)[_0x0f75('0x1b')](function(_0x493ab1){var _0x13f87c=JSON[_0x0f75('0x1c')](_0x493ab1);if(_0x13f87c[_0x0f75('0x1d')]){_0x2935b0[_0x0f75('0x1e')]=_0x13f87c[_0x0f75('0x1d')];logger[_0x0f75('0x1f')](util[_0x0f75('0x20')](_0x0f75('0x21'),_0x2935b0[_0x0f75('0x22')],_0x2935b0['id']));}else{logger[_0x0f75('0x23')](util[_0x0f75('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2935b0[_0x0f75('0x22')],_0x2935b0['id']),util[_0x0f75('0x24')](_0x13f87c,{'showHidden':![],'depth':null}));}return _0x523b9f(null,_0x44b461);})['catch'](function(_0x5a0a7e){logger[_0x0f75('0x23')](util[_0x0f75('0x20')](_0x0f75('0x25'),_0x2935b0['name'],_0x2935b0['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x523b9f(_0x5a0a7e);});}else{return _0x523b9f(null,_0x44b461);}},'beforeUpdate':function(_0x2cb2b7,_0x2c4238,_0x2122df){if(_0x2cb2b7[_0x0f75('0xb')](_0x0f75('0x13'))||_0x2cb2b7['changed']('serverUrl')||_0x2cb2b7[_0x0f75('0xb')](_0x0f75('0xd'))||_0x2cb2b7[_0x0f75('0xb')]('clientSecret')||_0x2cb2b7[_0x0f75('0xb')](_0x0f75('0xf'))||_0x2cb2b7[_0x0f75('0xb')](_0x0f75('0x10'))){var _0x9c302f,_0x443be4;_0x9c302f=_0x2cb2b7[_0x0f75('0xc')];var _0x41e701=_0x9c302f[_0x0f75('0x26')](-0x1);if(_0x41e701==='/'||_0x41e701==='\x5c'||_0x41e701===':'){_0x9c302f=_0x9c302f['substring'](0x0,_0x9c302f[_0x0f75('0x12')](_0x41e701));}switch(_0x2cb2b7[_0x0f75('0x13')]){case'US':_0x443be4=_0x0f75('0x14');break;case'AU':_0x443be4=_0x0f75('0x27');break;case'IN':_0x443be4=_0x0f75('0x15');break;case'CN':_0x443be4=_0x0f75('0x16');break;default:_0x443be4='https://accounts.zoho.eu';break;}var _0x31c840={'method':'POST','uri':_0x443be4+_0x0f75('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x2cb2b7['clientId'],'client_secret':_0x2cb2b7[_0x0f75('0xe')],'redirect_uri':_0x2cb2b7['serverUrl'],'code':_0x2cb2b7[_0x0f75('0xf')]},'headers':{'Content-Type':_0x0f75('0x28')}};return rp(_0x31c840)[_0x0f75('0x1b')](function(_0x2cdfc2){var _0x1c5ae4=JSON['parse'](_0x2cdfc2);if(_0x1c5ae4['refresh_token']){_0x2cb2b7[_0x0f75('0x1e')]=_0x1c5ae4[_0x0f75('0x1d')];logger['info'](util[_0x0f75('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2cb2b7[_0x0f75('0x22')],_0x2cb2b7['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2cb2b7[_0x0f75('0x22')],_0x2cb2b7['id']),util[_0x0f75('0x24')](_0x1c5ae4,{'showHidden':![],'depth':null}));}return _0x2122df(null,_0x2c4238);})[_0x0f75('0x29')](function(_0x212960){logger[_0x0f75('0x23')](util[_0x0f75('0x20')](_0x0f75('0x25'),_0x2cb2b7['name'],_0x2cb2b7['id']),util[_0x0f75('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2122df(_0x212960);});}else{return _0x2122df(null,_0x2c4238);}}}});}; \ No newline at end of file +var _0x2455=['host','slice','lastIndexOf','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.eu','application/x-www-form-urlencoded','parse','error','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code'];(function(_0x3fb34e,_0x374153){var _0x588e97=function(_0x5f1096){while(--_0x5f1096){_0x3fb34e['push'](_0x3fb34e['shift']());}};_0x588e97(++_0x374153);}(_0x2455,0x19c));var _0x5245=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0x2455[_0x172ed7];return _0xfa8f61;};'use strict';var _=require(_0x5245('0x0'));var util=require(_0x5245('0x1'));var logger=require(_0x5245('0x2'))(_0x5245('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5245('0x4'));var fs=require('fs');var path=require(_0x5245('0x5'));var rimraf=require('rimraf');var config=require(_0x5245('0x6'));var attributes=require(_0x5245('0x7'));var integrations=require(_0x5245('0x8'));module[_0x5245('0x9')]=function(_0x5bcb64,_0x4ab414){return _0x5bcb64[_0x5245('0xa')](_0x5245('0xb'),attributes,{'tableName':_0x5245('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x523331,_0x29be80,_0x4f6ec2){if(_0x523331['changed']('zone')||_0x523331[_0x5245('0xd')](_0x5245('0xe'))||_0x523331[_0x5245('0xd')](_0x5245('0xf'))||_0x523331[_0x5245('0xd')](_0x5245('0x10'))||_0x523331[_0x5245('0xd')](_0x5245('0x11'))||_0x523331[_0x5245('0xd')](_0x5245('0x12'))){var _0x2c2df3,_0x307a9e;_0x2c2df3=_0x523331[_0x5245('0xe')];var _0x42ee7a=_0x2c2df3[_0x5245('0x13')](-0x1);if(_0x42ee7a==='/'||_0x42ee7a==='\x5c'||_0x42ee7a===':'){_0x2c2df3=_0x2c2df3['substring'](0x0,_0x2c2df3[_0x5245('0x14')](_0x42ee7a));}switch(_0x523331[_0x5245('0x15')]){case'US':_0x307a9e='https://accounts.zoho.com';break;case'AU':_0x307a9e=_0x5245('0x16');break;case'IN':_0x307a9e=_0x5245('0x17');break;case'CN':_0x307a9e=_0x5245('0x18');break;default:_0x307a9e='https://accounts.zoho.eu';break;}var _0x3fb677={'method':_0x5245('0x19'),'uri':_0x307a9e+_0x5245('0x1a'),'form':{'grant_type':_0x5245('0x1b'),'client_id':_0x523331[_0x5245('0xf')],'client_secret':_0x523331[_0x5245('0x10')],'redirect_uri':_0x523331[_0x5245('0xe')],'code':_0x523331[_0x5245('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3fb677)[_0x5245('0x1c')](function(_0x5b5d52){var _0x318601=JSON['parse'](_0x5b5d52);if(_0x318601[_0x5245('0x1d')]){_0x523331[_0x5245('0x1e')]=_0x318601['refresh_token'];logger[_0x5245('0x1f')](util[_0x5245('0x20')](_0x5245('0x21'),_0x523331[_0x5245('0x22')],_0x523331['id']));}else{logger['error'](util[_0x5245('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x523331['name'],_0x523331['id']),util[_0x5245('0x23')](_0x318601,{'showHidden':![],'depth':null}));}return _0x4f6ec2(null,_0x29be80);})[_0x5245('0x24')](function(_0x4689dd){logger['error'](util[_0x5245('0x20')](_0x5245('0x25'),_0x523331['name'],_0x523331['id']),util[_0x5245('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x4f6ec2(_0x4689dd);});}else{return _0x4f6ec2(null,_0x29be80);}},'beforeUpdate':function(_0x624d5e,_0x1be4dc,_0x46111d){if(_0x624d5e['changed'](_0x5245('0x15'))||_0x624d5e['changed'](_0x5245('0xe'))||_0x624d5e[_0x5245('0xd')]('clientId')||_0x624d5e[_0x5245('0xd')](_0x5245('0x10'))||_0x624d5e[_0x5245('0xd')](_0x5245('0x11'))||_0x624d5e[_0x5245('0xd')](_0x5245('0x12'))){var _0x1ec74e,_0x51253e;_0x1ec74e=_0x624d5e[_0x5245('0xe')];var _0x420a5f=_0x1ec74e['slice'](-0x1);if(_0x420a5f==='/'||_0x420a5f==='\x5c'||_0x420a5f===':'){_0x1ec74e=_0x1ec74e[_0x5245('0x26')](0x0,_0x1ec74e[_0x5245('0x14')](_0x420a5f));}switch(_0x624d5e['zone']){case'US':_0x51253e='https://accounts.zoho.com';break;case'AU':_0x51253e=_0x5245('0x16');break;case'IN':_0x51253e='https://accounts.zoho.in';break;case'CN':_0x51253e=_0x5245('0x18');break;default:_0x51253e=_0x5245('0x27');break;}var _0x2d16f6={'method':'POST','uri':_0x51253e+'/oauth/v2/token','form':{'grant_type':_0x5245('0x1b'),'client_id':_0x624d5e[_0x5245('0xf')],'client_secret':_0x624d5e[_0x5245('0x10')],'redirect_uri':_0x624d5e['serverUrl'],'code':_0x624d5e['code']},'headers':{'Content-Type':_0x5245('0x28')}};return rp(_0x2d16f6)[_0x5245('0x1c')](function(_0x11244a){var _0x201ec9=JSON[_0x5245('0x29')](_0x11244a);if(_0x201ec9[_0x5245('0x1d')]){_0x624d5e['refreshToken']=_0x201ec9[_0x5245('0x1d')];logger['info'](util[_0x5245('0x20')](_0x5245('0x21'),_0x624d5e[_0x5245('0x22')],_0x624d5e['id']));}else{logger[_0x5245('0x2a')](util[_0x5245('0x20')](_0x5245('0x25'),_0x624d5e[_0x5245('0x22')],_0x624d5e['id']),util['inspect'](_0x201ec9,{'showHidden':![],'depth':null}));}return _0x46111d(null,_0x1be4dc);})[_0x5245('0x24')](function(_0x342b25){logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x624d5e['name'],_0x624d5e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x46111d(_0x342b25);});}else{return _0x46111d(null,_0x1be4dc);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index de84fb7..f33338f 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 _0x23bb=['debug','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','findAll','raw','options','where','attributes','limit','map','include','model','then','ShowZohoAccount','find','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent'];(function(_0x26b5cb,_0x15f879){var _0x3b2277=function(_0x12fe27){while(--_0x12fe27){_0x26b5cb['push'](_0x26b5cb['shift']());}};_0x3b2277(++_0x15f879);}(_0x23bb,0x79));var _0xb23b=function(_0x51708f,_0x511834){_0x51708f=_0x51708f-0x0;var _0x5c60a3=_0x23bb[_0x51708f];return _0x5c60a3;};'use strict';var _=require(_0xb23b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb23b('0x1'));var rs=require(_0xb23b('0x2'));var fs=require('fs');var Redis=require(_0xb23b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb23b('0x4'));var logger=require(_0xb23b('0x5'))(_0xb23b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb23b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c5626,_0x4a2873,_0x596a94){return new BPromise(function(_0x29e8e9,_0x4d00fe){return client[_0xb23b('0x8')](_0x4c5626,_0x596a94)['then'](function(_0x23270c){logger[_0xb23b('0x9')]('ZohoAccount,\x20%s,\x20%s',_0x4a2873,_0xb23b('0xa'));logger[_0xb23b('0xb')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4a2873,_0xb23b('0xa'),JSON[_0xb23b('0xc')](_0x23270c));if(_0x23270c[_0xb23b('0xd')]){if(_0x23270c['error'][_0xb23b('0xe')]===0x1f4){logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);return _0x4d00fe(_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);}logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);return _0x29e8e9(_0x23270c[_0xb23b('0xd')][_0xb23b('0x10')]);}else{logger[_0xb23b('0x9')](_0xb23b('0xf'),_0x4a2873,_0xb23b('0xa'));_0x29e8e9(_0x23270c[_0xb23b('0x11')]['message']);}})[_0xb23b('0x12')](function(_0x3c5852){logger[_0xb23b('0xd')](_0xb23b('0xf'),_0x4a2873,_0x3c5852);_0x4d00fe(_0x3c5852);});});}exports[_0xb23b('0x13')]=function(_0x582554){var _0x1db9a7=this;return new Promise(function(_0x547704,_0x2cd266){return db[_0xb23b('0x14')][_0xb23b('0x15')]({'raw':_0x582554['options']?_0x582554['options'][_0xb23b('0x16')]===undefined?!![]:![]:!![],'where':_0x582554[_0xb23b('0x17')]?_0x582554[_0xb23b('0x17')][_0xb23b('0x18')]||null:null,'attributes':_0x582554[_0xb23b('0x17')]?_0x582554[_0xb23b('0x17')][_0xb23b('0x19')]||null:null,'limit':_0x582554['options']?_0x582554[_0xb23b('0x17')][_0xb23b('0x1a')]||null:null,'include':_0x582554[_0xb23b('0x17')]?_0x582554[_0xb23b('0x17')]['include']?_[_0xb23b('0x1b')](_0x582554[_0xb23b('0x17')]['include'],function(_0x11aaac){return{'model':db[_0x11aaac['model']],'as':_0x11aaac['as'],'attributes':_0x11aaac[_0xb23b('0x19')],'include':_0x11aaac['include']?_[_0xb23b('0x1b')](_0x11aaac[_0xb23b('0x1c')],function(_0x50af31){return{'model':db[_0x50af31[_0xb23b('0x1d')]],'as':_0x50af31['as'],'attributes':_0x50af31[_0xb23b('0x19')],'include':_0x50af31[_0xb23b('0x1c')]?_[_0xb23b('0x1b')](_0x50af31[_0xb23b('0x1c')],function(_0x5ebe63){return{'model':db[_0x5ebe63[_0xb23b('0x1d')]],'as':_0x5ebe63['as'],'attributes':_0x5ebe63[_0xb23b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb23b('0x1e')](function(_0x35a723){logger[_0xb23b('0x9')](_0xb23b('0x13'),_0x582554);logger[_0xb23b('0xb')](_0xb23b('0x13'),_0x582554,JSON['stringify'](_0x35a723));_0x547704(_0x35a723);})[_0xb23b('0x12')](function(_0x2758d7){logger[_0xb23b('0xd')]('GetZohoAccount',_0x2758d7[_0xb23b('0x10')],_0x582554);_0x2cd266(_0x1db9a7[_0xb23b('0xd')](0x1f4,_0x2758d7[_0xb23b('0x10')]));});});};exports[_0xb23b('0x1f')]=function(_0x8a9bf2){var _0x496a38=this;return new Promise(function(_0x8c65f3,_0xe7193d){return db[_0xb23b('0x14')][_0xb23b('0x20')]({'raw':_0x8a9bf2[_0xb23b('0x17')]?_0x8a9bf2[_0xb23b('0x17')][_0xb23b('0x16')]===undefined?!![]:![]:!![],'where':_0x8a9bf2[_0xb23b('0x17')]?_0x8a9bf2[_0xb23b('0x17')][_0xb23b('0x18')]||null:null,'attributes':_0x8a9bf2[_0xb23b('0x17')]?_0x8a9bf2[_0xb23b('0x17')]['attributes']||null:null,'include':_0x8a9bf2[_0xb23b('0x17')]?_0x8a9bf2[_0xb23b('0x17')][_0xb23b('0x1c')]?_[_0xb23b('0x1b')](_0x8a9bf2['options'][_0xb23b('0x1c')],function(_0x288ef6){return{'model':db[_0x288ef6[_0xb23b('0x1d')]],'as':_0x288ef6['as'],'attributes':_0x288ef6[_0xb23b('0x19')],'include':_0x288ef6[_0xb23b('0x1c')]?_['map'](_0x288ef6[_0xb23b('0x1c')],function(_0x5d4a17){return{'model':db[_0x5d4a17[_0xb23b('0x1d')]],'as':_0x5d4a17['as'],'attributes':_0x5d4a17['attributes'],'include':_0x5d4a17[_0xb23b('0x1c')]?_['map'](_0x5d4a17[_0xb23b('0x1c')],function(_0x4a5be6){return{'model':db[_0x4a5be6['model']],'as':_0x4a5be6['as'],'attributes':_0x4a5be6[_0xb23b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb23b('0x1e')](function(_0x396fcd){logger['info'](_0xb23b('0x1f'),_0x8a9bf2);logger[_0xb23b('0xb')](_0xb23b('0x1f'),_0x8a9bf2,JSON[_0xb23b('0xc')](_0x396fcd));_0x8c65f3(_0x396fcd);})[_0xb23b('0x12')](function(_0x442b81){logger[_0xb23b('0xd')](_0xb23b('0x1f'),_0x442b81[_0xb23b('0x10')],_0x8a9bf2);_0xe7193d(_0x496a38[_0xb23b('0xd')](0x1f4,_0x442b81['message']));});});}; \ No newline at end of file +var _0xdf92=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','ShowZohoAccount','find','lodash','bluebird','randomstring','ioredis'];(function(_0x18d290,_0x2b09cb){var _0x370fee=function(_0x1b353f){while(--_0x1b353f){_0x18d290['push'](_0x18d290['shift']());}};_0x370fee(++_0x2b09cb);}(_0xdf92,0x10c));var _0x2df9=function(_0x5c8b35,_0x4bf13e){_0x5c8b35=_0x5c8b35-0x0;var _0x2689c1=_0xdf92[_0x5c8b35];return _0x2689c1;};'use strict';var _=require(_0x2df9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2df9('0x1'));var rs=require(_0x2df9('0x2'));var fs=require('fs');var Redis=require(_0x2df9('0x3'));var db=require(_0x2df9('0x4'))['db'];var utils=require(_0x2df9('0x5'));var logger=require(_0x2df9('0x6'))(_0x2df9('0x7'));var config=require(_0x2df9('0x8'));var jayson=require(_0x2df9('0x9'));var client=jayson[_0x2df9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353f73,_0x1ce438,_0x28f58c){return new BPromise(function(_0x2dc316,_0x24de04){return client['request'](_0x353f73,_0x28f58c)[_0x2df9('0xb')](function(_0x40ff87){logger[_0x2df9('0xc')](_0x2df9('0xd'),_0x1ce438,_0x2df9('0xe'));logger[_0x2df9('0xf')](_0x2df9('0x10'),_0x1ce438,_0x2df9('0xe'),JSON[_0x2df9('0x11')](_0x40ff87));if(_0x40ff87['error']){if(_0x40ff87['error'][_0x2df9('0x12')]===0x1f4){logger['error'](_0x2df9('0xd'),_0x1ce438,_0x40ff87[_0x2df9('0x13')]['message']);return _0x24de04(_0x40ff87['error'][_0x2df9('0x14')]);}logger[_0x2df9('0x13')](_0x2df9('0xd'),_0x1ce438,_0x40ff87[_0x2df9('0x13')]['message']);return _0x2dc316(_0x40ff87[_0x2df9('0x13')][_0x2df9('0x14')]);}else{logger[_0x2df9('0xc')](_0x2df9('0xd'),_0x1ce438,_0x2df9('0xe'));_0x2dc316(_0x40ff87['result'][_0x2df9('0x14')]);}})[_0x2df9('0x15')](function(_0x5b3751){logger[_0x2df9('0x13')](_0x2df9('0xd'),_0x1ce438,_0x5b3751);_0x24de04(_0x5b3751);});});}exports[_0x2df9('0x16')]=function(_0xd48d46){var _0x2ed7e3=this;return new Promise(function(_0x46763a,_0x4e6e3e){return db[_0x2df9('0x17')]['findAll']({'raw':_0xd48d46[_0x2df9('0x18')]?_0xd48d46['options'][_0x2df9('0x19')]===undefined?!![]:![]:!![],'where':_0xd48d46['options']?_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1a')]||null:null,'attributes':_0xd48d46[_0x2df9('0x18')]?_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1b')]||null:null,'limit':_0xd48d46[_0x2df9('0x18')]?_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1c')]||null:null,'include':_0xd48d46['options']?_0xd48d46['options'][_0x2df9('0x1d')]?_['map'](_0xd48d46[_0x2df9('0x18')][_0x2df9('0x1d')],function(_0x160a25){return{'model':db[_0x160a25[_0x2df9('0x1e')]],'as':_0x160a25['as'],'attributes':_0x160a25[_0x2df9('0x1b')],'include':_0x160a25[_0x2df9('0x1d')]?_['map'](_0x160a25['include'],function(_0x5a8cc7){return{'model':db[_0x5a8cc7[_0x2df9('0x1e')]],'as':_0x5a8cc7['as'],'attributes':_0x5a8cc7['attributes'],'include':_0x5a8cc7[_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x5a8cc7[_0x2df9('0x1d')],function(_0x19855e){return{'model':db[_0x19855e[_0x2df9('0x1e')]],'as':_0x19855e['as'],'attributes':_0x19855e[_0x2df9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x979ce4){logger[_0x2df9('0xc')](_0x2df9('0x16'),_0xd48d46);logger[_0x2df9('0xf')]('GetZohoAccount',_0xd48d46,JSON[_0x2df9('0x11')](_0x979ce4));_0x46763a(_0x979ce4);})[_0x2df9('0x15')](function(_0xec5c9f){logger['error'](_0x2df9('0x16'),_0xec5c9f[_0x2df9('0x14')],_0xd48d46);_0x4e6e3e(_0x2ed7e3[_0x2df9('0x13')](0x1f4,_0xec5c9f[_0x2df9('0x14')]));});});};exports[_0x2df9('0x20')]=function(_0x23cc34){var _0x1e010f=this;return new Promise(function(_0x5d96f6,_0x43726b){return db['ZohoAccount'][_0x2df9('0x21')]({'raw':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')][_0x2df9('0x19')]===undefined?!![]:![]:!![],'where':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')]['where']||null:null,'attributes':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')][_0x2df9('0x1b')]||null:null,'include':_0x23cc34[_0x2df9('0x18')]?_0x23cc34[_0x2df9('0x18')][_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x23cc34['options']['include'],function(_0x40adff){return{'model':db[_0x40adff[_0x2df9('0x1e')]],'as':_0x40adff['as'],'attributes':_0x40adff[_0x2df9('0x1b')],'include':_0x40adff[_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x40adff[_0x2df9('0x1d')],function(_0x1cef4a){return{'model':db[_0x1cef4a['model']],'as':_0x1cef4a['as'],'attributes':_0x1cef4a[_0x2df9('0x1b')],'include':_0x1cef4a[_0x2df9('0x1d')]?_[_0x2df9('0x1f')](_0x1cef4a['include'],function(_0x3dc758){return{'model':db[_0x3dc758[_0x2df9('0x1e')]],'as':_0x3dc758['as'],'attributes':_0x3dc758[_0x2df9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2df9('0xb')](function(_0x606c11){logger[_0x2df9('0xc')]('ShowZohoAccount',_0x23cc34);logger[_0x2df9('0xf')](_0x2df9('0x20'),_0x23cc34,JSON[_0x2df9('0x11')](_0x606c11));_0x5d96f6(_0x606c11);})['catch'](function(_0x30402c){logger[_0x2df9('0x13')](_0x2df9('0x20'),_0x30402c[_0x2df9('0x14')],_0x23cc34);_0x43726b(_0x1e010f['error'](0x1f4,_0x30402c[_0x2df9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ff83c76..28d01c4 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 _0x1ce5=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','delete'];(function(_0x3d03a4,_0x398148){var _0x54e920=function(_0x427ec6){while(--_0x427ec6){_0x3d03a4['push'](_0x3d03a4['shift']());}};_0x54e920(++_0x398148);}(_0x1ce5,0x12e));var _0x51ce=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1ce5[_0x5a95fa];return _0x1a61b8;};'use strict';var multer=require(_0x51ce('0x0'));var util=require(_0x51ce('0x1'));var path=require(_0x51ce('0x2'));var timeout=require(_0x51ce('0x3'));var express=require(_0x51ce('0x4'));var router=express[_0x51ce('0x5')]();var fs_extra=require(_0x51ce('0x6'));var auth=require(_0x51ce('0x7'));var interaction=require(_0x51ce('0x8'));var config=require(_0x51ce('0x9'));var controller=require(_0x51ce('0xa'));router[_0x51ce('0xb')]('/',auth['isAuthenticated'](),controller[_0x51ce('0xc')]);router[_0x51ce('0xb')](_0x51ce('0xd'),auth[_0x51ce('0xe')](),controller[_0x51ce('0xf')]);router[_0x51ce('0xb')](_0x51ce('0x10'),auth[_0x51ce('0xe')](),controller[_0x51ce('0x11')]);router['get'](_0x51ce('0x12'),auth[_0x51ce('0xe')](),controller[_0x51ce('0x13')]);router[_0x51ce('0xb')](_0x51ce('0x14'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x51ce('0x15')]('/',auth[_0x51ce('0xe')](),controller['create']);router['put'](_0x51ce('0xd'),auth[_0x51ce('0xe')](),controller['update']);router[_0x51ce('0x16')](_0x51ce('0xd'),auth['isAuthenticated'](),controller[_0x51ce('0x17')]);module[_0x51ce('0x18')]=router; \ No newline at end of file +var _0x706a=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x706a,0xa8));var _0xa706=function(_0x26d386,_0x1660c0){_0x26d386=_0x26d386-0x0;var _0x4ef9a8=_0x706a[_0x26d386];return _0x4ef9a8;};'use strict';var multer=require(_0xa706('0x0'));var util=require(_0xa706('0x1'));var path=require(_0xa706('0x2'));var timeout=require(_0xa706('0x3'));var express=require(_0xa706('0x4'));var router=express[_0xa706('0x5')]();var fs_extra=require(_0xa706('0x6'));var auth=require(_0xa706('0x7'));var interaction=require(_0xa706('0x8'));var config=require(_0xa706('0x9'));var controller=require(_0xa706('0xa'));router[_0xa706('0xb')]('/',auth[_0xa706('0xc')](),controller[_0xa706('0xd')]);router[_0xa706('0xb')](_0xa706('0xe'),auth['isAuthenticated'](),controller[_0xa706('0xf')]);router[_0xa706('0xb')](_0xa706('0x10'),auth[_0xa706('0xc')](),controller[_0xa706('0x11')]);router['get'](_0xa706('0x12'),auth[_0xa706('0xc')](),controller[_0xa706('0x13')]);router[_0xa706('0xb')](_0xa706('0x14'),auth[_0xa706('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0xa706('0xc')](),controller[_0xa706('0x15')]);router[_0xa706('0x16')](_0xa706('0xe'),auth['isAuthenticated'](),controller[_0xa706('0x17')]);router['delete'](_0xa706('0xe'),auth[_0xa706('0xc')](),controller[_0xa706('0x18')]);module[_0xa706('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9828783..16a1946 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 _0xc125=['nothing','lead','contact_lead','STRING','contact'];(function(_0x41591f,_0x9bd9a9){var _0x5858cb=function(_0x5822a8){while(--_0x5822a8){_0x41591f['push'](_0x41591f['shift']());}};_0x5858cb(++_0x9bd9a9);}(_0xc125,0x6c));var _0x5c12=function(_0x17bbf8,_0xea7e55){_0x17bbf8=_0x17bbf8-0x0;var _0x29bc84=_0xc125[_0x17bbf8];return _0x29bc84;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5c12('0x0')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x5c12('0x1'),_0x5c12('0x2')),'defaultValue':_0x5c12('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5c12('0x4'),_0x5c12('0x1'),'lead'),'defaultValue':_0x5c12('0x4')},'description':{'type':Sequelize[_0x5c12('0x0')]}}; \ No newline at end of file +var _0xedad=['STRING','lead','contact','nothing','ENUM','contact_lead','sequelize','exports'];(function(_0x1d5bed,_0x1e8c23){var _0x5a0c53=function(_0x88caa9){while(--_0x88caa9){_0x1d5bed['push'](_0x1d5bed['shift']());}};_0x5a0c53(++_0x1e8c23);}(_0xedad,0x17e));var _0xdeda=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xedad[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xdeda('0x0'));module[_0xdeda('0x1')]={'name':{'type':Sequelize[_0xdeda('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xdeda('0x3'),_0xdeda('0x4'),_0xdeda('0x5')),'defaultValue':_0xdeda('0x3')},'moduleSearch':{'type':Sequelize[_0xdeda('0x6')](_0xdeda('0x7'),'contact',_0xdeda('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xdeda('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 0032594..56de207 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 _0xb282=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','create','body','find','getFields','findOne','nolimit','getSubjects','params','ZohoField','getDescriptions','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','papaparse','ioredis'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xb282,0x17c));var _0x2b28=function(_0x5807e8,_0x5d1910){_0x5807e8=_0x5807e8-0x0;var _0x2f7f36=_0xb282[_0x5807e8];return _0x2f7f36;};'use strict';var emlformat=require(_0x2b28('0x0'));var rimraf=require(_0x2b28('0x1'));var zipdir=require(_0x2b28('0x2'));var jsonpatch=require(_0x2b28('0x3'));var rp=require(_0x2b28('0x4'));var moment=require('moment');var BPromise=require(_0x2b28('0x5'));var Mustache=require(_0x2b28('0x6'));var util=require(_0x2b28('0x7'));var path=require(_0x2b28('0x8'));var sox=require(_0x2b28('0x9'));var csv=require(_0x2b28('0xa'));var ejs=require(_0x2b28('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b28('0xc'));var squel=require(_0x2b28('0xd'));var crypto=require(_0x2b28('0xe'));var jsforce=require(_0x2b28('0xf'));var deskjs=require(_0x2b28('0x10'));var toCsv=require(_0x2b28('0xa'));var querystring=require(_0x2b28('0x11'));var Papa=require(_0x2b28('0x12'));var Redis=require(_0x2b28('0x13'));var authService=require(_0x2b28('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2b28('0x15'));var hardwareService=require(_0x2b28('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2b28('0x17'));var licenseUtil=require(_0x2b28('0x18'));var db=require(_0x2b28('0x19'))['db'];function respondWithStatusCode(_0x26c7bc,_0x55259c){_0x55259c=_0x55259c||0xcc;return function(_0xffe224){if(_0xffe224){return _0x26c7bc[_0x2b28('0x1a')](_0x55259c);}return _0x26c7bc[_0x2b28('0x1b')](_0x55259c)['end']();};}function respondWithResult(_0x1ea129,_0x570e52){_0x570e52=_0x570e52||0xc8;return function(_0x31a07a){if(_0x31a07a){return _0x1ea129[_0x2b28('0x1b')](_0x570e52)[_0x2b28('0x1c')](_0x31a07a);}};}function respondWithFilteredResult(_0x1506ce,_0x2f24e7){return function(_0x4d2ff8){if(_0x4d2ff8){var _0x443375=typeof _0x2f24e7[_0x2b28('0x1d')]===_0x2b28('0x1e')&&typeof _0x2f24e7[_0x2b28('0x1f')]===_0x2b28('0x1e');var _0x541733=_0x4d2ff8[_0x2b28('0x20')];var _0x58671a=_0x443375?0x0:_0x2f24e7['offset'];var _0x9ef874=_0x443375?_0x4d2ff8[_0x2b28('0x20')]:_0x2f24e7[_0x2b28('0x1d')]+_0x2f24e7[_0x2b28('0x1f')];var _0x162d3f;if(_0x9ef874>=_0x541733){_0x9ef874=_0x541733;_0x162d3f=0xc8;}else{_0x162d3f=0xce;}_0x1506ce['status'](_0x162d3f);return _0x1506ce['set'](_0x2b28('0x21'),_0x58671a+'-'+_0x9ef874+'/'+_0x541733)[_0x2b28('0x1c')](_0x4d2ff8);}return null;};}function patchUpdates(_0x199376){return function(_0x19032d){try{jsonpatch[_0x2b28('0x22')](_0x19032d,_0x199376,!![]);}catch(_0x48d28f){return BPromise[_0x2b28('0x23')](_0x48d28f);}return _0x19032d[_0x2b28('0x24')]();};}function saveUpdates(_0x1663d6,_0x67efa9){return function(_0x24bba0){if(_0x24bba0){return _0x24bba0[_0x2b28('0x25')](_0x1663d6)[_0x2b28('0x26')](function(_0x4018c2){return _0x4018c2;});}return null;};}function removeEntity(_0x5cffdc,_0x4c8ddf){return function(_0x9cccd6){if(_0x9cccd6){return _0x9cccd6[_0x2b28('0x27')]()[_0x2b28('0x26')](function(){_0x5cffdc[_0x2b28('0x1b')](0xcc)[_0x2b28('0x28')]();});}};}function handleEntityNotFound(_0x4b08d5,_0x4583f5){return function(_0xac3798){if(!_0xac3798){_0x4b08d5[_0x2b28('0x1a')](0x194);}return _0xac3798;};}function handleError(_0x285d54,_0x5c8e42){_0x5c8e42=_0x5c8e42||0x1f4;return function(_0xf131dd){logger[_0x2b28('0x29')](_0xf131dd['stack']);if(_0xf131dd[_0x2b28('0x2a')]){delete _0xf131dd[_0x2b28('0x2a')];}_0x285d54[_0x2b28('0x1b')](_0x5c8e42)['send'](_0xf131dd);};}exports['index']=function(_0xed73d4,_0x124f69){var _0x1d02d9={},_0x3adcae={},_0x3441a2={'count':0x0,'rows':[]};var _0x411cb5=_[_0x2b28('0x2b')](db[_0x2b28('0x2c')][_0x2b28('0x2d')],function(_0x19089a){return{'name':_0x19089a[_0x2b28('0x2e')],'type':_0x19089a[_0x2b28('0x2f')][_0x2b28('0x30')]};});_0x3adcae[_0x2b28('0x31')]=_[_0x2b28('0x2b')](_0x411cb5,_0x2b28('0x2a'));_0x3adcae[_0x2b28('0x32')]=_['keys'](_0xed73d4[_0x2b28('0x32')]);_0x3adcae[_0x2b28('0x33')]=_['intersection'](_0x3adcae['model'],_0x3adcae['query']);_0x1d02d9[_0x2b28('0x34')]=_[_0x2b28('0x35')](_0x3adcae[_0x2b28('0x31')],qs[_0x2b28('0x36')](_0xed73d4[_0x2b28('0x32')][_0x2b28('0x36')]));_0x1d02d9[_0x2b28('0x34')]=_0x1d02d9[_0x2b28('0x34')][_0x2b28('0x37')]?_0x1d02d9['attributes']:_0x3adcae['model'];if(!_0xed73d4['query']['hasOwnProperty']('nolimit')){_0x1d02d9['limit']=qs[_0x2b28('0x1f')](_0xed73d4['query'][_0x2b28('0x1f')]);_0x1d02d9['offset']=qs[_0x2b28('0x1d')](_0xed73d4[_0x2b28('0x32')][_0x2b28('0x1d')]);}_0x1d02d9[_0x2b28('0x38')]=qs[_0x2b28('0x39')](_0xed73d4[_0x2b28('0x32')][_0x2b28('0x39')]);_0x1d02d9[_0x2b28('0x3a')]=qs[_0x2b28('0x33')](_[_0x2b28('0x3b')](_0xed73d4['query'],_0x3adcae[_0x2b28('0x33')]),_0x411cb5);if(_0xed73d4[_0x2b28('0x32')][_0x2b28('0x3c')]){_0x1d02d9[_0x2b28('0x3a')]=_[_0x2b28('0x3d')](_0x1d02d9[_0x2b28('0x3a')],{'$or':_['map'](_0x411cb5,function(_0x51b9dc){if(_0x51b9dc[_0x2b28('0x2f')]!==_0x2b28('0x3e')){var _0x59a65a={};_0x59a65a[_0x51b9dc['name']]={'$like':'%'+_0xed73d4[_0x2b28('0x32')][_0x2b28('0x3c')]+'%'};return _0x59a65a;}})});}_0x1d02d9=_[_0x2b28('0x3d')]({},_0x1d02d9,_0xed73d4[_0x2b28('0x3f')]);var _0x13b736={'where':_0x1d02d9['where']};return db[_0x2b28('0x2c')][_0x2b28('0x20')](_0x13b736)[_0x2b28('0x26')](function(_0x3a99b4){_0x3441a2[_0x2b28('0x20')]=_0x3a99b4;if(_0xed73d4[_0x2b28('0x32')][_0x2b28('0x40')]){_0x1d02d9[_0x2b28('0x41')]=[{'all':!![]}];}return db[_0x2b28('0x2c')][_0x2b28('0x42')](_0x1d02d9);})[_0x2b28('0x26')](function(_0x472f39){_0x3441a2['rows']=_0x472f39;return _0x3441a2;})[_0x2b28('0x26')](respondWithFilteredResult(_0x124f69,_0x1d02d9))[_0x2b28('0x43')](handleError(_0x124f69,null));};exports[_0x2b28('0x44')]=function(_0x41f9c7,_0x2225c0){var _0x5f27e3={'raw':![],'where':{'id':_0x41f9c7['params']['id']}},_0x6a66a={};_0x6a66a[_0x2b28('0x31')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x6a66a['query']=_[_0x2b28('0x45')](_0x41f9c7[_0x2b28('0x32')]);_0x6a66a[_0x2b28('0x33')]=_[_0x2b28('0x35')](_0x6a66a[_0x2b28('0x31')],_0x6a66a[_0x2b28('0x32')]);_0x5f27e3[_0x2b28('0x34')]=_['intersection'](_0x6a66a[_0x2b28('0x31')],qs[_0x2b28('0x36')](_0x41f9c7['query'][_0x2b28('0x36')]));_0x5f27e3[_0x2b28('0x34')]=_0x5f27e3['attributes'][_0x2b28('0x37')]?_0x5f27e3[_0x2b28('0x34')]:_0x6a66a[_0x2b28('0x31')];if(_0x41f9c7[_0x2b28('0x32')][_0x2b28('0x40')]){_0x5f27e3[_0x2b28('0x41')]=[{'all':!![]}];}_0x5f27e3=_[_0x2b28('0x3d')]({},_0x5f27e3,_0x41f9c7[_0x2b28('0x3f')]);return db[_0x2b28('0x2c')]['find'](_0x5f27e3)['then'](handleEntityNotFound(_0x2225c0,null))[_0x2b28('0x26')](respondWithResult(_0x2225c0,null))[_0x2b28('0x43')](handleError(_0x2225c0,null));};exports[_0x2b28('0x46')]=function(_0x4f1055,_0x51ddb7){return db['ZohoConfiguration']['create'](_0x4f1055[_0x2b28('0x47')],{})['then'](respondWithResult(_0x51ddb7,0xc9))[_0x2b28('0x43')](handleError(_0x51ddb7,null));};exports[_0x2b28('0x25')]=function(_0x468f61,_0x416753){if(_0x468f61[_0x2b28('0x47')]['id']){delete _0x468f61['body']['id'];}return db['ZohoConfiguration'][_0x2b28('0x48')]({'where':{'id':_0x468f61['params']['id']}})[_0x2b28('0x26')](handleEntityNotFound(_0x416753,null))['then'](saveUpdates(_0x468f61[_0x2b28('0x47')],null))[_0x2b28('0x26')](respondWithResult(_0x416753,null))['catch'](handleError(_0x416753,null));};exports[_0x2b28('0x27')]=function(_0x2c64ef,_0x37fb17){return db[_0x2b28('0x2c')][_0x2b28('0x48')]({'where':{'id':_0x2c64ef['params']['id']}})['then'](handleEntityNotFound(_0x37fb17,null))['then'](removeEntity(_0x37fb17,null))[_0x2b28('0x43')](handleError(_0x37fb17,null));};exports[_0x2b28('0x49')]=function(_0x14e712,_0x2b03a5,_0x50e1d1){var _0x2b78a0={};var _0x189d12={};var _0x4d96f7;var _0x60145d;return db['ZohoConfiguration'][_0x2b28('0x4a')]({'where':{'id':_0x14e712['params']['id']}})[_0x2b28('0x26')](handleEntityNotFound(_0x2b03a5,null))[_0x2b28('0x26')](function(_0x4d73df){if(_0x4d73df){_0x4d96f7=_0x4d73df;_0x189d12['model']=_[_0x2b28('0x45')](db['ZohoField']['rawAttributes']);_0x189d12[_0x2b28('0x32')]=_[_0x2b28('0x45')](_0x14e712[_0x2b28('0x32')]);_0x189d12[_0x2b28('0x33')]=_[_0x2b28('0x35')](_0x189d12[_0x2b28('0x31')],_0x189d12[_0x2b28('0x32')]);_0x2b78a0[_0x2b28('0x34')]=_['intersection'](_0x189d12[_0x2b28('0x31')],qs['fields'](_0x14e712[_0x2b28('0x32')][_0x2b28('0x36')]));_0x2b78a0['attributes']=_0x2b78a0['attributes'][_0x2b28('0x37')]?_0x2b78a0[_0x2b28('0x34')]:_0x189d12[_0x2b28('0x31')];_0x2b78a0[_0x2b28('0x38')]=qs[_0x2b28('0x39')](_0x14e712[_0x2b28('0x32')][_0x2b28('0x39')]);_0x2b78a0['where']=qs['filters'](_[_0x2b28('0x3b')](_0x14e712[_0x2b28('0x32')],_0x189d12['filters']));if(_0x14e712[_0x2b28('0x32')]['filter']){_0x2b78a0['where']=_[_0x2b28('0x3d')](_0x2b78a0[_0x2b28('0x3a')],{'$or':_[_0x2b28('0x2b')](_0x2b78a0['attributes'],function(_0x102e3a){var _0x19d7da={};_0x19d7da[_0x102e3a]={'$like':'%'+_0x14e712[_0x2b28('0x32')][_0x2b28('0x3c')]+'%'};return _0x19d7da;})});}_0x2b78a0=_[_0x2b28('0x3d')]({},_0x2b78a0,_0x14e712[_0x2b28('0x3f')]);return _0x4d96f7['getFields'](_0x2b78a0);}})[_0x2b28('0x26')](function(_0x1f1d9e){if(_0x1f1d9e){_0x60145d=_0x1f1d9e[_0x2b28('0x37')];if(!_0x14e712[_0x2b28('0x32')]['hasOwnProperty'](_0x2b28('0x4b'))){_0x2b78a0[_0x2b28('0x1f')]=qs['limit'](_0x14e712[_0x2b28('0x32')][_0x2b28('0x1f')]);_0x2b78a0['offset']=qs['offset'](_0x14e712[_0x2b28('0x32')][_0x2b28('0x1d')]);}return _0x4d96f7[_0x2b28('0x49')](_0x2b78a0);}})[_0x2b28('0x26')](function(_0x12272e){if(_0x12272e){return _0x12272e?{'count':_0x60145d,'rows':_0x12272e}:null;}})[_0x2b28('0x26')](respondWithResult(_0x2b03a5,null))['catch'](handleError(_0x2b03a5,null));};exports[_0x2b28('0x4c')]=function(_0x5bd196,_0x4a6caf,_0x6c8421){var _0x4c374d={};var _0x5a81af={};var _0x28dbac;var _0x377185;return db[_0x2b28('0x2c')][_0x2b28('0x4a')]({'where':{'id':_0x5bd196[_0x2b28('0x4d')]['id']}})[_0x2b28('0x26')](handleEntityNotFound(_0x4a6caf,null))[_0x2b28('0x26')](function(_0x13e0e4){if(_0x13e0e4){_0x28dbac=_0x13e0e4;_0x5a81af[_0x2b28('0x31')]=_[_0x2b28('0x45')](db[_0x2b28('0x4e')][_0x2b28('0x2d')]);_0x5a81af[_0x2b28('0x32')]=_[_0x2b28('0x45')](_0x5bd196[_0x2b28('0x32')]);_0x5a81af[_0x2b28('0x33')]=_['intersection'](_0x5a81af[_0x2b28('0x31')],_0x5a81af[_0x2b28('0x32')]);_0x4c374d[_0x2b28('0x34')]=_[_0x2b28('0x35')](_0x5a81af[_0x2b28('0x31')],qs[_0x2b28('0x36')](_0x5bd196[_0x2b28('0x32')][_0x2b28('0x36')]));_0x4c374d['attributes']=_0x4c374d[_0x2b28('0x34')][_0x2b28('0x37')]?_0x4c374d[_0x2b28('0x34')]:_0x5a81af[_0x2b28('0x31')];_0x4c374d[_0x2b28('0x38')]=qs[_0x2b28('0x39')](_0x5bd196[_0x2b28('0x32')][_0x2b28('0x39')]);_0x4c374d['where']=qs[_0x2b28('0x33')](_[_0x2b28('0x3b')](_0x5bd196['query'],_0x5a81af['filters']));if(_0x5bd196[_0x2b28('0x32')][_0x2b28('0x3c')]){_0x4c374d[_0x2b28('0x3a')]=_[_0x2b28('0x3d')](_0x4c374d[_0x2b28('0x3a')],{'$or':_[_0x2b28('0x2b')](_0x4c374d[_0x2b28('0x34')],function(_0x6f8ef7){var _0x1d26db={};_0x1d26db[_0x6f8ef7]={'$like':'%'+_0x5bd196[_0x2b28('0x32')]['filter']+'%'};return _0x1d26db;})});}_0x4c374d=_['merge']({},_0x4c374d,_0x5bd196[_0x2b28('0x3f')]);return _0x28dbac['getSubjects'](_0x4c374d);}})[_0x2b28('0x26')](function(_0x31c219){if(_0x31c219){_0x377185=_0x31c219[_0x2b28('0x37')];if(!_0x5bd196['query']['hasOwnProperty'](_0x2b28('0x4b'))){_0x4c374d['limit']=qs[_0x2b28('0x1f')](_0x5bd196['query']['limit']);_0x4c374d[_0x2b28('0x1d')]=qs[_0x2b28('0x1d')](_0x5bd196[_0x2b28('0x32')][_0x2b28('0x1d')]);}return _0x28dbac['getSubjects'](_0x4c374d);}})[_0x2b28('0x26')](function(_0x3d1de3){if(_0x3d1de3){return _0x3d1de3?{'count':_0x377185,'rows':_0x3d1de3}:null;}})[_0x2b28('0x26')](respondWithResult(_0x4a6caf,null))[_0x2b28('0x43')](handleError(_0x4a6caf,null));};exports[_0x2b28('0x4f')]=function(_0x2402fa,_0x1b7ee9,_0x21ae5b){var _0x44497b={};var _0x2012d4={};var _0x2295d7;var _0x58d636;return db[_0x2b28('0x2c')][_0x2b28('0x4a')]({'where':{'id':_0x2402fa[_0x2b28('0x4d')]['id']}})[_0x2b28('0x26')](handleEntityNotFound(_0x1b7ee9,null))[_0x2b28('0x26')](function(_0x36980f){if(_0x36980f){_0x2295d7=_0x36980f;_0x2012d4[_0x2b28('0x31')]=_[_0x2b28('0x45')](db[_0x2b28('0x4e')][_0x2b28('0x2d')]);_0x2012d4[_0x2b28('0x32')]=_[_0x2b28('0x45')](_0x2402fa[_0x2b28('0x32')]);_0x2012d4[_0x2b28('0x33')]=_[_0x2b28('0x35')](_0x2012d4[_0x2b28('0x31')],_0x2012d4[_0x2b28('0x32')]);_0x44497b[_0x2b28('0x34')]=_[_0x2b28('0x35')](_0x2012d4[_0x2b28('0x31')],qs[_0x2b28('0x36')](_0x2402fa[_0x2b28('0x32')][_0x2b28('0x36')]));_0x44497b[_0x2b28('0x34')]=_0x44497b['attributes'][_0x2b28('0x37')]?_0x44497b[_0x2b28('0x34')]:_0x2012d4[_0x2b28('0x31')];_0x44497b['order']=qs[_0x2b28('0x39')](_0x2402fa[_0x2b28('0x32')][_0x2b28('0x39')]);_0x44497b[_0x2b28('0x3a')]=qs[_0x2b28('0x33')](_[_0x2b28('0x3b')](_0x2402fa[_0x2b28('0x32')],_0x2012d4[_0x2b28('0x33')]));if(_0x2402fa[_0x2b28('0x32')]['filter']){_0x44497b[_0x2b28('0x3a')]=_[_0x2b28('0x3d')](_0x44497b[_0x2b28('0x3a')],{'$or':_[_0x2b28('0x2b')](_0x44497b[_0x2b28('0x34')],function(_0x4efce3){var _0x58b5e1={};_0x58b5e1[_0x4efce3]={'$like':'%'+_0x2402fa[_0x2b28('0x32')][_0x2b28('0x3c')]+'%'};return _0x58b5e1;})});}_0x44497b=_[_0x2b28('0x3d')]({},_0x44497b,_0x2402fa[_0x2b28('0x3f')]);return _0x2295d7[_0x2b28('0x4f')](_0x44497b);}})['then'](function(_0x520b4f){if(_0x520b4f){_0x58d636=_0x520b4f['length'];if(!_0x2402fa[_0x2b28('0x32')]['hasOwnProperty']('nolimit')){_0x44497b[_0x2b28('0x1f')]=qs['limit'](_0x2402fa[_0x2b28('0x32')][_0x2b28('0x1f')]);_0x44497b['offset']=qs[_0x2b28('0x1d')](_0x2402fa[_0x2b28('0x32')]['offset']);}return _0x2295d7[_0x2b28('0x4f')](_0x44497b);}})[_0x2b28('0x26')](function(_0x43354e){if(_0x43354e){return _0x43354e?{'count':_0x58d636,'rows':_0x43354e}:null;}})[_0x2b28('0x26')](respondWithResult(_0x1b7ee9,null))['catch'](handleError(_0x1b7ee9,null));}; \ No newline at end of file +var _0x8faa=['pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','findOne','ZohoField','getFields','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../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','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','filters'];(function(_0x94e65d,_0xb4e801){var _0x4ff2d5=function(_0xc2592f){while(--_0xc2592f){_0x94e65d['push'](_0x94e65d['shift']());}};_0x4ff2d5(++_0xb4e801);}(_0x8faa,0x117));var _0xa8fa=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x8faa[_0x34d275];return _0x1379cc;};'use strict';var emlformat=require(_0xa8fa('0x0'));var rimraf=require(_0xa8fa('0x1'));var zipdir=require(_0xa8fa('0x2'));var jsonpatch=require(_0xa8fa('0x3'));var rp=require(_0xa8fa('0x4'));var moment=require(_0xa8fa('0x5'));var BPromise=require(_0xa8fa('0x6'));var Mustache=require('mustache');var util=require(_0xa8fa('0x7'));var path=require('path');var sox=require(_0xa8fa('0x8'));var csv=require(_0xa8fa('0x9'));var ejs=require(_0xa8fa('0xa'));var fs=require('fs');var fs_extra=require(_0xa8fa('0xb'));var _=require(_0xa8fa('0xc'));var squel=require(_0xa8fa('0xd'));var crypto=require(_0xa8fa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa8fa('0xf'));var toCsv=require(_0xa8fa('0x9'));var querystring=require(_0xa8fa('0x10'));var Papa=require(_0xa8fa('0x11'));var Redis=require(_0xa8fa('0x12'));var authService=require(_0xa8fa('0x13'));var qs=require(_0xa8fa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8fa('0x15'));var logger=require(_0xa8fa('0x16'))('api');var utils=require(_0xa8fa('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa8fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x152129,_0x47e80e){_0x47e80e=_0x47e80e||0xcc;return function(_0x22e7bb){if(_0x22e7bb){return _0x152129[_0xa8fa('0x19')](_0x47e80e);}return _0x152129[_0xa8fa('0x1a')](_0x47e80e)[_0xa8fa('0x1b')]();};}function respondWithResult(_0x10c96e,_0x91c93b){_0x91c93b=_0x91c93b||0xc8;return function(_0x3d8e79){if(_0x3d8e79){return _0x10c96e[_0xa8fa('0x1a')](_0x91c93b)[_0xa8fa('0x1c')](_0x3d8e79);}};}function respondWithFilteredResult(_0x5e0111,_0x165874){return function(_0x2d00f3){if(_0x2d00f3){var _0x12ccef=typeof _0x165874[_0xa8fa('0x1d')]===_0xa8fa('0x1e')&&typeof _0x165874[_0xa8fa('0x1f')]===_0xa8fa('0x1e');var _0x547fcc=_0x2d00f3[_0xa8fa('0x20')];var _0x4d4c6b=_0x12ccef?0x0:_0x165874[_0xa8fa('0x1d')];var _0x1ce9ea=_0x12ccef?_0x2d00f3[_0xa8fa('0x20')]:_0x165874[_0xa8fa('0x1d')]+_0x165874[_0xa8fa('0x1f')];var _0x549eb7;if(_0x1ce9ea>=_0x547fcc){_0x1ce9ea=_0x547fcc;_0x549eb7=0xc8;}else{_0x549eb7=0xce;}_0x5e0111[_0xa8fa('0x1a')](_0x549eb7);return _0x5e0111[_0xa8fa('0x21')](_0xa8fa('0x22'),_0x4d4c6b+'-'+_0x1ce9ea+'/'+_0x547fcc)['json'](_0x2d00f3);}return null;};}function patchUpdates(_0x22a582){return function(_0x363b08){try{jsonpatch[_0xa8fa('0x23')](_0x363b08,_0x22a582,!![]);}catch(_0x3b5835){return BPromise[_0xa8fa('0x24')](_0x3b5835);}return _0x363b08[_0xa8fa('0x25')]();};}function saveUpdates(_0xe9b3b0,_0x56786a){return function(_0x59b8dd){if(_0x59b8dd){return _0x59b8dd[_0xa8fa('0x26')](_0xe9b3b0)[_0xa8fa('0x27')](function(_0x3f0239){return _0x3f0239;});}return null;};}function removeEntity(_0x13a0a3,_0x1cc02b){return function(_0x57c347){if(_0x57c347){return _0x57c347[_0xa8fa('0x28')]()['then'](function(){_0x13a0a3[_0xa8fa('0x1a')](0xcc)[_0xa8fa('0x1b')]();});}};}function handleEntityNotFound(_0x1e0dbb,_0x19edf2){return function(_0x3a1c41){if(!_0x3a1c41){_0x1e0dbb['sendStatus'](0x194);}return _0x3a1c41;};}function handleError(_0x236be1,_0x2d29e5){_0x2d29e5=_0x2d29e5||0x1f4;return function(_0x5bf50e){logger[_0xa8fa('0x29')](_0x5bf50e[_0xa8fa('0x2a')]);if(_0x5bf50e[_0xa8fa('0x2b')]){delete _0x5bf50e[_0xa8fa('0x2b')];}_0x236be1['status'](_0x2d29e5)[_0xa8fa('0x2c')](_0x5bf50e);};}exports[_0xa8fa('0x2d')]=function(_0x544bd9,_0x4a4940){var _0x1ec484={},_0x12d611={},_0x5f5702={'count':0x0,'rows':[]};var _0x220770=_[_0xa8fa('0x2e')](db[_0xa8fa('0x2f')][_0xa8fa('0x30')],function(_0x560da6){return{'name':_0x560da6[_0xa8fa('0x31')],'type':_0x560da6['type'][_0xa8fa('0x32')]};});_0x12d611[_0xa8fa('0x33')]=_[_0xa8fa('0x2e')](_0x220770,_0xa8fa('0x2b'));_0x12d611['query']=_['keys'](_0x544bd9[_0xa8fa('0x34')]);_0x12d611['filters']=_[_0xa8fa('0x35')](_0x12d611[_0xa8fa('0x33')],_0x12d611[_0xa8fa('0x34')]);_0x1ec484[_0xa8fa('0x36')]=_[_0xa8fa('0x35')](_0x12d611['model'],qs['fields'](_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x1ec484['attributes']=_0x1ec484[_0xa8fa('0x36')][_0xa8fa('0x38')]?_0x1ec484[_0xa8fa('0x36')]:_0x12d611[_0xa8fa('0x33')];if(!_0x544bd9[_0xa8fa('0x34')]['hasOwnProperty'](_0xa8fa('0x39'))){_0x1ec484['limit']=qs[_0xa8fa('0x1f')](_0x544bd9['query'][_0xa8fa('0x1f')]);_0x1ec484[_0xa8fa('0x1d')]=qs[_0xa8fa('0x1d')](_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x1d')]);}_0x1ec484[_0xa8fa('0x3a')]=qs['sort'](_0x544bd9['query'][_0xa8fa('0x3b')]);_0x1ec484['where']=qs[_0xa8fa('0x3c')](_[_0xa8fa('0x3d')](_0x544bd9['query'],_0x12d611[_0xa8fa('0x3c')]),_0x220770);if(_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x3e')]){_0x1ec484['where']=_['merge'](_0x1ec484['where'],{'$or':_[_0xa8fa('0x2e')](_0x220770,function(_0x36d7d3){if(_0x36d7d3[_0xa8fa('0x3f')]!==_0xa8fa('0x40')){var _0x267a6a={};_0x267a6a[_0x36d7d3['name']]={'$like':'%'+_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x3e')]+'%'};return _0x267a6a;}})});}_0x1ec484=_[_0xa8fa('0x41')]({},_0x1ec484,_0x544bd9[_0xa8fa('0x42')]);var _0x3089df={'where':_0x1ec484[_0xa8fa('0x43')]};return db[_0xa8fa('0x2f')][_0xa8fa('0x20')](_0x3089df)[_0xa8fa('0x27')](function(_0x3e87e9){_0x5f5702[_0xa8fa('0x20')]=_0x3e87e9;if(_0x544bd9[_0xa8fa('0x34')][_0xa8fa('0x44')]){_0x1ec484[_0xa8fa('0x45')]=[{'all':!![]}];}return db[_0xa8fa('0x2f')][_0xa8fa('0x46')](_0x1ec484);})['then'](function(_0x761b5a){_0x5f5702[_0xa8fa('0x47')]=_0x761b5a;return _0x5f5702;})[_0xa8fa('0x27')](respondWithFilteredResult(_0x4a4940,_0x1ec484))[_0xa8fa('0x48')](handleError(_0x4a4940,null));};exports[_0xa8fa('0x49')]=function(_0x2e27d2,_0x507b79){var _0x144941={'raw':![],'where':{'id':_0x2e27d2[_0xa8fa('0x4a')]['id']}},_0x51fac3={};_0x51fac3[_0xa8fa('0x33')]=_['keys'](db[_0xa8fa('0x2f')][_0xa8fa('0x30')]);_0x51fac3[_0xa8fa('0x34')]=_[_0xa8fa('0x4b')](_0x2e27d2[_0xa8fa('0x34')]);_0x51fac3[_0xa8fa('0x3c')]=_[_0xa8fa('0x35')](_0x51fac3[_0xa8fa('0x33')],_0x51fac3[_0xa8fa('0x34')]);_0x144941[_0xa8fa('0x36')]=_[_0xa8fa('0x35')](_0x51fac3[_0xa8fa('0x33')],qs[_0xa8fa('0x37')](_0x2e27d2[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x144941[_0xa8fa('0x36')]=_0x144941['attributes'][_0xa8fa('0x38')]?_0x144941['attributes']:_0x51fac3[_0xa8fa('0x33')];if(_0x2e27d2['query']['includeAll']){_0x144941[_0xa8fa('0x45')]=[{'all':!![]}];}_0x144941=_['merge']({},_0x144941,_0x2e27d2[_0xa8fa('0x42')]);return db['ZohoConfiguration']['find'](_0x144941)[_0xa8fa('0x27')](handleEntityNotFound(_0x507b79,null))[_0xa8fa('0x27')](respondWithResult(_0x507b79,null))[_0xa8fa('0x48')](handleError(_0x507b79,null));};exports['create']=function(_0x544999,_0x1e15d3){return db[_0xa8fa('0x2f')][_0xa8fa('0x4c')](_0x544999[_0xa8fa('0x4d')],{})[_0xa8fa('0x27')](respondWithResult(_0x1e15d3,0xc9))['catch'](handleError(_0x1e15d3,null));};exports['update']=function(_0x3797dd,_0x48cfb9){if(_0x3797dd[_0xa8fa('0x4d')]['id']){delete _0x3797dd['body']['id'];}return db['ZohoConfiguration'][_0xa8fa('0x4e')]({'where':{'id':_0x3797dd[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x48cfb9,null))[_0xa8fa('0x27')](saveUpdates(_0x3797dd[_0xa8fa('0x4d')],null))[_0xa8fa('0x27')](respondWithResult(_0x48cfb9,null))[_0xa8fa('0x48')](handleError(_0x48cfb9,null));};exports[_0xa8fa('0x28')]=function(_0x4e2049,_0x56a8f5){return db['ZohoConfiguration'][_0xa8fa('0x4e')]({'where':{'id':_0x4e2049[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x56a8f5,null))[_0xa8fa('0x27')](removeEntity(_0x56a8f5,null))['catch'](handleError(_0x56a8f5,null));};exports['getFields']=function(_0x5900fd,_0x5b16f6,_0x508e7d){var _0x14ac84={};var _0xc2881c={};var _0x449368;var _0x419fd1;return db[_0xa8fa('0x2f')][_0xa8fa('0x4f')]({'where':{'id':_0x5900fd[_0xa8fa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b16f6,null))['then'](function(_0x32cf37){if(_0x32cf37){_0x449368=_0x32cf37;_0xc2881c['model']=_['keys'](db[_0xa8fa('0x50')][_0xa8fa('0x30')]);_0xc2881c['query']=_['keys'](_0x5900fd[_0xa8fa('0x34')]);_0xc2881c['filters']=_[_0xa8fa('0x35')](_0xc2881c[_0xa8fa('0x33')],_0xc2881c[_0xa8fa('0x34')]);_0x14ac84['attributes']=_[_0xa8fa('0x35')](_0xc2881c[_0xa8fa('0x33')],qs[_0xa8fa('0x37')](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x14ac84['attributes']=_0x14ac84['attributes'][_0xa8fa('0x38')]?_0x14ac84[_0xa8fa('0x36')]:_0xc2881c[_0xa8fa('0x33')];_0x14ac84['order']=qs[_0xa8fa('0x3b')](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x3b')]);_0x14ac84[_0xa8fa('0x43')]=qs[_0xa8fa('0x3c')](_['pick'](_0x5900fd[_0xa8fa('0x34')],_0xc2881c[_0xa8fa('0x3c')]));if(_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x3e')]){_0x14ac84[_0xa8fa('0x43')]=_[_0xa8fa('0x41')](_0x14ac84['where'],{'$or':_[_0xa8fa('0x2e')](_0x14ac84['attributes'],function(_0xa5e696){var _0x1aa491={};_0x1aa491[_0xa5e696]={'$like':'%'+_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x3e')]+'%'};return _0x1aa491;})});}_0x14ac84=_['merge']({},_0x14ac84,_0x5900fd[_0xa8fa('0x42')]);return _0x449368[_0xa8fa('0x51')](_0x14ac84);}})[_0xa8fa('0x27')](function(_0x287a9f){if(_0x287a9f){_0x419fd1=_0x287a9f[_0xa8fa('0x38')];if(!_0x5900fd[_0xa8fa('0x34')]['hasOwnProperty'](_0xa8fa('0x39'))){_0x14ac84[_0xa8fa('0x1f')]=qs['limit'](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x1f')]);_0x14ac84[_0xa8fa('0x1d')]=qs['offset'](_0x5900fd[_0xa8fa('0x34')][_0xa8fa('0x1d')]);}return _0x449368['getFields'](_0x14ac84);}})[_0xa8fa('0x27')](function(_0x39bd99){if(_0x39bd99){return _0x39bd99?{'count':_0x419fd1,'rows':_0x39bd99}:null;}})[_0xa8fa('0x27')](respondWithResult(_0x5b16f6,null))['catch'](handleError(_0x5b16f6,null));};exports['getSubjects']=function(_0x5957d5,_0x922e11,_0x35f2b2){var _0x2f0f7b={};var _0x533c13={};var _0x273a86;var _0x19b20b;return db[_0xa8fa('0x2f')]['findOne']({'where':{'id':_0x5957d5[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x922e11,null))[_0xa8fa('0x27')](function(_0x4132f2){if(_0x4132f2){_0x273a86=_0x4132f2;_0x533c13[_0xa8fa('0x33')]=_[_0xa8fa('0x4b')](db['ZohoField']['rawAttributes']);_0x533c13['query']=_[_0xa8fa('0x4b')](_0x5957d5[_0xa8fa('0x34')]);_0x533c13['filters']=_[_0xa8fa('0x35')](_0x533c13[_0xa8fa('0x33')],_0x533c13['query']);_0x2f0f7b['attributes']=_[_0xa8fa('0x35')](_0x533c13[_0xa8fa('0x33')],qs['fields'](_0x5957d5[_0xa8fa('0x34')]['fields']));_0x2f0f7b[_0xa8fa('0x36')]=_0x2f0f7b[_0xa8fa('0x36')][_0xa8fa('0x38')]?_0x2f0f7b[_0xa8fa('0x36')]:_0x533c13['model'];_0x2f0f7b[_0xa8fa('0x3a')]=qs['sort'](_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x3b')]);_0x2f0f7b[_0xa8fa('0x43')]=qs[_0xa8fa('0x3c')](_[_0xa8fa('0x3d')](_0x5957d5['query'],_0x533c13[_0xa8fa('0x3c')]));if(_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x3e')]){_0x2f0f7b['where']=_['merge'](_0x2f0f7b[_0xa8fa('0x43')],{'$or':_['map'](_0x2f0f7b['attributes'],function(_0x491731){var _0x25915f={};_0x25915f[_0x491731]={'$like':'%'+_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x3e')]+'%'};return _0x25915f;})});}_0x2f0f7b=_['merge']({},_0x2f0f7b,_0x5957d5['options']);return _0x273a86[_0xa8fa('0x52')](_0x2f0f7b);}})[_0xa8fa('0x27')](function(_0x2a636){if(_0x2a636){_0x19b20b=_0x2a636[_0xa8fa('0x38')];if(!_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x53')](_0xa8fa('0x39'))){_0x2f0f7b[_0xa8fa('0x1f')]=qs[_0xa8fa('0x1f')](_0x5957d5[_0xa8fa('0x34')][_0xa8fa('0x1f')]);_0x2f0f7b[_0xa8fa('0x1d')]=qs[_0xa8fa('0x1d')](_0x5957d5['query'][_0xa8fa('0x1d')]);}return _0x273a86[_0xa8fa('0x52')](_0x2f0f7b);}})[_0xa8fa('0x27')](function(_0x7bdde5){if(_0x7bdde5){return _0x7bdde5?{'count':_0x19b20b,'rows':_0x7bdde5}:null;}})['then'](respondWithResult(_0x922e11,null))[_0xa8fa('0x48')](handleError(_0x922e11,null));};exports['getDescriptions']=function(_0x36f35c,_0x4f086a,_0x1c9deb){var _0x38c40b={};var _0x559b3d={};var _0x4b905c;var _0x450544;return db[_0xa8fa('0x2f')]['findOne']({'where':{'id':_0x36f35c[_0xa8fa('0x4a')]['id']}})[_0xa8fa('0x27')](handleEntityNotFound(_0x4f086a,null))[_0xa8fa('0x27')](function(_0xc54497){if(_0xc54497){_0x4b905c=_0xc54497;_0x559b3d[_0xa8fa('0x33')]=_[_0xa8fa('0x4b')](db[_0xa8fa('0x50')][_0xa8fa('0x30')]);_0x559b3d[_0xa8fa('0x34')]=_[_0xa8fa('0x4b')](_0x36f35c['query']);_0x559b3d[_0xa8fa('0x3c')]=_[_0xa8fa('0x35')](_0x559b3d[_0xa8fa('0x33')],_0x559b3d[_0xa8fa('0x34')]);_0x38c40b[_0xa8fa('0x36')]=_[_0xa8fa('0x35')](_0x559b3d['model'],qs['fields'](_0x36f35c[_0xa8fa('0x34')][_0xa8fa('0x37')]));_0x38c40b[_0xa8fa('0x36')]=_0x38c40b[_0xa8fa('0x36')][_0xa8fa('0x38')]?_0x38c40b[_0xa8fa('0x36')]:_0x559b3d['model'];_0x38c40b[_0xa8fa('0x3a')]=qs[_0xa8fa('0x3b')](_0x36f35c['query'][_0xa8fa('0x3b')]);_0x38c40b[_0xa8fa('0x43')]=qs[_0xa8fa('0x3c')](_[_0xa8fa('0x3d')](_0x36f35c['query'],_0x559b3d[_0xa8fa('0x3c')]));if(_0x36f35c[_0xa8fa('0x34')]['filter']){_0x38c40b['where']=_['merge'](_0x38c40b['where'],{'$or':_[_0xa8fa('0x2e')](_0x38c40b[_0xa8fa('0x36')],function(_0x40bb73){var _0x40dabe={};_0x40dabe[_0x40bb73]={'$like':'%'+_0x36f35c['query']['filter']+'%'};return _0x40dabe;})});}_0x38c40b=_['merge']({},_0x38c40b,_0x36f35c[_0xa8fa('0x42')]);return _0x4b905c['getDescriptions'](_0x38c40b);}})[_0xa8fa('0x27')](function(_0x3c4924){if(_0x3c4924){_0x450544=_0x3c4924[_0xa8fa('0x38')];if(!_0x36f35c['query'][_0xa8fa('0x53')](_0xa8fa('0x39'))){_0x38c40b['limit']=qs[_0xa8fa('0x1f')](_0x36f35c[_0xa8fa('0x34')]['limit']);_0x38c40b[_0xa8fa('0x1d')]=qs[_0xa8fa('0x1d')](_0x36f35c['query'][_0xa8fa('0x1d')]);}return _0x4b905c[_0xa8fa('0x54')](_0x38c40b);}})[_0xa8fa('0x27')](function(_0x23e9ae){if(_0x23e9ae){return _0x23e9ae?{'count':_0x450544,'rows':_0x23e9ae}:null;}})['then'](respondWithResult(_0x4f086a,null))[_0xa8fa('0x48')](handleError(_0x4f086a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c2b2102..f251b11 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 _0x813f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0x291181,_0x276848){var _0x2f34a1=function(_0x6307a1){while(--_0x6307a1){_0x291181['push'](_0x291181['shift']());}};_0x2f34a1(++_0x276848);}(_0x813f,0xc9));var _0xf813=function(_0x740318,_0x26bccc){_0x740318=_0x740318-0x0;var _0x47228b=_0x813f[_0x740318];return _0x47228b;};'use strict';var _=require(_0xf813('0x0'));var util=require(_0xf813('0x1'));var logger=require(_0xf813('0x2'))(_0xf813('0x3'));var moment=require(_0xf813('0x4'));var BPromise=require(_0xf813('0x5'));var rp=require(_0xf813('0x6'));var fs=require('fs');var path=require(_0xf813('0x7'));var rimraf=require(_0xf813('0x8'));var config=require(_0xf813('0x9'));var attributes=require('./intZohoConfiguration.attributes');module[_0xf813('0xa')]=function(_0x37bb64,_0x123f11){return _0x37bb64[_0xf813('0xb')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f54=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x36b4de,_0x50c1bf){var _0x38e25c=function(_0x2b6331){while(--_0x2b6331){_0x36b4de['push'](_0x36b4de['shift']());}};_0x38e25c(++_0x50c1bf);}(_0x4f54,0x1ed));var _0x44f5=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4f54[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x44f5('0x0'));var util=require('util');var logger=require(_0x44f5('0x1'))(_0x44f5('0x2'));var moment=require(_0x44f5('0x3'));var BPromise=require(_0x44f5('0x4'));var rp=require(_0x44f5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44f5('0x6'));var config=require(_0x44f5('0x7'));var attributes=require(_0x44f5('0x8'));module[_0x44f5('0x9')]=function(_0x2e3040,_0x531dd1){return _0x2e3040[_0x44f5('0xa')](_0x44f5('0xb'),attributes,{'tableName':_0x44f5('0xc'),'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 67bb898..05dc6c6 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 _0x67d2=['then','info','request\x20sent','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x478970,_0x5df032){var _0x1759f1=function(_0x58579d){while(--_0x58579d){_0x478970['push'](_0x478970['shift']());}};_0x1759f1(++_0x5df032);}(_0x67d2,0x196));var _0x267d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x67d2[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x267d('0x0'));var util=require(_0x267d('0x1'));var moment=require(_0x267d('0x2'));var BPromise=require(_0x267d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x267d('0x4'));var db=require(_0x267d('0x5'))['db'];var utils=require(_0x267d('0x6'));var logger=require(_0x267d('0x7'))(_0x267d('0x8'));var config=require('../../config/environment');var jayson=require(_0x267d('0x9'));var client=jayson[_0x267d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e90f1,_0x532eda,_0x217399){return new BPromise(function(_0x35ffd3,_0x5aab52){return client[_0x267d('0xb')](_0x1e90f1,_0x217399)[_0x267d('0xc')](function(_0x2ab068){logger[_0x267d('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x532eda,_0x267d('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x532eda,_0x267d('0xe'),JSON[_0x267d('0xf')](_0x2ab068));if(_0x2ab068[_0x267d('0x10')]){if(_0x2ab068[_0x267d('0x10')][_0x267d('0x11')]===0x1f4){logger[_0x267d('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x532eda,_0x2ab068[_0x267d('0x10')]['message']);return _0x5aab52(_0x2ab068[_0x267d('0x10')][_0x267d('0x12')]);}logger[_0x267d('0x10')](_0x267d('0x13'),_0x532eda,_0x2ab068['error'][_0x267d('0x12')]);return _0x35ffd3(_0x2ab068[_0x267d('0x10')][_0x267d('0x12')]);}else{logger[_0x267d('0xd')](_0x267d('0x13'),_0x532eda,_0x267d('0xe'));_0x35ffd3(_0x2ab068[_0x267d('0x14')][_0x267d('0x12')]);}})[_0x267d('0x15')](function(_0xb0b6c1){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x532eda,_0xb0b6c1);_0x5aab52(_0xb0b6c1);});});} \ No newline at end of file +var _0xc0ba=['info','request\x20sent','debug','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc0ba,0x68));var _0xac0b=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xc0ba[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0xac0b('0x0'));var util=require(_0xac0b('0x1'));var moment=require(_0xac0b('0x2'));var BPromise=require(_0xac0b('0x3'));var rs=require(_0xac0b('0x4'));var fs=require('fs');var Redis=require(_0xac0b('0x5'));var db=require(_0xac0b('0x6'))['db'];var utils=require(_0xac0b('0x7'));var logger=require(_0xac0b('0x8'))(_0xac0b('0x9'));var config=require(_0xac0b('0xa'));var jayson=require(_0xac0b('0xb'));var client=jayson[_0xac0b('0xc')][_0xac0b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ee263,_0x3b5a48,_0x477a12){return new BPromise(function(_0x570dbe,_0x45dafe){return client[_0xac0b('0xe')](_0x2ee263,_0x477a12)[_0xac0b('0xf')](function(_0x15c0ca){logger[_0xac0b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3b5a48,_0xac0b('0x11'));logger[_0xac0b('0x12')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3b5a48,'request\x20sent',JSON['stringify'](_0x15c0ca));if(_0x15c0ca['error']){if(_0x15c0ca[_0xac0b('0x13')]['code']===0x1f4){logger[_0xac0b('0x13')](_0xac0b('0x14'),_0x3b5a48,_0x15c0ca[_0xac0b('0x13')]['message']);return _0x45dafe(_0x15c0ca[_0xac0b('0x13')][_0xac0b('0x15')]);}logger[_0xac0b('0x13')](_0xac0b('0x14'),_0x3b5a48,_0x15c0ca[_0xac0b('0x13')][_0xac0b('0x15')]);return _0x570dbe(_0x15c0ca['error'][_0xac0b('0x15')]);}else{logger[_0xac0b('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3b5a48,'request\x20sent');_0x570dbe(_0x15c0ca[_0xac0b('0x16')]['message']);}})[_0xac0b('0x17')](function(_0x22badf){logger[_0xac0b('0x13')](_0xac0b('0x14'),_0x3b5a48,_0x22badf);_0x45dafe(_0x22badf);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 51068da..8468e8f 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 _0xd96c=['../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','show','post','create','put','update','/:id','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x59769f,_0x862697){var _0x725471=function(_0x56e94c){while(--_0x56e94c){_0x59769f['push'](_0x59769f['shift']());}};_0x725471(++_0x862697);}(_0xd96c,0xe4));var _0xcd96=function(_0xe695fa,_0x387982){_0xe695fa=_0xe695fa-0x0;var _0x48660b=_0xd96c[_0xe695fa];return _0x48660b;};'use strict';var multer=require('multer');var util=require(_0xcd96('0x0'));var path=require(_0xcd96('0x1'));var timeout=require('connect-timeout');var express=require(_0xcd96('0x2'));var router=express[_0xcd96('0x3')]();var fs_extra=require(_0xcd96('0x4'));var auth=require(_0xcd96('0x5'));var interaction=require(_0xcd96('0x6'));var config=require(_0xcd96('0x7'));var controller=require(_0xcd96('0x8'));router['get']('/',auth[_0xcd96('0x9')](),controller[_0xcd96('0xa')]);router[_0xcd96('0xb')]('/:id',auth[_0xcd96('0x9')](),controller[_0xcd96('0xc')]);router[_0xcd96('0xd')]('/',auth[_0xcd96('0x9')](),controller[_0xcd96('0xe')]);router[_0xcd96('0xf')]('/:id',auth[_0xcd96('0x9')](),controller[_0xcd96('0x10')]);router['delete'](_0xcd96('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f55=['put','delete','multer','util','path','express','Router','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x2eda32,_0x1c314d){var _0x1c1c01=function(_0x310dc1){while(--_0x310dc1){_0x2eda32['push'](_0x2eda32['shift']());}};_0x1c1c01(++_0x1c314d);}(_0x5f55,0x1f1));var _0x55f5=function(_0x474035,_0x41e639){_0x474035=_0x474035-0x0;var _0x1b58e0=_0x5f55[_0x474035];return _0x1b58e0;};'use strict';var multer=require(_0x55f5('0x0'));var util=require(_0x55f5('0x1'));var path=require(_0x55f5('0x2'));var timeout=require('connect-timeout');var express=require(_0x55f5('0x3'));var router=express[_0x55f5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x55f5('0x5'));router[_0x55f5('0x6')]('/',auth[_0x55f5('0x7')](),controller[_0x55f5('0x8')]);router['get'](_0x55f5('0x9'),auth[_0x55f5('0x7')](),controller[_0x55f5('0xa')]);router[_0x55f5('0xb')]('/',auth[_0x55f5('0x7')](),controller[_0x55f5('0xc')]);router[_0x55f5('0xd')](_0x55f5('0x9'),auth[_0x55f5('0x7')](),controller['update']);router[_0x55f5('0xe')](_0x55f5('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 35faa2a..bda3c1a 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 _0xc9ce=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x40fc1e,_0x769613){var _0x54d2b8=function(_0x214dc1){while(--_0x214dc1){_0x40fc1e['push'](_0x40fc1e['shift']());}};_0x54d2b8(++_0x769613);}(_0xc9ce,0x138));var _0xec9c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc9ce[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xec9c('0x0'));module['exports']={'type':{'type':Sequelize[_0xec9c('0x1')](_0xec9c('0x2'),_0xec9c('0x3'),'customVariable',_0xec9c('0x4'),_0xec9c('0x5')),'defaultValue':_0xec9c('0x2')},'content':{'type':Sequelize[_0xec9c('0x6')]},'key':{'type':Sequelize[_0xec9c('0x6')]},'keyType':{'type':Sequelize[_0xec9c('0x1')](_0xec9c('0x2'),'variable',_0xec9c('0x7'))},'keyContent':{'type':Sequelize[_0xec9c('0x6')]},'idField':{'type':Sequelize[_0xec9c('0x6')]},'nameField':{'type':Sequelize[_0xec9c('0x6')]},'customField':{'type':Sequelize[_0xec9c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4504=['sequelize','exports','variable','customVariable','string','STRING','ENUM'];(function(_0x31eb98,_0x592fa2){var _0x20cf3e=function(_0x5e30b1){while(--_0x5e30b1){_0x31eb98['push'](_0x31eb98['shift']());}};_0x20cf3e(++_0x592fa2);}(_0x4504,0xe0));var _0x4450=function(_0x247e6b,_0x4620dc){_0x247e6b=_0x247e6b-0x0;var _0x38c48f=_0x4504[_0x247e6b];return _0x38c48f;};'use strict';var Sequelize=require(_0x4450('0x0'));module[_0x4450('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x4450('0x2'),_0x4450('0x3'),'keyValue','picklist'),'defaultValue':_0x4450('0x4')},'content':{'type':Sequelize[_0x4450('0x5')]},'key':{'type':Sequelize[_0x4450('0x5')]},'keyType':{'type':Sequelize[_0x4450('0x6')]('string',_0x4450('0x2'),_0x4450('0x3'))},'keyContent':{'type':Sequelize[_0x4450('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4450('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4450('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 099af0c..051e1c0 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 _0x2906=['intersection','fields','query','length','nolimit','order','sort','where','filter','merge','options','ZohoField','include','rows','catch','params','includeAll','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count','Content-Range','apply','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','attributes'];(function(_0x5a1ea7,_0x479735){var _0x32e949=function(_0xe796db){while(--_0xe796db){_0x5a1ea7['push'](_0x5a1ea7['shift']());}};_0x32e949(++_0x479735);}(_0x2906,0xe0));var _0x6290=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0x2906[_0x315b61];return _0x3521e8;};'use strict';var emlformat=require(_0x6290('0x0'));var rimraf=require(_0x6290('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6290('0x2'));var rp=require('request-promise');var moment=require(_0x6290('0x3'));var BPromise=require(_0x6290('0x4'));var Mustache=require(_0x6290('0x5'));var util=require(_0x6290('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6290('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6290('0x8'));var squel=require('squel');var crypto=require(_0x6290('0x9'));var jsforce=require(_0x6290('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6290('0xb'));var querystring=require(_0x6290('0xc'));var Papa=require(_0x6290('0xd'));var Redis=require(_0x6290('0xe'));var authService=require(_0x6290('0xf'));var qs=require(_0x6290('0x10'));var as=require(_0x6290('0x11'));var hardwareService=require(_0x6290('0x12'));var logger=require(_0x6290('0x13'))(_0x6290('0x14'));var utils=require(_0x6290('0x15'));var config=require(_0x6290('0x16'));var licenseUtil=require(_0x6290('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa58ce7,_0x4f0301){_0x4f0301=_0x4f0301||0xcc;return function(_0x31420d){if(_0x31420d){return _0xa58ce7['sendStatus'](_0x4f0301);}return _0xa58ce7[_0x6290('0x18')](_0x4f0301)[_0x6290('0x19')]();};}function respondWithResult(_0x1560f1,_0x4614c0){_0x4614c0=_0x4614c0||0xc8;return function(_0x151db9){if(_0x151db9){return _0x1560f1['status'](_0x4614c0)[_0x6290('0x1a')](_0x151db9);}};}function respondWithFilteredResult(_0x50d7b5,_0x226453){return function(_0x5ba781){if(_0x5ba781){var _0x204336=typeof _0x226453['offset']===_0x6290('0x1b')&&typeof _0x226453[_0x6290('0x1c')]===_0x6290('0x1b');var _0x3080e3=_0x5ba781['count'];var _0x43b43c=_0x204336?0x0:_0x226453[_0x6290('0x1d')];var _0x55f676=_0x204336?_0x5ba781[_0x6290('0x1e')]:_0x226453['offset']+_0x226453[_0x6290('0x1c')];var _0x45b322;if(_0x55f676>=_0x3080e3){_0x55f676=_0x3080e3;_0x45b322=0xc8;}else{_0x45b322=0xce;}_0x50d7b5[_0x6290('0x18')](_0x45b322);return _0x50d7b5['set'](_0x6290('0x1f'),_0x43b43c+'-'+_0x55f676+'/'+_0x3080e3)[_0x6290('0x1a')](_0x5ba781);}return null;};}function patchUpdates(_0x54100b){return function(_0x14ac6b){try{jsonpatch[_0x6290('0x20')](_0x14ac6b,_0x54100b,!![]);}catch(_0x2579a3){return BPromise['reject'](_0x2579a3);}return _0x14ac6b['save']();};}function saveUpdates(_0x2ccf34,_0x161526){return function(_0x4f9424){if(_0x4f9424){return _0x4f9424[_0x6290('0x21')](_0x2ccf34)[_0x6290('0x22')](function(_0x218861){return _0x218861;});}return null;};}function removeEntity(_0x2f4b9b,_0x30274c){return function(_0x20f26a){if(_0x20f26a){return _0x20f26a['destroy']()['then'](function(){_0x2f4b9b['status'](0xcc)[_0x6290('0x19')]();});}};}function handleEntityNotFound(_0x321ac4,_0x2fecc4){return function(_0x5eaa99){if(!_0x5eaa99){_0x321ac4['sendStatus'](0x194);}return _0x5eaa99;};}function handleError(_0x4c058b,_0x198e1f){_0x198e1f=_0x198e1f||0x1f4;return function(_0x1be6ad){logger[_0x6290('0x23')](_0x1be6ad[_0x6290('0x24')]);if(_0x1be6ad['name']){delete _0x1be6ad[_0x6290('0x25')];}_0x4c058b[_0x6290('0x18')](_0x198e1f)[_0x6290('0x26')](_0x1be6ad);};}exports[_0x6290('0x27')]=function(_0x5452f7,_0x3f1570){var _0x26bdf0={},_0x142b05={},_0x130d86={'count':0x0,'rows':[]};var _0x316f6a=_[_0x6290('0x28')](db['ZohoField'][_0x6290('0x29')],function(_0x57e38b){return{'name':_0x57e38b['fieldName'],'type':_0x57e38b[_0x6290('0x2a')][_0x6290('0x2b')]};});_0x142b05[_0x6290('0x2c')]=_['map'](_0x316f6a,'name');_0x142b05['query']=_[_0x6290('0x2d')](_0x5452f7['query']);_0x142b05[_0x6290('0x2e')]=_['intersection'](_0x142b05[_0x6290('0x2c')],_0x142b05['query']);_0x26bdf0[_0x6290('0x2f')]=_[_0x6290('0x30')](_0x142b05['model'],qs[_0x6290('0x31')](_0x5452f7[_0x6290('0x32')][_0x6290('0x31')]));_0x26bdf0[_0x6290('0x2f')]=_0x26bdf0[_0x6290('0x2f')][_0x6290('0x33')]?_0x26bdf0[_0x6290('0x2f')]:_0x142b05[_0x6290('0x2c')];if(!_0x5452f7[_0x6290('0x32')]['hasOwnProperty'](_0x6290('0x34'))){_0x26bdf0[_0x6290('0x1c')]=qs['limit'](_0x5452f7[_0x6290('0x32')][_0x6290('0x1c')]);_0x26bdf0[_0x6290('0x1d')]=qs['offset'](_0x5452f7['query'][_0x6290('0x1d')]);}_0x26bdf0[_0x6290('0x35')]=qs['sort'](_0x5452f7[_0x6290('0x32')][_0x6290('0x36')]);_0x26bdf0[_0x6290('0x37')]=qs[_0x6290('0x2e')](_['pick'](_0x5452f7[_0x6290('0x32')],_0x142b05[_0x6290('0x2e')]),_0x316f6a);if(_0x5452f7[_0x6290('0x32')][_0x6290('0x38')]){_0x26bdf0[_0x6290('0x37')]=_[_0x6290('0x39')](_0x26bdf0[_0x6290('0x37')],{'$or':_['map'](_0x316f6a,function(_0x119e4b){if(_0x119e4b['type']!=='VIRTUAL'){var _0x3649a5={};_0x3649a5[_0x119e4b[_0x6290('0x25')]]={'$like':'%'+_0x5452f7[_0x6290('0x32')][_0x6290('0x38')]+'%'};return _0x3649a5;}})});}_0x26bdf0=_['merge']({},_0x26bdf0,_0x5452f7[_0x6290('0x3a')]);var _0x4080d4={'where':_0x26bdf0[_0x6290('0x37')]};return db[_0x6290('0x3b')][_0x6290('0x1e')](_0x4080d4)[_0x6290('0x22')](function(_0x4fdcfc){_0x130d86[_0x6290('0x1e')]=_0x4fdcfc;if(_0x5452f7[_0x6290('0x32')]['includeAll']){_0x26bdf0[_0x6290('0x3c')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x26bdf0);})[_0x6290('0x22')](function(_0x37a2f9){_0x130d86[_0x6290('0x3d')]=_0x37a2f9;return _0x130d86;})[_0x6290('0x22')](respondWithFilteredResult(_0x3f1570,_0x26bdf0))[_0x6290('0x3e')](handleError(_0x3f1570,null));};exports['show']=function(_0x5cbb6f,_0x278c5a){var _0xfaa27e={'raw':!![],'where':{'id':_0x5cbb6f[_0x6290('0x3f')]['id']}},_0x464347={};_0x464347[_0x6290('0x2c')]=_[_0x6290('0x2d')](db[_0x6290('0x3b')]['rawAttributes']);_0x464347[_0x6290('0x32')]=_[_0x6290('0x2d')](_0x5cbb6f[_0x6290('0x32')]);_0x464347[_0x6290('0x2e')]=_[_0x6290('0x30')](_0x464347[_0x6290('0x2c')],_0x464347[_0x6290('0x32')]);_0xfaa27e[_0x6290('0x2f')]=_[_0x6290('0x30')](_0x464347[_0x6290('0x2c')],qs['fields'](_0x5cbb6f[_0x6290('0x32')][_0x6290('0x31')]));_0xfaa27e[_0x6290('0x2f')]=_0xfaa27e['attributes'][_0x6290('0x33')]?_0xfaa27e['attributes']:_0x464347['model'];if(_0x5cbb6f[_0x6290('0x32')][_0x6290('0x40')]){_0xfaa27e['include']=[{'all':!![]}];}_0xfaa27e=_[_0x6290('0x39')]({},_0xfaa27e,_0x5cbb6f['options']);return db[_0x6290('0x3b')]['find'](_0xfaa27e)[_0x6290('0x22')](handleEntityNotFound(_0x278c5a,null))['then'](respondWithResult(_0x278c5a,null))[_0x6290('0x3e')](handleError(_0x278c5a,null));};exports[_0x6290('0x41')]=function(_0x19ce84,_0x3d3ded){return db[_0x6290('0x3b')][_0x6290('0x41')](_0x19ce84['body'],{})[_0x6290('0x22')](respondWithResult(_0x3d3ded,0xc9))[_0x6290('0x3e')](handleError(_0x3d3ded,null));};exports[_0x6290('0x21')]=function(_0x4fad29,_0x28579e){if(_0x4fad29[_0x6290('0x42')]['id']){delete _0x4fad29[_0x6290('0x42')]['id'];}return db['ZohoField']['find']({'where':{'id':_0x4fad29[_0x6290('0x3f')]['id']}})[_0x6290('0x22')](handleEntityNotFound(_0x28579e,null))['then'](saveUpdates(_0x4fad29['body'],null))[_0x6290('0x22')](respondWithResult(_0x28579e,null))[_0x6290('0x3e')](handleError(_0x28579e,null));};exports[_0x6290('0x43')]=function(_0x41960d,_0x3998d9){return db[_0x6290('0x3b')]['find']({'where':{'id':_0x41960d[_0x6290('0x3f')]['id']}})[_0x6290('0x22')](handleEntityNotFound(_0x3998d9,null))[_0x6290('0x22')](removeEntity(_0x3998d9,null))[_0x6290('0x3e')](handleError(_0x3998d9,null));}; \ No newline at end of file +var _0x30ac=['bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','apply','reject','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','merge','options','ZohoField','include','findAll','catch','show','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1bbbe8,_0x1cc1d8){var _0x2f0e6e=function(_0x1bc3e2){while(--_0x1bc3e2){_0x1bbbe8['push'](_0x1bbbe8['shift']());}};_0x2f0e6e(++_0x1cc1d8);}(_0x30ac,0x11b));var _0xc30a=function(_0x549bc5,_0x5f05d3){_0x549bc5=_0x549bc5-0x0;var _0x5ec97f=_0x30ac[_0x549bc5];return _0x5ec97f;};'use strict';var emlformat=require(_0xc30a('0x0'));var rimraf=require(_0xc30a('0x1'));var zipdir=require(_0xc30a('0x2'));var jsonpatch=require(_0xc30a('0x3'));var rp=require(_0xc30a('0x4'));var moment=require('moment');var BPromise=require(_0xc30a('0x5'));var Mustache=require(_0xc30a('0x6'));var util=require('util');var path=require(_0xc30a('0x7'));var sox=require(_0xc30a('0x8'));var csv=require('to-csv');var ejs=require(_0xc30a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc30a('0xa'));var squel=require(_0xc30a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc30a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc30a('0xd'));var Redis=require(_0xc30a('0xe'));var authService=require(_0xc30a('0xf'));var qs=require(_0xc30a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc30a('0x11'))(_0xc30a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc30a('0x13'));var db=require(_0xc30a('0x14'))['db'];function respondWithStatusCode(_0x35ad47,_0x4f8c5d){_0x4f8c5d=_0x4f8c5d||0xcc;return function(_0x1c995c){if(_0x1c995c){return _0x35ad47['sendStatus'](_0x4f8c5d);}return _0x35ad47['status'](_0x4f8c5d)['end']();};}function respondWithResult(_0x329534,_0x46df70){_0x46df70=_0x46df70||0xc8;return function(_0xcf829b){if(_0xcf829b){return _0x329534[_0xc30a('0x15')](_0x46df70)['json'](_0xcf829b);}};}function respondWithFilteredResult(_0x11fa1f,_0x2d72fb){return function(_0x1d2ae1){if(_0x1d2ae1){var _0xb8e47d=typeof _0x2d72fb[_0xc30a('0x16')]===_0xc30a('0x17')&&typeof _0x2d72fb['limit']==='undefined';var _0x588373=_0x1d2ae1['count'];var _0x2a72f6=_0xb8e47d?0x0:_0x2d72fb[_0xc30a('0x16')];var _0x182aef=_0xb8e47d?_0x1d2ae1[_0xc30a('0x18')]:_0x2d72fb['offset']+_0x2d72fb['limit'];var _0x54fc83;if(_0x182aef>=_0x588373){_0x182aef=_0x588373;_0x54fc83=0xc8;}else{_0x54fc83=0xce;}_0x11fa1f[_0xc30a('0x15')](_0x54fc83);return _0x11fa1f[_0xc30a('0x19')](_0xc30a('0x1a'),_0x2a72f6+'-'+_0x182aef+'/'+_0x588373)[_0xc30a('0x1b')](_0x1d2ae1);}return null;};}function patchUpdates(_0x4d6a68){return function(_0x4ec1f5){try{jsonpatch[_0xc30a('0x1c')](_0x4ec1f5,_0x4d6a68,!![]);}catch(_0x32f0ca){return BPromise[_0xc30a('0x1d')](_0x32f0ca);}return _0x4ec1f5['save']();};}function saveUpdates(_0xec636c,_0x596ca7){return function(_0x29080f){if(_0x29080f){return _0x29080f['update'](_0xec636c)[_0xc30a('0x1e')](function(_0x19ac29){return _0x19ac29;});}return null;};}function removeEntity(_0x4b625d,_0x354e44){return function(_0x4e03c6){if(_0x4e03c6){return _0x4e03c6[_0xc30a('0x1f')]()[_0xc30a('0x1e')](function(){_0x4b625d[_0xc30a('0x15')](0xcc)[_0xc30a('0x20')]();});}};}function handleEntityNotFound(_0x27a471,_0x5e63d6){return function(_0x3307bc){if(!_0x3307bc){_0x27a471[_0xc30a('0x21')](0x194);}return _0x3307bc;};}function handleError(_0x5d3ba7,_0xb6d44e){_0xb6d44e=_0xb6d44e||0x1f4;return function(_0x4a2009){logger[_0xc30a('0x22')](_0x4a2009[_0xc30a('0x23')]);if(_0x4a2009[_0xc30a('0x24')]){delete _0x4a2009['name'];}_0x5d3ba7[_0xc30a('0x15')](_0xb6d44e)[_0xc30a('0x25')](_0x4a2009);};}exports[_0xc30a('0x26')]=function(_0x3a04e8,_0x5d8e6a){var _0x2e6c46={},_0x3c90d9={},_0x2972b0={'count':0x0,'rows':[]};var _0x2a3985=_['map'](db['ZohoField'][_0xc30a('0x27')],function(_0x7bb2e0){return{'name':_0x7bb2e0[_0xc30a('0x28')],'type':_0x7bb2e0[_0xc30a('0x29')][_0xc30a('0x2a')]};});_0x3c90d9[_0xc30a('0x2b')]=_['map'](_0x2a3985,_0xc30a('0x24'));_0x3c90d9[_0xc30a('0x2c')]=_[_0xc30a('0x2d')](_0x3a04e8[_0xc30a('0x2c')]);_0x3c90d9[_0xc30a('0x2e')]=_[_0xc30a('0x2f')](_0x3c90d9[_0xc30a('0x2b')],_0x3c90d9[_0xc30a('0x2c')]);_0x2e6c46[_0xc30a('0x30')]=_[_0xc30a('0x2f')](_0x3c90d9['model'],qs[_0xc30a('0x31')](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x31')]));_0x2e6c46[_0xc30a('0x30')]=_0x2e6c46[_0xc30a('0x30')][_0xc30a('0x32')]?_0x2e6c46['attributes']:_0x3c90d9[_0xc30a('0x2b')];if(!_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x33')](_0xc30a('0x34'))){_0x2e6c46[_0xc30a('0x35')]=qs[_0xc30a('0x35')](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x35')]);_0x2e6c46['offset']=qs['offset'](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x16')]);}_0x2e6c46[_0xc30a('0x36')]=qs[_0xc30a('0x37')](_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x37')]);_0x2e6c46[_0xc30a('0x38')]=qs['filters'](_['pick'](_0x3a04e8[_0xc30a('0x2c')],_0x3c90d9[_0xc30a('0x2e')]),_0x2a3985);if(_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x39')]){_0x2e6c46[_0xc30a('0x38')]=_['merge'](_0x2e6c46[_0xc30a('0x38')],{'$or':_[_0xc30a('0x3a')](_0x2a3985,function(_0x5cd2b7){if(_0x5cd2b7[_0xc30a('0x29')]!==_0xc30a('0x3b')){var _0x276266={};_0x276266[_0x5cd2b7['name']]={'$like':'%'+_0x3a04e8[_0xc30a('0x2c')][_0xc30a('0x39')]+'%'};return _0x276266;}})});}_0x2e6c46=_[_0xc30a('0x3c')]({},_0x2e6c46,_0x3a04e8[_0xc30a('0x3d')]);var _0x4d81b6={'where':_0x2e6c46[_0xc30a('0x38')]};return db[_0xc30a('0x3e')][_0xc30a('0x18')](_0x4d81b6)['then'](function(_0x1edaf5){_0x2972b0[_0xc30a('0x18')]=_0x1edaf5;if(_0x3a04e8[_0xc30a('0x2c')]['includeAll']){_0x2e6c46[_0xc30a('0x3f')]=[{'all':!![]}];}return db[_0xc30a('0x3e')][_0xc30a('0x40')](_0x2e6c46);})[_0xc30a('0x1e')](function(_0x297f36){_0x2972b0['rows']=_0x297f36;return _0x2972b0;})['then'](respondWithFilteredResult(_0x5d8e6a,_0x2e6c46))[_0xc30a('0x41')](handleError(_0x5d8e6a,null));};exports[_0xc30a('0x42')]=function(_0x24f482,_0x392c74){var _0x54c35a={'raw':!![],'where':{'id':_0x24f482['params']['id']}},_0x16c294={};_0x16c294[_0xc30a('0x2b')]=_[_0xc30a('0x2d')](db[_0xc30a('0x3e')]['rawAttributes']);_0x16c294[_0xc30a('0x2c')]=_[_0xc30a('0x2d')](_0x24f482[_0xc30a('0x2c')]);_0x16c294['filters']=_['intersection'](_0x16c294[_0xc30a('0x2b')],_0x16c294['query']);_0x54c35a[_0xc30a('0x30')]=_[_0xc30a('0x2f')](_0x16c294['model'],qs[_0xc30a('0x31')](_0x24f482['query']['fields']));_0x54c35a[_0xc30a('0x30')]=_0x54c35a[_0xc30a('0x30')]['length']?_0x54c35a['attributes']:_0x16c294[_0xc30a('0x2b')];if(_0x24f482[_0xc30a('0x2c')][_0xc30a('0x43')]){_0x54c35a[_0xc30a('0x3f')]=[{'all':!![]}];}_0x54c35a=_[_0xc30a('0x3c')]({},_0x54c35a,_0x24f482[_0xc30a('0x3d')]);return db[_0xc30a('0x3e')][_0xc30a('0x44')](_0x54c35a)[_0xc30a('0x1e')](handleEntityNotFound(_0x392c74,null))['then'](respondWithResult(_0x392c74,null))['catch'](handleError(_0x392c74,null));};exports[_0xc30a('0x45')]=function(_0x452c3c,_0x47eceb){return db['ZohoField'][_0xc30a('0x45')](_0x452c3c[_0xc30a('0x46')],{})[_0xc30a('0x1e')](respondWithResult(_0x47eceb,0xc9))[_0xc30a('0x41')](handleError(_0x47eceb,null));};exports['update']=function(_0x2f93d0,_0x3e9164){if(_0x2f93d0[_0xc30a('0x46')]['id']){delete _0x2f93d0['body']['id'];}return db[_0xc30a('0x3e')]['find']({'where':{'id':_0x2f93d0[_0xc30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e9164,null))['then'](saveUpdates(_0x2f93d0[_0xc30a('0x46')],null))[_0xc30a('0x1e')](respondWithResult(_0x3e9164,null))[_0xc30a('0x41')](handleError(_0x3e9164,null));};exports[_0xc30a('0x1f')]=function(_0x141019,_0x3fae5d){return db[_0xc30a('0x3e')][_0xc30a('0x44')]({'where':{'id':_0x141019[_0xc30a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fae5d,null))[_0xc30a('0x1e')](removeEntity(_0x3fae5d,null))[_0xc30a('0x41')](handleError(_0x3fae5d,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 250c16a..5eee17c 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 _0x77d4=['exports','define','zoho_unique_index','util','api','bluebird','request-promise','../../config/environment','./intZohoField.attributes'];(function(_0x9d53fb,_0x4b898b){var _0x12f955=function(_0x5b03f9){while(--_0x5b03f9){_0x9d53fb['push'](_0x9d53fb['shift']());}};_0x12f955(++_0x4b898b);}(_0x77d4,0x108));var _0x477d=function(_0x329efc,_0x2ec02c){_0x329efc=_0x329efc-0x0;var _0x3cc80a=_0x77d4[_0x329efc];return _0x3cc80a;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));module[_0x477d('0x6')]=function(_0x471fca,_0x2545e5){return _0x471fca[_0x477d('0x7')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x477d('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f0e=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x57e4fc,_0x5438b6){var _0x24987c=function(_0xc1a238){while(--_0xc1a238){_0x57e4fc['push'](_0x57e4fc['shift']());}};_0x24987c(++_0x5438b6);}(_0x9f0e,0x116));var _0xe9f0=function(_0x1c6f04,_0x3b5dfe){_0x1c6f04=_0x1c6f04-0x0;var _0x41c62e=_0x9f0e[_0x1c6f04];return _0x41c62e;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var logger=require(_0xe9f0('0x2'))(_0xe9f0('0x3'));var moment=require(_0xe9f0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9f0('0x5'));var rimraf=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var attributes=require(_0xe9f0('0x8'));module[_0xe9f0('0x9')]=function(_0x50313d,_0x5b87c1){return _0x50313d[_0xe9f0('0xa')](_0xe9f0('0xb'),attributes,{'tableName':_0xe9f0('0xc'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0xe9f0('0xd'),_0xe9f0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index b755d85..a61c99a 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 _0xec6e=['error','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','ZohoField,\x20%s,\x20%s','message'];(function(_0xc033b5,_0x165444){var _0x517443=function(_0x239d71){while(--_0x239d71){_0xc033b5['push'](_0xc033b5['shift']());}};_0x517443(++_0x165444);}(_0xec6e,0x15d));var _0xeec6=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0xec6e[_0x38b2d9];return _0x23a3e1;};'use strict';var _=require(_0xeec6('0x0'));var util=require(_0xeec6('0x1'));var moment=require(_0xeec6('0x2'));var BPromise=require(_0xeec6('0x3'));var rs=require(_0xeec6('0x4'));var fs=require('fs');var Redis=require(_0xeec6('0x5'));var db=require(_0xeec6('0x6'))['db'];var utils=require(_0xeec6('0x7'));var logger=require(_0xeec6('0x8'))(_0xeec6('0x9'));var config=require(_0xeec6('0xa'));var jayson=require(_0xeec6('0xb'));var client=jayson['client'][_0xeec6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4f8fef,_0x362f6e,_0x341a93){return new BPromise(function(_0x17a3aa,_0x44d9fa){return client['request'](_0x4f8fef,_0x341a93)['then'](function(_0x5c0f99){logger[_0xeec6('0xd')]('ZohoField,\x20%s,\x20%s',_0x362f6e,'request\x20sent');logger[_0xeec6('0xe')](_0xeec6('0xf'),_0x362f6e,'request\x20sent',JSON[_0xeec6('0x10')](_0x5c0f99));if(_0x5c0f99['error']){if(_0x5c0f99['error']['code']===0x1f4){logger['error'](_0xeec6('0x11'),_0x362f6e,_0x5c0f99['error']['message']);return _0x44d9fa(_0x5c0f99['error'][_0xeec6('0x12')]);}logger[_0xeec6('0x13')](_0xeec6('0x11'),_0x362f6e,_0x5c0f99[_0xeec6('0x13')][_0xeec6('0x12')]);return _0x17a3aa(_0x5c0f99[_0xeec6('0x13')][_0xeec6('0x12')]);}else{logger[_0xeec6('0xd')](_0xeec6('0x11'),_0x362f6e,_0xeec6('0x14'));_0x17a3aa(_0x5c0f99[_0xeec6('0x15')][_0xeec6('0x12')]);}})[_0xeec6('0x16')](function(_0x1e4ad3){logger[_0xeec6('0x13')](_0xeec6('0x11'),_0x362f6e,_0x1e4ad3);_0x44d9fa(_0x1e4ad3);});});} \ No newline at end of file +var _0xb397=['result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','ZohoField,\x20%s,\x20%s','message'];(function(_0x8629b4,_0xe4f9c0){var _0x3bc42a=function(_0x525241){while(--_0x525241){_0x8629b4['push'](_0x8629b4['shift']());}};_0x3bc42a(++_0xe4f9c0);}(_0xb397,0x166));var _0x7b39=function(_0x366993,_0x581488){_0x366993=_0x366993-0x0;var _0x37c367=_0xb397[_0x366993];return _0x37c367;};'use strict';var _=require('lodash');var util=require(_0x7b39('0x0'));var moment=require('moment');var BPromise=require(_0x7b39('0x1'));var rs=require(_0x7b39('0x2'));var fs=require('fs');var Redis=require(_0x7b39('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b39('0x4'));var logger=require(_0x7b39('0x5'))(_0x7b39('0x6'));var config=require(_0x7b39('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7b39('0x8')][_0x7b39('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bbf6d,_0x28451f,_0x2011ce){return new BPromise(function(_0x105e3a,_0x9d4b92){return client[_0x7b39('0xa')](_0x1bbf6d,_0x2011ce)[_0x7b39('0xb')](function(_0x3deb61){logger[_0x7b39('0xc')]('ZohoField,\x20%s,\x20%s',_0x28451f,_0x7b39('0xd'));logger[_0x7b39('0xe')](_0x7b39('0xf'),_0x28451f,'request\x20sent',JSON[_0x7b39('0x10')](_0x3deb61));if(_0x3deb61[_0x7b39('0x11')]){if(_0x3deb61[_0x7b39('0x11')]['code']===0x1f4){logger[_0x7b39('0x11')](_0x7b39('0x12'),_0x28451f,_0x3deb61[_0x7b39('0x11')][_0x7b39('0x13')]);return _0x9d4b92(_0x3deb61[_0x7b39('0x11')]['message']);}logger['error'](_0x7b39('0x12'),_0x28451f,_0x3deb61[_0x7b39('0x11')][_0x7b39('0x13')]);return _0x105e3a(_0x3deb61['error'][_0x7b39('0x13')]);}else{logger['info'](_0x7b39('0x12'),_0x28451f,_0x7b39('0xd'));_0x105e3a(_0x3deb61[_0x7b39('0x14')]['message']);}})['catch'](function(_0xf5620a){logger[_0x7b39('0x11')]('ZohoField,\x20%s,\x20%s',_0x28451f,_0xf5620a);_0x9d4b92(_0xf5620a);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index bd17c8b..b125172 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x211f04,_0x828280){var _0x1eab0d=function(_0x36e9a3){while(--_0x36e9a3){_0x211f04['push'](_0x211f04['shift']());}};_0x1eab0d(++_0x828280);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x238d90,_0x55ab60){var _0x46388a=function(_0x1ea450){while(--_0x1ea450){_0x238d90['push'](_0x238d90['shift']());}};_0x46388a(++_0x55ab60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 4ffe88e..54d3a62 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 _0x1b1d=['STRING','unique_name_and_version','app.js','BOOLEAN','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b1d,0x19c));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1b1('0x0'));module[_0xd1b1('0x1')]={'name':{'type':Sequelize[_0xd1b1('0x2')],'allowNull':![],'unique':_0xd1b1('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd1b1('0x3')},'main':{'type':Sequelize[_0xd1b1('0x2')],'defaultValue':_0xd1b1('0x4')},'filename':{'type':Sequelize[_0xd1b1('0x2')]},'path':{'type':Sequelize[_0xd1b1('0x2')]},'type':{'type':Sequelize[_0xd1b1('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xd1b1('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xd1b1('0x2')]},'logo':{'type':Sequelize[_0xd1b1('0x2')]},'state':{'type':Sequelize['STRING'],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xd1b1('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xd1b1('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5e0e=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5e0e,0x1c3));var _0xe5e0=function(_0x19faae,_0x5697bc){_0x19faae=_0x19faae-0x0;var _0x363543=_0x5e0e[_0x19faae];return _0x363543;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize[_0xe5e0('0x2')],'allowNull':![],'unique':_0xe5e0('0x3')},'version':{'type':Sequelize[_0xe5e0('0x2')],'allowNull':![],'unique':_0xe5e0('0x3')},'main':{'type':Sequelize[_0xe5e0('0x2')],'defaultValue':_0xe5e0('0x4')},'filename':{'type':Sequelize[_0xe5e0('0x2')]},'path':{'type':Sequelize[_0xe5e0('0x2')]},'type':{'type':Sequelize[_0xe5e0('0x2')]},'size':{'type':Sequelize[_0xe5e0('0x5')]},'active':{'type':Sequelize[_0xe5e0('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xe5e0('0x2')]},'state':{'type':Sequelize[_0xe5e0('0x2')],'unique':_0xe5e0('0x7')},'description':{'type':Sequelize[_0xe5e0('0x2')]},'title':{'type':Sequelize[_0xe5e0('0x2')]},'remoteUri':{'type':Sequelize[_0xe5e0('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0f2c29d..8d43d5d 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 _0x4975=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','Integration','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x35f54a,_0x11659b){var _0x1be213=function(_0x5aef71){while(--_0x5aef71){_0x35f54a['push'](_0x35f54a['shift']());}};_0x1be213(++_0x11659b);}(_0x4975,0x86));var _0x5497=function(_0x181447,_0x286148){_0x181447=_0x181447-0x0;var _0x1ac971=_0x4975[_0x181447];return _0x1ac971;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['Integration']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['Integration'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));}; \ No newline at end of file +var _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x58d381,_0x382cbc){var _0x493124=function(_0x3cdb42){while(--_0x3cdb42){_0x58d381['push'](_0x58d381['shift']());}};_0x493124(++_0x382cbc);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d4610b6..39dc656 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 _0x0d39=['./integration.attributes','exports','define','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x0d39,0x1cb));var _0x90d3=function(_0x445315,_0x1baa76){_0x445315=_0x445315-0x0;var _0x340feb=_0x0d39[_0x445315];return _0x340feb;};'use strict';var _=require(_0x90d3('0x0'));var util=require(_0x90d3('0x1'));var logger=require(_0x90d3('0x2'))(_0x90d3('0x3'));var moment=require(_0x90d3('0x4'));var BPromise=require(_0x90d3('0x5'));var rp=require(_0x90d3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90d3('0x7'));var config=require(_0x90d3('0x8'));var attributes=require(_0x90d3('0x9'));module[_0x90d3('0xa')]=function(_0x40b515,_0x20013a){return _0x40b515[_0x90d3('0xb')]('Integration',attributes,{'tableName':_0x90d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x642d=['rimraf','exports','Integration','integrations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x32f2d9,_0x547052){var _0x117ad6=function(_0x1027c5){while(--_0x1027c5){_0x32f2d9['push'](_0x32f2d9['shift']());}};_0x117ad6(++_0x547052);}(_0x642d,0x130));var _0xd642=function(_0x2a09c4,_0x2fee1c){_0x2a09c4=_0x2a09c4-0x0;var _0x5cb37a=_0x642d[_0x2a09c4];return _0x5cb37a;};'use strict';var _=require(_0xd642('0x0'));var util=require(_0xd642('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd642('0x2'));var BPromise=require(_0xd642('0x3'));var rp=require(_0xd642('0x4'));var fs=require('fs');var path=require(_0xd642('0x5'));var rimraf=require(_0xd642('0x6'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xd642('0x7')]=function(_0x4087c2,_0x304cc3){return _0x4087c2['define'](_0xd642('0x8'),attributes,{'tableName':_0xd642('0x9'),'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 4d061c1..984fa19 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 _0xd7d1=['info','Integration,\x20%s,\x20%s','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x41e45d,_0x1ee3b0){var _0x4d3aac=function(_0x4b7503){while(--_0x4b7503){_0x41e45d['push'](_0x41e45d['shift']());}};_0x4d3aac(++_0x1ee3b0);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x49b96c,_0xa0c92e){_0x49b96c=_0x49b96c-0x0;var _0x1d864f=_0xd7d1[_0x49b96c];return _0x1d864f;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Integration,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Integration,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file +var _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x181cbb,_0x409233){_0x181cbb=_0x181cbb-0x0;var _0x5f057e=_0x7a54[_0x181cbb];return _0x5f057e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Integration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 81f9b12..0e4c1da 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 _0x1967=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x1967,0x173));var _0x7196=function(_0x386049,_0x5d77f7){_0x386049=_0x386049-0x0;var _0x5435ea=_0x1967[_0x386049];return _0x5435ea;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0x11')]('/',auth[_0x7196('0xa')](),controller['create']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x12')]);router[_0x7196('0x13')](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x14')]);module[_0x7196('0x15')]=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x0295,0x1f0));var _0x5029=function(_0xe4c712,_0x1e26d5){_0xe4c712=_0xe4c712-0x0;var _0x101962=_0x0295[_0xe4c712];return _0x101962;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index db5474d..5c94ee7 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 _0x9158=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x4cf49e,_0x48c2b7){var _0x14ec19=function(_0x218642){while(--_0x218642){_0x4cf49e['push'](_0x4cf49e['shift']());}};_0x14ec19(++_0x48c2b7);}(_0x9158,0x153));var _0x8915=function(_0x69e08a,_0x170e36){_0x69e08a=_0x69e08a-0x0;var _0x318683=_0x9158[_0x69e08a];return _0x318683;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'integration':{'type':Sequelize[_0x8915('0x2')]},'eventChannel':{'type':Sequelize[_0x8915('0x2')]},'exitStatus':{'type':Sequelize[_0x8915('0x2')]},'ticketId':{'type':Sequelize[_0x8915('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x8915('0x2')]},'uniqueid':{'type':Sequelize[_0x8915('0x2')]},'calleridnum':{'type':Sequelize[_0x8915('0x2')]},'calleridname':{'type':Sequelize[_0x8915('0x2')]},'queue':{'type':Sequelize[_0x8915('0x2')]},'interface':{'type':Sequelize[_0x8915('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8915('0x3')]},'holdtime':{'type':Sequelize[_0x8915('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x8915('0x4')]},'agentacw':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8915('0x4')]},'reason':{'type':Sequelize[_0x8915('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x8915('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8915('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8915('0x3')]},'lastevent':{'type':Sequelize[_0x8915('0x2')]},'channel':{'type':Sequelize[_0x8915('0x2')]},'channelstate':{'type':Sequelize[_0x8915('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8915('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8915('0x2')]},'context':{'type':Sequelize[_0x8915('0x2')]},'exten':{'type':Sequelize[_0x8915('0x2')]},'priority':{'type':Sequelize[_0x8915('0x2')]},'destchannel':{'type':Sequelize[_0x8915('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8915('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8915('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8915('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8915('0x2')]},'destlanguage':{'type':Sequelize[_0x8915('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8915('0x2')]},'destexten':{'type':Sequelize[_0x8915('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8915('0x2')]},'messageId':{'type':Sequelize[_0x8915('0x2')]},'inReplyTo':{'type':Sequelize[_0x8915('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x8915('0x2')]},'to':{'type':Sequelize[_0x8915('0x2')]},'cc':{'type':Sequelize[_0x8915('0x2')]},'attachment':{'type':Sequelize[_0x8915('0x6')]},'html':{'type':Sequelize[_0x8915('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x8915('0x7')]('SENT',_0x8915('0x8'),_0x8915('0x9'),_0x8915('0xa'))},'url':{'type':Sequelize[_0x8915('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8915('0x2')]},'projectId':{'type':Sequelize[_0x8915('0x4')]}}; \ No newline at end of file +var _0xc5e6=['SENDING','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x1f2455,_0x33ee79){var _0x1cf505=function(_0x2dc908){while(--_0x2dc908){_0x1f2455['push'](_0x1f2455['shift']());}};_0x1cf505(++_0x33ee79);}(_0xc5e6,0x83));var _0x6c5e=function(_0x3c6c1b,_0x82a1e4){_0x3c6c1b=_0x3c6c1b-0x0;var _0x15170e=_0xc5e6[_0x3c6c1b];return _0x15170e;};'use strict';var Sequelize=require(_0x6c5e('0x0'));module[_0x6c5e('0x1')]={'integration':{'type':Sequelize[_0x6c5e('0x2')]},'eventChannel':{'type':Sequelize[_0x6c5e('0x2')]},'exitStatus':{'type':Sequelize[_0x6c5e('0x2')]},'ticketId':{'type':Sequelize[_0x6c5e('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6c5e('0x2')]},'calleridnum':{'type':Sequelize[_0x6c5e('0x2')]},'calleridname':{'type':Sequelize[_0x6c5e('0x2')]},'queue':{'type':Sequelize[_0x6c5e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6c5e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6c5e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6c5e('0x3')]},'holdtime':{'type':Sequelize[_0x6c5e('0x4')]},'agentcomplete':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x6c5e('0x4')]},'agentacw':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6c5e('0x4')]},'reason':{'type':Sequelize[_0x6c5e('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x6c5e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6c5e('0x2')]},'channel':{'type':Sequelize[_0x6c5e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6c5e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6c5e('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6c5e('0x2')]},'accountcode':{'type':Sequelize[_0x6c5e('0x2')]},'context':{'type':Sequelize[_0x6c5e('0x2')]},'exten':{'type':Sequelize[_0x6c5e('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x6c5e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x6c5e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6c5e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6c5e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6c5e('0x2')]},'destlanguage':{'type':Sequelize[_0x6c5e('0x2')]},'destaccountcode':{'type':Sequelize[_0x6c5e('0x2')]},'destcontext':{'type':Sequelize[_0x6c5e('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6c5e('0x2')]},'messageId':{'type':Sequelize[_0x6c5e('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6c5e('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x6c5e('0x6')]},'html':{'type':Sequelize[_0x6c5e('0x6')]},'text':{'type':Sequelize[_0x6c5e('0x6')]},'status':{'type':Sequelize[_0x6c5e('0x7')](_0x6c5e('0x8'),_0x6c5e('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0x6c5e('0x2')]},'app':{'type':Sequelize[_0x6c5e('0x2')]},'appdata':{'type':Sequelize[_0x6c5e('0x2')]},'projectId':{'type':Sequelize[_0x6c5e('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 32b8095..c1e1971 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 _0x8097=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','Content-Range','reject','save','then','destroy','error','stack','name','index','IntegrationReport','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','body','update','find','describe','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x9e5217,_0x493d2a){var _0x33eec2=function(_0x1fcbe9){while(--_0x1fcbe9){_0x9e5217['push'](_0x9e5217['shift']());}};_0x33eec2(++_0x493d2a);}(_0x8097,0x1f0));var _0x7809=function(_0x409765,_0x22dc18){_0x409765=_0x409765-0x0;var _0x4313af=_0x8097[_0x409765];return _0x4313af;};'use strict';var emlformat=require(_0x7809('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7809('0x1'));var rp=require(_0x7809('0x2'));var moment=require(_0x7809('0x3'));var BPromise=require(_0x7809('0x4'));var Mustache=require(_0x7809('0x5'));var util=require(_0x7809('0x6'));var path=require(_0x7809('0x7'));var sox=require(_0x7809('0x8'));var csv=require(_0x7809('0x9'));var ejs=require(_0x7809('0xa'));var fs=require('fs');var fs_extra=require(_0x7809('0xb'));var _=require('lodash');var squel=require(_0x7809('0xc'));var crypto=require(_0x7809('0xd'));var jsforce=require(_0x7809('0xe'));var deskjs=require(_0x7809('0xf'));var toCsv=require(_0x7809('0x9'));var querystring=require(_0x7809('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7809('0x11'));var qs=require(_0x7809('0x12'));var as=require(_0x7809('0x13'));var hardwareService=require(_0x7809('0x14'));var logger=require(_0x7809('0x15'))(_0x7809('0x16'));var utils=require('../../config/utils');var config=require(_0x7809('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7809('0x18'))['db'];function respondWithStatusCode(_0x524eb4,_0x44c3fc){_0x44c3fc=_0x44c3fc||0xcc;return function(_0x44a63f){if(_0x44a63f){return _0x524eb4[_0x7809('0x19')](_0x44c3fc);}return _0x524eb4[_0x7809('0x1a')](_0x44c3fc)[_0x7809('0x1b')]();};}function respondWithResult(_0x443b57,_0x403ba1){_0x403ba1=_0x403ba1||0xc8;return function(_0x52444e){if(_0x52444e){return _0x443b57['status'](_0x403ba1)[_0x7809('0x1c')](_0x52444e);}};}function respondWithFilteredResult(_0x1230b3,_0xb97726){return function(_0x21b1ea){if(_0x21b1ea){var _0x7ac031=typeof _0xb97726[_0x7809('0x1d')]==='undefined'&&typeof _0xb97726['limit']==='undefined';var _0x27b545=_0x21b1ea[_0x7809('0x1e')];var _0x42f1d7=_0x7ac031?0x0:_0xb97726[_0x7809('0x1d')];var _0x48146a=_0x7ac031?_0x21b1ea['count']:_0xb97726['offset']+_0xb97726[_0x7809('0x1f')];var _0xfa11ec;if(_0x48146a>=_0x27b545){_0x48146a=_0x27b545;_0xfa11ec=0xc8;}else{_0xfa11ec=0xce;}_0x1230b3['status'](_0xfa11ec);return _0x1230b3['set'](_0x7809('0x20'),_0x42f1d7+'-'+_0x48146a+'/'+_0x27b545)[_0x7809('0x1c')](_0x21b1ea);}return null;};}function patchUpdates(_0x569ad3){return function(_0x474348){try{jsonpatch['apply'](_0x474348,_0x569ad3,!![]);}catch(_0x11d33d){return BPromise[_0x7809('0x21')](_0x11d33d);}return _0x474348[_0x7809('0x22')]();};}function saveUpdates(_0x3701cf,_0xcf5ba4){return function(_0x99fd17){if(_0x99fd17){return _0x99fd17['update'](_0x3701cf)[_0x7809('0x23')](function(_0x4e703f){return _0x4e703f;});}return null;};}function removeEntity(_0x5a9fe4,_0x2d8819){return function(_0x315d85){if(_0x315d85){return _0x315d85[_0x7809('0x24')]()[_0x7809('0x23')](function(){_0x5a9fe4['status'](0xcc)[_0x7809('0x1b')]();});}};}function handleEntityNotFound(_0x515547,_0x1c56f9){return function(_0x88c732){if(!_0x88c732){_0x515547[_0x7809('0x19')](0x194);}return _0x88c732;};}function handleError(_0x97c038,_0x84f230){_0x84f230=_0x84f230||0x1f4;return function(_0x3d43cc){logger[_0x7809('0x25')](_0x3d43cc[_0x7809('0x26')]);if(_0x3d43cc[_0x7809('0x27')]){delete _0x3d43cc[_0x7809('0x27')];}_0x97c038[_0x7809('0x1a')](_0x84f230)['send'](_0x3d43cc);};}exports[_0x7809('0x28')]=function(_0x764963,_0x64d651){var _0x2fcca3={},_0x9f8c79={},_0x1d8ac1={'count':0x0,'rows':[]};var _0x1eecb6=_['map'](db[_0x7809('0x29')][_0x7809('0x2a')],function(_0x429f90){return{'name':_0x429f90['fieldName'],'type':_0x429f90[_0x7809('0x2b')][_0x7809('0x2c')]};});_0x9f8c79[_0x7809('0x2d')]=_['map'](_0x1eecb6,_0x7809('0x27'));_0x9f8c79['query']=_[_0x7809('0x2e')](_0x764963['query']);_0x9f8c79[_0x7809('0x2f')]=_[_0x7809('0x30')](_0x9f8c79[_0x7809('0x2d')],_0x9f8c79[_0x7809('0x31')]);_0x2fcca3[_0x7809('0x32')]=_[_0x7809('0x30')](_0x9f8c79[_0x7809('0x2d')],qs[_0x7809('0x33')](_0x764963[_0x7809('0x31')][_0x7809('0x33')]));_0x2fcca3['attributes']=_0x2fcca3[_0x7809('0x32')][_0x7809('0x34')]?_0x2fcca3[_0x7809('0x32')]:_0x9f8c79[_0x7809('0x2d')];if(!_0x764963['query'][_0x7809('0x35')](_0x7809('0x36'))){_0x2fcca3['limit']=qs['limit'](_0x764963['query'][_0x7809('0x1f')]);_0x2fcca3['offset']=qs[_0x7809('0x1d')](_0x764963[_0x7809('0x31')][_0x7809('0x1d')]);}_0x2fcca3['order']=qs[_0x7809('0x37')](_0x764963[_0x7809('0x31')][_0x7809('0x37')]);_0x2fcca3['where']=qs[_0x7809('0x2f')](_[_0x7809('0x38')](_0x764963[_0x7809('0x31')],_0x9f8c79[_0x7809('0x2f')]),_0x1eecb6);if(_0x764963[_0x7809('0x31')][_0x7809('0x39')]){_0x2fcca3[_0x7809('0x3a')]=_[_0x7809('0x3b')](_0x2fcca3[_0x7809('0x3a')],{'$or':_[_0x7809('0x3c')](_0x1eecb6,function(_0x2a5090){if(_0x2a5090[_0x7809('0x2b')]!==_0x7809('0x3d')){var _0x4c9624={};_0x4c9624[_0x2a5090[_0x7809('0x27')]]={'$like':'%'+_0x764963[_0x7809('0x31')][_0x7809('0x39')]+'%'};return _0x4c9624;}})});}_0x2fcca3=_[_0x7809('0x3b')]({},_0x2fcca3,_0x764963['options']);var _0x3f3e86={'where':_0x2fcca3[_0x7809('0x3a')]};return db['IntegrationReport'][_0x7809('0x1e')](_0x3f3e86)['then'](function(_0x2d342a){_0x1d8ac1[_0x7809('0x1e')]=_0x2d342a;if(_0x764963[_0x7809('0x31')][_0x7809('0x3e')]){_0x2fcca3[_0x7809('0x3f')]=[{'all':!![]}];}return db[_0x7809('0x29')][_0x7809('0x40')](_0x2fcca3);})['then'](function(_0x309db3){_0x1d8ac1[_0x7809('0x41')]=_0x309db3;return _0x1d8ac1;})[_0x7809('0x23')](respondWithFilteredResult(_0x64d651,_0x2fcca3))[_0x7809('0x42')](handleError(_0x64d651,null));};exports[_0x7809('0x43')]=function(_0x6bbafe,_0x41eb98){var _0x227fd8={'raw':![],'where':{'id':_0x6bbafe[_0x7809('0x44')]['id']}},_0x3db06e={};_0x3db06e[_0x7809('0x2d')]=_[_0x7809('0x2e')](db[_0x7809('0x29')][_0x7809('0x2a')]);_0x3db06e[_0x7809('0x31')]=_[_0x7809('0x2e')](_0x6bbafe['query']);_0x3db06e[_0x7809('0x2f')]=_[_0x7809('0x30')](_0x3db06e[_0x7809('0x2d')],_0x3db06e[_0x7809('0x31')]);_0x227fd8[_0x7809('0x32')]=_['intersection'](_0x3db06e['model'],qs[_0x7809('0x33')](_0x6bbafe[_0x7809('0x31')][_0x7809('0x33')]));_0x227fd8[_0x7809('0x32')]=_0x227fd8[_0x7809('0x32')]['length']?_0x227fd8[_0x7809('0x32')]:_0x3db06e['model'];if(_0x6bbafe[_0x7809('0x31')][_0x7809('0x3e')]){_0x227fd8[_0x7809('0x3f')]=[{'all':!![]}];}_0x227fd8=_[_0x7809('0x3b')]({},_0x227fd8,_0x6bbafe[_0x7809('0x45')]);return db[_0x7809('0x29')]['find'](_0x227fd8)[_0x7809('0x23')](handleEntityNotFound(_0x41eb98,null))[_0x7809('0x23')](respondWithResult(_0x41eb98,null))[_0x7809('0x42')](handleError(_0x41eb98,null));};exports['create']=function(_0x1c99d5,_0x774f93){return db[_0x7809('0x29')]['create'](_0x1c99d5[_0x7809('0x46')],{})[_0x7809('0x23')](respondWithResult(_0x774f93,0xc9))[_0x7809('0x42')](handleError(_0x774f93,null));};exports[_0x7809('0x47')]=function(_0x10f39b,_0x3ec118){if(_0x10f39b[_0x7809('0x46')]['id']){delete _0x10f39b[_0x7809('0x46')]['id'];}return db[_0x7809('0x29')][_0x7809('0x48')]({'where':{'id':_0x10f39b[_0x7809('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ec118,null))[_0x7809('0x23')](saveUpdates(_0x10f39b[_0x7809('0x46')],null))['then'](respondWithResult(_0x3ec118,null))['catch'](handleError(_0x3ec118,null));};exports['destroy']=function(_0x1ddc16,_0x393232){return db[_0x7809('0x29')]['find']({'where':{'id':_0x1ddc16[_0x7809('0x44')]['id']}})[_0x7809('0x23')](handleEntityNotFound(_0x393232,null))[_0x7809('0x23')](removeEntity(_0x393232,null))[_0x7809('0x42')](handleError(_0x393232,null));};exports[_0x7809('0x49')]=function(_0x57d701,_0x4de900){return db[_0x7809('0x29')][_0x7809('0x49')]()[_0x7809('0x23')](respondWithResult(_0x4de900,null))[_0x7809('0x42')](handleError(_0x4de900,null));}; \ No newline at end of file +var _0xd648=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','includeAll','rows','catch','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','keys','intersection'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xd648,0x1da));var _0x8d64=function(_0x4f45cc,_0x2d99f0){_0x4f45cc=_0x4f45cc-0x0;var _0x1b9315=_0xd648[_0x4f45cc];return _0x1b9315;};'use strict';var emlformat=require(_0x8d64('0x0'));var rimraf=require(_0x8d64('0x1'));var zipdir=require(_0x8d64('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8d64('0x3'));var moment=require(_0x8d64('0x4'));var BPromise=require(_0x8d64('0x5'));var Mustache=require(_0x8d64('0x6'));var util=require('util');var path=require(_0x8d64('0x7'));var sox=require(_0x8d64('0x8'));var csv=require('to-csv');var ejs=require(_0x8d64('0x9'));var fs=require('fs');var fs_extra=require(_0x8d64('0xa'));var _=require('lodash');var squel=require(_0x8d64('0xb'));var crypto=require(_0x8d64('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d64('0xd'));var querystring=require(_0x8d64('0xe'));var Papa=require(_0x8d64('0xf'));var Redis=require(_0x8d64('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8d64('0x11'));var as=require(_0x8d64('0x12'));var hardwareService=require(_0x8d64('0x13'));var logger=require('../../config/logger')(_0x8d64('0x14'));var utils=require(_0x8d64('0x15'));var config=require(_0x8d64('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8d64('0x17'))['db'];function respondWithStatusCode(_0x277155,_0xa54ba3){_0xa54ba3=_0xa54ba3||0xcc;return function(_0x4623da){if(_0x4623da){return _0x277155['sendStatus'](_0xa54ba3);}return _0x277155[_0x8d64('0x18')](_0xa54ba3)[_0x8d64('0x19')]();};}function respondWithResult(_0x4ac3f7,_0x3096c8){_0x3096c8=_0x3096c8||0xc8;return function(_0x3bfb61){if(_0x3bfb61){return _0x4ac3f7[_0x8d64('0x18')](_0x3096c8)[_0x8d64('0x1a')](_0x3bfb61);}};}function respondWithFilteredResult(_0x135a1f,_0x3a2504){return function(_0x3737ac){if(_0x3737ac){var _0x666255=typeof _0x3a2504[_0x8d64('0x1b')]===_0x8d64('0x1c')&&typeof _0x3a2504[_0x8d64('0x1d')]===_0x8d64('0x1c');var _0x1800a0=_0x3737ac[_0x8d64('0x1e')];var _0x231c34=_0x666255?0x0:_0x3a2504[_0x8d64('0x1b')];var _0x308d2b=_0x666255?_0x3737ac[_0x8d64('0x1e')]:_0x3a2504[_0x8d64('0x1b')]+_0x3a2504[_0x8d64('0x1d')];var _0x4ac75f;if(_0x308d2b>=_0x1800a0){_0x308d2b=_0x1800a0;_0x4ac75f=0xc8;}else{_0x4ac75f=0xce;}_0x135a1f[_0x8d64('0x18')](_0x4ac75f);return _0x135a1f[_0x8d64('0x1f')](_0x8d64('0x20'),_0x231c34+'-'+_0x308d2b+'/'+_0x1800a0)[_0x8d64('0x1a')](_0x3737ac);}return null;};}function patchUpdates(_0xc3aca4){return function(_0x4c2eff){try{jsonpatch[_0x8d64('0x21')](_0x4c2eff,_0xc3aca4,!![]);}catch(_0x41cf22){return BPromise['reject'](_0x41cf22);}return _0x4c2eff['save']();};}function saveUpdates(_0x31f741,_0x4d025e){return function(_0x4c9ce5){if(_0x4c9ce5){return _0x4c9ce5[_0x8d64('0x22')](_0x31f741)['then'](function(_0xa26da4){return _0xa26da4;});}return null;};}function removeEntity(_0x50e390,_0x23118d){return function(_0x3d2b9e){if(_0x3d2b9e){return _0x3d2b9e[_0x8d64('0x23')]()[_0x8d64('0x24')](function(){_0x50e390['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x326406,_0x4b4ad4){return function(_0x169850){if(!_0x169850){_0x326406['sendStatus'](0x194);}return _0x169850;};}function handleError(_0x7ab6be,_0x3db02e){_0x3db02e=_0x3db02e||0x1f4;return function(_0x1e35aa){logger[_0x8d64('0x25')](_0x1e35aa[_0x8d64('0x26')]);if(_0x1e35aa[_0x8d64('0x27')]){delete _0x1e35aa[_0x8d64('0x27')];}_0x7ab6be[_0x8d64('0x18')](_0x3db02e)[_0x8d64('0x28')](_0x1e35aa);};}exports[_0x8d64('0x29')]=function(_0x4bbc53,_0x299e2b){var _0x5ec37f={},_0x21e0cc={},_0x571824={'count':0x0,'rows':[]};var _0x1d5ed2=_[_0x8d64('0x2a')](db[_0x8d64('0x2b')]['rawAttributes'],function(_0x207796){return{'name':_0x207796[_0x8d64('0x2c')],'type':_0x207796[_0x8d64('0x2d')][_0x8d64('0x2e')]};});_0x21e0cc[_0x8d64('0x2f')]=_[_0x8d64('0x2a')](_0x1d5ed2,_0x8d64('0x27'));_0x21e0cc[_0x8d64('0x30')]=_[_0x8d64('0x31')](_0x4bbc53[_0x8d64('0x30')]);_0x21e0cc['filters']=_[_0x8d64('0x32')](_0x21e0cc[_0x8d64('0x2f')],_0x21e0cc[_0x8d64('0x30')]);_0x5ec37f['attributes']=_[_0x8d64('0x32')](_0x21e0cc['model'],qs[_0x8d64('0x33')](_0x4bbc53['query'][_0x8d64('0x33')]));_0x5ec37f['attributes']=_0x5ec37f[_0x8d64('0x34')][_0x8d64('0x35')]?_0x5ec37f['attributes']:_0x21e0cc[_0x8d64('0x2f')];if(!_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x36')](_0x8d64('0x37'))){_0x5ec37f[_0x8d64('0x1d')]=qs['limit'](_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x1d')]);_0x5ec37f[_0x8d64('0x1b')]=qs[_0x8d64('0x1b')](_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x1b')]);}_0x5ec37f[_0x8d64('0x38')]=qs[_0x8d64('0x39')](_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x39')]);_0x5ec37f[_0x8d64('0x3a')]=qs['filters'](_[_0x8d64('0x3b')](_0x4bbc53[_0x8d64('0x30')],_0x21e0cc[_0x8d64('0x3c')]),_0x1d5ed2);if(_0x4bbc53['query'][_0x8d64('0x3d')]){_0x5ec37f['where']=_['merge'](_0x5ec37f[_0x8d64('0x3a')],{'$or':_[_0x8d64('0x2a')](_0x1d5ed2,function(_0x11f8fc){if(_0x11f8fc['type']!==_0x8d64('0x3e')){var _0x2349ab={};_0x2349ab[_0x11f8fc[_0x8d64('0x27')]]={'$like':'%'+_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x3d')]+'%'};return _0x2349ab;}})});}_0x5ec37f=_[_0x8d64('0x3f')]({},_0x5ec37f,_0x4bbc53['options']);var _0x5de613={'where':_0x5ec37f[_0x8d64('0x3a')]};return db[_0x8d64('0x2b')][_0x8d64('0x1e')](_0x5de613)['then'](function(_0x15d37b){_0x571824[_0x8d64('0x1e')]=_0x15d37b;if(_0x4bbc53[_0x8d64('0x30')][_0x8d64('0x40')]){_0x5ec37f['include']=[{'all':!![]}];}return db[_0x8d64('0x2b')]['findAll'](_0x5ec37f);})[_0x8d64('0x24')](function(_0x462d8d){_0x571824[_0x8d64('0x41')]=_0x462d8d;return _0x571824;})[_0x8d64('0x24')](respondWithFilteredResult(_0x299e2b,_0x5ec37f))[_0x8d64('0x42')](handleError(_0x299e2b,null));};exports['show']=function(_0x482225,_0xe88c03){var _0x50aee6={'raw':![],'where':{'id':_0x482225[_0x8d64('0x43')]['id']}},_0x3abee0={};_0x3abee0[_0x8d64('0x2f')]=_[_0x8d64('0x31')](db[_0x8d64('0x2b')][_0x8d64('0x44')]);_0x3abee0['query']=_['keys'](_0x482225[_0x8d64('0x30')]);_0x3abee0[_0x8d64('0x3c')]=_[_0x8d64('0x32')](_0x3abee0[_0x8d64('0x2f')],_0x3abee0['query']);_0x50aee6[_0x8d64('0x34')]=_[_0x8d64('0x32')](_0x3abee0['model'],qs[_0x8d64('0x33')](_0x482225[_0x8d64('0x30')][_0x8d64('0x33')]));_0x50aee6[_0x8d64('0x34')]=_0x50aee6[_0x8d64('0x34')][_0x8d64('0x35')]?_0x50aee6['attributes']:_0x3abee0[_0x8d64('0x2f')];if(_0x482225[_0x8d64('0x30')][_0x8d64('0x40')]){_0x50aee6[_0x8d64('0x45')]=[{'all':!![]}];}_0x50aee6=_[_0x8d64('0x3f')]({},_0x50aee6,_0x482225[_0x8d64('0x46')]);return db[_0x8d64('0x2b')][_0x8d64('0x47')](_0x50aee6)[_0x8d64('0x24')](handleEntityNotFound(_0xe88c03,null))[_0x8d64('0x24')](respondWithResult(_0xe88c03,null))[_0x8d64('0x42')](handleError(_0xe88c03,null));};exports[_0x8d64('0x48')]=function(_0x37ed97,_0x18e18e){return db['IntegrationReport'][_0x8d64('0x48')](_0x37ed97['body'],{})[_0x8d64('0x24')](respondWithResult(_0x18e18e,0xc9))[_0x8d64('0x42')](handleError(_0x18e18e,null));};exports[_0x8d64('0x22')]=function(_0x40e2c6,_0x21250b){if(_0x40e2c6[_0x8d64('0x49')]['id']){delete _0x40e2c6[_0x8d64('0x49')]['id'];}return db[_0x8d64('0x2b')][_0x8d64('0x47')]({'where':{'id':_0x40e2c6[_0x8d64('0x43')]['id']}})[_0x8d64('0x24')](handleEntityNotFound(_0x21250b,null))['then'](saveUpdates(_0x40e2c6['body'],null))[_0x8d64('0x24')](respondWithResult(_0x21250b,null))[_0x8d64('0x42')](handleError(_0x21250b,null));};exports[_0x8d64('0x23')]=function(_0x498444,_0xc7f89d){return db['IntegrationReport'][_0x8d64('0x47')]({'where':{'id':_0x498444[_0x8d64('0x43')]['id']}})[_0x8d64('0x24')](handleEntityNotFound(_0xc7f89d,null))[_0x8d64('0x24')](removeEntity(_0xc7f89d,null))['catch'](handleError(_0xc7f89d,null));};exports[_0x8d64('0x4a')]=function(_0x4117b8,_0x203dca){return db[_0x8d64('0x2b')][_0x8d64('0x4a')]()['then'](respondWithResult(_0x203dca,null))['catch'](handleError(_0x203dca,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 395e4e4..d221c48 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 _0xc5d8=['../../config/environment','./integrationReport.attributes','IntegrationReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x103c0a,_0x2572fd){var _0x197c85=function(_0x5f2200){while(--_0x5f2200){_0x103c0a['push'](_0x103c0a['shift']());}};_0x197c85(++_0x2572fd);}(_0xc5d8,0x161));var _0x8c5d=function(_0x321df4,_0x3efec5){_0x321df4=_0x321df4-0x0;var _0x50d06c=_0xc5d8[_0x321df4];return _0x50d06c;};'use strict';var _=require('lodash');var util=require(_0x8c5d('0x0'));var logger=require(_0x8c5d('0x1'))(_0x8c5d('0x2'));var moment=require(_0x8c5d('0x3'));var BPromise=require(_0x8c5d('0x4'));var rp=require(_0x8c5d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c5d('0x6'));var config=require(_0x8c5d('0x7'));var attributes=require(_0x8c5d('0x8'));module['exports']=function(_0x57979e,_0x55663b){return _0x57979e['define'](_0x8c5d('0x9'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe9f=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','util','api','moment','bluebird','request-promise'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0xfe9f,0xaf));var _0xffe9=function(_0x3ddf5c,_0x5e55eb){_0x3ddf5c=_0x3ddf5c-0x0;var _0x4a3410=_0xfe9f[_0x3ddf5c];return _0x4a3410;};'use strict';var _=require('lodash');var util=require(_0xffe9('0x0'));var logger=require('../../config/logger')(_0xffe9('0x1'));var moment=require(_0xffe9('0x2'));var BPromise=require(_0xffe9('0x3'));var rp=require(_0xffe9('0x4'));var fs=require('fs');var path=require(_0xffe9('0x5'));var rimraf=require(_0xffe9('0x6'));var config=require(_0xffe9('0x7'));var attributes=require(_0xffe9('0x8'));module[_0xffe9('0x9')]=function(_0x2d750b,_0x1cd396){return _0x2d750b['define'](_0xffe9('0xa'),attributes,{'tableName':_0xffe9('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 26f768f..bdcf2f6 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 _0x31f0=['../../config/environment','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x15a8a2,_0x54b607){var _0x1786e8=function(_0x5e3ef3){while(--_0x5e3ef3){_0x15a8a2['push'](_0x15a8a2['shift']());}};_0x1786e8(++_0x54b607);}(_0x31f0,0xb7));var _0x031f=function(_0x61fe7c,_0x45e12d){_0x61fe7c=_0x61fe7c-0x0;var _0x2465a6=_0x31f0[_0x61fe7c];return _0x2465a6;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x340009,_0x416b26){var _0x48f1de=function(_0x35aebd){while(--_0x35aebd){_0x340009['push'](_0x340009['shift']());}};_0x48f1de(++_0x416b26);}(_0xda19,0xd5));var _0x9da1=function(_0x51aff1,_0x1ce446){_0x51aff1=_0x51aff1-0x0;var _0x42a506=_0xda19[_0x51aff1];return _0x42a506;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b0fa86a..3d4dc3f 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 _0x6114=['util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','exports','multer'];(function(_0x409c8b,_0x4892d4){var _0x430500=function(_0x386132){while(--_0x386132){_0x409c8b['push'](_0x409c8b['shift']());}};_0x430500(++_0x4892d4);}(_0x6114,0x6d));var _0x4611=function(_0x350a01,_0x5ed763){_0x350a01=_0x350a01-0x0;var _0xc17c6b=_0x6114[_0x350a01];return _0xc17c6b;};'use strict';var multer=require(_0x4611('0x0'));var util=require(_0x4611('0x1'));var path=require(_0x4611('0x2'));var timeout=require(_0x4611('0x3'));var express=require(_0x4611('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4611('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4611('0x6'));var controller=require(_0x4611('0x7'));router[_0x4611('0x8')]('/',auth['isAuthenticated'](),controller[_0x4611('0x9')]);router[_0x4611('0x8')](_0x4611('0xa'),auth[_0x4611('0xb')](),controller[_0x4611('0xc')]);router[_0x4611('0x8')](_0x4611('0xd'),auth[_0x4611('0xb')](),controller[_0x4611('0xe')]);router[_0x4611('0xf')]('/',auth[_0x4611('0xb')](),controller[_0x4611('0x10')]);router['post']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x4611('0x11')]);router[_0x4611('0xf')](_0x4611('0x12'),auth[_0x4611('0xb')](),controller[_0x4611('0x13')]);router['put'](_0x4611('0xa'),auth[_0x4611('0xb')](),controller[_0x4611('0x14')]);router['delete'](_0x4611('0xa'),auth[_0x4611('0xb')](),controller['destroy']);module[_0x4611('0x15')]=router; \ No newline at end of file +var _0xe202=['express','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x480f46,_0x585199){var _0x1431e0=function(_0x1a24f5){while(--_0x1a24f5){_0x480f46['push'](_0x480f46['shift']());}};_0x1431e0(++_0x585199);}(_0xe202,0x194));var _0x2e20=function(_0x433945,_0x59b45f){_0x433945=_0x433945-0x0;var _0x4a5392=_0xe202[_0x433945];return _0x4a5392;};'use strict';var multer=require(_0x2e20('0x0'));var util=require(_0x2e20('0x1'));var path=require(_0x2e20('0x2'));var timeout=require(_0x2e20('0x3'));var express=require(_0x2e20('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e20('0x5'));var interaction=require(_0x2e20('0x6'));var config=require('../../config/environment');var controller=require(_0x2e20('0x7'));router[_0x2e20('0x8')]('/',auth[_0x2e20('0x9')](),controller[_0x2e20('0xa')]);router[_0x2e20('0x8')]('/:id',auth[_0x2e20('0x9')](),controller['show']);router[_0x2e20('0x8')](_0x2e20('0xb'),auth[_0x2e20('0x9')](),controller[_0x2e20('0xc')]);router[_0x2e20('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e20('0xe')]);router[_0x2e20('0xd')](_0x2e20('0xb'),auth[_0x2e20('0x9')](),controller[_0x2e20('0xf')]);router['post'](_0x2e20('0x10'),auth['isAuthenticated'](),controller[_0x2e20('0x11')]);router[_0x2e20('0x12')](_0x2e20('0x13'),auth[_0x2e20('0x9')](),controller[_0x2e20('0x14')]);router[_0x2e20('0x15')](_0x2e20('0x13'),auth[_0x2e20('0x9')](),controller[_0x2e20('0x16')]);module[_0x2e20('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 87535e4..8bf8c60 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 _0x59e7=['sequelize','exports','STRING'];(function(_0x27c994,_0x114936){var _0x369001=function(_0x3a458a){while(--_0x3a458a){_0x27c994['push'](_0x27c994['shift']());}};_0x369001(++_0x114936);}(_0x59e7,0x15f));var _0x759e=function(_0x3118bf,_0x5b90b5){_0x3118bf=_0x3118bf-0x0;var _0x103a30=_0x59e7[_0x3118bf];return _0x103a30;};'use strict';var Sequelize=require(_0x759e('0x0'));module[_0x759e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x759e('0x2')]},'interval':{'type':Sequelize[_0x759e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf584=['STRING','sequelize','exports'];(function(_0x38f69b,_0x3dfcd8){var _0x212fbb=function(_0x4271bd){while(--_0x4271bd){_0x38f69b['push'](_0x38f69b['shift']());}};_0x212fbb(++_0x3dfcd8);}(_0xf584,0x15a));var _0x4f58=function(_0x71fe5a,_0x38e957){_0x71fe5a=_0x71fe5a-0x0;var _0x159564=_0xf584[_0x71fe5a];return _0x159564;};'use strict';var Sequelize=require(_0x4f58('0x0'));module[_0x4f58('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f58('0x2')]},'interval':{'type':Sequelize[_0x4f58('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 88c060b..4aab002 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 _0xb4de=['filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','update','addInterval','IntervalId','getIntervals','addIntervals','findOne','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','index','map','Interval','fieldName','type','key','model','query','keys'];(function(_0x55affd,_0xaa69f4){var _0x3cc6c5=function(_0x28bbc4){while(--_0x28bbc4){_0x55affd['push'](_0x55affd['shift']());}};_0x3cc6c5(++_0xaa69f4);}(_0xb4de,0x82));var _0xeb4d=function(_0x572b29,_0x2edf28){_0x572b29=_0x572b29-0x0;var _0x4952d8=_0xb4de[_0x572b29];return _0x4952d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb4d('0x0'));var zipdir=require(_0xeb4d('0x1'));var jsonpatch=require(_0xeb4d('0x2'));var rp=require(_0xeb4d('0x3'));var moment=require(_0xeb4d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb4d('0x5'));var util=require(_0xeb4d('0x6'));var path=require(_0xeb4d('0x7'));var sox=require(_0xeb4d('0x8'));var csv=require(_0xeb4d('0x9'));var ejs=require(_0xeb4d('0xa'));var fs=require('fs');var fs_extra=require(_0xeb4d('0xb'));var _=require(_0xeb4d('0xc'));var squel=require(_0xeb4d('0xd'));var crypto=require(_0xeb4d('0xe'));var jsforce=require(_0xeb4d('0xf'));var deskjs=require(_0xeb4d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xeb4d('0x11'));var Papa=require(_0xeb4d('0x12'));var Redis=require(_0xeb4d('0x13'));var authService=require(_0xeb4d('0x14'));var qs=require(_0xeb4d('0x15'));var as=require(_0xeb4d('0x16'));var hardwareService=require(_0xeb4d('0x17'));var logger=require(_0xeb4d('0x18'))(_0xeb4d('0x19'));var utils=require(_0xeb4d('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xeb4d('0x1b'));var db=require(_0xeb4d('0x1c'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x5e8498,_0x45ce89){_0x45ce89=_0x45ce89||0xcc;return function(_0x313043){if(_0x313043){return _0x5e8498[_0xeb4d('0x1d')](_0x45ce89);}return _0x5e8498[_0xeb4d('0x1e')](_0x45ce89)[_0xeb4d('0x1f')]();};}function respondWithResult(_0x592307,_0x381f5c){_0x381f5c=_0x381f5c||0xc8;return function(_0x35da8e){if(_0x35da8e){return _0x592307[_0xeb4d('0x1e')](_0x381f5c)[_0xeb4d('0x20')](_0x35da8e);}};}function respondWithFilteredResult(_0x2c6fc6,_0x133173){return function(_0x5e76cb){if(_0x5e76cb){var _0x3cc575=typeof _0x133173[_0xeb4d('0x21')]===_0xeb4d('0x22')&&typeof _0x133173[_0xeb4d('0x23')]===_0xeb4d('0x22');var _0x386b9c=_0x5e76cb[_0xeb4d('0x24')];var _0x544fec=_0x3cc575?0x0:_0x133173['offset'];var _0x5f2f26=_0x3cc575?_0x5e76cb[_0xeb4d('0x24')]:_0x133173[_0xeb4d('0x21')]+_0x133173[_0xeb4d('0x23')];var _0x8a47ba;if(_0x5f2f26>=_0x386b9c){_0x5f2f26=_0x386b9c;_0x8a47ba=0xc8;}else{_0x8a47ba=0xce;}_0x2c6fc6[_0xeb4d('0x1e')](_0x8a47ba);return _0x2c6fc6[_0xeb4d('0x25')](_0xeb4d('0x26'),_0x544fec+'-'+_0x5f2f26+'/'+_0x386b9c)[_0xeb4d('0x20')](_0x5e76cb);}return null;};}function patchUpdates(_0x5acecc){return function(_0x4d2f2c){try{jsonpatch[_0xeb4d('0x27')](_0x4d2f2c,_0x5acecc,!![]);}catch(_0x2b236f){return BPromise[_0xeb4d('0x28')](_0x2b236f);}return _0x4d2f2c[_0xeb4d('0x29')]();};}function saveUpdates(_0x38fcd3,_0x54b26c){return function(_0x1b4c3a){if(_0x1b4c3a){return _0x1b4c3a['update'](_0x38fcd3)[_0xeb4d('0x2a')](function(_0x420ab0){return _0x420ab0;});}return null;};}function removeEntity(_0x514564,_0x1778cd){return function(_0x114424){if(_0x114424){return _0x114424[_0xeb4d('0x2b')]()['then'](function(){var _0x12466c=_0x114424[_0xeb4d('0x2c')]({'plain':!![]});var _0x4a89d5='Intervals';return db[_0xeb4d('0x2d')]['destroy']({'where':{'type':_0x4a89d5,'resourceId':_0x12466c['id']}})['then'](function(){return _0x114424;});})['then'](function(){_0x514564[_0xeb4d('0x1e')](0xcc)[_0xeb4d('0x1f')]();});}};}function handleEntityNotFound(_0x4c840c,_0x1759a9){return function(_0x3e657a){if(!_0x3e657a){_0x4c840c['sendStatus'](0x194);}return _0x3e657a;};}function handleError(_0xe72fe4,_0x9be1e6){_0x9be1e6=_0x9be1e6||0x1f4;return function(_0x3c69e0){logger[_0xeb4d('0x2e')](_0x3c69e0['stack']);if(_0x3c69e0['name']){delete _0x3c69e0[_0xeb4d('0x2f')];}_0xe72fe4[_0xeb4d('0x1e')](_0x9be1e6)[_0xeb4d('0x30')](_0x3c69e0);};}exports[_0xeb4d('0x31')]=function(_0x3c4d49,_0x4b39cb){var _0x495b7a={},_0x18efbe={},_0x44a101={'count':0x0,'rows':[]};var _0x5a3d8e=_[_0xeb4d('0x32')](db[_0xeb4d('0x33')]['rawAttributes'],function(_0xc1b62c){return{'name':_0xc1b62c[_0xeb4d('0x34')],'type':_0xc1b62c[_0xeb4d('0x35')][_0xeb4d('0x36')]};});_0x18efbe[_0xeb4d('0x37')]=_['map'](_0x5a3d8e,'name');_0x18efbe[_0xeb4d('0x38')]=_[_0xeb4d('0x39')](_0x3c4d49[_0xeb4d('0x38')]);_0x18efbe[_0xeb4d('0x3a')]=_['intersection'](_0x18efbe[_0xeb4d('0x37')],_0x18efbe[_0xeb4d('0x38')]);_0x495b7a[_0xeb4d('0x3b')]=_['intersection'](_0x18efbe[_0xeb4d('0x37')],qs[_0xeb4d('0x3c')](_0x3c4d49[_0xeb4d('0x38')]['fields']));_0x495b7a['attributes']=_0x495b7a['attributes'][_0xeb4d('0x3d')]?_0x495b7a[_0xeb4d('0x3b')]:_0x18efbe[_0xeb4d('0x37')];if(!_0x3c4d49[_0xeb4d('0x38')][_0xeb4d('0x3e')](_0xeb4d('0x3f'))){_0x495b7a['limit']=qs[_0xeb4d('0x23')](_0x3c4d49[_0xeb4d('0x38')][_0xeb4d('0x23')]);_0x495b7a[_0xeb4d('0x21')]=qs[_0xeb4d('0x21')](_0x3c4d49[_0xeb4d('0x38')][_0xeb4d('0x21')]);}_0x495b7a[_0xeb4d('0x40')]=qs[_0xeb4d('0x41')](_0x3c4d49[_0xeb4d('0x38')]['sort']);_0x495b7a[_0xeb4d('0x42')]=qs[_0xeb4d('0x3a')](_[_0xeb4d('0x43')](_0x3c4d49[_0xeb4d('0x38')],_0x18efbe[_0xeb4d('0x3a')]),_0x5a3d8e);if(_0x3c4d49[_0xeb4d('0x38')]['filter']){_0x495b7a[_0xeb4d('0x42')]=_[_0xeb4d('0x44')](_0x495b7a[_0xeb4d('0x42')],{'$or':_['map'](_0x5a3d8e,function(_0x26c77c){if(_0x26c77c['type']!==_0xeb4d('0x45')){var _0xb2b2ae={};_0xb2b2ae[_0x26c77c[_0xeb4d('0x2f')]]={'$like':'%'+_0x3c4d49[_0xeb4d('0x38')][_0xeb4d('0x46')]+'%'};return _0xb2b2ae;}})});}_0x495b7a=_[_0xeb4d('0x44')]({},_0x495b7a,_0x3c4d49[_0xeb4d('0x47')]);var _0x3b032b={'where':_0x495b7a['where']};return db[_0xeb4d('0x33')][_0xeb4d('0x24')](_0x3b032b)[_0xeb4d('0x2a')](function(_0x48aad9){_0x44a101[_0xeb4d('0x24')]=_0x48aad9;if(_0x3c4d49[_0xeb4d('0x38')][_0xeb4d('0x48')]){_0x495b7a[_0xeb4d('0x49')]=[{'all':!![]}];}return db[_0xeb4d('0x33')][_0xeb4d('0x4a')](_0x495b7a);})['then'](function(_0x3d8e8e){_0x44a101[_0xeb4d('0x4b')]=_0x3d8e8e;return _0x44a101;})['then'](respondWithFilteredResult(_0x4b39cb,_0x495b7a))[_0xeb4d('0x4c')](handleError(_0x4b39cb,null));};exports[_0xeb4d('0x4d')]=function(_0x5baa04,_0xfc9980){var _0x528759={'raw':!![],'where':{'id':_0x5baa04[_0xeb4d('0x4e')]['id']}},_0x84f4c6={};_0x84f4c6[_0xeb4d('0x37')]=_['keys'](db[_0xeb4d('0x33')][_0xeb4d('0x4f')]);_0x84f4c6[_0xeb4d('0x38')]=_['keys'](_0x5baa04['query']);_0x84f4c6[_0xeb4d('0x3a')]=_[_0xeb4d('0x50')](_0x84f4c6[_0xeb4d('0x37')],_0x84f4c6['query']);_0x528759[_0xeb4d('0x3b')]=_[_0xeb4d('0x50')](_0x84f4c6[_0xeb4d('0x37')],qs[_0xeb4d('0x3c')](_0x5baa04[_0xeb4d('0x38')][_0xeb4d('0x3c')]));_0x528759[_0xeb4d('0x3b')]=_0x528759[_0xeb4d('0x3b')]['length']?_0x528759['attributes']:_0x84f4c6[_0xeb4d('0x37')];if(_0x5baa04['query'][_0xeb4d('0x48')]){_0x528759[_0xeb4d('0x49')]=[{'all':!![]}];}_0x528759=_['merge']({},_0x528759,_0x5baa04['options']);return db[_0xeb4d('0x33')][_0xeb4d('0x51')](_0x528759)[_0xeb4d('0x2a')](handleEntityNotFound(_0xfc9980,null))[_0xeb4d('0x2a')](respondWithResult(_0xfc9980,null))['catch'](handleError(_0xfc9980,null));};exports['create']=function(_0x2fcb16,_0xd46739){return db[_0xeb4d('0x33')][_0xeb4d('0x52')](_0x2fcb16[_0xeb4d('0x53')],{})[_0xeb4d('0x2a')](function(_0x371e5a){var _0x5925dc=_0x2fcb16['user']['get']({'plain':!![]});if(!_0x5925dc)throw new Error(_0xeb4d('0x54'));if(_0x5925dc[_0xeb4d('0x55')]===_0xeb4d('0x56')){var _0x3386d9=_0x371e5a[_0xeb4d('0x2c')]({'plain':!![]});var _0xe14080='Intervals';return db['UserProfileSection'][_0xeb4d('0x51')]({'where':{'name':_0xe14080,'userProfileId':_0x5925dc['userProfileId']},'raw':!![]})['then'](function(_0x57e624){if(_0x57e624&&_0x57e624['autoAssociation']===0x0){return db[_0xeb4d('0x2d')][_0xeb4d('0x52')]({'name':_0x3386d9[_0xeb4d('0x2f')],'resourceId':_0x3386d9['id'],'type':_0x57e624['name'],'sectionId':_0x57e624['id']},{})['then'](function(){return _0x371e5a;});}else{return _0x371e5a;}})[_0xeb4d('0x4c')](function(_0x48187c){logger[_0xeb4d('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48187c);throw _0x48187c;});}return _0x371e5a;})[_0xeb4d('0x2a')](respondWithResult(_0xd46739,0xc9))[_0xeb4d('0x4c')](handleError(_0xd46739,null));};exports[_0xeb4d('0x57')]=function(_0x428dbc,_0x30b70c){if(_0x428dbc[_0xeb4d('0x53')]['id']){delete _0x428dbc[_0xeb4d('0x53')]['id'];}return db[_0xeb4d('0x33')]['find']({'where':{'id':_0x428dbc[_0xeb4d('0x4e')]['id']}})[_0xeb4d('0x2a')](handleEntityNotFound(_0x30b70c,null))[_0xeb4d('0x2a')](saveUpdates(_0x428dbc['body'],null))['then'](respondWithResult(_0x30b70c,null))[_0xeb4d('0x4c')](handleError(_0x30b70c,null));};exports[_0xeb4d('0x2b')]=function(_0x2cf5d7,_0x313bc3){return db[_0xeb4d('0x33')][_0xeb4d('0x51')]({'where':{'id':_0x2cf5d7[_0xeb4d('0x4e')]['id']}})[_0xeb4d('0x2a')](handleEntityNotFound(_0x313bc3,null))['then'](removeEntity(_0x313bc3,null))['catch'](handleError(_0x313bc3,null));};exports[_0xeb4d('0x58')]=function(_0x29cb1a,_0xaae898,_0x3819aa){if(_0x29cb1a[_0xeb4d('0x53')]['id']){delete _0x29cb1a['body']['id'];}return db[_0xeb4d('0x33')][_0xeb4d('0x51')]({'where':{'id':_0x29cb1a[_0xeb4d('0x4e')]['id']}})[_0xeb4d('0x2a')](handleEntityNotFound(_0xaae898,null))[_0xeb4d('0x2a')](function(_0x2fc50f){if(_0x2fc50f){_0x29cb1a[_0xeb4d('0x53')][_0xeb4d('0x59')]=_0x2fc50f['id'];return db['Interval'][_0xeb4d('0x52')](_0x29cb1a['body']);}})[_0xeb4d('0x2a')](respondWithResult(_0xaae898,null))['catch'](handleError(_0xaae898,null));};exports[_0xeb4d('0x5a')]=function(_0x1b4692,_0x7eca47,_0x23c6ae){var _0x4e8e6b={};var _0x4c56c2={};var _0x5d56b8;var _0x4548d9;return db[_0xeb4d('0x33')]['findOne']({'where':{'id':_0x1b4692['params']['id']}})[_0xeb4d('0x2a')](handleEntityNotFound(_0x7eca47,null))[_0xeb4d('0x2a')](function(_0x36194a){if(_0x36194a){_0x5d56b8=_0x36194a;_0x4c56c2['model']=_[_0xeb4d('0x39')](db[_0xeb4d('0x33')][_0xeb4d('0x4f')]);_0x4c56c2[_0xeb4d('0x38')]=_['keys'](_0x1b4692[_0xeb4d('0x38')]);_0x4c56c2[_0xeb4d('0x3a')]=_[_0xeb4d('0x50')](_0x4c56c2[_0xeb4d('0x37')],_0x4c56c2[_0xeb4d('0x38')]);_0x4e8e6b[_0xeb4d('0x3b')]=_[_0xeb4d('0x50')](_0x4c56c2[_0xeb4d('0x37')],qs[_0xeb4d('0x3c')](_0x1b4692[_0xeb4d('0x38')]['fields']));_0x4e8e6b[_0xeb4d('0x3b')]=_0x4e8e6b['attributes'][_0xeb4d('0x3d')]?_0x4e8e6b['attributes']:_0x4c56c2[_0xeb4d('0x37')];_0x4e8e6b[_0xeb4d('0x40')]=qs[_0xeb4d('0x41')](_0x1b4692['query'][_0xeb4d('0x41')]);_0x4e8e6b[_0xeb4d('0x42')]=qs[_0xeb4d('0x3a')](_[_0xeb4d('0x43')](_0x1b4692[_0xeb4d('0x38')],_0x4c56c2[_0xeb4d('0x3a')]));if(_0x1b4692[_0xeb4d('0x38')][_0xeb4d('0x46')]){_0x4e8e6b[_0xeb4d('0x42')]=_['merge'](_0x4e8e6b['where'],{'$or':_['map'](_0x4e8e6b['attributes'],function(_0x108ea2){var _0x442ee4={};_0x442ee4[_0x108ea2]={'$like':'%'+_0x1b4692[_0xeb4d('0x38')][_0xeb4d('0x46')]+'%'};return _0x442ee4;})});}_0x4e8e6b=_[_0xeb4d('0x44')]({},_0x4e8e6b,_0x1b4692[_0xeb4d('0x47')]);return _0x5d56b8[_0xeb4d('0x5a')](_0x4e8e6b);}})[_0xeb4d('0x2a')](function(_0x28f87a){if(_0x28f87a){_0x4548d9=_0x28f87a['length'];if(!_0x1b4692[_0xeb4d('0x38')]['hasOwnProperty']('nolimit')){_0x4e8e6b[_0xeb4d('0x23')]=qs[_0xeb4d('0x23')](_0x1b4692['query'][_0xeb4d('0x23')]);_0x4e8e6b['offset']=qs[_0xeb4d('0x21')](_0x1b4692[_0xeb4d('0x38')]['offset']);}return _0x5d56b8[_0xeb4d('0x5a')](_0x4e8e6b);}})[_0xeb4d('0x2a')](function(_0x449bf6){if(_0x449bf6){return _0x449bf6?{'count':_0x4548d9,'rows':_0x449bf6}:null;}})['then'](respondWithResult(_0x7eca47,null))[_0xeb4d('0x4c')](handleError(_0x7eca47,null));};exports[_0xeb4d('0x5b')]=function(_0x551966,_0xb9126f,_0x414b59){return db['Interval'][_0xeb4d('0x5c')]({'where':{'id':_0x551966['params']['id']}})[_0xeb4d('0x2a')](handleEntityNotFound(_0xb9126f,null))[_0xeb4d('0x2a')](function(_0x5b6e05){if(_0x5b6e05){return db['sequelize'][_0xeb4d('0x5d')](function(_0x560cdc){return db[_0xeb4d('0x33')][_0xeb4d('0x2b')]({'where':{'IntervalId':_0x551966[_0xeb4d('0x4e')]['id']},'transaction':_0x560cdc})[_0xeb4d('0x2a')](function(_0xf56bfc){var _0x6008d7=_['map'](_0x551966[_0xeb4d('0x53')],function(_0x3b3deb){delete _0x3b3deb['id'];_0x3b3deb[_0xeb4d('0x59')]=_0x551966['params']['id'];return _0x3b3deb;});return db[_0xeb4d('0x33')]['bulkCreate'](_0x6008d7,{'transaction':_0x560cdc});});})[_0xeb4d('0x2a')](function(){return db[_0xeb4d('0x33')][_0xeb4d('0x4a')]({'where':{'IntervalId':_0x551966[_0xeb4d('0x4e')]['id']}});});}})[_0xeb4d('0x2a')](respondWithResult(_0xb9126f,null))[_0xeb4d('0x4c')](handleError(_0xb9126f,null));}; \ No newline at end of file +var _0x8a9c=['UserProfileResource','error','update','addInterval','getIntervals','findOne','hasOwnProperty','addIntervals','IntervalId','rimraf','zip-dir','fast-json-patch','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','../../components/extensions/rewrite','status','json','offset','undefined','count','limit','set','save','then','destroy','Intervals','end','sendStatus','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','fields','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x46e991,_0x3f80d0){var _0x401105=function(_0x1b1070){while(--_0x1b1070){_0x46e991['push'](_0x46e991['shift']());}};_0x401105(++_0x3f80d0);}(_0x8a9c,0x65));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8a9('0x0'));var zipdir=require(_0xc8a9('0x1'));var jsonpatch=require(_0xc8a9('0x2'));var rp=require('request-promise');var moment=require(_0xc8a9('0x3'));var BPromise=require(_0xc8a9('0x4'));var Mustache=require(_0xc8a9('0x5'));var util=require(_0xc8a9('0x6'));var path=require(_0xc8a9('0x7'));var sox=require(_0xc8a9('0x8'));var csv=require(_0xc8a9('0x9'));var ejs=require(_0xc8a9('0xa'));var fs=require('fs');var fs_extra=require(_0xc8a9('0xb'));var _=require(_0xc8a9('0xc'));var squel=require(_0xc8a9('0xd'));var crypto=require('crypto');var jsforce=require(_0xc8a9('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc8a9('0xf'));var Papa=require(_0xc8a9('0x10'));var Redis=require(_0xc8a9('0x11'));var authService=require(_0xc8a9('0x12'));var qs=require(_0xc8a9('0x13'));var as=require(_0xc8a9('0x14'));var hardwareService=require(_0xc8a9('0x15'));var logger=require(_0xc8a9('0x16'))(_0xc8a9('0x17'));var utils=require(_0xc8a9('0x18'));var config=require(_0xc8a9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0xc8a9('0x1a'));function respondWithStatusCode(_0x1a40c4,_0x11de08){_0x11de08=_0x11de08||0xcc;return function(_0x35e6f1){if(_0x35e6f1){return _0x1a40c4['sendStatus'](_0x11de08);}return _0x1a40c4[_0xc8a9('0x1b')](_0x11de08)['end']();};}function respondWithResult(_0x3561b9,_0x293656){_0x293656=_0x293656||0xc8;return function(_0x735f49){if(_0x735f49){return _0x3561b9[_0xc8a9('0x1b')](_0x293656)[_0xc8a9('0x1c')](_0x735f49);}};}function respondWithFilteredResult(_0x3fed67,_0x5187c9){return function(_0x5cd8b6){if(_0x5cd8b6){var _0x50c309=typeof _0x5187c9[_0xc8a9('0x1d')]==='undefined'&&typeof _0x5187c9['limit']===_0xc8a9('0x1e');var _0x39bf11=_0x5cd8b6[_0xc8a9('0x1f')];var _0x252617=_0x50c309?0x0:_0x5187c9['offset'];var _0x5bd31a=_0x50c309?_0x5cd8b6[_0xc8a9('0x1f')]:_0x5187c9[_0xc8a9('0x1d')]+_0x5187c9[_0xc8a9('0x20')];var _0x33a05d;if(_0x5bd31a>=_0x39bf11){_0x5bd31a=_0x39bf11;_0x33a05d=0xc8;}else{_0x33a05d=0xce;}_0x3fed67[_0xc8a9('0x1b')](_0x33a05d);return _0x3fed67[_0xc8a9('0x21')]('Content-Range',_0x252617+'-'+_0x5bd31a+'/'+_0x39bf11)[_0xc8a9('0x1c')](_0x5cd8b6);}return null;};}function patchUpdates(_0x5302ac){return function(_0x452ef7){try{jsonpatch['apply'](_0x452ef7,_0x5302ac,!![]);}catch(_0x25e1eb){return BPromise['reject'](_0x25e1eb);}return _0x452ef7[_0xc8a9('0x22')]();};}function saveUpdates(_0x97f197,_0x30a139){return function(_0x2b25a4){if(_0x2b25a4){return _0x2b25a4['update'](_0x97f197)[_0xc8a9('0x23')](function(_0x283279){return _0x283279;});}return null;};}function removeEntity(_0x16c977,_0x3f673c){return function(_0xaacc2){if(_0xaacc2){return _0xaacc2[_0xc8a9('0x24')]()[_0xc8a9('0x23')](function(){var _0xc1b9c1=_0xaacc2['get']({'plain':!![]});var _0x30d173=_0xc8a9('0x25');return db['UserProfileResource'][_0xc8a9('0x24')]({'where':{'type':_0x30d173,'resourceId':_0xc1b9c1['id']}})[_0xc8a9('0x23')](function(){return _0xaacc2;});})['then'](function(){_0x16c977[_0xc8a9('0x1b')](0xcc)[_0xc8a9('0x26')]();});}};}function handleEntityNotFound(_0x3207e8,_0x3d7a0d){return function(_0x3524a2){if(!_0x3524a2){_0x3207e8[_0xc8a9('0x27')](0x194);}return _0x3524a2;};}function handleError(_0x2f783e,_0x2a081f){_0x2a081f=_0x2a081f||0x1f4;return function(_0x3f890e){logger['error'](_0x3f890e[_0xc8a9('0x28')]);if(_0x3f890e['name']){delete _0x3f890e[_0xc8a9('0x29')];}_0x2f783e['status'](_0x2a081f)[_0xc8a9('0x2a')](_0x3f890e);};}exports[_0xc8a9('0x2b')]=function(_0x94c52b,_0x5cbc61){var _0x48f34f={},_0x120dbd={},_0x45697e={'count':0x0,'rows':[]};var _0x489881=_[_0xc8a9('0x2c')](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')],function(_0x1e4c16){return{'name':_0x1e4c16[_0xc8a9('0x2f')],'type':_0x1e4c16[_0xc8a9('0x30')][_0xc8a9('0x31')]};});_0x120dbd[_0xc8a9('0x32')]=_['map'](_0x489881,_0xc8a9('0x29'));_0x120dbd[_0xc8a9('0x33')]=_[_0xc8a9('0x34')](_0x94c52b[_0xc8a9('0x33')]);_0x120dbd[_0xc8a9('0x35')]=_['intersection'](_0x120dbd[_0xc8a9('0x32')],_0x120dbd['query']);_0x48f34f['attributes']=_['intersection'](_0x120dbd['model'],qs['fields'](_0x94c52b[_0xc8a9('0x33')]['fields']));_0x48f34f[_0xc8a9('0x36')]=_0x48f34f[_0xc8a9('0x36')][_0xc8a9('0x37')]?_0x48f34f[_0xc8a9('0x36')]:_0x120dbd['model'];if(!_0x94c52b[_0xc8a9('0x33')]['hasOwnProperty'](_0xc8a9('0x38'))){_0x48f34f[_0xc8a9('0x20')]=qs['limit'](_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x20')]);_0x48f34f[_0xc8a9('0x1d')]=qs[_0xc8a9('0x1d')](_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x1d')]);}_0x48f34f[_0xc8a9('0x39')]=qs[_0xc8a9('0x3a')](_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x3a')]);_0x48f34f[_0xc8a9('0x3b')]=qs['filters'](_[_0xc8a9('0x3c')](_0x94c52b['query'],_0x120dbd[_0xc8a9('0x35')]),_0x489881);if(_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x3d')]){_0x48f34f[_0xc8a9('0x3b')]=_[_0xc8a9('0x3e')](_0x48f34f[_0xc8a9('0x3b')],{'$or':_[_0xc8a9('0x2c')](_0x489881,function(_0x104bef){if(_0x104bef[_0xc8a9('0x30')]!==_0xc8a9('0x3f')){var _0x7a8a6d={};_0x7a8a6d[_0x104bef[_0xc8a9('0x29')]]={'$like':'%'+_0x94c52b[_0xc8a9('0x33')]['filter']+'%'};return _0x7a8a6d;}})});}_0x48f34f=_[_0xc8a9('0x3e')]({},_0x48f34f,_0x94c52b[_0xc8a9('0x40')]);var _0x5cc552={'where':_0x48f34f['where']};return db[_0xc8a9('0x2d')][_0xc8a9('0x1f')](_0x5cc552)['then'](function(_0x158b93){_0x45697e['count']=_0x158b93;if(_0x94c52b[_0xc8a9('0x33')][_0xc8a9('0x41')]){_0x48f34f[_0xc8a9('0x42')]=[{'all':!![]}];}return db[_0xc8a9('0x2d')][_0xc8a9('0x43')](_0x48f34f);})['then'](function(_0x364e1e){_0x45697e[_0xc8a9('0x44')]=_0x364e1e;return _0x45697e;})['then'](respondWithFilteredResult(_0x5cbc61,_0x48f34f))[_0xc8a9('0x45')](handleError(_0x5cbc61,null));};exports['show']=function(_0x402de6,_0x1ae22c){var _0x16ef11={'raw':!![],'where':{'id':_0x402de6[_0xc8a9('0x46')]['id']}},_0x521741={};_0x521741[_0xc8a9('0x32')]=_[_0xc8a9('0x34')](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')]);_0x521741[_0xc8a9('0x33')]=_[_0xc8a9('0x34')](_0x402de6[_0xc8a9('0x33')]);_0x521741[_0xc8a9('0x35')]=_[_0xc8a9('0x47')](_0x521741[_0xc8a9('0x32')],_0x521741[_0xc8a9('0x33')]);_0x16ef11[_0xc8a9('0x36')]=_[_0xc8a9('0x47')](_0x521741[_0xc8a9('0x32')],qs[_0xc8a9('0x48')](_0x402de6['query']['fields']));_0x16ef11[_0xc8a9('0x36')]=_0x16ef11[_0xc8a9('0x36')][_0xc8a9('0x37')]?_0x16ef11[_0xc8a9('0x36')]:_0x521741[_0xc8a9('0x32')];if(_0x402de6[_0xc8a9('0x33')]['includeAll']){_0x16ef11[_0xc8a9('0x42')]=[{'all':!![]}];}_0x16ef11=_[_0xc8a9('0x3e')]({},_0x16ef11,_0x402de6[_0xc8a9('0x40')]);return db[_0xc8a9('0x2d')]['find'](_0x16ef11)['then'](handleEntityNotFound(_0x1ae22c,null))[_0xc8a9('0x23')](respondWithResult(_0x1ae22c,null))[_0xc8a9('0x45')](handleError(_0x1ae22c,null));};exports['create']=function(_0x153149,_0x284954){return db[_0xc8a9('0x2d')][_0xc8a9('0x49')](_0x153149[_0xc8a9('0x4a')],{})[_0xc8a9('0x23')](function(_0x26ca3b){var _0x298aa6=_0x153149[_0xc8a9('0x4b')][_0xc8a9('0x4c')]({'plain':!![]});if(!_0x298aa6)throw new Error(_0xc8a9('0x4d'));if(_0x298aa6[_0xc8a9('0x4e')]===_0xc8a9('0x4b')){var _0x39ba4f=_0x26ca3b['get']({'plain':!![]});var _0x496c1a=_0xc8a9('0x25');return db[_0xc8a9('0x4f')][_0xc8a9('0x50')]({'where':{'name':_0x496c1a,'userProfileId':_0x298aa6[_0xc8a9('0x51')]},'raw':!![]})[_0xc8a9('0x23')](function(_0xa7850b){if(_0xa7850b&&_0xa7850b[_0xc8a9('0x52')]===0x0){return db[_0xc8a9('0x53')][_0xc8a9('0x49')]({'name':_0x39ba4f[_0xc8a9('0x29')],'resourceId':_0x39ba4f['id'],'type':_0xa7850b[_0xc8a9('0x29')],'sectionId':_0xa7850b['id']},{})[_0xc8a9('0x23')](function(){return _0x26ca3b;});}else{return _0x26ca3b;}})[_0xc8a9('0x45')](function(_0x443809){logger[_0xc8a9('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x443809);throw _0x443809;});}return _0x26ca3b;})[_0xc8a9('0x23')](respondWithResult(_0x284954,0xc9))[_0xc8a9('0x45')](handleError(_0x284954,null));};exports[_0xc8a9('0x55')]=function(_0x1549be,_0xe38142){if(_0x1549be[_0xc8a9('0x4a')]['id']){delete _0x1549be[_0xc8a9('0x4a')]['id'];}return db[_0xc8a9('0x2d')][_0xc8a9('0x50')]({'where':{'id':_0x1549be[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0xe38142,null))[_0xc8a9('0x23')](saveUpdates(_0x1549be['body'],null))[_0xc8a9('0x23')](respondWithResult(_0xe38142,null))[_0xc8a9('0x45')](handleError(_0xe38142,null));};exports[_0xc8a9('0x24')]=function(_0x23ceb2,_0x31f89b){return db['Interval']['find']({'where':{'id':_0x23ceb2['params']['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x31f89b,null))[_0xc8a9('0x23')](removeEntity(_0x31f89b,null))['catch'](handleError(_0x31f89b,null));};exports[_0xc8a9('0x56')]=function(_0x444b28,_0x2766a1,_0x7928f8){if(_0x444b28[_0xc8a9('0x4a')]['id']){delete _0x444b28[_0xc8a9('0x4a')]['id'];}return db[_0xc8a9('0x2d')]['find']({'where':{'id':_0x444b28[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x2766a1,null))[_0xc8a9('0x23')](function(_0x6e1880){if(_0x6e1880){_0x444b28[_0xc8a9('0x4a')]['IntervalId']=_0x6e1880['id'];return db['Interval'][_0xc8a9('0x49')](_0x444b28['body']);}})['then'](respondWithResult(_0x2766a1,null))[_0xc8a9('0x45')](handleError(_0x2766a1,null));};exports[_0xc8a9('0x57')]=function(_0x494337,_0x2b5e83,_0x1432d7){var _0x508d5a={};var _0x3f74c0={};var _0x14a61e;var _0x59fce5;return db[_0xc8a9('0x2d')][_0xc8a9('0x58')]({'where':{'id':_0x494337[_0xc8a9('0x46')]['id']}})[_0xc8a9('0x23')](handleEntityNotFound(_0x2b5e83,null))[_0xc8a9('0x23')](function(_0x81bae2){if(_0x81bae2){_0x14a61e=_0x81bae2;_0x3f74c0[_0xc8a9('0x32')]=_['keys'](db[_0xc8a9('0x2d')][_0xc8a9('0x2e')]);_0x3f74c0['query']=_[_0xc8a9('0x34')](_0x494337[_0xc8a9('0x33')]);_0x3f74c0['filters']=_[_0xc8a9('0x47')](_0x3f74c0[_0xc8a9('0x32')],_0x3f74c0[_0xc8a9('0x33')]);_0x508d5a['attributes']=_['intersection'](_0x3f74c0['model'],qs[_0xc8a9('0x48')](_0x494337[_0xc8a9('0x33')]['fields']));_0x508d5a[_0xc8a9('0x36')]=_0x508d5a[_0xc8a9('0x36')][_0xc8a9('0x37')]?_0x508d5a[_0xc8a9('0x36')]:_0x3f74c0[_0xc8a9('0x32')];_0x508d5a[_0xc8a9('0x39')]=qs[_0xc8a9('0x3a')](_0x494337[_0xc8a9('0x33')][_0xc8a9('0x3a')]);_0x508d5a['where']=qs[_0xc8a9('0x35')](_[_0xc8a9('0x3c')](_0x494337['query'],_0x3f74c0[_0xc8a9('0x35')]));if(_0x494337['query']['filter']){_0x508d5a[_0xc8a9('0x3b')]=_[_0xc8a9('0x3e')](_0x508d5a[_0xc8a9('0x3b')],{'$or':_['map'](_0x508d5a[_0xc8a9('0x36')],function(_0x46c182){var _0x31ff73={};_0x31ff73[_0x46c182]={'$like':'%'+_0x494337['query'][_0xc8a9('0x3d')]+'%'};return _0x31ff73;})});}_0x508d5a=_[_0xc8a9('0x3e')]({},_0x508d5a,_0x494337[_0xc8a9('0x40')]);return _0x14a61e['getIntervals'](_0x508d5a);}})['then'](function(_0x2b2a1f){if(_0x2b2a1f){_0x59fce5=_0x2b2a1f[_0xc8a9('0x37')];if(!_0x494337[_0xc8a9('0x33')][_0xc8a9('0x59')](_0xc8a9('0x38'))){_0x508d5a['limit']=qs['limit'](_0x494337[_0xc8a9('0x33')][_0xc8a9('0x20')]);_0x508d5a[_0xc8a9('0x1d')]=qs[_0xc8a9('0x1d')](_0x494337[_0xc8a9('0x33')][_0xc8a9('0x1d')]);}return _0x14a61e[_0xc8a9('0x57')](_0x508d5a);}})[_0xc8a9('0x23')](function(_0x583dfb){if(_0x583dfb){return _0x583dfb?{'count':_0x59fce5,'rows':_0x583dfb}:null;}})['then'](respondWithResult(_0x2b5e83,null))[_0xc8a9('0x45')](handleError(_0x2b5e83,null));};exports[_0xc8a9('0x5a')]=function(_0x42df49,_0x1de63e,_0x95f68a){return db[_0xc8a9('0x2d')][_0xc8a9('0x58')]({'where':{'id':_0x42df49[_0xc8a9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1de63e,null))[_0xc8a9('0x23')](function(_0x55be3b){if(_0x55be3b){return db['sequelize']['transaction'](function(_0x2b38cf){return db[_0xc8a9('0x2d')][_0xc8a9('0x24')]({'where':{'IntervalId':_0x42df49['params']['id']},'transaction':_0x2b38cf})['then'](function(_0x5b4bed){var _0x3904c9=_['map'](_0x42df49['body'],function(_0x252f8f){delete _0x252f8f['id'];_0x252f8f[_0xc8a9('0x5b')]=_0x42df49[_0xc8a9('0x46')]['id'];return _0x252f8f;});return db[_0xc8a9('0x2d')]['bulkCreate'](_0x3904c9,{'transaction':_0x2b38cf});});})[_0xc8a9('0x23')](function(){return db[_0xc8a9('0x2d')]['findAll']({'where':{'IntervalId':_0x42df49[_0xc8a9('0x46')]['id']}});});}})[_0xc8a9('0x23')](respondWithResult(_0x1de63e,null))[_0xc8a9('0x45')](handleError(_0x1de63e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index cd3b506..806261b 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 _0xbd78=['reduce','../../components/extensions/rewrite','iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','map','ifTime','then'];(function(_0x1125af,_0x40c829){var _0x1c01b1=function(_0x2e6e05){while(--_0x2e6e05){_0x1125af['push'](_0x1125af['shift']());}};_0x1c01b1(++_0x40c829);}(_0xbd78,0x189));var _0x8bd7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbd78[_0x1ac595];return _0x455fff;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x8bd7('0x0'));var iftime=require('../../utils/iftime')[_0x8bd7('0x1')];module[_0x8bd7('0x2')]=function(_0x599581){return _0x599581[_0x8bd7('0x3')](_0x8bd7('0x4'),attributes,{'tableName':_0x8bd7('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d7951){extensions['rewrite'](_0x599581,_0x5d7951);},'afterBulkCreate':function(_0xc2405c,_0x29ae09,_0x246315){_0x246315();extensions[_0x8bd7('0x6')](_0x599581,_0xc2405c[0x0]);},'afterUpdate':function(_0x480335){extensions[_0x8bd7('0x6')](_0x599581,_0x480335);},'afterDestroy':function(_0x22d616){extensions[_0x8bd7('0x6')](_0x599581,_0x22d616);}},'instanceMethods':{'ifTime':function(_0x55338f=undefined,_0x3e661e=new Date()){if(typeof this[_0x8bd7('0x7')]===_0x8bd7('0x8')){return iftime(this[_0x8bd7('0x7')],_0x55338f,_0x3e661e);}else{return this[_0x8bd7('0x9')]()['then'](function(_0x56785b){return Promise['all'](_0x56785b[_0x8bd7('0xa')](function(_0x17c0df){return _0x17c0df[_0x8bd7('0xb')](_0x55338f,_0x3e661e);}));})[_0x8bd7('0xc')](function(_0x51f94d){return _0x51f94d[_0x8bd7('0xd')](function(_0x4664ae,_0x22915c){return _0x4664ae||_0x22915c;},![]);});}}}});}; \ No newline at end of file +var _0xb50e=['Interval','rewrite','interval','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','iftime','exports'];(function(_0x5f1013,_0x4f03d4){var _0x20a5bc=function(_0x5e6066){while(--_0x5e6066){_0x5f1013['push'](_0x5f1013['shift']());}};_0x20a5bc(++_0x4f03d4);}(_0xb50e,0x190));var _0xeb50=function(_0x4f708f,_0x19857c){_0x4f708f=_0x4f708f-0x0;var _0xc14ea8=_0xb50e[_0x4f708f];return _0xc14ea8;};'use strict';var attributes=require(_0xeb50('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0xeb50('0x1')];module[_0xeb50('0x2')]=function(_0x10d40a){return _0x10d40a['define'](_0xeb50('0x3'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2fb2df){extensions[_0xeb50('0x4')](_0x10d40a,_0x2fb2df);},'afterBulkCreate':function(_0x14373b,_0x3539f4,_0x4fc94d){_0x4fc94d();extensions[_0xeb50('0x4')](_0x10d40a,_0x14373b[0x0]);},'afterUpdate':function(_0x1df921){extensions[_0xeb50('0x4')](_0x10d40a,_0x1df921);},'afterDestroy':function(_0xe93c70){extensions[_0xeb50('0x4')](_0x10d40a,_0xe93c70);}},'instanceMethods':{'ifTime':function(_0x57f12f=undefined,_0x30c4e3=new Date()){if(typeof this[_0xeb50('0x5')]===_0xeb50('0x6')){return iftime(this[_0xeb50('0x5')],_0x57f12f,_0x30c4e3);}else{return this[_0xeb50('0x7')]()[_0xeb50('0x8')](function(_0x4ed13d){return Promise[_0xeb50('0x9')](_0x4ed13d[_0xeb50('0xa')](function(_0x1a04a8){return _0x1a04a8[_0xeb50('0xb')](_0x57f12f,_0x30c4e3);}));})[_0xeb50('0x8')](function(_0x4c21cb){return _0x4c21cb[_0xeb50('0xc')](function(_0x17d528,_0x53e195){return _0x17d528||_0x53e195;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 4084077..e54e731 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 _0x0536=['rpc','GetInterval','Interval','raw','options','attributes','include','map','model','then','info','stringify','catch','error','message','ShowInterval','find','where','reduce','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervals','string','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s','debug','Iftime','silly','IntervalIftime','isArray','lodash','../../mysqldb'];(function(_0x2dbc8f,_0x59c1a7){var _0x510410=function(_0xa4d2ee){while(--_0xa4d2ee){_0x2dbc8f['push'](_0x2dbc8f['shift']());}};_0x510410(++_0x59c1a7);}(_0x0536,0xfa));var _0x6053=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0536[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6053('0x0'));var util=require('util');var db=require(_0x6053('0x1'))['db'];var iftime=require('../../utils/iftime')['iftime'];var logger=require('../../config/logger')(_0x6053('0x2'));exports[_0x6053('0x3')]=function(_0x13dd12){var _0x3236ef=this;return new Promise(function(_0x34869e,_0x1d1f41){return db[_0x6053('0x4')]['findAll']({'raw':_0x13dd12['options']?_0x13dd12['options'][_0x6053('0x5')]===undefined?!![]:![]:!![],'where':_0x13dd12[_0x6053('0x6')]?_0x13dd12[_0x6053('0x6')]['where']||null:null,'attributes':_0x13dd12[_0x6053('0x6')]?_0x13dd12['options'][_0x6053('0x7')]||null:null,'limit':_0x13dd12[_0x6053('0x6')]?_0x13dd12['options']['limit']||null:null,'include':_0x13dd12[_0x6053('0x6')]?_0x13dd12[_0x6053('0x6')][_0x6053('0x8')]?_[_0x6053('0x9')](_0x13dd12[_0x6053('0x6')][_0x6053('0x8')],function(_0x4c83af){return{'model':db[_0x4c83af['model']],'as':_0x4c83af['as'],'attributes':_0x4c83af[_0x6053('0x7')],'include':_0x4c83af[_0x6053('0x8')]?_['map'](_0x4c83af[_0x6053('0x8')],function(_0xb3c175){return{'model':db[_0xb3c175['model']],'as':_0xb3c175['as'],'attributes':_0xb3c175[_0x6053('0x7')],'include':_0xb3c175[_0x6053('0x8')]?_['map'](_0xb3c175['include'],function(_0x540c5a){return{'model':db[_0x540c5a[_0x6053('0xa')]],'as':_0x540c5a['as'],'attributes':_0x540c5a[_0x6053('0x7')]};}):[]};}):[]};}):[]:[]})[_0x6053('0xb')](function(_0x4a5afc){logger[_0x6053('0xc')](_0x6053('0x3'),_0x13dd12);logger['debug'](_0x6053('0x3'),_0x13dd12,JSON[_0x6053('0xd')](_0x4a5afc));_0x34869e(_0x4a5afc);})[_0x6053('0xe')](function(_0x495ac4){logger[_0x6053('0xf')]('GetInterval',_0x495ac4[_0x6053('0x10')],_0x13dd12);_0x1d1f41(_0x3236ef[_0x6053('0xf')](0x1f4,_0x495ac4[_0x6053('0x10')]));});});};exports[_0x6053('0x11')]=function(_0xaebec4){var _0x504436=this;return new Promise(function(_0x339061,_0xaf42ac){return db['Interval'][_0x6053('0x12')]({'raw':_0xaebec4['options']?_0xaebec4['options']['raw']===undefined?!![]:![]:!![],'where':_0xaebec4[_0x6053('0x6')]?_0xaebec4[_0x6053('0x6')][_0x6053('0x13')]||null:null,'attributes':_0xaebec4[_0x6053('0x6')]?_0xaebec4[_0x6053('0x6')][_0x6053('0x7')]||null:null,'include':_0xaebec4[_0x6053('0x6')]?_0xaebec4[_0x6053('0x6')][_0x6053('0x8')]?_[_0x6053('0x9')](_0xaebec4['options'][_0x6053('0x8')],function(_0x5943ec){return{'model':db[_0x5943ec[_0x6053('0xa')]],'as':_0x5943ec['as'],'attributes':_0x5943ec[_0x6053('0x7')],'include':_0x5943ec[_0x6053('0x8')]?_[_0x6053('0x9')](_0x5943ec[_0x6053('0x8')],function(_0x50e0b6){return{'model':db[_0x50e0b6[_0x6053('0xa')]],'as':_0x50e0b6['as'],'attributes':_0x50e0b6[_0x6053('0x7')],'include':_0x50e0b6[_0x6053('0x8')]?_['map'](_0x50e0b6[_0x6053('0x8')],function(_0xedab02){return{'model':db[_0xedab02['model']],'as':_0xedab02['as'],'attributes':_0xedab02[_0x6053('0x7')]};}):[]};}):[]};}):[]:[]})[_0x6053('0xb')](function(_0xc473dc){logger['info'](_0x6053('0x11'),_0xaebec4);logger['debug'](_0x6053('0x11'),_0xaebec4,JSON[_0x6053('0xd')](_0xc473dc));_0x339061(_0xc473dc);})[_0x6053('0xe')](function(_0x7bcbcf){logger['error'](_0x6053('0x11'),_0x7bcbcf['message'],_0xaebec4);_0xaf42ac(_0x504436[_0x6053('0xf')](0x1f4,_0x7bcbcf[_0x6053('0x10')]));});});};function checkArrayOfIntervals(_0x261838,_0x553c1e){var _0xf4c5e7=[];return db[_0x6053('0x4')]['findAll']({'where':{'id':_0x261838}})[_0x6053('0xb')](function(_0x2259e9){_0xf4c5e7=_0x2259e9;return Promise['all'](_0xf4c5e7['map'](function(_0x98ce2c){return _0x98ce2c['ifTime'](_0x553c1e);}));})['then'](function(_0x4d9ba9){var _0x4e70b3=_0x4d9ba9[_0x6053('0x14')](function(_0x4c9c9d,_0x4cffdc){return _0x4c9c9d||_0x4cffdc;},![]);logger['info'](util[_0x6053('0x15')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0xf4c5e7['map'](function(_0x3fd5b2){return _0x3fd5b2[_0x6053('0x16')];})[_0x6053('0x17')](',\x20'),_0xf4c5e7[_0x6053('0x9')](function(_0x1c5d21){return _0x1c5d21['id'];})[_0x6053('0x17')](',\x20')));return _0x4e70b3;});}function checkSingleInterval(_0xb72b77,_0x5926c6){return db[_0x6053('0x4')][_0x6053('0x18')](_0xb72b77)[_0x6053('0xb')](function(_0x4c23ed){if(_0x4c23ed){logger['info'](util[_0x6053('0x15')](_0x6053('0x19'),_0x4c23ed[_0x6053('0x16')],_0x4c23ed['id']));return _0x4c23ed['ifTime'](_0x5926c6);}});}exports['IntervalIftime']=function(_0x54d02b){var _0x1ad500=_0x54d02b['intervalIds'];var _0x25a08f=Array['isArray'](_0x54d02b[_0x6053('0x1a')])?_0x54d02b[_0x6053('0x1a')]:typeof _0x54d02b[_0x6053('0x1a')]===_0x6053('0x1b')?[_0x54d02b[_0x6053('0x1a')]]:[];var _0x2d86f3=_0x54d02b[_0x6053('0x1c')]||undefined;var _0x248923=![];if(_0x25a08f[_0x6053('0x1d')]){logger['info'](util[_0x6053('0x15')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x25a08f[_0x6053('0x17')](';\x20')));}if(_0x2d86f3){logger['info'](util[_0x6053('0x15')](_0x6053('0x1e'),_0x2d86f3));}logger[_0x6053('0x1f')](_0x6053('0x20'),_0x248923);logger[_0x6053('0x21')](_0x6053('0x22'),_0x54d02b);return Promise['resolve']()[_0x6053('0xb')](function(){if(Array[_0x6053('0x23')](_0x1ad500)){return checkArrayOfIntervals(_0x1ad500,_0x2d86f3);}else if(_0x1ad500){return checkSingleInterval(_0x1ad500,_0x2d86f3);}})[_0x6053('0xb')](function(_0x55b23c){var _0xee4361=_0x25a08f['reduce'](function(_0x5b6291,_0x1a4aa7){return _0x5b6291||iftime(_0x1a4aa7,_0x2d86f3);},![]);_0x248923=_0x55b23c||_0xee4361;return _0x248923;})[_0x6053('0xe')](function(_0x315b25){logger[_0x6053('0xf')](_0x6053('0x22'),_0x54d02b,_0x315b25);throw this[_0x6053('0xf')](0x1f4,_0x315b25[_0x6053('0x10')]);});}; \ No newline at end of file +var _0x9d8a=['isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','lodash','util','../../mysqldb','../../utils/iftime','iftime','GetInterval','Interval','options','raw','where','attributes','map','include','model','then','info','debug','stringify','catch','error','message','ShowInterval','find','all','ifTime','reduce','format','name','join','findById','intervalIds'];(function(_0x17ee90,_0x1025dc){var _0x1b2e52=function(_0x9d70e0){while(--_0x9d70e0){_0x17ee90['push'](_0x17ee90['shift']());}};_0x1b2e52(++_0x1025dc);}(_0x9d8a,0x81));var _0xa9d8=function(_0x293d3e,_0x41b2d9){_0x293d3e=_0x293d3e-0x0;var _0x5abca4=_0x9d8a[_0x293d3e];return _0x5abca4;};'use strict';var _=require(_0xa9d8('0x0'));var util=require(_0xa9d8('0x1'));var db=require(_0xa9d8('0x2'))['db'];var iftime=require(_0xa9d8('0x3'))[_0xa9d8('0x4')];var logger=require('../../config/logger')('rpc');exports[_0xa9d8('0x5')]=function(_0x37b3e6){var _0x334134=this;return new Promise(function(_0x53d0f5,_0x153aa7){return db[_0xa9d8('0x6')]['findAll']({'raw':_0x37b3e6[_0xa9d8('0x7')]?_0x37b3e6[_0xa9d8('0x7')][_0xa9d8('0x8')]===undefined?!![]:![]:!![],'where':_0x37b3e6[_0xa9d8('0x7')]?_0x37b3e6[_0xa9d8('0x7')][_0xa9d8('0x9')]||null:null,'attributes':_0x37b3e6[_0xa9d8('0x7')]?_0x37b3e6[_0xa9d8('0x7')][_0xa9d8('0xa')]||null:null,'limit':_0x37b3e6['options']?_0x37b3e6[_0xa9d8('0x7')]['limit']||null:null,'include':_0x37b3e6['options']?_0x37b3e6['options']['include']?_[_0xa9d8('0xb')](_0x37b3e6['options'][_0xa9d8('0xc')],function(_0x130620){return{'model':db[_0x130620[_0xa9d8('0xd')]],'as':_0x130620['as'],'attributes':_0x130620[_0xa9d8('0xa')],'include':_0x130620[_0xa9d8('0xc')]?_[_0xa9d8('0xb')](_0x130620['include'],function(_0x2bf4be){return{'model':db[_0x2bf4be[_0xa9d8('0xd')]],'as':_0x2bf4be['as'],'attributes':_0x2bf4be[_0xa9d8('0xa')],'include':_0x2bf4be['include']?_[_0xa9d8('0xb')](_0x2bf4be[_0xa9d8('0xc')],function(_0x31c6b1){return{'model':db[_0x31c6b1[_0xa9d8('0xd')]],'as':_0x31c6b1['as'],'attributes':_0x31c6b1['attributes']};}):[]};}):[]};}):[]:[]})[_0xa9d8('0xe')](function(_0x5cab98){logger[_0xa9d8('0xf')]('GetInterval',_0x37b3e6);logger[_0xa9d8('0x10')](_0xa9d8('0x5'),_0x37b3e6,JSON[_0xa9d8('0x11')](_0x5cab98));_0x53d0f5(_0x5cab98);})[_0xa9d8('0x12')](function(_0x19e8c8){logger[_0xa9d8('0x13')](_0xa9d8('0x5'),_0x19e8c8[_0xa9d8('0x14')],_0x37b3e6);_0x153aa7(_0x334134['error'](0x1f4,_0x19e8c8[_0xa9d8('0x14')]));});});};exports[_0xa9d8('0x15')]=function(_0x1bfd59){var _0x733468=this;return new Promise(function(_0x196a07,_0xbb507f){return db['Interval'][_0xa9d8('0x16')]({'raw':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59[_0xa9d8('0x7')][_0xa9d8('0x9')]||null:null,'attributes':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59['options'][_0xa9d8('0xa')]||null:null,'include':_0x1bfd59[_0xa9d8('0x7')]?_0x1bfd59[_0xa9d8('0x7')][_0xa9d8('0xc')]?_[_0xa9d8('0xb')](_0x1bfd59[_0xa9d8('0x7')][_0xa9d8('0xc')],function(_0x458562){return{'model':db[_0x458562[_0xa9d8('0xd')]],'as':_0x458562['as'],'attributes':_0x458562[_0xa9d8('0xa')],'include':_0x458562[_0xa9d8('0xc')]?_[_0xa9d8('0xb')](_0x458562[_0xa9d8('0xc')],function(_0x6e191f){return{'model':db[_0x6e191f['model']],'as':_0x6e191f['as'],'attributes':_0x6e191f[_0xa9d8('0xa')],'include':_0x6e191f['include']?_['map'](_0x6e191f[_0xa9d8('0xc')],function(_0x28eaa9){return{'model':db[_0x28eaa9[_0xa9d8('0xd')]],'as':_0x28eaa9['as'],'attributes':_0x28eaa9[_0xa9d8('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa9d8('0xe')](function(_0x14dea7){logger[_0xa9d8('0xf')](_0xa9d8('0x15'),_0x1bfd59);logger[_0xa9d8('0x10')](_0xa9d8('0x15'),_0x1bfd59,JSON[_0xa9d8('0x11')](_0x14dea7));_0x196a07(_0x14dea7);})[_0xa9d8('0x12')](function(_0x1c62a4){logger[_0xa9d8('0x13')]('ShowInterval',_0x1c62a4[_0xa9d8('0x14')],_0x1bfd59);_0xbb507f(_0x733468[_0xa9d8('0x13')](0x1f4,_0x1c62a4[_0xa9d8('0x14')]));});});};function checkArrayOfIntervals(_0x263626,_0x3b4de8){var _0x1c2ade=[];return db['Interval']['findAll']({'where':{'id':_0x263626}})['then'](function(_0x292749){_0x1c2ade=_0x292749;return Promise[_0xa9d8('0x17')](_0x1c2ade[_0xa9d8('0xb')](function(_0x15d99d){return _0x15d99d[_0xa9d8('0x18')](_0x3b4de8);}));})[_0xa9d8('0xe')](function(_0x6429b6){var _0x455eb6=_0x6429b6[_0xa9d8('0x19')](function(_0x35f421,_0x428c34){return _0x35f421||_0x428c34;},![]);logger[_0xa9d8('0xf')](util[_0xa9d8('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x1c2ade['map'](function(_0x6bb38c){return _0x6bb38c[_0xa9d8('0x1b')];})['join'](',\x20'),_0x1c2ade['map'](function(_0x1f17d1){return _0x1f17d1['id'];})[_0xa9d8('0x1c')](',\x20')));return _0x455eb6;});}function checkSingleInterval(_0x323c97,_0x300a1d){return db['Interval'][_0xa9d8('0x1d')](_0x323c97)[_0xa9d8('0xe')](function(_0x4fa950){if(_0x4fa950){logger['info'](util[_0xa9d8('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x4fa950[_0xa9d8('0x1b')],_0x4fa950['id']));return _0x4fa950[_0xa9d8('0x18')](_0x300a1d);}});}exports['IntervalIftime']=function(_0x51a3bc){var _0x2414af=_0x51a3bc[_0xa9d8('0x1e')];var _0x51a964=Array[_0xa9d8('0x1f')](_0x51a3bc[_0xa9d8('0x20')])?_0x51a3bc['intervals']:typeof _0x51a3bc[_0xa9d8('0x20')]===_0xa9d8('0x21')?[_0x51a3bc[_0xa9d8('0x20')]]:[];var _0x324b80=_0x51a3bc[_0xa9d8('0x22')]||undefined;var _0x1f115d=![];if(_0x51a964[_0xa9d8('0x23')]){logger[_0xa9d8('0xf')](util[_0xa9d8('0x1a')](_0xa9d8('0x24'),_0x51a964[_0xa9d8('0x1c')](';\x20')));}if(_0x324b80){logger[_0xa9d8('0xf')](util[_0xa9d8('0x1a')](_0xa9d8('0x25'),_0x324b80));}logger[_0xa9d8('0x10')]('Iftime',_0x1f115d);logger[_0xa9d8('0x26')](_0xa9d8('0x27'),_0x51a3bc);return Promise['resolve']()['then'](function(){if(Array['isArray'](_0x2414af)){return checkArrayOfIntervals(_0x2414af,_0x324b80);}else if(_0x2414af){return checkSingleInterval(_0x2414af,_0x324b80);}})[_0xa9d8('0xe')](function(_0x4245e1){var _0x21b38a=_0x51a964[_0xa9d8('0x19')](function(_0xb7e65,_0x208506){return _0xb7e65||iftime(_0x208506,_0x324b80);},![]);_0x1f115d=_0x4245e1||_0x21b38a;return _0x1f115d;})[_0xa9d8('0x12')](function(_0x7b788f){logger[_0xa9d8('0x13')](_0xa9d8('0x27'),_0x51a3bc,_0x7b788f);throw this[_0xa9d8('0x13')](0x1f4,_0x7b788f[_0xa9d8('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index dc90ca4..d8109d8 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0x0b0e[_0x1e399a];return _0x539897;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x8640b0,_0x40629e){var _0xc3b129=function(_0x5e1468){while(--_0x5e1468){_0x8640b0['push'](_0x8640b0['shift']());}};_0xc3b129(++_0x40629e);}(_0xadb5,0xad));var _0x5adb=function(_0x1d5671,_0x2a5885){_0x1d5671=_0x1d5671-0x0;var _0x123482=_0xadb5[_0x1d5671];return _0x123482;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index d287066..32e6ff2 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 _0x9583=['toString','base64','stringify','request','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','key','MOTGUI','summary','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST'];(function(_0x45c475,_0x2dd7d4){var _0x1cbb36=function(_0x176088){while(--_0x176088){_0x45c475['push'](_0x45c475['shift']());}};_0x1cbb36(++_0x2dd7d4);}(_0x9583,0xe5));var _0x3958=function(_0x250904,_0x217bb3){_0x250904=_0x250904-0x0;var _0x3df27c=_0x9583[_0x250904];return _0x3df27c;};'use strict';var BPromise=require(_0x3958('0x0'));var https=require('https');var logger=require(_0x3958('0x1'))(_0x3958('0x2'));var USERNAME=_0x3958('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x527e36,_0x4981d7){var _0x2485f7={'fields':{'project':{'key':_0x527e36[_0x3958('0x4')]||_0x3958('0x5')},'summary':(_0x527e36[_0x3958('0x6')]||'Report')+_0x3958('0x7')+_0x527e36['ip'],'description':_0x527e36['description']||JSON['stringify'](_0x527e36),'issuetype':{'name':_0x527e36[_0x3958('0x8')]||_0x3958('0x9')}}};_0x2485f7[_0x3958('0xa')][_0x3958('0xb')]=_0x527e36[_0x3958('0xc')];_0x2485f7[_0x3958('0xa')][_0x3958('0xd')]=_0x527e36[_0x3958('0xe')];_0x2485f7[_0x3958('0xa')][_0x3958('0xf')]=_0x527e36['newToken'];_0x2485f7[_0x3958('0xa')][_0x3958('0x10')]=_0x527e36[_0x3958('0x11')];_0x2485f7['fields'][_0x3958('0x12')]=_0x527e36[_0x3958('0x13')];_0x2485f7['fields'][_0x3958('0x14')]=_0x527e36['ip'];var _0x2a51e4={'host':_0x3958('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x3958('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x3958('0x17')](_0x3958('0x18'))}};var _0x53bb93=JSON[_0x3958('0x19')](_0x2485f7);var _0x412550=https[_0x3958('0x1a')](_0x2a51e4,function(_0x3e952a){_0x3e952a['setEncoding']('utf8');var _0x185b31='';_0x3e952a['on']('data',function(_0x1a6e34){_0x185b31+=_0x1a6e34;});_0x3e952a['on'](_0x3958('0x1b'),function(){if(_0x4981d7){return _0x4981d7[_0x3958('0x1c')](_0x3e952a['statusCode'])[_0x3958('0x1d')](JSON[_0x3958('0x1e')](_0x185b31));}});});_0x412550['on'](_0x3958('0x1f'),function(_0x26637f){if(_0x4981d7){return _0x4981d7[_0x3958('0x1c')](0x1f4)['json']({'errors':[{'message':_0x3958('0x20'),'type':'api.jira'}]});}});_0x412550[_0x3958('0x21')](_0x53bb93);_0x412550[_0x3958('0x1b')]();}exports[_0x3958('0x22')]=openIssue;exports[_0x3958('0x23')]=function(_0x334465,_0x65308f){_0x334465[_0x3958('0x24')]['ip']=_0x334465[_0x3958('0x25')][_0x3958('0x26')]||_0x334465[_0x3958('0x27')][_0x3958('0x28')]||_0x334465[_0x3958('0x29')]['remoteAddress']||_0x334465[_0x3958('0x27')][_0x3958('0x29')][_0x3958('0x28')];return openIssue(_0x334465[_0x3958('0x24')],_0x65308f);}; \ No newline at end of file +var _0xe032=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','headers','remoteAddress','socket','connection','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','summary','Report','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','base64','request','utf8','end','status','statusCode','json'];(function(_0x32822f,_0x59940e){var _0x3d2f24=function(_0x172bb0){while(--_0x172bb0){_0x32822f['push'](_0x32822f['shift']());}};_0x3d2f24(++_0x59940e);}(_0xe032,0x1cc));var _0x2e03=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xe032[_0x333767];return _0x51661b;};'use strict';var BPromise=require('bluebird');var https=require(_0x2e03('0x0'));var logger=require(_0x2e03('0x1'))(_0x2e03('0x2'));var USERNAME=_0x2e03('0x3');var PASSWORD=_0x2e03('0x4');function openIssue(_0x2cb55c,_0x13e8b4){var _0x4344a2={'fields':{'project':{'key':_0x2cb55c['key']||_0x2e03('0x5')},'summary':(_0x2cb55c[_0x2e03('0x6')]||_0x2e03('0x7'))+'\x20from\x20'+_0x2cb55c['ip'],'description':_0x2cb55c[_0x2e03('0x8')]||JSON[_0x2e03('0x9')](_0x2cb55c),'issuetype':{'name':_0x2cb55c[_0x2e03('0xa')]||_0x2e03('0xb')}}};_0x4344a2[_0x2e03('0xc')][_0x2e03('0xd')]=_0x2cb55c[_0x2e03('0xe')];_0x4344a2[_0x2e03('0xc')][_0x2e03('0xf')]=_0x2cb55c[_0x2e03('0x10')];_0x4344a2[_0x2e03('0xc')][_0x2e03('0x11')]=_0x2cb55c['newToken'];_0x4344a2[_0x2e03('0xc')]['customfield_11503']=_0x2cb55c[_0x2e03('0x12')];_0x4344a2[_0x2e03('0xc')]['customfield_11504']=_0x2cb55c[_0x2e03('0x13')];_0x4344a2[_0x2e03('0xc')][_0x2e03('0x14')]=_0x2cb55c['ip'];var _0x142ce4={'host':_0x2e03('0x15'),'port':0x1bb,'path':_0x2e03('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x2e03('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x2e03('0x18')](_0x2e03('0x19'))}};var _0x341123=JSON['stringify'](_0x4344a2);var _0x430a64=https[_0x2e03('0x1a')](_0x142ce4,function(_0x142f4d){_0x142f4d['setEncoding'](_0x2e03('0x1b'));var _0x1e2cb2='';_0x142f4d['on']('data',function(_0xd92133){_0x1e2cb2+=_0xd92133;});_0x142f4d['on'](_0x2e03('0x1c'),function(){if(_0x13e8b4){return _0x13e8b4[_0x2e03('0x1d')](_0x142f4d[_0x2e03('0x1e')])[_0x2e03('0x1f')](JSON['parse'](_0x1e2cb2));}});});_0x430a64['on']('error',function(_0x5c9920){if(_0x13e8b4){return _0x13e8b4[_0x2e03('0x1d')](0x1f4)[_0x2e03('0x1f')]({'errors':[{'message':_0x2e03('0x20'),'type':_0x2e03('0x21')}]});}});_0x430a64['write'](_0x341123);_0x430a64[_0x2e03('0x1c')]();}exports[_0x2e03('0x22')]=openIssue;exports[_0x2e03('0x23')]=function(_0x47e07e,_0x1989fd){_0x47e07e[_0x2e03('0x24')]['ip']=_0x47e07e[_0x2e03('0x25')]['x-forwarded-for']||_0x47e07e['connection'][_0x2e03('0x26')]||_0x47e07e[_0x2e03('0x27')][_0x2e03('0x26')]||_0x47e07e[_0x2e03('0x28')][_0x2e03('0x27')]['remoteAddress'];return openIssue(_0x47e07e[_0x2e03('0x24')],_0x1989fd);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 7dbb853..20efacc 100644 --- a/server/api/jscriptyAnswerReport/index.js +++ b/server/api/jscriptyAnswerReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x28dc47,_0x5b49fb){var _0x41f308=function(_0x165d3e){while(--_0x165d3e){_0x28dc47['push'](_0x28dc47['shift']());}};_0x41f308(++_0x5b49fb);}(_0xa74f,0x9a));var _0xfa74=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0xa74f[_0x65c0bb];return _0x320bd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router; \ No newline at end of file +var _0xa75b=['isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x420b2b,_0x54e29a){var _0x14b48f=function(_0x10c51f){while(--_0x10c51f){_0x420b2b['push'](_0x420b2b['shift']());}};_0x14b48f(++_0x54e29a);}(_0xa75b,0x170));var _0xba75=function(_0x1557b0,_0xb1f068){_0x1557b0=_0x1557b0-0x0;var _0x27c2ea=_0xa75b[_0x1557b0];return _0x27c2ea;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['post']('/',auth[_0xba75('0xa')](),controller[_0xba75('0xe')]);router[_0xba75('0xf')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x11')]);router[_0xba75('0x12')](_0xba75('0x10'),auth[_0xba75('0xa')](),controller[_0xba75('0x13')]);module[_0xba75('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 96b8a98..ed0033c 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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x2f29b4,_0x25f3ba){_0x2f29b4=_0x2f29b4-0x0;var _0x6fd5b3=_0x7a54[_0x2f29b4];return _0x6fd5b3;};'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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0xa5b48e,_0x4f0f23){_0xa5b48e=_0xa5b48e-0x0;var _0x5a83a9=_0x7a54[_0xa5b48e];return _0x5a83a9;};'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 98817f6..b9e16e2 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 _0x0f89=['sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','where','merge','filter','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x18ad90,_0x49cfc7){var _0xe6cad1=function(_0x323f26){while(--_0x323f26){_0x18ad90['push'](_0x18ad90['shift']());}};_0xe6cad1(++_0x49cfc7);}(_0x0f89,0x111));var _0x90f8=function(_0x463a63,_0x58b4e0){_0x463a63=_0x463a63-0x0;var _0x4fa922=_0x0f89[_0x463a63];return _0x4fa922;};'use strict';var emlformat=require(_0x90f8('0x0'));var rimraf=require(_0x90f8('0x1'));var zipdir=require(_0x90f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f8('0x3'));var moment=require(_0x90f8('0x4'));var BPromise=require(_0x90f8('0x5'));var Mustache=require(_0x90f8('0x6'));var util=require('util');var path=require(_0x90f8('0x7'));var sox=require(_0x90f8('0x8'));var csv=require('to-csv');var ejs=require(_0x90f8('0x9'));var fs=require('fs');var fs_extra=require(_0x90f8('0xa'));var _=require(_0x90f8('0xb'));var squel=require(_0x90f8('0xc'));var crypto=require(_0x90f8('0xd'));var jsforce=require(_0x90f8('0xe'));var deskjs=require(_0x90f8('0xf'));var toCsv=require(_0x90f8('0x10'));var querystring=require(_0x90f8('0x11'));var Papa=require(_0x90f8('0x12'));var Redis=require(_0x90f8('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x90f8('0x14'));var hardwareService=require(_0x90f8('0x15'));var logger=require(_0x90f8('0x16'))(_0x90f8('0x17'));var utils=require(_0x90f8('0x18'));var config=require(_0x90f8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x90f8('0x1a'))['db'];function respondWithStatusCode(_0x4a1c3d,_0x4b31e6){_0x4b31e6=_0x4b31e6||0xcc;return function(_0x329f26){if(_0x329f26){return _0x4a1c3d[_0x90f8('0x1b')](_0x4b31e6);}return _0x4a1c3d['status'](_0x4b31e6)[_0x90f8('0x1c')]();};}function respondWithResult(_0x4e230b,_0x270a7d){_0x270a7d=_0x270a7d||0xc8;return function(_0x3f357f){if(_0x3f357f){return _0x4e230b[_0x90f8('0x1d')](_0x270a7d)[_0x90f8('0x1e')](_0x3f357f);}};}function respondWithFilteredResult(_0x4a36f9,_0x7bdc62){return function(_0x2767b3){if(_0x2767b3){var _0xec9212=typeof _0x7bdc62[_0x90f8('0x1f')]==='undefined'&&typeof _0x7bdc62[_0x90f8('0x20')]===_0x90f8('0x21');var _0x5615d2=_0x2767b3[_0x90f8('0x22')];var _0x31cc49=_0xec9212?0x0:_0x7bdc62[_0x90f8('0x1f')];var _0xae253e=_0xec9212?_0x2767b3[_0x90f8('0x22')]:_0x7bdc62[_0x90f8('0x1f')]+_0x7bdc62[_0x90f8('0x20')];var _0x1c3e04;if(_0xae253e>=_0x5615d2){_0xae253e=_0x5615d2;_0x1c3e04=0xc8;}else{_0x1c3e04=0xce;}_0x4a36f9[_0x90f8('0x1d')](_0x1c3e04);return _0x4a36f9[_0x90f8('0x23')](_0x90f8('0x24'),_0x31cc49+'-'+_0xae253e+'/'+_0x5615d2)[_0x90f8('0x1e')](_0x2767b3);}return null;};}function patchUpdates(_0x2994f9){return function(_0x4e9104){try{jsonpatch['apply'](_0x4e9104,_0x2994f9,!![]);}catch(_0xb207f5){return BPromise[_0x90f8('0x25')](_0xb207f5);}return _0x4e9104[_0x90f8('0x26')]();};}function saveUpdates(_0x1892f0,_0x26b420){return function(_0x17dfe7){if(_0x17dfe7){return _0x17dfe7[_0x90f8('0x27')](_0x1892f0)[_0x90f8('0x28')](function(_0x487236){return _0x487236;});}return null;};}function removeEntity(_0xa07586,_0x2a78b8){return function(_0x30e5ed){if(_0x30e5ed){return _0x30e5ed[_0x90f8('0x29')]()['then'](function(){_0xa07586['status'](0xcc)[_0x90f8('0x1c')]();});}};}function handleEntityNotFound(_0x153d61,_0x48a21e){return function(_0x6115fc){if(!_0x6115fc){_0x153d61[_0x90f8('0x1b')](0x194);}return _0x6115fc;};}function handleError(_0x39c465,_0x5e1e07){_0x5e1e07=_0x5e1e07||0x1f4;return function(_0xf1606f){logger[_0x90f8('0x2a')](_0xf1606f[_0x90f8('0x2b')]);if(_0xf1606f[_0x90f8('0x2c')]){delete _0xf1606f[_0x90f8('0x2c')];}_0x39c465[_0x90f8('0x1d')](_0x5e1e07)[_0x90f8('0x2d')](_0xf1606f);};}exports[_0x90f8('0x2e')]=function(_0x3877e5,_0x507efa){var _0x277ead={},_0x5304e6={},_0x461bf6={'count':0x0,'rows':[]};var _0x4fb78c=_[_0x90f8('0x2f')](db[_0x90f8('0x30')][_0x90f8('0x31')],function(_0x340658){return{'name':_0x340658['fieldName'],'type':_0x340658[_0x90f8('0x32')][_0x90f8('0x33')]};});_0x5304e6[_0x90f8('0x34')]=_[_0x90f8('0x2f')](_0x4fb78c,_0x90f8('0x2c'));_0x5304e6[_0x90f8('0x35')]=_['keys'](_0x3877e5[_0x90f8('0x35')]);_0x5304e6[_0x90f8('0x36')]=_[_0x90f8('0x37')](_0x5304e6[_0x90f8('0x34')],_0x5304e6['query']);_0x277ead[_0x90f8('0x38')]=_[_0x90f8('0x37')](_0x5304e6[_0x90f8('0x34')],qs[_0x90f8('0x39')](_0x3877e5['query'][_0x90f8('0x39')]));_0x277ead['attributes']=_0x277ead[_0x90f8('0x38')][_0x90f8('0x3a')]?_0x277ead[_0x90f8('0x38')]:_0x5304e6[_0x90f8('0x34')];if(!_0x3877e5[_0x90f8('0x35')]['hasOwnProperty']('nolimit')){_0x277ead[_0x90f8('0x20')]=qs[_0x90f8('0x20')](_0x3877e5['query']['limit']);_0x277ead[_0x90f8('0x1f')]=qs[_0x90f8('0x1f')](_0x3877e5['query'][_0x90f8('0x1f')]);}_0x277ead['order']=qs['sort'](_0x3877e5[_0x90f8('0x35')]['sort']);_0x277ead[_0x90f8('0x3b')]=qs[_0x90f8('0x36')](_['pick'](_0x3877e5[_0x90f8('0x35')],_0x5304e6[_0x90f8('0x36')]),_0x4fb78c);if(_0x3877e5[_0x90f8('0x35')]['filter']){_0x277ead[_0x90f8('0x3b')]=_[_0x90f8('0x3c')](_0x277ead[_0x90f8('0x3b')],{'$or':_['map'](_0x4fb78c,function(_0x331263){if(_0x331263[_0x90f8('0x32')]!=='VIRTUAL'){var _0x241308={};_0x241308[_0x331263['name']]={'$like':'%'+_0x3877e5[_0x90f8('0x35')][_0x90f8('0x3d')]+'%'};return _0x241308;}})});}_0x277ead=_[_0x90f8('0x3c')]({},_0x277ead,_0x3877e5['options']);var _0x4ed477={'where':_0x277ead['where']};return db[_0x90f8('0x30')][_0x90f8('0x22')](_0x4ed477)[_0x90f8('0x28')](function(_0x3600ce){_0x461bf6[_0x90f8('0x22')]=_0x3600ce;if(_0x3877e5[_0x90f8('0x35')][_0x90f8('0x3e')]){_0x277ead[_0x90f8('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x90f8('0x40')](_0x277ead);})[_0x90f8('0x28')](function(_0x1b208c){_0x461bf6[_0x90f8('0x41')]=_0x1b208c;return _0x461bf6;})['then'](respondWithFilteredResult(_0x507efa,_0x277ead))['catch'](handleError(_0x507efa,null));};exports[_0x90f8('0x42')]=function(_0x3f556f,_0x464c34){var _0x1214f9={'raw':!![],'where':{'id':_0x3f556f[_0x90f8('0x43')]['id']}},_0x5f0a86={};_0x5f0a86[_0x90f8('0x34')]=_[_0x90f8('0x44')](db[_0x90f8('0x30')][_0x90f8('0x31')]);_0x5f0a86[_0x90f8('0x35')]=_['keys'](_0x3f556f['query']);_0x5f0a86[_0x90f8('0x36')]=_[_0x90f8('0x37')](_0x5f0a86['model'],_0x5f0a86['query']);_0x1214f9[_0x90f8('0x38')]=_[_0x90f8('0x37')](_0x5f0a86[_0x90f8('0x34')],qs[_0x90f8('0x39')](_0x3f556f[_0x90f8('0x35')][_0x90f8('0x39')]));_0x1214f9[_0x90f8('0x38')]=_0x1214f9[_0x90f8('0x38')][_0x90f8('0x3a')]?_0x1214f9[_0x90f8('0x38')]:_0x5f0a86['model'];if(_0x3f556f['query'][_0x90f8('0x3e')]){_0x1214f9['include']=[{'all':!![]}];}_0x1214f9=_[_0x90f8('0x3c')]({},_0x1214f9,_0x3f556f[_0x90f8('0x45')]);return db[_0x90f8('0x30')]['find'](_0x1214f9)[_0x90f8('0x28')](handleEntityNotFound(_0x464c34,null))['then'](respondWithResult(_0x464c34,null))[_0x90f8('0x46')](handleError(_0x464c34,null));};exports[_0x90f8('0x47')]=function(_0x10819d,_0x5a1bec){return db[_0x90f8('0x30')][_0x90f8('0x47')](_0x10819d[_0x90f8('0x48')],{})[_0x90f8('0x28')](respondWithResult(_0x5a1bec,0xc9))['catch'](handleError(_0x5a1bec,null));};exports[_0x90f8('0x27')]=function(_0x35c2b9,_0x461913){if(_0x35c2b9[_0x90f8('0x48')]['id']){delete _0x35c2b9['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x35c2b9['params']['id']}})[_0x90f8('0x28')](handleEntityNotFound(_0x461913,null))[_0x90f8('0x28')](saveUpdates(_0x35c2b9['body'],null))[_0x90f8('0x28')](respondWithResult(_0x461913,null))[_0x90f8('0x46')](handleError(_0x461913,null));};exports[_0x90f8('0x29')]=function(_0x3da03c,_0x1c915a){return db['JscriptyAnswerReport'][_0x90f8('0x49')]({'where':{'id':_0x3da03c['params']['id']}})[_0x90f8('0x28')](handleEntityNotFound(_0x1c915a,null))[_0x90f8('0x28')](removeEntity(_0x1c915a,null))['catch'](handleError(_0x1c915a,null));};exports[_0x90f8('0x4a')]=function(_0x17f635,_0x8751a8){return db[_0x90f8('0x30')][_0x90f8('0x4a')]()[_0x90f8('0x28')](respondWithResult(_0x8751a8,null))[_0x90f8('0x46')](handleError(_0x8751a8,null));}; \ No newline at end of file +var _0x44e8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x9522dd,_0x5595db){var _0x3ff377=function(_0x1faf4b){while(--_0x1faf4b){_0x9522dd['push'](_0x9522dd['shift']());}};_0x3ff377(++_0x5595db);}(_0x44e8,0xd7));var _0x844e=function(_0x401e8e,_0x56b07a){_0x401e8e=_0x401e8e-0x0;var _0x59c991=_0x44e8[_0x401e8e];return _0x59c991;};'use strict';var emlformat=require(_0x844e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x844e('0x1'));var rp=require(_0x844e('0x2'));var moment=require(_0x844e('0x3'));var BPromise=require(_0x844e('0x4'));var Mustache=require('mustache');var util=require(_0x844e('0x5'));var path=require(_0x844e('0x6'));var sox=require(_0x844e('0x7'));var csv=require(_0x844e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x844e('0x9'));var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0x8'));var querystring=require(_0x844e('0xe'));var Papa=require(_0x844e('0xf'));var Redis=require(_0x844e('0x10'));var authService=require(_0x844e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x12'));var hardwareService=require(_0x844e('0x13'));var logger=require(_0x844e('0x14'))(_0x844e('0x15'));var utils=require(_0x844e('0x16'));var config=require(_0x844e('0x17'));var licenseUtil=require(_0x844e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d3bea,_0x23df3f){_0x23df3f=_0x23df3f||0xcc;return function(_0x52ac76){if(_0x52ac76){return _0x8d3bea[_0x844e('0x19')](_0x23df3f);}return _0x8d3bea[_0x844e('0x1a')](_0x23df3f)['end']();};}function respondWithResult(_0x1f48e2,_0x6b542d){_0x6b542d=_0x6b542d||0xc8;return function(_0x1c1689){if(_0x1c1689){return _0x1f48e2['status'](_0x6b542d)[_0x844e('0x1b')](_0x1c1689);}};}function respondWithFilteredResult(_0x465e49,_0x380eb4){return function(_0x935134){if(_0x935134){var _0x2588a3=typeof _0x380eb4[_0x844e('0x1c')]===_0x844e('0x1d')&&typeof _0x380eb4[_0x844e('0x1e')]==='undefined';var _0x36286c=_0x935134['count'];var _0x3c307f=_0x2588a3?0x0:_0x380eb4['offset'];var _0x315c50=_0x2588a3?_0x935134['count']:_0x380eb4[_0x844e('0x1c')]+_0x380eb4[_0x844e('0x1e')];var _0x2d6ba8;if(_0x315c50>=_0x36286c){_0x315c50=_0x36286c;_0x2d6ba8=0xc8;}else{_0x2d6ba8=0xce;}_0x465e49[_0x844e('0x1a')](_0x2d6ba8);return _0x465e49[_0x844e('0x1f')](_0x844e('0x20'),_0x3c307f+'-'+_0x315c50+'/'+_0x36286c)[_0x844e('0x1b')](_0x935134);}return null;};}function patchUpdates(_0x243aeb){return function(_0x4ffb86){try{jsonpatch[_0x844e('0x21')](_0x4ffb86,_0x243aeb,!![]);}catch(_0x50aeec){return BPromise['reject'](_0x50aeec);}return _0x4ffb86[_0x844e('0x22')]();};}function saveUpdates(_0x345dcc,_0x439b26){return function(_0x286fdd){if(_0x286fdd){return _0x286fdd['update'](_0x345dcc)[_0x844e('0x23')](function(_0x3dde07){return _0x3dde07;});}return null;};}function removeEntity(_0x571498,_0x2520f8){return function(_0x13489b){if(_0x13489b){return _0x13489b[_0x844e('0x24')]()[_0x844e('0x23')](function(){_0x571498[_0x844e('0x1a')](0xcc)[_0x844e('0x25')]();});}};}function handleEntityNotFound(_0x498ae0,_0x399a81){return function(_0xadf0d8){if(!_0xadf0d8){_0x498ae0[_0x844e('0x19')](0x194);}return _0xadf0d8;};}function handleError(_0x263702,_0x2c915f){_0x2c915f=_0x2c915f||0x1f4;return function(_0x5d6856){logger[_0x844e('0x26')](_0x5d6856['stack']);if(_0x5d6856['name']){delete _0x5d6856[_0x844e('0x27')];}_0x263702[_0x844e('0x1a')](_0x2c915f)[_0x844e('0x28')](_0x5d6856);};}exports['index']=function(_0x489349,_0x2d4acd){var _0xc3ec93={},_0x54fd73={},_0x228cc1={'count':0x0,'rows':[]};var _0x81d4de=_[_0x844e('0x29')](db[_0x844e('0x2a')][_0x844e('0x2b')],function(_0x799cde){return{'name':_0x799cde[_0x844e('0x2c')],'type':_0x799cde[_0x844e('0x2d')][_0x844e('0x2e')]};});_0x54fd73[_0x844e('0x2f')]=_['map'](_0x81d4de,_0x844e('0x27'));_0x54fd73[_0x844e('0x30')]=_[_0x844e('0x31')](_0x489349[_0x844e('0x30')]);_0x54fd73[_0x844e('0x32')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],_0x54fd73['query']);_0xc3ec93[_0x844e('0x34')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],qs['fields'](_0x489349[_0x844e('0x30')][_0x844e('0x35')]));_0xc3ec93['attributes']=_0xc3ec93[_0x844e('0x34')][_0x844e('0x36')]?_0xc3ec93['attributes']:_0x54fd73[_0x844e('0x2f')];if(!_0x489349[_0x844e('0x30')][_0x844e('0x37')](_0x844e('0x38'))){_0xc3ec93[_0x844e('0x1e')]=qs[_0x844e('0x1e')](_0x489349[_0x844e('0x30')]['limit']);_0xc3ec93[_0x844e('0x1c')]=qs[_0x844e('0x1c')](_0x489349[_0x844e('0x30')][_0x844e('0x1c')]);}_0xc3ec93[_0x844e('0x39')]=qs[_0x844e('0x3a')](_0x489349[_0x844e('0x30')][_0x844e('0x3a')]);_0xc3ec93[_0x844e('0x3b')]=qs[_0x844e('0x32')](_[_0x844e('0x3c')](_0x489349['query'],_0x54fd73['filters']),_0x81d4de);if(_0x489349[_0x844e('0x30')][_0x844e('0x3d')]){_0xc3ec93[_0x844e('0x3b')]=_[_0x844e('0x3e')](_0xc3ec93[_0x844e('0x3b')],{'$or':_[_0x844e('0x29')](_0x81d4de,function(_0x6f902e){if(_0x6f902e[_0x844e('0x2d')]!==_0x844e('0x3f')){var _0x539077={};_0x539077[_0x6f902e[_0x844e('0x27')]]={'$like':'%'+_0x489349['query'][_0x844e('0x3d')]+'%'};return _0x539077;}})});}_0xc3ec93=_['merge']({},_0xc3ec93,_0x489349[_0x844e('0x40')]);var _0x5dc530={'where':_0xc3ec93[_0x844e('0x3b')]};return db[_0x844e('0x2a')][_0x844e('0x41')](_0x5dc530)[_0x844e('0x23')](function(_0x2eb412){_0x228cc1[_0x844e('0x41')]=_0x2eb412;if(_0x489349[_0x844e('0x30')][_0x844e('0x42')]){_0xc3ec93[_0x844e('0x43')]=[{'all':!![]}];}return db[_0x844e('0x2a')][_0x844e('0x44')](_0xc3ec93);})['then'](function(_0x3ecb60){_0x228cc1[_0x844e('0x45')]=_0x3ecb60;return _0x228cc1;})[_0x844e('0x23')](respondWithFilteredResult(_0x2d4acd,_0xc3ec93))['catch'](handleError(_0x2d4acd,null));};exports['show']=function(_0x213a9f,_0x3e24ca){var _0x1a7817={'raw':!![],'where':{'id':_0x213a9f['params']['id']}},_0x5d8cd9={};_0x5d8cd9['model']=_['keys'](db[_0x844e('0x2a')][_0x844e('0x2b')]);_0x5d8cd9[_0x844e('0x30')]=_[_0x844e('0x31')](_0x213a9f[_0x844e('0x30')]);_0x5d8cd9['filters']=_[_0x844e('0x33')](_0x5d8cd9['model'],_0x5d8cd9['query']);_0x1a7817[_0x844e('0x34')]=_[_0x844e('0x33')](_0x5d8cd9[_0x844e('0x2f')],qs[_0x844e('0x35')](_0x213a9f['query'][_0x844e('0x35')]));_0x1a7817[_0x844e('0x34')]=_0x1a7817[_0x844e('0x34')]['length']?_0x1a7817[_0x844e('0x34')]:_0x5d8cd9[_0x844e('0x2f')];if(_0x213a9f['query'][_0x844e('0x42')]){_0x1a7817[_0x844e('0x43')]=[{'all':!![]}];}_0x1a7817=_[_0x844e('0x3e')]({},_0x1a7817,_0x213a9f[_0x844e('0x40')]);return db[_0x844e('0x2a')][_0x844e('0x46')](_0x1a7817)['then'](handleEntityNotFound(_0x3e24ca,null))[_0x844e('0x23')](respondWithResult(_0x3e24ca,null))[_0x844e('0x47')](handleError(_0x3e24ca,null));};exports[_0x844e('0x48')]=function(_0x29dd8b,_0x1dcfcb){return db[_0x844e('0x2a')][_0x844e('0x48')](_0x29dd8b[_0x844e('0x49')],{})[_0x844e('0x23')](respondWithResult(_0x1dcfcb,0xc9))[_0x844e('0x47')](handleError(_0x1dcfcb,null));};exports['update']=function(_0x32e097,_0x694791){if(_0x32e097[_0x844e('0x49')]['id']){delete _0x32e097['body']['id'];}return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x32e097[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x694791,null))[_0x844e('0x23')](saveUpdates(_0x32e097[_0x844e('0x49')],null))[_0x844e('0x23')](respondWithResult(_0x694791,null))['catch'](handleError(_0x694791,null));};exports[_0x844e('0x24')]=function(_0x3c680c,_0x43e1f5){return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x3c680c[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x43e1f5,null))[_0x844e('0x23')](removeEntity(_0x43e1f5,null))[_0x844e('0x47')](handleError(_0x43e1f5,null));};exports[_0x844e('0x4b')]=function(_0x3af2fe,_0x1dda1d){return db[_0x844e('0x2a')]['describe']()[_0x844e('0x23')](respondWithResult(_0x1dda1d,null))[_0x844e('0x47')](handleError(_0x1dda1d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index f529020..292baff 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 _0x7b88=['path','rimraf','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe9bfbc,_0x488cd1){var _0x237482=function(_0x1303ef){while(--_0x1303ef){_0xe9bfbc['push'](_0xe9bfbc['shift']());}};_0x237482(++_0x488cd1);}(_0x7b88,0xf0));var _0x87b8=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x7b88[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0x87b8('0x0'));var util=require(_0x87b8('0x1'));var logger=require(_0x87b8('0x2'))(_0x87b8('0x3'));var moment=require(_0x87b8('0x4'));var BPromise=require(_0x87b8('0x5'));var rp=require(_0x87b8('0x6'));var fs=require('fs');var path=require(_0x87b8('0x7'));var rimraf=require(_0x87b8('0x8'));var config=require('../../config/environment');var attributes=require(_0x87b8('0x9'));module[_0x87b8('0xa')]=function(_0x33af15,_0x238ae8){return _0x33af15[_0x87b8('0xb')]('JscriptyAnswerReport',attributes,{'tableName':_0x87b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f63=['report_jscripty_answers','util','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','define'];(function(_0x385ec5,_0x3d678e){var _0x65683e=function(_0x27d9cf){while(--_0x27d9cf){_0x385ec5['push'](_0x385ec5['shift']());}};_0x65683e(++_0x3d678e);}(_0x7f63,0x155));var _0x37f6=function(_0x13d017,_0x13c192){_0x13d017=_0x13d017-0x0;var _0x432db4=_0x7f63[_0x13d017];return _0x432db4;};'use strict';var _=require('lodash');var util=require(_0x37f6('0x0'));var logger=require('../../config/logger')(_0x37f6('0x1'));var moment=require(_0x37f6('0x2'));var BPromise=require(_0x37f6('0x3'));var rp=require(_0x37f6('0x4'));var fs=require('fs');var path=require(_0x37f6('0x5'));var rimraf=require(_0x37f6('0x6'));var config=require('../../config/environment');var attributes=require(_0x37f6('0x7'));module['exports']=function(_0x2238b8,_0x39596a){return _0x2238b8[_0x37f6('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x37f6('0x9'),'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 078cbd6..5015567 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 _0x7413=['stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s'];(function(_0x5713d5,_0x4bd736){var _0x52e536=function(_0x25fdda){while(--_0x25fdda){_0x5713d5['push'](_0x5713d5['shift']());}};_0x52e536(++_0x4bd736);}(_0x7413,0x8d));var _0x3741=function(_0x122e08,_0x5718c8){_0x122e08=_0x122e08-0x0;var _0x73121b=_0x7413[_0x122e08];return _0x73121b;};'use strict';var _=require(_0x3741('0x0'));var util=require(_0x3741('0x1'));var moment=require('moment');var BPromise=require(_0x3741('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3741('0x3'));var db=require(_0x3741('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3741('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3741('0x6'));var client=jayson['client'][_0x3741('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44b8e4,_0x4f3366,_0x4256dc){return new BPromise(function(_0x2e5952,_0x28a0d6){return client['request'](_0x44b8e4,_0x4256dc)['then'](function(_0x164129){logger[_0x3741('0x8')](_0x3741('0x9'),_0x4f3366,_0x3741('0xa'));logger['debug'](_0x3741('0xb'),_0x4f3366,_0x3741('0xa'),JSON[_0x3741('0xc')](_0x164129));if(_0x164129[_0x3741('0xd')]){if(_0x164129[_0x3741('0xd')][_0x3741('0xe')]===0x1f4){logger['error'](_0x3741('0x9'),_0x4f3366,_0x164129[_0x3741('0xd')]['message']);return _0x28a0d6(_0x164129[_0x3741('0xd')][_0x3741('0xf')]);}logger[_0x3741('0xd')](_0x3741('0x9'),_0x4f3366,_0x164129['error'][_0x3741('0xf')]);return _0x2e5952(_0x164129[_0x3741('0xd')]['message']);}else{logger[_0x3741('0x8')](_0x3741('0x9'),_0x4f3366,_0x3741('0xa'));_0x2e5952(_0x164129['result'][_0x3741('0xf')]);}})[_0x3741('0x10')](function(_0x3ab43f){logger[_0x3741('0xd')](_0x3741('0x9'),_0x4f3366,_0x3ab43f);_0x28a0d6(_0x3ab43f);});});} \ No newline at end of file +var _0xcd3a=['result','catch','lodash','util','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0xcd3a,0x66));var _0xacd3=function(_0xe2d38,_0x40a174){_0xe2d38=_0xe2d38-0x0;var _0x8f0317=_0xcd3a[_0xe2d38];return _0x8f0317;};'use strict';var _=require(_0xacd3('0x0'));var util=require(_0xacd3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacd3('0x2'));var fs=require('fs');var Redis=require(_0xacd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacd3('0x4'))('rpc');var config=require(_0xacd3('0x5'));var jayson=require(_0xacd3('0x6'));var client=jayson[_0xacd3('0x7')][_0xacd3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x202661,_0x19d247,_0x320870){return new BPromise(function(_0x16c29d,_0x3ca3ee){return client['request'](_0x202661,_0x320870)[_0xacd3('0x9')](function(_0x50f2d6){logger[_0xacd3('0xa')](_0xacd3('0xb'),_0x19d247,_0xacd3('0xc'));logger[_0xacd3('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x19d247,'request\x20sent',JSON[_0xacd3('0xe')](_0x50f2d6));if(_0x50f2d6[_0xacd3('0xf')]){if(_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x10')]===0x1f4){logger[_0xacd3('0xf')](_0xacd3('0xb'),_0x19d247,_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x11')]);return _0x3ca3ee(_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x11')]);}logger[_0xacd3('0xf')](_0xacd3('0xb'),_0x19d247,_0x50f2d6[_0xacd3('0xf')][_0xacd3('0x11')]);return _0x16c29d(_0x50f2d6[_0xacd3('0xf')]['message']);}else{logger[_0xacd3('0xa')](_0xacd3('0xb'),_0x19d247,'request\x20sent');_0x16c29d(_0x50f2d6[_0xacd3('0x12')][_0xacd3('0x11')]);}})[_0xacd3('0x13')](function(_0x325962){logger['error'](_0xacd3('0xb'),_0x19d247,_0x325962);_0x3ca3ee(_0x325962);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 3b324d2..d6de10e 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 _0xbabe=['/:id/summary','30s','getSummary','post','create','/:id/clone','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers'];(function(_0x497fc7,_0x121e13){var _0x50d48=function(_0x1b64ac){while(--_0x1b64ac){_0x497fc7['push'](_0x497fc7['shift']());}};_0x50d48(++_0x121e13);}(_0xbabe,0x77));var _0xebab=function(_0x4732c6,_0x1c4cc7){_0x4732c6=_0x4732c6-0x0;var _0x4a1b5f=_0xbabe[_0x4732c6];return _0x4a1b5f;};'use strict';var multer=require('multer');var util=require(_0xebab('0x0'));var path=require(_0xebab('0x1'));var timeout=require(_0xebab('0x2'));var express=require('express');var router=express[_0xebab('0x3')]();var fs_extra=require(_0xebab('0x4'));var auth=require(_0xebab('0x5'));var interaction=require(_0xebab('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0xebab('0x7')]('/',auth['isAuthenticated'](),controller[_0xebab('0x8')]);router['get'](_0xebab('0x9'),auth[_0xebab('0xa')](),controller[_0xebab('0xb')]);router[_0xebab('0x7')](_0xebab('0xc'),auth[_0xebab('0xa')](),controller[_0xebab('0xd')]);router['get'](_0xebab('0xe'),auth['isAuthenticated'](),controller[_0xebab('0xf')]);router['get'](_0xebab('0x10'),auth[_0xebab('0xa')](),timeout(_0xebab('0x11')),controller[_0xebab('0x12')]);router[_0xebab('0x13')]('/',auth[_0xebab('0xa')](),controller[_0xebab('0x14')]);router['post'](_0xebab('0x15'),auth[_0xebab('0xa')](),controller['clone']);router[_0xebab('0x16')]('/:id',auth[_0xebab('0xa')](),controller[_0xebab('0x17')]);router[_0xebab('0x18')](_0xebab('0x9'),auth[_0xebab('0xa')](),controller[_0xebab('0x19')]);module[_0xebab('0x1a')]=router; \ No newline at end of file +var _0x6d78=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','post','create','clone'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x6d78,0x1df));var _0x86d7=function(_0x5d2bd6,_0x377005){_0x5d2bd6=_0x5d2bd6-0x0;var _0x796b32=_0x6d78[_0x5d2bd6];return _0x796b32;};'use strict';var multer=require('multer');var util=require(_0x86d7('0x0'));var path=require(_0x86d7('0x1'));var timeout=require(_0x86d7('0x2'));var express=require(_0x86d7('0x3'));var router=express[_0x86d7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86d7('0x5'));var config=require(_0x86d7('0x6'));var controller=require(_0x86d7('0x7'));router[_0x86d7('0x8')]('/',auth[_0x86d7('0x9')](),controller[_0x86d7('0xa')]);router['get'](_0x86d7('0xb'),auth[_0x86d7('0x9')](),controller[_0x86d7('0xc')]);router[_0x86d7('0x8')](_0x86d7('0xd'),auth['isAuthenticated'](),controller[_0x86d7('0xe')]);router[_0x86d7('0x8')](_0x86d7('0xf'),auth[_0x86d7('0x9')](),controller[_0x86d7('0x10')]);router['get'](_0x86d7('0x11'),auth['isAuthenticated'](),timeout('30s'),controller['getSummary']);router[_0x86d7('0x12')]('/',auth[_0x86d7('0x9')](),controller[_0x86d7('0x13')]);router[_0x86d7('0x12')]('/:id/clone',auth[_0x86d7('0x9')](),controller[_0x86d7('0x14')]);router[_0x86d7('0x15')](_0x86d7('0xb'),auth[_0x86d7('0x9')](),controller[_0x86d7('0x16')]);router[_0x86d7('0x17')](_0x86d7('0xb'),auth[_0x86d7('0x9')](),controller['destroy']);module[_0x86d7('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index eb51eda..bfde597 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 _0xab01=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData'];(function(_0x19c483,_0x3b63fc){var _0x47ae32=function(_0x5fd5a0){while(--_0x5fd5a0){_0x19c483['push'](_0x19c483['shift']());}};_0x47ae32(++_0x3b63fc);}(_0xab01,0xb5));var _0x1ab0=function(_0x48401f,_0x2457e2){_0x48401f=_0x48401f-0x0;var _0x5dc63f=_0xab01[_0x48401f];return _0x5dc63f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x1ab0('0x0'));var util=require(_0x1ab0('0x1'));module['exports']={'name':{'type':Sequelize[_0x1ab0('0x2')],'unique':_0x1ab0('0x3')},'description':{'type':Sequelize[_0x1ab0('0x2')]},'formData':{'type':Sequelize[_0x1ab0('0x4')](_0x1ab0('0x5')),'set':function(_0x73a382){if(_[_0x1ab0('0x6')](_0x73a382)){this[_0x1ab0('0x7')]('formData',JSON[_0x1ab0('0x8')](_0x73a382));}else if(_[_0x1ab0('0x9')](_0x73a382)){this[_0x1ab0('0x7')](_0x1ab0('0xa'),_0x73a382);}else{this[_0x1ab0('0x7')]('formData',util[_0x1ab0('0xb')](_0x1ab0('0xc'),this['getDataValue']('name')||'',this[_0x1ab0('0xd')](_0x1ab0('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x1ab0('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1ab0('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x00f2=['TEXT','isObjectLike','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','util','exports','name','STRING'];(function(_0x1bae75,_0x228797){var _0x43be36=function(_0x5812fe){while(--_0x5812fe){_0x1bae75['push'](_0x1bae75['shift']());}};_0x43be36(++_0x228797);}(_0x00f2,0xfa));var _0x200f=function(_0x341539,_0x4d51a5){_0x341539=_0x341539-0x0;var _0xc4121d=_0x00f2[_0x341539];return _0xc4121d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x200f('0x0'));var util=require(_0x200f('0x1'));module[_0x200f('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x200f('0x3')},'description':{'type':Sequelize[_0x200f('0x4')]},'formData':{'type':Sequelize[_0x200f('0x5')]('long'),'set':function(_0x23765a){if(_[_0x200f('0x6')](_0x23765a)){this['setDataValue'](_0x200f('0x7'),JSON['stringify'](_0x23765a));}else if(_[_0x200f('0x8')](_0x23765a)){this[_0x200f('0x9')](_0x200f('0x7'),_0x23765a);}else{this['setDataValue'](_0x200f('0x7'),util[_0x200f('0xa')](_0x200f('0xb'),this[_0x200f('0xc')](_0x200f('0x3'))||'',this[_0x200f('0xc')](_0x200f('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x200f('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x200f('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index cab34c2..bae5869 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 _0x08ca=['fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Projects','getSessions','findOne','JscriptySessionReport','order','ProjectId','JscriptyAnswerReport','toString','indexOf','replace','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','model','query','keys','intersection','attributes'];(function(_0x2c93f8,_0x5433f2){var _0x353f02=function(_0x2b6a89){while(--_0x2b6a89){_0x2c93f8['push'](_0x2c93f8['shift']());}};_0x353f02(++_0x5433f2);}(_0x08ca,0xb2));var _0xa08c=function(_0x521d64,_0x31b585){_0x521d64=_0x521d64-0x0;var _0xc24be=_0x08ca[_0x521d64];return _0xc24be;};'use strict';var emlformat=require(_0xa08c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa08c('0x1'));var jsonpatch=require(_0xa08c('0x2'));var rp=require(_0xa08c('0x3'));var moment=require(_0xa08c('0x4'));var BPromise=require(_0xa08c('0x5'));var Mustache=require(_0xa08c('0x6'));var util=require(_0xa08c('0x7'));var path=require(_0xa08c('0x8'));var sox=require(_0xa08c('0x9'));var csv=require(_0xa08c('0xa'));var ejs=require(_0xa08c('0xb'));var fs=require('fs');var fs_extra=require(_0xa08c('0xc'));var _=require('lodash');var squel=require(_0xa08c('0xd'));var crypto=require(_0xa08c('0xe'));var jsforce=require(_0xa08c('0xf'));var deskjs=require(_0xa08c('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa08c('0x11'));var Papa=require('papaparse');var Redis=require(_0xa08c('0x12'));var authService=require(_0xa08c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa08c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa08c('0x15'));var utils=require(_0xa08c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa08c('0x17'));var db=require(_0xa08c('0x18'))['db'];function respondWithStatusCode(_0x441998,_0x4ed55f){_0x4ed55f=_0x4ed55f||0xcc;return function(_0x1fda54){if(_0x1fda54){return _0x441998[_0xa08c('0x19')](_0x4ed55f);}return _0x441998['status'](_0x4ed55f)[_0xa08c('0x1a')]();};}function respondWithResult(_0x2e5629,_0x15186a){_0x15186a=_0x15186a||0xc8;return function(_0x306435){if(_0x306435){return _0x2e5629[_0xa08c('0x1b')](_0x15186a)[_0xa08c('0x1c')](_0x306435);}};}function respondWithFilteredResult(_0xff73e7,_0x26e44e){return function(_0x1a2d32){if(_0x1a2d32){var _0x41d1f0=typeof _0x26e44e['offset']===_0xa08c('0x1d')&&typeof _0x26e44e[_0xa08c('0x1e')]===_0xa08c('0x1d');var _0x42c5ea=_0x1a2d32[_0xa08c('0x1f')];var _0x1b2097=_0x41d1f0?0x0:_0x26e44e[_0xa08c('0x20')];var _0x3ea4f3=_0x41d1f0?_0x1a2d32[_0xa08c('0x1f')]:_0x26e44e[_0xa08c('0x20')]+_0x26e44e[_0xa08c('0x1e')];var _0x294a75;if(_0x3ea4f3>=_0x42c5ea){_0x3ea4f3=_0x42c5ea;_0x294a75=0xc8;}else{_0x294a75=0xce;}_0xff73e7['status'](_0x294a75);return _0xff73e7[_0xa08c('0x21')]('Content-Range',_0x1b2097+'-'+_0x3ea4f3+'/'+_0x42c5ea)[_0xa08c('0x1c')](_0x1a2d32);}return null;};}function patchUpdates(_0x43236b){return function(_0x153b1a){try{jsonpatch[_0xa08c('0x22')](_0x153b1a,_0x43236b,!![]);}catch(_0x5dac00){return BPromise[_0xa08c('0x23')](_0x5dac00);}return _0x153b1a[_0xa08c('0x24')]();};}function saveUpdates(_0x500bd4,_0x456d45){return function(_0x22ed38){if(_0x22ed38){return _0x22ed38[_0xa08c('0x25')](_0x500bd4)['then'](function(_0x34fa7b){return _0x34fa7b;});}return null;};}function removeEntity(_0x5473b8,_0x561b0c){return function(_0x3c46fc){if(_0x3c46fc){return _0x3c46fc[_0xa08c('0x26')]()['then'](function(){var _0x381821=_0x3c46fc[_0xa08c('0x27')]({'plain':!![]});var _0x491cb0='Projects';return db[_0xa08c('0x28')][_0xa08c('0x26')]({'where':{'type':_0x491cb0,'resourceId':_0x381821['id']}})[_0xa08c('0x29')](function(){return _0x3c46fc;});})['then'](function(){_0x5473b8[_0xa08c('0x1b')](0xcc)[_0xa08c('0x1a')]();});}};}function handleEntityNotFound(_0x22dc7c,_0x415291){return function(_0x2dbd27){if(!_0x2dbd27){_0x22dc7c[_0xa08c('0x19')](0x194);}return _0x2dbd27;};}function handleError(_0x494823,_0x5bb673){_0x5bb673=_0x5bb673||0x1f4;return function(_0x22260e){logger['error'](_0x22260e[_0xa08c('0x2a')]);if(_0x22260e[_0xa08c('0x2b')]){delete _0x22260e[_0xa08c('0x2b')];}_0x494823[_0xa08c('0x1b')](_0x5bb673)[_0xa08c('0x2c')](_0x22260e);};}exports[_0xa08c('0x2d')]=function(_0x3e8d8d,_0x9eaddd){var _0x35d3bc={},_0x56c0ca={},_0x300430={'count':0x0,'rows':[]};var _0x4ea6fb=_[_0xa08c('0x2e')](db[_0xa08c('0x2f')][_0xa08c('0x30')],function(_0x5780de){return{'name':_0x5780de['fieldName'],'type':_0x5780de[_0xa08c('0x31')][_0xa08c('0x32')]};});_0x56c0ca[_0xa08c('0x33')]=_[_0xa08c('0x2e')](_0x4ea6fb,_0xa08c('0x2b'));_0x56c0ca[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3e8d8d[_0xa08c('0x34')]);_0x56c0ca['filters']=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],_0x56c0ca['query']);_0x35d3bc[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x56c0ca[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x3e8d8d[_0xa08c('0x34')]['fields']));_0x35d3bc[_0xa08c('0x37')]=_0x35d3bc[_0xa08c('0x37')][_0xa08c('0x39')]?_0x35d3bc[_0xa08c('0x37')]:_0x56c0ca[_0xa08c('0x33')];if(!_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x35d3bc[_0xa08c('0x1e')]=qs['limit'](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x35d3bc[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x35d3bc['order']=qs[_0xa08c('0x3c')](_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x35d3bc['where']=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x3e8d8d[_0xa08c('0x34')],_0x56c0ca[_0xa08c('0x3d')]),_0x4ea6fb);if(_0x3e8d8d['query'][_0xa08c('0x3f')]){_0x35d3bc['where']=_[_0xa08c('0x40')](_0x35d3bc[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4ea6fb,function(_0x58a43b){if(_0x58a43b[_0xa08c('0x31')]!==_0xa08c('0x42')){var _0x12e787={};_0x12e787[_0x58a43b[_0xa08c('0x2b')]]={'$like':'%'+_0x3e8d8d['query'][_0xa08c('0x3f')]+'%'};return _0x12e787;}})});}_0x35d3bc=_[_0xa08c('0x40')]({},_0x35d3bc,_0x3e8d8d[_0xa08c('0x43')]);var _0x19cf46={'where':_0x35d3bc['where']};return db[_0xa08c('0x2f')][_0xa08c('0x1f')](_0x19cf46)[_0xa08c('0x29')](function(_0x39b313){_0x300430[_0xa08c('0x1f')]=_0x39b313;if(_0x3e8d8d[_0xa08c('0x34')][_0xa08c('0x44')]){_0x35d3bc[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyProject'][_0xa08c('0x46')](_0x35d3bc);})['then'](function(_0x250cea){_0x300430[_0xa08c('0x47')]=_0x250cea;return _0x300430;})[_0xa08c('0x29')](respondWithFilteredResult(_0x9eaddd,_0x35d3bc))[_0xa08c('0x48')](handleError(_0x9eaddd,null));};exports['show']=function(_0x3b7e00,_0x37d10b){var _0x4ca408={'raw':![],'where':{'id':_0x3b7e00['params']['id']}},_0x5111d6={};_0x5111d6[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')][_0xa08c('0x30')]);_0x5111d6[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x3b7e00[_0xa08c('0x34')]);_0x5111d6['filters']=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],_0x5111d6[_0xa08c('0x34')]);_0x4ca408[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x5111d6[_0xa08c('0x33')],qs['fields'](_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x38')]));_0x4ca408[_0xa08c('0x37')]=_0x4ca408[_0xa08c('0x37')][_0xa08c('0x39')]?_0x4ca408[_0xa08c('0x37')]:_0x5111d6[_0xa08c('0x33')];if(_0x3b7e00[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4ca408[_0xa08c('0x45')]=[{'all':!![]}];}_0x4ca408=_[_0xa08c('0x40')]({},_0x4ca408,_0x3b7e00[_0xa08c('0x43')]);return db['JscriptyProject'][_0xa08c('0x49')](_0x4ca408)[_0xa08c('0x29')](handleEntityNotFound(_0x37d10b,null))[_0xa08c('0x29')](respondWithResult(_0x37d10b,null))['catch'](handleError(_0x37d10b,null));};exports[_0xa08c('0x4a')]=function(_0x186fce,_0x1c8234){return db['JscriptyProject'][_0xa08c('0x4a')](_0x186fce[_0xa08c('0x4b')],{})[_0xa08c('0x29')](function(_0x160b22){var _0x225e28=_0x186fce[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x225e28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x225e28[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0x303396=_0x160b22['get']({'plain':!![]});var _0x586885='Projects';return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x586885,'userProfileId':_0x225e28[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x39f70f){if(_0x39f70f&&_0x39f70f[_0xa08c('0x50')]===0x0){return db['UserProfileResource'][_0xa08c('0x4a')]({'name':_0x303396[_0xa08c('0x2b')],'resourceId':_0x303396['id'],'type':_0x39f70f['name'],'sectionId':_0x39f70f['id']},{})['then'](function(){return _0x160b22;});}else{return _0x160b22;}})[_0xa08c('0x48')](function(_0x4544d6){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x4544d6);throw _0x4544d6;});}return _0x160b22;})[_0xa08c('0x29')](respondWithResult(_0x1c8234,0xc9))[_0xa08c('0x48')](handleError(_0x1c8234,null));};exports[_0xa08c('0x53')]=function(_0x437e35,_0x1acc1e){var _0xde5fe8={'where':{'id':_0x437e35[_0xa08c('0x54')]['id']}},_0x59a387={};_0x59a387[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x2f')]['rawAttributes']);_0xde5fe8['attributes']=_[_0xa08c('0x36')](_0x59a387[_0xa08c('0x33')],qs[_0xa08c('0x38')](_0x437e35[_0xa08c('0x34')][_0xa08c('0x38')]));_0xde5fe8[_0xa08c('0x37')]=_0xde5fe8[_0xa08c('0x37')][_0xa08c('0x39')]?_0xde5fe8['attributes']:_0x59a387[_0xa08c('0x33')];if(_0x437e35[_0xa08c('0x34')][_0xa08c('0x44')]){_0xde5fe8[_0xa08c('0x45')]=[{'all':!![]}];}_0xde5fe8=_[_0xa08c('0x40')]({},_0xde5fe8,_0x437e35[_0xa08c('0x43')]);return db[_0xa08c('0x2f')][_0xa08c('0x49')](_0xde5fe8)[_0xa08c('0x29')](handleEntityNotFound(_0x1acc1e,null))[_0xa08c('0x29')](function(_0x1271a4){if(_0x1271a4){var _0x492ff1=_0x1271a4[_0xa08c('0x27')]({'plain':!![]});_0x492ff1=qs['omit'](_0x492ff1,['id',_0xa08c('0x55'),_0xa08c('0x56')]);_0x437e35[_0xa08c('0x4b')]=_[_0xa08c('0x57')](_0x437e35['body'],['id',_0xa08c('0x55'),'updatedAt']);return db['JscriptyProject'][_0xa08c('0x4a')](_['merge'](_0x492ff1,_0x437e35[_0xa08c('0x4b')]),{'include':_0x437e35[_0xa08c('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xa08c('0x29')](function(_0x544745){var _0x85a661=_0x437e35[_0xa08c('0x4c')][_0xa08c('0x27')]({'plain':!![]});if(!_0x85a661)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85a661[_0xa08c('0x4d')]===_0xa08c('0x4c')){var _0xed8059=_0x544745[_0xa08c('0x27')]({'plain':!![]});var _0x1029f7=_0xa08c('0x58');return db[_0xa08c('0x4e')][_0xa08c('0x49')]({'where':{'name':_0x1029f7,'userProfileId':_0x85a661[_0xa08c('0x4f')]},'raw':!![]})[_0xa08c('0x29')](function(_0x184506){if(_0x184506&&_0x184506['autoAssociation']===0x0){return db[_0xa08c('0x28')][_0xa08c('0x4a')]({'name':_0xed8059[_0xa08c('0x2b')],'resourceId':_0xed8059['id'],'type':_0x184506[_0xa08c('0x2b')],'sectionId':_0x184506['id']},{})[_0xa08c('0x29')](function(){return _0x544745;});}else{return _0x544745;}})['catch'](function(_0x49d5ef){logger[_0xa08c('0x51')](_0xa08c('0x52'),_0x49d5ef);throw _0x49d5ef;});}return _0x544745;});}})['then'](respondWithResult(_0x1acc1e,0xc9))['catch'](handleError(_0x1acc1e,null));};exports[_0xa08c('0x25')]=function(_0x25248d,_0x2f296a){if(_0x25248d[_0xa08c('0x4b')]['id']){delete _0x25248d[_0xa08c('0x4b')]['id'];}return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x25248d[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2f296a,null))[_0xa08c('0x29')](saveUpdates(_0x25248d[_0xa08c('0x4b')],null))[_0xa08c('0x29')](respondWithResult(_0x2f296a,null))[_0xa08c('0x48')](handleError(_0x2f296a,null));};exports['destroy']=function(_0x565b71,_0x3d9715){return db[_0xa08c('0x2f')][_0xa08c('0x49')]({'where':{'id':_0x565b71[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x3d9715,null))['then'](removeEntity(_0x3d9715,null))[_0xa08c('0x48')](handleError(_0x3d9715,null));};exports[_0xa08c('0x59')]=function(_0x98a2f0,_0x1207bb,_0x102c39){var _0x4c14a0={'raw':!![],'where':{}};var _0x358104={};var _0x42d715={'count':0x0,'rows':[]};return db[_0xa08c('0x2f')][_0xa08c('0x5a')]({'where':{'id':_0x98a2f0[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x1207bb,null))['then'](function(_0x18473f){if(_0x18473f){_0x358104[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5b')][_0xa08c('0x30')]);_0x358104[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x98a2f0[_0xa08c('0x34')]);_0x358104[_0xa08c('0x3d')]=_['intersection'](_0x358104[_0xa08c('0x33')],_0x358104[_0xa08c('0x34')]);_0x4c14a0[_0xa08c('0x37')]=_['intersection'](_0x358104['model'],qs[_0xa08c('0x38')](_0x98a2f0['query'][_0xa08c('0x38')]));_0x4c14a0[_0xa08c('0x37')]=_0x4c14a0['attributes'][_0xa08c('0x39')]?_0x4c14a0[_0xa08c('0x37')]:_0x358104[_0xa08c('0x33')];if(!_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x4c14a0[_0xa08c('0x1e')]=qs[_0xa08c('0x1e')](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x1e')]);_0x4c14a0[_0xa08c('0x20')]=qs['offset'](_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x4c14a0[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x98a2f0[_0xa08c('0x34')]['sort']);_0x4c14a0[_0xa08c('0x41')]=qs[_0xa08c('0x3d')](_[_0xa08c('0x3e')](_0x98a2f0[_0xa08c('0x34')],_0x358104[_0xa08c('0x3d')]));_0x4c14a0[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x18473f['id'];if(_0x98a2f0['query'][_0xa08c('0x3f')]){_0x4c14a0[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x4c14a0[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x4c14a0['attributes'],function(_0x3d14d8){var _0x2e563a={};_0x2e563a[_0x3d14d8]={'$like':'%'+_0x98a2f0['query'][_0xa08c('0x3f')]+'%'};return _0x2e563a;})});}_0x4c14a0=_[_0xa08c('0x40')]({},_0x4c14a0,_0x98a2f0[_0xa08c('0x43')]);return db[_0xa08c('0x5b')][_0xa08c('0x1f')]({'where':_0x4c14a0[_0xa08c('0x41')]})['then'](function(_0x48009a){_0x42d715[_0xa08c('0x1f')]=_0x48009a;if(_0x98a2f0[_0xa08c('0x34')][_0xa08c('0x44')]){_0x4c14a0[_0xa08c('0x45')]=[{'all':!![]}];}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x4c14a0);})[_0xa08c('0x29')](function(_0x4b6116){_0x42d715[_0xa08c('0x47')]=_0x4b6116;return _0x42d715;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x1207bb,_0x4c14a0))['catch'](handleError(_0x1207bb,null));};exports['getAnswers']=function(_0x2949de,_0x2dd1fa,_0x128ba1){var _0x1e5491={'raw':!![],'where':{}};var _0x107c27={};var _0x23ec21={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2949de[_0xa08c('0x54')]['id']}})[_0xa08c('0x29')](handleEntityNotFound(_0x2dd1fa,null))[_0xa08c('0x29')](function(_0x4fbffa){if(_0x4fbffa){_0x107c27[_0xa08c('0x33')]=_[_0xa08c('0x35')](db[_0xa08c('0x5e')][_0xa08c('0x30')]);_0x107c27[_0xa08c('0x34')]=_[_0xa08c('0x35')](_0x2949de[_0xa08c('0x34')]);_0x107c27[_0xa08c('0x3d')]=_[_0xa08c('0x36')](_0x107c27[_0xa08c('0x33')],_0x107c27['query']);_0x1e5491[_0xa08c('0x37')]=_[_0xa08c('0x36')](_0x107c27['model'],qs[_0xa08c('0x38')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x38')]));_0x1e5491[_0xa08c('0x37')]=_0x1e5491[_0xa08c('0x37')][_0xa08c('0x39')]?_0x1e5491[_0xa08c('0x37')]:_0x107c27[_0xa08c('0x33')];if(!_0x2949de[_0xa08c('0x34')][_0xa08c('0x3a')](_0xa08c('0x3b'))){_0x1e5491['limit']=qs['limit'](_0x2949de[_0xa08c('0x34')]['limit']);_0x1e5491[_0xa08c('0x20')]=qs[_0xa08c('0x20')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x20')]);}_0x1e5491[_0xa08c('0x5c')]=qs[_0xa08c('0x3c')](_0x2949de[_0xa08c('0x34')][_0xa08c('0x3c')]);_0x1e5491[_0xa08c('0x41')]=qs['filters'](_[_0xa08c('0x3e')](_0x2949de[_0xa08c('0x34')],_0x107c27[_0xa08c('0x3d')]));_0x1e5491[_0xa08c('0x41')][_0xa08c('0x5d')]=_0x4fbffa['id'];if(_0x2949de[_0xa08c('0x34')][_0xa08c('0x3f')]){_0x1e5491[_0xa08c('0x41')]=_[_0xa08c('0x40')](_0x1e5491[_0xa08c('0x41')],{'$or':_[_0xa08c('0x2e')](_0x1e5491[_0xa08c('0x37')],function(_0x442ce7){var _0x13ab6a={};_0x13ab6a[_0x442ce7]={'$like':'%'+_0x2949de['query']['filter']+'%'};return _0x13ab6a;})});}_0x1e5491=_['merge']({},_0x1e5491,_0x2949de[_0xa08c('0x43')]);return db[_0xa08c('0x5e')]['count']({'where':_0x1e5491['where']})['then'](function(_0x3309f0){_0x23ec21[_0xa08c('0x1f')]=_0x3309f0;if(_0x2949de[_0xa08c('0x34')]['includeAll']){_0x1e5491[_0xa08c('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa08c('0x46')](_0x1e5491);})[_0xa08c('0x29')](function(_0x4a015f){_0x23ec21['rows']=_0x4a015f;return _0x23ec21;});}})[_0xa08c('0x29')](respondWithFilteredResult(_0x2dd1fa,_0x1e5491))[_0xa08c('0x48')](handleError(_0x2dd1fa,null));};function char(_0x252d4c){return'number'===typeof _0x252d4c?String['fromCharCode'][_0xa08c('0x22')](null,arguments):_0x252d4c;}function needsEncapsulation(_0x4a1f5c){return!!_0x4a1f5c&&(_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xd))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()[_0xa08c('0x60')](char(0xa))>=0x0||_0x4a1f5c[_0xa08c('0x5f')]()['indexOf'](char(0x2c))>=0x0||_0x4a1f5c['toString']()[_0xa08c('0x60')](char(0x22))>=0x0);}function encapsulate(_0x53c520){var _0x3b808d=char(0x22),_0x50a1da='\x5c'+char(0x22),_0x5b9ed5=_0x53c520[_0xa08c('0x5f')]()[_0xa08c('0x61')](new RegExp(_0x3b808d,'g'),_0x50a1da);return _0x3b808d+_0x5b9ed5+_0x3b808d;}exports['getSummary']=function(_0x2ef363,_0x412a10,_0x4b7038){var _0x3c1a39,_0x244f3f;var _0x44ebbb={'where':{'ProjectId':_0x2ef363[_0xa08c('0x54')]['id']}};if(_0x2ef363['query']['startTime']){_0x44ebbb[_0xa08c('0x41')]['starttime']=JSON[_0xa08c('0x62')](_0x2ef363['query'][_0xa08c('0x63')]);}return db[_0xa08c('0x5b')][_0xa08c('0x46')](_0x44ebbb)[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x1374bc){if(_0x1374bc){_0x3c1a39=_0x1374bc;return db[_0xa08c('0x64')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x3c1a39,'id')},'ProjectId':_0x2ef363['params']['id']},'order':_0xa08c('0x65')});}})[_0xa08c('0x29')](handleEntityNotFound(_0x412a10,null))[_0xa08c('0x29')](function(_0x10058a){if(_0x10058a){_0x244f3f=_0x10058a;var _0x55a278={};for(var _0x5559b6=0x0,_0x37e501=_0x244f3f[_0xa08c('0x39')];_0x5559b6<_0x37e501;_0x5559b6++){if(!_0x55a278['hasOwnProperty'](_0x244f3f[_0x5559b6][_0xa08c('0x66')])){_0x55a278[_0x244f3f[_0x5559b6][_0xa08c('0x66')]]=needsEncapsulation(_0x244f3f[_0x5559b6][_0xa08c('0x67')])?encapsulate(_0x244f3f[_0x5559b6][_0xa08c('0x67')]):_0x244f3f[_0x5559b6][_0xa08c('0x67')];}}var _0x5a208e=[],_0x479f6a={};for(var _0x23a17a=0x0,_0x5c7843=_0x3c1a39[_0xa08c('0x39')];_0x23a17a<_0x5c7843;_0x23a17a++){_0x479f6a={'ProjectId':_0x2ef363['params']['id'],'SessionId':_0x3c1a39[_0x23a17a]['id'],'StartTime':moment(_0x3c1a39[_0x23a17a][_0xa08c('0x68')])[_0xa08c('0x69')](_0xa08c('0x6a'))};for(var _0x419595=0x0,_0x2602a3=_0x244f3f[_0xa08c('0x39')];_0x419595<_0x2602a3;_0x419595++){if(_0x244f3f[_0x419595][_0xa08c('0x6b')]==_0x3c1a39[_0x23a17a]['id']&&_0x55a278[_0xa08c('0x3a')](_0x244f3f[_0x419595][_0xa08c('0x66')])){_0x479f6a[_0x55a278[_0x244f3f[_0x419595]['questionId']]]=_0x244f3f[_0x419595][_0xa08c('0x6c')];}}for(var _0x3ae665 in _0x55a278){if(!_0x479f6a[_0xa08c('0x3a')](_0x55a278[_0x3ae665])){_0x479f6a[_0x55a278[_0x3ae665]]=null;}}_0x5a208e[_0xa08c('0x6d')](_0x479f6a);}return _0x5a208e;}})['then'](function(_0x10c02b){if(!_['isEmpty'](_0x10c02b)){var _0x3d5c77=toCsv(_0x10c02b);var _0x2ae318=Date[_0xa08c('0x6e')]();fs['writeFileSync'](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318),_0x3d5c77);_0x412a10[_0xa08c('0x70')]('Content-disposition','attachment;\x20filename='+util[_0xa08c('0x69')](_0xa08c('0x71'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));_0x412a10[_0xa08c('0x70')](_0xa08c('0x72'),_0xa08c('0x73'));return _0x412a10[_0xa08c('0x74')](util[_0xa08c('0x69')](_0xa08c('0x6f'),_0x2ef363[_0xa08c('0x54')]['id'],_0x2ae318));}else{return _0x412a10[_0xa08c('0x19')](0xcc);}})['catch'](handleError(_0x412a10,null));}; \ No newline at end of file +var _0xa282=['moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','error','stack','name','send','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyProject','include','findAll','rows','catch','params','keys','intersection','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','user','getSessions','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','zip-dir','fast-json-patch'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0xa282,0x77));var _0x2a28=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xa282[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x2a28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a28('0x1'));var jsonpatch=require(_0x2a28('0x2'));var rp=require('request-promise');var moment=require(_0x2a28('0x3'));var BPromise=require(_0x2a28('0x4'));var Mustache=require(_0x2a28('0x5'));var util=require(_0x2a28('0x6'));var path=require(_0x2a28('0x7'));var sox=require('sox');var csv=require(_0x2a28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a28('0x9'));var _=require(_0x2a28('0xa'));var squel=require(_0x2a28('0xb'));var crypto=require(_0x2a28('0xc'));var jsforce=require(_0x2a28('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a28('0x8'));var querystring=require(_0x2a28('0xe'));var Papa=require(_0x2a28('0xf'));var Redis=require(_0x2a28('0x10'));var authService=require(_0x2a28('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a28('0x12'));var logger=require(_0x2a28('0x13'))(_0x2a28('0x14'));var utils=require('../../config/utils');var config=require(_0x2a28('0x15'));var licenseUtil=require(_0x2a28('0x16'));var db=require(_0x2a28('0x17'))['db'];function respondWithStatusCode(_0x52b081,_0x5438fa){_0x5438fa=_0x5438fa||0xcc;return function(_0x4f79c3){if(_0x4f79c3){return _0x52b081[_0x2a28('0x18')](_0x5438fa);}return _0x52b081['status'](_0x5438fa)[_0x2a28('0x19')]();};}function respondWithResult(_0x5ce628,_0x384436){_0x384436=_0x384436||0xc8;return function(_0x16991c){if(_0x16991c){return _0x5ce628[_0x2a28('0x1a')](_0x384436)[_0x2a28('0x1b')](_0x16991c);}};}function respondWithFilteredResult(_0x5b42c4,_0x1259eb){return function(_0x13d751){if(_0x13d751){var _0x246204=typeof _0x1259eb[_0x2a28('0x1c')]==='undefined'&&typeof _0x1259eb[_0x2a28('0x1d')]===_0x2a28('0x1e');var _0x177dbc=_0x13d751[_0x2a28('0x1f')];var _0x1c3d1b=_0x246204?0x0:_0x1259eb[_0x2a28('0x1c')];var _0x11a879=_0x246204?_0x13d751[_0x2a28('0x1f')]:_0x1259eb['offset']+_0x1259eb[_0x2a28('0x1d')];var _0x39bb1d;if(_0x11a879>=_0x177dbc){_0x11a879=_0x177dbc;_0x39bb1d=0xc8;}else{_0x39bb1d=0xce;}_0x5b42c4['status'](_0x39bb1d);return _0x5b42c4[_0x2a28('0x20')](_0x2a28('0x21'),_0x1c3d1b+'-'+_0x11a879+'/'+_0x177dbc)[_0x2a28('0x1b')](_0x13d751);}return null;};}function patchUpdates(_0x137b48){return function(_0x1f4722){try{jsonpatch[_0x2a28('0x22')](_0x1f4722,_0x137b48,!![]);}catch(_0x93aa88){return BPromise[_0x2a28('0x23')](_0x93aa88);}return _0x1f4722[_0x2a28('0x24')]();};}function saveUpdates(_0x4f547b,_0x4906aa){return function(_0x31adbb){if(_0x31adbb){return _0x31adbb[_0x2a28('0x25')](_0x4f547b)[_0x2a28('0x26')](function(_0x4f1539){return _0x4f1539;});}return null;};}function removeEntity(_0x292473,_0x1e0583){return function(_0x555c70){if(_0x555c70){return _0x555c70[_0x2a28('0x27')]()[_0x2a28('0x26')](function(){var _0x595707=_0x555c70[_0x2a28('0x28')]({'plain':!![]});var _0xbdb16c=_0x2a28('0x29');return db['UserProfileResource'][_0x2a28('0x27')]({'where':{'type':_0xbdb16c,'resourceId':_0x595707['id']}})[_0x2a28('0x26')](function(){return _0x555c70;});})[_0x2a28('0x26')](function(){_0x292473[_0x2a28('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39b6ea,_0x24f5b1){return function(_0x24d628){if(!_0x24d628){_0x39b6ea[_0x2a28('0x18')](0x194);}return _0x24d628;};}function handleError(_0x26fcbe,_0x29a588){_0x29a588=_0x29a588||0x1f4;return function(_0x4fcec5){logger[_0x2a28('0x2a')](_0x4fcec5[_0x2a28('0x2b')]);if(_0x4fcec5['name']){delete _0x4fcec5[_0x2a28('0x2c')];}_0x26fcbe[_0x2a28('0x1a')](_0x29a588)[_0x2a28('0x2d')](_0x4fcec5);};}exports['index']=function(_0x872e95,_0x214977){var _0x3e394c={},_0x225052={},_0x41abd7={'count':0x0,'rows':[]};var _0x45389c=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x3d0f3e){return{'name':_0x3d0f3e['fieldName'],'type':_0x3d0f3e[_0x2a28('0x2e')][_0x2a28('0x2f')]};});_0x225052[_0x2a28('0x30')]=_[_0x2a28('0x31')](_0x45389c,'name');_0x225052[_0x2a28('0x32')]=_['keys'](_0x872e95['query']);_0x225052[_0x2a28('0x33')]=_['intersection'](_0x225052[_0x2a28('0x30')],_0x225052[_0x2a28('0x32')]);_0x3e394c[_0x2a28('0x34')]=_['intersection'](_0x225052[_0x2a28('0x30')],qs[_0x2a28('0x35')](_0x872e95['query'][_0x2a28('0x35')]));_0x3e394c[_0x2a28('0x34')]=_0x3e394c[_0x2a28('0x34')][_0x2a28('0x36')]?_0x3e394c['attributes']:_0x225052[_0x2a28('0x30')];if(!_0x872e95[_0x2a28('0x32')][_0x2a28('0x37')](_0x2a28('0x38'))){_0x3e394c[_0x2a28('0x1d')]=qs['limit'](_0x872e95[_0x2a28('0x32')][_0x2a28('0x1d')]);_0x3e394c[_0x2a28('0x1c')]=qs['offset'](_0x872e95[_0x2a28('0x32')][_0x2a28('0x1c')]);}_0x3e394c[_0x2a28('0x39')]=qs[_0x2a28('0x3a')](_0x872e95[_0x2a28('0x32')][_0x2a28('0x3a')]);_0x3e394c[_0x2a28('0x3b')]=qs['filters'](_[_0x2a28('0x3c')](_0x872e95[_0x2a28('0x32')],_0x225052[_0x2a28('0x33')]),_0x45389c);if(_0x872e95['query'][_0x2a28('0x3d')]){_0x3e394c[_0x2a28('0x3b')]=_[_0x2a28('0x3e')](_0x3e394c[_0x2a28('0x3b')],{'$or':_['map'](_0x45389c,function(_0x6326f9){if(_0x6326f9[_0x2a28('0x2e')]!==_0x2a28('0x3f')){var _0x45bb81={};_0x45bb81[_0x6326f9[_0x2a28('0x2c')]]={'$like':'%'+_0x872e95['query'][_0x2a28('0x3d')]+'%'};return _0x45bb81;}})});}_0x3e394c=_['merge']({},_0x3e394c,_0x872e95['options']);var _0x3cd1da={'where':_0x3e394c[_0x2a28('0x3b')]};return db[_0x2a28('0x40')]['count'](_0x3cd1da)[_0x2a28('0x26')](function(_0x29ba57){_0x41abd7[_0x2a28('0x1f')]=_0x29ba57;if(_0x872e95[_0x2a28('0x32')]['includeAll']){_0x3e394c[_0x2a28('0x41')]=[{'all':!![]}];}return db[_0x2a28('0x40')][_0x2a28('0x42')](_0x3e394c);})[_0x2a28('0x26')](function(_0x50845e){_0x41abd7[_0x2a28('0x43')]=_0x50845e;return _0x41abd7;})[_0x2a28('0x26')](respondWithFilteredResult(_0x214977,_0x3e394c))[_0x2a28('0x44')](handleError(_0x214977,null));};exports['show']=function(_0x577f04,_0x405b8b){var _0x1e9c9f={'raw':![],'where':{'id':_0x577f04[_0x2a28('0x45')]['id']}},_0x15027c={};_0x15027c[_0x2a28('0x30')]=_[_0x2a28('0x46')](db[_0x2a28('0x40')]['rawAttributes']);_0x15027c[_0x2a28('0x32')]=_['keys'](_0x577f04[_0x2a28('0x32')]);_0x15027c[_0x2a28('0x33')]=_[_0x2a28('0x47')](_0x15027c[_0x2a28('0x30')],_0x15027c[_0x2a28('0x32')]);_0x1e9c9f['attributes']=_['intersection'](_0x15027c[_0x2a28('0x30')],qs[_0x2a28('0x35')](_0x577f04[_0x2a28('0x32')][_0x2a28('0x35')]));_0x1e9c9f[_0x2a28('0x34')]=_0x1e9c9f[_0x2a28('0x34')][_0x2a28('0x36')]?_0x1e9c9f['attributes']:_0x15027c[_0x2a28('0x30')];if(_0x577f04['query'][_0x2a28('0x48')]){_0x1e9c9f[_0x2a28('0x41')]=[{'all':!![]}];}_0x1e9c9f=_[_0x2a28('0x3e')]({},_0x1e9c9f,_0x577f04[_0x2a28('0x49')]);return db['JscriptyProject'][_0x2a28('0x4a')](_0x1e9c9f)[_0x2a28('0x26')](handleEntityNotFound(_0x405b8b,null))['then'](respondWithResult(_0x405b8b,null))['catch'](handleError(_0x405b8b,null));};exports[_0x2a28('0x4b')]=function(_0x412fa5,_0x32e939){return db[_0x2a28('0x40')]['create'](_0x412fa5[_0x2a28('0x4c')],{})['then'](function(_0xebc294){var _0xf8248b=_0x412fa5['user'][_0x2a28('0x28')]({'plain':!![]});if(!_0xf8248b)throw new Error(_0x2a28('0x4d'));if(_0xf8248b[_0x2a28('0x4e')]==='user'){var _0x5347ae=_0xebc294[_0x2a28('0x28')]({'plain':!![]});var _0x2e6e0d='Projects';return db[_0x2a28('0x4f')][_0x2a28('0x4a')]({'where':{'name':_0x2e6e0d,'userProfileId':_0xf8248b[_0x2a28('0x50')]},'raw':!![]})['then'](function(_0x51abf5){if(_0x51abf5&&_0x51abf5[_0x2a28('0x51')]===0x0){return db[_0x2a28('0x52')][_0x2a28('0x4b')]({'name':_0x5347ae[_0x2a28('0x2c')],'resourceId':_0x5347ae['id'],'type':_0x51abf5[_0x2a28('0x2c')],'sectionId':_0x51abf5['id']},{})['then'](function(){return _0xebc294;});}else{return _0xebc294;}})['catch'](function(_0x36b201){logger[_0x2a28('0x2a')](_0x2a28('0x53'),_0x36b201);throw _0x36b201;});}return _0xebc294;})['then'](respondWithResult(_0x32e939,0xc9))[_0x2a28('0x44')](handleError(_0x32e939,null));};exports[_0x2a28('0x54')]=function(_0x4f4d40,_0x685a59){var _0x400de4={'where':{'id':_0x4f4d40['params']['id']}},_0x23df13={};_0x23df13[_0x2a28('0x30')]=_['keys'](db[_0x2a28('0x40')][_0x2a28('0x55')]);_0x400de4[_0x2a28('0x34')]=_[_0x2a28('0x47')](_0x23df13[_0x2a28('0x30')],qs['fields'](_0x4f4d40[_0x2a28('0x32')][_0x2a28('0x35')]));_0x400de4['attributes']=_0x400de4[_0x2a28('0x34')]['length']?_0x400de4[_0x2a28('0x34')]:_0x23df13[_0x2a28('0x30')];if(_0x4f4d40[_0x2a28('0x32')][_0x2a28('0x48')]){_0x400de4['include']=[{'all':!![]}];}_0x400de4=_[_0x2a28('0x3e')]({},_0x400de4,_0x4f4d40[_0x2a28('0x49')]);return db[_0x2a28('0x40')]['find'](_0x400de4)[_0x2a28('0x26')](handleEntityNotFound(_0x685a59,null))['then'](function(_0x11cc4d){if(_0x11cc4d){var _0x3a8036=_0x11cc4d['get']({'plain':!![]});_0x3a8036=qs[_0x2a28('0x56')](_0x3a8036,['id',_0x2a28('0x57'),_0x2a28('0x58')]);_0x4f4d40[_0x2a28('0x4c')]=_[_0x2a28('0x56')](_0x4f4d40['body'],['id',_0x2a28('0x57'),_0x2a28('0x58')]);return db[_0x2a28('0x40')][_0x2a28('0x4b')](_[_0x2a28('0x3e')](_0x3a8036,_0x4f4d40[_0x2a28('0x4c')]),{'include':_0x4f4d40[_0x2a28('0x32')][_0x2a28('0x48')]?[{'all':!![]}]:undefined})[_0x2a28('0x26')](function(_0x700958){var _0xa54986=_0x4f4d40[_0x2a28('0x59')][_0x2a28('0x28')]({'plain':!![]});if(!_0xa54986)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa54986[_0x2a28('0x4e')]===_0x2a28('0x59')){var _0x5aac83=_0x700958[_0x2a28('0x28')]({'plain':!![]});var _0x22848a=_0x2a28('0x29');return db[_0x2a28('0x4f')][_0x2a28('0x4a')]({'where':{'name':_0x22848a,'userProfileId':_0xa54986['userProfileId']},'raw':!![]})[_0x2a28('0x26')](function(_0x3a371a){if(_0x3a371a&&_0x3a371a[_0x2a28('0x51')]===0x0){return db['UserProfileResource'][_0x2a28('0x4b')]({'name':_0x5aac83[_0x2a28('0x2c')],'resourceId':_0x5aac83['id'],'type':_0x3a371a[_0x2a28('0x2c')],'sectionId':_0x3a371a['id']},{})['then'](function(){return _0x700958;});}else{return _0x700958;}})[_0x2a28('0x44')](function(_0x376f22){logger['error'](_0x2a28('0x53'),_0x376f22);throw _0x376f22;});}return _0x700958;});}})[_0x2a28('0x26')](respondWithResult(_0x685a59,0xc9))['catch'](handleError(_0x685a59,null));};exports[_0x2a28('0x25')]=function(_0x312be8,_0x41d66b){if(_0x312be8[_0x2a28('0x4c')]['id']){delete _0x312be8[_0x2a28('0x4c')]['id'];}return db['JscriptyProject'][_0x2a28('0x4a')]({'where':{'id':_0x312be8['params']['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x41d66b,null))[_0x2a28('0x26')](saveUpdates(_0x312be8[_0x2a28('0x4c')],null))[_0x2a28('0x26')](respondWithResult(_0x41d66b,null))[_0x2a28('0x44')](handleError(_0x41d66b,null));};exports[_0x2a28('0x27')]=function(_0x4c55ff,_0x28dae6){return db['JscriptyProject'][_0x2a28('0x4a')]({'where':{'id':_0x4c55ff[_0x2a28('0x45')]['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x28dae6,null))[_0x2a28('0x26')](removeEntity(_0x28dae6,null))[_0x2a28('0x44')](handleError(_0x28dae6,null));};exports[_0x2a28('0x5a')]=function(_0x25db3f,_0x103b6f,_0x16b7d9){var _0x2632c2={'raw':!![],'where':{}};var _0x37d980={};var _0xdb908a={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x25db3f[_0x2a28('0x45')]['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x103b6f,null))['then'](function(_0x3762da){if(_0x3762da){_0x37d980[_0x2a28('0x30')]=_[_0x2a28('0x46')](db[_0x2a28('0x5b')][_0x2a28('0x55')]);_0x37d980['query']=_[_0x2a28('0x46')](_0x25db3f[_0x2a28('0x32')]);_0x37d980[_0x2a28('0x33')]=_[_0x2a28('0x47')](_0x37d980[_0x2a28('0x30')],_0x37d980[_0x2a28('0x32')]);_0x2632c2['attributes']=_['intersection'](_0x37d980[_0x2a28('0x30')],qs[_0x2a28('0x35')](_0x25db3f['query']['fields']));_0x2632c2[_0x2a28('0x34')]=_0x2632c2[_0x2a28('0x34')][_0x2a28('0x36')]?_0x2632c2[_0x2a28('0x34')]:_0x37d980[_0x2a28('0x30')];if(!_0x25db3f[_0x2a28('0x32')][_0x2a28('0x37')](_0x2a28('0x38'))){_0x2632c2['limit']=qs[_0x2a28('0x1d')](_0x25db3f[_0x2a28('0x32')]['limit']);_0x2632c2[_0x2a28('0x1c')]=qs[_0x2a28('0x1c')](_0x25db3f[_0x2a28('0x32')][_0x2a28('0x1c')]);}_0x2632c2[_0x2a28('0x39')]=qs[_0x2a28('0x3a')](_0x25db3f[_0x2a28('0x32')][_0x2a28('0x3a')]);_0x2632c2['where']=qs[_0x2a28('0x33')](_['pick'](_0x25db3f['query'],_0x37d980[_0x2a28('0x33')]));_0x2632c2[_0x2a28('0x3b')][_0x2a28('0x5c')]=_0x3762da['id'];if(_0x25db3f[_0x2a28('0x32')][_0x2a28('0x3d')]){_0x2632c2[_0x2a28('0x3b')]=_[_0x2a28('0x3e')](_0x2632c2[_0x2a28('0x3b')],{'$or':_['map'](_0x2632c2['attributes'],function(_0x8878bf){var _0x2f0c83={};_0x2f0c83[_0x8878bf]={'$like':'%'+_0x25db3f[_0x2a28('0x32')][_0x2a28('0x3d')]+'%'};return _0x2f0c83;})});}_0x2632c2=_[_0x2a28('0x3e')]({},_0x2632c2,_0x25db3f[_0x2a28('0x49')]);return db[_0x2a28('0x5b')]['count']({'where':_0x2632c2['where']})[_0x2a28('0x26')](function(_0x379ce3){_0xdb908a[_0x2a28('0x1f')]=_0x379ce3;if(_0x25db3f[_0x2a28('0x32')]['includeAll']){_0x2632c2['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2a28('0x42')](_0x2632c2);})[_0x2a28('0x26')](function(_0xdbe497){_0xdb908a[_0x2a28('0x43')]=_0xdbe497;return _0xdb908a;});}})[_0x2a28('0x26')](respondWithFilteredResult(_0x103b6f,_0x2632c2))['catch'](handleError(_0x103b6f,null));};exports[_0x2a28('0x5d')]=function(_0x142ee1,_0x43db5f,_0x2156cb){var _0x592185={'raw':!![],'where':{}};var _0x3f5119={};var _0x35eb15={'count':0x0,'rows':[]};return db[_0x2a28('0x40')]['findOne']({'where':{'id':_0x142ee1['params']['id']}})[_0x2a28('0x26')](handleEntityNotFound(_0x43db5f,null))[_0x2a28('0x26')](function(_0xc9b374){if(_0xc9b374){_0x3f5119['model']=_[_0x2a28('0x46')](db[_0x2a28('0x5e')]['rawAttributes']);_0x3f5119['query']=_['keys'](_0x142ee1[_0x2a28('0x32')]);_0x3f5119[_0x2a28('0x33')]=_[_0x2a28('0x47')](_0x3f5119[_0x2a28('0x30')],_0x3f5119[_0x2a28('0x32')]);_0x592185[_0x2a28('0x34')]=_['intersection'](_0x3f5119['model'],qs[_0x2a28('0x35')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x35')]));_0x592185[_0x2a28('0x34')]=_0x592185[_0x2a28('0x34')][_0x2a28('0x36')]?_0x592185['attributes']:_0x3f5119[_0x2a28('0x30')];if(!_0x142ee1[_0x2a28('0x32')][_0x2a28('0x37')](_0x2a28('0x38'))){_0x592185['limit']=qs[_0x2a28('0x1d')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x1d')]);_0x592185[_0x2a28('0x1c')]=qs[_0x2a28('0x1c')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x1c')]);}_0x592185[_0x2a28('0x39')]=qs[_0x2a28('0x3a')](_0x142ee1[_0x2a28('0x32')][_0x2a28('0x3a')]);_0x592185[_0x2a28('0x3b')]=qs[_0x2a28('0x33')](_[_0x2a28('0x3c')](_0x142ee1[_0x2a28('0x32')],_0x3f5119[_0x2a28('0x33')]));_0x592185[_0x2a28('0x3b')]['ProjectId']=_0xc9b374['id'];if(_0x142ee1[_0x2a28('0x32')]['filter']){_0x592185[_0x2a28('0x3b')]=_['merge'](_0x592185[_0x2a28('0x3b')],{'$or':_['map'](_0x592185[_0x2a28('0x34')],function(_0x2f9b13){var _0x40816f={};_0x40816f[_0x2f9b13]={'$like':'%'+_0x142ee1[_0x2a28('0x32')][_0x2a28('0x3d')]+'%'};return _0x40816f;})});}_0x592185=_[_0x2a28('0x3e')]({},_0x592185,_0x142ee1[_0x2a28('0x49')]);return db[_0x2a28('0x5e')][_0x2a28('0x1f')]({'where':_0x592185[_0x2a28('0x3b')]})[_0x2a28('0x26')](function(_0x276e92){_0x35eb15['count']=_0x276e92;if(_0x142ee1['query'][_0x2a28('0x48')]){_0x592185['include']=[{'all':!![]}];}return db[_0x2a28('0x5e')][_0x2a28('0x42')](_0x592185);})[_0x2a28('0x26')](function(_0x56d5c6){_0x35eb15[_0x2a28('0x43')]=_0x56d5c6;return _0x35eb15;});}})[_0x2a28('0x26')](respondWithFilteredResult(_0x43db5f,_0x592185))[_0x2a28('0x44')](handleError(_0x43db5f,null));};function char(_0x14074b){return _0x2a28('0x5f')===typeof _0x14074b?String[_0x2a28('0x60')][_0x2a28('0x22')](null,arguments):_0x14074b;}function needsEncapsulation(_0x35c415){return!!_0x35c415&&(_0x35c415[_0x2a28('0x61')]()['indexOf'](char(0xd))>=0x0||_0x35c415[_0x2a28('0x61')]()[_0x2a28('0x62')](char(0xa))>=0x0||_0x35c415['toString']()['indexOf'](char(0x2c))>=0x0||_0x35c415[_0x2a28('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x354352){var _0x31d8d2=char(0x22),_0x3c7e0d='\x5c'+char(0x22),_0x5e57bc=_0x354352['toString']()[_0x2a28('0x63')](new RegExp(_0x31d8d2,'g'),_0x3c7e0d);return _0x31d8d2+_0x5e57bc+_0x31d8d2;}exports[_0x2a28('0x64')]=function(_0xe305a7,_0x1a3d76,_0x1c0caa){var _0x36686e,_0x39ea0c;var _0x465b32={'where':{'ProjectId':_0xe305a7[_0x2a28('0x45')]['id']}};if(_0xe305a7[_0x2a28('0x32')][_0x2a28('0x65')]){_0x465b32[_0x2a28('0x3b')][_0x2a28('0x66')]=JSON[_0x2a28('0x67')](_0xe305a7[_0x2a28('0x32')]['startTime']);}return db[_0x2a28('0x5b')][_0x2a28('0x42')](_0x465b32)[_0x2a28('0x26')](handleEntityNotFound(_0x1a3d76,null))['then'](function(_0x547c22){if(_0x547c22){_0x36686e=_0x547c22;return db[_0x2a28('0x68')][_0x2a28('0x42')]({'where':{'SessionId':{'$in':_[_0x2a28('0x31')](_0x36686e,'id')},'ProjectId':_0xe305a7[_0x2a28('0x45')]['id']},'order':_0x2a28('0x69')});}})[_0x2a28('0x26')](handleEntityNotFound(_0x1a3d76,null))[_0x2a28('0x26')](function(_0x2b5aac){if(_0x2b5aac){_0x39ea0c=_0x2b5aac;var _0x3c3282={};for(var _0x4426d0=0x0,_0x2fd680=_0x39ea0c[_0x2a28('0x36')];_0x4426d0<_0x2fd680;_0x4426d0++){if(!_0x3c3282['hasOwnProperty'](_0x39ea0c[_0x4426d0]['questionId'])){_0x3c3282[_0x39ea0c[_0x4426d0][_0x2a28('0x6a')]]=needsEncapsulation(_0x39ea0c[_0x4426d0][_0x2a28('0x6b')])?encapsulate(_0x39ea0c[_0x4426d0][_0x2a28('0x6b')]):_0x39ea0c[_0x4426d0][_0x2a28('0x6b')];}}var _0x51c374=[],_0xac91be={};for(var _0x31156b=0x0,_0x32fe2a=_0x36686e[_0x2a28('0x36')];_0x31156b<_0x32fe2a;_0x31156b++){_0xac91be={'ProjectId':_0xe305a7[_0x2a28('0x45')]['id'],'SessionId':_0x36686e[_0x31156b]['id'],'StartTime':moment(_0x36686e[_0x31156b][_0x2a28('0x66')])[_0x2a28('0x6c')](_0x2a28('0x6d'))};for(var _0x4a2842=0x0,_0x57527a=_0x39ea0c[_0x2a28('0x36')];_0x4a2842<_0x57527a;_0x4a2842++){if(_0x39ea0c[_0x4a2842][_0x2a28('0x6e')]==_0x36686e[_0x31156b]['id']&&_0x3c3282[_0x2a28('0x37')](_0x39ea0c[_0x4a2842][_0x2a28('0x6a')])){_0xac91be[_0x3c3282[_0x39ea0c[_0x4a2842][_0x2a28('0x6a')]]]=_0x39ea0c[_0x4a2842][_0x2a28('0x6f')];}}for(var _0x52584f in _0x3c3282){if(!_0xac91be[_0x2a28('0x37')](_0x3c3282[_0x52584f])){_0xac91be[_0x3c3282[_0x52584f]]=null;}}_0x51c374[_0x2a28('0x70')](_0xac91be);}return _0x51c374;}})[_0x2a28('0x26')](function(_0x4f8e92){if(!_[_0x2a28('0x71')](_0x4f8e92)){var _0x4f6182=toCsv(_0x4f8e92);var _0x1e2591=Date[_0x2a28('0x72')]();fs['writeFileSync'](util[_0x2a28('0x6c')](_0x2a28('0x73'),_0xe305a7['params']['id'],_0x1e2591),_0x4f6182);_0x1a3d76[_0x2a28('0x74')]('Content-disposition',_0x2a28('0x75')+util[_0x2a28('0x6c')](_0x2a28('0x76'),_0xe305a7[_0x2a28('0x45')]['id'],_0x1e2591));_0x1a3d76['setHeader'](_0x2a28('0x77'),_0x2a28('0x78'));return _0x1a3d76[_0x2a28('0x79')](util[_0x2a28('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0xe305a7['params']['id'],_0x1e2591));}else{return _0x1a3d76[_0x2a28('0x18')](0xcc);}})[_0x2a28('0x44')](handleError(_0x1a3d76,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 41f470e..332c95b 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 _0xe314=['path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x13e534,_0x3de80b){var _0x277ad0=function(_0x43c716){while(--_0x43c716){_0x13e534['push'](_0x13e534['shift']());}};_0x277ad0(++_0x3de80b);}(_0xe314,0x7c));var _0x4e31=function(_0x2caad7,_0x1f5660){_0x2caad7=_0x2caad7-0x0;var _0x3b1f41=_0xe314[_0x2caad7];return _0x3b1f41;};'use strict';var _=require('lodash');var util=require(_0x4e31('0x0'));var logger=require(_0x4e31('0x1'))(_0x4e31('0x2'));var moment=require(_0x4e31('0x3'));var BPromise=require(_0x4e31('0x4'));var rp=require(_0x4e31('0x5'));var fs=require('fs');var path=require(_0x4e31('0x6'));var rimraf=require(_0x4e31('0x7'));var config=require(_0x4e31('0x8'));var attributes=require(_0x4e31('0x9'));module['exports']=function(_0x49b2a7,_0x3c5e06){return _0x49b2a7[_0x4e31('0xa')](_0x4e31('0xb'),attributes,{'tableName':_0x4e31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a59=['../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','api','moment','bluebird','request-promise','path'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7a59,0x16e));var _0x97a5=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7a59[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x97a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x97a5('0x1'));var moment=require(_0x97a5('0x2'));var BPromise=require(_0x97a5('0x3'));var rp=require(_0x97a5('0x4'));var fs=require('fs');var path=require(_0x97a5('0x5'));var rimraf=require('rimraf');var config=require(_0x97a5('0x6'));var attributes=require(_0x97a5('0x7'));module[_0x97a5('0x8')]=function(_0x48201b,_0x438520){return _0x48201b[_0x97a5('0x9')](_0x97a5('0xa'),attributes,{'tableName':_0x97a5('0xb'),'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 3442163..5e3f08f 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 _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dca4c,_0x35bd2b){var _0x20cbf9=function(_0x47d24d){while(--_0x47d24d){_0x3dca4c['push'](_0x3dca4c['shift']());}};_0x20cbf9(++_0x35bd2b);}(_0x70e0,0x17b));var _0x070e=function(_0x24188d,_0x4976ce){_0x24188d=_0x24188d-0x0;var _0x1fda9f=_0x70e0[_0x24188d];return _0x1fda9f;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1c7bc6,_0x49bd45){var _0x4fe724=function(_0x505910){while(--_0x505910){_0x1c7bc6['push'](_0x1c7bc6['shift']());}};_0x4fe724(++_0x49bd45);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index f6a0f12..6c7c137 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 _0xfa11=['destroy','exports','multer','path','connect-timeout','express','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete'];(function(_0x5683a1,_0x119044){var _0x4227c8=function(_0x1d264b){while(--_0x1d264b){_0x5683a1['push'](_0x5683a1['shift']());}};_0x4227c8(++_0x119044);}(_0xfa11,0xac));var _0x1fa1=function(_0x5b05a1,_0x34e8e7){_0x5b05a1=_0x5b05a1-0x0;var _0x6f3f99=_0xfa11[_0x5b05a1];return _0x6f3f99;};'use strict';var multer=require(_0x1fa1('0x0'));var util=require('util');var path=require(_0x1fa1('0x1'));var timeout=require(_0x1fa1('0x2'));var express=require(_0x1fa1('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1fa1('0x4'));router['get']('/',auth[_0x1fa1('0x5')](),controller[_0x1fa1('0x6')]);router[_0x1fa1('0x7')](_0x1fa1('0x8'),auth[_0x1fa1('0x5')](),controller[_0x1fa1('0x9')]);router[_0x1fa1('0x7')](_0x1fa1('0xa'),auth['isAuthenticated'](),controller[_0x1fa1('0xb')]);router['post']('/',auth[_0x1fa1('0x5')](),controller['create']);router[_0x1fa1('0xc')](_0x1fa1('0xa'),auth[_0x1fa1('0x5')](),controller[_0x1fa1('0xd')]);router[_0x1fa1('0xe')](_0x1fa1('0xa'),auth[_0x1fa1('0x5')](),controller[_0x1fa1('0xf')]);module[_0x1fa1('0x10')]=router; \ No newline at end of file +var _0x20a6=['/:id','post','create','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe'];(function(_0x33cf43,_0x4b4de9){var _0x521db5=function(_0x994173){while(--_0x994173){_0x33cf43['push'](_0x33cf43['shift']());}};_0x521db5(++_0x4b4de9);}(_0x20a6,0xfd));var _0x620a=function(_0x239c3c,_0x3c6075){_0x239c3c=_0x239c3c-0x0;var _0x5bfa50=_0x20a6[_0x239c3c];return _0x5bfa50;};'use strict';var multer=require(_0x620a('0x0'));var util=require(_0x620a('0x1'));var path=require('path');var timeout=require(_0x620a('0x2'));var express=require(_0x620a('0x3'));var router=express['Router']();var fs_extra=require(_0x620a('0x4'));var auth=require(_0x620a('0x5'));var interaction=require(_0x620a('0x6'));var config=require(_0x620a('0x7'));var controller=require(_0x620a('0x8'));router[_0x620a('0x9')]('/',auth[_0x620a('0xa')](),controller[_0x620a('0xb')]);router['get']('/describe',auth[_0x620a('0xa')](),controller[_0x620a('0xc')]);router[_0x620a('0x9')](_0x620a('0xd'),auth[_0x620a('0xa')](),controller['show']);router[_0x620a('0xe')]('/',auth[_0x620a('0xa')](),controller[_0x620a('0xf')]);router['put'](_0x620a('0xd'),auth[_0x620a('0xa')](),controller[_0x620a('0x10')]);router[_0x620a('0x11')](_0x620a('0xd'),auth[_0x620a('0xa')](),controller['destroy']);module[_0x620a('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d4d8ee6..cc6ebad 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x311771,_0x52e6c5){_0x311771=_0x311771-0x0;var _0x5c540b=_0x7a54[_0x311771];return _0x5c540b;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x2bcbe5,_0x1c1d7c){_0x2bcbe5=_0x2bcbe5-0x0;var _0x494ecc=_0x7a54[_0x2bcbe5];return _0x494ecc;};'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 13dc91a..143bb16 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 _0x2787=['status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','end','stack','name','index','map','JscriptyQuestionReport','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2ee2e3,_0x15b679){var _0x2dace1=function(_0x5028fc){while(--_0x5028fc){_0x2ee2e3['push'](_0x2ee2e3['shift']());}};_0x2dace1(++_0x15b679);}(_0x2787,0x151));var _0x7278=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2787[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x7278('0x0'));var rimraf=require(_0x7278('0x1'));var zipdir=require(_0x7278('0x2'));var jsonpatch=require(_0x7278('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7278('0x4'));var Mustache=require(_0x7278('0x5'));var util=require(_0x7278('0x6'));var path=require(_0x7278('0x7'));var sox=require('sox');var csv=require(_0x7278('0x8'));var ejs=require(_0x7278('0x9'));var fs=require('fs');var fs_extra=require(_0x7278('0xa'));var _=require('lodash');var squel=require(_0x7278('0xb'));var crypto=require('crypto');var jsforce=require(_0x7278('0xc'));var deskjs=require(_0x7278('0xd'));var toCsv=require(_0x7278('0x8'));var querystring=require(_0x7278('0xe'));var Papa=require('papaparse');var Redis=require(_0x7278('0xf'));var authService=require(_0x7278('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7278('0x11'));var hardwareService=require(_0x7278('0x12'));var logger=require('../../config/logger')(_0x7278('0x13'));var utils=require('../../config/utils');var config=require(_0x7278('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7278('0x15'))['db'];function respondWithStatusCode(_0x1c3f4b,_0xf034dd){_0xf034dd=_0xf034dd||0xcc;return function(_0x59c3a8){if(_0x59c3a8){return _0x1c3f4b[_0x7278('0x16')](_0xf034dd);}return _0x1c3f4b[_0x7278('0x17')](_0xf034dd)['end']();};}function respondWithResult(_0x196058,_0x4b5607){_0x4b5607=_0x4b5607||0xc8;return function(_0x593b8e){if(_0x593b8e){return _0x196058['status'](_0x4b5607)['json'](_0x593b8e);}};}function respondWithFilteredResult(_0x2193ac,_0x2b5007){return function(_0x43de0c){if(_0x43de0c){var _0x257191=typeof _0x2b5007[_0x7278('0x18')]==='undefined'&&typeof _0x2b5007[_0x7278('0x19')]===_0x7278('0x1a');var _0x1c0be4=_0x43de0c[_0x7278('0x1b')];var _0x34e945=_0x257191?0x0:_0x2b5007[_0x7278('0x18')];var _0x1e15bf=_0x257191?_0x43de0c[_0x7278('0x1b')]:_0x2b5007['offset']+_0x2b5007['limit'];var _0x1fc6fc;if(_0x1e15bf>=_0x1c0be4){_0x1e15bf=_0x1c0be4;_0x1fc6fc=0xc8;}else{_0x1fc6fc=0xce;}_0x2193ac[_0x7278('0x17')](_0x1fc6fc);return _0x2193ac[_0x7278('0x1c')](_0x7278('0x1d'),_0x34e945+'-'+_0x1e15bf+'/'+_0x1c0be4)[_0x7278('0x1e')](_0x43de0c);}return null;};}function patchUpdates(_0xb02a7f){return function(_0x3d6d48){try{jsonpatch['apply'](_0x3d6d48,_0xb02a7f,!![]);}catch(_0x5f4a2c){return BPromise[_0x7278('0x1f')](_0x5f4a2c);}return _0x3d6d48[_0x7278('0x20')]();};}function saveUpdates(_0x57b960,_0x347fcb){return function(_0x3849f4){if(_0x3849f4){return _0x3849f4[_0x7278('0x21')](_0x57b960)[_0x7278('0x22')](function(_0x5adaae){return _0x5adaae;});}return null;};}function removeEntity(_0x56c300,_0x78a516){return function(_0x4e261b){if(_0x4e261b){return _0x4e261b['destroy']()[_0x7278('0x22')](function(){_0x56c300[_0x7278('0x17')](0xcc)[_0x7278('0x23')]();});}};}function handleEntityNotFound(_0xf94f34,_0x192998){return function(_0xc859d3){if(!_0xc859d3){_0xf94f34['sendStatus'](0x194);}return _0xc859d3;};}function handleError(_0x3e508a,_0x1efd35){_0x1efd35=_0x1efd35||0x1f4;return function(_0x428697){logger['error'](_0x428697[_0x7278('0x24')]);if(_0x428697[_0x7278('0x25')]){delete _0x428697[_0x7278('0x25')];}_0x3e508a['status'](_0x1efd35)['send'](_0x428697);};}exports[_0x7278('0x26')]=function(_0x33d437,_0x5553a1){var _0x445f3c={},_0x298e84={},_0x1b3c46={'count':0x0,'rows':[]};var _0x29df02=_[_0x7278('0x27')](db[_0x7278('0x28')]['rawAttributes'],function(_0x134867){return{'name':_0x134867['fieldName'],'type':_0x134867[_0x7278('0x29')]['key']};});_0x298e84['model']=_['map'](_0x29df02,_0x7278('0x25'));_0x298e84[_0x7278('0x2a')]=_[_0x7278('0x2b')](_0x33d437[_0x7278('0x2a')]);_0x298e84[_0x7278('0x2c')]=_[_0x7278('0x2d')](_0x298e84[_0x7278('0x2e')],_0x298e84[_0x7278('0x2a')]);_0x445f3c[_0x7278('0x2f')]=_[_0x7278('0x2d')](_0x298e84[_0x7278('0x2e')],qs['fields'](_0x33d437[_0x7278('0x2a')][_0x7278('0x30')]));_0x445f3c[_0x7278('0x2f')]=_0x445f3c[_0x7278('0x2f')]['length']?_0x445f3c[_0x7278('0x2f')]:_0x298e84[_0x7278('0x2e')];if(!_0x33d437[_0x7278('0x2a')][_0x7278('0x31')](_0x7278('0x32'))){_0x445f3c[_0x7278('0x19')]=qs[_0x7278('0x19')](_0x33d437[_0x7278('0x2a')][_0x7278('0x19')]);_0x445f3c['offset']=qs[_0x7278('0x18')](_0x33d437[_0x7278('0x2a')][_0x7278('0x18')]);}_0x445f3c[_0x7278('0x33')]=qs['sort'](_0x33d437[_0x7278('0x2a')][_0x7278('0x34')]);_0x445f3c['where']=qs['filters'](_[_0x7278('0x35')](_0x33d437[_0x7278('0x2a')],_0x298e84[_0x7278('0x2c')]),_0x29df02);if(_0x33d437['query'][_0x7278('0x36')]){_0x445f3c['where']=_[_0x7278('0x37')](_0x445f3c[_0x7278('0x38')],{'$or':_[_0x7278('0x27')](_0x29df02,function(_0x392466){if(_0x392466['type']!==_0x7278('0x39')){var _0x7f0f68={};_0x7f0f68[_0x392466[_0x7278('0x25')]]={'$like':'%'+_0x33d437[_0x7278('0x2a')][_0x7278('0x36')]+'%'};return _0x7f0f68;}})});}_0x445f3c=_['merge']({},_0x445f3c,_0x33d437[_0x7278('0x3a')]);var _0x1a2352={'where':_0x445f3c[_0x7278('0x38')]};return db[_0x7278('0x28')][_0x7278('0x1b')](_0x1a2352)['then'](function(_0x11e360){_0x1b3c46['count']=_0x11e360;if(_0x33d437[_0x7278('0x2a')][_0x7278('0x3b')]){_0x445f3c[_0x7278('0x3c')]=[{'all':!![]}];}return db[_0x7278('0x28')][_0x7278('0x3d')](_0x445f3c);})[_0x7278('0x22')](function(_0xb94023){_0x1b3c46['rows']=_0xb94023;return _0x1b3c46;})[_0x7278('0x22')](respondWithFilteredResult(_0x5553a1,_0x445f3c))[_0x7278('0x3e')](handleError(_0x5553a1,null));};exports[_0x7278('0x3f')]=function(_0x37fc70,_0x220ebd){var _0x54e935={'raw':!![],'where':{'id':_0x37fc70[_0x7278('0x40')]['id']}},_0x32bd47={};_0x32bd47[_0x7278('0x2e')]=_[_0x7278('0x2b')](db['JscriptyQuestionReport'][_0x7278('0x41')]);_0x32bd47[_0x7278('0x2a')]=_[_0x7278('0x2b')](_0x37fc70['query']);_0x32bd47[_0x7278('0x2c')]=_[_0x7278('0x2d')](_0x32bd47[_0x7278('0x2e')],_0x32bd47[_0x7278('0x2a')]);_0x54e935[_0x7278('0x2f')]=_[_0x7278('0x2d')](_0x32bd47[_0x7278('0x2e')],qs['fields'](_0x37fc70[_0x7278('0x2a')]['fields']));_0x54e935[_0x7278('0x2f')]=_0x54e935['attributes'][_0x7278('0x42')]?_0x54e935[_0x7278('0x2f')]:_0x32bd47[_0x7278('0x2e')];if(_0x37fc70[_0x7278('0x2a')]['includeAll']){_0x54e935[_0x7278('0x3c')]=[{'all':!![]}];}_0x54e935=_[_0x7278('0x37')]({},_0x54e935,_0x37fc70[_0x7278('0x3a')]);return db['JscriptyQuestionReport']['find'](_0x54e935)[_0x7278('0x22')](handleEntityNotFound(_0x220ebd,null))['then'](respondWithResult(_0x220ebd,null))[_0x7278('0x3e')](handleError(_0x220ebd,null));};exports[_0x7278('0x43')]=function(_0x228e2c,_0x2b028b){return db[_0x7278('0x28')]['create'](_0x228e2c[_0x7278('0x44')],{})['then'](respondWithResult(_0x2b028b,0xc9))[_0x7278('0x3e')](handleError(_0x2b028b,null));};exports['update']=function(_0x294980,_0x1d92ae){if(_0x294980['body']['id']){delete _0x294980[_0x7278('0x44')]['id'];}return db[_0x7278('0x28')][_0x7278('0x45')]({'where':{'id':_0x294980['params']['id']}})[_0x7278('0x22')](handleEntityNotFound(_0x1d92ae,null))[_0x7278('0x22')](saveUpdates(_0x294980[_0x7278('0x44')],null))[_0x7278('0x22')](respondWithResult(_0x1d92ae,null))[_0x7278('0x3e')](handleError(_0x1d92ae,null));};exports[_0x7278('0x46')]=function(_0x26399a,_0x32fc9a){return db[_0x7278('0x28')]['find']({'where':{'id':_0x26399a[_0x7278('0x40')]['id']}})[_0x7278('0x22')](handleEntityNotFound(_0x32fc9a,null))['then'](removeEntity(_0x32fc9a,null))[_0x7278('0x3e')](handleError(_0x32fc9a,null));};exports['describe']=function(_0x5bd03d,_0x587fb9){return db['JscriptyQuestionReport'][_0x7278('0x47')]()[_0x7278('0x22')](respondWithResult(_0x587fb9,null))['catch'](handleError(_0x587fb9,null));}; \ No newline at end of file +var _0xdee6=['hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','params','include','options','find','create','body','catch','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','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','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xdee6,0x1f3));var _0x6dee=function(_0x235de2,_0x4f1099){_0x235de2=_0x235de2-0x0;var _0x3ecc49=_0xdee6[_0x235de2];return _0x3ecc49;};'use strict';var emlformat=require(_0x6dee('0x0'));var rimraf=require(_0x6dee('0x1'));var zipdir=require(_0x6dee('0x2'));var jsonpatch=require(_0x6dee('0x3'));var rp=require(_0x6dee('0x4'));var moment=require(_0x6dee('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6dee('0x6'));var path=require(_0x6dee('0x7'));var sox=require(_0x6dee('0x8'));var csv=require(_0x6dee('0x9'));var ejs=require(_0x6dee('0xa'));var fs=require('fs');var fs_extra=require(_0x6dee('0xb'));var _=require(_0x6dee('0xc'));var squel=require(_0x6dee('0xd'));var crypto=require(_0x6dee('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6dee('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6dee('0x10'));var Papa=require(_0x6dee('0x11'));var Redis=require(_0x6dee('0x12'));var authService=require(_0x6dee('0x13'));var qs=require(_0x6dee('0x14'));var as=require(_0x6dee('0x15'));var hardwareService=require(_0x6dee('0x16'));var logger=require(_0x6dee('0x17'))(_0x6dee('0x18'));var utils=require(_0x6dee('0x19'));var config=require(_0x6dee('0x1a'));var licenseUtil=require(_0x6dee('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x128841,_0x2bd0cc){_0x2bd0cc=_0x2bd0cc||0xcc;return function(_0x19bedc){if(_0x19bedc){return _0x128841[_0x6dee('0x1c')](_0x2bd0cc);}return _0x128841[_0x6dee('0x1d')](_0x2bd0cc)[_0x6dee('0x1e')]();};}function respondWithResult(_0x1a3329,_0x45c3c4){_0x45c3c4=_0x45c3c4||0xc8;return function(_0x5725d4){if(_0x5725d4){return _0x1a3329[_0x6dee('0x1d')](_0x45c3c4)['json'](_0x5725d4);}};}function respondWithFilteredResult(_0x42c7fd,_0x5b36d3){return function(_0x188cf4){if(_0x188cf4){var _0x137792=typeof _0x5b36d3[_0x6dee('0x1f')]==='undefined'&&typeof _0x5b36d3['limit']===_0x6dee('0x20');var _0x229457=_0x188cf4['count'];var _0x3f702c=_0x137792?0x0:_0x5b36d3[_0x6dee('0x1f')];var _0x1dbe6e=_0x137792?_0x188cf4[_0x6dee('0x21')]:_0x5b36d3[_0x6dee('0x1f')]+_0x5b36d3[_0x6dee('0x22')];var _0x5747b7;if(_0x1dbe6e>=_0x229457){_0x1dbe6e=_0x229457;_0x5747b7=0xc8;}else{_0x5747b7=0xce;}_0x42c7fd[_0x6dee('0x1d')](_0x5747b7);return _0x42c7fd[_0x6dee('0x23')](_0x6dee('0x24'),_0x3f702c+'-'+_0x1dbe6e+'/'+_0x229457)[_0x6dee('0x25')](_0x188cf4);}return null;};}function patchUpdates(_0x2ffa83){return function(_0x37854b){try{jsonpatch[_0x6dee('0x26')](_0x37854b,_0x2ffa83,!![]);}catch(_0x2e0a91){return BPromise['reject'](_0x2e0a91);}return _0x37854b[_0x6dee('0x27')]();};}function saveUpdates(_0x256d1e,_0x4cfa73){return function(_0x22ae89){if(_0x22ae89){return _0x22ae89[_0x6dee('0x28')](_0x256d1e)[_0x6dee('0x29')](function(_0xc98c3){return _0xc98c3;});}return null;};}function removeEntity(_0x430127,_0x10b9c8){return function(_0xa9001e){if(_0xa9001e){return _0xa9001e[_0x6dee('0x2a')]()[_0x6dee('0x29')](function(){_0x430127[_0x6dee('0x1d')](0xcc)[_0x6dee('0x1e')]();});}};}function handleEntityNotFound(_0x532ed2,_0x547d5b){return function(_0x2ba53c){if(!_0x2ba53c){_0x532ed2[_0x6dee('0x1c')](0x194);}return _0x2ba53c;};}function handleError(_0x39c86f,_0x30768b){_0x30768b=_0x30768b||0x1f4;return function(_0x507316){logger[_0x6dee('0x2b')](_0x507316[_0x6dee('0x2c')]);if(_0x507316[_0x6dee('0x2d')]){delete _0x507316['name'];}_0x39c86f[_0x6dee('0x1d')](_0x30768b)[_0x6dee('0x2e')](_0x507316);};}exports[_0x6dee('0x2f')]=function(_0x60ab02,_0xc7a11a){var _0x440913={},_0x6feb03={},_0x2c606f={'count':0x0,'rows':[]};var _0x2c424c=_[_0x6dee('0x30')](db[_0x6dee('0x31')][_0x6dee('0x32')],function(_0x7fd5ea){return{'name':_0x7fd5ea[_0x6dee('0x33')],'type':_0x7fd5ea[_0x6dee('0x34')]['key']};});_0x6feb03[_0x6dee('0x35')]=_[_0x6dee('0x30')](_0x2c424c,_0x6dee('0x2d'));_0x6feb03[_0x6dee('0x36')]=_[_0x6dee('0x37')](_0x60ab02['query']);_0x6feb03[_0x6dee('0x38')]=_[_0x6dee('0x39')](_0x6feb03[_0x6dee('0x35')],_0x6feb03['query']);_0x440913[_0x6dee('0x3a')]=_['intersection'](_0x6feb03[_0x6dee('0x35')],qs[_0x6dee('0x3b')](_0x60ab02[_0x6dee('0x36')][_0x6dee('0x3b')]));_0x440913[_0x6dee('0x3a')]=_0x440913['attributes'][_0x6dee('0x3c')]?_0x440913[_0x6dee('0x3a')]:_0x6feb03['model'];if(!_0x60ab02[_0x6dee('0x36')][_0x6dee('0x3d')]('nolimit')){_0x440913[_0x6dee('0x22')]=qs[_0x6dee('0x22')](_0x60ab02[_0x6dee('0x36')]['limit']);_0x440913['offset']=qs[_0x6dee('0x1f')](_0x60ab02['query']['offset']);}_0x440913[_0x6dee('0x3e')]=qs[_0x6dee('0x3f')](_0x60ab02[_0x6dee('0x36')][_0x6dee('0x3f')]);_0x440913['where']=qs['filters'](_[_0x6dee('0x40')](_0x60ab02[_0x6dee('0x36')],_0x6feb03['filters']),_0x2c424c);if(_0x60ab02[_0x6dee('0x36')][_0x6dee('0x41')]){_0x440913[_0x6dee('0x42')]=_['merge'](_0x440913[_0x6dee('0x42')],{'$or':_[_0x6dee('0x30')](_0x2c424c,function(_0x405aaa){if(_0x405aaa[_0x6dee('0x34')]!==_0x6dee('0x43')){var _0x5d2d8a={};_0x5d2d8a[_0x405aaa['name']]={'$like':'%'+_0x60ab02[_0x6dee('0x36')]['filter']+'%'};return _0x5d2d8a;}})});}_0x440913=_[_0x6dee('0x44')]({},_0x440913,_0x60ab02['options']);var _0x118330={'where':_0x440913['where']};return db['JscriptyQuestionReport'][_0x6dee('0x21')](_0x118330)['then'](function(_0x591085){_0x2c606f[_0x6dee('0x21')]=_0x591085;if(_0x60ab02[_0x6dee('0x36')][_0x6dee('0x45')]){_0x440913['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x6dee('0x46')](_0x440913);})[_0x6dee('0x29')](function(_0x251ee9){_0x2c606f[_0x6dee('0x47')]=_0x251ee9;return _0x2c606f;})[_0x6dee('0x29')](respondWithFilteredResult(_0xc7a11a,_0x440913))['catch'](handleError(_0xc7a11a,null));};exports['show']=function(_0x4f0d54,_0xfd2803){var _0x331a25={'raw':!![],'where':{'id':_0x4f0d54[_0x6dee('0x48')]['id']}},_0x3072c3={};_0x3072c3[_0x6dee('0x35')]=_['keys'](db[_0x6dee('0x31')][_0x6dee('0x32')]);_0x3072c3['query']=_[_0x6dee('0x37')](_0x4f0d54[_0x6dee('0x36')]);_0x3072c3[_0x6dee('0x38')]=_['intersection'](_0x3072c3[_0x6dee('0x35')],_0x3072c3[_0x6dee('0x36')]);_0x331a25[_0x6dee('0x3a')]=_['intersection'](_0x3072c3['model'],qs[_0x6dee('0x3b')](_0x4f0d54['query'][_0x6dee('0x3b')]));_0x331a25[_0x6dee('0x3a')]=_0x331a25[_0x6dee('0x3a')][_0x6dee('0x3c')]?_0x331a25[_0x6dee('0x3a')]:_0x3072c3[_0x6dee('0x35')];if(_0x4f0d54[_0x6dee('0x36')][_0x6dee('0x45')]){_0x331a25[_0x6dee('0x49')]=[{'all':!![]}];}_0x331a25=_[_0x6dee('0x44')]({},_0x331a25,_0x4f0d54[_0x6dee('0x4a')]);return db[_0x6dee('0x31')][_0x6dee('0x4b')](_0x331a25)[_0x6dee('0x29')](handleEntityNotFound(_0xfd2803,null))[_0x6dee('0x29')](respondWithResult(_0xfd2803,null))['catch'](handleError(_0xfd2803,null));};exports[_0x6dee('0x4c')]=function(_0x498ccb,_0x578c9b){return db[_0x6dee('0x31')][_0x6dee('0x4c')](_0x498ccb[_0x6dee('0x4d')],{})[_0x6dee('0x29')](respondWithResult(_0x578c9b,0xc9))[_0x6dee('0x4e')](handleError(_0x578c9b,null));};exports[_0x6dee('0x28')]=function(_0x50178c,_0x46a38b){if(_0x50178c[_0x6dee('0x4d')]['id']){delete _0x50178c[_0x6dee('0x4d')]['id'];}return db[_0x6dee('0x31')][_0x6dee('0x4b')]({'where':{'id':_0x50178c[_0x6dee('0x48')]['id']}})[_0x6dee('0x29')](handleEntityNotFound(_0x46a38b,null))[_0x6dee('0x29')](saveUpdates(_0x50178c[_0x6dee('0x4d')],null))[_0x6dee('0x29')](respondWithResult(_0x46a38b,null))['catch'](handleError(_0x46a38b,null));};exports[_0x6dee('0x2a')]=function(_0x3c93f6,_0x102623){return db[_0x6dee('0x31')][_0x6dee('0x4b')]({'where':{'id':_0x3c93f6[_0x6dee('0x48')]['id']}})[_0x6dee('0x29')](handleEntityNotFound(_0x102623,null))[_0x6dee('0x29')](removeEntity(_0x102623,null))['catch'](handleError(_0x102623,null));};exports[_0x6dee('0x4f')]=function(_0x14dcce,_0x3c80a2){return db[_0x6dee('0x31')]['describe']()[_0x6dee('0x29')](respondWithResult(_0x3c80a2,null))[_0x6dee('0x4e')](handleError(_0x3c80a2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index eaad191..8a467f3 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 _0x3b72=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x3b72,0x133));var _0x23b7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3b72[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x23b7('0x0'));var logger=require('../../config/logger')(_0x23b7('0x1'));var moment=require('moment');var BPromise=require(_0x23b7('0x2'));var rp=require(_0x23b7('0x3'));var fs=require('fs');var path=require(_0x23b7('0x4'));var rimraf=require(_0x23b7('0x5'));var config=require(_0x23b7('0x6'));var attributes=require(_0x23b7('0x7'));module[_0x23b7('0x8')]=function(_0xdaf8e7,_0x5cfd71){return _0xdaf8e7['define'](_0x23b7('0x9'),attributes,{'tableName':_0x23b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0569=['rimraf','../../config/environment','exports','define','report_jscripty_questions','lodash','util','api','moment','request-promise','path'];(function(_0x1e9d62,_0x25bb8e){var _0x56c490=function(_0x19f4e7){while(--_0x19f4e7){_0x1e9d62['push'](_0x1e9d62['shift']());}};_0x56c490(++_0x25bb8e);}(_0x0569,0x123));var _0x9056=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x0569[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x9056('0x0'));var util=require(_0x9056('0x1'));var logger=require('../../config/logger')(_0x9056('0x2'));var moment=require(_0x9056('0x3'));var BPromise=require('bluebird');var rp=require(_0x9056('0x4'));var fs=require('fs');var path=require(_0x9056('0x5'));var rimraf=require(_0x9056('0x6'));var config=require(_0x9056('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x9056('0x8')]=function(_0x2d70bb,_0x20143a){return _0x2d70bb[_0x9056('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x9056('0xa'),'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 e5c700e..65377c5 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 _0x91ae=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis'];(function(_0x1cdb18,_0x28d4a7){var _0x10ca20=function(_0x2c9e4c){while(--_0x2c9e4c){_0x1cdb18['push'](_0x1cdb18['shift']());}};_0x10ca20(++_0x28d4a7);}(_0x91ae,0x178));var _0xe91a=function(_0x256d4c,_0xe88c94){_0x256d4c=_0x256d4c-0x0;var _0x41ba4a=_0x91ae[_0x256d4c];return _0x41ba4a;};'use strict';var _=require(_0xe91a('0x0'));var util=require('util');var moment=require(_0xe91a('0x1'));var BPromise=require(_0xe91a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe91a('0x3'));var db=require(_0xe91a('0x4'))['db'];var utils=require(_0xe91a('0x5'));var logger=require(_0xe91a('0x6'))('rpc');var config=require(_0xe91a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe91a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14c63e,_0x216854,_0x5de930){return new BPromise(function(_0xbb1ca,_0x1c8215){return client['request'](_0x14c63e,_0x5de930)['then'](function(_0x54af79){logger[_0xe91a('0x9')](_0xe91a('0xa'),_0x216854,_0xe91a('0xb'));logger[_0xe91a('0xc')](_0xe91a('0xd'),_0x216854,_0xe91a('0xb'),JSON[_0xe91a('0xe')](_0x54af79));if(_0x54af79['error']){if(_0x54af79[_0xe91a('0xf')][_0xe91a('0x10')]===0x1f4){logger[_0xe91a('0xf')](_0xe91a('0xa'),_0x216854,_0x54af79[_0xe91a('0xf')][_0xe91a('0x11')]);return _0x1c8215(_0x54af79[_0xe91a('0xf')]['message']);}logger[_0xe91a('0xf')](_0xe91a('0xa'),_0x216854,_0x54af79['error'][_0xe91a('0x11')]);return _0xbb1ca(_0x54af79[_0xe91a('0xf')][_0xe91a('0x11')]);}else{logger[_0xe91a('0x9')](_0xe91a('0xa'),_0x216854,'request\x20sent');_0xbb1ca(_0x54af79['result'][_0xe91a('0x11')]);}})[_0xe91a('0x12')](function(_0x561841){logger[_0xe91a('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x216854,_0x561841);_0x1c8215(_0x561841);});});} \ No newline at end of file +var _0xd853=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4a2b3c,_0xc69f59){var _0x4b081b=function(_0x3dfcb1){while(--_0x3dfcb1){_0x4a2b3c['push'](_0x4a2b3c['shift']());}};_0x4b081b(++_0xc69f59);}(_0xd853,0x1c2));var _0x3d85=function(_0x25b430,_0x342119){_0x25b430=_0x25b430-0x0;var _0x32d9e3=_0xd853[_0x25b430];return _0x32d9e3;};'use strict';var _=require(_0x3d85('0x0'));var util=require(_0x3d85('0x1'));var moment=require(_0x3d85('0x2'));var BPromise=require(_0x3d85('0x3'));var rs=require(_0x3d85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d85('0x5'))['db'];var utils=require(_0x3d85('0x6'));var logger=require(_0x3d85('0x7'))(_0x3d85('0x8'));var config=require(_0x3d85('0x9'));var jayson=require(_0x3d85('0xa'));var client=jayson['client'][_0x3d85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x171040,_0xc3406e,_0x3106af){return new BPromise(function(_0x38f316,_0xeae9bc){return client[_0x3d85('0xc')](_0x171040,_0x3106af)[_0x3d85('0xd')](function(_0x593506){logger[_0x3d85('0xe')](_0x3d85('0xf'),_0xc3406e,_0x3d85('0x10'));logger[_0x3d85('0x11')](_0x3d85('0x12'),_0xc3406e,_0x3d85('0x10'),JSON[_0x3d85('0x13')](_0x593506));if(_0x593506[_0x3d85('0x14')]){if(_0x593506['error'][_0x3d85('0x15')]===0x1f4){logger[_0x3d85('0x14')](_0x3d85('0xf'),_0xc3406e,_0x593506[_0x3d85('0x14')]['message']);return _0xeae9bc(_0x593506[_0x3d85('0x14')]['message']);}logger[_0x3d85('0x14')](_0x3d85('0xf'),_0xc3406e,_0x593506[_0x3d85('0x14')][_0x3d85('0x16')]);return _0x38f316(_0x593506[_0x3d85('0x14')][_0x3d85('0x16')]);}else{logger[_0x3d85('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xc3406e,_0x3d85('0x10'));_0x38f316(_0x593506[_0x3d85('0x17')]['message']);}})[_0x3d85('0x18')](function(_0x1debab){logger[_0x3d85('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xc3406e,_0x1debab);_0xeae9bc(_0x1debab);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0537f8c..e79cdba 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 _0x5c3c=['describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','/describe'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x5c3c,0x136));var _0xc5c3=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x5c3c[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var path=require(_0xc5c3('0x2'));var timeout=require('connect-timeout');var express=require(_0xc5c3('0x3'));var router=express['Router']();var fs_extra=require(_0xc5c3('0x4'));var auth=require(_0xc5c3('0x5'));var interaction=require(_0xc5c3('0x6'));var config=require(_0xc5c3('0x7'));var controller=require(_0xc5c3('0x8'));router['get']('/',auth[_0xc5c3('0x9')](),controller['index']);router[_0xc5c3('0xa')](_0xc5c3('0xb'),auth[_0xc5c3('0x9')](),controller[_0xc5c3('0xc')]);router['get'](_0xc5c3('0xd'),auth[_0xc5c3('0x9')](),controller[_0xc5c3('0xe')]);router[_0xc5c3('0xa')](_0xc5c3('0xf'),auth[_0xc5c3('0x9')](),controller[_0xc5c3('0x10')]);router[_0xc5c3('0x11')]('/',auth[_0xc5c3('0x9')](),controller[_0xc5c3('0x12')]);router[_0xc5c3('0x13')](_0xc5c3('0xd'),auth[_0xc5c3('0x9')](),controller[_0xc5c3('0x14')]);router[_0xc5c3('0x15')](_0xc5c3('0xd'),auth[_0xc5c3('0x9')](),controller[_0xc5c3('0x16')]);module['exports']=router; \ No newline at end of file +var _0x5c30=['isAuthenticated','show','getQuestions','post','create','put','update','exports','util','path','connect-timeout','express','../../components/interaction/service','./jscriptySessionReport.controller','index','get','describe','/:id'];(function(_0x10f778,_0x41e1d7){var _0x5931f8=function(_0x3f6424){while(--_0x3f6424){_0x10f778['push'](_0x10f778['shift']());}};_0x5931f8(++_0x41e1d7);}(_0x5c30,0x1dc));var _0x05c3=function(_0x48d813,_0x29d6e8){_0x48d813=_0x48d813-0x0;var _0x1a4699=_0x5c30[_0x48d813];return _0x1a4699;};'use strict';var multer=require('multer');var util=require(_0x05c3('0x0'));var path=require(_0x05c3('0x1'));var timeout=require(_0x05c3('0x2'));var express=require(_0x05c3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x05c3('0x4'));var config=require('../../config/environment');var controller=require(_0x05c3('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x05c3('0x6')]);router[_0x05c3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x05c3('0x8')]);router['get'](_0x05c3('0x9'),auth[_0x05c3('0xa')](),controller[_0x05c3('0xb')]);router['get']('/:id/questions',auth[_0x05c3('0xa')](),controller[_0x05c3('0xc')]);router[_0x05c3('0xd')]('/',auth['isAuthenticated'](),controller[_0x05c3('0xe')]);router[_0x05c3('0xf')](_0x05c3('0x9'),auth[_0x05c3('0xa')](),controller[_0x05c3('0x10')]);router['delete'](_0x05c3('0x9'),auth[_0x05c3('0xa')](),controller['destroy']);module[_0x05c3('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 38c352b..d9b1521 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 _0x213d=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','starttime','setDataValue','endtime'];(function(_0x2bee13,_0x6e1114){var _0x29ee1e=function(_0x27b299){while(--_0x27b299){_0x2bee13['push'](_0x2bee13['shift']());}};_0x29ee1e(++_0x6e1114);}(_0x213d,0x1bc));var _0xd213=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x213d[_0x279d37];return _0x530173;};'use strict';var moment=require(_0xd213('0x0'));var Sequelize=require(_0xd213('0x1'));module[_0xd213('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5ae241){this['setDataValue'](_0xd213('0x3'),_0x5ae241);this[_0xd213('0x4')](_0xd213('0x5'),moment()[_0xd213('0x6')](_0xd213('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xd213('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd213('0x8')]},'calleridnum':{'type':Sequelize[_0xd213('0x8')]},'completed':{'type':Sequelize[_0xd213('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xe585=['BOOLEAN','moment','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe585,0x9a));var _0x5e58=function(_0x369f7b,_0x451c57){_0x369f7b=_0x369f7b-0x0;var _0x1e3652=_0xe585[_0x369f7b];return _0x1e3652;};'use strict';var moment=require(_0x5e58('0x0'));var Sequelize=require('sequelize');module[_0x5e58('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3e4f55){this[_0x5e58('0x2')](_0x5e58('0x3'),_0x3e4f55);this[_0x5e58('0x2')](_0x5e58('0x4'),moment()[_0x5e58('0x5')](_0x5e58('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x5e58('0x7')]},'projectname':{'type':Sequelize[_0x5e58('0x7')]},'queue':{'type':Sequelize[_0x5e58('0x7')]},'uniqueid':{'type':Sequelize[_0x5e58('0x7')]},'calleridname':{'type':Sequelize[_0x5e58('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x5e58('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 66d08ed..2e59847 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 _0xe0da=['send','JscriptySessionReport','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','map','merge','options','include','findAll','rows','show','params','includeAll','find','catch','create','update','body','describe','JscriptyQuestionReport','rawAttributes','nolimit','order','SessionId','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','apply','reject','save','then','destroy','error','name'];(function(_0x302f45,_0x56fc4c){var _0xb29ba4=function(_0x39f92c){while(--_0x39f92c){_0x302f45['push'](_0x302f45['shift']());}};_0xb29ba4(++_0x56fc4c);}(_0xe0da,0x6e));var _0xae0d=function(_0x1f1e62,_0x5d4280){_0x1f1e62=_0x1f1e62-0x0;var _0x563565=_0xe0da[_0x1f1e62];return _0x563565;};'use strict';var emlformat=require(_0xae0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae0d('0x1'));var jsonpatch=require(_0xae0d('0x2'));var rp=require('request-promise');var moment=require(_0xae0d('0x3'));var BPromise=require(_0xae0d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xae0d('0x5'));var sox=require(_0xae0d('0x6'));var csv=require(_0xae0d('0x7'));var ejs=require(_0xae0d('0x8'));var fs=require('fs');var fs_extra=require(_0xae0d('0x9'));var _=require(_0xae0d('0xa'));var squel=require('squel');var crypto=require(_0xae0d('0xb'));var jsforce=require(_0xae0d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xae0d('0xd'));var Papa=require(_0xae0d('0xe'));var Redis=require(_0xae0d('0xf'));var authService=require(_0xae0d('0x10'));var qs=require(_0xae0d('0x11'));var as=require(_0xae0d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae0d('0x13'))('api');var utils=require(_0xae0d('0x14'));var config=require(_0xae0d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xae0d('0x16'))['db'];function respondWithStatusCode(_0x4fad65,_0x16fa4a){_0x16fa4a=_0x16fa4a||0xcc;return function(_0x13c289){if(_0x13c289){return _0x4fad65[_0xae0d('0x17')](_0x16fa4a);}return _0x4fad65['status'](_0x16fa4a)[_0xae0d('0x18')]();};}function respondWithResult(_0x53223d,_0x198ae4){_0x198ae4=_0x198ae4||0xc8;return function(_0x418dbf){if(_0x418dbf){return _0x53223d[_0xae0d('0x19')](_0x198ae4)[_0xae0d('0x1a')](_0x418dbf);}};}function respondWithFilteredResult(_0x373731,_0x1f2018){return function(_0x43ed22){if(_0x43ed22){var _0x4ba0a8=typeof _0x1f2018['offset']===_0xae0d('0x1b')&&typeof _0x1f2018[_0xae0d('0x1c')]==='undefined';var _0xdfc37a=_0x43ed22['count'];var _0x3afd6c=_0x4ba0a8?0x0:_0x1f2018[_0xae0d('0x1d')];var _0x5e3e90=_0x4ba0a8?_0x43ed22[_0xae0d('0x1e')]:_0x1f2018[_0xae0d('0x1d')]+_0x1f2018['limit'];var _0x316a21;if(_0x5e3e90>=_0xdfc37a){_0x5e3e90=_0xdfc37a;_0x316a21=0xc8;}else{_0x316a21=0xce;}_0x373731[_0xae0d('0x19')](_0x316a21);return _0x373731['set']('Content-Range',_0x3afd6c+'-'+_0x5e3e90+'/'+_0xdfc37a)[_0xae0d('0x1a')](_0x43ed22);}return null;};}function patchUpdates(_0x5b7bd9){return function(_0x595e54){try{jsonpatch[_0xae0d('0x1f')](_0x595e54,_0x5b7bd9,!![]);}catch(_0xad8c38){return BPromise[_0xae0d('0x20')](_0xad8c38);}return _0x595e54[_0xae0d('0x21')]();};}function saveUpdates(_0x136c73,_0x511b83){return function(_0x45b857){if(_0x45b857){return _0x45b857['update'](_0x136c73)[_0xae0d('0x22')](function(_0x130145){return _0x130145;});}return null;};}function removeEntity(_0x366182,_0x5739f3){return function(_0x55a5b1){if(_0x55a5b1){return _0x55a5b1[_0xae0d('0x23')]()['then'](function(){_0x366182[_0xae0d('0x19')](0xcc)[_0xae0d('0x18')]();});}};}function handleEntityNotFound(_0x31ae51,_0x367d48){return function(_0x16bcd1){if(!_0x16bcd1){_0x31ae51[_0xae0d('0x17')](0x194);}return _0x16bcd1;};}function handleError(_0x44ca20,_0x2f1a98){_0x2f1a98=_0x2f1a98||0x1f4;return function(_0xca782d){logger[_0xae0d('0x24')](_0xca782d['stack']);if(_0xca782d[_0xae0d('0x25')]){delete _0xca782d[_0xae0d('0x25')];}_0x44ca20[_0xae0d('0x19')](_0x2f1a98)[_0xae0d('0x26')](_0xca782d);};}exports['index']=function(_0x5969f6,_0x1cefcf){var _0x550df7={},_0x1581a9={},_0x44871a={'count':0x0,'rows':[]};var _0x3b9b20=_['map'](db[_0xae0d('0x27')]['rawAttributes'],function(_0x17bf7d){return{'name':_0x17bf7d['fieldName'],'type':_0x17bf7d[_0xae0d('0x28')][_0xae0d('0x29')]};});_0x1581a9['model']=_['map'](_0x3b9b20,_0xae0d('0x25'));_0x1581a9[_0xae0d('0x2a')]=_[_0xae0d('0x2b')](_0x5969f6['query']);_0x1581a9[_0xae0d('0x2c')]=_['intersection'](_0x1581a9[_0xae0d('0x2d')],_0x1581a9[_0xae0d('0x2a')]);_0x550df7[_0xae0d('0x2e')]=_[_0xae0d('0x2f')](_0x1581a9['model'],qs[_0xae0d('0x30')](_0x5969f6[_0xae0d('0x2a')]['fields']));_0x550df7[_0xae0d('0x2e')]=_0x550df7[_0xae0d('0x2e')][_0xae0d('0x31')]?_0x550df7[_0xae0d('0x2e')]:_0x1581a9[_0xae0d('0x2d')];if(!_0x5969f6[_0xae0d('0x2a')][_0xae0d('0x32')]('nolimit')){_0x550df7[_0xae0d('0x1c')]=qs[_0xae0d('0x1c')](_0x5969f6['query'][_0xae0d('0x1c')]);_0x550df7[_0xae0d('0x1d')]=qs[_0xae0d('0x1d')](_0x5969f6[_0xae0d('0x2a')][_0xae0d('0x1d')]);}_0x550df7['order']=qs[_0xae0d('0x33')](_0x5969f6['query'][_0xae0d('0x33')]);_0x550df7[_0xae0d('0x34')]=qs[_0xae0d('0x2c')](_['pick'](_0x5969f6[_0xae0d('0x2a')],_0x1581a9[_0xae0d('0x2c')]),_0x3b9b20);if(_0x5969f6[_0xae0d('0x2a')][_0xae0d('0x35')]){_0x550df7[_0xae0d('0x34')]=_['merge'](_0x550df7['where'],{'$or':_[_0xae0d('0x36')](_0x3b9b20,function(_0x4378ff){if(_0x4378ff[_0xae0d('0x28')]!=='VIRTUAL'){var _0x163bbd={};_0x163bbd[_0x4378ff[_0xae0d('0x25')]]={'$like':'%'+_0x5969f6[_0xae0d('0x2a')][_0xae0d('0x35')]+'%'};return _0x163bbd;}})});}_0x550df7=_[_0xae0d('0x37')]({},_0x550df7,_0x5969f6[_0xae0d('0x38')]);var _0x3b4f45={'where':_0x550df7[_0xae0d('0x34')]};return db[_0xae0d('0x27')][_0xae0d('0x1e')](_0x3b4f45)[_0xae0d('0x22')](function(_0x4b7750){_0x44871a['count']=_0x4b7750;if(_0x5969f6['query']['includeAll']){_0x550df7[_0xae0d('0x39')]=[{'all':!![]}];}return db[_0xae0d('0x27')][_0xae0d('0x3a')](_0x550df7);})[_0xae0d('0x22')](function(_0x166b3d){_0x44871a[_0xae0d('0x3b')]=_0x166b3d;return _0x44871a;})[_0xae0d('0x22')](respondWithFilteredResult(_0x1cefcf,_0x550df7))['catch'](handleError(_0x1cefcf,null));};exports[_0xae0d('0x3c')]=function(_0x2632fe,_0x48eb04){var _0x248f05={'raw':!![],'where':{'id':_0x2632fe[_0xae0d('0x3d')]['id']}},_0x4a55e2={};_0x4a55e2[_0xae0d('0x2d')]=_[_0xae0d('0x2b')](db[_0xae0d('0x27')]['rawAttributes']);_0x4a55e2[_0xae0d('0x2a')]=_[_0xae0d('0x2b')](_0x2632fe['query']);_0x4a55e2[_0xae0d('0x2c')]=_[_0xae0d('0x2f')](_0x4a55e2[_0xae0d('0x2d')],_0x4a55e2[_0xae0d('0x2a')]);_0x248f05[_0xae0d('0x2e')]=_[_0xae0d('0x2f')](_0x4a55e2[_0xae0d('0x2d')],qs[_0xae0d('0x30')](_0x2632fe['query'][_0xae0d('0x30')]));_0x248f05[_0xae0d('0x2e')]=_0x248f05[_0xae0d('0x2e')]['length']?_0x248f05[_0xae0d('0x2e')]:_0x4a55e2[_0xae0d('0x2d')];if(_0x2632fe[_0xae0d('0x2a')][_0xae0d('0x3e')]){_0x248f05['include']=[{'all':!![]}];}_0x248f05=_[_0xae0d('0x37')]({},_0x248f05,_0x2632fe[_0xae0d('0x38')]);return db[_0xae0d('0x27')][_0xae0d('0x3f')](_0x248f05)[_0xae0d('0x22')](handleEntityNotFound(_0x48eb04,null))[_0xae0d('0x22')](respondWithResult(_0x48eb04,null))[_0xae0d('0x40')](handleError(_0x48eb04,null));};exports[_0xae0d('0x41')]=function(_0x12e40d,_0x1da4e4){return db[_0xae0d('0x27')][_0xae0d('0x41')](_0x12e40d['body'],{})[_0xae0d('0x22')](respondWithResult(_0x1da4e4,0xc9))[_0xae0d('0x40')](handleError(_0x1da4e4,null));};exports[_0xae0d('0x42')]=function(_0x38141f,_0x4cfcd0){if(_0x38141f[_0xae0d('0x43')]['id']){delete _0x38141f[_0xae0d('0x43')]['id'];}return db[_0xae0d('0x27')][_0xae0d('0x3f')]({'where':{'id':_0x38141f[_0xae0d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4cfcd0,null))[_0xae0d('0x22')](saveUpdates(_0x38141f[_0xae0d('0x43')],null))[_0xae0d('0x22')](respondWithResult(_0x4cfcd0,null))['catch'](handleError(_0x4cfcd0,null));};exports[_0xae0d('0x23')]=function(_0x1e1bf7,_0x272170){return db[_0xae0d('0x27')][_0xae0d('0x3f')]({'where':{'id':_0x1e1bf7[_0xae0d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x272170,null))[_0xae0d('0x22')](removeEntity(_0x272170,null))[_0xae0d('0x40')](handleError(_0x272170,null));};exports[_0xae0d('0x44')]=function(_0x1a2c1d,_0x7b564){return db['JscriptySessionReport'][_0xae0d('0x44')]()['then'](respondWithResult(_0x7b564,null))[_0xae0d('0x40')](handleError(_0x7b564,null));};exports['getQuestions']=function(_0x18fc79,_0x293347,_0x2c3245){var _0x33fe73={'raw':!![],'where':{}};var _0x10bb5b={};var _0x20c220={'count':0x0,'rows':[]};return db[_0xae0d('0x27')]['findOne']({'where':{'id':_0x18fc79[_0xae0d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x293347,null))['then'](function(_0x203213){if(_0x203213){_0x10bb5b[_0xae0d('0x2d')]=_['keys'](db[_0xae0d('0x45')][_0xae0d('0x46')]);_0x10bb5b[_0xae0d('0x2a')]=_[_0xae0d('0x2b')](_0x18fc79['query']);_0x10bb5b[_0xae0d('0x2c')]=_[_0xae0d('0x2f')](_0x10bb5b[_0xae0d('0x2d')],_0x10bb5b[_0xae0d('0x2a')]);_0x33fe73[_0xae0d('0x2e')]=_[_0xae0d('0x2f')](_0x10bb5b[_0xae0d('0x2d')],qs['fields'](_0x18fc79[_0xae0d('0x2a')]['fields']));_0x33fe73[_0xae0d('0x2e')]=_0x33fe73[_0xae0d('0x2e')]['length']?_0x33fe73[_0xae0d('0x2e')]:_0x10bb5b[_0xae0d('0x2d')];if(!_0x18fc79[_0xae0d('0x2a')]['hasOwnProperty'](_0xae0d('0x47'))){_0x33fe73[_0xae0d('0x1c')]=qs[_0xae0d('0x1c')](_0x18fc79['query'][_0xae0d('0x1c')]);_0x33fe73[_0xae0d('0x1d')]=qs['offset'](_0x18fc79[_0xae0d('0x2a')][_0xae0d('0x1d')]);}_0x33fe73[_0xae0d('0x48')]=qs[_0xae0d('0x33')](_0x18fc79[_0xae0d('0x2a')][_0xae0d('0x33')]);_0x33fe73['where']=qs['filters'](_['pick'](_0x18fc79[_0xae0d('0x2a')],_0x10bb5b[_0xae0d('0x2c')]));_0x33fe73[_0xae0d('0x34')][_0xae0d('0x49')]=_0x203213['id'];if(_0x18fc79[_0xae0d('0x2a')][_0xae0d('0x35')]){_0x33fe73['where']=_['merge'](_0x33fe73[_0xae0d('0x34')],{'$or':_[_0xae0d('0x36')](_0x33fe73[_0xae0d('0x2e')],function(_0x18d8dd){var _0xbc1aa5={};_0xbc1aa5[_0x18d8dd]={'$like':'%'+_0x18fc79['query'][_0xae0d('0x35')]+'%'};return _0xbc1aa5;})});}_0x33fe73=_[_0xae0d('0x37')]({},_0x33fe73,_0x18fc79[_0xae0d('0x38')]);return db[_0xae0d('0x45')][_0xae0d('0x1e')]({'where':_0x33fe73['where']})[_0xae0d('0x22')](function(_0x979548){_0x20c220[_0xae0d('0x1e')]=_0x979548;if(_0x18fc79['query'][_0xae0d('0x3e')]){_0x33fe73[_0xae0d('0x39')]=[{'all':!![]}];}return db[_0xae0d('0x45')][_0xae0d('0x3a')](_0x33fe73);})[_0xae0d('0x22')](function(_0x26b14d){_0x20c220['rows']=_0x26b14d;return _0x20c220;});}})[_0xae0d('0x22')](respondWithFilteredResult(_0x293347,_0x33fe73))[_0xae0d('0x40')](handleError(_0x293347,null));}; \ No newline at end of file +var _0x05ea=['error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','include','rows','catch','show','params','includeAll','create','body','find','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','sendStatus'];(function(_0x4f5a60,_0x337e0c){var _0x9a0ed1=function(_0x6fd951){while(--_0x6fd951){_0x4f5a60['push'](_0x4f5a60['shift']());}};_0x9a0ed1(++_0x337e0c);}(_0x05ea,0x11d));var _0xa05e=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x05ea[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0xa05e('0x0'));var rimraf=require(_0xa05e('0x1'));var zipdir=require(_0xa05e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa05e('0x3'));var moment=require(_0xa05e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa05e('0x5'));var path=require(_0xa05e('0x6'));var sox=require(_0xa05e('0x7'));var csv=require('to-csv');var ejs=require(_0xa05e('0x8'));var fs=require('fs');var fs_extra=require(_0xa05e('0x9'));var _=require(_0xa05e('0xa'));var squel=require(_0xa05e('0xb'));var crypto=require(_0xa05e('0xc'));var jsforce=require(_0xa05e('0xd'));var deskjs=require(_0xa05e('0xe'));var toCsv=require(_0xa05e('0xf'));var querystring=require('querystring');var Papa=require(_0xa05e('0x10'));var Redis=require(_0xa05e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa05e('0x12'));var hardwareService=require(_0xa05e('0x13'));var logger=require(_0xa05e('0x14'))('api');var utils=require(_0xa05e('0x15'));var config=require(_0xa05e('0x16'));var licenseUtil=require(_0xa05e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf29287,_0xd1822f){_0xd1822f=_0xd1822f||0xcc;return function(_0x75af90){if(_0x75af90){return _0xf29287['sendStatus'](_0xd1822f);}return _0xf29287[_0xa05e('0x18')](_0xd1822f)['end']();};}function respondWithResult(_0x19ee78,_0x32d137){_0x32d137=_0x32d137||0xc8;return function(_0x174299){if(_0x174299){return _0x19ee78[_0xa05e('0x18')](_0x32d137)[_0xa05e('0x19')](_0x174299);}};}function respondWithFilteredResult(_0x593ab7,_0x587885){return function(_0x4ce000){if(_0x4ce000){var _0x293cd8=typeof _0x587885[_0xa05e('0x1a')]==='undefined'&&typeof _0x587885[_0xa05e('0x1b')]==='undefined';var _0x197e44=_0x4ce000[_0xa05e('0x1c')];var _0x528c4e=_0x293cd8?0x0:_0x587885[_0xa05e('0x1a')];var _0x3682a0=_0x293cd8?_0x4ce000[_0xa05e('0x1c')]:_0x587885['offset']+_0x587885[_0xa05e('0x1b')];var _0x49b84e;if(_0x3682a0>=_0x197e44){_0x3682a0=_0x197e44;_0x49b84e=0xc8;}else{_0x49b84e=0xce;}_0x593ab7[_0xa05e('0x18')](_0x49b84e);return _0x593ab7[_0xa05e('0x1d')]('Content-Range',_0x528c4e+'-'+_0x3682a0+'/'+_0x197e44)[_0xa05e('0x19')](_0x4ce000);}return null;};}function patchUpdates(_0x25b819){return function(_0x4b9874){try{jsonpatch[_0xa05e('0x1e')](_0x4b9874,_0x25b819,!![]);}catch(_0x6165e7){return BPromise[_0xa05e('0x1f')](_0x6165e7);}return _0x4b9874[_0xa05e('0x20')]();};}function saveUpdates(_0x20730b,_0x263233){return function(_0x45345e){if(_0x45345e){return _0x45345e[_0xa05e('0x21')](_0x20730b)['then'](function(_0x58287e){return _0x58287e;});}return null;};}function removeEntity(_0x3c2ee5,_0x29cab2){return function(_0x17208b){if(_0x17208b){return _0x17208b['destroy']()['then'](function(){_0x3c2ee5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ca5f3,_0x2ddcf4){return function(_0x3cd7a8){if(!_0x3cd7a8){_0x9ca5f3[_0xa05e('0x22')](0x194);}return _0x3cd7a8;};}function handleError(_0x855f6d,_0x2525ab){_0x2525ab=_0x2525ab||0x1f4;return function(_0x39ee78){logger[_0xa05e('0x23')](_0x39ee78[_0xa05e('0x24')]);if(_0x39ee78[_0xa05e('0x25')]){delete _0x39ee78[_0xa05e('0x25')];}_0x855f6d['status'](_0x2525ab)['send'](_0x39ee78);};}exports[_0xa05e('0x26')]=function(_0x4a11ea,_0x21e318){var _0x3a57e5={},_0x4155d9={},_0x55d08c={'count':0x0,'rows':[]};var _0x3dd9ab=_[_0xa05e('0x27')](db[_0xa05e('0x28')][_0xa05e('0x29')],function(_0x507258){return{'name':_0x507258[_0xa05e('0x2a')],'type':_0x507258[_0xa05e('0x2b')][_0xa05e('0x2c')]};});_0x4155d9[_0xa05e('0x2d')]=_['map'](_0x3dd9ab,_0xa05e('0x25'));_0x4155d9['query']=_[_0xa05e('0x2e')](_0x4a11ea[_0xa05e('0x2f')]);_0x4155d9[_0xa05e('0x30')]=_[_0xa05e('0x31')](_0x4155d9[_0xa05e('0x2d')],_0x4155d9[_0xa05e('0x2f')]);_0x3a57e5[_0xa05e('0x32')]=_[_0xa05e('0x31')](_0x4155d9[_0xa05e('0x2d')],qs[_0xa05e('0x33')](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x33')]));_0x3a57e5[_0xa05e('0x32')]=_0x3a57e5['attributes'][_0xa05e('0x34')]?_0x3a57e5[_0xa05e('0x32')]:_0x4155d9[_0xa05e('0x2d')];if(!_0x4a11ea['query']['hasOwnProperty'](_0xa05e('0x35'))){_0x3a57e5[_0xa05e('0x1b')]=qs[_0xa05e('0x1b')](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x1b')]);_0x3a57e5[_0xa05e('0x1a')]=qs['offset'](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x1a')]);}_0x3a57e5[_0xa05e('0x36')]=qs['sort'](_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x37')]);_0x3a57e5['where']=qs[_0xa05e('0x30')](_[_0xa05e('0x38')](_0x4a11ea[_0xa05e('0x2f')],_0x4155d9['filters']),_0x3dd9ab);if(_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x39')]){_0x3a57e5[_0xa05e('0x3a')]=_['merge'](_0x3a57e5[_0xa05e('0x3a')],{'$or':_[_0xa05e('0x27')](_0x3dd9ab,function(_0x521b83){if(_0x521b83[_0xa05e('0x2b')]!==_0xa05e('0x3b')){var _0x5f055b={};_0x5f055b[_0x521b83['name']]={'$like':'%'+_0x4a11ea[_0xa05e('0x2f')][_0xa05e('0x39')]+'%'};return _0x5f055b;}})});}_0x3a57e5=_[_0xa05e('0x3c')]({},_0x3a57e5,_0x4a11ea[_0xa05e('0x3d')]);var _0x3496e7={'where':_0x3a57e5[_0xa05e('0x3a')]};return db[_0xa05e('0x28')][_0xa05e('0x1c')](_0x3496e7)[_0xa05e('0x3e')](function(_0x4ce6ab){_0x55d08c[_0xa05e('0x1c')]=_0x4ce6ab;if(_0x4a11ea[_0xa05e('0x2f')]['includeAll']){_0x3a57e5[_0xa05e('0x3f')]=[{'all':!![]}];}return db[_0xa05e('0x28')]['findAll'](_0x3a57e5);})['then'](function(_0x3db1aa){_0x55d08c[_0xa05e('0x40')]=_0x3db1aa;return _0x55d08c;})['then'](respondWithFilteredResult(_0x21e318,_0x3a57e5))[_0xa05e('0x41')](handleError(_0x21e318,null));};exports[_0xa05e('0x42')]=function(_0x541820,_0x20c0c1){var _0x4d07bc={'raw':!![],'where':{'id':_0x541820[_0xa05e('0x43')]['id']}},_0x4a6897={};_0x4a6897[_0xa05e('0x2d')]=_['keys'](db['JscriptySessionReport'][_0xa05e('0x29')]);_0x4a6897[_0xa05e('0x2f')]=_[_0xa05e('0x2e')](_0x541820[_0xa05e('0x2f')]);_0x4a6897[_0xa05e('0x30')]=_[_0xa05e('0x31')](_0x4a6897[_0xa05e('0x2d')],_0x4a6897['query']);_0x4d07bc[_0xa05e('0x32')]=_[_0xa05e('0x31')](_0x4a6897[_0xa05e('0x2d')],qs[_0xa05e('0x33')](_0x541820['query'][_0xa05e('0x33')]));_0x4d07bc['attributes']=_0x4d07bc[_0xa05e('0x32')]['length']?_0x4d07bc[_0xa05e('0x32')]:_0x4a6897[_0xa05e('0x2d')];if(_0x541820['query'][_0xa05e('0x44')]){_0x4d07bc[_0xa05e('0x3f')]=[{'all':!![]}];}_0x4d07bc=_[_0xa05e('0x3c')]({},_0x4d07bc,_0x541820['options']);return db['JscriptySessionReport']['find'](_0x4d07bc)[_0xa05e('0x3e')](handleEntityNotFound(_0x20c0c1,null))[_0xa05e('0x3e')](respondWithResult(_0x20c0c1,null))[_0xa05e('0x41')](handleError(_0x20c0c1,null));};exports[_0xa05e('0x45')]=function(_0x432f97,_0x5aacbd){return db[_0xa05e('0x28')]['create'](_0x432f97[_0xa05e('0x46')],{})['then'](respondWithResult(_0x5aacbd,0xc9))['catch'](handleError(_0x5aacbd,null));};exports[_0xa05e('0x21')]=function(_0x48d745,_0x4a51c6){if(_0x48d745[_0xa05e('0x46')]['id']){delete _0x48d745[_0xa05e('0x46')]['id'];}return db[_0xa05e('0x28')][_0xa05e('0x47')]({'where':{'id':_0x48d745['params']['id']}})[_0xa05e('0x3e')](handleEntityNotFound(_0x4a51c6,null))['then'](saveUpdates(_0x48d745[_0xa05e('0x46')],null))[_0xa05e('0x3e')](respondWithResult(_0x4a51c6,null))[_0xa05e('0x41')](handleError(_0x4a51c6,null));};exports[_0xa05e('0x48')]=function(_0x1cbc7e,_0x369207){return db[_0xa05e('0x28')][_0xa05e('0x47')]({'where':{'id':_0x1cbc7e['params']['id']}})['then'](handleEntityNotFound(_0x369207,null))[_0xa05e('0x3e')](removeEntity(_0x369207,null))[_0xa05e('0x41')](handleError(_0x369207,null));};exports['describe']=function(_0x16e26e,_0x577971){return db['JscriptySessionReport'][_0xa05e('0x49')]()['then'](respondWithResult(_0x577971,null))[_0xa05e('0x41')](handleError(_0x577971,null));};exports[_0xa05e('0x4a')]=function(_0x25f85a,_0x325554,_0x34459d){var _0x2086b4={'raw':!![],'where':{}};var _0x2d3f8f={};var _0x29923f={'count':0x0,'rows':[]};return db[_0xa05e('0x28')][_0xa05e('0x4b')]({'where':{'id':_0x25f85a[_0xa05e('0x43')]['id']}})[_0xa05e('0x3e')](handleEntityNotFound(_0x325554,null))[_0xa05e('0x3e')](function(_0xe32cf0){if(_0xe32cf0){_0x2d3f8f[_0xa05e('0x2d')]=_['keys'](db[_0xa05e('0x4c')][_0xa05e('0x29')]);_0x2d3f8f[_0xa05e('0x2f')]=_['keys'](_0x25f85a[_0xa05e('0x2f')]);_0x2d3f8f['filters']=_[_0xa05e('0x31')](_0x2d3f8f['model'],_0x2d3f8f[_0xa05e('0x2f')]);_0x2086b4[_0xa05e('0x32')]=_[_0xa05e('0x31')](_0x2d3f8f[_0xa05e('0x2d')],qs[_0xa05e('0x33')](_0x25f85a[_0xa05e('0x2f')][_0xa05e('0x33')]));_0x2086b4['attributes']=_0x2086b4['attributes']['length']?_0x2086b4['attributes']:_0x2d3f8f[_0xa05e('0x2d')];if(!_0x25f85a[_0xa05e('0x2f')][_0xa05e('0x4d')]('nolimit')){_0x2086b4[_0xa05e('0x1b')]=qs[_0xa05e('0x1b')](_0x25f85a['query'][_0xa05e('0x1b')]);_0x2086b4[_0xa05e('0x1a')]=qs[_0xa05e('0x1a')](_0x25f85a[_0xa05e('0x2f')][_0xa05e('0x1a')]);}_0x2086b4[_0xa05e('0x36')]=qs[_0xa05e('0x37')](_0x25f85a['query'][_0xa05e('0x37')]);_0x2086b4[_0xa05e('0x3a')]=qs[_0xa05e('0x30')](_['pick'](_0x25f85a[_0xa05e('0x2f')],_0x2d3f8f[_0xa05e('0x30')]));_0x2086b4[_0xa05e('0x3a')][_0xa05e('0x4e')]=_0xe32cf0['id'];if(_0x25f85a['query']['filter']){_0x2086b4[_0xa05e('0x3a')]=_[_0xa05e('0x3c')](_0x2086b4['where'],{'$or':_['map'](_0x2086b4[_0xa05e('0x32')],function(_0x28cd1b){var _0xa108c9={};_0xa108c9[_0x28cd1b]={'$like':'%'+_0x25f85a['query'][_0xa05e('0x39')]+'%'};return _0xa108c9;})});}_0x2086b4=_[_0xa05e('0x3c')]({},_0x2086b4,_0x25f85a[_0xa05e('0x3d')]);return db[_0xa05e('0x4c')][_0xa05e('0x1c')]({'where':_0x2086b4[_0xa05e('0x3a')]})[_0xa05e('0x3e')](function(_0x3a65ef){_0x29923f[_0xa05e('0x1c')]=_0x3a65ef;if(_0x25f85a[_0xa05e('0x2f')]['includeAll']){_0x2086b4[_0xa05e('0x3f')]=[{'all':!![]}];}return db[_0xa05e('0x4c')][_0xa05e('0x4f')](_0x2086b4);})[_0xa05e('0x3e')](function(_0x2cd7ab){_0x29923f[_0xa05e('0x40')]=_0x2cd7ab;return _0x29923f;});}})['then'](respondWithFilteredResult(_0x325554,_0x2086b4))[_0xa05e('0x41')](handleError(_0x325554,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 478f5fa..a78b1a7 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 _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x38c760,_0xfa9818){var _0x4a5b19=function(_0x5dcc1f){while(--_0x5dcc1f){_0x38c760['push'](_0x38c760['shift']());}};_0x4a5b19(++_0xfa9818);}(_0x5d17,0x114));var _0x75d1=function(_0x46066f,_0x23105c){_0x46066f=_0x46066f-0x0;var _0x411977=_0x5d17[_0x46066f];return _0x411977;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbf5=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0xc4966b,_0x6cd5e0){var _0x1802bb=function(_0x12f623){while(--_0x12f623){_0xc4966b['push'](_0xc4966b['shift']());}};_0x1802bb(++_0x6cd5e0);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1e2720,_0x9fe431){_0x1e2720=_0x1e2720-0x0;var _0x3752fc=_0xdbf5[_0x1e2720];return _0x3752fc;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'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 dd48af5..f567ab1 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 _0x0adf=['request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x19046c,_0x2494b5){var _0x469c79=function(_0x59cd03){while(--_0x59cd03){_0x19046c['push'](_0x19046c['shift']());}};_0x469c79(++_0x2494b5);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x436757,_0x9a71ab){_0x436757=_0x436757-0x0;var _0x5443d9=_0x0adf[_0x436757];return _0x5443d9;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0ad('0x3'));var fs=require('fs');var Redis=require(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var utils=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));var config=require(_0xf0ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eca0e,_0x44cf37,_0x170574){return new BPromise(function(_0x41c99d,_0xa9a315){return client[_0xf0ad('0xb')](_0x2eca0e,_0x170574)[_0xf0ad('0xc')](function(_0x5bdf69){logger[_0xf0ad('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x44cf37,_0xf0ad('0xe'));logger[_0xf0ad('0xf')](_0xf0ad('0x10'),_0x44cf37,_0xf0ad('0xe'),JSON[_0xf0ad('0x11')](_0x5bdf69));if(_0x5bdf69['error']){if(_0x5bdf69['error'][_0xf0ad('0x12')]===0x1f4){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x5bdf69[_0xf0ad('0x13')]['message']);return _0xa9a315(_0x5bdf69[_0xf0ad('0x13')][_0xf0ad('0x15')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x44cf37,_0x5bdf69['error'][_0xf0ad('0x15')]);return _0x41c99d(_0x5bdf69['error'][_0xf0ad('0x15')]);}else{logger[_0xf0ad('0xd')](_0xf0ad('0x14'),_0x44cf37,_0xf0ad('0xe'));_0x41c99d(_0x5bdf69[_0xf0ad('0x16')]['message']);}})[_0xf0ad('0x17')](function(_0x285ab0){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x285ab0);_0xa9a315(_0x285ab0);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xb8d37c,_0x10a6a4){var _0x400f4b=function(_0x479ae1){while(--_0x479ae1){_0xb8d37c['push'](_0xb8d37c['shift']());}};_0x400f4b(++_0x10a6a4);}(_0x5fab,0x177));var _0xb5fa=function(_0x56456b,_0x5babd7){_0x56456b=_0x56456b-0x0;var _0x37da11=_0x5fab[_0x56456b];return _0x37da11;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 1952a13..803d723 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 _0x9038=['/:id','update','/download_log_file','isAuthenticated','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put'];(function(_0x1551aa,_0x9bb63b){var _0x3758f8=function(_0x5aa70e){while(--_0x5aa70e){_0x1551aa['push'](_0x1551aa['shift']());}};_0x3758f8(++_0x9bb63b);}(_0x9038,0xa4));var _0x8903=function(_0x1686bf,_0x18fb2b){_0x1686bf=_0x1686bf-0x0;var _0x51335b=_0x9038[_0x1686bf];return _0x51335b;};'use strict';var multer=require(_0x8903('0x0'));var util=require(_0x8903('0x1'));var path=require('path');var timeout=require(_0x8903('0x2'));var express=require(_0x8903('0x3'));var router=express[_0x8903('0x4')]();var fs_extra=require(_0x8903('0x5'));var auth=require(_0x8903('0x6'));var interaction=require(_0x8903('0x7'));var config=require('../../config/environment');var controller=require(_0x8903('0x8'));router[_0x8903('0x9')]('/',controller[_0x8903('0xa')]);router[_0x8903('0xb')](_0x8903('0xc'),auth['isAuthenticated'](),controller[_0x8903('0xd')]);router['get'](_0x8903('0xe'),auth[_0x8903('0xf')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file +var _0xb2db=['fs-extra','../../components/auth/service','../../config/environment','index','put','update','get','isAuthenticated','downloadLogFile','exports','multer','path','connect-timeout','express'];(function(_0x552ac5,_0x360a34){var _0x3e7286=function(_0x4db179){while(--_0x4db179){_0x552ac5['push'](_0x552ac5['shift']());}};_0x3e7286(++_0x360a34);}(_0xb2db,0x1d8));var _0xbb2d=function(_0x4a1d76,_0x289b80){_0x4a1d76=_0x4a1d76-0x0;var _0x3c1731=_0xb2db[_0x4a1d76];return _0x3c1731;};'use strict';var multer=require(_0xbb2d('0x0'));var util=require('util');var path=require(_0xbb2d('0x1'));var timeout=require(_0xbb2d('0x2'));var express=require(_0xbb2d('0x3'));var router=express['Router']();var fs_extra=require(_0xbb2d('0x4'));var auth=require(_0xbb2d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb2d('0x6'));var controller=require('./license.controller');router['get']('/',controller[_0xbb2d('0x7')]);router[_0xbb2d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbb2d('0x9')]);router[_0xbb2d('0xa')]('/download_log_file',auth[_0xbb2d('0xb')](),controller[_0xbb2d('0xc')]);module[_0xbb2d('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 8ec2413..f0e020b 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 _0x36e3=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x36e3,0xe8));var _0x336e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x36e3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x336e('0x0'));module[_0x336e('0x1')]={'license':{'type':Sequelize[_0x336e('0x2')]},'data1':{'type':Sequelize[_0x336e('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x336e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb987=['sequelize','exports','TEXT','INTEGER'];(function(_0x30dace,_0x160f9f){var _0x373d35=function(_0x838234){while(--_0x838234){_0x30dace['push'](_0x30dace['shift']());}};_0x373d35(++_0x160f9f);}(_0xb987,0x98));var _0x7b98=function(_0x51ba3c,_0xc2d5b5){_0x51ba3c=_0x51ba3c-0x0;var _0x147cf6=_0xb987[_0x51ba3c];return _0x147cf6;};'use strict';var Sequelize=require(_0x7b98('0x0'));module[_0x7b98('0x1')]={'license':{'type':Sequelize[_0x7b98('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x7b98('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 11e9859..11a0242 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 _0x336f=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','stack','name','../../config/license/util','index','keys','query','filters','intersection','model','attributes','fields','merge','options','catch','body','find','params','checkLicense','downloadLogFile','license-info.log','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x4f5e17,_0x43041e){var _0x4a76a1=function(_0x1a4f2d){while(--_0x1a4f2d){_0x4f5e17['push'](_0x4f5e17['shift']());}};_0x4a76a1(++_0x43041e);}(_0x336f,0x1b7));var _0xf336=function(_0x1576f1,_0xf69fb6){_0x1576f1=_0x1576f1-0x0;var _0x334b28=_0x336f[_0x1576f1];return _0x334b28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf336('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf336('0x1'));var moment=require(_0xf336('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf336('0x3'));var util=require(_0xf336('0x4'));var path=require(_0xf336('0x5'));var sox=require(_0xf336('0x6'));var csv=require(_0xf336('0x7'));var ejs=require(_0xf336('0x8'));var fs=require('fs');var fs_extra=require(_0xf336('0x9'));var _=require(_0xf336('0xa'));var squel=require(_0xf336('0xb'));var crypto=require(_0xf336('0xc'));var jsforce=require(_0xf336('0xd'));var deskjs=require(_0xf336('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf336('0xf'));var Redis=require(_0xf336('0x10'));var authService=require(_0xf336('0x11'));var qs=require(_0xf336('0x12'));var as=require(_0xf336('0x13'));var hardwareService=require(_0xf336('0x14'));var logger=require(_0xf336('0x15'))('api');var utils=require(_0xf336('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf336('0x17'))['db'];function respondWithStatusCode(_0x496f26,_0x63c20){_0x63c20=_0x63c20||0xcc;return function(_0x1db5e6){if(_0x1db5e6){return _0x496f26[_0xf336('0x18')](_0x63c20);}return _0x496f26[_0xf336('0x19')](_0x63c20)[_0xf336('0x1a')]();};}function respondWithResult(_0x10aca8,_0x1ceca7){_0x1ceca7=_0x1ceca7||0xc8;return function(_0x563833){if(_0x563833){return _0x10aca8['status'](_0x1ceca7)[_0xf336('0x1b')](_0x563833);}};}function respondWithFilteredResult(_0x2d7d7d,_0x2061ba){return function(_0x39569f){if(_0x39569f){var _0x4d0225=typeof _0x2061ba['offset']===_0xf336('0x1c')&&typeof _0x2061ba[_0xf336('0x1d')]===_0xf336('0x1c');var _0x4f5829=_0x39569f[_0xf336('0x1e')];var _0x5810d7=_0x4d0225?0x0:_0x2061ba[_0xf336('0x1f')];var _0x1f453e=_0x4d0225?_0x39569f[_0xf336('0x1e')]:_0x2061ba['offset']+_0x2061ba[_0xf336('0x1d')];var _0x4ab563;if(_0x1f453e>=_0x4f5829){_0x1f453e=_0x4f5829;_0x4ab563=0xc8;}else{_0x4ab563=0xce;}_0x2d7d7d[_0xf336('0x19')](_0x4ab563);return _0x2d7d7d[_0xf336('0x20')]('Content-Range',_0x5810d7+'-'+_0x1f453e+'/'+_0x4f5829)[_0xf336('0x1b')](_0x39569f);}return null;};}function patchUpdates(_0x4c1048){return function(_0xab27f5){try{jsonpatch['apply'](_0xab27f5,_0x4c1048,!![]);}catch(_0x5b998b){return BPromise[_0xf336('0x21')](_0x5b998b);}return _0xab27f5[_0xf336('0x22')]();};}function saveUpdates(_0x521ff5,_0x2cefc3){return function(_0x20fa63){if(_0x20fa63){return _0x20fa63[_0xf336('0x23')](_0x521ff5)[_0xf336('0x24')](function(_0x44eef9){return _0x44eef9;});}return null;};}function removeEntity(_0x51d0ec,_0x4d8409){return function(_0x14ff29){if(_0x14ff29){return _0x14ff29['destroy']()[_0xf336('0x24')](function(){_0x51d0ec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1302fd,_0x3bd130){return function(_0x1922ae){if(!_0x1922ae){_0x1302fd[_0xf336('0x18')](0x194);}return _0x1922ae;};}function handleError(_0x1c51f4,_0x4b85c1){_0x4b85c1=_0x4b85c1||0x1f4;return function(_0x51ee28){logger['error'](_0x51ee28[_0xf336('0x25')]);if(_0x51ee28[_0xf336('0x26')]){delete _0x51ee28[_0xf336('0x26')];}_0x1c51f4[_0xf336('0x19')](_0x4b85c1)['send'](_0x51ee28);};}var utilLicense=require(_0xf336('0x27'));exports[_0xf336('0x28')]=function(_0x4fb79d,_0x418a94){var _0x22f857={'raw':!![],'where':{'id':0x1}},_0xc6dd71={};_0xc6dd71['model']=_[_0xf336('0x29')](db['License']['rawAttributes']);_0xc6dd71[_0xf336('0x2a')]=_[_0xf336('0x29')](_0x4fb79d[_0xf336('0x2a')]);_0xc6dd71[_0xf336('0x2b')]=_[_0xf336('0x2c')](_0xc6dd71[_0xf336('0x2d')],_0xc6dd71[_0xf336('0x2a')]);_0x22f857[_0xf336('0x2e')]=_[_0xf336('0x2c')](_0xc6dd71[_0xf336('0x2d')],qs[_0xf336('0x2f')](_0x4fb79d[_0xf336('0x2a')][_0xf336('0x2f')]));_0x22f857[_0xf336('0x2e')]=_0x22f857[_0xf336('0x2e')]['length']?_0x22f857[_0xf336('0x2e')]:_0xc6dd71[_0xf336('0x2d')];_0x22f857=_[_0xf336('0x30')]({},_0x22f857,_0x4fb79d[_0xf336('0x31')]);return utilLicense['getLicense'](_0x22f857)[_0xf336('0x24')](respondWithResult(_0x418a94,null))[_0xf336('0x32')](handleError(_0x418a94,null));};exports[_0xf336('0x23')]=function(_0x2285ae,_0x210902){if(_0x2285ae['body']['id']){delete _0x2285ae[_0xf336('0x33')]['id'];}return db['License'][_0xf336('0x34')]({'where':{'id':_0x2285ae[_0xf336('0x35')]['id']}})['then'](handleEntityNotFound(_0x210902,null))[_0xf336('0x24')](function(_0x5af9ad){var _0x124ec3=_0x5af9ad['get']({'plain':!![]});return utilLicense[_0xf336('0x36')](_0x124ec3,_0x2285ae['body']['key']);})['then'](function(_0x4be018){if(!_0x4be018['demo']){return saveUpdates(_0x2285ae[_0xf336('0x33')],null);}return _0x4be018;})[_0xf336('0x24')](respondWithResult(_0x210902,null))[_0xf336('0x32')](handleError(_0x210902,null));};exports[_0xf336('0x37')]=function(_0x27e4c4,_0xfae9ef){var _0x3a161e=_0xf336('0x38');var _0x1d7c3a=path['join'](_0xf336('0x39'),'log',_0xf336('0x3a'),_0x3a161e);_0xfae9ef[_0xf336('0x3b')](_0xf336('0x3c'),_0xf336('0x3d')+_0x3a161e);_0xfae9ef[_0xf336('0x20')](_0xf336('0x3e'),_0xf336('0x3f'));_0xfae9ef[_0xf336('0x40')](_0x1d7c3a);}; \ No newline at end of file +var _0xe8d2=['update','then','destroy','error','name','send','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','merge','options','getLicense','body','find','checkLicense','key','catch','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','save'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe8d2,0xac));var _0x2e8d=function(_0x231fe7,_0xb617ba){_0x231fe7=_0x231fe7-0x0;var _0x3dc2ab=_0xe8d2[_0x231fe7];return _0x3dc2ab;};'use strict';var emlformat=require(_0x2e8d('0x0'));var rimraf=require(_0x2e8d('0x1'));var zipdir=require(_0x2e8d('0x2'));var jsonpatch=require(_0x2e8d('0x3'));var rp=require(_0x2e8d('0x4'));var moment=require(_0x2e8d('0x5'));var BPromise=require(_0x2e8d('0x6'));var Mustache=require(_0x2e8d('0x7'));var util=require(_0x2e8d('0x8'));var path=require('path');var sox=require(_0x2e8d('0x9'));var csv=require(_0x2e8d('0xa'));var ejs=require(_0x2e8d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2e8d('0xc'));var crypto=require(_0x2e8d('0xd'));var jsforce=require(_0x2e8d('0xe'));var deskjs=require(_0x2e8d('0xf'));var toCsv=require(_0x2e8d('0xa'));var querystring=require('querystring');var Papa=require(_0x2e8d('0x10'));var Redis=require(_0x2e8d('0x11'));var authService=require(_0x2e8d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2e8d('0x13'));var hardwareService=require(_0x2e8d('0x14'));var logger=require(_0x2e8d('0x15'))('api');var utils=require(_0x2e8d('0x16'));var config=require(_0x2e8d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x340dad,_0x115a95){_0x115a95=_0x115a95||0xcc;return function(_0x4db608){if(_0x4db608){return _0x340dad[_0x2e8d('0x18')](_0x115a95);}return _0x340dad['status'](_0x115a95)[_0x2e8d('0x19')]();};}function respondWithResult(_0x33bebf,_0x5e0847){_0x5e0847=_0x5e0847||0xc8;return function(_0x15cb65){if(_0x15cb65){return _0x33bebf[_0x2e8d('0x1a')](_0x5e0847)[_0x2e8d('0x1b')](_0x15cb65);}};}function respondWithFilteredResult(_0x4abec6,_0xf533a6){return function(_0x49420a){if(_0x49420a){var _0x3f29a3=typeof _0xf533a6[_0x2e8d('0x1c')]===_0x2e8d('0x1d')&&typeof _0xf533a6['limit']===_0x2e8d('0x1d');var _0x1d5a5c=_0x49420a[_0x2e8d('0x1e')];var _0x4955d6=_0x3f29a3?0x0:_0xf533a6[_0x2e8d('0x1c')];var _0x49268f=_0x3f29a3?_0x49420a[_0x2e8d('0x1e')]:_0xf533a6[_0x2e8d('0x1c')]+_0xf533a6[_0x2e8d('0x1f')];var _0x5970f9;if(_0x49268f>=_0x1d5a5c){_0x49268f=_0x1d5a5c;_0x5970f9=0xc8;}else{_0x5970f9=0xce;}_0x4abec6['status'](_0x5970f9);return _0x4abec6['set']('Content-Range',_0x4955d6+'-'+_0x49268f+'/'+_0x1d5a5c)[_0x2e8d('0x1b')](_0x49420a);}return null;};}function patchUpdates(_0x1cc0ec){return function(_0x343b3d){try{jsonpatch[_0x2e8d('0x20')](_0x343b3d,_0x1cc0ec,!![]);}catch(_0x171015){return BPromise[_0x2e8d('0x21')](_0x171015);}return _0x343b3d[_0x2e8d('0x22')]();};}function saveUpdates(_0x575777,_0x20aac2){return function(_0x31f78c){if(_0x31f78c){return _0x31f78c[_0x2e8d('0x23')](_0x575777)[_0x2e8d('0x24')](function(_0x4aca53){return _0x4aca53;});}return null;};}function removeEntity(_0x578dc2,_0xcdbac6){return function(_0x5403b7){if(_0x5403b7){return _0x5403b7[_0x2e8d('0x25')]()['then'](function(){_0x578dc2[_0x2e8d('0x1a')](0xcc)[_0x2e8d('0x19')]();});}};}function handleEntityNotFound(_0x2ac264,_0x5f57d8){return function(_0x33095f){if(!_0x33095f){_0x2ac264[_0x2e8d('0x18')](0x194);}return _0x33095f;};}function handleError(_0x2b8df0,_0x16a472){_0x16a472=_0x16a472||0x1f4;return function(_0x294c3a){logger[_0x2e8d('0x26')](_0x294c3a['stack']);if(_0x294c3a['name']){delete _0x294c3a[_0x2e8d('0x27')];}_0x2b8df0[_0x2e8d('0x1a')](_0x16a472)[_0x2e8d('0x28')](_0x294c3a);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x5d52b2,_0x52ef78){var _0x3f39e1={'raw':!![],'where':{'id':0x1}},_0x4fa799={};_0x4fa799[_0x2e8d('0x29')]=_[_0x2e8d('0x2a')](db[_0x2e8d('0x2b')][_0x2e8d('0x2c')]);_0x4fa799['query']=_['keys'](_0x5d52b2[_0x2e8d('0x2d')]);_0x4fa799[_0x2e8d('0x2e')]=_['intersection'](_0x4fa799[_0x2e8d('0x29')],_0x4fa799[_0x2e8d('0x2d')]);_0x3f39e1[_0x2e8d('0x2f')]=_[_0x2e8d('0x30')](_0x4fa799[_0x2e8d('0x29')],qs[_0x2e8d('0x31')](_0x5d52b2[_0x2e8d('0x2d')][_0x2e8d('0x31')]));_0x3f39e1[_0x2e8d('0x2f')]=_0x3f39e1['attributes'][_0x2e8d('0x32')]?_0x3f39e1[_0x2e8d('0x2f')]:_0x4fa799['model'];_0x3f39e1=_[_0x2e8d('0x33')]({},_0x3f39e1,_0x5d52b2[_0x2e8d('0x34')]);return utilLicense[_0x2e8d('0x35')](_0x3f39e1)['then'](respondWithResult(_0x52ef78,null))['catch'](handleError(_0x52ef78,null));};exports['update']=function(_0x2ab21e,_0x59fa0c){if(_0x2ab21e[_0x2e8d('0x36')]['id']){delete _0x2ab21e[_0x2e8d('0x36')]['id'];}return db[_0x2e8d('0x2b')][_0x2e8d('0x37')]({'where':{'id':_0x2ab21e['params']['id']}})['then'](handleEntityNotFound(_0x59fa0c,null))['then'](function(_0x114435){var _0x47eba6=_0x114435['get']({'plain':!![]});return utilLicense[_0x2e8d('0x38')](_0x47eba6,_0x2ab21e['body'][_0x2e8d('0x39')]);})[_0x2e8d('0x24')](function(_0x28796d){if(!_0x28796d['demo']){return saveUpdates(_0x2ab21e[_0x2e8d('0x36')],null);}return _0x28796d;})['then'](respondWithResult(_0x59fa0c,null))[_0x2e8d('0x3a')](handleError(_0x59fa0c,null));};exports['downloadLogFile']=function(_0x2c64e0,_0x3ef524){var _0x314591=_0x2e8d('0x3b');var _0x3297ae=path[_0x2e8d('0x3c')](_0x2e8d('0x3d'),_0x2e8d('0x3e'),_0x2e8d('0x3f'),_0x314591);_0x3ef524[_0x2e8d('0x40')](_0x2e8d('0x41'),_0x2e8d('0x42')+_0x314591);_0x3ef524['set']('Content-Type',_0x2e8d('0x43'));_0x3ef524[_0x2e8d('0x44')](_0x3297ae);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 7eb1bd0..6eb784d 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 _0xa59a=['moment','bluebird','rimraf','./license.attributes','exports','define','License','license','util','api'];(function(_0xfbcec7,_0x24d860){var _0x1d8626=function(_0x4f739a){while(--_0x4f739a){_0xfbcec7['push'](_0xfbcec7['shift']());}};_0x1d8626(++_0x24d860);}(_0xa59a,0x1b6));var _0xaa59=function(_0x3db97c,_0xce9be){_0x3db97c=_0x3db97c-0x0;var _0x3b8786=_0xa59a[_0x3db97c];return _0x3b8786;};'use strict';var _=require('lodash');var util=require(_0xaa59('0x0'));var logger=require('../../config/logger')(_0xaa59('0x1'));var moment=require(_0xaa59('0x2'));var BPromise=require(_0xaa59('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa59('0x4'));var config=require('../../config/environment');var attributes=require(_0xaa59('0x5'));module[_0xaa59('0x6')]=function(_0x19837a,_0x6584d4){return _0x19837a[_0xaa59('0x7')](_0xaa59('0x8'),attributes,{'tableName':_0xaa59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93ca=['License','license','lodash','util','../../config/logger','path','rimraf','../../config/environment','define'];(function(_0x1f8679,_0x58bd3a){var _0x31f86f=function(_0x12c327){while(--_0x12c327){_0x1f8679['push'](_0x1f8679['shift']());}};_0x31f86f(++_0x58bd3a);}(_0x93ca,0xec));var _0xa93c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ca[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa93c('0x0'));var util=require(_0xa93c('0x1'));var logger=require(_0xa93c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa93c('0x3'));var rimraf=require(_0xa93c('0x4'));var config=require(_0xa93c('0x5'));var attributes=require('./license.attributes');module['exports']=function(_0x5076b4,_0x15724e){return _0x5076b4[_0xa93c('0x6')](_0xa93c('0x7'),attributes,{'tableName':_0xa93c('0x8'),'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 def9fc7..8f69499 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 _0x3ace=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x56c5a7,_0x185c0a){var _0x35f4d2=function(_0x429104){while(--_0x429104){_0x56c5a7['push'](_0x56c5a7['shift']());}};_0x35f4d2(++_0x185c0a);}(_0x3ace,0x1b4));var _0xe3ac=function(_0x217876,_0x8ae441){_0x217876=_0x217876-0x0;var _0x53b04c=_0x3ace[_0x217876];return _0x53b04c;};'use strict';var _=require(_0xe3ac('0x0'));var util=require('util');var moment=require(_0xe3ac('0x1'));var BPromise=require(_0xe3ac('0x2'));var rs=require(_0xe3ac('0x3'));var fs=require('fs');var Redis=require(_0xe3ac('0x4'));var db=require(_0xe3ac('0x5'))['db'];var utils=require(_0xe3ac('0x6'));var logger=require(_0xe3ac('0x7'))('rpc');var config=require(_0xe3ac('0x8'));var jayson=require(_0xe3ac('0x9'));var client=jayson[_0xe3ac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3610ee,_0x109f71,_0x4e1eaa){return new BPromise(function(_0x47940c,_0x501cd8){return client['request'](_0x3610ee,_0x4e1eaa)[_0xe3ac('0xb')](function(_0x54b586){logger['info'](_0xe3ac('0xc'),_0x109f71,_0xe3ac('0xd'));logger[_0xe3ac('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x109f71,_0xe3ac('0xd'),JSON[_0xe3ac('0xf')](_0x54b586));if(_0x54b586[_0xe3ac('0x10')]){if(_0x54b586[_0xe3ac('0x10')][_0xe3ac('0x11')]===0x1f4){logger[_0xe3ac('0x10')](_0xe3ac('0xc'),_0x109f71,_0x54b586[_0xe3ac('0x10')][_0xe3ac('0x12')]);return _0x501cd8(_0x54b586[_0xe3ac('0x10')]['message']);}logger['error'](_0xe3ac('0xc'),_0x109f71,_0x54b586['error']['message']);return _0x47940c(_0x54b586[_0xe3ac('0x10')][_0xe3ac('0x12')]);}else{logger[_0xe3ac('0x13')]('License,\x20%s,\x20%s',_0x109f71,_0xe3ac('0xd'));_0x47940c(_0x54b586['result'][_0xe3ac('0x12')]);}})[_0xe3ac('0x14')](function(_0x18e7a2){logger[_0xe3ac('0x10')](_0xe3ac('0xc'),_0x109f71,_0x18e7a2);_0x501cd8(_0x18e7a2);});});} \ No newline at end of file +var _0x3b78=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x3b78,0x18e));var _0x83b7=function(_0xc971a4,_0x5b381c){_0xc971a4=_0xc971a4-0x0;var _0x4ebd6b=_0x3b78[_0xc971a4];return _0x4ebd6b;};'use strict';var _=require(_0x83b7('0x0'));var util=require(_0x83b7('0x1'));var moment=require(_0x83b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x83b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83b7('0x4'))['db'];var utils=require(_0x83b7('0x5'));var logger=require('../../config/logger')(_0x83b7('0x6'));var config=require(_0x83b7('0x7'));var jayson=require(_0x83b7('0x8'));var client=jayson[_0x83b7('0x9')][_0x83b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13079a,_0x32ecd1,_0x2b1ed7){return new BPromise(function(_0x319a1c,_0x3626c8){return client['request'](_0x13079a,_0x2b1ed7)[_0x83b7('0xb')](function(_0x4bdcfd){logger[_0x83b7('0xc')](_0x83b7('0xd'),_0x32ecd1,'request\x20sent');logger[_0x83b7('0xe')](_0x83b7('0xf'),_0x32ecd1,_0x83b7('0x10'),JSON[_0x83b7('0x11')](_0x4bdcfd));if(_0x4bdcfd[_0x83b7('0x12')]){if(_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x13')]===0x1f4){logger[_0x83b7('0x12')](_0x83b7('0xd'),_0x32ecd1,_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);return _0x3626c8(_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);}logger[_0x83b7('0x12')](_0x83b7('0xd'),_0x32ecd1,_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);return _0x319a1c(_0x4bdcfd[_0x83b7('0x12')][_0x83b7('0x14')]);}else{logger[_0x83b7('0xc')](_0x83b7('0xd'),_0x32ecd1,_0x83b7('0x10'));_0x319a1c(_0x4bdcfd[_0x83b7('0x15')][_0x83b7('0x14')]);}})['catch'](function(_0x3a5574){logger['error'](_0x83b7('0xd'),_0x32ecd1,_0x3a5574);_0x3626c8(_0x3a5574);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f5b05b8..4512dfa 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 _0x9b17=['verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','delete','removeDispositions','removeAnswers','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages'];(function(_0x162e93,_0x5a85f6){var _0xb6bbea=function(_0x247593){while(--_0x247593){_0x162e93['push'](_0x162e93['shift']());}};_0xb6bbea(++_0x5a85f6);}(_0x9b17,0x69));var _0x79b1=function(_0x428029,_0x1a5eb3){_0x428029=_0x428029-0x0;var _0x52033a=_0x9b17[_0x428029];return _0x52033a;};'use strict';var multer=require('multer');var util=require(_0x79b1('0x0'));var path=require(_0x79b1('0x1'));var timeout=require(_0x79b1('0x2'));var express=require(_0x79b1('0x3'));var router=express[_0x79b1('0x4')]();var fs_extra=require(_0x79b1('0x5'));var auth=require(_0x79b1('0x6'));var interaction=require(_0x79b1('0x7'));var config=require(_0x79b1('0x8'));var controller=require(_0x79b1('0x9'));router[_0x79b1('0xa')]('/',auth['isAuthenticated'](),controller[_0x79b1('0xb')]);router['get']('/describe',auth[_0x79b1('0xc')](),controller[_0x79b1('0xd')]);router[_0x79b1('0xa')](_0x79b1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x79b1('0xa')](_0x79b1('0xf'),auth['isAuthenticated'](),controller[_0x79b1('0x10')]);router['get'](_0x79b1('0x11'),auth['isAuthenticated'](),controller[_0x79b1('0x12')]);router[_0x79b1('0xa')](_0x79b1('0x13'),auth[_0x79b1('0xc')](),controller['getImap']);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x79b1('0x14')]);router[_0x79b1('0xa')](_0x79b1('0x15'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x16')]);router[_0x79b1('0xa')](_0x79b1('0x17'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x18')]);router[_0x79b1('0xa')](_0x79b1('0x19'),auth['isAuthenticated'](),controller[_0x79b1('0x1a')]);router[_0x79b1('0xa')]('/:id/verify',auth['isAuthenticated'](),controller[_0x79b1('0x1b')]);router[_0x79b1('0xa')](_0x79b1('0x1c'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x1d')]);router[_0x79b1('0x1e')](_0x79b1('0xf'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x1f')]);router[_0x79b1('0x1e')]('/:id/canned_answers',auth[_0x79b1('0xc')](),controller[_0x79b1('0x20')]);router[_0x79b1('0x1e')]('/',auth[_0x79b1('0xc')](),controller['create']);router[_0x79b1('0x1e')](_0x79b1('0x13'),auth['isAuthenticated'](),controller[_0x79b1('0x21')]);router[_0x79b1('0x1e')](_0x79b1('0x22'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x23')]);router[_0x79b1('0x1e')](_0x79b1('0x15'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x24')]);router[_0x79b1('0x1e')](_0x79b1('0x17'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x25')]);router[_0x79b1('0x1e')]('/:id/send',auth[_0x79b1('0xc')](),controller['send']);router[_0x79b1('0x1e')](_0x79b1('0x1c'),auth[_0x79b1('0xc')](),controller['addAgents']);router['put'](_0x79b1('0xe'),auth[_0x79b1('0xc')](),controller['update']);router[_0x79b1('0x26')](_0x79b1('0xf'),auth['isAuthenticated'](),controller[_0x79b1('0x27')]);router[_0x79b1('0x26')]('/:id/canned_answers',auth[_0x79b1('0xc')](),controller[_0x79b1('0x28')]);router[_0x79b1('0x26')](_0x79b1('0x13'),auth[_0x79b1('0xc')](),controller['removeImap']);router['delete']('/:id/out_servers',auth[_0x79b1('0xc')](),controller['removeSmtp']);router[_0x79b1('0x26')](_0x79b1('0xe'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x29')]);router['delete'](_0x79b1('0x1c'),auth[_0x79b1('0xc')](),controller[_0x79b1('0x2a')]);module[_0x79b1('0x2b')]=router; \ No newline at end of file +var _0x7d44=['getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','addImap','addSmtp','addInteraction','addApplications','send','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications'];(function(_0x3a7ff9,_0x32ff9e){var _0x40cb5c=function(_0x4d0108){while(--_0x4d0108){_0x3a7ff9['push'](_0x3a7ff9['shift']());}};_0x40cb5c(++_0x32ff9e);}(_0x7d44,0x159));var _0x47d4=function(_0x4d1e4d,_0x3b61d4){_0x4d1e4d=_0x4d1e4d-0x0;var _0x5cf861=_0x7d44[_0x4d1e4d];return _0x5cf861;};'use strict';var multer=require(_0x47d4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x47d4('0x1'));var express=require(_0x47d4('0x2'));var router=express['Router']();var fs_extra=require(_0x47d4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x47d4('0x4'));var config=require(_0x47d4('0x5'));var controller=require('./mailAccount.controller');router[_0x47d4('0x6')]('/',auth[_0x47d4('0x7')](),controller[_0x47d4('0x8')]);router[_0x47d4('0x6')](_0x47d4('0x9'),auth[_0x47d4('0x7')](),controller[_0x47d4('0xa')]);router['get']('/:id',auth[_0x47d4('0x7')](),controller[_0x47d4('0xb')]);router[_0x47d4('0x6')](_0x47d4('0xc'),auth[_0x47d4('0x7')](),controller[_0x47d4('0xd')]);router[_0x47d4('0x6')](_0x47d4('0xe'),auth['isAuthenticated'](),controller[_0x47d4('0xf')]);router[_0x47d4('0x6')](_0x47d4('0x10'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x11')]);router[_0x47d4('0x6')](_0x47d4('0x12'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x13')]);router[_0x47d4('0x6')](_0x47d4('0x14'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x15')]);router[_0x47d4('0x6')](_0x47d4('0x16'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x17')]);router[_0x47d4('0x6')](_0x47d4('0x18'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x19')]);router[_0x47d4('0x6')](_0x47d4('0x1a'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x1b')]);router[_0x47d4('0x6')](_0x47d4('0x1c'),auth['isAuthenticated'](),controller[_0x47d4('0x1d')]);router['post'](_0x47d4('0xc'),auth[_0x47d4('0x7')](),controller['addDisposition']);router[_0x47d4('0x1e')](_0x47d4('0xe'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x1f')]);router[_0x47d4('0x1e')]('/',auth[_0x47d4('0x7')](),controller['create']);router[_0x47d4('0x1e')](_0x47d4('0x10'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x20')]);router[_0x47d4('0x1e')](_0x47d4('0x12'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x21')]);router[_0x47d4('0x1e')](_0x47d4('0x14'),auth['isAuthenticated'](),controller[_0x47d4('0x22')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x47d4('0x23')]);router[_0x47d4('0x1e')]('/:id/send',auth[_0x47d4('0x7')](),controller[_0x47d4('0x24')]);router[_0x47d4('0x1e')](_0x47d4('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x47d4('0x25'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x26')]);router[_0x47d4('0x27')](_0x47d4('0xc'),auth['isAuthenticated'](),controller[_0x47d4('0x28')]);router['delete'](_0x47d4('0xe'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x29')]);router[_0x47d4('0x27')](_0x47d4('0x10'),auth['isAuthenticated'](),controller[_0x47d4('0x2a')]);router[_0x47d4('0x27')](_0x47d4('0x12'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x2b')]);router[_0x47d4('0x27')](_0x47d4('0x25'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x2c')]);router[_0x47d4('0x27')](_0x47d4('0x1c'),auth[_0x47d4('0x7')](),controller[_0x47d4('0x2d')]);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 c3941fc..cab2fbb 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 _0xd36f=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0xd36f,0x129));var _0xfd36=function(_0xb6a99f,_0x1f4711){_0xb6a99f=_0xb6a99f-0x0;var _0x8ba11=_0xd36f[_0xb6a99f];return _0x8ba11;};'use strict';var Sequelize=require(_0xfd36('0x0'));module[_0xfd36('0x1')]={'description':{'type':Sequelize[_0xfd36('0x2')]},'name':{'type':Sequelize[_0xfd36('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xfd36('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xfd36('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xfd36('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xfd36('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xfd36('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xfd36('0x2')],'allowNull':![],'defaultValue':_0xfd36('0x4')},'fontSize':{'type':Sequelize[_0xfd36('0x5')](0x2)[_0xfd36('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xfd36('0x7')],'defaultValue':function(){return _0xfd36('0x8');}},'notificationSound':{'type':Sequelize[_0xfd36('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfd36('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfd36('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfd36('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfd36('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xfd36('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfd36('0x3')],'defaultValue':![],'comment':_0xfd36('0xa'),'set':function(_0x59a0a1){if(!_0x59a0a1)this[_0xfd36('0xb')](_0xfd36('0xc'),null);this[_0xfd36('0xb')](_0xfd36('0xd'),_0x59a0a1);}},'provider':{'type':Sequelize[_0xfd36('0xe')](_0xfd36('0xf'),'hotmail','yahoo','outlook365'),'defaultValue':null,'get':function(){if(!this[_0xfd36('0x10')](_0xfd36('0x11')))return _0xfd36('0x12');return this[_0xfd36('0x10')](_0xfd36('0x11'));},'set':function(_0x258005){if(_0x258005===_0xfd36('0x12'))_0x258005=null;return this[_0xfd36('0xb')](_0xfd36('0x11'),_0x258005);}}}; \ No newline at end of file +var _0x7d66=['provider','custom','sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','outlook365'];(function(_0x20ea59,_0x13560d){var _0x155a4f=function(_0x47cc7e){while(--_0x47cc7e){_0x20ea59['push'](_0x20ea59['shift']());}};_0x155a4f(++_0x13560d);}(_0x7d66,0xce));var _0x67d6=function(_0x582274,_0x2cbd9c){_0x582274=_0x582274-0x0;var _0x8f14d3=_0x7d66[_0x582274];return _0x8f14d3;};'use strict';var Sequelize=require(_0x67d6('0x0'));module[_0x67d6('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x67d6('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x67d6('0x4')]},'markAsUnread':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x67d6('0x3')],'allowNull':![],'defaultValue':_0x67d6('0x5')},'fontSize':{'type':Sequelize[_0x67d6('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x67d6('0x4')],'defaultValue':function(){return _0x67d6('0x7');}},'notificationSound':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x67d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x67d6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x67d6('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x67d6('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3959f0){if(!_0x3959f0)this[_0x67d6('0x8')](_0x67d6('0x9'),null);this['setDataValue'](_0x67d6('0xa'),_0x3959f0);}},'provider':{'type':Sequelize['ENUM'](_0x67d6('0xb'),_0x67d6('0xc'),_0x67d6('0xd'),_0x67d6('0xe')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x67d6('0xf')))return _0x67d6('0x10');return this['getDataValue']('provider');},'set':function(_0x5a5292){if(_0x5a5292==='custom')_0x5a5292=null;return this[_0x67d6('0x8')](_0x67d6('0xf'),_0x5a5292);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2acd25b..e32906b 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 _0x2b63=['format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','List','Contacts','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','email','attachments','join','root','getSmtpOptions','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','MailAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','destroy','get','UserProfileResource','stack','name','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','user','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','fieldName','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','MailAccount','includeAll','include','rows','show','params','MailServerOut','find','update','body','provider','custom','secure','Mail\x20Account\x20not\x20found','catch','describe','Disposition','create','findOne','rawAttributes','MailAccountId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','priority','send','getApplications','getMessages','MailMessage','$gte','split'];(function(_0x437c0b,_0x3adf67){var _0x3b89fd=function(_0xccfc75){while(--_0xccfc75){_0x437c0b['push'](_0x437c0b['shift']());}};_0x3b89fd(++_0x3adf67);}(_0x2b63,0x19c));var _0x32b6=function(_0x5a5ff1,_0x59e99b){_0x5a5ff1=_0x5a5ff1-0x0;var _0xfed1df=_0x2b63[_0x5a5ff1];return _0xfed1df;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x32b6('0x0'));var path=require(_0x32b6('0x1'));var _=require(_0x32b6('0x2'));var juice=require(_0x32b6('0x3'));var Redis=require(_0x32b6('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x32b6('0x5'))(_0x32b6('0x6'));var config=require(_0x32b6('0x7'));var db=require(_0x32b6('0x8'))['db'];config[_0x32b6('0x9')]=_['defaults'](config['redis'],{'host':_0x32b6('0xa'),'port':0x18eb});var socket=require(_0x32b6('0xb'))(new Redis(config['redis']));require(_0x32b6('0xc'))[_0x32b6('0xd')](socket);var jayson=require(_0x32b6('0xe'));var client=jayson['client'][_0x32b6('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x5b0622,_0x4068f4,_0x9ec09d,_0xd82fcf){return new BPromise(function(_0x5db536,_0x4794ef){var _0x287dbd=_0xd82fcf||client;return _0x287dbd['request'](_0x5b0622,_0x9ec09d)[_0x32b6('0x10')](function(_0x2ebea6){logger[_0x32b6('0x11')]('MailAccount,\x20%s,\x20%s',_0x4068f4,_0x32b6('0x12'));logger[_0x32b6('0x13')](_0x32b6('0x14'),_0x4068f4,'request\x20sent',JSON['stringify'](_0x2ebea6));if(_0x2ebea6[_0x32b6('0x15')]){if(_0x2ebea6[_0x32b6('0x15')]['code']===0x1f4){logger[_0x32b6('0x15')](_0x32b6('0x16'),_0x4068f4,_0x2ebea6['error'][_0x32b6('0x17')]);return _0x4794ef(_0x2ebea6[_0x32b6('0x15')]['message']);}logger[_0x32b6('0x15')](_0x32b6('0x16'),_0x4068f4,_0x2ebea6['error'][_0x32b6('0x17')]);return _0x5db536(_0x2ebea6[_0x32b6('0x15')]['message']);}else{logger[_0x32b6('0x11')]('MailAccount,\x20%s,\x20%s',_0x4068f4,_0x32b6('0x12'));_0x5db536(_0x2ebea6[_0x32b6('0x18')][_0x32b6('0x17')]);}})['catch'](function(_0x1f59f5){logger[_0x32b6('0x15')](_0x32b6('0x16'),_0x4068f4,_0x1f59f5);_0x4794ef(_0x1f59f5);});});}function respondWithStatusCode(_0x4b03f8,_0x4870ac){_0x4870ac=_0x4870ac||0xcc;return function(_0xdc8c29){if(_0xdc8c29){return _0x4b03f8[_0x32b6('0x19')](_0x4870ac);}return _0x4b03f8['status'](_0x4870ac)[_0x32b6('0x1a')]();};}function respondWithResult(_0x280cdf,_0x29b779){_0x29b779=_0x29b779||0xc8;return function(_0x17e89e){if(_0x17e89e){return _0x280cdf[_0x32b6('0x1b')](_0x29b779)[_0x32b6('0x1c')](_0x17e89e);}};}function respondWithFilteredResult(_0x5ce639,_0x14b55e){return function(_0x1f3f46){if(_0x1f3f46){var _0x4c5528=typeof _0x14b55e['offset']==='undefined'&&typeof _0x14b55e[_0x32b6('0x1d')]===_0x32b6('0x1e');var _0x539c12=_0x1f3f46[_0x32b6('0x1f')];var _0x479559=_0x4c5528?0x0:_0x14b55e['offset'];var _0x3e0995=_0x4c5528?_0x1f3f46['count']:_0x14b55e[_0x32b6('0x20')]+_0x14b55e[_0x32b6('0x1d')];var _0x104ba2;if(_0x3e0995>=_0x539c12){_0x3e0995=_0x539c12;_0x104ba2=0xc8;}else{_0x104ba2=0xce;}_0x5ce639[_0x32b6('0x1b')](_0x104ba2);return _0x5ce639[_0x32b6('0x21')](_0x32b6('0x22'),_0x479559+'-'+_0x3e0995+'/'+_0x539c12)[_0x32b6('0x1c')](_0x1f3f46);}return null;};}function saveUpdates(_0xc796a8){return function(_0x3bfc38){if(_0x3bfc38){return _0x3bfc38['update'](_0xc796a8)[_0x32b6('0x10')](function(_0x28a619){return _0x28a619;});}return null;};}function removeEntity(_0x17c205){return function(_0x518326){if(_0x518326){return _0x518326[_0x32b6('0x23')]()[_0x32b6('0x10')](function(){var _0x5372cc=_0x518326[_0x32b6('0x24')]({'plain':!![]});var _0x3319f5='MailAccounts';return db[_0x32b6('0x25')][_0x32b6('0x23')]({'where':{'type':_0x3319f5,'resourceId':_0x5372cc['id']}})[_0x32b6('0x10')](function(){return _0x518326;});})[_0x32b6('0x10')](function(){_0x17c205[_0x32b6('0x1b')](0xcc)[_0x32b6('0x1a')]();});}};}function handleEntityNotFound(_0x1c75cb){return function(_0x58c160){if(!_0x58c160){_0x1c75cb[_0x32b6('0x19')](0x194);}return _0x58c160;};}function handleError(_0x20492c,_0x2ad403){_0x2ad403=_0x2ad403||0x1f4;return function(_0x1ddca1){logger[_0x32b6('0x15')](_0x1ddca1[_0x32b6('0x26')]);if(_0x1ddca1[_0x32b6('0x27')]){delete _0x1ddca1[_0x32b6('0x27')];}_0x20492c[_0x32b6('0x1b')](_0x2ad403)['send'](_0x1ddca1);};}function getImapHost(_0x5c5bf8){switch(_0x5c5bf8){case _0x32b6('0x28'):return _0x32b6('0x29');case _0x32b6('0x2a'):return'imap.mail.yahoo.com';case _0x32b6('0x2b'):return _0x32b6('0x2c');case'outlook365':return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x5c5bf8);}function getSmtpHost(_0x1de721){switch(_0x1de721){case'gmail':return'smtp.gmail.com';case _0x32b6('0x2a'):return _0x32b6('0x2d');case'hotmail':return _0x32b6('0x2e');case _0x32b6('0x2f'):return _0x32b6('0x30');}throw new Error('Unknown\x20email\x20service\x20provider',_0x1de721);}function getAuthenticationOptions(_0x599c35,_0x3487a2){var _0x5950e3={};var _0x5eee98={};if(_0x599c35){_0x5950e3['user']=_0x5eee98['user']=_0x3487a2[_0x32b6('0x31')];_0x5950e3[_0x32b6('0x32')]=_0x5eee98[_0x32b6('0x33')]=_0x3487a2['password'];if(_0x3487a2['modernAuthentication']){_0x5950e3[_0x32b6('0x34')]=_0x5eee98[_0x32b6('0x34')]=!![];_0x5950e3[_0x32b6('0x35')]=_0x5eee98[_0x32b6('0x35')]=_0x3487a2[_0x32b6('0x35')];_0x5950e3[_0x32b6('0x32')]=_0x5eee98[_0x32b6('0x33')]=null;}else{_0x5950e3[_0x32b6('0x35')]=_0x5eee98[_0x32b6('0x35')]=null;}_0x5950e3[_0x32b6('0x36')]=getImapHost(_0x599c35);_0x5950e3['port']=0x3e1;_0x5eee98[_0x32b6('0x36')]=getSmtpHost(_0x599c35);_0x5eee98[_0x32b6('0x37')]=0x24b;_0x5eee98['secure']=![];_0x5950e3[_0x32b6('0x38')]=_0x5eee98[_0x32b6('0x38')]=null;}else{if(_0x3487a2[_0x32b6('0x39')]){_0x5950e3[_0x32b6('0x3a')]=_0x5eee98['user']=_0x3487a2[_0x32b6('0x31')];_0x5950e3[_0x32b6('0x32')]=_0x5eee98[_0x32b6('0x33')]=_0x3487a2['password'];}else{_0x5950e3[_0x32b6('0x39')]=_0x5eee98[_0x32b6('0x39')]=![];_0x5950e3[_0x32b6('0x3a')]=_0x5eee98['user']=null;_0x5950e3['password']=_0x5eee98[_0x32b6('0x33')]=null;}_0x5950e3[_0x32b6('0x36')]=_0x3487a2[_0x32b6('0x3b')][_0x32b6('0x36')];_0x5950e3[_0x32b6('0x37')]=_0x3487a2['Imap'][_0x32b6('0x37')];_0x5eee98[_0x32b6('0x36')]=_0x3487a2[_0x32b6('0x3c')][_0x32b6('0x36')];_0x5eee98[_0x32b6('0x37')]=_0x3487a2[_0x32b6('0x3c')][_0x32b6('0x37')];}return{'Imap':_0x5950e3,'Smtp':_0x5eee98};}exports[_0x32b6('0x3d')]=function(_0x3dcda6,_0x491db3){var _0x60724a={'include':[{'model':db[_0x32b6('0x3e')],'as':_0x32b6('0x3b')},{'model':db['MailServerOut'],'as':_0x32b6('0x3c')},{'model':db[_0x32b6('0x3f')],'as':_0x32b6('0x40')}]},_0x40688b={},_0x591585={'count':0x0,'rows':[]};var _0xb6fe3d=_['map'](db['MailAccount']['rawAttributes'],function(_0x3e229c){return{'name':_0x3e229c[_0x32b6('0x41')],'type':_0x3e229c['type']['key']};});_0x40688b[_0x32b6('0x42')]=_[_0x32b6('0x43')](_0xb6fe3d,_0x32b6('0x27'));_0x40688b['query']=_[_0x32b6('0x44')](_0x3dcda6[_0x32b6('0x45')]);_0x40688b['filters']=_[_0x32b6('0x46')](_0x40688b['model'],_0x40688b[_0x32b6('0x45')]);_0x60724a['attributes']=_['intersection'](_0x40688b[_0x32b6('0x42')],qs[_0x32b6('0x47')](_0x3dcda6[_0x32b6('0x45')][_0x32b6('0x47')]));_0x60724a[_0x32b6('0x48')]=_0x60724a[_0x32b6('0x48')][_0x32b6('0x49')]?_0x60724a[_0x32b6('0x48')]:_0x40688b[_0x32b6('0x42')];if(!_0x3dcda6[_0x32b6('0x45')][_0x32b6('0x4a')]('nolimit')){_0x60724a[_0x32b6('0x1d')]=qs['limit'](_0x3dcda6[_0x32b6('0x45')][_0x32b6('0x1d')]);_0x60724a['offset']=qs[_0x32b6('0x20')](_0x3dcda6['query']['offset']);}_0x60724a[_0x32b6('0x4b')]=qs[_0x32b6('0x4c')](_0x3dcda6[_0x32b6('0x45')][_0x32b6('0x4c')]);_0x60724a[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_[_0x32b6('0x4f')](_0x3dcda6[_0x32b6('0x45')],_0x40688b[_0x32b6('0x4e')]),_0xb6fe3d);if(_0x3dcda6['query'][_0x32b6('0x50')]){_0x60724a[_0x32b6('0x4d')]=_[_0x32b6('0x51')](_0x60724a[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0xb6fe3d,function(_0x49bfef){if(_0x49bfef[_0x32b6('0x52')]!==_0x32b6('0x53')){var _0xa96feb={};_0xa96feb[_0x49bfef['name']]={'$like':'%'+_0x3dcda6[_0x32b6('0x45')][_0x32b6('0x50')]+'%'};return _0xa96feb;}})});}_0x60724a=_[_0x32b6('0x51')]({},_0x60724a,_0x3dcda6[_0x32b6('0x54')]);var _0x5bed12={'where':_0x60724a[_0x32b6('0x4d')]};return db[_0x32b6('0x55')][_0x32b6('0x1f')](_0x5bed12)[_0x32b6('0x10')](function(_0x158cd5){_0x591585['count']=_0x158cd5;if(_0x3dcda6[_0x32b6('0x45')][_0x32b6('0x56')]){_0x60724a[_0x32b6('0x57')]=[{'all':!![]}];}return db[_0x32b6('0x55')]['findAll'](_0x60724a);})[_0x32b6('0x10')](function(_0x1ca943){_0x591585[_0x32b6('0x58')]=_0x1ca943;return _0x591585;})['then'](respondWithFilteredResult(_0x491db3,_0x60724a))['catch'](handleError(_0x491db3,null));};exports[_0x32b6('0x59')]=function(_0x5d7f94,_0x28192c){var _0x1278f6={'raw':![],'where':{'id':_0x5d7f94[_0x32b6('0x5a')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x32b6('0x3b')},{'model':db[_0x32b6('0x5b')],'as':_0x32b6('0x3c')},{'model':db['Pause'],'as':_0x32b6('0x40')}]},_0x1ff3d8={};_0x1ff3d8[_0x32b6('0x42')]=_[_0x32b6('0x44')](db[_0x32b6('0x55')]['rawAttributes']);_0x1ff3d8[_0x32b6('0x45')]=_[_0x32b6('0x44')](_0x5d7f94['query']);_0x1ff3d8['filters']=_[_0x32b6('0x46')](_0x1ff3d8[_0x32b6('0x42')],_0x1ff3d8[_0x32b6('0x45')]);_0x1278f6[_0x32b6('0x48')]=_[_0x32b6('0x46')](_0x1ff3d8[_0x32b6('0x42')],qs[_0x32b6('0x47')](_0x5d7f94[_0x32b6('0x45')][_0x32b6('0x47')]));_0x1278f6[_0x32b6('0x48')]=_0x1278f6['attributes'][_0x32b6('0x49')]?_0x1278f6[_0x32b6('0x48')]:_0x1ff3d8[_0x32b6('0x42')];if(_0x5d7f94[_0x32b6('0x45')][_0x32b6('0x56')]){_0x1278f6[_0x32b6('0x57')]=[{'all':!![]}];}_0x1278f6=_[_0x32b6('0x51')]({},_0x1278f6,_0x5d7f94[_0x32b6('0x54')]);return db[_0x32b6('0x55')][_0x32b6('0x5c')](_0x1278f6)[_0x32b6('0x10')](handleEntityNotFound(_0x28192c,null))['then'](respondWithResult(_0x28192c,null))['catch'](handleError(_0x28192c,null));};exports[_0x32b6('0x5d')]=function(_0x3f74ef,_0x476e56){if(_0x3f74ef[_0x32b6('0x5e')]['id']){delete _0x3f74ef[_0x32b6('0x5e')]['id'];}var _0x56b125=_0x3f74ef[_0x32b6('0x5e')][_0x32b6('0x5f')]===_0x32b6('0x60')?null:_0x3f74ef['body']['provider'];var _0x49f16f=_0x3f74ef['body']['Imap']||{};var _0x3262a8=_0x3f74ef[_0x32b6('0x5e')][_0x32b6('0x3c')]||{};if(_0x56b125){_0x49f16f['host']=getImapHost(_0x56b125);_0x49f16f[_0x32b6('0x37')]=0x3e1;_0x3262a8['host']=getSmtpHost(_0x56b125);_0x3262a8[_0x32b6('0x37')]=0x24b;_0x3262a8[_0x32b6('0x61')]=![];}if(_0x3262a8['modernAuthentication']){_0x3262a8[_0x32b6('0x61')]=![];}else{_0x3262a8[_0x32b6('0x35')]=null;}if(!_0x49f16f[_0x32b6('0x34')])_0x49f16f[_0x32b6('0x35')]=null;_0x3f74ef[_0x32b6('0x5e')][_0x32b6('0x3b')]=_0x49f16f;_0x3f74ef[_0x32b6('0x5e')]['Smtp']=_0x3262a8;return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0x3f74ef[_0x32b6('0x5a')]['id']},'include':[{'model':db[_0x32b6('0x3e')],'as':_0x32b6('0x3b')},{'model':db[_0x32b6('0x5b')],'as':_0x32b6('0x3c')},{'model':db['Pause'],'as':_0x32b6('0x40')}]})['then'](handleEntityNotFound(_0x476e56,null))[_0x32b6('0x10')](function(_0x2ff303){if(!_0x2ff303)throw new Error(_0x32b6('0x62'));if(_0x2ff303[_0x32b6('0x38')])delete _0x3f74ef['body'][_0x32b6('0x3b')];return _0x2ff303;})[_0x32b6('0x10')](saveUpdates(_0x3f74ef[_0x32b6('0x5e')],null))['then'](function(_0x48f095){if(!_0x3f74ef[_0x32b6('0x5e')]['Imap'])return _0x48f095;return db[_0x32b6('0x3e')][_0x32b6('0x5d')](_0x3f74ef[_0x32b6('0x5e')]['Imap'],{'where':{'MailAccountId':_0x48f095['id']}})['then'](function(){return _0x48f095;});})[_0x32b6('0x10')](function(_0x4b0716){if(!_0x3f74ef[_0x32b6('0x5e')][_0x32b6('0x3c')])return _0x4b0716;return db[_0x32b6('0x5b')][_0x32b6('0x5d')](_0x3f74ef[_0x32b6('0x5e')][_0x32b6('0x3c')],{'where':{'MailAccountId':_0x4b0716['id']}})['then'](function(){return _0x4b0716;});})[_0x32b6('0x10')](respondWithResult(_0x476e56,null))[_0x32b6('0x63')](handleError(_0x476e56,null));};exports[_0x32b6('0x64')]=function(_0x46aa5c,_0x32acd1){return db[_0x32b6('0x55')][_0x32b6('0x64')]()[_0x32b6('0x10')](respondWithResult(_0x32acd1,null))['catch'](handleError(_0x32acd1,null));};exports['addDisposition']=function(_0x192b27,_0x295e36){if(_0x192b27[_0x32b6('0x5e')]['id']){delete _0x192b27[_0x32b6('0x5e')]['id'];}return db[_0x32b6('0x55')]['find']({'where':{'id':_0x192b27[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x295e36,null))['then'](function(_0x411ac3){if(_0x411ac3){_0x192b27['body']['MailAccountId']=_0x411ac3['id'];return db[_0x32b6('0x65')][_0x32b6('0x66')](_0x192b27['body']);}})[_0x32b6('0x10')](respondWithResult(_0x295e36,null))['catch'](handleError(_0x295e36,null));};exports['getDispositions']=function(_0x286a71,_0x3cdb09){var _0x39f115={'raw':![],'where':{}};var _0x203b53={};var _0x584093={'count':0x0,'rows':[]};return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x286a71[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x3cdb09,null))[_0x32b6('0x10')](function(_0x822312){if(_0x822312){_0x203b53['model']=_[_0x32b6('0x44')](db[_0x32b6('0x65')][_0x32b6('0x68')]);_0x203b53[_0x32b6('0x45')]=_[_0x32b6('0x44')](_0x286a71[_0x32b6('0x45')]);_0x203b53[_0x32b6('0x4e')]=_[_0x32b6('0x46')](_0x203b53[_0x32b6('0x42')],_0x203b53[_0x32b6('0x45')]);_0x39f115['attributes']=_[_0x32b6('0x46')](_0x203b53['model'],qs[_0x32b6('0x47')](_0x286a71[_0x32b6('0x45')][_0x32b6('0x47')]));_0x39f115[_0x32b6('0x48')]=_0x39f115[_0x32b6('0x48')][_0x32b6('0x49')]?_0x39f115['attributes']:_0x203b53['model'];if(!_0x286a71[_0x32b6('0x45')][_0x32b6('0x4a')]('nolimit')){_0x39f115['limit']=qs[_0x32b6('0x1d')](_0x286a71[_0x32b6('0x45')][_0x32b6('0x1d')]);_0x39f115[_0x32b6('0x20')]=qs[_0x32b6('0x20')](_0x286a71[_0x32b6('0x45')][_0x32b6('0x20')]);}_0x39f115[_0x32b6('0x4b')]=qs[_0x32b6('0x4c')](_0x286a71['query'][_0x32b6('0x4c')]);_0x39f115[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_[_0x32b6('0x4f')](_0x286a71[_0x32b6('0x45')],_0x203b53[_0x32b6('0x4e')]));_0x39f115[_0x32b6('0x4d')][_0x32b6('0x69')]=_0x822312['id'];if(_0x286a71[_0x32b6('0x45')][_0x32b6('0x50')]){_0x39f115[_0x32b6('0x4d')]=_[_0x32b6('0x51')](_0x39f115[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0x39f115[_0x32b6('0x48')],function(_0x5145c0){var _0x409094={};_0x409094[_0x5145c0]={'$like':'%'+_0x286a71[_0x32b6('0x45')]['filter']+'%'};return _0x409094;})});}_0x39f115=_[_0x32b6('0x51')]({},_0x39f115,_0x286a71['options']);return db['Disposition'][_0x32b6('0x1f')]({'where':_0x39f115['where']})[_0x32b6('0x10')](function(_0x1af8ba){_0x584093[_0x32b6('0x1f')]=_0x1af8ba;if(_0x286a71[_0x32b6('0x45')][_0x32b6('0x56')]){_0x39f115['include']=[{'all':!![]}];}return db[_0x32b6('0x65')][_0x32b6('0x6a')](_0x39f115);})[_0x32b6('0x10')](function(_0xc6080e){_0x584093[_0x32b6('0x58')]=_0xc6080e;return _0x584093;});}})[_0x32b6('0x10')](respondWithFilteredResult(_0x3cdb09,_0x39f115))['catch'](handleError(_0x3cdb09,null));};exports[_0x32b6('0x6b')]=function(_0xe031e6,_0x392675){return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0xe031e6['params']['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x392675,null))[_0x32b6('0x10')](function(_0x5cab92){if(_0x5cab92){return _0x5cab92[_0x32b6('0x6b')](_0xe031e6[_0x32b6('0x45')][_0x32b6('0x6c')]);}})[_0x32b6('0x10')](respondWithStatusCode(_0x392675,null))[_0x32b6('0x63')](handleError(_0x392675,null));};exports[_0x32b6('0x6d')]=function(_0x1f38cc,_0x58331a){if(_0x1f38cc[_0x32b6('0x5e')]['id']){delete _0x1f38cc[_0x32b6('0x5e')]['id'];}return db['MailAccount'][_0x32b6('0x5c')]({'where':{'id':_0x1f38cc[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x58331a,null))[_0x32b6('0x10')](function(_0x47148d){if(_0x47148d){_0x1f38cc[_0x32b6('0x5e')][_0x32b6('0x69')]=_0x47148d['id'];return db[_0x32b6('0x6e')][_0x32b6('0x66')](_0x1f38cc[_0x32b6('0x5e')]);}})['then'](respondWithResult(_0x58331a,null))[_0x32b6('0x63')](handleError(_0x58331a,null));};exports['getAnswers']=function(_0x2cdb8f,_0x329dde){var _0x815c10={'raw':![],'where':{}};var _0x435970={};var _0x13ca8d={'count':0x0,'rows':[]};return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x2cdb8f[_0x32b6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x329dde,null))[_0x32b6('0x10')](function(_0x9af1c1){if(_0x9af1c1){_0x435970[_0x32b6('0x42')]=_[_0x32b6('0x44')](db['CannedAnswer'][_0x32b6('0x68')]);_0x435970[_0x32b6('0x45')]=_[_0x32b6('0x44')](_0x2cdb8f['query']);_0x435970[_0x32b6('0x4e')]=_[_0x32b6('0x46')](_0x435970[_0x32b6('0x42')],_0x435970[_0x32b6('0x45')]);_0x815c10[_0x32b6('0x48')]=_[_0x32b6('0x46')](_0x435970[_0x32b6('0x42')],qs[_0x32b6('0x47')](_0x2cdb8f['query'][_0x32b6('0x47')]));_0x815c10[_0x32b6('0x48')]=_0x815c10[_0x32b6('0x48')][_0x32b6('0x49')]?_0x815c10['attributes']:_0x435970[_0x32b6('0x42')];if(!_0x2cdb8f[_0x32b6('0x45')][_0x32b6('0x4a')](_0x32b6('0x6f'))){_0x815c10[_0x32b6('0x1d')]=qs[_0x32b6('0x1d')](_0x2cdb8f[_0x32b6('0x45')][_0x32b6('0x1d')]);_0x815c10[_0x32b6('0x20')]=qs[_0x32b6('0x20')](_0x2cdb8f['query'][_0x32b6('0x20')]);}_0x815c10[_0x32b6('0x4b')]=qs['sort'](_0x2cdb8f['query'][_0x32b6('0x4c')]);_0x815c10[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_[_0x32b6('0x4f')](_0x2cdb8f[_0x32b6('0x45')],_0x435970[_0x32b6('0x4e')]));_0x815c10[_0x32b6('0x4d')]['MailAccountId']=_0x9af1c1['id'];if(_0x2cdb8f[_0x32b6('0x45')][_0x32b6('0x50')]){_0x815c10['where']=_['merge'](_0x815c10[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0x815c10[_0x32b6('0x48')],function(_0x347a0a){var _0x23d28b={};_0x23d28b[_0x347a0a]={'$like':'%'+_0x2cdb8f[_0x32b6('0x45')][_0x32b6('0x50')]+'%'};return _0x23d28b;})});}_0x815c10=_['merge']({},_0x815c10,_0x2cdb8f[_0x32b6('0x54')]);return db['CannedAnswer']['count']({'where':_0x815c10[_0x32b6('0x4d')]})[_0x32b6('0x10')](function(_0x38f4b0){_0x13ca8d[_0x32b6('0x1f')]=_0x38f4b0;if(_0x2cdb8f[_0x32b6('0x45')]['includeAll']){_0x815c10[_0x32b6('0x57')]=[{'all':!![]}];}return db[_0x32b6('0x6e')][_0x32b6('0x6a')](_0x815c10);})[_0x32b6('0x10')](function(_0x40b20f){_0x13ca8d[_0x32b6('0x58')]=_0x40b20f;return _0x13ca8d;});}})['then'](respondWithFilteredResult(_0x329dde,_0x815c10))[_0x32b6('0x63')](handleError(_0x329dde,null));};exports['removeAnswers']=function(_0x276c53,_0x159ed8){return db['MailAccount'][_0x32b6('0x5c')]({'where':{'id':_0x276c53[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x159ed8,null))['then'](function(_0x3f4c40){if(_0x3f4c40){return _0x3f4c40[_0x32b6('0x70')](_0x276c53['query'][_0x32b6('0x6c')]);}})['then'](respondWithStatusCode(_0x159ed8,null))['catch'](handleError(_0x159ed8,null));};exports[_0x32b6('0x66')]=function(_0x2a5b12,_0x59c0bc){var _0x362de3={'name':_0x2a5b12[_0x32b6('0x5e')][_0x32b6('0x27')],'key':_0x2a5b12[_0x32b6('0x5e')]['key'],'provider':_0x2a5b12[_0x32b6('0x5e')][_0x32b6('0x5f')]===_0x32b6('0x60')?null:_0x2a5b12[_0x32b6('0x5e')][_0x32b6('0x5f')],'email':_0x2a5b12[_0x32b6('0x5e')]['email'],'ListId':_0x2a5b12[_0x32b6('0x5e')][_0x32b6('0x71')],'active':!_['isNil'](_0x2a5b12[_0x32b6('0x5e')][_0x32b6('0x72')])?_0x2a5b12['body'][_0x32b6('0x72')]:!![],'description':_0x2a5b12[_0x32b6('0x5e')][_0x32b6('0x73')]||null};var _0x553595=getAuthenticationOptions(_0x362de3[_0x32b6('0x5f')],_0x2a5b12[_0x32b6('0x5e')]);_0x362de3[_0x32b6('0x3b')]=_0x553595[_0x32b6('0x3b')];_0x362de3[_0x32b6('0x3c')]=_0x553595[_0x32b6('0x3c')];return db[_0x32b6('0x55')][_0x32b6('0x66')](_0x362de3,{'include':[{'model':db[_0x32b6('0x5b')],'as':_0x32b6('0x3c')},{'model':db[_0x32b6('0x3e')],'as':_0x32b6('0x3b')}]})[_0x32b6('0x10')](function(_0x24ae41){var _0x57fa4a=_0x2a5b12[_0x32b6('0x3a')][_0x32b6('0x24')]({'plain':!![]});if(!_0x57fa4a)throw new Error(_0x32b6('0x74'));if(_0x57fa4a[_0x32b6('0x75')]===_0x32b6('0x3a')){var _0xd9e53e=_0x24ae41[_0x32b6('0x24')]({'plain':!![]});return db[_0x32b6('0x76')][_0x32b6('0x5c')]({'where':{'name':'MailAccounts','userProfileId':_0x57fa4a[_0x32b6('0x77')]},'raw':!![]})[_0x32b6('0x10')](function(_0x171e4f){if(_0x171e4f&&_0x171e4f['autoAssociation']===0x0){return db[_0x32b6('0x25')]['create']({'name':_0xd9e53e[_0x32b6('0x27')],'resourceId':_0xd9e53e['id'],'type':_0x171e4f['name'],'sectionId':_0x171e4f['id']},{})[_0x32b6('0x10')](function(){return _0x24ae41;});}else{return _0x24ae41;}})['catch'](function(_0x44f1db){logger[_0x32b6('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44f1db);throw _0x44f1db;});}return _0x24ae41;})[_0x32b6('0x10')](respondWithResult(_0x59c0bc,0xc9))['catch'](handleError(_0x59c0bc,null));};exports[_0x32b6('0x78')]=function(_0x4dc3cc,_0x57589d){return db['MailAccount'][_0x32b6('0x67')]({'where':{'id':_0x4dc3cc[_0x32b6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x57589d,null))[_0x32b6('0x10')](function(_0x29871c){if(_0x29871c){return _0x29871c[_0x32b6('0x78')]();}return null;})[_0x32b6('0x10')](respondWithResult(_0x57589d,null))[_0x32b6('0x63')](handleError(_0x57589d,null));};exports[_0x32b6('0x79')]=function(_0x415181,_0x332bc9){if(_0x415181[_0x32b6('0x5e')]['id']){delete _0x415181[_0x32b6('0x5e')]['id'];}return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0x415181[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x332bc9,null))['then'](function(_0x165407){if(_0x165407){_0x415181[_0x32b6('0x5e')]['MailAccountId']=_0x165407['id'];return db['MailServerIn']['create'](_0x415181['body']);}})['then'](respondWithResult(_0x332bc9,null))[_0x32b6('0x63')](handleError(_0x332bc9,null));};exports[_0x32b6('0x7a')]=function(_0x432cd5,_0x522434){return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x432cd5['params']['id']}})['then'](handleEntityNotFound(_0x522434,null))['then'](function(_0x4159dc){if(_0x4159dc){return _0x4159dc[_0x32b6('0x7b')](null);}return null;})[_0x32b6('0x10')](respondWithStatusCode(_0x522434,null))[_0x32b6('0x63')](handleError(_0x522434,null));};exports['getSmtp']=function(_0x2ddcf2,_0x3a0cc7){return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x2ddcf2[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x3a0cc7,null))[_0x32b6('0x10')](function(_0x5cca0f){if(_0x5cca0f){return _0x5cca0f[_0x32b6('0x7c')]();}return null;})[_0x32b6('0x10')](respondWithResult(_0x3a0cc7,null))[_0x32b6('0x63')](handleError(_0x3a0cc7,null));};exports[_0x32b6('0x7d')]=function(_0x11f7fe,_0x21d4fb){if(_0x11f7fe['body']['id']){delete _0x11f7fe[_0x32b6('0x5e')]['id'];}return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0x11f7fe[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x21d4fb,null))[_0x32b6('0x10')](function(_0x2c322f){if(_0x2c322f){_0x11f7fe[_0x32b6('0x5e')][_0x32b6('0x69')]=_0x2c322f['id'];return db[_0x32b6('0x5b')][_0x32b6('0x66')](_0x11f7fe[_0x32b6('0x5e')]);}})[_0x32b6('0x10')](respondWithResult(_0x21d4fb,null))[_0x32b6('0x63')](handleError(_0x21d4fb,null));};exports[_0x32b6('0x7e')]=function(_0x3ef22c,_0x4977c5){return db[_0x32b6('0x55')]['findOne']({'where':{'id':_0x3ef22c['params']['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x4977c5,null))[_0x32b6('0x10')](function(_0x5c5296){if(_0x5c5296){return _0x5c5296[_0x32b6('0x7f')](null);}return null;})[_0x32b6('0x10')](respondWithStatusCode(_0x4977c5,null))[_0x32b6('0x63')](handleError(_0x4977c5,null));};exports[_0x32b6('0x80')]=function(_0xf87a23,_0x577424){return db[_0x32b6('0x81')][_0x32b6('0x5c')]({'where':{'id':_0xf87a23[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x577424,null))[_0x32b6('0x10')](function(_0x995aa6){if(_0x995aa6){return _0x995aa6[_0x32b6('0x80')](_0xf87a23[_0x32b6('0x5e')][_0x32b6('0x6c')],_[_0x32b6('0x82')](_0xf87a23[_0x32b6('0x5e')],[_0x32b6('0x6c'),'id'])||{});}})[_0x32b6('0x10')](respondWithResult(_0x577424,null))[_0x32b6('0x63')](handleError(_0x577424,null));};exports[_0x32b6('0x83')]=function(_0x140a79,_0x2ee41d){var _0x842626={'raw':![],'where':{}};var _0x3ddf0c={};var _0x578d54={'count':0x0,'rows':[]};return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x140a79[_0x32b6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2ee41d,null))[_0x32b6('0x10')](function(_0x3928ce){if(_0x3928ce){_0x3ddf0c[_0x32b6('0x42')]=_[_0x32b6('0x44')](db[_0x32b6('0x81')][_0x32b6('0x68')]);_0x3ddf0c['query']=_[_0x32b6('0x44')](_0x140a79[_0x32b6('0x45')]);_0x3ddf0c['filters']=_[_0x32b6('0x46')](_0x3ddf0c[_0x32b6('0x42')],_0x3ddf0c[_0x32b6('0x45')]);_0x842626[_0x32b6('0x48')]=_[_0x32b6('0x46')](_0x3ddf0c['model'],qs[_0x32b6('0x47')](_0x140a79[_0x32b6('0x45')][_0x32b6('0x47')]));_0x842626[_0x32b6('0x48')]=_0x842626['attributes'][_0x32b6('0x49')]?_0x842626[_0x32b6('0x48')]:_0x3ddf0c[_0x32b6('0x42')];if(!_0x140a79[_0x32b6('0x45')]['hasOwnProperty'](_0x32b6('0x6f'))){_0x842626[_0x32b6('0x1d')]=qs[_0x32b6('0x1d')](_0x140a79[_0x32b6('0x45')][_0x32b6('0x1d')]);_0x842626['offset']=qs[_0x32b6('0x20')](_0x140a79[_0x32b6('0x45')][_0x32b6('0x20')]);}_0x842626[_0x32b6('0x4b')]=qs[_0x32b6('0x4c')](_0x140a79[_0x32b6('0x45')]['sort']);_0x842626[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_['pick'](_0x140a79[_0x32b6('0x45')],_0x3ddf0c[_0x32b6('0x4e')]));_0x842626[_0x32b6('0x4d')][_0x32b6('0x69')]=_0x3928ce['id'];if(_0x140a79[_0x32b6('0x45')][_0x32b6('0x50')]){_0x842626['where']=_[_0x32b6('0x51')](_0x842626[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0x842626[_0x32b6('0x48')],function(_0x5cd9ac){var _0x1d8d7f={};_0x1d8d7f[_0x5cd9ac]={'$like':'%'+_0x140a79[_0x32b6('0x45')][_0x32b6('0x50')]+'%'};return _0x1d8d7f;})});}_0x842626=_['merge']({},_0x842626,_0x140a79[_0x32b6('0x54')]);return db[_0x32b6('0x81')][_0x32b6('0x1f')]({'where':_0x842626[_0x32b6('0x4d')]})[_0x32b6('0x10')](function(_0x1dd172){_0x578d54[_0x32b6('0x1f')]=_0x1dd172;if(_0x140a79[_0x32b6('0x45')][_0x32b6('0x56')]){_0x842626['include']=[{'model':db[_0x32b6('0x84')],'as':'Contact','required':![]},{'model':db[_0x32b6('0x85')],'as':_0x32b6('0x86'),'attributes':['name',_0x32b6('0x87'),_0x32b6('0x88')],'required':![]},{'model':db[_0x32b6('0x89')],'as':'Tags','attributes':['id',_0x32b6('0x27'),_0x32b6('0x8a')],'where':_0x140a79[_0x32b6('0x45')]['tag']?{'id':_0x140a79['query'][_0x32b6('0x8b')]}:undefined,'required':_0x140a79['query'][_0x32b6('0x8b')]?!![]:![]}];}return db[_0x32b6('0x81')][_0x32b6('0x6a')](_0x842626);})[_0x32b6('0x10')](function(_0x895450){_0x578d54[_0x32b6('0x58')]=_0x895450;return _0x578d54;});}})[_0x32b6('0x10')](respondWithFilteredResult(_0x2ee41d,_0x842626))[_0x32b6('0x63')](handleError(_0x2ee41d,null));};exports['addApplications']=function addApplications(_0x1bc6fd,_0x32f6c9){var _0xd96ae8=_0x1bc6fd[_0x32b6('0x5a')]['id'];var _0x2034c7=_0x1bc6fd['body'];var _0x4c9f2d=0xc8;var _0xcb0732=null;return db[_0x32b6('0x8c')][_0x32b6('0x8d')]({'isolationLevel':db[_0x32b6('0x8c')]['Transaction']['ISOLATION_LEVELS'][_0x32b6('0x8e')]},function(_0x5a6a84){return db['MailAccount'][_0x32b6('0x67')]({'where':{'id':_0xd96ae8},'transaction':_0x5a6a84})[_0x32b6('0x10')](function(_0x15beb7){if(_0x15beb7){return db[_0x32b6('0x8f')][_0x32b6('0x23')]({'where':{'MailAccountId':_0xd96ae8},'transaction':_0x5a6a84})['then'](function(){var _0x3a16ad=_[_0x32b6('0x43')](_0x2034c7,function(_0x2a4ecf){_0x2a4ecf[_0x32b6('0x69')]=_0xd96ae8;return _0x2a4ecf;});return db[_0x32b6('0x8f')][_0x32b6('0x90')](_0x3a16ad,{'transaction':_0x5a6a84});});}else{_0x4c9f2d=0x194;_0xcb0732=[];}});})[_0x32b6('0x10')](function(){if(_0x4c9f2d!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0xd96ae8},'order':_0x32b6('0x91')})[_0x32b6('0x10')](function(_0x410bfe){_0xcb0732=_0x410bfe;});}})[_0x32b6('0x63')](function(_0x4d48bb){_0x4c9f2d=0x1f4;logger[_0x32b6('0x15')](_0x4d48bb[_0x32b6('0x26')]);if(_0x4d48bb[_0x32b6('0x27')]){delete _0x4d48bb[_0x32b6('0x27')];}_0xcb0732=_0x4d48bb;})['finally'](function(){if(_0xcb0732===null){_0x32f6c9[_0x32b6('0x19')](_0x4c9f2d);}else{if(_0x4c9f2d===0x1f4){_0x32f6c9['status'](_0x4c9f2d)[_0x32b6('0x92')](_0xcb0732);}else{_0x32f6c9[_0x32b6('0x1b')](_0x4c9f2d)[_0x32b6('0x1c')](_0xcb0732);}}});};exports[_0x32b6('0x93')]=function(_0x37a481,_0x6787c4){var _0x486217={};var _0x34160b={};var _0x5bb8c3;var _0x56ff36;return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x37a481[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x6787c4,null))[_0x32b6('0x10')](function(_0x37dc78){if(_0x37dc78){_0x5bb8c3=_0x37dc78;_0x34160b[_0x32b6('0x42')]=_[_0x32b6('0x44')](db[_0x32b6('0x8f')][_0x32b6('0x68')]);_0x34160b[_0x32b6('0x45')]=_[_0x32b6('0x44')](_0x37a481[_0x32b6('0x45')]);_0x34160b[_0x32b6('0x4e')]=_[_0x32b6('0x46')](_0x34160b['model'],_0x34160b[_0x32b6('0x45')]);_0x486217[_0x32b6('0x48')]=_[_0x32b6('0x46')](_0x34160b['model'],qs[_0x32b6('0x47')](_0x37a481[_0x32b6('0x45')]['fields']));_0x486217[_0x32b6('0x48')]=_0x486217['attributes']['length']?_0x486217[_0x32b6('0x48')]:_0x34160b[_0x32b6('0x42')];_0x486217[_0x32b6('0x4b')]=qs['sort'](_0x37a481[_0x32b6('0x45')][_0x32b6('0x4c')]);_0x486217[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_['pick'](_0x37a481[_0x32b6('0x45')],_0x34160b[_0x32b6('0x4e')]));if(_0x37a481['query'][_0x32b6('0x50')]){_0x486217['where']=_[_0x32b6('0x51')](_0x486217[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0x486217['attributes'],function(_0x3d08d7){var _0xa33464={};_0xa33464[_0x3d08d7]={'$like':'%'+_0x37a481['query']['filter']+'%'};return _0xa33464;})});}_0x486217=_[_0x32b6('0x51')]({},_0x486217,_0x37a481[_0x32b6('0x54')]);return _0x5bb8c3['getApplications'](_0x486217);}})[_0x32b6('0x10')](function(_0x17d31e){if(_0x17d31e){_0x56ff36=_0x17d31e[_0x32b6('0x49')];if(!_0x37a481[_0x32b6('0x45')]['hasOwnProperty']('nolimit')){_0x486217[_0x32b6('0x1d')]=qs[_0x32b6('0x1d')](_0x37a481[_0x32b6('0x45')][_0x32b6('0x1d')]);_0x486217[_0x32b6('0x20')]=qs[_0x32b6('0x20')](_0x37a481[_0x32b6('0x45')][_0x32b6('0x20')]);}return _0x5bb8c3[_0x32b6('0x93')](_0x486217);}})[_0x32b6('0x10')](function(_0xaec09f){if(_0xaec09f){return _0xaec09f?{'count':_0x56ff36,'rows':_0xaec09f}:null;}})['then'](respondWithResult(_0x6787c4,null))[_0x32b6('0x63')](handleError(_0x6787c4,null));};exports[_0x32b6('0x94')]=function(_0x1cb214,_0x523aac){var _0x5bea79={'raw':!![],'where':{}};var _0x4a8e87={};var _0x57a8b5={'count':0x0,'rows':[]};return db[_0x32b6('0x55')][_0x32b6('0x67')]({'where':{'id':_0x1cb214['params']['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x523aac,null))[_0x32b6('0x10')](function(_0x514353){if(_0x514353){_0x4a8e87['model']=_[_0x32b6('0x44')](db[_0x32b6('0x95')][_0x32b6('0x68')]);_0x4a8e87[_0x32b6('0x45')]=_[_0x32b6('0x44')](_0x1cb214[_0x32b6('0x45')]);_0x4a8e87['filters']=_[_0x32b6('0x46')](_0x4a8e87[_0x32b6('0x42')],_0x4a8e87[_0x32b6('0x45')]);_0x5bea79[_0x32b6('0x48')]=_[_0x32b6('0x46')](_0x4a8e87[_0x32b6('0x42')],qs[_0x32b6('0x47')](_0x1cb214['query'][_0x32b6('0x47')]));_0x5bea79[_0x32b6('0x48')]=_0x5bea79[_0x32b6('0x48')][_0x32b6('0x49')]?_0x5bea79[_0x32b6('0x48')]:_0x4a8e87['model'];if(!_0x1cb214[_0x32b6('0x45')][_0x32b6('0x4a')]('nolimit')){_0x5bea79[_0x32b6('0x1d')]=qs[_0x32b6('0x1d')](_0x1cb214['query']['limit']);_0x5bea79[_0x32b6('0x20')]=qs[_0x32b6('0x20')](_0x1cb214[_0x32b6('0x45')][_0x32b6('0x20')]);}_0x5bea79['order']=qs[_0x32b6('0x4c')](_0x1cb214[_0x32b6('0x45')][_0x32b6('0x4c')]);_0x5bea79[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_[_0x32b6('0x4f')](_0x1cb214['query'],_0x4a8e87['filters']));_0x5bea79[_0x32b6('0x4d')][_0x32b6('0x69')]=_0x514353['id'];if(_0x1cb214['query']['filter']){_0x5bea79[_0x32b6('0x4d')]=_['merge'](_0x5bea79[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0x5bea79['attributes'],function(_0x39c6d4){var _0x1ce3e6={};_0x1ce3e6[_0x39c6d4]={'$like':'%'+_0x1cb214[_0x32b6('0x45')][_0x32b6('0x50')]+'%'};return _0x1ce3e6;})});}if(_0x1cb214['query'][_0x32b6('0x96')]){var _0x29efc0=_0x1cb214[_0x32b6('0x45')]['$gte'][_0x32b6('0x97')](',');var _0x792603={};_0x792603[_0x29efc0[0x0]]={'$gte':moment(_0x29efc0[0x1])[_0x32b6('0x98')](_0x32b6('0x99'))};_0x5bea79[_0x32b6('0x4d')]=_[_0x32b6('0x51')](_0x5bea79[_0x32b6('0x4d')],_0x792603);}_0x5bea79=_[_0x32b6('0x51')]({},_0x5bea79,_0x1cb214[_0x32b6('0x54')]);return db[_0x32b6('0x95')][_0x32b6('0x1f')]({'where':_0x5bea79[_0x32b6('0x4d')]})[_0x32b6('0x10')](function(_0xdc7fb8){_0x57a8b5[_0x32b6('0x1f')]=_0xdc7fb8;if(_0x1cb214[_0x32b6('0x45')]['includeAll']){_0x5bea79[_0x32b6('0x57')]=[{'all':!![]}];}return db[_0x32b6('0x95')][_0x32b6('0x6a')](_0x5bea79);})[_0x32b6('0x10')](function(_0x2f8721){if(_0x1cb214['query'][_0x32b6('0x9a')]===_0x32b6('0x9b')){for(var _0x1e0570=0x0;_0x1e0570<_0x2f8721[_0x32b6('0x49')];_0x1e0570++){_0x2f8721[_0x1e0570]['body']=juice(_0x2f8721[_0x1e0570][_0x32b6('0x5e')]);}}_0x57a8b5[_0x32b6('0x58')]=_0x2f8721;return _0x57a8b5;});}})[_0x32b6('0x10')](respondWithFilteredResult(_0x523aac,_0x5bea79))[_0x32b6('0x63')](handleError(_0x523aac,null));};exports[_0x32b6('0x92')]=function(_0x3b04e0,_0x461c1e){var _0x2e7139,_0x1eeec7={},_0x2626ad;if(_0x3b04e0[_0x32b6('0x5e')]['to']){_0x2626ad=_0x3b04e0[_0x32b6('0x5e')]['to'][_0x32b6('0x97')](',')[0x0];}return db[_0x32b6('0x55')]['find']({'where':{'id':_0x3b04e0[_0x32b6('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x32b6('0x9c'),'include':[{'model':db[_0x32b6('0x84')],'as':_0x32b6('0x9d'),'where':{'email':_0x2626ad},'limit':0x1,'order':[['updatedAt',_0x32b6('0x9e')]]}]},{'model':db[_0x32b6('0x5b')],'as':_0x32b6('0x3c'),'raw':!![],'include':[{'model':db[_0x32b6('0x9f')],'as':_0x32b6('0x9f'),'raw':!![]}]}]})[_0x32b6('0x10')](handleEntityNotFound(_0x461c1e,null))[_0x32b6('0x10')](function(_0x1d8d2e){if(!_0x1d8d2e)return;_0x2e7139=_0x1d8d2e;if(!_0x1d8d2e[_0x32b6('0x3c')])throw new Error(_0x32b6('0xa0'));if(_[_0x32b6('0xa1')](_0x3b04e0[_0x32b6('0x5e')]['from'])){_0x3b04e0[_0x32b6('0x5e')][_0x32b6('0xa2')]=util[_0x32b6('0x98')]('%s\x20<%s>',_0x1d8d2e[_0x32b6('0x27')],_0x1d8d2e[_0x32b6('0xa3')]||_0x1d8d2e[_0x32b6('0x3c')][_0x32b6('0x3a')]);}if(_0x3b04e0[_0x32b6('0x5e')][_0x32b6('0xa4')]&&_0x3b04e0[_0x32b6('0x5e')][_0x32b6('0xa4')]['length']){for(var _0x3940ec=0x0;_0x3940ec<_0x3b04e0['body'][_0x32b6('0xa4')][_0x32b6('0x49')];_0x3940ec+=0x1){_0x3b04e0['body'][_0x32b6('0xa4')][_0x3940ec]={'filename':_0x3b04e0[_0x32b6('0x5e')]['attachments'][_0x3940ec][_0x32b6('0x27')],'path':path[_0x32b6('0xa5')](config[_0x32b6('0xa6')],'server/files/attachments',_0x3b04e0[_0x32b6('0x5e')][_0x32b6('0xa4')][_0x3940ec]['basename'])};}}var _0x4ad282=_0x1d8d2e[_0x32b6('0xa7')]();return respondWithRpcPromise('SendMail',_0x32b6('0xa8'),{'account':_0x4ad282,'message':_0x3b04e0['body']});})[_0x32b6('0x10')](function(_0x4dbe66){if(!_0x4dbe66)return;_0x1eeec7=_0x4dbe66;if(!_0x2e7139[_0x32b6('0x9c')])throw new Error(_0x32b6('0xa9'));if(_0x2e7139[_0x32b6('0x9c')][_0x32b6('0x9d')][_0x32b6('0x49')])return _0x2e7139[_0x32b6('0x9c')][_0x32b6('0x9d')][0x0];return db[_0x32b6('0x84')]['create'](_['defaults'](_0x3b04e0[_0x32b6('0x5e')],{'firstName':_0x3b04e0['body']['to'],'email':_0x3b04e0[_0x32b6('0x5e')]['to'],'phone':_0x3b04e0[_0x32b6('0x5e')]['to'],'ListId':_0x2e7139[_0x32b6('0x71')]}));})['then'](function(_0x14bd71){if(!_0x14bd71)return;var _0x16ac23={'UserId':_0x3b04e0['user']['id'],'ContactId':_0x14bd71['id'],'MailAccountId':_0x2e7139['id'],'inReplyTo':_0x1eeec7[_0x32b6('0xaa')],'to':_0x3b04e0[_0x32b6('0x5e')]['from'],'cc':_0x3b04e0[_0x32b6('0x5e')]['cc'],'subject':_0x3b04e0[_0x32b6('0x5e')][_0x32b6('0xab')],'attach':_0x3b04e0[_0x32b6('0x5e')][_0x32b6('0xac')],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x32b6('0xad'),'Messages':[_[_0x32b6('0x51')](_0x3b04e0['body'],{'messageId':_0x1eeec7['messageId'],'sentAt':moment()['format'](_0x32b6('0x99')),'read':!![],'MailAccountId':_0x2e7139['id'],'UserId':_0x3b04e0[_0x32b6('0x3a')]['id'],'ContactId':_0x14bd71['id']})]};if(_0x3b04e0[_0x32b6('0x5e')]['Interaction']){_0x16ac23=_[_0x32b6('0x51')](_0x16ac23,_0x3b04e0['body'][_0x32b6('0xae')]);}return db[_0x32b6('0x81')][_0x32b6('0x66')](_0x16ac23,{'include':[{'model':db[_0x32b6('0x95')],'as':_0x32b6('0xaf')}]});})[_0x32b6('0x10')](respondWithResult(_0x461c1e,null))[_0x32b6('0x63')](handleError(_0x461c1e,null));};exports[_0x32b6('0xb0')]=function(_0x5c1d3b,_0x43f3a9){return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0x5c1d3b['params']['id']},'include':[{'model':db[_0x32b6('0x5b')],'as':_0x32b6('0x3c'),'raw':!![],'include':[{'model':db[_0x32b6('0x9f')],'as':_0x32b6('0x9f'),'raw':!![]}]}]})[_0x32b6('0x10')](handleEntityNotFound(_0x43f3a9,null))['then'](function(_0x3bd7cb){if(!_0x3bd7cb[_0x32b6('0x3c')])return;var _0x1016ff=_0x3bd7cb[_0x32b6('0xa7')]();return respondWithRpcPromise(_0x32b6('0xb1'),_0x32b6('0xb0'),{'account':_0x1016ff});})['then'](respondWithResult(_0x43f3a9,null))[_0x32b6('0x63')](handleError(_0x43f3a9,null));};exports[_0x32b6('0x23')]=function(_0x249ea5,_0x2acf05){return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0x249ea5[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x2acf05,null))[_0x32b6('0x10')](function(_0x3d92e0){if(_0x3d92e0&&_0x3d92e0['service']){throw new db[(_0x32b6('0xb2'))][(_0x32b6('0xb3'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3d92e0;})[_0x32b6('0x10')](removeEntity(_0x2acf05,null))[_0x32b6('0x63')](handleError(_0x2acf05,null));};exports[_0x32b6('0xb4')]=function(_0x79a41f,_0x39e685){return db['MailAccount'][_0x32b6('0x5c')]({'where':{'id':_0x79a41f['params']['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0x39e685,null))['then'](function(_0x2d66ef){if(_0x2d66ef){return _0x2d66ef['addAgents'](_0x79a41f[_0x32b6('0x5e')][_0x32b6('0x6c')],_[_0x32b6('0x82')](_0x79a41f[_0x32b6('0x5e')],[_0x32b6('0x6c'),'id'])||{})[_0x32b6('0xb5')](function(_0x2228af){for(var _0x1e93ae=0x0;_0x1e93ae<_0x79a41f[_0x32b6('0x5e')][_0x32b6('0x6c')][_0x32b6('0x49')];_0x1e93ae+=0x1){socket[_0x32b6('0xb6')](_0x32b6('0xb7'),{'UserId':Number(_0x79a41f[_0x32b6('0x5e')][_0x32b6('0x6c')][_0x1e93ae]),'MailAccountId':Number(_0x79a41f[_0x32b6('0x5a')]['id'])});}return _0x2228af;});}})[_0x32b6('0x10')](respondWithResult(_0x39e685,null))[_0x32b6('0x63')](handleError(_0x39e685,null));};exports[_0x32b6('0xb8')]=function(_0x303ae4,_0xd82362){return db[_0x32b6('0x55')][_0x32b6('0x5c')]({'where':{'id':_0x303ae4[_0x32b6('0x5a')]['id']}})[_0x32b6('0x10')](handleEntityNotFound(_0xd82362,null))[_0x32b6('0x10')](function(_0x8aa7e4){if(_0x8aa7e4){return _0x8aa7e4[_0x32b6('0xb8')](_0x303ae4[_0x32b6('0x45')][_0x32b6('0x6c')])['then'](function(){if(_[_0x32b6('0xb9')](_0x303ae4['query']['ids'])){for(var _0x14eef6=0x0;_0x14eef6<_0x303ae4[_0x32b6('0x45')][_0x32b6('0x6c')][_0x32b6('0x49')];_0x14eef6+=0x1){socket[_0x32b6('0xb6')](_0x32b6('0xba'),{'UserId':Number(_0x303ae4[_0x32b6('0x45')][_0x32b6('0x6c')][_0x14eef6]),'MailAccountId':Number(_0x303ae4[_0x32b6('0x5a')]['id'])});}}else{socket[_0x32b6('0xb6')](_0x32b6('0xba'),{'UserId':Number(_0x303ae4[_0x32b6('0x45')][_0x32b6('0x6c')]),'MailAccountId':Number(_0x303ae4[_0x32b6('0x5a')]['id'])});}});}})[_0x32b6('0x10')](respondWithStatusCode(_0xd82362,null))[_0x32b6('0x63')](handleError(_0xd82362,null));};exports[_0x32b6('0xbb')]=function(_0x170aeb,_0x17cae2){var _0x11c8d6={};var _0x27662a={};var _0x5d8109;var _0x291ea7;return db['MailAccount'][_0x32b6('0x67')]({'where':{'id':_0x170aeb[_0x32b6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x17cae2,null))[_0x32b6('0x10')](function(_0x28ae89){if(_0x28ae89){_0x5d8109=_0x28ae89;_0x27662a[_0x32b6('0x42')]=_[_0x32b6('0x44')](db['User']['rawAttributes']);_0x27662a['query']=_[_0x32b6('0x44')](_0x170aeb[_0x32b6('0x45')]);_0x27662a['filters']=_['intersection'](_0x27662a[_0x32b6('0x42')],_0x27662a[_0x32b6('0x45')]);_0x11c8d6[_0x32b6('0x48')]=_['intersection'](_0x27662a['model'],qs[_0x32b6('0x47')](_0x170aeb[_0x32b6('0x45')]['fields']));_0x11c8d6[_0x32b6('0x48')]=_0x11c8d6[_0x32b6('0x48')][_0x32b6('0x49')]?_0x11c8d6[_0x32b6('0x48')]:_0x27662a[_0x32b6('0x42')];_0x11c8d6[_0x32b6('0x4b')]=qs[_0x32b6('0x4c')](_0x170aeb[_0x32b6('0x45')][_0x32b6('0x4c')]);_0x11c8d6[_0x32b6('0x4d')]=qs[_0x32b6('0x4e')](_[_0x32b6('0x4f')](_0x170aeb[_0x32b6('0x45')],_0x27662a[_0x32b6('0x4e')]));if(_0x170aeb[_0x32b6('0x45')][_0x32b6('0x50')]){_0x11c8d6[_0x32b6('0x4d')]=_['merge'](_0x11c8d6[_0x32b6('0x4d')],{'$or':_[_0x32b6('0x43')](_0x11c8d6[_0x32b6('0x48')],function(_0x3bd84c){var _0x4f402f={};_0x4f402f[_0x3bd84c]={'$like':'%'+_0x170aeb[_0x32b6('0x45')][_0x32b6('0x50')]+'%'};return _0x4f402f;})});}_0x11c8d6=_[_0x32b6('0x51')]({},_0x11c8d6,_0x170aeb[_0x32b6('0x54')]);return _0x5d8109['getAgents'](_0x11c8d6);}})[_0x32b6('0x10')](function(_0x204f4b){if(_0x204f4b){_0x291ea7=_0x204f4b['length'];if(!_0x170aeb[_0x32b6('0x45')][_0x32b6('0x4a')](_0x32b6('0x6f'))){_0x11c8d6[_0x32b6('0x1d')]=qs['limit'](_0x170aeb['query'][_0x32b6('0x1d')]);_0x11c8d6['offset']=qs[_0x32b6('0x20')](_0x170aeb['query'][_0x32b6('0x20')]);}return _0x5d8109[_0x32b6('0xbb')](_0x11c8d6);}})['then'](function(_0x29182d){if(_0x29182d){return _0x29182d?{'count':_0x291ea7,'rows':_0x29182d}:null;}})[_0x32b6('0x10')](respondWithResult(_0x17cae2,null))[_0x32b6('0x63')](handleError(_0x17cae2,null));}; \ No newline at end of file +var _0x7807=['active','description','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','finally','json','getApplications','getMessages','MailMessage','$gte','format','inlineCss','true','split','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join','root','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','ListId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','sendStatus','stack','name','send','gmail','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','find','body','params','Pause','mandatoryDispositionPause','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','removeDispositions','ids','CannedAnswer','create','removeAnswers','provider','custom'];(function(_0x21e4e8,_0x56756b){var _0x389a84=function(_0x131b30){while(--_0x131b30){_0x21e4e8['push'](_0x21e4e8['shift']());}};_0x389a84(++_0x56756b);}(_0x7807,0x118));var _0x7780=function(_0x5e5cb1,_0x43d287){_0x5e5cb1=_0x5e5cb1-0x0;var _0x3896c9=_0x7807[_0x5e5cb1];return _0x3896c9;};'use strict';var moment=require(_0x7780('0x0'));var BPromise=require(_0x7780('0x1'));var util=require(_0x7780('0x2'));var path=require(_0x7780('0x3'));var _=require('lodash');var juice=require(_0x7780('0x4'));var Redis=require(_0x7780('0x5'));var qs=require(_0x7780('0x6'));var logger=require(_0x7780('0x7'))(_0x7780('0x8'));var config=require(_0x7780('0x9'));var db=require(_0x7780('0xa'))['db'];config['redis']=_[_0x7780('0xb')](config[_0x7780('0xc')],{'host':_0x7780('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7780('0xc')]));require(_0x7780('0xe'))[_0x7780('0xf')](socket);var jayson=require(_0x7780('0x10'));var client=jayson[_0x7780('0x11')][_0x7780('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x37275f,_0x5d1ee1,_0x1e7ffc,_0x349193){return new BPromise(function(_0x32d3a6,_0x4d0145){var _0x1ff702=_0x349193||client;return _0x1ff702[_0x7780('0x13')](_0x37275f,_0x1e7ffc)[_0x7780('0x14')](function(_0x4cf4a3){logger[_0x7780('0x15')](_0x7780('0x16'),_0x5d1ee1,_0x7780('0x17'));logger['debug'](_0x7780('0x18'),_0x5d1ee1,_0x7780('0x17'),JSON[_0x7780('0x19')](_0x4cf4a3));if(_0x4cf4a3[_0x7780('0x1a')]){if(_0x4cf4a3[_0x7780('0x1a')][_0x7780('0x1b')]===0x1f4){logger['error'](_0x7780('0x16'),_0x5d1ee1,_0x4cf4a3['error'][_0x7780('0x1c')]);return _0x4d0145(_0x4cf4a3[_0x7780('0x1a')][_0x7780('0x1c')]);}logger['error'](_0x7780('0x16'),_0x5d1ee1,_0x4cf4a3['error'][_0x7780('0x1c')]);return _0x32d3a6(_0x4cf4a3[_0x7780('0x1a')][_0x7780('0x1c')]);}else{logger['info'](_0x7780('0x16'),_0x5d1ee1,'request\x20sent');_0x32d3a6(_0x4cf4a3[_0x7780('0x1d')]['message']);}})[_0x7780('0x1e')](function(_0x13eaf6){logger['error'](_0x7780('0x16'),_0x5d1ee1,_0x13eaf6);_0x4d0145(_0x13eaf6);});});}function respondWithStatusCode(_0x55b8c3,_0x333a83){_0x333a83=_0x333a83||0xcc;return function(_0x957233){if(_0x957233){return _0x55b8c3['sendStatus'](_0x333a83);}return _0x55b8c3[_0x7780('0x1f')](_0x333a83)[_0x7780('0x20')]();};}function respondWithResult(_0xcfd4c3,_0x21dcc0){_0x21dcc0=_0x21dcc0||0xc8;return function(_0x18441b){if(_0x18441b){return _0xcfd4c3[_0x7780('0x1f')](_0x21dcc0)['json'](_0x18441b);}};}function respondWithFilteredResult(_0x5c5944,_0x2d7dc5){return function(_0x27cd01){if(_0x27cd01){var _0x89a9c=typeof _0x2d7dc5[_0x7780('0x21')]===_0x7780('0x22')&&typeof _0x2d7dc5[_0x7780('0x23')]==='undefined';var _0x72d359=_0x27cd01[_0x7780('0x24')];var _0x2cdfa6=_0x89a9c?0x0:_0x2d7dc5[_0x7780('0x21')];var _0x53b2ac=_0x89a9c?_0x27cd01[_0x7780('0x24')]:_0x2d7dc5['offset']+_0x2d7dc5[_0x7780('0x23')];var _0x18b0d6;if(_0x53b2ac>=_0x72d359){_0x53b2ac=_0x72d359;_0x18b0d6=0xc8;}else{_0x18b0d6=0xce;}_0x5c5944[_0x7780('0x1f')](_0x18b0d6);return _0x5c5944[_0x7780('0x25')](_0x7780('0x26'),_0x2cdfa6+'-'+_0x53b2ac+'/'+_0x72d359)['json'](_0x27cd01);}return null;};}function saveUpdates(_0x3647fd){return function(_0x52ff33){if(_0x52ff33){return _0x52ff33[_0x7780('0x27')](_0x3647fd)[_0x7780('0x14')](function(_0x16f0ff){return _0x16f0ff;});}return null;};}function removeEntity(_0x53eb72){return function(_0x60b0bc){if(_0x60b0bc){return _0x60b0bc[_0x7780('0x28')]()[_0x7780('0x14')](function(){var _0x35258f=_0x60b0bc[_0x7780('0x29')]({'plain':!![]});var _0x552f8f=_0x7780('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x552f8f,'resourceId':_0x35258f['id']}})[_0x7780('0x14')](function(){return _0x60b0bc;});})[_0x7780('0x14')](function(){_0x53eb72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22cf17){return function(_0x26ab10){if(!_0x26ab10){_0x22cf17[_0x7780('0x2b')](0x194);}return _0x26ab10;};}function handleError(_0x54f317,_0x297640){_0x297640=_0x297640||0x1f4;return function(_0x3c2e4){logger[_0x7780('0x1a')](_0x3c2e4[_0x7780('0x2c')]);if(_0x3c2e4[_0x7780('0x2d')]){delete _0x3c2e4[_0x7780('0x2d')];}_0x54f317['status'](_0x297640)[_0x7780('0x2e')](_0x3c2e4);};}function getImapHost(_0xcda7da){switch(_0xcda7da){case _0x7780('0x2f'):return'imap.gmail.com';case'yahoo':return _0x7780('0x30');case _0x7780('0x31'):return _0x7780('0x32');case'outlook365':return _0x7780('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0xcda7da);}function getSmtpHost(_0x460b24){switch(_0x460b24){case'gmail':return _0x7780('0x34');case _0x7780('0x35'):return _0x7780('0x36');case _0x7780('0x31'):return _0x7780('0x37');case _0x7780('0x38'):return _0x7780('0x39');}throw new Error('Unknown\x20email\x20service\x20provider',_0x460b24);}function getAuthenticationOptions(_0x58a9aa,_0x22e43f){var _0x39c955={};var _0x277e7c={};if(_0x58a9aa){_0x39c955[_0x7780('0x3a')]=_0x277e7c[_0x7780('0x3a')]=_0x22e43f[_0x7780('0x3b')];_0x39c955[_0x7780('0x3c')]=_0x277e7c[_0x7780('0x3d')]=_0x22e43f[_0x7780('0x3c')];if(_0x22e43f[_0x7780('0x3e')]){_0x39c955['modernAuthentication']=_0x277e7c[_0x7780('0x3e')]=!![];_0x39c955[_0x7780('0x3f')]=_0x277e7c[_0x7780('0x3f')]=_0x22e43f[_0x7780('0x3f')];_0x39c955['password']=_0x277e7c[_0x7780('0x3d')]=null;}else{_0x39c955[_0x7780('0x3f')]=_0x277e7c[_0x7780('0x3f')]=null;}_0x39c955[_0x7780('0x40')]=getImapHost(_0x58a9aa);_0x39c955[_0x7780('0x41')]=0x3e1;_0x277e7c['host']=getSmtpHost(_0x58a9aa);_0x277e7c[_0x7780('0x41')]=0x24b;_0x277e7c[_0x7780('0x42')]=![];_0x39c955[_0x7780('0x43')]=_0x277e7c[_0x7780('0x43')]=null;}else{if(_0x22e43f['authentication']){_0x39c955['user']=_0x277e7c[_0x7780('0x3a')]=_0x22e43f['username'];_0x39c955[_0x7780('0x3c')]=_0x277e7c['pass']=_0x22e43f[_0x7780('0x3c')];}else{_0x39c955[_0x7780('0x44')]=_0x277e7c[_0x7780('0x44')]=![];_0x39c955[_0x7780('0x3a')]=_0x277e7c[_0x7780('0x3a')]=null;_0x39c955['password']=_0x277e7c[_0x7780('0x3d')]=null;}_0x39c955['host']=_0x22e43f[_0x7780('0x45')][_0x7780('0x40')];_0x39c955[_0x7780('0x41')]=_0x22e43f['Imap'][_0x7780('0x41')];_0x277e7c[_0x7780('0x40')]=_0x22e43f[_0x7780('0x46')][_0x7780('0x40')];_0x277e7c[_0x7780('0x41')]=_0x22e43f[_0x7780('0x46')]['port'];}return{'Imap':_0x39c955,'Smtp':_0x277e7c};}exports[_0x7780('0x47')]=function(_0x32c8db,_0x3b2468){var _0x469523={'include':[{'model':db[_0x7780('0x48')],'as':'Imap'},{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x11daab={},_0x4223dc={'count':0x0,'rows':[]};var _0x45c60a=_['map'](db[_0x7780('0x4a')][_0x7780('0x4b')],function(_0x168225){return{'name':_0x168225[_0x7780('0x4c')],'type':_0x168225[_0x7780('0x4d')][_0x7780('0x4e')]};});_0x11daab[_0x7780('0x4f')]=_['map'](_0x45c60a,_0x7780('0x2d'));_0x11daab[_0x7780('0x50')]=_[_0x7780('0x51')](_0x32c8db[_0x7780('0x50')]);_0x11daab[_0x7780('0x52')]=_[_0x7780('0x53')](_0x11daab[_0x7780('0x4f')],_0x11daab['query']);_0x469523[_0x7780('0x54')]=_[_0x7780('0x53')](_0x11daab[_0x7780('0x4f')],qs[_0x7780('0x55')](_0x32c8db['query'][_0x7780('0x55')]));_0x469523['attributes']=_0x469523[_0x7780('0x54')][_0x7780('0x56')]?_0x469523[_0x7780('0x54')]:_0x11daab[_0x7780('0x4f')];if(!_0x32c8db[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x469523[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x32c8db[_0x7780('0x50')][_0x7780('0x23')]);_0x469523['offset']=qs[_0x7780('0x21')](_0x32c8db['query'][_0x7780('0x21')]);}_0x469523[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0x32c8db[_0x7780('0x50')][_0x7780('0x5a')]);_0x469523[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x32c8db[_0x7780('0x50')],_0x11daab[_0x7780('0x52')]),_0x45c60a);if(_0x32c8db[_0x7780('0x50')][_0x7780('0x5d')]){_0x469523[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x469523[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x45c60a,function(_0x438eb8){if(_0x438eb8['type']!==_0x7780('0x60')){var _0x13c95f={};_0x13c95f[_0x438eb8[_0x7780('0x2d')]]={'$like':'%'+_0x32c8db[_0x7780('0x50')]['filter']+'%'};return _0x13c95f;}})});}_0x469523=_[_0x7780('0x5e')]({},_0x469523,_0x32c8db[_0x7780('0x61')]);var _0x4a5b7c={'where':_0x469523['where']};return db[_0x7780('0x4a')][_0x7780('0x24')](_0x4a5b7c)['then'](function(_0x28106f){_0x4223dc[_0x7780('0x24')]=_0x28106f;if(_0x32c8db['query'][_0x7780('0x62')]){_0x469523[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x4a')][_0x7780('0x64')](_0x469523);})['then'](function(_0x390820){_0x4223dc[_0x7780('0x65')]=_0x390820;return _0x4223dc;})[_0x7780('0x14')](respondWithFilteredResult(_0x3b2468,_0x469523))[_0x7780('0x1e')](handleError(_0x3b2468,null));};exports['show']=function(_0xe93d9,_0x4d0892){var _0x4dd132={'raw':![],'where':{'id':_0xe93d9['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x7780('0x45')},{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x171e7a={};_0x171e7a['model']=_[_0x7780('0x51')](db[_0x7780('0x4a')][_0x7780('0x4b')]);_0x171e7a[_0x7780('0x50')]=_['keys'](_0xe93d9[_0x7780('0x50')]);_0x171e7a[_0x7780('0x52')]=_['intersection'](_0x171e7a[_0x7780('0x4f')],_0x171e7a['query']);_0x4dd132[_0x7780('0x54')]=_[_0x7780('0x53')](_0x171e7a[_0x7780('0x4f')],qs[_0x7780('0x55')](_0xe93d9['query'][_0x7780('0x55')]));_0x4dd132['attributes']=_0x4dd132[_0x7780('0x54')][_0x7780('0x56')]?_0x4dd132[_0x7780('0x54')]:_0x171e7a[_0x7780('0x4f')];if(_0xe93d9['query'][_0x7780('0x62')]){_0x4dd132[_0x7780('0x63')]=[{'all':!![]}];}_0x4dd132=_['merge']({},_0x4dd132,_0xe93d9[_0x7780('0x61')]);return db['MailAccount'][_0x7780('0x66')](_0x4dd132)[_0x7780('0x14')](handleEntityNotFound(_0x4d0892,null))['then'](respondWithResult(_0x4d0892,null))[_0x7780('0x1e')](handleError(_0x4d0892,null));};exports[_0x7780('0x27')]=function(_0x54b5ad,_0x243bf4){if(_0x54b5ad[_0x7780('0x67')]['id']){delete _0x54b5ad[_0x7780('0x67')]['id'];}var _0x17b967=_0x54b5ad[_0x7780('0x67')]['provider']==='custom'?null:_0x54b5ad[_0x7780('0x67')]['provider'];var _0x287898=_0x54b5ad[_0x7780('0x67')][_0x7780('0x45')]||{};var _0x101b15=_0x54b5ad[_0x7780('0x67')]['Smtp']||{};if(_0x17b967){_0x287898['host']=getImapHost(_0x17b967);_0x287898[_0x7780('0x41')]=0x3e1;_0x101b15['host']=getSmtpHost(_0x17b967);_0x101b15[_0x7780('0x41')]=0x24b;_0x101b15[_0x7780('0x42')]=![];}if(_0x101b15['modernAuthentication']){_0x101b15[_0x7780('0x42')]=![];}else{_0x101b15[_0x7780('0x3f')]=null;}if(!_0x287898['modernAuthentication'])_0x287898[_0x7780('0x3f')]=null;_0x54b5ad[_0x7780('0x67')][_0x7780('0x45')]=_0x287898;_0x54b5ad[_0x7780('0x67')][_0x7780('0x46')]=_0x101b15;return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x54b5ad[_0x7780('0x68')]['id']},'include':[{'model':db[_0x7780('0x48')],'as':_0x7780('0x45')},{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db[_0x7780('0x69')],'as':_0x7780('0x6a')}]})['then'](handleEntityNotFound(_0x243bf4,null))['then'](function(_0x26d79b){if(!_0x26d79b)throw new Error(_0x7780('0x6b'));if(_0x26d79b[_0x7780('0x43')])delete _0x54b5ad[_0x7780('0x67')]['Imap'];return _0x26d79b;})[_0x7780('0x14')](saveUpdates(_0x54b5ad[_0x7780('0x67')],null))['then'](function(_0x3660ee){if(!_0x54b5ad[_0x7780('0x67')]['Imap'])return _0x3660ee;return db[_0x7780('0x48')]['update'](_0x54b5ad[_0x7780('0x67')][_0x7780('0x45')],{'where':{'MailAccountId':_0x3660ee['id']}})[_0x7780('0x14')](function(){return _0x3660ee;});})[_0x7780('0x14')](function(_0xa98454){if(!_0x54b5ad[_0x7780('0x67')][_0x7780('0x46')])return _0xa98454;return db[_0x7780('0x49')][_0x7780('0x27')](_0x54b5ad[_0x7780('0x67')][_0x7780('0x46')],{'where':{'MailAccountId':_0xa98454['id']}})[_0x7780('0x14')](function(){return _0xa98454;});})['then'](respondWithResult(_0x243bf4,null))[_0x7780('0x1e')](handleError(_0x243bf4,null));};exports['describe']=function(_0x636594,_0x3366d7){return db[_0x7780('0x4a')][_0x7780('0x6c')]()[_0x7780('0x14')](respondWithResult(_0x3366d7,null))[_0x7780('0x1e')](handleError(_0x3366d7,null));};exports[_0x7780('0x6d')]=function(_0x65351e,_0x41f271){if(_0x65351e[_0x7780('0x67')]['id']){delete _0x65351e[_0x7780('0x67')]['id'];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x65351e[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x41f271,null))['then'](function(_0x2014a1){if(_0x2014a1){_0x65351e[_0x7780('0x67')][_0x7780('0x6e')]=_0x2014a1['id'];return db[_0x7780('0x6f')]['create'](_0x65351e[_0x7780('0x67')]);}})[_0x7780('0x14')](respondWithResult(_0x41f271,null))[_0x7780('0x1e')](handleError(_0x41f271,null));};exports[_0x7780('0x70')]=function(_0x2089bc,_0x1668dc){var _0x2037c4={'raw':![],'where':{}};var _0x2432bb={};var _0x344fca={'count':0x0,'rows':[]};return db[_0x7780('0x4a')]['findOne']({'where':{'id':_0x2089bc['params']['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x1668dc,null))['then'](function(_0x17750d){if(_0x17750d){_0x2432bb[_0x7780('0x4f')]=_['keys'](db[_0x7780('0x6f')][_0x7780('0x4b')]);_0x2432bb[_0x7780('0x50')]=_[_0x7780('0x51')](_0x2089bc['query']);_0x2432bb[_0x7780('0x52')]=_[_0x7780('0x53')](_0x2432bb[_0x7780('0x4f')],_0x2432bb['query']);_0x2037c4['attributes']=_[_0x7780('0x53')](_0x2432bb['model'],qs[_0x7780('0x55')](_0x2089bc[_0x7780('0x50')][_0x7780('0x55')]));_0x2037c4[_0x7780('0x54')]=_0x2037c4['attributes'][_0x7780('0x56')]?_0x2037c4[_0x7780('0x54')]:_0x2432bb[_0x7780('0x4f')];if(!_0x2089bc[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x2037c4['limit']=qs[_0x7780('0x23')](_0x2089bc[_0x7780('0x50')]['limit']);_0x2037c4[_0x7780('0x21')]=qs['offset'](_0x2089bc['query'][_0x7780('0x21')]);}_0x2037c4[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0x2089bc[_0x7780('0x50')]['sort']);_0x2037c4[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x2089bc['query'],_0x2432bb[_0x7780('0x52')]));_0x2037c4[_0x7780('0x5b')]['MailAccountId']=_0x17750d['id'];if(_0x2089bc[_0x7780('0x50')][_0x7780('0x5d')]){_0x2037c4[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x2037c4[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x2037c4['attributes'],function(_0x3a7d25){var _0x309881={};_0x309881[_0x3a7d25]={'$like':'%'+_0x2089bc[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x309881;})});}_0x2037c4=_[_0x7780('0x5e')]({},_0x2037c4,_0x2089bc[_0x7780('0x61')]);return db[_0x7780('0x6f')]['count']({'where':_0x2037c4[_0x7780('0x5b')]})['then'](function(_0x563120){_0x344fca[_0x7780('0x24')]=_0x563120;if(_0x2089bc[_0x7780('0x50')][_0x7780('0x62')]){_0x2037c4[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x6f')][_0x7780('0x64')](_0x2037c4);})[_0x7780('0x14')](function(_0x1fed3b){_0x344fca[_0x7780('0x65')]=_0x1fed3b;return _0x344fca;});}})[_0x7780('0x14')](respondWithFilteredResult(_0x1668dc,_0x2037c4))['catch'](handleError(_0x1668dc,null));};exports[_0x7780('0x71')]=function(_0x1fa28a,_0x13c281){return db[_0x7780('0x4a')]['find']({'where':{'id':_0x1fa28a[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x13c281,null))[_0x7780('0x14')](function(_0x52ad73){if(_0x52ad73){return _0x52ad73['removeDispositions'](_0x1fa28a['query'][_0x7780('0x72')]);}})['then'](respondWithStatusCode(_0x13c281,null))[_0x7780('0x1e')](handleError(_0x13c281,null));};exports['addAnswer']=function(_0x402c6a,_0xbffdff){if(_0x402c6a['body']['id']){delete _0x402c6a['body']['id'];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x402c6a['params']['id']}})[_0x7780('0x14')](handleEntityNotFound(_0xbffdff,null))[_0x7780('0x14')](function(_0x1d7d49){if(_0x1d7d49){_0x402c6a[_0x7780('0x67')][_0x7780('0x6e')]=_0x1d7d49['id'];return db[_0x7780('0x73')][_0x7780('0x74')](_0x402c6a[_0x7780('0x67')]);}})[_0x7780('0x14')](respondWithResult(_0xbffdff,null))[_0x7780('0x1e')](handleError(_0xbffdff,null));};exports['getAnswers']=function(_0xc2a558,_0x2ae13f){var _0x453f7f={'raw':![],'where':{}};var _0xb2aea2={};var _0xb8dc16={'count':0x0,'rows':[]};return db[_0x7780('0x4a')]['findOne']({'where':{'id':_0xc2a558[_0x7780('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ae13f,null))[_0x7780('0x14')](function(_0x151888){if(_0x151888){_0xb2aea2[_0x7780('0x4f')]=_['keys'](db[_0x7780('0x73')][_0x7780('0x4b')]);_0xb2aea2['query']=_['keys'](_0xc2a558[_0x7780('0x50')]);_0xb2aea2[_0x7780('0x52')]=_[_0x7780('0x53')](_0xb2aea2['model'],_0xb2aea2[_0x7780('0x50')]);_0x453f7f[_0x7780('0x54')]=_[_0x7780('0x53')](_0xb2aea2['model'],qs[_0x7780('0x55')](_0xc2a558[_0x7780('0x50')][_0x7780('0x55')]));_0x453f7f[_0x7780('0x54')]=_0x453f7f[_0x7780('0x54')][_0x7780('0x56')]?_0x453f7f[_0x7780('0x54')]:_0xb2aea2[_0x7780('0x4f')];if(!_0xc2a558[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x453f7f[_0x7780('0x23')]=qs[_0x7780('0x23')](_0xc2a558[_0x7780('0x50')]['limit']);_0x453f7f[_0x7780('0x21')]=qs[_0x7780('0x21')](_0xc2a558[_0x7780('0x50')][_0x7780('0x21')]);}_0x453f7f[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0xc2a558[_0x7780('0x50')][_0x7780('0x5a')]);_0x453f7f['where']=qs[_0x7780('0x52')](_['pick'](_0xc2a558['query'],_0xb2aea2[_0x7780('0x52')]));_0x453f7f[_0x7780('0x5b')]['MailAccountId']=_0x151888['id'];if(_0xc2a558['query'][_0x7780('0x5d')]){_0x453f7f[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x453f7f[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x453f7f[_0x7780('0x54')],function(_0x2ac822){var _0x283eec={};_0x283eec[_0x2ac822]={'$like':'%'+_0xc2a558[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x283eec;})});}_0x453f7f=_[_0x7780('0x5e')]({},_0x453f7f,_0xc2a558[_0x7780('0x61')]);return db[_0x7780('0x73')][_0x7780('0x24')]({'where':_0x453f7f[_0x7780('0x5b')]})[_0x7780('0x14')](function(_0x74a75c){_0xb8dc16[_0x7780('0x24')]=_0x74a75c;if(_0xc2a558[_0x7780('0x50')][_0x7780('0x62')]){_0x453f7f[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x73')]['findAll'](_0x453f7f);})[_0x7780('0x14')](function(_0x439401){_0xb8dc16[_0x7780('0x65')]=_0x439401;return _0xb8dc16;});}})['then'](respondWithFilteredResult(_0x2ae13f,_0x453f7f))[_0x7780('0x1e')](handleError(_0x2ae13f,null));};exports[_0x7780('0x75')]=function(_0x3e2796,_0x1d355b){return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x3e2796[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x1d355b,null))['then'](function(_0x3bb15b){if(_0x3bb15b){return _0x3bb15b[_0x7780('0x75')](_0x3e2796[_0x7780('0x50')]['ids']);}})[_0x7780('0x14')](respondWithStatusCode(_0x1d355b,null))[_0x7780('0x1e')](handleError(_0x1d355b,null));};exports[_0x7780('0x74')]=function(_0x119423,_0x22af1f){var _0x51222f={'name':_0x119423[_0x7780('0x67')][_0x7780('0x2d')],'key':_0x119423[_0x7780('0x67')][_0x7780('0x4e')],'provider':_0x119423[_0x7780('0x67')][_0x7780('0x76')]===_0x7780('0x77')?null:_0x119423[_0x7780('0x67')][_0x7780('0x76')],'email':_0x119423[_0x7780('0x67')]['email'],'ListId':_0x119423[_0x7780('0x67')]['ListId'],'active':!_['isNil'](_0x119423['body'][_0x7780('0x78')])?_0x119423[_0x7780('0x67')][_0x7780('0x78')]:!![],'description':_0x119423[_0x7780('0x67')][_0x7780('0x79')]||null};var _0xed5b08=getAuthenticationOptions(_0x51222f['provider'],_0x119423[_0x7780('0x67')]);_0x51222f[_0x7780('0x45')]=_0xed5b08['Imap'];_0x51222f['Smtp']=_0xed5b08['Smtp'];return db[_0x7780('0x4a')]['create'](_0x51222f,{'include':[{'model':db[_0x7780('0x49')],'as':_0x7780('0x46')},{'model':db[_0x7780('0x48')],'as':_0x7780('0x45')}]})[_0x7780('0x14')](function(_0x2e02e1){var _0x3a7523=_0x119423[_0x7780('0x3a')][_0x7780('0x29')]({'plain':!![]});if(!_0x3a7523)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a7523[_0x7780('0x7a')]==='user'){var _0x18e430=_0x2e02e1[_0x7780('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x7780('0x66')]({'where':{'name':_0x7780('0x2a'),'userProfileId':_0x3a7523[_0x7780('0x7b')]},'raw':!![]})[_0x7780('0x14')](function(_0x18aeb6){if(_0x18aeb6&&_0x18aeb6[_0x7780('0x7c')]===0x0){return db['UserProfileResource'][_0x7780('0x74')]({'name':_0x18e430[_0x7780('0x2d')],'resourceId':_0x18e430['id'],'type':_0x18aeb6['name'],'sectionId':_0x18aeb6['id']},{})['then'](function(){return _0x2e02e1;});}else{return _0x2e02e1;}})['catch'](function(_0x3b8b57){logger[_0x7780('0x1a')](_0x7780('0x7d'),_0x3b8b57);throw _0x3b8b57;});}return _0x2e02e1;})[_0x7780('0x14')](respondWithResult(_0x22af1f,0xc9))[_0x7780('0x1e')](handleError(_0x22af1f,null));};exports[_0x7780('0x7e')]=function(_0x2a3be2,_0x514eba){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x2a3be2[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x514eba,null))['then'](function(_0x5458e4){if(_0x5458e4){return _0x5458e4[_0x7780('0x7e')]();}return null;})[_0x7780('0x14')](respondWithResult(_0x514eba,null))[_0x7780('0x1e')](handleError(_0x514eba,null));};exports[_0x7780('0x80')]=function(_0x5d524d,_0x37d1f2){if(_0x5d524d[_0x7780('0x67')]['id']){delete _0x5d524d[_0x7780('0x67')]['id'];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x5d524d[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x37d1f2,null))['then'](function(_0x4795bd){if(_0x4795bd){_0x5d524d[_0x7780('0x67')]['MailAccountId']=_0x4795bd['id'];return db['MailServerIn'][_0x7780('0x74')](_0x5d524d[_0x7780('0x67')]);}})[_0x7780('0x14')](respondWithResult(_0x37d1f2,null))[_0x7780('0x1e')](handleError(_0x37d1f2,null));};exports[_0x7780('0x81')]=function(_0x89459d,_0x105d78){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x89459d[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x105d78,null))['then'](function(_0x4ab92e){if(_0x4ab92e){return _0x4ab92e[_0x7780('0x82')](null);}return null;})[_0x7780('0x14')](respondWithStatusCode(_0x105d78,null))[_0x7780('0x1e')](handleError(_0x105d78,null));};exports[_0x7780('0x83')]=function(_0x93cb89,_0x28501a){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x93cb89['params']['id']}})['then'](handleEntityNotFound(_0x28501a,null))[_0x7780('0x14')](function(_0x3db94e){if(_0x3db94e){return _0x3db94e[_0x7780('0x83')]();}return null;})[_0x7780('0x14')](respondWithResult(_0x28501a,null))[_0x7780('0x1e')](handleError(_0x28501a,null));};exports[_0x7780('0x84')]=function(_0x34f0e7,_0x178a09){if(_0x34f0e7[_0x7780('0x67')]['id']){delete _0x34f0e7[_0x7780('0x67')]['id'];}return db['MailAccount'][_0x7780('0x66')]({'where':{'id':_0x34f0e7[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x178a09,null))[_0x7780('0x14')](function(_0x292a51){if(_0x292a51){_0x34f0e7[_0x7780('0x67')][_0x7780('0x6e')]=_0x292a51['id'];return db[_0x7780('0x49')][_0x7780('0x74')](_0x34f0e7[_0x7780('0x67')]);}})['then'](respondWithResult(_0x178a09,null))[_0x7780('0x1e')](handleError(_0x178a09,null));};exports[_0x7780('0x85')]=function(_0x64b9c,_0x7947f7){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x64b9c[_0x7780('0x68')]['id']}})['then'](handleEntityNotFound(_0x7947f7,null))[_0x7780('0x14')](function(_0x33283f){if(_0x33283f){return _0x33283f[_0x7780('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x7947f7,null))[_0x7780('0x1e')](handleError(_0x7947f7,null));};exports[_0x7780('0x87')]=function(_0x244131,_0x20a90e){return db[_0x7780('0x88')]['find']({'where':{'id':_0x244131[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x20a90e,null))[_0x7780('0x14')](function(_0x127a70){if(_0x127a70){return _0x127a70[_0x7780('0x87')](_0x244131['body'][_0x7780('0x72')],_[_0x7780('0x89')](_0x244131[_0x7780('0x67')],[_0x7780('0x72'),'id'])||{});}})['then'](respondWithResult(_0x20a90e,null))[_0x7780('0x1e')](handleError(_0x20a90e,null));};exports['getInteractions']=function(_0x1dca45,_0xe2823d){var _0x43ac12={'raw':![],'where':{}};var _0x2ed708={};var _0x2c683a={'count':0x0,'rows':[]};return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x1dca45[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0xe2823d,null))[_0x7780('0x14')](function(_0x111fe4){if(_0x111fe4){_0x2ed708[_0x7780('0x4f')]=_[_0x7780('0x51')](db[_0x7780('0x88')][_0x7780('0x4b')]);_0x2ed708[_0x7780('0x50')]=_['keys'](_0x1dca45[_0x7780('0x50')]);_0x2ed708['filters']=_[_0x7780('0x53')](_0x2ed708['model'],_0x2ed708[_0x7780('0x50')]);_0x43ac12[_0x7780('0x54')]=_[_0x7780('0x53')](_0x2ed708['model'],qs[_0x7780('0x55')](_0x1dca45[_0x7780('0x50')][_0x7780('0x55')]));_0x43ac12['attributes']=_0x43ac12['attributes'][_0x7780('0x56')]?_0x43ac12[_0x7780('0x54')]:_0x2ed708[_0x7780('0x4f')];if(!_0x1dca45[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x43ac12[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x1dca45[_0x7780('0x50')][_0x7780('0x23')]);_0x43ac12[_0x7780('0x21')]=qs[_0x7780('0x21')](_0x1dca45['query']['offset']);}_0x43ac12['order']=qs[_0x7780('0x5a')](_0x1dca45[_0x7780('0x50')][_0x7780('0x5a')]);_0x43ac12[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x1dca45[_0x7780('0x50')],_0x2ed708[_0x7780('0x52')]));_0x43ac12[_0x7780('0x5b')][_0x7780('0x6e')]=_0x111fe4['id'];if(_0x1dca45[_0x7780('0x50')][_0x7780('0x5d')]){_0x43ac12['where']=_[_0x7780('0x5e')](_0x43ac12['where'],{'$or':_[_0x7780('0x5f')](_0x43ac12[_0x7780('0x54')],function(_0x3d3142){var _0x5b5677={};_0x5b5677[_0x3d3142]={'$like':'%'+_0x1dca45[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x5b5677;})});}_0x43ac12=_[_0x7780('0x5e')]({},_0x43ac12,_0x1dca45[_0x7780('0x61')]);return db['MailInteraction'][_0x7780('0x24')]({'where':_0x43ac12['where']})[_0x7780('0x14')](function(_0x49ff24){_0x2c683a[_0x7780('0x24')]=_0x49ff24;if(_0x1dca45[_0x7780('0x50')][_0x7780('0x62')]){_0x43ac12['include']=[{'model':db['CmContact'],'as':_0x7780('0x8a'),'required':![]},{'model':db[_0x7780('0x8b')],'as':_0x7780('0x8c'),'attributes':[_0x7780('0x2d'),_0x7780('0x8d'),_0x7780('0x8e')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x7780('0x8f')],'where':_0x1dca45['query'][_0x7780('0x90')]?{'id':_0x1dca45[_0x7780('0x50')][_0x7780('0x90')]}:undefined,'required':_0x1dca45[_0x7780('0x50')][_0x7780('0x90')]?!![]:![]}];}return db[_0x7780('0x88')][_0x7780('0x64')](_0x43ac12);})[_0x7780('0x14')](function(_0x40e345){_0x2c683a['rows']=_0x40e345;return _0x2c683a;});}})[_0x7780('0x14')](respondWithFilteredResult(_0xe2823d,_0x43ac12))[_0x7780('0x1e')](handleError(_0xe2823d,null));};exports[_0x7780('0x91')]=function addApplications(_0x32c50b,_0x30022a){var _0x17cdaf=_0x32c50b[_0x7780('0x68')]['id'];var _0x430812=_0x32c50b[_0x7780('0x67')];var _0xe11a70=0xc8;var _0x43bdea=null;return db[_0x7780('0x92')]['transaction']({'isolationLevel':db[_0x7780('0x92')][_0x7780('0x93')][_0x7780('0x94')][_0x7780('0x95')]},function(_0x57a56b){return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x17cdaf},'transaction':_0x57a56b})[_0x7780('0x14')](function(_0x29c145){if(_0x29c145){return db[_0x7780('0x96')][_0x7780('0x28')]({'where':{'MailAccountId':_0x17cdaf},'transaction':_0x57a56b})['then'](function(){var _0x44ee1c=_[_0x7780('0x5f')](_0x430812,function(_0x265426){_0x265426['MailAccountId']=_0x17cdaf;return _0x265426;});return db['MailApplication']['bulkCreate'](_0x44ee1c,{'transaction':_0x57a56b});});}else{_0xe11a70=0x194;_0x43bdea=[];}});})[_0x7780('0x14')](function(){if(_0xe11a70!==0x194){return db['MailApplication'][_0x7780('0x97')]({'where':{'MailAccountId':_0x17cdaf},'order':_0x7780('0x98')})[_0x7780('0x14')](function(_0x184ff3){_0x43bdea=_0x184ff3;});}})[_0x7780('0x1e')](function(_0x38c90e){_0xe11a70=0x1f4;logger[_0x7780('0x1a')](_0x38c90e[_0x7780('0x2c')]);if(_0x38c90e[_0x7780('0x2d')]){delete _0x38c90e['name'];}_0x43bdea=_0x38c90e;})[_0x7780('0x99')](function(){if(_0x43bdea===null){_0x30022a['sendStatus'](_0xe11a70);}else{if(_0xe11a70===0x1f4){_0x30022a[_0x7780('0x1f')](_0xe11a70)[_0x7780('0x2e')](_0x43bdea);}else{_0x30022a['status'](_0xe11a70)[_0x7780('0x9a')](_0x43bdea);}}});};exports[_0x7780('0x9b')]=function(_0xce6b75,_0x59f014){var _0xae5437={};var _0x24bc95={};var _0x178f74;var _0xcbf04b;return db['MailAccount'][_0x7780('0x7f')]({'where':{'id':_0xce6b75[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x59f014,null))[_0x7780('0x14')](function(_0x2ae61a){if(_0x2ae61a){_0x178f74=_0x2ae61a;_0x24bc95[_0x7780('0x4f')]=_['keys'](db['MailApplication']['rawAttributes']);_0x24bc95[_0x7780('0x50')]=_[_0x7780('0x51')](_0xce6b75['query']);_0x24bc95[_0x7780('0x52')]=_[_0x7780('0x53')](_0x24bc95['model'],_0x24bc95[_0x7780('0x50')]);_0xae5437['attributes']=_[_0x7780('0x53')](_0x24bc95[_0x7780('0x4f')],qs[_0x7780('0x55')](_0xce6b75['query'][_0x7780('0x55')]));_0xae5437[_0x7780('0x54')]=_0xae5437[_0x7780('0x54')][_0x7780('0x56')]?_0xae5437[_0x7780('0x54')]:_0x24bc95[_0x7780('0x4f')];_0xae5437[_0x7780('0x59')]=qs[_0x7780('0x5a')](_0xce6b75['query'][_0x7780('0x5a')]);_0xae5437['where']=qs['filters'](_[_0x7780('0x5c')](_0xce6b75[_0x7780('0x50')],_0x24bc95['filters']));if(_0xce6b75['query'][_0x7780('0x5d')]){_0xae5437[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0xae5437['where'],{'$or':_[_0x7780('0x5f')](_0xae5437[_0x7780('0x54')],function(_0x4fc09b){var _0x9abb71={};_0x9abb71[_0x4fc09b]={'$like':'%'+_0xce6b75[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x9abb71;})});}_0xae5437=_[_0x7780('0x5e')]({},_0xae5437,_0xce6b75[_0x7780('0x61')]);return _0x178f74[_0x7780('0x9b')](_0xae5437);}})[_0x7780('0x14')](function(_0x4db8be){if(_0x4db8be){_0xcbf04b=_0x4db8be[_0x7780('0x56')];if(!_0xce6b75['query'][_0x7780('0x57')]('nolimit')){_0xae5437[_0x7780('0x23')]=qs[_0x7780('0x23')](_0xce6b75[_0x7780('0x50')][_0x7780('0x23')]);_0xae5437[_0x7780('0x21')]=qs[_0x7780('0x21')](_0xce6b75[_0x7780('0x50')][_0x7780('0x21')]);}return _0x178f74['getApplications'](_0xae5437);}})['then'](function(_0x487ced){if(_0x487ced){return _0x487ced?{'count':_0xcbf04b,'rows':_0x487ced}:null;}})['then'](respondWithResult(_0x59f014,null))[_0x7780('0x1e')](handleError(_0x59f014,null));};exports[_0x7780('0x9c')]=function(_0x47fbc5,_0x3b0519){var _0x27f960={'raw':!![],'where':{}};var _0x2347d3={};var _0x5d2cff={'count':0x0,'rows':[]};return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x47fbc5[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x3b0519,null))[_0x7780('0x14')](function(_0x7f1495){if(_0x7f1495){_0x2347d3[_0x7780('0x4f')]=_[_0x7780('0x51')](db[_0x7780('0x9d')][_0x7780('0x4b')]);_0x2347d3[_0x7780('0x50')]=_[_0x7780('0x51')](_0x47fbc5[_0x7780('0x50')]);_0x2347d3[_0x7780('0x52')]=_[_0x7780('0x53')](_0x2347d3[_0x7780('0x4f')],_0x2347d3[_0x7780('0x50')]);_0x27f960[_0x7780('0x54')]=_[_0x7780('0x53')](_0x2347d3[_0x7780('0x4f')],qs[_0x7780('0x55')](_0x47fbc5[_0x7780('0x50')][_0x7780('0x55')]));_0x27f960[_0x7780('0x54')]=_0x27f960['attributes']['length']?_0x27f960['attributes']:_0x2347d3['model'];if(!_0x47fbc5['query'][_0x7780('0x57')]('nolimit')){_0x27f960[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x47fbc5[_0x7780('0x50')]['limit']);_0x27f960[_0x7780('0x21')]=qs[_0x7780('0x21')](_0x47fbc5[_0x7780('0x50')][_0x7780('0x21')]);}_0x27f960['order']=qs[_0x7780('0x5a')](_0x47fbc5['query'][_0x7780('0x5a')]);_0x27f960[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x47fbc5[_0x7780('0x50')],_0x2347d3[_0x7780('0x52')]));_0x27f960[_0x7780('0x5b')]['MailAccountId']=_0x7f1495['id'];if(_0x47fbc5[_0x7780('0x50')][_0x7780('0x5d')]){_0x27f960['where']=_[_0x7780('0x5e')](_0x27f960[_0x7780('0x5b')],{'$or':_[_0x7780('0x5f')](_0x27f960['attributes'],function(_0x197b15){var _0x485bb0={};_0x485bb0[_0x197b15]={'$like':'%'+_0x47fbc5[_0x7780('0x50')][_0x7780('0x5d')]+'%'};return _0x485bb0;})});}if(_0x47fbc5[_0x7780('0x50')][_0x7780('0x9e')]){var _0x40979d=_0x47fbc5[_0x7780('0x50')][_0x7780('0x9e')]['split'](',');var _0x179238={};_0x179238[_0x40979d[0x0]]={'$gte':moment(_0x40979d[0x1])[_0x7780('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x27f960[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x27f960[_0x7780('0x5b')],_0x179238);}_0x27f960=_[_0x7780('0x5e')]({},_0x27f960,_0x47fbc5[_0x7780('0x61')]);return db['MailMessage'][_0x7780('0x24')]({'where':_0x27f960['where']})[_0x7780('0x14')](function(_0xcdaafd){_0x5d2cff[_0x7780('0x24')]=_0xcdaafd;if(_0x47fbc5[_0x7780('0x50')][_0x7780('0x62')]){_0x27f960[_0x7780('0x63')]=[{'all':!![]}];}return db[_0x7780('0x9d')][_0x7780('0x64')](_0x27f960);})[_0x7780('0x14')](function(_0x33e769){if(_0x47fbc5[_0x7780('0x50')][_0x7780('0xa0')]===_0x7780('0xa1')){for(var _0x2f36e4=0x0;_0x2f36e4<_0x33e769[_0x7780('0x56')];_0x2f36e4++){_0x33e769[_0x2f36e4][_0x7780('0x67')]=juice(_0x33e769[_0x2f36e4][_0x7780('0x67')]);}}_0x5d2cff[_0x7780('0x65')]=_0x33e769;return _0x5d2cff;});}})['then'](respondWithFilteredResult(_0x3b0519,_0x27f960))[_0x7780('0x1e')](handleError(_0x3b0519,null));};exports[_0x7780('0x2e')]=function(_0xb8b06b,_0x131adf){var _0x2c332f,_0x39ccb2={},_0x206515;if(_0xb8b06b[_0x7780('0x67')]['to']){_0x206515=_0xb8b06b[_0x7780('0x67')]['to'][_0x7780('0xa2')](',')[0x0];}return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0xb8b06b[_0x7780('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0x7780('0xa3'),'include':[{'model':db[_0x7780('0xa4')],'as':'Contacts','where':{'email':_0x206515},'limit':0x1,'order':[[_0x7780('0xa5'),_0x7780('0xa6')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x7780('0xa7')],'as':_0x7780('0xa7'),'raw':!![]}]}]})[_0x7780('0x14')](handleEntityNotFound(_0x131adf,null))['then'](function(_0x223c85){if(!_0x223c85)return;_0x2c332f=_0x223c85;if(!_0x223c85['Smtp'])throw new Error(_0x7780('0xa8'));if(_[_0x7780('0xa9')](_0xb8b06b['body'][_0x7780('0xaa')])){_0xb8b06b['body'][_0x7780('0xaa')]=util['format'](_0x7780('0xab'),_0x223c85['name'],_0x223c85[_0x7780('0xac')]||_0x223c85[_0x7780('0x46')]['user']);}if(_0xb8b06b[_0x7780('0x67')][_0x7780('0xad')]&&_0xb8b06b[_0x7780('0x67')]['attachments']['length']){for(var _0x19ef04=0x0;_0x19ef04<_0xb8b06b[_0x7780('0x67')][_0x7780('0xad')][_0x7780('0x56')];_0x19ef04+=0x1){_0xb8b06b['body']['attachments'][_0x19ef04]={'filename':_0xb8b06b[_0x7780('0x67')]['attachments'][_0x19ef04][_0x7780('0x2d')],'path':path[_0x7780('0xae')](config[_0x7780('0xaf')],'server/files/attachments',_0xb8b06b['body'][_0x7780('0xad')][_0x19ef04][_0x7780('0xb0')])};}}var _0x3c2ac4=_0x223c85[_0x7780('0xb1')]();return respondWithRpcPromise(_0x7780('0xb2'),_0x7780('0xb3'),{'account':_0x3c2ac4,'message':_0xb8b06b[_0x7780('0x67')]});})[_0x7780('0x14')](function(_0x39d797){if(!_0x39d797)return;_0x39ccb2=_0x39d797;if(!_0x2c332f[_0x7780('0xa3')])throw new Error(_0x7780('0xb4'));if(_0x2c332f['List'][_0x7780('0xb5')][_0x7780('0x56')])return _0x2c332f[_0x7780('0xa3')][_0x7780('0xb5')][0x0];return db[_0x7780('0xa4')][_0x7780('0x74')](_['defaults'](_0xb8b06b[_0x7780('0x67')],{'firstName':_0xb8b06b[_0x7780('0x67')]['to'],'email':_0xb8b06b[_0x7780('0x67')]['to'],'phone':_0xb8b06b[_0x7780('0x67')]['to'],'ListId':_0x2c332f[_0x7780('0xb6')]}));})[_0x7780('0x14')](function(_0x3f8159){if(!_0x3f8159)return;var _0x1095fb={'UserId':_0xb8b06b[_0x7780('0x3a')]['id'],'ContactId':_0x3f8159['id'],'MailAccountId':_0x2c332f['id'],'inReplyTo':_0x39ccb2['messageId'],'to':_0xb8b06b[_0x7780('0x67')][_0x7780('0xaa')],'cc':_0xb8b06b[_0x7780('0x67')]['cc'],'subject':_0xb8b06b[_0x7780('0x67')][_0x7780('0xb7')],'attach':_0xb8b06b[_0x7780('0x67')][_0x7780('0xb8')],'firstMsgDirection':_0x7780('0xb9'),'lastMsgAt':moment()[_0x7780('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x7780('0x5e')](_0xb8b06b[_0x7780('0x67')],{'messageId':_0x39ccb2['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2c332f['id'],'UserId':_0xb8b06b[_0x7780('0x3a')]['id'],'ContactId':_0x3f8159['id']})]};if(_0xb8b06b[_0x7780('0x67')][_0x7780('0xba')]){_0x1095fb=_[_0x7780('0x5e')](_0x1095fb,_0xb8b06b[_0x7780('0x67')][_0x7780('0xba')]);}return db[_0x7780('0x88')][_0x7780('0x74')](_0x1095fb,{'include':[{'model':db[_0x7780('0x9d')],'as':_0x7780('0xbb')}]});})[_0x7780('0x14')](respondWithResult(_0x131adf,null))[_0x7780('0x1e')](handleError(_0x131adf,null));};exports[_0x7780('0xbc')]=function(_0x3e621a,_0x47876d){return db[_0x7780('0x4a')]['find']({'where':{'id':_0x3e621a[_0x7780('0x68')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x7780('0x46'),'raw':!![],'include':[{'model':db[_0x7780('0xa7')],'as':_0x7780('0xa7'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x47876d,null))[_0x7780('0x14')](function(_0x49482d){if(!_0x49482d[_0x7780('0x46')])return;var _0xb2e02c=_0x49482d[_0x7780('0xb1')]();return respondWithRpcPromise(_0x7780('0xbd'),_0x7780('0xbc'),{'account':_0xb2e02c});})[_0x7780('0x14')](respondWithResult(_0x47876d,null))[_0x7780('0x1e')](handleError(_0x47876d,null));};exports[_0x7780('0x28')]=function(_0x57a442,_0x859712){return db['MailAccount'][_0x7780('0x66')]({'where':{'id':_0x57a442[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x859712,null))['then'](function(_0x1dda36){if(_0x1dda36&&_0x1dda36[_0x7780('0x43')]){throw new db['Sequelize'][(_0x7780('0xbe'))](_0x7780('0xbf'));}return _0x1dda36;})['then'](removeEntity(_0x859712,null))[_0x7780('0x1e')](handleError(_0x859712,null));};exports[_0x7780('0xc0')]=function(_0x74edf7,_0x1eff2f){return db[_0x7780('0x4a')][_0x7780('0x66')]({'where':{'id':_0x74edf7[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x1eff2f,null))[_0x7780('0x14')](function(_0x399e81){if(_0x399e81){return _0x399e81[_0x7780('0xc0')](_0x74edf7[_0x7780('0x67')]['ids'],_[_0x7780('0x89')](_0x74edf7['body'],[_0x7780('0x72'),'id'])||{})[_0x7780('0xc1')](function(_0x2e00b2){for(var _0x5983d1=0x0;_0x5983d1<_0x74edf7['body'][_0x7780('0x72')][_0x7780('0x56')];_0x5983d1+=0x1){socket[_0x7780('0xc2')](_0x7780('0xc3'),{'UserId':Number(_0x74edf7[_0x7780('0x67')][_0x7780('0x72')][_0x5983d1]),'MailAccountId':Number(_0x74edf7[_0x7780('0x68')]['id'])});}return _0x2e00b2;});}})[_0x7780('0x14')](respondWithResult(_0x1eff2f,null))[_0x7780('0x1e')](handleError(_0x1eff2f,null));};exports[_0x7780('0xc4')]=function(_0x34ef95,_0x5ac9d5){return db[_0x7780('0x4a')]['find']({'where':{'id':_0x34ef95['params']['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x5ac9d5,null))['then'](function(_0x245321){if(_0x245321){return _0x245321[_0x7780('0xc4')](_0x34ef95[_0x7780('0x50')][_0x7780('0x72')])[_0x7780('0x14')](function(){if(_[_0x7780('0xc5')](_0x34ef95[_0x7780('0x50')][_0x7780('0x72')])){for(var _0x9d7814=0x0;_0x9d7814<_0x34ef95['query'][_0x7780('0x72')][_0x7780('0x56')];_0x9d7814+=0x1){socket[_0x7780('0xc2')](_0x7780('0xc6'),{'UserId':Number(_0x34ef95['query'][_0x7780('0x72')][_0x9d7814]),'MailAccountId':Number(_0x34ef95[_0x7780('0x68')]['id'])});}}else{socket['emit'](_0x7780('0xc6'),{'UserId':Number(_0x34ef95[_0x7780('0x50')][_0x7780('0x72')]),'MailAccountId':Number(_0x34ef95['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ac9d5,null))[_0x7780('0x1e')](handleError(_0x5ac9d5,null));};exports[_0x7780('0xc7')]=function(_0x559e27,_0x368335){var _0x55a281={};var _0x1c8786={};var _0x490685;var _0x7031;return db[_0x7780('0x4a')][_0x7780('0x7f')]({'where':{'id':_0x559e27[_0x7780('0x68')]['id']}})[_0x7780('0x14')](handleEntityNotFound(_0x368335,null))[_0x7780('0x14')](function(_0x217b16){if(_0x217b16){_0x490685=_0x217b16;_0x1c8786[_0x7780('0x4f')]=_[_0x7780('0x51')](db[_0x7780('0x8b')]['rawAttributes']);_0x1c8786['query']=_[_0x7780('0x51')](_0x559e27[_0x7780('0x50')]);_0x1c8786[_0x7780('0x52')]=_[_0x7780('0x53')](_0x1c8786['model'],_0x1c8786['query']);_0x55a281['attributes']=_[_0x7780('0x53')](_0x1c8786[_0x7780('0x4f')],qs['fields'](_0x559e27[_0x7780('0x50')]['fields']));_0x55a281[_0x7780('0x54')]=_0x55a281[_0x7780('0x54')][_0x7780('0x56')]?_0x55a281[_0x7780('0x54')]:_0x1c8786[_0x7780('0x4f')];_0x55a281['order']=qs['sort'](_0x559e27[_0x7780('0x50')]['sort']);_0x55a281[_0x7780('0x5b')]=qs[_0x7780('0x52')](_[_0x7780('0x5c')](_0x559e27[_0x7780('0x50')],_0x1c8786['filters']));if(_0x559e27[_0x7780('0x50')][_0x7780('0x5d')]){_0x55a281[_0x7780('0x5b')]=_[_0x7780('0x5e')](_0x55a281['where'],{'$or':_[_0x7780('0x5f')](_0x55a281[_0x7780('0x54')],function(_0x545ce3){var _0x529509={};_0x529509[_0x545ce3]={'$like':'%'+_0x559e27[_0x7780('0x50')]['filter']+'%'};return _0x529509;})});}_0x55a281=_[_0x7780('0x5e')]({},_0x55a281,_0x559e27[_0x7780('0x61')]);return _0x490685[_0x7780('0xc7')](_0x55a281);}})[_0x7780('0x14')](function(_0xdc8294){if(_0xdc8294){_0x7031=_0xdc8294[_0x7780('0x56')];if(!_0x559e27[_0x7780('0x50')][_0x7780('0x57')](_0x7780('0x58'))){_0x55a281[_0x7780('0x23')]=qs[_0x7780('0x23')](_0x559e27[_0x7780('0x50')][_0x7780('0x23')]);_0x55a281[_0x7780('0x21')]=qs['offset'](_0x559e27[_0x7780('0x50')][_0x7780('0x21')]);}return _0x490685[_0x7780('0xc7')](_0x55a281);}})[_0x7780('0x14')](function(_0x18f6c1){if(_0x18f6c1){return _0x18f6c1?{'count':_0x7031,'rows':_0x18f6c1}:null;}})[_0x7780('0x14')](respondWithResult(_0x368335,null))['catch'](handleError(_0x368335,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c079a2a..c178b18 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 _0x75ff=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','remove','emit'];(function(_0x8fc3c9,_0x17c14d){var _0x6660a8=function(_0x186ea9){while(--_0x186ea9){_0x8fc3c9['push'](_0x8fc3c9['shift']());}};_0x6660a8(++_0x17c14d);}(_0x75ff,0x131));var _0xf75f=function(_0x2766b4,_0xb9c42c){_0x2766b4=_0x2766b4-0x0;var _0x3c72ba=_0x75ff[_0x2766b4];return _0x3c72ba;};'use strict';var EventEmitter=require(_0xf75f('0x0'));var MailAccount=require(_0xf75f('0x1'))['db'][_0xf75f('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xf75f('0x3')](0x0);var events={'afterCreate':_0xf75f('0x4'),'afterUpdate':'update','afterDestroy':_0xf75f('0x5')};function emitEvent(_0xf1d634){return function(_0x968bae,_0x494cf9,_0x3d01bf){MailAccountEvents[_0xf75f('0x6')](_0xf1d634+':'+_0x968bae['id'],_0x968bae);MailAccountEvents[_0xf75f('0x6')](_0xf1d634,_0x968bae);_0x3d01bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xf75f('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x8325=['exports','events','MailAccount','save','remove','emit','hasOwnProperty','hook'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8325,0x1f1));var _0x5832=function(_0x2b41e1,_0xc10e43){_0x2b41e1=_0x2b41e1-0x0;var _0x1da82f=_0x8325[_0x2b41e1];return _0x1da82f;};'use strict';var EventEmitter=require(_0x5832('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x5832('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5832('0x2'),'afterUpdate':'update','afterDestroy':_0x5832('0x3')};function emitEvent(_0x39ae55){return function(_0x17bd8b,_0x24e83e,_0x5bfa64){MailAccountEvents['emit'](_0x39ae55+':'+_0x17bd8b['id'],_0x17bd8b);MailAccountEvents[_0x5832('0x4')](_0x39ae55,_0x17bd8b);_0x5bfa64(null);};}for(var e in events){if(events[_0x5832('0x5')](e)){var event=events[e];MailAccount[_0x5832('0x6')](e,emitEvent(event));}}module[_0x5832('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index cb5f216..555ccf3 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 _0x1d0d=['secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','data5','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','custom','service','host','Smtp','port'];(function(_0x31a461,_0x4d0097){var _0x29e8a2=function(_0x5eac44){while(--_0x5eac44){_0x31a461['push'](_0x31a461['shift']());}};_0x29e8a2(++_0x4d0097);}(_0x1d0d,0x194));var _0xd1d0=function(_0x5903d3,_0x5c31aa){_0x5903d3=_0x5903d3-0x0;var _0x8ebeb7=_0x1d0d[_0x5903d3];return _0x8ebeb7;};'use strict';var attributes=require(_0xd1d0('0x0'));module[_0xd1d0('0x1')]=function(_0x21ab4d){return _0x21ab4d[_0xd1d0('0x2')](_0xd1d0('0x3'),attributes,{'tableName':_0xd1d0('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1edcd5=this;var _0x1b3650={'id':_0x1edcd5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1edcd5['provider']!==_0xd1d0('0x5')){_0x1b3650[_0xd1d0('0x6')]=_0x1edcd5['provider'];}else{_0x1b3650[_0xd1d0('0x7')]=_0x1edcd5[_0xd1d0('0x8')][_0xd1d0('0x7')];_0x1b3650[_0xd1d0('0x9')]=_0x1edcd5[_0xd1d0('0x8')]['port'];_0x1b3650[_0xd1d0('0xa')]=_0x1edcd5[_0xd1d0('0x8')][_0xd1d0('0xa')];}if(_0x1edcd5[_0xd1d0('0x8')]['authentication']){if(_0x1edcd5[_0xd1d0('0x8')]['modernAuthentication']){if(!_0x1edcd5['Smtp'][_0xd1d0('0xb')])throw new Error(_0xd1d0('0xc'));_0x1b3650[_0xd1d0('0xd')]={'type':_0xd1d0('0xe'),'user':_0x1edcd5[_0xd1d0('0x8')]['user'],'accessToken':_0x1edcd5[_0xd1d0('0x8')][_0xd1d0('0xb')][_0xd1d0('0xf')]};}else{_0x1b3650['auth']={'user':_0x1edcd5['Smtp'][_0xd1d0('0x10')],'pass':_0x1edcd5[_0xd1d0('0x8')][_0xd1d0('0x11')]};}}return _0x1b3650;}}});}; \ No newline at end of file +var _0x4724=['OAuth2','data5','auth','user','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','secure','authentication','CloudProvider'];(function(_0x2fec20,_0x273fd0){var _0x369f01=function(_0x344f0e){while(--_0x344f0e){_0x2fec20['push'](_0x2fec20['shift']());}};_0x369f01(++_0x273fd0);}(_0x4724,0x15b));var _0x4472=function(_0x16d7a6,_0x4dac64){_0x16d7a6=_0x16d7a6-0x0;var _0x397bc1=_0x4724[_0x16d7a6];return _0x397bc1;};'use strict';var attributes=require(_0x4472('0x0'));module[_0x4472('0x1')]=function(_0x295584){return _0x295584[_0x4472('0x2')](_0x4472('0x3'),attributes,{'tableName':_0x4472('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2b72d1=this;var _0x3ff695={'id':_0x2b72d1['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2b72d1[_0x4472('0x5')]!==_0x4472('0x6')){_0x3ff695[_0x4472('0x7')]=_0x2b72d1[_0x4472('0x5')];}else{_0x3ff695[_0x4472('0x8')]=_0x2b72d1['Smtp'][_0x4472('0x8')];_0x3ff695[_0x4472('0x9')]=_0x2b72d1[_0x4472('0xa')][_0x4472('0x9')];_0x3ff695[_0x4472('0xb')]=_0x2b72d1[_0x4472('0xa')][_0x4472('0xb')];}if(_0x2b72d1['Smtp'][_0x4472('0xc')]){if(_0x2b72d1[_0x4472('0xa')]['modernAuthentication']){if(!_0x2b72d1[_0x4472('0xa')][_0x4472('0xd')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3ff695['auth']={'type':_0x4472('0xe'),'user':_0x2b72d1[_0x4472('0xa')]['user'],'accessToken':_0x2b72d1[_0x4472('0xa')]['CloudProvider'][_0x4472('0xf')]};}else{_0x3ff695[_0x4472('0x10')]={'user':_0x2b72d1[_0x4472('0xa')][_0x4472('0x11')],'pass':_0x2b72d1[_0x4472('0xa')][_0x4472('0x12')]};}}return _0x3ff695;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 17bc593..4fbb018 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 _0x1967=['getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','updatedAt','Applications','CloudProvider','List','get','applications','list','priority','asc','autoclose','push','close','*,*,*,*','Contacts','length','create','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','ChatOfflineMessageId','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailAccount','findAll','options','where','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0x1967,0x173));var _0x7196=function(_0x140295,_0x26022a){_0x140295=_0x140295-0x0;var _0xf86435=_0x1967[_0x140295];return _0xf86435;};'use strict';var _=require('lodash');var moment=require(_0x7196('0x0'));var BPromise=require(_0x7196('0x1'));var rs=require(_0x7196('0x2'));var Redis=require(_0x7196('0x3'));var db=require(_0x7196('0x4'))['db'];var logger=require(_0x7196('0x5'))(_0x7196('0x6'));var config=require(_0x7196('0x7'));var jayson=require(_0x7196('0x8'));var client=jayson[_0x7196('0x9')]['http']({'port':0x232c});config[_0x7196('0xa')]=_[_0x7196('0xb')](config[_0x7196('0xa')],{'host':_0x7196('0xc'),'port':0x18eb});var socket=require(_0x7196('0xd'))(new Redis(config[_0x7196('0xa')]));require('./mailAccount.socket')[_0x7196('0xe')](socket);function respondWithRpcPromise(_0xc6366f,_0x3f846e,_0x259b18){return new BPromise(function(_0x1e862d,_0x503070){return client['request'](_0xc6366f,_0x259b18)[_0x7196('0xf')](function(_0x10459b){logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));logger[_0x7196('0x13')](_0x7196('0x14'),_0x3f846e,_0x7196('0x12'),JSON[_0x7196('0x15')](_0x10459b));if(_0x10459b[_0x7196('0x16')]){if(_0x10459b[_0x7196('0x16')]['code']===0x1f4){logger[_0x7196('0x16')](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x503070(_0x10459b['error'][_0x7196('0x17')]);}logger['error'](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x1e862d(_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);}else{logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));_0x1e862d(_0x10459b[_0x7196('0x18')][_0x7196('0x17')]);}})[_0x7196('0x19')](function(_0x5b716a){logger['error'](_0x7196('0x11'),_0x3f846e,_0x5b716a);_0x503070(_0x5b716a);});});}exports[_0x7196('0x1a')]=function(_0x40418d){var _0x517a3e=this;return new Promise(function(_0x39b944,_0x539d8b){return db['MailAccount'][_0x7196('0x1b')]({'raw':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1d')]||null:null,'attributes':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'limit':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')][_0x7196('0x1f')]||null:null,'include':_0x40418d['options']?_0x40418d[_0x7196('0x1c')]['include']?_[_0x7196('0x20')](_0x40418d[_0x7196('0x1c')][_0x7196('0x21')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x22')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x1e')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x21')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x22')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes'],'include':_0x2d284f['include']?_[_0x7196('0x20')](_0x2d284f[_0x7196('0x21')],function(_0x675e64){return{'model':db[_0x675e64['model']],'as':_0x675e64['as'],'attributes':_0x675e64[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd339){logger['info'](_0x7196('0x1a'),_0x40418d);logger[_0x7196('0x13')](_0x7196('0x1a'),_0x40418d,JSON['stringify'](_0x4fd339));_0x39b944(_0x4fd339);})[_0x7196('0x19')](function(_0x45d567){logger[_0x7196('0x16')](_0x7196('0x1a'),_0x45d567['message'],_0x40418d);_0x539d8b(_0x517a3e[_0x7196('0x16')](0x1f4,_0x45d567[_0x7196('0x17')]));});});};exports[_0x7196('0x23')]=function(_0x651d7e){var _0x4780e1=this;return new Promise(function(_0x2786f3,_0x15c5f0){return db[_0x7196('0x24')][_0x7196('0x25')]({'raw':_0x651d7e[_0x7196('0x1c')]?_0x651d7e[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x651d7e[_0x7196('0x1c')]?_0x651d7e['options'][_0x7196('0x1d')]||null:null,'attributes':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'include':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')]?_[_0x7196('0x20')](_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x22')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x1e')],'include':_0x4a8580[_0x7196('0x21')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x21')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x1e')],'include':_0x123cad[_0x7196('0x21')]?_[_0x7196('0x20')](_0x123cad['include'],function(_0x33831a){return{'model':db[_0x33831a[_0x7196('0x22')]],'as':_0x33831a['as'],'attributes':_0x33831a[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xf')](function(_0x11d4ec){if(_0x651d7e[_0x7196('0x1c')][_0x7196('0x26')]===!![])_0x11d4ec[_0x7196('0x27')](_0x7196('0x28'),_0x11d4ec[_0x7196('0x29')]());logger['info'](_0x7196('0x23'),_0x651d7e);logger[_0x7196('0x13')]('ShowMailAccount',_0x651d7e,JSON[_0x7196('0x15')](_0x11d4ec));_0x2786f3(_0x11d4ec);})['catch'](function(_0x5bd701){logger[_0x7196('0x16')](_0x7196('0x23'),_0x5bd701['message'],_0x651d7e);_0x15c5f0(_0x4780e1['error'](0x1f4,_0x5bd701[_0x7196('0x17')]));});});};exports[_0x7196('0x2a')]=function(_0xed32cd){var _0x4c2341=this;return new Promise(function(_0x36a990,_0x2d13a5){var _0x29ba1c={'body':_0xed32cd[_0x7196('0x2b')],'channel':_0x7196('0x2c')};var _0x428d76=_[_0x7196('0x2d')](_[_0x7196('0x2e')](db['CmContact'][_0x7196('0x2f')]),[_0x7196('0x30'),'updatedAt',_0x7196('0x31'),_0x7196('0x32')]);var _0x48178f=![];if(_0xed32cd[_0x7196('0x2b')]['id']){delete _0xed32cd[_0x7196('0x2b')]['id'];}if(_[_0x7196('0x33')](_0xed32cd['body'][_0x7196('0x34')])){return _0x2d13a5(_0x4c2341[_0x7196('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x7196('0x33')](_0xed32cd[_0x7196('0x2b')]['body'])||_0xed32cd[_0x7196('0x2b')]['body']===''){return _0x2d13a5(_0x4c2341['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0xed32cd['body'][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x36')+_0x428d76));}if(!_[_0x7196('0x37')](_0x428d76,_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x38')+_0x428d76));}var _0x56ffdd={};_0x56ffdd[_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')]['from'];return db[_0x7196('0x24')][_0x7196('0x25')]({'where':{'id':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7196('0x3a')],'as':'Contacts','where':_0x56ffdd,'limit':0x1,'order':[[_0x7196('0x3b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x7196('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x7196('0x3d')}]}]})['then'](function(_0x48e3b5){if(_0x48e3b5&&_0x48e3b5[_0x7196('0x3e')]){var _0x182c8b=_0x48e3b5[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x39')]=_['omit'](_0x182c8b,[_0x7196('0x3c'),'List']);_0x29ba1c[_0x7196('0x39')][_0x7196('0x28')]=_0x48e3b5['getSmtpOptions']();_0x29ba1c[_0x7196('0x40')]=_0x182c8b[_0x7196('0x3c')];_0x29ba1c[_0x7196('0x41')]=_0x182c8b['List'];_0x29ba1c[_0x7196('0x40')]=_['orderBy'](_0x29ba1c[_0x7196('0x40')],[_0x7196('0x42')],[_0x7196('0x43')]);if(_0x29ba1c[_0x7196('0x39')]&&_0x29ba1c[_0x7196('0x39')][_0x7196('0x44')]){_0x29ba1c[_0x7196('0x40')][_0x7196('0x45')]({'id':0x0,'priority':_0x29ba1c['applications']['length']+0x1,'app':_0x7196('0x46'),'appdata':_0x7196('0x44'),'interval':_0x7196('0x47')});}if(_0x29ba1c[_0x7196('0x39')]['Applications']){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3c')];}if(_0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')]){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')];}if(_0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][_0x7196('0x49')]){return _0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][0x0];}var _0x4940a2=_[_0x7196('0xb')](_0xed32cd[_0x7196('0x2b')],{'firstName':_0xed32cd[_0x7196('0x2b')]['from'],'ListId':_0x182c8b[_0x7196('0x32')]});_0x4940a2[_0xed32cd['body'][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')][_0x7196('0x34')];return db[_0x7196('0x3a')][_0x7196('0x4a')](_0x4940a2);}else{throw new Error('List\x20not\x20found');}})[_0x7196('0xf')](function(_0x5b77fc){_0x29ba1c['contact']=_0x5b77fc;if(_0x5b77fc){if(!_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4b')]){_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')]=rs[_0x7196('0x4c')]()+'\x20'+_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x34')];}var _0x14dc43={'ContactId':_0x5b77fc['id'],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id'],'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['messageId'],'to':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x34')],'cc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['cc'],'subject':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7196('0x50')][_0x7196('0x25')]({'where':{'closed':![],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db[_0x7196('0x51')],'as':'Messages','attributes':[_0x7196('0x4b')],'where':{'messageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x52')]}}]})[_0x7196('0xf')](function(_0x3c3d64){if(_0x3c3d64){return[_0x3c3d64,![]];}return db[_0x7196('0x50')]['create'](_0x14dc43)[_0x7196('0xf')](function(_0x2c5cba){return[_0x2c5cba,!![]];});});}else{throw new Error(_0x7196('0x53'));}})[_0x7196('0x54')](function(_0x52827f,_0x418a7a){if(_0x52827f){_0x48178f=_0x418a7a;if(!_0x418a7a){return _0x52827f[_0x7196('0x55')]({'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')],'to':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['from'],'cc':_0xed32cd['body']['message']['cc'],'subject':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x4d')],'attach':_0x52827f[_0x7196('0x4e')]?_0x52827f[_0x7196('0x4e')]:_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'substatus':null,'substatusAt':moment()[_0x7196('0x4f')](_0x7196('0x56')),'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x52827f;}}})['then'](function(_0x4542c1){_0x29ba1c[_0x7196('0x57')]=_0x4542c1[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x57')][_0x7196('0x58')]=_0x48178f;return db[_0x7196('0x51')][_0x7196('0x4a')]({'body':_0xed32cd[_0x7196('0x2b')]['body'],'MailAccountId':_0xed32cd['account']['id'],'MailInteractionId':_0x4542c1['id'],'direction':'in','ContactId':_0x29ba1c[_0x7196('0x59')]['id'],'messageId':_0xed32cd['body'][_0x7196('0x17')]['messageId'],'from':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x34')],'to':_0xed32cd[_0x7196('0x2b')]['message']['to'],'cc':_0xed32cd['body'][_0x7196('0x17')]['cc'],'subject':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'Attachments':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x5a')],'originTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5b')],'originCc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5c')],'bcc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5d')],'ChatWebsiteId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['ChatWebsiteId']||null,'originChannel':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['originChannel']||'Email','ChatOfflineMessageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x7196('0x5f')}]});})['then'](function(_0x218396){_0x29ba1c[_0x7196('0x17')]=_0x218396;if(_0x29ba1c['interaction'][_0x7196('0x60')]){return db['User']['find']({'attributes':['id',_0x7196('0x61')],'where':{'id':_0x29ba1c[_0x7196('0x57')][_0x7196('0x60')]}})['then'](function(_0x423b83){if(_0x423b83){_0x29ba1c['applications'][_0x7196('0x62')]({'id':0x0,'priority':0x0,'app':_0x7196('0x63'),'appdata':_0x423b83[_0x7196('0x61')]+','+(_0x29ba1c[_0x7196('0x39')][_0x7196('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);})[_0x7196('0xf')](function(_0x29bafd){_0x36a990(_0x29bafd);})[_0x7196('0x19')](function(_0x34633a){_0x2d13a5(_0x4c2341['error'](0x1f4,_0x34633a[_0x7196('0x17')]));});});}; \ No newline at end of file +var _0xef0f=['Applications','MailServerOut','CloudProvider','get','omit','smtpOptions','list','applications','orderBy','priority','asc','autoclose','push','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','originTo','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','body','mail','difference','keys','rawAttributes','createdAt','ListId','isNil','from','from\x20is\x20mandatory','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','account','CmList','List','Contacts','MailApplication'];(function(_0x4c407d,_0x31d165){var _0x55ea18=function(_0x517e84){while(--_0x517e84){_0x4c407d['push'](_0x4c407d['shift']());}};_0x55ea18(++_0x31d165);}(_0xef0f,0x168));var _0xfef0=function(_0x2fa703,_0x5aee30){_0x2fa703=_0x2fa703-0x0;var _0x39f598=_0xef0f[_0x2fa703];return _0x39f598;};'use strict';var _=require(_0xfef0('0x0'));var moment=require('moment');var BPromise=require(_0xfef0('0x1'));var rs=require(_0xfef0('0x2'));var Redis=require(_0xfef0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xfef0('0x4'))(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfef0('0x7')][_0xfef0('0x8')]({'port':0x232c});config[_0xfef0('0x9')]=_[_0xfef0('0xa')](config[_0xfef0('0x9')],{'host':_0xfef0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0x9')]));require('./mailAccount.socket')[_0xfef0('0xc')](socket);function respondWithRpcPromise(_0x100e3a,_0x3a81cc,_0x2d42dc){return new BPromise(function(_0x334e74,_0x402dff){return client[_0xfef0('0xd')](_0x100e3a,_0x2d42dc)[_0xfef0('0xe')](function(_0x11bbca){logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x3a81cc,'request\x20sent',JSON[_0xfef0('0x14')](_0x11bbca));if(_0x11bbca[_0xfef0('0x15')]){if(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x16')]===0x1f4){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x11bbca[_0xfef0('0x15')]['message']);return _0x402dff(_0x11bbca[_0xfef0('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3a81cc,_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);return _0x334e74(_0x11bbca[_0xfef0('0x15')][_0xfef0('0x17')]);}else{logger[_0xfef0('0xf')](_0xfef0('0x10'),_0x3a81cc,_0xfef0('0x11'));_0x334e74(_0x11bbca[_0xfef0('0x18')]['message']);}})[_0xfef0('0x19')](function(_0x1642cd){logger[_0xfef0('0x15')](_0xfef0('0x10'),_0x3a81cc,_0x1642cd);_0x402dff(_0x1642cd);});});}exports[_0xfef0('0x1a')]=function(_0x55912f){var _0x5283e1=this;return new Promise(function(_0x4e24de,_0x20826b){return db[_0xfef0('0x1b')][_0xfef0('0x1c')]({'raw':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')]['where']||null:null,'attributes':_0x55912f['options']?_0x55912f['options'][_0xfef0('0x1e')]||null:null,'limit':_0x55912f['options']?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x1f')]||null:null,'include':_0x55912f[_0xfef0('0x1d')]?_0x55912f[_0xfef0('0x1d')][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x55912f['options']['include'],function(_0x316e20){return{'model':db[_0x316e20[_0xfef0('0x22')]],'as':_0x316e20['as'],'attributes':_0x316e20[_0xfef0('0x1e')],'include':_0x316e20[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x316e20[_0xfef0('0x20')],function(_0x5df04f){return{'model':db[_0x5df04f[_0xfef0('0x22')]],'as':_0x5df04f['as'],'attributes':_0x5df04f[_0xfef0('0x1e')],'include':_0x5df04f['include']?_[_0xfef0('0x21')](_0x5df04f[_0xfef0('0x20')],function(_0xca0cce){return{'model':db[_0xca0cce[_0xfef0('0x22')]],'as':_0xca0cce['as'],'attributes':_0xca0cce[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x3e3c4c){logger[_0xfef0('0xf')](_0xfef0('0x1a'),_0x55912f);logger[_0xfef0('0x12')](_0xfef0('0x1a'),_0x55912f,JSON[_0xfef0('0x14')](_0x3e3c4c));_0x4e24de(_0x3e3c4c);})['catch'](function(_0x445625){logger['error']('GetMailAccount',_0x445625[_0xfef0('0x17')],_0x55912f);_0x20826b(_0x5283e1[_0xfef0('0x15')](0x1f4,_0x445625['message']));});});};exports['ShowMailAccount']=function(_0x5cf518){var _0x4f65cd=this;return new Promise(function(_0x4cce8a,_0x417535){return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'raw':_0x5cf518['options']?_0x5cf518['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x24')]||null:null,'attributes':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518[_0xfef0('0x1d')]['attributes']||null:null,'include':_0x5cf518[_0xfef0('0x1d')]?_0x5cf518['options'][_0xfef0('0x20')]?_[_0xfef0('0x21')](_0x5cf518[_0xfef0('0x1d')][_0xfef0('0x20')],function(_0x3e1a64){return{'model':db[_0x3e1a64[_0xfef0('0x22')]],'as':_0x3e1a64['as'],'attributes':_0x3e1a64[_0xfef0('0x1e')],'include':_0x3e1a64[_0xfef0('0x20')]?_['map'](_0x3e1a64[_0xfef0('0x20')],function(_0xea09ec){return{'model':db[_0xea09ec[_0xfef0('0x22')]],'as':_0xea09ec['as'],'attributes':_0xea09ec[_0xfef0('0x1e')],'include':_0xea09ec[_0xfef0('0x20')]?_[_0xfef0('0x21')](_0xea09ec[_0xfef0('0x20')],function(_0xeb75e2){return{'model':db[_0xeb75e2[_0xfef0('0x22')]],'as':_0xeb75e2['as'],'attributes':_0xeb75e2[_0xfef0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfef0('0xe')](function(_0x22acf9){if(_0x5cf518[_0xfef0('0x1d')]['smtp']===!![])_0x22acf9[_0xfef0('0x25')]('smtpOptions',_0x22acf9[_0xfef0('0x26')]());logger[_0xfef0('0xf')](_0xfef0('0x27'),_0x5cf518);logger['debug'](_0xfef0('0x27'),_0x5cf518,JSON[_0xfef0('0x14')](_0x22acf9));_0x4cce8a(_0x22acf9);})[_0xfef0('0x19')](function(_0x5537c8){logger[_0xfef0('0x15')](_0xfef0('0x27'),_0x5537c8[_0xfef0('0x17')],_0x5cf518);_0x417535(_0x4f65cd['error'](0x1f4,_0x5537c8[_0xfef0('0x17')]));});});};exports['NotifyMailAccount']=function(_0x49ed48){var _0xf30aff=this;return new Promise(function(_0x547a5d,_0x5c3305){var _0xbf6ddd={'body':_0x49ed48[_0xfef0('0x28')],'channel':_0xfef0('0x29')};var _0x1a6593=_[_0xfef0('0x2a')](_[_0xfef0('0x2b')](db['CmContact'][_0xfef0('0x2c')]),[_0xfef0('0x2d'),'updatedAt','CompanyId',_0xfef0('0x2e')]);var _0x5dc824=![];if(_0x49ed48[_0xfef0('0x28')]['id']){delete _0x49ed48[_0xfef0('0x28')]['id'];}if(_[_0xfef0('0x2f')](_0x49ed48[_0xfef0('0x28')][_0xfef0('0x30')])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x31')));}if(_[_0xfef0('0x2f')](_0x49ed48['body'][_0xfef0('0x28')])||_0x49ed48['body']['body']===''){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x32')));}if(_['isNil'](_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x33')+_0x1a6593));}if(!_[_0xfef0('0x34')](_0x1a6593,_0x49ed48[_0xfef0('0x28')]['mapKey'])){return _0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0xfef0('0x35')+_0x1a6593));}var _0x504967={};_0x504967[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body'][_0xfef0('0x30')];return db[_0xfef0('0x1b')][_0xfef0('0x23')]({'where':{'id':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x38')],'as':_0xfef0('0x39'),'include':[{'model':db['CmContact'],'as':_0xfef0('0x3a'),'where':_0x504967,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xfef0('0x3b')],'as':_0xfef0('0x3c')},{'model':db[_0xfef0('0x3d')],'as':'Smtp','include':[{'model':db[_0xfef0('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x51f207){if(_0x51f207&&_0x51f207[_0xfef0('0x39')]){var _0x3d471c=_0x51f207[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x37')]=_[_0xfef0('0x40')](_0x3d471c,[_0xfef0('0x3c'),_0xfef0('0x39')]);_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x41')]=_0x51f207['getSmtpOptions']();_0xbf6ddd['applications']=_0x3d471c[_0xfef0('0x3c')];_0xbf6ddd[_0xfef0('0x42')]=_0x3d471c[_0xfef0('0x39')];_0xbf6ddd[_0xfef0('0x43')]=_[_0xfef0('0x44')](_0xbf6ddd[_0xfef0('0x43')],[_0xfef0('0x45')],[_0xfef0('0x46')]);if(_0xbf6ddd['account']&&_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x47')]){_0xbf6ddd[_0xfef0('0x43')][_0xfef0('0x48')]({'id':0x0,'priority':_0xbf6ddd[_0xfef0('0x43')]['length']+0x1,'app':'close','appdata':'autoclose','interval':_0xfef0('0x49')});}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x3c')]){delete _0xbf6ddd[_0xfef0('0x37')]['Applications'];}if(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')]){delete _0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x39')];}if(_0x3d471c[_0xfef0('0x39')][_0xfef0('0x3a')][_0xfef0('0x4a')]){return _0x3d471c['List'][_0xfef0('0x3a')][0x0];}var _0x163255=_['defaults'](_0x49ed48[_0xfef0('0x28')],{'firstName':_0x49ed48['body'][_0xfef0('0x30')],'ListId':_0x3d471c[_0xfef0('0x2e')]});_0x163255[_0x49ed48['body'][_0xfef0('0x36')]]=_0x49ed48['body']['from'];return db['CmContact'][_0xfef0('0x4b')](_0x163255);}else{throw new Error(_0xfef0('0x4c'));}})[_0xfef0('0xe')](function(_0x34fda3){_0xbf6ddd[_0xfef0('0x4d')]=_0x34fda3;if(_0x34fda3){if(!_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x4e')]){_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')]=rs[_0xfef0('0x4f')]()+'\x20'+_0x49ed48['body'][_0xfef0('0x17')]['from'];}var _0x135653={'ContactId':_0x34fda3['id'],'MailAccountId':_0x49ed48['account']['id'],'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['from'],'cc':_0x49ed48[_0xfef0('0x28')]['message']['cc'],'subject':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['subject'],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'lastMsgAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgDirection':'in'};return db[_0xfef0('0x53')][_0xfef0('0x23')]({'where':{'closed':![],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id']},'include':[{'model':db[_0xfef0('0x54')],'as':_0xfef0('0x55'),'attributes':[_0xfef0('0x4e')],'where':{'messageId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x56')]}}]})[_0xfef0('0xe')](function(_0x28cab7){if(_0x28cab7){return[_0x28cab7,![]];}return db[_0xfef0('0x53')][_0xfef0('0x4b')](_0x135653)['then'](function(_0x12e383){return[_0x12e383,!![]];});});}else{throw new Error(_0xfef0('0x57'));}})[_0xfef0('0x58')](function(_0x3c6bb8,_0x176fc7){if(_0x3c6bb8){_0x5dc824=_0x176fc7;if(!_0x176fc7){return _0x3c6bb8[_0xfef0('0x59')]({'inReplyTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x4e')],'to':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x30')],'cc':_0x49ed48['body'][_0xfef0('0x17')]['cc'],'subject':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5a')],'attach':_0x3c6bb8[_0xfef0('0x50')]?_0x3c6bb8[_0xfef0('0x50')]:_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xfef0('0x51')](_0xfef0('0x52')),'lastMsgAt':moment()[_0xfef0('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c6bb8;}}})[_0xfef0('0xe')](function(_0x2ab666){_0xbf6ddd[_0xfef0('0x5b')]=_0x2ab666[_0xfef0('0x3f')]({'plain':!![]});_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x5c')]=_0x5dc824;return db[_0xfef0('0x54')]['create']({'body':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x28')],'MailAccountId':_0x49ed48[_0xfef0('0x37')]['id'],'MailInteractionId':_0x2ab666['id'],'direction':'in','ContactId':_0xbf6ddd[_0xfef0('0x4d')]['id'],'messageId':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['messageId'],'from':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x30')],'to':_0x49ed48[_0xfef0('0x28')]['message']['to'],'cc':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['cc'],'subject':_0x49ed48['body'][_0xfef0('0x17')][_0xfef0('0x5a')],'attach':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x50')],'Attachments':_0x49ed48['body']['message']['attachments'],'originTo':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')][_0xfef0('0x5d')],'originCc':_0x49ed48['body'][_0xfef0('0x17')]['originCc'],'bcc':_0x49ed48['body']['message'][_0xfef0('0x5e')],'ChatWebsiteId':_0x49ed48[_0xfef0('0x28')]['message'][_0xfef0('0x5f')]||null,'originChannel':_0x49ed48[_0xfef0('0x28')][_0xfef0('0x17')]['originChannel']||_0xfef0('0x60'),'ChatOfflineMessageId':_0x49ed48['body']['message'][_0xfef0('0x61')]||null},{'include':[{'model':db[_0xfef0('0x62')],'as':_0xfef0('0x63')}]});})[_0xfef0('0xe')](function(_0x4df63b){_0xbf6ddd['message']=_0x4df63b;if(_0xbf6ddd['interaction'][_0xfef0('0x64')]){return db['User'][_0xfef0('0x23')]({'attributes':['id',_0xfef0('0x65')],'where':{'id':_0xbf6ddd[_0xfef0('0x5b')][_0xfef0('0x64')]}})[_0xfef0('0xe')](function(_0x4be622){if(_0x4be622){_0xbf6ddd[_0xfef0('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4be622[_0xfef0('0x65')]+','+(_0xbf6ddd[_0xfef0('0x37')][_0xfef0('0x66')]||0xa),'interval':_0xfef0('0x49')});}return respondWithRpcPromise('Start','startRouting',_0xbf6ddd);});}return respondWithRpcPromise(_0xfef0('0x67'),_0xfef0('0x68'),_0xbf6ddd);})['then'](function(_0x872f99){_0x547a5d(_0x872f99);})[_0xfef0('0x19')](function(_0x4690c0){_0x5c3305(_0xf30aff[_0xfef0('0x15')](0x1f4,_0x4690c0[_0xfef0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index deb5a82..c52ecc6 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 _0x34b7=['remove','update','register','length','mailAccount:','./mailAccount.events','save'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x34b7,0x1b7));var _0x734b=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x34b7[_0x5a1cc9];return _0x471761;};'use strict';var MailAccountEvents=require(_0x734b('0x0'));var events=[_0x734b('0x1'),_0x734b('0x2'),_0x734b('0x3')];function createListener(_0x3883eb,_0x4a6199){return function(_0x1bdfeb){_0x4a6199['emit'](_0x3883eb,_0x1bdfeb);};}function removeListener(_0x18cfb8,_0x475f43){return function(){MailAccountEvents['removeListener'](_0x18cfb8,_0x475f43);};}exports[_0x734b('0x4')]=function(_0x562af2){for(var _0x5da060=0x0,_0x1622d1=events[_0x734b('0x5')];_0x5da060<_0x1622d1;_0x5da060++){var _0x133653=events[_0x5da060];var _0x530f72=createListener(_0x734b('0x6')+_0x133653,_0x562af2);MailAccountEvents['on'](_0x133653,_0x530f72);}}; \ No newline at end of file +var _0xbd44=['length','./mailAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x1717b2,_0x474064){var _0x2b3038=function(_0x1cbd9f){while(--_0x1cbd9f){_0x1717b2['push'](_0x1717b2['shift']());}};_0x2b3038(++_0x474064);}(_0xbd44,0x151));var _0x4bd4=function(_0x1781a6,_0x350cb2){_0x1781a6=_0x1781a6-0x0;var _0x91de61=_0xbd44[_0x1781a6];return _0x91de61;};'use strict';var MailAccountEvents=require(_0x4bd4('0x0'));var events=[_0x4bd4('0x1'),_0x4bd4('0x2'),_0x4bd4('0x3')];function createListener(_0x47ee52,_0x337d39){return function(_0x5680ab){_0x337d39[_0x4bd4('0x4')](_0x47ee52,_0x5680ab);};}function removeListener(_0x569dd1,_0x3ba8d3){return function(){MailAccountEvents[_0x4bd4('0x5')](_0x569dd1,_0x3ba8d3);};}exports[_0x4bd4('0x6')]=function(_0x4f2b4c){for(var _0x412acd=0x0,_0x1ae77d=events[_0x4bd4('0x7')];_0x412acd<_0x1ae77d;_0x412acd++){var _0x558da8=events[_0x412acd];var _0x17dd38=createListener('mailAccount:'+_0x558da8,_0x4f2b4c);MailAccountEvents['on'](_0x558da8,_0x17dd38);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 24361ce..9a19b94 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 _0x9433=['isAuthenticated','show','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','get','/:id'];(function(_0x4d09ed,_0x2bd09d){var _0x124ab=function(_0x160b4f){while(--_0x160b4f){_0x4d09ed['push'](_0x4d09ed['shift']());}};_0x124ab(++_0x2bd09d);}(_0x9433,0x84));var _0x3943=function(_0x5b826e,_0x46bbbc){_0x5b826e=_0x5b826e-0x0;var _0x50105e=_0x9433[_0x5b826e];return _0x50105e;};'use strict';var multer=require('multer');var util=require(_0x3943('0x0'));var path=require(_0x3943('0x1'));var timeout=require(_0x3943('0x2'));var express=require(_0x3943('0x3'));var router=express[_0x3943('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3943('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x3943('0x6')](_0x3943('0x7'),auth[_0x3943('0x8')](),controller[_0x3943('0x9')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3943('0xa')]);router[_0x3943('0xb')](_0x3943('0x7'),auth['isAuthenticated'](),controller[_0x3943('0xc')]);module[_0x3943('0xd')]=router; \ No newline at end of file +var _0xcd74=['show','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x5f4a0b,_0xb8a9b1){var _0x1e5a6f=function(_0x4fb63c){while(--_0x4fb63c){_0x5f4a0b['push'](_0x5f4a0b['shift']());}};_0x1e5a6f(++_0xb8a9b1);}(_0xcd74,0x186));var _0x4cd7=function(_0x1111fa,_0x46727c){_0x1111fa=_0x1111fa-0x0;var _0xf07485=_0xcd74[_0x1111fa];return _0xf07485;};'use strict';var multer=require(_0x4cd7('0x0'));var util=require(_0x4cd7('0x1'));var path=require(_0x4cd7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4cd7('0x3')]();var fs_extra=require(_0x4cd7('0x4'));var auth=require(_0x4cd7('0x5'));var interaction=require(_0x4cd7('0x6'));var config=require(_0x4cd7('0x7'));var controller=require(_0x4cd7('0x8'));router[_0x4cd7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x4cd7('0xa')]);router[_0x4cd7('0xb')](_0x4cd7('0xc'),auth['isAuthenticated'](),controller[_0x4cd7('0xd')]);router[_0x4cd7('0xe')](_0x4cd7('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x4cd7('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4ccd633..37de1c0 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 _0x31f7=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x5f259c,_0x26127d){var _0xddcf04=function(_0x5ea71f){while(--_0x5ea71f){_0x5f259c['push'](_0x5f259c['shift']());}};_0xddcf04(++_0x26127d);}(_0x31f7,0xd6));var _0x731f=function(_0x442c72,_0x95361f){_0x442c72=_0x442c72-0x0;var _0x3e27b2=_0x31f7[_0x442c72];return _0x3e27b2;};'use strict';var Sequelize=require('sequelize');module[_0x731f('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x731f('0x1')],'allowNull':![],'defaultValue':_0x731f('0x2')},'appdata':{'type':Sequelize[_0x731f('0x3')]()},'description':{'type':Sequelize[_0x731f('0x1')]},'interval':{'type':Sequelize[_0x731f('0x1')],'defaultValue':_0x731f('0x4')}}; \ No newline at end of file +var _0xd835=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x2e3ba2,_0x475722){var _0x4114b1=function(_0x24d1e1){while(--_0x24d1e1){_0x2e3ba2['push'](_0x2e3ba2['shift']());}};_0x4114b1(++_0x475722);}(_0xd835,0xfb));var _0x5d83=function(_0x427d3a,_0x23724c){_0x427d3a=_0x427d3a-0x0;var _0xe5c521=_0xd835[_0x427d3a];return _0xe5c521;};'use strict';var Sequelize=require(_0x5d83('0x0'));module[_0x5d83('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5d83('0x2')],'allowNull':![],'defaultValue':_0x5d83('0x3')},'appdata':{'type':Sequelize[_0x5d83('0x4')]()},'description':{'type':Sequelize[_0x5d83('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5d83('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index b352084..c948892 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x331b3f,_0x29484d){var _0x18a0c2=function(_0x27445e){while(--_0x27445e){_0x331b3f['push'](_0x331b3f['shift']());}};_0x18a0c2(++_0x29484d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xcb91[_0x531d15];return _0x271a18;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x450c4a,_0x1fb7c8){var _0x135232=function(_0x54728d){while(--_0x54728d){_0x450c4a['push'](_0x450c4a['shift']());}};_0x135232(++_0x1fb7c8);}(_0x54ef,0x112));var _0xf54e=function(_0x3e05c1,_0x5575b4){_0x3e05c1=_0x3e05c1-0x0;var _0x7dd89a=_0x54ef[_0x3e05c1];return _0x7dd89a;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 9761fca..ef196d0 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 _0x6e6c=['exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5ea790,_0x46cfad){var _0x344e14=function(_0x5483ce){while(--_0x5483ce){_0x5ea790['push'](_0x5ea790['shift']());}};_0x344e14(++_0x46cfad);}(_0x6e6c,0x132));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require(_0xc6e6('0x2'))(_0xc6e6('0x3'));var moment=require(_0xc6e6('0x4'));var BPromise=require(_0xc6e6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x6'));var rimraf=require(_0xc6e6('0x7'));var config=require(_0xc6e6('0x8'));var attributes=require('./mailApplication.attributes');module[_0xc6e6('0x9')]=function(_0x568134,_0x2fc8bd){return _0x568134[_0xc6e6('0xa')](_0xc6e6('0xb'),attributes,{'tableName':_0xc6e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc6e6('0xd'),'collate':_0xc6e6('0xe')});}; \ No newline at end of file +var _0x2cec=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4'];(function(_0x121162,_0x45757a){var _0x5ae38f=function(_0x41bc8e){while(--_0x41bc8e){_0x121162['push'](_0x121162['shift']());}};_0x5ae38f(++_0x45757a);}(_0x2cec,0x76));var _0xc2ce=function(_0x5be42a,_0x4c1509){_0x5be42a=_0x5be42a-0x0;var _0x50267c=_0x2cec[_0x5be42a];return _0x50267c;};'use strict';var _=require(_0xc2ce('0x0'));var util=require(_0xc2ce('0x1'));var logger=require(_0xc2ce('0x2'))(_0xc2ce('0x3'));var moment=require(_0xc2ce('0x4'));var BPromise=require(_0xc2ce('0x5'));var rp=require(_0xc2ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc2ce('0x7'));var attributes=require(_0xc2ce('0x8'));module[_0xc2ce('0x9')]=function(_0x5720d5,_0x1576d6){return _0x5720d5['define']('MailApplication',attributes,{'tableName':_0xc2ce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc2ce('0xb'),'collate':_0xc2ce('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index e5cfec8..1a3da4c 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 _0x6ebe=['UpdateMailApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','catch','MailApplication','body','options','raw'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0x6ebe,0x146));var _0xe6eb=function(_0x5d2938,_0x53e760){_0x5d2938=_0x5d2938-0x0;var _0x538476=_0x6ebe[_0x5d2938];return _0x538476;};'use strict';var _=require(_0xe6eb('0x0'));var util=require(_0xe6eb('0x1'));var moment=require(_0xe6eb('0x2'));var BPromise=require(_0xe6eb('0x3'));var rs=require(_0xe6eb('0x4'));var fs=require('fs');var Redis=require(_0xe6eb('0x5'));var db=require(_0xe6eb('0x6'))['db'];var utils=require(_0xe6eb('0x7'));var logger=require(_0xe6eb('0x8'))(_0xe6eb('0x9'));var config=require('../../config/environment');var jayson=require(_0xe6eb('0xa'));var client=jayson['client'][_0xe6eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c7245,_0x3410ba,_0x20f609){return new BPromise(function(_0x4d5882,_0x3e973c){return client['request'](_0x1c7245,_0x20f609)[_0xe6eb('0xc')](function(_0x371cf5){logger[_0xe6eb('0xd')](_0xe6eb('0xe'),_0x3410ba,_0xe6eb('0xf'));logger[_0xe6eb('0x10')](_0xe6eb('0x11'),_0x3410ba,'request\x20sent',JSON['stringify'](_0x371cf5));if(_0x371cf5[_0xe6eb('0x12')]){if(_0x371cf5[_0xe6eb('0x12')]['code']===0x1f4){logger[_0xe6eb('0x12')](_0xe6eb('0xe'),_0x3410ba,_0x371cf5[_0xe6eb('0x12')][_0xe6eb('0x13')]);return _0x3e973c(_0x371cf5[_0xe6eb('0x12')][_0xe6eb('0x13')]);}logger[_0xe6eb('0x12')](_0xe6eb('0xe'),_0x3410ba,_0x371cf5[_0xe6eb('0x12')][_0xe6eb('0x13')]);return _0x4d5882(_0x371cf5[_0xe6eb('0x12')][_0xe6eb('0x13')]);}else{logger[_0xe6eb('0xd')](_0xe6eb('0xe'),_0x3410ba,'request\x20sent');_0x4d5882(_0x371cf5['result'][_0xe6eb('0x13')]);}})[_0xe6eb('0x14')](function(_0x3bbdaa){logger[_0xe6eb('0x12')](_0xe6eb('0xe'),_0x3410ba,_0x3bbdaa);_0x3e973c(_0x3bbdaa);});});}exports['UpdateMailApplication']=function(_0xab9004){var _0x2718f5=this;return new Promise(function(_0xc4ea77,_0x36473a){return db[_0xe6eb('0x15')]['update'](_0xab9004[_0xe6eb('0x16')],{'raw':_0xab9004[_0xe6eb('0x17')]?_0xab9004[_0xe6eb('0x17')][_0xe6eb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab9004[_0xe6eb('0x17')]?_0xab9004[_0xe6eb('0x17')]['where']||null:null,'attributes':_0xab9004[_0xe6eb('0x17')]?_0xab9004['options']['attributes']||null:null,'limit':_0xab9004[_0xe6eb('0x17')]?_0xab9004[_0xe6eb('0x17')]['limit']||null:null})[_0xe6eb('0xc')](function(_0x5704dc){logger[_0xe6eb('0xd')](_0xe6eb('0x19'),_0xab9004);logger[_0xe6eb('0x10')](_0xe6eb('0x19'),_0xab9004,JSON[_0xe6eb('0x1a')](_0x5704dc));_0xc4ea77(_0x5704dc);})['catch'](function(_0x50997a){logger[_0xe6eb('0x12')]('UpdateMailApplication',_0x50997a[_0xe6eb('0x13')],_0xab9004);_0x36473a(_0x2718f5[_0xe6eb('0x12')](0x1f4,_0x50997a[_0xe6eb('0x13')]));});});}; \ No newline at end of file +var _0x9ddb=['rpc','../../config/environment','jayson/promise','client','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailApplication','update','options','raw','where','attributes','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1a8c72,_0x5bd49e){var _0x117e35=function(_0x1ad4cf){while(--_0x1ad4cf){_0x1a8c72['push'](_0x1a8c72['shift']());}};_0x117e35(++_0x5bd49e);}(_0x9ddb,0x6b));var _0xb9dd=function(_0x49c185,_0x4c1ea5){_0x49c185=_0x49c185-0x0;var _0x40dc3e=_0x9ddb[_0x49c185];return _0x40dc3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb9dd('0x0'));var rs=require(_0xb9dd('0x1'));var fs=require('fs');var Redis=require(_0xb9dd('0x2'));var db=require(_0xb9dd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9dd('0x4'))(_0xb9dd('0x5'));var config=require(_0xb9dd('0x6'));var jayson=require(_0xb9dd('0x7'));var client=jayson[_0xb9dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x354bb0,_0x566e86,_0x409ebd){return new BPromise(function(_0x1bc7c0,_0x57fc6f){return client[_0xb9dd('0x9')](_0x354bb0,_0x409ebd)[_0xb9dd('0xa')](function(_0x3a3c45){logger['info'](_0xb9dd('0xb'),_0x566e86,_0xb9dd('0xc'));logger[_0xb9dd('0xd')](_0xb9dd('0xe'),_0x566e86,'request\x20sent',JSON[_0xb9dd('0xf')](_0x3a3c45));if(_0x3a3c45['error']){if(_0x3a3c45[_0xb9dd('0x10')][_0xb9dd('0x11')]===0x1f4){logger['error'](_0xb9dd('0xb'),_0x566e86,_0x3a3c45[_0xb9dd('0x10')]['message']);return _0x57fc6f(_0x3a3c45[_0xb9dd('0x10')]['message']);}logger[_0xb9dd('0x10')]('MailApplication,\x20%s,\x20%s',_0x566e86,_0x3a3c45[_0xb9dd('0x10')]['message']);return _0x1bc7c0(_0x3a3c45[_0xb9dd('0x10')][_0xb9dd('0x12')]);}else{logger[_0xb9dd('0x13')](_0xb9dd('0xb'),_0x566e86,'request\x20sent');_0x1bc7c0(_0x3a3c45[_0xb9dd('0x14')]['message']);}})[_0xb9dd('0x15')](function(_0x54df6c){logger[_0xb9dd('0x10')]('MailApplication,\x20%s,\x20%s',_0x566e86,_0x54df6c);_0x57fc6f(_0x54df6c);});});}exports[_0xb9dd('0x16')]=function(_0x4d93c2){var _0x504df6=this;return new Promise(function(_0x58cb8f,_0x378477){return db['MailApplication'][_0xb9dd('0x17')](_0x4d93c2['body'],{'raw':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')][_0xb9dd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')][_0xb9dd('0x1a')]||null:null,'attributes':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')][_0xb9dd('0x1b')]||null:null,'limit':_0x4d93c2[_0xb9dd('0x18')]?_0x4d93c2[_0xb9dd('0x18')]['limit']||null:null})[_0xb9dd('0xa')](function(_0x1eac8a){logger[_0xb9dd('0x13')](_0xb9dd('0x16'),_0x4d93c2);logger['debug'](_0xb9dd('0x16'),_0x4d93c2,JSON[_0xb9dd('0xf')](_0x1eac8a));_0x58cb8f(_0x1eac8a);})[_0xb9dd('0x15')](function(_0x11bf63){logger[_0xb9dd('0x10')]('UpdateMailApplication',_0x11bf63[_0xb9dd('0x12')],_0x4d93c2);_0x378477(_0x504df6[_0xb9dd('0x10')](0x1f4,_0x11bf63['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 1ce3b77..0743624 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 _0x6b2b=['index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy','removeTags','exports','../../components/interaction/service','get'];(function(_0x527e7f,_0x156347){var _0x16a9f9=function(_0x30c4aa){while(--_0x30c4aa){_0x527e7f['push'](_0x527e7f['shift']());}};_0x16a9f9(++_0x156347);}(_0x6b2b,0xd6));var _0xb6b2=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x6b2b[_0x432fca];return _0x3adba4;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb6b2('0x0'));var controller=require('./mailInteraction.controller');router[_0xb6b2('0x1')]('/',auth['isAuthenticated'](),controller[_0xb6b2('0x2')]);router[_0xb6b2('0x1')](_0xb6b2('0x3'),auth[_0xb6b2('0x4')](),controller[_0xb6b2('0x5')]);router[_0xb6b2('0x1')]('/:id',auth[_0xb6b2('0x4')](),controller[_0xb6b2('0x6')]);router[_0xb6b2('0x1')](_0xb6b2('0x7'),auth[_0xb6b2('0x4')](),controller[_0xb6b2('0x8')]);router[_0xb6b2('0x1')]('/:id/download',auth['isAuthenticated'](),controller[_0xb6b2('0x9')]);router[_0xb6b2('0xa')]('/',auth[_0xb6b2('0x4')](),controller[_0xb6b2('0xb')]);router[_0xb6b2('0xa')](_0xb6b2('0x7'),auth[_0xb6b2('0x4')](),controller[_0xb6b2('0xc')]);router[_0xb6b2('0xa')](_0xb6b2('0xd'),auth[_0xb6b2('0x4')](),interaction[_0xb6b2('0xe')](_0xb6b2('0xf'),_0xb6b2('0x10')),controller[_0xb6b2('0x11')]);router[_0xb6b2('0x12')]('/:id',auth[_0xb6b2('0x4')](),interaction[_0xb6b2('0xe')](_0xb6b2('0xf'),_0xb6b2('0x13')),controller[_0xb6b2('0x14')]);router[_0xb6b2('0x15')](_0xb6b2('0x16'),auth[_0xb6b2('0x4')](),interaction[_0xb6b2('0xe')](_0xb6b2('0xf'),_0xb6b2('0x17')),controller[_0xb6b2('0x18')]);router[_0xb6b2('0x15')](_0xb6b2('0xd'),auth['isAuthenticated'](),controller[_0xb6b2('0x19')]);module[_0xb6b2('0x1a')]=router; \ No newline at end of file +var _0x1b80=['/:id/messages','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','Router','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','create'];(function(_0x30d1df,_0x51a482){var _0xda3f00=function(_0x100c8b){while(--_0x100c8b){_0x30d1df['push'](_0x30d1df['shift']());}};_0xda3f00(++_0x51a482);}(_0x1b80,0x112));var _0x01b8=function(_0x11dd48,_0x4531a4){_0x11dd48=_0x11dd48-0x0;var _0x11222c=_0x1b80[_0x11dd48];return _0x11222c;};'use strict';var express=require('express');var router=express[_0x01b8('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x01b8('0x1'));var controller=require('./mailInteraction.controller');router[_0x01b8('0x2')]('/',auth[_0x01b8('0x3')](),controller['index']);router[_0x01b8('0x2')](_0x01b8('0x4'),auth[_0x01b8('0x3')](),controller[_0x01b8('0x5')]);router[_0x01b8('0x2')](_0x01b8('0x6'),auth[_0x01b8('0x3')](),controller[_0x01b8('0x7')]);router['get']('/:id/messages',auth[_0x01b8('0x3')](),controller['getMessages']);router[_0x01b8('0x2')](_0x01b8('0x8'),auth['isAuthenticated'](),controller[_0x01b8('0x9')]);router[_0x01b8('0xa')]('/',auth[_0x01b8('0x3')](),controller[_0x01b8('0xb')]);router['post'](_0x01b8('0xc'),auth[_0x01b8('0x3')](),controller[_0x01b8('0xd')]);router[_0x01b8('0xa')]('/:id/tags',auth[_0x01b8('0x3')](),interaction[_0x01b8('0xe')](_0x01b8('0xf'),_0x01b8('0x10')),controller[_0x01b8('0x11')]);router[_0x01b8('0x12')](_0x01b8('0x6'),auth[_0x01b8('0x3')](),interaction[_0x01b8('0xe')](_0x01b8('0xf'),_0x01b8('0x13')),controller[_0x01b8('0x14')]);router[_0x01b8('0x15')](_0x01b8('0x6'),auth[_0x01b8('0x3')](),interaction[_0x01b8('0xe')]('mail',_0x01b8('0x16')),controller[_0x01b8('0x17')]);router[_0x01b8('0x15')](_0x01b8('0x18'),auth[_0x01b8('0x3')](),controller[_0x01b8('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f6fe744..1fb99e6 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 _0xbafa=['iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x4f5dc1,_0x1c6e63){var _0xa8a8e1=function(_0x357a5c){while(--_0x357a5c){_0x4f5dc1['push'](_0x4f5dc1['shift']());}};_0xa8a8e1(++_0x1c6e63);}(_0xbafa,0x81));var _0xabaf=function(_0x43b25c,_0x3772f2){_0x43b25c=_0x43b25c-0x0;var _0x4702f1=_0xbafa[_0x43b25c];return _0x4702f1;};'use strict';var Sequelize=require(_0xabaf('0x0'));var iconv=require(_0xabaf('0x1'));module[_0xabaf('0x2')]={'closed':{'type':Sequelize[_0xabaf('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xabaf('0x4')]},'disposition':{'type':Sequelize[_0xabaf('0x5')]},'secondDisposition':{'type':Sequelize[_0xabaf('0x5')]},'thirdDisposition':{'type':Sequelize[_0xabaf('0x5')]},'note':{'type':Sequelize[_0xabaf('0x5')]},'inReplyTo':{'type':Sequelize[_0xabaf('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xabaf('0x6')](_0xabaf('0x7'))},'subject':{'type':Sequelize[_0xabaf('0x6')]()},'attach':{'type':Sequelize[_0xabaf('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xabaf('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xabaf('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xabaf('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xabaf('0x8')]('in',_0xabaf('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xabaf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbeff=['long','DATE','ENUM','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x2dce9d,_0x2cc39f){var _0x414e7b=function(_0x3408e0){while(--_0x3408e0){_0x2dce9d['push'](_0x2dce9d['shift']());}};_0x414e7b(++_0x2cc39f);}(_0xbeff,0x13e));var _0xfbef=function(_0x5bb2d8,_0x47a1db){_0x5bb2d8=_0x5bb2d8-0x0;var _0x19dc01=_0xbeff[_0x5bb2d8];return _0x19dc01;};'use strict';var Sequelize=require(_0xfbef('0x0'));var iconv=require(_0xfbef('0x1'));module[_0xfbef('0x2')]={'closed':{'type':Sequelize[_0xfbef('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfbef('0x4')]},'secondDisposition':{'type':Sequelize[_0xfbef('0x4')]},'thirdDisposition':{'type':Sequelize[_0xfbef('0x4')]},'note':{'type':Sequelize[_0xfbef('0x4')]},'inReplyTo':{'type':Sequelize[_0xfbef('0x4')](0x1fe)},'to':{'type':Sequelize[_0xfbef('0x4')]},'cc':{'type':Sequelize[_0xfbef('0x5')](_0xfbef('0x6'))},'subject':{'type':Sequelize[_0xfbef('0x5')]()},'attach':{'type':Sequelize[_0xfbef('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xfbef('0x7')]},'substatus':{'type':Sequelize[_0xfbef('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xfbef('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xfbef('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfbef('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfbef('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 7c6758d..c5cf74d 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 _0xa30b=['readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../config/logger','api','html-entities','redis','localhost','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','send','index','map','fieldName','type','key','findAll','mail','query','user','show','params','model','MailInteraction','filters','attributes','fields','length','includeAll','include','merge','options','find','create','catch','describe','addMessage','body','omit','ids','getMessages','findOne','rawAttributes','keys','intersection','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','rows','addTags','spread','Tag','name','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','root','attachments','transcript-%d-%s.zip','push','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename'];(function(_0x2c3e6f,_0x390b95){var _0x420c17=function(_0x3b5295){while(--_0x3b5295){_0x2c3e6f['push'](_0x2c3e6f['shift']());}};_0x420c17(++_0x390b95);}(_0xa30b,0x160));var _0xba30=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa30b[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xba30('0x0'));var rimraf=require(_0xba30('0x1'));var zipdir=require(_0xba30('0x2'));var moment=require(_0xba30('0x3'));var BPromise=require(_0xba30('0x4'));var util=require(_0xba30('0x5'));var path=require(_0xba30('0x6'));var fs=require('fs');var _=require(_0xba30('0x7'));var juice=require(_0xba30('0x8'));var Redis=require(_0xba30('0x9'));var interaction=require(_0xba30('0xa'));var qs=require('../../components/parsers/qs');var logger=require(_0xba30('0xb'))(_0xba30('0xc'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xba30('0xd'));config[_0xba30('0xe')]=_['defaults'](config[_0xba30('0xe')],{'host':_0xba30('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba30('0xe')]));require(_0xba30('0x10'))[_0xba30('0x11')](socket);function respondWithStatusCode(_0x45b597,_0xb488a6){_0xb488a6=_0xb488a6||0xcc;return function(_0x588ab3){if(_0x588ab3){return _0x45b597[_0xba30('0x12')](_0xb488a6);}return _0x45b597[_0xba30('0x13')](_0xb488a6)['end']();};}function respondWithResult(_0x2aa41f,_0x2c10e6){_0x2c10e6=_0x2c10e6||0xc8;return function(_0x11affd){if(_0x11affd){return _0x2aa41f['status'](_0x2c10e6)[_0xba30('0x14')](_0x11affd);}};}function respondWithFilteredResult(_0x558037,_0x4fb317){return function(_0x356fa8){if(_0x356fa8){var _0x1e74b5=typeof _0x4fb317[_0xba30('0x15')]===_0xba30('0x16')&&typeof _0x4fb317[_0xba30('0x17')]===_0xba30('0x16');var _0x34da37=_0x356fa8[_0xba30('0x18')];var _0x46a3ed=_0x1e74b5?0x0:_0x4fb317['offset'];var _0x1ea98f=_0x1e74b5?_0x356fa8['count']:_0x4fb317[_0xba30('0x15')]+_0x4fb317[_0xba30('0x17')];var _0x5c3986;if(_0x1ea98f>=_0x34da37){_0x1ea98f=_0x34da37;_0x5c3986=0xc8;}else{_0x5c3986=0xce;}_0x558037[_0xba30('0x13')](_0x5c3986);return _0x558037[_0xba30('0x19')](_0xba30('0x1a'),_0x46a3ed+'-'+_0x1ea98f+'/'+_0x34da37)[_0xba30('0x14')](_0x356fa8);}return null;};}function saveUpdates(_0x5d8f45){return function(_0x2ab02e){if(_0x2ab02e){return _0x2ab02e[_0xba30('0x1b')](_0x5d8f45)[_0xba30('0x1c')](function(_0x16b309){return _0x16b309;});}return null;};}function removeEntity(_0x1825d0){return function(_0x333cb9){if(_0x333cb9){return _0x333cb9[_0xba30('0x1d')]()['then'](function(){_0x1825d0['status'](0xcc)[_0xba30('0x1e')]();});}};}function handleEntityNotFound(_0x100a43){return function(_0x163551){if(!_0x163551){_0x100a43[_0xba30('0x12')](0x194);}return _0x163551;};}function handleError(_0x3ce931,_0x4de84d){_0x4de84d=_0x4de84d||0x1f4;return function(_0x10cf64){logger[_0xba30('0x1f')](_0x10cf64[_0xba30('0x20')]);if(_0x10cf64['name']){delete _0x10cf64['name'];}_0x3ce931[_0xba30('0x13')](_0x4de84d)[_0xba30('0x21')](_0x10cf64);};}exports[_0xba30('0x22')]=function(_0x16b64d,_0x68a495){var _0x19e086={};var _0x2c5611=_[_0xba30('0x23')](db['MailInteraction']['rawAttributes'],function(_0x5438ca){return{'name':_0x5438ca[_0xba30('0x24')],'type':_0x5438ca[_0xba30('0x25')][_0xba30('0x26')]};});_0x19e086=qs['getOptions'](_0x2c5611,_0x16b64d);return interaction[_0xba30('0x27')](_0xba30('0x28'),_0x16b64d[_0xba30('0x29')],_0x16b64d[_0xba30('0x2a')],_0x19e086,_0x2c5611)[_0xba30('0x1c')](respondWithFilteredResult(_0x68a495,_0x19e086))['catch'](handleError(_0x68a495,null));};exports[_0xba30('0x2b')]=function(_0x310bec,_0x2f9969){var _0x2694d2={'raw':![],'where':{'id':_0x310bec[_0xba30('0x2c')]['id']}},_0x10c366={};_0x10c366[_0xba30('0x2d')]=_['keys'](db[_0xba30('0x2e')]['rawAttributes']);_0x10c366['query']=_['keys'](_0x310bec[_0xba30('0x29')]);_0x10c366[_0xba30('0x2f')]=_['intersection'](_0x10c366[_0xba30('0x2d')],_0x10c366[_0xba30('0x29')]);_0x2694d2[_0xba30('0x30')]=_['intersection'](_0x10c366[_0xba30('0x2d')],qs[_0xba30('0x31')](_0x310bec[_0xba30('0x29')][_0xba30('0x31')]));_0x2694d2['attributes']=_0x2694d2[_0xba30('0x30')][_0xba30('0x32')]?_0x2694d2[_0xba30('0x30')]:_0x10c366[_0xba30('0x2d')];if(_0x310bec[_0xba30('0x29')][_0xba30('0x33')]){_0x2694d2[_0xba30('0x34')]=[{'all':!![]}];}_0x2694d2=_[_0xba30('0x35')]({},_0x2694d2,_0x310bec[_0xba30('0x36')]);return db[_0xba30('0x2e')][_0xba30('0x37')](_0x2694d2)[_0xba30('0x1c')](handleEntityNotFound(_0x2f9969,null))['then'](respondWithResult(_0x2f9969,null))['catch'](handleError(_0x2f9969,null));};exports[_0xba30('0x38')]=function(_0x327c5e,_0x712c33){return db['MailInteraction'][_0xba30('0x38')](_0x327c5e['body'],{})['then'](respondWithResult(_0x712c33,0xc9))[_0xba30('0x39')](handleError(_0x712c33,null));};exports[_0xba30('0x1b')]=function(_0xdab6a4,_0xa17876){if(_0xdab6a4['body']['id']){delete _0xdab6a4['body']['id'];}return db[_0xba30('0x2e')]['find']({'where':{'id':_0xdab6a4[_0xba30('0x2c')]['id']}})[_0xba30('0x1c')](handleEntityNotFound(_0xa17876,null))[_0xba30('0x1c')](saveUpdates(_0xdab6a4['body'],null))['then'](respondWithResult(_0xa17876,null))['catch'](handleError(_0xa17876,null));};exports[_0xba30('0x1d')]=function(_0x23c5f6,_0x41ce0f){return db[_0xba30('0x2e')][_0xba30('0x37')]({'where':{'id':_0x23c5f6['params']['id']}})[_0xba30('0x1c')](handleEntityNotFound(_0x41ce0f,null))[_0xba30('0x1c')](removeEntity(_0x41ce0f,null))['catch'](handleError(_0x41ce0f,null));};exports[_0xba30('0x3a')]=function(_0x103feb,_0x4d4bd6){return db['MailInteraction'][_0xba30('0x3a')]()[_0xba30('0x1c')](respondWithResult(_0x4d4bd6,null))[_0xba30('0x39')](handleError(_0x4d4bd6,null));};exports[_0xba30('0x3b')]=function(_0x5b126e,_0x156f9c){return db['MailMessage'][_0xba30('0x37')]({'where':{'id':_0x5b126e[_0xba30('0x2c')]['id']}})['then'](handleEntityNotFound(_0x156f9c,null))[_0xba30('0x1c')](function(_0x4c25b5){if(_0x4c25b5){return _0x4c25b5[_0xba30('0x3b')](_0x5b126e[_0xba30('0x3c')]['ids'],_[_0xba30('0x3d')](_0x5b126e[_0xba30('0x3c')],[_0xba30('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x156f9c,null))['catch'](handleError(_0x156f9c,null));};exports[_0xba30('0x3f')]=function(_0x49a3cc,_0x306e3a){var _0x13d042={'raw':![],'where':{}};var _0x35b49d={};var _0x2314b0={'count':0x0,'rows':[]};return db['MailInteraction'][_0xba30('0x40')]({'where':{'id':_0x49a3cc['params']['id']}})[_0xba30('0x1c')](handleEntityNotFound(_0x306e3a,null))[_0xba30('0x1c')](function(_0x458ed7){if(_0x458ed7){_0x35b49d['model']=_['keys'](db['MailMessage'][_0xba30('0x41')]);_0x35b49d[_0xba30('0x29')]=_[_0xba30('0x42')](_0x49a3cc['query']);_0x35b49d[_0xba30('0x2f')]=_[_0xba30('0x43')](_0x35b49d['model'],_0x35b49d[_0xba30('0x29')]);_0x13d042['attributes']=_[_0xba30('0x43')](_0x35b49d['model'],qs[_0xba30('0x31')](_0x49a3cc[_0xba30('0x29')][_0xba30('0x31')]));_0x13d042['attributes']=_0x13d042[_0xba30('0x30')][_0xba30('0x32')]?_0x13d042[_0xba30('0x30')]:_0x35b49d[_0xba30('0x2d')];if(!_0x49a3cc[_0xba30('0x29')]['hasOwnProperty'](_0xba30('0x44'))){_0x13d042[_0xba30('0x17')]=qs[_0xba30('0x17')](_0x49a3cc[_0xba30('0x29')][_0xba30('0x17')]);_0x13d042['offset']=qs[_0xba30('0x15')](_0x49a3cc[_0xba30('0x29')]['offset']);}_0x13d042[_0xba30('0x45')]=qs[_0xba30('0x46')](_0x49a3cc[_0xba30('0x29')][_0xba30('0x46')]);_0x13d042[_0xba30('0x47')]=qs[_0xba30('0x2f')](_[_0xba30('0x48')](_0x49a3cc[_0xba30('0x29')],_0x35b49d['filters']));_0x13d042[_0xba30('0x47')][_0xba30('0x49')]=_0x458ed7['id'];if(_0x49a3cc[_0xba30('0x29')][_0xba30('0x4a')]){_0x13d042[_0xba30('0x47')]=_['merge'](_0x13d042[_0xba30('0x47')],{'$or':_[_0xba30('0x23')](_0x13d042[_0xba30('0x30')],function(_0x552163){var _0x542dff={};_0x542dff[_0x552163]={'$like':'%'+_0x49a3cc['query'][_0xba30('0x4a')]+'%'};return _0x542dff;})});}if(_0x49a3cc[_0xba30('0x29')]['$gte']){var _0x22c72b=_0x49a3cc['query'][_0xba30('0x4b')]['split'](',');var _0x2c55b1={};_0x2c55b1[_0x22c72b[0x0]]={'$gte':moment(_0x22c72b[0x1])[_0xba30('0x4c')](_0xba30('0x4d'))};_0x13d042['where']=_['merge'](_0x13d042[_0xba30('0x47')],_0x2c55b1);}_0x13d042=_['merge']({},_0x13d042,_0x49a3cc[_0xba30('0x36')]);return db[_0xba30('0x4e')][_0xba30('0x18')]({'where':_0x13d042[_0xba30('0x47')]})[_0xba30('0x1c')](function(_0x1ba653){_0x2314b0['count']=_0x1ba653;if(_0x49a3cc[_0xba30('0x29')]['includeAll']){_0x13d042['include']=[{'all':!![]}];}return db['MailMessage'][_0xba30('0x27')](_0x13d042);})[_0xba30('0x1c')](function(_0x2f0c7f){if(_0x49a3cc[_0xba30('0x29')][_0xba30('0x4f')]===_0xba30('0x50')){for(var _0x44825b=0x0;_0x44825b<_0x2f0c7f[_0xba30('0x32')];_0x44825b++){_0x2f0c7f[_0x44825b][_0xba30('0x3c')]=juice(_0x2f0c7f[_0x44825b][_0xba30('0x3c')]);}}_0x2314b0[_0xba30('0x51')]=_0x2f0c7f;return _0x2314b0;});}})[_0xba30('0x1c')](respondWithFilteredResult(_0x306e3a,_0x13d042))['catch'](handleError(_0x306e3a,null));};exports[_0xba30('0x52')]=function(_0x4254f2,_0x5ccb1e){return db[_0xba30('0x2e')][_0xba30('0x37')]({'where':{'id':_0x4254f2['params']['id']}})[_0xba30('0x1c')](handleEntityNotFound(_0x5ccb1e,null))[_0xba30('0x1c')](function(_0xe8deed){if(_0xe8deed){return _0xe8deed['setTags'](_0x4254f2[_0xba30('0x3c')][_0xba30('0x3e')],_[_0xba30('0x3d')](_0x4254f2['body'],[_0xba30('0x3e'),'id'])||{})[_0xba30('0x53')](function(){return db[_0xba30('0x54')][_0xba30('0x27')]({'attributes':['id',_0xba30('0x55'),_0xba30('0x56')],'where':{'id':_0x4254f2[_0xba30('0x3c')][_0xba30('0x3e')]}});})[_0xba30('0x1c')](function(_0xf6964c){socket[_0xba30('0x57')](_0xba30('0x58'),{'id':Number(_0x4254f2[_0xba30('0x2c')]['id']),'tags':_0xf6964c||[]});return{'id':Number(_0x4254f2['params']['id']),'tags':_0xf6964c||[]};});}})[_0xba30('0x1c')](respondWithResult(_0x5ccb1e,null))[_0xba30('0x39')](handleError(_0x5ccb1e,null));};exports[_0xba30('0x59')]=function(_0xc934f2,_0x4195f7){return db['MailInteraction'][_0xba30('0x37')]({'where':{'id':_0xc934f2[_0xba30('0x2c')]['id']}})[_0xba30('0x1c')](handleEntityNotFound(_0x4195f7,null))['then'](function(_0x2b08b0){if(_0x2b08b0){return _0x2b08b0[_0xba30('0x59')](_0xc934f2[_0xba30('0x29')][_0xba30('0x3e')]);}})[_0xba30('0x1c')](respondWithStatusCode(_0x4195f7,null))[_0xba30('0x39')](handleError(_0x4195f7,null));};exports[_0xba30('0x5a')]=function(_0x4ea70a,_0x55eaa4){var _0x37ab90=moment()[_0xba30('0x5b')]()[_0xba30('0x5c')]();var _0x23fe7e=path[_0xba30('0x5d')](config['root'],'server',_0xba30('0x5e'),_0xba30('0x5f'));var _0x3c3f0d=path[_0xba30('0x5d')](config[_0xba30('0x60')],'server','files',_0xba30('0x61'));var _0x55ef31=path[_0xba30('0x5d')](_0x23fe7e,_0x37ab90);var _0x904700=util['format'](_0xba30('0x62'),_0x4ea70a['params']['id'],_0x37ab90);var _0x1f4d98=path[_0xba30('0x5d')](_0x23fe7e,_0x904700);var _0xe68f84=[];if(_0x4ea70a['query'][_0xba30('0x61')]){_0xe68f84[_0xba30('0x63')]({'model':db['Attachment'],'as':_0xba30('0x64'),'raw':!![]});}var _0x3f6d4e=[{'model':db[_0xba30('0x4e')],'as':_0xba30('0x65'),'attributes':['id',_0xba30('0x3c'),'from','to','cc',_0xba30('0x66'),_0xba30('0x67'),_0xba30('0x68')],'where':{'secret':![]},'order':qs[_0xba30('0x46')]('id'),'include':_0xe68f84}];return db[_0xba30('0x2e')][_0xba30('0x37')]({'where':{'id':_0x4ea70a[_0xba30('0x2c')]['id']},'include':_0x3f6d4e})[_0xba30('0x1c')](handleEntityNotFound(_0x55eaa4,null))[_0xba30('0x1c')](function(_0x95f6b8){if(_0x95f6b8&&_0x95f6b8['Messages']){var _0xb7d2cf=_0x95f6b8[_0xba30('0x69')]({'plain':!![]});fs[_0xba30('0x6a')](_0x55ef31);return BPromise[_0xba30('0x6b')](_0xb7d2cf['Messages'],function(_0x4eeb02,_0x39e50e){var _0x696182={'from':_0x4eeb02['from'],'to':_0x4eeb02['to']||'missing.recipient@your.company.com','subject':_0x4eeb02[_0xba30('0x67')],'html':htmlEntities['decode'](_0x4eeb02[_0xba30('0x3c')]),'headers':{'Date':moment(_0x4eeb02[_0xba30('0x68')])[_0xba30('0x4c')](_0xba30('0x6c'))},'attachments':[]};if(_0x4eeb02['cc']){_0x696182[_0xba30('0x6d')]['Cc']=_0x4eeb02['cc'];}if(_0x4eeb02[_0xba30('0x66')]){_0x696182[_0xba30('0x6d')][_0xba30('0x6e')]=_0x4eeb02[_0xba30('0x66')];}return new BPromise(function(_0x252c1,_0x484a59){if(_0x4eeb02[_0xba30('0x64')]){for(var _0x9d6673=0x0;_0x9d6673<_0x4eeb02[_0xba30('0x64')]['length'];_0x9d6673++){var _0x5e14c3=_0x4eeb02[_0xba30('0x64')][_0x9d6673];var _0xbe8d81=path[_0xba30('0x5d')](_0x3c3f0d,_0x5e14c3[_0xba30('0x6f')]);if(fs['existsSync'](_0xbe8d81)){_0x696182[_0xba30('0x61')][_0xba30('0x63')]({'name':_0x5e14c3[_0xba30('0x55')],'contentType':_0x5e14c3[_0xba30('0x25')],'data':fs[_0xba30('0x70')](_0xbe8d81)});}}}emlformat['build'](_0x696182,function(_0x4d8ef2,_0x42a044){if(_0x4d8ef2)return _0x484a59(_0x4d8ef2);fs[_0xba30('0x71')](path[_0xba30('0x5d')](_0x55ef31,util[_0xba30('0x4c')](_0xba30('0x72'),_0x39e50e)),_0x42a044);return _0x252c1(_0x42a044);});});})[_0xba30('0x1c')](function(){return new BPromise(function(_0x1c90c6,_0x15be19){zipdir(_0x55ef31,{'saveTo':_0x1f4d98},function(_0x111f7d,_0x5d1cab){if(_0x111f7d)return _0x15be19(_0x111f7d);return _0x1c90c6(_0x5d1cab);});})[_0xba30('0x1c')](function(){return new BPromise(function(_0x55b5bd,_0x4b7815){rimraf(_0x55ef31,function(_0xf80284){if(_0xf80284)_0x4b7815(_0xf80284);return _0x55b5bd();});});})['then'](function(){return _0x55eaa4[_0xba30('0x5a')](_0x1f4d98,_0x904700,function(_0x1fe221){if(!_0x1fe221)fs[_0xba30('0x73')](_0x1f4d98);});});});}else{return _0x55eaa4[_0xba30('0x12')](0xc8);}})['catch'](handleError(_0x55eaa4,null));}; \ No newline at end of file +var _0x27ac=['true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','push','Attachment','Messages','from','subject','get','mkdirSync','each','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','then','destroy','error','stack','name','send','index','map','MailInteraction','fieldName','type','key','findAll','mail','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x27ac,0xa0));var _0xc27a=function(_0x2e7426,_0x21caa7){_0x2e7426=_0x2e7426-0x0;var _0x4ddeb6=_0x27ac[_0x2e7426];return _0x4ddeb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc27a('0x0'));var zipdir=require('zip-dir');var moment=require(_0xc27a('0x1'));var BPromise=require(_0xc27a('0x2'));var util=require(_0xc27a('0x3'));var path=require(_0xc27a('0x4'));var fs=require('fs');var _=require('lodash');var juice=require(_0xc27a('0x5'));var Redis=require(_0xc27a('0x6'));var interaction=require(_0xc27a('0x7'));var qs=require(_0xc27a('0x8'));var logger=require(_0xc27a('0x9'))(_0xc27a('0xa'));var config=require(_0xc27a('0xb'));var db=require(_0xc27a('0xc'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xc27a('0xd')](config['redis'],{'host':_0xc27a('0xe'),'port':0x18eb});var socket=require(_0xc27a('0xf'))(new Redis(config[_0xc27a('0x10')]));require(_0xc27a('0x11'))[_0xc27a('0x12')](socket);function respondWithStatusCode(_0xc5b21,_0x534a31){_0x534a31=_0x534a31||0xcc;return function(_0x59b8f6){if(_0x59b8f6){return _0xc5b21[_0xc27a('0x13')](_0x534a31);}return _0xc5b21['status'](_0x534a31)['end']();};}function respondWithResult(_0x4b5cd0,_0x208834){_0x208834=_0x208834||0xc8;return function(_0x3d64ef){if(_0x3d64ef){return _0x4b5cd0[_0xc27a('0x14')](_0x208834)[_0xc27a('0x15')](_0x3d64ef);}};}function respondWithFilteredResult(_0x4ac09d,_0x464f88){return function(_0x5dfeb1){if(_0x5dfeb1){var _0x4dd9ec=typeof _0x464f88[_0xc27a('0x16')]==='undefined'&&typeof _0x464f88['limit']===_0xc27a('0x17');var _0x2a3c1e=_0x5dfeb1[_0xc27a('0x18')];var _0x251adb=_0x4dd9ec?0x0:_0x464f88[_0xc27a('0x16')];var _0x5ca042=_0x4dd9ec?_0x5dfeb1[_0xc27a('0x18')]:_0x464f88[_0xc27a('0x16')]+_0x464f88[_0xc27a('0x19')];var _0x154ca5;if(_0x5ca042>=_0x2a3c1e){_0x5ca042=_0x2a3c1e;_0x154ca5=0xc8;}else{_0x154ca5=0xce;}_0x4ac09d['status'](_0x154ca5);return _0x4ac09d['set'](_0xc27a('0x1a'),_0x251adb+'-'+_0x5ca042+'/'+_0x2a3c1e)[_0xc27a('0x15')](_0x5dfeb1);}return null;};}function saveUpdates(_0x3cd19a){return function(_0x4d11d7){if(_0x4d11d7){return _0x4d11d7['update'](_0x3cd19a)[_0xc27a('0x1b')](function(_0xf57c52){return _0xf57c52;});}return null;};}function removeEntity(_0x4f7bda){return function(_0x3acbea){if(_0x3acbea){return _0x3acbea[_0xc27a('0x1c')]()[_0xc27a('0x1b')](function(){_0x4f7bda[_0xc27a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x625d1e){return function(_0x53b78c){if(!_0x53b78c){_0x625d1e[_0xc27a('0x13')](0x194);}return _0x53b78c;};}function handleError(_0x4714ef,_0x3ca347){_0x3ca347=_0x3ca347||0x1f4;return function(_0x228054){logger[_0xc27a('0x1d')](_0x228054[_0xc27a('0x1e')]);if(_0x228054['name']){delete _0x228054[_0xc27a('0x1f')];}_0x4714ef[_0xc27a('0x14')](_0x3ca347)[_0xc27a('0x20')](_0x228054);};}exports[_0xc27a('0x21')]=function(_0x54f323,_0x340945){var _0x550d9e={};var _0x3b310b=_[_0xc27a('0x22')](db[_0xc27a('0x23')]['rawAttributes'],function(_0x4d04fc){return{'name':_0x4d04fc[_0xc27a('0x24')],'type':_0x4d04fc[_0xc27a('0x25')][_0xc27a('0x26')]};});_0x550d9e=qs['getOptions'](_0x3b310b,_0x54f323);return interaction[_0xc27a('0x27')](_0xc27a('0x28'),_0x54f323[_0xc27a('0x29')],_0x54f323['user'],_0x550d9e,_0x3b310b)[_0xc27a('0x1b')](respondWithFilteredResult(_0x340945,_0x550d9e))[_0xc27a('0x2a')](handleError(_0x340945,null));};exports[_0xc27a('0x2b')]=function(_0x2b35fa,_0x5572dd){var _0x2abc9a={'raw':![],'where':{'id':_0x2b35fa[_0xc27a('0x2c')]['id']}},_0x16944c={};_0x16944c[_0xc27a('0x2d')]=_[_0xc27a('0x2e')](db[_0xc27a('0x23')][_0xc27a('0x2f')]);_0x16944c['query']=_['keys'](_0x2b35fa['query']);_0x16944c[_0xc27a('0x30')]=_[_0xc27a('0x31')](_0x16944c[_0xc27a('0x2d')],_0x16944c[_0xc27a('0x29')]);_0x2abc9a[_0xc27a('0x32')]=_[_0xc27a('0x31')](_0x16944c['model'],qs[_0xc27a('0x33')](_0x2b35fa[_0xc27a('0x29')][_0xc27a('0x33')]));_0x2abc9a[_0xc27a('0x32')]=_0x2abc9a['attributes'][_0xc27a('0x34')]?_0x2abc9a[_0xc27a('0x32')]:_0x16944c['model'];if(_0x2b35fa[_0xc27a('0x29')][_0xc27a('0x35')]){_0x2abc9a[_0xc27a('0x36')]=[{'all':!![]}];}_0x2abc9a=_[_0xc27a('0x37')]({},_0x2abc9a,_0x2b35fa[_0xc27a('0x38')]);return db[_0xc27a('0x23')][_0xc27a('0x39')](_0x2abc9a)[_0xc27a('0x1b')](handleEntityNotFound(_0x5572dd,null))['then'](respondWithResult(_0x5572dd,null))[_0xc27a('0x2a')](handleError(_0x5572dd,null));};exports[_0xc27a('0x3a')]=function(_0x20fdca,_0x36bda2){return db[_0xc27a('0x23')][_0xc27a('0x3a')](_0x20fdca[_0xc27a('0x3b')],{})[_0xc27a('0x1b')](respondWithResult(_0x36bda2,0xc9))[_0xc27a('0x2a')](handleError(_0x36bda2,null));};exports[_0xc27a('0x3c')]=function(_0x390460,_0x4b880d){if(_0x390460['body']['id']){delete _0x390460[_0xc27a('0x3b')]['id'];}return db['MailInteraction'][_0xc27a('0x39')]({'where':{'id':_0x390460['params']['id']}})['then'](handleEntityNotFound(_0x4b880d,null))[_0xc27a('0x1b')](saveUpdates(_0x390460[_0xc27a('0x3b')],null))['then'](respondWithResult(_0x4b880d,null))[_0xc27a('0x2a')](handleError(_0x4b880d,null));};exports[_0xc27a('0x1c')]=function(_0x3ff3d8,_0x14f96b){return db[_0xc27a('0x23')][_0xc27a('0x39')]({'where':{'id':_0x3ff3d8[_0xc27a('0x2c')]['id']}})[_0xc27a('0x1b')](handleEntityNotFound(_0x14f96b,null))[_0xc27a('0x1b')](removeEntity(_0x14f96b,null))['catch'](handleError(_0x14f96b,null));};exports['describe']=function(_0x23207f,_0x28575e){return db[_0xc27a('0x23')][_0xc27a('0x3d')]()[_0xc27a('0x1b')](respondWithResult(_0x28575e,null))[_0xc27a('0x2a')](handleError(_0x28575e,null));};exports[_0xc27a('0x3e')]=function(_0x361dcc,_0x2f6458){return db['MailMessage'][_0xc27a('0x39')]({'where':{'id':_0x361dcc[_0xc27a('0x2c')]['id']}})[_0xc27a('0x1b')](handleEntityNotFound(_0x2f6458,null))[_0xc27a('0x1b')](function(_0x5e81d2){if(_0x5e81d2){return _0x5e81d2[_0xc27a('0x3e')](_0x361dcc[_0xc27a('0x3b')][_0xc27a('0x3f')],_[_0xc27a('0x40')](_0x361dcc[_0xc27a('0x3b')],[_0xc27a('0x3f'),'id'])||{});}})[_0xc27a('0x1b')](respondWithResult(_0x2f6458,null))[_0xc27a('0x2a')](handleError(_0x2f6458,null));};exports[_0xc27a('0x41')]=function(_0x313ae2,_0xb087e2){var _0x301d9c={'raw':![],'where':{}};var _0x10ca04={};var _0x333a5f={'count':0x0,'rows':[]};return db['MailInteraction'][_0xc27a('0x42')]({'where':{'id':_0x313ae2['params']['id']}})[_0xc27a('0x1b')](handleEntityNotFound(_0xb087e2,null))[_0xc27a('0x1b')](function(_0x4ca301){if(_0x4ca301){_0x10ca04[_0xc27a('0x2d')]=_[_0xc27a('0x2e')](db[_0xc27a('0x43')]['rawAttributes']);_0x10ca04[_0xc27a('0x29')]=_['keys'](_0x313ae2[_0xc27a('0x29')]);_0x10ca04['filters']=_[_0xc27a('0x31')](_0x10ca04['model'],_0x10ca04['query']);_0x301d9c[_0xc27a('0x32')]=_[_0xc27a('0x31')](_0x10ca04[_0xc27a('0x2d')],qs[_0xc27a('0x33')](_0x313ae2[_0xc27a('0x29')][_0xc27a('0x33')]));_0x301d9c[_0xc27a('0x32')]=_0x301d9c[_0xc27a('0x32')][_0xc27a('0x34')]?_0x301d9c['attributes']:_0x10ca04['model'];if(!_0x313ae2[_0xc27a('0x29')]['hasOwnProperty'](_0xc27a('0x44'))){_0x301d9c[_0xc27a('0x19')]=qs[_0xc27a('0x19')](_0x313ae2[_0xc27a('0x29')][_0xc27a('0x19')]);_0x301d9c[_0xc27a('0x16')]=qs[_0xc27a('0x16')](_0x313ae2['query']['offset']);}_0x301d9c[_0xc27a('0x45')]=qs[_0xc27a('0x46')](_0x313ae2[_0xc27a('0x29')]['sort']);_0x301d9c[_0xc27a('0x47')]=qs[_0xc27a('0x30')](_['pick'](_0x313ae2['query'],_0x10ca04['filters']));_0x301d9c[_0xc27a('0x47')][_0xc27a('0x48')]=_0x4ca301['id'];if(_0x313ae2[_0xc27a('0x29')][_0xc27a('0x49')]){_0x301d9c['where']=_[_0xc27a('0x37')](_0x301d9c[_0xc27a('0x47')],{'$or':_[_0xc27a('0x22')](_0x301d9c[_0xc27a('0x32')],function(_0x5164f6){var _0xe7199f={};_0xe7199f[_0x5164f6]={'$like':'%'+_0x313ae2[_0xc27a('0x29')][_0xc27a('0x49')]+'%'};return _0xe7199f;})});}if(_0x313ae2[_0xc27a('0x29')][_0xc27a('0x4a')]){var _0x42e92b=_0x313ae2[_0xc27a('0x29')]['$gte'][_0xc27a('0x4b')](',');var _0x238e63={};_0x238e63[_0x42e92b[0x0]]={'$gte':moment(_0x42e92b[0x1])['format'](_0xc27a('0x4c'))};_0x301d9c[_0xc27a('0x47')]=_[_0xc27a('0x37')](_0x301d9c['where'],_0x238e63);}_0x301d9c=_[_0xc27a('0x37')]({},_0x301d9c,_0x313ae2[_0xc27a('0x38')]);return db[_0xc27a('0x43')][_0xc27a('0x18')]({'where':_0x301d9c['where']})[_0xc27a('0x1b')](function(_0x2d5aa1){_0x333a5f['count']=_0x2d5aa1;if(_0x313ae2['query'][_0xc27a('0x35')]){_0x301d9c[_0xc27a('0x36')]=[{'all':!![]}];}return db['MailMessage'][_0xc27a('0x27')](_0x301d9c);})['then'](function(_0x3fae8f){if(_0x313ae2['query'][_0xc27a('0x4d')]===_0xc27a('0x4e')){for(var _0x1c3be3=0x0;_0x1c3be3<_0x3fae8f[_0xc27a('0x34')];_0x1c3be3++){_0x3fae8f[_0x1c3be3][_0xc27a('0x3b')]=juice(_0x3fae8f[_0x1c3be3][_0xc27a('0x3b')]);}}_0x333a5f[_0xc27a('0x4f')]=_0x3fae8f;return _0x333a5f;});}})[_0xc27a('0x1b')](respondWithFilteredResult(_0xb087e2,_0x301d9c))['catch'](handleError(_0xb087e2,null));};exports[_0xc27a('0x50')]=function(_0x916a5f,_0xff016d){return db[_0xc27a('0x23')][_0xc27a('0x39')]({'where':{'id':_0x916a5f[_0xc27a('0x2c')]['id']}})['then'](handleEntityNotFound(_0xff016d,null))[_0xc27a('0x1b')](function(_0x3b80a0){if(_0x3b80a0){return _0x3b80a0[_0xc27a('0x51')](_0x916a5f[_0xc27a('0x3b')][_0xc27a('0x3f')],_['omit'](_0x916a5f[_0xc27a('0x3b')],[_0xc27a('0x3f'),'id'])||{})[_0xc27a('0x52')](function(){return db[_0xc27a('0x53')]['findAll']({'attributes':['id',_0xc27a('0x1f'),_0xc27a('0x54')],'where':{'id':_0x916a5f[_0xc27a('0x3b')][_0xc27a('0x3f')]}});})[_0xc27a('0x1b')](function(_0x4a24af){socket[_0xc27a('0x55')](_0xc27a('0x56'),{'id':Number(_0x916a5f['params']['id']),'tags':_0x4a24af||[]});return{'id':Number(_0x916a5f[_0xc27a('0x2c')]['id']),'tags':_0x4a24af||[]};});}})[_0xc27a('0x1b')](respondWithResult(_0xff016d,null))[_0xc27a('0x2a')](handleError(_0xff016d,null));};exports[_0xc27a('0x57')]=function(_0xfb2f77,_0x1149e9){return db[_0xc27a('0x23')][_0xc27a('0x39')]({'where':{'id':_0xfb2f77['params']['id']}})['then'](handleEntityNotFound(_0x1149e9,null))['then'](function(_0xf808dc){if(_0xf808dc){return _0xf808dc[_0xc27a('0x57')](_0xfb2f77[_0xc27a('0x29')][_0xc27a('0x3f')]);}})[_0xc27a('0x1b')](respondWithStatusCode(_0x1149e9,null))['catch'](handleError(_0x1149e9,null));};exports[_0xc27a('0x58')]=function(_0x236426,_0x53269a){var _0x29b368=moment()[_0xc27a('0x59')]()[_0xc27a('0x5a')]();var _0x248101=path[_0xc27a('0x5b')](config[_0xc27a('0x5c')],_0xc27a('0x5d'),_0xc27a('0x5e'),_0xc27a('0x5f'));var _0x25336b=path[_0xc27a('0x5b')](config[_0xc27a('0x5c')],_0xc27a('0x5d'),_0xc27a('0x5e'),_0xc27a('0x60'));var _0x11cd94=path['join'](_0x248101,_0x29b368);var _0x4f6841=util[_0xc27a('0x61')]('transcript-%d-%s.zip',_0x236426['params']['id'],_0x29b368);var _0x456fbd=path['join'](_0x248101,_0x4f6841);var _0x1acae6=[];if(_0x236426[_0xc27a('0x29')][_0xc27a('0x60')]){_0x1acae6[_0xc27a('0x62')]({'model':db[_0xc27a('0x63')],'as':'Attachments','raw':!![]});}var _0xeca510=[{'model':db[_0xc27a('0x43')],'as':_0xc27a('0x64'),'attributes':['id',_0xc27a('0x3b'),_0xc27a('0x65'),'to','cc','bcc',_0xc27a('0x66'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x1acae6}];return db['MailInteraction'][_0xc27a('0x39')]({'where':{'id':_0x236426[_0xc27a('0x2c')]['id']},'include':_0xeca510})[_0xc27a('0x1b')](handleEntityNotFound(_0x53269a,null))['then'](function(_0x5c29e9){if(_0x5c29e9&&_0x5c29e9[_0xc27a('0x64')]){var _0x57f56b=_0x5c29e9[_0xc27a('0x67')]({'plain':!![]});fs[_0xc27a('0x68')](_0x11cd94);return BPromise[_0xc27a('0x69')](_0x57f56b['Messages'],function(_0x413d9c,_0x17fdee){var _0x2b680b={'from':_0x413d9c['from'],'to':_0x413d9c['to']||'missing.recipient@your.company.com','subject':_0x413d9c[_0xc27a('0x66')],'html':htmlEntities[_0xc27a('0x6a')](_0x413d9c[_0xc27a('0x3b')]),'headers':{'Date':moment(_0x413d9c[_0xc27a('0x6b')])[_0xc27a('0x61')](_0xc27a('0x6c'))},'attachments':[]};if(_0x413d9c['cc']){_0x2b680b[_0xc27a('0x6d')]['Cc']=_0x413d9c['cc'];}if(_0x413d9c['bcc']){_0x2b680b[_0xc27a('0x6d')][_0xc27a('0x6e')]=_0x413d9c['bcc'];}return new BPromise(function(_0x16ed21,_0x26bf54){if(_0x413d9c[_0xc27a('0x6f')]){for(var _0x141cff=0x0;_0x141cff<_0x413d9c['Attachments']['length'];_0x141cff++){var _0x4c964a=_0x413d9c[_0xc27a('0x6f')][_0x141cff];var _0x1956d8=path[_0xc27a('0x5b')](_0x25336b,_0x4c964a[_0xc27a('0x70')]);if(fs[_0xc27a('0x71')](_0x1956d8)){_0x2b680b[_0xc27a('0x60')][_0xc27a('0x62')]({'name':_0x4c964a[_0xc27a('0x1f')],'contentType':_0x4c964a[_0xc27a('0x25')],'data':fs[_0xc27a('0x72')](_0x1956d8)});}}}emlformat[_0xc27a('0x73')](_0x2b680b,function(_0x1bb529,_0x43795f){if(_0x1bb529)return _0x26bf54(_0x1bb529);fs[_0xc27a('0x74')](path[_0xc27a('0x5b')](_0x11cd94,util['format'](_0xc27a('0x75'),_0x17fdee)),_0x43795f);return _0x16ed21(_0x43795f);});});})[_0xc27a('0x1b')](function(){return new BPromise(function(_0xe9822d,_0x37ea58){zipdir(_0x11cd94,{'saveTo':_0x456fbd},function(_0x3f94f9,_0x35fd89){if(_0x3f94f9)return _0x37ea58(_0x3f94f9);return _0xe9822d(_0x35fd89);});})['then'](function(){return new BPromise(function(_0x3114bb,_0x55b666){rimraf(_0x11cd94,function(_0x146aef){if(_0x146aef)_0x55b666(_0x146aef);return _0x3114bb();});});})[_0xc27a('0x1b')](function(){return _0x53269a[_0xc27a('0x58')](_0x456fbd,_0x4f6841,function(_0x157ea5){if(!_0x157ea5)fs[_0xc27a('0x76')](_0x456fbd);});});});}else{return _0x53269a[_0xc27a('0x13')](0xc8);}})[_0xc27a('0x2a')](handleError(_0x53269a,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 34dfbed..c04ef25 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 _0xacc6=['setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xacc6,0x11d));var _0x6acc=function(_0x3c81b5,_0x3f5ed7){_0x3c81b5=_0x3c81b5-0x0;var _0x5888c4=_0xacc6[_0x3c81b5];return _0x5888c4;};'use strict';var EventEmitter=require(_0x6acc('0x0'));var MailInteraction=require(_0x6acc('0x1'))['db'][_0x6acc('0x2')];var MailMessage=require(_0x6acc('0x1'))['db'][_0x6acc('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6acc('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6acc('0x5'),'afterDestroy':_0x6acc('0x6')};function emitEvent(_0x1e1f0e){return function(_0x2ff908,_0x3db805,_0x21cc28){_0x2ff908[_0x6acc('0x7')]({'attributes':['id'],'raw':!![]})[_0x6acc('0x8')](function(_0x50fe6a){_0x2ff908[_0x6acc('0x9')](_0x6acc('0xa'),_0x50fe6a[_0x6acc('0xb')](function(_0x135cbd){return{'id':_0x135cbd['id']};}));return MailMessage[_0x6acc('0xc')]({'where':{'MailInteractionId':_0x2ff908['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6acc('0x8')](function(_0x565aaf){_0x2ff908['setDataValue']('unreadMessages',_0x565aaf['length']);MailInteractionEvents['emit'](_0x1e1f0e+':'+_0x2ff908['id'],_0x2ff908);MailInteractionEvents[_0x6acc('0xd')](_0x1e1f0e,_0x2ff908);_0x21cc28(null);})[_0x6acc('0xe')](_0x21cc28(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6acc('0xf')](e,emitEvent(event));}}module[_0x6acc('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x9843=['events','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x31facf,_0xc01f9a){var _0xa8c81c=function(_0x46614e){while(--_0x46614e){_0x31facf['push'](_0x31facf['shift']());}};_0xa8c81c(++_0xc01f9a);}(_0x9843,0xaa));var _0x3984=function(_0x1657a0,_0x39129c){_0x1657a0=_0x1657a0-0x0;var _0x5246bb=_0x9843[_0x1657a0];return _0x5246bb;};'use strict';var EventEmitter=require(_0x3984('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x3984('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3984('0x2'),'afterUpdate':_0x3984('0x3'),'afterDestroy':_0x3984('0x4')};function emitEvent(_0x311523){return function(_0x595c6a,_0x8c3451,_0x3ed505){_0x595c6a[_0x3984('0x5')]({'attributes':['id'],'raw':!![]})[_0x3984('0x6')](function(_0x281187){_0x595c6a[_0x3984('0x7')](_0x3984('0x8'),_0x281187[_0x3984('0x9')](function(_0x5f0707){return{'id':_0x5f0707['id']};}));return MailMessage[_0x3984('0xa')]({'where':{'MailInteractionId':_0x595c6a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3984('0x6')](function(_0x40ea47){_0x595c6a[_0x3984('0x7')](_0x3984('0xb'),_0x40ea47['length']);MailInteractionEvents[_0x3984('0xc')](_0x311523+':'+_0x595c6a['id'],_0x595c6a);MailInteractionEvents[_0x3984('0xc')](_0x311523,_0x595c6a);_0x3ed505(null);})[_0x3984('0xd')](_0x3ed505(null));};}for(var e in events){if(events[_0x3984('0xe')](e)){var event=events[e];MailInteraction[_0x3984('0xf')](e,emitEvent(event));}}module[_0x3984('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 4b35dc1..2093c74 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 _0xe96e=['../../config/environment','exports','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatus','closedAt','models','get','MailMessage','then','catch','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1d0a4f,_0x32ea8c){var _0x540b23=function(_0x2b3d22){while(--_0x2b3d22){_0x1d0a4f['push'](_0x1d0a4f['shift']());}};_0x540b23(++_0x32ea8c);}(_0xe96e,0xb3));var _0xee96=function(_0x2acb72,_0x54218e){_0x2acb72=_0x2acb72-0x0;var _0x12b3fc=_0xe96e[_0x2acb72];return _0x12b3fc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee96('0x0'))('api');var moment=require('moment');var BPromise=require(_0xee96('0x1'));var rp=require(_0xee96('0x2'));var fs=require('fs');var path=require(_0xee96('0x3'));var rimraf=require(_0xee96('0x4'));var config=require(_0xee96('0x5'));var attributes=require('./mailInteraction.attributes');module[_0xee96('0x6')]=function(_0x4c815d,_0x5e06b9){return _0x4c815d['define'](_0xee96('0x7'),attributes,{'tableName':_0xee96('0x8'),'paranoid':![],'indexes':[{'name':_0xee96('0x9'),'fields':['subject','to'],'type':_0xee96('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x54e7f5,_0x2890ed,_0x12ede6){if(_0x54e7f5['substatus']){_0x54e7f5[_0xee96('0xb')]=moment()[_0xee96('0xc')](_0xee96('0xd'));}if(_0x54e7f5[_0xee96('0xe')]){_0x54e7f5['closedAt']=moment()[_0xee96('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x12ede6(null,_0x2890ed);},'beforeUpdate':function(_0x458d7e,_0x3b8dba,_0x97aa19){if(_0x458d7e[_0xee96('0xf')](_0xee96('0x10'))){_0x458d7e[_0xee96('0xb')]=_0x458d7e['substatus']?moment()['format'](_0xee96('0xd')):null;}if(_0x458d7e[_0xee96('0xf')](_0xee96('0xe'))){_0x458d7e[_0xee96('0x11')]=moment()[_0xee96('0xc')](_0xee96('0xd'));_0x458d7e['substatus']=null;_0x458d7e['substatusAt']=null;}_0x97aa19(null,_0x458d7e);},'afterUpdate':function(_0x341351,_0x18026e,_0xc6668c){var _0x49a725=_0x4c815d[_0xee96('0x12')];var _0x939857=_0x341351[_0xee96('0x13')]({'plain':!![]});if(_0x939857[_0xee96('0xe')]){return _0x49a725[_0xee96('0x14')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x939857['id']}})[_0xee96('0x15')](function(){_0xc6668c();})[_0xee96('0x16')](function(_0x1f34ca){_0xc6668c(_0x1f34ca);});}else{_0xc6668c();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3323=['closed','closedAt','changed','substatus','substatusAt','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1c1013,_0x141999){var _0x51b180=function(_0x27e4a2){while(--_0x27e4a2){_0x1c1013['push'](_0x1c1013['shift']());}};_0x51b180(++_0x141999);}(_0x3323,0xfc));var _0x3332=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3323[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x3332('0x0'));var logger=require(_0x3332('0x1'))('api');var moment=require(_0x3332('0x2'));var BPromise=require(_0x3332('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3332('0x4'));var rimraf=require(_0x3332('0x5'));var config=require(_0x3332('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x17c500,_0x3a9756){return _0x17c500[_0x3332('0x7')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x3332('0x8'),'to'],'type':_0x3332('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x44c07a,_0x575ee0,_0x1b341c){if(_0x44c07a['substatus']){_0x44c07a['substatusAt']=moment()[_0x3332('0xa')](_0x3332('0xb'));}if(_0x44c07a[_0x3332('0xc')]){_0x44c07a[_0x3332('0xd')]=moment()[_0x3332('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1b341c(null,_0x575ee0);},'beforeUpdate':function(_0x29942f,_0x478cdd,_0x35850e){if(_0x29942f[_0x3332('0xe')](_0x3332('0xf'))){_0x29942f[_0x3332('0x10')]=_0x29942f['substatus']?moment()[_0x3332('0xa')](_0x3332('0xb')):null;}if(_0x29942f[_0x3332('0xe')](_0x3332('0xc'))){_0x29942f[_0x3332('0xd')]=moment()['format'](_0x3332('0xb'));_0x29942f['substatus']=null;_0x29942f[_0x3332('0x10')]=null;}_0x35850e(null,_0x29942f);},'afterUpdate':function(_0x271d80,_0x161a9e,_0x3b1be6){var _0x33760a=_0x17c500[_0x3332('0x11')];var _0xa7c02=_0x271d80[_0x3332('0x12')]({'plain':!![]});if(_0xa7c02[_0x3332('0xc')]){return _0x33760a[_0x3332('0x13')][_0x3332('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0xa7c02['id']}})['then'](function(){_0x3b1be6();})[_0x3332('0x15')](function(_0x2279bf){_0x3b1be6(_0x2279bf);});}else{_0x3b1be6();}}},'charset':_0x3332('0x16'),'collate':_0x3332('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index d860773..8545e18 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 _0xeadc=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','then','addTags','ids','omit','spread','AddTags'];(function(_0x47d804,_0x5cc88f){var _0x284c47=function(_0x271c22){while(--_0x271c22){_0x47d804['push'](_0x47d804['shift']());}};_0x284c47(++_0x5cc88f);}(_0xeadc,0x1d4));var _0xcead=function(_0x5aa8d1,_0x553e46){_0x5aa8d1=_0x5aa8d1-0x0;var _0x3cd67e=_0xeadc[_0x5aa8d1];return _0x3cd67e;};'use strict';var _=require(_0xcead('0x0'));var util=require(_0xcead('0x1'));var moment=require(_0xcead('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcead('0x3'));var db=require(_0xcead('0x4'))['db'];var utils=require(_0xcead('0x5'));var logger=require(_0xcead('0x6'))(_0xcead('0x7'));var config=require(_0xcead('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcead('0x9')]['http']({'port':0x232a});config[_0xcead('0xa')]=_[_0xcead('0xb')](config[_0xcead('0xa')],{'host':_0xcead('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcead('0xa')]));require(_0xcead('0xd'))[_0xcead('0xe')](socket);function respondWithRpcPromise(_0x17c932,_0x481cbc,_0x406eda){return new BPromise(function(_0x4c6ae5,_0x3c5e7e){return client[_0xcead('0xf')](_0x17c932,_0x406eda)['then'](function(_0x4221f2){logger[_0xcead('0x10')](_0xcead('0x11'),_0x481cbc,_0xcead('0x12'));logger[_0xcead('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x481cbc,_0xcead('0x12'),JSON[_0xcead('0x14')](_0x4221f2));if(_0x4221f2['error']){if(_0x4221f2['error']['code']===0x1f4){logger[_0xcead('0x15')](_0xcead('0x11'),_0x481cbc,_0x4221f2[_0xcead('0x15')][_0xcead('0x16')]);return _0x3c5e7e(_0x4221f2[_0xcead('0x15')]['message']);}logger[_0xcead('0x15')](_0xcead('0x11'),_0x481cbc,_0x4221f2[_0xcead('0x15')][_0xcead('0x16')]);return _0x4c6ae5(_0x4221f2[_0xcead('0x15')][_0xcead('0x16')]);}else{logger['info'](_0xcead('0x11'),_0x481cbc,'request\x20sent');_0x4c6ae5(_0x4221f2[_0xcead('0x17')][_0xcead('0x16')]);}})[_0xcead('0x18')](function(_0x1277b1){logger[_0xcead('0x15')](_0xcead('0x11'),_0x481cbc,_0x1277b1);_0x3c5e7e(_0x1277b1);});});}exports[_0xcead('0x19')]=function(_0x4cf963){var _0x234664=this;return new Promise(function(_0x13c1ca,_0x597fe9){return db[_0xcead('0x1a')][_0xcead('0x1b')](_0x4cf963[_0xcead('0x1c')],{'raw':_0x4cf963[_0xcead('0x1d')]?_0x4cf963[_0xcead('0x1d')][_0xcead('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cf963[_0xcead('0x1d')]?_0x4cf963[_0xcead('0x1d')][_0xcead('0x1f')]||null:null,'attributes':_0x4cf963[_0xcead('0x1d')]?_0x4cf963['options'][_0xcead('0x20')]||null:null,'limit':_0x4cf963[_0xcead('0x1d')]?_0x4cf963[_0xcead('0x1d')]['limit']||null:null})[_0xcead('0x21')](function(_0x466b56){logger['info']('UpdateMailInteraction',_0x4cf963);logger['debug'](_0xcead('0x19'),_0x4cf963,JSON['stringify'](_0x466b56));_0x13c1ca(_0x466b56);})['catch'](function(_0x396569){logger[_0xcead('0x15')]('UpdateMailInteraction',_0x396569[_0xcead('0x16')],_0x4cf963);_0x597fe9(_0x234664[_0xcead('0x15')](0x1f4,_0x396569[_0xcead('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x3e5bc7){return new Promise(function(_0x3de3b6,_0x49ab5b){return db[_0xcead('0x1a')]['find']({'where':_0x3e5bc7[_0xcead('0x1d')]?_0x3e5bc7[_0xcead('0x1d')][_0xcead('0x1f')]||null:null})['then'](function(_0x31c05b){if(_0x31c05b){return _0x31c05b[_0xcead('0x22')](_0x3e5bc7['body'][_0xcead('0x23')],_[_0xcead('0x24')](_0x3e5bc7[_0xcead('0x1c')],[_0xcead('0x23'),'id'])||{});}})[_0xcead('0x25')](function(_0x4562ee){logger['info'](_0xcead('0x26'),_0x3e5bc7);logger[_0xcead('0x13')](_0xcead('0x26'),_0x3e5bc7,JSON['stringify'](_0x4562ee));_0x3de3b6(_0x4562ee);})[_0xcead('0x18')](function(_0x27d045){logger[_0xcead('0x15')](_0xcead('0x26'),_0x27d045[_0xcead('0x16')],_0x3e5bc7);_0x49ab5b(_this[_0xcead('0x15')](0x1f4,_0x27d045[_0xcead('0x16')]));});});}; \ No newline at end of file +var _0xc61d=['raw','where','then','UpdateMailInteraction','stringify','catch','AddTagsToMailInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','MailInteraction','body','options'];(function(_0x5a6f43,_0x13e5b0){var _0x213def=function(_0x3fc044){while(--_0x3fc044){_0x5a6f43['push'](_0x5a6f43['shift']());}};_0x213def(++_0x13e5b0);}(_0xc61d,0xfb));var _0xdc61=function(_0x3d7a10,_0x21bc7b){_0x3d7a10=_0x3d7a10-0x0;var _0x5b0b11=_0xc61d[_0x3d7a10];return _0x5b0b11;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var moment=require(_0xdc61('0x2'));var BPromise=require(_0xdc61('0x3'));var rs=require(_0xdc61('0x4'));var fs=require('fs');var Redis=require(_0xdc61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc61('0x6'));var logger=require(_0xdc61('0x7'))('rpc');var config=require(_0xdc61('0x8'));var jayson=require(_0xdc61('0x9'));var client=jayson[_0xdc61('0xa')][_0xdc61('0xb')]({'port':0x232a});config[_0xdc61('0xc')]=_[_0xdc61('0xd')](config[_0xdc61('0xc')],{'host':_0xdc61('0xe'),'port':0x18eb});var socket=require(_0xdc61('0xf'))(new Redis(config[_0xdc61('0xc')]));require('./mailInteraction.socket')[_0xdc61('0x10')](socket);function respondWithRpcPromise(_0x1682d1,_0x175405,_0x333f0b){return new BPromise(function(_0xf27275,_0x55fe79){return client[_0xdc61('0x11')](_0x1682d1,_0x333f0b)['then'](function(_0x403725){logger['info'](_0xdc61('0x12'),_0x175405,_0xdc61('0x13'));logger[_0xdc61('0x14')](_0xdc61('0x15'),_0x175405,_0xdc61('0x13'),JSON['stringify'](_0x403725));if(_0x403725[_0xdc61('0x16')]){if(_0x403725[_0xdc61('0x16')]['code']===0x1f4){logger[_0xdc61('0x16')](_0xdc61('0x12'),_0x175405,_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);return _0x55fe79(_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);}logger[_0xdc61('0x16')](_0xdc61('0x12'),_0x175405,_0x403725[_0xdc61('0x16')]['message']);return _0xf27275(_0x403725[_0xdc61('0x16')][_0xdc61('0x17')]);}else{logger[_0xdc61('0x18')](_0xdc61('0x12'),_0x175405,_0xdc61('0x13'));_0xf27275(_0x403725[_0xdc61('0x19')][_0xdc61('0x17')]);}})['catch'](function(_0x49354d){logger['error'](_0xdc61('0x12'),_0x175405,_0x49354d);_0x55fe79(_0x49354d);});});}exports['UpdateMailInteraction']=function(_0x319d93){var _0x387f9a=this;return new Promise(function(_0xf9aa4e,_0x117d13){return db[_0xdc61('0x1a')]['update'](_0x319d93[_0xdc61('0x1b')],{'raw':_0x319d93[_0xdc61('0x1c')]?_0x319d93[_0xdc61('0x1c')][_0xdc61('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x319d93[_0xdc61('0x1c')]?_0x319d93['options'][_0xdc61('0x1e')]||null:null,'attributes':_0x319d93['options']?_0x319d93['options']['attributes']||null:null,'limit':_0x319d93[_0xdc61('0x1c')]?_0x319d93[_0xdc61('0x1c')]['limit']||null:null})[_0xdc61('0x1f')](function(_0x2c4b9a){logger[_0xdc61('0x18')](_0xdc61('0x20'),_0x319d93);logger[_0xdc61('0x14')](_0xdc61('0x20'),_0x319d93,JSON[_0xdc61('0x21')](_0x2c4b9a));_0xf9aa4e(_0x2c4b9a);})[_0xdc61('0x22')](function(_0x5f5666){logger[_0xdc61('0x16')](_0xdc61('0x20'),_0x5f5666[_0xdc61('0x17')],_0x319d93);_0x117d13(_0x387f9a[_0xdc61('0x16')](0x1f4,_0x5f5666[_0xdc61('0x17')]));});});};exports[_0xdc61('0x23')]=function(_0x217bbd){return new Promise(function(_0x5bb7e5,_0xfc12ac){return db[_0xdc61('0x1a')][_0xdc61('0x24')]({'where':_0x217bbd[_0xdc61('0x1c')]?_0x217bbd['options'][_0xdc61('0x1e')]||null:null})[_0xdc61('0x1f')](function(_0x3a2208){if(_0x3a2208){return _0x3a2208['addTags'](_0x217bbd[_0xdc61('0x1b')][_0xdc61('0x25')],_['omit'](_0x217bbd[_0xdc61('0x1b')],[_0xdc61('0x25'),'id'])||{});}})[_0xdc61('0x26')](function(_0x232d1f){logger[_0xdc61('0x18')](_0xdc61('0x27'),_0x217bbd);logger[_0xdc61('0x14')]('AddTags',_0x217bbd,JSON[_0xdc61('0x21')](_0x232d1f));_0x5bb7e5(_0x232d1f);})['catch'](function(_0x3128b3){logger[_0xdc61('0x16')](_0xdc61('0x27'),_0x3128b3[_0xdc61('0x17')],_0x217bbd);_0xfc12ac(_this[_0xdc61('0x16')](0x1f4,_0x3128b3[_0xdc61('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 1ac23bc..3fdbbd1 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 _0x8655=['emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x8655,0x89));var _0x5865=function(_0x21a2a4,_0x5054f8){_0x21a2a4=_0x21a2a4-0x0;var _0x504e1b=_0x8655[_0x21a2a4];return _0x504e1b;};'use strict';var MailInteractionEvents=require(_0x5865('0x0'));var events=['save','remove','update'];function createListener(_0x5a0d17,_0x225f7d){return function(_0x20ab1a){_0x225f7d[_0x5865('0x1')](_0x5a0d17,_0x20ab1a);};}function removeListener(_0x5408c3,_0x1bd637){return function(){MailInteractionEvents[_0x5865('0x2')](_0x5408c3,_0x1bd637);};}exports[_0x5865('0x3')]=function(_0x56f18a){for(var _0x3045e3=0x0,_0xe9aa57=events[_0x5865('0x4')];_0x3045e3<_0xe9aa57;_0x3045e3++){var _0x174dfa=events[_0x3045e3];var _0x43deec=createListener(_0x5865('0x5')+_0x174dfa,_0x56f18a);MailInteractionEvents['on'](_0x174dfa,_0x43deec);}}; \ No newline at end of file +var _0x76f3=['remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x595687,_0x4f9fdb){var _0x54e645=function(_0x5cc4fe){while(--_0x5cc4fe){_0x595687['push'](_0x595687['shift']());}};_0x54e645(++_0x4f9fdb);}(_0x76f3,0xdf));var _0x376f=function(_0xd2310c,_0xbb64aa){_0xd2310c=_0xd2310c-0x0;var _0x4794d2=_0x76f3[_0xd2310c];return _0x4794d2;};'use strict';var MailInteractionEvents=require(_0x376f('0x0'));var events=[_0x376f('0x1'),_0x376f('0x2'),_0x376f('0x3')];function createListener(_0x3d5eeb,_0x2754f3){return function(_0x1a6f53){_0x2754f3[_0x376f('0x4')](_0x3d5eeb,_0x1a6f53);};}function removeListener(_0x4309ba,_0x454c56){return function(){MailInteractionEvents[_0x376f('0x5')](_0x4309ba,_0x454c56);};}exports[_0x376f('0x6')]=function(_0xe3d4a3){for(var _0x1771f5=0x0,_0x4ca496=events[_0x376f('0x7')];_0x1771f5<_0x4ca496;_0x1771f5++){var _0x4a170e=events[_0x1771f5];var _0x29458a=createListener(_0x376f('0x8')+_0x4a170e,_0xe3d4a3);MailInteractionEvents['on'](_0x4a170e,_0x29458a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 4959e62..1478032 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 _0xeebe=['show','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2f66ee,_0x29e62c){var _0x2bbe5c=function(_0x414dba){while(--_0x414dba){_0x2f66ee['push'](_0x2f66ee['shift']());}};_0x2bbe5c(++_0x29e62c);}(_0xeebe,0xff));var _0xeeeb=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeebe[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xeeeb('0x0'));var util=require('util');var path=require(_0xeeeb('0x1'));var timeout=require('connect-timeout');var express=require(_0xeeeb('0x2'));var router=express[_0xeeeb('0x3')]();var fs_extra=require(_0xeeeb('0x4'));var auth=require(_0xeeeb('0x5'));var interaction=require(_0xeeeb('0x6'));var config=require(_0xeeeb('0x7'));var controller=require(_0xeeeb('0x8'));router[_0xeeeb('0x9')]('/',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xb')]);router[_0xeeeb('0x9')](_0xeeeb('0xc'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xd')]);router[_0xeeeb('0x9')](_0xeeeb('0xe'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xf')]);router['get']('/:id/download',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x10')]);router[_0xeeeb('0x11')]('/',auth['isAuthenticated'](),interaction[_0xeeeb('0x12')](_0xeeeb('0x13'),_0xeeeb('0x14')),controller['create']);router[_0xeeeb('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xeeeb('0x16')]);router[_0xeeeb('0x15')](_0xeeeb('0x17'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x18')]);router[_0xeeeb('0x15')](_0xeeeb('0x19'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x1a')]);router[_0xeeeb('0x1b')](_0xeeeb('0xe'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x1c')]);module[_0xeeeb('0x1d')]=router; \ No newline at end of file +var _0x24cf=['/:id','isAuthenticated','/:id/download','download','post','mail','mailmessage:create','create','/:id/accept','accept','put','reject','delete','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','describe'];(function(_0x1ca3f8,_0x2a36da){var _0x11f6c5=function(_0x3c8797){while(--_0x3c8797){_0x1ca3f8['push'](_0x1ca3f8['shift']());}};_0x11f6c5(++_0x2a36da);}(_0x24cf,0x1d5));var _0xf24c=function(_0x364e3c,_0x4783ae){_0x364e3c=_0x364e3c-0x0;var _0x4db121=_0x24cf[_0x364e3c];return _0x4db121;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf24c('0x0'));var timeout=require(_0xf24c('0x1'));var express=require(_0xf24c('0x2'));var router=express[_0xf24c('0x3')]();var fs_extra=require(_0xf24c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var controller=require(_0xf24c('0x7'));router[_0xf24c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf24c('0x9'),auth['isAuthenticated'](),controller[_0xf24c('0xa')]);router[_0xf24c('0x8')](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['show']);router[_0xf24c('0x8')](_0xf24c('0xd'),auth[_0xf24c('0xc')](),controller[_0xf24c('0xe')]);router[_0xf24c('0xf')]('/',auth[_0xf24c('0xc')](),interaction['tracked'](_0xf24c('0x10'),_0xf24c('0x11')),controller[_0xf24c('0x12')]);router['put'](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['update']);router['put'](_0xf24c('0x13'),auth['isAuthenticated'](),controller[_0xf24c('0x14')]);router[_0xf24c('0x15')]('/:id/reject',auth[_0xf24c('0xc')](),controller[_0xf24c('0x16')]);router[_0xf24c('0x17')](_0xf24c('0xb'),auth[_0xf24c('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 90ce3e2..25f3c48 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 _0x2da3=['BOOLEAN','STRING','DATE','INTEGER','ENUM','Email','Chat','sequelize','exports','TEXT','long','medium'];(function(_0x412a86,_0x21f8c6){var _0x403e5f=function(_0x83967a){while(--_0x83967a){_0x412a86['push'](_0x412a86['shift']());}};_0x403e5f(++_0x21f8c6);}(_0x2da3,0x1b7));var _0x32da=function(_0x173fd6,_0x33b2b5){_0x173fd6=_0x173fd6-0x0;var _0x43f6e1=_0x2da3[_0x173fd6];return _0x43f6e1;};'use strict';var Sequelize=require(_0x32da('0x0'));var _=require('lodash');module[_0x32da('0x1')]={'body':{'type':Sequelize[_0x32da('0x2')](_0x32da('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x32da('0x4'))},'read':{'type':Sequelize[_0x32da('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x32da('0x6')](0x1fe)},'from':{'type':Sequelize[_0x32da('0x6')]},'to':{'type':Sequelize['TEXT'](_0x32da('0x3'))},'cc':{'type':Sequelize[_0x32da('0x2')]('long')},'bcc':{'type':Sequelize[_0x32da('0x2')]('long')},'subject':{'type':Sequelize[_0x32da('0x2')]},'sentAt':{'type':Sequelize[_0x32da('0x7')]},'attach':{'type':Sequelize[_0x32da('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x32da('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x32da('0x7')]},'originTo':{'type':Sequelize[_0x32da('0x2')](_0x32da('0x3'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x32da('0x9')](_0x32da('0xa'),_0x32da('0xb')),'defaultValue':_0x32da('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xa287=['STRING','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa287,0x1b1));var _0x7a28=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0xa287[_0x16629d];return _0x56ccee;};'use strict';var Sequelize=require(_0x7a28('0x0'));var _=require(_0x7a28('0x1'));module[_0x7a28('0x2')]={'body':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x5'))},'read':{'type':Sequelize[_0x7a28('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7a28('0x7')]('in',_0x7a28('0x8')),'defaultValue':_0x7a28('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7a28('0x9')](0x1fe)},'from':{'type':Sequelize[_0x7a28('0x9')]},'to':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'cc':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'bcc':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'subject':{'type':Sequelize[_0x7a28('0x3')]},'sentAt':{'type':Sequelize[_0x7a28('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7a28('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'originCc':{'type':Sequelize[_0x7a28('0x3')](_0x7a28('0x4'))},'originChannel':{'type':Sequelize[_0x7a28('0x7')](_0x7a28('0xb'),_0x7a28('0xc')),'defaultValue':_0x7a28('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 52eda74..4d1f067 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 _0xfcd8=['message-%s.eml','from','subject','createdAt','Attachments','decode','headers','Bcc','bcc','push','build','writeFileSync','download','bluebird','util','path','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','json','offset','undefined','count','status','Content-Range','update','then','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','body','find','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','UserId','user','agent','get','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','fromString','EventManager','reject','MailInteraction','MailInteractionId','interaction','RejectMessage','rejectMessage','ContactId','interface','unix','toString','join','server','files','tmp'];(function(_0x419b6a,_0x265b43){var _0x229232=function(_0x514a3e){while(--_0x514a3e){_0x419b6a['push'](_0x419b6a['shift']());}};_0x229232(++_0x265b43);}(_0xfcd8,0xab));var _0x8fcd=function(_0x24e513,_0x432b2b){_0x24e513=_0x24e513-0x0;var _0x480f42=_0xfcd8[_0x24e513];return _0x480f42;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x8fcd('0x0'));var util=require(_0x8fcd('0x1'));var path=require(_0x8fcd('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0x8fcd('0x3'));var qs=require(_0x8fcd('0x4'));var logger=require(_0x8fcd('0x5'))(_0x8fcd('0x6'));var interaction_log=require('../../config/logger')(_0x8fcd('0x7'));var config=require(_0x8fcd('0x8'));var db=require(_0x8fcd('0x9'))['db'];config[_0x8fcd('0xa')]=_[_0x8fcd('0xb')](config[_0x8fcd('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fcd('0xa')]));var htmlEntities=require(_0x8fcd('0xc'));require(_0x8fcd('0xd'))[_0x8fcd('0xe')](socket);var jayson=require(_0x8fcd('0xf'));var client=jayson[_0x8fcd('0x10')]['http']({'port':0x232c});var client9003=jayson[_0x8fcd('0x10')][_0x8fcd('0x11')]({'port':0x232b});var client9002=jayson[_0x8fcd('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a199a,_0x36e28b,_0x359093,_0x4fa8f9){return new BPromise(function(_0x12d2a3,_0x313b41){var _0x424dd6=_0x4fa8f9||client;return _0x424dd6[_0x8fcd('0x12')](_0x4a199a,_0x359093)['then'](function(_0x3ef99c){logger[_0x8fcd('0x13')](_0x8fcd('0x14'),_0x36e28b,'request\x20sent');logger['debug'](_0x8fcd('0x15'),_0x36e28b,_0x8fcd('0x16'),JSON[_0x8fcd('0x17')](_0x3ef99c));if(_0x3ef99c[_0x8fcd('0x18')]){if(_0x3ef99c['error'][_0x8fcd('0x19')]===0x1f4){logger['error'](_0x8fcd('0x14'),_0x36e28b,_0x3ef99c['error'][_0x8fcd('0x1a')]);return _0x313b41(_0x3ef99c[_0x8fcd('0x18')][_0x8fcd('0x1a')]);}logger['error'](_0x8fcd('0x14'),_0x36e28b,_0x3ef99c[_0x8fcd('0x18')][_0x8fcd('0x1a')]);return _0x12d2a3(_0x3ef99c[_0x8fcd('0x18')]['message']);}else{logger[_0x8fcd('0x13')](_0x8fcd('0x14'),_0x36e28b,'request\x20sent');_0x12d2a3(_0x3ef99c[_0x8fcd('0x1b')]['message']);}})[_0x8fcd('0x1c')](function(_0x54d702){logger[_0x8fcd('0x18')]('MailMessage,\x20%s,\x20%s',_0x36e28b,_0x54d702);_0x313b41(_0x54d702);});});}function respondWithResult(_0x15cebf,_0x4086ef){_0x4086ef=_0x4086ef||0xc8;return function(_0x214700){if(_0x214700){return _0x15cebf['status'](_0x4086ef)[_0x8fcd('0x1d')](_0x214700);}};}function respondWithFilteredResult(_0x1a887c,_0x40c24f){return function(_0x22203b){if(_0x22203b){var _0x47ce97=typeof _0x40c24f[_0x8fcd('0x1e')]===_0x8fcd('0x1f')&&typeof _0x40c24f['limit']===_0x8fcd('0x1f');var _0x1751f2=_0x22203b[_0x8fcd('0x20')];var _0xaa0982=_0x47ce97?0x0:_0x40c24f[_0x8fcd('0x1e')];var _0x4d0363=_0x47ce97?_0x22203b['count']:_0x40c24f[_0x8fcd('0x1e')]+_0x40c24f['limit'];var _0x522fb8;if(_0x4d0363>=_0x1751f2){_0x4d0363=_0x1751f2;_0x522fb8=0xc8;}else{_0x522fb8=0xce;}_0x1a887c[_0x8fcd('0x21')](_0x522fb8);return _0x1a887c['set'](_0x8fcd('0x22'),_0xaa0982+'-'+_0x4d0363+'/'+_0x1751f2)[_0x8fcd('0x1d')](_0x22203b);}return null;};}function saveUpdates(_0xdcd4f0){return function(_0xbe4f20){if(_0xbe4f20){return _0xbe4f20[_0x8fcd('0x23')](_0xdcd4f0)[_0x8fcd('0x24')](function(_0x592038){return _0x592038;});}return null;};}function removeEntity(_0x52951c){return function(_0xb92d0f){if(_0xb92d0f){return _0xb92d0f[_0x8fcd('0x25')]()[_0x8fcd('0x24')](function(){_0x52951c['status'](0xcc)[_0x8fcd('0x26')]();});}};}function handleEntityNotFound(_0xba713c){return function(_0x2cdd94){if(!_0x2cdd94){_0xba713c['sendStatus'](0x194);}return _0x2cdd94;};}function handleError(_0x3f6c44,_0x572af9){_0x572af9=_0x572af9||0x1f4;return function(_0x2a062f){logger['error'](_0x2a062f[_0x8fcd('0x27')]);if(_0x2a062f[_0x8fcd('0x28')]){delete _0x2a062f[_0x8fcd('0x28')];}_0x3f6c44[_0x8fcd('0x21')](_0x572af9)[_0x8fcd('0x29')](_0x2a062f);};}exports[_0x8fcd('0x2a')]=function(_0x25fabb,_0x572b3d){var _0xce2871={},_0x12f3e7={},_0x50a194={'count':0x0,'rows':[]};var _0x123887=_[_0x8fcd('0x2b')](db[_0x8fcd('0x2c')][_0x8fcd('0x2d')],function(_0x86813c){return{'name':_0x86813c['fieldName'],'type':_0x86813c[_0x8fcd('0x2e')][_0x8fcd('0x2f')]};});_0x12f3e7[_0x8fcd('0x30')]=_[_0x8fcd('0x2b')](_0x123887,_0x8fcd('0x28'));_0x12f3e7[_0x8fcd('0x31')]=_[_0x8fcd('0x32')](_0x25fabb[_0x8fcd('0x31')]);_0x12f3e7[_0x8fcd('0x33')]=_[_0x8fcd('0x34')](_0x12f3e7[_0x8fcd('0x30')],_0x12f3e7[_0x8fcd('0x31')]);_0xce2871[_0x8fcd('0x35')]=_['intersection'](_0x12f3e7[_0x8fcd('0x30')],qs[_0x8fcd('0x36')](_0x25fabb[_0x8fcd('0x31')][_0x8fcd('0x36')]));_0xce2871[_0x8fcd('0x35')]=_0xce2871['attributes']['length']?_0xce2871['attributes']:_0x12f3e7['model'];if(!_0x25fabb['query'][_0x8fcd('0x37')](_0x8fcd('0x38'))){_0xce2871[_0x8fcd('0x39')]=qs[_0x8fcd('0x39')](_0x25fabb[_0x8fcd('0x31')]['limit']);_0xce2871[_0x8fcd('0x1e')]=qs['offset'](_0x25fabb[_0x8fcd('0x31')][_0x8fcd('0x1e')]);}_0xce2871[_0x8fcd('0x3a')]=qs[_0x8fcd('0x3b')](_0x25fabb[_0x8fcd('0x31')][_0x8fcd('0x3b')]);_0xce2871[_0x8fcd('0x3c')]=qs[_0x8fcd('0x33')](_['pick'](_0x25fabb['query'],_0x12f3e7[_0x8fcd('0x33')]),_0x123887);if(_0x25fabb[_0x8fcd('0x31')][_0x8fcd('0x3d')]){_0xce2871[_0x8fcd('0x3c')]=_[_0x8fcd('0x3e')](_0xce2871[_0x8fcd('0x3c')],{'$or':_[_0x8fcd('0x2b')](_0x123887,function(_0x11b1fd){if(_0x11b1fd[_0x8fcd('0x2e')]!==_0x8fcd('0x3f')){var _0x19fb3f={};_0x19fb3f[_0x11b1fd[_0x8fcd('0x28')]]={'$like':'%'+_0x25fabb[_0x8fcd('0x31')]['filter']+'%'};return _0x19fb3f;}})});}_0xce2871=_[_0x8fcd('0x3e')]({},_0xce2871,_0x25fabb[_0x8fcd('0x40')]);var _0x3a0208={'where':_0xce2871[_0x8fcd('0x3c')]};return db['MailMessage'][_0x8fcd('0x20')](_0x3a0208)['then'](function(_0x1dc935){_0x50a194[_0x8fcd('0x20')]=_0x1dc935;if(_0x25fabb[_0x8fcd('0x31')][_0x8fcd('0x41')]){_0xce2871[_0x8fcd('0x42')]=[{'all':!![]}];}return db[_0x8fcd('0x2c')][_0x8fcd('0x43')](_0xce2871);})['then'](function(_0x2b3885){_0x50a194[_0x8fcd('0x44')]=_0x2b3885;return _0x50a194;})[_0x8fcd('0x24')](respondWithFilteredResult(_0x572b3d,_0xce2871))[_0x8fcd('0x1c')](handleError(_0x572b3d,null));};exports[_0x8fcd('0x45')]=function(_0x2fb397,_0x44df79){var _0x594aa0={'raw':!![],'where':{'id':_0x2fb397[_0x8fcd('0x46')]['id']}},_0x3244ab={};_0x3244ab[_0x8fcd('0x30')]=_[_0x8fcd('0x32')](db['MailMessage']['rawAttributes']);_0x3244ab[_0x8fcd('0x31')]=_[_0x8fcd('0x32')](_0x2fb397[_0x8fcd('0x31')]);_0x3244ab[_0x8fcd('0x33')]=_[_0x8fcd('0x34')](_0x3244ab[_0x8fcd('0x30')],_0x3244ab['query']);_0x594aa0[_0x8fcd('0x35')]=_['intersection'](_0x3244ab[_0x8fcd('0x30')],qs['fields'](_0x2fb397[_0x8fcd('0x31')][_0x8fcd('0x36')]));_0x594aa0[_0x8fcd('0x35')]=_0x594aa0[_0x8fcd('0x35')][_0x8fcd('0x47')]?_0x594aa0[_0x8fcd('0x35')]:_0x3244ab[_0x8fcd('0x30')];if(_0x2fb397[_0x8fcd('0x31')]['includeAll']){_0x594aa0[_0x8fcd('0x42')]=[{'all':!![]}];}_0x594aa0=_[_0x8fcd('0x3e')]({},_0x594aa0,_0x2fb397[_0x8fcd('0x40')]);return db['MailMessage']['find'](_0x594aa0)['then'](handleEntityNotFound(_0x44df79,null))['then'](respondWithResult(_0x44df79,null))[_0x8fcd('0x1c')](handleError(_0x44df79,null));};exports[_0x8fcd('0x23')]=function(_0x2eb3bc,_0x53f218){if(_0x2eb3bc[_0x8fcd('0x48')]['id']){delete _0x2eb3bc[_0x8fcd('0x48')]['id'];}return db['MailMessage'][_0x8fcd('0x49')]({'where':{'id':_0x2eb3bc[_0x8fcd('0x46')]['id']}})[_0x8fcd('0x24')](handleEntityNotFound(_0x53f218,null))['then'](saveUpdates(_0x2eb3bc['body'],null))['then'](respondWithResult(_0x53f218,null))['catch'](handleError(_0x53f218,null));};exports['destroy']=function(_0x4cb389,_0x652828){return db[_0x8fcd('0x2c')][_0x8fcd('0x49')]({'where':{'id':_0x4cb389[_0x8fcd('0x46')]['id']}})[_0x8fcd('0x24')](handleEntityNotFound(_0x652828,null))[_0x8fcd('0x24')](removeEntity(_0x652828,null))[_0x8fcd('0x1c')](handleError(_0x652828,null));};exports[_0x8fcd('0x4a')]=function(_0x115f2b,_0x38361e){return db['MailMessage'][_0x8fcd('0x4a')]()['then'](respondWithResult(_0x38361e,null))[_0x8fcd('0x1c')](handleError(_0x38361e,null));};exports[_0x8fcd('0x4b')]=function(_0x194de3,_0x35a3db){return db['MailMessage'][_0x8fcd('0x4b')](_0x194de3[_0x8fcd('0x48')])[_0x8fcd('0x24')](function(_0x15fc2c){if(_0x15fc2c){if(_0x15fc2c[_0x8fcd('0x4c')]===_0x8fcd('0x4d')&&!_0x15fc2c[_0x8fcd('0x4e')]){var _0x513c23,_0x48bae0,_0x4ae674;if(_0x194de3[_0x8fcd('0x48')]['to']){_0x48bae0=_0x194de3[_0x8fcd('0x48')]['to'][_0x8fcd('0x4f')](',')[0x0];}return db[_0x8fcd('0x50')][_0x8fcd('0x51')]({'where':{'id':_0x15fc2c[_0x8fcd('0x52')]},'include':[{'model':db[_0x8fcd('0x53')],'as':_0x8fcd('0x54'),'include':[{'model':db[_0x8fcd('0x55')],'as':'Contacts','where':{'email':_0x48bae0},'limit':0x1,'order':[[_0x8fcd('0x56'),_0x8fcd('0x57')]]}]},{'model':db[_0x8fcd('0x58')],'as':_0x8fcd('0x59'),'raw':!![],'include':[{'model':db[_0x8fcd('0x5a')],'as':'CloudProvider','raw':!![]}]}]})[_0x8fcd('0x24')](function(_0x37af63){_0x513c23=_0x37af63;if(!_0x513c23||!_0x513c23[_0x8fcd('0x59')])return;var _0x2bdcae=_0x513c23[_0x8fcd('0x5b')]();if(_0x194de3[_0x8fcd('0x48')]['attachments']&&_0x194de3[_0x8fcd('0x48')][_0x8fcd('0x5c')]['length']){for(var _0x56ffa3=0x0;_0x56ffa3<_0x194de3[_0x8fcd('0x48')][_0x8fcd('0x5c')][_0x8fcd('0x47')];_0x56ffa3+=0x1){_0x194de3[_0x8fcd('0x48')]['attachments'][_0x56ffa3]={'filename':_0x194de3[_0x8fcd('0x48')]['attachments'][_0x56ffa3][_0x8fcd('0x28')],'path':path['join'](config[_0x8fcd('0x5d')],_0x8fcd('0x5e'),_0x194de3[_0x8fcd('0x48')][_0x8fcd('0x5c')][_0x56ffa3][_0x8fcd('0x5f')])};}}_0x4ae674={'account':_0x2bdcae,'message':_0x194de3[_0x8fcd('0x48')]};return;})['then'](function(){if(_0x513c23[_0x8fcd('0x54')]){if(_0x513c23[_0x8fcd('0x54')][_0x8fcd('0x60')]['length']){return _0x513c23[_0x8fcd('0x54')][_0x8fcd('0x60')][0x0];}else{return db['CmContact']['create'](_[_0x8fcd('0xb')](_0x194de3[_0x8fcd('0x48')],{'firstName':_0x194de3[_0x8fcd('0x48')]['to'],'email':_0x194de3[_0x8fcd('0x48')]['to'],'phone':_0x194de3[_0x8fcd('0x48')]['to'],'ListId':_0x513c23[_0x8fcd('0x61')]}));}}else{throw new Error(_0x8fcd('0x62'));}})[_0x8fcd('0x24')](function(){if(_0x4ae674){return respondWithRpcPromise(_0x8fcd('0x63'),_0x8fcd('0x64'),_0x4ae674,client9003)['then'](function(_0xfab364){return _0x15fc2c[_0x8fcd('0x23')]({'read':!![],'messageId':_0xfab364[_0x8fcd('0x65')],'sentAt':moment()[_0x8fcd('0x66')](_0x8fcd('0x67'))});})[_0x8fcd('0x1c')](function(_0x276860){logger['error']('%s',JSON['stringify'](_0x276860));return _0x15fc2c;});}return _0x15fc2c;});}return _0x15fc2c;}})[_0x8fcd('0x24')](respondWithResult(_0x35a3db,0xc9))[_0x8fcd('0x1c')](handleError(_0x35a3db,null));};exports[_0x8fcd('0x68')]=function(_0x29dbbf,_0x498a4d){var _0x3003e6={'agent':{},'channel':_0x8fcd('0x69')};if(_0x29dbbf[_0x8fcd('0x48')]['id']){delete _0x29dbbf[_0x8fcd('0x48')]['id'];}_0x29dbbf[_0x8fcd('0x48')]['read']=!![];_0x29dbbf[_0x8fcd('0x48')]['readAt']=moment()[_0x8fcd('0x66')](_0x8fcd('0x67'));_0x29dbbf[_0x8fcd('0x48')][_0x8fcd('0x6a')]=_0x29dbbf[_0x8fcd('0x48')][_0x8fcd('0x6a')]||_0x29dbbf[_0x8fcd('0x6b')]['id'];_0x3003e6[_0x8fcd('0x6c')]['id']=_0x29dbbf[_0x8fcd('0x48')]['UserId'];return db[_0x8fcd('0x2c')][_0x8fcd('0x49')]({'where':{'id':_0x29dbbf[_0x8fcd('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x498a4d,null))[_0x8fcd('0x24')](saveUpdates(_0x29dbbf['body'],null))[_0x8fcd('0x24')](function(_0x480794){if(_0x480794){_0x3003e6[_0x8fcd('0x1a')]=_0x480794[_0x8fcd('0x6d')]({'plain':!![]});return db['MailInteraction'][_0x8fcd('0x49')]({'where':{'id':_0x480794['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x498a4d,null))[_0x8fcd('0x24')](function(_0x40f089){if(_0x40f089){return _0x40f089[_0x8fcd('0x23')]({'UserId':_0x29dbbf[_0x8fcd('0x48')]['UserId'],'read1stAt':_[_0x8fcd('0x6e')](_0x40f089[_0x8fcd('0x6f')])?moment()[_0x8fcd('0x66')](_0x8fcd('0x67')):undefined});}return null;})['then'](function(_0x25c1e1){if(_0x25c1e1){_0x3003e6['interaction']=_0x25c1e1[_0x8fcd('0x6d')]({'plain':!![]});interaction_log[_0x8fcd('0x13')](_0x8fcd('0x70'),_0x29dbbf[_0x8fcd('0x6b')]['id'],_0x29dbbf[_0x8fcd('0x6b')][_0x8fcd('0x28')],_0x29dbbf['user'][_0x8fcd('0x71')],_0x3003e6['interaction']['id'],_0x29dbbf[_0x8fcd('0x48')]?JSON[_0x8fcd('0x17')](_0x29dbbf[_0x8fcd('0x48')]):_0x8fcd('0x72'));return respondWithRpcPromise(_0x8fcd('0x73'),_0x8fcd('0x74'),_0x3003e6);}return null;})['then'](function(_0x524275){var _0x38b1b5=_0x8fcd('0x75')+_0x524275[_0x8fcd('0x1a')]['ContactId'];return db[_0x8fcd('0x76')][_0x8fcd('0x31')](_0x38b1b5,{'type':db['Sequelize'][_0x8fcd('0x77')]['SELECT'],'raw':!![]})[_0x8fcd('0x24')](function(_0x864206){return _0x864206;});})[_0x8fcd('0x24')](function(_0x81d17a){if(_0x81d17a){_0x3003e6[_0x8fcd('0x1a')][_0x8fcd('0x78')]=_0x81d17a[0x0];if(!_0x29dbbf[_0x8fcd('0x48')]['UserId'])return;return db[_0x8fcd('0x79')][_0x8fcd('0x49')]({'where':{'id':_0x29dbbf[_0x8fcd('0x48')]['UserId'],'role':'agent'},'attributes':['id',_0x8fcd('0x28'),_0x8fcd('0x7a'),_0x8fcd('0x7b'),_0x8fcd('0x7c')],'raw':!![]});}return null;})[_0x8fcd('0x24')](function(_0xf5a75c){if(!_0xf5a75c)return null;_0x3003e6['message'][_0x8fcd('0x6c')]=_0xf5a75c;return _0x3003e6;})[_0x8fcd('0x24')](function(_0x2b4f76){if(_0x2b4f76){if(_0x29dbbf[_0x8fcd('0x48')][_0x8fcd('0x7d')]){_0x3003e6[_0x8fcd('0x1a')]['interface']=util[_0x8fcd('0x66')](_0x8fcd('0x7e'),_0x29dbbf[_0x8fcd('0x6b')][_0x8fcd('0x28')]);_0x3003e6[_0x8fcd('0x1a')][_0x8fcd('0x7f')]=_0x3003e6[_0x8fcd('0x7f')];_0x3003e6[_0x8fcd('0x1a')][_0x8fcd('0x80')]=_0x3003e6['channel'];_0x3003e6[_0x8fcd('0x1a')]['event']=_0x8fcd('0x68');_0x3003e6[_0x8fcd('0x1a')][_0x8fcd('0x48')]=htmlToText[_0x8fcd('0x81')](_0x3003e6['message'][_0x8fcd('0x48')]);return respondWithRpcPromise('EventManager',_0x8fcd('0x82'),{'event':'acceptmessage','message':_0x3003e6[_0x8fcd('0x1a')]},client9002)[_0x8fcd('0x24')](function(){return _0x3003e6;});}return _0x3003e6;}return null;})[_0x8fcd('0x24')](respondWithResult(_0x498a4d,null))['catch'](handleError(_0x498a4d,null));};exports[_0x8fcd('0x83')]=function(_0x17fd35,_0x24a898){var _0x2e917b={'agent':{},'channel':_0x8fcd('0x69')};if(_0x17fd35['body']['id']){delete _0x17fd35[_0x8fcd('0x48')]['id'];}_0x17fd35[_0x8fcd('0x48')][_0x8fcd('0x6a')]=_0x17fd35[_0x8fcd('0x48')]['UserId']||_0x17fd35['user']['id'];_0x2e917b[_0x8fcd('0x6c')]['id']=_0x17fd35[_0x8fcd('0x48')][_0x8fcd('0x6a')];return db[_0x8fcd('0x2c')][_0x8fcd('0x49')]({'where':{'id':_0x17fd35[_0x8fcd('0x46')]['id'],'UserId':null}})[_0x8fcd('0x24')](handleEntityNotFound(_0x24a898,null))['then'](function(_0x3be276){if(_0x3be276){_0x2e917b[_0x8fcd('0x1a')]=_0x3be276[_0x8fcd('0x6d')]({'plain':!![]});return db[_0x8fcd('0x84')][_0x8fcd('0x49')]({'where':{'id':_0x3be276[_0x8fcd('0x85')]}});}return null;})[_0x8fcd('0x24')](handleEntityNotFound(_0x24a898,null))['then'](function(_0x16e4b6){if(_0x16e4b6){_0x2e917b[_0x8fcd('0x86')]=_0x16e4b6[_0x8fcd('0x6d')]({'plain':!![]});interaction_log[_0x8fcd('0x13')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x17fd35[_0x8fcd('0x6b')]['id'],_0x17fd35[_0x8fcd('0x6b')]['name'],_0x17fd35[_0x8fcd('0x6b')][_0x8fcd('0x71')],_0x2e917b['interaction']['id'],_0x17fd35['body']?JSON[_0x8fcd('0x17')](_0x17fd35[_0x8fcd('0x48')]):_0x8fcd('0x72'));return respondWithRpcPromise(_0x8fcd('0x87'),_0x8fcd('0x88'),_0x2e917b);}return null;})[_0x8fcd('0x24')](function(_0x167dda){var _0x47b81c=_0x8fcd('0x75')+_0x167dda[_0x8fcd('0x1a')][_0x8fcd('0x89')];return db[_0x8fcd('0x76')][_0x8fcd('0x31')](_0x47b81c,{'type':db['Sequelize'][_0x8fcd('0x77')]['SELECT'],'raw':!![]})[_0x8fcd('0x24')](function(_0x5b711b){return _0x5b711b;});})[_0x8fcd('0x24')](function(_0x2b4041){if(_0x2b4041){_0x2e917b[_0x8fcd('0x1a')][_0x8fcd('0x78')]=_0x2b4041[0x0];if(!_0x17fd35['body'][_0x8fcd('0x6a')])return;return db['User']['find']({'where':{'id':_0x17fd35[_0x8fcd('0x48')]['UserId'],'role':'agent'},'attributes':['id',_0x8fcd('0x28'),_0x8fcd('0x7a'),_0x8fcd('0x7b'),_0x8fcd('0x7c')],'raw':!![]});}return null;})['then'](function(_0x148b99){if(!_0x148b99)return null;_0x2e917b['message']['agent']=_0x148b99;return _0x2e917b;})[_0x8fcd('0x24')](function(_0x3b40f7){if(_0x3b40f7){_0x3b40f7[_0x8fcd('0x1a')][_0x8fcd('0x8a')]=util['format'](_0x8fcd('0x7e'),_0x17fd35[_0x8fcd('0x6b')][_0x8fcd('0x28')]);_0x3b40f7[_0x8fcd('0x1a')][_0x8fcd('0x7f')]=_0x2e917b[_0x8fcd('0x7f')];_0x3b40f7[_0x8fcd('0x1a')][_0x8fcd('0x80')]=_0x2e917b['channel'];_0x3b40f7[_0x8fcd('0x1a')]['event']=_0x8fcd('0x83');_0x3b40f7['message']['body']=htmlToText[_0x8fcd('0x81')](_0x2e917b[_0x8fcd('0x1a')][_0x8fcd('0x48')]);respondWithRpcPromise(_0x8fcd('0x82'),_0x8fcd('0x82'),{'event':'rejectmessage','message':_0x3b40f7[_0x8fcd('0x1a')]},client9002);return _0x2e917b;}return null;})[_0x8fcd('0x24')](respondWithResult(_0x24a898,null))[_0x8fcd('0x1c')](handleError(_0x24a898,null));};exports['download']=function(_0x37ac6b,_0x316ce8){var _0xfd230e=moment()[_0x8fcd('0x8b')]()[_0x8fcd('0x8c')]();var _0x3f5411=path[_0x8fcd('0x8d')](config[_0x8fcd('0x5d')],_0x8fcd('0x8e'),_0x8fcd('0x8f'),_0x8fcd('0x90'));var _0x2217a8=path[_0x8fcd('0x8d')](config[_0x8fcd('0x5d')],_0x8fcd('0x8e'),'files',_0x8fcd('0x5c'));var _0x590b7c=util['format'](_0x8fcd('0x91'),_0xfd230e);return db[_0x8fcd('0x2c')][_0x8fcd('0x49')]({'where':{'id':_0x37ac6b[_0x8fcd('0x46')]['id']},'attributes':['id',_0x8fcd('0x48'),_0x8fcd('0x92'),'to','cc','bcc',_0x8fcd('0x93'),_0x8fcd('0x94')],'include':_0x37ac6b[_0x8fcd('0x31')][_0x8fcd('0x5c')]?[{'model':db['Attachment'],'as':_0x8fcd('0x95')}]:undefined})['then'](handleEntityNotFound(_0x316ce8,null))['then'](function(_0x2cbfef){if(_0x2cbfef){var _0x410d14=_0x2cbfef;var _0x4df557={'from':_0x410d14[_0x8fcd('0x92')],'to':_0x410d14['to'],'subject':_0x410d14[_0x8fcd('0x93')],'html':htmlEntities[_0x8fcd('0x96')](_0x410d14[_0x8fcd('0x48')]),'headers':{'Date':moment(_0x410d14[_0x8fcd('0x94')])[_0x8fcd('0x66')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2cbfef['cc']){_0x4df557[_0x8fcd('0x97')]['Cc']=_0x2cbfef['cc'];}if(_0x2cbfef['bcc']){_0x4df557['headers'][_0x8fcd('0x98')]=_0x2cbfef[_0x8fcd('0x99')];}return new BPromise(function(_0x4ef9ff,_0x1cfb06){if(_0x2cbfef[_0x8fcd('0x95')]){for(var _0xcba36d=0x0;_0xcba36d<_0x2cbfef[_0x8fcd('0x95')][_0x8fcd('0x47')];_0xcba36d++){var _0xd754ec=_0x2cbfef[_0x8fcd('0x95')][_0xcba36d];var _0x45aad9=path[_0x8fcd('0x8d')](_0x2217a8,_0xd754ec[_0x8fcd('0x5f')]);if(fs['existsSync'](_0x45aad9)){_0x4df557[_0x8fcd('0x5c')][_0x8fcd('0x9a')]({'name':_0xd754ec[_0x8fcd('0x28')],'contentType':_0xd754ec[_0x8fcd('0x2e')],'data':fs['readFileSync'](_0x45aad9)});}}}emlformat[_0x8fcd('0x9b')](_0x4df557,function(_0x334de1,_0x595e81){if(_0x334de1)return _0x1cfb06(_0x334de1);fs[_0x8fcd('0x9c')](path[_0x8fcd('0x8d')](_0x3f5411,_0x590b7c),_0x595e81);return _0x4ef9ff(_0x595e81);});});}})[_0x8fcd('0x24')](function(_0x241e54){if(_0x241e54){return _0x316ce8[_0x8fcd('0x9d')](path['join'](_0x3f5411,_0x590b7c),_0x590b7c,function(_0x5ee4e9){if(!_0x5ee4e9)fs['unlinkSync'](path[_0x8fcd('0x8d')](_0x3f5411,_0x590b7c));});}})[_0x8fcd('0x1c')](handleError(_0x316ce8,null));}; \ No newline at end of file +var _0xecd9=['jayson/promise','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','status','offset','undefined','limit','count','set','Content-Range','json','end','sendStatus','name','send','index','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','attachments','join','root','basename','ListId','List\x20not\x20found','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','format','UserId','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','fullname','email','internal','agent','interface','channel','motionChannel','event','fromString','EventManager','reject','mail','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','download','unix','toString','files','from','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','build','writeFileSync','moment','bluebird','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register'];(function(_0x1b643c,_0x24061a){var _0x3b65bb=function(_0x4f08d8){while(--_0x4f08d8){_0x1b643c['push'](_0x1b643c['shift']());}};_0x3b65bb(++_0x24061a);}(_0xecd9,0x1b4));var _0x9ecd=function(_0x4e876f,_0x5468a1){_0x4e876f=_0x4e876f-0x0;var _0x5e4ede=_0xecd9[_0x4e876f];return _0x5e4ede;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9ecd('0x0'));var BPromise=require(_0x9ecd('0x1'));var util=require('util');var path=require(_0x9ecd('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x9ecd('0x3'));var htmlToText=require(_0x9ecd('0x4'));var qs=require(_0x9ecd('0x5'));var logger=require(_0x9ecd('0x6'))('api');var interaction_log=require(_0x9ecd('0x6'))('mail-interactions');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x9ecd('0x7')]=_[_0x9ecd('0x8')](config['redis'],{'host':_0x9ecd('0x9'),'port':0x18eb});var socket=require(_0x9ecd('0xa'))(new Redis(config[_0x9ecd('0x7')]));var htmlEntities=require(_0x9ecd('0xb'));require(_0x9ecd('0xc'))[_0x9ecd('0xd')](socket);var jayson=require(_0x9ecd('0xe'));var client=jayson['client'][_0x9ecd('0xf')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x355d8b,_0x52a0a1,_0x596716,_0x18c621){return new BPromise(function(_0x227ea8,_0x1556cd){var _0xb66066=_0x18c621||client;return _0xb66066[_0x9ecd('0x10')](_0x355d8b,_0x596716)[_0x9ecd('0x11')](function(_0x427c30){logger[_0x9ecd('0x12')]('MailMessage,\x20%s,\x20%s',_0x52a0a1,_0x9ecd('0x13'));logger[_0x9ecd('0x14')](_0x9ecd('0x15'),_0x52a0a1,'request\x20sent',JSON['stringify'](_0x427c30));if(_0x427c30['error']){if(_0x427c30[_0x9ecd('0x16')]['code']===0x1f4){logger[_0x9ecd('0x16')](_0x9ecd('0x17'),_0x52a0a1,_0x427c30['error'][_0x9ecd('0x18')]);return _0x1556cd(_0x427c30['error'][_0x9ecd('0x18')]);}logger['error'](_0x9ecd('0x17'),_0x52a0a1,_0x427c30[_0x9ecd('0x16')]['message']);return _0x227ea8(_0x427c30[_0x9ecd('0x16')][_0x9ecd('0x18')]);}else{logger[_0x9ecd('0x12')]('MailMessage,\x20%s,\x20%s',_0x52a0a1,_0x9ecd('0x13'));_0x227ea8(_0x427c30[_0x9ecd('0x19')][_0x9ecd('0x18')]);}})['catch'](function(_0x4fddff){logger[_0x9ecd('0x16')]('MailMessage,\x20%s,\x20%s',_0x52a0a1,_0x4fddff);_0x1556cd(_0x4fddff);});});}function respondWithResult(_0x5cb9c2,_0x1b5903){_0x1b5903=_0x1b5903||0xc8;return function(_0xb958b7){if(_0xb958b7){return _0x5cb9c2[_0x9ecd('0x1a')](_0x1b5903)['json'](_0xb958b7);}};}function respondWithFilteredResult(_0x21a042,_0x41f65b){return function(_0x30d1b4){if(_0x30d1b4){var _0x1831e1=typeof _0x41f65b[_0x9ecd('0x1b')]===_0x9ecd('0x1c')&&typeof _0x41f65b[_0x9ecd('0x1d')]==='undefined';var _0x5934cb=_0x30d1b4[_0x9ecd('0x1e')];var _0x399ff9=_0x1831e1?0x0:_0x41f65b['offset'];var _0x3bacb1=_0x1831e1?_0x30d1b4[_0x9ecd('0x1e')]:_0x41f65b[_0x9ecd('0x1b')]+_0x41f65b[_0x9ecd('0x1d')];var _0x17efac;if(_0x3bacb1>=_0x5934cb){_0x3bacb1=_0x5934cb;_0x17efac=0xc8;}else{_0x17efac=0xce;}_0x21a042[_0x9ecd('0x1a')](_0x17efac);return _0x21a042[_0x9ecd('0x1f')](_0x9ecd('0x20'),_0x399ff9+'-'+_0x3bacb1+'/'+_0x5934cb)[_0x9ecd('0x21')](_0x30d1b4);}return null;};}function saveUpdates(_0xc8ef27){return function(_0x2c6fae){if(_0x2c6fae){return _0x2c6fae['update'](_0xc8ef27)[_0x9ecd('0x11')](function(_0x55cd27){return _0x55cd27;});}return null;};}function removeEntity(_0x232838){return function(_0x4c7d88){if(_0x4c7d88){return _0x4c7d88['destroy']()['then'](function(){_0x232838['status'](0xcc)[_0x9ecd('0x22')]();});}};}function handleEntityNotFound(_0x66467){return function(_0x555931){if(!_0x555931){_0x66467[_0x9ecd('0x23')](0x194);}return _0x555931;};}function handleError(_0xee42f4,_0x45d40e){_0x45d40e=_0x45d40e||0x1f4;return function(_0x103d0f){logger[_0x9ecd('0x16')](_0x103d0f['stack']);if(_0x103d0f[_0x9ecd('0x24')]){delete _0x103d0f[_0x9ecd('0x24')];}_0xee42f4[_0x9ecd('0x1a')](_0x45d40e)[_0x9ecd('0x25')](_0x103d0f);};}exports[_0x9ecd('0x26')]=function(_0x3e05e1,_0x2ca226){var _0x503bd0={},_0x3ef804={},_0x3772a1={'count':0x0,'rows':[]};var _0x44b3b8=_['map'](db[_0x9ecd('0x27')][_0x9ecd('0x28')],function(_0x589b5d){return{'name':_0x589b5d['fieldName'],'type':_0x589b5d[_0x9ecd('0x29')][_0x9ecd('0x2a')]};});_0x3ef804[_0x9ecd('0x2b')]=_[_0x9ecd('0x2c')](_0x44b3b8,_0x9ecd('0x24'));_0x3ef804[_0x9ecd('0x2d')]=_[_0x9ecd('0x2e')](_0x3e05e1[_0x9ecd('0x2d')]);_0x3ef804[_0x9ecd('0x2f')]=_['intersection'](_0x3ef804['model'],_0x3ef804[_0x9ecd('0x2d')]);_0x503bd0[_0x9ecd('0x30')]=_['intersection'](_0x3ef804[_0x9ecd('0x2b')],qs['fields'](_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x31')]));_0x503bd0[_0x9ecd('0x30')]=_0x503bd0['attributes'][_0x9ecd('0x32')]?_0x503bd0['attributes']:_0x3ef804[_0x9ecd('0x2b')];if(!_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x33')](_0x9ecd('0x34'))){_0x503bd0['limit']=qs['limit'](_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x1d')]);_0x503bd0[_0x9ecd('0x1b')]=qs[_0x9ecd('0x1b')](_0x3e05e1['query'][_0x9ecd('0x1b')]);}_0x503bd0[_0x9ecd('0x35')]=qs[_0x9ecd('0x36')](_0x3e05e1['query']['sort']);_0x503bd0[_0x9ecd('0x37')]=qs[_0x9ecd('0x2f')](_['pick'](_0x3e05e1[_0x9ecd('0x2d')],_0x3ef804[_0x9ecd('0x2f')]),_0x44b3b8);if(_0x3e05e1['query'][_0x9ecd('0x38')]){_0x503bd0[_0x9ecd('0x37')]=_[_0x9ecd('0x39')](_0x503bd0[_0x9ecd('0x37')],{'$or':_['map'](_0x44b3b8,function(_0x3ce834){if(_0x3ce834[_0x9ecd('0x29')]!==_0x9ecd('0x3a')){var _0x58778d={};_0x58778d[_0x3ce834[_0x9ecd('0x24')]]={'$like':'%'+_0x3e05e1[_0x9ecd('0x2d')][_0x9ecd('0x38')]+'%'};return _0x58778d;}})});}_0x503bd0=_[_0x9ecd('0x39')]({},_0x503bd0,_0x3e05e1[_0x9ecd('0x3b')]);var _0x15fa01={'where':_0x503bd0[_0x9ecd('0x37')]};return db[_0x9ecd('0x27')][_0x9ecd('0x1e')](_0x15fa01)[_0x9ecd('0x11')](function(_0xee6cfe){_0x3772a1['count']=_0xee6cfe;if(_0x3e05e1[_0x9ecd('0x2d')]['includeAll']){_0x503bd0[_0x9ecd('0x3c')]=[{'all':!![]}];}return db[_0x9ecd('0x27')][_0x9ecd('0x3d')](_0x503bd0);})[_0x9ecd('0x11')](function(_0xb06135){_0x3772a1[_0x9ecd('0x3e')]=_0xb06135;return _0x3772a1;})[_0x9ecd('0x11')](respondWithFilteredResult(_0x2ca226,_0x503bd0))[_0x9ecd('0x3f')](handleError(_0x2ca226,null));};exports[_0x9ecd('0x40')]=function(_0x2f38d8,_0x3e67e8){var _0x192f9b={'raw':!![],'where':{'id':_0x2f38d8[_0x9ecd('0x41')]['id']}},_0x235ea4={};_0x235ea4['model']=_[_0x9ecd('0x2e')](db[_0x9ecd('0x27')]['rawAttributes']);_0x235ea4['query']=_['keys'](_0x2f38d8[_0x9ecd('0x2d')]);_0x235ea4['filters']=_[_0x9ecd('0x42')](_0x235ea4[_0x9ecd('0x2b')],_0x235ea4['query']);_0x192f9b[_0x9ecd('0x30')]=_[_0x9ecd('0x42')](_0x235ea4[_0x9ecd('0x2b')],qs[_0x9ecd('0x31')](_0x2f38d8['query'][_0x9ecd('0x31')]));_0x192f9b['attributes']=_0x192f9b['attributes'][_0x9ecd('0x32')]?_0x192f9b[_0x9ecd('0x30')]:_0x235ea4[_0x9ecd('0x2b')];if(_0x2f38d8[_0x9ecd('0x2d')]['includeAll']){_0x192f9b[_0x9ecd('0x3c')]=[{'all':!![]}];}_0x192f9b=_[_0x9ecd('0x39')]({},_0x192f9b,_0x2f38d8[_0x9ecd('0x3b')]);return db[_0x9ecd('0x27')][_0x9ecd('0x43')](_0x192f9b)['then'](handleEntityNotFound(_0x3e67e8,null))[_0x9ecd('0x11')](respondWithResult(_0x3e67e8,null))['catch'](handleError(_0x3e67e8,null));};exports[_0x9ecd('0x44')]=function(_0x16d7b3,_0x22681e){if(_0x16d7b3[_0x9ecd('0x45')]['id']){delete _0x16d7b3['body']['id'];}return db['MailMessage'][_0x9ecd('0x43')]({'where':{'id':_0x16d7b3['params']['id']}})['then'](handleEntityNotFound(_0x22681e,null))['then'](saveUpdates(_0x16d7b3['body'],null))[_0x9ecd('0x11')](respondWithResult(_0x22681e,null))[_0x9ecd('0x3f')](handleError(_0x22681e,null));};exports['destroy']=function(_0x263a3d,_0x43caf7){return db[_0x9ecd('0x27')]['find']({'where':{'id':_0x263a3d[_0x9ecd('0x41')]['id']}})[_0x9ecd('0x11')](handleEntityNotFound(_0x43caf7,null))[_0x9ecd('0x11')](removeEntity(_0x43caf7,null))[_0x9ecd('0x3f')](handleError(_0x43caf7,null));};exports[_0x9ecd('0x46')]=function(_0x56a05b,_0x1f04eb){return db[_0x9ecd('0x27')][_0x9ecd('0x46')]()[_0x9ecd('0x11')](respondWithResult(_0x1f04eb,null))[_0x9ecd('0x3f')](handleError(_0x1f04eb,null));};exports[_0x9ecd('0x47')]=function(_0x171d13,_0x7f35dc){return db[_0x9ecd('0x27')][_0x9ecd('0x47')](_0x171d13[_0x9ecd('0x45')])['then'](function(_0x8f42fd){if(_0x8f42fd){if(_0x8f42fd[_0x9ecd('0x48')]===_0x9ecd('0x49')&&!_0x8f42fd[_0x9ecd('0x4a')]){var _0xb4705e,_0x355f54,_0x19753c;if(_0x171d13[_0x9ecd('0x45')]['to']){_0x355f54=_0x171d13[_0x9ecd('0x45')]['to'][_0x9ecd('0x4b')](',')[0x0];}return db[_0x9ecd('0x4c')][_0x9ecd('0x4d')]({'where':{'id':_0x8f42fd[_0x9ecd('0x4e')]},'include':[{'model':db['CmList'],'as':_0x9ecd('0x4f'),'include':[{'model':db[_0x9ecd('0x50')],'as':_0x9ecd('0x51'),'where':{'email':_0x355f54},'limit':0x1,'order':[[_0x9ecd('0x52'),_0x9ecd('0x53')]]}]},{'model':db['MailServerOut'],'as':_0x9ecd('0x54'),'raw':!![],'include':[{'model':db[_0x9ecd('0x55')],'as':_0x9ecd('0x55'),'raw':!![]}]}]})[_0x9ecd('0x11')](function(_0x4ee6d6){_0xb4705e=_0x4ee6d6;if(!_0xb4705e||!_0xb4705e[_0x9ecd('0x54')])return;var _0x41b2c7=_0xb4705e['getSmtpOptions']();if(_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')]&&_0x171d13[_0x9ecd('0x45')]['attachments'][_0x9ecd('0x32')]){for(var _0x123652=0x0;_0x123652<_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')]['length'];_0x123652+=0x1){_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')][_0x123652]={'filename':_0x171d13[_0x9ecd('0x45')][_0x9ecd('0x56')][_0x123652]['name'],'path':path[_0x9ecd('0x57')](config[_0x9ecd('0x58')],'server/files/attachments',_0x171d13['body'][_0x9ecd('0x56')][_0x123652][_0x9ecd('0x59')])};}}_0x19753c={'account':_0x41b2c7,'message':_0x171d13[_0x9ecd('0x45')]};return;})['then'](function(){if(_0xb4705e[_0x9ecd('0x4f')]){if(_0xb4705e['List']['Contacts']['length']){return _0xb4705e['List']['Contacts'][0x0];}else{return db[_0x9ecd('0x50')][_0x9ecd('0x47')](_['defaults'](_0x171d13[_0x9ecd('0x45')],{'firstName':_0x171d13[_0x9ecd('0x45')]['to'],'email':_0x171d13[_0x9ecd('0x45')]['to'],'phone':_0x171d13['body']['to'],'ListId':_0xb4705e[_0x9ecd('0x5a')]}));}}else{throw new Error(_0x9ecd('0x5b'));}})[_0x9ecd('0x11')](function(){if(_0x19753c){return respondWithRpcPromise('SendMail',_0x9ecd('0x5c'),_0x19753c,client9003)[_0x9ecd('0x11')](function(_0xcaca39){return _0x8f42fd[_0x9ecd('0x44')]({'read':!![],'messageId':_0xcaca39[_0x9ecd('0x5d')],'sentAt':moment()['format'](_0x9ecd('0x5e'))});})['catch'](function(_0x4c8025){logger[_0x9ecd('0x16')]('%s',JSON[_0x9ecd('0x5f')](_0x4c8025));return _0x8f42fd;});}return _0x8f42fd;});}return _0x8f42fd;}})[_0x9ecd('0x11')](respondWithResult(_0x7f35dc,0xc9))[_0x9ecd('0x3f')](handleError(_0x7f35dc,null));};exports[_0x9ecd('0x60')]=function(_0xe71639,_0x48b11d){var _0x63baab={'agent':{},'channel':'mail'};if(_0xe71639['body']['id']){delete _0xe71639['body']['id'];}_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x61')]=!![];_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x62')]=moment()[_0x9ecd('0x63')](_0x9ecd('0x5e'));_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x64')]=_0xe71639[_0x9ecd('0x45')][_0x9ecd('0x64')]||_0xe71639['user']['id'];_0x63baab['agent']['id']=_0xe71639['body']['UserId'];return db[_0x9ecd('0x27')]['find']({'where':{'id':_0xe71639[_0x9ecd('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48b11d,null))[_0x9ecd('0x11')](saveUpdates(_0xe71639[_0x9ecd('0x45')],null))[_0x9ecd('0x11')](function(_0x1dabba){if(_0x1dabba){_0x63baab['message']=_0x1dabba[_0x9ecd('0x65')]({'plain':!![]});return db[_0x9ecd('0x66')][_0x9ecd('0x43')]({'where':{'id':_0x1dabba[_0x9ecd('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x48b11d,null))[_0x9ecd('0x11')](function(_0x2f126e){if(_0x2f126e){return _0x2f126e[_0x9ecd('0x44')]({'UserId':_0xe71639['body'][_0x9ecd('0x64')],'read1stAt':_[_0x9ecd('0x68')](_0x2f126e[_0x9ecd('0x69')])?moment()[_0x9ecd('0x63')](_0x9ecd('0x5e')):undefined});}return null;})[_0x9ecd('0x11')](function(_0x1ed7a4){if(_0x1ed7a4){_0x63baab['interaction']=_0x1ed7a4[_0x9ecd('0x65')]({'plain':!![]});interaction_log['info'](_0x9ecd('0x6a'),_0xe71639[_0x9ecd('0x6b')]['id'],_0xe71639[_0x9ecd('0x6b')]['name'],_0xe71639[_0x9ecd('0x6b')][_0x9ecd('0x6c')],_0x63baab['interaction']['id'],_0xe71639[_0x9ecd('0x45')]?JSON[_0x9ecd('0x5f')](_0xe71639[_0x9ecd('0x45')]):'null');return respondWithRpcPromise(_0x9ecd('0x6d'),'acceptMessage',_0x63baab);}return null;})[_0x9ecd('0x11')](function(_0xd664b5){var _0x23e34d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd664b5['message'][_0x9ecd('0x6e')];return db[_0x9ecd('0x6f')][_0x9ecd('0x2d')](_0x23e34d,{'type':db[_0x9ecd('0x70')]['QueryTypes'][_0x9ecd('0x71')],'raw':!![]})[_0x9ecd('0x11')](function(_0x23a536){return _0x23a536;});})[_0x9ecd('0x11')](function(_0x425ae4){if(_0x425ae4){_0x63baab[_0x9ecd('0x18')][_0x9ecd('0x72')]=_0x425ae4[0x0];if(!_0xe71639['body'][_0x9ecd('0x64')])return;return db['User'][_0x9ecd('0x43')]({'where':{'id':_0xe71639[_0x9ecd('0x45')]['UserId'],'role':'agent'},'attributes':['id',_0x9ecd('0x24'),_0x9ecd('0x73'),_0x9ecd('0x74'),_0x9ecd('0x75')],'raw':!![]});}return null;})[_0x9ecd('0x11')](function(_0xbf032){if(!_0xbf032)return null;_0x63baab['message'][_0x9ecd('0x76')]=_0xbf032;return _0x63baab;})[_0x9ecd('0x11')](function(_0x415016){if(_0x415016){if(_0xe71639[_0x9ecd('0x45')]['manual']){_0x63baab[_0x9ecd('0x18')][_0x9ecd('0x77')]=util[_0x9ecd('0x63')]('SIP/%s',_0xe71639['user'][_0x9ecd('0x24')]);_0x63baab[_0x9ecd('0x18')]['channel']=_0x63baab[_0x9ecd('0x78')];_0x63baab[_0x9ecd('0x18')][_0x9ecd('0x79')]=_0x63baab[_0x9ecd('0x78')];_0x63baab['message'][_0x9ecd('0x7a')]='accept';_0x63baab['message']['body']=htmlToText[_0x9ecd('0x7b')](_0x63baab[_0x9ecd('0x18')]['body']);return respondWithRpcPromise('EventManager',_0x9ecd('0x7c'),{'event':'acceptmessage','message':_0x63baab[_0x9ecd('0x18')]},client9002)[_0x9ecd('0x11')](function(){return _0x63baab;});}return _0x63baab;}return null;})[_0x9ecd('0x11')](respondWithResult(_0x48b11d,null))['catch'](handleError(_0x48b11d,null));};exports[_0x9ecd('0x7d')]=function(_0xf4fa1a,_0x3796fd){var _0x54656b={'agent':{},'channel':_0x9ecd('0x7e')};if(_0xf4fa1a[_0x9ecd('0x45')]['id']){delete _0xf4fa1a[_0x9ecd('0x45')]['id'];}_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')]=_0xf4fa1a[_0x9ecd('0x45')]['UserId']||_0xf4fa1a[_0x9ecd('0x6b')]['id'];_0x54656b[_0x9ecd('0x76')]['id']=_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')];return db[_0x9ecd('0x27')][_0x9ecd('0x43')]({'where':{'id':_0xf4fa1a['params']['id'],'UserId':null}})[_0x9ecd('0x11')](handleEntityNotFound(_0x3796fd,null))[_0x9ecd('0x11')](function(_0x13238d){if(_0x13238d){_0x54656b['message']=_0x13238d[_0x9ecd('0x65')]({'plain':!![]});return db[_0x9ecd('0x66')][_0x9ecd('0x43')]({'where':{'id':_0x13238d[_0x9ecd('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x3796fd,null))['then'](function(_0x1842ef){if(_0x1842ef){_0x54656b[_0x9ecd('0x7f')]=_0x1842ef['get']({'plain':!![]});interaction_log['info'](_0x9ecd('0x80'),_0xf4fa1a[_0x9ecd('0x6b')]['id'],_0xf4fa1a[_0x9ecd('0x6b')][_0x9ecd('0x24')],_0xf4fa1a['user']['role'],_0x54656b['interaction']['id'],_0xf4fa1a[_0x9ecd('0x45')]?JSON[_0x9ecd('0x5f')](_0xf4fa1a[_0x9ecd('0x45')]):_0x9ecd('0x81'));return respondWithRpcPromise(_0x9ecd('0x82'),'rejectMessage',_0x54656b);}return null;})['then'](function(_0x1d4070){var _0x54c7ee=_0x9ecd('0x83')+_0x1d4070[_0x9ecd('0x18')]['ContactId'];return db[_0x9ecd('0x6f')][_0x9ecd('0x2d')](_0x54c7ee,{'type':db[_0x9ecd('0x70')][_0x9ecd('0x84')][_0x9ecd('0x71')],'raw':!![]})['then'](function(_0x453b6d){return _0x453b6d;});})['then'](function(_0x2865aa){if(_0x2865aa){_0x54656b[_0x9ecd('0x18')]['contact']=_0x2865aa[0x0];if(!_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')])return;return db['User'][_0x9ecd('0x43')]({'where':{'id':_0xf4fa1a[_0x9ecd('0x45')][_0x9ecd('0x64')],'role':_0x9ecd('0x76')},'attributes':['id',_0x9ecd('0x24'),_0x9ecd('0x73'),'email',_0x9ecd('0x75')],'raw':!![]});}return null;})[_0x9ecd('0x11')](function(_0x245976){if(!_0x245976)return null;_0x54656b[_0x9ecd('0x18')][_0x9ecd('0x76')]=_0x245976;return _0x54656b;})[_0x9ecd('0x11')](function(_0x498bbb){if(_0x498bbb){_0x498bbb[_0x9ecd('0x18')]['interface']=util['format'](_0x9ecd('0x85'),_0xf4fa1a[_0x9ecd('0x6b')][_0x9ecd('0x24')]);_0x498bbb[_0x9ecd('0x18')][_0x9ecd('0x78')]=_0x54656b[_0x9ecd('0x78')];_0x498bbb['message'][_0x9ecd('0x79')]=_0x54656b['channel'];_0x498bbb['message'][_0x9ecd('0x7a')]=_0x9ecd('0x7d');_0x498bbb['message'][_0x9ecd('0x45')]=htmlToText[_0x9ecd('0x7b')](_0x54656b['message'][_0x9ecd('0x45')]);respondWithRpcPromise('EventManager',_0x9ecd('0x7c'),{'event':'rejectmessage','message':_0x498bbb[_0x9ecd('0x18')]},client9002);return _0x54656b;}return null;})['then'](respondWithResult(_0x3796fd,null))['catch'](handleError(_0x3796fd,null));};exports[_0x9ecd('0x86')]=function(_0xaf975f,_0x98b000){var _0x476f36=moment()[_0x9ecd('0x87')]()[_0x9ecd('0x88')]();var _0x530413=path['join'](config[_0x9ecd('0x58')],'server',_0x9ecd('0x89'),'tmp');var _0x137ebe=path[_0x9ecd('0x57')](config[_0x9ecd('0x58')],'server',_0x9ecd('0x89'),_0x9ecd('0x56'));var _0x4f79b1=util[_0x9ecd('0x63')]('message-%s.eml',_0x476f36);return db[_0x9ecd('0x27')][_0x9ecd('0x43')]({'where':{'id':_0xaf975f['params']['id']},'attributes':['id',_0x9ecd('0x45'),_0x9ecd('0x8a'),'to','cc','bcc',_0x9ecd('0x8b'),_0x9ecd('0x8c')],'include':_0xaf975f[_0x9ecd('0x2d')][_0x9ecd('0x56')]?[{'model':db['Attachment'],'as':_0x9ecd('0x8d')}]:undefined})[_0x9ecd('0x11')](handleEntityNotFound(_0x98b000,null))[_0x9ecd('0x11')](function(_0x26e119){if(_0x26e119){var _0x5e88e2=_0x26e119;var _0x5902c9={'from':_0x5e88e2['from'],'to':_0x5e88e2['to'],'subject':_0x5e88e2[_0x9ecd('0x8b')],'html':htmlEntities['decode'](_0x5e88e2[_0x9ecd('0x45')]),'headers':{'Date':moment(_0x5e88e2[_0x9ecd('0x8c')])['format'](_0x9ecd('0x8e'))},'attachments':[]};if(_0x26e119['cc']){_0x5902c9[_0x9ecd('0x8f')]['Cc']=_0x26e119['cc'];}if(_0x26e119[_0x9ecd('0x90')]){_0x5902c9[_0x9ecd('0x8f')][_0x9ecd('0x91')]=_0x26e119[_0x9ecd('0x90')];}return new BPromise(function(_0x5bd156,_0xa91c00){if(_0x26e119[_0x9ecd('0x8d')]){for(var _0x3eea2a=0x0;_0x3eea2a<_0x26e119[_0x9ecd('0x8d')][_0x9ecd('0x32')];_0x3eea2a++){var _0x55d93f=_0x26e119[_0x9ecd('0x8d')][_0x3eea2a];var _0x266a55=path[_0x9ecd('0x57')](_0x137ebe,_0x55d93f['basename']);if(fs[_0x9ecd('0x92')](_0x266a55)){_0x5902c9['attachments'][_0x9ecd('0x93')]({'name':_0x55d93f[_0x9ecd('0x24')],'contentType':_0x55d93f['type'],'data':fs['readFileSync'](_0x266a55)});}}}emlformat[_0x9ecd('0x94')](_0x5902c9,function(_0x1ba820,_0x1a03de){if(_0x1ba820)return _0xa91c00(_0x1ba820);fs[_0x9ecd('0x95')](path[_0x9ecd('0x57')](_0x530413,_0x4f79b1),_0x1a03de);return _0x5bd156(_0x1a03de);});});}})[_0x9ecd('0x11')](function(_0x1e9bda){if(_0x1e9bda){return _0x98b000[_0x9ecd('0x86')](path[_0x9ecd('0x57')](_0x530413,_0x4f79b1),_0x4f79b1,function(_0x22393a){if(!_0x22393a)fs['unlinkSync'](path['join'](_0x530413,_0x4f79b1));});}})[_0x9ecd('0x3f')](handleError(_0x98b000,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 4c0dc46..0a62148 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 _0xf429=['hasOwnProperty','exports','../../mysqldb','save','remove','emit'];(function(_0x3f7874,_0x45d3f3){var _0x14f5c7=function(_0xaa2d5c){while(--_0xaa2d5c){_0x3f7874['push'](_0x3f7874['shift']());}};_0x14f5c7(++_0x45d3f3);}(_0xf429,0x1b2));var _0x9f42=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0xf429[_0x4a563b];return _0x2935ef;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x9f42('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9f42('0x1'),'afterUpdate':'update','afterDestroy':_0x9f42('0x2')};function emitEvent(_0x218bb5){return function(_0x223649,_0x32332,_0xb60824){MailMessageEvents[_0x9f42('0x3')](_0x218bb5+':'+_0x223649['id'],_0x223649);MailMessageEvents['emit'](_0x218bb5,_0x223649);_0xb60824(null);};}for(var e in events){if(events[_0x9f42('0x4')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x9f42('0x5')]=MailMessageEvents; \ No newline at end of file +var _0x2c12=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c12,0x65));var _0x22c1=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x2c12[_0xce93c];return _0x230720;};'use strict';var EventEmitter=require(_0x22c1('0x0'));var MailMessage=require(_0x22c1('0x1'))['db'][_0x22c1('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x22c1('0x3')](0x0);var events={'afterCreate':_0x22c1('0x4'),'afterUpdate':_0x22c1('0x5'),'afterDestroy':_0x22c1('0x6')};function emitEvent(_0x3b915f){return function(_0x5a840c,_0x2831ae,_0x289f23){MailMessageEvents[_0x22c1('0x7')](_0x3b915f+':'+_0x5a840c['id'],_0x5a840c);MailMessageEvents[_0x22c1('0x7')](_0x3b915f,_0x5a840c);_0x289f23(null);};}for(var e in events){if(events[_0x22c1('0x8')](e)){var event=events[e];MailMessage[_0x22c1('0x9')](e,emitEvent(event));}}module[_0x22c1('0xa')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index ded5eaa..9497e6b 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 _0xab1a=['html-to-text','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','plainBody','FULLTEXT','body','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x537f99,_0x427089){var _0x2d3443=function(_0x1d05df){while(--_0x1d05df){_0x537f99['push'](_0x537f99['shift']());}};_0x2d3443(++_0x427089);}(_0xab1a,0xb4));var _0xaab1=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0xab1a[_0x2c9b79];return _0x265032;};'use strict';var _=require('lodash');var util=require(_0xaab1('0x0'));var logger=require(_0xaab1('0x1'))(_0xaab1('0x2'));var moment=require(_0xaab1('0x3'));var BPromise=require(_0xaab1('0x4'));var rp=require(_0xaab1('0x5'));var htmlToText=require(_0xaab1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaab1('0x7'));var config=require(_0xaab1('0x8'));var attributes=require(_0xaab1('0x9'));module['exports']=function(_0x14218d,_0x3492a2){return _0x14218d[_0xaab1('0xa')](_0xaab1('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xaab1('0xc'),'fields':[_0xaab1('0xc')]},{'name':_0xaab1('0xd'),'fields':[_0xaab1('0xe'),'subject'],'type':_0xaab1('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4cbe78,_0x501d2d,_0x357619){if(_0x4cbe78[_0xaab1('0x10')]){_0x4cbe78[_0xaab1('0xe')]=htmlToText['fromString'](_0x4cbe78[_0xaab1('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x357619(null,_0x501d2d);},'afterCreate':function(_0x3308dc,_0x3bdb02,_0xfd18bf){var _0x3d99f0=_0x14218d[_0xaab1('0x11')];var _0x48b08d=_0x3308dc['get']({'plain':!![]});if(_0x48b08d[_0xaab1('0x12')][_0xaab1('0x13')]()==='in'||_0x48b08d[_0xaab1('0x12')][_0xaab1('0x13')]()===_0xaab1('0x14')&&!_0x48b08d[_0xaab1('0x15')]&&!_[_0xaab1('0x16')](_0x48b08d[_0xaab1('0x17')])){_0x3d99f0[_0xaab1('0x18')]['findOne']({'where':{'id':_0x48b08d[_0xaab1('0x19')]}})['then'](function(_0x567482){if(_0x567482){_0x567482[_0xaab1('0x1a')]({'lastMsgAt':_0x48b08d[_0xaab1('0x1b')],'lastMsgDirection':_0x48b08d[_0xaab1('0x12')][_0xaab1('0x13')]()});}})[_0xaab1('0x1c')](function(_0x5547f0){console[_0xaab1('0x1d')](_0x5547f0);});}_0xfd18bf();}},'charset':'utf8mb4','collate':_0xaab1('0x1e')});}; \ No newline at end of file +var _0xc499=['rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','fti_mail_messages','subject','body','fromString','models','get','direction','toLowerCase','out','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','lodash','util','../../config/logger','api','moment','bluebird','html-to-text'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc499,0x1d9));var _0x9c49=function(_0x19921b,_0x5c0c2d){_0x19921b=_0x19921b-0x0;var _0x273545=_0xc499[_0x19921b];return _0x273545;};'use strict';var _=require(_0x9c49('0x0'));var util=require(_0x9c49('0x1'));var logger=require(_0x9c49('0x2'))(_0x9c49('0x3'));var moment=require(_0x9c49('0x4'));var BPromise=require(_0x9c49('0x5'));var rp=require('request-promise');var htmlToText=require(_0x9c49('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c49('0x7'));var config=require(_0x9c49('0x8'));var attributes=require(_0x9c49('0x9'));module[_0x9c49('0xa')]=function(_0x12c219,_0x154de7){return _0x12c219[_0x9c49('0xb')](_0x9c49('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x9c49('0xd'),'fields':['plainBody',_0x9c49('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x35f77,_0x5e3abb,_0x1de158){if(_0x35f77[_0x9c49('0xf')]){_0x35f77['plainBody']=htmlToText[_0x9c49('0x10')](_0x35f77[_0x9c49('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1de158(null,_0x5e3abb);},'afterCreate':function(_0x1a3ff2,_0x2d6724,_0x47d3e1){var _0x778052=_0x12c219[_0x9c49('0x11')];var _0x1820de=_0x1a3ff2[_0x9c49('0x12')]({'plain':!![]});if(_0x1820de[_0x9c49('0x13')]['toLowerCase']()==='in'||_0x1820de[_0x9c49('0x13')][_0x9c49('0x14')]()===_0x9c49('0x15')&&!_0x1820de['secret']&&!_['isNil'](_0x1820de[_0x9c49('0x16')])){_0x778052['MailInteraction'][_0x9c49('0x17')]({'where':{'id':_0x1820de[_0x9c49('0x18')]}})[_0x9c49('0x19')](function(_0x5d4a59){if(_0x5d4a59){_0x5d4a59[_0x9c49('0x1a')]({'lastMsgAt':_0x1820de[_0x9c49('0x1b')],'lastMsgDirection':_0x1820de[_0x9c49('0x13')][_0x9c49('0x14')]()});}})[_0x9c49('0x1c')](function(_0x5c7b9a){console[_0x9c49('0x1d')](_0x5c7b9a);});}_0x47d3e1();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index f03fd2b..56b064b 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 _0x757a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','info','catch','CreateMailMessage','MailMessage','create','body','raw','debug','stringify','util','moment'];(function(_0x3654ef,_0x50f638){var _0xcbd451=function(_0x420bc1){while(--_0x420bc1){_0x3654ef['push'](_0x3654ef['shift']());}};_0xcbd451(++_0x50f638);}(_0x757a,0xde));var _0xa757=function(_0x4d2c8a,_0x29e2bd){_0x4d2c8a=_0x4d2c8a-0x0;var _0x40e876=_0x757a[_0x4d2c8a];return _0x40e876;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('MailMessage,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});}exports[_0xa757('0x15')]=function(_0x4bd137){var _0x58954=this;return new Promise(function(_0x4fec52,_0x32c2a1){return db[_0xa757('0x16')][_0xa757('0x17')](_0x4bd137[_0xa757('0x18')],{'raw':_0x4bd137['options']?_0x4bd137['options'][_0xa757('0x19')]===undefined?!![]:![]:!![]})[_0xa757('0xe')](function(_0x2ba923){logger[_0xa757('0x13')](_0xa757('0x15'),_0x4bd137);logger[_0xa757('0x1a')](_0xa757('0x15'),_0x4bd137,JSON[_0xa757('0x1b')](_0x2ba923));_0x4fec52(_0x2ba923);})[_0xa757('0x14')](function(_0x59fae6){logger[_0xa757('0x10')]('CreateMailMessage',_0x59fae6[_0xa757('0x12')],_0x4bd137);_0x32c2a1(_0x58954['error'](0x1f4,_0x59fae6[_0xa757('0x12')]));});});}; \ No newline at end of file +var _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateMailMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x407a5b,_0x4a84fc){var _0x39bda9=function(_0x7b60e2){while(--_0x7b60e2){_0x407a5b['push'](_0x407a5b['shift']());}};_0x39bda9(++_0x4a84fc);}(_0x5eb8,0xb0));var _0x85eb=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x5eb8[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./mailMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('MailMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateMailMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['MailMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateMailMessage',_0x24cf28);logger['debug']('CreateMailMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f43b8a4..6c827a3 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 _0xc775=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0x553150,_0x589ff3){var _0x18193d=function(_0x3a5ae6){while(--_0x3a5ae6){_0x553150['push'](_0x553150['shift']());}};_0x18193d(++_0x589ff3);}(_0xc775,0x156));var _0x5c77=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc775[_0xa464c9];return _0x3d73c4;};'use strict';var MailMessageEvents=require(_0x5c77('0x0'));var events=['save',_0x5c77('0x1'),_0x5c77('0x2')];function createListener(_0x568275,_0xa341ed){return function(_0x1120e1){_0xa341ed[_0x5c77('0x3')](_0x568275,_0x1120e1);};}function removeListener(_0x53a40c,_0x3ec6b9){return function(){MailMessageEvents[_0x5c77('0x4')](_0x53a40c,_0x3ec6b9);};}exports[_0x5c77('0x5')]=function(_0x54d8ff){for(var _0x36bd85=0x0,_0x25945b=events[_0x5c77('0x6')];_0x36bd85<_0x25945b;_0x36bd85++){var _0x483bc0=events[_0x36bd85];var _0x4bcee4=createListener(_0x5c77('0x7')+_0x483bc0,_0x54d8ff);MailMessageEvents['on'](_0x483bc0,_0x4bcee4);}}; \ No newline at end of file +var _0x7985=['length','mailMessage:','./mailMessage.events','remove','update','emit','register'];(function(_0x2c6f1c,_0x18f248){var _0x3aa773=function(_0x4acec3){while(--_0x4acec3){_0x2c6f1c['push'](_0x2c6f1c['shift']());}};_0x3aa773(++_0x18f248);}(_0x7985,0x1de));var _0x5798=function(_0x21929f,_0xb96182){_0x21929f=_0x21929f-0x0;var _0x1a6077=_0x7985[_0x21929f];return _0x1a6077;};'use strict';var MailMessageEvents=require(_0x5798('0x0'));var events=['save',_0x5798('0x1'),_0x5798('0x2')];function createListener(_0x297f13,_0x5510ad){return function(_0x58b86c){_0x5510ad[_0x5798('0x3')](_0x297f13,_0x58b86c);};}function removeListener(_0x1bc556,_0x43cf82){return function(){MailMessageEvents['removeListener'](_0x1bc556,_0x43cf82);};}exports[_0x5798('0x4')]=function(_0x422990){for(var _0x28cf24=0x0,_0x5b18ae=events[_0x5798('0x5')];_0x28cf24<_0x5b18ae;_0x28cf24++){var _0x5f2e1f=events[_0x28cf24];var _0x440294=createListener(_0x5798('0x6')+_0x5f2e1f,_0x422990);MailMessageEvents['on'](_0x5f2e1f,_0x440294);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 25ea837..adfecec 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 _0x2484=['removeTeams','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy'];(function(_0x3f6047,_0x2d4f4d){var _0x18cf85=function(_0x5b1b7d){while(--_0x5b1b7d){_0x3f6047['push'](_0x3f6047['shift']());}};_0x18cf85(++_0x2d4f4d);}(_0x2484,0x1b4));var _0x4248=function(_0x3e779c,_0x546ea2){_0x3e779c=_0x3e779c-0x0;var _0x22ab11=_0x2484[_0x3e779c];return _0x22ab11;};'use strict';var multer=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var path=require(_0x4248('0x2'));var timeout=require(_0x4248('0x3'));var express=require(_0x4248('0x4'));var router=express[_0x4248('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4248('0x6'));var interaction=require(_0x4248('0x7'));var config=require(_0x4248('0x8'));var controller=require(_0x4248('0x9'));router[_0x4248('0xa')]('/',auth[_0x4248('0xb')](),controller[_0x4248('0xc')]);router[_0x4248('0xa')]('/describe',auth[_0x4248('0xb')](),controller['describe']);router['get'](_0x4248('0xd'),auth[_0x4248('0xb')](),controller['show']);router[_0x4248('0xa')](_0x4248('0xe'),auth[_0x4248('0xb')](),controller[_0x4248('0xf')]);router[_0x4248('0xa')](_0x4248('0x10'),auth[_0x4248('0xb')](),controller[_0x4248('0x11')]);router[_0x4248('0xa')](_0x4248('0x12'),auth[_0x4248('0xb')](),controller[_0x4248('0x13')]);router[_0x4248('0x14')]('/',auth['isAuthenticated'](),controller[_0x4248('0x15')]);router[_0x4248('0x14')]('/:id/teams',auth[_0x4248('0xb')](),controller[_0x4248('0x16')]);router['post']('/:id/users',auth[_0x4248('0xb')](),controller[_0x4248('0x17')]);router[_0x4248('0x18')](_0x4248('0xd'),auth[_0x4248('0xb')](),controller[_0x4248('0x19')]);router[_0x4248('0x1a')](_0x4248('0xd'),auth[_0x4248('0xb')](),controller[_0x4248('0x1b')]);router['delete'](_0x4248('0x10'),auth['isAuthenticated'](),controller[_0x4248('0x1c')]);router[_0x4248('0x1a')](_0x4248('0x12'),auth[_0x4248('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x8409=['update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addAgents','put'];(function(_0x529b05,_0x130267){var _0x381832=function(_0x2cac68){while(--_0x2cac68){_0x529b05['push'](_0x529b05['shift']());}};_0x381832(++_0x130267);}(_0x8409,0x154));var _0x9840=function(_0x55cc6a,_0x5dbd65){_0x55cc6a=_0x55cc6a-0x0;var _0x26e2cd=_0x8409[_0x55cc6a];return _0x26e2cd;};'use strict';var multer=require(_0x9840('0x0'));var util=require(_0x9840('0x1'));var path=require(_0x9840('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9840('0x3')]();var fs_extra=require(_0x9840('0x4'));var auth=require(_0x9840('0x5'));var interaction=require(_0x9840('0x6'));var config=require(_0x9840('0x7'));var controller=require(_0x9840('0x8'));router['get']('/',auth[_0x9840('0x9')](),controller[_0x9840('0xa')]);router['get'](_0x9840('0xb'),auth[_0x9840('0x9')](),controller[_0x9840('0xc')]);router[_0x9840('0xd')](_0x9840('0xe'),auth['isAuthenticated'](),controller[_0x9840('0xf')]);router[_0x9840('0xd')](_0x9840('0x10'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9840('0xd')](_0x9840('0x11'),auth[_0x9840('0x9')](),controller['getTeams']);router[_0x9840('0xd')](_0x9840('0x12'),auth['isAuthenticated'](),controller[_0x9840('0x13')]);router[_0x9840('0x14')]('/',auth[_0x9840('0x9')](),controller[_0x9840('0x15')]);router[_0x9840('0x14')](_0x9840('0x11'),auth[_0x9840('0x9')](),controller['addTeams']);router['post'](_0x9840('0x12'),auth[_0x9840('0x9')](),controller[_0x9840('0x16')]);router[_0x9840('0x17')]('/:id',auth[_0x9840('0x9')](),controller[_0x9840('0x18')]);router[_0x9840('0x19')](_0x9840('0xe'),auth[_0x9840('0x9')](),controller[_0x9840('0x1a')]);router[_0x9840('0x19')](_0x9840('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x9840('0x19')](_0x9840('0x12'),auth[_0x9840('0x9')](),controller['removeAgents']);module[_0x9840('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 0176b6b..5ecd022 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 _0x81d5=['ENUM','rrmemory','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x53cb8b,_0x1074de){var _0x5a7658=function(_0xc3b5c9){while(--_0xc3b5c9){_0x53cb8b['push'](_0x53cb8b['shift']());}};_0x5a7658(++_0x1074de);}(_0x81d5,0xdc));var _0x581d=function(_0x1f650e,_0x4c83d3){_0x1f650e=_0x1f650e-0x0;var _0x3997f9=_0x81d5[_0x1f650e];return _0x3997f9;};'use strict';var Sequelize=require(_0x581d('0x0'));module[_0x581d('0x1')]={'name':{'type':Sequelize[_0x581d('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x581d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x581d('0x4')](_0x581d('0x5'),'beepall',_0x581d('0x6'))}}; \ No newline at end of file +var _0x4b49=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x4ef13e,_0x50dc3d){var _0x1791b2=function(_0x1502be){while(--_0x1502be){_0x4ef13e['push'](_0x4ef13e['shift']());}};_0x1791b2(++_0x50dc3d);}(_0x4b49,0x1c8));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x94b4('0x0'));module[_0x94b4('0x1')]={'name':{'type':Sequelize[_0x94b4('0x2')],'unique':_0x94b4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x94b4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x94b4('0x5')](_0x94b4('0x6'),'beepall',_0x94b4('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 0956088..7779b4c 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 _0x2769=['VIRTUAL','options','include','findAll','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserMailQueue','nolimit','sort','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','rows','format','getTeams','findOne','Team','addTeams','online','flatMap','sequelize','transaction','each','findOrCreate','ids','Agents','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','value','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','MailQueues','UserProfileResource','status','end','error','name','send','MailQueue','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type'];(function(_0x5e32ad,_0xe5887d){var _0x35ebac=function(_0x43c742){while(--_0x43c742){_0x5e32ad['push'](_0x5e32ad['shift']());}};_0x35ebac(++_0xe5887d);}(_0x2769,0xcf));var _0x9276=function(_0x5f3670,_0x1d270d){_0x5f3670=_0x5f3670-0x0;var _0x4c4d66=_0x2769[_0x5f3670];return _0x4c4d66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9276('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9276('0x1'));var rp=require(_0x9276('0x2'));var moment=require(_0x9276('0x3'));var BPromise=require(_0x9276('0x4'));var Mustache=require(_0x9276('0x5'));var util=require(_0x9276('0x6'));var path=require('path');var sox=require(_0x9276('0x7'));var csv=require('to-csv');var ejs=require(_0x9276('0x8'));var fs=require('fs');var fs_extra=require(_0x9276('0x9'));var _=require('lodash');var squel=require(_0x9276('0xa'));var crypto=require(_0x9276('0xb'));var jsforce=require(_0x9276('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9276('0xd'));var querystring=require(_0x9276('0xe'));var Papa=require(_0x9276('0xf'));var Redis=require(_0x9276('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9276('0x11'));var as=require(_0x9276('0x12'));var hardwareService=require(_0x9276('0x13'));var logger=require(_0x9276('0x14'))('api');var utils=require(_0x9276('0x15'));var config=require(_0x9276('0x16'));var licenseUtil=require(_0x9276('0x17'));var db=require(_0x9276('0x18'))['db'];config[_0x9276('0x19')]=_['defaults'](config[_0x9276('0x19')],{'host':_0x9276('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9276('0x19')]));require('./mailQueue.socket')[_0x9276('0x1b')](socket);function respondWithStatusCode(_0x43c1a8,_0x98bb30){_0x98bb30=_0x98bb30||0xcc;return function(_0x53bb32){if(_0x53bb32){return _0x43c1a8['sendStatus'](_0x98bb30);}return _0x43c1a8['status'](_0x98bb30)['end']();};}function respondWithResult(_0x1ec9ae,_0x2c655a){_0x2c655a=_0x2c655a||0xc8;return function(_0xd29cdf){if(_0xd29cdf){return _0x1ec9ae['status'](_0x2c655a)[_0x9276('0x1c')](_0xd29cdf);}};}function respondWithFilteredResult(_0x3977c7,_0x471a7c){return function(_0x33d584){if(_0x33d584){var _0x2fca4b=typeof _0x471a7c[_0x9276('0x1d')]==='undefined'&&typeof _0x471a7c['limit']===_0x9276('0x1e');var _0x2a9dce=_0x33d584[_0x9276('0x1f')];var _0x4c539b=_0x2fca4b?0x0:_0x471a7c[_0x9276('0x1d')];var _0x68210=_0x2fca4b?_0x33d584[_0x9276('0x1f')]:_0x471a7c[_0x9276('0x1d')]+_0x471a7c[_0x9276('0x20')];var _0x29800f;if(_0x68210>=_0x2a9dce){_0x68210=_0x2a9dce;_0x29800f=0xc8;}else{_0x29800f=0xce;}_0x3977c7['status'](_0x29800f);return _0x3977c7[_0x9276('0x21')](_0x9276('0x22'),_0x4c539b+'-'+_0x68210+'/'+_0x2a9dce)[_0x9276('0x1c')](_0x33d584);}return null;};}function patchUpdates(_0x28a946){return function(_0x39bd53){try{jsonpatch[_0x9276('0x23')](_0x39bd53,_0x28a946,!![]);}catch(_0x3747c4){return BPromise['reject'](_0x3747c4);}return _0x39bd53[_0x9276('0x24')]();};}function saveUpdates(_0x53ecb,_0x4e8889){return function(_0x464ea8){if(_0x464ea8){return _0x464ea8[_0x9276('0x25')](_0x53ecb)[_0x9276('0x26')](function(_0x140dc0){return _0x140dc0;});}return null;};}function removeEntity(_0xdf56be,_0x4c3c91){return function(_0xf95068){if(_0xf95068){return _0xf95068[_0x9276('0x27')]()[_0x9276('0x26')](function(){var _0x59adca=_0xf95068[_0x9276('0x28')]({'plain':!![]});var _0x33f67d=_0x9276('0x29');return db[_0x9276('0x2a')]['destroy']({'where':{'type':_0x33f67d,'resourceId':_0x59adca['id']}})[_0x9276('0x26')](function(){return _0xf95068;});})[_0x9276('0x26')](function(){_0xdf56be[_0x9276('0x2b')](0xcc)[_0x9276('0x2c')]();});}};}function handleEntityNotFound(_0x3d07bb,_0x111ebe){return function(_0x29f64e){if(!_0x29f64e){_0x3d07bb['sendStatus'](0x194);}return _0x29f64e;};}function handleError(_0x2fd25d,_0x1a1140){_0x1a1140=_0x1a1140||0x1f4;return function(_0x450280){logger[_0x9276('0x2d')](_0x450280['stack']);if(_0x450280[_0x9276('0x2e')]){delete _0x450280['name'];}_0x2fd25d[_0x9276('0x2b')](_0x1a1140)[_0x9276('0x2f')](_0x450280);};}exports['index']=function(_0x534e3e,_0x247bb6){var _0x55b0d4={},_0x46ae8a={},_0x152319={'count':0x0,'rows':[]};var _0x1e2d22=_['map'](db[_0x9276('0x30')][_0x9276('0x31')],function(_0x431532){return{'name':_0x431532[_0x9276('0x32')],'type':_0x431532['type']['key']};});_0x46ae8a[_0x9276('0x33')]=_[_0x9276('0x34')](_0x1e2d22,'name');_0x46ae8a['query']=_[_0x9276('0x35')](_0x534e3e[_0x9276('0x36')]);_0x46ae8a[_0x9276('0x37')]=_[_0x9276('0x38')](_0x46ae8a[_0x9276('0x33')],_0x46ae8a[_0x9276('0x36')]);_0x55b0d4[_0x9276('0x39')]=_[_0x9276('0x38')](_0x46ae8a['model'],qs[_0x9276('0x3a')](_0x534e3e[_0x9276('0x36')]['fields']));_0x55b0d4['attributes']=_0x55b0d4[_0x9276('0x39')][_0x9276('0x3b')]?_0x55b0d4[_0x9276('0x39')]:_0x46ae8a['model'];if(!_0x534e3e['query'][_0x9276('0x3c')]('nolimit')){_0x55b0d4[_0x9276('0x20')]=qs[_0x9276('0x20')](_0x534e3e['query'][_0x9276('0x20')]);_0x55b0d4[_0x9276('0x1d')]=qs[_0x9276('0x1d')](_0x534e3e['query'][_0x9276('0x1d')]);}_0x55b0d4[_0x9276('0x3d')]=qs['sort'](_0x534e3e[_0x9276('0x36')]['sort']);_0x55b0d4[_0x9276('0x3e')]=qs[_0x9276('0x37')](_[_0x9276('0x3f')](_0x534e3e[_0x9276('0x36')],_0x46ae8a[_0x9276('0x37')]),_0x1e2d22);if(_0x534e3e['query'][_0x9276('0x40')]){_0x55b0d4[_0x9276('0x3e')]=_[_0x9276('0x41')](_0x55b0d4[_0x9276('0x3e')],{'$or':_[_0x9276('0x34')](_0x1e2d22,function(_0x1ecc19){if(_0x1ecc19[_0x9276('0x42')]!==_0x9276('0x43')){var _0x153a9d={};_0x153a9d[_0x1ecc19[_0x9276('0x2e')]]={'$like':'%'+_0x534e3e['query'][_0x9276('0x40')]+'%'};return _0x153a9d;}})});}_0x55b0d4=_[_0x9276('0x41')]({},_0x55b0d4,_0x534e3e[_0x9276('0x44')]);var _0x4d691e={'where':_0x55b0d4['where']};return db[_0x9276('0x30')]['count'](_0x4d691e)[_0x9276('0x26')](function(_0x260a1d){_0x152319['count']=_0x260a1d;if(_0x534e3e[_0x9276('0x36')]['includeAll']){_0x55b0d4[_0x9276('0x45')]=[{'all':!![]}];}return db[_0x9276('0x30')][_0x9276('0x46')](_0x55b0d4);})['then'](function(_0x523bad){_0x152319['rows']=_0x523bad;return _0x152319;})[_0x9276('0x26')](respondWithFilteredResult(_0x247bb6,_0x55b0d4))[_0x9276('0x47')](handleError(_0x247bb6,null));};exports[_0x9276('0x48')]=function(_0x243081,_0xdc29c8){var _0x31c55b={'raw':!![],'where':{'id':_0x243081['params']['id']}},_0x4742e4={};_0x4742e4[_0x9276('0x33')]=_[_0x9276('0x35')](db[_0x9276('0x30')][_0x9276('0x31')]);_0x4742e4['query']=_['keys'](_0x243081[_0x9276('0x36')]);_0x4742e4[_0x9276('0x37')]=_[_0x9276('0x38')](_0x4742e4['model'],_0x4742e4[_0x9276('0x36')]);_0x31c55b[_0x9276('0x39')]=_['intersection'](_0x4742e4[_0x9276('0x33')],qs[_0x9276('0x3a')](_0x243081['query']['fields']));_0x31c55b['attributes']=_0x31c55b[_0x9276('0x39')][_0x9276('0x3b')]?_0x31c55b['attributes']:_0x4742e4[_0x9276('0x33')];if(_0x243081[_0x9276('0x36')]['includeAll']){_0x31c55b[_0x9276('0x45')]=[{'all':!![]}];}_0x31c55b=_['merge']({},_0x31c55b,_0x243081[_0x9276('0x44')]);return db[_0x9276('0x30')]['find'](_0x31c55b)[_0x9276('0x26')](handleEntityNotFound(_0xdc29c8,null))[_0x9276('0x26')](respondWithResult(_0xdc29c8,null))[_0x9276('0x47')](handleError(_0xdc29c8,null));};exports[_0x9276('0x49')]=function(_0x6ed233,_0x3f96cb){return db[_0x9276('0x30')][_0x9276('0x49')](_0x6ed233[_0x9276('0x4a')],{})[_0x9276('0x26')](function(_0x33c981){var _0x55770f=_0x6ed233[_0x9276('0x4b')][_0x9276('0x28')]({'plain':!![]});if(!_0x55770f)throw new Error(_0x9276('0x4c'));if(_0x55770f[_0x9276('0x4d')]===_0x9276('0x4b')){var _0x367f12=_0x33c981['get']({'plain':!![]});var _0x43b3f9=_0x9276('0x29');return db[_0x9276('0x4e')][_0x9276('0x4f')]({'where':{'name':_0x43b3f9,'userProfileId':_0x55770f[_0x9276('0x50')]},'raw':!![]})[_0x9276('0x26')](function(_0x33c197){if(_0x33c197&&_0x33c197[_0x9276('0x51')]===0x0){return db[_0x9276('0x2a')][_0x9276('0x49')]({'name':_0x367f12[_0x9276('0x2e')],'resourceId':_0x367f12['id'],'type':_0x33c197[_0x9276('0x2e')],'sectionId':_0x33c197['id']},{})[_0x9276('0x26')](function(){return _0x33c981;});}else{return _0x33c981;}})['catch'](function(_0x9c4f91){logger[_0x9276('0x2d')](_0x9276('0x52'),_0x9c4f91);throw _0x9c4f91;});}return _0x33c981;})['then'](respondWithResult(_0x3f96cb,0xc9))['catch'](handleError(_0x3f96cb,null));};exports[_0x9276('0x25')]=function(_0x63c4ce,_0x6077e5){if(_0x63c4ce[_0x9276('0x4a')]['id']){delete _0x63c4ce['body']['id'];}return db[_0x9276('0x30')][_0x9276('0x4f')]({'where':{'id':_0x63c4ce[_0x9276('0x53')]['id']}})[_0x9276('0x26')](handleEntityNotFound(_0x6077e5,null))[_0x9276('0x26')](saveUpdates(_0x63c4ce[_0x9276('0x4a')],null))['then'](respondWithResult(_0x6077e5,null))[_0x9276('0x47')](handleError(_0x6077e5,null));};exports[_0x9276('0x27')]=function(_0x576b58,_0x57c32b){return db[_0x9276('0x30')][_0x9276('0x4f')]({'where':{'id':_0x576b58[_0x9276('0x53')]['id']}})['then'](handleEntityNotFound(_0x57c32b,null))[_0x9276('0x26')](removeEntity(_0x57c32b,null))['catch'](handleError(_0x57c32b,null));};exports['describe']=function(_0x93b553,_0x179c16){return db[_0x9276('0x30')][_0x9276('0x54')]()[_0x9276('0x26')](respondWithResult(_0x179c16,null))[_0x9276('0x47')](handleError(_0x179c16,null));};exports[_0x9276('0x55')]=function(_0x473b93,_0xd85fb7,_0x57aa22){var _0x136a08={'raw':!![],'where':{}},_0x3ad43c={},_0x2aae5c;return db['MailQueue']['findOne']({'where':{'id':_0x473b93[_0x9276('0x53')]['id']}})['then'](handleEntityNotFound(_0xd85fb7,null))[_0x9276('0x26')](function(_0x3c9941){if(_0x3c9941){_0x2aae5c=_0x3c9941[_0x9276('0x28')]({'plain':!![]});_0x3ad43c[_0x9276('0x33')]=_['keys'](db[_0x9276('0x56')][_0x9276('0x31')]);_0x3ad43c[_0x9276('0x36')]=_[_0x9276('0x35')](_0x473b93[_0x9276('0x36')]);_0x3ad43c[_0x9276('0x37')]=_[_0x9276('0x38')](_0x3ad43c['model'],_0x3ad43c[_0x9276('0x36')]);_0x136a08['attributes']=_['intersection'](_0x3ad43c[_0x9276('0x33')],qs['fields'](_0x473b93[_0x9276('0x36')][_0x9276('0x3a')]));_0x136a08['attributes']=_0x136a08[_0x9276('0x39')][_0x9276('0x3b')]?_0x136a08[_0x9276('0x39')]:_0x3ad43c['model'];if(!_0x473b93[_0x9276('0x36')][_0x9276('0x3c')](_0x9276('0x57'))){_0x136a08[_0x9276('0x20')]=qs[_0x9276('0x20')](_0x473b93['query'][_0x9276('0x20')]);_0x136a08['offset']=qs[_0x9276('0x1d')](_0x473b93[_0x9276('0x36')][_0x9276('0x1d')]);}_0x136a08[_0x9276('0x3d')]=qs['sort'](_0x473b93[_0x9276('0x36')][_0x9276('0x58')]);_0x136a08['where']=qs[_0x9276('0x37')](_['pick'](_0x473b93['query'],_0x3ad43c[_0x9276('0x37')]));_0x136a08[_0x9276('0x3e')][_0x9276('0x59')]=_0x3c9941['id'];if(_0x473b93[_0x9276('0x36')]['filter']){_0x136a08[_0x9276('0x3e')]=_[_0x9276('0x41')](_0x136a08[_0x9276('0x3e')],{'$or':_[_0x9276('0x34')](_0x136a08['attributes'],function(_0x4c2353){var _0x4bcdea={};_0x4bcdea[_0x4c2353]={'$like':'%'+_0x473b93[_0x9276('0x36')][_0x9276('0x40')]+'%'};return _0x4bcdea;})});}_0x136a08=_[_0x9276('0x41')]({},_0x136a08,_0x473b93[_0x9276('0x44')]);return db[_0x9276('0x56')]['findAll'](_0x136a08);}})[_0x9276('0x26')](function(_0x2b9213){if(_0x2b9213){return db[_0x9276('0x5a')][_0x9276('0x5b')]({'where':{'id':_['map'](_0x2b9213,_0x9276('0x5c')),'role':_0x9276('0x5d')},'attributes':['id','name',_0x9276('0x5e'),'updatedAt','createdAt']});}})[_0x9276('0x26')](function(_0x27784b){if(_0x27784b){return{'count':_0x27784b[_0x9276('0x1f')],'rows':_[_0x9276('0x34')](_0x27784b[_0x9276('0x5f')],function(_0x5a21fc){return{'membername':_0x5a21fc[_0x9276('0x2e')],'UserId':_0x5a21fc['id'],'queue_name':_0x2aae5c['name'],'MailQueueId':_0x2aae5c['id'],'interface':util[_0x9276('0x60')]('%s/%s','SIP',_0x5a21fc[_0x9276('0x2e')]),'penalty':0x0,'paused':_0x5a21fc[_0x9276('0x5e')],'createdAt':_0x5a21fc['createdAt'],'updatedAt':_0x5a21fc['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9276('0x26')](respondWithFilteredResult(_0xd85fb7,_0x136a08))['catch'](handleError(_0xd85fb7,null));};exports[_0x9276('0x61')]=function(_0x11d30f,_0x4020d1,_0xc6f4be){var _0x932c76={};var _0x29be78={};var _0x147284;var _0x4c0f6d;return db[_0x9276('0x30')][_0x9276('0x62')]({'where':{'id':_0x11d30f[_0x9276('0x53')]['id']}})[_0x9276('0x26')](handleEntityNotFound(_0x4020d1,null))[_0x9276('0x26')](function(_0x4faf4a){if(_0x4faf4a){_0x147284=_0x4faf4a;_0x29be78['model']=_['keys'](db[_0x9276('0x63')][_0x9276('0x31')]);_0x29be78[_0x9276('0x36')]=_[_0x9276('0x35')](_0x11d30f['query']);_0x29be78[_0x9276('0x37')]=_[_0x9276('0x38')](_0x29be78[_0x9276('0x33')],_0x29be78['query']);_0x932c76[_0x9276('0x39')]=_[_0x9276('0x38')](_0x29be78[_0x9276('0x33')],qs[_0x9276('0x3a')](_0x11d30f[_0x9276('0x36')][_0x9276('0x3a')]));_0x932c76[_0x9276('0x39')]=_0x932c76['attributes']['length']?_0x932c76[_0x9276('0x39')]:_0x29be78[_0x9276('0x33')];_0x932c76[_0x9276('0x3d')]=qs['sort'](_0x11d30f[_0x9276('0x36')][_0x9276('0x58')]);_0x932c76[_0x9276('0x3e')]=qs[_0x9276('0x37')](_[_0x9276('0x3f')](_0x11d30f[_0x9276('0x36')],_0x29be78['filters']));if(_0x11d30f[_0x9276('0x36')][_0x9276('0x40')]){_0x932c76[_0x9276('0x3e')]=_[_0x9276('0x41')](_0x932c76['where'],{'$or':_[_0x9276('0x34')](_0x932c76[_0x9276('0x39')],function(_0x28ee38){var _0x1eff3e={};_0x1eff3e[_0x28ee38]={'$like':'%'+_0x11d30f[_0x9276('0x36')][_0x9276('0x40')]+'%'};return _0x1eff3e;})});}_0x932c76=_['merge']({},_0x932c76,_0x11d30f[_0x9276('0x44')]);return _0x147284[_0x9276('0x61')](_0x932c76);}})[_0x9276('0x26')](function(_0x3f4cf9){if(_0x3f4cf9){_0x4c0f6d=_0x3f4cf9['length'];if(!_0x11d30f['query'][_0x9276('0x3c')](_0x9276('0x57'))){_0x932c76[_0x9276('0x20')]=qs[_0x9276('0x20')](_0x11d30f[_0x9276('0x36')][_0x9276('0x20')]);_0x932c76[_0x9276('0x1d')]=qs[_0x9276('0x1d')](_0x11d30f[_0x9276('0x36')][_0x9276('0x1d')]);}return _0x147284['getTeams'](_0x932c76);}})[_0x9276('0x26')](function(_0x46a21d){if(_0x46a21d){return _0x46a21d?{'count':_0x4c0f6d,'rows':_0x46a21d}:null;}})[_0x9276('0x26')](respondWithResult(_0x4020d1,null))[_0x9276('0x47')](handleError(_0x4020d1,null));};exports[_0x9276('0x64')]=function(_0x31269f,_0x548fce,_0x3cacd2){var _0x375bd2=_0x31269f[_0x9276('0x4a')]['ids'];return db[_0x9276('0x63')][_0x9276('0x46')]({'where':{'id':_0x375bd2},'attributes':['id'],'include':[{'model':db[_0x9276('0x5a')],'as':'Agents','attributes':['id','name',_0x9276('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x9276('0x26')](function(_0x7e7ce9){if(_0x7e7ce9){var _0xde0cb5=_[_0x9276('0x66')](_0x7e7ce9,function(_0x56dd72){var _0x3d96b4=_0x56dd72['get']({'plain':!![]});return _0x3d96b4['Agents'];});return db[_0x9276('0x30')][_0x9276('0x4f')]({'where':{'id':_0x31269f[_0x9276('0x53')]['id']}})[_0x9276('0x26')](function(_0x312a52){return db[_0x9276('0x67')][_0x9276('0x68')](function(_0x3a987e){return _0x312a52[_0x9276('0x64')](_0x375bd2,{'transaction':_0x3a987e})[_0x9276('0x26')](function(){return BPromise[_0x9276('0x69')](_0xde0cb5,function(_0x282f52){return db[_0x9276('0x56')][_0x9276('0x6a')]({'where':{'UserId':_0x282f52['id'],'MailQueueId':_0x31269f[_0x9276('0x53')]['id']},'transaction':_0x3a987e});});})['then'](function(){_0xde0cb5['forEach'](function(_0x288c5d){socket['emit']('userMailQueue:save',{'UserId':_0x288c5d['id'],'MailQueueId':_0x312a52['id']});});});});});}})[_0x9276('0x26')](respondWithStatusCode(_0x548fce,null))[_0x9276('0x47')](handleError(_0x548fce,null));};exports['removeTeams']=function(_0x7ae331,_0x55e2c4,_0x4caaa7){return db[_0x9276('0x63')]['findAll']({'where':{'id':_0x7ae331['query'][_0x9276('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x9276('0x5a')],'as':_0x9276('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x9276('0x26')](handleEntityNotFound(_0x55e2c4,null))[_0x9276('0x26')](function(_0x1b6adc){var _0x537487=_[_0x9276('0x34')](_0x1b6adc,'id');var _0x10e9fc=[];var _0x35000c=[];var _0x447550=squel['select']();_0x447550[_0x9276('0x6d')](_0x9276('0x6e'))[_0x9276('0x6f')](_0x9276('0x70'),'tq')[_0x9276('0x71')](_0x9276('0x72'),'ut',_0x9276('0x73'))['where'](_0x9276('0x74'),_0x7ae331[_0x9276('0x53')]['id']);for(var _0x20e353=0x0;_0x20e353<_0x1b6adc[_0x9276('0x3b')];_0x20e353+=0x1){let _0x29a22c=_0x1b6adc[_0x20e353];for(var _0x2b9a31=0x0;_0x2b9a31<_0x29a22c['Agents'][_0x9276('0x3b')];_0x2b9a31+=0x1){let _0x495a86=_0x29a22c[_0x9276('0x6c')][_0x2b9a31];var _0x3bbe4c=_0x447550[_0x9276('0x75')]();_0x3bbe4c['where'](_0x9276('0x76'),_0x495a86['id']);_0x35000c[_0x9276('0x77')](db[_0x9276('0x67')]['query'](_0x3bbe4c[_0x9276('0x78')](),{'type':db['sequelize'][_0x9276('0x79')]['SELECT']})[_0x9276('0x26')](function(_0xc4a326){if(_0xc4a326[_0x9276('0x3b')]===0x1){return _0x495a86['id'];}else{var _0xb276d2=_[_0x9276('0x7a')](_[_0x9276('0x34')](_0xc4a326,_0x9276('0x7b')),function(_0x3f13ea){return _[_0x9276('0x7c')](_0x537487,_0x3f13ea);});if(_0xb276d2){return _0x495a86['id'];}}}));}}return BPromise['all'](_0x35000c)[_0x9276('0x26')](function(_0x516e2a){_0x10e9fc=_(_0x10e9fc)[_0x9276('0x7d')](_0x516e2a)[_0x9276('0x7e')]()[_0x9276('0x7f')]();return db[_0x9276('0x30')][_0x9276('0x4f')]({'where':{'id':_0x7ae331[_0x9276('0x53')]['id']}})[_0x9276('0x26')](function(_0x197deb){return db['sequelize']['transaction'](function(_0x2b535e){return _0x197deb['removeTeams'](_0x7ae331[_0x9276('0x36')][_0x9276('0x6b')],{'transaction':_0x2b535e})[_0x9276('0x26')](function(){if(!_['isEmpty'](_0x10e9fc)){return _0x197deb['removeAgents'](_0x10e9fc,{'transaction':_0x2b535e});}})['then'](function(){_0x10e9fc['forEach'](function(_0x93ffc5){socket[_0x9276('0x80')](_0x9276('0x81'),{'UserId':_0x93ffc5,'MailQueueId':_0x197deb['id']});});});});});});})[_0x9276('0x26')](respondWithStatusCode(_0x55e2c4,null))[_0x9276('0x47')](handleError(_0x55e2c4,null));};exports['addAgents']=function(_0x228c4d,_0x10e50e,_0x1900d7){return db[_0x9276('0x30')][_0x9276('0x4f')]({'where':{'id':_0x228c4d['params']['id']}})['then'](handleEntityNotFound(_0x10e50e,null))[_0x9276('0x26')](function(_0x1e3595){if(_0x1e3595){return _0x1e3595[_0x9276('0x82')](_0x228c4d[_0x9276('0x4a')][_0x9276('0x6b')],_[_0x9276('0x83')](_0x228c4d['body'],[_0x9276('0x6b'),'id'])||{})[_0x9276('0x84')](function(_0x4846e8){for(var _0x274ea1=0x0;_0x274ea1<_0x228c4d['body'][_0x9276('0x6b')][_0x9276('0x3b')];_0x274ea1+=0x1){socket[_0x9276('0x80')](_0x9276('0x85'),{'UserId':Number(_0x228c4d[_0x9276('0x4a')][_0x9276('0x6b')][_0x274ea1]),'MailQueueId':Number(_0x228c4d['params']['id'])});}return _0x4846e8;});}})[_0x9276('0x26')](respondWithResult(_0x10e50e,null))[_0x9276('0x47')](handleError(_0x10e50e,null));};exports[_0x9276('0x86')]=function(_0x2dccb7,_0x30738f,_0x5d5726){return db[_0x9276('0x30')][_0x9276('0x4f')]({'where':{'id':_0x2dccb7[_0x9276('0x53')]['id']}})[_0x9276('0x26')](handleEntityNotFound(_0x30738f,null))['then'](function(_0x3c550e){if(_0x3c550e){return _0x3c550e[_0x9276('0x86')](_0x2dccb7[_0x9276('0x36')][_0x9276('0x6b')])[_0x9276('0x26')](function(){if(_[_0x9276('0x87')](_0x2dccb7['query'][_0x9276('0x6b')])){for(var _0x4ffb8f=0x0;_0x4ffb8f<_0x2dccb7['query'][_0x9276('0x6b')][_0x9276('0x3b')];_0x4ffb8f+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x2dccb7[_0x9276('0x36')][_0x9276('0x6b')][_0x4ffb8f]),'MailQueueId':Number(_0x2dccb7[_0x9276('0x53')]['id'])});}}else{socket[_0x9276('0x80')](_0x9276('0x81'),{'UserId':Number(_0x2dccb7[_0x9276('0x36')][_0x9276('0x6b')]),'MailQueueId':Number(_0x2dccb7[_0x9276('0x53')]['id'])});}});}})[_0x9276('0x26')](respondWithStatusCode(_0x30738f,null))[_0x9276('0x47')](handleError(_0x30738f,null));};exports[_0x9276('0x88')]=function(_0x8e9f56,_0x2ab2e2,_0x431e69){var _0x1309c1={};var _0xf184c0={};var _0x4cfcd6;var _0x70f71f;return db['MailQueue'][_0x9276('0x62')]({'where':{'id':_0x8e9f56[_0x9276('0x53')]['id']}})[_0x9276('0x26')](handleEntityNotFound(_0x2ab2e2,null))[_0x9276('0x26')](function(_0xf8be65){if(_0xf8be65){_0x4cfcd6=_0xf8be65;_0xf184c0[_0x9276('0x33')]=_['keys'](db['User'][_0x9276('0x31')]);_0xf184c0[_0x9276('0x36')]=_[_0x9276('0x35')](_0x8e9f56[_0x9276('0x36')]);_0xf184c0[_0x9276('0x37')]=_[_0x9276('0x38')](_0xf184c0[_0x9276('0x33')],_0xf184c0[_0x9276('0x36')]);_0x1309c1[_0x9276('0x39')]=_[_0x9276('0x38')](_0xf184c0[_0x9276('0x33')],qs[_0x9276('0x3a')](_0x8e9f56[_0x9276('0x36')]['fields']));_0x1309c1[_0x9276('0x39')]=_0x1309c1['attributes'][_0x9276('0x3b')]?_0x1309c1[_0x9276('0x39')]:_0xf184c0[_0x9276('0x33')];_0x1309c1['order']=qs[_0x9276('0x58')](_0x8e9f56[_0x9276('0x36')][_0x9276('0x58')]);_0x1309c1[_0x9276('0x3e')]=qs[_0x9276('0x37')](_[_0x9276('0x3f')](_0x8e9f56[_0x9276('0x36')],_0xf184c0[_0x9276('0x37')]));if(_0x8e9f56[_0x9276('0x36')][_0x9276('0x40')]){_0x1309c1[_0x9276('0x3e')]=_[_0x9276('0x41')](_0x1309c1[_0x9276('0x3e')],{'$or':_['map'](_0x1309c1[_0x9276('0x39')],function(_0x4e5b3e){var _0x50388a={};_0x50388a[_0x4e5b3e]={'$like':'%'+_0x8e9f56[_0x9276('0x36')]['filter']+'%'};return _0x50388a;})});}_0x1309c1=_[_0x9276('0x41')]({},_0x1309c1,_0x8e9f56[_0x9276('0x44')]);return _0x4cfcd6[_0x9276('0x88')](_0x1309c1);}})[_0x9276('0x26')](function(_0xfca991){if(_0xfca991){_0x70f71f=_0xfca991[_0x9276('0x3b')];if(!_0x8e9f56['query']['hasOwnProperty']('nolimit')){_0x1309c1['limit']=qs[_0x9276('0x20')](_0x8e9f56[_0x9276('0x36')]['limit']);_0x1309c1[_0x9276('0x1d')]=qs[_0x9276('0x1d')](_0x8e9f56['query'][_0x9276('0x1d')]);}return _0x4cfcd6[_0x9276('0x88')](_0x1309c1);}})[_0x9276('0x26')](function(_0x271a3b){if(_0x271a3b){return _0x271a3b?{'count':_0x70f71f,'rows':_0x271a3b}:null;}})[_0x9276('0x26')](respondWithResult(_0x2ab2e2,null))['catch'](handleError(_0x2ab2e2,null));}; \ No newline at end of file +var _0x0e35=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserMailQueue','length','order','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','all','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','userMailQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./mailQueue.socket','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','MailQueues','end','stack','name','send','index','map','MailQueue','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','merge','find','create'];(function(_0x35e300,_0x5a661b){var _0x34ffa7=function(_0x31b18e){while(--_0x31b18e){_0x35e300['push'](_0x35e300['shift']());}};_0x34ffa7(++_0x5a661b);}(_0x0e35,0xc2));var _0x50e3=function(_0x1b263e,_0x34ab13){_0x1b263e=_0x1b263e-0x0;var _0x2ac691=_0x0e35[_0x1b263e];return _0x2ac691;};'use strict';var emlformat=require(_0x50e3('0x0'));var rimraf=require(_0x50e3('0x1'));var zipdir=require(_0x50e3('0x2'));var jsonpatch=require(_0x50e3('0x3'));var rp=require(_0x50e3('0x4'));var moment=require(_0x50e3('0x5'));var BPromise=require(_0x50e3('0x6'));var Mustache=require(_0x50e3('0x7'));var util=require(_0x50e3('0x8'));var path=require(_0x50e3('0x9'));var sox=require('sox');var csv=require(_0x50e3('0xa'));var ejs=require(_0x50e3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x50e3('0xc'));var crypto=require(_0x50e3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50e3('0xa'));var querystring=require(_0x50e3('0xe'));var Papa=require(_0x50e3('0xf'));var Redis=require(_0x50e3('0x10'));var authService=require(_0x50e3('0x11'));var qs=require(_0x50e3('0x12'));var as=require(_0x50e3('0x13'));var hardwareService=require(_0x50e3('0x14'));var logger=require(_0x50e3('0x15'))(_0x50e3('0x16'));var utils=require(_0x50e3('0x17'));var config=require(_0x50e3('0x18'));var licenseUtil=require(_0x50e3('0x19'));var db=require('../../mysqldb')['db'];config[_0x50e3('0x1a')]=_[_0x50e3('0x1b')](config[_0x50e3('0x1a')],{'host':_0x50e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x50e3('0x1a')]));require(_0x50e3('0x1d'))['register'](socket);function respondWithStatusCode(_0x43bb4d,_0x3f7cfa){_0x3f7cfa=_0x3f7cfa||0xcc;return function(_0x4b5ed5){if(_0x4b5ed5){return _0x43bb4d[_0x50e3('0x1e')](_0x3f7cfa);}return _0x43bb4d[_0x50e3('0x1f')](_0x3f7cfa)['end']();};}function respondWithResult(_0x2aff1c,_0x5f44e1){_0x5f44e1=_0x5f44e1||0xc8;return function(_0x411267){if(_0x411267){return _0x2aff1c[_0x50e3('0x1f')](_0x5f44e1)[_0x50e3('0x20')](_0x411267);}};}function respondWithFilteredResult(_0x4b1b85,_0x447a60){return function(_0x2d25e6){if(_0x2d25e6){var _0x1b4279=typeof _0x447a60[_0x50e3('0x21')]==='undefined'&&typeof _0x447a60['limit']===_0x50e3('0x22');var _0x5d002b=_0x2d25e6[_0x50e3('0x23')];var _0xcab60a=_0x1b4279?0x0:_0x447a60['offset'];var _0x4d20b1=_0x1b4279?_0x2d25e6[_0x50e3('0x23')]:_0x447a60[_0x50e3('0x21')]+_0x447a60['limit'];var _0x3444e3;if(_0x4d20b1>=_0x5d002b){_0x4d20b1=_0x5d002b;_0x3444e3=0xc8;}else{_0x3444e3=0xce;}_0x4b1b85[_0x50e3('0x1f')](_0x3444e3);return _0x4b1b85[_0x50e3('0x24')](_0x50e3('0x25'),_0xcab60a+'-'+_0x4d20b1+'/'+_0x5d002b)[_0x50e3('0x20')](_0x2d25e6);}return null;};}function patchUpdates(_0x164e11){return function(_0x499b07){try{jsonpatch[_0x50e3('0x26')](_0x499b07,_0x164e11,!![]);}catch(_0x40a78c){return BPromise[_0x50e3('0x27')](_0x40a78c);}return _0x499b07[_0x50e3('0x28')]();};}function saveUpdates(_0x34c68c,_0x283459){return function(_0x3c2e05){if(_0x3c2e05){return _0x3c2e05[_0x50e3('0x29')](_0x34c68c)['then'](function(_0x1b5d10){return _0x1b5d10;});}return null;};}function removeEntity(_0x576c7c,_0x14c06c){return function(_0x15bf54){if(_0x15bf54){return _0x15bf54[_0x50e3('0x2a')]()[_0x50e3('0x2b')](function(){var _0x1162f1=_0x15bf54['get']({'plain':!![]});var _0x5af9a4=_0x50e3('0x2c');return db['UserProfileResource'][_0x50e3('0x2a')]({'where':{'type':_0x5af9a4,'resourceId':_0x1162f1['id']}})['then'](function(){return _0x15bf54;});})['then'](function(){_0x576c7c['status'](0xcc)[_0x50e3('0x2d')]();});}};}function handleEntityNotFound(_0x169fd7,_0x426b1d){return function(_0x131fa2){if(!_0x131fa2){_0x169fd7[_0x50e3('0x1e')](0x194);}return _0x131fa2;};}function handleError(_0x23a5f4,_0x8b7e30){_0x8b7e30=_0x8b7e30||0x1f4;return function(_0x2a028b){logger['error'](_0x2a028b[_0x50e3('0x2e')]);if(_0x2a028b[_0x50e3('0x2f')]){delete _0x2a028b[_0x50e3('0x2f')];}_0x23a5f4['status'](_0x8b7e30)[_0x50e3('0x30')](_0x2a028b);};}exports[_0x50e3('0x31')]=function(_0x412d48,_0x501574){var _0x21c561={},_0x1b34ca={},_0x5c602d={'count':0x0,'rows':[]};var _0x3ac5d0=_[_0x50e3('0x32')](db[_0x50e3('0x33')]['rawAttributes'],function(_0x27a272){return{'name':_0x27a272[_0x50e3('0x34')],'type':_0x27a272[_0x50e3('0x35')][_0x50e3('0x36')]};});_0x1b34ca[_0x50e3('0x37')]=_[_0x50e3('0x32')](_0x3ac5d0,'name');_0x1b34ca[_0x50e3('0x38')]=_[_0x50e3('0x39')](_0x412d48[_0x50e3('0x38')]);_0x1b34ca['filters']=_[_0x50e3('0x3a')](_0x1b34ca[_0x50e3('0x37')],_0x1b34ca['query']);_0x21c561[_0x50e3('0x3b')]=_['intersection'](_0x1b34ca[_0x50e3('0x37')],qs['fields'](_0x412d48[_0x50e3('0x38')]['fields']));_0x21c561[_0x50e3('0x3b')]=_0x21c561['attributes']['length']?_0x21c561[_0x50e3('0x3b')]:_0x1b34ca['model'];if(!_0x412d48[_0x50e3('0x38')][_0x50e3('0x3c')](_0x50e3('0x3d'))){_0x21c561[_0x50e3('0x3e')]=qs[_0x50e3('0x3e')](_0x412d48[_0x50e3('0x38')][_0x50e3('0x3e')]);_0x21c561[_0x50e3('0x21')]=qs['offset'](_0x412d48[_0x50e3('0x38')][_0x50e3('0x21')]);}_0x21c561['order']=qs[_0x50e3('0x3f')](_0x412d48[_0x50e3('0x38')]['sort']);_0x21c561[_0x50e3('0x40')]=qs[_0x50e3('0x41')](_[_0x50e3('0x42')](_0x412d48[_0x50e3('0x38')],_0x1b34ca['filters']),_0x3ac5d0);if(_0x412d48['query'][_0x50e3('0x43')]){_0x21c561['where']=_['merge'](_0x21c561[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0x3ac5d0,function(_0xae1d1d){if(_0xae1d1d['type']!==_0x50e3('0x44')){var _0x34c288={};_0x34c288[_0xae1d1d[_0x50e3('0x2f')]]={'$like':'%'+_0x412d48[_0x50e3('0x38')]['filter']+'%'};return _0x34c288;}})});}_0x21c561=_['merge']({},_0x21c561,_0x412d48[_0x50e3('0x45')]);var _0x1716de={'where':_0x21c561[_0x50e3('0x40')]};return db[_0x50e3('0x33')]['count'](_0x1716de)['then'](function(_0x959df6){_0x5c602d[_0x50e3('0x23')]=_0x959df6;if(_0x412d48[_0x50e3('0x38')][_0x50e3('0x46')]){_0x21c561[_0x50e3('0x47')]=[{'all':!![]}];}return db[_0x50e3('0x33')][_0x50e3('0x48')](_0x21c561);})[_0x50e3('0x2b')](function(_0x39258c){_0x5c602d[_0x50e3('0x49')]=_0x39258c;return _0x5c602d;})[_0x50e3('0x2b')](respondWithFilteredResult(_0x501574,_0x21c561))[_0x50e3('0x4a')](handleError(_0x501574,null));};exports[_0x50e3('0x4b')]=function(_0x521940,_0x45a1b3){var _0x3bdba3={'raw':!![],'where':{'id':_0x521940[_0x50e3('0x4c')]['id']}},_0x3850e2={};_0x3850e2['model']=_[_0x50e3('0x39')](db[_0x50e3('0x33')][_0x50e3('0x4d')]);_0x3850e2['query']=_[_0x50e3('0x39')](_0x521940[_0x50e3('0x38')]);_0x3850e2['filters']=_[_0x50e3('0x3a')](_0x3850e2[_0x50e3('0x37')],_0x3850e2[_0x50e3('0x38')]);_0x3bdba3[_0x50e3('0x3b')]=_[_0x50e3('0x3a')](_0x3850e2[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x521940[_0x50e3('0x38')][_0x50e3('0x4e')]));_0x3bdba3[_0x50e3('0x3b')]=_0x3bdba3[_0x50e3('0x3b')]['length']?_0x3bdba3[_0x50e3('0x3b')]:_0x3850e2[_0x50e3('0x37')];if(_0x521940[_0x50e3('0x38')][_0x50e3('0x46')]){_0x3bdba3[_0x50e3('0x47')]=[{'all':!![]}];}_0x3bdba3=_[_0x50e3('0x4f')]({},_0x3bdba3,_0x521940[_0x50e3('0x45')]);return db[_0x50e3('0x33')][_0x50e3('0x50')](_0x3bdba3)[_0x50e3('0x2b')](handleEntityNotFound(_0x45a1b3,null))['then'](respondWithResult(_0x45a1b3,null))[_0x50e3('0x4a')](handleError(_0x45a1b3,null));};exports[_0x50e3('0x51')]=function(_0x479a12,_0x2d9f33){return db['MailQueue'][_0x50e3('0x51')](_0x479a12[_0x50e3('0x52')],{})[_0x50e3('0x2b')](function(_0x22a12e){var _0x6a14cf=_0x479a12['user']['get']({'plain':!![]});if(!_0x6a14cf)throw new Error(_0x50e3('0x53'));if(_0x6a14cf[_0x50e3('0x54')]==='user'){var _0x125350=_0x22a12e[_0x50e3('0x55')]({'plain':!![]});var _0x77ae2=_0x50e3('0x2c');return db['UserProfileSection'][_0x50e3('0x50')]({'where':{'name':_0x77ae2,'userProfileId':_0x6a14cf['userProfileId']},'raw':!![]})[_0x50e3('0x2b')](function(_0x58a81a){if(_0x58a81a&&_0x58a81a[_0x50e3('0x56')]===0x0){return db[_0x50e3('0x57')][_0x50e3('0x51')]({'name':_0x125350[_0x50e3('0x2f')],'resourceId':_0x125350['id'],'type':_0x58a81a[_0x50e3('0x2f')],'sectionId':_0x58a81a['id']},{})[_0x50e3('0x2b')](function(){return _0x22a12e;});}else{return _0x22a12e;}})[_0x50e3('0x4a')](function(_0x469667){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x469667);throw _0x469667;});}return _0x22a12e;})[_0x50e3('0x2b')](respondWithResult(_0x2d9f33,0xc9))['catch'](handleError(_0x2d9f33,null));};exports[_0x50e3('0x29')]=function(_0x7d7c33,_0x3e8790){if(_0x7d7c33['body']['id']){delete _0x7d7c33[_0x50e3('0x52')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x7d7c33['params']['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x3e8790,null))[_0x50e3('0x2b')](saveUpdates(_0x7d7c33[_0x50e3('0x52')],null))['then'](respondWithResult(_0x3e8790,null))[_0x50e3('0x4a')](handleError(_0x3e8790,null));};exports['destroy']=function(_0x5c9a19,_0x180c25){return db[_0x50e3('0x33')]['find']({'where':{'id':_0x5c9a19[_0x50e3('0x4c')]['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x180c25,null))[_0x50e3('0x2b')](removeEntity(_0x180c25,null))[_0x50e3('0x4a')](handleError(_0x180c25,null));};exports[_0x50e3('0x58')]=function(_0xc17f69,_0x32186f){return db[_0x50e3('0x33')][_0x50e3('0x58')]()[_0x50e3('0x2b')](respondWithResult(_0x32186f,null))[_0x50e3('0x4a')](handleError(_0x32186f,null));};exports[_0x50e3('0x59')]=function(_0x48c947,_0x10ad46,_0x5090b8){var _0xe812={'raw':!![],'where':{}},_0x113800={},_0x4a90b8;return db[_0x50e3('0x33')][_0x50e3('0x5a')]({'where':{'id':_0x48c947[_0x50e3('0x4c')]['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x10ad46,null))[_0x50e3('0x2b')](function(_0x1c38f4){if(_0x1c38f4){_0x4a90b8=_0x1c38f4[_0x50e3('0x55')]({'plain':!![]});_0x113800[_0x50e3('0x37')]=_[_0x50e3('0x39')](db[_0x50e3('0x5b')]['rawAttributes']);_0x113800['query']=_[_0x50e3('0x39')](_0x48c947[_0x50e3('0x38')]);_0x113800[_0x50e3('0x41')]=_[_0x50e3('0x3a')](_0x113800[_0x50e3('0x37')],_0x113800['query']);_0xe812[_0x50e3('0x3b')]=_[_0x50e3('0x3a')](_0x113800[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x48c947[_0x50e3('0x38')][_0x50e3('0x4e')]));_0xe812[_0x50e3('0x3b')]=_0xe812[_0x50e3('0x3b')][_0x50e3('0x5c')]?_0xe812['attributes']:_0x113800[_0x50e3('0x37')];if(!_0x48c947['query']['hasOwnProperty'](_0x50e3('0x3d'))){_0xe812[_0x50e3('0x3e')]=qs[_0x50e3('0x3e')](_0x48c947[_0x50e3('0x38')][_0x50e3('0x3e')]);_0xe812[_0x50e3('0x21')]=qs[_0x50e3('0x21')](_0x48c947['query'][_0x50e3('0x21')]);}_0xe812[_0x50e3('0x5d')]=qs[_0x50e3('0x3f')](_0x48c947[_0x50e3('0x38')][_0x50e3('0x3f')]);_0xe812[_0x50e3('0x40')]=qs['filters'](_['pick'](_0x48c947[_0x50e3('0x38')],_0x113800['filters']));_0xe812[_0x50e3('0x40')][_0x50e3('0x5e')]=_0x1c38f4['id'];if(_0x48c947['query'][_0x50e3('0x43')]){_0xe812[_0x50e3('0x40')]=_['merge'](_0xe812[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0xe812['attributes'],function(_0x2e68f6){var _0x47d559={};_0x47d559[_0x2e68f6]={'$like':'%'+_0x48c947[_0x50e3('0x38')][_0x50e3('0x43')]+'%'};return _0x47d559;})});}_0xe812=_[_0x50e3('0x4f')]({},_0xe812,_0x48c947[_0x50e3('0x45')]);return db['UserMailQueue']['findAll'](_0xe812);}})['then'](function(_0xce5f5f){if(_0xce5f5f){return db[_0x50e3('0x5f')][_0x50e3('0x60')]({'where':{'id':_['map'](_0xce5f5f,_0x50e3('0x61')),'role':'agent'},'attributes':['id','name',_0x50e3('0x62'),_0x50e3('0x63'),_0x50e3('0x64')]});}})[_0x50e3('0x2b')](function(_0x581587){if(_0x581587){return{'count':_0x581587[_0x50e3('0x23')],'rows':_[_0x50e3('0x32')](_0x581587[_0x50e3('0x49')],function(_0x7b61af){return{'membername':_0x7b61af[_0x50e3('0x2f')],'UserId':_0x7b61af['id'],'queue_name':_0x4a90b8[_0x50e3('0x2f')],'MailQueueId':_0x4a90b8['id'],'interface':util[_0x50e3('0x65')]('%s/%s',_0x50e3('0x66'),_0x7b61af[_0x50e3('0x2f')]),'penalty':0x0,'paused':_0x7b61af['mailPause'],'createdAt':_0x7b61af[_0x50e3('0x64')],'updatedAt':_0x7b61af[_0x50e3('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x50e3('0x2b')](respondWithFilteredResult(_0x10ad46,_0xe812))['catch'](handleError(_0x10ad46,null));};exports[_0x50e3('0x67')]=function(_0x5aa1e8,_0x5d4db3,_0x47fd9c){var _0x98b346={};var _0x31689f={};var _0x4adf3d;var _0x14f57d;return db[_0x50e3('0x33')]['findOne']({'where':{'id':_0x5aa1e8['params']['id']}})['then'](handleEntityNotFound(_0x5d4db3,null))[_0x50e3('0x2b')](function(_0x3670dc){if(_0x3670dc){_0x4adf3d=_0x3670dc;_0x31689f['model']=_[_0x50e3('0x39')](db[_0x50e3('0x68')][_0x50e3('0x4d')]);_0x31689f[_0x50e3('0x38')]=_['keys'](_0x5aa1e8['query']);_0x31689f[_0x50e3('0x41')]=_['intersection'](_0x31689f[_0x50e3('0x37')],_0x31689f[_0x50e3('0x38')]);_0x98b346[_0x50e3('0x3b')]=_[_0x50e3('0x3a')](_0x31689f[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x5aa1e8[_0x50e3('0x38')]['fields']));_0x98b346['attributes']=_0x98b346[_0x50e3('0x3b')][_0x50e3('0x5c')]?_0x98b346[_0x50e3('0x3b')]:_0x31689f[_0x50e3('0x37')];_0x98b346[_0x50e3('0x5d')]=qs['sort'](_0x5aa1e8[_0x50e3('0x38')][_0x50e3('0x3f')]);_0x98b346[_0x50e3('0x40')]=qs['filters'](_['pick'](_0x5aa1e8[_0x50e3('0x38')],_0x31689f[_0x50e3('0x41')]));if(_0x5aa1e8['query'][_0x50e3('0x43')]){_0x98b346[_0x50e3('0x40')]=_[_0x50e3('0x4f')](_0x98b346[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0x98b346[_0x50e3('0x3b')],function(_0x4caf37){var _0x30808e={};_0x30808e[_0x4caf37]={'$like':'%'+_0x5aa1e8[_0x50e3('0x38')][_0x50e3('0x43')]+'%'};return _0x30808e;})});}_0x98b346=_['merge']({},_0x98b346,_0x5aa1e8['options']);return _0x4adf3d[_0x50e3('0x67')](_0x98b346);}})[_0x50e3('0x2b')](function(_0x254c2d){if(_0x254c2d){_0x14f57d=_0x254c2d[_0x50e3('0x5c')];if(!_0x5aa1e8[_0x50e3('0x38')][_0x50e3('0x3c')](_0x50e3('0x3d'))){_0x98b346['limit']=qs['limit'](_0x5aa1e8[_0x50e3('0x38')]['limit']);_0x98b346[_0x50e3('0x21')]=qs['offset'](_0x5aa1e8[_0x50e3('0x38')]['offset']);}return _0x4adf3d['getTeams'](_0x98b346);}})[_0x50e3('0x2b')](function(_0x4cdbcc){if(_0x4cdbcc){return _0x4cdbcc?{'count':_0x14f57d,'rows':_0x4cdbcc}:null;}})['then'](respondWithResult(_0x5d4db3,null))[_0x50e3('0x4a')](handleError(_0x5d4db3,null));};exports[_0x50e3('0x69')]=function(_0x1a2d96,_0x4d14f9,_0x5910fc){var _0x29b8d7=_0x1a2d96[_0x50e3('0x52')][_0x50e3('0x6a')];return db['Team'][_0x50e3('0x48')]({'where':{'id':_0x29b8d7},'attributes':['id'],'include':[{'model':db[_0x50e3('0x5f')],'as':'Agents','attributes':['id',_0x50e3('0x2f'),_0x50e3('0x6b'),_0x50e3('0x6c'),_0x50e3('0x6d')],'raw':!![]}]})['then'](function(_0x448140){if(_0x448140){var _0x800a41=_[_0x50e3('0x6e')](_0x448140,function(_0x2b8bda){var _0x13f2e7=_0x2b8bda[_0x50e3('0x55')]({'plain':!![]});return _0x13f2e7['Agents'];});return db[_0x50e3('0x33')][_0x50e3('0x50')]({'where':{'id':_0x1a2d96[_0x50e3('0x4c')]['id']}})['then'](function(_0x21da99){return db[_0x50e3('0x6f')][_0x50e3('0x70')](function(_0x461af0){return _0x21da99['addTeams'](_0x29b8d7,{'transaction':_0x461af0})[_0x50e3('0x2b')](function(){return BPromise[_0x50e3('0x71')](_0x800a41,function(_0x522b5d){return db[_0x50e3('0x5b')]['findOrCreate']({'where':{'UserId':_0x522b5d['id'],'MailQueueId':_0x1a2d96[_0x50e3('0x4c')]['id']},'transaction':_0x461af0});});})[_0x50e3('0x2b')](function(){_0x800a41[_0x50e3('0x72')](function(_0x2d1b04){socket[_0x50e3('0x73')]('userMailQueue:save',{'UserId':_0x2d1b04['id'],'MailQueueId':_0x21da99['id']});});});});});}})[_0x50e3('0x2b')](respondWithStatusCode(_0x4d14f9,null))[_0x50e3('0x4a')](handleError(_0x4d14f9,null));};exports[_0x50e3('0x74')]=function(_0x3b30e9,_0x411c40,_0x269eaf){return db[_0x50e3('0x68')][_0x50e3('0x48')]({'where':{'id':_0x3b30e9['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x50e3('0x75'),'attributes':['id'],'raw':!![]}]})[_0x50e3('0x2b')](handleEntityNotFound(_0x411c40,null))[_0x50e3('0x2b')](function(_0x271b1f){var _0x3f59bd=_[_0x50e3('0x32')](_0x271b1f,'id');var _0x56d0f7=[];var _0x510aa7=[];var _0x229885=squel[_0x50e3('0x76')]();_0x229885[_0x50e3('0x77')](_0x50e3('0x78'))[_0x50e3('0x79')](_0x50e3('0x7a'),'tq')['join'](_0x50e3('0x7b'),'ut',_0x50e3('0x7c'))[_0x50e3('0x40')]('MailQueueId\x20=\x20?',_0x3b30e9[_0x50e3('0x4c')]['id']);for(var _0x46e64b=0x0;_0x46e64b<_0x271b1f[_0x50e3('0x5c')];_0x46e64b+=0x1){let _0x35891a=_0x271b1f[_0x46e64b];for(var _0x3b298b=0x0;_0x3b298b<_0x35891a[_0x50e3('0x75')]['length'];_0x3b298b+=0x1){let _0xeb35b9=_0x35891a[_0x50e3('0x75')][_0x3b298b];var _0x487e87=_0x229885['clone']();_0x487e87[_0x50e3('0x40')]('ut.UserId\x20=\x20?',_0xeb35b9['id']);_0x510aa7[_0x50e3('0x7d')](db[_0x50e3('0x6f')]['query'](_0x487e87[_0x50e3('0x7e')](),{'type':db[_0x50e3('0x6f')]['QueryTypes'][_0x50e3('0x7f')]})[_0x50e3('0x2b')](function(_0x369cc8){if(_0x369cc8[_0x50e3('0x5c')]===0x1){return _0xeb35b9['id'];}else{var _0x101029=_['every'](_['map'](_0x369cc8,'TeamId'),function(_0x1b9404){return _['includes'](_0x3f59bd,_0x1b9404);});if(_0x101029){return _0xeb35b9['id'];}}}));}}return BPromise[_0x50e3('0x80')](_0x510aa7)[_0x50e3('0x2b')](function(_0x474b75){_0x56d0f7=_(_0x56d0f7)['union'](_0x474b75)[_0x50e3('0x81')]()[_0x50e3('0x82')]();return db[_0x50e3('0x33')][_0x50e3('0x50')]({'where':{'id':_0x3b30e9[_0x50e3('0x4c')]['id']}})[_0x50e3('0x2b')](function(_0x3f6d6c){return db[_0x50e3('0x6f')][_0x50e3('0x70')](function(_0x2e6be2){return _0x3f6d6c[_0x50e3('0x74')](_0x3b30e9['query'][_0x50e3('0x6a')],{'transaction':_0x2e6be2})[_0x50e3('0x2b')](function(){if(!_[_0x50e3('0x83')](_0x56d0f7)){return _0x3f6d6c[_0x50e3('0x84')](_0x56d0f7,{'transaction':_0x2e6be2});}})[_0x50e3('0x2b')](function(){_0x56d0f7[_0x50e3('0x72')](function(_0x534987){socket[_0x50e3('0x73')](_0x50e3('0x85'),{'UserId':_0x534987,'MailQueueId':_0x3f6d6c['id']});});});});});});})['then'](respondWithStatusCode(_0x411c40,null))[_0x50e3('0x4a')](handleError(_0x411c40,null));};exports['addAgents']=function(_0x569272,_0x37a43d,_0x195da5){return db[_0x50e3('0x33')][_0x50e3('0x50')]({'where':{'id':_0x569272['params']['id']}})[_0x50e3('0x2b')](handleEntityNotFound(_0x37a43d,null))[_0x50e3('0x2b')](function(_0x41f6fe){if(_0x41f6fe){return _0x41f6fe[_0x50e3('0x86')](_0x569272[_0x50e3('0x52')]['ids'],_['omit'](_0x569272[_0x50e3('0x52')],[_0x50e3('0x6a'),'id'])||{})[_0x50e3('0x87')](function(_0x31d103){for(var _0xc49655=0x0;_0xc49655<_0x569272['body'][_0x50e3('0x6a')][_0x50e3('0x5c')];_0xc49655+=0x1){socket[_0x50e3('0x73')](_0x50e3('0x88'),{'UserId':Number(_0x569272['body'][_0x50e3('0x6a')][_0xc49655]),'MailQueueId':Number(_0x569272[_0x50e3('0x4c')]['id'])});}return _0x31d103;});}})[_0x50e3('0x2b')](respondWithResult(_0x37a43d,null))['catch'](handleError(_0x37a43d,null));};exports[_0x50e3('0x84')]=function(_0xc39894,_0x43414e,_0x33c1a4){return db['MailQueue'][_0x50e3('0x50')]({'where':{'id':_0xc39894[_0x50e3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x43414e,null))[_0x50e3('0x2b')](function(_0x1af26c){if(_0x1af26c){return _0x1af26c[_0x50e3('0x84')](_0xc39894['query']['ids'])[_0x50e3('0x2b')](function(){if(_['isArray'](_0xc39894[_0x50e3('0x38')][_0x50e3('0x6a')])){for(var _0x302f06=0x0;_0x302f06<_0xc39894[_0x50e3('0x38')][_0x50e3('0x6a')][_0x50e3('0x5c')];_0x302f06+=0x1){socket[_0x50e3('0x73')](_0x50e3('0x85'),{'UserId':Number(_0xc39894[_0x50e3('0x38')][_0x50e3('0x6a')][_0x302f06]),'MailQueueId':Number(_0xc39894[_0x50e3('0x4c')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0xc39894['query']['ids']),'MailQueueId':Number(_0xc39894[_0x50e3('0x4c')]['id'])});}});}})[_0x50e3('0x2b')](respondWithStatusCode(_0x43414e,null))[_0x50e3('0x4a')](handleError(_0x43414e,null));};exports['getAgents']=function(_0x49c34b,_0x3879e4,_0x39cbc7){var _0x3ef60f={};var _0x13f0dd={};var _0x5c60e4;var _0x200cd9;return db[_0x50e3('0x33')]['findOne']({'where':{'id':_0x49c34b[_0x50e3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3879e4,null))[_0x50e3('0x2b')](function(_0x51d6eb){if(_0x51d6eb){_0x5c60e4=_0x51d6eb;_0x13f0dd['model']=_[_0x50e3('0x39')](db[_0x50e3('0x5f')]['rawAttributes']);_0x13f0dd['query']=_['keys'](_0x49c34b[_0x50e3('0x38')]);_0x13f0dd['filters']=_[_0x50e3('0x3a')](_0x13f0dd[_0x50e3('0x37')],_0x13f0dd[_0x50e3('0x38')]);_0x3ef60f['attributes']=_['intersection'](_0x13f0dd[_0x50e3('0x37')],qs[_0x50e3('0x4e')](_0x49c34b['query'][_0x50e3('0x4e')]));_0x3ef60f[_0x50e3('0x3b')]=_0x3ef60f['attributes'][_0x50e3('0x5c')]?_0x3ef60f[_0x50e3('0x3b')]:_0x13f0dd[_0x50e3('0x37')];_0x3ef60f[_0x50e3('0x5d')]=qs[_0x50e3('0x3f')](_0x49c34b['query']['sort']);_0x3ef60f['where']=qs['filters'](_[_0x50e3('0x42')](_0x49c34b[_0x50e3('0x38')],_0x13f0dd[_0x50e3('0x41')]));if(_0x49c34b[_0x50e3('0x38')][_0x50e3('0x43')]){_0x3ef60f[_0x50e3('0x40')]=_[_0x50e3('0x4f')](_0x3ef60f[_0x50e3('0x40')],{'$or':_[_0x50e3('0x32')](_0x3ef60f[_0x50e3('0x3b')],function(_0x28cbb9){var _0x13dd50={};_0x13dd50[_0x28cbb9]={'$like':'%'+_0x49c34b['query'][_0x50e3('0x43')]+'%'};return _0x13dd50;})});}_0x3ef60f=_[_0x50e3('0x4f')]({},_0x3ef60f,_0x49c34b[_0x50e3('0x45')]);return _0x5c60e4[_0x50e3('0x89')](_0x3ef60f);}})['then'](function(_0x146334){if(_0x146334){_0x200cd9=_0x146334[_0x50e3('0x5c')];if(!_0x49c34b[_0x50e3('0x38')][_0x50e3('0x3c')](_0x50e3('0x3d'))){_0x3ef60f[_0x50e3('0x3e')]=qs[_0x50e3('0x3e')](_0x49c34b[_0x50e3('0x38')][_0x50e3('0x3e')]);_0x3ef60f[_0x50e3('0x21')]=qs[_0x50e3('0x21')](_0x49c34b['query'][_0x50e3('0x21')]);}return _0x5c60e4[_0x50e3('0x89')](_0x3ef60f);}})[_0x50e3('0x2b')](function(_0x19a296){if(_0x19a296){return _0x19a296?{'count':_0x200cd9,'rows':_0x19a296}:null;}})[_0x50e3('0x2b')](respondWithResult(_0x3879e4,null))[_0x50e3('0x4a')](handleError(_0x3879e4,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 501cf2b..a0c571c 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 _0xb8c0=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2e7274,_0x2dcfe6){var _0x319038=function(_0x5dae2b){while(--_0x5dae2b){_0x2e7274['push'](_0x2e7274['shift']());}};_0x319038(++_0x2dcfe6);}(_0xb8c0,0xee));var _0x0b8c=function(_0x187baf,_0x2d3fd5){_0x187baf=_0x187baf-0x0;var _0x366ff2=_0xb8c0[_0x187baf];return _0x366ff2;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x0b8c('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0b8c('0x1')](0x0);var events={'afterCreate':_0x0b8c('0x2'),'afterUpdate':_0x0b8c('0x3'),'afterDestroy':_0x0b8c('0x4')};function emitEvent(_0x17bdb8){return function(_0x438e81,_0x48c07b,_0x2e3d10){MailQueueEvents[_0x0b8c('0x5')](_0x17bdb8+':'+_0x438e81['id'],_0x438e81);MailQueueEvents['emit'](_0x17bdb8,_0x438e81);_0x2e3d10(null);};}for(var e in events){if(events[_0x0b8c('0x6')](e)){var event=events[e];MailQueue[_0x0b8c('0x7')](e,emitEvent(event));}}module[_0x0b8c('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xabe7=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','save','update'];(function(_0x2b7663,_0x17020d){var _0x13df95=function(_0x3e789e){while(--_0x3e789e){_0x2b7663['push'](_0x2b7663['shift']());}};_0x13df95(++_0x17020d);}(_0xabe7,0x190));var _0x7abe=function(_0x50b21c,_0x2696a5){_0x50b21c=_0x50b21c-0x0;var _0x48b899=_0xabe7[_0x50b21c];return _0x48b899;};'use strict';var EventEmitter=require(_0x7abe('0x0'));var MailQueue=require(_0x7abe('0x1'))['db'][_0x7abe('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7abe('0x3'),'afterUpdate':_0x7abe('0x4'),'afterDestroy':_0x7abe('0x5')};function emitEvent(_0x2fe582){return function(_0x511675,_0x4b4f92,_0x5331af){MailQueueEvents[_0x7abe('0x6')](_0x2fe582+':'+_0x511675['id'],_0x511675);MailQueueEvents[_0x7abe('0x6')](_0x2fe582,_0x511675);_0x5331af(null);};}for(var e in events){if(events[_0x7abe('0x7')](e)){var event=events[e];MailQueue[_0x7abe('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c96a966..eb1f395 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 _0x3c13=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x38e173,_0x4f5047){var _0x5579e1=function(_0x24b75a){while(--_0x24b75a){_0x38e173['push'](_0x38e173['shift']());}};_0x5579e1(++_0x4f5047);}(_0x3c13,0xbe));var _0x33c1=function(_0x1e7a57,_0x3ad15e){_0x1e7a57=_0x1e7a57-0x0;var _0x928e74=_0x3c13[_0x1e7a57];return _0x928e74;};'use strict';var _=require(_0x33c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33c1('0x1'));var moment=require(_0x33c1('0x2'));var BPromise=require(_0x33c1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33c1('0x4'));var rimraf=require(_0x33c1('0x5'));var config=require(_0x33c1('0x6'));var attributes=require(_0x33c1('0x7'));module[_0x33c1('0x8')]=function(_0x2ff749,_0x508328){return _0x2ff749[_0x33c1('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66c3=['MailQueue','mail_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x66c3,0x16e));var _0x366c=function(_0x5e0827,_0x4ff108){_0x5e0827=_0x5e0827-0x0;var _0x1c7143=_0x66c3[_0x5e0827];return _0x1c7143;};'use strict';var _=require(_0x366c('0x0'));var util=require('util');var logger=require(_0x366c('0x1'))(_0x366c('0x2'));var moment=require(_0x366c('0x3'));var BPromise=require(_0x366c('0x4'));var rp=require(_0x366c('0x5'));var fs=require('fs');var path=require(_0x366c('0x6'));var rimraf=require('rimraf');var config=require(_0x366c('0x7'));var attributes=require(_0x366c('0x8'));module[_0x366c('0x9')]=function(_0x354611,_0x293cdf){return _0x354611[_0x366c('0xa')](_0x366c('0xb'),attributes,{'tableName':_0x366c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index a195e27..733a8bf 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 _0xe725=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','MailQueue,\x20%s,\x20%s','error','message','info','result','MailQueue','findAll','options','raw','where','limit','include','model','attributes','map','GetMailQueue','stringify','ShowMailQueue','find','catch','lodash','bluebird','randomstring'];(function(_0x217286,_0x461070){var _0x186ff2=function(_0x397f0c){while(--_0x397f0c){_0x217286['push'](_0x217286['shift']());}};_0x186ff2(++_0x461070);}(_0xe725,0x165));var _0x5e72=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe725[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x5e72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e72('0x1'));var rs=require(_0x5e72('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e72('0x3'))['db'];var utils=require(_0x5e72('0x4'));var logger=require('../../config/logger')(_0x5e72('0x5'));var config=require(_0x5e72('0x6'));var jayson=require(_0x5e72('0x7'));var client=jayson['client'][_0x5e72('0x8')]({'port':0x232a});config[_0x5e72('0x9')]=_[_0x5e72('0xa')](config[_0x5e72('0x9')],{'host':_0x5e72('0xb'),'port':0x18eb});var socket=require(_0x5e72('0xc'))(new Redis(config[_0x5e72('0x9')]));require('./mailQueue.socket')[_0x5e72('0xd')](socket);function respondWithRpcPromise(_0x4f2fd8,_0x241d93,_0x4399df){return new BPromise(function(_0x690d0e,_0x15fa33){return client[_0x5e72('0xe')](_0x4f2fd8,_0x4399df)[_0x5e72('0xf')](function(_0x954ecd){logger['info']('MailQueue,\x20%s,\x20%s',_0x241d93,'request\x20sent');logger[_0x5e72('0x10')](_0x5e72('0x11'),_0x241d93,_0x5e72('0x12'),JSON['stringify'](_0x954ecd));if(_0x954ecd['error']){if(_0x954ecd['error'][_0x5e72('0x13')]===0x1f4){logger['error'](_0x5e72('0x14'),_0x241d93,_0x954ecd[_0x5e72('0x15')][_0x5e72('0x16')]);return _0x15fa33(_0x954ecd['error'][_0x5e72('0x16')]);}logger['error'](_0x5e72('0x14'),_0x241d93,_0x954ecd[_0x5e72('0x15')][_0x5e72('0x16')]);return _0x690d0e(_0x954ecd[_0x5e72('0x15')][_0x5e72('0x16')]);}else{logger[_0x5e72('0x17')](_0x5e72('0x14'),_0x241d93,'request\x20sent');_0x690d0e(_0x954ecd[_0x5e72('0x18')]['message']);}})['catch'](function(_0x55429c){logger[_0x5e72('0x15')](_0x5e72('0x14'),_0x241d93,_0x55429c);_0x15fa33(_0x55429c);});});}exports['GetMailQueue']=function(_0x4009b1){var _0x1defe9=this;return new Promise(function(_0x5eef8d,_0x58487f){return db[_0x5e72('0x19')][_0x5e72('0x1a')]({'raw':_0x4009b1[_0x5e72('0x1b')]?_0x4009b1['options'][_0x5e72('0x1c')]===undefined?!![]:![]:!![],'where':_0x4009b1['options']?_0x4009b1[_0x5e72('0x1b')][_0x5e72('0x1d')]||null:null,'attributes':_0x4009b1[_0x5e72('0x1b')]?_0x4009b1['options']['attributes']||null:null,'limit':_0x4009b1[_0x5e72('0x1b')]?_0x4009b1[_0x5e72('0x1b')][_0x5e72('0x1e')]||null:null,'include':_0x4009b1[_0x5e72('0x1b')]?_0x4009b1[_0x5e72('0x1b')]['include']?_['map'](_0x4009b1[_0x5e72('0x1b')][_0x5e72('0x1f')],function(_0x3a0caa){return{'model':db[_0x3a0caa[_0x5e72('0x20')]],'as':_0x3a0caa['as'],'attributes':_0x3a0caa[_0x5e72('0x21')],'include':_0x3a0caa[_0x5e72('0x1f')]?_[_0x5e72('0x22')](_0x3a0caa[_0x5e72('0x1f')],function(_0x22a7da){return{'model':db[_0x22a7da[_0x5e72('0x20')]],'as':_0x22a7da['as'],'attributes':_0x22a7da[_0x5e72('0x21')],'include':_0x22a7da[_0x5e72('0x1f')]?_[_0x5e72('0x22')](_0x22a7da['include'],function(_0x497f1e){return{'model':db[_0x497f1e['model']],'as':_0x497f1e['as'],'attributes':_0x497f1e[_0x5e72('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5e72('0xf')](function(_0x2e1848){logger['info'](_0x5e72('0x23'),_0x4009b1);logger[_0x5e72('0x10')]('GetMailQueue',_0x4009b1,JSON[_0x5e72('0x24')](_0x2e1848));_0x5eef8d(_0x2e1848);})['catch'](function(_0x42f1f7){logger[_0x5e72('0x15')](_0x5e72('0x23'),_0x42f1f7[_0x5e72('0x16')],_0x4009b1);_0x58487f(_0x1defe9[_0x5e72('0x15')](0x1f4,_0x42f1f7[_0x5e72('0x16')]));});});};exports[_0x5e72('0x25')]=function(_0x4b5e37){var _0x578b48=this;return new Promise(function(_0xb3fe6b,_0x3f2c77){return db['MailQueue'][_0x5e72('0x26')]({'raw':_0x4b5e37[_0x5e72('0x1b')]?_0x4b5e37[_0x5e72('0x1b')][_0x5e72('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b5e37[_0x5e72('0x1b')]?_0x4b5e37['options'][_0x5e72('0x1d')]||null:null,'attributes':_0x4b5e37[_0x5e72('0x1b')]?_0x4b5e37[_0x5e72('0x1b')][_0x5e72('0x21')]||null:null,'include':_0x4b5e37[_0x5e72('0x1b')]?_0x4b5e37[_0x5e72('0x1b')][_0x5e72('0x1f')]?_[_0x5e72('0x22')](_0x4b5e37['options'][_0x5e72('0x1f')],function(_0x10a503){return{'model':db[_0x10a503[_0x5e72('0x20')]],'as':_0x10a503['as'],'attributes':_0x10a503[_0x5e72('0x21')],'include':_0x10a503[_0x5e72('0x1f')]?_['map'](_0x10a503[_0x5e72('0x1f')],function(_0x193291){return{'model':db[_0x193291[_0x5e72('0x20')]],'as':_0x193291['as'],'attributes':_0x193291['attributes'],'include':_0x193291['include']?_[_0x5e72('0x22')](_0x193291[_0x5e72('0x1f')],function(_0x384c15){return{'model':db[_0x384c15[_0x5e72('0x20')]],'as':_0x384c15['as'],'attributes':_0x384c15[_0x5e72('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5e72('0xf')](function(_0x23a339){logger[_0x5e72('0x17')](_0x5e72('0x25'),_0x4b5e37);logger[_0x5e72('0x10')](_0x5e72('0x25'),_0x4b5e37,JSON[_0x5e72('0x24')](_0x23a339));_0xb3fe6b(_0x23a339);})[_0x5e72('0x27')](function(_0x3d5c4d){logger['error']('ShowMailQueue',_0x3d5c4d[_0x5e72('0x16')],_0x4b5e37);_0x3f2c77(_0x578b48[_0x5e72('0x15')](0x1f4,_0x3d5c4d[_0x5e72('0x16')]));});});}; \ No newline at end of file +var _0x588f=['ShowMailQueue','MailQueue','find','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug'];(function(_0x1a805b,_0xd1e4d1){var _0x3d6ffe=function(_0x51dc8f){while(--_0x51dc8f){_0x1a805b['push'](_0x1a805b['shift']());}};_0x3d6ffe(++_0xd1e4d1);}(_0x588f,0x194));var _0xf588=function(_0x46a197,_0xbab470){_0x46a197=_0x46a197-0x0;var _0x441b75=_0x588f[_0x46a197];return _0x441b75;};'use strict';var _=require(_0xf588('0x0'));var util=require(_0xf588('0x1'));var moment=require(_0xf588('0x2'));var BPromise=require('bluebird');var rs=require(_0xf588('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf588('0x4'))['db'];var utils=require(_0xf588('0x5'));var logger=require(_0xf588('0x6'))(_0xf588('0x7'));var config=require(_0xf588('0x8'));var jayson=require(_0xf588('0x9'));var client=jayson[_0xf588('0xa')]['http']({'port':0x232a});config[_0xf588('0xb')]=_[_0xf588('0xc')](config[_0xf588('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf588('0xb')]));require(_0xf588('0xd'))['register'](socket);function respondWithRpcPromise(_0x11d69d,_0x558d48,_0x1a1e9f){return new BPromise(function(_0xbc1b23,_0x3bbc90){return client[_0xf588('0xe')](_0x11d69d,_0x1a1e9f)[_0xf588('0xf')](function(_0x182923){logger[_0xf588('0x10')](_0xf588('0x11'),_0x558d48,_0xf588('0x12'));logger['debug'](_0xf588('0x13'),_0x558d48,_0xf588('0x12'),JSON['stringify'](_0x182923));if(_0x182923[_0xf588('0x14')]){if(_0x182923[_0xf588('0x14')][_0xf588('0x15')]===0x1f4){logger[_0xf588('0x14')](_0xf588('0x11'),_0x558d48,_0x182923[_0xf588('0x14')][_0xf588('0x16')]);return _0x3bbc90(_0x182923['error']['message']);}logger[_0xf588('0x14')]('MailQueue,\x20%s,\x20%s',_0x558d48,_0x182923['error'][_0xf588('0x16')]);return _0xbc1b23(_0x182923['error']['message']);}else{logger[_0xf588('0x10')]('MailQueue,\x20%s,\x20%s',_0x558d48,'request\x20sent');_0xbc1b23(_0x182923[_0xf588('0x17')][_0xf588('0x16')]);}})[_0xf588('0x18')](function(_0x1a6704){logger[_0xf588('0x14')](_0xf588('0x11'),_0x558d48,_0x1a6704);_0x3bbc90(_0x1a6704);});});}exports[_0xf588('0x19')]=function(_0x296c3e){var _0x204793=this;return new Promise(function(_0x38dbcc,_0x57431d){return db['MailQueue'][_0xf588('0x1a')]({'raw':_0x296c3e['options']?_0x296c3e[_0xf588('0x1b')][_0xf588('0x1c')]===undefined?!![]:![]:!![],'where':_0x296c3e[_0xf588('0x1b')]?_0x296c3e['options'][_0xf588('0x1d')]||null:null,'attributes':_0x296c3e[_0xf588('0x1b')]?_0x296c3e[_0xf588('0x1b')][_0xf588('0x1e')]||null:null,'limit':_0x296c3e[_0xf588('0x1b')]?_0x296c3e[_0xf588('0x1b')][_0xf588('0x1f')]||null:null,'include':_0x296c3e[_0xf588('0x1b')]?_0x296c3e[_0xf588('0x1b')][_0xf588('0x20')]?_[_0xf588('0x21')](_0x296c3e['options'][_0xf588('0x20')],function(_0x41eac5){return{'model':db[_0x41eac5[_0xf588('0x22')]],'as':_0x41eac5['as'],'attributes':_0x41eac5[_0xf588('0x1e')],'include':_0x41eac5['include']?_['map'](_0x41eac5[_0xf588('0x20')],function(_0x306559){return{'model':db[_0x306559[_0xf588('0x22')]],'as':_0x306559['as'],'attributes':_0x306559[_0xf588('0x1e')],'include':_0x306559['include']?_[_0xf588('0x21')](_0x306559[_0xf588('0x20')],function(_0x23c2fb){return{'model':db[_0x23c2fb[_0xf588('0x22')]],'as':_0x23c2fb['as'],'attributes':_0x23c2fb[_0xf588('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf588('0xf')](function(_0x2dfb10){logger[_0xf588('0x10')](_0xf588('0x19'),_0x296c3e);logger[_0xf588('0x23')](_0xf588('0x19'),_0x296c3e,JSON['stringify'](_0x2dfb10));_0x38dbcc(_0x2dfb10);})[_0xf588('0x18')](function(_0x419843){logger[_0xf588('0x14')](_0xf588('0x19'),_0x419843[_0xf588('0x16')],_0x296c3e);_0x57431d(_0x204793['error'](0x1f4,_0x419843['message']));});});};exports[_0xf588('0x24')]=function(_0x5e9fba){var _0x4673f2=this;return new Promise(function(_0xdf03b7,_0x29419e){return db[_0xf588('0x25')][_0xf588('0x26')]({'raw':_0x5e9fba[_0xf588('0x1b')]?_0x5e9fba[_0xf588('0x1b')][_0xf588('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e9fba[_0xf588('0x1b')]?_0x5e9fba[_0xf588('0x1b')][_0xf588('0x1d')]||null:null,'attributes':_0x5e9fba[_0xf588('0x1b')]?_0x5e9fba[_0xf588('0x1b')][_0xf588('0x1e')]||null:null,'include':_0x5e9fba['options']?_0x5e9fba[_0xf588('0x1b')]['include']?_['map'](_0x5e9fba['options']['include'],function(_0x220527){return{'model':db[_0x220527[_0xf588('0x22')]],'as':_0x220527['as'],'attributes':_0x220527[_0xf588('0x1e')],'include':_0x220527[_0xf588('0x20')]?_[_0xf588('0x21')](_0x220527[_0xf588('0x20')],function(_0x7fa423){return{'model':db[_0x7fa423[_0xf588('0x22')]],'as':_0x7fa423['as'],'attributes':_0x7fa423[_0xf588('0x1e')],'include':_0x7fa423[_0xf588('0x20')]?_['map'](_0x7fa423[_0xf588('0x20')],function(_0x40c9e1){return{'model':db[_0x40c9e1[_0xf588('0x22')]],'as':_0x40c9e1['as'],'attributes':_0x40c9e1[_0xf588('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf588('0xf')](function(_0xe9c4d6){logger[_0xf588('0x10')](_0xf588('0x24'),_0x5e9fba);logger[_0xf588('0x23')](_0xf588('0x24'),_0x5e9fba,JSON[_0xf588('0x27')](_0xe9c4d6));_0xdf03b7(_0xe9c4d6);})['catch'](function(_0x87bc83){logger[_0xf588('0x14')](_0xf588('0x24'),_0x87bc83['message'],_0x5e9fba);_0x29419e(_0x4673f2[_0xf588('0x14')](0x1f4,_0x87bc83['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 9dda985..b08aa4c 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 _0xa244=['./mailQueue.events','emit','removeListener','register','length','mailQueue:'];(function(_0x53c155,_0x35e106){var _0x28a124=function(_0x3eb854){while(--_0x3eb854){_0x53c155['push'](_0x53c155['shift']());}};_0x28a124(++_0x35e106);}(_0xa244,0xd2));var _0x4a24=function(_0x53ed08,_0x444ba4){_0x53ed08=_0x53ed08-0x0;var _0x9e3d30=_0xa244[_0x53ed08];return _0x9e3d30;};'use strict';var MailQueueEvents=require(_0x4a24('0x0'));var events=['save','remove','update'];function createListener(_0x3e0c80,_0x14b1cf){return function(_0x257953){_0x14b1cf[_0x4a24('0x1')](_0x3e0c80,_0x257953);};}function removeListener(_0xa9a61,_0x56ee35){return function(){MailQueueEvents[_0x4a24('0x2')](_0xa9a61,_0x56ee35);};}exports[_0x4a24('0x3')]=function(_0x4fd8e5){for(var _0x45b9c0=0x0,_0x114057=events[_0x4a24('0x4')];_0x45b9c0<_0x114057;_0x45b9c0++){var _0x3fe1b3=events[_0x45b9c0];var _0x38d246=createListener(_0x4a24('0x5')+_0x3fe1b3,_0x4fd8e5);MailQueueEvents['on'](_0x3fe1b3,_0x38d246);}}; \ No newline at end of file +var _0x6718=['remove','update','emit','removeListener','register','length','./mailQueue.events','save'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x6718,0xde));var _0x8671=function(_0x5c6272,_0xd82df5){_0x5c6272=_0x5c6272-0x0;var _0x19c236=_0x6718[_0x5c6272];return _0x19c236;};'use strict';var MailQueueEvents=require(_0x8671('0x0'));var events=[_0x8671('0x1'),_0x8671('0x2'),_0x8671('0x3')];function createListener(_0x5d5a50,_0x15a094){return function(_0x5a2c6a){_0x15a094[_0x8671('0x4')](_0x5d5a50,_0x5a2c6a);};}function removeListener(_0x46baea,_0x26f0f2){return function(){MailQueueEvents[_0x8671('0x5')](_0x46baea,_0x26f0f2);};}exports[_0x8671('0x6')]=function(_0x3155bd){for(var _0x38a0d5=0x0,_0x2a00eb=events[_0x8671('0x7')];_0x38a0d5<_0x2a00eb;_0x38a0d5++){var _0x56a55e=events[_0x38a0d5];var _0x41986d=createListener('mailQueue:'+_0x56a55e,_0x3155bd);MailQueueEvents['on'](_0x56a55e,_0x41986d);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 6427860..107143f 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 _0xcfc5=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x206b18,_0x130729){var _0x5a886b=function(_0xc8a68c){while(--_0xc8a68c){_0x206b18['push'](_0x206b18['shift']());}};_0x5a886b(++_0x130729);}(_0xcfc5,0xae));var _0x5cfc=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xcfc5[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x5cfc('0x0'));var util=require(_0x5cfc('0x1'));var path=require(_0x5cfc('0x2'));var timeout=require(_0x5cfc('0x3'));var express=require(_0x5cfc('0x4'));var router=express[_0x5cfc('0x5')]();var fs_extra=require(_0x5cfc('0x6'));var auth=require(_0x5cfc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5cfc('0x8'));var controller=require('./mailQueueReport.controller');router[_0x5cfc('0x9')]('/',auth['isAuthenticated'](),controller[_0x5cfc('0xa')]);router['get']('/describe',auth[_0x5cfc('0xb')](),controller[_0x5cfc('0xc')]);router[_0x5cfc('0x9')](_0x5cfc('0xd'),auth[_0x5cfc('0xb')](),controller['show']);router[_0x5cfc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5cfc('0xf')](_0x5cfc('0xd'),auth['isAuthenticated'](),controller[_0x5cfc('0x10')]);router[_0x5cfc('0x11')](_0x5cfc('0xd'),auth[_0x5cfc('0xb')](),controller[_0x5cfc('0x12')]);module[_0x5cfc('0x13')]=router; \ No newline at end of file +var _0xa6de=['show','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0xa6de,0x8a));var _0xea6d=function(_0x512550,_0x6a8b6f){_0x512550=_0x512550-0x0;var _0x19f661=_0xa6de[_0x512550];return _0x19f661;};'use strict';var multer=require('multer');var util=require(_0xea6d('0x0'));var path=require(_0xea6d('0x1'));var timeout=require(_0xea6d('0x2'));var express=require(_0xea6d('0x3'));var router=express[_0xea6d('0x4')]();var fs_extra=require(_0xea6d('0x5'));var auth=require(_0xea6d('0x6'));var interaction=require(_0xea6d('0x7'));var config=require(_0xea6d('0x8'));var controller=require(_0xea6d('0x9'));router[_0xea6d('0xa')]('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0xc')]);router['get'](_0xea6d('0xd'),auth[_0xea6d('0xb')](),controller[_0xea6d('0xe')]);router[_0xea6d('0xa')](_0xea6d('0xf'),auth[_0xea6d('0xb')](),controller[_0xea6d('0x10')]);router[_0xea6d('0x11')]('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0x12')]);router['put']('/:id',auth[_0xea6d('0xb')](),controller[_0xea6d('0x13')]);router['delete'](_0xea6d('0xf'),auth[_0xea6d('0xb')](),controller[_0xea6d('0x14')]);module[_0xea6d('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 52fc575..0c1939b 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 _0xde5f=['exports','STRING','DATE','moment'];(function(_0x30b94f,_0x2452fc){var _0x276d4c=function(_0x43c325){while(--_0x43c325){_0x30b94f['push'](_0x30b94f['shift']());}};_0x276d4c(++_0x2452fc);}(_0xde5f,0x83));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xfde5('0x0'));var Sequelize=require('sequelize');module[_0xfde5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfde5('0x2')]},'joinAt':{'type':Sequelize[_0xfde5('0x3')]},'leaveAt':{'type':Sequelize[_0xfde5('0x3')]},'acceptAt':{'type':Sequelize[_0xfde5('0x3')]},'exitAt':{'type':Sequelize[_0xfde5('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x50ff=['STRING','DATE','exports'];(function(_0x3e8dbd,_0x1126fd){var _0xff862f=function(_0x3db9cc){while(--_0x3db9cc){_0x3e8dbd['push'](_0x3e8dbd['shift']());}};_0xff862f(++_0x1126fd);}(_0x50ff,0x1c7));var _0xf50f=function(_0x358ad0,_0x3064e7){_0x358ad0=_0x358ad0-0x0;var _0x9957bf=_0x50ff[_0x358ad0];return _0x9957bf;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xf50f('0x0')]={'uniqueid':{'type':Sequelize[_0xf50f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xf50f('0x1')]},'joinAt':{'type':Sequelize[_0xf50f('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf50f('0x2')]},'exitAt':{'type':Sequelize[_0xf50f('0x2')]},'reason':{'type':Sequelize[_0xf50f('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5a3eda8..29da8de 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 _0xd7d1=['update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','rows','catch','length','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x5cef34,_0x5b3cd5){var _0x1c05ba=function(_0x4ac88f){while(--_0x4ac88f){_0x5cef34['push'](_0x5cef34['shift']());}};_0x1c05ba(++_0x5b3cd5);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x12841d,_0x3d63f6){_0x12841d=_0x12841d-0x0;var _0xf6aeff=_0xd7d1[_0x12841d];return _0xf6aeff;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var licenseUtil=require(_0x1d7d('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11b83f,_0x5ae1c9){_0x5ae1c9=_0x5ae1c9||0xcc;return function(_0x577e07){if(_0x577e07){return _0x11b83f[_0x1d7d('0x1c')](_0x5ae1c9);}return _0x11b83f[_0x1d7d('0x1d')](_0x5ae1c9)['end']();};}function respondWithResult(_0x55dba7,_0x1d3822){_0x1d3822=_0x1d3822||0xc8;return function(_0x334e78){if(_0x334e78){return _0x55dba7[_0x1d7d('0x1d')](_0x1d3822)[_0x1d7d('0x1e')](_0x334e78);}};}function respondWithFilteredResult(_0xeb05b3,_0x53423f){return function(_0x28adf3){if(_0x28adf3){var _0x1de6cc=typeof _0x53423f['offset']===_0x1d7d('0x1f')&&typeof _0x53423f[_0x1d7d('0x20')]===_0x1d7d('0x1f');var _0x47826a=_0x28adf3[_0x1d7d('0x21')];var _0x4db4f2=_0x1de6cc?0x0:_0x53423f[_0x1d7d('0x22')];var _0x191024=_0x1de6cc?_0x28adf3['count']:_0x53423f['offset']+_0x53423f[_0x1d7d('0x20')];var _0x1a5101;if(_0x191024>=_0x47826a){_0x191024=_0x47826a;_0x1a5101=0xc8;}else{_0x1a5101=0xce;}_0xeb05b3[_0x1d7d('0x1d')](_0x1a5101);return _0xeb05b3[_0x1d7d('0x23')](_0x1d7d('0x24'),_0x4db4f2+'-'+_0x191024+'/'+_0x47826a)[_0x1d7d('0x1e')](_0x28adf3);}return null;};}function patchUpdates(_0x54d401){return function(_0x225f85){try{jsonpatch[_0x1d7d('0x25')](_0x225f85,_0x54d401,!![]);}catch(_0x3a93d0){return BPromise['reject'](_0x3a93d0);}return _0x225f85[_0x1d7d('0x26')]();};}function saveUpdates(_0x12c54b,_0x4a1cdc){return function(_0x5950bd){if(_0x5950bd){return _0x5950bd[_0x1d7d('0x27')](_0x12c54b)[_0x1d7d('0x28')](function(_0x3d631f){return _0x3d631f;});}return null;};}function removeEntity(_0x5097b8,_0x377653){return function(_0x106376){if(_0x106376){return _0x106376[_0x1d7d('0x29')]()[_0x1d7d('0x28')](function(){_0x5097b8['status'](0xcc)[_0x1d7d('0x2a')]();});}};}function handleEntityNotFound(_0x151198,_0x5c8257){return function(_0x57bbd8){if(!_0x57bbd8){_0x151198[_0x1d7d('0x1c')](0x194);}return _0x57bbd8;};}function handleError(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0x1f4;return function(_0x2d4de4){logger[_0x1d7d('0x2b')](_0x2d4de4[_0x1d7d('0x2c')]);if(_0x2d4de4[_0x1d7d('0x2d')]){delete _0x2d4de4['name'];}_0x52c618[_0x1d7d('0x1d')](_0x38c323)[_0x1d7d('0x2e')](_0x2d4de4);};}exports[_0x1d7d('0x2f')]=function(_0x58672c,_0x78adbe){var _0x1a935a={},_0x23ad85={},_0x482367={'count':0x0,'rows':[]};var _0x5aeb1f=_['map'](db[_0x1d7d('0x30')][_0x1d7d('0x31')],function(_0x559f19){return{'name':_0x559f19[_0x1d7d('0x32')],'type':_0x559f19[_0x1d7d('0x33')][_0x1d7d('0x34')]};});_0x23ad85[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x5aeb1f,_0x1d7d('0x2d'));_0x23ad85[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x58672c[_0x1d7d('0x37')]);_0x23ad85[_0x1d7d('0x39')]=_['intersection'](_0x23ad85['model'],_0x23ad85[_0x1d7d('0x37')]);_0x1a935a[_0x1d7d('0x3a')]=_[_0x1d7d('0x3b')](_0x23ad85[_0x1d7d('0x35')],qs[_0x1d7d('0x3c')](_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x3c')]));_0x1a935a[_0x1d7d('0x3a')]=_0x1a935a[_0x1d7d('0x3a')]['length']?_0x1a935a[_0x1d7d('0x3a')]:_0x23ad85[_0x1d7d('0x35')];if(!_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x3d')]('nolimit')){_0x1a935a['limit']=qs[_0x1d7d('0x20')](_0x58672c[_0x1d7d('0x37')]['limit']);_0x1a935a[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x58672c['query']['offset']);}_0x1a935a[_0x1d7d('0x3e')]=qs[_0x1d7d('0x3f')](_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x3f')]);_0x1a935a[_0x1d7d('0x40')]=qs[_0x1d7d('0x39')](_[_0x1d7d('0x41')](_0x58672c[_0x1d7d('0x37')],_0x23ad85[_0x1d7d('0x39')]),_0x5aeb1f);if(_0x58672c[_0x1d7d('0x37')]['filter']){_0x1a935a['where']=_['merge'](_0x1a935a['where'],{'$or':_[_0x1d7d('0x36')](_0x5aeb1f,function(_0x5e7e8b){if(_0x5e7e8b[_0x1d7d('0x33')]!==_0x1d7d('0x42')){var _0x3d7c65={};_0x3d7c65[_0x5e7e8b['name']]={'$like':'%'+_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x43')]+'%'};return _0x3d7c65;}})});}_0x1a935a=_[_0x1d7d('0x44')]({},_0x1a935a,_0x58672c['options']);var _0x1a6a8c={'where':_0x1a935a[_0x1d7d('0x40')]};return db[_0x1d7d('0x30')][_0x1d7d('0x21')](_0x1a6a8c)['then'](function(_0x1db8e8){_0x482367[_0x1d7d('0x21')]=_0x1db8e8;if(_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x45')]){_0x1a935a['include']=[{'all':!![]}];}return db[_0x1d7d('0x30')]['findAll'](_0x1a935a);})[_0x1d7d('0x28')](function(_0x31b850){_0x482367[_0x1d7d('0x46')]=_0x31b850;return _0x482367;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x78adbe,_0x1a935a))[_0x1d7d('0x47')](handleError(_0x78adbe,null));};exports['show']=function(_0x59b8e7,_0x33582a){var _0xe57fa5={'raw':!![],'where':{'id':_0x59b8e7['params']['id']}},_0x1637fc={};_0x1637fc['model']=_[_0x1d7d('0x38')](db['MailQueueReport'][_0x1d7d('0x31')]);_0x1637fc[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x59b8e7[_0x1d7d('0x37')]);_0x1637fc[_0x1d7d('0x39')]=_[_0x1d7d('0x3b')](_0x1637fc[_0x1d7d('0x35')],_0x1637fc['query']);_0xe57fa5[_0x1d7d('0x3a')]=_[_0x1d7d('0x3b')](_0x1637fc['model'],qs[_0x1d7d('0x3c')](_0x59b8e7[_0x1d7d('0x37')][_0x1d7d('0x3c')]));_0xe57fa5[_0x1d7d('0x3a')]=_0xe57fa5[_0x1d7d('0x3a')][_0x1d7d('0x48')]?_0xe57fa5[_0x1d7d('0x3a')]:_0x1637fc[_0x1d7d('0x35')];if(_0x59b8e7[_0x1d7d('0x37')][_0x1d7d('0x45')]){_0xe57fa5[_0x1d7d('0x49')]=[{'all':!![]}];}_0xe57fa5=_[_0x1d7d('0x44')]({},_0xe57fa5,_0x59b8e7['options']);return db[_0x1d7d('0x30')]['find'](_0xe57fa5)[_0x1d7d('0x28')](handleEntityNotFound(_0x33582a,null))['then'](respondWithResult(_0x33582a,null))[_0x1d7d('0x47')](handleError(_0x33582a,null));};exports[_0x1d7d('0x4a')]=function(_0x7ebc25,_0xf25490){return db['MailQueueReport'][_0x1d7d('0x4a')](_0x7ebc25['body'],{})['then'](respondWithResult(_0xf25490,0xc9))[_0x1d7d('0x47')](handleError(_0xf25490,null));};exports['update']=function(_0x57e416,_0x3727be){if(_0x57e416[_0x1d7d('0x4b')]['id']){delete _0x57e416['body']['id'];}return db[_0x1d7d('0x30')][_0x1d7d('0x4c')]({'where':{'id':_0x57e416['params']['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x3727be,null))[_0x1d7d('0x28')](saveUpdates(_0x57e416[_0x1d7d('0x4b')],null))[_0x1d7d('0x28')](respondWithResult(_0x3727be,null))['catch'](handleError(_0x3727be,null));};exports['destroy']=function(_0x3f73eb,_0x44d38d){return db[_0x1d7d('0x30')][_0x1d7d('0x4c')]({'where':{'id':_0x3f73eb[_0x1d7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x44d38d,null))[_0x1d7d('0x28')](removeEntity(_0x44d38d,null))[_0x1d7d('0x47')](handleError(_0x44d38d,null));};exports[_0x1d7d('0x4e')]=function(_0x18a2d1,_0x471418){return db[_0x1d7d('0x30')][_0x1d7d('0x4e')]()[_0x1d7d('0x28')](respondWithResult(_0x471418,null))[_0x1d7d('0x47')](handleError(_0x471418,null));}; \ No newline at end of file +var _0x627e=['limit','count','set','reject','save','then','destroy','error','stack','name','index','MailQueueReport','fieldName','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','rows','catch','params','fields','length','includeAll','include','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x303eca,_0x2ec9f6){var _0x5e89c1=function(_0x5e59fe){while(--_0x5e59fe){_0x303eca['push'](_0x303eca['shift']());}};_0x5e89c1(++_0x2ec9f6);}(_0x627e,0x14a));var _0xe627=function(_0x541f6f,_0x2527c){_0x541f6f=_0x541f6f-0x0;var _0x1651f9=_0x627e[_0x541f6f];return _0x1651f9;};'use strict';var emlformat=require(_0xe627('0x0'));var rimraf=require(_0xe627('0x1'));var zipdir=require(_0xe627('0x2'));var jsonpatch=require(_0xe627('0x3'));var rp=require(_0xe627('0x4'));var moment=require('moment');var BPromise=require(_0xe627('0x5'));var Mustache=require(_0xe627('0x6'));var util=require(_0xe627('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe627('0x8'));var fs=require('fs');var fs_extra=require(_0xe627('0x9'));var _=require(_0xe627('0xa'));var squel=require(_0xe627('0xb'));var crypto=require(_0xe627('0xc'));var jsforce=require(_0xe627('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe627('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe627('0xf'));var authService=require(_0xe627('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe627('0x11'));var logger=require(_0xe627('0x12'))(_0xe627('0x13'));var utils=require(_0xe627('0x14'));var config=require(_0xe627('0x15'));var licenseUtil=require(_0xe627('0x16'));var db=require(_0xe627('0x17'))['db'];function respondWithStatusCode(_0x3919be,_0x1922f5){_0x1922f5=_0x1922f5||0xcc;return function(_0x582190){if(_0x582190){return _0x3919be[_0xe627('0x18')](_0x1922f5);}return _0x3919be[_0xe627('0x19')](_0x1922f5)[_0xe627('0x1a')]();};}function respondWithResult(_0x4be370,_0x42dd1c){_0x42dd1c=_0x42dd1c||0xc8;return function(_0x1e2e62){if(_0x1e2e62){return _0x4be370[_0xe627('0x19')](_0x42dd1c)[_0xe627('0x1b')](_0x1e2e62);}};}function respondWithFilteredResult(_0x62896f,_0x6a9a15){return function(_0x271325){if(_0x271325){var _0x54720a=typeof _0x6a9a15[_0xe627('0x1c')]===_0xe627('0x1d')&&typeof _0x6a9a15[_0xe627('0x1e')]===_0xe627('0x1d');var _0x403982=_0x271325[_0xe627('0x1f')];var _0x56559b=_0x54720a?0x0:_0x6a9a15[_0xe627('0x1c')];var _0x538b22=_0x54720a?_0x271325[_0xe627('0x1f')]:_0x6a9a15['offset']+_0x6a9a15[_0xe627('0x1e')];var _0x565213;if(_0x538b22>=_0x403982){_0x538b22=_0x403982;_0x565213=0xc8;}else{_0x565213=0xce;}_0x62896f['status'](_0x565213);return _0x62896f[_0xe627('0x20')]('Content-Range',_0x56559b+'-'+_0x538b22+'/'+_0x403982)[_0xe627('0x1b')](_0x271325);}return null;};}function patchUpdates(_0x3391ce){return function(_0x4adde7){try{jsonpatch['apply'](_0x4adde7,_0x3391ce,!![]);}catch(_0x4ecfa6){return BPromise[_0xe627('0x21')](_0x4ecfa6);}return _0x4adde7[_0xe627('0x22')]();};}function saveUpdates(_0x4e3338,_0x708a8a){return function(_0x33cb27){if(_0x33cb27){return _0x33cb27['update'](_0x4e3338)[_0xe627('0x23')](function(_0x29221b){return _0x29221b;});}return null;};}function removeEntity(_0x52d492,_0x42f3d1){return function(_0x19adbc){if(_0x19adbc){return _0x19adbc[_0xe627('0x24')]()['then'](function(){_0x52d492[_0xe627('0x19')](0xcc)[_0xe627('0x1a')]();});}};}function handleEntityNotFound(_0x1a5081,_0x3ddd8d){return function(_0x4b9ff9){if(!_0x4b9ff9){_0x1a5081[_0xe627('0x18')](0x194);}return _0x4b9ff9;};}function handleError(_0x1fe192,_0x1635a0){_0x1635a0=_0x1635a0||0x1f4;return function(_0x29eb8e){logger[_0xe627('0x25')](_0x29eb8e[_0xe627('0x26')]);if(_0x29eb8e[_0xe627('0x27')]){delete _0x29eb8e[_0xe627('0x27')];}_0x1fe192[_0xe627('0x19')](_0x1635a0)['send'](_0x29eb8e);};}exports[_0xe627('0x28')]=function(_0x5aeba1,_0x5cd7c8){var _0x1e0bd7={},_0xdf63c8={},_0x5799a3={'count':0x0,'rows':[]};var _0x39c23f=_['map'](db[_0xe627('0x29')]['rawAttributes'],function(_0x262253){return{'name':_0x262253[_0xe627('0x2a')],'type':_0x262253['type'][_0xe627('0x2b')]};});_0xdf63c8['model']=_[_0xe627('0x2c')](_0x39c23f,_0xe627('0x27'));_0xdf63c8[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x5aeba1[_0xe627('0x2d')]);_0xdf63c8[_0xe627('0x2f')]=_[_0xe627('0x30')](_0xdf63c8[_0xe627('0x31')],_0xdf63c8[_0xe627('0x2d')]);_0x1e0bd7[_0xe627('0x32')]=_[_0xe627('0x30')](_0xdf63c8['model'],qs['fields'](_0x5aeba1[_0xe627('0x2d')]['fields']));_0x1e0bd7[_0xe627('0x32')]=_0x1e0bd7['attributes']['length']?_0x1e0bd7[_0xe627('0x32')]:_0xdf63c8['model'];if(!_0x5aeba1['query'][_0xe627('0x33')](_0xe627('0x34'))){_0x1e0bd7[_0xe627('0x1e')]=qs['limit'](_0x5aeba1['query']['limit']);_0x1e0bd7[_0xe627('0x1c')]=qs['offset'](_0x5aeba1[_0xe627('0x2d')][_0xe627('0x1c')]);}_0x1e0bd7['order']=qs[_0xe627('0x35')](_0x5aeba1[_0xe627('0x2d')]['sort']);_0x1e0bd7[_0xe627('0x36')]=qs[_0xe627('0x2f')](_[_0xe627('0x37')](_0x5aeba1[_0xe627('0x2d')],_0xdf63c8[_0xe627('0x2f')]),_0x39c23f);if(_0x5aeba1[_0xe627('0x2d')]['filter']){_0x1e0bd7[_0xe627('0x36')]=_['merge'](_0x1e0bd7[_0xe627('0x36')],{'$or':_['map'](_0x39c23f,function(_0xe90eda){if(_0xe90eda[_0xe627('0x38')]!==_0xe627('0x39')){var _0x21a533={};_0x21a533[_0xe90eda[_0xe627('0x27')]]={'$like':'%'+_0x5aeba1[_0xe627('0x2d')][_0xe627('0x3a')]+'%'};return _0x21a533;}})});}_0x1e0bd7=_[_0xe627('0x3b')]({},_0x1e0bd7,_0x5aeba1[_0xe627('0x3c')]);var _0x415a25={'where':_0x1e0bd7[_0xe627('0x36')]};return db[_0xe627('0x29')][_0xe627('0x1f')](_0x415a25)['then'](function(_0x4ddff5){_0x5799a3['count']=_0x4ddff5;if(_0x5aeba1['query']['includeAll']){_0x1e0bd7['include']=[{'all':!![]}];}return db[_0xe627('0x29')]['findAll'](_0x1e0bd7);})[_0xe627('0x23')](function(_0x59cd6a){_0x5799a3[_0xe627('0x3d')]=_0x59cd6a;return _0x5799a3;})[_0xe627('0x23')](respondWithFilteredResult(_0x5cd7c8,_0x1e0bd7))[_0xe627('0x3e')](handleError(_0x5cd7c8,null));};exports['show']=function(_0x58e110,_0x26064c){var _0x5f3374={'raw':!![],'where':{'id':_0x58e110[_0xe627('0x3f')]['id']}},_0x5e352e={};_0x5e352e['model']=_[_0xe627('0x2e')](db['MailQueueReport']['rawAttributes']);_0x5e352e[_0xe627('0x2d')]=_[_0xe627('0x2e')](_0x58e110[_0xe627('0x2d')]);_0x5e352e['filters']=_['intersection'](_0x5e352e[_0xe627('0x31')],_0x5e352e['query']);_0x5f3374['attributes']=_[_0xe627('0x30')](_0x5e352e[_0xe627('0x31')],qs[_0xe627('0x40')](_0x58e110[_0xe627('0x2d')][_0xe627('0x40')]));_0x5f3374[_0xe627('0x32')]=_0x5f3374['attributes'][_0xe627('0x41')]?_0x5f3374[_0xe627('0x32')]:_0x5e352e['model'];if(_0x58e110['query'][_0xe627('0x42')]){_0x5f3374[_0xe627('0x43')]=[{'all':!![]}];}_0x5f3374=_[_0xe627('0x3b')]({},_0x5f3374,_0x58e110[_0xe627('0x3c')]);return db[_0xe627('0x29')][_0xe627('0x44')](_0x5f3374)[_0xe627('0x23')](handleEntityNotFound(_0x26064c,null))['then'](respondWithResult(_0x26064c,null))[_0xe627('0x3e')](handleError(_0x26064c,null));};exports['create']=function(_0x648456,_0xcd19f5){return db[_0xe627('0x29')]['create'](_0x648456[_0xe627('0x45')],{})['then'](respondWithResult(_0xcd19f5,0xc9))[_0xe627('0x3e')](handleError(_0xcd19f5,null));};exports[_0xe627('0x46')]=function(_0x375e05,_0x30e057){if(_0x375e05[_0xe627('0x45')]['id']){delete _0x375e05['body']['id'];}return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x375e05[_0xe627('0x3f')]['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x30e057,null))[_0xe627('0x23')](saveUpdates(_0x375e05[_0xe627('0x45')],null))[_0xe627('0x23')](respondWithResult(_0x30e057,null))[_0xe627('0x3e')](handleError(_0x30e057,null));};exports[_0xe627('0x24')]=function(_0x3824da,_0x550b74){return db[_0xe627('0x29')][_0xe627('0x44')]({'where':{'id':_0x3824da['params']['id']}})[_0xe627('0x23')](handleEntityNotFound(_0x550b74,null))[_0xe627('0x23')](removeEntity(_0x550b74,null))['catch'](handleError(_0x550b74,null));};exports[_0xe627('0x47')]=function(_0x3a827e,_0x542a4c){return db[_0xe627('0x29')][_0xe627('0x47')]()['then'](respondWithResult(_0x542a4c,null))[_0xe627('0x3e')](handleError(_0x542a4c,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d35d212..b5555ac 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 _0xfbff=['./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfbff,0x156));var _0xffbf=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xfbff[_0x590851];return _0x3b0115;};'use strict';var _=require(_0xffbf('0x0'));var util=require(_0xffbf('0x1'));var logger=require(_0xffbf('0x2'))(_0xffbf('0x3'));var moment=require(_0xffbf('0x4'));var BPromise=require(_0xffbf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xffbf('0x6'));var config=require(_0xffbf('0x7'));var attributes=require(_0xffbf('0x8'));module[_0xffbf('0x9')]=function(_0x348738,_0x295d6c){return _0x348738[_0xffbf('0xa')](_0xffbf('0xb'),attributes,{'tableName':_0xffbf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xffbf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31c2=['report_mail_queue','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','MailQueueReport'];(function(_0x1ae7c8,_0x274e1d){var _0x66aab0=function(_0x3dd2b0){while(--_0x3dd2b0){_0x1ae7c8['push'](_0x1ae7c8['shift']());}};_0x66aab0(++_0x274e1d);}(_0x31c2,0x70));var _0x231c=function(_0x2b965d,_0x347f79){_0x2b965d=_0x2b965d-0x0;var _0x469d83=_0x31c2[_0x2b965d];return _0x469d83;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var logger=require('../../config/logger')(_0x231c('0x2'));var moment=require(_0x231c('0x3'));var BPromise=require('bluebird');var rp=require(_0x231c('0x4'));var fs=require('fs');var path=require(_0x231c('0x5'));var rimraf=require(_0x231c('0x6'));var config=require(_0x231c('0x7'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x3f1118,_0x392af2){return _0x3f1118['define'](_0x231c('0x8'),attributes,{'tableName':_0x231c('0x9'),'paranoid':![],'indexes':[{'name':_0x231c('0xa'),'fields':[_0x231c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index cee0837..2e2af2a 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1357e5,_0x2ddb29){var _0x4db82c=function(_0x30b232){while(--_0x30b232){_0x1357e5['push'](_0x1357e5['shift']());}};_0x4db82c(++_0x2ddb29);}(_0x1261,0x144));var _0x1126=function(_0x52d543,_0x4982e1){_0x52d543=_0x52d543-0x0;var _0x572ca0=_0x1261[_0x52d543];return _0x572ca0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x413ab1,_0x2a968e){var _0x47c2a8=function(_0x4a3002){while(--_0x4a3002){_0x413ab1['push'](_0x413ab1['shift']());}};_0x47c2a8(++_0x2a968e);}(_0x1261,0x144));var _0x1126=function(_0x135448,_0x4ca19f){_0x135448=_0x135448-0x0;var _0x28389e=_0x1261[_0x135448];return _0x28389e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 04b6ef5..1b0f899 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x30aac6,_0x4d0fc6){var _0x4a0a1b=function(_0x152ff9){while(--_0x152ff9){_0x30aac6['push'](_0x30aac6['shift']());}};_0x4a0a1b(++_0x4d0fc6);}(_0x70e0,0x17b));var _0x070e=function(_0x3e2c39,_0x42436a){_0x3e2c39=_0x3e2c39-0x0;var _0x4a967d=_0x70e0[_0x3e2c39];return _0x4a967d;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x374954,_0x18dc36){var _0x42073e=function(_0x1cb45f){while(--_0x1cb45f){_0x374954['push'](_0x374954['shift']());}};_0x42073e(++_0x18dc36);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 7c1c98b..38fdef6 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 _0xf20f=['exports','STRING','INTEGER','BOOLEAN','INBOX','sequelize'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xf20f,0x101));var _0xff20=function(_0x9991af,_0x7cd4ff){_0x9991af=_0x9991af-0x0;var _0x384b89=_0xf20f[_0x9991af];return _0x384b89;};'use strict';var Sequelize=require(_0xff20('0x0'));module[_0xff20('0x1')]={'description':{'type':Sequelize[_0xff20('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xff20('0x2')]},'password':{'type':Sequelize[_0xff20('0x2')]},'port':{'type':Sequelize[_0xff20('0x3')]},'tls':{'type':Sequelize[_0xff20('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xff20('0x2')],'defaultValue':_0xff20('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xff20('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xff20('0x2')]},'modernAuthentication':{'type':Sequelize[_0xff20('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x668b=['INTEGER','BOOLEAN','INBOX','exports','STRING'];(function(_0x2f913b,_0x49ac46){var _0x3d8146=function(_0x876aee){while(--_0x876aee){_0x2f913b['push'](_0x2f913b['shift']());}};_0x3d8146(++_0x49ac46);}(_0x668b,0x99));var _0xb668=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x668b[_0x21b359];return _0x57b8e7;};'use strict';var Sequelize=require('sequelize');module[_0xb668('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xb668('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb668('0x2')]},'tls':{'type':Sequelize[_0xb668('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb668('0x1')],'defaultValue':_0xb668('0x4')},'connTimeout':{'type':Sequelize[_0xb668('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xb668('0x1')]},'modernAuthentication':{'type':Sequelize[_0xb668('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 dd91005..e556ec7 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 _0x8431=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x4b37bd,_0x32a113){var _0x255fe4=function(_0x10ef16){while(--_0x10ef16){_0x4b37bd['push'](_0x4b37bd['shift']());}};_0x255fe4(++_0x32a113);}(_0x8431,0x11e));var _0x1843=function(_0x4dea41,_0x57da1d){_0x4dea41=_0x4dea41-0x0;var _0x42b93f=_0x8431[_0x4dea41];return _0x42b93f;};'use strict';var _=require(_0x1843('0x0'));var util=require(_0x1843('0x1'));var logger=require(_0x1843('0x2'))(_0x1843('0x3'));var moment=require('moment');var BPromise=require(_0x1843('0x4'));var rp=require(_0x1843('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1843('0x6'));var config=require(_0x1843('0x7'));var attributes=require(_0x1843('0x8'));module[_0x1843('0x9')]=function(_0x424d51,_0x4a6473){return _0x424d51[_0x1843('0xa')](_0x1843('0xb'),attributes,{'tableName':_0x1843('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9bc=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','mail_servers_in'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xd9bc,0xb0));var _0xcd9b=function(_0x56a019,_0x932b8e){_0x56a019=_0x56a019-0x0;var _0x4ebe59=_0xd9bc[_0x56a019];return _0x4ebe59;};'use strict';var _=require(_0xcd9b('0x0'));var util=require(_0xcd9b('0x1'));var logger=require(_0xcd9b('0x2'))(_0xcd9b('0x3'));var moment=require('moment');var BPromise=require(_0xcd9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd9b('0x5'));var rimraf=require(_0xcd9b('0x6'));var config=require(_0xcd9b('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xcd9b('0x8')]=function(_0x53c685,_0xe1bb28){return _0x53c685[_0xcd9b('0x9')]('MailServerIn',attributes,{'tableName':_0xcd9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 6ac2cd8..d3eba8f 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 _0xaffb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','MailServerIn','findAll','options','where','include','map','model','attributes','GetMailServerIn','debug','lodash','util','randomstring'];(function(_0x4977e7,_0x107f9b){var _0x185c52=function(_0x485192){while(--_0x485192){_0x4977e7['push'](_0x4977e7['shift']());}};_0x185c52(++_0x107f9b);}(_0xaffb,0x85));var _0xbaff=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0xaffb[_0x330141];return _0x1b68a2;};'use strict';var _=require(_0xbaff('0x0'));var util=require(_0xbaff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbaff('0x2'));var fs=require('fs');var Redis=require(_0xbaff('0x3'));var db=require(_0xbaff('0x4'))['db'];var utils=require(_0xbaff('0x5'));var logger=require(_0xbaff('0x6'))(_0xbaff('0x7'));var config=require(_0xbaff('0x8'));var jayson=require(_0xbaff('0x9'));var client=jayson[_0xbaff('0xa')][_0xbaff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f861e,_0xc23ea4,_0x295e39){return new BPromise(function(_0x34c512,_0x73a3d1){return client[_0xbaff('0xc')](_0x3f861e,_0x295e39)[_0xbaff('0xd')](function(_0x3c3d36){logger['info'](_0xbaff('0xe'),_0xc23ea4,'request\x20sent');logger['debug'](_0xbaff('0xf'),_0xc23ea4,'request\x20sent',JSON[_0xbaff('0x10')](_0x3c3d36));if(_0x3c3d36[_0xbaff('0x11')]){if(_0x3c3d36[_0xbaff('0x11')][_0xbaff('0x12')]===0x1f4){logger[_0xbaff('0x11')]('MailServerIn,\x20%s,\x20%s',_0xc23ea4,_0x3c3d36[_0xbaff('0x11')][_0xbaff('0x13')]);return _0x73a3d1(_0x3c3d36['error'][_0xbaff('0x13')]);}logger[_0xbaff('0x11')](_0xbaff('0xe'),_0xc23ea4,_0x3c3d36[_0xbaff('0x11')]['message']);return _0x34c512(_0x3c3d36[_0xbaff('0x11')][_0xbaff('0x13')]);}else{logger[_0xbaff('0x14')](_0xbaff('0xe'),_0xc23ea4,_0xbaff('0x15'));_0x34c512(_0x3c3d36[_0xbaff('0x16')][_0xbaff('0x13')]);}})[_0xbaff('0x17')](function(_0xb40a10){logger[_0xbaff('0x11')](_0xbaff('0xe'),_0xc23ea4,_0xb40a10);_0x73a3d1(_0xb40a10);});});}exports['GetMailServerIn']=function(_0x5809a5){var _0x30ff3d=this;return new Promise(function(_0x12e5c8,_0x3ab75a){return db[_0xbaff('0x18')][_0xbaff('0x19')]({'raw':_0x5809a5[_0xbaff('0x1a')]?_0x5809a5[_0xbaff('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5809a5[_0xbaff('0x1a')]?_0x5809a5[_0xbaff('0x1a')][_0xbaff('0x1b')]||null:null,'attributes':_0x5809a5[_0xbaff('0x1a')]?_0x5809a5['options']['attributes']||null:null,'limit':_0x5809a5['options']?_0x5809a5[_0xbaff('0x1a')]['limit']||null:null,'include':_0x5809a5[_0xbaff('0x1a')]?_0x5809a5[_0xbaff('0x1a')][_0xbaff('0x1c')]?_[_0xbaff('0x1d')](_0x5809a5[_0xbaff('0x1a')][_0xbaff('0x1c')],function(_0x1cd6d0){return{'model':db[_0x1cd6d0[_0xbaff('0x1e')]],'as':_0x1cd6d0['as'],'attributes':_0x1cd6d0[_0xbaff('0x1f')],'include':_0x1cd6d0['include']?_['map'](_0x1cd6d0[_0xbaff('0x1c')],function(_0x4a6c52){return{'model':db[_0x4a6c52['model']],'as':_0x4a6c52['as'],'attributes':_0x4a6c52[_0xbaff('0x1f')],'include':_0x4a6c52[_0xbaff('0x1c')]?_['map'](_0x4a6c52['include'],function(_0x15e07a){return{'model':db[_0x15e07a['model']],'as':_0x15e07a['as'],'attributes':_0x15e07a[_0xbaff('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbaff('0xd')](function(_0x581d6c){logger['info'](_0xbaff('0x20'),_0x5809a5);logger[_0xbaff('0x21')](_0xbaff('0x20'),_0x5809a5,JSON['stringify'](_0x581d6c));_0x12e5c8(_0x581d6c);})[_0xbaff('0x17')](function(_0x2d6a58){logger[_0xbaff('0x11')](_0xbaff('0x20'),_0x2d6a58[_0xbaff('0x13')],_0x5809a5);_0x3ab75a(_0x30ff3d[_0xbaff('0x11')](0x1f4,_0x2d6a58[_0xbaff('0x13')]));});});}; \ No newline at end of file +var _0x636f=['jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4f441e,_0x31407b){var _0x3d58d1=function(_0x40f592){while(--_0x40f592){_0x4f441e['push'](_0x4f441e['shift']());}};_0x3d58d1(++_0x31407b);}(_0x636f,0x164));var _0xf636=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x636f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf636('0x0'));var util=require(_0xf636('0x1'));var moment=require(_0xf636('0x2'));var BPromise=require(_0xf636('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf636('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf636('0x5'));var logger=require(_0xf636('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf636('0x7'));var client=jayson[_0xf636('0x8')][_0xf636('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x82fad8,_0x1dbb4c,_0x2211dd){return new BPromise(function(_0x24243b,_0x1de521){return client[_0xf636('0xa')](_0x82fad8,_0x2211dd)['then'](function(_0x25bf2c){logger[_0xf636('0xb')](_0xf636('0xc'),_0x1dbb4c,_0xf636('0xd'));logger[_0xf636('0xe')](_0xf636('0xf'),_0x1dbb4c,_0xf636('0xd'),JSON[_0xf636('0x10')](_0x25bf2c));if(_0x25bf2c[_0xf636('0x11')]){if(_0x25bf2c['error'][_0xf636('0x12')]===0x1f4){logger[_0xf636('0x11')](_0xf636('0xc'),_0x1dbb4c,_0x25bf2c[_0xf636('0x11')][_0xf636('0x13')]);return _0x1de521(_0x25bf2c['error'][_0xf636('0x13')]);}logger[_0xf636('0x11')](_0xf636('0xc'),_0x1dbb4c,_0x25bf2c['error'][_0xf636('0x13')]);return _0x24243b(_0x25bf2c[_0xf636('0x11')][_0xf636('0x13')]);}else{logger[_0xf636('0xb')](_0xf636('0xc'),_0x1dbb4c,_0xf636('0xd'));_0x24243b(_0x25bf2c[_0xf636('0x14')][_0xf636('0x13')]);}})[_0xf636('0x15')](function(_0x29731e){logger[_0xf636('0x11')](_0xf636('0xc'),_0x1dbb4c,_0x29731e);_0x1de521(_0x29731e);});});}exports[_0xf636('0x16')]=function(_0x3e09fa){var _0x3e87ae=this;return new Promise(function(_0x567217,_0x543166){return db[_0xf636('0x17')]['findAll']({'raw':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x19')]===undefined?!![]:![]:!![],'where':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x1a')]||null:null,'attributes':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x1b')]||null:null,'limit':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa[_0xf636('0x18')][_0xf636('0x1c')]||null:null,'include':_0x3e09fa[_0xf636('0x18')]?_0x3e09fa['options']['include']?_[_0xf636('0x1d')](_0x3e09fa[_0xf636('0x18')][_0xf636('0x1e')],function(_0xcd993a){return{'model':db[_0xcd993a[_0xf636('0x1f')]],'as':_0xcd993a['as'],'attributes':_0xcd993a[_0xf636('0x1b')],'include':_0xcd993a['include']?_[_0xf636('0x1d')](_0xcd993a[_0xf636('0x1e')],function(_0x4a49d5){return{'model':db[_0x4a49d5[_0xf636('0x1f')]],'as':_0x4a49d5['as'],'attributes':_0x4a49d5['attributes'],'include':_0x4a49d5[_0xf636('0x1e')]?_[_0xf636('0x1d')](_0x4a49d5[_0xf636('0x1e')],function(_0x5df730){return{'model':db[_0x5df730[_0xf636('0x1f')]],'as':_0x5df730['as'],'attributes':_0x5df730['attributes']};}):[]};}):[]};}):[]:[]})[_0xf636('0x20')](function(_0x3d27b5){logger[_0xf636('0xb')](_0xf636('0x16'),_0x3e09fa);logger[_0xf636('0xe')](_0xf636('0x16'),_0x3e09fa,JSON[_0xf636('0x10')](_0x3d27b5));_0x567217(_0x3d27b5);})['catch'](function(_0x2ec042){logger[_0xf636('0x11')](_0xf636('0x16'),_0x2ec042[_0xf636('0x13')],_0x3e09fa);_0x543166(_0x3e87ae[_0xf636('0x11')](0x1f4,_0x2ec042['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index f90aae8..d0cd39b 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x41428a,_0x158e57){_0x41428a=_0x41428a-0x0;var _0x143c34=_0x7a54[_0x41428a];return _0x143c34;};'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 aea4892..f236543 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 _0xeffd=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x41c571,_0x58149b){var _0x4313e4=function(_0x3fc016){while(--_0x3fc016){_0x41c571['push'](_0x41c571['shift']());}};_0x4313e4(++_0x58149b);}(_0xeffd,0x6b));var _0xdeff=function(_0x43e679,_0x2a3494){_0x43e679=_0x43e679-0x0;var _0x383025=_0xeffd[_0x43e679];return _0x383025;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'description':{'type':Sequelize[_0xdeff('0x1')]},'host':{'type':Sequelize[_0xdeff('0x1')]},'user':{'type':Sequelize[_0xdeff('0x1')]},'pass':{'type':Sequelize[_0xdeff('0x1')]},'port':{'type':Sequelize[_0xdeff('0x2')]},'secure':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xdeff('0x1')]},'authentication':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1be1=['STRING','INTEGER','BOOLEAN'];(function(_0x4c4e5c,_0x2c9c8){var _0x1db97e=function(_0x4a6ea1){while(--_0x4a6ea1){_0x4c4e5c['push'](_0x4c4e5c['shift']());}};_0x1db97e(++_0x2c9c8);}(_0x1be1,0x192));var _0x11be=function(_0xf8ae4f,_0x4a89a9){_0xf8ae4f=_0xf8ae4f-0x0;var _0x23d381=_0x1be1[_0xf8ae4f];return _0x23d381;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x11be('0x0')]},'host':{'type':Sequelize[_0x11be('0x0')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x11be('0x0')]},'port':{'type':Sequelize[_0x11be('0x1')]},'secure':{'type':Sequelize[_0x11be('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x11be('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x11be('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 224579e..2747d04 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 _0x20bf=['map','MailServerOut','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','create','body','find','destroy','rimraf','zip-dir','moment','bluebird','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','stack','name','send','index'];(function(_0x942e0a,_0x3648f5){var _0x44254c=function(_0x525013){while(--_0x525013){_0x942e0a['push'](_0x942e0a['shift']());}};_0x44254c(++_0x3648f5);}(_0x20bf,0x68));var _0xf20b=function(_0x51fd24,_0x4523de){_0x51fd24=_0x51fd24-0x0;var _0x30f1b1=_0x20bf[_0x51fd24];return _0x30f1b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf20b('0x0'));var zipdir=require(_0xf20b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf20b('0x2'));var BPromise=require(_0xf20b('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf20b('0x4'));var sox=require(_0xf20b('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf20b('0x6'));var jsforce=require(_0xf20b('0x7'));var deskjs=require(_0xf20b('0x8'));var toCsv=require(_0xf20b('0x9'));var querystring=require(_0xf20b('0xa'));var Papa=require(_0xf20b('0xb'));var Redis=require(_0xf20b('0xc'));var authService=require(_0xf20b('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf20b('0xe'));var logger=require(_0xf20b('0xf'))(_0xf20b('0x10'));var utils=require(_0xf20b('0x11'));var config=require(_0xf20b('0x12'));var licenseUtil=require(_0xf20b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11d47f,_0x1f5e2d){_0x1f5e2d=_0x1f5e2d||0xcc;return function(_0x1faaec){if(_0x1faaec){return _0x11d47f['sendStatus'](_0x1f5e2d);}return _0x11d47f[_0xf20b('0x14')](_0x1f5e2d)[_0xf20b('0x15')]();};}function respondWithResult(_0x1b769e,_0x54b003){_0x54b003=_0x54b003||0xc8;return function(_0x147586){if(_0x147586){return _0x1b769e[_0xf20b('0x14')](_0x54b003)[_0xf20b('0x16')](_0x147586);}};}function respondWithFilteredResult(_0x215e4a,_0x1522aa){return function(_0x399b8f){if(_0x399b8f){var _0x569909=typeof _0x1522aa[_0xf20b('0x17')]===_0xf20b('0x18')&&typeof _0x1522aa[_0xf20b('0x19')]===_0xf20b('0x18');var _0x350c2f=_0x399b8f[_0xf20b('0x1a')];var _0x5d1006=_0x569909?0x0:_0x1522aa[_0xf20b('0x17')];var _0x286031=_0x569909?_0x399b8f[_0xf20b('0x1a')]:_0x1522aa['offset']+_0x1522aa[_0xf20b('0x19')];var _0x2f1c0c;if(_0x286031>=_0x350c2f){_0x286031=_0x350c2f;_0x2f1c0c=0xc8;}else{_0x2f1c0c=0xce;}_0x215e4a['status'](_0x2f1c0c);return _0x215e4a[_0xf20b('0x1b')]('Content-Range',_0x5d1006+'-'+_0x286031+'/'+_0x350c2f)[_0xf20b('0x16')](_0x399b8f);}return null;};}function patchUpdates(_0x9d0a2a){return function(_0x39cd79){try{jsonpatch[_0xf20b('0x1c')](_0x39cd79,_0x9d0a2a,!![]);}catch(_0x49df41){return BPromise[_0xf20b('0x1d')](_0x49df41);}return _0x39cd79[_0xf20b('0x1e')]();};}function saveUpdates(_0x1047e4,_0x5ed707){return function(_0x416493){if(_0x416493){return _0x416493[_0xf20b('0x1f')](_0x1047e4)[_0xf20b('0x20')](function(_0x3f9189){return _0x3f9189;});}return null;};}function removeEntity(_0x2fdd32,_0x2d5246){return function(_0x4c70e2){if(_0x4c70e2){return _0x4c70e2['destroy']()[_0xf20b('0x20')](function(){_0x2fdd32[_0xf20b('0x14')](0xcc)[_0xf20b('0x15')]();});}};}function handleEntityNotFound(_0x92aed,_0x41ce79){return function(_0x3da102){if(!_0x3da102){_0x92aed[_0xf20b('0x21')](0x194);}return _0x3da102;};}function handleError(_0x5ef864,_0x13ec4d){_0x13ec4d=_0x13ec4d||0x1f4;return function(_0x1a7ceb){logger['error'](_0x1a7ceb[_0xf20b('0x22')]);if(_0x1a7ceb[_0xf20b('0x23')]){delete _0x1a7ceb[_0xf20b('0x23')];}_0x5ef864[_0xf20b('0x14')](_0x13ec4d)[_0xf20b('0x24')](_0x1a7ceb);};}exports[_0xf20b('0x25')]=function(_0x59c3b5,_0x16502b){var _0x5ecac4={},_0xb8564c={},_0x54eaa1={'count':0x0,'rows':[]};var _0x517100=_[_0xf20b('0x26')](db[_0xf20b('0x27')]['rawAttributes'],function(_0x5167f6){return{'name':_0x5167f6[_0xf20b('0x28')],'type':_0x5167f6[_0xf20b('0x29')]['key']};});_0xb8564c[_0xf20b('0x2a')]=_[_0xf20b('0x26')](_0x517100,_0xf20b('0x23'));_0xb8564c['query']=_['keys'](_0x59c3b5[_0xf20b('0x2b')]);_0xb8564c[_0xf20b('0x2c')]=_['intersection'](_0xb8564c[_0xf20b('0x2a')],_0xb8564c[_0xf20b('0x2b')]);_0x5ecac4[_0xf20b('0x2d')]=_[_0xf20b('0x2e')](_0xb8564c[_0xf20b('0x2a')],qs[_0xf20b('0x2f')](_0x59c3b5['query'][_0xf20b('0x2f')]));_0x5ecac4[_0xf20b('0x2d')]=_0x5ecac4[_0xf20b('0x2d')][_0xf20b('0x30')]?_0x5ecac4[_0xf20b('0x2d')]:_0xb8564c[_0xf20b('0x2a')];if(!_0x59c3b5['query'][_0xf20b('0x31')](_0xf20b('0x32'))){_0x5ecac4[_0xf20b('0x19')]=qs[_0xf20b('0x19')](_0x59c3b5[_0xf20b('0x2b')]['limit']);_0x5ecac4[_0xf20b('0x17')]=qs[_0xf20b('0x17')](_0x59c3b5[_0xf20b('0x2b')][_0xf20b('0x17')]);}_0x5ecac4[_0xf20b('0x33')]=qs[_0xf20b('0x34')](_0x59c3b5[_0xf20b('0x2b')][_0xf20b('0x34')]);_0x5ecac4[_0xf20b('0x35')]=qs[_0xf20b('0x2c')](_['pick'](_0x59c3b5['query'],_0xb8564c['filters']),_0x517100);if(_0x59c3b5['query'][_0xf20b('0x36')]){_0x5ecac4[_0xf20b('0x35')]=_[_0xf20b('0x37')](_0x5ecac4[_0xf20b('0x35')],{'$or':_['map'](_0x517100,function(_0x5e85d3){if(_0x5e85d3[_0xf20b('0x29')]!==_0xf20b('0x38')){var _0x1774ee={};_0x1774ee[_0x5e85d3[_0xf20b('0x23')]]={'$like':'%'+_0x59c3b5[_0xf20b('0x2b')]['filter']+'%'};return _0x1774ee;}})});}_0x5ecac4=_[_0xf20b('0x37')]({},_0x5ecac4,_0x59c3b5[_0xf20b('0x39')]);var _0x4c10a2={'where':_0x5ecac4[_0xf20b('0x35')]};return db['MailServerOut'][_0xf20b('0x1a')](_0x4c10a2)[_0xf20b('0x20')](function(_0x48b129){_0x54eaa1['count']=_0x48b129;if(_0x59c3b5[_0xf20b('0x2b')]['includeAll']){_0x5ecac4[_0xf20b('0x3a')]=[{'all':!![]}];}return db[_0xf20b('0x27')][_0xf20b('0x3b')](_0x5ecac4);})['then'](function(_0x43aedb){_0x54eaa1[_0xf20b('0x3c')]=_0x43aedb;return _0x54eaa1;})[_0xf20b('0x20')](respondWithFilteredResult(_0x16502b,_0x5ecac4))[_0xf20b('0x3d')](handleError(_0x16502b,null));};exports[_0xf20b('0x3e')]=function(_0x1b3ba8,_0x522b8d){var _0x400b0a={'raw':!![],'where':{'id':_0x1b3ba8[_0xf20b('0x3f')]['id']}},_0x3543e0={};_0x3543e0['model']=_[_0xf20b('0x40')](db[_0xf20b('0x27')][_0xf20b('0x41')]);_0x3543e0['query']=_[_0xf20b('0x40')](_0x1b3ba8[_0xf20b('0x2b')]);_0x3543e0['filters']=_[_0xf20b('0x2e')](_0x3543e0[_0xf20b('0x2a')],_0x3543e0[_0xf20b('0x2b')]);_0x400b0a[_0xf20b('0x2d')]=_[_0xf20b('0x2e')](_0x3543e0[_0xf20b('0x2a')],qs['fields'](_0x1b3ba8['query'][_0xf20b('0x2f')]));_0x400b0a[_0xf20b('0x2d')]=_0x400b0a['attributes'][_0xf20b('0x30')]?_0x400b0a[_0xf20b('0x2d')]:_0x3543e0[_0xf20b('0x2a')];if(_0x1b3ba8[_0xf20b('0x2b')][_0xf20b('0x42')]){_0x400b0a[_0xf20b('0x3a')]=[{'all':!![]}];}_0x400b0a=_[_0xf20b('0x37')]({},_0x400b0a,_0x1b3ba8[_0xf20b('0x39')]);return db[_0xf20b('0x27')]['find'](_0x400b0a)['then'](handleEntityNotFound(_0x522b8d,null))[_0xf20b('0x20')](respondWithResult(_0x522b8d,null))[_0xf20b('0x3d')](handleError(_0x522b8d,null));};exports['create']=function(_0x4c2971,_0x1d11da){return db[_0xf20b('0x27')][_0xf20b('0x43')](_0x4c2971['body'],{})[_0xf20b('0x20')](respondWithResult(_0x1d11da,0xc9))[_0xf20b('0x3d')](handleError(_0x1d11da,null));};exports[_0xf20b('0x1f')]=function(_0x31e562,_0x2c7b0a){if(_0x31e562['body']['id']){delete _0x31e562[_0xf20b('0x44')]['id'];}return db['MailServerOut'][_0xf20b('0x45')]({'where':{'id':_0x31e562[_0xf20b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2c7b0a,null))[_0xf20b('0x20')](saveUpdates(_0x31e562[_0xf20b('0x44')],null))[_0xf20b('0x20')](respondWithResult(_0x2c7b0a,null))[_0xf20b('0x3d')](handleError(_0x2c7b0a,null));};exports[_0xf20b('0x46')]=function(_0x55989a,_0x3f32b6){return db[_0xf20b('0x27')][_0xf20b('0x45')]({'where':{'id':_0x55989a[_0xf20b('0x3f')]['id']}})[_0xf20b('0x20')](handleEntityNotFound(_0x3f32b6,null))[_0xf20b('0x20')](removeEntity(_0x3f32b6,null))[_0xf20b('0x3d')](handleError(_0x3f32b6,null));}; \ No newline at end of file +var _0xd87d=['mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','map','MailServerOut','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x226be1,_0x43af94){var _0x2abb6c=function(_0x123d05){while(--_0x123d05){_0x226be1['push'](_0x226be1['shift']());}};_0x2abb6c(++_0x43af94);}(_0xd87d,0x86));var _0xdd87=function(_0x36af4e,_0x1ac3d0){_0x36af4e=_0x36af4e-0x0;var _0x598ad3=_0xd87d[_0x36af4e];return _0x598ad3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd87('0x0'));var zipdir=require(_0xdd87('0x1'));var jsonpatch=require(_0xdd87('0x2'));var rp=require('request-promise');var moment=require(_0xdd87('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd87('0x4'));var util=require(_0xdd87('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xdd87('0x6'));var ejs=require(_0xdd87('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd87('0x8'));var squel=require('squel');var crypto=require(_0xdd87('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xdd87('0xa'));var toCsv=require(_0xdd87('0x6'));var querystring=require(_0xdd87('0xb'));var Papa=require('papaparse');var Redis=require(_0xdd87('0xc'));var authService=require(_0xdd87('0xd'));var qs=require(_0xdd87('0xe'));var as=require(_0xdd87('0xf'));var hardwareService=require(_0xdd87('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdd87('0x11'));var licenseUtil=require(_0xdd87('0x12'));var db=require(_0xdd87('0x13'))['db'];function respondWithStatusCode(_0x3ede09,_0xaec724){_0xaec724=_0xaec724||0xcc;return function(_0x434751){if(_0x434751){return _0x3ede09['sendStatus'](_0xaec724);}return _0x3ede09[_0xdd87('0x14')](_0xaec724)[_0xdd87('0x15')]();};}function respondWithResult(_0x2539af,_0x4fb9ee){_0x4fb9ee=_0x4fb9ee||0xc8;return function(_0x5e61ed){if(_0x5e61ed){return _0x2539af[_0xdd87('0x14')](_0x4fb9ee)[_0xdd87('0x16')](_0x5e61ed);}};}function respondWithFilteredResult(_0x4925ec,_0x58eed3){return function(_0xebf891){if(_0xebf891){var _0xaa9774=typeof _0x58eed3[_0xdd87('0x17')]==='undefined'&&typeof _0x58eed3['limit']===_0xdd87('0x18');var _0x15986e=_0xebf891[_0xdd87('0x19')];var _0x570f4c=_0xaa9774?0x0:_0x58eed3['offset'];var _0x214b40=_0xaa9774?_0xebf891[_0xdd87('0x19')]:_0x58eed3[_0xdd87('0x17')]+_0x58eed3['limit'];var _0x5dc943;if(_0x214b40>=_0x15986e){_0x214b40=_0x15986e;_0x5dc943=0xc8;}else{_0x5dc943=0xce;}_0x4925ec[_0xdd87('0x14')](_0x5dc943);return _0x4925ec[_0xdd87('0x1a')](_0xdd87('0x1b'),_0x570f4c+'-'+_0x214b40+'/'+_0x15986e)[_0xdd87('0x16')](_0xebf891);}return null;};}function patchUpdates(_0x380f3d){return function(_0xfd28b7){try{jsonpatch[_0xdd87('0x1c')](_0xfd28b7,_0x380f3d,!![]);}catch(_0x52268a){return BPromise[_0xdd87('0x1d')](_0x52268a);}return _0xfd28b7[_0xdd87('0x1e')]();};}function saveUpdates(_0x4a433a,_0x1a13e0){return function(_0x55d2b3){if(_0x55d2b3){return _0x55d2b3[_0xdd87('0x1f')](_0x4a433a)[_0xdd87('0x20')](function(_0xf321f4){return _0xf321f4;});}return null;};}function removeEntity(_0x3e16b7,_0x44f53b){return function(_0x3691d6){if(_0x3691d6){return _0x3691d6[_0xdd87('0x21')]()[_0xdd87('0x20')](function(){_0x3e16b7['status'](0xcc)[_0xdd87('0x15')]();});}};}function handleEntityNotFound(_0x313fce,_0x209488){return function(_0x45502d){if(!_0x45502d){_0x313fce[_0xdd87('0x22')](0x194);}return _0x45502d;};}function handleError(_0x260a71,_0x40c4ce){_0x40c4ce=_0x40c4ce||0x1f4;return function(_0x42c646){logger[_0xdd87('0x23')](_0x42c646['stack']);if(_0x42c646[_0xdd87('0x24')]){delete _0x42c646[_0xdd87('0x24')];}_0x260a71['status'](_0x40c4ce)['send'](_0x42c646);};}exports['index']=function(_0x7bcec7,_0x17c2e7){var _0x5e5799={},_0x5ee6f3={},_0x4b26ba={'count':0x0,'rows':[]};var _0x8b2eb8=_[_0xdd87('0x25')](db[_0xdd87('0x26')][_0xdd87('0x27')],function(_0x347f89){return{'name':_0x347f89['fieldName'],'type':_0x347f89[_0xdd87('0x28')][_0xdd87('0x29')]};});_0x5ee6f3[_0xdd87('0x2a')]=_[_0xdd87('0x25')](_0x8b2eb8,_0xdd87('0x24'));_0x5ee6f3['query']=_[_0xdd87('0x2b')](_0x7bcec7[_0xdd87('0x2c')]);_0x5ee6f3[_0xdd87('0x2d')]=_['intersection'](_0x5ee6f3['model'],_0x5ee6f3[_0xdd87('0x2c')]);_0x5e5799[_0xdd87('0x2e')]=_[_0xdd87('0x2f')](_0x5ee6f3['model'],qs['fields'](_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x30')]));_0x5e5799[_0xdd87('0x2e')]=_0x5e5799['attributes']['length']?_0x5e5799[_0xdd87('0x2e')]:_0x5ee6f3[_0xdd87('0x2a')];if(!_0x7bcec7['query'][_0xdd87('0x31')](_0xdd87('0x32'))){_0x5e5799[_0xdd87('0x33')]=qs[_0xdd87('0x33')](_0x7bcec7[_0xdd87('0x2c')]['limit']);_0x5e5799[_0xdd87('0x17')]=qs[_0xdd87('0x17')](_0x7bcec7[_0xdd87('0x2c')]['offset']);}_0x5e5799[_0xdd87('0x34')]=qs[_0xdd87('0x35')](_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x35')]);_0x5e5799[_0xdd87('0x36')]=qs[_0xdd87('0x2d')](_['pick'](_0x7bcec7[_0xdd87('0x2c')],_0x5ee6f3['filters']),_0x8b2eb8);if(_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x37')]){_0x5e5799[_0xdd87('0x36')]=_[_0xdd87('0x38')](_0x5e5799['where'],{'$or':_[_0xdd87('0x25')](_0x8b2eb8,function(_0xe3d90a){if(_0xe3d90a[_0xdd87('0x28')]!==_0xdd87('0x39')){var _0x43b56b={};_0x43b56b[_0xe3d90a[_0xdd87('0x24')]]={'$like':'%'+_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x37')]+'%'};return _0x43b56b;}})});}_0x5e5799=_[_0xdd87('0x38')]({},_0x5e5799,_0x7bcec7['options']);var _0x282640={'where':_0x5e5799[_0xdd87('0x36')]};return db['MailServerOut'][_0xdd87('0x19')](_0x282640)[_0xdd87('0x20')](function(_0x56dc80){_0x4b26ba['count']=_0x56dc80;if(_0x7bcec7[_0xdd87('0x2c')][_0xdd87('0x3a')]){_0x5e5799[_0xdd87('0x3b')]=[{'all':!![]}];}return db[_0xdd87('0x26')][_0xdd87('0x3c')](_0x5e5799);})[_0xdd87('0x20')](function(_0x164337){_0x4b26ba[_0xdd87('0x3d')]=_0x164337;return _0x4b26ba;})[_0xdd87('0x20')](respondWithFilteredResult(_0x17c2e7,_0x5e5799))[_0xdd87('0x3e')](handleError(_0x17c2e7,null));};exports[_0xdd87('0x3f')]=function(_0x31ec2f,_0x3a47d4){var _0x907263={'raw':!![],'where':{'id':_0x31ec2f[_0xdd87('0x40')]['id']}},_0x29350d={};_0x29350d['model']=_[_0xdd87('0x2b')](db[_0xdd87('0x26')][_0xdd87('0x27')]);_0x29350d['query']=_[_0xdd87('0x2b')](_0x31ec2f[_0xdd87('0x2c')]);_0x29350d['filters']=_[_0xdd87('0x2f')](_0x29350d[_0xdd87('0x2a')],_0x29350d[_0xdd87('0x2c')]);_0x907263[_0xdd87('0x2e')]=_[_0xdd87('0x2f')](_0x29350d[_0xdd87('0x2a')],qs[_0xdd87('0x30')](_0x31ec2f[_0xdd87('0x2c')][_0xdd87('0x30')]));_0x907263[_0xdd87('0x2e')]=_0x907263[_0xdd87('0x2e')]['length']?_0x907263[_0xdd87('0x2e')]:_0x29350d['model'];if(_0x31ec2f[_0xdd87('0x2c')][_0xdd87('0x3a')]){_0x907263[_0xdd87('0x3b')]=[{'all':!![]}];}_0x907263=_[_0xdd87('0x38')]({},_0x907263,_0x31ec2f[_0xdd87('0x41')]);return db['MailServerOut'][_0xdd87('0x42')](_0x907263)['then'](handleEntityNotFound(_0x3a47d4,null))[_0xdd87('0x20')](respondWithResult(_0x3a47d4,null))[_0xdd87('0x3e')](handleError(_0x3a47d4,null));};exports[_0xdd87('0x43')]=function(_0x463ff4,_0x1ddfb0){return db['MailServerOut']['create'](_0x463ff4[_0xdd87('0x44')],{})[_0xdd87('0x20')](respondWithResult(_0x1ddfb0,0xc9))['catch'](handleError(_0x1ddfb0,null));};exports[_0xdd87('0x1f')]=function(_0x36e7c9,_0x43599d){if(_0x36e7c9[_0xdd87('0x44')]['id']){delete _0x36e7c9[_0xdd87('0x44')]['id'];}return db[_0xdd87('0x26')][_0xdd87('0x42')]({'where':{'id':_0x36e7c9[_0xdd87('0x40')]['id']}})[_0xdd87('0x20')](handleEntityNotFound(_0x43599d,null))[_0xdd87('0x20')](saveUpdates(_0x36e7c9[_0xdd87('0x44')],null))[_0xdd87('0x20')](respondWithResult(_0x43599d,null))[_0xdd87('0x3e')](handleError(_0x43599d,null));};exports[_0xdd87('0x21')]=function(_0x1f0537,_0x1086da){return db[_0xdd87('0x26')]['find']({'where':{'id':_0x1f0537[_0xdd87('0x40')]['id']}})[_0xdd87('0x20')](handleEntityNotFound(_0x1086da,null))[_0xdd87('0x20')](removeEntity(_0x1086da,null))[_0xdd87('0x3e')](handleError(_0x1086da,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 9c69c37..e6490f8 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 _0x04c0=['bluebird','rimraf','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','api','moment'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x04c0,0x88));var _0x004c=function(_0x4ba95a,_0xf6c43a){_0x4ba95a=_0x4ba95a-0x0;var _0xb110f9=_0x04c0[_0x4ba95a];return _0xb110f9;};'use strict';var _=require(_0x004c('0x0'));var util=require(_0x004c('0x1'));var logger=require('../../config/logger')(_0x004c('0x2'));var moment=require(_0x004c('0x3'));var BPromise=require(_0x004c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x004c('0x5'));var config=require('../../config/environment');var attributes=require(_0x004c('0x6'));module[_0x004c('0x7')]=function(_0x10c1ed,_0x1f0172){return _0x10c1ed[_0x004c('0x8')](_0x004c('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x536b=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','util','../../config/logger'];(function(_0x3799cd,_0x131494){var _0x3410d3=function(_0x4a742b){while(--_0x4a742b){_0x3799cd['push'](_0x3799cd['shift']());}};_0x3410d3(++_0x131494);}(_0x536b,0x15e));var _0xb536=function(_0x305b49,_0x17ed26){_0x305b49=_0x305b49-0x0;var _0x364e28=_0x536b[_0x305b49];return _0x364e28;};'use strict';var _=require('lodash');var util=require(_0xb536('0x0'));var logger=require(_0xb536('0x1'))(_0xb536('0x2'));var moment=require('moment');var BPromise=require(_0xb536('0x3'));var rp=require(_0xb536('0x4'));var fs=require('fs');var path=require(_0xb536('0x5'));var rimraf=require(_0xb536('0x6'));var config=require(_0xb536('0x7'));var attributes=require(_0xb536('0x8'));module[_0xb536('0x9')]=function(_0x3bdc3a,_0x176048){return _0x3bdc3a[_0xb536('0xa')]('MailServerOut',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 1914716..a33b77b 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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1363b4,_0x2ef0aa){_0x1363b4=_0x1363b4-0x0;var _0x537351=_0x7a54[_0x1363b4];return _0x537351;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x44471b,_0x43713a){var _0x52a9ba=function(_0x38186d){while(--_0x38186d){_0x44471b['push'](_0x44471b['shift']());}};_0x52a9ba(++_0x43713a);}(_0x1261,0x144));var _0x1126=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0x1261[_0x2a5b3b];return _0xae665a;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ed9d399..563d927 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 _0xcfa0=['exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy'];(function(_0x4927cb,_0x5cb098){var _0x5d0b2c=function(_0x2ed0b6){while(--_0x2ed0b6){_0x4927cb['push'](_0x4927cb['shift']());}};_0x5d0b2c(++_0x5cb098);}(_0xcfa0,0x131));var _0x0cfa=function(_0x233277,_0x2568a0){_0x233277=_0x233277-0x0;var _0x5d215e=_0xcfa0[_0x233277];return _0x5d215e;};'use strict';var multer=require(_0x0cfa('0x0'));var util=require(_0x0cfa('0x1'));var path=require(_0x0cfa('0x2'));var timeout=require(_0x0cfa('0x3'));var express=require(_0x0cfa('0x4'));var router=express['Router']();var fs_extra=require(_0x0cfa('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cfa('0x6'));var controller=require(_0x0cfa('0x7'));router[_0x0cfa('0x8')]('/',auth[_0x0cfa('0x9')](),controller['index']);router[_0x0cfa('0x8')](_0x0cfa('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0cfa('0x8')](_0x0cfa('0xb'),auth['isAuthenticated'](),controller[_0x0cfa('0xc')]);router['post']('/',auth[_0x0cfa('0x9')](),controller[_0x0cfa('0xd')]);router[_0x0cfa('0xe')]('/:id',auth[_0x0cfa('0x9')](),controller[_0x0cfa('0xf')]);router[_0x0cfa('0x10')](_0x0cfa('0xb'),auth[_0x0cfa('0x9')](),controller[_0x0cfa('0x11')]);module[_0x0cfa('0x12')]=router; \ No newline at end of file +var _0xa4f1=['get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller'];(function(_0x33e375,_0x485a8d){var _0x4de504=function(_0x2c215a){while(--_0x2c215a){_0x33e375['push'](_0x33e375['shift']());}};_0x4de504(++_0x485a8d);}(_0xa4f1,0xf4));var _0x1a4f=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xa4f1[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0x1a4f('0x0'));var util=require(_0x1a4f('0x1'));var path=require(_0x1a4f('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a4f('0x3'));var router=express['Router']();var fs_extra=require(_0x1a4f('0x4'));var auth=require(_0x1a4f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a4f('0x6'));var controller=require(_0x1a4f('0x7'));router[_0x1a4f('0x8')]('/',auth[_0x1a4f('0x9')](),controller[_0x1a4f('0xa')]);router[_0x1a4f('0x8')](_0x1a4f('0xb'),auth['isAuthenticated'](),controller[_0x1a4f('0xc')]);router[_0x1a4f('0x8')]('/:id',auth[_0x1a4f('0x9')](),controller['show']);router[_0x1a4f('0xd')]('/',auth[_0x1a4f('0x9')](),controller[_0x1a4f('0xe')]);router[_0x1a4f('0xf')](_0x1a4f('0x10'),auth[_0x1a4f('0x9')](),controller[_0x1a4f('0x11')]);router[_0x1a4f('0x12')](_0x1a4f('0x10'),auth[_0x1a4f('0x9')](),controller[_0x1a4f('0x13')]);module[_0x1a4f('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d9c34c0..2a13f5a 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 _0x7ee1=['STRING','sequelize'];(function(_0x4d90a6,_0x2ecd04){var _0x49051f=function(_0x204efd){while(--_0x204efd){_0x4d90a6['push'](_0x4d90a6['shift']());}};_0x49051f(++_0x2ecd04);}(_0x7ee1,0x8d));var _0x17ee=function(_0x3a2a7f,_0x480a03){_0x3a2a7f=_0x3a2a7f-0x0;var _0x49ff8f=_0x7ee1[_0x3a2a7f];return _0x49ff8f;};'use strict';var Sequelize=require(_0x17ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x17ee('0x1')]}}; \ No newline at end of file +var _0xc03e=['sequelize','name'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xc03e,0x15a));var _0xec03=function(_0x1d1854,_0x4a83b1){_0x1d1854=_0x1d1854-0x0;var _0x5b2acb=_0xc03e[_0x1d1854];return _0x5b2acb;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xec03('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 8261a6b..cd325c7 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 _0xb98f=['rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','MailSubstatus','rows','catch','show','rawAttributes','intersection','include','find','create','body','params','describe','eml-format'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0xb98f,0xce));var _0xfb98=function(_0x2d6a06,_0x11d2e6){_0x2d6a06=_0x2d6a06-0x0;var _0x57eb9f=_0xb98f[_0x2d6a06];return _0x57eb9f;};'use strict';var emlformat=require(_0xfb98('0x0'));var rimraf=require(_0xfb98('0x1'));var zipdir=require(_0xfb98('0x2'));var jsonpatch=require(_0xfb98('0x3'));var rp=require(_0xfb98('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfb98('0x5'));var path=require(_0xfb98('0x6'));var sox=require(_0xfb98('0x7'));var csv=require(_0xfb98('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfb98('0x9'));var _=require(_0xfb98('0xa'));var squel=require('squel');var crypto=require(_0xfb98('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb98('0xc'));var authService=require(_0xfb98('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb98('0xe'));var logger=require('../../config/logger')(_0xfb98('0xf'));var utils=require(_0xfb98('0x10'));var config=require(_0xfb98('0x11'));var licenseUtil=require(_0xfb98('0x12'));var db=require(_0xfb98('0x13'))['db'];function respondWithStatusCode(_0x3cc48e,_0x77a949){_0x77a949=_0x77a949||0xcc;return function(_0x1c9933){if(_0x1c9933){return _0x3cc48e[_0xfb98('0x14')](_0x77a949);}return _0x3cc48e[_0xfb98('0x15')](_0x77a949)[_0xfb98('0x16')]();};}function respondWithResult(_0x3cdeb9,_0x14c9a3){_0x14c9a3=_0x14c9a3||0xc8;return function(_0x201b04){if(_0x201b04){return _0x3cdeb9['status'](_0x14c9a3)[_0xfb98('0x17')](_0x201b04);}};}function respondWithFilteredResult(_0x515864,_0x3e7e25){return function(_0x2d4efd){if(_0x2d4efd){var _0x3c6ca5=typeof _0x3e7e25[_0xfb98('0x18')]===_0xfb98('0x19')&&typeof _0x3e7e25['limit']===_0xfb98('0x19');var _0x174e4d=_0x2d4efd[_0xfb98('0x1a')];var _0x14b206=_0x3c6ca5?0x0:_0x3e7e25[_0xfb98('0x18')];var _0x15c4fa=_0x3c6ca5?_0x2d4efd[_0xfb98('0x1a')]:_0x3e7e25[_0xfb98('0x18')]+_0x3e7e25[_0xfb98('0x1b')];var _0x15932f;if(_0x15c4fa>=_0x174e4d){_0x15c4fa=_0x174e4d;_0x15932f=0xc8;}else{_0x15932f=0xce;}_0x515864[_0xfb98('0x15')](_0x15932f);return _0x515864[_0xfb98('0x1c')](_0xfb98('0x1d'),_0x14b206+'-'+_0x15c4fa+'/'+_0x174e4d)[_0xfb98('0x17')](_0x2d4efd);}return null;};}function patchUpdates(_0x23bc24){return function(_0x46a120){try{jsonpatch[_0xfb98('0x1e')](_0x46a120,_0x23bc24,!![]);}catch(_0x50c0d6){return BPromise[_0xfb98('0x1f')](_0x50c0d6);}return _0x46a120[_0xfb98('0x20')]();};}function saveUpdates(_0x14eaff,_0x284b59){return function(_0x4c3f10){if(_0x4c3f10){return _0x4c3f10[_0xfb98('0x21')](_0x14eaff)[_0xfb98('0x22')](function(_0xfa10fc){return _0xfa10fc;});}return null;};}function removeEntity(_0x5078aa,_0x568d6c){return function(_0x433fce){if(_0x433fce){return _0x433fce[_0xfb98('0x23')]()['then'](function(){_0x5078aa[_0xfb98('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x383057,_0x3f97fb){return function(_0x5727b4){if(!_0x5727b4){_0x383057['sendStatus'](0x194);}return _0x5727b4;};}function handleError(_0x25480d,_0x18e638){_0x18e638=_0x18e638||0x1f4;return function(_0x5136a3){logger[_0xfb98('0x24')](_0x5136a3['stack']);if(_0x5136a3[_0xfb98('0x25')]){delete _0x5136a3[_0xfb98('0x25')];}_0x25480d[_0xfb98('0x15')](_0x18e638)[_0xfb98('0x26')](_0x5136a3);};}exports['index']=function(_0x239705,_0x106602){var _0x5cdb18={},_0x3c6e77={},_0x52dd3a={'count':0x0,'rows':[]};var _0x5a5098=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x17fb49){return{'name':_0x17fb49[_0xfb98('0x27')],'type':_0x17fb49[_0xfb98('0x28')]['key']};});_0x3c6e77[_0xfb98('0x29')]=_[_0xfb98('0x2a')](_0x5a5098,'name');_0x3c6e77[_0xfb98('0x2b')]=_[_0xfb98('0x2c')](_0x239705[_0xfb98('0x2b')]);_0x3c6e77[_0xfb98('0x2d')]=_['intersection'](_0x3c6e77[_0xfb98('0x29')],_0x3c6e77[_0xfb98('0x2b')]);_0x5cdb18[_0xfb98('0x2e')]=_['intersection'](_0x3c6e77['model'],qs[_0xfb98('0x2f')](_0x239705['query'][_0xfb98('0x2f')]));_0x5cdb18[_0xfb98('0x2e')]=_0x5cdb18[_0xfb98('0x2e')][_0xfb98('0x30')]?_0x5cdb18[_0xfb98('0x2e')]:_0x3c6e77[_0xfb98('0x29')];if(!_0x239705[_0xfb98('0x2b')][_0xfb98('0x31')](_0xfb98('0x32'))){_0x5cdb18[_0xfb98('0x1b')]=qs[_0xfb98('0x1b')](_0x239705[_0xfb98('0x2b')][_0xfb98('0x1b')]);_0x5cdb18['offset']=qs[_0xfb98('0x18')](_0x239705[_0xfb98('0x2b')][_0xfb98('0x18')]);}_0x5cdb18[_0xfb98('0x33')]=qs[_0xfb98('0x34')](_0x239705[_0xfb98('0x2b')]['sort']);_0x5cdb18['where']=qs[_0xfb98('0x2d')](_['pick'](_0x239705['query'],_0x3c6e77['filters']),_0x5a5098);if(_0x239705['query'][_0xfb98('0x35')]){_0x5cdb18[_0xfb98('0x36')]=_['merge'](_0x5cdb18[_0xfb98('0x36')],{'$or':_[_0xfb98('0x2a')](_0x5a5098,function(_0x139c7c){if(_0x139c7c[_0xfb98('0x28')]!=='VIRTUAL'){var _0x26cf67={};_0x26cf67[_0x139c7c[_0xfb98('0x25')]]={'$like':'%'+_0x239705[_0xfb98('0x2b')]['filter']+'%'};return _0x26cf67;}})});}_0x5cdb18=_[_0xfb98('0x37')]({},_0x5cdb18,_0x239705[_0xfb98('0x38')]);var _0x248d38={'where':_0x5cdb18[_0xfb98('0x36')]};return db[_0xfb98('0x39')]['count'](_0x248d38)['then'](function(_0x1646b9){_0x52dd3a['count']=_0x1646b9;if(_0x239705['query']['includeAll']){_0x5cdb18['include']=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x5cdb18);})[_0xfb98('0x22')](function(_0x31694a){_0x52dd3a[_0xfb98('0x3a')]=_0x31694a;return _0x52dd3a;})[_0xfb98('0x22')](respondWithFilteredResult(_0x106602,_0x5cdb18))[_0xfb98('0x3b')](handleError(_0x106602,null));};exports[_0xfb98('0x3c')]=function(_0x5745bf,_0x253ab1){var _0x11c2ff={'raw':!![],'where':{'id':_0x5745bf['params']['id']}},_0x8a4947={};_0x8a4947[_0xfb98('0x29')]=_[_0xfb98('0x2c')](db['MailSubstatus'][_0xfb98('0x3d')]);_0x8a4947['query']=_[_0xfb98('0x2c')](_0x5745bf['query']);_0x8a4947[_0xfb98('0x2d')]=_[_0xfb98('0x3e')](_0x8a4947['model'],_0x8a4947[_0xfb98('0x2b')]);_0x11c2ff[_0xfb98('0x2e')]=_[_0xfb98('0x3e')](_0x8a4947['model'],qs[_0xfb98('0x2f')](_0x5745bf[_0xfb98('0x2b')][_0xfb98('0x2f')]));_0x11c2ff[_0xfb98('0x2e')]=_0x11c2ff[_0xfb98('0x2e')]['length']?_0x11c2ff[_0xfb98('0x2e')]:_0x8a4947['model'];if(_0x5745bf[_0xfb98('0x2b')]['includeAll']){_0x11c2ff[_0xfb98('0x3f')]=[{'all':!![]}];}_0x11c2ff=_[_0xfb98('0x37')]({},_0x11c2ff,_0x5745bf[_0xfb98('0x38')]);return db[_0xfb98('0x39')][_0xfb98('0x40')](_0x11c2ff)[_0xfb98('0x22')](handleEntityNotFound(_0x253ab1,null))[_0xfb98('0x22')](respondWithResult(_0x253ab1,null))[_0xfb98('0x3b')](handleError(_0x253ab1,null));};exports[_0xfb98('0x41')]=function(_0x23fad7,_0x2d47b5){return db[_0xfb98('0x39')][_0xfb98('0x41')](_0x23fad7[_0xfb98('0x42')],{})[_0xfb98('0x22')](respondWithResult(_0x2d47b5,0xc9))[_0xfb98('0x3b')](handleError(_0x2d47b5,null));};exports[_0xfb98('0x21')]=function(_0x157731,_0x32b781){if(_0x157731[_0xfb98('0x42')]['id']){delete _0x157731[_0xfb98('0x42')]['id'];}return db[_0xfb98('0x39')][_0xfb98('0x40')]({'where':{'id':_0x157731[_0xfb98('0x43')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x32b781,null))[_0xfb98('0x22')](saveUpdates(_0x157731['body'],null))['then'](respondWithResult(_0x32b781,null))[_0xfb98('0x3b')](handleError(_0x32b781,null));};exports['destroy']=function(_0x29d968,_0x3df6a3){return db[_0xfb98('0x39')]['find']({'where':{'id':_0x29d968[_0xfb98('0x43')]['id']}})[_0xfb98('0x22')](handleEntityNotFound(_0x3df6a3,null))[_0xfb98('0x22')](removeEntity(_0x3df6a3,null))[_0xfb98('0x3b')](handleError(_0x3df6a3,null));};exports[_0xfb98('0x44')]=function(_0x3fbd3d,_0x33ac1){return db[_0xfb98('0x39')]['describe']()[_0xfb98('0x22')](respondWithResult(_0x33ac1,null))['catch'](handleError(_0x33ac1,null));}; \ No newline at end of file +var _0x096a=['request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','rows','catch','params','keys','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x1d1219,_0x23fc71){var _0x5b5b89=function(_0x3d85e5){while(--_0x3d85e5){_0x1d1219['push'](_0x1d1219['shift']());}};_0x5b5b89(++_0x23fc71);}(_0x096a,0x121));var _0xa096=function(_0xf48431,_0x485b88){_0xf48431=_0xf48431-0x0;var _0x3ab7a3=_0x096a[_0xf48431];return _0x3ab7a3;};'use strict';var emlformat=require(_0xa096('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa096('0x1'));var jsonpatch=require(_0xa096('0x2'));var rp=require(_0xa096('0x3'));var moment=require(_0xa096('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa096('0x5'));var util=require('util');var path=require(_0xa096('0x6'));var sox=require('sox');var csv=require(_0xa096('0x7'));var ejs=require(_0xa096('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa096('0x9'));var squel=require('squel');var crypto=require(_0xa096('0xa'));var jsforce=require(_0xa096('0xb'));var deskjs=require(_0xa096('0xc'));var toCsv=require(_0xa096('0x7'));var querystring=require(_0xa096('0xd'));var Papa=require(_0xa096('0xe'));var Redis=require('ioredis');var authService=require(_0xa096('0xf'));var qs=require(_0xa096('0x10'));var as=require(_0xa096('0x11'));var hardwareService=require(_0xa096('0x12'));var logger=require(_0xa096('0x13'))('api');var utils=require(_0xa096('0x14'));var config=require(_0xa096('0x15'));var licenseUtil=require(_0xa096('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218fac,_0x2898c4){_0x2898c4=_0x2898c4||0xcc;return function(_0xb10f4){if(_0xb10f4){return _0x218fac[_0xa096('0x17')](_0x2898c4);}return _0x218fac[_0xa096('0x18')](_0x2898c4)[_0xa096('0x19')]();};}function respondWithResult(_0x512723,_0x221969){_0x221969=_0x221969||0xc8;return function(_0x3c7fbd){if(_0x3c7fbd){return _0x512723[_0xa096('0x18')](_0x221969)['json'](_0x3c7fbd);}};}function respondWithFilteredResult(_0x3a7a7d,_0x59c04a){return function(_0x5b6b67){if(_0x5b6b67){var _0x100da7=typeof _0x59c04a[_0xa096('0x1a')]==='undefined'&&typeof _0x59c04a[_0xa096('0x1b')]==='undefined';var _0x572d48=_0x5b6b67[_0xa096('0x1c')];var _0x4453f9=_0x100da7?0x0:_0x59c04a['offset'];var _0x598aca=_0x100da7?_0x5b6b67['count']:_0x59c04a[_0xa096('0x1a')]+_0x59c04a[_0xa096('0x1b')];var _0x57d04a;if(_0x598aca>=_0x572d48){_0x598aca=_0x572d48;_0x57d04a=0xc8;}else{_0x57d04a=0xce;}_0x3a7a7d[_0xa096('0x18')](_0x57d04a);return _0x3a7a7d['set'](_0xa096('0x1d'),_0x4453f9+'-'+_0x598aca+'/'+_0x572d48)[_0xa096('0x1e')](_0x5b6b67);}return null;};}function patchUpdates(_0x2ba537){return function(_0x3c4173){try{jsonpatch[_0xa096('0x1f')](_0x3c4173,_0x2ba537,!![]);}catch(_0x198d60){return BPromise[_0xa096('0x20')](_0x198d60);}return _0x3c4173[_0xa096('0x21')]();};}function saveUpdates(_0x4a3714,_0x37ab55){return function(_0x101ddb){if(_0x101ddb){return _0x101ddb[_0xa096('0x22')](_0x4a3714)['then'](function(_0x161aaf){return _0x161aaf;});}return null;};}function removeEntity(_0x41c1c9,_0x173e96){return function(_0x1f77fa){if(_0x1f77fa){return _0x1f77fa[_0xa096('0x23')]()[_0xa096('0x24')](function(){_0x41c1c9[_0xa096('0x18')](0xcc)[_0xa096('0x19')]();});}};}function handleEntityNotFound(_0x114631,_0x2583e2){return function(_0x24d14e){if(!_0x24d14e){_0x114631[_0xa096('0x17')](0x194);}return _0x24d14e;};}function handleError(_0x5bab4f,_0x2b6b7b){_0x2b6b7b=_0x2b6b7b||0x1f4;return function(_0x25aa98){logger[_0xa096('0x25')](_0x25aa98[_0xa096('0x26')]);if(_0x25aa98[_0xa096('0x27')]){delete _0x25aa98[_0xa096('0x27')];}_0x5bab4f[_0xa096('0x18')](_0x2b6b7b)[_0xa096('0x28')](_0x25aa98);};}exports[_0xa096('0x29')]=function(_0x139e77,_0x4a09b4){var _0x2e8106={},_0x3342fe={},_0x1c155d={'count':0x0,'rows':[]};var _0x507612=_[_0xa096('0x2a')](db[_0xa096('0x2b')][_0xa096('0x2c')],function(_0x315cda){return{'name':_0x315cda[_0xa096('0x2d')],'type':_0x315cda[_0xa096('0x2e')]['key']};});_0x3342fe[_0xa096('0x2f')]=_['map'](_0x507612,_0xa096('0x27'));_0x3342fe[_0xa096('0x30')]=_['keys'](_0x139e77[_0xa096('0x30')]);_0x3342fe[_0xa096('0x31')]=_[_0xa096('0x32')](_0x3342fe[_0xa096('0x2f')],_0x3342fe['query']);_0x2e8106[_0xa096('0x33')]=_[_0xa096('0x32')](_0x3342fe[_0xa096('0x2f')],qs['fields'](_0x139e77[_0xa096('0x30')]['fields']));_0x2e8106[_0xa096('0x33')]=_0x2e8106[_0xa096('0x33')][_0xa096('0x34')]?_0x2e8106[_0xa096('0x33')]:_0x3342fe[_0xa096('0x2f')];if(!_0x139e77[_0xa096('0x30')]['hasOwnProperty'](_0xa096('0x35'))){_0x2e8106[_0xa096('0x1b')]=qs[_0xa096('0x1b')](_0x139e77['query'][_0xa096('0x1b')]);_0x2e8106[_0xa096('0x1a')]=qs[_0xa096('0x1a')](_0x139e77[_0xa096('0x30')]['offset']);}_0x2e8106[_0xa096('0x36')]=qs[_0xa096('0x37')](_0x139e77[_0xa096('0x30')]['sort']);_0x2e8106['where']=qs[_0xa096('0x31')](_[_0xa096('0x38')](_0x139e77[_0xa096('0x30')],_0x3342fe[_0xa096('0x31')]),_0x507612);if(_0x139e77[_0xa096('0x30')]['filter']){_0x2e8106[_0xa096('0x39')]=_[_0xa096('0x3a')](_0x2e8106[_0xa096('0x39')],{'$or':_[_0xa096('0x2a')](_0x507612,function(_0x1a91d7){if(_0x1a91d7[_0xa096('0x2e')]!==_0xa096('0x3b')){var _0x5edc22={};_0x5edc22[_0x1a91d7[_0xa096('0x27')]]={'$like':'%'+_0x139e77[_0xa096('0x30')][_0xa096('0x3c')]+'%'};return _0x5edc22;}})});}_0x2e8106=_[_0xa096('0x3a')]({},_0x2e8106,_0x139e77['options']);var _0xd52ce0={'where':_0x2e8106[_0xa096('0x39')]};return db[_0xa096('0x2b')][_0xa096('0x1c')](_0xd52ce0)[_0xa096('0x24')](function(_0x5c0c54){_0x1c155d[_0xa096('0x1c')]=_0x5c0c54;if(_0x139e77[_0xa096('0x30')][_0xa096('0x3d')]){_0x2e8106[_0xa096('0x3e')]=[{'all':!![]}];}return db[_0xa096('0x2b')]['findAll'](_0x2e8106);})[_0xa096('0x24')](function(_0x530e0e){_0x1c155d[_0xa096('0x3f')]=_0x530e0e;return _0x1c155d;})['then'](respondWithFilteredResult(_0x4a09b4,_0x2e8106))[_0xa096('0x40')](handleError(_0x4a09b4,null));};exports['show']=function(_0x4d56f0,_0x50157a){var _0x232641={'raw':!![],'where':{'id':_0x4d56f0[_0xa096('0x41')]['id']}},_0x4dcb64={};_0x4dcb64[_0xa096('0x2f')]=_[_0xa096('0x42')](db[_0xa096('0x2b')][_0xa096('0x2c')]);_0x4dcb64[_0xa096('0x30')]=_[_0xa096('0x42')](_0x4d56f0[_0xa096('0x30')]);_0x4dcb64[_0xa096('0x31')]=_[_0xa096('0x32')](_0x4dcb64[_0xa096('0x2f')],_0x4dcb64[_0xa096('0x30')]);_0x232641[_0xa096('0x33')]=_[_0xa096('0x32')](_0x4dcb64['model'],qs[_0xa096('0x43')](_0x4d56f0['query'][_0xa096('0x43')]));_0x232641[_0xa096('0x33')]=_0x232641[_0xa096('0x33')][_0xa096('0x34')]?_0x232641[_0xa096('0x33')]:_0x4dcb64[_0xa096('0x2f')];if(_0x4d56f0['query'][_0xa096('0x3d')]){_0x232641['include']=[{'all':!![]}];}_0x232641=_[_0xa096('0x3a')]({},_0x232641,_0x4d56f0[_0xa096('0x44')]);return db[_0xa096('0x2b')][_0xa096('0x45')](_0x232641)['then'](handleEntityNotFound(_0x50157a,null))[_0xa096('0x24')](respondWithResult(_0x50157a,null))[_0xa096('0x40')](handleError(_0x50157a,null));};exports[_0xa096('0x46')]=function(_0x3463e3,_0x5cc434){return db[_0xa096('0x2b')][_0xa096('0x46')](_0x3463e3['body'],{})['then'](respondWithResult(_0x5cc434,0xc9))[_0xa096('0x40')](handleError(_0x5cc434,null));};exports[_0xa096('0x22')]=function(_0x2ee0b1,_0x19c2cf){if(_0x2ee0b1[_0xa096('0x47')]['id']){delete _0x2ee0b1[_0xa096('0x47')]['id'];}return db[_0xa096('0x2b')][_0xa096('0x45')]({'where':{'id':_0x2ee0b1[_0xa096('0x41')]['id']}})[_0xa096('0x24')](handleEntityNotFound(_0x19c2cf,null))[_0xa096('0x24')](saveUpdates(_0x2ee0b1[_0xa096('0x47')],null))[_0xa096('0x24')](respondWithResult(_0x19c2cf,null))['catch'](handleError(_0x19c2cf,null));};exports[_0xa096('0x23')]=function(_0x4c529a,_0x3a0012){return db[_0xa096('0x2b')][_0xa096('0x45')]({'where':{'id':_0x4c529a[_0xa096('0x41')]['id']}})[_0xa096('0x24')](handleEntityNotFound(_0x3a0012,null))[_0xa096('0x24')](removeEntity(_0x3a0012,null))[_0xa096('0x40')](handleError(_0x3a0012,null));};exports['describe']=function(_0x5b802d,_0x49d6e4){return db[_0xa096('0x2b')][_0xa096('0x48')]()[_0xa096('0x24')](respondWithResult(_0x49d6e4,null))[_0xa096('0x40')](handleError(_0x49d6e4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index b43f923..b772e5c 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 _0x9f72=['MailSubstatus','setMaxListeners','update','hook','exports','events','../../mysqldb'];(function(_0x1cf6ef,_0x3a4330){var _0x291a34=function(_0x173cf1){while(--_0x173cf1){_0x1cf6ef['push'](_0x1cf6ef['shift']());}};_0x291a34(++_0x3a4330);}(_0x9f72,0x6e));var _0x29f7=function(_0x512ba5,_0x3520){_0x512ba5=_0x512ba5-0x0;var _0x3a0cfa=_0x9f72[_0x512ba5];return _0x3a0cfa;};'use strict';var EventEmitter=require(_0x29f7('0x0'));var MailSubstatus=require(_0x29f7('0x1'))['db'][_0x29f7('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x29f7('0x3')](0x0);var events={'afterUpdate':_0x29f7('0x4')};function emitEvent(_0x37d3f4){return function(_0x216ee4,_0x487a83,_0x428b07){MailSubstatusEvents['emit'](_0x37d3f4+':'+_0x216ee4['id'],_0x216ee4);MailSubstatusEvents['emit'](_0x37d3f4,_0x216ee4);_0x428b07(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x29f7('0x5')](e,emitEvent(event));}}module[_0x29f7('0x6')]=MailSubstatusEvents; \ No newline at end of file +var _0xca6f=['events','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty','hook','exports'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xca6f,0x1b0));var _0xfca6=function(_0x51906f,_0x141a5d){_0x51906f=_0x51906f-0x0;var _0x16047d=_0xca6f[_0x51906f];return _0x16047d;};'use strict';var EventEmitter=require(_0xfca6('0x0'));var MailSubstatus=require(_0xfca6('0x1'))['db'][_0xfca6('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xfca6('0x3')};function emitEvent(_0x40da55){return function(_0xfb172b,_0x4e7602,_0x31e6ab){MailSubstatusEvents[_0xfca6('0x4')](_0x40da55+':'+_0xfb172b['id'],_0xfb172b);MailSubstatusEvents[_0xfca6('0x4')](_0x40da55,_0xfb172b);_0x31e6ab(null);};}for(var e in events){if(events[_0xfca6('0x5')](e)){var event=events[e];MailSubstatus[_0xfca6('0x6')](e,emitEvent(event));}}module[_0xfca6('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index f4a6ff0..14a6a30 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 _0x60fd=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus'];(function(_0x2c4013,_0x529007){var _0x45479f=function(_0x59a287){while(--_0x59a287){_0x2c4013['push'](_0x2c4013['shift']());}};_0x45479f(++_0x529007);}(_0x60fd,0xe9));var _0xd60f=function(_0x3f86c0,_0x2d575f){_0x3f86c0=_0x3f86c0-0x0;var _0x477d5a=_0x60fd[_0x3f86c0];return _0x477d5a;};'use strict';var attributes=require(_0xd60f('0x0'));module[_0xd60f('0x1')]=function(_0x55f116){var _0x2fbeaf=_0x55f116[_0xd60f('0x2')];return _0x55f116[_0xd60f('0x3')](_0xd60f('0x4'),attributes,{'tableName':_0xd60f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x40317e,_0x423173,_0xa502f0){return _0x2fbeaf[_0xd60f('0x6')][_0xd60f('0x7')]({'value':_0x40317e['name']},{'where':{'field':_0xd60f('0x8'),'value':_0x40317e['_previousDataValues']['name']}})[_0xd60f('0x9')](function(){_0xa502f0();})[_0xd60f('0xa')](function(_0x3e9a00){_0xa502f0(_0x3e9a00);});}}});}; \ No newline at end of file +var _0x38f9=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','name','mailSubstatus','_previousDataValues'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0x38f9,0x1af));var _0x938f=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x38f9[_0x2555d0];return _0x3bb486;};'use strict';var attributes=require(_0x938f('0x0'));module[_0x938f('0x1')]=function(_0x31df20){var _0x55dd2f=_0x31df20[_0x938f('0x2')];return _0x31df20[_0x938f('0x3')](_0x938f('0x4'),attributes,{'tableName':_0x938f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x501ca3,_0x4b68b8,_0x99fa62){return _0x55dd2f['Condition']['update']({'value':_0x501ca3[_0x938f('0x6')]},{'where':{'field':_0x938f('0x7'),'value':_0x501ca3[_0x938f('0x8')][_0x938f('0x6')]}})[_0x938f('0x9')](function(){_0x99fa62();})[_0x938f('0xa')](function(_0x5a934e){_0x99fa62(_0x5a934e);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 4afce63..e2b81a5 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 _0x446c=['request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x446c,0x156));var _0xc446=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x446c[_0x29d623];return _0x242e59;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var moment=require(_0xc446('0x2'));var BPromise=require(_0xc446('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc446('0x4'));var db=require(_0xc446('0x5'))['db'];var utils=require(_0xc446('0x6'));var logger=require('../../config/logger')(_0xc446('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc446('0x8')][_0xc446('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578895,_0x549fac,_0x2eea75){return new BPromise(function(_0x3e9e70,_0x1ddeaf){return client[_0xc446('0xa')](_0x578895,_0x2eea75)[_0xc446('0xb')](function(_0x4a2a80){logger[_0xc446('0xc')](_0xc446('0xd'),_0x549fac,_0xc446('0xe'));logger[_0xc446('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x549fac,_0xc446('0xe'),JSON[_0xc446('0x10')](_0x4a2a80));if(_0x4a2a80[_0xc446('0x11')]){if(_0x4a2a80[_0xc446('0x11')][_0xc446('0x12')]===0x1f4){logger[_0xc446('0x11')](_0xc446('0xd'),_0x549fac,_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);return _0x1ddeaf(_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);}logger[_0xc446('0x11')](_0xc446('0xd'),_0x549fac,_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);return _0x3e9e70(_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);}else{logger[_0xc446('0xc')](_0xc446('0xd'),_0x549fac,'request\x20sent');_0x3e9e70(_0x4a2a80[_0xc446('0x14')][_0xc446('0x13')]);}})[_0xc446('0x15')](function(_0x4690c5){logger[_0xc446('0x11')](_0xc446('0xd'),_0x549fac,_0x4690c5);_0x1ddeaf(_0x4690c5);});});} \ No newline at end of file +var _0xfa44=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xfa44,0xd6));var _0x4fa4=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0xfa44[_0xb47dc0];return _0x57f0b0;};'use strict';var _=require(_0x4fa4('0x0'));var util=require(_0x4fa4('0x1'));var moment=require(_0x4fa4('0x2'));var BPromise=require(_0x4fa4('0x3'));var rs=require(_0x4fa4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fa4('0x5'))['db'];var utils=require(_0x4fa4('0x6'));var logger=require(_0x4fa4('0x7'))('rpc');var config=require(_0x4fa4('0x8'));var jayson=require(_0x4fa4('0x9'));var client=jayson[_0x4fa4('0xa')][_0x4fa4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15a2f2,_0x2b65f3,_0x146f02){return new BPromise(function(_0x24ef9b,_0x3188f0){return client['request'](_0x15a2f2,_0x146f02)[_0x4fa4('0xc')](function(_0x4368c9){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x2b65f3,'request\x20sent');logger[_0x4fa4('0xd')](_0x4fa4('0xe'),_0x2b65f3,_0x4fa4('0xf'),JSON[_0x4fa4('0x10')](_0x4368c9));if(_0x4368c9[_0x4fa4('0x11')]){if(_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x12')]===0x1f4){logger[_0x4fa4('0x11')](_0x4fa4('0x13'),_0x2b65f3,_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x14')]);return _0x3188f0(_0x4368c9[_0x4fa4('0x11')]['message']);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2b65f3,_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x14')]);return _0x24ef9b(_0x4368c9[_0x4fa4('0x11')][_0x4fa4('0x14')]);}else{logger[_0x4fa4('0x15')](_0x4fa4('0x13'),_0x2b65f3,'request\x20sent');_0x24ef9b(_0x4368c9[_0x4fa4('0x16')][_0x4fa4('0x14')]);}})[_0x4fa4('0x17')](function(_0x3eacf3){logger['error'](_0x4fa4('0x13'),_0x2b65f3,_0x3eacf3);_0x3188f0(_0x3eacf3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 6f217fa..aa279bb 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 _0xa042=['get','isAuthenticated','/describe','/:id','show','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller'];(function(_0x48fc11,_0x4d0e03){var _0x2cbee2=function(_0x270cfc){while(--_0x270cfc){_0x48fc11['push'](_0x48fc11['shift']());}};_0x2cbee2(++_0x4d0e03);}(_0xa042,0x1be));var _0x2a04=function(_0x38c9dd,_0x234841){_0x38c9dd=_0x38c9dd-0x0;var _0x97472a=_0xa042[_0x38c9dd];return _0x97472a;};'use strict';var multer=require('multer');var util=require(_0x2a04('0x0'));var path=require(_0x2a04('0x1'));var timeout=require(_0x2a04('0x2'));var express=require(_0x2a04('0x3'));var router=express[_0x2a04('0x4')]();var fs_extra=require(_0x2a04('0x5'));var auth=require(_0x2a04('0x6'));var interaction=require(_0x2a04('0x7'));var config=require(_0x2a04('0x8'));var controller=require(_0x2a04('0x9'));router[_0x2a04('0xa')]('/',auth[_0x2a04('0xb')](),controller['index']);router[_0x2a04('0xa')](_0x2a04('0xc'),auth[_0x2a04('0xb')](),controller['describe']);router[_0x2a04('0xa')](_0x2a04('0xd'),auth[_0x2a04('0xb')](),controller[_0x2a04('0xe')]);router['post']('/',auth[_0x2a04('0xb')](),controller[_0x2a04('0xf')]);router[_0x2a04('0x10')](_0x2a04('0xd'),auth[_0x2a04('0xb')](),controller['update']);router[_0x2a04('0x11')](_0x2a04('0xd'),auth[_0x2a04('0xb')](),controller[_0x2a04('0x12')]);module['exports']=router; \ No newline at end of file +var _0x561b=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','index','describe','show','post','isAuthenticated','create','/:id','update','delete'];(function(_0x1f5ae2,_0x74a260){var _0x4bd843=function(_0x153ea6){while(--_0x153ea6){_0x1f5ae2['push'](_0x1f5ae2['shift']());}};_0x4bd843(++_0x74a260);}(_0x561b,0x95));var _0xb561=function(_0x37943c,_0x43c93e){_0x37943c=_0x37943c-0x0;var _0x5948e2=_0x561b[_0x37943c];return _0x5948e2;};'use strict';var multer=require(_0xb561('0x0'));var util=require('util');var path=require(_0xb561('0x1'));var timeout=require(_0xb561('0x2'));var express=require(_0xb561('0x3'));var router=express[_0xb561('0x4')]();var fs_extra=require(_0xb561('0x5'));var auth=require(_0xb561('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb561('0x7'));var controller=require(_0xb561('0x8'));router[_0xb561('0x9')]('/',auth['isAuthenticated'](),controller[_0xb561('0xa')]);router[_0xb561('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb561('0xb')]);router[_0xb561('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb561('0xc')]);router[_0xb561('0xd')]('/',auth[_0xb561('0xe')](),controller[_0xb561('0xf')]);router['put'](_0xb561('0x10'),auth[_0xb561('0xe')](),controller[_0xb561('0x11')]);router[_0xb561('0x12')](_0xb561('0x10'),auth[_0xb561('0xe')](),controller[_0xb561('0x13')]);module[_0xb561('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 8d6f460..11f7487 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x540041,_0x388ca0){var _0x5a4898=function(_0x18a165){while(--_0x18a165){_0x540041['push'](_0x540041['shift']());}};_0x5a4898(++_0x388ca0);}(_0x54ef,0x112));var _0xf54e=function(_0x46a6f5,_0x27dcc6){_0x46a6f5=_0x46a6f5-0x0;var _0x4db53a=_0x54ef[_0x46a6f5];return _0x4db53a;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x495a74,_0x426732){var _0x5aa75c=function(_0x25748e){while(--_0x25748e){_0x495a74['push'](_0x495a74['shift']());}};_0x5aa75c(++_0x426732);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 9fbf0ef..aa96f42 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 _0x9996=['name','query','keys','intersection','fields','attributes','length','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','describe','eml-format','rimraf','zip-dir','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x9996,0x18b));var _0x6999=function(_0x3697a4,_0xa8d834){_0x3697a4=_0x3697a4-0x0;var _0x3058f5=_0x9996[_0x3697a4];return _0x3058f5;};'use strict';var emlformat=require(_0x6999('0x0'));var rimraf=require(_0x6999('0x1'));var zipdir=require(_0x6999('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6999('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6999('0x4'));var path=require(_0x6999('0x5'));var sox=require(_0x6999('0x6'));var csv=require('to-csv');var ejs=require(_0x6999('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6999('0x8'));var squel=require(_0x6999('0x9'));var crypto=require(_0x6999('0xa'));var jsforce=require(_0x6999('0xb'));var deskjs=require(_0x6999('0xc'));var toCsv=require(_0x6999('0xd'));var querystring=require(_0x6999('0xe'));var Papa=require(_0x6999('0xf'));var Redis=require(_0x6999('0x10'));var authService=require(_0x6999('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6999('0x12'))(_0x6999('0x13'));var utils=require(_0x6999('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6999('0x15'));var db=require(_0x6999('0x16'))['db'];function respondWithStatusCode(_0x215431,_0x4cafbc){_0x4cafbc=_0x4cafbc||0xcc;return function(_0x1035bd){if(_0x1035bd){return _0x215431[_0x6999('0x17')](_0x4cafbc);}return _0x215431[_0x6999('0x18')](_0x4cafbc)['end']();};}function respondWithResult(_0x36e007,_0x10f3b5){_0x10f3b5=_0x10f3b5||0xc8;return function(_0x180674){if(_0x180674){return _0x36e007[_0x6999('0x18')](_0x10f3b5)['json'](_0x180674);}};}function respondWithFilteredResult(_0x13088a,_0x1a4f94){return function(_0x3f15d9){if(_0x3f15d9){var _0x10a011=typeof _0x1a4f94[_0x6999('0x19')]===_0x6999('0x1a')&&typeof _0x1a4f94['limit']===_0x6999('0x1a');var _0x2c325c=_0x3f15d9[_0x6999('0x1b')];var _0x460f29=_0x10a011?0x0:_0x1a4f94[_0x6999('0x19')];var _0x3e1b2e=_0x10a011?_0x3f15d9[_0x6999('0x1b')]:_0x1a4f94[_0x6999('0x19')]+_0x1a4f94[_0x6999('0x1c')];var _0x5f0a27;if(_0x3e1b2e>=_0x2c325c){_0x3e1b2e=_0x2c325c;_0x5f0a27=0xc8;}else{_0x5f0a27=0xce;}_0x13088a['status'](_0x5f0a27);return _0x13088a[_0x6999('0x1d')](_0x6999('0x1e'),_0x460f29+'-'+_0x3e1b2e+'/'+_0x2c325c)[_0x6999('0x1f')](_0x3f15d9);}return null;};}function patchUpdates(_0x2c09b7){return function(_0x3b3b49){try{jsonpatch[_0x6999('0x20')](_0x3b3b49,_0x2c09b7,!![]);}catch(_0x1e5a84){return BPromise[_0x6999('0x21')](_0x1e5a84);}return _0x3b3b49[_0x6999('0x22')]();};}function saveUpdates(_0x540608,_0x471a37){return function(_0x3baa2b){if(_0x3baa2b){return _0x3baa2b[_0x6999('0x23')](_0x540608)['then'](function(_0x54de79){return _0x54de79;});}return null;};}function removeEntity(_0x13236f,_0x1b7c50){return function(_0x140ee5){if(_0x140ee5){return _0x140ee5[_0x6999('0x24')]()[_0x6999('0x25')](function(){_0x13236f[_0x6999('0x18')](0xcc)[_0x6999('0x26')]();});}};}function handleEntityNotFound(_0x3d8f5b,_0x325536){return function(_0x289555){if(!_0x289555){_0x3d8f5b[_0x6999('0x17')](0x194);}return _0x289555;};}function handleError(_0x2b1131,_0x4eb114){_0x4eb114=_0x4eb114||0x1f4;return function(_0x5e51c5){logger[_0x6999('0x27')](_0x5e51c5[_0x6999('0x28')]);if(_0x5e51c5['name']){delete _0x5e51c5['name'];}_0x2b1131['status'](_0x4eb114)[_0x6999('0x29')](_0x5e51c5);};}exports[_0x6999('0x2a')]=function(_0x53059b,_0x28828a){var _0x1d5ac0={},_0x4b623e={},_0x35efec={'count':0x0,'rows':[]};var _0x2044e6=_[_0x6999('0x2b')](db[_0x6999('0x2c')][_0x6999('0x2d')],function(_0x6965c0){return{'name':_0x6965c0[_0x6999('0x2e')],'type':_0x6965c0['type'][_0x6999('0x2f')]};});_0x4b623e[_0x6999('0x30')]=_['map'](_0x2044e6,_0x6999('0x31'));_0x4b623e[_0x6999('0x32')]=_[_0x6999('0x33')](_0x53059b[_0x6999('0x32')]);_0x4b623e['filters']=_['intersection'](_0x4b623e[_0x6999('0x30')],_0x4b623e['query']);_0x1d5ac0['attributes']=_[_0x6999('0x34')](_0x4b623e[_0x6999('0x30')],qs[_0x6999('0x35')](_0x53059b['query'][_0x6999('0x35')]));_0x1d5ac0[_0x6999('0x36')]=_0x1d5ac0['attributes'][_0x6999('0x37')]?_0x1d5ac0[_0x6999('0x36')]:_0x4b623e[_0x6999('0x30')];if(!_0x53059b[_0x6999('0x32')]['hasOwnProperty'](_0x6999('0x38'))){_0x1d5ac0[_0x6999('0x1c')]=qs[_0x6999('0x1c')](_0x53059b['query']['limit']);_0x1d5ac0['offset']=qs['offset'](_0x53059b[_0x6999('0x32')]['offset']);}_0x1d5ac0['order']=qs['sort'](_0x53059b[_0x6999('0x32')]['sort']);_0x1d5ac0[_0x6999('0x39')]=qs[_0x6999('0x3a')](_[_0x6999('0x3b')](_0x53059b['query'],_0x4b623e['filters']),_0x2044e6);if(_0x53059b[_0x6999('0x32')][_0x6999('0x3c')]){_0x1d5ac0[_0x6999('0x39')]=_[_0x6999('0x3d')](_0x1d5ac0[_0x6999('0x39')],{'$or':_['map'](_0x2044e6,function(_0x1aef59){if(_0x1aef59['type']!==_0x6999('0x3e')){var _0x463ae2={};_0x463ae2[_0x1aef59['name']]={'$like':'%'+_0x53059b[_0x6999('0x32')][_0x6999('0x3c')]+'%'};return _0x463ae2;}})});}_0x1d5ac0=_[_0x6999('0x3d')]({},_0x1d5ac0,_0x53059b[_0x6999('0x3f')]);var _0x20bc50={'where':_0x1d5ac0[_0x6999('0x39')]};return db['MailTransferReport'][_0x6999('0x1b')](_0x20bc50)[_0x6999('0x25')](function(_0x3b137c){_0x35efec[_0x6999('0x1b')]=_0x3b137c;if(_0x53059b[_0x6999('0x32')][_0x6999('0x40')]){_0x1d5ac0['include']=[{'all':!![]}];}return db[_0x6999('0x2c')][_0x6999('0x41')](_0x1d5ac0);})[_0x6999('0x25')](function(_0x10dcc6){_0x35efec[_0x6999('0x42')]=_0x10dcc6;return _0x35efec;})[_0x6999('0x25')](respondWithFilteredResult(_0x28828a,_0x1d5ac0))[_0x6999('0x43')](handleError(_0x28828a,null));};exports[_0x6999('0x44')]=function(_0x23970e,_0x3f6add){var _0x5c1b30={'raw':!![],'where':{'id':_0x23970e[_0x6999('0x45')]['id']}},_0x52a96c={};_0x52a96c[_0x6999('0x30')]=_[_0x6999('0x33')](db[_0x6999('0x2c')][_0x6999('0x2d')]);_0x52a96c['query']=_['keys'](_0x23970e[_0x6999('0x32')]);_0x52a96c['filters']=_[_0x6999('0x34')](_0x52a96c[_0x6999('0x30')],_0x52a96c[_0x6999('0x32')]);_0x5c1b30['attributes']=_['intersection'](_0x52a96c[_0x6999('0x30')],qs[_0x6999('0x35')](_0x23970e[_0x6999('0x32')][_0x6999('0x35')]));_0x5c1b30[_0x6999('0x36')]=_0x5c1b30[_0x6999('0x36')][_0x6999('0x37')]?_0x5c1b30[_0x6999('0x36')]:_0x52a96c[_0x6999('0x30')];if(_0x23970e[_0x6999('0x32')][_0x6999('0x40')]){_0x5c1b30[_0x6999('0x46')]=[{'all':!![]}];}_0x5c1b30=_['merge']({},_0x5c1b30,_0x23970e['options']);return db[_0x6999('0x2c')]['find'](_0x5c1b30)[_0x6999('0x25')](handleEntityNotFound(_0x3f6add,null))[_0x6999('0x25')](respondWithResult(_0x3f6add,null))[_0x6999('0x43')](handleError(_0x3f6add,null));};exports['create']=function(_0x2063d6,_0x1337af){return db[_0x6999('0x2c')][_0x6999('0x47')](_0x2063d6[_0x6999('0x48')],{})['then'](respondWithResult(_0x1337af,0xc9))[_0x6999('0x43')](handleError(_0x1337af,null));};exports[_0x6999('0x23')]=function(_0xb5fb48,_0x3a483e){if(_0xb5fb48[_0x6999('0x48')]['id']){delete _0xb5fb48[_0x6999('0x48')]['id'];}return db[_0x6999('0x2c')]['find']({'where':{'id':_0xb5fb48[_0x6999('0x45')]['id']}})[_0x6999('0x25')](handleEntityNotFound(_0x3a483e,null))['then'](saveUpdates(_0xb5fb48[_0x6999('0x48')],null))['then'](respondWithResult(_0x3a483e,null))[_0x6999('0x43')](handleError(_0x3a483e,null));};exports[_0x6999('0x24')]=function(_0x490f15,_0x55ea69){return db[_0x6999('0x2c')]['find']({'where':{'id':_0x490f15[_0x6999('0x45')]['id']}})[_0x6999('0x25')](handleEntityNotFound(_0x55ea69,null))[_0x6999('0x25')](removeEntity(_0x55ea69,null))[_0x6999('0x43')](handleError(_0x55ea69,null));};exports[_0x6999('0x49')]=function(_0x1aef0c,_0x534dbb){return db[_0x6999('0x2c')][_0x6999('0x49')]()[_0x6999('0x25')](respondWithResult(_0x534dbb,null))[_0x6999('0x43')](handleError(_0x534dbb,null));}; \ No newline at end of file +var _0x75f7=['save','update','then','destroy','error','stack','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x1f535b,_0xc42523){var _0x5bb329=function(_0xcaa78d){while(--_0xcaa78d){_0x1f535b['push'](_0x1f535b['shift']());}};_0x5bb329(++_0xc42523);}(_0x75f7,0x1a3));var _0x775f=function(_0x1c87f4,_0x7501a5){_0x1c87f4=_0x1c87f4-0x0;var _0x331974=_0x75f7[_0x1c87f4];return _0x331974;};'use strict';var emlformat=require(_0x775f('0x0'));var rimraf=require(_0x775f('0x1'));var zipdir=require(_0x775f('0x2'));var jsonpatch=require(_0x775f('0x3'));var rp=require(_0x775f('0x4'));var moment=require('moment');var BPromise=require(_0x775f('0x5'));var Mustache=require(_0x775f('0x6'));var util=require('util');var path=require(_0x775f('0x7'));var sox=require(_0x775f('0x8'));var csv=require('to-csv');var ejs=require(_0x775f('0x9'));var fs=require('fs');var fs_extra=require(_0x775f('0xa'));var _=require('lodash');var squel=require(_0x775f('0xb'));var crypto=require(_0x775f('0xc'));var jsforce=require(_0x775f('0xd'));var deskjs=require(_0x775f('0xe'));var toCsv=require(_0x775f('0xf'));var querystring=require(_0x775f('0x10'));var Papa=require('papaparse');var Redis=require(_0x775f('0x11'));var authService=require(_0x775f('0x12'));var qs=require(_0x775f('0x13'));var as=require(_0x775f('0x14'));var hardwareService=require(_0x775f('0x15'));var logger=require(_0x775f('0x16'))('api');var utils=require(_0x775f('0x17'));var config=require(_0x775f('0x18'));var licenseUtil=require(_0x775f('0x19'));var db=require(_0x775f('0x1a'))['db'];function respondWithStatusCode(_0x4fec2d,_0xc3feb0){_0xc3feb0=_0xc3feb0||0xcc;return function(_0x3f4a9f){if(_0x3f4a9f){return _0x4fec2d[_0x775f('0x1b')](_0xc3feb0);}return _0x4fec2d[_0x775f('0x1c')](_0xc3feb0)[_0x775f('0x1d')]();};}function respondWithResult(_0x157876,_0x5e92f6){_0x5e92f6=_0x5e92f6||0xc8;return function(_0x18d279){if(_0x18d279){return _0x157876[_0x775f('0x1c')](_0x5e92f6)[_0x775f('0x1e')](_0x18d279);}};}function respondWithFilteredResult(_0x5d40a2,_0x4dd141){return function(_0x2ed9d5){if(_0x2ed9d5){var _0x58385d=typeof _0x4dd141[_0x775f('0x1f')]===_0x775f('0x20')&&typeof _0x4dd141[_0x775f('0x21')]==='undefined';var _0x3ac7d9=_0x2ed9d5[_0x775f('0x22')];var _0x2d0fd0=_0x58385d?0x0:_0x4dd141['offset'];var _0x8f3fd2=_0x58385d?_0x2ed9d5[_0x775f('0x22')]:_0x4dd141[_0x775f('0x1f')]+_0x4dd141[_0x775f('0x21')];var _0xa9f312;if(_0x8f3fd2>=_0x3ac7d9){_0x8f3fd2=_0x3ac7d9;_0xa9f312=0xc8;}else{_0xa9f312=0xce;}_0x5d40a2[_0x775f('0x1c')](_0xa9f312);return _0x5d40a2['set']('Content-Range',_0x2d0fd0+'-'+_0x8f3fd2+'/'+_0x3ac7d9)[_0x775f('0x1e')](_0x2ed9d5);}return null;};}function patchUpdates(_0x46f4cd){return function(_0x21153b){try{jsonpatch[_0x775f('0x23')](_0x21153b,_0x46f4cd,!![]);}catch(_0x1b7706){return BPromise[_0x775f('0x24')](_0x1b7706);}return _0x21153b[_0x775f('0x25')]();};}function saveUpdates(_0x1c1eb9,_0x295373){return function(_0x565043){if(_0x565043){return _0x565043[_0x775f('0x26')](_0x1c1eb9)[_0x775f('0x27')](function(_0x286479){return _0x286479;});}return null;};}function removeEntity(_0x5d84b5,_0x5b663b){return function(_0x1981f8){if(_0x1981f8){return _0x1981f8[_0x775f('0x28')]()[_0x775f('0x27')](function(){_0x5d84b5[_0x775f('0x1c')](0xcc)[_0x775f('0x1d')]();});}};}function handleEntityNotFound(_0x27dff3,_0x34b636){return function(_0x51f742){if(!_0x51f742){_0x27dff3['sendStatus'](0x194);}return _0x51f742;};}function handleError(_0x2549d2,_0x1f54a9){_0x1f54a9=_0x1f54a9||0x1f4;return function(_0x19d83f){logger[_0x775f('0x29')](_0x19d83f[_0x775f('0x2a')]);if(_0x19d83f['name']){delete _0x19d83f['name'];}_0x2549d2[_0x775f('0x1c')](_0x1f54a9)[_0x775f('0x2b')](_0x19d83f);};}exports['index']=function(_0x28031c,_0x2d14fc){var _0x3d3abb={},_0x2e3ea1={},_0x5e5e17={'count':0x0,'rows':[]};var _0x380414=_[_0x775f('0x2c')](db[_0x775f('0x2d')][_0x775f('0x2e')],function(_0x399fa5){return{'name':_0x399fa5[_0x775f('0x2f')],'type':_0x399fa5[_0x775f('0x30')][_0x775f('0x31')]};});_0x2e3ea1[_0x775f('0x32')]=_[_0x775f('0x2c')](_0x380414,_0x775f('0x33'));_0x2e3ea1[_0x775f('0x34')]=_['keys'](_0x28031c[_0x775f('0x34')]);_0x2e3ea1[_0x775f('0x35')]=_[_0x775f('0x36')](_0x2e3ea1['model'],_0x2e3ea1[_0x775f('0x34')]);_0x3d3abb[_0x775f('0x37')]=_[_0x775f('0x36')](_0x2e3ea1['model'],qs[_0x775f('0x38')](_0x28031c['query']['fields']));_0x3d3abb['attributes']=_0x3d3abb[_0x775f('0x37')][_0x775f('0x39')]?_0x3d3abb[_0x775f('0x37')]:_0x2e3ea1[_0x775f('0x32')];if(!_0x28031c['query'][_0x775f('0x3a')]('nolimit')){_0x3d3abb[_0x775f('0x21')]=qs[_0x775f('0x21')](_0x28031c[_0x775f('0x34')][_0x775f('0x21')]);_0x3d3abb[_0x775f('0x1f')]=qs[_0x775f('0x1f')](_0x28031c[_0x775f('0x34')][_0x775f('0x1f')]);}_0x3d3abb[_0x775f('0x3b')]=qs[_0x775f('0x3c')](_0x28031c[_0x775f('0x34')][_0x775f('0x3c')]);_0x3d3abb[_0x775f('0x3d')]=qs[_0x775f('0x35')](_[_0x775f('0x3e')](_0x28031c['query'],_0x2e3ea1['filters']),_0x380414);if(_0x28031c[_0x775f('0x34')][_0x775f('0x3f')]){_0x3d3abb[_0x775f('0x3d')]=_[_0x775f('0x40')](_0x3d3abb[_0x775f('0x3d')],{'$or':_[_0x775f('0x2c')](_0x380414,function(_0x2cc163){if(_0x2cc163['type']!==_0x775f('0x41')){var _0x1409a7={};_0x1409a7[_0x2cc163[_0x775f('0x33')]]={'$like':'%'+_0x28031c[_0x775f('0x34')][_0x775f('0x3f')]+'%'};return _0x1409a7;}})});}_0x3d3abb=_[_0x775f('0x40')]({},_0x3d3abb,_0x28031c[_0x775f('0x42')]);var _0x391b4d={'where':_0x3d3abb[_0x775f('0x3d')]};return db['MailTransferReport']['count'](_0x391b4d)[_0x775f('0x27')](function(_0x16e6ba){_0x5e5e17['count']=_0x16e6ba;if(_0x28031c[_0x775f('0x34')][_0x775f('0x43')]){_0x3d3abb[_0x775f('0x44')]=[{'all':!![]}];}return db[_0x775f('0x2d')]['findAll'](_0x3d3abb);})[_0x775f('0x27')](function(_0x4056dc){_0x5e5e17['rows']=_0x4056dc;return _0x5e5e17;})[_0x775f('0x27')](respondWithFilteredResult(_0x2d14fc,_0x3d3abb))[_0x775f('0x45')](handleError(_0x2d14fc,null));};exports['show']=function(_0x39685e,_0x31b3fe){var _0x5c34c7={'raw':!![],'where':{'id':_0x39685e[_0x775f('0x46')]['id']}},_0x2ed1c1={};_0x2ed1c1[_0x775f('0x32')]=_[_0x775f('0x47')](db['MailTransferReport']['rawAttributes']);_0x2ed1c1[_0x775f('0x34')]=_[_0x775f('0x47')](_0x39685e[_0x775f('0x34')]);_0x2ed1c1[_0x775f('0x35')]=_[_0x775f('0x36')](_0x2ed1c1[_0x775f('0x32')],_0x2ed1c1[_0x775f('0x34')]);_0x5c34c7[_0x775f('0x37')]=_[_0x775f('0x36')](_0x2ed1c1['model'],qs[_0x775f('0x38')](_0x39685e['query'][_0x775f('0x38')]));_0x5c34c7[_0x775f('0x37')]=_0x5c34c7[_0x775f('0x37')][_0x775f('0x39')]?_0x5c34c7[_0x775f('0x37')]:_0x2ed1c1[_0x775f('0x32')];if(_0x39685e[_0x775f('0x34')][_0x775f('0x43')]){_0x5c34c7['include']=[{'all':!![]}];}_0x5c34c7=_[_0x775f('0x40')]({},_0x5c34c7,_0x39685e[_0x775f('0x42')]);return db[_0x775f('0x2d')]['find'](_0x5c34c7)[_0x775f('0x27')](handleEntityNotFound(_0x31b3fe,null))['then'](respondWithResult(_0x31b3fe,null))[_0x775f('0x45')](handleError(_0x31b3fe,null));};exports[_0x775f('0x48')]=function(_0x373538,_0x34700c){return db[_0x775f('0x2d')][_0x775f('0x48')](_0x373538[_0x775f('0x49')],{})[_0x775f('0x27')](respondWithResult(_0x34700c,0xc9))[_0x775f('0x45')](handleError(_0x34700c,null));};exports[_0x775f('0x26')]=function(_0x122014,_0x3ff651){if(_0x122014[_0x775f('0x49')]['id']){delete _0x122014['body']['id'];}return db[_0x775f('0x2d')][_0x775f('0x4a')]({'where':{'id':_0x122014[_0x775f('0x46')]['id']}})[_0x775f('0x27')](handleEntityNotFound(_0x3ff651,null))[_0x775f('0x27')](saveUpdates(_0x122014[_0x775f('0x49')],null))[_0x775f('0x27')](respondWithResult(_0x3ff651,null))[_0x775f('0x45')](handleError(_0x3ff651,null));};exports['destroy']=function(_0x37c726,_0x40397f){return db[_0x775f('0x2d')]['find']({'where':{'id':_0x37c726[_0x775f('0x46')]['id']}})[_0x775f('0x27')](handleEntityNotFound(_0x40397f,null))[_0x775f('0x27')](removeEntity(_0x40397f,null))[_0x775f('0x45')](handleError(_0x40397f,null));};exports[_0x775f('0x4b')]=function(_0x4844e1,_0x41cb90){return db['MailTransferReport'][_0x775f('0x4b')]()['then'](respondWithResult(_0x41cb90,null))['catch'](handleError(_0x41cb90,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 8898635..802693f 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 _0xb439=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x480422,_0x42a39d){var _0x1b1f45=function(_0x2e9238){while(--_0x2e9238){_0x480422['push'](_0x480422['shift']());}};_0x1b1f45(++_0x42a39d);}(_0xb439,0x87));var _0x9b43=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb439[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x9b43('0x0'));var util=require(_0x9b43('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b43('0x2'));var BPromise=require(_0x9b43('0x3'));var rp=require(_0x9b43('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b43('0x5'));var config=require(_0x9b43('0x6'));var attributes=require(_0x9b43('0x7'));module[_0x9b43('0x8')]=function(_0x3ab870,_0x3d2a05){return _0x3ab870[_0x9b43('0x9')](_0x9b43('0xa'),attributes,{'tableName':_0x9b43('0xb'),'paranoid':![],'indexes':[{'name':_0x9b43('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c2a=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x13b07a,_0x49cfc3){var _0xdcbe0=function(_0x45dee2){while(--_0x45dee2){_0x13b07a['push'](_0x13b07a['shift']());}};_0xdcbe0(++_0x49cfc3);}(_0x3c2a,0x1b2));var _0xa3c2=function(_0x254532,_0x41d920){_0x254532=_0x254532-0x0;var _0x3edec4=_0x3c2a[_0x254532];return _0x3edec4;};'use strict';var _=require(_0xa3c2('0x0'));var util=require(_0xa3c2('0x1'));var logger=require('../../config/logger')(_0xa3c2('0x2'));var moment=require('moment');var BPromise=require(_0xa3c2('0x3'));var rp=require(_0xa3c2('0x4'));var fs=require('fs');var path=require(_0xa3c2('0x5'));var rimraf=require(_0xa3c2('0x6'));var config=require(_0xa3c2('0x7'));var attributes=require(_0xa3c2('0x8'));module[_0xa3c2('0x9')]=function(_0x230a89,_0x45a0b6){return _0x230a89[_0xa3c2('0xa')](_0xa3c2('0xb'),attributes,{'tableName':_0xa3c2('0xc'),'paranoid':![],'indexes':[{'name':_0xa3c2('0xd'),'fields':[_0xa3c2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8dc808e..93e7d08 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 _0x131e=['info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x167295,_0x555a81){var _0x400be6=function(_0x1edcba){while(--_0x1edcba){_0x167295['push'](_0x167295['shift']());}};_0x400be6(++_0x555a81);}(_0x131e,0x81));var _0xe131=function(_0x1855c9,_0x249834){_0x1855c9=_0x1855c9-0x0;var _0x44586b=_0x131e[_0x1855c9];return _0x44586b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe131('0x0'));var BPromise=require(_0xe131('0x1'));var rs=require(_0xe131('0x2'));var fs=require('fs');var Redis=require(_0xe131('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe131('0x4'));var logger=require('../../config/logger')(_0xe131('0x5'));var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x406a39,_0x570ec1,_0x2590d9){return new BPromise(function(_0x5ba341,_0x1f6f08){return client[_0xe131('0x9')](_0x406a39,_0x2590d9)[_0xe131('0xa')](function(_0x402218){logger[_0xe131('0xb')](_0xe131('0xc'),_0x570ec1,'request\x20sent');logger['debug'](_0xe131('0xd'),_0x570ec1,_0xe131('0xe'),JSON[_0xe131('0xf')](_0x402218));if(_0x402218[_0xe131('0x10')]){if(_0x402218['error'][_0xe131('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x570ec1,_0x402218[_0xe131('0x10')][_0xe131('0x12')]);return _0x1f6f08(_0x402218[_0xe131('0x10')][_0xe131('0x12')]);}logger['error'](_0xe131('0xc'),_0x570ec1,_0x402218[_0xe131('0x10')][_0xe131('0x12')]);return _0x5ba341(_0x402218[_0xe131('0x10')][_0xe131('0x12')]);}else{logger[_0xe131('0xb')](_0xe131('0xc'),_0x570ec1,_0xe131('0xe'));_0x5ba341(_0x402218[_0xe131('0x13')][_0xe131('0x12')]);}})['catch'](function(_0x544fb5){logger[_0xe131('0x10')](_0xe131('0xc'),_0x570ec1,_0x544fb5);_0x1f6f08(_0x544fb5);});});} \ No newline at end of file +var _0xa70d=['../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa70d,0xec));var _0xda70=function(_0x2c5b0c,_0x1c1f86){_0x2c5b0c=_0x2c5b0c-0x0;var _0x2f52c7=_0xa70d[_0x2c5b0c];return _0x2f52c7;};'use strict';var _=require(_0xda70('0x0'));var util=require(_0xda70('0x1'));var moment=require(_0xda70('0x2'));var BPromise=require('bluebird');var rs=require(_0xda70('0x3'));var fs=require('fs');var Redis=require(_0xda70('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xda70('0x5'));var config=require(_0xda70('0x6'));var jayson=require(_0xda70('0x7'));var client=jayson[_0xda70('0x8')][_0xda70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22f074,_0x24c6a6,_0x555c9b){return new BPromise(function(_0x714c26,_0x4a7375){return client[_0xda70('0xa')](_0x22f074,_0x555c9b)[_0xda70('0xb')](function(_0x42d48f){logger[_0xda70('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x24c6a6,'request\x20sent');logger['debug'](_0xda70('0xd'),_0x24c6a6,_0xda70('0xe'),JSON[_0xda70('0xf')](_0x42d48f));if(_0x42d48f[_0xda70('0x10')]){if(_0x42d48f[_0xda70('0x10')][_0xda70('0x11')]===0x1f4){logger['error'](_0xda70('0x12'),_0x24c6a6,_0x42d48f[_0xda70('0x10')][_0xda70('0x13')]);return _0x4a7375(_0x42d48f['error'][_0xda70('0x13')]);}logger[_0xda70('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x24c6a6,_0x42d48f['error'][_0xda70('0x13')]);return _0x714c26(_0x42d48f[_0xda70('0x10')][_0xda70('0x13')]);}else{logger[_0xda70('0xc')](_0xda70('0x12'),_0x24c6a6,_0xda70('0xe'));_0x714c26(_0x42d48f[_0xda70('0x14')][_0xda70('0x13')]);}})[_0xda70('0x15')](function(_0x434227){logger[_0xda70('0x10')](_0xda70('0x12'),_0x24c6a6,_0x434227);_0x4a7375(_0x434227);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 44ef1e6..a10e287 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 _0x7eb9=['Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','util','path','express'];(function(_0x33adc9,_0x5f444f){var _0xf3d44b=function(_0x3e0efc){while(--_0x3e0efc){_0x33adc9['push'](_0x33adc9['shift']());}};_0xf3d44b(++_0x5f444f);}(_0x7eb9,0x12f));var _0x97eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7eb9[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x97eb('0x0'));var path=require(_0x97eb('0x1'));var timeout=require('connect-timeout');var express=require(_0x97eb('0x2'));var router=express[_0x97eb('0x3')]();var fs_extra=require(_0x97eb('0x4'));var auth=require(_0x97eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x97eb('0x6'));var controller=require(_0x97eb('0x7'));router[_0x97eb('0x8')]('/',auth[_0x97eb('0x9')](),controller[_0x97eb('0xa')]);router[_0x97eb('0x8')](_0x97eb('0xb'),auth[_0x97eb('0x9')](),controller['describe']);router[_0x97eb('0x8')](_0x97eb('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x97eb('0xd')]('/',auth[_0x97eb('0x9')](),controller[_0x97eb('0xe')]);router[_0x97eb('0xf')](_0x97eb('0xc'),auth[_0x97eb('0x9')](),controller[_0x97eb('0x10')]);router['delete'](_0x97eb('0xc'),auth[_0x97eb('0x9')](),controller[_0x97eb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9405=['../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9405,0x19b));var _0x5940=function(_0x17ab07,_0x175fa0){_0x17ab07=_0x17ab07-0x0;var _0x5754d0=_0x9405[_0x17ab07];return _0x5754d0;};'use strict';var multer=require(_0x5940('0x0'));var util=require(_0x5940('0x1'));var path=require(_0x5940('0x2'));var timeout=require(_0x5940('0x3'));var express=require(_0x5940('0x4'));var router=express[_0x5940('0x5')]();var fs_extra=require(_0x5940('0x6'));var auth=require(_0x5940('0x7'));var interaction=require(_0x5940('0x8'));var config=require(_0x5940('0x9'));var controller=require(_0x5940('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x5940('0xb')]);router[_0x5940('0xc')](_0x5940('0xd'),auth[_0x5940('0xe')](),controller[_0x5940('0xf')]);router[_0x5940('0xc')](_0x5940('0x10'),auth[_0x5940('0xe')](),controller[_0x5940('0x11')]);router[_0x5940('0x12')]('/',auth[_0x5940('0xe')](),controller[_0x5940('0x13')]);router['put'](_0x5940('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x5940('0x14')](_0x5940('0x10'),auth[_0x5940('0xe')](),controller['destroy']);module[_0x5940('0x15')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a6ca122..8c68d05 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 _0xab38=['DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING'];(function(_0x18b707,_0x1010fe){var _0x1250b2=function(_0x3cffc5){while(--_0x3cffc5){_0x18b707['push'](_0x18b707['shift']());}};_0x1250b2(++_0x1010fe);}(_0xab38,0xe0));var _0x8ab3=function(_0x2bea7a,_0x194456){_0x2bea7a=_0x2bea7a-0x0;var _0xda3ab0=_0xab38[_0x2bea7a];return _0xda3ab0;};'use strict';var Sequelize=require(_0x8ab3('0x0'));var moment=require(_0x8ab3('0x1'));module[_0x8ab3('0x2')]={'channel':{'type':Sequelize[_0x8ab3('0x3')]},'membername':{'type':Sequelize[_0x8ab3('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8ab3('0x3')],'defaultValue':_0x8ab3('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x8ab3('0x5')]},'enterAt':{'type':Sequelize[_0x8ab3('0x6')]},'exitAt':{'type':Sequelize[_0x8ab3('0x6')],'set':function(_0x4617da){var _0x4c2f1c=moment(_0x4617da);var _0x16a473=moment(this[_0x8ab3('0x7')](_0x8ab3('0x8')));var _0x573748=_0x4c2f1c[_0x8ab3('0x9')](_0x16a473,_0x8ab3('0xa'));this[_0x8ab3('0xb')](_0x8ab3('0xc'),_0x4617da);this[_0x8ab3('0xb')](_0x8ab3('0xd'),_0x573748>=0x0?_0x573748:null);}},'data1':{'type':Sequelize[_0x8ab3('0x3')],'comment':_0x8ab3('0xe')},'data2':{'type':Sequelize[_0x8ab3('0x3')],'comment':_0x8ab3('0xf')},'data3':{'type':Sequelize[_0x8ab3('0x3')],'comment':_0x8ab3('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0x8ab3('0x11')},'data5':{'type':Sequelize[_0x8ab3('0x3')],'comment':_0x8ab3('0x12')},'role':{'type':Sequelize[_0x8ab3('0x3')]},'internal':{'type':Sequelize[_0x8ab3('0x5')]},'uniqueid':{'type':Sequelize[_0x8ab3('0x3')]}}; \ No newline at end of file +var _0xc2a2=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','enterAt','setDataValue'];(function(_0x63ecb6,_0x55eb9f){var _0x1fbff5=function(_0x4af13f){while(--_0x4af13f){_0x63ecb6['push'](_0x63ecb6['shift']());}};_0x1fbff5(++_0x55eb9f);}(_0xc2a2,0x170));var _0x2c2a=function(_0x281e03,_0x51786d){_0x281e03=_0x281e03-0x0;var _0x4511f0=_0xc2a2[_0x281e03];return _0x4511f0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2c2a('0x0'));module[_0x2c2a('0x1')]={'channel':{'type':Sequelize[_0x2c2a('0x2')]},'membername':{'type':Sequelize[_0x2c2a('0x2')]},'interface':{'type':Sequelize[_0x2c2a('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2c2a('0x3'),'comment':_0x2c2a('0x4')},'duration':{'type':Sequelize[_0x2c2a('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x208bec){var _0x1de565=moment(_0x208bec);var _0x195785=moment(this[_0x2c2a('0x6')](_0x2c2a('0x7')));var _0x235f3c=_0x1de565['diff'](_0x195785,'seconds');this[_0x2c2a('0x8')](_0x2c2a('0x9'),_0x208bec);this[_0x2c2a('0x8')](_0x2c2a('0xa'),_0x235f3c>=0x0?_0x235f3c:null);}},'data1':{'type':Sequelize[_0x2c2a('0x2')],'comment':_0x2c2a('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2c2a('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2c2a('0x2')],'comment':_0x2c2a('0xc')},'data5':{'type':Sequelize[_0x2c2a('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2c2a('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 4a454b7..d96af12 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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'];(function(_0x163374,_0x1b0054){var _0x445d96=function(_0x532d44){while(--_0x532d44){_0x163374['push'](_0x163374['shift']());}};_0x445d96(++_0x1b0054);}(_0x008c,0x188));var _0xc008=function(_0x53c7a0,_0x41ece0){_0x53c7a0=_0x53c7a0-0x0;var _0x150d96=_0x008c[_0x53c7a0];return _0x150d96;};'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(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x6c9205,_0x2154c2){var _0x22eecb=function(_0x1477fa){while(--_0x1477fa){_0x6c9205['push'](_0x6c9205['shift']());}};_0x22eecb(++_0x2154c2);}(_0x3e74,0x175));var _0x43e7=function(_0x5a4d1d,_0xd3596c){_0x5a4d1d=_0x5a4d1d-0x0;var _0x2ea962=_0x3e74[_0x5a4d1d];return _0x2ea962;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 6456b90..de81d73 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 _0x7a8a=['./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x2499de,_0x472aa3){var _0x37e95b=function(_0x453c18){while(--_0x453c18){_0x2499de['push'](_0x2499de['shift']());}};_0x37e95b(++_0x472aa3);}(_0x7a8a,0x173));var _0xa7a8=function(_0x5ac352,_0x8d85ae){_0x5ac352=_0x5ac352-0x0;var _0x4874bb=_0x7a8a[_0x5ac352];return _0x4874bb;};'use strict';var _=require(_0xa7a8('0x0'));var util=require(_0xa7a8('0x1'));var logger=require('../../config/logger')(_0xa7a8('0x2'));var moment=require(_0xa7a8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7a8('0x5'));var config=require(_0xa7a8('0x6'));var attributes=require(_0xa7a8('0x7'));module[_0xa7a8('0x8')]=function(_0x122c9d,_0x1c579d){return _0x122c9d[_0xa7a8('0x9')](_0xa7a8('0xa'),attributes,{'tableName':_0xa7a8('0xb'),'paranoid':![],'indexes':[{'name':_0xa7a8('0xc'),'fields':[_0xa7a8('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb054=['membername_interface','membername','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xb054,0x128));var _0x4b05=function(_0x349cf1,_0x474e7c){_0x349cf1=_0x349cf1-0x0;var _0x5c4f28=_0xb054[_0x349cf1];return _0x5c4f28;};'use strict';var _=require(_0x4b05('0x0'));var util=require(_0x4b05('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b05('0x2'));var rp=require(_0x4b05('0x3'));var fs=require('fs');var path=require(_0x4b05('0x4'));var rimraf=require(_0x4b05('0x5'));var config=require(_0x4b05('0x6'));var attributes=require(_0x4b05('0x7'));module[_0x4b05('0x8')]=function(_0x30f394,_0x5cef1e){return _0x30f394[_0x4b05('0x9')](_0x4b05('0xa'),attributes,{'tableName':_0x4b05('0xb'),'paranoid':![],'indexes':[{'name':_0x4b05('0xc'),'fields':[_0x4b05('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 5d9552f..0fec7ff 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 _0x0d91=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','create','UpdateMemberReport','update','body','lodash','util'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x0d91,0x76));var _0x10d9=function(_0x5673c4,_0x5b672d){_0x5673c4=_0x5673c4-0x0;var _0x32b859=_0x0d91[_0x5673c4];return _0x32b859;};'use strict';var _=require(_0x10d9('0x0'));var util=require(_0x10d9('0x1'));var moment=require(_0x10d9('0x2'));var BPromise=require(_0x10d9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10d9('0x4'));var db=require(_0x10d9('0x5'))['db'];var utils=require(_0x10d9('0x6'));var logger=require('../../config/logger')(_0x10d9('0x7'));var config=require(_0x10d9('0x8'));var jayson=require(_0x10d9('0x9'));var client=jayson['client'][_0x10d9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a49ab,_0x946fc7,_0x26b6cf){return new BPromise(function(_0x2558bb,_0x3d4ca7){return client[_0x10d9('0xb')](_0x3a49ab,_0x26b6cf)[_0x10d9('0xc')](function(_0x24b5e7){logger[_0x10d9('0xd')](_0x10d9('0xe'),_0x946fc7,_0x10d9('0xf'));logger[_0x10d9('0x10')](_0x10d9('0x11'),_0x946fc7,_0x10d9('0xf'),JSON[_0x10d9('0x12')](_0x24b5e7));if(_0x24b5e7[_0x10d9('0x13')]){if(_0x24b5e7['error'][_0x10d9('0x14')]===0x1f4){logger[_0x10d9('0x13')](_0x10d9('0xe'),_0x946fc7,_0x24b5e7[_0x10d9('0x13')][_0x10d9('0x15')]);return _0x3d4ca7(_0x24b5e7['error'][_0x10d9('0x15')]);}logger['error'](_0x10d9('0xe'),_0x946fc7,_0x24b5e7[_0x10d9('0x13')][_0x10d9('0x15')]);return _0x2558bb(_0x24b5e7[_0x10d9('0x13')][_0x10d9('0x15')]);}else{logger[_0x10d9('0xd')](_0x10d9('0xe'),_0x946fc7,_0x10d9('0xf'));_0x2558bb(_0x24b5e7[_0x10d9('0x16')][_0x10d9('0x15')]);}})['catch'](function(_0x5658b5){logger[_0x10d9('0x13')](_0x10d9('0xe'),_0x946fc7,_0x5658b5);_0x3d4ca7(_0x5658b5);});});}exports[_0x10d9('0x17')]=function(_0x1e9db9){var _0x4fdea6=this;return new Promise(function(_0x3f5819,_0x206045){return db[_0x10d9('0x18')][_0x10d9('0x19')]({'raw':_0x1e9db9['options']?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e9db9['options']?_0x1e9db9['options'][_0x10d9('0x1c')]||null:null,'attributes':_0x1e9db9['options']?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1d')]||null:null,'limit':_0x1e9db9['options']?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1e')]||null:null,'include':_0x1e9db9[_0x10d9('0x1a')]?_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x1e9db9[_0x10d9('0x1a')][_0x10d9('0x1f')],function(_0x13a3e0){return{'model':db[_0x13a3e0[_0x10d9('0x21')]],'as':_0x13a3e0['as'],'attributes':_0x13a3e0[_0x10d9('0x1d')],'include':_0x13a3e0[_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x13a3e0[_0x10d9('0x1f')],function(_0x76e43d){return{'model':db[_0x76e43d['model']],'as':_0x76e43d['as'],'attributes':_0x76e43d[_0x10d9('0x1d')],'include':_0x76e43d[_0x10d9('0x1f')]?_[_0x10d9('0x20')](_0x76e43d[_0x10d9('0x1f')],function(_0x4b2619){return{'model':db[_0x4b2619[_0x10d9('0x21')]],'as':_0x4b2619['as'],'attributes':_0x4b2619[_0x10d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x10d9('0xc')](function(_0x96655f){logger[_0x10d9('0xd')](_0x10d9('0x17'),_0x1e9db9);logger['debug'](_0x10d9('0x17'),_0x1e9db9,JSON['stringify'](_0x96655f));_0x3f5819(_0x96655f);})[_0x10d9('0x22')](function(_0x3ec714){logger[_0x10d9('0x13')](_0x10d9('0x17'),_0x3ec714[_0x10d9('0x15')],_0x1e9db9);_0x206045(_0x4fdea6['error'](0x1f4,_0x3ec714['message']));});});};exports[_0x10d9('0x23')]=function(_0x108bd5){var _0x4f4359=this;return new Promise(function(_0x53ae15,_0x37b4de){return db[_0x10d9('0x18')][_0x10d9('0x24')](_0x108bd5['body'],{'raw':_0x108bd5[_0x10d9('0x1a')]?_0x108bd5['options'][_0x10d9('0x1b')]===undefined?!![]:![]:!![]})[_0x10d9('0xc')](function(_0x547dc2){logger['info'](_0x10d9('0x23'),_0x108bd5);logger[_0x10d9('0x10')]('CreateMemberReport',_0x108bd5,JSON[_0x10d9('0x12')](_0x547dc2));_0x53ae15(_0x547dc2);})[_0x10d9('0x22')](function(_0x5846bc){logger[_0x10d9('0x13')](_0x10d9('0x23'),_0x5846bc[_0x10d9('0x15')],_0x108bd5);_0x37b4de(_0x4f4359['error'](0x1f4,_0x5846bc[_0x10d9('0x15')]));});});};exports[_0x10d9('0x25')]=function(_0x9ddff){var _0x506575=this;return new Promise(function(_0x7dbda0,_0x3cdea9){return db['MemberReport'][_0x10d9('0x26')](_0x9ddff[_0x10d9('0x27')],{'raw':_0x9ddff[_0x10d9('0x1a')]?_0x9ddff[_0x10d9('0x1a')][_0x10d9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9ddff[_0x10d9('0x1a')]?_0x9ddff['options']['where']||null:null,'attributes':_0x9ddff['options']?_0x9ddff[_0x10d9('0x1a')][_0x10d9('0x1d')]||null:null,'limit':_0x9ddff[_0x10d9('0x1a')]?_0x9ddff[_0x10d9('0x1a')][_0x10d9('0x1e')]||null:null})['then'](function(_0x3e1c4e){logger[_0x10d9('0xd')](_0x10d9('0x25'),_0x9ddff);logger[_0x10d9('0x10')]('UpdateMemberReport',_0x9ddff,JSON[_0x10d9('0x12')](_0x3e1c4e));_0x7dbda0(_0x3e1c4e);})[_0x10d9('0x22')](function(_0xdd2c0d){logger[_0x10d9('0x13')](_0x10d9('0x25'),_0xdd2c0d[_0x10d9('0x15')],_0x9ddff);_0x3cdea9(_0x506575['error'](0x1f4,_0xdd2c0d[_0x10d9('0x15')]));});});}; \ No newline at end of file +var _0x86f4=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2d912c,_0x53bfb9){var _0x208b06=function(_0x3d8758){while(--_0x3d8758){_0x2d912c['push'](_0x2d912c['shift']());}};_0x208b06(++_0x53bfb9);}(_0x86f4,0x18a));var _0x486f=function(_0x2bb883,_0x4dbe8f){_0x2bb883=_0x2bb883-0x0;var _0x22933a=_0x86f4[_0x2bb883];return _0x22933a;};'use strict';var _=require(_0x486f('0x0'));var util=require(_0x486f('0x1'));var moment=require(_0x486f('0x2'));var BPromise=require(_0x486f('0x3'));var rs=require(_0x486f('0x4'));var fs=require('fs');var Redis=require(_0x486f('0x5'));var db=require(_0x486f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x486f('0x7'))(_0x486f('0x8'));var config=require('../../config/environment');var jayson=require(_0x486f('0x9'));var client=jayson[_0x486f('0xa')][_0x486f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x207201,_0x3c6469,_0x3a0791){return new BPromise(function(_0x5bfabc,_0x33363d){return client[_0x486f('0xc')](_0x207201,_0x3a0791)[_0x486f('0xd')](function(_0x468a82){logger[_0x486f('0xe')](_0x486f('0xf'),_0x3c6469,_0x486f('0x10'));logger[_0x486f('0x11')](_0x486f('0x12'),_0x3c6469,_0x486f('0x10'),JSON[_0x486f('0x13')](_0x468a82));if(_0x468a82[_0x486f('0x14')]){if(_0x468a82[_0x486f('0x14')][_0x486f('0x15')]===0x1f4){logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x468a82[_0x486f('0x14')]['message']);return _0x33363d(_0x468a82[_0x486f('0x14')]['message']);}logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x468a82[_0x486f('0x14')]['message']);return _0x5bfabc(_0x468a82['error'][_0x486f('0x16')]);}else{logger[_0x486f('0xe')]('MemberReport,\x20%s,\x20%s',_0x3c6469,_0x486f('0x10'));_0x5bfabc(_0x468a82[_0x486f('0x17')][_0x486f('0x16')]);}})['catch'](function(_0x53561a){logger[_0x486f('0x14')](_0x486f('0xf'),_0x3c6469,_0x53561a);_0x33363d(_0x53561a);});});}exports[_0x486f('0x18')]=function(_0x39bfac){var _0x4e68d1=this;return new Promise(function(_0x59deb8,_0x268eb9){return db[_0x486f('0x19')][_0x486f('0x1a')]({'raw':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1c')]===undefined?!![]:![]:!![],'where':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1d')]||null:null,'attributes':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1e')]||null:null,'limit':_0x39bfac[_0x486f('0x1b')]?_0x39bfac[_0x486f('0x1b')][_0x486f('0x1f')]||null:null,'include':_0x39bfac[_0x486f('0x1b')]?_0x39bfac['options'][_0x486f('0x20')]?_[_0x486f('0x21')](_0x39bfac[_0x486f('0x1b')][_0x486f('0x20')],function(_0x351f81){return{'model':db[_0x351f81[_0x486f('0x22')]],'as':_0x351f81['as'],'attributes':_0x351f81[_0x486f('0x1e')],'include':_0x351f81[_0x486f('0x20')]?_[_0x486f('0x21')](_0x351f81[_0x486f('0x20')],function(_0x2e983b){return{'model':db[_0x2e983b[_0x486f('0x22')]],'as':_0x2e983b['as'],'attributes':_0x2e983b[_0x486f('0x1e')],'include':_0x2e983b[_0x486f('0x20')]?_[_0x486f('0x21')](_0x2e983b[_0x486f('0x20')],function(_0x6f1e8e){return{'model':db[_0x6f1e8e[_0x486f('0x22')]],'as':_0x6f1e8e['as'],'attributes':_0x6f1e8e[_0x486f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x486f('0xd')](function(_0x3c2762){logger[_0x486f('0xe')]('GetMemberReport',_0x39bfac);logger['debug']('GetMemberReport',_0x39bfac,JSON['stringify'](_0x3c2762));_0x59deb8(_0x3c2762);})[_0x486f('0x23')](function(_0x5c994a){logger[_0x486f('0x14')](_0x486f('0x18'),_0x5c994a['message'],_0x39bfac);_0x268eb9(_0x4e68d1[_0x486f('0x14')](0x1f4,_0x5c994a['message']));});});};exports[_0x486f('0x24')]=function(_0x2f166c){var _0x1481c1=this;return new Promise(function(_0x604ec3,_0x1962c2){return db[_0x486f('0x19')]['create'](_0x2f166c[_0x486f('0x25')],{'raw':_0x2f166c[_0x486f('0x1b')]?_0x2f166c[_0x486f('0x1b')][_0x486f('0x1c')]===undefined?!![]:![]:!![]})[_0x486f('0xd')](function(_0x22d89c){logger[_0x486f('0xe')](_0x486f('0x24'),_0x2f166c);logger['debug'](_0x486f('0x24'),_0x2f166c,JSON[_0x486f('0x13')](_0x22d89c));_0x604ec3(_0x22d89c);})['catch'](function(_0x153a48){logger[_0x486f('0x14')](_0x486f('0x24'),_0x153a48[_0x486f('0x16')],_0x2f166c);_0x1962c2(_0x1481c1[_0x486f('0x14')](0x1f4,_0x153a48['message']));});});};exports[_0x486f('0x26')]=function(_0x40dd81){var _0x1be0da=this;return new Promise(function(_0x202ea8,_0x387939){return db[_0x486f('0x19')][_0x486f('0x27')](_0x40dd81['body'],{'raw':_0x40dd81[_0x486f('0x1b')]?_0x40dd81[_0x486f('0x1b')][_0x486f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40dd81['options']?_0x40dd81['options'][_0x486f('0x1d')]||null:null,'attributes':_0x40dd81[_0x486f('0x1b')]?_0x40dd81['options'][_0x486f('0x1e')]||null:null,'limit':_0x40dd81['options']?_0x40dd81[_0x486f('0x1b')][_0x486f('0x1f')]||null:null})['then'](function(_0x5a8eb2){logger[_0x486f('0xe')](_0x486f('0x26'),_0x40dd81);logger[_0x486f('0x11')](_0x486f('0x26'),_0x40dd81,JSON[_0x486f('0x13')](_0x5a8eb2));_0x202ea8(_0x5a8eb2);})[_0x486f('0x23')](function(_0x901b9){logger[_0x486f('0x14')](_0x486f('0x26'),_0x901b9[_0x486f('0x16')],_0x40dd81);_0x387939(_0x1be0da[_0x486f('0x14')](0x1f4,_0x901b9[_0x486f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index f3dc57a..3240cfe 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 _0xd3ed=['get','index','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller'];(function(_0x3e774a,_0x14de4f){var _0x2adf57=function(_0xc756f0){while(--_0xc756f0){_0x3e774a['push'](_0x3e774a['shift']());}};_0x2adf57(++_0x14de4f);}(_0xd3ed,0x15f));var _0xdd3e=function(_0x27d6c0,_0x5a4468){_0x27d6c0=_0x27d6c0-0x0;var _0xdd5a28=_0xd3ed[_0x27d6c0];return _0xdd5a28;};'use strict';var multer=require(_0xdd3e('0x0'));var util=require(_0xdd3e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdd3e('0x2'));var router=express[_0xdd3e('0x3')]();var fs_extra=require(_0xdd3e('0x4'));var auth=require(_0xdd3e('0x5'));var interaction=require(_0xdd3e('0x6'));var config=require(_0xdd3e('0x7'));var controller=require(_0xdd3e('0x8'));router[_0xdd3e('0x9')]('/',controller[_0xdd3e('0xa')]);module[_0xdd3e('0xb')]=router; \ No newline at end of file +var _0x0183=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x42c0c7,_0x10c2eb){var _0xd3bb5=function(_0x1d54c8){while(--_0x1d54c8){_0x42c0c7['push'](_0x42c0c7['shift']());}};_0xd3bb5(++_0x10c2eb);}(_0x0183,0x1e1));var _0x3018=function(_0x47f1ed,_0x27ebb9){_0x47f1ed=_0x47f1ed-0x0;var _0x52f25a=_0x0183[_0x47f1ed];return _0x52f25a;};'use strict';var multer=require(_0x3018('0x0'));var util=require(_0x3018('0x1'));var path=require(_0x3018('0x2'));var timeout=require(_0x3018('0x3'));var express=require(_0x3018('0x4'));var router=express[_0x3018('0x5')]();var fs_extra=require(_0x3018('0x6'));var auth=require(_0x3018('0x7'));var interaction=require(_0x3018('0x8'));var config=require(_0x3018('0x9'));var controller=require(_0x3018('0xa'));router['get']('/',controller[_0x3018('0xb')]);module[_0x3018('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f1e0cf7..921cbac 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 _0x73c3=['STRING','sequelize'];(function(_0x14a266,_0xd97a26){var _0x512a9e=function(_0xcc6869){while(--_0xcc6869){_0x14a266['push'](_0x14a266['shift']());}};_0x512a9e(++_0xd97a26);}(_0x73c3,0x15f));var _0x373c=function(_0x30811b,_0x83492e){_0x30811b=_0x30811b-0x0;var _0x3580ed=_0x73c3[_0x30811b];return _0x3580ed;};'use strict';var Sequelize=require(_0x373c('0x0'));module['exports']={'version':{'type':Sequelize[_0x373c('0x1')],'unique':'version'}}; \ No newline at end of file +var _0x3c0f=['sequelize','STRING','version'];(function(_0x29dda1,_0x508e13){var _0x21b0ef=function(_0x118906){while(--_0x118906){_0x29dda1['push'](_0x29dda1['shift']());}};_0x21b0ef(++_0x508e13);}(_0x3c0f,0x159));var _0xf3c0=function(_0x3bef2c,_0x5a86fd){_0x3bef2c=_0x3bef2c-0x0;var _0x331503=_0x3c0f[_0x3bef2c];return _0x331503;};'use strict';var Sequelize=require(_0xf3c0('0x0'));module['exports']={'version':{'type':Sequelize[_0xf3c0('0x1')],'unique':_0xf3c0('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0ff983d..0ed0a15 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=['crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','status','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Migration','count','include','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel'];(function(_0x1869dd,_0x5893af){var _0x197c2d=function(_0x2a98d6){while(--_0x2a98d6){_0x1869dd['push'](_0x1869dd['shift']());}};_0x197c2d(++_0x5893af);}(_0xbac8,0x1ec));var _0x8bac=function(_0x13b5a8,_0xb5ee28){_0x13b5a8=_0x13b5a8-0x0;var _0x7a98ef=_0xbac8[_0x13b5a8];return _0x7a98ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bac('0x0'));var zipdir=require(_0x8bac('0x1'));var jsonpatch=require(_0x8bac('0x2'));var rp=require(_0x8bac('0x3'));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('jsforce');var deskjs=require(_0x8bac('0xd'));var toCsv=require(_0x8bac('0xe'));var querystring=require(_0x8bac('0xf'));var Papa=require(_0x8bac('0x10'));var Redis=require(_0x8bac('0x11'));var authService=require(_0x8bac('0x12'));var qs=require(_0x8bac('0x13'));var as=require(_0x8bac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bac('0x15'))('api');var utils=require(_0x8bac('0x16'));var config=require(_0x8bac('0x17'));var licenseUtil=require(_0x8bac('0x18'));var db=require(_0x8bac('0x19'))['db'];function respondWithStatusCode(_0x367221,_0x4df96c){_0x4df96c=_0x4df96c||0xcc;return function(_0x1dfae6){if(_0x1dfae6){return _0x367221[_0x8bac('0x1a')](_0x4df96c);}return _0x367221['status'](_0x4df96c)[_0x8bac('0x1b')]();};}function respondWithResult(_0x578445,_0x1e8040){_0x1e8040=_0x1e8040||0xc8;return function(_0x1b6e52){if(_0x1b6e52){return _0x578445['status'](_0x1e8040)['json'](_0x1b6e52);}};}function respondWithFilteredResult(_0x2f4c12,_0x2f6191){return function(_0x3b7a26){if(_0x3b7a26){var _0x29ad00=typeof _0x2f6191[_0x8bac('0x1c')]==='undefined'&&typeof _0x2f6191['limit']===_0x8bac('0x1d');var _0x37aa75=_0x3b7a26['count'];var _0x2c5a3e=_0x29ad00?0x0:_0x2f6191['offset'];var _0xaf2c8d=_0x29ad00?_0x3b7a26['count']:_0x2f6191[_0x8bac('0x1c')]+_0x2f6191[_0x8bac('0x1e')];var _0x408857;if(_0xaf2c8d>=_0x37aa75){_0xaf2c8d=_0x37aa75;_0x408857=0xc8;}else{_0x408857=0xce;}_0x2f4c12[_0x8bac('0x1f')](_0x408857);return _0x2f4c12[_0x8bac('0x20')](_0x8bac('0x21'),_0x2c5a3e+'-'+_0xaf2c8d+'/'+_0x37aa75)[_0x8bac('0x22')](_0x3b7a26);}return null;};}function patchUpdates(_0x4c0cf3){return function(_0x6e46cf){try{jsonpatch[_0x8bac('0x23')](_0x6e46cf,_0x4c0cf3,!![]);}catch(_0x201827){return BPromise[_0x8bac('0x24')](_0x201827);}return _0x6e46cf[_0x8bac('0x25')]();};}function saveUpdates(_0x45c920,_0x3b3e2f){return function(_0x34c72a){if(_0x34c72a){return _0x34c72a['update'](_0x45c920)[_0x8bac('0x26')](function(_0x3b283e){return _0x3b283e;});}return null;};}function removeEntity(_0x39508f,_0x12fd78){return function(_0x4adf41){if(_0x4adf41){return _0x4adf41[_0x8bac('0x27')]()[_0x8bac('0x26')](function(){_0x39508f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57afef,_0x500109){return function(_0x576802){if(!_0x576802){_0x57afef[_0x8bac('0x1a')](0x194);}return _0x576802;};}function handleError(_0x108c6e,_0x4d50ca){_0x4d50ca=_0x4d50ca||0x1f4;return function(_0x1dbcf8){logger[_0x8bac('0x28')](_0x1dbcf8[_0x8bac('0x29')]);if(_0x1dbcf8['name']){delete _0x1dbcf8[_0x8bac('0x2a')];}_0x108c6e['status'](_0x4d50ca)[_0x8bac('0x2b')](_0x1dbcf8);};}exports[_0x8bac('0x2c')]=function(_0x882595,_0x1a0525){var _0x2eb518={},_0x59908e={},_0x41c2c3={'count':0x0,'rows':[]};var _0x5c0df6=_['map'](db['Migration'][_0x8bac('0x2d')],function(_0x362361){return{'name':_0x362361[_0x8bac('0x2e')],'type':_0x362361[_0x8bac('0x2f')]['key']};});_0x59908e[_0x8bac('0x30')]=_[_0x8bac('0x31')](_0x5c0df6,_0x8bac('0x2a'));_0x59908e[_0x8bac('0x32')]=_[_0x8bac('0x33')](_0x882595[_0x8bac('0x32')]);_0x59908e[_0x8bac('0x34')]=_['intersection'](_0x59908e[_0x8bac('0x30')],_0x59908e[_0x8bac('0x32')]);_0x2eb518[_0x8bac('0x35')]=_[_0x8bac('0x36')](_0x59908e[_0x8bac('0x30')],qs['fields'](_0x882595[_0x8bac('0x32')][_0x8bac('0x37')]));_0x2eb518[_0x8bac('0x35')]=_0x2eb518[_0x8bac('0x35')][_0x8bac('0x38')]?_0x2eb518[_0x8bac('0x35')]:_0x59908e[_0x8bac('0x30')];if(!_0x882595['query'][_0x8bac('0x39')](_0x8bac('0x3a'))){_0x2eb518[_0x8bac('0x1e')]=qs[_0x8bac('0x1e')](_0x882595['query'][_0x8bac('0x1e')]);_0x2eb518[_0x8bac('0x1c')]=qs[_0x8bac('0x1c')](_0x882595[_0x8bac('0x32')][_0x8bac('0x1c')]);}_0x2eb518[_0x8bac('0x3b')]=qs[_0x8bac('0x3c')](_0x882595[_0x8bac('0x32')]['sort']);_0x2eb518[_0x8bac('0x3d')]=qs[_0x8bac('0x34')](_[_0x8bac('0x3e')](_0x882595[_0x8bac('0x32')],_0x59908e[_0x8bac('0x34')]),_0x5c0df6);if(_0x882595[_0x8bac('0x32')][_0x8bac('0x3f')]){_0x2eb518[_0x8bac('0x3d')]=_[_0x8bac('0x40')](_0x2eb518[_0x8bac('0x3d')],{'$or':_[_0x8bac('0x31')](_0x5c0df6,function(_0x58fe87){if(_0x58fe87[_0x8bac('0x2f')]!==_0x8bac('0x41')){var _0x52f6d6={};_0x52f6d6[_0x58fe87[_0x8bac('0x2a')]]={'$like':'%'+_0x882595['query'][_0x8bac('0x3f')]+'%'};return _0x52f6d6;}})});}_0x2eb518=_[_0x8bac('0x40')]({},_0x2eb518,_0x882595['options']);var _0x227b37={'where':_0x2eb518[_0x8bac('0x3d')]};return db[_0x8bac('0x42')][_0x8bac('0x43')](_0x227b37)[_0x8bac('0x26')](function(_0x1ae7f0){_0x41c2c3[_0x8bac('0x43')]=_0x1ae7f0;if(_0x882595['query']['includeAll']){_0x2eb518[_0x8bac('0x44')]=[{'all':!![]}];}return db[_0x8bac('0x42')][_0x8bac('0x45')](_0x2eb518);})[_0x8bac('0x26')](function(_0x4a84a4){_0x41c2c3[_0x8bac('0x46')]=_0x4a84a4;return _0x41c2c3;})[_0x8bac('0x26')](respondWithFilteredResult(_0x1a0525,_0x2eb518))[_0x8bac('0x47')](handleError(_0x1a0525,null));}; \ No newline at end of file +var _0xc91c=['catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Migration','include','rows'];(function(_0x3968a8,_0x333b4e){var _0x3cf27d=function(_0x1d1026){while(--_0x1d1026){_0x3968a8['push'](_0x3968a8['shift']());}};_0x3cf27d(++_0x333b4e);}(_0xc91c,0x150));var _0xcc91=function(_0xacb1e2,_0x55e0ab){_0xacb1e2=_0xacb1e2-0x0;var _0x463815=_0xc91c[_0xacb1e2];return _0x463815;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc91('0x0'));var zipdir=require(_0xcc91('0x1'));var jsonpatch=require(_0xcc91('0x2'));var rp=require(_0xcc91('0x3'));var moment=require(_0xcc91('0x4'));var BPromise=require(_0xcc91('0x5'));var Mustache=require(_0xcc91('0x6'));var util=require(_0xcc91('0x7'));var path=require(_0xcc91('0x8'));var sox=require(_0xcc91('0x9'));var csv=require(_0xcc91('0xa'));var ejs=require(_0xcc91('0xb'));var fs=require('fs');var fs_extra=require(_0xcc91('0xc'));var _=require(_0xcc91('0xd'));var squel=require(_0xcc91('0xe'));var crypto=require(_0xcc91('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xcc91('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcc91('0x11'));var Papa=require(_0xcc91('0x12'));var Redis=require(_0xcc91('0x13'));var authService=require(_0xcc91('0x14'));var qs=require(_0xcc91('0x15'));var as=require(_0xcc91('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc91('0x17'))('api');var utils=require(_0xcc91('0x18'));var config=require(_0xcc91('0x19'));var licenseUtil=require(_0xcc91('0x1a'));var db=require(_0xcc91('0x1b'))['db'];function respondWithStatusCode(_0x226c42,_0x40cba6){_0x40cba6=_0x40cba6||0xcc;return function(_0x2077cf){if(_0x2077cf){return _0x226c42['sendStatus'](_0x40cba6);}return _0x226c42[_0xcc91('0x1c')](_0x40cba6)['end']();};}function respondWithResult(_0x2f6419,_0x4120e1){_0x4120e1=_0x4120e1||0xc8;return function(_0x2fd82a){if(_0x2fd82a){return _0x2f6419['status'](_0x4120e1)[_0xcc91('0x1d')](_0x2fd82a);}};}function respondWithFilteredResult(_0x374f31,_0x58370e){return function(_0x2f6292){if(_0x2f6292){var _0x177d60=typeof _0x58370e[_0xcc91('0x1e')]==='undefined'&&typeof _0x58370e['limit']===_0xcc91('0x1f');var _0x4c92a6=_0x2f6292[_0xcc91('0x20')];var _0x3d21d4=_0x177d60?0x0:_0x58370e[_0xcc91('0x1e')];var _0x31ac6e=_0x177d60?_0x2f6292[_0xcc91('0x20')]:_0x58370e['offset']+_0x58370e[_0xcc91('0x21')];var _0x51b281;if(_0x31ac6e>=_0x4c92a6){_0x31ac6e=_0x4c92a6;_0x51b281=0xc8;}else{_0x51b281=0xce;}_0x374f31[_0xcc91('0x1c')](_0x51b281);return _0x374f31['set'](_0xcc91('0x22'),_0x3d21d4+'-'+_0x31ac6e+'/'+_0x4c92a6)['json'](_0x2f6292);}return null;};}function patchUpdates(_0x14e241){return function(_0x3c2ee6){try{jsonpatch[_0xcc91('0x23')](_0x3c2ee6,_0x14e241,!![]);}catch(_0x21f0f3){return BPromise[_0xcc91('0x24')](_0x21f0f3);}return _0x3c2ee6[_0xcc91('0x25')]();};}function saveUpdates(_0x305352,_0x166821){return function(_0x2cca4c){if(_0x2cca4c){return _0x2cca4c[_0xcc91('0x26')](_0x305352)[_0xcc91('0x27')](function(_0x1509cd){return _0x1509cd;});}return null;};}function removeEntity(_0x2f6e30,_0x52bc10){return function(_0x2fa9da){if(_0x2fa9da){return _0x2fa9da[_0xcc91('0x28')]()[_0xcc91('0x27')](function(){_0x2f6e30[_0xcc91('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cec66,_0x42e5a1){return function(_0x30906d){if(!_0x30906d){_0x1cec66[_0xcc91('0x29')](0x194);}return _0x30906d;};}function handleError(_0x6a0893,_0x20ae3d){_0x20ae3d=_0x20ae3d||0x1f4;return function(_0x3a72c0){logger[_0xcc91('0x2a')](_0x3a72c0[_0xcc91('0x2b')]);if(_0x3a72c0['name']){delete _0x3a72c0[_0xcc91('0x2c')];}_0x6a0893['status'](_0x20ae3d)['send'](_0x3a72c0);};}exports[_0xcc91('0x2d')]=function(_0x371f54,_0x2340cf){var _0x363260={},_0x19bf9f={},_0x4af8be={'count':0x0,'rows':[]};var _0x3379e4=_[_0xcc91('0x2e')](db['Migration']['rawAttributes'],function(_0x14821e){return{'name':_0x14821e['fieldName'],'type':_0x14821e[_0xcc91('0x2f')][_0xcc91('0x30')]};});_0x19bf9f['model']=_[_0xcc91('0x2e')](_0x3379e4,_0xcc91('0x2c'));_0x19bf9f[_0xcc91('0x31')]=_['keys'](_0x371f54[_0xcc91('0x31')]);_0x19bf9f[_0xcc91('0x32')]=_['intersection'](_0x19bf9f[_0xcc91('0x33')],_0x19bf9f[_0xcc91('0x31')]);_0x363260[_0xcc91('0x34')]=_[_0xcc91('0x35')](_0x19bf9f[_0xcc91('0x33')],qs[_0xcc91('0x36')](_0x371f54[_0xcc91('0x31')][_0xcc91('0x36')]));_0x363260[_0xcc91('0x34')]=_0x363260[_0xcc91('0x34')]['length']?_0x363260[_0xcc91('0x34')]:_0x19bf9f['model'];if(!_0x371f54[_0xcc91('0x31')][_0xcc91('0x37')]('nolimit')){_0x363260['limit']=qs[_0xcc91('0x21')](_0x371f54['query'][_0xcc91('0x21')]);_0x363260['offset']=qs[_0xcc91('0x1e')](_0x371f54[_0xcc91('0x31')][_0xcc91('0x1e')]);}_0x363260['order']=qs[_0xcc91('0x38')](_0x371f54[_0xcc91('0x31')][_0xcc91('0x38')]);_0x363260[_0xcc91('0x39')]=qs[_0xcc91('0x32')](_[_0xcc91('0x3a')](_0x371f54[_0xcc91('0x31')],_0x19bf9f[_0xcc91('0x32')]),_0x3379e4);if(_0x371f54[_0xcc91('0x31')][_0xcc91('0x3b')]){_0x363260[_0xcc91('0x39')]=_[_0xcc91('0x3c')](_0x363260[_0xcc91('0x39')],{'$or':_[_0xcc91('0x2e')](_0x3379e4,function(_0x4b60c9){if(_0x4b60c9[_0xcc91('0x2f')]!==_0xcc91('0x3d')){var _0x35fc5b={};_0x35fc5b[_0x4b60c9[_0xcc91('0x2c')]]={'$like':'%'+_0x371f54['query'][_0xcc91('0x3b')]+'%'};return _0x35fc5b;}})});}_0x363260=_[_0xcc91('0x3c')]({},_0x363260,_0x371f54[_0xcc91('0x3e')]);var _0x4a2c1f={'where':_0x363260[_0xcc91('0x39')]};return db[_0xcc91('0x3f')][_0xcc91('0x20')](_0x4a2c1f)[_0xcc91('0x27')](function(_0x507ccd){_0x4af8be['count']=_0x507ccd;if(_0x371f54[_0xcc91('0x31')]['includeAll']){_0x363260[_0xcc91('0x40')]=[{'all':!![]}];}return db[_0xcc91('0x3f')]['findAll'](_0x363260);})[_0xcc91('0x27')](function(_0x4a3ea5){_0x4af8be[_0xcc91('0x41')]=_0x4a3ea5;return _0x4af8be;})[_0xcc91('0x27')](respondWithFilteredResult(_0x2340cf,_0x363260))[_0xcc91('0x42')](handleError(_0x2340cf,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 64411b3..dcf5ce9 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 _0xbf36=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Migration','migrations','lodash','../../config/logger','api'];(function(_0x3bffa7,_0x398d51){var _0x102c03=function(_0x2189d1){while(--_0x2189d1){_0x3bffa7['push'](_0x3bffa7['shift']());}};_0x102c03(++_0x398d51);}(_0xbf36,0x1a1));var _0x6bf3=function(_0x7e20ec,_0x4c7946){_0x7e20ec=_0x7e20ec-0x0;var _0x45cf35=_0xbf36[_0x7e20ec];return _0x45cf35;};'use strict';var _=require(_0x6bf3('0x0'));var util=require('util');var logger=require(_0x6bf3('0x1'))(_0x6bf3('0x2'));var moment=require(_0x6bf3('0x3'));var BPromise=require(_0x6bf3('0x4'));var rp=require(_0x6bf3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bf3('0x6'));var config=require(_0x6bf3('0x7'));var attributes=require('./migration.attributes');module[_0x6bf3('0x8')]=function(_0x3b2e6b,_0x35f161){return _0x3b2e6b[_0x6bf3('0x9')](_0x6bf3('0xa'),attributes,{'tableName':_0x6bf3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e95=['exports','Migration','migrations','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes'];(function(_0x2ba262,_0x4f19fe){var _0x12aace=function(_0xe5d22){while(--_0xe5d22){_0x2ba262['push'](_0x2ba262['shift']());}};_0x12aace(++_0x4f19fe);}(_0x7e95,0x1f2));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x57e9('0x0'));var util=require(_0x57e9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x57e9('0x2'));var BPromise=require(_0x57e9('0x3'));var rp=require(_0x57e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57e9('0x5'));var config=require(_0x57e9('0x6'));var attributes=require(_0x57e9('0x7'));module[_0x57e9('0x8')]=function(_0x40604d,_0x46a0b0){return _0x40604d['define'](_0x57e9('0x9'),attributes,{'tableName':_0x57e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index a6ea278..e6cda98 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 _0x24e9=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x24e9,0x85));var _0x924e=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x24e9[_0x4cd21c];return _0x5d8e5e;};'use strict';var _=require(_0x924e('0x0'));var util=require('util');var moment=require(_0x924e('0x1'));var BPromise=require(_0x924e('0x2'));var rs=require(_0x924e('0x3'));var fs=require('fs');var Redis=require(_0x924e('0x4'));var db=require(_0x924e('0x5'))['db'];var utils=require(_0x924e('0x6'));var logger=require(_0x924e('0x7'))(_0x924e('0x8'));var config=require('../../config/environment');var jayson=require(_0x924e('0x9'));var client=jayson[_0x924e('0xa')][_0x924e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19370a,_0xdcafe0,_0x491000){return new BPromise(function(_0x4eeee8,_0x35c2a1){return client[_0x924e('0xc')](_0x19370a,_0x491000)[_0x924e('0xd')](function(_0x3b3ab5){logger['info'](_0x924e('0xe'),_0xdcafe0,_0x924e('0xf'));logger['debug'](_0x924e('0x10'),_0xdcafe0,'request\x20sent',JSON[_0x924e('0x11')](_0x3b3ab5));if(_0x3b3ab5[_0x924e('0x12')]){if(_0x3b3ab5[_0x924e('0x12')][_0x924e('0x13')]===0x1f4){logger[_0x924e('0x12')](_0x924e('0xe'),_0xdcafe0,_0x3b3ab5[_0x924e('0x12')][_0x924e('0x14')]);return _0x35c2a1(_0x3b3ab5['error'][_0x924e('0x14')]);}logger['error'](_0x924e('0xe'),_0xdcafe0,_0x3b3ab5[_0x924e('0x12')][_0x924e('0x14')]);return _0x4eeee8(_0x3b3ab5[_0x924e('0x12')][_0x924e('0x14')]);}else{logger[_0x924e('0x15')]('Migration,\x20%s,\x20%s',_0xdcafe0,'request\x20sent');_0x4eeee8(_0x3b3ab5[_0x924e('0x16')][_0x924e('0x14')]);}})['catch'](function(_0x285d77){logger['error']('Migration,\x20%s,\x20%s',_0xdcafe0,_0x285d77);_0x35c2a1(_0x285d77);});});} \ No newline at end of file +var _0x57f8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x47e2a3,_0x3fbb50){var _0x2d0bbd=function(_0x4fe1d3){while(--_0x4fe1d3){_0x47e2a3['push'](_0x47e2a3['shift']());}};_0x2d0bbd(++_0x3fbb50);}(_0x57f8,0x198));var _0x857f=function(_0x1e203a,_0x397111){_0x1e203a=_0x1e203a-0x0;var _0x2a5006=_0x57f8[_0x1e203a];return _0x2a5006;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('Migration,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('Migration,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e4579df..26e7a98 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 _0xee55=['index','/:id','show','create','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated'];(function(_0x1128bf,_0x44f52d){var _0xfe27c6=function(_0x3fe164){while(--_0x3fe164){_0x1128bf['push'](_0x1128bf['shift']());}};_0xfe27c6(++_0x44f52d);}(_0xee55,0x1a0));var _0x5ee5=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xee55[_0x4f5108];return _0x2d56ca;};'use strict';var multer=require(_0x5ee5('0x0'));var util=require('util');var path=require(_0x5ee5('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ee5('0x2'));var router=express['Router']();var fs_extra=require(_0x5ee5('0x3'));var auth=require(_0x5ee5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ee5('0x5'));var controller=require(_0x5ee5('0x6'));router[_0x5ee5('0x7')]('/',auth[_0x5ee5('0x8')](),controller[_0x5ee5('0x9')]);router[_0x5ee5('0x7')](_0x5ee5('0xa'),auth['isAuthenticated'](),controller[_0x5ee5('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5ee5('0xc')]);router['put']('/:id',auth[_0x5ee5('0x8')](),controller[_0x5ee5('0xd')]);router[_0x5ee5('0xe')](_0x5ee5('0xa'),auth['isAuthenticated'](),controller[_0x5ee5('0xf')]);module[_0x5ee5('0x10')]=router; \ No newline at end of file +var _0x046b=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0xcdfd00,_0x583d3c){var _0x44ae35=function(_0x183432){while(--_0x183432){_0xcdfd00['push'](_0xcdfd00['shift']());}};_0x44ae35(++_0x583d3c);}(_0x046b,0x1ba));var _0xb046=function(_0x34b018,_0x214f06){_0x34b018=_0x34b018-0x0;var _0x20989f=_0x046b[_0x34b018];return _0x20989f;};'use strict';var multer=require(_0xb046('0x0'));var util=require(_0xb046('0x1'));var path=require(_0xb046('0x2'));var timeout=require(_0xb046('0x3'));var express=require('express');var router=express[_0xb046('0x4')]();var fs_extra=require(_0xb046('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',auth[_0xb046('0xa')](),controller[_0xb046('0xb')]);router[_0xb046('0x9')](_0xb046('0xc'),auth[_0xb046('0xa')](),controller[_0xb046('0xd')]);router[_0xb046('0xe')]('/',auth[_0xb046('0xa')](),controller[_0xb046('0xf')]);router['put'](_0xb046('0xc'),auth[_0xb046('0xa')](),controller[_0xb046('0x10')]);router[_0xb046('0x11')](_0xb046('0xc'),auth['isAuthenticated'](),controller[_0xb046('0x12')]);module[_0xb046('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e21c93f..8d131d8 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 _0x0846=['ENUM','externip','stun','STRING','sequelize','exports'];(function(_0xb5eeda,_0x1a12ce){var _0x191d16=function(_0x2b2327){while(--_0x2b2327){_0xb5eeda['push'](_0xb5eeda['shift']());}};_0x191d16(++_0x1a12ce);}(_0x0846,0x1f0));var _0x6084=function(_0x59ab72,_0x51975f){_0x59ab72=_0x59ab72-0x0;var _0x2e96aa=_0x0846[_0x59ab72];return _0x2e96aa;};'use strict';var Sequelize=require(_0x6084('0x0'));module[_0x6084('0x1')]={'type':{'type':Sequelize[_0x6084('0x2')]('localnet',_0x6084('0x3'),_0x6084('0x4'),'turn')},'value':{'type':Sequelize[_0x6084('0x5')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6084('0x5')]}}; \ No newline at end of file +var _0xd56f=['exports','ENUM','externip','STRING','sequelize'];(function(_0x3ebcab,_0x482df2){var _0x4074d3=function(_0x43ec1a){while(--_0x43ec1a){_0x3ebcab['push'](_0x3ebcab['shift']());}};_0x4074d3(++_0x482df2);}(_0xd56f,0xea));var _0xfd56=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0xd56f[_0x42ebba];return _0x3fd2af;};'use strict';var Sequelize=require(_0xfd56('0x0'));module[_0xfd56('0x1')]={'type':{'type':Sequelize[_0xfd56('0x2')]('localnet',_0xfd56('0x3'),'stun','turn')},'value':{'type':Sequelize[_0xfd56('0x4')]},'username':{'type':Sequelize[_0xfd56('0x4')]},'password':{'type':Sequelize[_0xfd56('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 7824769..d204848 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 _0x1074=['error','code','message','result','catch','status','json','offset','limit','count','set','Content-Range','update','end','name','send','index','map','Network','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','includeAll','show','length','include','options','find','create','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','destroy','TURN','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1387f5,_0x42f810){var _0x34b815=function(_0x5dc0f3){while(--_0x5dc0f3){_0x1387f5['push'](_0x1387f5['shift']());}};_0x34b815(++_0x42f810);}(_0x1074,0xe5));var _0x4107=function(_0x3a3500,_0x37c562){_0x3a3500=_0x3a3500-0x0;var _0x84a50d=_0x1074[_0x3a3500];return _0x84a50d;};'use strict';var util=require('util');var path=require(_0x4107('0x0'));var ejs=require(_0x4107('0x1'));var fs=require('fs');var _=require(_0x4107('0x2'));var qs=require(_0x4107('0x3'));var logger=require(_0x4107('0x4'))(_0x4107('0x5'));var config=require(_0x4107('0x6'));var db=require(_0x4107('0x7'))['db'];var jayson=require(_0x4107('0x8'));var client=jayson[_0x4107('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30519e,_0x2f1b19,_0x38fb69,_0x4385f0){return new Promise(function(_0x30f554,_0x34c800){var _0xaf4d92=_0x4385f0||client;return _0xaf4d92['request'](_0x30519e,_0x38fb69)[_0x4107('0xa')](function(_0x211a6f){logger[_0x4107('0xb')](_0x4107('0xc'),_0x2f1b19,_0x4107('0xd'));logger[_0x4107('0xe')](_0x4107('0xf'),_0x2f1b19,'request\x20sent',JSON[_0x4107('0x10')](_0x211a6f));if(_0x211a6f[_0x4107('0x11')]){if(_0x211a6f[_0x4107('0x11')][_0x4107('0x12')]===0x1f4){logger[_0x4107('0x11')](_0x4107('0xc'),_0x2f1b19,_0x211a6f[_0x4107('0x11')][_0x4107('0x13')]);return _0x34c800(_0x211a6f['error']['message']);}logger[_0x4107('0x11')](_0x4107('0xc'),_0x2f1b19,_0x211a6f[_0x4107('0x11')][_0x4107('0x13')]);return _0x30f554(_0x211a6f[_0x4107('0x11')]['message']);}else{logger[_0x4107('0xb')](_0x4107('0xc'),_0x2f1b19,_0x4107('0xd'));_0x30f554(_0x211a6f[_0x4107('0x14')][_0x4107('0x13')]);}})[_0x4107('0x15')](function(_0x528d0d){logger[_0x4107('0x11')](_0x4107('0xc'),_0x2f1b19,_0x528d0d);_0x34c800(_0x528d0d);});});}function respondWithResult(_0x149a33,_0x350f06){_0x350f06=_0x350f06||0xc8;return function(_0x5bd952){if(_0x5bd952){return _0x149a33[_0x4107('0x16')](_0x350f06)[_0x4107('0x17')](_0x5bd952);}};}function respondWithFilteredResult(_0x494520,_0x3f9247){return function(_0x4d36f6){if(_0x4d36f6){var _0xdd420c=typeof _0x3f9247[_0x4107('0x18')]==='undefined'&&typeof _0x3f9247[_0x4107('0x19')]==='undefined';var _0x2dd98d=_0x4d36f6[_0x4107('0x1a')];var _0xfb41d1=_0xdd420c?0x0:_0x3f9247[_0x4107('0x18')];var _0x5bd8c2=_0xdd420c?_0x4d36f6[_0x4107('0x1a')]:_0x3f9247[_0x4107('0x18')]+_0x3f9247[_0x4107('0x19')];var _0xd89d0e;if(_0x5bd8c2>=_0x2dd98d){_0x5bd8c2=_0x2dd98d;_0xd89d0e=0xc8;}else{_0xd89d0e=0xce;}_0x494520[_0x4107('0x16')](_0xd89d0e);return _0x494520[_0x4107('0x1b')](_0x4107('0x1c'),_0xfb41d1+'-'+_0x5bd8c2+'/'+_0x2dd98d)[_0x4107('0x17')](_0x4d36f6);}return null;};}function saveUpdates(_0x58c96e){return function(_0xddb0c1){if(_0xddb0c1){return _0xddb0c1[_0x4107('0x1d')](_0x58c96e)[_0x4107('0xa')](function(_0x41815e){return _0x41815e;});}return null;};}function removeEntity(_0x5cb7b9){return function(_0x1c5290){if(_0x1c5290){return _0x1c5290['destroy']()[_0x4107('0xa')](function(){_0x5cb7b9[_0x4107('0x16')](0xcc)[_0x4107('0x1e')]();});}};}function handleEntityNotFound(_0x12afac){return function(_0x22e402){if(!_0x22e402){_0x12afac['sendStatus'](0x194);}return _0x22e402;};}function handleError(_0x38a9ba,_0x2b4298){_0x2b4298=_0x2b4298||0x1f4;return function(_0x5944a1){logger[_0x4107('0x11')](_0x5944a1['stack']);if(_0x5944a1[_0x4107('0x1f')]){delete _0x5944a1[_0x4107('0x1f')];}_0x38a9ba['status'](_0x2b4298)[_0x4107('0x20')](_0x5944a1);};}exports[_0x4107('0x21')]=function(_0x527b3a,_0x1c7a22){var _0x13ad83={},_0x3c0370={},_0x73b695={'count':0x0,'rows':[]};var _0x4bc505=_[_0x4107('0x22')](db[_0x4107('0x23')]['rawAttributes'],function(_0x9f1e6e){return{'name':_0x9f1e6e['fieldName'],'type':_0x9f1e6e[_0x4107('0x24')][_0x4107('0x25')]};});_0x3c0370['model']=_[_0x4107('0x22')](_0x4bc505,_0x4107('0x1f'));_0x3c0370[_0x4107('0x26')]=_[_0x4107('0x27')](_0x527b3a[_0x4107('0x26')]);_0x3c0370[_0x4107('0x28')]=_[_0x4107('0x29')](_0x3c0370[_0x4107('0x2a')],_0x3c0370[_0x4107('0x26')]);_0x13ad83[_0x4107('0x2b')]=_[_0x4107('0x29')](_0x3c0370[_0x4107('0x2a')],qs[_0x4107('0x2c')](_0x527b3a['query'][_0x4107('0x2c')]));_0x13ad83[_0x4107('0x2b')]=_0x13ad83[_0x4107('0x2b')]['length']?_0x13ad83['attributes']:_0x3c0370[_0x4107('0x2a')];if(!_0x527b3a['query']['hasOwnProperty'](_0x4107('0x2d'))){_0x13ad83['limit']=qs[_0x4107('0x19')](_0x527b3a['query']['limit']);_0x13ad83['offset']=qs['offset'](_0x527b3a[_0x4107('0x26')][_0x4107('0x18')]);}_0x13ad83[_0x4107('0x2e')]=qs['sort'](_0x527b3a['query'][_0x4107('0x2f')]);_0x13ad83[_0x4107('0x30')]=qs[_0x4107('0x28')](_['pick'](_0x527b3a[_0x4107('0x26')],_0x3c0370[_0x4107('0x28')]),_0x4bc505);if(_0x527b3a[_0x4107('0x26')][_0x4107('0x31')]){_0x13ad83[_0x4107('0x30')]=_[_0x4107('0x32')](_0x13ad83[_0x4107('0x30')],{'$or':_[_0x4107('0x22')](_0x4bc505,function(_0x3e2cc9){if(_0x3e2cc9[_0x4107('0x24')]!=='VIRTUAL'){var _0x4eacb2={};_0x4eacb2[_0x3e2cc9[_0x4107('0x1f')]]={'$like':'%'+_0x527b3a['query'][_0x4107('0x31')]+'%'};return _0x4eacb2;}})});}_0x13ad83=_['merge']({},_0x13ad83,_0x527b3a['options']);var _0x3364ba={'where':_0x13ad83[_0x4107('0x30')]};return db['Network']['count'](_0x3364ba)[_0x4107('0xa')](function(_0xa71765){_0x73b695['count']=_0xa71765;if(_0x527b3a[_0x4107('0x26')][_0x4107('0x33')]){_0x13ad83['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x13ad83);})['then'](function(_0x277ad0){_0x73b695['rows']=_0x277ad0;return _0x73b695;})[_0x4107('0xa')](respondWithFilteredResult(_0x1c7a22,_0x13ad83))[_0x4107('0x15')](handleError(_0x1c7a22,null));};exports[_0x4107('0x34')]=function(_0x59f292,_0x481c86){var _0xd0f2e0={'raw':!![],'where':{'id':_0x59f292['params']['id']}},_0xd576e8={};_0xd576e8[_0x4107('0x2a')]=_[_0x4107('0x27')](db[_0x4107('0x23')]['rawAttributes']);_0xd576e8[_0x4107('0x26')]=_['keys'](_0x59f292['query']);_0xd576e8['filters']=_[_0x4107('0x29')](_0xd576e8[_0x4107('0x2a')],_0xd576e8[_0x4107('0x26')]);_0xd0f2e0[_0x4107('0x2b')]=_['intersection'](_0xd576e8['model'],qs[_0x4107('0x2c')](_0x59f292[_0x4107('0x26')][_0x4107('0x2c')]));_0xd0f2e0[_0x4107('0x2b')]=_0xd0f2e0[_0x4107('0x2b')][_0x4107('0x35')]?_0xd0f2e0[_0x4107('0x2b')]:_0xd576e8[_0x4107('0x2a')];if(_0x59f292[_0x4107('0x26')][_0x4107('0x33')]){_0xd0f2e0[_0x4107('0x36')]=[{'all':!![]}];}_0xd0f2e0=_[_0x4107('0x32')]({},_0xd0f2e0,_0x59f292[_0x4107('0x37')]);return db[_0x4107('0x23')][_0x4107('0x38')](_0xd0f2e0)[_0x4107('0xa')](handleEntityNotFound(_0x481c86,null))[_0x4107('0xa')](respondWithResult(_0x481c86,null))[_0x4107('0x15')](handleError(_0x481c86,null));};exports[_0x4107('0x39')]=function(_0x30a4ba,_0x2d189f){var _0x39da86;return db[_0x4107('0x23')][_0x4107('0x39')](_0x30a4ba[_0x4107('0x3a')],{'raw':!![]})[_0x4107('0xa')](function(_0x1d8d25){_0x39da86=_0x1d8d25;return db[_0x4107('0x23')][_0x4107('0x3b')]({'where':{'type':_0x30a4ba['body'][_0x4107('0x24')]},'raw':!![]});})[_0x4107('0xa')](function(_0x9f5b56){if(_0x39da86[_0x4107('0x24')][_0x4107('0x3c')]()==_0x4107('0x3d')){var _0x5c8db7=fs[_0x4107('0x3e')](path[_0x4107('0x3f')](config[_0x4107('0x40')],_0x4107('0x41')),_0x4107('0x42'));var _0x5bd82f=ejs[_0x4107('0x43')](_0x5c8db7,{'networks':_0x9f5b56||[]});fs[_0x4107('0x44')](_0x4107('0x45'),_0x5bd82f);return respondWithRpcPromise(_0x4107('0x46'),_0x4107('0x39'),{'module':'res_stun_monitor.so'});}else if(_0x39da86['type'][_0x4107('0x3c')]()=='TURN'){var _0x1f253f=fs['readFileSync'](path[_0x4107('0x3f')](config[_0x4107('0x40')],_0x4107('0x47')),'utf8');var _0x466e49=ejs[_0x4107('0x43')](_0x1f253f,{'networks':_0x9f5b56||[]});fs['writeFileSync'](_0x4107('0x48'),_0x466e49);return respondWithRpcPromise('Reload',_0x4107('0x39'),{'module':_0x4107('0x49')});}else{var _0x2a551a=fs['readFileSync'](path[_0x4107('0x3f')](config[_0x4107('0x40')],_0x4107('0x4a')),'utf8');var _0x1fc4a7=ejs[_0x4107('0x43')](_0x2a551a,{'networks':_0x9f5b56||[]});fs['writeFileSync'](util[_0x4107('0x4b')](_0x4107('0x4c'),_0x30a4ba[_0x4107('0x3a')]['type'][_0x4107('0x4d')]()),_0x1fc4a7);return respondWithRpcPromise(_0x4107('0x46'),_0x4107('0x39'),{'module':_0x4107('0x4e')});}})[_0x4107('0xa')](function(){return _0x39da86;})[_0x4107('0xa')](respondWithResult(_0x2d189f,0xc9))['catch'](handleError(_0x2d189f,null));};exports[_0x4107('0x1d')]=function(_0x3463a2,_0x4016af){var _0xe3695d;return db[_0x4107('0x23')][_0x4107('0x38')]({'where':{'id':_0x3463a2[_0x4107('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4016af,null))[_0x4107('0xa')](saveUpdates(_0x3463a2[_0x4107('0x3a')],null))[_0x4107('0xa')](function(_0x278c2e){if(_0x278c2e){_0xe3695d=_0x278c2e;return db[_0x4107('0x23')][_0x4107('0x3b')]({'where':{'type':_0xe3695d[_0x4107('0x24')]},'raw':!![]});}return null;})[_0x4107('0xa')](function(_0x373ecc){if(_0xe3695d[_0x4107('0x24')][_0x4107('0x3c')]()==_0x4107('0x3d')){var _0x31c51f=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0x4107('0x42'));var _0xc4d634=ejs['render'](_0x31c51f,{'networks':_0x373ecc||[]});fs[_0x4107('0x44')](_0x4107('0x45'),_0xc4d634);return respondWithRpcPromise('Reload',_0x4107('0x1d'),{'module':_0x4107('0x49')});}else if(_0xe3695d[_0x4107('0x24')]['toUpperCase']()=='TURN'){var _0x1efdf5=fs[_0x4107('0x3e')](path[_0x4107('0x3f')](config[_0x4107('0x40')],_0x4107('0x47')),'utf8');var _0x26fc1f=ejs[_0x4107('0x43')](_0x1efdf5,{'networks':_0x373ecc||[]});fs[_0x4107('0x44')](_0x4107('0x48'),_0x26fc1f);return respondWithRpcPromise(_0x4107('0x46'),_0x4107('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x317dfd=fs[_0x4107('0x3e')](path['join'](config['root'],_0x4107('0x4a')),'utf8');var _0x1ca2fa=ejs['render'](_0x317dfd,{'networks':_0x373ecc||[]});fs[_0x4107('0x44')](util['format'](_0x4107('0x4c'),_0x3463a2['body'][_0x4107('0x24')][_0x4107('0x4d')]()),_0x1ca2fa);return respondWithRpcPromise('Reload',_0x4107('0x1d'),{'module':_0x4107('0x4e')});}})[_0x4107('0xa')](function(_0x3a210d){if(_0x3a210d){return _0xe3695d;}return null;})[_0x4107('0xa')](respondWithResult(_0x4016af,null))['catch'](handleError(_0x4016af,null));};exports[_0x4107('0x50')]=function(_0x302af9,_0x409090){var _0x502d33;return db[_0x4107('0x23')][_0x4107('0x38')]({'where':{'id':_0x302af9[_0x4107('0x4f')]['id']}})[_0x4107('0xa')](function(_0x108083){_0x502d33=_0x108083;return _0x108083;})[_0x4107('0xa')](handleEntityNotFound(_0x409090,null))[_0x4107('0xa')](removeEntity(_0x409090,null))[_0x4107('0xa')](function(){if(_0x502d33){return db[_0x4107('0x23')][_0x4107('0x3b')]({'where':{'type':_0x502d33[_0x4107('0x24')]},'raw':!![]});}})[_0x4107('0xa')](function(_0x464dc1){if(_0x502d33[_0x4107('0x24')][_0x4107('0x3c')]()==_0x4107('0x3d')){var _0x11ef79=fs[_0x4107('0x3e')](path[_0x4107('0x3f')](config[_0x4107('0x40')],_0x4107('0x41')),_0x4107('0x42'));var _0x34371b=ejs['render'](_0x11ef79,{'networks':_0x464dc1||[]});fs[_0x4107('0x44')](_0x4107('0x45'),_0x34371b);return respondWithRpcPromise(_0x4107('0x46'),_0x4107('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x502d33[_0x4107('0x24')]['toUpperCase']()==_0x4107('0x51')){var _0x5d21e2=fs[_0x4107('0x3e')](path[_0x4107('0x3f')](config[_0x4107('0x40')],_0x4107('0x47')),_0x4107('0x42'));var _0x189264=ejs[_0x4107('0x43')](_0x5d21e2,{'networks':_0x464dc1||[]});fs['writeFileSync'](_0x4107('0x48'),_0x189264);return respondWithRpcPromise('Reload',_0x4107('0x50'),{'module':_0x4107('0x49')});}else{var _0x308c41=fs['readFileSync'](path['join'](config[_0x4107('0x40')],'server/files/templates/network.ejs'),_0x4107('0x42'));var _0x850797=ejs['render'](_0x308c41,{'networks':_0x464dc1||[]});fs[_0x4107('0x44')](util[_0x4107('0x4b')](_0x4107('0x4c'),_0x502d33[_0x4107('0x24')]['toLowerCase']()),_0x850797);return respondWithRpcPromise('Reload','destroy',{'module':_0x4107('0x4e')});}})[_0x4107('0x15')](handleError(_0x409090,null));}; \ No newline at end of file +var _0x2a1a=['STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','Reload','TURN','render','res_stun_monitor.so','format','chan_sip.so','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','sendStatus','name','send','index','Network','type','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','merge','VIRTUAL','where','includeAll','include','findAll','show','params','rawAttributes','length','options','find','create','body','toUpperCase'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x2a1a,0x163));var _0xa2a1=function(_0x48132e,_0x3bbe71){_0x48132e=_0x48132e-0x0;var _0x354ca1=_0x2a1a[_0x48132e];return _0x354ca1;};'use strict';var util=require(_0xa2a1('0x0'));var path=require(_0xa2a1('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa2a1('0x2'));var qs=require(_0xa2a1('0x3'));var logger=require(_0xa2a1('0x4'))(_0xa2a1('0x5'));var config=require(_0xa2a1('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa2a1('0x7'));var client=jayson[_0xa2a1('0x8')][_0xa2a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37b0bb,_0x2a6b4d,_0x48661c,_0x2dbc55){return new Promise(function(_0x5e0336,_0x2923ae){var _0x599cb4=_0x2dbc55||client;return _0x599cb4[_0xa2a1('0xa')](_0x37b0bb,_0x48661c)[_0xa2a1('0xb')](function(_0x520f57){logger['info'](_0xa2a1('0xc'),_0x2a6b4d,_0xa2a1('0xd'));logger[_0xa2a1('0xe')](_0xa2a1('0xf'),_0x2a6b4d,_0xa2a1('0xd'),JSON[_0xa2a1('0x10')](_0x520f57));if(_0x520f57[_0xa2a1('0x11')]){if(_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x12')]===0x1f4){logger[_0xa2a1('0x11')](_0xa2a1('0xc'),_0x2a6b4d,_0x520f57['error'][_0xa2a1('0x13')]);return _0x2923ae(_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x13')]);}logger['error'](_0xa2a1('0xc'),_0x2a6b4d,_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x13')]);return _0x5e0336(_0x520f57[_0xa2a1('0x11')][_0xa2a1('0x13')]);}else{logger[_0xa2a1('0x14')](_0xa2a1('0xc'),_0x2a6b4d,_0xa2a1('0xd'));_0x5e0336(_0x520f57['result'][_0xa2a1('0x13')]);}})[_0xa2a1('0x15')](function(_0x314591){logger[_0xa2a1('0x11')](_0xa2a1('0xc'),_0x2a6b4d,_0x314591);_0x2923ae(_0x314591);});});}function respondWithResult(_0x1d7499,_0x55381a){_0x55381a=_0x55381a||0xc8;return function(_0x559ca1){if(_0x559ca1){return _0x1d7499[_0xa2a1('0x16')](_0x55381a)[_0xa2a1('0x17')](_0x559ca1);}};}function respondWithFilteredResult(_0x5bd874,_0x59bc0e){return function(_0xc3bdb5){if(_0xc3bdb5){var _0xbbe235=typeof _0x59bc0e[_0xa2a1('0x18')]==='undefined'&&typeof _0x59bc0e[_0xa2a1('0x19')]===_0xa2a1('0x1a');var _0x1001c3=_0xc3bdb5[_0xa2a1('0x1b')];var _0x325c1a=_0xbbe235?0x0:_0x59bc0e[_0xa2a1('0x18')];var _0x28f09f=_0xbbe235?_0xc3bdb5[_0xa2a1('0x1b')]:_0x59bc0e[_0xa2a1('0x18')]+_0x59bc0e[_0xa2a1('0x19')];var _0xd66d8;if(_0x28f09f>=_0x1001c3){_0x28f09f=_0x1001c3;_0xd66d8=0xc8;}else{_0xd66d8=0xce;}_0x5bd874[_0xa2a1('0x16')](_0xd66d8);return _0x5bd874[_0xa2a1('0x1c')](_0xa2a1('0x1d'),_0x325c1a+'-'+_0x28f09f+'/'+_0x1001c3)[_0xa2a1('0x17')](_0xc3bdb5);}return null;};}function saveUpdates(_0x914560){return function(_0x1aeb50){if(_0x1aeb50){return _0x1aeb50[_0xa2a1('0x1e')](_0x914560)[_0xa2a1('0xb')](function(_0x1121f4){return _0x1121f4;});}return null;};}function removeEntity(_0x20dee8){return function(_0x270a7a){if(_0x270a7a){return _0x270a7a[_0xa2a1('0x1f')]()['then'](function(){_0x20dee8[_0xa2a1('0x16')](0xcc)[_0xa2a1('0x20')]();});}};}function handleEntityNotFound(_0x372366){return function(_0x4f9468){if(!_0x4f9468){_0x372366[_0xa2a1('0x21')](0x194);}return _0x4f9468;};}function handleError(_0x449d08,_0x42ff08){_0x42ff08=_0x42ff08||0x1f4;return function(_0x5d26f6){logger[_0xa2a1('0x11')](_0x5d26f6['stack']);if(_0x5d26f6[_0xa2a1('0x22')]){delete _0x5d26f6[_0xa2a1('0x22')];}_0x449d08['status'](_0x42ff08)[_0xa2a1('0x23')](_0x5d26f6);};}exports[_0xa2a1('0x24')]=function(_0x454131,_0x2e019f){var _0x484489={},_0x365963={},_0x38189b={'count':0x0,'rows':[]};var _0x20bcaa=_['map'](db[_0xa2a1('0x25')]['rawAttributes'],function(_0x21020a){return{'name':_0x21020a['fieldName'],'type':_0x21020a[_0xa2a1('0x26')]['key']};});_0x365963[_0xa2a1('0x27')]=_[_0xa2a1('0x28')](_0x20bcaa,'name');_0x365963[_0xa2a1('0x29')]=_[_0xa2a1('0x2a')](_0x454131['query']);_0x365963['filters']=_['intersection'](_0x365963[_0xa2a1('0x27')],_0x365963[_0xa2a1('0x29')]);_0x484489[_0xa2a1('0x2b')]=_[_0xa2a1('0x2c')](_0x365963[_0xa2a1('0x27')],qs['fields'](_0x454131[_0xa2a1('0x29')][_0xa2a1('0x2d')]));_0x484489['attributes']=_0x484489[_0xa2a1('0x2b')]['length']?_0x484489[_0xa2a1('0x2b')]:_0x365963[_0xa2a1('0x27')];if(!_0x454131[_0xa2a1('0x29')][_0xa2a1('0x2e')]('nolimit')){_0x484489[_0xa2a1('0x19')]=qs[_0xa2a1('0x19')](_0x454131[_0xa2a1('0x29')][_0xa2a1('0x19')]);_0x484489[_0xa2a1('0x18')]=qs[_0xa2a1('0x18')](_0x454131['query'][_0xa2a1('0x18')]);}_0x484489[_0xa2a1('0x2f')]=qs[_0xa2a1('0x30')](_0x454131['query'][_0xa2a1('0x30')]);_0x484489['where']=qs[_0xa2a1('0x31')](_['pick'](_0x454131['query'],_0x365963[_0xa2a1('0x31')]),_0x20bcaa);if(_0x454131[_0xa2a1('0x29')]['filter']){_0x484489['where']=_[_0xa2a1('0x32')](_0x484489['where'],{'$or':_['map'](_0x20bcaa,function(_0x1f77df){if(_0x1f77df['type']!==_0xa2a1('0x33')){var _0x210882={};_0x210882[_0x1f77df[_0xa2a1('0x22')]]={'$like':'%'+_0x454131[_0xa2a1('0x29')]['filter']+'%'};return _0x210882;}})});}_0x484489=_[_0xa2a1('0x32')]({},_0x484489,_0x454131['options']);var _0x146e25={'where':_0x484489[_0xa2a1('0x34')]};return db[_0xa2a1('0x25')][_0xa2a1('0x1b')](_0x146e25)[_0xa2a1('0xb')](function(_0xd95b4c){_0x38189b['count']=_0xd95b4c;if(_0x454131['query'][_0xa2a1('0x35')]){_0x484489[_0xa2a1('0x36')]=[{'all':!![]}];}return db['Network'][_0xa2a1('0x37')](_0x484489);})[_0xa2a1('0xb')](function(_0x122dbc){_0x38189b['rows']=_0x122dbc;return _0x38189b;})['then'](respondWithFilteredResult(_0x2e019f,_0x484489))[_0xa2a1('0x15')](handleError(_0x2e019f,null));};exports[_0xa2a1('0x38')]=function(_0x4f8ff2,_0x54593c){var _0x621717={'raw':!![],'where':{'id':_0x4f8ff2[_0xa2a1('0x39')]['id']}},_0x497555={};_0x497555['model']=_[_0xa2a1('0x2a')](db['Network'][_0xa2a1('0x3a')]);_0x497555[_0xa2a1('0x29')]=_[_0xa2a1('0x2a')](_0x4f8ff2[_0xa2a1('0x29')]);_0x497555['filters']=_['intersection'](_0x497555[_0xa2a1('0x27')],_0x497555['query']);_0x621717[_0xa2a1('0x2b')]=_[_0xa2a1('0x2c')](_0x497555[_0xa2a1('0x27')],qs['fields'](_0x4f8ff2[_0xa2a1('0x29')][_0xa2a1('0x2d')]));_0x621717['attributes']=_0x621717[_0xa2a1('0x2b')][_0xa2a1('0x3b')]?_0x621717[_0xa2a1('0x2b')]:_0x497555[_0xa2a1('0x27')];if(_0x4f8ff2[_0xa2a1('0x29')][_0xa2a1('0x35')]){_0x621717[_0xa2a1('0x36')]=[{'all':!![]}];}_0x621717=_[_0xa2a1('0x32')]({},_0x621717,_0x4f8ff2[_0xa2a1('0x3c')]);return db[_0xa2a1('0x25')][_0xa2a1('0x3d')](_0x621717)['then'](handleEntityNotFound(_0x54593c,null))[_0xa2a1('0xb')](respondWithResult(_0x54593c,null))['catch'](handleError(_0x54593c,null));};exports[_0xa2a1('0x3e')]=function(_0x52b0f7,_0x34ed08){var _0x35ae91;return db['Network'][_0xa2a1('0x3e')](_0x52b0f7['body'],{'raw':!![]})[_0xa2a1('0xb')](function(_0x33c1e0){_0x35ae91=_0x33c1e0;return db[_0xa2a1('0x25')]['findAll']({'where':{'type':_0x52b0f7[_0xa2a1('0x3f')]['type']},'raw':!![]});})['then'](function(_0xc538d){if(_0x35ae91['type'][_0xa2a1('0x40')]()==_0xa2a1('0x41')){var _0x1d80b1=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x45')),_0xa2a1('0x46'));var _0xe19ac5=ejs['render'](_0x1d80b1,{'networks':_0xc538d||[]});fs[_0xa2a1('0x47')]('/etc/asterisk/stun_xcally.conf',_0xe19ac5);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x35ae91[_0xa2a1('0x26')]['toUpperCase']()==_0xa2a1('0x49')){var _0x255d5c=fs['readFileSync'](path['join'](config[_0xa2a1('0x44')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x3d3361=ejs[_0xa2a1('0x4a')](_0x255d5c,{'networks':_0xc538d||[]});fs[_0xa2a1('0x47')]('/etc/asterisk/turn_xcally.conf',_0x3d3361);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x3e'),{'module':_0xa2a1('0x4b')});}else{var _0x2f0dac=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],'server/files/templates/network.ejs'),_0xa2a1('0x46'));var _0x355962=ejs[_0xa2a1('0x4a')](_0x2f0dac,{'networks':_0xc538d||[]});fs[_0xa2a1('0x47')](util[_0xa2a1('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x52b0f7[_0xa2a1('0x3f')][_0xa2a1('0x26')]['toLowerCase']()),_0x355962);return respondWithRpcPromise(_0xa2a1('0x48'),'create',{'module':_0xa2a1('0x4d')});}})[_0xa2a1('0xb')](function(){return _0x35ae91;})['then'](respondWithResult(_0x34ed08,0xc9))[_0xa2a1('0x15')](handleError(_0x34ed08,null));};exports[_0xa2a1('0x1e')]=function(_0x62fc7c,_0x4dc932){var _0xf7bf09;return db[_0xa2a1('0x25')][_0xa2a1('0x3d')]({'where':{'id':_0x62fc7c[_0xa2a1('0x39')]['id']}})[_0xa2a1('0xb')](handleEntityNotFound(_0x4dc932,null))['then'](saveUpdates(_0x62fc7c[_0xa2a1('0x3f')],null))[_0xa2a1('0xb')](function(_0x140df2){if(_0x140df2){_0xf7bf09=_0x140df2;return db['Network'][_0xa2a1('0x37')]({'where':{'type':_0xf7bf09[_0xa2a1('0x26')]},'raw':!![]});}return null;})[_0xa2a1('0xb')](function(_0x8c089f){if(_0xf7bf09[_0xa2a1('0x26')][_0xa2a1('0x40')]()==_0xa2a1('0x41')){var _0x1266fb=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x45')),_0xa2a1('0x46'));var _0x28a7e4=ejs[_0xa2a1('0x4a')](_0x1266fb,{'networks':_0x8c089f||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x28a7e4);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x1e'),{'module':'res_stun_monitor.so'});}else if(_0xf7bf09['type'][_0xa2a1('0x40')]()==_0xa2a1('0x49')){var _0x26252b=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xa2a1('0x46'));var _0x504a43=ejs[_0xa2a1('0x4a')](_0x26252b,{'networks':_0x8c089f||[]});fs['writeFileSync'](_0xa2a1('0x4e'),_0x504a43);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x46dc5a=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x4f')),_0xa2a1('0x46'));var _0x3e1bf6=ejs[_0xa2a1('0x4a')](_0x46dc5a,{'networks':_0x8c089f||[]});fs['writeFileSync'](util[_0xa2a1('0x4c')](_0xa2a1('0x50'),_0x62fc7c[_0xa2a1('0x3f')][_0xa2a1('0x26')][_0xa2a1('0x51')]()),_0x3e1bf6);return respondWithRpcPromise(_0xa2a1('0x48'),'update',{'module':_0xa2a1('0x4d')});}})[_0xa2a1('0xb')](function(_0x1c4624){if(_0x1c4624){return _0xf7bf09;}return null;})[_0xa2a1('0xb')](respondWithResult(_0x4dc932,null))[_0xa2a1('0x15')](handleError(_0x4dc932,null));};exports[_0xa2a1('0x1f')]=function(_0x3d1bda,_0x4ae272){var _0x5e1e74;return db[_0xa2a1('0x25')][_0xa2a1('0x3d')]({'where':{'id':_0x3d1bda[_0xa2a1('0x39')]['id']}})[_0xa2a1('0xb')](function(_0x4a334c){_0x5e1e74=_0x4a334c;return _0x4a334c;})[_0xa2a1('0xb')](handleEntityNotFound(_0x4ae272,null))[_0xa2a1('0xb')](removeEntity(_0x4ae272,null))[_0xa2a1('0xb')](function(){if(_0x5e1e74){return db[_0xa2a1('0x25')]['findAll']({'where':{'type':_0x5e1e74[_0xa2a1('0x26')]},'raw':!![]});}})[_0xa2a1('0xb')](function(_0x37a8cf){if(_0x5e1e74[_0xa2a1('0x26')][_0xa2a1('0x40')]()==_0xa2a1('0x41')){var _0x5242d0=fs['readFileSync'](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x45')),_0xa2a1('0x46'));var _0x438972=ejs[_0xa2a1('0x4a')](_0x5242d0,{'networks':_0x37a8cf||[]});fs[_0xa2a1('0x47')](_0xa2a1('0x52'),_0x438972);return respondWithRpcPromise('Reload','destroy',{'module':_0xa2a1('0x4b')});}else if(_0x5e1e74[_0xa2a1('0x26')][_0xa2a1('0x40')]()==_0xa2a1('0x49')){var _0x3a7d1a=fs[_0xa2a1('0x42')](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x53')),_0xa2a1('0x46'));var _0x54f772=ejs[_0xa2a1('0x4a')](_0x3a7d1a,{'networks':_0x37a8cf||[]});fs[_0xa2a1('0x47')](_0xa2a1('0x4e'),_0x54f772);return respondWithRpcPromise('Reload',_0xa2a1('0x1f'),{'module':_0xa2a1('0x4b')});}else{var _0x26a119=fs['readFileSync'](path[_0xa2a1('0x43')](config[_0xa2a1('0x44')],_0xa2a1('0x4f')),_0xa2a1('0x46'));var _0x589e0c=ejs['render'](_0x26a119,{'networks':_0x37a8cf||[]});fs[_0xa2a1('0x47')](util['format'](_0xa2a1('0x50'),_0x5e1e74['type'][_0xa2a1('0x51')]()),_0x589e0c);return respondWithRpcPromise(_0xa2a1('0x48'),_0xa2a1('0x1f'),{'module':_0xa2a1('0x4d')});}})['catch'](handleError(_0x4ae272,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 88ed66a..ad61ac4 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 _0x6c76=['define','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x2a9600,_0x3e600c){var _0x38c696=function(_0x5d4bbd){while(--_0x5d4bbd){_0x2a9600['push'](_0x2a9600['shift']());}};_0x38c696(++_0x3e600c);}(_0x6c76,0x184));var _0x66c7=function(_0x5d0eca,_0x4b7289){_0x5d0eca=_0x5d0eca-0x0;var _0x435c80=_0x6c76[_0x5d0eca];return _0x435c80;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var moment=require(_0x66c7('0x3'));var BPromise=require(_0x66c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var attributes=require('./network.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x705f=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','../../config/logger','moment','bluebird'];(function(_0x33c84d,_0x507fe5){var _0x234bed=function(_0x5f2651){while(--_0x5f2651){_0x33c84d['push'](_0x33c84d['shift']());}};_0x234bed(++_0x507fe5);}(_0x705f,0x75));var _0xf705=function(_0x23266e,_0x3647e2){_0x23266e=_0x23266e-0x0;var _0x55c2b6=_0x705f[_0x23266e];return _0x55c2b6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf705('0x0'))('api');var moment=require(_0xf705('0x1'));var BPromise=require(_0xf705('0x2'));var rp=require(_0xf705('0x3'));var fs=require('fs');var path=require(_0xf705('0x4'));var rimraf=require(_0xf705('0x5'));var config=require(_0xf705('0x6'));var attributes=require(_0xf705('0x7'));module[_0xf705('0x8')]=function(_0x10214c,_0x991602){return _0x10214c[_0xf705('0x9')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index c9c2d3f..bc5450b 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa93464,_0x1b4df3){var _0x46861f=function(_0x4511b7){while(--_0x4511b7){_0xa93464['push'](_0xa93464['shift']());}};_0x46861f(++_0x1b4df3);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x8c906b,_0x26dd36){_0x8c906b=_0x8c906b-0x0;var _0x13118f=_0x7a54[_0x8c906b];return _0x13118f;};'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 bc1f6a6..70917a8 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 _0x7dd3=['get','isAuthenticated','index','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getAgents','post','create','addDisposition','addAnswer','notify','/:id/users','addAgents','send','put','/:id','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7dd3,0x82));var _0x37dd=function(_0x4fe416,_0x5a310a){_0x4fe416=_0x4fe416-0x0;var _0x252725=_0x7dd3[_0x4fe416];return _0x252725;};'use strict';var multer=require(_0x37dd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x37dd('0x1'));var express=require(_0x37dd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37dd('0x3'));var interaction=require(_0x37dd('0x4'));var config=require('../../config/environment');var controller=require(_0x37dd('0x5'));router[_0x37dd('0x6')]('/',auth[_0x37dd('0x7')](),controller[_0x37dd('0x8')]);router['get']('/describe',auth[_0x37dd('0x7')](),controller['describe']);router[_0x37dd('0x6')]('/:id',auth[_0x37dd('0x7')](),controller[_0x37dd('0x9')]);router[_0x37dd('0x6')]('/:id/dispositions',auth[_0x37dd('0x7')](),controller[_0x37dd('0xa')]);router[_0x37dd('0x6')](_0x37dd('0xb'),auth[_0x37dd('0x7')](),controller[_0x37dd('0xc')]);router[_0x37dd('0x6')](_0x37dd('0xd'),auth[_0x37dd('0x7')](),controller[_0x37dd('0xe')]);router[_0x37dd('0x6')]('/:id/interactions',auth[_0x37dd('0x7')](),controller['getInteractions']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x37dd('0xf')]);router[_0x37dd('0x10')]('/',auth[_0x37dd('0x7')](),controller[_0x37dd('0x11')]);router['post']('/:id/dispositions',auth[_0x37dd('0x7')](),controller[_0x37dd('0x12')]);router[_0x37dd('0x10')](_0x37dd('0xb'),auth[_0x37dd('0x7')](),controller[_0x37dd('0x13')]);router[_0x37dd('0x10')]('/:id/notify',controller[_0x37dd('0x14')]);router[_0x37dd('0x10')](_0x37dd('0xd'),auth['isAuthenticated'](),controller['addApplications']);router[_0x37dd('0x10')](_0x37dd('0x15'),auth[_0x37dd('0x7')](),controller[_0x37dd('0x16')]);router[_0x37dd('0x10')]('/:id/send',auth[_0x37dd('0x7')](),controller[_0x37dd('0x17')]);router[_0x37dd('0x18')](_0x37dd('0x19'),auth['isAuthenticated'](),controller[_0x37dd('0x1a')]);router[_0x37dd('0x1b')](_0x37dd('0x19'),auth[_0x37dd('0x7')](),controller[_0x37dd('0x1c')]);router[_0x37dd('0x1b')](_0x37dd('0x1d'),auth[_0x37dd('0x7')](),controller[_0x37dd('0x1e')]);router[_0x37dd('0x1b')](_0x37dd('0xb'),auth[_0x37dd('0x7')](),controller[_0x37dd('0x1f')]);router[_0x37dd('0x1b')](_0x37dd('0x15'),auth[_0x37dd('0x7')](),controller[_0x37dd('0x20')]);module[_0x37dd('0x21')]=router; \ No newline at end of file +var _0x86e4=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','show','/:id/canned_answers','getAnswers','/:id/interactions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions'];(function(_0x207e2a,_0x41653c){var _0x1cfb4e=function(_0x1402cb){while(--_0x1402cb){_0x207e2a['push'](_0x207e2a['shift']());}};_0x1cfb4e(++_0x41653c);}(_0x86e4,0x129));var _0x486e=function(_0x23884b,_0x50c307){_0x23884b=_0x23884b-0x0;var _0x28113b=_0x86e4[_0x23884b];return _0x28113b;};'use strict';var multer=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var path=require(_0x486e('0x2'));var timeout=require('connect-timeout');var express=require(_0x486e('0x3'));var router=express['Router']();var fs_extra=require(_0x486e('0x4'));var auth=require(_0x486e('0x5'));var interaction=require(_0x486e('0x6'));var config=require(_0x486e('0x7'));var controller=require(_0x486e('0x8'));router[_0x486e('0x9')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0xb')]);router[_0x486e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x486e('0xc')]);router[_0x486e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x486e('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x486e('0xe'),auth[_0x486e('0xa')](),controller[_0x486e('0xf')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x486e('0x9')](_0x486e('0x10'),auth[_0x486e('0xa')](),controller['getInteractions']);router[_0x486e('0x9')](_0x486e('0x11'),auth[_0x486e('0xa')](),controller[_0x486e('0x12')]);router[_0x486e('0x13')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0x14')]);router[_0x486e('0x13')](_0x486e('0x15'),auth['isAuthenticated'](),controller[_0x486e('0x16')]);router['post'](_0x486e('0xe'),auth[_0x486e('0xa')](),controller['addAnswer']);router['post'](_0x486e('0x17'),controller[_0x486e('0x18')]);router[_0x486e('0x13')](_0x486e('0x19'),auth[_0x486e('0xa')](),controller[_0x486e('0x1a')]);router[_0x486e('0x13')](_0x486e('0x11'),auth[_0x486e('0xa')](),controller[_0x486e('0x1b')]);router[_0x486e('0x13')](_0x486e('0x1c'),auth[_0x486e('0xa')](),controller[_0x486e('0x1d')]);router[_0x486e('0x1e')](_0x486e('0x1f'),auth['isAuthenticated'](),controller[_0x486e('0x20')]);router[_0x486e('0x21')](_0x486e('0x1f'),auth[_0x486e('0xa')](),controller[_0x486e('0x22')]);router[_0x486e('0x21')](_0x486e('0x15'),auth[_0x486e('0xa')](),controller[_0x486e('0x23')]);router['delete'](_0x486e('0xe'),auth[_0x486e('0xa')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x486e('0xa')](),controller['removeAgents']);module[_0x486e('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index f4c7591..99c7602 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 _0x3cd3=['sequelize','randomstring','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x33a313,_0x3227b4){var _0x909474=function(_0x1c27a8){while(--_0x1c27a8){_0x33a313['push'](_0x33a313['shift']());}};_0x909474(++_0x3227b4);}(_0x3cd3,0x1e0));var _0x33cd=function(_0x5ec34a,_0x48c085){_0x5ec34a=_0x5ec34a-0x0;var _0x52bbe2=_0x3cd3[_0x5ec34a];return _0x52bbe2;};'use strict';var Sequelize=require(_0x33cd('0x0'));var rs=require(_0x33cd('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x33cd('0x2')],'defaultValue':function(){return rs[_0x33cd('0x3')]();}},'replyUri':{'type':Sequelize[_0x33cd('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x33cd('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x33cd('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x33cd('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x33cd('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x33cd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x33cd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x33cd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x33cd('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x33cd('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x33cd('0x5')],'defaultValue':![],'comment':_0x33cd('0x8'),'set':function(_0x3a2bf4){if(!_0x3a2bf4)this[_0x33cd('0x9')](_0x33cd('0xa'),null);this[_0x33cd('0x9')](_0x33cd('0xb'),_0x3a2bf4);}}}; \ No newline at end of file +var _0x2a76=['sequelize','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0xece559,_0x114f74){var _0x28249b=function(_0x3b9c60){while(--_0x3b9c60){_0xece559['push'](_0xece559['shift']());}};_0x28249b(++_0x114f74);}(_0x2a76,0x134));var _0x62a7=function(_0x3d04db,_0x3f4a12){_0x3d04db=_0x3d04db-0x0;var _0x25e488=_0x2a76[_0x3d04db];return _0x25e488;};'use strict';var Sequelize=require(_0x62a7('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x62a7('0x1')],'unique':_0x62a7('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x62a7('0x1')],'defaultValue':function(){return rs[_0x62a7('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x62a7('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x62a7('0x4')],'defaultValue':function(){return _0x62a7('0x5');}},'notificationSound':{'type':Sequelize[_0x62a7('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x62a7('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x62a7('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x62a7('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x62a7('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x62a7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x62a7('0x6')],'defaultValue':![],'comment':_0x62a7('0x9'),'set':function(_0x34ce67){if(!_0x34ce67)this[_0x62a7('0xa')]('mandatoryDispositionPauseId',null);this[_0x62a7('0xa')]('mandatoryDisposition',_0x34ce67);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index bba3489..5759396 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 _0xf842=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','http','client','request','then','info','request\x20sent','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','status','end','json','offset','undefined','limit','count','set','save','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','findOne','pick','includeAll','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','ISOLATION_LEVELS','bulkCreate','finally','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','ListId','out','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf842,0x172));var _0x2f84=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0xf842[_0x30cd7e];return _0x462a02;};'use strict';var emlformat=require(_0x2f84('0x0'));var rimraf=require(_0x2f84('0x1'));var zipdir=require(_0x2f84('0x2'));var jsonpatch=require(_0x2f84('0x3'));var rp=require('request-promise');var moment=require(_0x2f84('0x4'));var BPromise=require(_0x2f84('0x5'));var Mustache=require(_0x2f84('0x6'));var util=require(_0x2f84('0x7'));var path=require(_0x2f84('0x8'));var sox=require('sox');var csv=require(_0x2f84('0x9'));var ejs=require(_0x2f84('0xa'));var fs=require('fs');var fs_extra=require(_0x2f84('0xb'));var _=require('lodash');var squel=require(_0x2f84('0xc'));var crypto=require(_0x2f84('0xd'));var jsforce=require(_0x2f84('0xe'));var deskjs=require(_0x2f84('0xf'));var toCsv=require(_0x2f84('0x9'));var querystring=require(_0x2f84('0x10'));var Papa=require(_0x2f84('0x11'));var Redis=require(_0x2f84('0x12'));var authService=require(_0x2f84('0x13'));var qs=require(_0x2f84('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f84('0x15'));var logger=require('../../config/logger')(_0x2f84('0x16'));var utils=require(_0x2f84('0x17'));var config=require(_0x2f84('0x18'));var licenseUtil=require(_0x2f84('0x19'));var db=require(_0x2f84('0x1a'))['db'];config[_0x2f84('0x1b')]=_[_0x2f84('0x1c')](config[_0x2f84('0x1b')],{'host':_0x2f84('0x1d'),'port':0x18eb});var socket=require(_0x2f84('0x1e'))(new Redis(config[_0x2f84('0x1b')]));require(_0x2f84('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x2f84('0x20')]({'port':0x232c});var client9002=jayson[_0x2f84('0x21')][_0x2f84('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x51e4af,_0x41848c,_0x31958b,_0x4cfe4){return new BPromise(function(_0x54e1f2,_0x3f0b36){var _0xbe3e4f=_0x4cfe4||client;return _0xbe3e4f[_0x2f84('0x22')](_0x51e4af,_0x31958b)[_0x2f84('0x23')](function(_0x59b952){logger[_0x2f84('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x41848c,_0x2f84('0x25'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x41848c,_0x2f84('0x25'),JSON[_0x2f84('0x26')](_0x59b952));if(_0x59b952[_0x2f84('0x27')]){if(_0x59b952[_0x2f84('0x27')][_0x2f84('0x28')]===0x1f4){logger[_0x2f84('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x41848c,_0x59b952['error'][_0x2f84('0x29')]);return _0x3f0b36(_0x59b952[_0x2f84('0x27')][_0x2f84('0x29')]);}logger[_0x2f84('0x27')](_0x2f84('0x2a'),_0x41848c,_0x59b952[_0x2f84('0x27')]['message']);return _0x54e1f2(_0x59b952[_0x2f84('0x27')]['message']);}else{logger[_0x2f84('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x41848c,_0x2f84('0x25'));_0x54e1f2(_0x59b952[_0x2f84('0x2b')][_0x2f84('0x29')]);}})['catch'](function(_0x16ec4a){logger[_0x2f84('0x27')](_0x2f84('0x2a'),_0x41848c,_0x16ec4a);_0x3f0b36(_0x16ec4a);});});}function respondWithStatusCode(_0x362ae8,_0x19a615){_0x19a615=_0x19a615||0xcc;return function(_0x3a04fa){if(_0x3a04fa){return _0x362ae8['sendStatus'](_0x19a615);}return _0x362ae8[_0x2f84('0x2c')](_0x19a615)[_0x2f84('0x2d')]();};}function respondWithResult(_0x11f113,_0x59a1c6){_0x59a1c6=_0x59a1c6||0xc8;return function(_0x58f479){if(_0x58f479){return _0x11f113[_0x2f84('0x2c')](_0x59a1c6)[_0x2f84('0x2e')](_0x58f479);}};}function respondWithFilteredResult(_0x5e104a,_0x3cadc2){return function(_0x1de657){if(_0x1de657){var _0x4e193d=typeof _0x3cadc2[_0x2f84('0x2f')]===_0x2f84('0x30')&&typeof _0x3cadc2[_0x2f84('0x31')]===_0x2f84('0x30');var _0x2260ed=_0x1de657[_0x2f84('0x32')];var _0x1e7e37=_0x4e193d?0x0:_0x3cadc2['offset'];var _0x2adfe0=_0x4e193d?_0x1de657[_0x2f84('0x32')]:_0x3cadc2[_0x2f84('0x2f')]+_0x3cadc2[_0x2f84('0x31')];var _0x3162c6;if(_0x2adfe0>=_0x2260ed){_0x2adfe0=_0x2260ed;_0x3162c6=0xc8;}else{_0x3162c6=0xce;}_0x5e104a['status'](_0x3162c6);return _0x5e104a[_0x2f84('0x33')]('Content-Range',_0x1e7e37+'-'+_0x2adfe0+'/'+_0x2260ed)[_0x2f84('0x2e')](_0x1de657);}return null;};}function patchUpdates(_0x5ee205){return function(_0x5a7cdb){try{jsonpatch['apply'](_0x5a7cdb,_0x5ee205,!![]);}catch(_0x343703){return BPromise['reject'](_0x343703);}return _0x5a7cdb[_0x2f84('0x34')]();};}function saveUpdates(_0x2b7f9b,_0x3aeb16){return function(_0x519187){if(_0x519187){return _0x519187['update'](_0x2b7f9b)[_0x2f84('0x23')](function(_0x5d5f0b){return _0x5d5f0b;});}return null;};}function removeEntity(_0x48b2cf,_0x3fd622){return function(_0x33dc1e){if(_0x33dc1e){return _0x33dc1e[_0x2f84('0x35')]()[_0x2f84('0x23')](function(){var _0x349a94=_0x33dc1e[_0x2f84('0x36')]({'plain':!![]});var _0x3f816b='OpenchannelAccounts';return db[_0x2f84('0x37')][_0x2f84('0x35')]({'where':{'type':_0x3f816b,'resourceId':_0x349a94['id']}})['then'](function(){return _0x33dc1e;});})[_0x2f84('0x23')](function(){_0x48b2cf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x238615,_0x53ba30){return function(_0x12271a){if(!_0x12271a){_0x238615[_0x2f84('0x38')](0x194);}return _0x12271a;};}function handleError(_0x910586,_0x4f51da){_0x4f51da=_0x4f51da||0x1f4;return function(_0x163c61){logger[_0x2f84('0x27')](_0x163c61[_0x2f84('0x39')]);if(_0x163c61[_0x2f84('0x3a')]){delete _0x163c61[_0x2f84('0x3a')];}_0x910586[_0x2f84('0x2c')](_0x4f51da)[_0x2f84('0x3b')](_0x163c61);};}exports[_0x2f84('0x3c')]=function(_0xafbe7e,_0x25962b){var _0x426caa={'include':[{'model':db[_0x2f84('0x3d')],'as':_0x2f84('0x3e')}]},_0x888319={},_0x52d606={'count':0x0,'rows':[]};var _0x4b27be=_['map'](db[_0x2f84('0x3f')][_0x2f84('0x40')],function(_0x1e4d82){return{'name':_0x1e4d82[_0x2f84('0x41')],'type':_0x1e4d82[_0x2f84('0x42')]['key']};});_0x888319[_0x2f84('0x43')]=_[_0x2f84('0x44')](_0x4b27be,_0x2f84('0x3a'));_0x888319['query']=_[_0x2f84('0x45')](_0xafbe7e[_0x2f84('0x46')]);_0x888319[_0x2f84('0x47')]=_[_0x2f84('0x48')](_0x888319['model'],_0x888319['query']);_0x426caa[_0x2f84('0x49')]=_[_0x2f84('0x48')](_0x888319['model'],qs[_0x2f84('0x4a')](_0xafbe7e[_0x2f84('0x46')]['fields']));_0x426caa['attributes']=_0x426caa[_0x2f84('0x49')]['length']?_0x426caa[_0x2f84('0x49')]:_0x888319[_0x2f84('0x43')];if(!_0xafbe7e[_0x2f84('0x46')][_0x2f84('0x4b')](_0x2f84('0x4c'))){_0x426caa[_0x2f84('0x31')]=qs[_0x2f84('0x31')](_0xafbe7e[_0x2f84('0x46')]['limit']);_0x426caa['offset']=qs[_0x2f84('0x2f')](_0xafbe7e[_0x2f84('0x46')][_0x2f84('0x2f')]);}_0x426caa[_0x2f84('0x4d')]=qs[_0x2f84('0x4e')](_0xafbe7e[_0x2f84('0x46')][_0x2f84('0x4e')]);_0x426caa[_0x2f84('0x4f')]=qs[_0x2f84('0x47')](_['pick'](_0xafbe7e[_0x2f84('0x46')],_0x888319[_0x2f84('0x47')]),_0x4b27be);if(_0xafbe7e[_0x2f84('0x46')][_0x2f84('0x50')]){_0x426caa[_0x2f84('0x4f')]=_['merge'](_0x426caa[_0x2f84('0x4f')],{'$or':_[_0x2f84('0x44')](_0x4b27be,function(_0x23afd9){if(_0x23afd9[_0x2f84('0x42')]!=='VIRTUAL'){var _0x2e29fe={};_0x2e29fe[_0x23afd9[_0x2f84('0x3a')]]={'$like':'%'+_0xafbe7e['query'][_0x2f84('0x50')]+'%'};return _0x2e29fe;}})});}_0x426caa=_[_0x2f84('0x51')]({},_0x426caa,_0xafbe7e[_0x2f84('0x52')]);var _0x4a1b67={'where':_0x426caa[_0x2f84('0x4f')]};return db[_0x2f84('0x3f')][_0x2f84('0x32')](_0x4a1b67)[_0x2f84('0x23')](function(_0x14d4a0){_0x52d606[_0x2f84('0x32')]=_0x14d4a0;if(_0xafbe7e[_0x2f84('0x46')]['includeAll']){_0x426caa[_0x2f84('0x53')]=[{'all':!![]}];}return db[_0x2f84('0x3f')][_0x2f84('0x54')](_0x426caa);})[_0x2f84('0x23')](function(_0x2cda71){_0x52d606[_0x2f84('0x55')]=_0x2cda71;return _0x52d606;})[_0x2f84('0x23')](respondWithFilteredResult(_0x25962b,_0x426caa))[_0x2f84('0x56')](handleError(_0x25962b,null));};exports[_0x2f84('0x57')]=function(_0x4a188c,_0x2a136c){var _0x1155ab={'raw':![],'where':{'id':_0x4a188c[_0x2f84('0x58')]['id']},'include':[{'model':db[_0x2f84('0x3d')],'as':_0x2f84('0x3e')}]},_0x4bb00b={};_0x4bb00b[_0x2f84('0x43')]=_[_0x2f84('0x45')](db[_0x2f84('0x3f')][_0x2f84('0x40')]);_0x4bb00b['query']=_['keys'](_0x4a188c['query']);_0x4bb00b[_0x2f84('0x47')]=_[_0x2f84('0x48')](_0x4bb00b[_0x2f84('0x43')],_0x4bb00b[_0x2f84('0x46')]);_0x1155ab['attributes']=_[_0x2f84('0x48')](_0x4bb00b[_0x2f84('0x43')],qs[_0x2f84('0x4a')](_0x4a188c[_0x2f84('0x46')][_0x2f84('0x4a')]));_0x1155ab[_0x2f84('0x49')]=_0x1155ab[_0x2f84('0x49')][_0x2f84('0x59')]?_0x1155ab[_0x2f84('0x49')]:_0x4bb00b[_0x2f84('0x43')];if(_0x4a188c[_0x2f84('0x46')]['includeAll']){_0x1155ab[_0x2f84('0x53')]=[{'all':!![]}];}_0x1155ab=_[_0x2f84('0x51')]({},_0x1155ab,_0x4a188c[_0x2f84('0x52')]);return db[_0x2f84('0x3f')][_0x2f84('0x5a')](_0x1155ab)[_0x2f84('0x23')](handleEntityNotFound(_0x2a136c,null))[_0x2f84('0x23')](respondWithResult(_0x2a136c,null))[_0x2f84('0x56')](handleError(_0x2a136c,null));};exports['create']=function(_0x4ec74c,_0x4df804){return db[_0x2f84('0x3f')][_0x2f84('0x5b')](_0x4ec74c['body'],{})[_0x2f84('0x23')](function(_0x5a8bdf){var _0xc7a1bc=_0x4ec74c[_0x2f84('0x5c')]['get']({'plain':!![]});if(!_0xc7a1bc)throw new Error(_0x2f84('0x5d'));if(_0xc7a1bc[_0x2f84('0x5e')]===_0x2f84('0x5c')){var _0x5c473a=_0x5a8bdf['get']({'plain':!![]});var _0x47f276=_0x2f84('0x5f');return db['UserProfileSection'][_0x2f84('0x5a')]({'where':{'name':_0x47f276,'userProfileId':_0xc7a1bc[_0x2f84('0x60')]},'raw':!![]})['then'](function(_0x275f4f){if(_0x275f4f&&_0x275f4f[_0x2f84('0x61')]===0x0){return db['UserProfileResource'][_0x2f84('0x5b')]({'name':_0x5c473a[_0x2f84('0x3a')],'resourceId':_0x5c473a['id'],'type':_0x275f4f[_0x2f84('0x3a')],'sectionId':_0x275f4f['id']},{})[_0x2f84('0x23')](function(){return _0x5a8bdf;});}else{return _0x5a8bdf;}})['catch'](function(_0x461eaf){logger[_0x2f84('0x27')](_0x2f84('0x62'),_0x461eaf);throw _0x461eaf;});}return _0x5a8bdf;})[_0x2f84('0x23')](respondWithResult(_0x4df804,0xc9))['catch'](handleError(_0x4df804,null));};exports[_0x2f84('0x63')]=function(_0xec2444,_0x5d5c17){if(_0xec2444[_0x2f84('0x64')]['id']){delete _0xec2444[_0x2f84('0x64')]['id'];}return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0xec2444[_0x2f84('0x58')]['id']},'include':[{'model':db[_0x2f84('0x3d')],'as':_0x2f84('0x3e')}]})[_0x2f84('0x23')](handleEntityNotFound(_0x5d5c17,null))[_0x2f84('0x23')](saveUpdates(_0xec2444[_0x2f84('0x64')],null))[_0x2f84('0x23')](respondWithResult(_0x5d5c17,null))[_0x2f84('0x56')](handleError(_0x5d5c17,null));};exports[_0x2f84('0x35')]=function(_0x441d67,_0x1d8f77){return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0x441d67['params']['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x1d8f77,null))[_0x2f84('0x23')](removeEntity(_0x1d8f77,null))[_0x2f84('0x56')](handleError(_0x1d8f77,null));};exports['describe']=function(_0x23a06e,_0x2b1202){return db['OpenchannelAccount'][_0x2f84('0x65')]()[_0x2f84('0x23')](respondWithResult(_0x2b1202,null))[_0x2f84('0x56')](handleError(_0x2b1202,null));};exports[_0x2f84('0x66')]=function(_0x1141cd,_0x24b7a3,_0x94e5da){if(_0x1141cd[_0x2f84('0x64')]['id']){delete _0x1141cd[_0x2f84('0x64')]['id'];}return db[_0x2f84('0x3f')]['find']({'where':{'id':_0x1141cd['params']['id']}})['then'](handleEntityNotFound(_0x24b7a3,null))['then'](function(_0x414ed4){if(_0x414ed4){_0x1141cd[_0x2f84('0x64')]['OpenchannelAccountId']=_0x414ed4['id'];return db[_0x2f84('0x67')][_0x2f84('0x5b')](_0x1141cd[_0x2f84('0x64')]);}})[_0x2f84('0x23')](respondWithResult(_0x24b7a3,null))[_0x2f84('0x56')](handleError(_0x24b7a3,null));};exports[_0x2f84('0x68')]=function(_0x256d6a,_0xcaa44c,_0xb52322){var _0x211c06={'raw':![],'where':{}};var _0x422964={};var _0x49e2c9={'count':0x0,'rows':[]};return db[_0x2f84('0x3f')][_0x2f84('0x69')]({'where':{'id':_0x256d6a[_0x2f84('0x58')]['id']}})['then'](handleEntityNotFound(_0xcaa44c,null))[_0x2f84('0x23')](function(_0x6eabea){if(_0x6eabea){_0x422964[_0x2f84('0x43')]=_[_0x2f84('0x45')](db[_0x2f84('0x67')][_0x2f84('0x40')]);_0x422964[_0x2f84('0x46')]=_[_0x2f84('0x45')](_0x256d6a[_0x2f84('0x46')]);_0x422964[_0x2f84('0x47')]=_['intersection'](_0x422964[_0x2f84('0x43')],_0x422964[_0x2f84('0x46')]);_0x211c06['attributes']=_['intersection'](_0x422964[_0x2f84('0x43')],qs[_0x2f84('0x4a')](_0x256d6a[_0x2f84('0x46')][_0x2f84('0x4a')]));_0x211c06[_0x2f84('0x49')]=_0x211c06['attributes'][_0x2f84('0x59')]?_0x211c06[_0x2f84('0x49')]:_0x422964[_0x2f84('0x43')];if(!_0x256d6a['query']['hasOwnProperty'](_0x2f84('0x4c'))){_0x211c06[_0x2f84('0x31')]=qs[_0x2f84('0x31')](_0x256d6a[_0x2f84('0x46')][_0x2f84('0x31')]);_0x211c06[_0x2f84('0x2f')]=qs[_0x2f84('0x2f')](_0x256d6a[_0x2f84('0x46')][_0x2f84('0x2f')]);}_0x211c06[_0x2f84('0x4d')]=qs[_0x2f84('0x4e')](_0x256d6a[_0x2f84('0x46')][_0x2f84('0x4e')]);_0x211c06['where']=qs[_0x2f84('0x47')](_[_0x2f84('0x6a')](_0x256d6a['query'],_0x422964['filters']));_0x211c06[_0x2f84('0x4f')]['OpenchannelAccountId']=_0x6eabea['id'];if(_0x256d6a['query']['filter']){_0x211c06[_0x2f84('0x4f')]=_[_0x2f84('0x51')](_0x211c06[_0x2f84('0x4f')],{'$or':_[_0x2f84('0x44')](_0x211c06[_0x2f84('0x49')],function(_0x4706df){var _0xecd192={};_0xecd192[_0x4706df]={'$like':'%'+_0x256d6a[_0x2f84('0x46')]['filter']+'%'};return _0xecd192;})});}_0x211c06=_[_0x2f84('0x51')]({},_0x211c06,_0x256d6a['options']);return db[_0x2f84('0x67')][_0x2f84('0x32')]({'where':_0x211c06['where']})[_0x2f84('0x23')](function(_0x1f3d38){_0x49e2c9[_0x2f84('0x32')]=_0x1f3d38;if(_0x256d6a[_0x2f84('0x46')][_0x2f84('0x6b')]){_0x211c06['include']=[{'all':!![]}];}return db[_0x2f84('0x67')][_0x2f84('0x54')](_0x211c06);})[_0x2f84('0x23')](function(_0x57f4c4){_0x49e2c9[_0x2f84('0x55')]=_0x57f4c4;return _0x49e2c9;});}})[_0x2f84('0x23')](respondWithFilteredResult(_0xcaa44c,_0x211c06))[_0x2f84('0x56')](handleError(_0xcaa44c,null));};exports['removeDispositions']=function(_0x373c8c,_0x3d4236,_0x41c96e){return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0x373c8c[_0x2f84('0x58')]['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x3d4236,null))[_0x2f84('0x23')](function(_0x14f95c){if(_0x14f95c){return _0x14f95c[_0x2f84('0x6c')](_0x373c8c['query'][_0x2f84('0x6d')]);}})[_0x2f84('0x23')](respondWithStatusCode(_0x3d4236,null))['catch'](handleError(_0x3d4236,null));};exports[_0x2f84('0x6e')]=function(_0x259f39,_0x54ece7,_0x3e5700){if(_0x259f39[_0x2f84('0x64')]['id']){delete _0x259f39[_0x2f84('0x64')]['id'];}return db[_0x2f84('0x3f')]['find']({'where':{'id':_0x259f39['params']['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x54ece7,null))[_0x2f84('0x23')](function(_0x4308e4){if(_0x4308e4){_0x259f39[_0x2f84('0x64')][_0x2f84('0x6f')]=_0x4308e4['id'];return db[_0x2f84('0x70')][_0x2f84('0x5b')](_0x259f39[_0x2f84('0x64')]);}})[_0x2f84('0x23')](respondWithResult(_0x54ece7,null))[_0x2f84('0x56')](handleError(_0x54ece7,null));};exports[_0x2f84('0x71')]=function(_0x3bce00,_0x5d9d72,_0x483560){var _0x57d95c={'raw':![],'where':{}};var _0x894f1={};var _0x2f5995={'count':0x0,'rows':[]};return db[_0x2f84('0x3f')][_0x2f84('0x69')]({'where':{'id':_0x3bce00['params']['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x5d9d72,null))[_0x2f84('0x23')](function(_0x2b9d36){if(_0x2b9d36){_0x894f1[_0x2f84('0x43')]=_['keys'](db[_0x2f84('0x70')][_0x2f84('0x40')]);_0x894f1[_0x2f84('0x46')]=_[_0x2f84('0x45')](_0x3bce00[_0x2f84('0x46')]);_0x894f1[_0x2f84('0x47')]=_['intersection'](_0x894f1[_0x2f84('0x43')],_0x894f1[_0x2f84('0x46')]);_0x57d95c[_0x2f84('0x49')]=_[_0x2f84('0x48')](_0x894f1[_0x2f84('0x43')],qs[_0x2f84('0x4a')](_0x3bce00[_0x2f84('0x46')][_0x2f84('0x4a')]));_0x57d95c['attributes']=_0x57d95c[_0x2f84('0x49')]['length']?_0x57d95c[_0x2f84('0x49')]:_0x894f1[_0x2f84('0x43')];if(!_0x3bce00[_0x2f84('0x46')][_0x2f84('0x4b')](_0x2f84('0x4c'))){_0x57d95c['limit']=qs[_0x2f84('0x31')](_0x3bce00[_0x2f84('0x46')][_0x2f84('0x31')]);_0x57d95c['offset']=qs[_0x2f84('0x2f')](_0x3bce00[_0x2f84('0x46')][_0x2f84('0x2f')]);}_0x57d95c[_0x2f84('0x4d')]=qs['sort'](_0x3bce00[_0x2f84('0x46')]['sort']);_0x57d95c[_0x2f84('0x4f')]=qs[_0x2f84('0x47')](_[_0x2f84('0x6a')](_0x3bce00[_0x2f84('0x46')],_0x894f1['filters']));_0x57d95c[_0x2f84('0x4f')][_0x2f84('0x6f')]=_0x2b9d36['id'];if(_0x3bce00['query']['filter']){_0x57d95c[_0x2f84('0x4f')]=_[_0x2f84('0x51')](_0x57d95c[_0x2f84('0x4f')],{'$or':_[_0x2f84('0x44')](_0x57d95c[_0x2f84('0x49')],function(_0x1f7e1b){var _0x7f3611={};_0x7f3611[_0x1f7e1b]={'$like':'%'+_0x3bce00[_0x2f84('0x46')]['filter']+'%'};return _0x7f3611;})});}_0x57d95c=_['merge']({},_0x57d95c,_0x3bce00['options']);return db[_0x2f84('0x70')][_0x2f84('0x32')]({'where':_0x57d95c[_0x2f84('0x4f')]})[_0x2f84('0x23')](function(_0xdde948){_0x2f5995[_0x2f84('0x32')]=_0xdde948;if(_0x3bce00[_0x2f84('0x46')][_0x2f84('0x6b')]){_0x57d95c['include']=[{'all':!![]}];}return db[_0x2f84('0x70')][_0x2f84('0x54')](_0x57d95c);})[_0x2f84('0x23')](function(_0xddd56c){_0x2f5995[_0x2f84('0x55')]=_0xddd56c;return _0x2f5995;});}})[_0x2f84('0x23')](respondWithFilteredResult(_0x5d9d72,_0x57d95c))['catch'](handleError(_0x5d9d72,null));};exports['removeAnswers']=function(_0x1c9987,_0xcfdc63,_0x46d776){return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0x1c9987[_0x2f84('0x58')]['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0xcfdc63,null))[_0x2f84('0x23')](function(_0x2c968c){if(_0x2c968c){return _0x2c968c[_0x2f84('0x72')](_0x1c9987[_0x2f84('0x46')][_0x2f84('0x6d')]);}})[_0x2f84('0x23')](respondWithStatusCode(_0xcfdc63,null))[_0x2f84('0x56')](handleError(_0xcfdc63,null));};exports[_0x2f84('0x73')]=function(_0x1f00d8,_0x4ab15e,_0x44693a){var _0x52dc4d={'body':_0x1f00d8[_0x2f84('0x64')],'channel':_0x2f84('0x74')};var _0x1403de=[];var _0x2d9725=[];var _0x1dcc20={};var _0x3a87ae=![];return db[_0x2f84('0x75')][_0x2f84('0x65')]()[_0x2f84('0x23')](function(_0x5cdc11){if(!_0x5cdc11){throw new db[(_0x2f84('0x76'))][(_0x2f84('0x77'))](_0x2f84('0x78'));}_0x1403de=_[_0x2f84('0x79')](_['keys'](_0x5cdc11),['createdAt',_0x2f84('0x7a')]);_0x2d9725=_[_0x2f84('0x79')](_['keys'](_0x5cdc11),[_0x2f84('0x7b'),_0x2f84('0x7a'),_0x2f84('0x7c'),'ListId']);if(_0x1f00d8['body']['id']){delete _0x1f00d8[_0x2f84('0x64')]['id'];}if(_[_0x2f84('0x7d')](_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x7e')])){throw new db[(_0x2f84('0x76'))][(_0x2f84('0x77'))](_0x2f84('0x7f'));}if(_[_0x2f84('0x7d')](_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x64')])||_0x1f00d8['body']['body']===''){throw new db[(_0x2f84('0x76'))]['ValidationError'](_0x2f84('0x80'));}if(_['isNil'](_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x81')])){throw new db[(_0x2f84('0x76'))][(_0x2f84('0x77'))](_0x2f84('0x82')+_0x2d9725);}if(!_[_0x2f84('0x83')](_0x2d9725,_0x1f00d8[_0x2f84('0x64')]['mapKey'])){throw new db[(_0x2f84('0x76'))][(_0x2f84('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d9725);}_0x1dcc20[_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x81')]]=_0x1f00d8[_0x2f84('0x64')]['from'];})[_0x2f84('0x23')](function(){return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0x1f00d8[_0x2f84('0x58')]['id']},'include':[{'model':db[_0x2f84('0x84')],'as':_0x2f84('0x85'),'include':[{'model':db[_0x2f84('0x75')],'as':_0x2f84('0x86'),'where':_0x1dcc20,'limit':0x1,'order':[[_0x2f84('0x7a'),_0x2f84('0x87')]]}]},{'model':db[_0x2f84('0x88')],'as':'Applications'}]});})[_0x2f84('0x23')](handleEntityNotFound(_0x4ab15e,null))[_0x2f84('0x23')](function(_0x344e6a){if(_0x344e6a&&_0x344e6a['List']){_0x52dc4d[_0x2f84('0x89')]=_0x344e6a;_0x52dc4d[_0x2f84('0x8a')]=_0x344e6a[_0x2f84('0x8b')];_0x52dc4d['list']=_0x344e6a[_0x2f84('0x85')];_0x52dc4d[_0x2f84('0x8a')]=_[_0x2f84('0x8c')](_0x52dc4d[_0x2f84('0x8a')],[_0x2f84('0x8d')],[_0x2f84('0x8e')]);if(_0x52dc4d[_0x2f84('0x89')][_0x2f84('0x8b')]){delete _0x52dc4d['account'][_0x2f84('0x8b')];}if(_0x52dc4d[_0x2f84('0x89')][_0x2f84('0x85')]&&_0x52dc4d[_0x2f84('0x89')][_0x2f84('0x85')][_0x2f84('0x86')][_0x2f84('0x59')]){return _0x52dc4d[_0x2f84('0x89')]['List'][_0x2f84('0x86')][0x0];}var _0x4e609b=_[_0x2f84('0x1c')](_0x1f00d8['body'],{'firstName':_0x1f00d8[_0x2f84('0x64')]['from'],'ListId':_0x344e6a['ListId']});_0x4e609b[_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x81')]]=_0x1f00d8[_0x2f84('0x64')]['from'];return db[_0x2f84('0x75')][_0x2f84('0x5b')](_0x4e609b,{'fields':_0x1403de,'raw':!![]});}})[_0x2f84('0x23')](handleEntityNotFound(_0x4ab15e,null))[_0x2f84('0x23')](function(_0x3a4606){_0x52dc4d['contact']=_0x3a4606;if(_0x3a4606){var _0x1671d7={'ContactId':_0x3a4606['id'],'OpenchannelAccountId':_0x1f00d8[_0x2f84('0x58')]['id'],'from':(_0x3a4606[_0x2f84('0x8f')]||'')+'\x20'+(_0x3a4606[_0x2f84('0x90')]||'')};var _0x56a00d={'OpenchannelAccountId':_0x1f00d8[_0x2f84('0x58')]['id'],'closed':![]};if(_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x91')]){_0x56a00d[_0x2f84('0x91')]=_0x1f00d8['body'][_0x2f84('0x91')];return db[_0x2f84('0x92')][_0x2f84('0x5a')]({'where':_0x56a00d})[_0x2f84('0x23')](function(_0x4d9fd1){if(_0x4d9fd1){return[_0x4d9fd1,![]];}_0x1671d7[_0x2f84('0x91')]=_0x1f00d8[_0x2f84('0x64')]['threadId'];_0x1671d7['externalUrl']=_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x93')];return db['OpenchannelInteraction']['create'](_0x1671d7)[_0x2f84('0x23')](function(_0x5924fd){return[_0x5924fd,!![]];});});}else{_0x56a00d['threadId']=null;}_0x56a00d[_0x2f84('0x94')]=_0x3a4606['id'];return db[_0x2f84('0x92')][_0x2f84('0x5a')]({'where':_0x56a00d})[_0x2f84('0x23')](function(_0x19bb6c){if(_0x19bb6c){return[_0x19bb6c,![]];}return db[_0x2f84('0x92')]['create'](_0x1671d7)['then'](function(_0x434e5d){return[_0x434e5d,!![]];});});}})['spread'](function(_0x3a12bd,_0x1e0cb1){if(_0x3a12bd){_0x3a87ae=_0x1e0cb1;if(!_0x1e0cb1){var _0x4deb1f={'from':(_0x52dc4d[_0x2f84('0x95')][_0x2f84('0x8f')]||'')+'\x20'+(_0x52dc4d[_0x2f84('0x95')]['lastName']||'')};if(_0x1f00d8['body'][_0x2f84('0x91')]&&_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x96')]&&_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x91')]!=_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x96')]){_0x4deb1f[_0x2f84('0x91')]=_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x96')];}return _0x3a12bd[_0x2f84('0x63')](_0x4deb1f);}else{return _0x3a12bd;}}})['then'](function(_0x2f578b){_0x52dc4d[_0x2f84('0x97')]=_0x2f578b[_0x2f84('0x36')]({'plain':!![]});_0x52dc4d[_0x2f84('0x97')][_0x2f84('0x98')]=_0x3a87ae;if(_0x52dc4d[_0x2f84('0x97')][_0x2f84('0x98')]){if(_0x52dc4d[_0x2f84('0x89')][_0x2f84('0x99')]){_0x52dc4d['applications']['push']({'id':0x0,'priority':_0x52dc4d[_0x2f84('0x8a')][_0x2f84('0x59')]+0x1,'app':_0x2f84('0x9a'),'appdata':_0x2f84('0x9b'),'interval':_0x2f84('0x9c')});}}return db[_0x2f84('0x9d')][_0x2f84('0x5b')]({'body':_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x64')],'OpenchannelAccountId':_0x1f00d8[_0x2f84('0x58')]['id'],'OpenchannelInteractionId':_0x2f578b['id'],'direction':'in','ContactId':_0x52dc4d[_0x2f84('0x95')]['id'],'AttachmentId':_0x1f00d8[_0x2f84('0x64')][_0x2f84('0x9e')]});})['then'](function(_0x2a30d6){_0x52dc4d[_0x2f84('0x29')]=_0x2a30d6;if(_0x52dc4d['interaction'][_0x2f84('0x9f')]){return db[_0x2f84('0xa0')][_0x2f84('0x5a')]({'attributes':['id',_0x2f84('0x3a')],'where':{'id':_0x52dc4d[_0x2f84('0x97')]['UserId']}})[_0x2f84('0x23')](function(_0x342690){if(_0x342690){_0x52dc4d[_0x2f84('0x8a')][_0x2f84('0xa1')]({'id':0x0,'priority':0x0,'app':_0x2f84('0xa2'),'appdata':_0x342690['name']+','+(_0x52dc4d[_0x2f84('0x89')]['waitForTheAssignedAgent']||0xa),'interval':_0x2f84('0x9c')});_0x52dc4d[_0x2f84('0xa3')]=![];}return respondWithRpcPromise('Start',_0x2f84('0xa4'),_0x52dc4d);});}return respondWithRpcPromise(_0x2f84('0xa5'),_0x2f84('0xa4'),_0x52dc4d);})['then'](function(_0x4169bc){respondWithRpcPromise('EventManager',_0x2f84('0xa6'),{'event':_0x2f84('0x73'),'message':_0x4169bc},client9002);return _0x4169bc;})['then'](respondWithResult(_0x4ab15e,null))[_0x2f84('0x56')](handleError(_0x4ab15e,null));};exports[_0x2f84('0xa7')]=function(_0xb72f0,_0x3c748c){var _0x492e51=_0xb72f0[_0x2f84('0x58')]['id'];var _0x37db11=_0xb72f0[_0x2f84('0x64')];var _0x45f67a=0xc8;var _0x22489b=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x2f84('0xa8')]['Transaction'][_0x2f84('0xa9')]['READ_COMMITTED']},function(_0x36e31f){return db['OpenchannelAccount'][_0x2f84('0x69')]({'where':{'id':_0x492e51},'transaction':_0x36e31f})['then'](function(_0x28aac1){if(_0x28aac1){return db[_0x2f84('0x88')][_0x2f84('0x35')]({'where':{'OpenchannelAccountId':_0x492e51},'transaction':_0x36e31f})[_0x2f84('0x23')](function(){var _0x1c664a=_[_0x2f84('0x44')](_0x37db11,function(_0x1795e5){_0x1795e5['OpenchannelAccountId']=_0x492e51;return _0x1795e5;});return db[_0x2f84('0x88')][_0x2f84('0xaa')](_0x1c664a,{'transaction':_0x36e31f});});}else{_0x45f67a=0x194;_0x22489b=[];}});})[_0x2f84('0x23')](function(){if(_0x45f67a!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x492e51},'order':'priority'})[_0x2f84('0x23')](function(_0xa069b2){_0x22489b=_0xa069b2;});}})[_0x2f84('0x56')](function(_0x129ff8){_0x45f67a=0x1f4;logger[_0x2f84('0x27')](_0x129ff8['stack']);if(_0x129ff8[_0x2f84('0x3a')]){delete _0x129ff8[_0x2f84('0x3a')];}_0x22489b=_0x129ff8;})[_0x2f84('0xab')](function(){if(_0x22489b===null){_0x3c748c[_0x2f84('0x38')](_0x45f67a);}else{if(_0x45f67a===0x1f4){_0x3c748c[_0x2f84('0x2c')](_0x45f67a)['send'](_0x22489b);}else{_0x3c748c['status'](_0x45f67a)['json'](_0x22489b);}}});};exports[_0x2f84('0xac')]=function(_0x56f38f,_0x3374a1,_0x35e68e){var _0x1f16ec={};var _0x9e0089={};var _0x1dc536;var _0xd8ca61;return db[_0x2f84('0x3f')][_0x2f84('0x69')]({'where':{'id':_0x56f38f[_0x2f84('0x58')]['id']}})['then'](handleEntityNotFound(_0x3374a1,null))[_0x2f84('0x23')](function(_0x472313){if(_0x472313){_0x1dc536=_0x472313;_0x9e0089['model']=_[_0x2f84('0x45')](db[_0x2f84('0x88')][_0x2f84('0x40')]);_0x9e0089[_0x2f84('0x46')]=_[_0x2f84('0x45')](_0x56f38f[_0x2f84('0x46')]);_0x9e0089[_0x2f84('0x47')]=_[_0x2f84('0x48')](_0x9e0089[_0x2f84('0x43')],_0x9e0089[_0x2f84('0x46')]);_0x1f16ec[_0x2f84('0x49')]=_[_0x2f84('0x48')](_0x9e0089[_0x2f84('0x43')],qs['fields'](_0x56f38f[_0x2f84('0x46')][_0x2f84('0x4a')]));_0x1f16ec[_0x2f84('0x49')]=_0x1f16ec['attributes'][_0x2f84('0x59')]?_0x1f16ec[_0x2f84('0x49')]:_0x9e0089[_0x2f84('0x43')];_0x1f16ec[_0x2f84('0x4d')]=qs[_0x2f84('0x4e')](_0x56f38f[_0x2f84('0x46')][_0x2f84('0x4e')]);_0x1f16ec[_0x2f84('0x4f')]=qs[_0x2f84('0x47')](_[_0x2f84('0x6a')](_0x56f38f['query'],_0x9e0089[_0x2f84('0x47')]));if(_0x56f38f[_0x2f84('0x46')]['filter']){_0x1f16ec['where']=_[_0x2f84('0x51')](_0x1f16ec[_0x2f84('0x4f')],{'$or':_[_0x2f84('0x44')](_0x1f16ec[_0x2f84('0x49')],function(_0x5e5f99){var _0x818dea={};_0x818dea[_0x5e5f99]={'$like':'%'+_0x56f38f['query'][_0x2f84('0x50')]+'%'};return _0x818dea;})});}_0x1f16ec=_[_0x2f84('0x51')]({},_0x1f16ec,_0x56f38f['options']);return _0x1dc536[_0x2f84('0xac')](_0x1f16ec);}})[_0x2f84('0x23')](function(_0x1e7057){if(_0x1e7057){_0xd8ca61=_0x1e7057[_0x2f84('0x59')];if(!_0x56f38f['query'][_0x2f84('0x4b')](_0x2f84('0x4c'))){_0x1f16ec['limit']=qs[_0x2f84('0x31')](_0x56f38f[_0x2f84('0x46')][_0x2f84('0x31')]);_0x1f16ec['offset']=qs[_0x2f84('0x2f')](_0x56f38f[_0x2f84('0x46')][_0x2f84('0x2f')]);}return _0x1dc536['getApplications'](_0x1f16ec);}})[_0x2f84('0x23')](function(_0x277739){if(_0x277739){return _0x277739?{'count':_0xd8ca61,'rows':_0x277739}:null;}})[_0x2f84('0x23')](respondWithResult(_0x3374a1,null))[_0x2f84('0x56')](handleError(_0x3374a1,null));};exports['getInteractions']=function(_0x1e352d,_0x665d3c,_0x4cb481){var _0x135b73={'raw':![],'where':{}};var _0x506ff8={};var _0xcbf899={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2f84('0x69')]({'where':{'id':_0x1e352d[_0x2f84('0x58')]['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x665d3c,null))['then'](function(_0x45640b){if(_0x45640b){_0x506ff8[_0x2f84('0x43')]=_[_0x2f84('0x45')](db[_0x2f84('0x92')][_0x2f84('0x40')]);_0x506ff8[_0x2f84('0x46')]=_['keys'](_0x1e352d[_0x2f84('0x46')]);_0x506ff8[_0x2f84('0x47')]=_[_0x2f84('0x48')](_0x506ff8['model'],_0x506ff8[_0x2f84('0x46')]);_0x135b73['attributes']=_[_0x2f84('0x48')](_0x506ff8[_0x2f84('0x43')],qs[_0x2f84('0x4a')](_0x1e352d[_0x2f84('0x46')]['fields']));_0x135b73[_0x2f84('0x49')]=_0x135b73[_0x2f84('0x49')][_0x2f84('0x59')]?_0x135b73[_0x2f84('0x49')]:_0x506ff8[_0x2f84('0x43')];if(!_0x1e352d[_0x2f84('0x46')][_0x2f84('0x4b')](_0x2f84('0x4c'))){_0x135b73[_0x2f84('0x31')]=qs['limit'](_0x1e352d[_0x2f84('0x46')][_0x2f84('0x31')]);_0x135b73[_0x2f84('0x2f')]=qs[_0x2f84('0x2f')](_0x1e352d[_0x2f84('0x46')]['offset']);}_0x135b73[_0x2f84('0x4d')]=qs[_0x2f84('0x4e')](_0x1e352d[_0x2f84('0x46')][_0x2f84('0x4e')]);_0x135b73[_0x2f84('0x4f')]=qs[_0x2f84('0x47')](_[_0x2f84('0x6a')](_0x1e352d[_0x2f84('0x46')],_0x506ff8[_0x2f84('0x47')]));_0x135b73[_0x2f84('0x4f')][_0x2f84('0x6f')]=_0x45640b['id'];if(_0x1e352d[_0x2f84('0x46')][_0x2f84('0x50')]){_0x135b73[_0x2f84('0x4f')]=_[_0x2f84('0x51')](_0x135b73[_0x2f84('0x4f')],{'$or':_[_0x2f84('0x44')](_0x135b73[_0x2f84('0x49')],function(_0x2eab04){var _0x33337e={};_0x33337e[_0x2eab04]={'$like':'%'+_0x1e352d[_0x2f84('0x46')]['filter']+'%'};return _0x33337e;})});}_0x135b73=_[_0x2f84('0x51')]({},_0x135b73,_0x1e352d['options']);return db['OpenchannelInteraction'][_0x2f84('0x32')]({'where':_0x135b73['where']})['then'](function(_0xe16c30){_0xcbf899[_0x2f84('0x32')]=_0xe16c30;if(_0x1e352d[_0x2f84('0x46')][_0x2f84('0x6b')]){_0x135b73[_0x2f84('0x53')]=[{'model':db[_0x2f84('0x75')],'as':_0x2f84('0xad'),'required':![]},{'model':db[_0x2f84('0xa0')],'as':'Owner','attributes':[_0x2f84('0x3a'),_0x2f84('0xae'),_0x2f84('0xaf')],'required':![]},{'model':db[_0x2f84('0xb0')],'as':_0x2f84('0xb1'),'attributes':['id','name',_0x2f84('0xb2')],'where':_0x1e352d['query'][_0x2f84('0xb3')]?{'id':_0x1e352d[_0x2f84('0x46')][_0x2f84('0xb3')]}:undefined,'required':_0x1e352d[_0x2f84('0x46')][_0x2f84('0xb3')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x135b73);})[_0x2f84('0x23')](function(_0x52e733){_0xcbf899[_0x2f84('0x55')]=_0x52e733;return _0xcbf899;});}})[_0x2f84('0x23')](respondWithFilteredResult(_0x665d3c,_0x135b73))[_0x2f84('0x56')](handleError(_0x665d3c,null));};exports[_0x2f84('0xb4')]=function(_0x2cec04,_0x4ddf17,_0x1cace){return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0x2cec04[_0x2f84('0x58')]['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x4ddf17,null))[_0x2f84('0x23')](function(_0x3ff34b){if(_0x3ff34b){return _0x3ff34b[_0x2f84('0xb4')](_0x2cec04[_0x2f84('0x64')][_0x2f84('0x6d')],_[_0x2f84('0xb5')](_0x2cec04['body'],[_0x2f84('0x6d'),'id'])||{})[_0x2f84('0xb6')](function(_0x15b321){for(var _0xc2844c=0x0;_0xc2844c<_0x2cec04[_0x2f84('0x64')][_0x2f84('0x6d')][_0x2f84('0x59')];_0xc2844c+=0x1){socket[_0x2f84('0xb7')](_0x2f84('0xb8'),{'UserId':Number(_0x2cec04[_0x2f84('0x64')]['ids'][_0xc2844c]),'OpenchannelAccountId':Number(_0x2cec04[_0x2f84('0x58')]['id'])});}return _0x15b321;});}})[_0x2f84('0x23')](respondWithResult(_0x4ddf17,null))[_0x2f84('0x56')](handleError(_0x4ddf17,null));};exports[_0x2f84('0xb9')]=function(_0x26b698,_0x3d90b1,_0x3c5821){return db['OpenchannelAccount'][_0x2f84('0x5a')]({'where':{'id':_0x26b698['params']['id']}})['then'](handleEntityNotFound(_0x3d90b1,null))[_0x2f84('0x23')](function(_0x11a79b){if(_0x11a79b){return _0x11a79b[_0x2f84('0xb9')](_0x26b698[_0x2f84('0x46')][_0x2f84('0x6d')])[_0x2f84('0x23')](function(){if(_[_0x2f84('0xba')](_0x26b698[_0x2f84('0x46')][_0x2f84('0x6d')])){for(var _0xef4f8f=0x0;_0xef4f8f<_0x26b698[_0x2f84('0x46')]['ids'][_0x2f84('0x59')];_0xef4f8f+=0x1){socket[_0x2f84('0xb7')](_0x2f84('0xbb'),{'UserId':Number(_0x26b698['query']['ids'][_0xef4f8f]),'OpenchannelAccountId':Number(_0x26b698['params']['id'])});}}else{socket[_0x2f84('0xb7')](_0x2f84('0xbb'),{'UserId':Number(_0x26b698[_0x2f84('0x46')][_0x2f84('0x6d')]),'OpenchannelAccountId':Number(_0x26b698[_0x2f84('0x58')]['id'])});}});}})[_0x2f84('0x23')](respondWithStatusCode(_0x3d90b1,null))[_0x2f84('0x56')](handleError(_0x3d90b1,null));};exports[_0x2f84('0xbc')]=function(_0x3c5221,_0x1f3b4f,_0x2ce488){var _0x59e4d1={};var _0xabbae5={};var _0x38c690;var _0xafeaa2;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3c5221['params']['id']}})['then'](handleEntityNotFound(_0x1f3b4f,null))['then'](function(_0x37bdb7){if(_0x37bdb7){_0x38c690=_0x37bdb7;_0xabbae5[_0x2f84('0x43')]=_[_0x2f84('0x45')](db[_0x2f84('0xa0')][_0x2f84('0x40')]);_0xabbae5['query']=_[_0x2f84('0x45')](_0x3c5221['query']);_0xabbae5[_0x2f84('0x47')]=_['intersection'](_0xabbae5['model'],_0xabbae5[_0x2f84('0x46')]);_0x59e4d1[_0x2f84('0x49')]=_[_0x2f84('0x48')](_0xabbae5[_0x2f84('0x43')],qs[_0x2f84('0x4a')](_0x3c5221['query'][_0x2f84('0x4a')]));_0x59e4d1['attributes']=_0x59e4d1[_0x2f84('0x49')][_0x2f84('0x59')]?_0x59e4d1['attributes']:_0xabbae5[_0x2f84('0x43')];_0x59e4d1['order']=qs[_0x2f84('0x4e')](_0x3c5221[_0x2f84('0x46')][_0x2f84('0x4e')]);_0x59e4d1[_0x2f84('0x4f')]=qs[_0x2f84('0x47')](_[_0x2f84('0x6a')](_0x3c5221['query'],_0xabbae5['filters']));if(_0x3c5221['query'][_0x2f84('0x50')]){_0x59e4d1[_0x2f84('0x4f')]=_['merge'](_0x59e4d1['where'],{'$or':_[_0x2f84('0x44')](_0x59e4d1[_0x2f84('0x49')],function(_0x1c1d3d){var _0x42d242={};_0x42d242[_0x1c1d3d]={'$like':'%'+_0x3c5221[_0x2f84('0x46')][_0x2f84('0x50')]+'%'};return _0x42d242;})});}_0x59e4d1=_[_0x2f84('0x51')]({},_0x59e4d1,_0x3c5221[_0x2f84('0x52')]);return _0x38c690[_0x2f84('0xbc')](_0x59e4d1);}})[_0x2f84('0x23')](function(_0x2521ec){if(_0x2521ec){_0xafeaa2=_0x2521ec['length'];if(!_0x3c5221[_0x2f84('0x46')][_0x2f84('0x4b')](_0x2f84('0x4c'))){_0x59e4d1[_0x2f84('0x31')]=qs[_0x2f84('0x31')](_0x3c5221[_0x2f84('0x46')]['limit']);_0x59e4d1[_0x2f84('0x2f')]=qs[_0x2f84('0x2f')](_0x3c5221['query']['offset']);}return _0x38c690[_0x2f84('0xbc')](_0x59e4d1);}})['then'](function(_0x463920){if(_0x463920){return _0x463920?{'count':_0xafeaa2,'rows':_0x463920}:null;}})[_0x2f84('0x23')](respondWithResult(_0x1f3b4f,null))['catch'](handleError(_0x1f3b4f,null));};exports[_0x2f84('0x3b')]=function(_0x1095a8,_0x20040e,_0x3d7377){var _0x558ad5,_0x319bc8,_0x2c2c3c;if(_[_0x2f84('0x7d')](_0x1095a8[_0x2f84('0x64')][_0x2f84('0x64')])||_0x1095a8[_0x2f84('0x64')][_0x2f84('0x64')]===''){throw new db['Sequelize'][(_0x2f84('0x77'))](_0x2f84('0x80'));}if(_['isNil'](_0x1095a8['body']['to'])){}_0x558ad5=_0x1095a8[_0x2f84('0x64')]['to'];return db[_0x2f84('0x3f')]['findOne']({'where':{'id':_0x1095a8[_0x2f84('0x58')]['id']}})[_0x2f84('0x23')](handleEntityNotFound(_0x20040e,null))[_0x2f84('0x23')](function(_0xb54b00){if(_0xb54b00){return db[_0x2f84('0x3f')][_0x2f84('0x5a')]({'where':{'id':_0xb54b00['id']},'include':[{'model':db[_0x2f84('0x84')],'as':'List','include':[{'model':db[_0x2f84('0x75')],'as':'Contacts','where':{[_0xb54b00[_0x2f84('0x81')]]:_0x558ad5},'limit':0x1,'order':[[_0x2f84('0x7a'),_0x2f84('0x87')]]}]}]})['then'](handleEntityNotFound(_0x20040e,null))[_0x2f84('0x23')](function(_0x1cad8e){if(_0x1cad8e&&_0x1cad8e[_0x2f84('0x85')]){_0x319bc8=_0x1cad8e[_0x2f84('0x36')]({'plain':!![]});if(_0x319bc8[_0x2f84('0x85')]&&_0x319bc8['List']['Contacts'][_0x2f84('0x59')]){return _0x319bc8[_0x2f84('0x85')][_0x2f84('0x86')][0x0];}return db['CmContact'][_0x2f84('0x5b')](_['defaults'](_0x1095a8[_0x2f84('0x64')],{'firstName':_0x558ad5,[_0x1cad8e[_0x2f84('0x81')]]:_0x558ad5,'phone':_0x558ad5,'ListId':_0x319bc8[_0x2f84('0xbd')]}));}})[_0x2f84('0x23')](handleEntityNotFound(_0x20040e,null))['then'](function(_0x318ab2){if(_0x318ab2){_0x2c2c3c=_0x318ab2;return db[_0x2f84('0x92')]['find']({'where':{'ContactId':_0x2c2c3c['id'],'closed':![],'OpenchannelAccountId':_0x319bc8['id']}})['then'](function(_0x426334){if(_0x426334){return[_0x426334,![]];}return db[_0x2f84('0x92')][_0x2f84('0x5b')]({'UserId':_0x1095a8['user']['id'],'ContactId':_0x2c2c3c['id'],'OpenchannelAccountId':_0x319bc8['id'],'lastMsgDirection':'out','firstMsgDirection':_0x2f84('0xbe'),'Messages':[_[_0x2f84('0x51')](_0x1095a8[_0x2f84('0x64')],{'read':![],'body':_0x1095a8[_0x2f84('0x64')][_0x2f84('0x64')],'OpenchannelAccountId':_0x319bc8['id'],'UserId':_0x1095a8[_0x2f84('0x5c')]['id'],'ContactId':_0x2c2c3c['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x2f84('0x23')](function(_0x4a58b3){return[_0x4a58b3,!![]];});});}})[_0x2f84('0xb6')](function(_0x1b025d,_0x2436a0){if(_0x2436a0){return _0x1b025d;}return db['OpenchannelMessage'][_0x2f84('0x5b')](_[_0x2f84('0x51')](_0x1095a8[_0x2f84('0x64')],{'read':![],'body':_0x1095a8[_0x2f84('0x64')]['body'],'OpenchannelAccountId':_0x319bc8['id'],'OpenchannelInteractionId':_0x1b025d['id'],'UserId':_0x1095a8[_0x2f84('0x5c')]['id'],'ContactId':_0x2c2c3c['id']}))[_0x2f84('0x23')](function(_0x2946a3){_0x1b025d[_0x2f84('0xbf')]['Messages']=[];_0x1b025d['dataValues']['Messages']['push'](_0x2946a3['dataValues']);return _0x1b025d;});});}})[_0x2f84('0x23')](respondWithResult(_0x20040e,null))[_0x2f84('0x56')](handleError(_0x20040e,null));}; \ No newline at end of file +var _0x6e12=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','end','json','undefined','count','offset','limit','status','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','VIRTUAL','options','where','includeAll','include','OpenchannelAccount','findAll','rows','Pause','keys','find','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','pick','filter','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','DESC','Applications','List','account','applications','list','orderBy','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','*,*,*,*','Start','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','priority','stack','finally','send','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','addAgents','emit','removeAgents','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','client','http'];(function(_0x4066e1,_0x289436){var _0x3a178b=function(_0x3bb74a){while(--_0x3bb74a){_0x4066e1['push'](_0x4066e1['shift']());}};_0x3a178b(++_0x289436);}(_0x6e12,0x154));var _0x26e1=function(_0x236c8d,_0xd1f84b){_0x236c8d=_0x236c8d-0x0;var _0x15ec5c=_0x6e12[_0x236c8d];return _0x15ec5c;};'use strict';var emlformat=require(_0x26e1('0x0'));var rimraf=require(_0x26e1('0x1'));var zipdir=require(_0x26e1('0x2'));var jsonpatch=require(_0x26e1('0x3'));var rp=require('request-promise');var moment=require(_0x26e1('0x4'));var BPromise=require(_0x26e1('0x5'));var Mustache=require(_0x26e1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x26e1('0x7'));var csv=require(_0x26e1('0x8'));var ejs=require(_0x26e1('0x9'));var fs=require('fs');var fs_extra=require(_0x26e1('0xa'));var _=require(_0x26e1('0xb'));var squel=require('squel');var crypto=require(_0x26e1('0xc'));var jsforce=require(_0x26e1('0xd'));var deskjs=require(_0x26e1('0xe'));var toCsv=require(_0x26e1('0x8'));var querystring=require(_0x26e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x26e1('0x10'));var authService=require(_0x26e1('0x11'));var qs=require(_0x26e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e1('0x13'));var logger=require(_0x26e1('0x14'))(_0x26e1('0x15'));var utils=require(_0x26e1('0x16'));var config=require(_0x26e1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x26e1('0x18'))['db'];config[_0x26e1('0x19')]=_[_0x26e1('0x1a')](config['redis'],{'host':_0x26e1('0x1b'),'port':0x18eb});var socket=require(_0x26e1('0x1c'))(new Redis(config[_0x26e1('0x19')]));require(_0x26e1('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x26e1('0x1e')][_0x26e1('0x1f')]({'port':0x232c});var client9002=jayson[_0x26e1('0x1e')][_0x26e1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x438eca,_0x5edd81,_0x28f87b,_0x411b9d){return new BPromise(function(_0x545727,_0x1f4d1f){var _0x1043e1=_0x411b9d||client;return _0x1043e1[_0x26e1('0x20')](_0x438eca,_0x28f87b)[_0x26e1('0x21')](function(_0x2bb105){logger[_0x26e1('0x22')](_0x26e1('0x23'),_0x5edd81,'request\x20sent');logger['debug'](_0x26e1('0x24'),_0x5edd81,_0x26e1('0x25'),JSON[_0x26e1('0x26')](_0x2bb105));if(_0x2bb105['error']){if(_0x2bb105[_0x26e1('0x27')]['code']===0x1f4){logger[_0x26e1('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x5edd81,_0x2bb105[_0x26e1('0x27')][_0x26e1('0x28')]);return _0x1f4d1f(_0x2bb105[_0x26e1('0x27')]['message']);}logger[_0x26e1('0x27')](_0x26e1('0x23'),_0x5edd81,_0x2bb105[_0x26e1('0x27')][_0x26e1('0x28')]);return _0x545727(_0x2bb105[_0x26e1('0x27')][_0x26e1('0x28')]);}else{logger[_0x26e1('0x22')](_0x26e1('0x23'),_0x5edd81,_0x26e1('0x25'));_0x545727(_0x2bb105['result'][_0x26e1('0x28')]);}})[_0x26e1('0x29')](function(_0x21ed95){logger[_0x26e1('0x27')](_0x26e1('0x23'),_0x5edd81,_0x21ed95);_0x1f4d1f(_0x21ed95);});});}function respondWithStatusCode(_0x1d166c,_0x112285){_0x112285=_0x112285||0xcc;return function(_0x5973c1){if(_0x5973c1){return _0x1d166c['sendStatus'](_0x112285);}return _0x1d166c['status'](_0x112285)[_0x26e1('0x2a')]();};}function respondWithResult(_0x28278d,_0x198d1f){_0x198d1f=_0x198d1f||0xc8;return function(_0x587113){if(_0x587113){return _0x28278d['status'](_0x198d1f)[_0x26e1('0x2b')](_0x587113);}};}function respondWithFilteredResult(_0xeed638,_0x385698){return function(_0x2abff3){if(_0x2abff3){var _0x2e4c78=typeof _0x385698['offset']==='undefined'&&typeof _0x385698['limit']===_0x26e1('0x2c');var _0x2d7f78=_0x2abff3[_0x26e1('0x2d')];var _0x412b2f=_0x2e4c78?0x0:_0x385698['offset'];var _0x51396d=_0x2e4c78?_0x2abff3[_0x26e1('0x2d')]:_0x385698[_0x26e1('0x2e')]+_0x385698[_0x26e1('0x2f')];var _0xe0a08d;if(_0x51396d>=_0x2d7f78){_0x51396d=_0x2d7f78;_0xe0a08d=0xc8;}else{_0xe0a08d=0xce;}_0xeed638[_0x26e1('0x30')](_0xe0a08d);return _0xeed638[_0x26e1('0x31')](_0x26e1('0x32'),_0x412b2f+'-'+_0x51396d+'/'+_0x2d7f78)['json'](_0x2abff3);}return null;};}function patchUpdates(_0x96e6da){return function(_0x3b3006){try{jsonpatch['apply'](_0x3b3006,_0x96e6da,!![]);}catch(_0x13eb0d){return BPromise[_0x26e1('0x33')](_0x13eb0d);}return _0x3b3006[_0x26e1('0x34')]();};}function saveUpdates(_0x4dbc94,_0x4ac6f0){return function(_0x2c2a1c){if(_0x2c2a1c){return _0x2c2a1c[_0x26e1('0x35')](_0x4dbc94)[_0x26e1('0x21')](function(_0x50700a){return _0x50700a;});}return null;};}function removeEntity(_0x1a91c6,_0x1e9265){return function(_0xd14d1c){if(_0xd14d1c){return _0xd14d1c[_0x26e1('0x36')]()[_0x26e1('0x21')](function(){var _0xe8cbc6=_0xd14d1c[_0x26e1('0x37')]({'plain':!![]});var _0x27c4fc=_0x26e1('0x38');return db[_0x26e1('0x39')][_0x26e1('0x36')]({'where':{'type':_0x27c4fc,'resourceId':_0xe8cbc6['id']}})['then'](function(){return _0xd14d1c;});})[_0x26e1('0x21')](function(){_0x1a91c6[_0x26e1('0x30')](0xcc)[_0x26e1('0x2a')]();});}};}function handleEntityNotFound(_0x5e2aa2,_0x4404d8){return function(_0x539b5d){if(!_0x539b5d){_0x5e2aa2[_0x26e1('0x3a')](0x194);}return _0x539b5d;};}function handleError(_0x200a63,_0x353737){_0x353737=_0x353737||0x1f4;return function(_0x395f56){logger[_0x26e1('0x27')](_0x395f56['stack']);if(_0x395f56[_0x26e1('0x3b')]){delete _0x395f56['name'];}_0x200a63[_0x26e1('0x30')](_0x353737)['send'](_0x395f56);};}exports[_0x26e1('0x3c')]=function(_0x3752ed,_0x81efc2){var _0x1ebd8c={'include':[{'model':db['Pause'],'as':_0x26e1('0x3d')}]},_0x2a5bc5={},_0x62f198={'count':0x0,'rows':[]};var _0x3bb8a5=_[_0x26e1('0x3e')](db['OpenchannelAccount'][_0x26e1('0x3f')],function(_0x3f38bb){return{'name':_0x3f38bb[_0x26e1('0x40')],'type':_0x3f38bb[_0x26e1('0x41')][_0x26e1('0x42')]};});_0x2a5bc5[_0x26e1('0x43')]=_[_0x26e1('0x3e')](_0x3bb8a5,_0x26e1('0x3b'));_0x2a5bc5['query']=_['keys'](_0x3752ed[_0x26e1('0x44')]);_0x2a5bc5[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x2a5bc5[_0x26e1('0x43')],_0x2a5bc5['query']);_0x1ebd8c[_0x26e1('0x47')]=_[_0x26e1('0x46')](_0x2a5bc5[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x3752ed[_0x26e1('0x44')][_0x26e1('0x48')]));_0x1ebd8c[_0x26e1('0x47')]=_0x1ebd8c[_0x26e1('0x47')][_0x26e1('0x49')]?_0x1ebd8c['attributes']:_0x2a5bc5[_0x26e1('0x43')];if(!_0x3752ed[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x1ebd8c[_0x26e1('0x2f')]=qs['limit'](_0x3752ed['query'][_0x26e1('0x2f')]);_0x1ebd8c['offset']=qs[_0x26e1('0x2e')](_0x3752ed['query']['offset']);}_0x1ebd8c[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x3752ed[_0x26e1('0x44')]['sort']);_0x1ebd8c['where']=qs['filters'](_['pick'](_0x3752ed['query'],_0x2a5bc5[_0x26e1('0x45')]),_0x3bb8a5);if(_0x3752ed[_0x26e1('0x44')]['filter']){_0x1ebd8c['where']=_[_0x26e1('0x4e')](_0x1ebd8c['where'],{'$or':_[_0x26e1('0x3e')](_0x3bb8a5,function(_0x3cc61f){if(_0x3cc61f[_0x26e1('0x41')]!==_0x26e1('0x4f')){var _0x44cf16={};_0x44cf16[_0x3cc61f[_0x26e1('0x3b')]]={'$like':'%'+_0x3752ed[_0x26e1('0x44')]['filter']+'%'};return _0x44cf16;}})});}_0x1ebd8c=_['merge']({},_0x1ebd8c,_0x3752ed[_0x26e1('0x50')]);var _0x489da2={'where':_0x1ebd8c[_0x26e1('0x51')]};return db['OpenchannelAccount'][_0x26e1('0x2d')](_0x489da2)['then'](function(_0x2ef970){_0x62f198['count']=_0x2ef970;if(_0x3752ed[_0x26e1('0x44')][_0x26e1('0x52')]){_0x1ebd8c[_0x26e1('0x53')]=[{'all':!![]}];}return db[_0x26e1('0x54')][_0x26e1('0x55')](_0x1ebd8c);})['then'](function(_0x8dafec){_0x62f198[_0x26e1('0x56')]=_0x8dafec;return _0x62f198;})[_0x26e1('0x21')](respondWithFilteredResult(_0x81efc2,_0x1ebd8c))['catch'](handleError(_0x81efc2,null));};exports['show']=function(_0x24e360,_0x2c3169){var _0xe5f598={'raw':![],'where':{'id':_0x24e360['params']['id']},'include':[{'model':db[_0x26e1('0x57')],'as':_0x26e1('0x3d')}]},_0x52608d={};_0x52608d[_0x26e1('0x43')]=_[_0x26e1('0x58')](db[_0x26e1('0x54')][_0x26e1('0x3f')]);_0x52608d['query']=_['keys'](_0x24e360[_0x26e1('0x44')]);_0x52608d[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x52608d[_0x26e1('0x43')],_0x52608d[_0x26e1('0x44')]);_0xe5f598[_0x26e1('0x47')]=_[_0x26e1('0x46')](_0x52608d[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x24e360[_0x26e1('0x44')][_0x26e1('0x48')]));_0xe5f598['attributes']=_0xe5f598[_0x26e1('0x47')][_0x26e1('0x49')]?_0xe5f598[_0x26e1('0x47')]:_0x52608d[_0x26e1('0x43')];if(_0x24e360[_0x26e1('0x44')][_0x26e1('0x52')]){_0xe5f598[_0x26e1('0x53')]=[{'all':!![]}];}_0xe5f598=_[_0x26e1('0x4e')]({},_0xe5f598,_0x24e360['options']);return db[_0x26e1('0x54')][_0x26e1('0x59')](_0xe5f598)[_0x26e1('0x21')](handleEntityNotFound(_0x2c3169,null))[_0x26e1('0x21')](respondWithResult(_0x2c3169,null))[_0x26e1('0x29')](handleError(_0x2c3169,null));};exports['create']=function(_0x58233b,_0x59211a){return db[_0x26e1('0x54')][_0x26e1('0x5a')](_0x58233b[_0x26e1('0x5b')],{})[_0x26e1('0x21')](function(_0x17043c){var _0x30eef3=_0x58233b[_0x26e1('0x5c')]['get']({'plain':!![]});if(!_0x30eef3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30eef3[_0x26e1('0x5d')]===_0x26e1('0x5c')){var _0x33c112=_0x17043c[_0x26e1('0x37')]({'plain':!![]});var _0xf364c0=_0x26e1('0x38');return db['UserProfileSection'][_0x26e1('0x59')]({'where':{'name':_0xf364c0,'userProfileId':_0x30eef3[_0x26e1('0x5e')]},'raw':!![]})[_0x26e1('0x21')](function(_0x476a91){if(_0x476a91&&_0x476a91['autoAssociation']===0x0){return db[_0x26e1('0x39')]['create']({'name':_0x33c112[_0x26e1('0x3b')],'resourceId':_0x33c112['id'],'type':_0x476a91[_0x26e1('0x3b')],'sectionId':_0x476a91['id']},{})[_0x26e1('0x21')](function(){return _0x17043c;});}else{return _0x17043c;}})['catch'](function(_0x299cc0){logger[_0x26e1('0x27')](_0x26e1('0x5f'),_0x299cc0);throw _0x299cc0;});}return _0x17043c;})[_0x26e1('0x21')](respondWithResult(_0x59211a,0xc9))[_0x26e1('0x29')](handleError(_0x59211a,null));};exports[_0x26e1('0x35')]=function(_0xd2b873,_0x4b12f8){if(_0xd2b873[_0x26e1('0x5b')]['id']){delete _0xd2b873[_0x26e1('0x5b')]['id'];}return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0xd2b873[_0x26e1('0x60')]['id']},'include':[{'model':db[_0x26e1('0x57')],'as':_0x26e1('0x3d')}]})[_0x26e1('0x21')](handleEntityNotFound(_0x4b12f8,null))[_0x26e1('0x21')](saveUpdates(_0xd2b873[_0x26e1('0x5b')],null))['then'](respondWithResult(_0x4b12f8,null))[_0x26e1('0x29')](handleError(_0x4b12f8,null));};exports[_0x26e1('0x36')]=function(_0x4d21c7,_0x13370c){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x4d21c7[_0x26e1('0x60')]['id']}})['then'](handleEntityNotFound(_0x13370c,null))[_0x26e1('0x21')](removeEntity(_0x13370c,null))[_0x26e1('0x29')](handleError(_0x13370c,null));};exports[_0x26e1('0x61')]=function(_0x306389,_0x2047fa){return db[_0x26e1('0x54')][_0x26e1('0x61')]()['then'](respondWithResult(_0x2047fa,null))[_0x26e1('0x29')](handleError(_0x2047fa,null));};exports[_0x26e1('0x62')]=function(_0x29c784,_0x42dde2,_0x4c12ef){if(_0x29c784[_0x26e1('0x5b')]['id']){delete _0x29c784['body']['id'];}return db['OpenchannelAccount'][_0x26e1('0x59')]({'where':{'id':_0x29c784[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x42dde2,null))['then'](function(_0x573636){if(_0x573636){_0x29c784[_0x26e1('0x5b')][_0x26e1('0x63')]=_0x573636['id'];return db['Disposition']['create'](_0x29c784['body']);}})['then'](respondWithResult(_0x42dde2,null))['catch'](handleError(_0x42dde2,null));};exports[_0x26e1('0x64')]=function(_0x52e820,_0x106d22,_0x5f39b7){var _0x46d3cc={'raw':![],'where':{}};var _0x7d4ce8={};var _0x4b4d04={'count':0x0,'rows':[]};return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x52e820['params']['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x106d22,null))[_0x26e1('0x21')](function(_0x11a48c){if(_0x11a48c){_0x7d4ce8['model']=_[_0x26e1('0x58')](db['Disposition'][_0x26e1('0x3f')]);_0x7d4ce8[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x52e820['query']);_0x7d4ce8['filters']=_[_0x26e1('0x46')](_0x7d4ce8['model'],_0x7d4ce8[_0x26e1('0x44')]);_0x46d3cc['attributes']=_[_0x26e1('0x46')](_0x7d4ce8[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x52e820[_0x26e1('0x44')][_0x26e1('0x48')]));_0x46d3cc[_0x26e1('0x47')]=_0x46d3cc['attributes'][_0x26e1('0x49')]?_0x46d3cc['attributes']:_0x7d4ce8[_0x26e1('0x43')];if(!_0x52e820[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x46d3cc[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x52e820[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x46d3cc['offset']=qs[_0x26e1('0x2e')](_0x52e820[_0x26e1('0x44')][_0x26e1('0x2e')]);}_0x46d3cc['order']=qs[_0x26e1('0x4d')](_0x52e820['query'][_0x26e1('0x4d')]);_0x46d3cc['where']=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x52e820[_0x26e1('0x44')],_0x7d4ce8[_0x26e1('0x45')]));_0x46d3cc[_0x26e1('0x51')]['OpenchannelAccountId']=_0x11a48c['id'];if(_0x52e820[_0x26e1('0x44')][_0x26e1('0x67')]){_0x46d3cc[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x46d3cc[_0x26e1('0x51')],{'$or':_['map'](_0x46d3cc[_0x26e1('0x47')],function(_0x592120){var _0x48e6b6={};_0x48e6b6[_0x592120]={'$like':'%'+_0x52e820['query']['filter']+'%'};return _0x48e6b6;})});}_0x46d3cc=_[_0x26e1('0x4e')]({},_0x46d3cc,_0x52e820[_0x26e1('0x50')]);return db[_0x26e1('0x68')][_0x26e1('0x2d')]({'where':_0x46d3cc[_0x26e1('0x51')]})[_0x26e1('0x21')](function(_0x40cb72){_0x4b4d04['count']=_0x40cb72;if(_0x52e820[_0x26e1('0x44')][_0x26e1('0x52')]){_0x46d3cc[_0x26e1('0x53')]=[{'all':!![]}];}return db[_0x26e1('0x68')][_0x26e1('0x55')](_0x46d3cc);})[_0x26e1('0x21')](function(_0x2f81ec){_0x4b4d04['rows']=_0x2f81ec;return _0x4b4d04;});}})['then'](respondWithFilteredResult(_0x106d22,_0x46d3cc))[_0x26e1('0x29')](handleError(_0x106d22,null));};exports[_0x26e1('0x69')]=function(_0x5ab4f1,_0x1e1129,_0xd9bba9){return db[_0x26e1('0x54')]['find']({'where':{'id':_0x5ab4f1[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x1e1129,null))[_0x26e1('0x21')](function(_0x395039){if(_0x395039){return _0x395039[_0x26e1('0x69')](_0x5ab4f1[_0x26e1('0x44')][_0x26e1('0x6a')]);}})[_0x26e1('0x21')](respondWithStatusCode(_0x1e1129,null))[_0x26e1('0x29')](handleError(_0x1e1129,null));};exports[_0x26e1('0x6b')]=function(_0x326678,_0xf2ffb4,_0x10d02f){if(_0x326678['body']['id']){delete _0x326678[_0x26e1('0x5b')]['id'];}return db[_0x26e1('0x54')]['find']({'where':{'id':_0x326678[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0xf2ffb4,null))[_0x26e1('0x21')](function(_0x504730){if(_0x504730){_0x326678[_0x26e1('0x5b')][_0x26e1('0x63')]=_0x504730['id'];return db[_0x26e1('0x6c')]['create'](_0x326678['body']);}})['then'](respondWithResult(_0xf2ffb4,null))['catch'](handleError(_0xf2ffb4,null));};exports[_0x26e1('0x6d')]=function(_0x576e09,_0x48413b,_0x18f42e){var _0x400e02={'raw':![],'where':{}};var _0x167239={};var _0x3677e2={'count':0x0,'rows':[]};return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x576e09['params']['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x48413b,null))['then'](function(_0x353a7e){if(_0x353a7e){_0x167239['model']=_[_0x26e1('0x58')](db[_0x26e1('0x6c')][_0x26e1('0x3f')]);_0x167239[_0x26e1('0x44')]=_['keys'](_0x576e09['query']);_0x167239[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x167239[_0x26e1('0x43')],_0x167239[_0x26e1('0x44')]);_0x400e02['attributes']=_['intersection'](_0x167239[_0x26e1('0x43')],qs['fields'](_0x576e09['query']['fields']));_0x400e02[_0x26e1('0x47')]=_0x400e02[_0x26e1('0x47')]['length']?_0x400e02[_0x26e1('0x47')]:_0x167239[_0x26e1('0x43')];if(!_0x576e09[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x400e02['limit']=qs[_0x26e1('0x2f')](_0x576e09[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x400e02['offset']=qs['offset'](_0x576e09[_0x26e1('0x44')][_0x26e1('0x2e')]);}_0x400e02[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x576e09[_0x26e1('0x44')][_0x26e1('0x4d')]);_0x400e02[_0x26e1('0x51')]=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x576e09[_0x26e1('0x44')],_0x167239[_0x26e1('0x45')]));_0x400e02[_0x26e1('0x51')][_0x26e1('0x63')]=_0x353a7e['id'];if(_0x576e09[_0x26e1('0x44')][_0x26e1('0x67')]){_0x400e02[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x400e02[_0x26e1('0x51')],{'$or':_['map'](_0x400e02[_0x26e1('0x47')],function(_0x5973ee){var _0x2e9b62={};_0x2e9b62[_0x5973ee]={'$like':'%'+_0x576e09[_0x26e1('0x44')][_0x26e1('0x67')]+'%'};return _0x2e9b62;})});}_0x400e02=_[_0x26e1('0x4e')]({},_0x400e02,_0x576e09[_0x26e1('0x50')]);return db[_0x26e1('0x6c')][_0x26e1('0x2d')]({'where':_0x400e02[_0x26e1('0x51')]})['then'](function(_0x3163e5){_0x3677e2['count']=_0x3163e5;if(_0x576e09[_0x26e1('0x44')][_0x26e1('0x52')]){_0x400e02[_0x26e1('0x53')]=[{'all':!![]}];}return db[_0x26e1('0x6c')][_0x26e1('0x55')](_0x400e02);})[_0x26e1('0x21')](function(_0x3ffafe){_0x3677e2[_0x26e1('0x56')]=_0x3ffafe;return _0x3677e2;});}})[_0x26e1('0x21')](respondWithFilteredResult(_0x48413b,_0x400e02))['catch'](handleError(_0x48413b,null));};exports['removeAnswers']=function(_0x27801a,_0xba8a46,_0x69ef04){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x27801a[_0x26e1('0x60')]['id']}})['then'](handleEntityNotFound(_0xba8a46,null))[_0x26e1('0x21')](function(_0x3f336f){if(_0x3f336f){return _0x3f336f[_0x26e1('0x6e')](_0x27801a[_0x26e1('0x44')]['ids']);}})['then'](respondWithStatusCode(_0xba8a46,null))[_0x26e1('0x29')](handleError(_0xba8a46,null));};exports['notify']=function(_0x50524f,_0x190d73,_0x548dc2){var _0xc6e690={'body':_0x50524f[_0x26e1('0x5b')],'channel':_0x26e1('0x6f')};var _0x4eb4df=[];var _0x4ef816=[];var _0x1861e8={};var _0x46f0ea=![];return db[_0x26e1('0x70')][_0x26e1('0x61')]()[_0x26e1('0x21')](function(_0x157f69){if(!_0x157f69){throw new db[(_0x26e1('0x71'))][(_0x26e1('0x72'))](_0x26e1('0x73'));}_0x4eb4df=_[_0x26e1('0x74')](_[_0x26e1('0x58')](_0x157f69),[_0x26e1('0x75'),_0x26e1('0x76')]);_0x4ef816=_['difference'](_['keys'](_0x157f69),['createdAt',_0x26e1('0x76'),_0x26e1('0x77'),_0x26e1('0x78')]);if(_0x50524f[_0x26e1('0x5b')]['id']){delete _0x50524f[_0x26e1('0x5b')]['id'];}if(_[_0x26e1('0x79')](_0x50524f[_0x26e1('0x5b')]['from'])){throw new db['Sequelize'][(_0x26e1('0x72'))](_0x26e1('0x7a'));}if(_[_0x26e1('0x79')](_0x50524f[_0x26e1('0x5b')]['body'])||_0x50524f[_0x26e1('0x5b')]['body']===''){throw new db['Sequelize'][(_0x26e1('0x72'))](_0x26e1('0x7b'));}if(_[_0x26e1('0x79')](_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7c')])){throw new db[(_0x26e1('0x71'))][(_0x26e1('0x72'))](_0x26e1('0x7d')+_0x4ef816);}if(!_['includes'](_0x4ef816,_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7c')])){throw new db[(_0x26e1('0x71'))][(_0x26e1('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ef816);}_0x1861e8[_0x50524f['body']['mapKey']]=_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7e')];})['then'](function(){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x50524f[_0x26e1('0x60')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x26e1('0x70')],'as':_0x26e1('0x7f'),'where':_0x1861e8,'limit':0x1,'order':[[_0x26e1('0x76'),_0x26e1('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x26e1('0x81')}]});})['then'](handleEntityNotFound(_0x190d73,null))[_0x26e1('0x21')](function(_0x568d96){if(_0x568d96&&_0x568d96[_0x26e1('0x82')]){_0xc6e690[_0x26e1('0x83')]=_0x568d96;_0xc6e690[_0x26e1('0x84')]=_0x568d96[_0x26e1('0x81')];_0xc6e690[_0x26e1('0x85')]=_0x568d96[_0x26e1('0x82')];_0xc6e690[_0x26e1('0x84')]=_[_0x26e1('0x86')](_0xc6e690[_0x26e1('0x84')],['priority'],[_0x26e1('0x87')]);if(_0xc6e690[_0x26e1('0x83')]['Applications']){delete _0xc6e690[_0x26e1('0x83')][_0x26e1('0x81')];}if(_0xc6e690[_0x26e1('0x83')][_0x26e1('0x82')]&&_0xc6e690[_0x26e1('0x83')][_0x26e1('0x82')][_0x26e1('0x7f')][_0x26e1('0x49')]){return _0xc6e690[_0x26e1('0x83')]['List'][_0x26e1('0x7f')][0x0];}var _0x6dd8c=_[_0x26e1('0x1a')](_0x50524f[_0x26e1('0x5b')],{'firstName':_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7e')],'ListId':_0x568d96[_0x26e1('0x78')]});_0x6dd8c[_0x50524f[_0x26e1('0x5b')][_0x26e1('0x7c')]]=_0x50524f[_0x26e1('0x5b')]['from'];return db['CmContact']['create'](_0x6dd8c,{'fields':_0x4eb4df,'raw':!![]});}})[_0x26e1('0x21')](handleEntityNotFound(_0x190d73,null))['then'](function(_0x5c5bc1){_0xc6e690[_0x26e1('0x88')]=_0x5c5bc1;if(_0x5c5bc1){var _0x30a3b4={'ContactId':_0x5c5bc1['id'],'OpenchannelAccountId':_0x50524f[_0x26e1('0x60')]['id'],'from':(_0x5c5bc1[_0x26e1('0x89')]||'')+'\x20'+(_0x5c5bc1[_0x26e1('0x8a')]||'')};var _0x45411b={'OpenchannelAccountId':_0x50524f[_0x26e1('0x60')]['id'],'closed':![]};if(_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8b')]){_0x45411b[_0x26e1('0x8b')]=_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8b')];return db['OpenchannelInteraction']['find']({'where':_0x45411b})[_0x26e1('0x21')](function(_0x3f4053){if(_0x3f4053){return[_0x3f4053,![]];}_0x30a3b4[_0x26e1('0x8b')]=_0x50524f['body'][_0x26e1('0x8b')];_0x30a3b4['externalUrl']=_0x50524f[_0x26e1('0x5b')]['externalUrl'];return db['OpenchannelInteraction'][_0x26e1('0x5a')](_0x30a3b4)[_0x26e1('0x21')](function(_0x2bbb3c){return[_0x2bbb3c,!![]];});});}else{_0x45411b[_0x26e1('0x8b')]=null;}_0x45411b['ContactId']=_0x5c5bc1['id'];return db[_0x26e1('0x8c')][_0x26e1('0x59')]({'where':_0x45411b})['then'](function(_0xbc812c){if(_0xbc812c){return[_0xbc812c,![]];}return db[_0x26e1('0x8c')][_0x26e1('0x5a')](_0x30a3b4)['then'](function(_0x2fba62){return[_0x2fba62,!![]];});});}})[_0x26e1('0x8d')](function(_0x4f2e5e,_0x6aa0a3){if(_0x4f2e5e){_0x46f0ea=_0x6aa0a3;if(!_0x6aa0a3){var _0x4b49e5={'from':(_0xc6e690['contact'][_0x26e1('0x89')]||'')+'\x20'+(_0xc6e690[_0x26e1('0x88')][_0x26e1('0x8a')]||'')};if(_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8b')]&&_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8e')]&&_0x50524f[_0x26e1('0x5b')]['threadId']!=_0x50524f[_0x26e1('0x5b')][_0x26e1('0x8e')]){_0x4b49e5[_0x26e1('0x8b')]=_0x50524f['body'][_0x26e1('0x8e')];}return _0x4f2e5e[_0x26e1('0x35')](_0x4b49e5);}else{return _0x4f2e5e;}}})['then'](function(_0x7b3efa){_0xc6e690[_0x26e1('0x8f')]=_0x7b3efa[_0x26e1('0x37')]({'plain':!![]});_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x90')]=_0x46f0ea;if(_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x90')]){if(_0xc6e690[_0x26e1('0x83')][_0x26e1('0x91')]){_0xc6e690[_0x26e1('0x84')][_0x26e1('0x92')]({'id':0x0,'priority':_0xc6e690[_0x26e1('0x84')][_0x26e1('0x49')]+0x1,'app':_0x26e1('0x93'),'appdata':_0x26e1('0x94'),'interval':'*,*,*,*'});}}return db[_0x26e1('0x95')][_0x26e1('0x5a')]({'body':_0x50524f[_0x26e1('0x5b')][_0x26e1('0x5b')],'OpenchannelAccountId':_0x50524f[_0x26e1('0x60')]['id'],'OpenchannelInteractionId':_0x7b3efa['id'],'direction':'in','ContactId':_0xc6e690[_0x26e1('0x88')]['id'],'AttachmentId':_0x50524f[_0x26e1('0x5b')][_0x26e1('0x96')]});})[_0x26e1('0x21')](function(_0xd188fd){_0xc6e690[_0x26e1('0x28')]=_0xd188fd;if(_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x97')]){return db[_0x26e1('0x98')][_0x26e1('0x59')]({'attributes':['id',_0x26e1('0x3b')],'where':{'id':_0xc6e690[_0x26e1('0x8f')][_0x26e1('0x97')]}})[_0x26e1('0x21')](function(_0x5b0727){if(_0x5b0727){_0xc6e690['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b0727[_0x26e1('0x3b')]+','+(_0xc6e690[_0x26e1('0x83')][_0x26e1('0x99')]||0xa),'interval':_0x26e1('0x9a')});_0xc6e690['forcedOwnership']=![];}return respondWithRpcPromise(_0x26e1('0x9b'),'startRouting',_0xc6e690);});}return respondWithRpcPromise('Start','startRouting',_0xc6e690);})[_0x26e1('0x21')](function(_0x47f45f){respondWithRpcPromise(_0x26e1('0x9c'),_0x26e1('0x9c'),{'event':_0x26e1('0x9d'),'message':_0x47f45f},client9002);return _0x47f45f;})['then'](respondWithResult(_0x190d73,null))[_0x26e1('0x29')](handleError(_0x190d73,null));};exports[_0x26e1('0x9e')]=function(_0x547479,_0x51b733){var _0x363ea6=_0x547479[_0x26e1('0x60')]['id'];var _0x28e1cb=_0x547479[_0x26e1('0x5b')];var _0x316337=0xc8;var _0x11f82d=null;return db[_0x26e1('0x9f')][_0x26e1('0xa0')]({'isolationLevel':db[_0x26e1('0x9f')][_0x26e1('0xa1')][_0x26e1('0xa2')][_0x26e1('0xa3')]},function(_0x5addf2){return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x363ea6},'transaction':_0x5addf2})[_0x26e1('0x21')](function(_0x308b91){if(_0x308b91){return db[_0x26e1('0xa4')][_0x26e1('0x36')]({'where':{'OpenchannelAccountId':_0x363ea6},'transaction':_0x5addf2})[_0x26e1('0x21')](function(){var _0x5491d5=_[_0x26e1('0x3e')](_0x28e1cb,function(_0x451f24){_0x451f24[_0x26e1('0x63')]=_0x363ea6;return _0x451f24;});return db[_0x26e1('0xa4')]['bulkCreate'](_0x5491d5,{'transaction':_0x5addf2});});}else{_0x316337=0x194;_0x11f82d=[];}});})['then'](function(){if(_0x316337!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x363ea6},'order':_0x26e1('0xa5')})[_0x26e1('0x21')](function(_0x431ce5){_0x11f82d=_0x431ce5;});}})[_0x26e1('0x29')](function(_0x3e0bcd){_0x316337=0x1f4;logger[_0x26e1('0x27')](_0x3e0bcd[_0x26e1('0xa6')]);if(_0x3e0bcd[_0x26e1('0x3b')]){delete _0x3e0bcd[_0x26e1('0x3b')];}_0x11f82d=_0x3e0bcd;})[_0x26e1('0xa7')](function(){if(_0x11f82d===null){_0x51b733[_0x26e1('0x3a')](_0x316337);}else{if(_0x316337===0x1f4){_0x51b733[_0x26e1('0x30')](_0x316337)[_0x26e1('0xa8')](_0x11f82d);}else{_0x51b733['status'](_0x316337)[_0x26e1('0x2b')](_0x11f82d);}}});};exports[_0x26e1('0xa9')]=function(_0x16aabf,_0x2b687c,_0x22a389){var _0x19bddd={};var _0xb60a5a={};var _0x3c99d5;var _0x4d7e26;return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x16aabf[_0x26e1('0x60')]['id']}})['then'](handleEntityNotFound(_0x2b687c,null))[_0x26e1('0x21')](function(_0x907c65){if(_0x907c65){_0x3c99d5=_0x907c65;_0xb60a5a[_0x26e1('0x43')]=_[_0x26e1('0x58')](db[_0x26e1('0xa4')][_0x26e1('0x3f')]);_0xb60a5a[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x16aabf[_0x26e1('0x44')]);_0xb60a5a['filters']=_['intersection'](_0xb60a5a[_0x26e1('0x43')],_0xb60a5a['query']);_0x19bddd[_0x26e1('0x47')]=_[_0x26e1('0x46')](_0xb60a5a[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x16aabf[_0x26e1('0x44')][_0x26e1('0x48')]));_0x19bddd[_0x26e1('0x47')]=_0x19bddd[_0x26e1('0x47')][_0x26e1('0x49')]?_0x19bddd['attributes']:_0xb60a5a[_0x26e1('0x43')];_0x19bddd[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x16aabf['query'][_0x26e1('0x4d')]);_0x19bddd['where']=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x16aabf[_0x26e1('0x44')],_0xb60a5a[_0x26e1('0x45')]));if(_0x16aabf[_0x26e1('0x44')]['filter']){_0x19bddd[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x19bddd[_0x26e1('0x51')],{'$or':_[_0x26e1('0x3e')](_0x19bddd['attributes'],function(_0x175ca3){var _0x325448={};_0x325448[_0x175ca3]={'$like':'%'+_0x16aabf['query'][_0x26e1('0x67')]+'%'};return _0x325448;})});}_0x19bddd=_['merge']({},_0x19bddd,_0x16aabf[_0x26e1('0x50')]);return _0x3c99d5[_0x26e1('0xa9')](_0x19bddd);}})['then'](function(_0x883218){if(_0x883218){_0x4d7e26=_0x883218[_0x26e1('0x49')];if(!_0x16aabf['query']['hasOwnProperty']('nolimit')){_0x19bddd[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x16aabf[_0x26e1('0x44')]['limit']);_0x19bddd[_0x26e1('0x2e')]=qs[_0x26e1('0x2e')](_0x16aabf['query'][_0x26e1('0x2e')]);}return _0x3c99d5[_0x26e1('0xa9')](_0x19bddd);}})['then'](function(_0x1fc599){if(_0x1fc599){return _0x1fc599?{'count':_0x4d7e26,'rows':_0x1fc599}:null;}})['then'](respondWithResult(_0x2b687c,null))[_0x26e1('0x29')](handleError(_0x2b687c,null));};exports[_0x26e1('0xaa')]=function(_0x72cfe4,_0xf52d05,_0x4c49e0){var _0x512db1={'raw':![],'where':{}};var _0x261b27={};var _0x26b53d={'count':0x0,'rows':[]};return db[_0x26e1('0x54')]['findOne']({'where':{'id':_0x72cfe4['params']['id']}})['then'](handleEntityNotFound(_0xf52d05,null))[_0x26e1('0x21')](function(_0x5223d3){if(_0x5223d3){_0x261b27[_0x26e1('0x43')]=_[_0x26e1('0x58')](db['OpenchannelInteraction'][_0x26e1('0x3f')]);_0x261b27[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x72cfe4[_0x26e1('0x44')]);_0x261b27[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x261b27['model'],_0x261b27[_0x26e1('0x44')]);_0x512db1[_0x26e1('0x47')]=_['intersection'](_0x261b27[_0x26e1('0x43')],qs[_0x26e1('0x48')](_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x48')]));_0x512db1[_0x26e1('0x47')]=_0x512db1['attributes'][_0x26e1('0x49')]?_0x512db1[_0x26e1('0x47')]:_0x261b27[_0x26e1('0x43')];if(!_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x4a')](_0x26e1('0x4b'))){_0x512db1[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x512db1[_0x26e1('0x2e')]=qs[_0x26e1('0x2e')](_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x2e')]);}_0x512db1[_0x26e1('0x4c')]=qs[_0x26e1('0x4d')](_0x72cfe4['query'][_0x26e1('0x4d')]);_0x512db1[_0x26e1('0x51')]=qs[_0x26e1('0x45')](_[_0x26e1('0x66')](_0x72cfe4[_0x26e1('0x44')],_0x261b27[_0x26e1('0x45')]));_0x512db1[_0x26e1('0x51')][_0x26e1('0x63')]=_0x5223d3['id'];if(_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x67')]){_0x512db1[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x512db1[_0x26e1('0x51')],{'$or':_['map'](_0x512db1[_0x26e1('0x47')],function(_0x195c4f){var _0x33dc81={};_0x33dc81[_0x195c4f]={'$like':'%'+_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x67')]+'%'};return _0x33dc81;})});}_0x512db1=_[_0x26e1('0x4e')]({},_0x512db1,_0x72cfe4['options']);return db[_0x26e1('0x8c')][_0x26e1('0x2d')]({'where':_0x512db1['where']})[_0x26e1('0x21')](function(_0x3210ca){_0x26b53d[_0x26e1('0x2d')]=_0x3210ca;if(_0x72cfe4[_0x26e1('0x44')][_0x26e1('0x52')]){_0x512db1[_0x26e1('0x53')]=[{'model':db['CmContact'],'as':_0x26e1('0xab'),'required':![]},{'model':db[_0x26e1('0x98')],'as':'Owner','attributes':[_0x26e1('0x3b'),_0x26e1('0xac'),_0x26e1('0xad')],'required':![]},{'model':db[_0x26e1('0xae')],'as':_0x26e1('0xaf'),'attributes':['id',_0x26e1('0x3b'),'color'],'where':_0x72cfe4[_0x26e1('0x44')]['tag']?{'id':_0x72cfe4[_0x26e1('0x44')][_0x26e1('0xb0')]}:undefined,'required':_0x72cfe4[_0x26e1('0x44')][_0x26e1('0xb0')]?!![]:![]}];}return db[_0x26e1('0x8c')][_0x26e1('0x55')](_0x512db1);})[_0x26e1('0x21')](function(_0x3a3964){_0x26b53d[_0x26e1('0x56')]=_0x3a3964;return _0x26b53d;});}})[_0x26e1('0x21')](respondWithFilteredResult(_0xf52d05,_0x512db1))['catch'](handleError(_0xf52d05,null));};exports['addAgents']=function(_0xa3042,_0x336c45,_0x16d0ce){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0xa3042[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x336c45,null))['then'](function(_0x2ef313){if(_0x2ef313){return _0x2ef313[_0x26e1('0xb1')](_0xa3042[_0x26e1('0x5b')][_0x26e1('0x6a')],_['omit'](_0xa3042[_0x26e1('0x5b')],[_0x26e1('0x6a'),'id'])||{})[_0x26e1('0x8d')](function(_0x591d05){for(var _0x5872a2=0x0;_0x5872a2<_0xa3042[_0x26e1('0x5b')][_0x26e1('0x6a')][_0x26e1('0x49')];_0x5872a2+=0x1){socket[_0x26e1('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0xa3042[_0x26e1('0x5b')]['ids'][_0x5872a2]),'OpenchannelAccountId':Number(_0xa3042[_0x26e1('0x60')]['id'])});}return _0x591d05;});}})[_0x26e1('0x21')](respondWithResult(_0x336c45,null))['catch'](handleError(_0x336c45,null));};exports[_0x26e1('0xb3')]=function(_0x26a9dd,_0x3a5d2a,_0x1334e2){return db[_0x26e1('0x54')][_0x26e1('0x59')]({'where':{'id':_0x26a9dd[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x3a5d2a,null))[_0x26e1('0x21')](function(_0x4c73b0){if(_0x4c73b0){return _0x4c73b0[_0x26e1('0xb3')](_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')])[_0x26e1('0x21')](function(){if(_['isArray'](_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')])){for(var _0x269416=0x0;_0x269416<_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')]['length'];_0x269416+=0x1){socket['emit'](_0x26e1('0xb4'),{'UserId':Number(_0x26a9dd[_0x26e1('0x44')][_0x26e1('0x6a')][_0x269416]),'OpenchannelAccountId':Number(_0x26a9dd[_0x26e1('0x60')]['id'])});}}else{socket[_0x26e1('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x26a9dd['query'][_0x26e1('0x6a')]),'OpenchannelAccountId':Number(_0x26a9dd[_0x26e1('0x60')]['id'])});}});}})[_0x26e1('0x21')](respondWithStatusCode(_0x3a5d2a,null))[_0x26e1('0x29')](handleError(_0x3a5d2a,null));};exports['getAgents']=function(_0x320b6e,_0x29ec4a,_0x5ad465){var _0x4db5b2={};var _0x139411={};var _0x5d2e78;var _0x4d6edf;return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x320b6e[_0x26e1('0x60')]['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x29ec4a,null))[_0x26e1('0x21')](function(_0xa40054){if(_0xa40054){_0x5d2e78=_0xa40054;_0x139411[_0x26e1('0x43')]=_[_0x26e1('0x58')](db[_0x26e1('0x98')][_0x26e1('0x3f')]);_0x139411[_0x26e1('0x44')]=_[_0x26e1('0x58')](_0x320b6e[_0x26e1('0x44')]);_0x139411[_0x26e1('0x45')]=_[_0x26e1('0x46')](_0x139411[_0x26e1('0x43')],_0x139411['query']);_0x4db5b2['attributes']=_[_0x26e1('0x46')](_0x139411[_0x26e1('0x43')],qs['fields'](_0x320b6e[_0x26e1('0x44')][_0x26e1('0x48')]));_0x4db5b2[_0x26e1('0x47')]=_0x4db5b2[_0x26e1('0x47')][_0x26e1('0x49')]?_0x4db5b2['attributes']:_0x139411['model'];_0x4db5b2['order']=qs[_0x26e1('0x4d')](_0x320b6e['query']['sort']);_0x4db5b2['where']=qs[_0x26e1('0x45')](_['pick'](_0x320b6e[_0x26e1('0x44')],_0x139411[_0x26e1('0x45')]));if(_0x320b6e['query']['filter']){_0x4db5b2[_0x26e1('0x51')]=_[_0x26e1('0x4e')](_0x4db5b2['where'],{'$or':_[_0x26e1('0x3e')](_0x4db5b2[_0x26e1('0x47')],function(_0x55cbdf){var _0x1c31a5={};_0x1c31a5[_0x55cbdf]={'$like':'%'+_0x320b6e[_0x26e1('0x44')][_0x26e1('0x67')]+'%'};return _0x1c31a5;})});}_0x4db5b2=_[_0x26e1('0x4e')]({},_0x4db5b2,_0x320b6e[_0x26e1('0x50')]);return _0x5d2e78['getAgents'](_0x4db5b2);}})[_0x26e1('0x21')](function(_0x219dd3){if(_0x219dd3){_0x4d6edf=_0x219dd3[_0x26e1('0x49')];if(!_0x320b6e[_0x26e1('0x44')]['hasOwnProperty'](_0x26e1('0x4b'))){_0x4db5b2[_0x26e1('0x2f')]=qs[_0x26e1('0x2f')](_0x320b6e[_0x26e1('0x44')][_0x26e1('0x2f')]);_0x4db5b2['offset']=qs[_0x26e1('0x2e')](_0x320b6e[_0x26e1('0x44')]['offset']);}return _0x5d2e78[_0x26e1('0xb5')](_0x4db5b2);}})[_0x26e1('0x21')](function(_0x305dae){if(_0x305dae){return _0x305dae?{'count':_0x4d6edf,'rows':_0x305dae}:null;}})[_0x26e1('0x21')](respondWithResult(_0x29ec4a,null))[_0x26e1('0x29')](handleError(_0x29ec4a,null));};exports[_0x26e1('0xa8')]=function(_0x5ca4bb,_0x5f0f0c,_0x573b11){var _0x19fb2e,_0x4b4d51,_0x1f59ff;if(_[_0x26e1('0x79')](_0x5ca4bb[_0x26e1('0x5b')][_0x26e1('0x5b')])||_0x5ca4bb['body'][_0x26e1('0x5b')]===''){throw new db['Sequelize'][(_0x26e1('0x72'))](_0x26e1('0x7b'));}if(_[_0x26e1('0x79')](_0x5ca4bb[_0x26e1('0x5b')]['to'])){}_0x19fb2e=_0x5ca4bb[_0x26e1('0x5b')]['to'];return db[_0x26e1('0x54')][_0x26e1('0x65')]({'where':{'id':_0x5ca4bb['params']['id']}})[_0x26e1('0x21')](handleEntityNotFound(_0x5f0f0c,null))[_0x26e1('0x21')](function(_0x5be42f){if(_0x5be42f){return db['OpenchannelAccount']['find']({'where':{'id':_0x5be42f['id']},'include':[{'model':db[_0x26e1('0xb6')],'as':_0x26e1('0x82'),'include':[{'model':db[_0x26e1('0x70')],'as':_0x26e1('0x7f'),'where':{[_0x5be42f[_0x26e1('0x7c')]]:_0x19fb2e},'limit':0x1,'order':[[_0x26e1('0x76'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5f0f0c,null))[_0x26e1('0x21')](function(_0xf632e1){if(_0xf632e1&&_0xf632e1['List']){_0x4b4d51=_0xf632e1['get']({'plain':!![]});if(_0x4b4d51[_0x26e1('0x82')]&&_0x4b4d51[_0x26e1('0x82')][_0x26e1('0x7f')][_0x26e1('0x49')]){return _0x4b4d51[_0x26e1('0x82')][_0x26e1('0x7f')][0x0];}return db[_0x26e1('0x70')]['create'](_['defaults'](_0x5ca4bb[_0x26e1('0x5b')],{'firstName':_0x19fb2e,[_0xf632e1[_0x26e1('0x7c')]]:_0x19fb2e,'phone':_0x19fb2e,'ListId':_0x4b4d51[_0x26e1('0x78')]}));}})[_0x26e1('0x21')](handleEntityNotFound(_0x5f0f0c,null))['then'](function(_0x315bda){if(_0x315bda){_0x1f59ff=_0x315bda;return db[_0x26e1('0x8c')][_0x26e1('0x59')]({'where':{'ContactId':_0x1f59ff['id'],'closed':![],'OpenchannelAccountId':_0x4b4d51['id']}})[_0x26e1('0x21')](function(_0x166100){if(_0x166100){return[_0x166100,![]];}return db['OpenchannelInteraction'][_0x26e1('0x5a')]({'UserId':_0x5ca4bb[_0x26e1('0x5c')]['id'],'ContactId':_0x1f59ff['id'],'OpenchannelAccountId':_0x4b4d51['id'],'lastMsgDirection':_0x26e1('0xb7'),'firstMsgDirection':_0x26e1('0xb7'),'Messages':[_[_0x26e1('0x4e')](_0x5ca4bb[_0x26e1('0x5b')],{'read':![],'body':_0x5ca4bb['body'][_0x26e1('0x5b')],'OpenchannelAccountId':_0x4b4d51['id'],'UserId':_0x5ca4bb[_0x26e1('0x5c')]['id'],'ContactId':_0x1f59ff['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x26e1('0xb8')}]})['then'](function(_0x176d1a){return[_0x176d1a,!![]];});});}})[_0x26e1('0x8d')](function(_0x47910b,_0x4ae455){if(_0x4ae455){return _0x47910b;}return db[_0x26e1('0x95')][_0x26e1('0x5a')](_[_0x26e1('0x4e')](_0x5ca4bb[_0x26e1('0x5b')],{'read':![],'body':_0x5ca4bb[_0x26e1('0x5b')][_0x26e1('0x5b')],'OpenchannelAccountId':_0x4b4d51['id'],'OpenchannelInteractionId':_0x47910b['id'],'UserId':_0x5ca4bb[_0x26e1('0x5c')]['id'],'ContactId':_0x1f59ff['id']}))[_0x26e1('0x21')](function(_0x4c6385){_0x47910b[_0x26e1('0xb9')][_0x26e1('0xb8')]=[];_0x47910b[_0x26e1('0xb9')][_0x26e1('0xb8')][_0x26e1('0x92')](_0x4c6385[_0x26e1('0xb9')]);return _0x47910b;});});}})[_0x26e1('0x21')](respondWithResult(_0x5f0f0c,null))[_0x26e1('0x29')](handleError(_0x5f0f0c,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e2ed4e1..fe8be09 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x702d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x120cb1,_0xc99756){var _0x3b8c62=function(_0x45c227){while(--_0x45c227){_0x120cb1['push'](_0x120cb1['shift']());}};_0x3b8c62(++_0xc99756);}(_0x702d,0x147));var _0xd702=function(_0x414aee,_0x3df62e){_0x414aee=_0x414aee-0x0;var _0x2b42cb=_0x702d[_0x414aee];return _0x2b42cb;};'use strict';var EventEmitter=require(_0xd702('0x0'));var OpenchannelAccount=require(_0xd702('0x1'))['db'][_0xd702('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd702('0x3')](0x0);var events={'afterCreate':_0xd702('0x4'),'afterUpdate':'update','afterDestroy':_0xd702('0x5')};function emitEvent(_0xebbd7c){return function(_0x27b260,_0x1c5a32,_0x481ee0){OpenchannelAccountEvents[_0xd702('0x6')](_0xebbd7c+':'+_0x27b260['id'],_0x27b260);OpenchannelAccountEvents['emit'](_0xebbd7c,_0x27b260);_0x481ee0(null);};}for(var e in events){if(events[_0xd702('0x7')](e)){var event=events[e];OpenchannelAccount[_0xd702('0x8')](e,emitEvent(event));}}module[_0xd702('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x3c81=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x55c3d9,_0x3bf75c){var _0x19fd97=function(_0x2b0205){while(--_0x2b0205){_0x55c3d9['push'](_0x55c3d9['shift']());}};_0x19fd97(++_0x3bf75c);}(_0x3c81,0x102));var _0x13c8=function(_0x1b4a3c,_0x427ffb){_0x1b4a3c=_0x1b4a3c-0x0;var _0x7ce04=_0x3c81[_0x1b4a3c];return _0x7ce04;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var OpenchannelAccount=require(_0x13c8('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x13c8('0x2')](0x0);var events={'afterCreate':_0x13c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c3ba4){return function(_0x548599,_0x101d4f,_0x3ec886){OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4+':'+_0x548599['id'],_0x548599);OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4,_0x548599);_0x3ec886(null);};}for(var e in events){if(events[_0x13c8('0x5')](e)){var event=events[e];OpenchannelAccount[_0x13c8('0x6')](e,emitEvent(event));}}module[_0x13c8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 64a30a5..bd57824 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(_0x59bbe8,_0x51c4b9){var _0x118cd8=function(_0x331fc3){while(--_0x331fc3){_0x59bbe8['push'](_0x59bbe8['shift']());}};_0x118cd8(++_0x51c4b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4677d1,_0xf2e220){var _0x29370a=function(_0x398fea){while(--_0x398fea){_0x4677d1['push'](_0x4677d1['shift']());}};_0x29370a(++_0xf2e220);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 4db0c5b..77f0e04 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 _0x705f=['jayson/promise','client','http','redis','localhost','./openchannelAccount.socket','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x13812c,_0x26a19c){var _0x1f3762=function(_0x3a746b){while(--_0x3a746b){_0x13812c['push'](_0x13812c['shift']());}};_0x1f3762(++_0x26a19c);}(_0x705f,0x75));var _0xf705=function(_0x2700d5,_0x1b113b){_0x2700d5=_0x2700d5-0x0;var _0xdc3338=_0x705f[_0x2700d5];return _0xdc3338;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf705('0x0'));var BPromise=require('bluebird');var rs=require(_0xf705('0x1'));var fs=require('fs');var Redis=require(_0xf705('0x2'));var db=require(_0xf705('0x3'))['db'];var utils=require(_0xf705('0x4'));var logger=require(_0xf705('0x5'))(_0xf705('0x6'));var config=require(_0xf705('0x7'));var jayson=require(_0xf705('0x8'));var client=jayson[_0xf705('0x9')][_0xf705('0xa')]({'port':0x232a});config[_0xf705('0xb')]=_['defaults'](config['redis'],{'host':_0xf705('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf705('0xb')]));require(_0xf705('0xd'))['register'](socket);function respondWithRpcPromise(_0x4bd6fd,_0x1f9ab1,_0xc6fbde){return new BPromise(function(_0xfe67fe,_0x45316b){return client[_0xf705('0xe')](_0x4bd6fd,_0xc6fbde)[_0xf705('0xf')](function(_0x13db14){logger[_0xf705('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x1f9ab1,_0xf705('0x11'));logger[_0xf705('0x12')](_0xf705('0x13'),_0x1f9ab1,_0xf705('0x11'),JSON[_0xf705('0x14')](_0x13db14));if(_0x13db14['error']){if(_0x13db14['error'][_0xf705('0x15')]===0x1f4){logger[_0xf705('0x16')](_0xf705('0x17'),_0x1f9ab1,_0x13db14[_0xf705('0x16')]['message']);return _0x45316b(_0x13db14[_0xf705('0x16')][_0xf705('0x18')]);}logger[_0xf705('0x16')](_0xf705('0x17'),_0x1f9ab1,_0x13db14['error'][_0xf705('0x18')]);return _0xfe67fe(_0x13db14['error'][_0xf705('0x18')]);}else{logger[_0xf705('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x1f9ab1,_0xf705('0x11'));_0xfe67fe(_0x13db14['result'][_0xf705('0x18')]);}})['catch'](function(_0x57d537){logger[_0xf705('0x16')](_0xf705('0x17'),_0x1f9ab1,_0x57d537);_0x45316b(_0x57d537);});});} \ No newline at end of file +var _0xd139=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','register','request','then','request\x20sent'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xd139,0x14e));var _0x9d13=function(_0x1dac40,_0x37c55c){_0x1dac40=_0x1dac40-0x0;var _0x400136=_0xd139[_0x1dac40];return _0x400136;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});config['redis']=_[_0x9d13('0xb')](config['redis'],{'host':_0x9d13('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x9d13('0xd')](socket);function respondWithRpcPromise(_0xba5caa,_0x41eef2,_0x51ac36){return new BPromise(function(_0x135232,_0x5aa0c8){return client[_0x9d13('0xe')](_0xba5caa,_0x51ac36)[_0x9d13('0xf')](function(_0x43a3cc){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x41eef2,_0x9d13('0x10'));logger[_0x9d13('0x11')](_0x9d13('0x12'),_0x41eef2,_0x9d13('0x10'),JSON[_0x9d13('0x13')](_0x43a3cc));if(_0x43a3cc['error']){if(_0x43a3cc['error'][_0x9d13('0x14')]===0x1f4){logger[_0x9d13('0x15')](_0x9d13('0x16'),_0x41eef2,_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);return _0x5aa0c8(_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);}logger['error'](_0x9d13('0x16'),_0x41eef2,_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);return _0x135232(_0x43a3cc[_0x9d13('0x15')][_0x9d13('0x17')]);}else{logger[_0x9d13('0x18')](_0x9d13('0x16'),_0x41eef2,_0x9d13('0x10'));_0x135232(_0x43a3cc[_0x9d13('0x19')][_0x9d13('0x17')]);}})[_0x9d13('0x1a')](function(_0x38acaf){logger[_0x9d13('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x41eef2,_0x38acaf);_0x5aa0c8(_0x38acaf);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 30aac75..7353cef 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 _0x0506=['emit','length','openchannelAccount:','./openchannelAccount.events','save','remove'];(function(_0xf157d8,_0x413e94){var _0x8f4dcb=function(_0x336b58){while(--_0x336b58){_0xf157d8['push'](_0xf157d8['shift']());}};_0x8f4dcb(++_0x413e94);}(_0x0506,0x1d1));var _0x6050=function(_0x3948e0,_0x18eacf){_0x3948e0=_0x3948e0-0x0;var _0x3c01db=_0x0506[_0x3948e0];return _0x3c01db;};'use strict';var OpenchannelAccountEvents=require(_0x6050('0x0'));var events=[_0x6050('0x1'),_0x6050('0x2'),'update'];function createListener(_0x52f82b,_0x5139c7){return function(_0x49a1ca){_0x5139c7[_0x6050('0x3')](_0x52f82b,_0x49a1ca);};}function removeListener(_0x58e2a9,_0x3cbb1f){return function(){OpenchannelAccountEvents['removeListener'](_0x58e2a9,_0x3cbb1f);};}exports['register']=function(_0xfd44cc){for(var _0x269be3=0x0,_0x2a3644=events[_0x6050('0x4')];_0x269be3<_0x2a3644;_0x269be3++){var _0x3512ba=events[_0x269be3];var _0xf64de5=createListener(_0x6050('0x5')+_0x3512ba,_0xfd44cc);OpenchannelAccountEvents['on'](_0x3512ba,_0xf64de5);}}; \ No newline at end of file +var _0xfa7c=['remove','update','emit','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x4e8401,_0x51b328){var _0x17269f=function(_0x35ac65){while(--_0x35ac65){_0x4e8401['push'](_0x4e8401['shift']());}};_0x17269f(++_0x51b328);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x4792d7,_0x1be61a){_0x4792d7=_0x4792d7-0x0;var _0x4c1c9f=_0xfa7c[_0x4792d7];return _0x4c1c9f;};'use strict';var OpenchannelAccountEvents=require(_0xcfa7('0x0'));var events=['save',_0xcfa7('0x1'),_0xcfa7('0x2')];function createListener(_0x252259,_0x1d6921){return function(_0x19beaf){_0x1d6921[_0xcfa7('0x3')](_0x252259,_0x19beaf);};}function removeListener(_0x45411c,_0x1f671b){return function(){OpenchannelAccountEvents['removeListener'](_0x45411c,_0x1f671b);};}exports[_0xcfa7('0x4')]=function(_0x3bf816){for(var _0x9d96a2=0x0,_0x1d5f85=events['length'];_0x9d96a2<_0x1d5f85;_0x9d96a2++){var _0x816590=events[_0x9d96a2];var _0x573432=createListener(_0xcfa7('0x5')+_0x816590,_0x3bf816);OpenchannelAccountEvents['on'](_0x816590,_0x573432);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4e61049..b6c8ae5 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 _0x12a6=['./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21fc65,_0x421fbe){var _0x5042aa=function(_0x4b412a){while(--_0x4b412a){_0x21fc65['push'](_0x21fc65['shift']());}};_0x5042aa(++_0x421fbe);}(_0x12a6,0x1e7));var _0x612a=function(_0x3705f7,_0x2553c4){_0x3705f7=_0x3705f7-0x0;var _0x2a1cf2=_0x12a6[_0x3705f7];return _0x2a1cf2;};'use strict';var multer=require('multer');var util=require(_0x612a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x612a('0x1'));var router=express[_0x612a('0x2')]();var fs_extra=require(_0x612a('0x3'));var auth=require(_0x612a('0x4'));var interaction=require(_0x612a('0x5'));var config=require(_0x612a('0x6'));var controller=require(_0x612a('0x7'));router[_0x612a('0x8')]('/',auth[_0x612a('0x9')](),controller[_0x612a('0xa')]);router[_0x612a('0x8')](_0x612a('0xb'),auth[_0x612a('0x9')](),controller[_0x612a('0xc')]);router[_0x612a('0xd')]('/',auth['isAuthenticated'](),controller[_0x612a('0xe')]);router[_0x612a('0xf')]('/:id',auth[_0x612a('0x9')](),controller[_0x612a('0x10')]);router[_0x612a('0x11')](_0x612a('0xb'),auth[_0x612a('0x9')](),controller['destroy']);module[_0x612a('0x12')]=router; \ No newline at end of file +var _0xecee=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x59056b,_0x4f5327){var _0x582465=function(_0x30233b){while(--_0x30233b){_0x59056b['push'](_0x59056b['shift']());}};_0x582465(++_0x4f5327);}(_0xecee,0x1f1));var _0xeece=function(_0x373e27,_0x1f1634){_0x373e27=_0x373e27-0x0;var _0x439431=_0xecee[_0x373e27];return _0x439431;};'use strict';var multer=require(_0xeece('0x0'));var util=require('util');var path=require(_0xeece('0x1'));var timeout=require(_0xeece('0x2'));var express=require(_0xeece('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeece('0x4'));var interaction=require(_0xeece('0x5'));var config=require(_0xeece('0x6'));var controller=require('./openchannelApplication.controller');router[_0xeece('0x7')]('/',auth[_0xeece('0x8')](),controller[_0xeece('0x9')]);router[_0xeece('0x7')](_0xeece('0xa'),auth[_0xeece('0x8')](),controller[_0xeece('0xb')]);router[_0xeece('0xc')]('/',auth[_0xeece('0x8')](),controller[_0xeece('0xd')]);router[_0xeece('0xe')](_0xeece('0xa'),auth[_0xeece('0x8')](),controller[_0xeece('0xf')]);router[_0xeece('0x10')](_0xeece('0xa'),auth[_0xeece('0x8')](),controller[_0xeece('0x11')]);module[_0xeece('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d3e4912..7c3c3a8 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 _0x5ec0=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0x5ec0,0xc7));var _0x05ec=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5ec0[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x05ec('0x0'));module[_0x05ec('0x1')]={'priority':{'type':Sequelize[_0x05ec('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x05ec('0x3')],'allowNull':![],'defaultValue':_0x05ec('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x05ec('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x05ec('0x5')}}; \ No newline at end of file +var _0xc5e7=['INTEGER','STRING'];(function(_0x187cbd,_0x5ced7d){var _0x414e34=function(_0x137e72){while(--_0x137e72){_0x187cbd['push'](_0x187cbd['shift']());}};_0x414e34(++_0x5ced7d);}(_0xc5e7,0x1c0));var _0x7c5e=function(_0x379606,_0x203819){_0x379606=_0x379606-0x0;var _0x4f5f05=_0xc5e7[_0x379606];return _0x4f5f05;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x7c5e('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x7c5e('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7c5e('0x1')]},'interval':{'type':Sequelize[_0x7c5e('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 8fff3c4..8b2adf8 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 _0x1f95=['reject','destroy','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply'];(function(_0x503a18,_0x16d952){var _0x288633=function(_0x586b54){while(--_0x586b54){_0x503a18['push'](_0x503a18['shift']());}};_0x288633(++_0x16d952);}(_0x1f95,0x154));var _0x51f9=function(_0x3188bc,_0x22fd90){_0x3188bc=_0x3188bc-0x0;var _0x2906f7=_0x1f95[_0x3188bc];return _0x2906f7;};'use strict';var emlformat=require(_0x51f9('0x0'));var rimraf=require(_0x51f9('0x1'));var zipdir=require(_0x51f9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51f9('0x3'));var moment=require(_0x51f9('0x4'));var BPromise=require(_0x51f9('0x5'));var Mustache=require(_0x51f9('0x6'));var util=require(_0x51f9('0x7'));var path=require(_0x51f9('0x8'));var sox=require(_0x51f9('0x9'));var csv=require('to-csv');var ejs=require(_0x51f9('0xa'));var fs=require('fs');var fs_extra=require(_0x51f9('0xb'));var _=require(_0x51f9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51f9('0xd'));var deskjs=require(_0x51f9('0xe'));var toCsv=require(_0x51f9('0xf'));var querystring=require(_0x51f9('0x10'));var Papa=require('papaparse');var Redis=require(_0x51f9('0x11'));var authService=require(_0x51f9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x51f9('0x13'));var hardwareService=require(_0x51f9('0x14'));var logger=require(_0x51f9('0x15'))('api');var utils=require(_0x51f9('0x16'));var config=require(_0x51f9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x51f9('0x18'))['db'];function respondWithStatusCode(_0x20dc36,_0x7fb933){_0x7fb933=_0x7fb933||0xcc;return function(_0x22ede0){if(_0x22ede0){return _0x20dc36[_0x51f9('0x19')](_0x7fb933);}return _0x20dc36['status'](_0x7fb933)[_0x51f9('0x1a')]();};}function respondWithResult(_0x37539c,_0x2ce36c){_0x2ce36c=_0x2ce36c||0xc8;return function(_0x359a37){if(_0x359a37){return _0x37539c[_0x51f9('0x1b')](_0x2ce36c)[_0x51f9('0x1c')](_0x359a37);}};}function respondWithFilteredResult(_0x2cc547,_0x24ed0a){return function(_0x2461f9){if(_0x2461f9){var _0x5bfea1=typeof _0x24ed0a['offset']===_0x51f9('0x1d')&&typeof _0x24ed0a[_0x51f9('0x1e')]===_0x51f9('0x1d');var _0x5c6bd7=_0x2461f9[_0x51f9('0x1f')];var _0x487321=_0x5bfea1?0x0:_0x24ed0a[_0x51f9('0x20')];var _0x28306e=_0x5bfea1?_0x2461f9[_0x51f9('0x1f')]:_0x24ed0a[_0x51f9('0x20')]+_0x24ed0a['limit'];var _0x4e8551;if(_0x28306e>=_0x5c6bd7){_0x28306e=_0x5c6bd7;_0x4e8551=0xc8;}else{_0x4e8551=0xce;}_0x2cc547['status'](_0x4e8551);return _0x2cc547['set'](_0x51f9('0x21'),_0x487321+'-'+_0x28306e+'/'+_0x5c6bd7)[_0x51f9('0x1c')](_0x2461f9);}return null;};}function patchUpdates(_0x5cdd0d){return function(_0xb4575e){try{jsonpatch[_0x51f9('0x22')](_0xb4575e,_0x5cdd0d,!![]);}catch(_0x2fe00f){return BPromise[_0x51f9('0x23')](_0x2fe00f);}return _0xb4575e['save']();};}function saveUpdates(_0x87a025,_0x4faba9){return function(_0x4d8087){if(_0x4d8087){return _0x4d8087['update'](_0x87a025)['then'](function(_0x3f651e){return _0x3f651e;});}return null;};}function removeEntity(_0x2a9d5e,_0x37e17f){return function(_0xcfd35c){if(_0xcfd35c){return _0xcfd35c[_0x51f9('0x24')]()[_0x51f9('0x25')](function(){_0x2a9d5e[_0x51f9('0x1b')](0xcc)[_0x51f9('0x1a')]();});}};}function handleEntityNotFound(_0x2738d3,_0x24dfe9){return function(_0x514d38){if(!_0x514d38){_0x2738d3['sendStatus'](0x194);}return _0x514d38;};}function handleError(_0x317efd,_0x267b42){_0x267b42=_0x267b42||0x1f4;return function(_0x229214){logger[_0x51f9('0x26')](_0x229214[_0x51f9('0x27')]);if(_0x229214['name']){delete _0x229214[_0x51f9('0x28')];}_0x317efd['status'](_0x267b42)[_0x51f9('0x29')](_0x229214);};}exports[_0x51f9('0x2a')]=function(_0x1061a3,_0x2f49cb){var _0x1c4379={},_0x7b2226={},_0x18516d={'count':0x0,'rows':[]};var _0x550f02=_[_0x51f9('0x2b')](db[_0x51f9('0x2c')][_0x51f9('0x2d')],function(_0x395f64){return{'name':_0x395f64['fieldName'],'type':_0x395f64[_0x51f9('0x2e')][_0x51f9('0x2f')]};});_0x7b2226[_0x51f9('0x30')]=_[_0x51f9('0x2b')](_0x550f02,_0x51f9('0x28'));_0x7b2226[_0x51f9('0x31')]=_[_0x51f9('0x32')](_0x1061a3[_0x51f9('0x31')]);_0x7b2226[_0x51f9('0x33')]=_[_0x51f9('0x34')](_0x7b2226['model'],_0x7b2226['query']);_0x1c4379[_0x51f9('0x35')]=_['intersection'](_0x7b2226[_0x51f9('0x30')],qs[_0x51f9('0x36')](_0x1061a3[_0x51f9('0x31')][_0x51f9('0x36')]));_0x1c4379[_0x51f9('0x35')]=_0x1c4379[_0x51f9('0x35')]['length']?_0x1c4379[_0x51f9('0x35')]:_0x7b2226['model'];if(!_0x1061a3[_0x51f9('0x31')][_0x51f9('0x37')](_0x51f9('0x38'))){_0x1c4379[_0x51f9('0x1e')]=qs[_0x51f9('0x1e')](_0x1061a3['query']['limit']);_0x1c4379[_0x51f9('0x20')]=qs[_0x51f9('0x20')](_0x1061a3[_0x51f9('0x31')][_0x51f9('0x20')]);}_0x1c4379[_0x51f9('0x39')]=qs[_0x51f9('0x3a')](_0x1061a3[_0x51f9('0x31')][_0x51f9('0x3a')]);_0x1c4379[_0x51f9('0x3b')]=qs[_0x51f9('0x33')](_[_0x51f9('0x3c')](_0x1061a3[_0x51f9('0x31')],_0x7b2226[_0x51f9('0x33')]),_0x550f02);if(_0x1061a3[_0x51f9('0x31')][_0x51f9('0x3d')]){_0x1c4379[_0x51f9('0x3b')]=_[_0x51f9('0x3e')](_0x1c4379[_0x51f9('0x3b')],{'$or':_['map'](_0x550f02,function(_0x28f6ef){if(_0x28f6ef[_0x51f9('0x2e')]!==_0x51f9('0x3f')){var _0x144a1b={};_0x144a1b[_0x28f6ef[_0x51f9('0x28')]]={'$like':'%'+_0x1061a3[_0x51f9('0x31')][_0x51f9('0x3d')]+'%'};return _0x144a1b;}})});}_0x1c4379=_[_0x51f9('0x3e')]({},_0x1c4379,_0x1061a3[_0x51f9('0x40')]);var _0x2eab80={'where':_0x1c4379[_0x51f9('0x3b')]};return db[_0x51f9('0x2c')]['count'](_0x2eab80)[_0x51f9('0x25')](function(_0x589a4f){_0x18516d[_0x51f9('0x1f')]=_0x589a4f;if(_0x1061a3[_0x51f9('0x31')]['includeAll']){_0x1c4379['include']=[{'all':!![]}];}return db[_0x51f9('0x2c')][_0x51f9('0x41')](_0x1c4379);})[_0x51f9('0x25')](function(_0x591568){_0x18516d[_0x51f9('0x42')]=_0x591568;return _0x18516d;})[_0x51f9('0x25')](respondWithFilteredResult(_0x2f49cb,_0x1c4379))[_0x51f9('0x43')](handleError(_0x2f49cb,null));};exports[_0x51f9('0x44')]=function(_0x4d66e7,_0x492b4c){var _0x5407cd={'raw':!![],'where':{'id':_0x4d66e7[_0x51f9('0x45')]['id']}},_0x167482={};_0x167482[_0x51f9('0x30')]=_[_0x51f9('0x32')](db[_0x51f9('0x2c')][_0x51f9('0x2d')]);_0x167482['query']=_[_0x51f9('0x32')](_0x4d66e7['query']);_0x167482[_0x51f9('0x33')]=_['intersection'](_0x167482['model'],_0x167482[_0x51f9('0x31')]);_0x5407cd[_0x51f9('0x35')]=_[_0x51f9('0x34')](_0x167482[_0x51f9('0x30')],qs[_0x51f9('0x36')](_0x4d66e7['query'][_0x51f9('0x36')]));_0x5407cd[_0x51f9('0x35')]=_0x5407cd[_0x51f9('0x35')][_0x51f9('0x46')]?_0x5407cd['attributes']:_0x167482['model'];if(_0x4d66e7[_0x51f9('0x31')]['includeAll']){_0x5407cd[_0x51f9('0x47')]=[{'all':!![]}];}_0x5407cd=_[_0x51f9('0x3e')]({},_0x5407cd,_0x4d66e7[_0x51f9('0x40')]);return db[_0x51f9('0x2c')][_0x51f9('0x48')](_0x5407cd)[_0x51f9('0x25')](handleEntityNotFound(_0x492b4c,null))[_0x51f9('0x25')](respondWithResult(_0x492b4c,null))[_0x51f9('0x43')](handleError(_0x492b4c,null));};exports[_0x51f9('0x49')]=function(_0x39ee8,_0x5e5338){return db[_0x51f9('0x2c')]['create'](_0x39ee8['body'],{})[_0x51f9('0x25')](respondWithResult(_0x5e5338,0xc9))['catch'](handleError(_0x5e5338,null));};exports['update']=function(_0x19d3d6,_0x41c49a){if(_0x19d3d6[_0x51f9('0x4a')]['id']){delete _0x19d3d6['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x19d3d6[_0x51f9('0x45')]['id']}})[_0x51f9('0x25')](handleEntityNotFound(_0x41c49a,null))[_0x51f9('0x25')](saveUpdates(_0x19d3d6['body'],null))[_0x51f9('0x25')](respondWithResult(_0x41c49a,null))[_0x51f9('0x43')](handleError(_0x41c49a,null));};exports[_0x51f9('0x24')]=function(_0x5aeda1,_0x51b5a6){return db[_0x51f9('0x2c')][_0x51f9('0x48')]({'where':{'id':_0x5aeda1[_0x51f9('0x45')]['id']}})[_0x51f9('0x25')](handleEntityNotFound(_0x51b5a6,null))[_0x51f9('0x25')](removeEntity(_0x51b5a6,null))[_0x51f9('0x43')](handleError(_0x51b5a6,null));}; \ No newline at end of file +var _0x3c72=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','update','body','eml-format','rimraf','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','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x120a55,_0x4ad4b3){var _0x1b074c=function(_0x21ce44){while(--_0x21ce44){_0x120a55['push'](_0x120a55['shift']());}};_0x1b074c(++_0x4ad4b3);}(_0x3c72,0x1ab));var _0x23c7=function(_0x4ed90f,_0x1efc5f){_0x4ed90f=_0x4ed90f-0x0;var _0x232cbb=_0x3c72[_0x4ed90f];return _0x232cbb;};'use strict';var emlformat=require(_0x23c7('0x0'));var rimraf=require(_0x23c7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x23c7('0x2'));var rp=require(_0x23c7('0x3'));var moment=require('moment');var BPromise=require(_0x23c7('0x4'));var Mustache=require(_0x23c7('0x5'));var util=require(_0x23c7('0x6'));var path=require(_0x23c7('0x7'));var sox=require(_0x23c7('0x8'));var csv=require(_0x23c7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23c7('0xa'));var _=require(_0x23c7('0xb'));var squel=require(_0x23c7('0xc'));var crypto=require(_0x23c7('0xd'));var jsforce=require(_0x23c7('0xe'));var deskjs=require(_0x23c7('0xf'));var toCsv=require(_0x23c7('0x9'));var querystring=require(_0x23c7('0x10'));var Papa=require('papaparse');var Redis=require(_0x23c7('0x11'));var authService=require(_0x23c7('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23c7('0x13'));var logger=require('../../config/logger')(_0x23c7('0x14'));var utils=require(_0x23c7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x23c7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5443db,_0x2c68ac){_0x2c68ac=_0x2c68ac||0xcc;return function(_0x29035b){if(_0x29035b){return _0x5443db[_0x23c7('0x17')](_0x2c68ac);}return _0x5443db[_0x23c7('0x18')](_0x2c68ac)[_0x23c7('0x19')]();};}function respondWithResult(_0x298499,_0x4383fb){_0x4383fb=_0x4383fb||0xc8;return function(_0x3a164a){if(_0x3a164a){return _0x298499[_0x23c7('0x18')](_0x4383fb)['json'](_0x3a164a);}};}function respondWithFilteredResult(_0x1003a3,_0x482c5f){return function(_0x2cfd65){if(_0x2cfd65){var _0x4997ea=typeof _0x482c5f[_0x23c7('0x1a')]===_0x23c7('0x1b')&&typeof _0x482c5f[_0x23c7('0x1c')]===_0x23c7('0x1b');var _0x499e64=_0x2cfd65[_0x23c7('0x1d')];var _0x2a127a=_0x4997ea?0x0:_0x482c5f[_0x23c7('0x1a')];var _0x49c50a=_0x4997ea?_0x2cfd65['count']:_0x482c5f[_0x23c7('0x1a')]+_0x482c5f['limit'];var _0x2b4172;if(_0x49c50a>=_0x499e64){_0x49c50a=_0x499e64;_0x2b4172=0xc8;}else{_0x2b4172=0xce;}_0x1003a3[_0x23c7('0x18')](_0x2b4172);return _0x1003a3['set'](_0x23c7('0x1e'),_0x2a127a+'-'+_0x49c50a+'/'+_0x499e64)[_0x23c7('0x1f')](_0x2cfd65);}return null;};}function patchUpdates(_0x2a2276){return function(_0x216439){try{jsonpatch[_0x23c7('0x20')](_0x216439,_0x2a2276,!![]);}catch(_0x1d4a3a){return BPromise['reject'](_0x1d4a3a);}return _0x216439[_0x23c7('0x21')]();};}function saveUpdates(_0x299fea,_0x395fe7){return function(_0x14b871){if(_0x14b871){return _0x14b871['update'](_0x299fea)[_0x23c7('0x22')](function(_0x844168){return _0x844168;});}return null;};}function removeEntity(_0xb1a587,_0xa44a9a){return function(_0x2c5ddd){if(_0x2c5ddd){return _0x2c5ddd[_0x23c7('0x23')]()[_0x23c7('0x22')](function(){_0xb1a587[_0x23c7('0x18')](0xcc)[_0x23c7('0x19')]();});}};}function handleEntityNotFound(_0x466dea,_0x1bade6){return function(_0x4dbf32){if(!_0x4dbf32){_0x466dea[_0x23c7('0x17')](0x194);}return _0x4dbf32;};}function handleError(_0x5908e8,_0x5275c8){_0x5275c8=_0x5275c8||0x1f4;return function(_0x5325f0){logger[_0x23c7('0x24')](_0x5325f0[_0x23c7('0x25')]);if(_0x5325f0[_0x23c7('0x26')]){delete _0x5325f0['name'];}_0x5908e8[_0x23c7('0x18')](_0x5275c8)[_0x23c7('0x27')](_0x5325f0);};}exports[_0x23c7('0x28')]=function(_0x24fc38,_0x5d0554){var _0x25982b={},_0x4518b2={},_0x3be62c={'count':0x0,'rows':[]};var _0x38b674=_[_0x23c7('0x29')](db[_0x23c7('0x2a')][_0x23c7('0x2b')],function(_0x4a107f){return{'name':_0x4a107f[_0x23c7('0x2c')],'type':_0x4a107f[_0x23c7('0x2d')][_0x23c7('0x2e')]};});_0x4518b2[_0x23c7('0x2f')]=_[_0x23c7('0x29')](_0x38b674,'name');_0x4518b2['query']=_[_0x23c7('0x30')](_0x24fc38[_0x23c7('0x31')]);_0x4518b2[_0x23c7('0x32')]=_['intersection'](_0x4518b2[_0x23c7('0x2f')],_0x4518b2[_0x23c7('0x31')]);_0x25982b['attributes']=_['intersection'](_0x4518b2[_0x23c7('0x2f')],qs['fields'](_0x24fc38[_0x23c7('0x31')][_0x23c7('0x33')]));_0x25982b[_0x23c7('0x34')]=_0x25982b[_0x23c7('0x34')][_0x23c7('0x35')]?_0x25982b[_0x23c7('0x34')]:_0x4518b2[_0x23c7('0x2f')];if(!_0x24fc38['query'][_0x23c7('0x36')](_0x23c7('0x37'))){_0x25982b['limit']=qs[_0x23c7('0x1c')](_0x24fc38['query'][_0x23c7('0x1c')]);_0x25982b['offset']=qs['offset'](_0x24fc38[_0x23c7('0x31')][_0x23c7('0x1a')]);}_0x25982b[_0x23c7('0x38')]=qs['sort'](_0x24fc38[_0x23c7('0x31')][_0x23c7('0x39')]);_0x25982b[_0x23c7('0x3a')]=qs[_0x23c7('0x32')](_[_0x23c7('0x3b')](_0x24fc38['query'],_0x4518b2[_0x23c7('0x32')]),_0x38b674);if(_0x24fc38[_0x23c7('0x31')][_0x23c7('0x3c')]){_0x25982b['where']=_[_0x23c7('0x3d')](_0x25982b[_0x23c7('0x3a')],{'$or':_['map'](_0x38b674,function(_0x3c5273){if(_0x3c5273[_0x23c7('0x2d')]!==_0x23c7('0x3e')){var _0x5da745={};_0x5da745[_0x3c5273['name']]={'$like':'%'+_0x24fc38[_0x23c7('0x31')][_0x23c7('0x3c')]+'%'};return _0x5da745;}})});}_0x25982b=_[_0x23c7('0x3d')]({},_0x25982b,_0x24fc38[_0x23c7('0x3f')]);var _0x55afb9={'where':_0x25982b[_0x23c7('0x3a')]};return db[_0x23c7('0x2a')][_0x23c7('0x1d')](_0x55afb9)[_0x23c7('0x22')](function(_0xf96427){_0x3be62c[_0x23c7('0x1d')]=_0xf96427;if(_0x24fc38['query'][_0x23c7('0x40')]){_0x25982b[_0x23c7('0x41')]=[{'all':!![]}];}return db[_0x23c7('0x2a')][_0x23c7('0x42')](_0x25982b);})[_0x23c7('0x22')](function(_0x589d3e){_0x3be62c[_0x23c7('0x43')]=_0x589d3e;return _0x3be62c;})[_0x23c7('0x22')](respondWithFilteredResult(_0x5d0554,_0x25982b))[_0x23c7('0x44')](handleError(_0x5d0554,null));};exports[_0x23c7('0x45')]=function(_0x21f462,_0x366492){var _0x7b3137={'raw':!![],'where':{'id':_0x21f462[_0x23c7('0x46')]['id']}},_0xb00df2={};_0xb00df2[_0x23c7('0x2f')]=_[_0x23c7('0x30')](db[_0x23c7('0x2a')][_0x23c7('0x2b')]);_0xb00df2[_0x23c7('0x31')]=_[_0x23c7('0x30')](_0x21f462[_0x23c7('0x31')]);_0xb00df2[_0x23c7('0x32')]=_['intersection'](_0xb00df2[_0x23c7('0x2f')],_0xb00df2['query']);_0x7b3137['attributes']=_[_0x23c7('0x47')](_0xb00df2[_0x23c7('0x2f')],qs[_0x23c7('0x33')](_0x21f462[_0x23c7('0x31')][_0x23c7('0x33')]));_0x7b3137['attributes']=_0x7b3137[_0x23c7('0x34')][_0x23c7('0x35')]?_0x7b3137[_0x23c7('0x34')]:_0xb00df2[_0x23c7('0x2f')];if(_0x21f462[_0x23c7('0x31')][_0x23c7('0x40')]){_0x7b3137[_0x23c7('0x41')]=[{'all':!![]}];}_0x7b3137=_['merge']({},_0x7b3137,_0x21f462[_0x23c7('0x3f')]);return db[_0x23c7('0x2a')]['find'](_0x7b3137)[_0x23c7('0x22')](handleEntityNotFound(_0x366492,null))['then'](respondWithResult(_0x366492,null))[_0x23c7('0x44')](handleError(_0x366492,null));};exports['create']=function(_0x4a7066,_0x6a3b63){return db[_0x23c7('0x2a')][_0x23c7('0x48')](_0x4a7066['body'],{})['then'](respondWithResult(_0x6a3b63,0xc9))[_0x23c7('0x44')](handleError(_0x6a3b63,null));};exports[_0x23c7('0x49')]=function(_0x3ff2ec,_0x247d18){if(_0x3ff2ec['body']['id']){delete _0x3ff2ec['body']['id'];}return db[_0x23c7('0x2a')]['find']({'where':{'id':_0x3ff2ec[_0x23c7('0x46')]['id']}})[_0x23c7('0x22')](handleEntityNotFound(_0x247d18,null))[_0x23c7('0x22')](saveUpdates(_0x3ff2ec[_0x23c7('0x4a')],null))[_0x23c7('0x22')](respondWithResult(_0x247d18,null))[_0x23c7('0x44')](handleError(_0x247d18,null));};exports[_0x23c7('0x23')]=function(_0x24e373,_0xe25108){return db[_0x23c7('0x2a')]['find']({'where':{'id':_0x24e373[_0x23c7('0x46')]['id']}})['then'](handleEntityNotFound(_0xe25108,null))[_0x23c7('0x22')](removeEntity(_0xe25108,null))[_0x23c7('0x44')](handleError(_0xe25108,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 382a900..5c5756d 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 _0xfe02=['bluebird','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xfe02,0x191));var _0x2fe0=function(_0x597351,_0x5aed9f){_0x597351=_0x597351-0x0;var _0x410cd7=_0xfe02[_0x597351];return _0x410cd7;};'use strict';var _=require(_0x2fe0('0x0'));var util=require(_0x2fe0('0x1'));var logger=require(_0x2fe0('0x2'))(_0x2fe0('0x3'));var moment=require(_0x2fe0('0x4'));var BPromise=require(_0x2fe0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2fe0('0x6'));var rimraf=require(_0x2fe0('0x7'));var config=require('../../config/environment');var attributes=require(_0x2fe0('0x8'));module[_0x2fe0('0x9')]=function(_0x239159,_0x16daf5){return _0x239159[_0x2fe0('0xa')](_0x2fe0('0xb'),attributes,{'tableName':_0x2fe0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2fe0('0xd')});}; \ No newline at end of file +var _0x142b=['./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x489fe3,_0x5ebb81){var _0x592190=function(_0x1612a7){while(--_0x1612a7){_0x489fe3['push'](_0x489fe3['shift']());}};_0x592190(++_0x5ebb81);}(_0x142b,0xef));var _0xb142=function(_0x50ddfe,_0x14265d){_0x50ddfe=_0x50ddfe-0x0;var _0x1b1f89=_0x142b[_0x50ddfe];return _0x1b1f89;};'use strict';var _=require('lodash');var util=require(_0xb142('0x0'));var logger=require(_0xb142('0x1'))(_0xb142('0x2'));var moment=require(_0xb142('0x3'));var BPromise=require(_0xb142('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb142('0x5'));var rimraf=require(_0xb142('0x6'));var config=require(_0xb142('0x7'));var attributes=require(_0xb142('0x8'));module['exports']=function(_0x5e472e,_0x1370fa){return _0x5e472e['define'](_0xb142('0x9'),attributes,{'tableName':_0xb142('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb142('0xb'),'collate':_0xb142('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 8fd5af4..fa0107c 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 _0x038a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment'];(function(_0x3f8f30,_0x53f8bc){var _0x1fc3b5=function(_0x6f6cef){while(--_0x6f6cef){_0x3f8f30['push'](_0x3f8f30['shift']());}};_0x1fc3b5(++_0x53f8bc);}(_0x038a,0xc3));var _0xa038=function(_0x2bcddb,_0x3eaf37){_0x2bcddb=_0x2bcddb-0x0;var _0x12a9e8=_0x038a[_0x2bcddb];return _0x12a9e8;};'use strict';var _=require(_0xa038('0x0'));var util=require(_0xa038('0x1'));var moment=require(_0xa038('0x2'));var BPromise=require(_0xa038('0x3'));var rs=require(_0xa038('0x4'));var fs=require('fs');var Redis=require(_0xa038('0x5'));var db=require(_0xa038('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa038('0x7'))(_0xa038('0x8'));var config=require(_0xa038('0x9'));var jayson=require(_0xa038('0xa'));var client=jayson[_0xa038('0xb')][_0xa038('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c2d80,_0x256269,_0x3b709d){return new BPromise(function(_0x125a81,_0x57f8f5){return client[_0xa038('0xd')](_0x5c2d80,_0x3b709d)[_0xa038('0xe')](function(_0x468e4d){logger[_0xa038('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x256269,_0xa038('0x10'));logger[_0xa038('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x256269,_0xa038('0x10'),JSON[_0xa038('0x12')](_0x468e4d));if(_0x468e4d['error']){if(_0x468e4d[_0xa038('0x13')][_0xa038('0x14')]===0x1f4){logger[_0xa038('0x13')](_0xa038('0x15'),_0x256269,_0x468e4d[_0xa038('0x13')][_0xa038('0x16')]);return _0x57f8f5(_0x468e4d[_0xa038('0x13')]['message']);}logger[_0xa038('0x13')](_0xa038('0x15'),_0x256269,_0x468e4d[_0xa038('0x13')]['message']);return _0x125a81(_0x468e4d['error'][_0xa038('0x16')]);}else{logger[_0xa038('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x256269,'request\x20sent');_0x125a81(_0x468e4d[_0xa038('0x17')][_0xa038('0x16')]);}})[_0xa038('0x18')](function(_0x33f690){logger['error'](_0xa038('0x15'),_0x256269,_0x33f690);_0x57f8f5(_0x33f690);});});}exports[_0xa038('0x19')]=function(_0x48f226){var _0x3219fc=this;return new Promise(function(_0x569019,_0x22ee26){return db[_0xa038('0x1a')]['update'](_0x48f226[_0xa038('0x1b')],{'raw':_0x48f226[_0xa038('0x1c')]?_0x48f226[_0xa038('0x1c')][_0xa038('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48f226[_0xa038('0x1c')]?_0x48f226[_0xa038('0x1c')][_0xa038('0x1e')]||null:null,'attributes':_0x48f226[_0xa038('0x1c')]?_0x48f226[_0xa038('0x1c')][_0xa038('0x1f')]||null:null,'limit':_0x48f226[_0xa038('0x1c')]?_0x48f226[_0xa038('0x1c')][_0xa038('0x20')]||null:null})[_0xa038('0xe')](function(_0x4d4139){logger['info'](_0xa038('0x19'),_0x48f226);logger['debug'](_0xa038('0x19'),_0x48f226,JSON[_0xa038('0x12')](_0x4d4139));_0x569019(_0x4d4139);})[_0xa038('0x18')](function(_0x420cac){logger['error'](_0xa038('0x19'),_0x420cac['message'],_0x48f226);_0x22ee26(_0x3219fc[_0xa038('0x13')](0x1f4,_0x420cac[_0xa038('0x16')]));});});}; \ No newline at end of file +var _0x3897=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x24037a,_0x1ab4be){var _0x4784a4=function(_0x174444){while(--_0x174444){_0x24037a['push'](_0x24037a['shift']());}};_0x4784a4(++_0x1ab4be);}(_0x3897,0x112));var _0x7389=function(_0x2715cf,_0x517bb2){_0x2715cf=_0x2715cf-0x0;var _0x1bdcb8=_0x3897[_0x2715cf];return _0x1bdcb8;};'use strict';var _=require(_0x7389('0x0'));var util=require(_0x7389('0x1'));var moment=require(_0x7389('0x2'));var BPromise=require(_0x7389('0x3'));var rs=require(_0x7389('0x4'));var fs=require('fs');var Redis=require(_0x7389('0x5'));var db=require(_0x7389('0x6'))['db'];var utils=require(_0x7389('0x7'));var logger=require('../../config/logger')(_0x7389('0x8'));var config=require(_0x7389('0x9'));var jayson=require(_0x7389('0xa'));var client=jayson[_0x7389('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34705e,_0x5e645b,_0x511edd){return new BPromise(function(_0x16eb78,_0x5286e8){return client[_0x7389('0xc')](_0x34705e,_0x511edd)[_0x7389('0xd')](function(_0x5ad347){logger[_0x7389('0xe')](_0x7389('0xf'),_0x5e645b,_0x7389('0x10'));logger[_0x7389('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5e645b,'request\x20sent',JSON[_0x7389('0x12')](_0x5ad347));if(_0x5ad347[_0x7389('0x13')]){if(_0x5ad347[_0x7389('0x13')][_0x7389('0x14')]===0x1f4){logger[_0x7389('0x13')](_0x7389('0xf'),_0x5e645b,_0x5ad347['error'][_0x7389('0x15')]);return _0x5286e8(_0x5ad347['error']['message']);}logger[_0x7389('0x13')](_0x7389('0xf'),_0x5e645b,_0x5ad347['error']['message']);return _0x16eb78(_0x5ad347[_0x7389('0x13')][_0x7389('0x15')]);}else{logger[_0x7389('0xe')](_0x7389('0xf'),_0x5e645b,_0x7389('0x10'));_0x16eb78(_0x5ad347['result']['message']);}})[_0x7389('0x16')](function(_0x54918a){logger['error'](_0x7389('0xf'),_0x5e645b,_0x54918a);_0x5286e8(_0x54918a);});});}exports[_0x7389('0x17')]=function(_0x4fb33a){var _0x40bb0d=this;return new Promise(function(_0x1060aa,_0x2cd43a){return db[_0x7389('0x18')][_0x7389('0x19')](_0x4fb33a[_0x7389('0x1a')],{'raw':_0x4fb33a[_0x7389('0x1b')]?_0x4fb33a['options'][_0x7389('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fb33a['options']?_0x4fb33a[_0x7389('0x1b')][_0x7389('0x1d')]||null:null,'attributes':_0x4fb33a[_0x7389('0x1b')]?_0x4fb33a[_0x7389('0x1b')][_0x7389('0x1e')]||null:null,'limit':_0x4fb33a[_0x7389('0x1b')]?_0x4fb33a[_0x7389('0x1b')][_0x7389('0x1f')]||null:null})[_0x7389('0xd')](function(_0x2f9135){logger[_0x7389('0xe')](_0x7389('0x17'),_0x4fb33a);logger['debug']('UpdateOpenchannelApplication',_0x4fb33a,JSON[_0x7389('0x12')](_0x2f9135));_0x1060aa(_0x2f9135);})[_0x7389('0x16')](function(_0x5ef74c){logger[_0x7389('0x13')]('UpdateOpenchannelApplication',_0x5ef74c['message'],_0x4fb33a);_0x2cd43a(_0x40bb0d[_0x7389('0x13')](0x1f4,_0x5ef74c['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 57178de..6f3c40f 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 _0xcf10=['openchannelinteraction:destroy','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete'];(function(_0x13fc0e,_0xfcd675){var _0x24d266=function(_0x4b653e){while(--_0x4b653e){_0x13fc0e['push'](_0x13fc0e['shift']());}};_0x24d266(++_0xfcd675);}(_0xcf10,0x163));var _0x0cf1=function(_0x1de0b9,_0xc6f046){_0x1de0b9=_0x1de0b9-0x0;var _0x18edae=_0xcf10[_0x1de0b9];return _0x18edae;};'use strict';var multer=require(_0x0cf1('0x0'));var util=require(_0x0cf1('0x1'));var path=require(_0x0cf1('0x2'));var timeout=require('connect-timeout');var express=require(_0x0cf1('0x3'));var router=express[_0x0cf1('0x4')]();var fs_extra=require(_0x0cf1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0cf1('0x6'));var config=require(_0x0cf1('0x7'));var controller=require(_0x0cf1('0x8'));router['get']('/',auth[_0x0cf1('0x9')](),controller[_0x0cf1('0xa')]);router[_0x0cf1('0xb')](_0x0cf1('0xc'),auth[_0x0cf1('0x9')](),controller[_0x0cf1('0xd')]);router[_0x0cf1('0xb')](_0x0cf1('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0cf1('0xb')](_0x0cf1('0xf'),auth[_0x0cf1('0x9')](),controller[_0x0cf1('0x10')]);router[_0x0cf1('0xb')](_0x0cf1('0x11'),auth[_0x0cf1('0x9')](),controller['download']);router[_0x0cf1('0x12')]('/',auth['isAuthenticated'](),controller[_0x0cf1('0x13')]);router['post'](_0x0cf1('0xf'),auth[_0x0cf1('0x9')](),controller['addMessage']);router[_0x0cf1('0x12')](_0x0cf1('0x14'),auth[_0x0cf1('0x9')](),interaction[_0x0cf1('0x15')](_0x0cf1('0x16'),_0x0cf1('0x17')),controller[_0x0cf1('0x18')]);router[_0x0cf1('0x19')](_0x0cf1('0xe'),auth[_0x0cf1('0x9')](),interaction[_0x0cf1('0x15')](_0x0cf1('0x16'),_0x0cf1('0x1a')),controller[_0x0cf1('0x1b')]);router[_0x0cf1('0x1c')]('/:id',auth[_0x0cf1('0x9')](),interaction[_0x0cf1('0x15')](_0x0cf1('0x16'),_0x0cf1('0x1d')),controller[_0x0cf1('0x1e')]);router[_0x0cf1('0x1c')](_0x0cf1('0x14'),auth[_0x0cf1('0x9')](),controller['removeTags']);module[_0x0cf1('0x1f')]=router; \ No newline at end of file +var _0xe975=['addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages'];(function(_0x3de73d,_0x568980){var _0x2c17ab=function(_0x53595a){while(--_0x53595a){_0x3de73d['push'](_0x3de73d['shift']());}};_0x2c17ab(++_0x568980);}(_0xe975,0x1cd));var _0x5e97=function(_0x5c3c54,_0x143661){_0x5c3c54=_0x5c3c54-0x0;var _0x15b8ab=_0xe975[_0x5c3c54];return _0x15b8ab;};'use strict';var multer=require(_0x5e97('0x0'));var util=require('util');var path=require(_0x5e97('0x1'));var timeout=require(_0x5e97('0x2'));var express=require(_0x5e97('0x3'));var router=express[_0x5e97('0x4')]();var fs_extra=require(_0x5e97('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e97('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x5e97('0x7')]('/',auth[_0x5e97('0x8')](),controller[_0x5e97('0x9')]);router[_0x5e97('0x7')](_0x5e97('0xa'),auth[_0x5e97('0x8')](),controller[_0x5e97('0xb')]);router[_0x5e97('0x7')](_0x5e97('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x5e97('0x8')](),controller[_0x5e97('0xd')]);router[_0x5e97('0x7')](_0x5e97('0xe'),auth[_0x5e97('0x8')](),controller[_0x5e97('0xf')]);router[_0x5e97('0x10')]('/',auth[_0x5e97('0x8')](),controller[_0x5e97('0x11')]);router[_0x5e97('0x10')](_0x5e97('0x12'),auth[_0x5e97('0x8')](),controller[_0x5e97('0x13')]);router['post'](_0x5e97('0x14'),auth[_0x5e97('0x8')](),interaction[_0x5e97('0x15')](_0x5e97('0x16'),'openchannelinteraction:addtags'),controller[_0x5e97('0x17')]);router[_0x5e97('0x18')]('/:id',auth[_0x5e97('0x8')](),interaction[_0x5e97('0x15')](_0x5e97('0x16'),_0x5e97('0x19')),controller[_0x5e97('0x1a')]);router['delete'](_0x5e97('0xc'),auth[_0x5e97('0x8')](),interaction[_0x5e97('0x15')](_0x5e97('0x16'),_0x5e97('0x1b')),controller[_0x5e97('0x1c')]);router['delete'](_0x5e97('0x14'),auth[_0x5e97('0x8')](),controller[_0x5e97('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 7685221..cfdb948 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 _0x4f17=['DATE','STRING','ENUM','sequelize','BOOLEAN'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4f17,0x9e));var _0x74f1=function(_0x525864,_0x1bb3ea){_0x525864=_0x525864-0x0;var _0x4f9964=_0x4f17[_0x525864];return _0x4f9964;};'use strict';var Sequelize=require(_0x74f1('0x0'));module['exports']={'closed':{'type':Sequelize[_0x74f1('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x74f1('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x74f1('0x3')]},'thirdDisposition':{'type':Sequelize[_0x74f1('0x3')]},'note':{'type':Sequelize[_0x74f1('0x3')]},'read1stAt':{'type':Sequelize[_0x74f1('0x2')]},'threadId':{'type':Sequelize[_0x74f1('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x74f1('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x74f1('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x74f1('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x74f1('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xe13e=['ENUM','out','BOOLEAN','DATE','STRING'];(function(_0x217b9b,_0x366b88){var _0x2fbc3b=function(_0x48fc51){while(--_0x48fc51){_0x217b9b['push'](_0x217b9b['shift']());}};_0x2fbc3b(++_0x366b88);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xee13('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xee13('0x1')]},'disposition':{'type':Sequelize[_0xee13('0x2')]},'secondDisposition':{'type':Sequelize[_0xee13('0x2')]},'thirdDisposition':{'type':Sequelize[_0xee13('0x2')]},'note':{'type':Sequelize[_0xee13('0x2')]},'read1stAt':{'type':Sequelize[_0xee13('0x1')]},'threadId':{'type':Sequelize[_0xee13('0x2')]},'externalUrl':{'type':Sequelize[_0xee13('0x2')]},'lastMsgAt':{'type':Sequelize[_0xee13('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xee13('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xee13('0x3')]('in',_0xee13('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xee13('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xee13('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3d73008..0f50dda 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 _0xa829=['Contact','lastName','read','renderFile','root','views','transcript-','createPdfFromHTML','unlinkSync','rimraf','moment','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','key','getOptions','findAll','openchannel','query','catch','show','type','from','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','create','body','update','find','addMessage','ids','omit','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','server','join','files','attachments','transcript-%d-%s.zip','push','fullname','firstName','Attachment','direction','secret','OpenchannelAccount','Account','User','Owner','get','mkdirSync','Openchannel','createdAt','closed','closedAt','threadId','Public','Private','Messages','basename','existsSync','pipe','createWriteStream','out','System'];(function(_0x1af984,_0x420319){var _0x1ad773=function(_0x277f60){while(--_0x277f60){_0x1af984['push'](_0x1af984['shift']());}};_0x1ad773(++_0x420319);}(_0xa829,0x89));var _0x9a82=function(_0x8b4421,_0x277535){_0x8b4421=_0x8b4421-0x0;var _0x3584cc=_0xa829[_0x8b4421];return _0x3584cc;};'use strict';var rimraf=require(_0x9a82('0x0'));var zipdir=require('zip-dir');var moment=require(_0x9a82('0x1'));var util=require('util');var path=require(_0x9a82('0x2'));var ejs=require(_0x9a82('0x3'));var fs=require('fs');var _=require(_0x9a82('0x4'));var Redis=require('ioredis');var interaction=require(_0x9a82('0x5'));var qs=require(_0x9a82('0x6'));var pdf=require(_0x9a82('0x7'));var logger=require(_0x9a82('0x8'))(_0x9a82('0x9'));var config=require(_0x9a82('0xa'));var db=require(_0x9a82('0xb'))['db'];config[_0x9a82('0xc')]=_['defaults'](config[_0x9a82('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a82('0xd'))(new Redis(config['redis']));require(_0x9a82('0xe'))[_0x9a82('0xf')](socket);function respondWithStatusCode(_0x4e603f,_0xdeb53d){_0xdeb53d=_0xdeb53d||0xcc;return function(_0x55dbff){if(_0x55dbff){return _0x4e603f['sendStatus'](_0xdeb53d);}return _0x4e603f[_0x9a82('0x10')](_0xdeb53d)[_0x9a82('0x11')]();};}function respondWithResult(_0x433e55,_0x437d0e){_0x437d0e=_0x437d0e||0xc8;return function(_0x2c7286){if(_0x2c7286){return _0x433e55[_0x9a82('0x10')](_0x437d0e)[_0x9a82('0x12')](_0x2c7286);}};}function respondWithFilteredResult(_0x273de1,_0x26cb8e){return function(_0x3daa53){if(_0x3daa53){var _0x1eb155=typeof _0x26cb8e[_0x9a82('0x13')]==='undefined'&&typeof _0x26cb8e[_0x9a82('0x14')]===_0x9a82('0x15');var _0x164477=_0x3daa53[_0x9a82('0x16')];var _0x2bfc2c=_0x1eb155?0x0:_0x26cb8e[_0x9a82('0x13')];var _0x7d2a7b=_0x1eb155?_0x3daa53[_0x9a82('0x16')]:_0x26cb8e[_0x9a82('0x13')]+_0x26cb8e[_0x9a82('0x14')];var _0x3764f5;if(_0x7d2a7b>=_0x164477){_0x7d2a7b=_0x164477;_0x3764f5=0xc8;}else{_0x3764f5=0xce;}_0x273de1[_0x9a82('0x10')](_0x3764f5);return _0x273de1[_0x9a82('0x17')](_0x9a82('0x18'),_0x2bfc2c+'-'+_0x7d2a7b+'/'+_0x164477)[_0x9a82('0x12')](_0x3daa53);}return null;};}function saveUpdates(_0x118e21){return function(_0x5342ed){if(_0x5342ed){return _0x5342ed['update'](_0x118e21)[_0x9a82('0x19')](function(_0x3fac71){return _0x3fac71;});}return null;};}function removeEntity(_0x3a3936){return function(_0x2c49de){if(_0x2c49de){return _0x2c49de[_0x9a82('0x1a')]()[_0x9a82('0x19')](function(){_0x3a3936[_0x9a82('0x10')](0xcc)[_0x9a82('0x11')]();});}};}function handleEntityNotFound(_0xb12884){return function(_0xed1aa1){if(!_0xed1aa1){_0xb12884[_0x9a82('0x1b')](0x194);}return _0xed1aa1;};}function handleError(_0x2b57f5,_0x2461f6){_0x2461f6=_0x2461f6||0x1f4;return function(_0x5ab2ec){logger[_0x9a82('0x1c')](_0x5ab2ec[_0x9a82('0x1d')]);if(_0x5ab2ec[_0x9a82('0x1e')]){delete _0x5ab2ec[_0x9a82('0x1e')];}_0x2b57f5[_0x9a82('0x10')](_0x2461f6)['send'](_0x5ab2ec);};}exports[_0x9a82('0x1f')]=function(_0x150f4e,_0x3026aa){var _0x5e619b={};var _0x44f2d4=_[_0x9a82('0x20')](db[_0x9a82('0x21')][_0x9a82('0x22')],function(_0x42971d){return{'name':_0x42971d[_0x9a82('0x23')],'type':_0x42971d['type'][_0x9a82('0x24')]};});_0x5e619b=qs[_0x9a82('0x25')](_0x44f2d4,_0x150f4e);return interaction[_0x9a82('0x26')](_0x9a82('0x27'),_0x150f4e[_0x9a82('0x28')],_0x150f4e['user'],_0x5e619b,_0x44f2d4)[_0x9a82('0x19')](respondWithFilteredResult(_0x3026aa,_0x5e619b))[_0x9a82('0x29')](handleError(_0x3026aa,null));};exports[_0x9a82('0x2a')]=function(_0x1dab34,_0x1c5068){var _0x3f58eb={};if(_0x1dab34[_0x9a82('0x28')][_0x9a82('0x2b')]&&_0x1dab34[_0x9a82('0x28')][_0x9a82('0x2b')]===_0x9a82('0x2c')){_0x3f58eb['from']=_0x1dab34[_0x9a82('0x2d')]['id'];}else{_0x3f58eb['id']=_0x1dab34[_0x9a82('0x2d')]['id'];}var _0x17d178={'raw':![],'where':_0x3f58eb},_0x35d02c={};_0x35d02c[_0x9a82('0x2e')]=_[_0x9a82('0x2f')](db[_0x9a82('0x21')]['rawAttributes']);_0x35d02c[_0x9a82('0x28')]=_[_0x9a82('0x2f')](_0x1dab34[_0x9a82('0x28')]);_0x35d02c[_0x9a82('0x30')]=_[_0x9a82('0x31')](_0x35d02c['model'],_0x35d02c[_0x9a82('0x28')]);_0x17d178[_0x9a82('0x32')]=_[_0x9a82('0x31')](_0x35d02c['model'],qs[_0x9a82('0x33')](_0x1dab34[_0x9a82('0x28')]['fields']));_0x17d178[_0x9a82('0x32')]=_0x17d178[_0x9a82('0x32')][_0x9a82('0x34')]?_0x17d178[_0x9a82('0x32')]:_0x35d02c['model'];if(_0x1dab34[_0x9a82('0x28')]['includeAll']){_0x17d178[_0x9a82('0x35')]=[{'all':!![]}];}_0x17d178=_[_0x9a82('0x36')]({},_0x17d178,_0x1dab34[_0x9a82('0x37')]);return db[_0x9a82('0x21')]['find'](_0x17d178)['then'](handleEntityNotFound(_0x1c5068,null))[_0x9a82('0x19')](respondWithResult(_0x1c5068,null))['catch'](handleError(_0x1c5068,null));};exports['create']=function(_0x3ad2be,_0x56c8c8){return db[_0x9a82('0x21')][_0x9a82('0x38')](_0x3ad2be[_0x9a82('0x39')],{})[_0x9a82('0x19')](respondWithResult(_0x56c8c8,0xc9))[_0x9a82('0x29')](handleError(_0x56c8c8,null));};exports[_0x9a82('0x3a')]=function(_0x335071,_0x3c5b71){if(_0x335071[_0x9a82('0x39')]['id']){delete _0x335071[_0x9a82('0x39')]['id'];}return db[_0x9a82('0x21')][_0x9a82('0x3b')]({'where':{'id':_0x335071['params']['id']}})[_0x9a82('0x19')](handleEntityNotFound(_0x3c5b71,null))[_0x9a82('0x19')](saveUpdates(_0x335071[_0x9a82('0x39')],null))[_0x9a82('0x19')](respondWithResult(_0x3c5b71,null))[_0x9a82('0x29')](handleError(_0x3c5b71,null));};exports[_0x9a82('0x1a')]=function(_0x3fa163,_0x232c3b){return db[_0x9a82('0x21')][_0x9a82('0x3b')]({'where':{'id':_0x3fa163['params']['id']}})[_0x9a82('0x19')](handleEntityNotFound(_0x232c3b,null))[_0x9a82('0x19')](removeEntity(_0x232c3b,null))[_0x9a82('0x29')](handleError(_0x232c3b,null));};exports['describe']=function(_0x222df0,_0x57beb6){return db['OpenchannelInteraction']['describe']()[_0x9a82('0x19')](respondWithResult(_0x57beb6,null))[_0x9a82('0x29')](handleError(_0x57beb6,null));};exports[_0x9a82('0x3c')]=function(_0x366c1b,_0x1e65e8){return db['OpenchannelMessage']['find']({'where':{'id':_0x366c1b[_0x9a82('0x2d')]['id']}})[_0x9a82('0x19')](handleEntityNotFound(_0x1e65e8,null))[_0x9a82('0x19')](function(_0x1cc187){if(_0x1cc187){return _0x1cc187[_0x9a82('0x3c')](_0x366c1b[_0x9a82('0x39')][_0x9a82('0x3d')],_[_0x9a82('0x3e')](_0x366c1b['body'],[_0x9a82('0x3d'),'id'])||{});}})[_0x9a82('0x19')](respondWithResult(_0x1e65e8,null))[_0x9a82('0x29')](handleError(_0x1e65e8,null));};exports['getMessages']=function(_0x11c063,_0x566f73){var _0x5b92a3={'raw':![],'where':{}};var _0x4d4b00={};var _0x40cbb3={'count':0x0,'rows':[]};return db[_0x9a82('0x21')]['findOne']({'where':{'id':_0x11c063[_0x9a82('0x2d')]['id']}})[_0x9a82('0x19')](handleEntityNotFound(_0x566f73,null))[_0x9a82('0x19')](function(_0x178a39){if(_0x178a39){_0x4d4b00['model']=_[_0x9a82('0x2f')](db[_0x9a82('0x3f')]['rawAttributes']);_0x4d4b00['query']=_[_0x9a82('0x2f')](_0x11c063[_0x9a82('0x28')]);_0x4d4b00['filters']=_[_0x9a82('0x31')](_0x4d4b00[_0x9a82('0x2e')],_0x4d4b00['query']);_0x5b92a3['attributes']=_[_0x9a82('0x31')](_0x4d4b00['model'],qs[_0x9a82('0x33')](_0x11c063[_0x9a82('0x28')][_0x9a82('0x33')]));_0x5b92a3[_0x9a82('0x32')]=_0x5b92a3[_0x9a82('0x32')]['length']?_0x5b92a3[_0x9a82('0x32')]:_0x4d4b00['model'];if(!_0x11c063[_0x9a82('0x28')][_0x9a82('0x40')](_0x9a82('0x41'))){_0x5b92a3['limit']=qs[_0x9a82('0x14')](_0x11c063['query'][_0x9a82('0x14')]);_0x5b92a3[_0x9a82('0x13')]=qs[_0x9a82('0x13')](_0x11c063[_0x9a82('0x28')][_0x9a82('0x13')]);}_0x5b92a3[_0x9a82('0x42')]=qs[_0x9a82('0x43')](_0x11c063[_0x9a82('0x28')]['sort']);_0x5b92a3[_0x9a82('0x44')]=qs[_0x9a82('0x30')](_[_0x9a82('0x45')](_0x11c063['query'],_0x4d4b00[_0x9a82('0x30')]));_0x5b92a3[_0x9a82('0x44')][_0x9a82('0x46')]=_0x178a39['id'];if(_0x11c063['query'][_0x9a82('0x47')]){_0x5b92a3[_0x9a82('0x44')]=_[_0x9a82('0x36')](_0x5b92a3['where'],{'$or':_['map'](_0x5b92a3['attributes'],function(_0xbaf97e){var _0x71c98b={};_0x71c98b[_0xbaf97e]={'$like':'%'+_0x11c063[_0x9a82('0x28')][_0x9a82('0x47')]+'%'};return _0x71c98b;})});}if(_0x11c063[_0x9a82('0x28')]['$gte']){var _0x16fcbc=_0x11c063[_0x9a82('0x28')][_0x9a82('0x48')]['split'](',');var _0x1ec388={};_0x1ec388[_0x16fcbc[0x0]]={'$gte':moment(_0x16fcbc[0x1])[_0x9a82('0x49')](_0x9a82('0x4a'))};_0x5b92a3[_0x9a82('0x44')]=_[_0x9a82('0x36')](_0x5b92a3[_0x9a82('0x44')],_0x1ec388);}_0x5b92a3=_[_0x9a82('0x36')]({},_0x5b92a3,_0x11c063['options']);return db[_0x9a82('0x3f')][_0x9a82('0x16')]({'where':_0x5b92a3[_0x9a82('0x44')]})['then'](function(_0x2fa1f3){_0x40cbb3[_0x9a82('0x16')]=_0x2fa1f3;if(_0x11c063[_0x9a82('0x28')][_0x9a82('0x4b')]){_0x5b92a3[_0x9a82('0x35')]=[{'all':!![]}];}return db[_0x9a82('0x3f')][_0x9a82('0x26')](_0x5b92a3);})[_0x9a82('0x19')](function(_0x2a1c26){_0x40cbb3[_0x9a82('0x4c')]=_0x2a1c26;return _0x40cbb3;});}})[_0x9a82('0x19')](respondWithFilteredResult(_0x566f73,_0x5b92a3))[_0x9a82('0x29')](handleError(_0x566f73,null));};exports[_0x9a82('0x4d')]=function(_0x1a58f9,_0x60786b){return db[_0x9a82('0x21')][_0x9a82('0x3b')]({'where':{'id':_0x1a58f9[_0x9a82('0x2d')]['id']}})['then'](handleEntityNotFound(_0x60786b,null))[_0x9a82('0x19')](function(_0x1eeeb8){if(_0x1eeeb8){return _0x1eeeb8[_0x9a82('0x4e')](_0x1a58f9['body']['ids'],_['omit'](_0x1a58f9[_0x9a82('0x39')],[_0x9a82('0x3d'),'id'])||{})[_0x9a82('0x4f')](function(){return db[_0x9a82('0x50')][_0x9a82('0x26')]({'attributes':['id',_0x9a82('0x1e'),_0x9a82('0x51')],'where':{'id':_0x1a58f9[_0x9a82('0x39')][_0x9a82('0x3d')]}});})[_0x9a82('0x19')](function(_0xbf1ae9){socket[_0x9a82('0x52')](_0x9a82('0x53'),{'id':Number(_0x1a58f9['params']['id']),'tags':_0xbf1ae9||[]});return{'id':Number(_0x1a58f9['params']['id']),'tags':_0xbf1ae9||[]};});}})[_0x9a82('0x19')](respondWithResult(_0x60786b,null))[_0x9a82('0x29')](handleError(_0x60786b,null));};exports['removeTags']=function(_0x1771a1,_0x34a543){return db[_0x9a82('0x21')]['find']({'where':{'id':_0x1771a1[_0x9a82('0x2d')]['id']}})['then'](handleEntityNotFound(_0x34a543,null))['then'](function(_0x521f85){if(_0x521f85){return _0x521f85[_0x9a82('0x54')](_0x1771a1['query'][_0x9a82('0x3d')]);}})[_0x9a82('0x19')](respondWithStatusCode(_0x34a543,null))[_0x9a82('0x29')](handleError(_0x34a543,null));};exports[_0x9a82('0x55')]=function(_0x1f01b9,_0x57f4d1){var _0xae6c30=moment()[_0x9a82('0x56')]()[_0x9a82('0x57')]();var _0x2b7005=path['join'](config['root'],_0x9a82('0x58'),'files','tmp');var _0x11c4b9=path[_0x9a82('0x59')](config['root'],_0x9a82('0x58'),_0x9a82('0x5a'),_0x9a82('0x5b'));var _0xabf18f=path[_0x9a82('0x59')](_0x2b7005,_0xae6c30);var _0xa014ce=util['format'](_0x9a82('0x5c'),_0x1f01b9[_0x9a82('0x2d')]['id'],_0xae6c30);var _0x152b1e=path[_0x9a82('0x59')](_0x2b7005,_0xa014ce);var _0x2aeb30=[];_0x2aeb30[_0x9a82('0x5d')]({'model':db['User'],'as':'User','attributes':['id',_0x9a82('0x5e')],'raw':!![]});_0x2aeb30[_0x9a82('0x5d')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x9a82('0x5f'),'lastName'],'raw':!![]});if(_0x1f01b9[_0x9a82('0x28')]['attachments']){_0x2aeb30[_0x9a82('0x5d')]({'model':db[_0x9a82('0x60')],'as':_0x9a82('0x60'),'raw':!![]});}var _0x54df1c=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body','createdAt',_0x9a82('0x61'),_0x9a82('0x62'),'read'],'include':_0x2aeb30}];_0x54df1c[_0x9a82('0x5d')]({'model':db[_0x9a82('0x63')],'as':_0x9a82('0x64'),'attributes':['id','name']});_0x54df1c[_0x9a82('0x5d')]({'model':db[_0x9a82('0x65')],'as':_0x9a82('0x66'),'attributes':['id','fullname']});return db[_0x9a82('0x21')]['find']({'where':{'id':_0x1f01b9[_0x9a82('0x2d')]['id']},'include':_0x54df1c})[_0x9a82('0x19')](handleEntityNotFound(_0x57f4d1,null))[_0x9a82('0x19')](function(_0x2f3f45){if(_0x2f3f45){var _0x2095d5=_0x2f3f45[_0x9a82('0x67')]({'plain':!![]});fs[_0x9a82('0x68')](_0xabf18f);var _0x2be3b4={'channel':_0x9a82('0x69'),'account':_0x2095d5['Account'][_0x9a82('0x1e')],'agent':_0x2095d5[_0x9a82('0x66')]?_0x2095d5[_0x9a82('0x66')][_0x9a82('0x5e')]:'N.A.','createdAt':moment(_0x2095d5[_0x9a82('0x6a')])['format'](_0x9a82('0x4a'))['toString'](),'closedAt':_0x2095d5[_0x9a82('0x6b')]?moment(_0x2095d5[_0x9a82('0x6c')])[_0x9a82('0x49')](_0x9a82('0x4a'))[_0x9a82('0x57')]():'','disposition':_0x2095d5['disposition'],'visibility':_0x2095d5[_0x9a82('0x6d')]?_0x9a82('0x6e'):_0x9a82('0x6f'),'messages':_(_0x2095d5[_0x9a82('0x70')])[_0x9a82('0x47')]({'secret':![]})['map'](function(_0x143843){if(_0x143843[_0x9a82('0x60')]){var _0x537679=path[_0x9a82('0x59')](_0x11c4b9,_0x143843[_0x9a82('0x60')][_0x9a82('0x71')]);if(fs[_0x9a82('0x72')](_0x537679)){fs['createReadStream'](_0x537679)[_0x9a82('0x73')](fs[_0x9a82('0x74')](path[_0x9a82('0x59')](_0xabf18f,_0x143843[_0x9a82('0x60')][_0x9a82('0x71')])));}}return{'date':moment(_0x143843[_0x9a82('0x6a')])[_0x9a82('0x49')](_0x9a82('0x4a'))[_0x9a82('0x57')](),'sender':_0x143843[_0x9a82('0x61')]===_0x9a82('0x75')?_0x143843[_0x9a82('0x65')]?_0x143843[_0x9a82('0x65')][_0x9a82('0x5e')]:_0x9a82('0x76'):_0x143843[_0x9a82('0x77')][_0x9a82('0x5f')]+(_0x143843[_0x9a82('0x77')][_0x9a82('0x78')]?'\x20'+_0x143843[_0x9a82('0x77')]['lastName']:''),'body':_0x143843[_0x9a82('0x60')]?_0x143843['Attachment'][_0x9a82('0x71')]:_0x143843[_0x9a82('0x39')],'direction':_0x143843['direction']==='out'?'A':'C','secret':_0x143843[_0x9a82('0x62')],'read':_0x143843[_0x9a82('0x79')],'attachment':_0x143843['Attachment']};})['value']()};return ejs[_0x9a82('0x7a')](path['join'](config[_0x9a82('0x7b')],_0x9a82('0x58'),_0x9a82('0x7c'),'downloadInteraction.ejs'),{'interaction':_0x2be3b4})['then'](function(_0x2e05e6){var _0x293594=path[_0x9a82('0x59')](_0xabf18f,_0x9a82('0x7d')+_0x2095d5['id']+'-'+_0xae6c30+'.pdf');var _0x1efcd4={'path':_0x293594,'channel':_0x9a82('0x69'),'interactionId':_0x2095d5['id']};return pdf[_0x9a82('0x7e')](_0x2e05e6,_0x1efcd4);})[_0x9a82('0x19')](function(){return new Promise(function(_0x2b5285,_0x50baff){zipdir(_0xabf18f,{'saveTo':_0x152b1e},function(_0x278236,_0x470f91){if(_0x278236)return _0x50baff(_0x278236);return _0x2b5285(_0x470f91);});})[_0x9a82('0x19')](function(){return new Promise(function(_0x350e32,_0x55febd){rimraf(_0xabf18f,function(_0x5ab64f){if(_0x5ab64f)_0x55febd(_0x5ab64f);return _0x350e32();});});})[_0x9a82('0x19')](function(){return _0x57f4d1[_0x9a82('0x55')](_0x152b1e,_0xa014ce,function(_0x38cb5e){if(_0x38cb5e){logger[_0x9a82('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x38cb5e);}else{fs[_0x9a82('0x7f')](_0x152b1e);}});});});}else{return _0x57f4d1[_0x9a82('0x1b')](0xc8);}})[_0x9a82('0x29')](handleError(_0x57f4d1,null));}; \ No newline at end of file +var _0x1656=['emit','openchannelInteractionTags:save','removeTags','unix','toString','root','files','tmp','join','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','Public','Private','basename','existsSync','createReadStream','pipe','out','lastName','downloadInteraction.ejs','transcript-','.pdf','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','getOptions','findAll','query','user','show','from','params','model','keys','filters','intersection','attributes','fields','length','merge','options','OpenchannelInteraction','find','create','body','catch','describe','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','order','sort','where','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','omit','Tag','color'];(function(_0x97acee,_0x202957){var _0x16cc43=function(_0x22969b){while(--_0x22969b){_0x97acee['push'](_0x97acee['shift']());}};_0x16cc43(++_0x202957);}(_0x1656,0xa9));var _0x6165=function(_0x3779eb,_0xc19002){_0x3779eb=_0x3779eb-0x0;var _0x50423a=_0x1656[_0x3779eb];return _0x50423a;};'use strict';var rimraf=require(_0x6165('0x0'));var zipdir=require(_0x6165('0x1'));var moment=require('moment');var util=require(_0x6165('0x2'));var path=require(_0x6165('0x3'));var ejs=require(_0x6165('0x4'));var fs=require('fs');var _=require(_0x6165('0x5'));var Redis=require('ioredis');var interaction=require(_0x6165('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0x6165('0x7'));var logger=require(_0x6165('0x8'))(_0x6165('0x9'));var config=require(_0x6165('0xa'));var db=require(_0x6165('0xb'))['db'];config[_0x6165('0xc')]=_[_0x6165('0xd')](config[_0x6165('0xc')],{'host':_0x6165('0xe'),'port':0x18eb});var socket=require(_0x6165('0xf'))(new Redis(config[_0x6165('0xc')]));require(_0x6165('0x10'))['register'](socket);function respondWithStatusCode(_0x50f481,_0x521476){_0x521476=_0x521476||0xcc;return function(_0x5a3c72){if(_0x5a3c72){return _0x50f481[_0x6165('0x11')](_0x521476);}return _0x50f481[_0x6165('0x12')](_0x521476)[_0x6165('0x13')]();};}function respondWithResult(_0x1c0893,_0xe8b18d){_0xe8b18d=_0xe8b18d||0xc8;return function(_0x241041){if(_0x241041){return _0x1c0893['status'](_0xe8b18d)[_0x6165('0x14')](_0x241041);}};}function respondWithFilteredResult(_0x52a322,_0x34f82b){return function(_0x2490dc){if(_0x2490dc){var _0x2078e7=typeof _0x34f82b[_0x6165('0x15')]===_0x6165('0x16')&&typeof _0x34f82b[_0x6165('0x17')]===_0x6165('0x16');var _0x2be69d=_0x2490dc[_0x6165('0x18')];var _0x458a00=_0x2078e7?0x0:_0x34f82b[_0x6165('0x15')];var _0x1bd7ca=_0x2078e7?_0x2490dc['count']:_0x34f82b[_0x6165('0x15')]+_0x34f82b['limit'];var _0x5065d3;if(_0x1bd7ca>=_0x2be69d){_0x1bd7ca=_0x2be69d;_0x5065d3=0xc8;}else{_0x5065d3=0xce;}_0x52a322[_0x6165('0x12')](_0x5065d3);return _0x52a322[_0x6165('0x19')](_0x6165('0x1a'),_0x458a00+'-'+_0x1bd7ca+'/'+_0x2be69d)[_0x6165('0x14')](_0x2490dc);}return null;};}function saveUpdates(_0x1d6430){return function(_0x7db6c6){if(_0x7db6c6){return _0x7db6c6[_0x6165('0x1b')](_0x1d6430)[_0x6165('0x1c')](function(_0x4ad931){return _0x4ad931;});}return null;};}function removeEntity(_0x3a34e6){return function(_0x563dc1){if(_0x563dc1){return _0x563dc1[_0x6165('0x1d')]()[_0x6165('0x1c')](function(){_0x3a34e6[_0x6165('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x260a93){return function(_0x2ecc4c){if(!_0x2ecc4c){_0x260a93['sendStatus'](0x194);}return _0x2ecc4c;};}function handleError(_0x2b3902,_0x350330){_0x350330=_0x350330||0x1f4;return function(_0x5da0f9){logger[_0x6165('0x1e')](_0x5da0f9[_0x6165('0x1f')]);if(_0x5da0f9[_0x6165('0x20')]){delete _0x5da0f9['name'];}_0x2b3902[_0x6165('0x12')](_0x350330)[_0x6165('0x21')](_0x5da0f9);};}exports[_0x6165('0x22')]=function(_0xe91f9e,_0x19a1c0){var _0x1c4a87={};var _0x3241a6=_['map'](db['OpenchannelInteraction'][_0x6165('0x23')],function(_0x2e2d91){return{'name':_0x2e2d91[_0x6165('0x24')],'type':_0x2e2d91[_0x6165('0x25')]['key']};});_0x1c4a87=qs[_0x6165('0x26')](_0x3241a6,_0xe91f9e);return interaction[_0x6165('0x27')]('openchannel',_0xe91f9e[_0x6165('0x28')],_0xe91f9e[_0x6165('0x29')],_0x1c4a87,_0x3241a6)[_0x6165('0x1c')](respondWithFilteredResult(_0x19a1c0,_0x1c4a87))['catch'](handleError(_0x19a1c0,null));};exports[_0x6165('0x2a')]=function(_0x3e9cd4,_0x3679b8){var _0x13428b={};if(_0x3e9cd4[_0x6165('0x28')][_0x6165('0x25')]&&_0x3e9cd4[_0x6165('0x28')][_0x6165('0x25')]===_0x6165('0x2b')){_0x13428b['from']=_0x3e9cd4[_0x6165('0x2c')]['id'];}else{_0x13428b['id']=_0x3e9cd4[_0x6165('0x2c')]['id'];}var _0x42f6d9={'raw':![],'where':_0x13428b},_0x1b0893={};_0x1b0893[_0x6165('0x2d')]=_[_0x6165('0x2e')](db['OpenchannelInteraction'][_0x6165('0x23')]);_0x1b0893[_0x6165('0x28')]=_[_0x6165('0x2e')](_0x3e9cd4[_0x6165('0x28')]);_0x1b0893[_0x6165('0x2f')]=_[_0x6165('0x30')](_0x1b0893['model'],_0x1b0893[_0x6165('0x28')]);_0x42f6d9[_0x6165('0x31')]=_[_0x6165('0x30')](_0x1b0893[_0x6165('0x2d')],qs[_0x6165('0x32')](_0x3e9cd4[_0x6165('0x28')]['fields']));_0x42f6d9[_0x6165('0x31')]=_0x42f6d9[_0x6165('0x31')][_0x6165('0x33')]?_0x42f6d9[_0x6165('0x31')]:_0x1b0893['model'];if(_0x3e9cd4[_0x6165('0x28')]['includeAll']){_0x42f6d9['include']=[{'all':!![]}];}_0x42f6d9=_[_0x6165('0x34')]({},_0x42f6d9,_0x3e9cd4[_0x6165('0x35')]);return db[_0x6165('0x36')][_0x6165('0x37')](_0x42f6d9)[_0x6165('0x1c')](handleEntityNotFound(_0x3679b8,null))[_0x6165('0x1c')](respondWithResult(_0x3679b8,null))['catch'](handleError(_0x3679b8,null));};exports[_0x6165('0x38')]=function(_0x1b3404,_0x111873){return db[_0x6165('0x36')][_0x6165('0x38')](_0x1b3404[_0x6165('0x39')],{})[_0x6165('0x1c')](respondWithResult(_0x111873,0xc9))[_0x6165('0x3a')](handleError(_0x111873,null));};exports[_0x6165('0x1b')]=function(_0x311d1d,_0x1049ef){if(_0x311d1d[_0x6165('0x39')]['id']){delete _0x311d1d['body']['id'];}return db[_0x6165('0x36')][_0x6165('0x37')]({'where':{'id':_0x311d1d[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1049ef,null))['then'](saveUpdates(_0x311d1d[_0x6165('0x39')],null))[_0x6165('0x1c')](respondWithResult(_0x1049ef,null))['catch'](handleError(_0x1049ef,null));};exports['destroy']=function(_0x228659,_0x35e954){return db['OpenchannelInteraction'][_0x6165('0x37')]({'where':{'id':_0x228659[_0x6165('0x2c')]['id']}})[_0x6165('0x1c')](handleEntityNotFound(_0x35e954,null))[_0x6165('0x1c')](removeEntity(_0x35e954,null))[_0x6165('0x3a')](handleError(_0x35e954,null));};exports[_0x6165('0x3b')]=function(_0x781b21,_0x1831e9){return db[_0x6165('0x36')]['describe']()[_0x6165('0x1c')](respondWithResult(_0x1831e9,null))['catch'](handleError(_0x1831e9,null));};exports['addMessage']=function(_0x52dac5,_0x3672d6){return db['OpenchannelMessage']['find']({'where':{'id':_0x52dac5[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3672d6,null))[_0x6165('0x1c')](function(_0x27d093){if(_0x27d093){return _0x27d093['addMessage'](_0x52dac5[_0x6165('0x39')][_0x6165('0x3c')],_['omit'](_0x52dac5['body'],[_0x6165('0x3c'),'id'])||{});}})[_0x6165('0x1c')](respondWithResult(_0x3672d6,null))[_0x6165('0x3a')](handleError(_0x3672d6,null));};exports[_0x6165('0x3d')]=function(_0x177f05,_0x288766){var _0x156450={'raw':![],'where':{}};var _0x5ade0a={};var _0x15ae09={'count':0x0,'rows':[]};return db[_0x6165('0x36')][_0x6165('0x3e')]({'where':{'id':_0x177f05[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x288766,null))[_0x6165('0x1c')](function(_0x10a0c8){if(_0x10a0c8){_0x5ade0a[_0x6165('0x2d')]=_['keys'](db[_0x6165('0x3f')][_0x6165('0x23')]);_0x5ade0a[_0x6165('0x28')]=_[_0x6165('0x2e')](_0x177f05[_0x6165('0x28')]);_0x5ade0a[_0x6165('0x2f')]=_['intersection'](_0x5ade0a[_0x6165('0x2d')],_0x5ade0a[_0x6165('0x28')]);_0x156450['attributes']=_[_0x6165('0x30')](_0x5ade0a[_0x6165('0x2d')],qs[_0x6165('0x32')](_0x177f05[_0x6165('0x28')]['fields']));_0x156450['attributes']=_0x156450[_0x6165('0x31')][_0x6165('0x33')]?_0x156450[_0x6165('0x31')]:_0x5ade0a[_0x6165('0x2d')];if(!_0x177f05[_0x6165('0x28')][_0x6165('0x40')]('nolimit')){_0x156450[_0x6165('0x17')]=qs[_0x6165('0x17')](_0x177f05['query'][_0x6165('0x17')]);_0x156450['offset']=qs[_0x6165('0x15')](_0x177f05[_0x6165('0x28')][_0x6165('0x15')]);}_0x156450[_0x6165('0x41')]=qs[_0x6165('0x42')](_0x177f05['query'][_0x6165('0x42')]);_0x156450[_0x6165('0x43')]=qs['filters'](_['pick'](_0x177f05['query'],_0x5ade0a[_0x6165('0x2f')]));_0x156450['where']['OpenchannelInteractionId']=_0x10a0c8['id'];if(_0x177f05[_0x6165('0x28')][_0x6165('0x44')]){_0x156450[_0x6165('0x43')]=_[_0x6165('0x34')](_0x156450[_0x6165('0x43')],{'$or':_[_0x6165('0x45')](_0x156450[_0x6165('0x31')],function(_0x154692){var _0xc8e962={};_0xc8e962[_0x154692]={'$like':'%'+_0x177f05[_0x6165('0x28')][_0x6165('0x44')]+'%'};return _0xc8e962;})});}if(_0x177f05[_0x6165('0x28')][_0x6165('0x46')]){var _0x24cc9b=_0x177f05[_0x6165('0x28')][_0x6165('0x46')]['split'](',');var _0x24539c={};_0x24539c[_0x24cc9b[0x0]]={'$gte':moment(_0x24cc9b[0x1])[_0x6165('0x47')](_0x6165('0x48'))};_0x156450['where']=_[_0x6165('0x34')](_0x156450[_0x6165('0x43')],_0x24539c);}_0x156450=_[_0x6165('0x34')]({},_0x156450,_0x177f05[_0x6165('0x35')]);return db[_0x6165('0x3f')][_0x6165('0x18')]({'where':_0x156450[_0x6165('0x43')]})[_0x6165('0x1c')](function(_0x4ce3d1){_0x15ae09[_0x6165('0x18')]=_0x4ce3d1;if(_0x177f05['query']['includeAll']){_0x156450[_0x6165('0x49')]=[{'all':!![]}];}return db[_0x6165('0x3f')][_0x6165('0x27')](_0x156450);})[_0x6165('0x1c')](function(_0x521360){_0x15ae09[_0x6165('0x4a')]=_0x521360;return _0x15ae09;});}})[_0x6165('0x1c')](respondWithFilteredResult(_0x288766,_0x156450))[_0x6165('0x3a')](handleError(_0x288766,null));};exports[_0x6165('0x4b')]=function(_0x26b1b6,_0x1a2366){return db['OpenchannelInteraction'][_0x6165('0x37')]({'where':{'id':_0x26b1b6[_0x6165('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1a2366,null))[_0x6165('0x1c')](function(_0x17b4cb){if(_0x17b4cb){return _0x17b4cb['setTags'](_0x26b1b6[_0x6165('0x39')][_0x6165('0x3c')],_[_0x6165('0x4c')](_0x26b1b6[_0x6165('0x39')],[_0x6165('0x3c'),'id'])||{})['spread'](function(){return db[_0x6165('0x4d')][_0x6165('0x27')]({'attributes':['id','name',_0x6165('0x4e')],'where':{'id':_0x26b1b6[_0x6165('0x39')]['ids']}});})[_0x6165('0x1c')](function(_0x46edb0){socket[_0x6165('0x4f')](_0x6165('0x50'),{'id':Number(_0x26b1b6['params']['id']),'tags':_0x46edb0||[]});return{'id':Number(_0x26b1b6[_0x6165('0x2c')]['id']),'tags':_0x46edb0||[]};});}})['then'](respondWithResult(_0x1a2366,null))[_0x6165('0x3a')](handleError(_0x1a2366,null));};exports[_0x6165('0x51')]=function(_0x467e96,_0x3eb85f){return db[_0x6165('0x36')][_0x6165('0x37')]({'where':{'id':_0x467e96[_0x6165('0x2c')]['id']}})[_0x6165('0x1c')](handleEntityNotFound(_0x3eb85f,null))['then'](function(_0x1d9953){if(_0x1d9953){return _0x1d9953['removeTags'](_0x467e96[_0x6165('0x28')][_0x6165('0x3c')]);}})[_0x6165('0x1c')](respondWithStatusCode(_0x3eb85f,null))[_0x6165('0x3a')](handleError(_0x3eb85f,null));};exports['download']=function(_0x7d21af,_0x120b73){var _0x59fc8c=moment()[_0x6165('0x52')]()[_0x6165('0x53')]();var _0xf27f3e=path['join'](config[_0x6165('0x54')],'server',_0x6165('0x55'),_0x6165('0x56'));var _0x485916=path[_0x6165('0x57')](config['root'],_0x6165('0x58'),_0x6165('0x55'),_0x6165('0x59'));var _0x51ec31=path[_0x6165('0x57')](_0xf27f3e,_0x59fc8c);var _0x3cd6f0=util[_0x6165('0x47')](_0x6165('0x5a'),_0x7d21af[_0x6165('0x2c')]['id'],_0x59fc8c);var _0x67cb87=path['join'](_0xf27f3e,_0x3cd6f0);var _0x5c0e35=[];_0x5c0e35[_0x6165('0x5b')]({'model':db[_0x6165('0x5c')],'as':_0x6165('0x5c'),'attributes':['id',_0x6165('0x5d')],'raw':!![]});_0x5c0e35[_0x6165('0x5b')]({'model':db[_0x6165('0x5e')],'as':_0x6165('0x5f'),'attributes':['id',_0x6165('0x60'),'lastName'],'raw':!![]});if(_0x7d21af[_0x6165('0x28')][_0x6165('0x59')]){_0x5c0e35[_0x6165('0x5b')]({'model':db[_0x6165('0x61')],'as':_0x6165('0x61'),'raw':!![]});}var _0x4beb64=[{'model':db[_0x6165('0x3f')],'as':_0x6165('0x62'),'attributes':['id',_0x6165('0x39'),_0x6165('0x63'),_0x6165('0x64'),_0x6165('0x65'),'read'],'include':_0x5c0e35}];_0x4beb64[_0x6165('0x5b')]({'model':db['OpenchannelAccount'],'as':_0x6165('0x66'),'attributes':['id',_0x6165('0x20')]});_0x4beb64[_0x6165('0x5b')]({'model':db[_0x6165('0x5c')],'as':_0x6165('0x67'),'attributes':['id',_0x6165('0x5d')]});return db[_0x6165('0x36')][_0x6165('0x37')]({'where':{'id':_0x7d21af[_0x6165('0x2c')]['id']},'include':_0x4beb64})['then'](handleEntityNotFound(_0x120b73,null))['then'](function(_0x57dfa0){if(_0x57dfa0){var _0x1d91b5=_0x57dfa0[_0x6165('0x68')]({'plain':!![]});fs[_0x6165('0x69')](_0x51ec31);var _0x42e20a={'channel':_0x6165('0x6a'),'account':_0x1d91b5['Account'][_0x6165('0x20')],'agent':_0x1d91b5[_0x6165('0x67')]?_0x1d91b5[_0x6165('0x67')][_0x6165('0x5d')]:_0x6165('0x6b'),'createdAt':moment(_0x1d91b5[_0x6165('0x63')])['format'](_0x6165('0x48'))[_0x6165('0x53')](),'closedAt':_0x1d91b5[_0x6165('0x6c')]?moment(_0x1d91b5[_0x6165('0x6d')])[_0x6165('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1d91b5['disposition'],'visibility':_0x1d91b5['threadId']?_0x6165('0x6e'):_0x6165('0x6f'),'messages':_(_0x1d91b5[_0x6165('0x62')])[_0x6165('0x44')]({'secret':![]})[_0x6165('0x45')](function(_0x5d337b){if(_0x5d337b[_0x6165('0x61')]){var _0x1e33ba=path['join'](_0x485916,_0x5d337b[_0x6165('0x61')][_0x6165('0x70')]);if(fs[_0x6165('0x71')](_0x1e33ba)){fs[_0x6165('0x72')](_0x1e33ba)[_0x6165('0x73')](fs['createWriteStream'](path['join'](_0x51ec31,_0x5d337b[_0x6165('0x61')]['basename'])));}}return{'date':moment(_0x5d337b[_0x6165('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x6165('0x53')](),'sender':_0x5d337b['direction']===_0x6165('0x74')?_0x5d337b[_0x6165('0x5c')]?_0x5d337b['User'][_0x6165('0x5d')]:'System':_0x5d337b['Contact'][_0x6165('0x60')]+(_0x5d337b[_0x6165('0x5f')][_0x6165('0x75')]?'\x20'+_0x5d337b[_0x6165('0x5f')]['lastName']:''),'body':_0x5d337b[_0x6165('0x61')]?_0x5d337b[_0x6165('0x61')][_0x6165('0x70')]:_0x5d337b[_0x6165('0x39')],'direction':_0x5d337b[_0x6165('0x64')]===_0x6165('0x74')?'A':'C','secret':_0x5d337b['secret'],'read':_0x5d337b['read'],'attachment':_0x5d337b[_0x6165('0x61')]};})['value']()};return ejs['renderFile'](path[_0x6165('0x57')](config[_0x6165('0x54')],_0x6165('0x58'),'views',_0x6165('0x76')),{'interaction':_0x42e20a})[_0x6165('0x1c')](function(_0x57d9d9){var _0x44bf19=path['join'](_0x51ec31,_0x6165('0x77')+_0x1d91b5['id']+'-'+_0x59fc8c+_0x6165('0x78'));var _0x5d07aa={'path':_0x44bf19,'channel':_0x6165('0x6a'),'interactionId':_0x1d91b5['id']};return pdf['createPdfFromHTML'](_0x57d9d9,_0x5d07aa);})[_0x6165('0x1c')](function(){return new Promise(function(_0x2fcdd5,_0x500933){zipdir(_0x51ec31,{'saveTo':_0x67cb87},function(_0x5b44ca,_0x32c7c4){if(_0x5b44ca)return _0x500933(_0x5b44ca);return _0x2fcdd5(_0x32c7c4);});})[_0x6165('0x1c')](function(){return new Promise(function(_0x41556b,_0xbd01ef){rimraf(_0x51ec31,function(_0x1d015f){if(_0x1d015f)_0xbd01ef(_0x1d015f);return _0x41556b();});});})[_0x6165('0x1c')](function(){return _0x120b73[_0x6165('0x79')](_0x67cb87,_0x3cd6f0,function(_0x5399d4){if(_0x5399d4){logger[_0x6165('0x1e')](_0x6165('0x7a'),_0x5399d4);}else{fs[_0x6165('0x7b')](_0x67cb87);}});});});}else{return _0x120b73[_0x6165('0x11')](0xc8);}})[_0x6165('0x3a')](handleError(_0x120b73,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index e4e5acc..9906930 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 _0x4f59=['setDataValue','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x2348b7,_0x5e5b00){var _0x227b9f=function(_0x1db845){while(--_0x1db845){_0x2348b7['push'](_0x2348b7['shift']());}};_0x227b9f(++_0x5e5b00);}(_0x4f59,0x81));var _0x94f5=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0x4f59[_0x2f32c4];return _0x3f3018;};'use strict';var EventEmitter=require(_0x94f5('0x0'));var OpenchannelInteraction=require(_0x94f5('0x1'))['db'][_0x94f5('0x2')];var OpenchannelMessage=require(_0x94f5('0x1'))['db'][_0x94f5('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x94f5('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x94f5('0x5'),'afterDestroy':_0x94f5('0x6')};function emitEvent(_0x442f3e){return function(_0x5bb956,_0x3af999,_0x2db52c){_0x5bb956['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x208ddb){_0x5bb956[_0x94f5('0x7')]('Users',_0x208ddb[_0x94f5('0x8')](function(_0xa74d24){return{'id':_0xa74d24['id']};}));return OpenchannelMessage[_0x94f5('0x9')]({'where':{'OpenchannelInteractionId':_0x5bb956['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94f5('0xa')](function(_0x2930db){_0x5bb956[_0x94f5('0x7')](_0x94f5('0xb'),_0x2930db[_0x94f5('0xc')]);OpenchannelInteractionEvents[_0x94f5('0xd')](_0x442f3e+':'+_0x5bb956['id'],_0x5bb956);OpenchannelInteractionEvents[_0x94f5('0xd')](_0x442f3e,_0x5bb956);_0x2db52c(null);})[_0x94f5('0xe')](_0x2db52c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x94f5('0xf')](e,emitEvent(event));}}module[_0x94f5('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xf902=['getUsers','setDataValue','map','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove'];(function(_0x3b415c,_0x1dd4e0){var _0x212656=function(_0xfc8aa8){while(--_0xfc8aa8){_0x3b415c['push'](_0x3b415c['shift']());}};_0x212656(++_0x1dd4e0);}(_0xf902,0x71));var _0x2f90=function(_0x28920b,_0x3e6595){_0x28920b=_0x28920b-0x0;var _0x12fa39=_0xf902[_0x28920b];return _0x12fa39;};'use strict';var EventEmitter=require(_0x2f90('0x0'));var OpenchannelInteraction=require(_0x2f90('0x1'))['db'][_0x2f90('0x2')];var OpenchannelMessage=require(_0x2f90('0x1'))['db'][_0x2f90('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2f90('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2f90('0x5'),'afterDestroy':_0x2f90('0x6')};function emitEvent(_0x3909f8){return function(_0x210161,_0x49cc21,_0x37f6fc){_0x210161[_0x2f90('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x361ada){_0x210161[_0x2f90('0x8')]('Users',_0x361ada[_0x2f90('0x9')](function(_0x97096a){return{'id':_0x97096a['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x210161['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x42dddc){_0x210161[_0x2f90('0x8')]('unreadMessages',_0x42dddc[_0x2f90('0xa')]);OpenchannelInteractionEvents['emit'](_0x3909f8+':'+_0x210161['id'],_0x210161);OpenchannelInteractionEvents[_0x2f90('0xb')](_0x3909f8,_0x210161);_0x37f6fc(null);})[_0x2f90('0xc')](_0x37f6fc(null));};}for(var e in events){if(events[_0x2f90('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x2f90('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 1f40a96..1160b9c 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 _0xfce0=['define','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x267a05,_0x2465ec){var _0x281b32=function(_0x2d0b8a){while(--_0x2d0b8a){_0x267a05['push'](_0x267a05['shift']());}};_0x281b32(++_0x2465ec);}(_0xfce0,0x15c));var _0x0fce=function(_0x4672e9,_0x5caff9){_0x4672e9=_0x4672e9-0x0;var _0x2407fd=_0xfce0[_0x4672e9];return _0x2407fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0fce('0x0'))(_0x0fce('0x1'));var moment=require(_0x0fce('0x2'));var BPromise=require(_0x0fce('0x3'));var rp=require(_0x0fce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fce('0x5'));var config=require(_0x0fce('0x6'));var attributes=require(_0x0fce('0x7'));module[_0x0fce('0x8')]=function(_0x56f295,_0x9ad31c){return _0x56f295[_0x0fce('0x9')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0fce('0xa'),'collate':_0x0fce('0xb'),'hooks':{'beforeUpdate':function(_0x16e3b6,_0x30893c,_0x251b31){if(_0x16e3b6[_0x0fce('0xc')](_0x0fce('0xd'))){_0x16e3b6[_0x0fce('0xe')]=moment()[_0x0fce('0xf')](_0x0fce('0x10'));}_0x251b31(null,_0x16e3b6);}}});}; \ No newline at end of file +var _0x0c23=['bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x14090e,_0x30c2f7){var _0x554da7=function(_0x165d16){while(--_0x165d16){_0x14090e['push'](_0x14090e['shift']());}};_0x554da7(++_0x30c2f7);}(_0x0c23,0x13e));var _0x30c2=function(_0xe92683,_0x458c0c){_0xe92683=_0xe92683-0x0;var _0x1f948c=_0x0c23[_0xe92683];return _0x1f948c;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var logger=require(_0x30c2('0x2'))(_0x30c2('0x3'));var moment=require(_0x30c2('0x4'));var BPromise=require(_0x30c2('0x5'));var rp=require(_0x30c2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30c2('0x7'));var config=require(_0x30c2('0x8'));var attributes=require(_0x30c2('0x9'));module[_0x30c2('0xa')]=function(_0x28630b,_0x166e7a){return _0x28630b['define'](_0x30c2('0xb'),attributes,{'tableName':_0x30c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x30c2('0xd'),'collate':_0x30c2('0xe'),'hooks':{'beforeUpdate':function(_0x405e1e,_0x508c12,_0x410fc0){if(_0x405e1e[_0x30c2('0xf')]('closed')){_0x405e1e[_0x30c2('0x10')]=moment()[_0x30c2('0x11')](_0x30c2('0x12'));}_0x410fc0(null,_0x405e1e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 2a6bb40..b6cbe6a 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 _0x9894=['request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0x38de15,_0x1c0125){var _0x4db04b=function(_0x5c67c1){while(--_0x5c67c1){_0x38de15['push'](_0x38de15['shift']());}};_0x4db04b(++_0x1c0125);}(_0x9894,0xce));var _0x4989=function(_0x12acfe,_0x36ca2b){_0x12acfe=_0x12acfe-0x0;var _0x26be42=_0x9894[_0x12acfe];return _0x26be42;};'use strict';var _=require('lodash');var util=require(_0x4989('0x0'));var moment=require(_0x4989('0x1'));var BPromise=require(_0x4989('0x2'));var rs=require(_0x4989('0x3'));var fs=require('fs');var Redis=require(_0x4989('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4989('0x5'))(_0x4989('0x6'));var config=require('../../config/environment');var jayson=require(_0x4989('0x7'));var client=jayson['client'][_0x4989('0x8')]({'port':0x232a});config[_0x4989('0x9')]=_['defaults'](config[_0x4989('0x9')],{'host':_0x4989('0xa'),'port':0x18eb});var socket=require(_0x4989('0xb'))(new Redis(config[_0x4989('0x9')]));require('./openchannelInteraction.socket')[_0x4989('0xc')](socket);function respondWithRpcPromise(_0x1025b8,_0x26a74e,_0x4c8037){return new BPromise(function(_0x20dead,_0x5dbf49){return client['request'](_0x1025b8,_0x4c8037)[_0x4989('0xd')](function(_0x18ff1e){logger[_0x4989('0xe')](_0x4989('0xf'),_0x26a74e,_0x4989('0x10'));logger['debug'](_0x4989('0x11'),_0x26a74e,'request\x20sent',JSON[_0x4989('0x12')](_0x18ff1e));if(_0x18ff1e['error']){if(_0x18ff1e[_0x4989('0x13')]['code']===0x1f4){logger[_0x4989('0x13')](_0x4989('0xf'),_0x26a74e,_0x18ff1e[_0x4989('0x13')][_0x4989('0x14')]);return _0x5dbf49(_0x18ff1e['error'][_0x4989('0x14')]);}logger[_0x4989('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x26a74e,_0x18ff1e['error'][_0x4989('0x14')]);return _0x20dead(_0x18ff1e['error'][_0x4989('0x14')]);}else{logger[_0x4989('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x26a74e,_0x4989('0x10'));_0x20dead(_0x18ff1e[_0x4989('0x15')][_0x4989('0x14')]);}})[_0x4989('0x16')](function(_0x58fe7b){logger[_0x4989('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x26a74e,_0x58fe7b);_0x5dbf49(_0x58fe7b);});});}exports[_0x4989('0x17')]=function(_0x3fa2de){var _0x12149a=this;return new Promise(function(_0x373262,_0x5451ff){return db['OpenchannelInteraction'][_0x4989('0x18')](_0x3fa2de[_0x4989('0x19')],{'raw':_0x3fa2de[_0x4989('0x1a')]?_0x3fa2de[_0x4989('0x1a')][_0x4989('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fa2de[_0x4989('0x1a')]?_0x3fa2de[_0x4989('0x1a')][_0x4989('0x1c')]||null:null,'attributes':_0x3fa2de[_0x4989('0x1a')]?_0x3fa2de['options']['attributes']||null:null,'limit':_0x3fa2de['options']?_0x3fa2de[_0x4989('0x1a')][_0x4989('0x1d')]||null:null})['then'](function(_0x2f9358){logger[_0x4989('0xe')](_0x4989('0x17'),_0x3fa2de);logger[_0x4989('0x1e')](_0x4989('0x17'),_0x3fa2de,JSON['stringify'](_0x2f9358));_0x373262(_0x2f9358);})['catch'](function(_0x2527fd){logger[_0x4989('0x13')]('UpdateOpenchannelInteraction',_0x2527fd[_0x4989('0x14')],_0x3fa2de);_0x5451ff(_0x12149a[_0x4989('0x13')](0x1f4,_0x2527fd[_0x4989('0x14')]));});});};exports[_0x4989('0x1f')]=function(_0x41ef02){return new Promise(function(_0x4761ef,_0x5ea704){return db['OpenchannelInteraction'][_0x4989('0x20')]({'where':_0x41ef02[_0x4989('0x1a')]?_0x41ef02[_0x4989('0x1a')][_0x4989('0x1c')]||null:null})[_0x4989('0xd')](function(_0x35388b){if(_0x35388b){return _0x35388b[_0x4989('0x21')](_0x41ef02[_0x4989('0x19')]['ids'],_['omit'](_0x41ef02['body'],[_0x4989('0x22'),'id'])||{});}})[_0x4989('0x23')](function(_0x17f671){logger['info'](_0x4989('0x24'),_0x41ef02);logger['debug']('AddTags',_0x41ef02,JSON[_0x4989('0x12')](_0x17f671));_0x4761ef(_0x17f671);})['catch'](function(_0x11756a){logger[_0x4989('0x13')](_0x4989('0x24'),_0x11756a[_0x4989('0x14')],_0x41ef02);_0x5ea704(_this['error'](0x1f4,_0x11756a[_0x4989('0x14')]));});});}; \ No newline at end of file +var _0xeb35=['update','options','raw','attributes','limit','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','OpenchannelInteraction'];(function(_0x2353b3,_0x62f7cb){var _0x34aeeb=function(_0x20e406){while(--_0x20e406){_0x2353b3['push'](_0x2353b3['shift']());}};_0x34aeeb(++_0x62f7cb);}(_0xeb35,0xbb));var _0x5eb3=function(_0x392186,_0x61025a){_0x392186=_0x392186-0x0;var _0x6ac810=_0xeb35[_0x392186];return _0x6ac810;};'use strict';var _=require(_0x5eb3('0x0'));var util=require(_0x5eb3('0x1'));var moment=require('moment');var BPromise=require(_0x5eb3('0x2'));var rs=require(_0x5eb3('0x3'));var fs=require('fs');var Redis=require(_0x5eb3('0x4'));var db=require(_0x5eb3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5eb3('0x6'))(_0x5eb3('0x7'));var config=require(_0x5eb3('0x8'));var jayson=require(_0x5eb3('0x9'));var client=jayson[_0x5eb3('0xa')][_0x5eb3('0xb')]({'port':0x232a});config[_0x5eb3('0xc')]=_['defaults'](config['redis'],{'host':_0x5eb3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5eb3('0xc')]));require('./openchannelInteraction.socket')[_0x5eb3('0xe')](socket);function respondWithRpcPromise(_0x511cc8,_0x2e70a4,_0x119bbc){return new BPromise(function(_0x1e9859,_0x462f00){return client[_0x5eb3('0xf')](_0x511cc8,_0x119bbc)[_0x5eb3('0x10')](function(_0x565798){logger[_0x5eb3('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2e70a4,_0x5eb3('0x12'));logger['debug'](_0x5eb3('0x13'),_0x2e70a4,_0x5eb3('0x12'),JSON[_0x5eb3('0x14')](_0x565798));if(_0x565798[_0x5eb3('0x15')]){if(_0x565798['error'][_0x5eb3('0x16')]===0x1f4){logger['error'](_0x5eb3('0x17'),_0x2e70a4,_0x565798[_0x5eb3('0x15')]['message']);return _0x462f00(_0x565798[_0x5eb3('0x15')][_0x5eb3('0x18')]);}logger[_0x5eb3('0x15')](_0x5eb3('0x17'),_0x2e70a4,_0x565798[_0x5eb3('0x15')]['message']);return _0x1e9859(_0x565798[_0x5eb3('0x15')]['message']);}else{logger['info'](_0x5eb3('0x17'),_0x2e70a4,_0x5eb3('0x12'));_0x1e9859(_0x565798[_0x5eb3('0x19')]['message']);}})[_0x5eb3('0x1a')](function(_0x37f19b){logger[_0x5eb3('0x15')](_0x5eb3('0x17'),_0x2e70a4,_0x37f19b);_0x462f00(_0x37f19b);});});}exports['UpdateOpenchannelInteraction']=function(_0x3e5a27){var _0xdfcd12=this;return new Promise(function(_0x20e3f1,_0x19f88b){return db[_0x5eb3('0x1b')][_0x5eb3('0x1c')](_0x3e5a27['body'],{'raw':_0x3e5a27['options']?_0x3e5a27[_0x5eb3('0x1d')][_0x5eb3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e5a27['options']?_0x3e5a27['options']['where']||null:null,'attributes':_0x3e5a27['options']?_0x3e5a27['options'][_0x5eb3('0x1f')]||null:null,'limit':_0x3e5a27['options']?_0x3e5a27[_0x5eb3('0x1d')][_0x5eb3('0x20')]||null:null})['then'](function(_0x2b923a){logger[_0x5eb3('0x11')](_0x5eb3('0x21'),_0x3e5a27);logger[_0x5eb3('0x22')](_0x5eb3('0x21'),_0x3e5a27,JSON[_0x5eb3('0x14')](_0x2b923a));_0x20e3f1(_0x2b923a);})[_0x5eb3('0x1a')](function(_0x1b1e0a){logger['error']('UpdateOpenchannelInteraction',_0x1b1e0a[_0x5eb3('0x18')],_0x3e5a27);_0x19f88b(_0xdfcd12[_0x5eb3('0x15')](0x1f4,_0x1b1e0a[_0x5eb3('0x18')]));});});};exports[_0x5eb3('0x23')]=function(_0x3df965){return new Promise(function(_0x188820,_0x58de49){return db['OpenchannelInteraction'][_0x5eb3('0x24')]({'where':_0x3df965[_0x5eb3('0x1d')]?_0x3df965[_0x5eb3('0x1d')][_0x5eb3('0x25')]||null:null})[_0x5eb3('0x10')](function(_0x42f751){if(_0x42f751){return _0x42f751[_0x5eb3('0x26')](_0x3df965['body'][_0x5eb3('0x27')],_[_0x5eb3('0x28')](_0x3df965['body'],[_0x5eb3('0x27'),'id'])||{});}})[_0x5eb3('0x29')](function(_0xd9c1a7){logger[_0x5eb3('0x11')](_0x5eb3('0x2a'),_0x3df965);logger[_0x5eb3('0x22')](_0x5eb3('0x2a'),_0x3df965,JSON[_0x5eb3('0x14')](_0xd9c1a7));_0x188820(_0xd9c1a7);})['catch'](function(_0xf4018c){logger['error'](_0x5eb3('0x2a'),_0xf4018c[_0x5eb3('0x18')],_0x3df965);_0x58de49(_this[_0x5eb3('0x15')](0x1f4,_0xf4018c[_0x5eb3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 9d9e133..57dec04 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 _0x03cd=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x03cd,0x1b6));var _0xd03c=function(_0x5434e1,_0x7be127){_0x5434e1=_0x5434e1-0x0;var _0x4d3aaa=_0x03cd[_0x5434e1];return _0x4d3aaa;};'use strict';var OpenchannelInteractionEvents=require(_0xd03c('0x0'));var events=[_0xd03c('0x1'),'remove',_0xd03c('0x2')];function createListener(_0x25f1ac,_0x562b61){return function(_0x1d8d62){_0x562b61[_0xd03c('0x3')](_0x25f1ac,_0x1d8d62);};}function removeListener(_0x5d6007,_0x10f6b7){return function(){OpenchannelInteractionEvents[_0xd03c('0x4')](_0x5d6007,_0x10f6b7);};}exports[_0xd03c('0x5')]=function(_0x5bc1e3){for(var _0x24b573=0x0,_0x55c4cc=events[_0xd03c('0x6')];_0x24b573<_0x55c4cc;_0x24b573++){var _0x55b0ab=events[_0x24b573];var _0x5520d8=createListener(_0xd03c('0x7')+_0x55b0ab,_0x5bc1e3);OpenchannelInteractionEvents['on'](_0x55b0ab,_0x5520d8);}}; \ No newline at end of file +var _0x9a2f=['save','remove','emit','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x5b2fa9,_0x373c61){var _0x3bc18f=function(_0x49eab3){while(--_0x49eab3){_0x5b2fa9['push'](_0x5b2fa9['shift']());}};_0x3bc18f(++_0x373c61);}(_0x9a2f,0xad));var _0xf9a2=function(_0x4376e5,_0x3f44b3){_0x4376e5=_0x4376e5-0x0;var _0x519846=_0x9a2f[_0x4376e5];return _0x519846;};'use strict';var OpenchannelInteractionEvents=require(_0xf9a2('0x0'));var events=[_0xf9a2('0x1'),_0xf9a2('0x2'),'update'];function createListener(_0xea2c2f,_0x2bd2be){return function(_0x32522f){_0x2bd2be[_0xf9a2('0x3')](_0xea2c2f,_0x32522f);};}function removeListener(_0x1cb27d,_0x2605f4){return function(){OpenchannelInteractionEvents['removeListener'](_0x1cb27d,_0x2605f4);};}exports[_0xf9a2('0x4')]=function(_0x4f1f33){for(var _0x1a349f=0x0,_0x3ed07f=events['length'];_0x1a349f<_0x3ed07f;_0x1a349f++){var _0x36321e=events[_0x1a349f];var _0x14eaa6=createListener(_0xf9a2('0x5')+_0x36321e,_0x4f1f33);OpenchannelInteractionEvents['on'](_0x36321e,_0x14eaa6);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index e71277c..91eb9eb 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x12ef00,_0x58825b){_0x12ef00=_0x12ef00-0x0;var _0x2a84e2=_0x70e0[_0x12ef00];return _0x2a84e2;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x236470,_0x752a84){var _0x2b858d=function(_0x40c5b2){while(--_0x40c5b2){_0x236470['push'](_0x236470['shift']());}};_0x2b858d(++_0x752a84);}(_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('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 15683d4..a71ae17 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 _0x4227=['TEXT','sequelize','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x385f9f,_0x10d4fd){var _0x22acd9=function(_0x5b1244){while(--_0x5b1244){_0x385f9f['push'](_0x385f9f['shift']());}};_0x22acd9(++_0x10d4fd);}(_0x4227,0x89));var _0x7422=function(_0x5f13f4,_0x454e04){_0x5f13f4=_0x5f13f4-0x0;var _0x19b2ff=_0x4227[_0x5f13f4];return _0x19b2ff;};'use strict';var Sequelize=require(_0x7422('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x7422('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7422('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7422('0x3')]('in',_0x7422('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7422('0x5')]},'providerName':{'type':Sequelize[_0x7422('0x6')]},'providerResponse':{'type':Sequelize[_0x7422('0x7')]}}; \ No newline at end of file +var _0xaa1b=['BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0x191154,_0x56f74c){var _0x3dcd73=function(_0x51c321){while(--_0x51c321){_0x191154['push'](_0x191154['shift']());}};_0x3dcd73(++_0x56f74c);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'body':{'type':Sequelize[_0xbaa1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbaa1('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbaa1('0x4')]('in',_0xbaa1('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbaa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 014a90a..300f44d 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 _0x29af=['openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteractionId','isNil','read1stAt','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','get','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','openchannel-interactions'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x29af,0x134));var _0xf29a=function(_0x14f54a,_0x42536b){_0x14f54a=_0x14f54a-0x0;var _0x122b3a=_0x29af[_0x14f54a];return _0x122b3a;};'use strict';var emlformat=require(_0xf29a('0x0'));var rimraf=require(_0xf29a('0x1'));var zipdir=require(_0xf29a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf29a('0x3'));var moment=require(_0xf29a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf29a('0x5'));var util=require('util');var path=require(_0xf29a('0x6'));var sox=require(_0xf29a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf29a('0x8'));var _=require(_0xf29a('0x9'));var squel=require(_0xf29a('0xa'));var crypto=require(_0xf29a('0xb'));var jsforce=require(_0xf29a('0xc'));var deskjs=require(_0xf29a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf29a('0xe'));var Papa=require(_0xf29a('0xf'));var Redis=require(_0xf29a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf29a('0x11'));var hardwareService=require(_0xf29a('0x12'));var logger=require(_0xf29a('0x13'))(_0xf29a('0x14'));var utils=require(_0xf29a('0x15'));var config=require(_0xf29a('0x16'));var licenseUtil=require(_0xf29a('0x17'));var db=require('../../mysqldb')['db'];config[_0xf29a('0x18')]=_[_0xf29a('0x19')](config[_0xf29a('0x18')],{'host':_0xf29a('0x1a'),'port':0x18eb});var socket=require(_0xf29a('0x1b'))(new Redis(config[_0xf29a('0x18')]));require(_0xf29a('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf29a('0x1d')]({'port':0x232c});var client9002=jayson[_0xf29a('0x1e')][_0xf29a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x16913b,_0x17faf4,_0x5a351f,_0x34cd2e){return new BPromise(function(_0x42567e,_0x297764){var _0x283fe5=_0x34cd2e||client;return _0x283fe5[_0xf29a('0x1f')](_0x16913b,_0x5a351f)[_0xf29a('0x20')](function(_0x19e886){logger[_0xf29a('0x21')](_0xf29a('0x22'),_0x17faf4,_0xf29a('0x23'));logger['debug'](_0xf29a('0x24'),_0x17faf4,_0xf29a('0x23'),JSON['stringify'](_0x19e886));if(_0x19e886[_0xf29a('0x25')]){if(_0x19e886[_0xf29a('0x25')][_0xf29a('0x26')]===0x1f4){logger['error'](_0xf29a('0x22'),_0x17faf4,_0x19e886['error'][_0xf29a('0x27')]);return _0x297764(_0x19e886[_0xf29a('0x25')][_0xf29a('0x27')]);}logger[_0xf29a('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x17faf4,_0x19e886[_0xf29a('0x25')][_0xf29a('0x27')]);return _0x42567e(_0x19e886[_0xf29a('0x25')][_0xf29a('0x27')]);}else{logger[_0xf29a('0x21')](_0xf29a('0x22'),_0x17faf4,_0xf29a('0x23'));_0x42567e(_0x19e886['result']['message']);}})['catch'](function(_0x262a5f){logger['error'](_0xf29a('0x22'),_0x17faf4,_0x262a5f);_0x297764(_0x262a5f);});});}function respondWithStatusCode(_0xd791e3,_0x45a396){_0x45a396=_0x45a396||0xcc;return function(_0x5aee4a){if(_0x5aee4a){return _0xd791e3[_0xf29a('0x28')](_0x45a396);}return _0xd791e3[_0xf29a('0x29')](_0x45a396)[_0xf29a('0x2a')]();};}function respondWithResult(_0xc2f545,_0x11d1a6){_0x11d1a6=_0x11d1a6||0xc8;return function(_0x3f1bcc){if(_0x3f1bcc){return _0xc2f545['status'](_0x11d1a6)[_0xf29a('0x2b')](_0x3f1bcc);}};}function respondWithFilteredResult(_0x43b4ab,_0x524c16){return function(_0x4b7e38){if(_0x4b7e38){var _0x4fdd1b=typeof _0x524c16[_0xf29a('0x2c')]===_0xf29a('0x2d')&&typeof _0x524c16[_0xf29a('0x2e')]===_0xf29a('0x2d');var _0xcde883=_0x4b7e38[_0xf29a('0x2f')];var _0x694c05=_0x4fdd1b?0x0:_0x524c16['offset'];var _0x2b10d1=_0x4fdd1b?_0x4b7e38[_0xf29a('0x2f')]:_0x524c16[_0xf29a('0x2c')]+_0x524c16[_0xf29a('0x2e')];var _0x476d42;if(_0x2b10d1>=_0xcde883){_0x2b10d1=_0xcde883;_0x476d42=0xc8;}else{_0x476d42=0xce;}_0x43b4ab[_0xf29a('0x29')](_0x476d42);return _0x43b4ab[_0xf29a('0x30')]('Content-Range',_0x694c05+'-'+_0x2b10d1+'/'+_0xcde883)[_0xf29a('0x2b')](_0x4b7e38);}return null;};}function patchUpdates(_0x566b1d){return function(_0x274d25){try{jsonpatch[_0xf29a('0x31')](_0x274d25,_0x566b1d,!![]);}catch(_0x305de7){return BPromise[_0xf29a('0x32')](_0x305de7);}return _0x274d25[_0xf29a('0x33')]();};}function saveUpdates(_0x4e081c,_0x12110d){return function(_0x56dc44){if(_0x56dc44){return _0x56dc44[_0xf29a('0x34')](_0x4e081c)[_0xf29a('0x20')](function(_0x4f88f8){return _0x4f88f8;});}return null;};}function removeEntity(_0x30f6a7,_0x343a80){return function(_0x5b1834){if(_0x5b1834){return _0x5b1834[_0xf29a('0x35')]()[_0xf29a('0x20')](function(){_0x30f6a7[_0xf29a('0x29')](0xcc)[_0xf29a('0x2a')]();});}};}function handleEntityNotFound(_0xc84a77,_0x240698){return function(_0x48972a){if(!_0x48972a){_0xc84a77[_0xf29a('0x28')](0x194);}return _0x48972a;};}function handleError(_0x244d89,_0x10616d){_0x10616d=_0x10616d||0x1f4;return function(_0x545244){logger[_0xf29a('0x25')](_0x545244[_0xf29a('0x36')]);if(_0x545244[_0xf29a('0x37')]){delete _0x545244[_0xf29a('0x37')];}_0x244d89[_0xf29a('0x29')](_0x10616d)[_0xf29a('0x38')](_0x545244);};}exports[_0xf29a('0x39')]=function(_0x3bcba9,_0x1fde1e){var _0x203e26={},_0x243291={},_0x210b49={'count':0x0,'rows':[]};var _0x4e76b3=_['map'](db[_0xf29a('0x3a')][_0xf29a('0x3b')],function(_0x27243d){return{'name':_0x27243d['fieldName'],'type':_0x27243d[_0xf29a('0x3c')][_0xf29a('0x3d')]};});_0x243291[_0xf29a('0x3e')]=_[_0xf29a('0x3f')](_0x4e76b3,_0xf29a('0x37'));_0x243291[_0xf29a('0x40')]=_[_0xf29a('0x41')](_0x3bcba9[_0xf29a('0x40')]);_0x243291[_0xf29a('0x42')]=_[_0xf29a('0x43')](_0x243291[_0xf29a('0x3e')],_0x243291['query']);_0x203e26[_0xf29a('0x44')]=_['intersection'](_0x243291[_0xf29a('0x3e')],qs[_0xf29a('0x45')](_0x3bcba9['query'][_0xf29a('0x45')]));_0x203e26['attributes']=_0x203e26[_0xf29a('0x44')][_0xf29a('0x46')]?_0x203e26[_0xf29a('0x44')]:_0x243291[_0xf29a('0x3e')];if(!_0x3bcba9[_0xf29a('0x40')]['hasOwnProperty'](_0xf29a('0x47'))){_0x203e26[_0xf29a('0x2e')]=qs[_0xf29a('0x2e')](_0x3bcba9[_0xf29a('0x40')]['limit']);_0x203e26[_0xf29a('0x2c')]=qs[_0xf29a('0x2c')](_0x3bcba9[_0xf29a('0x40')][_0xf29a('0x2c')]);}_0x203e26[_0xf29a('0x48')]=qs[_0xf29a('0x49')](_0x3bcba9[_0xf29a('0x40')][_0xf29a('0x49')]);_0x203e26[_0xf29a('0x4a')]=qs[_0xf29a('0x42')](_[_0xf29a('0x4b')](_0x3bcba9[_0xf29a('0x40')],_0x243291[_0xf29a('0x42')]),_0x4e76b3);if(_0x3bcba9[_0xf29a('0x40')][_0xf29a('0x4c')]){_0x203e26[_0xf29a('0x4a')]=_[_0xf29a('0x4d')](_0x203e26[_0xf29a('0x4a')],{'$or':_[_0xf29a('0x3f')](_0x4e76b3,function(_0x3950e4){if(_0x3950e4['type']!=='VIRTUAL'){var _0x90bd27={};_0x90bd27[_0x3950e4[_0xf29a('0x37')]]={'$like':'%'+_0x3bcba9[_0xf29a('0x40')][_0xf29a('0x4c')]+'%'};return _0x90bd27;}})});}_0x203e26=_[_0xf29a('0x4d')]({},_0x203e26,_0x3bcba9[_0xf29a('0x4e')]);var _0x1e1234={'where':_0x203e26[_0xf29a('0x4a')]};return db[_0xf29a('0x3a')][_0xf29a('0x2f')](_0x1e1234)[_0xf29a('0x20')](function(_0x45975b){_0x210b49[_0xf29a('0x2f')]=_0x45975b;if(_0x3bcba9[_0xf29a('0x40')][_0xf29a('0x4f')]){_0x203e26[_0xf29a('0x50')]=[{'all':!![]}];}return db[_0xf29a('0x3a')][_0xf29a('0x51')](_0x203e26);})[_0xf29a('0x20')](function(_0x26de80){_0x210b49[_0xf29a('0x52')]=_0x26de80;return _0x210b49;})[_0xf29a('0x20')](respondWithFilteredResult(_0x1fde1e,_0x203e26))['catch'](handleError(_0x1fde1e,null));};exports[_0xf29a('0x53')]=function(_0x2545cd,_0x42bf31){var _0x434d6f={'raw':!![],'where':{'id':_0x2545cd['params']['id']}},_0x3f80a5={};_0x3f80a5[_0xf29a('0x3e')]=_[_0xf29a('0x41')](db[_0xf29a('0x3a')]['rawAttributes']);_0x3f80a5['query']=_['keys'](_0x2545cd[_0xf29a('0x40')]);_0x3f80a5[_0xf29a('0x42')]=_['intersection'](_0x3f80a5['model'],_0x3f80a5[_0xf29a('0x40')]);_0x434d6f[_0xf29a('0x44')]=_['intersection'](_0x3f80a5[_0xf29a('0x3e')],qs[_0xf29a('0x45')](_0x2545cd['query']['fields']));_0x434d6f['attributes']=_0x434d6f[_0xf29a('0x44')][_0xf29a('0x46')]?_0x434d6f[_0xf29a('0x44')]:_0x3f80a5[_0xf29a('0x3e')];if(_0x2545cd[_0xf29a('0x40')][_0xf29a('0x4f')]){_0x434d6f['include']=[{'all':!![]}];}_0x434d6f=_[_0xf29a('0x4d')]({},_0x434d6f,_0x2545cd[_0xf29a('0x4e')]);return db[_0xf29a('0x3a')][_0xf29a('0x54')](_0x434d6f)[_0xf29a('0x20')](handleEntityNotFound(_0x42bf31,null))[_0xf29a('0x20')](respondWithResult(_0x42bf31,null))[_0xf29a('0x55')](handleError(_0x42bf31,null));};exports[_0xf29a('0x56')]=function(_0x2a289d,_0x546dba){return db['OpenchannelMessage'][_0xf29a('0x56')](_0x2a289d[_0xf29a('0x57')],{})[_0xf29a('0x20')](respondWithResult(_0x546dba,0xc9))[_0xf29a('0x55')](handleError(_0x546dba,null));};exports['update']=function(_0x4e2f62,_0x527c9a){if(_0x4e2f62[_0xf29a('0x57')]['id']){delete _0x4e2f62[_0xf29a('0x57')]['id'];}return db[_0xf29a('0x3a')][_0xf29a('0x54')]({'where':{'id':_0x4e2f62['params']['id']}})[_0xf29a('0x20')](handleEntityNotFound(_0x527c9a,null))[_0xf29a('0x20')](saveUpdates(_0x4e2f62[_0xf29a('0x57')],null))[_0xf29a('0x20')](respondWithResult(_0x527c9a,null))['catch'](handleError(_0x527c9a,null));};exports[_0xf29a('0x35')]=function(_0x552d27,_0x3fb464){return db[_0xf29a('0x3a')][_0xf29a('0x54')]({'where':{'id':_0x552d27[_0xf29a('0x58')]['id']}})[_0xf29a('0x20')](handleEntityNotFound(_0x3fb464,null))[_0xf29a('0x20')](removeEntity(_0x3fb464,null))[_0xf29a('0x55')](handleError(_0x3fb464,null));};exports[_0xf29a('0x59')]=function(_0x5c87cf,_0x664a59){return db[_0xf29a('0x3a')][_0xf29a('0x59')]()[_0xf29a('0x20')](respondWithResult(_0x664a59,null))[_0xf29a('0x55')](handleError(_0x664a59,null));};var interaction_log=require(_0xf29a('0x13'))(_0xf29a('0x5a'));exports['accept']=function(_0x2c1afc,_0x9eeb6a,_0xe81bcb){var _0x50ca33={'agent':{},'channel':_0xf29a('0x5b')};if(_0x2c1afc[_0xf29a('0x57')]['id']){delete _0x2c1afc[_0xf29a('0x57')]['id'];}_0x2c1afc[_0xf29a('0x57')][_0xf29a('0x5c')]=!![];_0x2c1afc[_0xf29a('0x57')][_0xf29a('0x5d')]=moment()[_0xf29a('0x5e')](_0xf29a('0x5f'));_0x2c1afc['body'][_0xf29a('0x60')]=_0x2c1afc[_0xf29a('0x57')][_0xf29a('0x60')]||_0x2c1afc[_0xf29a('0x61')]['id'];_0x50ca33[_0xf29a('0x62')]['id']=_0x2c1afc[_0xf29a('0x57')][_0xf29a('0x60')];return db['OpenchannelMessage'][_0xf29a('0x54')]({'where':{'id':_0x2c1afc[_0xf29a('0x58')]['id'],'UserId':null}})[_0xf29a('0x20')](handleEntityNotFound(_0x9eeb6a,null))[_0xf29a('0x20')](saveUpdates(_0x2c1afc[_0xf29a('0x57')],null))[_0xf29a('0x20')](function(_0x4f6a67){if(_0x4f6a67){_0x50ca33['message']=_0x4f6a67['get']({'plain':!![]});return db['OpenchannelInteraction'][_0xf29a('0x54')]({'where':{'id':_0x4f6a67[_0xf29a('0x63')]}});}return null;})[_0xf29a('0x20')](handleEntityNotFound(_0x9eeb6a,null))[_0xf29a('0x20')](function(_0x5669ec){if(_0x5669ec){return _0x5669ec['update']({'UserId':_0x2c1afc[_0xf29a('0x57')][_0xf29a('0x60')],'read1stAt':_[_0xf29a('0x64')](_0x5669ec[_0xf29a('0x65')])?moment()[_0xf29a('0x5e')](_0xf29a('0x5f')):undefined});}return null;})[_0xf29a('0x20')](function(_0x2cf06c){if(_0x2cf06c){_0x50ca33['interaction']=_0x2cf06c['get']({'plain':!![]});interaction_log[_0xf29a('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c1afc[_0xf29a('0x61')]['id'],_0x2c1afc[_0xf29a('0x61')][_0xf29a('0x37')],_0x2c1afc[_0xf29a('0x61')]['role'],_0x50ca33[_0xf29a('0x66')]['id'],_0x2c1afc['body']?JSON[_0xf29a('0x67')](_0x2c1afc[_0xf29a('0x57')]):_0xf29a('0x68'));return respondWithRpcPromise(_0xf29a('0x69'),_0xf29a('0x6a'),_0x50ca33);}return null;})[_0xf29a('0x20')](function(_0x32cdf1){var _0x3644e3=_0xf29a('0x6b')+_0x32cdf1['message'][_0xf29a('0x6c')];return db[_0xf29a('0x6d')][_0xf29a('0x40')](_0x3644e3,{'type':db[_0xf29a('0x6e')][_0xf29a('0x6f')][_0xf29a('0x70')],'raw':!![]})[_0xf29a('0x20')](function(_0x186c46){return _0x186c46;});})[_0xf29a('0x20')](function(_0x138383){if(_0x138383){_0x50ca33[_0xf29a('0x27')][_0xf29a('0x71')]=_0x138383[0x0];if(!_0x2c1afc[_0xf29a('0x57')]['UserId'])return;return db[_0xf29a('0x72')]['find']({'where':{'id':_0x2c1afc[_0xf29a('0x57')]['UserId'],'role':_0xf29a('0x62')},'attributes':['id',_0xf29a('0x37'),_0xf29a('0x73'),_0xf29a('0x74'),_0xf29a('0x75')],'raw':!![]});}return null;})[_0xf29a('0x20')](function(_0x40ecb9){if(!_0x40ecb9)return null;_0x50ca33['message']['agent']=_0x40ecb9;return _0x50ca33;})[_0xf29a('0x20')](function(_0x35c596){if(_0x35c596){if(_0x2c1afc['body'][_0xf29a('0x76')]){_0x50ca33[_0xf29a('0x27')][_0xf29a('0x77')]=util[_0xf29a('0x5e')](_0xf29a('0x78'),_0x2c1afc[_0xf29a('0x61')][_0xf29a('0x37')]);_0x50ca33[_0xf29a('0x27')][_0xf29a('0x79')]=_0x50ca33[_0xf29a('0x79')];_0x50ca33['message'][_0xf29a('0x7a')]=_0x50ca33['channel'];_0x50ca33[_0xf29a('0x27')][_0xf29a('0x7b')]=_0xf29a('0x7c');return respondWithRpcPromise(_0xf29a('0x7d'),'EventManager',{'event':_0xf29a('0x7e'),'message':_0x50ca33[_0xf29a('0x27')]},client9002)[_0xf29a('0x20')](function(){return _0x50ca33;});}return _0x50ca33;}return null;})[_0xf29a('0x20')](respondWithResult(_0x9eeb6a,null))[_0xf29a('0x55')](handleError(_0x9eeb6a,null));};var interaction_log=require(_0xf29a('0x13'))(_0xf29a('0x5a'));exports['reject']=function(_0x1f408a,_0x45072b,_0x4ebdcb){var _0x48b52a={'agent':{},'channel':'openchannel'};if(_0x1f408a[_0xf29a('0x57')]['id']){delete _0x1f408a[_0xf29a('0x57')]['id'];}_0x1f408a[_0xf29a('0x57')][_0xf29a('0x60')]=_0x1f408a[_0xf29a('0x57')][_0xf29a('0x60')]||_0x1f408a[_0xf29a('0x61')]['id'];_0x48b52a[_0xf29a('0x62')]['id']=_0x1f408a[_0xf29a('0x57')][_0xf29a('0x60')];return db[_0xf29a('0x3a')]['find']({'where':{'id':_0x1f408a[_0xf29a('0x58')]['id'],'UserId':null}})[_0xf29a('0x20')](handleEntityNotFound(_0x45072b,null))[_0xf29a('0x20')](function(_0x214a50){if(_0x214a50){_0x48b52a[_0xf29a('0x27')]=_0x214a50[_0xf29a('0x7f')]({'plain':!![]});return db[_0xf29a('0x80')][_0xf29a('0x54')]({'where':{'id':_0x214a50['OpenchannelInteractionId']}});}return null;})[_0xf29a('0x20')](handleEntityNotFound(_0x45072b,null))[_0xf29a('0x20')](function(_0x5b60cc){if(_0x5b60cc){_0x48b52a[_0xf29a('0x66')]=_0x5b60cc[_0xf29a('0x7f')]({'plain':!![]});interaction_log['info'](_0xf29a('0x81'),_0x1f408a['user']['id'],_0x1f408a[_0xf29a('0x61')][_0xf29a('0x37')],_0x1f408a[_0xf29a('0x61')][_0xf29a('0x82')],_0x48b52a[_0xf29a('0x66')]['id'],_0x1f408a[_0xf29a('0x57')]?JSON[_0xf29a('0x67')](_0x1f408a[_0xf29a('0x57')]):_0xf29a('0x68'));return respondWithRpcPromise(_0xf29a('0x83'),_0xf29a('0x84'),_0x48b52a);}return null;})['then'](function(_0x4b2bff){var _0x49b017=_0xf29a('0x6b')+_0x4b2bff[_0xf29a('0x27')][_0xf29a('0x6c')];return db[_0xf29a('0x6d')][_0xf29a('0x40')](_0x49b017,{'type':db[_0xf29a('0x6e')][_0xf29a('0x6f')][_0xf29a('0x70')],'raw':!![]})['then'](function(_0x5d69a1){return _0x5d69a1;});})[_0xf29a('0x20')](function(_0x42083f){if(_0x42083f){_0x48b52a[_0xf29a('0x27')]['contact']=_0x42083f[0x0];if(!_0x1f408a[_0xf29a('0x57')][_0xf29a('0x60')])return;return db[_0xf29a('0x72')]['find']({'where':{'id':_0x1f408a['body'][_0xf29a('0x60')],'role':_0xf29a('0x62')},'attributes':['id','name',_0xf29a('0x73'),_0xf29a('0x74'),_0xf29a('0x75')],'raw':!![]});}return null;})['then'](function(_0x321306){if(!_0x321306)return null;_0x48b52a['message']['agent']=_0x321306;return _0x48b52a;})[_0xf29a('0x20')](function(_0x273542){if(_0x273542){_0x273542['message']['interface']=util[_0xf29a('0x5e')](_0xf29a('0x78'),_0x1f408a[_0xf29a('0x61')][_0xf29a('0x37')]);_0x273542[_0xf29a('0x27')][_0xf29a('0x79')]=_0x48b52a[_0xf29a('0x79')];_0x273542[_0xf29a('0x27')]['motionChannel']=_0x48b52a[_0xf29a('0x79')];_0x273542[_0xf29a('0x27')][_0xf29a('0x7b')]=_0xf29a('0x32');respondWithRpcPromise(_0xf29a('0x7d'),_0xf29a('0x7d'),{'event':'rejectmessage','message':_0x273542[_0xf29a('0x27')]},client9002);return _0x48b52a;}return null;})['then'](respondWithResult(_0x45072b,null))[_0xf29a('0x55')](handleError(_0x45072b,null));}; \ No newline at end of file +var _0x3cd2=['null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','RejectMessage','rejectMessage','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./openchannelMessage.socket','register','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','offset','limit','count','status','set','Content-Range','reject','update','then','destroy','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','show','includeAll','options','find','create','body','params','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify'];(function(_0x46131d,_0x4e701d){var _0x301c71=function(_0x1ce369){while(--_0x1ce369){_0x46131d['push'](_0x46131d['shift']());}};_0x301c71(++_0x4e701d);}(_0x3cd2,0x115));var _0x23cd=function(_0x1c0fa0,_0x43e1e7){_0x1c0fa0=_0x1c0fa0-0x0;var _0x47525f=_0x3cd2[_0x1c0fa0];return _0x47525f;};'use strict';var emlformat=require(_0x23cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x23cd('0x1'));var moment=require(_0x23cd('0x2'));var BPromise=require(_0x23cd('0x3'));var Mustache=require(_0x23cd('0x4'));var util=require('util');var path=require(_0x23cd('0x5'));var sox=require(_0x23cd('0x6'));var csv=require('to-csv');var ejs=require(_0x23cd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x23cd('0x8'));var squel=require(_0x23cd('0x9'));var crypto=require('crypto');var jsforce=require(_0x23cd('0xa'));var deskjs=require(_0x23cd('0xb'));var toCsv=require(_0x23cd('0xc'));var querystring=require('querystring');var Papa=require(_0x23cd('0xd'));var Redis=require(_0x23cd('0xe'));var authService=require(_0x23cd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x23cd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x23cd('0x11'))('api');var utils=require(_0x23cd('0x12'));var config=require(_0x23cd('0x13'));var licenseUtil=require(_0x23cd('0x14'));var db=require(_0x23cd('0x15'))['db'];config[_0x23cd('0x16')]=_['defaults'](config[_0x23cd('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23cd('0x16')]));require(_0x23cd('0x17'))[_0x23cd('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x23cd('0x19')][_0x23cd('0x1a')]({'port':0x232c});var client9002=jayson[_0x23cd('0x19')][_0x23cd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x47ae59,_0x5d3928,_0x4d09cc,_0x20c0a1){return new BPromise(function(_0x5a12d1,_0x1b600a){var _0x30e951=_0x20c0a1||client;return _0x30e951[_0x23cd('0x1b')](_0x47ae59,_0x4d09cc)['then'](function(_0x59ff04){logger[_0x23cd('0x1c')](_0x23cd('0x1d'),_0x5d3928,_0x23cd('0x1e'));logger['debug'](_0x23cd('0x1f'),_0x5d3928,'request\x20sent',JSON['stringify'](_0x59ff04));if(_0x59ff04[_0x23cd('0x20')]){if(_0x59ff04[_0x23cd('0x20')][_0x23cd('0x21')]===0x1f4){logger[_0x23cd('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x5d3928,_0x59ff04[_0x23cd('0x20')]['message']);return _0x1b600a(_0x59ff04[_0x23cd('0x20')]['message']);}logger[_0x23cd('0x20')](_0x23cd('0x1d'),_0x5d3928,_0x59ff04['error'][_0x23cd('0x22')]);return _0x5a12d1(_0x59ff04['error'][_0x23cd('0x22')]);}else{logger[_0x23cd('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x5d3928,_0x23cd('0x1e'));_0x5a12d1(_0x59ff04['result'][_0x23cd('0x22')]);}})[_0x23cd('0x23')](function(_0x3db72e){logger[_0x23cd('0x20')](_0x23cd('0x1d'),_0x5d3928,_0x3db72e);_0x1b600a(_0x3db72e);});});}function respondWithStatusCode(_0xaab4dc,_0x1d480e){_0x1d480e=_0x1d480e||0xcc;return function(_0xcff3cc){if(_0xcff3cc){return _0xaab4dc[_0x23cd('0x24')](_0x1d480e);}return _0xaab4dc['status'](_0x1d480e)[_0x23cd('0x25')]();};}function respondWithResult(_0x30e4dc,_0x1b194c){_0x1b194c=_0x1b194c||0xc8;return function(_0x4f14ad){if(_0x4f14ad){return _0x30e4dc['status'](_0x1b194c)['json'](_0x4f14ad);}};}function respondWithFilteredResult(_0x18b68e,_0x26b02e){return function(_0x1ec2eb){if(_0x1ec2eb){var _0x33e30c=typeof _0x26b02e[_0x23cd('0x26')]==='undefined'&&typeof _0x26b02e[_0x23cd('0x27')]==='undefined';var _0x19de84=_0x1ec2eb['count'];var _0x538eca=_0x33e30c?0x0:_0x26b02e[_0x23cd('0x26')];var _0x5c9175=_0x33e30c?_0x1ec2eb[_0x23cd('0x28')]:_0x26b02e[_0x23cd('0x26')]+_0x26b02e[_0x23cd('0x27')];var _0x26f0d5;if(_0x5c9175>=_0x19de84){_0x5c9175=_0x19de84;_0x26f0d5=0xc8;}else{_0x26f0d5=0xce;}_0x18b68e[_0x23cd('0x29')](_0x26f0d5);return _0x18b68e[_0x23cd('0x2a')](_0x23cd('0x2b'),_0x538eca+'-'+_0x5c9175+'/'+_0x19de84)['json'](_0x1ec2eb);}return null;};}function patchUpdates(_0x55971d){return function(_0x3e150c){try{jsonpatch['apply'](_0x3e150c,_0x55971d,!![]);}catch(_0x1ce40e){return BPromise[_0x23cd('0x2c')](_0x1ce40e);}return _0x3e150c['save']();};}function saveUpdates(_0x24f7d5,_0x3ce113){return function(_0x2a82e2){if(_0x2a82e2){return _0x2a82e2[_0x23cd('0x2d')](_0x24f7d5)[_0x23cd('0x2e')](function(_0x48c1cc){return _0x48c1cc;});}return null;};}function removeEntity(_0x4a38f9,_0xb314ab){return function(_0x23cc05){if(_0x23cc05){return _0x23cc05[_0x23cd('0x2f')]()[_0x23cd('0x2e')](function(){_0x4a38f9[_0x23cd('0x29')](0xcc)[_0x23cd('0x25')]();});}};}function handleEntityNotFound(_0x23359a,_0x5f2431){return function(_0x4e6ee0){if(!_0x4e6ee0){_0x23359a[_0x23cd('0x24')](0x194);}return _0x4e6ee0;};}function handleError(_0x26dbda,_0x2f4bfb){_0x2f4bfb=_0x2f4bfb||0x1f4;return function(_0x4542df){logger[_0x23cd('0x20')](_0x4542df['stack']);if(_0x4542df[_0x23cd('0x30')]){delete _0x4542df[_0x23cd('0x30')];}_0x26dbda[_0x23cd('0x29')](_0x2f4bfb)[_0x23cd('0x31')](_0x4542df);};}exports[_0x23cd('0x32')]=function(_0x12fad5,_0x33b0da){var _0x43199b={},_0x7f9988={},_0x1fce51={'count':0x0,'rows':[]};var _0xc32191=_['map'](db[_0x23cd('0x33')][_0x23cd('0x34')],function(_0x3410ba){return{'name':_0x3410ba[_0x23cd('0x35')],'type':_0x3410ba[_0x23cd('0x36')][_0x23cd('0x37')]};});_0x7f9988['model']=_[_0x23cd('0x38')](_0xc32191,'name');_0x7f9988[_0x23cd('0x39')]=_[_0x23cd('0x3a')](_0x12fad5[_0x23cd('0x39')]);_0x7f9988[_0x23cd('0x3b')]=_[_0x23cd('0x3c')](_0x7f9988[_0x23cd('0x3d')],_0x7f9988['query']);_0x43199b[_0x23cd('0x3e')]=_[_0x23cd('0x3c')](_0x7f9988['model'],qs[_0x23cd('0x3f')](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x3f')]));_0x43199b[_0x23cd('0x3e')]=_0x43199b[_0x23cd('0x3e')][_0x23cd('0x40')]?_0x43199b[_0x23cd('0x3e')]:_0x7f9988[_0x23cd('0x3d')];if(!_0x12fad5[_0x23cd('0x39')][_0x23cd('0x41')](_0x23cd('0x42'))){_0x43199b[_0x23cd('0x27')]=qs[_0x23cd('0x27')](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x27')]);_0x43199b['offset']=qs['offset'](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x26')]);}_0x43199b[_0x23cd('0x43')]=qs[_0x23cd('0x44')](_0x12fad5[_0x23cd('0x39')][_0x23cd('0x44')]);_0x43199b[_0x23cd('0x45')]=qs['filters'](_[_0x23cd('0x46')](_0x12fad5['query'],_0x7f9988[_0x23cd('0x3b')]),_0xc32191);if(_0x12fad5['query']['filter']){_0x43199b[_0x23cd('0x45')]=_[_0x23cd('0x47')](_0x43199b[_0x23cd('0x45')],{'$or':_[_0x23cd('0x38')](_0xc32191,function(_0x4e9a45){if(_0x4e9a45[_0x23cd('0x36')]!==_0x23cd('0x48')){var _0x28ec57={};_0x28ec57[_0x4e9a45[_0x23cd('0x30')]]={'$like':'%'+_0x12fad5['query'][_0x23cd('0x49')]+'%'};return _0x28ec57;}})});}_0x43199b=_[_0x23cd('0x47')]({},_0x43199b,_0x12fad5['options']);var _0x674ef4={'where':_0x43199b[_0x23cd('0x45')]};return db[_0x23cd('0x33')][_0x23cd('0x28')](_0x674ef4)[_0x23cd('0x2e')](function(_0x113515){_0x1fce51['count']=_0x113515;if(_0x12fad5[_0x23cd('0x39')]['includeAll']){_0x43199b[_0x23cd('0x4a')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x23cd('0x4b')](_0x43199b);})['then'](function(_0x5f110f){_0x1fce51[_0x23cd('0x4c')]=_0x5f110f;return _0x1fce51;})[_0x23cd('0x2e')](respondWithFilteredResult(_0x33b0da,_0x43199b))['catch'](handleError(_0x33b0da,null));};exports[_0x23cd('0x4d')]=function(_0x12f384,_0x4267d1){var _0x2cf781={'raw':!![],'where':{'id':_0x12f384['params']['id']}},_0x3c8621={};_0x3c8621[_0x23cd('0x3d')]=_[_0x23cd('0x3a')](db[_0x23cd('0x33')][_0x23cd('0x34')]);_0x3c8621[_0x23cd('0x39')]=_[_0x23cd('0x3a')](_0x12f384['query']);_0x3c8621[_0x23cd('0x3b')]=_[_0x23cd('0x3c')](_0x3c8621['model'],_0x3c8621[_0x23cd('0x39')]);_0x2cf781['attributes']=_['intersection'](_0x3c8621['model'],qs[_0x23cd('0x3f')](_0x12f384['query'][_0x23cd('0x3f')]));_0x2cf781[_0x23cd('0x3e')]=_0x2cf781[_0x23cd('0x3e')]['length']?_0x2cf781[_0x23cd('0x3e')]:_0x3c8621[_0x23cd('0x3d')];if(_0x12f384[_0x23cd('0x39')][_0x23cd('0x4e')]){_0x2cf781[_0x23cd('0x4a')]=[{'all':!![]}];}_0x2cf781=_[_0x23cd('0x47')]({},_0x2cf781,_0x12f384[_0x23cd('0x4f')]);return db[_0x23cd('0x33')][_0x23cd('0x50')](_0x2cf781)[_0x23cd('0x2e')](handleEntityNotFound(_0x4267d1,null))[_0x23cd('0x2e')](respondWithResult(_0x4267d1,null))[_0x23cd('0x23')](handleError(_0x4267d1,null));};exports['create']=function(_0x327520,_0x4bbd71){return db[_0x23cd('0x33')][_0x23cd('0x51')](_0x327520[_0x23cd('0x52')],{})[_0x23cd('0x2e')](respondWithResult(_0x4bbd71,0xc9))[_0x23cd('0x23')](handleError(_0x4bbd71,null));};exports[_0x23cd('0x2d')]=function(_0x30384d,_0x1b0a8e){if(_0x30384d['body']['id']){delete _0x30384d['body']['id'];}return db[_0x23cd('0x33')][_0x23cd('0x50')]({'where':{'id':_0x30384d[_0x23cd('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b0a8e,null))[_0x23cd('0x2e')](saveUpdates(_0x30384d[_0x23cd('0x52')],null))[_0x23cd('0x2e')](respondWithResult(_0x1b0a8e,null))[_0x23cd('0x23')](handleError(_0x1b0a8e,null));};exports['destroy']=function(_0x23eb42,_0x15901f){return db[_0x23cd('0x33')][_0x23cd('0x50')]({'where':{'id':_0x23eb42[_0x23cd('0x53')]['id']}})[_0x23cd('0x2e')](handleEntityNotFound(_0x15901f,null))[_0x23cd('0x2e')](removeEntity(_0x15901f,null))[_0x23cd('0x23')](handleError(_0x15901f,null));};exports[_0x23cd('0x54')]=function(_0xe5547e,_0x4752fc){return db[_0x23cd('0x33')]['describe']()[_0x23cd('0x2e')](respondWithResult(_0x4752fc,null))['catch'](handleError(_0x4752fc,null));};var interaction_log=require('../../config/logger')(_0x23cd('0x55'));exports[_0x23cd('0x56')]=function(_0x1aab42,_0x94a9c8,_0x444e2b){var _0x4373ba={'agent':{},'channel':'openchannel'};if(_0x1aab42[_0x23cd('0x52')]['id']){delete _0x1aab42[_0x23cd('0x52')]['id'];}_0x1aab42['body'][_0x23cd('0x57')]=!![];_0x1aab42[_0x23cd('0x52')][_0x23cd('0x58')]=moment()[_0x23cd('0x59')](_0x23cd('0x5a'));_0x1aab42[_0x23cd('0x52')][_0x23cd('0x5b')]=_0x1aab42['body'][_0x23cd('0x5b')]||_0x1aab42[_0x23cd('0x5c')]['id'];_0x4373ba[_0x23cd('0x5d')]['id']=_0x1aab42[_0x23cd('0x52')][_0x23cd('0x5b')];return db[_0x23cd('0x33')][_0x23cd('0x50')]({'where':{'id':_0x1aab42['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x94a9c8,null))[_0x23cd('0x2e')](saveUpdates(_0x1aab42[_0x23cd('0x52')],null))[_0x23cd('0x2e')](function(_0x15ab3e){if(_0x15ab3e){_0x4373ba[_0x23cd('0x22')]=_0x15ab3e[_0x23cd('0x5e')]({'plain':!![]});return db['OpenchannelInteraction'][_0x23cd('0x50')]({'where':{'id':_0x15ab3e[_0x23cd('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x94a9c8,null))[_0x23cd('0x2e')](function(_0x14f209){if(_0x14f209){return _0x14f209[_0x23cd('0x2d')]({'UserId':_0x1aab42[_0x23cd('0x52')]['UserId'],'read1stAt':_['isNil'](_0x14f209[_0x23cd('0x60')])?moment()['format'](_0x23cd('0x5a')):undefined});}return null;})[_0x23cd('0x2e')](function(_0xb3b855){if(_0xb3b855){_0x4373ba[_0x23cd('0x61')]=_0xb3b855[_0x23cd('0x5e')]({'plain':!![]});interaction_log[_0x23cd('0x1c')](_0x23cd('0x62'),_0x1aab42[_0x23cd('0x5c')]['id'],_0x1aab42['user'][_0x23cd('0x30')],_0x1aab42[_0x23cd('0x5c')][_0x23cd('0x63')],_0x4373ba[_0x23cd('0x61')]['id'],_0x1aab42[_0x23cd('0x52')]?JSON[_0x23cd('0x64')](_0x1aab42['body']):_0x23cd('0x65'));return respondWithRpcPromise(_0x23cd('0x66'),_0x23cd('0x67'),_0x4373ba);}return null;})[_0x23cd('0x2e')](function(_0x2787b5){var _0x8ffc18=_0x23cd('0x68')+_0x2787b5[_0x23cd('0x22')][_0x23cd('0x69')];return db[_0x23cd('0x6a')]['query'](_0x8ffc18,{'type':db[_0x23cd('0x6b')][_0x23cd('0x6c')][_0x23cd('0x6d')],'raw':!![]})['then'](function(_0x4ebfa3){return _0x4ebfa3;});})[_0x23cd('0x2e')](function(_0x239e24){if(_0x239e24){_0x4373ba['message'][_0x23cd('0x6e')]=_0x239e24[0x0];if(!_0x1aab42['body'][_0x23cd('0x5b')])return;return db[_0x23cd('0x6f')][_0x23cd('0x50')]({'where':{'id':_0x1aab42[_0x23cd('0x52')]['UserId'],'role':'agent'},'attributes':['id',_0x23cd('0x30'),_0x23cd('0x70'),_0x23cd('0x71'),_0x23cd('0x72')],'raw':!![]});}return null;})[_0x23cd('0x2e')](function(_0x4c6ff8){if(!_0x4c6ff8)return null;_0x4373ba[_0x23cd('0x22')][_0x23cd('0x5d')]=_0x4c6ff8;return _0x4373ba;})['then'](function(_0x2d0904){if(_0x2d0904){if(_0x1aab42[_0x23cd('0x52')][_0x23cd('0x73')]){_0x4373ba[_0x23cd('0x22')][_0x23cd('0x74')]=util[_0x23cd('0x59')](_0x23cd('0x75'),_0x1aab42['user'][_0x23cd('0x30')]);_0x4373ba[_0x23cd('0x22')][_0x23cd('0x76')]=_0x4373ba[_0x23cd('0x76')];_0x4373ba[_0x23cd('0x22')][_0x23cd('0x77')]=_0x4373ba['channel'];_0x4373ba[_0x23cd('0x22')][_0x23cd('0x78')]=_0x23cd('0x56');return respondWithRpcPromise(_0x23cd('0x79'),_0x23cd('0x79'),{'event':_0x23cd('0x7a'),'message':_0x4373ba[_0x23cd('0x22')]},client9002)[_0x23cd('0x2e')](function(){return _0x4373ba;});}return _0x4373ba;}return null;})[_0x23cd('0x2e')](respondWithResult(_0x94a9c8,null))[_0x23cd('0x23')](handleError(_0x94a9c8,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x23cd('0x2c')]=function(_0x389e62,_0x1bd6e8,_0x1b0c20){var _0x42f59e={'agent':{},'channel':_0x23cd('0x7b')};if(_0x389e62['body']['id']){delete _0x389e62[_0x23cd('0x52')]['id'];}_0x389e62[_0x23cd('0x52')][_0x23cd('0x5b')]=_0x389e62[_0x23cd('0x52')][_0x23cd('0x5b')]||_0x389e62[_0x23cd('0x5c')]['id'];_0x42f59e[_0x23cd('0x5d')]['id']=_0x389e62[_0x23cd('0x52')]['UserId'];return db['OpenchannelMessage'][_0x23cd('0x50')]({'where':{'id':_0x389e62['params']['id'],'UserId':null}})[_0x23cd('0x2e')](handleEntityNotFound(_0x1bd6e8,null))['then'](function(_0xf6b9be){if(_0xf6b9be){_0x42f59e[_0x23cd('0x22')]=_0xf6b9be[_0x23cd('0x5e')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0xf6b9be['OpenchannelInteractionId']}});}return null;})[_0x23cd('0x2e')](handleEntityNotFound(_0x1bd6e8,null))['then'](function(_0x1a9de9){if(_0x1a9de9){_0x42f59e[_0x23cd('0x61')]=_0x1a9de9[_0x23cd('0x5e')]({'plain':!![]});interaction_log[_0x23cd('0x1c')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x389e62[_0x23cd('0x5c')]['id'],_0x389e62['user'][_0x23cd('0x30')],_0x389e62['user'][_0x23cd('0x63')],_0x42f59e[_0x23cd('0x61')]['id'],_0x389e62[_0x23cd('0x52')]?JSON[_0x23cd('0x64')](_0x389e62[_0x23cd('0x52')]):_0x23cd('0x65'));return respondWithRpcPromise(_0x23cd('0x7c'),_0x23cd('0x7d'),_0x42f59e);}return null;})[_0x23cd('0x2e')](function(_0x20b886){var _0x1dfcae=_0x23cd('0x68')+_0x20b886['message'][_0x23cd('0x69')];return db[_0x23cd('0x6a')][_0x23cd('0x39')](_0x1dfcae,{'type':db['Sequelize'][_0x23cd('0x6c')][_0x23cd('0x6d')],'raw':!![]})[_0x23cd('0x2e')](function(_0x365aab){return _0x365aab;});})[_0x23cd('0x2e')](function(_0x4888e9){if(_0x4888e9){_0x42f59e[_0x23cd('0x22')][_0x23cd('0x6e')]=_0x4888e9[0x0];if(!_0x389e62['body'][_0x23cd('0x5b')])return;return db['User']['find']({'where':{'id':_0x389e62[_0x23cd('0x52')][_0x23cd('0x5b')],'role':_0x23cd('0x5d')},'attributes':['id',_0x23cd('0x30'),_0x23cd('0x70'),_0x23cd('0x71'),_0x23cd('0x72')],'raw':!![]});}return null;})['then'](function(_0x79533b){if(!_0x79533b)return null;_0x42f59e[_0x23cd('0x22')][_0x23cd('0x5d')]=_0x79533b;return _0x42f59e;})[_0x23cd('0x2e')](function(_0x2ab18e){if(_0x2ab18e){_0x2ab18e['message'][_0x23cd('0x74')]=util['format'](_0x23cd('0x75'),_0x389e62[_0x23cd('0x5c')][_0x23cd('0x30')]);_0x2ab18e['message'][_0x23cd('0x76')]=_0x42f59e[_0x23cd('0x76')];_0x2ab18e[_0x23cd('0x22')]['motionChannel']=_0x42f59e[_0x23cd('0x76')];_0x2ab18e[_0x23cd('0x22')][_0x23cd('0x78')]=_0x23cd('0x2c');respondWithRpcPromise(_0x23cd('0x79'),_0x23cd('0x79'),{'event':'rejectmessage','message':_0x2ab18e[_0x23cd('0x22')]},client9002);return _0x42f59e;}return null;})[_0x23cd('0x2e')](respondWithResult(_0x1bd6e8,null))[_0x23cd('0x23')](handleError(_0x1bd6e8,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index f7d77c0..60844f9 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 _0x6e90=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x42a85f,_0x1d0d85){var _0x1b2326=function(_0x2257e9){while(--_0x2257e9){_0x42a85f['push'](_0x42a85f['shift']());}};_0x1b2326(++_0x1d0d85);}(_0x6e90,0x151));var _0x06e9=function(_0x319f2b,_0x35e2ce){_0x319f2b=_0x319f2b-0x0;var _0x2bcbd7=_0x6e90[_0x319f2b];return _0x2bcbd7;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x06e9('0x0'))['db'][_0x06e9('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x06e9('0x2')](0x0);var events={'afterCreate':_0x06e9('0x3'),'afterUpdate':_0x06e9('0x4'),'afterDestroy':_0x06e9('0x5')};function emitEvent(_0x32f278){return function(_0x16cd2d,_0x54c5ce,_0x36c394){OpenchannelMessageEvents[_0x06e9('0x6')](_0x32f278+':'+_0x16cd2d['id'],_0x16cd2d);OpenchannelMessageEvents[_0x06e9('0x6')](_0x32f278,_0x16cd2d);_0x36c394(null);};}for(var e in events){if(events[_0x06e9('0x7')](e)){var event=events[e];OpenchannelMessage[_0x06e9('0x8')](e,emitEvent(event));}}module[_0x06e9('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0a1b=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x33331a,_0x5dd74d){var _0x264e26=function(_0xbd24fc){while(--_0xbd24fc){_0x33331a['push'](_0x33331a['shift']());}};_0x264e26(++_0x5dd74d);}(_0x0a1b,0x1b2));var _0xb0a1=function(_0x59df37,_0x2a3f2a){_0x59df37=_0x59df37-0x0;var _0x4feaf4=_0x0a1b[_0x59df37];return _0x4feaf4;};'use strict';var EventEmitter=require(_0xb0a1('0x0'));var OpenchannelMessage=require(_0xb0a1('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb0a1('0x2')](0x0);var events={'afterCreate':_0xb0a1('0x3'),'afterUpdate':'update','afterDestroy':_0xb0a1('0x4')};function emitEvent(_0x5bacc0){return function(_0x29ccca,_0x361bf8,_0xfb13ac){OpenchannelMessageEvents['emit'](_0x5bacc0+':'+_0x29ccca['id'],_0x29ccca);OpenchannelMessageEvents[_0xb0a1('0x5')](_0x5bacc0,_0x29ccca);_0xfb13ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xb0a1('0x6')](e,emitEvent(event));}}module[_0xb0a1('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 6c5e53c..14057e1 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 _0x9d6b=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','omit','GET','POST','body','format','threadId','Interaction','update','catch','inspect','finally','lodash','util','../../config/logger','api','path','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','error','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','get','replyUri'];(function(_0x31d507,_0x3040a8){var _0xc4cccf=function(_0x249bac){while(--_0x249bac){_0x31d507['push'](_0x31d507['shift']());}};_0xc4cccf(++_0x3040a8);}(_0x9d6b,0x1ef));var _0xb9d6=function(_0x4a4e9a,_0x257f0c){_0x4a4e9a=_0x4a4e9a-0x0;var _0x32e311=_0x9d6b[_0x4a4e9a];return _0x32e311;};'use strict';var _=require(_0xb9d6('0x0'));var util=require(_0xb9d6('0x1'));var logger=require(_0xb9d6('0x2'))(_0xb9d6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9d6('0x4'));var rimraf=require('rimraf');var config=require(_0xb9d6('0x5'));var attributes=require(_0xb9d6('0x6'));module[_0xb9d6('0x7')]=function(_0x8e33d9,_0x44b9a7){return _0x8e33d9['define']('OpenchannelMessage',attributes,{'tableName':_0xb9d6('0x8'),'paranoid':![],'indexes':[{'name':_0xb9d6('0x9'),'fields':['body'],'type':_0xb9d6('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc52e80,_0x9e1e5a,_0x50fac1){var _0x57e5be=_0x8e33d9[_0xb9d6('0xb')];var _0x3b6ad8=_0xc52e80['get']({'plain':!![]});if(_0x3b6ad8['direction']['toLowerCase']()==='in'||_0x3b6ad8[_0xb9d6('0xc')][_0xb9d6('0xd')]()===_0xb9d6('0xe')&&!_0x3b6ad8[_0xb9d6('0xf')]&&!_[_0xb9d6('0x10')](_0x3b6ad8[_0xb9d6('0x11')])){_0x57e5be['OpenchannelInteraction'][_0xb9d6('0x12')]({'where':{'id':_0x3b6ad8[_0xb9d6('0x13')]}})['then'](function(_0x40ddd8){if(_0x40ddd8){_0x40ddd8['update']({'lastMsgAt':_0x3b6ad8['createdAt'],'lastMsgDirection':_0x3b6ad8['direction']['toLowerCase']()});}})['catch'](function(_0x2937d1){console[_0xb9d6('0x14')](_0x2937d1);});}if(_0x3b6ad8[_0xb9d6('0xc')]==='out'&&!_0x3b6ad8[_0xb9d6('0xf')]){var _0x306bbe;_0x57e5be[_0xb9d6('0x15')][_0xb9d6('0x16')]()[_0xb9d6('0x17')](function(_0x5a390f){return _0x57e5be[_0xb9d6('0x18')][_0xb9d6('0x19')]({'where':{'id':_0x3b6ad8[_0xb9d6('0x1a')]},'include':[{'model':_0x57e5be[_0xb9d6('0x1b')],'as':_0xb9d6('0x1c'),'where':{'id':_0x3b6ad8['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x57e5be[_0xb9d6('0x15')],'as':_0xb9d6('0x1d'),'attributes':_[_0xb9d6('0x1e')](_0x5a390f)}]}]});})[_0xb9d6('0x17')](function(_0x48e9da){_0x306bbe=_0x48e9da[_0xb9d6('0x1f')]({'plain':!![]});if(_0x306bbe&&_0x306bbe[_0xb9d6('0x20')]){logger[_0xb9d6('0x21')](_0xb9d6('0x22'),_0xb9d6('0x23'),util['format'](_0xb9d6('0x24'),_0x3b6ad8['id'],_0x306bbe['replyUri']));if(_0x306bbe[_0xb9d6('0x1c')]&&_0x306bbe[_0xb9d6('0x1c')]['length']){_0x3b6ad8['Interaction']=_[_0xb9d6('0x25')](_0x306bbe['Interactions'][0x0],_0xb9d6('0x1d'));_0x3b6ad8[_0xb9d6('0x1d')]=_0x306bbe[_0xb9d6('0x1c')][0x0][_0xb9d6('0x1d')];}var _0x9e1e5a={'method':'POST','uri':encodeURI(_0x306bbe[_0xb9d6('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x9e1e5a['method']){case _0xb9d6('0x26'):_0x9e1e5a['qs']=_0x3b6ad8;break;case _0xb9d6('0x27'):_0x9e1e5a[_0xb9d6('0x28')]=_0x3b6ad8;break;}return rp(_0x9e1e5a)['then'](function(_0x59e352){logger['info'](_0xb9d6('0x22'),_0xb9d6('0x23'),util[_0xb9d6('0x29')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x3b6ad8['id'],_0x306bbe['replyUri']));if(_0x59e352['body'][_0xb9d6('0x2a')]&&_0x59e352[_0xb9d6('0x28')][_0xb9d6('0x2a')]!=_0x3b6ad8[_0xb9d6('0x2b')][_0xb9d6('0x2a')]){return _0x57e5be[_0xb9d6('0x1b')][_0xb9d6('0x2c')]({'threadId':_0x59e352[_0xb9d6('0x28')][_0xb9d6('0x2a')]},{'where':{'id':_0x3b6ad8['Interaction']['id']}});}else{return;}})[_0xb9d6('0x17')](function(){return _0xc52e80[_0xb9d6('0x2c')]({'read':!![]});})[_0xb9d6('0x2d')](function(_0x519d1d){logger['error'](_0xb9d6('0x22'),'afterCreate',util[_0xb9d6('0x2e')](_0x519d1d,{'showHidden':![],'depth':null}));_0x50fac1();});}else{_0x50fac1();}})[_0xb9d6('0x2f')](function(){_0x50fac1();});}else{_0x50fac1();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8c7f=['error','secret','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','catch'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8c7f,0x18d));var _0xf8c7=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x8c7f[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0xf8c7('0x0'));var util=require('util');var logger=require(_0xf8c7('0x1'))(_0xf8c7('0x2'));var moment=require(_0xf8c7('0x3'));var BPromise=require(_0xf8c7('0x4'));var rp=require(_0xf8c7('0x5'));var fs=require('fs');var path=require(_0xf8c7('0x6'));var rimraf=require(_0xf8c7('0x7'));var config=require(_0xf8c7('0x8'));var attributes=require(_0xf8c7('0x9'));module[_0xf8c7('0xa')]=function(_0x2f707c,_0x16bfdc){return _0x2f707c['define']('OpenchannelMessage',attributes,{'tableName':_0xf8c7('0xb'),'paranoid':![],'indexes':[{'name':_0xf8c7('0xc'),'fields':[_0xf8c7('0xd')],'type':_0xf8c7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e0567,_0xac6928,_0x686800){var _0x53db27=_0x2f707c[_0xf8c7('0xf')];var _0x17c851=_0x2e0567[_0xf8c7('0x10')]({'plain':!![]});if(_0x17c851[_0xf8c7('0x11')][_0xf8c7('0x12')]()==='in'||_0x17c851[_0xf8c7('0x11')][_0xf8c7('0x12')]()===_0xf8c7('0x13')&&!_0x17c851['secret']&&!_[_0xf8c7('0x14')](_0x17c851[_0xf8c7('0x15')])){_0x53db27[_0xf8c7('0x16')]['findOne']({'where':{'id':_0x17c851[_0xf8c7('0x17')]}})[_0xf8c7('0x18')](function(_0x1b7a78){if(_0x1b7a78){_0x1b7a78[_0xf8c7('0x19')]({'lastMsgAt':_0x17c851['createdAt'],'lastMsgDirection':_0x17c851[_0xf8c7('0x11')]['toLowerCase']()});}})[_0xf8c7('0x1a')](function(_0x43a9ca){console[_0xf8c7('0x1b')](_0x43a9ca);});}if(_0x17c851[_0xf8c7('0x11')]===_0xf8c7('0x13')&&!_0x17c851[_0xf8c7('0x1c')]){var _0x4bd31c;_0x53db27[_0xf8c7('0x1d')]['describe']()[_0xf8c7('0x18')](function(_0x124b77){return _0x53db27[_0xf8c7('0x1e')][_0xf8c7('0x1f')]({'where':{'id':_0x17c851[_0xf8c7('0x20')]},'include':[{'model':_0x53db27[_0xf8c7('0x16')],'as':_0xf8c7('0x21'),'where':{'id':_0x17c851[_0xf8c7('0x17')]},'limit':0x1,'include':[{'model':_0x53db27['CmContact'],'as':_0xf8c7('0x22'),'attributes':_[_0xf8c7('0x23')](_0x124b77)}]}]});})[_0xf8c7('0x18')](function(_0x8605d1){_0x4bd31c=_0x8605d1['get']({'plain':!![]});if(_0x4bd31c&&_0x4bd31c['replyUri']){logger[_0xf8c7('0x24')](_0xf8c7('0x25'),_0xf8c7('0x26'),util[_0xf8c7('0x27')](_0xf8c7('0x28'),_0x17c851['id'],_0x4bd31c[_0xf8c7('0x29')]));if(_0x4bd31c[_0xf8c7('0x21')]&&_0x4bd31c[_0xf8c7('0x21')][_0xf8c7('0x2a')]){_0x17c851[_0xf8c7('0x2b')]=_[_0xf8c7('0x2c')](_0x4bd31c[_0xf8c7('0x21')][0x0],_0xf8c7('0x22'));_0x17c851['Contact']=_0x4bd31c[_0xf8c7('0x21')][0x0][_0xf8c7('0x22')];}var _0xac6928={'method':_0xf8c7('0x2d'),'uri':encodeURI(_0x4bd31c[_0xf8c7('0x29')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xac6928[_0xf8c7('0x2e')]){case _0xf8c7('0x2f'):_0xac6928['qs']=_0x17c851;break;case _0xf8c7('0x2d'):_0xac6928['body']=_0x17c851;break;}return rp(_0xac6928)[_0xf8c7('0x18')](function(_0x2d870b){logger[_0xf8c7('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xf8c7('0x26'),util[_0xf8c7('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x17c851['id'],_0x4bd31c[_0xf8c7('0x29')]));if(_0x2d870b[_0xf8c7('0xd')][_0xf8c7('0x30')]&&_0x2d870b[_0xf8c7('0xd')][_0xf8c7('0x30')]!=_0x17c851[_0xf8c7('0x2b')][_0xf8c7('0x30')]){return _0x53db27[_0xf8c7('0x16')][_0xf8c7('0x19')]({'threadId':_0x2d870b['body'][_0xf8c7('0x30')]},{'where':{'id':_0x17c851[_0xf8c7('0x2b')]['id']}});}else{return;}})[_0xf8c7('0x18')](function(){return _0x2e0567['update']({'read':!![]});})[_0xf8c7('0x1a')](function(_0x3f9d8d){logger[_0xf8c7('0x1b')](_0xf8c7('0x25'),_0xf8c7('0x26'),util[_0xf8c7('0x31')](_0x3f9d8d,{'showHidden':![],'depth':null}));_0x686800();});}else{_0x686800();}})[_0xf8c7('0x32')](function(){_0x686800();});}else{_0x686800();}}},'charset':_0xf8c7('0x33'),'collate':_0xf8c7('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 5a77e8d..7eaeb10 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 _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3a52a8,_0x378f62){var _0x4780f1=function(_0x5e7205){while(--_0x5e7205){_0x3a52a8['push'](_0x3a52a8['shift']());}};_0x4780f1(++_0x378f62);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xe01a45,_0x4ab55a){var _0x290f12=function(_0x5d1123){while(--_0x5d1123){_0xe01a45['push'](_0xe01a45['shift']());}};_0x290f12(++_0x4ab55a);}(_0x2ef3,0xba));var _0x32ef=function(_0x250c0b,_0x5025a1){_0x250c0b=_0x250c0b-0x0;var _0x458132=_0x2ef3[_0x250c0b];return _0x458132;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 0858e20..424fd22 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 _0xe376=['emit','removeListener','register','length','openchannelMessage:','remove','update'];(function(_0x2f6ca8,_0x2a38ad){var _0x6eca94=function(_0x3fc765){while(--_0x3fc765){_0x2f6ca8['push'](_0x2f6ca8['shift']());}};_0x6eca94(++_0x2a38ad);}(_0xe376,0x194));var _0x6e37=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0xe376[_0x810e4d];return _0x13f01c;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x6e37('0x0'),_0x6e37('0x1')];function createListener(_0x1740a3,_0x32dfe1){return function(_0x2b548e){_0x32dfe1[_0x6e37('0x2')](_0x1740a3,_0x2b548e);};}function removeListener(_0x3dc3cb,_0x1988e3){return function(){OpenchannelMessageEvents[_0x6e37('0x3')](_0x3dc3cb,_0x1988e3);};}exports[_0x6e37('0x4')]=function(_0x20e325){for(var _0x5e562f=0x0,_0x4d47be=events[_0x6e37('0x5')];_0x5e562f<_0x4d47be;_0x5e562f++){var _0x1e7d6e=events[_0x5e562f];var _0x47d621=createListener(_0x6e37('0x6')+_0x1e7d6e,_0x20e325);OpenchannelMessageEvents['on'](_0x1e7d6e,_0x47d621);}}; \ No newline at end of file +var _0x934f=['register','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x42fb2a,_0x41bffd){var _0x2f2a7d=function(_0x5ceeb5){while(--_0x5ceeb5){_0x42fb2a['push'](_0x42fb2a['shift']());}};_0x2f2a7d(++_0x41bffd);}(_0x934f,0x1d2));var _0xf934=function(_0x2b37aa,_0x1d40dc){_0x2b37aa=_0x2b37aa-0x0;var _0x52b73d=_0x934f[_0x2b37aa];return _0x52b73d;};'use strict';var OpenchannelMessageEvents=require(_0xf934('0x0'));var events=[_0xf934('0x1'),_0xf934('0x2'),_0xf934('0x3')];function createListener(_0x332d9c,_0x30ff6c){return function(_0x24900e){_0x30ff6c[_0xf934('0x4')](_0x332d9c,_0x24900e);};}function removeListener(_0x225f54,_0x508239){return function(){OpenchannelMessageEvents[_0xf934('0x5')](_0x225f54,_0x508239);};}exports[_0xf934('0x6')]=function(_0x59dd08){for(var _0x4b9d6f=0x0,_0x3f380e=events['length'];_0x4b9d6f<_0x3f380e;_0x4b9d6f++){var _0x259bb7=events[_0x4b9d6f];var _0x4b413e=createListener(_0xf934('0x7')+_0x259bb7,_0x59dd08);OpenchannelMessageEvents['on'](_0x259bb7,_0x4b413e);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9bb01b2..2a595dd 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 _0x0947=['addAgents','put','update','destroy','delete','/:id/teams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/users','getAgents','create','post'];(function(_0x3a92d2,_0x3c460b){var _0x2a1dbf=function(_0xb47246){while(--_0xb47246){_0x3a92d2['push'](_0x3a92d2['shift']());}};_0x2a1dbf(++_0x3c460b);}(_0x0947,0xda));var _0x7094=function(_0x1c0cfd,_0x494bdf){_0x1c0cfd=_0x1c0cfd-0x0;var _0x125324=_0x0947[_0x1c0cfd];return _0x125324;};'use strict';var multer=require(_0x7094('0x0'));var util=require(_0x7094('0x1'));var path=require(_0x7094('0x2'));var timeout=require(_0x7094('0x3'));var express=require(_0x7094('0x4'));var router=express[_0x7094('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7094('0x6'));var interaction=require(_0x7094('0x7'));var config=require(_0x7094('0x8'));var controller=require('./openchannelQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7094('0x9')]);router[_0x7094('0xa')](_0x7094('0xb'),auth['isAuthenticated'](),controller[_0x7094('0xc')]);router[_0x7094('0xa')](_0x7094('0xd'),auth[_0x7094('0xe')](),controller[_0x7094('0xf')]);router[_0x7094('0xa')](_0x7094('0x10'),auth[_0x7094('0xe')](),controller[_0x7094('0x11')]);router[_0x7094('0xa')]('/:id/teams',auth[_0x7094('0xe')](),controller['getTeams']);router['get'](_0x7094('0x12'),auth[_0x7094('0xe')](),controller[_0x7094('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7094('0x14')]);router[_0x7094('0x15')]('/:id/teams',auth[_0x7094('0xe')](),controller['addTeams']);router[_0x7094('0x15')](_0x7094('0x12'),auth[_0x7094('0xe')](),controller[_0x7094('0x16')]);router[_0x7094('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7094('0x18')]);router['delete'](_0x7094('0xd'),auth[_0x7094('0xe')](),controller[_0x7094('0x19')]);router[_0x7094('0x1a')](_0x7094('0x1b'),auth[_0x7094('0xe')](),controller['removeTeams']);router['delete'](_0x7094('0x12'),auth[_0x7094('0xe')](),controller[_0x7094('0x1c')]);module[_0x7094('0x1d')]=router; \ No newline at end of file +var _0xd1b7=['../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/members','getMembers','getTeams','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd1b7,0x181));var _0x7d1b=function(_0x49a4e6,_0x1ffa3c){_0x49a4e6=_0x49a4e6-0x0;var _0x2a23a9=_0xd1b7[_0x49a4e6];return _0x2a23a9;};'use strict';var multer=require(_0x7d1b('0x0'));var util=require(_0x7d1b('0x1'));var path=require(_0x7d1b('0x2'));var timeout=require(_0x7d1b('0x3'));var express=require(_0x7d1b('0x4'));var router=express['Router']();var fs_extra=require(_0x7d1b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7d1b('0x6'));var config=require(_0x7d1b('0x7'));var controller=require(_0x7d1b('0x8'));router['get']('/',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0xa')]);router[_0x7d1b('0xb')](_0x7d1b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x7d1b('0xb')](_0x7d1b('0xd'),auth[_0x7d1b('0x9')](),controller[_0x7d1b('0xe')]);router[_0x7d1b('0xb')](_0x7d1b('0xf'),auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x10')]);router[_0x7d1b('0xb')]('/:id/teams',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x11')]);router[_0x7d1b('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x7d1b('0x12')]('/',auth['isAuthenticated'](),controller[_0x7d1b('0x13')]);router[_0x7d1b('0x12')]('/:id/teams',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x14')]);router[_0x7d1b('0x12')](_0x7d1b('0x15'),auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x16')]);router[_0x7d1b('0x17')]('/:id',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x18')]);router[_0x7d1b('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x7d1b('0x1a')]);router[_0x7d1b('0x19')]('/:id/teams',auth[_0x7d1b('0x9')](),controller['removeTeams']);router[_0x7d1b('0x19')]('/:id/users',auth[_0x7d1b('0x9')](),controller[_0x7d1b('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 5483323..279ec86 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 _0xf3db=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x26cbbf,_0xaca77c){var _0x445bf2=function(_0x5cb399){while(--_0x5cb399){_0x26cbbf['push'](_0x26cbbf['shift']());}};_0x445bf2(++_0xaca77c);}(_0xf3db,0x1cf));var _0xbf3d=function(_0x35d475,_0x41621b){_0x35d475=_0x35d475-0x0;var _0x256f51=_0xf3db[_0x35d475];return _0x256f51;};'use strict';var Sequelize=require(_0xbf3d('0x0'));module[_0xbf3d('0x1')]={'name':{'type':Sequelize[_0xbf3d('0x2')],'unique':_0xbf3d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xbf3d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xbf3d('0x5'),'beepall',_0xbf3d('0x6'))}}; \ No newline at end of file +var _0x40c9=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x42e8e7,_0x34d2ee){var _0x1a99fc=function(_0x7b27c2){while(--_0x7b27c2){_0x42e8e7['push'](_0x42e8e7['shift']());}};_0x1a99fc(++_0x34d2ee);}(_0x40c9,0x195));var _0x940c=function(_0x17a128,_0x204b3a){_0x17a128=_0x17a128-0x0;var _0x5ac1e1=_0x40c9[_0x17a128];return _0x5ac1e1;};'use strict';var Sequelize=require(_0x940c('0x0'));module[_0x940c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x940c('0x2')]},'timeout':{'type':Sequelize[_0x940c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x940c('0x4')](_0x940c('0x5'),'beepall',_0x940c('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 580faa7..9fdb618 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 _0x3e0b=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','OpenchannelQueue','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','role','UserProfileSection','userProfileId','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','voicePause','interface','Agents','transaction','addTeams','each','findOrCreate','forEach','removeTeams','select','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','value','ids','isEmpty','emit','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./openchannelQueue.socket','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','update','destroy','get','OpenchannelQueues','UserProfileResource','then','error','name','send','index','map','rawAttributes','key','model','query'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3e0b,0xd6));var _0xb3e0=function(_0x21138d,_0x4df4e2){_0x21138d=_0x21138d-0x0;var _0x519ed7=_0x3e0b[_0x21138d];return _0x519ed7;};'use strict';var emlformat=require(_0xb3e0('0x0'));var rimraf=require(_0xb3e0('0x1'));var zipdir=require(_0xb3e0('0x2'));var jsonpatch=require(_0xb3e0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb3e0('0x4'));var Mustache=require(_0xb3e0('0x5'));var util=require(_0xb3e0('0x6'));var path=require(_0xb3e0('0x7'));var sox=require(_0xb3e0('0x8'));var csv=require(_0xb3e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3e0('0xa'));var _=require(_0xb3e0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb3e0('0xc'));var deskjs=require(_0xb3e0('0xd'));var toCsv=require(_0xb3e0('0x9'));var querystring=require(_0xb3e0('0xe'));var Papa=require(_0xb3e0('0xf'));var Redis=require(_0xb3e0('0x10'));var authService=require(_0xb3e0('0x11'));var qs=require(_0xb3e0('0x12'));var as=require(_0xb3e0('0x13'));var hardwareService=require(_0xb3e0('0x14'));var logger=require(_0xb3e0('0x15'))('api');var utils=require(_0xb3e0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb3e0('0x17'))['db'];config[_0xb3e0('0x18')]=_['defaults'](config['redis'],{'host':_0xb3e0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb3e0('0x18')]));require(_0xb3e0('0x1a'))['register'](socket);function respondWithStatusCode(_0x19e384,_0x2253ff){_0x2253ff=_0x2253ff||0xcc;return function(_0x1e4b6){if(_0x1e4b6){return _0x19e384[_0xb3e0('0x1b')](_0x2253ff);}return _0x19e384[_0xb3e0('0x1c')](_0x2253ff)[_0xb3e0('0x1d')]();};}function respondWithResult(_0x16701b,_0x504fc2){_0x504fc2=_0x504fc2||0xc8;return function(_0x2a869a){if(_0x2a869a){return _0x16701b['status'](_0x504fc2)[_0xb3e0('0x1e')](_0x2a869a);}};}function respondWithFilteredResult(_0xb409b5,_0x3f7d2d){return function(_0x45bda0){if(_0x45bda0){var _0x290322=typeof _0x3f7d2d['offset']===_0xb3e0('0x1f')&&typeof _0x3f7d2d[_0xb3e0('0x20')]===_0xb3e0('0x1f');var _0xfafa1e=_0x45bda0['count'];var _0x5cddec=_0x290322?0x0:_0x3f7d2d[_0xb3e0('0x21')];var _0x5e4f9b=_0x290322?_0x45bda0[_0xb3e0('0x22')]:_0x3f7d2d[_0xb3e0('0x21')]+_0x3f7d2d[_0xb3e0('0x20')];var _0x2f2f54;if(_0x5e4f9b>=_0xfafa1e){_0x5e4f9b=_0xfafa1e;_0x2f2f54=0xc8;}else{_0x2f2f54=0xce;}_0xb409b5[_0xb3e0('0x1c')](_0x2f2f54);return _0xb409b5['set']('Content-Range',_0x5cddec+'-'+_0x5e4f9b+'/'+_0xfafa1e)['json'](_0x45bda0);}return null;};}function patchUpdates(_0x359aa7){return function(_0x2034e1){try{jsonpatch[_0xb3e0('0x23')](_0x2034e1,_0x359aa7,!![]);}catch(_0x5ce695){return BPromise[_0xb3e0('0x24')](_0x5ce695);}return _0x2034e1['save']();};}function saveUpdates(_0x47f4f3,_0x139cb5){return function(_0x37cc0d){if(_0x37cc0d){return _0x37cc0d[_0xb3e0('0x25')](_0x47f4f3)['then'](function(_0x54aab2){return _0x54aab2;});}return null;};}function removeEntity(_0x55b6a1,_0x21e61a){return function(_0x57996c){if(_0x57996c){return _0x57996c[_0xb3e0('0x26')]()['then'](function(){var _0x4e0dc5=_0x57996c[_0xb3e0('0x27')]({'plain':!![]});var _0x1640fd=_0xb3e0('0x28');return db[_0xb3e0('0x29')][_0xb3e0('0x26')]({'where':{'type':_0x1640fd,'resourceId':_0x4e0dc5['id']}})['then'](function(){return _0x57996c;});})[_0xb3e0('0x2a')](function(){_0x55b6a1['status'](0xcc)[_0xb3e0('0x1d')]();});}};}function handleEntityNotFound(_0xe1c050,_0x5ca7c5){return function(_0x347e2d){if(!_0x347e2d){_0xe1c050[_0xb3e0('0x1b')](0x194);}return _0x347e2d;};}function handleError(_0x11616f,_0x778d6c){_0x778d6c=_0x778d6c||0x1f4;return function(_0x36d969){logger[_0xb3e0('0x2b')](_0x36d969['stack']);if(_0x36d969[_0xb3e0('0x2c')]){delete _0x36d969[_0xb3e0('0x2c')];}_0x11616f[_0xb3e0('0x1c')](_0x778d6c)[_0xb3e0('0x2d')](_0x36d969);};}exports[_0xb3e0('0x2e')]=function(_0xa06c92,_0x57d5af){var _0x2b66f3={},_0xdf48ce={},_0x147cda={'count':0x0,'rows':[]};var _0x3b26d7=_[_0xb3e0('0x2f')](db['OpenchannelQueue'][_0xb3e0('0x30')],function(_0x31b98c){return{'name':_0x31b98c['fieldName'],'type':_0x31b98c['type'][_0xb3e0('0x31')]};});_0xdf48ce[_0xb3e0('0x32')]=_['map'](_0x3b26d7,'name');_0xdf48ce[_0xb3e0('0x33')]=_['keys'](_0xa06c92['query']);_0xdf48ce[_0xb3e0('0x34')]=_[_0xb3e0('0x35')](_0xdf48ce['model'],_0xdf48ce[_0xb3e0('0x33')]);_0x2b66f3[_0xb3e0('0x36')]=_['intersection'](_0xdf48ce[_0xb3e0('0x32')],qs[_0xb3e0('0x37')](_0xa06c92['query'][_0xb3e0('0x37')]));_0x2b66f3[_0xb3e0('0x36')]=_0x2b66f3[_0xb3e0('0x36')][_0xb3e0('0x38')]?_0x2b66f3[_0xb3e0('0x36')]:_0xdf48ce[_0xb3e0('0x32')];if(!_0xa06c92[_0xb3e0('0x33')]['hasOwnProperty'](_0xb3e0('0x39'))){_0x2b66f3[_0xb3e0('0x20')]=qs[_0xb3e0('0x20')](_0xa06c92[_0xb3e0('0x33')][_0xb3e0('0x20')]);_0x2b66f3[_0xb3e0('0x21')]=qs[_0xb3e0('0x21')](_0xa06c92[_0xb3e0('0x33')][_0xb3e0('0x21')]);}_0x2b66f3[_0xb3e0('0x3a')]=qs[_0xb3e0('0x3b')](_0xa06c92[_0xb3e0('0x33')]['sort']);_0x2b66f3[_0xb3e0('0x3c')]=qs[_0xb3e0('0x34')](_['pick'](_0xa06c92[_0xb3e0('0x33')],_0xdf48ce[_0xb3e0('0x34')]),_0x3b26d7);if(_0xa06c92[_0xb3e0('0x33')][_0xb3e0('0x3d')]){_0x2b66f3[_0xb3e0('0x3c')]=_['merge'](_0x2b66f3[_0xb3e0('0x3c')],{'$or':_[_0xb3e0('0x2f')](_0x3b26d7,function(_0x14b38c){if(_0x14b38c[_0xb3e0('0x3e')]!==_0xb3e0('0x3f')){var _0x4ee26b={};_0x4ee26b[_0x14b38c['name']]={'$like':'%'+_0xa06c92[_0xb3e0('0x33')][_0xb3e0('0x3d')]+'%'};return _0x4ee26b;}})});}_0x2b66f3=_[_0xb3e0('0x40')]({},_0x2b66f3,_0xa06c92[_0xb3e0('0x41')]);var _0x14abcd={'where':_0x2b66f3['where']};return db[_0xb3e0('0x42')][_0xb3e0('0x22')](_0x14abcd)[_0xb3e0('0x2a')](function(_0x4e939e){_0x147cda[_0xb3e0('0x22')]=_0x4e939e;if(_0xa06c92['query']['includeAll']){_0x2b66f3[_0xb3e0('0x43')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xb3e0('0x44')](_0x2b66f3);})[_0xb3e0('0x2a')](function(_0x5a1a12){_0x147cda[_0xb3e0('0x45')]=_0x5a1a12;return _0x147cda;})[_0xb3e0('0x2a')](respondWithFilteredResult(_0x57d5af,_0x2b66f3))['catch'](handleError(_0x57d5af,null));};exports[_0xb3e0('0x46')]=function(_0x26c0d2,_0x5669a3){var _0x2e8a3c={'raw':!![],'where':{'id':_0x26c0d2[_0xb3e0('0x47')]['id']}},_0xed7c76={};_0xed7c76[_0xb3e0('0x32')]=_['keys'](db[_0xb3e0('0x42')][_0xb3e0('0x30')]);_0xed7c76[_0xb3e0('0x33')]=_[_0xb3e0('0x48')](_0x26c0d2[_0xb3e0('0x33')]);_0xed7c76[_0xb3e0('0x34')]=_['intersection'](_0xed7c76[_0xb3e0('0x32')],_0xed7c76[_0xb3e0('0x33')]);_0x2e8a3c[_0xb3e0('0x36')]=_['intersection'](_0xed7c76[_0xb3e0('0x32')],qs[_0xb3e0('0x37')](_0x26c0d2['query']['fields']));_0x2e8a3c['attributes']=_0x2e8a3c[_0xb3e0('0x36')]['length']?_0x2e8a3c['attributes']:_0xed7c76['model'];if(_0x26c0d2['query'][_0xb3e0('0x49')]){_0x2e8a3c[_0xb3e0('0x43')]=[{'all':!![]}];}_0x2e8a3c=_[_0xb3e0('0x40')]({},_0x2e8a3c,_0x26c0d2['options']);return db[_0xb3e0('0x42')][_0xb3e0('0x4a')](_0x2e8a3c)[_0xb3e0('0x2a')](handleEntityNotFound(_0x5669a3,null))[_0xb3e0('0x2a')](respondWithResult(_0x5669a3,null))[_0xb3e0('0x4b')](handleError(_0x5669a3,null));};exports[_0xb3e0('0x4c')]=function(_0x405307,_0x346412){return db[_0xb3e0('0x42')]['create'](_0x405307[_0xb3e0('0x4d')],{})['then'](function(_0x31eb8e){var _0x24cfd2=_0x405307['user'][_0xb3e0('0x27')]({'plain':!![]});if(!_0x24cfd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24cfd2[_0xb3e0('0x4e')]==='user'){var _0x12a7ed=_0x31eb8e[_0xb3e0('0x27')]({'plain':!![]});var _0x1b6a70=_0xb3e0('0x28');return db[_0xb3e0('0x4f')][_0xb3e0('0x4a')]({'where':{'name':_0x1b6a70,'userProfileId':_0x24cfd2[_0xb3e0('0x50')]},'raw':!![]})[_0xb3e0('0x2a')](function(_0x1d7c63){if(_0x1d7c63&&_0x1d7c63['autoAssociation']===0x0){return db[_0xb3e0('0x29')]['create']({'name':_0x12a7ed[_0xb3e0('0x2c')],'resourceId':_0x12a7ed['id'],'type':_0x1d7c63['name'],'sectionId':_0x1d7c63['id']},{})[_0xb3e0('0x2a')](function(){return _0x31eb8e;});}else{return _0x31eb8e;}})[_0xb3e0('0x4b')](function(_0x12ecbd){logger[_0xb3e0('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12ecbd);throw _0x12ecbd;});}return _0x31eb8e;})['then'](respondWithResult(_0x346412,0xc9))[_0xb3e0('0x4b')](handleError(_0x346412,null));};exports[_0xb3e0('0x25')]=function(_0x53c687,_0x5d01b9){if(_0x53c687[_0xb3e0('0x4d')]['id']){delete _0x53c687[_0xb3e0('0x4d')]['id'];}return db[_0xb3e0('0x42')][_0xb3e0('0x4a')]({'where':{'id':_0x53c687[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](handleEntityNotFound(_0x5d01b9,null))[_0xb3e0('0x2a')](saveUpdates(_0x53c687[_0xb3e0('0x4d')],null))[_0xb3e0('0x2a')](respondWithResult(_0x5d01b9,null))[_0xb3e0('0x4b')](handleError(_0x5d01b9,null));};exports[_0xb3e0('0x26')]=function(_0x4defff,_0x31034a){return db[_0xb3e0('0x42')][_0xb3e0('0x4a')]({'where':{'id':_0x4defff[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](handleEntityNotFound(_0x31034a,null))[_0xb3e0('0x2a')](removeEntity(_0x31034a,null))[_0xb3e0('0x4b')](handleError(_0x31034a,null));};exports[_0xb3e0('0x51')]=function(_0x1613ac,_0x2777f6){return db[_0xb3e0('0x42')][_0xb3e0('0x51')]()['then'](respondWithResult(_0x2777f6,null))[_0xb3e0('0x4b')](handleError(_0x2777f6,null));};exports[_0xb3e0('0x52')]=function(_0x5ef4b1,_0x59e393,_0x30a3f7){var _0x485e82={'raw':!![],'where':{}},_0x5e6c87={},_0xf82319;return db[_0xb3e0('0x42')][_0xb3e0('0x53')]({'where':{'id':_0x5ef4b1[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](handleEntityNotFound(_0x59e393,null))[_0xb3e0('0x2a')](function(_0xcab8b){if(_0xcab8b){_0xf82319=_0xcab8b[_0xb3e0('0x27')]({'plain':!![]});_0x5e6c87[_0xb3e0('0x32')]=_[_0xb3e0('0x48')](db[_0xb3e0('0x54')]['rawAttributes']);_0x5e6c87['query']=_[_0xb3e0('0x48')](_0x5ef4b1[_0xb3e0('0x33')]);_0x5e6c87[_0xb3e0('0x34')]=_[_0xb3e0('0x35')](_0x5e6c87[_0xb3e0('0x32')],_0x5e6c87[_0xb3e0('0x33')]);_0x485e82[_0xb3e0('0x36')]=_[_0xb3e0('0x35')](_0x5e6c87['model'],qs[_0xb3e0('0x37')](_0x5ef4b1[_0xb3e0('0x33')][_0xb3e0('0x37')]));_0x485e82[_0xb3e0('0x36')]=_0x485e82[_0xb3e0('0x36')]['length']?_0x485e82[_0xb3e0('0x36')]:_0x5e6c87[_0xb3e0('0x32')];if(!_0x5ef4b1[_0xb3e0('0x33')][_0xb3e0('0x55')]('nolimit')){_0x485e82[_0xb3e0('0x20')]=qs[_0xb3e0('0x20')](_0x5ef4b1[_0xb3e0('0x33')][_0xb3e0('0x20')]);_0x485e82[_0xb3e0('0x21')]=qs['offset'](_0x5ef4b1['query'][_0xb3e0('0x21')]);}_0x485e82[_0xb3e0('0x3a')]=qs[_0xb3e0('0x3b')](_0x5ef4b1[_0xb3e0('0x33')][_0xb3e0('0x3b')]);_0x485e82['where']=qs[_0xb3e0('0x34')](_['pick'](_0x5ef4b1[_0xb3e0('0x33')],_0x5e6c87[_0xb3e0('0x34')]));_0x485e82[_0xb3e0('0x3c')][_0xb3e0('0x56')]=_0xcab8b['id'];if(_0x5ef4b1[_0xb3e0('0x33')]['filter']){_0x485e82[_0xb3e0('0x3c')]=_[_0xb3e0('0x40')](_0x485e82[_0xb3e0('0x3c')],{'$or':_[_0xb3e0('0x2f')](_0x485e82[_0xb3e0('0x36')],function(_0xbde8e1){var _0xd84d2c={};_0xd84d2c[_0xbde8e1]={'$like':'%'+_0x5ef4b1[_0xb3e0('0x33')][_0xb3e0('0x3d')]+'%'};return _0xd84d2c;})});}_0x485e82=_['merge']({},_0x485e82,_0x5ef4b1[_0xb3e0('0x41')]);return db[_0xb3e0('0x54')][_0xb3e0('0x44')](_0x485e82);}})['then'](function(_0x2115d8){if(_0x2115d8){return db[_0xb3e0('0x57')][_0xb3e0('0x58')]({'where':{'id':_[_0xb3e0('0x2f')](_0x2115d8,_0xb3e0('0x59')),'role':_0xb3e0('0x5a')},'attributes':['id',_0xb3e0('0x2c'),_0xb3e0('0x5b'),_0xb3e0('0x5c'),_0xb3e0('0x5d')]});}})[_0xb3e0('0x2a')](function(_0x469fff){if(_0x469fff){return{'count':_0x469fff[_0xb3e0('0x22')],'rows':_[_0xb3e0('0x2f')](_0x469fff[_0xb3e0('0x45')],function(_0xf53459){return{'membername':_0xf53459[_0xb3e0('0x2c')],'UserId':_0xf53459['id'],'queue_name':_0xf82319['name'],'OpenchannelQueueId':_0xf82319['id'],'interface':util[_0xb3e0('0x5e')](_0xb3e0('0x5f'),_0xb3e0('0x60'),_0xf53459[_0xb3e0('0x2c')]),'penalty':0x0,'paused':_0xf53459[_0xb3e0('0x5b')],'createdAt':_0xf53459['createdAt'],'updatedAt':_0xf53459[_0xb3e0('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x59e393,_0x485e82))[_0xb3e0('0x4b')](handleError(_0x59e393,null));};exports[_0xb3e0('0x61')]=function(_0x436df6,_0x117b5b,_0x3fb6c4){var _0x2090a8={};var _0x5cccd4={};var _0x382fc3;var _0x155aa2;return db[_0xb3e0('0x42')][_0xb3e0('0x53')]({'where':{'id':_0x436df6[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](handleEntityNotFound(_0x117b5b,null))[_0xb3e0('0x2a')](function(_0x20d630){if(_0x20d630){_0x382fc3=_0x20d630;_0x5cccd4[_0xb3e0('0x32')]=_[_0xb3e0('0x48')](db[_0xb3e0('0x62')][_0xb3e0('0x30')]);_0x5cccd4[_0xb3e0('0x33')]=_[_0xb3e0('0x48')](_0x436df6[_0xb3e0('0x33')]);_0x5cccd4[_0xb3e0('0x34')]=_[_0xb3e0('0x35')](_0x5cccd4[_0xb3e0('0x32')],_0x5cccd4[_0xb3e0('0x33')]);_0x2090a8[_0xb3e0('0x36')]=_[_0xb3e0('0x35')](_0x5cccd4[_0xb3e0('0x32')],qs[_0xb3e0('0x37')](_0x436df6[_0xb3e0('0x33')][_0xb3e0('0x37')]));_0x2090a8[_0xb3e0('0x36')]=_0x2090a8[_0xb3e0('0x36')][_0xb3e0('0x38')]?_0x2090a8[_0xb3e0('0x36')]:_0x5cccd4['model'];_0x2090a8[_0xb3e0('0x3a')]=qs[_0xb3e0('0x3b')](_0x436df6[_0xb3e0('0x33')][_0xb3e0('0x3b')]);_0x2090a8[_0xb3e0('0x3c')]=qs[_0xb3e0('0x34')](_[_0xb3e0('0x63')](_0x436df6[_0xb3e0('0x33')],_0x5cccd4[_0xb3e0('0x34')]));if(_0x436df6[_0xb3e0('0x33')]['filter']){_0x2090a8[_0xb3e0('0x3c')]=_[_0xb3e0('0x40')](_0x2090a8[_0xb3e0('0x3c')],{'$or':_[_0xb3e0('0x2f')](_0x2090a8[_0xb3e0('0x36')],function(_0x509c12){var _0x52bc7c={};_0x52bc7c[_0x509c12]={'$like':'%'+_0x436df6['query']['filter']+'%'};return _0x52bc7c;})});}_0x2090a8=_[_0xb3e0('0x40')]({},_0x2090a8,_0x436df6[_0xb3e0('0x41')]);return _0x382fc3[_0xb3e0('0x61')](_0x2090a8);}})[_0xb3e0('0x2a')](function(_0x4b6b56){if(_0x4b6b56){_0x155aa2=_0x4b6b56[_0xb3e0('0x38')];if(!_0x436df6[_0xb3e0('0x33')][_0xb3e0('0x55')](_0xb3e0('0x39'))){_0x2090a8[_0xb3e0('0x20')]=qs[_0xb3e0('0x20')](_0x436df6[_0xb3e0('0x33')][_0xb3e0('0x20')]);_0x2090a8[_0xb3e0('0x21')]=qs[_0xb3e0('0x21')](_0x436df6[_0xb3e0('0x33')][_0xb3e0('0x21')]);}return _0x382fc3['getTeams'](_0x2090a8);}})[_0xb3e0('0x2a')](function(_0x3984b1){if(_0x3984b1){return _0x3984b1?{'count':_0x155aa2,'rows':_0x3984b1}:null;}})[_0xb3e0('0x2a')](respondWithResult(_0x117b5b,null))['catch'](handleError(_0x117b5b,null));};exports['addTeams']=function(_0x131bac,_0x481906,_0x360778){var _0x5dfb31=_0x131bac[_0xb3e0('0x4d')]['ids'];return db[_0xb3e0('0x62')][_0xb3e0('0x44')]({'where':{'id':_0x5dfb31},'attributes':['id'],'include':[{'model':db[_0xb3e0('0x57')],'as':'Agents','attributes':['id',_0xb3e0('0x2c'),'online',_0xb3e0('0x64'),_0xb3e0('0x65')],'raw':!![]}]})[_0xb3e0('0x2a')](function(_0x4cb061){if(_0x4cb061){var _0x4ec769=_['flatMap'](_0x4cb061,function(_0x3d4449){var _0x16ba29=_0x3d4449[_0xb3e0('0x27')]({'plain':!![]});return _0x16ba29[_0xb3e0('0x66')];});return db[_0xb3e0('0x42')][_0xb3e0('0x4a')]({'where':{'id':_0x131bac[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](function(_0x363853){return db['sequelize'][_0xb3e0('0x67')](function(_0x2ff365){return _0x363853[_0xb3e0('0x68')](_0x5dfb31,{'transaction':_0x2ff365})[_0xb3e0('0x2a')](function(){return BPromise[_0xb3e0('0x69')](_0x4ec769,function(_0x301e66){return db[_0xb3e0('0x54')][_0xb3e0('0x6a')]({'where':{'UserId':_0x301e66['id'],'OpenchannelQueueId':_0x131bac['params']['id']},'transaction':_0x2ff365});});})[_0xb3e0('0x2a')](function(){_0x4ec769[_0xb3e0('0x6b')](function(_0x46cfbc){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x46cfbc['id'],'OpenchannelQueueId':_0x363853['id']});});});});});}})[_0xb3e0('0x2a')](respondWithStatusCode(_0x481906,null))[_0xb3e0('0x4b')](handleError(_0x481906,null));};exports[_0xb3e0('0x6c')]=function(_0x46cbbc,_0x485268,_0x459e7a){return db[_0xb3e0('0x62')]['findAll']({'where':{'id':_0x46cbbc[_0xb3e0('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb3e0('0x66'),'attributes':['id'],'raw':!![]}]})[_0xb3e0('0x2a')](handleEntityNotFound(_0x485268,null))[_0xb3e0('0x2a')](function(_0x34a48a){var _0x1481df=_[_0xb3e0('0x2f')](_0x34a48a,'id');var _0x3cf56a=[];var _0x36f949=[];var _0x383517=squel[_0xb3e0('0x6d')]();_0x383517['field']('tq.TeamId')[_0xb3e0('0x6e')]('team_has_openchannel_queues','tq')[_0xb3e0('0x6f')](_0xb3e0('0x70'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb3e0('0x3c')](_0xb3e0('0x71'),_0x46cbbc['params']['id']);for(var _0x4a9613=0x0;_0x4a9613<_0x34a48a['length'];_0x4a9613+=0x1){let _0x25c187=_0x34a48a[_0x4a9613];for(var _0x2eb1e1=0x0;_0x2eb1e1<_0x25c187[_0xb3e0('0x66')][_0xb3e0('0x38')];_0x2eb1e1+=0x1){let _0x36a81c=_0x25c187['Agents'][_0x2eb1e1];var _0x4d773a=_0x383517[_0xb3e0('0x72')]();_0x4d773a[_0xb3e0('0x3c')]('ut.UserId\x20=\x20?',_0x36a81c['id']);_0x36f949[_0xb3e0('0x73')](db[_0xb3e0('0x74')][_0xb3e0('0x33')](_0x4d773a['toString'](),{'type':db[_0xb3e0('0x74')][_0xb3e0('0x75')][_0xb3e0('0x76')]})['then'](function(_0x17153b){if(_0x17153b[_0xb3e0('0x38')]===0x1){return _0x36a81c['id'];}else{var _0x455c8b=_['every'](_[_0xb3e0('0x2f')](_0x17153b,_0xb3e0('0x77')),function(_0x29cd01){return _[_0xb3e0('0x78')](_0x1481df,_0x29cd01);});if(_0x455c8b){return _0x36a81c['id'];}}}));}}return BPromise[_0xb3e0('0x79')](_0x36f949)[_0xb3e0('0x2a')](function(_0x309fbd){_0x3cf56a=_(_0x3cf56a)[_0xb3e0('0x7a')](_0x309fbd)['compact']()[_0xb3e0('0x7b')]();return db[_0xb3e0('0x42')]['find']({'where':{'id':_0x46cbbc[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](function(_0x474da5){return db[_0xb3e0('0x74')][_0xb3e0('0x67')](function(_0x32f0b8){return _0x474da5[_0xb3e0('0x6c')](_0x46cbbc[_0xb3e0('0x33')][_0xb3e0('0x7c')],{'transaction':_0x32f0b8})[_0xb3e0('0x2a')](function(){if(!_[_0xb3e0('0x7d')](_0x3cf56a)){return _0x474da5['removeAgents'](_0x3cf56a,{'transaction':_0x32f0b8});}})[_0xb3e0('0x2a')](function(){_0x3cf56a[_0xb3e0('0x6b')](function(_0xafca1d){socket[_0xb3e0('0x7e')](_0xb3e0('0x7f'),{'UserId':_0xafca1d,'OpenchannelQueueId':_0x474da5['id']});});});});});});})[_0xb3e0('0x2a')](respondWithStatusCode(_0x485268,null))[_0xb3e0('0x4b')](handleError(_0x485268,null));};exports[_0xb3e0('0x80')]=function(_0x3fd1a2,_0x307b40,_0x36df0a){return db['OpenchannelQueue'][_0xb3e0('0x4a')]({'where':{'id':_0x3fd1a2[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](handleEntityNotFound(_0x307b40,null))['then'](function(_0x55c12a){if(_0x55c12a){return _0x55c12a[_0xb3e0('0x80')](_0x3fd1a2['body'][_0xb3e0('0x7c')],_[_0xb3e0('0x81')](_0x3fd1a2[_0xb3e0('0x4d')],[_0xb3e0('0x7c'),'id'])||{})[_0xb3e0('0x82')](function(_0x1ef3ce){for(var _0x37792c=0x0;_0x37792c<_0x3fd1a2[_0xb3e0('0x4d')]['ids'][_0xb3e0('0x38')];_0x37792c+=0x1){socket['emit'](_0xb3e0('0x83'),{'UserId':Number(_0x3fd1a2['body']['ids'][_0x37792c]),'OpenchannelQueueId':Number(_0x3fd1a2[_0xb3e0('0x47')]['id'])});}return _0x1ef3ce;});}})['then'](respondWithResult(_0x307b40,null))['catch'](handleError(_0x307b40,null));};exports['removeAgents']=function(_0x5deb04,_0x24e72d,_0x44ad4f){return db['OpenchannelQueue'][_0xb3e0('0x4a')]({'where':{'id':_0x5deb04[_0xb3e0('0x47')]['id']}})[_0xb3e0('0x2a')](handleEntityNotFound(_0x24e72d,null))[_0xb3e0('0x2a')](function(_0x377093){if(_0x377093){return _0x377093['removeAgents'](_0x5deb04[_0xb3e0('0x33')][_0xb3e0('0x7c')])[_0xb3e0('0x2a')](function(){if(_['isArray'](_0x5deb04[_0xb3e0('0x33')][_0xb3e0('0x7c')])){for(var _0x411f51=0x0;_0x411f51<_0x5deb04['query'][_0xb3e0('0x7c')]['length'];_0x411f51+=0x1){socket[_0xb3e0('0x7e')](_0xb3e0('0x7f'),{'UserId':Number(_0x5deb04[_0xb3e0('0x33')][_0xb3e0('0x7c')][_0x411f51]),'OpenchannelQueueId':Number(_0x5deb04[_0xb3e0('0x47')]['id'])});}}else{socket[_0xb3e0('0x7e')](_0xb3e0('0x7f'),{'UserId':Number(_0x5deb04['query'][_0xb3e0('0x7c')]),'OpenchannelQueueId':Number(_0x5deb04[_0xb3e0('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x24e72d,null))[_0xb3e0('0x4b')](handleError(_0x24e72d,null));};exports[_0xb3e0('0x84')]=function(_0x471d36,_0x3fe633,_0xb353b){var _0x5e94bd={};var _0x5c22bb={};var _0x5f1c13;var _0x18945b;return db[_0xb3e0('0x42')][_0xb3e0('0x53')]({'where':{'id':_0x471d36[_0xb3e0('0x47')]['id']}})['then'](handleEntityNotFound(_0x3fe633,null))[_0xb3e0('0x2a')](function(_0x20130d){if(_0x20130d){_0x5f1c13=_0x20130d;_0x5c22bb[_0xb3e0('0x32')]=_[_0xb3e0('0x48')](db[_0xb3e0('0x57')][_0xb3e0('0x30')]);_0x5c22bb[_0xb3e0('0x33')]=_[_0xb3e0('0x48')](_0x471d36['query']);_0x5c22bb[_0xb3e0('0x34')]=_[_0xb3e0('0x35')](_0x5c22bb[_0xb3e0('0x32')],_0x5c22bb[_0xb3e0('0x33')]);_0x5e94bd[_0xb3e0('0x36')]=_['intersection'](_0x5c22bb[_0xb3e0('0x32')],qs[_0xb3e0('0x37')](_0x471d36[_0xb3e0('0x33')]['fields']));_0x5e94bd[_0xb3e0('0x36')]=_0x5e94bd[_0xb3e0('0x36')]['length']?_0x5e94bd[_0xb3e0('0x36')]:_0x5c22bb['model'];_0x5e94bd[_0xb3e0('0x3a')]=qs[_0xb3e0('0x3b')](_0x471d36[_0xb3e0('0x33')][_0xb3e0('0x3b')]);_0x5e94bd[_0xb3e0('0x3c')]=qs[_0xb3e0('0x34')](_[_0xb3e0('0x63')](_0x471d36[_0xb3e0('0x33')],_0x5c22bb[_0xb3e0('0x34')]));if(_0x471d36[_0xb3e0('0x33')][_0xb3e0('0x3d')]){_0x5e94bd['where']=_[_0xb3e0('0x40')](_0x5e94bd[_0xb3e0('0x3c')],{'$or':_[_0xb3e0('0x2f')](_0x5e94bd[_0xb3e0('0x36')],function(_0x504fbf){var _0x45c398={};_0x45c398[_0x504fbf]={'$like':'%'+_0x471d36[_0xb3e0('0x33')][_0xb3e0('0x3d')]+'%'};return _0x45c398;})});}_0x5e94bd=_[_0xb3e0('0x40')]({},_0x5e94bd,_0x471d36[_0xb3e0('0x41')]);return _0x5f1c13['getAgents'](_0x5e94bd);}})[_0xb3e0('0x2a')](function(_0x383227){if(_0x383227){_0x18945b=_0x383227[_0xb3e0('0x38')];if(!_0x471d36[_0xb3e0('0x33')][_0xb3e0('0x55')](_0xb3e0('0x39'))){_0x5e94bd['limit']=qs[_0xb3e0('0x20')](_0x471d36['query']['limit']);_0x5e94bd[_0xb3e0('0x21')]=qs['offset'](_0x471d36[_0xb3e0('0x33')][_0xb3e0('0x21')]);}return _0x5f1c13[_0xb3e0('0x84')](_0x5e94bd);}})[_0xb3e0('0x2a')](function(_0x51e581){if(_0x51e581){return _0x51e581?{'count':_0x18945b,'rows':_0x51e581}:null;}})[_0xb3e0('0x2a')](respondWithResult(_0x3fe633,null))[_0xb3e0('0x4b')](handleError(_0x3fe633,null));}; \ No newline at end of file +var _0xd4d1=['forEach','emit','userOpenchannelQueue:save','removeTeams','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','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','../../mysqldb','defaults','socket.io-emitter','redis','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','destroy','then','OpenchannelQueues','end','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','limit','order','sort','where','pick','filter','VIRTUAL','options','OpenchannelQueue','include','findAll','rows','includeAll','merge','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','nolimit','addTeams','ids','voicePause','flatMap','Agents','sequelize','transaction','findOrCreate'];(function(_0x4bcaf9,_0x334488){var _0x3a64e1=function(_0x2a1d45){while(--_0x2a1d45){_0x4bcaf9['push'](_0x4bcaf9['shift']());}};_0x3a64e1(++_0x334488);}(_0xd4d1,0x13a));var _0x1d4d=function(_0xc48740,_0x1d6061){_0xc48740=_0xc48740-0x0;var _0x2d19c1=_0xd4d1[_0xc48740];return _0x2d19c1;};'use strict';var emlformat=require(_0x1d4d('0x0'));var rimraf=require(_0x1d4d('0x1'));var zipdir=require(_0x1d4d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d4d('0x3'));var BPromise=require(_0x1d4d('0x4'));var Mustache=require(_0x1d4d('0x5'));var util=require(_0x1d4d('0x6'));var path=require(_0x1d4d('0x7'));var sox=require(_0x1d4d('0x8'));var csv=require(_0x1d4d('0x9'));var ejs=require(_0x1d4d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d4d('0xb'));var _=require('lodash');var squel=require(_0x1d4d('0xc'));var crypto=require(_0x1d4d('0xd'));var jsforce=require(_0x1d4d('0xe'));var deskjs=require(_0x1d4d('0xf'));var toCsv=require(_0x1d4d('0x9'));var querystring=require(_0x1d4d('0x10'));var Papa=require('papaparse');var Redis=require(_0x1d4d('0x11'));var authService=require(_0x1d4d('0x12'));var qs=require(_0x1d4d('0x13'));var as=require(_0x1d4d('0x14'));var hardwareService=require(_0x1d4d('0x15'));var logger=require(_0x1d4d('0x16'))(_0x1d4d('0x17'));var utils=require(_0x1d4d('0x18'));var config=require(_0x1d4d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d4d('0x1a'))['db'];config['redis']=_[_0x1d4d('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1d4d('0x1c'))(new Redis(config[_0x1d4d('0x1d')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4ccf7e,_0x475f5b){_0x475f5b=_0x475f5b||0xcc;return function(_0x443eb5){if(_0x443eb5){return _0x4ccf7e[_0x1d4d('0x1e')](_0x475f5b);}return _0x4ccf7e[_0x1d4d('0x1f')](_0x475f5b)['end']();};}function respondWithResult(_0x3c29db,_0x231f51){_0x231f51=_0x231f51||0xc8;return function(_0x3145ac){if(_0x3145ac){return _0x3c29db['status'](_0x231f51)[_0x1d4d('0x20')](_0x3145ac);}};}function respondWithFilteredResult(_0x53437a,_0x5e8ccf){return function(_0x4274d4){if(_0x4274d4){var _0x51e6f9=typeof _0x5e8ccf[_0x1d4d('0x21')]===_0x1d4d('0x22')&&typeof _0x5e8ccf['limit']==='undefined';var _0x5ac407=_0x4274d4['count'];var _0xfff05e=_0x51e6f9?0x0:_0x5e8ccf['offset'];var _0x26af3a=_0x51e6f9?_0x4274d4[_0x1d4d('0x23')]:_0x5e8ccf[_0x1d4d('0x21')]+_0x5e8ccf['limit'];var _0x68fd32;if(_0x26af3a>=_0x5ac407){_0x26af3a=_0x5ac407;_0x68fd32=0xc8;}else{_0x68fd32=0xce;}_0x53437a[_0x1d4d('0x1f')](_0x68fd32);return _0x53437a['set'](_0x1d4d('0x24'),_0xfff05e+'-'+_0x26af3a+'/'+_0x5ac407)[_0x1d4d('0x20')](_0x4274d4);}return null;};}function patchUpdates(_0x34fd1e){return function(_0x3c5e22){try{jsonpatch[_0x1d4d('0x25')](_0x3c5e22,_0x34fd1e,!![]);}catch(_0xff0487){return BPromise[_0x1d4d('0x26')](_0xff0487);}return _0x3c5e22[_0x1d4d('0x27')]();};}function saveUpdates(_0x3992ab,_0x59fa02){return function(_0x257575){if(_0x257575){return _0x257575[_0x1d4d('0x28')](_0x3992ab)['then'](function(_0xb1d3c4){return _0xb1d3c4;});}return null;};}function removeEntity(_0x2da4c8,_0x2af33f){return function(_0x35af03){if(_0x35af03){return _0x35af03[_0x1d4d('0x29')]()[_0x1d4d('0x2a')](function(){var _0x40f3a2=_0x35af03['get']({'plain':!![]});var _0x279883=_0x1d4d('0x2b');return db['UserProfileResource'][_0x1d4d('0x29')]({'where':{'type':_0x279883,'resourceId':_0x40f3a2['id']}})[_0x1d4d('0x2a')](function(){return _0x35af03;});})['then'](function(){_0x2da4c8[_0x1d4d('0x1f')](0xcc)[_0x1d4d('0x2c')]();});}};}function handleEntityNotFound(_0x517fdb,_0x19e1f4){return function(_0x172317){if(!_0x172317){_0x517fdb['sendStatus'](0x194);}return _0x172317;};}function handleError(_0x5c55ad,_0x3b327b){_0x3b327b=_0x3b327b||0x1f4;return function(_0x49a6ec){logger['error'](_0x49a6ec['stack']);if(_0x49a6ec[_0x1d4d('0x2d')]){delete _0x49a6ec[_0x1d4d('0x2d')];}_0x5c55ad[_0x1d4d('0x1f')](_0x3b327b)[_0x1d4d('0x2e')](_0x49a6ec);};}exports[_0x1d4d('0x2f')]=function(_0x16a7ae,_0x106240){var _0xf72a1a={},_0x27d43e={},_0xb33d4f={'count':0x0,'rows':[]};var _0x4c9e1e=_['map'](db['OpenchannelQueue'][_0x1d4d('0x30')],function(_0x739120){return{'name':_0x739120[_0x1d4d('0x31')],'type':_0x739120[_0x1d4d('0x32')][_0x1d4d('0x33')]};});_0x27d43e[_0x1d4d('0x34')]=_[_0x1d4d('0x35')](_0x4c9e1e,_0x1d4d('0x2d'));_0x27d43e['query']=_[_0x1d4d('0x36')](_0x16a7ae[_0x1d4d('0x37')]);_0x27d43e[_0x1d4d('0x38')]=_['intersection'](_0x27d43e[_0x1d4d('0x34')],_0x27d43e[_0x1d4d('0x37')]);_0xf72a1a['attributes']=_[_0x1d4d('0x39')](_0x27d43e['model'],qs['fields'](_0x16a7ae[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0xf72a1a[_0x1d4d('0x3b')]=_0xf72a1a[_0x1d4d('0x3b')][_0x1d4d('0x3c')]?_0xf72a1a[_0x1d4d('0x3b')]:_0x27d43e['model'];if(!_0x16a7ae['query']['hasOwnProperty']('nolimit')){_0xf72a1a[_0x1d4d('0x3d')]=qs[_0x1d4d('0x3d')](_0x16a7ae[_0x1d4d('0x37')][_0x1d4d('0x3d')]);_0xf72a1a[_0x1d4d('0x21')]=qs[_0x1d4d('0x21')](_0x16a7ae['query']['offset']);}_0xf72a1a[_0x1d4d('0x3e')]=qs[_0x1d4d('0x3f')](_0x16a7ae[_0x1d4d('0x37')][_0x1d4d('0x3f')]);_0xf72a1a[_0x1d4d('0x40')]=qs[_0x1d4d('0x38')](_[_0x1d4d('0x41')](_0x16a7ae['query'],_0x27d43e[_0x1d4d('0x38')]),_0x4c9e1e);if(_0x16a7ae['query'][_0x1d4d('0x42')]){_0xf72a1a[_0x1d4d('0x40')]=_['merge'](_0xf72a1a[_0x1d4d('0x40')],{'$or':_['map'](_0x4c9e1e,function(_0x1c3b21){if(_0x1c3b21[_0x1d4d('0x32')]!==_0x1d4d('0x43')){var _0x1397c9={};_0x1397c9[_0x1c3b21[_0x1d4d('0x2d')]]={'$like':'%'+_0x16a7ae[_0x1d4d('0x37')]['filter']+'%'};return _0x1397c9;}})});}_0xf72a1a=_['merge']({},_0xf72a1a,_0x16a7ae[_0x1d4d('0x44')]);var _0x41455a={'where':_0xf72a1a[_0x1d4d('0x40')]};return db[_0x1d4d('0x45')][_0x1d4d('0x23')](_0x41455a)[_0x1d4d('0x2a')](function(_0x38d590){_0xb33d4f['count']=_0x38d590;if(_0x16a7ae[_0x1d4d('0x37')]['includeAll']){_0xf72a1a[_0x1d4d('0x46')]=[{'all':!![]}];}return db[_0x1d4d('0x45')][_0x1d4d('0x47')](_0xf72a1a);})[_0x1d4d('0x2a')](function(_0x40ca2c){_0xb33d4f[_0x1d4d('0x48')]=_0x40ca2c;return _0xb33d4f;})[_0x1d4d('0x2a')](respondWithFilteredResult(_0x106240,_0xf72a1a))['catch'](handleError(_0x106240,null));};exports['show']=function(_0x4752e4,_0x4cf156){var _0xd885f7={'raw':!![],'where':{'id':_0x4752e4['params']['id']}},_0x976c59={};_0x976c59[_0x1d4d('0x34')]=_[_0x1d4d('0x36')](db[_0x1d4d('0x45')][_0x1d4d('0x30')]);_0x976c59[_0x1d4d('0x37')]=_[_0x1d4d('0x36')](_0x4752e4['query']);_0x976c59['filters']=_['intersection'](_0x976c59[_0x1d4d('0x34')],_0x976c59[_0x1d4d('0x37')]);_0xd885f7[_0x1d4d('0x3b')]=_[_0x1d4d('0x39')](_0x976c59[_0x1d4d('0x34')],qs['fields'](_0x4752e4[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0xd885f7[_0x1d4d('0x3b')]=_0xd885f7['attributes'][_0x1d4d('0x3c')]?_0xd885f7['attributes']:_0x976c59[_0x1d4d('0x34')];if(_0x4752e4[_0x1d4d('0x37')][_0x1d4d('0x49')]){_0xd885f7[_0x1d4d('0x46')]=[{'all':!![]}];}_0xd885f7=_[_0x1d4d('0x4a')]({},_0xd885f7,_0x4752e4[_0x1d4d('0x44')]);return db[_0x1d4d('0x45')]['find'](_0xd885f7)['then'](handleEntityNotFound(_0x4cf156,null))[_0x1d4d('0x2a')](respondWithResult(_0x4cf156,null))[_0x1d4d('0x4b')](handleError(_0x4cf156,null));};exports[_0x1d4d('0x4c')]=function(_0x4e204b,_0xbc00bb){return db[_0x1d4d('0x45')][_0x1d4d('0x4c')](_0x4e204b[_0x1d4d('0x4d')],{})['then'](function(_0x3fa76e){var _0x5eeafe=_0x4e204b['user'][_0x1d4d('0x4e')]({'plain':!![]});if(!_0x5eeafe)throw new Error(_0x1d4d('0x4f'));if(_0x5eeafe[_0x1d4d('0x50')]==='user'){var _0x1248e3=_0x3fa76e[_0x1d4d('0x4e')]({'plain':!![]});var _0x190947=_0x1d4d('0x2b');return db[_0x1d4d('0x51')][_0x1d4d('0x52')]({'where':{'name':_0x190947,'userProfileId':_0x5eeafe[_0x1d4d('0x53')]},'raw':!![]})['then'](function(_0x4efc20){if(_0x4efc20&&_0x4efc20[_0x1d4d('0x54')]===0x0){return db[_0x1d4d('0x55')][_0x1d4d('0x4c')]({'name':_0x1248e3[_0x1d4d('0x2d')],'resourceId':_0x1248e3['id'],'type':_0x4efc20[_0x1d4d('0x2d')],'sectionId':_0x4efc20['id']},{})[_0x1d4d('0x2a')](function(){return _0x3fa76e;});}else{return _0x3fa76e;}})[_0x1d4d('0x4b')](function(_0x5ed763){logger[_0x1d4d('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ed763);throw _0x5ed763;});}return _0x3fa76e;})[_0x1d4d('0x2a')](respondWithResult(_0xbc00bb,0xc9))[_0x1d4d('0x4b')](handleError(_0xbc00bb,null));};exports[_0x1d4d('0x28')]=function(_0x2d454f,_0x550649){if(_0x2d454f['body']['id']){delete _0x2d454f[_0x1d4d('0x4d')]['id'];}return db[_0x1d4d('0x45')]['find']({'where':{'id':_0x2d454f['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x550649,null))[_0x1d4d('0x2a')](saveUpdates(_0x2d454f[_0x1d4d('0x4d')],null))[_0x1d4d('0x2a')](respondWithResult(_0x550649,null))[_0x1d4d('0x4b')](handleError(_0x550649,null));};exports['destroy']=function(_0x4e6b2e,_0x14566f){return db[_0x1d4d('0x45')][_0x1d4d('0x52')]({'where':{'id':_0x4e6b2e[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x14566f,null))[_0x1d4d('0x2a')](removeEntity(_0x14566f,null))[_0x1d4d('0x4b')](handleError(_0x14566f,null));};exports[_0x1d4d('0x58')]=function(_0x59d7c0,_0x506eb7){return db['OpenchannelQueue'][_0x1d4d('0x58')]()[_0x1d4d('0x2a')](respondWithResult(_0x506eb7,null))[_0x1d4d('0x4b')](handleError(_0x506eb7,null));};exports[_0x1d4d('0x59')]=function(_0x216492,_0x1b6025,_0x50a227){var _0x14eb47={'raw':!![],'where':{}},_0x4a71f9={},_0x2094ec;return db['OpenchannelQueue'][_0x1d4d('0x5a')]({'where':{'id':_0x216492['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x1b6025,null))[_0x1d4d('0x2a')](function(_0x1e5dbe){if(_0x1e5dbe){_0x2094ec=_0x1e5dbe['get']({'plain':!![]});_0x4a71f9[_0x1d4d('0x34')]=_[_0x1d4d('0x36')](db[_0x1d4d('0x5b')][_0x1d4d('0x30')]);_0x4a71f9['query']=_[_0x1d4d('0x36')](_0x216492[_0x1d4d('0x37')]);_0x4a71f9['filters']=_[_0x1d4d('0x39')](_0x4a71f9[_0x1d4d('0x34')],_0x4a71f9['query']);_0x14eb47['attributes']=_[_0x1d4d('0x39')](_0x4a71f9[_0x1d4d('0x34')],qs['fields'](_0x216492[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0x14eb47[_0x1d4d('0x3b')]=_0x14eb47[_0x1d4d('0x3b')][_0x1d4d('0x3c')]?_0x14eb47['attributes']:_0x4a71f9[_0x1d4d('0x34')];if(!_0x216492['query'][_0x1d4d('0x5c')]('nolimit')){_0x14eb47[_0x1d4d('0x3d')]=qs[_0x1d4d('0x3d')](_0x216492[_0x1d4d('0x37')][_0x1d4d('0x3d')]);_0x14eb47[_0x1d4d('0x21')]=qs[_0x1d4d('0x21')](_0x216492[_0x1d4d('0x37')][_0x1d4d('0x21')]);}_0x14eb47[_0x1d4d('0x3e')]=qs['sort'](_0x216492[_0x1d4d('0x37')]['sort']);_0x14eb47['where']=qs[_0x1d4d('0x38')](_['pick'](_0x216492['query'],_0x4a71f9['filters']));_0x14eb47[_0x1d4d('0x40')][_0x1d4d('0x5d')]=_0x1e5dbe['id'];if(_0x216492['query'][_0x1d4d('0x42')]){_0x14eb47[_0x1d4d('0x40')]=_['merge'](_0x14eb47['where'],{'$or':_[_0x1d4d('0x35')](_0x14eb47['attributes'],function(_0x46161f){var _0x2cb718={};_0x2cb718[_0x46161f]={'$like':'%'+_0x216492[_0x1d4d('0x37')]['filter']+'%'};return _0x2cb718;})});}_0x14eb47=_[_0x1d4d('0x4a')]({},_0x14eb47,_0x216492[_0x1d4d('0x44')]);return db[_0x1d4d('0x5b')][_0x1d4d('0x47')](_0x14eb47);}})['then'](function(_0x502a7a){if(_0x502a7a){return db[_0x1d4d('0x5e')][_0x1d4d('0x5f')]({'where':{'id':_[_0x1d4d('0x35')](_0x502a7a,_0x1d4d('0x60')),'role':_0x1d4d('0x61')},'attributes':['id',_0x1d4d('0x2d'),_0x1d4d('0x62'),_0x1d4d('0x63'),'createdAt']});}})['then'](function(_0xe3e1f2){if(_0xe3e1f2){return{'count':_0xe3e1f2['count'],'rows':_[_0x1d4d('0x35')](_0xe3e1f2[_0x1d4d('0x48')],function(_0x2be4fe){return{'membername':_0x2be4fe[_0x1d4d('0x2d')],'UserId':_0x2be4fe['id'],'queue_name':_0x2094ec[_0x1d4d('0x2d')],'OpenchannelQueueId':_0x2094ec['id'],'interface':util[_0x1d4d('0x64')](_0x1d4d('0x65'),_0x1d4d('0x66'),_0x2be4fe[_0x1d4d('0x2d')]),'penalty':0x0,'paused':_0x2be4fe[_0x1d4d('0x62')],'createdAt':_0x2be4fe[_0x1d4d('0x67')],'updatedAt':_0x2be4fe[_0x1d4d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1d4d('0x2a')](respondWithFilteredResult(_0x1b6025,_0x14eb47))[_0x1d4d('0x4b')](handleError(_0x1b6025,null));};exports[_0x1d4d('0x68')]=function(_0x28f855,_0x31de42,_0x26c4ce){var _0x4471b8={};var _0x2820cc={};var _0x4da0d7;var _0x134ddd;return db['OpenchannelQueue'][_0x1d4d('0x5a')]({'where':{'id':_0x28f855['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x31de42,null))[_0x1d4d('0x2a')](function(_0x3223f7){if(_0x3223f7){_0x4da0d7=_0x3223f7;_0x2820cc[_0x1d4d('0x34')]=_['keys'](db[_0x1d4d('0x69')][_0x1d4d('0x30')]);_0x2820cc[_0x1d4d('0x37')]=_['keys'](_0x28f855[_0x1d4d('0x37')]);_0x2820cc[_0x1d4d('0x38')]=_[_0x1d4d('0x39')](_0x2820cc[_0x1d4d('0x34')],_0x2820cc['query']);_0x4471b8[_0x1d4d('0x3b')]=_[_0x1d4d('0x39')](_0x2820cc[_0x1d4d('0x34')],qs[_0x1d4d('0x3a')](_0x28f855[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0x4471b8[_0x1d4d('0x3b')]=_0x4471b8['attributes'][_0x1d4d('0x3c')]?_0x4471b8[_0x1d4d('0x3b')]:_0x2820cc[_0x1d4d('0x34')];_0x4471b8['order']=qs[_0x1d4d('0x3f')](_0x28f855[_0x1d4d('0x37')]['sort']);_0x4471b8[_0x1d4d('0x40')]=qs[_0x1d4d('0x38')](_[_0x1d4d('0x41')](_0x28f855[_0x1d4d('0x37')],_0x2820cc[_0x1d4d('0x38')]));if(_0x28f855['query'][_0x1d4d('0x42')]){_0x4471b8['where']=_[_0x1d4d('0x4a')](_0x4471b8[_0x1d4d('0x40')],{'$or':_['map'](_0x4471b8[_0x1d4d('0x3b')],function(_0xc09702){var _0x5e70d0={};_0x5e70d0[_0xc09702]={'$like':'%'+_0x28f855[_0x1d4d('0x37')]['filter']+'%'};return _0x5e70d0;})});}_0x4471b8=_['merge']({},_0x4471b8,_0x28f855['options']);return _0x4da0d7['getTeams'](_0x4471b8);}})['then'](function(_0x53b551){if(_0x53b551){_0x134ddd=_0x53b551[_0x1d4d('0x3c')];if(!_0x28f855[_0x1d4d('0x37')][_0x1d4d('0x5c')](_0x1d4d('0x6a'))){_0x4471b8[_0x1d4d('0x3d')]=qs['limit'](_0x28f855[_0x1d4d('0x37')]['limit']);_0x4471b8[_0x1d4d('0x21')]=qs[_0x1d4d('0x21')](_0x28f855[_0x1d4d('0x37')][_0x1d4d('0x21')]);}return _0x4da0d7[_0x1d4d('0x68')](_0x4471b8);}})[_0x1d4d('0x2a')](function(_0x62ba2){if(_0x62ba2){return _0x62ba2?{'count':_0x134ddd,'rows':_0x62ba2}:null;}})[_0x1d4d('0x2a')](respondWithResult(_0x31de42,null))[_0x1d4d('0x4b')](handleError(_0x31de42,null));};exports[_0x1d4d('0x6b')]=function(_0x1b79be,_0xb71841,_0x25d3f6){var _0x232f8d=_0x1b79be['body'][_0x1d4d('0x6c')];return db['Team']['findAll']({'where':{'id':_0x232f8d},'attributes':['id'],'include':[{'model':db[_0x1d4d('0x5e')],'as':'Agents','attributes':['id','name','online',_0x1d4d('0x6d'),'interface'],'raw':!![]}]})[_0x1d4d('0x2a')](function(_0x432715){if(_0x432715){var _0x43404e=_[_0x1d4d('0x6e')](_0x432715,function(_0x429421){var _0x14bc3d=_0x429421[_0x1d4d('0x4e')]({'plain':!![]});return _0x14bc3d[_0x1d4d('0x6f')];});return db[_0x1d4d('0x45')]['find']({'where':{'id':_0x1b79be[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](function(_0x388cdf){return db[_0x1d4d('0x70')][_0x1d4d('0x71')](function(_0x357226){return _0x388cdf[_0x1d4d('0x6b')](_0x232f8d,{'transaction':_0x357226})[_0x1d4d('0x2a')](function(){return BPromise['each'](_0x43404e,function(_0x5a7ce5){return db[_0x1d4d('0x5b')][_0x1d4d('0x72')]({'where':{'UserId':_0x5a7ce5['id'],'OpenchannelQueueId':_0x1b79be[_0x1d4d('0x57')]['id']},'transaction':_0x357226});});})[_0x1d4d('0x2a')](function(){_0x43404e[_0x1d4d('0x73')](function(_0xbe2a2){socket[_0x1d4d('0x74')](_0x1d4d('0x75'),{'UserId':_0xbe2a2['id'],'OpenchannelQueueId':_0x388cdf['id']});});});});});}})[_0x1d4d('0x2a')](respondWithStatusCode(_0xb71841,null))[_0x1d4d('0x4b')](handleError(_0xb71841,null));};exports[_0x1d4d('0x76')]=function(_0x3f614e,_0xb40408,_0x1923cc){return db['Team'][_0x1d4d('0x47')]({'where':{'id':_0x3f614e[_0x1d4d('0x37')][_0x1d4d('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x1d4d('0x5e')],'as':_0x1d4d('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x1d4d('0x2a')](handleEntityNotFound(_0xb40408,null))[_0x1d4d('0x2a')](function(_0x52dd07){var _0x413b61=_[_0x1d4d('0x35')](_0x52dd07,'id');var _0x284904=[];var _0x3fc6f9=[];var _0x4350e4=squel['select']();_0x4350e4['field'](_0x1d4d('0x77'))[_0x1d4d('0x78')]('team_has_openchannel_queues','tq')[_0x1d4d('0x79')](_0x1d4d('0x7a'),'ut',_0x1d4d('0x7b'))['where'](_0x1d4d('0x7c'),_0x3f614e['params']['id']);for(var _0x5d8680=0x0;_0x5d8680<_0x52dd07[_0x1d4d('0x3c')];_0x5d8680+=0x1){let _0x191d92=_0x52dd07[_0x5d8680];for(var _0x280d48=0x0;_0x280d48<_0x191d92[_0x1d4d('0x6f')]['length'];_0x280d48+=0x1){let _0x517fa0=_0x191d92[_0x1d4d('0x6f')][_0x280d48];var _0x358c7f=_0x4350e4[_0x1d4d('0x7d')]();_0x358c7f['where']('ut.UserId\x20=\x20?',_0x517fa0['id']);_0x3fc6f9[_0x1d4d('0x7e')](db[_0x1d4d('0x70')][_0x1d4d('0x37')](_0x358c7f[_0x1d4d('0x7f')](),{'type':db[_0x1d4d('0x70')]['QueryTypes'][_0x1d4d('0x80')]})[_0x1d4d('0x2a')](function(_0x53d8e0){if(_0x53d8e0['length']===0x1){return _0x517fa0['id'];}else{var _0x3102bb=_[_0x1d4d('0x81')](_[_0x1d4d('0x35')](_0x53d8e0,_0x1d4d('0x82')),function(_0x1ffa05){return _['includes'](_0x413b61,_0x1ffa05);});if(_0x3102bb){return _0x517fa0['id'];}}}));}}return BPromise[_0x1d4d('0x83')](_0x3fc6f9)[_0x1d4d('0x2a')](function(_0x1e3810){_0x284904=_(_0x284904)[_0x1d4d('0x84')](_0x1e3810)[_0x1d4d('0x85')]()[_0x1d4d('0x86')]();return db[_0x1d4d('0x45')][_0x1d4d('0x52')]({'where':{'id':_0x3f614e[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](function(_0xeb5899){return db[_0x1d4d('0x70')][_0x1d4d('0x71')](function(_0x40b068){return _0xeb5899[_0x1d4d('0x76')](_0x3f614e['query'][_0x1d4d('0x6c')],{'transaction':_0x40b068})['then'](function(){if(!_[_0x1d4d('0x87')](_0x284904)){return _0xeb5899['removeAgents'](_0x284904,{'transaction':_0x40b068});}})['then'](function(){_0x284904[_0x1d4d('0x73')](function(_0x59a5a8){socket[_0x1d4d('0x74')](_0x1d4d('0x88'),{'UserId':_0x59a5a8,'OpenchannelQueueId':_0xeb5899['id']});});});});});});})[_0x1d4d('0x2a')](respondWithStatusCode(_0xb40408,null))[_0x1d4d('0x4b')](handleError(_0xb40408,null));};exports['addAgents']=function(_0x2919ce,_0x1f63aa,_0x1757a2){return db[_0x1d4d('0x45')]['find']({'where':{'id':_0x2919ce[_0x1d4d('0x57')]['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x1f63aa,null))[_0x1d4d('0x2a')](function(_0x35e185){if(_0x35e185){return _0x35e185[_0x1d4d('0x89')](_0x2919ce[_0x1d4d('0x4d')][_0x1d4d('0x6c')],_[_0x1d4d('0x8a')](_0x2919ce[_0x1d4d('0x4d')],[_0x1d4d('0x6c'),'id'])||{})[_0x1d4d('0x8b')](function(_0xd579c2){for(var _0x21f517=0x0;_0x21f517<_0x2919ce[_0x1d4d('0x4d')]['ids']['length'];_0x21f517+=0x1){socket[_0x1d4d('0x74')](_0x1d4d('0x75'),{'UserId':Number(_0x2919ce[_0x1d4d('0x4d')][_0x1d4d('0x6c')][_0x21f517]),'OpenchannelQueueId':Number(_0x2919ce[_0x1d4d('0x57')]['id'])});}return _0xd579c2;});}})[_0x1d4d('0x2a')](respondWithResult(_0x1f63aa,null))[_0x1d4d('0x4b')](handleError(_0x1f63aa,null));};exports[_0x1d4d('0x8c')]=function(_0x37a428,_0x5bc744,_0x4a43d5){return db[_0x1d4d('0x45')][_0x1d4d('0x52')]({'where':{'id':_0x37a428['params']['id']}})['then'](handleEntityNotFound(_0x5bc744,null))[_0x1d4d('0x2a')](function(_0x16dc8a){if(_0x16dc8a){return _0x16dc8a[_0x1d4d('0x8c')](_0x37a428[_0x1d4d('0x37')]['ids'])[_0x1d4d('0x2a')](function(){if(_[_0x1d4d('0x8d')](_0x37a428[_0x1d4d('0x37')]['ids'])){for(var _0x2cd38b=0x0;_0x2cd38b<_0x37a428['query'][_0x1d4d('0x6c')][_0x1d4d('0x3c')];_0x2cd38b+=0x1){socket[_0x1d4d('0x74')](_0x1d4d('0x88'),{'UserId':Number(_0x37a428['query'][_0x1d4d('0x6c')][_0x2cd38b]),'OpenchannelQueueId':Number(_0x37a428[_0x1d4d('0x57')]['id'])});}}else{socket['emit'](_0x1d4d('0x88'),{'UserId':Number(_0x37a428[_0x1d4d('0x37')][_0x1d4d('0x6c')]),'OpenchannelQueueId':Number(_0x37a428[_0x1d4d('0x57')]['id'])});}});}})[_0x1d4d('0x2a')](respondWithStatusCode(_0x5bc744,null))[_0x1d4d('0x4b')](handleError(_0x5bc744,null));};exports[_0x1d4d('0x8e')]=function(_0x66732a,_0x104001,_0x170254){var _0x39f011={};var _0x554289={};var _0x4db7f7;var _0x159c3c;return db[_0x1d4d('0x45')][_0x1d4d('0x5a')]({'where':{'id':_0x66732a['params']['id']}})[_0x1d4d('0x2a')](handleEntityNotFound(_0x104001,null))[_0x1d4d('0x2a')](function(_0x55f235){if(_0x55f235){_0x4db7f7=_0x55f235;_0x554289[_0x1d4d('0x34')]=_['keys'](db['User'][_0x1d4d('0x30')]);_0x554289[_0x1d4d('0x37')]=_[_0x1d4d('0x36')](_0x66732a[_0x1d4d('0x37')]);_0x554289[_0x1d4d('0x38')]=_[_0x1d4d('0x39')](_0x554289[_0x1d4d('0x34')],_0x554289[_0x1d4d('0x37')]);_0x39f011[_0x1d4d('0x3b')]=_[_0x1d4d('0x39')](_0x554289['model'],qs[_0x1d4d('0x3a')](_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x3a')]));_0x39f011[_0x1d4d('0x3b')]=_0x39f011[_0x1d4d('0x3b')][_0x1d4d('0x3c')]?_0x39f011[_0x1d4d('0x3b')]:_0x554289[_0x1d4d('0x34')];_0x39f011['order']=qs['sort'](_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x3f')]);_0x39f011[_0x1d4d('0x40')]=qs[_0x1d4d('0x38')](_['pick'](_0x66732a['query'],_0x554289[_0x1d4d('0x38')]));if(_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x42')]){_0x39f011[_0x1d4d('0x40')]=_[_0x1d4d('0x4a')](_0x39f011['where'],{'$or':_[_0x1d4d('0x35')](_0x39f011[_0x1d4d('0x3b')],function(_0x3e6960){var _0xdb33de={};_0xdb33de[_0x3e6960]={'$like':'%'+_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x42')]+'%'};return _0xdb33de;})});}_0x39f011=_[_0x1d4d('0x4a')]({},_0x39f011,_0x66732a[_0x1d4d('0x44')]);return _0x4db7f7['getAgents'](_0x39f011);}})['then'](function(_0x3d80d8){if(_0x3d80d8){_0x159c3c=_0x3d80d8['length'];if(!_0x66732a[_0x1d4d('0x37')][_0x1d4d('0x5c')](_0x1d4d('0x6a'))){_0x39f011['limit']=qs[_0x1d4d('0x3d')](_0x66732a['query'][_0x1d4d('0x3d')]);_0x39f011['offset']=qs[_0x1d4d('0x21')](_0x66732a['query'][_0x1d4d('0x21')]);}return _0x4db7f7['getAgents'](_0x39f011);}})[_0x1d4d('0x2a')](function(_0x41bc9b){if(_0x41bc9b){return _0x41bc9b?{'count':_0x159c3c,'rows':_0x41bc9b}:null;}})['then'](respondWithResult(_0x104001,null))[_0x1d4d('0x4b')](handleError(_0x104001,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e2a23e2..1fae285 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 _0xb26c=['hasOwnProperty','hook','events','../../mysqldb','save','remove','emit'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb26c,0x72));var _0xcb26=function(_0x41ce68,_0x5d78ef){_0x41ce68=_0x41ce68-0x0;var _0xbe8b17=_0xb26c[_0x41ce68];return _0xbe8b17;};'use strict';var EventEmitter=require(_0xcb26('0x0'));var OpenchannelQueue=require(_0xcb26('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcb26('0x2'),'afterUpdate':'update','afterDestroy':_0xcb26('0x3')};function emitEvent(_0x48539b){return function(_0x399050,_0x4bbc9e,_0x3ea0db){OpenchannelQueueEvents[_0xcb26('0x4')](_0x48539b+':'+_0x399050['id'],_0x399050);OpenchannelQueueEvents['emit'](_0x48539b,_0x399050);_0x3ea0db(null);};}for(var e in events){if(events[_0xcb26('0x5')](e)){var event=events[e];OpenchannelQueue[_0xcb26('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x6510=['save','update','emit','OpenchannelQueue','setMaxListeners'];(function(_0x7eda84,_0x23feed){var _0x190b93=function(_0x57af55){while(--_0x57af55){_0x7eda84['push'](_0x7eda84['shift']());}};_0x190b93(++_0x23feed);}(_0x6510,0xa3));var _0x0651=function(_0x2eb751,_0xe3afbb){_0x2eb751=_0x2eb751-0x0;var _0x296a71=_0x6510[_0x2eb751];return _0x296a71;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x0651('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0651('0x1')](0x0);var events={'afterCreate':_0x0651('0x2'),'afterUpdate':_0x0651('0x3'),'afterDestroy':'remove'};function emitEvent(_0x16c32e){return function(_0x595f0f,_0x42b325,_0x1d1dcc){OpenchannelQueueEvents[_0x0651('0x4')](_0x16c32e+':'+_0x595f0f['id'],_0x595f0f);OpenchannelQueueEvents[_0x0651('0x4')](_0x16c32e,_0x595f0f);_0x1d1dcc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](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 c28093a..74bfc9c 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 _0xf31f=['./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x47f50f,_0x535fe5){var _0x4a295c=function(_0x1f3ab1){while(--_0x1f3ab1){_0x47f50f['push'](_0x47f50f['shift']());}};_0x4a295c(++_0x535fe5);}(_0xf31f,0x19b));var _0xff31=function(_0x517086,_0x542952){_0x517086=_0x517086-0x0;var _0x594a9b=_0xf31f[_0x517086];return _0x594a9b;};'use strict';var _=require('lodash');var util=require(_0xff31('0x0'));var logger=require(_0xff31('0x1'))('api');var moment=require(_0xff31('0x2'));var BPromise=require('bluebird');var rp=require(_0xff31('0x3'));var fs=require('fs');var path=require(_0xff31('0x4'));var rimraf=require(_0xff31('0x5'));var config=require(_0xff31('0x6'));var attributes=require(_0xff31('0x7'));module[_0xff31('0x8')]=function(_0x1fee03,_0x4614b1){return _0x1fee03['define'](_0xff31('0x9'),attributes,{'tableName':_0xff31('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff36=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','../../config/logger'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xff36,0xc1));var _0x6ff3=function(_0x5db96b,_0x612cae){_0x5db96b=_0x5db96b-0x0;var _0x22f779=_0xff36[_0x5db96b];return _0x22f779;};'use strict';var _=require(_0x6ff3('0x0'));var util=require(_0x6ff3('0x1'));var logger=require(_0x6ff3('0x2'))(_0x6ff3('0x3'));var moment=require(_0x6ff3('0x4'));var BPromise=require(_0x6ff3('0x5'));var rp=require(_0x6ff3('0x6'));var fs=require('fs');var path=require(_0x6ff3('0x7'));var rimraf=require(_0x6ff3('0x8'));var config=require(_0x6ff3('0x9'));var attributes=require(_0x6ff3('0xa'));module[_0x6ff3('0xb')]=function(_0xd01d0d,_0x388aa2){return _0xd01d0d[_0x6ff3('0xc')](_0x6ff3('0xd'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 3bc4ec9..542e1b1 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 _0x58e5=['rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','OpenchannelQueue','findAll','options','raw','attributes','limit','include','model','map','then','GetOpenchannelQueue','catch','ShowOpenchannelQueue','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d5e86,_0x937d08){var _0x572355=function(_0x205217){while(--_0x205217){_0x1d5e86['push'](_0x1d5e86['shift']());}};_0x572355(++_0x937d08);}(_0x58e5,0x148));var _0x558e=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x58e5[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0x558e('0x0'));var moment=require(_0x558e('0x1'));var BPromise=require(_0x558e('0x2'));var rs=require(_0x558e('0x3'));var fs=require('fs');var Redis=require(_0x558e('0x4'));var db=require(_0x558e('0x5'))['db'];var utils=require(_0x558e('0x6'));var logger=require(_0x558e('0x7'))(_0x558e('0x8'));var config=require(_0x558e('0x9'));var jayson=require(_0x558e('0xa'));var client=jayson[_0x558e('0xb')]['http']({'port':0x232a});config[_0x558e('0xc')]=_[_0x558e('0xd')](config[_0x558e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x558e('0xe'))(new Redis(config['redis']));require(_0x558e('0xf'))[_0x558e('0x10')](socket);function respondWithRpcPromise(_0x2e4811,_0x142aeb,_0x5b3cb9){return new BPromise(function(_0x5b0c56,_0x35a7f9){return client[_0x558e('0x11')](_0x2e4811,_0x5b3cb9)['then'](function(_0x56b34e){logger['info'](_0x558e('0x12'),_0x142aeb,_0x558e('0x13'));logger[_0x558e('0x14')](_0x558e('0x15'),_0x142aeb,_0x558e('0x13'),JSON[_0x558e('0x16')](_0x56b34e));if(_0x56b34e[_0x558e('0x17')]){if(_0x56b34e['error'][_0x558e('0x18')]===0x1f4){logger[_0x558e('0x17')](_0x558e('0x12'),_0x142aeb,_0x56b34e[_0x558e('0x17')][_0x558e('0x19')]);return _0x35a7f9(_0x56b34e[_0x558e('0x17')][_0x558e('0x19')]);}logger[_0x558e('0x17')](_0x558e('0x12'),_0x142aeb,_0x56b34e[_0x558e('0x17')][_0x558e('0x19')]);return _0x5b0c56(_0x56b34e['error'][_0x558e('0x19')]);}else{logger[_0x558e('0x1a')](_0x558e('0x12'),_0x142aeb,_0x558e('0x13'));_0x5b0c56(_0x56b34e[_0x558e('0x1b')][_0x558e('0x19')]);}})['catch'](function(_0x16572d){logger['error'](_0x558e('0x12'),_0x142aeb,_0x16572d);_0x35a7f9(_0x16572d);});});}exports['GetOpenchannelQueue']=function(_0x5cd684){var _0x561fe3=this;return new Promise(function(_0x3dd3c7,_0x2ae550){return db[_0x558e('0x1c')][_0x558e('0x1d')]({'raw':_0x5cd684['options']?_0x5cd684[_0x558e('0x1e')][_0x558e('0x1f')]===undefined?!![]:![]:!![],'where':_0x5cd684[_0x558e('0x1e')]?_0x5cd684[_0x558e('0x1e')]['where']||null:null,'attributes':_0x5cd684['options']?_0x5cd684[_0x558e('0x1e')][_0x558e('0x20')]||null:null,'limit':_0x5cd684[_0x558e('0x1e')]?_0x5cd684['options'][_0x558e('0x21')]||null:null,'include':_0x5cd684[_0x558e('0x1e')]?_0x5cd684[_0x558e('0x1e')][_0x558e('0x22')]?_['map'](_0x5cd684['options'][_0x558e('0x22')],function(_0x193879){return{'model':db[_0x193879[_0x558e('0x23')]],'as':_0x193879['as'],'attributes':_0x193879['attributes'],'include':_0x193879[_0x558e('0x22')]?_[_0x558e('0x24')](_0x193879[_0x558e('0x22')],function(_0x2753de){return{'model':db[_0x2753de[_0x558e('0x23')]],'as':_0x2753de['as'],'attributes':_0x2753de[_0x558e('0x20')],'include':_0x2753de['include']?_[_0x558e('0x24')](_0x2753de[_0x558e('0x22')],function(_0x3ef0cd){return{'model':db[_0x3ef0cd[_0x558e('0x23')]],'as':_0x3ef0cd['as'],'attributes':_0x3ef0cd[_0x558e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x558e('0x25')](function(_0x50fbd7){logger['info']('GetOpenchannelQueue',_0x5cd684);logger['debug'](_0x558e('0x26'),_0x5cd684,JSON[_0x558e('0x16')](_0x50fbd7));_0x3dd3c7(_0x50fbd7);})[_0x558e('0x27')](function(_0x4bf24a){logger[_0x558e('0x17')]('GetOpenchannelQueue',_0x4bf24a['message'],_0x5cd684);_0x2ae550(_0x561fe3[_0x558e('0x17')](0x1f4,_0x4bf24a[_0x558e('0x19')]));});});};exports[_0x558e('0x28')]=function(_0x16000f){var _0x1f36d1=this;return new Promise(function(_0x34df5f,_0xcb9718){return db['OpenchannelQueue']['find']({'raw':_0x16000f['options']?_0x16000f[_0x558e('0x1e')][_0x558e('0x1f')]===undefined?!![]:![]:!![],'where':_0x16000f[_0x558e('0x1e')]?_0x16000f[_0x558e('0x1e')][_0x558e('0x29')]||null:null,'attributes':_0x16000f['options']?_0x16000f[_0x558e('0x1e')][_0x558e('0x20')]||null:null,'include':_0x16000f[_0x558e('0x1e')]?_0x16000f[_0x558e('0x1e')][_0x558e('0x22')]?_[_0x558e('0x24')](_0x16000f[_0x558e('0x1e')][_0x558e('0x22')],function(_0x2d6fca){return{'model':db[_0x2d6fca[_0x558e('0x23')]],'as':_0x2d6fca['as'],'attributes':_0x2d6fca['attributes'],'include':_0x2d6fca[_0x558e('0x22')]?_[_0x558e('0x24')](_0x2d6fca[_0x558e('0x22')],function(_0x1b4e33){return{'model':db[_0x1b4e33[_0x558e('0x23')]],'as':_0x1b4e33['as'],'attributes':_0x1b4e33[_0x558e('0x20')],'include':_0x1b4e33[_0x558e('0x22')]?_[_0x558e('0x24')](_0x1b4e33['include'],function(_0x4c9350){return{'model':db[_0x4c9350[_0x558e('0x23')]],'as':_0x4c9350['as'],'attributes':_0x4c9350[_0x558e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x405720){logger['info'](_0x558e('0x28'),_0x16000f);logger[_0x558e('0x14')]('ShowOpenchannelQueue',_0x16000f,JSON[_0x558e('0x16')](_0x405720));_0x34df5f(_0x405720);})[_0x558e('0x27')](function(_0x227f80){logger[_0x558e('0x17')]('ShowOpenchannelQueue',_0x227f80[_0x558e('0x19')],_0x16000f);_0xcb9718(_0x1f36d1[_0x558e('0x17')](0x1f4,_0x227f80[_0x558e('0x19')]));});});}; \ No newline at end of file +var _0x7b7e=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetOpenchannelQueue','stringify','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x368fe6,_0x546333){var _0x51b70b=function(_0x3bfd7a){while(--_0x3bfd7a){_0x368fe6['push'](_0x368fe6['shift']());}};_0x51b70b(++_0x546333);}(_0x7b7e,0x17b));var _0xe7b7=function(_0x9fb081,_0x48f480){_0x9fb081=_0x9fb081-0x0;var _0x43f8b0=_0x7b7e[_0x9fb081];return _0x43f8b0;};'use strict';var _=require(_0xe7b7('0x0'));var util=require(_0xe7b7('0x1'));var moment=require(_0xe7b7('0x2'));var BPromise=require(_0xe7b7('0x3'));var rs=require(_0xe7b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7b7('0x5'));var logger=require(_0xe7b7('0x6'))(_0xe7b7('0x7'));var config=require(_0xe7b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7b7('0x9')][_0xe7b7('0xa')]({'port':0x232a});config[_0xe7b7('0xb')]=_['defaults'](config[_0xe7b7('0xb')],{'host':_0xe7b7('0xc'),'port':0x18eb});var socket=require(_0xe7b7('0xd'))(new Redis(config[_0xe7b7('0xb')]));require(_0xe7b7('0xe'))[_0xe7b7('0xf')](socket);function respondWithRpcPromise(_0x1d131a,_0xda9f85,_0x23c6c4){return new BPromise(function(_0xd8b0bd,_0x573d47){return client['request'](_0x1d131a,_0x23c6c4)[_0xe7b7('0x10')](function(_0x1cc578){logger[_0xe7b7('0x11')](_0xe7b7('0x12'),_0xda9f85,_0xe7b7('0x13'));logger[_0xe7b7('0x14')](_0xe7b7('0x15'),_0xda9f85,_0xe7b7('0x13'),JSON['stringify'](_0x1cc578));if(_0x1cc578[_0xe7b7('0x16')]){if(_0x1cc578['error'][_0xe7b7('0x17')]===0x1f4){logger[_0xe7b7('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xda9f85,_0x1cc578[_0xe7b7('0x16')][_0xe7b7('0x18')]);return _0x573d47(_0x1cc578[_0xe7b7('0x16')][_0xe7b7('0x18')]);}logger[_0xe7b7('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0xda9f85,_0x1cc578[_0xe7b7('0x16')][_0xe7b7('0x18')]);return _0xd8b0bd(_0x1cc578[_0xe7b7('0x16')]['message']);}else{logger[_0xe7b7('0x11')](_0xe7b7('0x12'),_0xda9f85,_0xe7b7('0x13'));_0xd8b0bd(_0x1cc578['result'][_0xe7b7('0x18')]);}})[_0xe7b7('0x19')](function(_0x4ebd2d){logger['error'](_0xe7b7('0x12'),_0xda9f85,_0x4ebd2d);_0x573d47(_0x4ebd2d);});});}exports['GetOpenchannelQueue']=function(_0x43a76b){var _0x12a792=this;return new Promise(function(_0x4d61cb,_0x138040){return db[_0xe7b7('0x1a')][_0xe7b7('0x1b')]({'raw':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x1d')]===undefined?!![]:![]:!![],'where':_0x43a76b['options']?_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x1e')]||null:null,'attributes':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x1f')]||null:null,'limit':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b['options'][_0xe7b7('0x20')]||null:null,'include':_0x43a76b[_0xe7b7('0x1c')]?_0x43a76b[_0xe7b7('0x1c')]['include']?_['map'](_0x43a76b[_0xe7b7('0x1c')][_0xe7b7('0x21')],function(_0xaee122){return{'model':db[_0xaee122[_0xe7b7('0x22')]],'as':_0xaee122['as'],'attributes':_0xaee122[_0xe7b7('0x1f')],'include':_0xaee122[_0xe7b7('0x21')]?_[_0xe7b7('0x23')](_0xaee122[_0xe7b7('0x21')],function(_0x1085b1){return{'model':db[_0x1085b1['model']],'as':_0x1085b1['as'],'attributes':_0x1085b1[_0xe7b7('0x1f')],'include':_0x1085b1['include']?_[_0xe7b7('0x23')](_0x1085b1[_0xe7b7('0x21')],function(_0x47eed4){return{'model':db[_0x47eed4[_0xe7b7('0x22')]],'as':_0x47eed4['as'],'attributes':_0x47eed4[_0xe7b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0caa){logger[_0xe7b7('0x11')]('GetOpenchannelQueue',_0x43a76b);logger[_0xe7b7('0x14')](_0xe7b7('0x24'),_0x43a76b,JSON[_0xe7b7('0x25')](_0x2b0caa));_0x4d61cb(_0x2b0caa);})[_0xe7b7('0x19')](function(_0x3c272c){logger['error'](_0xe7b7('0x24'),_0x3c272c[_0xe7b7('0x18')],_0x43a76b);_0x138040(_0x12a792[_0xe7b7('0x16')](0x1f4,_0x3c272c[_0xe7b7('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x32de57){var _0x534d9d=this;return new Promise(function(_0x3a70fc,_0x3fad57){return db['OpenchannelQueue'][_0xe7b7('0x26')]({'raw':_0x32de57[_0xe7b7('0x1c')]?_0x32de57[_0xe7b7('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x32de57[_0xe7b7('0x1c')]?_0x32de57[_0xe7b7('0x1c')][_0xe7b7('0x1e')]||null:null,'attributes':_0x32de57[_0xe7b7('0x1c')]?_0x32de57[_0xe7b7('0x1c')][_0xe7b7('0x1f')]||null:null,'include':_0x32de57[_0xe7b7('0x1c')]?_0x32de57['options']['include']?_[_0xe7b7('0x23')](_0x32de57['options']['include'],function(_0x63ab35){return{'model':db[_0x63ab35[_0xe7b7('0x22')]],'as':_0x63ab35['as'],'attributes':_0x63ab35['attributes'],'include':_0x63ab35[_0xe7b7('0x21')]?_[_0xe7b7('0x23')](_0x63ab35[_0xe7b7('0x21')],function(_0x1829d2){return{'model':db[_0x1829d2[_0xe7b7('0x22')]],'as':_0x1829d2['as'],'attributes':_0x1829d2['attributes'],'include':_0x1829d2['include']?_[_0xe7b7('0x23')](_0x1829d2[_0xe7b7('0x21')],function(_0x5a3ba3){return{'model':db[_0x5a3ba3['model']],'as':_0x5a3ba3['as'],'attributes':_0x5a3ba3['attributes']};}):[]};}):[]};}):[]:[]})[_0xe7b7('0x10')](function(_0x313d7c){logger[_0xe7b7('0x11')](_0xe7b7('0x27'),_0x32de57);logger[_0xe7b7('0x14')](_0xe7b7('0x27'),_0x32de57,JSON[_0xe7b7('0x25')](_0x313d7c));_0x3a70fc(_0x313d7c);})['catch'](function(_0x1b045b){logger['error']('ShowOpenchannelQueue',_0x1b045b['message'],_0x32de57);_0x3fad57(_0x534d9d['error'](0x1f4,_0x1b045b[_0xe7b7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 0ea38fd..83215ea 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 _0x4273=['register','./openchannelQueue.events','save','remove'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x4273,0xc5));var _0x3427=function(_0x485a12,_0x2cf89b){_0x485a12=_0x485a12-0x0;var _0x1ed1ad=_0x4273[_0x485a12];return _0x1ed1ad;};'use strict';var OpenchannelQueueEvents=require(_0x3427('0x0'));var events=[_0x3427('0x1'),_0x3427('0x2'),'update'];function createListener(_0x32bc8c,_0x12c06c){return function(_0x62fe43){_0x12c06c['emit'](_0x32bc8c,_0x62fe43);};}function removeListener(_0x506a49,_0x50838b){return function(){OpenchannelQueueEvents['removeListener'](_0x506a49,_0x50838b);};}exports[_0x3427('0x3')]=function(_0x13cd6f){for(var _0x539d20=0x0,_0x33850e=events['length'];_0x539d20<_0x33850e;_0x539d20++){var _0x763889=events[_0x539d20];var _0x21637a=createListener('openchannelQueue:'+_0x763889,_0x13cd6f);OpenchannelQueueEvents['on'](_0x763889,_0x21637a);}}; \ No newline at end of file +var _0x71db=['register','length','./openchannelQueue.events','remove','update','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x71db,0x146));var _0xb71d=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x71db[_0x5c6299];return _0x23b564;};'use strict';var OpenchannelQueueEvents=require(_0xb71d('0x0'));var events=['save',_0xb71d('0x1'),_0xb71d('0x2')];function createListener(_0x42dc24,_0xeecd8e){return function(_0x2fe836){_0xeecd8e[_0xb71d('0x3')](_0x42dc24,_0x2fe836);};}function removeListener(_0x2b0f6d,_0x425020){return function(){OpenchannelQueueEvents['removeListener'](_0x2b0f6d,_0x425020);};}exports[_0xb71d('0x4')]=function(_0x3e48e9){for(var _0x2b9701=0x0,_0x25c8e3=events[_0xb71d('0x5')];_0x2b9701<_0x25c8e3;_0x2b9701++){var _0x5b723f=events[_0x2b9701];var _0x368898=createListener('openchannelQueue:'+_0x5b723f,_0x3e48e9);OpenchannelQueueEvents['on'](_0x5b723f,_0x368898);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 085b1ee..65cec09 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 _0x6d7a=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x48dfce,_0x3f9c55){var _0x35dcac=function(_0x28d323){while(--_0x28d323){_0x48dfce['push'](_0x48dfce['shift']());}};_0x35dcac(++_0x3f9c55);}(_0x6d7a,0xd9));var _0xa6d7=function(_0x523cdf,_0x495050){_0x523cdf=_0x523cdf-0x0;var _0x3586f2=_0x6d7a[_0x523cdf];return _0x3586f2;};'use strict';var multer=require(_0xa6d7('0x0'));var util=require(_0xa6d7('0x1'));var path=require(_0xa6d7('0x2'));var timeout=require(_0xa6d7('0x3'));var express=require(_0xa6d7('0x4'));var router=express['Router']();var fs_extra=require(_0xa6d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6d7('0x6'));var config=require(_0xa6d7('0x7'));var controller=require(_0xa6d7('0x8'));router[_0xa6d7('0x9')]('/',auth[_0xa6d7('0xa')](),controller[_0xa6d7('0xb')]);router[_0xa6d7('0x9')](_0xa6d7('0xc'),auth[_0xa6d7('0xa')](),controller[_0xa6d7('0xd')]);router['get'](_0xa6d7('0xe'),auth[_0xa6d7('0xa')](),controller[_0xa6d7('0xf')]);router[_0xa6d7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6d7('0x11')]('/:id',auth[_0xa6d7('0xa')](),controller[_0xa6d7('0x12')]);router[_0xa6d7('0x13')]('/:id',auth[_0xa6d7('0xa')](),controller[_0xa6d7('0x14')]);module[_0xa6d7('0x15')]=router; \ No newline at end of file +var _0xa9c9=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xfdb6b4,_0xf85ff6){var _0x2f0bb9=function(_0x43e348){while(--_0x43e348){_0xfdb6b4['push'](_0xfdb6b4['shift']());}};_0x2f0bb9(++_0xf85ff6);}(_0xa9c9,0x185));var _0x9a9c=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xa9c9[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x9a9c('0x0'));var util=require(_0x9a9c('0x1'));var path=require(_0x9a9c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a9c('0x3'));var router=express[_0x9a9c('0x4')]();var fs_extra=require(_0x9a9c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9a9c('0x6'));var config=require(_0x9a9c('0x7'));var controller=require(_0x9a9c('0x8'));router[_0x9a9c('0x9')]('/',auth['isAuthenticated'](),controller[_0x9a9c('0xa')]);router[_0x9a9c('0x9')](_0x9a9c('0xb'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0xd')]);router[_0x9a9c('0x9')](_0x9a9c('0xe'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0xf')]);router[_0x9a9c('0x10')]('/',auth[_0x9a9c('0xc')](),controller[_0x9a9c('0x11')]);router[_0x9a9c('0x12')](_0x9a9c('0xe'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0x13')]);router[_0x9a9c('0x14')](_0x9a9c('0xe'),auth[_0x9a9c('0xc')](),controller[_0x9a9c('0x15')]);module[_0x9a9c('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 645e432..2cb5df7 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 _0xd4ff=['sequelize','STRING','DATE','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd4ff,0x18b));var _0xfd4f=function(_0x54b51d,_0x1474db){_0x54b51d=_0x54b51d-0x0;var _0xa4df07=_0xd4ff[_0x54b51d];return _0xa4df07;};'use strict';var moment=require(_0xfd4f('0x0'));var Sequelize=require(_0xfd4f('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfd4f('0x2')]},'joinAt':{'type':Sequelize[_0xfd4f('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfd4f('0x3')]},'exitAt':{'type':Sequelize[_0xfd4f('0x3')]},'reason':{'type':Sequelize[_0xfd4f('0x2')]}}; \ No newline at end of file +var _0x9891=['STRING','DATE','exports'];(function(_0x40c98f,_0x538320){var _0x2380b5=function(_0xb737d2){while(--_0xb737d2){_0x40c98f['push'](_0x40c98f['shift']());}};_0x2380b5(++_0x538320);}(_0x9891,0x1ee));var _0x1989=function(_0x466a1a,_0x37933b){_0x466a1a=_0x466a1a-0x0;var _0x577165=_0x9891[_0x466a1a];return _0x577165;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1989('0x0')]={'uniqueid':{'type':Sequelize[_0x1989('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1989('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1989('0x2')]},'acceptAt':{'type':Sequelize[_0x1989('0x2')]},'exitAt':{'type':Sequelize[_0x1989('0x2')]},'reason':{'type':Sequelize[_0x1989('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 03fcd36..8c7bb58 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 _0x67a1=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','sort','filter','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x67a1,0x1f4));var _0x167a=function(_0x59ea1d,_0x29f043){_0x59ea1d=_0x59ea1d-0x0;var _0x137bdb=_0x67a1[_0x59ea1d];return _0x137bdb;};'use strict';var emlformat=require(_0x167a('0x0'));var rimraf=require(_0x167a('0x1'));var zipdir=require(_0x167a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x167a('0x3'));var moment=require(_0x167a('0x4'));var BPromise=require(_0x167a('0x5'));var Mustache=require('mustache');var util=require(_0x167a('0x6'));var path=require('path');var sox=require(_0x167a('0x7'));var csv=require(_0x167a('0x8'));var ejs=require(_0x167a('0x9'));var fs=require('fs');var fs_extra=require(_0x167a('0xa'));var _=require(_0x167a('0xb'));var squel=require(_0x167a('0xc'));var crypto=require('crypto');var jsforce=require(_0x167a('0xd'));var deskjs=require(_0x167a('0xe'));var toCsv=require(_0x167a('0x8'));var querystring=require(_0x167a('0xf'));var Papa=require(_0x167a('0x10'));var Redis=require(_0x167a('0x11'));var authService=require(_0x167a('0x12'));var qs=require(_0x167a('0x13'));var as=require(_0x167a('0x14'));var hardwareService=require(_0x167a('0x15'));var logger=require(_0x167a('0x16'))(_0x167a('0x17'));var utils=require(_0x167a('0x18'));var config=require(_0x167a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x167a('0x1a'))['db'];function respondWithStatusCode(_0x13811e,_0x319cc1){_0x319cc1=_0x319cc1||0xcc;return function(_0x37ec97){if(_0x37ec97){return _0x13811e[_0x167a('0x1b')](_0x319cc1);}return _0x13811e[_0x167a('0x1c')](_0x319cc1)[_0x167a('0x1d')]();};}function respondWithResult(_0x3a995e,_0x1a85fe){_0x1a85fe=_0x1a85fe||0xc8;return function(_0x28b0a1){if(_0x28b0a1){return _0x3a995e[_0x167a('0x1c')](_0x1a85fe)[_0x167a('0x1e')](_0x28b0a1);}};}function respondWithFilteredResult(_0x413cf5,_0x22122c){return function(_0x3ac1ec){if(_0x3ac1ec){var _0x20f377=typeof _0x22122c[_0x167a('0x1f')]==='undefined'&&typeof _0x22122c['limit']==='undefined';var _0x12cd52=_0x3ac1ec['count'];var _0x40b1eb=_0x20f377?0x0:_0x22122c[_0x167a('0x1f')];var _0x251050=_0x20f377?_0x3ac1ec[_0x167a('0x20')]:_0x22122c[_0x167a('0x1f')]+_0x22122c[_0x167a('0x21')];var _0x38e349;if(_0x251050>=_0x12cd52){_0x251050=_0x12cd52;_0x38e349=0xc8;}else{_0x38e349=0xce;}_0x413cf5[_0x167a('0x1c')](_0x38e349);return _0x413cf5[_0x167a('0x22')](_0x167a('0x23'),_0x40b1eb+'-'+_0x251050+'/'+_0x12cd52)[_0x167a('0x1e')](_0x3ac1ec);}return null;};}function patchUpdates(_0xe766fd){return function(_0x480ae9){try{jsonpatch[_0x167a('0x24')](_0x480ae9,_0xe766fd,!![]);}catch(_0x5cce4c){return BPromise[_0x167a('0x25')](_0x5cce4c);}return _0x480ae9[_0x167a('0x26')]();};}function saveUpdates(_0x5dd3ba,_0x1d2eb9){return function(_0x5289c6){if(_0x5289c6){return _0x5289c6[_0x167a('0x27')](_0x5dd3ba)['then'](function(_0xd3f581){return _0xd3f581;});}return null;};}function removeEntity(_0x33e455,_0x3b17b7){return function(_0x28d2ee){if(_0x28d2ee){return _0x28d2ee[_0x167a('0x28')]()[_0x167a('0x29')](function(){_0x33e455['status'](0xcc)[_0x167a('0x1d')]();});}};}function handleEntityNotFound(_0x6468e1,_0x1b1505){return function(_0x2bf9c7){if(!_0x2bf9c7){_0x6468e1[_0x167a('0x1b')](0x194);}return _0x2bf9c7;};}function handleError(_0x488aa2,_0xfab9d0){_0xfab9d0=_0xfab9d0||0x1f4;return function(_0x14cc98){logger[_0x167a('0x2a')](_0x14cc98['stack']);if(_0x14cc98[_0x167a('0x2b')]){delete _0x14cc98[_0x167a('0x2b')];}_0x488aa2[_0x167a('0x1c')](_0xfab9d0)['send'](_0x14cc98);};}exports[_0x167a('0x2c')]=function(_0x6b5504,_0x5bcaeb){var _0x2b39f4={},_0xf4c030={},_0x7b9da4={'count':0x0,'rows':[]};var _0x3fb141=_[_0x167a('0x2d')](db[_0x167a('0x2e')][_0x167a('0x2f')],function(_0x1eb9d1){return{'name':_0x1eb9d1[_0x167a('0x30')],'type':_0x1eb9d1[_0x167a('0x31')][_0x167a('0x32')]};});_0xf4c030[_0x167a('0x33')]=_[_0x167a('0x2d')](_0x3fb141,_0x167a('0x2b'));_0xf4c030[_0x167a('0x34')]=_[_0x167a('0x35')](_0x6b5504[_0x167a('0x34')]);_0xf4c030[_0x167a('0x36')]=_['intersection'](_0xf4c030[_0x167a('0x33')],_0xf4c030[_0x167a('0x34')]);_0x2b39f4[_0x167a('0x37')]=_[_0x167a('0x38')](_0xf4c030['model'],qs[_0x167a('0x39')](_0x6b5504[_0x167a('0x34')][_0x167a('0x39')]));_0x2b39f4['attributes']=_0x2b39f4[_0x167a('0x37')][_0x167a('0x3a')]?_0x2b39f4[_0x167a('0x37')]:_0xf4c030[_0x167a('0x33')];if(!_0x6b5504['query']['hasOwnProperty']('nolimit')){_0x2b39f4[_0x167a('0x21')]=qs['limit'](_0x6b5504[_0x167a('0x34')][_0x167a('0x21')]);_0x2b39f4[_0x167a('0x1f')]=qs[_0x167a('0x1f')](_0x6b5504['query'][_0x167a('0x1f')]);}_0x2b39f4['order']=qs['sort'](_0x6b5504['query'][_0x167a('0x3b')]);_0x2b39f4['where']=qs[_0x167a('0x36')](_['pick'](_0x6b5504[_0x167a('0x34')],_0xf4c030['filters']),_0x3fb141);if(_0x6b5504[_0x167a('0x34')][_0x167a('0x3c')]){_0x2b39f4[_0x167a('0x3d')]=_['merge'](_0x2b39f4[_0x167a('0x3d')],{'$or':_[_0x167a('0x2d')](_0x3fb141,function(_0x1929b5){if(_0x1929b5[_0x167a('0x31')]!==_0x167a('0x3e')){var _0x2c05c3={};_0x2c05c3[_0x1929b5[_0x167a('0x2b')]]={'$like':'%'+_0x6b5504[_0x167a('0x34')][_0x167a('0x3c')]+'%'};return _0x2c05c3;}})});}_0x2b39f4=_['merge']({},_0x2b39f4,_0x6b5504[_0x167a('0x3f')]);var _0x293b08={'where':_0x2b39f4[_0x167a('0x3d')]};return db[_0x167a('0x2e')][_0x167a('0x20')](_0x293b08)['then'](function(_0x2ebfc3){_0x7b9da4[_0x167a('0x20')]=_0x2ebfc3;if(_0x6b5504[_0x167a('0x34')][_0x167a('0x40')]){_0x2b39f4[_0x167a('0x41')]=[{'all':!![]}];}return db[_0x167a('0x2e')]['findAll'](_0x2b39f4);})[_0x167a('0x29')](function(_0x200213){_0x7b9da4[_0x167a('0x42')]=_0x200213;return _0x7b9da4;})['then'](respondWithFilteredResult(_0x5bcaeb,_0x2b39f4))[_0x167a('0x43')](handleError(_0x5bcaeb,null));};exports[_0x167a('0x44')]=function(_0x9f10d5,_0x532772){var _0x408a4b={'raw':!![],'where':{'id':_0x9f10d5[_0x167a('0x45')]['id']}},_0x2d06a8={};_0x2d06a8['model']=_['keys'](db['OpenchannelQueueReport']['rawAttributes']);_0x2d06a8[_0x167a('0x34')]=_[_0x167a('0x35')](_0x9f10d5[_0x167a('0x34')]);_0x2d06a8[_0x167a('0x36')]=_['intersection'](_0x2d06a8['model'],_0x2d06a8[_0x167a('0x34')]);_0x408a4b[_0x167a('0x37')]=_[_0x167a('0x38')](_0x2d06a8[_0x167a('0x33')],qs['fields'](_0x9f10d5[_0x167a('0x34')][_0x167a('0x39')]));_0x408a4b[_0x167a('0x37')]=_0x408a4b['attributes'][_0x167a('0x3a')]?_0x408a4b[_0x167a('0x37')]:_0x2d06a8[_0x167a('0x33')];if(_0x9f10d5[_0x167a('0x34')][_0x167a('0x40')]){_0x408a4b[_0x167a('0x41')]=[{'all':!![]}];}_0x408a4b=_[_0x167a('0x46')]({},_0x408a4b,_0x9f10d5[_0x167a('0x3f')]);return db[_0x167a('0x2e')][_0x167a('0x47')](_0x408a4b)[_0x167a('0x29')](handleEntityNotFound(_0x532772,null))[_0x167a('0x29')](respondWithResult(_0x532772,null))['catch'](handleError(_0x532772,null));};exports['create']=function(_0x3bace9,_0x2f1e3f){return db[_0x167a('0x2e')][_0x167a('0x48')](_0x3bace9[_0x167a('0x49')],{})[_0x167a('0x29')](respondWithResult(_0x2f1e3f,0xc9))[_0x167a('0x43')](handleError(_0x2f1e3f,null));};exports[_0x167a('0x27')]=function(_0xa4e9d5,_0x5eb1dd){if(_0xa4e9d5[_0x167a('0x49')]['id']){delete _0xa4e9d5[_0x167a('0x49')]['id'];}return db[_0x167a('0x2e')][_0x167a('0x47')]({'where':{'id':_0xa4e9d5[_0x167a('0x45')]['id']}})['then'](handleEntityNotFound(_0x5eb1dd,null))[_0x167a('0x29')](saveUpdates(_0xa4e9d5[_0x167a('0x49')],null))['then'](respondWithResult(_0x5eb1dd,null))['catch'](handleError(_0x5eb1dd,null));};exports[_0x167a('0x28')]=function(_0x174512,_0x5e2750){return db[_0x167a('0x2e')][_0x167a('0x47')]({'where':{'id':_0x174512[_0x167a('0x45')]['id']}})[_0x167a('0x29')](handleEntityNotFound(_0x5e2750,null))['then'](removeEntity(_0x5e2750,null))[_0x167a('0x43')](handleError(_0x5e2750,null));};exports['describe']=function(_0x46607a,_0x39cb94){return db[_0x167a('0x2e')]['describe']()[_0x167a('0x29')](respondWithResult(_0x39cb94,null))[_0x167a('0x43')](handleError(_0x39cb94,null));}; \ No newline at end of file +var _0x9514=['path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','OpenchannelQueueReport','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x225a75,_0x43c1de){var _0xee995d=function(_0x31a816){while(--_0x31a816){_0x225a75['push'](_0x225a75['shift']());}};_0xee995d(++_0x43c1de);}(_0x9514,0xdc));var _0x4951=function(_0x2b9530,_0x29f882){_0x2b9530=_0x2b9530-0x0;var _0x55c5b3=_0x9514[_0x2b9530];return _0x55c5b3;};'use strict';var emlformat=require(_0x4951('0x0'));var rimraf=require(_0x4951('0x1'));var zipdir=require(_0x4951('0x2'));var jsonpatch=require(_0x4951('0x3'));var rp=require(_0x4951('0x4'));var moment=require(_0x4951('0x5'));var BPromise=require(_0x4951('0x6'));var Mustache=require('mustache');var util=require(_0x4951('0x7'));var path=require(_0x4951('0x8'));var sox=require(_0x4951('0x9'));var csv=require('to-csv');var ejs=require(_0x4951('0xa'));var fs=require('fs');var fs_extra=require(_0x4951('0xb'));var _=require(_0x4951('0xc'));var squel=require(_0x4951('0xd'));var crypto=require(_0x4951('0xe'));var jsforce=require(_0x4951('0xf'));var deskjs=require(_0x4951('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4951('0x11'));var Redis=require(_0x4951('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4951('0x13'));var as=require(_0x4951('0x14'));var hardwareService=require(_0x4951('0x15'));var logger=require('../../config/logger')(_0x4951('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4951('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a4464,_0x1707d6){_0x1707d6=_0x1707d6||0xcc;return function(_0x11d967){if(_0x11d967){return _0x4a4464[_0x4951('0x18')](_0x1707d6);}return _0x4a4464[_0x4951('0x19')](_0x1707d6)[_0x4951('0x1a')]();};}function respondWithResult(_0xac5c0f,_0x137e60){_0x137e60=_0x137e60||0xc8;return function(_0x4545d3){if(_0x4545d3){return _0xac5c0f[_0x4951('0x19')](_0x137e60)['json'](_0x4545d3);}};}function respondWithFilteredResult(_0x1e23a6,_0x15c80a){return function(_0x6e657f){if(_0x6e657f){var _0x5370e1=typeof _0x15c80a['offset']===_0x4951('0x1b')&&typeof _0x15c80a['limit']===_0x4951('0x1b');var _0x34a48b=_0x6e657f['count'];var _0x966185=_0x5370e1?0x0:_0x15c80a[_0x4951('0x1c')];var _0x3d94f9=_0x5370e1?_0x6e657f[_0x4951('0x1d')]:_0x15c80a[_0x4951('0x1c')]+_0x15c80a[_0x4951('0x1e')];var _0xdae97c;if(_0x3d94f9>=_0x34a48b){_0x3d94f9=_0x34a48b;_0xdae97c=0xc8;}else{_0xdae97c=0xce;}_0x1e23a6[_0x4951('0x19')](_0xdae97c);return _0x1e23a6[_0x4951('0x1f')](_0x4951('0x20'),_0x966185+'-'+_0x3d94f9+'/'+_0x34a48b)[_0x4951('0x21')](_0x6e657f);}return null;};}function patchUpdates(_0x3d59da){return function(_0x3adf62){try{jsonpatch[_0x4951('0x22')](_0x3adf62,_0x3d59da,!![]);}catch(_0x1fd206){return BPromise[_0x4951('0x23')](_0x1fd206);}return _0x3adf62[_0x4951('0x24')]();};}function saveUpdates(_0x326f9d,_0x342244){return function(_0x47f8e0){if(_0x47f8e0){return _0x47f8e0['update'](_0x326f9d)[_0x4951('0x25')](function(_0x3682fe){return _0x3682fe;});}return null;};}function removeEntity(_0x739eb,_0x1144e9){return function(_0x100072){if(_0x100072){return _0x100072[_0x4951('0x26')]()[_0x4951('0x25')](function(){_0x739eb[_0x4951('0x19')](0xcc)[_0x4951('0x1a')]();});}};}function handleEntityNotFound(_0x56f597,_0x30faf1){return function(_0x1a4f0b){if(!_0x1a4f0b){_0x56f597[_0x4951('0x18')](0x194);}return _0x1a4f0b;};}function handleError(_0x28c35d,_0x5db529){_0x5db529=_0x5db529||0x1f4;return function(_0x15b228){logger[_0x4951('0x27')](_0x15b228[_0x4951('0x28')]);if(_0x15b228[_0x4951('0x29')]){delete _0x15b228[_0x4951('0x29')];}_0x28c35d[_0x4951('0x19')](_0x5db529)['send'](_0x15b228);};}exports[_0x4951('0x2a')]=function(_0x2f038b,_0x46d950){var _0x289ece={},_0xab6cc3={},_0x23e6b6={'count':0x0,'rows':[]};var _0x584ea7=_[_0x4951('0x2b')](db[_0x4951('0x2c')]['rawAttributes'],function(_0x65e026){return{'name':_0x65e026[_0x4951('0x2d')],'type':_0x65e026['type'][_0x4951('0x2e')]};});_0xab6cc3[_0x4951('0x2f')]=_[_0x4951('0x2b')](_0x584ea7,_0x4951('0x29'));_0xab6cc3[_0x4951('0x30')]=_['keys'](_0x2f038b['query']);_0xab6cc3[_0x4951('0x31')]=_['intersection'](_0xab6cc3[_0x4951('0x2f')],_0xab6cc3[_0x4951('0x30')]);_0x289ece['attributes']=_[_0x4951('0x32')](_0xab6cc3[_0x4951('0x2f')],qs[_0x4951('0x33')](_0x2f038b[_0x4951('0x30')][_0x4951('0x33')]));_0x289ece['attributes']=_0x289ece[_0x4951('0x34')]['length']?_0x289ece['attributes']:_0xab6cc3[_0x4951('0x2f')];if(!_0x2f038b[_0x4951('0x30')][_0x4951('0x35')]('nolimit')){_0x289ece[_0x4951('0x1e')]=qs[_0x4951('0x1e')](_0x2f038b[_0x4951('0x30')][_0x4951('0x1e')]);_0x289ece['offset']=qs[_0x4951('0x1c')](_0x2f038b['query'][_0x4951('0x1c')]);}_0x289ece[_0x4951('0x36')]=qs[_0x4951('0x37')](_0x2f038b[_0x4951('0x30')]['sort']);_0x289ece[_0x4951('0x38')]=qs['filters'](_['pick'](_0x2f038b[_0x4951('0x30')],_0xab6cc3[_0x4951('0x31')]),_0x584ea7);if(_0x2f038b[_0x4951('0x30')][_0x4951('0x39')]){_0x289ece[_0x4951('0x38')]=_[_0x4951('0x3a')](_0x289ece[_0x4951('0x38')],{'$or':_[_0x4951('0x2b')](_0x584ea7,function(_0x481666){if(_0x481666[_0x4951('0x3b')]!==_0x4951('0x3c')){var _0x174e1c={};_0x174e1c[_0x481666[_0x4951('0x29')]]={'$like':'%'+_0x2f038b[_0x4951('0x30')][_0x4951('0x39')]+'%'};return _0x174e1c;}})});}_0x289ece=_['merge']({},_0x289ece,_0x2f038b[_0x4951('0x3d')]);var _0x371730={'where':_0x289ece[_0x4951('0x38')]};return db['OpenchannelQueueReport'][_0x4951('0x1d')](_0x371730)[_0x4951('0x25')](function(_0x4a50cb){_0x23e6b6[_0x4951('0x1d')]=_0x4a50cb;if(_0x2f038b[_0x4951('0x30')][_0x4951('0x3e')]){_0x289ece[_0x4951('0x3f')]=[{'all':!![]}];}return db[_0x4951('0x2c')][_0x4951('0x40')](_0x289ece);})['then'](function(_0x2b43b1){_0x23e6b6[_0x4951('0x41')]=_0x2b43b1;return _0x23e6b6;})[_0x4951('0x25')](respondWithFilteredResult(_0x46d950,_0x289ece))[_0x4951('0x42')](handleError(_0x46d950,null));};exports[_0x4951('0x43')]=function(_0x4b5f68,_0x376d96){var _0x5d65bf={'raw':!![],'where':{'id':_0x4b5f68['params']['id']}},_0x58b007={};_0x58b007[_0x4951('0x2f')]=_[_0x4951('0x44')](db[_0x4951('0x2c')][_0x4951('0x45')]);_0x58b007['query']=_[_0x4951('0x44')](_0x4b5f68[_0x4951('0x30')]);_0x58b007[_0x4951('0x31')]=_['intersection'](_0x58b007[_0x4951('0x2f')],_0x58b007[_0x4951('0x30')]);_0x5d65bf['attributes']=_[_0x4951('0x32')](_0x58b007['model'],qs[_0x4951('0x33')](_0x4b5f68[_0x4951('0x30')][_0x4951('0x33')]));_0x5d65bf[_0x4951('0x34')]=_0x5d65bf['attributes'][_0x4951('0x46')]?_0x5d65bf[_0x4951('0x34')]:_0x58b007[_0x4951('0x2f')];if(_0x4b5f68[_0x4951('0x30')][_0x4951('0x3e')]){_0x5d65bf['include']=[{'all':!![]}];}_0x5d65bf=_['merge']({},_0x5d65bf,_0x4b5f68['options']);return db[_0x4951('0x2c')][_0x4951('0x47')](_0x5d65bf)[_0x4951('0x25')](handleEntityNotFound(_0x376d96,null))[_0x4951('0x25')](respondWithResult(_0x376d96,null))[_0x4951('0x42')](handleError(_0x376d96,null));};exports[_0x4951('0x48')]=function(_0xef37b4,_0x17c18c){return db[_0x4951('0x2c')][_0x4951('0x48')](_0xef37b4[_0x4951('0x49')],{})[_0x4951('0x25')](respondWithResult(_0x17c18c,0xc9))[_0x4951('0x42')](handleError(_0x17c18c,null));};exports['update']=function(_0x3feaa0,_0x5c9d3d){if(_0x3feaa0[_0x4951('0x49')]['id']){delete _0x3feaa0[_0x4951('0x49')]['id'];}return db[_0x4951('0x2c')][_0x4951('0x47')]({'where':{'id':_0x3feaa0['params']['id']}})['then'](handleEntityNotFound(_0x5c9d3d,null))['then'](saveUpdates(_0x3feaa0[_0x4951('0x49')],null))['then'](respondWithResult(_0x5c9d3d,null))[_0x4951('0x42')](handleError(_0x5c9d3d,null));};exports[_0x4951('0x26')]=function(_0x16adc3,_0x3fdb58){return db['OpenchannelQueueReport'][_0x4951('0x47')]({'where':{'id':_0x16adc3[_0x4951('0x4a')]['id']}})[_0x4951('0x25')](handleEntityNotFound(_0x3fdb58,null))[_0x4951('0x25')](removeEntity(_0x3fdb58,null))[_0x4951('0x42')](handleError(_0x3fdb58,null));};exports[_0x4951('0x4b')]=function(_0x81105c,_0x41dfa1){return db[_0x4951('0x2c')][_0x4951('0x4b')]()[_0x4951('0x25')](respondWithResult(_0x41dfa1,null))[_0x4951('0x42')](handleError(_0x41dfa1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 3d32716..3a1e2cb 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x3f9f0f,_0x531b30){var _0x2eb31d=function(_0x43feb1){while(--_0x43feb1){_0x3f9f0f['push'](_0x3f9f0f['shift']());}};_0x2eb31d(++_0x531b30);}(_0xe14b,0x93));var _0xbe14=function(_0x1cb94f,_0x4f8b5b){_0x1cb94f=_0x1cb94f-0x0;var _0x52b29a=_0xe14b[_0x1cb94f];return _0x52b29a;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x440845,_0x3eeadc){var _0x3248c3=function(_0x136de2){while(--_0x136de2){_0x440845['push'](_0x440845['shift']());}};_0x3248c3(++_0x3eeadc);}(_0x7a54,0x106));var _0x47a5=function(_0x47a6be,_0x1e6345){_0x47a6be=_0x47a6be-0x0;var _0x57879b=_0x7a54[_0x47a6be];return _0x57879b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index cf00f22..3854007 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 _0xb10b=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0x133f69,_0x2d4632){_0x133f69=_0x133f69-0x0;var _0x3b67bb=_0xb10b[_0x133f69];return _0x3b67bb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateOpenchannelQueueReport',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};exports[_0xbb10('0x1b')]=function(_0x436104){var _0x7f2377=this;return new Promise(function(_0x395404,_0x3ba6cd){return db[_0xbb10('0x16')]['update'](_0x436104['body'],{'raw':_0x436104['options']?_0x436104[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436104[_0xbb10('0x18')]?_0x436104['options'][_0xbb10('0x1c')]||null:null,'attributes':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')][_0xbb10('0x1d')]||null:null,'limit':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')][_0xbb10('0x1e')]||null:null})['then'](function(_0x3796c7){logger[_0xbb10('0xd')](_0xbb10('0x1b'),_0x436104);logger[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x436104,JSON[_0xbb10('0x11')](_0x3796c7));_0x395404(_0x3796c7);})['catch'](function(_0x221624){logger['error'](_0xbb10('0x1b'),_0x221624['message'],_0x436104);_0x3ba6cd(_0x7f2377[_0xbb10('0x12')](0x1f4,_0x221624[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xd26f=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','update','body','attributes','limit','then','UpdateOpenchannelQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x42f666,_0x260dd3){var _0x500c39=function(_0xa88d60){while(--_0xa88d60){_0x42f666['push'](_0x42f666['shift']());}};_0x500c39(++_0x260dd3);}(_0xd26f,0x113));var _0xfd26=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xd26f[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd26('0x2'));var fs=require('fs');var Redis=require(_0xfd26('0x3'));var db=require(_0xfd26('0x4'))['db'];var utils=require(_0xfd26('0x5'));var logger=require(_0xfd26('0x6'))(_0xfd26('0x7'));var config=require(_0xfd26('0x8'));var jayson=require(_0xfd26('0x9'));var client=jayson[_0xfd26('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22b353,_0x3c148d,_0x1905a2){return new BPromise(function(_0x3d405f,_0x3c9154){return client[_0xfd26('0xb')](_0x22b353,_0x1905a2)['then'](function(_0xcf2fdb){logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));logger[_0xfd26('0xf')](_0xfd26('0x10'),_0x3c148d,'request\x20sent',JSON[_0xfd26('0x11')](_0xcf2fdb));if(_0xcf2fdb['error']){if(_0xcf2fdb[_0xfd26('0x12')]['code']===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3c148d,_0xcf2fdb['error']['message']);return _0x3c9154(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}logger[_0xfd26('0x12')](_0xfd26('0xd'),_0x3c148d,_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);return _0x3d405f(_0xcf2fdb[_0xfd26('0x12')][_0xfd26('0x13')]);}else{logger[_0xfd26('0xc')](_0xfd26('0xd'),_0x3c148d,_0xfd26('0xe'));_0x3d405f(_0xcf2fdb[_0xfd26('0x14')][_0xfd26('0x13')]);}})[_0xfd26('0x15')](function(_0x2f9b37){logger['error'](_0xfd26('0xd'),_0x3c148d,_0x2f9b37);_0x3c9154(_0x2f9b37);});});}exports[_0xfd26('0x16')]=function(_0xeb7aeb){var _0x210dd4=this;return new Promise(function(_0x36a275,_0x5b3e8b){return db[_0xfd26('0x17')]['create'](_0xeb7aeb['body'],{'raw':_0xeb7aeb['options']?_0xeb7aeb[_0xfd26('0x18')][_0xfd26('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x523cbe){logger[_0xfd26('0xc')](_0xfd26('0x16'),_0xeb7aeb);logger['debug'](_0xfd26('0x16'),_0xeb7aeb,JSON['stringify'](_0x523cbe));_0x36a275(_0x523cbe);})[_0xfd26('0x15')](function(_0x531bf7){logger[_0xfd26('0x12')]('CreateOpenchannelQueueReport',_0x531bf7[_0xfd26('0x13')],_0xeb7aeb);_0x5b3e8b(_0x210dd4[_0xfd26('0x12')](0x1f4,_0x531bf7['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1194c2){var _0x4bc02c=this;return new Promise(function(_0x1d62c5,_0xebbab7){return db[_0xfd26('0x17')][_0xfd26('0x1a')](_0x1194c2[_0xfd26('0x1b')],{'raw':_0x1194c2['options']?_0x1194c2[_0xfd26('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')]['where']||null:null,'attributes':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')][_0xfd26('0x1c')]||null:null,'limit':_0x1194c2[_0xfd26('0x18')]?_0x1194c2[_0xfd26('0x18')][_0xfd26('0x1d')]||null:null})[_0xfd26('0x1e')](function(_0x565c0){logger[_0xfd26('0xc')]('UpdateOpenchannelQueueReport',_0x1194c2);logger['debug']('UpdateOpenchannelQueueReport',_0x1194c2,JSON['stringify'](_0x565c0));_0x1d62c5(_0x565c0);})[_0xfd26('0x15')](function(_0x5d0101){logger[_0xfd26('0x12')](_0xfd26('0x1f'),_0x5d0101['message'],_0x1194c2);_0xebbab7(_0x4bc02c['error'](0x1f4,_0x5d0101[_0xfd26('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0acfe9b..de9f2e0 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 _0x6375=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6375,0x1e7));var _0x5637=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x6375[_0x31a938];return _0x1bf341;};'use strict';var multer=require(_0x5637('0x0'));var util=require(_0x5637('0x1'));var path=require(_0x5637('0x2'));var timeout=require(_0x5637('0x3'));var express=require('express');var router=express[_0x5637('0x4')]();var fs_extra=require(_0x5637('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5637('0x6'));var config=require(_0x5637('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0x5637('0x8')]('/',auth[_0x5637('0x9')](),controller[_0x5637('0xa')]);router['get']('/describe',auth[_0x5637('0x9')](),controller[_0x5637('0xb')]);router['get'](_0x5637('0xc'),auth[_0x5637('0x9')](),controller[_0x5637('0xd')]);router['post']('/',auth[_0x5637('0x9')](),controller['create']);router[_0x5637('0xe')](_0x5637('0xc'),auth[_0x5637('0x9')](),controller['update']);router['delete']('/:id',auth[_0x5637('0x9')](),controller[_0x5637('0xf')]);module[_0x5637('0x10')]=router; \ No newline at end of file +var _0x94c9=['/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index'];(function(_0x2be84b,_0x2d14f0){var _0x203c14=function(_0x45b983){while(--_0x45b983){_0x2be84b['push'](_0x2be84b['shift']());}};_0x203c14(++_0x2d14f0);}(_0x94c9,0x1ae));var _0x994c=function(_0x13ce7b,_0x56008a){_0x13ce7b=_0x13ce7b-0x0;var _0x2ac971=_0x94c9[_0x13ce7b];return _0x2ac971;};'use strict';var multer=require('multer');var util=require(_0x994c('0x0'));var path=require('path');var timeout=require(_0x994c('0x1'));var express=require(_0x994c('0x2'));var router=express[_0x994c('0x3')]();var fs_extra=require(_0x994c('0x4'));var auth=require(_0x994c('0x5'));var interaction=require(_0x994c('0x6'));var config=require(_0x994c('0x7'));var controller=require(_0x994c('0x8'));router[_0x994c('0x9')]('/',auth['isAuthenticated'](),controller[_0x994c('0xa')]);router[_0x994c('0x9')](_0x994c('0xb'),auth[_0x994c('0xc')](),controller[_0x994c('0xd')]);router[_0x994c('0x9')](_0x994c('0xe'),auth[_0x994c('0xc')](),controller[_0x994c('0xf')]);router[_0x994c('0x10')]('/',auth[_0x994c('0xc')](),controller['create']);router[_0x994c('0x11')](_0x994c('0xe'),auth[_0x994c('0xc')](),controller['update']);router[_0x994c('0x12')](_0x994c('0xe'),auth[_0x994c('0xc')](),controller[_0x994c('0x13')]);module[_0x994c('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b602126..6b77ee1 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1d2892,_0x2fa9ee){var _0x2e10f=function(_0x2aef0f){while(--_0x2aef0f){_0x1d2892['push'](_0x1d2892['shift']());}};_0x2e10f(++_0x2fa9ee);}(_0x70e0,0x17b));var _0x070e=function(_0x3af398,_0x4a7340){_0x3af398=_0x3af398-0x0;var _0x174fa5=_0x70e0[_0x3af398];return _0x174fa5;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1665be,_0x5e1f15){var _0x6ec3b6=function(_0x22580b){while(--_0x22580b){_0x1665be['push'](_0x1665be['shift']());}};_0x6ec3b6(++_0x5e1f15);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0xf3cd[_0x91ed5c];return _0x2387d8;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 0a2dc7c..68690e0 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 _0x3c17=['fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x55c00d,_0x520cb6){var _0x254a8f=function(_0x2b3378){while(--_0x2b3378){_0x55c00d['push'](_0x55c00d['shift']());}};_0x254a8f(++_0x520cb6);}(_0x3c17,0x8a));var _0x73c1=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x3c17[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x73c1('0x0'));var rimraf=require(_0x73c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x73c1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x73c1('0x3'));var Mustache=require(_0x73c1('0x4'));var util=require(_0x73c1('0x5'));var path=require(_0x73c1('0x6'));var sox=require(_0x73c1('0x7'));var csv=require(_0x73c1('0x8'));var ejs=require(_0x73c1('0x9'));var fs=require('fs');var fs_extra=require(_0x73c1('0xa'));var _=require('lodash');var squel=require(_0x73c1('0xb'));var crypto=require('crypto');var jsforce=require(_0x73c1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x73c1('0x8'));var querystring=require(_0x73c1('0xd'));var Papa=require(_0x73c1('0xe'));var Redis=require(_0x73c1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x73c1('0x10'));var as=require(_0x73c1('0x11'));var hardwareService=require(_0x73c1('0x12'));var logger=require(_0x73c1('0x13'))('api');var utils=require(_0x73c1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x73c1('0x15'))['db'];function respondWithStatusCode(_0x36cb0b,_0x4f02a7){_0x4f02a7=_0x4f02a7||0xcc;return function(_0x21362d){if(_0x21362d){return _0x36cb0b[_0x73c1('0x16')](_0x4f02a7);}return _0x36cb0b[_0x73c1('0x17')](_0x4f02a7)[_0x73c1('0x18')]();};}function respondWithResult(_0x45c4dd,_0xa09d31){_0xa09d31=_0xa09d31||0xc8;return function(_0x1d5ab7){if(_0x1d5ab7){return _0x45c4dd[_0x73c1('0x17')](_0xa09d31)[_0x73c1('0x19')](_0x1d5ab7);}};}function respondWithFilteredResult(_0x357816,_0x19b78f){return function(_0x359f1b){if(_0x359f1b){var _0x5cddde=typeof _0x19b78f['offset']==='undefined'&&typeof _0x19b78f[_0x73c1('0x1a')]===_0x73c1('0x1b');var _0x29ca29=_0x359f1b[_0x73c1('0x1c')];var _0x3ed0d9=_0x5cddde?0x0:_0x19b78f[_0x73c1('0x1d')];var _0x4f4eb4=_0x5cddde?_0x359f1b[_0x73c1('0x1c')]:_0x19b78f[_0x73c1('0x1d')]+_0x19b78f['limit'];var _0x7ce484;if(_0x4f4eb4>=_0x29ca29){_0x4f4eb4=_0x29ca29;_0x7ce484=0xc8;}else{_0x7ce484=0xce;}_0x357816[_0x73c1('0x17')](_0x7ce484);return _0x357816[_0x73c1('0x1e')]('Content-Range',_0x3ed0d9+'-'+_0x4f4eb4+'/'+_0x29ca29)[_0x73c1('0x19')](_0x359f1b);}return null;};}function patchUpdates(_0x6b508a){return function(_0x1bf50f){try{jsonpatch[_0x73c1('0x1f')](_0x1bf50f,_0x6b508a,!![]);}catch(_0x309c7f){return BPromise[_0x73c1('0x20')](_0x309c7f);}return _0x1bf50f[_0x73c1('0x21')]();};}function saveUpdates(_0x29dc64,_0x30a61b){return function(_0x2cf8ee){if(_0x2cf8ee){return _0x2cf8ee[_0x73c1('0x22')](_0x29dc64)[_0x73c1('0x23')](function(_0x2c42d3){return _0x2c42d3;});}return null;};}function removeEntity(_0x5050bb,_0x361213){return function(_0x340a27){if(_0x340a27){return _0x340a27[_0x73c1('0x24')]()['then'](function(){_0x5050bb[_0x73c1('0x17')](0xcc)[_0x73c1('0x18')]();});}};}function handleEntityNotFound(_0x380ffc,_0x501fe1){return function(_0x47b4ee){if(!_0x47b4ee){_0x380ffc[_0x73c1('0x16')](0x194);}return _0x47b4ee;};}function handleError(_0xf5e0b8,_0x4a6f8){_0x4a6f8=_0x4a6f8||0x1f4;return function(_0x1e4a84){logger[_0x73c1('0x25')](_0x1e4a84['stack']);if(_0x1e4a84[_0x73c1('0x26')]){delete _0x1e4a84['name'];}_0xf5e0b8[_0x73c1('0x17')](_0x4a6f8)['send'](_0x1e4a84);};}exports['index']=function(_0x576f62,_0x86973f){var _0x301079={},_0x139317={},_0x328e8b={'count':0x0,'rows':[]};var _0x5b385a=_[_0x73c1('0x27')](db[_0x73c1('0x28')][_0x73c1('0x29')],function(_0x2a1c97){return{'name':_0x2a1c97[_0x73c1('0x2a')],'type':_0x2a1c97[_0x73c1('0x2b')][_0x73c1('0x2c')]};});_0x139317[_0x73c1('0x2d')]=_[_0x73c1('0x27')](_0x5b385a,_0x73c1('0x26'));_0x139317[_0x73c1('0x2e')]=_['keys'](_0x576f62[_0x73c1('0x2e')]);_0x139317[_0x73c1('0x2f')]=_[_0x73c1('0x30')](_0x139317['model'],_0x139317[_0x73c1('0x2e')]);_0x301079['attributes']=_['intersection'](_0x139317[_0x73c1('0x2d')],qs[_0x73c1('0x31')](_0x576f62[_0x73c1('0x2e')][_0x73c1('0x31')]));_0x301079[_0x73c1('0x32')]=_0x301079['attributes'][_0x73c1('0x33')]?_0x301079[_0x73c1('0x32')]:_0x139317[_0x73c1('0x2d')];if(!_0x576f62[_0x73c1('0x2e')][_0x73c1('0x34')](_0x73c1('0x35'))){_0x301079['limit']=qs['limit'](_0x576f62[_0x73c1('0x2e')]['limit']);_0x301079[_0x73c1('0x1d')]=qs[_0x73c1('0x1d')](_0x576f62[_0x73c1('0x2e')][_0x73c1('0x1d')]);}_0x301079[_0x73c1('0x36')]=qs[_0x73c1('0x37')](_0x576f62['query'][_0x73c1('0x37')]);_0x301079[_0x73c1('0x38')]=qs['filters'](_[_0x73c1('0x39')](_0x576f62[_0x73c1('0x2e')],_0x139317['filters']),_0x5b385a);if(_0x576f62[_0x73c1('0x2e')][_0x73c1('0x3a')]){_0x301079[_0x73c1('0x38')]=_[_0x73c1('0x3b')](_0x301079['where'],{'$or':_['map'](_0x5b385a,function(_0x542356){if(_0x542356[_0x73c1('0x2b')]!==_0x73c1('0x3c')){var _0x554d19={};_0x554d19[_0x542356[_0x73c1('0x26')]]={'$like':'%'+_0x576f62['query']['filter']+'%'};return _0x554d19;}})});}_0x301079=_[_0x73c1('0x3b')]({},_0x301079,_0x576f62[_0x73c1('0x3d')]);var _0x28fc25={'where':_0x301079[_0x73c1('0x38')]};return db[_0x73c1('0x28')]['count'](_0x28fc25)[_0x73c1('0x23')](function(_0x223148){_0x328e8b[_0x73c1('0x1c')]=_0x223148;if(_0x576f62['query'][_0x73c1('0x3e')]){_0x301079['include']=[{'all':!![]}];}return db[_0x73c1('0x28')][_0x73c1('0x3f')](_0x301079);})[_0x73c1('0x23')](function(_0x29b493){_0x328e8b[_0x73c1('0x40')]=_0x29b493;return _0x328e8b;})[_0x73c1('0x23')](respondWithFilteredResult(_0x86973f,_0x301079))[_0x73c1('0x41')](handleError(_0x86973f,null));};exports[_0x73c1('0x42')]=function(_0x4a4331,_0x54e6f8){var _0x5d5fbb={'raw':!![],'where':{'id':_0x4a4331['params']['id']}},_0x11e5fd={};_0x11e5fd['model']=_[_0x73c1('0x43')](db[_0x73c1('0x28')]['rawAttributes']);_0x11e5fd[_0x73c1('0x2e')]=_[_0x73c1('0x43')](_0x4a4331[_0x73c1('0x2e')]);_0x11e5fd[_0x73c1('0x2f')]=_[_0x73c1('0x30')](_0x11e5fd[_0x73c1('0x2d')],_0x11e5fd[_0x73c1('0x2e')]);_0x5d5fbb[_0x73c1('0x32')]=_[_0x73c1('0x30')](_0x11e5fd[_0x73c1('0x2d')],qs['fields'](_0x4a4331[_0x73c1('0x2e')][_0x73c1('0x31')]));_0x5d5fbb['attributes']=_0x5d5fbb['attributes'][_0x73c1('0x33')]?_0x5d5fbb[_0x73c1('0x32')]:_0x11e5fd['model'];if(_0x4a4331[_0x73c1('0x2e')][_0x73c1('0x3e')]){_0x5d5fbb[_0x73c1('0x44')]=[{'all':!![]}];}_0x5d5fbb=_['merge']({},_0x5d5fbb,_0x4a4331[_0x73c1('0x3d')]);return db[_0x73c1('0x28')]['find'](_0x5d5fbb)[_0x73c1('0x23')](handleEntityNotFound(_0x54e6f8,null))[_0x73c1('0x23')](respondWithResult(_0x54e6f8,null))['catch'](handleError(_0x54e6f8,null));};exports[_0x73c1('0x45')]=function(_0x8eef8b,_0xaa9a0f){return db[_0x73c1('0x28')][_0x73c1('0x45')](_0x8eef8b[_0x73c1('0x46')],{})[_0x73c1('0x23')](respondWithResult(_0xaa9a0f,0xc9))[_0x73c1('0x41')](handleError(_0xaa9a0f,null));};exports['update']=function(_0x3e5e92,_0x1a6577){if(_0x3e5e92['body']['id']){delete _0x3e5e92['body']['id'];}return db[_0x73c1('0x28')][_0x73c1('0x47')]({'where':{'id':_0x3e5e92['params']['id']}})['then'](handleEntityNotFound(_0x1a6577,null))[_0x73c1('0x23')](saveUpdates(_0x3e5e92[_0x73c1('0x46')],null))[_0x73c1('0x23')](respondWithResult(_0x1a6577,null))[_0x73c1('0x41')](handleError(_0x1a6577,null));};exports[_0x73c1('0x24')]=function(_0x54ee9d,_0x173d75){return db[_0x73c1('0x28')][_0x73c1('0x47')]({'where':{'id':_0x54ee9d[_0x73c1('0x48')]['id']}})['then'](handleEntityNotFound(_0x173d75,null))[_0x73c1('0x23')](removeEntity(_0x173d75,null))[_0x73c1('0x41')](handleError(_0x173d75,null));};exports['describe']=function(_0x32d858,_0x27d878){return db[_0x73c1('0x28')][_0x73c1('0x49')]()[_0x73c1('0x23')](respondWithResult(_0x27d878,null))[_0x73c1('0x41')](handleError(_0x27d878,null));}; \ No newline at end of file +var _0x47de=['reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x5e28e6,_0x4201e4){var _0x595638=function(_0x48cee9){while(--_0x48cee9){_0x5e28e6['push'](_0x5e28e6['shift']());}};_0x595638(++_0x4201e4);}(_0x47de,0x73));var _0xe47d=function(_0x2b9767,_0x541f6c){_0x2b9767=_0x2b9767-0x0;var _0x5aeb0c=_0x47de[_0x2b9767];return _0x5aeb0c;};'use strict';var emlformat=require(_0xe47d('0x0'));var rimraf=require(_0xe47d('0x1'));var zipdir=require(_0xe47d('0x2'));var jsonpatch=require(_0xe47d('0x3'));var rp=require('request-promise');var moment=require(_0xe47d('0x4'));var BPromise=require(_0xe47d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe47d('0x6'));var csv=require(_0xe47d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe47d('0x8'));var _=require(_0xe47d('0x9'));var squel=require('squel');var crypto=require(_0xe47d('0xa'));var jsforce=require(_0xe47d('0xb'));var deskjs=require(_0xe47d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe47d('0xd'));var Papa=require(_0xe47d('0xe'));var Redis=require(_0xe47d('0xf'));var authService=require(_0xe47d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe47d('0x11'));var hardwareService=require(_0xe47d('0x12'));var logger=require(_0xe47d('0x13'))(_0xe47d('0x14'));var utils=require('../../config/utils');var config=require(_0xe47d('0x15'));var licenseUtil=require(_0xe47d('0x16'));var db=require(_0xe47d('0x17'))['db'];function respondWithStatusCode(_0xb1e3e7,_0xdeb562){_0xdeb562=_0xdeb562||0xcc;return function(_0xea1cbd){if(_0xea1cbd){return _0xb1e3e7[_0xe47d('0x18')](_0xdeb562);}return _0xb1e3e7[_0xe47d('0x19')](_0xdeb562)[_0xe47d('0x1a')]();};}function respondWithResult(_0x17ab05,_0x26480d){_0x26480d=_0x26480d||0xc8;return function(_0x449702){if(_0x449702){return _0x17ab05[_0xe47d('0x19')](_0x26480d)[_0xe47d('0x1b')](_0x449702);}};}function respondWithFilteredResult(_0x40e08b,_0x5b28bd){return function(_0x178eb0){if(_0x178eb0){var _0x416b36=typeof _0x5b28bd[_0xe47d('0x1c')]===_0xe47d('0x1d')&&typeof _0x5b28bd[_0xe47d('0x1e')]===_0xe47d('0x1d');var _0xfddbfb=_0x178eb0['count'];var _0x24be4d=_0x416b36?0x0:_0x5b28bd[_0xe47d('0x1c')];var _0x3ff9ec=_0x416b36?_0x178eb0[_0xe47d('0x1f')]:_0x5b28bd[_0xe47d('0x1c')]+_0x5b28bd['limit'];var _0x4892f9;if(_0x3ff9ec>=_0xfddbfb){_0x3ff9ec=_0xfddbfb;_0x4892f9=0xc8;}else{_0x4892f9=0xce;}_0x40e08b[_0xe47d('0x19')](_0x4892f9);return _0x40e08b[_0xe47d('0x20')](_0xe47d('0x21'),_0x24be4d+'-'+_0x3ff9ec+'/'+_0xfddbfb)[_0xe47d('0x1b')](_0x178eb0);}return null;};}function patchUpdates(_0x4f1092){return function(_0x37a291){try{jsonpatch[_0xe47d('0x22')](_0x37a291,_0x4f1092,!![]);}catch(_0x2d3681){return BPromise[_0xe47d('0x23')](_0x2d3681);}return _0x37a291['save']();};}function saveUpdates(_0x162fa8,_0x144b9f){return function(_0x3ffd1a){if(_0x3ffd1a){return _0x3ffd1a[_0xe47d('0x24')](_0x162fa8)[_0xe47d('0x25')](function(_0x3200f1){return _0x3200f1;});}return null;};}function removeEntity(_0x24e6c0,_0x481631){return function(_0x17e591){if(_0x17e591){return _0x17e591[_0xe47d('0x26')]()[_0xe47d('0x25')](function(){_0x24e6c0[_0xe47d('0x19')](0xcc)[_0xe47d('0x1a')]();});}};}function handleEntityNotFound(_0x51d03f,_0x4c7643){return function(_0x259fcb){if(!_0x259fcb){_0x51d03f['sendStatus'](0x194);}return _0x259fcb;};}function handleError(_0x39d7a2,_0x559c4d){_0x559c4d=_0x559c4d||0x1f4;return function(_0x78aae6){logger[_0xe47d('0x27')](_0x78aae6[_0xe47d('0x28')]);if(_0x78aae6[_0xe47d('0x29')]){delete _0x78aae6[_0xe47d('0x29')];}_0x39d7a2['status'](_0x559c4d)[_0xe47d('0x2a')](_0x78aae6);};}exports[_0xe47d('0x2b')]=function(_0x2621a0,_0x346ff3){var _0x1963a9={},_0x1c22fc={},_0x3c7a8f={'count':0x0,'rows':[]};var _0x4f1f10=_[_0xe47d('0x2c')](db[_0xe47d('0x2d')][_0xe47d('0x2e')],function(_0xd4564f){return{'name':_0xd4564f['fieldName'],'type':_0xd4564f[_0xe47d('0x2f')][_0xe47d('0x30')]};});_0x1c22fc[_0xe47d('0x31')]=_[_0xe47d('0x2c')](_0x4f1f10,_0xe47d('0x29'));_0x1c22fc[_0xe47d('0x32')]=_[_0xe47d('0x33')](_0x2621a0['query']);_0x1c22fc['filters']=_['intersection'](_0x1c22fc[_0xe47d('0x31')],_0x1c22fc[_0xe47d('0x32')]);_0x1963a9[_0xe47d('0x34')]=_[_0xe47d('0x35')](_0x1c22fc[_0xe47d('0x31')],qs[_0xe47d('0x36')](_0x2621a0['query']['fields']));_0x1963a9[_0xe47d('0x34')]=_0x1963a9['attributes']['length']?_0x1963a9[_0xe47d('0x34')]:_0x1c22fc['model'];if(!_0x2621a0[_0xe47d('0x32')][_0xe47d('0x37')](_0xe47d('0x38'))){_0x1963a9[_0xe47d('0x1e')]=qs[_0xe47d('0x1e')](_0x2621a0[_0xe47d('0x32')][_0xe47d('0x1e')]);_0x1963a9[_0xe47d('0x1c')]=qs[_0xe47d('0x1c')](_0x2621a0['query']['offset']);}_0x1963a9[_0xe47d('0x39')]=qs[_0xe47d('0x3a')](_0x2621a0[_0xe47d('0x32')][_0xe47d('0x3a')]);_0x1963a9[_0xe47d('0x3b')]=qs[_0xe47d('0x3c')](_[_0xe47d('0x3d')](_0x2621a0[_0xe47d('0x32')],_0x1c22fc[_0xe47d('0x3c')]),_0x4f1f10);if(_0x2621a0[_0xe47d('0x32')][_0xe47d('0x3e')]){_0x1963a9['where']=_[_0xe47d('0x3f')](_0x1963a9[_0xe47d('0x3b')],{'$or':_[_0xe47d('0x2c')](_0x4f1f10,function(_0x9ff91f){if(_0x9ff91f[_0xe47d('0x2f')]!=='VIRTUAL'){var _0x340144={};_0x340144[_0x9ff91f[_0xe47d('0x29')]]={'$like':'%'+_0x2621a0[_0xe47d('0x32')]['filter']+'%'};return _0x340144;}})});}_0x1963a9=_['merge']({},_0x1963a9,_0x2621a0[_0xe47d('0x40')]);var _0x20c433={'where':_0x1963a9['where']};return db[_0xe47d('0x2d')][_0xe47d('0x1f')](_0x20c433)[_0xe47d('0x25')](function(_0x2aa625){_0x3c7a8f['count']=_0x2aa625;if(_0x2621a0[_0xe47d('0x32')]['includeAll']){_0x1963a9[_0xe47d('0x41')]=[{'all':!![]}];}return db[_0xe47d('0x2d')][_0xe47d('0x42')](_0x1963a9);})[_0xe47d('0x25')](function(_0x25d7c6){_0x3c7a8f[_0xe47d('0x43')]=_0x25d7c6;return _0x3c7a8f;})[_0xe47d('0x25')](respondWithFilteredResult(_0x346ff3,_0x1963a9))[_0xe47d('0x44')](handleError(_0x346ff3,null));};exports['show']=function(_0x544b15,_0x4f8e89){var _0x19bb94={'raw':!![],'where':{'id':_0x544b15[_0xe47d('0x45')]['id']}},_0x546a06={};_0x546a06['model']=_['keys'](db[_0xe47d('0x2d')]['rawAttributes']);_0x546a06[_0xe47d('0x32')]=_[_0xe47d('0x33')](_0x544b15[_0xe47d('0x32')]);_0x546a06[_0xe47d('0x3c')]=_[_0xe47d('0x35')](_0x546a06[_0xe47d('0x31')],_0x546a06[_0xe47d('0x32')]);_0x19bb94[_0xe47d('0x34')]=_[_0xe47d('0x35')](_0x546a06['model'],qs['fields'](_0x544b15['query'][_0xe47d('0x36')]));_0x19bb94[_0xe47d('0x34')]=_0x19bb94[_0xe47d('0x34')][_0xe47d('0x46')]?_0x19bb94['attributes']:_0x546a06[_0xe47d('0x31')];if(_0x544b15[_0xe47d('0x32')]['includeAll']){_0x19bb94[_0xe47d('0x41')]=[{'all':!![]}];}_0x19bb94=_[_0xe47d('0x3f')]({},_0x19bb94,_0x544b15[_0xe47d('0x40')]);return db[_0xe47d('0x2d')]['find'](_0x19bb94)[_0xe47d('0x25')](handleEntityNotFound(_0x4f8e89,null))['then'](respondWithResult(_0x4f8e89,null))['catch'](handleError(_0x4f8e89,null));};exports[_0xe47d('0x47')]=function(_0x272f6a,_0x39fdbe){return db[_0xe47d('0x2d')][_0xe47d('0x47')](_0x272f6a[_0xe47d('0x48')],{})[_0xe47d('0x25')](respondWithResult(_0x39fdbe,0xc9))['catch'](handleError(_0x39fdbe,null));};exports[_0xe47d('0x24')]=function(_0x17205b,_0x1fe4f0){if(_0x17205b[_0xe47d('0x48')]['id']){delete _0x17205b[_0xe47d('0x48')]['id'];}return db[_0xe47d('0x2d')][_0xe47d('0x49')]({'where':{'id':_0x17205b[_0xe47d('0x45')]['id']}})[_0xe47d('0x25')](handleEntityNotFound(_0x1fe4f0,null))[_0xe47d('0x25')](saveUpdates(_0x17205b[_0xe47d('0x48')],null))['then'](respondWithResult(_0x1fe4f0,null))[_0xe47d('0x44')](handleError(_0x1fe4f0,null));};exports[_0xe47d('0x26')]=function(_0x142f4e,_0x2a63f6){return db[_0xe47d('0x2d')][_0xe47d('0x49')]({'where':{'id':_0x142f4e[_0xe47d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a63f6,null))[_0xe47d('0x25')](removeEntity(_0x2a63f6,null))['catch'](handleError(_0x2a63f6,null));};exports[_0xe47d('0x4a')]=function(_0x4e25ec,_0x7c57f0){return db[_0xe47d('0x2d')][_0xe47d('0x4a')]()[_0xe47d('0x25')](respondWithResult(_0x7c57f0,null))[_0xe47d('0x44')](handleError(_0x7c57f0,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 71ad826..39710e6 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 _0xb57d=['exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./openchannelTransferReport.attributes'];(function(_0x260575,_0x26c65f){var _0x3254b5=function(_0x2ecde2){while(--_0x2ecde2){_0x260575['push'](_0x260575['shift']());}};_0x3254b5(++_0x26c65f);}(_0xb57d,0xd0));var _0xdb57=function(_0x16de39,_0x50e362){_0x16de39=_0x16de39-0x0;var _0x3efeb9=_0xb57d[_0x16de39];return _0x3efeb9;};'use strict';var _=require(_0xdb57('0x0'));var util=require(_0xdb57('0x1'));var logger=require(_0xdb57('0x2'))(_0xdb57('0x3'));var moment=require('moment');var BPromise=require(_0xdb57('0x4'));var rp=require(_0xdb57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb57('0x6'));var attributes=require(_0xdb57('0x7'));module[_0xdb57('0x8')]=function(_0x17656a,_0x2466b1){return _0x17656a[_0xdb57('0x9')](_0xdb57('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xdb57('0xb'),'fields':[_0xdb57('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e71=['report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','OpenchannelTransferReport'];(function(_0xf5f216,_0x1cd34){var _0x10e5b3=function(_0x52d73b){while(--_0x52d73b){_0xf5f216['push'](_0xf5f216['shift']());}};_0x10e5b3(++_0x1cd34);}(_0x9e71,0xda));var _0x19e7=function(_0x3227c4,_0x29b196){_0x3227c4=_0x3227c4-0x0;var _0x1cc1bf=_0x9e71[_0x3227c4];return _0x1cc1bf;};'use strict';var _=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var logger=require('../../config/logger')(_0x19e7('0x2'));var moment=require(_0x19e7('0x3'));var BPromise=require(_0x19e7('0x4'));var rp=require(_0x19e7('0x5'));var fs=require('fs');var path=require(_0x19e7('0x6'));var rimraf=require(_0x19e7('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x19e7('0x8')]=function(_0x505e88,_0x14bb11){return _0x505e88['define'](_0x19e7('0x9'),attributes,{'tableName':_0x19e7('0xa'),'paranoid':![],'indexes':[{'name':_0x19e7('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 58314c9..c6a0004 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 _0x1a61=['error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xc96ce9,_0x39dab2){var _0x4f8966=function(_0x5739ef){while(--_0x5739ef){_0xc96ce9['push'](_0xc96ce9['shift']());}};_0x4f8966(++_0x39dab2);}(_0x1a61,0x1e6));var _0x11a6=function(_0x30ea7f,_0x297b7f){_0x30ea7f=_0x30ea7f-0x0;var _0x1046e1=_0x1a61[_0x30ea7f];return _0x1046e1;};'use strict';var _=require(_0x11a6('0x0'));var util=require('util');var moment=require(_0x11a6('0x1'));var BPromise=require('bluebird');var rs=require(_0x11a6('0x2'));var fs=require('fs');var Redis=require(_0x11a6('0x3'));var db=require(_0x11a6('0x4'))['db'];var utils=require(_0x11a6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x11a6('0x6'));var jayson=require(_0x11a6('0x7'));var client=jayson['client'][_0x11a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c4b31,_0x124855,_0x333ec2){return new BPromise(function(_0x1c67ce,_0x33b9b4){return client[_0x11a6('0x9')](_0x1c4b31,_0x333ec2)[_0x11a6('0xa')](function(_0x1a7d57){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x124855,'request\x20sent');logger[_0x11a6('0xb')](_0x11a6('0xc'),_0x124855,'request\x20sent',JSON[_0x11a6('0xd')](_0x1a7d57));if(_0x1a7d57[_0x11a6('0xe')]){if(_0x1a7d57[_0x11a6('0xe')][_0x11a6('0xf')]===0x1f4){logger[_0x11a6('0xe')](_0x11a6('0x10'),_0x124855,_0x1a7d57['error']['message']);return _0x33b9b4(_0x1a7d57[_0x11a6('0xe')][_0x11a6('0x11')]);}logger['error'](_0x11a6('0x10'),_0x124855,_0x1a7d57[_0x11a6('0xe')]['message']);return _0x1c67ce(_0x1a7d57[_0x11a6('0xe')][_0x11a6('0x11')]);}else{logger['info'](_0x11a6('0x10'),_0x124855,_0x11a6('0x12'));_0x1c67ce(_0x1a7d57[_0x11a6('0x13')][_0x11a6('0x11')]);}})['catch'](function(_0x3d6457){logger[_0x11a6('0xe')](_0x11a6('0x10'),_0x124855,_0x3d6457);_0x33b9b4(_0x3d6457);});});} \ No newline at end of file +var _0x1501=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0xab7e7c,_0x4c8cfe){var _0x4c80f4=function(_0x286385){while(--_0x286385){_0xab7e7c['push'](_0xab7e7c['shift']());}};_0x4c80f4(++_0x4c8cfe);}(_0x1501,0x126));var _0x1150=function(_0x4706af,_0x24b450){_0x4706af=_0x4706af-0x0;var _0x2f75c4=_0x1501[_0x4706af];return _0x2f75c4;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var moment=require(_0x1150('0x1'));var BPromise=require(_0x1150('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1150('0x3'));var db=require(_0x1150('0x4'))['db'];var utils=require(_0x1150('0x5'));var logger=require(_0x1150('0x6'))('rpc');var config=require(_0x1150('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1150('0x8')][_0x1150('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc391,_0x131b49,_0x24340c){return new BPromise(function(_0x321d80,_0x2da67d){return client['request'](_0x2fc391,_0x24340c)['then'](function(_0x22d26c){logger[_0x1150('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x131b49,'request\x20sent');logger[_0x1150('0xb')](_0x1150('0xc'),_0x131b49,_0x1150('0xd'),JSON[_0x1150('0xe')](_0x22d26c));if(_0x22d26c['error']){if(_0x22d26c[_0x1150('0xf')][_0x1150('0x10')]===0x1f4){logger['error'](_0x1150('0x11'),_0x131b49,_0x22d26c['error'][_0x1150('0x12')]);return _0x2da67d(_0x22d26c[_0x1150('0xf')][_0x1150('0x12')]);}logger[_0x1150('0xf')](_0x1150('0x11'),_0x131b49,_0x22d26c[_0x1150('0xf')][_0x1150('0x12')]);return _0x321d80(_0x22d26c[_0x1150('0xf')]['message']);}else{logger['info'](_0x1150('0x11'),_0x131b49,_0x1150('0xd'));_0x321d80(_0x22d26c[_0x1150('0x13')][_0x1150('0x12')]);}})[_0x1150('0x14')](function(_0x1a8b62){logger[_0x1150('0xf')](_0x1150('0x11'),_0x131b49,_0x1a8b62);_0x2da67d(_0x1a8b62);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index cd33af7..70d2ed8 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 _0xc18b=['delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/:id','isAuthenticated','create','put','update'];(function(_0x28447f,_0x1a578d){var _0x20e3fb=function(_0x4a06e8){while(--_0x4a06e8){_0x28447f['push'](_0x28447f['shift']());}};_0x20e3fb(++_0x1a578d);}(_0xc18b,0xe2));var _0xbc18=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xc18b[_0x376b45];return _0x2341b3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc18('0x0'));var timeout=require(_0xbc18('0x1'));var express=require('express');var router=express[_0xbc18('0x2')]();var fs_extra=require(_0xbc18('0x3'));var auth=require(_0xbc18('0x4'));var interaction=require(_0xbc18('0x5'));var config=require('../../config/environment');var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xbc18('0x6')]);router['get'](_0xbc18('0x7'),auth[_0xbc18('0x8')](),controller['show']);router['post']('/',auth[_0xbc18('0x8')](),controller[_0xbc18('0x9')]);router[_0xbc18('0xa')](_0xbc18('0x7'),auth[_0xbc18('0x8')](),controller[_0xbc18('0xb')]);router[_0xbc18('0xc')](_0xbc18('0x7'),auth[_0xbc18('0x8')](),controller['destroy']);module[_0xbc18('0xd')]=router; \ No newline at end of file +var _0x8b59=['update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','/:id','show','create','put'];(function(_0x1aa613,_0x188134){var _0x4a3698=function(_0x25a8f2){while(--_0x25a8f2){_0x1aa613['push'](_0x1aa613['shift']());}};_0x4a3698(++_0x188134);}(_0x8b59,0x1d7));var _0x98b5=function(_0x2223e0,_0x876294){_0x2223e0=_0x2223e0-0x0;var _0x10a84b=_0x8b59[_0x2223e0];return _0x10a84b;};'use strict';var multer=require(_0x98b5('0x0'));var util=require(_0x98b5('0x1'));var path=require('path');var timeout=require(_0x98b5('0x2'));var express=require(_0x98b5('0x3'));var router=express[_0x98b5('0x4')]();var fs_extra=require(_0x98b5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x98b5('0x6'));var config=require(_0x98b5('0x7'));var controller=require(_0x98b5('0x8'));router['get']('/',auth[_0x98b5('0x9')](),controller[_0x98b5('0xa')]);router['get'](_0x98b5('0xb'),auth[_0x98b5('0x9')](),controller[_0x98b5('0xc')]);router['post']('/',auth[_0x98b5('0x9')](),controller[_0x98b5('0xd')]);router[_0x98b5('0xe')](_0x98b5('0xb'),auth[_0x98b5('0x9')](),controller[_0x98b5('0xf')]);router[_0x98b5('0x10')]('/:id',auth[_0x98b5('0x9')](),controller['destroy']);module[_0x98b5('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index ba410d9..67549d5 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 _0x200a=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x200a,0x8c));var _0xa200=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x200a[_0x121886];return _0x20ca01;};'use strict';var Sequelize=require(_0xa200('0x0'));module[_0xa200('0x1')]={'name':{'type':Sequelize[_0xa200('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x876c=['exports','STRING','name','sequelize'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x876c,0x1db));var _0xc876=function(_0x4965ce,_0x5e4fd4){_0x4965ce=_0x4965ce-0x0;var _0x41b7ad=_0x876c[_0x4965ce];return _0x41b7ad;};'use strict';var Sequelize=require(_0xc876('0x0'));module[_0xc876('0x1')]={'name':{'type':Sequelize[_0xc876('0x2')],'unique':_0xc876('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc876('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 0039094..05ecb03 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 _0x1378=['fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Pauses','sendStatus','error','name','map','Pause','rawAttributes','type','query','keys','filters','intersection','model','attributes'];(function(_0x32d10a,_0xc25853){var _0x42a6db=function(_0x418ef8){while(--_0x418ef8){_0x32d10a['push'](_0x32d10a['shift']());}};_0x42a6db(++_0xc25853);}(_0x1378,0x10f));var _0x8137=function(_0x4e8901,_0x3341ec){_0x4e8901=_0x4e8901-0x0;var _0x109b96=_0x1378[_0x4e8901];return _0x109b96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8137('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8137('0x1'));var rp=require(_0x8137('0x2'));var moment=require(_0x8137('0x3'));var BPromise=require(_0x8137('0x4'));var Mustache=require(_0x8137('0x5'));var util=require(_0x8137('0x6'));var path=require(_0x8137('0x7'));var sox=require('sox');var csv=require(_0x8137('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8137('0x9'));var _=require(_0x8137('0xa'));var squel=require(_0x8137('0xb'));var crypto=require(_0x8137('0xc'));var jsforce=require(_0x8137('0xd'));var deskjs=require(_0x8137('0xe'));var toCsv=require(_0x8137('0x8'));var querystring=require(_0x8137('0xf'));var Papa=require(_0x8137('0x10'));var Redis=require('ioredis');var authService=require(_0x8137('0x11'));var qs=require(_0x8137('0x12'));var as=require(_0x8137('0x13'));var hardwareService=require(_0x8137('0x14'));var logger=require('../../config/logger')(_0x8137('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8137('0x16'));var db=require(_0x8137('0x17'))['db'];function respondWithStatusCode(_0x4f6cd0,_0x45d6f4){_0x45d6f4=_0x45d6f4||0xcc;return function(_0x422892){if(_0x422892){return _0x4f6cd0['sendStatus'](_0x45d6f4);}return _0x4f6cd0[_0x8137('0x18')](_0x45d6f4)[_0x8137('0x19')]();};}function respondWithResult(_0x11c919,_0x2fc76e){_0x2fc76e=_0x2fc76e||0xc8;return function(_0x548073){if(_0x548073){return _0x11c919[_0x8137('0x18')](_0x2fc76e)[_0x8137('0x1a')](_0x548073);}};}function respondWithFilteredResult(_0x1ecafa,_0x5c8b7d){return function(_0x2c1f3a){if(_0x2c1f3a){var _0x17de37=typeof _0x5c8b7d[_0x8137('0x1b')]===_0x8137('0x1c')&&typeof _0x5c8b7d[_0x8137('0x1d')]===_0x8137('0x1c');var _0xae90f4=_0x2c1f3a[_0x8137('0x1e')];var _0x27a73b=_0x17de37?0x0:_0x5c8b7d[_0x8137('0x1b')];var _0x12d046=_0x17de37?_0x2c1f3a[_0x8137('0x1e')]:_0x5c8b7d['offset']+_0x5c8b7d[_0x8137('0x1d')];var _0x2ab290;if(_0x12d046>=_0xae90f4){_0x12d046=_0xae90f4;_0x2ab290=0xc8;}else{_0x2ab290=0xce;}_0x1ecafa[_0x8137('0x18')](_0x2ab290);return _0x1ecafa[_0x8137('0x1f')]('Content-Range',_0x27a73b+'-'+_0x12d046+'/'+_0xae90f4)['json'](_0x2c1f3a);}return null;};}function patchUpdates(_0x21c800){return function(_0xebb50b){try{jsonpatch[_0x8137('0x20')](_0xebb50b,_0x21c800,!![]);}catch(_0xd8444){return BPromise[_0x8137('0x21')](_0xd8444);}return _0xebb50b[_0x8137('0x22')]();};}function saveUpdates(_0x43a89e,_0x1f2e3f){return function(_0x38e59b){if(_0x38e59b){return _0x38e59b[_0x8137('0x23')](_0x43a89e)[_0x8137('0x24')](function(_0x3d280f){return _0x3d280f;});}return null;};}function removeEntity(_0x4e761a,_0x4882fa){return function(_0x41a965){if(_0x41a965){return _0x41a965[_0x8137('0x25')]()[_0x8137('0x24')](function(){var _0x5442f0=_0x41a965[_0x8137('0x26')]({'plain':!![]});var _0x130fdd=_0x8137('0x27');return db['UserProfileResource'][_0x8137('0x25')]({'where':{'type':_0x130fdd,'resourceId':_0x5442f0['id']}})[_0x8137('0x24')](function(){return _0x41a965;});})[_0x8137('0x24')](function(){_0x4e761a[_0x8137('0x18')](0xcc)[_0x8137('0x19')]();});}};}function handleEntityNotFound(_0x1ee42e,_0x5c9c70){return function(_0x502e37){if(!_0x502e37){_0x1ee42e[_0x8137('0x28')](0x194);}return _0x502e37;};}function handleError(_0x12c152,_0x5400fb){_0x5400fb=_0x5400fb||0x1f4;return function(_0x20abb){logger[_0x8137('0x29')](_0x20abb['stack']);if(_0x20abb['name']){delete _0x20abb[_0x8137('0x2a')];}_0x12c152[_0x8137('0x18')](_0x5400fb)['send'](_0x20abb);};}exports['index']=function(_0xc6d1df,_0x36d876){var _0x1aadb7={},_0x38bb60={},_0x174689={'count':0x0,'rows':[]};var _0x2d218a=_[_0x8137('0x2b')](db[_0x8137('0x2c')][_0x8137('0x2d')],function(_0x5250e3){return{'name':_0x5250e3['fieldName'],'type':_0x5250e3[_0x8137('0x2e')]['key']};});_0x38bb60['model']=_[_0x8137('0x2b')](_0x2d218a,_0x8137('0x2a'));_0x38bb60[_0x8137('0x2f')]=_[_0x8137('0x30')](_0xc6d1df['query']);_0x38bb60[_0x8137('0x31')]=_[_0x8137('0x32')](_0x38bb60[_0x8137('0x33')],_0x38bb60[_0x8137('0x2f')]);_0x1aadb7[_0x8137('0x34')]=_[_0x8137('0x32')](_0x38bb60[_0x8137('0x33')],qs[_0x8137('0x35')](_0xc6d1df[_0x8137('0x2f')][_0x8137('0x35')]));_0x1aadb7[_0x8137('0x34')]=_0x1aadb7[_0x8137('0x34')][_0x8137('0x36')]?_0x1aadb7[_0x8137('0x34')]:_0x38bb60[_0x8137('0x33')];if(!_0xc6d1df[_0x8137('0x2f')]['hasOwnProperty'](_0x8137('0x37'))){_0x1aadb7[_0x8137('0x1d')]=qs[_0x8137('0x1d')](_0xc6d1df[_0x8137('0x2f')][_0x8137('0x1d')]);_0x1aadb7['offset']=qs[_0x8137('0x1b')](_0xc6d1df[_0x8137('0x2f')][_0x8137('0x1b')]);}_0x1aadb7[_0x8137('0x38')]=qs[_0x8137('0x39')](_0xc6d1df[_0x8137('0x2f')][_0x8137('0x39')]);_0x1aadb7[_0x8137('0x3a')]=qs[_0x8137('0x31')](_[_0x8137('0x3b')](_0xc6d1df[_0x8137('0x2f')],_0x38bb60[_0x8137('0x31')]),_0x2d218a);if(_0xc6d1df[_0x8137('0x2f')][_0x8137('0x3c')]){_0x1aadb7[_0x8137('0x3a')]=_[_0x8137('0x3d')](_0x1aadb7[_0x8137('0x3a')],{'$or':_[_0x8137('0x2b')](_0x2d218a,function(_0x996e1f){if(_0x996e1f[_0x8137('0x2e')]!==_0x8137('0x3e')){var _0x168556={};_0x168556[_0x996e1f[_0x8137('0x2a')]]={'$like':'%'+_0xc6d1df[_0x8137('0x2f')][_0x8137('0x3c')]+'%'};return _0x168556;}})});}_0x1aadb7=_[_0x8137('0x3d')]({},_0x1aadb7,_0xc6d1df[_0x8137('0x3f')]);var _0x1e2761={'where':_0x1aadb7[_0x8137('0x3a')]};return db[_0x8137('0x2c')][_0x8137('0x1e')](_0x1e2761)[_0x8137('0x24')](function(_0x1a897e){_0x174689[_0x8137('0x1e')]=_0x1a897e;if(_0xc6d1df[_0x8137('0x2f')]['includeAll']){_0x1aadb7['include']=[{'all':!![]}];}return db[_0x8137('0x2c')]['findAll'](_0x1aadb7);})['then'](function(_0x5116a6){_0x174689[_0x8137('0x40')]=_0x5116a6;return _0x174689;})[_0x8137('0x24')](respondWithFilteredResult(_0x36d876,_0x1aadb7))[_0x8137('0x41')](handleError(_0x36d876,null));};exports[_0x8137('0x42')]=function(_0x2c754f,_0x461aea){var _0x26a31f={'raw':!![],'where':{'id':_0x2c754f['params']['id']}},_0x5c77e8={};_0x5c77e8[_0x8137('0x33')]=_[_0x8137('0x30')](db[_0x8137('0x2c')][_0x8137('0x2d')]);_0x5c77e8['query']=_['keys'](_0x2c754f['query']);_0x5c77e8[_0x8137('0x31')]=_[_0x8137('0x32')](_0x5c77e8[_0x8137('0x33')],_0x5c77e8['query']);_0x26a31f[_0x8137('0x34')]=_[_0x8137('0x32')](_0x5c77e8[_0x8137('0x33')],qs[_0x8137('0x35')](_0x2c754f[_0x8137('0x2f')][_0x8137('0x35')]));_0x26a31f[_0x8137('0x34')]=_0x26a31f['attributes'][_0x8137('0x36')]?_0x26a31f[_0x8137('0x34')]:_0x5c77e8['model'];if(_0x2c754f[_0x8137('0x2f')][_0x8137('0x43')]){_0x26a31f[_0x8137('0x44')]=[{'all':!![]}];}_0x26a31f=_[_0x8137('0x3d')]({},_0x26a31f,_0x2c754f['options']);return db[_0x8137('0x2c')][_0x8137('0x45')](_0x26a31f)['then'](handleEntityNotFound(_0x461aea,null))[_0x8137('0x24')](respondWithResult(_0x461aea,null))[_0x8137('0x41')](handleError(_0x461aea,null));};exports['create']=function(_0x12825a,_0x374d03){return db[_0x8137('0x2c')][_0x8137('0x46')](_0x12825a['body'],{})['then'](function(_0x369b0e){var _0xb9acde=_0x12825a[_0x8137('0x47')]['get']({'plain':!![]});if(!_0xb9acde)throw new Error(_0x8137('0x48'));if(_0xb9acde[_0x8137('0x49')]===_0x8137('0x47')){var _0x47be86=_0x369b0e[_0x8137('0x26')]({'plain':!![]});var _0x2161d5=_0x8137('0x27');return db[_0x8137('0x4a')][_0x8137('0x45')]({'where':{'name':_0x2161d5,'userProfileId':_0xb9acde[_0x8137('0x4b')]},'raw':!![]})[_0x8137('0x24')](function(_0x49cf24){if(_0x49cf24&&_0x49cf24[_0x8137('0x4c')]===0x0){return db[_0x8137('0x4d')][_0x8137('0x46')]({'name':_0x47be86[_0x8137('0x2a')],'resourceId':_0x47be86['id'],'type':_0x49cf24[_0x8137('0x2a')],'sectionId':_0x49cf24['id']},{})['then'](function(){return _0x369b0e;});}else{return _0x369b0e;}})[_0x8137('0x41')](function(_0xa2038c){logger['error'](_0x8137('0x4e'),_0xa2038c);throw _0xa2038c;});}return _0x369b0e;})[_0x8137('0x24')](respondWithResult(_0x374d03,0xc9))[_0x8137('0x41')](handleError(_0x374d03,null));};exports[_0x8137('0x23')]=function(_0x383298,_0x58180f){if(_0x383298[_0x8137('0x4f')]['id']){delete _0x383298['body']['id'];}return db[_0x8137('0x2c')][_0x8137('0x45')]({'where':{'id':_0x383298[_0x8137('0x50')]['id']}})[_0x8137('0x24')](handleEntityNotFound(_0x58180f,null))[_0x8137('0x24')](saveUpdates(_0x383298[_0x8137('0x4f')],null))[_0x8137('0x24')](respondWithResult(_0x58180f,null))[_0x8137('0x41')](handleError(_0x58180f,null));};exports['destroy']=function(_0x206686,_0x183a11){return db['Pause']['find']({'where':{'id':_0x206686[_0x8137('0x50')]['id']}})[_0x8137('0x24')](handleEntityNotFound(_0x183a11,null))[_0x8137('0x24')](removeEntity(_0x183a11,null))[_0x8137('0x41')](handleError(_0x183a11,null));}; \ No newline at end of file +var _0xbeb7=['merge','VIRTUAL','includeAll','rows','catch','params','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Pauses','UserProfileResource','end','error','stack','name','send','index','Pause','type','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','where'];(function(_0x613385,_0x808baf){var _0x4ab7b5=function(_0x17305c){while(--_0x17305c){_0x613385['push'](_0x613385['shift']());}};_0x4ab7b5(++_0x808baf);}(_0xbeb7,0x189));var _0x7beb=function(_0x5466dd,_0x1dda96){_0x5466dd=_0x5466dd-0x0;var _0x5c03a7=_0xbeb7[_0x5466dd];return _0x5c03a7;};'use strict';var emlformat=require(_0x7beb('0x0'));var rimraf=require(_0x7beb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7beb('0x2'));var rp=require(_0x7beb('0x3'));var moment=require(_0x7beb('0x4'));var BPromise=require(_0x7beb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7beb('0x6'));var sox=require('sox');var csv=require(_0x7beb('0x7'));var ejs=require(_0x7beb('0x8'));var fs=require('fs');var fs_extra=require(_0x7beb('0x9'));var _=require(_0x7beb('0xa'));var squel=require('squel');var crypto=require(_0x7beb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7beb('0x7'));var querystring=require('querystring');var Papa=require(_0x7beb('0xc'));var Redis=require(_0x7beb('0xd'));var authService=require(_0x7beb('0xe'));var qs=require(_0x7beb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7beb('0x10'))(_0x7beb('0x11'));var utils=require('../../config/utils');var config=require(_0x7beb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7beb('0x13'))['db'];function respondWithStatusCode(_0x4935ef,_0x24b3ec){_0x24b3ec=_0x24b3ec||0xcc;return function(_0x4f1dd9){if(_0x4f1dd9){return _0x4935ef['sendStatus'](_0x24b3ec);}return _0x4935ef[_0x7beb('0x14')](_0x24b3ec)['end']();};}function respondWithResult(_0x41459c,_0x56b4fc){_0x56b4fc=_0x56b4fc||0xc8;return function(_0x422146){if(_0x422146){return _0x41459c[_0x7beb('0x14')](_0x56b4fc)[_0x7beb('0x15')](_0x422146);}};}function respondWithFilteredResult(_0x4e2528,_0x1078a5){return function(_0x4b1e81){if(_0x4b1e81){var _0x52684b=typeof _0x1078a5[_0x7beb('0x16')]===_0x7beb('0x17')&&typeof _0x1078a5[_0x7beb('0x18')]===_0x7beb('0x17');var _0x20d680=_0x4b1e81['count'];var _0x549783=_0x52684b?0x0:_0x1078a5[_0x7beb('0x16')];var _0x3ca533=_0x52684b?_0x4b1e81[_0x7beb('0x19')]:_0x1078a5[_0x7beb('0x16')]+_0x1078a5[_0x7beb('0x18')];var _0x26c756;if(_0x3ca533>=_0x20d680){_0x3ca533=_0x20d680;_0x26c756=0xc8;}else{_0x26c756=0xce;}_0x4e2528[_0x7beb('0x14')](_0x26c756);return _0x4e2528[_0x7beb('0x1a')](_0x7beb('0x1b'),_0x549783+'-'+_0x3ca533+'/'+_0x20d680)[_0x7beb('0x15')](_0x4b1e81);}return null;};}function patchUpdates(_0x4a0242){return function(_0x191927){try{jsonpatch[_0x7beb('0x1c')](_0x191927,_0x4a0242,!![]);}catch(_0x404aa3){return BPromise['reject'](_0x404aa3);}return _0x191927[_0x7beb('0x1d')]();};}function saveUpdates(_0x1c0a9c,_0x216d91){return function(_0x3d8406){if(_0x3d8406){return _0x3d8406[_0x7beb('0x1e')](_0x1c0a9c)['then'](function(_0x89673){return _0x89673;});}return null;};}function removeEntity(_0x19fec7,_0x18f53e){return function(_0x3a5bc2){if(_0x3a5bc2){return _0x3a5bc2[_0x7beb('0x1f')]()[_0x7beb('0x20')](function(){var _0xca6299=_0x3a5bc2[_0x7beb('0x21')]({'plain':!![]});var _0x6978d7=_0x7beb('0x22');return db[_0x7beb('0x23')][_0x7beb('0x1f')]({'where':{'type':_0x6978d7,'resourceId':_0xca6299['id']}})[_0x7beb('0x20')](function(){return _0x3a5bc2;});})['then'](function(){_0x19fec7[_0x7beb('0x14')](0xcc)[_0x7beb('0x24')]();});}};}function handleEntityNotFound(_0x3fafc4,_0x504173){return function(_0x72a80){if(!_0x72a80){_0x3fafc4['sendStatus'](0x194);}return _0x72a80;};}function handleError(_0x30c01d,_0xeab60b){_0xeab60b=_0xeab60b||0x1f4;return function(_0x3e0cb9){logger[_0x7beb('0x25')](_0x3e0cb9[_0x7beb('0x26')]);if(_0x3e0cb9['name']){delete _0x3e0cb9[_0x7beb('0x27')];}_0x30c01d[_0x7beb('0x14')](_0xeab60b)[_0x7beb('0x28')](_0x3e0cb9);};}exports[_0x7beb('0x29')]=function(_0x29c7e8,_0x62c276){var _0x2e108e={},_0x33d838={},_0x3d7c5f={'count':0x0,'rows':[]};var _0x392e50=_['map'](db[_0x7beb('0x2a')]['rawAttributes'],function(_0x10cc43){return{'name':_0x10cc43['fieldName'],'type':_0x10cc43[_0x7beb('0x2b')]['key']};});_0x33d838['model']=_[_0x7beb('0x2c')](_0x392e50,_0x7beb('0x27'));_0x33d838[_0x7beb('0x2d')]=_[_0x7beb('0x2e')](_0x29c7e8[_0x7beb('0x2d')]);_0x33d838[_0x7beb('0x2f')]=_[_0x7beb('0x30')](_0x33d838[_0x7beb('0x31')],_0x33d838[_0x7beb('0x2d')]);_0x2e108e['attributes']=_[_0x7beb('0x30')](_0x33d838[_0x7beb('0x31')],qs[_0x7beb('0x32')](_0x29c7e8['query'][_0x7beb('0x32')]));_0x2e108e[_0x7beb('0x33')]=_0x2e108e[_0x7beb('0x33')]['length']?_0x2e108e[_0x7beb('0x33')]:_0x33d838['model'];if(!_0x29c7e8['query'][_0x7beb('0x34')](_0x7beb('0x35'))){_0x2e108e[_0x7beb('0x18')]=qs[_0x7beb('0x18')](_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x18')]);_0x2e108e['offset']=qs[_0x7beb('0x16')](_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x16')]);}_0x2e108e['order']=qs[_0x7beb('0x36')](_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x36')]);_0x2e108e['where']=qs['filters'](_[_0x7beb('0x37')](_0x29c7e8[_0x7beb('0x2d')],_0x33d838[_0x7beb('0x2f')]),_0x392e50);if(_0x29c7e8['query']['filter']){_0x2e108e[_0x7beb('0x38')]=_[_0x7beb('0x39')](_0x2e108e['where'],{'$or':_[_0x7beb('0x2c')](_0x392e50,function(_0x35b18f){if(_0x35b18f[_0x7beb('0x2b')]!==_0x7beb('0x3a')){var _0x4474d6={};_0x4474d6[_0x35b18f[_0x7beb('0x27')]]={'$like':'%'+_0x29c7e8[_0x7beb('0x2d')]['filter']+'%'};return _0x4474d6;}})});}_0x2e108e=_[_0x7beb('0x39')]({},_0x2e108e,_0x29c7e8['options']);var _0x2ae609={'where':_0x2e108e[_0x7beb('0x38')]};return db[_0x7beb('0x2a')][_0x7beb('0x19')](_0x2ae609)[_0x7beb('0x20')](function(_0x362bde){_0x3d7c5f['count']=_0x362bde;if(_0x29c7e8[_0x7beb('0x2d')][_0x7beb('0x3b')]){_0x2e108e['include']=[{'all':!![]}];}return db['Pause']['findAll'](_0x2e108e);})[_0x7beb('0x20')](function(_0x599d34){_0x3d7c5f[_0x7beb('0x3c')]=_0x599d34;return _0x3d7c5f;})[_0x7beb('0x20')](respondWithFilteredResult(_0x62c276,_0x2e108e))[_0x7beb('0x3d')](handleError(_0x62c276,null));};exports['show']=function(_0x429f82,_0x411591){var _0x234bff={'raw':!![],'where':{'id':_0x429f82[_0x7beb('0x3e')]['id']}},_0x238462={};_0x238462['model']=_['keys'](db[_0x7beb('0x2a')][_0x7beb('0x3f')]);_0x238462[_0x7beb('0x2d')]=_[_0x7beb('0x2e')](_0x429f82[_0x7beb('0x2d')]);_0x238462[_0x7beb('0x2f')]=_[_0x7beb('0x30')](_0x238462['model'],_0x238462[_0x7beb('0x2d')]);_0x234bff[_0x7beb('0x33')]=_[_0x7beb('0x30')](_0x238462['model'],qs[_0x7beb('0x32')](_0x429f82[_0x7beb('0x2d')][_0x7beb('0x32')]));_0x234bff[_0x7beb('0x33')]=_0x234bff[_0x7beb('0x33')][_0x7beb('0x40')]?_0x234bff[_0x7beb('0x33')]:_0x238462[_0x7beb('0x31')];if(_0x429f82[_0x7beb('0x2d')][_0x7beb('0x3b')]){_0x234bff['include']=[{'all':!![]}];}_0x234bff=_[_0x7beb('0x39')]({},_0x234bff,_0x429f82[_0x7beb('0x41')]);return db[_0x7beb('0x2a')][_0x7beb('0x42')](_0x234bff)[_0x7beb('0x20')](handleEntityNotFound(_0x411591,null))['then'](respondWithResult(_0x411591,null))[_0x7beb('0x3d')](handleError(_0x411591,null));};exports[_0x7beb('0x43')]=function(_0x542076,_0x7a9956){return db['Pause'][_0x7beb('0x43')](_0x542076[_0x7beb('0x44')],{})['then'](function(_0x401ef1){var _0x1b558e=_0x542076[_0x7beb('0x45')][_0x7beb('0x21')]({'plain':!![]});if(!_0x1b558e)throw new Error(_0x7beb('0x46'));if(_0x1b558e['role']===_0x7beb('0x45')){var _0x3c5983=_0x401ef1[_0x7beb('0x21')]({'plain':!![]});var _0x117878=_0x7beb('0x22');return db[_0x7beb('0x47')][_0x7beb('0x42')]({'where':{'name':_0x117878,'userProfileId':_0x1b558e[_0x7beb('0x48')]},'raw':!![]})['then'](function(_0x376c18){if(_0x376c18&&_0x376c18[_0x7beb('0x49')]===0x0){return db[_0x7beb('0x23')][_0x7beb('0x43')]({'name':_0x3c5983[_0x7beb('0x27')],'resourceId':_0x3c5983['id'],'type':_0x376c18[_0x7beb('0x27')],'sectionId':_0x376c18['id']},{})[_0x7beb('0x20')](function(){return _0x401ef1;});}else{return _0x401ef1;}})['catch'](function(_0x587578){logger[_0x7beb('0x25')](_0x7beb('0x4a'),_0x587578);throw _0x587578;});}return _0x401ef1;})[_0x7beb('0x20')](respondWithResult(_0x7a9956,0xc9))[_0x7beb('0x3d')](handleError(_0x7a9956,null));};exports['update']=function(_0x48c074,_0x12203b){if(_0x48c074[_0x7beb('0x44')]['id']){delete _0x48c074['body']['id'];}return db[_0x7beb('0x2a')]['find']({'where':{'id':_0x48c074['params']['id']}})['then'](handleEntityNotFound(_0x12203b,null))[_0x7beb('0x20')](saveUpdates(_0x48c074['body'],null))[_0x7beb('0x20')](respondWithResult(_0x12203b,null))[_0x7beb('0x3d')](handleError(_0x12203b,null));};exports[_0x7beb('0x1f')]=function(_0x29dc83,_0x2d577e){return db[_0x7beb('0x2a')][_0x7beb('0x42')]({'where':{'id':_0x29dc83[_0x7beb('0x3e')]['id']}})[_0x7beb('0x20')](handleEntityNotFound(_0x2d577e,null))[_0x7beb('0x20')](removeEntity(_0x2d577e,null))[_0x7beb('0x3d')](handleError(_0x2d577e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 022c558..655f7f1 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x4563a5,_0x30cf02){var _0x5400ab=function(_0x38286b){while(--_0x38286b){_0x4563a5['push'](_0x4563a5['shift']());}};_0x5400ab(++_0x30cf02);}(_0xe14b,0x93));var _0xbe14=function(_0xd7168a,_0x46f167){_0xd7168a=_0xd7168a-0x0;var _0x335b9b=_0xe14b[_0xd7168a];return _0x335b9b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6aa7,0x178));var _0x76aa=function(_0x5bf042,_0x3a8eb7){_0x5bf042=_0x5bf042-0x0;var _0x4864cf=_0x6aa7[_0x5bf042];return _0x4864cf;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'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 1b0d68e..f9e473b 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x46e8b0,_0x2bd080){var _0x735b90=function(_0x2d4add){while(--_0x2d4add){_0x46e8b0['push'](_0x46e8b0['shift']());}};_0x735b90(++_0x2bd080);}(_0x7a54,0x106));var _0x47a5=function(_0x3c9ac0,_0x4a61c3){_0x3c9ac0=_0x3c9ac0-0x0;var _0x3beaee=_0x7a54[_0x3c9ac0];return _0x3beaee;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x24f65e,_0x3ea9ac){var _0x3a1f0c=function(_0x425036){while(--_0x425036){_0x24f65e['push'](_0x24f65e['shift']());}};_0x3a1f0c(++_0x3ea9ac);}(_0x7a54,0x106));var _0x47a5=function(_0x23de5d,_0x56e8ad){_0x23de5d=_0x23de5d-0x0;var _0x12c79b=_0x7a54[_0x23de5d];return _0x12c79b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index a7390bd..44e4e9f 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 _0x0e85=['put','update','delete','exports','multer','util','connect-timeout','express','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0x1c3d97,_0x18389b){var _0x2713fb=function(_0x3657d4){while(--_0x3657d4){_0x1c3d97['push'](_0x1c3d97['shift']());}};_0x2713fb(++_0x18389b);}(_0x0e85,0x7c));var _0x50e8=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x0e85[_0x4a3898];return _0x25ceb0;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50e8('0x4'));var config=require('../../config/environment');var controller=require(_0x50e8('0x5'));router[_0x50e8('0x6')]('/',auth[_0x50e8('0x7')](),controller[_0x50e8('0x8')]);router['get'](_0x50e8('0x9'),controller[_0x50e8('0xa')]);router[_0x50e8('0x6')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xc')]);router['get'](_0x50e8('0xd'),auth[_0x50e8('0x7')](),controller[_0x50e8('0xe')]);var upload=multer({'storage':multer[_0x50e8('0xf')]({'destination':function(_0x154b9e,_0x194a89,_0x45dc6f){_0x45dc6f(null,path[_0x50e8('0x10')](config['root'],'server/files/plugins'));},'filename':function(_0xfc6bb9,_0x24d381,_0x508377){_0x24d381['originalname']=_0x24d381[_0x50e8('0x11')][_0x50e8('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x508377(null,util[_0x50e8('0x13')](_0x50e8('0x14'),path['basename'](_0x24d381[_0x50e8('0x11')],path[_0x50e8('0x15')](_0x24d381[_0x50e8('0x11')])),Date['now'](),path['extname'](_0x24d381[_0x50e8('0x11')])));}})});router[_0x50e8('0x16')]('/',upload[_0x50e8('0x17')](_0x50e8('0x18')),controller[_0x50e8('0x19')]);router[_0x50e8('0x16')]('/webhook',controller['webhookPost']);router[_0x50e8('0x1a')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller[_0x50e8('0x1b')]);router[_0x50e8('0x1c')](_0x50e8('0xb'),auth[_0x50e8('0x7')](),controller['delete']);module[_0x50e8('0x1d')]=router; \ No newline at end of file +var _0x524a=['show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','format','basename','now','extname','post','single','file','/webhook','webhookPost','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./plugin.controller','get','isAuthenticated','webhookGet'];(function(_0x5c3b63,_0x85ed6f){var _0x3983c0=function(_0x54548b){while(--_0x54548b){_0x5c3b63['push'](_0x5c3b63['shift']());}};_0x3983c0(++_0x85ed6f);}(_0x524a,0xf5));var _0xa524=function(_0x540a23,_0x51b018){_0x540a23=_0x540a23-0x0;var _0x10547e=_0x524a[_0x540a23];return _0x10547e;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var fs_extra=require(_0xa524('0x5'));var auth=require(_0xa524('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa524('0x7'));router[_0xa524('0x8')]('/',auth[_0xa524('0x9')](),controller['index']);router[_0xa524('0x8')]('/webhook',controller[_0xa524('0xa')]);router[_0xa524('0x8')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0xb')]);router[_0xa524('0x8')](_0xa524('0xc'),auth[_0xa524('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xa524('0xd')]({'destination':function(_0x2ebea2,_0x59660a,_0x565fab){_0x565fab(null,path[_0xa524('0xe')](config[_0xa524('0xf')],_0xa524('0x10')));},'filename':function(_0x4936fa,_0x55117f,_0x14a0d6){_0x55117f['originalname']=_0x55117f[_0xa524('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x14a0d6(null,util[_0xa524('0x12')]('%s-%s%s',path[_0xa524('0x13')](_0x55117f[_0xa524('0x11')],path['extname'](_0x55117f[_0xa524('0x11')])),Date[_0xa524('0x14')](),path[_0xa524('0x15')](_0x55117f[_0xa524('0x11')])));}})});router[_0xa524('0x16')]('/',upload[_0xa524('0x17')](_0xa524('0x18')),controller['upload']);router[_0xa524('0x16')](_0xa524('0x19'),controller[_0xa524('0x1a')]);router[_0xa524('0x1b')](_0xa524('0x1c'),auth[_0xa524('0x9')](),controller[_0xa524('0x1d')]);router[_0xa524('0x1e')]('/:id',auth[_0xa524('0x9')](),controller[_0xa524('0x1e')]);module[_0xa524('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e341e82..b5c9aca 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 _0x8429=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html'];(function(_0x17a0b8,_0x42e60b){var _0x417ba8=function(_0x5c7ec8){while(--_0x5c7ec8){_0x17a0b8['push'](_0x17a0b8['shift']());}};_0x417ba8(++_0x42e60b);}(_0x8429,0x1eb));var _0x9842=function(_0x2483c5,_0x4cd412){_0x2483c5=_0x2483c5-0x0;var _0x24141a=_0x8429[_0x2483c5];return _0x24141a;};'use strict';var Sequelize=require(_0x9842('0x0'));module[_0x9842('0x1')]={'name':{'type':Sequelize[_0x9842('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9842('0x3'),_0x9842('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9842('0x5')]},'path':{'type':Sequelize[_0x9842('0x2')],'comment':_0x9842('0x6')},'active':{'type':Sequelize[_0x9842('0x7')],'defaultValue':0x0,'comment':_0x9842('0x8')},'sidebar':{'type':Sequelize[_0x9842('0x9')](_0x9842('0xa'),_0x9842('0xb'),'always',_0x9842('0xc')),'defaultValue':_0x9842('0xd'),'comment':_0x9842('0xe')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x9842('0x2')]},'agentUrl':{'type':Sequelize[_0x9842('0x2')]},'scriptName':{'type':Sequelize[_0x9842('0x2')]},'scriptPath':{'type':Sequelize[_0x9842('0x2')]}}; \ No newline at end of file +var _0xa277=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always'];(function(_0x2800d9,_0x5ad932){var _0x298a61=function(_0x19fcd5){while(--_0x19fcd5){_0x2800d9['push'](_0x2800d9['shift']());}};_0x298a61(++_0x5ad932);}(_0xa277,0x105));var _0x7a27=function(_0xdd4b1,_0x1a89a8){_0xdd4b1=_0xdd4b1-0x0;var _0x218a9a=_0xa277[_0xdd4b1];return _0x218a9a;};'use strict';var Sequelize=require(_0x7a27('0x0'));module[_0x7a27('0x1')]={'name':{'type':Sequelize[_0x7a27('0x2')]},'type':{'type':Sequelize['ENUM'](_0x7a27('0x3'),'script')},'description':{'type':Sequelize[_0x7a27('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x7a27('0x2')],'comment':_0x7a27('0x5')},'active':{'type':Sequelize[_0x7a27('0x6')],'defaultValue':0x0,'comment':_0x7a27('0x7')},'sidebar':{'type':Sequelize[_0x7a27('0x8')](_0x7a27('0x9'),_0x7a27('0xa'),_0x7a27('0xb'),'never'),'defaultValue':_0x7a27('0xb'),'comment':_0x7a27('0xc')},'icon':{'type':Sequelize[_0x7a27('0x2')]},'adminUrl':{'type':Sequelize[_0x7a27('0x2')]},'agentUrl':{'type':Sequelize[_0x7a27('0x2')]},'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 42cf15c..18531ef 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 _0x08ca=['Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','set','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','get','Plugins','UserProfileResource','error','stack','name','send','Plugin','fieldName','type','key','map','query','keys','intersection','attributes','fields','model','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','Plugin\x20manifest\x20missing','readFileSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified'];(function(_0x51e6c0,_0x21d972){var _0x164a29=function(_0x5f223d){while(--_0x5f223d){_0x51e6c0['push'](_0x51e6c0['shift']());}};_0x164a29(++_0x21d972);}(_0x08ca,0xcc));var _0xa08c=function(_0x1b6484,_0x16b640){_0x1b6484=_0x1b6484-0x0;var _0x52e789=_0x08ca[_0x1b6484];return _0x52e789;};'use strict';var emlformat=require(_0xa08c('0x0'));var rimraf=require(_0xa08c('0x1'));var zipdir=require(_0xa08c('0x2'));var jsonpatch=require(_0xa08c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa08c('0x4'));var Mustache=require(_0xa08c('0x5'));var util=require(_0xa08c('0x6'));var path=require('path');var sox=require(_0xa08c('0x7'));var csv=require(_0xa08c('0x8'));var ejs=require(_0xa08c('0x9'));var fs=require('fs');var fs_extra=require(_0xa08c('0xa'));var _=require(_0xa08c('0xb'));var squel=require(_0xa08c('0xc'));var crypto=require(_0xa08c('0xd'));var jsforce=require(_0xa08c('0xe'));var deskjs=require(_0xa08c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa08c('0x10'));var Papa=require(_0xa08c('0x11'));var extract=require(_0xa08c('0x12'));var rimraf=require(_0xa08c('0x1'));var archiver=require(_0xa08c('0x13'));var Redis=require(_0xa08c('0x14'));var authService=require(_0xa08c('0x15'));var qs=require(_0xa08c('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa08c('0x17'));var logger=require(_0xa08c('0x18'))(_0xa08c('0x19'));var utils=require('../../config/utils');var config=require(_0xa08c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xa08c('0x1b'))['db'];config[_0xa08c('0x1c')]=_['defaults'](config[_0xa08c('0x1c')],{'host':_0xa08c('0x1d'),'port':0x18eb});var socket=require(_0xa08c('0x1e'))(new Redis(config[_0xa08c('0x1c')]));require(_0xa08c('0x1f'))[_0xa08c('0x20')](socket);function respondWithStatusCode(_0x298899,_0x1c8881){_0x1c8881=_0x1c8881||0xcc;return function(_0x54a675){if(_0x54a675){return _0x298899[_0xa08c('0x21')](_0x1c8881);}return _0x298899[_0xa08c('0x22')](_0x1c8881)[_0xa08c('0x23')]();};}function respondWithResult(_0x370bff,_0x4b8dca){_0x4b8dca=_0x4b8dca||0xc8;return function(_0x1bc165){if(_0x1bc165){return _0x370bff[_0xa08c('0x22')](_0x4b8dca)[_0xa08c('0x24')](_0x1bc165);}};}function respondWithFilteredResult(_0x54eef3,_0x259c96){return function(_0x165055){if(_0x165055){var _0x3def52=typeof _0x259c96[_0xa08c('0x25')]===_0xa08c('0x26')&&typeof _0x259c96[_0xa08c('0x27')]===_0xa08c('0x26');var _0x3de322=_0x165055['count'];var _0x301c66=_0x3def52?0x0:_0x259c96[_0xa08c('0x25')];var _0x1cc5e5=_0x3def52?_0x165055[_0xa08c('0x28')]:_0x259c96['offset']+_0x259c96[_0xa08c('0x27')];var _0x3cc292;if(_0x1cc5e5>=_0x3de322){_0x1cc5e5=_0x3de322;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x54eef3['status'](_0x3cc292);return _0x54eef3['set'](_0xa08c('0x29'),_0x301c66+'-'+_0x1cc5e5+'/'+_0x3de322)[_0xa08c('0x24')](_0x165055);}return null;};}function patchUpdates(_0x2c7330){return function(_0x5b3711){try{jsonpatch['apply'](_0x5b3711,_0x2c7330,!![]);}catch(_0x2e157c){return BPromise['reject'](_0x2e157c);}return _0x5b3711[_0xa08c('0x2a')]();};}function saveUpdates(_0x40b1e8,_0x496fae){return function(_0x4412dd){if(_0x4412dd){return _0x4412dd[_0xa08c('0x2b')](_0x40b1e8)[_0xa08c('0x2c')](function(_0x90e39){return _0x90e39;});}return null;};}function removeEntity(_0x205cab,_0x62ae1e){return function(_0x213e8c){if(_0x213e8c){return _0x213e8c['destroy']()['then'](function(){var _0xcda122=_0x213e8c[_0xa08c('0x2d')]({'plain':!![]});var _0x7f5872=_0xa08c('0x2e');return db[_0xa08c('0x2f')]['destroy']({'where':{'type':_0x7f5872,'resourceId':_0xcda122['id']}})['then'](function(){return _0x213e8c;});})[_0xa08c('0x2c')](function(){_0x205cab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f2819,_0x199756){return function(_0x2d8454){if(!_0x2d8454){_0x2f2819[_0xa08c('0x21')](0x194);}return _0x2d8454;};}function handleError(_0x123ea5,_0x3d00a){_0x3d00a=_0x3d00a||0x1f4;return function(_0x48d57f){logger[_0xa08c('0x30')](_0x48d57f[_0xa08c('0x31')]);if(_0x48d57f[_0xa08c('0x32')]){delete _0x48d57f[_0xa08c('0x32')];}_0x123ea5[_0xa08c('0x22')](_0x3d00a)[_0xa08c('0x33')](_0x48d57f);};}exports['index']=function(_0x23e5eb,_0x277473){var _0xbdafa3={},_0x950c89={},_0x495dd6={'count':0x0,'rows':[]};var _0x532458=_['map'](db[_0xa08c('0x34')]['rawAttributes'],function(_0x5f2940){return{'name':_0x5f2940[_0xa08c('0x35')],'type':_0x5f2940[_0xa08c('0x36')][_0xa08c('0x37')]};});_0x950c89['model']=_[_0xa08c('0x38')](_0x532458,_0xa08c('0x32'));_0x950c89[_0xa08c('0x39')]=_[_0xa08c('0x3a')](_0x23e5eb[_0xa08c('0x39')]);_0x950c89['filters']=_[_0xa08c('0x3b')](_0x950c89['model'],_0x950c89[_0xa08c('0x39')]);_0xbdafa3[_0xa08c('0x3c')]=_['intersection'](_0x950c89['model'],qs[_0xa08c('0x3d')](_0x23e5eb['query'][_0xa08c('0x3d')]));_0xbdafa3[_0xa08c('0x3c')]=_0xbdafa3['attributes']['length']?_0xbdafa3['attributes']:_0x950c89[_0xa08c('0x3e')];if(!_0x23e5eb[_0xa08c('0x39')]['hasOwnProperty']('nolimit')){_0xbdafa3['limit']=qs['limit'](_0x23e5eb[_0xa08c('0x39')][_0xa08c('0x27')]);_0xbdafa3['offset']=qs['offset'](_0x23e5eb[_0xa08c('0x39')][_0xa08c('0x25')]);}_0xbdafa3[_0xa08c('0x3f')]=qs['sort'](_0x23e5eb['query'][_0xa08c('0x40')]);_0xbdafa3['where']=qs[_0xa08c('0x41')](_[_0xa08c('0x42')](_0x23e5eb[_0xa08c('0x39')],_0x950c89[_0xa08c('0x41')]),_0x532458);if(_0x23e5eb[_0xa08c('0x39')][_0xa08c('0x43')]){_0xbdafa3[_0xa08c('0x44')]=_[_0xa08c('0x45')](_0xbdafa3['where'],{'$or':_[_0xa08c('0x38')](_0x532458,function(_0x3de5ec){if(_0x3de5ec['type']!==_0xa08c('0x46')){var _0x5ca853={};_0x5ca853[_0x3de5ec[_0xa08c('0x32')]]={'$like':'%'+_0x23e5eb['query'][_0xa08c('0x43')]+'%'};return _0x5ca853;}})});}_0xbdafa3=_[_0xa08c('0x45')]({},_0xbdafa3,_0x23e5eb[_0xa08c('0x47')]);var _0x184c64={'where':_0xbdafa3['where']};return db[_0xa08c('0x34')][_0xa08c('0x28')](_0x184c64)[_0xa08c('0x2c')](function(_0x2fff4f){_0x495dd6['count']=_0x2fff4f;if(_0x23e5eb[_0xa08c('0x39')][_0xa08c('0x48')]){_0xbdafa3[_0xa08c('0x49')]=[{'all':!![]}];}return db[_0xa08c('0x34')][_0xa08c('0x4a')](_0xbdafa3);})['then'](function(_0xa2ade6){_0x495dd6['rows']=_0xa2ade6;return _0x495dd6;})[_0xa08c('0x2c')](respondWithFilteredResult(_0x277473,_0xbdafa3))[_0xa08c('0x4b')](handleError(_0x277473,null));};exports[_0xa08c('0x4c')]=function(_0x5a8f61,_0x4162a3){var _0x25fad9={'raw':!![],'where':{'id':_0x5a8f61[_0xa08c('0x4d')]['id']}},_0x293f26={};_0x293f26[_0xa08c('0x3e')]=_[_0xa08c('0x3a')](db['Plugin']['rawAttributes']);_0x293f26[_0xa08c('0x39')]=_['keys'](_0x5a8f61[_0xa08c('0x39')]);_0x293f26[_0xa08c('0x41')]=_['intersection'](_0x293f26[_0xa08c('0x3e')],_0x293f26[_0xa08c('0x39')]);_0x25fad9[_0xa08c('0x3c')]=_[_0xa08c('0x3b')](_0x293f26[_0xa08c('0x3e')],qs['fields'](_0x5a8f61[_0xa08c('0x39')][_0xa08c('0x3d')]));_0x25fad9['attributes']=_0x25fad9[_0xa08c('0x3c')][_0xa08c('0x4e')]?_0x25fad9[_0xa08c('0x3c')]:_0x293f26['model'];if(_0x5a8f61['query']['includeAll']){_0x25fad9[_0xa08c('0x49')]=[{'all':!![]}];}_0x25fad9=_[_0xa08c('0x45')]({},_0x25fad9,_0x5a8f61[_0xa08c('0x47')]);return db[_0xa08c('0x34')][_0xa08c('0x4f')](_0x25fad9)[_0xa08c('0x2c')](handleEntityNotFound(_0x4162a3,null))['then'](respondWithResult(_0x4162a3,null))[_0xa08c('0x4b')](handleError(_0x4162a3,null));};exports[_0xa08c('0x50')]=function(_0x1262a2,_0x313415,_0x217910){return db['Plugin']['find']({'where':{'id':_0x1262a2[_0xa08c('0x4d')]['id']},'attributes':[_0xa08c('0x32'),_0xa08c('0x51')],'raw':!![]})[_0xa08c('0x2c')](handleEntityNotFound(_0x313415,null))['then'](function(_0x3f6482){if(_0x3f6482){var _0x286404=path[_0xa08c('0x52')](config[_0xa08c('0x53')],_0xa08c('0x54'),util[_0xa08c('0x55')](_0xa08c('0x56'),path[_0xa08c('0x57')](_0x3f6482[_0xa08c('0x51')])));var _0x3deea4=fs[_0xa08c('0x58')](_0x286404);var _0x53a428=archiver(_0xa08c('0x59'),{'zlib':{'level':0x9}});_0x53a428['on'](_0xa08c('0x5a'),function(_0x75d7c8){if(_0x75d7c8[_0xa08c('0x5b')]===_0xa08c('0x5c')){logger[_0xa08c('0x30')](_0x75d7c8);}else{throw new db[(_0xa08c('0x5d'))][(_0xa08c('0x5e'))](_0xa08c('0x5f'));}});_0x53a428['on']('error',function(_0x5e2868){throw new db[(_0xa08c('0x5d'))][(_0xa08c('0x5e'))](_0xa08c('0x5f'));});_0x53a428[_0xa08c('0x60')](_0x3deea4);_0x53a428[_0xa08c('0x61')](_0xa08c('0x62'),{'cwd':path['join'](config[_0xa08c('0x53')],_0xa08c('0x54'),path['dirname'](_0x3f6482[_0xa08c('0x51')])),'ignore':[path[_0xa08c('0x52')](path[_0xa08c('0x57')](_0x3f6482[_0xa08c('0x51')]),_0xa08c('0x63')),path['join'](path[_0xa08c('0x57')](_0x3f6482['path']),_0xa08c('0x64'))],'nodir':!![]})['finalize']();_0x3deea4['on']('close',function(){if(!fs[_0xa08c('0x65')](_0x286404)){throw new db['Sequelize'][(_0xa08c('0x5e'))](_0xa08c('0x66'));}return _0x313415[_0xa08c('0x50')](_0x286404,util[_0xa08c('0x55')](_0xa08c('0x56'),path[_0xa08c('0x57')](_0x3f6482[_0xa08c('0x51')])),function(_0x4f68c4){if(_0x4f68c4){throw new db[(_0xa08c('0x5d'))][(_0xa08c('0x5e'))](_0xa08c('0x67'));}fs[_0xa08c('0x68')](_0x286404);logger[_0xa08c('0x69')](_0xa08c('0x6a'));logger[_0xa08c('0x69')](_0xa08c('0x6b'));});});}return null;})[_0xa08c('0x4b')](handleError(_0x313415,null));};exports[_0xa08c('0x6c')]=function(_0x576261,_0x4eaed7,_0x17f28d){var _0x2af3ab=path[_0xa08c('0x57')](_0x576261[_0xa08c('0x6d')][_0xa08c('0x6e')],path['extname'](_0x576261['file'][_0xa08c('0x6e')]));var _0x129bda=path[_0xa08c('0x52')](config['root'],_0xa08c('0x54'),_0x576261[_0xa08c('0x6d')][_0xa08c('0x6e')]);var _0xc09a36=path['join'](config['root'],'server/files/plugins',_0x2af3ab);logger['info'](_0xa08c('0x6f'),_0x129bda);logger[_0xa08c('0x69')](_0xa08c('0x70'),_0xc09a36);try{fs[_0xa08c('0x71')](_0x129bda,parseInt(_0xa08c('0x72'),0x8));extract(_0x129bda,{'dir':_0xc09a36},function(_0x1d8866){if(_0x1d8866){logger[_0xa08c('0x30')](_0x1d8866);handleError(_0x1d8866,!![]);};var _0x5cf2b4=fs[_0xa08c('0x73')](_0xc09a36);if(_0x5cf2b4[_0xa08c('0x4e')]>0x1){removeReferences(_0x129bda,_0xc09a36);logger[_0xa08c('0x30')]('Invalid\x20plugin\x20structure');return _0x17f28d(new Error(_0xa08c('0x74')));}var _0x319c36=fs[_0xa08c('0x75')](path['join'](_0xc09a36,_0x5cf2b4[0x0]));if(_0x319c36[_0xa08c('0x76')]()){removeReferences(_0x129bda,_0xc09a36);logger[_0xa08c('0x30')](_0xa08c('0x74'));return _0x17f28d(new Error(_0xa08c('0x74')));}if(_0x319c36['isDirectory']()){var _0x3879e0=fs[_0xa08c('0x73')](path[_0xa08c('0x52')](_0xc09a36,_0x5cf2b4[0x0]));if(_0x3879e0['length']===0x0){removeReferences(_0x129bda,_0xc09a36);logger[_0xa08c('0x30')](_0xa08c('0x74'));return _0x17f28d(new Error(_0xa08c('0x74')));}var _0x442d2c=_0x3879e0['some'](function(_0xf276ed){return _0xf276ed==='manifest.json';});if(!_0x442d2c){return _0x17f28d(new Error(_0xa08c('0x77')));}var _0x3814d8=fs[_0xa08c('0x78')](path[_0xa08c('0x52')](_0xc09a36,_0x5cf2b4[0x0],_0xa08c('0x79')));var _0x4361b7=JSON['parse'](_0x3814d8);if('undefined'==typeof _0x4361b7[_0xa08c('0x32')]){return _0x17f28d(new Error(_0xa08c('0x7a')));}if(_0xa08c('0x26')==typeof _0x4361b7['type']){return _0x17f28d(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xa08c('0x26')==typeof _0x4361b7[_0xa08c('0x7b')]){return _0x17f28d(new Error(_0xa08c('0x7c')));}if(_0xa08c('0x26')==typeof _0x4361b7[_0xa08c('0x7d')]){return _0x17f28d(new Error(_0xa08c('0x7e')));}if(_0x4361b7[_0xa08c('0x36')]==='html'){if(_0xa08c('0x26')==typeof _0x4361b7['parameters'][_0xa08c('0x7f')]){return _0x17f28d(new Error(_0xa08c('0x80')));}if(_0xa08c('0x26')==typeof _0x4361b7[_0xa08c('0x7d')]['views'][_0xa08c('0x81')]&&_0xa08c('0x26')==typeof _0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')][_0xa08c('0x82')]){return _0x17f28d(new Error(_0xa08c('0x83')));}}else if(_0x4361b7[_0xa08c('0x36')]===_0xa08c('0x84')){if(_0xa08c('0x26')==typeof _0x4361b7[_0xa08c('0x7d')][_0xa08c('0x85')]){return _0x17f28d(new Error(_0xa08c('0x86')));}if('undefined'==typeof _0x4361b7['parameters'][_0xa08c('0x87')]){return _0x17f28d(new Error(_0xa08c('0x88')));}}else{return _0x17f28d(new Error(_0xa08c('0x89')));}var _0x4df946=_0x4361b7[_0xa08c('0x32')];var _0x10a831=_0x4361b7[_0xa08c('0x8a')];var _0xb5c813=_0x4361b7[_0xa08c('0x36')];var _0x1d7dfb=_0x4361b7[_0xa08c('0x8b')]?_0x4361b7[_0xa08c('0x8b')]:'always';var _0x138fb1=_0x4361b7[_0xa08c('0x8c')]?_0x4361b7['icon']:_0xa08c('0x8d');var _0x3d1a83='';var _0x4434e2='';var _0x3965b8='';var _0x4bf3d5='';var _0x1be669=_0x4361b7['version'];if(_0xb5c813===_0xa08c('0x8e')){if(_0xa08c('0x26')!=typeof _0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')][_0xa08c('0x81')]){var _0x3181a3=_0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xa08c('0x8f')](_0x3181a3)){_0x3d1a83=path['join'](_0xa08c('0x90'),_0x2af3ab,_0x5cf2b4[0x0],_0x3181a3);}else{_0x3d1a83=_0x3181a3;}}else{logger[_0xa08c('0x69')](_0xa08c('0x91'));}if(_0xa08c('0x26')!=typeof _0x4361b7[_0xa08c('0x7d')]['views'][_0xa08c('0x82')]){var _0x2f87fc=_0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')][_0xa08c('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2f87fc)){_0x4434e2=path[_0xa08c('0x52')]('plugins',_0x2af3ab,_0x5cf2b4[0x0],_0x2f87fc);}else{_0x4434e2=_0x2f87fc;}}else{logger['info'](_0xa08c('0x92'));}}else if(_0xb5c813===_0xa08c('0x84')){_0x3965b8=_0x4361b7[_0xa08c('0x7d')][_0xa08c('0x85')];_0x4bf3d5=_0x4361b7[_0xa08c('0x7d')][_0xa08c('0x87')];if(_0xa08c('0x26')!=typeof _0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')]){if(_0xa08c('0x26')!=typeof _0x4361b7['parameters'][_0xa08c('0x7f')]['admin']){var _0x3181a3=_0x4361b7['parameters'][_0xa08c('0x7f')][_0xa08c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xa08c('0x8f')](_0x3181a3)){_0x3d1a83=path[_0xa08c('0x52')](_0xa08c('0x90'),_0x2af3ab,_0x5cf2b4[0x0],_0x3181a3);}else{_0x3d1a83=_0x3181a3;}}if('undefined'!=typeof _0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')][_0xa08c('0x82')]){var _0x2f87fc=_0x4361b7[_0xa08c('0x7d')][_0xa08c('0x7f')][_0xa08c('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xa08c('0x8f')](_0x2f87fc)){_0x4434e2=path[_0xa08c('0x52')]('plugins',_0x2af3ab,_0x5cf2b4[0x0],_0x2f87fc);}else{_0x4434e2=_0x2f87fc;}}}}var _0x1e60ba={'name':_0x4df946,'description':_0x10a831,'path':path[_0xa08c('0x52')](_0x2af3ab,_0x5cf2b4[0x0]),'type':_0xb5c813,'sidebar':_0x1d7dfb,'icon':_0x138fb1,'adminUrl':_0x3d1a83,'agentUrl':_0x4434e2,'scriptName':_0x3965b8,'scriptPath':_0x4bf3d5,'version':_0x1be669};removeReferences(_0x129bda,null);return db[_0xa08c('0x34')]['create'](_0x1e60ba)['then'](function(_0x2ff639){var _0x5db0da={'role':_0x576261[_0xa08c('0x93')][_0xa08c('0x94')],'userProfileId':_0x576261[_0xa08c('0x93')][_0xa08c('0x95')]};if(!_0x5db0da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5db0da[_0xa08c('0x94')]===_0xa08c('0x96')){var _0x2f98c4=_0x2ff639[_0xa08c('0x2d')]({'plain':!![]});return db[_0xa08c('0x97')][_0xa08c('0x4f')]({'where':{'name':_0xa08c('0x2e'),'userProfileId':_0x5db0da['userProfileId']},'raw':!![]})[_0xa08c('0x2c')](function(_0x52e8ff){if(_0x52e8ff&&_0x52e8ff[_0xa08c('0x98')]===0x0){return db['UserProfileResource'][_0xa08c('0x99')]({'name':_0x2f98c4[_0xa08c('0x32')],'resourceId':_0x2f98c4['id'],'type':_0x52e8ff[_0xa08c('0x32')],'sectionId':_0x52e8ff['id']},{})[_0xa08c('0x2c')](function(){return _0x2ff639;});}else{return _0x2ff639;}})[_0xa08c('0x4b')](function(_0x2b7e06){logger[_0xa08c('0x30')](_0xa08c('0x9a'),_0x2b7e06);throw _0x2b7e06;});}return _0x2ff639;})[_0xa08c('0x2c')](respondWithResult(_0x4eaed7,null))[_0xa08c('0x4b')](handleError(_0x4eaed7,null));}});}catch(_0x54926b){_0x4eaed7[_0xa08c('0x22')](0x1f4)[_0xa08c('0x33')](_0x54926b);}};function removeReferences(_0x1b6203,_0x4f0f70){try{if(_0x1b6203){fs[_0xa08c('0x68')](_0x1b6203);logger[_0xa08c('0x69')](_0xa08c('0x9b'));}if(_0x4f0f70){rimraf(_0x4f0f70,function(){});logger[_0xa08c('0x69')]('Extracted\x20folder\x20removed');}}catch(_0x33378b){logger[_0xa08c('0x30')](_0x33378b);}}exports[_0xa08c('0x2b')]=function(_0x54fe80,_0x51c3df,_0x5b2045){return db[_0xa08c('0x34')][_0xa08c('0x4f')]({'where':{'id':_0x54fe80[_0xa08c('0x4d')]['id']}})[_0xa08c('0x2c')](handleEntityNotFound(_0x51c3df,null))[_0xa08c('0x2c')](saveUpdates(_0x54fe80[_0xa08c('0x93')],null))[_0xa08c('0x2c')](respondWithResult(_0x51c3df,null))[_0xa08c('0x4b')](handleError(_0x51c3df,null));};exports[_0xa08c('0x9c')]=function(_0x311617,_0x3503e8,_0x4d3aa7){return db[_0xa08c('0x34')][_0xa08c('0x4f')]({'where':{'id':_0x311617['params']['id']}})[_0xa08c('0x2c')](function(_0x2028c1){if(_0x2028c1){return _0x2028c1['destroy']();}})['then'](function(_0x51079c){rimraf(path['join'](config[_0xa08c('0x53')],'server/files/plugins',path[_0xa08c('0x9d')](_0x51079c['path'])),function(){});return _0x51079c;})[_0xa08c('0x2c')](handleEntityNotFound(_0x3503e8,null))['then'](respondWithStatusCode(_0x3503e8,null))[_0xa08c('0x4b')](handleError(_0x3503e8,null));};exports[_0xa08c('0x9e')]=function(_0x56757e,_0x4563b0,_0x3bf328){return BPromise['resolve']()[_0xa08c('0x2c')](function(){if(!_0x56757e['query']['path']){throw new Error(_0xa08c('0x9f'));}if(!_0x56757e[_0xa08c('0x39')][_0xa08c('0xa0')]){throw new Error(_0xa08c('0xa1'));}var _0x2f488d=_0x56757e[_0xa08c('0x39')][_0xa08c('0xa2')]?_0x56757e[_0xa08c('0x39')][_0xa08c('0xa2')]+':'+_0x56757e[_0xa08c('0x39')][_0xa08c('0xa0')]:_0xa08c('0xa3')+_0x56757e['query'][_0xa08c('0xa0')];var _0x4aa2cc=_0x56757e[_0xa08c('0x39')]['json']?_0x56757e[_0xa08c('0x39')][_0xa08c('0x24')]:!![];var _0x45535d=_0x56757e[_0xa08c('0x39')][_0xa08c('0xa4')]?_0x56757e[_0xa08c('0x39')][_0xa08c('0xa4')]:null;var _0x4baab7={'method':_0x56757e[_0xa08c('0xa5')],'uri':util[_0xa08c('0x55')](_0xa08c('0xa6'),_0x2f488d,_0x56757e[_0xa08c('0x39')]['path']),'json':_0x4aa2cc,'resolveWithFullResponse':!![],'encoding':_0x45535d,'qs':_0x56757e[_0xa08c('0x39')]};if(_0x56757e[_0xa08c('0xa7')]){_0x4baab7['headers']=_0x56757e[_0xa08c('0xa7')];if(_0x4baab7[_0xa08c('0xa7')]['content-length']){delete _0x4baab7[_0xa08c('0xa7')][_0xa08c('0xa8')];}}if(_0x4baab7['headers']['content-type']){delete _0x4baab7[_0xa08c('0xa7')][_0xa08c('0xa9')];}return rp(_0x4baab7);})[_0xa08c('0x2c')](function(_0x1cc589){if(_0x1cc589){_0x4563b0['set'](_0x1cc589['headers']);logger[_0xa08c('0x69')](_0x1cc589[_0xa08c('0x93')]);if(_[_0xa08c('0xaa')](_0x56757e[_0xa08c('0x39')][_0xa08c('0x51')],_0xa08c('0x50'))&&_0x1cc589[_0xa08c('0xab')]==0x1f4){return _0x4563b0[_0xa08c('0x21')](_0x1cc589[_0xa08c('0xab')]);}else{return _0x4563b0[_0xa08c('0x22')](_0x1cc589[_0xa08c('0xab')])['send'](_0x1cc589[_0xa08c('0x93')]);}}else{return _0x4563b0['sendStatus'](0xc8);}})['catch'](handleError(_0x4563b0,null));};exports[_0xa08c('0xac')]=function(_0x5dffe0,_0x51819a,_0x180917){return BPromise[_0xa08c('0xad')]()[_0xa08c('0x2c')](function(){if(!_0x5dffe0[_0xa08c('0x39')][_0xa08c('0x51')]){throw new Error(_0xa08c('0x9f'));}if(!_0x5dffe0['query'][_0xa08c('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x675a19=_0x5dffe0[_0xa08c('0x39')][_0xa08c('0xa2')]?_0x5dffe0[_0xa08c('0x39')][_0xa08c('0xa2')]+':'+_0x5dffe0[_0xa08c('0x39')][_0xa08c('0xa0')]:'http://localhost:'+_0x5dffe0[_0xa08c('0x39')]['port'];var _0x49dd68=_0x5dffe0[_0xa08c('0x39')][_0xa08c('0x24')]?_0x5dffe0[_0xa08c('0x39')][_0xa08c('0x24')]:!![];var _0x5a8776=_0x5dffe0[_0xa08c('0x39')]['encoding']?_0x5dffe0[_0xa08c('0x39')][_0xa08c('0xa4')]:null;var _0x4d5e8f={'method':_0x5dffe0['method'],'uri':util['format'](_0xa08c('0xa6'),_0x675a19,_0x5dffe0['query']['path']),'json':_0x49dd68,'resolveWithFullResponse':!![],'encoding':_0x5a8776,'body':_0x5dffe0[_0xa08c('0x93')]};if(_0x5dffe0['headers']){_0x4d5e8f[_0xa08c('0xa7')]=_0x5dffe0[_0xa08c('0xa7')];if(_0x4d5e8f[_0xa08c('0xa7')]['content-length']){delete _0x4d5e8f[_0xa08c('0xa7')][_0xa08c('0xa8')];}}if(_0x4d5e8f[_0xa08c('0xa7')][_0xa08c('0xa9')]){delete _0x4d5e8f[_0xa08c('0xa7')][_0xa08c('0xa9')];}return rp(_0x4d5e8f);})[_0xa08c('0x2c')](function(_0x2336f3){if(_0x2336f3){_0x51819a[_0xa08c('0xae')](_0x2336f3['headers']);logger['info'](_0x2336f3[_0xa08c('0x93')]);return _0x51819a[_0xa08c('0x22')](_0x2336f3[_0xa08c('0xab')])[_0xa08c('0x33')](_0x2336f3[_0xa08c('0x93')]);}else{return _0x51819a[_0xa08c('0x21')](0xc8);}})[_0xa08c('0x4b')](handleError(_0x51819a,null));}; \ No newline at end of file +var _0x6070=['role','UserProfileSection','userProfileId','UserProfileResource','Zip\x20archive\x20removed','delete','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','catch','show','params','model','find','download','join','root','server/files/plugins','format','%s.zip','path','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','close','existsSync','basename','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','scriptName','create','body'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x6070,0xbf));var _0x0607=function(_0x489ba1,_0x1f6526){_0x489ba1=_0x489ba1-0x0;var _0x2fef6b=_0x6070[_0x489ba1];return _0x2fef6b;};'use strict';var emlformat=require(_0x0607('0x0'));var rimraf=require(_0x0607('0x1'));var zipdir=require(_0x0607('0x2'));var jsonpatch=require(_0x0607('0x3'));var rp=require('request-promise');var moment=require(_0x0607('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0607('0x5'));var util=require(_0x0607('0x6'));var path=require('path');var sox=require(_0x0607('0x7'));var csv=require(_0x0607('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0607('0x9'));var squel=require(_0x0607('0xa'));var crypto=require(_0x0607('0xb'));var jsforce=require(_0x0607('0xc'));var deskjs=require(_0x0607('0xd'));var toCsv=require(_0x0607('0x8'));var querystring=require('querystring');var Papa=require(_0x0607('0xe'));var extract=require(_0x0607('0xf'));var rimraf=require(_0x0607('0x1'));var archiver=require(_0x0607('0x10'));var Redis=require(_0x0607('0x11'));var authService=require(_0x0607('0x12'));var qs=require(_0x0607('0x13'));var as=require(_0x0607('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0607('0x15'))('api');var utils=require(_0x0607('0x16'));var config=require(_0x0607('0x17'));var licenseUtil=require(_0x0607('0x18'));var db=require(_0x0607('0x19'))['db'];config[_0x0607('0x1a')]=_['defaults'](config[_0x0607('0x1a')],{'host':_0x0607('0x1b'),'port':0x18eb});var socket=require(_0x0607('0x1c'))(new Redis(config[_0x0607('0x1a')]));require(_0x0607('0x1d'))['register'](socket);function respondWithStatusCode(_0x31481f,_0x1005d1){_0x1005d1=_0x1005d1||0xcc;return function(_0x318b5f){if(_0x318b5f){return _0x31481f[_0x0607('0x1e')](_0x1005d1);}return _0x31481f[_0x0607('0x1f')](_0x1005d1)[_0x0607('0x20')]();};}function respondWithResult(_0x3026d5,_0xf32027){_0xf32027=_0xf32027||0xc8;return function(_0xe3567f){if(_0xe3567f){return _0x3026d5['status'](_0xf32027)['json'](_0xe3567f);}};}function respondWithFilteredResult(_0x161138,_0x3f33e6){return function(_0x2f02d2){if(_0x2f02d2){var _0x14aa6a=typeof _0x3f33e6[_0x0607('0x21')]===_0x0607('0x22')&&typeof _0x3f33e6[_0x0607('0x23')]===_0x0607('0x22');var _0x4355e2=_0x2f02d2[_0x0607('0x24')];var _0x5d57ad=_0x14aa6a?0x0:_0x3f33e6[_0x0607('0x21')];var _0x10bd1c=_0x14aa6a?_0x2f02d2[_0x0607('0x24')]:_0x3f33e6[_0x0607('0x21')]+_0x3f33e6[_0x0607('0x23')];var _0x2fc1a7;if(_0x10bd1c>=_0x4355e2){_0x10bd1c=_0x4355e2;_0x2fc1a7=0xc8;}else{_0x2fc1a7=0xce;}_0x161138[_0x0607('0x1f')](_0x2fc1a7);return _0x161138[_0x0607('0x25')](_0x0607('0x26'),_0x5d57ad+'-'+_0x10bd1c+'/'+_0x4355e2)['json'](_0x2f02d2);}return null;};}function patchUpdates(_0x4342b0){return function(_0x19dc66){try{jsonpatch[_0x0607('0x27')](_0x19dc66,_0x4342b0,!![]);}catch(_0x4f30e1){return BPromise[_0x0607('0x28')](_0x4f30e1);}return _0x19dc66[_0x0607('0x29')]();};}function saveUpdates(_0x525564,_0xb88078){return function(_0x189639){if(_0x189639){return _0x189639[_0x0607('0x2a')](_0x525564)[_0x0607('0x2b')](function(_0x781ad5){return _0x781ad5;});}return null;};}function removeEntity(_0x2cf95e,_0x21ddce){return function(_0x3a8317){if(_0x3a8317){return _0x3a8317[_0x0607('0x2c')]()[_0x0607('0x2b')](function(){var _0x23d287=_0x3a8317[_0x0607('0x2d')]({'plain':!![]});var _0xd59568=_0x0607('0x2e');return db['UserProfileResource'][_0x0607('0x2c')]({'where':{'type':_0xd59568,'resourceId':_0x23d287['id']}})[_0x0607('0x2b')](function(){return _0x3a8317;});})[_0x0607('0x2b')](function(){_0x2cf95e[_0x0607('0x1f')](0xcc)[_0x0607('0x20')]();});}};}function handleEntityNotFound(_0x2a4115,_0x359a3e){return function(_0x49b67d){if(!_0x49b67d){_0x2a4115[_0x0607('0x1e')](0x194);}return _0x49b67d;};}function handleError(_0x1d0d1e,_0x56078c){_0x56078c=_0x56078c||0x1f4;return function(_0x252e45){logger[_0x0607('0x2f')](_0x252e45[_0x0607('0x30')]);if(_0x252e45[_0x0607('0x31')]){delete _0x252e45[_0x0607('0x31')];}_0x1d0d1e[_0x0607('0x1f')](_0x56078c)[_0x0607('0x32')](_0x252e45);};}exports[_0x0607('0x33')]=function(_0x3e3d5f,_0x42a91f){var _0x10fc51={},_0x3e0ba7={},_0x4ff336={'count':0x0,'rows':[]};var _0xd064cf=_[_0x0607('0x34')](db['Plugin'][_0x0607('0x35')],function(_0x19ff0a){return{'name':_0x19ff0a[_0x0607('0x36')],'type':_0x19ff0a[_0x0607('0x37')][_0x0607('0x38')]};});_0x3e0ba7['model']=_[_0x0607('0x34')](_0xd064cf,'name');_0x3e0ba7['query']=_[_0x0607('0x39')](_0x3e3d5f[_0x0607('0x3a')]);_0x3e0ba7[_0x0607('0x3b')]=_[_0x0607('0x3c')](_0x3e0ba7['model'],_0x3e0ba7[_0x0607('0x3a')]);_0x10fc51[_0x0607('0x3d')]=_[_0x0607('0x3c')](_0x3e0ba7['model'],qs[_0x0607('0x3e')](_0x3e3d5f[_0x0607('0x3a')]['fields']));_0x10fc51['attributes']=_0x10fc51[_0x0607('0x3d')][_0x0607('0x3f')]?_0x10fc51[_0x0607('0x3d')]:_0x3e0ba7['model'];if(!_0x3e3d5f['query'][_0x0607('0x40')](_0x0607('0x41'))){_0x10fc51[_0x0607('0x23')]=qs[_0x0607('0x23')](_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x23')]);_0x10fc51[_0x0607('0x21')]=qs[_0x0607('0x21')](_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x21')]);}_0x10fc51['order']=qs[_0x0607('0x42')](_0x3e3d5f['query'][_0x0607('0x42')]);_0x10fc51[_0x0607('0x43')]=qs[_0x0607('0x3b')](_[_0x0607('0x44')](_0x3e3d5f[_0x0607('0x3a')],_0x3e0ba7['filters']),_0xd064cf);if(_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x45')]){_0x10fc51['where']=_[_0x0607('0x46')](_0x10fc51[_0x0607('0x43')],{'$or':_[_0x0607('0x34')](_0xd064cf,function(_0x1df2c2){if(_0x1df2c2[_0x0607('0x37')]!==_0x0607('0x47')){var _0x19994a={};_0x19994a[_0x1df2c2[_0x0607('0x31')]]={'$like':'%'+_0x3e3d5f['query'][_0x0607('0x45')]+'%'};return _0x19994a;}})});}_0x10fc51=_[_0x0607('0x46')]({},_0x10fc51,_0x3e3d5f[_0x0607('0x48')]);var _0x3cc549={'where':_0x10fc51[_0x0607('0x43')]};return db[_0x0607('0x49')]['count'](_0x3cc549)['then'](function(_0x393d2e){_0x4ff336[_0x0607('0x24')]=_0x393d2e;if(_0x3e3d5f[_0x0607('0x3a')][_0x0607('0x4a')]){_0x10fc51[_0x0607('0x4b')]=[{'all':!![]}];}return db[_0x0607('0x49')]['findAll'](_0x10fc51);})[_0x0607('0x2b')](function(_0x501082){_0x4ff336['rows']=_0x501082;return _0x4ff336;})['then'](respondWithFilteredResult(_0x42a91f,_0x10fc51))[_0x0607('0x4c')](handleError(_0x42a91f,null));};exports[_0x0607('0x4d')]=function(_0x2f138a,_0x2d56c9){var _0x2beb69={'raw':!![],'where':{'id':_0x2f138a[_0x0607('0x4e')]['id']}},_0x236873={};_0x236873['model']=_[_0x0607('0x39')](db[_0x0607('0x49')]['rawAttributes']);_0x236873[_0x0607('0x3a')]=_[_0x0607('0x39')](_0x2f138a[_0x0607('0x3a')]);_0x236873[_0x0607('0x3b')]=_[_0x0607('0x3c')](_0x236873[_0x0607('0x4f')],_0x236873[_0x0607('0x3a')]);_0x2beb69[_0x0607('0x3d')]=_[_0x0607('0x3c')](_0x236873['model'],qs[_0x0607('0x3e')](_0x2f138a[_0x0607('0x3a')][_0x0607('0x3e')]));_0x2beb69[_0x0607('0x3d')]=_0x2beb69[_0x0607('0x3d')][_0x0607('0x3f')]?_0x2beb69['attributes']:_0x236873[_0x0607('0x4f')];if(_0x2f138a['query'][_0x0607('0x4a')]){_0x2beb69[_0x0607('0x4b')]=[{'all':!![]}];}_0x2beb69=_['merge']({},_0x2beb69,_0x2f138a[_0x0607('0x48')]);return db[_0x0607('0x49')][_0x0607('0x50')](_0x2beb69)['then'](handleEntityNotFound(_0x2d56c9,null))[_0x0607('0x2b')](respondWithResult(_0x2d56c9,null))[_0x0607('0x4c')](handleError(_0x2d56c9,null));};exports[_0x0607('0x51')]=function(_0x2cdb4e,_0x4b9fee,_0x5b2254){return db[_0x0607('0x49')][_0x0607('0x50')]({'where':{'id':_0x2cdb4e[_0x0607('0x4e')]['id']},'attributes':['name','path'],'raw':!![]})[_0x0607('0x2b')](handleEntityNotFound(_0x4b9fee,null))[_0x0607('0x2b')](function(_0xf32953){if(_0xf32953){var _0x243a0=path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),util[_0x0607('0x55')](_0x0607('0x56'),path['basename'](_0xf32953[_0x0607('0x57')])));var _0x2085de=fs[_0x0607('0x58')](_0x243a0);var _0x457e33=archiver(_0x0607('0x59'),{'zlib':{'level':0x9}});_0x457e33['on'](_0x0607('0x5a'),function(_0x87db94){if(_0x87db94[_0x0607('0x5b')]===_0x0607('0x5c')){logger[_0x0607('0x2f')](_0x87db94);}else{throw new db[(_0x0607('0x5d'))]['Error'](_0x0607('0x5e'));}});_0x457e33['on'](_0x0607('0x2f'),function(_0x16058f){throw new db['Sequelize'][(_0x0607('0x5f'))](_0x0607('0x5e'));});_0x457e33[_0x0607('0x60')](_0x2085de);_0x457e33[_0x0607('0x61')](_0x0607('0x62'),{'cwd':path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),path[_0x0607('0x63')](_0xf32953[_0x0607('0x57')])),'ignore':[path['join'](path['basename'](_0xf32953[_0x0607('0x57')]),_0x0607('0x64')),path['join'](path['basename'](_0xf32953[_0x0607('0x57')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x2085de['on'](_0x0607('0x65'),function(){if(!fs[_0x0607('0x66')](_0x243a0)){throw new db[(_0x0607('0x5d'))][(_0x0607('0x5f'))]('Plugin\x20not\x20found');}return _0x4b9fee[_0x0607('0x51')](_0x243a0,util['format'](_0x0607('0x56'),path[_0x0607('0x67')](_0xf32953[_0x0607('0x57')])),function(_0x1a98df){if(_0x1a98df){throw new db[(_0x0607('0x5d'))][(_0x0607('0x5f'))](_0x0607('0x68'));}fs[_0x0607('0x69')](_0x243a0);logger[_0x0607('0x6a')](_0x0607('0x6b'));logger[_0x0607('0x6a')](_0x0607('0x6c'));});});}return null;})[_0x0607('0x4c')](handleError(_0x4b9fee,null));};exports['upload']=function(_0x48d782,_0x1fe4d5,_0xa1e767){var _0x2873b7=path[_0x0607('0x67')](_0x48d782[_0x0607('0x6d')][_0x0607('0x6e')],path[_0x0607('0x6f')](_0x48d782[_0x0607('0x6d')][_0x0607('0x6e')]));var _0x2f3a02=path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),_0x48d782[_0x0607('0x6d')][_0x0607('0x6e')]);var _0x5be7bd=path[_0x0607('0x52')](config[_0x0607('0x53')],_0x0607('0x54'),_0x2873b7);logger['info'](_0x0607('0x70'),_0x2f3a02);logger[_0x0607('0x6a')](_0x0607('0x71'),_0x5be7bd);try{fs['chmodSync'](_0x2f3a02,parseInt('0777',0x8));extract(_0x2f3a02,{'dir':_0x5be7bd},function(_0x210f0d){if(_0x210f0d){logger[_0x0607('0x2f')](_0x210f0d);handleError(_0x210f0d,!![]);};var _0x565110=fs[_0x0607('0x72')](_0x5be7bd);if(_0x565110[_0x0607('0x3f')]>0x1){removeReferences(_0x2f3a02,_0x5be7bd);logger[_0x0607('0x2f')](_0x0607('0x73'));return _0xa1e767(new Error(_0x0607('0x73')));}var _0x2a80be=fs[_0x0607('0x74')](path[_0x0607('0x52')](_0x5be7bd,_0x565110[0x0]));if(_0x2a80be[_0x0607('0x75')]()){removeReferences(_0x2f3a02,_0x5be7bd);logger[_0x0607('0x2f')](_0x0607('0x73'));return _0xa1e767(new Error(_0x0607('0x73')));}if(_0x2a80be[_0x0607('0x76')]()){var _0x3a9710=fs['readdirSync'](path[_0x0607('0x52')](_0x5be7bd,_0x565110[0x0]));if(_0x3a9710[_0x0607('0x3f')]===0x0){removeReferences(_0x2f3a02,_0x5be7bd);logger[_0x0607('0x2f')](_0x0607('0x73'));return _0xa1e767(new Error(_0x0607('0x73')));}var _0x35270d=_0x3a9710[_0x0607('0x77')](function(_0xd4dd02){return _0xd4dd02===_0x0607('0x78');});if(!_0x35270d){return _0xa1e767(new Error('Plugin\x20manifest\x20missing'));}var _0x4f9508=fs[_0x0607('0x79')](path[_0x0607('0x52')](_0x5be7bd,_0x565110[0x0],'manifest.json'));var _0x25899a=JSON[_0x0607('0x7a')](_0x4f9508);if('undefined'==typeof _0x25899a[_0x0607('0x31')]){return _0xa1e767(new Error(_0x0607('0x7b')));}if(_0x0607('0x22')==typeof _0x25899a[_0x0607('0x37')]){return _0xa1e767(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x0607('0x22')==typeof _0x25899a['version']){return _0xa1e767(new Error(_0x0607('0x7c')));}if('undefined'==typeof _0x25899a[_0x0607('0x7d')]){return _0xa1e767(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x25899a[_0x0607('0x37')]===_0x0607('0x7e')){if(_0x0607('0x22')==typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]){return _0xa1e767(new Error(_0x0607('0x80')));}if(_0x0607('0x22')==typeof _0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x81')]&&_0x0607('0x22')==typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')][_0x0607('0x82')]){return _0xa1e767(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x25899a[_0x0607('0x37')]===_0x0607('0x83')){if(_0x0607('0x22')==typeof _0x25899a[_0x0607('0x7d')]['scriptName']){return _0xa1e767(new Error(_0x0607('0x84')));}if('undefined'==typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x85')]){return _0xa1e767(new Error(_0x0607('0x86')));}}else{return _0xa1e767(new Error(_0x0607('0x87')));}var _0x3d1a7f=_0x25899a[_0x0607('0x31')];var _0x4dc514=_0x25899a[_0x0607('0x88')];var _0x5c086d=_0x25899a[_0x0607('0x37')];var _0xaca006=_0x25899a[_0x0607('0x89')]?_0x25899a[_0x0607('0x89')]:_0x0607('0x8a');var _0x55b7c4=_0x25899a[_0x0607('0x8b')]?_0x25899a[_0x0607('0x8b')]:_0x0607('0x8c');var _0x20aba2='';var _0x232f32='';var _0x4be89c='';var _0x412411='';var _0x521611=_0x25899a['version'];if(_0x5c086d==='html'){if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')]['views']['admin']){var _0x38db3b=_0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x38db3b)){_0x20aba2=path[_0x0607('0x52')](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x38db3b);}else{_0x20aba2=_0x38db3b;}}else{logger[_0x0607('0x6a')](_0x0607('0x8e'));}if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]['agent']){var _0x5bc10b=_0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x0607('0x8f')](_0x5bc10b)){_0x232f32=path['join'](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x5bc10b);}else{_0x232f32=_0x5bc10b;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5c086d==='script'){_0x4be89c=_0x25899a[_0x0607('0x7d')][_0x0607('0x90')];_0x412411=_0x25899a[_0x0607('0x7d')][_0x0607('0x85')];if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]){if('undefined'!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]['admin']){var _0x38db3b=_0x25899a['parameters'][_0x0607('0x7f')][_0x0607('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x0607('0x8f')](_0x38db3b)){_0x20aba2=path[_0x0607('0x52')](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x38db3b);}else{_0x20aba2=_0x38db3b;}}if(_0x0607('0x22')!=typeof _0x25899a[_0x0607('0x7d')][_0x0607('0x7f')][_0x0607('0x82')]){var _0x5bc10b=_0x25899a[_0x0607('0x7d')][_0x0607('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x0607('0x8f')](_0x5bc10b)){_0x232f32=path[_0x0607('0x52')](_0x0607('0x8d'),_0x2873b7,_0x565110[0x0],_0x5bc10b);}else{_0x232f32=_0x5bc10b;}}}}var _0x38fe2a={'name':_0x3d1a7f,'description':_0x4dc514,'path':path['join'](_0x2873b7,_0x565110[0x0]),'type':_0x5c086d,'sidebar':_0xaca006,'icon':_0x55b7c4,'adminUrl':_0x20aba2,'agentUrl':_0x232f32,'scriptName':_0x4be89c,'scriptPath':_0x412411,'version':_0x521611};removeReferences(_0x2f3a02,null);return db[_0x0607('0x49')][_0x0607('0x91')](_0x38fe2a)[_0x0607('0x2b')](function(_0x109ced){var _0x166efb={'role':_0x48d782[_0x0607('0x92')]['role'],'userProfileId':_0x48d782[_0x0607('0x92')]['userProfileId']};if(!_0x166efb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x166efb[_0x0607('0x93')]==='user'){var _0x3c344b=_0x109ced[_0x0607('0x2d')]({'plain':!![]});return db[_0x0607('0x94')][_0x0607('0x50')]({'where':{'name':_0x0607('0x2e'),'userProfileId':_0x166efb[_0x0607('0x95')]},'raw':!![]})[_0x0607('0x2b')](function(_0x260b4c){if(_0x260b4c&&_0x260b4c['autoAssociation']===0x0){return db[_0x0607('0x96')][_0x0607('0x91')]({'name':_0x3c344b[_0x0607('0x31')],'resourceId':_0x3c344b['id'],'type':_0x260b4c[_0x0607('0x31')],'sectionId':_0x260b4c['id']},{})[_0x0607('0x2b')](function(){return _0x109ced;});}else{return _0x109ced;}})['catch'](function(_0x5a148d){logger[_0x0607('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a148d);throw _0x5a148d;});}return _0x109ced;})['then'](respondWithResult(_0x1fe4d5,null))[_0x0607('0x4c')](handleError(_0x1fe4d5,null));}});}catch(_0x2206c3){_0x1fe4d5[_0x0607('0x1f')](0x1f4)[_0x0607('0x32')](_0x2206c3);}};function removeReferences(_0x42b276,_0x21328a){try{if(_0x42b276){fs[_0x0607('0x69')](_0x42b276);logger[_0x0607('0x6a')](_0x0607('0x97'));}if(_0x21328a){rimraf(_0x21328a,function(){});logger[_0x0607('0x6a')]('Extracted\x20folder\x20removed');}}catch(_0x1306bd){logger[_0x0607('0x2f')](_0x1306bd);}}exports[_0x0607('0x2a')]=function(_0x1a7eda,_0x2413bd,_0x54acec){return db[_0x0607('0x49')][_0x0607('0x50')]({'where':{'id':_0x1a7eda[_0x0607('0x4e')]['id']}})[_0x0607('0x2b')](handleEntityNotFound(_0x2413bd,null))[_0x0607('0x2b')](saveUpdates(_0x1a7eda[_0x0607('0x92')],null))[_0x0607('0x2b')](respondWithResult(_0x2413bd,null))['catch'](handleError(_0x2413bd,null));};exports[_0x0607('0x98')]=function(_0x4c4073,_0xdb7664,_0x74f56){return db['Plugin'][_0x0607('0x50')]({'where':{'id':_0x4c4073[_0x0607('0x4e')]['id']}})[_0x0607('0x2b')](function(_0x3de24c){if(_0x3de24c){return _0x3de24c['destroy']();}})[_0x0607('0x2b')](function(_0x4ed6d0){rimraf(path[_0x0607('0x52')](config[_0x0607('0x53')],'server/files/plugins',path[_0x0607('0x63')](_0x4ed6d0[_0x0607('0x57')])),function(){});return _0x4ed6d0;})['then'](handleEntityNotFound(_0xdb7664,null))[_0x0607('0x2b')](respondWithStatusCode(_0xdb7664,null))[_0x0607('0x4c')](handleError(_0xdb7664,null));};exports['webhookGet']=function(_0x40efda,_0x4545fe,_0x38cca3){return BPromise[_0x0607('0x99')]()[_0x0607('0x2b')](function(){if(!_0x40efda['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x40efda[_0x0607('0x3a')][_0x0607('0x9a')]){throw new Error(_0x0607('0x9b'));}var _0x88814=_0x40efda[_0x0607('0x3a')][_0x0607('0x9c')]?_0x40efda['query'][_0x0607('0x9c')]+':'+_0x40efda['query'][_0x0607('0x9a')]:_0x0607('0x9d')+_0x40efda['query'][_0x0607('0x9a')];var _0x30eb97=_0x40efda[_0x0607('0x3a')][_0x0607('0x9e')]?_0x40efda[_0x0607('0x3a')][_0x0607('0x9e')]:!![];var _0xbe0a42=_0x40efda[_0x0607('0x3a')][_0x0607('0x9f')]?_0x40efda[_0x0607('0x3a')][_0x0607('0x9f')]:null;var _0x128fbc={'method':_0x40efda['method'],'uri':util[_0x0607('0x55')](_0x0607('0xa0'),_0x88814,_0x40efda['query'][_0x0607('0x57')]),'json':_0x30eb97,'resolveWithFullResponse':!![],'encoding':_0xbe0a42,'qs':_0x40efda[_0x0607('0x3a')]};if(_0x40efda['headers']){_0x128fbc[_0x0607('0xa1')]=_0x40efda[_0x0607('0xa1')];if(_0x128fbc[_0x0607('0xa1')][_0x0607('0xa2')]){delete _0x128fbc['headers'][_0x0607('0xa2')];}}if(_0x128fbc[_0x0607('0xa1')]['content-type']){delete _0x128fbc[_0x0607('0xa1')][_0x0607('0xa3')];}return rp(_0x128fbc);})['then'](function(_0x1f0b38){if(_0x1f0b38){_0x4545fe[_0x0607('0x25')](_0x1f0b38['headers']);logger[_0x0607('0x6a')](_0x1f0b38[_0x0607('0x92')]);if(_[_0x0607('0xa4')](_0x40efda['query'][_0x0607('0x57')],'download')&&_0x1f0b38[_0x0607('0xa5')]==0x1f4){return _0x4545fe['sendStatus'](_0x1f0b38['statusCode']);}else{return _0x4545fe[_0x0607('0x1f')](_0x1f0b38[_0x0607('0xa5')])[_0x0607('0x32')](_0x1f0b38[_0x0607('0x92')]);}}else{return _0x4545fe[_0x0607('0x1e')](0xc8);}})[_0x0607('0x4c')](handleError(_0x4545fe,null));};exports[_0x0607('0xa6')]=function(_0x45fd1b,_0x58b099,_0x3d53d1){return BPromise['resolve']()[_0x0607('0x2b')](function(){if(!_0x45fd1b[_0x0607('0x3a')][_0x0607('0x57')]){throw new Error(_0x0607('0xa7'));}if(!_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3f3658=_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9c')]?_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9c')]+':'+_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9a')]:_0x0607('0x9d')+_0x45fd1b['query'][_0x0607('0x9a')];var _0x2110b1=_0x45fd1b['query'][_0x0607('0x9e')]?_0x45fd1b['query'][_0x0607('0x9e')]:!![];var _0x511e29=_0x45fd1b['query'][_0x0607('0x9f')]?_0x45fd1b[_0x0607('0x3a')][_0x0607('0x9f')]:null;var _0x17e60b={'method':_0x45fd1b[_0x0607('0xa8')],'uri':util[_0x0607('0x55')](_0x0607('0xa0'),_0x3f3658,_0x45fd1b[_0x0607('0x3a')][_0x0607('0x57')]),'json':_0x2110b1,'resolveWithFullResponse':!![],'encoding':_0x511e29,'body':_0x45fd1b['body']};if(_0x45fd1b[_0x0607('0xa1')]){_0x17e60b[_0x0607('0xa1')]=_0x45fd1b[_0x0607('0xa1')];if(_0x17e60b['headers']['content-length']){delete _0x17e60b['headers'][_0x0607('0xa2')];}}if(_0x17e60b[_0x0607('0xa1')][_0x0607('0xa3')]){delete _0x17e60b[_0x0607('0xa1')][_0x0607('0xa3')];}return rp(_0x17e60b);})[_0x0607('0x2b')](function(_0x1247dd){if(_0x1247dd){_0x58b099[_0x0607('0x25')](_0x1247dd[_0x0607('0xa1')]);logger[_0x0607('0x6a')](_0x1247dd[_0x0607('0x92')]);return _0x58b099[_0x0607('0x1f')](_0x1247dd['statusCode'])[_0x0607('0x32')](_0x1247dd[_0x0607('0x92')]);}else{return _0x58b099[_0x0607('0x1e')](0xc8);}})[_0x0607('0x4c')](handleError(_0x58b099,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 71ec79c..9d7d83a 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 _0x4453=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x4fa936,_0x34b9ad){var _0xefa5a1=function(_0xc2abe6){while(--_0xc2abe6){_0x4fa936['push'](_0x4fa936['shift']());}};_0xefa5a1(++_0x34b9ad);}(_0x4453,0x9c));var _0x3445=function(_0x41e477,_0x1025a2){_0x41e477=_0x41e477-0x0;var _0x31ca57=_0x4453[_0x41e477];return _0x31ca57;};'use strict';var EventEmitter=require(_0x3445('0x0'));var Plugin=require(_0x3445('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x3445('0x2')](0x0);var events={'afterCreate':_0x3445('0x3'),'afterUpdate':'update','afterDestroy':_0x3445('0x4')};function emitEvent(_0x1419a5){return function(_0xfff5,_0x22c15c,_0x461d8a){PluginEvents[_0x3445('0x5')](_0x1419a5+':'+_0xfff5['id'],_0xfff5);PluginEvents[_0x3445('0x5')](_0x1419a5,_0xfff5);_0x461d8a(null);};}for(var e in events){if(events[_0x3445('0x6')](e)){var event=events[e];Plugin[_0x3445('0x7')](e,emitEvent(event));}}module[_0x3445('0x8')]=PluginEvents; \ No newline at end of file +var _0xf494=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','save','update'];(function(_0x2e0769,_0x416bea){var _0x356795=function(_0x5adbeb){while(--_0x5adbeb){_0x2e0769['push'](_0x2e0769['shift']());}};_0x356795(++_0x416bea);}(_0xf494,0x1c6));var _0x4f49=function(_0x52007e,_0x332a29){_0x52007e=_0x52007e-0x0;var _0x2de4bc=_0xf494[_0x52007e];return _0x2de4bc;};'use strict';var EventEmitter=require(_0x4f49('0x0'));var Plugin=require(_0x4f49('0x1'))['db'][_0x4f49('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f49('0x3'),'afterUpdate':_0x4f49('0x4'),'afterDestroy':_0x4f49('0x5')};function emitEvent(_0x25677c){return function(_0x20c0d7,_0x2a15fb,_0x3267c1){PluginEvents[_0x4f49('0x6')](_0x25677c+':'+_0x20c0d7['id'],_0x20c0d7);PluginEvents[_0x4f49('0x6')](_0x25677c,_0x20c0d7);_0x3267c1(null);};}for(var e in events){if(events[_0x4f49('0x7')](e)){var event=events[e];Plugin[_0x4f49('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index d6c3847..8f0e9ce 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 _0xd999=['./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x8e6602,_0x53e83e){var _0x335b61=function(_0x48d59f){while(--_0x48d59f){_0x8e6602['push'](_0x8e6602['shift']());}};_0x335b61(++_0x53e83e);}(_0xd999,0x122));var _0x9d99=function(_0x53263b,_0x299c08){_0x53263b=_0x53263b-0x0;var _0x3fd94b=_0xd999[_0x53263b];return _0x3fd94b;};'use strict';var _=require(_0x9d99('0x0'));var util=require(_0x9d99('0x1'));var logger=require(_0x9d99('0x2'))(_0x9d99('0x3'));var moment=require(_0x9d99('0x4'));var BPromise=require('bluebird');var rp=require(_0x9d99('0x5'));var fs=require('fs');var path=require(_0x9d99('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9d99('0x7'));module['exports']=function(_0x4baa13,_0x3d2378){return _0x4baa13[_0x9d99('0x8')](_0x9d99('0x9'),attributes,{'tableName':_0x9d99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd488=['rimraf','./plugin.attributes','exports','Plugin','plugins','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd488,0xe1));var _0x8d48=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0xd488[_0x5ff517];return _0x19a245;};'use strict';var _=require(_0x8d48('0x0'));var util=require('util');var logger=require(_0x8d48('0x1'))(_0x8d48('0x2'));var moment=require(_0x8d48('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d48('0x4'));var fs=require('fs');var path=require(_0x8d48('0x5'));var rimraf=require(_0x8d48('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d48('0x7'));module[_0x8d48('0x8')]=function(_0x5498ba,_0x49e2bc){return _0x5498ba['define'](_0x8d48('0x9'),attributes,{'tableName':_0x8d48('0xa'),'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 5e62824..1507972 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 _0x082e=['register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','CreatePlugin','Plugin','create','body','options','stringify','catch','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','http','redis','localhost','./plugin.socket'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x082e,0x17d));var _0xe082=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x082e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe082('0x0'));var util=require(_0xe082('0x1'));var moment=require(_0xe082('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe082('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe082('0x4'));var logger=require('../../config/logger')(_0xe082('0x5'));var config=require(_0xe082('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe082('0x7')]({'port':0x232a});config[_0xe082('0x8')]=_['defaults'](config[_0xe082('0x8')],{'host':_0xe082('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe082('0xa'))[_0xe082('0xb')](socket);function respondWithRpcPromise(_0x4926ed,_0xb78be0,_0x5c036c){return new BPromise(function(_0x351de2,_0x32a256){return client['request'](_0x4926ed,_0x5c036c)[_0xe082('0xc')](function(_0xb42b44){logger[_0xe082('0xd')](_0xe082('0xe'),_0xb78be0,_0xe082('0xf'));logger['debug'](_0xe082('0x10'),_0xb78be0,_0xe082('0xf'),JSON['stringify'](_0xb42b44));if(_0xb42b44['error']){if(_0xb42b44[_0xe082('0x11')][_0xe082('0x12')]===0x1f4){logger[_0xe082('0x11')](_0xe082('0xe'),_0xb78be0,_0xb42b44[_0xe082('0x11')][_0xe082('0x13')]);return _0x32a256(_0xb42b44[_0xe082('0x11')][_0xe082('0x13')]);}logger['error'](_0xe082('0xe'),_0xb78be0,_0xb42b44[_0xe082('0x11')][_0xe082('0x13')]);return _0x351de2(_0xb42b44[_0xe082('0x11')][_0xe082('0x13')]);}else{logger[_0xe082('0xd')](_0xe082('0xe'),_0xb78be0,'request\x20sent');_0x351de2(_0xb42b44[_0xe082('0x14')][_0xe082('0x13')]);}})['catch'](function(_0x12adad){logger[_0xe082('0x11')](_0xe082('0xe'),_0xb78be0,_0x12adad);_0x32a256(_0x12adad);});});}exports[_0xe082('0x15')]=function(_0x2de916){var _0x650a7c=this;return new Promise(function(_0x1befb1,_0x1865f0){return db[_0xe082('0x16')][_0xe082('0x17')](_0x2de916[_0xe082('0x18')],{'raw':_0x2de916[_0xe082('0x19')]?_0x2de916[_0xe082('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xe082('0xc')](function(_0x3f5492){logger[_0xe082('0xd')](_0xe082('0x15'),_0x2de916);logger['debug'](_0xe082('0x15'),_0x2de916,JSON[_0xe082('0x1a')](_0x3f5492));_0x1befb1(_0x3f5492);})[_0xe082('0x1b')](function(_0x4a614a){logger[_0xe082('0x11')]('CreatePlugin',_0x4a614a['message'],_0x2de916);_0x1865f0(_0x650a7c[_0xe082('0x11')](0x1f4,_0x4a614a['message']));});});}; \ No newline at end of file +var _0x6cfc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','options','raw','then','stringify'];(function(_0x1ba17a,_0x297e74){var _0x2e762b=function(_0x602095){while(--_0x602095){_0x1ba17a['push'](_0x1ba17a['shift']());}};_0x2e762b(++_0x297e74);}(_0x6cfc,0x14a));var _0xc6cf=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x6cfc[_0xc7348b];return _0x307cec;};'use strict';var _=require('lodash');var util=require(_0xc6cf('0x0'));var moment=require(_0xc6cf('0x1'));var BPromise=require(_0xc6cf('0x2'));var rs=require(_0xc6cf('0x3'));var fs=require('fs');var Redis=require(_0xc6cf('0x4'));var db=require(_0xc6cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6cf('0x6'))('rpc');var config=require(_0xc6cf('0x7'));var jayson=require(_0xc6cf('0x8'));var client=jayson[_0xc6cf('0x9')][_0xc6cf('0xa')]({'port':0x232a});config['redis']=_[_0xc6cf('0xb')](config[_0xc6cf('0xc')],{'host':_0xc6cf('0xd'),'port':0x18eb});var socket=require(_0xc6cf('0xe'))(new Redis(config[_0xc6cf('0xc')]));require(_0xc6cf('0xf'))[_0xc6cf('0x10')](socket);function respondWithRpcPromise(_0x5442bb,_0x31a397,_0x35acbe){return new BPromise(function(_0x36d188,_0x2c20dd){return client[_0xc6cf('0x11')](_0x5442bb,_0x35acbe)['then'](function(_0x58d3a4){logger[_0xc6cf('0x12')](_0xc6cf('0x13'),_0x31a397,_0xc6cf('0x14'));logger[_0xc6cf('0x15')](_0xc6cf('0x16'),_0x31a397,'request\x20sent',JSON['stringify'](_0x58d3a4));if(_0x58d3a4[_0xc6cf('0x17')]){if(_0x58d3a4[_0xc6cf('0x17')][_0xc6cf('0x18')]===0x1f4){logger[_0xc6cf('0x17')](_0xc6cf('0x13'),_0x31a397,_0x58d3a4[_0xc6cf('0x17')]['message']);return _0x2c20dd(_0x58d3a4[_0xc6cf('0x17')][_0xc6cf('0x19')]);}logger[_0xc6cf('0x17')](_0xc6cf('0x13'),_0x31a397,_0x58d3a4['error']['message']);return _0x36d188(_0x58d3a4[_0xc6cf('0x17')][_0xc6cf('0x19')]);}else{logger[_0xc6cf('0x12')]('Plugin,\x20%s,\x20%s',_0x31a397,_0xc6cf('0x14'));_0x36d188(_0x58d3a4[_0xc6cf('0x1a')][_0xc6cf('0x19')]);}})[_0xc6cf('0x1b')](function(_0x51e52e){logger[_0xc6cf('0x17')]('Plugin,\x20%s,\x20%s',_0x31a397,_0x51e52e);_0x2c20dd(_0x51e52e);});});}exports[_0xc6cf('0x1c')]=function(_0x50a243){var _0x7fec4a=this;return new Promise(function(_0x18e8c1,_0x134e43){return db['Plugin']['create'](_0x50a243['body'],{'raw':_0x50a243[_0xc6cf('0x1d')]?_0x50a243[_0xc6cf('0x1d')][_0xc6cf('0x1e')]===undefined?!![]:![]:!![]})[_0xc6cf('0x1f')](function(_0x3ad7df){logger['info'](_0xc6cf('0x1c'),_0x50a243);logger[_0xc6cf('0x15')](_0xc6cf('0x1c'),_0x50a243,JSON[_0xc6cf('0x20')](_0x3ad7df));_0x18e8c1(_0x3ad7df);})[_0xc6cf('0x1b')](function(_0x304fb1){logger[_0xc6cf('0x17')]('CreatePlugin',_0x304fb1[_0xc6cf('0x19')],_0x50a243);_0x134e43(_0x7fec4a[_0xc6cf('0x17')](0x1f4,_0x304fb1[_0xc6cf('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 93d309f..b6cc6ce 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 _0xfef1=['update','emit','register','length','plugin:','./plugin.events'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xfef1,0xc5));var _0x1fef=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfef1[_0x501510];return _0x1e6ee5;};'use strict';var PluginEvents=require(_0x1fef('0x0'));var events=['save','remove',_0x1fef('0x1')];function createListener(_0x4bab7b,_0xa45e4a){return function(_0x28a2a6){_0xa45e4a[_0x1fef('0x2')](_0x4bab7b,_0x28a2a6);};}function removeListener(_0x58aaa1,_0x1018b1){return function(){PluginEvents['removeListener'](_0x58aaa1,_0x1018b1);};}exports[_0x1fef('0x3')]=function(_0x44f16b){for(var _0x433f93=0x0,_0x13d22b=events[_0x1fef('0x4')];_0x433f93<_0x13d22b;_0x433f93++){var _0x8eeccc=events[_0x433f93];var _0x48e139=createListener(_0x1fef('0x5')+_0x8eeccc,_0x44f16b);PluginEvents['on'](_0x8eeccc,_0x48e139);}}; \ No newline at end of file +var _0xe06f=['removeListener','length','remove','emit'];(function(_0x9c150a,_0x268e0b){var _0x3f2f06=function(_0x2bcfd7){while(--_0x2bcfd7){_0x9c150a['push'](_0x9c150a['shift']());}};_0x3f2f06(++_0x268e0b);}(_0xe06f,0x8e));var _0xfe06=function(_0x57e15e,_0x270a91){_0x57e15e=_0x57e15e-0x0;var _0x325a9a=_0xe06f[_0x57e15e];return _0x325a9a;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xfe06('0x0'),'update'];function createListener(_0x4ca64a,_0x5d2f55){return function(_0x33e47c){_0x5d2f55[_0xfe06('0x1')](_0x4ca64a,_0x33e47c);};}function removeListener(_0x1f35d5,_0x109322){return function(){PluginEvents[_0xfe06('0x2')](_0x1f35d5,_0x109322);};}exports['register']=function(_0x44d503){for(var _0x419c65=0x0,_0x5d2a6a=events[_0xfe06('0x3')];_0x419c65<_0x5d2a6a;_0x419c65++){var _0x405e76=events[_0x419c65];var _0xe9077b=createListener('plugin:'+_0x405e76,_0x44d503);PluginEvents['on'](_0x405e76,_0xe9077b);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c7868c1..7f0e42d 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(_0xf9c9f9,_0x33acdb){var _0x4ad6c2=function(_0x4840ba){while(--_0x4840ba){_0xf9c9f9['push'](_0xf9c9f9['shift']());}};_0x4ad6c2(++_0x33acdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x191c44,_0x20a896){var _0x1086cd=function(_0x2e2cac){while(--_0x2e2cac){_0x191c44['push'](_0x191c44['shift']());}};_0x1086cd(++_0x20a896);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 50b2081..c37a7ab 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 _0x5ff3=['Unknown\x20id','../../config/pm2','api','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x5ff3,0x17d));var _0x35ff=function(_0xe651eb,_0x5e2f4f){_0xe651eb=_0xe651eb-0x0;var _0xe0b0e6=_0x5ff3[_0xe651eb];return _0xe0b0e6;};'use strict';var _=require('lodash');var pm2=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var path=require('path');var exec=require(_0x35ff('0x2'))[_0x35ff('0x3')];var BPromise=require(_0x35ff('0x4'));function handleEntityNotFound(_0xd0846d,_0x551514){return function(_0x2fcb74){if(!_0x2fcb74){_0xd0846d[_0x35ff('0x5')](0x194);;}return _0x2fcb74;};}function respondWithResult(_0x2e9873,_0x11e738){_0x11e738=_0x11e738||0xc8;return function(_0x30c3ff){if(_0x30c3ff){return _0x2e9873['status'](_0x11e738)[_0x35ff('0x6')](_0x30c3ff);}return null;};}function handleError(_0x4c9fab,_0x2e7470){_0x2e7470=_0x2e7470||0x1f4;return function(_0xfcec34){logger[_0x35ff('0x7')](_0xfcec34['stack']);if(_0xfcec34[_0x35ff('0x8')]){delete _0xfcec34['name'];}_0x4c9fab[_0x35ff('0x9')](_0x2e7470)[_0x35ff('0xa')](_0xfcec34);};}function execChildProcess(){return new BPromise(function(_0x57ad20,_0x5c3131){exec(_0x35ff('0xb'),function(_0x574c81,_0x592295,_0x567080){logger[_0x35ff('0xc')](_0x592295);logger[_0x35ff('0xc')](_0x567080);if(_0x574c81){logger[_0x35ff('0x7')](_0x574c81);return _0x5c3131(_0x574c81);}return _0x57ad20(_0x592295);});});}exports[_0x35ff('0xd')]=function(_0x559e33,_0x33154f){return pm2[_0x35ff('0xe')]()[_0x35ff('0xf')](function(_0x4d1d41){if(_0x4d1d41){var _0xff8ac=_[_0x35ff('0x10')](_0x4d1d41,function(_0x254975){return _0x254975[_0x35ff('0x8')]===_0x35ff('0x11')||_0x254975[_0x35ff('0x8')]===_0x35ff('0x12');});return{'rows':_0xff8ac,'count':_0xff8ac[_0x35ff('0x13')]};}return null;})[_0x35ff('0xf')](respondWithResult(_0x33154f,null))[_0x35ff('0x14')](handleError(_0x33154f,null));};exports[_0x35ff('0x15')]=function(_0x3430e2,_0x37ea06){return pm2[_0x35ff('0x16')](_0x3430e2[_0x35ff('0x17')]['id'])['then'](respondWithResult(_0x37ea06,null))[_0x35ff('0xf')](handleEntityNotFound(_0x37ea06,null))[_0x35ff('0x14')](handleError(_0x37ea06,null));};exports[_0x35ff('0x18')]=function(_0x1c0d8c,_0x567bcb){if(_0x1c0d8c['body'][_0x35ff('0x8')]&&_0x1c0d8c[_0x35ff('0x19')]['script']){var _0x238f65=path[_0x35ff('0x1a')](__dirname,_0x35ff('0x1b'),_0x1c0d8c[_0x35ff('0x19')]['script']);var _0x3d60b4=process['cwd']();process[_0x35ff('0x1c')](path[_0x35ff('0x1d')](_0x238f65));return execChildProcess()[_0x35ff('0xf')](function(_0x16a5a0){process[_0x35ff('0x1c')](_0x3d60b4);return pm2[_0x35ff('0x1e')]({'name':_0x1c0d8c[_0x35ff('0x19')]['name'],'script':_0x238f65});})[_0x35ff('0xf')](function(_0x2ffcb){pm2['dump']();return _0x2ffcb[0x0];})[_0x35ff('0xf')](respondWithResult(_0x567bcb,0xc9))['catch'](handleError(_0x567bcb,null));}else{return _0x567bcb['status'](0x1f4)[_0x35ff('0xa')]({'message':_0x35ff('0x1f')});}};exports[_0x35ff('0x20')]=function(_0x11a5eb,_0x302d5a){if(_0x11a5eb['body']['id']){delete _0x11a5eb[_0x35ff('0x19')]['id'];}var _0x412873={'online':_0x35ff('0x21'),'stopped':'stop'};if(_0x412873[_0x35ff('0x22')](_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')])){return pm2[_0x412873[_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')]]](_0x11a5eb[_0x35ff('0x17')]['id'])[_0x35ff('0xf')](respondWithResult(_0x302d5a,0xc8))[_0x35ff('0x14')](handleError(_0x302d5a,null));}else{return _0x302d5a[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x23')});}};exports['destroy']=function(_0x1cb370,_0x257501){if(_0x1cb370[_0x35ff('0x19')]['id']){delete _0x1cb370[_0x35ff('0x19')]['id'];}if(_0x1cb370['params']['id']){return pm2[_0x35ff('0x24')](_0x1cb370['params']['id'])[_0x35ff('0xf')](function(_0xf88865){pm2['dump']();return _0xf88865[0x0];})['then'](respondWithResult(_0x257501,null))[_0x35ff('0x14')](handleError(_0x257501,null));}else{return _0x257501[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x25')});}}; \ No newline at end of file +var _0x91a7=['params','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','length','show','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','catch','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status'];(function(_0x5837e7,_0x35de4f){var _0x537783=function(_0x4cce5d){while(--_0x4cce5d){_0x5837e7['push'](_0x5837e7['shift']());}};_0x537783(++_0x35de4f);}(_0x91a7,0xe7));var _0x791a=function(_0x1cc849,_0x352841){_0x1cc849=_0x1cc849-0x0;var _0x55c1ca=_0x91a7[_0x1cc849];return _0x55c1ca;};'use strict';var _=require('lodash');var pm2=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var path=require('path');var exec=require(_0x791a('0x3'))['exec'];var BPromise=require(_0x791a('0x4'));function handleEntityNotFound(_0x535640,_0x50ab29){return function(_0x32fe2b){if(!_0x32fe2b){_0x535640[_0x791a('0x5')](0x194);;}return _0x32fe2b;};}function respondWithResult(_0x49a9b7,_0x361f53){_0x361f53=_0x361f53||0xc8;return function(_0x5db6db){if(_0x5db6db){return _0x49a9b7[_0x791a('0x6')](_0x361f53)[_0x791a('0x7')](_0x5db6db);}return null;};}function handleError(_0x5aa10a,_0x1a32b4){_0x1a32b4=_0x1a32b4||0x1f4;return function(_0x12884d){logger[_0x791a('0x8')](_0x12884d[_0x791a('0x9')]);if(_0x12884d[_0x791a('0xa')]){delete _0x12884d['name'];}_0x5aa10a[_0x791a('0x6')](_0x1a32b4)[_0x791a('0xb')](_0x12884d);};}function execChildProcess(){return new BPromise(function(_0x57e99c,_0x2bd26a){exec(_0x791a('0xc'),function(_0x167bc4,_0x17cf33,_0x2805c9){logger[_0x791a('0xd')](_0x17cf33);logger['info'](_0x2805c9);if(_0x167bc4){logger['error'](_0x167bc4);return _0x2bd26a(_0x167bc4);}return _0x57e99c(_0x17cf33);});});}exports[_0x791a('0xe')]=function(_0x2f2d8d,_0x4c56f0){return pm2[_0x791a('0xf')]()[_0x791a('0x10')](function(_0x5d5b11){if(_0x5d5b11){var _0x2887f0=_[_0x791a('0x11')](_0x5d5b11,function(_0x2ef5c5){return _0x2ef5c5[_0x791a('0xa')]==='express'||_0x2ef5c5[_0x791a('0xa')]==='motion2';});return{'rows':_0x2887f0,'count':_0x2887f0[_0x791a('0x12')]};}return null;})[_0x791a('0x10')](respondWithResult(_0x4c56f0,null))['catch'](handleError(_0x4c56f0,null));};exports[_0x791a('0x13')]=function(_0x5bea2e,_0x35fe48){return pm2['describe'](_0x5bea2e['params']['id'])['then'](respondWithResult(_0x35fe48,null))[_0x791a('0x10')](handleEntityNotFound(_0x35fe48,null))['catch'](handleError(_0x35fe48,null));};exports['create']=function(_0x39c60b,_0x5a702e){if(_0x39c60b[_0x791a('0x14')][_0x791a('0xa')]&&_0x39c60b['body'][_0x791a('0x15')]){var _0xcb5e66=path[_0x791a('0x16')](__dirname,_0x791a('0x17'),_0x39c60b['body'][_0x791a('0x15')]);var _0x2054c6=process[_0x791a('0x18')]();process[_0x791a('0x19')](path[_0x791a('0x1a')](_0xcb5e66));return execChildProcess()[_0x791a('0x10')](function(_0x2241a0){process[_0x791a('0x19')](_0x2054c6);return pm2[_0x791a('0x1b')]({'name':_0x39c60b[_0x791a('0x14')][_0x791a('0xa')],'script':_0xcb5e66});})['then'](function(_0x1102c9){pm2[_0x791a('0x1c')]();return _0x1102c9[0x0];})[_0x791a('0x10')](respondWithResult(_0x5a702e,0xc9))[_0x791a('0x1d')](handleError(_0x5a702e,null));}else{return _0x5a702e['status'](0x1f4)[_0x791a('0xb')]({'message':_0x791a('0x1e')});}};exports['update']=function(_0xdfa84f,_0x1785f5){if(_0xdfa84f[_0x791a('0x14')]['id']){delete _0xdfa84f['body']['id'];}var _0x29194d={'online':_0x791a('0x1f'),'stopped':_0x791a('0x20')};if(_0x29194d[_0x791a('0x21')](_0xdfa84f[_0x791a('0x14')][_0x791a('0x6')])){return pm2[_0x29194d[_0xdfa84f[_0x791a('0x14')][_0x791a('0x6')]]](_0xdfa84f['params']['id'])[_0x791a('0x10')](respondWithResult(_0x1785f5,0xc8))[_0x791a('0x1d')](handleError(_0x1785f5,null));}else{return _0x1785f5[_0x791a('0x6')](0x1f4)['send']({'message':_0x791a('0x22')});}};exports['destroy']=function(_0xc59f5e,_0x2e4ec8){if(_0xc59f5e[_0x791a('0x14')]['id']){delete _0xc59f5e[_0x791a('0x14')]['id'];}if(_0xc59f5e[_0x791a('0x23')]['id']){return pm2[_0x791a('0x24')](_0xc59f5e[_0x791a('0x23')]['id'])['then'](function(_0x3662c6){pm2[_0x791a('0x1c')]();return _0x3662c6[0x0];})[_0x791a('0x10')](respondWithResult(_0x2e4ec8,null))[_0x791a('0x1d')](handleError(_0x2e4ec8,null));}else{return _0x2e4ec8[_0x791a('0x6')](0x1f4)['send']({'message':_0x791a('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 09fe669..5494227 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 _0x72a5=['./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','express','Router','../../components/auth/service'];(function(_0x2f2e64,_0x549b76){var _0x8c59bf=function(_0x5a1b41){while(--_0x5a1b41){_0x2f2e64['push'](_0x2f2e64['shift']());}};_0x8c59bf(++_0x549b76);}(_0x72a5,0x147));var _0x572a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72a5[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x572a('0x0'));var router=express[_0x572a('0x1')]();var auth=require(_0x572a('0x2'));var controller=require(_0x572a('0x3'));router[_0x572a('0x4')](_0x572a('0x5'),auth[_0x572a('0x6')](),controller[_0x572a('0x7')]);router[_0x572a('0x4')](_0x572a('0x8'),auth[_0x572a('0x6')](),controller[_0x572a('0x9')]);module['exports']=router; \ No newline at end of file +var _0x05a9=['get','/agents','getAgents','getQueues','exports','express','Router','./realtime.controller'];(function(_0x5af9ba,_0x30adfb){var _0x488c7c=function(_0x558245){while(--_0x558245){_0x5af9ba['push'](_0x5af9ba['shift']());}};_0x488c7c(++_0x30adfb);}(_0x05a9,0x15d));var _0x905a=function(_0x2a74f5,_0x572a9d){_0x2a74f5=_0x2a74f5-0x0;var _0x2c9427=_0x05a9[_0x2a74f5];return _0x2c9427;};'use strict';var express=require(_0x905a('0x0'));var router=express[_0x905a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x905a('0x2'));router[_0x905a('0x3')](_0x905a('0x4'),auth['isAuthenticated'](),controller[_0x905a('0x5')]);router['get']('/queues',auth['isAuthenticated'](),controller[_0x905a('0x6')]);module[_0x905a('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index d5799bd..e97a948 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 _0x5d9b=['name','voice','outbound','dialActive','dialMethod','Queues','findAndCountAll','initializeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','handleError','undefined','count','offset','limit','set','Content-Range','json','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','channel','isValidChannel','format','toLowerCase','sort','validateSortParameter','getUpdatedSortOptions','fields','order','getRealtimeAgents','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','Agents','extraQueryConditions','UserProfile','getResources','filterAgentAttributes','merge','globalStatus','includes','Status','sortAgentsByStatus','pick','rows','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','startCase','Queue','key'];(function(_0x21f3c3,_0x42e32c){var _0x15957=function(_0x271f01){while(--_0x271f01){_0x21f3c3['push'](_0x21f3c3['shift']());}};_0x15957(++_0x42e32c);}(_0x5d9b,0x189));var _0xb5d9=function(_0x3c3535,_0x5dde91){_0x3c3535=_0x3c3535-0x0;var _0x283369=_0x5d9b[_0x3c3535];return _0x283369;};'use strict';var _=require('lodash');var util=require(_0xb5d9('0x0'));var rta=require(_0xb5d9('0x1'));var rtq=require(_0xb5d9('0x2'));var qs=require(_0xb5d9('0x3'));var utils=require('../../config/utils');var db=require(_0xb5d9('0x4'))['db'];var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APIHandleError=require('../../errors/api')[_0xb5d9('0x5')];function respondWithFilteredResult(_0x52717e,_0x197a4e){return function(_0x48e553){if(_0x48e553){var _0x489c35=typeof _0x197a4e['offset']===_0xb5d9('0x6')&&typeof _0x197a4e['limit']===_0xb5d9('0x6');var _0x20e172=_0x48e553['count'];var _0x270e70=_0x489c35?0x0:_0x197a4e['offset'];var _0x465f81=_0x489c35?_0x48e553[_0xb5d9('0x7')]:_0x197a4e[_0xb5d9('0x8')]+_0x197a4e[_0xb5d9('0x9')];var _0x2031bf;if(_0x465f81>=_0x20e172){_0x465f81=_0x20e172;_0x2031bf=0xc8;}else{_0x2031bf=0xce;}_0x52717e['status'](_0x2031bf);return _0x52717e[_0xb5d9('0xa')](_0xb5d9('0xb'),_0x270e70+'-'+_0x465f81+'/'+_0x20e172)[_0xb5d9('0xc')](_0x48e553);}return null;};}exports[_0xb5d9('0xd')]=function(_0x498e08,_0x58d470){var _0x3e4753={'count':0x0,'rows':[]};var _0x641429={};var _0x119167;var _0x569163=utils['getChannels']();var _0x5ad0f4;var _0x3ef8a3;var _0x506880=_0x498e08[_0xb5d9('0xe')]['globalQueueFilter'];var _0x132424=_0x498e08[_0xb5d9('0xe')][_0xb5d9('0xf')];var _0x4c0ad2=_0x498e08['query'][_0xb5d9('0x10')];var _0x56a815=_0x132424===_0xb5d9('0x11')||_0x132424===_0xb5d9('0x12')?!![]:![];var _0x3492d6=[];var _0x1c39b0;var _0x10205f;Promise[_0xb5d9('0x13')]()[_0xb5d9('0x14')](function(){if(_0x498e08['query'][_0xb5d9('0x15')]){if(!utils[_0xb5d9('0x16')](_0x498e08[_0xb5d9('0xe')][_0xb5d9('0x15')])){throw new APIBadRequestError(util[_0xb5d9('0x17')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x498e08[_0xb5d9('0xe')][_0xb5d9('0x15')]));}_0x119167=_0x498e08['query']['channel'][_0xb5d9('0x18')]();}if(!_0x498e08['query'][_0xb5d9('0x19')]||!_0x498e08[_0xb5d9('0xe')]['sort']['includes']('globalStatus')){_0x498e08[_0xb5d9('0xe')]['sort']=rta[_0xb5d9('0x1a')](_0x498e08[_0xb5d9('0xe')][_0xb5d9('0x19')]);return;}var _0x5bbea0=rta[_0xb5d9('0x1b')](_0x498e08[_0xb5d9('0xe')]['sort']);_0x498e08[_0xb5d9('0xe')][_0xb5d9('0x19')]=_0x5bbea0[_0xb5d9('0x1c')]['join'](',');_0x1c39b0=_0x5bbea0[_0xb5d9('0x1d')];})['then'](function(){if(!_0x506880){return[];}return rta['getAgentIdsByQueues'](_0x506880,_0x119167);})[_0xb5d9('0x14')](function(_0x925bd6){_0x3492d6=_0x925bd6;return rta[_0xb5d9('0x1e')]();})[_0xb5d9('0x14')](function(_0x4d32d3){_0x3ef8a3=_0x4d32d3['rows'];if((!_0x132424||_0x56a815)&&!_0x1c39b0){return _0x3492d6;}if(_0x1c39b0&&!_0x132424){return rta[_0xb5d9('0x1f')](_0x3ef8a3,_0x3492d6,_0x1c39b0);}else{return rta['getAgentIdsByStatus'](_0x3ef8a3,_0x3492d6,_0x132424);}})[_0xb5d9('0x14')](function(_0x477494){_0x3492d6=_0x477494;var _0xe142eb=![];if(_0x3492d6[_0xb5d9('0x20')]===0x0){if(_0x506880||_0x132424){_0xe142eb=!![];}if(_0x56a815){_0xe142eb=![];}}if(_0xe142eb){return _0x3e4753;}var _0x50c101=_[_0xb5d9('0x21')](db[_0xb5d9('0x22')][_0xb5d9('0x23')],function(_0x47e3b1){return{'name':_0x47e3b1[_0xb5d9('0x24')],'type':_0x47e3b1[_0xb5d9('0x25')]['key']};});_0x498e08['query'][_0xb5d9('0x26')]=_0xb5d9('0x27');_0x498e08['query']['online']=!![];_0x641429=qs[_0xb5d9('0x28')](_0x50c101,_0x498e08);_0x641429[_0xb5d9('0x29')]=!![];var _0x3aaa8d=[];if(_0x3492d6['length']>0x0){_0x3aaa8d[_0xb5d9('0x2a')]({'id':{'$in':_0x3492d6}});if(_0x1c39b0&&!_0x132424){_0x10205f=[db[_0xb5d9('0x2b')][_0xb5d9('0x2c')](_0xb5d9('0x2d')+_0x3492d6+')')];_0x641429[_0xb5d9('0x1d')]=_0x10205f;}}if(_0x56a815){_0x569163[_0xb5d9('0x2e')](function(_0x3052ac){var _0x2fc2d8=!![];if(_0x132424===_0xb5d9('0x12')&&_0x119167!==_0x3052ac){_0x2fc2d8=![];}_0x3aaa8d[_0xb5d9('0x2a')]({[_0x3052ac+_0xb5d9('0x2f')]:_0x2fc2d8});});if(_0x4c0ad2){_0x3aaa8d['push']({'pauseType':_0x4c0ad2});}}else if(_0x132424){_0x569163[_0xb5d9('0x2e')](function(_0x15cf1d){_0x3aaa8d['push']({[_0x15cf1d+_0xb5d9('0x2f')]:![]});});}_0x641429[_0xb5d9('0x30')]=_['merge'](_0x641429['where'],{'$and':_0x3aaa8d});if(_0x498e08[_0xb5d9('0x31')][_0xb5d9('0x26')]==='user'){var _0x9614f6={'params':{'id':_0x498e08[_0xb5d9('0x31')][_0xb5d9('0x32')]},'query':{'section':_0xb5d9('0x33'),'role':_0xb5d9('0x27'),'online':!![],'raw':!![],'ids':_0x3492d6,'customSorting':_0x10205f}};if(_0x56a815){_0x9614f6[_0xb5d9('0xe')][_0xb5d9('0x34')]=_0x3aaa8d;}_0x9614f6[_0xb5d9('0xe')]=Object['assign'](_0x9614f6['query'],_0x498e08[_0xb5d9('0xe')]);delete _0x9614f6['query']['id'];return db[_0xb5d9('0x35')][_0xb5d9('0x36')](_0x9614f6);}return db['User']['findAndCountAll'](_0x641429);})[_0xb5d9('0x14')](function(_0x40a171){_0x3e4753[_0xb5d9('0x7')]=_0x40a171[_0xb5d9('0x7')];_0x5ad0f4=_0x40a171['rows'];return _0x5ad0f4[_0xb5d9('0x21')](function(_0x2eb471){var _0x1b1043=_['find'](_0x3ef8a3,['id',_0x2eb471['id']]);if(_0x1b1043){var _0xb8f1a9=rta[_0xb5d9('0x37')](_0x1b1043);_[_0xb5d9('0x38')](_0x2eb471,_0xb8f1a9);}_0x2eb471[_0xb5d9('0x39')]=rta['getAgentStatus'](_0x2eb471);if(_0x2eb471[_0xb5d9('0x39')][_0xb5d9('0x3a')](_0xb5d9('0x11'))){_0x569163[_0xb5d9('0x2e')](function(_0x4d614d){if(_0x2eb471[_0x4d614d+_0xb5d9('0x2f')]){_0x2eb471[_0x4d614d+_0xb5d9('0x3b')]='pause';}});}return _0x2eb471;});})[_0xb5d9('0x14')](function(_0xece468){if(!_0x1c39b0||_0x10205f){return _0xece468;}return rta[_0xb5d9('0x3c')](_0xece468,_0x1c39b0);})[_0xb5d9('0x14')](function(_0x15571b){var _0x505dd3=null;if(_0x498e08['query'][_0xb5d9('0x1c')]){var _0x2119de=_0x498e08[_0xb5d9('0xe')][_0xb5d9('0x1c')]['split'](',');_0x505dd3=_0x15571b[_0xb5d9('0x21')](function(_0x4049e9){return _[_0xb5d9('0x3d')](_0x4049e9,_0x2119de);});}_0x3e4753[_0xb5d9('0x3e')]=_0x505dd3||_0x15571b;return _0x3e4753;})[_0xb5d9('0x14')](respondWithFilteredResult(_0x58d470,_0x641429))[_0xb5d9('0x3f')](APIHandleError(_0x58d470));};exports[_0xb5d9('0x40')]=function(_0x504155,_0x5d3384){var _0x19fd43={'count':0x0,'rows':[]};var _0x5466a7={};var _0x2ba73f;var _0x22c587;var _0x26bf97;Promise[_0xb5d9('0x13')]()[_0xb5d9('0x14')](function(){if(_0x504155[_0xb5d9('0xe')][_0xb5d9('0x15')]){if(!utils['isValidChannel'](_0x504155[_0xb5d9('0xe')][_0xb5d9('0x15')])){throw new APIBadRequestError(util[_0xb5d9('0x17')](_0xb5d9('0x41'),_0x504155[_0xb5d9('0xe')]['channel']));}_0x2ba73f=_0x504155[_0xb5d9('0xe')]['channel']['toLowerCase']();}var _0x54522c=_[_0xb5d9('0x42')](_0x2ba73f)+_0xb5d9('0x43');var _0x33e1ba=_[_0xb5d9('0x21')](db[_0x54522c]['rawAttributes'],function(_0x17ea39){return{'name':_0x17ea39[_0xb5d9('0x24')],'type':_0x17ea39[_0xb5d9('0x25')][_0xb5d9('0x44')]};});if(!_0x504155[_0xb5d9('0xe')][_0xb5d9('0x1c')]){var _0x3b8b6a=['id',_0xb5d9('0x45')];if(_0x2ba73f===_0xb5d9('0x46')){_0x3b8b6a[_0xb5d9('0x2a')]('type');if(_0x504155['query'][_0xb5d9('0x25')]===_0xb5d9('0x47')){_0x3b8b6a['push']([_0xb5d9('0x48'),_0xb5d9('0x49')]);}}_0x504155[_0xb5d9('0xe')][_0xb5d9('0x1c')]=_0x3b8b6a['join'](',');}_0x5466a7=qs[_0xb5d9('0x28')](_0x33e1ba,_0x504155);if(_0x504155[_0xb5d9('0x31')][_0xb5d9('0x26')]===_0xb5d9('0x31')){var _0x3dbcc9={'params':{'id':_0x504155[_0xb5d9('0x31')][_0xb5d9('0x32')]},'query':{'section':_0x2ba73f===_0xb5d9('0x46')&&_0x504155[_0xb5d9('0xe')][_0xb5d9('0x25')]===_0xb5d9('0x47')?'QueueCampaigns':_[_0xb5d9('0x42')](_0x2ba73f)+_0xb5d9('0x4a'),'type':_0x504155['query'][_0xb5d9('0x25')],'nolimit':!![],'sort':_0xb5d9('0x45'),'filter':_0x504155[_0xb5d9('0xe')]['filter']}};return db['UserProfile']['getResources'](_0x3dbcc9);}return db[_0x54522c][_0xb5d9('0x4b')](_0x5466a7);})['then'](function(_0x2afe11){_0x19fd43[_0xb5d9('0x7')]=_0x2afe11[_0xb5d9('0x7')];_0x22c587=_0x2afe11[_0xb5d9('0x3e')];return rtq['getRealtimeQueues'](_0x504155,_0x2ba73f);})[_0xb5d9('0x14')](function(_0x218999){_0x26bf97=_0x218999[_0xb5d9('0x3e')];return rtq[_0xb5d9('0x4c')](_0x22c587,_0x26bf97,_0x2ba73f,_0x504155[_0xb5d9('0xe')][_0xb5d9('0x25')]);})[_0xb5d9('0x14')](function(_0xc02374){_0x19fd43[_0xb5d9('0x3e')]=_0xc02374;return _0x19fd43;})[_0xb5d9('0x14')](respondWithFilteredResult(_0x5d3384,_0x5466a7))[_0xb5d9('0x3f')](APIHandleError(_0x5d3384));}; \ No newline at end of file +var _0xde63=['getAgentStatus','Status','fields','pick','catch','getQueues','startCase','Queue','name','dialActive','outbound','QueueCampaigns','filter','UserProfile','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','offset','undefined','count','limit','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','pause','resolve','then','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','join','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','where','user','userProfileId','Agents','extraQueryConditions','assign','findAndCountAll','find','filterAgentAttributes'];(function(_0x1f2019,_0x26065a){var _0x2c5de3=function(_0x5e7a0d){while(--_0x5e7a0d){_0x1f2019['push'](_0x1f2019['shift']());}};_0x2c5de3(++_0x26065a);}(_0xde63,0x1a0));var _0x3de6=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xde63[_0x3afe18];return _0x19ed1f;};'use strict';var _=require(_0x3de6('0x0'));var util=require(_0x3de6('0x1'));var rta=require(_0x3de6('0x2'));var rtq=require(_0x3de6('0x3'));var qs=require(_0x3de6('0x4'));var utils=require(_0x3de6('0x5'));var db=require(_0x3de6('0x6'))['db'];var APIBadRequestError=require(_0x3de6('0x7'))['APIBadRequestError'];var APIHandleError=require(_0x3de6('0x7'))[_0x3de6('0x8')];function respondWithFilteredResult(_0x16caaa,_0x58ba5a){return function(_0x5a7b48){if(_0x5a7b48){var _0x38f6fd=typeof _0x58ba5a[_0x3de6('0x9')]===_0x3de6('0xa')&&typeof _0x58ba5a['limit']===_0x3de6('0xa');var _0x2c349d=_0x5a7b48[_0x3de6('0xb')];var _0x354a97=_0x38f6fd?0x0:_0x58ba5a[_0x3de6('0x9')];var _0x1c76c2=_0x38f6fd?_0x5a7b48[_0x3de6('0xb')]:_0x58ba5a[_0x3de6('0x9')]+_0x58ba5a[_0x3de6('0xc')];var _0x166aa3;if(_0x1c76c2>=_0x2c349d){_0x1c76c2=_0x2c349d;_0x166aa3=0xc8;}else{_0x166aa3=0xce;}_0x16caaa[_0x3de6('0xd')](_0x166aa3);return _0x16caaa[_0x3de6('0xe')](_0x3de6('0xf'),_0x354a97+'-'+_0x1c76c2+'/'+_0x2c349d)[_0x3de6('0x10')](_0x5a7b48);}return null;};}exports[_0x3de6('0x11')]=function(_0x54238d,_0x519396){var _0x202e69={'count':0x0,'rows':[]};var _0x538951={};var _0x3d569e;var _0x1bb3b1=utils[_0x3de6('0x12')]();var _0x4b2e12;var _0x33d764;var _0x4b8293=_0x54238d[_0x3de6('0x13')][_0x3de6('0x14')];var _0x173bda=_0x54238d[_0x3de6('0x13')]['globalStatusFilter'];var _0x8f4e71=_0x54238d[_0x3de6('0x13')]['pauseTypeFilter'];var _0x103084=_0x173bda===_0x3de6('0x15')||_0x173bda==='*pause'?!![]:![];var _0x41da4e=[];var _0x48499f;var _0xd40b2c;Promise[_0x3de6('0x16')]()[_0x3de6('0x17')](function(){if(_0x54238d['query']['channel']){if(!utils[_0x3de6('0x18')](_0x54238d[_0x3de6('0x13')]['channel'])){throw new APIBadRequestError(util[_0x3de6('0x19')](_0x3de6('0x1a'),_0x54238d['query'][_0x3de6('0x1b')]));}_0x3d569e=_0x54238d[_0x3de6('0x13')]['channel']['toLowerCase']();}if(!_0x54238d[_0x3de6('0x13')]['sort']||!_0x54238d[_0x3de6('0x13')][_0x3de6('0x1c')][_0x3de6('0x1d')](_0x3de6('0x1e'))){_0x54238d[_0x3de6('0x13')][_0x3de6('0x1c')]=rta[_0x3de6('0x1f')](_0x54238d[_0x3de6('0x13')]['sort']);return;}var _0x10f2e7=rta[_0x3de6('0x20')](_0x54238d[_0x3de6('0x13')]['sort']);_0x54238d[_0x3de6('0x13')][_0x3de6('0x1c')]=_0x10f2e7['fields'][_0x3de6('0x21')](',');_0x48499f=_0x10f2e7['order'];})['then'](function(){if(!_0x4b8293){return[];}return rta['getAgentIdsByQueues'](_0x4b8293,_0x3d569e);})[_0x3de6('0x17')](function(_0x55ea8c){_0x41da4e=_0x55ea8c;return rta[_0x3de6('0x22')]();})[_0x3de6('0x17')](function(_0x47493c){_0x33d764=_0x47493c[_0x3de6('0x23')];if((!_0x173bda||_0x103084)&&!_0x48499f){return _0x41da4e;}if(_0x48499f&&!_0x173bda){return rta[_0x3de6('0x24')](_0x33d764,_0x41da4e,_0x48499f);}else{return rta[_0x3de6('0x25')](_0x33d764,_0x41da4e,_0x173bda);}})[_0x3de6('0x17')](function(_0x1d5d83){_0x41da4e=_0x1d5d83;var _0x38528c=![];if(_0x41da4e[_0x3de6('0x26')]===0x0){if(_0x4b8293||_0x173bda){_0x38528c=!![];}if(_0x103084){_0x38528c=![];}}if(_0x38528c){return _0x202e69;}var _0x4946ce=_[_0x3de6('0x27')](db['User'][_0x3de6('0x28')],function(_0x3d3c93){return{'name':_0x3d3c93[_0x3de6('0x29')],'type':_0x3d3c93[_0x3de6('0x2a')][_0x3de6('0x2b')]};});_0x54238d[_0x3de6('0x13')][_0x3de6('0x2c')]=_0x3de6('0x2d');_0x54238d[_0x3de6('0x13')][_0x3de6('0x2e')]=!![];_0x538951=qs[_0x3de6('0x2f')](_0x4946ce,_0x54238d);_0x538951[_0x3de6('0x30')]=!![];var _0x2852c1=[];if(_0x41da4e[_0x3de6('0x26')]>0x0){_0x2852c1[_0x3de6('0x31')]({'id':{'$in':_0x41da4e}});if(_0x48499f&&!_0x173bda){_0xd40b2c=[db['sequelize'][_0x3de6('0x32')](_0x3de6('0x33')+_0x41da4e+')')];_0x538951['order']=_0xd40b2c;}}if(_0x103084){_0x1bb3b1[_0x3de6('0x34')](function(_0x2eed14){var _0x321b94=!![];if(_0x173bda===_0x3de6('0x35')&&_0x3d569e!==_0x2eed14){_0x321b94=![];}_0x2852c1['push']({[_0x2eed14+_0x3de6('0x36')]:_0x321b94});});if(_0x8f4e71){_0x2852c1[_0x3de6('0x31')]({'pauseType':_0x8f4e71});}}else if(_0x173bda){_0x1bb3b1[_0x3de6('0x34')](function(_0x480cbd){_0x2852c1[_0x3de6('0x31')]({[_0x480cbd+_0x3de6('0x36')]:![]});});}_0x538951[_0x3de6('0x37')]=_['merge'](_0x538951[_0x3de6('0x37')],{'$and':_0x2852c1});if(_0x54238d['user'][_0x3de6('0x2c')]===_0x3de6('0x38')){var _0x2c05b2={'params':{'id':_0x54238d[_0x3de6('0x38')][_0x3de6('0x39')]},'query':{'section':_0x3de6('0x3a'),'role':_0x3de6('0x2d'),'online':!![],'raw':!![],'ids':_0x41da4e,'customSorting':_0xd40b2c}};if(_0x103084){_0x2c05b2[_0x3de6('0x13')][_0x3de6('0x3b')]=_0x2852c1;}_0x2c05b2['query']=Object[_0x3de6('0x3c')](_0x2c05b2[_0x3de6('0x13')],_0x54238d['query']);delete _0x2c05b2['query']['id'];return db['UserProfile']['getResources'](_0x2c05b2);}return db['User'][_0x3de6('0x3d')](_0x538951);})[_0x3de6('0x17')](function(_0x3ec4f){_0x202e69['count']=_0x3ec4f[_0x3de6('0xb')];_0x4b2e12=_0x3ec4f[_0x3de6('0x23')];return _0x4b2e12[_0x3de6('0x27')](function(_0x232677){var _0x5969c3=_[_0x3de6('0x3e')](_0x33d764,['id',_0x232677['id']]);if(_0x5969c3){var _0x27c949=rta[_0x3de6('0x3f')](_0x5969c3);_['merge'](_0x232677,_0x27c949);}_0x232677[_0x3de6('0x1e')]=rta[_0x3de6('0x40')](_0x232677);if(_0x232677[_0x3de6('0x1e')]['includes'](_0x3de6('0x15'))){_0x1bb3b1['forEach'](function(_0xd33d81){if(_0x232677[_0xd33d81+_0x3de6('0x36')]){_0x232677[_0xd33d81+_0x3de6('0x41')]=_0x3de6('0x15');}});}return _0x232677;});})['then'](function(_0x207e26){if(!_0x48499f||_0xd40b2c){return _0x207e26;}return rta['sortAgentsByStatus'](_0x207e26,_0x48499f);})[_0x3de6('0x17')](function(_0x534935){var _0x4cc89c=null;if(_0x54238d[_0x3de6('0x13')]['fields']){var _0xd6ad49=_0x54238d[_0x3de6('0x13')][_0x3de6('0x42')]['split'](',');_0x4cc89c=_0x534935[_0x3de6('0x27')](function(_0x4f5a2d){return _[_0x3de6('0x43')](_0x4f5a2d,_0xd6ad49);});}_0x202e69[_0x3de6('0x23')]=_0x4cc89c||_0x534935;return _0x202e69;})['then'](respondWithFilteredResult(_0x519396,_0x538951))[_0x3de6('0x44')](APIHandleError(_0x519396));};exports[_0x3de6('0x45')]=function(_0x319cb6,_0x4636fc){var _0x4870e0={'count':0x0,'rows':[]};var _0x56f14d={};var _0x423887;var _0x4dcea7;var _0x44bd84;Promise[_0x3de6('0x16')]()['then'](function(){if(_0x319cb6['query']['channel']){if(!utils[_0x3de6('0x18')](_0x319cb6[_0x3de6('0x13')][_0x3de6('0x1b')])){throw new APIBadRequestError(util[_0x3de6('0x19')](_0x3de6('0x1a'),_0x319cb6[_0x3de6('0x13')][_0x3de6('0x1b')]));}_0x423887=_0x319cb6['query'][_0x3de6('0x1b')]['toLowerCase']();}var _0x1d1a99=_[_0x3de6('0x46')](_0x423887)+_0x3de6('0x47');var _0x4ab4ef=_['map'](db[_0x1d1a99][_0x3de6('0x28')],function(_0x579e12){return{'name':_0x579e12[_0x3de6('0x29')],'type':_0x579e12[_0x3de6('0x2a')]['key']};});if(!_0x319cb6[_0x3de6('0x13')][_0x3de6('0x42')]){var _0x1d902b=['id',_0x3de6('0x48')];if(_0x423887==='voice'){_0x1d902b[_0x3de6('0x31')](_0x3de6('0x2a'));if(_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')]==='outbound'){_0x1d902b[_0x3de6('0x31')]([_0x3de6('0x49'),'dialMethod']);}}_0x319cb6[_0x3de6('0x13')][_0x3de6('0x42')]=_0x1d902b[_0x3de6('0x21')](',');}_0x56f14d=qs[_0x3de6('0x2f')](_0x4ab4ef,_0x319cb6);if(_0x319cb6[_0x3de6('0x38')][_0x3de6('0x2c')]===_0x3de6('0x38')){var _0x3263f7={'params':{'id':_0x319cb6[_0x3de6('0x38')][_0x3de6('0x39')]},'query':{'section':_0x423887==='voice'&&_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')]===_0x3de6('0x4a')?_0x3de6('0x4b'):_['startCase'](_0x423887)+'Queues','type':_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')],'nolimit':!![],'sort':_0x3de6('0x48'),'filter':_0x319cb6[_0x3de6('0x13')][_0x3de6('0x4c')]}};return db[_0x3de6('0x4d')]['getResources'](_0x3263f7);}return db[_0x1d1a99][_0x3de6('0x3d')](_0x56f14d);})[_0x3de6('0x17')](function(_0x22b3f3){_0x4870e0[_0x3de6('0xb')]=_0x22b3f3['count'];_0x4dcea7=_0x22b3f3[_0x3de6('0x23')];return rtq[_0x3de6('0x4e')](_0x319cb6,_0x423887);})[_0x3de6('0x17')](function(_0x593f65){_0x44bd84=_0x593f65[_0x3de6('0x23')];return rtq[_0x3de6('0x4f')](_0x4dcea7,_0x44bd84,_0x423887,_0x319cb6[_0x3de6('0x13')][_0x3de6('0x2a')]);})[_0x3de6('0x17')](function(_0x41f5a8){_0x4870e0['rows']=_0x41f5a8;return _0x4870e0;})[_0x3de6('0x17')](respondWithFilteredResult(_0x4636fc,_0x56f14d))[_0x3de6('0x44')](APIHandleError(_0x4636fc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index f68ee75..662c64a 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(_0x5277df,_0x4f836e){var _0x34249e=function(_0x1222cf){while(--_0x1222cf){_0x5277df['push'](_0x5277df['shift']());}};_0x34249e(++_0x4f836e);}(_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(_0xcead4,_0x54dd56){var _0x3c3f91=function(_0xfe25cf){while(--_0xfe25cf){_0xcead4['push'](_0xcead4['shift']());}};_0x3c3f91(++_0x54dd56);}(_0xedd9,0xfc));var _0x9edd=function(_0x4692d7,_0x448d8e){_0x4692d7=_0x4692d7-0x0;var _0x26657a=_0xedd9[_0x4692d7];return _0x26657a;};'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 22462c9..37300ad 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 _0xe314=['exports','INTEGER','STRING','DATE'];(function(_0x1feefe,_0x2018ad){var _0x56471a=function(_0x8745df){while(--_0x8745df){_0x1feefe['push'](_0x1feefe['shift']());}};_0x56471a(++_0x2018ad);}(_0xe314,0x7c));var _0x4e31=function(_0x32b092,_0x3547aa){_0x32b092=_0x32b092-0x0;var _0x33b0ba=_0xe314[_0x32b092];return _0x33b0ba;};'use strict';var Sequelize=require('sequelize');module[_0x4e31('0x0')]={'state':{'type':Sequelize[_0x4e31('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x4e31('0x2')]},'scheduledat':{'type':Sequelize[_0x4e31('0x3')]},'uniqueid':{'type':Sequelize[_0x4e31('0x2')]},'starttime':{'type':Sequelize[_0x4e31('0x3')]},'responsetime':{'type':Sequelize[_0x4e31('0x3')]},'ringtime':{'type':Sequelize[_0x4e31('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4e31('0x2')]},'campaigntype':{'type':Sequelize[_0x4e31('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc7b3=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0x539a53,_0x389971){var _0x233052=function(_0x1b9fa8){while(--_0x1b9fa8){_0x539a53['push'](_0x539a53['shift']());}};_0x233052(++_0x389971);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc7b3[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require(_0x3c7b('0x0'));module[_0x3c7b('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3c7b('0x2')]},'scheduledat':{'type':Sequelize[_0x3c7b('0x3')]},'uniqueid':{'type':Sequelize[_0x3c7b('0x2')]},'starttime':{'type':Sequelize[_0x3c7b('0x3')]},'responsetime':{'type':Sequelize[_0x3c7b('0x3')]},'ringtime':{'type':Sequelize[_0x3c7b('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3c7b('0x2')]},'membername':{'type':Sequelize[_0x3c7b('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index c65a5d7..2af6ca8 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 _0xe2e7=['request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','moment','bluebird'];(function(_0x283549,_0x1cea15){var _0x328596=function(_0x3779a3){while(--_0x3779a3){_0x283549['push'](_0x283549['shift']());}};_0x328596(++_0x1cea15);}(_0xe2e7,0x1d0));var _0x7e2e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe2e7[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7e2e('0x0'));var util=require(_0x7e2e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7e2e('0x2'));var BPromise=require(_0x7e2e('0x3'));var rp=require(_0x7e2e('0x4'));var fs=require('fs');var path=require(_0x7e2e('0x5'));var rimraf=require(_0x7e2e('0x6'));var config=require('../../config/environment');var attributes=require(_0x7e2e('0x7'));module[_0x7e2e('0x8')]=function(_0x355f1e,_0x319b4f){return _0x355f1e[_0x7e2e('0x9')](_0x7e2e('0xa'),attributes,{'tableName':_0x7e2e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa881=['path','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x38a0e9,_0x3da515){var _0xb3472c=function(_0x388561){while(--_0x388561){_0x38a0e9['push'](_0x38a0e9['shift']());}};_0xb3472c(++_0x3da515);}(_0xa881,0x199));var _0x1a88=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa881[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1a88('0x0'));var util=require(_0x1a88('0x1'));var logger=require(_0x1a88('0x2'))(_0x1a88('0x3'));var moment=require(_0x1a88('0x4'));var BPromise=require(_0x1a88('0x5'));var rp=require(_0x1a88('0x6'));var fs=require('fs');var path=require(_0x1a88('0x7'));var rimraf=require('rimraf');var config=require(_0x1a88('0x8'));var attributes=require(_0x1a88('0x9'));module[_0x1a88('0xa')]=function(_0x5daf12,_0x501949){return _0x5daf12[_0x1a88('0xb')]('ReportAgentPreview',attributes,{'tableName':_0x1a88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index f7927f0..18579fa 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 _0xf931=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','request\x20sent','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','catch','util'];(function(_0x3fc8c0,_0x4071da){var _0x4dfb76=function(_0x4b7246){while(--_0x4b7246){_0x3fc8c0['push'](_0x3fc8c0['shift']());}};_0x4dfb76(++_0x4071da);}(_0xf931,0x1a3));var _0x1f93=function(_0x4123a0,_0x8eb7c){_0x4123a0=_0x4123a0-0x0;var _0x41643c=_0xf931[_0x4123a0];return _0x41643c;};'use strict';var _=require('lodash');var util=require(_0x1f93('0x0'));var moment=require('moment');var BPromise=require(_0x1f93('0x1'));var rs=require(_0x1f93('0x2'));var fs=require('fs');var Redis=require(_0x1f93('0x3'));var db=require(_0x1f93('0x4'))['db'];var utils=require(_0x1f93('0x5'));var logger=require(_0x1f93('0x6'))(_0x1f93('0x7'));var config=require(_0x1f93('0x8'));var jayson=require(_0x1f93('0x9'));var client=jayson[_0x1f93('0xa')][_0x1f93('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c7d1b,_0x953277,_0x3d34a6){return new BPromise(function(_0x309561,_0xd6a868){return client[_0x1f93('0xc')](_0x2c7d1b,_0x3d34a6)[_0x1f93('0xd')](function(_0x4bde25){logger[_0x1f93('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x953277,'request\x20sent');logger[_0x1f93('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x953277,'request\x20sent',JSON[_0x1f93('0x10')](_0x4bde25));if(_0x4bde25['error']){if(_0x4bde25[_0x1f93('0x11')][_0x1f93('0x12')]===0x1f4){logger[_0x1f93('0x11')](_0x1f93('0x13'),_0x953277,_0x4bde25[_0x1f93('0x11')][_0x1f93('0x14')]);return _0xd6a868(_0x4bde25['error'][_0x1f93('0x14')]);}logger[_0x1f93('0x11')](_0x1f93('0x13'),_0x953277,_0x4bde25[_0x1f93('0x11')][_0x1f93('0x14')]);return _0x309561(_0x4bde25['error'][_0x1f93('0x14')]);}else{logger[_0x1f93('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x953277,_0x1f93('0x15'));_0x309561(_0x4bde25[_0x1f93('0x16')][_0x1f93('0x14')]);}})['catch'](function(_0x1f559e){logger[_0x1f93('0x11')](_0x1f93('0x13'),_0x953277,_0x1f559e);_0xd6a868(_0x1f559e);});});}exports[_0x1f93('0x17')]=function(_0x3e7f19){var _0x2f382e=this;return new Promise(function(_0x2b80b1,_0xd3ff32){return db[_0x1f93('0x18')][_0x1f93('0x19')](_0x3e7f19[_0x1f93('0x1a')],{'raw':_0x3e7f19[_0x1f93('0x1b')]?_0x3e7f19['options'][_0x1f93('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x215e86){logger[_0x1f93('0xe')](_0x1f93('0x17'),_0x3e7f19);logger[_0x1f93('0xf')]('CreateReportAgentPreview',_0x3e7f19,JSON[_0x1f93('0x10')](_0x215e86));_0x2b80b1(_0x215e86);})[_0x1f93('0x1d')](function(_0x49def5){logger[_0x1f93('0x11')](_0x1f93('0x17'),_0x49def5['message'],_0x3e7f19);_0xd3ff32(_0x2f382e[_0x1f93('0x11')](0x1f4,_0x49def5[_0x1f93('0x14')]));});});}; \ No newline at end of file +var _0x5fdd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','info','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','moment'];(function(_0x47db1e,_0x1345a2){var _0x12983f=function(_0x1c7e2d){while(--_0x1c7e2d){_0x47db1e['push'](_0x47db1e['shift']());}};_0x12983f(++_0x1345a2);}(_0x5fdd,0x16f));var _0xd5fd=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x5fdd[_0x547456];return _0xc1fd7b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd5fd('0x0'));var BPromise=require(_0xd5fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd5fd('0x2'));var db=require(_0xd5fd('0x3'))['db'];var utils=require(_0xd5fd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd5fd('0x5'));var jayson=require(_0xd5fd('0x6'));var client=jayson[_0xd5fd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fda78,_0x3f02b1,_0x3a854f){return new BPromise(function(_0x87ca6c,_0x238700){return client['request'](_0x1fda78,_0x3a854f)[_0xd5fd('0x8')](function(_0x559dae){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0xd5fd('0x9'));logger[_0xd5fd('0xa')](_0xd5fd('0xb'),_0x3f02b1,_0xd5fd('0x9'),JSON[_0xd5fd('0xc')](_0x559dae));if(_0x559dae[_0xd5fd('0xd')]){if(_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xe')]===0x1f4){logger[_0xd5fd('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0x559dae['error'][_0xd5fd('0xf')]);return _0x238700(_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xf')]);}logger['error'](_0xd5fd('0x10'),_0x3f02b1,_0x559dae[_0xd5fd('0xd')][_0xd5fd('0xf')]);return _0x87ca6c(_0x559dae['error'][_0xd5fd('0xf')]);}else{logger[_0xd5fd('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3f02b1,_0xd5fd('0x9'));_0x87ca6c(_0x559dae['result'][_0xd5fd('0xf')]);}})[_0xd5fd('0x12')](function(_0x1b00c5){logger[_0xd5fd('0xd')](_0xd5fd('0x10'),_0x3f02b1,_0x1b00c5);_0x238700(_0x1b00c5);});});}exports[_0xd5fd('0x13')]=function(_0x50f12e){var _0x365829=this;return new Promise(function(_0x6873ae,_0x262c27){return db[_0xd5fd('0x14')]['create'](_0x50f12e[_0xd5fd('0x15')],{'raw':_0x50f12e[_0xd5fd('0x16')]?_0x50f12e[_0xd5fd('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd5fd('0x8')](function(_0xf4ed32){logger['info'](_0xd5fd('0x13'),_0x50f12e);logger['debug']('CreateReportAgentPreview',_0x50f12e,JSON[_0xd5fd('0xc')](_0xf4ed32));_0x6873ae(_0xf4ed32);})[_0xd5fd('0x12')](function(_0x21d4ad){logger['error'](_0xd5fd('0x13'),_0x21d4ad['message'],_0x50f12e);_0x262c27(_0x365829[_0xd5fd('0xd')](0x1f4,_0x21d4ad[_0xd5fd('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 67712f8..7d52ccd 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 _0xa3e7=['agentNotify','multer','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/whatsapp/queues','whatsappQueues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','agentCapacity','/trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify'];(function(_0x540b7d,_0x3ce514){var _0x3f4eda=function(_0x464dbd){while(--_0x464dbd){_0x540b7d['push'](_0x540b7d['shift']());}};_0x3f4eda(++_0x3ce514);}(_0xa3e7,0x8b));var _0x7a3e=function(_0x59ecad,_0x1abc43){_0x59ecad=_0x59ecad-0x0;var _0x2c6b32=_0xa3e7[_0x59ecad];return _0x2c6b32;};'use strict';var multer=require(_0x7a3e('0x0'));var util=require('util');var path=require('path');var express=require('express');var router=express[_0x7a3e('0x1')]();var auth=require(_0x7a3e('0x2'));var controller=require(_0x7a3e('0x3'));router['get'](_0x7a3e('0x4'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x6')]);router[_0x7a3e('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x7a3e('0x8')]);router[_0x7a3e('0x7')](_0x7a3e('0x9'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0xa')]);router[_0x7a3e('0x7')]('/voice/queues',auth['isAuthenticated'](),controller['voiceQueues']);router[_0x7a3e('0x7')](_0x7a3e('0xb'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0xc')]);router['get'](_0x7a3e('0xd'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0xe')]);router[_0x7a3e('0x7')](_0x7a3e('0xf'),auth['isAuthenticated'](),controller[_0x7a3e('0x10')]);router[_0x7a3e('0x7')](_0x7a3e('0x11'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x12')]);router['get']('/sms/queues',auth[_0x7a3e('0x5')](),controller['smsQueues']);router[_0x7a3e('0x7')](_0x7a3e('0x13'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x14')]);router[_0x7a3e('0x7')]('/fax/queues',auth[_0x7a3e('0x5')](),controller['faxQueues']);router['get'](_0x7a3e('0x15'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0x7a3e('0x7')]('/voice/queues/channels',auth[_0x7a3e('0x5')](),controller['voiceQueuesChannels']);router[_0x7a3e('0x7')]('/voice/queues/channels/:uniqueid',auth[_0x7a3e('0x5')](),controller['voiceQueuesChannel']);router[_0x7a3e('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x7a3e('0x5')](),controller['voiceQueuesChannelHangup']);router[_0x7a3e('0x7')](_0x7a3e('0x16'),auth[_0x7a3e('0x5')](),controller['voiceQueuesChannelRedirect']);router[_0x7a3e('0x7')]('/voice/queues/:id',auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x17')]);router[_0x7a3e('0x18')]('/voice/queues/:id',auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x19')]);router[_0x7a3e('0x7')](_0x7a3e('0x1a'),auth[_0x7a3e('0x5')](),controller['outbound']);router[_0x7a3e('0x7')](_0x7a3e('0x1b'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x1c')]);router[_0x7a3e('0x7')](_0x7a3e('0x1d'),auth[_0x7a3e('0x5')](),controller['agents']);router[_0x7a3e('0x18')](_0x7a3e('0x1e'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x1f')]);router[_0x7a3e('0x7')]('/telephones',auth[_0x7a3e('0x5')](),controller['telephones']);router['get'](_0x7a3e('0x20'),auth[_0x7a3e('0x5')](),controller['trunks']);router[_0x7a3e('0x7')](_0x7a3e('0x21'),auth[_0x7a3e('0x5')](),controller['campaigns']);router['get']('/fax/accounts',auth['isAuthenticated'](),controller[_0x7a3e('0x22')]);router['get'](_0x7a3e('0x23'),auth['isAuthenticated'](),controller[_0x7a3e('0x24')]);router[_0x7a3e('0x7')](_0x7a3e('0x25'),auth[_0x7a3e('0x5')](),controller['mailQueuesWaitingInteractions']);router[_0x7a3e('0x7')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x7a3e('0x26')]);router[_0x7a3e('0x7')](_0x7a3e('0x27'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x28')]);router[_0x7a3e('0x7')](_0x7a3e('0x29'),auth['isAuthenticated'](),controller[_0x7a3e('0x2a')]);router[_0x7a3e('0x7')](_0x7a3e('0x2b'),auth['isAuthenticated'](),controller[_0x7a3e('0x2c')]);router[_0x7a3e('0x7')](_0x7a3e('0x2d'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x2e')]);router[_0x7a3e('0x2f')](_0x7a3e('0x30'),auth[_0x7a3e('0x5')](),controller['queueNotify'](_0x7a3e('0x31')));router[_0x7a3e('0x7')](_0x7a3e('0x32'),auth['isAuthenticated'](),controller[_0x7a3e('0x33')]);router[_0x7a3e('0x2f')](_0x7a3e('0x34'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x35')](_0x7a3e('0x36')));router[_0x7a3e('0x7')]('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router[_0x7a3e('0x2f')](_0x7a3e('0x37'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x35')]('fax'));router[_0x7a3e('0x7')]('/fax/queues/:id',auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x38')]);router[_0x7a3e('0x2f')](_0x7a3e('0x39'),auth['isAuthenticated'](),controller[_0x7a3e('0x35')](_0x7a3e('0x3a')));router[_0x7a3e('0x7')](_0x7a3e('0x3b'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x3c')]);router[_0x7a3e('0x2f')]('/sms/queues/:id/notify',auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x35')](_0x7a3e('0x3d')));router[_0x7a3e('0x2f')](_0x7a3e('0x3e'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x35')](_0x7a3e('0x3f')));router[_0x7a3e('0x7')]('/sms/queues/:id',auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x40')]);router['get'](_0x7a3e('0x41'),auth[_0x7a3e('0x5')](),controller[_0x7a3e('0x42')]);router[_0x7a3e('0x2f')](_0x7a3e('0x43'),auth['isAuthenticated'](),controller[_0x7a3e('0x44')]);module['exports']=router; \ No newline at end of file +var _0x2c05=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/:id','put','/outbound','outbound','/outbound/channels','outboundChannels','agents','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id','post','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','Router','../../components/auth/service','./rpc.controller','get'];(function(_0x9b6d07,_0x2b840e){var _0x5b9c21=function(_0x31aa91){while(--_0x31aa91){_0x9b6d07['push'](_0x9b6d07['shift']());}};_0x5b9c21(++_0x2b840e);}(_0x2c05,0x143));var _0x52c0=function(_0x2b3dd3,_0x35a845){_0x2b3dd3=_0x2b3dd3-0x0;var _0x53436f=_0x2c05[_0x2b3dd3];return _0x53436f;};'use strict';var multer=require(_0x52c0('0x0'));var util=require(_0x52c0('0x1'));var path=require(_0x52c0('0x2'));var express=require('express');var router=express[_0x52c0('0x3')]();var auth=require(_0x52c0('0x4'));var controller=require(_0x52c0('0x5'));router[_0x52c0('0x6')](_0x52c0('0x7'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x9')]);router[_0x52c0('0x6')](_0x52c0('0xa'),auth['isAuthenticated'](),controller[_0x52c0('0xb')]);router['get'](_0x52c0('0xc'),auth[_0x52c0('0x8')](),controller['voiceChannelStopMixMonitor']);router[_0x52c0('0x6')](_0x52c0('0xd'),auth[_0x52c0('0x8')](),controller['voiceQueues']);router['get'](_0x52c0('0xe'),auth['isAuthenticated'](),controller[_0x52c0('0xf')]);router['get'](_0x52c0('0x10'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x11')]);router[_0x52c0('0x6')](_0x52c0('0x12'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x52c0('0x6')](_0x52c0('0x13'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x14')]);router[_0x52c0('0x6')](_0x52c0('0x15'),auth['isAuthenticated'](),controller['smsQueues']);router['get'](_0x52c0('0x16'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x17')]);router[_0x52c0('0x6')](_0x52c0('0x18'),auth[_0x52c0('0x8')](),controller['faxQueues']);router[_0x52c0('0x6')](_0x52c0('0x19'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x1a')]);router[_0x52c0('0x6')]('/voice/queues/channels',auth[_0x52c0('0x8')](),controller[_0x52c0('0x1b')]);router[_0x52c0('0x6')](_0x52c0('0x1c'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x1d')]);router[_0x52c0('0x6')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x52c0('0x8')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x52c0('0x6')](_0x52c0('0x1e'),auth[_0x52c0('0x8')](),controller['showVoiceQueues']);router[_0x52c0('0x1f')](_0x52c0('0x1e'),auth[_0x52c0('0x8')](),controller['updateVoiceQueue']);router[_0x52c0('0x6')](_0x52c0('0x20'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x21')]);router[_0x52c0('0x6')](_0x52c0('0x22'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x23')]);router['get']('/agents',auth[_0x52c0('0x8')](),controller[_0x52c0('0x24')]);router['put']('/agents/:id/capacity',auth[_0x52c0('0x8')](),controller['agentCapacity']);router[_0x52c0('0x6')]('/telephones',auth[_0x52c0('0x8')](),controller['telephones']);router[_0x52c0('0x6')]('/trunks',auth[_0x52c0('0x8')](),controller['trunks']);router['get'](_0x52c0('0x25'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x26')]);router[_0x52c0('0x6')](_0x52c0('0x27'),auth['isAuthenticated'](),controller[_0x52c0('0x28')]);router['get'](_0x52c0('0x29'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x2a')]);router['get']('/mail/queues/waitinginteractions',auth[_0x52c0('0x8')](),controller['mailQueuesWaitingInteractions']);router[_0x52c0('0x6')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x52c0('0x2b')]);router[_0x52c0('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0x52c0('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x52c0('0x6')]('/sms/queues/waitinginteractions',auth[_0x52c0('0x8')](),controller[_0x52c0('0x2c')]);router[_0x52c0('0x6')](_0x52c0('0x2d'),auth[_0x52c0('0x8')](),controller['whatsappQueuesWaitingInteractions']);router[_0x52c0('0x6')](_0x52c0('0x2e'),auth[_0x52c0('0x8')](),controller['faxQueuesWaitingInteractions']);router['post'](_0x52c0('0x2f'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')](_0x52c0('0x31')));router['get'](_0x52c0('0x32'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x33')]);router['post']('/chat/queues/:id/notify',auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')]('chat'));router['get'](_0x52c0('0x34'),auth[_0x52c0('0x8')](),controller['showChatQueues']);router[_0x52c0('0x35')]('/fax/queues/:id/notify',auth[_0x52c0('0x8')](),controller['queueNotify']('fax'));router[_0x52c0('0x6')](_0x52c0('0x36'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x37')]);router[_0x52c0('0x35')](_0x52c0('0x38'),auth['isAuthenticated'](),controller[_0x52c0('0x30')]('openchannel'));router[_0x52c0('0x6')]('/openchannel/queues/:id',auth[_0x52c0('0x8')](),controller[_0x52c0('0x39')]);router[_0x52c0('0x35')](_0x52c0('0x3a'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')]('sms'));router[_0x52c0('0x35')](_0x52c0('0x3b'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x30')](_0x52c0('0x3c')));router['get'](_0x52c0('0x3d'),auth[_0x52c0('0x8')](),controller['showSmsQueues']);router[_0x52c0('0x6')](_0x52c0('0x3e'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x3f')]);router['post'](_0x52c0('0x40'),auth[_0x52c0('0x8')](),controller[_0x52c0('0x41')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a8abb09..c2f1ef0 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 _0xf494=['WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','MessageId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','messageId','update','InteractionId','From','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','status','json','sendStatus','stack','name','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues'];(function(_0x64bbb9,_0x909c76){var _0x5c3707=function(_0x26ded5){while(--_0x26ded5){_0x64bbb9['push'](_0x64bbb9['shift']());}};_0x5c3707(++_0x909c76);}(_0xf494,0x1c6));var _0x4f49=function(_0xfbd7f5,_0x12d61e){_0xfbd7f5=_0xfbd7f5-0x0;var _0x164665=_0xf494[_0xfbd7f5];return _0x164665;};'use strict';var BPromise=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));var _=require(_0x4f49('0x2'));var util=require('util');var db=require(_0x4f49('0x3'))['db'];var logger=require(_0x4f49('0x4'))(_0x4f49('0x5'));var jayson=require(_0x4f49('0x6'));var amiClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232a});var mailClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232b});var routingClient=jayson[_0x4f49('0x7')][_0x4f49('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){var _0x31a725=_0x58e9a0?_0x58e9a0:amiClient;return _0x31a725[_0x4f49('0x9')](_0x42b0e8,_0x5eb186)[_0x4f49('0xa')](function(_0x174d0d){if(_0x174d0d[_0x4f49('0xb')]){if(_0x174d0d[_0x4f49('0xb')]['code']===0x1f4){return _0x327bd5(_0x174d0d[_0x4f49('0xb')][_0x4f49('0xc')]);}return _0x169c95(_0x174d0d['error'][_0x4f49('0xc')]);}else{_0x169c95(_0x174d0d['result']);}})['catch'](function(_0x4b9cd3){_0x327bd5(_0x4b9cd3);});});}function respondWithResult(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xc8;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0xd')](_0x4bf89f)[_0x4f49('0xe')](_0x1e1c37);}return _0x12527d[_0x4f49('0xf')](0x194);};}function handleError(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0x1f4;return function(_0xfdb477){logger['error'](_0xfdb477[_0x4f49('0x10')]);if(_0xfdb477[_0x4f49('0x11')]){delete _0xfdb477[_0x4f49('0x11')];}_0x1a0f1e['status'](_0x2f0131)['send'](_0xfdb477);};}function findById(_0x2f0a0d){return function(_0x2ecaaa){if(!_[_0x4f49('0x12')](_0x2f0a0d)&&!_['isNil'](_0x2ecaaa)&&!_[_0x4f49('0x12')](_0x2ecaaa[_0x4f49('0x13')])){return _[_0x4f49('0x14')](_0x2ecaaa['rows'],function(_0x5bb23b){return _0x5bb23b['id']==_0x2f0a0d;});}return null;};}exports['voiceChannels']=function(_0x47f1e8,_0xb2081a){return respondWithRpcPromise(_0x4f49('0x15'),_0x47f1e8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0xb2081a,null))['catch'](handleError(_0xb2081a,null));};exports[_0x4f49('0x17')]=function(_0x2aed27,_0x197a49){return respondWithRpcPromise(_0x4f49('0x18'),_[_0x4f49('0x19')](_0x2aed27['query'],_0x2aed27[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x197a49,null))[_0x4f49('0x1b')](handleError(_0x197a49,null));};exports['voiceChannelStopMixMonitor']=function(_0x40755e,_0x1d70a7){return respondWithRpcPromise(_0x4f49('0x1c'),_[_0x4f49('0x19')](_0x40755e[_0x4f49('0x16')],_0x40755e[_0x4f49('0x1a')]))['then'](respondWithResult(_0x1d70a7,null))['catch'](handleError(_0x1d70a7,null));};exports[_0x4f49('0x1d')]=function(_0x429de7,_0x4fedbb){return respondWithRpcPromise(_0x4f49('0x1e'),_0x429de7[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x4fedbb,null))['catch'](handleError(_0x4fedbb,null));};exports[_0x4f49('0x1f')]=function(_0x2eed1c,_0x298785){return respondWithRpcPromise(_0x4f49('0x1e'),_0x2eed1c[_0x4f49('0x16')])[_0x4f49('0xa')](findById(_0x2eed1c['params']['id']))['then'](respondWithResult(_0x298785,null))[_0x4f49('0x1b')](handleError(_0x298785,null));};exports[_0x4f49('0x20')]=function(_0x605c91,_0x560050){return respondWithRpcPromise(_0x4f49('0x21'),_[_0x4f49('0x19')](_0x605c91[_0x4f49('0x22')],_0x605c91['params']))['then'](respondWithResult(_0x560050,null))[_0x4f49('0x1b')](handleError(_0x560050,null));};exports[_0x4f49('0x23')]=function(_0x7a6ea0,_0x5e7076){return respondWithRpcPromise(_0x4f49('0x24'),_[_0x4f49('0x19')](_0x7a6ea0[_0x4f49('0x16')],_0x7a6ea0[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x5e7076,null))[_0x4f49('0x1b')](handleError(_0x5e7076,null));};exports[_0x4f49('0x25')]=function(_0x45ae19,_0x1f38d3){return respondWithRpcPromise(_0x4f49('0x26'),_0x45ae19[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f38d3,null))[_0x4f49('0x1b')](handleError(_0x1f38d3,null));};exports[_0x4f49('0x27')]=function(_0x135d17,_0x97ef98){return respondWithRpcPromise(_0x4f49('0x28'),_[_0x4f49('0x19')](_0x135d17[_0x4f49('0x16')],_0x135d17['params']))[_0x4f49('0xa')](respondWithResult(_0x97ef98,null))[_0x4f49('0x1b')](handleError(_0x97ef98,null));};exports[_0x4f49('0x29')]=function(_0x1cb3cc,_0x1c3af8){return respondWithRpcPromise(_0x4f49('0x2a'),_[_0x4f49('0x19')](_0x1cb3cc[_0x4f49('0x16')],_0x1cb3cc[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x1c3af8,null))[_0x4f49('0x1b')](handleError(_0x1c3af8,null));};exports[_0x4f49('0x2b')]=function(_0x3ec6c4,_0x4d2d57){return respondWithRpcPromise(_0x4f49('0x2c'),_[_0x4f49('0x19')](_0x3ec6c4[_0x4f49('0x16')],_0x3ec6c4[_0x4f49('0x1a')]))[_0x4f49('0xa')](respondWithResult(_0x4d2d57,null))[_0x4f49('0x1b')](handleError(_0x4d2d57,null));};exports[_0x4f49('0x2d')]=function(_0x25fdf8,_0x10bfc4){return respondWithRpcPromise(_0x4f49('0x2e'),_0x25fdf8[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x10bfc4,null))[_0x4f49('0x1b')](handleError(_0x10bfc4,null));};exports[_0x4f49('0x2f')]=function(_0x4e3f72,_0x802f20){return respondWithRpcPromise(_0x4f49('0x30'),_0x4e3f72['query'])[_0x4f49('0xa')](respondWithResult(_0x802f20,null))[_0x4f49('0x1b')](handleError(_0x802f20,null));};exports['agents']=function(_0x29e762,_0x1dd1a6){var _0x2548ad;return respondWithRpcPromise(_0x4f49('0x31'),_0x29e762[_0x4f49('0x16')])[_0x4f49('0xa')](function(_0x29e910){_0x2548ad=_0x29e910;return respondWithRpcPromise('Agents',_0x29e762['query'],routingClient);})['then'](function(_0x15e4b3){return _[_0x4f49('0x19')]({},_0x15e4b3,_0x2548ad);})[_0x4f49('0xa')](respondWithResult(_0x1dd1a6,null))[_0x4f49('0x1b')](handleError(_0x1dd1a6,null));};exports[_0x4f49('0x32')]=function(_0x1ecf6c,_0x38aff8){if(_0x1ecf6c[_0x4f49('0x22')]&&_0x1ecf6c[_0x4f49('0x22')]['interaction']&&_0x1ecf6c['user']&&_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]){for(var _0x159642 in _0x1ecf6c['body'][_0x4f49('0x34')]){if(_0x1ecf6c['body']['interaction'][_0x4f49('0x35')](_0x159642)){db[_0x4f49('0x36')][_0x4f49('0x37')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'exitAt':null,'uniqueid':_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642]&&_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')]?{'$notIn':_0x1ecf6c[_0x4f49('0x22')]['interaction'][_0x159642]}:{'$ne':null}}})[_0x4f49('0xa')](function(_0x1e5f0b){var _0x33bb04=moment()[_0x4f49('0x3a')](_0x4f49('0x3b'));for(var _0x1c41e4=0x0,_0xe66867=_0x1e5f0b[_0x4f49('0x39')];_0x1c41e4<_0xe66867;_0x1c41e4+=0x1){_0x1e5f0b[_0x1c41e4][_0x4f49('0x3c')]({'exitAt':_0x33bb04});}});for(var _0x157a55=0x0;_0x157a55<_0x1ecf6c['body'][_0x4f49('0x34')][_0x159642][_0x4f49('0x39')];_0x157a55+=0x1){db['MemberReport'][_0x4f49('0x3d')]({'where':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'type':_0x4f49('0x38'),'uniqueid':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x34')][_0x159642][_0x157a55],'exitAt':null},'defaults':{'channel':_0x159642,'membername':_0x1ecf6c['user'][_0x4f49('0x11')],'interface':_[_0x4f49('0x12')](_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')])?util[_0x4f49('0x3a')](_0x4f49('0x3f'),_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x11')]):_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x3e')],'type':_0x4f49('0x38'),'enterAt':moment()[_0x4f49('0x3a')](_0x4f49('0x3b')),'role':_0x4f49('0x40'),'internal':_0x1ecf6c[_0x4f49('0x33')][_0x4f49('0x41')],'uniqueid':_0x1ecf6c['body']['interaction'][_0x159642][_0x157a55]}});}}}}return respondWithRpcPromise(_0x4f49('0x42'),{'id':_0x1ecf6c[_0x4f49('0x1a')]['id'],'capacity':_0x1ecf6c[_0x4f49('0x22')][_0x4f49('0x43')]},routingClient)[_0x4f49('0xa')](respondWithResult(_0x38aff8,null))[_0x4f49('0x1b')](handleError(_0x38aff8,null));};exports[_0x4f49('0x44')]=function(_0x51c756,_0x6637f4){return respondWithRpcPromise('Telephones',_0x51c756[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x6637f4,null))[_0x4f49('0x1b')](handleError(_0x6637f4,null));};exports[_0x4f49('0x45')]=function(_0x586095,_0x342980){return respondWithRpcPromise('Trunks',_0x586095['query'])[_0x4f49('0xa')](respondWithResult(_0x342980,null))[_0x4f49('0x1b')](handleError(_0x342980,null));};exports[_0x4f49('0x46')]=function(_0x26ae33,_0x56375a){return respondWithRpcPromise('Campaigns',_0x26ae33[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x56375a,null))['catch'](handleError(_0x56375a,null));};exports[_0x4f49('0x47')]=function(_0x5b50bc,_0x5a929a){return respondWithRpcPromise(_0x4f49('0x48'),_0x5b50bc['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5a929a,null))['catch'](handleError(_0x5a929a,null));};exports[_0x4f49('0x49')]=function(_0x38a640,_0x2472c9){return respondWithRpcPromise(_0x4f49('0x48'),_0x38a640[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x38a640[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x2472c9,null))['catch'](handleError(_0x2472c9,null));};exports[_0x4f49('0x4a')]=function(_0x51f57e,_0x213608){return respondWithRpcPromise(_0x4f49('0x4b'),_0x51f57e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x213608,null))[_0x4f49('0x1b')](handleError(_0x213608,null));};exports[_0x4f49('0x4c')]=function(_0x553981,_0x426c50){return respondWithRpcPromise(_0x4f49('0x4b'),_0x553981['query'],routingClient)['then'](findById(_0x553981[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x426c50,null))[_0x4f49('0x1b')](handleError(_0x426c50,null));};exports[_0x4f49('0x4d')]=function(_0x19a788,_0x4af08d){return respondWithRpcPromise(_0x4f49('0x4e'),_0x19a788['query'],mailClient)[_0x4f49('0xa')](respondWithResult(_0x4af08d,null))[_0x4f49('0x1b')](handleError(_0x4af08d,null));};exports[_0x4f49('0x4f')]=function(_0x4aae7c,_0x1dade6){return respondWithRpcPromise(_0x4f49('0x50'),_0x4aae7c[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x1dade6,null))['catch'](handleError(_0x1dade6,null));};exports[_0x4f49('0x51')]=function(_0x269564,_0x5e6898){return respondWithRpcPromise(_0x4f49('0x50'),_0x269564[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x269564[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x5e6898,null))[_0x4f49('0x1b')](handleError(_0x5e6898,null));};exports[_0x4f49('0x52')]=function(_0x30fc21,_0x519721){return respondWithRpcPromise(_0x4f49('0x53'),_0x30fc21[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x519721,null))[_0x4f49('0x1b')](handleError(_0x519721,null));};exports[_0x4f49('0x54')]=function(_0x26b022,_0x335875){return respondWithRpcPromise('SmsQueues',_0x26b022[_0x4f49('0x16')],routingClient)['then'](findById(_0x26b022[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x335875,null))[_0x4f49('0x1b')](handleError(_0x335875,null));};exports[_0x4f49('0x55')]=function(_0xc7743e,_0x3f2f3f){return respondWithRpcPromise(_0x4f49('0x56'),_0xc7743e[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x3f2f3f,null))[_0x4f49('0x1b')](handleError(_0x3f2f3f,null));};exports['showWhatsappQueues']=function(_0x2f9f2e,_0x141554){return respondWithRpcPromise(_0x4f49('0x56'),_0x2f9f2e[_0x4f49('0x16')],routingClient)['then'](findById(_0x2f9f2e['params']['id']))[_0x4f49('0xa')](respondWithResult(_0x141554,null))['catch'](handleError(_0x141554,null));};exports[_0x4f49('0x57')]=function(_0x287705,_0x43bdde){return respondWithRpcPromise(_0x4f49('0x58'),_0x287705[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x43bdde,null))[_0x4f49('0x1b')](handleError(_0x43bdde,null));};exports[_0x4f49('0x59')]=function(_0x3823f0,_0x3e9b47){return respondWithRpcPromise(_0x4f49('0x58'),_0x3823f0[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](findById(_0x3823f0[_0x4f49('0x1a')]['id']))[_0x4f49('0xa')](respondWithResult(_0x3e9b47,null))[_0x4f49('0x1b')](handleError(_0x3e9b47,null));};exports[_0x4f49('0x5a')]=function(_0x753863,_0x1f9161){return respondWithRpcPromise(_0x4f49('0x5b'),_0x753863[_0x4f49('0x16')])[_0x4f49('0xa')](respondWithResult(_0x1f9161,null))[_0x4f49('0x1b')](handleError(_0x1f9161,null));};exports[_0x4f49('0x5c')]=function(_0x2d0990,_0x49a79d){return respondWithRpcPromise(_0x4f49('0x5d'),_0x2d0990['query'],routingClient)[_0x4f49('0xa')](respondWithResult(_0x49a79d,null))[_0x4f49('0x1b')](handleError(_0x49a79d,null));};exports[_0x4f49('0x5e')]=function(_0x3c0f69,_0x26de18){return respondWithRpcPromise(_0x4f49('0x5f'),_0x3c0f69[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x26de18,null))[_0x4f49('0x1b')](handleError(_0x26de18,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x4b6ef4,_0x539e21){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4b6ef4[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x539e21,null))[_0x4f49('0x1b')](handleError(_0x539e21,null));};exports[_0x4f49('0x60')]=function(_0x1fc88a,_0x5a8b1c){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x1fc88a[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](function(_0x4bdd1b){if(_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')]!==undefined){var _0x5c824f=_(_0x4bdd1b[_0x4f49('0x13')])['filter']([_0x1fc88a[_0x4f49('0x16')][_0x4f49('0x61')],_0x1fc88a['params']['id']])[_0x4f49('0x62')](_0x4f49('0x63'))[_0x4f49('0x64')]()[_0x4f49('0x65')]();return _0x4bdd1b[_0x4f49('0x13')][_0x4f49('0x66')](function(_0x5f0dbf){return _0x5c824f[_0x4f49('0x67')](_0x5f0dbf['queue_id'])>-0x1;});}else{return _0x4bdd1b[_0x4f49('0x13')]['filter'](function(_0x50c06e){return _0x50c06e['queue_id']===parseInt(_0x1fc88a[_0x4f49('0x1a')]['id']);});}})[_0x4f49('0xa')](respondWithResult(_0x5a8b1c,null))[_0x4f49('0x1b')](handleError(_0x5a8b1c,null));};exports[_0x4f49('0x68')]=function(_0x47af99,_0x39024d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x47af99[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x39024d,null))[_0x4f49('0x1b')](handleError(_0x39024d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x4938a6,_0x329a49){return respondWithRpcPromise(_0x4f49('0x69'),_0x4938a6[_0x4f49('0x16')],routingClient)['then'](respondWithResult(_0x329a49,null))[_0x4f49('0x1b')](handleError(_0x329a49,null));};exports[_0x4f49('0x6a')]=function(_0x5c33c9,_0x5d52ae){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5c33c9[_0x4f49('0x16')],routingClient)[_0x4f49('0xa')](respondWithResult(_0x5d52ae,null))[_0x4f49('0x1b')](handleError(_0x5d52ae,null));};exports[_0x4f49('0x6b')]=function(_0x1643fc){return function(_0x517144,_0x15b7e4){var _0x1b922e,_0x29de92;var _0x58d07e=_[_0x4f49('0x6c')](_0x1643fc);var _0x34843a=_0x1643fc===_0x4f49('0x6d')?_0x4f49('0x6e'):'Account';return db[_0x58d07e+_0x4f49('0x6f')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x517144[_0x4f49('0x1a')]['id']}})[_0x4f49('0xa')](function(_0x389679){if(_['isNil'](_0x389679)){throw new Error(_0x58d07e+_0x4f49('0x71'));}_0x1b922e=_0x389679;return db[_0x58d07e+_0x4f49('0x72')]['findOne']({'where':{'id':_0x517144[_0x4f49('0x22')]['messageId']},'include':[{'model':db[_0x58d07e+_0x4f49('0x73')],'as':'Interaction'},{'model':db[_0x58d07e+_0x34843a],'as':_0x4f49('0x74')}]});})[_0x4f49('0xa')](function(_0x2ef19e){if(_[_0x4f49('0x12')](_0x2ef19e)){throw new Error(_0x58d07e+_0x4f49('0x75'));}_0x29de92=_0x2ef19e;return _0x2ef19e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x4f49('0xa')](function(){var _0x1f3556={'uniqueid':_0x1643fc+'.'+_0x29de92['id']+'.'+_0x29de92[_0x4f49('0x73')]['id'],'FromUserId':_0x517144[_0x4f49('0x33')]['id'],'type':'queue'};_0x1f3556[_0x58d07e+_0x4f49('0x76')]=_0x29de92['id'];_0x1f3556[_0x58d07e+'InteractionId']=_0x29de92[_0x4f49('0x73')]['id'];_0x1f3556['From'+_0x58d07e+_0x34843a+'Id']=_0x29de92[_0x4f49('0x74')]['id'];_0x1f3556['To'+_0x58d07e+_0x4f49('0x77')]=_0x1b922e['id'];return db[_0x58d07e+_0x4f49('0x78')][_0x4f49('0x79')](_0x1f3556);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x1643fc,'interaction':_0x29de92[_0x4f49('0x73')],'message':_0x29de92,'account':_0x29de92[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':_0x4f49('0x7b'),'appdata':_0x1b922e[_0x4f49('0x11')]+','+(_0x29de92['Account'][_0x4f49('0x7c')]||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x15b7e4,null))[_0x4f49('0x1b')](handleError(_0x15b7e4,null));};};exports[_0x4f49('0x7e')]=function(_0x24b033,_0x55b28b){var _0x2ec42b,_0x20a0d4;if(_[_0x4f49('0x12')](_0x24b033[_0x4f49('0x22')]['channel'])){throw new Error(_0x4f49('0x7f'));}var _0x57567a=_0x24b033[_0x4f49('0x22')][_0x4f49('0x80')];var _0x5c5d2=_[_0x4f49('0x6c')](_0x57567a);var _0x4cfb48=_0x57567a===_0x4f49('0x6d')?_0x4f49('0x6e'):_0x4f49('0x74');return db[_0x4f49('0x81')][_0x4f49('0x70')]({'raw':!![],'where':{'id':_0x24b033[_0x4f49('0x1a')]['id'],'role':_0x4f49('0x40')}})[_0x4f49('0xa')](function(_0x355787){if(_[_0x4f49('0x12')](_0x355787)){throw new Error(_0x4f49('0x82'));}_0x2ec42b=_0x355787;return db[_0x5c5d2+_0x4f49('0x72')][_0x4f49('0x70')]({'where':{'id':_0x24b033[_0x4f49('0x22')][_0x4f49('0x83')]},'include':[{'model':db[_0x5c5d2+_0x4f49('0x73')],'as':_0x4f49('0x73')},{'model':db[_0x5c5d2+_0x4cfb48],'as':_0x4f49('0x74')}]});})['then'](function(_0x1979ef){if(_[_0x4f49('0x12')](_0x1979ef)){throw new Error(_0x5c5d2+_0x4f49('0x75'));}_0x20a0d4=_0x1979ef;return _0x1979ef[_0x4f49('0x84')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x225e63={'uniqueid':_0x57567a+'.'+_0x20a0d4['id']+'.'+_0x20a0d4[_0x4f49('0x73')]['id'],'FromUserId':_0x24b033['user']['id'],'type':_0x4f49('0x7b'),'ToUserId':_0x2ec42b['id']};_0x225e63[_0x5c5d2+'MessageId']=_0x20a0d4['id'];_0x225e63[_0x5c5d2+_0x4f49('0x85')]=_0x20a0d4[_0x4f49('0x73')]['id'];_0x225e63[_0x4f49('0x86')+_0x5c5d2+_0x4cfb48+'Id']=_0x20a0d4[_0x4f49('0x74')]['id'];return db[_0x5c5d2+_0x4f49('0x78')][_0x4f49('0x79')](_0x225e63);})[_0x4f49('0xa')](function(){return respondWithRpcPromise(_0x4f49('0x7a'),{'channel':_0x57567a,'interaction':_0x20a0d4[_0x4f49('0x73')],'message':_0x20a0d4,'account':_0x20a0d4[_0x4f49('0x74')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2ec42b['name']+','+(_0x20a0d4[_0x4f49('0x74')]['agentTransferTimeout']||0x12c),'interval':_0x4f49('0x7d')}]},routingClient);})[_0x4f49('0xa')](respondWithResult(_0x55b28b,null))['catch'](handleError(_0x55b28b,null));}; \ No newline at end of file +var _0xe14b=['MessageId','InteractionId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','agent','Agent\x20not\x20found','Message','update','From','bluebird','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found'];(function(_0x38c80f,_0x9b0c12){var _0x3d8954=function(_0x45059c){while(--_0x45059c){_0x38c80f['push'](_0x38c80f['shift']());}};_0x3d8954(++_0x9b0c12);}(_0xe14b,0x93));var _0xbe14=function(_0x4765a7,_0x2e2248){_0x4765a7=_0x4765a7-0x0;var _0xd05e90=_0xe14b[_0x4765a7];return _0xd05e90;};'use strict';var BPromise=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xbe14('0x2'))['db'];var logger=require(_0xbe14('0x3'))('api');var jayson=require(_0xbe14('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232b});var routingClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){var _0x496063=_0x196fca?_0x196fca:amiClient;return _0x496063[_0xbe14('0x7')](_0x1d9ade,_0x39387e)[_0xbe14('0x8')](function(_0xd68cd7){if(_0xd68cd7[_0xbe14('0x9')]){if(_0xd68cd7['error']['code']===0x1f4){return _0x50f909(_0xd68cd7[_0xbe14('0x9')][_0xbe14('0xa')]);}return _0x566ae7(_0xd68cd7['error'][_0xbe14('0xa')]);}else{_0x566ae7(_0xd68cd7[_0xbe14('0xb')]);}})[_0xbe14('0xc')](function(_0x3d38c2){_0x50f909(_0x3d38c2);});});}function respondWithResult(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xc8;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0xd')](_0x3b898d)[_0xbe14('0xe')](_0x23a730);}return _0x27792f[_0xbe14('0xf')](0x194);};}function handleError(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0x1f4;return function(_0x813399){logger['error'](_0x813399['stack']);if(_0x813399[_0xbe14('0x10')]){delete _0x813399[_0xbe14('0x10')];}_0x1e4826[_0xbe14('0xd')](_0x33fd54)[_0xbe14('0x11')](_0x813399);};}function findById(_0x4e8f34){return function(_0x21c789){if(!_[_0xbe14('0x12')](_0x4e8f34)&&!_[_0xbe14('0x12')](_0x21c789)&&!_[_0xbe14('0x12')](_0x21c789[_0xbe14('0x13')])){return _[_0xbe14('0x14')](_0x21c789[_0xbe14('0x13')],function(_0x5ea1f8){return _0x5ea1f8['id']==_0x4e8f34;});}return null;};}exports[_0xbe14('0x15')]=function(_0x456ca8,_0x329588){return respondWithRpcPromise(_0xbe14('0x16'),_0x456ca8[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x329588,null))['catch'](handleError(_0x329588,null));};exports[_0xbe14('0x18')]=function(_0x4a1bbd,_0x417c8d){return respondWithRpcPromise(_0xbe14('0x19'),_[_0xbe14('0x1a')](_0x4a1bbd['query'],_0x4a1bbd[_0xbe14('0x1b')]))['then'](respondWithResult(_0x417c8d,null))[_0xbe14('0xc')](handleError(_0x417c8d,null));};exports['voiceChannelStopMixMonitor']=function(_0x32e8eb,_0x4a25fa){return respondWithRpcPromise(_0xbe14('0x1c'),_[_0xbe14('0x1a')](_0x32e8eb['query'],_0x32e8eb[_0xbe14('0x1b')]))['then'](respondWithResult(_0x4a25fa,null))[_0xbe14('0xc')](handleError(_0x4a25fa,null));};exports['voiceQueues']=function(_0x36a21e,_0x5fa043){return respondWithRpcPromise(_0xbe14('0x1d'),_0x36a21e[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x5fa043,null))[_0xbe14('0xc')](handleError(_0x5fa043,null));};exports['showVoiceQueues']=function(_0x1822e0,_0x1ba46a){return respondWithRpcPromise(_0xbe14('0x1d'),_0x1822e0[_0xbe14('0x17')])['then'](findById(_0x1822e0[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x1ba46a,null))['catch'](handleError(_0x1ba46a,null));};exports[_0xbe14('0x1e')]=function(_0x3b3e84,_0x1c7cc7){return respondWithRpcPromise(_0xbe14('0x1f'),_[_0xbe14('0x1a')](_0x3b3e84[_0xbe14('0x20')],_0x3b3e84[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x1c7cc7,null))[_0xbe14('0xc')](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x21')]=function(_0x40538f,_0x3bf43c){return respondWithRpcPromise(_0xbe14('0x22'),_[_0xbe14('0x1a')](_0x40538f[_0xbe14('0x17')],_0x40538f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x3bf43c,null))[_0xbe14('0xc')](handleError(_0x3bf43c,null));};exports[_0xbe14('0x23')]=function(_0x14e7c4,_0x581e86){return respondWithRpcPromise(_0xbe14('0x24'),_0x14e7c4['query'])['then'](respondWithResult(_0x581e86,null))[_0xbe14('0xc')](handleError(_0x581e86,null));};exports['voiceQueuesChannel']=function(_0x243524,_0x345b0){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x243524['query'],_0x243524[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x345b0,null))['catch'](handleError(_0x345b0,null));};exports[_0xbe14('0x25')]=function(_0x1faf3e,_0x452635){return respondWithRpcPromise(_0xbe14('0x26'),_[_0xbe14('0x1a')](_0x1faf3e['query'],_0x1faf3e['params']))[_0xbe14('0x8')](respondWithResult(_0x452635,null))['catch'](handleError(_0x452635,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c5e9f,_0x163ef7){return respondWithRpcPromise(_0xbe14('0x27'),_[_0xbe14('0x1a')](_0x5c5e9f[_0xbe14('0x17')],_0x5c5e9f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x163ef7,null))[_0xbe14('0xc')](handleError(_0x163ef7,null));};exports[_0xbe14('0x28')]=function(_0x2d9c12,_0x2dfd5a){return respondWithRpcPromise(_0xbe14('0x29'),_0x2d9c12[_0xbe14('0x17')])['then'](respondWithResult(_0x2dfd5a,null))['catch'](handleError(_0x2dfd5a,null));};exports[_0xbe14('0x2a')]=function(_0x2951e1,_0x13bfcf){return respondWithRpcPromise('OutboundChannels',_0x2951e1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x13bfcf,null))[_0xbe14('0xc')](handleError(_0x13bfcf,null));};exports[_0xbe14('0x2b')]=function(_0x3bd454,_0x25ee1f){var _0x19fa30;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')])['then'](function(_0xe51424){_0x19fa30=_0xe51424;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')],routingClient);})[_0xbe14('0x8')](function(_0x3287b9){return _[_0xbe14('0x1a')]({},_0x3287b9,_0x19fa30);})['then'](respondWithResult(_0x25ee1f,null))[_0xbe14('0xc')](handleError(_0x25ee1f,null));};exports[_0xbe14('0x2d')]=function(_0x1220c9,_0x36263c){if(_0x1220c9['body']&&_0x1220c9['body'][_0xbe14('0x2e')]&&_0x1220c9[_0xbe14('0x2f')]&&_0x1220c9[_0xbe14('0x2f')]['name']){for(var _0x5d5318 in _0x1220c9[_0xbe14('0x20')]['interaction']){if(_0x1220c9['body'][_0xbe14('0x2e')][_0xbe14('0x30')](_0x5d5318)){db[_0xbe14('0x31')]['findAll']({'where':{'channel':_0x5d5318,'membername':_0x1220c9['user']['name'],'type':_0xbe14('0x32'),'exitAt':null,'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]&&_0x1220c9['body'][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')]?{'$notIn':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]}:{'$ne':null}}})['then'](function(_0x4a1a4b){var _0x3e2fd3=moment()[_0xbe14('0x34')](_0xbe14('0x35'));for(var _0xb2b285=0x0,_0x2550dc=_0x4a1a4b['length'];_0xb2b285<_0x2550dc;_0xb2b285+=0x1){_0x4a1a4b[_0xb2b285]['updateAttributes']({'exitAt':_0x3e2fd3});}});for(var _0x46af81=0x0;_0x46af81<_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')];_0x46af81+=0x1){db['MemberReport'][_0xbe14('0x36')]({'where':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'type':_0xbe14('0x32'),'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81],'exitAt':null},'defaults':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'interface':_['isNil'](_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')])?util['format']('SIP/%s',_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x10')]):_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')],'type':_0xbe14('0x32'),'enterAt':moment()[_0xbe14('0x34')](_0xbe14('0x35')),'role':'agent','internal':_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x38')],'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81]}});}}}}return respondWithRpcPromise(_0xbe14('0x39'),{'id':_0x1220c9['params']['id'],'capacity':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x3a')]},routingClient)[_0xbe14('0x8')](respondWithResult(_0x36263c,null))[_0xbe14('0xc')](handleError(_0x36263c,null));};exports[_0xbe14('0x3b')]=function(_0x2dbeb1,_0x505829){return respondWithRpcPromise('Telephones',_0x2dbeb1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x505829,null))[_0xbe14('0xc')](handleError(_0x505829,null));};exports['trunks']=function(_0x497b00,_0x44fe0d){return respondWithRpcPromise(_0xbe14('0x3c'),_0x497b00['query'])[_0xbe14('0x8')](respondWithResult(_0x44fe0d,null))[_0xbe14('0xc')](handleError(_0x44fe0d,null));};exports['campaigns']=function(_0x28f995,_0x4a40d2){return respondWithRpcPromise(_0xbe14('0x3d'),_0x28f995[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x4a40d2,null))['catch'](handleError(_0x4a40d2,null));};exports[_0xbe14('0x3e')]=function(_0x404212,_0x5dc78a){return respondWithRpcPromise(_0xbe14('0x3f'),_0x404212[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x5dc78a,null))[_0xbe14('0xc')](handleError(_0x5dc78a,null));};exports[_0xbe14('0x40')]=function(_0x4f06a3,_0x42a346){return respondWithRpcPromise(_0xbe14('0x3f'),_0x4f06a3[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x4f06a3[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x42a346,null))[_0xbe14('0xc')](handleError(_0x42a346,null));};exports['mailQueues']=function(_0x72c875,_0x1b47a4){return respondWithRpcPromise(_0xbe14('0x41'),_0x72c875[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1b47a4,null))[_0xbe14('0xc')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x42')]=function(_0x32df3c,_0x285b6e){return respondWithRpcPromise(_0xbe14('0x41'),_0x32df3c[_0xbe14('0x17')],routingClient)['then'](findById(_0x32df3c['params']['id']))['then'](respondWithResult(_0x285b6e,null))[_0xbe14('0xc')](handleError(_0x285b6e,null));};exports[_0xbe14('0x43')]=function(_0x2f4e52,_0xf79b21){return respondWithRpcPromise(_0xbe14('0x44'),_0x2f4e52[_0xbe14('0x17')],mailClient)[_0xbe14('0x8')](respondWithResult(_0xf79b21,null))[_0xbe14('0xc')](handleError(_0xf79b21,null));};exports[_0xbe14('0x45')]=function(_0x451b0b,_0x603816){return respondWithRpcPromise(_0xbe14('0x46'),_0x451b0b[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x603816,null))[_0xbe14('0xc')](handleError(_0x603816,null));};exports[_0xbe14('0x47')]=function(_0x179077,_0x2225d9){return respondWithRpcPromise(_0xbe14('0x46'),_0x179077[_0xbe14('0x17')],routingClient)['then'](findById(_0x179077[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x2225d9,null))[_0xbe14('0xc')](handleError(_0x2225d9,null));};exports[_0xbe14('0x48')]=function(_0x3ee6b7,_0x222944){return respondWithRpcPromise(_0xbe14('0x49'),_0x3ee6b7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x222944,null))[_0xbe14('0xc')](handleError(_0x222944,null));};exports['showSmsQueues']=function(_0x18be56,_0x442ec4){return respondWithRpcPromise(_0xbe14('0x49'),_0x18be56[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x18be56['params']['id']))[_0xbe14('0x8')](respondWithResult(_0x442ec4,null))[_0xbe14('0xc')](handleError(_0x442ec4,null));};exports[_0xbe14('0x4a')]=function(_0xd4e1c7,_0x46ac9c){return respondWithRpcPromise('WhatsappQueues',_0xd4e1c7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x46ac9c,null))[_0xbe14('0xc')](handleError(_0x46ac9c,null));};exports[_0xbe14('0x4b')]=function(_0xaebce8,_0x289c4d){return respondWithRpcPromise(_0xbe14('0x4c'),_0xaebce8[_0xbe14('0x17')],routingClient)['then'](findById(_0xaebce8[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x289c4d,null))[_0xbe14('0xc')](handleError(_0x289c4d,null));};exports[_0xbe14('0x4d')]=function(_0x5982b7,_0xa4b2a3){return respondWithRpcPromise(_0xbe14('0x4e'),_0x5982b7['query'],routingClient)['then'](respondWithResult(_0xa4b2a3,null))[_0xbe14('0xc')](handleError(_0xa4b2a3,null));};exports[_0xbe14('0x4f')]=function(_0x2d2643,_0x2510a0){return respondWithRpcPromise(_0xbe14('0x4e'),_0x2d2643[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x2d2643[_0xbe14('0x1b')]['id']))['then'](respondWithResult(_0x2510a0,null))['catch'](handleError(_0x2510a0,null));};exports[_0xbe14('0x50')]=function(_0x1c18b6,_0x29aa52){return respondWithRpcPromise('FaxAccounts',_0x1c18b6[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x29aa52,null))[_0xbe14('0xc')](handleError(_0x29aa52,null));};exports[_0xbe14('0x51')]=function(_0x468e9f,_0x1ef09b){return respondWithRpcPromise(_0xbe14('0x52'),_0x468e9f['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1ef09b,null))[_0xbe14('0xc')](handleError(_0x1ef09b,null));};exports[_0xbe14('0x53')]=function(_0x3afc5a,_0x469555){return respondWithRpcPromise(_0xbe14('0x54'),_0x3afc5a[_0xbe14('0x17')],routingClient)['then'](respondWithResult(_0x469555,null))[_0xbe14('0xc')](handleError(_0x469555,null));};exports[_0xbe14('0x55')]=function(_0x3cd17e,_0x1c0932){return respondWithRpcPromise(_0xbe14('0x56'),_0x3cd17e[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1c0932,null))[_0xbe14('0xc')](handleError(_0x1c0932,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x1e5ce1,_0x401968){return respondWithRpcPromise(_0xbe14('0x56'),_0x1e5ce1[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](function(_0x17576b){if(_0x1e5ce1['query'][_0xbe14('0x57')]!==undefined){var _0x175213=_(_0x17576b[_0xbe14('0x13')])[_0xbe14('0x58')]([_0x1e5ce1['query'][_0xbe14('0x57')],_0x1e5ce1[_0xbe14('0x1b')]['id']])[_0xbe14('0x59')](_0xbe14('0x5a'))[_0xbe14('0x5b')]()[_0xbe14('0x5c')]();return _0x17576b[_0xbe14('0x13')]['filter'](function(_0x70ed08){return _0x175213['indexOf'](_0x70ed08[_0xbe14('0x5a')])>-0x1;});}else{return _0x17576b['rows'][_0xbe14('0x58')](function(_0x21837c){return _0x21837c[_0xbe14('0x5a')]===parseInt(_0x1e5ce1['params']['id']);});}})[_0xbe14('0x8')](respondWithResult(_0x401968,null))[_0xbe14('0xc')](handleError(_0x401968,null));};exports[_0xbe14('0x5d')]=function(_0x546f22,_0x41a896){return respondWithRpcPromise(_0xbe14('0x5e'),_0x546f22[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x41a896,null))['catch'](handleError(_0x41a896,null));};exports[_0xbe14('0x5f')]=function(_0x39bc54,_0x34f90b){return respondWithRpcPromise(_0xbe14('0x60'),_0x39bc54[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x34f90b,null))[_0xbe14('0xc')](handleError(_0x34f90b,null));};exports['faxQueuesWaitingInteractions']=function(_0x2ff94c,_0x123f4f){return respondWithRpcPromise(_0xbe14('0x61'),_0x2ff94c['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x123f4f,null))[_0xbe14('0xc')](handleError(_0x123f4f,null));};exports[_0xbe14('0x62')]=function(_0x5bc52b){return function(_0xa53262,_0x1205d1){var _0x47d7bb,_0x2be969;var _0x49990b=_[_0xbe14('0x63')](_0x5bc52b);var _0x337073=_0x5bc52b==='chat'?'Website':_0xbe14('0x64');return db[_0x49990b+_0xbe14('0x65')][_0xbe14('0x66')]({'raw':!![],'where':{'id':_0xa53262['params']['id']}})[_0xbe14('0x8')](function(_0x30c03b){if(_[_0xbe14('0x12')](_0x30c03b)){throw new Error(_0x49990b+_0xbe14('0x67'));}_0x47d7bb=_0x30c03b;return db[_0x49990b+'Message']['findOne']({'where':{'id':_0xa53262[_0xbe14('0x20')][_0xbe14('0x68')]},'include':[{'model':db[_0x49990b+_0xbe14('0x69')],'as':_0xbe14('0x69')},{'model':db[_0x49990b+_0x337073],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x139aab){if(_['isNil'](_0x139aab)){throw new Error(_0x49990b+_0xbe14('0x6a'));}_0x2be969=_0x139aab;return _0x139aab['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x3a01bb={'uniqueid':_0x5bc52b+'.'+_0x2be969['id']+'.'+_0x2be969[_0xbe14('0x69')]['id'],'FromUserId':_0xa53262[_0xbe14('0x2f')]['id'],'type':'queue'};_0x3a01bb[_0x49990b+_0xbe14('0x6b')]=_0x2be969['id'];_0x3a01bb[_0x49990b+_0xbe14('0x6c')]=_0x2be969[_0xbe14('0x69')]['id'];_0x3a01bb['From'+_0x49990b+_0x337073+'Id']=_0x2be969[_0xbe14('0x64')]['id'];_0x3a01bb['To'+_0x49990b+_0xbe14('0x6d')]=_0x47d7bb['id'];return db[_0x49990b+_0xbe14('0x6e')][_0xbe14('0x6f')](_0x3a01bb);})[_0xbe14('0x8')](function(){return respondWithRpcPromise(_0xbe14('0x70'),{'channel':_0x5bc52b,'interaction':_0x2be969[_0xbe14('0x69')],'message':_0x2be969,'account':_0x2be969[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbe14('0x71'),'appdata':_0x47d7bb[_0xbe14('0x10')]+','+(_0x2be969[_0xbe14('0x64')][_0xbe14('0x72')]||0x12c),'interval':_0xbe14('0x73')}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x1205d1,null))[_0xbe14('0xc')](handleError(_0x1205d1,null));};};exports[_0xbe14('0x74')]=function(_0x1de70d,_0x30be9e){var _0x1679bd,_0x2ca6e6;if(_['isNil'](_0x1de70d[_0xbe14('0x20')]['channel'])){throw new Error(_0xbe14('0x75'));}var _0x1b8733=_0x1de70d[_0xbe14('0x20')][_0xbe14('0x76')];var _0x1d7b08=_['capitalize'](_0x1b8733);var _0x5868d7=_0x1b8733===_0xbe14('0x77')?_0xbe14('0x78'):_0xbe14('0x64');return db[_0xbe14('0x79')]['findOne']({'raw':!![],'where':{'id':_0x1de70d[_0xbe14('0x1b')]['id'],'role':_0xbe14('0x7a')}})['then'](function(_0x186225){if(_[_0xbe14('0x12')](_0x186225)){throw new Error(_0xbe14('0x7b'));}_0x1679bd=_0x186225;return db[_0x1d7b08+_0xbe14('0x7c')]['findOne']({'where':{'id':_0x1de70d[_0xbe14('0x20')]['messageId']},'include':[{'model':db[_0x1d7b08+'Interaction'],'as':_0xbe14('0x69')},{'model':db[_0x1d7b08+_0x5868d7],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x3d890b){if(_[_0xbe14('0x12')](_0x3d890b)){throw new Error(_0x1d7b08+'\x20Message\x20not\x20found');}_0x2ca6e6=_0x3d890b;return _0x3d890b[_0xbe14('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x5dc793={'uniqueid':_0x1b8733+'.'+_0x2ca6e6['id']+'.'+_0x2ca6e6['Interaction']['id'],'FromUserId':_0x1de70d[_0xbe14('0x2f')]['id'],'type':_0xbe14('0x71'),'ToUserId':_0x1679bd['id']};_0x5dc793[_0x1d7b08+'MessageId']=_0x2ca6e6['id'];_0x5dc793[_0x1d7b08+_0xbe14('0x6c')]=_0x2ca6e6['Interaction']['id'];_0x5dc793[_0xbe14('0x7e')+_0x1d7b08+_0x5868d7+'Id']=_0x2ca6e6['Account']['id'];return db[_0x1d7b08+_0xbe14('0x6e')]['create'](_0x5dc793);})[_0xbe14('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1b8733,'interaction':_0x2ca6e6[_0xbe14('0x69')],'message':_0x2ca6e6,'account':_0x2ca6e6[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1679bd['name']+','+(_0x2ca6e6[_0xbe14('0x64')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x30be9e,null))[_0xbe14('0xc')](handleError(_0x30be9e,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 440e0ff..ef59b93 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 _0x0518=['../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20e270,_0x23e5e5){var _0xbbfe00=function(_0xb02ca9){while(--_0xb02ca9){_0x20e270['push'](_0x20e270['shift']());}};_0xbbfe00(++_0x23e5e5);}(_0x0518,0x1db));var _0x8051=function(_0x4387a6,_0x514cbc){_0x4387a6=_0x4387a6-0x0;var _0x51aecd=_0x0518[_0x4387a6];return _0x51aecd;};'use strict';var multer=require(_0x8051('0x0'));var util=require(_0x8051('0x1'));var path=require(_0x8051('0x2'));var timeout=require(_0x8051('0x3'));var express=require(_0x8051('0x4'));var router=express[_0x8051('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8051('0x6'));var interaction=require(_0x8051('0x7'));var config=require(_0x8051('0x8'));var controller=require(_0x8051('0x9'));router[_0x8051('0xa')]('/',auth[_0x8051('0xb')](),controller[_0x8051('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8051('0xd')]);router[_0x8051('0xa')](_0x8051('0xe'),auth[_0x8051('0xb')](),controller['run']);router[_0x8051('0xf')]('/',auth['isAuthenticated'](),controller[_0x8051('0x10')]);router[_0x8051('0x11')](_0x8051('0x12'),auth[_0x8051('0xb')](),controller[_0x8051('0x13')]);router['delete'](_0x8051('0x12'),auth[_0x8051('0xb')](),controller[_0x8051('0x14')]);module['exports']=router; \ No newline at end of file +var _0x86e4=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','put','delete','destroy','exports','multer'];(function(_0x1634d3,_0x565400){var _0x3c21b5=function(_0xecc7f6){while(--_0xecc7f6){_0x1634d3['push'](_0x1634d3['shift']());}};_0x3c21b5(++_0x565400);}(_0x86e4,0xe6));var _0x486e=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x86e4[_0x671369];return _0x33f2b4;};'use strict';var multer=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var path=require(_0x486e('0x2'));var timeout=require(_0x486e('0x3'));var express=require(_0x486e('0x4'));var router=express['Router']();var fs_extra=require(_0x486e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x486e('0x6'));var config=require(_0x486e('0x7'));var controller=require(_0x486e('0x8'));router[_0x486e('0x9')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0xb')]);router[_0x486e('0x9')](_0x486e('0xc'),auth['isAuthenticated'](),controller[_0x486e('0xd')]);router[_0x486e('0x9')](_0x486e('0xe'),auth[_0x486e('0xa')](),controller['run']);router[_0x486e('0xf')]('/',auth[_0x486e('0xa')](),controller[_0x486e('0x10')]);router[_0x486e('0x11')](_0x486e('0xc'),auth[_0x486e('0xa')](),controller['update']);router[_0x486e('0x12')](_0x486e('0xc'),auth[_0x486e('0xa')](),controller[_0x486e('0x13')]);module[_0x486e('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index e6a919e..49cb62f 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 _0x997e=['days','csv','pdf','xlsx','custom','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','months','hours','minutes'];(function(_0x14ae8b,_0xa14eba){var _0x27f611=function(_0x25daa1){while(--_0x25daa1){_0x14ae8b['push'](_0x14ae8b['shift']());}};_0x27f611(++_0xa14eba);}(_0x997e,0xe6));var _0xe997=function(_0x275df2,_0x305e6a){_0x275df2=_0x275df2-0x0;var _0x4857ee=_0x997e[_0x275df2];return _0x4857ee;};'use strict';var Sequelize=require('sequelize');module[_0xe997('0x0')]={'name':{'type':Sequelize[_0xe997('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe997('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe997('0x1')],'allowNull':![],'defaultValue':_0xe997('0x2')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe997('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xe997('0x4')](_0xe997('0x5'),_0xe997('0x6'),_0xe997('0x7'),'weeks','days',_0xe997('0x8'),_0xe997('0x9')),'allowNull':![],'defaultValue':_0xe997('0xa')},'output':{'type':Sequelize[_0xe997('0x4')](_0xe997('0xb'),_0xe997('0xc'),_0xe997('0xd')),'allowNull':![],'defaultValue':_0xe997('0xb')},'type':{'type':Sequelize['ENUM'](_0xe997('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xe997('0x1')]},'cc':{'type':Sequelize[_0xe997('0xf')]},'bcc':{'type':Sequelize[_0xe997('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x99f0=['xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','hours','minutes','days','csv','pdf'];(function(_0x383368,_0xb2bbe){var _0x2762ca=function(_0x1ef4df){while(--_0x1ef4df){_0x383368['push'](_0x383368['shift']());}};_0x2762ca(++_0xb2bbe);}(_0x99f0,0x100));var _0x099f=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x99f0[_0x3cfb0d];return _0x3486b4;};'use strict';var Sequelize=require('sequelize');module[_0x099f('0x0')]={'name':{'type':Sequelize[_0x099f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x099f('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x099f('0x3')},'startAt':{'type':Sequelize[_0x099f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x099f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x099f('0x5')]('years',_0x099f('0x6'),_0x099f('0x7'),_0x099f('0x8'),'days',_0x099f('0x9'),_0x099f('0xa')),'allowNull':![],'defaultValue':_0x099f('0xb')},'output':{'type':Sequelize[_0x099f('0x5')](_0x099f('0xc'),_0x099f('0xd'),_0x099f('0xe')),'allowNull':![],'defaultValue':_0x099f('0xc')},'type':{'type':Sequelize[_0x099f('0x5')](_0x099f('0xf'),_0x099f('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x099f('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x099f('0x1')]},'cc':{'type':Sequelize[_0x099f('0x11')]},'bcc':{'type':Sequelize[_0x099f('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index da24246..a35f8d3 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 _0x5f94=['limit','count','set','Content-Range','apply','reject','update','then','destroy','Scheduler','error','stack','send','index','Schedule','rawAttributes','type','key','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','filters','include','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined'];(function(_0x42fc97,_0x2fba84){var _0x26b8e2=function(_0x5548d2){while(--_0x5548d2){_0x42fc97['push'](_0x42fc97['shift']());}};_0x26b8e2(++_0x2fba84);}(_0x5f94,0x179));var _0x45f9=function(_0x415153,_0x4314be){_0x415153=_0x415153-0x0;var _0x362d54=_0x5f94[_0x415153];return _0x362d54;};'use strict';var emlformat=require(_0x45f9('0x0'));var rimraf=require(_0x45f9('0x1'));var zipdir=require(_0x45f9('0x2'));var jsonpatch=require(_0x45f9('0x3'));var rp=require(_0x45f9('0x4'));var moment=require(_0x45f9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x45f9('0x6'));var util=require(_0x45f9('0x7'));var path=require(_0x45f9('0x8'));var sox=require(_0x45f9('0x9'));var csv=require(_0x45f9('0xa'));var ejs=require(_0x45f9('0xb'));var fs=require('fs');var fs_extra=require(_0x45f9('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x45f9('0xd'));var jsforce=require(_0x45f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x45f9('0xa'));var querystring=require('querystring');var Papa=require(_0x45f9('0xf'));var Redis=require(_0x45f9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x45f9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45f9('0x12'));var logger=require(_0x45f9('0x13'))('api');var utils=require(_0x45f9('0x14'));var config=require(_0x45f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34daab,_0x3396a9){_0x3396a9=_0x3396a9||0xcc;return function(_0x4e0e45){if(_0x4e0e45){return _0x34daab[_0x45f9('0x16')](_0x3396a9);}return _0x34daab[_0x45f9('0x17')](_0x3396a9)[_0x45f9('0x18')]();};}function respondWithResult(_0x2c5c17,_0xd76790){_0xd76790=_0xd76790||0xc8;return function(_0x54b096){if(_0x54b096){return _0x2c5c17['status'](_0xd76790)[_0x45f9('0x19')](_0x54b096);}};}function respondWithFilteredResult(_0x26d18f,_0x408ec1){return function(_0x38fdbe){if(_0x38fdbe){var _0x2a355c=typeof _0x408ec1[_0x45f9('0x1a')]===_0x45f9('0x1b')&&typeof _0x408ec1[_0x45f9('0x1c')]===_0x45f9('0x1b');var _0x78344e=_0x38fdbe[_0x45f9('0x1d')];var _0x5b1a92=_0x2a355c?0x0:_0x408ec1[_0x45f9('0x1a')];var _0x3f9723=_0x2a355c?_0x38fdbe[_0x45f9('0x1d')]:_0x408ec1['offset']+_0x408ec1['limit'];var _0x26663a;if(_0x3f9723>=_0x78344e){_0x3f9723=_0x78344e;_0x26663a=0xc8;}else{_0x26663a=0xce;}_0x26d18f[_0x45f9('0x17')](_0x26663a);return _0x26d18f[_0x45f9('0x1e')](_0x45f9('0x1f'),_0x5b1a92+'-'+_0x3f9723+'/'+_0x78344e)[_0x45f9('0x19')](_0x38fdbe);}return null;};}function patchUpdates(_0x56f5e8){return function(_0x2a7d21){try{jsonpatch[_0x45f9('0x20')](_0x2a7d21,_0x56f5e8,!![]);}catch(_0x51d8cb){return BPromise[_0x45f9('0x21')](_0x51d8cb);}return _0x2a7d21['save']();};}function saveUpdates(_0x364a07,_0x1c5588){return function(_0x48e3a6){if(_0x48e3a6){return _0x48e3a6[_0x45f9('0x22')](_0x364a07)[_0x45f9('0x23')](function(_0x42eeef){return _0x42eeef;});}return null;};}function removeEntity(_0x3b5d8b,_0x4b0326){return function(_0x232582){if(_0x232582){return _0x232582[_0x45f9('0x24')]()[_0x45f9('0x23')](function(){var _0x3795ce=_0x232582['get']({'plain':!![]});var _0x4b8df3=_0x45f9('0x25');return db['UserProfileResource'][_0x45f9('0x24')]({'where':{'type':_0x4b8df3,'resourceId':_0x3795ce['id']}})['then'](function(){return _0x232582;});})[_0x45f9('0x23')](function(){_0x3b5d8b[_0x45f9('0x17')](0xcc)[_0x45f9('0x18')]();});}};}function handleEntityNotFound(_0x3cf877,_0x44c861){return function(_0x2d1d57){if(!_0x2d1d57){_0x3cf877[_0x45f9('0x16')](0x194);}return _0x2d1d57;};}function handleError(_0x2a1e47,_0x4fef13){_0x4fef13=_0x4fef13||0x1f4;return function(_0x316544){logger[_0x45f9('0x26')](_0x316544[_0x45f9('0x27')]);if(_0x316544['name']){delete _0x316544['name'];}_0x2a1e47[_0x45f9('0x17')](_0x4fef13)[_0x45f9('0x28')](_0x316544);};}exports[_0x45f9('0x29')]=function(_0x1d87d6,_0x194127){var _0x5da3cf={},_0x141f42={},_0x19393e={'count':0x0,'rows':[]};var _0xb5ee1e=_['map'](db[_0x45f9('0x2a')][_0x45f9('0x2b')],function(_0x27c7df){return{'name':_0x27c7df['fieldName'],'type':_0x27c7df[_0x45f9('0x2c')][_0x45f9('0x2d')]};});_0x141f42[_0x45f9('0x2e')]=_[_0x45f9('0x2f')](_0xb5ee1e,_0x45f9('0x30'));_0x141f42[_0x45f9('0x31')]=_[_0x45f9('0x32')](_0x1d87d6[_0x45f9('0x31')]);_0x141f42['filters']=_[_0x45f9('0x33')](_0x141f42[_0x45f9('0x2e')],_0x141f42['query']);_0x5da3cf[_0x45f9('0x34')]=_[_0x45f9('0x33')](_0x141f42[_0x45f9('0x2e')],qs[_0x45f9('0x35')](_0x1d87d6['query'][_0x45f9('0x35')]));_0x5da3cf[_0x45f9('0x34')]=_0x5da3cf[_0x45f9('0x34')][_0x45f9('0x36')]?_0x5da3cf[_0x45f9('0x34')]:_0x141f42[_0x45f9('0x2e')];if(!_0x1d87d6[_0x45f9('0x31')][_0x45f9('0x37')](_0x45f9('0x38'))){_0x5da3cf['limit']=qs[_0x45f9('0x1c')](_0x1d87d6[_0x45f9('0x31')][_0x45f9('0x1c')]);_0x5da3cf[_0x45f9('0x1a')]=qs['offset'](_0x1d87d6[_0x45f9('0x31')][_0x45f9('0x1a')]);}_0x5da3cf['order']=qs[_0x45f9('0x39')](_0x1d87d6[_0x45f9('0x31')]['sort']);_0x5da3cf[_0x45f9('0x3a')]=qs['filters'](_[_0x45f9('0x3b')](_0x1d87d6['query'],_0x141f42['filters']),_0xb5ee1e);if(_0x1d87d6['query'][_0x45f9('0x3c')]){_0x5da3cf['where']=_[_0x45f9('0x3d')](_0x5da3cf[_0x45f9('0x3a')],{'$or':_[_0x45f9('0x2f')](_0xb5ee1e,function(_0x2c37d0){if(_0x2c37d0[_0x45f9('0x2c')]!==_0x45f9('0x3e')){var _0x38b5df={};_0x38b5df[_0x2c37d0[_0x45f9('0x30')]]={'$like':'%'+_0x1d87d6['query'][_0x45f9('0x3c')]+'%'};return _0x38b5df;}})});}_0x5da3cf=_['merge']({},_0x5da3cf,_0x1d87d6['options']);var _0x2226c5={'where':_0x5da3cf['where']};return db[_0x45f9('0x2a')][_0x45f9('0x1d')](_0x2226c5)[_0x45f9('0x23')](function(_0x26110a){_0x19393e[_0x45f9('0x1d')]=_0x26110a;if(_0x1d87d6[_0x45f9('0x31')][_0x45f9('0x3f')]){_0x5da3cf['include']=[{'all':!![]}];}return db[_0x45f9('0x2a')][_0x45f9('0x40')](_0x5da3cf);})[_0x45f9('0x23')](function(_0x32efdd){_0x19393e[_0x45f9('0x41')]=_0x32efdd;return _0x19393e;})[_0x45f9('0x23')](respondWithFilteredResult(_0x194127,_0x5da3cf))[_0x45f9('0x42')](handleError(_0x194127,null));};exports['show']=function(_0x2f72da,_0x165ce9){var _0x280c8e={'raw':![],'where':{'id':_0x2f72da['params']['id']}},_0x1ba1a3={};_0x1ba1a3[_0x45f9('0x2e')]=_[_0x45f9('0x32')](db[_0x45f9('0x2a')][_0x45f9('0x2b')]);_0x1ba1a3[_0x45f9('0x31')]=_[_0x45f9('0x32')](_0x2f72da[_0x45f9('0x31')]);_0x1ba1a3[_0x45f9('0x43')]=_[_0x45f9('0x33')](_0x1ba1a3[_0x45f9('0x2e')],_0x1ba1a3[_0x45f9('0x31')]);_0x280c8e[_0x45f9('0x34')]=_['intersection'](_0x1ba1a3[_0x45f9('0x2e')],qs['fields'](_0x2f72da['query'][_0x45f9('0x35')]));_0x280c8e[_0x45f9('0x34')]=_0x280c8e['attributes'][_0x45f9('0x36')]?_0x280c8e[_0x45f9('0x34')]:_0x1ba1a3[_0x45f9('0x2e')];if(_0x2f72da[_0x45f9('0x31')][_0x45f9('0x3f')]){_0x280c8e[_0x45f9('0x44')]=[{'all':!![]}];}_0x280c8e=_[_0x45f9('0x3d')]({},_0x280c8e,_0x2f72da['options']);return db['Schedule'][_0x45f9('0x45')](_0x280c8e)[_0x45f9('0x23')](handleEntityNotFound(_0x165ce9,null))['then'](respondWithResult(_0x165ce9,null))[_0x45f9('0x42')](handleError(_0x165ce9,null));};exports[_0x45f9('0x46')]=function(_0x48339c,_0x278fb1){return db[_0x45f9('0x2a')][_0x45f9('0x46')](_0x48339c[_0x45f9('0x47')],{})[_0x45f9('0x23')](function(_0xbb5df3){var _0x46bf2a=_0x48339c[_0x45f9('0x48')][_0x45f9('0x49')]({'plain':!![]});if(!_0x46bf2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46bf2a['role']===_0x45f9('0x48')){var _0x2fe0cf=_0xbb5df3['get']({'plain':!![]});var _0x32de8c=_0x45f9('0x25');return db[_0x45f9('0x4a')][_0x45f9('0x45')]({'where':{'name':_0x32de8c,'userProfileId':_0x46bf2a[_0x45f9('0x4b')]},'raw':!![]})[_0x45f9('0x23')](function(_0x35995d){if(_0x35995d&&_0x35995d[_0x45f9('0x4c')]===0x0){return db['UserProfileResource'][_0x45f9('0x46')]({'name':_0x2fe0cf[_0x45f9('0x30')],'resourceId':_0x2fe0cf['id'],'type':_0x35995d[_0x45f9('0x30')],'sectionId':_0x35995d['id']},{})['then'](function(){return _0xbb5df3;});}else{return _0xbb5df3;}})[_0x45f9('0x42')](function(_0x2cfe57){logger['error'](_0x45f9('0x4d'),_0x2cfe57);throw _0x2cfe57;});}return _0xbb5df3;})[_0x45f9('0x23')](respondWithResult(_0x278fb1,0xc9))[_0x45f9('0x42')](handleError(_0x278fb1,null));};exports['update']=function(_0x4b23ef,_0x3c3512){if(_0x4b23ef[_0x45f9('0x47')]['id']){delete _0x4b23ef[_0x45f9('0x47')]['id'];}return db['Schedule']['find']({'where':{'id':_0x4b23ef[_0x45f9('0x4e')]['id']}})[_0x45f9('0x23')](handleEntityNotFound(_0x3c3512,null))[_0x45f9('0x23')](saveUpdates(_0x4b23ef[_0x45f9('0x47')],null))[_0x45f9('0x23')](respondWithResult(_0x3c3512,null))[_0x45f9('0x42')](handleError(_0x3c3512,null));};exports[_0x45f9('0x24')]=function(_0x57a78e,_0x44d674){return db[_0x45f9('0x2a')][_0x45f9('0x45')]({'where':{'id':_0x57a78e[_0x45f9('0x4e')]['id']}})[_0x45f9('0x23')](handleEntityNotFound(_0x44d674,null))['then'](removeEntity(_0x44d674,null))[_0x45f9('0x42')](handleError(_0x44d674,null));};exports[_0x45f9('0x4f')]=function(_0x15ac9a,_0x2958af,_0x5e2d83){var _0x1e1a9a=require(_0x45f9('0x50'));return db[_0x45f9('0x2a')][_0x45f9('0x45')]({'where':{'id':_0x15ac9a[_0x45f9('0x4e')]['id']},'raw':!![]})[_0x45f9('0x23')](handleEntityNotFound(_0x2958af,null))[_0x45f9('0x23')](function(){_0x1e1a9a[_0x45f9('0x4f')](_0x15ac9a[_0x45f9('0x4e')]['id']);})[_0x45f9('0x23')](respondWithStatusCode(_0x2958af,null))[_0x45f9('0x42')](handleError(_0x2958af,null));}; \ No newline at end of file +var _0xdc08=['show','includeAll','create','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','send','index','map','Schedule','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','include','findAll','rows','catch'];(function(_0x42f840,_0x1aa32e){var _0x47539f=function(_0x390a4b){while(--_0x390a4b){_0x42f840['push'](_0x42f840['shift']());}};_0x47539f(++_0x1aa32e);}(_0xdc08,0x159));var _0x8dc0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xdc08[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8dc0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8dc0('0x1'));var rp=require(_0x8dc0('0x2'));var moment=require(_0x8dc0('0x3'));var BPromise=require(_0x8dc0('0x4'));var Mustache=require(_0x8dc0('0x5'));var util=require(_0x8dc0('0x6'));var path=require(_0x8dc0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8dc0('0x8'));var fs=require('fs');var fs_extra=require(_0x8dc0('0x9'));var _=require(_0x8dc0('0xa'));var squel=require(_0x8dc0('0xb'));var crypto=require('crypto');var jsforce=require(_0x8dc0('0xc'));var deskjs=require(_0x8dc0('0xd'));var toCsv=require(_0x8dc0('0xe'));var querystring=require('querystring');var Papa=require(_0x8dc0('0xf'));var Redis=require('ioredis');var authService=require(_0x8dc0('0x10'));var qs=require(_0x8dc0('0x11'));var as=require(_0x8dc0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8dc0('0x13'));var utils=require(_0x8dc0('0x14'));var config=require(_0x8dc0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226bd4,_0x1f999c){_0x1f999c=_0x1f999c||0xcc;return function(_0x57aba1){if(_0x57aba1){return _0x226bd4[_0x8dc0('0x16')](_0x1f999c);}return _0x226bd4['status'](_0x1f999c)[_0x8dc0('0x17')]();};}function respondWithResult(_0x1acc47,_0x52abe9){_0x52abe9=_0x52abe9||0xc8;return function(_0x8f0f77){if(_0x8f0f77){return _0x1acc47[_0x8dc0('0x18')](_0x52abe9)[_0x8dc0('0x19')](_0x8f0f77);}};}function respondWithFilteredResult(_0x8a4ff3,_0x48af2b){return function(_0x42602b){if(_0x42602b){var _0x9cffe=typeof _0x48af2b[_0x8dc0('0x1a')]===_0x8dc0('0x1b')&&typeof _0x48af2b[_0x8dc0('0x1c')]==='undefined';var _0x1c104e=_0x42602b['count'];var _0x3ee914=_0x9cffe?0x0:_0x48af2b[_0x8dc0('0x1a')];var _0x59d3d9=_0x9cffe?_0x42602b[_0x8dc0('0x1d')]:_0x48af2b[_0x8dc0('0x1a')]+_0x48af2b[_0x8dc0('0x1c')];var _0x262553;if(_0x59d3d9>=_0x1c104e){_0x59d3d9=_0x1c104e;_0x262553=0xc8;}else{_0x262553=0xce;}_0x8a4ff3[_0x8dc0('0x18')](_0x262553);return _0x8a4ff3[_0x8dc0('0x1e')](_0x8dc0('0x1f'),_0x3ee914+'-'+_0x59d3d9+'/'+_0x1c104e)['json'](_0x42602b);}return null;};}function patchUpdates(_0x582bf7){return function(_0x5df8bd){try{jsonpatch['apply'](_0x5df8bd,_0x582bf7,!![]);}catch(_0x238f5b){return BPromise[_0x8dc0('0x20')](_0x238f5b);}return _0x5df8bd[_0x8dc0('0x21')]();};}function saveUpdates(_0x3ae4f3,_0x59dad2){return function(_0x42fdc0){if(_0x42fdc0){return _0x42fdc0[_0x8dc0('0x22')](_0x3ae4f3)[_0x8dc0('0x23')](function(_0x483048){return _0x483048;});}return null;};}function removeEntity(_0x5a925b,_0x5763ce){return function(_0x631083){if(_0x631083){return _0x631083[_0x8dc0('0x24')]()[_0x8dc0('0x23')](function(){var _0x1a4428=_0x631083[_0x8dc0('0x25')]({'plain':!![]});var _0x293cf0=_0x8dc0('0x26');return db[_0x8dc0('0x27')][_0x8dc0('0x24')]({'where':{'type':_0x293cf0,'resourceId':_0x1a4428['id']}})[_0x8dc0('0x23')](function(){return _0x631083;});})[_0x8dc0('0x23')](function(){_0x5a925b[_0x8dc0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9431,_0x57fde5){return function(_0x444aed){if(!_0x444aed){_0x5c9431[_0x8dc0('0x16')](0x194);}return _0x444aed;};}function handleError(_0x678993,_0x10dc38){_0x10dc38=_0x10dc38||0x1f4;return function(_0x36d17f){logger[_0x8dc0('0x28')](_0x36d17f[_0x8dc0('0x29')]);if(_0x36d17f['name']){delete _0x36d17f['name'];}_0x678993['status'](_0x10dc38)[_0x8dc0('0x2a')](_0x36d17f);};}exports[_0x8dc0('0x2b')]=function(_0x3238cd,_0x1d0841){var _0x3c1d63={},_0x2fa90f={},_0x3c4cd5={'count':0x0,'rows':[]};var _0x3b616e=_[_0x8dc0('0x2c')](db[_0x8dc0('0x2d')][_0x8dc0('0x2e')],function(_0x588351){return{'name':_0x588351['fieldName'],'type':_0x588351[_0x8dc0('0x2f')][_0x8dc0('0x30')]};});_0x2fa90f[_0x8dc0('0x31')]=_[_0x8dc0('0x2c')](_0x3b616e,'name');_0x2fa90f['query']=_[_0x8dc0('0x32')](_0x3238cd['query']);_0x2fa90f[_0x8dc0('0x33')]=_[_0x8dc0('0x34')](_0x2fa90f[_0x8dc0('0x31')],_0x2fa90f[_0x8dc0('0x35')]);_0x3c1d63[_0x8dc0('0x36')]=_[_0x8dc0('0x34')](_0x2fa90f[_0x8dc0('0x31')],qs[_0x8dc0('0x37')](_0x3238cd[_0x8dc0('0x35')]['fields']));_0x3c1d63[_0x8dc0('0x36')]=_0x3c1d63[_0x8dc0('0x36')][_0x8dc0('0x38')]?_0x3c1d63[_0x8dc0('0x36')]:_0x2fa90f[_0x8dc0('0x31')];if(!_0x3238cd[_0x8dc0('0x35')]['hasOwnProperty'](_0x8dc0('0x39'))){_0x3c1d63['limit']=qs[_0x8dc0('0x1c')](_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x1c')]);_0x3c1d63[_0x8dc0('0x1a')]=qs[_0x8dc0('0x1a')](_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x1a')]);}_0x3c1d63[_0x8dc0('0x3a')]=qs['sort'](_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x3b')]);_0x3c1d63[_0x8dc0('0x3c')]=qs[_0x8dc0('0x33')](_['pick'](_0x3238cd['query'],_0x2fa90f[_0x8dc0('0x33')]),_0x3b616e);if(_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x3d')]){_0x3c1d63[_0x8dc0('0x3c')]=_[_0x8dc0('0x3e')](_0x3c1d63[_0x8dc0('0x3c')],{'$or':_['map'](_0x3b616e,function(_0x336a3d){if(_0x336a3d[_0x8dc0('0x2f')]!==_0x8dc0('0x3f')){var _0x3ae1b6={};_0x3ae1b6[_0x336a3d[_0x8dc0('0x40')]]={'$like':'%'+_0x3238cd[_0x8dc0('0x35')][_0x8dc0('0x3d')]+'%'};return _0x3ae1b6;}})});}_0x3c1d63=_[_0x8dc0('0x3e')]({},_0x3c1d63,_0x3238cd[_0x8dc0('0x41')]);var _0x2e1a9e={'where':_0x3c1d63[_0x8dc0('0x3c')]};return db[_0x8dc0('0x2d')]['count'](_0x2e1a9e)[_0x8dc0('0x23')](function(_0x45f8a8){_0x3c4cd5['count']=_0x45f8a8;if(_0x3238cd[_0x8dc0('0x35')]['includeAll']){_0x3c1d63[_0x8dc0('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x8dc0('0x43')](_0x3c1d63);})['then'](function(_0x37e7ab){_0x3c4cd5[_0x8dc0('0x44')]=_0x37e7ab;return _0x3c4cd5;})[_0x8dc0('0x23')](respondWithFilteredResult(_0x1d0841,_0x3c1d63))[_0x8dc0('0x45')](handleError(_0x1d0841,null));};exports[_0x8dc0('0x46')]=function(_0x20ff84,_0x28ec20){var _0x566090={'raw':![],'where':{'id':_0x20ff84['params']['id']}},_0x3627f2={};_0x3627f2['model']=_[_0x8dc0('0x32')](db['Schedule'][_0x8dc0('0x2e')]);_0x3627f2['query']=_['keys'](_0x20ff84['query']);_0x3627f2[_0x8dc0('0x33')]=_[_0x8dc0('0x34')](_0x3627f2[_0x8dc0('0x31')],_0x3627f2[_0x8dc0('0x35')]);_0x566090[_0x8dc0('0x36')]=_[_0x8dc0('0x34')](_0x3627f2['model'],qs[_0x8dc0('0x37')](_0x20ff84[_0x8dc0('0x35')][_0x8dc0('0x37')]));_0x566090[_0x8dc0('0x36')]=_0x566090['attributes']['length']?_0x566090[_0x8dc0('0x36')]:_0x3627f2[_0x8dc0('0x31')];if(_0x20ff84['query'][_0x8dc0('0x47')]){_0x566090['include']=[{'all':!![]}];}_0x566090=_[_0x8dc0('0x3e')]({},_0x566090,_0x20ff84[_0x8dc0('0x41')]);return db['Schedule']['find'](_0x566090)[_0x8dc0('0x23')](handleEntityNotFound(_0x28ec20,null))[_0x8dc0('0x23')](respondWithResult(_0x28ec20,null))[_0x8dc0('0x45')](handleError(_0x28ec20,null));};exports[_0x8dc0('0x48')]=function(_0x329356,_0x4c01d4){return db[_0x8dc0('0x2d')][_0x8dc0('0x48')](_0x329356[_0x8dc0('0x49')],{})[_0x8dc0('0x23')](function(_0x2e25e6){var _0x778432=_0x329356['user'][_0x8dc0('0x25')]({'plain':!![]});if(!_0x778432)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x778432[_0x8dc0('0x4a')]===_0x8dc0('0x4b')){var _0x586b32=_0x2e25e6[_0x8dc0('0x25')]({'plain':!![]});var _0x3045d9='Scheduler';return db['UserProfileSection'][_0x8dc0('0x4c')]({'where':{'name':_0x3045d9,'userProfileId':_0x778432[_0x8dc0('0x4d')]},'raw':!![]})[_0x8dc0('0x23')](function(_0x1364f5){if(_0x1364f5&&_0x1364f5[_0x8dc0('0x4e')]===0x0){return db[_0x8dc0('0x27')][_0x8dc0('0x48')]({'name':_0x586b32[_0x8dc0('0x40')],'resourceId':_0x586b32['id'],'type':_0x1364f5[_0x8dc0('0x40')],'sectionId':_0x1364f5['id']},{})['then'](function(){return _0x2e25e6;});}else{return _0x2e25e6;}})[_0x8dc0('0x45')](function(_0x300c28){logger['error'](_0x8dc0('0x4f'),_0x300c28);throw _0x300c28;});}return _0x2e25e6;})[_0x8dc0('0x23')](respondWithResult(_0x4c01d4,0xc9))[_0x8dc0('0x45')](handleError(_0x4c01d4,null));};exports[_0x8dc0('0x22')]=function(_0x29d78e,_0x19e574){if(_0x29d78e[_0x8dc0('0x49')]['id']){delete _0x29d78e[_0x8dc0('0x49')]['id'];}return db[_0x8dc0('0x2d')][_0x8dc0('0x4c')]({'where':{'id':_0x29d78e['params']['id']}})['then'](handleEntityNotFound(_0x19e574,null))[_0x8dc0('0x23')](saveUpdates(_0x29d78e[_0x8dc0('0x49')],null))['then'](respondWithResult(_0x19e574,null))['catch'](handleError(_0x19e574,null));};exports[_0x8dc0('0x24')]=function(_0x583ece,_0x2d6805){return db[_0x8dc0('0x2d')][_0x8dc0('0x4c')]({'where':{'id':_0x583ece['params']['id']}})[_0x8dc0('0x23')](handleEntityNotFound(_0x2d6805,null))[_0x8dc0('0x23')](removeEntity(_0x2d6805,null))[_0x8dc0('0x45')](handleError(_0x2d6805,null));};exports[_0x8dc0('0x50')]=function(_0x58fca0,_0x3b77ba,_0x41c059){var _0x1a21f8=require(_0x8dc0('0x51'));return db[_0x8dc0('0x2d')][_0x8dc0('0x4c')]({'where':{'id':_0x58fca0['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b77ba,null))['then'](function(){_0x1a21f8[_0x8dc0('0x50')](_0x58fca0[_0x8dc0('0x52')]['id']);})[_0x8dc0('0x23')](respondWithStatusCode(_0x3b77ba,null))[_0x8dc0('0x45')](handleError(_0x3b77ba,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 5d37fca..f73d48d 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 _0x6698=['../../config/environment','./schedule.attributes','exports','tools_schedules','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xa3e768,_0x5c2570){var _0x3ad9db=function(_0x2c2162){while(--_0x2c2162){_0xa3e768['push'](_0xa3e768['shift']());}};_0x3ad9db(++_0x5c2570);}(_0x6698,0x13c));var _0x8669=function(_0x31d1b3,_0x127054){_0x31d1b3=_0x31d1b3-0x0;var _0x2c0b91=_0x6698[_0x31d1b3];return _0x2c0b91;};'use strict';var _=require(_0x8669('0x0'));var util=require(_0x8669('0x1'));var logger=require('../../config/logger')(_0x8669('0x2'));var moment=require(_0x8669('0x3'));var BPromise=require(_0x8669('0x4'));var rp=require(_0x8669('0x5'));var fs=require('fs');var path=require(_0x8669('0x6'));var rimraf=require(_0x8669('0x7'));var config=require(_0x8669('0x8'));var attributes=require(_0x8669('0x9'));module[_0x8669('0xa')]=function(_0x51d133,_0x116415){return _0x51d133['define']('Schedule',attributes,{'tableName':_0x8669('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebce=['./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xebce,0xb8));var _0xeebc=function(_0x3032e2,_0x26a4e8){_0x3032e2=_0x3032e2-0x0;var _0x427aef=_0xebce[_0x3032e2];return _0x427aef;};'use strict';var _=require(_0xeebc('0x0'));var util=require(_0xeebc('0x1'));var logger=require(_0xeebc('0x2'))(_0xeebc('0x3'));var moment=require(_0xeebc('0x4'));var BPromise=require(_0xeebc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeebc('0x6'));var rimraf=require(_0xeebc('0x7'));var config=require('../../config/environment');var attributes=require(_0xeebc('0x8'));module[_0xeebc('0x9')]=function(_0x21de9e,_0x2e3ea1){return _0x21de9e[_0xeebc('0xa')](_0xeebc('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index d50ab72..8a61c9c 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 _0xa1e7=['../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x370ef5,_0x4a2917){var _0x36579f=function(_0x45249b){while(--_0x45249b){_0x370ef5['push'](_0x370ef5['shift']());}};_0x36579f(++_0x4a2917);}(_0xa1e7,0x91));var _0x7a1e=function(_0x2aec6b,_0x78c853){_0x2aec6b=_0x2aec6b-0x0;var _0x21dea4=_0xa1e7[_0x2aec6b];return _0x21dea4;};'use strict';var _=require(_0x7a1e('0x0'));var util=require(_0x7a1e('0x1'));var moment=require(_0x7a1e('0x2'));var BPromise=require(_0x7a1e('0x3'));var rs=require(_0x7a1e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a1e('0x5'))['db'];var utils=require(_0x7a1e('0x6'));var logger=require(_0x7a1e('0x7'))(_0x7a1e('0x8'));var config=require(_0x7a1e('0x9'));var jayson=require(_0x7a1e('0xa'));var client=jayson[_0x7a1e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1faf70,_0x2d4783,_0x554ba3){return new BPromise(function(_0x5d0ebc,_0xa9b1cb){return client[_0x7a1e('0xc')](_0x1faf70,_0x554ba3)['then'](function(_0x43f433){logger[_0x7a1e('0xd')](_0x7a1e('0xe'),_0x2d4783,_0x7a1e('0xf'));logger[_0x7a1e('0x10')](_0x7a1e('0x11'),_0x2d4783,_0x7a1e('0xf'),JSON[_0x7a1e('0x12')](_0x43f433));if(_0x43f433['error']){if(_0x43f433[_0x7a1e('0x13')]['code']===0x1f4){logger[_0x7a1e('0x13')](_0x7a1e('0xe'),_0x2d4783,_0x43f433[_0x7a1e('0x13')][_0x7a1e('0x14')]);return _0xa9b1cb(_0x43f433[_0x7a1e('0x13')][_0x7a1e('0x14')]);}logger[_0x7a1e('0x13')]('Schedule,\x20%s,\x20%s',_0x2d4783,_0x43f433[_0x7a1e('0x13')][_0x7a1e('0x14')]);return _0x5d0ebc(_0x43f433['error']['message']);}else{logger[_0x7a1e('0xd')]('Schedule,\x20%s,\x20%s',_0x2d4783,_0x7a1e('0xf'));_0x5d0ebc(_0x43f433['result']['message']);}})[_0x7a1e('0x15')](function(_0x3f7796){logger[_0x7a1e('0x13')]('Schedule,\x20%s,\x20%s',_0x2d4783,_0x3f7796);_0xa9b1cb(_0x3f7796);});});} \ No newline at end of file +var _0x6c31=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x131232,_0x5e45f9){var _0x3a61dc=function(_0x3e89f9){while(--_0x3e89f9){_0x131232['push'](_0x131232['shift']());}};_0x3a61dc(++_0x5e45f9);}(_0x6c31,0x1cb));var _0x16c3=function(_0xfcfc35,_0x41125e){_0xfcfc35=_0xfcfc35-0x0;var _0x13a3c7=_0x6c31[_0xfcfc35];return _0x13a3c7;};'use strict';var _=require(_0x16c3('0x0'));var util=require(_0x16c3('0x1'));var moment=require(_0x16c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x16c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16c3('0x4'))['db'];var utils=require(_0x16c3('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x16c3('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0bf4,_0x3eb2be,_0x4e1902){return new BPromise(function(_0x20e2b6,_0x47e698){return client[_0x16c3('0x7')](_0x1f0bf4,_0x4e1902)[_0x16c3('0x8')](function(_0x452698){logger[_0x16c3('0x9')](_0x16c3('0xa'),_0x3eb2be,_0x16c3('0xb'));logger[_0x16c3('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x3eb2be,_0x16c3('0xb'),JSON[_0x16c3('0xd')](_0x452698));if(_0x452698[_0x16c3('0xe')]){if(_0x452698['error']['code']===0x1f4){logger[_0x16c3('0xe')](_0x16c3('0xa'),_0x3eb2be,_0x452698[_0x16c3('0xe')][_0x16c3('0xf')]);return _0x47e698(_0x452698[_0x16c3('0xe')][_0x16c3('0xf')]);}logger[_0x16c3('0xe')]('Schedule,\x20%s,\x20%s',_0x3eb2be,_0x452698['error'][_0x16c3('0xf')]);return _0x20e2b6(_0x452698['error'][_0x16c3('0xf')]);}else{logger[_0x16c3('0x9')](_0x16c3('0xa'),_0x3eb2be,_0x16c3('0xb'));_0x20e2b6(_0x452698['result'][_0x16c3('0xf')]);}})[_0x16c3('0x10')](function(_0x2851f8){logger[_0x16c3('0xe')](_0x16c3('0xa'),_0x3eb2be,_0x2851f8);_0x47e698(_0x2851f8);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index a9720ef..54f1eb8 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 _0xa699=['isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','put','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get'];(function(_0x69e6ac,_0x218e1a){var _0x6a868f=function(_0x549968){while(--_0x549968){_0x69e6ac['push'](_0x69e6ac['shift']());}};_0x6a868f(++_0x218e1a);}(_0xa699,0xf3));var _0x9a69=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa699[_0xf0bcac];return _0x4e4c65;};'use strict';var multer=require(_0x9a69('0x0'));var util=require('util');var path=require(_0x9a69('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a69('0x2'));var router=express[_0x9a69('0x3')]();var fs_extra=require(_0x9a69('0x4'));var auth=require(_0x9a69('0x5'));var interaction=require(_0x9a69('0x6'));var config=require(_0x9a69('0x7'));var controller=require(_0x9a69('0x8'));router[_0x9a69('0x9')]('/',auth[_0x9a69('0xa')](),controller[_0x9a69('0xb')]);router['get'](_0x9a69('0xc'),auth[_0x9a69('0xa')](),controller[_0x9a69('0xd')]);router[_0x9a69('0x9')](_0x9a69('0xe'),auth[_0x9a69('0xa')](),controller['show']);router[_0x9a69('0x9')](_0x9a69('0xf'),auth[_0x9a69('0xa')](),controller[_0x9a69('0x10')]);router[_0x9a69('0x11')]('/',auth[_0x9a69('0xa')](),controller[_0x9a69('0x12')]);router[_0x9a69('0x13')](_0x9a69('0xe'),auth[_0x9a69('0xa')](),controller[_0x9a69('0x14')]);router['delete'](_0x9a69('0xe'),auth['isAuthenticated'](),controller[_0x9a69('0x15')]);module[_0x9a69('0x16')]=router; \ No newline at end of file +var _0x4bca=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x4c219c,_0x547d3b){var _0xf40c74=function(_0x46ad50){while(--_0x46ad50){_0x4c219c['push'](_0x4c219c['shift']());}};_0xf40c74(++_0x547d3b);}(_0x4bca,0xb3));var _0xa4bc=function(_0x5b337b,_0x467e71){_0x5b337b=_0x5b337b-0x0;var _0x1fc141=_0x4bca[_0x5b337b];return _0x1fc141;};'use strict';var multer=require(_0xa4bc('0x0'));var util=require(_0xa4bc('0x1'));var path=require(_0xa4bc('0x2'));var timeout=require(_0xa4bc('0x3'));var express=require(_0xa4bc('0x4'));var router=express[_0xa4bc('0x5')]();var fs_extra=require(_0xa4bc('0x6'));var auth=require(_0xa4bc('0x7'));var interaction=require(_0xa4bc('0x8'));var config=require(_0xa4bc('0x9'));var controller=require(_0xa4bc('0xa'));router[_0xa4bc('0xb')]('/',auth[_0xa4bc('0xc')](),controller[_0xa4bc('0xd')]);router[_0xa4bc('0xb')](_0xa4bc('0xe'),auth[_0xa4bc('0xc')](),controller['describe']);router['get'](_0xa4bc('0xf'),auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x10')]);router[_0xa4bc('0xb')]('/:id/download',auth[_0xa4bc('0xc')](),controller['download']);router[_0xa4bc('0x11')]('/',auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x12')]);router['put']('/:id',auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x13')]);router['delete'](_0xa4bc('0xf'),auth[_0xa4bc('0xc')](),controller[_0xa4bc('0x14')]);module[_0xa4bc('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 3c43024..138e264 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 _0x6bab=['extname','STRING','replace','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x6bab[_0x2fd69d];return _0x5d5ef3;};'use strict';var Sequelize=require(_0xb6ba('0x0'));var moment=require(_0xb6ba('0x1'));var path=require(_0xb6ba('0x2'));var config=require(_0xb6ba('0x3'));module['exports']={'format':{'type':Sequelize[_0xb6ba('0x4')],'get':function(){return this[_0xb6ba('0x5')](_0xb6ba('0x6'))?path[_0xb6ba('0x7')](this[_0xb6ba('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xb6ba('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xb6ba('0x8')],'set':function(_0x389a0d){var _0x3fd283=_0x389a0d[_0xb6ba('0x9')](/\\/g,'/');this[_0xb6ba('0xa')](_0xb6ba('0x6'),_0x3fd283);}},'rating':{'type':Sequelize[_0xb6ba('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb6ba('0xb')],'set':function(_0x36bdc2){this['setDataValue'](_0xb6ba('0xc'),moment()['subtract'](_0x36bdc2,'ms'));this['setDataValue']('closedAt',moment());this[_0xb6ba('0xa')](_0xb6ba('0xd'),_0x36bdc2);}},'startedAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this['getDataValue'](_0xb6ba('0xc')))[_0xb6ba('0xf')](_0xb6ba('0x10'))[_0xb6ba('0x11')]();}},'closedAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this[_0xb6ba('0x5')](_0xb6ba('0x12')))[_0xb6ba('0xf')](_0xb6ba('0x10'))[_0xb6ba('0x11')]();}},'createdAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this[_0xb6ba('0x5')](_0xb6ba('0x13')))[_0xb6ba('0xf')](_0xb6ba('0x10'))[_0xb6ba('0x11')]();}},'updatedAt':{'type':Sequelize[_0xb6ba('0xe')],'get':function(){return moment(this[_0xb6ba('0x5')](_0xb6ba('0x14')))['format'](_0xb6ba('0x10'))['toString']();}}}; \ No newline at end of file +var _0x29b1=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','closedAt'];(function(_0x414308,_0x53b84f){var _0x26b37a=function(_0x105d39){while(--_0x105d39){_0x414308['push'](_0x414308['shift']());}};_0x26b37a(++_0x53b84f);}(_0x29b1,0x16d));var _0x129b=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x29b1[_0xf50820];return _0x2a9b10;};'use strict';var Sequelize=require(_0x129b('0x0'));var moment=require(_0x129b('0x1'));var path=require(_0x129b('0x2'));var config=require(_0x129b('0x3'));module[_0x129b('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x129b('0x5')](_0x129b('0x6'))?path[_0x129b('0x7')](this[_0x129b('0x5')](_0x129b('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x129b('0x8')]},'channel':{'type':Sequelize[_0x129b('0x8')]},'value':{'type':Sequelize[_0x129b('0x8')],'set':function(_0x5ce8f9){var _0x3ef769=_0x5ce8f9['replace'](/\\/g,'/');this[_0x129b('0x9')](_0x129b('0x6'),_0x3ef769);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x129b('0xa')],'set':function(_0x1abf45){this['setDataValue'](_0x129b('0xb'),moment()['subtract'](_0x1abf45,'ms'));this[_0x129b('0x9')](_0x129b('0xc'),moment());this[_0x129b('0x9')]('duration',_0x1abf45);}},'startedAt':{'type':Sequelize[_0x129b('0xd')],'get':function(){return moment(this[_0x129b('0x5')](_0x129b('0xb')))[_0x129b('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x129b('0x5')]('closedAt'))[_0x129b('0xe')](_0x129b('0xf'))[_0x129b('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x129b('0x5')]('createdAt'))[_0x129b('0xe')](_0x129b('0xf'))[_0x129b('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x129b('0x5')](_0x129b('0x11')))[_0x129b('0xe')](_0x129b('0xf'))[_0x129b('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 98159fe..225528a 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 _0x8ef6=['keys','find','create','update','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','ValidationError','ScreenRecording\x20not\x20found','filename','extname','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params'];(function(_0x35e930,_0x4bfcca){var _0x405d7a=function(_0x361c5b){while(--_0x361c5b){_0x35e930['push'](_0x35e930['shift']());}};_0x405d7a(++_0x4bfcca);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2754a3,_0x1d03a2){_0x2754a3=_0x2754a3-0x0;var _0x22b0b5=_0x8ef6[_0x2754a3];return _0x22b0b5;};'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(){_0x312cc9[_0x68ef('0x1d')](0xcc)[_0x68ef('0x1c')]();});}};}function handleEntityNotFound(_0x13280b,_0x5e4dbe){return function(_0x178460){if(!_0x178460){_0x13280b['sendStatus'](0x194);}return _0x178460;};}function handleError(_0x599243,_0x55d8b0){_0x55d8b0=_0x55d8b0||0x1f4;return function(_0x1a7ce1){logger[_0x68ef('0x29')](_0x1a7ce1[_0x68ef('0x2a')]);if(_0x1a7ce1[_0x68ef('0x2b')]){delete _0x1a7ce1['name'];}_0x599243['status'](_0x55d8b0)[_0x68ef('0x2c')](_0x1a7ce1);};}exports[_0x68ef('0x2d')]=function(_0x7bf96,_0x263b30){var _0x22ef25={},_0x201884={},_0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x2e')][_0x68ef('0x2f')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x30')]['key']};});_0x201884[_0x68ef('0x31')]=_[_0x68ef('0x32')](_['map'](_0x4579cb,'name'),[_0x68ef('0x33')]);_0x201884[_0x68ef('0x34')]=_['keys'](_0x7bf96[_0x68ef('0x34')]);_0x201884[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x201884[_0x68ef('0x31')],_0x201884['query']);_0x22ef25[_0x68ef('0x37')]=_[_0x68ef('0x36')](_0x201884['model'],qs[_0x68ef('0x38')](_0x7bf96['query'][_0x68ef('0x38')]));_0x22ef25[_0x68ef('0x37')]=_0x22ef25['attributes'][_0x68ef('0x39')]?_0x22ef25['attributes']:_0x201884[_0x68ef('0x31')];if(!_0x7bf96['query'][_0x68ef('0x3a')](_0x68ef('0x3b'))){_0x22ef25[_0x68ef('0x21')]=qs['limit'](_0x7bf96[_0x68ef('0x34')]['limit']);_0x22ef25[_0x68ef('0x1f')]=qs['offset'](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x1f')]);}_0x22ef25[_0x68ef('0x3c')]=qs[_0x68ef('0x3d')](_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3d')]);_0x22ef25['where']=qs[_0x68ef('0x35')](_[_0x68ef('0x3e')](_0x7bf96[_0x68ef('0x34')],_0x201884['filters']),_0x4579cb);if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x3f')]){_0x22ef25[_0x68ef('0x40')]=_['merge'](_0x22ef25['where'],{'$or':_[_0x68ef('0x41')](_0x4579cb,function(_0xec7de3){if(_0xec7de3[_0x68ef('0x30')]!==_0x68ef('0x42')){var _0x401459={};_0x401459[_0xec7de3[_0x68ef('0x2b')]]={'$like':'%'+_0x7bf96[_0x68ef('0x34')]['filter']+'%'};return _0x401459;}})});}_0x22ef25=_[_0x68ef('0x43')]({},_0x22ef25,_0x7bf96[_0x68ef('0x44')]);var _0x2f6ee0={'where':_0x22ef25[_0x68ef('0x40')]};return db['ScreenRecording'][_0x68ef('0x45')](_0x2f6ee0)[_0x68ef('0x27')](function(_0xcf595d){_0x26288a[_0x68ef('0x45')]=_0xcf595d;if(_0x7bf96[_0x68ef('0x34')][_0x68ef('0x46')]){_0x22ef25['include']=[{'all':!![]}];}return db[_0x68ef('0x2e')][_0x68ef('0x47')](_0x22ef25);})[_0x68ef('0x27')](function(_0x43796b){_0x26288a[_0x68ef('0x48')]=_0x43796b;return _0x26288a;})[_0x68ef('0x27')](respondWithFilteredResult(_0x263b30,_0x22ef25))[_0x68ef('0x49')](handleError(_0x263b30,null));};exports[_0x68ef('0x4a')]=function(_0xc687ab,_0x531096){var _0xad1a28={'raw':![],'where':{'id':_0xc687ab[_0x68ef('0x4b')]['id']}},_0x19d7a1={};_0x19d7a1[_0x68ef('0x31')]=_[_0x68ef('0x4c')](db[_0x68ef('0x2e')][_0x68ef('0x2f')]);_0x19d7a1['query']=_[_0x68ef('0x4c')](_0xc687ab['query']);_0x19d7a1[_0x68ef('0x35')]=_[_0x68ef('0x36')](_0x19d7a1[_0x68ef('0x31')],_0x19d7a1[_0x68ef('0x34')]);_0xad1a28['attributes']=_[_0x68ef('0x36')](_0x19d7a1['model'],qs[_0x68ef('0x38')](_0xc687ab['query'][_0x68ef('0x38')]));_0xad1a28[_0x68ef('0x37')]=_0xad1a28[_0x68ef('0x37')]['length']?_0xad1a28['attributes']:_0x19d7a1[_0x68ef('0x31')];if(_0xc687ab[_0x68ef('0x34')]['includeAll']){_0xad1a28['include']=[{'all':!![]}];}_0xad1a28=_['merge']({},_0xad1a28,_0xc687ab[_0x68ef('0x44')]);return db[_0x68ef('0x2e')][_0x68ef('0x4d')](_0xad1a28)[_0x68ef('0x27')](handleEntityNotFound(_0x531096,null))[_0x68ef('0x27')](respondWithResult(_0x531096,null))['catch'](handleError(_0x531096,null));};exports['create']=function(_0xc39f5b,_0x21f064){return db[_0x68ef('0x2e')][_0x68ef('0x4e')](_0xc39f5b['body'],{})[_0x68ef('0x27')](respondWithResult(_0x21f064,0xc9))[_0x68ef('0x49')](handleError(_0x21f064,null));};exports[_0x68ef('0x4f')]=function(_0x14142a,_0x53880c){if(_0x14142a['body']['id']){delete _0x14142a[_0x68ef('0x50')]['id'];}delete _0x14142a[_0x68ef('0x50')]['duration'];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x51')];delete _0x14142a[_0x68ef('0x50')][_0x68ef('0x52')];delete _0x14142a[_0x68ef('0x50')]['value'];return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':{'id':_0x14142a[_0x68ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53880c,null))[_0x68ef('0x27')](saveUpdates(_0x14142a[_0x68ef('0x50')],null))[_0x68ef('0x27')](respondWithResult(_0x53880c,null))['catch'](handleError(_0x53880c,null));};exports[_0x68ef('0x53')]=function(_0x59e8ee,_0x574573){return db[_0x68ef('0x2e')]['describe']()[_0x68ef('0x27')](respondWithResult(_0x574573,null))[_0x68ef('0x49')](handleError(_0x574573,null));};exports[_0x68ef('0x54')]=function(_0x1e651f,_0x2a0be0,_0x45ae42){var _0x363498=require(_0x68ef('0x55'));var _0x2b35f4=![];var _0x247915={};if(_0x1e651f['query']['type']&&_0x1e651f[_0x68ef('0x34')][_0x68ef('0x30')]===_0x68ef('0x56')){_0x247915[_0x68ef('0x56')]=_0x1e651f[_0x68ef('0x4b')]['id'];}else{_0x247915['id']=_0x1e651f[_0x68ef('0x4b')]['id'];}return db[_0x68ef('0x2e')][_0x68ef('0x4d')]({'where':_0x247915,'attributes':['id',_0x68ef('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x2a0be0,null))['then'](function(_0x42a4b2){if(_0x42a4b2){var _0x5781c8=path[_0x68ef('0x58')](config['root'],_0x68ef('0x59'),_0x42a4b2[_0x68ef('0x57')]);var _0x552736=util[_0x68ef('0x33')]('%s.cypher',_0x5781c8);if(fs[_0x68ef('0x5a')](_0x552736)){_0x2b35f4=!![];return _0x363498[_0x68ef('0x5b')](_0x552736,_0x5781c8,config[_0x68ef('0x5c')][_0x68ef('0x5d')])[_0x68ef('0x27')](function(){return _0x42a4b2;});}return _0x42a4b2;}})[_0x68ef('0x27')](function(_0x5c347c){if(_0x5c347c){var _0x1cdaef=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],_0x68ef('0x59'),_0x5c347c[_0x68ef('0x57')]);if(!fs[_0x68ef('0x5a')](_0x1cdaef)){throw new db['Sequelize'][(_0x68ef('0x5f'))](_0x68ef('0x60'));}if(_0x5c347c['filename']){return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,_0x5c347c[_0x68ef('0x61')]+path[_0x68ef('0x62')](_0x1cdaef),function(){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}else{return _0x2a0be0[_0x68ef('0x54')](_0x1cdaef,function(_0x49d197){if(_0x2b35f4){fs['unlink'](_0x1cdaef);}});}}})[_0x68ef('0x49')](function(_0x540da5){if(_0x540da5[_0x68ef('0x63')]==='ScreenRecording\x20not\x20found'){_0x2a0be0[_0x68ef('0x1d')](0x194)[_0x68ef('0x2c')](_0x68ef('0x64'));}else{return handleError(_0x2a0be0,null);}});};exports[_0x68ef('0x28')]=function(_0x19ce17,_0x19a9c4){return db['ScreenRecording'][_0x68ef('0x4d')]({'where':{'id':_0x19ce17['params']['id']}})[_0x68ef('0x27')](function(_0x4b0c3e){if(_[_0x68ef('0x65')](_0x4b0c3e)){throw new ReferenceError(_0x68ef('0x66'));}return _0x4b0c3e;})[_0x68ef('0x27')](function(_0xf0a40f){var _0x2f409c=path[_0x68ef('0x58')](config[_0x68ef('0x5e')],'server/files/screen_recordings',_0xf0a40f[_0x68ef('0x57')]);logger[_0x68ef('0x67')](_0x68ef('0x68'),_0x2f409c);if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs['existsSync'](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}_0x2f409c=_0x2f409c+'.cypher';if(!_[_0x68ef('0x65')](_0xf0a40f[_0x68ef('0x57')])&&fs[_0x68ef('0x5a')](_0x2f409c)){logger[_0x68ef('0x67')]('File:\x20\x22'+_0x2f409c+_0x68ef('0x69'));fs['unlinkSync'](_0x2f409c);}return _0xf0a40f;})[_0x68ef('0x27')](function(_0x2d916e){if(!_0x2d916e)throw new InternalError();return _0x2d916e[_0x68ef('0x28')]();})['then'](function(){_0x19a9c4['status'](0xcc)[_0x68ef('0x1c')]();})[_0x68ef('0x49')](handleError(_0x19a9c4,null));}; \ No newline at end of file +var _0x7fbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','find','catch','create','body','duration','createdAt','closedAt','params','describe','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x597acf,_0x4dfb41){var _0x401de0=function(_0x389327){while(--_0x389327){_0x597acf['push'](_0x597acf['shift']());}};_0x401de0(++_0x4dfb41);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x508d16,_0x3e5c76){_0x508d16=_0x508d16-0x0;var _0x169e38=_0x7fbe[_0x508d16];return _0x169e38;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();});}};}function handleEntityNotFound(_0x2996ae,_0x4f6c73){return function(_0x6c930){if(!_0x6c930){_0x2996ae[_0xe7fb('0x1b')](0x194);}return _0x6c930;};}function handleError(_0x390f32,_0x1ceed8){_0x1ceed8=_0x1ceed8||0x1f4;return function(_0x392d75){logger[_0xe7fb('0x28')](_0x392d75[_0xe7fb('0x29')]);if(_0x392d75['name']){delete _0x392d75['name'];}_0x390f32[_0xe7fb('0x1c')](_0x1ceed8)[_0xe7fb('0x2a')](_0x392d75);};}exports[_0xe7fb('0x2b')]=function(_0x4fd290,_0xb1f2f4){var _0x251807={},_0xd3fffe={},_0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x2c')](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x2f')],'type':_0x4ce993[_0xe7fb('0x30')][_0xe7fb('0x31')]};});_0xd3fffe['model']=_['differenceBy'](_[_0xe7fb('0x2c')](_0x219554,'name'),[_0xe7fb('0x32')]);_0xd3fffe[_0xe7fb('0x33')]=_[_0xe7fb('0x34')](_0x4fd290[_0xe7fb('0x33')]);_0xd3fffe['filters']=_[_0xe7fb('0x35')](_0xd3fffe[_0xe7fb('0x36')],_0xd3fffe[_0xe7fb('0x33')]);_0x251807[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xd3fffe['model'],qs[_0xe7fb('0x38')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x251807[_0xe7fb('0x37')]=_0x251807[_0xe7fb('0x37')][_0xe7fb('0x39')]?_0x251807[_0xe7fb('0x37')]:_0xd3fffe[_0xe7fb('0x36')];if(!_0x4fd290[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x3a'))){_0x251807[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x4fd290['query'][_0xe7fb('0x20')]);_0x251807[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x1e')]);}_0x251807[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x251807[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x4fd290[_0xe7fb('0x33')],_0xd3fffe[_0xe7fb('0x3e')]),_0x219554);if(_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x251807[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x251807[_0xe7fb('0x3d')],{'$or':_['map'](_0x219554,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x30')]!==_0xe7fb('0x42')){var _0x444f98={};_0x444f98[_0x261ec5['name']]={'$like':'%'+_0x4fd290[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x444f98;}})});}_0x251807=_[_0xe7fb('0x41')]({},_0x251807,_0x4fd290[_0xe7fb('0x43')]);var _0x49fe9d={'where':_0x251807[_0xe7fb('0x3d')]};return db[_0xe7fb('0x2d')][_0xe7fb('0x21')](_0x49fe9d)[_0xe7fb('0x26')](function(_0x468d16){_0x5f265f[_0xe7fb('0x21')]=_0x468d16;if(_0x4fd290['query'][_0xe7fb('0x44')]){_0x251807[_0xe7fb('0x45')]=[{'all':!![]}];}return db[_0xe7fb('0x2d')]['findAll'](_0x251807);})[_0xe7fb('0x26')](function(_0x3a8c52){_0x5f265f['rows']=_0x3a8c52;return _0x5f265f;})['then'](respondWithFilteredResult(_0xb1f2f4,_0x251807))['catch'](handleError(_0xb1f2f4,null));};exports['show']=function(_0x5e0153,_0x900d67){var _0x957ca3={'raw':![],'where':{'id':_0x5e0153['params']['id']}},_0xed62e9={};_0xed62e9[_0xe7fb('0x36')]=_['keys'](db[_0xe7fb('0x2d')][_0xe7fb('0x2e')]);_0xed62e9['query']=_[_0xe7fb('0x34')](_0x5e0153[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x3e')]=_[_0xe7fb('0x35')](_0xed62e9['model'],_0xed62e9[_0xe7fb('0x33')]);_0x957ca3[_0xe7fb('0x37')]=_[_0xe7fb('0x35')](_0xed62e9['model'],qs[_0xe7fb('0x38')](_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x38')]));_0x957ca3[_0xe7fb('0x37')]=_0x957ca3[_0xe7fb('0x37')]['length']?_0x957ca3[_0xe7fb('0x37')]:_0xed62e9['model'];if(_0x5e0153[_0xe7fb('0x33')][_0xe7fb('0x44')]){_0x957ca3[_0xe7fb('0x45')]=[{'all':!![]}];}_0x957ca3=_[_0xe7fb('0x41')]({},_0x957ca3,_0x5e0153[_0xe7fb('0x43')]);return db['ScreenRecording'][_0xe7fb('0x46')](_0x957ca3)['then'](handleEntityNotFound(_0x900d67,null))['then'](respondWithResult(_0x900d67,null))[_0xe7fb('0x47')](handleError(_0x900d67,null));};exports[_0xe7fb('0x48')]=function(_0x16327f,_0x589555){return db[_0xe7fb('0x2d')][_0xe7fb('0x48')](_0x16327f['body'],{})['then'](respondWithResult(_0x589555,0xc9))[_0xe7fb('0x47')](handleError(_0x589555,null));};exports[_0xe7fb('0x25')]=function(_0x1cbf34,_0x3dd6bf){if(_0x1cbf34[_0xe7fb('0x49')]['id']){delete _0x1cbf34[_0xe7fb('0x49')]['id'];}delete _0x1cbf34[_0xe7fb('0x49')][_0xe7fb('0x4a')];delete _0x1cbf34['body'][_0xe7fb('0x4b')];delete _0x1cbf34['body'][_0xe7fb('0x4c')];delete _0x1cbf34[_0xe7fb('0x49')]['value'];return db[_0xe7fb('0x2d')]['find']({'where':{'id':_0x1cbf34[_0xe7fb('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd6bf,null))[_0xe7fb('0x26')](saveUpdates(_0x1cbf34['body'],null))[_0xe7fb('0x26')](respondWithResult(_0x3dd6bf,null))['catch'](handleError(_0x3dd6bf,null));};exports[_0xe7fb('0x4e')]=function(_0x1b6442,_0x41fcfb){return db[_0xe7fb('0x2d')][_0xe7fb('0x4e')]()[_0xe7fb('0x26')](respondWithResult(_0x41fcfb,null))[_0xe7fb('0x47')](handleError(_0x41fcfb,null));};exports['download']=function(_0x5d20dc,_0x20aa55,_0x4948a7){var _0x4f4240=require('../../components/encryptor');var _0x50b8df=![];var _0x539252={};if(_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]&&_0x5d20dc[_0xe7fb('0x33')][_0xe7fb('0x30')]==='uniqueid'){_0x539252[_0xe7fb('0x4f')]=_0x5d20dc[_0xe7fb('0x4d')]['id'];}else{_0x539252['id']=_0x5d20dc[_0xe7fb('0x4d')]['id'];}return db['ScreenRecording']['find']({'where':_0x539252,'attributes':['id',_0xe7fb('0x50')],'raw':!![]})[_0xe7fb('0x26')](handleEntityNotFound(_0x20aa55,null))[_0xe7fb('0x26')](function(_0x4f4ba3){if(_0x4f4ba3){var _0x27f860=path[_0xe7fb('0x51')](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x4f4ba3['value']);var _0x4b35f9=util[_0xe7fb('0x32')](_0xe7fb('0x54'),_0x27f860);if(fs[_0xe7fb('0x55')](_0x4b35f9)){_0x50b8df=!![];return _0x4f4240[_0xe7fb('0x56')](_0x4b35f9,_0x27f860,config[_0xe7fb('0x57')]['recording'])[_0xe7fb('0x26')](function(){return _0x4f4ba3;});}return _0x4f4ba3;}})[_0xe7fb('0x26')](function(_0x23755b){if(_0x23755b){var _0x590d7a=path['join'](config[_0xe7fb('0x52')],_0xe7fb('0x53'),_0x23755b[_0xe7fb('0x50')]);if(!fs[_0xe7fb('0x55')](_0x590d7a)){throw new db[(_0xe7fb('0x58'))][(_0xe7fb('0x59'))]('ScreenRecording\x20not\x20found');}if(_0x23755b[_0xe7fb('0x5a')]){return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,_0x23755b[_0xe7fb('0x5a')]+path[_0xe7fb('0x5c')](_0x590d7a),function(){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}else{return _0x20aa55[_0xe7fb('0x5b')](_0x590d7a,function(_0x554092){if(_0x50b8df){fs[_0xe7fb('0x5d')](_0x590d7a);}});}}})['catch'](function(_0x1eda1d){if(_0x1eda1d[_0xe7fb('0x5e')]===_0xe7fb('0x5f')){_0x20aa55[_0xe7fb('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x20aa55,null);}});};exports[_0xe7fb('0x60')]=function(_0x11e15a,_0x25aeb2){return db[_0xe7fb('0x2d')][_0xe7fb('0x46')]({'where':{'id':_0x11e15a['params']['id']}})[_0xe7fb('0x26')](function(_0x58d4ec){if(_[_0xe7fb('0x61')](_0x58d4ec)){throw new ReferenceError('Entity\x20not\x20found');}return _0x58d4ec;})['then'](function(_0xc13fac){var _0x203da3=path[_0xe7fb('0x51')](config['root'],_0xe7fb('0x53'),_0xc13fac[_0xe7fb('0x50')]);logger[_0xe7fb('0x62')](_0xe7fb('0x63'),_0x203da3);if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')]('File:\x20\x22'+_0x203da3+_0xe7fb('0x64'));fs[_0xe7fb('0x65')](_0x203da3);}_0x203da3=_0x203da3+'.cypher';if(!_[_0xe7fb('0x61')](_0xc13fac['value'])&&fs[_0xe7fb('0x55')](_0x203da3)){logger[_0xe7fb('0x62')](_0xe7fb('0x66')+_0x203da3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe7fb('0x65')](_0x203da3);}return _0xc13fac;})[_0xe7fb('0x26')](function(_0x2c558a){if(!_0x2c558a)throw new InternalError();return _0x2c558a[_0xe7fb('0x60')]();})[_0xe7fb('0x26')](function(){_0x25aeb2[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x27')]();})[_0xe7fb('0x47')](handleError(_0x25aeb2,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index f423513..c0e0880 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 _0x5f98=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash'];(function(_0x447b23,_0x49c577){var _0x2f37c7=function(_0x19d049){while(--_0x19d049){_0x447b23['push'](_0x447b23['shift']());}};_0x2f37c7(++_0x49c577);}(_0x5f98,0xa8));var _0x85f9=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5f98[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x85f9('0x0'));var util=require(_0x85f9('0x1'));var logger=require(_0x85f9('0x2'))('api');var moment=require(_0x85f9('0x3'));var BPromise=require(_0x85f9('0x4'));var rp=require(_0x85f9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85f9('0x6'));var config=require(_0x85f9('0x7'));var attributes=require(_0x85f9('0x8'));module[_0x85f9('0x9')]=function(_0xdeea0e,_0x8b7d44){return _0xdeea0e[_0x85f9('0xa')]('ScreenRecording',attributes,{'tableName':_0x85f9('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x85f9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2094=['rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x285b5f,_0x207e93){var _0x4cf41d=function(_0x42e4fc){while(--_0x42e4fc){_0x285b5f['push'](_0x285b5f['shift']());}};_0x4cf41d(++_0x207e93);}(_0x2094,0x84));var _0x4209=function(_0xe46922,_0x8b20fc){_0xe46922=_0xe46922-0x0;var _0x3644db=_0x2094[_0xe46922];return _0x3644db;};'use strict';var _=require(_0x4209('0x0'));var util=require(_0x4209('0x1'));var logger=require(_0x4209('0x2'))(_0x4209('0x3'));var moment=require(_0x4209('0x4'));var BPromise=require(_0x4209('0x5'));var rp=require(_0x4209('0x6'));var fs=require('fs');var path=require(_0x4209('0x7'));var rimraf=require(_0x4209('0x8'));var config=require(_0x4209('0x9'));var attributes=require(_0x4209('0xa'));module['exports']=function(_0xadc0e6,_0x1027bd){return _0xadc0e6['define'](_0x4209('0xb'),attributes,{'tableName':_0x4209('0xc'),'paranoid':![],'indexes':[{'name':_0x4209('0xd'),'fields':[_0x4209('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 9142167..267cdce 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 _0xe0f5=['rpc','../../config/environment','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger'];(function(_0xdbbed5,_0x2425c7){var _0x477079=function(_0x59d18b){while(--_0x59d18b){_0xdbbed5['push'](_0xdbbed5['shift']());}};_0x477079(++_0x2425c7);}(_0xe0f5,0x1ef));var _0x5e0f=function(_0x483e3a,_0x568361){_0x483e3a=_0x483e3a-0x0;var _0x43fca9=_0xe0f5[_0x483e3a];return _0x43fca9;};'use strict';var _=require(_0x5e0f('0x0'));var util=require(_0x5e0f('0x1'));var moment=require('moment');var BPromise=require(_0x5e0f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e0f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e0f('0x4'))(_0x5e0f('0x5'));var config=require(_0x5e0f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5e0f('0x7')][_0x5e0f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53ff29,_0x3fb6ec,_0x437136){return new BPromise(function(_0x390660,_0x2f6658){return client[_0x5e0f('0x9')](_0x53ff29,_0x437136)[_0x5e0f('0xa')](function(_0x15d940){logger['info'](_0x5e0f('0xb'),_0x3fb6ec,_0x5e0f('0xc'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x3fb6ec,_0x5e0f('0xc'),JSON[_0x5e0f('0xd')](_0x15d940));if(_0x15d940['error']){if(_0x15d940[_0x5e0f('0xe')][_0x5e0f('0xf')]===0x1f4){logger[_0x5e0f('0xe')](_0x5e0f('0xb'),_0x3fb6ec,_0x15d940['error']['message']);return _0x2f6658(_0x15d940[_0x5e0f('0xe')]['message']);}logger['error'](_0x5e0f('0xb'),_0x3fb6ec,_0x15d940[_0x5e0f('0xe')][_0x5e0f('0x10')]);return _0x390660(_0x15d940[_0x5e0f('0xe')][_0x5e0f('0x10')]);}else{logger[_0x5e0f('0x11')](_0x5e0f('0xb'),_0x3fb6ec,_0x5e0f('0xc'));_0x390660(_0x15d940[_0x5e0f('0x12')]['message']);}})[_0x5e0f('0x13')](function(_0x5f3393){logger[_0x5e0f('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x3fb6ec,_0x5f3393);_0x2f6658(_0x5f3393);});});} \ No newline at end of file +var _0x611f=['stringify','error','code','message','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x611f,0xd7));var _0xf611=function(_0xe7dfc2,_0x59ef08){_0xe7dfc2=_0xe7dfc2-0x0;var _0x17aa52=_0x611f[_0xe7dfc2];return _0x17aa52;};'use strict';var _=require(_0xf611('0x0'));var util=require('util');var moment=require(_0xf611('0x1'));var BPromise=require(_0xf611('0x2'));var rs=require(_0xf611('0x3'));var fs=require('fs');var Redis=require(_0xf611('0x4'));var db=require(_0xf611('0x5'))['db'];var utils=require(_0xf611('0x6'));var logger=require(_0xf611('0x7'))(_0xf611('0x8'));var config=require(_0xf611('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf611('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dcb65,_0x726d05,_0x55382a){return new BPromise(function(_0x48d82a,_0x19e63a){return client[_0xf611('0xb')](_0x2dcb65,_0x55382a)[_0xf611('0xc')](function(_0x2a2362){logger['info'](_0xf611('0xd'),_0x726d05,_0xf611('0xe'));logger[_0xf611('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x726d05,_0xf611('0xe'),JSON[_0xf611('0x10')](_0x2a2362));if(_0x2a2362[_0xf611('0x11')]){if(_0x2a2362[_0xf611('0x11')][_0xf611('0x12')]===0x1f4){logger[_0xf611('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x726d05,_0x2a2362[_0xf611('0x11')][_0xf611('0x13')]);return _0x19e63a(_0x2a2362['error'][_0xf611('0x13')]);}logger[_0xf611('0x11')](_0xf611('0xd'),_0x726d05,_0x2a2362[_0xf611('0x11')][_0xf611('0x13')]);return _0x48d82a(_0x2a2362[_0xf611('0x11')][_0xf611('0x13')]);}else{logger[_0xf611('0x14')](_0xf611('0xd'),_0x726d05,'request\x20sent');_0x48d82a(_0x2a2362['result'][_0xf611('0x13')]);}})['catch'](function(_0x1dc088){logger['error'](_0xf611('0xd'),_0x726d05,_0x1dc088);_0x19e63a(_0x1dc088);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 9f743c7..b9647f2 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 _0xd0e5=['single','file','addLogo','join','server/files/images/logos/','logologin','addLogoLogin','addPreferred','favicon','addFavicon','put','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','format','%s%s','logo','extname','originalname','post'];(function(_0x2b48ac,_0x29442a){var _0x20ab20=function(_0x3c19ee){while(--_0x3c19ee){_0x2b48ac['push'](_0x2b48ac['shift']());}};_0x20ab20(++_0x29442a);}(_0xd0e5,0xb9));var _0x5d0e=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xd0e5[_0x8dc04d];return _0x2f5f28;};'use strict';var multer=require(_0x5d0e('0x0'));var util=require(_0x5d0e('0x1'));var path=require('path');var timeout=require(_0x5d0e('0x2'));var express=require('express');var router=express[_0x5d0e('0x3')]();var fs_extra=require(_0x5d0e('0x4'));var auth=require(_0x5d0e('0x5'));var interaction=require(_0x5d0e('0x6'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x5d0e('0x7')]('/',auth[_0x5d0e('0x8')](),controller[_0x5d0e('0x9')]);router[_0x5d0e('0x7')]('/now',controller[_0x5d0e('0xa')]);router['get'](_0x5d0e('0xb'),controller[_0x5d0e('0xc')]);router[_0x5d0e('0x7')](_0x5d0e('0xd'),controller['getLogo']);router[_0x5d0e('0x7')](_0x5d0e('0xe'),controller[_0x5d0e('0xf')]);router[_0x5d0e('0x7')](_0x5d0e('0x10'),controller[_0x5d0e('0x11')]);router[_0x5d0e('0x7')](_0x5d0e('0x12'),controller[_0x5d0e('0x13')]);router['get'](_0x5d0e('0x14'),controller[_0x5d0e('0x15')]);var upload=multer({'storage':multer[_0x5d0e('0x16')]({'destination':function(_0x37fdc4,_0x49e124,_0x374f67){_0x374f67(null,path['join'](config[_0x5d0e('0x17')],'server/files/images/logos/'));},'filename':function(_0x23fe25,_0x4fdd8e,_0x2fe74f){_0x2fe74f(null,util[_0x5d0e('0x18')](_0x5d0e('0x19'),_0x5d0e('0x1a'),path[_0x5d0e('0x1b')](_0x4fdd8e[_0x5d0e('0x1c')])));}})});router[_0x5d0e('0x1d')](_0x5d0e('0xd'),upload[_0x5d0e('0x1e')](_0x5d0e('0x1f')),controller[_0x5d0e('0x20')]);var upload=multer({'storage':multer[_0x5d0e('0x16')]({'destination':function(_0x5012f1,_0x25ec78,_0x292418){_0x292418(null,path[_0x5d0e('0x21')](config[_0x5d0e('0x17')],_0x5d0e('0x22')));},'filename':function(_0x192ef5,_0x9f3f83,_0x27aa24){_0x27aa24(null,util[_0x5d0e('0x18')](_0x5d0e('0x19'),_0x5d0e('0x23'),path[_0x5d0e('0x1b')](_0x9f3f83[_0x5d0e('0x1c')])));}})});router[_0x5d0e('0x1d')]('/:id/logo_login',upload['single'](_0x5d0e('0x1f')),controller[_0x5d0e('0x24')]);var upload=multer({'storage':multer[_0x5d0e('0x16')]({'destination':function(_0x1a0823,_0x3def7b,_0x128922){_0x128922(null,path[_0x5d0e('0x21')](config[_0x5d0e('0x17')],_0x5d0e('0x22')));},'filename':function(_0x15b2a4,_0x47255a,_0x5c0a79){_0x5c0a79(null,util[_0x5d0e('0x18')]('%s%s','preferred',path['extname'](_0x47255a[_0x5d0e('0x1c')])));}})});router[_0x5d0e('0x1d')]('/:id/preferred',upload[_0x5d0e('0x1e')](_0x5d0e('0x1f')),controller[_0x5d0e('0x25')]);var upload=multer({'storage':multer[_0x5d0e('0x16')]({'destination':function(_0x4d6c88,_0x1cd08c,_0x27f4d3){_0x27f4d3(null,path[_0x5d0e('0x21')](config['root'],_0x5d0e('0x22')));},'filename':function(_0x594eed,_0xb9f116,_0x568133){_0x568133(null,util[_0x5d0e('0x18')](_0x5d0e('0x19'),_0x5d0e('0x26'),path[_0x5d0e('0x1b')](_0xb9f116[_0x5d0e('0x1c')])));}})});router[_0x5d0e('0x1d')]('/:id/favicon',upload[_0x5d0e('0x1e')](_0x5d0e('0x1f')),controller[_0x5d0e('0x27')]);router[_0x5d0e('0x28')]('/:id',auth[_0x5d0e('0x8')](),controller[_0x5d0e('0x29')]);module[_0x5d0e('0x2a')]=router; \ No newline at end of file +var _0x3286=['addPreferred','addFavicon','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','diskStorage','root','%s%s','logo','originalname','single','addLogo','join','server/files/images/logos/','format','logologin','extname','post','file','addLogoLogin','/:id/preferred'];(function(_0x1e1a63,_0x2f2793){var _0xb4deb0=function(_0x26ffb5){while(--_0x26ffb5){_0x1e1a63['push'](_0x1e1a63['shift']());}};_0xb4deb0(++_0x2f2793);}(_0x3286,0x1b2));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6328('0x0'));var util=require(_0x6328('0x1'));var path=require(_0x6328('0x2'));var timeout=require(_0x6328('0x3'));var express=require(_0x6328('0x4'));var router=express[_0x6328('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6328('0x6'));var interaction=require(_0x6328('0x7'));var config=require(_0x6328('0x8'));var controller=require(_0x6328('0x9'));router[_0x6328('0xa')]('/',auth[_0x6328('0xb')](),controller[_0x6328('0xc')]);router[_0x6328('0xa')](_0x6328('0xd'),controller['getDate']);router[_0x6328('0xa')](_0x6328('0xe'),controller[_0x6328('0xf')]);router[_0x6328('0xa')](_0x6328('0x10'),controller['getLogo']);router[_0x6328('0xa')](_0x6328('0x11'),controller[_0x6328('0x12')]);router['get'](_0x6328('0x13'),controller[_0x6328('0x14')]);router['get']('/:id/preferred',controller[_0x6328('0x15')]);router[_0x6328('0xa')](_0x6328('0x16'),controller['getFavicon']);var upload=multer({'storage':multer[_0x6328('0x17')]({'destination':function(_0xa472a1,_0x4da5ff,_0x2baacf){_0x2baacf(null,path['join'](config[_0x6328('0x18')],'server/files/images/logos/'));},'filename':function(_0x47c084,_0x56075b,_0x16baac){_0x16baac(null,util['format'](_0x6328('0x19'),_0x6328('0x1a'),path['extname'](_0x56075b[_0x6328('0x1b')])));}})});router['post'](_0x6328('0x10'),upload[_0x6328('0x1c')]('file'),controller[_0x6328('0x1d')]);var upload=multer({'storage':multer[_0x6328('0x17')]({'destination':function(_0x3ae938,_0x2b1ff5,_0x5b42c0){_0x5b42c0(null,path[_0x6328('0x1e')](config[_0x6328('0x18')],_0x6328('0x1f')));},'filename':function(_0xb8f200,_0x508b3f,_0x1233ad){_0x1233ad(null,util[_0x6328('0x20')]('%s%s',_0x6328('0x21'),path[_0x6328('0x22')](_0x508b3f['originalname'])));}})});router[_0x6328('0x23')](_0x6328('0x11'),upload[_0x6328('0x1c')](_0x6328('0x24')),controller[_0x6328('0x25')]);var upload=multer({'storage':multer[_0x6328('0x17')]({'destination':function(_0x517575,_0x5ed577,_0x2db21d){_0x2db21d(null,path[_0x6328('0x1e')](config['root'],_0x6328('0x1f')));},'filename':function(_0x24ceea,_0x487756,_0x141ccd){_0x141ccd(null,util[_0x6328('0x20')](_0x6328('0x19'),'preferred',path[_0x6328('0x22')](_0x487756[_0x6328('0x1b')])));}})});router[_0x6328('0x23')](_0x6328('0x26'),upload['single'](_0x6328('0x24')),controller[_0x6328('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bdb0e,_0x190dd6,_0x197803){_0x197803(null,path[_0x6328('0x1e')](config[_0x6328('0x18')],_0x6328('0x1f')));},'filename':function(_0xe1ef23,_0x25a58c,_0xbf1c17){_0xbf1c17(null,util[_0x6328('0x20')](_0x6328('0x19'),'favicon',path[_0x6328('0x22')](_0x25a58c['originalname'])));}})});router[_0x6328('0x23')](_0x6328('0x16'),upload['single'](_0x6328('0x24')),controller[_0x6328('0x28')]);router[_0x6328('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x6328('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index cb5395a..c8f11ea 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x471e6c,_0x2ddd1a){var _0x2925a1=function(_0x47253a){while(--_0x47253a){_0x471e6c['push'](_0x471e6c['shift']());}};_0x2925a1(++_0x2ddd1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x17cc05,_0x23e66a){var _0x56ba4e=function(_0x2f2646){while(--_0x2f2646){_0x17cc05['push'](_0x17cc05['shift']());}};_0x56ba4e(++_0x23e66a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 4c9d5e7..9448c73 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 _0x394f=['default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','../../config/license/util','getLogoLogin','server/files/images/logos','default_loginLogo.svg','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','debug','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','map','Setting','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','intersection','length','include','body','find','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg'];(function(_0xd5ff8f,_0x2bdc8f){var _0x1e8a6e=function(_0x23f970){while(--_0x23f970){_0xd5ff8f['push'](_0xd5ff8f['shift']());}};_0x1e8a6e(++_0x2bdc8f);}(_0x394f,0x8f));var _0xf394=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x394f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf394('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf394('0x1'));var jsonpatch=require(_0xf394('0x2'));var rp=require(_0xf394('0x3'));var moment=require(_0xf394('0x4'));var BPromise=require(_0xf394('0x5'));var Mustache=require(_0xf394('0x6'));var util=require(_0xf394('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf394('0x8'));var squel=require(_0xf394('0x9'));var crypto=require(_0xf394('0xa'));var jsforce=require(_0xf394('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf394('0xc'));var Redis=require(_0xf394('0xd'));var authService=require(_0xf394('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf394('0xf'));var hardwareService=require(_0xf394('0x10'));var logger=require('../../config/logger')(_0xf394('0x11'));var utils=require(_0xf394('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf394('0x13'))['db'];var jayson=require(_0xf394('0x14'));var client=jayson[_0xf394('0x15')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2668ce,_0x509d8a,_0x5eb3a2,_0x457117){return new BPromise(function(_0x56bfa0,_0xad56c9){var _0x25c4cd=_0x457117||client;return _0x25c4cd[_0xf394('0x16')](_0x2668ce,_0x5eb3a2)[_0xf394('0x17')](function(_0x2374a9){logger[_0xf394('0x18')](_0xf394('0x19'),_0x509d8a,'request\x20sent');logger[_0xf394('0x1a')]('Setting,\x20%s,\x20%s,\x20%s',_0x509d8a,'request\x20sent',JSON[_0xf394('0x1b')](_0x2374a9));if(_0x2374a9[_0xf394('0x1c')]){if(_0x2374a9[_0xf394('0x1c')]['code']===0x1f4){logger[_0xf394('0x1c')]('Setting,\x20%s,\x20%s',_0x509d8a,_0x2374a9[_0xf394('0x1c')]['message']);return _0xad56c9(_0x2374a9['error'][_0xf394('0x1d')]);}logger[_0xf394('0x1c')](_0xf394('0x19'),_0x509d8a,_0x2374a9['error'][_0xf394('0x1d')]);return _0x56bfa0(_0x2374a9[_0xf394('0x1c')][_0xf394('0x1d')]);}else{logger[_0xf394('0x18')](_0xf394('0x19'),_0x509d8a,'request\x20sent');_0x56bfa0(_0x2374a9['result'][_0xf394('0x1d')]);}})[_0xf394('0x1e')](function(_0x4a59bf){logger[_0xf394('0x1c')](_0xf394('0x19'),_0x509d8a,_0x4a59bf);_0xad56c9(_0x4a59bf);});});}function respondWithStatusCode(_0x310157,_0xf2985e){_0xf2985e=_0xf2985e||0xcc;return function(_0x4abe18){if(_0x4abe18){return _0x310157[_0xf394('0x1f')](_0xf2985e);}return _0x310157[_0xf394('0x20')](_0xf2985e)[_0xf394('0x21')]();};}function respondWithResult(_0x13797a,_0x2a30b6){_0x2a30b6=_0x2a30b6||0xc8;return function(_0x4fc8f8){if(_0x4fc8f8){return _0x13797a[_0xf394('0x20')](_0x2a30b6)[_0xf394('0x22')](_0x4fc8f8);}};}function respondWithFilteredResult(_0x593277,_0x1bf372){return function(_0x2e4cba){if(_0x2e4cba){var _0x53e2fc=typeof _0x1bf372[_0xf394('0x23')]===_0xf394('0x24')&&typeof _0x1bf372[_0xf394('0x25')]===_0xf394('0x24');var _0x229c8c=_0x2e4cba[_0xf394('0x26')];var _0x294a3c=_0x53e2fc?0x0:_0x1bf372[_0xf394('0x23')];var _0x224aa2=_0x53e2fc?_0x2e4cba['count']:_0x1bf372[_0xf394('0x23')]+_0x1bf372[_0xf394('0x25')];var _0x205d40;if(_0x224aa2>=_0x229c8c){_0x224aa2=_0x229c8c;_0x205d40=0xc8;}else{_0x205d40=0xce;}_0x593277['status'](_0x205d40);return _0x593277[_0xf394('0x27')](_0xf394('0x28'),_0x294a3c+'-'+_0x224aa2+'/'+_0x229c8c)['json'](_0x2e4cba);}return null;};}function patchUpdates(_0x21f5f8){return function(_0x264f94){try{jsonpatch[_0xf394('0x29')](_0x264f94,_0x21f5f8,!![]);}catch(_0xfe7df2){return BPromise[_0xf394('0x2a')](_0xfe7df2);}return _0x264f94['save']();};}function saveUpdates(_0x438a95,_0x5d5aa1){return function(_0x2e7382){if(_0x2e7382){return _0x2e7382[_0xf394('0x2b')](_0x438a95)[_0xf394('0x17')](function(_0x5ab843){return _0x5ab843;});}return null;};}function removeEntity(_0x3f6b47,_0x3e8d6a){return function(_0x3f3660){if(_0x3f3660){return _0x3f3660[_0xf394('0x2c')]()[_0xf394('0x17')](function(){_0x3f6b47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1acba6,_0x3e7fd1){return function(_0x250520){if(!_0x250520){_0x1acba6[_0xf394('0x1f')](0x194);}return _0x250520;};}function handleError(_0x1fdec7,_0x94adf9){_0x94adf9=_0x94adf9||0x1f4;return function(_0x5c1686){logger[_0xf394('0x1c')](_0x5c1686[_0xf394('0x2d')]);if(_0x5c1686[_0xf394('0x2e')]){delete _0x5c1686[_0xf394('0x2e')];}_0x1fdec7[_0xf394('0x20')](_0x94adf9)['send'](_0x5c1686);};}exports['index']=function(_0x2267d1,_0x5dfb96){var _0x1c6be2={},_0x98796b={},_0x221184={'count':0x0,'rows':[]};var _0x4186d9=_[_0xf394('0x2f')](db[_0xf394('0x30')]['rawAttributes'],function(_0x1f3e97){return{'name':_0x1f3e97[_0xf394('0x31')],'type':_0x1f3e97[_0xf394('0x32')][_0xf394('0x33')]};});_0x98796b[_0xf394('0x34')]=_[_0xf394('0x2f')](_0x4186d9,_0xf394('0x2e'));_0x98796b[_0xf394('0x35')]=_[_0xf394('0x36')](_0x2267d1['query']);_0x98796b[_0xf394('0x37')]=_['intersection'](_0x98796b[_0xf394('0x34')],_0x98796b[_0xf394('0x35')]);_0x1c6be2['attributes']=_['intersection'](_0x98796b[_0xf394('0x34')],qs[_0xf394('0x38')](_0x2267d1[_0xf394('0x35')][_0xf394('0x38')]));_0x1c6be2[_0xf394('0x39')]=_0x1c6be2[_0xf394('0x39')]['length']?_0x1c6be2[_0xf394('0x39')]:_0x98796b['model'];if(!_0x2267d1[_0xf394('0x35')][_0xf394('0x3a')](_0xf394('0x3b'))){_0x1c6be2[_0xf394('0x25')]=qs[_0xf394('0x25')](_0x2267d1['query']['limit']);_0x1c6be2[_0xf394('0x23')]=qs[_0xf394('0x23')](_0x2267d1[_0xf394('0x35')]['offset']);}_0x1c6be2[_0xf394('0x3c')]=qs[_0xf394('0x3d')](_0x2267d1['query'][_0xf394('0x3d')]);_0x1c6be2['where']=qs[_0xf394('0x37')](_['pick'](_0x2267d1[_0xf394('0x35')],_0x98796b['filters']),_0x4186d9);if(_0x2267d1['query'][_0xf394('0x3e')]){_0x1c6be2['where']=_[_0xf394('0x3f')](_0x1c6be2[_0xf394('0x40')],{'$or':_[_0xf394('0x2f')](_0x4186d9,function(_0xc77d2d){if(_0xc77d2d[_0xf394('0x32')]!==_0xf394('0x41')){var _0x18e73e={};_0x18e73e[_0xc77d2d[_0xf394('0x2e')]]={'$like':'%'+_0x2267d1[_0xf394('0x35')][_0xf394('0x3e')]+'%'};return _0x18e73e;}})});}_0x1c6be2=_[_0xf394('0x3f')]({},_0x1c6be2,_0x2267d1[_0xf394('0x42')]);var _0x51c719={'where':_0x1c6be2[_0xf394('0x40')]};return db['Setting'][_0xf394('0x26')](_0x51c719)['then'](function(_0x2736a3){_0x221184['count']=_0x2736a3;if(_0x2267d1['query'][_0xf394('0x43')]){_0x1c6be2['include']=[{'all':!![]}];}return db[_0xf394('0x30')][_0xf394('0x44')](_0x1c6be2);})[_0xf394('0x17')](function(_0x17e537){_0x221184[_0xf394('0x45')]=_0x17e537;return _0x221184;})[_0xf394('0x17')](respondWithFilteredResult(_0x5dfb96,_0x1c6be2))[_0xf394('0x1e')](handleError(_0x5dfb96,null));};exports[_0xf394('0x46')]=function(_0x29c23d,_0x3f6c62){var _0x9a8862={'raw':![],'where':{'id':_0x29c23d['params']['id']}},_0x42f1ba={};_0x42f1ba[_0xf394('0x34')]=_['keys'](db['Setting']['rawAttributes']);_0x42f1ba['query']=_[_0xf394('0x36')](_0x29c23d[_0xf394('0x35')]);_0x42f1ba['filters']=_[_0xf394('0x47')](_0x42f1ba[_0xf394('0x34')],_0x42f1ba[_0xf394('0x35')]);_0x9a8862['attributes']=_[_0xf394('0x47')](_0x42f1ba[_0xf394('0x34')],qs[_0xf394('0x38')](_0x29c23d[_0xf394('0x35')]['fields']));_0x9a8862[_0xf394('0x39')]=_0x9a8862['attributes'][_0xf394('0x48')]?_0x9a8862[_0xf394('0x39')]:_0x42f1ba['model'];if(_0x29c23d['query'][_0xf394('0x43')]){_0x9a8862[_0xf394('0x49')]=[{'all':!![]}];}_0x9a8862=_['merge']({},_0x9a8862,_0x29c23d[_0xf394('0x42')]);return db[_0xf394('0x30')]['find'](_0x9a8862)[_0xf394('0x17')](handleEntityNotFound(_0x3f6c62,null))[_0xf394('0x17')](respondWithResult(_0x3f6c62,null))['catch'](handleError(_0x3f6c62,null));};exports[_0xf394('0x2b')]=function(_0x3ce93b,_0x36a33e){if(_0x3ce93b['body']['id']){delete _0x3ce93b[_0xf394('0x4a')]['id'];}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x3ce93b[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36a33e,null))['then'](saveUpdates(_0x3ce93b[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x36a33e,null))['catch'](handleError(_0x36a33e,null));};exports[_0xf394('0x4d')]=function(_0x486fe1,_0xcfbf09,_0x3073b4){if(_0x486fe1[_0xf394('0x4e')]&&_0x486fe1[_0xf394('0x4e')][_0xf394('0x4f')]){_0x486fe1['body'][_0xf394('0x50')]=_0x486fe1[_0xf394('0x4e')][_0xf394('0x4f')];}return db['Setting'][_0xf394('0x4b')]({'where':{'id':_0x486fe1[_0xf394('0x4c')]['id']}})[_0xf394('0x17')](handleEntityNotFound(_0xcfbf09,null))[_0xf394('0x17')](saveUpdates(_0x486fe1[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0xcfbf09,null))[_0xf394('0x1e')](handleError(_0xcfbf09,null));};exports[_0xf394('0x51')]=function(_0x1b3c8b,_0x37019e,_0x4641f9){if(_0x1b3c8b[_0xf394('0x4e')]&&_0x1b3c8b[_0xf394('0x4e')][_0xf394('0x4f')]){_0x1b3c8b[_0xf394('0x4a')][_0xf394('0x52')]=_0x1b3c8b['file'][_0xf394('0x4f')];}return db['Setting'][_0xf394('0x4b')]({'where':{'id':_0x1b3c8b[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37019e,null))['then'](saveUpdates(_0x1b3c8b[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x37019e,null))['catch'](handleError(_0x37019e,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x1b8cd2,_0x15050b,_0x5c83d8){var _0x4cb2ff='server/files/images/logos';var _0x2c2a02={'custom':![]};return utilLicense[_0xf394('0x53')]()[_0xf394('0x17')](function(_0x1b4091){if(_0x1b4091){_0x2c2a02=_0x1b4091;}return db[_0xf394('0x30')]['find']({'where':{'id':_0x1b8cd2[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),'loginLogo',_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),_0xf394('0x57'),_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x15050b,null))[_0xf394('0x17')](function(_0x232c52){if(_0x232c52){var _0x2bf8e0=_0x232c52[_0xf394('0x50')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0x232c52['logo'])))?path['join'](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0x232c52[_0xf394('0x50')])):path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x4cb2ff,_[_0xf394('0x5c')](_0xf394('0x5e')));var _0xaf657d=_0xf394('0x5f')+_[_0xf394('0x60')]('logo');if(_0x232c52[_0xaf657d]||!_0x2c2a02[_0xf394('0x61')]){_0x2bf8e0=path['join'](config['root'],_0x4cb2ff,_[_0xf394('0x5c')](_0xf394('0x5e')));}if(!fs['existsSync'](_0x2bf8e0)){throw new db[(_0xf394('0x62'))][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x50'))+_0xf394('0x64'));}return _0x15050b['download'](_0x2bf8e0);}})['catch'](handleError(_0x15050b,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x66')]=function(_0x1a6c6c,_0x2d1aa9,_0x3a59d0){var _0x20d088=_0xf394('0x67');var _0x357e5f={'custom':![]};return utilLicense[_0xf394('0x53')]()[_0xf394('0x17')](function(_0x2d7417){if(_0x2d7417){_0x357e5f=_0x2d7417;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x1a6c6c[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),'loginLogo','preferred','favicon','defaultLogo',_0xf394('0x57'),'defaultPreferred',_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x2d1aa9,null))[_0xf394('0x17')](function(_0x20ddf3){if(_0x20ddf3){var _0xf64963=_0x20ddf3['loginLogo']&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x20d088,_[_0xf394('0x5c')](_0x20ddf3[_0xf394('0x52')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x20d088,_[_0xf394('0x5c')](_0x20ddf3[_0xf394('0x52')])):path[_0xf394('0x5b')](config['root'],_0x20d088,_[_0xf394('0x5c')](_0xf394('0x68')));var _0x4cae1a=_0xf394('0x5f')+_[_0xf394('0x60')]('loginLogo');if(_0x20ddf3[_0x4cae1a]||!_0x357e5f['custom']){_0xf64963=path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x20d088,_[_0xf394('0x5c')](_0xf394('0x68')));}if(!fs[_0xf394('0x5a')](_0xf64963)){throw new db[(_0xf394('0x62'))]['ValidationError'](_[_0xf394('0x60')](_0xf394('0x52'))+'\x20not\x20found');}return _0x2d1aa9[_0xf394('0x69')](_0xf64963);}})[_0xf394('0x1e')](handleError(_0x2d1aa9,null));};exports[_0xf394('0x6a')]=function(_0x200738,_0x59fcba){return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x200738[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x6b')]})[_0xf394('0x17')](respondWithResult(_0x59fcba,null))[_0xf394('0x1e')](handleError(_0x59fcba,null));};exports[_0xf394('0x6c')]=function(_0x4d94a5,_0x4e4de7,_0x89ecc2){if(_0x4d94a5['file']&&_0x4d94a5[_0xf394('0x4e')][_0xf394('0x4f')]){_0x4d94a5['body'][_0xf394('0x54')]=_0x4d94a5['file'][_0xf394('0x4f')];}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x4d94a5[_0xf394('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e4de7,null))[_0xf394('0x17')](saveUpdates(_0x4d94a5[_0xf394('0x4a')],null))[_0xf394('0x17')](respondWithResult(_0x4e4de7,null))[_0xf394('0x1e')](handleError(_0x4e4de7,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x6d')]=function(_0x30a56e,_0x33c725,_0x4a2bb9){var _0x2d1932='server/files/images/logos';var _0x49f612={'custom':![]};return utilLicense['getLicense']()[_0xf394('0x17')](function(_0x56680b){if(_0x56680b){_0x49f612=_0x56680b;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x30a56e[_0xf394('0x4c')]['id']},'attributes':['logo','loginLogo',_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),'defaultLoginLogo',_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x33c725,null))['then'](function(_0x1344a5){if(_0x1344a5){var _0x2a1c7b=_0x1344a5[_0xf394('0x54')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_[_0xf394('0x5c')](_0x1344a5[_0xf394('0x54')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_[_0xf394('0x5c')](_0x1344a5['preferred'])):path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x2d1932,_['toLower'](_0xf394('0x6e')));var _0xe101d2='default'+_['upperFirst'](_0xf394('0x54'));if(_0x1344a5[_0xe101d2]||!_0x49f612[_0xf394('0x61')]||!_0x49f612[_0xf394('0x54')]){_0x2a1c7b=path['join'](config[_0xf394('0x5d')],_0x2d1932,_['toLower'](_0xf394('0x6e')));}if(!fs[_0xf394('0x5a')](_0x2a1c7b)){throw new db[(_0xf394('0x62'))][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x54'))+_0xf394('0x64'));}return _0x33c725[_0xf394('0x69')](_0x2a1c7b);}})[_0xf394('0x1e')](handleError(_0x33c725,null));};exports[_0xf394('0x6f')]=function(_0x1f78e8,_0x26b5dc,_0x1444e1){if(_0x1f78e8[_0xf394('0x4e')]&&_0x1f78e8[_0xf394('0x4e')][_0xf394('0x4f')]){_0x1f78e8[_0xf394('0x4a')]['favicon']=_0x1f78e8['file'][_0xf394('0x4f')];}return db['Setting']['find']({'where':{'id':_0x1f78e8['params']['id']}})[_0xf394('0x17')](handleEntityNotFound(_0x26b5dc,null))[_0xf394('0x17')](saveUpdates(_0x1f78e8[_0xf394('0x4a')],null))['then'](respondWithResult(_0x26b5dc,null))['catch'](handleError(_0x26b5dc,null));};var utilLicense=require(_0xf394('0x65'));exports[_0xf394('0x70')]=function(_0x364f32,_0x327b7e,_0x48faac){var _0x482008=_0xf394('0x67');var _0x5cd1a6={'custom':![]};return utilLicense['getLicense']()[_0xf394('0x17')](function(_0x5db4f3){if(_0x5db4f3){_0x5cd1a6=_0x5db4f3;}return db[_0xf394('0x30')][_0xf394('0x4b')]({'where':{'id':_0x364f32[_0xf394('0x4c')]['id']},'attributes':[_0xf394('0x50'),_0xf394('0x52'),_0xf394('0x54'),_0xf394('0x55'),_0xf394('0x56'),'defaultLoginLogo',_0xf394('0x58'),_0xf394('0x59')],'raw':!![]});})[_0xf394('0x17')](handleEntityNotFound(_0x327b7e,null))['then'](function(_0x963d9e){if(_0x963d9e){var _0x488da4=_0x963d9e[_0xf394('0x55')]&&fs[_0xf394('0x5a')](path[_0xf394('0x5b')](config['root'],_0x482008,_[_0xf394('0x5c')](_0x963d9e[_0xf394('0x55')])))?path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x482008,_[_0xf394('0x5c')](_0x963d9e[_0xf394('0x55')])):path['join'](config['root'],_0x482008,_[_0xf394('0x5c')]('default_favicon.ico'));var _0x40d161=_0xf394('0x5f')+_[_0xf394('0x60')]('favicon');if(_0x963d9e[_0x40d161]||!_0x5cd1a6[_0xf394('0x61')]){_0x488da4=path[_0xf394('0x5b')](config[_0xf394('0x5d')],_0x482008,_['toLower'](_0xf394('0x71')));}if(!fs[_0xf394('0x5a')](_0x488da4)){throw new db['Sequelize'][(_0xf394('0x63'))](_[_0xf394('0x60')](_0xf394('0x55'))+_0xf394('0x64'));}return _0x327b7e[_0xf394('0x69')](_0x488da4);}})[_0xf394('0x1e')](handleError(_0x327b7e,null));};exports[_0xf394('0x72')]=function(_0xb0e659,_0x281380){var _0x5ab54d={'offset':moment()[_0xf394('0x73')]()};_0x5ab54d[_0xf394('0x74')]=moment()[_0xf394('0x73')](_0x5ab54d['offset'])[_0xf394('0x75')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x281380[_0xf394('0x20')](0xc8)[_0xf394('0x76')](_0x5ab54d);}; \ No newline at end of file +var _0xf3cc=['toLower','default_logo.svg','default','custom','Sequelize','ValidationError','download','default_loginLogo.svg','upperFirst','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','findAll','rows','catch','show','rawAttributes','fields','body','find','params','addLogo','file','filename','addLogoLogin','getLogo','server/files/images/logos','getLicense','logo','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root'];(function(_0x1150dc,_0x3e5a8a){var _0xdf8174=function(_0x305b56){while(--_0x305b56){_0x1150dc['push'](_0x1150dc['shift']());}};_0xdf8174(++_0x3e5a8a);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x31bbf7,_0x292c9a){_0x31bbf7=_0x31bbf7-0x0;var _0x1469f3=_0xf3cc[_0x31bbf7];return _0x1469f3;};'use strict';var emlformat=require(_0xcf3c('0x0'));var rimraf=require(_0xcf3c('0x1'));var zipdir=require(_0xcf3c('0x2'));var jsonpatch=require(_0xcf3c('0x3'));var rp=require('request-promise');var moment=require(_0xcf3c('0x4'));var BPromise=require(_0xcf3c('0x5'));var Mustache=require(_0xcf3c('0x6'));var util=require('util');var path=require(_0xcf3c('0x7'));var sox=require(_0xcf3c('0x8'));var csv=require('to-csv');var ejs=require(_0xcf3c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf3c('0xa'));var _=require(_0xcf3c('0xb'));var squel=require(_0xcf3c('0xc'));var crypto=require(_0xcf3c('0xd'));var jsforce=require(_0xcf3c('0xe'));var deskjs=require(_0xcf3c('0xf'));var toCsv=require(_0xcf3c('0x10'));var querystring=require(_0xcf3c('0x11'));var Papa=require(_0xcf3c('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf3c('0x13'));var as=require(_0xcf3c('0x14'));var hardwareService=require(_0xcf3c('0x15'));var logger=require(_0xcf3c('0x16'))(_0xcf3c('0x17'));var utils=require(_0xcf3c('0x18'));var config=require(_0xcf3c('0x19'));var licenseUtil=require(_0xcf3c('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcf3c('0x1b'));var client=jayson[_0xcf3c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x60e424,_0x4e6c38,_0x55ef34,_0x56261f){return new BPromise(function(_0x3fd714,_0x598576){var _0x2f387b=_0x56261f||client;return _0x2f387b[_0xcf3c('0x1d')](_0x60e424,_0x55ef34)['then'](function(_0x3e759f){logger['info'](_0xcf3c('0x1e'),_0x4e6c38,_0xcf3c('0x1f'));logger[_0xcf3c('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x4e6c38,_0xcf3c('0x1f'),JSON[_0xcf3c('0x21')](_0x3e759f));if(_0x3e759f[_0xcf3c('0x22')]){if(_0x3e759f[_0xcf3c('0x22')]['code']===0x1f4){logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);return _0x598576(_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);}logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);return _0x3fd714(_0x3e759f[_0xcf3c('0x22')][_0xcf3c('0x23')]);}else{logger['info'](_0xcf3c('0x1e'),_0x4e6c38,'request\x20sent');_0x3fd714(_0x3e759f[_0xcf3c('0x24')][_0xcf3c('0x23')]);}})['catch'](function(_0x1bd0f2){logger[_0xcf3c('0x22')](_0xcf3c('0x1e'),_0x4e6c38,_0x1bd0f2);_0x598576(_0x1bd0f2);});});}function respondWithStatusCode(_0x1d7e79,_0x32bbd5){_0x32bbd5=_0x32bbd5||0xcc;return function(_0x3f1771){if(_0x3f1771){return _0x1d7e79[_0xcf3c('0x25')](_0x32bbd5);}return _0x1d7e79[_0xcf3c('0x26')](_0x32bbd5)['end']();};}function respondWithResult(_0x771a9f,_0x4ce43c){_0x4ce43c=_0x4ce43c||0xc8;return function(_0x2281b6){if(_0x2281b6){return _0x771a9f[_0xcf3c('0x26')](_0x4ce43c)[_0xcf3c('0x27')](_0x2281b6);}};}function respondWithFilteredResult(_0x35e546,_0x181c90){return function(_0x43c912){if(_0x43c912){var _0x5631f1=typeof _0x181c90[_0xcf3c('0x28')]==='undefined'&&typeof _0x181c90[_0xcf3c('0x29')]===_0xcf3c('0x2a');var _0x3b253d=_0x43c912['count'];var _0x397996=_0x5631f1?0x0:_0x181c90['offset'];var _0x1d8223=_0x5631f1?_0x43c912[_0xcf3c('0x2b')]:_0x181c90[_0xcf3c('0x28')]+_0x181c90[_0xcf3c('0x29')];var _0x5835b2;if(_0x1d8223>=_0x3b253d){_0x1d8223=_0x3b253d;_0x5835b2=0xc8;}else{_0x5835b2=0xce;}_0x35e546[_0xcf3c('0x26')](_0x5835b2);return _0x35e546[_0xcf3c('0x2c')](_0xcf3c('0x2d'),_0x397996+'-'+_0x1d8223+'/'+_0x3b253d)[_0xcf3c('0x27')](_0x43c912);}return null;};}function patchUpdates(_0x502bca){return function(_0x1fae74){try{jsonpatch[_0xcf3c('0x2e')](_0x1fae74,_0x502bca,!![]);}catch(_0x2b2915){return BPromise['reject'](_0x2b2915);}return _0x1fae74[_0xcf3c('0x2f')]();};}function saveUpdates(_0x185868,_0x196b02){return function(_0x5f376e){if(_0x5f376e){return _0x5f376e[_0xcf3c('0x30')](_0x185868)[_0xcf3c('0x31')](function(_0x45a611){return _0x45a611;});}return null;};}function removeEntity(_0x2e7b19,_0x1b15cf){return function(_0x534f56){if(_0x534f56){return _0x534f56[_0xcf3c('0x32')]()['then'](function(){_0x2e7b19[_0xcf3c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a78f2,_0x1daba1){return function(_0x32b41d){if(!_0x32b41d){_0x2a78f2[_0xcf3c('0x25')](0x194);}return _0x32b41d;};}function handleError(_0x2a014a,_0x3a54bf){_0x3a54bf=_0x3a54bf||0x1f4;return function(_0x7933ca){logger[_0xcf3c('0x22')](_0x7933ca['stack']);if(_0x7933ca[_0xcf3c('0x33')]){delete _0x7933ca[_0xcf3c('0x33')];}_0x2a014a[_0xcf3c('0x26')](_0x3a54bf)[_0xcf3c('0x34')](_0x7933ca);};}exports[_0xcf3c('0x35')]=function(_0x161ef9,_0x9a64be){var _0xff382e={},_0x16f81d={},_0x22fed3={'count':0x0,'rows':[]};var _0x4ad15a=_[_0xcf3c('0x36')](db['Setting']['rawAttributes'],function(_0x517e98){return{'name':_0x517e98[_0xcf3c('0x37')],'type':_0x517e98[_0xcf3c('0x38')][_0xcf3c('0x39')]};});_0x16f81d[_0xcf3c('0x3a')]=_['map'](_0x4ad15a,'name');_0x16f81d[_0xcf3c('0x3b')]=_[_0xcf3c('0x3c')](_0x161ef9[_0xcf3c('0x3b')]);_0x16f81d[_0xcf3c('0x3d')]=_[_0xcf3c('0x3e')](_0x16f81d[_0xcf3c('0x3a')],_0x16f81d['query']);_0xff382e[_0xcf3c('0x3f')]=_[_0xcf3c('0x3e')](_0x16f81d[_0xcf3c('0x3a')],qs['fields'](_0x161ef9[_0xcf3c('0x3b')]['fields']));_0xff382e['attributes']=_0xff382e[_0xcf3c('0x3f')][_0xcf3c('0x40')]?_0xff382e[_0xcf3c('0x3f')]:_0x16f81d[_0xcf3c('0x3a')];if(!_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x41')](_0xcf3c('0x42'))){_0xff382e[_0xcf3c('0x29')]=qs[_0xcf3c('0x29')](_0x161ef9['query']['limit']);_0xff382e[_0xcf3c('0x28')]=qs[_0xcf3c('0x28')](_0x161ef9['query'][_0xcf3c('0x28')]);}_0xff382e['order']=qs[_0xcf3c('0x43')](_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x43')]);_0xff382e[_0xcf3c('0x44')]=qs[_0xcf3c('0x3d')](_[_0xcf3c('0x45')](_0x161ef9[_0xcf3c('0x3b')],_0x16f81d[_0xcf3c('0x3d')]),_0x4ad15a);if(_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x46')]){_0xff382e[_0xcf3c('0x44')]=_[_0xcf3c('0x47')](_0xff382e[_0xcf3c('0x44')],{'$or':_[_0xcf3c('0x36')](_0x4ad15a,function(_0x256e00){if(_0x256e00[_0xcf3c('0x38')]!==_0xcf3c('0x48')){var _0xf7b7a4={};_0xf7b7a4[_0x256e00['name']]={'$like':'%'+_0x161ef9['query'][_0xcf3c('0x46')]+'%'};return _0xf7b7a4;}})});}_0xff382e=_['merge']({},_0xff382e,_0x161ef9[_0xcf3c('0x49')]);var _0x3d9265={'where':_0xff382e[_0xcf3c('0x44')]};return db[_0xcf3c('0x4a')][_0xcf3c('0x2b')](_0x3d9265)['then'](function(_0x5b6802){_0x22fed3['count']=_0x5b6802;if(_0x161ef9[_0xcf3c('0x3b')][_0xcf3c('0x4b')]){_0xff382e['include']=[{'all':!![]}];}return db[_0xcf3c('0x4a')][_0xcf3c('0x4c')](_0xff382e);})[_0xcf3c('0x31')](function(_0x2800d4){_0x22fed3[_0xcf3c('0x4d')]=_0x2800d4;return _0x22fed3;})[_0xcf3c('0x31')](respondWithFilteredResult(_0x9a64be,_0xff382e))[_0xcf3c('0x4e')](handleError(_0x9a64be,null));};exports[_0xcf3c('0x4f')]=function(_0x31124d,_0x2c8234){var _0x25d090={'raw':![],'where':{'id':_0x31124d['params']['id']}},_0x2cfc0b={};_0x2cfc0b[_0xcf3c('0x3a')]=_[_0xcf3c('0x3c')](db[_0xcf3c('0x4a')][_0xcf3c('0x50')]);_0x2cfc0b['query']=_[_0xcf3c('0x3c')](_0x31124d['query']);_0x2cfc0b[_0xcf3c('0x3d')]=_['intersection'](_0x2cfc0b['model'],_0x2cfc0b['query']);_0x25d090['attributes']=_[_0xcf3c('0x3e')](_0x2cfc0b[_0xcf3c('0x3a')],qs['fields'](_0x31124d[_0xcf3c('0x3b')][_0xcf3c('0x51')]));_0x25d090[_0xcf3c('0x3f')]=_0x25d090['attributes']['length']?_0x25d090[_0xcf3c('0x3f')]:_0x2cfc0b[_0xcf3c('0x3a')];if(_0x31124d['query']['includeAll']){_0x25d090['include']=[{'all':!![]}];}_0x25d090=_[_0xcf3c('0x47')]({},_0x25d090,_0x31124d['options']);return db[_0xcf3c('0x4a')]['find'](_0x25d090)[_0xcf3c('0x31')](handleEntityNotFound(_0x2c8234,null))[_0xcf3c('0x31')](respondWithResult(_0x2c8234,null))[_0xcf3c('0x4e')](handleError(_0x2c8234,null));};exports[_0xcf3c('0x30')]=function(_0x2d0710,_0x4cb19d){if(_0x2d0710[_0xcf3c('0x52')]['id']){delete _0x2d0710[_0xcf3c('0x52')]['id'];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x2d0710[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x4cb19d,null))[_0xcf3c('0x31')](saveUpdates(_0x2d0710['body'],null))['then'](respondWithResult(_0x4cb19d,null))['catch'](handleError(_0x4cb19d,null));};exports[_0xcf3c('0x55')]=function(_0x4b902b,_0x5a7c0f,_0x340b82){if(_0x4b902b[_0xcf3c('0x56')]&&_0x4b902b[_0xcf3c('0x56')]['filename']){_0x4b902b[_0xcf3c('0x52')]['logo']=_0x4b902b[_0xcf3c('0x56')][_0xcf3c('0x57')];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x4b902b[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x5a7c0f,null))[_0xcf3c('0x31')](saveUpdates(_0x4b902b[_0xcf3c('0x52')],null))[_0xcf3c('0x31')](respondWithResult(_0x5a7c0f,null))[_0xcf3c('0x4e')](handleError(_0x5a7c0f,null));};exports[_0xcf3c('0x58')]=function(_0x5578c4,_0x2bae67,_0x191cfb){if(_0x5578c4[_0xcf3c('0x56')]&&_0x5578c4[_0xcf3c('0x56')][_0xcf3c('0x57')]){_0x5578c4[_0xcf3c('0x52')]['loginLogo']=_0x5578c4[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')]['find']({'where':{'id':_0x5578c4['params']['id']}})['then'](handleEntityNotFound(_0x2bae67,null))[_0xcf3c('0x31')](saveUpdates(_0x5578c4[_0xcf3c('0x52')],null))['then'](respondWithResult(_0x2bae67,null))[_0xcf3c('0x4e')](handleError(_0x2bae67,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x59')]=function(_0x4084ac,_0x121907,_0x4518dd){var _0x4db5f8=_0xcf3c('0x5a');var _0x32cdec={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x4419e2){if(_0x4419e2){_0x32cdec=_0x4419e2;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x4084ac[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x5c'),_0xcf3c('0x5d'),_0xcf3c('0x5e'),_0xcf3c('0x5f'),_0xcf3c('0x60'),_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x121907,null))[_0xcf3c('0x31')](function(_0x50b802){if(_0x50b802){var _0x19680d=_0x50b802[_0xcf3c('0x5c')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x4db5f8,_[_0xcf3c('0x67')](_0x50b802[_0xcf3c('0x5c')])))?path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x4db5f8,_['toLower'](_0x50b802[_0xcf3c('0x5c')])):path['join'](config[_0xcf3c('0x66')],_0x4db5f8,_[_0xcf3c('0x67')](_0xcf3c('0x68')));var _0x295d39=_0xcf3c('0x69')+_['upperFirst']('logo');if(_0x50b802[_0x295d39]||!_0x32cdec[_0xcf3c('0x6a')]){_0x19680d=path['join'](config['root'],_0x4db5f8,_['toLower'](_0xcf3c('0x68')));}if(!fs[_0xcf3c('0x64')](_0x19680d)){throw new db[(_0xcf3c('0x6b'))][(_0xcf3c('0x6c'))](_['upperFirst'](_0xcf3c('0x5c'))+'\x20not\x20found');}return _0x121907[_0xcf3c('0x6d')](_0x19680d);}})[_0xcf3c('0x4e')](handleError(_0x121907,null));};var utilLicense=require(_0xcf3c('0x1a'));exports['getLogoLogin']=function(_0x29c7ab,_0xe2d51a,_0x3c940d){var _0x95ce18=_0xcf3c('0x5a');var _0x1f2ef2={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x219dc0){if(_0x219dc0){_0x1f2ef2=_0x219dc0;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x29c7ab[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x5c'),_0xcf3c('0x5d'),_0xcf3c('0x5e'),_0xcf3c('0x5f'),'defaultLogo',_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0xe2d51a,null))[_0xcf3c('0x31')](function(_0x381d5b){if(_0x381d5b){var _0xdfd54f=_0x381d5b[_0xcf3c('0x5d')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0x381d5b['loginLogo'])))?path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_['toLower'](_0x381d5b[_0xcf3c('0x5d')])):path['join'](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0xcf3c('0x6e')));var _0x3f9165='default'+_[_0xcf3c('0x6f')](_0xcf3c('0x5d'));if(_0x381d5b[_0x3f9165]||!_0x1f2ef2['custom']){_0xdfd54f=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x95ce18,_[_0xcf3c('0x67')](_0xcf3c('0x6e')));}if(!fs[_0xcf3c('0x64')](_0xdfd54f)){throw new db['Sequelize'][(_0xcf3c('0x6c'))](_[_0xcf3c('0x6f')](_0xcf3c('0x5d'))+_0xcf3c('0x70'));}return _0xe2d51a[_0xcf3c('0x6d')](_0xdfd54f);}})[_0xcf3c('0x4e')](handleError(_0xe2d51a,null));};exports[_0xcf3c('0x71')]=function(_0x43763c,_0x4e8ada){return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x43763c[_0xcf3c('0x54')]['id']},'attributes':[_0xcf3c('0x72')]})[_0xcf3c('0x31')](respondWithResult(_0x4e8ada,null))['catch'](handleError(_0x4e8ada,null));};exports[_0xcf3c('0x73')]=function(_0x235263,_0x4db968,_0x59eb68){if(_0x235263[_0xcf3c('0x56')]&&_0x235263[_0xcf3c('0x56')][_0xcf3c('0x57')]){_0x235263[_0xcf3c('0x52')][_0xcf3c('0x5e')]=_0x235263[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')]['find']({'where':{'id':_0x235263['params']['id']}})['then'](handleEntityNotFound(_0x4db968,null))['then'](saveUpdates(_0x235263['body'],null))['then'](respondWithResult(_0x4db968,null))['catch'](handleError(_0x4db968,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x74')]=function(_0x21aecd,_0x509239,_0x45df41){var _0x20fb50=_0xcf3c('0x5a');var _0x2c6e5c={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x4994d9){if(_0x4994d9){_0x2c6e5c=_0x4994d9;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x21aecd['params']['id']},'attributes':[_0xcf3c('0x5c'),'loginLogo','preferred',_0xcf3c('0x5f'),_0xcf3c('0x60'),_0xcf3c('0x61'),_0xcf3c('0x62'),_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x509239,null))[_0xcf3c('0x31')](function(_0x473df3){if(_0x473df3){var _0x181fe0=_0x473df3[_0xcf3c('0x5e')]&&fs[_0xcf3c('0x64')](path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_['toLower'](_0x473df3[_0xcf3c('0x5e')])))?path['join'](config['root'],_0x20fb50,_[_0xcf3c('0x67')](_0x473df3[_0xcf3c('0x5e')])):path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_['toLower'](_0xcf3c('0x75')));var _0x17d364=_0xcf3c('0x69')+_[_0xcf3c('0x6f')](_0xcf3c('0x5e'));if(_0x473df3[_0x17d364]||!_0x2c6e5c[_0xcf3c('0x6a')]||!_0x2c6e5c[_0xcf3c('0x5e')]){_0x181fe0=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x20fb50,_[_0xcf3c('0x67')](_0xcf3c('0x75')));}if(!fs[_0xcf3c('0x64')](_0x181fe0)){throw new db[(_0xcf3c('0x6b'))][(_0xcf3c('0x6c'))](_[_0xcf3c('0x6f')](_0xcf3c('0x5e'))+_0xcf3c('0x70'));}return _0x509239['download'](_0x181fe0);}})[_0xcf3c('0x4e')](handleError(_0x509239,null));};exports[_0xcf3c('0x76')]=function(_0x501227,_0x36efdf,_0x4cfebf){if(_0x501227[_0xcf3c('0x56')]&&_0x501227['file'][_0xcf3c('0x57')]){_0x501227[_0xcf3c('0x52')][_0xcf3c('0x5f')]=_0x501227[_0xcf3c('0x56')]['filename'];}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x501227[_0xcf3c('0x54')]['id']}})[_0xcf3c('0x31')](handleEntityNotFound(_0x36efdf,null))[_0xcf3c('0x31')](saveUpdates(_0x501227[_0xcf3c('0x52')],null))['then'](respondWithResult(_0x36efdf,null))['catch'](handleError(_0x36efdf,null));};var utilLicense=require(_0xcf3c('0x1a'));exports[_0xcf3c('0x77')]=function(_0x3412f4,_0x2b1153,_0x227087){var _0x23b1af=_0xcf3c('0x5a');var _0x581ead={'custom':![]};return utilLicense[_0xcf3c('0x5b')]()[_0xcf3c('0x31')](function(_0x303467){if(_0x303467){_0x581ead=_0x303467;}return db[_0xcf3c('0x4a')][_0xcf3c('0x53')]({'where':{'id':_0x3412f4[_0xcf3c('0x54')]['id']},'attributes':['logo','loginLogo',_0xcf3c('0x5e'),'favicon',_0xcf3c('0x60'),_0xcf3c('0x61'),'defaultPreferred',_0xcf3c('0x63')],'raw':!![]});})[_0xcf3c('0x31')](handleEntityNotFound(_0x2b1153,null))['then'](function(_0x38ce58){if(_0x38ce58){var _0x255bb4=_0x38ce58[_0xcf3c('0x5f')]&&fs[_0xcf3c('0x64')](path['join'](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0x38ce58['favicon'])))?path[_0xcf3c('0x65')](config['root'],_0x23b1af,_[_0xcf3c('0x67')](_0x38ce58[_0xcf3c('0x5f')])):path['join'](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0xcf3c('0x78')));var _0x36d9eb=_0xcf3c('0x69')+_[_0xcf3c('0x6f')]('favicon');if(_0x38ce58[_0x36d9eb]||!_0x581ead['custom']){_0x255bb4=path[_0xcf3c('0x65')](config[_0xcf3c('0x66')],_0x23b1af,_[_0xcf3c('0x67')](_0xcf3c('0x78')));}if(!fs['existsSync'](_0x255bb4)){throw new db[(_0xcf3c('0x6b'))]['ValidationError'](_[_0xcf3c('0x6f')](_0xcf3c('0x5f'))+_0xcf3c('0x70'));}return _0x2b1153[_0xcf3c('0x6d')](_0x255bb4);}})['catch'](handleError(_0x2b1153,null));};exports[_0xcf3c('0x79')]=function(_0xf0a123,_0x35ec88){var _0x2a1d6d={'offset':moment()[_0xcf3c('0x7a')]()};_0x2a1d6d['now']=moment()[_0xcf3c('0x7a')](_0x2a1d6d['offset'])[_0xcf3c('0x7b')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x35ec88[_0xcf3c('0x26')](0xc8)['send'](_0x2a1d6d);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index fb2c80e..73ee057 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 _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x15b399,_0x59db1a){var _0x199f2d=function(_0x3bd31c){while(--_0x3bd31c){_0x15b399['push'](_0x15b399['shift']());}};_0x199f2d(++_0x59db1a);}(_0x55ca,0x126));var _0xa55c=function(_0x389318,_0x13a53d){_0x389318=_0x389318-0x0;var _0x7919e3=_0x55ca[_0x389318];return _0x7919e3;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x10b843,_0x2d080e){var _0x2e73b3=function(_0x16e740){while(--_0x16e740){_0x10b843['push'](_0x10b843['shift']());}};_0x2e73b3(++_0x2d080e);}(_0x34e8,0x12c));var _0x834e=function(_0x450e62,_0x1fee16){_0x450e62=_0x450e62-0x0;var _0xbce92a=_0x34e8[_0x450e62];return _0xbce92a;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index a81d3f6..3994ec5 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 _0x8725=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','ShowSetting','find','options','raw','attributes','include','model','map','lodash','util'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x8725,0x132));var _0x5872=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x8725[_0x10291b];return _0x1d5fbe;};'use strict';var _=require(_0x5872('0x0'));var util=require(_0x5872('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5872('0x2'));var fs=require('fs');var Redis=require(_0x5872('0x3'));var db=require(_0x5872('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5872('0x5'))(_0x5872('0x6'));var config=require('../../config/environment');var jayson=require(_0x5872('0x7'));var client=jayson[_0x5872('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4aa8d7,_0x139878,_0x4c579e){return new BPromise(function(_0x534554,_0x10e594){return client[_0x5872('0x9')](_0x4aa8d7,_0x4c579e)['then'](function(_0x46f293){logger[_0x5872('0xa')]('Setting,\x20%s,\x20%s',_0x139878,_0x5872('0xb'));logger[_0x5872('0xc')](_0x5872('0xd'),_0x139878,_0x5872('0xb'),JSON[_0x5872('0xe')](_0x46f293));if(_0x46f293[_0x5872('0xf')]){if(_0x46f293['error'][_0x5872('0x10')]===0x1f4){logger[_0x5872('0xf')](_0x5872('0x11'),_0x139878,_0x46f293[_0x5872('0xf')][_0x5872('0x12')]);return _0x10e594(_0x46f293[_0x5872('0xf')][_0x5872('0x12')]);}logger[_0x5872('0xf')](_0x5872('0x11'),_0x139878,_0x46f293[_0x5872('0xf')][_0x5872('0x12')]);return _0x534554(_0x46f293['error'][_0x5872('0x12')]);}else{logger['info'](_0x5872('0x11'),_0x139878,_0x5872('0xb'));_0x534554(_0x46f293['result'][_0x5872('0x12')]);}})[_0x5872('0x13')](function(_0x27a0fd){logger['error'](_0x5872('0x11'),_0x139878,_0x27a0fd);_0x10e594(_0x27a0fd);});});}exports[_0x5872('0x14')]=function(_0x5625cb){var _0x88af9c=this;return new Promise(function(_0x121552,_0x2a88a5){return db['Setting'][_0x5872('0x15')]({'raw':_0x5625cb[_0x5872('0x16')]?_0x5625cb[_0x5872('0x16')][_0x5872('0x17')]===undefined?!![]:![]:!![],'where':_0x5625cb['options']?_0x5625cb[_0x5872('0x16')]['where']||null:null,'attributes':_0x5625cb[_0x5872('0x16')]?_0x5625cb[_0x5872('0x16')][_0x5872('0x18')]||null:null,'include':_0x5625cb[_0x5872('0x16')]?_0x5625cb[_0x5872('0x16')][_0x5872('0x19')]?_['map'](_0x5625cb[_0x5872('0x16')]['include'],function(_0x3fd458){return{'model':db[_0x3fd458[_0x5872('0x1a')]],'as':_0x3fd458['as'],'attributes':_0x3fd458[_0x5872('0x18')],'include':_0x3fd458[_0x5872('0x19')]?_['map'](_0x3fd458[_0x5872('0x19')],function(_0x4bb547){return{'model':db[_0x4bb547[_0x5872('0x1a')]],'as':_0x4bb547['as'],'attributes':_0x4bb547[_0x5872('0x18')],'include':_0x4bb547[_0x5872('0x19')]?_[_0x5872('0x1b')](_0x4bb547[_0x5872('0x19')],function(_0x120890){return{'model':db[_0x120890[_0x5872('0x1a')]],'as':_0x120890['as'],'attributes':_0x120890['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1caf94){logger['info']('ShowSetting',_0x5625cb);logger[_0x5872('0xc')]('ShowSetting',_0x5625cb,JSON['stringify'](_0x1caf94));_0x121552(_0x1caf94);})[_0x5872('0x13')](function(_0x22b3b7){logger[_0x5872('0xf')](_0x5872('0x14'),_0x22b3b7[_0x5872('0x12')],_0x5625cb);_0x2a88a5(_0x88af9c['error'](0x1f4,_0x22b3b7[_0x5872('0x12')]));});});}; \ No newline at end of file +var _0xa3d1=['options','raw','where','attributes','include','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ShowSetting','Setting','find'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xa3d1,0x93));var _0x1a3d=function(_0x98a662,_0x764308){_0x98a662=_0x98a662-0x0;var _0x2a5962=_0xa3d1[_0x98a662];return _0x2a5962;};'use strict';var _=require(_0x1a3d('0x0'));var util=require(_0x1a3d('0x1'));var moment=require(_0x1a3d('0x2'));var BPromise=require(_0x1a3d('0x3'));var rs=require(_0x1a3d('0x4'));var fs=require('fs');var Redis=require(_0x1a3d('0x5'));var db=require(_0x1a3d('0x6'))['db'];var utils=require(_0x1a3d('0x7'));var logger=require(_0x1a3d('0x8'))(_0x1a3d('0x9'));var config=require(_0x1a3d('0xa'));var jayson=require(_0x1a3d('0xb'));var client=jayson[_0x1a3d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x491c1c,_0x2559b0,_0x4b4494){return new BPromise(function(_0x16a59a,_0x41c436){return client[_0x1a3d('0xd')](_0x491c1c,_0x4b4494)[_0x1a3d('0xe')](function(_0x139931){logger['info'](_0x1a3d('0xf'),_0x2559b0,'request\x20sent');logger[_0x1a3d('0x10')](_0x1a3d('0x11'),_0x2559b0,_0x1a3d('0x12'),JSON[_0x1a3d('0x13')](_0x139931));if(_0x139931[_0x1a3d('0x14')]){if(_0x139931['error'][_0x1a3d('0x15')]===0x1f4){logger[_0x1a3d('0x14')](_0x1a3d('0xf'),_0x2559b0,_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);return _0x41c436(_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);}logger[_0x1a3d('0x14')](_0x1a3d('0xf'),_0x2559b0,_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);return _0x16a59a(_0x139931[_0x1a3d('0x14')][_0x1a3d('0x16')]);}else{logger[_0x1a3d('0x17')]('Setting,\x20%s,\x20%s',_0x2559b0,_0x1a3d('0x12'));_0x16a59a(_0x139931[_0x1a3d('0x18')][_0x1a3d('0x16')]);}})['catch'](function(_0x7652f1){logger[_0x1a3d('0x14')](_0x1a3d('0xf'),_0x2559b0,_0x7652f1);_0x41c436(_0x7652f1);});});}exports[_0x1a3d('0x19')]=function(_0x15ae3d){var _0x180a3f=this;return new Promise(function(_0x442c9a,_0x1e290f){return db[_0x1a3d('0x1a')][_0x1a3d('0x1b')]({'raw':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x1e')]||null:null,'attributes':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d['options'][_0x1a3d('0x1f')]||null:null,'include':_0x15ae3d[_0x1a3d('0x1c')]?_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x20')]?_[_0x1a3d('0x21')](_0x15ae3d[_0x1a3d('0x1c')][_0x1a3d('0x20')],function(_0x3ea335){return{'model':db[_0x3ea335['model']],'as':_0x3ea335['as'],'attributes':_0x3ea335[_0x1a3d('0x1f')],'include':_0x3ea335[_0x1a3d('0x20')]?_[_0x1a3d('0x21')](_0x3ea335['include'],function(_0x238629){return{'model':db[_0x238629['model']],'as':_0x238629['as'],'attributes':_0x238629[_0x1a3d('0x1f')],'include':_0x238629[_0x1a3d('0x20')]?_[_0x1a3d('0x21')](_0x238629[_0x1a3d('0x20')],function(_0x2e826a){return{'model':db[_0x2e826a['model']],'as':_0x2e826a['as'],'attributes':_0x2e826a[_0x1a3d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24e07e){logger['info']('ShowSetting',_0x15ae3d);logger[_0x1a3d('0x10')](_0x1a3d('0x19'),_0x15ae3d,JSON[_0x1a3d('0x13')](_0x24e07e));_0x442c9a(_0x24e07e);})[_0x1a3d('0x22')](function(_0x29603f){logger[_0x1a3d('0x14')](_0x1a3d('0x19'),_0x29603f[_0x1a3d('0x16')],_0x15ae3d);_0x1e290f(_0x180a3f['error'](0x1f4,_0x29603f[_0x1a3d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 73924e1..b755be6 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 _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x234b1d,_0x22343c){var _0x55236f=function(_0x6ff02){while(--_0x6ff02){_0x234b1d['push'](_0x234b1d['shift']());}};_0x55236f(++_0x22343c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file +var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x228805,_0x17a7b2){_0x228805=_0x228805-0x0;var _0x132673=_0x1cb9[_0x228805];return _0x132673;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index a0538f8..2015416 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 _0x0f86=['csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','bandwidth'];(function(_0x114223,_0x223040){var _0xddf55f=function(_0x3e32c5){while(--_0x3e32c5){_0x114223['push'](_0x114223['shift']());}};_0xddf55f(++_0x223040);}(_0x0f86,0x1ee));var _0x60f8=function(_0x54221f,_0xde407d){_0x54221f=_0x54221f-0x0;var _0x5a4ebf=_0x0f86[_0x54221f];return _0x5a4ebf;};'use strict';var Sequelize=require(_0x60f8('0x0'));var rs=require(_0x60f8('0x1'));module[_0x60f8('0x2')]={'name':{'type':Sequelize[_0x60f8('0x3')],'unique':_0x60f8('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x60f8('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x60f8('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x60f8('0x5')]();}},'phone':{'type':Sequelize[_0x60f8('0x3')]},'type':{'type':Sequelize[_0x60f8('0x6')](_0x60f8('0x7'),_0x60f8('0x8'),'connectel','clicksend','plivo','clickatell',_0x60f8('0x9'),_0x60f8('0xa'),_0x60f8('0xb'),_0x60f8('0xc'))},'accountSid':{'type':Sequelize[_0x60f8('0x3')]},'authId':{'type':Sequelize[_0x60f8('0x3')]},'authToken':{'type':Sequelize[_0x60f8('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x60f8('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x60f8('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x60f8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x60f8('0xe')],'defaultValue':function(){return _0x60f8('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60f8('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60f8('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x60f8('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x60f8('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x60f8('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x60f8('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x60f8('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60f8('0x10')],'comment':_0x60f8('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x60f8('0xd')],'defaultValue':![],'comment':_0x60f8('0x12'),'set':function(_0x6c94d){if(!_0x6c94d)this[_0x60f8('0x13')](_0x60f8('0x14'),null);this[_0x60f8('0x13')]('mandatoryDisposition',_0x6c94d);}}}; \ No newline at end of file +var _0xda49=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','STRING','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','bandwidth','csc','intelepeer','BOOLEAN','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda49,0x149));var _0x9da4=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xda49[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x9da4('0x0'));var rs=require('randomstring');module[_0x9da4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9da4('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x9da4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9da4('0x3')],'defaultValue':function(){return rs[_0x9da4('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9da4('0x5')](_0x9da4('0x6'),_0x9da4('0x7'),'connectel',_0x9da4('0x8'),_0x9da4('0x9'),_0x9da4('0xa'),_0x9da4('0xb'),_0x9da4('0xc'),'infobip',_0x9da4('0xd'))},'accountSid':{'type':Sequelize[_0x9da4('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x9da4('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9da4('0x3')]},'password':{'type':Sequelize[_0x9da4('0x3')]},'apiKey':{'type':Sequelize[_0x9da4('0x3')]},'applicationId':{'type':Sequelize[_0x9da4('0x3')]},'accountId':{'type':Sequelize[_0x9da4('0x3')]},'senderString':{'type':Sequelize[_0x9da4('0x3')]},'deliveryReport':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9da4('0xf')],'defaultValue':function(){return _0x9da4('0x10');}},'notificationSound':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9da4('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9da4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9da4('0x11')],'comment':_0x9da4('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9da4('0xe')],'defaultValue':![],'comment':_0x9da4('0x13'),'set':function(_0x2391f5){if(!_0x2391f5)this[_0x9da4('0x14')](_0x9da4('0x15'),null);this[_0x9da4('0x14')](_0x9da4('0x16'),_0x2391f5);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 507c0b7..5b06082 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 _0x8ad2=['catch','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','account','orderBy','priority','asc','Applications','ValidationError','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','from\x20is\x20mandatory','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','push','close','AttachmentId','User','UserId','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','skebby_dispatch_id','requestid','status_code','groupName','DELIVERED','intelepeer','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','omit','userSmsAccount:save','removeAgents','userSmsAccount:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','show','intersection','find'];(function(_0x1a74c2,_0x3ac70f){var _0x1457e7=function(_0x526bc0){while(--_0x526bc0){_0x1a74c2['push'](_0x1a74c2['shift']());}};_0x1457e7(++_0x3ac70f);}(_0x8ad2,0x8d));var _0x28ad=function(_0x18df66,_0x410191){_0x18df66=_0x18df66-0x0;var _0x1b585c=_0x8ad2[_0x18df66];return _0x1b585c;};'use strict';var emlformat=require(_0x28ad('0x0'));var rimraf=require(_0x28ad('0x1'));var zipdir=require(_0x28ad('0x2'));var jsonpatch=require(_0x28ad('0x3'));var rp=require(_0x28ad('0x4'));var moment=require('moment');var BPromise=require(_0x28ad('0x5'));var Mustache=require('mustache');var util=require(_0x28ad('0x6'));var path=require(_0x28ad('0x7'));var sox=require('sox');var csv=require(_0x28ad('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28ad('0x9'));var _=require(_0x28ad('0xa'));var squel=require(_0x28ad('0xb'));var crypto=require(_0x28ad('0xc'));var jsforce=require(_0x28ad('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x28ad('0x8'));var querystring=require(_0x28ad('0xe'));var Papa=require(_0x28ad('0xf'));var Redis=require(_0x28ad('0x10'));var authService=require(_0x28ad('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28ad('0x12'));var logger=require(_0x28ad('0x13'))('api');var utils=require(_0x28ad('0x14'));var config=require(_0x28ad('0x15'));var licenseUtil=require(_0x28ad('0x16'));var db=require(_0x28ad('0x17'))['db'];config[_0x28ad('0x18')]=_[_0x28ad('0x19')](config[_0x28ad('0x18')],{'host':_0x28ad('0x1a'),'port':0x18eb});var socket=require(_0x28ad('0x1b'))(new Redis(config[_0x28ad('0x18')]));require(_0x28ad('0x1c'))[_0x28ad('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x28ad('0x1e')][_0x28ad('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x56b13a,_0x57722f,_0x27a473,_0x18c5c5){return new BPromise(function(_0x37b756,_0x41235e){var _0xdc873f=_0x18c5c5||client;return _0xdc873f[_0x28ad('0x20')](_0x56b13a,_0x27a473)[_0x28ad('0x21')](function(_0x5ac830){logger[_0x28ad('0x22')](_0x28ad('0x23'),_0x57722f,'request\x20sent');logger['debug'](_0x28ad('0x24'),_0x57722f,_0x28ad('0x25'),JSON['stringify'](_0x5ac830));if(_0x5ac830[_0x28ad('0x26')]){if(_0x5ac830[_0x28ad('0x26')][_0x28ad('0x27')]===0x1f4){logger[_0x28ad('0x26')](_0x28ad('0x23'),_0x57722f,_0x5ac830[_0x28ad('0x26')][_0x28ad('0x28')]);return _0x41235e(_0x5ac830[_0x28ad('0x26')]['message']);}logger[_0x28ad('0x26')](_0x28ad('0x23'),_0x57722f,_0x5ac830[_0x28ad('0x26')]['message']);return _0x37b756(_0x5ac830[_0x28ad('0x26')][_0x28ad('0x28')]);}else{logger[_0x28ad('0x22')]('SmsAccount,\x20%s,\x20%s',_0x57722f,_0x28ad('0x25'));_0x37b756(_0x5ac830[_0x28ad('0x29')][_0x28ad('0x28')]);}})['catch'](function(_0x4079eb){logger['error'](_0x28ad('0x23'),_0x57722f,_0x4079eb);_0x41235e(_0x4079eb);});});}function respondWithStatusCode(_0x197bc0,_0x1f2776){_0x1f2776=_0x1f2776||0xcc;return function(_0x2283e0){if(_0x2283e0){return _0x197bc0[_0x28ad('0x2a')](_0x1f2776);}return _0x197bc0[_0x28ad('0x2b')](_0x1f2776)[_0x28ad('0x2c')]();};}function respondWithResult(_0x2851bd,_0x159f70){_0x159f70=_0x159f70||0xc8;return function(_0x310821){if(_0x310821){return _0x2851bd[_0x28ad('0x2b')](_0x159f70)[_0x28ad('0x2d')](_0x310821);}};}function respondWithFilteredResult(_0x14f6d7,_0x3073d3){return function(_0x4410f7){if(_0x4410f7){var _0x3f70a6=typeof _0x3073d3['offset']===_0x28ad('0x2e')&&typeof _0x3073d3[_0x28ad('0x2f')]==='undefined';var _0x7bd4e7=_0x4410f7['count'];var _0x43704c=_0x3f70a6?0x0:_0x3073d3['offset'];var _0x340d16=_0x3f70a6?_0x4410f7[_0x28ad('0x30')]:_0x3073d3['offset']+_0x3073d3['limit'];var _0x432f84;if(_0x340d16>=_0x7bd4e7){_0x340d16=_0x7bd4e7;_0x432f84=0xc8;}else{_0x432f84=0xce;}_0x14f6d7['status'](_0x432f84);return _0x14f6d7['set'](_0x28ad('0x31'),_0x43704c+'-'+_0x340d16+'/'+_0x7bd4e7)[_0x28ad('0x2d')](_0x4410f7);}return null;};}function patchUpdates(_0x338862){return function(_0x25a7ed){try{jsonpatch[_0x28ad('0x32')](_0x25a7ed,_0x338862,!![]);}catch(_0x4223d7){return BPromise[_0x28ad('0x33')](_0x4223d7);}return _0x25a7ed['save']();};}function saveUpdates(_0x28a158,_0x5472cb){return function(_0x34dea8){if(_0x34dea8){return _0x34dea8[_0x28ad('0x34')](_0x28a158)[_0x28ad('0x21')](function(_0x30bbe2){return _0x30bbe2;});}return null;};}function removeEntity(_0x52df5d,_0x8805c0){return function(_0x37bce7){if(_0x37bce7){return _0x37bce7[_0x28ad('0x35')]()['then'](function(){var _0x4ddd86=_0x37bce7[_0x28ad('0x36')]({'plain':!![]});var _0xd5a083=_0x28ad('0x37');return db[_0x28ad('0x38')]['destroy']({'where':{'type':_0xd5a083,'resourceId':_0x4ddd86['id']}})[_0x28ad('0x21')](function(){return _0x37bce7;});})[_0x28ad('0x21')](function(){_0x52df5d[_0x28ad('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe995eb,_0x511d44){return function(_0x37533a){if(!_0x37533a){_0xe995eb['sendStatus'](0x194);}return _0x37533a;};}function handleError(_0x29529f,_0x382ada){_0x382ada=_0x382ada||0x1f4;return function(_0x3de3d0){logger[_0x28ad('0x26')](_0x3de3d0[_0x28ad('0x39')]);if(_0x3de3d0[_0x28ad('0x3a')]){delete _0x3de3d0[_0x28ad('0x3a')];}_0x29529f[_0x28ad('0x2b')](_0x382ada)[_0x28ad('0x3b')](_0x3de3d0);};}exports['index']=function(_0x550e17,_0x5eea72){var _0x100ead={'include':[{'model':db[_0x28ad('0x3c')],'as':_0x28ad('0x3d')}]},_0x2e9b6b={},_0x29b191={'count':0x0,'rows':[]};var _0x53d409=_[_0x28ad('0x3e')](db[_0x28ad('0x3f')][_0x28ad('0x40')],function(_0x4b1ef4){return{'name':_0x4b1ef4['fieldName'],'type':_0x4b1ef4[_0x28ad('0x41')][_0x28ad('0x42')]};});_0x2e9b6b['model']=_[_0x28ad('0x3e')](_0x53d409,_0x28ad('0x3a'));_0x2e9b6b[_0x28ad('0x43')]=_[_0x28ad('0x44')](_0x550e17[_0x28ad('0x43')]);_0x2e9b6b[_0x28ad('0x45')]=_['intersection'](_0x2e9b6b[_0x28ad('0x46')],_0x2e9b6b[_0x28ad('0x43')]);_0x100ead[_0x28ad('0x47')]=_['intersection'](_0x2e9b6b['model'],qs[_0x28ad('0x48')](_0x550e17[_0x28ad('0x43')]['fields']));_0x100ead['attributes']=_0x100ead[_0x28ad('0x47')][_0x28ad('0x49')]?_0x100ead[_0x28ad('0x47')]:_0x2e9b6b[_0x28ad('0x46')];if(!_0x550e17[_0x28ad('0x43')][_0x28ad('0x4a')](_0x28ad('0x4b'))){_0x100ead[_0x28ad('0x2f')]=qs[_0x28ad('0x2f')](_0x550e17['query'][_0x28ad('0x2f')]);_0x100ead[_0x28ad('0x4c')]=qs[_0x28ad('0x4c')](_0x550e17[_0x28ad('0x43')][_0x28ad('0x4c')]);}_0x100ead[_0x28ad('0x4d')]=qs[_0x28ad('0x4e')](_0x550e17[_0x28ad('0x43')][_0x28ad('0x4e')]);_0x100ead['where']=qs[_0x28ad('0x45')](_['pick'](_0x550e17[_0x28ad('0x43')],_0x2e9b6b[_0x28ad('0x45')]),_0x53d409);if(_0x550e17[_0x28ad('0x43')]['filter']){_0x100ead[_0x28ad('0x4f')]=_['merge'](_0x100ead['where'],{'$or':_[_0x28ad('0x3e')](_0x53d409,function(_0x88b255){if(_0x88b255[_0x28ad('0x41')]!==_0x28ad('0x50')){var _0x41b233={};_0x41b233[_0x88b255[_0x28ad('0x3a')]]={'$like':'%'+_0x550e17[_0x28ad('0x43')][_0x28ad('0x51')]+'%'};return _0x41b233;}})});}_0x100ead=_[_0x28ad('0x52')]({},_0x100ead,_0x550e17[_0x28ad('0x53')]);var _0x59264e={'where':_0x100ead[_0x28ad('0x4f')]};return db[_0x28ad('0x3f')][_0x28ad('0x30')](_0x59264e)['then'](function(_0x2b1c6a){_0x29b191[_0x28ad('0x30')]=_0x2b1c6a;if(_0x550e17[_0x28ad('0x43')][_0x28ad('0x54')]){_0x100ead[_0x28ad('0x55')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x100ead);})[_0x28ad('0x21')](function(_0x17db55){_0x29b191[_0x28ad('0x56')]=_0x17db55;return _0x29b191;})[_0x28ad('0x21')](respondWithFilteredResult(_0x5eea72,_0x100ead))['catch'](handleError(_0x5eea72,null));};exports[_0x28ad('0x57')]=function(_0x489a17,_0x188d8f){var _0x19f07b={'raw':![],'where':{'id':_0x489a17['params']['id']},'include':[{'model':db[_0x28ad('0x3c')],'as':_0x28ad('0x3d')}]},_0x1edc91={};_0x1edc91[_0x28ad('0x46')]=_[_0x28ad('0x44')](db[_0x28ad('0x3f')]['rawAttributes']);_0x1edc91[_0x28ad('0x43')]=_[_0x28ad('0x44')](_0x489a17[_0x28ad('0x43')]);_0x1edc91[_0x28ad('0x45')]=_[_0x28ad('0x58')](_0x1edc91[_0x28ad('0x46')],_0x1edc91['query']);_0x19f07b['attributes']=_[_0x28ad('0x58')](_0x1edc91[_0x28ad('0x46')],qs[_0x28ad('0x48')](_0x489a17[_0x28ad('0x43')]['fields']));_0x19f07b[_0x28ad('0x47')]=_0x19f07b['attributes'][_0x28ad('0x49')]?_0x19f07b[_0x28ad('0x47')]:_0x1edc91[_0x28ad('0x46')];if(_0x489a17[_0x28ad('0x43')][_0x28ad('0x54')]){_0x19f07b[_0x28ad('0x55')]=[{'all':!![]}];}_0x19f07b=_[_0x28ad('0x52')]({},_0x19f07b,_0x489a17['options']);return db[_0x28ad('0x3f')][_0x28ad('0x59')](_0x19f07b)['then'](handleEntityNotFound(_0x188d8f,null))['then'](respondWithResult(_0x188d8f,null))[_0x28ad('0x5a')](handleError(_0x188d8f,null));};exports[_0x28ad('0x5b')]=function(_0x2d21c1,_0x12001a){return db[_0x28ad('0x3f')][_0x28ad('0x5b')](_0x2d21c1['body'],{})[_0x28ad('0x21')](function(_0x1b701d){var _0x3f9d6e=_0x2d21c1[_0x28ad('0x5c')][_0x28ad('0x36')]({'plain':!![]});if(!_0x3f9d6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f9d6e[_0x28ad('0x5d')]===_0x28ad('0x5c')){var _0x22a31c=_0x1b701d['get']({'plain':!![]});var _0x1b0dc1=_0x28ad('0x37');return db[_0x28ad('0x5e')][_0x28ad('0x59')]({'where':{'name':_0x1b0dc1,'userProfileId':_0x3f9d6e['userProfileId']},'raw':!![]})['then'](function(_0x189dec){if(_0x189dec&&_0x189dec['autoAssociation']===0x0){return db[_0x28ad('0x38')]['create']({'name':_0x22a31c['name'],'resourceId':_0x22a31c['id'],'type':_0x189dec['name'],'sectionId':_0x189dec['id']},{})[_0x28ad('0x21')](function(){return _0x1b701d;});}else{return _0x1b701d;}})['catch'](function(_0x49267f){logger[_0x28ad('0x26')](_0x28ad('0x5f'),_0x49267f);throw _0x49267f;});}return _0x1b701d;})[_0x28ad('0x21')](respondWithResult(_0x12001a,0xc9))[_0x28ad('0x5a')](handleError(_0x12001a,null));};exports[_0x28ad('0x34')]=function(_0x23c069,_0x479deb){if(_0x23c069[_0x28ad('0x60')]['id']){delete _0x23c069['body']['id'];}return db[_0x28ad('0x3f')][_0x28ad('0x59')]({'where':{'id':_0x23c069['params']['id']},'include':[{'model':db[_0x28ad('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x28ad('0x21')](handleEntityNotFound(_0x479deb,null))['then'](saveUpdates(_0x23c069[_0x28ad('0x60')],null))['then'](respondWithResult(_0x479deb,null))[_0x28ad('0x5a')](handleError(_0x479deb,null));};exports[_0x28ad('0x35')]=function(_0x2c2e33,_0x2967a8){return db[_0x28ad('0x3f')][_0x28ad('0x59')]({'where':{'id':_0x2c2e33[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x2967a8,null))[_0x28ad('0x21')](removeEntity(_0x2967a8,null))['catch'](handleError(_0x2967a8,null));};exports[_0x28ad('0x62')]=function(_0x150fff,_0x2e4baa){return db[_0x28ad('0x3f')][_0x28ad('0x62')]()['then'](respondWithResult(_0x2e4baa,null))[_0x28ad('0x5a')](handleError(_0x2e4baa,null));};exports[_0x28ad('0x63')]=function(_0x5962f0,_0x2e9d5b,_0x28d448){if(_0x5962f0[_0x28ad('0x60')]['id']){delete _0x5962f0['body']['id'];}return db[_0x28ad('0x3f')]['find']({'where':{'id':_0x5962f0[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x2e9d5b,null))[_0x28ad('0x21')](function(_0x43a233){if(_0x43a233){_0x5962f0['body'][_0x28ad('0x64')]=_0x43a233['id'];return db['Disposition'][_0x28ad('0x5b')](_0x5962f0[_0x28ad('0x60')]);}})['then'](respondWithResult(_0x2e9d5b,null))[_0x28ad('0x5a')](handleError(_0x2e9d5b,null));};exports[_0x28ad('0x65')]=function(_0x1f5ded,_0x3da5d1,_0xbafc11){var _0x580886={'raw':![],'where':{}};var _0x394f22={};var _0x370fa4={'count':0x0,'rows':[]};return db['SmsAccount'][_0x28ad('0x66')]({'where':{'id':_0x1f5ded[_0x28ad('0x61')]['id']}})['then'](handleEntityNotFound(_0x3da5d1,null))[_0x28ad('0x21')](function(_0x1291aa){if(_0x1291aa){_0x394f22['model']=_[_0x28ad('0x44')](db[_0x28ad('0x67')][_0x28ad('0x40')]);_0x394f22[_0x28ad('0x43')]=_['keys'](_0x1f5ded[_0x28ad('0x43')]);_0x394f22[_0x28ad('0x45')]=_[_0x28ad('0x58')](_0x394f22[_0x28ad('0x46')],_0x394f22[_0x28ad('0x43')]);_0x580886['attributes']=_[_0x28ad('0x58')](_0x394f22[_0x28ad('0x46')],qs['fields'](_0x1f5ded['query'][_0x28ad('0x48')]));_0x580886[_0x28ad('0x47')]=_0x580886['attributes']['length']?_0x580886[_0x28ad('0x47')]:_0x394f22['model'];if(!_0x1f5ded[_0x28ad('0x43')][_0x28ad('0x4a')](_0x28ad('0x4b'))){_0x580886['limit']=qs[_0x28ad('0x2f')](_0x1f5ded[_0x28ad('0x43')][_0x28ad('0x2f')]);_0x580886[_0x28ad('0x4c')]=qs[_0x28ad('0x4c')](_0x1f5ded[_0x28ad('0x43')]['offset']);}_0x580886[_0x28ad('0x4d')]=qs[_0x28ad('0x4e')](_0x1f5ded['query'][_0x28ad('0x4e')]);_0x580886[_0x28ad('0x4f')]=qs['filters'](_[_0x28ad('0x68')](_0x1f5ded[_0x28ad('0x43')],_0x394f22['filters']));_0x580886[_0x28ad('0x4f')][_0x28ad('0x64')]=_0x1291aa['id'];if(_0x1f5ded[_0x28ad('0x43')][_0x28ad('0x51')]){_0x580886[_0x28ad('0x4f')]=_[_0x28ad('0x52')](_0x580886[_0x28ad('0x4f')],{'$or':_['map'](_0x580886[_0x28ad('0x47')],function(_0x3f0538){var _0x52cdf1={};_0x52cdf1[_0x3f0538]={'$like':'%'+_0x1f5ded[_0x28ad('0x43')][_0x28ad('0x51')]+'%'};return _0x52cdf1;})});}_0x580886=_[_0x28ad('0x52')]({},_0x580886,_0x1f5ded[_0x28ad('0x53')]);return db[_0x28ad('0x67')][_0x28ad('0x30')]({'where':_0x580886[_0x28ad('0x4f')]})[_0x28ad('0x21')](function(_0x39cebc){_0x370fa4[_0x28ad('0x30')]=_0x39cebc;if(_0x1f5ded['query'][_0x28ad('0x54')]){_0x580886[_0x28ad('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x28ad('0x69')](_0x580886);})[_0x28ad('0x21')](function(_0x35be4c){_0x370fa4['rows']=_0x35be4c;return _0x370fa4;});}})[_0x28ad('0x21')](respondWithFilteredResult(_0x3da5d1,_0x580886))[_0x28ad('0x5a')](handleError(_0x3da5d1,null));};exports[_0x28ad('0x6a')]=function(_0x639d91,_0x221e9f,_0x312bf0){return db[_0x28ad('0x3f')]['find']({'where':{'id':_0x639d91[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x221e9f,null))[_0x28ad('0x21')](function(_0x63328a){if(_0x63328a){return _0x63328a[_0x28ad('0x6a')](_0x639d91['query'][_0x28ad('0x6b')]);}})['then'](respondWithStatusCode(_0x221e9f,null))[_0x28ad('0x5a')](handleError(_0x221e9f,null));};exports[_0x28ad('0x6c')]=function(_0x5f36bc,_0x29485b,_0x12fc77){if(_0x5f36bc[_0x28ad('0x60')]['id']){delete _0x5f36bc[_0x28ad('0x60')]['id'];}return db[_0x28ad('0x3f')][_0x28ad('0x59')]({'where':{'id':_0x5f36bc[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x29485b,null))[_0x28ad('0x21')](function(_0x10f649){if(_0x10f649){_0x5f36bc[_0x28ad('0x60')]['SmsAccountId']=_0x10f649['id'];return db[_0x28ad('0x6d')][_0x28ad('0x5b')](_0x5f36bc['body']);}})['then'](respondWithResult(_0x29485b,null))[_0x28ad('0x5a')](handleError(_0x29485b,null));};exports['getAnswers']=function(_0x58f3ec,_0xc101af,_0xb6d78e){var _0x2b5feb={'raw':![],'where':{}};var _0xacc772={};var _0x46ef00={'count':0x0,'rows':[]};return db[_0x28ad('0x3f')][_0x28ad('0x66')]({'where':{'id':_0x58f3ec['params']['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0xc101af,null))['then'](function(_0x18a980){if(_0x18a980){_0xacc772[_0x28ad('0x46')]=_[_0x28ad('0x44')](db[_0x28ad('0x6d')][_0x28ad('0x40')]);_0xacc772[_0x28ad('0x43')]=_['keys'](_0x58f3ec['query']);_0xacc772[_0x28ad('0x45')]=_['intersection'](_0xacc772[_0x28ad('0x46')],_0xacc772[_0x28ad('0x43')]);_0x2b5feb[_0x28ad('0x47')]=_[_0x28ad('0x58')](_0xacc772[_0x28ad('0x46')],qs['fields'](_0x58f3ec[_0x28ad('0x43')]['fields']));_0x2b5feb[_0x28ad('0x47')]=_0x2b5feb['attributes'][_0x28ad('0x49')]?_0x2b5feb[_0x28ad('0x47')]:_0xacc772[_0x28ad('0x46')];if(!_0x58f3ec['query'][_0x28ad('0x4a')](_0x28ad('0x4b'))){_0x2b5feb[_0x28ad('0x2f')]=qs[_0x28ad('0x2f')](_0x58f3ec['query']['limit']);_0x2b5feb[_0x28ad('0x4c')]=qs[_0x28ad('0x4c')](_0x58f3ec[_0x28ad('0x43')]['offset']);}_0x2b5feb[_0x28ad('0x4d')]=qs['sort'](_0x58f3ec[_0x28ad('0x43')][_0x28ad('0x4e')]);_0x2b5feb[_0x28ad('0x4f')]=qs[_0x28ad('0x45')](_['pick'](_0x58f3ec['query'],_0xacc772['filters']));_0x2b5feb[_0x28ad('0x4f')][_0x28ad('0x64')]=_0x18a980['id'];if(_0x58f3ec[_0x28ad('0x43')]['filter']){_0x2b5feb['where']=_[_0x28ad('0x52')](_0x2b5feb[_0x28ad('0x4f')],{'$or':_['map'](_0x2b5feb[_0x28ad('0x47')],function(_0x12bfe3){var _0x5f48cc={};_0x5f48cc[_0x12bfe3]={'$like':'%'+_0x58f3ec[_0x28ad('0x43')]['filter']+'%'};return _0x5f48cc;})});}_0x2b5feb=_[_0x28ad('0x52')]({},_0x2b5feb,_0x58f3ec[_0x28ad('0x53')]);return db['CannedAnswer'][_0x28ad('0x30')]({'where':_0x2b5feb['where']})[_0x28ad('0x21')](function(_0x2687d8){_0x46ef00[_0x28ad('0x30')]=_0x2687d8;if(_0x58f3ec[_0x28ad('0x43')]['includeAll']){_0x2b5feb[_0x28ad('0x55')]=[{'all':!![]}];}return db[_0x28ad('0x6d')]['findAll'](_0x2b5feb);})[_0x28ad('0x21')](function(_0x13d8e6){_0x46ef00[_0x28ad('0x56')]=_0x13d8e6;return _0x46ef00;});}})[_0x28ad('0x21')](respondWithFilteredResult(_0xc101af,_0x2b5feb))[_0x28ad('0x5a')](handleError(_0xc101af,null));};exports[_0x28ad('0x6e')]=function(_0x357938,_0x11af76,_0x49b4b2){return db[_0x28ad('0x3f')]['find']({'where':{'id':_0x357938[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x11af76,null))[_0x28ad('0x21')](function(_0x4acf75){if(_0x4acf75){return _0x4acf75[_0x28ad('0x6e')](_0x357938[_0x28ad('0x43')][_0x28ad('0x6b')]);}})['then'](respondWithStatusCode(_0x11af76,null))[_0x28ad('0x5a')](handleError(_0x11af76,null));};exports[_0x28ad('0x6f')]=function(_0x49ac74,_0x2b5005,_0x451eac){var _0x50b681={'channel':_0x28ad('0x70')};var _0x13355d=[];var _0x380d94=[];var _0x44a921={};return db[_0x28ad('0x3f')][_0x28ad('0x59')]({'where':{'id':_0x49ac74['params']['id']},'include':[{'model':db[_0x28ad('0x71')],'as':'Applications'}]})[_0x28ad('0x21')](handleEntityNotFound(_0x2b5005,null))[_0x28ad('0x21')](function(_0x1be22c){_0x50b681[_0x28ad('0x72')]=_0x1be22c;_0x50b681['applications']=_[_0x28ad('0x73')](_0x1be22c['Applications'],[_0x28ad('0x74')],[_0x28ad('0x75')]);if(_0x50b681[_0x28ad('0x72')][_0x28ad('0x76')]){delete _0x50b681[_0x28ad('0x72')]['Applications'];}return db['CmContact']['describe']();})['then'](function(_0x4a7ae9){if(!_0x4a7ae9){throw new db['Sequelize'][(_0x28ad('0x77'))]('no\x20available\x20attributes');}_0x13355d=_[_0x28ad('0x78')](_[_0x28ad('0x44')](_0x4a7ae9),[_0x28ad('0x79'),_0x28ad('0x7a')]);_0x380d94=_[_0x28ad('0x78')](_[_0x28ad('0x44')](_0x4a7ae9),[_0x28ad('0x79'),_0x28ad('0x7a'),_0x28ad('0x7b'),'ListId']);_0x50b681[_0x28ad('0x60')]={'mapKey':_0x28ad('0x7c')};if(_0x50b681[_0x28ad('0x72')]['type']){switch(_0x50b681[_0x28ad('0x72')][_0x28ad('0x41')]){case _0x28ad('0x7d'):_0x50b681['body'][_0x28ad('0x7e')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x7f')];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74['body'][_0x28ad('0x80')];_0x50b681['body'][_0x28ad('0x81')]=_0x49ac74['body'][_0x28ad('0x82')];break;case _0x28ad('0x83'):_0x50b681[_0x28ad('0x60')]['from']='+'+_0x49ac74['body']['sender'];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74['body'][_0x28ad('0x84')];break;case _0x28ad('0x85'):_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x7e')];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x28')];break;case _0x28ad('0x86'):_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')]=_0x49ac74['body'][_0x28ad('0x7e')];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74[_0x28ad('0x60')]['body'];_0x50b681[_0x28ad('0x60')][_0x28ad('0x81')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x87')];break;case _0x28ad('0x88'):_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x7f')];_0x50b681[_0x28ad('0x60')]['body']=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x89')];_0x50b681[_0x28ad('0x60')]['messageId']=_0x49ac74['body'][_0x28ad('0x8a')];break;case _0x28ad('0x8b'):_0x50b681['body'][_0x28ad('0x7e')]='+'+_0x49ac74[_0x28ad('0x60')][_0x28ad('0x8c')][0x0][_0x28ad('0x7e')];_0x50b681['body']['body']=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x8c')][0x0][_0x28ad('0x84')];_0x50b681[_0x28ad('0x60')][_0x28ad('0x81')]=_0x49ac74['body'][_0x28ad('0x8c')][0x0][_0x28ad('0x81')];break;case _0x28ad('0x8d'):_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x8e')];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x8f')]['message'];break;case _0x28ad('0x90'):_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')]=_0x49ac74[_0x28ad('0x60')]['fromNumber'];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74[_0x28ad('0x60')]['text'];_0x50b681[_0x28ad('0x60')][_0x28ad('0x81')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x91')];break;case _0x28ad('0x92'):_0x50b681[_0x28ad('0x60')][_0x28ad('0x81')]=_0x49ac74[_0x28ad('0x60')][0x0][_0x28ad('0x28')]['id'];_0x50b681['body']['from']=_0x49ac74[_0x28ad('0x60')][0x0][_0x28ad('0x28')][_0x28ad('0x7e')];_0x50b681[_0x28ad('0x60')]['body']=_0x49ac74[_0x28ad('0x60')][0x0][_0x28ad('0x28')][_0x28ad('0x84')];break;case'intelepeer':_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')]=_0x49ac74[_0x28ad('0x60')][_0x28ad('0x7e')];_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')]=_0x49ac74[_0x28ad('0x60')]['message'];_0x50b681[_0x28ad('0x60')][_0x28ad('0x81')]=_0x49ac74[_0x28ad('0x60')]['refid'];break;}}if(_0x50b681[_0x28ad('0x60')]['id']){delete _0x50b681['body']['id'];}if(_['isNil'](_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')])){throw new db['Sequelize'][(_0x28ad('0x77'))](_0x28ad('0x93'));}if(_[_0x28ad('0x94')](_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')])||_0x50b681['body']['body']===''){throw new db[(_0x28ad('0x95'))][(_0x28ad('0x77'))](_0x28ad('0x96'));}if(_[_0x28ad('0x94')](_0x50b681[_0x28ad('0x60')][_0x28ad('0x97')])){throw new db[(_0x28ad('0x95'))][(_0x28ad('0x77'))](_0x28ad('0x98')+_0x380d94);}if(!_['includes'](_0x380d94,_0x50b681[_0x28ad('0x60')][_0x28ad('0x97')])){throw new db['Sequelize'][(_0x28ad('0x77'))](_0x28ad('0x99')+_0x380d94);}_0x44a921[_0x50b681[_0x28ad('0x60')]['mapKey']]=_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')];return db[_0x28ad('0x9a')][_0x28ad('0x59')]({'where':{'id':_0x50b681[_0x28ad('0x72')][_0x28ad('0x9b')]},'include':[{'model':db[_0x28ad('0x9c')],'as':_0x28ad('0x9d'),'where':_0x44a921,'limit':0x1,'order':[[_0x28ad('0x7a'),_0x28ad('0x9e')]]}]});})[_0x28ad('0x21')](handleEntityNotFound(_0x2b5005,null))['then'](function(_0x4b0c2e){if(_0x4b0c2e){_0x50b681[_0x28ad('0x9f')]=_['omit'](_0x4b0c2e,['Contacts']);if(_0x4b0c2e[_0x28ad('0x9d')]['length']){return _0x4b0c2e['Contacts'][0x0];}var _0x75c940=_[_0x28ad('0x19')](_0x50b681[_0x28ad('0x60')],{'firstName':_0x50b681[_0x28ad('0x60')]['from'],'ListId':_0x4b0c2e['id']});_0x75c940[_0x50b681[_0x28ad('0x60')][_0x28ad('0x97')]]=_0x50b681[_0x28ad('0x60')]['from'];return db[_0x28ad('0x9c')][_0x28ad('0x5b')](_0x75c940,{'fields':_0x13355d,'raw':!![]});}})[_0x28ad('0x21')](handleEntityNotFound(_0x2b5005,null))[_0x28ad('0x21')](function(_0xd7f70b){if(_0xd7f70b){_0x50b681[_0x28ad('0xa0')]=_0xd7f70b;var _0x4ed0e2={'ContactId':_0xd7f70b['id'],'phone':_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')],'SmsAccountId':_0x49ac74['params']['id']};var _0x3dd996={'ContactId':_0xd7f70b['id'],'SmsAccountId':_0x49ac74[_0x28ad('0x61')]['id'],'closed':![]};return db[_0x28ad('0xa1')][_0x28ad('0x59')]({'where':_0x3dd996})[_0x28ad('0x21')](function(_0x58c152){if(_0x58c152){return[_0x58c152,![]];}return db[_0x28ad('0xa1')][_0x28ad('0x5b')](_0x4ed0e2)[_0x28ad('0x21')](function(_0x5ea33b){return[_0x5ea33b,!![]];});});}})[_0x28ad('0xa2')](function(_0x2ad0d4,_0x4c4399){_0x50b681[_0x28ad('0xa3')]=_0x2ad0d4[_0x28ad('0x36')]({'plain':!![]});_0x50b681['interaction'][_0x28ad('0xa4')]=![];if(_0x4c4399){if(_0x50b681[_0x28ad('0x72')]['autoclose']){_0x50b681['applications'][_0x28ad('0xa5')]({'id':0x0,'priority':_0x50b681['applications'][_0x28ad('0x49')]+0x1,'app':_0x28ad('0xa6'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x50b681[_0x28ad('0xa3')]['created']=!![];}return db['SmsMessage'][_0x28ad('0x5b')]({'phone':_0x50b681[_0x28ad('0x60')][_0x28ad('0x7e')],'messageId':_0x50b681[_0x28ad('0x60')][_0x28ad('0x81')],'body':_0x50b681[_0x28ad('0x60')][_0x28ad('0x60')],'SmsAccountId':_0x49ac74[_0x28ad('0x61')]['id'],'SmsInteractionId':_0x2ad0d4['id'],'direction':'in','ContactId':_0x2ad0d4['ContactId'],'AttachmentId':_0x50b681['body'][_0x28ad('0xa7')]});})[_0x28ad('0x21')](function(_0x308303){_0x50b681[_0x28ad('0x28')]=_0x308303;if(_0x50b681[_0x28ad('0xa3')]['UserId']){return db[_0x28ad('0xa8')][_0x28ad('0x59')]({'attributes':['id','name'],'where':{'id':_0x50b681[_0x28ad('0xa3')][_0x28ad('0xa9')]}})[_0x28ad('0x21')](function(_0x17df4f){if(_0x17df4f){_0x50b681['applications'][_0x28ad('0xaa')]({'id':0x0,'priority':0x0,'app':_0x28ad('0xab'),'appdata':_0x17df4f[_0x28ad('0x3a')]+','+(_0x50b681[_0x28ad('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x28ad('0xac')});}return respondWithRpcPromise(_0x28ad('0xad'),_0x28ad('0xae'),_0x50b681);});}return respondWithRpcPromise(_0x28ad('0xad'),_0x28ad('0xae'),_0x50b681);})[_0x28ad('0x21')](function(_0x20ab55){if(_0x20ab55){var _0x14d52b=0xc8;var _0xa63ade=_0x28ad('0xaf');logger[_0x28ad('0x22')](_0x28ad('0x24'),_0xa63ade,_0x14d52b,_0x28ad('0xb0'));logger[_0x28ad('0xb1')](_0x28ad('0xb2'),_0xa63ade,_0x14d52b,_0x28ad('0xb0'),JSON[_0x28ad('0xb3')](_0x20ab55));if(_0x50b681[_0x28ad('0x72')][_0x28ad('0x41')]===_0x28ad('0x7d')){return _0x2b5005[_0x28ad('0x2b')](_0x14d52b)[_0x28ad('0xb4')](_0x28ad('0xb5'),_0x28ad('0xb6'))[_0x28ad('0x3b')](_0x28ad('0xb7'));}else{return _0x2b5005[_0x28ad('0x2b')](_0x14d52b)['json'](_0x20ab55);}}})['catch'](handleError(_0x2b5005,null));};exports[_0x28ad('0xb8')]=function(_0x3d51df,_0x27a6ae){var _0x3b88e6=_0x3d51df['params']['id'];var _0x100d1d=_0x3d51df[_0x28ad('0x60')];var _0x27c604=0xc8;var _0x1da282=null;return db[_0x28ad('0xb9')][_0x28ad('0xba')]({'isolationLevel':db[_0x28ad('0xb9')][_0x28ad('0xbb')][_0x28ad('0xbc')][_0x28ad('0xbd')]},function(_0x3e0dce){return db[_0x28ad('0x3f')][_0x28ad('0x66')]({'where':{'id':_0x3b88e6},'transaction':_0x3e0dce})[_0x28ad('0x21')](function(_0x36ca4f){if(_0x36ca4f){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x3b88e6},'transaction':_0x3e0dce})[_0x28ad('0x21')](function(){var _0x3592ed=_[_0x28ad('0x3e')](_0x100d1d,function(_0x9d2215){_0x9d2215['SmsAccountId']=_0x3b88e6;return _0x9d2215;});return db[_0x28ad('0x71')][_0x28ad('0xbe')](_0x3592ed,{'transaction':_0x3e0dce});});}else{_0x27c604=0x194;_0x1da282=[];}});})[_0x28ad('0x21')](function(){if(_0x27c604!==0x194){return db[_0x28ad('0x71')][_0x28ad('0xbf')]({'where':{'SmsAccountId':_0x3b88e6},'order':_0x28ad('0x74')})[_0x28ad('0x21')](function(_0x392998){_0x1da282=_0x392998;});}})[_0x28ad('0x5a')](function(_0x3026a8){_0x27c604=0x1f4;logger[_0x28ad('0x26')](_0x3026a8[_0x28ad('0x39')]);if(_0x3026a8[_0x28ad('0x3a')]){delete _0x3026a8[_0x28ad('0x3a')];}_0x1da282=_0x3026a8;})[_0x28ad('0xc0')](function(){if(_0x1da282===null){_0x27a6ae[_0x28ad('0x2a')](_0x27c604);}else{if(_0x27c604===0x1f4){_0x27a6ae[_0x28ad('0x2b')](_0x27c604)['send'](_0x1da282);}else{_0x27a6ae[_0x28ad('0x2b')](_0x27c604)[_0x28ad('0x2d')](_0x1da282);}}});};exports['getApplications']=function(_0x73d941,_0x5b9367,_0x4ebda3){var _0x51fb0c={};var _0x3e49a9={};var _0x384988;var _0x106496;return db['SmsAccount'][_0x28ad('0x66')]({'where':{'id':_0x73d941['params']['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x5b9367,null))[_0x28ad('0x21')](function(_0x314e50){if(_0x314e50){_0x384988=_0x314e50;_0x3e49a9[_0x28ad('0x46')]=_[_0x28ad('0x44')](db[_0x28ad('0x71')]['rawAttributes']);_0x3e49a9[_0x28ad('0x43')]=_[_0x28ad('0x44')](_0x73d941[_0x28ad('0x43')]);_0x3e49a9[_0x28ad('0x45')]=_[_0x28ad('0x58')](_0x3e49a9[_0x28ad('0x46')],_0x3e49a9[_0x28ad('0x43')]);_0x51fb0c[_0x28ad('0x47')]=_[_0x28ad('0x58')](_0x3e49a9[_0x28ad('0x46')],qs['fields'](_0x73d941[_0x28ad('0x43')][_0x28ad('0x48')]));_0x51fb0c[_0x28ad('0x47')]=_0x51fb0c[_0x28ad('0x47')][_0x28ad('0x49')]?_0x51fb0c[_0x28ad('0x47')]:_0x3e49a9[_0x28ad('0x46')];_0x51fb0c[_0x28ad('0x4d')]=qs['sort'](_0x73d941[_0x28ad('0x43')][_0x28ad('0x4e')]);_0x51fb0c[_0x28ad('0x4f')]=qs[_0x28ad('0x45')](_['pick'](_0x73d941['query'],_0x3e49a9['filters']));if(_0x73d941[_0x28ad('0x43')]['filter']){_0x51fb0c[_0x28ad('0x4f')]=_['merge'](_0x51fb0c[_0x28ad('0x4f')],{'$or':_[_0x28ad('0x3e')](_0x51fb0c['attributes'],function(_0x513128){var _0x32c043={};_0x32c043[_0x513128]={'$like':'%'+_0x73d941[_0x28ad('0x43')]['filter']+'%'};return _0x32c043;})});}_0x51fb0c=_[_0x28ad('0x52')]({},_0x51fb0c,_0x73d941[_0x28ad('0x53')]);return _0x384988[_0x28ad('0xc1')](_0x51fb0c);}})[_0x28ad('0x21')](function(_0x23d114){if(_0x23d114){_0x106496=_0x23d114[_0x28ad('0x49')];if(!_0x73d941[_0x28ad('0x43')]['hasOwnProperty'](_0x28ad('0x4b'))){_0x51fb0c[_0x28ad('0x2f')]=qs[_0x28ad('0x2f')](_0x73d941[_0x28ad('0x43')]['limit']);_0x51fb0c['offset']=qs[_0x28ad('0x4c')](_0x73d941[_0x28ad('0x43')][_0x28ad('0x4c')]);}return _0x384988[_0x28ad('0xc1')](_0x51fb0c);}})[_0x28ad('0x21')](function(_0x3a890f){if(_0x3a890f){return _0x3a890f?{'count':_0x106496,'rows':_0x3a890f}:null;}})[_0x28ad('0x21')](respondWithResult(_0x5b9367,null))[_0x28ad('0x5a')](handleError(_0x5b9367,null));};exports[_0x28ad('0xc2')]=function(_0x481209,_0x2b7b01,_0x108a4e){var _0x68bc44={'raw':![],'where':{}};var _0x36f429={};var _0x245377={'count':0x0,'rows':[]};return db[_0x28ad('0x3f')][_0x28ad('0x66')]({'where':{'id':_0x481209[_0x28ad('0x61')]['id']}})['then'](handleEntityNotFound(_0x2b7b01,null))[_0x28ad('0x21')](function(_0x487e65){if(_0x487e65){_0x36f429[_0x28ad('0x46')]=_[_0x28ad('0x44')](db[_0x28ad('0xa1')][_0x28ad('0x40')]);_0x36f429[_0x28ad('0x43')]=_['keys'](_0x481209[_0x28ad('0x43')]);_0x36f429[_0x28ad('0x45')]=_[_0x28ad('0x58')](_0x36f429[_0x28ad('0x46')],_0x36f429[_0x28ad('0x43')]);_0x68bc44[_0x28ad('0x47')]=_[_0x28ad('0x58')](_0x36f429[_0x28ad('0x46')],qs[_0x28ad('0x48')](_0x481209[_0x28ad('0x43')][_0x28ad('0x48')]));_0x68bc44[_0x28ad('0x47')]=_0x68bc44[_0x28ad('0x47')][_0x28ad('0x49')]?_0x68bc44['attributes']:_0x36f429['model'];if(!_0x481209[_0x28ad('0x43')][_0x28ad('0x4a')](_0x28ad('0x4b'))){_0x68bc44[_0x28ad('0x2f')]=qs[_0x28ad('0x2f')](_0x481209[_0x28ad('0x43')]['limit']);_0x68bc44['offset']=qs[_0x28ad('0x4c')](_0x481209['query'][_0x28ad('0x4c')]);}_0x68bc44[_0x28ad('0x4d')]=qs[_0x28ad('0x4e')](_0x481209['query'][_0x28ad('0x4e')]);_0x68bc44[_0x28ad('0x4f')]=qs[_0x28ad('0x45')](_[_0x28ad('0x68')](_0x481209[_0x28ad('0x43')],_0x36f429[_0x28ad('0x45')]));_0x68bc44['where'][_0x28ad('0x64')]=_0x487e65['id'];if(_0x481209['query'][_0x28ad('0x51')]){_0x68bc44[_0x28ad('0x4f')]=_['merge'](_0x68bc44[_0x28ad('0x4f')],{'$or':_['map'](_0x68bc44[_0x28ad('0x47')],function(_0x4b3300){var _0x461e8d={};_0x461e8d[_0x4b3300]={'$like':'%'+_0x481209['query']['filter']+'%'};return _0x461e8d;})});}_0x68bc44=_[_0x28ad('0x52')]({},_0x68bc44,_0x481209[_0x28ad('0x53')]);return db[_0x28ad('0xa1')][_0x28ad('0x30')]({'where':_0x68bc44['where']})[_0x28ad('0x21')](function(_0x41bfd7){_0x245377[_0x28ad('0x30')]=_0x41bfd7;if(_0x481209[_0x28ad('0x43')][_0x28ad('0x54')]){_0x68bc44[_0x28ad('0x55')]=[{'model':db[_0x28ad('0x9c')],'as':_0x28ad('0xc3'),'required':![]},{'model':db[_0x28ad('0xa8')],'as':'Owner','attributes':['name',_0x28ad('0xc4'),_0x28ad('0xc5')],'required':![]},{'model':db[_0x28ad('0xc6')],'as':'Tags','attributes':['id',_0x28ad('0x3a'),_0x28ad('0xc7')],'where':_0x481209['query'][_0x28ad('0xc8')]?{'id':_0x481209['query'][_0x28ad('0xc8')]}:undefined,'required':_0x481209[_0x28ad('0x43')][_0x28ad('0xc8')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x68bc44);})['then'](function(_0x32c999){_0x245377[_0x28ad('0x56')]=_0x32c999;return _0x245377;});}})[_0x28ad('0x21')](respondWithFilteredResult(_0x2b7b01,_0x68bc44))[_0x28ad('0x5a')](handleError(_0x2b7b01,null));};exports['send']=function(_0x3ad125,_0xbee566,_0xcb7a87){var _0x19865a,_0x2a0122,_0x34ef4b;if(_[_0x28ad('0x94')](_0x3ad125[_0x28ad('0x60')][_0x28ad('0x60')])||_0x3ad125[_0x28ad('0x60')][_0x28ad('0x60')]===''){throw new db['Sequelize'][(_0x28ad('0x77'))](_0x28ad('0x96'));}if(_[_0x28ad('0x94')](_0x3ad125[_0x28ad('0x60')]['to'])){throw new db[(_0x28ad('0x95'))][(_0x28ad('0x77'))](_0x28ad('0xc9'));}_0x19865a=_0x3ad125['body']['to'];return db[_0x28ad('0x3f')][_0x28ad('0x59')]({'where':{'id':_0x3ad125['params']['id']},'include':[{'model':db[_0x28ad('0x9a')],'as':'List','include':[{'model':db[_0x28ad('0x9c')],'as':'Contacts','where':{'mobile':_0x19865a},'limit':0x1,'order':[[_0x28ad('0x7a'),_0x28ad('0x9e')]]}]}]})[_0x28ad('0x21')](handleEntityNotFound(_0xbee566,null))[_0x28ad('0x21')](function(_0x4cae8){if(_0x4cae8&&_0x4cae8[_0x28ad('0xca')]){_0x2a0122=_0x4cae8[_0x28ad('0x36')]({'plain':!![]});if(_0x2a0122[_0x28ad('0xca')]&&_0x2a0122[_0x28ad('0xca')][_0x28ad('0x9d')][_0x28ad('0x49')]){return _0x2a0122['List'][_0x28ad('0x9d')][0x0];}return db['CmContact']['create'](_[_0x28ad('0x19')](_0x3ad125[_0x28ad('0x60')],{'firstName':_0x19865a,'mobile':_0x19865a,'phone':_0x19865a,'ListId':_0x2a0122[_0x28ad('0x9b')]}));}})[_0x28ad('0x21')](handleEntityNotFound(_0xbee566,null))['then'](function(_0xdc09ba){if(_0xdc09ba){_0x34ef4b=_0xdc09ba;return db[_0x28ad('0xa1')][_0x28ad('0x59')]({'where':{'ContactId':_0x34ef4b['id'],'closed':![],'SmsAccountId':_0x2a0122['id']}})['then'](function(_0x428f50){if(_0x428f50){return[_0x428f50,![]];}return db['SmsInteraction'][_0x28ad('0x5b')]({'UserId':_0x3ad125[_0x28ad('0x5c')]['id'],'ContactId':_0x34ef4b['id'],'SmsAccountId':_0x2a0122['id'],'phone':_0x19865a,'firstMsgDirection':_0x28ad('0xcb'),'Messages':[_[_0x28ad('0x52')](_0x3ad125[_0x28ad('0x60')],{'read':![],'body':_0x3ad125[_0x28ad('0x60')][_0x28ad('0x60')],'phone':_0x19865a,'SmsAccountId':_0x2a0122['id'],'UserId':_0x3ad125['user']['id'],'ContactId':_0x34ef4b['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x28ad('0xcc')}]})[_0x28ad('0x21')](function(_0x38c7a4){return[_0x38c7a4,!![]];});});}})['spread'](function(_0x2b5498,_0x1179ac){if(_0x1179ac){return _0x2b5498;}return db[_0x28ad('0xcd')][_0x28ad('0x5b')](_[_0x28ad('0x52')](_0x3ad125[_0x28ad('0x60')],{'read':![],'body':_0x3ad125[_0x28ad('0x60')]['body'],'phone':_0x19865a,'SmsAccountId':_0x2a0122['id'],'SmsInteractionId':_0x2b5498['id'],'UserId':_0x3ad125[_0x28ad('0x5c')]['id'],'ContactId':_0x34ef4b['id']}))[_0x28ad('0x21')](function(_0x3792fb){_0x2b5498[_0x28ad('0xce')]['Messages']=[];_0x2b5498[_0x28ad('0xce')][_0x28ad('0xcc')][_0x28ad('0xa5')](_0x3792fb[_0x28ad('0xce')]);return _0x2b5498;});})[_0x28ad('0x21')](respondWithResult(_0xbee566,null))[_0x28ad('0x5a')](handleError(_0xbee566,null));};exports[_0x28ad('0x2b')]=function(_0x507784,_0x1a144b,_0x759f6){if(_0x507784[_0x28ad('0x60')]['id']){delete _0x507784[_0x28ad('0x60')]['id'];}var _0x2e48d4,_0x29cf50,_0x4b50a2;return db[_0x28ad('0x3f')]['find']({'where':{'id':_0x507784[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x1a144b,null))['then'](function(_0xd83b03){if(_0xd83b03){_0x4b50a2=_0xd83b03;logger['debug'](_0x28ad('0x24'),_0x28ad('0x2b'),'received\x20delivery\x20report\x20from',_0xd83b03['type'],util['inspect'](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));switch(_0xd83b03[_0x28ad('0x41')]){case _0x28ad('0x83'):if(_0x507784[_0x28ad('0x60')][_0x28ad('0xcf')]&&_0x507784[_0x28ad('0x60')]['status']){_0x29cf50=_0x507784[_0x28ad('0x60')][_0x28ad('0x2b')];return db[_0x28ad('0xcd')][_0x28ad('0x59')]({'where':{'messageId':_0x507784[_0x28ad('0x60')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x507784[_0x28ad('0x60')]['requestid']&&_0x507784[_0x28ad('0x60')]['statusInt']){_0x29cf50=_0x507784['body']['statusInt'];return db[_0x28ad('0xcd')][_0x28ad('0x59')]({'where':{'messageId':_0x507784[_0x28ad('0x60')][_0x28ad('0xd0')]}});}break;case _0x28ad('0x86'):if(_0x507784['body'][_0x28ad('0x87')]&&_0x507784[_0x28ad('0x60')][_0x28ad('0xd1')]){_0x29cf50=_0x507784['body']['status_code'];return db['SmsMessage'][_0x28ad('0x59')]({'where':{'messageId':_0x507784[_0x28ad('0x60')][_0x28ad('0x87')]}});}break;case _0x28ad('0x8b'):var _0x286e10=_0x507784[_0x28ad('0x60')][_0x28ad('0x8c')][0x0];if(_0x286e10[_0x28ad('0x81')]&&_0x286e10[_0x28ad('0x2b')][_0x28ad('0xd2')]===_0x28ad('0xd3')){_0x29cf50=_0x286e10[_0x28ad('0x2b')][_0x28ad('0xd2')];return db[_0x28ad('0xcd')]['find']({'where':{'messageId':_0x286e10['messageId']}});}break;case'clickatell':if(_0x507784[_0x28ad('0x60')]['messageId']&&_0x507784[_0x28ad('0x60')][_0x28ad('0x2b')]){_0x29cf50=_0x507784[_0x28ad('0x60')][_0x28ad('0x2b')];return db[_0x28ad('0xcd')][_0x28ad('0x59')]({'where':{'messageId':_0x507784['body']['messageId']}});}break;case _0x28ad('0x92'):if(_0x507784[_0x28ad('0x60')][0x0]['message']['id']){_0x29cf50=_0x507784[_0x28ad('0x60')][0x0]['type'];return db['SmsMessage'][_0x28ad('0x59')]({'where':{'messageId':_0x507784[_0x28ad('0x60')][0x0][_0x28ad('0x28')]['id']}});}break;case _0x28ad('0xd4'):if(_0x507784[_0x28ad('0x60')][_0x28ad('0xd5')]&&_0x507784[_0x28ad('0x60')][_0x28ad('0x2b')]){_0x29cf50=_0x507784[_0x28ad('0x60')]['status'];return db[_0x28ad('0xcd')][_0x28ad('0x59')]({'where':{'messageId':_0x507784[_0x28ad('0x60')]['redif']}});}break;}}})[_0x28ad('0x21')](handleEntityNotFound(_0x1a144b,null))['then'](function(_0x253938){if(_0x253938){_0x2e48d4=_0x253938;switch(_0x4b50a2[_0x28ad('0x41')]){case'skebby':if(_0x29cf50==='DELIVERED'){return _0x2e48d4[_0x28ad('0x34')]({'read':!![]});}else{logger[_0x28ad('0x26')](_0x28ad('0x24'),_0x28ad('0x2b'),'skebby',util[_0x28ad('0xd6')](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));}break;case _0x28ad('0x85'):if(_0x29cf50==='1'){return _0x2e48d4['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x28ad('0x2b'),_0x28ad('0x83'),util[_0x28ad('0xd6')](_0x507784['body'],{'showHidden':![],'depth':null}));}break;case _0x28ad('0x86'):if(!_0x507784['body'][_0x28ad('0xd7')]&&_0x29cf50>=0xc8&&_0x29cf50<=0xce){return _0x2e48d4['update']({'read':!![]});}else{logger[_0x28ad('0x26')](_0x28ad('0x24'),'status',_0x28ad('0x86'),util[_0x28ad('0xd6')](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));}break;case _0x28ad('0x8b'):var _0x2f254b=_0x507784[_0x28ad('0x60')][_0x28ad('0x8c')][0x0];if(_0x2f254b[_0x28ad('0x2b')][_0x28ad('0xd2')]===_0x28ad('0xd3')){return _0x2e48d4[_0x28ad('0x34')]({'read':!![]});}else{logger[_0x28ad('0x26')](_0x28ad('0x24'),_0x28ad('0x2b'),_0x28ad('0x8b'),util[_0x28ad('0xd6')](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));}break;case _0x28ad('0x90'):if(_0x29cf50==_0x28ad('0xd8')||_0x29cf50==_0x28ad('0xd9')){return _0x2e48d4['update']({'read':!![]});}else{logger[_0x28ad('0x26')](_0x28ad('0x24'),_0x28ad('0x2b'),_0x28ad('0x90'),util[_0x28ad('0xd6')](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));}break;case _0x28ad('0x92'):if(_0x29cf50==_0x28ad('0xda')){return _0x2e48d4['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x28ad('0x2b'),'bandwidth',util[_0x28ad('0xd6')](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));}break;case _0x28ad('0xd4'):if(_0x29cf50==='DELIVRD'||_0x29cf50===_0x28ad('0xdb')){return _0x2e48d4[_0x28ad('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x28ad('0x2b'),'intelepeer',util[_0x28ad('0xd6')](_0x507784[_0x28ad('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x2e48d4;}})[_0x28ad('0x21')](respondWithResult(_0x1a144b,null))[_0x28ad('0x5a')](handleError(_0x1a144b,null));};exports[_0x28ad('0xdc')]=function(_0x349180,_0x3abb73,_0x55830b){var _0x420698,_0x25cc0f,_0x3869a4;return db[_0x28ad('0x3f')]['find']({'where':{'id':_0x349180['params']['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x3abb73,null))['then'](function(_0x33c36b){if(_0x33c36b){_0x3869a4=_0x33c36b;logger['debug'](_0x28ad('0x24'),_0x28ad('0x2b'),_0x28ad('0xdd'),_0x33c36b[_0x28ad('0x41')],util[_0x28ad('0xd6')](_0x349180['query'],{'showHidden':![],'depth':null}));switch(_0x33c36b[_0x28ad('0x41')]){case _0x28ad('0x8d'):if(_0x349180[_0x28ad('0x43')]['message-id']&&_0x349180['query']['state']){_0x25cc0f=_0x349180[_0x28ad('0x43')][_0x28ad('0xde')];return db[_0x28ad('0xcd')]['find']({'where':{'messageId':_0x349180[_0x28ad('0x43')][_0x28ad('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x3abb73,null))[_0x28ad('0x21')](function(_0x4c83df){if(_0x4c83df){_0x420698=_0x4c83df;switch(_0x3869a4[_0x28ad('0x41')]){case _0x28ad('0x8d'):if(_0x25cc0f==='2'||_0x25cc0f==='6'){return _0x420698[_0x28ad('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x28ad('0x2b'),_0x28ad('0x8d'),util[_0x28ad('0xd6')](_0x349180[_0x28ad('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x420698;}})[_0x28ad('0x21')](respondWithResult(_0x3abb73,null))[_0x28ad('0x5a')](handleError(_0x3abb73,null));};exports[_0x28ad('0xe0')]=function(_0x357031,_0x5f0515,_0xdc0973){return db[_0x28ad('0x3f')]['find']({'where':{'id':_0x357031[_0x28ad('0x61')]['id']}})['then'](handleEntityNotFound(_0x5f0515,null))[_0x28ad('0x21')](function(_0x38513a){if(_0x38513a){return _0x38513a[_0x28ad('0xe0')](_0x357031[_0x28ad('0x60')]['ids'],_[_0x28ad('0xe1')](_0x357031[_0x28ad('0x60')],[_0x28ad('0x6b'),'id'])||{})[_0x28ad('0xa2')](function(_0xaa92df){for(var _0x39dc4c=0x0;_0x39dc4c<_0x357031[_0x28ad('0x60')][_0x28ad('0x6b')][_0x28ad('0x49')];_0x39dc4c+=0x1){socket['emit'](_0x28ad('0xe2'),{'UserId':Number(_0x357031['body'][_0x28ad('0x6b')][_0x39dc4c]),'SmsAccountId':Number(_0x357031[_0x28ad('0x61')]['id'])});}return _0xaa92df;});}})['then'](respondWithResult(_0x5f0515,null))['catch'](handleError(_0x5f0515,null));};exports[_0x28ad('0xe3')]=function(_0x11c7aa,_0x263669,_0x4dfd6f){return db['SmsAccount'][_0x28ad('0x59')]({'where':{'id':_0x11c7aa[_0x28ad('0x61')]['id']}})[_0x28ad('0x21')](handleEntityNotFound(_0x263669,null))['then'](function(_0x4a2833){if(_0x4a2833){return _0x4a2833[_0x28ad('0xe3')](_0x11c7aa['query'][_0x28ad('0x6b')])[_0x28ad('0x21')](function(){if(_['isArray'](_0x11c7aa[_0x28ad('0x43')][_0x28ad('0x6b')])){for(var _0x520db9=0x0;_0x520db9<_0x11c7aa[_0x28ad('0x43')]['ids']['length'];_0x520db9+=0x1){socket['emit'](_0x28ad('0xe4'),{'UserId':Number(_0x11c7aa[_0x28ad('0x43')][_0x28ad('0x6b')][_0x520db9]),'SmsAccountId':Number(_0x11c7aa['params']['id'])});}}else{socket[_0x28ad('0xe5')]('userSmsAccount:remove',{'UserId':Number(_0x11c7aa[_0x28ad('0x43')]['ids']),'SmsAccountId':Number(_0x11c7aa['params']['id'])});}});}})[_0x28ad('0x21')](respondWithStatusCode(_0x263669,null))[_0x28ad('0x5a')](handleError(_0x263669,null));};exports[_0x28ad('0xe6')]=function(_0xe5f760,_0x12b6c7,_0x1e7de3){var _0x3f1403={};var _0x2c06b9={};var _0x5c3931;var _0x451b5a;return db[_0x28ad('0x3f')][_0x28ad('0x66')]({'where':{'id':_0xe5f760['params']['id']}})['then'](handleEntityNotFound(_0x12b6c7,null))[_0x28ad('0x21')](function(_0x1fa06f){if(_0x1fa06f){_0x5c3931=_0x1fa06f;_0x2c06b9[_0x28ad('0x46')]=_[_0x28ad('0x44')](db[_0x28ad('0xa8')][_0x28ad('0x40')]);_0x2c06b9[_0x28ad('0x43')]=_[_0x28ad('0x44')](_0xe5f760[_0x28ad('0x43')]);_0x2c06b9[_0x28ad('0x45')]=_[_0x28ad('0x58')](_0x2c06b9['model'],_0x2c06b9['query']);_0x3f1403[_0x28ad('0x47')]=_[_0x28ad('0x58')](_0x2c06b9[_0x28ad('0x46')],qs[_0x28ad('0x48')](_0xe5f760[_0x28ad('0x43')][_0x28ad('0x48')]));_0x3f1403[_0x28ad('0x47')]=_0x3f1403[_0x28ad('0x47')][_0x28ad('0x49')]?_0x3f1403[_0x28ad('0x47')]:_0x2c06b9[_0x28ad('0x46')];_0x3f1403[_0x28ad('0x4d')]=qs['sort'](_0xe5f760[_0x28ad('0x43')][_0x28ad('0x4e')]);_0x3f1403[_0x28ad('0x4f')]=qs['filters'](_[_0x28ad('0x68')](_0xe5f760['query'],_0x2c06b9[_0x28ad('0x45')]));if(_0xe5f760[_0x28ad('0x43')][_0x28ad('0x51')]){_0x3f1403[_0x28ad('0x4f')]=_[_0x28ad('0x52')](_0x3f1403[_0x28ad('0x4f')],{'$or':_[_0x28ad('0x3e')](_0x3f1403['attributes'],function(_0x12d4c9){var _0x196b89={};_0x196b89[_0x12d4c9]={'$like':'%'+_0xe5f760[_0x28ad('0x43')]['filter']+'%'};return _0x196b89;})});}_0x3f1403=_['merge']({},_0x3f1403,_0xe5f760['options']);return _0x5c3931[_0x28ad('0xe6')](_0x3f1403);}})['then'](function(_0x2cf63b){if(_0x2cf63b){_0x451b5a=_0x2cf63b[_0x28ad('0x49')];if(!_0xe5f760['query']['hasOwnProperty']('nolimit')){_0x3f1403[_0x28ad('0x2f')]=qs[_0x28ad('0x2f')](_0xe5f760[_0x28ad('0x43')][_0x28ad('0x2f')]);_0x3f1403[_0x28ad('0x4c')]=qs[_0x28ad('0x4c')](_0xe5f760[_0x28ad('0x43')][_0x28ad('0x4c')]);}return _0x5c3931[_0x28ad('0xe6')](_0x3f1403);}})['then'](function(_0x512fba){if(_0x512fba){return _0x512fba?{'count':_0x451b5a,'rows':_0x512fba}:null;}})[_0x28ad('0x21')](respondWithResult(_0x12b6c7,null))[_0x28ad('0x5a')](handleError(_0x12b6c7,null));}; \ No newline at end of file +var _0xce9a=['api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','get','SmsAccounts','UserProfileResource','destroy','stack','name','send','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','sms','applications','Applications','priority','asc','account','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','From','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','infobip','results','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','CmContact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','Start','startRouting','entity\x20found','twilio','Content-Type','text/xml','\x0a','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','finally','getApplications','Owner','fullname','internal','Tag','Tags','color','tag','CmList','List','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x47f0de,_0xe12c95){var _0x2fd5d2=function(_0x307ef9){while(--_0x307ef9){_0x47f0de['push'](_0x47f0de['shift']());}};_0x2fd5d2(++_0xe12c95);}(_0xce9a,0xc9));var _0xace9=function(_0x4bfb89,_0x1c03dd){_0x4bfb89=_0x4bfb89-0x0;var _0x341f09=_0xce9a[_0x4bfb89];return _0x341f09;};'use strict';var emlformat=require(_0xace9('0x0'));var rimraf=require(_0xace9('0x1'));var zipdir=require(_0xace9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xace9('0x3'));var BPromise=require(_0xace9('0x4'));var Mustache=require(_0xace9('0x5'));var util=require(_0xace9('0x6'));var path=require(_0xace9('0x7'));var sox=require('sox');var csv=require(_0xace9('0x8'));var ejs=require(_0xace9('0x9'));var fs=require('fs');var fs_extra=require(_0xace9('0xa'));var _=require(_0xace9('0xb'));var squel=require(_0xace9('0xc'));var crypto=require(_0xace9('0xd'));var jsforce=require(_0xace9('0xe'));var deskjs=require(_0xace9('0xf'));var toCsv=require(_0xace9('0x8'));var querystring=require(_0xace9('0x10'));var Papa=require('papaparse');var Redis=require(_0xace9('0x11'));var authService=require(_0xace9('0x12'));var qs=require(_0xace9('0x13'));var as=require(_0xace9('0x14'));var hardwareService=require(_0xace9('0x15'));var logger=require(_0xace9('0x16'))(_0xace9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace9('0x18'));var db=require(_0xace9('0x19'))['db'];config[_0xace9('0x1a')]=_[_0xace9('0x1b')](config[_0xace9('0x1a')],{'host':_0xace9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xace9('0x1a')]));require(_0xace9('0x1d'))[_0xace9('0x1e')](socket);var jayson=require(_0xace9('0x1f'));var client=jayson[_0xace9('0x20')][_0xace9('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2eb1e3,_0x19ffd7,_0x51f08b,_0x585f11){return new BPromise(function(_0x49e6b4,_0x1b5a29){var _0x32a7fa=_0x585f11||client;return _0x32a7fa[_0xace9('0x22')](_0x2eb1e3,_0x51f08b)[_0xace9('0x23')](function(_0x2d6adb){logger[_0xace9('0x24')](_0xace9('0x25'),_0x19ffd7,_0xace9('0x26'));logger[_0xace9('0x27')](_0xace9('0x28'),_0x19ffd7,_0xace9('0x26'),JSON[_0xace9('0x29')](_0x2d6adb));if(_0x2d6adb[_0xace9('0x2a')]){if(_0x2d6adb['error'][_0xace9('0x2b')]===0x1f4){logger[_0xace9('0x2a')](_0xace9('0x25'),_0x19ffd7,_0x2d6adb[_0xace9('0x2a')][_0xace9('0x2c')]);return _0x1b5a29(_0x2d6adb[_0xace9('0x2a')][_0xace9('0x2c')]);}logger[_0xace9('0x2a')](_0xace9('0x25'),_0x19ffd7,_0x2d6adb[_0xace9('0x2a')][_0xace9('0x2c')]);return _0x49e6b4(_0x2d6adb[_0xace9('0x2a')]['message']);}else{logger[_0xace9('0x24')](_0xace9('0x25'),_0x19ffd7,_0xace9('0x26'));_0x49e6b4(_0x2d6adb['result'][_0xace9('0x2c')]);}})[_0xace9('0x2d')](function(_0x33be70){logger[_0xace9('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x19ffd7,_0x33be70);_0x1b5a29(_0x33be70);});});}function respondWithStatusCode(_0x4f75d0,_0x5307fe){_0x5307fe=_0x5307fe||0xcc;return function(_0x2fb9ce){if(_0x2fb9ce){return _0x4f75d0[_0xace9('0x2e')](_0x5307fe);}return _0x4f75d0[_0xace9('0x2f')](_0x5307fe)[_0xace9('0x30')]();};}function respondWithResult(_0x252fca,_0x112697){_0x112697=_0x112697||0xc8;return function(_0x1b88ad){if(_0x1b88ad){return _0x252fca[_0xace9('0x2f')](_0x112697)[_0xace9('0x31')](_0x1b88ad);}};}function respondWithFilteredResult(_0x1b845f,_0xaa8f16){return function(_0x1bb789){if(_0x1bb789){var _0x554b0e=typeof _0xaa8f16[_0xace9('0x32')]===_0xace9('0x33')&&typeof _0xaa8f16[_0xace9('0x34')]===_0xace9('0x33');var _0x3be3cc=_0x1bb789[_0xace9('0x35')];var _0x442a73=_0x554b0e?0x0:_0xaa8f16['offset'];var _0x5261fb=_0x554b0e?_0x1bb789[_0xace9('0x35')]:_0xaa8f16[_0xace9('0x32')]+_0xaa8f16[_0xace9('0x34')];var _0x5cc746;if(_0x5261fb>=_0x3be3cc){_0x5261fb=_0x3be3cc;_0x5cc746=0xc8;}else{_0x5cc746=0xce;}_0x1b845f[_0xace9('0x2f')](_0x5cc746);return _0x1b845f[_0xace9('0x36')](_0xace9('0x37'),_0x442a73+'-'+_0x5261fb+'/'+_0x3be3cc)[_0xace9('0x31')](_0x1bb789);}return null;};}function patchUpdates(_0x42e983){return function(_0x163c66){try{jsonpatch['apply'](_0x163c66,_0x42e983,!![]);}catch(_0x396c60){return BPromise[_0xace9('0x38')](_0x396c60);}return _0x163c66['save']();};}function saveUpdates(_0x50ac3c,_0x3130fe){return function(_0x8408d2){if(_0x8408d2){return _0x8408d2[_0xace9('0x39')](_0x50ac3c)[_0xace9('0x23')](function(_0x237bcf){return _0x237bcf;});}return null;};}function removeEntity(_0x533f73,_0x2eedf7){return function(_0x27a7de){if(_0x27a7de){return _0x27a7de['destroy']()[_0xace9('0x23')](function(){var _0x427778=_0x27a7de[_0xace9('0x3a')]({'plain':!![]});var _0x5f37d4=_0xace9('0x3b');return db[_0xace9('0x3c')][_0xace9('0x3d')]({'where':{'type':_0x5f37d4,'resourceId':_0x427778['id']}})[_0xace9('0x23')](function(){return _0x27a7de;});})[_0xace9('0x23')](function(){_0x533f73[_0xace9('0x2f')](0xcc)[_0xace9('0x30')]();});}};}function handleEntityNotFound(_0x1c192d,_0x3ed35d){return function(_0x5bbe1f){if(!_0x5bbe1f){_0x1c192d[_0xace9('0x2e')](0x194);}return _0x5bbe1f;};}function handleError(_0x38205a,_0x50847e){_0x50847e=_0x50847e||0x1f4;return function(_0x223d8a){logger[_0xace9('0x2a')](_0x223d8a[_0xace9('0x3e')]);if(_0x223d8a[_0xace9('0x3f')]){delete _0x223d8a[_0xace9('0x3f')];}_0x38205a[_0xace9('0x2f')](_0x50847e)[_0xace9('0x40')](_0x223d8a);};}exports['index']=function(_0x2bce1b,_0x3d3d74){var _0x500530={'include':[{'model':db[_0xace9('0x41')],'as':'mandatoryDispositionPause'}]},_0x46168e={},_0x3fcc0e={'count':0x0,'rows':[]};var _0x469ad0=_[_0xace9('0x42')](db[_0xace9('0x43')][_0xace9('0x44')],function(_0x18da85){return{'name':_0x18da85[_0xace9('0x45')],'type':_0x18da85[_0xace9('0x46')][_0xace9('0x47')]};});_0x46168e[_0xace9('0x48')]=_['map'](_0x469ad0,'name');_0x46168e[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x2bce1b[_0xace9('0x49')]);_0x46168e[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x46168e[_0xace9('0x48')],_0x46168e['query']);_0x500530[_0xace9('0x4d')]=_['intersection'](_0x46168e[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x2bce1b[_0xace9('0x49')][_0xace9('0x4e')]));_0x500530[_0xace9('0x4d')]=_0x500530[_0xace9('0x4d')][_0xace9('0x4f')]?_0x500530['attributes']:_0x46168e[_0xace9('0x48')];if(!_0x2bce1b[_0xace9('0x49')][_0xace9('0x50')](_0xace9('0x51'))){_0x500530[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x2bce1b[_0xace9('0x49')][_0xace9('0x34')]);_0x500530[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x2bce1b[_0xace9('0x49')][_0xace9('0x32')]);}_0x500530[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x2bce1b['query'][_0xace9('0x53')]);_0x500530[_0xace9('0x54')]=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x2bce1b[_0xace9('0x49')],_0x46168e[_0xace9('0x4b')]),_0x469ad0);if(_0x2bce1b[_0xace9('0x49')]['filter']){_0x500530['where']=_[_0xace9('0x56')](_0x500530[_0xace9('0x54')],{'$or':_[_0xace9('0x42')](_0x469ad0,function(_0x1197f7){if(_0x1197f7[_0xace9('0x46')]!==_0xace9('0x57')){var _0x5565f8={};_0x5565f8[_0x1197f7[_0xace9('0x3f')]]={'$like':'%'+_0x2bce1b['query'][_0xace9('0x58')]+'%'};return _0x5565f8;}})});}_0x500530=_['merge']({},_0x500530,_0x2bce1b[_0xace9('0x59')]);var _0x270ecb={'where':_0x500530[_0xace9('0x54')]};return db[_0xace9('0x43')][_0xace9('0x35')](_0x270ecb)[_0xace9('0x23')](function(_0x59fa79){_0x3fcc0e[_0xace9('0x35')]=_0x59fa79;if(_0x2bce1b[_0xace9('0x49')][_0xace9('0x5a')]){_0x500530[_0xace9('0x5b')]=[{'all':!![]}];}return db[_0xace9('0x43')][_0xace9('0x5c')](_0x500530);})[_0xace9('0x23')](function(_0x2650ba){_0x3fcc0e[_0xace9('0x5d')]=_0x2650ba;return _0x3fcc0e;})[_0xace9('0x23')](respondWithFilteredResult(_0x3d3d74,_0x500530))[_0xace9('0x2d')](handleError(_0x3d3d74,null));};exports[_0xace9('0x5e')]=function(_0x3ff0b7,_0x278e57){var _0x3bcf8d={'raw':![],'where':{'id':_0x3ff0b7[_0xace9('0x5f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x59a3d1={};_0x59a3d1[_0xace9('0x48')]=_[_0xace9('0x4a')](db['SmsAccount'][_0xace9('0x44')]);_0x59a3d1[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x3ff0b7['query']);_0x59a3d1[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x59a3d1[_0xace9('0x48')],_0x59a3d1[_0xace9('0x49')]);_0x3bcf8d[_0xace9('0x4d')]=_[_0xace9('0x4c')](_0x59a3d1[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x3ff0b7[_0xace9('0x49')]['fields']));_0x3bcf8d[_0xace9('0x4d')]=_0x3bcf8d[_0xace9('0x4d')]['length']?_0x3bcf8d['attributes']:_0x59a3d1['model'];if(_0x3ff0b7[_0xace9('0x49')][_0xace9('0x5a')]){_0x3bcf8d[_0xace9('0x5b')]=[{'all':!![]}];}_0x3bcf8d=_[_0xace9('0x56')]({},_0x3bcf8d,_0x3ff0b7[_0xace9('0x59')]);return db[_0xace9('0x43')]['find'](_0x3bcf8d)[_0xace9('0x23')](handleEntityNotFound(_0x278e57,null))[_0xace9('0x23')](respondWithResult(_0x278e57,null))[_0xace9('0x2d')](handleError(_0x278e57,null));};exports[_0xace9('0x60')]=function(_0x3405f4,_0x57a283){return db[_0xace9('0x43')][_0xace9('0x60')](_0x3405f4[_0xace9('0x61')],{})['then'](function(_0x5a6b27){var _0x29ec7d=_0x3405f4[_0xace9('0x62')][_0xace9('0x3a')]({'plain':!![]});if(!_0x29ec7d)throw new Error(_0xace9('0x63'));if(_0x29ec7d[_0xace9('0x64')]===_0xace9('0x62')){var _0x455691=_0x5a6b27['get']({'plain':!![]});var _0x17adc7=_0xace9('0x3b');return db['UserProfileSection'][_0xace9('0x65')]({'where':{'name':_0x17adc7,'userProfileId':_0x29ec7d[_0xace9('0x66')]},'raw':!![]})[_0xace9('0x23')](function(_0x21a5b2){if(_0x21a5b2&&_0x21a5b2[_0xace9('0x67')]===0x0){return db[_0xace9('0x3c')][_0xace9('0x60')]({'name':_0x455691[_0xace9('0x3f')],'resourceId':_0x455691['id'],'type':_0x21a5b2[_0xace9('0x3f')],'sectionId':_0x21a5b2['id']},{})[_0xace9('0x23')](function(){return _0x5a6b27;});}else{return _0x5a6b27;}})[_0xace9('0x2d')](function(_0x41eba6){logger[_0xace9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41eba6);throw _0x41eba6;});}return _0x5a6b27;})[_0xace9('0x23')](respondWithResult(_0x57a283,0xc9))[_0xace9('0x2d')](handleError(_0x57a283,null));};exports[_0xace9('0x39')]=function(_0x2dcbd8,_0x557e98){if(_0x2dcbd8[_0xace9('0x61')]['id']){delete _0x2dcbd8[_0xace9('0x61')]['id'];}return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x2dcbd8['params']['id']},'include':[{'model':db[_0xace9('0x41')],'as':_0xace9('0x68')}]})[_0xace9('0x23')](handleEntityNotFound(_0x557e98,null))['then'](saveUpdates(_0x2dcbd8['body'],null))[_0xace9('0x23')](respondWithResult(_0x557e98,null))[_0xace9('0x2d')](handleError(_0x557e98,null));};exports[_0xace9('0x3d')]=function(_0x2abcb5,_0x5c2c94){return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x2abcb5[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x5c2c94,null))['then'](removeEntity(_0x5c2c94,null))['catch'](handleError(_0x5c2c94,null));};exports[_0xace9('0x69')]=function(_0x5798e4,_0xacd98e){return db[_0xace9('0x43')]['describe']()[_0xace9('0x23')](respondWithResult(_0xacd98e,null))[_0xace9('0x2d')](handleError(_0xacd98e,null));};exports[_0xace9('0x6a')]=function(_0x3790ca,_0x467a8c,_0xf10b2e){if(_0x3790ca[_0xace9('0x61')]['id']){delete _0x3790ca[_0xace9('0x61')]['id'];}return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x3790ca[_0xace9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x467a8c,null))[_0xace9('0x23')](function(_0x5aed51){if(_0x5aed51){_0x3790ca[_0xace9('0x61')][_0xace9('0x6b')]=_0x5aed51['id'];return db[_0xace9('0x6c')][_0xace9('0x60')](_0x3790ca['body']);}})['then'](respondWithResult(_0x467a8c,null))[_0xace9('0x2d')](handleError(_0x467a8c,null));};exports[_0xace9('0x6d')]=function(_0x35ca68,_0x3deb41,_0x51331c){var _0x3836e4={'raw':![],'where':{}};var _0x2ca760={};var _0x4b3f80={'count':0x0,'rows':[]};return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x35ca68['params']['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x3deb41,null))[_0xace9('0x23')](function(_0x36f0da){if(_0x36f0da){_0x2ca760['model']=_[_0xace9('0x4a')](db[_0xace9('0x6c')][_0xace9('0x44')]);_0x2ca760['query']=_['keys'](_0x35ca68[_0xace9('0x49')]);_0x2ca760[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x2ca760[_0xace9('0x48')],_0x2ca760[_0xace9('0x49')]);_0x3836e4[_0xace9('0x4d')]=_['intersection'](_0x2ca760[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x35ca68['query'][_0xace9('0x4e')]));_0x3836e4['attributes']=_0x3836e4['attributes'][_0xace9('0x4f')]?_0x3836e4[_0xace9('0x4d')]:_0x2ca760[_0xace9('0x48')];if(!_0x35ca68[_0xace9('0x49')][_0xace9('0x50')](_0xace9('0x51'))){_0x3836e4[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x35ca68[_0xace9('0x49')][_0xace9('0x34')]);_0x3836e4[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x35ca68[_0xace9('0x49')]['offset']);}_0x3836e4[_0xace9('0x52')]=qs['sort'](_0x35ca68[_0xace9('0x49')][_0xace9('0x53')]);_0x3836e4[_0xace9('0x54')]=qs['filters'](_['pick'](_0x35ca68[_0xace9('0x49')],_0x2ca760[_0xace9('0x4b')]));_0x3836e4['where'][_0xace9('0x6b')]=_0x36f0da['id'];if(_0x35ca68[_0xace9('0x49')][_0xace9('0x58')]){_0x3836e4[_0xace9('0x54')]=_[_0xace9('0x56')](_0x3836e4['where'],{'$or':_['map'](_0x3836e4[_0xace9('0x4d')],function(_0x5e55fa){var _0x337253={};_0x337253[_0x5e55fa]={'$like':'%'+_0x35ca68[_0xace9('0x49')][_0xace9('0x58')]+'%'};return _0x337253;})});}_0x3836e4=_[_0xace9('0x56')]({},_0x3836e4,_0x35ca68[_0xace9('0x59')]);return db[_0xace9('0x6c')]['count']({'where':_0x3836e4['where']})[_0xace9('0x23')](function(_0x43ccc4){_0x4b3f80[_0xace9('0x35')]=_0x43ccc4;if(_0x35ca68[_0xace9('0x49')][_0xace9('0x5a')]){_0x3836e4[_0xace9('0x5b')]=[{'all':!![]}];}return db[_0xace9('0x6c')][_0xace9('0x5c')](_0x3836e4);})[_0xace9('0x23')](function(_0x4bd14f){_0x4b3f80['rows']=_0x4bd14f;return _0x4b3f80;});}})[_0xace9('0x23')](respondWithFilteredResult(_0x3deb41,_0x3836e4))['catch'](handleError(_0x3deb41,null));};exports[_0xace9('0x6f')]=function(_0x41e6e6,_0x12d214,_0xd86e63){return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x41e6e6[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x12d214,null))[_0xace9('0x23')](function(_0x55385e){if(_0x55385e){return _0x55385e['removeDispositions'](_0x41e6e6['query']['ids']);}})[_0xace9('0x23')](respondWithStatusCode(_0x12d214,null))['catch'](handleError(_0x12d214,null));};exports[_0xace9('0x70')]=function(_0x419194,_0x3d1d4f,_0x523848){if(_0x419194['body']['id']){delete _0x419194[_0xace9('0x61')]['id'];}return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x419194[_0xace9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3d1d4f,null))[_0xace9('0x23')](function(_0x23b2e7){if(_0x23b2e7){_0x419194['body'][_0xace9('0x6b')]=_0x23b2e7['id'];return db[_0xace9('0x71')][_0xace9('0x60')](_0x419194[_0xace9('0x61')]);}})[_0xace9('0x23')](respondWithResult(_0x3d1d4f,null))[_0xace9('0x2d')](handleError(_0x3d1d4f,null));};exports[_0xace9('0x72')]=function(_0x452af7,_0x1cec7f,_0x298488){var _0x30606d={'raw':![],'where':{}};var _0x47b73f={};var _0x560944={'count':0x0,'rows':[]};return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x452af7[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x1cec7f,null))['then'](function(_0x459450){if(_0x459450){_0x47b73f[_0xace9('0x48')]=_[_0xace9('0x4a')](db[_0xace9('0x71')][_0xace9('0x44')]);_0x47b73f['query']=_['keys'](_0x452af7[_0xace9('0x49')]);_0x47b73f[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x47b73f[_0xace9('0x48')],_0x47b73f[_0xace9('0x49')]);_0x30606d[_0xace9('0x4d')]=_[_0xace9('0x4c')](_0x47b73f[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x452af7[_0xace9('0x49')]['fields']));_0x30606d[_0xace9('0x4d')]=_0x30606d['attributes'][_0xace9('0x4f')]?_0x30606d[_0xace9('0x4d')]:_0x47b73f['model'];if(!_0x452af7['query']['hasOwnProperty'](_0xace9('0x51'))){_0x30606d[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x452af7[_0xace9('0x49')]['limit']);_0x30606d[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x452af7[_0xace9('0x49')][_0xace9('0x32')]);}_0x30606d[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x452af7[_0xace9('0x49')][_0xace9('0x53')]);_0x30606d[_0xace9('0x54')]=qs['filters'](_[_0xace9('0x55')](_0x452af7[_0xace9('0x49')],_0x47b73f[_0xace9('0x4b')]));_0x30606d[_0xace9('0x54')]['SmsAccountId']=_0x459450['id'];if(_0x452af7[_0xace9('0x49')][_0xace9('0x58')]){_0x30606d[_0xace9('0x54')]=_[_0xace9('0x56')](_0x30606d[_0xace9('0x54')],{'$or':_[_0xace9('0x42')](_0x30606d['attributes'],function(_0x2adb19){var _0x240796={};_0x240796[_0x2adb19]={'$like':'%'+_0x452af7[_0xace9('0x49')][_0xace9('0x58')]+'%'};return _0x240796;})});}_0x30606d=_[_0xace9('0x56')]({},_0x30606d,_0x452af7[_0xace9('0x59')]);return db[_0xace9('0x71')][_0xace9('0x35')]({'where':_0x30606d['where']})[_0xace9('0x23')](function(_0x5d9b59){_0x560944[_0xace9('0x35')]=_0x5d9b59;if(_0x452af7[_0xace9('0x49')][_0xace9('0x5a')]){_0x30606d[_0xace9('0x5b')]=[{'all':!![]}];}return db[_0xace9('0x71')][_0xace9('0x5c')](_0x30606d);})['then'](function(_0x3cb16d){_0x560944['rows']=_0x3cb16d;return _0x560944;});}})[_0xace9('0x23')](respondWithFilteredResult(_0x1cec7f,_0x30606d))[_0xace9('0x2d')](handleError(_0x1cec7f,null));};exports['removeAnswers']=function(_0x4b4a18,_0x47aec6,_0x20042b){return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x4b4a18['params']['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x47aec6,null))[_0xace9('0x23')](function(_0x1f5602){if(_0x1f5602){return _0x1f5602['removeAnswers'](_0x4b4a18[_0xace9('0x49')][_0xace9('0x73')]);}})[_0xace9('0x23')](respondWithStatusCode(_0x47aec6,null))[_0xace9('0x2d')](handleError(_0x47aec6,null));};exports['notify']=function(_0x1a9133,_0x54effa,_0x27e6eb){var _0x4b8b8b={'channel':_0xace9('0x74')};var _0x402cb7=[];var _0x1e0e6e=[];var _0x2e13ca={};return db[_0xace9('0x43')]['find']({'where':{'id':_0x1a9133['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x54effa,null))[_0xace9('0x23')](function(_0x5a9980){_0x4b8b8b['account']=_0x5a9980;_0x4b8b8b[_0xace9('0x75')]=_['orderBy'](_0x5a9980[_0xace9('0x76')],[_0xace9('0x77')],[_0xace9('0x78')]);if(_0x4b8b8b[_0xace9('0x79')][_0xace9('0x76')]){delete _0x4b8b8b[_0xace9('0x79')][_0xace9('0x76')];}return db['CmContact'][_0xace9('0x69')]();})[_0xace9('0x23')](function(_0x4c3a13){if(!_0x4c3a13){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))]('no\x20available\x20attributes');}_0x402cb7=_[_0xace9('0x7c')](_['keys'](_0x4c3a13),[_0xace9('0x7d'),_0xace9('0x7e')]);_0x1e0e6e=_[_0xace9('0x7c')](_[_0xace9('0x4a')](_0x4c3a13),[_0xace9('0x7d'),_0xace9('0x7e'),_0xace9('0x7f'),_0xace9('0x80')]);_0x4b8b8b['body']={'mapKey':'mobile'};if(_0x4b8b8b[_0xace9('0x79')]['type']){switch(_0x4b8b8b[_0xace9('0x79')][_0xace9('0x46')]){case'twilio':_0x4b8b8b[_0xace9('0x61')]['from']=_0x1a9133[_0xace9('0x61')][_0xace9('0x81')];_0x4b8b8b[_0xace9('0x61')]['body']=_0x1a9133[_0xace9('0x61')]['Body'];_0x4b8b8b[_0xace9('0x61')]['messageId']=_0x1a9133[_0xace9('0x61')]['MessageSid'];break;case _0xace9('0x82'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]='+'+_0x1a9133['body'][_0xace9('0x84')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133['body'][_0xace9('0x85')];break;case _0xace9('0x86'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')]['from'];_0x4b8b8b['body'][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x2c')];break;case _0xace9('0x87'):_0x4b8b8b['body'][_0xace9('0x83')]=_0x1a9133['body'][_0xace9('0x83')];_0x4b8b8b[_0xace9('0x61')]['body']=_0x1a9133['body'][_0xace9('0x61')];_0x4b8b8b[_0xace9('0x61')]['messageId']=_0x1a9133[_0xace9('0x61')][_0xace9('0x88')];break;case _0xace9('0x89'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x81')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x8a')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133['body'][_0xace9('0x8c')];break;case _0xace9('0x8d'):_0x4b8b8b['body'][_0xace9('0x83')]='+'+_0x1a9133['body'][_0xace9('0x8e')][0x0][_0xace9('0x83')];_0x4b8b8b['body'][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x8e')][0x0][_0xace9('0x85')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')]['results'][0x0][_0xace9('0x8b')];break;case _0xace9('0x8f'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x90')];_0x4b8b8b['body'][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')]['segmentedMessage']['message'];break;case _0xace9('0x91'):_0x4b8b8b[_0xace9('0x61')]['from']=_0x1a9133['body'][_0xace9('0x92')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x85')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x93')];break;case _0xace9('0x94'):_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')][0x0][_0xace9('0x2c')]['id'];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][0x0][_0xace9('0x2c')][_0xace9('0x83')];_0x4b8b8b[_0xace9('0x61')]['body']=_0x1a9133[_0xace9('0x61')][0x0]['message']['text'];break;case'intelepeer':_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x83')];_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x2c')];_0x4b8b8b['body'][_0xace9('0x8b')]=_0x1a9133[_0xace9('0x61')][_0xace9('0x95')];break;}}if(_0x4b8b8b[_0xace9('0x61')]['id']){delete _0x4b8b8b['body']['id'];}if(_['isNil'](_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')])){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))](_0xace9('0x96'));}if(_['isNil'](_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')])||_0x4b8b8b[_0xace9('0x61')][_0xace9('0x61')]===''){throw new db['Sequelize'][(_0xace9('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xace9('0x97')](_0x4b8b8b['body'][_0xace9('0x98')])){throw new db[(_0xace9('0x7a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e0e6e);}if(!_[_0xace9('0x99')](_0x1e0e6e,_0x4b8b8b['body']['mapKey'])){throw new db[(_0xace9('0x7a'))]['ValidationError'](_0xace9('0x9a')+_0x1e0e6e);}_0x2e13ca[_0x4b8b8b['body'][_0xace9('0x98')]]=_0x4b8b8b['body'][_0xace9('0x83')];return db['CmList'][_0xace9('0x65')]({'where':{'id':_0x4b8b8b[_0xace9('0x79')][_0xace9('0x80')]},'include':[{'model':db['CmContact'],'as':_0xace9('0x9b'),'where':_0x2e13ca,'limit':0x1,'order':[[_0xace9('0x7e'),_0xace9('0x9c')]]}]});})['then'](handleEntityNotFound(_0x54effa,null))[_0xace9('0x23')](function(_0x5ed531){if(_0x5ed531){_0x4b8b8b[_0xace9('0x9d')]=_[_0xace9('0x9e')](_0x5ed531,[_0xace9('0x9b')]);if(_0x5ed531['Contacts']['length']){return _0x5ed531[_0xace9('0x9b')][0x0];}var _0x354794=_[_0xace9('0x1b')](_0x4b8b8b['body'],{'firstName':_0x4b8b8b['body'][_0xace9('0x83')],'ListId':_0x5ed531['id']});_0x354794[_0x4b8b8b[_0xace9('0x61')]['mapKey']]=_0x4b8b8b['body'][_0xace9('0x83')];return db[_0xace9('0x9f')][_0xace9('0x60')](_0x354794,{'fields':_0x402cb7,'raw':!![]});}})[_0xace9('0x23')](handleEntityNotFound(_0x54effa,null))['then'](function(_0x3c8379){if(_0x3c8379){_0x4b8b8b['contact']=_0x3c8379;var _0xa036ef={'ContactId':_0x3c8379['id'],'phone':_0x4b8b8b[_0xace9('0x61')][_0xace9('0x83')],'SmsAccountId':_0x1a9133[_0xace9('0x5f')]['id']};var _0x10a2cd={'ContactId':_0x3c8379['id'],'SmsAccountId':_0x1a9133[_0xace9('0x5f')]['id'],'closed':![]};return db[_0xace9('0xa0')][_0xace9('0x65')]({'where':_0x10a2cd})[_0xace9('0x23')](function(_0x3742b9){if(_0x3742b9){return[_0x3742b9,![]];}return db['SmsInteraction'][_0xace9('0x60')](_0xa036ef)[_0xace9('0x23')](function(_0x34bc00){return[_0x34bc00,!![]];});});}})[_0xace9('0xa1')](function(_0x30cb57,_0x1c2e1d){_0x4b8b8b[_0xace9('0xa2')]=_0x30cb57[_0xace9('0x3a')]({'plain':!![]});_0x4b8b8b[_0xace9('0xa2')][_0xace9('0xa3')]=![];if(_0x1c2e1d){if(_0x4b8b8b[_0xace9('0x79')][_0xace9('0xa4')]){_0x4b8b8b[_0xace9('0x75')][_0xace9('0xa5')]({'id':0x0,'priority':_0x4b8b8b[_0xace9('0x75')][_0xace9('0x4f')]+0x1,'app':_0xace9('0xa6'),'appdata':_0xace9('0xa7'),'interval':_0xace9('0xa8')});}_0x4b8b8b[_0xace9('0xa2')]['created']=!![];}return db['SmsMessage'][_0xace9('0x60')]({'phone':_0x4b8b8b['body'][_0xace9('0x83')],'messageId':_0x4b8b8b[_0xace9('0x61')][_0xace9('0x8b')],'body':_0x4b8b8b[_0xace9('0x61')]['body'],'SmsAccountId':_0x1a9133[_0xace9('0x5f')]['id'],'SmsInteractionId':_0x30cb57['id'],'direction':'in','ContactId':_0x30cb57['ContactId'],'AttachmentId':_0x4b8b8b[_0xace9('0x61')][_0xace9('0xa9')]});})[_0xace9('0x23')](function(_0x1c312c){_0x4b8b8b[_0xace9('0x2c')]=_0x1c312c;if(_0x4b8b8b[_0xace9('0xa2')][_0xace9('0xaa')]){return db[_0xace9('0xab')][_0xace9('0x65')]({'attributes':['id',_0xace9('0x3f')],'where':{'id':_0x4b8b8b[_0xace9('0xa2')]['UserId']}})[_0xace9('0x23')](function(_0x58f50e){if(_0x58f50e){_0x4b8b8b[_0xace9('0x75')][_0xace9('0xac')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x58f50e[_0xace9('0x3f')]+','+(_0x4b8b8b[_0xace9('0x79')]['waitForTheAssignedAgent']||0xa),'interval':_0xace9('0xa8')});}return respondWithRpcPromise(_0xace9('0xad'),'startRouting',_0x4b8b8b);});}return respondWithRpcPromise(_0xace9('0xad'),_0xace9('0xae'),_0x4b8b8b);})[_0xace9('0x23')](function(_0x4eec54){if(_0x4eec54){var _0x3f5915=0xc8;var _0x304a8a='receiveMessage';logger[_0xace9('0x24')](_0xace9('0x28'),_0x304a8a,_0x3f5915,'entity\x20found');logger[_0xace9('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x304a8a,_0x3f5915,_0xace9('0xaf'),JSON['stringify'](_0x4eec54));if(_0x4b8b8b[_0xace9('0x79')]['type']===_0xace9('0xb0')){return _0x54effa[_0xace9('0x2f')](_0x3f5915)[_0xace9('0x36')](_0xace9('0xb1'),_0xace9('0xb2'))['send'](_0xace9('0xb3'));}else{return _0x54effa[_0xace9('0x2f')](_0x3f5915)[_0xace9('0x31')](_0x4eec54);}}})[_0xace9('0x2d')](handleError(_0x54effa,null));};exports['addApplications']=function(_0x28ad6c,_0xfdff48){var _0x271d27=_0x28ad6c['params']['id'];var _0x1b4e7d=_0x28ad6c[_0xace9('0x61')];var _0x5e4cc5=0xc8;var _0x3dac2c=null;return db[_0xace9('0xb4')][_0xace9('0xb5')]({'isolationLevel':db['sequelize'][_0xace9('0xb6')]['ISOLATION_LEVELS'][_0xace9('0xb7')]},function(_0x2a3a36){return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x271d27},'transaction':_0x2a3a36})[_0xace9('0x23')](function(_0x59e916){if(_0x59e916){return db[_0xace9('0xb8')][_0xace9('0x3d')]({'where':{'SmsAccountId':_0x271d27},'transaction':_0x2a3a36})[_0xace9('0x23')](function(){var _0x37076b=_[_0xace9('0x42')](_0x1b4e7d,function(_0x18fce8){_0x18fce8[_0xace9('0x6b')]=_0x271d27;return _0x18fce8;});return db[_0xace9('0xb8')][_0xace9('0xb9')](_0x37076b,{'transaction':_0x2a3a36});});}else{_0x5e4cc5=0x194;_0x3dac2c=[];}});})[_0xace9('0x23')](function(){if(_0x5e4cc5!==0x194){return db[_0xace9('0xb8')]['findAndCountAll']({'where':{'SmsAccountId':_0x271d27},'order':_0xace9('0x77')})['then'](function(_0x3a28ed){_0x3dac2c=_0x3a28ed;});}})[_0xace9('0x2d')](function(_0xec7933){_0x5e4cc5=0x1f4;logger[_0xace9('0x2a')](_0xec7933[_0xace9('0x3e')]);if(_0xec7933[_0xace9('0x3f')]){delete _0xec7933[_0xace9('0x3f')];}_0x3dac2c=_0xec7933;})[_0xace9('0xba')](function(){if(_0x3dac2c===null){_0xfdff48[_0xace9('0x2e')](_0x5e4cc5);}else{if(_0x5e4cc5===0x1f4){_0xfdff48[_0xace9('0x2f')](_0x5e4cc5)[_0xace9('0x40')](_0x3dac2c);}else{_0xfdff48[_0xace9('0x2f')](_0x5e4cc5)[_0xace9('0x31')](_0x3dac2c);}}});};exports[_0xace9('0xbb')]=function(_0x4dbb87,_0x1f3d29,_0x47735d){var _0x4e88cd={};var _0x4946ca={};var _0x42af45;var _0x3e7921;return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x4dbb87[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x1f3d29,null))[_0xace9('0x23')](function(_0x5a8bee){if(_0x5a8bee){_0x42af45=_0x5a8bee;_0x4946ca['model']=_[_0xace9('0x4a')](db[_0xace9('0xb8')][_0xace9('0x44')]);_0x4946ca[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x4dbb87[_0xace9('0x49')]);_0x4946ca[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x4946ca[_0xace9('0x48')],_0x4946ca[_0xace9('0x49')]);_0x4e88cd[_0xace9('0x4d')]=_['intersection'](_0x4946ca[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x4dbb87[_0xace9('0x49')][_0xace9('0x4e')]));_0x4e88cd[_0xace9('0x4d')]=_0x4e88cd[_0xace9('0x4d')][_0xace9('0x4f')]?_0x4e88cd[_0xace9('0x4d')]:_0x4946ca[_0xace9('0x48')];_0x4e88cd['order']=qs[_0xace9('0x53')](_0x4dbb87[_0xace9('0x49')][_0xace9('0x53')]);_0x4e88cd[_0xace9('0x54')]=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x4dbb87[_0xace9('0x49')],_0x4946ca[_0xace9('0x4b')]));if(_0x4dbb87[_0xace9('0x49')][_0xace9('0x58')]){_0x4e88cd[_0xace9('0x54')]=_[_0xace9('0x56')](_0x4e88cd[_0xace9('0x54')],{'$or':_['map'](_0x4e88cd[_0xace9('0x4d')],function(_0x15c9ed){var _0x282060={};_0x282060[_0x15c9ed]={'$like':'%'+_0x4dbb87[_0xace9('0x49')]['filter']+'%'};return _0x282060;})});}_0x4e88cd=_[_0xace9('0x56')]({},_0x4e88cd,_0x4dbb87[_0xace9('0x59')]);return _0x42af45[_0xace9('0xbb')](_0x4e88cd);}})[_0xace9('0x23')](function(_0xbfc4ff){if(_0xbfc4ff){_0x3e7921=_0xbfc4ff['length'];if(!_0x4dbb87['query'][_0xace9('0x50')](_0xace9('0x51'))){_0x4e88cd[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x4dbb87[_0xace9('0x49')][_0xace9('0x34')]);_0x4e88cd[_0xace9('0x32')]=qs[_0xace9('0x32')](_0x4dbb87[_0xace9('0x49')]['offset']);}return _0x42af45[_0xace9('0xbb')](_0x4e88cd);}})[_0xace9('0x23')](function(_0x464a50){if(_0x464a50){return _0x464a50?{'count':_0x3e7921,'rows':_0x464a50}:null;}})[_0xace9('0x23')](respondWithResult(_0x1f3d29,null))[_0xace9('0x2d')](handleError(_0x1f3d29,null));};exports['getInteractions']=function(_0x14e710,_0x2764dc,_0x4c020e){var _0x3b5af5={'raw':![],'where':{}};var _0x1603e9={};var _0x21d4f0={'count':0x0,'rows':[]};return db['SmsAccount'][_0xace9('0x6e')]({'where':{'id':_0x14e710[_0xace9('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2764dc,null))[_0xace9('0x23')](function(_0x4a4214){if(_0x4a4214){_0x1603e9[_0xace9('0x48')]=_['keys'](db[_0xace9('0xa0')][_0xace9('0x44')]);_0x1603e9[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x14e710[_0xace9('0x49')]);_0x1603e9[_0xace9('0x4b')]=_[_0xace9('0x4c')](_0x1603e9[_0xace9('0x48')],_0x1603e9['query']);_0x3b5af5[_0xace9('0x4d')]=_[_0xace9('0x4c')](_0x1603e9[_0xace9('0x48')],qs[_0xace9('0x4e')](_0x14e710[_0xace9('0x49')][_0xace9('0x4e')]));_0x3b5af5['attributes']=_0x3b5af5[_0xace9('0x4d')][_0xace9('0x4f')]?_0x3b5af5['attributes']:_0x1603e9[_0xace9('0x48')];if(!_0x14e710[_0xace9('0x49')][_0xace9('0x50')](_0xace9('0x51'))){_0x3b5af5[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x14e710['query'][_0xace9('0x34')]);_0x3b5af5[_0xace9('0x32')]=qs['offset'](_0x14e710[_0xace9('0x49')]['offset']);}_0x3b5af5[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x14e710[_0xace9('0x49')][_0xace9('0x53')]);_0x3b5af5[_0xace9('0x54')]=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x14e710[_0xace9('0x49')],_0x1603e9[_0xace9('0x4b')]));_0x3b5af5[_0xace9('0x54')][_0xace9('0x6b')]=_0x4a4214['id'];if(_0x14e710['query'][_0xace9('0x58')]){_0x3b5af5[_0xace9('0x54')]=_[_0xace9('0x56')](_0x3b5af5[_0xace9('0x54')],{'$or':_['map'](_0x3b5af5[_0xace9('0x4d')],function(_0x7290a5){var _0x5a40a8={};_0x5a40a8[_0x7290a5]={'$like':'%'+_0x14e710[_0xace9('0x49')][_0xace9('0x58')]+'%'};return _0x5a40a8;})});}_0x3b5af5=_[_0xace9('0x56')]({},_0x3b5af5,_0x14e710[_0xace9('0x59')]);return db['SmsInteraction']['count']({'where':_0x3b5af5['where']})['then'](function(_0x1b49c9){_0x21d4f0[_0xace9('0x35')]=_0x1b49c9;if(_0x14e710['query']['includeAll']){_0x3b5af5[_0xace9('0x5b')]=[{'model':db[_0xace9('0x9f')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xace9('0xbc'),'attributes':[_0xace9('0x3f'),_0xace9('0xbd'),_0xace9('0xbe')],'required':![]},{'model':db[_0xace9('0xbf')],'as':_0xace9('0xc0'),'attributes':['id',_0xace9('0x3f'),_0xace9('0xc1')],'where':_0x14e710['query'][_0xace9('0xc2')]?{'id':_0x14e710[_0xace9('0x49')][_0xace9('0xc2')]}:undefined,'required':_0x14e710[_0xace9('0x49')]['tag']?!![]:![]}];}return db[_0xace9('0xa0')][_0xace9('0x5c')](_0x3b5af5);})[_0xace9('0x23')](function(_0x438133){_0x21d4f0['rows']=_0x438133;return _0x21d4f0;});}})[_0xace9('0x23')](respondWithFilteredResult(_0x2764dc,_0x3b5af5))[_0xace9('0x2d')](handleError(_0x2764dc,null));};exports[_0xace9('0x40')]=function(_0x39e4e4,_0x354dea,_0x38914a){var _0x5d8bc1,_0x21e55c,_0x589e9c;if(_['isNil'](_0x39e4e4['body'][_0xace9('0x61')])||_0x39e4e4[_0xace9('0x61')][_0xace9('0x61')]===''){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xace9('0x97')](_0x39e4e4['body']['to'])){throw new db[(_0xace9('0x7a'))][(_0xace9('0x7b'))]('to\x20is\x20mandatory');}_0x5d8bc1=_0x39e4e4[_0xace9('0x61')]['to'];return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x39e4e4['params']['id']},'include':[{'model':db[_0xace9('0xc3')],'as':_0xace9('0xc4'),'include':[{'model':db[_0xace9('0x9f')],'as':_0xace9('0x9b'),'where':{'mobile':_0x5d8bc1},'limit':0x1,'order':[[_0xace9('0x7e'),'DESC']]}]}]})[_0xace9('0x23')](handleEntityNotFound(_0x354dea,null))[_0xace9('0x23')](function(_0x421e49){if(_0x421e49&&_0x421e49[_0xace9('0xc4')]){_0x21e55c=_0x421e49[_0xace9('0x3a')]({'plain':!![]});if(_0x21e55c[_0xace9('0xc4')]&&_0x21e55c['List'][_0xace9('0x9b')][_0xace9('0x4f')]){return _0x21e55c[_0xace9('0xc4')]['Contacts'][0x0];}return db['CmContact'][_0xace9('0x60')](_[_0xace9('0x1b')](_0x39e4e4[_0xace9('0x61')],{'firstName':_0x5d8bc1,'mobile':_0x5d8bc1,'phone':_0x5d8bc1,'ListId':_0x21e55c[_0xace9('0x80')]}));}})[_0xace9('0x23')](handleEntityNotFound(_0x354dea,null))[_0xace9('0x23')](function(_0x5fddf){if(_0x5fddf){_0x589e9c=_0x5fddf;return db[_0xace9('0xa0')][_0xace9('0x65')]({'where':{'ContactId':_0x589e9c['id'],'closed':![],'SmsAccountId':_0x21e55c['id']}})['then'](function(_0x206a89){if(_0x206a89){return[_0x206a89,![]];}return db[_0xace9('0xa0')][_0xace9('0x60')]({'UserId':_0x39e4e4['user']['id'],'ContactId':_0x589e9c['id'],'SmsAccountId':_0x21e55c['id'],'phone':_0x5d8bc1,'firstMsgDirection':_0xace9('0xc5'),'Messages':[_['merge'](_0x39e4e4['body'],{'read':![],'body':_0x39e4e4[_0xace9('0x61')][_0xace9('0x61')],'phone':_0x5d8bc1,'SmsAccountId':_0x21e55c['id'],'UserId':_0x39e4e4[_0xace9('0x62')]['id'],'ContactId':_0x589e9c['id']})]},{'include':[{'model':db[_0xace9('0xc6')],'as':_0xace9('0xc7')}]})[_0xace9('0x23')](function(_0x1ffcd8){return[_0x1ffcd8,!![]];});});}})[_0xace9('0xa1')](function(_0x2be21a,_0x1087b2){if(_0x1087b2){return _0x2be21a;}return db[_0xace9('0xc6')][_0xace9('0x60')](_[_0xace9('0x56')](_0x39e4e4[_0xace9('0x61')],{'read':![],'body':_0x39e4e4[_0xace9('0x61')][_0xace9('0x61')],'phone':_0x5d8bc1,'SmsAccountId':_0x21e55c['id'],'SmsInteractionId':_0x2be21a['id'],'UserId':_0x39e4e4['user']['id'],'ContactId':_0x589e9c['id']}))[_0xace9('0x23')](function(_0x11e0be){_0x2be21a[_0xace9('0xc8')][_0xace9('0xc7')]=[];_0x2be21a[_0xace9('0xc8')]['Messages'][_0xace9('0xa5')](_0x11e0be[_0xace9('0xc8')]);return _0x2be21a;});})[_0xace9('0x23')](respondWithResult(_0x354dea,null))['catch'](handleError(_0x354dea,null));};exports['status']=function(_0x1d373f,_0x3c4f11,_0x4ab080){if(_0x1d373f[_0xace9('0x61')]['id']){delete _0x1d373f[_0xace9('0x61')]['id'];}var _0x335eb4,_0x2dd3bb,_0x2385cf;return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x1d373f[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x3c4f11,null))[_0xace9('0x23')](function(_0x54c693){if(_0x54c693){_0x2385cf=_0x54c693;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xace9('0x2f'),_0xace9('0xc9'),_0x54c693[_0xace9('0x46')],util[_0xace9('0xca')](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));switch(_0x54c693[_0xace9('0x46')]){case _0xace9('0x82'):if(_0x1d373f[_0xace9('0x61')][_0xace9('0xcb')]&&_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')]){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x1d373f[_0xace9('0x61')]['skebby_dispatch_id']}});}break;case _0xace9('0x86'):if(_0x1d373f['body'][_0xace9('0xcc')]&&_0x1d373f['body'][_0xace9('0xcd')]){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0xcd')];return db[_0xace9('0xc6')]['find']({'where':{'messageId':_0x1d373f[_0xace9('0x61')]['requestid']}});}break;case _0xace9('0x87'):if(_0x1d373f[_0xace9('0x61')][_0xace9('0x88')]&&_0x1d373f[_0xace9('0x61')]['status_code']){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0xce')];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x1d373f['body']['message_id']}});}break;case _0xace9('0x8d'):var _0x13b6ae=_0x1d373f[_0xace9('0x61')][_0xace9('0x8e')][0x0];if(_0x13b6ae[_0xace9('0x8b')]&&_0x13b6ae[_0xace9('0x2f')][_0xace9('0xcf')]===_0xace9('0xd0')){_0x2dd3bb=_0x13b6ae[_0xace9('0x2f')][_0xace9('0xcf')];return db[_0xace9('0xc6')]['find']({'where':{'messageId':_0x13b6ae[_0xace9('0x8b')]}});}break;case _0xace9('0x91'):if(_0x1d373f[_0xace9('0x61')][_0xace9('0x8b')]&&_0x1d373f['body'][_0xace9('0x2f')]){_0x2dd3bb=_0x1d373f['body'][_0xace9('0x2f')];return db['SmsMessage'][_0xace9('0x65')]({'where':{'messageId':_0x1d373f['body']['messageId']}});}break;case _0xace9('0x94'):if(_0x1d373f['body'][0x0][_0xace9('0x2c')]['id']){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][0x0]['type'];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x1d373f[_0xace9('0x61')][0x0][_0xace9('0x2c')]['id']}});}break;case _0xace9('0xd1'):if(_0x1d373f['body']['redif']&&_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')]){_0x2dd3bb=_0x1d373f[_0xace9('0x61')][_0xace9('0x2f')];return db[_0xace9('0xc6')]['find']({'where':{'messageId':_0x1d373f[_0xace9('0x61')][_0xace9('0xd2')]}});}break;}}})[_0xace9('0x23')](handleEntityNotFound(_0x3c4f11,null))['then'](function(_0x37a833){if(_0x37a833){_0x335eb4=_0x37a833;switch(_0x2385cf[_0xace9('0x46')]){case _0xace9('0x82'):if(_0x2dd3bb===_0xace9('0xd0')){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xace9('0x2f'),'skebby',util['inspect'](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;case _0xace9('0x86'):if(_0x2dd3bb==='1'){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0x82'),util[_0xace9('0xca')](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1d373f[_0xace9('0x61')][_0xace9('0xd3')]&&_0x2dd3bb>=0xc8&&_0x2dd3bb<=0xce){return _0x335eb4['update']({'read':!![]});}else{logger['error'](_0xace9('0x28'),_0xace9('0x2f'),'clicksend',util[_0xace9('0xca')](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));}break;case _0xace9('0x8d'):var _0x5bcb93=_0x1d373f[_0xace9('0x61')][_0xace9('0x8e')][0x0];if(_0x5bcb93[_0xace9('0x2f')][_0xace9('0xcf')]===_0xace9('0xd0')){return _0x335eb4['update']({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),'status',_0xace9('0x8d'),util['inspect'](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));}break;case _0xace9('0x91'):if(_0x2dd3bb==_0xace9('0xd4')||_0x2dd3bb==_0xace9('0xd5')){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),_0xace9('0x2f'),'clickatell',util[_0xace9('0xca')](_0x1d373f[_0xace9('0x61')],{'showHidden':![],'depth':null}));}break;case _0xace9('0x94'):if(_0x2dd3bb=='message-delivered'){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xace9('0x94'),util[_0xace9('0xca')](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2dd3bb==='DELIVRD'||_0x2dd3bb===_0xace9('0xd6')){return _0x335eb4[_0xace9('0x39')]({'read':!![]});}else{logger[_0xace9('0x2a')](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0xd1'),util[_0xace9('0xca')](_0x1d373f['body'],{'showHidden':![],'depth':null}));}break;}return _0x335eb4;}})['then'](respondWithResult(_0x3c4f11,null))['catch'](handleError(_0x3c4f11,null));};exports[_0xace9('0xd7')]=function(_0x6286b4,_0x24f90a,_0x2fd9cb){var _0x3991e9,_0x4d08b2,_0x8c7922;return db['SmsAccount'][_0xace9('0x65')]({'where':{'id':_0x6286b4[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x24f90a,null))['then'](function(_0x377ed2){if(_0x377ed2){_0x8c7922=_0x377ed2;logger['debug'](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0xc9'),_0x377ed2[_0xace9('0x46')],util[_0xace9('0xca')](_0x6286b4[_0xace9('0x49')],{'showHidden':![],'depth':null}));switch(_0x377ed2[_0xace9('0x46')]){case _0xace9('0x8f'):if(_0x6286b4[_0xace9('0x49')][_0xace9('0xd8')]&&_0x6286b4['query'][_0xace9('0xd9')]){_0x4d08b2=_0x6286b4[_0xace9('0x49')][_0xace9('0xd9')];return db[_0xace9('0xc6')][_0xace9('0x65')]({'where':{'messageId':_0x6286b4['query'][_0xace9('0xd8')]}});}break;}}})[_0xace9('0x23')](handleEntityNotFound(_0x24f90a,null))[_0xace9('0x23')](function(_0x3b9fd1){if(_0x3b9fd1){_0x3991e9=_0x3b9fd1;switch(_0x8c7922[_0xace9('0x46')]){case'csc':if(_0x4d08b2==='2'||_0x4d08b2==='6'){return _0x3991e9['update']({'read':!![]});}else{logger['error'](_0xace9('0x28'),_0xace9('0x2f'),_0xace9('0x8f'),util[_0xace9('0xca')](_0x6286b4[_0xace9('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x3991e9;}})[_0xace9('0x23')](respondWithResult(_0x24f90a,null))[_0xace9('0x2d')](handleError(_0x24f90a,null));};exports['addAgents']=function(_0x60df84,_0x388a05,_0x17a5cc){return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x60df84[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x388a05,null))[_0xace9('0x23')](function(_0x490411){if(_0x490411){return _0x490411['addAgents'](_0x60df84[_0xace9('0x61')][_0xace9('0x73')],_['omit'](_0x60df84[_0xace9('0x61')],[_0xace9('0x73'),'id'])||{})[_0xace9('0xa1')](function(_0x2f0395){for(var _0x1b5971=0x0;_0x1b5971<_0x60df84[_0xace9('0x61')][_0xace9('0x73')][_0xace9('0x4f')];_0x1b5971+=0x1){socket[_0xace9('0xda')](_0xace9('0xdb'),{'UserId':Number(_0x60df84['body'][_0xace9('0x73')][_0x1b5971]),'SmsAccountId':Number(_0x60df84['params']['id'])});}return _0x2f0395;});}})[_0xace9('0x23')](respondWithResult(_0x388a05,null))[_0xace9('0x2d')](handleError(_0x388a05,null));};exports['removeAgents']=function(_0x48bac7,_0x51a4d3,_0x10f392){return db[_0xace9('0x43')][_0xace9('0x65')]({'where':{'id':_0x48bac7[_0xace9('0x5f')]['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x51a4d3,null))[_0xace9('0x23')](function(_0x575a8e){if(_0x575a8e){return _0x575a8e[_0xace9('0xdc')](_0x48bac7[_0xace9('0x49')][_0xace9('0x73')])[_0xace9('0x23')](function(){if(_[_0xace9('0xdd')](_0x48bac7[_0xace9('0x49')][_0xace9('0x73')])){for(var _0x120dd5=0x0;_0x120dd5<_0x48bac7[_0xace9('0x49')][_0xace9('0x73')][_0xace9('0x4f')];_0x120dd5+=0x1){socket[_0xace9('0xda')](_0xace9('0xde'),{'UserId':Number(_0x48bac7['query'][_0xace9('0x73')][_0x120dd5]),'SmsAccountId':Number(_0x48bac7[_0xace9('0x5f')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x48bac7[_0xace9('0x49')][_0xace9('0x73')]),'SmsAccountId':Number(_0x48bac7[_0xace9('0x5f')]['id'])});}});}})[_0xace9('0x23')](respondWithStatusCode(_0x51a4d3,null))[_0xace9('0x2d')](handleError(_0x51a4d3,null));};exports[_0xace9('0xdf')]=function(_0x4685d0,_0x50c03e,_0x525354){var _0x409750={};var _0x2779fb={};var _0x22bf91;var _0x207d53;return db[_0xace9('0x43')][_0xace9('0x6e')]({'where':{'id':_0x4685d0['params']['id']}})[_0xace9('0x23')](handleEntityNotFound(_0x50c03e,null))[_0xace9('0x23')](function(_0x256e5f){if(_0x256e5f){_0x22bf91=_0x256e5f;_0x2779fb[_0xace9('0x48')]=_[_0xace9('0x4a')](db[_0xace9('0xab')][_0xace9('0x44')]);_0x2779fb[_0xace9('0x49')]=_[_0xace9('0x4a')](_0x4685d0[_0xace9('0x49')]);_0x2779fb[_0xace9('0x4b')]=_['intersection'](_0x2779fb[_0xace9('0x48')],_0x2779fb[_0xace9('0x49')]);_0x409750[_0xace9('0x4d')]=_['intersection'](_0x2779fb['model'],qs[_0xace9('0x4e')](_0x4685d0[_0xace9('0x49')][_0xace9('0x4e')]));_0x409750['attributes']=_0x409750[_0xace9('0x4d')]['length']?_0x409750[_0xace9('0x4d')]:_0x2779fb['model'];_0x409750[_0xace9('0x52')]=qs[_0xace9('0x53')](_0x4685d0[_0xace9('0x49')][_0xace9('0x53')]);_0x409750['where']=qs[_0xace9('0x4b')](_[_0xace9('0x55')](_0x4685d0[_0xace9('0x49')],_0x2779fb[_0xace9('0x4b')]));if(_0x4685d0[_0xace9('0x49')]['filter']){_0x409750['where']=_[_0xace9('0x56')](_0x409750[_0xace9('0x54')],{'$or':_[_0xace9('0x42')](_0x409750[_0xace9('0x4d')],function(_0x594ba6){var _0x5cd323={};_0x5cd323[_0x594ba6]={'$like':'%'+_0x4685d0['query'][_0xace9('0x58')]+'%'};return _0x5cd323;})});}_0x409750=_[_0xace9('0x56')]({},_0x409750,_0x4685d0[_0xace9('0x59')]);return _0x22bf91[_0xace9('0xdf')](_0x409750);}})['then'](function(_0x2cad41){if(_0x2cad41){_0x207d53=_0x2cad41[_0xace9('0x4f')];if(!_0x4685d0[_0xace9('0x49')]['hasOwnProperty'](_0xace9('0x51'))){_0x409750[_0xace9('0x34')]=qs[_0xace9('0x34')](_0x4685d0[_0xace9('0x49')]['limit']);_0x409750[_0xace9('0x32')]=qs['offset'](_0x4685d0[_0xace9('0x49')][_0xace9('0x32')]);}return _0x22bf91[_0xace9('0xdf')](_0x409750);}})[_0xace9('0x23')](function(_0x159214){if(_0x159214){return _0x159214?{'count':_0x207d53,'rows':_0x159214}:null;}})[_0xace9('0x23')](respondWithResult(_0x50c03e,null))[_0xace9('0x2d')](handleError(_0x50c03e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 710a989..63bab69 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 _0xfcb6=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','emit'];(function(_0x1f79b3,_0x144667){var _0x351c11=function(_0x4df49c){while(--_0x4df49c){_0x1f79b3['push'](_0x1f79b3['shift']());}};_0x351c11(++_0x144667);}(_0xfcb6,0x78));var _0x6fcb=function(_0x3a4318,_0x13c6eb){_0x3a4318=_0x3a4318-0x0;var _0x36d746=_0xfcb6[_0x3a4318];return _0x36d746;};'use strict';var EventEmitter=require(_0x6fcb('0x0'));var SmsAccount=require(_0x6fcb('0x1'))['db'][_0x6fcb('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6fcb('0x3')](0x0);var events={'afterCreate':_0x6fcb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1f06a1){return function(_0x37c43c,_0x413312,_0x3724c1){SmsAccountEvents[_0x6fcb('0x5')](_0x1f06a1+':'+_0x37c43c['id'],_0x37c43c);SmsAccountEvents[_0x6fcb('0x5')](_0x1f06a1,_0x37c43c);_0x3724c1(null);};}for(var e in events){if(events[_0x6fcb('0x6')](e)){var event=events[e];SmsAccount[_0x6fcb('0x7')](e,emitEvent(event));}}module[_0x6fcb('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x6bc8=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6bc8,0x150));var _0x86bc=function(_0x4b26f3,_0x2293ed){_0x4b26f3=_0x4b26f3-0x0;var _0x3f87d1=_0x6bc8[_0x4b26f3];return _0x3f87d1;};'use strict';var EventEmitter=require(_0x86bc('0x0'));var SmsAccount=require(_0x86bc('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x86bc('0x2')](0x0);var events={'afterCreate':_0x86bc('0x3'),'afterUpdate':_0x86bc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2b663c){return function(_0x7afb4b,_0x22eb0e,_0x270fce){SmsAccountEvents['emit'](_0x2b663c+':'+_0x7afb4b['id'],_0x7afb4b);SmsAccountEvents[_0x86bc('0x5')](_0x2b663c,_0x7afb4b);_0x270fce(null);};}for(var e in events){if(events[_0x86bc('0x6')](e)){var event=events[e];SmsAccount[_0x86bc('0x7')](e,emitEvent(event));}}module[_0x86bc('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 8bf35bc..f8fe7a4 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 _0x82e3=['SmsAccount','sms_accounts','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x8e4c20,_0x52cdcf){var _0x13ca42=function(_0x51e39a){while(--_0x51e39a){_0x8e4c20['push'](_0x8e4c20['shift']());}};_0x13ca42(++_0x52cdcf);}(_0x82e3,0xc2));var _0x382e=function(_0x1e2c10,_0x225846){_0x1e2c10=_0x1e2c10-0x0;var _0x5a84ca=_0x82e3[_0x1e2c10];return _0x5a84ca;};'use strict';var _=require('lodash');var util=require(_0x382e('0x0'));var logger=require(_0x382e('0x1'))(_0x382e('0x2'));var moment=require('moment');var BPromise=require(_0x382e('0x3'));var rp=require(_0x382e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x382e('0x5'));var config=require(_0x382e('0x6'));var attributes=require(_0x382e('0x7'));module[_0x382e('0x8')]=function(_0x2027c8,_0x343928){return _0x2027c8[_0x382e('0x9')](_0x382e('0xa'),attributes,{'tableName':_0x382e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa12e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0x46261b,_0xd68542){var _0x31e36f=function(_0xf5ed2b){while(--_0xf5ed2b){_0x46261b['push'](_0x46261b['shift']());}};_0x31e36f(++_0xd68542);}(_0xa12e,0x1c7));var _0xea12=function(_0x3658d1,_0x5b3437){_0x3658d1=_0x3658d1-0x0;var _0x3db9de=_0xa12e[_0x3658d1];return _0x3db9de;};'use strict';var _=require('lodash');var util=require(_0xea12('0x0'));var logger=require(_0xea12('0x1'))(_0xea12('0x2'));var moment=require(_0xea12('0x3'));var BPromise=require(_0xea12('0x4'));var rp=require(_0xea12('0x5'));var fs=require('fs');var path=require(_0xea12('0x6'));var rimraf=require(_0xea12('0x7'));var config=require(_0xea12('0x8'));var attributes=require(_0xea12('0x9'));module[_0xea12('0xa')]=function(_0x43fdf5,_0x5ad8e7){return _0x43fdf5[_0xea12('0xb')]('SmsAccount',attributes,{'tableName':_0xea12('0xc'),'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 e2fa962..a32323f 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 _0x2766=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash'];(function(_0x5375bf,_0x5069bf){var _0x273e5c=function(_0x4ee269){while(--_0x4ee269){_0x5375bf['push'](_0x5375bf['shift']());}};_0x273e5c(++_0x5069bf);}(_0x2766,0xe9));var _0x6276=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x2766[_0xce93c];return _0x230720;};'use strict';var _=require(_0x6276('0x0'));var util=require(_0x6276('0x1'));var moment=require(_0x6276('0x2'));var BPromise=require(_0x6276('0x3'));var rs=require(_0x6276('0x4'));var fs=require('fs');var Redis=require(_0x6276('0x5'));var db=require(_0x6276('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6276('0x7'))(_0x6276('0x8'));var config=require(_0x6276('0x9'));var jayson=require(_0x6276('0xa'));var client=jayson[_0x6276('0xb')][_0x6276('0xc')]({'port':0x232a});config[_0x6276('0xd')]=_['defaults'](config['redis'],{'host':_0x6276('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6276('0xd')]));require(_0x6276('0xf'))[_0x6276('0x10')](socket);function respondWithRpcPromise(_0x135894,_0x2a4beb,_0xd74802){return new BPromise(function(_0xe37d0a,_0x6a7ac8){return client[_0x6276('0x11')](_0x135894,_0xd74802)[_0x6276('0x12')](function(_0x5b0d3a){logger[_0x6276('0x13')](_0x6276('0x14'),_0x2a4beb,_0x6276('0x15'));logger[_0x6276('0x16')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2a4beb,_0x6276('0x15'),JSON[_0x6276('0x17')](_0x5b0d3a));if(_0x5b0d3a[_0x6276('0x18')]){if(_0x5b0d3a[_0x6276('0x18')][_0x6276('0x19')]===0x1f4){logger[_0x6276('0x18')]('SmsAccount,\x20%s,\x20%s',_0x2a4beb,_0x5b0d3a['error']['message']);return _0x6a7ac8(_0x5b0d3a['error']['message']);}logger[_0x6276('0x18')](_0x6276('0x14'),_0x2a4beb,_0x5b0d3a['error'][_0x6276('0x1a')]);return _0xe37d0a(_0x5b0d3a['error'][_0x6276('0x1a')]);}else{logger[_0x6276('0x13')]('SmsAccount,\x20%s,\x20%s',_0x2a4beb,_0x6276('0x15'));_0xe37d0a(_0x5b0d3a[_0x6276('0x1b')][_0x6276('0x1a')]);}})[_0x6276('0x1c')](function(_0x299a67){logger[_0x6276('0x18')](_0x6276('0x14'),_0x2a4beb,_0x299a67);_0x6a7ac8(_0x299a67);});});}exports['ShowSmsAccount']=function(_0x156513){var _0x4aff48=this;return new Promise(function(_0x335058,_0xbbc2d0){return db[_0x6276('0x1d')][_0x6276('0x1e')]({'raw':_0x156513[_0x6276('0x1f')]?_0x156513[_0x6276('0x1f')][_0x6276('0x20')]===undefined?!![]:![]:!![],'where':_0x156513['options']?_0x156513[_0x6276('0x1f')][_0x6276('0x21')]||null:null,'attributes':_0x156513[_0x6276('0x1f')]?_0x156513[_0x6276('0x1f')][_0x6276('0x22')]||null:null,'include':_0x156513[_0x6276('0x1f')]?_0x156513[_0x6276('0x1f')][_0x6276('0x23')]?_[_0x6276('0x24')](_0x156513['options'][_0x6276('0x23')],function(_0x4b54cc){return{'model':db[_0x4b54cc['model']],'as':_0x4b54cc['as'],'attributes':_0x4b54cc[_0x6276('0x22')],'include':_0x4b54cc[_0x6276('0x23')]?_['map'](_0x4b54cc['include'],function(_0x4ae6f2){return{'model':db[_0x4ae6f2[_0x6276('0x25')]],'as':_0x4ae6f2['as'],'attributes':_0x4ae6f2[_0x6276('0x22')],'include':_0x4ae6f2[_0x6276('0x23')]?_['map'](_0x4ae6f2[_0x6276('0x23')],function(_0x498a67){return{'model':db[_0x498a67[_0x6276('0x25')]],'as':_0x498a67['as'],'attributes':_0x498a67['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15bd05){logger[_0x6276('0x13')]('ShowSmsAccount',_0x156513);logger['debug'](_0x6276('0x26'),_0x156513,JSON[_0x6276('0x17')](_0x15bd05));_0x335058(_0x15bd05);})[_0x6276('0x1c')](function(_0x581593){logger[_0x6276('0x18')](_0x6276('0x26'),_0x581593[_0x6276('0x1a')],_0x156513);_0xbbc2d0(_0x4aff48[_0x6276('0x18')](0x1f4,_0x581593[_0x6276('0x1a')]));});});}; \ No newline at end of file +var _0xafbb=['http','redis','localhost','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','map','model','attributes','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x344778,_0x408156){var _0x13e6c4=function(_0x461647){while(--_0x461647){_0x344778['push'](_0x344778['shift']());}};_0x13e6c4(++_0x408156);}(_0xafbb,0x65));var _0xbafb=function(_0x130027,_0x110588){_0x130027=_0x130027-0x0;var _0x5ce5ae=_0xafbb[_0x130027];return _0x5ce5ae;};'use strict';var _=require(_0xbafb('0x0'));var util=require(_0xbafb('0x1'));var moment=require(_0xbafb('0x2'));var BPromise=require(_0xbafb('0x3'));var rs=require(_0xbafb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbafb('0x5'))['db'];var utils=require(_0xbafb('0x6'));var logger=require(_0xbafb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbafb('0x8'));var client=jayson[_0xbafb('0x9')][_0xbafb('0xa')]({'port':0x232a});config[_0xbafb('0xb')]=_['defaults'](config['redis'],{'host':_0xbafb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbafb('0xb')]));require('./smsAccount.socket')[_0xbafb('0xd')](socket);function respondWithRpcPromise(_0x4ca1ed,_0x503c99,_0x716df4){return new BPromise(function(_0x5d1538,_0x5d56b7){return client[_0xbafb('0xe')](_0x4ca1ed,_0x716df4)[_0xbafb('0xf')](function(_0x38d11b){logger['info'](_0xbafb('0x10'),_0x503c99,_0xbafb('0x11'));logger['debug'](_0xbafb('0x12'),_0x503c99,_0xbafb('0x11'),JSON[_0xbafb('0x13')](_0x38d11b));if(_0x38d11b[_0xbafb('0x14')]){if(_0x38d11b[_0xbafb('0x14')][_0xbafb('0x15')]===0x1f4){logger[_0xbafb('0x14')](_0xbafb('0x10'),_0x503c99,_0x38d11b[_0xbafb('0x14')][_0xbafb('0x16')]);return _0x5d56b7(_0x38d11b[_0xbafb('0x14')][_0xbafb('0x16')]);}logger[_0xbafb('0x14')](_0xbafb('0x10'),_0x503c99,_0x38d11b['error'][_0xbafb('0x16')]);return _0x5d1538(_0x38d11b[_0xbafb('0x14')][_0xbafb('0x16')]);}else{logger[_0xbafb('0x17')](_0xbafb('0x10'),_0x503c99,_0xbafb('0x11'));_0x5d1538(_0x38d11b[_0xbafb('0x18')][_0xbafb('0x16')]);}})[_0xbafb('0x19')](function(_0x177053){logger['error'](_0xbafb('0x10'),_0x503c99,_0x177053);_0x5d56b7(_0x177053);});});}exports[_0xbafb('0x1a')]=function(_0x52bd2e){var _0x45160e=this;return new Promise(function(_0x30a47b,_0x37ed9e){return db[_0xbafb('0x1b')][_0xbafb('0x1c')]({'raw':_0x52bd2e[_0xbafb('0x1d')]?_0x52bd2e[_0xbafb('0x1d')][_0xbafb('0x1e')]===undefined?!![]:![]:!![],'where':_0x52bd2e['options']?_0x52bd2e[_0xbafb('0x1d')][_0xbafb('0x1f')]||null:null,'attributes':_0x52bd2e[_0xbafb('0x1d')]?_0x52bd2e[_0xbafb('0x1d')]['attributes']||null:null,'include':_0x52bd2e[_0xbafb('0x1d')]?_0x52bd2e[_0xbafb('0x1d')][_0xbafb('0x20')]?_[_0xbafb('0x21')](_0x52bd2e[_0xbafb('0x1d')]['include'],function(_0x345391){return{'model':db[_0x345391[_0xbafb('0x22')]],'as':_0x345391['as'],'attributes':_0x345391[_0xbafb('0x23')],'include':_0x345391['include']?_[_0xbafb('0x21')](_0x345391[_0xbafb('0x20')],function(_0x47696b){return{'model':db[_0x47696b[_0xbafb('0x22')]],'as':_0x47696b['as'],'attributes':_0x47696b['attributes'],'include':_0x47696b[_0xbafb('0x20')]?_[_0xbafb('0x21')](_0x47696b[_0xbafb('0x20')],function(_0x46558f){return{'model':db[_0x46558f[_0xbafb('0x22')]],'as':_0x46558f['as'],'attributes':_0x46558f[_0xbafb('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbafb('0xf')](function(_0x2ff249){logger[_0xbafb('0x17')](_0xbafb('0x1a'),_0x52bd2e);logger[_0xbafb('0x24')](_0xbafb('0x1a'),_0x52bd2e,JSON[_0xbafb('0x13')](_0x2ff249));_0x30a47b(_0x2ff249);})[_0xbafb('0x19')](function(_0x342241){logger[_0xbafb('0x14')]('ShowSmsAccount',_0x342241[_0xbafb('0x16')],_0x52bd2e);_0x37ed9e(_0x45160e[_0xbafb('0x14')](0x1f4,_0x342241[_0xbafb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 149cd1f..8d3687e 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 19056d9..b41534e 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25383a,_0xd9b3c5){var _0x25fdb1=function(_0x343ca3){while(--_0x343ca3){_0x25383a['push'](_0x25383a['shift']());}};_0x25fdb1(++_0xd9b3c5);}(_0x34e8,0x12c));var _0x834e=function(_0x5b6913,_0xfec9e3){_0x5b6913=_0x5b6913-0x0;var _0xbd0690=_0x34e8[_0x5b6913];return _0xbd0690;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b14cb,_0xce9a95){var _0x39ddbc=function(_0x1630a6){while(--_0x1630a6){_0x4b14cb['push'](_0x4b14cb['shift']());}};_0x39ddbc(++_0xce9a95);}(_0x34e8,0x12c));var _0x834e=function(_0x26c6a1,_0x2c0172){_0x26c6a1=_0x26c6a1-0x0;var _0x2ef996=_0x34e8[_0x26c6a1];return _0x2ef996;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f0df739..6923a7d 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 _0xb6a4=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xb6a4,0x138));var _0x4b6a=function(_0x491ec7,_0x3ddaaa){_0x491ec7=_0x491ec7-0x0;var _0x24ee9d=_0xb6a4[_0x491ec7];return _0x24ee9d;};'use strict';var Sequelize=require(_0x4b6a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4b6a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4b6a('0x2')],'allowNull':![],'defaultValue':_0x4b6a('0x3')},'appdata':{'type':Sequelize[_0x4b6a('0x4')]()},'description':{'type':Sequelize[_0x4b6a('0x2')]},'interval':{'type':Sequelize[_0x4b6a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x8e73=['TEXT','*,*,*,*','STRING','noop'];(function(_0xd097a7,_0x4e81b4){var _0x411b55=function(_0x3088e6){while(--_0x3088e6){_0xd097a7['push'](_0xd097a7['shift']());}};_0x411b55(++_0x4e81b4);}(_0x8e73,0xb6));var _0x38e7=function(_0x2fb06b,_0x5b7164){_0x2fb06b=_0x2fb06b-0x0;var _0xdc88b4=_0x8e73[_0x2fb06b];return _0xdc88b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x38e7('0x0')],'allowNull':![],'defaultValue':_0x38e7('0x1')},'appdata':{'type':Sequelize[_0x38e7('0x2')]()},'description':{'type':Sequelize[_0x38e7('0x0')]},'interval':{'type':Sequelize[_0x38e7('0x0')],'defaultValue':_0x38e7('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 3f8e679..a98bada 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 _0xac67=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','error','stack','name','SmsApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs'];(function(_0x266ffa,_0x1a7a03){var _0x2628ee=function(_0x4ce47e){while(--_0x4ce47e){_0x266ffa['push'](_0x266ffa['shift']());}};_0x2628ee(++_0x1a7a03);}(_0xac67,0x16c));var _0x7ac6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xac67[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x7ac6('0x0'));var rimraf=require(_0x7ac6('0x1'));var zipdir=require(_0x7ac6('0x2'));var jsonpatch=require(_0x7ac6('0x3'));var rp=require(_0x7ac6('0x4'));var moment=require(_0x7ac6('0x5'));var BPromise=require(_0x7ac6('0x6'));var Mustache=require(_0x7ac6('0x7'));var util=require(_0x7ac6('0x8'));var path=require(_0x7ac6('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7ac6('0xa'));var fs=require('fs');var fs_extra=require(_0x7ac6('0xb'));var _=require(_0x7ac6('0xc'));var squel=require(_0x7ac6('0xd'));var crypto=require('crypto');var jsforce=require(_0x7ac6('0xe'));var deskjs=require(_0x7ac6('0xf'));var toCsv=require(_0x7ac6('0x10'));var querystring=require(_0x7ac6('0x11'));var Papa=require(_0x7ac6('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7ac6('0x13'));var as=require(_0x7ac6('0x14'));var hardwareService=require(_0x7ac6('0x15'));var logger=require(_0x7ac6('0x16'))(_0x7ac6('0x17'));var utils=require(_0x7ac6('0x18'));var config=require(_0x7ac6('0x19'));var licenseUtil=require(_0x7ac6('0x1a'));var db=require(_0x7ac6('0x1b'))['db'];function respondWithStatusCode(_0x4a8d9d,_0x464e10){_0x464e10=_0x464e10||0xcc;return function(_0x1d34ac){if(_0x1d34ac){return _0x4a8d9d[_0x7ac6('0x1c')](_0x464e10);}return _0x4a8d9d[_0x7ac6('0x1d')](_0x464e10)[_0x7ac6('0x1e')]();};}function respondWithResult(_0x409dc3,_0x59b102){_0x59b102=_0x59b102||0xc8;return function(_0x5da1f3){if(_0x5da1f3){return _0x409dc3[_0x7ac6('0x1d')](_0x59b102)[_0x7ac6('0x1f')](_0x5da1f3);}};}function respondWithFilteredResult(_0x36ccfa,_0x327f43){return function(_0x22a3bd){if(_0x22a3bd){var _0x53d362=typeof _0x327f43[_0x7ac6('0x20')]==='undefined'&&typeof _0x327f43[_0x7ac6('0x21')]===_0x7ac6('0x22');var _0x275891=_0x22a3bd[_0x7ac6('0x23')];var _0x3b2807=_0x53d362?0x0:_0x327f43[_0x7ac6('0x20')];var _0x233dcf=_0x53d362?_0x22a3bd[_0x7ac6('0x23')]:_0x327f43[_0x7ac6('0x20')]+_0x327f43['limit'];var _0x28864e;if(_0x233dcf>=_0x275891){_0x233dcf=_0x275891;_0x28864e=0xc8;}else{_0x28864e=0xce;}_0x36ccfa[_0x7ac6('0x1d')](_0x28864e);return _0x36ccfa[_0x7ac6('0x24')](_0x7ac6('0x25'),_0x3b2807+'-'+_0x233dcf+'/'+_0x275891)['json'](_0x22a3bd);}return null;};}function patchUpdates(_0x52a01b){return function(_0x2d4e22){try{jsonpatch['apply'](_0x2d4e22,_0x52a01b,!![]);}catch(_0x3b8743){return BPromise[_0x7ac6('0x26')](_0x3b8743);}return _0x2d4e22[_0x7ac6('0x27')]();};}function saveUpdates(_0x501959,_0x24f87b){return function(_0x52a525){if(_0x52a525){return _0x52a525[_0x7ac6('0x28')](_0x501959)[_0x7ac6('0x29')](function(_0x37fab6){return _0x37fab6;});}return null;};}function removeEntity(_0x4aac86,_0x224399){return function(_0x2efd20){if(_0x2efd20){return _0x2efd20['destroy']()['then'](function(){_0x4aac86[_0x7ac6('0x1d')](0xcc)[_0x7ac6('0x1e')]();});}};}function handleEntityNotFound(_0x53a12f,_0x17e937){return function(_0x28512c){if(!_0x28512c){_0x53a12f[_0x7ac6('0x1c')](0x194);}return _0x28512c;};}function handleError(_0x5d385d,_0x2e6ed2){_0x2e6ed2=_0x2e6ed2||0x1f4;return function(_0x3adcea){logger[_0x7ac6('0x2a')](_0x3adcea[_0x7ac6('0x2b')]);if(_0x3adcea['name']){delete _0x3adcea[_0x7ac6('0x2c')];}_0x5d385d['status'](_0x2e6ed2)['send'](_0x3adcea);};}exports['index']=function(_0x24772c,_0x55bbb9){var _0x3f972d={},_0x1d9ba9={},_0x5b2c51={'count':0x0,'rows':[]};var _0x4a785b=_['map'](db[_0x7ac6('0x2d')]['rawAttributes'],function(_0xd836c2){return{'name':_0xd836c2[_0x7ac6('0x2e')],'type':_0xd836c2[_0x7ac6('0x2f')][_0x7ac6('0x30')]};});_0x1d9ba9[_0x7ac6('0x31')]=_[_0x7ac6('0x32')](_0x4a785b,'name');_0x1d9ba9[_0x7ac6('0x33')]=_[_0x7ac6('0x34')](_0x24772c['query']);_0x1d9ba9[_0x7ac6('0x35')]=_[_0x7ac6('0x36')](_0x1d9ba9[_0x7ac6('0x31')],_0x1d9ba9['query']);_0x3f972d[_0x7ac6('0x37')]=_[_0x7ac6('0x36')](_0x1d9ba9['model'],qs[_0x7ac6('0x38')](_0x24772c[_0x7ac6('0x33')]['fields']));_0x3f972d['attributes']=_0x3f972d[_0x7ac6('0x37')][_0x7ac6('0x39')]?_0x3f972d[_0x7ac6('0x37')]:_0x1d9ba9['model'];if(!_0x24772c[_0x7ac6('0x33')]['hasOwnProperty']('nolimit')){_0x3f972d[_0x7ac6('0x21')]=qs[_0x7ac6('0x21')](_0x24772c['query'][_0x7ac6('0x21')]);_0x3f972d['offset']=qs[_0x7ac6('0x20')](_0x24772c['query'][_0x7ac6('0x20')]);}_0x3f972d[_0x7ac6('0x3a')]=qs[_0x7ac6('0x3b')](_0x24772c[_0x7ac6('0x33')][_0x7ac6('0x3b')]);_0x3f972d[_0x7ac6('0x3c')]=qs[_0x7ac6('0x35')](_[_0x7ac6('0x3d')](_0x24772c[_0x7ac6('0x33')],_0x1d9ba9[_0x7ac6('0x35')]),_0x4a785b);if(_0x24772c['query'][_0x7ac6('0x3e')]){_0x3f972d['where']=_[_0x7ac6('0x3f')](_0x3f972d[_0x7ac6('0x3c')],{'$or':_[_0x7ac6('0x32')](_0x4a785b,function(_0x24eeb0){if(_0x24eeb0[_0x7ac6('0x2f')]!==_0x7ac6('0x40')){var _0x502f32={};_0x502f32[_0x24eeb0[_0x7ac6('0x2c')]]={'$like':'%'+_0x24772c['query'][_0x7ac6('0x3e')]+'%'};return _0x502f32;}})});}_0x3f972d=_[_0x7ac6('0x3f')]({},_0x3f972d,_0x24772c['options']);var _0x5e9121={'where':_0x3f972d[_0x7ac6('0x3c')]};return db[_0x7ac6('0x2d')][_0x7ac6('0x23')](_0x5e9121)[_0x7ac6('0x29')](function(_0x90220a){_0x5b2c51[_0x7ac6('0x23')]=_0x90220a;if(_0x24772c[_0x7ac6('0x33')][_0x7ac6('0x41')]){_0x3f972d[_0x7ac6('0x42')]=[{'all':!![]}];}return db[_0x7ac6('0x2d')][_0x7ac6('0x43')](_0x3f972d);})[_0x7ac6('0x29')](function(_0x533563){_0x5b2c51[_0x7ac6('0x44')]=_0x533563;return _0x5b2c51;})['then'](respondWithFilteredResult(_0x55bbb9,_0x3f972d))[_0x7ac6('0x45')](handleError(_0x55bbb9,null));};exports[_0x7ac6('0x46')]=function(_0x12a4c1,_0x1ccb8c){var _0x4e00ce={'raw':!![],'where':{'id':_0x12a4c1[_0x7ac6('0x47')]['id']}},_0x5e10c2={};_0x5e10c2[_0x7ac6('0x31')]=_['keys'](db[_0x7ac6('0x2d')][_0x7ac6('0x48')]);_0x5e10c2[_0x7ac6('0x33')]=_[_0x7ac6('0x34')](_0x12a4c1[_0x7ac6('0x33')]);_0x5e10c2['filters']=_[_0x7ac6('0x36')](_0x5e10c2[_0x7ac6('0x31')],_0x5e10c2['query']);_0x4e00ce[_0x7ac6('0x37')]=_['intersection'](_0x5e10c2[_0x7ac6('0x31')],qs[_0x7ac6('0x38')](_0x12a4c1['query'][_0x7ac6('0x38')]));_0x4e00ce[_0x7ac6('0x37')]=_0x4e00ce[_0x7ac6('0x37')]['length']?_0x4e00ce[_0x7ac6('0x37')]:_0x5e10c2[_0x7ac6('0x31')];if(_0x12a4c1['query']['includeAll']){_0x4e00ce[_0x7ac6('0x42')]=[{'all':!![]}];}_0x4e00ce=_['merge']({},_0x4e00ce,_0x12a4c1['options']);return db[_0x7ac6('0x2d')]['find'](_0x4e00ce)['then'](handleEntityNotFound(_0x1ccb8c,null))['then'](respondWithResult(_0x1ccb8c,null))[_0x7ac6('0x45')](handleError(_0x1ccb8c,null));};exports['create']=function(_0x1208a0,_0x2efd6a){return db[_0x7ac6('0x2d')]['create'](_0x1208a0[_0x7ac6('0x49')],{})[_0x7ac6('0x29')](respondWithResult(_0x2efd6a,0xc9))[_0x7ac6('0x45')](handleError(_0x2efd6a,null));};exports[_0x7ac6('0x28')]=function(_0x408d66,_0x5dd42a){if(_0x408d66[_0x7ac6('0x49')]['id']){delete _0x408d66[_0x7ac6('0x49')]['id'];}return db[_0x7ac6('0x2d')]['find']({'where':{'id':_0x408d66[_0x7ac6('0x47')]['id']}})[_0x7ac6('0x29')](handleEntityNotFound(_0x5dd42a,null))['then'](saveUpdates(_0x408d66[_0x7ac6('0x49')],null))[_0x7ac6('0x29')](respondWithResult(_0x5dd42a,null))[_0x7ac6('0x45')](handleError(_0x5dd42a,null));};exports['destroy']=function(_0x547542,_0x1c151a){return db[_0x7ac6('0x2d')][_0x7ac6('0x4a')]({'where':{'id':_0x547542[_0x7ac6('0x47')]['id']}})[_0x7ac6('0x29')](handleEntityNotFound(_0x1c151a,null))[_0x7ac6('0x29')](removeEntity(_0x1c151a,null))['catch'](handleError(_0x1c151a,null));}; \ No newline at end of file +var _0x805e=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','json','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SmsApplication','include','findAll','rows','catch','show','params','length','find','create','body','zip-dir','fast-json-patch'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x805e,0xcd));var _0xe805=function(_0x3ab862,_0x584207){_0x3ab862=_0x3ab862-0x0;var _0xfd3898=_0x805e[_0x3ab862];return _0xfd3898;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe805('0x0'));var jsonpatch=require(_0xe805('0x1'));var rp=require('request-promise');var moment=require(_0xe805('0x2'));var BPromise=require(_0xe805('0x3'));var Mustache=require(_0xe805('0x4'));var util=require(_0xe805('0x5'));var path=require(_0xe805('0x6'));var sox=require(_0xe805('0x7'));var csv=require(_0xe805('0x8'));var ejs=require(_0xe805('0x9'));var fs=require('fs');var fs_extra=require(_0xe805('0xa'));var _=require(_0xe805('0xb'));var squel=require(_0xe805('0xc'));var crypto=require(_0xe805('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe805('0xe'));var toCsv=require(_0xe805('0x8'));var querystring=require('querystring');var Papa=require(_0xe805('0xf'));var Redis=require(_0xe805('0x10'));var authService=require(_0xe805('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe805('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe805('0x13'));var utils=require(_0xe805('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe805('0x15'));var db=require(_0xe805('0x16'))['db'];function respondWithStatusCode(_0x502ace,_0x4f60ef){_0x4f60ef=_0x4f60ef||0xcc;return function(_0x43b317){if(_0x43b317){return _0x502ace[_0xe805('0x17')](_0x4f60ef);}return _0x502ace[_0xe805('0x18')](_0x4f60ef)[_0xe805('0x19')]();};}function respondWithResult(_0x61f0a1,_0x314cb3){_0x314cb3=_0x314cb3||0xc8;return function(_0x7601ca){if(_0x7601ca){return _0x61f0a1['status'](_0x314cb3)['json'](_0x7601ca);}};}function respondWithFilteredResult(_0x53e1aa,_0x4b1da5){return function(_0x36dac2){if(_0x36dac2){var _0x2827b4=typeof _0x4b1da5[_0xe805('0x1a')]===_0xe805('0x1b')&&typeof _0x4b1da5[_0xe805('0x1c')]==='undefined';var _0x1bd100=_0x36dac2['count'];var _0x585313=_0x2827b4?0x0:_0x4b1da5[_0xe805('0x1a')];var _0x568535=_0x2827b4?_0x36dac2['count']:_0x4b1da5[_0xe805('0x1a')]+_0x4b1da5[_0xe805('0x1c')];var _0xe9f652;if(_0x568535>=_0x1bd100){_0x568535=_0x1bd100;_0xe9f652=0xc8;}else{_0xe9f652=0xce;}_0x53e1aa[_0xe805('0x18')](_0xe9f652);return _0x53e1aa['set']('Content-Range',_0x585313+'-'+_0x568535+'/'+_0x1bd100)[_0xe805('0x1d')](_0x36dac2);}return null;};}function patchUpdates(_0x434b63){return function(_0x39edb6){try{jsonpatch['apply'](_0x39edb6,_0x434b63,!![]);}catch(_0x53b1dd){return BPromise['reject'](_0x53b1dd);}return _0x39edb6[_0xe805('0x1e')]();};}function saveUpdates(_0x397b74,_0x177a8e){return function(_0x17bd91){if(_0x17bd91){return _0x17bd91[_0xe805('0x1f')](_0x397b74)[_0xe805('0x20')](function(_0x6147f3){return _0x6147f3;});}return null;};}function removeEntity(_0x59c27e,_0x425f6e){return function(_0x2bc50d){if(_0x2bc50d){return _0x2bc50d[_0xe805('0x21')]()[_0xe805('0x20')](function(){_0x59c27e[_0xe805('0x18')](0xcc)[_0xe805('0x19')]();});}};}function handleEntityNotFound(_0xc8478f,_0x9b3c4b){return function(_0x54bcb6){if(!_0x54bcb6){_0xc8478f[_0xe805('0x17')](0x194);}return _0x54bcb6;};}function handleError(_0x326b5e,_0x48103b){_0x48103b=_0x48103b||0x1f4;return function(_0x2eb517){logger[_0xe805('0x22')](_0x2eb517[_0xe805('0x23')]);if(_0x2eb517['name']){delete _0x2eb517[_0xe805('0x24')];}_0x326b5e['status'](_0x48103b)['send'](_0x2eb517);};}exports['index']=function(_0x10b953,_0x25ebf7){var _0x2b4a9c={},_0x4cd12a={},_0x259b58={'count':0x0,'rows':[]};var _0x41de4d=_[_0xe805('0x25')](db['SmsApplication'][_0xe805('0x26')],function(_0x4d8ab3){return{'name':_0x4d8ab3[_0xe805('0x27')],'type':_0x4d8ab3[_0xe805('0x28')][_0xe805('0x29')]};});_0x4cd12a[_0xe805('0x2a')]=_[_0xe805('0x25')](_0x41de4d,_0xe805('0x24'));_0x4cd12a[_0xe805('0x2b')]=_[_0xe805('0x2c')](_0x10b953[_0xe805('0x2b')]);_0x4cd12a[_0xe805('0x2d')]=_[_0xe805('0x2e')](_0x4cd12a[_0xe805('0x2a')],_0x4cd12a[_0xe805('0x2b')]);_0x2b4a9c[_0xe805('0x2f')]=_[_0xe805('0x2e')](_0x4cd12a[_0xe805('0x2a')],qs[_0xe805('0x30')](_0x10b953['query'][_0xe805('0x30')]));_0x2b4a9c[_0xe805('0x2f')]=_0x2b4a9c[_0xe805('0x2f')]['length']?_0x2b4a9c[_0xe805('0x2f')]:_0x4cd12a[_0xe805('0x2a')];if(!_0x10b953[_0xe805('0x2b')][_0xe805('0x31')](_0xe805('0x32'))){_0x2b4a9c[_0xe805('0x1c')]=qs[_0xe805('0x1c')](_0x10b953[_0xe805('0x2b')][_0xe805('0x1c')]);_0x2b4a9c[_0xe805('0x1a')]=qs[_0xe805('0x1a')](_0x10b953[_0xe805('0x2b')]['offset']);}_0x2b4a9c[_0xe805('0x33')]=qs['sort'](_0x10b953['query'][_0xe805('0x34')]);_0x2b4a9c[_0xe805('0x35')]=qs[_0xe805('0x2d')](_[_0xe805('0x36')](_0x10b953['query'],_0x4cd12a[_0xe805('0x2d')]),_0x41de4d);if(_0x10b953[_0xe805('0x2b')]['filter']){_0x2b4a9c[_0xe805('0x35')]=_[_0xe805('0x37')](_0x2b4a9c[_0xe805('0x35')],{'$or':_[_0xe805('0x25')](_0x41de4d,function(_0xa884b8){if(_0xa884b8[_0xe805('0x28')]!==_0xe805('0x38')){var _0x221247={};_0x221247[_0xa884b8['name']]={'$like':'%'+_0x10b953[_0xe805('0x2b')]['filter']+'%'};return _0x221247;}})});}_0x2b4a9c=_['merge']({},_0x2b4a9c,_0x10b953[_0xe805('0x39')]);var _0x58de3e={'where':_0x2b4a9c[_0xe805('0x35')]};return db[_0xe805('0x3a')]['count'](_0x58de3e)[_0xe805('0x20')](function(_0x77fdec){_0x259b58['count']=_0x77fdec;if(_0x10b953[_0xe805('0x2b')]['includeAll']){_0x2b4a9c[_0xe805('0x3b')]=[{'all':!![]}];}return db[_0xe805('0x3a')][_0xe805('0x3c')](_0x2b4a9c);})[_0xe805('0x20')](function(_0x1d86e6){_0x259b58[_0xe805('0x3d')]=_0x1d86e6;return _0x259b58;})[_0xe805('0x20')](respondWithFilteredResult(_0x25ebf7,_0x2b4a9c))[_0xe805('0x3e')](handleError(_0x25ebf7,null));};exports[_0xe805('0x3f')]=function(_0x1c2c77,_0x4988dc){var _0x1068b8={'raw':!![],'where':{'id':_0x1c2c77[_0xe805('0x40')]['id']}},_0x1a07f7={};_0x1a07f7[_0xe805('0x2a')]=_[_0xe805('0x2c')](db[_0xe805('0x3a')]['rawAttributes']);_0x1a07f7[_0xe805('0x2b')]=_[_0xe805('0x2c')](_0x1c2c77[_0xe805('0x2b')]);_0x1a07f7[_0xe805('0x2d')]=_['intersection'](_0x1a07f7[_0xe805('0x2a')],_0x1a07f7[_0xe805('0x2b')]);_0x1068b8[_0xe805('0x2f')]=_['intersection'](_0x1a07f7[_0xe805('0x2a')],qs[_0xe805('0x30')](_0x1c2c77['query'][_0xe805('0x30')]));_0x1068b8[_0xe805('0x2f')]=_0x1068b8[_0xe805('0x2f')][_0xe805('0x41')]?_0x1068b8['attributes']:_0x1a07f7[_0xe805('0x2a')];if(_0x1c2c77[_0xe805('0x2b')]['includeAll']){_0x1068b8[_0xe805('0x3b')]=[{'all':!![]}];}_0x1068b8=_[_0xe805('0x37')]({},_0x1068b8,_0x1c2c77[_0xe805('0x39')]);return db[_0xe805('0x3a')][_0xe805('0x42')](_0x1068b8)[_0xe805('0x20')](handleEntityNotFound(_0x4988dc,null))['then'](respondWithResult(_0x4988dc,null))['catch'](handleError(_0x4988dc,null));};exports[_0xe805('0x43')]=function(_0x27f690,_0x56d576){return db['SmsApplication'][_0xe805('0x43')](_0x27f690[_0xe805('0x44')],{})[_0xe805('0x20')](respondWithResult(_0x56d576,0xc9))['catch'](handleError(_0x56d576,null));};exports[_0xe805('0x1f')]=function(_0x4c3c9d,_0x25956b){if(_0x4c3c9d[_0xe805('0x44')]['id']){delete _0x4c3c9d['body']['id'];}return db[_0xe805('0x3a')][_0xe805('0x42')]({'where':{'id':_0x4c3c9d[_0xe805('0x40')]['id']}})[_0xe805('0x20')](handleEntityNotFound(_0x25956b,null))[_0xe805('0x20')](saveUpdates(_0x4c3c9d[_0xe805('0x44')],null))[_0xe805('0x20')](respondWithResult(_0x25956b,null))[_0xe805('0x3e')](handleError(_0x25956b,null));};exports[_0xe805('0x21')]=function(_0x6bafa2,_0x2cff48){return db[_0xe805('0x3a')][_0xe805('0x42')]({'where':{'id':_0x6bafa2[_0xe805('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cff48,null))['then'](removeEntity(_0x2cff48,null))[_0xe805('0x3e')](handleError(_0x2cff48,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 92eb895..3e401af 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 _0x2657=['SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x54bd5a,_0x5a3a87){var _0x268668=function(_0x414f7e){while(--_0x414f7e){_0x54bd5a['push'](_0x54bd5a['shift']());}};_0x268668(++_0x5a3a87);}(_0x2657,0x103));var _0x7265=function(_0xdfde42,_0x336d87){_0xdfde42=_0xdfde42-0x0;var _0x27247e=_0x2657[_0xdfde42];return _0x27247e;};'use strict';var _=require(_0x7265('0x0'));var util=require(_0x7265('0x1'));var logger=require(_0x7265('0x2'))(_0x7265('0x3'));var moment=require(_0x7265('0x4'));var BPromise=require(_0x7265('0x5'));var rp=require(_0x7265('0x6'));var fs=require('fs');var path=require(_0x7265('0x7'));var rimraf=require(_0x7265('0x8'));var config=require(_0x7265('0x9'));var attributes=require(_0x7265('0xa'));module[_0x7265('0xb')]=function(_0x322aca,_0x2adec5){return _0x322aca[_0x7265('0xc')](_0x7265('0xd'),attributes,{'tableName':_0x7265('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7265('0xf')});}; \ No newline at end of file +var _0xee8b=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird'];(function(_0x153157,_0x40d467){var _0x3a4899=function(_0x2b755e){while(--_0x2b755e){_0x153157['push'](_0x153157['shift']());}};_0x3a4899(++_0x40d467);}(_0xee8b,0x14c));var _0xbee8=function(_0x3cc23e,_0x5518d8){_0x3cc23e=_0x3cc23e-0x0;var _0x43eb86=_0xee8b[_0x3cc23e];return _0x43eb86;};'use strict';var _=require(_0xbee8('0x0'));var util=require(_0xbee8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbee8('0x2'));var BPromise=require(_0xbee8('0x3'));var rp=require(_0xbee8('0x4'));var fs=require('fs');var path=require(_0xbee8('0x5'));var rimraf=require(_0xbee8('0x6'));var config=require(_0xbee8('0x7'));var attributes=require(_0xbee8('0x8'));module['exports']=function(_0x31acd7,_0xc608ab){return _0x31acd7[_0xbee8('0x9')](_0xbee8('0xa'),attributes,{'tableName':_0xbee8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbee8('0xc'),'collate':_0xbee8('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 967af39..7a628a7 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 _0xcabe=['http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x3d8e73,_0x2bacac){var _0x2c3fdf=function(_0xae391b){while(--_0xae391b){_0x3d8e73['push'](_0x3d8e73['shift']());}};_0x2c3fdf(++_0x2bacac);}(_0xcabe,0x1ef));var _0xecab=function(_0x56f39b,_0x309e19){_0x56f39b=_0x56f39b-0x0;var _0xd8181e=_0xcabe[_0x56f39b];return _0xd8181e;};'use strict';var _=require(_0xecab('0x0'));var util=require('util');var moment=require(_0xecab('0x1'));var BPromise=require(_0xecab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecab('0x3'));var db=require(_0xecab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xecab('0x5'))(_0xecab('0x6'));var config=require(_0xecab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecab('0x8')][_0xecab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105562,_0xbfa4bf,_0x1ead3d){return new BPromise(function(_0x2bd7c7,_0x88f839){return client[_0xecab('0xa')](_0x105562,_0x1ead3d)[_0xecab('0xb')](function(_0x5f2db6){logger['info'](_0xecab('0xc'),_0xbfa4bf,_0xecab('0xd'));logger['debug'](_0xecab('0xe'),_0xbfa4bf,_0xecab('0xd'),JSON[_0xecab('0xf')](_0x5f2db6));if(_0x5f2db6[_0xecab('0x10')]){if(_0x5f2db6[_0xecab('0x10')][_0xecab('0x11')]===0x1f4){logger['error'](_0xecab('0xc'),_0xbfa4bf,_0x5f2db6[_0xecab('0x10')][_0xecab('0x12')]);return _0x88f839(_0x5f2db6[_0xecab('0x10')][_0xecab('0x12')]);}logger[_0xecab('0x10')]('SmsApplication,\x20%s,\x20%s',_0xbfa4bf,_0x5f2db6[_0xecab('0x10')]['message']);return _0x2bd7c7(_0x5f2db6['error'][_0xecab('0x12')]);}else{logger[_0xecab('0x13')](_0xecab('0xc'),_0xbfa4bf,_0xecab('0xd'));_0x2bd7c7(_0x5f2db6['result'][_0xecab('0x12')]);}})[_0xecab('0x14')](function(_0x260a09){logger[_0xecab('0x10')](_0xecab('0xc'),_0xbfa4bf,_0x260a09);_0x88f839(_0x260a09);});});} \ No newline at end of file +var _0xa3e8=['SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info'];(function(_0x3bede6,_0x7f5cfb){var _0x30b8e9=function(_0x14d6e6){while(--_0x14d6e6){_0x3bede6['push'](_0x3bede6['shift']());}};_0x30b8e9(++_0x7f5cfb);}(_0xa3e8,0x127));var _0x8a3e=function(_0x41f92c,_0x57e922){_0x41f92c=_0x41f92c-0x0;var _0x2c3dbf=_0xa3e8[_0x41f92c];return _0x2c3dbf;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var moment=require(_0x8a3e('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a3e('0x3'));var fs=require('fs');var Redis=require(_0x8a3e('0x4'));var db=require(_0x8a3e('0x5'))['db'];var utils=require(_0x8a3e('0x6'));var logger=require(_0x8a3e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a3e('0x8')][_0x8a3e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2052a8,_0x5a2a25,_0x27f08d){return new BPromise(function(_0x4c7f41,_0x437cde){return client[_0x8a3e('0xa')](_0x2052a8,_0x27f08d)[_0x8a3e('0xb')](function(_0x402a96){logger[_0x8a3e('0xc')](_0x8a3e('0xd'),_0x5a2a25,_0x8a3e('0xe'));logger['debug'](_0x8a3e('0xf'),_0x5a2a25,_0x8a3e('0xe'),JSON[_0x8a3e('0x10')](_0x402a96));if(_0x402a96['error']){if(_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x12')]===0x1f4){logger[_0x8a3e('0x11')](_0x8a3e('0xd'),_0x5a2a25,_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x13')]);return _0x437cde(_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x13')]);}logger[_0x8a3e('0x11')](_0x8a3e('0xd'),_0x5a2a25,_0x402a96[_0x8a3e('0x11')][_0x8a3e('0x13')]);return _0x4c7f41(_0x402a96[_0x8a3e('0x11')]['message']);}else{logger[_0x8a3e('0xc')](_0x8a3e('0xd'),_0x5a2a25,_0x8a3e('0xe'));_0x4c7f41(_0x402a96[_0x8a3e('0x14')][_0x8a3e('0x13')]);}})[_0x8a3e('0x15')](function(_0x48e5a8){logger[_0x8a3e('0x11')]('SmsApplication,\x20%s,\x20%s',_0x5a2a25,_0x48e5a8);_0x437cde(_0x48e5a8);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 83f771c..b26942b 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 _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x5e82c7,_0x3a7e22){var _0x2d4225=function(_0x153bab){while(--_0x153bab){_0x5e82c7['push'](_0x5e82c7['shift']());}};_0x2d4225(++_0x3a7e22);}(_0x7708,0x188));var _0x8770=function(_0x39e164,_0x2cb93b){_0x39e164=_0x39e164-0x0;var _0x13fa6b=_0x7708[_0x39e164];return _0x13fa6b;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file +var _0xed3c=['sms','smsinteraction:addtags','addTags','put','tracked','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsInteraction.controller','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage'];(function(_0x3b875b,_0x4f648d){var _0x1ae967=function(_0x42633c){while(--_0x42633c){_0x3b875b['push'](_0x3b875b['shift']());}};_0x1ae967(++_0x4f648d);}(_0xed3c,0x1a6));var _0xced3=function(_0x56899b,_0x80fce){_0x56899b=_0x56899b-0x0;var _0x47d591=_0xed3c[_0x56899b];return _0x47d591;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var fs_extra=require(_0xced3('0x5'));var auth=require(_0xced3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xced3('0x7'));router[_0xced3('0x8')]('/',auth[_0xced3('0x9')](),controller[_0xced3('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xced3('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xced3('0xc')]);router[_0xced3('0x8')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0xe')]);router['get'](_0xced3('0xf'),auth[_0xced3('0x9')](),controller[_0xced3('0x10')]);router['post']('/',auth[_0xced3('0x9')](),controller[_0xced3('0x11')]);router[_0xced3('0x12')](_0xced3('0xd'),auth[_0xced3('0x9')](),controller[_0xced3('0x13')]);router[_0xced3('0x12')]('/:id/tags',auth[_0xced3('0x9')](),interaction['tracked'](_0xced3('0x14'),_0xced3('0x15')),controller[_0xced3('0x16')]);router[_0xced3('0x17')]('/:id',auth[_0xced3('0x9')](),interaction[_0xced3('0x18')]('sms',_0xced3('0x19')),controller[_0xced3('0x1a')]);router[_0xced3('0x1b')](_0xced3('0x1c'),auth['isAuthenticated'](),interaction[_0xced3('0x18')]('sms',_0xced3('0x1d')),controller[_0xced3('0x1e')]);router[_0xced3('0x1b')](_0xced3('0x1f'),auth[_0xced3('0x9')](),controller[_0xced3('0x20')]);module[_0xced3('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index cdfa503..b9123c3 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 _0x4677=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x5eb1a8,_0x30e664){var _0x14c11c=function(_0x5f2ea5){while(--_0x5f2ea5){_0x5eb1a8['push'](_0x5eb1a8['shift']());}};_0x14c11c(++_0x30e664);}(_0x4677,0x155));var _0x7467=function(_0x576032,_0x449487){_0x576032=_0x576032-0x0;var _0x35dd8a=_0x4677[_0x576032];return _0x35dd8a;};'use strict';var Sequelize=require(_0x7467('0x0'));var moment=require('moment');module[_0x7467('0x1')]={'closed':{'type':Sequelize[_0x7467('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7467('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7467('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7467('0x4')]},'note':{'type':Sequelize[_0x7467('0x4')]},'phone':{'type':Sequelize[_0x7467('0x4')]},'read1stAt':{'type':Sequelize[_0x7467('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7467('0x5')]('in',_0x7467('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7467('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7467('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6379=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x511b0b,_0x4c6ec4){var _0x115078=function(_0x45dfaf){while(--_0x45dfaf){_0x511b0b['push'](_0x511b0b['shift']());}};_0x115078(++_0x4c6ec4);}(_0x6379,0x84));var _0x9637=function(_0x68dc02,_0x587379){_0x68dc02=_0x68dc02-0x0;var _0x57524a=_0x6379[_0x68dc02];return _0x57524a;};'use strict';var Sequelize=require(_0x9637('0x0'));var moment=require(_0x9637('0x1'));module[_0x9637('0x2')]={'closed':{'type':Sequelize[_0x9637('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9637('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9637('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9637('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9637('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in',_0x9637('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9637('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 5e90ffc..2dc9852 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 _0x1050=['closedAt','disposition','out','System','value','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','sms','query','catch','show','keys','filters','intersection','model','fields','attributes','includeAll','merge','options','find','create','body','params','describe','SmsMessage','addMessage','ids','getMessages','findOne','length','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','Tag','color','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','fullname','push','CmContact','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','User','Owner','get','mkdirSync','Sms','N.A.','closed'];(function(_0x2200a4,_0x446b0d){var _0x52b861=function(_0xcabc63){while(--_0xcabc63){_0x2200a4['push'](_0x2200a4['shift']());}};_0x52b861(++_0x446b0d);}(_0x1050,0x1ef));var _0x0105=function(_0x58c95a,_0x994d2c){_0x58c95a=_0x58c95a-0x0;var _0x1f356a=_0x1050[_0x58c95a];return _0x1f356a;};'use strict';var rimraf=require(_0x0105('0x0'));var zipdir=require(_0x0105('0x1'));var moment=require(_0x0105('0x2'));var BPromise=require(_0x0105('0x3'));var util=require('util');var path=require(_0x0105('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0105('0x5'));var Redis=require(_0x0105('0x6'));var interaction=require(_0x0105('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x0105('0x8'))(_0x0105('0x9'));var config=require(_0x0105('0xa'));var db=require(_0x0105('0xb'))['db'];config[_0x0105('0xc')]=_[_0x0105('0xd')](config[_0x0105('0xc')],{'host':_0x0105('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0105('0xc')]));require('./smsInteraction.socket')[_0x0105('0xf')](socket);function respondWithStatusCode(_0x2df2fe,_0x3633e5){_0x3633e5=_0x3633e5||0xcc;return function(_0x3de825){if(_0x3de825){return _0x2df2fe[_0x0105('0x10')](_0x3633e5);}return _0x2df2fe[_0x0105('0x11')](_0x3633e5)[_0x0105('0x12')]();};}function respondWithResult(_0x5563f,_0x405902){_0x405902=_0x405902||0xc8;return function(_0x5b492f){if(_0x5b492f){return _0x5563f[_0x0105('0x11')](_0x405902)[_0x0105('0x13')](_0x5b492f);}};}function respondWithFilteredResult(_0x59607e,_0x2b0dcc){return function(_0x3be877){if(_0x3be877){var _0x2a80a7=typeof _0x2b0dcc[_0x0105('0x14')]===_0x0105('0x15')&&typeof _0x2b0dcc[_0x0105('0x16')]==='undefined';var _0x5e65d3=_0x3be877[_0x0105('0x17')];var _0x22e3aa=_0x2a80a7?0x0:_0x2b0dcc[_0x0105('0x14')];var _0x254f06=_0x2a80a7?_0x3be877['count']:_0x2b0dcc['offset']+_0x2b0dcc['limit'];var _0x27922d;if(_0x254f06>=_0x5e65d3){_0x254f06=_0x5e65d3;_0x27922d=0xc8;}else{_0x27922d=0xce;}_0x59607e[_0x0105('0x11')](_0x27922d);return _0x59607e[_0x0105('0x18')](_0x0105('0x19'),_0x22e3aa+'-'+_0x254f06+'/'+_0x5e65d3)[_0x0105('0x13')](_0x3be877);}return null;};}function saveUpdates(_0x22cceb){return function(_0x4f6e76){if(_0x4f6e76){return _0x4f6e76[_0x0105('0x1a')](_0x22cceb)[_0x0105('0x1b')](function(_0x46889e){return _0x46889e;});}return null;};}function removeEntity(_0x7b210f){return function(_0x1e4da2){if(_0x1e4da2){return _0x1e4da2[_0x0105('0x1c')]()[_0x0105('0x1b')](function(){_0x7b210f[_0x0105('0x11')](0xcc)[_0x0105('0x12')]();});}};}function handleEntityNotFound(_0x4e996e){return function(_0x453087){if(!_0x453087){_0x4e996e[_0x0105('0x10')](0x194);}return _0x453087;};}function handleError(_0x57762b,_0x43ae10){_0x43ae10=_0x43ae10||0x1f4;return function(_0x4e4e19){logger[_0x0105('0x1d')](_0x4e4e19[_0x0105('0x1e')]);if(_0x4e4e19[_0x0105('0x1f')]){delete _0x4e4e19['name'];}_0x57762b[_0x0105('0x11')](_0x43ae10)[_0x0105('0x20')](_0x4e4e19);};}exports[_0x0105('0x21')]=function(_0x285f16,_0x4dd041){var _0x1cef04={};var _0xab59cb=_[_0x0105('0x22')](db[_0x0105('0x23')][_0x0105('0x24')],function(_0x20f6fe){return{'name':_0x20f6fe['fieldName'],'type':_0x20f6fe['type']['key']};});_0x1cef04=qs['getOptions'](_0xab59cb,_0x285f16);return interaction['findAll'](_0x0105('0x25'),_0x285f16[_0x0105('0x26')],_0x285f16['user'],_0x1cef04,_0xab59cb)[_0x0105('0x1b')](respondWithFilteredResult(_0x4dd041,_0x1cef04))[_0x0105('0x27')](handleError(_0x4dd041,null));};exports[_0x0105('0x28')]=function(_0x42be53,_0x57bf7c){var _0x1569a9={'raw':![],'where':{'id':_0x42be53['params']['id']}},_0x3c2c7c={};_0x3c2c7c['model']=_['keys'](db[_0x0105('0x23')]['rawAttributes']);_0x3c2c7c['query']=_[_0x0105('0x29')](_0x42be53['query']);_0x3c2c7c[_0x0105('0x2a')]=_[_0x0105('0x2b')](_0x3c2c7c[_0x0105('0x2c')],_0x3c2c7c[_0x0105('0x26')]);_0x1569a9['attributes']=_[_0x0105('0x2b')](_0x3c2c7c[_0x0105('0x2c')],qs['fields'](_0x42be53[_0x0105('0x26')][_0x0105('0x2d')]));_0x1569a9['attributes']=_0x1569a9[_0x0105('0x2e')]['length']?_0x1569a9[_0x0105('0x2e')]:_0x3c2c7c[_0x0105('0x2c')];if(_0x42be53[_0x0105('0x26')][_0x0105('0x2f')]){_0x1569a9['include']=[{'all':!![]}];}_0x1569a9=_[_0x0105('0x30')]({},_0x1569a9,_0x42be53[_0x0105('0x31')]);return db[_0x0105('0x23')][_0x0105('0x32')](_0x1569a9)[_0x0105('0x1b')](handleEntityNotFound(_0x57bf7c,null))['then'](respondWithResult(_0x57bf7c,null))[_0x0105('0x27')](handleError(_0x57bf7c,null));};exports[_0x0105('0x33')]=function(_0x53fb04,_0x55785c){return db[_0x0105('0x23')][_0x0105('0x33')](_0x53fb04[_0x0105('0x34')],{})[_0x0105('0x1b')](respondWithResult(_0x55785c,0xc9))[_0x0105('0x27')](handleError(_0x55785c,null));};exports[_0x0105('0x1a')]=function(_0x59647c,_0x17d8a0){if(_0x59647c[_0x0105('0x34')]['id']){delete _0x59647c[_0x0105('0x34')]['id'];}return db[_0x0105('0x23')]['find']({'where':{'id':_0x59647c[_0x0105('0x35')]['id']}})[_0x0105('0x1b')](handleEntityNotFound(_0x17d8a0,null))[_0x0105('0x1b')](saveUpdates(_0x59647c[_0x0105('0x34')],null))[_0x0105('0x1b')](respondWithResult(_0x17d8a0,null))[_0x0105('0x27')](handleError(_0x17d8a0,null));};exports['destroy']=function(_0x3c696f,_0x270570){return db[_0x0105('0x23')][_0x0105('0x32')]({'where':{'id':_0x3c696f[_0x0105('0x35')]['id']}})[_0x0105('0x1b')](handleEntityNotFound(_0x270570,null))[_0x0105('0x1b')](removeEntity(_0x270570,null))[_0x0105('0x27')](handleError(_0x270570,null));};exports[_0x0105('0x36')]=function(_0x2e4100,_0x932662){return db[_0x0105('0x23')]['describe']()['then'](respondWithResult(_0x932662,null))[_0x0105('0x27')](handleError(_0x932662,null));};exports['addMessage']=function(_0x1b446d,_0x9b70f4){return db[_0x0105('0x37')][_0x0105('0x32')]({'where':{'id':_0x1b446d[_0x0105('0x35')]['id']}})[_0x0105('0x1b')](handleEntityNotFound(_0x9b70f4,null))[_0x0105('0x1b')](function(_0x33bff3){if(_0x33bff3){return _0x33bff3[_0x0105('0x38')](_0x1b446d[_0x0105('0x34')][_0x0105('0x39')],_['omit'](_0x1b446d[_0x0105('0x34')],['ids','id'])||{});}})['then'](respondWithResult(_0x9b70f4,null))[_0x0105('0x27')](handleError(_0x9b70f4,null));};exports[_0x0105('0x3a')]=function(_0x1f0cda,_0x70991b){var _0x313e89={'raw':![],'where':{}};var _0x1429ab={};var _0x1bdc04={'count':0x0,'rows':[]};return db[_0x0105('0x23')][_0x0105('0x3b')]({'where':{'id':_0x1f0cda[_0x0105('0x35')]['id']}})[_0x0105('0x1b')](handleEntityNotFound(_0x70991b,null))[_0x0105('0x1b')](function(_0x5abb77){if(_0x5abb77){_0x1429ab[_0x0105('0x2c')]=_['keys'](db[_0x0105('0x37')]['rawAttributes']);_0x1429ab[_0x0105('0x26')]=_[_0x0105('0x29')](_0x1f0cda['query']);_0x1429ab['filters']=_[_0x0105('0x2b')](_0x1429ab[_0x0105('0x2c')],_0x1429ab['query']);_0x313e89[_0x0105('0x2e')]=_['intersection'](_0x1429ab['model'],qs[_0x0105('0x2d')](_0x1f0cda['query'][_0x0105('0x2d')]));_0x313e89[_0x0105('0x2e')]=_0x313e89[_0x0105('0x2e')][_0x0105('0x3c')]?_0x313e89['attributes']:_0x1429ab[_0x0105('0x2c')];if(!_0x1f0cda[_0x0105('0x26')]['hasOwnProperty'](_0x0105('0x3d'))){_0x313e89[_0x0105('0x16')]=qs['limit'](_0x1f0cda[_0x0105('0x26')][_0x0105('0x16')]);_0x313e89[_0x0105('0x14')]=qs['offset'](_0x1f0cda[_0x0105('0x26')][_0x0105('0x14')]);}_0x313e89[_0x0105('0x3e')]=qs[_0x0105('0x3f')](_0x1f0cda[_0x0105('0x26')][_0x0105('0x3f')]);_0x313e89[_0x0105('0x40')]=qs[_0x0105('0x2a')](_[_0x0105('0x41')](_0x1f0cda[_0x0105('0x26')],_0x1429ab['filters']));_0x313e89[_0x0105('0x40')][_0x0105('0x42')]=_0x5abb77['id'];if(_0x1f0cda[_0x0105('0x26')]['filter']){_0x313e89[_0x0105('0x40')]=_[_0x0105('0x30')](_0x313e89[_0x0105('0x40')],{'$or':_['map'](_0x313e89[_0x0105('0x2e')],function(_0x6c3868){var _0x3f75b3={};_0x3f75b3[_0x6c3868]={'$like':'%'+_0x1f0cda[_0x0105('0x26')][_0x0105('0x43')]+'%'};return _0x3f75b3;})});}if(_0x1f0cda[_0x0105('0x26')][_0x0105('0x44')]){var _0x81d2ef=_0x1f0cda['query'][_0x0105('0x44')][_0x0105('0x45')](',');var _0x3b00d5={};_0x3b00d5[_0x81d2ef[0x0]]={'$gte':moment(_0x81d2ef[0x1])[_0x0105('0x46')](_0x0105('0x47'))};_0x313e89[_0x0105('0x40')]=_[_0x0105('0x30')](_0x313e89[_0x0105('0x40')],_0x3b00d5);}_0x313e89=_[_0x0105('0x30')]({},_0x313e89,_0x1f0cda[_0x0105('0x31')]);return db['SmsMessage'][_0x0105('0x17')]({'where':_0x313e89[_0x0105('0x40')]})[_0x0105('0x1b')](function(_0x23f8d9){_0x1bdc04[_0x0105('0x17')]=_0x23f8d9;if(_0x1f0cda[_0x0105('0x26')][_0x0105('0x2f')]){_0x313e89['include']=[{'all':!![]}];}return db[_0x0105('0x37')][_0x0105('0x48')](_0x313e89);})[_0x0105('0x1b')](function(_0x246aef){_0x1bdc04[_0x0105('0x49')]=_0x246aef;return _0x1bdc04;});}})[_0x0105('0x1b')](respondWithFilteredResult(_0x70991b,_0x313e89))[_0x0105('0x27')](handleError(_0x70991b,null));};exports[_0x0105('0x4a')]=function(_0x51ae66,_0x4ea18f){return db[_0x0105('0x23')][_0x0105('0x32')]({'where':{'id':_0x51ae66[_0x0105('0x35')]['id']}})[_0x0105('0x1b')](handleEntityNotFound(_0x4ea18f,null))[_0x0105('0x1b')](function(_0x279d7f){if(_0x279d7f){return _0x279d7f[_0x0105('0x4b')](_0x51ae66['body'][_0x0105('0x39')],_[_0x0105('0x4c')](_0x51ae66[_0x0105('0x34')],[_0x0105('0x39'),'id'])||{})[_0x0105('0x4d')](function(){return db[_0x0105('0x4e')]['findAll']({'attributes':['id',_0x0105('0x1f'),_0x0105('0x4f')],'where':{'id':_0x51ae66[_0x0105('0x34')][_0x0105('0x39')]}});})[_0x0105('0x1b')](function(_0x51f381){socket['emit']('smsInteractionTags:save',{'id':Number(_0x51ae66[_0x0105('0x35')]['id']),'tags':_0x51f381||[]});return{'id':Number(_0x51ae66[_0x0105('0x35')]['id']),'tags':_0x51f381||[]};});}})['then'](respondWithResult(_0x4ea18f,null))[_0x0105('0x27')](handleError(_0x4ea18f,null));};exports[_0x0105('0x50')]=function(_0x165af8,_0x1c91f9){return db['SmsInteraction'][_0x0105('0x32')]({'where':{'id':_0x165af8[_0x0105('0x35')]['id']}})['then'](handleEntityNotFound(_0x1c91f9,null))[_0x0105('0x1b')](function(_0x4b97e6){if(_0x4b97e6){return _0x4b97e6[_0x0105('0x50')](_0x165af8[_0x0105('0x26')][_0x0105('0x39')]);}})[_0x0105('0x1b')](respondWithStatusCode(_0x1c91f9,null))['catch'](handleError(_0x1c91f9,null));};exports[_0x0105('0x51')]=function(_0x105587,_0x4ff137){var _0xd12efd=moment()[_0x0105('0x52')]()[_0x0105('0x53')]();var _0x50cfcc=path[_0x0105('0x54')](config[_0x0105('0x55')],_0x0105('0x56'),_0x0105('0x57'),_0x0105('0x58'));var _0x15f9e0=path['join'](_0x50cfcc,_0xd12efd);var _0x5c4a66=util[_0x0105('0x46')](_0x0105('0x59'),_0x105587[_0x0105('0x35')]['id'],_0xd12efd);var _0xa4e245=path[_0x0105('0x54')](_0x50cfcc,_0x5c4a66);var _0x5c6643=[];_0x5c6643['push']({'model':db['User'],'as':'User','attributes':['id',_0x0105('0x5a')],'raw':!![]});_0x5c6643[_0x0105('0x5b')]({'model':db[_0x0105('0x5c')],'as':_0x0105('0x5d'),'attributes':['id',_0x0105('0x5e'),_0x0105('0x5f')],'raw':!![]});var _0x47337b=[{'model':db['SmsMessage'],'as':_0x0105('0x60'),'attributes':['id',_0x0105('0x34'),_0x0105('0x61'),_0x0105('0x62'),_0x0105('0x63'),_0x0105('0x64')],'include':_0x5c6643}];_0x47337b[_0x0105('0x5b')]({'model':db[_0x0105('0x65')],'as':_0x0105('0x66'),'attributes':['id','name']});_0x47337b[_0x0105('0x5b')]({'model':db[_0x0105('0x67')],'as':_0x0105('0x68'),'attributes':['id',_0x0105('0x5a')]});return db[_0x0105('0x23')][_0x0105('0x32')]({'where':{'id':_0x105587[_0x0105('0x35')]['id']},'include':_0x47337b})[_0x0105('0x1b')](handleEntityNotFound(_0x4ff137,null))[_0x0105('0x1b')](function(_0xef7728){if(_0xef7728){var _0x499e25=_0xef7728[_0x0105('0x69')]({'plain':!![]});fs[_0x0105('0x6a')](_0x15f9e0);var _0x4338a6={'channel':_0x0105('0x6b'),'account':_0x499e25['Account'][_0x0105('0x1f')],'agent':_0x499e25['Owner']?_0x499e25[_0x0105('0x68')]['fullname']:_0x0105('0x6c'),'createdAt':moment(_0x499e25[_0x0105('0x61')])[_0x0105('0x46')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0105('0x53')](),'closedAt':_0x499e25[_0x0105('0x6d')]?moment(_0x499e25[_0x0105('0x6e')])['format'](_0x0105('0x47'))['toString']():'','disposition':_0x499e25[_0x0105('0x6f')],'messages':_(_0x499e25[_0x0105('0x60')])['filter']({'secret':![]})[_0x0105('0x22')](function(_0x56b8af){return{'date':moment(_0x56b8af[_0x0105('0x61')])[_0x0105('0x46')](_0x0105('0x47'))[_0x0105('0x53')](),'sender':_0x56b8af['direction']===_0x0105('0x70')?_0x56b8af['User']?_0x56b8af[_0x0105('0x67')][_0x0105('0x5a')]:_0x0105('0x71'):_0x56b8af['Contact'][_0x0105('0x5e')]+(_0x56b8af['Contact'][_0x0105('0x5f')]?'\x20'+_0x56b8af['Contact']['lastName']:''),'body':_0x56b8af[_0x0105('0x34')],'direction':_0x56b8af[_0x0105('0x62')]===_0x0105('0x70')?'A':'C','secret':_0x56b8af[_0x0105('0x63')],'read':_0x56b8af['read']};})[_0x0105('0x72')]()};return ejs[_0x0105('0x73')](path[_0x0105('0x54')](config[_0x0105('0x55')],_0x0105('0x56'),'views','downloadInteraction.ejs'),{'interaction':_0x4338a6})[_0x0105('0x1b')](function(_0x1217df){var _0x33e346=path[_0x0105('0x54')](_0x15f9e0,_0x0105('0x74')+_0x499e25['id']+'-'+_0xd12efd+_0x0105('0x75'));var _0x4279bf={'path':_0x33e346,'channel':_0x0105('0x6b'),'interactionId':_0x499e25['id']};return pdf[_0x0105('0x76')](_0x1217df,_0x4279bf);})[_0x0105('0x1b')](function(){return new BPromise(function(_0x115b04,_0x5c6a0f){zipdir(_0x15f9e0,{'saveTo':_0xa4e245},function(_0x22ac8,_0x156618){if(_0x22ac8)return _0x5c6a0f(_0x22ac8);return _0x115b04(_0x156618);});})[_0x0105('0x1b')](function(){return new BPromise(function(_0x46a4cd,_0x11af51){rimraf(_0x15f9e0,function(_0x4110e3){if(_0x4110e3)_0x11af51(_0x4110e3);return _0x46a4cd();});});})[_0x0105('0x1b')](function(){return _0x4ff137[_0x0105('0x51')](_0xa4e245,_0x5c4a66,function(_0x1c5755){if(_0x1c5755){console['log'](_0x0105('0x77'),_0x1c5755);}else{fs[_0x0105('0x78')](_0xa4e245);}});});});}else{return _0x4ff137[_0x0105('0x10')](0xc8);}})['catch'](handleError(_0x4ff137,null));}; \ No newline at end of file +var _0xfc70=['ids','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Account','fullname','get','Sms','Owner','N.A.','toString','closedAt','firstName','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','log','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','map','SmsInteraction','key','getOptions','query','user','catch','model','keys','filters','intersection','attributes','fields','length','merge','options','find','create','body','destroy','params','describe','addMessage','SmsMessage','omit','getMessages','hasOwnProperty','order','sort','pick','SmsInteractionId','filter','where','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','setTags'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0xfc70,0x108));var _0x0fc7=function(_0x298367,_0x45012a){_0x298367=_0x298367-0x0;var _0x28d491=_0xfc70[_0x298367];return _0x28d491;};'use strict';var rimraf=require(_0x0fc7('0x0'));var zipdir=require(_0x0fc7('0x1'));var moment=require('moment');var BPromise=require(_0x0fc7('0x2'));var util=require(_0x0fc7('0x3'));var path=require(_0x0fc7('0x4'));var ejs=require(_0x0fc7('0x5'));var fs=require('fs');var _=require(_0x0fc7('0x6'));var Redis=require(_0x0fc7('0x7'));var interaction=require(_0x0fc7('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x0fc7('0x9'));var logger=require(_0x0fc7('0xa'))(_0x0fc7('0xb'));var config=require('../../config/environment');var db=require(_0x0fc7('0xc'))['db'];config['redis']=_[_0x0fc7('0xd')](config[_0x0fc7('0xe')],{'host':_0x0fc7('0xf'),'port':0x18eb});var socket=require(_0x0fc7('0x10'))(new Redis(config['redis']));require(_0x0fc7('0x11'))['register'](socket);function respondWithStatusCode(_0x441db8,_0x382465){_0x382465=_0x382465||0xcc;return function(_0xd569d9){if(_0xd569d9){return _0x441db8[_0x0fc7('0x12')](_0x382465);}return _0x441db8[_0x0fc7('0x13')](_0x382465)[_0x0fc7('0x14')]();};}function respondWithResult(_0x30a9c5,_0x1c2dd9){_0x1c2dd9=_0x1c2dd9||0xc8;return function(_0x147e0c){if(_0x147e0c){return _0x30a9c5[_0x0fc7('0x13')](_0x1c2dd9)[_0x0fc7('0x15')](_0x147e0c);}};}function respondWithFilteredResult(_0x57f233,_0x1e2309){return function(_0x38ca79){if(_0x38ca79){var _0x5dce66=typeof _0x1e2309[_0x0fc7('0x16')]==='undefined'&&typeof _0x1e2309[_0x0fc7('0x17')]===_0x0fc7('0x18');var _0x5bd6b1=_0x38ca79[_0x0fc7('0x19')];var _0x37f864=_0x5dce66?0x0:_0x1e2309[_0x0fc7('0x16')];var _0x35aeac=_0x5dce66?_0x38ca79[_0x0fc7('0x19')]:_0x1e2309['offset']+_0x1e2309[_0x0fc7('0x17')];var _0x3e7679;if(_0x35aeac>=_0x5bd6b1){_0x35aeac=_0x5bd6b1;_0x3e7679=0xc8;}else{_0x3e7679=0xce;}_0x57f233[_0x0fc7('0x13')](_0x3e7679);return _0x57f233[_0x0fc7('0x1a')](_0x0fc7('0x1b'),_0x37f864+'-'+_0x35aeac+'/'+_0x5bd6b1)[_0x0fc7('0x15')](_0x38ca79);}return null;};}function saveUpdates(_0x3fd244){return function(_0x267ebb){if(_0x267ebb){return _0x267ebb[_0x0fc7('0x1c')](_0x3fd244)[_0x0fc7('0x1d')](function(_0x3369bc){return _0x3369bc;});}return null;};}function removeEntity(_0x487744){return function(_0x21e476){if(_0x21e476){return _0x21e476['destroy']()[_0x0fc7('0x1d')](function(){_0x487744[_0x0fc7('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6254){return function(_0x129f27){if(!_0x129f27){_0x1e6254[_0x0fc7('0x12')](0x194);}return _0x129f27;};}function handleError(_0x49e016,_0x1728da){_0x1728da=_0x1728da||0x1f4;return function(_0x650ef2){logger[_0x0fc7('0x1e')](_0x650ef2[_0x0fc7('0x1f')]);if(_0x650ef2[_0x0fc7('0x20')]){delete _0x650ef2[_0x0fc7('0x20')];}_0x49e016[_0x0fc7('0x13')](_0x1728da)[_0x0fc7('0x21')](_0x650ef2);};}exports['index']=function(_0x11904d,_0x16fd66){var _0x4bbe40={};var _0x3084bc=_[_0x0fc7('0x22')](db[_0x0fc7('0x23')]['rawAttributes'],function(_0x47627c){return{'name':_0x47627c['fieldName'],'type':_0x47627c['type'][_0x0fc7('0x24')]};});_0x4bbe40=qs[_0x0fc7('0x25')](_0x3084bc,_0x11904d);return interaction['findAll']('sms',_0x11904d[_0x0fc7('0x26')],_0x11904d[_0x0fc7('0x27')],_0x4bbe40,_0x3084bc)['then'](respondWithFilteredResult(_0x16fd66,_0x4bbe40))[_0x0fc7('0x28')](handleError(_0x16fd66,null));};exports['show']=function(_0x1ae78f,_0x2b021f){var _0x48568c={'raw':![],'where':{'id':_0x1ae78f['params']['id']}},_0x355fb7={};_0x355fb7[_0x0fc7('0x29')]=_[_0x0fc7('0x2a')](db['SmsInteraction']['rawAttributes']);_0x355fb7[_0x0fc7('0x26')]=_[_0x0fc7('0x2a')](_0x1ae78f[_0x0fc7('0x26')]);_0x355fb7[_0x0fc7('0x2b')]=_[_0x0fc7('0x2c')](_0x355fb7[_0x0fc7('0x29')],_0x355fb7[_0x0fc7('0x26')]);_0x48568c[_0x0fc7('0x2d')]=_[_0x0fc7('0x2c')](_0x355fb7[_0x0fc7('0x29')],qs[_0x0fc7('0x2e')](_0x1ae78f[_0x0fc7('0x26')]['fields']));_0x48568c[_0x0fc7('0x2d')]=_0x48568c[_0x0fc7('0x2d')][_0x0fc7('0x2f')]?_0x48568c[_0x0fc7('0x2d')]:_0x355fb7[_0x0fc7('0x29')];if(_0x1ae78f[_0x0fc7('0x26')]['includeAll']){_0x48568c['include']=[{'all':!![]}];}_0x48568c=_[_0x0fc7('0x30')]({},_0x48568c,_0x1ae78f[_0x0fc7('0x31')]);return db['SmsInteraction'][_0x0fc7('0x32')](_0x48568c)[_0x0fc7('0x1d')](handleEntityNotFound(_0x2b021f,null))['then'](respondWithResult(_0x2b021f,null))['catch'](handleError(_0x2b021f,null));};exports[_0x0fc7('0x33')]=function(_0xc552aa,_0x45191b){return db['SmsInteraction']['create'](_0xc552aa[_0x0fc7('0x34')],{})[_0x0fc7('0x1d')](respondWithResult(_0x45191b,0xc9))['catch'](handleError(_0x45191b,null));};exports[_0x0fc7('0x1c')]=function(_0x43f8fa,_0x2e87de){if(_0x43f8fa[_0x0fc7('0x34')]['id']){delete _0x43f8fa[_0x0fc7('0x34')]['id'];}return db[_0x0fc7('0x23')][_0x0fc7('0x32')]({'where':{'id':_0x43f8fa['params']['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x2e87de,null))[_0x0fc7('0x1d')](saveUpdates(_0x43f8fa[_0x0fc7('0x34')],null))[_0x0fc7('0x1d')](respondWithResult(_0x2e87de,null))['catch'](handleError(_0x2e87de,null));};exports[_0x0fc7('0x35')]=function(_0x37af72,_0x59dc9e){return db['SmsInteraction'][_0x0fc7('0x32')]({'where':{'id':_0x37af72[_0x0fc7('0x36')]['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x59dc9e,null))[_0x0fc7('0x1d')](removeEntity(_0x59dc9e,null))['catch'](handleError(_0x59dc9e,null));};exports[_0x0fc7('0x37')]=function(_0x5ab747,_0x2026ca){return db[_0x0fc7('0x23')][_0x0fc7('0x37')]()[_0x0fc7('0x1d')](respondWithResult(_0x2026ca,null))[_0x0fc7('0x28')](handleError(_0x2026ca,null));};exports[_0x0fc7('0x38')]=function(_0x55956a,_0x3ea9c6){return db[_0x0fc7('0x39')][_0x0fc7('0x32')]({'where':{'id':_0x55956a[_0x0fc7('0x36')]['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x3ea9c6,null))[_0x0fc7('0x1d')](function(_0x341959){if(_0x341959){return _0x341959[_0x0fc7('0x38')](_0x55956a[_0x0fc7('0x34')]['ids'],_[_0x0fc7('0x3a')](_0x55956a[_0x0fc7('0x34')],['ids','id'])||{});}})[_0x0fc7('0x1d')](respondWithResult(_0x3ea9c6,null))['catch'](handleError(_0x3ea9c6,null));};exports[_0x0fc7('0x3b')]=function(_0x4197cf,_0x2d7f06){var _0x580792={'raw':![],'where':{}};var _0xf1e27c={};var _0x50c30a={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x4197cf['params']['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x2d7f06,null))['then'](function(_0x2bd964){if(_0x2bd964){_0xf1e27c['model']=_[_0x0fc7('0x2a')](db[_0x0fc7('0x39')]['rawAttributes']);_0xf1e27c[_0x0fc7('0x26')]=_['keys'](_0x4197cf[_0x0fc7('0x26')]);_0xf1e27c[_0x0fc7('0x2b')]=_['intersection'](_0xf1e27c['model'],_0xf1e27c[_0x0fc7('0x26')]);_0x580792[_0x0fc7('0x2d')]=_['intersection'](_0xf1e27c[_0x0fc7('0x29')],qs[_0x0fc7('0x2e')](_0x4197cf[_0x0fc7('0x26')]['fields']));_0x580792[_0x0fc7('0x2d')]=_0x580792[_0x0fc7('0x2d')][_0x0fc7('0x2f')]?_0x580792['attributes']:_0xf1e27c['model'];if(!_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x3c')]('nolimit')){_0x580792[_0x0fc7('0x17')]=qs[_0x0fc7('0x17')](_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x17')]);_0x580792[_0x0fc7('0x16')]=qs[_0x0fc7('0x16')](_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x16')]);}_0x580792[_0x0fc7('0x3d')]=qs[_0x0fc7('0x3e')](_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x3e')]);_0x580792['where']=qs[_0x0fc7('0x2b')](_[_0x0fc7('0x3f')](_0x4197cf[_0x0fc7('0x26')],_0xf1e27c['filters']));_0x580792['where'][_0x0fc7('0x40')]=_0x2bd964['id'];if(_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x41')]){_0x580792[_0x0fc7('0x42')]=_[_0x0fc7('0x30')](_0x580792[_0x0fc7('0x42')],{'$or':_[_0x0fc7('0x22')](_0x580792[_0x0fc7('0x2d')],function(_0x2b7a7a){var _0x397449={};_0x397449[_0x2b7a7a]={'$like':'%'+_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x41')]+'%'};return _0x397449;})});}if(_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x43')]){var _0xea7af9=_0x4197cf[_0x0fc7('0x26')][_0x0fc7('0x43')][_0x0fc7('0x44')](',');var _0x14afa6={};_0x14afa6[_0xea7af9[0x0]]={'$gte':moment(_0xea7af9[0x1])[_0x0fc7('0x45')](_0x0fc7('0x46'))};_0x580792['where']=_[_0x0fc7('0x30')](_0x580792[_0x0fc7('0x42')],_0x14afa6);}_0x580792=_['merge']({},_0x580792,_0x4197cf['options']);return db[_0x0fc7('0x39')][_0x0fc7('0x19')]({'where':_0x580792[_0x0fc7('0x42')]})[_0x0fc7('0x1d')](function(_0x559f4b){_0x50c30a[_0x0fc7('0x19')]=_0x559f4b;if(_0x4197cf['query'][_0x0fc7('0x47')]){_0x580792['include']=[{'all':!![]}];}return db[_0x0fc7('0x39')][_0x0fc7('0x48')](_0x580792);})[_0x0fc7('0x1d')](function(_0x38b4){_0x50c30a[_0x0fc7('0x49')]=_0x38b4;return _0x50c30a;});}})[_0x0fc7('0x1d')](respondWithFilteredResult(_0x2d7f06,_0x580792))[_0x0fc7('0x28')](handleError(_0x2d7f06,null));};exports['addTags']=function(_0x1bd147,_0x4f5faa){return db['SmsInteraction']['find']({'where':{'id':_0x1bd147[_0x0fc7('0x36')]['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x4f5faa,null))[_0x0fc7('0x1d')](function(_0x3dafd1){if(_0x3dafd1){return _0x3dafd1[_0x0fc7('0x4a')](_0x1bd147[_0x0fc7('0x34')][_0x0fc7('0x4b')],_[_0x0fc7('0x3a')](_0x1bd147['body'],[_0x0fc7('0x4b'),'id'])||{})[_0x0fc7('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x0fc7('0x4d')],'where':{'id':_0x1bd147[_0x0fc7('0x34')][_0x0fc7('0x4b')]}});})[_0x0fc7('0x1d')](function(_0x1cb169){socket[_0x0fc7('0x4e')](_0x0fc7('0x4f'),{'id':Number(_0x1bd147['params']['id']),'tags':_0x1cb169||[]});return{'id':Number(_0x1bd147['params']['id']),'tags':_0x1cb169||[]};});}})[_0x0fc7('0x1d')](respondWithResult(_0x4f5faa,null))['catch'](handleError(_0x4f5faa,null));};exports[_0x0fc7('0x50')]=function(_0x1fc4e4,_0x39fa40){return db[_0x0fc7('0x23')][_0x0fc7('0x32')]({'where':{'id':_0x1fc4e4['params']['id']}})[_0x0fc7('0x1d')](handleEntityNotFound(_0x39fa40,null))[_0x0fc7('0x1d')](function(_0x56b7cc){if(_0x56b7cc){return _0x56b7cc[_0x0fc7('0x50')](_0x1fc4e4['query'][_0x0fc7('0x4b')]);}})[_0x0fc7('0x1d')](respondWithStatusCode(_0x39fa40,null))[_0x0fc7('0x28')](handleError(_0x39fa40,null));};exports[_0x0fc7('0x51')]=function(_0x930d14,_0x26a020){var _0xe98305=moment()[_0x0fc7('0x52')]()['toString']();var _0x228f28=path[_0x0fc7('0x53')](config[_0x0fc7('0x54')],_0x0fc7('0x55'),_0x0fc7('0x56'),_0x0fc7('0x57'));var _0x611903=path['join'](_0x228f28,_0xe98305);var _0x258a75=util['format'](_0x0fc7('0x58'),_0x930d14[_0x0fc7('0x36')]['id'],_0xe98305);var _0x44290f=path['join'](_0x228f28,_0x258a75);var _0x199cf9=[];_0x199cf9[_0x0fc7('0x59')]({'model':db[_0x0fc7('0x5a')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x199cf9[_0x0fc7('0x59')]({'model':db['CmContact'],'as':_0x0fc7('0x5b'),'attributes':['id','firstName',_0x0fc7('0x5c')],'raw':!![]});var _0x162715=[{'model':db[_0x0fc7('0x39')],'as':_0x0fc7('0x5d'),'attributes':['id','body',_0x0fc7('0x5e'),'direction',_0x0fc7('0x5f'),_0x0fc7('0x60')],'include':_0x199cf9}];_0x162715[_0x0fc7('0x59')]({'model':db[_0x0fc7('0x61')],'as':_0x0fc7('0x62'),'attributes':['id',_0x0fc7('0x20')]});_0x162715[_0x0fc7('0x59')]({'model':db[_0x0fc7('0x5a')],'as':'Owner','attributes':['id',_0x0fc7('0x63')]});return db[_0x0fc7('0x23')][_0x0fc7('0x32')]({'where':{'id':_0x930d14['params']['id']},'include':_0x162715})['then'](handleEntityNotFound(_0x26a020,null))[_0x0fc7('0x1d')](function(_0x3c7371){if(_0x3c7371){var _0x4441fb=_0x3c7371[_0x0fc7('0x64')]({'plain':!![]});fs['mkdirSync'](_0x611903);var _0x484890={'channel':_0x0fc7('0x65'),'account':_0x4441fb[_0x0fc7('0x62')][_0x0fc7('0x20')],'agent':_0x4441fb[_0x0fc7('0x66')]?_0x4441fb[_0x0fc7('0x66')][_0x0fc7('0x63')]:_0x0fc7('0x67'),'createdAt':moment(_0x4441fb[_0x0fc7('0x5e')])['format'](_0x0fc7('0x46'))[_0x0fc7('0x68')](),'closedAt':_0x4441fb['closed']?moment(_0x4441fb[_0x0fc7('0x69')])[_0x0fc7('0x45')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4441fb['disposition'],'messages':_(_0x4441fb[_0x0fc7('0x5d')])['filter']({'secret':![]})[_0x0fc7('0x22')](function(_0x9ec55e){return{'date':moment(_0x9ec55e[_0x0fc7('0x5e')])[_0x0fc7('0x45')](_0x0fc7('0x46'))[_0x0fc7('0x68')](),'sender':_0x9ec55e['direction']==='out'?_0x9ec55e[_0x0fc7('0x5a')]?_0x9ec55e[_0x0fc7('0x5a')][_0x0fc7('0x63')]:'System':_0x9ec55e[_0x0fc7('0x5b')][_0x0fc7('0x6a')]+(_0x9ec55e[_0x0fc7('0x5b')][_0x0fc7('0x5c')]?'\x20'+_0x9ec55e[_0x0fc7('0x5b')]['lastName']:''),'body':_0x9ec55e[_0x0fc7('0x34')],'direction':_0x9ec55e[_0x0fc7('0x6b')]==='out'?'A':'C','secret':_0x9ec55e['secret'],'read':_0x9ec55e[_0x0fc7('0x60')]};})['value']()};return ejs[_0x0fc7('0x6c')](path[_0x0fc7('0x53')](config[_0x0fc7('0x54')],_0x0fc7('0x55'),'views',_0x0fc7('0x6d')),{'interaction':_0x484890})[_0x0fc7('0x1d')](function(_0x19e6b1){var _0x275e74=path['join'](_0x611903,_0x0fc7('0x6e')+_0x4441fb['id']+'-'+_0xe98305+_0x0fc7('0x6f'));var _0x1f312e={'path':_0x275e74,'channel':'Sms','interactionId':_0x4441fb['id']};return pdf['createPdfFromHTML'](_0x19e6b1,_0x1f312e);})[_0x0fc7('0x1d')](function(){return new BPromise(function(_0x2f29cc,_0x332d1b){zipdir(_0x611903,{'saveTo':_0x44290f},function(_0x353de6,_0x3949d3){if(_0x353de6)return _0x332d1b(_0x353de6);return _0x2f29cc(_0x3949d3);});})[_0x0fc7('0x1d')](function(){return new BPromise(function(_0x251f36,_0x3e9626){rimraf(_0x611903,function(_0x4d2a3e){if(_0x4d2a3e)_0x3e9626(_0x4d2a3e);return _0x251f36();});});})[_0x0fc7('0x1d')](function(){return _0x26a020[_0x0fc7('0x51')](_0x44290f,_0x258a75,function(_0x57abb3){if(_0x57abb3){console[_0x0fc7('0x70')]('err',_0x57abb3);}else{fs['unlinkSync'](_0x44290f);}});});});}else{return _0x26a020[_0x0fc7('0x12')](0xc8);}})[_0x0fc7('0x28')](handleError(_0x26a020,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 61758a5..7507d04 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 _0x7880=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','unreadMessages','length'];(function(_0x3778d4,_0x146db3){var _0x327fd8=function(_0x1af85e){while(--_0x1af85e){_0x3778d4['push'](_0x3778d4['shift']());}};_0x327fd8(++_0x146db3);}(_0x7880,0x1f4));var _0x0788=function(_0x2bee11,_0x21dcce){_0x2bee11=_0x2bee11-0x0;var _0x56670f=_0x7880[_0x2bee11];return _0x56670f;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x0788('0x0'))['db'][_0x0788('0x1')];var SmsMessage=require(_0x0788('0x0'))['db'][_0x0788('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x0788('0x3')](0x0);var events={'afterCreate':_0x0788('0x4'),'afterUpdate':'update','afterDestroy':_0x0788('0x5')};function emitEvent(_0x1e0814){return function(_0x317885,_0xd53e7d,_0x262f5c){_0x317885[_0x0788('0x6')]({'attributes':['id'],'raw':!![]})[_0x0788('0x7')](function(_0x44bbb5){_0x317885[_0x0788('0x8')](_0x0788('0x9'),_0x44bbb5['map'](function(_0x1497dd){return{'id':_0x1497dd['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x317885['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0788('0x7')](function(_0x53b2f2){_0x317885[_0x0788('0x8')](_0x0788('0xa'),_0x53b2f2[_0x0788('0xb')]);SmsInteractionEvents[_0x0788('0xc')](_0x1e0814+':'+_0x317885['id'],_0x317885);SmsInteractionEvents[_0x0788('0xc')](_0x1e0814,_0x317885);_0x262f5c(null);})['catch'](_0x262f5c(null));};}for(var e in events){if(events[_0x0788('0xd')](e)){var event=events[e];SmsInteraction[_0x0788('0xe')](e,emitEvent(event));}}module[_0x0788('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xc2c7=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then'];(function(_0x555155,_0xaa307a){var _0x1095f4=function(_0x47686e){while(--_0x47686e){_0x555155['push'](_0x555155['shift']());}};_0x1095f4(++_0xaa307a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x17f360,_0xf394d5){_0x17f360=_0x17f360-0x0;var _0x3df335=_0xc2c7[_0x17f360];return _0x3df335;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x1')];var SmsMessage=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7c2c('0x3')](0x0);var events={'afterCreate':_0x7c2c('0x4'),'afterUpdate':_0x7c2c('0x5'),'afterDestroy':_0x7c2c('0x6')};function emitEvent(_0x4bbc14){return function(_0x59f346,_0x31dc4e,_0x42ecc9){_0x59f346[_0x7c2c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4abe93){_0x59f346['setDataValue'](_0x7c2c('0x8'),_0x4abe93[_0x7c2c('0x9')](function(_0x3e668f){return{'id':_0x3e668f['id']};}));return SmsMessage[_0x7c2c('0xa')]({'where':{'SmsInteractionId':_0x59f346['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c2c('0xb')](function(_0x57b107){_0x59f346[_0x7c2c('0xc')](_0x7c2c('0xd'),_0x57b107[_0x7c2c('0xe')]);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14+':'+_0x59f346['id'],_0x59f346);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14,_0x59f346);_0x42ecc9(null);})[_0x7c2c('0x10')](_0x42ecc9(null));};}for(var e in events){if(events[_0x7c2c('0x11')](e)){var event=events[e];SmsInteraction[_0x7c2c('0x12')](e,emitEvent(event));}}module[_0x7c2c('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 39f3524..f97b66d 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 _0x240f=['rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x415153,_0x4314be){var _0x362d54=function(_0x3e2d80){while(--_0x3e2d80){_0x415153['push'](_0x415153['shift']());}};_0x362d54(++_0x4314be);}(_0x240f,0x72));var _0xf240=function(_0x48288c,_0x5e5e8c){_0x48288c=_0x48288c-0x0;var _0x153d17=_0x240f[_0x48288c];return _0x153d17;};'use strict';var _=require(_0xf240('0x0'));var util=require(_0xf240('0x1'));var logger=require(_0xf240('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf240('0x3'));var rp=require(_0xf240('0x4'));var fs=require('fs');var path=require(_0xf240('0x5'));var rimraf=require(_0xf240('0x6'));var config=require(_0xf240('0x7'));var attributes=require(_0xf240('0x8'));module[_0xf240('0x9')]=function(_0x172fc7,_0x2bf8b8){return _0x172fc7['define'](_0xf240('0xa'),attributes,{'tableName':_0xf240('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8cffc6,_0x1d32c5,_0x280bef){if(_0x8cffc6[_0xf240('0xc')]('closed')){_0x8cffc6['closedAt']=moment()[_0xf240('0xd')](_0xf240('0xe'));}_0x280bef(null,_0x8cffc6);}}});}; \ No newline at end of file +var _0xff02=['util','api','bluebird','request-promise','path','../../config/environment','define','SmsInteraction','sms_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2a0733,_0x290d2b){var _0x15dc3b=function(_0x5265){while(--_0x5265){_0x2a0733['push'](_0x2a0733['shift']());}};_0x15dc3b(++_0x290d2b);}(_0xff02,0x103));var _0x2ff0=function(_0x582513,_0xe38251){_0x582513=_0x582513-0x0;var _0x4ed247=_0xff02[_0x582513];return _0x4ed247;};'use strict';var _=require(_0x2ff0('0x0'));var util=require(_0x2ff0('0x1'));var logger=require('../../config/logger')(_0x2ff0('0x2'));var moment=require('moment');var BPromise=require(_0x2ff0('0x3'));var rp=require(_0x2ff0('0x4'));var fs=require('fs');var path=require(_0x2ff0('0x5'));var rimraf=require('rimraf');var config=require(_0x2ff0('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x29d77d,_0x30643c){return _0x29d77d[_0x2ff0('0x7')](_0x2ff0('0x8'),attributes,{'tableName':_0x2ff0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x172cf5,_0x578768,_0x2efbcd){if(_0x172cf5['changed']('closed')){_0x172cf5[_0x2ff0('0xa')]=moment()[_0x2ff0('0xb')](_0x2ff0('0xc'));}_0x2efbcd(null,_0x172cf5);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 86ab0b5..bd3823e 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 _0x22dd=['limit','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','ids','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','update','body','options','where'];(function(_0x11ce2f,_0x2bab8b){var _0x683942=function(_0x5bbac0){while(--_0x5bbac0){_0x11ce2f['push'](_0x11ce2f['shift']());}};_0x683942(++_0x2bab8b);}(_0x22dd,0x1b3));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd22d('0x0'));var moment=require(_0xd22d('0x1'));var BPromise=require(_0xd22d('0x2'));var rs=require(_0xd22d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd22d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd22d('0x5'))(_0xd22d('0x6'));var config=require(_0xd22d('0x7'));var jayson=require(_0xd22d('0x8'));var client=jayson[_0xd22d('0x9')][_0xd22d('0xa')]({'port':0x232a});config[_0xd22d('0xb')]=_[_0xd22d('0xc')](config[_0xd22d('0xb')],{'host':_0xd22d('0xd'),'port':0x18eb});var socket=require(_0xd22d('0xe'))(new Redis(config[_0xd22d('0xb')]));require(_0xd22d('0xf'))[_0xd22d('0x10')](socket);function respondWithRpcPromise(_0x16b68b,_0x6985ea,_0x555c39){return new BPromise(function(_0x33bec8,_0x48ecbe){return client[_0xd22d('0x11')](_0x16b68b,_0x555c39)[_0xd22d('0x12')](function(_0x15c1a7){logger[_0xd22d('0x13')](_0xd22d('0x14'),_0x6985ea,'request\x20sent');logger[_0xd22d('0x15')](_0xd22d('0x16'),_0x6985ea,_0xd22d('0x17'),JSON[_0xd22d('0x18')](_0x15c1a7));if(_0x15c1a7[_0xd22d('0x19')]){if(_0x15c1a7[_0xd22d('0x19')][_0xd22d('0x1a')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x6985ea,_0x15c1a7[_0xd22d('0x19')][_0xd22d('0x1b')]);return _0x48ecbe(_0x15c1a7[_0xd22d('0x19')][_0xd22d('0x1b')]);}logger[_0xd22d('0x19')](_0xd22d('0x14'),_0x6985ea,_0x15c1a7[_0xd22d('0x19')]['message']);return _0x33bec8(_0x15c1a7[_0xd22d('0x19')][_0xd22d('0x1b')]);}else{logger[_0xd22d('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x6985ea,'request\x20sent');_0x33bec8(_0x15c1a7[_0xd22d('0x1c')][_0xd22d('0x1b')]);}})['catch'](function(_0x2ca874){logger[_0xd22d('0x19')](_0xd22d('0x14'),_0x6985ea,_0x2ca874);_0x48ecbe(_0x2ca874);});});}exports['UpdateSmsInteraction']=function(_0x28f426){var _0x8fc350=this;return new Promise(function(_0x26140b,_0x4a4f8b){return db['SmsInteraction'][_0xd22d('0x1d')](_0x28f426[_0xd22d('0x1e')],{'raw':_0x28f426[_0xd22d('0x1f')]?_0x28f426['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28f426['options']?_0x28f426[_0xd22d('0x1f')][_0xd22d('0x20')]||null:null,'attributes':_0x28f426[_0xd22d('0x1f')]?_0x28f426[_0xd22d('0x1f')]['attributes']||null:null,'limit':_0x28f426[_0xd22d('0x1f')]?_0x28f426['options'][_0xd22d('0x21')]||null:null})[_0xd22d('0x12')](function(_0x477c87){logger[_0xd22d('0x13')](_0xd22d('0x22'),_0x28f426);logger[_0xd22d('0x15')](_0xd22d('0x22'),_0x28f426,JSON['stringify'](_0x477c87));_0x26140b(_0x477c87);})['catch'](function(_0x3aa339){logger[_0xd22d('0x19')]('UpdateSmsInteraction',_0x3aa339[_0xd22d('0x1b')],_0x28f426);_0x4a4f8b(_0x8fc350[_0xd22d('0x19')](0x1f4,_0x3aa339[_0xd22d('0x1b')]));});});};exports[_0xd22d('0x23')]=function(_0x3229a0){return new Promise(function(_0x31df97,_0x419926){return db[_0xd22d('0x24')]['find']({'where':_0x3229a0['options']?_0x3229a0[_0xd22d('0x1f')]['where']||null:null})[_0xd22d('0x12')](function(_0x42f1aa){if(_0x42f1aa){return _0x42f1aa['addTags'](_0x3229a0[_0xd22d('0x1e')]['ids'],_['omit'](_0x3229a0['body'],[_0xd22d('0x25'),'id'])||{});}})['spread'](function(_0x2a81ff){logger[_0xd22d('0x13')](_0xd22d('0x26'),_0x3229a0);logger['debug']('AddTags',_0x3229a0,JSON[_0xd22d('0x18')](_0x2a81ff));_0x31df97(_0x2a81ff);})['catch'](function(_0x1d50e0){logger[_0xd22d('0x19')](_0xd22d('0x26'),_0x1d50e0[_0xd22d('0x1b')],_0x3229a0);_0x419926(_this[_0xd22d('0x19')](0x1f4,_0x1d50e0['message']));});});}; \ No newline at end of file +var _0xb663=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','SmsInteraction','update','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring'];(function(_0x3afbdf,_0x9e463b){var _0x5b6861=function(_0x31d287){while(--_0x31d287){_0x3afbdf['push'](_0x3afbdf['shift']());}};_0x5b6861(++_0x9e463b);}(_0xb663,0x1dc));var _0x3b66=function(_0x18ebea,_0x4042f1){_0x18ebea=_0x18ebea-0x0;var _0x21bd52=_0xb663[_0x18ebea];return _0x21bd52;};'use strict';var _=require(_0x3b66('0x0'));var util=require('util');var moment=require(_0x3b66('0x1'));var BPromise=require(_0x3b66('0x2'));var rs=require(_0x3b66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b66('0x4'))['db'];var utils=require(_0x3b66('0x5'));var logger=require(_0x3b66('0x6'))(_0x3b66('0x7'));var config=require(_0x3b66('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3b66('0x9')]({'port':0x232a});config[_0x3b66('0xa')]=_[_0x3b66('0xb')](config[_0x3b66('0xa')],{'host':_0x3b66('0xc'),'port':0x18eb});var socket=require(_0x3b66('0xd'))(new Redis(config[_0x3b66('0xa')]));require('./smsInteraction.socket')[_0x3b66('0xe')](socket);function respondWithRpcPromise(_0x3d176a,_0x4da194,_0x1ba541){return new BPromise(function(_0x28c79f,_0x24e6e9){return client[_0x3b66('0xf')](_0x3d176a,_0x1ba541)[_0x3b66('0x10')](function(_0x24639b){logger[_0x3b66('0x11')](_0x3b66('0x12'),_0x4da194,_0x3b66('0x13'));logger[_0x3b66('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x4da194,'request\x20sent',JSON[_0x3b66('0x15')](_0x24639b));if(_0x24639b['error']){if(_0x24639b[_0x3b66('0x16')][_0x3b66('0x17')]===0x1f4){logger[_0x3b66('0x16')](_0x3b66('0x12'),_0x4da194,_0x24639b[_0x3b66('0x16')]['message']);return _0x24e6e9(_0x24639b[_0x3b66('0x16')]['message']);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x4da194,_0x24639b['error'][_0x3b66('0x18')]);return _0x28c79f(_0x24639b[_0x3b66('0x16')][_0x3b66('0x18')]);}else{logger['info'](_0x3b66('0x12'),_0x4da194,_0x3b66('0x13'));_0x28c79f(_0x24639b['result'][_0x3b66('0x18')]);}})[_0x3b66('0x19')](function(_0x28258e){logger[_0x3b66('0x16')](_0x3b66('0x12'),_0x4da194,_0x28258e);_0x24e6e9(_0x28258e);});});}exports['UpdateSmsInteraction']=function(_0x5a0488){var _0x54c75c=this;return new Promise(function(_0xcc333a,_0x37ccc8){return db[_0x3b66('0x1a')][_0x3b66('0x1b')](_0x5a0488['body'],{'raw':_0x5a0488[_0x3b66('0x1c')]?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0488['options']?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x1e')]||null:null,'attributes':_0x5a0488[_0x3b66('0x1c')]?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x1f')]||null:null,'limit':_0x5a0488[_0x3b66('0x1c')]?_0x5a0488[_0x3b66('0x1c')][_0x3b66('0x20')]||null:null})['then'](function(_0x431946){logger[_0x3b66('0x11')](_0x3b66('0x21'),_0x5a0488);logger[_0x3b66('0x14')](_0x3b66('0x21'),_0x5a0488,JSON[_0x3b66('0x15')](_0x431946));_0xcc333a(_0x431946);})[_0x3b66('0x19')](function(_0x23ad55){logger[_0x3b66('0x16')]('UpdateSmsInteraction',_0x23ad55['message'],_0x5a0488);_0x37ccc8(_0x54c75c[_0x3b66('0x16')](0x1f4,_0x23ad55[_0x3b66('0x18')]));});});};exports[_0x3b66('0x22')]=function(_0x5099d6){return new Promise(function(_0x5a8c16,_0x4f8491){return db[_0x3b66('0x1a')]['find']({'where':_0x5099d6['options']?_0x5099d6[_0x3b66('0x1c')][_0x3b66('0x1e')]||null:null})[_0x3b66('0x10')](function(_0x5e62fb){if(_0x5e62fb){return _0x5e62fb[_0x3b66('0x23')](_0x5099d6[_0x3b66('0x24')][_0x3b66('0x25')],_['omit'](_0x5099d6[_0x3b66('0x24')],['ids','id'])||{});}})[_0x3b66('0x26')](function(_0x143979){logger[_0x3b66('0x11')](_0x3b66('0x27'),_0x5099d6);logger[_0x3b66('0x14')](_0x3b66('0x27'),_0x5099d6,JSON[_0x3b66('0x15')](_0x143979));_0x5a8c16(_0x143979);})[_0x3b66('0x19')](function(_0x3a7d21){logger[_0x3b66('0x16')](_0x3b66('0x27'),_0x3a7d21[_0x3b66('0x18')],_0x5099d6);_0x4f8491(_this['error'](0x1f4,_0x3a7d21[_0x3b66('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 4e2f958..0356b79 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 _0x293f=['emit','removeListener','length','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x31ec29,_0x58915c){var _0x3275fc=function(_0x435075){while(--_0x435075){_0x31ec29['push'](_0x31ec29['shift']());}};_0x3275fc(++_0x58915c);}(_0x293f,0x164));var _0xf293=function(_0x2fbaaf,_0x184b3a){_0x2fbaaf=_0x2fbaaf-0x0;var _0x131997=_0x293f[_0x2fbaaf];return _0x131997;};'use strict';var SmsInteractionEvents=require(_0xf293('0x0'));var events=[_0xf293('0x1'),_0xf293('0x2'),_0xf293('0x3')];function createListener(_0xa81230,_0x6580ca){return function(_0x288932){_0x6580ca[_0xf293('0x4')](_0xa81230,_0x288932);};}function removeListener(_0x1cb82a,_0x2d0821){return function(){SmsInteractionEvents[_0xf293('0x5')](_0x1cb82a,_0x2d0821);};}exports['register']=function(_0x861adc){for(var _0x3d6327=0x0,_0x323a6b=events[_0xf293('0x6')];_0x3d6327<_0x323a6b;_0x3d6327++){var _0x1d3d87=events[_0x3d6327];var _0x2b37a0=createListener(_0xf293('0x7')+_0x1d3d87,_0x861adc);SmsInteractionEvents['on'](_0x1d3d87,_0x2b37a0);}}; \ No newline at end of file +var _0x8155=['emit','removeListener','register','length','./smsInteraction.events','save'];(function(_0x52b9d2,_0x4bb0a9){var _0x4c6570=function(_0xb9768e){while(--_0xb9768e){_0x52b9d2['push'](_0x52b9d2['shift']());}};_0x4c6570(++_0x4bb0a9);}(_0x8155,0x160));var _0x5815=function(_0x25df48,_0x2d1c65){_0x25df48=_0x25df48-0x0;var _0x3a1461=_0x8155[_0x25df48];return _0x3a1461;};'use strict';var SmsInteractionEvents=require(_0x5815('0x0'));var events=[_0x5815('0x1'),'remove','update'];function createListener(_0xbe04b4,_0x22e020){return function(_0x2dc242){_0x22e020[_0x5815('0x2')](_0xbe04b4,_0x2dc242);};}function removeListener(_0x1980f7,_0x8d6852){return function(){SmsInteractionEvents[_0x5815('0x3')](_0x1980f7,_0x8d6852);};}exports[_0x5815('0x4')]=function(_0x5789ed){for(var _0x4ce21e=0x0,_0x28962b=events[_0x5815('0x5')];_0x4ce21e<_0x28962b;_0x4ce21e++){var _0x3b8f6c=events[_0x4ce21e];var _0x5378be=createListener('smsInteraction:'+_0x3b8f6c,_0x5789ed);SmsInteractionEvents['on'](_0x3b8f6c,_0x5378be);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f94de1e..12a958e 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 _0xf4a0=['show','tracked','smsmessage:create','create','post','/:id/status','/:id','update','/:id/accept','accept','put','reject','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','/describe','describe','get'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xf4a0,0x1f2));var _0x0f4a=function(_0x10d43d,_0x1ae865){_0x10d43d=_0x10d43d-0x0;var _0x2101bc=_0xf4a0[_0x10d43d];return _0x2101bc;};'use strict';var multer=require(_0x0f4a('0x0'));var util=require(_0x0f4a('0x1'));var path=require(_0x0f4a('0x2'));var timeout=require(_0x0f4a('0x3'));var express=require(_0x0f4a('0x4'));var router=express[_0x0f4a('0x5')]();var fs_extra=require(_0x0f4a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0f4a('0x7'));var config=require(_0x0f4a('0x8'));var controller=require(_0x0f4a('0x9'));router['get']('/',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xb')]);router['get'](_0x0f4a('0xc'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xd')]);router[_0x0f4a('0xe')]('/:id',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0xf')]);router['post']('/',auth[_0x0f4a('0xa')](),interaction[_0x0f4a('0x10')]('sms',_0x0f4a('0x11')),controller[_0x0f4a('0x12')]);router[_0x0f4a('0x13')](_0x0f4a('0x14'),controller['status']);router['put'](_0x0f4a('0x15'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0x16')]);router['put'](_0x0f4a('0x17'),auth[_0x0f4a('0xa')](),controller[_0x0f4a('0x18')]);router[_0x0f4a('0x19')]('/:id/reject',auth[_0x0f4a('0xa')](),controller[_0x0f4a('0x1a')]);router['delete'](_0x0f4a('0x15'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf891=['tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/reject','multer','util','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x9c000,_0x320650){var _0x10b93b=function(_0x14b185){while(--_0x14b185){_0x9c000['push'](_0x9c000['shift']());}};_0x10b93b(++_0x320650);}(_0xf891,0x93));var _0x1f89=function(_0x1d4315,_0x57dee3){_0x1d4315=_0x1d4315-0x0;var _0xa9ccf2=_0xf891[_0x1d4315];return _0xa9ccf2;};'use strict';var multer=require(_0x1f89('0x0'));var util=require(_0x1f89('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1f89('0x2'));var router=express[_0x1f89('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f89('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f89('0x5'));var controller=require(_0x1f89('0x6'));router[_0x1f89('0x7')]('/',auth['isAuthenticated'](),controller[_0x1f89('0x8')]);router[_0x1f89('0x7')]('/describe',auth[_0x1f89('0x9')](),controller[_0x1f89('0xa')]);router[_0x1f89('0x7')](_0x1f89('0xb'),auth[_0x1f89('0x9')](),controller[_0x1f89('0xc')]);router[_0x1f89('0xd')]('/',auth['isAuthenticated'](),interaction[_0x1f89('0xe')](_0x1f89('0xf'),_0x1f89('0x10')),controller[_0x1f89('0x11')]);router[_0x1f89('0xd')](_0x1f89('0x12'),controller[_0x1f89('0x13')]);router[_0x1f89('0x14')]('/:id',auth[_0x1f89('0x9')](),controller[_0x1f89('0x15')]);router[_0x1f89('0x14')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1f89('0x14')](_0x1f89('0x16'),auth[_0x1f89('0x9')](),controller['reject']);router['delete'](_0x1f89('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index bbb4593..b2f7c4e 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 _0xbf2b=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf2b,0x103));var _0xbbf2=function(_0x24fde3,_0x1a2a0f){_0x24fde3=_0x24fde3-0x0;var _0x5b40d0=_0xbf2b[_0x24fde3];return _0x5b40d0;};'use strict';var Sequelize=require(_0xbbf2('0x0'));module[_0xbbf2('0x1')]={'body':{'type':Sequelize[_0xbbf2('0x2')](_0xbbf2('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbbf2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbbf2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xbbf2('0x6')]},'secret':{'type':Sequelize[_0xbbf2('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbbf2('0x7')]},'providerResponse':{'type':Sequelize[_0xbbf2('0x2')]}}; \ No newline at end of file +var _0x8a86=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','exports','medium'];(function(_0x250c9b,_0x4b8cc8){var _0xc09774=function(_0x5117d2){while(--_0x5117d2){_0x250c9b['push'](_0x250c9b['shift']());}};_0xc09774(++_0x4b8cc8);}(_0x8a86,0xd6));var _0x68a8=function(_0x2fd8ba,_0x4f9882){_0x2fd8ba=_0x2fd8ba-0x0;var _0x2ece64=_0x8a86[_0x2fd8ba];return _0x2ece64;};'use strict';var Sequelize=require('sequelize');module[_0x68a8('0x0')]={'body':{'type':Sequelize['TEXT'](_0x68a8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x68a8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x68a8('0x3')]('in',_0x68a8('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x68a8('0x5')](0xbe)},'phone':{'type':Sequelize[_0x68a8('0x5')]},'readAt':{'type':Sequelize[_0x68a8('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x68a8('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index d87b8e3..4667695 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 _0x86dc=['EventManager','acceptmessage','RejectMessage','rejectMessage','Sequelize','email','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','plivio','infobip','results','SmsAccount,\x20%s,\x20%s,\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','stack','name','send','index','SmsMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','format','SIP/%s','channel','event'];(function(_0x30522b,_0x44508e){var _0x553fa6=function(_0x1f57f9){while(--_0x1f57f9){_0x30522b['push'](_0x30522b['shift']());}};_0x553fa6(++_0x44508e);}(_0x86dc,0x13e));var _0xc86d=function(_0xb528e3,_0x2aae03){_0xb528e3=_0xb528e3-0x0;var _0x12462d=_0x86dc[_0xb528e3];return _0x12462d;};'use strict';var emlformat=require(_0xc86d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc86d('0x1'));var rp=require(_0xc86d('0x2'));var moment=require(_0xc86d('0x3'));var BPromise=require(_0xc86d('0x4'));var Mustache=require('mustache');var util=require(_0xc86d('0x5'));var path=require('path');var sox=require(_0xc86d('0x6'));var csv=require('to-csv');var ejs=require(_0xc86d('0x7'));var fs=require('fs');var fs_extra=require(_0xc86d('0x8'));var _=require(_0xc86d('0x9'));var squel=require('squel');var crypto=require(_0xc86d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc86d('0xb'));var toCsv=require(_0xc86d('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc86d('0xd'));var authService=require(_0xc86d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc86d('0xf'));var hardwareService=require(_0xc86d('0x10'));var logger=require(_0xc86d('0x11'))(_0xc86d('0x12'));var utils=require(_0xc86d('0x13'));var config=require(_0xc86d('0x14'));var licenseUtil=require(_0xc86d('0x15'));var db=require(_0xc86d('0x16'))['db'];config[_0xc86d('0x17')]=_[_0xc86d('0x18')](config[_0xc86d('0x17')],{'host':_0xc86d('0x19'),'port':0x18eb});var socket=require(_0xc86d('0x1a'))(new Redis(config[_0xc86d('0x17')]));require(_0xc86d('0x1b'))[_0xc86d('0x1c')](socket);var jayson=require(_0xc86d('0x1d'));var client=jayson[_0xc86d('0x1e')][_0xc86d('0x1f')]({'port':0x232c});var client9002=jayson[_0xc86d('0x1e')][_0xc86d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5e58aa,_0x4fb8e7,_0x49af1f,_0x3a253c){return new BPromise(function(_0x376a90,_0x17f576){var _0x2a9459=_0x3a253c||client;return _0x2a9459[_0xc86d('0x20')](_0x5e58aa,_0x49af1f)[_0xc86d('0x21')](function(_0x279406){logger['info']('SmsMessage,\x20%s,\x20%s',_0x4fb8e7,_0xc86d('0x22'));logger[_0xc86d('0x23')](_0xc86d('0x24'),_0x4fb8e7,'request\x20sent',JSON[_0xc86d('0x25')](_0x279406));if(_0x279406[_0xc86d('0x26')]){if(_0x279406[_0xc86d('0x26')]['code']===0x1f4){logger[_0xc86d('0x26')](_0xc86d('0x27'),_0x4fb8e7,_0x279406['error'][_0xc86d('0x28')]);return _0x17f576(_0x279406[_0xc86d('0x26')][_0xc86d('0x28')]);}logger[_0xc86d('0x26')]('SmsMessage,\x20%s,\x20%s',_0x4fb8e7,_0x279406[_0xc86d('0x26')][_0xc86d('0x28')]);return _0x376a90(_0x279406[_0xc86d('0x26')][_0xc86d('0x28')]);}else{logger[_0xc86d('0x29')]('SmsMessage,\x20%s,\x20%s',_0x4fb8e7,_0xc86d('0x22'));_0x376a90(_0x279406[_0xc86d('0x2a')][_0xc86d('0x28')]);}})[_0xc86d('0x2b')](function(_0x27d636){logger['error'](_0xc86d('0x27'),_0x4fb8e7,_0x27d636);_0x17f576(_0x27d636);});});}function respondWithStatusCode(_0x54303e,_0x4e1312){_0x4e1312=_0x4e1312||0xcc;return function(_0x533cce){if(_0x533cce){return _0x54303e[_0xc86d('0x2c')](_0x4e1312);}return _0x54303e[_0xc86d('0x2d')](_0x4e1312)[_0xc86d('0x2e')]();};}function respondWithResult(_0x1e29be,_0xd8b255){_0xd8b255=_0xd8b255||0xc8;return function(_0x1ad978){if(_0x1ad978){return _0x1e29be[_0xc86d('0x2d')](_0xd8b255)[_0xc86d('0x2f')](_0x1ad978);}};}function respondWithFilteredResult(_0x4db581,_0x397a55){return function(_0x2bce7b){if(_0x2bce7b){var _0x581a9e=typeof _0x397a55['offset']===_0xc86d('0x30')&&typeof _0x397a55[_0xc86d('0x31')]===_0xc86d('0x30');var _0x271b23=_0x2bce7b[_0xc86d('0x32')];var _0x217415=_0x581a9e?0x0:_0x397a55[_0xc86d('0x33')];var _0x5a4ef1=_0x581a9e?_0x2bce7b['count']:_0x397a55[_0xc86d('0x33')]+_0x397a55[_0xc86d('0x31')];var _0x18e468;if(_0x5a4ef1>=_0x271b23){_0x5a4ef1=_0x271b23;_0x18e468=0xc8;}else{_0x18e468=0xce;}_0x4db581[_0xc86d('0x2d')](_0x18e468);return _0x4db581[_0xc86d('0x34')]('Content-Range',_0x217415+'-'+_0x5a4ef1+'/'+_0x271b23)[_0xc86d('0x2f')](_0x2bce7b);}return null;};}function patchUpdates(_0x5ba241){return function(_0xc539d0){try{jsonpatch[_0xc86d('0x35')](_0xc539d0,_0x5ba241,!![]);}catch(_0x1f01f7){return BPromise[_0xc86d('0x36')](_0x1f01f7);}return _0xc539d0[_0xc86d('0x37')]();};}function saveUpdates(_0x1d7fe8,_0x119b54){return function(_0x100258){if(_0x100258){return _0x100258[_0xc86d('0x38')](_0x1d7fe8)['then'](function(_0x557a73){return _0x557a73;});}return null;};}function removeEntity(_0x52c552,_0x4ce856){return function(_0x50d014){if(_0x50d014){return _0x50d014['destroy']()[_0xc86d('0x21')](function(){_0x52c552[_0xc86d('0x2d')](0xcc)[_0xc86d('0x2e')]();});}};}function handleEntityNotFound(_0x118007,_0x2cba68){return function(_0x225a25){if(!_0x225a25){_0x118007['sendStatus'](0x194);}return _0x225a25;};}function handleError(_0x3b0940,_0x288c34){_0x288c34=_0x288c34||0x1f4;return function(_0x34cb84){logger[_0xc86d('0x26')](_0x34cb84[_0xc86d('0x39')]);if(_0x34cb84[_0xc86d('0x3a')]){delete _0x34cb84[_0xc86d('0x3a')];}_0x3b0940[_0xc86d('0x2d')](_0x288c34)[_0xc86d('0x3b')](_0x34cb84);};}exports[_0xc86d('0x3c')]=function(_0x5e4b08,_0x247560){var _0x5b2df9={},_0x10b90e={},_0x41b71c={'count':0x0,'rows':[]};var _0x3cf1c2=_['map'](db[_0xc86d('0x3d')][_0xc86d('0x3e')],function(_0x3202b8){return{'name':_0x3202b8['fieldName'],'type':_0x3202b8[_0xc86d('0x3f')][_0xc86d('0x40')]};});_0x10b90e[_0xc86d('0x41')]=_[_0xc86d('0x42')](_0x3cf1c2,_0xc86d('0x3a'));_0x10b90e['query']=_[_0xc86d('0x43')](_0x5e4b08[_0xc86d('0x44')]);_0x10b90e[_0xc86d('0x45')]=_[_0xc86d('0x46')](_0x10b90e[_0xc86d('0x41')],_0x10b90e[_0xc86d('0x44')]);_0x5b2df9['attributes']=_[_0xc86d('0x46')](_0x10b90e['model'],qs[_0xc86d('0x47')](_0x5e4b08[_0xc86d('0x44')][_0xc86d('0x47')]));_0x5b2df9[_0xc86d('0x48')]=_0x5b2df9['attributes']['length']?_0x5b2df9['attributes']:_0x10b90e[_0xc86d('0x41')];if(!_0x5e4b08[_0xc86d('0x44')][_0xc86d('0x49')](_0xc86d('0x4a'))){_0x5b2df9['limit']=qs[_0xc86d('0x31')](_0x5e4b08[_0xc86d('0x44')][_0xc86d('0x31')]);_0x5b2df9[_0xc86d('0x33')]=qs[_0xc86d('0x33')](_0x5e4b08['query'][_0xc86d('0x33')]);}_0x5b2df9[_0xc86d('0x4b')]=qs[_0xc86d('0x4c')](_0x5e4b08[_0xc86d('0x44')]['sort']);_0x5b2df9[_0xc86d('0x4d')]=qs['filters'](_['pick'](_0x5e4b08[_0xc86d('0x44')],_0x10b90e['filters']),_0x3cf1c2);if(_0x5e4b08[_0xc86d('0x44')][_0xc86d('0x4e')]){_0x5b2df9[_0xc86d('0x4d')]=_[_0xc86d('0x4f')](_0x5b2df9['where'],{'$or':_[_0xc86d('0x42')](_0x3cf1c2,function(_0x2ed413){if(_0x2ed413[_0xc86d('0x3f')]!=='VIRTUAL'){var _0x56ea96={};_0x56ea96[_0x2ed413[_0xc86d('0x3a')]]={'$like':'%'+_0x5e4b08['query'][_0xc86d('0x4e')]+'%'};return _0x56ea96;}})});}_0x5b2df9=_[_0xc86d('0x4f')]({},_0x5b2df9,_0x5e4b08[_0xc86d('0x50')]);var _0x5a6bfc={'where':_0x5b2df9['where']};return db[_0xc86d('0x3d')][_0xc86d('0x32')](_0x5a6bfc)[_0xc86d('0x21')](function(_0x574663){_0x41b71c[_0xc86d('0x32')]=_0x574663;if(_0x5e4b08['query'][_0xc86d('0x51')]){_0x5b2df9[_0xc86d('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0xc86d('0x53')](_0x5b2df9);})[_0xc86d('0x21')](function(_0x5db16d){_0x41b71c[_0xc86d('0x54')]=_0x5db16d;return _0x41b71c;})['then'](respondWithFilteredResult(_0x247560,_0x5b2df9))[_0xc86d('0x2b')](handleError(_0x247560,null));};exports[_0xc86d('0x55')]=function(_0x47474a,_0x52c6e0){var _0x505aaf={'raw':!![],'where':{'id':_0x47474a[_0xc86d('0x56')]['id']}},_0x29dbbe={};_0x29dbbe[_0xc86d('0x41')]=_[_0xc86d('0x43')](db['SmsMessage'][_0xc86d('0x3e')]);_0x29dbbe[_0xc86d('0x44')]=_[_0xc86d('0x43')](_0x47474a[_0xc86d('0x44')]);_0x29dbbe[_0xc86d('0x45')]=_[_0xc86d('0x46')](_0x29dbbe['model'],_0x29dbbe[_0xc86d('0x44')]);_0x505aaf[_0xc86d('0x48')]=_[_0xc86d('0x46')](_0x29dbbe[_0xc86d('0x41')],qs[_0xc86d('0x47')](_0x47474a[_0xc86d('0x44')][_0xc86d('0x47')]));_0x505aaf[_0xc86d('0x48')]=_0x505aaf['attributes']['length']?_0x505aaf[_0xc86d('0x48')]:_0x29dbbe['model'];if(_0x47474a[_0xc86d('0x44')][_0xc86d('0x51')]){_0x505aaf['include']=[{'all':!![]}];}_0x505aaf=_[_0xc86d('0x4f')]({},_0x505aaf,_0x47474a[_0xc86d('0x50')]);return db[_0xc86d('0x3d')][_0xc86d('0x57')](_0x505aaf)[_0xc86d('0x21')](handleEntityNotFound(_0x52c6e0,null))[_0xc86d('0x21')](respondWithResult(_0x52c6e0,null))[_0xc86d('0x2b')](handleError(_0x52c6e0,null));};exports[_0xc86d('0x58')]=function(_0x509484,_0x30aacd){return db[_0xc86d('0x3d')][_0xc86d('0x58')](_0x509484[_0xc86d('0x59')],{})['then'](respondWithResult(_0x30aacd,0xc9))[_0xc86d('0x2b')](handleError(_0x30aacd,null));};exports['update']=function(_0xb766e1,_0x3a7900){if(_0xb766e1[_0xc86d('0x59')]['id']){delete _0xb766e1['body']['id'];}return db[_0xc86d('0x3d')][_0xc86d('0x57')]({'where':{'id':_0xb766e1[_0xc86d('0x56')]['id']}})[_0xc86d('0x21')](handleEntityNotFound(_0x3a7900,null))['then'](saveUpdates(_0xb766e1['body'],null))[_0xc86d('0x21')](respondWithResult(_0x3a7900,null))['catch'](handleError(_0x3a7900,null));};exports[_0xc86d('0x5a')]=function(_0x569ac9,_0x41b5ce){return db[_0xc86d('0x3d')][_0xc86d('0x57')]({'where':{'id':_0x569ac9['params']['id']}})['then'](handleEntityNotFound(_0x41b5ce,null))['then'](removeEntity(_0x41b5ce,null))[_0xc86d('0x2b')](handleError(_0x41b5ce,null));};exports[_0xc86d('0x5b')]=function(_0x234af8,_0xa28234){return db[_0xc86d('0x3d')][_0xc86d('0x5b')]()['then'](respondWithResult(_0xa28234,null))['catch'](handleError(_0xa28234,null));};var interaction_log=require(_0xc86d('0x11'))(_0xc86d('0x5c'));exports[_0xc86d('0x5d')]=function(_0x3bb71c,_0x379b99,_0x465aac){var _0x4237fa={'agent':{},'channel':_0xc86d('0x5e')};if(_0x3bb71c[_0xc86d('0x59')]['id']){delete _0x3bb71c['body']['id'];}_0x3bb71c[_0xc86d('0x59')][_0xc86d('0x5f')]=!![];_0x3bb71c['body']['readAt']=moment()['format'](_0xc86d('0x60'));_0x3bb71c[_0xc86d('0x59')][_0xc86d('0x61')]=_0x3bb71c[_0xc86d('0x59')][_0xc86d('0x61')]||_0x3bb71c[_0xc86d('0x62')]['id'];_0x4237fa[_0xc86d('0x63')]['id']=_0x3bb71c[_0xc86d('0x59')]['UserId'];return db[_0xc86d('0x3d')]['find']({'where':{'id':_0x3bb71c[_0xc86d('0x56')]['id'],'UserId':null}})[_0xc86d('0x21')](handleEntityNotFound(_0x379b99,null))[_0xc86d('0x21')](saveUpdates(_0x3bb71c[_0xc86d('0x59')],null))[_0xc86d('0x21')](function(_0x267d2a){if(_0x267d2a){_0x4237fa[_0xc86d('0x28')]=_0x267d2a[_0xc86d('0x64')]({'plain':!![]});return db[_0xc86d('0x65')][_0xc86d('0x57')]({'where':{'id':_0x267d2a[_0xc86d('0x66')]}});}return null;})[_0xc86d('0x21')](handleEntityNotFound(_0x379b99,null))['then'](function(_0x25e122){if(_0x25e122){return _0x25e122[_0xc86d('0x38')]({'UserId':_0x3bb71c[_0xc86d('0x59')][_0xc86d('0x61')],'read1stAt':_[_0xc86d('0x67')](_0x25e122[_0xc86d('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc86d('0x21')](function(_0x1d2127){if(_0x1d2127){_0x4237fa[_0xc86d('0x69')]=_0x1d2127['get']({'plain':!![]});interaction_log[_0xc86d('0x29')](_0xc86d('0x6a'),_0x3bb71c['user']['id'],_0x3bb71c['user'][_0xc86d('0x3a')],_0x3bb71c[_0xc86d('0x62')][_0xc86d('0x6b')],_0x4237fa[_0xc86d('0x69')]['id'],_0x3bb71c[_0xc86d('0x59')]?JSON[_0xc86d('0x25')](_0x3bb71c[_0xc86d('0x59')]):_0xc86d('0x6c'));return respondWithRpcPromise(_0xc86d('0x6d'),_0xc86d('0x6e'),_0x4237fa);}return null;})[_0xc86d('0x21')](function(_0x296736){var _0x362614=_0xc86d('0x6f')+_0x296736[_0xc86d('0x28')][_0xc86d('0x70')];return db[_0xc86d('0x71')][_0xc86d('0x44')](_0x362614,{'type':db['Sequelize'][_0xc86d('0x72')][_0xc86d('0x73')],'raw':!![]})['then'](function(_0x58656c){return _0x58656c;});})[_0xc86d('0x21')](function(_0x5edc91){if(_0x5edc91){_0x4237fa[_0xc86d('0x28')][_0xc86d('0x74')]=_0x5edc91[0x0];if(!_0x3bb71c[_0xc86d('0x59')]['UserId'])return;return db[_0xc86d('0x75')][_0xc86d('0x57')]({'where':{'id':_0x3bb71c[_0xc86d('0x59')][_0xc86d('0x61')],'role':_0xc86d('0x63')},'attributes':['id',_0xc86d('0x3a'),_0xc86d('0x76'),'email',_0xc86d('0x77')],'raw':!![]});}return null;})[_0xc86d('0x21')](function(_0x61ca65){if(!_0x61ca65)return null;_0x4237fa[_0xc86d('0x28')][_0xc86d('0x63')]=_0x61ca65;return _0x4237fa;})[_0xc86d('0x21')](function(_0x1e885d){if(_0x1e885d){if(_0x3bb71c[_0xc86d('0x59')][_0xc86d('0x78')]){_0x4237fa[_0xc86d('0x28')][_0xc86d('0x79')]=util[_0xc86d('0x7a')](_0xc86d('0x7b'),_0x3bb71c[_0xc86d('0x62')][_0xc86d('0x3a')]);_0x4237fa[_0xc86d('0x28')][_0xc86d('0x7c')]=_0x4237fa[_0xc86d('0x7c')];_0x4237fa[_0xc86d('0x28')]['motionChannel']=_0x4237fa[_0xc86d('0x7c')];_0x4237fa[_0xc86d('0x28')][_0xc86d('0x7d')]='accept';return respondWithRpcPromise(_0xc86d('0x7e'),_0xc86d('0x7e'),{'event':_0xc86d('0x7f'),'message':_0x4237fa[_0xc86d('0x28')]},client9002)[_0xc86d('0x21')](function(){return _0x4237fa;});}return _0x4237fa;}return null;})[_0xc86d('0x21')](respondWithResult(_0x379b99,null))['catch'](handleError(_0x379b99,null));};var interaction_log=require(_0xc86d('0x11'))(_0xc86d('0x5c'));exports['reject']=function(_0x28a69c,_0x1cb58c,_0x43a3bc){var _0x5a34c5={'agent':{},'channel':_0xc86d('0x5e')};if(_0x28a69c[_0xc86d('0x59')]['id']){delete _0x28a69c[_0xc86d('0x59')]['id'];}_0x28a69c[_0xc86d('0x59')][_0xc86d('0x61')]=_0x28a69c['body']['UserId']||_0x28a69c[_0xc86d('0x62')]['id'];_0x5a34c5['agent']['id']=_0x28a69c['body'][_0xc86d('0x61')];return db['SmsMessage'][_0xc86d('0x57')]({'where':{'id':_0x28a69c[_0xc86d('0x56')]['id'],'UserId':null}})[_0xc86d('0x21')](handleEntityNotFound(_0x1cb58c,null))[_0xc86d('0x21')](function(_0x19376d){if(_0x19376d){_0x5a34c5[_0xc86d('0x28')]=_0x19376d[_0xc86d('0x64')]({'plain':!![]});return db[_0xc86d('0x65')][_0xc86d('0x57')]({'where':{'id':_0x19376d[_0xc86d('0x66')]}});}return null;})[_0xc86d('0x21')](handleEntityNotFound(_0x1cb58c,null))[_0xc86d('0x21')](function(_0x44adc8){if(_0x44adc8){_0x5a34c5['interaction']=_0x44adc8[_0xc86d('0x64')]({'plain':!![]});interaction_log[_0xc86d('0x29')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28a69c['user']['id'],_0x28a69c['user'][_0xc86d('0x3a')],_0x28a69c[_0xc86d('0x62')][_0xc86d('0x6b')],_0x5a34c5[_0xc86d('0x69')]['id'],_0x28a69c[_0xc86d('0x59')]?JSON[_0xc86d('0x25')](_0x28a69c[_0xc86d('0x59')]):'null');return respondWithRpcPromise(_0xc86d('0x80'),_0xc86d('0x81'),_0x5a34c5);}return null;})[_0xc86d('0x21')](function(_0x4c5e64){var _0x318331=_0xc86d('0x6f')+_0x4c5e64['message'][_0xc86d('0x70')];return db[_0xc86d('0x71')]['query'](_0x318331,{'type':db[_0xc86d('0x82')]['QueryTypes'][_0xc86d('0x73')],'raw':!![]})[_0xc86d('0x21')](function(_0x449c2f){return _0x449c2f;});})['then'](function(_0x3a53a4){if(_0x3a53a4){_0x5a34c5[_0xc86d('0x28')][_0xc86d('0x74')]=_0x3a53a4[0x0];if(!_0x28a69c[_0xc86d('0x59')][_0xc86d('0x61')])return;return db[_0xc86d('0x75')][_0xc86d('0x57')]({'where':{'id':_0x28a69c['body'][_0xc86d('0x61')],'role':_0xc86d('0x63')},'attributes':['id',_0xc86d('0x3a'),'fullname',_0xc86d('0x83'),_0xc86d('0x77')],'raw':!![]});}return null;})[_0xc86d('0x21')](function(_0x3bf026){if(!_0x3bf026)return null;_0x5a34c5['message'][_0xc86d('0x63')]=_0x3bf026;return _0x5a34c5;})[_0xc86d('0x21')](function(_0x4e69ae){if(_0x4e69ae){_0x4e69ae['message'][_0xc86d('0x79')]=util[_0xc86d('0x7a')]('SIP/%s',_0x28a69c[_0xc86d('0x62')][_0xc86d('0x3a')]);_0x4e69ae[_0xc86d('0x28')][_0xc86d('0x7c')]=_0x5a34c5['channel'];_0x4e69ae[_0xc86d('0x28')]['motionChannel']=_0x5a34c5[_0xc86d('0x7c')];_0x4e69ae[_0xc86d('0x28')][_0xc86d('0x7d')]=_0xc86d('0x36');respondWithRpcPromise(_0xc86d('0x7e'),_0xc86d('0x7e'),{'event':_0xc86d('0x84'),'message':_0x4e69ae[_0xc86d('0x28')]},client9002);return _0x5a34c5;}return null;})['then'](respondWithResult(_0x1cb58c,null))[_0xc86d('0x2b')](handleError(_0x1cb58c,null));};exports[_0xc86d('0x2d')]=function(_0x71cf12,_0x429c45,_0x5bd3a2){if(_0x71cf12[_0xc86d('0x59')]['id']){delete _0x71cf12['body']['id'];}var _0x33cf85;return db[_0xc86d('0x3d')][_0xc86d('0x57')]({'where':{'id':_0x71cf12[_0xc86d('0x56')]['id']}})[_0xc86d('0x21')](handleEntityNotFound(_0x429c45,null))[_0xc86d('0x21')](function(_0x3aa461){if(_0x3aa461){_0x33cf85=_0x3aa461;return db['SmsAccount'][_0xc86d('0x57')]({'where':{'id':_0x3aa461[_0xc86d('0x85')]}});}})['then'](handleEntityNotFound(_0x429c45,null))['then'](function(_0x1083d2){if(_0x1083d2){logger[_0xc86d('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc86d('0x2d'),_0xc86d('0x86'),_0x1083d2[_0xc86d('0x3f')],util[_0xc86d('0x87')](_0x71cf12[_0xc86d('0x59')],{'showHidden':![],'depth':null}));switch(_0x1083d2[_0xc86d('0x3f')]){case _0xc86d('0x88'):if(_0x71cf12[_0xc86d('0x59')][_0xc86d('0x89')]&&_0x71cf12['body']['MessageSid']===_0x33cf85[_0xc86d('0x8a')]){return _0x33cf85[_0xc86d('0x38')]({'read':!![]});}else{logger[_0xc86d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc86d('0x2d'),_0xc86d('0x88'),util[_0xc86d('0x87')](_0x71cf12['body'],{'showHidden':![],'depth':null}));}break;case _0xc86d('0x8b'):if(_0x71cf12[_0xc86d('0x59')]['MessageUUID']&&_0x71cf12[_0xc86d('0x59')][_0xc86d('0x8c')]===_0x33cf85[_0xc86d('0x8a')]&&_[_0xc86d('0x8d')]([_0xc86d('0x8e'),_0xc86d('0x8f')],_0x71cf12[_0xc86d('0x59')]['Status'])>=0x0){return _0x33cf85[_0xc86d('0x38')]({'read':!![]});}else{logger[_0xc86d('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc86d('0x90'),util[_0xc86d('0x87')](_0x71cf12['body'],{'showHidden':![],'depth':null}));}break;case _0xc86d('0x91'):var _0x3be4cd=_0x71cf12[_0xc86d('0x59')][_0xc86d('0x92')][0x0];if(_0x3be4cd[_0xc86d('0x2d')]['groupName']==='DELIVERED'){return _0x33cf85[_0xc86d('0x38')]({'read':!![]});}else{logger['error'](_0xc86d('0x93'),_0xc86d('0x2d'),'infobip',util[_0xc86d('0x87')](_0x71cf12[_0xc86d('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x33cf85;}})[_0xc86d('0x21')](respondWithResult(_0x429c45,null))[_0xc86d('0x2b')](handleError(_0x429c45,null));}; \ No newline at end of file +var _0x793b=['send','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','SmsMessage','include','find','body','update','destroy','describe','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','sms-interactions','sms','get','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','motionChannel','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','type','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','stack','name'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x793b,0x189));var _0xb793=function(_0x2c71fb,_0x13128f){_0x2c71fb=_0x2c71fb-0x0;var _0x581033=_0x793b[_0x2c71fb];return _0x581033;};'use strict';var emlformat=require(_0xb793('0x0'));var rimraf=require(_0xb793('0x1'));var zipdir=require(_0xb793('0x2'));var jsonpatch=require(_0xb793('0x3'));var rp=require(_0xb793('0x4'));var moment=require('moment');var BPromise=require(_0xb793('0x5'));var Mustache=require(_0xb793('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb793('0x7'));var csv=require(_0xb793('0x8'));var ejs=require(_0xb793('0x9'));var fs=require('fs');var fs_extra=require(_0xb793('0xa'));var _=require(_0xb793('0xb'));var squel=require(_0xb793('0xc'));var crypto=require(_0xb793('0xd'));var jsforce=require(_0xb793('0xe'));var deskjs=require(_0xb793('0xf'));var toCsv=require(_0xb793('0x8'));var querystring=require(_0xb793('0x10'));var Papa=require(_0xb793('0x11'));var Redis=require(_0xb793('0x12'));var authService=require(_0xb793('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb793('0x14'));var hardwareService=require(_0xb793('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xb793('0x16'));var config=require(_0xb793('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb793('0x18'))['db'];config[_0xb793('0x19')]=_['defaults'](config[_0xb793('0x19')],{'host':_0xb793('0x1a'),'port':0x18eb});var socket=require(_0xb793('0x1b'))(new Redis(config[_0xb793('0x19')]));require(_0xb793('0x1c'))[_0xb793('0x1d')](socket);var jayson=require(_0xb793('0x1e'));var client=jayson['client'][_0xb793('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20ab1e,_0x18fb18,_0x115165,_0x1ff6cb){return new BPromise(function(_0x38d9f2,_0x32e9e7){var _0x18c005=_0x1ff6cb||client;return _0x18c005[_0xb793('0x20')](_0x20ab1e,_0x115165)[_0xb793('0x21')](function(_0x2914a2){logger[_0xb793('0x22')](_0xb793('0x23'),_0x18fb18,_0xb793('0x24'));logger[_0xb793('0x25')](_0xb793('0x26'),_0x18fb18,_0xb793('0x24'),JSON['stringify'](_0x2914a2));if(_0x2914a2[_0xb793('0x27')]){if(_0x2914a2[_0xb793('0x27')]['code']===0x1f4){logger[_0xb793('0x27')](_0xb793('0x23'),_0x18fb18,_0x2914a2[_0xb793('0x27')][_0xb793('0x28')]);return _0x32e9e7(_0x2914a2[_0xb793('0x27')]['message']);}logger['error'](_0xb793('0x23'),_0x18fb18,_0x2914a2[_0xb793('0x27')][_0xb793('0x28')]);return _0x38d9f2(_0x2914a2[_0xb793('0x27')][_0xb793('0x28')]);}else{logger[_0xb793('0x22')](_0xb793('0x23'),_0x18fb18,_0xb793('0x24'));_0x38d9f2(_0x2914a2['result'][_0xb793('0x28')]);}})[_0xb793('0x29')](function(_0x14ecb0){logger[_0xb793('0x27')](_0xb793('0x23'),_0x18fb18,_0x14ecb0);_0x32e9e7(_0x14ecb0);});});}function respondWithStatusCode(_0x164107,_0x66263f){_0x66263f=_0x66263f||0xcc;return function(_0x484788){if(_0x484788){return _0x164107[_0xb793('0x2a')](_0x66263f);}return _0x164107[_0xb793('0x2b')](_0x66263f)[_0xb793('0x2c')]();};}function respondWithResult(_0x2d5444,_0x35cd9d){_0x35cd9d=_0x35cd9d||0xc8;return function(_0x2afea2){if(_0x2afea2){return _0x2d5444['status'](_0x35cd9d)[_0xb793('0x2d')](_0x2afea2);}};}function respondWithFilteredResult(_0x249acf,_0x107d78){return function(_0x4ec642){if(_0x4ec642){var _0x89d007=typeof _0x107d78[_0xb793('0x2e')]===_0xb793('0x2f')&&typeof _0x107d78[_0xb793('0x30')]==='undefined';var _0x493a8c=_0x4ec642[_0xb793('0x31')];var _0x4b0297=_0x89d007?0x0:_0x107d78['offset'];var _0x8a0bed=_0x89d007?_0x4ec642[_0xb793('0x31')]:_0x107d78[_0xb793('0x2e')]+_0x107d78[_0xb793('0x30')];var _0x52956a;if(_0x8a0bed>=_0x493a8c){_0x8a0bed=_0x493a8c;_0x52956a=0xc8;}else{_0x52956a=0xce;}_0x249acf[_0xb793('0x2b')](_0x52956a);return _0x249acf[_0xb793('0x32')](_0xb793('0x33'),_0x4b0297+'-'+_0x8a0bed+'/'+_0x493a8c)[_0xb793('0x2d')](_0x4ec642);}return null;};}function patchUpdates(_0x500cf5){return function(_0x17a941){try{jsonpatch[_0xb793('0x34')](_0x17a941,_0x500cf5,!![]);}catch(_0x13075b){return BPromise[_0xb793('0x35')](_0x13075b);}return _0x17a941[_0xb793('0x36')]();};}function saveUpdates(_0x37ceaa,_0x23e439){return function(_0x31439b){if(_0x31439b){return _0x31439b['update'](_0x37ceaa)['then'](function(_0x447ede){return _0x447ede;});}return null;};}function removeEntity(_0x38fb94,_0xa4b7c1){return function(_0x2308e6){if(_0x2308e6){return _0x2308e6['destroy']()[_0xb793('0x21')](function(){_0x38fb94[_0xb793('0x2b')](0xcc)[_0xb793('0x2c')]();});}};}function handleEntityNotFound(_0x1e7eae,_0x4237d7){return function(_0x588645){if(!_0x588645){_0x1e7eae[_0xb793('0x2a')](0x194);}return _0x588645;};}function handleError(_0x417484,_0x6d836f){_0x6d836f=_0x6d836f||0x1f4;return function(_0x432720){logger[_0xb793('0x27')](_0x432720[_0xb793('0x37')]);if(_0x432720[_0xb793('0x38')]){delete _0x432720['name'];}_0x417484[_0xb793('0x2b')](_0x6d836f)[_0xb793('0x39')](_0x432720);};}exports['index']=function(_0x3127f1,_0x17a91c){var _0x497568={},_0x10a5a1={},_0x4a1aee={'count':0x0,'rows':[]};var _0x3c2f60=_[_0xb793('0x3a')](db['SmsMessage'][_0xb793('0x3b')],function(_0x1ee631){return{'name':_0x1ee631['fieldName'],'type':_0x1ee631['type'][_0xb793('0x3c')]};});_0x10a5a1[_0xb793('0x3d')]=_[_0xb793('0x3a')](_0x3c2f60,_0xb793('0x38'));_0x10a5a1[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x3127f1[_0xb793('0x3e')]);_0x10a5a1['filters']=_[_0xb793('0x40')](_0x10a5a1['model'],_0x10a5a1[_0xb793('0x3e')]);_0x497568[_0xb793('0x41')]=_[_0xb793('0x40')](_0x10a5a1[_0xb793('0x3d')],qs[_0xb793('0x42')](_0x3127f1['query']['fields']));_0x497568[_0xb793('0x41')]=_0x497568['attributes'][_0xb793('0x43')]?_0x497568[_0xb793('0x41')]:_0x10a5a1[_0xb793('0x3d')];if(!_0x3127f1['query'][_0xb793('0x44')](_0xb793('0x45'))){_0x497568['limit']=qs[_0xb793('0x30')](_0x3127f1[_0xb793('0x3e')][_0xb793('0x30')]);_0x497568[_0xb793('0x2e')]=qs['offset'](_0x3127f1[_0xb793('0x3e')][_0xb793('0x2e')]);}_0x497568[_0xb793('0x46')]=qs['sort'](_0x3127f1[_0xb793('0x3e')][_0xb793('0x47')]);_0x497568[_0xb793('0x48')]=qs['filters'](_[_0xb793('0x49')](_0x3127f1[_0xb793('0x3e')],_0x10a5a1['filters']),_0x3c2f60);if(_0x3127f1[_0xb793('0x3e')][_0xb793('0x4a')]){_0x497568['where']=_[_0xb793('0x4b')](_0x497568['where'],{'$or':_['map'](_0x3c2f60,function(_0x278c6f){if(_0x278c6f['type']!==_0xb793('0x4c')){var _0x221bd8={};_0x221bd8[_0x278c6f[_0xb793('0x38')]]={'$like':'%'+_0x3127f1['query'][_0xb793('0x4a')]+'%'};return _0x221bd8;}})});}_0x497568=_[_0xb793('0x4b')]({},_0x497568,_0x3127f1[_0xb793('0x4d')]);var _0xead97={'where':_0x497568[_0xb793('0x48')]};return db['SmsMessage'][_0xb793('0x31')](_0xead97)[_0xb793('0x21')](function(_0x30209a){_0x4a1aee[_0xb793('0x31')]=_0x30209a;if(_0x3127f1['query'][_0xb793('0x4e')]){_0x497568['include']=[{'all':!![]}];}return db['SmsMessage'][_0xb793('0x4f')](_0x497568);})[_0xb793('0x21')](function(_0x338011){_0x4a1aee[_0xb793('0x50')]=_0x338011;return _0x4a1aee;})[_0xb793('0x21')](respondWithFilteredResult(_0x17a91c,_0x497568))[_0xb793('0x29')](handleError(_0x17a91c,null));};exports[_0xb793('0x51')]=function(_0x583fd8,_0x3addc2){var _0x34bc7e={'raw':!![],'where':{'id':_0x583fd8[_0xb793('0x52')]['id']}},_0x4612be={};_0x4612be[_0xb793('0x3d')]=_[_0xb793('0x3f')](db[_0xb793('0x53')][_0xb793('0x3b')]);_0x4612be[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x583fd8['query']);_0x4612be['filters']=_[_0xb793('0x40')](_0x4612be[_0xb793('0x3d')],_0x4612be[_0xb793('0x3e')]);_0x34bc7e[_0xb793('0x41')]=_['intersection'](_0x4612be[_0xb793('0x3d')],qs[_0xb793('0x42')](_0x583fd8[_0xb793('0x3e')][_0xb793('0x42')]));_0x34bc7e[_0xb793('0x41')]=_0x34bc7e['attributes'][_0xb793('0x43')]?_0x34bc7e[_0xb793('0x41')]:_0x4612be['model'];if(_0x583fd8[_0xb793('0x3e')][_0xb793('0x4e')]){_0x34bc7e[_0xb793('0x54')]=[{'all':!![]}];}_0x34bc7e=_[_0xb793('0x4b')]({},_0x34bc7e,_0x583fd8[_0xb793('0x4d')]);return db['SmsMessage'][_0xb793('0x55')](_0x34bc7e)[_0xb793('0x21')](handleEntityNotFound(_0x3addc2,null))[_0xb793('0x21')](respondWithResult(_0x3addc2,null))[_0xb793('0x29')](handleError(_0x3addc2,null));};exports['create']=function(_0x4586ab,_0x20543a){return db['SmsMessage']['create'](_0x4586ab[_0xb793('0x56')],{})['then'](respondWithResult(_0x20543a,0xc9))['catch'](handleError(_0x20543a,null));};exports[_0xb793('0x57')]=function(_0x468077,_0x46e111){if(_0x468077[_0xb793('0x56')]['id']){delete _0x468077[_0xb793('0x56')]['id'];}return db['SmsMessage'][_0xb793('0x55')]({'where':{'id':_0x468077['params']['id']}})[_0xb793('0x21')](handleEntityNotFound(_0x46e111,null))['then'](saveUpdates(_0x468077[_0xb793('0x56')],null))[_0xb793('0x21')](respondWithResult(_0x46e111,null))[_0xb793('0x29')](handleError(_0x46e111,null));};exports[_0xb793('0x58')]=function(_0x43831e,_0x55e176){return db['SmsMessage'][_0xb793('0x55')]({'where':{'id':_0x43831e[_0xb793('0x52')]['id']}})[_0xb793('0x21')](handleEntityNotFound(_0x55e176,null))[_0xb793('0x21')](removeEntity(_0x55e176,null))['catch'](handleError(_0x55e176,null));};exports[_0xb793('0x59')]=function(_0x1672e9,_0x5c9bed){return db['SmsMessage']['describe']()[_0xb793('0x21')](respondWithResult(_0x5c9bed,null))[_0xb793('0x29')](handleError(_0x5c9bed,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0xb793('0x5a')]=function(_0xf9a4b4,_0x256c74,_0x46f734){var _0x385bb9={'agent':{},'channel':'sms'};if(_0xf9a4b4[_0xb793('0x56')]['id']){delete _0xf9a4b4[_0xb793('0x56')]['id'];}_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5b')]=!![];_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5c')]=moment()['format'](_0xb793('0x5d'));_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')]=_0xf9a4b4[_0xb793('0x56')]['UserId']||_0xf9a4b4[_0xb793('0x5f')]['id'];_0x385bb9[_0xb793('0x60')]['id']=_0xf9a4b4['body'][_0xb793('0x5e')];return db[_0xb793('0x53')][_0xb793('0x55')]({'where':{'id':_0xf9a4b4['params']['id'],'UserId':null}})[_0xb793('0x21')](handleEntityNotFound(_0x256c74,null))[_0xb793('0x21')](saveUpdates(_0xf9a4b4[_0xb793('0x56')],null))[_0xb793('0x21')](function(_0x5b7bce){if(_0x5b7bce){_0x385bb9[_0xb793('0x28')]=_0x5b7bce['get']({'plain':!![]});return db[_0xb793('0x61')][_0xb793('0x55')]({'where':{'id':_0x5b7bce['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x256c74,null))[_0xb793('0x21')](function(_0x445c00){if(_0x445c00){return _0x445c00[_0xb793('0x57')]({'UserId':_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')],'read1stAt':_['isNil'](_0x445c00[_0xb793('0x62')])?moment()['format'](_0xb793('0x5d')):undefined});}return null;})[_0xb793('0x21')](function(_0x48f08f){if(_0x48f08f){_0x385bb9[_0xb793('0x63')]=_0x48f08f['get']({'plain':!![]});interaction_log[_0xb793('0x22')](_0xb793('0x64'),_0xf9a4b4['user']['id'],_0xf9a4b4[_0xb793('0x5f')]['name'],_0xf9a4b4[_0xb793('0x5f')][_0xb793('0x65')],_0x385bb9[_0xb793('0x63')]['id'],_0xf9a4b4[_0xb793('0x56')]?JSON[_0xb793('0x66')](_0xf9a4b4[_0xb793('0x56')]):_0xb793('0x67'));return respondWithRpcPromise(_0xb793('0x68'),_0xb793('0x69'),_0x385bb9);}return null;})['then'](function(_0x491f66){var _0x56d0df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x491f66['message'][_0xb793('0x6a')];return db[_0xb793('0x6b')][_0xb793('0x3e')](_0x56d0df,{'type':db['Sequelize'][_0xb793('0x6c')][_0xb793('0x6d')],'raw':!![]})[_0xb793('0x21')](function(_0x3fa570){return _0x3fa570;});})[_0xb793('0x21')](function(_0x39ec49){if(_0x39ec49){_0x385bb9[_0xb793('0x28')][_0xb793('0x6e')]=_0x39ec49[0x0];if(!_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')])return;return db[_0xb793('0x6f')][_0xb793('0x55')]({'where':{'id':_0xf9a4b4[_0xb793('0x56')][_0xb793('0x5e')],'role':_0xb793('0x60')},'attributes':['id',_0xb793('0x38'),'fullname',_0xb793('0x70'),_0xb793('0x71')],'raw':!![]});}return null;})[_0xb793('0x21')](function(_0x4b06a7){if(!_0x4b06a7)return null;_0x385bb9[_0xb793('0x28')]['agent']=_0x4b06a7;return _0x385bb9;})['then'](function(_0x15b06b){if(_0x15b06b){if(_0xf9a4b4[_0xb793('0x56')][_0xb793('0x72')]){_0x385bb9['message'][_0xb793('0x73')]=util[_0xb793('0x74')](_0xb793('0x75'),_0xf9a4b4['user']['name']);_0x385bb9[_0xb793('0x28')]['channel']=_0x385bb9[_0xb793('0x76')];_0x385bb9[_0xb793('0x28')]['motionChannel']=_0x385bb9[_0xb793('0x76')];_0x385bb9[_0xb793('0x28')][_0xb793('0x77')]=_0xb793('0x5a');return respondWithRpcPromise(_0xb793('0x78'),_0xb793('0x78'),{'event':_0xb793('0x79'),'message':_0x385bb9[_0xb793('0x28')]},client9002)[_0xb793('0x21')](function(){return _0x385bb9;});}return _0x385bb9;}return null;})[_0xb793('0x21')](respondWithResult(_0x256c74,null))[_0xb793('0x29')](handleError(_0x256c74,null));};var interaction_log=require(_0xb793('0x7a'))(_0xb793('0x7b'));exports['reject']=function(_0x3a809b,_0x55e67d,_0x532d70){var _0x24f9b3={'agent':{},'channel':_0xb793('0x7c')};if(_0x3a809b[_0xb793('0x56')]['id']){delete _0x3a809b[_0xb793('0x56')]['id'];}_0x3a809b['body'][_0xb793('0x5e')]=_0x3a809b[_0xb793('0x56')]['UserId']||_0x3a809b[_0xb793('0x5f')]['id'];_0x24f9b3[_0xb793('0x60')]['id']=_0x3a809b[_0xb793('0x56')]['UserId'];return db[_0xb793('0x53')][_0xb793('0x55')]({'where':{'id':_0x3a809b['params']['id'],'UserId':null}})[_0xb793('0x21')](handleEntityNotFound(_0x55e67d,null))[_0xb793('0x21')](function(_0x262b9b){if(_0x262b9b){_0x24f9b3[_0xb793('0x28')]=_0x262b9b[_0xb793('0x7d')]({'plain':!![]});return db['SmsInteraction'][_0xb793('0x55')]({'where':{'id':_0x262b9b[_0xb793('0x7e')]}});}return null;})['then'](handleEntityNotFound(_0x55e67d,null))[_0xb793('0x21')](function(_0x342840){if(_0x342840){_0x24f9b3['interaction']=_0x342840[_0xb793('0x7d')]({'plain':!![]});interaction_log[_0xb793('0x22')](_0xb793('0x7f'),_0x3a809b[_0xb793('0x5f')]['id'],_0x3a809b[_0xb793('0x5f')][_0xb793('0x38')],_0x3a809b[_0xb793('0x5f')]['role'],_0x24f9b3[_0xb793('0x63')]['id'],_0x3a809b['body']?JSON[_0xb793('0x66')](_0x3a809b[_0xb793('0x56')]):_0xb793('0x67'));return respondWithRpcPromise(_0xb793('0x80'),'rejectMessage',_0x24f9b3);}return null;})['then'](function(_0x2f3a7b){var _0x1b5138=_0xb793('0x81')+_0x2f3a7b[_0xb793('0x28')][_0xb793('0x6a')];return db[_0xb793('0x6b')][_0xb793('0x3e')](_0x1b5138,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xb793('0x21')](function(_0x294764){return _0x294764;});})[_0xb793('0x21')](function(_0x434615){if(_0x434615){_0x24f9b3[_0xb793('0x28')][_0xb793('0x6e')]=_0x434615[0x0];if(!_0x3a809b[_0xb793('0x56')]['UserId'])return;return db[_0xb793('0x6f')][_0xb793('0x55')]({'where':{'id':_0x3a809b['body']['UserId'],'role':_0xb793('0x60')},'attributes':['id',_0xb793('0x38'),_0xb793('0x82'),'email',_0xb793('0x71')],'raw':!![]});}return null;})['then'](function(_0x52b765){if(!_0x52b765)return null;_0x24f9b3[_0xb793('0x28')][_0xb793('0x60')]=_0x52b765;return _0x24f9b3;})[_0xb793('0x21')](function(_0x2e547f){if(_0x2e547f){_0x2e547f[_0xb793('0x28')]['interface']=util['format'](_0xb793('0x75'),_0x3a809b[_0xb793('0x5f')][_0xb793('0x38')]);_0x2e547f[_0xb793('0x28')][_0xb793('0x76')]=_0x24f9b3[_0xb793('0x76')];_0x2e547f[_0xb793('0x28')][_0xb793('0x83')]=_0x24f9b3[_0xb793('0x76')];_0x2e547f[_0xb793('0x28')][_0xb793('0x77')]=_0xb793('0x35');respondWithRpcPromise('EventManager',_0xb793('0x78'),{'event':_0xb793('0x84'),'message':_0x2e547f[_0xb793('0x28')]},client9002);return _0x24f9b3;}return null;})[_0xb793('0x21')](respondWithResult(_0x55e67d,null))[_0xb793('0x29')](handleError(_0x55e67d,null));};exports[_0xb793('0x2b')]=function(_0x11c61d,_0x3a3b41,_0x344eb4){if(_0x11c61d['body']['id']){delete _0x11c61d[_0xb793('0x56')]['id'];}var _0x2d024f;return db['SmsMessage'][_0xb793('0x55')]({'where':{'id':_0x11c61d[_0xb793('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a3b41,null))[_0xb793('0x21')](function(_0x16230f){if(_0x16230f){_0x2d024f=_0x16230f;return db[_0xb793('0x85')]['find']({'where':{'id':_0x16230f['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3a3b41,null))[_0xb793('0x21')](function(_0x557602){if(_0x557602){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xb793('0x2b'),_0xb793('0x86'),_0x557602[_0xb793('0x87')],util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));switch(_0x557602[_0xb793('0x87')]){case'twilio':if(_0x11c61d[_0xb793('0x56')][_0xb793('0x89')]&&_0x11c61d[_0xb793('0x56')][_0xb793('0x89')]===_0x2d024f[_0xb793('0x8a')]){return _0x2d024f[_0xb793('0x57')]({'read':!![]});}else{logger['error'](_0xb793('0x8b'),'status','twilio',util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));}break;case _0xb793('0x8c'):if(_0x11c61d[_0xb793('0x56')][_0xb793('0x8d')]&&_0x11c61d[_0xb793('0x56')][_0xb793('0x8d')]===_0x2d024f['messageId']&&_[_0xb793('0x8e')]([_0xb793('0x8f'),_0xb793('0x90')],_0x11c61d[_0xb793('0x56')]['Status'])>=0x0){return _0x2d024f[_0xb793('0x57')]({'read':!![]});}else{logger[_0xb793('0x27')](_0xb793('0x8b'),'status',_0xb793('0x91'),util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4f02e8=_0x11c61d[_0xb793('0x56')][_0xb793('0x92')][0x0];if(_0x4f02e8[_0xb793('0x2b')][_0xb793('0x93')]===_0xb793('0x94')){return _0x2d024f[_0xb793('0x57')]({'read':!![]});}else{logger[_0xb793('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xb793('0x95'),util[_0xb793('0x88')](_0x11c61d[_0xb793('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x2d024f;}})[_0xb793('0x21')](respondWithResult(_0x3a3b41,null))[_0xb793('0x29')](handleError(_0x3a3b41,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 94e6b8f..7ed992b 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 _0xd9ed=['remove','emit','hasOwnProperty','exports','events','SmsMessage','setMaxListeners','update'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xd9ed,0x1cc));var _0xdd9e=function(_0x82b64f,_0x23fd07){_0x82b64f=_0x82b64f-0x0;var _0x88fc0a=_0xd9ed[_0x82b64f];return _0x88fc0a;};'use strict';var EventEmitter=require(_0xdd9e('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xdd9e('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdd9e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdd9e('0x3'),'afterDestroy':_0xdd9e('0x4')};function emitEvent(_0x840282){return function(_0x1c3483,_0x21e784,_0x43df6e){SmsMessageEvents[_0xdd9e('0x5')](_0x840282+':'+_0x1c3483['id'],_0x1c3483);SmsMessageEvents['emit'](_0x840282,_0x1c3483);_0x43df6e(null);};}for(var e in events){if(events[_0xdd9e('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xdd9e('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x755f=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x329473,_0x3af48b){var _0x27394f=function(_0x4b94be){while(--_0x4b94be){_0x329473['push'](_0x329473['shift']());}};_0x27394f(++_0x3af48b);}(_0x755f,0x16e));var _0xf755=function(_0x52a9fa,_0x13f364){_0x52a9fa=_0x52a9fa-0x0;var _0x13280b=_0x755f[_0x52a9fa];return _0x13280b;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xf755('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xf755('0x1')](0x0);var events={'afterCreate':_0xf755('0x2'),'afterUpdate':_0xf755('0x3'),'afterDestroy':_0xf755('0x4')};function emitEvent(_0x39d03e){return function(_0x434b33,_0x42b633,_0x2ee9e0){SmsMessageEvents['emit'](_0x39d03e+':'+_0x434b33['id'],_0x434b33);SmsMessageEvents[_0xf755('0x5')](_0x39d03e,_0x434b33);_0x2ee9e0(null);};}for(var e in events){if(events[_0xf755('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xf755('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c70c0b5..e7cdc99 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 _0xd64f=['total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','authToken','POST','https://smsapi.connectel.se/api/v2/send/','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','head','data','message_id','clickSend','plivo','senderString','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','lodash','util','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','phone','accountSid','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','user_key','session_key'];(function(_0x7d0b74,_0x3d0a04){var _0x4677d2=function(_0x8137b8){while(--_0x8137b8){_0x7d0b74['push'](_0x7d0b74['shift']());}};_0x4677d2(++_0x3d0a04);}(_0xd64f,0xc0));var _0xfd64=function(_0x4a8275,_0x25341a){_0x4a8275=_0x4a8275-0x0;var _0x272b86=_0xd64f[_0x4a8275];return _0x272b86;};'use strict';var _=require(_0xfd64('0x0'));var util=require(_0xfd64('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfd64('0x2'));var BPromise=require(_0xfd64('0x3'));var rp=require(_0xfd64('0x4'));var fs=require('fs');var path=require(_0xfd64('0x5'));var rimraf=require(_0xfd64('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd64('0x7'));module[_0xfd64('0x8')]=function(_0x52974e,_0x2a9767){return _0x52974e[_0xfd64('0x9')]('SmsMessage',attributes,{'tableName':_0xfd64('0xa'),'paranoid':![],'indexes':[{'name':_0xfd64('0xb'),'fields':['messageId']},{'name':_0xfd64('0xc'),'fields':[_0xfd64('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2dc4d1,_0x412a00,_0x53c47b){var _0x42c1dd=_0x52974e[_0xfd64('0xe')];var _0x4a3c97=_0x2dc4d1[_0xfd64('0xf')]({'plain':!![]});if(_0x4a3c97[_0xfd64('0x10')][_0xfd64('0x11')]()==='in'||_0x4a3c97['direction']['toLowerCase']()===_0xfd64('0x12')&&!_0x4a3c97[_0xfd64('0x13')]&&!_[_0xfd64('0x14')](_0x4a3c97[_0xfd64('0x15')])&&!_[_0xfd64('0x14')](_0x4a3c97[_0xfd64('0x16')])){_0x42c1dd[_0xfd64('0x17')][_0xfd64('0x18')]({'where':{'id':_0x4a3c97['SmsInteractionId']}})[_0xfd64('0x19')](function(_0x3c46ac){if(_0x3c46ac){_0x3c46ac[_0xfd64('0x1a')]({'lastMsgAt':_0x4a3c97[_0xfd64('0x1b')],'lastMsgDirection':_0x4a3c97['direction'][_0xfd64('0x11')]()});}})[_0xfd64('0x1c')](function(_0x7a6f42){console[_0xfd64('0x1d')](_0x7a6f42);});}if(_0x4a3c97[_0xfd64('0x10')]===_0xfd64('0x12')&&!_0x4a3c97['secret']){var _0x1a0d3d;_0x42c1dd[_0xfd64('0x1e')][_0xfd64('0x1f')]({'where':{'id':_0x4a3c97[_0xfd64('0x20')]},'raw':!![]})[_0xfd64('0x19')](function(_0x46847c){_0x1a0d3d=_0x46847c;if(_0x1a0d3d&&_0x1a0d3d[_0xfd64('0x21')]){switch(_0x1a0d3d[_0xfd64('0x21')]){case _0xfd64('0x22'):var _0x213e7d=require('twilio');if(_0x1a0d3d['accountSid']&&_0x1a0d3d['authToken']&&_0x1a0d3d[_0xfd64('0x23')]){var _0x22cc09=new _0x213e7d(_0x1a0d3d[_0xfd64('0x24')],_0x1a0d3d['authToken']);_0x22cc09[_0xfd64('0x25')][_0xfd64('0x26')]({'body':_0x4a3c97[_0xfd64('0xd')],'to':_0x4a3c97[_0xfd64('0x23')],'from':_0x1a0d3d[_0xfd64('0x23')],'statusCallback':_0x1a0d3d[_0xfd64('0x27')]+_0xfd64('0x28')+_0x4a3c97['id']+_0xfd64('0x29')+_0x1a0d3d[_0xfd64('0x2a')]})[_0xfd64('0x19')](function(_0x97f199){if(_0x97f199[_0xfd64('0x2b')]){return _0x2dc4d1[_0xfd64('0x1a')]({'messageId':_0x97f199[_0xfd64('0x2b')]});}})['catch'](function(_0x5a75eb){logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x22'),util[_0xfd64('0x2e')](_0x5a75eb,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),'twilio',_0xfd64('0x2f'));}break;case _0xfd64('0x30'):var _0x2700c8=_0xfd64('0x31');if(_0x1a0d3d[_0xfd64('0x32')]&&_0x1a0d3d[_0xfd64('0x33')]){var _0x40f863={'recipient':[_0x4a3c97[_0xfd64('0x23')]],'message':_0x4a3c97[_0xfd64('0xd')],'message_type':_0x1a0d3d[_0xfd64('0x34')]};if(_0x1a0d3d['smsMethod']&&_0x1a0d3d[_0xfd64('0x34')]!=='SI'){_0x40f863[_0xfd64('0x35')]=_0x1a0d3d[_0xfd64('0x23')];}var _0x2725ff={'url':_0x2700c8+_0xfd64('0x36')+_0x1a0d3d['username']+_0xfd64('0x37')+_0x1a0d3d[_0xfd64('0x33')],'method':'GET'};rp(_0x2725ff)['then'](function(_0x144487){var _0x326a8f=_0x144487[_0xfd64('0x38')](';');var _0x593cff={'user_key':_0x326a8f[0x0],'session_key':_0x326a8f[0x1]};_0x2725ff={'url':_0x2700c8+_0xfd64('0x39'),'method':'POST','headers':{'user_key':_0x593cff[_0xfd64('0x3a')],'Session_key':_0x593cff[_0xfd64('0x3b')]},'json':!![],'body':_0x40f863};return rp(_0x2725ff);})[_0xfd64('0x19')](function(_0x5270aa){if(_0x5270aa[_0xfd64('0x3c')]>=0x1){var _0x379bcf={'messageId':_0x5270aa[_0xfd64('0x3d')]};if(_0x1a0d3d['smsMethod']!=='GP'||!_0x1a0d3d[_0xfd64('0x3e')]){_0x379bcf[_0xfd64('0x3f')]=!![];}return _0x2dc4d1[_0xfd64('0x1a')](_0x379bcf);}else{return logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x30'),util['inspect'](_0x5270aa,{'showHidden':![],'depth':null}));}})[_0xfd64('0x1c')](function(_0x4c37e0){return logger['error'](_0xfd64('0x2c'),'afterCreate',_0xfd64('0x30'),util[_0xfd64('0x2e')](_0x4c37e0,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x30'),_0xfd64('0x40'));}break;case _0xfd64('0x41'):if(_0x1a0d3d[_0xfd64('0x42')]){var _0x45504c={'recipient':_0x4a3c97[_0xfd64('0x23')],'message':_0x4a3c97[_0xfd64('0xd')],'sender':_0x1a0d3d['senderString']||_0x1a0d3d['phone'],'authorization':_0x1a0d3d[_0xfd64('0x42')]};var _0x412a00={'method':_0xfd64('0x43'),'uri':_0xfd64('0x44'),'body':_0x45504c,'json':!![]};rp(_0x412a00)[_0xfd64('0x19')](function(_0x1ab91c){var _0x2cafb6={'messageId':_0x1ab91c['requestid']};if(!_0x1a0d3d[_0xfd64('0x3e')]){_0x2cafb6['read']=!![];}return _0x2dc4d1[_0xfd64('0x1a')](_0x2cafb6);})[_0xfd64('0x1c')](function(_0x439d68){logger['error'](_0xfd64('0x2c'),_0xfd64('0x2d'),'connectel',util[_0xfd64('0x2e')](_0x439d68,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x41'),'Missing\x20parameters:\x20authToken');}break;case _0xfd64('0x45'):if(_0x1a0d3d[_0xfd64('0x32')]&&_0x1a0d3d['password']){var _0x45504c={'messages':[{'source':_0xfd64('0x46'),'to':_0x4a3c97[_0xfd64('0x23')],'body':_0x4a3c97[_0xfd64('0xd')],'from':_0x1a0d3d['senderString']||_0x1a0d3d['phone']}]};var _0x45dfad=util[_0xfd64('0x47')](_0xfd64('0x48'),_0x1a0d3d[_0xfd64('0x32')],_0x1a0d3d[_0xfd64('0x33')]);var _0x412a00={'method':_0xfd64('0x43'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x45504c,'headers':{'Authorization':util[_0xfd64('0x47')](_0xfd64('0x49'),new Buffer(_0x45dfad)[_0xfd64('0x4a')]('base64'))},'json':!![]};rp(_0x412a00)[_0xfd64('0x19')](function(_0x435c5f){if(_0x435c5f[_0xfd64('0x4b')]>=0xc8&&_0x435c5f[_0xfd64('0x4b')]<=0xce){if(_0x435c5f['data']&&_0x435c5f['data']['queued_count']>0x0){var _0x3e8e89=_[_0xfd64('0x4c')](_0x435c5f[_0xfd64('0x4d')][_0xfd64('0x25')]);var _0x39afb8={'messageId':_0x3e8e89[_0xfd64('0x4e')]};if(!_0x1a0d3d['deliveryReport']){_0x39afb8['read']=!![];}return _0x2dc4d1[_0xfd64('0x1a')](_0x39afb8);}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x4f'),util[_0xfd64('0x2e')](_0x435c5f,{'showHidden':![],'depth':null}));}}else{logger[_0xfd64('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfd64('0x2d'),_0xfd64('0x4f'),util['inspect'](_0x435c5f,{'showHidden':![],'depth':null}));}})[_0xfd64('0x1c')](function(_0x4a120d){logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),'clickSend',util[_0xfd64('0x2e')](_0x4a120d,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfd64('0x2d'),'clickSend',_0xfd64('0x40'));}break;case _0xfd64('0x50'):if(_0x1a0d3d['authId']&&_0x1a0d3d[_0xfd64('0x42')]){var _0x45504c={'dst':_0x4a3c97[_0xfd64('0x23')],'text':_0x4a3c97[_0xfd64('0xd')],'src':_0x1a0d3d[_0xfd64('0x51')]||_0x1a0d3d['phone'],'url':_0x1a0d3d['remote']+'/api/sms/messages/'+_0x4a3c97['id']+_0xfd64('0x29')+_0x1a0d3d['token']};var _0x45dfad=util[_0xfd64('0x47')](_0xfd64('0x48'),_0x1a0d3d[_0xfd64('0x52')],_0x1a0d3d['authToken']);var _0x412a00={'method':_0xfd64('0x43'),'uri':util[_0xfd64('0x47')](_0xfd64('0x53'),_0x1a0d3d[_0xfd64('0x52')]),'body':_0x45504c,'headers':{'Authorization':util[_0xfd64('0x47')](_0xfd64('0x49'),new Buffer(_0x45dfad)[_0xfd64('0x4a')](_0xfd64('0x54')))},'json':!![]};rp(_0x412a00)[_0xfd64('0x19')](function(_0x2289c8){var _0x50f496={'messageId':_0x2289c8[_0xfd64('0x55')][0x0]};return _0x2dc4d1['update'](_0x50f496);})['catch'](function(_0x2ae36d){logger['error'](_0xfd64('0x2c'),'afterCreate',_0xfd64('0x50'),util[_0xfd64('0x2e')](_0x2ae36d,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xfd64('0x56'):if(_0x1a0d3d['username']&&_0x1a0d3d[_0xfd64('0x33')]){if(_0x1a0d3d[_0xfd64('0x57')]){var _0xc8e890={'method':_0xfd64('0x43'),'uri':_0x1a0d3d[_0xfd64('0x57')]+_0xfd64('0x58'),'body':{'username':_0x1a0d3d[_0xfd64('0x32')],'password':_0x1a0d3d[_0xfd64('0x33')]},'json':!![]};return rp(_0xc8e890)['then'](function(_0x6560e4){var _0x83dbcf={'method':_0xfd64('0x43'),'uri':_0x1a0d3d['baseUrl']+_0xfd64('0x59'),'body':{'messages':[{'from':_0x1a0d3d[_0xfd64('0x23')],'destinations':[{'to':_0x4a3c97['phone']}],'text':_0x4a3c97[_0xfd64('0xd')],'notifyUrl':_0x1a0d3d[_0xfd64('0x27')]+_0xfd64('0x28')+_0x4a3c97['id']+_0xfd64('0x29')+_0x1a0d3d[_0xfd64('0x2a')],'notifyContentType':_0xfd64('0x5a'),'callbackData':_0x1a0d3d[_0xfd64('0x23')]+';'+_0x4a3c97['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x6560e4[_0xfd64('0x2a')]},'json':!![]};return rp(_0x83dbcf)['then'](function(_0x370182){if(_0x370182[_0xfd64('0x25')]){var _0xf2cf81={'messageId':_0x370182[_0xfd64('0x25')][0x0]['messageId']};if(!_0x1a0d3d[_0xfd64('0x3e')]){_0xf2cf81[_0xfd64('0x3f')]=!![];}return _0x2dc4d1[_0xfd64('0x1a')](_0xf2cf81);}else{return logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x56'),util[_0xfd64('0x2e')](_0x370182,{'showHidden':![],'depth':null}));}});})[_0xfd64('0x1c')](function(_0x55e2f8){return logger[_0xfd64('0x1d')](_0xfd64('0x2c'),'afterCreate',_0xfd64('0x56'),util['inspect'](_0x55e2f8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfd64('0x2c'),_0xfd64('0x2d'),'infobip',_0xfd64('0x5b'));}}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x56'),_0xfd64('0x40'));}break;case _0xfd64('0x5c'):var _0x19fdf6=require(_0xfd64('0x5d'));if(_0x1a0d3d[_0xfd64('0x5e')]){var _0x371956={};_0x371956[_0xfd64('0x5f')]=_0x1a0d3d['username'];_0x371956[_0xfd64('0x23')]=_0x4a3c97[_0xfd64('0x23')];_0x371956[_0xfd64('0x35')]=_0x1a0d3d[_0xfd64('0x23')];_0x371956[_0xfd64('0x60')]=_0x4a3c97['body'];_0x371956['timestamp']=+new Date();var _0x2dce78='';var _0x5d5eae='';var _0x2dbccc=Object[_0xfd64('0x61')](_0x371956);_0x2dbccc[_0xfd64('0x62')]();for(var _0x22d6d5=0x0;_0x22d6d5<_0x2dbccc[_0xfd64('0x63')];_0x22d6d5++){if(_0x2dce78!=''){_0x2dce78+='&';}_0x2dce78+=_0x2dbccc[_0x22d6d5]+'='+encodeURIComponent(_0x371956[_0x2dbccc[_0x22d6d5]]);_0x5d5eae+=_0x371956[_0x2dbccc[_0x22d6d5]];}_0x5d5eae+=_0x1a0d3d[_0xfd64('0x5e')];_0x5d5eae=_0x19fdf6['createHash'](_0xfd64('0x64'))[_0xfd64('0x1a')](_0x5d5eae)[_0xfd64('0x65')](_0xfd64('0x66'));if(_0x2dce78!==''){_0x2dce78+='&';}_0x2dce78+=_0xfd64('0x67')+_0x5d5eae;var _0x2725ff={'method':_0xfd64('0x68'),'uri':_0x1a0d3d[_0xfd64('0x57')]+_0xfd64('0x69')+_0x2dce78,'json':!![]};return rp(_0x2725ff)[_0xfd64('0x19')](function(_0x410c1b){var _0x17ca2b=Object['keys'](_0x410c1b);if(_0x410c1b[_0x17ca2b[0x0]][_0xfd64('0x1d')]&&parseInt(_0x410c1b[_0x17ca2b[0x0]]['error'])===0x0){var _0x3db2d0={'messageId':_0x410c1b[_0x17ca2b[0x0]][_0xfd64('0x6a')]};if(!_0x1a0d3d['deliveryReport']){_0x3db2d0[_0xfd64('0x3f')]=!![];}return _0x2dc4d1[_0xfd64('0x1a')](_0x3db2d0);}else{return logger[_0xfd64('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfd64('0x2d'),'csc',util['inspect'](_0x410c1b['error'],{'showHidden':![],'depth':null}));}})[_0xfd64('0x1c')](function(_0x540472){return logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),'csc',util[_0xfd64('0x2e')](_0x540472,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x5c'),_0xfd64('0x6b'));}break;case _0xfd64('0x6c'):if(_0x1a0d3d[_0xfd64('0x5e')]){var _0x30f88d={'method':_0xfd64('0x43'),'uri':_0xfd64('0x6d'),'headers':{'Authorization':_0x1a0d3d[_0xfd64('0x5e')]},'body':{'content':_0x4a3c97[_0xfd64('0xd')],'to':[_0x4a3c97[_0xfd64('0x23')]],'from':_0x1a0d3d[_0xfd64('0x23')],'binary':![],'clientMessageId':_0xfd64('0x6e'),'charset':_0xfd64('0x6f')},'json':!![]};rp(_0x30f88d)[_0xfd64('0x19')](function(_0x3f8833){if(!_0x3f8833[_0xfd64('0x1d')]){var _0xc70a20={'messageId':_0x3f8833[_0xfd64('0x25')][0x0][_0xfd64('0x70')]};if(!_0x1a0d3d[_0xfd64('0x3e')]){_0xc70a20['read']=!![];}return _0x2dc4d1[_0xfd64('0x1a')](_0xc70a20);}else{return logger[_0xfd64('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfd64('0x6c'),util[_0xfd64('0x2e')](_0x3f8833[_0xfd64('0x1d')],{'showHidden':![],'depth':null}));}})[_0xfd64('0x1c')](function(_0xdf08af){return logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),'clickatell',util[_0xfd64('0x2e')](_0xdf08af,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),'afterCreate',_0xfd64('0x6c'),_0xfd64('0x6b'));}break;case _0xfd64('0x71'):if(_0x1a0d3d['username']&&_0x1a0d3d[_0xfd64('0x33')]){var _0x45dfad=util[_0xfd64('0x47')](_0xfd64('0x48'),_0x1a0d3d[_0xfd64('0x32')],_0x1a0d3d[_0xfd64('0x33')]);var _0x412a00={'method':_0xfd64('0x43'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1a0d3d[_0xfd64('0x72')]+_0xfd64('0x73'),'body':{'to':[_0x4a3c97[_0xfd64('0x23')]],'text':_0x4a3c97[_0xfd64('0xd')],'from':_0x1a0d3d[_0xfd64('0x23')],'applicationId':_0x1a0d3d[_0xfd64('0x74')]},'headers':{'Authorization':util[_0xfd64('0x47')](_0xfd64('0x49'),new Buffer(_0x45dfad)['toString'](_0xfd64('0x54')))},'json':!![]};rp(_0x412a00)[_0xfd64('0x19')](function(_0x539db9){if(_0x539db9['id']){var _0x1a5c7b={'messageId':_0x539db9['id']};return _0x2dc4d1['update'](_0x1a5c7b);}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),'bandwidth',util['inspect'](_0x539db9,{'showHidden':![],'depth':null}));}})['catch'](function(_0x35493f){logger[_0xfd64('0x1d')](_0xfd64('0x2c'),'afterCreate',_0xfd64('0x71'),util[_0xfd64('0x2e')](_0x35493f,{'showHidden':![],'depth':null}));});}else{logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x71'),_0xfd64('0x40'));}break;case _0xfd64('0x75'):if(_0x1a0d3d[_0xfd64('0x5e')]){var _0x341250={};var _0x2725ff={'method':'POST','uri':_0xfd64('0x76'),'headers':{'Authorization':'Bearer\x20'+_0x1a0d3d['apiKey'],'Content-Type':_0xfd64('0x5a')},'body':{'from':_0x1a0d3d['phone'],'to':_0x4a3c97['phone'],'text':_0x4a3c97[_0xfd64('0xd')]},'json':!![]};return rp(_0x2725ff)[_0xfd64('0x19')](function(_0x39259c){if(_0x39259c[_0xfd64('0x77')]==0xca){_0x341250[_0xfd64('0x78')]=_0x39259c;var _0x3dd4bf={'method':_0xfd64('0x43'),'uri':_0xfd64('0x79'),'headers':{'Authorization':'Bearer\x20'+_0x1a0d3d[_0xfd64('0x5e')],'Content-Type':_0xfd64('0x5a')},'body':{'refid':_0x341250[_0xfd64('0x78')][_0xfd64('0x7a')]},'json':!![]};return rp(_0x3dd4bf)[_0xfd64('0x19')](function(_0x925c6a){_0x341250[_0xfd64('0x7b')]=_0x925c6a;var _0x4dac9b={'messageId':_0x341250[_0xfd64('0x78')][_0xfd64('0x7a')],'read':!![]};return _0x2dc4d1['update'](_0x4dac9b);});}else{return logger['error'](_0xfd64('0x2c'),_0xfd64('0x2d'),'intelepeer',util['inspect'](_0x39259c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x749124){return logger[_0xfd64('0x1d')](_0xfd64('0x2c'),_0xfd64('0x2d'),_0xfd64('0x75'),util[_0xfd64('0x2e')](_0x749124,{'showHidden':![],'depth':null}));});}else{return logger[_0xfd64('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfd64('0x2d'),'intelepeer',_0xfd64('0x7c'));}break;}}})[_0xfd64('0x7d')](function(){_0x53c47b();});}else{_0x53c47b();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0c61=['username','password','smsMethod','sender','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','messages','message_id','catch','clickSend','plivo','/status?token=','%s:%s','authId','Basic\x20%s','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20username,\x20password','crypto','apiKey','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','keys','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','SmsMessage','messageId','fti_sms_messages','FULLTEXT','models','get','direction','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','toLowerCase','error','SmsAccount','find','type','twilio','phone','authToken','body','remote','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby'];(function(_0x4f8e52,_0x2d0050){var _0x55f89c=function(_0x5b6af0){while(--_0x5b6af0){_0x4f8e52['push'](_0x4f8e52['shift']());}};_0x55f89c(++_0x2d0050);}(_0x0c61,0x13c));var _0x10c6=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x0c61[_0x337748];return _0x3bb03f;};'use strict';var _=require(_0x10c6('0x0'));var util=require('util');var logger=require(_0x10c6('0x1'))('api');var moment=require(_0x10c6('0x2'));var BPromise=require('bluebird');var rp=require(_0x10c6('0x3'));var fs=require('fs');var path=require(_0x10c6('0x4'));var rimraf=require(_0x10c6('0x5'));var config=require(_0x10c6('0x6'));var attributes=require('./smsMessage.attributes');module[_0x10c6('0x7')]=function(_0x15a088,_0xe2acac){return _0x15a088['define'](_0x10c6('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x10c6('0x9'),'fields':[_0x10c6('0x9')]},{'name':_0x10c6('0xa'),'fields':['body'],'type':_0x10c6('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a8fc6,_0x32fb63,_0xd2e6cb){var _0x118703=_0x15a088[_0x10c6('0xc')];var _0x354066=_0x1a8fc6[_0x10c6('0xd')]({'plain':!![]});if(_0x354066[_0x10c6('0xe')]['toLowerCase']()==='in'||_0x354066[_0x10c6('0xe')]['toLowerCase']()==='out'&&!_0x354066[_0x10c6('0xf')]&&!_[_0x10c6('0x10')](_0x354066['UserId'])&&!_[_0x10c6('0x10')](_0x354066[_0x10c6('0x11')])){_0x118703[_0x10c6('0x12')][_0x10c6('0x13')]({'where':{'id':_0x354066[_0x10c6('0x11')]}})[_0x10c6('0x14')](function(_0x778a6d){if(_0x778a6d){_0x778a6d['update']({'lastMsgAt':_0x354066[_0x10c6('0x15')],'lastMsgDirection':_0x354066[_0x10c6('0xe')][_0x10c6('0x16')]()});}})['catch'](function(_0x1db54a){console[_0x10c6('0x17')](_0x1db54a);});}if(_0x354066[_0x10c6('0xe')]==='out'&&!_0x354066[_0x10c6('0xf')]){var _0x39447e;_0x118703[_0x10c6('0x18')][_0x10c6('0x19')]({'where':{'id':_0x354066['SmsAccountId']},'raw':!![]})[_0x10c6('0x14')](function(_0x539c24){_0x39447e=_0x539c24;if(_0x39447e&&_0x39447e[_0x10c6('0x1a')]){switch(_0x39447e[_0x10c6('0x1a')]){case'twilio':var _0x17c9fc=require(_0x10c6('0x1b'));if(_0x39447e['accountSid']&&_0x39447e['authToken']&&_0x39447e[_0x10c6('0x1c')]){var _0x44463d=new _0x17c9fc(_0x39447e['accountSid'],_0x39447e[_0x10c6('0x1d')]);_0x44463d['messages']['create']({'body':_0x354066[_0x10c6('0x1e')],'to':_0x354066[_0x10c6('0x1c')],'from':_0x39447e[_0x10c6('0x1c')],'statusCallback':_0x39447e[_0x10c6('0x1f')]+_0x10c6('0x20')+_0x354066['id']+'/status?token='+_0x39447e[_0x10c6('0x21')]})[_0x10c6('0x14')](function(_0x23dae7){if(_0x23dae7[_0x10c6('0x22')]){return _0x1a8fc6[_0x10c6('0x23')]({'messageId':_0x23dae7['sid']});}})['catch'](function(_0x307d32){logger[_0x10c6('0x17')](_0x10c6('0x24'),'afterCreate',_0x10c6('0x1b'),util[_0x10c6('0x25')](_0x307d32,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),'twilio',_0x10c6('0x27'));}break;case _0x10c6('0x28'):var _0x535f47='https://api.skebby.it/API/v1.0/REST/';if(_0x39447e[_0x10c6('0x29')]&&_0x39447e[_0x10c6('0x2a')]){var _0x9926fb={'recipient':[_0x354066['phone']],'message':_0x354066[_0x10c6('0x1e')],'message_type':_0x39447e[_0x10c6('0x2b')]};if(_0x39447e[_0x10c6('0x2b')]&&_0x39447e[_0x10c6('0x2b')]!=='SI'){_0x9926fb[_0x10c6('0x2c')]=_0x39447e[_0x10c6('0x1c')];}var _0x248f72={'url':_0x535f47+'login?username='+_0x39447e[_0x10c6('0x29')]+_0x10c6('0x2d')+_0x39447e[_0x10c6('0x2a')],'method':_0x10c6('0x2e')};rp(_0x248f72)[_0x10c6('0x14')](function(_0x2424e7){var _0x117abf=_0x2424e7[_0x10c6('0x2f')](';');var _0x1a1b3e={'user_key':_0x117abf[0x0],'session_key':_0x117abf[0x1]};_0x248f72={'url':_0x535f47+_0x10c6('0x30'),'method':_0x10c6('0x31'),'headers':{'user_key':_0x1a1b3e[_0x10c6('0x32')],'Session_key':_0x1a1b3e['session_key']},'json':!![],'body':_0x9926fb};return rp(_0x248f72);})[_0x10c6('0x14')](function(_0x11c3ae){if(_0x11c3ae[_0x10c6('0x33')]>=0x1){var _0x518851={'messageId':_0x11c3ae[_0x10c6('0x34')]};if(_0x39447e['smsMethod']!=='GP'||!_0x39447e[_0x10c6('0x35')]){_0x518851[_0x10c6('0x36')]=!![];}return _0x1a8fc6['update'](_0x518851);}else{return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'skebby',util[_0x10c6('0x25')](_0x11c3ae,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5dca2d){return logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x28'),util[_0x10c6('0x25')](_0x5dca2d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x28'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x10c6('0x37'):if(_0x39447e['authToken']){var _0x5e6e4a={'recipient':_0x354066[_0x10c6('0x1c')],'message':_0x354066[_0x10c6('0x1e')],'sender':_0x39447e[_0x10c6('0x38')]||_0x39447e[_0x10c6('0x1c')],'authorization':_0x39447e[_0x10c6('0x1d')]};var _0x32fb63={'method':_0x10c6('0x31'),'uri':_0x10c6('0x39'),'body':_0x5e6e4a,'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x499441){var _0x4ad07f={'messageId':_0x499441['requestid']};if(!_0x39447e[_0x10c6('0x35')]){_0x4ad07f['read']=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x4ad07f);})['catch'](function(_0x538021){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x37'),util[_0x10c6('0x25')](_0x538021,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x37'),_0x10c6('0x3a'));}break;case _0x10c6('0x3b'):if(_0x39447e['username']&&_0x39447e['password']){var _0x5e6e4a={'messages':[{'source':_0x10c6('0x3c'),'to':_0x354066[_0x10c6('0x1c')],'body':_0x354066['body'],'from':_0x39447e[_0x10c6('0x38')]||_0x39447e['phone']}]};var _0x4a093a=util[_0x10c6('0x3d')]('%s:%s',_0x39447e[_0x10c6('0x29')],_0x39447e[_0x10c6('0x2a')]);var _0x32fb63={'method':_0x10c6('0x31'),'uri':_0x10c6('0x3e'),'body':_0x5e6e4a,'headers':{'Authorization':util[_0x10c6('0x3d')]('Basic\x20%s',new Buffer(_0x4a093a)[_0x10c6('0x3f')](_0x10c6('0x40')))},'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x5cc6b4){if(_0x5cc6b4[_0x10c6('0x41')]>=0xc8&&_0x5cc6b4[_0x10c6('0x41')]<=0xce){if(_0x5cc6b4[_0x10c6('0x42')]&&_0x5cc6b4['data'][_0x10c6('0x43')]>0x0){var _0x1d8de9=_[_0x10c6('0x44')](_0x5cc6b4[_0x10c6('0x42')][_0x10c6('0x45')]);var _0x2bdaf4={'messageId':_0x1d8de9[_0x10c6('0x46')]};if(!_0x39447e[_0x10c6('0x35')]){_0x2bdaf4[_0x10c6('0x36')]=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x2bdaf4);}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),'clickSend',util[_0x10c6('0x25')](_0x5cc6b4,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),'clickSend',util[_0x10c6('0x25')](_0x5cc6b4,{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x2e3b3f){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'clickSend',util[_0x10c6('0x25')](_0x2e3b3f,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10c6('0x26'),_0x10c6('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x10c6('0x49'):if(_0x39447e['authId']&&_0x39447e[_0x10c6('0x1d')]){var _0x5e6e4a={'dst':_0x354066['phone'],'text':_0x354066[_0x10c6('0x1e')],'src':_0x39447e[_0x10c6('0x38')]||_0x39447e[_0x10c6('0x1c')],'url':_0x39447e[_0x10c6('0x1f')]+_0x10c6('0x20')+_0x354066['id']+_0x10c6('0x4a')+_0x39447e[_0x10c6('0x21')]};var _0x4a093a=util[_0x10c6('0x3d')](_0x10c6('0x4b'),_0x39447e[_0x10c6('0x4c')],_0x39447e[_0x10c6('0x1d')]);var _0x32fb63={'method':_0x10c6('0x31'),'uri':util[_0x10c6('0x3d')]('https://api.plivo.com/v1/Account/%s/Message/',_0x39447e[_0x10c6('0x4c')]),'body':_0x5e6e4a,'headers':{'Authorization':util[_0x10c6('0x3d')](_0x10c6('0x4d'),new Buffer(_0x4a093a)[_0x10c6('0x3f')](_0x10c6('0x40')))},'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x23fef6){var _0x2658cd={'messageId':_0x23fef6['message_uuid'][0x0]};return _0x1a8fc6[_0x10c6('0x23')](_0x2658cd);})['catch'](function(_0x21c577){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'plivo',util[_0x10c6('0x25')](_0x21c577,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10c6('0x26'),'plivo',_0x10c6('0x4e'));}break;case _0x10c6('0x4f'):if(_0x39447e['username']&&_0x39447e[_0x10c6('0x2a')]){if(_0x39447e['baseUrl']){var _0x22bc98={'method':_0x10c6('0x31'),'uri':_0x39447e[_0x10c6('0x50')]+_0x10c6('0x51'),'body':{'username':_0x39447e[_0x10c6('0x29')],'password':_0x39447e[_0x10c6('0x2a')]},'json':!![]};return rp(_0x22bc98)['then'](function(_0x3bd314){var _0x5236c6={'method':_0x10c6('0x31'),'uri':_0x39447e[_0x10c6('0x50')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x39447e['phone'],'destinations':[{'to':_0x354066['phone']}],'text':_0x354066[_0x10c6('0x1e')],'notifyUrl':_0x39447e[_0x10c6('0x1f')]+_0x10c6('0x20')+_0x354066['id']+_0x10c6('0x4a')+_0x39447e[_0x10c6('0x21')],'notifyContentType':_0x10c6('0x52'),'callbackData':_0x39447e[_0x10c6('0x1c')]+';'+_0x354066[_0x10c6('0x1e')]}]},'headers':{'Authorization':_0x10c6('0x53')+_0x3bd314[_0x10c6('0x21')]},'json':!![]};return rp(_0x5236c6)[_0x10c6('0x14')](function(_0x32720a){if(_0x32720a[_0x10c6('0x45')]){var _0x1ea6b0={'messageId':_0x32720a[_0x10c6('0x45')][0x0][_0x10c6('0x9')]};if(!_0x39447e[_0x10c6('0x35')]){_0x1ea6b0[_0x10c6('0x36')]=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x1ea6b0);}else{return logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x4f'),util[_0x10c6('0x25')](_0x32720a,{'showHidden':![],'depth':null}));}});})[_0x10c6('0x47')](function(_0x3373e6){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x4f'),util[_0x10c6('0x25')](_0x3373e6,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10c6('0x26'),'infobip',_0x10c6('0x54'));}break;case'csc':var _0x566ec4=require(_0x10c6('0x55'));if(_0x39447e[_0x10c6('0x56')]){var _0x4b982a={};_0x4b982a['login']=_0x39447e[_0x10c6('0x29')];_0x4b982a[_0x10c6('0x1c')]=_0x354066[_0x10c6('0x1c')];_0x4b982a['sender']=_0x39447e[_0x10c6('0x1c')];_0x4b982a[_0x10c6('0x57')]=_0x354066[_0x10c6('0x1e')];_0x4b982a[_0x10c6('0x58')]=+new Date();var _0x290049='';var _0x459dce='';var _0x27f65f=Object['keys'](_0x4b982a);_0x27f65f[_0x10c6('0x59')]();for(var _0x4d9318=0x0;_0x4d9318<_0x27f65f[_0x10c6('0x5a')];_0x4d9318++){if(_0x290049!=''){_0x290049+='&';}_0x290049+=_0x27f65f[_0x4d9318]+'='+encodeURIComponent(_0x4b982a[_0x27f65f[_0x4d9318]]);_0x459dce+=_0x4b982a[_0x27f65f[_0x4d9318]];}_0x459dce+=_0x39447e['apiKey'];_0x459dce=_0x566ec4[_0x10c6('0x5b')](_0x10c6('0x5c'))['update'](_0x459dce)[_0x10c6('0x5d')](_0x10c6('0x5e'));if(_0x290049!==''){_0x290049+='&';}_0x290049+=_0x10c6('0x5f')+_0x459dce;var _0x248f72={'method':_0x10c6('0x2e'),'uri':_0x39447e[_0x10c6('0x50')]+_0x10c6('0x60')+_0x290049,'json':!![]};return rp(_0x248f72)['then'](function(_0x4bdb40){var _0x35e175=Object[_0x10c6('0x61')](_0x4bdb40);if(_0x4bdb40[_0x35e175[0x0]]['error']&&parseInt(_0x4bdb40[_0x35e175[0x0]]['error'])===0x0){var _0x1fe02f={'messageId':_0x4bdb40[_0x35e175[0x0]][_0x10c6('0x62')]};if(!_0x39447e['deliveryReport']){_0x1fe02f[_0x10c6('0x36')]=!![];}return _0x1a8fc6[_0x10c6('0x23')](_0x1fe02f);}else{return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x63'),util[_0x10c6('0x25')](_0x4bdb40[_0x10c6('0x17')],{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x15702c){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x63'),util[_0x10c6('0x25')](_0x15702c,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),'afterCreate',_0x10c6('0x63'),'Missing\x20parameters:\x20apiKey');}break;case _0x10c6('0x64'):if(_0x39447e['apiKey']){var _0x509853={'method':_0x10c6('0x31'),'uri':_0x10c6('0x65'),'headers':{'Authorization':_0x39447e[_0x10c6('0x56')]},'body':{'content':_0x354066[_0x10c6('0x1e')],'to':[_0x354066[_0x10c6('0x1c')]],'from':_0x39447e[_0x10c6('0x1c')],'binary':![],'clientMessageId':_0x10c6('0x66'),'charset':'UTF-8'},'json':!![]};rp(_0x509853)[_0x10c6('0x14')](function(_0x2ed41c){if(!_0x2ed41c['error']){var _0x671e47={'messageId':_0x2ed41c['messages'][0x0][_0x10c6('0x67')]};if(!_0x39447e[_0x10c6('0x35')]){_0x671e47[_0x10c6('0x36')]=!![];}return _0x1a8fc6['update'](_0x671e47);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0x10c6('0x25')](_0x2ed41c[_0x10c6('0x17')],{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x1d8550){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x64'),util[_0x10c6('0x25')](_0x1d8550,{'showHidden':![],'depth':null}));});}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),'afterCreate',_0x10c6('0x64'),_0x10c6('0x68'));}break;case _0x10c6('0x69'):if(_0x39447e[_0x10c6('0x29')]&&_0x39447e[_0x10c6('0x2a')]){var _0x4a093a=util['format'](_0x10c6('0x4b'),_0x39447e[_0x10c6('0x29')],_0x39447e[_0x10c6('0x2a')]);var _0x32fb63={'method':_0x10c6('0x31'),'uri':_0x10c6('0x6a')+_0x39447e[_0x10c6('0x6b')]+_0x10c6('0x6c'),'body':{'to':[_0x354066[_0x10c6('0x1c')]],'text':_0x354066[_0x10c6('0x1e')],'from':_0x39447e[_0x10c6('0x1c')],'applicationId':_0x39447e[_0x10c6('0x6d')]},'headers':{'Authorization':util[_0x10c6('0x3d')](_0x10c6('0x4d'),new Buffer(_0x4a093a)[_0x10c6('0x3f')]('base64'))},'json':!![]};rp(_0x32fb63)[_0x10c6('0x14')](function(_0x594054){if(_0x594054['id']){var _0x23e597={'messageId':_0x594054['id']};return _0x1a8fc6[_0x10c6('0x23')](_0x23e597);}else{logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x69'),util[_0x10c6('0x25')](_0x594054,{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x513dc2){logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x69'),util['inspect'](_0x513dc2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x69'),_0x10c6('0x54'));}break;case _0x10c6('0x6e'):if(_0x39447e[_0x10c6('0x56')]){var _0x5a965b={};var _0x248f72={'method':_0x10c6('0x31'),'uri':_0x10c6('0x6f'),'headers':{'Authorization':_0x10c6('0x70')+_0x39447e['apiKey'],'Content-Type':_0x10c6('0x52')},'body':{'from':_0x39447e[_0x10c6('0x1c')],'to':_0x354066[_0x10c6('0x1c')],'text':_0x354066[_0x10c6('0x1e')]},'json':!![]};return rp(_0x248f72)['then'](function(_0x398ded){if(_0x398ded['code']==0xca){_0x5a965b['message']=_0x398ded;var _0xe4c411={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x39447e['apiKey'],'Content-Type':_0x10c6('0x52')},'body':{'refid':_0x5a965b[_0x10c6('0x71')]['refid']},'json':!![]};return rp(_0xe4c411)['then'](function(_0x4223b9){_0x5a965b['status']=_0x4223b9;var _0x562fb3={'messageId':_0x5a965b[_0x10c6('0x71')][_0x10c6('0x72')],'read':!![]};return _0x1a8fc6[_0x10c6('0x23')](_0x562fb3);});}else{return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x6e'),util[_0x10c6('0x25')](_0x398ded,{'showHidden':![],'depth':null}));}})[_0x10c6('0x47')](function(_0x304f16){return logger[_0x10c6('0x17')](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x6e'),util['inspect'](_0x304f16,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x10c6('0x24'),_0x10c6('0x26'),_0x10c6('0x6e'),_0x10c6('0x73'));}break;}}})[_0x10c6('0x74')](function(){_0xd2e6cb();});}else{_0xd2e6cb();}}},'charset':_0x10c6('0x75'),'collate':_0x10c6('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 22b7fe7..fd6f768 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 _0xe4b8=['socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SmsMessage','create','options','raw','CreateSmsMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3feccc,_0x5534c7){var _0x2c13b5=function(_0x59a2cd){while(--_0x59a2cd){_0x3feccc['push'](_0x3feccc['shift']());}};_0x2c13b5(++_0x5534c7);}(_0xe4b8,0x1e9));var _0x8e4b=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xe4b8[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var moment=require(_0x8e4b('0x2'));var BPromise=require(_0x8e4b('0x3'));var rs=require(_0x8e4b('0x4'));var fs=require('fs');var Redis=require(_0x8e4b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e4b('0x6'));var logger=require(_0x8e4b('0x7'))(_0x8e4b('0x8'));var config=require('../../config/environment');var jayson=require(_0x8e4b('0x9'));var client=jayson[_0x8e4b('0xa')][_0x8e4b('0xb')]({'port':0x232a});config[_0x8e4b('0xc')]=_[_0x8e4b('0xd')](config[_0x8e4b('0xc')],{'host':_0x8e4b('0xe'),'port':0x18eb});var socket=require(_0x8e4b('0xf'))(new Redis(config[_0x8e4b('0xc')]));require(_0x8e4b('0x10'))[_0x8e4b('0x11')](socket);function respondWithRpcPromise(_0x32662a,_0x1b4429,_0x814c73){return new BPromise(function(_0x2706df,_0x39f098){return client[_0x8e4b('0x12')](_0x32662a,_0x814c73)[_0x8e4b('0x13')](function(_0x5b0d18){logger[_0x8e4b('0x14')](_0x8e4b('0x15'),_0x1b4429,_0x8e4b('0x16'));logger[_0x8e4b('0x17')](_0x8e4b('0x18'),_0x1b4429,_0x8e4b('0x16'),JSON['stringify'](_0x5b0d18));if(_0x5b0d18[_0x8e4b('0x19')]){if(_0x5b0d18[_0x8e4b('0x19')][_0x8e4b('0x1a')]===0x1f4){logger[_0x8e4b('0x19')](_0x8e4b('0x15'),_0x1b4429,_0x5b0d18[_0x8e4b('0x19')][_0x8e4b('0x1b')]);return _0x39f098(_0x5b0d18[_0x8e4b('0x19')]['message']);}logger['error'](_0x8e4b('0x15'),_0x1b4429,_0x5b0d18[_0x8e4b('0x19')][_0x8e4b('0x1b')]);return _0x2706df(_0x5b0d18[_0x8e4b('0x19')][_0x8e4b('0x1b')]);}else{logger['info'](_0x8e4b('0x15'),_0x1b4429,'request\x20sent');_0x2706df(_0x5b0d18[_0x8e4b('0x1c')][_0x8e4b('0x1b')]);}})[_0x8e4b('0x1d')](function(_0x9152fd){logger['error'](_0x8e4b('0x15'),_0x1b4429,_0x9152fd);_0x39f098(_0x9152fd);});});}exports['CreateSmsMessage']=function(_0x4656d7){var _0x484de3=this;return new Promise(function(_0x36f3bf,_0x3406cd){return db[_0x8e4b('0x1e')][_0x8e4b('0x1f')](_0x4656d7['body'],{'raw':_0x4656d7[_0x8e4b('0x20')]?_0x4656d7[_0x8e4b('0x20')][_0x8e4b('0x21')]===undefined?!![]:![]:!![]})[_0x8e4b('0x13')](function(_0x40996f){logger[_0x8e4b('0x14')](_0x8e4b('0x22'),_0x4656d7);logger[_0x8e4b('0x17')](_0x8e4b('0x22'),_0x4656d7,JSON[_0x8e4b('0x23')](_0x40996f));_0x36f3bf(_0x40996f);})[_0x8e4b('0x1d')](function(_0x262e04){logger[_0x8e4b('0x19')](_0x8e4b('0x22'),_0x262e04['message'],_0x4656d7);_0x3406cd(_0x484de3[_0x8e4b('0x19')](0x1f4,_0x262e04[_0x8e4b('0x1b')]));});});}; \ No newline at end of file +var _0xd006=['error','code','message','result','create','body','options','raw','CreateSmsMessage','debug','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f5a40,_0x113dc4){var _0x5c6f32=function(_0x584e2b){while(--_0x584e2b){_0x3f5a40['push'](_0x3f5a40['shift']());}};_0x5c6f32(++_0x113dc4);}(_0xd006,0xeb));var _0x6d00=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xd006[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x6d00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6d00('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d00('0x2'));var db=require(_0x6d00('0x3'))['db'];var utils=require(_0x6d00('0x4'));var logger=require(_0x6d00('0x5'))(_0x6d00('0x6'));var config=require(_0x6d00('0x7'));var jayson=require(_0x6d00('0x8'));var client=jayson[_0x6d00('0x9')][_0x6d00('0xa')]({'port':0x232a});config[_0x6d00('0xb')]=_['defaults'](config[_0x6d00('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d00('0xc'))(new Redis(config[_0x6d00('0xb')]));require(_0x6d00('0xd'))[_0x6d00('0xe')](socket);function respondWithRpcPromise(_0x4fa0a4,_0x4458a8,_0x79ff29){return new BPromise(function(_0x54a188,_0xdb89c6){return client[_0x6d00('0xf')](_0x4fa0a4,_0x79ff29)[_0x6d00('0x10')](function(_0x272b30){logger[_0x6d00('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x6d00('0x12'));logger['debug'](_0x6d00('0x13'),_0x4458a8,_0x6d00('0x12'),JSON[_0x6d00('0x14')](_0x272b30));if(_0x272b30['error']){if(_0x272b30[_0x6d00('0x15')][_0x6d00('0x16')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x272b30['error']['message']);return _0xdb89c6(_0x272b30[_0x6d00('0x15')][_0x6d00('0x17')]);}logger[_0x6d00('0x15')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x272b30[_0x6d00('0x15')]['message']);return _0x54a188(_0x272b30[_0x6d00('0x15')][_0x6d00('0x17')]);}else{logger[_0x6d00('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x6d00('0x12'));_0x54a188(_0x272b30[_0x6d00('0x18')][_0x6d00('0x17')]);}})['catch'](function(_0x96351d){logger[_0x6d00('0x15')]('SmsMessage,\x20%s,\x20%s',_0x4458a8,_0x96351d);_0xdb89c6(_0x96351d);});});}exports['CreateSmsMessage']=function(_0x5c91f5){var _0x57498b=this;return new Promise(function(_0x2bb4ff,_0x17ea37){return db['SmsMessage'][_0x6d00('0x19')](_0x5c91f5[_0x6d00('0x1a')],{'raw':_0x5c91f5['options']?_0x5c91f5[_0x6d00('0x1b')][_0x6d00('0x1c')]===undefined?!![]:![]:!![]})[_0x6d00('0x10')](function(_0x2f462d){logger['info'](_0x6d00('0x1d'),_0x5c91f5);logger[_0x6d00('0x1e')]('CreateSmsMessage',_0x5c91f5,JSON['stringify'](_0x2f462d));_0x2bb4ff(_0x2f462d);})[_0x6d00('0x1f')](function(_0x1a32b7){logger[_0x6d00('0x15')]('CreateSmsMessage',_0x1a32b7[_0x6d00('0x17')],_0x5c91f5);_0x17ea37(_0x57498b['error'](0x1f4,_0x1a32b7[_0x6d00('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6b41e98..afe028f 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 _0xf549=['save','removeListener','length','./smsMessage.events'];(function(_0xe3979b,_0x3cd9d0){var _0x44b506=function(_0xec9595){while(--_0xec9595){_0xe3979b['push'](_0xe3979b['shift']());}};_0x44b506(++_0x3cd9d0);}(_0xf549,0xcf));var _0x9f54=function(_0x34f070,_0x155063){_0x34f070=_0x34f070-0x0;var _0x12fb44=_0xf549[_0x34f070];return _0x12fb44;};'use strict';var SmsMessageEvents=require(_0x9f54('0x0'));var events=[_0x9f54('0x1'),'remove','update'];function createListener(_0x5684e7,_0x3fab6b){return function(_0x4623c7){_0x3fab6b['emit'](_0x5684e7,_0x4623c7);};}function removeListener(_0x525f08,_0x2b1f4b){return function(){SmsMessageEvents[_0x9f54('0x2')](_0x525f08,_0x2b1f4b);};}exports['register']=function(_0x6b3e24){for(var _0xe72681=0x0,_0x10e514=events[_0x9f54('0x3')];_0xe72681<_0x10e514;_0xe72681++){var _0xd84787=events[_0xe72681];var _0x220f39=createListener('smsMessage:'+_0xd84787,_0x6b3e24);SmsMessageEvents['on'](_0xd84787,_0x220f39);}}; \ No newline at end of file +var _0x433b=['save','remove','update','emit','removeListener','length','./smsMessage.events'];(function(_0x405a51,_0x487278){var _0x395328=function(_0x19ffad){while(--_0x19ffad){_0x405a51['push'](_0x405a51['shift']());}};_0x395328(++_0x487278);}(_0x433b,0xc3));var _0xb433=function(_0x7c3553,_0x58020e){_0x7c3553=_0x7c3553-0x0;var _0x3d2fc5=_0x433b[_0x7c3553];return _0x3d2fc5;};'use strict';var SmsMessageEvents=require(_0xb433('0x0'));var events=[_0xb433('0x1'),_0xb433('0x2'),_0xb433('0x3')];function createListener(_0x44ff16,_0x412eb5){return function(_0x304dbb){_0x412eb5[_0xb433('0x4')](_0x44ff16,_0x304dbb);};}function removeListener(_0xaccdc6,_0x24a7eb){return function(){SmsMessageEvents[_0xb433('0x5')](_0xaccdc6,_0x24a7eb);};}exports['register']=function(_0x358835){for(var _0x2281b7=0x0,_0x537105=events[_0xb433('0x6')];_0x2281b7<_0x537105;_0x2281b7++){var _0x296a4c=events[_0x2281b7];var _0x511f54=createListener('smsMessage:'+_0x296a4c,_0x358835);SmsMessageEvents['on'](_0x296a4c,_0x511f54);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 423ce02..d38fa45 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 _0x6aef=['isAuthenticated','index','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','put','delete','/:id','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5be1ac,_0x5ee1f4){var _0x21b996=function(_0x377104){while(--_0x377104){_0x5be1ac['push'](_0x5be1ac['shift']());}};_0x21b996(++_0x5ee1f4);}(_0x6aef,0x151));var _0xf6ae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6aef[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf6ae('0x0'));var util=require(_0xf6ae('0x1'));var path=require(_0xf6ae('0x2'));var timeout=require(_0xf6ae('0x3'));var express=require(_0xf6ae('0x4'));var router=express[_0xf6ae('0x5')]();var fs_extra=require(_0xf6ae('0x6'));var auth=require(_0xf6ae('0x7'));var interaction=require(_0xf6ae('0x8'));var config=require(_0xf6ae('0x9'));var controller=require('./smsQueue.controller');router[_0xf6ae('0xa')]('/',auth[_0xf6ae('0xb')](),controller[_0xf6ae('0xc')]);router[_0xf6ae('0xa')]('/describe',auth[_0xf6ae('0xb')](),controller[_0xf6ae('0xd')]);router[_0xf6ae('0xa')]('/:id',auth[_0xf6ae('0xb')](),controller[_0xf6ae('0xe')]);router[_0xf6ae('0xa')](_0xf6ae('0xf'),auth[_0xf6ae('0xb')](),controller[_0xf6ae('0x10')]);router[_0xf6ae('0xa')](_0xf6ae('0x11'),auth[_0xf6ae('0xb')](),controller[_0xf6ae('0x12')]);router[_0xf6ae('0xa')](_0xf6ae('0x13'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xf6ae('0xb')](),controller[_0xf6ae('0x14')]);router[_0xf6ae('0x15')](_0xf6ae('0x11'),auth[_0xf6ae('0xb')](),controller[_0xf6ae('0x16')]);router['post'](_0xf6ae('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf6ae('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf6ae('0x18')](_0xf6ae('0x19'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xf6ae('0x11'),auth[_0xf6ae('0xb')](),controller[_0xf6ae('0x1a')]);router[_0xf6ae('0x18')](_0xf6ae('0x13'),auth[_0xf6ae('0xb')](),controller[_0xf6ae('0x1b')]);module[_0xf6ae('0x1c')]=router; \ No newline at end of file +var _0xb550=['removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb550,0x9d));var _0x0b55=function(_0xcdd9bf,_0x2ff687){_0xcdd9bf=_0xcdd9bf-0x0;var _0x3bf701=_0xb550[_0xcdd9bf];return _0x3bf701;};'use strict';var multer=require('multer');var util=require(_0x0b55('0x0'));var path=require(_0x0b55('0x1'));var timeout=require(_0x0b55('0x2'));var express=require(_0x0b55('0x3'));var router=express['Router']();var fs_extra=require(_0x0b55('0x4'));var auth=require(_0x0b55('0x5'));var interaction=require(_0x0b55('0x6'));var config=require(_0x0b55('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x0b55('0x8')](),controller[_0x0b55('0x9')]);router['get'](_0x0b55('0xa'),auth[_0x0b55('0x8')](),controller[_0x0b55('0xb')]);router[_0x0b55('0xc')](_0x0b55('0xd'),auth['isAuthenticated'](),controller[_0x0b55('0xe')]);router[_0x0b55('0xc')](_0x0b55('0xf'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x10')]);router[_0x0b55('0xc')](_0x0b55('0x11'),auth['isAuthenticated'](),controller[_0x0b55('0x12')]);router[_0x0b55('0xc')](_0x0b55('0x13'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x14')]);router['post']('/',auth[_0x0b55('0x8')](),controller['create']);router[_0x0b55('0x15')]('/:id/teams',auth[_0x0b55('0x8')](),controller[_0x0b55('0x16')]);router[_0x0b55('0x15')](_0x0b55('0x13'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x17')]);router[_0x0b55('0x18')]('/:id',auth[_0x0b55('0x8')](),controller[_0x0b55('0x19')]);router[_0x0b55('0x1a')](_0x0b55('0xd'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x1b')]);router[_0x0b55('0x1a')](_0x0b55('0x11'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x1c')]);router['delete'](_0x0b55('0x13'),auth[_0x0b55('0x8')](),controller[_0x0b55('0x1d')]);module[_0x0b55('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index a457a52..4a8577b 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 _0x484b=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x76759,_0x4100f4){var _0x23e273=function(_0x149e12){while(--_0x149e12){_0x76759['push'](_0x76759['shift']());}};_0x23e273(++_0x4100f4);}(_0x484b,0x164));var _0xb484=function(_0xee2e68,_0x280550){_0xee2e68=_0xee2e68-0x0;var _0x241e81=_0x484b[_0xee2e68];return _0x241e81;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb484('0x0')],'unique':_0xb484('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb484('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb484('0x3')](_0xb484('0x4'),_0xb484('0x5'),_0xb484('0x6'))}}; \ No newline at end of file +var _0x1892=['name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0xaf94e4,_0x278780){var _0x39bfa0=function(_0x23b23d){while(--_0x23b23d){_0xaf94e4['push'](_0xaf94e4['shift']());}};_0x39bfa0(++_0x278780);}(_0x1892,0x9d));var _0x2189=function(_0x111170,_0x12bcea){_0x111170=_0x111170-0x0;var _0x4c6bea=_0x1892[_0x111170];return _0x4c6bea;};'use strict';var Sequelize=require(_0x2189('0x0'));module[_0x2189('0x1')]={'name':{'type':Sequelize[_0x2189('0x2')],'unique':_0x2189('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2189('0x2')]},'timeout':{'type':Sequelize[_0x2189('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2189('0x5')](_0x2189('0x6'),_0x2189('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index f3f421c..2bb025c 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 _0x46db=['SmsQueueId','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','smsPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','redis','defaults','localhost','./smsQueue.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','sendStatus','error','name','send','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','order'];(function(_0xc02ad5,_0x5473a6){var _0x4b4f08=function(_0x3b1574){while(--_0x3b1574){_0xc02ad5['push'](_0xc02ad5['shift']());}};_0x4b4f08(++_0x5473a6);}(_0x46db,0x1da));var _0xb46d=function(_0x260b6f,_0x1edc36){_0x260b6f=_0x260b6f-0x0;var _0x3f672e=_0x46db[_0x260b6f];return _0x3f672e;};'use strict';var emlformat=require(_0xb46d('0x0'));var rimraf=require(_0xb46d('0x1'));var zipdir=require(_0xb46d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb46d('0x3'));var BPromise=require(_0xb46d('0x4'));var Mustache=require(_0xb46d('0x5'));var util=require(_0xb46d('0x6'));var path=require(_0xb46d('0x7'));var sox=require(_0xb46d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb46d('0x9'));var _=require(_0xb46d('0xa'));var squel=require(_0xb46d('0xb'));var crypto=require(_0xb46d('0xc'));var jsforce=require(_0xb46d('0xd'));var deskjs=require(_0xb46d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb46d('0xf'));var Papa=require(_0xb46d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb46d('0x11'));var as=require(_0xb46d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46d('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb46d('0x14'));var db=require('../../mysqldb')['db'];config[_0xb46d('0x15')]=_[_0xb46d('0x16')](config[_0xb46d('0x15')],{'host':_0xb46d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb46d('0x15')]));require(_0xb46d('0x18'))[_0xb46d('0x19')](socket);function respondWithStatusCode(_0x44b690,_0x5c3056){_0x5c3056=_0x5c3056||0xcc;return function(_0x40f761){if(_0x40f761){return _0x44b690['sendStatus'](_0x5c3056);}return _0x44b690['status'](_0x5c3056)['end']();};}function respondWithResult(_0x23a2bf,_0x5721de){_0x5721de=_0x5721de||0xc8;return function(_0x2847bc){if(_0x2847bc){return _0x23a2bf[_0xb46d('0x1a')](_0x5721de)[_0xb46d('0x1b')](_0x2847bc);}};}function respondWithFilteredResult(_0x52e076,_0x376b42){return function(_0x18a16a){if(_0x18a16a){var _0x3fe125=typeof _0x376b42[_0xb46d('0x1c')]==='undefined'&&typeof _0x376b42[_0xb46d('0x1d')]===_0xb46d('0x1e');var _0x1206b9=_0x18a16a['count'];var _0x59b0fc=_0x3fe125?0x0:_0x376b42[_0xb46d('0x1c')];var _0x477a90=_0x3fe125?_0x18a16a[_0xb46d('0x1f')]:_0x376b42[_0xb46d('0x1c')]+_0x376b42[_0xb46d('0x1d')];var _0x165613;if(_0x477a90>=_0x1206b9){_0x477a90=_0x1206b9;_0x165613=0xc8;}else{_0x165613=0xce;}_0x52e076['status'](_0x165613);return _0x52e076[_0xb46d('0x20')](_0xb46d('0x21'),_0x59b0fc+'-'+_0x477a90+'/'+_0x1206b9)[_0xb46d('0x1b')](_0x18a16a);}return null;};}function patchUpdates(_0x345903){return function(_0xd751ca){try{jsonpatch[_0xb46d('0x22')](_0xd751ca,_0x345903,!![]);}catch(_0x2b3e96){return BPromise['reject'](_0x2b3e96);}return _0xd751ca[_0xb46d('0x23')]();};}function saveUpdates(_0xb5a9f3,_0x5aba64){return function(_0x192670){if(_0x192670){return _0x192670[_0xb46d('0x24')](_0xb5a9f3)[_0xb46d('0x25')](function(_0x433184){return _0x433184;});}return null;};}function removeEntity(_0x124c1e,_0x259ad3){return function(_0x780d07){if(_0x780d07){return _0x780d07[_0xb46d('0x26')]()[_0xb46d('0x25')](function(){var _0x5355e5=_0x780d07[_0xb46d('0x27')]({'plain':!![]});var _0x1b253d=_0xb46d('0x28');return db[_0xb46d('0x29')][_0xb46d('0x26')]({'where':{'type':_0x1b253d,'resourceId':_0x5355e5['id']}})[_0xb46d('0x25')](function(){return _0x780d07;});})[_0xb46d('0x25')](function(){_0x124c1e['status'](0xcc)[_0xb46d('0x2a')]();});}};}function handleEntityNotFound(_0x129004,_0x3beb6c){return function(_0x3cb821){if(!_0x3cb821){_0x129004[_0xb46d('0x2b')](0x194);}return _0x3cb821;};}function handleError(_0x25a9a9,_0x3ffbed){_0x3ffbed=_0x3ffbed||0x1f4;return function(_0xedd0d5){logger[_0xb46d('0x2c')](_0xedd0d5['stack']);if(_0xedd0d5[_0xb46d('0x2d')]){delete _0xedd0d5['name'];}_0x25a9a9[_0xb46d('0x1a')](_0x3ffbed)[_0xb46d('0x2e')](_0xedd0d5);};}exports['index']=function(_0x3a13ae,_0x288060){var _0x2b1586={},_0x346d24={},_0x19b013={'count':0x0,'rows':[]};var _0x55b4db=_[_0xb46d('0x2f')](db[_0xb46d('0x30')][_0xb46d('0x31')],function(_0x4bc765){return{'name':_0x4bc765[_0xb46d('0x32')],'type':_0x4bc765[_0xb46d('0x33')]['key']};});_0x346d24[_0xb46d('0x34')]=_[_0xb46d('0x2f')](_0x55b4db,_0xb46d('0x2d'));_0x346d24[_0xb46d('0x35')]=_[_0xb46d('0x36')](_0x3a13ae[_0xb46d('0x35')]);_0x346d24['filters']=_[_0xb46d('0x37')](_0x346d24[_0xb46d('0x34')],_0x346d24[_0xb46d('0x35')]);_0x2b1586['attributes']=_[_0xb46d('0x37')](_0x346d24[_0xb46d('0x34')],qs['fields'](_0x3a13ae[_0xb46d('0x35')][_0xb46d('0x38')]));_0x2b1586[_0xb46d('0x39')]=_0x2b1586['attributes']['length']?_0x2b1586[_0xb46d('0x39')]:_0x346d24[_0xb46d('0x34')];if(!_0x3a13ae['query']['hasOwnProperty'](_0xb46d('0x3a'))){_0x2b1586[_0xb46d('0x1d')]=qs[_0xb46d('0x1d')](_0x3a13ae[_0xb46d('0x35')]['limit']);_0x2b1586[_0xb46d('0x1c')]=qs[_0xb46d('0x1c')](_0x3a13ae[_0xb46d('0x35')]['offset']);}_0x2b1586['order']=qs[_0xb46d('0x3b')](_0x3a13ae[_0xb46d('0x35')]['sort']);_0x2b1586['where']=qs[_0xb46d('0x3c')](_[_0xb46d('0x3d')](_0x3a13ae[_0xb46d('0x35')],_0x346d24[_0xb46d('0x3c')]),_0x55b4db);if(_0x3a13ae[_0xb46d('0x35')]['filter']){_0x2b1586['where']=_[_0xb46d('0x3e')](_0x2b1586[_0xb46d('0x3f')],{'$or':_['map'](_0x55b4db,function(_0x5139e4){if(_0x5139e4[_0xb46d('0x33')]!==_0xb46d('0x40')){var _0xcf5be6={};_0xcf5be6[_0x5139e4[_0xb46d('0x2d')]]={'$like':'%'+_0x3a13ae[_0xb46d('0x35')][_0xb46d('0x41')]+'%'};return _0xcf5be6;}})});}_0x2b1586=_[_0xb46d('0x3e')]({},_0x2b1586,_0x3a13ae[_0xb46d('0x42')]);var _0x3cb6bf={'where':_0x2b1586[_0xb46d('0x3f')]};return db[_0xb46d('0x30')][_0xb46d('0x1f')](_0x3cb6bf)[_0xb46d('0x25')](function(_0x343121){_0x19b013['count']=_0x343121;if(_0x3a13ae[_0xb46d('0x35')][_0xb46d('0x43')]){_0x2b1586[_0xb46d('0x44')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x2b1586);})[_0xb46d('0x25')](function(_0x485c5d){_0x19b013[_0xb46d('0x45')]=_0x485c5d;return _0x19b013;})[_0xb46d('0x25')](respondWithFilteredResult(_0x288060,_0x2b1586))[_0xb46d('0x46')](handleError(_0x288060,null));};exports[_0xb46d('0x47')]=function(_0x7f05b8,_0x33817b){var _0x500a68={'raw':!![],'where':{'id':_0x7f05b8['params']['id']}},_0x1cb26e={};_0x1cb26e['model']=_[_0xb46d('0x36')](db['SmsQueue']['rawAttributes']);_0x1cb26e[_0xb46d('0x35')]=_[_0xb46d('0x36')](_0x7f05b8[_0xb46d('0x35')]);_0x1cb26e[_0xb46d('0x3c')]=_[_0xb46d('0x37')](_0x1cb26e[_0xb46d('0x34')],_0x1cb26e[_0xb46d('0x35')]);_0x500a68[_0xb46d('0x39')]=_[_0xb46d('0x37')](_0x1cb26e[_0xb46d('0x34')],qs[_0xb46d('0x38')](_0x7f05b8['query'][_0xb46d('0x38')]));_0x500a68[_0xb46d('0x39')]=_0x500a68[_0xb46d('0x39')]['length']?_0x500a68[_0xb46d('0x39')]:_0x1cb26e[_0xb46d('0x34')];if(_0x7f05b8[_0xb46d('0x35')][_0xb46d('0x43')]){_0x500a68[_0xb46d('0x44')]=[{'all':!![]}];}_0x500a68=_[_0xb46d('0x3e')]({},_0x500a68,_0x7f05b8[_0xb46d('0x42')]);return db[_0xb46d('0x30')][_0xb46d('0x48')](_0x500a68)[_0xb46d('0x25')](handleEntityNotFound(_0x33817b,null))['then'](respondWithResult(_0x33817b,null))['catch'](handleError(_0x33817b,null));};exports['create']=function(_0x2c1f8d,_0x418820){return db[_0xb46d('0x30')]['create'](_0x2c1f8d[_0xb46d('0x49')],{})[_0xb46d('0x25')](function(_0x65dd62){var _0x5698cd=_0x2c1f8d[_0xb46d('0x4a')]['get']({'plain':!![]});if(!_0x5698cd)throw new Error(_0xb46d('0x4b'));if(_0x5698cd[_0xb46d('0x4c')]===_0xb46d('0x4a')){var _0x556532=_0x65dd62[_0xb46d('0x27')]({'plain':!![]});var _0x5360d6=_0xb46d('0x28');return db[_0xb46d('0x4d')]['find']({'where':{'name':_0x5360d6,'userProfileId':_0x5698cd[_0xb46d('0x4e')]},'raw':!![]})['then'](function(_0xeb94a6){if(_0xeb94a6&&_0xeb94a6[_0xb46d('0x4f')]===0x0){return db['UserProfileResource'][_0xb46d('0x50')]({'name':_0x556532[_0xb46d('0x2d')],'resourceId':_0x556532['id'],'type':_0xeb94a6[_0xb46d('0x2d')],'sectionId':_0xeb94a6['id']},{})[_0xb46d('0x25')](function(){return _0x65dd62;});}else{return _0x65dd62;}})[_0xb46d('0x46')](function(_0x3be61d){logger[_0xb46d('0x2c')](_0xb46d('0x51'),_0x3be61d);throw _0x3be61d;});}return _0x65dd62;})[_0xb46d('0x25')](respondWithResult(_0x418820,0xc9))['catch'](handleError(_0x418820,null));};exports[_0xb46d('0x24')]=function(_0x6c4429,_0x405c65){if(_0x6c4429[_0xb46d('0x49')]['id']){delete _0x6c4429['body']['id'];}return db[_0xb46d('0x30')][_0xb46d('0x48')]({'where':{'id':_0x6c4429['params']['id']}})['then'](handleEntityNotFound(_0x405c65,null))[_0xb46d('0x25')](saveUpdates(_0x6c4429[_0xb46d('0x49')],null))['then'](respondWithResult(_0x405c65,null))[_0xb46d('0x46')](handleError(_0x405c65,null));};exports[_0xb46d('0x26')]=function(_0x3f11b5,_0x3c6b2b){return db[_0xb46d('0x30')]['find']({'where':{'id':_0x3f11b5[_0xb46d('0x52')]['id']}})[_0xb46d('0x25')](handleEntityNotFound(_0x3c6b2b,null))['then'](removeEntity(_0x3c6b2b,null))[_0xb46d('0x46')](handleError(_0x3c6b2b,null));};exports['describe']=function(_0x51c027,_0x315ef0){return db['SmsQueue'][_0xb46d('0x53')]()[_0xb46d('0x25')](respondWithResult(_0x315ef0,null))['catch'](handleError(_0x315ef0,null));};exports[_0xb46d('0x54')]=function(_0x95e15b,_0xbf4ced,_0x53f7ec){var _0x4eba6f={'raw':!![],'where':{}},_0x1aa59c={},_0x206aa2;return db[_0xb46d('0x30')][_0xb46d('0x55')]({'where':{'id':_0x95e15b['params']['id']}})[_0xb46d('0x25')](handleEntityNotFound(_0xbf4ced,null))[_0xb46d('0x25')](function(_0x204f27){if(_0x204f27){_0x206aa2=_0x204f27[_0xb46d('0x27')]({'plain':!![]});_0x1aa59c[_0xb46d('0x34')]=_[_0xb46d('0x36')](db[_0xb46d('0x56')]['rawAttributes']);_0x1aa59c[_0xb46d('0x35')]=_[_0xb46d('0x36')](_0x95e15b[_0xb46d('0x35')]);_0x1aa59c['filters']=_[_0xb46d('0x37')](_0x1aa59c[_0xb46d('0x34')],_0x1aa59c[_0xb46d('0x35')]);_0x4eba6f['attributes']=_[_0xb46d('0x37')](_0x1aa59c[_0xb46d('0x34')],qs[_0xb46d('0x38')](_0x95e15b['query'][_0xb46d('0x38')]));_0x4eba6f['attributes']=_0x4eba6f[_0xb46d('0x39')][_0xb46d('0x57')]?_0x4eba6f[_0xb46d('0x39')]:_0x1aa59c[_0xb46d('0x34')];if(!_0x95e15b[_0xb46d('0x35')][_0xb46d('0x58')](_0xb46d('0x3a'))){_0x4eba6f[_0xb46d('0x1d')]=qs[_0xb46d('0x1d')](_0x95e15b[_0xb46d('0x35')][_0xb46d('0x1d')]);_0x4eba6f[_0xb46d('0x1c')]=qs['offset'](_0x95e15b['query']['offset']);}_0x4eba6f[_0xb46d('0x59')]=qs['sort'](_0x95e15b[_0xb46d('0x35')][_0xb46d('0x3b')]);_0x4eba6f['where']=qs[_0xb46d('0x3c')](_[_0xb46d('0x3d')](_0x95e15b[_0xb46d('0x35')],_0x1aa59c['filters']));_0x4eba6f['where'][_0xb46d('0x5a')]=_0x204f27['id'];if(_0x95e15b[_0xb46d('0x35')]['filter']){_0x4eba6f[_0xb46d('0x3f')]=_['merge'](_0x4eba6f[_0xb46d('0x3f')],{'$or':_[_0xb46d('0x2f')](_0x4eba6f[_0xb46d('0x39')],function(_0x471051){var _0x529c86={};_0x529c86[_0x471051]={'$like':'%'+_0x95e15b[_0xb46d('0x35')][_0xb46d('0x41')]+'%'};return _0x529c86;})});}_0x4eba6f=_[_0xb46d('0x3e')]({},_0x4eba6f,_0x95e15b[_0xb46d('0x42')]);return db[_0xb46d('0x56')][_0xb46d('0x5b')](_0x4eba6f);}})[_0xb46d('0x25')](function(_0x16cefb){if(_0x16cefb){return db[_0xb46d('0x5c')]['findAndCountAll']({'where':{'id':_[_0xb46d('0x2f')](_0x16cefb,_0xb46d('0x5d')),'role':_0xb46d('0x5e')},'attributes':['id','name','smsPause',_0xb46d('0x5f'),_0xb46d('0x60')]});}})['then'](function(_0x1048bf){if(_0x1048bf){return{'count':_0x1048bf['count'],'rows':_['map'](_0x1048bf[_0xb46d('0x45')],function(_0x42cfe9){return{'membername':_0x42cfe9['name'],'UserId':_0x42cfe9['id'],'queue_name':_0x206aa2['name'],'SmsQueueId':_0x206aa2['id'],'interface':util[_0xb46d('0x61')](_0xb46d('0x62'),_0xb46d('0x63'),_0x42cfe9[_0xb46d('0x2d')]),'penalty':0x0,'paused':_0x42cfe9[_0xb46d('0x64')],'createdAt':_0x42cfe9[_0xb46d('0x60')],'updatedAt':_0x42cfe9[_0xb46d('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb46d('0x25')](respondWithFilteredResult(_0xbf4ced,_0x4eba6f))[_0xb46d('0x46')](handleError(_0xbf4ced,null));};exports[_0xb46d('0x65')]=function(_0x239a03,_0x425d76,_0x26ddb3){var _0x988692={};var _0x2e9e38={};var _0xc4fe4a;var _0x34eff8;return db['SmsQueue'][_0xb46d('0x55')]({'where':{'id':_0x239a03['params']['id']}})[_0xb46d('0x25')](handleEntityNotFound(_0x425d76,null))['then'](function(_0x518748){if(_0x518748){_0xc4fe4a=_0x518748;_0x2e9e38[_0xb46d('0x34')]=_[_0xb46d('0x36')](db[_0xb46d('0x66')][_0xb46d('0x31')]);_0x2e9e38[_0xb46d('0x35')]=_[_0xb46d('0x36')](_0x239a03[_0xb46d('0x35')]);_0x2e9e38['filters']=_[_0xb46d('0x37')](_0x2e9e38[_0xb46d('0x34')],_0x2e9e38[_0xb46d('0x35')]);_0x988692[_0xb46d('0x39')]=_[_0xb46d('0x37')](_0x2e9e38[_0xb46d('0x34')],qs[_0xb46d('0x38')](_0x239a03['query'][_0xb46d('0x38')]));_0x988692[_0xb46d('0x39')]=_0x988692[_0xb46d('0x39')][_0xb46d('0x57')]?_0x988692[_0xb46d('0x39')]:_0x2e9e38[_0xb46d('0x34')];_0x988692[_0xb46d('0x59')]=qs['sort'](_0x239a03['query'][_0xb46d('0x3b')]);_0x988692[_0xb46d('0x3f')]=qs['filters'](_[_0xb46d('0x3d')](_0x239a03['query'],_0x2e9e38['filters']));if(_0x239a03[_0xb46d('0x35')][_0xb46d('0x41')]){_0x988692['where']=_[_0xb46d('0x3e')](_0x988692[_0xb46d('0x3f')],{'$or':_[_0xb46d('0x2f')](_0x988692[_0xb46d('0x39')],function(_0x272f2b){var _0x25ad5c={};_0x25ad5c[_0x272f2b]={'$like':'%'+_0x239a03[_0xb46d('0x35')][_0xb46d('0x41')]+'%'};return _0x25ad5c;})});}_0x988692=_[_0xb46d('0x3e')]({},_0x988692,_0x239a03[_0xb46d('0x42')]);return _0xc4fe4a[_0xb46d('0x65')](_0x988692);}})[_0xb46d('0x25')](function(_0x4a11de){if(_0x4a11de){_0x34eff8=_0x4a11de[_0xb46d('0x57')];if(!_0x239a03[_0xb46d('0x35')][_0xb46d('0x58')](_0xb46d('0x3a'))){_0x988692['limit']=qs[_0xb46d('0x1d')](_0x239a03[_0xb46d('0x35')][_0xb46d('0x1d')]);_0x988692['offset']=qs['offset'](_0x239a03[_0xb46d('0x35')][_0xb46d('0x1c')]);}return _0xc4fe4a[_0xb46d('0x65')](_0x988692);}})[_0xb46d('0x25')](function(_0x71b391){if(_0x71b391){return _0x71b391?{'count':_0x34eff8,'rows':_0x71b391}:null;}})[_0xb46d('0x25')](respondWithResult(_0x425d76,null))[_0xb46d('0x46')](handleError(_0x425d76,null));};exports[_0xb46d('0x67')]=function(_0x569fdc,_0x304a59,_0x5c2ad0){var _0xf69fa2=_0x569fdc[_0xb46d('0x49')][_0xb46d('0x68')];return db[_0xb46d('0x66')]['findAll']({'where':{'id':_0xf69fa2},'attributes':['id'],'include':[{'model':db[_0xb46d('0x5c')],'as':_0xb46d('0x69'),'attributes':['id',_0xb46d('0x2d'),_0xb46d('0x6a'),_0xb46d('0x6b'),_0xb46d('0x6c')],'raw':!![]}]})['then'](function(_0x2c26c1){if(_0x2c26c1){var _0x18ba05=_[_0xb46d('0x6d')](_0x2c26c1,function(_0x839264){var _0x38c4b6=_0x839264[_0xb46d('0x27')]({'plain':!![]});return _0x38c4b6[_0xb46d('0x69')];});return db[_0xb46d('0x30')][_0xb46d('0x48')]({'where':{'id':_0x569fdc[_0xb46d('0x52')]['id']}})[_0xb46d('0x25')](function(_0x375fa3){return db[_0xb46d('0x6e')][_0xb46d('0x6f')](function(_0x3b5e0c){return _0x375fa3[_0xb46d('0x67')](_0xf69fa2,{'transaction':_0x3b5e0c})[_0xb46d('0x25')](function(){return BPromise[_0xb46d('0x70')](_0x18ba05,function(_0x37089b){return db[_0xb46d('0x56')]['findOrCreate']({'where':{'UserId':_0x37089b['id'],'SmsQueueId':_0x569fdc['params']['id']},'transaction':_0x3b5e0c});});})['then'](function(){_0x18ba05[_0xb46d('0x71')](function(_0x1be751){socket['emit'](_0xb46d('0x72'),{'UserId':_0x1be751['id'],'SmsQueueId':_0x375fa3['id']});});});});});}})['then'](respondWithStatusCode(_0x304a59,null))[_0xb46d('0x46')](handleError(_0x304a59,null));};exports[_0xb46d('0x73')]=function(_0x4c80bf,_0x4d4238,_0x41ac5b){return db[_0xb46d('0x66')][_0xb46d('0x5b')]({'where':{'id':_0x4c80bf['query'][_0xb46d('0x68')]},'attributes':['id'],'include':[{'model':db[_0xb46d('0x5c')],'as':_0xb46d('0x69'),'attributes':['id'],'raw':!![]}]})[_0xb46d('0x25')](handleEntityNotFound(_0x4d4238,null))[_0xb46d('0x25')](function(_0x4996b6){var _0x17f08d=_[_0xb46d('0x2f')](_0x4996b6,'id');var _0x2dcf8a=[];var _0x4b1ca7=[];var _0x33890e=squel['select']();_0x33890e[_0xb46d('0x74')](_0xb46d('0x75'))[_0xb46d('0x76')](_0xb46d('0x77'),'tq')[_0xb46d('0x78')](_0xb46d('0x79'),'ut',_0xb46d('0x7a'))[_0xb46d('0x3f')](_0xb46d('0x7b'),_0x4c80bf[_0xb46d('0x52')]['id']);for(var _0x2a94ae=0x0;_0x2a94ae<_0x4996b6[_0xb46d('0x57')];_0x2a94ae+=0x1){let _0x382d1a=_0x4996b6[_0x2a94ae];for(var _0x4f01ab=0x0;_0x4f01ab<_0x382d1a[_0xb46d('0x69')]['length'];_0x4f01ab+=0x1){let _0x1a697b=_0x382d1a['Agents'][_0x4f01ab];var _0x4bf6eb=_0x33890e['clone']();_0x4bf6eb[_0xb46d('0x3f')](_0xb46d('0x7c'),_0x1a697b['id']);_0x4b1ca7[_0xb46d('0x7d')](db[_0xb46d('0x6e')][_0xb46d('0x35')](_0x4bf6eb[_0xb46d('0x7e')](),{'type':db[_0xb46d('0x6e')][_0xb46d('0x7f')][_0xb46d('0x80')]})[_0xb46d('0x25')](function(_0x39d372){if(_0x39d372[_0xb46d('0x57')]===0x1){return _0x1a697b['id'];}else{var _0x2b53e1=_[_0xb46d('0x81')](_[_0xb46d('0x2f')](_0x39d372,'TeamId'),function(_0x335786){return _[_0xb46d('0x82')](_0x17f08d,_0x335786);});if(_0x2b53e1){return _0x1a697b['id'];}}}));}}return BPromise['all'](_0x4b1ca7)[_0xb46d('0x25')](function(_0x1587ce){_0x2dcf8a=_(_0x2dcf8a)[_0xb46d('0x83')](_0x1587ce)[_0xb46d('0x84')]()[_0xb46d('0x85')]();return db[_0xb46d('0x30')][_0xb46d('0x48')]({'where':{'id':_0x4c80bf['params']['id']}})[_0xb46d('0x25')](function(_0x305213){return db[_0xb46d('0x6e')][_0xb46d('0x6f')](function(_0x1c0b07){return _0x305213['removeTeams'](_0x4c80bf[_0xb46d('0x35')][_0xb46d('0x68')],{'transaction':_0x1c0b07})[_0xb46d('0x25')](function(){if(!_[_0xb46d('0x86')](_0x2dcf8a)){return _0x305213[_0xb46d('0x87')](_0x2dcf8a,{'transaction':_0x1c0b07});}})[_0xb46d('0x25')](function(){_0x2dcf8a[_0xb46d('0x71')](function(_0x32e0c5){socket[_0xb46d('0x88')](_0xb46d('0x89'),{'UserId':_0x32e0c5,'SmsQueueId':_0x305213['id']});});});});});});})[_0xb46d('0x25')](respondWithStatusCode(_0x4d4238,null))['catch'](handleError(_0x4d4238,null));};exports[_0xb46d('0x8a')]=function(_0x1bad82,_0x92609b,_0x2b4acd){return db[_0xb46d('0x30')]['find']({'where':{'id':_0x1bad82[_0xb46d('0x52')]['id']}})['then'](handleEntityNotFound(_0x92609b,null))['then'](function(_0x5a1321){if(_0x5a1321){return _0x5a1321[_0xb46d('0x8a')](_0x1bad82[_0xb46d('0x49')][_0xb46d('0x68')],_['omit'](_0x1bad82[_0xb46d('0x49')],['ids','id'])||{})[_0xb46d('0x8b')](function(_0xa9e45e){for(var _0x1b4295=0x0;_0x1b4295<_0x1bad82[_0xb46d('0x49')][_0xb46d('0x68')]['length'];_0x1b4295+=0x1){socket[_0xb46d('0x88')]('userSmsQueue:save',{'UserId':Number(_0x1bad82[_0xb46d('0x49')][_0xb46d('0x68')][_0x1b4295]),'SmsQueueId':Number(_0x1bad82[_0xb46d('0x52')]['id'])});}return _0xa9e45e;});}})['then'](respondWithResult(_0x92609b,null))['catch'](handleError(_0x92609b,null));};exports[_0xb46d('0x87')]=function(_0x21bdcb,_0x1be638,_0x227ba0){return db['SmsQueue'][_0xb46d('0x48')]({'where':{'id':_0x21bdcb['params']['id']}})['then'](handleEntityNotFound(_0x1be638,null))[_0xb46d('0x25')](function(_0x5e1f4f){if(_0x5e1f4f){return _0x5e1f4f[_0xb46d('0x87')](_0x21bdcb['query'][_0xb46d('0x68')])[_0xb46d('0x25')](function(){if(_['isArray'](_0x21bdcb['query'][_0xb46d('0x68')])){for(var _0x54ca4a=0x0;_0x54ca4a<_0x21bdcb[_0xb46d('0x35')][_0xb46d('0x68')]['length'];_0x54ca4a+=0x1){socket[_0xb46d('0x88')](_0xb46d('0x89'),{'UserId':Number(_0x21bdcb[_0xb46d('0x35')][_0xb46d('0x68')][_0x54ca4a]),'SmsQueueId':Number(_0x21bdcb[_0xb46d('0x52')]['id'])});}}else{socket[_0xb46d('0x88')](_0xb46d('0x89'),{'UserId':Number(_0x21bdcb['query'][_0xb46d('0x68')]),'SmsQueueId':Number(_0x21bdcb['params']['id'])});}});}})[_0xb46d('0x25')](respondWithStatusCode(_0x1be638,null))['catch'](handleError(_0x1be638,null));};exports[_0xb46d('0x8c')]=function(_0x372bc0,_0x23149c,_0x8bfdd6){var _0x134d5f={};var _0x47b15b={};var _0x28b030;var _0x3984ef;return db[_0xb46d('0x30')]['findOne']({'where':{'id':_0x372bc0[_0xb46d('0x52')]['id']}})[_0xb46d('0x25')](handleEntityNotFound(_0x23149c,null))[_0xb46d('0x25')](function(_0x3e8971){if(_0x3e8971){_0x28b030=_0x3e8971;_0x47b15b[_0xb46d('0x34')]=_[_0xb46d('0x36')](db[_0xb46d('0x5c')][_0xb46d('0x31')]);_0x47b15b[_0xb46d('0x35')]=_[_0xb46d('0x36')](_0x372bc0[_0xb46d('0x35')]);_0x47b15b[_0xb46d('0x3c')]=_[_0xb46d('0x37')](_0x47b15b[_0xb46d('0x34')],_0x47b15b[_0xb46d('0x35')]);_0x134d5f[_0xb46d('0x39')]=_['intersection'](_0x47b15b['model'],qs[_0xb46d('0x38')](_0x372bc0[_0xb46d('0x35')]['fields']));_0x134d5f[_0xb46d('0x39')]=_0x134d5f[_0xb46d('0x39')][_0xb46d('0x57')]?_0x134d5f['attributes']:_0x47b15b[_0xb46d('0x34')];_0x134d5f[_0xb46d('0x59')]=qs[_0xb46d('0x3b')](_0x372bc0[_0xb46d('0x35')][_0xb46d('0x3b')]);_0x134d5f[_0xb46d('0x3f')]=qs['filters'](_[_0xb46d('0x3d')](_0x372bc0[_0xb46d('0x35')],_0x47b15b[_0xb46d('0x3c')]));if(_0x372bc0[_0xb46d('0x35')][_0xb46d('0x41')]){_0x134d5f[_0xb46d('0x3f')]=_[_0xb46d('0x3e')](_0x134d5f[_0xb46d('0x3f')],{'$or':_[_0xb46d('0x2f')](_0x134d5f[_0xb46d('0x39')],function(_0x2bfa6e){var _0x245591={};_0x245591[_0x2bfa6e]={'$like':'%'+_0x372bc0[_0xb46d('0x35')][_0xb46d('0x41')]+'%'};return _0x245591;})});}_0x134d5f=_['merge']({},_0x134d5f,_0x372bc0[_0xb46d('0x42')]);return _0x28b030[_0xb46d('0x8c')](_0x134d5f);}})['then'](function(_0x8fc6e4){if(_0x8fc6e4){_0x3984ef=_0x8fc6e4[_0xb46d('0x57')];if(!_0x372bc0[_0xb46d('0x35')][_0xb46d('0x58')](_0xb46d('0x3a'))){_0x134d5f[_0xb46d('0x1d')]=qs[_0xb46d('0x1d')](_0x372bc0[_0xb46d('0x35')][_0xb46d('0x1d')]);_0x134d5f[_0xb46d('0x1c')]=qs[_0xb46d('0x1c')](_0x372bc0[_0xb46d('0x35')][_0xb46d('0x1c')]);}return _0x28b030['getAgents'](_0x134d5f);}})[_0xb46d('0x25')](function(_0x44a76f){if(_0x44a76f){return _0x44a76f?{'count':_0x3984ef,'rows':_0x44a76f}:null;}})['then'](respondWithResult(_0x23149c,null))[_0xb46d('0x46')](handleError(_0x23149c,null));}; \ No newline at end of file +var _0xe0a8=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','map','SmsQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','SmsQueues','UserProfileSection','find'];(function(_0x1a9c07,_0x197774){var _0x43ab79=function(_0x4e6c6b){while(--_0x4e6c6b){_0x1a9c07['push'](_0x1a9c07['shift']());}};_0x43ab79(++_0x197774);}(_0xe0a8,0x161));var _0x8e0a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe0a8[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e0a('0x0'));var zipdir=require(_0x8e0a('0x1'));var jsonpatch=require(_0x8e0a('0x2'));var rp=require(_0x8e0a('0x3'));var moment=require(_0x8e0a('0x4'));var BPromise=require(_0x8e0a('0x5'));var Mustache=require(_0x8e0a('0x6'));var util=require(_0x8e0a('0x7'));var path=require(_0x8e0a('0x8'));var sox=require(_0x8e0a('0x9'));var csv=require('to-csv');var ejs=require(_0x8e0a('0xa'));var fs=require('fs');var fs_extra=require(_0x8e0a('0xb'));var _=require(_0x8e0a('0xc'));var squel=require('squel');var crypto=require(_0x8e0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e0a('0xe'));var toCsv=require(_0x8e0a('0xf'));var querystring=require(_0x8e0a('0x10'));var Papa=require(_0x8e0a('0x11'));var Redis=require(_0x8e0a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e0a('0x13'));var as=require(_0x8e0a('0x14'));var hardwareService=require(_0x8e0a('0x15'));var logger=require(_0x8e0a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8e0a('0x17'));var licenseUtil=require(_0x8e0a('0x18'));var db=require(_0x8e0a('0x19'))['db'];config[_0x8e0a('0x1a')]=_[_0x8e0a('0x1b')](config['redis'],{'host':_0x8e0a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8e0a('0x1d'))[_0x8e0a('0x1e')](socket);function respondWithStatusCode(_0x5a2df7,_0x481617){_0x481617=_0x481617||0xcc;return function(_0x4cc4f7){if(_0x4cc4f7){return _0x5a2df7[_0x8e0a('0x1f')](_0x481617);}return _0x5a2df7[_0x8e0a('0x20')](_0x481617)['end']();};}function respondWithResult(_0x5eb144,_0x38dd37){_0x38dd37=_0x38dd37||0xc8;return function(_0x635f4b){if(_0x635f4b){return _0x5eb144[_0x8e0a('0x20')](_0x38dd37)[_0x8e0a('0x21')](_0x635f4b);}};}function respondWithFilteredResult(_0x2b2007,_0x36aee7){return function(_0x5d1b00){if(_0x5d1b00){var _0x1c71ad=typeof _0x36aee7[_0x8e0a('0x22')]==='undefined'&&typeof _0x36aee7[_0x8e0a('0x23')]===_0x8e0a('0x24');var _0x190c13=_0x5d1b00[_0x8e0a('0x25')];var _0x339e3b=_0x1c71ad?0x0:_0x36aee7[_0x8e0a('0x22')];var _0x102415=_0x1c71ad?_0x5d1b00['count']:_0x36aee7[_0x8e0a('0x22')]+_0x36aee7[_0x8e0a('0x23')];var _0x4f2703;if(_0x102415>=_0x190c13){_0x102415=_0x190c13;_0x4f2703=0xc8;}else{_0x4f2703=0xce;}_0x2b2007['status'](_0x4f2703);return _0x2b2007['set']('Content-Range',_0x339e3b+'-'+_0x102415+'/'+_0x190c13)['json'](_0x5d1b00);}return null;};}function patchUpdates(_0x29625a){return function(_0x3c1527){try{jsonpatch[_0x8e0a('0x26')](_0x3c1527,_0x29625a,!![]);}catch(_0x3095b9){return BPromise[_0x8e0a('0x27')](_0x3095b9);}return _0x3c1527[_0x8e0a('0x28')]();};}function saveUpdates(_0x4a29c5,_0xcff72d){return function(_0x45edc4){if(_0x45edc4){return _0x45edc4[_0x8e0a('0x29')](_0x4a29c5)[_0x8e0a('0x2a')](function(_0x1feba5){return _0x1feba5;});}return null;};}function removeEntity(_0x418e19,_0x11895b){return function(_0x209518){if(_0x209518){return _0x209518['destroy']()[_0x8e0a('0x2a')](function(){var _0x43dad9=_0x209518[_0x8e0a('0x2b')]({'plain':!![]});var _0x22fcbe='SmsQueues';return db[_0x8e0a('0x2c')][_0x8e0a('0x2d')]({'where':{'type':_0x22fcbe,'resourceId':_0x43dad9['id']}})[_0x8e0a('0x2a')](function(){return _0x209518;});})[_0x8e0a('0x2a')](function(){_0x418e19[_0x8e0a('0x20')](0xcc)[_0x8e0a('0x2e')]();});}};}function handleEntityNotFound(_0x3e6b24,_0x554e24){return function(_0x2230f9){if(!_0x2230f9){_0x3e6b24[_0x8e0a('0x1f')](0x194);}return _0x2230f9;};}function handleError(_0x4b6c4c,_0x4d0d11){_0x4d0d11=_0x4d0d11||0x1f4;return function(_0x416eed){logger['error'](_0x416eed['stack']);if(_0x416eed[_0x8e0a('0x2f')]){delete _0x416eed[_0x8e0a('0x2f')];}_0x4b6c4c[_0x8e0a('0x20')](_0x4d0d11)['send'](_0x416eed);};}exports['index']=function(_0x2daa94,_0x26d7b2){var _0x4b8a9d={},_0x46d810={},_0x589005={'count':0x0,'rows':[]};var _0x2ce503=_[_0x8e0a('0x30')](db[_0x8e0a('0x31')][_0x8e0a('0x32')],function(_0x303a0c){return{'name':_0x303a0c['fieldName'],'type':_0x303a0c[_0x8e0a('0x33')][_0x8e0a('0x34')]};});_0x46d810['model']=_[_0x8e0a('0x30')](_0x2ce503,_0x8e0a('0x2f'));_0x46d810[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x2daa94[_0x8e0a('0x35')]);_0x46d810[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],_0x46d810[_0x8e0a('0x35')]);_0x4b8a9d[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x4b8a9d['attributes']=_0x4b8a9d[_0x8e0a('0x3a')][_0x8e0a('0x3c')]?_0x4b8a9d[_0x8e0a('0x3a')]:_0x46d810[_0x8e0a('0x39')];if(!_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3d')](_0x8e0a('0x3e'))){_0x4b8a9d[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x4b8a9d[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x2daa94['query'][_0x8e0a('0x22')]);}_0x4b8a9d[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x4b8a9d[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x2daa94['query'],_0x46d810[_0x8e0a('0x37')]),_0x2ce503);if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x4b8a9d[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x4b8a9d['where'],{'$or':_[_0x8e0a('0x30')](_0x2ce503,function(_0x35d4dc){if(_0x35d4dc[_0x8e0a('0x33')]!==_0x8e0a('0x45')){var _0x4d3749={};_0x4d3749[_0x35d4dc[_0x8e0a('0x2f')]]={'$like':'%'+_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x4d3749;}})});}_0x4b8a9d=_[_0x8e0a('0x44')]({},_0x4b8a9d,_0x2daa94[_0x8e0a('0x46')]);var _0x28a02e={'where':_0x4b8a9d['where']};return db[_0x8e0a('0x31')][_0x8e0a('0x25')](_0x28a02e)['then'](function(_0xb2a7c7){_0x589005[_0x8e0a('0x25')]=_0xb2a7c7;if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x4b8a9d['include']=[{'all':!![]}];}return db[_0x8e0a('0x31')][_0x8e0a('0x48')](_0x4b8a9d);})[_0x8e0a('0x2a')](function(_0x4c6ef0){_0x589005[_0x8e0a('0x49')]=_0x4c6ef0;return _0x589005;})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x26d7b2,_0x4b8a9d))[_0x8e0a('0x4a')](handleError(_0x26d7b2,null));};exports[_0x8e0a('0x4b')]=function(_0x51bf04,_0x4431c9){var _0x2f2d86={'raw':!![],'where':{'id':_0x51bf04[_0x8e0a('0x4c')]['id']}},_0xaa831a={};_0xaa831a[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x31')][_0x8e0a('0x32')]);_0xaa831a[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x51bf04[_0x8e0a('0x35')]);_0xaa831a[_0x8e0a('0x37')]=_['intersection'](_0xaa831a['model'],_0xaa831a[_0x8e0a('0x35')]);_0x2f2d86[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0xaa831a[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x51bf04['query']['fields']));_0x2f2d86['attributes']=_0x2f2d86[_0x8e0a('0x3a')]['length']?_0x2f2d86['attributes']:_0xaa831a['model'];if(_0x51bf04[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x2f2d86[_0x8e0a('0x4d')]=[{'all':!![]}];}_0x2f2d86=_['merge']({},_0x2f2d86,_0x51bf04[_0x8e0a('0x46')]);return db[_0x8e0a('0x31')]['find'](_0x2f2d86)[_0x8e0a('0x2a')](handleEntityNotFound(_0x4431c9,null))[_0x8e0a('0x2a')](respondWithResult(_0x4431c9,null))[_0x8e0a('0x4a')](handleError(_0x4431c9,null));};exports[_0x8e0a('0x4e')]=function(_0xe37838,_0x1674b8){return db['SmsQueue'][_0x8e0a('0x4e')](_0xe37838[_0x8e0a('0x4f')],{})[_0x8e0a('0x2a')](function(_0x704770){var _0x55795b=_0xe37838[_0x8e0a('0x50')]['get']({'plain':!![]});if(!_0x55795b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55795b[_0x8e0a('0x51')]==='user'){var _0x6ba9d0=_0x704770[_0x8e0a('0x2b')]({'plain':!![]});var _0x92d311=_0x8e0a('0x52');return db[_0x8e0a('0x53')][_0x8e0a('0x54')]({'where':{'name':_0x92d311,'userProfileId':_0x55795b[_0x8e0a('0x55')]},'raw':!![]})[_0x8e0a('0x2a')](function(_0x51c8d3){if(_0x51c8d3&&_0x51c8d3[_0x8e0a('0x56')]===0x0){return db[_0x8e0a('0x2c')][_0x8e0a('0x4e')]({'name':_0x6ba9d0['name'],'resourceId':_0x6ba9d0['id'],'type':_0x51c8d3['name'],'sectionId':_0x51c8d3['id']},{})[_0x8e0a('0x2a')](function(){return _0x704770;});}else{return _0x704770;}})[_0x8e0a('0x4a')](function(_0x11abef){logger[_0x8e0a('0x57')](_0x8e0a('0x58'),_0x11abef);throw _0x11abef;});}return _0x704770;})[_0x8e0a('0x2a')](respondWithResult(_0x1674b8,0xc9))[_0x8e0a('0x4a')](handleError(_0x1674b8,null));};exports['update']=function(_0x3f3b46,_0x1f6930){if(_0x3f3b46[_0x8e0a('0x4f')]['id']){delete _0x3f3b46['body']['id'];}return db[_0x8e0a('0x31')]['find']({'where':{'id':_0x3f3b46[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1f6930,null))[_0x8e0a('0x2a')](saveUpdates(_0x3f3b46['body'],null))[_0x8e0a('0x2a')](respondWithResult(_0x1f6930,null))[_0x8e0a('0x4a')](handleError(_0x1f6930,null));};exports[_0x8e0a('0x2d')]=function(_0x8d34a3,_0x1d6a58){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x8d34a3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1d6a58,null))[_0x8e0a('0x2a')](removeEntity(_0x1d6a58,null))[_0x8e0a('0x4a')](handleError(_0x1d6a58,null));};exports['describe']=function(_0x1362ce,_0x5e775d){return db['SmsQueue'][_0x8e0a('0x59')]()['then'](respondWithResult(_0x5e775d,null))[_0x8e0a('0x4a')](handleError(_0x5e775d,null));};exports[_0x8e0a('0x5a')]=function(_0x1e4446,_0x350538,_0x28e868){var _0x46ce59={'raw':!![],'where':{}},_0x4549eb={},_0x56e466;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x1e4446[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x350538,null))['then'](function(_0x52f10d){if(_0x52f10d){_0x56e466=_0x52f10d['get']({'plain':!![]});_0x4549eb['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5c')][_0x8e0a('0x32')]);_0x4549eb['query']=_['keys'](_0x1e4446[_0x8e0a('0x35')]);_0x4549eb[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x4549eb[_0x8e0a('0x39')],_0x4549eb[_0x8e0a('0x35')]);_0x46ce59[_0x8e0a('0x3a')]=_['intersection'](_0x4549eb[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x1e4446['query'][_0x8e0a('0x3b')]));_0x46ce59[_0x8e0a('0x3a')]=_0x46ce59['attributes'][_0x8e0a('0x3c')]?_0x46ce59[_0x8e0a('0x3a')]:_0x4549eb[_0x8e0a('0x39')];if(!_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x3d')]('nolimit')){_0x46ce59[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x46ce59[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x1e4446['query'][_0x8e0a('0x22')]);}_0x46ce59[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x46ce59[_0x8e0a('0x41')]=qs[_0x8e0a('0x37')](_[_0x8e0a('0x42')](_0x1e4446[_0x8e0a('0x35')],_0x4549eb[_0x8e0a('0x37')]));_0x46ce59[_0x8e0a('0x41')][_0x8e0a('0x5d')]=_0x52f10d['id'];if(_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x46ce59[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x46ce59[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x46ce59['attributes'],function(_0x4f2b51){var _0x50bbc0={};_0x50bbc0[_0x4f2b51]={'$like':'%'+_0x1e4446['query'][_0x8e0a('0x43')]+'%'};return _0x50bbc0;})});}_0x46ce59=_[_0x8e0a('0x44')]({},_0x46ce59,_0x1e4446[_0x8e0a('0x46')]);return db[_0x8e0a('0x5c')]['findAll'](_0x46ce59);}})[_0x8e0a('0x2a')](function(_0x5de647){if(_0x5de647){return db[_0x8e0a('0x5e')][_0x8e0a('0x5f')]({'where':{'id':_[_0x8e0a('0x30')](_0x5de647,'UserId'),'role':_0x8e0a('0x60')},'attributes':['id',_0x8e0a('0x2f'),_0x8e0a('0x61'),_0x8e0a('0x62'),'createdAt']});}})[_0x8e0a('0x2a')](function(_0x2e775d){if(_0x2e775d){return{'count':_0x2e775d[_0x8e0a('0x25')],'rows':_['map'](_0x2e775d['rows'],function(_0x1cb48e){return{'membername':_0x1cb48e[_0x8e0a('0x2f')],'UserId':_0x1cb48e['id'],'queue_name':_0x56e466[_0x8e0a('0x2f')],'SmsQueueId':_0x56e466['id'],'interface':util[_0x8e0a('0x63')](_0x8e0a('0x64'),'SIP',_0x1cb48e[_0x8e0a('0x2f')]),'penalty':0x0,'paused':_0x1cb48e[_0x8e0a('0x61')],'createdAt':_0x1cb48e[_0x8e0a('0x65')],'updatedAt':_0x1cb48e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x350538,_0x46ce59))[_0x8e0a('0x4a')](handleError(_0x350538,null));};exports[_0x8e0a('0x66')]=function(_0x223e25,_0x6b5d90,_0x4ca2ad){var _0x2d1a2a={};var _0x200912={};var _0x56d3c1;var _0x2981dc;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x223e25['params']['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x6b5d90,null))[_0x8e0a('0x2a')](function(_0x7e3227){if(_0x7e3227){_0x56d3c1=_0x7e3227;_0x200912[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x67')][_0x8e0a('0x32')]);_0x200912[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x223e25[_0x8e0a('0x35')]);_0x200912['filters']=_[_0x8e0a('0x38')](_0x200912['model'],_0x200912[_0x8e0a('0x35')]);_0x2d1a2a[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x200912[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x223e25[_0x8e0a('0x35')]['fields']));_0x2d1a2a['attributes']=_0x2d1a2a['attributes']['length']?_0x2d1a2a[_0x8e0a('0x3a')]:_0x200912['model'];_0x2d1a2a[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x223e25['query'][_0x8e0a('0x40')]);_0x2d1a2a[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x223e25[_0x8e0a('0x35')],_0x200912['filters']));if(_0x223e25[_0x8e0a('0x35')]['filter']){_0x2d1a2a[_0x8e0a('0x41')]=_['merge'](_0x2d1a2a['where'],{'$or':_['map'](_0x2d1a2a[_0x8e0a('0x3a')],function(_0x549b56){var _0xf0ffd2={};_0xf0ffd2[_0x549b56]={'$like':'%'+_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0xf0ffd2;})});}_0x2d1a2a=_['merge']({},_0x2d1a2a,_0x223e25[_0x8e0a('0x46')]);return _0x56d3c1[_0x8e0a('0x66')](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x4b75d1){if(_0x4b75d1){_0x2981dc=_0x4b75d1[_0x8e0a('0x3c')];if(!_0x223e25[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x2d1a2a[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x223e25[_0x8e0a('0x35')]['limit']);_0x2d1a2a[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x56d3c1['getTeams'](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x5eb7f7){if(_0x5eb7f7){return _0x5eb7f7?{'count':_0x2981dc,'rows':_0x5eb7f7}:null;}})['then'](respondWithResult(_0x6b5d90,null))[_0x8e0a('0x4a')](handleError(_0x6b5d90,null));};exports[_0x8e0a('0x68')]=function(_0x1e0c64,_0x828ce4,_0x3e4fb4){var _0x54d1a6=_0x1e0c64[_0x8e0a('0x4f')][_0x8e0a('0x69')];return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x54d1a6},'attributes':['id'],'include':[{'model':db[_0x8e0a('0x5e')],'as':_0x8e0a('0x6a'),'attributes':['id','name',_0x8e0a('0x6b'),_0x8e0a('0x6c'),_0x8e0a('0x6d')],'raw':!![]}]})['then'](function(_0x259f66){if(_0x259f66){var _0x25da85=_[_0x8e0a('0x6e')](_0x259f66,function(_0x1682dc){var _0x756692=_0x1682dc[_0x8e0a('0x2b')]({'plain':!![]});return _0x756692['Agents'];});return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x1e0c64[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](function(_0x544fe5){return db[_0x8e0a('0x6f')][_0x8e0a('0x70')](function(_0x35ecad){return _0x544fe5[_0x8e0a('0x68')](_0x54d1a6,{'transaction':_0x35ecad})[_0x8e0a('0x2a')](function(){return BPromise[_0x8e0a('0x71')](_0x25da85,function(_0xeb6faa){return db['UserSmsQueue'][_0x8e0a('0x72')]({'where':{'UserId':_0xeb6faa['id'],'SmsQueueId':_0x1e0c64['params']['id']},'transaction':_0x35ecad});});})[_0x8e0a('0x2a')](function(){_0x25da85[_0x8e0a('0x73')](function(_0x870906){socket[_0x8e0a('0x74')]('userSmsQueue:save',{'UserId':_0x870906['id'],'SmsQueueId':_0x544fe5['id']});});});});});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x828ce4,null))[_0x8e0a('0x4a')](handleError(_0x828ce4,null));};exports['removeTeams']=function(_0x751214,_0x268ed2,_0x3ad0bf){return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x751214[_0x8e0a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8e0a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x8e0a('0x2a')](handleEntityNotFound(_0x268ed2,null))[_0x8e0a('0x2a')](function(_0x282e79){var _0x264c7a=_['map'](_0x282e79,'id');var _0x465cdc=[];var _0x432efa=[];var _0x2d2ca5=squel[_0x8e0a('0x75')]();_0x2d2ca5[_0x8e0a('0x76')](_0x8e0a('0x77'))[_0x8e0a('0x78')](_0x8e0a('0x79'),'tq')[_0x8e0a('0x7a')](_0x8e0a('0x7b'),'ut',_0x8e0a('0x7c'))[_0x8e0a('0x41')](_0x8e0a('0x7d'),_0x751214[_0x8e0a('0x4c')]['id']);for(var _0x15a792=0x0;_0x15a792<_0x282e79[_0x8e0a('0x3c')];_0x15a792+=0x1){let _0x3e7d30=_0x282e79[_0x15a792];for(var _0x20566c=0x0;_0x20566c<_0x3e7d30[_0x8e0a('0x6a')][_0x8e0a('0x3c')];_0x20566c+=0x1){let _0x1cc944=_0x3e7d30[_0x8e0a('0x6a')][_0x20566c];var _0x43df3c=_0x2d2ca5[_0x8e0a('0x7e')]();_0x43df3c['where']('ut.UserId\x20=\x20?',_0x1cc944['id']);_0x432efa[_0x8e0a('0x7f')](db['sequelize'][_0x8e0a('0x35')](_0x43df3c[_0x8e0a('0x80')](),{'type':db[_0x8e0a('0x6f')]['QueryTypes'][_0x8e0a('0x81')]})[_0x8e0a('0x2a')](function(_0x50c855){if(_0x50c855[_0x8e0a('0x3c')]===0x1){return _0x1cc944['id'];}else{var _0x52775a=_[_0x8e0a('0x82')](_['map'](_0x50c855,_0x8e0a('0x83')),function(_0x4131e1){return _[_0x8e0a('0x84')](_0x264c7a,_0x4131e1);});if(_0x52775a){return _0x1cc944['id'];}}}));}}return BPromise['all'](_0x432efa)['then'](function(_0x3c5639){_0x465cdc=_(_0x465cdc)[_0x8e0a('0x85')](_0x3c5639)[_0x8e0a('0x86')]()[_0x8e0a('0x87')]();return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x751214[_0x8e0a('0x4c')]['id']}})['then'](function(_0x1ee98e){return db['sequelize'][_0x8e0a('0x70')](function(_0x3beb00){return _0x1ee98e[_0x8e0a('0x88')](_0x751214[_0x8e0a('0x35')][_0x8e0a('0x69')],{'transaction':_0x3beb00})['then'](function(){if(!_[_0x8e0a('0x89')](_0x465cdc)){return _0x1ee98e['removeAgents'](_0x465cdc,{'transaction':_0x3beb00});}})[_0x8e0a('0x2a')](function(){_0x465cdc[_0x8e0a('0x73')](function(_0x4863bd){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':_0x4863bd,'SmsQueueId':_0x1ee98e['id']});});});});});});})[_0x8e0a('0x2a')](respondWithStatusCode(_0x268ed2,null))[_0x8e0a('0x4a')](handleError(_0x268ed2,null));};exports[_0x8e0a('0x8b')]=function(_0x5f05e3,_0x8498f7,_0x451d23){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x5f05e3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x8498f7,null))['then'](function(_0x4ed2c5){if(_0x4ed2c5){return _0x4ed2c5['addAgents'](_0x5f05e3[_0x8e0a('0x4f')]['ids'],_[_0x8e0a('0x8c')](_0x5f05e3['body'],[_0x8e0a('0x69'),'id'])||{})[_0x8e0a('0x8d')](function(_0x15037a){for(var _0x5af85f=0x0;_0x5af85f<_0x5f05e3['body'][_0x8e0a('0x69')]['length'];_0x5af85f+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8e'),{'UserId':Number(_0x5f05e3[_0x8e0a('0x4f')]['ids'][_0x5af85f]),'SmsQueueId':Number(_0x5f05e3[_0x8e0a('0x4c')]['id'])});}return _0x15037a;});}})[_0x8e0a('0x2a')](respondWithResult(_0x8498f7,null))['catch'](handleError(_0x8498f7,null));};exports[_0x8e0a('0x8f')]=function(_0xecff65,_0x4b274b,_0x440f6d){return db['SmsQueue']['find']({'where':{'id':_0xecff65[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x4b274b,null))['then'](function(_0x2ea517){if(_0x2ea517){return _0x2ea517['removeAgents'](_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')])[_0x8e0a('0x2a')](function(){if(_[_0x8e0a('0x90')](_0xecff65['query'][_0x8e0a('0x69')])){for(var _0xb25ec=0x0;_0xb25ec<_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0x8e0a('0x3c')];_0xb25ec+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0xb25ec]),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}}else{socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65['query']['ids']),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x4b274b,null))[_0x8e0a('0x4a')](handleError(_0x4b274b,null));};exports[_0x8e0a('0x91')]=function(_0x12ca1b,_0x1763a2,_0x489d4f){var _0x261eef={};var _0x542f84={};var _0x152155;var _0x8842;return db[_0x8e0a('0x31')]['findOne']({'where':{'id':_0x12ca1b[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1763a2,null))[_0x8e0a('0x2a')](function(_0x20bd26){if(_0x20bd26){_0x152155=_0x20bd26;_0x542f84['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5e')][_0x8e0a('0x32')]);_0x542f84[_0x8e0a('0x35')]=_['keys'](_0x12ca1b['query']);_0x542f84[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x542f84[_0x8e0a('0x39')],_0x542f84['query']);_0x261eef[_0x8e0a('0x3a')]=_['intersection'](_0x542f84[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x261eef[_0x8e0a('0x3a')]=_0x261eef['attributes']['length']?_0x261eef[_0x8e0a('0x3a')]:_0x542f84[_0x8e0a('0x39')];_0x261eef[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x12ca1b['query'][_0x8e0a('0x40')]);_0x261eef[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x12ca1b[_0x8e0a('0x35')],_0x542f84[_0x8e0a('0x37')]));if(_0x12ca1b[_0x8e0a('0x35')]['filter']){_0x261eef[_0x8e0a('0x41')]=_['merge'](_0x261eef[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x261eef[_0x8e0a('0x3a')],function(_0x580caa){var _0x10927c={};_0x10927c[_0x580caa]={'$like':'%'+_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x10927c;})});}_0x261eef=_['merge']({},_0x261eef,_0x12ca1b[_0x8e0a('0x46')]);return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0x47065a){if(_0x47065a){_0x8842=_0x47065a[_0x8e0a('0x3c')];if(!_0x12ca1b[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x261eef[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x261eef[_0x8e0a('0x22')]=qs['offset'](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0xa6bf8c){if(_0xa6bf8c){return _0xa6bf8c?{'count':_0x8842,'rows':_0xa6bf8c}:null;}})[_0x8e0a('0x2a')](respondWithResult(_0x1763a2,null))[_0x8e0a('0x4a')](handleError(_0x1763a2,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 2e96082..9234911 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 _0x0126=['update','remove','emit','hook','exports','setMaxListeners'];(function(_0x534982,_0x1dc7a0){var _0x10a77d=function(_0x5c5bb8){while(--_0x5c5bb8){_0x534982['push'](_0x534982['shift']());}};_0x10a77d(++_0x1dc7a0);}(_0x0126,0x95));var _0x6012=function(_0x344e68,_0x46c796){_0x344e68=_0x344e68-0x0;var _0x32b906=_0x0126[_0x344e68];return _0x32b906;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6012('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6012('0x1'),'afterDestroy':_0x6012('0x2')};function emitEvent(_0x37ebe2){return function(_0x22d816,_0x212367,_0x24aea4){SmsQueueEvents[_0x6012('0x3')](_0x37ebe2+':'+_0x22d816['id'],_0x22d816);SmsQueueEvents[_0x6012('0x3')](_0x37ebe2,_0x22d816);_0x24aea4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x6012('0x4')](e,emitEvent(event));}}module[_0x6012('0x5')]=SmsQueueEvents; \ No newline at end of file +var _0xdccd=['events','../../mysqldb','SmsQueue','update','emit','hook','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdccd,0x126));var _0xddcc=function(_0x51f471,_0xdbc0ba){_0x51f471=_0x51f471-0x0;var _0x5a0d53=_0xdccd[_0x51f471];return _0x5a0d53;};'use strict';var EventEmitter=require(_0xddcc('0x0'));var SmsQueue=require(_0xddcc('0x1'))['db'][_0xddcc('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xddcc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1fbfb5){return function(_0x2e6d0,_0x48a1ae,_0x23eafd){SmsQueueEvents[_0xddcc('0x4')](_0x1fbfb5+':'+_0x2e6d0['id'],_0x2e6d0);SmsQueueEvents[_0xddcc('0x4')](_0x1fbfb5,_0x2e6d0);_0x23eafd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xddcc('0x5')](e,emitEvent(event));}}module[_0xddcc('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index db03977..3d8c8f8 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 _0x0f5b=['SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsQueue.attributes','exports','define'];(function(_0x455c48,_0x1c5dba){var _0x1d6ee8=function(_0x10e7ca){while(--_0x10e7ca){_0x455c48['push'](_0x455c48['shift']());}};_0x1d6ee8(++_0x1c5dba);}(_0x0f5b,0xb8));var _0xb0f5=function(_0x3c0d5a,_0x150eac){_0x3c0d5a=_0x3c0d5a-0x0;var _0x5ded2e=_0x0f5b[_0x3c0d5a];return _0x5ded2e;};'use strict';var _=require(_0xb0f5('0x0'));var util=require(_0xb0f5('0x1'));var logger=require(_0xb0f5('0x2'))('api');var moment=require(_0xb0f5('0x3'));var BPromise=require(_0xb0f5('0x4'));var rp=require(_0xb0f5('0x5'));var fs=require('fs');var path=require(_0xb0f5('0x6'));var rimraf=require(_0xb0f5('0x7'));var config=require('../../config/environment');var attributes=require(_0xb0f5('0x8'));module[_0xb0f5('0x9')]=function(_0x209533,_0x44933a){return _0x209533[_0xb0f5('0xa')](_0xb0f5('0xb'),attributes,{'tableName':_0xb0f5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb058=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsQueue.attributes'];(function(_0x9a0c2,_0x48a029){var _0x5d0fad=function(_0x41dee2){while(--_0x41dee2){_0x9a0c2['push'](_0x9a0c2['shift']());}};_0x5d0fad(++_0x48a029);}(_0xb058,0xa0));var _0x8b05=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb058[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x8b05('0x0'));var util=require(_0x8b05('0x1'));var logger=require(_0x8b05('0x2'))(_0x8b05('0x3'));var moment=require(_0x8b05('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b05('0x5'));var fs=require('fs');var path=require(_0x8b05('0x6'));var rimraf=require('rimraf');var config=require(_0x8b05('0x7'));var attributes=require(_0x8b05('0x8'));module[_0x8b05('0x9')]=function(_0x2f3c8e,_0x3a3919){return _0x2f3c8e[_0x8b05('0xa')](_0x8b05('0xb'),attributes,{'tableName':_0x8b05('0xc'),'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 a5bafd0..8857963 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 _0x40ab=['defaults','localhost','socket.io-emitter','./smsQueue.socket','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','include','model','map','then','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x5d93c7,_0x580b09){var _0x54a38b=function(_0x38c4c2){while(--_0x38c4c2){_0x5d93c7['push'](_0x5d93c7['shift']());}};_0x54a38b(++_0x580b09);}(_0x40ab,0x134));var _0xb40a=function(_0x3bb4c4,_0x304cc8){_0x3bb4c4=_0x3bb4c4-0x0;var _0x2c7522=_0x40ab[_0x3bb4c4];return _0x2c7522;};'use strict';var _=require(_0xb40a('0x0'));var util=require(_0xb40a('0x1'));var moment=require(_0xb40a('0x2'));var BPromise=require(_0xb40a('0x3'));var rs=require(_0xb40a('0x4'));var fs=require('fs');var Redis=require(_0xb40a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb40a('0x6'));var logger=require('../../config/logger')(_0xb40a('0x7'));var config=require(_0xb40a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb40a('0x9')][_0xb40a('0xa')]({'port':0x232a});config[_0xb40a('0xb')]=_[_0xb40a('0xc')](config[_0xb40a('0xb')],{'host':_0xb40a('0xd'),'port':0x18eb});var socket=require(_0xb40a('0xe'))(new Redis(config[_0xb40a('0xb')]));require(_0xb40a('0xf'))['register'](socket);function respondWithRpcPromise(_0x46cfff,_0x3688a4,_0x30a44e){return new BPromise(function(_0x28dd61,_0x55b3e0){return client[_0xb40a('0x10')](_0x46cfff,_0x30a44e)['then'](function(_0x1f7a09){logger[_0xb40a('0x11')](_0xb40a('0x12'),_0x3688a4,_0xb40a('0x13'));logger[_0xb40a('0x14')](_0xb40a('0x15'),_0x3688a4,'request\x20sent',JSON[_0xb40a('0x16')](_0x1f7a09));if(_0x1f7a09[_0xb40a('0x17')]){if(_0x1f7a09[_0xb40a('0x17')]['code']===0x1f4){logger[_0xb40a('0x17')](_0xb40a('0x12'),_0x3688a4,_0x1f7a09[_0xb40a('0x17')]['message']);return _0x55b3e0(_0x1f7a09[_0xb40a('0x17')]['message']);}logger[_0xb40a('0x17')](_0xb40a('0x12'),_0x3688a4,_0x1f7a09[_0xb40a('0x17')][_0xb40a('0x18')]);return _0x28dd61(_0x1f7a09[_0xb40a('0x17')][_0xb40a('0x18')]);}else{logger[_0xb40a('0x11')](_0xb40a('0x12'),_0x3688a4,'request\x20sent');_0x28dd61(_0x1f7a09[_0xb40a('0x19')][_0xb40a('0x18')]);}})[_0xb40a('0x1a')](function(_0x2c4106){logger[_0xb40a('0x17')]('SmsQueue,\x20%s,\x20%s',_0x3688a4,_0x2c4106);_0x55b3e0(_0x2c4106);});});}exports[_0xb40a('0x1b')]=function(_0x4dc481){var _0x46c8e0=this;return new Promise(function(_0x56b35f,_0x10d5ed){return db[_0xb40a('0x1c')][_0xb40a('0x1d')]({'raw':_0x4dc481[_0xb40a('0x1e')]?_0x4dc481['options'][_0xb40a('0x1f')]===undefined?!![]:![]:!![],'where':_0x4dc481[_0xb40a('0x1e')]?_0x4dc481[_0xb40a('0x1e')][_0xb40a('0x20')]||null:null,'attributes':_0x4dc481[_0xb40a('0x1e')]?_0x4dc481['options'][_0xb40a('0x21')]||null:null,'limit':_0x4dc481[_0xb40a('0x1e')]?_0x4dc481['options']['limit']||null:null,'include':_0x4dc481[_0xb40a('0x1e')]?_0x4dc481['options']['include']?_['map'](_0x4dc481['options'][_0xb40a('0x22')],function(_0x36c67b){return{'model':db[_0x36c67b[_0xb40a('0x23')]],'as':_0x36c67b['as'],'attributes':_0x36c67b[_0xb40a('0x21')],'include':_0x36c67b[_0xb40a('0x22')]?_[_0xb40a('0x24')](_0x36c67b[_0xb40a('0x22')],function(_0x22f08f){return{'model':db[_0x22f08f['model']],'as':_0x22f08f['as'],'attributes':_0x22f08f[_0xb40a('0x21')],'include':_0x22f08f['include']?_['map'](_0x22f08f[_0xb40a('0x22')],function(_0xdc86b){return{'model':db[_0xdc86b['model']],'as':_0xdc86b['as'],'attributes':_0xdc86b[_0xb40a('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb40a('0x25')](function(_0xb1eeab){logger[_0xb40a('0x11')]('GetSmsQueue',_0x4dc481);logger[_0xb40a('0x14')](_0xb40a('0x1b'),_0x4dc481,JSON[_0xb40a('0x16')](_0xb1eeab));_0x56b35f(_0xb1eeab);})[_0xb40a('0x1a')](function(_0x4ea1a0){logger[_0xb40a('0x17')](_0xb40a('0x1b'),_0x4ea1a0[_0xb40a('0x18')],_0x4dc481);_0x10d5ed(_0x46c8e0[_0xb40a('0x17')](0x1f4,_0x4ea1a0[_0xb40a('0x18')]));});});};exports[_0xb40a('0x26')]=function(_0x2cd569){var _0x2bfb02=this;return new Promise(function(_0x3fe3ce,_0x310edd){return db[_0xb40a('0x1c')][_0xb40a('0x27')]({'raw':_0x2cd569[_0xb40a('0x1e')]?_0x2cd569[_0xb40a('0x1e')][_0xb40a('0x1f')]===undefined?!![]:![]:!![],'where':_0x2cd569[_0xb40a('0x1e')]?_0x2cd569['options'][_0xb40a('0x20')]||null:null,'attributes':_0x2cd569['options']?_0x2cd569[_0xb40a('0x1e')][_0xb40a('0x21')]||null:null,'include':_0x2cd569[_0xb40a('0x1e')]?_0x2cd569['options'][_0xb40a('0x22')]?_[_0xb40a('0x24')](_0x2cd569[_0xb40a('0x1e')]['include'],function(_0x3d3b8){return{'model':db[_0x3d3b8['model']],'as':_0x3d3b8['as'],'attributes':_0x3d3b8[_0xb40a('0x21')],'include':_0x3d3b8[_0xb40a('0x22')]?_[_0xb40a('0x24')](_0x3d3b8[_0xb40a('0x22')],function(_0x1a2fd5){return{'model':db[_0x1a2fd5['model']],'as':_0x1a2fd5['as'],'attributes':_0x1a2fd5[_0xb40a('0x21')],'include':_0x1a2fd5[_0xb40a('0x22')]?_[_0xb40a('0x24')](_0x1a2fd5['include'],function(_0x53f83a){return{'model':db[_0x53f83a['model']],'as':_0x53f83a['as'],'attributes':_0x53f83a[_0xb40a('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bd3c7){logger[_0xb40a('0x11')](_0xb40a('0x26'),_0x2cd569);logger[_0xb40a('0x14')]('ShowSmsQueue',_0x2cd569,JSON[_0xb40a('0x16')](_0x4bd3c7));_0x3fe3ce(_0x4bd3c7);})[_0xb40a('0x1a')](function(_0x2d8ece){logger[_0xb40a('0x17')](_0xb40a('0x26'),_0x2d8ece[_0xb40a('0x18')],_0x2cd569);_0x310edd(_0x2bfb02[_0xb40a('0x17')](0x1f4,_0x2d8ece[_0xb40a('0x18')]));});});}; \ No newline at end of file +var _0x35f6=['socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','SmsQueue','options','where','attributes','limit','map','model','include','GetSmsQueue','stringify','catch','ShowSmsQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x491a8e,_0x1578a6){var _0x1f03ca=function(_0x595b81){while(--_0x595b81){_0x491a8e['push'](_0x491a8e['shift']());}};_0x1f03ca(++_0x1578a6);}(_0x35f6,0x1ea));var _0x635f=function(_0x791d77,_0x2d5801){_0x791d77=_0x791d77-0x0;var _0xf40e61=_0x35f6[_0x791d77];return _0xf40e61;};'use strict';var _=require('lodash');var util=require(_0x635f('0x0'));var moment=require(_0x635f('0x1'));var BPromise=require(_0x635f('0x2'));var rs=require(_0x635f('0x3'));var fs=require('fs');var Redis=require(_0x635f('0x4'));var db=require(_0x635f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x635f('0x6'))(_0x635f('0x7'));var config=require(_0x635f('0x8'));var jayson=require(_0x635f('0x9'));var client=jayson['client'][_0x635f('0xa')]({'port':0x232a});config[_0x635f('0xb')]=_[_0x635f('0xc')](config[_0x635f('0xb')],{'host':_0x635f('0xd'),'port':0x18eb});var socket=require(_0x635f('0xe'))(new Redis(config[_0x635f('0xb')]));require(_0x635f('0xf'))[_0x635f('0x10')](socket);function respondWithRpcPromise(_0x438d6b,_0x5d290a,_0x4f0f43){return new BPromise(function(_0x3c5c15,_0x265ea6){return client[_0x635f('0x11')](_0x438d6b,_0x4f0f43)[_0x635f('0x12')](function(_0x3e3cf4){logger['info'](_0x635f('0x13'),_0x5d290a,_0x635f('0x14'));logger[_0x635f('0x15')](_0x635f('0x16'),_0x5d290a,_0x635f('0x14'),JSON['stringify'](_0x3e3cf4));if(_0x3e3cf4['error']){if(_0x3e3cf4[_0x635f('0x17')][_0x635f('0x18')]===0x1f4){logger[_0x635f('0x17')](_0x635f('0x13'),_0x5d290a,_0x3e3cf4[_0x635f('0x17')]['message']);return _0x265ea6(_0x3e3cf4[_0x635f('0x17')][_0x635f('0x19')]);}logger['error'](_0x635f('0x13'),_0x5d290a,_0x3e3cf4[_0x635f('0x17')][_0x635f('0x19')]);return _0x3c5c15(_0x3e3cf4[_0x635f('0x17')][_0x635f('0x19')]);}else{logger[_0x635f('0x1a')](_0x635f('0x13'),_0x5d290a,_0x635f('0x14'));_0x3c5c15(_0x3e3cf4[_0x635f('0x1b')][_0x635f('0x19')]);}})['catch'](function(_0x395721){logger['error'](_0x635f('0x13'),_0x5d290a,_0x395721);_0x265ea6(_0x395721);});});}exports['GetSmsQueue']=function(_0x18598c){var _0x1b4729=this;return new Promise(function(_0x583cf5,_0x2911a7){return db[_0x635f('0x1c')]['findAll']({'raw':_0x18598c[_0x635f('0x1d')]?_0x18598c['options']['raw']===undefined?!![]:![]:!![],'where':_0x18598c[_0x635f('0x1d')]?_0x18598c[_0x635f('0x1d')][_0x635f('0x1e')]||null:null,'attributes':_0x18598c[_0x635f('0x1d')]?_0x18598c['options'][_0x635f('0x1f')]||null:null,'limit':_0x18598c[_0x635f('0x1d')]?_0x18598c[_0x635f('0x1d')][_0x635f('0x20')]||null:null,'include':_0x18598c[_0x635f('0x1d')]?_0x18598c['options']['include']?_[_0x635f('0x21')](_0x18598c[_0x635f('0x1d')]['include'],function(_0x29e94e){return{'model':db[_0x29e94e[_0x635f('0x22')]],'as':_0x29e94e['as'],'attributes':_0x29e94e['attributes'],'include':_0x29e94e['include']?_[_0x635f('0x21')](_0x29e94e[_0x635f('0x23')],function(_0x2b8acd){return{'model':db[_0x2b8acd['model']],'as':_0x2b8acd['as'],'attributes':_0x2b8acd['attributes'],'include':_0x2b8acd[_0x635f('0x23')]?_[_0x635f('0x21')](_0x2b8acd[_0x635f('0x23')],function(_0x598024){return{'model':db[_0x598024['model']],'as':_0x598024['as'],'attributes':_0x598024[_0x635f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x635f('0x12')](function(_0x5ac19f){logger[_0x635f('0x1a')](_0x635f('0x24'),_0x18598c);logger[_0x635f('0x15')](_0x635f('0x24'),_0x18598c,JSON[_0x635f('0x25')](_0x5ac19f));_0x583cf5(_0x5ac19f);})[_0x635f('0x26')](function(_0x5a1325){logger[_0x635f('0x17')]('GetSmsQueue',_0x5a1325[_0x635f('0x19')],_0x18598c);_0x2911a7(_0x1b4729[_0x635f('0x17')](0x1f4,_0x5a1325[_0x635f('0x19')]));});});};exports[_0x635f('0x27')]=function(_0x5624e0){var _0x4b1926=this;return new Promise(function(_0x33c23c,_0x21be00){return db[_0x635f('0x1c')][_0x635f('0x28')]({'raw':_0x5624e0['options']?_0x5624e0[_0x635f('0x1d')][_0x635f('0x29')]===undefined?!![]:![]:!![],'where':_0x5624e0[_0x635f('0x1d')]?_0x5624e0[_0x635f('0x1d')][_0x635f('0x1e')]||null:null,'attributes':_0x5624e0['options']?_0x5624e0[_0x635f('0x1d')]['attributes']||null:null,'include':_0x5624e0[_0x635f('0x1d')]?_0x5624e0[_0x635f('0x1d')][_0x635f('0x23')]?_[_0x635f('0x21')](_0x5624e0[_0x635f('0x1d')][_0x635f('0x23')],function(_0x2d9b8f){return{'model':db[_0x2d9b8f[_0x635f('0x22')]],'as':_0x2d9b8f['as'],'attributes':_0x2d9b8f['attributes'],'include':_0x2d9b8f[_0x635f('0x23')]?_[_0x635f('0x21')](_0x2d9b8f[_0x635f('0x23')],function(_0x4f35c2){return{'model':db[_0x4f35c2[_0x635f('0x22')]],'as':_0x4f35c2['as'],'attributes':_0x4f35c2[_0x635f('0x1f')],'include':_0x4f35c2[_0x635f('0x23')]?_[_0x635f('0x21')](_0x4f35c2[_0x635f('0x23')],function(_0xaa4f8c){return{'model':db[_0xaa4f8c[_0x635f('0x22')]],'as':_0xaa4f8c['as'],'attributes':_0xaa4f8c['attributes']};}):[]};}):[]};}):[]:[]})[_0x635f('0x12')](function(_0x4a9c28){logger[_0x635f('0x1a')](_0x635f('0x27'),_0x5624e0);logger['debug']('ShowSmsQueue',_0x5624e0,JSON['stringify'](_0x4a9c28));_0x33c23c(_0x4a9c28);})[_0x635f('0x26')](function(_0x2ee6cc){logger[_0x635f('0x17')](_0x635f('0x27'),_0x2ee6cc['message'],_0x5624e0);_0x21be00(_0x4b1926[_0x635f('0x17')](0x1f4,_0x2ee6cc[_0x635f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 0871d07..05e8371 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 _0xddb9=['length','./smsQueue.events','save','remove','update','emit','register'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xddb9,0x174));var _0x9ddb=function(_0x20db6b,_0x2852be){_0x20db6b=_0x20db6b-0x0;var _0x18a32e=_0xddb9[_0x20db6b];return _0x18a32e;};'use strict';var SmsQueueEvents=require(_0x9ddb('0x0'));var events=[_0x9ddb('0x1'),_0x9ddb('0x2'),_0x9ddb('0x3')];function createListener(_0xd8e39e,_0x48ba3b){return function(_0x23e750){_0x48ba3b[_0x9ddb('0x4')](_0xd8e39e,_0x23e750);};}function removeListener(_0x129847,_0x3c447d){return function(){SmsQueueEvents['removeListener'](_0x129847,_0x3c447d);};}exports[_0x9ddb('0x5')]=function(_0x1b2136){for(var _0x2f9ded=0x0,_0x2ba968=events[_0x9ddb('0x6')];_0x2f9ded<_0x2ba968;_0x2f9ded++){var _0x366a7b=events[_0x2f9ded];var _0x2c2ac9=createListener('smsQueue:'+_0x366a7b,_0x1b2136);SmsQueueEvents['on'](_0x366a7b,_0x2c2ac9);}}; \ No newline at end of file +var _0x28ae=['removeListener','register','length','smsQueue:','./smsQueue.events','remove'];(function(_0x14090e,_0x30c2f7){var _0x554da7=function(_0x165d16){while(--_0x165d16){_0x14090e['push'](_0x14090e['shift']());}};_0x554da7(++_0x30c2f7);}(_0x28ae,0x190));var _0xe28a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28ae[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require(_0xe28a('0x0'));var events=['save',_0xe28a('0x1'),'update'];function createListener(_0x555629,_0x1d8f6d){return function(_0x104e98){_0x1d8f6d['emit'](_0x555629,_0x104e98);};}function removeListener(_0x266c2a,_0x192087){return function(){SmsQueueEvents[_0xe28a('0x2')](_0x266c2a,_0x192087);};}exports[_0xe28a('0x3')]=function(_0x320872){for(var _0x11dc18=0x0,_0x38c3a6=events[_0xe28a('0x4')];_0x11dc18<_0x38c3a6;_0x11dc18++){var _0x15e131=events[_0x11dc18];var _0x2574a1=createListener(_0xe28a('0x5')+_0x15e131,_0x320872);SmsQueueEvents['on'](_0x15e131,_0x2574a1);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index a30118d..4320c4d 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 _0x15a9=['delete','/:id','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update'];(function(_0x3830ff,_0x3fb435){var _0x3c91a8=function(_0x1754ca){while(--_0x1754ca){_0x3830ff['push'](_0x3830ff['shift']());}};_0x3c91a8(++_0x3fb435);}(_0x15a9,0x18a));var _0x915a=function(_0x1b5a50,_0x574b1e){_0x1b5a50=_0x1b5a50-0x0;var _0x192fe4=_0x15a9[_0x1b5a50];return _0x192fe4;};'use strict';var multer=require(_0x915a('0x0'));var util=require(_0x915a('0x1'));var path=require(_0x915a('0x2'));var timeout=require(_0x915a('0x3'));var express=require('express');var router=express[_0x915a('0x4')]();var fs_extra=require(_0x915a('0x5'));var auth=require(_0x915a('0x6'));var interaction=require(_0x915a('0x7'));var config=require(_0x915a('0x8'));var controller=require(_0x915a('0x9'));router[_0x915a('0xa')]('/',auth[_0x915a('0xb')](),controller[_0x915a('0xc')]);router[_0x915a('0xa')](_0x915a('0xd'),auth[_0x915a('0xb')](),controller[_0x915a('0xe')]);router['get']('/:id',auth[_0x915a('0xb')](),controller[_0x915a('0xf')]);router[_0x915a('0x10')]('/',auth[_0x915a('0xb')](),controller[_0x915a('0x11')]);router[_0x915a('0x12')]('/:id',auth[_0x915a('0xb')](),controller[_0x915a('0x13')]);router[_0x915a('0x14')](_0x915a('0x15'),auth[_0x915a('0xb')](),controller[_0x915a('0x16')]);module['exports']=router; \ No newline at end of file +var _0xdbce=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./smsQueueReport.controller'];(function(_0x56046c,_0x48f853){var _0xfa490d=function(_0x593cf5){while(--_0x593cf5){_0x56046c['push'](_0x56046c['shift']());}};_0xfa490d(++_0x48f853);}(_0xdbce,0x1f1));var _0xedbc=function(_0x1ecd92,_0x3160e5){_0x1ecd92=_0x1ecd92-0x0;var _0x252421=_0xdbce[_0x1ecd92];return _0x252421;};'use strict';var multer=require(_0xedbc('0x0'));var util=require('util');var path=require(_0xedbc('0x1'));var timeout=require('connect-timeout');var express=require(_0xedbc('0x2'));var router=express[_0xedbc('0x3')]();var fs_extra=require(_0xedbc('0x4'));var auth=require(_0xedbc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xedbc('0x6'));router[_0xedbc('0x7')]('/',auth[_0xedbc('0x8')](),controller[_0xedbc('0x9')]);router[_0xedbc('0x7')](_0xedbc('0xa'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xb')]);router['get'](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xd')]);router[_0xedbc('0xe')]('/',auth[_0xedbc('0x8')](),controller[_0xedbc('0xf')]);router[_0xedbc('0x10')](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0x11')]);router[_0xedbc('0x12')](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0x13')]);module[_0xedbc('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index f64f147..07ac400 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 _0xc7a3=['DATE','moment','sequelize','exports','STRING'];(function(_0x533736,_0x3d5e6b){var _0x588d15=function(_0x81dff7){while(--_0x81dff7){_0x533736['push'](_0x533736['shift']());}};_0x588d15(++_0x3d5e6b);}(_0xc7a3,0x182));var _0x3c7a=function(_0x1f8c85,_0x208e38){_0x1f8c85=_0x1f8c85-0x0;var _0x3ffa64=_0xc7a3[_0x1f8c85];return _0x3ffa64;};'use strict';var moment=require(_0x3c7a('0x0'));var Sequelize=require(_0x3c7a('0x1'));module[_0x3c7a('0x2')]={'uniqueid':{'type':Sequelize[_0x3c7a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3c7a('0x3')]},'joinAt':{'type':Sequelize[_0x3c7a('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3c7a('0x4')]},'reason':{'type':Sequelize[_0x3c7a('0x3')]}}; \ No newline at end of file +var _0xf4f5=['STRING','DATE'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0xf4f5,0x1dc));var _0x5f4f=function(_0x283379,_0x51e897){_0x283379=_0x283379-0x0;var _0x4ce67d=_0xf4f5[_0x283379];return _0x4ce67d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5f4f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x5f4f('0x0')]},'joinAt':{'type':Sequelize[_0x5f4f('0x1')]},'leaveAt':{'type':Sequelize[_0x5f4f('0x1')]},'acceptAt':{'type':Sequelize[_0x5f4f('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5f4f('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index ef6290f..dd16bd6 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 _0x9af3=['params','intersection','include','find','catch','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','SmsQueueReport','rawAttributes','fieldName','type','key','map','name','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','show'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x9af3,0x11d));var _0x39af=function(_0x412e98,_0x305653){_0x412e98=_0x412e98-0x0;var _0xcd0ae=_0x9af3[_0x412e98];return _0xcd0ae;};'use strict';var emlformat=require(_0x39af('0x0'));var rimraf=require(_0x39af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x39af('0x2'));var rp=require(_0x39af('0x3'));var moment=require('moment');var BPromise=require(_0x39af('0x4'));var Mustache=require(_0x39af('0x5'));var util=require(_0x39af('0x6'));var path=require(_0x39af('0x7'));var sox=require(_0x39af('0x8'));var csv=require(_0x39af('0x9'));var ejs=require(_0x39af('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x39af('0xb'));var crypto=require(_0x39af('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x39af('0x9'));var querystring=require(_0x39af('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x39af('0xe'));var qs=require(_0x39af('0xf'));var as=require(_0x39af('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39af('0x11'))(_0x39af('0x12'));var utils=require(_0x39af('0x13'));var config=require(_0x39af('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x39af('0x15'))['db'];function respondWithStatusCode(_0x3f34bf,_0x2ae3f8){_0x2ae3f8=_0x2ae3f8||0xcc;return function(_0x4ab522){if(_0x4ab522){return _0x3f34bf[_0x39af('0x16')](_0x2ae3f8);}return _0x3f34bf[_0x39af('0x17')](_0x2ae3f8)[_0x39af('0x18')]();};}function respondWithResult(_0x7fb5fb,_0x55f979){_0x55f979=_0x55f979||0xc8;return function(_0x12be76){if(_0x12be76){return _0x7fb5fb[_0x39af('0x17')](_0x55f979)['json'](_0x12be76);}};}function respondWithFilteredResult(_0x4b20ac,_0x96d90a){return function(_0x402d6f){if(_0x402d6f){var _0x11f14c=typeof _0x96d90a[_0x39af('0x19')]===_0x39af('0x1a')&&typeof _0x96d90a['limit']==='undefined';var _0x4bbf48=_0x402d6f[_0x39af('0x1b')];var _0xdf74fa=_0x11f14c?0x0:_0x96d90a['offset'];var _0x2672cb=_0x11f14c?_0x402d6f[_0x39af('0x1b')]:_0x96d90a['offset']+_0x96d90a[_0x39af('0x1c')];var _0xf094c5;if(_0x2672cb>=_0x4bbf48){_0x2672cb=_0x4bbf48;_0xf094c5=0xc8;}else{_0xf094c5=0xce;}_0x4b20ac[_0x39af('0x17')](_0xf094c5);return _0x4b20ac[_0x39af('0x1d')](_0x39af('0x1e'),_0xdf74fa+'-'+_0x2672cb+'/'+_0x4bbf48)[_0x39af('0x1f')](_0x402d6f);}return null;};}function patchUpdates(_0x3cd634){return function(_0x1a8cbf){try{jsonpatch['apply'](_0x1a8cbf,_0x3cd634,!![]);}catch(_0x50eae7){return BPromise[_0x39af('0x20')](_0x50eae7);}return _0x1a8cbf[_0x39af('0x21')]();};}function saveUpdates(_0x4f0327,_0x21b6e9){return function(_0x1403ec){if(_0x1403ec){return _0x1403ec['update'](_0x4f0327)[_0x39af('0x22')](function(_0x1aab12){return _0x1aab12;});}return null;};}function removeEntity(_0x15ee18,_0x5c4d52){return function(_0x258804){if(_0x258804){return _0x258804[_0x39af('0x23')]()[_0x39af('0x22')](function(){_0x15ee18['status'](0xcc)[_0x39af('0x18')]();});}};}function handleEntityNotFound(_0x465fce,_0x3df84d){return function(_0x826c5e){if(!_0x826c5e){_0x465fce[_0x39af('0x16')](0x194);}return _0x826c5e;};}function handleError(_0x2826d7,_0x31aa36){_0x31aa36=_0x31aa36||0x1f4;return function(_0x2a5f24){logger[_0x39af('0x24')](_0x2a5f24['stack']);if(_0x2a5f24['name']){delete _0x2a5f24['name'];}_0x2826d7[_0x39af('0x17')](_0x31aa36)['send'](_0x2a5f24);};}exports['index']=function(_0x2b4725,_0x4bc32e){var _0x538ad9={},_0x30024b={},_0x57d421={'count':0x0,'rows':[]};var _0x33b578=_['map'](db[_0x39af('0x25')][_0x39af('0x26')],function(_0xa94122){return{'name':_0xa94122[_0x39af('0x27')],'type':_0xa94122[_0x39af('0x28')][_0x39af('0x29')]};});_0x30024b['model']=_[_0x39af('0x2a')](_0x33b578,_0x39af('0x2b'));_0x30024b[_0x39af('0x2c')]=_['keys'](_0x2b4725[_0x39af('0x2c')]);_0x30024b[_0x39af('0x2d')]=_['intersection'](_0x30024b[_0x39af('0x2e')],_0x30024b[_0x39af('0x2c')]);_0x538ad9['attributes']=_['intersection'](_0x30024b[_0x39af('0x2e')],qs[_0x39af('0x2f')](_0x2b4725[_0x39af('0x2c')][_0x39af('0x2f')]));_0x538ad9[_0x39af('0x30')]=_0x538ad9[_0x39af('0x30')][_0x39af('0x31')]?_0x538ad9[_0x39af('0x30')]:_0x30024b[_0x39af('0x2e')];if(!_0x2b4725[_0x39af('0x2c')][_0x39af('0x32')](_0x39af('0x33'))){_0x538ad9[_0x39af('0x1c')]=qs['limit'](_0x2b4725[_0x39af('0x2c')]['limit']);_0x538ad9[_0x39af('0x19')]=qs[_0x39af('0x19')](_0x2b4725[_0x39af('0x2c')]['offset']);}_0x538ad9['order']=qs[_0x39af('0x34')](_0x2b4725[_0x39af('0x2c')]['sort']);_0x538ad9[_0x39af('0x35')]=qs[_0x39af('0x2d')](_['pick'](_0x2b4725['query'],_0x30024b['filters']),_0x33b578);if(_0x2b4725[_0x39af('0x2c')][_0x39af('0x36')]){_0x538ad9[_0x39af('0x35')]=_['merge'](_0x538ad9['where'],{'$or':_['map'](_0x33b578,function(_0x4e9814){if(_0x4e9814[_0x39af('0x28')]!=='VIRTUAL'){var _0x1a2535={};_0x1a2535[_0x4e9814[_0x39af('0x2b')]]={'$like':'%'+_0x2b4725['query']['filter']+'%'};return _0x1a2535;}})});}_0x538ad9=_[_0x39af('0x37')]({},_0x538ad9,_0x2b4725[_0x39af('0x38')]);var _0x15bc0e={'where':_0x538ad9[_0x39af('0x35')]};return db[_0x39af('0x25')][_0x39af('0x1b')](_0x15bc0e)[_0x39af('0x22')](function(_0x398572){_0x57d421['count']=_0x398572;if(_0x2b4725[_0x39af('0x2c')][_0x39af('0x39')]){_0x538ad9['include']=[{'all':!![]}];}return db[_0x39af('0x25')][_0x39af('0x3a')](_0x538ad9);})[_0x39af('0x22')](function(_0x1e41ce){_0x57d421['rows']=_0x1e41ce;return _0x57d421;})[_0x39af('0x22')](respondWithFilteredResult(_0x4bc32e,_0x538ad9))['catch'](handleError(_0x4bc32e,null));};exports[_0x39af('0x3b')]=function(_0x93a92,_0x564e38){var _0x3fd0ee={'raw':!![],'where':{'id':_0x93a92[_0x39af('0x3c')]['id']}},_0x380871={};_0x380871[_0x39af('0x2e')]=_['keys'](db[_0x39af('0x25')][_0x39af('0x26')]);_0x380871['query']=_['keys'](_0x93a92[_0x39af('0x2c')]);_0x380871[_0x39af('0x2d')]=_[_0x39af('0x3d')](_0x380871[_0x39af('0x2e')],_0x380871[_0x39af('0x2c')]);_0x3fd0ee[_0x39af('0x30')]=_['intersection'](_0x380871['model'],qs[_0x39af('0x2f')](_0x93a92[_0x39af('0x2c')][_0x39af('0x2f')]));_0x3fd0ee[_0x39af('0x30')]=_0x3fd0ee[_0x39af('0x30')][_0x39af('0x31')]?_0x3fd0ee[_0x39af('0x30')]:_0x380871[_0x39af('0x2e')];if(_0x93a92[_0x39af('0x2c')][_0x39af('0x39')]){_0x3fd0ee[_0x39af('0x3e')]=[{'all':!![]}];}_0x3fd0ee=_['merge']({},_0x3fd0ee,_0x93a92['options']);return db[_0x39af('0x25')][_0x39af('0x3f')](_0x3fd0ee)[_0x39af('0x22')](handleEntityNotFound(_0x564e38,null))[_0x39af('0x22')](respondWithResult(_0x564e38,null))[_0x39af('0x40')](handleError(_0x564e38,null));};exports[_0x39af('0x41')]=function(_0x5f1f29,_0x29bc1e){return db[_0x39af('0x25')][_0x39af('0x41')](_0x5f1f29['body'],{})[_0x39af('0x22')](respondWithResult(_0x29bc1e,0xc9))[_0x39af('0x40')](handleError(_0x29bc1e,null));};exports[_0x39af('0x42')]=function(_0x1dd9e2,_0x32fc85){if(_0x1dd9e2['body']['id']){delete _0x1dd9e2[_0x39af('0x43')]['id'];}return db['SmsQueueReport'][_0x39af('0x3f')]({'where':{'id':_0x1dd9e2[_0x39af('0x3c')]['id']}})[_0x39af('0x22')](handleEntityNotFound(_0x32fc85,null))[_0x39af('0x22')](saveUpdates(_0x1dd9e2[_0x39af('0x43')],null))[_0x39af('0x22')](respondWithResult(_0x32fc85,null))[_0x39af('0x40')](handleError(_0x32fc85,null));};exports['destroy']=function(_0x2a1497,_0x2fd8fb){return db[_0x39af('0x25')][_0x39af('0x3f')]({'where':{'id':_0x2a1497[_0x39af('0x3c')]['id']}})[_0x39af('0x22')](handleEntityNotFound(_0x2fd8fb,null))[_0x39af('0x22')](removeEntity(_0x2fd8fb,null))[_0x39af('0x40')](handleError(_0x2fd8fb,null));};exports[_0x39af('0x44')]=function(_0x3f3bff,_0x4c7eea){return db[_0x39af('0x25')]['describe']()[_0x39af('0x22')](respondWithResult(_0x4c7eea,null))[_0x39af('0x40')](handleError(_0x4c7eea,null));}; \ No newline at end of file +var _0xce2a=['merge','include','findAll','rows','catch','params','includeAll','options','create','body','find','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL'];(function(_0xd1190e,_0x356b17){var _0x36d815=function(_0x8a2442){while(--_0x8a2442){_0xd1190e['push'](_0xd1190e['shift']());}};_0x36d815(++_0x356b17);}(_0xce2a,0x135));var _0xace2=function(_0x5c189f,_0x156d25){_0x5c189f=_0x5c189f-0x0;var _0x3dadb3=_0xce2a[_0x5c189f];return _0x3dadb3;};'use strict';var emlformat=require(_0xace2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xace2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xace2('0x2'));var moment=require(_0xace2('0x3'));var BPromise=require(_0xace2('0x4'));var Mustache=require('mustache');var util=require(_0xace2('0x5'));var path=require('path');var sox=require(_0xace2('0x6'));var csv=require(_0xace2('0x7'));var ejs=require(_0xace2('0x8'));var fs=require('fs');var fs_extra=require(_0xace2('0x9'));var _=require('lodash');var squel=require(_0xace2('0xa'));var crypto=require('crypto');var jsforce=require(_0xace2('0xb'));var deskjs=require(_0xace2('0xc'));var toCsv=require(_0xace2('0x7'));var querystring=require(_0xace2('0xd'));var Papa=require(_0xace2('0xe'));var Redis=require(_0xace2('0xf'));var authService=require(_0xace2('0x10'));var qs=require(_0xace2('0x11'));var as=require(_0xace2('0x12'));var hardwareService=require(_0xace2('0x13'));var logger=require('../../config/logger')(_0xace2('0x14'));var utils=require(_0xace2('0x15'));var config=require(_0xace2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xace2('0x17'))['db'];function respondWithStatusCode(_0x4cea14,_0x45a1dd){_0x45a1dd=_0x45a1dd||0xcc;return function(_0x5d65db){if(_0x5d65db){return _0x4cea14[_0xace2('0x18')](_0x45a1dd);}return _0x4cea14['status'](_0x45a1dd)[_0xace2('0x19')]();};}function respondWithResult(_0x4b4e3a,_0x176cea){_0x176cea=_0x176cea||0xc8;return function(_0x321149){if(_0x321149){return _0x4b4e3a[_0xace2('0x1a')](_0x176cea)['json'](_0x321149);}};}function respondWithFilteredResult(_0x3a06cd,_0x358f19){return function(_0x1c08b8){if(_0x1c08b8){var _0x521201=typeof _0x358f19['offset']===_0xace2('0x1b')&&typeof _0x358f19[_0xace2('0x1c')]===_0xace2('0x1b');var _0x265c1d=_0x1c08b8[_0xace2('0x1d')];var _0x12d187=_0x521201?0x0:_0x358f19[_0xace2('0x1e')];var _0x151f7a=_0x521201?_0x1c08b8[_0xace2('0x1d')]:_0x358f19[_0xace2('0x1e')]+_0x358f19[_0xace2('0x1c')];var _0x194660;if(_0x151f7a>=_0x265c1d){_0x151f7a=_0x265c1d;_0x194660=0xc8;}else{_0x194660=0xce;}_0x3a06cd[_0xace2('0x1a')](_0x194660);return _0x3a06cd[_0xace2('0x1f')](_0xace2('0x20'),_0x12d187+'-'+_0x151f7a+'/'+_0x265c1d)['json'](_0x1c08b8);}return null;};}function patchUpdates(_0x563fc0){return function(_0x49f0bd){try{jsonpatch['apply'](_0x49f0bd,_0x563fc0,!![]);}catch(_0x1adc26){return BPromise[_0xace2('0x21')](_0x1adc26);}return _0x49f0bd[_0xace2('0x22')]();};}function saveUpdates(_0xb99dfc,_0x2a791f){return function(_0x51f52a){if(_0x51f52a){return _0x51f52a[_0xace2('0x23')](_0xb99dfc)[_0xace2('0x24')](function(_0x50d283){return _0x50d283;});}return null;};}function removeEntity(_0x41344a,_0x5f2f85){return function(_0x232dd1){if(_0x232dd1){return _0x232dd1['destroy']()['then'](function(){_0x41344a['status'](0xcc)[_0xace2('0x19')]();});}};}function handleEntityNotFound(_0x498c76,_0x47bddb){return function(_0x49a1b6){if(!_0x49a1b6){_0x498c76['sendStatus'](0x194);}return _0x49a1b6;};}function handleError(_0x344cae,_0x433284){_0x433284=_0x433284||0x1f4;return function(_0x238b9a){logger[_0xace2('0x25')](_0x238b9a[_0xace2('0x26')]);if(_0x238b9a[_0xace2('0x27')]){delete _0x238b9a['name'];}_0x344cae[_0xace2('0x1a')](_0x433284)['send'](_0x238b9a);};}exports['index']=function(_0x4f0efc,_0x211e70){var _0x1fbdc9={},_0x2db3ed={},_0x460a72={'count':0x0,'rows':[]};var _0x28e464=_[_0xace2('0x28')](db[_0xace2('0x29')][_0xace2('0x2a')],function(_0xe8c66e){return{'name':_0xe8c66e[_0xace2('0x2b')],'type':_0xe8c66e[_0xace2('0x2c')][_0xace2('0x2d')]};});_0x2db3ed[_0xace2('0x2e')]=_[_0xace2('0x28')](_0x28e464,_0xace2('0x27'));_0x2db3ed[_0xace2('0x2f')]=_[_0xace2('0x30')](_0x4f0efc[_0xace2('0x2f')]);_0x2db3ed[_0xace2('0x31')]=_[_0xace2('0x32')](_0x2db3ed[_0xace2('0x2e')],_0x2db3ed[_0xace2('0x2f')]);_0x1fbdc9[_0xace2('0x33')]=_[_0xace2('0x32')](_0x2db3ed[_0xace2('0x2e')],qs['fields'](_0x4f0efc[_0xace2('0x2f')][_0xace2('0x34')]));_0x1fbdc9[_0xace2('0x33')]=_0x1fbdc9[_0xace2('0x33')][_0xace2('0x35')]?_0x1fbdc9[_0xace2('0x33')]:_0x2db3ed[_0xace2('0x2e')];if(!_0x4f0efc[_0xace2('0x2f')][_0xace2('0x36')](_0xace2('0x37'))){_0x1fbdc9[_0xace2('0x1c')]=qs[_0xace2('0x1c')](_0x4f0efc[_0xace2('0x2f')]['limit']);_0x1fbdc9[_0xace2('0x1e')]=qs[_0xace2('0x1e')](_0x4f0efc[_0xace2('0x2f')][_0xace2('0x1e')]);}_0x1fbdc9[_0xace2('0x38')]=qs[_0xace2('0x39')](_0x4f0efc[_0xace2('0x2f')]['sort']);_0x1fbdc9['where']=qs[_0xace2('0x31')](_['pick'](_0x4f0efc[_0xace2('0x2f')],_0x2db3ed[_0xace2('0x31')]),_0x28e464);if(_0x4f0efc[_0xace2('0x2f')][_0xace2('0x3a')]){_0x1fbdc9['where']=_['merge'](_0x1fbdc9[_0xace2('0x3b')],{'$or':_[_0xace2('0x28')](_0x28e464,function(_0x40ccac){if(_0x40ccac[_0xace2('0x2c')]!==_0xace2('0x3c')){var _0x65398b={};_0x65398b[_0x40ccac[_0xace2('0x27')]]={'$like':'%'+_0x4f0efc[_0xace2('0x2f')][_0xace2('0x3a')]+'%'};return _0x65398b;}})});}_0x1fbdc9=_[_0xace2('0x3d')]({},_0x1fbdc9,_0x4f0efc['options']);var _0x386db1={'where':_0x1fbdc9[_0xace2('0x3b')]};return db['SmsQueueReport'][_0xace2('0x1d')](_0x386db1)[_0xace2('0x24')](function(_0x19f8af){_0x460a72[_0xace2('0x1d')]=_0x19f8af;if(_0x4f0efc['query']['includeAll']){_0x1fbdc9[_0xace2('0x3e')]=[{'all':!![]}];}return db[_0xace2('0x29')][_0xace2('0x3f')](_0x1fbdc9);})[_0xace2('0x24')](function(_0x4c27b5){_0x460a72[_0xace2('0x40')]=_0x4c27b5;return _0x460a72;})[_0xace2('0x24')](respondWithFilteredResult(_0x211e70,_0x1fbdc9))[_0xace2('0x41')](handleError(_0x211e70,null));};exports['show']=function(_0x240d5b,_0x4e036a){var _0x7ec8f5={'raw':!![],'where':{'id':_0x240d5b[_0xace2('0x42')]['id']}},_0x1e8e7c={};_0x1e8e7c[_0xace2('0x2e')]=_[_0xace2('0x30')](db[_0xace2('0x29')]['rawAttributes']);_0x1e8e7c[_0xace2('0x2f')]=_[_0xace2('0x30')](_0x240d5b['query']);_0x1e8e7c['filters']=_['intersection'](_0x1e8e7c[_0xace2('0x2e')],_0x1e8e7c[_0xace2('0x2f')]);_0x7ec8f5[_0xace2('0x33')]=_[_0xace2('0x32')](_0x1e8e7c[_0xace2('0x2e')],qs[_0xace2('0x34')](_0x240d5b['query'][_0xace2('0x34')]));_0x7ec8f5[_0xace2('0x33')]=_0x7ec8f5['attributes']['length']?_0x7ec8f5['attributes']:_0x1e8e7c['model'];if(_0x240d5b[_0xace2('0x2f')][_0xace2('0x43')]){_0x7ec8f5[_0xace2('0x3e')]=[{'all':!![]}];}_0x7ec8f5=_[_0xace2('0x3d')]({},_0x7ec8f5,_0x240d5b[_0xace2('0x44')]);return db[_0xace2('0x29')]['find'](_0x7ec8f5)[_0xace2('0x24')](handleEntityNotFound(_0x4e036a,null))[_0xace2('0x24')](respondWithResult(_0x4e036a,null))[_0xace2('0x41')](handleError(_0x4e036a,null));};exports[_0xace2('0x45')]=function(_0x592a58,_0x1d280d){return db[_0xace2('0x29')][_0xace2('0x45')](_0x592a58[_0xace2('0x46')],{})[_0xace2('0x24')](respondWithResult(_0x1d280d,0xc9))[_0xace2('0x41')](handleError(_0x1d280d,null));};exports[_0xace2('0x23')]=function(_0x7431a5,_0x15c9e5){if(_0x7431a5[_0xace2('0x46')]['id']){delete _0x7431a5[_0xace2('0x46')]['id'];}return db[_0xace2('0x29')][_0xace2('0x47')]({'where':{'id':_0x7431a5[_0xace2('0x42')]['id']}})[_0xace2('0x24')](handleEntityNotFound(_0x15c9e5,null))[_0xace2('0x24')](saveUpdates(_0x7431a5[_0xace2('0x46')],null))[_0xace2('0x24')](respondWithResult(_0x15c9e5,null))[_0xace2('0x41')](handleError(_0x15c9e5,null));};exports[_0xace2('0x48')]=function(_0x267773,_0x649a7c){return db[_0xace2('0x29')]['find']({'where':{'id':_0x267773[_0xace2('0x42')]['id']}})['then'](handleEntityNotFound(_0x649a7c,null))['then'](removeEntity(_0x649a7c,null))['catch'](handleError(_0x649a7c,null));};exports[_0xace2('0x49')]=function(_0x424964,_0x1e225f){return db['SmsQueueReport'][_0xace2('0x49')]()[_0xace2('0x24')](respondWithResult(_0x1e225f,null))[_0xace2('0x41')](handleError(_0x1e225f,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1ac2de3..1ad4d19 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_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 +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55dfbc,_0x155b9c){var _0x3ff2f9=function(_0x1e6fde){while(--_0x1e6fde){_0x55dfbc['push'](_0x55dfbc['shift']());}};_0x3ff2f9(++_0x155b9c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8d71c73..ede970a 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 _0xe130=['catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','UpdateSmsQueueReport','update','where','limit','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x27a864,_0x1d53b2){var _0x3a138e=function(_0x3446db){while(--_0x3446db){_0x27a864['push'](_0x27a864['shift']());}};_0x3a138e(++_0x1d53b2);}(_0xe130,0xeb));var _0x0e13=function(_0xeb1a30,_0x42df16){_0xeb1a30=_0xeb1a30-0x0;var _0x41fd4e=_0xe130[_0xeb1a30];return _0x41fd4e;};'use strict';var _=require(_0x0e13('0x0'));var util=require('util');var moment=require(_0x0e13('0x1'));var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e13('0x4'))['db'];var utils=require(_0x0e13('0x5'));var logger=require(_0x0e13('0x6'))(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson['client'][_0x0e13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328f96,_0x2bb084,_0x5ece31){return new BPromise(function(_0x51b14a,_0x1d960c){return client[_0x0e13('0xb')](_0x328f96,_0x5ece31)[_0x0e13('0xc')](function(_0x41307c){logger[_0x0e13('0xd')](_0x0e13('0xe'),_0x2bb084,'request\x20sent');logger[_0x0e13('0xf')](_0x0e13('0x10'),_0x2bb084,_0x0e13('0x11'),JSON['stringify'](_0x41307c));if(_0x41307c[_0x0e13('0x12')]){if(_0x41307c[_0x0e13('0x12')]['code']===0x1f4){logger[_0x0e13('0x12')](_0x0e13('0xe'),_0x2bb084,_0x41307c[_0x0e13('0x12')][_0x0e13('0x13')]);return _0x1d960c(_0x41307c['error'][_0x0e13('0x13')]);}logger[_0x0e13('0x12')](_0x0e13('0xe'),_0x2bb084,_0x41307c[_0x0e13('0x12')][_0x0e13('0x13')]);return _0x51b14a(_0x41307c[_0x0e13('0x12')][_0x0e13('0x13')]);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x2bb084,_0x0e13('0x11'));_0x51b14a(_0x41307c[_0x0e13('0x14')][_0x0e13('0x13')]);}})[_0x0e13('0x15')](function(_0x510ecc){logger['error'](_0x0e13('0xe'),_0x2bb084,_0x510ecc);_0x1d960c(_0x510ecc);});});}exports[_0x0e13('0x16')]=function(_0x3252ed){var _0x4af74d=this;return new Promise(function(_0xa22372,_0x1857f3){return db[_0x0e13('0x17')]['create'](_0x3252ed[_0x0e13('0x18')],{'raw':_0x3252ed[_0x0e13('0x19')]?_0x3252ed[_0x0e13('0x19')][_0x0e13('0x1a')]===undefined?!![]:![]:!![]})[_0x0e13('0xc')](function(_0x16f346){logger[_0x0e13('0xd')](_0x0e13('0x16'),_0x3252ed);logger[_0x0e13('0xf')](_0x0e13('0x16'),_0x3252ed,JSON['stringify'](_0x16f346));_0xa22372(_0x16f346);})[_0x0e13('0x15')](function(_0x5dd141){logger[_0x0e13('0x12')](_0x0e13('0x16'),_0x5dd141[_0x0e13('0x13')],_0x3252ed);_0x1857f3(_0x4af74d['error'](0x1f4,_0x5dd141['message']));});});};exports[_0x0e13('0x1b')]=function(_0x305045){var _0x478c0a=this;return new Promise(function(_0x114bab,_0x49d517){return db[_0x0e13('0x17')][_0x0e13('0x1c')](_0x305045[_0x0e13('0x18')],{'raw':_0x305045['options']?_0x305045['options'][_0x0e13('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305045[_0x0e13('0x19')]?_0x305045[_0x0e13('0x19')][_0x0e13('0x1d')]||null:null,'attributes':_0x305045[_0x0e13('0x19')]?_0x305045[_0x0e13('0x19')]['attributes']||null:null,'limit':_0x305045[_0x0e13('0x19')]?_0x305045['options'][_0x0e13('0x1e')]||null:null})[_0x0e13('0xc')](function(_0x40fbc2){logger['info'](_0x0e13('0x1b'),_0x305045);logger[_0x0e13('0xf')](_0x0e13('0x1b'),_0x305045,JSON[_0x0e13('0x1f')](_0x40fbc2));_0x114bab(_0x40fbc2);})[_0x0e13('0x15')](function(_0x528c6d){logger['error'](_0x0e13('0x1b'),_0x528c6d[_0x0e13('0x13')],_0x305045);_0x49d517(_0x478c0a[_0x0e13('0x12')](0x1f4,_0x528c6d['message']));});});}; \ No newline at end of file +var _0xa4b5=['result','catch','SmsQueueReport','create','body','options','CreateSmsQueueReport','debug','UpdateSmsQueueReport','raw','where','attributes','limit','util','moment','ioredis','../../config/utils','rpc','client','http','request','then','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xa4b5,0x9e));var _0x5a4b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa4b5[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0x5a4b('0x0'));var moment=require(_0x5a4b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a4b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a4b('0x3'));var logger=require('../../config/logger')(_0x5a4b('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a4b('0x5')][_0x5a4b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b15cf,_0x49d877,_0x4c0505){return new BPromise(function(_0x315d96,_0x36904b){return client[_0x5a4b('0x7')](_0x3b15cf,_0x4c0505)[_0x5a4b('0x8')](function(_0x3ada68){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x49d877,_0x5a4b('0x9'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x49d877,_0x5a4b('0x9'),JSON[_0x5a4b('0xa')](_0x3ada68));if(_0x3ada68[_0x5a4b('0xb')]){if(_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xc')]===0x1f4){logger[_0x5a4b('0xb')](_0x5a4b('0xd'),_0x49d877,_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);return _0x36904b(_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);}logger[_0x5a4b('0xb')](_0x5a4b('0xd'),_0x49d877,_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);return _0x315d96(_0x3ada68[_0x5a4b('0xb')][_0x5a4b('0xe')]);}else{logger[_0x5a4b('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x49d877,_0x5a4b('0x9'));_0x315d96(_0x3ada68[_0x5a4b('0x10')][_0x5a4b('0xe')]);}})[_0x5a4b('0x11')](function(_0x1a568f){logger[_0x5a4b('0xb')](_0x5a4b('0xd'),_0x49d877,_0x1a568f);_0x36904b(_0x1a568f);});});}exports['CreateSmsQueueReport']=function(_0x3ea908){var _0x379f80=this;return new Promise(function(_0x418b91,_0x22934d){return db[_0x5a4b('0x12')][_0x5a4b('0x13')](_0x3ea908[_0x5a4b('0x14')],{'raw':_0x3ea908[_0x5a4b('0x15')]?_0x3ea908[_0x5a4b('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xce88d5){logger[_0x5a4b('0xf')](_0x5a4b('0x16'),_0x3ea908);logger[_0x5a4b('0x17')]('CreateSmsQueueReport',_0x3ea908,JSON[_0x5a4b('0xa')](_0xce88d5));_0x418b91(_0xce88d5);})[_0x5a4b('0x11')](function(_0x26d6e6){logger[_0x5a4b('0xb')](_0x5a4b('0x16'),_0x26d6e6[_0x5a4b('0xe')],_0x3ea908);_0x22934d(_0x379f80[_0x5a4b('0xb')](0x1f4,_0x26d6e6['message']));});});};exports[_0x5a4b('0x18')]=function(_0x38e984){var _0x524c1b=this;return new Promise(function(_0x4f3e72,_0x519246){return db[_0x5a4b('0x12')]['update'](_0x38e984[_0x5a4b('0x14')],{'raw':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x1a')]||null:null,'attributes':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x1b')]||null:null,'limit':_0x38e984[_0x5a4b('0x15')]?_0x38e984[_0x5a4b('0x15')][_0x5a4b('0x1c')]||null:null})[_0x5a4b('0x8')](function(_0x74b215){logger[_0x5a4b('0xf')](_0x5a4b('0x18'),_0x38e984);logger[_0x5a4b('0x17')](_0x5a4b('0x18'),_0x38e984,JSON['stringify'](_0x74b215));_0x4f3e72(_0x74b215);})[_0x5a4b('0x11')](function(_0x47518b){logger[_0x5a4b('0xb')](_0x5a4b('0x18'),_0x47518b[_0x5a4b('0xe')],_0x38e984);_0x519246(_0x524c1b[_0x5a4b('0xb')](0x1f4,_0x47518b['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 216d480..e4c6776 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 _0x5089=['show','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5089,0x1bb));var _0x9508=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x5089[_0x1ee62e];return _0x27c6c8;};'use strict';var multer=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var path=require('path');var timeout=require(_0x9508('0x2'));var express=require(_0x9508('0x3'));var router=express[_0x9508('0x4')]();var fs_extra=require(_0x9508('0x5'));var auth=require(_0x9508('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9508('0x7'));var controller=require('./smsTransferReport.controller');router[_0x9508('0x8')]('/',auth[_0x9508('0x9')](),controller[_0x9508('0xa')]);router['get'](_0x9508('0xb'),auth[_0x9508('0x9')](),controller['describe']);router[_0x9508('0x8')](_0x9508('0xc'),auth['isAuthenticated'](),controller[_0x9508('0xd')]);router['post']('/',auth[_0x9508('0x9')](),controller[_0x9508('0xe')]);router[_0x9508('0xf')](_0x9508('0xc'),auth[_0x9508('0x9')](),controller[_0x9508('0x10')]);router['delete'](_0x9508('0xc'),auth['isAuthenticated'](),controller[_0x9508('0x11')]);module[_0x9508('0x12')]=router; \ No newline at end of file +var _0x25fa=['isAuthenticated','index','get','/describe','describe','/:id','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x25fa,0x109));var _0xa25f=function(_0x17fabd,_0x40830e){_0x17fabd=_0x17fabd-0x0;var _0x3965fb=_0x25fa[_0x17fabd];return _0x3965fb;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0xd')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0xe')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xf')]);router['delete'](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['destroy']);module[_0xa25f('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 6d4055d..4891a58 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x5bf096,_0x13922d){var _0x5852c7=function(_0x5df8e3){while(--_0x5df8e3){_0x5bf096['push'](_0x5bf096['shift']());}};_0x5852c7(++_0x13922d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x00bb[_0x4e9628];return _0x27bc8c;};'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(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x9bde,0xe1));var _0xe9bd=function(_0x117282,_0x4b98d2){_0x117282=_0x117282-0x0;var _0x546b46=_0x9bde[_0x117282];return _0x546b46;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index bfe9671..bd024b4 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 _0x7ca8=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','then','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0xcf9710,_0x52fcad){var _0x548320=function(_0x3be742){while(--_0x3be742){_0xcf9710['push'](_0xcf9710['shift']());}};_0x548320(++_0x52fcad);}(_0x7ca8,0x16c));var _0x87ca=function(_0x264485,_0x13011b){_0x264485=_0x264485-0x0;var _0x342586=_0x7ca8[_0x264485];return _0x342586;};'use strict';var emlformat=require(_0x87ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87ca('0x1'));var jsonpatch=require(_0x87ca('0x2'));var rp=require(_0x87ca('0x3'));var moment=require('moment');var BPromise=require(_0x87ca('0x4'));var Mustache=require(_0x87ca('0x5'));var util=require(_0x87ca('0x6'));var path=require('path');var sox=require(_0x87ca('0x7'));var csv=require('to-csv');var ejs=require(_0x87ca('0x8'));var fs=require('fs');var fs_extra=require(_0x87ca('0x9'));var _=require(_0x87ca('0xa'));var squel=require(_0x87ca('0xb'));var crypto=require(_0x87ca('0xc'));var jsforce=require(_0x87ca('0xd'));var deskjs=require(_0x87ca('0xe'));var toCsv=require(_0x87ca('0xf'));var querystring=require(_0x87ca('0x10'));var Papa=require(_0x87ca('0x11'));var Redis=require('ioredis');var authService=require(_0x87ca('0x12'));var qs=require(_0x87ca('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87ca('0x14'));var logger=require('../../config/logger')(_0x87ca('0x15'));var utils=require('../../config/utils');var config=require(_0x87ca('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x87ca('0x17'))['db'];function respondWithStatusCode(_0x3c1627,_0x501f42){_0x501f42=_0x501f42||0xcc;return function(_0x530068){if(_0x530068){return _0x3c1627[_0x87ca('0x18')](_0x501f42);}return _0x3c1627[_0x87ca('0x19')](_0x501f42)[_0x87ca('0x1a')]();};}function respondWithResult(_0x306229,_0x1d355e){_0x1d355e=_0x1d355e||0xc8;return function(_0x2b95d5){if(_0x2b95d5){return _0x306229['status'](_0x1d355e)[_0x87ca('0x1b')](_0x2b95d5);}};}function respondWithFilteredResult(_0x5db53b,_0x3e70fc){return function(_0x28cf2f){if(_0x28cf2f){var _0xd92c1c=typeof _0x3e70fc[_0x87ca('0x1c')]===_0x87ca('0x1d')&&typeof _0x3e70fc[_0x87ca('0x1e')]==='undefined';var _0xab1fda=_0x28cf2f['count'];var _0x2d20a8=_0xd92c1c?0x0:_0x3e70fc[_0x87ca('0x1c')];var _0x3acdd2=_0xd92c1c?_0x28cf2f[_0x87ca('0x1f')]:_0x3e70fc[_0x87ca('0x1c')]+_0x3e70fc[_0x87ca('0x1e')];var _0x8eee98;if(_0x3acdd2>=_0xab1fda){_0x3acdd2=_0xab1fda;_0x8eee98=0xc8;}else{_0x8eee98=0xce;}_0x5db53b['status'](_0x8eee98);return _0x5db53b[_0x87ca('0x20')](_0x87ca('0x21'),_0x2d20a8+'-'+_0x3acdd2+'/'+_0xab1fda)[_0x87ca('0x1b')](_0x28cf2f);}return null;};}function patchUpdates(_0x1f2a5a){return function(_0x28b505){try{jsonpatch[_0x87ca('0x22')](_0x28b505,_0x1f2a5a,!![]);}catch(_0x447d09){return BPromise[_0x87ca('0x23')](_0x447d09);}return _0x28b505[_0x87ca('0x24')]();};}function saveUpdates(_0x57b451,_0x5565d1){return function(_0x2a3a28){if(_0x2a3a28){return _0x2a3a28[_0x87ca('0x25')](_0x57b451)['then'](function(_0x4e2ae6){return _0x4e2ae6;});}return null;};}function removeEntity(_0x375f2e,_0x219723){return function(_0x6cc9bb){if(_0x6cc9bb){return _0x6cc9bb[_0x87ca('0x26')]()['then'](function(){_0x375f2e[_0x87ca('0x19')](0xcc)[_0x87ca('0x1a')]();});}};}function handleEntityNotFound(_0x4ef26c,_0x1a0146){return function(_0x49a2de){if(!_0x49a2de){_0x4ef26c[_0x87ca('0x18')](0x194);}return _0x49a2de;};}function handleError(_0x2aadda,_0x426159){_0x426159=_0x426159||0x1f4;return function(_0xcbd162){logger[_0x87ca('0x27')](_0xcbd162[_0x87ca('0x28')]);if(_0xcbd162[_0x87ca('0x29')]){delete _0xcbd162[_0x87ca('0x29')];}_0x2aadda[_0x87ca('0x19')](_0x426159)[_0x87ca('0x2a')](_0xcbd162);};}exports[_0x87ca('0x2b')]=function(_0x5ab434,_0xbc25ae){var _0x2b911c={},_0x59f3aa={},_0x2182b7={'count':0x0,'rows':[]};var _0x5713da=_[_0x87ca('0x2c')](db[_0x87ca('0x2d')][_0x87ca('0x2e')],function(_0x2621ad){return{'name':_0x2621ad[_0x87ca('0x2f')],'type':_0x2621ad['type'][_0x87ca('0x30')]};});_0x59f3aa[_0x87ca('0x31')]=_['map'](_0x5713da,_0x87ca('0x29'));_0x59f3aa[_0x87ca('0x32')]=_[_0x87ca('0x33')](_0x5ab434['query']);_0x59f3aa[_0x87ca('0x34')]=_['intersection'](_0x59f3aa['model'],_0x59f3aa[_0x87ca('0x32')]);_0x2b911c[_0x87ca('0x35')]=_[_0x87ca('0x36')](_0x59f3aa['model'],qs[_0x87ca('0x37')](_0x5ab434[_0x87ca('0x32')][_0x87ca('0x37')]));_0x2b911c[_0x87ca('0x35')]=_0x2b911c[_0x87ca('0x35')][_0x87ca('0x38')]?_0x2b911c[_0x87ca('0x35')]:_0x59f3aa[_0x87ca('0x31')];if(!_0x5ab434[_0x87ca('0x32')][_0x87ca('0x39')](_0x87ca('0x3a'))){_0x2b911c[_0x87ca('0x1e')]=qs['limit'](_0x5ab434['query'][_0x87ca('0x1e')]);_0x2b911c[_0x87ca('0x1c')]=qs[_0x87ca('0x1c')](_0x5ab434[_0x87ca('0x32')][_0x87ca('0x1c')]);}_0x2b911c['order']=qs['sort'](_0x5ab434['query'][_0x87ca('0x3b')]);_0x2b911c[_0x87ca('0x3c')]=qs[_0x87ca('0x34')](_[_0x87ca('0x3d')](_0x5ab434[_0x87ca('0x32')],_0x59f3aa[_0x87ca('0x34')]),_0x5713da);if(_0x5ab434['query'][_0x87ca('0x3e')]){_0x2b911c[_0x87ca('0x3c')]=_[_0x87ca('0x3f')](_0x2b911c['where'],{'$or':_['map'](_0x5713da,function(_0x13d833){if(_0x13d833[_0x87ca('0x40')]!=='VIRTUAL'){var _0x117a4a={};_0x117a4a[_0x13d833[_0x87ca('0x29')]]={'$like':'%'+_0x5ab434[_0x87ca('0x32')][_0x87ca('0x3e')]+'%'};return _0x117a4a;}})});}_0x2b911c=_[_0x87ca('0x3f')]({},_0x2b911c,_0x5ab434[_0x87ca('0x41')]);var _0x49bd1b={'where':_0x2b911c[_0x87ca('0x3c')]};return db[_0x87ca('0x2d')][_0x87ca('0x1f')](_0x49bd1b)['then'](function(_0x401b85){_0x2182b7[_0x87ca('0x1f')]=_0x401b85;if(_0x5ab434['query'][_0x87ca('0x42')]){_0x2b911c[_0x87ca('0x43')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x87ca('0x44')](_0x2b911c);})[_0x87ca('0x45')](function(_0x170803){_0x2182b7['rows']=_0x170803;return _0x2182b7;})[_0x87ca('0x45')](respondWithFilteredResult(_0xbc25ae,_0x2b911c))[_0x87ca('0x46')](handleError(_0xbc25ae,null));};exports[_0x87ca('0x47')]=function(_0x556fed,_0x57b010){var _0x3980cd={'raw':!![],'where':{'id':_0x556fed['params']['id']}},_0x22dd21={};_0x22dd21['model']=_[_0x87ca('0x33')](db[_0x87ca('0x2d')]['rawAttributes']);_0x22dd21[_0x87ca('0x32')]=_['keys'](_0x556fed[_0x87ca('0x32')]);_0x22dd21[_0x87ca('0x34')]=_[_0x87ca('0x36')](_0x22dd21[_0x87ca('0x31')],_0x22dd21[_0x87ca('0x32')]);_0x3980cd[_0x87ca('0x35')]=_[_0x87ca('0x36')](_0x22dd21[_0x87ca('0x31')],qs[_0x87ca('0x37')](_0x556fed[_0x87ca('0x32')][_0x87ca('0x37')]));_0x3980cd['attributes']=_0x3980cd[_0x87ca('0x35')]['length']?_0x3980cd[_0x87ca('0x35')]:_0x22dd21[_0x87ca('0x31')];if(_0x556fed[_0x87ca('0x32')][_0x87ca('0x42')]){_0x3980cd[_0x87ca('0x43')]=[{'all':!![]}];}_0x3980cd=_[_0x87ca('0x3f')]({},_0x3980cd,_0x556fed[_0x87ca('0x41')]);return db[_0x87ca('0x2d')][_0x87ca('0x48')](_0x3980cd)[_0x87ca('0x45')](handleEntityNotFound(_0x57b010,null))[_0x87ca('0x45')](respondWithResult(_0x57b010,null))['catch'](handleError(_0x57b010,null));};exports[_0x87ca('0x49')]=function(_0x4770ce,_0x7d89e){return db['SmsTransferReport']['create'](_0x4770ce[_0x87ca('0x4a')],{})[_0x87ca('0x45')](respondWithResult(_0x7d89e,0xc9))['catch'](handleError(_0x7d89e,null));};exports[_0x87ca('0x25')]=function(_0x13da9a,_0x33f6c7){if(_0x13da9a[_0x87ca('0x4a')]['id']){delete _0x13da9a['body']['id'];}return db[_0x87ca('0x2d')]['find']({'where':{'id':_0x13da9a['params']['id']}})[_0x87ca('0x45')](handleEntityNotFound(_0x33f6c7,null))['then'](saveUpdates(_0x13da9a[_0x87ca('0x4a')],null))[_0x87ca('0x45')](respondWithResult(_0x33f6c7,null))[_0x87ca('0x46')](handleError(_0x33f6c7,null));};exports['destroy']=function(_0x9932b2,_0x50c2c1){return db[_0x87ca('0x2d')]['find']({'where':{'id':_0x9932b2[_0x87ca('0x4b')]['id']}})[_0x87ca('0x45')](handleEntityNotFound(_0x50c2c1,null))[_0x87ca('0x45')](removeEntity(_0x50c2c1,null))[_0x87ca('0x46')](handleError(_0x50c2c1,null));};exports[_0x87ca('0x4c')]=function(_0x292e44,_0x28f4be){return db['SmsTransferReport']['describe']()[_0x87ca('0x45')](respondWithResult(_0x28f4be,null))['catch'](handleError(_0x28f4be,null));}; \ No newline at end of file +var _0xc85c=['send','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','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','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name'];(function(_0x1a6f6b,_0x423c2c){var _0x18c73c=function(_0x4d2f9c){while(--_0x4d2f9c){_0x1a6f6b['push'](_0x1a6f6b['shift']());}};_0x18c73c(++_0x423c2c);}(_0xc85c,0x155));var _0xcc85=function(_0x5c6a78,_0x5c0503){_0x5c6a78=_0x5c6a78-0x0;var _0x236c5e=_0xc85c[_0x5c6a78];return _0x236c5e;};'use strict';var emlformat=require(_0xcc85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc85('0x1'));var jsonpatch=require(_0xcc85('0x2'));var rp=require(_0xcc85('0x3'));var moment=require(_0xcc85('0x4'));var BPromise=require(_0xcc85('0x5'));var Mustache=require(_0xcc85('0x6'));var util=require('util');var path=require(_0xcc85('0x7'));var sox=require(_0xcc85('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc85('0x9'));var _=require(_0xcc85('0xa'));var squel=require(_0xcc85('0xb'));var crypto=require(_0xcc85('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcc85('0xd'));var toCsv=require(_0xcc85('0xe'));var querystring=require(_0xcc85('0xf'));var Papa=require(_0xcc85('0x10'));var Redis=require(_0xcc85('0x11'));var authService=require(_0xcc85('0x12'));var qs=require(_0xcc85('0x13'));var as=require(_0xcc85('0x14'));var hardwareService=require(_0xcc85('0x15'));var logger=require(_0xcc85('0x16'))(_0xcc85('0x17'));var utils=require('../../config/utils');var config=require(_0xcc85('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc85('0x19'))['db'];function respondWithStatusCode(_0x38d7b0,_0x3eb9fb){_0x3eb9fb=_0x3eb9fb||0xcc;return function(_0x3c37e4){if(_0x3c37e4){return _0x38d7b0[_0xcc85('0x1a')](_0x3eb9fb);}return _0x38d7b0[_0xcc85('0x1b')](_0x3eb9fb)[_0xcc85('0x1c')]();};}function respondWithResult(_0x2dbccd,_0x3934b4){_0x3934b4=_0x3934b4||0xc8;return function(_0x323a41){if(_0x323a41){return _0x2dbccd['status'](_0x3934b4)[_0xcc85('0x1d')](_0x323a41);}};}function respondWithFilteredResult(_0x5187cf,_0x1421d8){return function(_0x52d123){if(_0x52d123){var _0x13c507=typeof _0x1421d8[_0xcc85('0x1e')]===_0xcc85('0x1f')&&typeof _0x1421d8[_0xcc85('0x20')]===_0xcc85('0x1f');var _0x3b5de6=_0x52d123[_0xcc85('0x21')];var _0x321bd2=_0x13c507?0x0:_0x1421d8[_0xcc85('0x1e')];var _0x2a57d0=_0x13c507?_0x52d123[_0xcc85('0x21')]:_0x1421d8['offset']+_0x1421d8[_0xcc85('0x20')];var _0x31565d;if(_0x2a57d0>=_0x3b5de6){_0x2a57d0=_0x3b5de6;_0x31565d=0xc8;}else{_0x31565d=0xce;}_0x5187cf['status'](_0x31565d);return _0x5187cf[_0xcc85('0x22')](_0xcc85('0x23'),_0x321bd2+'-'+_0x2a57d0+'/'+_0x3b5de6)[_0xcc85('0x1d')](_0x52d123);}return null;};}function patchUpdates(_0x3b7b67){return function(_0x2ebb8a){try{jsonpatch['apply'](_0x2ebb8a,_0x3b7b67,!![]);}catch(_0x4e7ed8){return BPromise[_0xcc85('0x24')](_0x4e7ed8);}return _0x2ebb8a[_0xcc85('0x25')]();};}function saveUpdates(_0x516252,_0x529ec8){return function(_0x56391a){if(_0x56391a){return _0x56391a[_0xcc85('0x26')](_0x516252)[_0xcc85('0x27')](function(_0x2be892){return _0x2be892;});}return null;};}function removeEntity(_0x1109c3,_0x52539f){return function(_0x14df17){if(_0x14df17){return _0x14df17[_0xcc85('0x28')]()[_0xcc85('0x27')](function(){_0x1109c3['status'](0xcc)[_0xcc85('0x1c')]();});}};}function handleEntityNotFound(_0xaaff66,_0x1cc652){return function(_0x4e595d){if(!_0x4e595d){_0xaaff66[_0xcc85('0x1a')](0x194);}return _0x4e595d;};}function handleError(_0xd1f3c1,_0x8af74c){_0x8af74c=_0x8af74c||0x1f4;return function(_0x4aba04){logger[_0xcc85('0x29')](_0x4aba04[_0xcc85('0x2a')]);if(_0x4aba04[_0xcc85('0x2b')]){delete _0x4aba04[_0xcc85('0x2b')];}_0xd1f3c1[_0xcc85('0x1b')](_0x8af74c)[_0xcc85('0x2c')](_0x4aba04);};}exports['index']=function(_0x213266,_0x525375){var _0x1f1d23={},_0x4004f5={},_0x579eb7={'count':0x0,'rows':[]};var _0x2f16f1=_['map'](db[_0xcc85('0x2d')][_0xcc85('0x2e')],function(_0x2884df){return{'name':_0x2884df['fieldName'],'type':_0x2884df[_0xcc85('0x2f')][_0xcc85('0x30')]};});_0x4004f5[_0xcc85('0x31')]=_['map'](_0x2f16f1,'name');_0x4004f5[_0xcc85('0x32')]=_[_0xcc85('0x33')](_0x213266[_0xcc85('0x32')]);_0x4004f5[_0xcc85('0x34')]=_[_0xcc85('0x35')](_0x4004f5[_0xcc85('0x31')],_0x4004f5[_0xcc85('0x32')]);_0x1f1d23['attributes']=_[_0xcc85('0x35')](_0x4004f5['model'],qs['fields'](_0x213266[_0xcc85('0x32')][_0xcc85('0x36')]));_0x1f1d23['attributes']=_0x1f1d23[_0xcc85('0x37')][_0xcc85('0x38')]?_0x1f1d23[_0xcc85('0x37')]:_0x4004f5[_0xcc85('0x31')];if(!_0x213266[_0xcc85('0x32')][_0xcc85('0x39')](_0xcc85('0x3a'))){_0x1f1d23[_0xcc85('0x20')]=qs[_0xcc85('0x20')](_0x213266[_0xcc85('0x32')]['limit']);_0x1f1d23['offset']=qs['offset'](_0x213266[_0xcc85('0x32')][_0xcc85('0x1e')]);}_0x1f1d23['order']=qs[_0xcc85('0x3b')](_0x213266[_0xcc85('0x32')][_0xcc85('0x3b')]);_0x1f1d23[_0xcc85('0x3c')]=qs[_0xcc85('0x34')](_[_0xcc85('0x3d')](_0x213266[_0xcc85('0x32')],_0x4004f5[_0xcc85('0x34')]),_0x2f16f1);if(_0x213266['query']['filter']){_0x1f1d23[_0xcc85('0x3c')]=_[_0xcc85('0x3e')](_0x1f1d23['where'],{'$or':_[_0xcc85('0x3f')](_0x2f16f1,function(_0x605959){if(_0x605959[_0xcc85('0x2f')]!=='VIRTUAL'){var _0x5d4900={};_0x5d4900[_0x605959['name']]={'$like':'%'+_0x213266['query'][_0xcc85('0x40')]+'%'};return _0x5d4900;}})});}_0x1f1d23=_['merge']({},_0x1f1d23,_0x213266['options']);var _0x58ad39={'where':_0x1f1d23[_0xcc85('0x3c')]};return db['SmsTransferReport'][_0xcc85('0x21')](_0x58ad39)['then'](function(_0x2502e2){_0x579eb7[_0xcc85('0x21')]=_0x2502e2;if(_0x213266['query'][_0xcc85('0x41')]){_0x1f1d23['include']=[{'all':!![]}];}return db[_0xcc85('0x2d')][_0xcc85('0x42')](_0x1f1d23);})[_0xcc85('0x27')](function(_0x54df1d){_0x579eb7[_0xcc85('0x43')]=_0x54df1d;return _0x579eb7;})[_0xcc85('0x27')](respondWithFilteredResult(_0x525375,_0x1f1d23))[_0xcc85('0x44')](handleError(_0x525375,null));};exports[_0xcc85('0x45')]=function(_0x35f6e4,_0x616047){var _0x5df4c1={'raw':!![],'where':{'id':_0x35f6e4[_0xcc85('0x46')]['id']}},_0x570af3={};_0x570af3[_0xcc85('0x31')]=_[_0xcc85('0x33')](db['SmsTransferReport']['rawAttributes']);_0x570af3[_0xcc85('0x32')]=_['keys'](_0x35f6e4['query']);_0x570af3[_0xcc85('0x34')]=_[_0xcc85('0x35')](_0x570af3['model'],_0x570af3[_0xcc85('0x32')]);_0x5df4c1[_0xcc85('0x37')]=_[_0xcc85('0x35')](_0x570af3[_0xcc85('0x31')],qs[_0xcc85('0x36')](_0x35f6e4['query']['fields']));_0x5df4c1[_0xcc85('0x37')]=_0x5df4c1[_0xcc85('0x37')][_0xcc85('0x38')]?_0x5df4c1[_0xcc85('0x37')]:_0x570af3[_0xcc85('0x31')];if(_0x35f6e4[_0xcc85('0x32')][_0xcc85('0x41')]){_0x5df4c1[_0xcc85('0x47')]=[{'all':!![]}];}_0x5df4c1=_[_0xcc85('0x3e')]({},_0x5df4c1,_0x35f6e4[_0xcc85('0x48')]);return db[_0xcc85('0x2d')][_0xcc85('0x49')](_0x5df4c1)[_0xcc85('0x27')](handleEntityNotFound(_0x616047,null))[_0xcc85('0x27')](respondWithResult(_0x616047,null))[_0xcc85('0x44')](handleError(_0x616047,null));};exports[_0xcc85('0x4a')]=function(_0x15ded8,_0x423558){return db[_0xcc85('0x2d')][_0xcc85('0x4a')](_0x15ded8[_0xcc85('0x4b')],{})[_0xcc85('0x27')](respondWithResult(_0x423558,0xc9))[_0xcc85('0x44')](handleError(_0x423558,null));};exports[_0xcc85('0x26')]=function(_0x4dff94,_0x30d30e){if(_0x4dff94[_0xcc85('0x4b')]['id']){delete _0x4dff94['body']['id'];}return db[_0xcc85('0x2d')]['find']({'where':{'id':_0x4dff94[_0xcc85('0x46')]['id']}})[_0xcc85('0x27')](handleEntityNotFound(_0x30d30e,null))[_0xcc85('0x27')](saveUpdates(_0x4dff94[_0xcc85('0x4b')],null))[_0xcc85('0x27')](respondWithResult(_0x30d30e,null))['catch'](handleError(_0x30d30e,null));};exports[_0xcc85('0x28')]=function(_0x3382f8,_0x469f7a){return db[_0xcc85('0x2d')][_0xcc85('0x49')]({'where':{'id':_0x3382f8[_0xcc85('0x46')]['id']}})[_0xcc85('0x27')](handleEntityNotFound(_0x469f7a,null))[_0xcc85('0x27')](removeEntity(_0x469f7a,null))['catch'](handleError(_0x469f7a,null));};exports['describe']=function(_0x159771,_0x26c0d8){return db[_0xcc85('0x2d')][_0xcc85('0x4c')]()['then'](respondWithResult(_0x26c0d8,null))[_0xcc85('0x44')](handleError(_0x26c0d8,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b43ecf3..e73211b 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 _0x3d9e=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_sms_transfer'];(function(_0x30b862,_0x5a1c2a){var _0x295a56=function(_0x192eff){while(--_0x192eff){_0x30b862['push'](_0x30b862['shift']());}};_0x295a56(++_0x5a1c2a);}(_0x3d9e,0x181));var _0xe3d9=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x3d9e[_0x2fdce0];return _0x36f07e;};'use strict';var _=require('lodash');var util=require(_0xe3d9('0x0'));var logger=require(_0xe3d9('0x1'))(_0xe3d9('0x2'));var moment=require(_0xe3d9('0x3'));var BPromise=require(_0xe3d9('0x4'));var rp=require(_0xe3d9('0x5'));var fs=require('fs');var path=require(_0xe3d9('0x6'));var rimraf=require(_0xe3d9('0x7'));var config=require(_0xe3d9('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0xe3d9('0x9')]=function(_0xfa896e,_0x178be9){return _0xfa896e['define']('SmsTransferReport',attributes,{'tableName':_0xe3d9('0xa'),'paranoid':![],'indexes':[{'name':_0xe3d9('0xb'),'fields':[_0xe3d9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a3b=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SmsTransferReport','report_sms_transfer','lodash'];(function(_0x78a8f4,_0x259809){var _0x2b3291=function(_0x5e64ca){while(--_0x5e64ca){_0x78a8f4['push'](_0x78a8f4['shift']());}};_0x2b3291(++_0x259809);}(_0x9a3b,0x83));var _0xb9a3=function(_0xfebe8f,_0x54af65){_0xfebe8f=_0xfebe8f-0x0;var _0x4c33a5=_0x9a3b[_0xfebe8f];return _0x4c33a5;};'use strict';var _=require(_0xb9a3('0x0'));var util=require('util');var logger=require(_0xb9a3('0x1'))(_0xb9a3('0x2'));var moment=require(_0xb9a3('0x3'));var BPromise=require(_0xb9a3('0x4'));var rp=require(_0xb9a3('0x5'));var fs=require('fs');var path=require(_0xb9a3('0x6'));var rimraf=require('rimraf');var config=require(_0xb9a3('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xb9a3('0x8')]=function(_0xcd65fa,_0x3093c0){return _0xcd65fa['define'](_0xb9a3('0x9'),attributes,{'tableName':_0xb9a3('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index c20319b..c7b7d14 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 _0x5024=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','SmsTransferReport,\x20%s,\x20%s'];(function(_0x348a50,_0xe211f1){var _0x29beb2=function(_0x1a4036){while(--_0x1a4036){_0x348a50['push'](_0x348a50['shift']());}};_0x29beb2(++_0xe211f1);}(_0x5024,0xf7));var _0x4502=function(_0x23a239,_0x1243a2){_0x23a239=_0x23a239-0x0;var _0x43b49e=_0x5024[_0x23a239];return _0x43b49e;};'use strict';var _=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var moment=require(_0x4502('0x2'));var BPromise=require(_0x4502('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4502('0x4'));var db=require(_0x4502('0x5'))['db'];var utils=require(_0x4502('0x6'));var logger=require(_0x4502('0x7'))(_0x4502('0x8'));var config=require(_0x4502('0x9'));var jayson=require(_0x4502('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x429d5f,_0x5a2a47,_0x45d2eb){return new BPromise(function(_0x254536,_0x4997b7){return client['request'](_0x429d5f,_0x45d2eb)[_0x4502('0xb')](function(_0x2fe973){logger['info'](_0x4502('0xc'),_0x5a2a47,_0x4502('0xd'));logger['debug'](_0x4502('0xe'),_0x5a2a47,_0x4502('0xd'),JSON[_0x4502('0xf')](_0x2fe973));if(_0x2fe973[_0x4502('0x10')]){if(_0x2fe973[_0x4502('0x10')][_0x4502('0x11')]===0x1f4){logger['error'](_0x4502('0xc'),_0x5a2a47,_0x2fe973['error'][_0x4502('0x12')]);return _0x4997b7(_0x2fe973[_0x4502('0x10')]['message']);}logger[_0x4502('0x10')](_0x4502('0xc'),_0x5a2a47,_0x2fe973[_0x4502('0x10')][_0x4502('0x12')]);return _0x254536(_0x2fe973[_0x4502('0x10')][_0x4502('0x12')]);}else{logger['info'](_0x4502('0xc'),_0x5a2a47,_0x4502('0xd'));_0x254536(_0x2fe973['result'][_0x4502('0x12')]);}})[_0x4502('0x13')](function(_0x33ab10){logger[_0x4502('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x5a2a47,_0x33ab10);_0x4997b7(_0x33ab10);});});} \ No newline at end of file +var _0x75a2=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','then'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x75a2,0x187));var _0x275a=function(_0x2e0510,_0x3189fe){_0x2e0510=_0x2e0510-0x0;var _0x3a6cd6=_0x75a2[_0x2e0510];return _0x3a6cd6;};'use strict';var _=require(_0x275a('0x0'));var util=require(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require('bluebird');var rs=require(_0x275a('0x3'));var fs=require('fs');var Redis=require(_0x275a('0x4'));var db=require(_0x275a('0x5'))['db'];var utils=require(_0x275a('0x6'));var logger=require('../../config/logger')(_0x275a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32f0cb,_0x12cad9,_0x17ad5e){return new BPromise(function(_0x38b303,_0x525950){return client['request'](_0x32f0cb,_0x17ad5e)[_0x275a('0x8')](function(_0x46f9c7){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x12cad9,'request\x20sent');logger[_0x275a('0x9')](_0x275a('0xa'),_0x12cad9,_0x275a('0xb'),JSON[_0x275a('0xc')](_0x46f9c7));if(_0x46f9c7[_0x275a('0xd')]){if(_0x46f9c7[_0x275a('0xd')][_0x275a('0xe')]===0x1f4){logger[_0x275a('0xd')](_0x275a('0xf'),_0x12cad9,_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);return _0x525950(_0x46f9c7['error'][_0x275a('0x10')]);}logger[_0x275a('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x12cad9,_0x46f9c7['error'][_0x275a('0x10')]);return _0x38b303(_0x46f9c7[_0x275a('0xd')][_0x275a('0x10')]);}else{logger[_0x275a('0x11')](_0x275a('0xf'),_0x12cad9,_0x275a('0xb'));_0x38b303(_0x46f9c7[_0x275a('0x12')][_0x275a('0x10')]);}})[_0x275a('0x13')](function(_0x58e54d){logger['error'](_0x275a('0xf'),_0x12cad9,_0x58e54d);_0x525950(_0x58e54d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index ee439d0..9a61e73 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 _0xda8d=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','/:id','isAuthenticated','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','single','file','create','update','delete','exports','multer'];(function(_0x3046b1,_0x4ed783){var _0x5bef92=function(_0x52cb86){while(--_0x52cb86){_0x3046b1['push'](_0x3046b1['shift']());}};_0x5bef92(++_0x4ed783);}(_0xda8d,0xc7));var _0xdda8=function(_0x12d0bb,_0x56430a){_0x12d0bb=_0x12d0bb-0x0;var _0x44e5af=_0xda8d[_0x12d0bb];return _0x44e5af;};'use strict';var multer=require(_0xdda8('0x0'));var util=require(_0xdda8('0x1'));var path=require(_0xdda8('0x2'));var timeout=require(_0xdda8('0x3'));var express=require('express');var router=express[_0xdda8('0x4')]();var fs_extra=require(_0xdda8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdda8('0x6'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xdda8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdda8('0x7')](_0xdda8('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xdda8('0x7')]('/:id/download',auth[_0xdda8('0x9')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x102c7c,_0x1ef24f,_0x48006d){_0x48006d(null,path[_0xdda8('0xa')](config[_0xdda8('0xb')],_0xdda8('0xc')));},'filename':function(_0x40a322,_0x552839,_0x3b1b54){_0x552839[_0xdda8('0xd')]=_0x552839[_0xdda8('0xd')][_0xdda8('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b1b54(null,util[_0xdda8('0xf')](_0xdda8('0x10'),path[_0xdda8('0x11')](_0x552839[_0xdda8('0xd')],path['extname'](_0x552839[_0xdda8('0xd')])),Date[_0xdda8('0x12')](),path['extname'](_0x552839[_0xdda8('0xd')])));}})});router['post']('/',upload[_0xdda8('0x13')](_0xdda8('0x14')),controller[_0xdda8('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xdda8('0x16')]);router['delete'](_0xdda8('0x8'),auth[_0xdda8('0x9')](),controller[_0xdda8('0x17')]);module[_0xdda8('0x18')]=router; \ No newline at end of file +var _0x4244=['get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./sound.controller'];(function(_0x53ebc7,_0x4550cd){var _0x3af577=function(_0x4c0306){while(--_0x4c0306){_0x53ebc7['push'](_0x53ebc7['shift']());}};_0x3af577(++_0x4550cd);}(_0x4244,0xc3));var _0x4424=function(_0x1611f9,_0xddc39c){_0x1611f9=_0x1611f9-0x0;var _0x1d066d=_0x4244[_0x1611f9];return _0x1d066d;};'use strict';var multer=require(_0x4424('0x0'));var util=require(_0x4424('0x1'));var path=require(_0x4424('0x2'));var timeout=require('connect-timeout');var express=require(_0x4424('0x3'));var router=express[_0x4424('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4424('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4424('0x6'));var controller=require(_0x4424('0x7'));router[_0x4424('0x8')]('/',auth[_0x4424('0x9')](),controller['index']);router[_0x4424('0x8')](_0x4424('0xa'),auth[_0x4424('0x9')](),controller[_0x4424('0xb')]);router[_0x4424('0x8')](_0x4424('0xc'),auth[_0x4424('0x9')](),controller[_0x4424('0xd')]);var upload=multer({'storage':multer[_0x4424('0xe')]({'destination':function(_0x498a08,_0xdfbef5,_0x142663){_0x142663(null,path[_0x4424('0xf')](config[_0x4424('0x10')],_0x4424('0x11')));},'filename':function(_0x315c18,_0x41649d,_0x5a841c){_0x41649d['originalname']=_0x41649d[_0x4424('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a841c(null,util[_0x4424('0x13')](_0x4424('0x14'),path[_0x4424('0x15')](_0x41649d[_0x4424('0x12')],path[_0x4424('0x16')](_0x41649d['originalname'])),Date[_0x4424('0x17')](),path[_0x4424('0x16')](_0x41649d['originalname'])));}})});router['post']('/',upload['single']('file'),controller[_0x4424('0x18')]);router[_0x4424('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x4424('0x1a')]);router['delete']('/:id',auth[_0x4424('0x9')](),controller[_0x4424('0x1b')]);module[_0x4424('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index e291c27..4ad302f 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 _0xb5da=['INTEGER','FLOAT','exports','STRING','name','BIGINT'];(function(_0x15e6fe,_0x1a5c39){var _0x34894d=function(_0x32eec2){while(--_0x32eec2){_0x15e6fe['push'](_0x15e6fe['shift']());}};_0x34894d(++_0x1a5c39);}(_0xb5da,0x98));var _0xab5d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb5da[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0xab5d('0x0')]={'name':{'type':Sequelize[_0xab5d('0x1')],'unique':_0xab5d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xab5d('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xab5d('0x1')]},'original_format':{'type':Sequelize[_0xab5d('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xab5d('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xab5d('0x3')]},'original_sampleRate':{'type':Sequelize[_0xab5d('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xab5d('0x5')]},'converted_sampleCount':{'type':Sequelize[_0xab5d('0x3')]},'converted_channelCount':{'type':Sequelize[_0xab5d('0x4')]},'converted_bitRate':{'type':Sequelize[_0xab5d('0x3')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xef7c=['FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x42724f,_0x41ca00){var _0x355cd9=function(_0x829949){while(--_0x829949){_0x42724f['push'](_0x42724f['shift']());}};_0x355cd9(++_0x41ca00);}(_0xef7c,0x1e8));var _0xcef7=function(_0x206567,_0x33d93c){_0x206567=_0x206567-0x0;var _0x4fedbb=_0xef7c[_0x206567];return _0x4fedbb;};'use strict';var Sequelize=require(_0xcef7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xcef7('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xcef7('0x1')]},'original_format':{'type':Sequelize[_0xcef7('0x1')]},'original_duration':{'type':Sequelize[_0xcef7('0x2')]},'original_sampleCount':{'type':Sequelize[_0xcef7('0x3')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xcef7('0x4')]},'converted_format':{'type':Sequelize[_0xcef7('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xcef7('0x3')]},'converted_channelCount':{'type':Sequelize[_0xcef7('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xcef7('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 705411e..bede6ca 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 _0x65b1=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','get','UserProfileResource','stack','name','map','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','Sound','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','download','params','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','file','originalname','extname','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','error','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','end','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x65b1,0x6f));var _0x165b=function(_0x45832e,_0x1a3019){_0x45832e=_0x45832e-0x0;var _0x5b2ed8=_0x65b1[_0x45832e];return _0x5b2ed8;};'use strict';var emlformat=require(_0x165b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x165b('0x1'));var moment=require(_0x165b('0x2'));var BPromise=require(_0x165b('0x3'));var Mustache=require('mustache');var util=require(_0x165b('0x4'));var path=require(_0x165b('0x5'));var sox=require(_0x165b('0x6'));var csv=require(_0x165b('0x7'));var ejs=require(_0x165b('0x8'));var fs=require('fs');var fs_extra=require(_0x165b('0x9'));var _=require(_0x165b('0xa'));var squel=require(_0x165b('0xb'));var crypto=require(_0x165b('0xc'));var jsforce=require(_0x165b('0xd'));var deskjs=require(_0x165b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x165b('0xf'));var Redis=require(_0x165b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x165b('0x11'));var hardwareService=require(_0x165b('0x12'));var logger=require(_0x165b('0x13'))(_0x165b('0x14'));var utils=require(_0x165b('0x15'));var config=require(_0x165b('0x16'));var licenseUtil=require(_0x165b('0x17'));var db=require(_0x165b('0x18'))['db'];function respondWithStatusCode(_0x2fef2b,_0x1506fa){_0x1506fa=_0x1506fa||0xcc;return function(_0x25fb42){if(_0x25fb42){return _0x2fef2b[_0x165b('0x19')](_0x1506fa);}return _0x2fef2b[_0x165b('0x1a')](_0x1506fa)['end']();};}function respondWithResult(_0x358d95,_0x14f19e){_0x14f19e=_0x14f19e||0xc8;return function(_0x538d70){if(_0x538d70){return _0x358d95[_0x165b('0x1a')](_0x14f19e)[_0x165b('0x1b')](_0x538d70);}};}function respondWithFilteredResult(_0x26c22a,_0x950154){return function(_0x480284){if(_0x480284){var _0x295eac=typeof _0x950154[_0x165b('0x1c')]===_0x165b('0x1d')&&typeof _0x950154[_0x165b('0x1e')]===_0x165b('0x1d');var _0x4b9ffa=_0x480284[_0x165b('0x1f')];var _0x582217=_0x295eac?0x0:_0x950154[_0x165b('0x1c')];var _0x580216=_0x295eac?_0x480284[_0x165b('0x1f')]:_0x950154[_0x165b('0x1c')]+_0x950154[_0x165b('0x1e')];var _0x3c2f0d;if(_0x580216>=_0x4b9ffa){_0x580216=_0x4b9ffa;_0x3c2f0d=0xc8;}else{_0x3c2f0d=0xce;}_0x26c22a['status'](_0x3c2f0d);return _0x26c22a[_0x165b('0x20')]('Content-Range',_0x582217+'-'+_0x580216+'/'+_0x4b9ffa)[_0x165b('0x1b')](_0x480284);}return null;};}function patchUpdates(_0x4c47ed){return function(_0x42e233){try{jsonpatch['apply'](_0x42e233,_0x4c47ed,!![]);}catch(_0x1e0ff9){return BPromise['reject'](_0x1e0ff9);}return _0x42e233['save']();};}function saveUpdates(_0x4e345e,_0x1b8756){return function(_0x49e6fe){if(_0x49e6fe){return _0x49e6fe[_0x165b('0x21')](_0x4e345e)[_0x165b('0x22')](function(_0x393bec){return _0x393bec;});}return null;};}function removeEntity(_0x3eb84e,_0x56bd98){return function(_0x7a524e){if(_0x7a524e){return _0x7a524e[_0x165b('0x23')]()[_0x165b('0x22')](function(){var _0x54a114=_0x7a524e[_0x165b('0x24')]({'plain':!![]});var _0x31582e='Sounds';return db[_0x165b('0x25')][_0x165b('0x23')]({'where':{'type':_0x31582e,'resourceId':_0x54a114['id']}})['then'](function(){return _0x7a524e;});})['then'](function(){_0x3eb84e[_0x165b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd205,_0x5ef6d8){return function(_0x5ff38d){if(!_0x5ff38d){_0x4bd205['sendStatus'](0x194);}return _0x5ff38d;};}function handleError(_0x342212,_0x2c1bd9){_0x2c1bd9=_0x2c1bd9||0x1f4;return function(_0x30550d){logger['error'](_0x30550d[_0x165b('0x26')]);if(_0x30550d[_0x165b('0x27')]){delete _0x30550d[_0x165b('0x27')];}_0x342212[_0x165b('0x1a')](_0x2c1bd9)['send'](_0x30550d);};}exports['index']=function(_0x1fa8bf,_0x3712d8){var _0x238d4e={},_0x275a46={},_0x188dbb={'count':0x0,'rows':[]};var _0x174b1f=_[_0x165b('0x28')](db['Sound']['rawAttributes'],function(_0x585673){return{'name':_0x585673['fieldName'],'type':_0x585673['type'][_0x165b('0x29')]};});_0x275a46[_0x165b('0x2a')]=_[_0x165b('0x28')](_0x174b1f,_0x165b('0x27'));_0x275a46['query']=_[_0x165b('0x2b')](_0x1fa8bf['query']);_0x275a46[_0x165b('0x2c')]=_['intersection'](_0x275a46[_0x165b('0x2a')],_0x275a46[_0x165b('0x2d')]);_0x238d4e[_0x165b('0x2e')]=_[_0x165b('0x2f')](_0x275a46[_0x165b('0x2a')],qs[_0x165b('0x30')](_0x1fa8bf[_0x165b('0x2d')][_0x165b('0x30')]));_0x238d4e[_0x165b('0x2e')]=_0x238d4e['attributes']['length']?_0x238d4e[_0x165b('0x2e')]:_0x275a46['model'];if(!_0x1fa8bf['query'][_0x165b('0x31')](_0x165b('0x32'))){_0x238d4e[_0x165b('0x1e')]=qs[_0x165b('0x1e')](_0x1fa8bf[_0x165b('0x2d')][_0x165b('0x1e')]);_0x238d4e[_0x165b('0x1c')]=qs[_0x165b('0x1c')](_0x1fa8bf[_0x165b('0x2d')][_0x165b('0x1c')]);}_0x238d4e['order']=qs[_0x165b('0x33')](_0x1fa8bf[_0x165b('0x2d')]['sort']);_0x238d4e[_0x165b('0x34')]=qs[_0x165b('0x2c')](_[_0x165b('0x35')](_0x1fa8bf[_0x165b('0x2d')],_0x275a46['filters']),_0x174b1f);if(_0x1fa8bf[_0x165b('0x2d')][_0x165b('0x36')]){_0x238d4e['where']=_['merge'](_0x238d4e[_0x165b('0x34')],{'$or':_[_0x165b('0x28')](_0x174b1f,function(_0x33e80c){if(_0x33e80c['type']!==_0x165b('0x37')){var _0x1f91be={};_0x1f91be[_0x33e80c[_0x165b('0x27')]]={'$like':'%'+_0x1fa8bf[_0x165b('0x2d')][_0x165b('0x36')]+'%'};return _0x1f91be;}})});}_0x238d4e=_[_0x165b('0x38')]({},_0x238d4e,_0x1fa8bf[_0x165b('0x39')]);var _0xc73341={'where':_0x238d4e['where']};return db[_0x165b('0x3a')][_0x165b('0x1f')](_0xc73341)[_0x165b('0x22')](function(_0x1d66e6){_0x188dbb['count']=_0x1d66e6;if(_0x1fa8bf[_0x165b('0x2d')][_0x165b('0x3b')]){_0x238d4e['include']=[{'all':!![]}];}return db['Sound'][_0x165b('0x3c')](_0x238d4e);})[_0x165b('0x22')](function(_0x90614d){_0x188dbb[_0x165b('0x3d')]=_0x90614d;return _0x188dbb;})[_0x165b('0x22')](respondWithFilteredResult(_0x3712d8,_0x238d4e))[_0x165b('0x3e')](handleError(_0x3712d8,null));};exports[_0x165b('0x3f')]=function(_0x13e929,_0x5ebf58){var _0x9cae2c={'raw':!![],'where':{'id':_0x13e929['params']['id']}},_0x52444e={};_0x52444e[_0x165b('0x2a')]=_[_0x165b('0x2b')](db[_0x165b('0x3a')][_0x165b('0x40')]);_0x52444e[_0x165b('0x2d')]=_[_0x165b('0x2b')](_0x13e929[_0x165b('0x2d')]);_0x52444e[_0x165b('0x2c')]=_[_0x165b('0x2f')](_0x52444e[_0x165b('0x2a')],_0x52444e[_0x165b('0x2d')]);_0x9cae2c[_0x165b('0x2e')]=_[_0x165b('0x2f')](_0x52444e[_0x165b('0x2a')],qs['fields'](_0x13e929[_0x165b('0x2d')][_0x165b('0x30')]));_0x9cae2c[_0x165b('0x2e')]=_0x9cae2c[_0x165b('0x2e')][_0x165b('0x41')]?_0x9cae2c[_0x165b('0x2e')]:_0x52444e[_0x165b('0x2a')];if(_0x13e929[_0x165b('0x2d')][_0x165b('0x3b')]){_0x9cae2c[_0x165b('0x42')]=[{'all':!![]}];}_0x9cae2c=_[_0x165b('0x38')]({},_0x9cae2c,_0x13e929[_0x165b('0x39')]);return db['Sound'][_0x165b('0x43')](_0x9cae2c)[_0x165b('0x22')](handleEntityNotFound(_0x5ebf58,null))[_0x165b('0x22')](respondWithResult(_0x5ebf58,null))[_0x165b('0x3e')](handleError(_0x5ebf58,null));};exports[_0x165b('0x44')]=function(_0x161833,_0x727324,_0x2baa8e){return db[_0x165b('0x3a')][_0x165b('0x43')]({'where':{'id':_0x161833[_0x165b('0x45')]['id']},'attributes':[_0x165b('0x27'),_0x165b('0x46'),_0x165b('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x727324,null))['then'](function(_0x66c260){if(_0x66c260){if(!fs[_0x165b('0x48')](path[_0x165b('0x49')](config[_0x165b('0x4a')],'server/files/sounds/converted',_0x66c260['save_name']+'.'+_0x66c260[_0x165b('0x47')]))){throw new db[(_0x165b('0x4b'))][(_0x165b('0x4c'))](_0x165b('0x4d'));}return _0x727324[_0x165b('0x44')](path['join'](config[_0x165b('0x4a')],_0x165b('0x4e'),util[_0x165b('0x4f')](_0x165b('0x50'),_0x66c260['save_name'],_0x66c260[_0x165b('0x47')])),util[_0x165b('0x4f')](_0x165b('0x50'),_0x66c260[_0x165b('0x27')],_0x66c260[_0x165b('0x47')]));}return null;})[_0x165b('0x3e')](handleError(_0x727324,null));};exports['create']=function(_0x167a7e,_0x3ad66d,_0x14a64c){var _0x1a31ac={'name':path['basename'](_0x167a7e[_0x165b('0x51')][_0x165b('0x52')],path[_0x165b('0x53')](_0x167a7e[_0x165b('0x51')][_0x165b('0x52')])),'save_name':path[_0x165b('0x54')](_0x167a7e['file'][_0x165b('0x55')],path[_0x165b('0x53')](_0x167a7e[_0x165b('0x51')]['filename'])),'original_format':path[_0x165b('0x53')](_0x167a7e[_0x165b('0x51')][_0x165b('0x52')])[_0x165b('0x56')](0x1),'converted_format':'wav'};var _0x513f22=path['join'](config[_0x165b('0x4a')],_0x165b('0x57'),_0x167a7e[_0x165b('0x51')][_0x165b('0x55')]);var _0xa4fe52=path['join'](config[_0x165b('0x4a')],_0x165b('0x4e'),util[_0x165b('0x4f')](_0x165b('0x50'),path[_0x165b('0x54')](_0x167a7e[_0x165b('0x51')][_0x165b('0x55')],path[_0x165b('0x53')](_0x167a7e[_0x165b('0x51')][_0x165b('0x55')])),_0x1a31ac[_0x165b('0x47')]));logger[_0x165b('0x58')]('Sound\x20upload\x20filepath:\x20%s',_0x513f22);logger['info'](_0x165b('0x59'),_0xa4fe52);try{fs[_0x165b('0x5a')](_0x513f22,parseInt(_0x165b('0x5b'),0x8));var _0x30d32b=sox[_0x165b('0x5c')](_0x513f22,_0xa4fe52,{'sampleRate':0x1f40,'format':_0x165b('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x30d32b['on'](_0x165b('0x5e'),function(_0x1d157c){fs[_0x165b('0x5f')](_0x513f22);_0x3ad66d[_0x165b('0x1a')](0x1f4)[_0x165b('0x60')](_0x1d157c);});_0x30d32b['on'](_0x165b('0x61'),function(_0x4a2873){_0x1a31ac[_0x165b('0x62')]=isNaN(_0x4a2873[_0x165b('0x63')])?null:_0x4a2873[_0x165b('0x63')]*0x3e8;_0x1a31ac[_0x165b('0x64')]=isNaN(_0x4a2873[_0x165b('0x65')])?null:_0x4a2873[_0x165b('0x65')];_0x1a31ac[_0x165b('0x66')]=isNaN(_0x4a2873['channelCount'])?null:_0x4a2873[_0x165b('0x67')];_0x1a31ac[_0x165b('0x68')]=isNaN(_0x4a2873[_0x165b('0x69')])?null:_0x4a2873['bitRate'];_0x1a31ac[_0x165b('0x6a')]=isNaN(_0x4a2873[_0x165b('0x6b')])?null:_0x4a2873[_0x165b('0x6b')];});_0x30d32b['on']('dest',function(_0x457231){_0x1a31ac[_0x165b('0x6c')]=isNaN(_0x457231[_0x165b('0x63')])?null:_0x457231[_0x165b('0x63')]*0x3e8;_0x1a31ac[_0x165b('0x6d')]=isNaN(_0x457231[_0x165b('0x65')])?null:_0x457231['sampleCount'];_0x1a31ac[_0x165b('0x6e')]=isNaN(_0x457231[_0x165b('0x67')])?null:_0x457231[_0x165b('0x67')];_0x1a31ac[_0x165b('0x6f')]=isNaN(_0x457231[_0x165b('0x69')])?null:_0x457231[_0x165b('0x69')];_0x1a31ac[_0x165b('0x70')]=isNaN(_0x457231['sampleRate'])?null:_0x457231[_0x165b('0x6b')];});_0x30d32b['on']('end',function(){fs[_0x165b('0x5a')](_0xa4fe52,parseInt('0777',0x8));return db[_0x165b('0x3a')][_0x165b('0x71')](_0x1a31ac)[_0x165b('0x22')](function(_0x2d5cb0){var _0x3fac21={'role':_0x167a7e[_0x165b('0x72')][_0x165b('0x73')],'userProfileId':_0x167a7e[_0x165b('0x72')][_0x165b('0x74')]};if(!_0x3fac21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fac21[_0x165b('0x73')]==='user'){var _0x1a139f=_0x2d5cb0[_0x165b('0x24')]({'plain':!![]});return db[_0x165b('0x75')][_0x165b('0x43')]({'where':{'name':_0x165b('0x76'),'userProfileId':_0x3fac21[_0x165b('0x74')]},'raw':!![]})[_0x165b('0x22')](function(_0x31a614){if(_0x31a614&&_0x31a614[_0x165b('0x77')]===0x0){return db[_0x165b('0x25')][_0x165b('0x71')]({'name':_0x1a139f[_0x165b('0x27')],'resourceId':_0x1a139f['id'],'type':_0x31a614[_0x165b('0x27')],'sectionId':_0x31a614['id']},{})[_0x165b('0x22')](function(){return _0x2d5cb0;});}else{return _0x2d5cb0;}})['catch'](function(_0x181d25){logger['error'](_0x165b('0x78'),_0x181d25);throw _0x181d25;});}return _0x2d5cb0;})['then'](respondWithResult(_0x3ad66d,null))[_0x165b('0x3e')](handleError(_0x3ad66d,null));});_0x30d32b[_0x165b('0x79')]();}catch(_0x57be7c){_0x3ad66d['status'](0x1f4)[_0x165b('0x60')](_0x57be7c);}};exports['update']=function(_0x72853c,_0x533894,_0x48e47e){return db[_0x165b('0x3a')][_0x165b('0x43')]({'where':{'id':_0x72853c[_0x165b('0x45')]['id']}})[_0x165b('0x22')](handleEntityNotFound(_0x533894,null))['then'](saveUpdates(_[_0x165b('0x35')](_0x72853c[_0x165b('0x72')],[_0x165b('0x27'),'description']),null))[_0x165b('0x22')](respondWithResult(_0x533894,null))['catch'](handleError(_0x533894,null));};exports['delete']=function(_0x3eade9,_0x1e55b8,_0x96951d){return db[_0x165b('0x3a')][_0x165b('0x43')]({'where':{'id':_0x3eade9[_0x165b('0x45')]['id']}})[_0x165b('0x22')](function(_0x5e9e02){if(_0x5e9e02){return _0x5e9e02[_0x165b('0x23')]();}})[_0x165b('0x22')](function(_0x2d60c7){var _0x48f78c=path[_0x165b('0x49')](config[_0x165b('0x4a')],_0x165b('0x57'),util[_0x165b('0x4f')](_0x165b('0x50'),_0x2d60c7[_0x165b('0x46')],_0x2d60c7['original_format']));var _0xb1f11c=path[_0x165b('0x49')](config['root'],_0x165b('0x4e'),util[_0x165b('0x4f')](_0x165b('0x50'),_0x2d60c7['save_name'],_0x2d60c7[_0x165b('0x47')]));fs[_0x165b('0x5f')](_0x48f78c);fs[_0x165b('0x5f')](_0xb1f11c);return _0x2d60c7;})[_0x165b('0x22')](function(_0x251231){if(_0x251231){return _0x1e55b8[_0x165b('0x1a')](0xcc)[_0x165b('0x7a')]();}})[_0x165b('0x22')](handleEntityNotFound(_0x1e55b8,null))[_0x165b('0x3e')](handleError(_0x1e55b8,null));}; \ No newline at end of file +var _0x7cd3=['delete','server/files/sounds/original','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','limit','status','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','Sound','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','download','save_name','join','Sequelize','root','server/files/sounds/converted','format','converted_format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','UserProfileSection','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick'];(function(_0xfde474,_0x602e9a){var _0x2b1b28=function(_0x127c0c){while(--_0x127c0c){_0xfde474['push'](_0xfde474['shift']());}};_0x2b1b28(++_0x602e9a);}(_0x7cd3,0x7b));var _0x37cd=function(_0x5689dc,_0x227782){_0x5689dc=_0x5689dc-0x0;var _0x2635ac=_0x7cd3[_0x5689dc];return _0x2635ac;};'use strict';var emlformat=require(_0x37cd('0x0'));var rimraf=require(_0x37cd('0x1'));var zipdir=require(_0x37cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37cd('0x3'));var moment=require(_0x37cd('0x4'));var BPromise=require(_0x37cd('0x5'));var Mustache=require(_0x37cd('0x6'));var util=require(_0x37cd('0x7'));var path=require(_0x37cd('0x8'));var sox=require('sox');var csv=require(_0x37cd('0x9'));var ejs=require(_0x37cd('0xa'));var fs=require('fs');var fs_extra=require(_0x37cd('0xb'));var _=require(_0x37cd('0xc'));var squel=require(_0x37cd('0xd'));var crypto=require(_0x37cd('0xe'));var jsforce=require(_0x37cd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x37cd('0x9'));var querystring=require(_0x37cd('0x10'));var Papa=require('papaparse');var Redis=require(_0x37cd('0x11'));var authService=require(_0x37cd('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37cd('0x13'));var logger=require(_0x37cd('0x14'))(_0x37cd('0x15'));var utils=require(_0x37cd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x37cd('0x17'));var db=require(_0x37cd('0x18'))['db'];function respondWithStatusCode(_0x98af6a,_0x330df7){_0x330df7=_0x330df7||0xcc;return function(_0x426f9e){if(_0x426f9e){return _0x98af6a[_0x37cd('0x19')](_0x330df7);}return _0x98af6a['status'](_0x330df7)['end']();};}function respondWithResult(_0x3491f3,_0x21d1d1){_0x21d1d1=_0x21d1d1||0xc8;return function(_0x25e5e3){if(_0x25e5e3){return _0x3491f3['status'](_0x21d1d1)['json'](_0x25e5e3);}};}function respondWithFilteredResult(_0x4275da,_0x192332){return function(_0x1c41f){if(_0x1c41f){var _0x1f804f=typeof _0x192332[_0x37cd('0x1a')]===_0x37cd('0x1b')&&typeof _0x192332['limit']==='undefined';var _0x905700=_0x1c41f[_0x37cd('0x1c')];var _0x5c0b05=_0x1f804f?0x0:_0x192332[_0x37cd('0x1a')];var _0x3c785d=_0x1f804f?_0x1c41f[_0x37cd('0x1c')]:_0x192332[_0x37cd('0x1a')]+_0x192332[_0x37cd('0x1d')];var _0x135684;if(_0x3c785d>=_0x905700){_0x3c785d=_0x905700;_0x135684=0xc8;}else{_0x135684=0xce;}_0x4275da[_0x37cd('0x1e')](_0x135684);return _0x4275da[_0x37cd('0x1f')](_0x37cd('0x20'),_0x5c0b05+'-'+_0x3c785d+'/'+_0x905700)['json'](_0x1c41f);}return null;};}function patchUpdates(_0x3eedf7){return function(_0x3a02ca){try{jsonpatch[_0x37cd('0x21')](_0x3a02ca,_0x3eedf7,!![]);}catch(_0x36453c){return BPromise[_0x37cd('0x22')](_0x36453c);}return _0x3a02ca['save']();};}function saveUpdates(_0x1e292f,_0x16b750){return function(_0x3602af){if(_0x3602af){return _0x3602af[_0x37cd('0x23')](_0x1e292f)[_0x37cd('0x24')](function(_0xcb5127){return _0xcb5127;});}return null;};}function removeEntity(_0x3de422,_0x3658b9){return function(_0x3f5827){if(_0x3f5827){return _0x3f5827[_0x37cd('0x25')]()['then'](function(){var _0x2363de=_0x3f5827[_0x37cd('0x26')]({'plain':!![]});var _0x4d2b28='Sounds';return db[_0x37cd('0x27')]['destroy']({'where':{'type':_0x4d2b28,'resourceId':_0x2363de['id']}})[_0x37cd('0x24')](function(){return _0x3f5827;});})[_0x37cd('0x24')](function(){_0x3de422[_0x37cd('0x1e')](0xcc)[_0x37cd('0x28')]();});}};}function handleEntityNotFound(_0x4fde30,_0x26067d){return function(_0x21c095){if(!_0x21c095){_0x4fde30[_0x37cd('0x19')](0x194);}return _0x21c095;};}function handleError(_0x22a41a,_0x488e3c){_0x488e3c=_0x488e3c||0x1f4;return function(_0x36603){logger[_0x37cd('0x29')](_0x36603[_0x37cd('0x2a')]);if(_0x36603[_0x37cd('0x2b')]){delete _0x36603[_0x37cd('0x2b')];}_0x22a41a['status'](_0x488e3c)[_0x37cd('0x2c')](_0x36603);};}exports['index']=function(_0x110e9b,_0x23e9df){var _0x3c5734={},_0xb76d1e={},_0x1accb4={'count':0x0,'rows':[]};var _0x4782eb=_['map'](db[_0x37cd('0x2d')][_0x37cd('0x2e')],function(_0x58cca2){return{'name':_0x58cca2[_0x37cd('0x2f')],'type':_0x58cca2[_0x37cd('0x30')][_0x37cd('0x31')]};});_0xb76d1e['model']=_[_0x37cd('0x32')](_0x4782eb,_0x37cd('0x2b'));_0xb76d1e[_0x37cd('0x33')]=_[_0x37cd('0x34')](_0x110e9b[_0x37cd('0x33')]);_0xb76d1e[_0x37cd('0x35')]=_[_0x37cd('0x36')](_0xb76d1e['model'],_0xb76d1e['query']);_0x3c5734[_0x37cd('0x37')]=_[_0x37cd('0x36')](_0xb76d1e[_0x37cd('0x38')],qs[_0x37cd('0x39')](_0x110e9b['query'][_0x37cd('0x39')]));_0x3c5734[_0x37cd('0x37')]=_0x3c5734[_0x37cd('0x37')][_0x37cd('0x3a')]?_0x3c5734[_0x37cd('0x37')]:_0xb76d1e['model'];if(!_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3b')](_0x37cd('0x3c'))){_0x3c5734[_0x37cd('0x1d')]=qs[_0x37cd('0x1d')](_0x110e9b[_0x37cd('0x33')][_0x37cd('0x1d')]);_0x3c5734[_0x37cd('0x1a')]=qs[_0x37cd('0x1a')](_0x110e9b[_0x37cd('0x33')][_0x37cd('0x1a')]);}_0x3c5734['order']=qs[_0x37cd('0x3d')](_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3d')]);_0x3c5734[_0x37cd('0x3e')]=qs[_0x37cd('0x35')](_['pick'](_0x110e9b['query'],_0xb76d1e['filters']),_0x4782eb);if(_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3f')]){_0x3c5734['where']=_['merge'](_0x3c5734[_0x37cd('0x3e')],{'$or':_['map'](_0x4782eb,function(_0x4f7c8f){if(_0x4f7c8f[_0x37cd('0x30')]!==_0x37cd('0x40')){var _0x38b613={};_0x38b613[_0x4f7c8f[_0x37cd('0x2b')]]={'$like':'%'+_0x110e9b[_0x37cd('0x33')][_0x37cd('0x3f')]+'%'};return _0x38b613;}})});}_0x3c5734=_[_0x37cd('0x41')]({},_0x3c5734,_0x110e9b[_0x37cd('0x42')]);var _0x5efdc4={'where':_0x3c5734[_0x37cd('0x3e')]};return db['Sound']['count'](_0x5efdc4)['then'](function(_0x4cc622){_0x1accb4[_0x37cd('0x1c')]=_0x4cc622;if(_0x110e9b[_0x37cd('0x33')][_0x37cd('0x43')]){_0x3c5734[_0x37cd('0x44')]=[{'all':!![]}];}return db[_0x37cd('0x2d')][_0x37cd('0x45')](_0x3c5734);})[_0x37cd('0x24')](function(_0x5c1b34){_0x1accb4['rows']=_0x5c1b34;return _0x1accb4;})[_0x37cd('0x24')](respondWithFilteredResult(_0x23e9df,_0x3c5734))[_0x37cd('0x46')](handleError(_0x23e9df,null));};exports[_0x37cd('0x47')]=function(_0x495906,_0x369da7){var _0x5aaab2={'raw':!![],'where':{'id':_0x495906[_0x37cd('0x48')]['id']}},_0x3829f4={};_0x3829f4[_0x37cd('0x38')]=_[_0x37cd('0x34')](db[_0x37cd('0x2d')]['rawAttributes']);_0x3829f4[_0x37cd('0x33')]=_[_0x37cd('0x34')](_0x495906[_0x37cd('0x33')]);_0x3829f4[_0x37cd('0x35')]=_['intersection'](_0x3829f4['model'],_0x3829f4[_0x37cd('0x33')]);_0x5aaab2['attributes']=_[_0x37cd('0x36')](_0x3829f4[_0x37cd('0x38')],qs[_0x37cd('0x39')](_0x495906[_0x37cd('0x33')][_0x37cd('0x39')]));_0x5aaab2['attributes']=_0x5aaab2[_0x37cd('0x37')][_0x37cd('0x3a')]?_0x5aaab2[_0x37cd('0x37')]:_0x3829f4[_0x37cd('0x38')];if(_0x495906[_0x37cd('0x33')][_0x37cd('0x43')]){_0x5aaab2[_0x37cd('0x44')]=[{'all':!![]}];}_0x5aaab2=_[_0x37cd('0x41')]({},_0x5aaab2,_0x495906[_0x37cd('0x42')]);return db['Sound'][_0x37cd('0x49')](_0x5aaab2)[_0x37cd('0x24')](handleEntityNotFound(_0x369da7,null))[_0x37cd('0x24')](respondWithResult(_0x369da7,null))['catch'](handleError(_0x369da7,null));};exports[_0x37cd('0x4a')]=function(_0x5c138d,_0x4c2227,_0x3cad35){return db[_0x37cd('0x2d')][_0x37cd('0x49')]({'where':{'id':_0x5c138d[_0x37cd('0x48')]['id']},'attributes':[_0x37cd('0x2b'),_0x37cd('0x4b'),'converted_format'],'raw':!![]})[_0x37cd('0x24')](handleEntityNotFound(_0x4c2227,null))[_0x37cd('0x24')](function(_0x1cc82a){if(_0x1cc82a){if(!fs['existsSync'](path[_0x37cd('0x4c')](config['root'],'server/files/sounds/converted',_0x1cc82a[_0x37cd('0x4b')]+'.'+_0x1cc82a['converted_format']))){throw new db[(_0x37cd('0x4d'))]['ValidationError']('Sound\x20not\x20found');}return _0x4c2227[_0x37cd('0x4a')](path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],_0x37cd('0x4f'),util[_0x37cd('0x50')]('%s.%s',_0x1cc82a[_0x37cd('0x4b')],_0x1cc82a[_0x37cd('0x51')])),util['format'](_0x37cd('0x52'),_0x1cc82a[_0x37cd('0x2b')],_0x1cc82a['converted_format']));}return null;})[_0x37cd('0x46')](handleError(_0x4c2227,null));};exports[_0x37cd('0x53')]=function(_0x3e3885,_0x3e3176,_0x3dde94){var _0x5f0313={'name':path[_0x37cd('0x54')](_0x3e3885['file']['originalname'],path[_0x37cd('0x55')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x57')])),'save_name':path['basename'](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x58')],path[_0x37cd('0x55')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x58')])),'original_format':path[_0x37cd('0x55')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x57')])[_0x37cd('0x59')](0x1),'converted_format':_0x37cd('0x5a')};var _0x554182=path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],'server/files/sounds/original',_0x3e3885[_0x37cd('0x56')]['filename']);var _0x5e47e5=path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],_0x37cd('0x4f'),util[_0x37cd('0x50')](_0x37cd('0x52'),path[_0x37cd('0x54')](_0x3e3885[_0x37cd('0x56')][_0x37cd('0x58')],path[_0x37cd('0x55')](_0x3e3885['file'][_0x37cd('0x58')])),_0x5f0313[_0x37cd('0x51')]));logger[_0x37cd('0x5b')](_0x37cd('0x5c'),_0x554182);logger[_0x37cd('0x5b')](_0x37cd('0x5d'),_0x5e47e5);try{fs['chmodSync'](_0x554182,parseInt('0777',0x8));var _0x56169c=sox['transcode'](_0x554182,_0x5e47e5,{'sampleRate':0x1f40,'format':_0x37cd('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x56169c['on'](_0x37cd('0x29'),function(_0x343b92){fs[_0x37cd('0x5e')](_0x554182);_0x3e3176['status'](0x1f4)[_0x37cd('0x2c')](_0x343b92);});_0x56169c['on'](_0x37cd('0x5f'),function(_0x384958){_0x5f0313['original_duration']=isNaN(_0x384958['duration'])?null:_0x384958[_0x37cd('0x60')]*0x3e8;_0x5f0313[_0x37cd('0x61')]=isNaN(_0x384958[_0x37cd('0x62')])?null:_0x384958[_0x37cd('0x62')];_0x5f0313[_0x37cd('0x63')]=isNaN(_0x384958[_0x37cd('0x64')])?null:_0x384958[_0x37cd('0x64')];_0x5f0313[_0x37cd('0x65')]=isNaN(_0x384958[_0x37cd('0x66')])?null:_0x384958[_0x37cd('0x66')];_0x5f0313[_0x37cd('0x67')]=isNaN(_0x384958['sampleRate'])?null:_0x384958[_0x37cd('0x68')];});_0x56169c['on']('dest',function(_0x3bb411){_0x5f0313[_0x37cd('0x69')]=isNaN(_0x3bb411['duration'])?null:_0x3bb411['duration']*0x3e8;_0x5f0313[_0x37cd('0x6a')]=isNaN(_0x3bb411['sampleCount'])?null:_0x3bb411[_0x37cd('0x62')];_0x5f0313[_0x37cd('0x6b')]=isNaN(_0x3bb411['channelCount'])?null:_0x3bb411[_0x37cd('0x64')];_0x5f0313[_0x37cd('0x6c')]=isNaN(_0x3bb411[_0x37cd('0x66')])?null:_0x3bb411[_0x37cd('0x66')];_0x5f0313[_0x37cd('0x6d')]=isNaN(_0x3bb411[_0x37cd('0x68')])?null:_0x3bb411['sampleRate'];});_0x56169c['on']('end',function(){fs[_0x37cd('0x6e')](_0x5e47e5,parseInt('0777',0x8));return db[_0x37cd('0x2d')][_0x37cd('0x53')](_0x5f0313)[_0x37cd('0x24')](function(_0xb081fa){var _0x5e1a03={'role':_0x3e3885[_0x37cd('0x6f')][_0x37cd('0x70')],'userProfileId':_0x3e3885[_0x37cd('0x6f')][_0x37cd('0x71')]};if(!_0x5e1a03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e1a03[_0x37cd('0x70')]==='user'){var _0x334d53=_0xb081fa['get']({'plain':!![]});return db[_0x37cd('0x72')][_0x37cd('0x49')]({'where':{'name':_0x37cd('0x73'),'userProfileId':_0x5e1a03['userProfileId']},'raw':!![]})[_0x37cd('0x24')](function(_0x4b7f66){if(_0x4b7f66&&_0x4b7f66['autoAssociation']===0x0){return db[_0x37cd('0x27')][_0x37cd('0x53')]({'name':_0x334d53[_0x37cd('0x2b')],'resourceId':_0x334d53['id'],'type':_0x4b7f66[_0x37cd('0x2b')],'sectionId':_0x4b7f66['id']},{})['then'](function(){return _0xb081fa;});}else{return _0xb081fa;}})['catch'](function(_0x2520ed){logger['error'](_0x37cd('0x74'),_0x2520ed);throw _0x2520ed;});}return _0xb081fa;})[_0x37cd('0x24')](respondWithResult(_0x3e3176,null))['catch'](handleError(_0x3e3176,null));});_0x56169c[_0x37cd('0x75')]();}catch(_0x101759){_0x3e3176['status'](0x1f4)[_0x37cd('0x2c')](_0x101759);}};exports[_0x37cd('0x23')]=function(_0x307ac5,_0x19bc77,_0x552027){return db[_0x37cd('0x2d')][_0x37cd('0x49')]({'where':{'id':_0x307ac5[_0x37cd('0x48')]['id']}})[_0x37cd('0x24')](handleEntityNotFound(_0x19bc77,null))[_0x37cd('0x24')](saveUpdates(_[_0x37cd('0x76')](_0x307ac5[_0x37cd('0x6f')],[_0x37cd('0x2b'),'description']),null))[_0x37cd('0x24')](respondWithResult(_0x19bc77,null))[_0x37cd('0x46')](handleError(_0x19bc77,null));};exports[_0x37cd('0x77')]=function(_0x3e7864,_0x4ebd67,_0x26e29c){return db[_0x37cd('0x2d')][_0x37cd('0x49')]({'where':{'id':_0x3e7864[_0x37cd('0x48')]['id']}})[_0x37cd('0x24')](function(_0x4aff17){if(_0x4aff17){return _0x4aff17[_0x37cd('0x25')]();}})[_0x37cd('0x24')](function(_0x11b12a){var _0x27e3bb=path[_0x37cd('0x4c')](config[_0x37cd('0x4e')],_0x37cd('0x78'),util[_0x37cd('0x50')]('%s.%s',_0x11b12a[_0x37cd('0x4b')],_0x11b12a['original_format']));var _0x2431ab=path['join'](config[_0x37cd('0x4e')],_0x37cd('0x4f'),util[_0x37cd('0x50')](_0x37cd('0x52'),_0x11b12a[_0x37cd('0x4b')],_0x11b12a[_0x37cd('0x51')]));fs[_0x37cd('0x5e')](_0x27e3bb);fs[_0x37cd('0x5e')](_0x2431ab);return _0x11b12a;})[_0x37cd('0x24')](function(_0x2912d4){if(_0x2912d4){return _0x4ebd67[_0x37cd('0x1e')](0xcc)['end']();}})[_0x37cd('0x24')](handleEntityNotFound(_0x4ebd67,null))[_0x37cd('0x46')](handleError(_0x4ebd67,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 59f4c95..26a27d4 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 _0xa02b=['path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa02b,0x112));var _0xba02=function(_0x551f70,_0x21460e){_0x551f70=_0x551f70-0x0;var _0x1de80d=_0xa02b[_0x551f70];return _0x1de80d;};'use strict';var _=require('lodash');var util=require(_0xba02('0x0'));var logger=require(_0xba02('0x1'))(_0xba02('0x2'));var moment=require(_0xba02('0x3'));var BPromise=require(_0xba02('0x4'));var rp=require(_0xba02('0x5'));var fs=require('fs');var path=require(_0xba02('0x6'));var rimraf=require(_0xba02('0x7'));var config=require(_0xba02('0x8'));var attributes=require(_0xba02('0x9'));module[_0xba02('0xa')]=function(_0x205a04,_0x19fc29){return _0x205a04[_0xba02('0xb')](_0xba02('0xc'),attributes,{'tableName':_0xba02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5904=['request-promise','../../config/environment','exports','define','Sound','tools_sounds','util','api','moment','bluebird'];(function(_0x5adb68,_0x484cd){var _0x433c3c=function(_0x50905c){while(--_0x50905c){_0x5adb68['push'](_0x5adb68['shift']());}};_0x433c3c(++_0x484cd);}(_0x5904,0x16e));var _0x4590=function(_0x18c126,_0x3a12fe){_0x18c126=_0x18c126-0x0;var _0x1be598=_0x5904[_0x18c126];return _0x1be598;};'use strict';var _=require('lodash');var util=require(_0x4590('0x0'));var logger=require('../../config/logger')(_0x4590('0x1'));var moment=require(_0x4590('0x2'));var BPromise=require(_0x4590('0x3'));var rp=require(_0x4590('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4590('0x5'));var attributes=require('./sound.attributes');module[_0x4590('0x6')]=function(_0x697390,_0x597fc3){return _0x697390[_0x4590('0x7')](_0x4590('0x8'),attributes,{'tableName':_0x4590('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 93eef53..fa2d8a2 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 _0x8e54=['raw','options','where','attributes','model','include','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ShowSound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e54,0x152));var _0x48e5=function(_0x4f7a84,_0x25f55b){_0x4f7a84=_0x4f7a84-0x0;var _0x8ef09d=_0x8e54[_0x4f7a84];return _0x8ef09d;};'use strict';var _=require(_0x48e5('0x0'));var util=require('util');var moment=require(_0x48e5('0x1'));var BPromise=require(_0x48e5('0x2'));var rs=require(_0x48e5('0x3'));var fs=require('fs');var Redis=require(_0x48e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x48e5('0x5'));var logger=require('../../config/logger')(_0x48e5('0x6'));var config=require(_0x48e5('0x7'));var jayson=require(_0x48e5('0x8'));var client=jayson['client'][_0x48e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49e32e,_0x54d27f,_0x27bbf7){return new BPromise(function(_0x3a8646,_0x4dd5bb){return client[_0x48e5('0xa')](_0x49e32e,_0x27bbf7)[_0x48e5('0xb')](function(_0x523d71){logger['info'](_0x48e5('0xc'),_0x54d27f,_0x48e5('0xd'));logger[_0x48e5('0xe')](_0x48e5('0xf'),_0x54d27f,_0x48e5('0xd'),JSON[_0x48e5('0x10')](_0x523d71));if(_0x523d71[_0x48e5('0x11')]){if(_0x523d71[_0x48e5('0x11')]['code']===0x1f4){logger[_0x48e5('0x11')](_0x48e5('0xc'),_0x54d27f,_0x523d71['error']['message']);return _0x4dd5bb(_0x523d71[_0x48e5('0x11')]['message']);}logger[_0x48e5('0x11')](_0x48e5('0xc'),_0x54d27f,_0x523d71[_0x48e5('0x11')]['message']);return _0x3a8646(_0x523d71[_0x48e5('0x11')][_0x48e5('0x12')]);}else{logger[_0x48e5('0x13')](_0x48e5('0xc'),_0x54d27f,_0x48e5('0xd'));_0x3a8646(_0x523d71[_0x48e5('0x14')][_0x48e5('0x12')]);}})['catch'](function(_0x369179){logger[_0x48e5('0x11')]('Sound,\x20%s,\x20%s',_0x54d27f,_0x369179);_0x4dd5bb(_0x369179);});});}exports[_0x48e5('0x15')]=function(_0x8f5a4){var _0x43566e=this;return new Promise(function(_0x11c73e,_0x3f0e7a){return db['Sound']['find']({'raw':_0x8f5a4['options']?_0x8f5a4['options'][_0x48e5('0x16')]===undefined?!![]:![]:!![],'where':_0x8f5a4['options']?_0x8f5a4[_0x48e5('0x17')][_0x48e5('0x18')]||null:null,'attributes':_0x8f5a4[_0x48e5('0x17')]?_0x8f5a4['options'][_0x48e5('0x19')]||null:null,'include':_0x8f5a4[_0x48e5('0x17')]?_0x8f5a4[_0x48e5('0x17')]['include']?_['map'](_0x8f5a4[_0x48e5('0x17')]['include'],function(_0x3e30c2){return{'model':db[_0x3e30c2[_0x48e5('0x1a')]],'as':_0x3e30c2['as'],'attributes':_0x3e30c2['attributes'],'include':_0x3e30c2[_0x48e5('0x1b')]?_[_0x48e5('0x1c')](_0x3e30c2[_0x48e5('0x1b')],function(_0x4f287b){return{'model':db[_0x4f287b['model']],'as':_0x4f287b['as'],'attributes':_0x4f287b[_0x48e5('0x19')],'include':_0x4f287b['include']?_[_0x48e5('0x1c')](_0x4f287b['include'],function(_0x5acae1){return{'model':db[_0x5acae1['model']],'as':_0x5acae1['as'],'attributes':_0x5acae1['attributes']};}):[]};}):[]};}):[]:[]})[_0x48e5('0xb')](function(_0x5653a6){logger[_0x48e5('0x13')]('ShowSound',_0x8f5a4);logger[_0x48e5('0xe')](_0x48e5('0x15'),_0x8f5a4,JSON[_0x48e5('0x10')](_0x5653a6));_0x11c73e(_0x5653a6);})[_0x48e5('0x1d')](function(_0x2a0990){logger[_0x48e5('0x11')]('ShowSound',_0x2a0990[_0x48e5('0x12')],_0x8f5a4);_0x3f0e7a(_0x43566e[_0x48e5('0x11')](0x1f4,_0x2a0990[_0x48e5('0x12')]));});});}; \ No newline at end of file +var _0xe2de=['request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x3adc57,_0x4ccf9b){var _0x42ddb1=function(_0x4d7589){while(--_0x4d7589){_0x3adc57['push'](_0x3adc57['shift']());}};_0x42ddb1(++_0x4ccf9b);}(_0xe2de,0x1d6));var _0xee2d=function(_0xa8fb97,_0x2ce4b4){_0xa8fb97=_0xa8fb97-0x0;var _0x57cdf7=_0xe2de[_0xa8fb97];return _0x57cdf7;};'use strict';var _=require(_0xee2d('0x0'));var util=require(_0xee2d('0x1'));var moment=require(_0xee2d('0x2'));var BPromise=require('bluebird');var rs=require(_0xee2d('0x3'));var fs=require('fs');var Redis=require(_0xee2d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xee2d('0x5'));var logger=require(_0xee2d('0x6'))(_0xee2d('0x7'));var config=require('../../config/environment');var jayson=require(_0xee2d('0x8'));var client=jayson['client'][_0xee2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5421a7,_0xca2290,_0x2a56b8){return new BPromise(function(_0x57a02d,_0x65c2b7){return client[_0xee2d('0xa')](_0x5421a7,_0x2a56b8)[_0xee2d('0xb')](function(_0x20cfa4){logger[_0xee2d('0xc')](_0xee2d('0xd'),_0xca2290,_0xee2d('0xe'));logger[_0xee2d('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0xca2290,_0xee2d('0xe'),JSON[_0xee2d('0x10')](_0x20cfa4));if(_0x20cfa4['error']){if(_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x12')]===0x1f4){logger[_0xee2d('0x11')](_0xee2d('0xd'),_0xca2290,_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x13')]);return _0x65c2b7(_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x13')]);}logger[_0xee2d('0x11')](_0xee2d('0xd'),_0xca2290,_0x20cfa4[_0xee2d('0x11')]['message']);return _0x57a02d(_0x20cfa4[_0xee2d('0x11')][_0xee2d('0x13')]);}else{logger[_0xee2d('0xc')](_0xee2d('0xd'),_0xca2290,_0xee2d('0xe'));_0x57a02d(_0x20cfa4[_0xee2d('0x14')][_0xee2d('0x13')]);}})[_0xee2d('0x15')](function(_0x1fe759){logger[_0xee2d('0x11')](_0xee2d('0xd'),_0xca2290,_0x1fe759);_0x65c2b7(_0x1fe759);});});}exports[_0xee2d('0x16')]=function(_0x504673){var _0x42ac39=this;return new Promise(function(_0x31f926,_0x4740f2){return db[_0xee2d('0x17')][_0xee2d('0x18')]({'raw':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')][_0xee2d('0x1a')]===undefined?!![]:![]:!![],'where':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')][_0xee2d('0x1b')]||null:null,'attributes':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')][_0xee2d('0x1c')]||null:null,'include':_0x504673[_0xee2d('0x19')]?_0x504673[_0xee2d('0x19')]['include']?_[_0xee2d('0x1d')](_0x504673[_0xee2d('0x19')][_0xee2d('0x1e')],function(_0x1fef00){return{'model':db[_0x1fef00[_0xee2d('0x1f')]],'as':_0x1fef00['as'],'attributes':_0x1fef00[_0xee2d('0x1c')],'include':_0x1fef00[_0xee2d('0x1e')]?_['map'](_0x1fef00['include'],function(_0x126210){return{'model':db[_0x126210[_0xee2d('0x1f')]],'as':_0x126210['as'],'attributes':_0x126210[_0xee2d('0x1c')],'include':_0x126210[_0xee2d('0x1e')]?_[_0xee2d('0x1d')](_0x126210[_0xee2d('0x1e')],function(_0x34d6c2){return{'model':db[_0x34d6c2[_0xee2d('0x1f')]],'as':_0x34d6c2['as'],'attributes':_0x34d6c2[_0xee2d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xee2d('0xb')](function(_0x352053){logger[_0xee2d('0xc')]('ShowSound',_0x504673);logger[_0xee2d('0xf')](_0xee2d('0x16'),_0x504673,JSON['stringify'](_0x352053));_0x31f926(_0x352053);})[_0xee2d('0x15')](function(_0x5bb93f){logger[_0xee2d('0x11')](_0xee2d('0x16'),_0x5bb93f[_0xee2d('0x13')],_0x504673);_0x4740f2(_0x42ac39[_0xee2d('0x11')](0x1f4,_0x5bb93f[_0xee2d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 422c6fc..d5fdc1a 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0x4fc2,0x111));var _0x24fc=function(_0x3f54e1,_0x2aac41){_0x3f54e1=_0x3f54e1-0x0;var _0x5a0d29=_0x4fc2[_0x3f54e1];return _0x5a0d29;};'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')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0xda2d,0x102));var _0xdda2=function(_0x2babc3,_0x3762a8){_0x2babc3=_0x2babc3-0x0;var _0x420ec1=_0xda2d[_0x2babc3];return _0x420ec1;};'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('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index eed583a..846e9bd 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 _0x3f77=['medium','ENUM','out','sequelize','STRING','TEXT'];(function(_0x53066f,_0x3e26b8){var _0x31861d=function(_0x2e3830){while(--_0x2e3830){_0x53066f['push'](_0x53066f['shift']());}};_0x31861d(++_0x3e26b8);}(_0x3f77,0x69));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x73f7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x73f7('0x1')]},'body':{'type':Sequelize[_0x73f7('0x2')](_0x73f7('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x73f7('0x4')]('in','out'),'defaultValue':_0x73f7('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x819b=['out','exports','STRING','TEXT','ENUM'];(function(_0x2ca147,_0x379da5){var _0x18c16d=function(_0x442a5a){while(--_0x442a5a){_0x2ca147['push'](_0x2ca147['shift']());}};_0x18c16d(++_0x379da5);}(_0x819b,0xb0));var _0xb819=function(_0x150199,_0x5d8234){_0x150199=_0x150199-0x0;var _0x50fa5c=_0x819b[_0x150199];return _0x50fa5c;};'use strict';var Sequelize=require('sequelize');module[_0xb819('0x0')]={'uniqueid':{'type':Sequelize[_0xb819('0x1')]},'body':{'type':Sequelize[_0xb819('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xb819('0x3')]('in','out'),'defaultValue':_0xb819('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb819('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 89a58e1..f5436c5 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 _0x15e8=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','SquareMessage','findAll','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes'];(function(_0x4a5784,_0x32c088){var _0x22d31d=function(_0x5261b9){while(--_0x5261b9){_0x4a5784['push'](_0x4a5784['shift']());}};_0x22d31d(++_0x32c088);}(_0x15e8,0x13d));var _0x815e=function(_0x3ea895,_0x3f5262){_0x3ea895=_0x3ea895-0x0;var _0x10f156=_0x15e8[_0x3ea895];return _0x10f156;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x815e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x815e('0x1'));var rp=require(_0x815e('0x2'));var moment=require(_0x815e('0x3'));var BPromise=require(_0x815e('0x4'));var Mustache=require(_0x815e('0x5'));var util=require(_0x815e('0x6'));var path=require(_0x815e('0x7'));var sox=require(_0x815e('0x8'));var csv=require('to-csv');var ejs=require(_0x815e('0x9'));var fs=require('fs');var fs_extra=require(_0x815e('0xa'));var _=require(_0x815e('0xb'));var squel=require('squel');var crypto=require(_0x815e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x815e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x815e('0xe'));var Papa=require(_0x815e('0xf'));var Redis=require('ioredis');var authService=require(_0x815e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x815e('0x11'));var hardwareService=require(_0x815e('0x12'));var logger=require(_0x815e('0x13'))(_0x815e('0x14'));var utils=require(_0x815e('0x15'));var config=require(_0x815e('0x16'));var licenseUtil=require(_0x815e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4730a3,_0x1ccd1f){_0x1ccd1f=_0x1ccd1f||0xcc;return function(_0x5c75eb){if(_0x5c75eb){return _0x4730a3[_0x815e('0x18')](_0x1ccd1f);}return _0x4730a3[_0x815e('0x19')](_0x1ccd1f)['end']();};}function respondWithResult(_0x4b1fde,_0x11191b){_0x11191b=_0x11191b||0xc8;return function(_0x564692){if(_0x564692){return _0x4b1fde[_0x815e('0x19')](_0x11191b)[_0x815e('0x1a')](_0x564692);}};}function respondWithFilteredResult(_0x4a7330,_0x811655){return function(_0x5c3fe5){if(_0x5c3fe5){var _0x585115=typeof _0x811655[_0x815e('0x1b')]==='undefined'&&typeof _0x811655['limit']===_0x815e('0x1c');var _0xd79f8c=_0x5c3fe5[_0x815e('0x1d')];var _0x344457=_0x585115?0x0:_0x811655[_0x815e('0x1b')];var _0x2df9c1=_0x585115?_0x5c3fe5[_0x815e('0x1d')]:_0x811655['offset']+_0x811655[_0x815e('0x1e')];var _0x5775f6;if(_0x2df9c1>=_0xd79f8c){_0x2df9c1=_0xd79f8c;_0x5775f6=0xc8;}else{_0x5775f6=0xce;}_0x4a7330[_0x815e('0x19')](_0x5775f6);return _0x4a7330[_0x815e('0x1f')](_0x815e('0x20'),_0x344457+'-'+_0x2df9c1+'/'+_0xd79f8c)[_0x815e('0x1a')](_0x5c3fe5);}return null;};}function patchUpdates(_0x1a4749){return function(_0x182a4f){try{jsonpatch['apply'](_0x182a4f,_0x1a4749,!![]);}catch(_0x4b48cc){return BPromise['reject'](_0x4b48cc);}return _0x182a4f[_0x815e('0x21')]();};}function saveUpdates(_0x1cace7,_0x102bf7){return function(_0x890e0e){if(_0x890e0e){return _0x890e0e[_0x815e('0x22')](_0x1cace7)[_0x815e('0x23')](function(_0x134423){return _0x134423;});}return null;};}function removeEntity(_0x2bcdb8,_0x5e54de){return function(_0x595d93){if(_0x595d93){return _0x595d93[_0x815e('0x24')]()[_0x815e('0x23')](function(){_0x2bcdb8['status'](0xcc)[_0x815e('0x25')]();});}};}function handleEntityNotFound(_0x8e93da,_0x1688e3){return function(_0x56cacb){if(!_0x56cacb){_0x8e93da[_0x815e('0x18')](0x194);}return _0x56cacb;};}function handleError(_0x432561,_0x4fb9db){_0x4fb9db=_0x4fb9db||0x1f4;return function(_0xccaf92){logger[_0x815e('0x26')](_0xccaf92[_0x815e('0x27')]);if(_0xccaf92['name']){delete _0xccaf92[_0x815e('0x28')];}_0x432561[_0x815e('0x19')](_0x4fb9db)[_0x815e('0x29')](_0xccaf92);};}exports['index']=function(_0xf286bb,_0x40a63a){var _0x362365={},_0x27dda4={},_0xce4d05={'count':0x0,'rows':[]};var _0x5b7553=_['map'](db['SquareMessage'][_0x815e('0x2a')],function(_0xa87d42){return{'name':_0xa87d42[_0x815e('0x2b')],'type':_0xa87d42[_0x815e('0x2c')][_0x815e('0x2d')]};});_0x27dda4[_0x815e('0x2e')]=_[_0x815e('0x2f')](_0x5b7553,'name');_0x27dda4['query']=_[_0x815e('0x30')](_0xf286bb[_0x815e('0x31')]);_0x27dda4[_0x815e('0x32')]=_[_0x815e('0x33')](_0x27dda4[_0x815e('0x2e')],_0x27dda4['query']);_0x362365[_0x815e('0x34')]=_[_0x815e('0x33')](_0x27dda4[_0x815e('0x2e')],qs[_0x815e('0x35')](_0xf286bb['query'][_0x815e('0x35')]));_0x362365[_0x815e('0x34')]=_0x362365['attributes'][_0x815e('0x36')]?_0x362365[_0x815e('0x34')]:_0x27dda4['model'];if(!_0xf286bb[_0x815e('0x31')][_0x815e('0x37')](_0x815e('0x38'))){_0x362365[_0x815e('0x1e')]=qs[_0x815e('0x1e')](_0xf286bb[_0x815e('0x31')][_0x815e('0x1e')]);_0x362365['offset']=qs[_0x815e('0x1b')](_0xf286bb[_0x815e('0x31')][_0x815e('0x1b')]);}_0x362365['order']=qs[_0x815e('0x39')](_0xf286bb[_0x815e('0x31')][_0x815e('0x39')]);_0x362365[_0x815e('0x3a')]=qs['filters'](_[_0x815e('0x3b')](_0xf286bb[_0x815e('0x31')],_0x27dda4[_0x815e('0x32')]),_0x5b7553);if(_0xf286bb[_0x815e('0x31')][_0x815e('0x3c')]){_0x362365[_0x815e('0x3a')]=_[_0x815e('0x3d')](_0x362365['where'],{'$or':_[_0x815e('0x2f')](_0x5b7553,function(_0x54a465){if(_0x54a465[_0x815e('0x2c')]!==_0x815e('0x3e')){var _0x47696e={};_0x47696e[_0x54a465[_0x815e('0x28')]]={'$like':'%'+_0xf286bb[_0x815e('0x31')][_0x815e('0x3c')]+'%'};return _0x47696e;}})});}_0x362365=_[_0x815e('0x3d')]({},_0x362365,_0xf286bb[_0x815e('0x3f')]);var _0x3ee9eb={'where':_0x362365[_0x815e('0x3a')]};return db['SquareMessage'][_0x815e('0x1d')](_0x3ee9eb)[_0x815e('0x23')](function(_0x565fb1){_0xce4d05[_0x815e('0x1d')]=_0x565fb1;if(_0xf286bb[_0x815e('0x31')][_0x815e('0x40')]){_0x362365['include']=[{'all':!![]}];}return db[_0x815e('0x41')][_0x815e('0x42')](_0x362365);})[_0x815e('0x23')](function(_0x42f4e5){_0xce4d05[_0x815e('0x43')]=_0x42f4e5;return _0xce4d05;})[_0x815e('0x23')](respondWithFilteredResult(_0x40a63a,_0x362365))[_0x815e('0x44')](handleError(_0x40a63a,null));};exports[_0x815e('0x45')]=function(_0xd072fb,_0x2ebb11){var _0x28c6fe={'raw':!![],'where':{'id':_0xd072fb[_0x815e('0x46')]['id']}},_0x232966={};_0x232966[_0x815e('0x2e')]=_[_0x815e('0x30')](db[_0x815e('0x41')][_0x815e('0x2a')]);_0x232966[_0x815e('0x31')]=_[_0x815e('0x30')](_0xd072fb['query']);_0x232966['filters']=_['intersection'](_0x232966[_0x815e('0x2e')],_0x232966[_0x815e('0x31')]);_0x28c6fe[_0x815e('0x34')]=_[_0x815e('0x33')](_0x232966['model'],qs['fields'](_0xd072fb[_0x815e('0x31')][_0x815e('0x35')]));_0x28c6fe['attributes']=_0x28c6fe[_0x815e('0x34')][_0x815e('0x36')]?_0x28c6fe['attributes']:_0x232966[_0x815e('0x2e')];if(_0xd072fb[_0x815e('0x31')][_0x815e('0x40')]){_0x28c6fe['include']=[{'all':!![]}];}_0x28c6fe=_[_0x815e('0x3d')]({},_0x28c6fe,_0xd072fb[_0x815e('0x3f')]);return db[_0x815e('0x41')][_0x815e('0x47')](_0x28c6fe)[_0x815e('0x23')](handleEntityNotFound(_0x2ebb11,null))[_0x815e('0x23')](respondWithResult(_0x2ebb11,null))['catch'](handleError(_0x2ebb11,null));};exports[_0x815e('0x48')]=function(_0x30d188,_0x8c69cf){return db[_0x815e('0x41')][_0x815e('0x48')](_0x30d188[_0x815e('0x49')],{})[_0x815e('0x23')](respondWithResult(_0x8c69cf,0xc9))['catch'](handleError(_0x8c69cf,null));};exports[_0x815e('0x22')]=function(_0x1531de,_0x3d0114){if(_0x1531de['body']['id']){delete _0x1531de['body']['id'];}return db[_0x815e('0x41')][_0x815e('0x47')]({'where':{'id':_0x1531de[_0x815e('0x46')]['id']}})[_0x815e('0x23')](handleEntityNotFound(_0x3d0114,null))[_0x815e('0x23')](saveUpdates(_0x1531de[_0x815e('0x49')],null))['then'](respondWithResult(_0x3d0114,null))[_0x815e('0x44')](handleError(_0x3d0114,null));};exports[_0x815e('0x24')]=function(_0x4801e9,_0x3b8c92){return db[_0x815e('0x41')][_0x815e('0x47')]({'where':{'id':_0x4801e9['params']['id']}})[_0x815e('0x23')](handleEntityNotFound(_0x3b8c92,null))[_0x815e('0x23')](removeEntity(_0x3b8c92,null))[_0x815e('0x44')](handleError(_0x3b8c92,null));}; \ No newline at end of file +var _0x9264=['rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','show','params','keys','includeAll','include','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','SquareMessage'];(function(_0x2f04a4,_0x1be47e){var _0x5dde34=function(_0x2aac62){while(--_0x2aac62){_0x2f04a4['push'](_0x2f04a4['shift']());}};_0x5dde34(++_0x1be47e);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4926('0x0'));var rimraf=require(_0x4926('0x1'));var zipdir=require(_0x4926('0x2'));var jsonpatch=require(_0x4926('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4926('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4926('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4926('0x6'));var _=require(_0x4926('0x7'));var squel=require('squel');var crypto=require(_0x4926('0x8'));var jsforce=require(_0x4926('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4926('0xa'));var querystring=require(_0x4926('0xb'));var Papa=require(_0x4926('0xc'));var Redis=require('ioredis');var authService=require(_0x4926('0xd'));var qs=require(_0x4926('0xe'));var as=require(_0x4926('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4926('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4926('0x11'));var licenseUtil=require(_0x4926('0x12'));var db=require(_0x4926('0x13'))['db'];function respondWithStatusCode(_0x5423a3,_0xd3cbc){_0xd3cbc=_0xd3cbc||0xcc;return function(_0x21eae1){if(_0x21eae1){return _0x5423a3[_0x4926('0x14')](_0xd3cbc);}return _0x5423a3[_0x4926('0x15')](_0xd3cbc)[_0x4926('0x16')]();};}function respondWithResult(_0x2a2105,_0x2f466b){_0x2f466b=_0x2f466b||0xc8;return function(_0x1a280b){if(_0x1a280b){return _0x2a2105[_0x4926('0x15')](_0x2f466b)[_0x4926('0x17')](_0x1a280b);}};}function respondWithFilteredResult(_0xac0db7,_0x1fbb5d){return function(_0x3018cb){if(_0x3018cb){var _0x1ac74f=typeof _0x1fbb5d['offset']===_0x4926('0x18')&&typeof _0x1fbb5d[_0x4926('0x19')]===_0x4926('0x18');var _0x5736dd=_0x3018cb['count'];var _0x1dd78e=_0x1ac74f?0x0:_0x1fbb5d['offset'];var _0x214e36=_0x1ac74f?_0x3018cb[_0x4926('0x1a')]:_0x1fbb5d['offset']+_0x1fbb5d[_0x4926('0x19')];var _0x49461e;if(_0x214e36>=_0x5736dd){_0x214e36=_0x5736dd;_0x49461e=0xc8;}else{_0x49461e=0xce;}_0xac0db7[_0x4926('0x15')](_0x49461e);return _0xac0db7[_0x4926('0x1b')](_0x4926('0x1c'),_0x1dd78e+'-'+_0x214e36+'/'+_0x5736dd)[_0x4926('0x17')](_0x3018cb);}return null;};}function patchUpdates(_0x5b7588){return function(_0x59dc6a){try{jsonpatch[_0x4926('0x1d')](_0x59dc6a,_0x5b7588,!![]);}catch(_0x588c7a){return BPromise['reject'](_0x588c7a);}return _0x59dc6a[_0x4926('0x1e')]();};}function saveUpdates(_0x309c71,_0x55d055){return function(_0xfd1095){if(_0xfd1095){return _0xfd1095['update'](_0x309c71)[_0x4926('0x1f')](function(_0x55e459){return _0x55e459;});}return null;};}function removeEntity(_0x10d0b2,_0x34d600){return function(_0x2df18c){if(_0x2df18c){return _0x2df18c[_0x4926('0x20')]()['then'](function(){_0x10d0b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c02e7,_0xbfbe1b){return function(_0x43c077){if(!_0x43c077){_0x1c02e7[_0x4926('0x14')](0x194);}return _0x43c077;};}function handleError(_0x51be4f,_0x508dea){_0x508dea=_0x508dea||0x1f4;return function(_0x55413a){logger[_0x4926('0x21')](_0x55413a[_0x4926('0x22')]);if(_0x55413a[_0x4926('0x23')]){delete _0x55413a['name'];}_0x51be4f['status'](_0x508dea)['send'](_0x55413a);};}exports[_0x4926('0x24')]=function(_0x3f06a3,_0xbfe28d){var _0x4bd08d={},_0x180421={},_0x9d610c={'count':0x0,'rows':[]};var _0x3f4a69=_[_0x4926('0x25')](db[_0x4926('0x26')][_0x4926('0x27')],function(_0x5a44a9){return{'name':_0x5a44a9[_0x4926('0x28')],'type':_0x5a44a9[_0x4926('0x29')][_0x4926('0x2a')]};});_0x180421[_0x4926('0x2b')]=_[_0x4926('0x25')](_0x3f4a69,_0x4926('0x23'));_0x180421[_0x4926('0x2c')]=_['keys'](_0x3f06a3[_0x4926('0x2c')]);_0x180421[_0x4926('0x2d')]=_['intersection'](_0x180421[_0x4926('0x2b')],_0x180421[_0x4926('0x2c')]);_0x4bd08d[_0x4926('0x2e')]=_[_0x4926('0x2f')](_0x180421[_0x4926('0x2b')],qs[_0x4926('0x30')](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x30')]));_0x4bd08d[_0x4926('0x2e')]=_0x4bd08d[_0x4926('0x2e')][_0x4926('0x31')]?_0x4bd08d[_0x4926('0x2e')]:_0x180421[_0x4926('0x2b')];if(!_0x3f06a3[_0x4926('0x2c')]['hasOwnProperty'](_0x4926('0x32'))){_0x4bd08d[_0x4926('0x19')]=qs[_0x4926('0x19')](_0x3f06a3[_0x4926('0x2c')]['limit']);_0x4bd08d[_0x4926('0x33')]=qs[_0x4926('0x33')](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x33')]);}_0x4bd08d[_0x4926('0x34')]=qs['sort'](_0x3f06a3[_0x4926('0x2c')][_0x4926('0x35')]);_0x4bd08d[_0x4926('0x36')]=qs['filters'](_[_0x4926('0x37')](_0x3f06a3[_0x4926('0x2c')],_0x180421[_0x4926('0x2d')]),_0x3f4a69);if(_0x3f06a3[_0x4926('0x2c')][_0x4926('0x38')]){_0x4bd08d[_0x4926('0x36')]=_['merge'](_0x4bd08d[_0x4926('0x36')],{'$or':_[_0x4926('0x25')](_0x3f4a69,function(_0x3c5595){if(_0x3c5595[_0x4926('0x29')]!==_0x4926('0x39')){var _0x5237f4={};_0x5237f4[_0x3c5595[_0x4926('0x23')]]={'$like':'%'+_0x3f06a3[_0x4926('0x2c')][_0x4926('0x38')]+'%'};return _0x5237f4;}})});}_0x4bd08d=_[_0x4926('0x3a')]({},_0x4bd08d,_0x3f06a3['options']);var _0x505de3={'where':_0x4bd08d['where']};return db[_0x4926('0x26')][_0x4926('0x1a')](_0x505de3)[_0x4926('0x1f')](function(_0x1d97db){_0x9d610c[_0x4926('0x1a')]=_0x1d97db;if(_0x3f06a3['query']['includeAll']){_0x4bd08d['include']=[{'all':!![]}];}return db['SquareMessage'][_0x4926('0x3b')](_0x4bd08d);})[_0x4926('0x1f')](function(_0x4380da){_0x9d610c[_0x4926('0x3c')]=_0x4380da;return _0x9d610c;})[_0x4926('0x1f')](respondWithFilteredResult(_0xbfe28d,_0x4bd08d))['catch'](handleError(_0xbfe28d,null));};exports[_0x4926('0x3d')]=function(_0x203f24,_0x218631){var _0x9dc879={'raw':!![],'where':{'id':_0x203f24[_0x4926('0x3e')]['id']}},_0x437800={};_0x437800[_0x4926('0x2b')]=_[_0x4926('0x3f')](db[_0x4926('0x26')][_0x4926('0x27')]);_0x437800['query']=_['keys'](_0x203f24[_0x4926('0x2c')]);_0x437800['filters']=_[_0x4926('0x2f')](_0x437800[_0x4926('0x2b')],_0x437800[_0x4926('0x2c')]);_0x9dc879['attributes']=_[_0x4926('0x2f')](_0x437800[_0x4926('0x2b')],qs[_0x4926('0x30')](_0x203f24[_0x4926('0x2c')][_0x4926('0x30')]));_0x9dc879[_0x4926('0x2e')]=_0x9dc879[_0x4926('0x2e')][_0x4926('0x31')]?_0x9dc879[_0x4926('0x2e')]:_0x437800[_0x4926('0x2b')];if(_0x203f24[_0x4926('0x2c')][_0x4926('0x40')]){_0x9dc879[_0x4926('0x41')]=[{'all':!![]}];}_0x9dc879=_[_0x4926('0x3a')]({},_0x9dc879,_0x203f24[_0x4926('0x42')]);return db['SquareMessage'][_0x4926('0x43')](_0x9dc879)[_0x4926('0x1f')](handleEntityNotFound(_0x218631,null))['then'](respondWithResult(_0x218631,null))[_0x4926('0x44')](handleError(_0x218631,null));};exports[_0x4926('0x45')]=function(_0x416968,_0x572c91){return db[_0x4926('0x26')][_0x4926('0x45')](_0x416968[_0x4926('0x46')],{})[_0x4926('0x1f')](respondWithResult(_0x572c91,0xc9))[_0x4926('0x44')](handleError(_0x572c91,null));};exports[_0x4926('0x47')]=function(_0x43764f,_0x12a89b){if(_0x43764f['body']['id']){delete _0x43764f[_0x4926('0x46')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x43764f[_0x4926('0x3e')]['id']}})[_0x4926('0x1f')](handleEntityNotFound(_0x12a89b,null))['then'](saveUpdates(_0x43764f[_0x4926('0x46')],null))[_0x4926('0x1f')](respondWithResult(_0x12a89b,null))[_0x4926('0x44')](handleError(_0x12a89b,null));};exports[_0x4926('0x20')]=function(_0x15d338,_0x84f5b0){return db['SquareMessage']['find']({'where':{'id':_0x15d338['params']['id']}})['then'](handleEntityNotFound(_0x84f5b0,null))[_0x4926('0x1f')](removeEntity(_0x84f5b0,null))[_0x4926('0x44')](handleError(_0x84f5b0,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2c2070b..70b6f1c 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 _0xdd0a=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','util','../../config/logger','bluebird','request-promise','path'];(function(_0x11e2b0,_0x386c82){var _0x1b9672=function(_0x51096d){while(--_0x51096d){_0x11e2b0['push'](_0x11e2b0['shift']());}};_0x1b9672(++_0x386c82);}(_0xdd0a,0x74));var _0xadd0=function(_0x3e4670,_0x4de3f3){_0x3e4670=_0x3e4670-0x0;var _0x4dd1e2=_0xdd0a[_0x3e4670];return _0x4dd1e2;};'use strict';var _=require('lodash');var util=require(_0xadd0('0x0'));var logger=require(_0xadd0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xadd0('0x2'));var rp=require(_0xadd0('0x3'));var fs=require('fs');var path=require(_0xadd0('0x4'));var rimraf=require(_0xadd0('0x5'));var config=require(_0xadd0('0x6'));var attributes=require(_0xadd0('0x7'));module[_0xadd0('0x8')]=function(_0x198276,_0x2daa73){return _0x198276[_0xadd0('0x9')]('SquareMessage',attributes,{'tableName':_0xadd0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87a7=['request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x535b74,_0x53da59){var _0x5b56f8=function(_0x916056){while(--_0x916056){_0x535b74['push'](_0x535b74['shift']());}};_0x5b56f8(++_0x53da59);}(_0x87a7,0x1ac));var _0x787a=function(_0x5f2c63,_0x1ea8e4){_0x5f2c63=_0x5f2c63-0x0;var _0x403728=_0x87a7[_0x5f2c63];return _0x403728;};'use strict';var _=require(_0x787a('0x0'));var util=require(_0x787a('0x1'));var logger=require(_0x787a('0x2'))(_0x787a('0x3'));var moment=require(_0x787a('0x4'));var BPromise=require(_0x787a('0x5'));var rp=require(_0x787a('0x6'));var fs=require('fs');var path=require(_0x787a('0x7'));var rimraf=require(_0x787a('0x8'));var config=require(_0x787a('0x9'));var attributes=require(_0x787a('0xa'));module[_0x787a('0xb')]=function(_0x4e612b,_0xb0233f){return _0x4e612b[_0x787a('0xc')]('SquareMessage',attributes,{'tableName':_0x787a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index ceafaa1..0e3a144 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 _0xcc2b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','info','result','CreateSquareMessage','SquareMessage','options','raw','debug'];(function(_0x810c00,_0x26ce72){var _0x3bc80b=function(_0xf5add4){while(--_0xf5add4){_0x810c00['push'](_0x810c00['shift']());}};_0x3bc80b(++_0x26ce72);}(_0xcc2b,0x6d));var _0xbcc2=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xcc2b[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xbcc2('0x0'));var util=require(_0xbcc2('0x1'));var moment=require(_0xbcc2('0x2'));var BPromise=require(_0xbcc2('0x3'));var rs=require(_0xbcc2('0x4'));var fs=require('fs');var Redis=require(_0xbcc2('0x5'));var db=require(_0xbcc2('0x6'))['db'];var utils=require(_0xbcc2('0x7'));var logger=require(_0xbcc2('0x8'))('rpc');var config=require(_0xbcc2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbcc2('0xa')][_0xbcc2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a55a1,_0x3f4cda,_0x532545){return new BPromise(function(_0x8e856b,_0x6f2497){return client['request'](_0x2a55a1,_0x532545)[_0xbcc2('0xc')](function(_0xc6dbbd){logger['info']('SquareMessage,\x20%s,\x20%s',_0x3f4cda,_0xbcc2('0xd'));logger['debug'](_0xbcc2('0xe'),_0x3f4cda,_0xbcc2('0xd'),JSON[_0xbcc2('0xf')](_0xc6dbbd));if(_0xc6dbbd['error']){if(_0xc6dbbd[_0xbcc2('0x10')]['code']===0x1f4){logger['error'](_0xbcc2('0x11'),_0x3f4cda,_0xc6dbbd[_0xbcc2('0x10')][_0xbcc2('0x12')]);return _0x6f2497(_0xc6dbbd[_0xbcc2('0x10')][_0xbcc2('0x12')]);}logger[_0xbcc2('0x10')](_0xbcc2('0x11'),_0x3f4cda,_0xc6dbbd[_0xbcc2('0x10')][_0xbcc2('0x12')]);return _0x8e856b(_0xc6dbbd[_0xbcc2('0x10')][_0xbcc2('0x12')]);}else{logger[_0xbcc2('0x13')](_0xbcc2('0x11'),_0x3f4cda,_0xbcc2('0xd'));_0x8e856b(_0xc6dbbd[_0xbcc2('0x14')]['message']);}})['catch'](function(_0x4c5e87){logger[_0xbcc2('0x10')](_0xbcc2('0x11'),_0x3f4cda,_0x4c5e87);_0x6f2497(_0x4c5e87);});});}exports[_0xbcc2('0x15')]=function(_0x4fa3e7){var _0x415c04=this;return new Promise(function(_0x3c3c15,_0x22a147){return db[_0xbcc2('0x16')]['create'](_0x4fa3e7['body'],{'raw':_0x4fa3e7['options']?_0x4fa3e7[_0xbcc2('0x17')][_0xbcc2('0x18')]===undefined?!![]:![]:!![]})[_0xbcc2('0xc')](function(_0x317057){logger[_0xbcc2('0x13')](_0xbcc2('0x15'),_0x4fa3e7);logger[_0xbcc2('0x19')](_0xbcc2('0x15'),_0x4fa3e7,JSON[_0xbcc2('0xf')](_0x317057));_0x3c3c15(_0x317057);})[_0xbcc2('0x1a')](function(_0x59d9e7){logger[_0xbcc2('0x10')](_0xbcc2('0x15'),_0x59d9e7[_0xbcc2('0x12')],_0x4fa3e7);_0x22a147(_0x415c04['error'](0x1f4,_0x59d9e7[_0xbcc2('0x12')]));});});}; \ No newline at end of file +var _0xe59a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','create','body','options','raw','CreateSquareMessage','debug','stringify','catch','moment','bluebird','ioredis'];(function(_0x3316d0,_0x239485){var _0x11193d=function(_0x4fdea7){while(--_0x4fdea7){_0x3316d0['push'](_0x3316d0['shift']());}};_0x11193d(++_0x239485);}(_0xe59a,0x131));var _0xae59=function(_0x5901d3,_0x43a6fd){_0x5901d3=_0x5901d3-0x0;var _0xc37489=_0xe59a[_0x5901d3];return _0xc37489;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae59('0x0'));var BPromise=require(_0xae59('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae59('0x2'));var db=require(_0xae59('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae59('0x4'))(_0xae59('0x5'));var config=require(_0xae59('0x6'));var jayson=require(_0xae59('0x7'));var client=jayson[_0xae59('0x8')][_0xae59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6d07e4,_0x3704c4,_0x58cc7d){return new BPromise(function(_0xcf0f6a,_0x5342cf){return client[_0xae59('0xa')](_0x6d07e4,_0x58cc7d)[_0xae59('0xb')](function(_0x1b0e42){logger[_0xae59('0xc')](_0xae59('0xd'),_0x3704c4,'request\x20sent');logger['debug'](_0xae59('0xe'),_0x3704c4,_0xae59('0xf'),JSON['stringify'](_0x1b0e42));if(_0x1b0e42[_0xae59('0x10')]){if(_0x1b0e42[_0xae59('0x10')][_0xae59('0x11')]===0x1f4){logger['error'](_0xae59('0xd'),_0x3704c4,_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);return _0x5342cf(_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);}logger[_0xae59('0x10')](_0xae59('0xd'),_0x3704c4,_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);return _0xcf0f6a(_0x1b0e42[_0xae59('0x10')][_0xae59('0x12')]);}else{logger['info'](_0xae59('0xd'),_0x3704c4,_0xae59('0xf'));_0xcf0f6a(_0x1b0e42[_0xae59('0x13')]['message']);}})['catch'](function(_0x2c1553){logger[_0xae59('0x10')](_0xae59('0xd'),_0x3704c4,_0x2c1553);_0x5342cf(_0x2c1553);});});}exports['CreateSquareMessage']=function(_0x250400){var _0x150036=this;return new Promise(function(_0x2b73c2,_0x178d13){return db['SquareMessage'][_0xae59('0x14')](_0x250400[_0xae59('0x15')],{'raw':_0x250400[_0xae59('0x16')]?_0x250400[_0xae59('0x16')][_0xae59('0x17')]===undefined?!![]:![]:!![]})[_0xae59('0xb')](function(_0x140db8){logger[_0xae59('0xc')](_0xae59('0x18'),_0x250400);logger[_0xae59('0x19')](_0xae59('0x18'),_0x250400,JSON[_0xae59('0x1a')](_0x140db8));_0x2b73c2(_0x140db8);})[_0xae59('0x1b')](function(_0x4bb665){logger[_0xae59('0x10')](_0xae59('0x18'),_0x4bb665[_0xae59('0x12')],_0x250400);_0x178d13(_0x150036['error'](0x1f4,_0x4bb665[_0xae59('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index b7f9829..9608520 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 _0x9566=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','post','create','destroy'];(function(_0x208f23,_0x556e21){var _0x162683=function(_0x39b903){while(--_0x39b903){_0x208f23['push'](_0x208f23['shift']());}};_0x162683(++_0x556e21);}(_0x9566,0x1d5));var _0x6956=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9566[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x6956('0x0'));var util=require(_0x6956('0x1'));var path=require(_0x6956('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6956('0x3'));var auth=require(_0x6956('0x4'));var interaction=require(_0x6956('0x5'));var config=require(_0x6956('0x6'));var controller=require(_0x6956('0x7'));router['get']('/',auth[_0x6956('0x8')](),controller[_0x6956('0x9')]);router[_0x6956('0xa')](_0x6956('0xb'),auth['isAuthenticated'](),controller[_0x6956('0xc')]);router[_0x6956('0xa')](_0x6956('0xd'),auth[_0x6956('0x8')](),timeout('15s'),controller['test']);router[_0x6956('0xe')]('/',auth['isAuthenticated'](),controller[_0x6956('0xf')]);router['put'](_0x6956('0xb'),auth[_0x6956('0x8')](),controller['update']);router['delete'](_0x6956('0xb'),auth[_0x6956('0x8')](),controller[_0x6956('0x10')]);module[_0x6956('0x11')]=router; \ No newline at end of file +var _0xb574=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','delete'];(function(_0x4dc307,_0x59e8bc){var _0x1f7a19=function(_0x1c8d14){while(--_0x1c8d14){_0x4dc307['push'](_0x4dc307['shift']());}};_0x1f7a19(++_0x59e8bc);}(_0xb574,0xff));var _0x4b57=function(_0x574da8,_0x50754f){_0x574da8=_0x574da8-0x0;var _0x4edc7b=_0xb574[_0x574da8];return _0x4edc7b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b57('0x0'));var timeout=require(_0x4b57('0x1'));var express=require(_0x4b57('0x2'));var router=express['Router']();var fs_extra=require(_0x4b57('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b57('0x4'));var config=require(_0x4b57('0x5'));var controller=require(_0x4b57('0x6'));router[_0x4b57('0x7')]('/',auth[_0x4b57('0x8')](),controller[_0x4b57('0x9')]);router[_0x4b57('0x7')](_0x4b57('0xa'),auth['isAuthenticated'](),controller[_0x4b57('0xb')]);router['get'](_0x4b57('0xc'),auth[_0x4b57('0x8')](),timeout(_0x4b57('0xd')),controller[_0x4b57('0xe')]);router[_0x4b57('0xf')]('/',auth[_0x4b57('0x8')](),controller['create']);router['put'](_0x4b57('0xa'),auth[_0x4b57('0x8')](),controller['update']);router[_0x4b57('0x10')](_0x4b57('0xa'),auth[_0x4b57('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 951a89e..f79465e 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 _0x47cd=['exports','STRING','name'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x47cd,0x1e9));var _0xd47c=function(_0x1f777a,_0x4938c0){_0x1f777a=_0x1f777a-0x0;var _0x370dda=_0x47cd[_0x1f777a];return _0x370dda;};'use strict';var Sequelize=require('sequelize');module[_0xd47c('0x0')]={'name':{'type':Sequelize[_0xd47c('0x1')],'unique':_0xd47c('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd47c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9e99=['exports','STRING','name','sequelize'];(function(_0x44a736,_0xe931c){var _0x32f8fb=function(_0x62f2cf){while(--_0x62f2cf){_0x44a736['push'](_0x44a736['shift']());}};_0x32f8fb(++_0xe931c);}(_0x9e99,0x9b));var _0x99e9=function(_0x489fe3,_0x5ebb81){_0x489fe3=_0x489fe3-0x0;var _0x592190=_0x9e99[_0x489fe3];return _0x592190;};'use strict';var Sequelize=require(_0x99e9('0x0'));module[_0x99e9('0x1')]={'name':{'type':Sequelize[_0x99e9('0x2')],'unique':_0x99e9('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 2f61975..031d7ca 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 _0x9d0e=['save','update','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','index','SquareOdbc','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x146cda,_0x47ef74){var _0x55c2f6=function(_0x5b4fe2){while(--_0x5b4fe2){_0x146cda['push'](_0x146cda['shift']());}};_0x55c2f6(++_0x47ef74);}(_0x9d0e,0xde));var _0xe9d0=function(_0x4bb0e1,_0x2ce957){_0x4bb0e1=_0x4bb0e1-0x0;var _0x52a1f1=_0x9d0e[_0x4bb0e1];return _0x52a1f1;};'use strict';var emlformat=require(_0xe9d0('0x0'));var rimraf=require(_0xe9d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9d0('0x2'));var rp=require(_0xe9d0('0x3'));var moment=require(_0xe9d0('0x4'));var BPromise=require(_0xe9d0('0x5'));var Mustache=require('mustache');var util=require(_0xe9d0('0x6'));var path=require(_0xe9d0('0x7'));var sox=require(_0xe9d0('0x8'));var csv=require(_0xe9d0('0x9'));var ejs=require(_0xe9d0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9d0('0xb'));var squel=require(_0xe9d0('0xc'));var crypto=require(_0xe9d0('0xd'));var jsforce=require(_0xe9d0('0xe'));var deskjs=require(_0xe9d0('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe9d0('0x10'));var Papa=require(_0xe9d0('0x11'));var Redis=require('ioredis');var authService=require(_0xe9d0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe9d0('0x13'));var hardwareService=require(_0xe9d0('0x14'));var logger=require('../../config/logger')(_0xe9d0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe9d0('0x16'));var db=require(_0xe9d0('0x17'))['db'];function respondWithStatusCode(_0x462fce,_0x1cbd8e){_0x1cbd8e=_0x1cbd8e||0xcc;return function(_0x58b34b){if(_0x58b34b){return _0x462fce[_0xe9d0('0x18')](_0x1cbd8e);}return _0x462fce[_0xe9d0('0x19')](_0x1cbd8e)[_0xe9d0('0x1a')]();};}function respondWithResult(_0x19e8b6,_0x333a4c){_0x333a4c=_0x333a4c||0xc8;return function(_0x362576){if(_0x362576){return _0x19e8b6[_0xe9d0('0x19')](_0x333a4c)[_0xe9d0('0x1b')](_0x362576);}};}function respondWithFilteredResult(_0x19a806,_0x11a4ae){return function(_0x1e224a){if(_0x1e224a){var _0x34de32=typeof _0x11a4ae[_0xe9d0('0x1c')]===_0xe9d0('0x1d')&&typeof _0x11a4ae[_0xe9d0('0x1e')]==='undefined';var _0x163eb2=_0x1e224a[_0xe9d0('0x1f')];var _0x22ddf2=_0x34de32?0x0:_0x11a4ae[_0xe9d0('0x1c')];var _0x47a51e=_0x34de32?_0x1e224a[_0xe9d0('0x1f')]:_0x11a4ae[_0xe9d0('0x1c')]+_0x11a4ae[_0xe9d0('0x1e')];var _0x5004c0;if(_0x47a51e>=_0x163eb2){_0x47a51e=_0x163eb2;_0x5004c0=0xc8;}else{_0x5004c0=0xce;}_0x19a806[_0xe9d0('0x19')](_0x5004c0);return _0x19a806[_0xe9d0('0x20')](_0xe9d0('0x21'),_0x22ddf2+'-'+_0x47a51e+'/'+_0x163eb2)[_0xe9d0('0x1b')](_0x1e224a);}return null;};}function patchUpdates(_0x55f186){return function(_0x485259){try{jsonpatch[_0xe9d0('0x22')](_0x485259,_0x55f186,!![]);}catch(_0x5cfc29){return BPromise[_0xe9d0('0x23')](_0x5cfc29);}return _0x485259[_0xe9d0('0x24')]();};}function saveUpdates(_0x274ea6,_0x57d1d1){return function(_0x2290ec){if(_0x2290ec){return _0x2290ec[_0xe9d0('0x25')](_0x274ea6)['then'](function(_0x1c90de){return _0x1c90de;});}return null;};}function removeEntity(_0x2f66d3,_0x199483){return function(_0x289106){if(_0x289106){return _0x289106['destroy']()[_0xe9d0('0x26')](function(){var _0x34af87=_0x289106[_0xe9d0('0x27')]({'plain':!![]});var _0x1ec49a=_0xe9d0('0x28');return db[_0xe9d0('0x29')][_0xe9d0('0x2a')]({'where':{'type':_0x1ec49a,'resourceId':_0x34af87['id']}})['then'](function(){return _0x289106;});})[_0xe9d0('0x26')](function(){_0x2f66d3[_0xe9d0('0x19')](0xcc)[_0xe9d0('0x1a')]();});}};}function handleEntityNotFound(_0x74d5f5,_0x7e2720){return function(_0x478c16){if(!_0x478c16){_0x74d5f5['sendStatus'](0x194);}return _0x478c16;};}function handleError(_0x137288,_0x1b19ea){_0x1b19ea=_0x1b19ea||0x1f4;return function(_0x41f5d9){logger[_0xe9d0('0x2b')](_0x41f5d9[_0xe9d0('0x2c')]);if(_0x41f5d9[_0xe9d0('0x2d')]){delete _0x41f5d9[_0xe9d0('0x2d')];}_0x137288[_0xe9d0('0x19')](_0x1b19ea)[_0xe9d0('0x2e')](_0x41f5d9);};}exports[_0xe9d0('0x2f')]=function(_0x387107,_0x2a57f1){var _0x21ef96={},_0x1fcaae={},_0x437d48={'count':0x0,'rows':[]};var _0x317a98=_['map'](db[_0xe9d0('0x30')]['rawAttributes'],function(_0x15e575){return{'name':_0x15e575[_0xe9d0('0x31')],'type':_0x15e575[_0xe9d0('0x32')]['key']};});_0x1fcaae[_0xe9d0('0x33')]=_['map'](_0x317a98,_0xe9d0('0x2d'));_0x1fcaae['query']=_[_0xe9d0('0x34')](_0x387107[_0xe9d0('0x35')]);_0x1fcaae[_0xe9d0('0x36')]=_[_0xe9d0('0x37')](_0x1fcaae[_0xe9d0('0x33')],_0x1fcaae[_0xe9d0('0x35')]);_0x21ef96['attributes']=_['intersection'](_0x1fcaae[_0xe9d0('0x33')],qs['fields'](_0x387107['query'][_0xe9d0('0x38')]));_0x21ef96[_0xe9d0('0x39')]=_0x21ef96[_0xe9d0('0x39')][_0xe9d0('0x3a')]?_0x21ef96[_0xe9d0('0x39')]:_0x1fcaae[_0xe9d0('0x33')];if(!_0x387107[_0xe9d0('0x35')][_0xe9d0('0x3b')](_0xe9d0('0x3c'))){_0x21ef96[_0xe9d0('0x1e')]=qs[_0xe9d0('0x1e')](_0x387107[_0xe9d0('0x35')]['limit']);_0x21ef96['offset']=qs[_0xe9d0('0x1c')](_0x387107[_0xe9d0('0x35')]['offset']);}_0x21ef96['order']=qs[_0xe9d0('0x3d')](_0x387107[_0xe9d0('0x35')][_0xe9d0('0x3d')]);_0x21ef96[_0xe9d0('0x3e')]=qs[_0xe9d0('0x36')](_[_0xe9d0('0x3f')](_0x387107[_0xe9d0('0x35')],_0x1fcaae['filters']),_0x317a98);if(_0x387107[_0xe9d0('0x35')][_0xe9d0('0x40')]){_0x21ef96[_0xe9d0('0x3e')]=_[_0xe9d0('0x41')](_0x21ef96[_0xe9d0('0x3e')],{'$or':_[_0xe9d0('0x42')](_0x317a98,function(_0x39ef39){if(_0x39ef39[_0xe9d0('0x32')]!=='VIRTUAL'){var _0x5cc427={};_0x5cc427[_0x39ef39['name']]={'$like':'%'+_0x387107[_0xe9d0('0x35')]['filter']+'%'};return _0x5cc427;}})});}_0x21ef96=_[_0xe9d0('0x41')]({},_0x21ef96,_0x387107[_0xe9d0('0x43')]);var _0xbdc208={'where':_0x21ef96[_0xe9d0('0x3e')]};return db[_0xe9d0('0x30')][_0xe9d0('0x1f')](_0xbdc208)['then'](function(_0xa4a6bc){_0x437d48['count']=_0xa4a6bc;if(_0x387107[_0xe9d0('0x35')][_0xe9d0('0x44')]){_0x21ef96[_0xe9d0('0x45')]=[{'all':!![]}];}return db['SquareOdbc'][_0xe9d0('0x46')](_0x21ef96);})['then'](function(_0x36c56e){_0x437d48[_0xe9d0('0x47')]=_0x36c56e;return _0x437d48;})['then'](respondWithFilteredResult(_0x2a57f1,_0x21ef96))[_0xe9d0('0x48')](handleError(_0x2a57f1,null));};exports[_0xe9d0('0x49')]=function(_0x2eb827,_0x9f5223){var _0x24e161={'raw':!![],'where':{'id':_0x2eb827['params']['id']}},_0x4cc78c={};_0x4cc78c['model']=_[_0xe9d0('0x34')](db[_0xe9d0('0x30')][_0xe9d0('0x4a')]);_0x4cc78c[_0xe9d0('0x35')]=_[_0xe9d0('0x34')](_0x2eb827['query']);_0x4cc78c[_0xe9d0('0x36')]=_[_0xe9d0('0x37')](_0x4cc78c[_0xe9d0('0x33')],_0x4cc78c[_0xe9d0('0x35')]);_0x24e161[_0xe9d0('0x39')]=_['intersection'](_0x4cc78c['model'],qs[_0xe9d0('0x38')](_0x2eb827[_0xe9d0('0x35')][_0xe9d0('0x38')]));_0x24e161[_0xe9d0('0x39')]=_0x24e161[_0xe9d0('0x39')]['length']?_0x24e161[_0xe9d0('0x39')]:_0x4cc78c['model'];if(_0x2eb827[_0xe9d0('0x35')]['includeAll']){_0x24e161['include']=[{'all':!![]}];}_0x24e161=_[_0xe9d0('0x41')]({},_0x24e161,_0x2eb827[_0xe9d0('0x43')]);return db[_0xe9d0('0x30')][_0xe9d0('0x4b')](_0x24e161)[_0xe9d0('0x26')](handleEntityNotFound(_0x9f5223,null))[_0xe9d0('0x26')](respondWithResult(_0x9f5223,null))['catch'](handleError(_0x9f5223,null));};exports[_0xe9d0('0x4c')]=function(_0x344dba,_0x41b843){return db[_0xe9d0('0x30')][_0xe9d0('0x4c')](_0x344dba[_0xe9d0('0x4d')],{})['then'](function(_0x29e803){var _0x2e922e=_0x344dba['user'][_0xe9d0('0x27')]({'plain':!![]});if(!_0x2e922e)throw new Error(_0xe9d0('0x4e'));if(_0x2e922e[_0xe9d0('0x4f')]==='user'){var _0x59c6ff=_0x29e803[_0xe9d0('0x27')]({'plain':!![]});var _0xa27bb4='ODBC';return db[_0xe9d0('0x50')][_0xe9d0('0x4b')]({'where':{'name':_0xa27bb4,'userProfileId':_0x2e922e[_0xe9d0('0x51')]},'raw':!![]})['then'](function(_0x224c7f){if(_0x224c7f&&_0x224c7f['autoAssociation']===0x0){return db[_0xe9d0('0x29')][_0xe9d0('0x4c')]({'name':_0x59c6ff[_0xe9d0('0x2d')],'resourceId':_0x59c6ff['id'],'type':_0x224c7f[_0xe9d0('0x2d')],'sectionId':_0x224c7f['id']},{})[_0xe9d0('0x26')](function(){return _0x29e803;});}else{return _0x29e803;}})[_0xe9d0('0x48')](function(_0x3cb2e6){logger[_0xe9d0('0x2b')](_0xe9d0('0x52'),_0x3cb2e6);throw _0x3cb2e6;});}return _0x29e803;})[_0xe9d0('0x26')](respondWithResult(_0x41b843,0xc9))[_0xe9d0('0x48')](handleError(_0x41b843,null));};exports[_0xe9d0('0x25')]=function(_0x4365a4,_0x56ec91){if(_0x4365a4['body']['id']){delete _0x4365a4[_0xe9d0('0x4d')]['id'];}return db[_0xe9d0('0x30')][_0xe9d0('0x4b')]({'where':{'id':_0x4365a4['params']['id']}})[_0xe9d0('0x26')](handleEntityNotFound(_0x56ec91,null))['then'](saveUpdates(_0x4365a4[_0xe9d0('0x4d')],null))['then'](respondWithResult(_0x56ec91,null))[_0xe9d0('0x48')](handleError(_0x56ec91,null));};exports[_0xe9d0('0x2a')]=function(_0x3ab4f2,_0x200be4){return db[_0xe9d0('0x30')]['find']({'where':{'id':_0x3ab4f2[_0xe9d0('0x53')]['id']}})[_0xe9d0('0x26')](handleEntityNotFound(_0x200be4,null))['then'](removeEntity(_0x200be4,null))[_0xe9d0('0x48')](handleError(_0x200be4,null));};exports['test']=function(_0x3a5001,_0x213065,_0xbddbfe){var _0x37ee84;return db[_0xe9d0('0x30')][_0xe9d0('0x4b')]({'where':{'id':_0x3a5001[_0xe9d0('0x53')]['id']},'attributes':['id','dsn']})[_0xe9d0('0x26')](handleEntityNotFound(_0x213065,null))[_0xe9d0('0x26')](function(_0x501578){if(_0x501578){var _0x5a1a78=require('odbc')();_0x5a1a78[_0xe9d0('0x54')](_0x501578['dsn']);_0x5a1a78[_0xe9d0('0x55')]();return _0x501578;}})[_0xe9d0('0x26')](respondWithResult(_0x213065,null))['catch'](handleError(_0x213065,null));}; \ No newline at end of file +var _0xd9ca=['params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','odbc','openSync','closeSync','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x252ebc,_0x47b093){var _0x181ea9=function(_0x334571){while(--_0x334571){_0x252ebc['push'](_0x252ebc['shift']());}};_0x181ea9(++_0x47b093);}(_0xd9ca,0x116));var _0xad9c=function(_0x1ac4a2,_0x5d9182){_0x1ac4a2=_0x1ac4a2-0x0;var _0x508d77=_0xd9ca[_0x1ac4a2];return _0x508d77;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xad9c('0x0'));var rp=require('request-promise');var moment=require(_0xad9c('0x1'));var BPromise=require(_0xad9c('0x2'));var Mustache=require(_0xad9c('0x3'));var util=require(_0xad9c('0x4'));var path=require(_0xad9c('0x5'));var sox=require(_0xad9c('0x6'));var csv=require(_0xad9c('0x7'));var ejs=require(_0xad9c('0x8'));var fs=require('fs');var fs_extra=require(_0xad9c('0x9'));var _=require(_0xad9c('0xa'));var squel=require(_0xad9c('0xb'));var crypto=require(_0xad9c('0xc'));var jsforce=require(_0xad9c('0xd'));var deskjs=require(_0xad9c('0xe'));var toCsv=require(_0xad9c('0x7'));var querystring=require(_0xad9c('0xf'));var Papa=require('papaparse');var Redis=require(_0xad9c('0x10'));var authService=require(_0xad9c('0x11'));var qs=require(_0xad9c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xad9c('0x13'))(_0xad9c('0x14'));var utils=require(_0xad9c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54bde9,_0x192f07){_0x192f07=_0x192f07||0xcc;return function(_0x410671){if(_0x410671){return _0x54bde9[_0xad9c('0x16')](_0x192f07);}return _0x54bde9[_0xad9c('0x17')](_0x192f07)[_0xad9c('0x18')]();};}function respondWithResult(_0x405d61,_0x251176){_0x251176=_0x251176||0xc8;return function(_0x308a65){if(_0x308a65){return _0x405d61[_0xad9c('0x17')](_0x251176)[_0xad9c('0x19')](_0x308a65);}};}function respondWithFilteredResult(_0x2a304b,_0x5c2ccf){return function(_0x523c7f){if(_0x523c7f){var _0x384c2e=typeof _0x5c2ccf[_0xad9c('0x1a')]==='undefined'&&typeof _0x5c2ccf[_0xad9c('0x1b')]==='undefined';var _0x463188=_0x523c7f[_0xad9c('0x1c')];var _0x1e277f=_0x384c2e?0x0:_0x5c2ccf[_0xad9c('0x1a')];var _0x15674c=_0x384c2e?_0x523c7f[_0xad9c('0x1c')]:_0x5c2ccf[_0xad9c('0x1a')]+_0x5c2ccf[_0xad9c('0x1b')];var _0x1e6b97;if(_0x15674c>=_0x463188){_0x15674c=_0x463188;_0x1e6b97=0xc8;}else{_0x1e6b97=0xce;}_0x2a304b[_0xad9c('0x17')](_0x1e6b97);return _0x2a304b[_0xad9c('0x1d')](_0xad9c('0x1e'),_0x1e277f+'-'+_0x15674c+'/'+_0x463188)[_0xad9c('0x19')](_0x523c7f);}return null;};}function patchUpdates(_0x1e0455){return function(_0x29aef2){try{jsonpatch[_0xad9c('0x1f')](_0x29aef2,_0x1e0455,!![]);}catch(_0x459393){return BPromise[_0xad9c('0x20')](_0x459393);}return _0x29aef2[_0xad9c('0x21')]();};}function saveUpdates(_0x623e36,_0x30fa36){return function(_0x42d451){if(_0x42d451){return _0x42d451['update'](_0x623e36)[_0xad9c('0x22')](function(_0x3bb2f2){return _0x3bb2f2;});}return null;};}function removeEntity(_0x5f2839,_0x5346f8){return function(_0x471f06){if(_0x471f06){return _0x471f06[_0xad9c('0x23')]()['then'](function(){var _0xfa478a=_0x471f06[_0xad9c('0x24')]({'plain':!![]});var _0x366fa7=_0xad9c('0x25');return db[_0xad9c('0x26')]['destroy']({'where':{'type':_0x366fa7,'resourceId':_0xfa478a['id']}})['then'](function(){return _0x471f06;});})[_0xad9c('0x22')](function(){_0x5f2839[_0xad9c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f9433,_0x1e711d){return function(_0x5dbbcf){if(!_0x5dbbcf){_0x4f9433[_0xad9c('0x16')](0x194);}return _0x5dbbcf;};}function handleError(_0x4d92bd,_0x4a2f0d){_0x4a2f0d=_0x4a2f0d||0x1f4;return function(_0x178ab7){logger[_0xad9c('0x27')](_0x178ab7[_0xad9c('0x28')]);if(_0x178ab7['name']){delete _0x178ab7[_0xad9c('0x29')];}_0x4d92bd[_0xad9c('0x17')](_0x4a2f0d)[_0xad9c('0x2a')](_0x178ab7);};}exports['index']=function(_0x193b56,_0x23aa74){var _0x378259={},_0x348f2e={},_0x340a55={'count':0x0,'rows':[]};var _0x565e9f=_[_0xad9c('0x2b')](db[_0xad9c('0x2c')][_0xad9c('0x2d')],function(_0x1613ec){return{'name':_0x1613ec[_0xad9c('0x2e')],'type':_0x1613ec[_0xad9c('0x2f')]['key']};});_0x348f2e['model']=_[_0xad9c('0x2b')](_0x565e9f,'name');_0x348f2e[_0xad9c('0x30')]=_['keys'](_0x193b56[_0xad9c('0x30')]);_0x348f2e[_0xad9c('0x31')]=_['intersection'](_0x348f2e['model'],_0x348f2e[_0xad9c('0x30')]);_0x378259[_0xad9c('0x32')]=_[_0xad9c('0x33')](_0x348f2e[_0xad9c('0x34')],qs['fields'](_0x193b56['query'][_0xad9c('0x35')]));_0x378259[_0xad9c('0x32')]=_0x378259[_0xad9c('0x32')][_0xad9c('0x36')]?_0x378259['attributes']:_0x348f2e['model'];if(!_0x193b56[_0xad9c('0x30')][_0xad9c('0x37')](_0xad9c('0x38'))){_0x378259['limit']=qs[_0xad9c('0x1b')](_0x193b56['query'][_0xad9c('0x1b')]);_0x378259[_0xad9c('0x1a')]=qs['offset'](_0x193b56[_0xad9c('0x30')][_0xad9c('0x1a')]);}_0x378259[_0xad9c('0x39')]=qs[_0xad9c('0x3a')](_0x193b56[_0xad9c('0x30')][_0xad9c('0x3a')]);_0x378259[_0xad9c('0x3b')]=qs['filters'](_[_0xad9c('0x3c')](_0x193b56[_0xad9c('0x30')],_0x348f2e[_0xad9c('0x31')]),_0x565e9f);if(_0x193b56['query'][_0xad9c('0x3d')]){_0x378259[_0xad9c('0x3b')]=_[_0xad9c('0x3e')](_0x378259[_0xad9c('0x3b')],{'$or':_[_0xad9c('0x2b')](_0x565e9f,function(_0x81337f){if(_0x81337f[_0xad9c('0x2f')]!==_0xad9c('0x3f')){var _0x14383b={};_0x14383b[_0x81337f[_0xad9c('0x29')]]={'$like':'%'+_0x193b56[_0xad9c('0x30')][_0xad9c('0x3d')]+'%'};return _0x14383b;}})});}_0x378259=_[_0xad9c('0x3e')]({},_0x378259,_0x193b56[_0xad9c('0x40')]);var _0x3d7905={'where':_0x378259[_0xad9c('0x3b')]};return db[_0xad9c('0x2c')][_0xad9c('0x1c')](_0x3d7905)[_0xad9c('0x22')](function(_0x317cfc){_0x340a55[_0xad9c('0x1c')]=_0x317cfc;if(_0x193b56[_0xad9c('0x30')][_0xad9c('0x41')]){_0x378259[_0xad9c('0x42')]=[{'all':!![]}];}return db[_0xad9c('0x2c')][_0xad9c('0x43')](_0x378259);})[_0xad9c('0x22')](function(_0x5d8566){_0x340a55[_0xad9c('0x44')]=_0x5d8566;return _0x340a55;})['then'](respondWithFilteredResult(_0x23aa74,_0x378259))[_0xad9c('0x45')](handleError(_0x23aa74,null));};exports['show']=function(_0x1de629,_0xd3652f){var _0x1d3863={'raw':!![],'where':{'id':_0x1de629[_0xad9c('0x46')]['id']}},_0x31fa19={};_0x31fa19[_0xad9c('0x34')]=_[_0xad9c('0x47')](db['SquareOdbc'][_0xad9c('0x2d')]);_0x31fa19[_0xad9c('0x30')]=_[_0xad9c('0x47')](_0x1de629[_0xad9c('0x30')]);_0x31fa19[_0xad9c('0x31')]=_['intersection'](_0x31fa19[_0xad9c('0x34')],_0x31fa19[_0xad9c('0x30')]);_0x1d3863['attributes']=_[_0xad9c('0x33')](_0x31fa19[_0xad9c('0x34')],qs[_0xad9c('0x35')](_0x1de629[_0xad9c('0x30')]['fields']));_0x1d3863[_0xad9c('0x32')]=_0x1d3863[_0xad9c('0x32')]['length']?_0x1d3863[_0xad9c('0x32')]:_0x31fa19[_0xad9c('0x34')];if(_0x1de629[_0xad9c('0x30')]['includeAll']){_0x1d3863['include']=[{'all':!![]}];}_0x1d3863=_[_0xad9c('0x3e')]({},_0x1d3863,_0x1de629['options']);return db[_0xad9c('0x2c')][_0xad9c('0x48')](_0x1d3863)[_0xad9c('0x22')](handleEntityNotFound(_0xd3652f,null))[_0xad9c('0x22')](respondWithResult(_0xd3652f,null))['catch'](handleError(_0xd3652f,null));};exports[_0xad9c('0x49')]=function(_0x30b938,_0x2a002c){return db[_0xad9c('0x2c')]['create'](_0x30b938[_0xad9c('0x4a')],{})['then'](function(_0x55dc23){var _0x4f3bd1=_0x30b938[_0xad9c('0x4b')][_0xad9c('0x24')]({'plain':!![]});if(!_0x4f3bd1)throw new Error(_0xad9c('0x4c'));if(_0x4f3bd1['role']===_0xad9c('0x4b')){var _0x124e41=_0x55dc23[_0xad9c('0x24')]({'plain':!![]});var _0x391cc6=_0xad9c('0x25');return db[_0xad9c('0x4d')][_0xad9c('0x48')]({'where':{'name':_0x391cc6,'userProfileId':_0x4f3bd1[_0xad9c('0x4e')]},'raw':!![]})['then'](function(_0x9d4abe){if(_0x9d4abe&&_0x9d4abe[_0xad9c('0x4f')]===0x0){return db[_0xad9c('0x26')]['create']({'name':_0x124e41[_0xad9c('0x29')],'resourceId':_0x124e41['id'],'type':_0x9d4abe[_0xad9c('0x29')],'sectionId':_0x9d4abe['id']},{})[_0xad9c('0x22')](function(){return _0x55dc23;});}else{return _0x55dc23;}})[_0xad9c('0x45')](function(_0x1680ad){logger['error'](_0xad9c('0x50'),_0x1680ad);throw _0x1680ad;});}return _0x55dc23;})['then'](respondWithResult(_0x2a002c,0xc9))[_0xad9c('0x45')](handleError(_0x2a002c,null));};exports[_0xad9c('0x51')]=function(_0x313a9b,_0x24fdbf){if(_0x313a9b[_0xad9c('0x4a')]['id']){delete _0x313a9b[_0xad9c('0x4a')]['id'];}return db[_0xad9c('0x2c')][_0xad9c('0x48')]({'where':{'id':_0x313a9b[_0xad9c('0x46')]['id']}})[_0xad9c('0x22')](handleEntityNotFound(_0x24fdbf,null))[_0xad9c('0x22')](saveUpdates(_0x313a9b['body'],null))[_0xad9c('0x22')](respondWithResult(_0x24fdbf,null))[_0xad9c('0x45')](handleError(_0x24fdbf,null));};exports[_0xad9c('0x23')]=function(_0x18d1be,_0x233505){return db[_0xad9c('0x2c')]['find']({'where':{'id':_0x18d1be[_0xad9c('0x46')]['id']}})[_0xad9c('0x22')](handleEntityNotFound(_0x233505,null))[_0xad9c('0x22')](removeEntity(_0x233505,null))[_0xad9c('0x45')](handleError(_0x233505,null));};exports[_0xad9c('0x52')]=function(_0x280089,_0x141018,_0x4d7d09){var _0x5bac8a;return db[_0xad9c('0x2c')]['find']({'where':{'id':_0x280089[_0xad9c('0x46')]['id']},'attributes':['id',_0xad9c('0x53')]})[_0xad9c('0x22')](handleEntityNotFound(_0x141018,null))['then'](function(_0x13c5a0){if(_0x13c5a0){var _0x1f8b1c=require(_0xad9c('0x54'))();_0x1f8b1c[_0xad9c('0x55')](_0x13c5a0[_0xad9c('0x53')]);_0x1f8b1c[_0xad9c('0x56')]();return _0x13c5a0;}})[_0xad9c('0x22')](respondWithResult(_0x141018,null))[_0xad9c('0x45')](handleError(_0x141018,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 29f8147..59c4f93 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 _0x7db1=['exports','define','SquareOdbc','square_odbc','../../config/logger','api','moment','bluebird','../../config/environment','./squareOdbc.attributes'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x7db1,0x1ee));var _0x17db=function(_0x5d8084,_0x1947e9){_0x5d8084=_0x5d8084-0x0;var _0x4c0147=_0x7db1[_0x5d8084];return _0x4c0147;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x17db('0x0'))(_0x17db('0x1'));var moment=require(_0x17db('0x2'));var BPromise=require(_0x17db('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x17db('0x4'));var attributes=require(_0x17db('0x5'));module[_0x17db('0x6')]=function(_0x547f2d,_0x4693dd){return _0x547f2d[_0x17db('0x7')](_0x17db('0x8'),attributes,{'tableName':_0x17db('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8876=['square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x1ae449,_0x2fe441){var _0x5c7cee=function(_0x442301){while(--_0x442301){_0x1ae449['push'](_0x1ae449['shift']());}};_0x5c7cee(++_0x2fe441);}(_0x8876,0x1a3));var _0x6887=function(_0x222c4c,_0x44d3b2){_0x222c4c=_0x222c4c-0x0;var _0x54c2c0=_0x8876[_0x222c4c];return _0x54c2c0;};'use strict';var _=require(_0x6887('0x0'));var util=require('util');var logger=require(_0x6887('0x1'))(_0x6887('0x2'));var moment=require(_0x6887('0x3'));var BPromise=require(_0x6887('0x4'));var rp=require(_0x6887('0x5'));var fs=require('fs');var path=require(_0x6887('0x6'));var rimraf=require(_0x6887('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x6887('0x8')]=function(_0x499ae8,_0x223eff){return _0x499ae8[_0x6887('0x9')]('SquareOdbc',attributes,{'tableName':_0x6887('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index d8ed441..f6f2428 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 _0x7586=['then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','result','SquareOdbc','find','options','raw','where','attributes','include','map','model','ShowSquareOdbc','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x316ffd,_0x52c35d){var _0x26add6=function(_0x40bbde){while(--_0x40bbde){_0x316ffd['push'](_0x316ffd['shift']());}};_0x26add6(++_0x52c35d);}(_0x7586,0xc8));var _0x6758=function(_0x1819bd,_0x15e90e){_0x1819bd=_0x1819bd-0x0;var _0x5b5f76=_0x7586[_0x1819bd];return _0x5b5f76;};'use strict';var _=require(_0x6758('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6758('0x1'));var rs=require(_0x6758('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6758('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6758('0x4'))(_0x6758('0x5'));var config=require(_0x6758('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6758('0x7')][_0x6758('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3071f5,_0x311ff3,_0x1d8c4c){return new BPromise(function(_0x3ea2f5,_0x303f9f){return client[_0x6758('0x9')](_0x3071f5,_0x1d8c4c)[_0x6758('0xa')](function(_0x47f57b){logger[_0x6758('0xb')](_0x6758('0xc'),_0x311ff3,_0x6758('0xd'));logger[_0x6758('0xe')](_0x6758('0xf'),_0x311ff3,_0x6758('0xd'),JSON['stringify'](_0x47f57b));if(_0x47f57b[_0x6758('0x10')]){if(_0x47f57b[_0x6758('0x10')]['code']===0x1f4){logger[_0x6758('0x10')](_0x6758('0xc'),_0x311ff3,_0x47f57b[_0x6758('0x10')]['message']);return _0x303f9f(_0x47f57b['error'][_0x6758('0x11')]);}logger[_0x6758('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x311ff3,_0x47f57b[_0x6758('0x10')][_0x6758('0x11')]);return _0x3ea2f5(_0x47f57b[_0x6758('0x10')][_0x6758('0x11')]);}else{logger[_0x6758('0xb')](_0x6758('0xc'),_0x311ff3,_0x6758('0xd'));_0x3ea2f5(_0x47f57b[_0x6758('0x12')][_0x6758('0x11')]);}})['catch'](function(_0x2d067c){logger[_0x6758('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x311ff3,_0x2d067c);_0x303f9f(_0x2d067c);});});}exports['ShowSquareOdbc']=function(_0x2f4aae){var _0xc174f7=this;return new Promise(function(_0x4c1db3,_0x267899){return db[_0x6758('0x13')][_0x6758('0x14')]({'raw':_0x2f4aae[_0x6758('0x15')]?_0x2f4aae[_0x6758('0x15')][_0x6758('0x16')]===undefined?!![]:![]:!![],'where':_0x2f4aae[_0x6758('0x15')]?_0x2f4aae[_0x6758('0x15')][_0x6758('0x17')]||null:null,'attributes':_0x2f4aae[_0x6758('0x15')]?_0x2f4aae[_0x6758('0x15')][_0x6758('0x18')]||null:null,'include':_0x2f4aae[_0x6758('0x15')]?_0x2f4aae[_0x6758('0x15')][_0x6758('0x19')]?_[_0x6758('0x1a')](_0x2f4aae['options'][_0x6758('0x19')],function(_0x9c6510){return{'model':db[_0x9c6510[_0x6758('0x1b')]],'as':_0x9c6510['as'],'attributes':_0x9c6510[_0x6758('0x18')],'include':_0x9c6510[_0x6758('0x19')]?_[_0x6758('0x1a')](_0x9c6510[_0x6758('0x19')],function(_0x5dad52){return{'model':db[_0x5dad52['model']],'as':_0x5dad52['as'],'attributes':_0x5dad52[_0x6758('0x18')],'include':_0x5dad52[_0x6758('0x19')]?_[_0x6758('0x1a')](_0x5dad52[_0x6758('0x19')],function(_0x31b81e){return{'model':db[_0x31b81e[_0x6758('0x1b')]],'as':_0x31b81e['as'],'attributes':_0x31b81e[_0x6758('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6758('0xa')](function(_0x11e278){logger[_0x6758('0xb')](_0x6758('0x1c'),_0x2f4aae);logger[_0x6758('0xe')](_0x6758('0x1c'),_0x2f4aae,JSON[_0x6758('0x1d')](_0x11e278));_0x4c1db3(_0x11e278);})['catch'](function(_0x13159e){logger[_0x6758('0x10')](_0x6758('0x1c'),_0x13159e[_0x6758('0x11')],_0x2f4aae);_0x267899(_0xc174f7[_0x6758('0x10')](0x1f4,_0x13159e[_0x6758('0x11')]));});});}; \ No newline at end of file +var _0xc698=['error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','attributes','include','model','map','then','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xc698,0x1a4));var _0x8c69=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xc698[_0x37b3e5];return _0x207f20;};'use strict';var _=require(_0x8c69('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8c69('0x1'));var rs=require(_0x8c69('0x2'));var fs=require('fs');var Redis=require(_0x8c69('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c69('0x4'));var logger=require(_0x8c69('0x5'))('rpc');var config=require(_0x8c69('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8c69('0x7')][_0x8c69('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x389af0,_0x35a720,_0x2602b2){return new BPromise(function(_0x59e1f0,_0x4185e9){return client[_0x8c69('0x9')](_0x389af0,_0x2602b2)['then'](function(_0x2a6efa){logger['info'](_0x8c69('0xa'),_0x35a720,_0x8c69('0xb'));logger[_0x8c69('0xc')](_0x8c69('0xd'),_0x35a720,_0x8c69('0xb'),JSON[_0x8c69('0xe')](_0x2a6efa));if(_0x2a6efa[_0x8c69('0xf')]){if(_0x2a6efa['error'][_0x8c69('0x10')]===0x1f4){logger[_0x8c69('0xf')](_0x8c69('0xa'),_0x35a720,_0x2a6efa['error'][_0x8c69('0x11')]);return _0x4185e9(_0x2a6efa[_0x8c69('0xf')]['message']);}logger[_0x8c69('0xf')](_0x8c69('0xa'),_0x35a720,_0x2a6efa['error'][_0x8c69('0x11')]);return _0x59e1f0(_0x2a6efa[_0x8c69('0xf')]['message']);}else{logger[_0x8c69('0x12')](_0x8c69('0xa'),_0x35a720,_0x8c69('0xb'));_0x59e1f0(_0x2a6efa['result'][_0x8c69('0x11')]);}})[_0x8c69('0x13')](function(_0x347677){logger[_0x8c69('0xf')](_0x8c69('0xa'),_0x35a720,_0x347677);_0x4185e9(_0x347677);});});}exports[_0x8c69('0x14')]=function(_0x39bc8d){var _0x10b80f=this;return new Promise(function(_0x5d1136,_0x114aaa){return db[_0x8c69('0x15')][_0x8c69('0x16')]({'raw':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d[_0x8c69('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d['options']['where']||null:null,'attributes':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d[_0x8c69('0x17')][_0x8c69('0x18')]||null:null,'include':_0x39bc8d[_0x8c69('0x17')]?_0x39bc8d[_0x8c69('0x17')][_0x8c69('0x19')]?_['map'](_0x39bc8d[_0x8c69('0x17')][_0x8c69('0x19')],function(_0x42b4a7){return{'model':db[_0x42b4a7[_0x8c69('0x1a')]],'as':_0x42b4a7['as'],'attributes':_0x42b4a7[_0x8c69('0x18')],'include':_0x42b4a7[_0x8c69('0x19')]?_['map'](_0x42b4a7[_0x8c69('0x19')],function(_0x39935c){return{'model':db[_0x39935c[_0x8c69('0x1a')]],'as':_0x39935c['as'],'attributes':_0x39935c['attributes'],'include':_0x39935c['include']?_[_0x8c69('0x1b')](_0x39935c['include'],function(_0x518960){return{'model':db[_0x518960[_0x8c69('0x1a')]],'as':_0x518960['as'],'attributes':_0x518960['attributes']};}):[]};}):[]};}):[]:[]})[_0x8c69('0x1c')](function(_0x573a03){logger[_0x8c69('0x12')](_0x8c69('0x14'),_0x39bc8d);logger[_0x8c69('0xc')]('ShowSquareOdbc',_0x39bc8d,JSON[_0x8c69('0xe')](_0x573a03));_0x5d1136(_0x573a03);})['catch'](function(_0x58b391){logger[_0x8c69('0xf')](_0x8c69('0x14'),_0x58b391['message'],_0x39bc8d);_0x114aaa(_0x10b80f[_0x8c69('0xf')](0x1f4,_0x58b391[_0x8c69('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 4f5f7c7..3523b99 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 _0xe0ee=['../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe0ee,0x9a));var _0xee0e=function(_0x53fcd0,_0x294576){_0x53fcd0=_0x53fcd0-0x0;var _0x456acb=_0xe0ee[_0x53fcd0];return _0x456acb;};'use strict';var multer=require(_0xee0e('0x0'));var util=require(_0xee0e('0x1'));var path=require(_0xee0e('0x2'));var timeout=require(_0xee0e('0x3'));var express=require(_0xee0e('0x4'));var router=express[_0xee0e('0x5')]();var fs_extra=require(_0xee0e('0x6'));var auth=require(_0xee0e('0x7'));var interaction=require(_0xee0e('0x8'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router['get']('/',auth[_0xee0e('0x9')](),controller[_0xee0e('0xa')]);router[_0xee0e('0xb')](_0xee0e('0xc'),auth[_0xee0e('0x9')](),controller[_0xee0e('0xd')]);router['post']('/',auth[_0xee0e('0x9')](),controller[_0xee0e('0xe')]);router[_0xee0e('0xf')](_0xee0e('0xc'),auth[_0xee0e('0x9')](),controller[_0xee0e('0x10')]);router['delete'](_0xee0e('0xc'),auth[_0xee0e('0x9')](),controller[_0xee0e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0d2c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x194016,_0x12572a){var _0x5aae35=function(_0x578ab3){while(--_0x578ab3){_0x194016['push'](_0x194016['shift']());}};_0x5aae35(++_0x12572a);}(_0x0d2c,0x1f4));var _0xc0d2=function(_0x2e586b,_0x3a5429){_0x2e586b=_0x2e586b-0x0;var _0x3474a1=_0x0d2c[_0x2e586b];return _0x3474a1;};'use strict';var multer=require(_0xc0d2('0x0'));var util=require(_0xc0d2('0x1'));var path=require(_0xc0d2('0x2'));var timeout=require(_0xc0d2('0x3'));var express=require(_0xc0d2('0x4'));var router=express[_0xc0d2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc0d2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc0d2('0x7'));var controller=require(_0xc0d2('0x8'));router[_0xc0d2('0x9')]('/',auth[_0xc0d2('0xa')](),controller[_0xc0d2('0xb')]);router[_0xc0d2('0x9')](_0xc0d2('0xc'),auth[_0xc0d2('0xa')](),controller[_0xc0d2('0xd')]);router[_0xc0d2('0xe')]('/',auth['isAuthenticated'](),controller[_0xc0d2('0xf')]);router[_0xc0d2('0x10')](_0xc0d2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc0d2('0x11')](_0xc0d2('0xc'),auth[_0xc0d2('0xa')](),controller[_0xc0d2('0x12')]);module[_0xc0d2('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 e7be29d..4e68179 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 _0x4c50=['production','utf8','DATE','sequelize','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x7febda,_0x1f8318){var _0x32fb3d=function(_0x28b72c){while(--_0x28b72c){_0x7febda['push'](_0x7febda['shift']());}};_0x32fb3d(++_0x1f8318);}(_0x4c50,0x1f2));var _0x04c5=function(_0x59e5ed,_0x1dc619){_0x59e5ed=_0x59e5ed-0x0;var _0x3601c1=_0x4c50[_0x59e5ed];return _0x3601c1;};'use strict';var Sequelize=require(_0x04c5('0x0'));module['exports']={'name':{'type':Sequelize[_0x04c5('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x04c5('0x1')]},'notes':{'type':Sequelize[_0x04c5('0x2')]},'preproduction':{'type':Sequelize[_0x04c5('0x3')](_0x04c5('0x4')),'get':function(){if(this[_0x04c5('0x5')](_0x04c5('0x6'))){return this[_0x04c5('0x5')](_0x04c5('0x6'))[_0x04c5('0x7')]('utf8');}}},'production':{'type':Sequelize[_0x04c5('0x3')](_0x04c5('0x4')),'get':function(){if(this[_0x04c5('0x5')](_0x04c5('0x8'))){return this[_0x04c5('0x5')]('production')[_0x04c5('0x7')](_0x04c5('0x9'));}}},'savedAt':{'type':Sequelize[_0x04c5('0xa')]},'publishedAt':{'type':Sequelize[_0x04c5('0xa')]}}; \ No newline at end of file +var _0xbc5a=['BLOB','production','DATE','exports','STRING','name','long','preproduction','getDataValue','toString'];(function(_0x98db33,_0x397f20){var _0x5ae63a=function(_0x411f1c){while(--_0x411f1c){_0x98db33['push'](_0x98db33['shift']());}};_0x5ae63a(++_0x397f20);}(_0xbc5a,0x193));var _0xabc5=function(_0x2be67f,_0x238c6d){_0x2be67f=_0x2be67f-0x0;var _0x1d94b4=_0xbc5a[_0x2be67f];return _0x1d94b4;};'use strict';var Sequelize=require('sequelize');module[_0xabc5('0x0')]={'name':{'type':Sequelize[_0xabc5('0x1')],'unique':_0xabc5('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0xabc5('0x3')),'get':function(){if(this['getDataValue'](_0xabc5('0x4'))){return this[_0xabc5('0x5')](_0xabc5('0x4'))[_0xabc5('0x6')]('utf8');}}},'production':{'type':Sequelize[_0xabc5('0x7')](_0xabc5('0x3')),'get':function(){if(this['getDataValue']('production')){return this[_0xabc5('0x5')](_0xabc5('0x8'))[_0xabc5('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0xabc5('0x9')]},'publishedAt':{'type':Sequelize[_0xabc5('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 7ef20f2..ca02842 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 _0xd6f3=['query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','offset','limit','undefined','count','status','Content-Range','json','then','get','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','stack','name','index','map','SquareProject','rawAttributes','fieldName','key'];(function(_0x3d9c78,_0x1890ad){var _0x5de9e7=function(_0x23bcfe){while(--_0x23bcfe){_0x3d9c78['push'](_0x3d9c78['shift']());}};_0x5de9e7(++_0x1890ad);}(_0xd6f3,0x16f));var _0x3d6f=function(_0x570484,_0x2a8c27){_0x570484=_0x570484-0x0;var _0x2a706c=_0xd6f3[_0x570484];return _0x2a706c;};'use strict';var _=require(_0x3d6f('0x0'));var Redis=require(_0x3d6f('0x1'));var qs=require(_0x3d6f('0x2'));var logger=require(_0x3d6f('0x3'))(_0x3d6f('0x4'));var config=require(_0x3d6f('0x5'));var db=require('../../mysqldb')['db'];config[_0x3d6f('0x6')]=_[_0x3d6f('0x7')](config[_0x3d6f('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d6f('0x8'))(new Redis(config[_0x3d6f('0x6')]));require('./squareProject.socket')[_0x3d6f('0x9')](socket);function respondWithResult(_0x5bb906,_0x193a7b){_0x193a7b=_0x193a7b||0xc8;return function(_0x10b8df){if(_0x10b8df){return _0x5bb906['status'](_0x193a7b)['json'](_0x10b8df);}};}function respondWithFilteredResult(_0x4262e4,_0x2e467f){return function(_0x64c53e){if(_0x64c53e){var _0x42ebd4=typeof _0x2e467f[_0x3d6f('0xa')]==='undefined'&&typeof _0x2e467f[_0x3d6f('0xb')]===_0x3d6f('0xc');var _0x19738d=_0x64c53e[_0x3d6f('0xd')];var _0xed48df=_0x42ebd4?0x0:_0x2e467f[_0x3d6f('0xa')];var _0x2be8c5=_0x42ebd4?_0x64c53e[_0x3d6f('0xd')]:_0x2e467f[_0x3d6f('0xa')]+_0x2e467f[_0x3d6f('0xb')];var _0x4cd744;if(_0x2be8c5>=_0x19738d){_0x2be8c5=_0x19738d;_0x4cd744=0xc8;}else{_0x4cd744=0xce;}_0x4262e4[_0x3d6f('0xe')](_0x4cd744);return _0x4262e4['set'](_0x3d6f('0xf'),_0xed48df+'-'+_0x2be8c5+'/'+_0x19738d)[_0x3d6f('0x10')](_0x64c53e);}return null;};}function saveUpdates(_0x4371e8){return function(_0x1d4233){if(_0x1d4233){return _0x1d4233['update'](_0x4371e8)[_0x3d6f('0x11')](function(_0x13430b){return _0x13430b;});}return null;};}function removeEntity(_0x1b066a){return function(_0x449425){if(_0x449425){return _0x449425['destroy']()[_0x3d6f('0x11')](function(){var _0x951012=_0x449425[_0x3d6f('0x12')]({'plain':!![]});var _0x2f9cd9=_0x3d6f('0x13');return db[_0x3d6f('0x14')][_0x3d6f('0x15')]({'where':{'type':_0x2f9cd9,'resourceId':_0x951012['id']}})[_0x3d6f('0x11')](function(){return _0x449425;});})[_0x3d6f('0x11')](function(){var _0x2fcd3=new Redis(config[_0x3d6f('0x6')]);_0x2fcd3[_0x3d6f('0x16')](_0x3d6f('0x17'),JSON[_0x3d6f('0x18')]({'id':_0x449425['id'],'deleted':!![]}));})[_0x3d6f('0x11')](function(){_0x1b066a['status'](0xcc)[_0x3d6f('0x19')]();});}};}function handleEntityNotFound(_0x31b6eb){return function(_0x89f3fb){if(!_0x89f3fb){_0x31b6eb[_0x3d6f('0x1a')](0x194);}return _0x89f3fb;};}function handleError(_0x57f832,_0x310d5f){_0x310d5f=_0x310d5f||0x1f4;return function(_0x202b11){logger['error'](_0x202b11[_0x3d6f('0x1b')]);if(_0x202b11[_0x3d6f('0x1c')]){delete _0x202b11[_0x3d6f('0x1c')];}_0x57f832[_0x3d6f('0xe')](_0x310d5f)['send'](_0x202b11);};}exports[_0x3d6f('0x1d')]=function(_0x25c043,_0x10dea4){var _0x28c886={},_0x5bece8={},_0xa21c14={'count':0x0,'rows':[]};var _0x290fb1=_[_0x3d6f('0x1e')](db[_0x3d6f('0x1f')][_0x3d6f('0x20')],function(_0x111364){return{'name':_0x111364[_0x3d6f('0x21')],'type':_0x111364['type'][_0x3d6f('0x22')]};});_0x5bece8['model']=_['map'](_0x290fb1,_0x3d6f('0x1c'));_0x5bece8[_0x3d6f('0x23')]=_['keys'](_0x25c043[_0x3d6f('0x23')]);_0x5bece8[_0x3d6f('0x24')]=_[_0x3d6f('0x25')](_0x5bece8[_0x3d6f('0x26')],_0x5bece8[_0x3d6f('0x23')]);_0x28c886['attributes']=_[_0x3d6f('0x25')](_0x5bece8[_0x3d6f('0x26')],qs[_0x3d6f('0x27')](_0x25c043[_0x3d6f('0x23')][_0x3d6f('0x27')]));_0x28c886[_0x3d6f('0x28')]=_0x28c886[_0x3d6f('0x28')][_0x3d6f('0x29')]?_0x28c886['attributes']:_0x5bece8['model'];if(!_0x25c043[_0x3d6f('0x23')]['hasOwnProperty'](_0x3d6f('0x2a'))){_0x28c886['limit']=qs[_0x3d6f('0xb')](_0x25c043['query'][_0x3d6f('0xb')]);_0x28c886[_0x3d6f('0xa')]=qs[_0x3d6f('0xa')](_0x25c043['query'][_0x3d6f('0xa')]);}_0x28c886[_0x3d6f('0x2b')]=qs['sort'](_0x25c043['query'][_0x3d6f('0x2c')]);_0x28c886[_0x3d6f('0x2d')]=qs[_0x3d6f('0x24')](_[_0x3d6f('0x2e')](_0x25c043['query'],_0x5bece8[_0x3d6f('0x24')]),_0x290fb1);if(_0x25c043['query'][_0x3d6f('0x2f')]){_0x28c886['where']=_[_0x3d6f('0x30')](_0x28c886[_0x3d6f('0x2d')],{'$or':_['map'](_0x290fb1,function(_0x5ce003){if(_0x5ce003['type']!==_0x3d6f('0x31')){var _0x25a0d8={};_0x25a0d8[_0x5ce003[_0x3d6f('0x1c')]]={'$like':'%'+_0x25c043[_0x3d6f('0x23')][_0x3d6f('0x2f')]+'%'};return _0x25a0d8;}})});}_0x28c886=_[_0x3d6f('0x30')]({},_0x28c886,_0x25c043[_0x3d6f('0x32')]);var _0x5f9c4c={'where':_0x28c886[_0x3d6f('0x2d')]};return db[_0x3d6f('0x1f')][_0x3d6f('0xd')](_0x5f9c4c)['then'](function(_0x532652){_0xa21c14['count']=_0x532652;if(_0x25c043[_0x3d6f('0x23')][_0x3d6f('0x33')]){_0x28c886[_0x3d6f('0x34')]=[{'all':!![]}];}return db[_0x3d6f('0x1f')][_0x3d6f('0x35')](_0x28c886);})[_0x3d6f('0x11')](function(_0x5071b1){_0xa21c14['rows']=_0x5071b1;return _0xa21c14;})[_0x3d6f('0x11')](respondWithFilteredResult(_0x10dea4,_0x28c886))[_0x3d6f('0x36')](handleError(_0x10dea4,null));};exports['show']=function(_0x5ad892,_0xc38d03){var _0x5dd3a5={'raw':![],'where':{'id':_0x5ad892[_0x3d6f('0x37')]['id']}},_0x1cf676={};_0x1cf676['model']=_[_0x3d6f('0x38')](db[_0x3d6f('0x1f')][_0x3d6f('0x20')]);_0x1cf676['query']=_[_0x3d6f('0x38')](_0x5ad892['query']);_0x1cf676[_0x3d6f('0x24')]=_[_0x3d6f('0x25')](_0x1cf676[_0x3d6f('0x26')],_0x1cf676[_0x3d6f('0x23')]);_0x5dd3a5[_0x3d6f('0x28')]=_[_0x3d6f('0x25')](_0x1cf676['model'],qs[_0x3d6f('0x27')](_0x5ad892['query'][_0x3d6f('0x27')]));_0x5dd3a5[_0x3d6f('0x28')]=_0x5dd3a5[_0x3d6f('0x28')][_0x3d6f('0x29')]?_0x5dd3a5[_0x3d6f('0x28')]:_0x1cf676[_0x3d6f('0x26')];if(_0x5ad892[_0x3d6f('0x23')]['includeAll']){_0x5dd3a5[_0x3d6f('0x34')]=[{'all':!![]}];}_0x5dd3a5=_[_0x3d6f('0x30')]({},_0x5dd3a5,_0x5ad892['options']);return db[_0x3d6f('0x1f')][_0x3d6f('0x39')](_0x5dd3a5)[_0x3d6f('0x11')](handleEntityNotFound(_0xc38d03,null))['then'](respondWithResult(_0xc38d03,null))[_0x3d6f('0x36')](handleError(_0xc38d03,null));};exports[_0x3d6f('0x3a')]=function(_0x468fa0,_0x35a4d3){return db['SquareProject'][_0x3d6f('0x3a')](_0x468fa0['body'],{})[_0x3d6f('0x11')](function(_0x5d0cf4){var _0x5df30d=_0x468fa0[_0x3d6f('0x3b')][_0x3d6f('0x12')]({'plain':!![]});if(!_0x5df30d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5df30d[_0x3d6f('0x3c')]===_0x3d6f('0x3b')){var _0x175210=_0x5d0cf4[_0x3d6f('0x12')]({'plain':!![]});var _0x150974=_0x3d6f('0x13');return db['UserProfileSection'][_0x3d6f('0x39')]({'where':{'name':_0x150974,'userProfileId':_0x5df30d[_0x3d6f('0x3d')]},'raw':!![]})[_0x3d6f('0x11')](function(_0x1f8662){if(_0x1f8662&&_0x1f8662[_0x3d6f('0x3e')]===0x0){return db[_0x3d6f('0x14')]['create']({'name':_0x175210['name'],'resourceId':_0x175210['id'],'type':_0x1f8662[_0x3d6f('0x1c')],'sectionId':_0x1f8662['id']},{})[_0x3d6f('0x11')](function(){return _0x5d0cf4;});}else{return _0x5d0cf4;}})[_0x3d6f('0x36')](function(_0xfcf3b){logger[_0x3d6f('0x3f')](_0x3d6f('0x40'),_0xfcf3b);throw _0xfcf3b;});}return _0x5d0cf4;})['then'](respondWithResult(_0x35a4d3,0xc9))['catch'](handleError(_0x35a4d3,null));};exports['update']=function(_0x42edad,_0x44bb3c){if(_0x42edad['body']['id']){delete _0x42edad[_0x3d6f('0x41')]['id'];}return db[_0x3d6f('0x1f')][_0x3d6f('0x39')]({'where':{'id':_0x42edad[_0x3d6f('0x37')]['id']}})[_0x3d6f('0x11')](handleEntityNotFound(_0x44bb3c,null))[_0x3d6f('0x11')](saveUpdates(_0x42edad['body'],null))['then'](function(_0x29c32b){if(!_0x29c32b)return;var _0x543988=_0x29c32b['get']({'plain':!![]});return _0x543988;})[_0x3d6f('0x11')](function(_0x21e482){var _0x50464f=new Redis(config['redis']);_0x50464f[_0x3d6f('0x16')](_0x3d6f('0x17'),JSON[_0x3d6f('0x18')](_['pick'](_0x21e482,['id',_0x3d6f('0x1c'),_0x3d6f('0x42')])));return _0x21e482;})[_0x3d6f('0x11')](respondWithResult(_0x44bb3c,null))['catch'](handleError(_0x44bb3c,null));};exports[_0x3d6f('0x15')]=function(_0x2e71b6,_0x5cce65){return db[_0x3d6f('0x1f')][_0x3d6f('0x39')]({'where':{'id':_0x2e71b6[_0x3d6f('0x37')]['id']}})[_0x3d6f('0x11')](handleEntityNotFound(_0x5cce65,null))[_0x3d6f('0x11')](removeEntity(_0x5cce65,null))[_0x3d6f('0x36')](handleError(_0x5cce65,null));}; \ No newline at end of file +var _0xbb17=['where','pick','merge','map','SquareProject','include','catch','show','params','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','production','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','json','offset','limit','undefined','count','Content-Range','then','get','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x1c94bd,_0x474057){var _0x3744ca=function(_0xd9bbc2){while(--_0xd9bbc2){_0x1c94bd['push'](_0x1c94bd['shift']());}};_0x3744ca(++_0x474057);}(_0xbb17,0x176));var _0x7bb1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xbb17[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7bb1('0x0'));var Redis=require('ioredis');var qs=require(_0x7bb1('0x1'));var logger=require(_0x7bb1('0x2'))(_0x7bb1('0x3'));var config=require(_0x7bb1('0x4'));var db=require(_0x7bb1('0x5'))['db'];config[_0x7bb1('0x6')]=_[_0x7bb1('0x7')](config[_0x7bb1('0x6')],{'host':_0x7bb1('0x8'),'port':0x18eb});var socket=require(_0x7bb1('0x9'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithResult(_0x186eb7,_0x22bf6e){_0x22bf6e=_0x22bf6e||0xc8;return function(_0x3a4b0f){if(_0x3a4b0f){return _0x186eb7[_0x7bb1('0xa')](_0x22bf6e)[_0x7bb1('0xb')](_0x3a4b0f);}};}function respondWithFilteredResult(_0x1ea6aa,_0x1b6a50){return function(_0x192b95){if(_0x192b95){var _0x4bc8c5=typeof _0x1b6a50[_0x7bb1('0xc')]==='undefined'&&typeof _0x1b6a50[_0x7bb1('0xd')]===_0x7bb1('0xe');var _0x5582f0=_0x192b95[_0x7bb1('0xf')];var _0x802eff=_0x4bc8c5?0x0:_0x1b6a50['offset'];var _0xc9fb3d=_0x4bc8c5?_0x192b95[_0x7bb1('0xf')]:_0x1b6a50[_0x7bb1('0xc')]+_0x1b6a50[_0x7bb1('0xd')];var _0x7d306a;if(_0xc9fb3d>=_0x5582f0){_0xc9fb3d=_0x5582f0;_0x7d306a=0xc8;}else{_0x7d306a=0xce;}_0x1ea6aa[_0x7bb1('0xa')](_0x7d306a);return _0x1ea6aa['set'](_0x7bb1('0x10'),_0x802eff+'-'+_0xc9fb3d+'/'+_0x5582f0)['json'](_0x192b95);}return null;};}function saveUpdates(_0x1bdc94){return function(_0x25e8ad){if(_0x25e8ad){return _0x25e8ad['update'](_0x1bdc94)[_0x7bb1('0x11')](function(_0x4eebc3){return _0x4eebc3;});}return null;};}function removeEntity(_0x4bf69e){return function(_0x2d0a2b){if(_0x2d0a2b){return _0x2d0a2b['destroy']()[_0x7bb1('0x11')](function(){var _0x9e701=_0x2d0a2b[_0x7bb1('0x12')]({'plain':!![]});var _0x2f8af8=_0x7bb1('0x13');return db[_0x7bb1('0x14')][_0x7bb1('0x15')]({'where':{'type':_0x2f8af8,'resourceId':_0x9e701['id']}})['then'](function(){return _0x2d0a2b;});})[_0x7bb1('0x11')](function(){var _0x168b5c=new Redis(config[_0x7bb1('0x6')]);_0x168b5c[_0x7bb1('0x16')](_0x7bb1('0x17'),JSON[_0x7bb1('0x18')]({'id':_0x2d0a2b['id'],'deleted':!![]}));})[_0x7bb1('0x11')](function(){_0x4bf69e[_0x7bb1('0xa')](0xcc)[_0x7bb1('0x19')]();});}};}function handleEntityNotFound(_0x40535d){return function(_0xf48dde){if(!_0xf48dde){_0x40535d[_0x7bb1('0x1a')](0x194);}return _0xf48dde;};}function handleError(_0x6f5a22,_0x45e5d7){_0x45e5d7=_0x45e5d7||0x1f4;return function(_0x151344){logger[_0x7bb1('0x1b')](_0x151344[_0x7bb1('0x1c')]);if(_0x151344[_0x7bb1('0x1d')]){delete _0x151344[_0x7bb1('0x1d')];}_0x6f5a22[_0x7bb1('0xa')](_0x45e5d7)[_0x7bb1('0x1e')](_0x151344);};}exports[_0x7bb1('0x1f')]=function(_0x1191d1,_0x3708ed){var _0x4ca8bc={},_0x2be3d4={},_0x596a28={'count':0x0,'rows':[]};var _0x5c500c=_['map'](db['SquareProject'][_0x7bb1('0x20')],function(_0x49a145){return{'name':_0x49a145[_0x7bb1('0x21')],'type':_0x49a145[_0x7bb1('0x22')][_0x7bb1('0x23')]};});_0x2be3d4['model']=_['map'](_0x5c500c,_0x7bb1('0x1d'));_0x2be3d4['query']=_['keys'](_0x1191d1[_0x7bb1('0x24')]);_0x2be3d4[_0x7bb1('0x25')]=_[_0x7bb1('0x26')](_0x2be3d4[_0x7bb1('0x27')],_0x2be3d4[_0x7bb1('0x24')]);_0x4ca8bc['attributes']=_['intersection'](_0x2be3d4['model'],qs[_0x7bb1('0x28')](_0x1191d1[_0x7bb1('0x24')][_0x7bb1('0x28')]));_0x4ca8bc[_0x7bb1('0x29')]=_0x4ca8bc[_0x7bb1('0x29')][_0x7bb1('0x2a')]?_0x4ca8bc[_0x7bb1('0x29')]:_0x2be3d4[_0x7bb1('0x27')];if(!_0x1191d1['query'][_0x7bb1('0x2b')](_0x7bb1('0x2c'))){_0x4ca8bc[_0x7bb1('0xd')]=qs['limit'](_0x1191d1[_0x7bb1('0x24')][_0x7bb1('0xd')]);_0x4ca8bc[_0x7bb1('0xc')]=qs[_0x7bb1('0xc')](_0x1191d1['query'][_0x7bb1('0xc')]);}_0x4ca8bc['order']=qs['sort'](_0x1191d1[_0x7bb1('0x24')][_0x7bb1('0x2d')]);_0x4ca8bc[_0x7bb1('0x2e')]=qs[_0x7bb1('0x25')](_[_0x7bb1('0x2f')](_0x1191d1[_0x7bb1('0x24')],_0x2be3d4[_0x7bb1('0x25')]),_0x5c500c);if(_0x1191d1[_0x7bb1('0x24')]['filter']){_0x4ca8bc[_0x7bb1('0x2e')]=_[_0x7bb1('0x30')](_0x4ca8bc['where'],{'$or':_[_0x7bb1('0x31')](_0x5c500c,function(_0x483837){if(_0x483837[_0x7bb1('0x22')]!=='VIRTUAL'){var _0x4ffbac={};_0x4ffbac[_0x483837[_0x7bb1('0x1d')]]={'$like':'%'+_0x1191d1[_0x7bb1('0x24')]['filter']+'%'};return _0x4ffbac;}})});}_0x4ca8bc=_[_0x7bb1('0x30')]({},_0x4ca8bc,_0x1191d1['options']);var _0x5a8f3b={'where':_0x4ca8bc['where']};return db[_0x7bb1('0x32')][_0x7bb1('0xf')](_0x5a8f3b)[_0x7bb1('0x11')](function(_0x12761c){_0x596a28['count']=_0x12761c;if(_0x1191d1[_0x7bb1('0x24')]['includeAll']){_0x4ca8bc[_0x7bb1('0x33')]=[{'all':!![]}];}return db[_0x7bb1('0x32')]['findAll'](_0x4ca8bc);})[_0x7bb1('0x11')](function(_0x4cc396){_0x596a28['rows']=_0x4cc396;return _0x596a28;})[_0x7bb1('0x11')](respondWithFilteredResult(_0x3708ed,_0x4ca8bc))[_0x7bb1('0x34')](handleError(_0x3708ed,null));};exports[_0x7bb1('0x35')]=function(_0x3024ed,_0x13e9db){var _0x10803c={'raw':![],'where':{'id':_0x3024ed[_0x7bb1('0x36')]['id']}},_0x4c7e24={};_0x4c7e24[_0x7bb1('0x27')]=_['keys'](db[_0x7bb1('0x32')][_0x7bb1('0x20')]);_0x4c7e24[_0x7bb1('0x24')]=_[_0x7bb1('0x37')](_0x3024ed[_0x7bb1('0x24')]);_0x4c7e24[_0x7bb1('0x25')]=_[_0x7bb1('0x26')](_0x4c7e24[_0x7bb1('0x27')],_0x4c7e24[_0x7bb1('0x24')]);_0x10803c[_0x7bb1('0x29')]=_[_0x7bb1('0x26')](_0x4c7e24['model'],qs['fields'](_0x3024ed[_0x7bb1('0x24')][_0x7bb1('0x28')]));_0x10803c[_0x7bb1('0x29')]=_0x10803c[_0x7bb1('0x29')][_0x7bb1('0x2a')]?_0x10803c[_0x7bb1('0x29')]:_0x4c7e24[_0x7bb1('0x27')];if(_0x3024ed[_0x7bb1('0x24')][_0x7bb1('0x38')]){_0x10803c[_0x7bb1('0x33')]=[{'all':!![]}];}_0x10803c=_['merge']({},_0x10803c,_0x3024ed[_0x7bb1('0x39')]);return db[_0x7bb1('0x32')][_0x7bb1('0x3a')](_0x10803c)[_0x7bb1('0x11')](handleEntityNotFound(_0x13e9db,null))[_0x7bb1('0x11')](respondWithResult(_0x13e9db,null))[_0x7bb1('0x34')](handleError(_0x13e9db,null));};exports[_0x7bb1('0x3b')]=function(_0x106a2d,_0x3a00f4){return db[_0x7bb1('0x32')][_0x7bb1('0x3b')](_0x106a2d[_0x7bb1('0x3c')],{})[_0x7bb1('0x11')](function(_0x3ad260){var _0x4af3f5=_0x106a2d['user'][_0x7bb1('0x12')]({'plain':!![]});if(!_0x4af3f5)throw new Error(_0x7bb1('0x3d'));if(_0x4af3f5[_0x7bb1('0x3e')]===_0x7bb1('0x3f')){var _0x501c40=_0x3ad260[_0x7bb1('0x12')]({'plain':!![]});var _0x1aaac6=_0x7bb1('0x13');return db[_0x7bb1('0x40')][_0x7bb1('0x3a')]({'where':{'name':_0x1aaac6,'userProfileId':_0x4af3f5[_0x7bb1('0x41')]},'raw':!![]})[_0x7bb1('0x11')](function(_0x2f6be5){if(_0x2f6be5&&_0x2f6be5[_0x7bb1('0x42')]===0x0){return db[_0x7bb1('0x14')][_0x7bb1('0x3b')]({'name':_0x501c40['name'],'resourceId':_0x501c40['id'],'type':_0x2f6be5[_0x7bb1('0x1d')],'sectionId':_0x2f6be5['id']},{})['then'](function(){return _0x3ad260;});}else{return _0x3ad260;}})[_0x7bb1('0x34')](function(_0x104cbc){logger[_0x7bb1('0x1b')](_0x7bb1('0x43'),_0x104cbc);throw _0x104cbc;});}return _0x3ad260;})[_0x7bb1('0x11')](respondWithResult(_0x3a00f4,0xc9))[_0x7bb1('0x34')](handleError(_0x3a00f4,null));};exports[_0x7bb1('0x44')]=function(_0x35f296,_0x3f4a47){if(_0x35f296[_0x7bb1('0x3c')]['id']){delete _0x35f296[_0x7bb1('0x3c')]['id'];}return db[_0x7bb1('0x32')][_0x7bb1('0x3a')]({'where':{'id':_0x35f296[_0x7bb1('0x36')]['id']}})[_0x7bb1('0x11')](handleEntityNotFound(_0x3f4a47,null))['then'](saveUpdates(_0x35f296[_0x7bb1('0x3c')],null))['then'](function(_0xbefa0b){if(!_0xbefa0b)return;var _0x1fffe6=_0xbefa0b[_0x7bb1('0x12')]({'plain':!![]});return _0x1fffe6;})[_0x7bb1('0x11')](function(_0x5740f5){var _0x353788=new Redis(config[_0x7bb1('0x6')]);_0x353788[_0x7bb1('0x16')](_0x7bb1('0x17'),JSON['stringify'](_[_0x7bb1('0x2f')](_0x5740f5,['id','name',_0x7bb1('0x45')])));return _0x5740f5;})[_0x7bb1('0x11')](respondWithResult(_0x3f4a47,null))['catch'](handleError(_0x3f4a47,null));};exports['destroy']=function(_0x436fe9,_0x1d1b54){return db[_0x7bb1('0x32')]['find']({'where':{'id':_0x436fe9[_0x7bb1('0x36')]['id']}})[_0x7bb1('0x11')](handleEntityNotFound(_0x1d1b54,null))['then'](removeEntity(_0x1d1b54,null))[_0x7bb1('0x34')](handleError(_0x1d1b54,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 2d27b9b..b6005f2 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 _0x0e83=['hasOwnProperty','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x49cd89,_0x2ecaef){var _0x2d4ec9=function(_0x4623e1){while(--_0x4623e1){_0x49cd89['push'](_0x49cd89['shift']());}};_0x2d4ec9(++_0x2ecaef);}(_0x0e83,0x132));var _0x30e8=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x0e83[_0x35885a];return _0xe86249;};'use strict';var EventEmitter=require(_0x30e8('0x0'));var SquareProject=require(_0x30e8('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x30e8('0x2'),'afterUpdate':_0x30e8('0x3'),'afterDestroy':_0x30e8('0x4')};function emitEvent(_0x5d66ed){return function(_0x2c7018,_0x5c98da,_0x5ef85c){SquareProjectEvents[_0x30e8('0x5')](_0x5d66ed+':'+_0x2c7018['id'],_0x2c7018);SquareProjectEvents['emit'](_0x5d66ed,_0x2c7018);_0x5ef85c(null);};}for(var e in events){if(events[_0x30e8('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x30e8('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x1b38=['hook','exports','events','../../mysqldb','save','remove','emit'];(function(_0x39d89b,_0x413243){var _0x477b21=function(_0x5ea8bf){while(--_0x5ea8bf){_0x39d89b['push'](_0x39d89b['shift']());}};_0x477b21(++_0x413243);}(_0x1b38,0xd4));var _0x81b3=function(_0x2356e6,_0x130b1f){_0x2356e6=_0x2356e6-0x0;var _0x31094e=_0x1b38[_0x2356e6];return _0x31094e;};'use strict';var EventEmitter=require(_0x81b3('0x0'));var SquareProject=require(_0x81b3('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x81b3('0x2'),'afterUpdate':'update','afterDestroy':_0x81b3('0x3')};function emitEvent(_0x36c947){return function(_0x2984c8,_0x3ea254,_0x50f439){SquareProjectEvents[_0x81b3('0x4')](_0x36c947+':'+_0x2984c8['id'],_0x2984c8);SquareProjectEvents['emit'](_0x36c947,_0x2984c8);_0x50f439(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x81b3('0x5')](e,emitEvent(event));}}module[_0x81b3('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 7e52340..6787b70 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 _0xf2c3=['api','moment','bluebird','path','rimraf','exports','define','SquareProject','square_projects','preproduction','savedAt','format','changed','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf2c3,0x1ae));var _0x3f2c=function(_0xf1d023,_0x1f4051){_0xf1d023=_0xf1d023-0x0;var _0x1ab530=_0xf2c3[_0xf1d023];return _0x1ab530;};'use strict';var _=require('lodash');var util=require(_0x3f2c('0x0'));var logger=require(_0x3f2c('0x1'))(_0x3f2c('0x2'));var moment=require(_0x3f2c('0x3'));var BPromise=require(_0x3f2c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f2c('0x5'));var rimraf=require(_0x3f2c('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x3f2c('0x7')]=function(_0x538979,_0x3cfbc0){return _0x538979[_0x3f2c('0x8')](_0x3f2c('0x9'),attributes,{'tableName':_0x3f2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x594d92,_0x28e6ed,_0xe97b5f){if(_0x594d92['changed'](_0x3f2c('0xb'))){_0x594d92[_0x3f2c('0xc')]=moment()[_0x3f2c('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x594d92[_0x3f2c('0xe')](_0x3f2c('0xf'))){_0x594d92[_0x3f2c('0x10')]=moment()['format'](_0x3f2c('0x11'));}_0xe97b5f(null,_0x594d92);}}});}; \ No newline at end of file +var _0x96b1=['bluebird','request-promise','path','exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api'];(function(_0x10be19,_0x363045){var _0x3ced5f=function(_0xbf888c){while(--_0xbf888c){_0x10be19['push'](_0x10be19['shift']());}};_0x3ced5f(++_0x363045);}(_0x96b1,0xbd));var _0x196b=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0x96b1[_0x3d38ae];return _0x3757ee;};'use strict';var _=require(_0x196b('0x0'));var util=require(_0x196b('0x1'));var logger=require('../../config/logger')(_0x196b('0x2'));var moment=require('moment');var BPromise=require(_0x196b('0x3'));var rp=require(_0x196b('0x4'));var fs=require('fs');var path=require(_0x196b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x196b('0x6')]=function(_0x4b3ee0,_0x7c5354){return _0x4b3ee0[_0x196b('0x7')](_0x196b('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x165337,_0x793c8c,_0x2df6a1){if(_0x165337[_0x196b('0x9')](_0x196b('0xa'))){_0x165337[_0x196b('0xb')]=moment()[_0x196b('0xc')](_0x196b('0xd'));}if(_0x165337[_0x196b('0x9')](_0x196b('0xe'))){_0x165337[_0x196b('0xf')]=moment()[_0x196b('0xc')](_0x196b('0xd'));}_0x2df6a1(null,_0x165337);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 009a662..8f4158a 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 _0x00ef=['limit','include','map','model','then','info','debug','stringify','error','message','ShowSquareProject','SquareProject','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','options','where','attributes'];(function(_0x520937,_0x973680){var _0x39ff07=function(_0x817ce8){while(--_0x817ce8){_0x520937['push'](_0x520937['shift']());}};_0x39ff07(++_0x973680);}(_0x00ef,0x1c0));var _0xf00e=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x00ef[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xf00e('0x0'));var Redis=require(_0xf00e('0x1'));var db=require(_0xf00e('0x2'))['db'];var logger=require(_0xf00e('0x3'))(_0xf00e('0x4'));var config=require(_0xf00e('0x5'));config[_0xf00e('0x6')]=_[_0xf00e('0x7')](config[_0xf00e('0x6')],{'host':_0xf00e('0x8'),'port':0x18eb});var socket=require(_0xf00e('0x9'))(new Redis(config[_0xf00e('0x6')]));require(_0xf00e('0xa'))[_0xf00e('0xb')](socket);exports[_0xf00e('0xc')]=function(_0x151104){var _0x4c812d=this;return new Promise(function(_0x268865,_0x4a3978){return db['SquareProject']['findAll']({'raw':_0x151104[_0xf00e('0xd')]?_0x151104['options']['raw']===undefined?!![]:![]:!![],'where':_0x151104['options']?_0x151104[_0xf00e('0xd')][_0xf00e('0xe')]||null:null,'attributes':_0x151104['options']?_0x151104[_0xf00e('0xd')][_0xf00e('0xf')]||null:null,'limit':_0x151104[_0xf00e('0xd')]?_0x151104[_0xf00e('0xd')][_0xf00e('0x10')]||null:null,'include':_0x151104[_0xf00e('0xd')]?_0x151104[_0xf00e('0xd')][_0xf00e('0x11')]?_[_0xf00e('0x12')](_0x151104[_0xf00e('0xd')][_0xf00e('0x11')],function(_0x5d9f47){return{'model':db[_0x5d9f47['model']],'as':_0x5d9f47['as'],'attributes':_0x5d9f47['attributes'],'include':_0x5d9f47[_0xf00e('0x11')]?_['map'](_0x5d9f47['include'],function(_0x5464b2){return{'model':db[_0x5464b2[_0xf00e('0x13')]],'as':_0x5464b2['as'],'attributes':_0x5464b2[_0xf00e('0xf')],'include':_0x5464b2[_0xf00e('0x11')]?_[_0xf00e('0x12')](_0x5464b2[_0xf00e('0x11')],function(_0x3ccee9){return{'model':db[_0x3ccee9[_0xf00e('0x13')]],'as':_0x3ccee9['as'],'attributes':_0x3ccee9[_0xf00e('0xf')]};}):[]};}):[]};}):[]:[]})[_0xf00e('0x14')](function(_0xe2a3a){logger[_0xf00e('0x15')](_0xf00e('0xc'),_0x151104);logger[_0xf00e('0x16')](_0xf00e('0xc'),_0x151104,JSON[_0xf00e('0x17')](_0xe2a3a));_0x268865(_0xe2a3a);})['catch'](function(_0x5541c1){logger[_0xf00e('0x18')](_0xf00e('0xc'),_0x5541c1['message'],_0x151104);_0x4a3978(_0x4c812d['error'](0x1f4,_0x5541c1[_0xf00e('0x19')]));});});};exports[_0xf00e('0x1a')]=function(_0x6ebb25){var _0x44f6e8=this;return new Promise(function(_0x4662b5,_0x55ef47){return db[_0xf00e('0x1b')]['find']({'raw':_0x6ebb25[_0xf00e('0xd')]?_0x6ebb25[_0xf00e('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x6ebb25[_0xf00e('0xd')]?_0x6ebb25[_0xf00e('0xd')][_0xf00e('0xe')]||null:null,'attributes':_0x6ebb25[_0xf00e('0xd')]?_0x6ebb25[_0xf00e('0xd')][_0xf00e('0xf')]||null:null,'include':_0x6ebb25['options']?_0x6ebb25[_0xf00e('0xd')]['include']?_[_0xf00e('0x12')](_0x6ebb25[_0xf00e('0xd')][_0xf00e('0x11')],function(_0x260144){return{'model':db[_0x260144['model']],'as':_0x260144['as'],'attributes':_0x260144['attributes'],'include':_0x260144[_0xf00e('0x11')]?_[_0xf00e('0x12')](_0x260144[_0xf00e('0x11')],function(_0x3639f2){return{'model':db[_0x3639f2[_0xf00e('0x13')]],'as':_0x3639f2['as'],'attributes':_0x3639f2[_0xf00e('0xf')],'include':_0x3639f2[_0xf00e('0x11')]?_[_0xf00e('0x12')](_0x3639f2[_0xf00e('0x11')],function(_0x431738){return{'model':db[_0x431738[_0xf00e('0x13')]],'as':_0x431738['as'],'attributes':_0x431738[_0xf00e('0xf')]};}):[]};}):[]};}):[]:[]})[_0xf00e('0x14')](function(_0x345bb3){logger[_0xf00e('0x15')](_0xf00e('0x1a'),_0x6ebb25);logger[_0xf00e('0x16')](_0xf00e('0x1a'),_0x6ebb25,JSON[_0xf00e('0x17')](_0x345bb3));_0x4662b5(_0x345bb3);})[_0xf00e('0x1c')](function(_0x2e62e1){logger['error'](_0xf00e('0x1a'),_0x2e62e1[_0xf00e('0x19')],_0x6ebb25);_0x55ef47(_0x44f6e8['error'](0x1f4,_0x2e62e1[_0xf00e('0x19')]));});});}; \ No newline at end of file +var _0x6e0a=['defaults','localhost','./squareProject.socket','register','GetSquareProjects','findAll','options','attributes','limit','map','model','include','then','info','debug','stringify','catch','error','message','SquareProject','find','raw','where','ShowSquareProject','ioredis','../../mysqldb','redis'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x6e0a,0x1c8));var _0xa6e0=function(_0x32e33c,_0x2c4cf7){_0x32e33c=_0x32e33c-0x0;var _0x1805a2=_0x6e0a[_0x32e33c];return _0x1805a2;};'use strict';var _=require('lodash');var Redis=require(_0xa6e0('0x0'));var db=require(_0xa6e0('0x1'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');config[_0xa6e0('0x2')]=_[_0xa6e0('0x3')](config[_0xa6e0('0x2')],{'host':_0xa6e0('0x4'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6e0('0x2')]));require(_0xa6e0('0x5'))[_0xa6e0('0x6')](socket);exports[_0xa6e0('0x7')]=function(_0x4a3089){var _0x1de8f7=this;return new Promise(function(_0x49b887,_0x2a026e){return db['SquareProject'][_0xa6e0('0x8')]({'raw':_0x4a3089[_0xa6e0('0x9')]?_0x4a3089[_0xa6e0('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4a3089[_0xa6e0('0x9')]?_0x4a3089[_0xa6e0('0x9')]['where']||null:null,'attributes':_0x4a3089['options']?_0x4a3089[_0xa6e0('0x9')][_0xa6e0('0xa')]||null:null,'limit':_0x4a3089[_0xa6e0('0x9')]?_0x4a3089[_0xa6e0('0x9')][_0xa6e0('0xb')]||null:null,'include':_0x4a3089['options']?_0x4a3089[_0xa6e0('0x9')]['include']?_[_0xa6e0('0xc')](_0x4a3089[_0xa6e0('0x9')]['include'],function(_0x2b0a94){return{'model':db[_0x2b0a94[_0xa6e0('0xd')]],'as':_0x2b0a94['as'],'attributes':_0x2b0a94[_0xa6e0('0xa')],'include':_0x2b0a94['include']?_[_0xa6e0('0xc')](_0x2b0a94['include'],function(_0x2ec28e){return{'model':db[_0x2ec28e[_0xa6e0('0xd')]],'as':_0x2ec28e['as'],'attributes':_0x2ec28e[_0xa6e0('0xa')],'include':_0x2ec28e['include']?_['map'](_0x2ec28e[_0xa6e0('0xe')],function(_0x1b46fb){return{'model':db[_0x1b46fb[_0xa6e0('0xd')]],'as':_0x1b46fb['as'],'attributes':_0x1b46fb[_0xa6e0('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa6e0('0xf')](function(_0x12f79c){logger[_0xa6e0('0x10')](_0xa6e0('0x7'),_0x4a3089);logger[_0xa6e0('0x11')]('GetSquareProjects',_0x4a3089,JSON[_0xa6e0('0x12')](_0x12f79c));_0x49b887(_0x12f79c);})[_0xa6e0('0x13')](function(_0x410c50){logger[_0xa6e0('0x14')](_0xa6e0('0x7'),_0x410c50[_0xa6e0('0x15')],_0x4a3089);_0x2a026e(_0x1de8f7[_0xa6e0('0x14')](0x1f4,_0x410c50['message']));});});};exports['ShowSquareProject']=function(_0x214d43){var _0x29f544=this;return new Promise(function(_0x46a96d,_0x5a7110){return db[_0xa6e0('0x16')][_0xa6e0('0x17')]({'raw':_0x214d43['options']?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0x18')]===undefined?!![]:![]:!![],'where':_0x214d43[_0xa6e0('0x9')]?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0x19')]||null:null,'attributes':_0x214d43['options']?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0xa')]||null:null,'include':_0x214d43[_0xa6e0('0x9')]?_0x214d43[_0xa6e0('0x9')][_0xa6e0('0xe')]?_[_0xa6e0('0xc')](_0x214d43[_0xa6e0('0x9')][_0xa6e0('0xe')],function(_0x56c642){return{'model':db[_0x56c642[_0xa6e0('0xd')]],'as':_0x56c642['as'],'attributes':_0x56c642[_0xa6e0('0xa')],'include':_0x56c642[_0xa6e0('0xe')]?_[_0xa6e0('0xc')](_0x56c642[_0xa6e0('0xe')],function(_0x22aa03){return{'model':db[_0x22aa03['model']],'as':_0x22aa03['as'],'attributes':_0x22aa03[_0xa6e0('0xa')],'include':_0x22aa03['include']?_[_0xa6e0('0xc')](_0x22aa03[_0xa6e0('0xe')],function(_0x56e73c){return{'model':db[_0x56e73c[_0xa6e0('0xd')]],'as':_0x56e73c['as'],'attributes':_0x56e73c[_0xa6e0('0xa')]};}):[]};}):[]};}):[]:[]})[_0xa6e0('0xf')](function(_0x442c77){logger[_0xa6e0('0x10')](_0xa6e0('0x1a'),_0x214d43);logger[_0xa6e0('0x11')](_0xa6e0('0x1a'),_0x214d43,JSON[_0xa6e0('0x12')](_0x442c77));_0x46a96d(_0x442c77);})[_0xa6e0('0x13')](function(_0x416d57){logger[_0xa6e0('0x14')](_0xa6e0('0x1a'),_0x416d57[_0xa6e0('0x15')],_0x214d43);_0x5a7110(_0x29f544[_0xa6e0('0x14')](0x1f4,_0x416d57[_0xa6e0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index ac5bfe9..f6ac51f 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 _0x13b2=['remove','removeListener','register','length','./squareProject.events'];(function(_0x12dfbe,_0x308c90){var _0xfde192=function(_0x1da89b){while(--_0x1da89b){_0x12dfbe['push'](_0x12dfbe['shift']());}};_0xfde192(++_0x308c90);}(_0x13b2,0x112));var _0x213b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13b2[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0x213b('0x0'));var events=['save',_0x213b('0x1'),'update'];function createListener(_0x5775e9,_0x4816c4){return function(_0xe86845){_0x4816c4['emit'](_0x5775e9,_0xe86845);};}function removeListener(_0x38382a,_0x5f44df){return function(){SquareProjectEvents[_0x213b('0x2')](_0x38382a,_0x5f44df);};}exports[_0x213b('0x3')]=function(_0x35e09c){for(var _0xa9f04f=0x0,_0x2071eb=events[_0x213b('0x4')];_0xa9f04f<_0x2071eb;_0xa9f04f++){var _0x34d876=events[_0xa9f04f];var _0x3d39c=createListener('squareProject:'+_0x34d876,_0x35e09c);SquareProjectEvents['on'](_0x34d876,_0x3d39c);}}; \ No newline at end of file +var _0x402b=['emit','removeListener','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x114bf0,_0x29f2f1){var _0x53e038=function(_0x2fb664){while(--_0x2fb664){_0x114bf0['push'](_0x114bf0['shift']());}};_0x53e038(++_0x29f2f1);}(_0x402b,0xd4));var _0xb402=function(_0xd38d53,_0x17d20e){_0xd38d53=_0xd38d53-0x0;var _0x2ceeda=_0x402b[_0xd38d53];return _0x2ceeda;};'use strict';var SquareProjectEvents=require(_0xb402('0x0'));var events=[_0xb402('0x1'),_0xb402('0x2'),_0xb402('0x3')];function createListener(_0x357263,_0x3cfdf0){return function(_0x7ec299){_0x3cfdf0[_0xb402('0x4')](_0x357263,_0x7ec299);};}function removeListener(_0x2d3b1a,_0x440603){return function(){SquareProjectEvents[_0xb402('0x5')](_0x2d3b1a,_0x440603);};}exports['register']=function(_0x21a7f2){for(var _0x4066c4=0x0,_0x27d4ce=events[_0xb402('0x6')];_0x4066c4<_0x27d4ce;_0x4066c4++){var _0x59490d=events[_0x4066c4];var _0xeae811=createListener(_0xb402('0x7')+_0x59490d,_0x21a7f2);SquareProjectEvents['on'](_0x59490d,_0xeae811);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 89549f4..d51c39d 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(_0x243d52,_0x2d5634){var _0xbbf923=function(_0x1a9466){while(--_0x1a9466){_0x243d52['push'](_0x243d52['shift']());}};_0xbbf923(++_0x2d5634);}(_0x4975,0x86));var _0x5497=function(_0x2938e8,_0x56d74d){_0x2938e8=_0x2938e8-0x0;var _0x8f0fe6=_0x4975[_0x2938e8];return _0x8f0fe6;};'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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0xc1b0fc,_0x1265b3){var _0x55c682=function(_0x163ea3){while(--_0x163ea3){_0xc1b0fc['push'](_0xc1b0fc['shift']());}};_0x55c682(++_0x1265b3);}(_0x7a54,0x106));var _0x47a5=function(_0x2a5c65,_0x5ea07d){_0x2a5c65=_0x2a5c65-0x0;var _0x5dc615=_0x7a54[_0x2a5c65];return _0x5dc615;};'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('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 96bd064..e11fa50 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 _0x207c=['savePath','substring','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3ffd01,_0x2a8e2d){var _0x567b04=function(_0x30879e){while(--_0x30879e){_0x3ffd01['push'](_0x3ffd01['shift']());}};_0x567b04(++_0x2a8e2d);}(_0x207c,0x1e8));var _0xc207=function(_0x565d0a,_0x4927cc){_0x565d0a=_0x565d0a-0x0;var _0x24c211=_0x207c[_0x565d0a];return _0x24c211;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'uniqueid':{'type':Sequelize[_0xc207('0x1')]},'callerid':{'type':Sequelize[_0xc207('0x1')]},'calleridname':{'type':Sequelize[_0xc207('0x1')]},'context':{'type':Sequelize[_0xc207('0x1')]},'extension':{'type':Sequelize[_0xc207('0x1')]},'priority':{'type':Sequelize[_0xc207('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc207('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xc207('0x1')]},'format':{'type':Sequelize[_0xc207('0x2')],'get':function(){var _0x3395e4='';var _0x59ff6f=this[_0xc207('0x3')](_0xc207('0x4'));if(_0x59ff6f){_0x3395e4=_0x59ff6f[_0xc207('0x5')](_0x59ff6f['lastIndexOf']('.'));}return _0x3395e4;}}}; \ No newline at end of file +var _0x1cb9=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x4d941d,_0x24c568){var _0x4a7778=function(_0x13d938){while(--_0x13d938){_0x4d941d['push'](_0x4d941d['shift']());}};_0x4a7778(++_0x24c568);}(_0x1cb9,0x14e));var _0x91cb=function(_0x59f1a4,_0x372644){_0x59f1a4=_0x59f1a4-0x0;var _0x443009=_0x1cb9[_0x59f1a4];return _0x443009;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x91cb('0x1')]},'callerid':{'type':Sequelize[_0x91cb('0x1')]},'calleridname':{'type':Sequelize[_0x91cb('0x1')]},'context':{'type':Sequelize[_0x91cb('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x91cb('0x1')]},'accountcode':{'type':Sequelize[_0x91cb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x91cb('0x1')]},'saveName':{'type':Sequelize[_0x91cb('0x1')]},'filename':{'type':Sequelize[_0x91cb('0x1')]},'savePath':{'type':Sequelize[_0x91cb('0x1')]},'format':{'type':Sequelize[_0x91cb('0x2')],'get':function(){var _0x8f8a3b='';var _0x4c1f56=this[_0x91cb('0x3')]('savePath');if(_0x4c1f56){_0x8f8a3b=_0x4c1f56[_0x91cb('0x4')](_0x4c1f56['lastIndexOf']('.'));}return _0x8f8a3b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 99844b9..b79d7e3 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 _0x2605=['unlink','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','download','../../components/encryptor','uniqueid','savePath','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname'];(function(_0xdc4a2a,_0x244593){var _0x54eaa7=function(_0x3a50eb){while(--_0x3a50eb){_0xdc4a2a['push'](_0xdc4a2a['shift']());}};_0x54eaa7(++_0x244593);}(_0x2605,0xc8));var _0x5260=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x2605[_0x5a7e3c];return _0x59252b;};'use strict';var emlformat=require(_0x5260('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5260('0x1'));var jsonpatch=require(_0x5260('0x2'));var rp=require(_0x5260('0x3'));var moment=require(_0x5260('0x4'));var BPromise=require(_0x5260('0x5'));var Mustache=require(_0x5260('0x6'));var util=require(_0x5260('0x7'));var path=require(_0x5260('0x8'));var sox=require(_0x5260('0x9'));var csv=require(_0x5260('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5260('0xb'));var _=require(_0x5260('0xc'));var squel=require(_0x5260('0xd'));var crypto=require(_0x5260('0xe'));var jsforce=require(_0x5260('0xf'));var deskjs=require(_0x5260('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5260('0x11'));var Papa=require('papaparse');var Redis=require(_0x5260('0x12'));var authService=require(_0x5260('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5260('0x14'));var logger=require('../../config/logger')(_0x5260('0x15'));var utils=require(_0x5260('0x16'));var config=require(_0x5260('0x17'));var licenseUtil=require(_0x5260('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4053d7,_0x1ed364){_0x1ed364=_0x1ed364||0xcc;return function(_0x54ab2a){if(_0x54ab2a){return _0x4053d7[_0x5260('0x19')](_0x1ed364);}return _0x4053d7[_0x5260('0x1a')](_0x1ed364)[_0x5260('0x1b')]();};}function respondWithResult(_0x3490e5,_0x3d4b91){_0x3d4b91=_0x3d4b91||0xc8;return function(_0x5bce12){if(_0x5bce12){return _0x3490e5[_0x5260('0x1a')](_0x3d4b91)[_0x5260('0x1c')](_0x5bce12);}};}function respondWithFilteredResult(_0x481cf2,_0xcb1e01){return function(_0x55b872){if(_0x55b872){var _0x3d1688=typeof _0xcb1e01[_0x5260('0x1d')]===_0x5260('0x1e')&&typeof _0xcb1e01[_0x5260('0x1f')]==='undefined';var _0x35fb3d=_0x55b872[_0x5260('0x20')];var _0x1d8b4=_0x3d1688?0x0:_0xcb1e01[_0x5260('0x1d')];var _0x23ea39=_0x3d1688?_0x55b872[_0x5260('0x20')]:_0xcb1e01[_0x5260('0x1d')]+_0xcb1e01[_0x5260('0x1f')];var _0x5d32d2;if(_0x23ea39>=_0x35fb3d){_0x23ea39=_0x35fb3d;_0x5d32d2=0xc8;}else{_0x5d32d2=0xce;}_0x481cf2[_0x5260('0x1a')](_0x5d32d2);return _0x481cf2['set']('Content-Range',_0x1d8b4+'-'+_0x23ea39+'/'+_0x35fb3d)[_0x5260('0x1c')](_0x55b872);}return null;};}function patchUpdates(_0x15240e){return function(_0x143de8){try{jsonpatch[_0x5260('0x21')](_0x143de8,_0x15240e,!![]);}catch(_0x185173){return BPromise['reject'](_0x185173);}return _0x143de8[_0x5260('0x22')]();};}function saveUpdates(_0x2dfa9f,_0x59392d){return function(_0x2ed448){if(_0x2ed448){return _0x2ed448[_0x5260('0x23')](_0x2dfa9f)[_0x5260('0x24')](function(_0x51b771){return _0x51b771;});}return null;};}function removeEntity(_0x56a5e8,_0x8378c9){return function(_0x41bf54){if(_0x41bf54){return _0x41bf54['destroy']()[_0x5260('0x24')](function(){_0x56a5e8[_0x5260('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18adc6,_0x3888c5){return function(_0x59dc47){if(!_0x59dc47){_0x18adc6['sendStatus'](0x194);}return _0x59dc47;};}function handleError(_0x4fac75,_0x2e0c2a){_0x2e0c2a=_0x2e0c2a||0x1f4;return function(_0x17cca1){logger[_0x5260('0x25')](_0x17cca1['stack']);if(_0x17cca1[_0x5260('0x26')]){delete _0x17cca1[_0x5260('0x26')];}_0x4fac75[_0x5260('0x1a')](_0x2e0c2a)[_0x5260('0x27')](_0x17cca1);};}exports[_0x5260('0x28')]=function(_0x15b16d,_0x2cc382){var _0x2cc6f0={},_0x2f6843={},_0x2be8b2={'count':0x0,'rows':[]};var _0x2fc0c6=_[_0x5260('0x29')](db[_0x5260('0x2a')][_0x5260('0x2b')],function(_0x5796c2){return{'name':_0x5796c2[_0x5260('0x2c')],'type':_0x5796c2[_0x5260('0x2d')][_0x5260('0x2e')]};});_0x2f6843[_0x5260('0x2f')]=_[_0x5260('0x29')](_0x2fc0c6,_0x5260('0x26'));_0x2f6843[_0x5260('0x30')]=_['keys'](_0x15b16d['query']);_0x2f6843['filters']=_[_0x5260('0x31')](_0x2f6843[_0x5260('0x2f')],_0x2f6843[_0x5260('0x30')]);_0x2cc6f0[_0x5260('0x32')]=_[_0x5260('0x31')](_0x2f6843[_0x5260('0x2f')],qs[_0x5260('0x33')](_0x15b16d[_0x5260('0x30')][_0x5260('0x33')]));_0x2cc6f0[_0x5260('0x32')]=_0x2cc6f0['attributes'][_0x5260('0x34')]?_0x2cc6f0[_0x5260('0x32')]:_0x2f6843['model'];if(!_0x15b16d[_0x5260('0x30')][_0x5260('0x35')](_0x5260('0x36'))){_0x2cc6f0['limit']=qs[_0x5260('0x1f')](_0x15b16d[_0x5260('0x30')]['limit']);_0x2cc6f0[_0x5260('0x1d')]=qs['offset'](_0x15b16d['query'][_0x5260('0x1d')]);}_0x2cc6f0[_0x5260('0x37')]=qs[_0x5260('0x38')](_0x15b16d['query']['sort']);_0x2cc6f0[_0x5260('0x39')]=qs[_0x5260('0x3a')](_[_0x5260('0x3b')](_0x15b16d['query'],_0x2f6843[_0x5260('0x3a')]),_0x2fc0c6);if(_0x15b16d[_0x5260('0x30')][_0x5260('0x3c')]){_0x2cc6f0[_0x5260('0x39')]=_[_0x5260('0x3d')](_0x2cc6f0[_0x5260('0x39')],{'$or':_[_0x5260('0x29')](_0x2fc0c6,function(_0x38848a){if(_0x38848a[_0x5260('0x2d')]!==_0x5260('0x3e')){var _0x28f8c3={};_0x28f8c3[_0x38848a[_0x5260('0x26')]]={'$like':'%'+_0x15b16d['query'][_0x5260('0x3c')]+'%'};return _0x28f8c3;}})});}_0x2cc6f0=_[_0x5260('0x3d')]({},_0x2cc6f0,_0x15b16d[_0x5260('0x3f')]);var _0x4a7747={'where':_0x2cc6f0[_0x5260('0x39')]};return db[_0x5260('0x2a')][_0x5260('0x20')](_0x4a7747)[_0x5260('0x24')](function(_0x55d625){_0x2be8b2[_0x5260('0x20')]=_0x55d625;if(_0x15b16d['query'][_0x5260('0x40')]){_0x2cc6f0[_0x5260('0x41')]=[{'all':!![]}];}return db[_0x5260('0x2a')][_0x5260('0x42')](_0x2cc6f0);})['then'](function(_0x1dde24){_0x2be8b2[_0x5260('0x43')]=_0x1dde24;return _0x2be8b2;})[_0x5260('0x24')](respondWithFilteredResult(_0x2cc382,_0x2cc6f0))[_0x5260('0x44')](handleError(_0x2cc382,null));};exports[_0x5260('0x45')]=function(_0x14c352,_0x572fce){var _0x5b35bd={'raw':!![],'where':{'id':_0x14c352[_0x5260('0x46')]['id']}},_0xde3182={};_0xde3182['model']=_[_0x5260('0x47')](db[_0x5260('0x2a')]['rawAttributes']);_0xde3182[_0x5260('0x30')]=_['keys'](_0x14c352[_0x5260('0x30')]);_0xde3182[_0x5260('0x3a')]=_['intersection'](_0xde3182[_0x5260('0x2f')],_0xde3182[_0x5260('0x30')]);_0x5b35bd['attributes']=_[_0x5260('0x31')](_0xde3182[_0x5260('0x2f')],qs[_0x5260('0x33')](_0x14c352[_0x5260('0x30')][_0x5260('0x33')]));_0x5b35bd[_0x5260('0x32')]=_0x5b35bd[_0x5260('0x32')][_0x5260('0x34')]?_0x5b35bd[_0x5260('0x32')]:_0xde3182[_0x5260('0x2f')];if(_0x14c352['query'][_0x5260('0x40')]){_0x5b35bd[_0x5260('0x41')]=[{'all':!![]}];}_0x5b35bd=_[_0x5260('0x3d')]({},_0x5b35bd,_0x14c352[_0x5260('0x3f')]);return db[_0x5260('0x2a')][_0x5260('0x48')](_0x5b35bd)[_0x5260('0x24')](handleEntityNotFound(_0x572fce,null))[_0x5260('0x24')](respondWithResult(_0x572fce,null))[_0x5260('0x44')](handleError(_0x572fce,null));};exports['create']=function(_0x51b7c5,_0xe6e46b){return db[_0x5260('0x2a')][_0x5260('0x49')](_0x51b7c5[_0x5260('0x4a')],{})[_0x5260('0x24')](respondWithResult(_0xe6e46b,0xc9))['catch'](handleError(_0xe6e46b,null));};exports[_0x5260('0x23')]=function(_0x13f74b,_0x5d5323){if(_0x13f74b[_0x5260('0x4a')]['id']){delete _0x13f74b[_0x5260('0x4a')]['id'];}return db[_0x5260('0x2a')]['find']({'where':{'id':_0x13f74b[_0x5260('0x46')]['id']}})[_0x5260('0x24')](handleEntityNotFound(_0x5d5323,null))[_0x5260('0x24')](saveUpdates(_0x13f74b['body'],null))['then'](respondWithResult(_0x5d5323,null))['catch'](handleError(_0x5d5323,null));};exports[_0x5260('0x4b')]=function(_0x38b2f9,_0x374f41,_0x2fcb1b){var _0x2b6ae4=require(_0x5260('0x4c'));var _0x32980=![];var _0x18861d={};if(_0x38b2f9[_0x5260('0x30')][_0x5260('0x2d')]&&_0x38b2f9[_0x5260('0x30')]['type']===_0x5260('0x4d')){_0x18861d['uniqueid']=_0x38b2f9['params']['id'];}else{_0x18861d['id']=_0x38b2f9[_0x5260('0x46')]['id'];}return db[_0x5260('0x2a')][_0x5260('0x48')]({'where':_0x18861d,'attributes':['id','savePath','filename'],'raw':!![]})['then'](handleEntityNotFound(_0x374f41,null))[_0x5260('0x24')](function(_0x2302f2){if(_0x2302f2){var _0x58821e=_0x2302f2[_0x5260('0x4e')];var _0x5d8662=util['format']('%s.cypher',_0x58821e);if(fs[_0x5260('0x4f')](_0x5d8662)){_0x32980=!![];return _0x2b6ae4[_0x5260('0x50')](_0x5d8662,_0x58821e,config[_0x5260('0x51')][_0x5260('0x52')])[_0x5260('0x24')](function(){return _0x2302f2;});}return _0x2302f2;}})[_0x5260('0x24')](function(_0x362486){if(_0x362486){var _0x23a73d=_0x362486[_0x5260('0x4e')];if(!fs[_0x5260('0x4f')](_0x23a73d)){throw new db[(_0x5260('0x53'))][(_0x5260('0x54'))](_0x5260('0x55'));}if(_0x362486['filename']){return _0x374f41[_0x5260('0x4b')](_0x23a73d,_0x362486[_0x5260('0x56')]+path[_0x5260('0x57')](_0x23a73d),function(){if(_0x32980){fs[_0x5260('0x58')](_0x23a73d);}});}else{return _0x374f41[_0x5260('0x4b')](_0x23a73d,function(_0x2e50aa){if(_0x32980){fs[_0x5260('0x58')](_0x23a73d);}});}}})[_0x5260('0x44')](function(_0x438300){if(_0x438300['message']===_0x5260('0x55')){_0x374f41[_0x5260('0x1a')](0x194)[_0x5260('0x27')]('Not\x20found');}else{return handleError(_0x374f41,null);}});};exports['destroy']=function(_0xb4e470,_0x535491){return db[_0x5260('0x2a')][_0x5260('0x48')]({'where':{'id':_0xb4e470[_0x5260('0x46')]['id']}})[_0x5260('0x24')](function(_0x35867a){if(_[_0x5260('0x59')](_0x35867a)){throw new ReferenceError(_0x5260('0x5a'));}return _0x35867a;})['then'](function(_0x4ffcdb){var _0x56dc13=_0x4ffcdb[_0x5260('0x4e')];logger[_0x5260('0x5b')]('cancellazione\x20fisica\x20documento\x20%s',_0x56dc13);if(!_[_0x5260('0x59')](_0x4ffcdb[_0x5260('0x4e')])&&fs[_0x5260('0x4f')](_0x56dc13)){logger[_0x5260('0x5b')](_0x5260('0x5c')+_0x56dc13+_0x5260('0x5d'));fs['unlinkSync'](_0x56dc13);}_0x56dc13=_0x56dc13+_0x5260('0x5e');if(!_[_0x5260('0x59')](_0x4ffcdb['savePath'])&&fs[_0x5260('0x4f')](_0x56dc13)){logger[_0x5260('0x5b')]('File:\x20\x22'+_0x56dc13+_0x5260('0x5d'));fs[_0x5260('0x5f')](_0x56dc13);}return _0x4ffcdb;})['then'](function(_0x2523e1){if(!_0x2523e1)throw new InternalError();return _0x2523e1['destroy']();})[_0x5260('0x24')](function(){_0x535491['status'](0xcc)[_0x5260('0x1b')]();})[_0x5260('0x44')](handleError(_0x535491,null));}; \ No newline at end of file +var _0x7263=['SquareRecording','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','map','type','includeAll','include','findAll','rows','catch','params','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','index'];(function(_0x24a7c9,_0x157c78){var _0x451a81=function(_0x4bdc76){while(--_0x4bdc76){_0x24a7c9['push'](_0x24a7c9['shift']());}};_0x451a81(++_0x157c78);}(_0x7263,0x93));var _0x3726=function(_0x4c74b0,_0x5bdd7f){_0x4c74b0=_0x4c74b0-0x0;var _0x681540=_0x7263[_0x4c74b0];return _0x681540;};'use strict';var emlformat=require(_0x3726('0x0'));var rimraf=require(_0x3726('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3726('0x2'));var rp=require(_0x3726('0x3'));var moment=require('moment');var BPromise=require(_0x3726('0x4'));var Mustache=require(_0x3726('0x5'));var util=require(_0x3726('0x6'));var path=require(_0x3726('0x7'));var sox=require(_0x3726('0x8'));var csv=require(_0x3726('0x9'));var ejs=require(_0x3726('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3726('0xb'));var squel=require(_0x3726('0xc'));var crypto=require(_0x3726('0xd'));var jsforce=require(_0x3726('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3726('0x9'));var querystring=require(_0x3726('0xf'));var Papa=require(_0x3726('0x10'));var Redis=require(_0x3726('0x11'));var authService=require(_0x3726('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3726('0x13'));var hardwareService=require(_0x3726('0x14'));var logger=require(_0x3726('0x15'))(_0x3726('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3726('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fe7a7,_0x3534f7){_0x3534f7=_0x3534f7||0xcc;return function(_0x2d2a8e){if(_0x2d2a8e){return _0x2fe7a7[_0x3726('0x18')](_0x3534f7);}return _0x2fe7a7[_0x3726('0x19')](_0x3534f7)['end']();};}function respondWithResult(_0x46fda4,_0x565d21){_0x565d21=_0x565d21||0xc8;return function(_0x1fa642){if(_0x1fa642){return _0x46fda4[_0x3726('0x19')](_0x565d21)['json'](_0x1fa642);}};}function respondWithFilteredResult(_0xea15be,_0x408331){return function(_0x337380){if(_0x337380){var _0x5f4a48=typeof _0x408331[_0x3726('0x1a')]==='undefined'&&typeof _0x408331['limit']===_0x3726('0x1b');var _0x29563f=_0x337380[_0x3726('0x1c')];var _0x47e0d6=_0x5f4a48?0x0:_0x408331[_0x3726('0x1a')];var _0x187a5d=_0x5f4a48?_0x337380[_0x3726('0x1c')]:_0x408331[_0x3726('0x1a')]+_0x408331[_0x3726('0x1d')];var _0x121426;if(_0x187a5d>=_0x29563f){_0x187a5d=_0x29563f;_0x121426=0xc8;}else{_0x121426=0xce;}_0xea15be[_0x3726('0x19')](_0x121426);return _0xea15be[_0x3726('0x1e')](_0x3726('0x1f'),_0x47e0d6+'-'+_0x187a5d+'/'+_0x29563f)[_0x3726('0x20')](_0x337380);}return null;};}function patchUpdates(_0x5cb1eb){return function(_0x25cdfe){try{jsonpatch[_0x3726('0x21')](_0x25cdfe,_0x5cb1eb,!![]);}catch(_0x411b78){return BPromise[_0x3726('0x22')](_0x411b78);}return _0x25cdfe[_0x3726('0x23')]();};}function saveUpdates(_0x100020,_0x53dd5f){return function(_0x5b56e0){if(_0x5b56e0){return _0x5b56e0[_0x3726('0x24')](_0x100020)[_0x3726('0x25')](function(_0x1bf963){return _0x1bf963;});}return null;};}function removeEntity(_0x3f5a86,_0x2e1876){return function(_0x1220b4){if(_0x1220b4){return _0x1220b4[_0x3726('0x26')]()[_0x3726('0x25')](function(){_0x3f5a86[_0x3726('0x19')](0xcc)[_0x3726('0x27')]();});}};}function handleEntityNotFound(_0x1c946f,_0x4cbf48){return function(_0x17cb4d){if(!_0x17cb4d){_0x1c946f[_0x3726('0x18')](0x194);}return _0x17cb4d;};}function handleError(_0xc68aba,_0x1f4481){_0x1f4481=_0x1f4481||0x1f4;return function(_0x4a4d7d){logger[_0x3726('0x28')](_0x4a4d7d['stack']);if(_0x4a4d7d[_0x3726('0x29')]){delete _0x4a4d7d[_0x3726('0x29')];}_0xc68aba[_0x3726('0x19')](_0x1f4481)['send'](_0x4a4d7d);};}exports[_0x3726('0x2a')]=function(_0x6c1530,_0x4fea09){var _0x241fd5={},_0x459632={},_0x31d4d9={'count':0x0,'rows':[]};var _0x3178ed=_['map'](db[_0x3726('0x2b')][_0x3726('0x2c')],function(_0x18c84b){return{'name':_0x18c84b['fieldName'],'type':_0x18c84b['type'][_0x3726('0x2d')]};});_0x459632[_0x3726('0x2e')]=_['map'](_0x3178ed,_0x3726('0x29'));_0x459632[_0x3726('0x2f')]=_[_0x3726('0x30')](_0x6c1530['query']);_0x459632[_0x3726('0x31')]=_[_0x3726('0x32')](_0x459632[_0x3726('0x2e')],_0x459632[_0x3726('0x2f')]);_0x241fd5[_0x3726('0x33')]=_[_0x3726('0x32')](_0x459632[_0x3726('0x2e')],qs[_0x3726('0x34')](_0x6c1530[_0x3726('0x2f')][_0x3726('0x34')]));_0x241fd5[_0x3726('0x33')]=_0x241fd5[_0x3726('0x33')][_0x3726('0x35')]?_0x241fd5['attributes']:_0x459632[_0x3726('0x2e')];if(!_0x6c1530[_0x3726('0x2f')]['hasOwnProperty'](_0x3726('0x36'))){_0x241fd5[_0x3726('0x1d')]=qs['limit'](_0x6c1530[_0x3726('0x2f')][_0x3726('0x1d')]);_0x241fd5[_0x3726('0x1a')]=qs[_0x3726('0x1a')](_0x6c1530[_0x3726('0x2f')][_0x3726('0x1a')]);}_0x241fd5[_0x3726('0x37')]=qs['sort'](_0x6c1530[_0x3726('0x2f')]['sort']);_0x241fd5[_0x3726('0x38')]=qs[_0x3726('0x31')](_[_0x3726('0x39')](_0x6c1530[_0x3726('0x2f')],_0x459632[_0x3726('0x31')]),_0x3178ed);if(_0x6c1530['query'][_0x3726('0x3a')]){_0x241fd5[_0x3726('0x38')]=_[_0x3726('0x3b')](_0x241fd5[_0x3726('0x38')],{'$or':_[_0x3726('0x3c')](_0x3178ed,function(_0x33d273){if(_0x33d273[_0x3726('0x3d')]!=='VIRTUAL'){var _0x238d24={};_0x238d24[_0x33d273[_0x3726('0x29')]]={'$like':'%'+_0x6c1530['query']['filter']+'%'};return _0x238d24;}})});}_0x241fd5=_[_0x3726('0x3b')]({},_0x241fd5,_0x6c1530['options']);var _0x381c1f={'where':_0x241fd5[_0x3726('0x38')]};return db['SquareRecording']['count'](_0x381c1f)[_0x3726('0x25')](function(_0x4adee3){_0x31d4d9['count']=_0x4adee3;if(_0x6c1530[_0x3726('0x2f')][_0x3726('0x3e')]){_0x241fd5[_0x3726('0x3f')]=[{'all':!![]}];}return db[_0x3726('0x2b')][_0x3726('0x40')](_0x241fd5);})[_0x3726('0x25')](function(_0x36df9a){_0x31d4d9[_0x3726('0x41')]=_0x36df9a;return _0x31d4d9;})['then'](respondWithFilteredResult(_0x4fea09,_0x241fd5))[_0x3726('0x42')](handleError(_0x4fea09,null));};exports['show']=function(_0x3ce1d2,_0x3e1142){var _0x534639={'raw':!![],'where':{'id':_0x3ce1d2[_0x3726('0x43')]['id']}},_0x5c8e94={};_0x5c8e94[_0x3726('0x2e')]=_[_0x3726('0x30')](db['SquareRecording']['rawAttributes']);_0x5c8e94[_0x3726('0x2f')]=_[_0x3726('0x30')](_0x3ce1d2[_0x3726('0x2f')]);_0x5c8e94['filters']=_[_0x3726('0x32')](_0x5c8e94[_0x3726('0x2e')],_0x5c8e94[_0x3726('0x2f')]);_0x534639[_0x3726('0x33')]=_[_0x3726('0x32')](_0x5c8e94[_0x3726('0x2e')],qs[_0x3726('0x34')](_0x3ce1d2[_0x3726('0x2f')][_0x3726('0x34')]));_0x534639['attributes']=_0x534639[_0x3726('0x33')][_0x3726('0x35')]?_0x534639[_0x3726('0x33')]:_0x5c8e94['model'];if(_0x3ce1d2['query'][_0x3726('0x3e')]){_0x534639['include']=[{'all':!![]}];}_0x534639=_[_0x3726('0x3b')]({},_0x534639,_0x3ce1d2[_0x3726('0x44')]);return db['SquareRecording'][_0x3726('0x45')](_0x534639)[_0x3726('0x25')](handleEntityNotFound(_0x3e1142,null))[_0x3726('0x25')](respondWithResult(_0x3e1142,null))[_0x3726('0x42')](handleError(_0x3e1142,null));};exports[_0x3726('0x46')]=function(_0x34c2f4,_0x54ddec){return db[_0x3726('0x2b')][_0x3726('0x46')](_0x34c2f4[_0x3726('0x47')],{})[_0x3726('0x25')](respondWithResult(_0x54ddec,0xc9))['catch'](handleError(_0x54ddec,null));};exports[_0x3726('0x24')]=function(_0x625700,_0x15461){if(_0x625700[_0x3726('0x47')]['id']){delete _0x625700[_0x3726('0x47')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x625700['params']['id']}})[_0x3726('0x25')](handleEntityNotFound(_0x15461,null))[_0x3726('0x25')](saveUpdates(_0x625700['body'],null))[_0x3726('0x25')](respondWithResult(_0x15461,null))[_0x3726('0x42')](handleError(_0x15461,null));};exports[_0x3726('0x48')]=function(_0x33db68,_0x199c97,_0x1d9cab){var _0x25fc83=require(_0x3726('0x49'));var _0x5a67d7=![];var _0x4b29a1={};if(_0x33db68[_0x3726('0x2f')]['type']&&_0x33db68['query'][_0x3726('0x3d')]===_0x3726('0x4a')){_0x4b29a1[_0x3726('0x4a')]=_0x33db68[_0x3726('0x43')]['id'];}else{_0x4b29a1['id']=_0x33db68[_0x3726('0x43')]['id'];}return db[_0x3726('0x2b')][_0x3726('0x45')]({'where':_0x4b29a1,'attributes':['id',_0x3726('0x4b'),'filename'],'raw':!![]})[_0x3726('0x25')](handleEntityNotFound(_0x199c97,null))['then'](function(_0x2bb61f){if(_0x2bb61f){var _0x136fdb=_0x2bb61f[_0x3726('0x4b')];var _0x2f0c69=util['format'](_0x3726('0x4c'),_0x136fdb);if(fs['existsSync'](_0x2f0c69)){_0x5a67d7=!![];return _0x25fc83[_0x3726('0x4d')](_0x2f0c69,_0x136fdb,config['secrets'][_0x3726('0x4e')])[_0x3726('0x25')](function(){return _0x2bb61f;});}return _0x2bb61f;}})['then'](function(_0x1614e8){if(_0x1614e8){var _0x375a9c=_0x1614e8[_0x3726('0x4b')];if(!fs[_0x3726('0x4f')](_0x375a9c)){throw new db[(_0x3726('0x50'))][(_0x3726('0x51'))](_0x3726('0x52'));}if(_0x1614e8[_0x3726('0x53')]){return _0x199c97['download'](_0x375a9c,_0x1614e8['filename']+path['extname'](_0x375a9c),function(){if(_0x5a67d7){fs[_0x3726('0x54')](_0x375a9c);}});}else{return _0x199c97[_0x3726('0x48')](_0x375a9c,function(_0x2365a3){if(_0x5a67d7){fs[_0x3726('0x54')](_0x375a9c);}});}}})[_0x3726('0x42')](function(_0x59e10c){if(_0x59e10c['message']===_0x3726('0x52')){_0x199c97['status'](0x194)[_0x3726('0x55')](_0x3726('0x56'));}else{return handleError(_0x199c97,null);}});};exports['destroy']=function(_0x25cb6f,_0x5945c7){return db['SquareRecording'][_0x3726('0x45')]({'where':{'id':_0x25cb6f[_0x3726('0x43')]['id']}})[_0x3726('0x25')](function(_0x1b6fc3){if(_[_0x3726('0x57')](_0x1b6fc3)){throw new ReferenceError(_0x3726('0x58'));}return _0x1b6fc3;})[_0x3726('0x25')](function(_0x36f835){var _0xc46e2b=_0x36f835['savePath'];logger[_0x3726('0x59')](_0x3726('0x5a'),_0xc46e2b);if(!_[_0x3726('0x57')](_0x36f835['savePath'])&&fs[_0x3726('0x4f')](_0xc46e2b)){logger[_0x3726('0x59')](_0x3726('0x5b')+_0xc46e2b+_0x3726('0x5c'));fs[_0x3726('0x5d')](_0xc46e2b);}_0xc46e2b=_0xc46e2b+_0x3726('0x5e');if(!_[_0x3726('0x57')](_0x36f835[_0x3726('0x4b')])&&fs[_0x3726('0x4f')](_0xc46e2b)){logger[_0x3726('0x59')]('File:\x20\x22'+_0xc46e2b+_0x3726('0x5c'));fs[_0x3726('0x5d')](_0xc46e2b);}return _0x36f835;})['then'](function(_0x999587){if(!_0x999587)throw new InternalError();return _0x999587[_0x3726('0x26')]();})[_0x3726('0x25')](function(){_0x5945c7[_0x3726('0x19')](0xcc)[_0x3726('0x27')]();})[_0x3726('0x42')](handleError(_0x5945c7,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index efebbce..8b12f56 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 _0xbb8d=['define','SquareRecording','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x50918a,_0x3883b8){var _0x4a9430=function(_0x17562d){while(--_0x17562d){_0x50918a['push'](_0x50918a['shift']());}};_0x4a9430(++_0x3883b8);}(_0xbb8d,0x146));var _0xdbb8=function(_0x584788,_0x566a1c){_0x584788=_0x584788-0x0;var _0x54d7ee=_0xbb8d[_0x584788];return _0x54d7ee;};'use strict';var _=require(_0xdbb8('0x0'));var util=require('util');var logger=require(_0xdbb8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdbb8('0x2'));var fs=require('fs');var path=require(_0xdbb8('0x3'));var rimraf=require(_0xdbb8('0x4'));var config=require(_0xdbb8('0x5'));var attributes=require(_0xdbb8('0x6'));module['exports']=function(_0x6a6db3,_0x149c99){return _0x6a6db3[_0xdbb8('0x7')](_0xdbb8('0x8'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fcd=['moment','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','lodash','util','../../config/logger','api'];(function(_0x2487cb,_0x3c3231){var _0x12a831=function(_0x20c596){while(--_0x20c596){_0x2487cb['push'](_0x2487cb['shift']());}};_0x12a831(++_0x3c3231);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x1e40e9,_0x16cc7a){_0x1e40e9=_0x1e40e9-0x0;var _0x3d3cbc=_0x8fcd[_0x1e40e9];return _0x3d3cbc;};'use strict';var _=require(_0xd8fc('0x0'));var util=require(_0xd8fc('0x1'));var logger=require(_0xd8fc('0x2'))(_0xd8fc('0x3'));var moment=require(_0xd8fc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8fc('0x5'));var rimraf=require(_0xd8fc('0x6'));var config=require(_0xd8fc('0x7'));var attributes=require(_0xd8fc('0x8'));module[_0xd8fc('0x9')]=function(_0x127911,_0x5d9c8e){return _0x127911['define'](_0xd8fc('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 3e87bcf..bb44d01 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 _0xb3c2=['SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','catch'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xb3c2,0xd1));var _0x2b3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb3c2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2b3c('0x0'));var util=require(_0x2b3c('0x1'));var moment=require(_0x2b3c('0x2'));var BPromise=require(_0x2b3c('0x3'));var rs=require(_0x2b3c('0x4'));var fs=require('fs');var Redis=require(_0x2b3c('0x5'));var db=require(_0x2b3c('0x6'))['db'];var utils=require(_0x2b3c('0x7'));var logger=require(_0x2b3c('0x8'))('rpc');var config=require(_0x2b3c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2b3c('0xa')][_0x2b3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x434b40,_0x27f0ef,_0x3ad19d){return new BPromise(function(_0x4939dc,_0x62c9f5){return client['request'](_0x434b40,_0x3ad19d)[_0x2b3c('0xc')](function(_0x4e69e8){logger[_0x2b3c('0xd')]('SquareRecording,\x20%s,\x20%s',_0x27f0ef,_0x2b3c('0xe'));logger[_0x2b3c('0xf')](_0x2b3c('0x10'),_0x27f0ef,_0x2b3c('0xe'),JSON[_0x2b3c('0x11')](_0x4e69e8));if(_0x4e69e8[_0x2b3c('0x12')]){if(_0x4e69e8[_0x2b3c('0x12')]['code']===0x1f4){logger[_0x2b3c('0x12')](_0x2b3c('0x13'),_0x27f0ef,_0x4e69e8['error'][_0x2b3c('0x14')]);return _0x62c9f5(_0x4e69e8[_0x2b3c('0x12')][_0x2b3c('0x14')]);}logger['error'](_0x2b3c('0x13'),_0x27f0ef,_0x4e69e8[_0x2b3c('0x12')][_0x2b3c('0x14')]);return _0x4939dc(_0x4e69e8[_0x2b3c('0x12')][_0x2b3c('0x14')]);}else{logger['info'](_0x2b3c('0x13'),_0x27f0ef,_0x2b3c('0xe'));_0x4939dc(_0x4e69e8[_0x2b3c('0x15')][_0x2b3c('0x14')]);}})[_0x2b3c('0x16')](function(_0x3371be){logger[_0x2b3c('0x12')](_0x2b3c('0x13'),_0x27f0ef,_0x3371be);_0x62c9f5(_0x3371be);});});}exports['CreateSquareRecording']=function(_0x303e08){var _0x3e1a70=this;return new Promise(function(_0x55af75,_0x148870){return db[_0x2b3c('0x17')][_0x2b3c('0x18')](_0x303e08[_0x2b3c('0x19')],{'raw':_0x303e08[_0x2b3c('0x1a')]?_0x303e08[_0x2b3c('0x1a')][_0x2b3c('0x1b')]===undefined?!![]:![]:!![]})[_0x2b3c('0xc')](function(_0x254d23){logger[_0x2b3c('0xd')](_0x2b3c('0x1c'),_0x303e08);logger['debug'](_0x2b3c('0x1c'),_0x303e08,JSON[_0x2b3c('0x11')](_0x254d23));_0x55af75(_0x254d23);})['catch'](function(_0x268fa9){logger[_0x2b3c('0x12')](_0x2b3c('0x1c'),_0x268fa9[_0x2b3c('0x14')],_0x303e08);_0x148870(_0x3e1a70[_0x2b3c('0x12')](0x1f4,_0x268fa9['message']));});});}; \ No newline at end of file +var _0xf4d9=['options','raw','then','CreateSquareRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','message','catch','SquareRecording','body'];(function(_0x5f6d3d,_0x5b6c3f){var _0x1d4252=function(_0x19603e){while(--_0x19603e){_0x5f6d3d['push'](_0x5f6d3d['shift']());}};_0x1d4252(++_0x5b6c3f);}(_0xf4d9,0xc1));var _0x9f4d=function(_0x193281,_0x5cd64f){_0x193281=_0x193281-0x0;var _0x575553=_0xf4d9[_0x193281];return _0x575553;};'use strict';var _=require(_0x9f4d('0x0'));var util=require(_0x9f4d('0x1'));var moment=require(_0x9f4d('0x2'));var BPromise=require(_0x9f4d('0x3'));var rs=require(_0x9f4d('0x4'));var fs=require('fs');var Redis=require(_0x9f4d('0x5'));var db=require(_0x9f4d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f4d('0x7'))(_0x9f4d('0x8'));var config=require(_0x9f4d('0x9'));var jayson=require(_0x9f4d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6f56,_0x3c8a15,_0x1ad440){return new BPromise(function(_0x1ae6fc,_0x467256){return client[_0x9f4d('0xb')](_0x4c6f56,_0x1ad440)['then'](function(_0x488c91){logger[_0x9f4d('0xc')](_0x9f4d('0xd'),_0x3c8a15,_0x9f4d('0xe'));logger[_0x9f4d('0xf')](_0x9f4d('0x10'),_0x3c8a15,_0x9f4d('0xe'),JSON['stringify'](_0x488c91));if(_0x488c91[_0x9f4d('0x11')]){if(_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x12')]===0x1f4){logger[_0x9f4d('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x13')]);return _0x467256(_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x13')]);}logger[_0x9f4d('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x488c91[_0x9f4d('0x11')][_0x9f4d('0x13')]);return _0x1ae6fc(_0x488c91['error']['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x9f4d('0xe'));_0x1ae6fc(_0x488c91['result']['message']);}})[_0x9f4d('0x14')](function(_0x4f5aaf){logger[_0x9f4d('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3c8a15,_0x4f5aaf);_0x467256(_0x4f5aaf);});});}exports['CreateSquareRecording']=function(_0x2f7b7d){var _0x87caa0=this;return new Promise(function(_0x257178,_0x583758){return db[_0x9f4d('0x15')]['create'](_0x2f7b7d[_0x9f4d('0x16')],{'raw':_0x2f7b7d[_0x9f4d('0x17')]?_0x2f7b7d['options'][_0x9f4d('0x18')]===undefined?!![]:![]:!![]})[_0x9f4d('0x19')](function(_0x50c3c8){logger[_0x9f4d('0xc')](_0x9f4d('0x1a'),_0x2f7b7d);logger[_0x9f4d('0xf')](_0x9f4d('0x1a'),_0x2f7b7d,JSON['stringify'](_0x50c3c8));_0x257178(_0x50c3c8);})[_0x9f4d('0x14')](function(_0xd16967){logger[_0x9f4d('0x11')](_0x9f4d('0x1a'),_0xd16967[_0x9f4d('0x13')],_0x2f7b7d);_0x583758(_0x87caa0['error'](0x1f4,_0xd16967['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 4077027..b253a3e 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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xdd62a4,_0x598c99){var _0x4b48bb=function(_0x59efae){while(--_0x59efae){_0xdd62a4['push'](_0xdd62a4['shift']());}};_0x4b48bb(++_0x598c99);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0xbd2347,_0x21809a){var _0x2b1212=function(_0x2fc2cd){while(--_0x2fc2cd){_0xbd2347['push'](_0xbd2347['shift']());}};_0x2b1212(++_0x21809a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 30a406f..63d8518 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 _0x04e4=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x2668d4,_0x2bbebc){var _0x341317=function(_0x1ad445){while(--_0x1ad445){_0x2668d4['push'](_0x2668d4['shift']());}};_0x341317(++_0x2bbebc);}(_0x04e4,0x17d));var _0x404e=function(_0x290c7c,_0x33c9d6){_0x290c7c=_0x290c7c-0x0;var _0x461316=_0x04e4[_0x290c7c];return _0x461316;};'use strict';var Sequelize=require(_0x404e('0x0'));module[_0x404e('0x1')]={'network':{'type':Sequelize[_0x404e('0x2')]},'network_script':{'type':Sequelize[_0x404e('0x2')]},'request':{'type':Sequelize[_0x404e('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x404e('0x2')]},'type':{'type':Sequelize[_0x404e('0x2')]},'uniqueid':{'type':Sequelize[_0x404e('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x404e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x404e('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x404e('0x2')]},'callingtns':{'type':Sequelize[_0x404e('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x404e('0x2')]},'context':{'type':Sequelize[_0x404e('0x2')]},'extension':{'type':Sequelize[_0x404e('0x2')]},'priority':{'type':Sequelize[_0x404e('0x2')]},'enhanced':{'type':Sequelize[_0x404e('0x2')]},'accountcode':{'type':Sequelize[_0x404e('0x2')]},'threadid':{'type':Sequelize[_0x404e('0x2')]},'project_name':{'type':Sequelize[_0x404e('0x2')]},'joinAt':{'type':Sequelize[_0x404e('0x3')]},'leaveAt':{'type':Sequelize[_0x404e('0x3')]},'bot':{'type':Sequelize[_0x404e('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xce60=['DATE','BOOLEAN','sequelize','STRING'];(function(_0x137077,_0x575634){var _0x18a2b3=function(_0x576c4d){while(--_0x576c4d){_0x137077['push'](_0x137077['shift']());}};_0x18a2b3(++_0x575634);}(_0xce60,0xca));var _0x0ce6=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0xce60[_0x3050ca];return _0x1eed1d;};'use strict';var Sequelize=require(_0x0ce6('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0ce6('0x1')]},'channel':{'type':Sequelize[_0x0ce6('0x1')]},'language':{'type':Sequelize[_0x0ce6('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0ce6('0x1')]},'version':{'type':Sequelize[_0x0ce6('0x1')]},'callerid':{'type':Sequelize[_0x0ce6('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x0ce6('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x0ce6('0x1')]},'callingtns':{'type':Sequelize[_0x0ce6('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x0ce6('0x1')]},'context':{'type':Sequelize[_0x0ce6('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0ce6('0x1')]},'enhanced':{'type':Sequelize[_0x0ce6('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0ce6('0x1')]},'project_name':{'type':Sequelize[_0x0ce6('0x1')]},'joinAt':{'type':Sequelize[_0x0ce6('0x2')]},'leaveAt':{'type':Sequelize[_0x0ce6('0x2')]},'bot':{'type':Sequelize[_0x0ce6('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index f71a640..ed8c993 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 _0xc120=['type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','VIRTUAL','options','where','findAll','catch','params','length','includeAll','include','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName'];(function(_0x5e1864,_0x2a0dc3){var _0x29e801=function(_0x50e09a){while(--_0x50e09a){_0x5e1864['push'](_0x5e1864['shift']());}};_0x29e801(++_0x2a0dc3);}(_0xc120,0x140));var _0x0c12=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xc120[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x0c12('0x0'));var rimraf=require(_0x0c12('0x1'));var zipdir=require(_0x0c12('0x2'));var jsonpatch=require(_0x0c12('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c12('0x4'));var Mustache=require(_0x0c12('0x5'));var util=require(_0x0c12('0x6'));var path=require(_0x0c12('0x7'));var sox=require(_0x0c12('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c12('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c12('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c12('0xb'));var querystring=require(_0x0c12('0xc'));var Papa=require(_0x0c12('0xd'));var Redis=require(_0x0c12('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0c12('0xf'));var as=require(_0x0c12('0x10'));var hardwareService=require(_0x0c12('0x11'));var logger=require(_0x0c12('0x12'))('api');var utils=require(_0x0c12('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c12('0x14'));var db=require(_0x0c12('0x15'))['db'];function respondWithStatusCode(_0x4ce662,_0x4f81b4){_0x4f81b4=_0x4f81b4||0xcc;return function(_0x37dddd){if(_0x37dddd){return _0x4ce662[_0x0c12('0x16')](_0x4f81b4);}return _0x4ce662[_0x0c12('0x17')](_0x4f81b4)[_0x0c12('0x18')]();};}function respondWithResult(_0x4d5f8c,_0x2a9d5){_0x2a9d5=_0x2a9d5||0xc8;return function(_0x3834d1){if(_0x3834d1){return _0x4d5f8c[_0x0c12('0x17')](_0x2a9d5)[_0x0c12('0x19')](_0x3834d1);}};}function respondWithFilteredResult(_0x5c6c96,_0x480e01){return function(_0x5885b4){if(_0x5885b4){var _0x290d5e=typeof _0x480e01[_0x0c12('0x1a')]===_0x0c12('0x1b')&&typeof _0x480e01[_0x0c12('0x1c')]===_0x0c12('0x1b');var _0x2e167d=_0x5885b4[_0x0c12('0x1d')];var _0x5b4023=_0x290d5e?0x0:_0x480e01['offset'];var _0x24c357=_0x290d5e?_0x5885b4['count']:_0x480e01[_0x0c12('0x1a')]+_0x480e01['limit'];var _0x54d1d5;if(_0x24c357>=_0x2e167d){_0x24c357=_0x2e167d;_0x54d1d5=0xc8;}else{_0x54d1d5=0xce;}_0x5c6c96[_0x0c12('0x17')](_0x54d1d5);return _0x5c6c96[_0x0c12('0x1e')]('Content-Range',_0x5b4023+'-'+_0x24c357+'/'+_0x2e167d)['json'](_0x5885b4);}return null;};}function patchUpdates(_0x5ed9a8){return function(_0x2bd383){try{jsonpatch[_0x0c12('0x1f')](_0x2bd383,_0x5ed9a8,!![]);}catch(_0x2fae47){return BPromise['reject'](_0x2fae47);}return _0x2bd383[_0x0c12('0x20')]();};}function saveUpdates(_0x24fe00,_0x58fe0a){return function(_0x42966b){if(_0x42966b){return _0x42966b[_0x0c12('0x21')](_0x24fe00)[_0x0c12('0x22')](function(_0x22f0a4){return _0x22f0a4;});}return null;};}function removeEntity(_0x4687b8,_0x320841){return function(_0x249d61){if(_0x249d61){return _0x249d61[_0x0c12('0x23')]()['then'](function(){_0x4687b8['status'](0xcc)[_0x0c12('0x18')]();});}};}function handleEntityNotFound(_0x134fe6,_0x243594){return function(_0x2d2279){if(!_0x2d2279){_0x134fe6['sendStatus'](0x194);}return _0x2d2279;};}function handleError(_0x1b7028,_0x438597){_0x438597=_0x438597||0x1f4;return function(_0x20b121){logger[_0x0c12('0x24')](_0x20b121[_0x0c12('0x25')]);if(_0x20b121[_0x0c12('0x26')]){delete _0x20b121[_0x0c12('0x26')];}_0x1b7028[_0x0c12('0x17')](_0x438597)[_0x0c12('0x27')](_0x20b121);};}exports[_0x0c12('0x28')]=function(_0x272cdf,_0x21a8a2){var _0x21a8bd={},_0x12cb90={},_0x29c68f={'count':0x0,'rows':[]};var _0x1d6c98=_[_0x0c12('0x29')](db[_0x0c12('0x2a')][_0x0c12('0x2b')],function(_0x41200b){return{'name':_0x41200b[_0x0c12('0x2c')],'type':_0x41200b[_0x0c12('0x2d')][_0x0c12('0x2e')]};});_0x12cb90[_0x0c12('0x2f')]=_[_0x0c12('0x29')](_0x1d6c98,'name');_0x12cb90['query']=_[_0x0c12('0x30')](_0x272cdf[_0x0c12('0x31')]);_0x12cb90[_0x0c12('0x32')]=_[_0x0c12('0x33')](_0x12cb90[_0x0c12('0x2f')],_0x12cb90[_0x0c12('0x31')]);_0x21a8bd[_0x0c12('0x34')]=_[_0x0c12('0x33')](_0x12cb90[_0x0c12('0x2f')],qs[_0x0c12('0x35')](_0x272cdf['query']['fields']));_0x21a8bd[_0x0c12('0x34')]=_0x21a8bd['attributes']['length']?_0x21a8bd[_0x0c12('0x34')]:_0x12cb90[_0x0c12('0x2f')];if(!_0x272cdf[_0x0c12('0x31')][_0x0c12('0x36')]('nolimit')){_0x21a8bd[_0x0c12('0x1c')]=qs[_0x0c12('0x1c')](_0x272cdf['query'][_0x0c12('0x1c')]);_0x21a8bd[_0x0c12('0x1a')]=qs[_0x0c12('0x1a')](_0x272cdf[_0x0c12('0x31')][_0x0c12('0x1a')]);}_0x21a8bd[_0x0c12('0x37')]=qs[_0x0c12('0x38')](_0x272cdf[_0x0c12('0x31')][_0x0c12('0x38')]);_0x21a8bd['where']=qs[_0x0c12('0x32')](_[_0x0c12('0x39')](_0x272cdf['query'],_0x12cb90[_0x0c12('0x32')]),_0x1d6c98);if(_0x272cdf[_0x0c12('0x31')][_0x0c12('0x3a')]){_0x21a8bd['where']=_['merge'](_0x21a8bd['where'],{'$or':_[_0x0c12('0x29')](_0x1d6c98,function(_0x1752d9){if(_0x1752d9['type']!==_0x0c12('0x3b')){var _0x49f374={};_0x49f374[_0x1752d9[_0x0c12('0x26')]]={'$like':'%'+_0x272cdf[_0x0c12('0x31')][_0x0c12('0x3a')]+'%'};return _0x49f374;}})});}_0x21a8bd=_['merge']({},_0x21a8bd,_0x272cdf[_0x0c12('0x3c')]);var _0x5c371e={'where':_0x21a8bd[_0x0c12('0x3d')]};return db[_0x0c12('0x2a')][_0x0c12('0x1d')](_0x5c371e)[_0x0c12('0x22')](function(_0x4a1cf1){_0x29c68f[_0x0c12('0x1d')]=_0x4a1cf1;if(_0x272cdf[_0x0c12('0x31')]['includeAll']){_0x21a8bd['include']=[{'all':!![]}];}return db['SquareReport'][_0x0c12('0x3e')](_0x21a8bd);})[_0x0c12('0x22')](function(_0x6362de){_0x29c68f['rows']=_0x6362de;return _0x29c68f;})[_0x0c12('0x22')](respondWithFilteredResult(_0x21a8a2,_0x21a8bd))[_0x0c12('0x3f')](handleError(_0x21a8a2,null));};exports['show']=function(_0x55c6c2,_0x5edb23){var _0x239557={'raw':!![],'where':{'id':_0x55c6c2[_0x0c12('0x40')]['id']}},_0x3f3eb3={};_0x3f3eb3[_0x0c12('0x2f')]=_['keys'](db[_0x0c12('0x2a')][_0x0c12('0x2b')]);_0x3f3eb3[_0x0c12('0x31')]=_[_0x0c12('0x30')](_0x55c6c2[_0x0c12('0x31')]);_0x3f3eb3[_0x0c12('0x32')]=_['intersection'](_0x3f3eb3['model'],_0x3f3eb3[_0x0c12('0x31')]);_0x239557[_0x0c12('0x34')]=_[_0x0c12('0x33')](_0x3f3eb3['model'],qs[_0x0c12('0x35')](_0x55c6c2['query'][_0x0c12('0x35')]));_0x239557[_0x0c12('0x34')]=_0x239557[_0x0c12('0x34')][_0x0c12('0x41')]?_0x239557[_0x0c12('0x34')]:_0x3f3eb3['model'];if(_0x55c6c2[_0x0c12('0x31')][_0x0c12('0x42')]){_0x239557[_0x0c12('0x43')]=[{'all':!![]}];}_0x239557=_[_0x0c12('0x44')]({},_0x239557,_0x55c6c2[_0x0c12('0x3c')]);return db[_0x0c12('0x2a')][_0x0c12('0x45')](_0x239557)[_0x0c12('0x22')](handleEntityNotFound(_0x5edb23,null))['then'](respondWithResult(_0x5edb23,null))['catch'](handleError(_0x5edb23,null));};exports[_0x0c12('0x46')]=function(_0x3e4cf8,_0x3da7b8){return db[_0x0c12('0x2a')][_0x0c12('0x46')](_0x3e4cf8[_0x0c12('0x47')],{})['then'](respondWithResult(_0x3da7b8,0xc9))[_0x0c12('0x3f')](handleError(_0x3da7b8,null));};exports[_0x0c12('0x21')]=function(_0x49a6f2,_0x3beee9){if(_0x49a6f2[_0x0c12('0x47')]['id']){delete _0x49a6f2[_0x0c12('0x47')]['id'];}return db[_0x0c12('0x2a')][_0x0c12('0x45')]({'where':{'id':_0x49a6f2['params']['id']}})['then'](handleEntityNotFound(_0x3beee9,null))[_0x0c12('0x22')](saveUpdates(_0x49a6f2[_0x0c12('0x47')],null))['then'](respondWithResult(_0x3beee9,null))[_0x0c12('0x3f')](handleError(_0x3beee9,null));};exports[_0x0c12('0x23')]=function(_0x598865,_0x5455a0){return db['SquareReport']['find']({'where':{'id':_0x598865[_0x0c12('0x40')]['id']}})[_0x0c12('0x22')](handleEntityNotFound(_0x5455a0,null))['then'](removeEntity(_0x5455a0,null))[_0x0c12('0x3f')](handleError(_0x5455a0,null));};exports[_0x0c12('0x48')]=function(_0x1fd0f2,_0x1c85ad){return db[_0x0c12('0x2a')][_0x0c12('0x48')]()['then'](respondWithResult(_0x1c85ad,null))['catch'](handleError(_0x1c85ad,null));}; \ No newline at end of file +var _0x8576=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','catch'];(function(_0x228c21,_0x9f0166){var _0x3bb84b=function(_0x5541b2){while(--_0x5541b2){_0x228c21['push'](_0x228c21['shift']());}};_0x3bb84b(++_0x9f0166);}(_0x8576,0x131));var _0x6857=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x8576[_0x5ddaac];return _0x2a9c58;};'use strict';var emlformat=require(_0x6857('0x0'));var rimraf=require(_0x6857('0x1'));var zipdir=require(_0x6857('0x2'));var jsonpatch=require(_0x6857('0x3'));var rp=require(_0x6857('0x4'));var moment=require(_0x6857('0x5'));var BPromise=require(_0x6857('0x6'));var Mustache=require(_0x6857('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6857('0x8'));var csv=require('to-csv');var ejs=require(_0x6857('0x9'));var fs=require('fs');var fs_extra=require(_0x6857('0xa'));var _=require(_0x6857('0xb'));var squel=require(_0x6857('0xc'));var crypto=require(_0x6857('0xd'));var jsforce=require(_0x6857('0xe'));var deskjs=require(_0x6857('0xf'));var toCsv=require(_0x6857('0x10'));var querystring=require(_0x6857('0x11'));var Papa=require(_0x6857('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6857('0x13'));var logger=require(_0x6857('0x14'))(_0x6857('0x15'));var utils=require(_0x6857('0x16'));var config=require(_0x6857('0x17'));var licenseUtil=require(_0x6857('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xda62d7,_0x41ff38){_0x41ff38=_0x41ff38||0xcc;return function(_0x25fa6c){if(_0x25fa6c){return _0xda62d7[_0x6857('0x19')](_0x41ff38);}return _0xda62d7['status'](_0x41ff38)[_0x6857('0x1a')]();};}function respondWithResult(_0x59c62e,_0x5c7d1c){_0x5c7d1c=_0x5c7d1c||0xc8;return function(_0x2c2c16){if(_0x2c2c16){return _0x59c62e[_0x6857('0x1b')](_0x5c7d1c)['json'](_0x2c2c16);}};}function respondWithFilteredResult(_0x1d01d9,_0xe311d2){return function(_0x171c9b){if(_0x171c9b){var _0x4e1861=typeof _0xe311d2['offset']===_0x6857('0x1c')&&typeof _0xe311d2[_0x6857('0x1d')]===_0x6857('0x1c');var _0x20054d=_0x171c9b[_0x6857('0x1e')];var _0x58adc3=_0x4e1861?0x0:_0xe311d2[_0x6857('0x1f')];var _0x7fab7b=_0x4e1861?_0x171c9b[_0x6857('0x1e')]:_0xe311d2['offset']+_0xe311d2[_0x6857('0x1d')];var _0x59fb16;if(_0x7fab7b>=_0x20054d){_0x7fab7b=_0x20054d;_0x59fb16=0xc8;}else{_0x59fb16=0xce;}_0x1d01d9[_0x6857('0x1b')](_0x59fb16);return _0x1d01d9[_0x6857('0x20')](_0x6857('0x21'),_0x58adc3+'-'+_0x7fab7b+'/'+_0x20054d)['json'](_0x171c9b);}return null;};}function patchUpdates(_0x27314a){return function(_0x5db0bc){try{jsonpatch[_0x6857('0x22')](_0x5db0bc,_0x27314a,!![]);}catch(_0x1180cd){return BPromise[_0x6857('0x23')](_0x1180cd);}return _0x5db0bc[_0x6857('0x24')]();};}function saveUpdates(_0x1624ff,_0x13ed4f){return function(_0x49c21d){if(_0x49c21d){return _0x49c21d[_0x6857('0x25')](_0x1624ff)[_0x6857('0x26')](function(_0x29f0f6){return _0x29f0f6;});}return null;};}function removeEntity(_0x4a854c,_0xa24382){return function(_0x502149){if(_0x502149){return _0x502149[_0x6857('0x27')]()['then'](function(){_0x4a854c[_0x6857('0x1b')](0xcc)[_0x6857('0x1a')]();});}};}function handleEntityNotFound(_0xa63c68,_0x847fa8){return function(_0x2a0c69){if(!_0x2a0c69){_0xa63c68[_0x6857('0x19')](0x194);}return _0x2a0c69;};}function handleError(_0x41322f,_0x397343){_0x397343=_0x397343||0x1f4;return function(_0x241c1d){logger[_0x6857('0x28')](_0x241c1d[_0x6857('0x29')]);if(_0x241c1d['name']){delete _0x241c1d[_0x6857('0x2a')];}_0x41322f['status'](_0x397343)[_0x6857('0x2b')](_0x241c1d);};}exports[_0x6857('0x2c')]=function(_0xca637c,_0x6d2fa0){var _0x13a535={},_0x56e8e6={},_0x927b69={'count':0x0,'rows':[]};var _0x2bbe4b=_['map'](db[_0x6857('0x2d')][_0x6857('0x2e')],function(_0x4bc4f8){return{'name':_0x4bc4f8[_0x6857('0x2f')],'type':_0x4bc4f8[_0x6857('0x30')][_0x6857('0x31')]};});_0x56e8e6[_0x6857('0x32')]=_['map'](_0x2bbe4b,_0x6857('0x2a'));_0x56e8e6['query']=_[_0x6857('0x33')](_0xca637c[_0x6857('0x34')]);_0x56e8e6[_0x6857('0x35')]=_[_0x6857('0x36')](_0x56e8e6[_0x6857('0x32')],_0x56e8e6['query']);_0x13a535['attributes']=_['intersection'](_0x56e8e6[_0x6857('0x32')],qs[_0x6857('0x37')](_0xca637c[_0x6857('0x34')][_0x6857('0x37')]));_0x13a535[_0x6857('0x38')]=_0x13a535[_0x6857('0x38')][_0x6857('0x39')]?_0x13a535['attributes']:_0x56e8e6[_0x6857('0x32')];if(!_0xca637c[_0x6857('0x34')]['hasOwnProperty']('nolimit')){_0x13a535[_0x6857('0x1d')]=qs[_0x6857('0x1d')](_0xca637c['query']['limit']);_0x13a535['offset']=qs['offset'](_0xca637c['query']['offset']);}_0x13a535[_0x6857('0x3a')]=qs[_0x6857('0x3b')](_0xca637c['query'][_0x6857('0x3b')]);_0x13a535[_0x6857('0x3c')]=qs[_0x6857('0x35')](_['pick'](_0xca637c['query'],_0x56e8e6[_0x6857('0x35')]),_0x2bbe4b);if(_0xca637c[_0x6857('0x34')][_0x6857('0x3d')]){_0x13a535[_0x6857('0x3c')]=_['merge'](_0x13a535[_0x6857('0x3c')],{'$or':_[_0x6857('0x3e')](_0x2bbe4b,function(_0x5251c8){if(_0x5251c8[_0x6857('0x30')]!==_0x6857('0x3f')){var _0x215f12={};_0x215f12[_0x5251c8[_0x6857('0x2a')]]={'$like':'%'+_0xca637c['query'][_0x6857('0x3d')]+'%'};return _0x215f12;}})});}_0x13a535=_[_0x6857('0x40')]({},_0x13a535,_0xca637c[_0x6857('0x41')]);var _0x1f8106={'where':_0x13a535[_0x6857('0x3c')]};return db[_0x6857('0x2d')][_0x6857('0x1e')](_0x1f8106)['then'](function(_0x21c832){_0x927b69[_0x6857('0x1e')]=_0x21c832;if(_0xca637c[_0x6857('0x34')][_0x6857('0x42')]){_0x13a535[_0x6857('0x43')]=[{'all':!![]}];}return db['SquareReport'][_0x6857('0x44')](_0x13a535);})[_0x6857('0x26')](function(_0x40982e){_0x927b69['rows']=_0x40982e;return _0x927b69;})[_0x6857('0x26')](respondWithFilteredResult(_0x6d2fa0,_0x13a535))['catch'](handleError(_0x6d2fa0,null));};exports[_0x6857('0x45')]=function(_0x5e2780,_0x2fb6f2){var _0x20da9d={'raw':!![],'where':{'id':_0x5e2780[_0x6857('0x46')]['id']}},_0x3b2da3={};_0x3b2da3['model']=_[_0x6857('0x33')](db[_0x6857('0x2d')][_0x6857('0x2e')]);_0x3b2da3['query']=_[_0x6857('0x33')](_0x5e2780[_0x6857('0x34')]);_0x3b2da3[_0x6857('0x35')]=_[_0x6857('0x36')](_0x3b2da3[_0x6857('0x32')],_0x3b2da3['query']);_0x20da9d[_0x6857('0x38')]=_[_0x6857('0x36')](_0x3b2da3[_0x6857('0x32')],qs[_0x6857('0x37')](_0x5e2780['query'][_0x6857('0x37')]));_0x20da9d['attributes']=_0x20da9d[_0x6857('0x38')][_0x6857('0x39')]?_0x20da9d[_0x6857('0x38')]:_0x3b2da3[_0x6857('0x32')];if(_0x5e2780['query']['includeAll']){_0x20da9d[_0x6857('0x43')]=[{'all':!![]}];}_0x20da9d=_['merge']({},_0x20da9d,_0x5e2780['options']);return db[_0x6857('0x2d')][_0x6857('0x47')](_0x20da9d)[_0x6857('0x26')](handleEntityNotFound(_0x2fb6f2,null))['then'](respondWithResult(_0x2fb6f2,null))['catch'](handleError(_0x2fb6f2,null));};exports[_0x6857('0x48')]=function(_0x8462e2,_0x1f9db9){return db['SquareReport'][_0x6857('0x48')](_0x8462e2[_0x6857('0x49')],{})[_0x6857('0x26')](respondWithResult(_0x1f9db9,0xc9))[_0x6857('0x4a')](handleError(_0x1f9db9,null));};exports[_0x6857('0x25')]=function(_0x387de9,_0x4c709d){if(_0x387de9['body']['id']){delete _0x387de9[_0x6857('0x49')]['id'];}return db[_0x6857('0x2d')][_0x6857('0x47')]({'where':{'id':_0x387de9[_0x6857('0x46')]['id']}})[_0x6857('0x26')](handleEntityNotFound(_0x4c709d,null))[_0x6857('0x26')](saveUpdates(_0x387de9[_0x6857('0x49')],null))[_0x6857('0x26')](respondWithResult(_0x4c709d,null))[_0x6857('0x4a')](handleError(_0x4c709d,null));};exports[_0x6857('0x27')]=function(_0x1f99b6,_0xb83071){return db[_0x6857('0x2d')][_0x6857('0x47')]({'where':{'id':_0x1f99b6[_0x6857('0x46')]['id']}})[_0x6857('0x26')](handleEntityNotFound(_0xb83071,null))[_0x6857('0x26')](removeEntity(_0xb83071,null))[_0x6857('0x4a')](handleError(_0xb83071,null));};exports['describe']=function(_0x5d5443,_0x39142e){return db[_0x6857('0x2d')][_0x6857('0x4b')]()['then'](respondWithResult(_0x39142e,null))[_0x6857('0x4a')](handleError(_0x39142e,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c4fe192..190eaed 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 _0x541a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareReport','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x2c0da8,_0x271ba3){var _0x4d362c=function(_0x5b1d9b){while(--_0x5b1d9b){_0x2c0da8['push'](_0x2c0da8['shift']());}};_0x4d362c(++_0x271ba3);}(_0x541a,0x1a1));var _0xa541=function(_0xcd4e86,_0x10338c){_0xcd4e86=_0xcd4e86-0x0;var _0x3b10ed=_0x541a[_0xcd4e86];return _0x3b10ed;};'use strict';var _=require(_0xa541('0x0'));var util=require(_0xa541('0x1'));var logger=require(_0xa541('0x2'))('api');var moment=require(_0xa541('0x3'));var BPromise=require(_0xa541('0x4'));var rp=require(_0xa541('0x5'));var fs=require('fs');var path=require(_0xa541('0x6'));var rimraf=require(_0xa541('0x7'));var config=require(_0xa541('0x8'));var attributes=require('./squareReport.attributes');module[_0xa541('0x9')]=function(_0x3253ec,_0x2dbf2d){return _0x3253ec[_0xa541('0xa')](_0xa541('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xa541('0xc')]},{'name':'leaveAt','fields':[_0xa541('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a65=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','SquareReport','uid_pname','project_name','leaveAt','lodash','util'];(function(_0x151d92,_0x3d500a){var _0x1cd3f7=function(_0x173029){while(--_0x173029){_0x151d92['push'](_0x151d92['shift']());}};_0x1cd3f7(++_0x3d500a);}(_0x4a65,0x15c));var _0x54a6=function(_0x25f663,_0x80a7a5){_0x25f663=_0x25f663-0x0;var _0x105f44=_0x4a65[_0x25f663];return _0x105f44;};'use strict';var _=require(_0x54a6('0x0'));var util=require(_0x54a6('0x1'));var logger=require('../../config/logger')(_0x54a6('0x2'));var moment=require(_0x54a6('0x3'));var BPromise=require(_0x54a6('0x4'));var rp=require(_0x54a6('0x5'));var fs=require('fs');var path=require(_0x54a6('0x6'));var rimraf=require(_0x54a6('0x7'));var config=require(_0x54a6('0x8'));var attributes=require(_0x54a6('0x9'));module['exports']=function(_0x312d91,_0x8166a8){return _0x312d91['define'](_0x54a6('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x54a6('0xb'),'fields':['uniqueid',_0x54a6('0xc')]},{'name':'leaveAt','fields':[_0x54a6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 975707d..0a8dcf6 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 _0x8fc2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','SquareReport,\x20%s,\x20%s','error','message','catch','CreateSquareReport','SquareReport','create','options','raw','UpdateSquareReport','update','body','where','attributes','limit','lodash','moment','bluebird'];(function(_0x1dfc3d,_0x14e67e){var _0x2d126f=function(_0x4e5939){while(--_0x4e5939){_0x1dfc3d['push'](_0x1dfc3d['shift']());}};_0x2d126f(++_0x14e67e);}(_0x8fc2,0x7d));var _0x28fc=function(_0x3a3b25,_0x28ac09){_0x3a3b25=_0x3a3b25-0x0;var _0x5a233f=_0x8fc2[_0x3a3b25];return _0x5a233f;};'use strict';var _=require(_0x28fc('0x0'));var util=require('util');var moment=require(_0x28fc('0x1'));var BPromise=require(_0x28fc('0x2'));var rs=require(_0x28fc('0x3'));var fs=require('fs');var Redis=require(_0x28fc('0x4'));var db=require(_0x28fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28fc('0x6'))(_0x28fc('0x7'));var config=require(_0x28fc('0x8'));var jayson=require(_0x28fc('0x9'));var client=jayson[_0x28fc('0xa')][_0x28fc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23746c,_0x58af6a,_0x43f147){return new BPromise(function(_0x2bb027,_0x4c083d){return client['request'](_0x23746c,_0x43f147)[_0x28fc('0xc')](function(_0x1c8291){logger[_0x28fc('0xd')]('SquareReport,\x20%s,\x20%s',_0x58af6a,_0x28fc('0xe'));logger[_0x28fc('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x58af6a,_0x28fc('0xe'),JSON[_0x28fc('0x10')](_0x1c8291));if(_0x1c8291['error']){if(_0x1c8291['error']['code']===0x1f4){logger['error'](_0x28fc('0x11'),_0x58af6a,_0x1c8291[_0x28fc('0x12')]['message']);return _0x4c083d(_0x1c8291[_0x28fc('0x12')]['message']);}logger[_0x28fc('0x12')](_0x28fc('0x11'),_0x58af6a,_0x1c8291['error']['message']);return _0x2bb027(_0x1c8291[_0x28fc('0x12')][_0x28fc('0x13')]);}else{logger['info'](_0x28fc('0x11'),_0x58af6a,_0x28fc('0xe'));_0x2bb027(_0x1c8291['result'][_0x28fc('0x13')]);}})[_0x28fc('0x14')](function(_0x1b87b4){logger[_0x28fc('0x12')](_0x28fc('0x11'),_0x58af6a,_0x1b87b4);_0x4c083d(_0x1b87b4);});});}exports[_0x28fc('0x15')]=function(_0x329d41){var _0x576fee=this;return new Promise(function(_0x4e9caf,_0x1bd91a){return db[_0x28fc('0x16')][_0x28fc('0x17')](_0x329d41['body'],{'raw':_0x329d41['options']?_0x329d41[_0x28fc('0x18')][_0x28fc('0x19')]===undefined?!![]:![]:!![]})[_0x28fc('0xc')](function(_0xde7eab){logger[_0x28fc('0xd')]('CreateSquareReport',_0x329d41);logger[_0x28fc('0xf')](_0x28fc('0x15'),_0x329d41,JSON['stringify'](_0xde7eab));_0x4e9caf(_0xde7eab);})['catch'](function(_0x158767){logger[_0x28fc('0x12')](_0x28fc('0x15'),_0x158767['message'],_0x329d41);_0x1bd91a(_0x576fee[_0x28fc('0x12')](0x1f4,_0x158767['message']));});});};exports[_0x28fc('0x1a')]=function(_0x11f98f){var _0x1b9732=this;return new Promise(function(_0x26f942,_0x568d51){return db['SquareReport'][_0x28fc('0x1b')](_0x11f98f[_0x28fc('0x1c')],{'raw':_0x11f98f[_0x28fc('0x18')]?_0x11f98f[_0x28fc('0x18')][_0x28fc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11f98f[_0x28fc('0x18')]?_0x11f98f[_0x28fc('0x18')][_0x28fc('0x1d')]||null:null,'attributes':_0x11f98f[_0x28fc('0x18')]?_0x11f98f[_0x28fc('0x18')][_0x28fc('0x1e')]||null:null,'limit':_0x11f98f[_0x28fc('0x18')]?_0x11f98f[_0x28fc('0x18')][_0x28fc('0x1f')]||null:null})[_0x28fc('0xc')](function(_0x1f0734){logger[_0x28fc('0xd')](_0x28fc('0x1a'),_0x11f98f);logger['debug'](_0x28fc('0x1a'),_0x11f98f,JSON[_0x28fc('0x10')](_0x1f0734));_0x26f942(_0x1f0734);})[_0x28fc('0x14')](function(_0x80433d){logger['error'](_0x28fc('0x1a'),_0x80433d[_0x28fc('0x13')],_0x11f98f);_0x568d51(_0x1b9732[_0x28fc('0x12')](0x1f4,_0x80433d[_0x28fc('0x13')]));});});}; \ No newline at end of file +var _0x16ec=['UpdateSquareReport','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x16ec,0x17a));var _0xc16e=function(_0x3b0355,_0x48fccf){_0x3b0355=_0x3b0355-0x0;var _0x53d10e=_0x16ec[_0x3b0355];return _0x53d10e;};'use strict';var _=require(_0xc16e('0x0'));var util=require(_0xc16e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc16e('0x2'));var fs=require('fs');var Redis=require(_0xc16e('0x3'));var db=require(_0xc16e('0x4'))['db'];var utils=require(_0xc16e('0x5'));var logger=require(_0xc16e('0x6'))(_0xc16e('0x7'));var config=require(_0xc16e('0x8'));var jayson=require(_0xc16e('0x9'));var client=jayson[_0xc16e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42a9ea,_0x70612d,_0x1cb64a){return new BPromise(function(_0x19fa4e,_0x2ecce6){return client[_0xc16e('0xb')](_0x42a9ea,_0x1cb64a)[_0xc16e('0xc')](function(_0x1af574){logger[_0xc16e('0xd')](_0xc16e('0xe'),_0x70612d,'request\x20sent');logger[_0xc16e('0xf')](_0xc16e('0x10'),_0x70612d,_0xc16e('0x11'),JSON['stringify'](_0x1af574));if(_0x1af574[_0xc16e('0x12')]){if(_0x1af574['error'][_0xc16e('0x13')]===0x1f4){logger[_0xc16e('0x12')](_0xc16e('0xe'),_0x70612d,_0x1af574['error'][_0xc16e('0x14')]);return _0x2ecce6(_0x1af574['error'][_0xc16e('0x14')]);}logger['error'](_0xc16e('0xe'),_0x70612d,_0x1af574[_0xc16e('0x12')][_0xc16e('0x14')]);return _0x19fa4e(_0x1af574['error'][_0xc16e('0x14')]);}else{logger[_0xc16e('0xd')](_0xc16e('0xe'),_0x70612d,'request\x20sent');_0x19fa4e(_0x1af574[_0xc16e('0x15')][_0xc16e('0x14')]);}})[_0xc16e('0x16')](function(_0x1233ff){logger['error'](_0xc16e('0xe'),_0x70612d,_0x1233ff);_0x2ecce6(_0x1233ff);});});}exports[_0xc16e('0x17')]=function(_0x522c86){var _0x274546=this;return new Promise(function(_0x1fed58,_0x351756){return db[_0xc16e('0x18')][_0xc16e('0x19')](_0x522c86[_0xc16e('0x1a')],{'raw':_0x522c86[_0xc16e('0x1b')]?_0x522c86[_0xc16e('0x1b')][_0xc16e('0x1c')]===undefined?!![]:![]:!![]})[_0xc16e('0xc')](function(_0x30bc2a){logger[_0xc16e('0xd')](_0xc16e('0x17'),_0x522c86);logger[_0xc16e('0xf')](_0xc16e('0x17'),_0x522c86,JSON[_0xc16e('0x1d')](_0x30bc2a));_0x1fed58(_0x30bc2a);})[_0xc16e('0x16')](function(_0x347e4c){logger[_0xc16e('0x12')](_0xc16e('0x17'),_0x347e4c[_0xc16e('0x14')],_0x522c86);_0x351756(_0x274546[_0xc16e('0x12')](0x1f4,_0x347e4c['message']));});});};exports[_0xc16e('0x1e')]=function(_0x41d84f){var _0x181d45=this;return new Promise(function(_0x45d2a9,_0x155ff0){return db[_0xc16e('0x18')]['update'](_0x41d84f[_0xc16e('0x1a')],{'raw':_0x41d84f[_0xc16e('0x1b')]?_0x41d84f[_0xc16e('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41d84f['options']?_0x41d84f[_0xc16e('0x1b')][_0xc16e('0x1f')]||null:null,'attributes':_0x41d84f[_0xc16e('0x1b')]?_0x41d84f[_0xc16e('0x1b')][_0xc16e('0x20')]||null:null,'limit':_0x41d84f[_0xc16e('0x1b')]?_0x41d84f[_0xc16e('0x1b')][_0xc16e('0x21')]||null:null})[_0xc16e('0xc')](function(_0x1ca8de){logger[_0xc16e('0xd')]('UpdateSquareReport',_0x41d84f);logger[_0xc16e('0xf')](_0xc16e('0x1e'),_0x41d84f,JSON['stringify'](_0x1ca8de));_0x45d2a9(_0x1ca8de);})[_0xc16e('0x16')](function(_0x1dd5ad){logger[_0xc16e('0x12')](_0xc16e('0x1e'),_0x1dd5ad[_0xc16e('0x14')],_0x41d84f);_0x155ff0(_0x181d45[_0xc16e('0x12')](0x1f4,_0x1dd5ad[_0xc16e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 9ca620f..b538afe 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 _0xdc59=['describe','/:id','show','isAuthenticated','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xdc59,0x10d));var _0x9dc5=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xdc59[_0x5cb1af];return _0x8d7940;};'use strict';var multer=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9dc5('0x2'));var router=express[_0x9dc5('0x3')]();var fs_extra=require(_0x9dc5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9dc5('0x5'));var config=require(_0x9dc5('0x6'));var controller=require(_0x9dc5('0x7'));router[_0x9dc5('0x8')]('/',auth['isAuthenticated'](),controller[_0x9dc5('0x9')]);router[_0x9dc5('0x8')](_0x9dc5('0xa'),auth['isAuthenticated'](),controller[_0x9dc5('0xb')]);router[_0x9dc5('0x8')](_0x9dc5('0xc'),auth['isAuthenticated'](),controller[_0x9dc5('0xd')]);router['post']('/',auth[_0x9dc5('0xe')](),controller[_0x9dc5('0xf')]);router[_0x9dc5('0x10')]('/:id',auth[_0x9dc5('0xe')](),controller[_0x9dc5('0x11')]);router[_0x9dc5('0x12')]('/:id',auth[_0x9dc5('0xe')](),controller['destroy']);module[_0x9dc5('0x13')]=router; \ No newline at end of file +var _0x30fb=['../../config/environment','./squareReportDetail.controller','get','index','isAuthenticated','show','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30fb,0x65));var _0xb30f=function(_0x3c8679,_0x2faea3){_0x3c8679=_0x3c8679-0x0;var _0x2791f8=_0x30fb[_0x3c8679];return _0x2791f8;};'use strict';var multer=require(_0xb30f('0x0'));var util=require(_0xb30f('0x1'));var path=require(_0xb30f('0x2'));var timeout=require(_0xb30f('0x3'));var express=require(_0xb30f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb30f('0x5'));var interaction=require(_0xb30f('0x6'));var config=require(_0xb30f('0x7'));var controller=require(_0xb30f('0x8'));router[_0xb30f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb30f('0xa')]);router[_0xb30f('0x9')]('/describe',auth[_0xb30f('0xb')](),controller['describe']);router[_0xb30f('0x9')]('/:id',auth[_0xb30f('0xb')](),controller[_0xb30f('0xc')]);router['post']('/',auth[_0xb30f('0xb')](),controller[_0xb30f('0xd')]);router[_0xb30f('0xe')](_0xb30f('0xf'),auth[_0xb30f('0xb')](),controller[_0xb30f('0x10')]);router['delete'](_0xb30f('0xf'),auth[_0xb30f('0xb')](),controller[_0xb30f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 69c2cdf..ad0ab22 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 _0x9f2d=['STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9f2d,0x15f));var _0xd9f2=function(_0x35199c,_0x475e42){_0x35199c=_0x35199c-0x0;var _0x3ad754=_0x9f2d[_0x35199c];return _0x3ad754;};'use strict';var Sequelize=require(_0xd9f2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd9f2('0x1')]},'node':{'type':Sequelize[_0xd9f2('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xd9f2('0x1')]},'callerid':{'type':Sequelize[_0xd9f2('0x1')]}}; \ No newline at end of file +var _0x8d29=['sequelize','exports','STRING','TEXT'];(function(_0x13c135,_0xe7393){var _0x456d59=function(_0x5056b7){while(--_0x5056b7){_0x13c135['push'](_0x13c135['shift']());}};_0x456d59(++_0xe7393);}(_0x8d29,0x130));var _0x98d2=function(_0x102215,_0x42ea07){_0x102215=_0x102215-0x0;var _0x37810a=_0x8d29[_0x102215];return _0x37810a;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x98d2('0x2')]},'application':{'type':Sequelize[_0x98d2('0x2')]},'data':{'type':Sequelize[_0x98d2('0x3')]},'project_name':{'type':Sequelize[_0x98d2('0x2')]},'callerid':{'type':Sequelize[_0x98d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4a6a55f..7f74de6 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 _0x8043=['model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','length','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','map','query','keys','filters'];(function(_0x1045bd,_0x126cd7){var _0x273bf5=function(_0x3fa486){while(--_0x3fa486){_0x1045bd['push'](_0x1045bd['shift']());}};_0x273bf5(++_0x126cd7);}(_0x8043,0x66));var _0x3804=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x8043[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require(_0x3804('0x0'));var rimraf=require(_0x3804('0x1'));var zipdir=require(_0x3804('0x2'));var jsonpatch=require(_0x3804('0x3'));var rp=require(_0x3804('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3804('0x5'));var util=require(_0x3804('0x6'));var path=require(_0x3804('0x7'));var sox=require(_0x3804('0x8'));var csv=require(_0x3804('0x9'));var ejs=require(_0x3804('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3804('0xb'));var squel=require('squel');var crypto=require(_0x3804('0xc'));var jsforce=require(_0x3804('0xd'));var deskjs=require(_0x3804('0xe'));var toCsv=require(_0x3804('0x9'));var querystring=require(_0x3804('0xf'));var Papa=require(_0x3804('0x10'));var Redis=require(_0x3804('0x11'));var authService=require(_0x3804('0x12'));var qs=require(_0x3804('0x13'));var as=require(_0x3804('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3804('0x15'))(_0x3804('0x16'));var utils=require(_0x3804('0x17'));var config=require(_0x3804('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3804('0x19'))['db'];function respondWithStatusCode(_0x50bacc,_0x2c32e8){_0x2c32e8=_0x2c32e8||0xcc;return function(_0x48773e){if(_0x48773e){return _0x50bacc[_0x3804('0x1a')](_0x2c32e8);}return _0x50bacc[_0x3804('0x1b')](_0x2c32e8)[_0x3804('0x1c')]();};}function respondWithResult(_0x575ab0,_0x453586){_0x453586=_0x453586||0xc8;return function(_0x25cd47){if(_0x25cd47){return _0x575ab0['status'](_0x453586)[_0x3804('0x1d')](_0x25cd47);}};}function respondWithFilteredResult(_0x4cca78,_0x1e8b2b){return function(_0x19c4d2){if(_0x19c4d2){var _0x5c71b8=typeof _0x1e8b2b[_0x3804('0x1e')]===_0x3804('0x1f')&&typeof _0x1e8b2b[_0x3804('0x20')]===_0x3804('0x1f');var _0xc3b7d5=_0x19c4d2[_0x3804('0x21')];var _0x27a234=_0x5c71b8?0x0:_0x1e8b2b[_0x3804('0x1e')];var _0x114d0c=_0x5c71b8?_0x19c4d2['count']:_0x1e8b2b['offset']+_0x1e8b2b[_0x3804('0x20')];var _0x3b33fe;if(_0x114d0c>=_0xc3b7d5){_0x114d0c=_0xc3b7d5;_0x3b33fe=0xc8;}else{_0x3b33fe=0xce;}_0x4cca78[_0x3804('0x1b')](_0x3b33fe);return _0x4cca78['set']('Content-Range',_0x27a234+'-'+_0x114d0c+'/'+_0xc3b7d5)['json'](_0x19c4d2);}return null;};}function patchUpdates(_0x445d9e){return function(_0x242f06){try{jsonpatch['apply'](_0x242f06,_0x445d9e,!![]);}catch(_0x1eaa7b){return BPromise['reject'](_0x1eaa7b);}return _0x242f06[_0x3804('0x22')]();};}function saveUpdates(_0x3814b1,_0x37341a){return function(_0x1e7bf8){if(_0x1e7bf8){return _0x1e7bf8[_0x3804('0x23')](_0x3814b1)[_0x3804('0x24')](function(_0x1fa4f3){return _0x1fa4f3;});}return null;};}function removeEntity(_0x4ab2e8,_0x2355f8){return function(_0x40017e){if(_0x40017e){return _0x40017e[_0x3804('0x25')]()['then'](function(){_0x4ab2e8[_0x3804('0x1b')](0xcc)[_0x3804('0x1c')]();});}};}function handleEntityNotFound(_0x2065ee,_0x4e9157){return function(_0x5eba93){if(!_0x5eba93){_0x2065ee[_0x3804('0x1a')](0x194);}return _0x5eba93;};}function handleError(_0x58d5af,_0x5b4c2a){_0x5b4c2a=_0x5b4c2a||0x1f4;return function(_0x553900){logger[_0x3804('0x26')](_0x553900[_0x3804('0x27')]);if(_0x553900[_0x3804('0x28')]){delete _0x553900['name'];}_0x58d5af['status'](_0x5b4c2a)[_0x3804('0x29')](_0x553900);};}exports[_0x3804('0x2a')]=function(_0x4c146f,_0x4ff0aa){var _0x512f2c={},_0x347004={},_0x1f4eb7={'count':0x0,'rows':[]};var _0x87b939=_['map'](db[_0x3804('0x2b')][_0x3804('0x2c')],function(_0x32656a){return{'name':_0x32656a[_0x3804('0x2d')],'type':_0x32656a[_0x3804('0x2e')][_0x3804('0x2f')]};});_0x347004['model']=_[_0x3804('0x30')](_0x87b939,_0x3804('0x28'));_0x347004[_0x3804('0x31')]=_[_0x3804('0x32')](_0x4c146f[_0x3804('0x31')]);_0x347004[_0x3804('0x33')]=_['intersection'](_0x347004[_0x3804('0x34')],_0x347004[_0x3804('0x31')]);_0x512f2c[_0x3804('0x35')]=_[_0x3804('0x36')](_0x347004['model'],qs[_0x3804('0x37')](_0x4c146f[_0x3804('0x31')][_0x3804('0x37')]));_0x512f2c[_0x3804('0x35')]=_0x512f2c[_0x3804('0x35')]['length']?_0x512f2c[_0x3804('0x35')]:_0x347004['model'];if(!_0x4c146f[_0x3804('0x31')][_0x3804('0x38')](_0x3804('0x39'))){_0x512f2c['limit']=qs[_0x3804('0x20')](_0x4c146f[_0x3804('0x31')][_0x3804('0x20')]);_0x512f2c[_0x3804('0x1e')]=qs[_0x3804('0x1e')](_0x4c146f[_0x3804('0x31')][_0x3804('0x1e')]);}_0x512f2c[_0x3804('0x3a')]=qs[_0x3804('0x3b')](_0x4c146f['query'][_0x3804('0x3b')]);_0x512f2c[_0x3804('0x3c')]=qs['filters'](_[_0x3804('0x3d')](_0x4c146f['query'],_0x347004[_0x3804('0x33')]),_0x87b939);if(_0x4c146f[_0x3804('0x31')][_0x3804('0x3e')]){_0x512f2c[_0x3804('0x3c')]=_[_0x3804('0x3f')](_0x512f2c[_0x3804('0x3c')],{'$or':_[_0x3804('0x30')](_0x87b939,function(_0x156b03){if(_0x156b03['type']!==_0x3804('0x40')){var _0x5db926={};_0x5db926[_0x156b03[_0x3804('0x28')]]={'$like':'%'+_0x4c146f[_0x3804('0x31')][_0x3804('0x3e')]+'%'};return _0x5db926;}})});}_0x512f2c=_[_0x3804('0x3f')]({},_0x512f2c,_0x4c146f[_0x3804('0x41')]);var _0x194bce={'where':_0x512f2c[_0x3804('0x3c')]};return db[_0x3804('0x2b')][_0x3804('0x21')](_0x194bce)[_0x3804('0x24')](function(_0x195d3d){_0x1f4eb7[_0x3804('0x21')]=_0x195d3d;if(_0x4c146f[_0x3804('0x31')][_0x3804('0x42')]){_0x512f2c[_0x3804('0x43')]=[{'all':!![]}];}return db[_0x3804('0x2b')]['findAll'](_0x512f2c);})[_0x3804('0x24')](function(_0x3c33a3){_0x1f4eb7[_0x3804('0x44')]=_0x3c33a3;return _0x1f4eb7;})['then'](respondWithFilteredResult(_0x4ff0aa,_0x512f2c))['catch'](handleError(_0x4ff0aa,null));};exports[_0x3804('0x45')]=function(_0x1e333f,_0x4f7680){var _0x4a74b3={'raw':!![],'where':{'id':_0x1e333f[_0x3804('0x46')]['id']}},_0x4e68fe={};_0x4e68fe[_0x3804('0x34')]=_[_0x3804('0x32')](db[_0x3804('0x2b')][_0x3804('0x2c')]);_0x4e68fe[_0x3804('0x31')]=_[_0x3804('0x32')](_0x1e333f[_0x3804('0x31')]);_0x4e68fe['filters']=_[_0x3804('0x36')](_0x4e68fe[_0x3804('0x34')],_0x4e68fe[_0x3804('0x31')]);_0x4a74b3[_0x3804('0x35')]=_[_0x3804('0x36')](_0x4e68fe[_0x3804('0x34')],qs['fields'](_0x1e333f[_0x3804('0x31')]['fields']));_0x4a74b3[_0x3804('0x35')]=_0x4a74b3[_0x3804('0x35')][_0x3804('0x47')]?_0x4a74b3['attributes']:_0x4e68fe[_0x3804('0x34')];if(_0x1e333f[_0x3804('0x31')][_0x3804('0x42')]){_0x4a74b3[_0x3804('0x43')]=[{'all':!![]}];}_0x4a74b3=_[_0x3804('0x3f')]({},_0x4a74b3,_0x1e333f[_0x3804('0x41')]);return db[_0x3804('0x2b')][_0x3804('0x48')](_0x4a74b3)['then'](handleEntityNotFound(_0x4f7680,null))['then'](respondWithResult(_0x4f7680,null))['catch'](handleError(_0x4f7680,null));};exports[_0x3804('0x49')]=function(_0x596609,_0x192f32){return db[_0x3804('0x2b')][_0x3804('0x49')](_0x596609[_0x3804('0x4a')],{})['then'](respondWithResult(_0x192f32,0xc9))[_0x3804('0x4b')](handleError(_0x192f32,null));};exports[_0x3804('0x23')]=function(_0x42dd86,_0x1f2e3f){if(_0x42dd86[_0x3804('0x4a')]['id']){delete _0x42dd86[_0x3804('0x4a')]['id'];}return db[_0x3804('0x2b')][_0x3804('0x48')]({'where':{'id':_0x42dd86['params']['id']}})[_0x3804('0x24')](handleEntityNotFound(_0x1f2e3f,null))[_0x3804('0x24')](saveUpdates(_0x42dd86['body'],null))['then'](respondWithResult(_0x1f2e3f,null))['catch'](handleError(_0x1f2e3f,null));};exports[_0x3804('0x25')]=function(_0x11beb5,_0x5a0bed){return db['SquareDetailsReport'][_0x3804('0x48')]({'where':{'id':_0x11beb5['params']['id']}})['then'](handleEntityNotFound(_0x5a0bed,null))[_0x3804('0x24')](removeEntity(_0x5a0bed,null))[_0x3804('0x4b')](handleError(_0x5a0bed,null));};exports[_0x3804('0x4c')]=function(_0x1fca01,_0x3b7b9d){return db[_0x3804('0x2b')][_0x3804('0x4c')]()['then'](respondWithResult(_0x3b7b9d,null))[_0x3804('0x4b')](handleError(_0x3b7b9d,null));}; \ No newline at end of file +var _0x0de9=['options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','SquareDetailsReport','includeAll','include','findAll','then','show','params'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x0de9,0x13e));var _0x90de=function(_0x647584,_0x406759){_0x647584=_0x647584-0x0;var _0x1a33a8=_0x0de9[_0x647584];return _0x1a33a8;};'use strict';var emlformat=require(_0x90de('0x0'));var rimraf=require(_0x90de('0x1'));var zipdir=require(_0x90de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90de('0x3'));var moment=require(_0x90de('0x4'));var BPromise=require(_0x90de('0x5'));var Mustache=require('mustache');var util=require(_0x90de('0x6'));var path=require(_0x90de('0x7'));var sox=require(_0x90de('0x8'));var csv=require(_0x90de('0x9'));var ejs=require(_0x90de('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x90de('0xb'));var squel=require(_0x90de('0xc'));var crypto=require(_0x90de('0xd'));var jsforce=require(_0x90de('0xe'));var deskjs=require(_0x90de('0xf'));var toCsv=require(_0x90de('0x9'));var querystring=require(_0x90de('0x10'));var Papa=require(_0x90de('0x11'));var Redis=require(_0x90de('0x12'));var authService=require(_0x90de('0x13'));var qs=require(_0x90de('0x14'));var as=require(_0x90de('0x15'));var hardwareService=require(_0x90de('0x16'));var logger=require('../../config/logger')(_0x90de('0x17'));var utils=require(_0x90de('0x18'));var config=require(_0x90de('0x19'));var licenseUtil=require(_0x90de('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x66e6a5,_0x37875c){_0x37875c=_0x37875c||0xcc;return function(_0x5b44e9){if(_0x5b44e9){return _0x66e6a5[_0x90de('0x1b')](_0x37875c);}return _0x66e6a5[_0x90de('0x1c')](_0x37875c)[_0x90de('0x1d')]();};}function respondWithResult(_0x57af15,_0x4f748b){_0x4f748b=_0x4f748b||0xc8;return function(_0x497ac9){if(_0x497ac9){return _0x57af15[_0x90de('0x1c')](_0x4f748b)[_0x90de('0x1e')](_0x497ac9);}};}function respondWithFilteredResult(_0x4f0dc5,_0x2760f0){return function(_0x1b1094){if(_0x1b1094){var _0x49d529=typeof _0x2760f0[_0x90de('0x1f')]==='undefined'&&typeof _0x2760f0[_0x90de('0x20')]===_0x90de('0x21');var _0x4e8430=_0x1b1094[_0x90de('0x22')];var _0x5bb85b=_0x49d529?0x0:_0x2760f0[_0x90de('0x1f')];var _0x50ed1a=_0x49d529?_0x1b1094['count']:_0x2760f0[_0x90de('0x1f')]+_0x2760f0[_0x90de('0x20')];var _0x4775f7;if(_0x50ed1a>=_0x4e8430){_0x50ed1a=_0x4e8430;_0x4775f7=0xc8;}else{_0x4775f7=0xce;}_0x4f0dc5['status'](_0x4775f7);return _0x4f0dc5['set']('Content-Range',_0x5bb85b+'-'+_0x50ed1a+'/'+_0x4e8430)[_0x90de('0x1e')](_0x1b1094);}return null;};}function patchUpdates(_0x4feb16){return function(_0x5b327a){try{jsonpatch[_0x90de('0x23')](_0x5b327a,_0x4feb16,!![]);}catch(_0x47d1bc){return BPromise[_0x90de('0x24')](_0x47d1bc);}return _0x5b327a['save']();};}function saveUpdates(_0x34a056,_0x374b98){return function(_0x3d5976){if(_0x3d5976){return _0x3d5976[_0x90de('0x25')](_0x34a056)['then'](function(_0x26ae55){return _0x26ae55;});}return null;};}function removeEntity(_0x5054c2,_0x38544a){return function(_0x42ce33){if(_0x42ce33){return _0x42ce33[_0x90de('0x26')]()['then'](function(){_0x5054c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x218446,_0x24b066){return function(_0x32d9d6){if(!_0x32d9d6){_0x218446[_0x90de('0x1b')](0x194);}return _0x32d9d6;};}function handleError(_0x19354b,_0x38d661){_0x38d661=_0x38d661||0x1f4;return function(_0x300d7a){logger[_0x90de('0x27')](_0x300d7a[_0x90de('0x28')]);if(_0x300d7a[_0x90de('0x29')]){delete _0x300d7a[_0x90de('0x29')];}_0x19354b[_0x90de('0x1c')](_0x38d661)[_0x90de('0x2a')](_0x300d7a);};}exports[_0x90de('0x2b')]=function(_0x1bcd88,_0x29ed3d){var _0xe2687e={},_0x546b30={},_0x32eca3={'count':0x0,'rows':[]};var _0x493d9d=_[_0x90de('0x2c')](db['SquareDetailsReport'][_0x90de('0x2d')],function(_0xf1b73){return{'name':_0xf1b73[_0x90de('0x2e')],'type':_0xf1b73[_0x90de('0x2f')][_0x90de('0x30')]};});_0x546b30['model']=_[_0x90de('0x2c')](_0x493d9d,_0x90de('0x29'));_0x546b30[_0x90de('0x31')]=_[_0x90de('0x32')](_0x1bcd88[_0x90de('0x31')]);_0x546b30[_0x90de('0x33')]=_[_0x90de('0x34')](_0x546b30['model'],_0x546b30[_0x90de('0x31')]);_0xe2687e[_0x90de('0x35')]=_[_0x90de('0x34')](_0x546b30[_0x90de('0x36')],qs[_0x90de('0x37')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x37')]));_0xe2687e[_0x90de('0x35')]=_0xe2687e[_0x90de('0x35')][_0x90de('0x38')]?_0xe2687e[_0x90de('0x35')]:_0x546b30[_0x90de('0x36')];if(!_0x1bcd88[_0x90de('0x31')][_0x90de('0x39')](_0x90de('0x3a'))){_0xe2687e[_0x90de('0x20')]=qs[_0x90de('0x20')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x20')]);_0xe2687e['offset']=qs[_0x90de('0x1f')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x1f')]);}_0xe2687e[_0x90de('0x3b')]=qs[_0x90de('0x3c')](_0x1bcd88[_0x90de('0x31')][_0x90de('0x3c')]);_0xe2687e[_0x90de('0x3d')]=qs['filters'](_[_0x90de('0x3e')](_0x1bcd88[_0x90de('0x31')],_0x546b30[_0x90de('0x33')]),_0x493d9d);if(_0x1bcd88[_0x90de('0x31')]['filter']){_0xe2687e[_0x90de('0x3d')]=_[_0x90de('0x3f')](_0xe2687e[_0x90de('0x3d')],{'$or':_['map'](_0x493d9d,function(_0x4860b1){if(_0x4860b1[_0x90de('0x2f')]!=='VIRTUAL'){var _0x528487={};_0x528487[_0x4860b1[_0x90de('0x29')]]={'$like':'%'+_0x1bcd88[_0x90de('0x31')][_0x90de('0x40')]+'%'};return _0x528487;}})});}_0xe2687e=_[_0x90de('0x3f')]({},_0xe2687e,_0x1bcd88['options']);var _0x3eb960={'where':_0xe2687e[_0x90de('0x3d')]};return db[_0x90de('0x41')][_0x90de('0x22')](_0x3eb960)['then'](function(_0x284da9){_0x32eca3[_0x90de('0x22')]=_0x284da9;if(_0x1bcd88[_0x90de('0x31')][_0x90de('0x42')]){_0xe2687e[_0x90de('0x43')]=[{'all':!![]}];}return db[_0x90de('0x41')][_0x90de('0x44')](_0xe2687e);})['then'](function(_0x2f2369){_0x32eca3['rows']=_0x2f2369;return _0x32eca3;})[_0x90de('0x45')](respondWithFilteredResult(_0x29ed3d,_0xe2687e))['catch'](handleError(_0x29ed3d,null));};exports[_0x90de('0x46')]=function(_0x547729,_0x5558d6){var _0x458b1a={'raw':!![],'where':{'id':_0x547729[_0x90de('0x47')]['id']}},_0x16400e={};_0x16400e['model']=_['keys'](db[_0x90de('0x41')][_0x90de('0x2d')]);_0x16400e[_0x90de('0x31')]=_[_0x90de('0x32')](_0x547729[_0x90de('0x31')]);_0x16400e['filters']=_[_0x90de('0x34')](_0x16400e[_0x90de('0x36')],_0x16400e[_0x90de('0x31')]);_0x458b1a[_0x90de('0x35')]=_[_0x90de('0x34')](_0x16400e['model'],qs[_0x90de('0x37')](_0x547729['query'][_0x90de('0x37')]));_0x458b1a['attributes']=_0x458b1a[_0x90de('0x35')][_0x90de('0x38')]?_0x458b1a[_0x90de('0x35')]:_0x16400e['model'];if(_0x547729[_0x90de('0x31')][_0x90de('0x42')]){_0x458b1a[_0x90de('0x43')]=[{'all':!![]}];}_0x458b1a=_['merge']({},_0x458b1a,_0x547729[_0x90de('0x48')]);return db['SquareDetailsReport'][_0x90de('0x49')](_0x458b1a)[_0x90de('0x45')](handleEntityNotFound(_0x5558d6,null))[_0x90de('0x45')](respondWithResult(_0x5558d6,null))[_0x90de('0x4a')](handleError(_0x5558d6,null));};exports[_0x90de('0x4b')]=function(_0x49b88e,_0x5a004f){return db['SquareDetailsReport'][_0x90de('0x4b')](_0x49b88e[_0x90de('0x4c')],{})[_0x90de('0x45')](respondWithResult(_0x5a004f,0xc9))[_0x90de('0x4a')](handleError(_0x5a004f,null));};exports[_0x90de('0x25')]=function(_0x2ccce0,_0xaff0b3){if(_0x2ccce0[_0x90de('0x4c')]['id']){delete _0x2ccce0[_0x90de('0x4c')]['id'];}return db[_0x90de('0x41')]['find']({'where':{'id':_0x2ccce0[_0x90de('0x47')]['id']}})[_0x90de('0x45')](handleEntityNotFound(_0xaff0b3,null))['then'](saveUpdates(_0x2ccce0[_0x90de('0x4c')],null))[_0x90de('0x45')](respondWithResult(_0xaff0b3,null))[_0x90de('0x4a')](handleError(_0xaff0b3,null));};exports[_0x90de('0x26')]=function(_0x5ca674,_0x489454){return db['SquareDetailsReport'][_0x90de('0x49')]({'where':{'id':_0x5ca674[_0x90de('0x47')]['id']}})[_0x90de('0x45')](handleEntityNotFound(_0x489454,null))['then'](removeEntity(_0x489454,null))[_0x90de('0x4a')](handleError(_0x489454,null));};exports[_0x90de('0x4d')]=function(_0x537b58,_0x1b2838){return db[_0x90de('0x41')][_0x90de('0x4d')]()[_0x90de('0x45')](respondWithResult(_0x1b2838,null))['catch'](handleError(_0x1b2838,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3208627..e523804 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 _0x0e51=['SquareDetailsReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0e51,0x139));var _0x10e5=function(_0x345052,_0x446b04){_0x345052=_0x345052-0x0;var _0x4a173a=_0x0e51[_0x345052];return _0x4a173a;};'use strict';var _=require(_0x10e5('0x0'));var util=require(_0x10e5('0x1'));var logger=require('../../config/logger')(_0x10e5('0x2'));var moment=require(_0x10e5('0x3'));var BPromise=require(_0x10e5('0x4'));var rp=require(_0x10e5('0x5'));var fs=require('fs');var path=require(_0x10e5('0x6'));var rimraf=require(_0x10e5('0x7'));var config=require('../../config/environment');var attributes=require(_0x10e5('0x8'));module[_0x10e5('0x9')]=function(_0x30ff63,_0x1204a4){return _0x30ff63[_0x10e5('0xa')](_0x10e5('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf43a=['../../config/logger','moment','bluebird','path','rimraf','exports','SquareDetailsReport','report_square_details','lodash'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0xf43a,0xa1));var _0xaf43=function(_0x2d36b0,_0x3c3282){_0x2d36b0=_0x2d36b0-0x0;var _0x132b95=_0xf43a[_0x2d36b0];return _0x132b95;};'use strict';var _=require(_0xaf43('0x0'));var util=require('util');var logger=require(_0xaf43('0x1'))('api');var moment=require(_0xaf43('0x2'));var BPromise=require(_0xaf43('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf43('0x4'));var rimraf=require(_0xaf43('0x5'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xaf43('0x6')]=function(_0x2219b5,_0x2592c3){return _0x2219b5['define'](_0xaf43('0x7'),attributes,{'tableName':_0xaf43('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 215f024..f967a21 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 _0x6017=['http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x6017,0xae));var _0x7601=function(_0x5b0162,_0x18e8d5){_0x5b0162=_0x5b0162-0x0;var _0x5a2f3e=_0x6017[_0x5b0162];return _0x5a2f3e;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var moment=require(_0x7601('0x2'));var BPromise=require('bluebird');var rs=require(_0x7601('0x3'));var fs=require('fs');var Redis=require(_0x7601('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7601('0x5'));var logger=require('../../config/logger')(_0x7601('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7601('0x7')][_0x7601('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcb5ed9,_0x34a36d,_0x2bc643){return new BPromise(function(_0xe6e524,_0x4ff3e4){return client[_0x7601('0x9')](_0xcb5ed9,_0x2bc643)[_0x7601('0xa')](function(_0xd3a338){logger['info'](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));logger[_0x7601('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x34a36d,_0x7601('0xc'),JSON[_0x7601('0xe')](_0xd3a338));if(_0xd3a338[_0x7601('0xf')]){if(_0xd3a338[_0x7601('0xf')][_0x7601('0x10')]===0x1f4){logger[_0x7601('0xf')](_0x7601('0xb'),_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0x4ff3e4(_0xd3a338[_0x7601('0xf')]['message']);}logger[_0x7601('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x34a36d,_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);return _0xe6e524(_0xd3a338[_0x7601('0xf')][_0x7601('0x11')]);}else{logger[_0x7601('0x12')](_0x7601('0xb'),_0x34a36d,_0x7601('0xc'));_0xe6e524(_0xd3a338[_0x7601('0x13')][_0x7601('0x11')]);}})['catch'](function(_0xa0e556){logger[_0x7601('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x34a36d,_0xa0e556);_0x4ff3e4(_0xa0e556);});});}exports[_0x7601('0x14')]=function(_0x5c3fb7){var _0x5f530e=this;return new Promise(function(_0x22520e,_0x403e38){return db[_0x7601('0x15')][_0x7601('0x16')](_0x5c3fb7[_0x7601('0x17')],{'raw':_0x5c3fb7[_0x7601('0x18')]?_0x5c3fb7[_0x7601('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7601('0xa')](function(_0x1d58c0){logger['info'](_0x7601('0x14'),_0x5c3fb7);logger[_0x7601('0xd')](_0x7601('0x14'),_0x5c3fb7,JSON[_0x7601('0xe')](_0x1d58c0));_0x22520e(_0x1d58c0);})[_0x7601('0x19')](function(_0x12f3f6){logger['error'](_0x7601('0x14'),_0x12f3f6[_0x7601('0x11')],_0x5c3fb7);_0x403e38(_0x5f530e[_0x7601('0xf')](0x1f4,_0x12f3f6[_0x7601('0x11')]));});});}; \ No newline at end of file +var _0x34b7=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0xbf1875,_0x34b144){var _0x2e598b=function(_0xd104ec){while(--_0xd104ec){_0xbf1875['push'](_0xbf1875['shift']());}};_0x2e598b(++_0x34b144);}(_0x34b7,0x196));var _0x734b=function(_0x1a2581,_0x44dab6){_0x1a2581=_0x1a2581-0x0;var _0x21ef3e=_0x34b7[_0x1a2581];return _0x21ef3e;};'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')]('SquareDetailsReport,\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')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateSquareDetailsReport',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 7cadaad..3e067ec 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 _0x2b20=['express','Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x593800,_0x35f6b0){var _0x5a2a1a=function(_0x3f28fe){while(--_0x3f28fe){_0x593800['push'](_0x593800['shift']());}};_0x5a2a1a(++_0x35f6b0);}(_0x2b20,0x157));var _0x02b2=function(_0x15d1f7,_0x567bba){_0x15d1f7=_0x15d1f7-0x0;var _0x318629=_0x2b20[_0x15d1f7];return _0x318629;};'use strict';var express=require(_0x02b2('0x0'));var router=express[_0x02b2('0x1')]();var auth=require(_0x02b2('0x2'));var controller=require('./system.controller');router[_0x02b2('0x3')]('/',auth[_0x02b2('0x4')](),controller['index']);router[_0x02b2('0x3')](_0x02b2('0x5'),auth[_0x02b2('0x4')](),controller[_0x02b2('0x6')]);module['exports']=router; \ No newline at end of file +var _0x7b22=['/process/:pid/kill','killProcess','exports','./system.controller','isAuthenticated','get'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x7b22,0x93));var _0x27b2=function(_0xca1091,_0x539dbf){_0xca1091=_0xca1091-0x0;var _0xd3019c=_0x7b22[_0xca1091];return _0xd3019c;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x27b2('0x0'));router['get']('/',auth[_0x27b2('0x1')](),controller['index']);router[_0x27b2('0x2')](_0x27b2('0x3'),auth[_0x27b2('0x1')](),controller[_0x27b2('0x4')]);module[_0x27b2('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index e1dbbc1..a0bfe44 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 _0x6ae1=['then','status','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','inspect','name','index','getAllData'];(function(_0x288478,_0x312057){var _0x29e45d=function(_0x331ea5){while(--_0x331ea5){_0x288478['push'](_0x288478['shift']());}};_0x29e45d(++_0x312057);}(_0x6ae1,0x184));var _0x16ae=function(_0x233253,_0x6670f8){_0x233253=_0x233253-0x0;var _0x34a475=_0x6ae1[_0x233253];return _0x34a475;};'use strict';var info=require(_0x16ae('0x0'));var exec=require(_0x16ae('0x1'))[_0x16ae('0x2')];var logger=require(_0x16ae('0x3'))(_0x16ae('0x4'));var util=require(_0x16ae('0x5'));var BPromise=require(_0x16ae('0x6'));var _=require('lodash');function handleError(_0x86717d,_0x13ace9,_0x2dabd5){_0x13ace9=_0x13ace9||0x1f4;return function(_0x274d57){logger[_0x16ae('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2dabd5,_0x13ace9,util[_0x16ae('0x8')](_0x274d57,{'showHidden':![],'depth':null}));delete _0x274d57[_0x16ae('0x9')];_0x86717d['status'](_0x13ace9)['send'](_0x274d57);};}exports[_0x16ae('0xa')]=function(_0x22f9c4,_0x22e1a5){return info[_0x16ae('0xb')]()[_0x16ae('0xc')](function(_0x5f49c8){return _0x22e1a5[_0x16ae('0xd')](0xc8)[_0x16ae('0xe')](_0x5f49c8);})[_0x16ae('0xf')](function(_0x54eba2){return _0x22e1a5[_0x16ae('0xd')](0x1f4)[_0x16ae('0xe')](_0x54eba2);});};exports['killProcess']=function(_0x295b41,_0x27f498){var _0x5b27b2=[_0x16ae('0x10')];return new BPromise(function(_0xfff359,_0x288fb7){return exec(util[_0x16ae('0x11')](_0x16ae('0x12'),_0x295b41[_0x16ae('0x13')][_0x16ae('0x14')]),function(_0x581f20,_0x1affe7,_0x20a899){if(_0x581f20){return _0x288fb7(_0x581f20);}return _0xfff359(_0x1affe7);});})[_0x16ae('0xc')](function(_0x2428e5){var _0x5b97da=![];var _0x43bb4f=_0x2428e5['split'](/\n/);for(var _0x423e21=0x0,_0x1a422c=_0x5b27b2[_0x16ae('0x15')];_0x423e21<_0x1a422c,_0x5b97da===![];_0x423e21+=0x1){if(_0x2428e5['indexOf'](_0x5b27b2[_0x423e21])>=0x0){_0x5b97da=!![];}}if(!_0x5b97da){throw new Error(util['format'](_0x16ae('0x16'),_0x295b41[_0x16ae('0x13')][_0x16ae('0x14')]));}process[_0x16ae('0x17')](_0x295b41[_0x16ae('0x13')][_0x16ae('0x14')],_0x16ae('0x18'));return _0x27f498[_0x16ae('0xd')](0xc8)[_0x16ae('0xe')]({'message':util[_0x16ae('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x295b41['params']['pid'])});})[_0x16ae('0xf')](handleError(_0x27f498,null,'killProcess'));}; \ No newline at end of file +var _0x554b=['format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','index','getAllData','then','status','json','killProcess'];(function(_0x527ebf,_0x3bb310){var _0x5bb3a1=function(_0x49482e){while(--_0x49482e){_0x527ebf['push'](_0x527ebf['shift']());}};_0x5bb3a1(++_0x3bb310);}(_0x554b,0x72));var _0xb554=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x554b[_0x48999d];return _0x1ad0d1;};'use strict';var info=require(_0xb554('0x0'));var exec=require(_0xb554('0x1'))[_0xb554('0x2')];var logger=require('../../config/logger')(_0xb554('0x3'));var util=require('util');var BPromise=require(_0xb554('0x4'));var _=require(_0xb554('0x5'));function handleError(_0x35b2dd,_0x8190c0,_0x450be8){_0x8190c0=_0x8190c0||0x1f4;return function(_0x57153c){logger[_0xb554('0x6')](_0xb554('0x7'),_0x450be8,_0x8190c0,util['inspect'](_0x57153c,{'showHidden':![],'depth':null}));delete _0x57153c[_0xb554('0x8')];_0x35b2dd['status'](_0x8190c0)[_0xb554('0x9')](_0x57153c);};}exports[_0xb554('0xa')]=function(_0x20986a,_0x575ed5){return info[_0xb554('0xb')]()[_0xb554('0xc')](function(_0x307d28){return _0x575ed5[_0xb554('0xd')](0xc8)['json'](_0x307d28);})['catch'](function(_0x172144){return _0x575ed5[_0xb554('0xd')](0x1f4)[_0xb554('0xe')](_0x172144);});};exports[_0xb554('0xf')]=function(_0x31c6ce,_0x2ab9ca){var _0xd44fc2=['components/import/cm'];return new BPromise(function(_0x58fa99,_0x40378a){return exec(util[_0xb554('0x10')](_0xb554('0x11'),_0x31c6ce['params'][_0xb554('0x12')]),function(_0x505ee9,_0x3acbc7,_0x4c4779){if(_0x505ee9){return _0x40378a(_0x505ee9);}return _0x58fa99(_0x3acbc7);});})[_0xb554('0xc')](function(_0x294f7c){var _0x326f69=![];var _0x920dd3=_0x294f7c['split'](/\n/);for(var _0x437d89=0x0,_0x453022=_0xd44fc2[_0xb554('0x13')];_0x437d89<_0x453022,_0x326f69===![];_0x437d89+=0x1){if(_0x294f7c['indexOf'](_0xd44fc2[_0x437d89])>=0x0){_0x326f69=!![];}}if(!_0x326f69){throw new Error(util[_0xb554('0x10')](_0xb554('0x14'),_0x31c6ce[_0xb554('0x15')][_0xb554('0x12')]));}process[_0xb554('0x16')](_0x31c6ce['params']['pid'],_0xb554('0x17'));return _0x2ab9ca[_0xb554('0xd')](0xc8)[_0xb554('0xe')]({'message':util[_0xb554('0x10')](_0xb554('0x18'),_0x31c6ce['params']['pid'])});})[_0xb554('0x19')](handleError(_0x2ab9ca,null,_0xb554('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 33fb81e..110a9b3 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 _0x164b=['/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','get','show','create','put'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x164b,0x157));var _0xb164=function(_0x2b3906,_0x2f2e4d){_0x2b3906=_0x2b3906-0x0;var _0x140825=_0x164b[_0x2b3906];return _0x140825;};'use strict';var multer=require(_0xb164('0x0'));var util=require(_0xb164('0x1'));var path=require('path');var timeout=require(_0xb164('0x2'));var express=require(_0xb164('0x3'));var router=express[_0xb164('0x4')]();var fs_extra=require(_0xb164('0x5'));var auth=require(_0xb164('0x6'));var interaction=require(_0xb164('0x7'));var config=require('../../config/environment');var controller=require(_0xb164('0x8'));router['get']('/',auth[_0xb164('0x9')](),controller['index']);router[_0xb164('0xa')]('/:id',auth[_0xb164('0x9')](),controller[_0xb164('0xb')]);router['post']('/',auth[_0xb164('0x9')](),controller[_0xb164('0xc')]);router[_0xb164('0xd')](_0xb164('0xe'),auth[_0xb164('0x9')](),controller['update']);router[_0xb164('0xf')](_0xb164('0xe'),auth[_0xb164('0x9')](),controller[_0xb164('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1675=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x3abf9a,_0x3d71df){var _0x1de11b=function(_0x593c77){while(--_0x593c77){_0x3abf9a['push'](_0x3abf9a['shift']());}};_0x1de11b(++_0x3d71df);}(_0x1675,0x1a4));var _0x5167=function(_0x59291b,_0x5e7125){_0x59291b=_0x59291b-0x0;var _0x3ff71e=_0x1675[_0x59291b];return _0x3ff71e;};'use strict';var multer=require(_0x5167('0x0'));var util=require(_0x5167('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5167('0x2')]();var fs_extra=require(_0x5167('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5167('0x4'));var config=require(_0x5167('0x5'));var controller=require('./tag.controller');router[_0x5167('0x6')]('/',auth[_0x5167('0x7')](),controller[_0x5167('0x8')]);router['get'](_0x5167('0x9'),auth[_0x5167('0x7')](),controller[_0x5167('0xa')]);router[_0x5167('0xb')]('/',auth[_0x5167('0x7')](),controller[_0x5167('0xc')]);router[_0x5167('0xd')](_0x5167('0x9'),auth[_0x5167('0x7')](),controller[_0x5167('0xe')]);router[_0x5167('0xf')](_0x5167('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5167('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index dbb6892..592eb39 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 _0x823c=['STRING','name','#0091EA','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x823c,0x143));var _0xc823=function(_0x3744b4,_0x10eb87){_0x3744b4=_0x3744b4-0x0;var _0x46d227=_0x823c[_0x3744b4];return _0x46d227;};'use strict';var Sequelize=require(_0xc823('0x0'));module['exports']={'name':{'type':Sequelize[_0xc823('0x1')],'unique':_0xc823('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc823('0x1')],'defaultValue':_0xc823('0x3')},'description':{'type':Sequelize[_0xc823('0x1')]}}; \ No newline at end of file +var _0xc686=['STRING'];(function(_0x314328,_0x235c73){var _0x5001de=function(_0x3daab3){while(--_0x3daab3){_0x314328['push'](_0x314328['shift']());}};_0x5001de(++_0x235c73);}(_0xc686,0x148));var _0x6c68=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xc686[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c68('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6c68('0x0')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x6c68('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d0082e0..2996d39 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 _0x26c2=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../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','then','destroy','UserProfileResource','error','name','send','index','map','Tag','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x28294a,_0x542642){var _0x3bef7d=function(_0x2229f4){while(--_0x2229f4){_0x28294a['push'](_0x28294a['shift']());}};_0x3bef7d(++_0x542642);}(_0x26c2,0x130));var _0x226c=function(_0x252f69,_0x12eec4){_0x252f69=_0x252f69-0x0;var _0x378d8a=_0x26c2[_0x252f69];return _0x378d8a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x226c('0x0'));var rp=require(_0x226c('0x1'));var moment=require(_0x226c('0x2'));var BPromise=require(_0x226c('0x3'));var Mustache=require('mustache');var util=require(_0x226c('0x4'));var path=require(_0x226c('0x5'));var sox=require('sox');var csv=require(_0x226c('0x6'));var ejs=require(_0x226c('0x7'));var fs=require('fs');var fs_extra=require(_0x226c('0x8'));var _=require(_0x226c('0x9'));var squel=require(_0x226c('0xa'));var crypto=require('crypto');var jsforce=require(_0x226c('0xb'));var deskjs=require(_0x226c('0xc'));var toCsv=require(_0x226c('0x6'));var querystring=require(_0x226c('0xd'));var Papa=require(_0x226c('0xe'));var Redis=require('ioredis');var authService=require(_0x226c('0xf'));var qs=require(_0x226c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x226c('0x11'))(_0x226c('0x12'));var utils=require(_0x226c('0x13'));var config=require(_0x226c('0x14'));var licenseUtil=require(_0x226c('0x15'));var db=require(_0x226c('0x16'))['db'];function respondWithStatusCode(_0x2964c2,_0x57dbc4){_0x57dbc4=_0x57dbc4||0xcc;return function(_0x481496){if(_0x481496){return _0x2964c2[_0x226c('0x17')](_0x57dbc4);}return _0x2964c2[_0x226c('0x18')](_0x57dbc4)[_0x226c('0x19')]();};}function respondWithResult(_0x36af55,_0x4eb557){_0x4eb557=_0x4eb557||0xc8;return function(_0x4bfd5c){if(_0x4bfd5c){return _0x36af55[_0x226c('0x18')](_0x4eb557)[_0x226c('0x1a')](_0x4bfd5c);}};}function respondWithFilteredResult(_0x15e13b,_0x55697c){return function(_0x5d6c21){if(_0x5d6c21){var _0x694eef=typeof _0x55697c[_0x226c('0x1b')]===_0x226c('0x1c')&&typeof _0x55697c[_0x226c('0x1d')]===_0x226c('0x1c');var _0x4832f5=_0x5d6c21['count'];var _0x5989e0=_0x694eef?0x0:_0x55697c[_0x226c('0x1b')];var _0x813b69=_0x694eef?_0x5d6c21[_0x226c('0x1e')]:_0x55697c[_0x226c('0x1b')]+_0x55697c['limit'];var _0x7fc168;if(_0x813b69>=_0x4832f5){_0x813b69=_0x4832f5;_0x7fc168=0xc8;}else{_0x7fc168=0xce;}_0x15e13b[_0x226c('0x18')](_0x7fc168);return _0x15e13b[_0x226c('0x1f')](_0x226c('0x20'),_0x5989e0+'-'+_0x813b69+'/'+_0x4832f5)[_0x226c('0x1a')](_0x5d6c21);}return null;};}function patchUpdates(_0x3d412a){return function(_0x4dabf3){try{jsonpatch[_0x226c('0x21')](_0x4dabf3,_0x3d412a,!![]);}catch(_0x34253b){return BPromise[_0x226c('0x22')](_0x34253b);}return _0x4dabf3[_0x226c('0x23')]();};}function saveUpdates(_0x272f26,_0x57eb9f){return function(_0x575c7a){if(_0x575c7a){return _0x575c7a['update'](_0x272f26)[_0x226c('0x24')](function(_0x52985c){return _0x52985c;});}return null;};}function removeEntity(_0x4da72c,_0xbaee21){return function(_0x5b3919){if(_0x5b3919){return _0x5b3919[_0x226c('0x25')]()[_0x226c('0x24')](function(){var _0x2a570a=_0x5b3919['get']({'plain':!![]});var _0x25165d='Tags';return db[_0x226c('0x26')]['destroy']({'where':{'type':_0x25165d,'resourceId':_0x2a570a['id']}})[_0x226c('0x24')](function(){return _0x5b3919;});})[_0x226c('0x24')](function(){_0x4da72c[_0x226c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c49b,_0x4a0b38){return function(_0xbe7c35){if(!_0xbe7c35){_0x14c49b['sendStatus'](0x194);}return _0xbe7c35;};}function handleError(_0x431875,_0x539e59){_0x539e59=_0x539e59||0x1f4;return function(_0x40a095){logger[_0x226c('0x27')](_0x40a095['stack']);if(_0x40a095['name']){delete _0x40a095[_0x226c('0x28')];}_0x431875[_0x226c('0x18')](_0x539e59)[_0x226c('0x29')](_0x40a095);};}exports[_0x226c('0x2a')]=function(_0x1e78f5,_0x253aeb){var _0x2ff83b={},_0x3a28d8={},_0x5fdaf5={'count':0x0,'rows':[]};var _0x1bd25d=_[_0x226c('0x2b')](db[_0x226c('0x2c')]['rawAttributes'],function(_0xabaf14){return{'name':_0xabaf14[_0x226c('0x2d')],'type':_0xabaf14[_0x226c('0x2e')][_0x226c('0x2f')]};});_0x3a28d8[_0x226c('0x30')]=_['map'](_0x1bd25d,_0x226c('0x28'));_0x3a28d8[_0x226c('0x31')]=_[_0x226c('0x32')](_0x1e78f5['query']);_0x3a28d8[_0x226c('0x33')]=_['intersection'](_0x3a28d8[_0x226c('0x30')],_0x3a28d8[_0x226c('0x31')]);_0x2ff83b[_0x226c('0x34')]=_[_0x226c('0x35')](_0x3a28d8[_0x226c('0x30')],qs[_0x226c('0x36')](_0x1e78f5[_0x226c('0x31')][_0x226c('0x36')]));_0x2ff83b[_0x226c('0x34')]=_0x2ff83b[_0x226c('0x34')][_0x226c('0x37')]?_0x2ff83b[_0x226c('0x34')]:_0x3a28d8[_0x226c('0x30')];if(!_0x1e78f5[_0x226c('0x31')]['hasOwnProperty'](_0x226c('0x38'))){_0x2ff83b[_0x226c('0x1d')]=qs[_0x226c('0x1d')](_0x1e78f5[_0x226c('0x31')][_0x226c('0x1d')]);_0x2ff83b[_0x226c('0x1b')]=qs[_0x226c('0x1b')](_0x1e78f5[_0x226c('0x31')][_0x226c('0x1b')]);}_0x2ff83b['order']=qs['sort'](_0x1e78f5[_0x226c('0x31')][_0x226c('0x39')]);_0x2ff83b[_0x226c('0x3a')]=qs[_0x226c('0x33')](_[_0x226c('0x3b')](_0x1e78f5[_0x226c('0x31')],_0x3a28d8[_0x226c('0x33')]),_0x1bd25d);if(_0x1e78f5[_0x226c('0x31')][_0x226c('0x3c')]){_0x2ff83b['where']=_[_0x226c('0x3d')](_0x2ff83b['where'],{'$or':_[_0x226c('0x2b')](_0x1bd25d,function(_0x1a7d0d){if(_0x1a7d0d[_0x226c('0x2e')]!=='VIRTUAL'){var _0x507aa8={};_0x507aa8[_0x1a7d0d[_0x226c('0x28')]]={'$like':'%'+_0x1e78f5[_0x226c('0x31')]['filter']+'%'};return _0x507aa8;}})});}_0x2ff83b=_[_0x226c('0x3d')]({},_0x2ff83b,_0x1e78f5[_0x226c('0x3e')]);var _0x190605={'where':_0x2ff83b[_0x226c('0x3a')]};return db['Tag'][_0x226c('0x1e')](_0x190605)[_0x226c('0x24')](function(_0x12f34d){_0x5fdaf5['count']=_0x12f34d;if(_0x1e78f5[_0x226c('0x31')][_0x226c('0x3f')]){_0x2ff83b[_0x226c('0x40')]=[{'all':!![]}];}return db[_0x226c('0x2c')][_0x226c('0x41')](_0x2ff83b);})['then'](function(_0x5ea01f){_0x5fdaf5['rows']=_0x5ea01f;return _0x5fdaf5;})[_0x226c('0x24')](respondWithFilteredResult(_0x253aeb,_0x2ff83b))[_0x226c('0x42')](handleError(_0x253aeb,null));};exports[_0x226c('0x43')]=function(_0x17e1a8,_0x345514){var _0x3145f4={'raw':!![],'where':{'id':_0x17e1a8[_0x226c('0x44')]['id']}},_0x16ae23={};_0x16ae23[_0x226c('0x30')]=_['keys'](db['Tag'][_0x226c('0x45')]);_0x16ae23[_0x226c('0x31')]=_['keys'](_0x17e1a8[_0x226c('0x31')]);_0x16ae23['filters']=_['intersection'](_0x16ae23[_0x226c('0x30')],_0x16ae23['query']);_0x3145f4[_0x226c('0x34')]=_[_0x226c('0x35')](_0x16ae23[_0x226c('0x30')],qs[_0x226c('0x36')](_0x17e1a8[_0x226c('0x31')][_0x226c('0x36')]));_0x3145f4['attributes']=_0x3145f4[_0x226c('0x34')]['length']?_0x3145f4[_0x226c('0x34')]:_0x16ae23[_0x226c('0x30')];if(_0x17e1a8[_0x226c('0x31')][_0x226c('0x3f')]){_0x3145f4['include']=[{'all':!![]}];}_0x3145f4=_[_0x226c('0x3d')]({},_0x3145f4,_0x17e1a8['options']);return db[_0x226c('0x2c')][_0x226c('0x46')](_0x3145f4)[_0x226c('0x24')](handleEntityNotFound(_0x345514,null))[_0x226c('0x24')](respondWithResult(_0x345514,null))[_0x226c('0x42')](handleError(_0x345514,null));};exports[_0x226c('0x47')]=function(_0x4f99f5,_0x21c046){return db[_0x226c('0x2c')][_0x226c('0x47')](_0x4f99f5[_0x226c('0x48')],{})[_0x226c('0x24')](function(_0x27ccb8){var _0xfa1394=_0x4f99f5[_0x226c('0x49')][_0x226c('0x4a')]({'plain':!![]});if(!_0xfa1394)throw new Error(_0x226c('0x4b'));if(_0xfa1394[_0x226c('0x4c')]===_0x226c('0x49')){var _0x5f3434=_0x27ccb8['get']({'plain':!![]});var _0x486510=_0x226c('0x4d');return db[_0x226c('0x4e')][_0x226c('0x46')]({'where':{'name':_0x486510,'userProfileId':_0xfa1394['userProfileId']},'raw':!![]})[_0x226c('0x24')](function(_0x42710d){if(_0x42710d&&_0x42710d['autoAssociation']===0x0){return db[_0x226c('0x26')][_0x226c('0x47')]({'name':_0x5f3434[_0x226c('0x28')],'resourceId':_0x5f3434['id'],'type':_0x42710d[_0x226c('0x28')],'sectionId':_0x42710d['id']},{})[_0x226c('0x24')](function(){return _0x27ccb8;});}else{return _0x27ccb8;}})[_0x226c('0x42')](function(_0x3e60bf){logger[_0x226c('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e60bf);throw _0x3e60bf;});}return _0x27ccb8;})[_0x226c('0x24')](respondWithResult(_0x21c046,0xc9))[_0x226c('0x42')](handleError(_0x21c046,null));};exports['update']=function(_0x3b902a,_0x3e5304){if(_0x3b902a[_0x226c('0x48')]['id']){delete _0x3b902a[_0x226c('0x48')]['id'];}return db[_0x226c('0x2c')][_0x226c('0x46')]({'where':{'id':_0x3b902a['params']['id']}})[_0x226c('0x24')](handleEntityNotFound(_0x3e5304,null))['then'](saveUpdates(_0x3b902a['body'],null))[_0x226c('0x24')](respondWithResult(_0x3e5304,null))[_0x226c('0x42')](handleError(_0x3e5304,null));};exports['destroy']=function(_0x3861be,_0x17cfc1){return db[_0x226c('0x2c')]['find']({'where':{'id':_0x3861be[_0x226c('0x44')]['id']}})[_0x226c('0x24')](handleEntityNotFound(_0x17cfc1,null))[_0x226c('0x24')](removeEntity(_0x17cfc1,null))[_0x226c('0x42')](handleError(_0x17cfc1,null));}; \ No newline at end of file +var _0xadb8=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','Tag','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','filter','includeAll','include','params','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x2ffccf,_0x50010b){var _0x246666=function(_0x39f658){while(--_0x39f658){_0x2ffccf['push'](_0x2ffccf['shift']());}};_0x246666(++_0x50010b);}(_0xadb8,0x1d0));var _0x8adb=function(_0x332a78,_0x4d38b3){_0x332a78=_0x332a78-0x0;var _0x537ac5=_0xadb8[_0x332a78];return _0x537ac5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8adb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8adb('0x1'));var moment=require(_0x8adb('0x2'));var BPromise=require(_0x8adb('0x3'));var Mustache=require(_0x8adb('0x4'));var util=require(_0x8adb('0x5'));var path=require(_0x8adb('0x6'));var sox=require(_0x8adb('0x7'));var csv=require('to-csv');var ejs=require(_0x8adb('0x8'));var fs=require('fs');var fs_extra=require(_0x8adb('0x9'));var _=require(_0x8adb('0xa'));var squel=require(_0x8adb('0xb'));var crypto=require(_0x8adb('0xc'));var jsforce=require(_0x8adb('0xd'));var deskjs=require(_0x8adb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8adb('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8adb('0x10'));var logger=require(_0x8adb('0x11'))(_0x8adb('0x12'));var utils=require(_0x8adb('0x13'));var config=require(_0x8adb('0x14'));var licenseUtil=require(_0x8adb('0x15'));var db=require(_0x8adb('0x16'))['db'];function respondWithStatusCode(_0x2828f1,_0x2d6b55){_0x2d6b55=_0x2d6b55||0xcc;return function(_0x8c6c39){if(_0x8c6c39){return _0x2828f1['sendStatus'](_0x2d6b55);}return _0x2828f1['status'](_0x2d6b55)['end']();};}function respondWithResult(_0x122b37,_0x4ff3c3){_0x4ff3c3=_0x4ff3c3||0xc8;return function(_0xe9280c){if(_0xe9280c){return _0x122b37[_0x8adb('0x17')](_0x4ff3c3)[_0x8adb('0x18')](_0xe9280c);}};}function respondWithFilteredResult(_0x52e1d9,_0x20add0){return function(_0x117054){if(_0x117054){var _0x1096fb=typeof _0x20add0[_0x8adb('0x19')]===_0x8adb('0x1a')&&typeof _0x20add0[_0x8adb('0x1b')]==='undefined';var _0xc01052=_0x117054[_0x8adb('0x1c')];var _0x4ba298=_0x1096fb?0x0:_0x20add0['offset'];var _0x18897e=_0x1096fb?_0x117054[_0x8adb('0x1c')]:_0x20add0[_0x8adb('0x19')]+_0x20add0[_0x8adb('0x1b')];var _0x46bce0;if(_0x18897e>=_0xc01052){_0x18897e=_0xc01052;_0x46bce0=0xc8;}else{_0x46bce0=0xce;}_0x52e1d9[_0x8adb('0x17')](_0x46bce0);return _0x52e1d9[_0x8adb('0x1d')](_0x8adb('0x1e'),_0x4ba298+'-'+_0x18897e+'/'+_0xc01052)[_0x8adb('0x18')](_0x117054);}return null;};}function patchUpdates(_0x2a322d){return function(_0x36c62a){try{jsonpatch[_0x8adb('0x1f')](_0x36c62a,_0x2a322d,!![]);}catch(_0x4a1a84){return BPromise['reject'](_0x4a1a84);}return _0x36c62a[_0x8adb('0x20')]();};}function saveUpdates(_0x3d37db,_0x4f33e7){return function(_0x37b0a4){if(_0x37b0a4){return _0x37b0a4[_0x8adb('0x21')](_0x3d37db)[_0x8adb('0x22')](function(_0x184c2a){return _0x184c2a;});}return null;};}function removeEntity(_0x11c2e8,_0x28d5cd){return function(_0x542156){if(_0x542156){return _0x542156[_0x8adb('0x23')]()[_0x8adb('0x22')](function(){var _0x234ef2=_0x542156['get']({'plain':!![]});var _0x5c8c18=_0x8adb('0x24');return db[_0x8adb('0x25')][_0x8adb('0x23')]({'where':{'type':_0x5c8c18,'resourceId':_0x234ef2['id']}})[_0x8adb('0x22')](function(){return _0x542156;});})[_0x8adb('0x22')](function(){_0x11c2e8['status'](0xcc)[_0x8adb('0x26')]();});}};}function handleEntityNotFound(_0x16f724,_0x18f94e){return function(_0x44f242){if(!_0x44f242){_0x16f724[_0x8adb('0x27')](0x194);}return _0x44f242;};}function handleError(_0x4aca77,_0x3faee9){_0x3faee9=_0x3faee9||0x1f4;return function(_0x5c5a7b){logger[_0x8adb('0x28')](_0x5c5a7b[_0x8adb('0x29')]);if(_0x5c5a7b[_0x8adb('0x2a')]){delete _0x5c5a7b[_0x8adb('0x2a')];}_0x4aca77['status'](_0x3faee9)[_0x8adb('0x2b')](_0x5c5a7b);};}exports['index']=function(_0x2c582b,_0x1ac23e){var _0x12f552={},_0x13a887={},_0x56f8a4={'count':0x0,'rows':[]};var _0x279cd8=_['map'](db[_0x8adb('0x2c')]['rawAttributes'],function(_0x1d4962){return{'name':_0x1d4962[_0x8adb('0x2d')],'type':_0x1d4962[_0x8adb('0x2e')][_0x8adb('0x2f')]};});_0x13a887[_0x8adb('0x30')]=_[_0x8adb('0x31')](_0x279cd8,'name');_0x13a887['query']=_[_0x8adb('0x32')](_0x2c582b[_0x8adb('0x33')]);_0x13a887[_0x8adb('0x34')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],_0x13a887[_0x8adb('0x33')]);_0x12f552[_0x8adb('0x36')]=_[_0x8adb('0x35')](_0x13a887[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x37')]));_0x12f552[_0x8adb('0x36')]=_0x12f552['attributes'][_0x8adb('0x38')]?_0x12f552[_0x8adb('0x36')]:_0x13a887['model'];if(!_0x2c582b[_0x8adb('0x33')]['hasOwnProperty'](_0x8adb('0x39'))){_0x12f552[_0x8adb('0x1b')]=qs[_0x8adb('0x1b')](_0x2c582b[_0x8adb('0x33')][_0x8adb('0x1b')]);_0x12f552['offset']=qs[_0x8adb('0x19')](_0x2c582b['query'][_0x8adb('0x19')]);}_0x12f552[_0x8adb('0x3a')]=qs['sort'](_0x2c582b[_0x8adb('0x33')]['sort']);_0x12f552[_0x8adb('0x3b')]=qs['filters'](_[_0x8adb('0x3c')](_0x2c582b[_0x8adb('0x33')],_0x13a887[_0x8adb('0x34')]),_0x279cd8);if(_0x2c582b['query']['filter']){_0x12f552[_0x8adb('0x3b')]=_[_0x8adb('0x3d')](_0x12f552['where'],{'$or':_[_0x8adb('0x31')](_0x279cd8,function(_0x13589b){if(_0x13589b[_0x8adb('0x2e')]!==_0x8adb('0x3e')){var _0x922b58={};_0x922b58[_0x13589b[_0x8adb('0x2a')]]={'$like':'%'+_0x2c582b[_0x8adb('0x33')][_0x8adb('0x3f')]+'%'};return _0x922b58;}})});}_0x12f552=_['merge']({},_0x12f552,_0x2c582b['options']);var _0x3f69b3={'where':_0x12f552[_0x8adb('0x3b')]};return db[_0x8adb('0x2c')][_0x8adb('0x1c')](_0x3f69b3)['then'](function(_0x29d16d){_0x56f8a4['count']=_0x29d16d;if(_0x2c582b[_0x8adb('0x33')][_0x8adb('0x40')]){_0x12f552[_0x8adb('0x41')]=[{'all':!![]}];}return db[_0x8adb('0x2c')]['findAll'](_0x12f552);})['then'](function(_0x213c23){_0x56f8a4['rows']=_0x213c23;return _0x56f8a4;})[_0x8adb('0x22')](respondWithFilteredResult(_0x1ac23e,_0x12f552))['catch'](handleError(_0x1ac23e,null));};exports['show']=function(_0x18984a,_0x24feeb){var _0x5061d9={'raw':!![],'where':{'id':_0x18984a[_0x8adb('0x42')]['id']}},_0x3fb9e0={};_0x3fb9e0[_0x8adb('0x30')]=_[_0x8adb('0x32')](db[_0x8adb('0x2c')]['rawAttributes']);_0x3fb9e0[_0x8adb('0x33')]=_['keys'](_0x18984a[_0x8adb('0x33')]);_0x3fb9e0[_0x8adb('0x34')]=_['intersection'](_0x3fb9e0['model'],_0x3fb9e0[_0x8adb('0x33')]);_0x5061d9['attributes']=_[_0x8adb('0x35')](_0x3fb9e0[_0x8adb('0x30')],qs[_0x8adb('0x37')](_0x18984a[_0x8adb('0x33')]['fields']));_0x5061d9[_0x8adb('0x36')]=_0x5061d9[_0x8adb('0x36')]['length']?_0x5061d9['attributes']:_0x3fb9e0[_0x8adb('0x30')];if(_0x18984a[_0x8adb('0x33')][_0x8adb('0x40')]){_0x5061d9['include']=[{'all':!![]}];}_0x5061d9=_[_0x8adb('0x3d')]({},_0x5061d9,_0x18984a[_0x8adb('0x43')]);return db[_0x8adb('0x2c')][_0x8adb('0x44')](_0x5061d9)[_0x8adb('0x22')](handleEntityNotFound(_0x24feeb,null))[_0x8adb('0x22')](respondWithResult(_0x24feeb,null))[_0x8adb('0x45')](handleError(_0x24feeb,null));};exports[_0x8adb('0x46')]=function(_0xc2861b,_0xe725e9){return db[_0x8adb('0x2c')][_0x8adb('0x46')](_0xc2861b['body'],{})[_0x8adb('0x22')](function(_0x33c28c){var _0x35ef9d=_0xc2861b[_0x8adb('0x47')][_0x8adb('0x48')]({'plain':!![]});if(!_0x35ef9d)throw new Error(_0x8adb('0x49'));if(_0x35ef9d[_0x8adb('0x4a')]===_0x8adb('0x47')){var _0x276af8=_0x33c28c[_0x8adb('0x48')]({'plain':!![]});var _0x52daa7=_0x8adb('0x24');return db[_0x8adb('0x4b')][_0x8adb('0x44')]({'where':{'name':_0x52daa7,'userProfileId':_0x35ef9d[_0x8adb('0x4c')]},'raw':!![]})[_0x8adb('0x22')](function(_0x12b242){if(_0x12b242&&_0x12b242[_0x8adb('0x4d')]===0x0){return db[_0x8adb('0x25')]['create']({'name':_0x276af8[_0x8adb('0x2a')],'resourceId':_0x276af8['id'],'type':_0x12b242[_0x8adb('0x2a')],'sectionId':_0x12b242['id']},{})[_0x8adb('0x22')](function(){return _0x33c28c;});}else{return _0x33c28c;}})[_0x8adb('0x45')](function(_0x4bba0e){logger[_0x8adb('0x28')](_0x8adb('0x4e'),_0x4bba0e);throw _0x4bba0e;});}return _0x33c28c;})[_0x8adb('0x22')](respondWithResult(_0xe725e9,0xc9))[_0x8adb('0x45')](handleError(_0xe725e9,null));};exports['update']=function(_0x415dc0,_0x34eb4d){if(_0x415dc0[_0x8adb('0x4f')]['id']){delete _0x415dc0[_0x8adb('0x4f')]['id'];}return db[_0x8adb('0x2c')][_0x8adb('0x44')]({'where':{'id':_0x415dc0[_0x8adb('0x42')]['id']}})[_0x8adb('0x22')](handleEntityNotFound(_0x34eb4d,null))[_0x8adb('0x22')](saveUpdates(_0x415dc0[_0x8adb('0x4f')],null))[_0x8adb('0x22')](respondWithResult(_0x34eb4d,null))[_0x8adb('0x45')](handleError(_0x34eb4d,null));};exports['destroy']=function(_0x4329b0,_0x492a60){return db['Tag'][_0x8adb('0x44')]({'where':{'id':_0x4329b0[_0x8adb('0x42')]['id']}})['then'](handleEntityNotFound(_0x492a60,null))[_0x8adb('0x22')](removeEntity(_0x492a60,null))[_0x8adb('0x45')](handleError(_0x492a60,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 8b95c3c..ec55961 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 _0xebed=['tools_tags','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','define','Tag'];(function(_0x105b16,_0x26e874){var _0x287e47=function(_0x34e864){while(--_0x34e864){_0x105b16['push'](_0x105b16['shift']());}};_0x287e47(++_0x26e874);}(_0xebed,0x1a5));var _0xdebe=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xebed[_0x1c0991];return _0x5034de;};'use strict';var _=require('lodash');var util=require(_0xdebe('0x0'));var logger=require(_0xdebe('0x1'))(_0xdebe('0x2'));var moment=require(_0xdebe('0x3'));var BPromise=require('bluebird');var rp=require(_0xdebe('0x4'));var fs=require('fs');var path=require(_0xdebe('0x5'));var rimraf=require(_0xdebe('0x6'));var config=require(_0xdebe('0x7'));var attributes=require(_0xdebe('0x8'));module['exports']=function(_0xc4343,_0x4e2aa7){return _0xc4343[_0xdebe('0x9')](_0xdebe('0xa'),attributes,{'tableName':_0xdebe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d84=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','tools_tags','lodash','util','../../config/logger','api'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x8d84,0x64));var _0x48d8=function(_0x18a896,_0x37f73c){_0x18a896=_0x18a896-0x0;var _0x70f96c=_0x8d84[_0x18a896];return _0x70f96c;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var logger=require(_0x48d8('0x2'))(_0x48d8('0x3'));var moment=require(_0x48d8('0x4'));var BPromise=require(_0x48d8('0x5'));var rp=require(_0x48d8('0x6'));var fs=require('fs');var path=require(_0x48d8('0x7'));var rimraf=require(_0x48d8('0x8'));var config=require(_0x48d8('0x9'));var attributes=require(_0x48d8('0xa'));module[_0x48d8('0xb')]=function(_0x46cd76,_0x248654){return _0x46cd76['define']('Tag',attributes,{'tableName':_0x48d8('0xc'),'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 ad1d954..d249bae 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 _0xf873=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x41a93b,_0x2fc19d){var _0x220a7e=function(_0x5ecb05){while(--_0x5ecb05){_0x41a93b['push'](_0x41a93b['shift']());}};_0x220a7e(++_0x2fc19d);}(_0xf873,0xb2));var _0x3f87=function(_0x2266f5,_0x3c459f){_0x2266f5=_0x2266f5-0x0;var _0x546383=_0xf873[_0x2266f5];return _0x546383;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var moment=require(_0x3f87('0x1'));var BPromise=require(_0x3f87('0x2'));var rs=require(_0x3f87('0x3'));var fs=require('fs');var Redis=require(_0x3f87('0x4'));var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require(_0x3f87('0x7'))(_0x3f87('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f87('0x9'));var client=jayson[_0x3f87('0xa')][_0x3f87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a5e37,_0x8bf89b,_0x2c7ccc){return new BPromise(function(_0x3b8e92,_0x41faf2){return client[_0x3f87('0xc')](_0x5a5e37,_0x2c7ccc)[_0x3f87('0xd')](function(_0x4c3ed4){logger[_0x3f87('0xe')](_0x3f87('0xf'),_0x8bf89b,_0x3f87('0x10'));logger[_0x3f87('0x11')](_0x3f87('0x12'),_0x8bf89b,_0x3f87('0x10'),JSON[_0x3f87('0x13')](_0x4c3ed4));if(_0x4c3ed4[_0x3f87('0x14')]){if(_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x15')]===0x1f4){logger[_0x3f87('0x14')](_0x3f87('0xf'),_0x8bf89b,_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);return _0x41faf2(_0x4c3ed4['error'][_0x3f87('0x16')]);}logger[_0x3f87('0x14')]('Tag,\x20%s,\x20%s',_0x8bf89b,_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);return _0x3b8e92(_0x4c3ed4[_0x3f87('0x14')][_0x3f87('0x16')]);}else{logger[_0x3f87('0xe')](_0x3f87('0xf'),_0x8bf89b,_0x3f87('0x10'));_0x3b8e92(_0x4c3ed4[_0x3f87('0x17')]['message']);}})[_0x3f87('0x18')](function(_0x3ac7a7){logger[_0x3f87('0x14')]('Tag,\x20%s,\x20%s',_0x8bf89b,_0x3ac7a7);_0x41faf2(_0x3ac7a7);});});} \ No newline at end of file +var _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1a5e30,_0x49a2bd){var _0x4343ca=function(_0x2f523c){while(--_0x2f523c){_0x1a5e30['push'](_0x1a5e30['shift']());}};_0x4343ca(++_0x49a2bd);}(_0xc368,0x7b));var _0x8c36=function(_0x1e2fdb,_0x1cc2e3){_0x1e2fdb=_0x1e2fdb-0x0;var _0x1d3bee=_0xc368[_0x1e2fdb];return _0x1d3bee;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('Tag,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 24e588f..e78de5f 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 08eb13c..52503c2 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x345889,_0x28bb0a){var _0x2625ec=function(_0x345174){while(--_0x345174){_0x345889['push'](_0x345889['shift']());}};_0x2625ec(++_0x28bb0a);}(_0xb10b,0x12a));var _0xbb10=function(_0x38b8c6,_0x541f91){_0x38b8c6=_0x38b8c6-0x0;var _0x3104d6=_0xb10b[_0x38b8c6];return _0x3104d6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x3da71f,_0x47875d){var _0x4b1bda=function(_0x5cf99b){while(--_0x5cf99b){_0x3da71f['push'](_0x3da71f['shift']());}};_0x4b1bda(++_0x47875d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 14ecb8e..26d5fa0 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 _0xda8f=['Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SmsQueueId','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','TeamVoicePrefix','sendStatus','end','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ValidationError','add','ids','removeQueues','isArray','Voice','Chat','Mail','Fax','Whatsapp','transaction','through','get','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','format','SIP/%s','all','UserVoicePrefix','upsert','VoicePrefixId','addAgents','removeAgents','Sms','Queue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','undefined','limit','count','offset','set','json','update','then','name','send','index','map'];(function(_0x1480a0,_0x699c5d){var _0x137e9f=function(_0x34ba3a){while(--_0x34ba3a){_0x1480a0['push'](_0x1480a0['shift']());}};_0x137e9f(++_0x699c5d);}(_0xda8f,0x19d));var _0xfda8=function(_0xb41466,_0x26c922){_0xb41466=_0xb41466-0x0;var _0x54c602=_0xda8f[_0xb41466];return _0x54c602;};'use strict';var emlformat=require(_0xfda8('0x0'));var rimraf=require(_0xfda8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfda8('0x2'));var rp=require(_0xfda8('0x3'));var moment=require(_0xfda8('0x4'));var BPromise=require(_0xfda8('0x5'));var Mustache=require(_0xfda8('0x6'));var util=require(_0xfda8('0x7'));var path=require(_0xfda8('0x8'));var sox=require('sox');var csv=require(_0xfda8('0x9'));var ejs=require(_0xfda8('0xa'));var fs=require('fs');var fs_extra=require(_0xfda8('0xb'));var _=require(_0xfda8('0xc'));var squel=require('squel');var crypto=require(_0xfda8('0xd'));var jsforce=require(_0xfda8('0xe'));var deskjs=require(_0xfda8('0xf'));var toCsv=require(_0xfda8('0x9'));var querystring=require(_0xfda8('0x10'));var Papa=require(_0xfda8('0x11'));var Redis=require(_0xfda8('0x12'));var authService=require(_0xfda8('0x13'));var qs=require(_0xfda8('0x14'));var as=require(_0xfda8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfda8('0x16'));var utils=require(_0xfda8('0x17'));var config=require(_0xfda8('0x18'));var licenseUtil=require(_0xfda8('0x19'));var db=require(_0xfda8('0x1a'))['db'];config[_0xfda8('0x1b')]=_['defaults'](config[_0xfda8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xfda8('0x1c'))(new Redis(config['redis']));require('./team.socket')[_0xfda8('0x1d')](socket);function respondWithStatusCode(_0x4c877a,_0x133da5){_0x133da5=_0x133da5||0xcc;return function(_0x26e999){if(_0x26e999){return _0x4c877a['sendStatus'](_0x133da5);}return _0x4c877a[_0xfda8('0x1e')](_0x133da5)['end']();};}function respondWithResult(_0xb8997,_0x27d3eb){_0x27d3eb=_0x27d3eb||0xc8;return function(_0x42a59e){if(_0x42a59e){return _0xb8997['status'](_0x27d3eb)['json'](_0x42a59e);}};}function respondWithFilteredResult(_0x28f0a3,_0x1f27a2){return function(_0x186b3e){if(_0x186b3e){var _0x3dcb86=typeof _0x1f27a2['offset']===_0xfda8('0x1f')&&typeof _0x1f27a2[_0xfda8('0x20')]===_0xfda8('0x1f');var _0x59269e=_0x186b3e[_0xfda8('0x21')];var _0xf78a26=_0x3dcb86?0x0:_0x1f27a2[_0xfda8('0x22')];var _0x4c7859=_0x3dcb86?_0x186b3e[_0xfda8('0x21')]:_0x1f27a2[_0xfda8('0x22')]+_0x1f27a2[_0xfda8('0x20')];var _0x5848e9;if(_0x4c7859>=_0x59269e){_0x4c7859=_0x59269e;_0x5848e9=0xc8;}else{_0x5848e9=0xce;}_0x28f0a3[_0xfda8('0x1e')](_0x5848e9);return _0x28f0a3[_0xfda8('0x23')]('Content-Range',_0xf78a26+'-'+_0x4c7859+'/'+_0x59269e)[_0xfda8('0x24')](_0x186b3e);}return null;};}function patchUpdates(_0x1c9a93){return function(_0x353326){try{jsonpatch['apply'](_0x353326,_0x1c9a93,!![]);}catch(_0xb87743){return BPromise['reject'](_0xb87743);}return _0x353326['save']();};}function saveUpdates(_0x30a7af,_0xcf57ad){return function(_0x430f2e){if(_0x430f2e){return _0x430f2e[_0xfda8('0x25')](_0x30a7af)[_0xfda8('0x26')](function(_0x36c468){return _0x36c468;});}return null;};}function handleEntityNotFound(_0x328613,_0x4b81da){return function(_0x35b6a6){if(!_0x35b6a6){_0x328613['sendStatus'](0x194);}return _0x35b6a6;};}function handleError(_0x316bb7,_0x49fce1){_0x49fce1=_0x49fce1||0x1f4;return function(_0x4be2ab){logger['error'](_0x4be2ab['stack']);if(_0x4be2ab['name']){delete _0x4be2ab[_0xfda8('0x27')];}_0x316bb7[_0xfda8('0x1e')](_0x49fce1)[_0xfda8('0x28')](_0x4be2ab);};}exports[_0xfda8('0x29')]=function(_0x21d130,_0xe64c16){var _0x1233cc={},_0x3885bc={},_0x2a351b={'count':0x0,'rows':[]};var _0x3d4346=_[_0xfda8('0x2a')](db[_0xfda8('0x2b')][_0xfda8('0x2c')],function(_0x39e6e5){return{'name':_0x39e6e5[_0xfda8('0x2d')],'type':_0x39e6e5[_0xfda8('0x2e')][_0xfda8('0x2f')]};});_0x3885bc['model']=_['map'](_0x3d4346,'name');_0x3885bc[_0xfda8('0x30')]=_[_0xfda8('0x31')](_0x21d130[_0xfda8('0x30')]);_0x3885bc[_0xfda8('0x32')]=_[_0xfda8('0x33')](_0x3885bc[_0xfda8('0x34')],_0x3885bc[_0xfda8('0x30')]);_0x1233cc['attributes']=_[_0xfda8('0x33')](_0x3885bc[_0xfda8('0x34')],qs[_0xfda8('0x35')](_0x21d130[_0xfda8('0x30')][_0xfda8('0x35')]));_0x1233cc[_0xfda8('0x36')]=_0x1233cc[_0xfda8('0x36')][_0xfda8('0x37')]?_0x1233cc[_0xfda8('0x36')]:_0x3885bc['model'];if(!_0x21d130[_0xfda8('0x30')][_0xfda8('0x38')](_0xfda8('0x39'))){_0x1233cc['limit']=qs[_0xfda8('0x20')](_0x21d130['query']['limit']);_0x1233cc['offset']=qs['offset'](_0x21d130['query']['offset']);}_0x1233cc[_0xfda8('0x3a')]=qs['sort'](_0x21d130[_0xfda8('0x30')][_0xfda8('0x3b')]);_0x1233cc['where']=qs[_0xfda8('0x32')](_[_0xfda8('0x3c')](_0x21d130[_0xfda8('0x30')],_0x3885bc[_0xfda8('0x32')]),_0x3d4346);if(_0x21d130[_0xfda8('0x30')][_0xfda8('0x3d')]){_0x1233cc[_0xfda8('0x3e')]=_[_0xfda8('0x3f')](_0x1233cc['where'],{'$or':_[_0xfda8('0x2a')](_0x3d4346,function(_0xa03c52){if(_0xa03c52['type']!==_0xfda8('0x40')){var _0x266118={};_0x266118[_0xa03c52[_0xfda8('0x27')]]={'$like':'%'+_0x21d130[_0xfda8('0x30')]['filter']+'%'};return _0x266118;}})});}_0x1233cc=_[_0xfda8('0x3f')]({},_0x1233cc,_0x21d130[_0xfda8('0x41')]);var _0x7ddee5={'where':_0x1233cc[_0xfda8('0x3e')]};return db[_0xfda8('0x2b')]['count'](_0x7ddee5)[_0xfda8('0x26')](function(_0x4cf53b){_0x2a351b[_0xfda8('0x21')]=_0x4cf53b;if(_0x21d130[_0xfda8('0x30')][_0xfda8('0x42')]){_0x1233cc[_0xfda8('0x43')]=[{'all':!![]}];}return db[_0xfda8('0x2b')][_0xfda8('0x44')](_0x1233cc);})[_0xfda8('0x26')](function(_0x10066c){_0x2a351b[_0xfda8('0x45')]=_0x10066c;return _0x2a351b;})[_0xfda8('0x26')](respondWithFilteredResult(_0xe64c16,_0x1233cc))[_0xfda8('0x46')](handleError(_0xe64c16,null));};exports[_0xfda8('0x47')]=function(_0x51dd2b,_0x15046d){var _0x1bf4e3={'raw':![],'where':{'id':_0x51dd2b[_0xfda8('0x48')]['id']}},_0x4b84d2={};_0x4b84d2[_0xfda8('0x34')]=_[_0xfda8('0x31')](db['Team'][_0xfda8('0x2c')]);_0x4b84d2[_0xfda8('0x30')]=_[_0xfda8('0x31')](_0x51dd2b[_0xfda8('0x30')]);_0x4b84d2['filters']=_[_0xfda8('0x33')](_0x4b84d2['model'],_0x4b84d2[_0xfda8('0x30')]);_0x1bf4e3[_0xfda8('0x36')]=_[_0xfda8('0x33')](_0x4b84d2[_0xfda8('0x34')],qs[_0xfda8('0x35')](_0x51dd2b['query'][_0xfda8('0x35')]));_0x1bf4e3['attributes']=_0x1bf4e3[_0xfda8('0x36')]['length']?_0x1bf4e3[_0xfda8('0x36')]:_0x4b84d2[_0xfda8('0x34')];if(_0x51dd2b['query'][_0xfda8('0x42')]){_0x1bf4e3['include']=[{'all':!![]}];}_0x1bf4e3=_[_0xfda8('0x3f')]({},_0x1bf4e3,_0x51dd2b['options']);return db['Team'][_0xfda8('0x49')](_0x1bf4e3)['then'](handleEntityNotFound(_0x15046d,null))[_0xfda8('0x26')](respondWithResult(_0x15046d,null))['catch'](handleError(_0x15046d,null));};exports[_0xfda8('0x4a')]=function(_0x3d085f,_0x5ee5c3){return db['Team']['create'](_0x3d085f[_0xfda8('0x4b')],{})[_0xfda8('0x26')](function(_0xd5cd01){var _0x590780=_0x3d085f[_0xfda8('0x4c')]['get']({'plain':!![]});if(!_0x590780)throw new Error(_0xfda8('0x4d'));if(_0x590780[_0xfda8('0x4e')]===_0xfda8('0x4c')){var _0x1ea383=_0xd5cd01['get']({'plain':!![]});var _0x1ffc8d=_0xfda8('0x4f');return db[_0xfda8('0x50')][_0xfda8('0x49')]({'where':{'name':_0x1ffc8d,'userProfileId':_0x590780[_0xfda8('0x51')]},'raw':!![]})[_0xfda8('0x26')](function(_0x1bb2b2){if(_0x1bb2b2&&_0x1bb2b2[_0xfda8('0x52')]===0x0){return db[_0xfda8('0x53')][_0xfda8('0x4a')]({'name':_0x1ea383[_0xfda8('0x27')],'resourceId':_0x1ea383['id'],'type':_0x1bb2b2[_0xfda8('0x27')],'sectionId':_0x1bb2b2['id']},{})['then'](function(){return _0xd5cd01;});}else{return _0xd5cd01;}})[_0xfda8('0x46')](function(_0x470c8f){logger['error'](_0xfda8('0x54'),_0x470c8f);throw _0x470c8f;});}return _0xd5cd01;})[_0xfda8('0x26')](respondWithResult(_0x5ee5c3,0xc9))[_0xfda8('0x46')](handleError(_0x5ee5c3,null));};exports['update']=function(_0x1dcdd8,_0x10c114){if(_0x1dcdd8[_0xfda8('0x4b')]['id']){delete _0x1dcdd8[_0xfda8('0x4b')]['id'];}return db[_0xfda8('0x2b')][_0xfda8('0x49')]({'where':{'id':_0x1dcdd8['params']['id']}})['then'](handleEntityNotFound(_0x10c114,null))[_0xfda8('0x26')](saveUpdates(_0x1dcdd8[_0xfda8('0x4b')],null))[_0xfda8('0x26')](respondWithResult(_0x10c114,null))[_0xfda8('0x46')](handleError(_0x10c114,null));};exports[_0xfda8('0x55')]=function(_0x749fd7,_0x466bf9){var _0x2390aa=_0x749fd7[_0xfda8('0x48')]['id'];var _0x1e16de=[];return db[_0xfda8('0x56')]['transaction'](function(_0x5a49c9){var _0x5d9095=_0xfda8('0x57')+_0x2390aa;return db[_0xfda8('0x56')][_0xfda8('0x30')](_0x5d9095,{'type':db[_0xfda8('0x58')]['QueryTypes'][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9})[_0xfda8('0x26')](function(_0x1aee54){_0x1e16de=_[_0xfda8('0x2a')](_0x1aee54,function(_0x4a01f7){return Number(_0x4a01f7[_0xfda8('0x5a')]);});})[_0xfda8('0x26')](function(){var _0x2b3332=_0xfda8('0x5b')+_0x2390aa;return db[_0xfda8('0x56')][_0xfda8('0x30')](_0x2b3332,{'type':db['Sequelize'][_0xfda8('0x5c')][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(_0x43c0ac){var _0x21ae51=_[_0xfda8('0x2a')](_0x43c0ac,function(_0x19cb9f){return Number(_0x19cb9f[_0xfda8('0x5d')]);});return db[_0xfda8('0x5e')][_0xfda8('0x55')]({'where':{'UserId':{'$in':_0x1e16de},'VoiceQueueId':{'$in':_0x21ae51}},'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(){var _0x22f688='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2390aa;return db['sequelize'][_0xfda8('0x30')](_0x22f688,{'type':db[_0xfda8('0x58')][_0xfda8('0x5c')][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(_0x4cfb9c){var _0x249f67=_['map'](_0x4cfb9c,function(_0x39d12c){return Number(_0x39d12c[_0xfda8('0x5f')]);});return db[_0xfda8('0x60')]['destroy']({'where':{'UserId':{'$in':_0x1e16de},'MailQueueId':{'$in':_0x249f67}},'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(){var _0x3af2c3='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2390aa;return db[_0xfda8('0x56')]['query'](_0x3af2c3,{'type':db[_0xfda8('0x58')][_0xfda8('0x5c')][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(_0x417c43){var _0x475456=_[_0xfda8('0x2a')](_0x417c43,function(_0x360c63){return Number(_0x360c63[_0xfda8('0x61')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x1e16de},'SmsQueueId':{'$in':_0x475456}},'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(){var _0x4ba90f='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2390aa;return db[_0xfda8('0x56')][_0xfda8('0x30')](_0x4ba90f,{'type':db[_0xfda8('0x58')][_0xfda8('0x5c')][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(_0x52d3ef){var _0x18da4f=_['map'](_0x52d3ef,function(_0x15b619){return Number(_0x15b619[_0xfda8('0x62')]);});return db['UserChatQueue'][_0xfda8('0x55')]({'where':{'UserId':{'$in':_0x1e16de},'ChatQueueId':{'$in':_0x18da4f}},'transaction':_0x5a49c9});})['then'](function(){var _0x8a0f4b=_0xfda8('0x63')+_0x2390aa;return db[_0xfda8('0x56')]['query'](_0x8a0f4b,{'type':db[_0xfda8('0x58')][_0xfda8('0x5c')][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(_0x1b5c5e){var _0xf55582=_[_0xfda8('0x2a')](_0x1b5c5e,function(_0x3edf76){return Number(_0x3edf76['FaxQueueId']);});return db[_0xfda8('0x64')][_0xfda8('0x55')]({'where':{'UserId':{'$in':_0x1e16de},'FaxQueueId':{'$in':_0xf55582}},'transaction':_0x5a49c9});})['then'](function(){var _0x8d900=_0xfda8('0x65')+_0x2390aa;return db[_0xfda8('0x56')][_0xfda8('0x30')](_0x8d900,{'type':db[_0xfda8('0x58')]['QueryTypes'][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})['then'](function(_0x1ffb0d){var _0x50f25b=_[_0xfda8('0x2a')](_0x1ffb0d,function(_0x5702d2){return Number(_0x5702d2[_0xfda8('0x66')]);});return db[_0xfda8('0x67')][_0xfda8('0x55')]({'where':{'UserId':{'$in':_0x1e16de},'OpenchannelQueueId':{'$in':_0x50f25b}},'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(){var _0xd88f17='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2390aa;return db[_0xfda8('0x56')]['query'](_0xd88f17,{'type':db[_0xfda8('0x58')][_0xfda8('0x5c')][_0xfda8('0x59')],'raw':!![],'transaction':_0x5a49c9});})['then'](function(_0x4dbe39){var _0x22e199=_['map'](_0x4dbe39,function(_0x20db05){return Number(_0x20db05[_0xfda8('0x68')]);});return db['UserWhatsappQueue'][_0xfda8('0x55')]({'where':{'UserId':{'$in':_0x1e16de},'WhatsappQueueId':{'$in':_0x22e199}},'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(){return db[_0xfda8('0x69')][_0xfda8('0x49')]({'where':{'TeamId':_0x2390aa}});})['then'](function(_0x1cb05a){if(_0x1cb05a===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x1e16de},'VoicePrefixId':_0x1cb05a['VoicePrefixId']},'transaction':_0x5a49c9});})['then'](function(){return db['Team'][_0xfda8('0x55')]({'where':{'id':_0x2390aa},'cascade':!![],'transaction':_0x5a49c9});})[_0xfda8('0x26')](function(_0x2625e0){if(_0x2625e0===0x0){_0x466bf9[_0xfda8('0x6a')](0x194);}else{return db['UserProfileResource'][_0xfda8('0x55')]({'where':{'type':_0xfda8('0x4f'),'resourceId':_0x2390aa},'cascade':!![],'transaction':_0x5a49c9})['then'](function(){_0x466bf9[_0xfda8('0x1e')](0xcc)[_0xfda8('0x6b')]();});}})['catch'](function(_0x1cfe4d){_0x466bf9['status'](0x1f4)[_0xfda8('0x28')](_0x1cfe4d);});});};exports['getQueues']=function(_0x587e38,_0x49e291,_0x2dd9c6){return db[_0xfda8('0x2b')][_0xfda8('0x6c')]({'where':{'id':_0x587e38[_0xfda8('0x48')]['id']}})[_0xfda8('0x26')](handleEntityNotFound(_0x49e291,null))[_0xfda8('0x26')](function(_0x139da8){if(!_0x587e38[_0xfda8('0x30')][_0xfda8('0x6d')]||!utils[_0xfda8('0x6e')](_0x587e38['query'][_0xfda8('0x6d')])){throw new db[(_0xfda8('0x58'))]['ValidationError'](_0xfda8('0x6f'));}var _0x423204={};var _0x564f51={};_0x564f51[_0xfda8('0x34')]=_['keys'](db[_[_0xfda8('0x70')](_0x587e38[_0xfda8('0x30')][_0xfda8('0x6d')][_0xfda8('0x71')]())+_0xfda8('0x72')]['rawAttributes']);_0x564f51[_0xfda8('0x30')]=_['keys'](_0x587e38[_0xfda8('0x30')]);_0x564f51['filters']=_[_0xfda8('0x33')](_0x564f51[_0xfda8('0x34')],_0x564f51[_0xfda8('0x30')]);_0x423204[_0xfda8('0x36')]=_['intersection'](_0x564f51[_0xfda8('0x34')],qs['fields'](_0x587e38[_0xfda8('0x30')]['fields']));_0x423204['attributes']=_0x423204['attributes'][_0xfda8('0x37')]?_0x423204[_0xfda8('0x36')]:_0x564f51[_0xfda8('0x34')];_0x423204['limit']=qs[_0xfda8('0x20')](_0x587e38['query']['limit']);_0x423204[_0xfda8('0x22')]=qs[_0xfda8('0x22')](_0x587e38[_0xfda8('0x30')][_0xfda8('0x22')]);_0x423204[_0xfda8('0x3a')]=qs[_0xfda8('0x3b')](_0x587e38[_0xfda8('0x30')][_0xfda8('0x3b')]);_0x423204[_0xfda8('0x3e')]=qs['filters'](_[_0xfda8('0x3c')](_0x587e38[_0xfda8('0x30')],_0x564f51[_0xfda8('0x32')]));_0x423204=_['merge']({},_0x423204,_0x587e38['options']);return _0x139da8['get'+_[_0xfda8('0x70')](_0x587e38[_0xfda8('0x30')]['channel'][_0xfda8('0x71')]())+_0xfda8('0x73')](_0x423204);})[_0xfda8('0x26')](respondWithResult(_0x49e291,null))[_0xfda8('0x46')](handleError(_0x49e291,null));};exports[_0xfda8('0x74')]=function(_0x583056,_0x279093,_0x196b41){return db[_0xfda8('0x2b')][_0xfda8('0x6c')]({'where':{'id':_0x583056[_0xfda8('0x48')]['id']}})[_0xfda8('0x26')](function(_0x507708){if(_0x507708){if(!_0x583056[_0xfda8('0x4b')][_0xfda8('0x6d')]||!utils[_0xfda8('0x6e')](_0x583056[_0xfda8('0x4b')][_0xfda8('0x6d')])){throw new db[(_0xfda8('0x58'))][(_0xfda8('0x75'))]('Unknown\x20channel');}return _0x507708[_0xfda8('0x76')+_[_0xfda8('0x70')](_0x583056[_0xfda8('0x4b')][_0xfda8('0x6d')][_0xfda8('0x71')]())+_0xfda8('0x73')](_0x583056[_0xfda8('0x4b')][_0xfda8('0x77')]);}return null;})[_0xfda8('0x26')](handleEntityNotFound(_0x279093,null))[_0xfda8('0x26')](respondWithStatusCode(_0x279093,null))[_0xfda8('0x46')](handleError(_0x279093,null));};exports[_0xfda8('0x78')]=function(_0x967608,_0x648687,_0x533b1a){return db[_0xfda8('0x2b')][_0xfda8('0x6c')]({'where':{'id':_0x967608[_0xfda8('0x48')]['id']}})[_0xfda8('0x26')](function(_0x46ba14){if(_0x46ba14){if(!_0x967608[_0xfda8('0x30')][_0xfda8('0x6d')]||!utils[_0xfda8('0x6e')](_0x967608[_0xfda8('0x30')]['channel'])){throw new db[(_0xfda8('0x58'))][(_0xfda8('0x75'))](_0xfda8('0x6f'));}return _0x46ba14['remove'+_[_0xfda8('0x70')](_0x967608['query'][_0xfda8('0x6d')][_0xfda8('0x71')]())+_0xfda8('0x73')](_0x967608['query'][_0xfda8('0x77')]);}return null;})[_0xfda8('0x26')](handleEntityNotFound(_0x648687,null))[_0xfda8('0x26')](respondWithStatusCode(_0x648687,null))[_0xfda8('0x46')](handleError(_0x648687,null));};exports['addAgents']=function(_0x2980df,_0x4f44e6){var _0x222e9a=_[_0xfda8('0x79')](_0x2980df[_0xfda8('0x4b')]['ids'])?_0x2980df[_0xfda8('0x4b')][_0xfda8('0x77')]:[_0x2980df[_0xfda8('0x4b')][_0xfda8('0x77')]];var _0x5d512c=_0x2980df['params']['id'];return db[_0xfda8('0x2b')][_0xfda8('0x49')]({'where':{'id':_0x5d512c}})[_0xfda8('0x26')](handleEntityNotFound(_0x4f44e6,null))[_0xfda8('0x26')](function(_0x13c860){if(_0x13c860){var _0x380113=[_0xfda8('0x7a'),_0xfda8('0x7b'),_0xfda8('0x7c'),'Sms',_0xfda8('0x7d'),'Openchannel',_0xfda8('0x7e')];return db[_0xfda8('0x56')][_0xfda8('0x7f')](function(_0x5f82f3){var _0x4e6623=_[_0xfda8('0x2a')](_0x380113,function(_0x348793){var _0x430394={'attributes':['id',_0xfda8('0x27')]};if(_0x348793===_0xfda8('0x7a')){_0x430394[_0xfda8('0x80')]={'attributes':['penalty']};}return _0x13c860[_0xfda8('0x81')+_0x348793+_0xfda8('0x73')](_0x430394)[_0xfda8('0x26')](function(_0x350ba9){var _0x36236c=_[_0xfda8('0x2a')](_0x350ba9,function(_0x74f39){var _0xb18f02=_[_0xfda8('0x2a')](_0x222e9a,function(_0x2a8add){var _0x2a8c87={'where':{'UserId':_0x2a8add,[_0x348793+_0xfda8('0x82')]:_0x74f39['id']},'transaction':_0x5f82f3};if(_0x348793==='Voice'){_0x2a8c87['defaults']={'penalty':_0x74f39[_0xfda8('0x83')][_0xfda8('0x84')]};}return db[_0xfda8('0x85')+_0x348793+'Queue'][_0xfda8('0x86')](_0x2a8c87)[_0xfda8('0x26')](function(){socket[_0xfda8('0x87')](_0xfda8('0x4c')+_0x348793+_0xfda8('0x88'),{'UserId':_0x2a8add,[_0x348793+_0xfda8('0x82')]:_0x74f39['id']});if(_0x348793!==_0xfda8('0x7a')){return;}return db[_0xfda8('0x85')][_0xfda8('0x44')]({'where':{'id':_0x222e9a,'online':0x1},'attributes':['id','name',_0xfda8('0x89'),_0xfda8('0x8a'),_0xfda8('0x8b')],'raw':!![]})['then'](function(_0x82f580){var _0x128977=_[_0xfda8('0x2a')](_0x82f580,function(_0x4ff666){return db[_0xfda8('0x8c')]['upsert']({'membername':_0x4ff666[_0xfda8('0x27')],'UserId':_0x4ff666['id'],'queue_name':_0x74f39['name'],'VoiceQueueId':_0x74f39['id'],'interface':_['isNil'](_0x4ff666[_0xfda8('0x8b')])?util[_0xfda8('0x8d')](_0xfda8('0x8e'),_0x4ff666[_0xfda8('0x27')]):_0x4ff666[_0xfda8('0x8b')],'paused':_0x4ff666[_0xfda8('0x8a')]||![],'penalty':_0x74f39[_0xfda8('0x83')]['penalty']},{'transaction':_0x5f82f3});});return Promise[_0xfda8('0x8f')](_0x128977);});});});return Promise['all'](_0xb18f02);});return Promise[_0xfda8('0x8f')](_0x36236c);})[_0xfda8('0x26')](function(){return db[_0xfda8('0x69')]['findOne']({'where':{'teamId':_0x5d512c}})[_0xfda8('0x26')](function(_0x22eedf){if(_0x22eedf){var _0x1a7435=_[_0xfda8('0x2a')](_0x222e9a,function(_0x5e5b93){db[_0xfda8('0x90')][_0xfda8('0x91')]({'UserId':_0x5e5b93,'VoicePrefixId':_0x22eedf[_0xfda8('0x92')]});});return Promise[_0xfda8('0x8f')](_0x1a7435);}});});});return Promise[_0xfda8('0x8f')](_0x4e6623)['then'](function(){return _0x13c860[_0xfda8('0x93')](_0x222e9a,{'transaction':_0x5f82f3})['spread'](function(_0x38f862){return _0x38f862;});});});}})[_0xfda8('0x26')](respondWithResult(_0x4f44e6,null))[_0xfda8('0x46')](handleError(_0x4f44e6,null));};exports[_0xfda8('0x94')]=function(_0x49ff24,_0x432edd){var _0x4bf0a7=_[_0xfda8('0x79')](_0x49ff24[_0xfda8('0x30')][_0xfda8('0x77')])?_0x49ff24['query']['ids']:[_0x49ff24[_0xfda8('0x30')][_0xfda8('0x77')]];var _0x59f8ae=_0x49ff24[_0xfda8('0x48')]['id'];return db['Team'][_0xfda8('0x49')]({'where':{'id':_0x59f8ae}})[_0xfda8('0x26')](handleEntityNotFound(_0x432edd,null))[_0xfda8('0x26')](function(_0x104fd1){if(_0x104fd1){var _0x3d1bc6=[_0xfda8('0x7a'),_0xfda8('0x7b'),_0xfda8('0x7c'),_0xfda8('0x95'),_0xfda8('0x7d'),'Openchannel',_0xfda8('0x7e')];return db['sequelize'][_0xfda8('0x7f')](function(_0x341ce0){var _0x4c2753=_['map'](_0x3d1bc6,function(_0x4916c2){var _0x5c5e2f={'attributes':['id',_0xfda8('0x27')]};return _0x104fd1[_0xfda8('0x81')+_0x4916c2+_0xfda8('0x73')](_0x5c5e2f)['then'](function(_0x8569c6){var _0x265cbc=_['map'](_0x8569c6,function(_0x4c0dc4){return _0x4c0dc4[_0xfda8('0x94')](_0x4bf0a7,{'transaction':_0x341ce0})[_0xfda8('0x26')](function(){var _0x15cfef=_[_0xfda8('0x2a')](_0x4bf0a7,function(_0x75dccf){socket[_0xfda8('0x87')]('user'+_0x4916c2+_0xfda8('0x96'),{'UserId':Number(_0x75dccf),[_0x4916c2+_0xfda8('0x82')]:_0x4c0dc4['id']});if(_0x4916c2!==_0xfda8('0x7a')){return;}return db[_0xfda8('0x8c')][_0xfda8('0x55')]({'where':{'VoiceQueueId':_0x4c0dc4['id'],'UserId':_0x75dccf},'transaction':_0x341ce0});});return Promise[_0xfda8('0x8f')](_0x15cfef);});});return Promise[_0xfda8('0x8f')](_0x265cbc);});});return Promise[_0xfda8('0x8f')](_0x4c2753)[_0xfda8('0x26')](function(){return _0x104fd1[_0xfda8('0x94')](_0x4bf0a7,{'transaction':_0x341ce0});})[_0xfda8('0x26')](function(){return db[_0xfda8('0x69')][_0xfda8('0x6c')]({'where':{'teamId':_0x59f8ae}})[_0xfda8('0x26')](function(_0x4144b5){if(_0x4144b5){var _0xc8e7c1=_['map'](_0x4bf0a7,function(_0x2508a5){db[_0xfda8('0x90')]['destroy']({'where':{'UserId':_0x2508a5,'VoicePrefixId':_0x4144b5[_0xfda8('0x92')]}});});return Promise[_0xfda8('0x8f')](_0xc8e7c1);}});});});}})['then'](respondWithStatusCode(_0x432edd,null))['catch'](handleError(_0x432edd,null));};exports[_0xfda8('0x97')]=function(_0x409299,_0x1b6001,_0x2e8e4d){var _0x28d237={};var _0x182d26={};var _0x3bc64b;var _0x5924ff;return db[_0xfda8('0x2b')][_0xfda8('0x6c')]({'where':{'id':_0x409299['params']['id']}})[_0xfda8('0x26')](handleEntityNotFound(_0x1b6001,null))[_0xfda8('0x26')](function(_0x4ad06c){if(_0x4ad06c){_0x3bc64b=_0x4ad06c;_0x182d26[_0xfda8('0x34')]=_[_0xfda8('0x31')](db['User'][_0xfda8('0x2c')]);_0x182d26[_0xfda8('0x30')]=_[_0xfda8('0x31')](_0x409299['query']);_0x182d26[_0xfda8('0x32')]=_[_0xfda8('0x33')](_0x182d26[_0xfda8('0x34')],_0x182d26[_0xfda8('0x30')]);_0x28d237['attributes']=_[_0xfda8('0x33')](_0x182d26[_0xfda8('0x34')],qs[_0xfda8('0x35')](_0x409299[_0xfda8('0x30')]['fields']));_0x28d237['attributes']=_0x28d237['attributes']['length']?_0x28d237['attributes']:_0x182d26[_0xfda8('0x34')];_0x28d237[_0xfda8('0x3a')]=qs[_0xfda8('0x3b')](_0x409299[_0xfda8('0x30')]['sort']);_0x28d237[_0xfda8('0x3e')]=qs[_0xfda8('0x32')](_[_0xfda8('0x3c')](_0x409299[_0xfda8('0x30')],_0x182d26[_0xfda8('0x32')]));if(_0x409299[_0xfda8('0x30')][_0xfda8('0x3d')]){_0x28d237[_0xfda8('0x3e')]=_[_0xfda8('0x3f')](_0x28d237[_0xfda8('0x3e')],{'$or':_['map'](_0x28d237['attributes'],function(_0x2700dc){var _0x446514={};_0x446514[_0x2700dc]={'$like':'%'+_0x409299[_0xfda8('0x30')]['filter']+'%'};return _0x446514;})});}_0x28d237=_[_0xfda8('0x3f')]({},_0x28d237,_0x409299[_0xfda8('0x41')]);return _0x3bc64b['getAgents'](_0x28d237);}})['then'](function(_0x201763){if(_0x201763){_0x5924ff=_0x201763[_0xfda8('0x37')];if(!_0x409299[_0xfda8('0x30')]['hasOwnProperty']('nolimit')){_0x28d237[_0xfda8('0x20')]=qs[_0xfda8('0x20')](_0x409299[_0xfda8('0x30')]['limit']);_0x28d237['offset']=qs[_0xfda8('0x22')](_0x409299[_0xfda8('0x30')]['offset']);}return _0x3bc64b[_0xfda8('0x97')](_0x28d237);}})['then'](function(_0x152c75){if(_0x152c75){return _0x152c75?{'count':_0x5924ff,'rows':_0x152c75}:null;}})['then'](respondWithResult(_0x1b6001,null))[_0xfda8('0x46')](handleError(_0x1b6001,null));}; \ No newline at end of file +var _0xc829=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','Team','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','UserProfileResource','Teams','getQueues','findOne','channel','ValidationError','toLowerCase','rawAttributes','Queues','addQueues','Unknown\x20channel','add','capitalize','ids','removeQueues','isValidChannel','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','UserVoicePrefix','Openchannel','Whatsapp','removeAgents','getAgents','nolimit','eml-format','zip-dir'];(function(_0x339d45,_0x5b91d4){var _0x5e4a60=function(_0x4de526){while(--_0x4de526){_0x339d45['push'](_0x339d45['shift']());}};_0x5e4a60(++_0x5b91d4);}(_0xc829,0x9f));var _0x9c82=function(_0x697425,_0x142de8){_0x697425=_0x697425-0x0;var _0xf49eef=_0xc829[_0x697425];return _0xf49eef;};'use strict';var emlformat=require(_0x9c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c82('0x1'));var jsonpatch=require(_0x9c82('0x2'));var rp=require(_0x9c82('0x3'));var moment=require('moment');var BPromise=require(_0x9c82('0x4'));var Mustache=require(_0x9c82('0x5'));var util=require(_0x9c82('0x6'));var path=require(_0x9c82('0x7'));var sox=require(_0x9c82('0x8'));var csv=require(_0x9c82('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c82('0xa'));var _=require(_0x9c82('0xb'));var squel=require(_0x9c82('0xc'));var crypto=require(_0x9c82('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9c82('0xe'));var toCsv=require(_0x9c82('0x9'));var querystring=require(_0x9c82('0xf'));var Papa=require(_0x9c82('0x10'));var Redis=require(_0x9c82('0x11'));var authService=require(_0x9c82('0x12'));var qs=require(_0x9c82('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c82('0x14'));var logger=require(_0x9c82('0x15'))(_0x9c82('0x16'));var utils=require(_0x9c82('0x17'));var config=require(_0x9c82('0x18'));var licenseUtil=require(_0x9c82('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9c82('0x1a')](config[_0x9c82('0x1b')],{'host':_0x9c82('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c82('0x1b')]));require(_0x9c82('0x1d'))[_0x9c82('0x1e')](socket);function respondWithStatusCode(_0x283cac,_0x2c564c){_0x2c564c=_0x2c564c||0xcc;return function(_0x17c5fa){if(_0x17c5fa){return _0x283cac[_0x9c82('0x1f')](_0x2c564c);}return _0x283cac[_0x9c82('0x20')](_0x2c564c)[_0x9c82('0x21')]();};}function respondWithResult(_0x956c73,_0x2ba863){_0x2ba863=_0x2ba863||0xc8;return function(_0x5a44e2){if(_0x5a44e2){return _0x956c73[_0x9c82('0x20')](_0x2ba863)['json'](_0x5a44e2);}};}function respondWithFilteredResult(_0x3ee97e,_0x2fb0ee){return function(_0x258a36){if(_0x258a36){var _0x313a95=typeof _0x2fb0ee[_0x9c82('0x22')]===_0x9c82('0x23')&&typeof _0x2fb0ee[_0x9c82('0x24')]===_0x9c82('0x23');var _0x3e4d4f=_0x258a36[_0x9c82('0x25')];var _0x58ed68=_0x313a95?0x0:_0x2fb0ee['offset'];var _0x2ef1ed=_0x313a95?_0x258a36[_0x9c82('0x25')]:_0x2fb0ee[_0x9c82('0x22')]+_0x2fb0ee['limit'];var _0xb934f4;if(_0x2ef1ed>=_0x3e4d4f){_0x2ef1ed=_0x3e4d4f;_0xb934f4=0xc8;}else{_0xb934f4=0xce;}_0x3ee97e[_0x9c82('0x20')](_0xb934f4);return _0x3ee97e[_0x9c82('0x26')](_0x9c82('0x27'),_0x58ed68+'-'+_0x2ef1ed+'/'+_0x3e4d4f)[_0x9c82('0x28')](_0x258a36);}return null;};}function patchUpdates(_0x3c6d15){return function(_0x5ae914){try{jsonpatch[_0x9c82('0x29')](_0x5ae914,_0x3c6d15,!![]);}catch(_0x48bedb){return BPromise[_0x9c82('0x2a')](_0x48bedb);}return _0x5ae914[_0x9c82('0x2b')]();};}function saveUpdates(_0x420bc8,_0x22f0f9){return function(_0x23c1b7){if(_0x23c1b7){return _0x23c1b7['update'](_0x420bc8)[_0x9c82('0x2c')](function(_0x2f9af0){return _0x2f9af0;});}return null;};}function handleEntityNotFound(_0x572ba7,_0x3c8981){return function(_0x4a05f5){if(!_0x4a05f5){_0x572ba7['sendStatus'](0x194);}return _0x4a05f5;};}function handleError(_0x1b7b93,_0x4ff06b){_0x4ff06b=_0x4ff06b||0x1f4;return function(_0x3f626a){logger[_0x9c82('0x2d')](_0x3f626a[_0x9c82('0x2e')]);if(_0x3f626a['name']){delete _0x3f626a[_0x9c82('0x2f')];}_0x1b7b93[_0x9c82('0x20')](_0x4ff06b)[_0x9c82('0x30')](_0x3f626a);};}exports[_0x9c82('0x31')]=function(_0x2f166a,_0xacb740){var _0x5878b1={},_0x1fe27e={},_0x43f9a0={'count':0x0,'rows':[]};var _0x43109d=_[_0x9c82('0x32')](db[_0x9c82('0x33')]['rawAttributes'],function(_0x39e3ac){return{'name':_0x39e3ac[_0x9c82('0x34')],'type':_0x39e3ac['type'][_0x9c82('0x35')]};});_0x1fe27e[_0x9c82('0x36')]=_[_0x9c82('0x32')](_0x43109d,'name');_0x1fe27e[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x2f166a[_0x9c82('0x37')]);_0x1fe27e['filters']=_[_0x9c82('0x39')](_0x1fe27e['model'],_0x1fe27e['query']);_0x5878b1[_0x9c82('0x3a')]=_['intersection'](_0x1fe27e['model'],qs[_0x9c82('0x3b')](_0x2f166a[_0x9c82('0x37')][_0x9c82('0x3b')]));_0x5878b1[_0x9c82('0x3a')]=_0x5878b1[_0x9c82('0x3a')][_0x9c82('0x3c')]?_0x5878b1[_0x9c82('0x3a')]:_0x1fe27e[_0x9c82('0x36')];if(!_0x2f166a[_0x9c82('0x37')][_0x9c82('0x3d')]('nolimit')){_0x5878b1[_0x9c82('0x24')]=qs[_0x9c82('0x24')](_0x2f166a[_0x9c82('0x37')]['limit']);_0x5878b1[_0x9c82('0x22')]=qs[_0x9c82('0x22')](_0x2f166a[_0x9c82('0x37')][_0x9c82('0x22')]);}_0x5878b1[_0x9c82('0x3e')]=qs[_0x9c82('0x3f')](_0x2f166a[_0x9c82('0x37')][_0x9c82('0x3f')]);_0x5878b1[_0x9c82('0x40')]=qs[_0x9c82('0x41')](_[_0x9c82('0x42')](_0x2f166a[_0x9c82('0x37')],_0x1fe27e[_0x9c82('0x41')]),_0x43109d);if(_0x2f166a[_0x9c82('0x37')][_0x9c82('0x43')]){_0x5878b1[_0x9c82('0x40')]=_[_0x9c82('0x44')](_0x5878b1['where'],{'$or':_[_0x9c82('0x32')](_0x43109d,function(_0x371048){if(_0x371048['type']!==_0x9c82('0x45')){var _0x17b3f6={};_0x17b3f6[_0x371048['name']]={'$like':'%'+_0x2f166a['query'][_0x9c82('0x43')]+'%'};return _0x17b3f6;}})});}_0x5878b1=_[_0x9c82('0x44')]({},_0x5878b1,_0x2f166a[_0x9c82('0x46')]);var _0xb85d38={'where':_0x5878b1[_0x9c82('0x40')]};return db[_0x9c82('0x33')][_0x9c82('0x25')](_0xb85d38)['then'](function(_0x65d9fb){_0x43f9a0[_0x9c82('0x25')]=_0x65d9fb;if(_0x2f166a[_0x9c82('0x37')]['includeAll']){_0x5878b1[_0x9c82('0x47')]=[{'all':!![]}];}return db[_0x9c82('0x33')]['findAll'](_0x5878b1);})['then'](function(_0x13d65b){_0x43f9a0[_0x9c82('0x48')]=_0x13d65b;return _0x43f9a0;})['then'](respondWithFilteredResult(_0xacb740,_0x5878b1))['catch'](handleError(_0xacb740,null));};exports[_0x9c82('0x49')]=function(_0x300dfc,_0x2693ac){var _0x5a079a={'raw':![],'where':{'id':_0x300dfc[_0x9c82('0x4a')]['id']}},_0x5ee7da={};_0x5ee7da[_0x9c82('0x36')]=_['keys'](db[_0x9c82('0x33')]['rawAttributes']);_0x5ee7da[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x300dfc[_0x9c82('0x37')]);_0x5ee7da[_0x9c82('0x41')]=_[_0x9c82('0x39')](_0x5ee7da[_0x9c82('0x36')],_0x5ee7da[_0x9c82('0x37')]);_0x5a079a[_0x9c82('0x3a')]=_['intersection'](_0x5ee7da['model'],qs['fields'](_0x300dfc[_0x9c82('0x37')][_0x9c82('0x3b')]));_0x5a079a[_0x9c82('0x3a')]=_0x5a079a[_0x9c82('0x3a')]['length']?_0x5a079a[_0x9c82('0x3a')]:_0x5ee7da[_0x9c82('0x36')];if(_0x300dfc[_0x9c82('0x37')][_0x9c82('0x4b')]){_0x5a079a[_0x9c82('0x47')]=[{'all':!![]}];}_0x5a079a=_[_0x9c82('0x44')]({},_0x5a079a,_0x300dfc[_0x9c82('0x46')]);return db[_0x9c82('0x33')][_0x9c82('0x4c')](_0x5a079a)['then'](handleEntityNotFound(_0x2693ac,null))[_0x9c82('0x2c')](respondWithResult(_0x2693ac,null))[_0x9c82('0x4d')](handleError(_0x2693ac,null));};exports[_0x9c82('0x4e')]=function(_0x1d2b2c,_0x36f0e0){return db[_0x9c82('0x33')][_0x9c82('0x4e')](_0x1d2b2c['body'],{})['then'](function(_0x2b450d){var _0x317af8=_0x1d2b2c['user'][_0x9c82('0x4f')]({'plain':!![]});if(!_0x317af8)throw new Error(_0x9c82('0x50'));if(_0x317af8[_0x9c82('0x51')]===_0x9c82('0x52')){var _0x1cea47=_0x2b450d[_0x9c82('0x4f')]({'plain':!![]});var _0xe5e448='Teams';return db[_0x9c82('0x53')]['find']({'where':{'name':_0xe5e448,'userProfileId':_0x317af8[_0x9c82('0x54')]},'raw':!![]})[_0x9c82('0x2c')](function(_0x5f5a28){if(_0x5f5a28&&_0x5f5a28['autoAssociation']===0x0){return db['UserProfileResource'][_0x9c82('0x4e')]({'name':_0x1cea47['name'],'resourceId':_0x1cea47['id'],'type':_0x5f5a28[_0x9c82('0x2f')],'sectionId':_0x5f5a28['id']},{})[_0x9c82('0x2c')](function(){return _0x2b450d;});}else{return _0x2b450d;}})[_0x9c82('0x4d')](function(_0x50c315){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50c315);throw _0x50c315;});}return _0x2b450d;})[_0x9c82('0x2c')](respondWithResult(_0x36f0e0,0xc9))[_0x9c82('0x4d')](handleError(_0x36f0e0,null));};exports['update']=function(_0x266e15,_0x1e78c2){if(_0x266e15[_0x9c82('0x55')]['id']){delete _0x266e15[_0x9c82('0x55')]['id'];}return db[_0x9c82('0x33')][_0x9c82('0x4c')]({'where':{'id':_0x266e15[_0x9c82('0x4a')]['id']}})[_0x9c82('0x2c')](handleEntityNotFound(_0x1e78c2,null))[_0x9c82('0x2c')](saveUpdates(_0x266e15[_0x9c82('0x55')],null))[_0x9c82('0x2c')](respondWithResult(_0x1e78c2,null))[_0x9c82('0x4d')](handleError(_0x1e78c2,null));};exports[_0x9c82('0x56')]=function(_0x459789,_0x2a3fd9){var _0x1529af=_0x459789[_0x9c82('0x4a')]['id'];var _0x1346e0=[];return db[_0x9c82('0x57')][_0x9c82('0x58')](function(_0x21ab73){var _0x52808e=_0x9c82('0x59')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x52808e,{'type':db[_0x9c82('0x5a')]['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73})[_0x9c82('0x2c')](function(_0xf313b8){_0x1346e0=_[_0x9c82('0x32')](_0xf313b8,function(_0x5769f9){return Number(_0x5769f9[_0x9c82('0x5c')]);});})[_0x9c82('0x2c')](function(){var _0x5a24fc=_0x9c82('0x5d')+_0x1529af;return db['sequelize']['query'](_0x5a24fc,{'type':db[_0x9c82('0x5a')][_0x9c82('0x5e')][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x568c1b){var _0x163161=_[_0x9c82('0x32')](_0x568c1b,function(_0x5b0aee){return Number(_0x5b0aee['VoiceQueueId']);});return db[_0x9c82('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x1346e0},'VoiceQueueId':{'$in':_0x163161}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x53be16=_0x9c82('0x60')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x53be16,{'type':db[_0x9c82('0x5a')][_0x9c82('0x5e')][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0xf4d2f){var _0x42355e=_[_0x9c82('0x32')](_0xf4d2f,function(_0x4897b2){return Number(_0x4897b2['MailQueueId']);});return db[_0x9c82('0x61')][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'MailQueueId':{'$in':_0x42355e}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x92832e=_0x9c82('0x62')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x92832e,{'type':db[_0x9c82('0x5a')]['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})['then'](function(_0x24304d){var _0x2b577b=_[_0x9c82('0x32')](_0x24304d,function(_0x45a0c4){return Number(_0x45a0c4[_0x9c82('0x63')]);});return db['UserSmsQueue'][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'SmsQueueId':{'$in':_0x2b577b}},'transaction':_0x21ab73});})['then'](function(){var _0x36dddc=_0x9c82('0x64')+_0x1529af;return db[_0x9c82('0x57')]['query'](_0x36dddc,{'type':db[_0x9c82('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x46a52c){var _0x7fca6d=_['map'](_0x46a52c,function(_0x49fc68){return Number(_0x49fc68[_0x9c82('0x65')]);});return db[_0x9c82('0x66')][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'ChatQueueId':{'$in':_0x7fca6d}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x2e7bbc=_0x9c82('0x67')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x2e7bbc,{'type':db['Sequelize'][_0x9c82('0x5e')]['SELECT'],'raw':!![],'transaction':_0x21ab73});})['then'](function(_0x219b68){var _0x3305bb=_[_0x9c82('0x32')](_0x219b68,function(_0xbef456){return Number(_0xbef456[_0x9c82('0x68')]);});return db[_0x9c82('0x69')]['destroy']({'where':{'UserId':{'$in':_0x1346e0},'FaxQueueId':{'$in':_0x3305bb}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){var _0x633ed2=_0x9c82('0x6a')+_0x1529af;return db[_0x9c82('0x57')]['query'](_0x633ed2,{'type':db['Sequelize']['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x1efee7){var _0x3e673a=_[_0x9c82('0x32')](_0x1efee7,function(_0x526231){return Number(_0x526231[_0x9c82('0x6b')]);});return db[_0x9c82('0x6c')][_0x9c82('0x56')]({'where':{'UserId':{'$in':_0x1346e0},'OpenchannelQueueId':{'$in':_0x3e673a}},'transaction':_0x21ab73});})['then'](function(){var _0x3362f3=_0x9c82('0x6d')+_0x1529af;return db[_0x9c82('0x57')][_0x9c82('0x37')](_0x3362f3,{'type':db[_0x9c82('0x5a')]['QueryTypes'][_0x9c82('0x5b')],'raw':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x4daad8){var _0x5d5c07=_[_0x9c82('0x32')](_0x4daad8,function(_0x32710b){return Number(_0x32710b[_0x9c82('0x6e')]);});return db[_0x9c82('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x1346e0},'WhatsappQueueId':{'$in':_0x5d5c07}},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){return db[_0x9c82('0x70')]['find']({'where':{'TeamId':_0x1529af}});})[_0x9c82('0x2c')](function(_0x5d8a3d){if(_0x5d8a3d===null){return;}return db['UserVoicePrefix']['destroy']({'where':{'UserId':{'$in':_0x1346e0},'VoicePrefixId':_0x5d8a3d[_0x9c82('0x71')]},'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(){return db['Team'][_0x9c82('0x56')]({'where':{'id':_0x1529af},'cascade':!![],'transaction':_0x21ab73});})[_0x9c82('0x2c')](function(_0x49ce5b){if(_0x49ce5b===0x0){_0x2a3fd9[_0x9c82('0x1f')](0x194);}else{return db[_0x9c82('0x72')][_0x9c82('0x56')]({'where':{'type':_0x9c82('0x73'),'resourceId':_0x1529af},'cascade':!![],'transaction':_0x21ab73})['then'](function(){_0x2a3fd9[_0x9c82('0x20')](0xcc)['end']();});}})[_0x9c82('0x4d')](function(_0x154bd5){_0x2a3fd9[_0x9c82('0x20')](0x1f4)[_0x9c82('0x30')](_0x154bd5);});});};exports[_0x9c82('0x74')]=function(_0x41fd99,_0x20e5ae,_0x43916d){return db[_0x9c82('0x33')][_0x9c82('0x75')]({'where':{'id':_0x41fd99[_0x9c82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x20e5ae,null))[_0x9c82('0x2c')](function(_0x56f340){if(!_0x41fd99[_0x9c82('0x37')][_0x9c82('0x76')]||!utils['isValidChannel'](_0x41fd99[_0x9c82('0x37')][_0x9c82('0x76')])){throw new db[(_0x9c82('0x5a'))][(_0x9c82('0x77'))]('Unknown\x20channel');}var _0x19eb9e={};var _0x2d5f2a={};_0x2d5f2a[_0x9c82('0x36')]=_[_0x9c82('0x38')](db[_['capitalize'](_0x41fd99[_0x9c82('0x37')]['channel'][_0x9c82('0x78')]())+'Queue'][_0x9c82('0x79')]);_0x2d5f2a[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x41fd99['query']);_0x2d5f2a[_0x9c82('0x41')]=_[_0x9c82('0x39')](_0x2d5f2a[_0x9c82('0x36')],_0x2d5f2a[_0x9c82('0x37')]);_0x19eb9e[_0x9c82('0x3a')]=_[_0x9c82('0x39')](_0x2d5f2a['model'],qs[_0x9c82('0x3b')](_0x41fd99['query'][_0x9c82('0x3b')]));_0x19eb9e[_0x9c82('0x3a')]=_0x19eb9e[_0x9c82('0x3a')][_0x9c82('0x3c')]?_0x19eb9e[_0x9c82('0x3a')]:_0x2d5f2a['model'];_0x19eb9e[_0x9c82('0x24')]=qs[_0x9c82('0x24')](_0x41fd99[_0x9c82('0x37')][_0x9c82('0x24')]);_0x19eb9e[_0x9c82('0x22')]=qs[_0x9c82('0x22')](_0x41fd99[_0x9c82('0x37')]['offset']);_0x19eb9e[_0x9c82('0x3e')]=qs[_0x9c82('0x3f')](_0x41fd99[_0x9c82('0x37')][_0x9c82('0x3f')]);_0x19eb9e['where']=qs['filters'](_['pick'](_0x41fd99['query'],_0x2d5f2a[_0x9c82('0x41')]));_0x19eb9e=_[_0x9c82('0x44')]({},_0x19eb9e,_0x41fd99['options']);return _0x56f340[_0x9c82('0x4f')+_['capitalize'](_0x41fd99[_0x9c82('0x37')]['channel'][_0x9c82('0x78')]())+_0x9c82('0x7a')](_0x19eb9e);})[_0x9c82('0x2c')](respondWithResult(_0x20e5ae,null))[_0x9c82('0x4d')](handleError(_0x20e5ae,null));};exports[_0x9c82('0x7b')]=function(_0x14d224,_0x5ed631,_0x5c06c1){return db['Team']['findOne']({'where':{'id':_0x14d224[_0x9c82('0x4a')]['id']}})['then'](function(_0x5a533e){if(_0x5a533e){if(!_0x14d224[_0x9c82('0x55')][_0x9c82('0x76')]||!utils['isValidChannel'](_0x14d224[_0x9c82('0x55')][_0x9c82('0x76')])){throw new db[(_0x9c82('0x5a'))][(_0x9c82('0x77'))](_0x9c82('0x7c'));}return _0x5a533e[_0x9c82('0x7d')+_[_0x9c82('0x7e')](_0x14d224[_0x9c82('0x55')]['channel'][_0x9c82('0x78')]())+_0x9c82('0x7a')](_0x14d224[_0x9c82('0x55')][_0x9c82('0x7f')]);}return null;})[_0x9c82('0x2c')](handleEntityNotFound(_0x5ed631,null))[_0x9c82('0x2c')](respondWithStatusCode(_0x5ed631,null))['catch'](handleError(_0x5ed631,null));};exports[_0x9c82('0x80')]=function(_0x33cb30,_0x1e5d47,_0x21f6d1){return db[_0x9c82('0x33')][_0x9c82('0x75')]({'where':{'id':_0x33cb30['params']['id']}})[_0x9c82('0x2c')](function(_0x4a20c3){if(_0x4a20c3){if(!_0x33cb30[_0x9c82('0x37')][_0x9c82('0x76')]||!utils[_0x9c82('0x81')](_0x33cb30[_0x9c82('0x37')][_0x9c82('0x76')])){throw new db[(_0x9c82('0x5a'))][(_0x9c82('0x77'))](_0x9c82('0x7c'));}return _0x4a20c3[_0x9c82('0x82')+_[_0x9c82('0x7e')](_0x33cb30[_0x9c82('0x37')][_0x9c82('0x76')][_0x9c82('0x78')]())+_0x9c82('0x7a')](_0x33cb30[_0x9c82('0x37')]['ids']);}return null;})[_0x9c82('0x2c')](handleEntityNotFound(_0x1e5d47,null))[_0x9c82('0x2c')](respondWithStatusCode(_0x1e5d47,null))[_0x9c82('0x4d')](handleError(_0x1e5d47,null));};exports[_0x9c82('0x83')]=function(_0x1147d7,_0x50435a){var _0x1ca903=_[_0x9c82('0x84')](_0x1147d7[_0x9c82('0x55')][_0x9c82('0x7f')])?_0x1147d7[_0x9c82('0x55')][_0x9c82('0x7f')]:[_0x1147d7[_0x9c82('0x55')][_0x9c82('0x7f')]];var _0x390fe4=_0x1147d7[_0x9c82('0x4a')]['id'];return db[_0x9c82('0x33')][_0x9c82('0x4c')]({'where':{'id':_0x390fe4}})[_0x9c82('0x2c')](handleEntityNotFound(_0x50435a,null))['then'](function(_0x58f323){if(_0x58f323){var _0xcf642c=[_0x9c82('0x85'),_0x9c82('0x86'),_0x9c82('0x87'),_0x9c82('0x88'),_0x9c82('0x89'),'Openchannel','Whatsapp'];return db['sequelize']['transaction'](function(_0x1b264b){var _0xd04030=_[_0x9c82('0x32')](_0xcf642c,function(_0x2b9c1f){var _0x42ad2a={'attributes':['id',_0x9c82('0x2f')]};if(_0x2b9c1f===_0x9c82('0x85')){_0x42ad2a['through']={'attributes':[_0x9c82('0x8a')]};}return _0x58f323['get'+_0x2b9c1f+_0x9c82('0x7a')](_0x42ad2a)[_0x9c82('0x2c')](function(_0x265a84){var _0xd687f=_[_0x9c82('0x32')](_0x265a84,function(_0x379fdc){var _0x250081=_[_0x9c82('0x32')](_0x1ca903,function(_0x3e38f3){var _0x45b3fa={'where':{'UserId':_0x3e38f3,[_0x2b9c1f+_0x9c82('0x8b')]:_0x379fdc['id']},'transaction':_0x1b264b};if(_0x2b9c1f===_0x9c82('0x85')){_0x45b3fa[_0x9c82('0x1a')]={'penalty':_0x379fdc[_0x9c82('0x8c')][_0x9c82('0x8a')]};}return db[_0x9c82('0x8d')+_0x2b9c1f+_0x9c82('0x8e')][_0x9c82('0x8f')](_0x45b3fa)['then'](function(){socket[_0x9c82('0x90')](_0x9c82('0x52')+_0x2b9c1f+_0x9c82('0x91'),{'UserId':_0x3e38f3,[_0x2b9c1f+_0x9c82('0x8b')]:_0x379fdc['id']});if(_0x2b9c1f!=='Voice'){return;}return db['User'][_0x9c82('0x92')]({'where':{'id':_0x1ca903,'online':0x1},'attributes':['id',_0x9c82('0x2f'),_0x9c82('0x93'),_0x9c82('0x94'),_0x9c82('0x95')],'raw':!![]})[_0x9c82('0x2c')](function(_0x4e4f69){var _0x2c32db=_[_0x9c82('0x32')](_0x4e4f69,function(_0x2951a9){return db[_0x9c82('0x96')]['upsert']({'membername':_0x2951a9[_0x9c82('0x2f')],'UserId':_0x2951a9['id'],'queue_name':_0x379fdc[_0x9c82('0x2f')],'VoiceQueueId':_0x379fdc['id'],'interface':_[_0x9c82('0x97')](_0x2951a9['interface'])?util[_0x9c82('0x98')](_0x9c82('0x99'),_0x2951a9[_0x9c82('0x2f')]):_0x2951a9[_0x9c82('0x95')],'paused':_0x2951a9[_0x9c82('0x94')]||![],'penalty':_0x379fdc[_0x9c82('0x8c')][_0x9c82('0x8a')]},{'transaction':_0x1b264b});});return Promise[_0x9c82('0x9a')](_0x2c32db);});});});return Promise['all'](_0x250081);});return Promise[_0x9c82('0x9a')](_0xd687f);})[_0x9c82('0x2c')](function(){return db[_0x9c82('0x70')][_0x9c82('0x75')]({'where':{'teamId':_0x390fe4}})[_0x9c82('0x2c')](function(_0x2a071c){if(_0x2a071c){var _0x15b51b=_[_0x9c82('0x32')](_0x1ca903,function(_0x174364){db[_0x9c82('0x9b')]['upsert']({'UserId':_0x174364,'VoicePrefixId':_0x2a071c[_0x9c82('0x71')]});});return Promise[_0x9c82('0x9a')](_0x15b51b);}});});});return Promise[_0x9c82('0x9a')](_0xd04030)['then'](function(){return _0x58f323[_0x9c82('0x83')](_0x1ca903,{'transaction':_0x1b264b})['spread'](function(_0x3195d8){return _0x3195d8;});});});}})[_0x9c82('0x2c')](respondWithResult(_0x50435a,null))[_0x9c82('0x4d')](handleError(_0x50435a,null));};exports['removeAgents']=function(_0x450e80,_0x39b849){var _0x45a002=_[_0x9c82('0x84')](_0x450e80[_0x9c82('0x37')]['ids'])?_0x450e80[_0x9c82('0x37')]['ids']:[_0x450e80[_0x9c82('0x37')][_0x9c82('0x7f')]];var _0x3e0cae=_0x450e80['params']['id'];return db[_0x9c82('0x33')]['find']({'where':{'id':_0x3e0cae}})[_0x9c82('0x2c')](handleEntityNotFound(_0x39b849,null))[_0x9c82('0x2c')](function(_0x32850b){if(_0x32850b){var _0x574970=[_0x9c82('0x85'),_0x9c82('0x86'),_0x9c82('0x87'),_0x9c82('0x88'),'Fax',_0x9c82('0x9c'),_0x9c82('0x9d')];return db[_0x9c82('0x57')]['transaction'](function(_0x40a033){var _0x392069=_[_0x9c82('0x32')](_0x574970,function(_0x1f3d21){var _0x185a37={'attributes':['id',_0x9c82('0x2f')]};return _0x32850b[_0x9c82('0x4f')+_0x1f3d21+_0x9c82('0x7a')](_0x185a37)['then'](function(_0x10e1cd){var _0x441458=_['map'](_0x10e1cd,function(_0x881ee){return _0x881ee[_0x9c82('0x9e')](_0x45a002,{'transaction':_0x40a033})[_0x9c82('0x2c')](function(){var _0x113223=_[_0x9c82('0x32')](_0x45a002,function(_0x23702b){socket['emit'](_0x9c82('0x52')+_0x1f3d21+'Queue:remove',{'UserId':Number(_0x23702b),[_0x1f3d21+_0x9c82('0x8b')]:_0x881ee['id']});if(_0x1f3d21!==_0x9c82('0x85')){return;}return db[_0x9c82('0x96')][_0x9c82('0x56')]({'where':{'VoiceQueueId':_0x881ee['id'],'UserId':_0x23702b},'transaction':_0x40a033});});return Promise['all'](_0x113223);});});return Promise[_0x9c82('0x9a')](_0x441458);});});return Promise[_0x9c82('0x9a')](_0x392069)[_0x9c82('0x2c')](function(){return _0x32850b[_0x9c82('0x9e')](_0x45a002,{'transaction':_0x40a033});})[_0x9c82('0x2c')](function(){return db[_0x9c82('0x70')][_0x9c82('0x75')]({'where':{'teamId':_0x3e0cae}})[_0x9c82('0x2c')](function(_0x422519){if(_0x422519){var _0x11e789=_[_0x9c82('0x32')](_0x45a002,function(_0xb2beff){db[_0x9c82('0x9b')][_0x9c82('0x56')]({'where':{'UserId':_0xb2beff,'VoicePrefixId':_0x422519[_0x9c82('0x71')]}});});return Promise[_0x9c82('0x9a')](_0x11e789);}});});});}})[_0x9c82('0x2c')](respondWithStatusCode(_0x39b849,null))[_0x9c82('0x4d')](handleError(_0x39b849,null));};exports[_0x9c82('0x9f')]=function(_0x549b03,_0x182290,_0x1465bd){var _0xa25cd5={};var _0x5e3308={};var _0x4532ca;var _0x265e32;return db[_0x9c82('0x33')][_0x9c82('0x75')]({'where':{'id':_0x549b03[_0x9c82('0x4a')]['id']}})[_0x9c82('0x2c')](handleEntityNotFound(_0x182290,null))['then'](function(_0x18924b){if(_0x18924b){_0x4532ca=_0x18924b;_0x5e3308['model']=_[_0x9c82('0x38')](db['User'][_0x9c82('0x79')]);_0x5e3308[_0x9c82('0x37')]=_[_0x9c82('0x38')](_0x549b03[_0x9c82('0x37')]);_0x5e3308['filters']=_[_0x9c82('0x39')](_0x5e3308[_0x9c82('0x36')],_0x5e3308[_0x9c82('0x37')]);_0xa25cd5[_0x9c82('0x3a')]=_[_0x9c82('0x39')](_0x5e3308['model'],qs['fields'](_0x549b03['query']['fields']));_0xa25cd5['attributes']=_0xa25cd5[_0x9c82('0x3a')]['length']?_0xa25cd5[_0x9c82('0x3a')]:_0x5e3308[_0x9c82('0x36')];_0xa25cd5['order']=qs['sort'](_0x549b03['query'][_0x9c82('0x3f')]);_0xa25cd5['where']=qs[_0x9c82('0x41')](_[_0x9c82('0x42')](_0x549b03[_0x9c82('0x37')],_0x5e3308[_0x9c82('0x41')]));if(_0x549b03['query'][_0x9c82('0x43')]){_0xa25cd5['where']=_[_0x9c82('0x44')](_0xa25cd5[_0x9c82('0x40')],{'$or':_['map'](_0xa25cd5[_0x9c82('0x3a')],function(_0x4b87d0){var _0x4dbb1f={};_0x4dbb1f[_0x4b87d0]={'$like':'%'+_0x549b03[_0x9c82('0x37')]['filter']+'%'};return _0x4dbb1f;})});}_0xa25cd5=_[_0x9c82('0x44')]({},_0xa25cd5,_0x549b03[_0x9c82('0x46')]);return _0x4532ca[_0x9c82('0x9f')](_0xa25cd5);}})[_0x9c82('0x2c')](function(_0x1a78e7){if(_0x1a78e7){_0x265e32=_0x1a78e7[_0x9c82('0x3c')];if(!_0x549b03[_0x9c82('0x37')][_0x9c82('0x3d')](_0x9c82('0xa0'))){_0xa25cd5[_0x9c82('0x24')]=qs['limit'](_0x549b03['query'][_0x9c82('0x24')]);_0xa25cd5['offset']=qs[_0x9c82('0x22')](_0x549b03[_0x9c82('0x37')][_0x9c82('0x22')]);}return _0x4532ca[_0x9c82('0x9f')](_0xa25cd5);}})[_0x9c82('0x2c')](function(_0x397073){if(_0x397073){return _0x397073?{'count':_0x265e32,'rows':_0x397073}:null;}})[_0x9c82('0x2c')](respondWithResult(_0x182290,null))[_0x9c82('0x4d')](handleError(_0x182290,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 637858c..750e708 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 _0x1546=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1546,0x1ef));var _0x6154=function(_0x4c1d1e,_0x1edf4b){_0x4c1d1e=_0x4c1d1e-0x0;var _0x14fca5=_0x1546[_0x4c1d1e];return _0x14fca5;};'use strict';var EventEmitter=require(_0x6154('0x0'));var Team=require(_0x6154('0x1'))['db'][_0x6154('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x6154('0x3')](0x0);var events={'afterCreate':_0x6154('0x4'),'afterUpdate':_0x6154('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4dffba){return function(_0x52fea8,_0x196c5b,_0x3d4113){TeamEvents[_0x6154('0x6')](_0x4dffba+':'+_0x52fea8['id'],_0x52fea8);TeamEvents['emit'](_0x4dffba,_0x52fea8);_0x3d4113(null);};}for(var e in events){if(events[_0x6154('0x7')](e)){var event=events[e];Team[_0x6154('0x8')](e,emitEvent(event));}}module[_0x6154('0x9')]=TeamEvents; \ No newline at end of file +var _0xfd39=['Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x272973,_0x3a8224){var _0x1c95b1=function(_0x397bae){while(--_0x397bae){_0x272973['push'](_0x272973['shift']());}};_0x1c95b1(++_0x3a8224);}(_0xfd39,0x115));var _0x9fd3=function(_0x5d5004,_0x5418ca){_0x5d5004=_0x5d5004-0x0;var _0x117e4d=_0xfd39[_0x5d5004];return _0x117e4d;};'use strict';var EventEmitter=require(_0x9fd3('0x0'));var Team=require(_0x9fd3('0x1'))['db'][_0x9fd3('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9fd3('0x3')](0x0);var events={'afterCreate':_0x9fd3('0x4'),'afterUpdate':_0x9fd3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d1bf3){return function(_0x1b15fa,_0x28e8da,_0x39fa2f){TeamEvents[_0x9fd3('0x6')](_0x4d1bf3+':'+_0x1b15fa['id'],_0x1b15fa);TeamEvents[_0x9fd3('0x6')](_0x4d1bf3,_0x1b15fa);_0x39fa2f(null);};}for(var e in events){if(events[_0x9fd3('0x7')](e)){var event=events[e];Team[_0x9fd3('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index c9be847..be9669d 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 _0x53c5=['Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','map','all','lodash','./team.attributes','get','Queues','then','setDataValue','catch','exports','define','Team','Chat'];(function(_0x5285f9,_0x2bd7d7){var _0x6edc0c=function(_0x5ae671){while(--_0x5ae671){_0x5285f9['push'](_0x5285f9['shift']());}};_0x6edc0c(++_0x2bd7d7);}(_0x53c5,0x185));var _0x553c=function(_0x1355a2,_0x4ced1c){_0x1355a2=_0x1355a2-0x0;var _0x1512bc=_0x53c5[_0x1355a2];return _0x1512bc;};'use strict';var _=require(_0x553c('0x0'));var attributes=require(_0x553c('0x1'));function getQueuesByChannel(_0x4bb2da,_0x263fdb){var _0x4ecf8d=_0x553c('0x2')+_0x263fdb+_0x553c('0x3');return _0x4bb2da[_0x4ecf8d]()[_0x553c('0x4')](function(_0x38699e){return _['map'](_0x38699e,function(_0x141f92){_0x141f92[_0x553c('0x5')]('channel',_0x263fdb);return _0x141f92;});})[_0x553c('0x6')](function(_0x4c26bb){throw _0x4c26bb;});}module[_0x553c('0x7')]=function(_0x1c1a09){return _0x1c1a09[_0x553c('0x8')](_0x553c('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x23b68a=this;var _0x3aaae0=[_0x553c('0xa'),_0x553c('0xb'),_0x553c('0xc'),_0x553c('0xd'),_0x553c('0xe'),_0x553c('0xf'),_0x553c('0x10')];return Promise[_0x553c('0x11')]()[_0x553c('0x4')](function(){var _0x8d4b8f=_[_0x553c('0x12')](_0x3aaae0,function(_0x371215){return getQueuesByChannel(_0x23b68a,_0x371215);});return Promise[_0x553c('0x13')](_0x8d4b8f);})[_0x553c('0x6')](function(_0xf822b8){throw _0xf822b8;});}}});}; \ No newline at end of file +var _0xab30=['exports','define','Team','Mail','Openchannel','Voice','Whatsapp','all','lodash','./team.attributes','get','Queues','then','map','channel','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xab30,0xe8));var _0x0ab3=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xab30[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x0ab3('0x0'));var attributes=require(_0x0ab3('0x1'));function getQueuesByChannel(_0x4aebd8,_0x1d66ad){var _0x743d78=_0x0ab3('0x2')+_0x1d66ad+_0x0ab3('0x3');return _0x4aebd8[_0x743d78]()[_0x0ab3('0x4')](function(_0xec93df){return _[_0x0ab3('0x5')](_0xec93df,function(_0x44748f){_0x44748f['setDataValue'](_0x0ab3('0x6'),_0x1d66ad);return _0x44748f;});})[_0x0ab3('0x7')](function(_0xef768c){throw _0xef768c;});}module[_0x0ab3('0x8')]=function(_0x26956e){return _0x26956e[_0x0ab3('0x9')](_0x0ab3('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xb15535=this;var _0x17d8d0=['Chat','Fax',_0x0ab3('0xb'),_0x0ab3('0xc'),'Sms',_0x0ab3('0xd'),_0x0ab3('0xe')];return Promise['resolve']()[_0x0ab3('0x4')](function(){var _0x2e8324=_[_0x0ab3('0x5')](_0x17d8d0,function(_0x196484){return getQueuesByChannel(_0xb15535,_0x196484);});return Promise[_0x0ab3('0xf')](_0x2e8324);})['catch'](function(_0x3c2296){throw _0x3c2296;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 27b95cc..9cab383 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 _0xd658=['defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x42004d,_0x127961){var _0xb47cd4=function(_0x5a3b8d){while(--_0x5a3b8d){_0x42004d['push'](_0x42004d['shift']());}};_0xb47cd4(++_0x127961);}(_0xd658,0xe8));var _0x8d65=function(_0x52b6e5,_0x103814){_0x52b6e5=_0x52b6e5-0x0;var _0x5a9012=_0xd658[_0x52b6e5];return _0x5a9012;};'use strict';var _=require('lodash');var util=require(_0x8d65('0x0'));var moment=require(_0x8d65('0x1'));var BPromise=require(_0x8d65('0x2'));var rs=require(_0x8d65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8d65('0x4'));var logger=require(_0x8d65('0x5'))(_0x8d65('0x6'));var config=require(_0x8d65('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8d65('0x8')][_0x8d65('0x9')]({'port':0x232a});config[_0x8d65('0xa')]=_[_0x8d65('0xb')](config[_0x8d65('0xa')],{'host':_0x8d65('0xc'),'port':0x18eb});var socket=require(_0x8d65('0xd'))(new Redis(config[_0x8d65('0xa')]));require(_0x8d65('0xe'))[_0x8d65('0xf')](socket);function respondWithRpcPromise(_0x471f09,_0x2304ec,_0x50ff95){return new BPromise(function(_0x3a42ca,_0x48469f){return client['request'](_0x471f09,_0x50ff95)[_0x8d65('0x10')](function(_0x4b8bc1){logger[_0x8d65('0x11')](_0x8d65('0x12'),_0x2304ec,'request\x20sent');logger[_0x8d65('0x13')](_0x8d65('0x14'),_0x2304ec,'request\x20sent',JSON[_0x8d65('0x15')](_0x4b8bc1));if(_0x4b8bc1[_0x8d65('0x16')]){if(_0x4b8bc1['error'][_0x8d65('0x17')]===0x1f4){logger[_0x8d65('0x16')](_0x8d65('0x12'),_0x2304ec,_0x4b8bc1[_0x8d65('0x16')][_0x8d65('0x18')]);return _0x48469f(_0x4b8bc1['error']['message']);}logger[_0x8d65('0x16')](_0x8d65('0x12'),_0x2304ec,_0x4b8bc1[_0x8d65('0x16')][_0x8d65('0x18')]);return _0x3a42ca(_0x4b8bc1[_0x8d65('0x16')][_0x8d65('0x18')]);}else{logger[_0x8d65('0x11')](_0x8d65('0x12'),_0x2304ec,_0x8d65('0x19'));_0x3a42ca(_0x4b8bc1['result'][_0x8d65('0x18')]);}})[_0x8d65('0x1a')](function(_0x1b0cf0){logger[_0x8d65('0x16')](_0x8d65('0x12'),_0x2304ec,_0x1b0cf0);_0x48469f(_0x1b0cf0);});});} \ No newline at end of file +var _0x4290=['result','catch','lodash','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','localhost','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x3ca115,_0x286520){var _0x1538bc=function(_0x2f891b){while(--_0x2f891b){_0x3ca115['push'](_0x3ca115['shift']());}};_0x1538bc(++_0x286520);}(_0x4290,0xf2));var _0x0429=function(_0x3bc231,_0x12dfd6){_0x3bc231=_0x3bc231-0x0;var _0x3c301c=_0x4290[_0x3bc231];return _0x3c301c;};'use strict';var _=require(_0x0429('0x0'));var util=require('util');var moment=require(_0x0429('0x1'));var BPromise=require('bluebird');var rs=require(_0x0429('0x2'));var fs=require('fs');var Redis=require(_0x0429('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0429('0x4'));var config=require(_0x0429('0x5'));var jayson=require(_0x0429('0x6'));var client=jayson[_0x0429('0x7')]['http']({'port':0x232a});config[_0x0429('0x8')]=_['defaults'](config[_0x0429('0x8')],{'host':_0x0429('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0429('0x8')]));require(_0x0429('0xa'))[_0x0429('0xb')](socket);function respondWithRpcPromise(_0x6cd787,_0x1895a2,_0x3102c0){return new BPromise(function(_0x6b28ed,_0x1f21bc){return client[_0x0429('0xc')](_0x6cd787,_0x3102c0)[_0x0429('0xd')](function(_0x3d4dd6){logger['info'](_0x0429('0xe'),_0x1895a2,_0x0429('0xf'));logger[_0x0429('0x10')](_0x0429('0x11'),_0x1895a2,_0x0429('0xf'),JSON[_0x0429('0x12')](_0x3d4dd6));if(_0x3d4dd6[_0x0429('0x13')]){if(_0x3d4dd6[_0x0429('0x13')]['code']===0x1f4){logger[_0x0429('0x13')]('Team,\x20%s,\x20%s',_0x1895a2,_0x3d4dd6[_0x0429('0x13')][_0x0429('0x14')]);return _0x1f21bc(_0x3d4dd6[_0x0429('0x13')][_0x0429('0x14')]);}logger[_0x0429('0x13')](_0x0429('0xe'),_0x1895a2,_0x3d4dd6[_0x0429('0x13')][_0x0429('0x14')]);return _0x6b28ed(_0x3d4dd6['error'][_0x0429('0x14')]);}else{logger[_0x0429('0x15')](_0x0429('0xe'),_0x1895a2,_0x0429('0xf'));_0x6b28ed(_0x3d4dd6[_0x0429('0x16')][_0x0429('0x14')]);}})[_0x0429('0x17')](function(_0xf17bff){logger[_0x0429('0x13')]('Team,\x20%s,\x20%s',_0x1895a2,_0xf17bff);_0x1f21bc(_0xf17bff);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2a87033..2321bf7 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 _0x453b=['emit','removeListener','register','length','team:','./team.events','save','remove','update'];(function(_0x40d8b9,_0x12488e){var _0x1ea7bf=function(_0x182840){while(--_0x182840){_0x40d8b9['push'](_0x40d8b9['shift']());}};_0x1ea7bf(++_0x12488e);}(_0x453b,0x164));var _0xb453=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0x453b[_0x143a91];return _0x1906f5;};'use strict';var TeamEvents=require(_0xb453('0x0'));var events=[_0xb453('0x1'),_0xb453('0x2'),_0xb453('0x3')];function createListener(_0x20affe,_0x3ad3a7){return function(_0x2abbc6){_0x3ad3a7[_0xb453('0x4')](_0x20affe,_0x2abbc6);};}function removeListener(_0x380c0b,_0x1314f4){return function(){TeamEvents[_0xb453('0x5')](_0x380c0b,_0x1314f4);};}exports[_0xb453('0x6')]=function(_0x434695){for(var _0x4d7c1e=0x0,_0x1ab841=events[_0xb453('0x7')];_0x4d7c1e<_0x1ab841;_0x4d7c1e++){var _0x4fdd93=events[_0x4d7c1e];var _0x12c490=createListener(_0xb453('0x8')+_0x4fdd93,_0x434695);TeamEvents['on'](_0x4fdd93,_0x12c490);}}; \ No newline at end of file +var _0x60a5=['update','emit','removeListener','register','team:','./team.events'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x60a5,0x83));var _0x560a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x60a5[_0x2dafbe];return _0x58a45a;};'use strict';var TeamEvents=require(_0x560a('0x0'));var events=['save','remove',_0x560a('0x1')];function createListener(_0x58528d,_0x4ebe35){return function(_0xc047a6){_0x4ebe35[_0x560a('0x2')](_0x58528d,_0xc047a6);};}function removeListener(_0xe97b87,_0x5f1104){return function(){TeamEvents[_0x560a('0x3')](_0xe97b87,_0x5f1104);};}exports[_0x560a('0x4')]=function(_0x3856ae){for(var _0x5aaec6=0x0,_0x52fa23=events['length'];_0x5aaec6<_0x52fa23;_0x5aaec6++){var _0x53a664=events[_0x5aaec6];var _0x3ac39e=createListener(_0x560a('0x5')+_0x53a664,_0x3856ae);TeamEvents['on'](_0x53a664,_0x3ac39e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index c9db801..165c85e 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 _0x6ce9=['INTEGER','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6ce9,0x76));var _0x96ce=function(_0x5bf016,_0x38a8e8){_0x5bf016=_0x5bf016-0x0;var _0xbe20b6=_0x6ce9[_0x5bf016];return _0xbe20b6;};'use strict';var Sequelize=require(_0x96ce('0x0'));module[_0x96ce('0x1')]={'TeamId':{'type':Sequelize[_0x96ce('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7d19=['sequelize','INTEGER'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x7d19,0x9e));var _0x97d1=function(_0x2cd8a4,_0x51fb40){_0x2cd8a4=_0x2cd8a4-0x0;var _0x375630=_0x7d19[_0x2cd8a4];return _0x375630;};'use strict';var Sequelize=require(_0x97d1('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x97d1('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x97d1('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 64a02c6..6fe2f7c 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 _0xeffd=['request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xeffd,0x6b));var _0xdeff=function(_0x3d5bef,_0xbda859){_0x3d5bef=_0x3d5bef-0x0;var _0x1e7cc6=_0xeffd[_0x3d5bef];return _0x1e7cc6;};'use strict';var _=require(_0xdeff('0x0'));var util=require('util');var logger=require(_0xdeff('0x1'))(_0xdeff('0x2'));var moment=require(_0xdeff('0x3'));var BPromise=require(_0xdeff('0x4'));var rp=require(_0xdeff('0x5'));var fs=require('fs');var path=require(_0xdeff('0x6'));var rimraf=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var attributes=require(_0xdeff('0x9'));module[_0xdeff('0xa')]=function(_0x1ed641,_0x132631){return _0x1ed641[_0xdeff('0xb')](_0xdeff('0xc'),attributes,{'tableName':_0xdeff('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x608a=['path','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4f653f,_0x6a5fb1){var _0x4ce5bd=function(_0x4ebcf8){while(--_0x4ebcf8){_0x4f653f['push'](_0x4f653f['shift']());}};_0x4ce5bd(++_0x6a5fb1);}(_0x608a,0xff));var _0xa608=function(_0x43b0d6,_0x565f5e){_0x43b0d6=_0x43b0d6-0x0;var _0xb62482=_0x608a[_0x43b0d6];return _0xb62482;};'use strict';var _=require('lodash');var util=require(_0xa608('0x0'));var logger=require(_0xa608('0x1'))('api');var moment=require(_0xa608('0x2'));var BPromise=require(_0xa608('0x3'));var rp=require(_0xa608('0x4'));var fs=require('fs');var path=require(_0xa608('0x5'));var rimraf=require('rimraf');var config=require(_0xa608('0x6'));var attributes=require(_0xa608('0x7'));module['exports']=function(_0x4e24d6,_0x3b0f4e){return _0x4e24d6['define'](_0xa608('0x8'),attributes,{'tableName':_0xa608('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 4108ff1..e8ce8cf 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x314815,_0x15c294){var _0x5caa59=function(_0x24fd14){while(--_0x24fd14){_0x314815['push'](_0x314815['shift']());}};_0x5caa59(++_0x15c294);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x253ed4,_0x342aca){var _0x22df23=function(_0x5ebbfa){while(--_0x5ebbfa){_0x253ed4['push'](_0x253ed4['shift']());}};_0x22df23(++_0x342aca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 759a340..d75bed5 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 _0x4e45=['INTEGER','sequelize','exports'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0x4e45,0x124));var _0x54e4=function(_0x4ba468,_0x3f1c40){_0x4ba468=_0x4ba468-0x0;var _0xc30dfc=_0x4e45[_0x4ba468];return _0xc30dfc;};'use strict';var Sequelize=require(_0x54e4('0x0'));module[_0x54e4('0x1')]={'penalty':{'type':Sequelize[_0x54e4('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x89ca=['sequelize'];(function(_0x4c3296,_0x262566){var _0x5260de=function(_0x2543c6){while(--_0x2543c6){_0x4c3296['push'](_0x4c3296['shift']());}};_0x5260de(++_0x262566);}(_0x89ca,0xe3));var _0xa89c=function(_0x285a0e,_0x13b8e5){_0x285a0e=_0x285a0e-0x0;var _0x39018f=_0x89ca[_0x285a0e];return _0x39018f;};'use strict';var Sequelize=require(_0xa89c('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 71fcccb..bd448b2 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 _0x34b2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','team_has_voice_queues','lodash','util'];(function(_0x19d701,_0xd502c1){var _0x5b4dec=function(_0x147ce3){while(--_0x147ce3){_0x19d701['push'](_0x19d701['shift']());}};_0x5b4dec(++_0xd502c1);}(_0x34b2,0x11c));var _0x234b=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0x34b2[_0x499ca5];return _0x7bfd9c;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var logger=require(_0x234b('0x2'))(_0x234b('0x3'));var moment=require(_0x234b('0x4'));var BPromise=require(_0x234b('0x5'));var rp=require(_0x234b('0x6'));var fs=require('fs');var path=require(_0x234b('0x7'));var rimraf=require(_0x234b('0x8'));var config=require(_0x234b('0x9'));var attributes=require(_0x234b('0xa'));module[_0x234b('0xb')]=function(_0x412014,_0x4e814f){return _0x412014['define']('TeamVoiceQueue',attributes,{'tableName':_0x234b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefbf=['./teamVoiceQueue.attributes','define','TeamVoiceQueue','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5f0c67,_0xc0e2c8){var _0x119e60=function(_0x260054){while(--_0x260054){_0x5f0c67['push'](_0x5f0c67['shift']());}};_0x119e60(++_0xc0e2c8);}(_0xefbf,0xa3));var _0xfefb=function(_0x33bd66,_0x656d68){_0x33bd66=_0x33bd66-0x0;var _0x55987b=_0xefbf[_0x33bd66];return _0x55987b;};'use strict';var _=require(_0xfefb('0x0'));var util=require(_0xfefb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfefb('0x2'));var rp=require(_0xfefb('0x3'));var fs=require('fs');var path=require(_0xfefb('0x4'));var rimraf=require(_0xfefb('0x5'));var config=require(_0xfefb('0x6'));var attributes=require(_0xfefb('0x7'));module['exports']=function(_0xaac208,_0x58c767){return _0xaac208[_0xfefb('0x8')](_0xfefb('0x9'),attributes,{'tableName':'team_has_voice_queues','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 1faa92f..6ea5502 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 _0xae99=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x3043e0,_0x558eb7){var _0xc59610=function(_0x561d37){while(--_0x561d37){_0x3043e0['push'](_0x3043e0['shift']());}};_0xc59610(++_0x558eb7);}(_0xae99,0x172));var _0x9ae9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xae99[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x9ae9('0x0'));var util=require(_0x9ae9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ae9('0x2'));var db=require(_0x9ae9('0x3'))['db'];var utils=require(_0x9ae9('0x4'));var logger=require(_0x9ae9('0x5'))(_0x9ae9('0x6'));var config=require(_0x9ae9('0x7'));var jayson=require(_0x9ae9('0x8'));var client=jayson[_0x9ae9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e2871,_0x1eeea9,_0x5e1734){return new BPromise(function(_0x61398c,_0x2c6eb5){return client[_0x9ae9('0xa')](_0x5e2871,_0x5e1734)['then'](function(_0x193030){logger[_0x9ae9('0xb')](_0x9ae9('0xc'),_0x1eeea9,_0x9ae9('0xd'));logger[_0x9ae9('0xe')](_0x9ae9('0xf'),_0x1eeea9,_0x9ae9('0xd'),JSON[_0x9ae9('0x10')](_0x193030));if(_0x193030[_0x9ae9('0x11')]){if(_0x193030[_0x9ae9('0x11')][_0x9ae9('0x12')]===0x1f4){logger[_0x9ae9('0x11')](_0x9ae9('0xc'),_0x1eeea9,_0x193030[_0x9ae9('0x11')][_0x9ae9('0x13')]);return _0x2c6eb5(_0x193030[_0x9ae9('0x11')][_0x9ae9('0x13')]);}logger[_0x9ae9('0x11')](_0x9ae9('0xc'),_0x1eeea9,_0x193030[_0x9ae9('0x11')][_0x9ae9('0x13')]);return _0x61398c(_0x193030[_0x9ae9('0x11')][_0x9ae9('0x13')]);}else{logger[_0x9ae9('0xb')](_0x9ae9('0xc'),_0x1eeea9,'request\x20sent');_0x61398c(_0x193030[_0x9ae9('0x14')][_0x9ae9('0x13')]);}})[_0x9ae9('0x15')](function(_0x5bc5d2){logger[_0x9ae9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1eeea9,_0x5bc5d2);_0x2c6eb5(_0x5bc5d2);});});} \ No newline at end of file +var _0xea10=['error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4a3971,_0x3fe958){var _0x1db582=function(_0x1377cb){while(--_0x1377cb){_0x4a3971['push'](_0x4a3971['shift']());}};_0x1db582(++_0x3fe958);}(_0xea10,0x1d2));var _0x0ea1=function(_0x533b7d,_0x38dc92){_0x533b7d=_0x533b7d-0x0;var _0x2fc804=_0xea10[_0x533b7d];return _0x2fc804;};'use strict';var _=require(_0x0ea1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0ea1('0x1'));var rs=require(_0x0ea1('0x2'));var fs=require('fs');var Redis=require(_0x0ea1('0x3'));var db=require(_0x0ea1('0x4'))['db'];var utils=require(_0x0ea1('0x5'));var logger=require('../../config/logger')(_0x0ea1('0x6'));var config=require(_0x0ea1('0x7'));var jayson=require(_0x0ea1('0x8'));var client=jayson[_0x0ea1('0x9')][_0x0ea1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e5679,_0x374af5,_0x5cd631){return new BPromise(function(_0x3cc085,_0x571eec){return client[_0x0ea1('0xb')](_0x2e5679,_0x5cd631)['then'](function(_0xb65d0a){logger[_0x0ea1('0xc')](_0x0ea1('0xd'),_0x374af5,_0x0ea1('0xe'));logger[_0x0ea1('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x374af5,_0x0ea1('0xe'),JSON[_0x0ea1('0x10')](_0xb65d0a));if(_0xb65d0a[_0x0ea1('0x11')]){if(_0xb65d0a[_0x0ea1('0x11')]['code']===0x1f4){logger[_0x0ea1('0x11')](_0x0ea1('0xd'),_0x374af5,_0xb65d0a[_0x0ea1('0x11')][_0x0ea1('0x12')]);return _0x571eec(_0xb65d0a[_0x0ea1('0x11')]['message']);}logger[_0x0ea1('0x11')](_0x0ea1('0xd'),_0x374af5,_0xb65d0a[_0x0ea1('0x11')][_0x0ea1('0x12')]);return _0x3cc085(_0xb65d0a[_0x0ea1('0x11')][_0x0ea1('0x12')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x374af5,_0x0ea1('0xe'));_0x3cc085(_0xb65d0a[_0x0ea1('0x13')]['message']);}})[_0x0ea1('0x14')](function(_0x3ffdfd){logger[_0x0ea1('0x11')](_0x0ea1('0xd'),_0x374af5,_0x3ffdfd);_0x571eec(_0x3ffdfd);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c026c52..692a37f 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 _0x7096=['destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7096,0x10c));var _0x6709=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7096[_0x5b561d];return _0x431060;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var fs_extra=require(_0x6709('0x3'));var auth=require(_0x6709('0x4'));var interaction=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var controller=require(_0x6709('0x7'));router[_0x6709('0x8')]('/',auth[_0x6709('0x9')](),controller[_0x6709('0xa')]);router[_0x6709('0x8')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6709('0xd')]);router[_0x6709('0xe')](_0x6709('0xb'),auth[_0x6709('0x9')](),controller[_0x6709('0xf')]);router[_0x6709('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6709('0x11')]);module[_0x6709('0x12')]=router; \ No newline at end of file +var _0xd9eb=['../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x17349c,_0x53c5db){var _0x37044a=function(_0x366404){while(--_0x366404){_0x17349c['push'](_0x17349c['shift']());}};_0x37044a(++_0x53c5db);}(_0xd9eb,0xca));var _0xbd9e=function(_0x5d10c2,_0x4b0a49){_0x5d10c2=_0x5d10c2-0x0;var _0x57c7c4=_0xd9eb[_0x5d10c2];return _0x57c7c4;};'use strict';var multer=require(_0xbd9e('0x0'));var util=require(_0xbd9e('0x1'));var path=require(_0xbd9e('0x2'));var timeout=require(_0xbd9e('0x3'));var express=require(_0xbd9e('0x4'));var router=express[_0xbd9e('0x5')]();var fs_extra=require(_0xbd9e('0x6'));var auth=require(_0xbd9e('0x7'));var interaction=require(_0xbd9e('0x8'));var config=require(_0xbd9e('0x9'));var controller=require(_0xbd9e('0xa'));router[_0xbd9e('0xb')]('/',auth[_0xbd9e('0xc')](),controller['index']);router[_0xbd9e('0xb')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0xe')]);router[_0xbd9e('0xf')]('/',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x10')]);router[_0xbd9e('0x11')](_0xbd9e('0xd'),auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x12')]);router[_0xbd9e('0x13')]('/:id',auth[_0xbd9e('0xc')](),controller[_0xbd9e('0x14')]);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 ee5c264..a61353d 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 _0xcae2=['TEXT','sequelize','exports','STRING'];(function(_0x432259,_0x23fdba){var _0x47b232=function(_0x57f178){while(--_0x57f178){_0x432259['push'](_0x432259['shift']());}};_0x47b232(++_0x23fdba);}(_0xcae2,0xd5));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x2cae('0x0'));module[_0x2cae('0x1')]={'name':{'type':Sequelize[_0x2cae('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x2cae('0x3')]}}; \ No newline at end of file +var _0xd8c9=['sequelize','STRING','TEXT'];(function(_0x15821d,_0x3d3029){var _0x5e443c=function(_0x23bc30){while(--_0x23bc30){_0x15821d['push'](_0x15821d['shift']());}};_0x5e443c(++_0x3d3029);}(_0xd8c9,0x132));var _0x9d8c=function(_0x27b73d,_0x4e13c6){_0x27b73d=_0x27b73d-0x0;var _0x7d30c3=_0xd8c9[_0x27b73d];return _0x7d30c3;};'use strict';var Sequelize=require(_0x9d8c('0x0'));module['exports']={'name':{'type':Sequelize[_0x9d8c('0x1')]},'description':{'type':Sequelize[_0x9d8c('0x1')]},'html':{'type':Sequelize[_0x9d8c('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 02499b3..3845655 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 _0x8056=['where','pick','filter','VIRTUAL','options','include','findAll','show','params','fields','includeAll','merge','find','catch','create','body','user','get','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','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','Templates','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort'];(function(_0x569bf8,_0x8e0b67){var _0x575c87=function(_0x2df61f){while(--_0x2df61f){_0x569bf8['push'](_0x569bf8['shift']());}};_0x575c87(++_0x8e0b67);}(_0x8056,0x16e));var _0x6805=function(_0x4360c4,_0x2f8209){_0x4360c4=_0x4360c4-0x0;var _0x3168c8=_0x8056[_0x4360c4];return _0x3168c8;};'use strict';var emlformat=require(_0x6805('0x0'));var rimraf=require(_0x6805('0x1'));var zipdir=require(_0x6805('0x2'));var jsonpatch=require(_0x6805('0x3'));var rp=require(_0x6805('0x4'));var moment=require(_0x6805('0x5'));var BPromise=require(_0x6805('0x6'));var Mustache=require('mustache');var util=require(_0x6805('0x7'));var path=require(_0x6805('0x8'));var sox=require('sox');var csv=require(_0x6805('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6805('0xa'));var _=require(_0x6805('0xb'));var squel=require(_0x6805('0xc'));var crypto=require(_0x6805('0xd'));var jsforce=require(_0x6805('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6805('0xf'));var Papa=require(_0x6805('0x10'));var Redis=require(_0x6805('0x11'));var authService=require(_0x6805('0x12'));var qs=require(_0x6805('0x13'));var as=require(_0x6805('0x14'));var hardwareService=require(_0x6805('0x15'));var logger=require(_0x6805('0x16'))(_0x6805('0x17'));var utils=require('../../config/utils');var config=require(_0x6805('0x18'));var licenseUtil=require(_0x6805('0x19'));var db=require(_0x6805('0x1a'))['db'];function respondWithStatusCode(_0x67955c,_0x404e9d){_0x404e9d=_0x404e9d||0xcc;return function(_0x6d018a){if(_0x6d018a){return _0x67955c['sendStatus'](_0x404e9d);}return _0x67955c[_0x6805('0x1b')](_0x404e9d)['end']();};}function respondWithResult(_0x11a639,_0x1262d2){_0x1262d2=_0x1262d2||0xc8;return function(_0x1acd10){if(_0x1acd10){return _0x11a639[_0x6805('0x1b')](_0x1262d2)['json'](_0x1acd10);}};}function respondWithFilteredResult(_0x5d9418,_0x5f4c29){return function(_0x54cc0d){if(_0x54cc0d){var _0x55eca0=typeof _0x5f4c29[_0x6805('0x1c')]===_0x6805('0x1d')&&typeof _0x5f4c29['limit']===_0x6805('0x1d');var _0x56c0df=_0x54cc0d[_0x6805('0x1e')];var _0x204c96=_0x55eca0?0x0:_0x5f4c29[_0x6805('0x1c')];var _0x81af93=_0x55eca0?_0x54cc0d[_0x6805('0x1e')]:_0x5f4c29[_0x6805('0x1c')]+_0x5f4c29[_0x6805('0x1f')];var _0x59de35;if(_0x81af93>=_0x56c0df){_0x81af93=_0x56c0df;_0x59de35=0xc8;}else{_0x59de35=0xce;}_0x5d9418[_0x6805('0x1b')](_0x59de35);return _0x5d9418['set'](_0x6805('0x20'),_0x204c96+'-'+_0x81af93+'/'+_0x56c0df)[_0x6805('0x21')](_0x54cc0d);}return null;};}function patchUpdates(_0x5f0cc4){return function(_0xbc5da8){try{jsonpatch['apply'](_0xbc5da8,_0x5f0cc4,!![]);}catch(_0x1ca5d7){return BPromise[_0x6805('0x22')](_0x1ca5d7);}return _0xbc5da8[_0x6805('0x23')]();};}function saveUpdates(_0x4afa45,_0x1d9400){return function(_0x52fee3){if(_0x52fee3){return _0x52fee3[_0x6805('0x24')](_0x4afa45)[_0x6805('0x25')](function(_0x2121ef){return _0x2121ef;});}return null;};}function removeEntity(_0x1deeae,_0x373fc4){return function(_0x27de69){if(_0x27de69){return _0x27de69[_0x6805('0x26')]()[_0x6805('0x25')](function(){var _0x4ecacd=_0x27de69['get']({'plain':!![]});var _0x38db07=_0x6805('0x27');return db[_0x6805('0x28')][_0x6805('0x26')]({'where':{'type':_0x38db07,'resourceId':_0x4ecacd['id']}})[_0x6805('0x25')](function(){return _0x27de69;});})[_0x6805('0x25')](function(){_0x1deeae[_0x6805('0x1b')](0xcc)[_0x6805('0x29')]();});}};}function handleEntityNotFound(_0x1f2a98,_0x317b04){return function(_0x5f17c4){if(!_0x5f17c4){_0x1f2a98[_0x6805('0x2a')](0x194);}return _0x5f17c4;};}function handleError(_0x204c3c,_0x177cf8){_0x177cf8=_0x177cf8||0x1f4;return function(_0x57be70){logger[_0x6805('0x2b')](_0x57be70[_0x6805('0x2c')]);if(_0x57be70[_0x6805('0x2d')]){delete _0x57be70[_0x6805('0x2d')];}_0x204c3c[_0x6805('0x1b')](_0x177cf8)[_0x6805('0x2e')](_0x57be70);};}exports[_0x6805('0x2f')]=function(_0x55a7bb,_0x5aa8a9){var _0x35758e={},_0x42300e={},_0x4ae596={'count':0x0,'rows':[]};var _0x215f8e=_[_0x6805('0x30')](db[_0x6805('0x31')][_0x6805('0x32')],function(_0x411a5c){return{'name':_0x411a5c[_0x6805('0x33')],'type':_0x411a5c[_0x6805('0x34')][_0x6805('0x35')]};});_0x42300e[_0x6805('0x36')]=_[_0x6805('0x30')](_0x215f8e,'name');_0x42300e['query']=_[_0x6805('0x37')](_0x55a7bb[_0x6805('0x38')]);_0x42300e[_0x6805('0x39')]=_[_0x6805('0x3a')](_0x42300e[_0x6805('0x36')],_0x42300e[_0x6805('0x38')]);_0x35758e[_0x6805('0x3b')]=_[_0x6805('0x3a')](_0x42300e['model'],qs['fields'](_0x55a7bb[_0x6805('0x38')]['fields']));_0x35758e[_0x6805('0x3b')]=_0x35758e['attributes'][_0x6805('0x3c')]?_0x35758e[_0x6805('0x3b')]:_0x42300e[_0x6805('0x36')];if(!_0x55a7bb[_0x6805('0x38')]['hasOwnProperty'](_0x6805('0x3d'))){_0x35758e[_0x6805('0x1f')]=qs[_0x6805('0x1f')](_0x55a7bb[_0x6805('0x38')][_0x6805('0x1f')]);_0x35758e[_0x6805('0x1c')]=qs[_0x6805('0x1c')](_0x55a7bb['query']['offset']);}_0x35758e[_0x6805('0x3e')]=qs[_0x6805('0x3f')](_0x55a7bb[_0x6805('0x38')][_0x6805('0x3f')]);_0x35758e[_0x6805('0x40')]=qs[_0x6805('0x39')](_[_0x6805('0x41')](_0x55a7bb[_0x6805('0x38')],_0x42300e['filters']),_0x215f8e);if(_0x55a7bb[_0x6805('0x38')][_0x6805('0x42')]){_0x35758e[_0x6805('0x40')]=_['merge'](_0x35758e['where'],{'$or':_[_0x6805('0x30')](_0x215f8e,function(_0x59d84){if(_0x59d84[_0x6805('0x34')]!==_0x6805('0x43')){var _0x5870aa={};_0x5870aa[_0x59d84[_0x6805('0x2d')]]={'$like':'%'+_0x55a7bb[_0x6805('0x38')][_0x6805('0x42')]+'%'};return _0x5870aa;}})});}_0x35758e=_['merge']({},_0x35758e,_0x55a7bb[_0x6805('0x44')]);var _0x2c62af={'where':_0x35758e['where']};return db[_0x6805('0x31')]['count'](_0x2c62af)[_0x6805('0x25')](function(_0x1787ff){_0x4ae596[_0x6805('0x1e')]=_0x1787ff;if(_0x55a7bb[_0x6805('0x38')]['includeAll']){_0x35758e[_0x6805('0x45')]=[{'all':!![]}];}return db[_0x6805('0x31')][_0x6805('0x46')](_0x35758e);})[_0x6805('0x25')](function(_0x5a5f9c){_0x4ae596['rows']=_0x5a5f9c;return _0x4ae596;})['then'](respondWithFilteredResult(_0x5aa8a9,_0x35758e))['catch'](handleError(_0x5aa8a9,null));};exports[_0x6805('0x47')]=function(_0x22e1e2,_0x1ea78f){var _0x598456={'raw':!![],'where':{'id':_0x22e1e2[_0x6805('0x48')]['id']}},_0x5a645b={};_0x5a645b[_0x6805('0x36')]=_['keys'](db[_0x6805('0x31')][_0x6805('0x32')]);_0x5a645b[_0x6805('0x38')]=_[_0x6805('0x37')](_0x22e1e2[_0x6805('0x38')]);_0x5a645b[_0x6805('0x39')]=_[_0x6805('0x3a')](_0x5a645b[_0x6805('0x36')],_0x5a645b[_0x6805('0x38')]);_0x598456['attributes']=_[_0x6805('0x3a')](_0x5a645b['model'],qs[_0x6805('0x49')](_0x22e1e2[_0x6805('0x38')][_0x6805('0x49')]));_0x598456[_0x6805('0x3b')]=_0x598456[_0x6805('0x3b')]['length']?_0x598456['attributes']:_0x5a645b[_0x6805('0x36')];if(_0x22e1e2['query'][_0x6805('0x4a')]){_0x598456[_0x6805('0x45')]=[{'all':!![]}];}_0x598456=_[_0x6805('0x4b')]({},_0x598456,_0x22e1e2['options']);return db['Template'][_0x6805('0x4c')](_0x598456)[_0x6805('0x25')](handleEntityNotFound(_0x1ea78f,null))[_0x6805('0x25')](respondWithResult(_0x1ea78f,null))[_0x6805('0x4d')](handleError(_0x1ea78f,null));};exports[_0x6805('0x4e')]=function(_0x208825,_0x3179a1){return db[_0x6805('0x31')]['create'](_0x208825[_0x6805('0x4f')],{})[_0x6805('0x25')](function(_0x3557c6){var _0x14bfd8=_0x208825[_0x6805('0x50')][_0x6805('0x51')]({'plain':!![]});if(!_0x14bfd8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14bfd8[_0x6805('0x52')]===_0x6805('0x50')){var _0x10dfbc=_0x3557c6[_0x6805('0x51')]({'plain':!![]});var _0x148623=_0x6805('0x27');return db['UserProfileSection'][_0x6805('0x4c')]({'where':{'name':_0x148623,'userProfileId':_0x14bfd8[_0x6805('0x53')]},'raw':!![]})[_0x6805('0x25')](function(_0x247ce9){if(_0x247ce9&&_0x247ce9[_0x6805('0x54')]===0x0){return db[_0x6805('0x28')][_0x6805('0x4e')]({'name':_0x10dfbc[_0x6805('0x2d')],'resourceId':_0x10dfbc['id'],'type':_0x247ce9[_0x6805('0x2d')],'sectionId':_0x247ce9['id']},{})[_0x6805('0x25')](function(){return _0x3557c6;});}else{return _0x3557c6;}})[_0x6805('0x4d')](function(_0x478b93){logger[_0x6805('0x2b')](_0x6805('0x55'),_0x478b93);throw _0x478b93;});}return _0x3557c6;})['then'](respondWithResult(_0x3179a1,0xc9))[_0x6805('0x4d')](handleError(_0x3179a1,null));};exports['update']=function(_0x5983b9,_0x512576){if(_0x5983b9[_0x6805('0x4f')]['id']){delete _0x5983b9[_0x6805('0x4f')]['id'];}return db[_0x6805('0x31')][_0x6805('0x4c')]({'where':{'id':_0x5983b9[_0x6805('0x48')]['id']}})[_0x6805('0x25')](handleEntityNotFound(_0x512576,null))[_0x6805('0x25')](saveUpdates(_0x5983b9[_0x6805('0x4f')],null))[_0x6805('0x25')](respondWithResult(_0x512576,null))[_0x6805('0x4d')](handleError(_0x512576,null));};exports[_0x6805('0x26')]=function(_0x541d27,_0x3dca27){return db[_0x6805('0x31')][_0x6805('0x4c')]({'where':{'id':_0x541d27[_0x6805('0x48')]['id']}})[_0x6805('0x25')](handleEntityNotFound(_0x3dca27,null))['then'](removeEntity(_0x3dca27,null))['catch'](handleError(_0x3dca27,null));}; \ No newline at end of file +var _0x909d=['options','then','includeAll','rows','show','params','include','find','create','body','user','role','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Templates','stack','name','map','Template','rawAttributes','fieldName','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL'];(function(_0x5dfacb,_0x112487){var _0x367f33=function(_0x28b8d8){while(--_0x28b8d8){_0x5dfacb['push'](_0x5dfacb['shift']());}};_0x367f33(++_0x112487);}(_0x909d,0x194));var _0xd909=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x909d[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xd909('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd909('0x1'));var jsonpatch=require(_0xd909('0x2'));var rp=require(_0xd909('0x3'));var moment=require(_0xd909('0x4'));var BPromise=require(_0xd909('0x5'));var Mustache=require(_0xd909('0x6'));var util=require(_0xd909('0x7'));var path=require(_0xd909('0x8'));var sox=require(_0xd909('0x9'));var csv=require('to-csv');var ejs=require(_0xd909('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd909('0xb'));var squel=require(_0xd909('0xc'));var crypto=require(_0xd909('0xd'));var jsforce=require(_0xd909('0xe'));var deskjs=require(_0xd909('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd909('0x10'));var Redis=require(_0xd909('0x11'));var authService=require(_0xd909('0x12'));var qs=require(_0xd909('0x13'));var as=require(_0xd909('0x14'));var hardwareService=require(_0xd909('0x15'));var logger=require(_0xd909('0x16'))(_0xd909('0x17'));var utils=require(_0xd909('0x18'));var config=require(_0xd909('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd909('0x1a'))['db'];function respondWithStatusCode(_0x1d1b1f,_0x4421b4){_0x4421b4=_0x4421b4||0xcc;return function(_0x16bf06){if(_0x16bf06){return _0x1d1b1f[_0xd909('0x1b')](_0x4421b4);}return _0x1d1b1f[_0xd909('0x1c')](_0x4421b4)['end']();};}function respondWithResult(_0x537e15,_0x2153e0){_0x2153e0=_0x2153e0||0xc8;return function(_0x55b6ff){if(_0x55b6ff){return _0x537e15['status'](_0x2153e0)[_0xd909('0x1d')](_0x55b6ff);}};}function respondWithFilteredResult(_0x910f88,_0x1f86eb){return function(_0x16ae54){if(_0x16ae54){var _0x26ad13=typeof _0x1f86eb[_0xd909('0x1e')]===_0xd909('0x1f')&&typeof _0x1f86eb[_0xd909('0x20')]==='undefined';var _0x1e16b4=_0x16ae54[_0xd909('0x21')];var _0x10746a=_0x26ad13?0x0:_0x1f86eb[_0xd909('0x1e')];var _0x35e96d=_0x26ad13?_0x16ae54[_0xd909('0x21')]:_0x1f86eb[_0xd909('0x1e')]+_0x1f86eb[_0xd909('0x20')];var _0x160694;if(_0x35e96d>=_0x1e16b4){_0x35e96d=_0x1e16b4;_0x160694=0xc8;}else{_0x160694=0xce;}_0x910f88[_0xd909('0x1c')](_0x160694);return _0x910f88[_0xd909('0x22')](_0xd909('0x23'),_0x10746a+'-'+_0x35e96d+'/'+_0x1e16b4)[_0xd909('0x1d')](_0x16ae54);}return null;};}function patchUpdates(_0x3fc99d){return function(_0x1138c6){try{jsonpatch[_0xd909('0x24')](_0x1138c6,_0x3fc99d,!![]);}catch(_0x2b49cd){return BPromise[_0xd909('0x25')](_0x2b49cd);}return _0x1138c6[_0xd909('0x26')]();};}function saveUpdates(_0x391829,_0x200a0){return function(_0x32af1c){if(_0x32af1c){return _0x32af1c[_0xd909('0x27')](_0x391829)['then'](function(_0x3a1684){return _0x3a1684;});}return null;};}function removeEntity(_0x1d6ec1,_0x2e84bf){return function(_0x1b1c0a){if(_0x1b1c0a){return _0x1b1c0a['destroy']()['then'](function(){var _0xc709db=_0x1b1c0a[_0xd909('0x28')]({'plain':!![]});var _0x28d2a3=_0xd909('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x28d2a3,'resourceId':_0xc709db['id']}})['then'](function(){return _0x1b1c0a;});})['then'](function(){_0x1d6ec1[_0xd909('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b9396,_0x2951a8){return function(_0x754a5e){if(!_0x754a5e){_0x4b9396[_0xd909('0x1b')](0x194);}return _0x754a5e;};}function handleError(_0x3e010b,_0x26227f){_0x26227f=_0x26227f||0x1f4;return function(_0x5aa07b){logger['error'](_0x5aa07b[_0xd909('0x2a')]);if(_0x5aa07b[_0xd909('0x2b')]){delete _0x5aa07b[_0xd909('0x2b')];}_0x3e010b['status'](_0x26227f)['send'](_0x5aa07b);};}exports['index']=function(_0x37c19b,_0x355975){var _0x44d9dc={},_0x363135={},_0x4c70d3={'count':0x0,'rows':[]};var _0x1d63fe=_[_0xd909('0x2c')](db[_0xd909('0x2d')][_0xd909('0x2e')],function(_0x2272b4){return{'name':_0x2272b4[_0xd909('0x2f')],'type':_0x2272b4['type']['key']};});_0x363135[_0xd909('0x30')]=_[_0xd909('0x2c')](_0x1d63fe,'name');_0x363135['query']=_[_0xd909('0x31')](_0x37c19b[_0xd909('0x32')]);_0x363135['filters']=_['intersection'](_0x363135[_0xd909('0x30')],_0x363135[_0xd909('0x32')]);_0x44d9dc[_0xd909('0x33')]=_[_0xd909('0x34')](_0x363135[_0xd909('0x30')],qs['fields'](_0x37c19b['query'][_0xd909('0x35')]));_0x44d9dc[_0xd909('0x33')]=_0x44d9dc[_0xd909('0x33')][_0xd909('0x36')]?_0x44d9dc[_0xd909('0x33')]:_0x363135[_0xd909('0x30')];if(!_0x37c19b[_0xd909('0x32')]['hasOwnProperty'](_0xd909('0x37'))){_0x44d9dc[_0xd909('0x20')]=qs[_0xd909('0x20')](_0x37c19b['query'][_0xd909('0x20')]);_0x44d9dc['offset']=qs[_0xd909('0x1e')](_0x37c19b['query'][_0xd909('0x1e')]);}_0x44d9dc[_0xd909('0x38')]=qs['sort'](_0x37c19b[_0xd909('0x32')][_0xd909('0x39')]);_0x44d9dc[_0xd909('0x3a')]=qs[_0xd909('0x3b')](_['pick'](_0x37c19b['query'],_0x363135['filters']),_0x1d63fe);if(_0x37c19b['query'][_0xd909('0x3c')]){_0x44d9dc['where']=_[_0xd909('0x3d')](_0x44d9dc[_0xd909('0x3a')],{'$or':_[_0xd909('0x2c')](_0x1d63fe,function(_0x2af6e6){if(_0x2af6e6[_0xd909('0x3e')]!==_0xd909('0x3f')){var _0x490f01={};_0x490f01[_0x2af6e6[_0xd909('0x2b')]]={'$like':'%'+_0x37c19b[_0xd909('0x32')][_0xd909('0x3c')]+'%'};return _0x490f01;}})});}_0x44d9dc=_['merge']({},_0x44d9dc,_0x37c19b[_0xd909('0x40')]);var _0x232961={'where':_0x44d9dc[_0xd909('0x3a')]};return db[_0xd909('0x2d')]['count'](_0x232961)[_0xd909('0x41')](function(_0x43cf90){_0x4c70d3[_0xd909('0x21')]=_0x43cf90;if(_0x37c19b['query'][_0xd909('0x42')]){_0x44d9dc['include']=[{'all':!![]}];}return db['Template']['findAll'](_0x44d9dc);})['then'](function(_0x5379d4){_0x4c70d3[_0xd909('0x43')]=_0x5379d4;return _0x4c70d3;})[_0xd909('0x41')](respondWithFilteredResult(_0x355975,_0x44d9dc))['catch'](handleError(_0x355975,null));};exports[_0xd909('0x44')]=function(_0x3d0954,_0x14f43e){var _0x2d05e6={'raw':!![],'where':{'id':_0x3d0954[_0xd909('0x45')]['id']}},_0x82aa1={};_0x82aa1[_0xd909('0x30')]=_['keys'](db[_0xd909('0x2d')][_0xd909('0x2e')]);_0x82aa1[_0xd909('0x32')]=_[_0xd909('0x31')](_0x3d0954[_0xd909('0x32')]);_0x82aa1[_0xd909('0x3b')]=_[_0xd909('0x34')](_0x82aa1['model'],_0x82aa1[_0xd909('0x32')]);_0x2d05e6[_0xd909('0x33')]=_[_0xd909('0x34')](_0x82aa1[_0xd909('0x30')],qs['fields'](_0x3d0954[_0xd909('0x32')]['fields']));_0x2d05e6[_0xd909('0x33')]=_0x2d05e6['attributes']['length']?_0x2d05e6[_0xd909('0x33')]:_0x82aa1[_0xd909('0x30')];if(_0x3d0954[_0xd909('0x32')]['includeAll']){_0x2d05e6[_0xd909('0x46')]=[{'all':!![]}];}_0x2d05e6=_[_0xd909('0x3d')]({},_0x2d05e6,_0x3d0954['options']);return db[_0xd909('0x2d')][_0xd909('0x47')](_0x2d05e6)[_0xd909('0x41')](handleEntityNotFound(_0x14f43e,null))[_0xd909('0x41')](respondWithResult(_0x14f43e,null))['catch'](handleError(_0x14f43e,null));};exports[_0xd909('0x48')]=function(_0x20f1dd,_0x3c0a65){return db[_0xd909('0x2d')]['create'](_0x20f1dd[_0xd909('0x49')],{})[_0xd909('0x41')](function(_0x103ee9){var _0x3e9ece=_0x20f1dd[_0xd909('0x4a')][_0xd909('0x28')]({'plain':!![]});if(!_0x3e9ece)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9ece[_0xd909('0x4b')]===_0xd909('0x4a')){var _0x292760=_0x103ee9[_0xd909('0x28')]({'plain':!![]});var _0x5b2941=_0xd909('0x29');return db['UserProfileSection'][_0xd909('0x47')]({'where':{'name':_0x5b2941,'userProfileId':_0x3e9ece['userProfileId']},'raw':!![]})['then'](function(_0x26a7ef){if(_0x26a7ef&&_0x26a7ef['autoAssociation']===0x0){return db['UserProfileResource'][_0xd909('0x48')]({'name':_0x292760['name'],'resourceId':_0x292760['id'],'type':_0x26a7ef[_0xd909('0x2b')],'sectionId':_0x26a7ef['id']},{})[_0xd909('0x41')](function(){return _0x103ee9;});}else{return _0x103ee9;}})[_0xd909('0x4c')](function(_0x33f148){logger['error'](_0xd909('0x4d'),_0x33f148);throw _0x33f148;});}return _0x103ee9;})[_0xd909('0x41')](respondWithResult(_0x3c0a65,0xc9))[_0xd909('0x4c')](handleError(_0x3c0a65,null));};exports[_0xd909('0x27')]=function(_0x50ee07,_0x159e9e){if(_0x50ee07[_0xd909('0x49')]['id']){delete _0x50ee07[_0xd909('0x49')]['id'];}return db[_0xd909('0x2d')]['find']({'where':{'id':_0x50ee07[_0xd909('0x45')]['id']}})[_0xd909('0x41')](handleEntityNotFound(_0x159e9e,null))[_0xd909('0x41')](saveUpdates(_0x50ee07[_0xd909('0x49')],null))[_0xd909('0x41')](respondWithResult(_0x159e9e,null))['catch'](handleError(_0x159e9e,null));};exports['destroy']=function(_0x1938f1,_0x5c08e2){return db['Template']['find']({'where':{'id':_0x1938f1[_0xd909('0x45')]['id']}})[_0xd909('0x41')](handleEntityNotFound(_0x5c08e2,null))[_0xd909('0x41')](removeEntity(_0x5c08e2,null))['catch'](handleError(_0x5c08e2,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index f0a0bcd..c4e893a 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 _0xfe64=['moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','tools_templates','util','api'];(function(_0x2f5484,_0x5bb489){var _0x284f66=function(_0x568b10){while(--_0x568b10){_0x2f5484['push'](_0x2f5484['shift']());}};_0x284f66(++_0x5bb489);}(_0xfe64,0x18a));var _0x4fe6=function(_0x2064b4,_0x4b520c){_0x2064b4=_0x2064b4-0x0;var _0x5c4873=_0xfe64[_0x2064b4];return _0x5c4873;};'use strict';var _=require('lodash');var util=require(_0x4fe6('0x0'));var logger=require('../../config/logger')(_0x4fe6('0x1'));var moment=require(_0x4fe6('0x2'));var BPromise=require(_0x4fe6('0x3'));var rp=require(_0x4fe6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fe6('0x5'));var config=require(_0x4fe6('0x6'));var attributes=require(_0x4fe6('0x7'));module[_0x4fe6('0x8')]=function(_0x29ae53,_0x308107){return _0x29ae53[_0x4fe6('0x9')]('Template',attributes,{'tableName':_0x4fe6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d25=['request-promise','path','exports','define','Template','tools_templates','lodash','util','api','moment','bluebird'];(function(_0x2cc8bb,_0x5f2607){var _0x140e40=function(_0x80d96d){while(--_0x80d96d){_0x2cc8bb['push'](_0x2cc8bb['shift']());}};_0x140e40(++_0x5f2607);}(_0x8d25,0xd7));var _0x58d2=function(_0x25134a,_0x347ce7){_0x25134a=_0x25134a-0x0;var _0x559d35=_0x8d25[_0x25134a];return _0x559d35;};'use strict';var _=require(_0x58d2('0x0'));var util=require(_0x58d2('0x1'));var logger=require('../../config/logger')(_0x58d2('0x2'));var moment=require(_0x58d2('0x3'));var BPromise=require(_0x58d2('0x4'));var rp=require(_0x58d2('0x5'));var fs=require('fs');var path=require(_0x58d2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x58d2('0x7')]=function(_0x21d7bb,_0x5392a9){return _0x21d7bb[_0x58d2('0x8')](_0x58d2('0x9'),attributes,{'tableName':_0x58d2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index dc7343d..9d1eb96 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 _0x6359=['request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6359,0x177));var _0x9635=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6359[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x9635('0x0'));var util=require(_0x9635('0x1'));var moment=require(_0x9635('0x2'));var BPromise=require(_0x9635('0x3'));var rs=require(_0x9635('0x4'));var fs=require('fs');var Redis=require(_0x9635('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9635('0x6'));var logger=require(_0x9635('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9635('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33ae65,_0x5e48e5,_0x1b7007){return new BPromise(function(_0x235737,_0x139586){return client[_0x9635('0x9')](_0x33ae65,_0x1b7007)[_0x9635('0xa')](function(_0x5af8ea){logger[_0x9635('0xb')](_0x9635('0xc'),_0x5e48e5,_0x9635('0xd'));logger[_0x9635('0xe')](_0x9635('0xf'),_0x5e48e5,_0x9635('0xd'),JSON['stringify'](_0x5af8ea));if(_0x5af8ea[_0x9635('0x10')]){if(_0x5af8ea['error'][_0x9635('0x11')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x5e48e5,_0x5af8ea['error'][_0x9635('0x12')]);return _0x139586(_0x5af8ea[_0x9635('0x10')][_0x9635('0x12')]);}logger['error'](_0x9635('0xc'),_0x5e48e5,_0x5af8ea[_0x9635('0x10')][_0x9635('0x12')]);return _0x235737(_0x5af8ea[_0x9635('0x10')][_0x9635('0x12')]);}else{logger[_0x9635('0xb')]('Template,\x20%s,\x20%s',_0x5e48e5,_0x9635('0xd'));_0x235737(_0x5af8ea['result'][_0x9635('0x12')]);}})['catch'](function(_0x3762b0){logger[_0x9635('0x10')](_0x9635('0xc'),_0x5e48e5,_0x3762b0);_0x139586(_0x3762b0);});});}exports[_0x9635('0x13')]=function(_0x331164){var _0x3a1f09=this;return new Promise(function(_0x3ace9d,_0x1dff6d){return db[_0x9635('0x14')][_0x9635('0x15')]({'raw':_0x331164[_0x9635('0x16')]?_0x331164['options'][_0x9635('0x17')]===undefined?!![]:![]:!![],'where':_0x331164[_0x9635('0x16')]?_0x331164[_0x9635('0x16')][_0x9635('0x18')]||null:null,'attributes':_0x331164[_0x9635('0x16')]?_0x331164[_0x9635('0x16')][_0x9635('0x19')]||null:null,'limit':_0x331164[_0x9635('0x16')]?_0x331164[_0x9635('0x16')][_0x9635('0x1a')]||null:null,'include':_0x331164[_0x9635('0x16')]?_0x331164[_0x9635('0x16')][_0x9635('0x1b')]?_[_0x9635('0x1c')](_0x331164[_0x9635('0x16')][_0x9635('0x1b')],function(_0x382321){return{'model':db[_0x382321[_0x9635('0x1d')]],'as':_0x382321['as'],'attributes':_0x382321['attributes'],'include':_0x382321[_0x9635('0x1b')]?_[_0x9635('0x1c')](_0x382321[_0x9635('0x1b')],function(_0x3126d4){return{'model':db[_0x3126d4[_0x9635('0x1d')]],'as':_0x3126d4['as'],'attributes':_0x3126d4[_0x9635('0x19')],'include':_0x3126d4['include']?_['map'](_0x3126d4[_0x9635('0x1b')],function(_0x27b7ab){return{'model':db[_0x27b7ab[_0x9635('0x1d')]],'as':_0x27b7ab['as'],'attributes':_0x27b7ab[_0x9635('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9635('0xa')](function(_0x4bba1a){logger[_0x9635('0xb')](_0x9635('0x13'),_0x331164);logger[_0x9635('0xe')](_0x9635('0x13'),_0x331164,JSON[_0x9635('0x1e')](_0x4bba1a));_0x3ace9d(_0x4bba1a);})[_0x9635('0x1f')](function(_0x30ae12){logger[_0x9635('0x10')](_0x9635('0x13'),_0x30ae12[_0x9635('0x12')],_0x331164);_0x1dff6d(_0x3a1f09[_0x9635('0x10')](0x1f4,_0x30ae12[_0x9635('0x12')]));});});}; \ No newline at end of file +var _0xc68f=['attributes','include','model','GetTemplate','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','catch','Template','findAll','options','raw','where'];(function(_0x1042c3,_0x3a025f){var _0x1cabbf=function(_0x15d24a){while(--_0x15d24a){_0x1042c3['push'](_0x1042c3['shift']());}};_0x1cabbf(++_0x3a025f);}(_0xc68f,0xfe));var _0xfc68=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc68f[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xfc68('0x0'));var util=require(_0xfc68('0x1'));var moment=require(_0xfc68('0x2'));var BPromise=require(_0xfc68('0x3'));var rs=require(_0xfc68('0x4'));var fs=require('fs');var Redis=require(_0xfc68('0x5'));var db=require(_0xfc68('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfc68('0x7'));var jayson=require(_0xfc68('0x8'));var client=jayson[_0xfc68('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb3d066,_0x2b4198,_0x440e65){return new BPromise(function(_0x4a83fa,_0x224464){return client[_0xfc68('0xa')](_0xb3d066,_0x440e65)[_0xfc68('0xb')](function(_0x400bac){logger[_0xfc68('0xc')]('Template,\x20%s,\x20%s',_0x2b4198,_0xfc68('0xd'));logger['debug'](_0xfc68('0xe'),_0x2b4198,_0xfc68('0xd'),JSON['stringify'](_0x400bac));if(_0x400bac[_0xfc68('0xf')]){if(_0x400bac[_0xfc68('0xf')][_0xfc68('0x10')]===0x1f4){logger[_0xfc68('0xf')](_0xfc68('0x11'),_0x2b4198,_0x400bac[_0xfc68('0xf')][_0xfc68('0x12')]);return _0x224464(_0x400bac[_0xfc68('0xf')]['message']);}logger[_0xfc68('0xf')]('Template,\x20%s,\x20%s',_0x2b4198,_0x400bac['error'][_0xfc68('0x12')]);return _0x4a83fa(_0x400bac[_0xfc68('0xf')][_0xfc68('0x12')]);}else{logger['info'](_0xfc68('0x11'),_0x2b4198,_0xfc68('0xd'));_0x4a83fa(_0x400bac['result'][_0xfc68('0x12')]);}})[_0xfc68('0x13')](function(_0x40bb4f){logger[_0xfc68('0xf')](_0xfc68('0x11'),_0x2b4198,_0x40bb4f);_0x224464(_0x40bb4f);});});}exports['GetTemplate']=function(_0x24cf09){var _0x39a5aa=this;return new Promise(function(_0x5721ee,_0x2ca744){return db[_0xfc68('0x14')][_0xfc68('0x15')]({'raw':_0x24cf09[_0xfc68('0x16')]?_0x24cf09[_0xfc68('0x16')][_0xfc68('0x17')]===undefined?!![]:![]:!![],'where':_0x24cf09[_0xfc68('0x16')]?_0x24cf09['options'][_0xfc68('0x18')]||null:null,'attributes':_0x24cf09['options']?_0x24cf09[_0xfc68('0x16')][_0xfc68('0x19')]||null:null,'limit':_0x24cf09[_0xfc68('0x16')]?_0x24cf09[_0xfc68('0x16')]['limit']||null:null,'include':_0x24cf09['options']?_0x24cf09['options'][_0xfc68('0x1a')]?_['map'](_0x24cf09[_0xfc68('0x16')][_0xfc68('0x1a')],function(_0x1721fc){return{'model':db[_0x1721fc[_0xfc68('0x1b')]],'as':_0x1721fc['as'],'attributes':_0x1721fc['attributes'],'include':_0x1721fc[_0xfc68('0x1a')]?_['map'](_0x1721fc[_0xfc68('0x1a')],function(_0x8d99dd){return{'model':db[_0x8d99dd['model']],'as':_0x8d99dd['as'],'attributes':_0x8d99dd[_0xfc68('0x19')],'include':_0x8d99dd[_0xfc68('0x1a')]?_['map'](_0x8d99dd['include'],function(_0x274199){return{'model':db[_0x274199['model']],'as':_0x274199['as'],'attributes':_0x274199[_0xfc68('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15b693){logger[_0xfc68('0xc')](_0xfc68('0x1c'),_0x24cf09);logger[_0xfc68('0x1d')](_0xfc68('0x1c'),_0x24cf09,JSON[_0xfc68('0x1e')](_0x15b693));_0x5721ee(_0x15b693);})[_0xfc68('0x13')](function(_0x1ef0b5){logger['error'](_0xfc68('0x1c'),_0x1ef0b5[_0xfc68('0x12')],_0x24cf09);_0x2ca744(_0x39a5aa[_0xfc68('0xf')](0x1f4,_0x1ef0b5[_0xfc68('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 996aad5..5d015ab 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 _0x3e5b=['/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x3e5b,0x1e9));var _0xb3e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3e5b[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xb3e5('0x0'));var path=require(_0xb3e5('0x1'));var timeout=require(_0xb3e5('0x2'));var express=require(_0xb3e5('0x3'));var router=express['Router']();var fs_extra=require(_0xb3e5('0x4'));var auth=require(_0xb3e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3e5('0x6'));var controller=require(_0xb3e5('0x7'));router['get']('/',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x9')]);router[_0xb3e5('0xa')](_0xb3e5('0xb'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0xc')]);router[_0xb3e5('0xa')](_0xb3e5('0xd'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0xe')]);router['get'](_0xb3e5('0xf'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0xb3e5('0xa')](_0xb3e5('0x10'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x11')]);router[_0xb3e5('0x12')]('/',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x13')]);router[_0xb3e5('0x12')]('/:id/all_conditions',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x14')]);router[_0xb3e5('0x12')](_0xb3e5('0xf'),auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x15')]);router['post']('/:id/actions',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x16')]);router[_0xb3e5('0x17')](_0xb3e5('0xb'),auth['isAuthenticated'](),controller[_0xb3e5('0x18')]);router[_0xb3e5('0x19')]('/:id',auth[_0xb3e5('0x8')](),controller[_0xb3e5('0x1a')]);module[_0xb3e5('0x1b')]=router; \ No newline at end of file +var _0x347d=['show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAllCondition','/:id/actions','addAction','put','/:id','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','isAuthenticated'];(function(_0x4e557d,_0x4d533b){var _0x393f57=function(_0x56d1a2){while(--_0x56d1a2){_0x4e557d['push'](_0x4e557d['shift']());}};_0x393f57(++_0x4d533b);}(_0x347d,0x17a));var _0xd347=function(_0x3e92b9,_0x4d9792){_0x3e92b9=_0x3e92b9-0x0;var _0xd5e6=_0x347d[_0x3e92b9];return _0xd5e6;};'use strict';var multer=require(_0xd347('0x0'));var util=require(_0xd347('0x1'));var path=require(_0xd347('0x2'));var timeout=require(_0xd347('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd347('0x4'));var auth=require(_0xd347('0x5'));var interaction=require(_0xd347('0x6'));var config=require(_0xd347('0x7'));var controller=require(_0xd347('0x8'));router[_0xd347('0x9')]('/',auth['isAuthenticated'](),controller[_0xd347('0xa')]);router[_0xd347('0x9')]('/:id',auth[_0xd347('0xb')](),controller[_0xd347('0xc')]);router['get'](_0xd347('0xd'),auth[_0xd347('0xb')](),controller[_0xd347('0xe')]);router[_0xd347('0x9')](_0xd347('0xf'),auth[_0xd347('0xb')](),controller[_0xd347('0x10')]);router[_0xd347('0x9')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0xd347('0x11')]('/',auth[_0xd347('0xb')](),controller[_0xd347('0x12')]);router[_0xd347('0x11')](_0xd347('0xd'),auth[_0xd347('0xb')](),controller[_0xd347('0x13')]);router[_0xd347('0x11')](_0xd347('0xf'),auth[_0xd347('0xb')](),controller['addAnyCondition']);router['post'](_0xd347('0x14'),auth[_0xd347('0xb')](),controller[_0xd347('0x15')]);router[_0xd347('0x16')](_0xd347('0x17'),auth[_0xd347('0xb')](),controller[_0xd347('0x18')]);router['delete'](_0xd347('0x17'),auth[_0xd347('0xb')](),controller[_0xd347('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 060b270..923fbbf 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 _0x7fb1=['sequelize','exports'];(function(_0x11bee6,_0x37245f){var _0x2aa037=function(_0x43aa57){while(--_0x43aa57){_0x11bee6['push'](_0x11bee6['shift']());}};_0x2aa037(++_0x37245f);}(_0x7fb1,0x1ce));var _0x17fb=function(_0x1667df,_0x266940){_0x1667df=_0x1667df-0x0;var _0x341abf=_0x7fb1[_0x1667df];return _0x341abf;};'use strict';var Sequelize=require(_0x17fb('0x0'));module[_0x17fb('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xac39=['sequelize','exports','STRING','BOOLEAN'];(function(_0xfa2086,_0x398fcf){var _0x5c7118=function(_0x5b7a09){while(--_0x5b7a09){_0xfa2086['push'](_0xfa2086['shift']());}};_0x5c7118(++_0x398fcf);}(_0xac39,0x11c));var _0x9ac3=function(_0x9f0365,_0x375ba5){_0x9f0365=_0x9f0365-0x0;var _0x3aab1d=_0xac39[_0x9f0365];return _0x3aab1d;};'use strict';var Sequelize=require(_0x9ac3('0x0'));module[_0x9ac3('0x1')]={'name':{'type':Sequelize[_0x9ac3('0x2')]},'channel':{'type':Sequelize[_0x9ac3('0x2')]},'description':{'type':Sequelize[_0x9ac3('0x2')]},'status':{'type':Sequelize[_0x9ac3('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6e9cdfc..1d1c388 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 _0xe0e3=['then','get','UserProfileResource','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Trigger','findAll','rows','catch','show','includeAll','include','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','params','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','update'];(function(_0x54c822,_0x30a166){var _0x23822a=function(_0x189f03){while(--_0x189f03){_0x54c822['push'](_0x54c822['shift']());}};_0x23822a(++_0x30a166);}(_0xe0e3,0x1b8));var _0x3e0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0e3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e0e('0x0'));var zipdir=require(_0x3e0e('0x1'));var jsonpatch=require(_0x3e0e('0x2'));var rp=require(_0x3e0e('0x3'));var moment=require(_0x3e0e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3e0e('0x5'));var util=require('util');var path=require(_0x3e0e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e0e('0x7'));var fs=require('fs');var fs_extra=require(_0x3e0e('0x8'));var _=require(_0x3e0e('0x9'));var squel=require(_0x3e0e('0xa'));var crypto=require('crypto');var jsforce=require(_0x3e0e('0xb'));var deskjs=require(_0x3e0e('0xc'));var toCsv=require(_0x3e0e('0xd'));var querystring=require(_0x3e0e('0xe'));var Papa=require(_0x3e0e('0xf'));var Redis=require(_0x3e0e('0x10'));var authService=require(_0x3e0e('0x11'));var qs=require(_0x3e0e('0x12'));var as=require(_0x3e0e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e0e('0x14'));var utils=require(_0x3e0e('0x15'));var config=require(_0x3e0e('0x16'));var licenseUtil=require(_0x3e0e('0x17'));var db=require(_0x3e0e('0x18'))['db'];function respondWithStatusCode(_0x476acc,_0x53b1c4){_0x53b1c4=_0x53b1c4||0xcc;return function(_0x38515d){if(_0x38515d){return _0x476acc['sendStatus'](_0x53b1c4);}return _0x476acc[_0x3e0e('0x19')](_0x53b1c4)[_0x3e0e('0x1a')]();};}function respondWithResult(_0x21f172,_0x5619b5){_0x5619b5=_0x5619b5||0xc8;return function(_0x723f4d){if(_0x723f4d){return _0x21f172[_0x3e0e('0x19')](_0x5619b5)[_0x3e0e('0x1b')](_0x723f4d);}};}function respondWithFilteredResult(_0x7b8164,_0x14e394){return function(_0x4f801c){if(_0x4f801c){var _0x5f3693=typeof _0x14e394[_0x3e0e('0x1c')]===_0x3e0e('0x1d')&&typeof _0x14e394[_0x3e0e('0x1e')]===_0x3e0e('0x1d');var _0x40d363=_0x4f801c[_0x3e0e('0x1f')];var _0x32adf9=_0x5f3693?0x0:_0x14e394[_0x3e0e('0x1c')];var _0xc98c6e=_0x5f3693?_0x4f801c[_0x3e0e('0x1f')]:_0x14e394[_0x3e0e('0x1c')]+_0x14e394['limit'];var _0x14413e;if(_0xc98c6e>=_0x40d363){_0xc98c6e=_0x40d363;_0x14413e=0xc8;}else{_0x14413e=0xce;}_0x7b8164[_0x3e0e('0x19')](_0x14413e);return _0x7b8164[_0x3e0e('0x20')](_0x3e0e('0x21'),_0x32adf9+'-'+_0xc98c6e+'/'+_0x40d363)[_0x3e0e('0x1b')](_0x4f801c);}return null;};}function patchUpdates(_0x14c3aa){return function(_0x5687a5){try{jsonpatch['apply'](_0x5687a5,_0x14c3aa,!![]);}catch(_0x5db3a0){return BPromise['reject'](_0x5db3a0);}return _0x5687a5['save']();};}function saveUpdates(_0x543657,_0x41e3d6){return function(_0x896d78){if(_0x896d78){return _0x896d78[_0x3e0e('0x22')](_0x543657)[_0x3e0e('0x23')](function(_0x1f0d57){return _0x1f0d57;});}return null;};}function removeEntity(_0x3a6e41,_0x5a5dc6){return function(_0x27ab68){if(_0x27ab68){return _0x27ab68['destroy']()['then'](function(){var _0x70e7f1=_0x27ab68[_0x3e0e('0x24')]({'plain':!![]});var _0xf9ee5e='Triggers';return db[_0x3e0e('0x25')]['destroy']({'where':{'type':_0xf9ee5e,'resourceId':_0x70e7f1['id']}})[_0x3e0e('0x23')](function(){return _0x27ab68;});})['then'](function(){_0x3a6e41[_0x3e0e('0x19')](0xcc)[_0x3e0e('0x1a')]();});}};}function handleEntityNotFound(_0x435ca2,_0x3dbe36){return function(_0x591b33){if(!_0x591b33){_0x435ca2[_0x3e0e('0x26')](0x194);}return _0x591b33;};}function handleError(_0xccf2dd,_0x3386f3){_0x3386f3=_0x3386f3||0x1f4;return function(_0x50aa98){logger['error'](_0x50aa98[_0x3e0e('0x27')]);if(_0x50aa98[_0x3e0e('0x28')]){delete _0x50aa98[_0x3e0e('0x28')];}_0xccf2dd['status'](_0x3386f3)[_0x3e0e('0x29')](_0x50aa98);};}exports['index']=function(_0x2227d4,_0x13424a){var _0x3c1bda={},_0x4717f2={},_0x5b8491={'count':0x0,'rows':[]};var _0x1d0f07=_[_0x3e0e('0x2a')](db['Trigger'][_0x3e0e('0x2b')],function(_0x5d5c37){return{'name':_0x5d5c37[_0x3e0e('0x2c')],'type':_0x5d5c37['type'][_0x3e0e('0x2d')]};});_0x4717f2[_0x3e0e('0x2e')]=_[_0x3e0e('0x2a')](_0x1d0f07,_0x3e0e('0x28'));_0x4717f2[_0x3e0e('0x2f')]=_[_0x3e0e('0x30')](_0x2227d4[_0x3e0e('0x2f')]);_0x4717f2[_0x3e0e('0x31')]=_['intersection'](_0x4717f2['model'],_0x4717f2[_0x3e0e('0x2f')]);_0x3c1bda['attributes']=_[_0x3e0e('0x32')](_0x4717f2[_0x3e0e('0x2e')],qs[_0x3e0e('0x33')](_0x2227d4[_0x3e0e('0x2f')][_0x3e0e('0x33')]));_0x3c1bda[_0x3e0e('0x34')]=_0x3c1bda[_0x3e0e('0x34')][_0x3e0e('0x35')]?_0x3c1bda[_0x3e0e('0x34')]:_0x4717f2['model'];if(!_0x2227d4[_0x3e0e('0x2f')][_0x3e0e('0x36')](_0x3e0e('0x37'))){_0x3c1bda[_0x3e0e('0x1e')]=qs[_0x3e0e('0x1e')](_0x2227d4['query'][_0x3e0e('0x1e')]);_0x3c1bda[_0x3e0e('0x1c')]=qs[_0x3e0e('0x1c')](_0x2227d4[_0x3e0e('0x2f')]['offset']);}_0x3c1bda[_0x3e0e('0x38')]=qs[_0x3e0e('0x39')](_0x2227d4[_0x3e0e('0x2f')][_0x3e0e('0x39')]);_0x3c1bda[_0x3e0e('0x3a')]=qs[_0x3e0e('0x31')](_[_0x3e0e('0x3b')](_0x2227d4[_0x3e0e('0x2f')],_0x4717f2['filters']),_0x1d0f07);if(_0x2227d4[_0x3e0e('0x2f')][_0x3e0e('0x3c')]){_0x3c1bda[_0x3e0e('0x3a')]=_['merge'](_0x3c1bda[_0x3e0e('0x3a')],{'$or':_[_0x3e0e('0x2a')](_0x1d0f07,function(_0x474610){if(_0x474610[_0x3e0e('0x3d')]!==_0x3e0e('0x3e')){var _0x5f1cc0={};_0x5f1cc0[_0x474610[_0x3e0e('0x28')]]={'$like':'%'+_0x2227d4[_0x3e0e('0x2f')][_0x3e0e('0x3c')]+'%'};return _0x5f1cc0;}})});}_0x3c1bda=_[_0x3e0e('0x3f')]({},_0x3c1bda,_0x2227d4[_0x3e0e('0x40')]);var _0x4a5452={'where':_0x3c1bda['where']};return db[_0x3e0e('0x41')]['count'](_0x4a5452)['then'](function(_0x3f8b64){_0x5b8491[_0x3e0e('0x1f')]=_0x3f8b64;if(_0x2227d4[_0x3e0e('0x2f')]['includeAll']){_0x3c1bda['include']=[{'all':!![]}];}return db[_0x3e0e('0x41')][_0x3e0e('0x42')](_0x3c1bda);})[_0x3e0e('0x23')](function(_0x4e37e4){_0x5b8491[_0x3e0e('0x43')]=_0x4e37e4;return _0x5b8491;})[_0x3e0e('0x23')](respondWithFilteredResult(_0x13424a,_0x3c1bda))[_0x3e0e('0x44')](handleError(_0x13424a,null));};exports[_0x3e0e('0x45')]=function(_0x148c18,_0x44400a){var _0xa7ce58={'raw':![],'where':{'id':_0x148c18['params']['id']}},_0x100b72={};_0x100b72[_0x3e0e('0x2e')]=_['keys'](db[_0x3e0e('0x41')][_0x3e0e('0x2b')]);_0x100b72[_0x3e0e('0x2f')]=_[_0x3e0e('0x30')](_0x148c18['query']);_0x100b72[_0x3e0e('0x31')]=_[_0x3e0e('0x32')](_0x100b72['model'],_0x100b72[_0x3e0e('0x2f')]);_0xa7ce58['attributes']=_[_0x3e0e('0x32')](_0x100b72['model'],qs[_0x3e0e('0x33')](_0x148c18['query'][_0x3e0e('0x33')]));_0xa7ce58[_0x3e0e('0x34')]=_0xa7ce58[_0x3e0e('0x34')][_0x3e0e('0x35')]?_0xa7ce58[_0x3e0e('0x34')]:_0x100b72['model'];if(_0x148c18[_0x3e0e('0x2f')][_0x3e0e('0x46')]){_0xa7ce58[_0x3e0e('0x47')]=[{'all':!![]}];}_0xa7ce58=_[_0x3e0e('0x3f')]({},_0xa7ce58,_0x148c18['options']);return db[_0x3e0e('0x41')][_0x3e0e('0x48')](_0xa7ce58)[_0x3e0e('0x23')](handleEntityNotFound(_0x44400a,null))[_0x3e0e('0x23')](respondWithResult(_0x44400a,null))[_0x3e0e('0x44')](handleError(_0x44400a,null));};exports[_0x3e0e('0x49')]=function(_0x46d33d,_0x1b25fb){return db[_0x3e0e('0x41')][_0x3e0e('0x49')](_0x46d33d[_0x3e0e('0x4a')],{})[_0x3e0e('0x23')](function(_0x41c565){var _0x3d782b=_0x46d33d[_0x3e0e('0x4b')][_0x3e0e('0x24')]({'plain':!![]});if(!_0x3d782b)throw new Error(_0x3e0e('0x4c'));if(_0x3d782b['role']===_0x3e0e('0x4b')){var _0x5ca3d4=_0x41c565[_0x3e0e('0x24')]({'plain':!![]});var _0x5882e8='Triggers';return db[_0x3e0e('0x4d')][_0x3e0e('0x48')]({'where':{'name':_0x5882e8,'userProfileId':_0x3d782b[_0x3e0e('0x4e')]},'raw':!![]})[_0x3e0e('0x23')](function(_0x23f269){if(_0x23f269&&_0x23f269[_0x3e0e('0x4f')]===0x0){return db['UserProfileResource'][_0x3e0e('0x49')]({'name':_0x5ca3d4[_0x3e0e('0x28')],'resourceId':_0x5ca3d4['id'],'type':_0x23f269[_0x3e0e('0x28')],'sectionId':_0x23f269['id']},{})[_0x3e0e('0x23')](function(){return _0x41c565;});}else{return _0x41c565;}})['catch'](function(_0x556d35){logger[_0x3e0e('0x50')](_0x3e0e('0x51'),_0x556d35);throw _0x556d35;});}return _0x41c565;})['then'](respondWithResult(_0x1b25fb,0xc9))[_0x3e0e('0x44')](handleError(_0x1b25fb,null));};exports['update']=function(_0x2d6afc,_0x38e053){if(_0x2d6afc[_0x3e0e('0x4a')]['id']){delete _0x2d6afc['body']['id'];}return db[_0x3e0e('0x41')][_0x3e0e('0x48')]({'where':{'id':_0x2d6afc['params']['id']}})['then'](handleEntityNotFound(_0x38e053,null))[_0x3e0e('0x23')](saveUpdates(_0x2d6afc[_0x3e0e('0x4a')],null))[_0x3e0e('0x23')](respondWithResult(_0x38e053,null))['catch'](handleError(_0x38e053,null));};exports['destroy']=function(_0x1f1276,_0x815967){return db[_0x3e0e('0x41')][_0x3e0e('0x48')]({'where':{'id':_0x1f1276[_0x3e0e('0x52')]['id']}})[_0x3e0e('0x23')](handleEntityNotFound(_0x815967,null))[_0x3e0e('0x23')](removeEntity(_0x815967,null))[_0x3e0e('0x44')](handleError(_0x815967,null));};exports[_0x3e0e('0x53')]=function(_0x1df6d6,_0x2693ac,_0x4b222c){if(_0x1df6d6[_0x3e0e('0x4a')]['id']){delete _0x1df6d6[_0x3e0e('0x4a')]['id'];}return db[_0x3e0e('0x41')][_0x3e0e('0x48')]({'where':{'id':_0x1df6d6[_0x3e0e('0x52')]['id']}})['then'](handleEntityNotFound(_0x2693ac,null))[_0x3e0e('0x23')](function(_0x2e71ca){if(_0x2e71ca){_0x1df6d6['body'][_0x3e0e('0x54')]=_0x2e71ca['id'];return db['Condition'][_0x3e0e('0x49')](_0x1df6d6[_0x3e0e('0x4a')]);}})[_0x3e0e('0x23')](respondWithResult(_0x2693ac,null))[_0x3e0e('0x44')](handleError(_0x2693ac,null));};exports[_0x3e0e('0x55')]=function(_0x1b5d95,_0x39fe20,_0x6007c9){if(_0x1b5d95[_0x3e0e('0x4a')]['id']){delete _0x1b5d95[_0x3e0e('0x4a')]['id'];}return db[_0x3e0e('0x41')][_0x3e0e('0x48')]({'where':{'id':_0x1b5d95[_0x3e0e('0x52')]['id']}})['then'](handleEntityNotFound(_0x39fe20,null))[_0x3e0e('0x23')](function(_0x23fe7c){if(_0x23fe7c){_0x1b5d95[_0x3e0e('0x4a')][_0x3e0e('0x56')]=_0x23fe7c['id'];return db[_0x3e0e('0x57')][_0x3e0e('0x49')](_0x1b5d95[_0x3e0e('0x4a')]);}})['then'](respondWithResult(_0x39fe20,null))[_0x3e0e('0x44')](handleError(_0x39fe20,null));};exports[_0x3e0e('0x58')]=function(_0x5e44c3,_0x1dd6ed,_0x1d6b1c){var _0x48f635={};var _0x4959ff={};var _0x108e7e;var _0x173dbd;return db[_0x3e0e('0x41')][_0x3e0e('0x59')]({'where':{'id':_0x5e44c3['params']['id']}})[_0x3e0e('0x23')](handleEntityNotFound(_0x1dd6ed,null))[_0x3e0e('0x23')](function(_0xad6f77){if(_0xad6f77){_0x108e7e=_0xad6f77;_0x4959ff[_0x3e0e('0x2e')]=_[_0x3e0e('0x30')](db[_0x3e0e('0x57')][_0x3e0e('0x2b')]);_0x4959ff[_0x3e0e('0x2f')]=_[_0x3e0e('0x30')](_0x5e44c3[_0x3e0e('0x2f')]);_0x4959ff[_0x3e0e('0x31')]=_[_0x3e0e('0x32')](_0x4959ff[_0x3e0e('0x2e')],_0x4959ff['query']);_0x48f635['attributes']=_[_0x3e0e('0x32')](_0x4959ff[_0x3e0e('0x2e')],qs[_0x3e0e('0x33')](_0x5e44c3[_0x3e0e('0x2f')][_0x3e0e('0x33')]));_0x48f635[_0x3e0e('0x34')]=_0x48f635['attributes']['length']?_0x48f635[_0x3e0e('0x34')]:_0x4959ff['model'];_0x48f635[_0x3e0e('0x38')]=qs[_0x3e0e('0x39')](_0x5e44c3['query']['sort']);_0x48f635[_0x3e0e('0x3a')]=qs[_0x3e0e('0x31')](_[_0x3e0e('0x3b')](_0x5e44c3['query'],_0x4959ff[_0x3e0e('0x31')]));if(_0x5e44c3[_0x3e0e('0x2f')][_0x3e0e('0x3c')]){_0x48f635['where']=_[_0x3e0e('0x3f')](_0x48f635[_0x3e0e('0x3a')],{'$or':_['map'](_0x48f635[_0x3e0e('0x34')],function(_0x263284){var _0x1e99e4={};_0x1e99e4[_0x263284]={'$like':'%'+_0x5e44c3[_0x3e0e('0x2f')][_0x3e0e('0x3c')]+'%'};return _0x1e99e4;})});}_0x48f635=_[_0x3e0e('0x3f')]({},_0x48f635,_0x5e44c3['options']);return _0x108e7e['getAllConditions'](_0x48f635);}})[_0x3e0e('0x23')](function(_0x2cd584){if(_0x2cd584){_0x173dbd=_0x2cd584[_0x3e0e('0x35')];if(!_0x5e44c3[_0x3e0e('0x2f')]['hasOwnProperty']('nolimit')){_0x48f635[_0x3e0e('0x1e')]=qs[_0x3e0e('0x1e')](_0x5e44c3[_0x3e0e('0x2f')][_0x3e0e('0x1e')]);_0x48f635[_0x3e0e('0x1c')]=qs['offset'](_0x5e44c3['query']['offset']);}return _0x108e7e[_0x3e0e('0x58')](_0x48f635);}})[_0x3e0e('0x23')](function(_0x458157){if(_0x458157){return _0x458157?{'count':_0x173dbd,'rows':_0x458157}:null;}})[_0x3e0e('0x23')](respondWithResult(_0x1dd6ed,null))[_0x3e0e('0x44')](handleError(_0x1dd6ed,null));};exports[_0x3e0e('0x5a')]=function(_0x2f841d,_0x156d85,_0x2ddfae){var _0x31fa8f={};var _0xd7a53c={};var _0x315859;var _0x5531ca;return db['Trigger'][_0x3e0e('0x59')]({'where':{'id':_0x2f841d['params']['id']}})['then'](handleEntityNotFound(_0x156d85,null))[_0x3e0e('0x23')](function(_0x14aec9){if(_0x14aec9){_0x315859=_0x14aec9;_0xd7a53c[_0x3e0e('0x2e')]=_[_0x3e0e('0x30')](db[_0x3e0e('0x57')][_0x3e0e('0x2b')]);_0xd7a53c[_0x3e0e('0x2f')]=_[_0x3e0e('0x30')](_0x2f841d[_0x3e0e('0x2f')]);_0xd7a53c[_0x3e0e('0x31')]=_[_0x3e0e('0x32')](_0xd7a53c[_0x3e0e('0x2e')],_0xd7a53c[_0x3e0e('0x2f')]);_0x31fa8f['attributes']=_['intersection'](_0xd7a53c['model'],qs['fields'](_0x2f841d[_0x3e0e('0x2f')][_0x3e0e('0x33')]));_0x31fa8f[_0x3e0e('0x34')]=_0x31fa8f[_0x3e0e('0x34')][_0x3e0e('0x35')]?_0x31fa8f[_0x3e0e('0x34')]:_0xd7a53c[_0x3e0e('0x2e')];_0x31fa8f[_0x3e0e('0x38')]=qs[_0x3e0e('0x39')](_0x2f841d[_0x3e0e('0x2f')]['sort']);_0x31fa8f[_0x3e0e('0x3a')]=qs[_0x3e0e('0x31')](_[_0x3e0e('0x3b')](_0x2f841d['query'],_0xd7a53c[_0x3e0e('0x31')]));if(_0x2f841d[_0x3e0e('0x2f')][_0x3e0e('0x3c')]){_0x31fa8f['where']=_[_0x3e0e('0x3f')](_0x31fa8f[_0x3e0e('0x3a')],{'$or':_[_0x3e0e('0x2a')](_0x31fa8f[_0x3e0e('0x34')],function(_0x147c99){var _0x4334b0={};_0x4334b0[_0x147c99]={'$like':'%'+_0x2f841d[_0x3e0e('0x2f')][_0x3e0e('0x3c')]+'%'};return _0x4334b0;})});}_0x31fa8f=_[_0x3e0e('0x3f')]({},_0x31fa8f,_0x2f841d[_0x3e0e('0x40')]);return _0x315859[_0x3e0e('0x5a')](_0x31fa8f);}})[_0x3e0e('0x23')](function(_0x589cb2){if(_0x589cb2){_0x5531ca=_0x589cb2['length'];if(!_0x2f841d[_0x3e0e('0x2f')][_0x3e0e('0x36')](_0x3e0e('0x37'))){_0x31fa8f[_0x3e0e('0x1e')]=qs[_0x3e0e('0x1e')](_0x2f841d['query'][_0x3e0e('0x1e')]);_0x31fa8f[_0x3e0e('0x1c')]=qs[_0x3e0e('0x1c')](_0x2f841d['query']['offset']);}return _0x315859[_0x3e0e('0x5a')](_0x31fa8f);}})[_0x3e0e('0x23')](function(_0x26099a){if(_0x26099a){return _0x26099a?{'count':_0x5531ca,'rows':_0x26099a}:null;}})[_0x3e0e('0x23')](respondWithResult(_0x156d85,null))[_0x3e0e('0x44')](handleError(_0x156d85,null));};exports[_0x3e0e('0x5b')]=function(_0x168ee0,_0xbd7d55,_0x380f28){if(_0x168ee0[_0x3e0e('0x4a')]['id']){delete _0x168ee0['body']['id'];}return db[_0x3e0e('0x41')]['find']({'where':{'id':_0x168ee0[_0x3e0e('0x52')]['id']}})['then'](handleEntityNotFound(_0xbd7d55,null))[_0x3e0e('0x23')](function(_0x211408){if(_0x211408){_0x168ee0[_0x3e0e('0x4a')][_0x3e0e('0x5c')]=_0x211408['id'];return db[_0x3e0e('0x5d')][_0x3e0e('0x49')](_0x168ee0[_0x3e0e('0x4a')]);}})['then'](respondWithResult(_0xbd7d55,null))[_0x3e0e('0x44')](handleError(_0xbd7d55,null));};exports['getActions']=function(_0xfbb6d3,_0x5b2399,_0x3bc5dc){var _0x170d88={};var _0x1b8976={};var _0x313a9f;var _0x5497c8;return db[_0x3e0e('0x41')][_0x3e0e('0x59')]({'where':{'id':_0xfbb6d3[_0x3e0e('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b2399,null))[_0x3e0e('0x23')](function(_0x1a42ee){if(_0x1a42ee){_0x313a9f=_0x1a42ee;_0x1b8976[_0x3e0e('0x2e')]=_[_0x3e0e('0x30')](db[_0x3e0e('0x5d')][_0x3e0e('0x2b')]);_0x1b8976[_0x3e0e('0x2f')]=_[_0x3e0e('0x30')](_0xfbb6d3['query']);_0x1b8976[_0x3e0e('0x31')]=_[_0x3e0e('0x32')](_0x1b8976[_0x3e0e('0x2e')],_0x1b8976[_0x3e0e('0x2f')]);_0x170d88[_0x3e0e('0x34')]=_[_0x3e0e('0x32')](_0x1b8976[_0x3e0e('0x2e')],qs['fields'](_0xfbb6d3[_0x3e0e('0x2f')][_0x3e0e('0x33')]));_0x170d88[_0x3e0e('0x34')]=_0x170d88[_0x3e0e('0x34')][_0x3e0e('0x35')]?_0x170d88[_0x3e0e('0x34')]:_0x1b8976['model'];_0x170d88[_0x3e0e('0x38')]=qs[_0x3e0e('0x39')](_0xfbb6d3['query'][_0x3e0e('0x39')]);_0x170d88[_0x3e0e('0x3a')]=qs[_0x3e0e('0x31')](_[_0x3e0e('0x3b')](_0xfbb6d3[_0x3e0e('0x2f')],_0x1b8976[_0x3e0e('0x31')]));if(_0xfbb6d3['query'][_0x3e0e('0x3c')]){_0x170d88[_0x3e0e('0x3a')]=_[_0x3e0e('0x3f')](_0x170d88[_0x3e0e('0x3a')],{'$or':_['map'](_0x170d88[_0x3e0e('0x34')],function(_0x126084){var _0x680edd={};_0x680edd[_0x126084]={'$like':'%'+_0xfbb6d3['query']['filter']+'%'};return _0x680edd;})});}_0x170d88=_['merge']({},_0x170d88,_0xfbb6d3[_0x3e0e('0x40')]);return _0x313a9f[_0x3e0e('0x5e')](_0x170d88);}})[_0x3e0e('0x23')](function(_0x45577a){if(_0x45577a){_0x5497c8=_0x45577a['length'];if(!_0xfbb6d3[_0x3e0e('0x2f')]['hasOwnProperty'](_0x3e0e('0x37'))){_0x170d88[_0x3e0e('0x1e')]=qs[_0x3e0e('0x1e')](_0xfbb6d3[_0x3e0e('0x2f')][_0x3e0e('0x1e')]);_0x170d88['offset']=qs[_0x3e0e('0x1c')](_0xfbb6d3[_0x3e0e('0x2f')][_0x3e0e('0x1c')]);}return _0x313a9f['getActions'](_0x170d88);}})[_0x3e0e('0x23')](function(_0x5f27ae){if(_0x5f27ae){return _0x5f27ae?{'count':_0x5497c8,'rows':_0x5f27ae}:null;}})[_0x3e0e('0x23')](respondWithResult(_0x5b2399,null))[_0x3e0e('0x44')](handleError(_0x5b2399,null));}; \ No newline at end of file +var _0xada1=['sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','Triggers','UserProfileResource','destroy','then','stack','name','index','map','Trigger','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','keys','rawAttributes','options','find','catch','create','body','user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','TriggerAllId','addAnyCondition','getAllConditions','findOne','Condition','getAnyConditions','addAction','TriggerId','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xada1,0x1ce));var _0x1ada=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xada1[_0x341e0f];return _0x59555a;};'use strict';var emlformat=require(_0x1ada('0x0'));var rimraf=require(_0x1ada('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1ada('0x2'));var moment=require(_0x1ada('0x3'));var BPromise=require(_0x1ada('0x4'));var Mustache=require(_0x1ada('0x5'));var util=require(_0x1ada('0x6'));var path=require(_0x1ada('0x7'));var sox=require(_0x1ada('0x8'));var csv=require(_0x1ada('0x9'));var ejs=require(_0x1ada('0xa'));var fs=require('fs');var fs_extra=require(_0x1ada('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ada('0xc'));var jsforce=require(_0x1ada('0xd'));var deskjs=require(_0x1ada('0xe'));var toCsv=require(_0x1ada('0x9'));var querystring=require(_0x1ada('0xf'));var Papa=require(_0x1ada('0x10'));var Redis=require(_0x1ada('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1ada('0x12'));var as=require(_0x1ada('0x13'));var hardwareService=require(_0x1ada('0x14'));var logger=require(_0x1ada('0x15'))(_0x1ada('0x16'));var utils=require(_0x1ada('0x17'));var config=require(_0x1ada('0x18'));var licenseUtil=require(_0x1ada('0x19'));var db=require(_0x1ada('0x1a'))['db'];function respondWithStatusCode(_0x5c8295,_0x282c4e){_0x282c4e=_0x282c4e||0xcc;return function(_0x556e41){if(_0x556e41){return _0x5c8295[_0x1ada('0x1b')](_0x282c4e);}return _0x5c8295[_0x1ada('0x1c')](_0x282c4e)[_0x1ada('0x1d')]();};}function respondWithResult(_0x45487c,_0x28b9af){_0x28b9af=_0x28b9af||0xc8;return function(_0x23d8ae){if(_0x23d8ae){return _0x45487c['status'](_0x28b9af)['json'](_0x23d8ae);}};}function respondWithFilteredResult(_0x37e9e6,_0x2bbf86){return function(_0x371e87){if(_0x371e87){var _0x3e3e20=typeof _0x2bbf86[_0x1ada('0x1e')]===_0x1ada('0x1f')&&typeof _0x2bbf86['limit']===_0x1ada('0x1f');var _0x5d2970=_0x371e87['count'];var _0x4249af=_0x3e3e20?0x0:_0x2bbf86[_0x1ada('0x1e')];var _0x128408=_0x3e3e20?_0x371e87[_0x1ada('0x20')]:_0x2bbf86[_0x1ada('0x1e')]+_0x2bbf86[_0x1ada('0x21')];var _0x1fe31a;if(_0x128408>=_0x5d2970){_0x128408=_0x5d2970;_0x1fe31a=0xc8;}else{_0x1fe31a=0xce;}_0x37e9e6[_0x1ada('0x1c')](_0x1fe31a);return _0x37e9e6[_0x1ada('0x22')](_0x1ada('0x23'),_0x4249af+'-'+_0x128408+'/'+_0x5d2970)['json'](_0x371e87);}return null;};}function patchUpdates(_0x309b4d){return function(_0x2f38ef){try{jsonpatch['apply'](_0x2f38ef,_0x309b4d,!![]);}catch(_0x5dd320){return BPromise[_0x1ada('0x24')](_0x5dd320);}return _0x2f38ef[_0x1ada('0x25')]();};}function saveUpdates(_0x150e6d,_0x54d919){return function(_0x18ea77){if(_0x18ea77){return _0x18ea77['update'](_0x150e6d)['then'](function(_0x5be550){return _0x5be550;});}return null;};}function removeEntity(_0x5939a8,_0x303778){return function(_0x2d9840){if(_0x2d9840){return _0x2d9840['destroy']()['then'](function(){var _0x5cb643=_0x2d9840['get']({'plain':!![]});var _0x4c9944=_0x1ada('0x26');return db[_0x1ada('0x27')][_0x1ada('0x28')]({'where':{'type':_0x4c9944,'resourceId':_0x5cb643['id']}})['then'](function(){return _0x2d9840;});})[_0x1ada('0x29')](function(){_0x5939a8['status'](0xcc)[_0x1ada('0x1d')]();});}};}function handleEntityNotFound(_0x48f146,_0x365f1b){return function(_0x7a8fd4){if(!_0x7a8fd4){_0x48f146[_0x1ada('0x1b')](0x194);}return _0x7a8fd4;};}function handleError(_0x2f475b,_0x1663db){_0x1663db=_0x1663db||0x1f4;return function(_0x8cb232){logger['error'](_0x8cb232[_0x1ada('0x2a')]);if(_0x8cb232['name']){delete _0x8cb232[_0x1ada('0x2b')];}_0x2f475b[_0x1ada('0x1c')](_0x1663db)['send'](_0x8cb232);};}exports[_0x1ada('0x2c')]=function(_0x31ce51,_0x50d505){var _0xbe698={},_0x47c832={},_0x415d6c={'count':0x0,'rows':[]};var _0x5f530f=_[_0x1ada('0x2d')](db[_0x1ada('0x2e')]['rawAttributes'],function(_0x5a637c){return{'name':_0x5a637c[_0x1ada('0x2f')],'type':_0x5a637c[_0x1ada('0x30')][_0x1ada('0x31')]};});_0x47c832[_0x1ada('0x32')]=_[_0x1ada('0x2d')](_0x5f530f,'name');_0x47c832[_0x1ada('0x33')]=_['keys'](_0x31ce51[_0x1ada('0x33')]);_0x47c832[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0x47c832[_0x1ada('0x32')],_0x47c832[_0x1ada('0x33')]);_0xbe698[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0x47c832[_0x1ada('0x32')],qs[_0x1ada('0x37')](_0x31ce51[_0x1ada('0x33')]['fields']));_0xbe698[_0x1ada('0x36')]=_0xbe698[_0x1ada('0x36')][_0x1ada('0x38')]?_0xbe698[_0x1ada('0x36')]:_0x47c832[_0x1ada('0x32')];if(!_0x31ce51[_0x1ada('0x33')][_0x1ada('0x39')](_0x1ada('0x3a'))){_0xbe698[_0x1ada('0x21')]=qs[_0x1ada('0x21')](_0x31ce51[_0x1ada('0x33')][_0x1ada('0x21')]);_0xbe698[_0x1ada('0x1e')]=qs[_0x1ada('0x1e')](_0x31ce51['query'][_0x1ada('0x1e')]);}_0xbe698[_0x1ada('0x3b')]=qs[_0x1ada('0x3c')](_0x31ce51[_0x1ada('0x33')][_0x1ada('0x3c')]);_0xbe698[_0x1ada('0x3d')]=qs[_0x1ada('0x34')](_[_0x1ada('0x3e')](_0x31ce51[_0x1ada('0x33')],_0x47c832['filters']),_0x5f530f);if(_0x31ce51[_0x1ada('0x33')][_0x1ada('0x3f')]){_0xbe698[_0x1ada('0x3d')]=_['merge'](_0xbe698[_0x1ada('0x3d')],{'$or':_['map'](_0x5f530f,function(_0x1d28b3){if(_0x1d28b3['type']!==_0x1ada('0x40')){var _0x146319={};_0x146319[_0x1d28b3[_0x1ada('0x2b')]]={'$like':'%'+_0x31ce51[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0x146319;}})});}_0xbe698=_[_0x1ada('0x41')]({},_0xbe698,_0x31ce51['options']);var _0x32e874={'where':_0xbe698[_0x1ada('0x3d')]};return db[_0x1ada('0x2e')][_0x1ada('0x20')](_0x32e874)[_0x1ada('0x29')](function(_0x40e25f){_0x415d6c[_0x1ada('0x20')]=_0x40e25f;if(_0x31ce51['query'][_0x1ada('0x42')]){_0xbe698[_0x1ada('0x43')]=[{'all':!![]}];}return db[_0x1ada('0x2e')][_0x1ada('0x44')](_0xbe698);})[_0x1ada('0x29')](function(_0x51cfd6){_0x415d6c[_0x1ada('0x45')]=_0x51cfd6;return _0x415d6c;})[_0x1ada('0x29')](respondWithFilteredResult(_0x50d505,_0xbe698))['catch'](handleError(_0x50d505,null));};exports['show']=function(_0x26ffe5,_0x3f15a4){var _0x528bbf={'raw':![],'where':{'id':_0x26ffe5['params']['id']}},_0xa55999={};_0xa55999[_0x1ada('0x32')]=_[_0x1ada('0x46')](db[_0x1ada('0x2e')][_0x1ada('0x47')]);_0xa55999['query']=_[_0x1ada('0x46')](_0x26ffe5[_0x1ada('0x33')]);_0xa55999[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0xa55999[_0x1ada('0x32')],_0xa55999[_0x1ada('0x33')]);_0x528bbf[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0xa55999[_0x1ada('0x32')],qs[_0x1ada('0x37')](_0x26ffe5[_0x1ada('0x33')][_0x1ada('0x37')]));_0x528bbf[_0x1ada('0x36')]=_0x528bbf[_0x1ada('0x36')]['length']?_0x528bbf[_0x1ada('0x36')]:_0xa55999[_0x1ada('0x32')];if(_0x26ffe5[_0x1ada('0x33')]['includeAll']){_0x528bbf['include']=[{'all':!![]}];}_0x528bbf=_[_0x1ada('0x41')]({},_0x528bbf,_0x26ffe5[_0x1ada('0x48')]);return db[_0x1ada('0x2e')][_0x1ada('0x49')](_0x528bbf)[_0x1ada('0x29')](handleEntityNotFound(_0x3f15a4,null))[_0x1ada('0x29')](respondWithResult(_0x3f15a4,null))[_0x1ada('0x4a')](handleError(_0x3f15a4,null));};exports[_0x1ada('0x4b')]=function(_0x3ac5f1,_0x279e2b){return db[_0x1ada('0x2e')]['create'](_0x3ac5f1[_0x1ada('0x4c')],{})[_0x1ada('0x29')](function(_0x51ebd7){var _0x3d01c7=_0x3ac5f1[_0x1ada('0x4d')]['get']({'plain':!![]});if(!_0x3d01c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d01c7[_0x1ada('0x4e')]===_0x1ada('0x4d')){var _0xf9f702=_0x51ebd7['get']({'plain':!![]});var _0x547a29=_0x1ada('0x26');return db['UserProfileSection'][_0x1ada('0x49')]({'where':{'name':_0x547a29,'userProfileId':_0x3d01c7['userProfileId']},'raw':!![]})[_0x1ada('0x29')](function(_0x5abf52){if(_0x5abf52&&_0x5abf52[_0x1ada('0x4f')]===0x0){return db[_0x1ada('0x27')][_0x1ada('0x4b')]({'name':_0xf9f702[_0x1ada('0x2b')],'resourceId':_0xf9f702['id'],'type':_0x5abf52[_0x1ada('0x2b')],'sectionId':_0x5abf52['id']},{})[_0x1ada('0x29')](function(){return _0x51ebd7;});}else{return _0x51ebd7;}})[_0x1ada('0x4a')](function(_0x540c33){logger[_0x1ada('0x50')](_0x1ada('0x51'),_0x540c33);throw _0x540c33;});}return _0x51ebd7;})['then'](respondWithResult(_0x279e2b,0xc9))[_0x1ada('0x4a')](handleError(_0x279e2b,null));};exports[_0x1ada('0x52')]=function(_0x4afa3d,_0x9cdbdd){if(_0x4afa3d['body']['id']){delete _0x4afa3d[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')][_0x1ada('0x49')]({'where':{'id':_0x4afa3d['params']['id']}})['then'](handleEntityNotFound(_0x9cdbdd,null))[_0x1ada('0x29')](saveUpdates(_0x4afa3d['body'],null))[_0x1ada('0x29')](respondWithResult(_0x9cdbdd,null))[_0x1ada('0x4a')](handleError(_0x9cdbdd,null));};exports[_0x1ada('0x28')]=function(_0x8f518d,_0x36e608){return db['Trigger'][_0x1ada('0x49')]({'where':{'id':_0x8f518d[_0x1ada('0x53')]['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x36e608,null))[_0x1ada('0x29')](removeEntity(_0x36e608,null))[_0x1ada('0x4a')](handleError(_0x36e608,null));};exports[_0x1ada('0x54')]=function(_0x309696,_0xd09e91,_0x509510){if(_0x309696['body']['id']){delete _0x309696[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')]['find']({'where':{'id':_0x309696['params']['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0xd09e91,null))[_0x1ada('0x29')](function(_0x54c8ca){if(_0x54c8ca){_0x309696[_0x1ada('0x4c')][_0x1ada('0x55')]=_0x54c8ca['id'];return db['Condition'][_0x1ada('0x4b')](_0x309696[_0x1ada('0x4c')]);}})[_0x1ada('0x29')](respondWithResult(_0xd09e91,null))[_0x1ada('0x4a')](handleError(_0xd09e91,null));};exports[_0x1ada('0x56')]=function(_0x26f3cf,_0x216d19,_0x11e890){if(_0x26f3cf[_0x1ada('0x4c')]['id']){delete _0x26f3cf[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')]['find']({'where':{'id':_0x26f3cf[_0x1ada('0x53')]['id']}})['then'](handleEntityNotFound(_0x216d19,null))[_0x1ada('0x29')](function(_0x1b051f){if(_0x1b051f){_0x26f3cf[_0x1ada('0x4c')]['TriggerAnyId']=_0x1b051f['id'];return db['Condition'][_0x1ada('0x4b')](_0x26f3cf[_0x1ada('0x4c')]);}})['then'](respondWithResult(_0x216d19,null))[_0x1ada('0x4a')](handleError(_0x216d19,null));};exports[_0x1ada('0x57')]=function(_0x332dd0,_0x4b7706,_0x18d6f9){var _0x180319={};var _0x37288d={};var _0x4d0ff6;var _0x2c0b4d;return db[_0x1ada('0x2e')][_0x1ada('0x58')]({'where':{'id':_0x332dd0['params']['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x4b7706,null))['then'](function(_0x45518b){if(_0x45518b){_0x4d0ff6=_0x45518b;_0x37288d[_0x1ada('0x32')]=_[_0x1ada('0x46')](db[_0x1ada('0x59')]['rawAttributes']);_0x37288d[_0x1ada('0x33')]=_[_0x1ada('0x46')](_0x332dd0['query']);_0x37288d[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0x37288d[_0x1ada('0x32')],_0x37288d[_0x1ada('0x33')]);_0x180319['attributes']=_[_0x1ada('0x35')](_0x37288d[_0x1ada('0x32')],qs['fields'](_0x332dd0[_0x1ada('0x33')][_0x1ada('0x37')]));_0x180319[_0x1ada('0x36')]=_0x180319['attributes'][_0x1ada('0x38')]?_0x180319[_0x1ada('0x36')]:_0x37288d[_0x1ada('0x32')];_0x180319['order']=qs[_0x1ada('0x3c')](_0x332dd0['query'][_0x1ada('0x3c')]);_0x180319[_0x1ada('0x3d')]=qs[_0x1ada('0x34')](_[_0x1ada('0x3e')](_0x332dd0[_0x1ada('0x33')],_0x37288d[_0x1ada('0x34')]));if(_0x332dd0[_0x1ada('0x33')]['filter']){_0x180319[_0x1ada('0x3d')]=_[_0x1ada('0x41')](_0x180319[_0x1ada('0x3d')],{'$or':_['map'](_0x180319[_0x1ada('0x36')],function(_0x34205e){var _0x4aa25f={};_0x4aa25f[_0x34205e]={'$like':'%'+_0x332dd0[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0x4aa25f;})});}_0x180319=_[_0x1ada('0x41')]({},_0x180319,_0x332dd0[_0x1ada('0x48')]);return _0x4d0ff6[_0x1ada('0x57')](_0x180319);}})[_0x1ada('0x29')](function(_0x2e3dc3){if(_0x2e3dc3){_0x2c0b4d=_0x2e3dc3[_0x1ada('0x38')];if(!_0x332dd0[_0x1ada('0x33')]['hasOwnProperty']('nolimit')){_0x180319[_0x1ada('0x21')]=qs['limit'](_0x332dd0[_0x1ada('0x33')][_0x1ada('0x21')]);_0x180319[_0x1ada('0x1e')]=qs[_0x1ada('0x1e')](_0x332dd0[_0x1ada('0x33')][_0x1ada('0x1e')]);}return _0x4d0ff6[_0x1ada('0x57')](_0x180319);}})['then'](function(_0x1839b4){if(_0x1839b4){return _0x1839b4?{'count':_0x2c0b4d,'rows':_0x1839b4}:null;}})[_0x1ada('0x29')](respondWithResult(_0x4b7706,null))[_0x1ada('0x4a')](handleError(_0x4b7706,null));};exports['getAnyConditions']=function(_0x3e5662,_0x1fa1a7,_0x20d4d0){var _0x46bd97={};var _0x268131={};var _0x498f6b;var _0x1f1dc1;return db[_0x1ada('0x2e')][_0x1ada('0x58')]({'where':{'id':_0x3e5662[_0x1ada('0x53')]['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x1fa1a7,null))['then'](function(_0x599826){if(_0x599826){_0x498f6b=_0x599826;_0x268131['model']=_['keys'](db[_0x1ada('0x59')][_0x1ada('0x47')]);_0x268131[_0x1ada('0x33')]=_['keys'](_0x3e5662[_0x1ada('0x33')]);_0x268131[_0x1ada('0x34')]=_[_0x1ada('0x35')](_0x268131[_0x1ada('0x32')],_0x268131[_0x1ada('0x33')]);_0x46bd97[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0x268131[_0x1ada('0x32')],qs[_0x1ada('0x37')](_0x3e5662[_0x1ada('0x33')][_0x1ada('0x37')]));_0x46bd97['attributes']=_0x46bd97[_0x1ada('0x36')][_0x1ada('0x38')]?_0x46bd97[_0x1ada('0x36')]:_0x268131[_0x1ada('0x32')];_0x46bd97[_0x1ada('0x3b')]=qs[_0x1ada('0x3c')](_0x3e5662['query'][_0x1ada('0x3c')]);_0x46bd97[_0x1ada('0x3d')]=qs[_0x1ada('0x34')](_[_0x1ada('0x3e')](_0x3e5662[_0x1ada('0x33')],_0x268131[_0x1ada('0x34')]));if(_0x3e5662['query']['filter']){_0x46bd97[_0x1ada('0x3d')]=_[_0x1ada('0x41')](_0x46bd97[_0x1ada('0x3d')],{'$or':_[_0x1ada('0x2d')](_0x46bd97['attributes'],function(_0x26c45d){var _0xfaf7fe={};_0xfaf7fe[_0x26c45d]={'$like':'%'+_0x3e5662[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0xfaf7fe;})});}_0x46bd97=_[_0x1ada('0x41')]({},_0x46bd97,_0x3e5662['options']);return _0x498f6b[_0x1ada('0x5a')](_0x46bd97);}})[_0x1ada('0x29')](function(_0x2d43b1){if(_0x2d43b1){_0x1f1dc1=_0x2d43b1['length'];if(!_0x3e5662['query'][_0x1ada('0x39')](_0x1ada('0x3a'))){_0x46bd97[_0x1ada('0x21')]=qs[_0x1ada('0x21')](_0x3e5662['query'][_0x1ada('0x21')]);_0x46bd97[_0x1ada('0x1e')]=qs[_0x1ada('0x1e')](_0x3e5662[_0x1ada('0x33')][_0x1ada('0x1e')]);}return _0x498f6b[_0x1ada('0x5a')](_0x46bd97);}})[_0x1ada('0x29')](function(_0x208fd3){if(_0x208fd3){return _0x208fd3?{'count':_0x1f1dc1,'rows':_0x208fd3}:null;}})[_0x1ada('0x29')](respondWithResult(_0x1fa1a7,null))[_0x1ada('0x4a')](handleError(_0x1fa1a7,null));};exports[_0x1ada('0x5b')]=function(_0x828c76,_0x2bbf0b,_0x4edb29){if(_0x828c76[_0x1ada('0x4c')]['id']){delete _0x828c76[_0x1ada('0x4c')]['id'];}return db[_0x1ada('0x2e')][_0x1ada('0x49')]({'where':{'id':_0x828c76[_0x1ada('0x53')]['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x2bbf0b,null))[_0x1ada('0x29')](function(_0x11ada6){if(_0x11ada6){_0x828c76[_0x1ada('0x4c')][_0x1ada('0x5c')]=_0x11ada6['id'];return db['Action'][_0x1ada('0x4b')](_0x828c76[_0x1ada('0x4c')]);}})['then'](respondWithResult(_0x2bbf0b,null))[_0x1ada('0x4a')](handleError(_0x2bbf0b,null));};exports[_0x1ada('0x5d')]=function(_0x48f2ab,_0x95e09d,_0x2b6d5d){var _0x283527={};var _0x680424={};var _0x376090;var _0x4825d9;return db[_0x1ada('0x2e')][_0x1ada('0x58')]({'where':{'id':_0x48f2ab['params']['id']}})[_0x1ada('0x29')](handleEntityNotFound(_0x95e09d,null))['then'](function(_0x3ed545){if(_0x3ed545){_0x376090=_0x3ed545;_0x680424[_0x1ada('0x32')]=_[_0x1ada('0x46')](db['Action'][_0x1ada('0x47')]);_0x680424[_0x1ada('0x33')]=_[_0x1ada('0x46')](_0x48f2ab[_0x1ada('0x33')]);_0x680424['filters']=_[_0x1ada('0x35')](_0x680424[_0x1ada('0x32')],_0x680424[_0x1ada('0x33')]);_0x283527[_0x1ada('0x36')]=_[_0x1ada('0x35')](_0x680424[_0x1ada('0x32')],qs['fields'](_0x48f2ab['query']['fields']));_0x283527[_0x1ada('0x36')]=_0x283527['attributes'][_0x1ada('0x38')]?_0x283527[_0x1ada('0x36')]:_0x680424[_0x1ada('0x32')];_0x283527['order']=qs[_0x1ada('0x3c')](_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x3c')]);_0x283527[_0x1ada('0x3d')]=qs['filters'](_[_0x1ada('0x3e')](_0x48f2ab[_0x1ada('0x33')],_0x680424['filters']));if(_0x48f2ab[_0x1ada('0x33')]['filter']){_0x283527[_0x1ada('0x3d')]=_['merge'](_0x283527['where'],{'$or':_['map'](_0x283527['attributes'],function(_0x26bf45){var _0x4559db={};_0x4559db[_0x26bf45]={'$like':'%'+_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x3f')]+'%'};return _0x4559db;})});}_0x283527=_[_0x1ada('0x41')]({},_0x283527,_0x48f2ab['options']);return _0x376090[_0x1ada('0x5d')](_0x283527);}})[_0x1ada('0x29')](function(_0x312930){if(_0x312930){_0x4825d9=_0x312930['length'];if(!_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x39')](_0x1ada('0x3a'))){_0x283527[_0x1ada('0x21')]=qs[_0x1ada('0x21')](_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x21')]);_0x283527['offset']=qs[_0x1ada('0x1e')](_0x48f2ab[_0x1ada('0x33')][_0x1ada('0x1e')]);}return _0x376090[_0x1ada('0x5d')](_0x283527);}})['then'](function(_0x5062c7){if(_0x5062c7){return _0x5062c7?{'count':_0x4825d9,'rows':_0x5062c7}:null;}})[_0x1ada('0x29')](respondWithResult(_0x95e09d,null))[_0x1ada('0x4a')](handleError(_0x95e09d,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 64eeb72..c89866b 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 _0x3c6d=['rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x55d814,_0x463900){var _0x136a4c=function(_0xa77a0e){while(--_0xa77a0e){_0x55d814['push'](_0x55d814['shift']());}};_0x136a4c(++_0x463900);}(_0x3c6d,0x199));var _0xd3c6=function(_0x1cb3c4,_0x1ec4c2){_0x1cb3c4=_0x1cb3c4-0x0;var _0x8ef0f0=_0x3c6d[_0x1cb3c4];return _0x8ef0f0;};'use strict';var _=require(_0xd3c6('0x0'));var util=require(_0xd3c6('0x1'));var logger=require(_0xd3c6('0x2'))(_0xd3c6('0x3'));var moment=require('moment');var BPromise=require(_0xd3c6('0x4'));var rp=require(_0xd3c6('0x5'));var fs=require('fs');var path=require(_0xd3c6('0x6'));var rimraf=require(_0xd3c6('0x7'));var config=require(_0xd3c6('0x8'));var attributes=require(_0xd3c6('0x9'));module['exports']=function(_0x11fb61,_0xe7c405){return _0x11fb61[_0xd3c6('0xa')](_0xd3c6('0xb'),attributes,{'tableName':_0xd3c6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0b2=['bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports','define','tools_triggers','util','../../config/logger','api','moment'];(function(_0x1dd034,_0x5f5a76){var _0x4ecb48=function(_0x18ee58){while(--_0x18ee58){_0x1dd034['push'](_0x1dd034['shift']());}};_0x4ecb48(++_0x5f5a76);}(_0xe0b2,0xec));var _0x2e0b=function(_0x3e6575,_0x26ddbe){_0x3e6575=_0x3e6575-0x0;var _0x4c0253=_0xe0b2[_0x3e6575];return _0x4c0253;};'use strict';var _=require('lodash');var util=require(_0x2e0b('0x0'));var logger=require(_0x2e0b('0x1'))(_0x2e0b('0x2'));var moment=require(_0x2e0b('0x3'));var BPromise=require(_0x2e0b('0x4'));var rp=require(_0x2e0b('0x5'));var fs=require('fs');var path=require(_0x2e0b('0x6'));var rimraf=require('rimraf');var config=require(_0x2e0b('0x7'));var attributes=require(_0x2e0b('0x8'));module[_0x2e0b('0x9')]=function(_0x2a3a82,_0x1b8455){return _0x2a3a82[_0x2e0b('0xa')]('Trigger',attributes,{'tableName':_0x2e0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 7c033a5..daa1107 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 _0x7ad8=['Trigger,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','options','where','limit','include','map','attributes','then','GetTrigger','stringify','ShowTrigger','raw','model','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Trigger,\x20%s,\x20%s','debug'];(function(_0x4764cd,_0x36f5f0){var _0x141daf=function(_0x39c4a2){while(--_0x39c4a2){_0x4764cd['push'](_0x4764cd['shift']());}};_0x141daf(++_0x36f5f0);}(_0x7ad8,0x76));var _0x87ad=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0x7ad8[_0x2df1f2];return _0x38652b;};'use strict';var _=require(_0x87ad('0x0'));var util=require('util');var moment=require(_0x87ad('0x1'));var BPromise=require(_0x87ad('0x2'));var rs=require(_0x87ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x87ad('0x4'));var logger=require(_0x87ad('0x5'))(_0x87ad('0x6'));var config=require(_0x87ad('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x87ad('0x8')][_0x87ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x259625,_0x2499c3,_0x48f5bf){return new BPromise(function(_0x1b2e42,_0x51d78e){return client[_0x87ad('0xa')](_0x259625,_0x48f5bf)['then'](function(_0x34d992){logger[_0x87ad('0xb')](_0x87ad('0xc'),_0x2499c3,'request\x20sent');logger[_0x87ad('0xd')](_0x87ad('0xe'),_0x2499c3,'request\x20sent',JSON['stringify'](_0x34d992));if(_0x34d992['error']){if(_0x34d992[_0x87ad('0xf')][_0x87ad('0x10')]===0x1f4){logger[_0x87ad('0xf')](_0x87ad('0xc'),_0x2499c3,_0x34d992[_0x87ad('0xf')][_0x87ad('0x11')]);return _0x51d78e(_0x34d992[_0x87ad('0xf')][_0x87ad('0x11')]);}logger['error'](_0x87ad('0xc'),_0x2499c3,_0x34d992['error'][_0x87ad('0x11')]);return _0x1b2e42(_0x34d992[_0x87ad('0xf')]['message']);}else{logger[_0x87ad('0xb')](_0x87ad('0xc'),_0x2499c3,_0x87ad('0x12'));_0x1b2e42(_0x34d992[_0x87ad('0x13')][_0x87ad('0x11')]);}})[_0x87ad('0x14')](function(_0x2767fb){logger['error'](_0x87ad('0xc'),_0x2499c3,_0x2767fb);_0x51d78e(_0x2767fb);});});}exports['GetTrigger']=function(_0x70d3b2){var _0x8a93e7=this;return new Promise(function(_0x4e7e8d,_0x3d6eaa){return db['Trigger']['findAll']({'raw':_0x70d3b2[_0x87ad('0x15')]?_0x70d3b2[_0x87ad('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x70d3b2[_0x87ad('0x15')]?_0x70d3b2[_0x87ad('0x15')][_0x87ad('0x16')]||null:null,'attributes':_0x70d3b2[_0x87ad('0x15')]?_0x70d3b2['options']['attributes']||null:null,'limit':_0x70d3b2[_0x87ad('0x15')]?_0x70d3b2['options'][_0x87ad('0x17')]||null:null,'include':_0x70d3b2[_0x87ad('0x15')]?_0x70d3b2['options'][_0x87ad('0x18')]?_[_0x87ad('0x19')](_0x70d3b2[_0x87ad('0x15')][_0x87ad('0x18')],function(_0x524dec){return{'model':db[_0x524dec['model']],'as':_0x524dec['as'],'attributes':_0x524dec['attributes'],'include':_0x524dec[_0x87ad('0x18')]?_['map'](_0x524dec[_0x87ad('0x18')],function(_0x119695){return{'model':db[_0x119695['model']],'as':_0x119695['as'],'attributes':_0x119695[_0x87ad('0x1a')],'include':_0x119695['include']?_[_0x87ad('0x19')](_0x119695[_0x87ad('0x18')],function(_0x5228e7){return{'model':db[_0x5228e7['model']],'as':_0x5228e7['as'],'attributes':_0x5228e7['attributes']};}):[]};}):[]};}):[]:[]})[_0x87ad('0x1b')](function(_0x2d7d6c){logger[_0x87ad('0xb')](_0x87ad('0x1c'),_0x70d3b2);logger['debug'](_0x87ad('0x1c'),_0x70d3b2,JSON[_0x87ad('0x1d')](_0x2d7d6c));_0x4e7e8d(_0x2d7d6c);})['catch'](function(_0x1bad29){logger[_0x87ad('0xf')]('GetTrigger',_0x1bad29[_0x87ad('0x11')],_0x70d3b2);_0x3d6eaa(_0x8a93e7['error'](0x1f4,_0x1bad29['message']));});});};exports[_0x87ad('0x1e')]=function(_0x53ac93){var _0x1bcbc4=this;return new Promise(function(_0x5459c2,_0x6846b){return db['Trigger']['find']({'raw':_0x53ac93[_0x87ad('0x15')]?_0x53ac93[_0x87ad('0x15')][_0x87ad('0x1f')]===undefined?!![]:![]:!![],'where':_0x53ac93['options']?_0x53ac93['options'][_0x87ad('0x16')]||null:null,'attributes':_0x53ac93[_0x87ad('0x15')]?_0x53ac93[_0x87ad('0x15')]['attributes']||null:null,'include':_0x53ac93[_0x87ad('0x15')]?_0x53ac93[_0x87ad('0x15')][_0x87ad('0x18')]?_[_0x87ad('0x19')](_0x53ac93[_0x87ad('0x15')][_0x87ad('0x18')],function(_0x4eae8e){return{'model':db[_0x4eae8e[_0x87ad('0x20')]],'as':_0x4eae8e['as'],'attributes':_0x4eae8e[_0x87ad('0x1a')],'include':_0x4eae8e[_0x87ad('0x18')]?_['map'](_0x4eae8e[_0x87ad('0x18')],function(_0x5a46ca){return{'model':db[_0x5a46ca['model']],'as':_0x5a46ca['as'],'attributes':_0x5a46ca[_0x87ad('0x1a')],'include':_0x5a46ca[_0x87ad('0x18')]?_[_0x87ad('0x19')](_0x5a46ca[_0x87ad('0x18')],function(_0x326882){return{'model':db[_0x326882['model']],'as':_0x326882['as'],'attributes':_0x326882[_0x87ad('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x87ad('0x1b')](function(_0x44c45b){logger[_0x87ad('0xb')]('ShowTrigger',_0x53ac93);logger[_0x87ad('0xd')](_0x87ad('0x1e'),_0x53ac93,JSON[_0x87ad('0x1d')](_0x44c45b));_0x5459c2(_0x44c45b);})[_0x87ad('0x14')](function(_0x4ae431){logger[_0x87ad('0xf')](_0x87ad('0x1e'),_0x4ae431[_0x87ad('0x11')],_0x53ac93);_0x6846b(_0x1bcbc4[_0x87ad('0xf')](0x1f4,_0x4ae431[_0x87ad('0x11')]));});});}; \ No newline at end of file +var _0x7b7b=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trigger','findAll','options','limit','include','attributes','map','GetTrigger','ShowTrigger','find','raw','model','debug','util','bluebird'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x7b7b,0xe5));var _0xb7b7=function(_0x7dfb59,_0x2db32f){_0x7dfb59=_0x7dfb59-0x0;var _0x326c4a=_0x7b7b[_0x7dfb59];return _0x326c4a;};'use strict';var _=require('lodash');var util=require(_0xb7b7('0x0'));var moment=require('moment');var BPromise=require(_0xb7b7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7b7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7b7('0x3'));var logger=require(_0xb7b7('0x4'))('rpc');var config=require(_0xb7b7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb7b7('0x6')][_0xb7b7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48cef4,_0x3eba08,_0x5d240d){return new BPromise(function(_0x46c8c2,_0x1df5ab){return client[_0xb7b7('0x8')](_0x48cef4,_0x5d240d)[_0xb7b7('0x9')](function(_0x38b657){logger[_0xb7b7('0xa')](_0xb7b7('0xb'),_0x3eba08,_0xb7b7('0xc'));logger['debug'](_0xb7b7('0xd'),_0x3eba08,_0xb7b7('0xc'),JSON[_0xb7b7('0xe')](_0x38b657));if(_0x38b657[_0xb7b7('0xf')]){if(_0x38b657[_0xb7b7('0xf')][_0xb7b7('0x10')]===0x1f4){logger[_0xb7b7('0xf')](_0xb7b7('0xb'),_0x3eba08,_0x38b657[_0xb7b7('0xf')]['message']);return _0x1df5ab(_0x38b657[_0xb7b7('0xf')][_0xb7b7('0x11')]);}logger[_0xb7b7('0xf')](_0xb7b7('0xb'),_0x3eba08,_0x38b657[_0xb7b7('0xf')]['message']);return _0x46c8c2(_0x38b657[_0xb7b7('0xf')][_0xb7b7('0x11')]);}else{logger[_0xb7b7('0xa')](_0xb7b7('0xb'),_0x3eba08,'request\x20sent');_0x46c8c2(_0x38b657[_0xb7b7('0x12')][_0xb7b7('0x11')]);}})[_0xb7b7('0x13')](function(_0x5373b4){logger[_0xb7b7('0xf')](_0xb7b7('0xb'),_0x3eba08,_0x5373b4);_0x1df5ab(_0x5373b4);});});}exports['GetTrigger']=function(_0x37eba2){var _0x3fece7=this;return new Promise(function(_0x492553,_0x3a0d3d){return db[_0xb7b7('0x14')][_0xb7b7('0x15')]({'raw':_0x37eba2['options']?_0x37eba2[_0xb7b7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x37eba2[_0xb7b7('0x16')]?_0x37eba2[_0xb7b7('0x16')]['where']||null:null,'attributes':_0x37eba2['options']?_0x37eba2[_0xb7b7('0x16')]['attributes']||null:null,'limit':_0x37eba2['options']?_0x37eba2[_0xb7b7('0x16')][_0xb7b7('0x17')]||null:null,'include':_0x37eba2[_0xb7b7('0x16')]?_0x37eba2[_0xb7b7('0x16')][_0xb7b7('0x18')]?_['map'](_0x37eba2['options'][_0xb7b7('0x18')],function(_0x31f374){return{'model':db[_0x31f374['model']],'as':_0x31f374['as'],'attributes':_0x31f374[_0xb7b7('0x19')],'include':_0x31f374['include']?_[_0xb7b7('0x1a')](_0x31f374['include'],function(_0x318f12){return{'model':db[_0x318f12['model']],'as':_0x318f12['as'],'attributes':_0x318f12[_0xb7b7('0x19')],'include':_0x318f12[_0xb7b7('0x18')]?_[_0xb7b7('0x1a')](_0x318f12[_0xb7b7('0x18')],function(_0x3dd46e){return{'model':db[_0x3dd46e['model']],'as':_0x3dd46e['as'],'attributes':_0x3dd46e['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7b7('0x9')](function(_0x49f5aa){logger[_0xb7b7('0xa')](_0xb7b7('0x1b'),_0x37eba2);logger['debug'](_0xb7b7('0x1b'),_0x37eba2,JSON[_0xb7b7('0xe')](_0x49f5aa));_0x492553(_0x49f5aa);})['catch'](function(_0x162372){logger[_0xb7b7('0xf')]('GetTrigger',_0x162372['message'],_0x37eba2);_0x3a0d3d(_0x3fece7[_0xb7b7('0xf')](0x1f4,_0x162372[_0xb7b7('0x11')]));});});};exports[_0xb7b7('0x1c')]=function(_0x455f2f){var _0x5dbddf=this;return new Promise(function(_0x4dfca5,_0x6d6b9e){return db[_0xb7b7('0x14')][_0xb7b7('0x1d')]({'raw':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x1e')]===undefined?!![]:![]:!![],'where':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')]['where']||null:null,'attributes':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x19')]||null:null,'include':_0x455f2f[_0xb7b7('0x16')]?_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x18')]?_[_0xb7b7('0x1a')](_0x455f2f[_0xb7b7('0x16')][_0xb7b7('0x18')],function(_0x11fa76){return{'model':db[_0x11fa76[_0xb7b7('0x1f')]],'as':_0x11fa76['as'],'attributes':_0x11fa76['attributes'],'include':_0x11fa76[_0xb7b7('0x18')]?_['map'](_0x11fa76[_0xb7b7('0x18')],function(_0xff9a81){return{'model':db[_0xff9a81[_0xb7b7('0x1f')]],'as':_0xff9a81['as'],'attributes':_0xff9a81[_0xb7b7('0x19')],'include':_0xff9a81[_0xb7b7('0x18')]?_[_0xb7b7('0x1a')](_0xff9a81['include'],function(_0x4f3be8){return{'model':db[_0x4f3be8['model']],'as':_0x4f3be8['as'],'attributes':_0x4f3be8[_0xb7b7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb7b7('0x9')](function(_0xc43f70){logger[_0xb7b7('0xa')](_0xb7b7('0x1c'),_0x455f2f);logger[_0xb7b7('0x20')]('ShowTrigger',_0x455f2f,JSON[_0xb7b7('0xe')](_0xc43f70));_0x4dfca5(_0xc43f70);})[_0xb7b7('0x13')](function(_0xa694b){logger[_0xb7b7('0xf')](_0xb7b7('0x1c'),_0xa694b['message'],_0x455f2f);_0x6d6b9e(_0x5dbddf[_0xb7b7('0xf')](0x1f4,_0xa694b[_0xb7b7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e3e258c..98b95bf 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 _0xb3a1=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','post','/:id/clone','create','put','update'];(function(_0x250bfb,_0x183c55){var _0x2fa5d0=function(_0x2d9495){while(--_0x2d9495){_0x250bfb['push'](_0x250bfb['shift']());}};_0x2fa5d0(++_0x183c55);}(_0xb3a1,0x153));var _0x1b3a=function(_0x4a9193,_0x5ea9a4){_0x4a9193=_0x4a9193-0x0;var _0x160be2=_0xb3a1[_0x4a9193];return _0x160be2;};'use strict';var multer=require(_0x1b3a('0x0'));var util=require(_0x1b3a('0x1'));var path=require('path');var timeout=require(_0x1b3a('0x2'));var express=require('express');var router=express[_0x1b3a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1b3a('0x4'));var interaction=require(_0x1b3a('0x5'));var config=require(_0x1b3a('0x6'));var controller=require(_0x1b3a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1b3a('0x8')]);router[_0x1b3a('0x9')](_0x1b3a('0xa'),auth[_0x1b3a('0xb')](),controller[_0x1b3a('0xc')]);router[_0x1b3a('0xd')](_0x1b3a('0xe'),auth[_0x1b3a('0xb')](),controller['clone']);router[_0x1b3a('0xd')]('/',auth[_0x1b3a('0xb')](),controller[_0x1b3a('0xf')]);router[_0x1b3a('0x10')]('/:id',auth[_0x1b3a('0xb')](),controller[_0x1b3a('0x11')]);router[_0x1b3a('0x12')](_0x1b3a('0xa'),auth[_0x1b3a('0xb')](),controller[_0x1b3a('0x13')]);module[_0x1b3a('0x14')]=router; \ No newline at end of file +var _0xe863=['update','delete','/:id','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','isAuthenticated','show','/:id/clone','clone','create'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xe863,0x136));var _0x3e86=function(_0x465643,_0x44dc4e){_0x465643=_0x465643-0x0;var _0x38ab86=_0xe863[_0x465643];return _0x38ab86;};'use strict';var multer=require(_0x3e86('0x0'));var util=require(_0x3e86('0x1'));var path=require(_0x3e86('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e86('0x3'));var router=express[_0x3e86('0x4')]();var fs_extra=require(_0x3e86('0x5'));var auth=require(_0x3e86('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3e86('0x7'));var controller=require('./trunk.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3e86('0x8')]);router['get']('/:id',auth[_0x3e86('0x9')](),controller[_0x3e86('0xa')]);router['post'](_0x3e86('0xb'),auth[_0x3e86('0x9')](),controller[_0x3e86('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3e86('0xd')]);router['put']('/:id',auth[_0x3e86('0x9')](),controller[_0x3e86('0xe')]);router[_0x3e86('0xf')](_0x3e86('0x10'),auth['isAuthenticated'](),controller[_0x3e86('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a92afd8..cf31249 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 _0x5106=['info','shortinfo','auto','yes','nonat','update','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\x22alaw\x22]','insecure','\x22\x22\x20<>','INTEGER','always','refuse','originate','uac','pai','certificate','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833'];(function(_0xd8e9f5,_0x29df60){var _0x4b915e=function(_0xb395cb){while(--_0xb395cb){_0xd8e9f5['push'](_0xd8e9f5['shift']());}};_0x4b915e(++_0x29df60);}(_0x5106,0xfa));var _0x6510=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5106[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6510('0x0'));module[_0x6510('0x1')]={'name':{'type':Sequelize[_0x6510('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x6510('0x3'),_0x6510('0x4'),_0x6510('0x5')),'allowNull':![],'defaultValue':_0x6510('0x3')},'context':{'type':Sequelize[_0x6510('0x2')],'allowNull':![],'defaultValue':_0x6510('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x6510('0x7'),'ALLOWED_PASSED_SCREEN',_0x6510('0x8'),_0x6510('0x9'),_0x6510('0xa'),'PROHIB_PASSED_SCREEN',_0x6510('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x6510('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x6510('0x2')]},'md5secret':{'type':Sequelize[_0x6510('0x2')]},'remotesecret':{'type':Sequelize[_0x6510('0x2')]},'transport':{'type':Sequelize[_0x6510('0x2')],'defaultValue':_0x6510('0xc'),'set':function(_0x19d699){this[_0x6510('0xd')](_0x6510('0xe'),_0x19d699?_0x19d699['join'](','):null);},'get':function(){return this[_0x6510('0xf')]('transport')?this['getDataValue'](_0x6510('0xe'))[_0x6510('0x10')](','):null;},'comment':_0x6510('0x11')},'dtmfmode':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x13'),_0x6510('0x14'),_0x6510('0x15'),'inband',_0x6510('0x16')),'defaultValue':_0x6510('0x13')},'directmedia':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no',_0x6510('0x18'),_0x6510('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x6510('0x1a'),'set':function(_0x524d16){this['setDataValue'](_0x6510('0x1b'),_0x524d16?_0x524d16[_0x6510('0x1c')](','):null);},'get':function(){return this[_0x6510('0xf')](_0x6510('0x1b'))?this[_0x6510('0xf')](_0x6510('0x1b'))[_0x6510('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x6510('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x6510('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6510('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x6510('0x2')],'defaultValue':_0x6510('0x1d')},'allow':{'type':Sequelize[_0x6510('0x2')],'allowNull':![],'defaultValue':_0x6510('0x1e'),'set':function(_0x5adb74){this[_0x6510('0xd')](_0x6510('0x1f'),_0x5adb74?_0x5adb74[_0x6510('0x1c')](';'):_0x6510('0x1e'));},'get':function(){return this[_0x6510('0xf')](_0x6510('0x1f'))?this[_0x6510('0xf')](_0x6510('0x1f'))[_0x6510('0x10')](';'):null;},'comment':_0x6510('0x20')},'autoframing':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'insecure':{'type':Sequelize[_0x6510('0x2')],'defaultValue':'port,invite','set':function(_0x802748){this[_0x6510('0xd')](_0x6510('0x21'),_0x802748?_0x802748[_0x6510('0x1c')](','):null);},'get':function(){return this[_0x6510('0xf')](_0x6510('0x21'))?this['getDataValue'](_0x6510('0x21'))[_0x6510('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6510('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0x6510('0x12')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x6510('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x6510('0x2')]},'callerid':{'type':Sequelize[_0x6510('0x2')],'defaultValue':_0x6510('0x22')},'amaflags':{'type':Sequelize[_0x6510('0x2')]},'callcounter':{'type':Sequelize[_0x6510('0x12')]('yes','no'),'defaultValue':_0x6510('0x17')},'busylevel':{'type':Sequelize[_0x6510('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x6510('0x12')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x6510('0x2')]},'videosupport':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no',_0x6510('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6510('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'mailbox':{'type':Sequelize[_0x6510('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x6510('0x25'),_0x6510('0x26'))},'session_expires':{'type':Sequelize[_0x6510('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x6510('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x27'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x6510('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x6510('0x23')](0x5)},'qualify':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x6510('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x6510('0x2')]},'defaultuser':{'type':Sequelize[_0x6510('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6510('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no',_0x6510('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6510('0x2')]},'callbackextension':{'type':Sequelize[_0x6510('0x2')]},'timert1':{'type':Sequelize[_0x6510('0x23')](0xb)},'timerb':{'type':Sequelize[_0x6510('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x6510('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x6510('0x2')]},'contactdeny':{'type':Sequelize[_0x6510('0x2')]},'contactacl':{'type':Sequelize[_0x6510('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x6510('0x2')]},'use_q850_reason':{'type':Sequelize[_0x6510('0x2')]},'maxforwards':{'type':Sequelize[_0x6510('0x23')](0xb)},'encryption':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'force_avp':{'type':Sequelize[_0x6510('0x12')]('yes','no')},'icesupport':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x6510('0x17'),'no','fingerprint',_0x6510('0x29'))},'dtlsrekey':{'type':Sequelize[_0x6510('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x6510('0x2')]},'dtlscipher':{'type':Sequelize[_0x6510('0x2')]},'dtlscafile':{'type':Sequelize[_0x6510('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x6510('0x12')]('active','passive',_0x6510('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6510('0x2')]},'usereqphone':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6510('0x2')]},'recordofffeature':{'type':Sequelize[_0x6510('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x6510('0x12')]('yes','no')},'vmexten':{'type':Sequelize[_0x6510('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x6510('0x2')]},'parkinglot':{'type':Sequelize[_0x6510('0x2')]},'description':{'type':Sequelize[_0x6510('0x2')]},'host':{'type':Sequelize[_0x6510('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x6510('0x12')](_0x6510('0x17'),'no',_0x6510('0x18'),'update',_0x6510('0x2b')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6510('0x2')]},'otherFields':{'type':Sequelize[_0x6510('0x2')]},'active':{'type':Sequelize[_0x6510('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x3197=['insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','INTEGER','always','accept','uac','uas','pai','fingerprint','certificate','active','dynamic','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','nonat','update','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite'];(function(_0x275165,_0x17d6dc){var _0x54cb25=function(_0x554a55){while(--_0x554a55){_0x275165['push'](_0x275165['shift']());}};_0x54cb25(++_0x17d6dc);}(_0x3197,0x18e));var _0x7319=function(_0x3f3407,_0x163493){_0x3f3407=_0x3f3407-0x0;var _0x554169=_0x3197[_0x3f3407];return _0x554169;};'use strict';var Sequelize=require(_0x7319('0x0'));module['exports']={'name':{'type':Sequelize[_0x7319('0x1')],'allowNull':![],'unique':_0x7319('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x4'),_0x7319('0x5'),_0x7319('0x6')),'allowNull':![],'defaultValue':_0x7319('0x4')},'context':{'type':Sequelize[_0x7319('0x1')],'allowNull':![],'defaultValue':_0x7319('0x7')},'callingpres':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x8'),_0x7319('0x9'),'ALLOWED_FAILED_SCREEN',_0x7319('0xa'),_0x7319('0xb'),_0x7319('0xc'),_0x7319('0xd'),_0x7319('0xe'))},'deny':{'type':Sequelize[_0x7319('0x1')]},'permit':{'type':Sequelize[_0x7319('0x1')]},'secret':{'type':Sequelize[_0x7319('0x1')]},'md5secret':{'type':Sequelize[_0x7319('0x1')]},'remotesecret':{'type':Sequelize[_0x7319('0x1')]},'transport':{'type':Sequelize[_0x7319('0x1')],'defaultValue':'udp','set':function(_0x49cb08){this[_0x7319('0xf')](_0x7319('0x10'),_0x49cb08?_0x49cb08[_0x7319('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x7319('0x10'))?this[_0x7319('0x12')]('transport')['split'](','):null;},'comment':_0x7319('0x13')},'dtmfmode':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x14'),'info','shortinfo',_0x7319('0x15'),_0x7319('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x7319('0x3')]('yes','no',_0x7319('0x17'),_0x7319('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7319('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7319('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x7319('0x1')],'defaultValue':_0x7319('0x19'),'set':function(_0x2e97fc){this[_0x7319('0xf')]('nat',_0x2e97fc?_0x2e97fc[_0x7319('0x11')](','):null);},'get':function(){return this[_0x7319('0x12')]('nat')?this['getDataValue'](_0x7319('0x1a'))[_0x7319('0x1b')](','):null;},'comment':_0x7319('0x1c')},'callgroup':{'type':Sequelize[_0x7319('0x1')]},'namedcallgroup':{'type':Sequelize[_0x7319('0x1')]},'pickupgroup':{'type':Sequelize[_0x7319('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7319('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7319('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7319('0x1')],'defaultValue':_0x7319('0x1d')},'allow':{'type':Sequelize[_0x7319('0x1')],'allowNull':![],'defaultValue':_0x7319('0x1e'),'set':function(_0x35d86b){this[_0x7319('0xf')](_0x7319('0x1f'),_0x35d86b?_0x35d86b[_0x7319('0x11')](';'):_0x7319('0x1e'));},'get':function(){return this['getDataValue'](_0x7319('0x1f'))?this[_0x7319('0x12')](_0x7319('0x1f'))[_0x7319('0x1b')](';'):null;},'comment':_0x7319('0x20')},'autoframing':{'type':Sequelize[_0x7319('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x7319('0x1')],'defaultValue':_0x7319('0x21'),'set':function(_0x5825f8){this['setDataValue'](_0x7319('0x22'),_0x5825f8?_0x5825f8[_0x7319('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x7319('0x22'))?this['getDataValue'](_0x7319('0x22'))[_0x7319('0x1b')](','):null;},'comment':_0x7319('0x23')},'trustrpid':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7319('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x7319('0x24'),'no')},'useclientcode':{'type':Sequelize[_0x7319('0x3')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x7319('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7319('0x1')]},'callcounter':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x7319('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'allowsubscribe':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'allowtransfer':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7319('0x24'),'no')},'subscribecontext':{'type':Sequelize[_0x7319('0x1')]},'template':{'type':Sequelize[_0x7319('0x1')]},'videosupport':{'type':Sequelize[_0x7319('0x3')]('yes','no',_0x7319('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7319('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'mailbox':{'type':Sequelize[_0x7319('0x1')]},'session_timers':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x27'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x7319('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x7319('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x28'),_0x7319('0x29')),'defaultValue':_0x7319('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x7319('0x1')]},'regexten':{'type':Sequelize[_0x7319('0x1')]},'fromdomain':{'type':Sequelize[_0x7319('0x1')]},'fromuser':{'type':Sequelize[_0x7319('0x1')]},'port':{'type':Sequelize[_0x7319('0x25')](0x5)},'qualify':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7319('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x7319('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x7319('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x7319('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7319('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no',_0x7319('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7319('0x1')]},'callbackextension':{'type':Sequelize[_0x7319('0x1')]},'timert1':{'type':Sequelize[_0x7319('0x25')](0xb)},'timerb':{'type':Sequelize[_0x7319('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x7319('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x7319('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x7319('0x1')]},'use_q850_reason':{'type':Sequelize[_0x7319('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'icesupport':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'dtlsenable':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'dtlsverify':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no',_0x7319('0x2b'),_0x7319('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x7319('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7319('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x7319('0x1')]},'dtlscapath':{'type':Sequelize[_0x7319('0x1')]},'dtlssetup':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x2d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7319('0x1')]},'usereqphone':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7319('0x1')]},'recordofffeature':{'type':Sequelize[_0x7319('0x1')]},'call_limit':{'type':Sequelize[_0x7319('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7319('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x7319('0x3')](_0x7319('0x24'),'no')},'vmexten':{'type':Sequelize[_0x7319('0x1')]},'mohinterpret':{'type':Sequelize[_0x7319('0x1')]},'mohsuggest':{'type':Sequelize[_0x7319('0x1')]},'parkinglot':{'type':Sequelize[_0x7319('0x1')]},'description':{'type':Sequelize[_0x7319('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x7319('0x2e')},'canreinvite':{'type':Sequelize['ENUM'](_0x7319('0x24'),'no',_0x7319('0x17'),_0x7319('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x7319('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7319('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7319('0x1')],'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 0851151..3ae7cda 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 _0x8ef6=['userProfileId','autoAssociation','UserProfileResource','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','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','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','Trunks','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','options','Trunk','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','clone','omit','createdAt','updatedAt','create','body','get','role','UserProfileSection'];(function(_0x5104f2,_0x51ec95){var _0x43dcb3=function(_0x27eccd){while(--_0x27eccd){_0x5104f2['push'](_0x5104f2['shift']());}};_0x43dcb3(++_0x51ec95);}(_0x8ef6,0xf2));var _0x68ef=function(_0x533d4e,_0x18442b){_0x533d4e=_0x533d4e-0x0;var _0x11d7b5=_0x8ef6[_0x533d4e];return _0x11d7b5;};'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'];var jayson=require(_0x68ef('0x1b'));var client=jayson[_0x68ef('0x1c')][_0x68ef('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x288cc9,_0x508671,_0x3b48dd,_0xc50cce){return new BPromise(function(_0x2657c5,_0x47fbb5){var _0x22fe96=_0xc50cce||client;return _0x22fe96[_0x68ef('0x1e')](_0x288cc9,_0x3b48dd)[_0x68ef('0x1f')](function(_0x5005ba){logger[_0x68ef('0x20')](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));logger[_0x68ef('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x508671,_0x68ef('0x22'),JSON['stringify'](_0x5005ba));if(_0x5005ba['error']){if(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x25')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x508671,_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);return _0x47fbb5(_0x5005ba[_0x68ef('0x24')]['message']);}logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x5005ba[_0x68ef('0x24')]['message']);return _0x2657c5(_0x5005ba[_0x68ef('0x24')][_0x68ef('0x26')]);}else{logger['info'](_0x68ef('0x21'),_0x508671,_0x68ef('0x22'));_0x2657c5(_0x5005ba[_0x68ef('0x27')]['message']);}})['catch'](function(_0x59bebc){logger[_0x68ef('0x24')](_0x68ef('0x21'),_0x508671,_0x59bebc);_0x47fbb5(_0x59bebc);});});}function respondWithStatusCode(_0x312cc9,_0x2e6e39){_0x2e6e39=_0x2e6e39||0xcc;return function(_0x438b4c){if(_0x438b4c){return _0x312cc9[_0x68ef('0x28')](_0x2e6e39);}return _0x312cc9[_0x68ef('0x29')](_0x2e6e39)[_0x68ef('0x2a')]();};}function respondWithResult(_0x65fd09,_0x13280b){_0x13280b=_0x13280b||0xc8;return function(_0x5e4dbe){if(_0x5e4dbe){return _0x65fd09[_0x68ef('0x29')](_0x13280b)['json'](_0x5e4dbe);}};}function respondWithFilteredResult(_0x599243,_0x55d8b0){return function(_0x1a7ce1){if(_0x1a7ce1){var _0x268f32=typeof _0x55d8b0[_0x68ef('0x2b')]===_0x68ef('0x2c')&&typeof _0x55d8b0['limit']==='undefined';var _0x1cbe4f=_0x1a7ce1[_0x68ef('0x2d')];var _0x7bf96=_0x268f32?0x0:_0x55d8b0[_0x68ef('0x2b')];var _0x22ef25=_0x268f32?_0x1a7ce1[_0x68ef('0x2d')]:_0x55d8b0[_0x68ef('0x2b')]+_0x55d8b0[_0x68ef('0x2e')];var _0x5a6dfd;if(_0x22ef25>=_0x1cbe4f){_0x22ef25=_0x1cbe4f;_0x5a6dfd=0xc8;}else{_0x5a6dfd=0xce;}_0x599243[_0x68ef('0x29')](_0x5a6dfd);return _0x599243[_0x68ef('0x2f')](_0x68ef('0x30'),_0x7bf96+'-'+_0x22ef25+'/'+_0x1cbe4f)['json'](_0x1a7ce1);}return null;};}function patchUpdates(_0x370a8f){return function(_0x523120){try{jsonpatch[_0x68ef('0x31')](_0x523120,_0x370a8f,!![]);}catch(_0x17588a){return BPromise['reject'](_0x17588a);}return _0x523120['save']();};}function saveUpdates(_0x159395,_0x5fa72a){return function(_0x4b8fc8){if(_0x4b8fc8){return _0x4b8fc8[_0x68ef('0x32')](_0x159395)[_0x68ef('0x1f')](function(_0x2d67be){return _0x2d67be;});}return null;};}function removeEntity(_0x2d1e9f,_0x59e9fb){return function(_0x2c8bd0){if(_0x2c8bd0){return _0x2c8bd0[_0x68ef('0x33')]()['then'](function(){var _0x2f8de2=_0x2c8bd0['get']({'plain':!![]});var _0x14581d=_0x68ef('0x34');return db['UserProfileResource'][_0x68ef('0x33')]({'where':{'type':_0x14581d,'resourceId':_0x2f8de2['id']}})['then'](function(){return _0x2c8bd0;});})[_0x68ef('0x1f')](function(){_0x2d1e9f['status'](0xcc)[_0x68ef('0x2a')]();});}};}function handleEntityNotFound(_0x1444e0,_0x798276){return function(_0x569949){if(!_0x569949){_0x1444e0[_0x68ef('0x28')](0x194);}return _0x569949;};}function handleError(_0x485dc3,_0x476938){_0x476938=_0x476938||0x1f4;return function(_0x4c9506){logger[_0x68ef('0x24')](_0x4c9506[_0x68ef('0x35')]);if(_0x4c9506[_0x68ef('0x36')]){delete _0x4c9506[_0x68ef('0x36')];}_0x485dc3[_0x68ef('0x29')](_0x476938)[_0x68ef('0x37')](_0x4c9506);};}exports['index']=function(_0x294fba,_0x15a6ab){var _0x32074a={},_0x52a8b9={},_0x32eddd={'count':0x0,'rows':[]};var _0x3c5de6=_[_0x68ef('0x38')](db['Trunk']['rawAttributes'],function(_0x14f0fc){return{'name':_0x14f0fc[_0x68ef('0x39')],'type':_0x14f0fc[_0x68ef('0x3a')][_0x68ef('0x3b')]};});_0x52a8b9[_0x68ef('0x3c')]=_[_0x68ef('0x38')](_0x3c5de6,_0x68ef('0x36'));_0x52a8b9['query']=_[_0x68ef('0x3d')](_0x294fba[_0x68ef('0x3e')]);_0x52a8b9[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x52a8b9['model'],_0x52a8b9[_0x68ef('0x3e')]);_0x32074a[_0x68ef('0x41')]=_[_0x68ef('0x40')](_0x52a8b9[_0x68ef('0x3c')],qs[_0x68ef('0x42')](_0x294fba[_0x68ef('0x3e')]['fields']));_0x32074a[_0x68ef('0x41')]=_0x32074a[_0x68ef('0x41')][_0x68ef('0x43')]?_0x32074a[_0x68ef('0x41')]:_0x52a8b9[_0x68ef('0x3c')];if(!_0x294fba[_0x68ef('0x3e')][_0x68ef('0x44')](_0x68ef('0x45'))){_0x32074a[_0x68ef('0x2e')]=qs['limit'](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2e')]);_0x32074a[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x294fba[_0x68ef('0x3e')][_0x68ef('0x2b')]);}_0x32074a[_0x68ef('0x46')]=qs['sort'](_0x294fba[_0x68ef('0x3e')]['sort']);_0x32074a[_0x68ef('0x47')]=qs[_0x68ef('0x3f')](_[_0x68ef('0x48')](_0x294fba[_0x68ef('0x3e')],_0x52a8b9['filters']),_0x3c5de6);if(_0x294fba[_0x68ef('0x3e')]['filter']){_0x32074a[_0x68ef('0x47')]=_['merge'](_0x32074a[_0x68ef('0x47')],{'$or':_[_0x68ef('0x38')](_0x3c5de6,function(_0x105e8c){if(_0x105e8c['type']!=='VIRTUAL'){var _0x4044d5={};_0x4044d5[_0x105e8c[_0x68ef('0x36')]]={'$like':'%'+_0x294fba['query']['filter']+'%'};return _0x4044d5;}})});}_0x32074a=_['merge']({},_0x32074a,_0x294fba[_0x68ef('0x49')]);var _0x15c753={'where':_0x32074a[_0x68ef('0x47')]};return db[_0x68ef('0x4a')][_0x68ef('0x2d')](_0x15c753)['then'](function(_0x55f385){_0x32eddd[_0x68ef('0x2d')]=_0x55f385;if(_0x294fba[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0x32074a[_0x68ef('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x68ef('0x4d')](_0x32074a);})[_0x68ef('0x1f')](function(_0x1c9b6f){_0x32eddd[_0x68ef('0x4e')]=_0x1c9b6f;return _0x32eddd;})['then'](respondWithFilteredResult(_0x15a6ab,_0x32074a))['catch'](handleError(_0x15a6ab,null));};exports[_0x68ef('0x4f')]=function(_0x3c3074,_0x566e7c){var _0xfc7a74={'raw':![],'where':{'id':_0x3c3074[_0x68ef('0x50')]['id']}},_0x12fff3={};_0x12fff3[_0x68ef('0x3c')]=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x12fff3[_0x68ef('0x3e')]=_[_0x68ef('0x3d')](_0x3c3074['query']);_0x12fff3[_0x68ef('0x3f')]=_[_0x68ef('0x40')](_0x12fff3[_0x68ef('0x3c')],_0x12fff3['query']);_0xfc7a74[_0x68ef('0x41')]=_['intersection'](_0x12fff3['model'],qs[_0x68ef('0x42')](_0x3c3074['query'][_0x68ef('0x42')]));_0xfc7a74[_0x68ef('0x41')]=_0xfc7a74[_0x68ef('0x41')][_0x68ef('0x43')]?_0xfc7a74[_0x68ef('0x41')]:_0x12fff3[_0x68ef('0x3c')];if(_0x3c3074[_0x68ef('0x3e')][_0x68ef('0x4b')]){_0xfc7a74[_0x68ef('0x4c')]=[{'all':!![]}];}_0xfc7a74=_[_0x68ef('0x52')]({},_0xfc7a74,_0x3c3074['options']);return db['Trunk'][_0x68ef('0x53')](_0xfc7a74)[_0x68ef('0x1f')](handleEntityNotFound(_0x566e7c,null))[_0x68ef('0x1f')](respondWithResult(_0x566e7c,null))[_0x68ef('0x54')](handleError(_0x566e7c,null));};exports[_0x68ef('0x55')]=function(_0x1d11d7,_0x15400c){var _0x300a64={'where':{'id':_0x1d11d7['params']['id']}},_0x40c784={};_0x40c784['model']=_[_0x68ef('0x3d')](db['Trunk'][_0x68ef('0x51')]);_0x300a64['attributes']=_[_0x68ef('0x40')](_0x40c784[_0x68ef('0x3c')],qs['fields'](_0x1d11d7[_0x68ef('0x3e')]['fields']));_0x300a64[_0x68ef('0x41')]=_0x300a64[_0x68ef('0x41')][_0x68ef('0x43')]?_0x300a64[_0x68ef('0x41')]:_0x40c784[_0x68ef('0x3c')];if(_0x1d11d7[_0x68ef('0x3e')]['includeAll']){_0x300a64[_0x68ef('0x4c')]=[{'all':!![]}];}_0x300a64=_[_0x68ef('0x52')]({},_0x300a64,_0x1d11d7[_0x68ef('0x49')]);return db[_0x68ef('0x4a')][_0x68ef('0x53')](_0x300a64)[_0x68ef('0x1f')](handleEntityNotFound(_0x15400c,null))['then'](function(_0x9a978f){if(_0x9a978f){var _0x42d2a3=_0x9a978f['get']({'plain':!![]});_0x42d2a3=qs[_0x68ef('0x56')](_0x42d2a3,['id',_0x68ef('0x57'),_0x68ef('0x58')]);_0x1d11d7['body']=_[_0x68ef('0x56')](_0x1d11d7['body'],['id','createdAt',_0x68ef('0x58')]);return db['Trunk'][_0x68ef('0x59')](_['merge'](_0x42d2a3,_0x1d11d7[_0x68ef('0x5a')]),{'include':_0x1d11d7[_0x68ef('0x3e')][_0x68ef('0x4b')]?[{'all':!![]}]:undefined})[_0x68ef('0x1f')](function(_0x19ce17){var _0x19a9c4=_0x1d11d7['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x19a9c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19a9c4[_0x68ef('0x5c')]==='user'){var _0x2f97c5=_0x19ce17[_0x68ef('0x5b')]({'plain':!![]});var _0x212ec4=_0x68ef('0x34');return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x212ec4,'userProfileId':_0x19a9c4[_0x68ef('0x5e')]},'raw':!![]})['then'](function(_0x3ea4e7){if(_0x3ea4e7&&_0x3ea4e7[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x2f97c5[_0x68ef('0x36')],'resourceId':_0x2f97c5['id'],'type':_0x3ea4e7['name'],'sectionId':_0x3ea4e7['id']},{})[_0x68ef('0x1f')](function(){return _0x19ce17;});}else{return _0x19ce17;}})['catch'](function(_0x1ed172){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ed172);throw _0x1ed172;});}return _0x19ce17;});}})[_0x68ef('0x1f')](respondWithResult(_0x15400c,0xc9))[_0x68ef('0x54')](handleError(_0x15400c,null));};exports[_0x68ef('0x59')]=function(_0x21b2ce,_0x51f905,_0x124b49){var _0x570e0c;return db[_0x68ef('0x4a')][_0x68ef('0x59')](_0x21b2ce[_0x68ef('0x5a')],{'raw':!![]})['then'](function(_0x541e35){_0x570e0c=_0x541e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});})[_0x68ef('0x1f')](function(_0x454c6f){var _0x5b41e1=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),'utf8');var _0x3f56a7=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0xed16d1=ejs['render'](_0x5b41e1,{'trunks':_0x454c6f||[]});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0xed16d1);if(_0x570e0c[_0x68ef('0x69')]){var _0x595e79=ejs[_0x68ef('0x6a')](_0x3f56a7,{'trunks':_0x454c6f||[]});fs['writeFileSync'](_0x68ef('0x6b'),_0x595e79);}})['then'](function(){return respondWithRpcPromise('Reload',_0x68ef('0x59'),{'module':_0x68ef('0x6c')});})[_0x68ef('0x1f')](function(){var _0x405971=_0x21b2ce['user'][_0x68ef('0x5b')]({'plain':!![]});if(!_0x405971)throw new Error(_0x68ef('0x6d'));if(_0x405971[_0x68ef('0x5c')]==='user'){var _0x3e14a4=_0x570e0c[_0x68ef('0x5b')]({'plain':!![]});return db[_0x68ef('0x5d')][_0x68ef('0x53')]({'where':{'name':_0x68ef('0x34'),'userProfileId':_0x405971[_0x68ef('0x5e')]},'raw':!![]})[_0x68ef('0x1f')](function(_0xfe72dc){if(_0xfe72dc&&_0xfe72dc[_0x68ef('0x5f')]===0x0){return db[_0x68ef('0x60')][_0x68ef('0x59')]({'name':_0x3e14a4[_0x68ef('0x36')],'resourceId':_0x3e14a4['id'],'type':_0xfe72dc['name'],'sectionId':_0xfe72dc['id']},{})[_0x68ef('0x1f')](function(){return _0x570e0c;});}else{return _0x570e0c;}})[_0x68ef('0x54')](function(_0x5db443){logger['error'](_0x68ef('0x6e'),_0x5db443);throw _0x5db443;});}return _0x570e0c;})['then'](respondWithResult(_0x51f905,0xc9))[_0x68ef('0x54')](handleError(_0x51f905,null));};exports[_0x68ef('0x32')]=function(_0x5f1b12,_0x4e0874,_0x31a336){var _0x5c500c;return db[_0x68ef('0x4a')]['find']({'where':{'id':_0x5f1b12[_0x68ef('0x50')]['id']}})['then'](handleEntityNotFound(_0x4e0874,null))[_0x68ef('0x1f')](saveUpdates(_0x5f1b12[_0x68ef('0x5a')],null))['then'](function(_0x3c5e35){if(_0x3c5e35){_0x5c500c=_0x3c5e35;return db[_0x68ef('0x4a')][_0x68ef('0x4d')]({'raw':!![]});}})[_0x68ef('0x1f')](function(_0x50c308){if(_0x50c308){var _0x2bebdc=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4de1d1=fs[_0x68ef('0x61')](path['join'](config[_0x68ef('0x63')],_0x68ef('0x65')),'utf8');var _0x4b0fb4=ejs['render'](_0x2bebdc,{'trunks':_0x50c308||[]});fs['writeFileSync'](_0x68ef('0x68'),_0x4b0fb4);var _0x28ad22=ejs[_0x68ef('0x6a')](_0x4de1d1,{'trunks':_0x50c308||[]});fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x28ad22);return respondWithRpcPromise(_0x68ef('0x6f'),_0x68ef('0x32'),{'module':_0x68ef('0x6c')});}return null;})[_0x68ef('0x1f')](function(_0x3ae3e9){if(_0x3ae3e9){return _0x5c500c;}})[_0x68ef('0x1f')](respondWithResult(_0x4e0874,null))[_0x68ef('0x54')](handleError(_0x4e0874,null));};exports[_0x68ef('0x33')]=function(_0x4bd5c3,_0x2b20dc,_0x556dfc){var _0x791181;return db['Trunk']['find']({'where':{'id':_0x4bd5c3[_0x68ef('0x50')]['id']}})[_0x68ef('0x1f')](handleEntityNotFound(_0x2b20dc,null))[_0x68ef('0x1f')](removeEntity(_0x2b20dc,null))[_0x68ef('0x1f')](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0x68ef('0x1f')](function(_0x308997){var _0x1f1dfd=fs['readFileSync'](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x64')),_0x68ef('0x66'));var _0x4dc885=fs[_0x68ef('0x61')](path[_0x68ef('0x62')](config[_0x68ef('0x63')],_0x68ef('0x65')),_0x68ef('0x66'));var _0x346049=ejs['render'](_0x1f1dfd,{'trunks':_0x308997});var _0x2a72e8=ejs['render'](_0x4dc885,{'trunks':_0x308997});fs[_0x68ef('0x67')](_0x68ef('0x68'),_0x346049);fs[_0x68ef('0x67')](_0x68ef('0x6b'),_0x2a72e8);return respondWithRpcPromise('Reload',_0x68ef('0x33'),{'module':'chan_sip.so'});})[_0x68ef('0x54')](handleError(_0x2b20dc,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x21cd14,_0xc37f17){var _0x21cc6a=function(_0x16f658){while(--_0x16f658){_0x21cd14['push'](_0x21cd14['shift']());}};_0x21cc6a(++_0xc37f17);}(_0x98a8,0x12c));var _0x898a=function(_0x284355,_0x3d323f){_0x284355=_0x284355-0x0;var _0x14ada3=_0x98a8[_0x284355];return _0x14ada3;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 225b827..33931f8 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 _0x60d4=['tools_trunks','../../config/logger','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk'];(function(_0x5451cd,_0x49e495){var _0x55060e=function(_0x3ff99b){while(--_0x3ff99b){_0x5451cd['push'](_0x5451cd['shift']());}};_0x55060e(++_0x49e495);}(_0x60d4,0xd0));var _0x460d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x60d4[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x460d('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x460d('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x460d('0x2'));var config=require(_0x460d('0x3'));var attributes=require(_0x460d('0x4'));module[_0x460d('0x5')]=function(_0x3b3d5f,_0xe3acc5){return _0x3b3d5f[_0x460d('0x6')](_0x460d('0x7'),attributes,{'tableName':_0x460d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9b8=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','lodash'];(function(_0x332f44,_0x33ded1){var _0x318b5e=function(_0x1af4d0){while(--_0x1af4d0){_0x332f44['push'](_0x332f44['shift']());}};_0x318b5e(++_0x33ded1);}(_0xe9b8,0x1a3));var _0x8e9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe9b8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e9b('0x0'));var util=require(_0x8e9b('0x1'));var logger=require(_0x8e9b('0x2'))('api');var moment=require(_0x8e9b('0x3'));var BPromise=require(_0x8e9b('0x4'));var rp=require(_0x8e9b('0x5'));var fs=require('fs');var path=require(_0x8e9b('0x6'));var rimraf=require(_0x8e9b('0x7'));var config=require(_0x8e9b('0x8'));var attributes=require(_0x8e9b('0x9'));module['exports']=function(_0x231867,_0x3fa317){return _0x231867[_0x8e9b('0xa')](_0x8e9b('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 9fcaae8..778d494 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 _0x8666=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetTrunk','Trunk','options','raw','where','limit','include','model','attributes','map','then','ShowTrunk','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x8666,0x18b));var _0x6866=function(_0x322a0a,_0x41ce19){_0x322a0a=_0x322a0a-0x0;var _0x107cac=_0x8666[_0x322a0a];return _0x107cac;};'use strict';var _=require(_0x6866('0x0'));var util=require('util');var moment=require(_0x6866('0x1'));var BPromise=require(_0x6866('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6866('0x3'));var db=require(_0x6866('0x4'))['db'];var utils=require(_0x6866('0x5'));var logger=require(_0x6866('0x6'))(_0x6866('0x7'));var config=require(_0x6866('0x8'));var jayson=require(_0x6866('0x9'));var client=jayson[_0x6866('0xa')][_0x6866('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c3867,_0x12cd7b,_0x32eabc){return new BPromise(function(_0x28f6c5,_0x30e6d5){return client[_0x6866('0xc')](_0x3c3867,_0x32eabc)['then'](function(_0x1de5ec){logger[_0x6866('0xd')](_0x6866('0xe'),_0x12cd7b,_0x6866('0xf'));logger[_0x6866('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x12cd7b,'request\x20sent',JSON[_0x6866('0x11')](_0x1de5ec));if(_0x1de5ec['error']){if(_0x1de5ec[_0x6866('0x12')]['code']===0x1f4){logger[_0x6866('0x12')](_0x6866('0xe'),_0x12cd7b,_0x1de5ec['error'][_0x6866('0x13')]);return _0x30e6d5(_0x1de5ec[_0x6866('0x12')][_0x6866('0x13')]);}logger[_0x6866('0x12')]('Trunk,\x20%s,\x20%s',_0x12cd7b,_0x1de5ec[_0x6866('0x12')][_0x6866('0x13')]);return _0x28f6c5(_0x1de5ec[_0x6866('0x12')][_0x6866('0x13')]);}else{logger[_0x6866('0xd')](_0x6866('0xe'),_0x12cd7b,_0x6866('0xf'));_0x28f6c5(_0x1de5ec['result'][_0x6866('0x13')]);}})[_0x6866('0x14')](function(_0x5be5e2){logger['error']('Trunk,\x20%s,\x20%s',_0x12cd7b,_0x5be5e2);_0x30e6d5(_0x5be5e2);});});}exports[_0x6866('0x15')]=function(_0x93056d){var _0x21bd91=this;return new Promise(function(_0x4bcc24,_0x12d548){return db[_0x6866('0x16')]['findAll']({'raw':_0x93056d[_0x6866('0x17')]?_0x93056d[_0x6866('0x17')][_0x6866('0x18')]===undefined?!![]:![]:!![],'where':_0x93056d[_0x6866('0x17')]?_0x93056d[_0x6866('0x17')][_0x6866('0x19')]||null:null,'attributes':_0x93056d[_0x6866('0x17')]?_0x93056d[_0x6866('0x17')]['attributes']||null:null,'limit':_0x93056d[_0x6866('0x17')]?_0x93056d['options'][_0x6866('0x1a')]||null:null,'include':_0x93056d[_0x6866('0x17')]?_0x93056d[_0x6866('0x17')][_0x6866('0x1b')]?_['map'](_0x93056d[_0x6866('0x17')][_0x6866('0x1b')],function(_0x5c2126){return{'model':db[_0x5c2126[_0x6866('0x1c')]],'as':_0x5c2126['as'],'attributes':_0x5c2126[_0x6866('0x1d')],'include':_0x5c2126[_0x6866('0x1b')]?_[_0x6866('0x1e')](_0x5c2126[_0x6866('0x1b')],function(_0x4cf4cc){return{'model':db[_0x4cf4cc[_0x6866('0x1c')]],'as':_0x4cf4cc['as'],'attributes':_0x4cf4cc[_0x6866('0x1d')],'include':_0x4cf4cc[_0x6866('0x1b')]?_['map'](_0x4cf4cc['include'],function(_0x285be9){return{'model':db[_0x285be9[_0x6866('0x1c')]],'as':_0x285be9['as'],'attributes':_0x285be9[_0x6866('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6866('0x1f')](function(_0x17b695){logger[_0x6866('0xd')](_0x6866('0x15'),_0x93056d);logger[_0x6866('0x10')](_0x6866('0x15'),_0x93056d,JSON[_0x6866('0x11')](_0x17b695));_0x4bcc24(_0x17b695);})[_0x6866('0x14')](function(_0x267680){logger[_0x6866('0x12')](_0x6866('0x15'),_0x267680[_0x6866('0x13')],_0x93056d);_0x12d548(_0x21bd91[_0x6866('0x12')](0x1f4,_0x267680['message']));});});};exports[_0x6866('0x20')]=function(_0x186fa7){var _0x32bd6b=this;return new Promise(function(_0x5c78d8,_0x50f1df){return db[_0x6866('0x16')][_0x6866('0x21')]({'raw':_0x186fa7[_0x6866('0x17')]?_0x186fa7[_0x6866('0x17')][_0x6866('0x18')]===undefined?!![]:![]:!![],'where':_0x186fa7[_0x6866('0x17')]?_0x186fa7['options']['where']||null:null,'attributes':_0x186fa7[_0x6866('0x17')]?_0x186fa7[_0x6866('0x17')][_0x6866('0x1d')]||null:null,'include':_0x186fa7['options']?_0x186fa7['options'][_0x6866('0x1b')]?_[_0x6866('0x1e')](_0x186fa7[_0x6866('0x17')]['include'],function(_0x2444b5){return{'model':db[_0x2444b5[_0x6866('0x1c')]],'as':_0x2444b5['as'],'attributes':_0x2444b5[_0x6866('0x1d')],'include':_0x2444b5[_0x6866('0x1b')]?_[_0x6866('0x1e')](_0x2444b5['include'],function(_0xfe92c8){return{'model':db[_0xfe92c8[_0x6866('0x1c')]],'as':_0xfe92c8['as'],'attributes':_0xfe92c8['attributes'],'include':_0xfe92c8[_0x6866('0x1b')]?_[_0x6866('0x1e')](_0xfe92c8[_0x6866('0x1b')],function(_0x39a0f2){return{'model':db[_0x39a0f2['model']],'as':_0x39a0f2['as'],'attributes':_0x39a0f2[_0x6866('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6866('0x1f')](function(_0xbac79a){logger['info']('ShowTrunk',_0x186fa7);logger[_0x6866('0x10')]('ShowTrunk',_0x186fa7,JSON[_0x6866('0x11')](_0xbac79a));_0x5c78d8(_0xbac79a);})[_0x6866('0x14')](function(_0x504c2){logger[_0x6866('0x12')](_0x6866('0x20'),_0x504c2[_0x6866('0x13')],_0x186fa7);_0x50f1df(_0x32bd6b[_0x6866('0x12')](0x1f4,_0x504c2[_0x6866('0x13')]));});});}; \ No newline at end of file +var _0xd50a=['where','attributes','limit','include','map','model','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','findAll','options','raw'];(function(_0x26fbe1,_0xd9fa2c){var _0x41f9be=function(_0x3b8504){while(--_0x3b8504){_0x26fbe1['push'](_0x26fbe1['shift']());}};_0x41f9be(++_0xd9fa2c);}(_0xd50a,0x188));var _0xad50=function(_0x1b656b,_0x35013f){_0x1b656b=_0x1b656b-0x0;var _0xabcce7=_0xd50a[_0x1b656b];return _0xabcce7;};'use strict';var _=require(_0xad50('0x0'));var util=require(_0xad50('0x1'));var moment=require(_0xad50('0x2'));var BPromise=require(_0xad50('0x3'));var rs=require(_0xad50('0x4'));var fs=require('fs');var Redis=require(_0xad50('0x5'));var db=require(_0xad50('0x6'))['db'];var utils=require(_0xad50('0x7'));var logger=require(_0xad50('0x8'))('rpc');var config=require(_0xad50('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xad50('0xa')][_0xad50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x376075,_0x31513c,_0x140300){return new BPromise(function(_0x1ccd87,_0x421fb0){return client[_0xad50('0xc')](_0x376075,_0x140300)[_0xad50('0xd')](function(_0xa9b24e){logger[_0xad50('0xe')](_0xad50('0xf'),_0x31513c,_0xad50('0x10'));logger[_0xad50('0x11')](_0xad50('0x12'),_0x31513c,_0xad50('0x10'),JSON[_0xad50('0x13')](_0xa9b24e));if(_0xa9b24e[_0xad50('0x14')]){if(_0xa9b24e[_0xad50('0x14')]['code']===0x1f4){logger[_0xad50('0x14')](_0xad50('0xf'),_0x31513c,_0xa9b24e[_0xad50('0x14')]['message']);return _0x421fb0(_0xa9b24e[_0xad50('0x14')][_0xad50('0x15')]);}logger[_0xad50('0x14')](_0xad50('0xf'),_0x31513c,_0xa9b24e[_0xad50('0x14')][_0xad50('0x15')]);return _0x1ccd87(_0xa9b24e[_0xad50('0x14')][_0xad50('0x15')]);}else{logger[_0xad50('0xe')](_0xad50('0xf'),_0x31513c,_0xad50('0x10'));_0x1ccd87(_0xa9b24e[_0xad50('0x16')]['message']);}})[_0xad50('0x17')](function(_0x49410e){logger[_0xad50('0x14')](_0xad50('0xf'),_0x31513c,_0x49410e);_0x421fb0(_0x49410e);});});}exports[_0xad50('0x18')]=function(_0x518c60){var _0x18563b=this;return new Promise(function(_0x6d1023,_0x2e709e){return db['Trunk'][_0xad50('0x19')]({'raw':_0x518c60['options']?_0x518c60[_0xad50('0x1a')][_0xad50('0x1b')]===undefined?!![]:![]:!![],'where':_0x518c60[_0xad50('0x1a')]?_0x518c60['options'][_0xad50('0x1c')]||null:null,'attributes':_0x518c60['options']?_0x518c60[_0xad50('0x1a')][_0xad50('0x1d')]||null:null,'limit':_0x518c60[_0xad50('0x1a')]?_0x518c60[_0xad50('0x1a')][_0xad50('0x1e')]||null:null,'include':_0x518c60['options']?_0x518c60[_0xad50('0x1a')][_0xad50('0x1f')]?_[_0xad50('0x20')](_0x518c60[_0xad50('0x1a')]['include'],function(_0x187af5){return{'model':db[_0x187af5[_0xad50('0x21')]],'as':_0x187af5['as'],'attributes':_0x187af5[_0xad50('0x1d')],'include':_0x187af5[_0xad50('0x1f')]?_['map'](_0x187af5[_0xad50('0x1f')],function(_0x108ea4){return{'model':db[_0x108ea4[_0xad50('0x21')]],'as':_0x108ea4['as'],'attributes':_0x108ea4[_0xad50('0x1d')],'include':_0x108ea4[_0xad50('0x1f')]?_['map'](_0x108ea4[_0xad50('0x1f')],function(_0x3155e0){return{'model':db[_0x3155e0['model']],'as':_0x3155e0['as'],'attributes':_0x3155e0[_0xad50('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad50('0xd')](function(_0x43cd8b){logger[_0xad50('0xe')](_0xad50('0x18'),_0x518c60);logger[_0xad50('0x11')](_0xad50('0x18'),_0x518c60,JSON['stringify'](_0x43cd8b));_0x6d1023(_0x43cd8b);})[_0xad50('0x17')](function(_0x2de651){logger[_0xad50('0x14')]('GetTrunk',_0x2de651[_0xad50('0x15')],_0x518c60);_0x2e709e(_0x18563b[_0xad50('0x14')](0x1f4,_0x2de651['message']));});});};exports[_0xad50('0x22')]=function(_0x134bbc){var _0x396290=this;return new Promise(function(_0x17d6fb,_0x2f5fd9){return db['Trunk']['find']({'raw':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')][_0xad50('0x1b')]===undefined?!![]:![]:!![],'where':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')][_0xad50('0x1c')]||null:null,'attributes':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')][_0xad50('0x1d')]||null:null,'include':_0x134bbc[_0xad50('0x1a')]?_0x134bbc[_0xad50('0x1a')]['include']?_[_0xad50('0x20')](_0x134bbc[_0xad50('0x1a')]['include'],function(_0x5ec73c){return{'model':db[_0x5ec73c[_0xad50('0x21')]],'as':_0x5ec73c['as'],'attributes':_0x5ec73c['attributes'],'include':_0x5ec73c[_0xad50('0x1f')]?_[_0xad50('0x20')](_0x5ec73c[_0xad50('0x1f')],function(_0x425180){return{'model':db[_0x425180[_0xad50('0x21')]],'as':_0x425180['as'],'attributes':_0x425180[_0xad50('0x1d')],'include':_0x425180['include']?_['map'](_0x425180[_0xad50('0x1f')],function(_0x38b322){return{'model':db[_0x38b322[_0xad50('0x21')]],'as':_0x38b322['as'],'attributes':_0x38b322[_0xad50('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xad50('0xd')](function(_0x166fae){logger['info'](_0xad50('0x22'),_0x134bbc);logger['debug']('ShowTrunk',_0x134bbc,JSON[_0xad50('0x13')](_0x166fae));_0x17d6fb(_0x166fae);})['catch'](function(_0x28f1c2){logger[_0xad50('0x14')]('ShowTrunk',_0x28f1c2[_0xad50('0x15')],_0x134bbc);_0x2f5fd9(_0x396290[_0xad50('0x14')](0x1f4,_0x28f1c2['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 69fc3de..9726d60 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 _0x7c43=['update','express','../../components/auth/service','put','isAuthenticated'];(function(_0x273bb2,_0x319264){var _0x22f932=function(_0x2124ba){while(--_0x2124ba){_0x273bb2['push'](_0x273bb2['shift']());}};_0x22f932(++_0x319264);}(_0x7c43,0xdd));var _0x37c4=function(_0x41f3fd,_0x50d0c2){_0x41f3fd=_0x41f3fd-0x0;var _0x3a836f=_0x7c43[_0x41f3fd];return _0x3a836f;};'use strict';var express=require(_0x37c4('0x0'));var router=express['Router']();var auth=require(_0x37c4('0x1'));var controller=require('./user-setting.controller');router[_0x37c4('0x2')]('/:id',auth[_0x37c4('0x3')](),controller[_0x37c4('0x4')]);module['exports']=router; \ No newline at end of file +var _0xff78=['put','/:id','isAuthenticated','express','Router','../../components/auth/service'];(function(_0x397a0b,_0x1a9fe7){var _0x5f3b98=function(_0x424a69){while(--_0x424a69){_0x397a0b['push'](_0x397a0b['shift']());}};_0x5f3b98(++_0x1a9fe7);}(_0xff78,0x159));var _0x8ff7=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0xff78[_0x148879];return _0x4f7027;};'use strict';var express=require(_0x8ff7('0x0'));var router=express[_0x8ff7('0x1')]();var auth=require(_0x8ff7('0x2'));var controller=require('./user-setting.controller');router[_0x8ff7('0x3')](_0x8ff7('0x4'),auth[_0x8ff7('0x5')](),controller['update']);module['exports']=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 6f34d1d..b6f636e 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 _0x201c=['warning','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x34df82,_0x315f76){var _0x4e998f=function(_0x23c5cc){while(--_0x23c5cc){_0x34df82['push'](_0x34df82['shift']());}};_0x4e998f(++_0x315f76);}(_0x201c,0x11e));var _0xc201=function(_0x39c01c,_0x1c652f){_0x39c01c=_0x39c01c-0x0;var _0x5046e3=_0x201c[_0x39c01c];return _0x5046e3;};'use strict';var Sequelize=require(_0xc201('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xc201('0x1'),_0xc201('0x2'),'info','debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xc201('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xc201('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xc201('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xc201('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xc201('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xc201('0x7')],'unique':_0xc201('0x8')}}; \ No newline at end of file +var _0x6b7f=['debug','exports','ENUM','error','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x6b7f,0x171));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf6b7('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error','warning','info',_0xf6b7('0x1')];module[_0xf6b7('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf6b7('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf6b7('0x4'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf6b7('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xf6b7('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf6b7('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xf6b7('0x8')],'unique':_0xf6b7('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 93982f2..bf0a97a 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 _0xc999=['status','json','update','sendStatus','error','name','send','role','Invalid\x20user\x20setting\x20id','UserSetting','params','body','then','ioredis','../../config/logger','api','./user-setting.socket','redis','localhost'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0xc999,0x176));var _0x9c99=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xc999[_0x5f5cce];return _0x705ecf;};'use strict';var _=require('lodash');var Redis=require(_0x9c99('0x0'));var logger=require(_0x9c99('0x1'))(_0x9c99('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9c99('0x3'))['register'](socket);config[_0x9c99('0x4')]=_['defaults'](config[_0x9c99('0x4')],{'host':_0x9c99('0x5'),'port':0x18eb});function respondWithResult(_0xe80252,_0x47bfaa){_0x47bfaa=_0x47bfaa||0xc8;return function(_0xfa25e1){if(_0xfa25e1){return _0xe80252[_0x9c99('0x6')](_0x47bfaa)[_0x9c99('0x7')](_0xfa25e1);}};}function saveUpdates(_0x2b5df9){return function(_0x2e526f){if(_0x2e526f){return _0x2e526f[_0x9c99('0x8')](_0x2b5df9)['then'](function(_0x9406a){return _0x9406a;});}return null;};}function handleEntityNotFound(_0x18e677){return function(_0x1e34b5){if(!_0x1e34b5){_0x18e677[_0x9c99('0x9')](0x194);}return _0x1e34b5;};}function handleError(_0x560631,_0xf751e1){_0xf751e1=_0xf751e1||0x1f4;return function(_0x7d199a){logger[_0x9c99('0xa')](_0x7d199a['stack']);if(_0x7d199a[_0x9c99('0xb')]){delete _0x7d199a['name'];}_0x560631['status'](_0xf751e1)[_0x9c99('0xc')](_0x7d199a);};}exports[_0x9c99('0x8')]=function(_0x2d4c9a,_0x2bb18a){if(_0x2d4c9a['user'][_0x9c99('0xd')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x2d4c9a['params']['id'])))throw new Error(_0x9c99('0xe'));return db[_0x9c99('0xf')]['find']({'where':{'id':_0x2d4c9a[_0x9c99('0x10')]['id']}})['then'](handleEntityNotFound(_0x2bb18a,null))['then'](saveUpdates(_0x2d4c9a[_0x9c99('0x11')],null))[_0x9c99('0x12')](respondWithResult(_0x2bb18a,null))['catch'](handleError(_0x2bb18a,null));}; \ No newline at end of file +var _0x63bb=['../../mysqldb','socket.io-emitter','register','redis','defaults','json','update','then','name','status','send','user','role','admin','Unauthorized','params','UserSetting','body','lodash','ioredis','../../config/logger','api','../../config/environment'];(function(_0x5b638d,_0x19c25d){var _0x2fc633=function(_0x19c392){while(--_0x19c392){_0x5b638d['push'](_0x5b638d['shift']());}};_0x2fc633(++_0x19c25d);}(_0x63bb,0xf8));var _0xb63b=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x63bb[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require(_0xb63b('0x0'));var Redis=require(_0xb63b('0x1'));var logger=require(_0xb63b('0x2'))(_0xb63b('0x3'));var config=require(_0xb63b('0x4'));var db=require(_0xb63b('0x5'))['db'];var socket=require(_0xb63b('0x6'))(new Redis(config['redis']));require('./user-setting.socket')[_0xb63b('0x7')](socket);config[_0xb63b('0x8')]=_[_0xb63b('0x9')](config[_0xb63b('0x8')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3eb1be,_0x2a27f9){_0x2a27f9=_0x2a27f9||0xc8;return function(_0x2aa873){if(_0x2aa873){return _0x3eb1be['status'](_0x2a27f9)[_0xb63b('0xa')](_0x2aa873);}};}function saveUpdates(_0x46a6ea){return function(_0x4df157){if(_0x4df157){return _0x4df157[_0xb63b('0xb')](_0x46a6ea)[_0xb63b('0xc')](function(_0x254e59){return _0x254e59;});}return null;};}function handleEntityNotFound(_0x40a21e){return function(_0x2b2574){if(!_0x2b2574){_0x40a21e['sendStatus'](0x194);}return _0x2b2574;};}function handleError(_0x5255ad,_0x3a22a6){_0x3a22a6=_0x3a22a6||0x1f4;return function(_0xac9d51){logger['error'](_0xac9d51['stack']);if(_0xac9d51[_0xb63b('0xd')]){delete _0xac9d51[_0xb63b('0xd')];}_0x5255ad[_0xb63b('0xe')](_0x3a22a6)[_0xb63b('0xf')](_0xac9d51);};}exports['update']=function(_0x33fa77,_0x16c594){if(_0x33fa77[_0xb63b('0x10')][_0xb63b('0x11')]!==_0xb63b('0x12'))throw new Error(_0xb63b('0x13'));if(isNaN(Number(_0x33fa77[_0xb63b('0x14')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xb63b('0x15')]['find']({'where':{'id':_0x33fa77[_0xb63b('0x14')]['id']}})[_0xb63b('0xc')](handleEntityNotFound(_0x16c594,null))[_0xb63b('0xc')](saveUpdates(_0x33fa77[_0xb63b('0x16')],null))[_0xb63b('0xc')](respondWithResult(_0x16c594,null))['catch'](handleError(_0x16c594,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 54440bf..26a507a 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 _0xaae7=['exports','events','UserSetting','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x154dae,_0x1d7e54){var _0xbdaf10=function(_0x1e5db4){while(--_0x1e5db4){_0x154dae['push'](_0x154dae['shift']());}};_0xbdaf10(++_0x1d7e54);}(_0xaae7,0xa9));var _0x7aae=function(_0x45583d,_0x486505){_0x45583d=_0x45583d-0x0;var _0x1bbb7a=_0xaae7[_0x45583d];return _0x1bbb7a;};'use strict';var EventEmitter=require(_0x7aae('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x7aae('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x7aae('0x2')](0x0);var events={'afterCreate':_0x7aae('0x3'),'afterUpdate':'update','afterDestroy':_0x7aae('0x4')};function emitEvent(_0x5c00aa){return function(_0x21fe4b,_0x3bf202,_0x568d9d){UserSettingEvents['emit'](_0x5c00aa+':'+_0x21fe4b['id'],_0x21fe4b);UserSettingEvents['emit'](_0x5c00aa,_0x21fe4b);_0x568d9d(null);};}for(var e in events){if(events[_0x7aae('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x7aae('0x6')]=UserSettingEvents; \ No newline at end of file +var _0xb744=['hook','exports','../../mysqldb','UserSetting','save','update','emit','hasOwnProperty'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xb744,0x12a));var _0x4b74=function(_0x9adffe,_0x49b8ac){_0x9adffe=_0x9adffe-0x0;var _0x73da4=_0xb744[_0x9adffe];return _0x73da4;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x4b74('0x0'))['db'][_0x4b74('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b74('0x2'),'afterUpdate':_0x4b74('0x3'),'afterDestroy':'remove'};function emitEvent(_0x42f0fe){return function(_0x12a51d,_0x441074,_0x2702cb){UserSettingEvents[_0x4b74('0x4')](_0x42f0fe+':'+_0x12a51d['id'],_0x12a51d);UserSettingEvents[_0x4b74('0x4')](_0x42f0fe,_0x12a51d);_0x2702cb(null);};}for(var e in events){if(events[_0x4b74('0x5')](e)){var event=events[e];UserSetting[_0x4b74('0x6')](e,emitEvent(event));}}module[_0x4b74('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 36b17fe..88dbeff 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 _0x5ec6=['exports','UserSetting','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x424357,_0x9ebe3e){var _0x29c68e=function(_0x663b5d){while(--_0x663b5d){_0x424357['push'](_0x424357['shift']());}};_0x29c68e(++_0x9ebe3e);}(_0x5ec6,0x7f));var _0x65ec=function(_0x454a09,_0x5633a7){_0x454a09=_0x454a09-0x0;var _0x7fe609=_0x5ec6[_0x454a09];return _0x7fe609;};'use strict';var attributes=require(_0x65ec('0x0'));module[_0x65ec('0x1')]=function(_0x26f68b){return _0x26f68b['define'](_0x65ec('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x476873){if(!_0x476873['clientSideLoggingEnabled'])_0x476873[_0x65ec('0x3')]=null;else if(_0x476873['clientSideLoggingEnabledSince']===null)_0x476873[_0x65ec('0x3')]=new Date();}}});}; \ No newline at end of file +var _0x4227=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x4227,0x89));var _0x7422=function(_0x2812b7,_0x1b9dd2){_0x2812b7=_0x2812b7-0x0;var _0x4e4a48=_0x4227[_0x2812b7];return _0x4e4a48;};'use strict';var attributes=require(_0x7422('0x0'));module['exports']=function(_0x4f6e48){return _0x4f6e48[_0x7422('0x1')]('UserSetting',attributes,{'tableName':_0x7422('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17e787){if(!_0x17e787[_0x7422('0x3')])_0x17e787['clientSideLoggingEnabledSince']=null;else if(_0x17e787[_0x7422('0x4')]===null)_0x17e787[_0x7422('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index a4fb83b..819e81b 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 _0x05e0=['update','emit','user-setting:update','UserId','register','length','user-setting:','./user-setting.events','remove'];(function(_0x21519b,_0x3007b7){var _0x17cf1c=function(_0x503d03){while(--_0x503d03){_0x21519b['push'](_0x21519b['shift']());}};_0x17cf1c(++_0x3007b7);}(_0x05e0,0x181));var _0x005e=function(_0xc29fa6,_0x41cdd6){_0xc29fa6=_0xc29fa6-0x0;var _0x2e957b=_0x05e0[_0xc29fa6];return _0x2e957b;};'use strict';var UserSettingEvents=require(_0x005e('0x0'));var events=['save',_0x005e('0x1'),_0x005e('0x2')];function createListener(_0x20180a,_0x23b0f2){return function(_0x5c558f){_0x23b0f2[_0x005e('0x3')](_0x20180a,_0x5c558f);if(_0x20180a===_0x005e('0x4')){_0x23b0f2['emit']('user-setting:update:user-'+_0x5c558f[_0x005e('0x5')],_0x5c558f);}};}exports[_0x005e('0x6')]=function(_0x295af0){for(var _0x144d44=0x0,_0xbfea61=events[_0x005e('0x7')];_0x144d44<_0xbfea61;_0x144d44++){var _0x378601=events[_0x144d44];var _0x12e460=createListener(_0x005e('0x8')+_0x378601,_0x295af0);UserSettingEvents['on'](_0x378601,_0x12e460);}}; \ No newline at end of file +var _0xf54e=['user-setting:update:user-','UserId','register','length','user-setting:','save','remove','update','user-setting:update','emit'];(function(_0x1e5d56,_0x8a4924){var _0x37f85b=function(_0x250679){while(--_0x250679){_0x1e5d56['push'](_0x1e5d56['shift']());}};_0x37f85b(++_0x8a4924);}(_0xf54e,0xf5));var _0xef54=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0xf54e[_0x44039a];return _0x525de5;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xef54('0x0'),_0xef54('0x1'),_0xef54('0x2')];function createListener(_0x4eddb9,_0x1d5f2a){return function(_0x19cb20){_0x1d5f2a['emit'](_0x4eddb9,_0x19cb20);if(_0x4eddb9===_0xef54('0x3')){_0x1d5f2a[_0xef54('0x4')](_0xef54('0x5')+_0x19cb20[_0xef54('0x6')],_0x19cb20);}};}exports[_0xef54('0x7')]=function(_0x30adec){for(var _0xc8e6d0=0x0,_0x2ce9eb=events[_0xef54('0x8')];_0xc8e6d0<_0x2ce9eb;_0xc8e6d0++){var _0x23560c=events[_0xc8e6d0];var _0x3fbbda=createListener(_0xef54('0x9')+_0x23560c,_0x30adec);UserSettingEvents['on'](_0x23560c,_0x3fbbda);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 9e0a481..255a3f9 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 _0xed7a=['server/files/images/','%s-%s','now','originalname','/:id/avatar','file','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','/:id/api_key','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','index','isAuthenticated','/whoami','whoami','/presence','/:id','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getLists','getAgents','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root'];(function(_0x19656a,_0x206f40){var _0xf706f7=function(_0x59e23f){while(--_0x59e23f){_0x19656a['push'](_0x19656a['shift']());}};_0xf706f7(++_0x206f40);}(_0xed7a,0x9f));var _0xaed7=function(_0x752b24,_0xc9fe47){_0x752b24=_0x752b24-0x0;var _0x5203e0=_0xed7a[_0x752b24];return _0x5203e0;};'use strict';var multer=require(_0xaed7('0x0'));var util=require(_0xaed7('0x1'));var path=require('path');var timeout=require(_0xaed7('0x2'));var express=require(_0xaed7('0x3'));var router=express[_0xaed7('0x4')]();var fs_extra=require(_0xaed7('0x5'));var auth=require(_0xaed7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaed7('0x7'));var controller=require(_0xaed7('0x8'));router[_0xaed7('0x9')]('/',auth['isAuthenticated'](),controller[_0xaed7('0xa')]);router[_0xaed7('0x9')]('/describe',auth[_0xaed7('0xb')](),controller['describe']);router['get'](_0xaed7('0xc'),auth[_0xaed7('0xb')](),controller[_0xaed7('0xd')]);router[_0xaed7('0x9')](_0xaed7('0xe'),auth[_0xaed7('0xb')](),controller['getPresence']);router[_0xaed7('0x9')](_0xaed7('0xf'),auth[_0xaed7('0xb')](),controller['show']);router[_0xaed7('0x9')]('/:id/avatar',controller['getAvatar']);router[_0xaed7('0x9')]('/:id/open_tabs',auth['isAuthenticated'](),controller[_0xaed7('0x10')]);router[_0xaed7('0x9')](_0xaed7('0x11'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x12')]);router[_0xaed7('0x9')]('/:id/queues',auth[_0xaed7('0xb')](),controller[_0xaed7('0x13')]);router[_0xaed7('0x9')]('/:id/queues_rt',auth[_0xaed7('0xb')](),controller[_0xaed7('0x14')]);router[_0xaed7('0x9')](_0xaed7('0x15'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x16')]);router['get'](_0xaed7('0x17'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x18')]);router[_0xaed7('0x9')](_0xaed7('0x19'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x1a')]);router[_0xaed7('0x9')](_0xaed7('0x1b'),auth[_0xaed7('0xb')](),controller['getChatInteractions']);router[_0xaed7('0x9')](_0xaed7('0x1c'),auth[_0xaed7('0xb')](),controller['getOpenchannelInteractions']);router[_0xaed7('0x9')](_0xaed7('0x1d'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x1e')]);router[_0xaed7('0x9')](_0xaed7('0x1f'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x20')]);router[_0xaed7('0x9')](_0xaed7('0x21'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x22')]);router[_0xaed7('0x9')](_0xaed7('0x23'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x24')]);router[_0xaed7('0x9')](_0xaed7('0x25'),auth[_0xaed7('0xb')](),controller['getTeams']);router['get']('/:id/lists',auth[_0xaed7('0xb')](),controller[_0xaed7('0x26')]);router[_0xaed7('0x9')]('/:id/agents',auth[_0xaed7('0xb')](),controller[_0xaed7('0x27')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xaed7('0x9')]('/:id/fax_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x28')]);router[_0xaed7('0x9')](_0xaed7('0x29'),auth[_0xaed7('0xb')](),controller['getMailAccounts']);router['get'](_0xaed7('0x2a'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x2b')]);router[_0xaed7('0x9')]('/:id/sms_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x2c')]);router[_0xaed7('0x9')](_0xaed7('0x2d'),auth['isAuthenticated'](),controller[_0xaed7('0x2e')]);router[_0xaed7('0x9')](_0xaed7('0x2f'),auth[_0xaed7('0xb')](),controller['getWhatsappAccounts']);router['get'](_0xaed7('0x30'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x31')]);router[_0xaed7('0x9')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xaed7('0x32')]);router['post'](_0xaed7('0x11'),auth[_0xaed7('0xb')](),controller['addContacts']);router['post']('/',auth[_0xaed7('0xb')](),controller['create']);router[_0xaed7('0x33')](_0xaed7('0x34'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x35')]);router[_0xaed7('0x33')](_0xaed7('0x36'),auth['isAuthenticated'](),controller[_0xaed7('0x37')]);var upload=multer({'storage':multer[_0xaed7('0x38')]({'destination':function(_0x4ab955,_0x18b874,_0xb5fc52){_0xb5fc52(null,path[_0xaed7('0x39')](config[_0xaed7('0x3a')],_0xaed7('0x3b')));},'filename':function(_0x3e2060,_0x2f02e0,_0x592a80){_0x592a80(null,util['format'](_0xaed7('0x3c'),Date[_0xaed7('0x3d')](),_0x2f02e0[_0xaed7('0x3e')]));}})});router[_0xaed7('0x33')](_0xaed7('0x3f'),upload['single'](_0xaed7('0x40')),controller['addAvatar']);router['post']('/:id/login',auth[_0xaed7('0xb')](),controller[_0xaed7('0x41')]);router['post'](_0xaed7('0x42'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x43')]);router[_0xaed7('0x33')](_0xaed7('0x44'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x45')]);router[_0xaed7('0x33')](_0xaed7('0x46'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x47')]);router['post'](_0xaed7('0x25'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x48')]);router['post'](_0xaed7('0x49'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x4a')]);router[_0xaed7('0x33')](_0xaed7('0x4b'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x4c')]);router[_0xaed7('0x33')](_0xaed7('0x4d'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x4e')]);router[_0xaed7('0x33')](_0xaed7('0x4f'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x50')]);router[_0xaed7('0x33')](_0xaed7('0x51'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x52')]);router[_0xaed7('0x33')](_0xaed7('0x53'),auth[_0xaed7('0xb')](),controller['addWhatsappInteractions']);router['post'](_0xaed7('0x54'),auth['isAuthenticated'](),controller['addFaxAccounts']);router[_0xaed7('0x33')](_0xaed7('0x29'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x55')]);router[_0xaed7('0x33')]('/:id/openchannel_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x56')]);router[_0xaed7('0x33')]('/:id/sms_accounts',auth[_0xaed7('0xb')](),controller[_0xaed7('0x57')]);router[_0xaed7('0x33')](_0xaed7('0x2d'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x58')]);router[_0xaed7('0x33')](_0xaed7('0x2f'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x59')]);router[_0xaed7('0x33')]('/:id/api_key',auth[_0xaed7('0xb')](),controller[_0xaed7('0x5a')]);router[_0xaed7('0x5b')]('/:id',auth['isAuthenticated'](),controller[_0xaed7('0x5c')]);router[_0xaed7('0x5b')](_0xaed7('0x5d'),auth[_0xaed7('0xb')](),controller['changePassword']);router[_0xaed7('0x5e')](_0xaed7('0x36'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x5f')]);router[_0xaed7('0x5e')](_0xaed7('0x25'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x60')]);router[_0xaed7('0x5e')](_0xaed7('0xf'),auth[_0xaed7('0xb')](),controller['destroy']);router[_0xaed7('0x5e')]('/:id/chat_interactions',auth[_0xaed7('0xb')](),controller[_0xaed7('0x61')]);router['delete']('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xaed7('0x62')]);router[_0xaed7('0x5e')]('/:id/fax_interactions',auth[_0xaed7('0xb')](),controller['removeFaxInteractions']);router[_0xaed7('0x5e')]('/:id/sms_interactions',auth[_0xaed7('0xb')](),controller[_0xaed7('0x63')]);router['delete'](_0xaed7('0x51'),auth['isAuthenticated'](),controller[_0xaed7('0x64')]);router[_0xaed7('0x5e')]('/:id/whatsapp_interactions',auth[_0xaed7('0xb')](),controller[_0xaed7('0x65')]);router[_0xaed7('0x5e')](_0xaed7('0x54'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x66')]);router['delete'](_0xaed7('0x29'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x67')]);router['delete'](_0xaed7('0x2a'),auth['isAuthenticated'](),controller[_0xaed7('0x68')]);router[_0xaed7('0x5e')](_0xaed7('0x69'),auth[_0xaed7('0xb')](),controller[_0xaed7('0x6a')]);router[_0xaed7('0x5e')](_0xaed7('0x2d'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xaed7('0x5e')]('/:id/whatsapp_accounts',auth[_0xaed7('0xb')](),controller['removeWhatsappAccounts']);router[_0xaed7('0x5e')](_0xaed7('0x6b'),auth[_0xaed7('0xb')](),controller['removeApiKey']);module[_0xaed7('0x6c')]=router; \ No newline at end of file +var _0xae60=['isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0xae60,0x1c7));var _0x0ae6=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xae60[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var path=require(_0x0ae6('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae6('0x3'));var router=express[_0x0ae6('0x4')]();var fs_extra=require(_0x0ae6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae6('0x6'));var config=require(_0x0ae6('0x7'));var controller=require('./user.controller');router[_0x0ae6('0x8')]('/',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xa')]);router[_0x0ae6('0x8')](_0x0ae6('0xb'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xc')]);router[_0x0ae6('0x8')]('/whoami',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0xd')]);router[_0x0ae6('0x8')](_0x0ae6('0xe'),auth['isAuthenticated'](),controller[_0x0ae6('0xf')]);router[_0x0ae6('0x8')](_0x0ae6('0x10'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x11')]);router[_0x0ae6('0x8')](_0x0ae6('0x12'),controller[_0x0ae6('0x13')]);router[_0x0ae6('0x8')](_0x0ae6('0x14'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x15')]);router[_0x0ae6('0x8')](_0x0ae6('0x16'),auth['isAuthenticated'](),controller[_0x0ae6('0x17')]);router[_0x0ae6('0x8')](_0x0ae6('0x18'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x19')]);router[_0x0ae6('0x8')](_0x0ae6('0x1a'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1b')]);router[_0x0ae6('0x8')](_0x0ae6('0x1c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1d')]);router[_0x0ae6('0x8')](_0x0ae6('0x1e'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x1f')]);router[_0x0ae6('0x8')](_0x0ae6('0x20'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x21')]);router[_0x0ae6('0x8')]('/:id/chat/interactions',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x22')]);router[_0x0ae6('0x8')](_0x0ae6('0x23'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x24')]);router[_0x0ae6('0x8')](_0x0ae6('0x25'),auth['isAuthenticated'](),controller[_0x0ae6('0x26')]);router[_0x0ae6('0x8')](_0x0ae6('0x27'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x28')]);router['get'](_0x0ae6('0x29'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x2a')]);router[_0x0ae6('0x8')](_0x0ae6('0x2b'),auth[_0x0ae6('0x9')](),controller['getWhatsappInteractions']);router[_0x0ae6('0x8')](_0x0ae6('0x2c'),auth['isAuthenticated'](),controller['getTeams']);router[_0x0ae6('0x8')](_0x0ae6('0x2d'),auth[_0x0ae6('0x9')](),controller['getLists']);router[_0x0ae6('0x8')](_0x0ae6('0x2e'),auth[_0x0ae6('0x9')](),controller['getAgents']);router[_0x0ae6('0x8')](_0x0ae6('0x2f'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x30')]);router[_0x0ae6('0x8')](_0x0ae6('0x31'),auth['isAuthenticated'](),controller['getFaxAccounts']);router[_0x0ae6('0x8')](_0x0ae6('0x32'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0x0ae6('0x8')](_0x0ae6('0x33'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x34')]);router['get'](_0x0ae6('0x35'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x36')]);router['get'](_0x0ae6('0x37'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x38')]);router[_0x0ae6('0x8')](_0x0ae6('0x39'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x3a')]);router[_0x0ae6('0x8')](_0x0ae6('0x3b'),auth[_0x0ae6('0x9')](),controller['getScheduledCalls']);router[_0x0ae6('0x8')](_0x0ae6('0x3c'),auth['isAuthenticated'](),controller[_0x0ae6('0x3d')]);router[_0x0ae6('0x3e')](_0x0ae6('0x16'),auth['isAuthenticated'](),controller[_0x0ae6('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0ae6('0x40')]);router[_0x0ae6('0x3e')](_0x0ae6('0x41'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x42')]);router['post']('/:id/queues',auth[_0x0ae6('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x0ae6('0x43')]({'destination':function(_0x4a8a5c,_0xf669e1,_0x5232be){_0x5232be(null,path[_0x0ae6('0x44')](config[_0x0ae6('0x45')],_0x0ae6('0x46')));},'filename':function(_0x2204e5,_0x5be17f,_0x4a9c75){_0x4a9c75(null,util[_0x0ae6('0x47')](_0x0ae6('0x48'),Date[_0x0ae6('0x49')](),_0x5be17f['originalname']));}})});router[_0x0ae6('0x3e')]('/:id/avatar',upload[_0x0ae6('0x4a')](_0x0ae6('0x4b')),controller[_0x0ae6('0x4c')]);router[_0x0ae6('0x3e')](_0x0ae6('0x4d'),auth[_0x0ae6('0x9')](),controller['login']);router[_0x0ae6('0x3e')](_0x0ae6('0x4e'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x4f')]);router[_0x0ae6('0x3e')](_0x0ae6('0x50'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x51')]);router['post'](_0x0ae6('0x52'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x53')]);router[_0x0ae6('0x3e')](_0x0ae6('0x2c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x54')]);router[_0x0ae6('0x3e')](_0x0ae6('0x55'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x56')]);router[_0x0ae6('0x3e')](_0x0ae6('0x57'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x58')]);router[_0x0ae6('0x3e')](_0x0ae6('0x59'),auth[_0x0ae6('0x9')](),controller['addFaxInteractions']);router[_0x0ae6('0x3e')](_0x0ae6('0x5a'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x5b')]);router[_0x0ae6('0x3e')](_0x0ae6('0x5c'),auth['isAuthenticated'](),controller[_0x0ae6('0x5d')]);router[_0x0ae6('0x3e')](_0x0ae6('0x5e'),auth[_0x0ae6('0x9')](),controller['addWhatsappInteractions']);router['post']('/:id/fax_accounts',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x5f')]);router[_0x0ae6('0x3e')]('/:id/mail_accounts',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x60')]);router['post'](_0x0ae6('0x33'),auth[_0x0ae6('0x9')](),controller['addOpenchannelAccounts']);router[_0x0ae6('0x3e')](_0x0ae6('0x35'),auth['isAuthenticated'](),controller[_0x0ae6('0x61')]);router[_0x0ae6('0x3e')](_0x0ae6('0x37'),auth['isAuthenticated'](),controller[_0x0ae6('0x62')]);router[_0x0ae6('0x3e')](_0x0ae6('0x39'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x63')]);router[_0x0ae6('0x3e')](_0x0ae6('0x3c'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x0ae6('0x64')](_0x0ae6('0x10'),auth[_0x0ae6('0x9')](),controller['update']);router[_0x0ae6('0x64')]('/:id/password',auth['isAuthenticated'](),controller[_0x0ae6('0x65')]);router[_0x0ae6('0x66')](_0x0ae6('0x18'),auth['isAuthenticated'](),controller[_0x0ae6('0x67')]);router[_0x0ae6('0x66')](_0x0ae6('0x2c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x68')]);router[_0x0ae6('0x66')](_0x0ae6('0x10'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x69')]);router[_0x0ae6('0x66')](_0x0ae6('0x55'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6a')]);router[_0x0ae6('0x66')](_0x0ae6('0x57'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x0ae6('0x66')](_0x0ae6('0x59'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6b')]);router[_0x0ae6('0x66')](_0x0ae6('0x5a'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6c')]);router[_0x0ae6('0x66')](_0x0ae6('0x5c'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6d')]);router[_0x0ae6('0x66')](_0x0ae6('0x5e'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x6e')]);router[_0x0ae6('0x66')](_0x0ae6('0x31'),auth['isAuthenticated'](),controller[_0x0ae6('0x6f')]);router[_0x0ae6('0x66')](_0x0ae6('0x32'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x70')]);router[_0x0ae6('0x66')](_0x0ae6('0x33'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x71')]);router[_0x0ae6('0x66')]('/:id/sms_accounts',auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x72')]);router[_0x0ae6('0x66')](_0x0ae6('0x37'),auth[_0x0ae6('0x9')](),controller[_0x0ae6('0x73')]);router[_0x0ae6('0x66')](_0x0ae6('0x39'),auth[_0x0ae6('0x9')](),controller['removeWhatsappAccounts']);router['delete'](_0x0ae6('0x3c'),auth[_0x0ae6('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 99e5721..c10466c 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 _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x38e2d4,_0x188242){var _0x1b7bf1=function(_0x25d5e0){while(--_0x25d5e0){_0x38e2d4['push'](_0x38e2d4['shift']());}};_0x1b7bf1(++_0x188242);}(_0x34e8,0x12c));var _0x834e=function(_0xe35c30,_0x9b19){_0xe35c30=_0xe35c30-0x0;var _0x2054b2=_0x34e8[_0xe35c30];return _0x2054b2;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x41d413,_0x670662){var _0x2d55c6=function(_0x28dc41){while(--_0x28dc41){_0x41d413['push'](_0x41d413['shift']());}};_0x2d55c6(++_0x670662);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xcb91[_0x231dda];return _0x3f88cb;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 7a4d2b7..587fd5c 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 _0x10a0=['includeAll','userSetting','true','include','UserSetting','attributes','push','User','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','model','rawAttributes','password','keys','filters','intersection','fields','merge','update','body','params','describe','addContacts','ids','internal','findById','validatePasswordPattern','max','min_internal','isNil','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','from','voicemail','mailbox','fullname','permissions','101','103','113','110','104','105','106','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','userProfileId','VoiceMail','UserProfileSection','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','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','telephone','findAll','autoAssociation','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','add','capitalize','toLowerCase','spread','Queue:save','voice','VoiceQueue','SIP/%s','penalty','removeQueues','isValidChannel','Unknown\x20channel','remove','isArray','QueueId','UserVoiceQueueRt','addAvatar','file','getAvatar','root','server/files/images/logos/default_profile.png','userpic','existsSync','server/files/images/','join','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WHATSAPP','getContacts','format','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','List','Tag','Tags','color','tag','getQueues','Queue','order','sort','where','pick','options','Queues','Unknown\x20role','nolimit','getVoiceQueuesRt','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','faxPause','smsPause','whatsappPause','lastPauseAt','getTeams','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getAssociatedQueues','Queue:remove','getLists','getAgents','getVoiceQueues','values','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','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contained','firstName','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','getUserSetting','getPresence','teams','queues','isEmpty','flatten','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','busy','slice','charAt','toUpperCase','SELECT','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','util','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/contacts','../../config/logger','api','../../config/utils','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','role','agent','emit','destroy','then','get','admin','Users','user','Agents','Telephones','filter','map','value','includes','find','name','UserProfileResource','stack','fieldName','key','salt','getOptions','query'];(function(_0x1fb119,_0x13f62f){var _0x5d85d9=function(_0x2a8c65){while(--_0x2a8c65){_0x1fb119['push'](_0x1fb119['shift']());}};_0x5d85d9(++_0x13f62f);}(_0x10a0,0x153));var _0x010a=function(_0x24201a,_0x3ed184){_0x24201a=_0x24201a-0x0;var _0x36a6b9=_0x10a0[_0x24201a];return _0x36a6b9;};'use strict';var moment=require(_0x010a('0x0'));var util=require(_0x010a('0x1'));var path=require(_0x010a('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x010a('0x3'));var jayson=require(_0x010a('0x4'));var Redis=require(_0x010a('0x5'));var authService=require(_0x010a('0x6'));var contacts=require(_0x010a('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x010a('0x8'))(_0x010a('0x9'));var utils=require(_0x010a('0xa'));var config=require(_0x010a('0xb'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x010a('0xc'))[_0x010a('0xd')];var APINotFoundError=require('../../errors/api')[_0x010a('0xe')];var APIHandleError=require('../../errors/api')[_0x010a('0xf')];var db=require(_0x010a('0x10'))['db'];var socket=require(_0x010a('0x11'))(new Redis(config[_0x010a('0x12')]));require(_0x010a('0x13'))[_0x010a('0x14')](socket);config['redis']=_[_0x010a('0x15')](config['redis'],{'host':_0x010a('0x16'),'port':0x18eb});var amiClient=jayson[_0x010a('0x17')][_0x010a('0x18')]({'port':0x232a});var values;function respondWithRpcPromise(_0x410060,_0xcbb300,_0x26aa8c,_0x1a939b){return new Promise(function(_0xc3122e,_0x380b3e){var _0x155272=_0x1a939b||amiClient;return _0x155272[_0x010a('0x19')](_0x410060,_0x26aa8c)['then'](function(_0x1c139c){logger[_0x010a('0x1a')](_0x010a('0x1b'),_0xcbb300,_0x010a('0x1c'));logger['debug'](_0x010a('0x1d'),_0xcbb300,'request\x20sent',JSON[_0x010a('0x1e')](_0x1c139c));if(_0x1c139c[_0x010a('0x1f')]){if(_0x1c139c[_0x010a('0x1f')][_0x010a('0x20')]===0x1f4){logger['error'](_0x010a('0x1b'),_0xcbb300,_0x1c139c[_0x010a('0x1f')][_0x010a('0x21')]);return _0x380b3e(_0x1c139c[_0x010a('0x1f')][_0x010a('0x21')]);}logger[_0x010a('0x1f')]('User,\x20%s,\x20%s',_0xcbb300,_0x1c139c[_0x010a('0x1f')]['message']);return _0xc3122e(_0x1c139c[_0x010a('0x1f')][_0x010a('0x21')]);}else{logger[_0x010a('0x1a')](_0x010a('0x1b'),_0xcbb300,_0x010a('0x1c'));_0xc3122e(_0x1c139c['result'][_0x010a('0x21')]);}})[_0x010a('0x22')](function(_0x6778c0){logger['error'](_0x010a('0x1b'),_0xcbb300,_0x6778c0);_0x380b3e(_0x6778c0);});});}function respondWithStatusCode(_0x8cc959,_0x2cfa13){_0x2cfa13=_0x2cfa13||0xcc;return function(_0x5b78c7){if(_0x5b78c7){return _0x8cc959[_0x010a('0x23')](_0x2cfa13);}return _0x8cc959[_0x010a('0x24')](_0x2cfa13)['end']();};}function respondWithResult(_0x44954a,_0x382953){_0x382953=_0x382953||0xc8;return function(_0x4e1230){if(_0x4e1230){return _0x44954a[_0x010a('0x24')](_0x382953)[_0x010a('0x25')](_0x4e1230);}};}function respondWithFilteredResult(_0x1f7b77,_0xd8c4eb){return function(_0x486e94){if(_0x486e94){var _0x468c9f=typeof _0xd8c4eb[_0x010a('0x26')]===_0x010a('0x27')&&typeof _0xd8c4eb[_0x010a('0x28')]==='undefined';var _0xc18adc=_0x486e94[_0x010a('0x29')];var _0x23977c=_0x468c9f?0x0:_0xd8c4eb[_0x010a('0x26')];var _0xb4530c=_0x468c9f?_0x486e94[_0x010a('0x29')]:_0xd8c4eb[_0x010a('0x26')]+_0xd8c4eb[_0x010a('0x28')];var _0x28a688;if(_0xb4530c>=_0xc18adc){_0xb4530c=_0xc18adc;_0x28a688=0xc8;}else{_0x28a688=0xce;}_0x1f7b77[_0x010a('0x24')](_0x28a688);return _0x1f7b77['set'](_0x010a('0x2a'),_0x23977c+'-'+_0xb4530c+'/'+_0xc18adc)[_0x010a('0x25')](_0x486e94);}return null;};}function saveUpdates(_0x95a81e){return function(_0x5677ec){if(_0x5677ec){return _0x5677ec['update'](_0x95a81e)['then'](function(_0x55d0c6){if(_0x55d0c6[_0x010a('0x2b')]===_0x010a('0x2c')){socket[_0x010a('0x2d')]('userNotification:recalc:'+_0x55d0c6['id'],_0x55d0c6);}return _0x55d0c6;});}return null;};}function removeEntity(_0x5899f8){return function(_0x3b4587){if(_0x3b4587){return _0x3b4587[_0x010a('0x2e')]()[_0x010a('0x2f')](function(){var _0x365dfd=_0x3b4587[_0x010a('0x30')]({'plain':!![]});if(_0x365dfd[_0x010a('0x2b')]===_0x010a('0x31'))return;var _0x91e36f=[{'name':_0x010a('0x32'),'value':_0x010a('0x33'),'ignore':!![]},{'name':_0x010a('0x34'),'value':_0x010a('0x2c'),'ignore':![]},{'name':_0x010a('0x35'),'value':'telephone','ignore':![]}];var _0x463632=_(_0x91e36f)[_0x010a('0x36')]('ignore')[_0x010a('0x37')](_0x010a('0x38'))[_0x010a('0x38')]();if(_[_0x010a('0x39')](_0x463632,_0x365dfd[_0x010a('0x2b')])){return;}var _0x18bb90=_[_0x010a('0x3a')](_0x91e36f,[_0x010a('0x38'),_0x365dfd[_0x010a('0x2b')]])[_0x010a('0x3b')];return db[_0x010a('0x3c')][_0x010a('0x2e')]({'where':{'type':_0x18bb90,'resourceId':_0x365dfd['id']}})[_0x010a('0x2f')](function(){return _0x3b4587;});})['then'](function(){_0x5899f8[_0x010a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f4ea){return function(_0x487acc){if(!_0x487acc){_0x14f4ea[_0x010a('0x23')](0x194);}return _0x487acc;};}function handleError(_0x58fb29,_0x579881){_0x579881=_0x579881||0x1f4;return function(_0x19b982){logger[_0x010a('0x1f')](_0x19b982[_0x010a('0x3d')]);if(_0x19b982[_0x010a('0x3b')]){delete _0x19b982[_0x010a('0x3b')];}_0x58fb29[_0x010a('0x24')](_0x579881)['send'](_0x19b982);};}exports['index']=function(_0x552349,_0x582751){var _0x38c1c4={},_0x5a99b6={'count':0x0,'rows':[]};var _0x30e0ed=_(db['User']['rawAttributes'])[_0x010a('0x37')](function(_0x2f7827){return{'name':_0x2f7827[_0x010a('0x3e')],'type':_0x2f7827['type'][_0x010a('0x3f')]};})['filter'](function(_0x14857a){return!_[_0x010a('0x39')](['password',_0x010a('0x40')],_0x14857a['name']);})[_0x010a('0x38')]();_0x38c1c4=qs[_0x010a('0x41')](_0x30e0ed,_0x552349);var _0x1a2ecb={'where':_0x38c1c4['where']};return db['User'][_0x010a('0x29')](_0x1a2ecb)[_0x010a('0x2f')](function(_0x43870a){_0x5a99b6[_0x010a('0x29')]=_0x43870a;if(_0x552349[_0x010a('0x42')][_0x010a('0x43')]){_0x38c1c4['include']=[{'all':!![]}];}if(_0x552349[_0x010a('0x42')][_0x010a('0x44')]===_0x010a('0x45')){_0x38c1c4[_0x010a('0x46')]=[{'model':db[_0x010a('0x47')],'as':_0x010a('0x44')}];}if(!_[_0x010a('0x39')](_0x38c1c4[_0x010a('0x48')],'id')){_0x38c1c4[_0x010a('0x48')][_0x010a('0x49')]('id');}return db[_0x010a('0x4a')]['findAll'](_0x38c1c4);})[_0x010a('0x2f')](function(_0x332d65){_0x5a99b6[_0x010a('0x4b')]=_0x332d65;if(_0x552349['query'][_0x010a('0x4c')]==='true'){var _0xb8d2ee=[];for(var _0x5d73d6=0x0;_0x5d73d6<_0x5a99b6[_0x010a('0x4b')][_0x010a('0x4d')];_0x5d73d6++){_0xb8d2ee['push'](get_open_tabs(_0x010a('0x4e'),_0x5a99b6['rows'][_0x5d73d6][_0x010a('0x4f')]));_0xb8d2ee['push'](get_open_tabs(_0x010a('0x50'),_0x5a99b6[_0x010a('0x4b')][_0x5d73d6]['dataValues']));_0xb8d2ee[_0x010a('0x49')](get_open_tabs(_0x010a('0x51'),_0x5a99b6[_0x010a('0x4b')][_0x5d73d6]['dataValues']));_0xb8d2ee[_0x010a('0x49')](get_open_tabs(_0x010a('0x52'),_0x5a99b6[_0x010a('0x4b')][_0x5d73d6][_0x010a('0x4f')]));_0xb8d2ee['push'](get_open_tabs(_0x010a('0x53'),_0x5a99b6[_0x010a('0x4b')][_0x5d73d6][_0x010a('0x4f')]));_0xb8d2ee[_0x010a('0x49')](get_open_tabs(_0x010a('0x54'),_0x5a99b6[_0x010a('0x4b')][_0x5d73d6]['dataValues']));}return Promise[_0x010a('0x55')](_0xb8d2ee)['then'](function(){return _0x5a99b6;});}else{return _0x5a99b6;}})[_0x010a('0x2f')](respondWithFilteredResult(_0x582751,_0x38c1c4))[_0x010a('0x22')](handleError(_0x582751,null));};exports[_0x010a('0x56')]=function(_0x539a53,_0x4034ba){var _0x2f6021={'raw':![],'where':{'id':_0x539a53['params']['id']}},_0x36b5a1={};_0x36b5a1[_0x010a('0x57')]=_['differenceBy'](_['keys'](db[_0x010a('0x4a')][_0x010a('0x58')]),[_0x010a('0x59'),_0x010a('0x40')]);_0x36b5a1['query']=_[_0x010a('0x5a')](_0x539a53['query']);_0x36b5a1[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x36b5a1[_0x010a('0x57')],_0x36b5a1[_0x010a('0x42')]);_0x2f6021[_0x010a('0x48')]=_['intersection'](_0x36b5a1[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x539a53[_0x010a('0x42')][_0x010a('0x5d')]));_0x2f6021[_0x010a('0x48')]=_0x2f6021[_0x010a('0x48')][_0x010a('0x4d')]?_0x2f6021[_0x010a('0x48')]:_0x36b5a1[_0x010a('0x57')];if(_0x539a53['query'][_0x010a('0x43')]){_0x2f6021[_0x010a('0x46')]=[{'all':!![]}];}if(_0x539a53[_0x010a('0x42')][_0x010a('0x44')]===_0x010a('0x45')){_0x2f6021[_0x010a('0x46')]=[{'model':db['UserSetting'],'as':_0x010a('0x44')}];}_0x2f6021=_[_0x010a('0x5e')]({},_0x2f6021,_0x539a53['options']);if(!_[_0x010a('0x39')](_0x2f6021[_0x010a('0x48')],'id')){_0x2f6021[_0x010a('0x48')][_0x010a('0x49')]('id');}return db['User'][_0x010a('0x3a')](_0x2f6021)[_0x010a('0x2f')](handleEntityNotFound(_0x4034ba,null))[_0x010a('0x2f')](function(_0x36d7a7){var _0x3868a3=[];values=_0x36d7a7;if(_0x539a53[_0x010a('0x42')][_0x010a('0x4c')]===_0x010a('0x45')){_0x3868a3[_0x010a('0x49')](get_open_tabs(_0x010a('0x4e'),_0x36d7a7[_0x010a('0x4f')]));_0x3868a3[_0x010a('0x49')](get_open_tabs(_0x010a('0x50'),_0x36d7a7['dataValues']));_0x3868a3[_0x010a('0x49')](get_open_tabs('openchannel',_0x36d7a7[_0x010a('0x4f')]));_0x3868a3[_0x010a('0x49')](get_open_tabs(_0x010a('0x54'),_0x36d7a7[_0x010a('0x4f')]));_0x3868a3[_0x010a('0x49')](get_open_tabs('fax',_0x36d7a7[_0x010a('0x4f')]));_0x3868a3[_0x010a('0x49')](get_open_tabs(_0x010a('0x52'),_0x36d7a7['dataValues']));return Promise['all'](_0x3868a3);}else{return values;}})[_0x010a('0x2f')](function(){return values;})[_0x010a('0x2f')](respondWithResult(_0x4034ba,null))[_0x010a('0x22')](handleError(_0x4034ba,null));};exports[_0x010a('0x5f')]=function(_0x4e60e2,_0x49c9b4){if(_0x4e60e2[_0x010a('0x60')]['id']){delete _0x4e60e2[_0x010a('0x60')]['id'];}delete _0x4e60e2[_0x010a('0x60')]['role'];return db[_0x010a('0x4a')]['find']({'where':{'id':_0x4e60e2[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x49c9b4,null))[_0x010a('0x2f')](saveUpdates(_0x4e60e2['body'],null))['then'](respondWithResult(_0x49c9b4,null))[_0x010a('0x22')](handleError(_0x49c9b4,null));};exports[_0x010a('0x62')]=function(_0xffb7bf,_0x437ee1){return db[_0x010a('0x4a')]['describe']()[_0x010a('0x2f')](respondWithResult(_0x437ee1,null))[_0x010a('0x22')](handleError(_0x437ee1,null));};exports[_0x010a('0x63')]=function(_0x2bf198,_0x356497){return db[_0x010a('0x4a')][_0x010a('0x3a')]({'where':{'id':_0x2bf198[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x356497,null))['then'](function(_0x1c5167){if(_0x1c5167){return _0x1c5167[_0x010a('0x63')](_0x2bf198['body'][_0x010a('0x64')],_['omit'](_0x2bf198[_0x010a('0x60')],[_0x010a('0x64'),'id'])||{});}})[_0x010a('0x2f')](respondWithResult(_0x356497,null))[_0x010a('0x22')](handleError(_0x356497,null));};function validateUser(_0x4ff9c2){return new Promise(function(_0x55571c,_0x3c1682){if(_0x4ff9c2[_0x010a('0x65')])return _0x55571c(_0x4ff9c2);return db['Setting'][_0x010a('0x66')](0x1)[_0x010a('0x2f')](function(_0x366123){if(_0x366123['securePassword'])authService[_0x010a('0x67')](_0x4ff9c2[_0x010a('0x59')]);db[_0x010a('0x4a')][_0x010a('0x68')](_0x010a('0x65'))[_0x010a('0x2f')](function(_0x47f2b2){if(_['isNil'](_0x47f2b2)){_0x4ff9c2[_0x010a('0x65')]=_0x366123[_0x010a('0x69')]||0x1;return;}if(_[_0x010a('0x6a')](_0x366123[_0x010a('0x69')])||_0x366123[_0x010a('0x69')]===_0x47f2b2){_0x4ff9c2[_0x010a('0x65')]=_0x47f2b2+0x1;return;}if(_0x366123['min_internal']>_0x47f2b2){_0x4ff9c2['internal']=_0x366123[_0x010a('0x69')];return;}return db[_0x010a('0x6b')]['query'](_0x010a('0x6c'),{'type':db[_0x010a('0x6b')][_0x010a('0x6d')]['SELECT']})[_0x010a('0x2f')](function(_0x36bb57){if(_0x36bb57&&_0x36bb57[_0x010a('0x4d')]){for(var _0x1db4cf=0x0,_0x393648=_0x36bb57['length'];_0x1db4cf<_0x393648&&_[_0x010a('0x6a')](_0x4ff9c2[_0x010a('0x65')]);_0x1db4cf++){if(_0x366123['min_internal']<=_0x36bb57[_0x1db4cf][_0x010a('0x6e')]){_0x4ff9c2[_0x010a('0x65')]=_0x36bb57[_0x1db4cf][_0x010a('0x6e')];}else if(_0x366123[_0x010a('0x69')]>_0x36bb57[_0x1db4cf][_0x010a('0x6e')]&&_0x366123[_0x010a('0x69')]<=_0x36bb57[_0x1db4cf]['to']){_0x4ff9c2[_0x010a('0x65')]=_0x366123[_0x010a('0x69')];}}}if(_[_0x010a('0x6a')](_0x4ff9c2[_0x010a('0x65')])){_0x4ff9c2[_0x010a('0x65')]=_0x47f2b2+0x1;}return _0x55571c(_0x4ff9c2);});});})[_0x010a('0x22')](function(_0x5f029a){_0x3c1682(_0x5f029a);});});}function updateUser(_0x6e49fc){return new Promise(function(_0x53f28f,_0x45e945){try{if(_0x6e49fc[_0x010a('0x6f')]){_0x6e49fc[_0x010a('0x70')]=_0x6e49fc[_0x010a('0x65')];_0x6e49fc['VoiceMail']={'mailbox':_0x6e49fc[_0x010a('0x65')],'password':_0x6e49fc['password'],'fullname':_0x6e49fc[_0x010a('0x71')],'email':_0x6e49fc['email']};}if(_0x6e49fc['role']==='agent'){if(!_0x6e49fc[_0x010a('0x72')])_0x6e49fc[_0x010a('0x72')]=[_0x010a('0x73'),'102',_0x010a('0x74'),_0x010a('0x75'),_0x010a('0x76'),_0x010a('0x77'),_0x010a('0x78'),_0x010a('0x79'),_0x010a('0x7a'),_0x010a('0x7b'),_0x010a('0x7c'),_0x010a('0x7d'),_0x010a('0x7e'),_0x010a('0x7f'),_0x010a('0x80')];}_0x53f28f(_0x6e49fc);}catch(_0x5e3370){_0x45e945(_0x5e3370);}});}exports[_0x010a('0x81')]=function(_0x593605,_0x505c06){if(_0x593605['user'][_0x010a('0x2b')]==='agent')throw new Error(_0x010a('0x82'));if(_0x593605['body'][_0x010a('0x2b')]===_0x010a('0x33')&&_0x593605[_0x010a('0x33')][_0x010a('0x2b')]!==_0x010a('0x31')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x593605['body'][_0x010a('0x2b')]==='admin'&&_0x593605[_0x010a('0x33')]['role']!==_0x010a('0x31')){throw new Error(_0x010a('0x83'));}return licenseUtil['checkUserLimits']([_0x593605[_0x010a('0x60')]])[_0x010a('0x2f')](function(){return validateUser(_0x593605[_0x010a('0x60')]);})[_0x010a('0x2f')](function(_0x49b812){return updateUser(_0x49b812)[_0x010a('0x2f')](function(_0x5dcb35){if(_0x5dcb35[_0x010a('0x2b')]===_0x010a('0x31')){_0x5dcb35['settingsEnabled']=_0x593605[_0x010a('0x33')]['settingsEnabled'];delete _0x5dcb35[_0x010a('0x84')];}return _0x5dcb35;});})[_0x010a('0x2f')](function(_0x38d67a){return db[_0x010a('0x4a')][_0x010a('0x81')](_0x38d67a,{'include':[{'model':db[_0x010a('0x85')],'as':_0x010a('0x85')}]});})[_0x010a('0x2f')](function(_0x50c56e){if(_0x593605[_0x010a('0x60')]['role']===_0x010a('0x33'))return _0x50c56e;if(_0x593605[_0x010a('0x33')][_0x010a('0x2b')]!==_0x010a('0x33'))return _0x50c56e;return db[_0x010a('0x86')][_0x010a('0x3a')]({'where':{'name':_0x50c56e[_0x010a('0x2b')]===_0x010a('0x2c')?_0x010a('0x34'):_0x010a('0x35'),'userProfileId':_0x593605['user'][_0x010a('0x84')]},'raw':!![]})[_0x010a('0x2f')](function(_0xd92c51){if(!_0xd92c51||_0xd92c51['autoAssociation']!=0x0)return _0x50c56e;return db['UserProfileResource'][_0x010a('0x81')]({'name':_0x50c56e[_0x010a('0x3b')],'resourceId':_0x50c56e['id'],'type':_0xd92c51['name'],'sectionId':_0xd92c51['id']},{})[_0x010a('0x2f')](function(){return _0x50c56e;});})['catch'](function(_0x1f9957){logger[_0x010a('0x1f')](_0x010a('0x87'),_0x1f9957);throw _0x1f9957;});})['then'](respondWithResult(_0x505c06,0xc9))[_0x010a('0x22')](handleError(_0x505c06,null));};exports[_0x010a('0x88')]=function(_0x16908d,_0x4e7345){var _0x1305f4=_0x16908d['body'];var _0x433105=[];if(_0x16908d[_0x010a('0x33')][_0x010a('0x2b')]===_0x010a('0x2c'))throw new Error(_0x010a('0x82'));if(_[_0x010a('0x89')](_0x1305f4,[_0x010a('0x2b'),_0x010a('0x33')])&&_0x16908d[_0x010a('0x33')]['role']!==_0x010a('0x31')){throw new Error(_0x010a('0x8a'));}if(_[_0x010a('0x89')](_0x1305f4,[_0x010a('0x2b'),_0x010a('0x31')])&&_0x16908d[_0x010a('0x33')][_0x010a('0x2b')]!==_0x010a('0x31')){throw new Error(_0x010a('0x8b'));}return licenseUtil[_0x010a('0x8c')](_0x1305f4)[_0x010a('0x2f')](function(){return validateUser(_0x1305f4[0x0]);})[_0x010a('0x2f')](function(){for(var _0x1ac94d=0x1;_0x1ac94d<_0x1305f4['length'];_0x1ac94d++){var _0x1252b5=_0x1305f4[_0x1ac94d-0x1][_0x010a('0x65')];if(!_0x1305f4[_0x1ac94d]['internal'])_0x1305f4[_0x1ac94d][_0x010a('0x65')]=_0x1252b5+0x1;_0x433105['push'](validateUser(_0x1305f4[_0x1ac94d]));}return Promise[_0x010a('0x55')](_0x433105);})[_0x010a('0x2f')](function(){_0x433105=[];for(var _0x1c1fda=0x0;_0x1c1fda<_0x1305f4['length'];_0x1c1fda++){_0x433105[_0x010a('0x49')](updateUser(_0x1305f4[_0x1c1fda]));}return Promise['all'](_0x433105);})[_0x010a('0x2f')](function(){_0x433105=_0x1305f4[_0x010a('0x37')](function(_0x12c94b){return db[_0x010a('0x4a')][_0x010a('0x81')](_0x12c94b,{'include':[{'model':db[_0x010a('0x85')],'as':_0x010a('0x85')}]})[_0x010a('0x2f')](function(_0x5d85ec){_0x12c94b['id']=_0x5d85ec['id'];return _0x12c94b;});});return Promise[_0x010a('0x55')](_0x433105);})[_0x010a('0x2f')](function(_0x2fec70){if(_0x16908d[_0x010a('0x60')]['role']===_0x010a('0x33'))return _0x2fec70;if(_0x16908d[_0x010a('0x33')][_0x010a('0x2b')]!=='user')return _0x2fec70;var _0x5f11ef=_[_0x010a('0x89')](_0x2fec70,function(_0x55039c){return _0x55039c['role']===_0x010a('0x2c')||_0x55039c['role']===_0x010a('0x8d');});if(!_0x5f11ef)return _0x2fec70;return db[_0x010a('0x86')][_0x010a('0x8e')]({'where':{'name':{'$or':[_0x010a('0x34'),'Telephones']},'userProfileId':_0x16908d['user'][_0x010a('0x84')]},'raw':!![]})[_0x010a('0x2f')](function(_0x1342e9){if(_['isEmpty'](_0x1342e9)||!_[_0x010a('0x89')](_0x1342e9,[_0x010a('0x8f'),0x0]))return _0x2fec70;_0x433105=[];var _0x9849f2=_(_0x1342e9)[_0x010a('0x37')](function(_0x298f88){if(_0x298f88[_0x010a('0x8f')]===0x1)return;return _0x298f88[_0x010a('0x3b')]===_0x010a('0x34')?'agent':'telephone';})[_0x010a('0x90')]()['value']();for(var _0x52c1d6=0x0;_0x52c1d6<_0x2fec70['length'];_0x52c1d6++){if(!_['includes'](_0x9849f2,_0x2fec70[_0x52c1d6][_0x010a('0x2b')]))return;var _0xa34e90=_0x2fec70[_0x52c1d6][_0x010a('0x2b')]===_0x010a('0x2c')?_0x010a('0x34'):_0x010a('0x35');_0x433105[_0x010a('0x49')](db[_0x010a('0x3c')]['create']({'name':_0x2fec70[_0x52c1d6][_0x010a('0x3b')],'resourceId':_0x2fec70[_0x52c1d6]['id'],'type':_0xa34e90,'sectionId':_[_0x010a('0x3a')](_0x1342e9,[_0x010a('0x3b'),_0xa34e90])['id']},{}));}return Promise['all'](_0x433105);});})[_0x010a('0x2f')](respondWithResult(_0x4e7345,0xc9))[_0x010a('0x22')](handleError(_0x4e7345,null));};exports[_0x010a('0x91')]=function(_0x429a72,_0x48e75f){if(_0x429a72[_0x010a('0x60')]['id']){delete _0x429a72['body']['id'];}return db['User'][_0x010a('0x3a')]({'where':{'id':_0x429a72[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](function(_0x183988){if(!_0x183988)return null;if(_0x183988['id']===_0x429a72[_0x010a('0x33')]['id']){if(!_0x429a72[_0x010a('0x60')][_0x010a('0x92')]||!_0x429a72[_0x010a('0x60')]['newPassword']){throw new db[(_0x010a('0x93'))][(_0x010a('0x94'))](_0x010a('0x95'));}if(!_0x183988[_0x010a('0x96')](_0x429a72['body'][_0x010a('0x92')])){throw new db['Sequelize'][(_0x010a('0x94'))](_0x010a('0x97'));}if(_0x429a72[_0x010a('0x60')][_0x010a('0x92')]===_0x429a72[_0x010a('0x60')][_0x010a('0x98')]){throw new db[(_0x010a('0x93'))]['ValidationError'](_0x010a('0x99'));}}else if(_0x429a72[_0x010a('0x33')][_0x010a('0x2b')]===_0x010a('0x31')){if(!_0x429a72[_0x010a('0x60')]['newPassword']){throw new db[(_0x010a('0x93'))][(_0x010a('0x94'))](_0x010a('0x9a'));}}else if(_0x429a72['user'][_0x010a('0x2b')]===_0x010a('0x33')){if(!_0x429a72[_0x010a('0x60')]['newPassword']){throw new db[(_0x010a('0x93'))][(_0x010a('0x94'))](_0x010a('0x9a'));}if(_0x183988[_0x010a('0x2b')]!==_0x010a('0x2c')){throw new db[(_0x010a('0x93'))][(_0x010a('0x94'))](_0x010a('0x82'));}}else{throw new db['Sequelize'][(_0x010a('0x94'))](_0x010a('0x82'));}return _0x183988;})['then'](handleEntityNotFound(_0x48e75f,null))['then'](function(_0x5ca8f2){return db[_0x010a('0x9b')][_0x010a('0x9c')]({'attributes':['id',_0x010a('0x9d'),_0x010a('0x9e'),_0x010a('0x9f')]})['then'](function(_0x54b2ab){if(_0x54b2ab['securePassword'])authService[_0x010a('0x67')](_0x429a72[_0x010a('0x60')]['newPassword']);if(!_0x54b2ab[_0x010a('0x9e')]||!_0x5ca8f2[_0x010a('0xa0')])return _0x5ca8f2;authService[_0x010a('0xa1')](_0x429a72[_0x010a('0x60')]['newPassword'],_0x5ca8f2[_0x010a('0xa0')],_0x54b2ab[_0x010a('0x9f')]);return _0x5ca8f2;})['then'](saveUpdates({'password':_0x429a72[_0x010a('0x60')][_0x010a('0x98')],'passwordResetAt':_0x429a72[_0x010a('0x33')]['id']==_0x429a72[_0x010a('0x61')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x429a72[_0x010a('0x60')][_0x010a('0x98')],_0x5ca8f2['previousPasswords'])},null));})[_0x010a('0x2f')](respondWithResult(_0x48e75f,null))[_0x010a('0x22')](handleError(_0x48e75f,null));};exports[_0x010a('0xa2')]=function(_0x55526c,_0x5c0a17){var _0x2d007f=_0x55526c[_0x010a('0x60')][_0x010a('0xa3')];return db['User'][_0x010a('0x3a')]({'where':{'id':_0x55526c[_0x010a('0x61')]['id']},'attributes':['id',_0x010a('0x3b'),'role',_0x010a('0xa4'),_0x010a('0xa5'),_0x010a('0xa6'),_0x010a('0xa7')]})[_0x010a('0x2f')](handleEntityNotFound(_0x5c0a17,null))['then'](function(_0x1b01c6){if(_0x1b01c6){if(!utils['isValidChannel'](_0x2d007f)){throw new db[(_0x010a('0x93'))][(_0x010a('0x94'))]('Unknown\x20channel');}return _0x1b01c6[_0x010a('0xa8')+_[_0x010a('0xa9')](_0x2d007f[_0x010a('0xaa')]())+'Queues'](_0x55526c[_0x010a('0x60')]['ids'],{'penalty':_0x55526c[_0x010a('0x60')]['penalty']||0x0})[_0x010a('0xab')](function(_0x291225){for(var _0x1ac906=0x0;_0x1ac906<_0x55526c['body']['ids'][_0x010a('0x4d')];_0x1ac906+=0x1){var _0x2104c3={'UserId':Number(_0x55526c['params']['id'])};_0x2104c3[_['capitalize'](_0x2d007f['toLowerCase']())+'QueueId']=Number(_0x55526c[_0x010a('0x60')][_0x010a('0x64')][_0x1ac906]);socket[_0x010a('0x2d')](_0x010a('0x33')+_[_0x010a('0xa9')](_0x2d007f[_0x010a('0xaa')]())+_0x010a('0xac'),_0x2104c3);}return _0x291225;})['then'](function(){if(_0x2d007f===_0x010a('0xad')){return db[_0x010a('0xae')]['findAll']({'where':{'id':_0x55526c[_0x010a('0x60')][_0x010a('0x64')]||[]},'raw':!![],'attributes':['id',_0x010a('0x3b')]});}})[_0x010a('0x2f')](function(_0x2d59fe){var _0x304005=_0x1b01c6['get']({'plain':!![]});var _0x494111=[];if(_0x2d007f==='voice'&&_0x304005[_0x010a('0x2b')]===_0x010a('0x2c')&&_0x304005[_0x010a('0xa4')]){for(let _0x50d605=0x0;_0x50d605<_0x2d59fe[_0x010a('0x4d')];_0x50d605+=0x1){_0x494111[_0x010a('0x49')]({'membername':_0x304005[_0x010a('0x3b')],'UserId':_0x304005['id'],'queue_name':_0x2d59fe[_0x50d605][_0x010a('0x3b')],'VoiceQueueId':_0x2d59fe[_0x50d605]['id'],'interface':_[_0x010a('0x6a')](_0x304005['interface'])?util['format'](_0x010a('0xaf'),_0x304005[_0x010a('0x3b')]):_0x304005[_0x010a('0xa7')],'paused':_0x304005[_0x010a('0xa6')]||![],'penalty':_0x55526c[_0x010a('0x60')][_0x010a('0xb0')]||0x0});}return Promise[_0x010a('0x55')](_0x494111[_0x010a('0x37')](function(_0xf5612d){return db['UserVoiceQueueRt']['upsert'](_0xf5612d);}));}return _0x1b01c6;});}})[_0x010a('0x2f')](respondWithStatusCode(_0x5c0a17,null))[_0x010a('0x22')](handleError(_0x5c0a17,null));};exports[_0x010a('0xb1')]=function(_0x1786ec,_0x1eb101){var _0x4da384,_0x304ba2;return db['User'][_0x010a('0x3a')]({'where':{'id':_0x1786ec[_0x010a('0x61')]['id']},'attributes':['id',_0x010a('0x3b'),'role']})[_0x010a('0x2f')](handleEntityNotFound(_0x1eb101,null))[_0x010a('0x2f')](function(_0x61cd98){if(_0x61cd98){_0x4da384=_0x61cd98;if(!_0x1786ec[_0x010a('0x42')]['channel']||!utils[_0x010a('0xb2')](_0x1786ec[_0x010a('0x42')]['channel'])){throw new db['Sequelize'][(_0x010a('0x94'))](_0x010a('0xb3'));}return _0x61cd98[_0x010a('0xb4')+_['capitalize'](_0x1786ec[_0x010a('0x42')][_0x010a('0xa3')][_0x010a('0xaa')]())+'Queues'](_0x1786ec[_0x010a('0x42')][_0x010a('0x64')]);}})[_0x010a('0x2f')](function(_0xd718d2){if(_[_0x010a('0xb5')](_0x1786ec[_0x010a('0x42')][_0x010a('0x64')])){for(var _0x2c86fb=0x0;_0x2c86fb<_0x1786ec[_0x010a('0x42')]['ids'][_0x010a('0x4d')];_0x2c86fb+=0x1){_0x304ba2={'UserId':Number(_0x1786ec['params']['id'])};_0x304ba2[_[_0x010a('0xa9')](_0x1786ec[_0x010a('0x42')][_0x010a('0xa3')]['toLowerCase']())+_0x010a('0xb6')]=Number(_0x1786ec[_0x010a('0x42')][_0x010a('0x64')][_0x2c86fb]);socket[_0x010a('0x2d')](_0x010a('0x33')+_[_0x010a('0xa9')](_0x1786ec[_0x010a('0x42')][_0x010a('0xa3')]['toLowerCase']())+'Queue:remove',_0x304ba2);}}else{_0x304ba2={'UserId':Number(_0x1786ec[_0x010a('0x61')]['id'])};_0x304ba2[_[_0x010a('0xa9')](_0x1786ec[_0x010a('0x42')][_0x010a('0xa3')][_0x010a('0xaa')]())+_0x010a('0xb6')]=Number(_0x1786ec[_0x010a('0x42')][_0x010a('0x64')]);socket[_0x010a('0x2d')](_0x010a('0x33')+_['capitalize'](_0x1786ec[_0x010a('0x42')][_0x010a('0xa3')]['toLowerCase']())+'Queue:remove',_0x304ba2);}return _0xd718d2;})['then'](function(){if(_0x1786ec[_0x010a('0x42')][_0x010a('0xa3')]===_0x010a('0xad')){return db[_0x010a('0xb7')][_0x010a('0x2e')]({'where':{'UserId':_0x1786ec['params']['id'],'VoiceQueueId':_0x1786ec[_0x010a('0x42')][_0x010a('0x64')]},'individualHooks':!![]})[_0x010a('0x2f')](function(){return _0x4da384;});}return _0x4da384;})[_0x010a('0x2f')](respondWithStatusCode(_0x1eb101,null))['catch'](handleError(_0x1eb101,null));};exports[_0x010a('0xb8')]=function(_0xf1d87e,_0x2b82df){_0xf1d87e[_0x010a('0x60')]['userpic']=_0xf1d87e[_0x010a('0xb9')]['filename'];return db['User'][_0x010a('0x3a')]({'where':{'id':_0xf1d87e[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x2b82df,null))[_0x010a('0x2f')](saveUpdates(_0xf1d87e['body'],null))[_0x010a('0x2f')](respondWithResult(_0x2b82df,null))[_0x010a('0x22')](handleError(_0x2b82df,null));};exports[_0x010a('0xba')]=function(_0x11d0b0,_0x36424b){var _0x2e94a2=path['join'](config[_0x010a('0xbb')],_0x010a('0xbc'));return db[_0x010a('0x4a')][_0x010a('0x3a')]({'where':{'id':_0x11d0b0[_0x010a('0x61')]['id']},'attributes':['id',_0x010a('0xbd')],'raw':!![]})['then'](handleEntityNotFound(_0x36424b,null))[_0x010a('0x2f')](function(_0x1231a7){if(_0x1231a7){if(_[_0x010a('0x6a')](_0x1231a7['userpic'])){return _0x36424b['download'](_0x2e94a2);}else{if(!fs[_0x010a('0xbe')](path['join'](config[_0x010a('0xbb')],_0x010a('0xbf'),_0x1231a7['userpic']))){return _0x36424b['download'](_0x2e94a2);}return _0x36424b['download'](path[_0x010a('0xc0')](config[_0x010a('0xbb')],_0x010a('0xbf'),_0x1231a7['userpic']));}}})[_0x010a('0x22')](handleError(_0x36424b,null));};exports[_0x010a('0xc1')]=function(_0x5a7a75,_0x399a87){return db[_0x010a('0x4a')][_0x010a('0x3a')]({'where':{'id':_0x5a7a75[_0x010a('0x61')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x399a87,null))[_0x010a('0x2f')](function(_0x2a70fa){var _0x2a1434=[];values=_0x2a70fa[_0x010a('0x4f')];_0x2a1434[_0x010a('0x49')](get_open_tabs(_0x010a('0x4e'),_0x2a70fa[_0x010a('0x4f')]));_0x2a1434[_0x010a('0x49')](get_open_tabs(_0x010a('0x50'),_0x2a70fa[_0x010a('0x4f')]));_0x2a1434[_0x010a('0x49')](get_open_tabs(_0x010a('0x53'),_0x2a70fa['dataValues']));_0x2a1434[_0x010a('0x49')](get_open_tabs(_0x010a('0x54'),_0x2a70fa[_0x010a('0x4f')]));_0x2a1434['push'](get_open_tabs('fax',_0x2a70fa[_0x010a('0x4f')]));_0x2a1434[_0x010a('0x49')](get_open_tabs(_0x010a('0x52'),_0x2a70fa[_0x010a('0x4f')]));return Promise[_0x010a('0x55')](_0x2a1434);})[_0x010a('0x2f')](function(_0x2b9ea2){if(_0x2b9ea2){var _0x3c1755=_['map'](values[_0x010a('0xc2')],function(_0x49f469){return{'channel':_0x010a('0xc3'),'id':_0x49f469['id'],'createdAt':_0x49f469['createdAt']};});var _0x4bb627=_[_0x010a('0x37')](values[_0x010a('0xc4')],function(_0x1e5154){return{'channel':_0x010a('0xc5'),'id':_0x1e5154['id'],'createdAt':_0x1e5154[_0x010a('0xc6')]};});var _0x3ca896=_[_0x010a('0x37')](values[_0x010a('0xc7')],function(_0x59733e){return{'channel':'OPENCHANNEL','id':_0x59733e['id'],'createdAt':_0x59733e[_0x010a('0xc6')]};});var _0x57518f=_[_0x010a('0x37')](values[_0x010a('0xc8')],function(_0x44cf9d){return{'channel':_0x010a('0xc9'),'id':_0x44cf9d['id'],'createdAt':_0x44cf9d['createdAt']};});var _0x383629=_['map'](values[_0x010a('0xca')],function(_0x2c34c7){return{'channel':_0x010a('0xcb'),'id':_0x2c34c7['id'],'createdAt':_0x2c34c7[_0x010a('0xc6')]};});var _0x47f1b7=_[_0x010a('0x37')](values['WhatsappOpenTabs'],function(_0x13c32c){return{'channel':_0x010a('0xcc'),'id':_0x13c32c['id'],'createdAt':_0x13c32c[_0x010a('0xc6')]};});var _0x5dc4dc=_['concat'](_0x3c1755,_0x4bb627,_0x3ca896,_0x57518f,_0x383629,_0x47f1b7);var _0x27c99f={'count':_0x5dc4dc['length'],'rows':_0x5dc4dc};return _0x27c99f;}else return null;})[_0x010a('0x2f')](respondWithResult(_0x399a87,null))[_0x010a('0x22')](handleError(_0x399a87,null));};exports[_0x010a('0xcd')]=function(_0x100ae5,_0x305a0e){var _0x34cdc4={};return db['User'][_0x010a('0x9c')]({'where':{'id':_0x100ae5['params']['id']}})[_0x010a('0x2f')](function(_0xd31c56){if(!_0xd31c56){throw new APINotFoundError(util[_0x010a('0xce')](_0x010a('0xcf'),_0x100ae5[_0x010a('0x61')]['id']));}return contacts[_0x010a('0x62')]();})['then'](function(_0x12eb73){_0x100ae5[_0x010a('0x42')][_0x010a('0x4a')]=_0x100ae5[_0x010a('0x61')]['id'];_0x34cdc4=qs[_0x010a('0x41')](_0x12eb73,_0x100ae5);if(_0x100ae5[_0x010a('0x42')][_0x010a('0xd0')](_0x010a('0x43'))){_0x34cdc4[_0x010a('0x46')]=[{'model':db['CmList'],'as':_0x010a('0xd1'),'required':![]},{'model':db[_0x010a('0xd2')],'as':_0x010a('0xd3'),'attributes':['id',_0x010a('0x3b'),_0x010a('0xd4')],'where':_0x100ae5[_0x010a('0x42')][_0x010a('0xd5')]?{'id':_0x100ae5['query'][_0x010a('0xd5')]}:undefined,'required':_0x100ae5[_0x010a('0x42')][_0x010a('0xd5')]?!![]:![]}];}return contacts[_0x010a('0x8e')](_0x100ae5[_0x010a('0x42')],_0x100ae5[_0x010a('0x33')],_0x34cdc4,_0x12eb73);})['then'](respondWithFilteredResult(_0x305a0e,_0x34cdc4))['catch'](APIHandleError(_0x305a0e));};exports[_0x010a('0xd6')]=function(_0x156856,_0x43a714){var _0x5d424d;var _0x3b0110={};var _0x4ddfa9;return db['User'][_0x010a('0x9c')]({'where':{'id':_0x156856[_0x010a('0x61')]['id']},'attributes':['id',_0x010a('0x3b'),_0x010a('0x2b')]})['then'](handleEntityNotFound(_0x43a714,null))[_0x010a('0x2f')](function(_0x421a48){if(!utils[_0x010a('0xb2')](_0x156856[_0x010a('0x42')][_0x010a('0xa3')])){throw new db[(_0x010a('0x93'))]['ValidationError'](_0x010a('0xb3'));}_0x5d424d=_0x421a48;var _0x1e7f91={};_0x1e7f91['model']=_['keys'](db[_['capitalize'](_0x156856[_0x010a('0x42')]['channel'])+_0x010a('0xd7')][_0x010a('0x58')]);_0x1e7f91[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x156856[_0x010a('0x42')]);_0x1e7f91[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x1e7f91[_0x010a('0x57')],_0x1e7f91[_0x010a('0x42')]);_0x3b0110[_0x010a('0x48')]=_['intersection'](_0x1e7f91['model'],qs[_0x010a('0x5d')](_0x156856[_0x010a('0x42')][_0x010a('0x5d')]));_0x3b0110[_0x010a('0x48')]=_0x3b0110[_0x010a('0x48')][_0x010a('0x4d')]?_0x3b0110[_0x010a('0x48')]:_0x1e7f91[_0x010a('0x57')];_0x3b0110[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x156856[_0x010a('0x42')][_0x010a('0xd9')]);_0x3b0110[_0x010a('0xda')]=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0x156856[_0x010a('0x42')],_0x1e7f91[_0x010a('0x5b')]));if(_0x156856[_0x010a('0x42')][_0x010a('0x36')]){_0x3b0110[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x3b0110['where'],{'$or':_['map'](_0x3b0110[_0x010a('0x48')],function(_0x2494fa){var _0x3bbbe6={};_0x3bbbe6[_0x2494fa]={'$like':'%'+_0x156856[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x3bbbe6;})});}_0x3b0110=_[_0x010a('0x5e')]({},_0x3b0110,_0x156856[_0x010a('0xdc')]);switch(_0x5d424d['role']){case _0x010a('0x31'):return db[_[_0x010a('0xa9')](_0x156856[_0x010a('0x42')]['channel'])+_0x010a('0xd7')][_0x010a('0x8e')](_0x3b0110);case _0x010a('0x33'):case _0x010a('0x2c'):return _0x5d424d[_0x010a('0x30')+_[_0x010a('0xa9')](_0x156856[_0x010a('0x42')]['channel'])+_0x010a('0xdd')](_0x3b0110);default:throw new db[(_0x010a('0x93'))][(_0x010a('0x94'))](_0x010a('0xde'));}})[_0x010a('0x2f')](function(_0x4e215e){_0x4ddfa9=_0x4e215e[_0x010a('0x4d')];if(!_0x156856[_0x010a('0x42')][_0x010a('0xd0')](_0x010a('0xdf'))){_0x3b0110[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x156856['query']['limit']);_0x3b0110['offset']=qs[_0x010a('0x26')](_0x156856[_0x010a('0x42')][_0x010a('0x26')]);}switch(_0x5d424d[_0x010a('0x2b')]){case _0x010a('0x31'):return db[_[_0x010a('0xa9')](_0x156856[_0x010a('0x42')]['channel'])+_0x010a('0xd7')][_0x010a('0x8e')](_0x3b0110);case'user':case'agent':return _0x5d424d[_0x010a('0x30')+_[_0x010a('0xa9')](_0x156856[_0x010a('0x42')][_0x010a('0xa3')])+_0x010a('0xdd')](_0x3b0110);}})['then'](function(_0x3bc579){return{'count':_0x4ddfa9,'rows':_0x3bc579};})[_0x010a('0x2f')](respondWithResult(_0x43a714,null))[_0x010a('0x22')](handleError(_0x43a714,null));};exports[_0x010a('0xe0')]=function(_0x23525b,_0x297cc6){var _0x78e7ee={};var _0xf26577={};var _0x3e1b62;var _0x27fddb;return db['User'][_0x010a('0x9c')]({'where':{'id':_0x23525b[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x297cc6,null))[_0x010a('0x2f')](function(_0x1c5951){if(_0x1c5951){_0x3e1b62=_0x1c5951;_0xf26577[_0x010a('0x57')]=_[_0x010a('0x5a')](db[_0x010a('0xb7')][_0x010a('0x58')]);_0xf26577[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x23525b['query']);_0xf26577[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0xf26577['model'],_0xf26577['query']);_0x78e7ee[_0x010a('0x48')]=_[_0x010a('0x5c')](_0xf26577[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x23525b[_0x010a('0x42')][_0x010a('0x5d')]));_0x78e7ee[_0x010a('0x48')]=_0x78e7ee['attributes'][_0x010a('0x4d')]?_0x78e7ee[_0x010a('0x48')]:_0xf26577[_0x010a('0x57')];_0x78e7ee[_0x010a('0xd8')]=qs['sort'](_0x23525b[_0x010a('0x42')][_0x010a('0xd9')]);_0x78e7ee[_0x010a('0xda')]=qs[_0x010a('0x5b')](_['pick'](_0x23525b['query'],_0xf26577[_0x010a('0x5b')]));if(_0x23525b[_0x010a('0x42')]['filter']){_0x78e7ee[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x78e7ee['where'],{'$or':_['map'](_0x78e7ee[_0x010a('0x48')],function(_0x51cf16){var _0x192fca={};_0x192fca[_0x51cf16]={'$like':'%'+_0x23525b[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x192fca;})});}_0x78e7ee=_['merge']({},_0x78e7ee,_0x23525b[_0x010a('0xdc')]);return _0x3e1b62[_0x010a('0xe0')](_0x78e7ee);}})[_0x010a('0x2f')](function(_0x2da78d){if(_0x2da78d){_0x27fddb=_0x2da78d['length'];if(!_0x23525b['query'][_0x010a('0xd0')](_0x010a('0xdf'))){_0x78e7ee[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x23525b['query']['limit']);_0x78e7ee['offset']=qs[_0x010a('0x26')](_0x23525b[_0x010a('0x42')][_0x010a('0x26')]);}return _0x3e1b62[_0x010a('0xe0')](_0x78e7ee);}})['then'](function(_0x321a49){if(_0x321a49){return _0x321a49?{'count':_0x27fddb,'rows':_0x321a49}:null;}})[_0x010a('0x2f')](respondWithResult(_0x297cc6,null))[_0x010a('0x22')](handleError(_0x297cc6,null));};exports['getGroups']=function(_0xe26540,_0x511035){var _0x5b5699={};var _0x48da4a={};var _0x3883d3;var _0x2e81ea;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0xe26540['params']['id']}})['then'](handleEntityNotFound(_0x511035,null))['then'](function(_0x65a4da){if(_0x65a4da){_0x3883d3=_0x65a4da;_0x48da4a['model']=_[_0x010a('0x5a')](db['ChatGroup'][_0x010a('0x58')]);_0x48da4a[_0x010a('0x42')]=_[_0x010a('0x5a')](_0xe26540[_0x010a('0x42')]);_0x48da4a[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x48da4a['model'],_0x48da4a['query']);_0x5b5699[_0x010a('0x48')]=_[_0x010a('0x5c')](_0x48da4a[_0x010a('0x57')],qs[_0x010a('0x5d')](_0xe26540['query'][_0x010a('0x5d')]));_0x5b5699[_0x010a('0x48')]=_0x5b5699['attributes']['length']?_0x5b5699[_0x010a('0x48')]:_0x48da4a[_0x010a('0x57')];_0x5b5699[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0xe26540[_0x010a('0x42')][_0x010a('0xd9')]);_0x5b5699[_0x010a('0xda')]=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0xe26540[_0x010a('0x42')],_0x48da4a[_0x010a('0x5b')]));if(_0xe26540['query'][_0x010a('0x36')]){_0x5b5699[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x5b5699['where'],{'$or':_[_0x010a('0x37')](_0x5b5699[_0x010a('0x48')],function(_0x45e0cc){var _0x564f2e={};_0x564f2e[_0x45e0cc]={'$like':'%'+_0xe26540['query'][_0x010a('0x36')]+'%'};return _0x564f2e;})});}_0x5b5699=_[_0x010a('0x5e')]({},_0x5b5699,_0xe26540['options']);return _0x3883d3['getGroups'](_0x5b5699);}})['then'](function(_0x1c6aff){if(_0x1c6aff){_0x2e81ea=_0x1c6aff[_0x010a('0x4d')];if(!_0xe26540[_0x010a('0x42')]['hasOwnProperty']('nolimit')){_0x5b5699[_0x010a('0x28')]=qs[_0x010a('0x28')](_0xe26540['query']['limit']);_0x5b5699[_0x010a('0x26')]=qs[_0x010a('0x26')](_0xe26540[_0x010a('0x42')]['offset']);}return _0x3883d3['getGroups'](_0x5b5699);}})[_0x010a('0x2f')](function(_0x2ede0e){if(_0x2ede0e){return _0x2ede0e?{'count':_0x2e81ea,'rows':_0x2ede0e}:null;}})[_0x010a('0x2f')](respondWithResult(_0x511035,null))[_0x010a('0x22')](handleError(_0x511035,null));};exports[_0x010a('0xe1')]=function(_0x18cf32,_0x2248b2){var _0x5391a8={'raw':!![],'where':{}};var _0x357c14={};var _0x2d8613={'count':0x0,'rows':[]};return db['User'][_0x010a('0x9c')]({'where':{'id':_0x18cf32['params']['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x2248b2,null))[_0x010a('0x2f')](function(_0xa57436){if(_0xa57436){_0x357c14[_0x010a('0x57')]=_['keys'](db[_0x010a('0xe2')][_0x010a('0x58')]);_0x357c14[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x18cf32[_0x010a('0x42')]);_0x357c14['filters']=_['intersection'](_0x357c14[_0x010a('0x57')],_0x357c14[_0x010a('0x42')]);_0x5391a8[_0x010a('0x48')]=_[_0x010a('0x5c')](_0x357c14['model'],qs['fields'](_0x18cf32['query'][_0x010a('0x5d')]));_0x5391a8[_0x010a('0x48')]=_0x5391a8[_0x010a('0x48')][_0x010a('0x4d')]?_0x5391a8['attributes']:_0x357c14[_0x010a('0x57')];if(!_0x18cf32[_0x010a('0x42')][_0x010a('0xd0')]('nolimit')){_0x5391a8[_0x010a('0x28')]=qs['limit'](_0x18cf32[_0x010a('0x42')]['limit']);_0x5391a8['offset']=qs[_0x010a('0x26')](_0x18cf32[_0x010a('0x42')][_0x010a('0x26')]);}_0x5391a8[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x18cf32['query'][_0x010a('0xd9')]);_0x5391a8[_0x010a('0xda')]=qs['filters'](_[_0x010a('0xdb')](_0x18cf32[_0x010a('0x42')],_0x357c14[_0x010a('0x5b')]));_0x5391a8[_0x010a('0xda')][_0x010a('0xe3')]=_0xa57436['id'];if(_0x18cf32[_0x010a('0x42')][_0x010a('0x36')]){_0x5391a8['where']=_[_0x010a('0x5e')](_0x5391a8[_0x010a('0xda')],{'$or':_[_0x010a('0x37')](_0x5391a8[_0x010a('0x48')],function(_0x266999){var _0x4b6421={};_0x4b6421[_0x266999]={'$like':'%'+_0x18cf32['query'][_0x010a('0x36')]+'%'};return _0x4b6421;})});}_0x5391a8=_['merge']({},_0x5391a8,_0x18cf32[_0x010a('0xdc')]);return db[_0x010a('0xe2')][_0x010a('0x29')]({'where':_0x5391a8[_0x010a('0xda')]})['then'](function(_0x5034ef){_0x2d8613[_0x010a('0x29')]=_0x5034ef;if(_0x18cf32['query'][_0x010a('0x43')]){_0x5391a8['include']=[{'all':!![]}];}return db[_0x010a('0xe2')][_0x010a('0x8e')](_0x5391a8);})[_0x010a('0x2f')](function(_0xcf9fdb){_0x2d8613[_0x010a('0x4b')]=_0xcf9fdb;return _0x2d8613;});}})[_0x010a('0x2f')](respondWithFilteredResult(_0x2248b2,_0x5391a8))[_0x010a('0x22')](handleError(_0x2248b2,null));};exports[_0x010a('0xe4')]=function(_0x531867,_0xc09fa3){var _0x44bc1d={'raw':!![],'where':{}};var _0x1cc51c={};var _0x486a40={'count':0x0,'rows':[]};return db[_0x010a('0x4a')]['findOne']({'where':{'id':_0x531867[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0xc09fa3,null))['then'](function(_0x1bffd6){if(_0x1bffd6){_0x1cc51c['model']=_['keys'](db[_0x010a('0xe5')]['rawAttributes']);_0x1cc51c[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x531867['query']);_0x1cc51c[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x1cc51c[_0x010a('0x57')],_0x1cc51c[_0x010a('0x42')]);_0x44bc1d[_0x010a('0x48')]=_[_0x010a('0x5c')](_0x1cc51c[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x531867['query']['fields']));_0x44bc1d[_0x010a('0x48')]=_0x44bc1d[_0x010a('0x48')][_0x010a('0x4d')]?_0x44bc1d[_0x010a('0x48')]:_0x1cc51c[_0x010a('0x57')];if(!_0x531867[_0x010a('0x42')][_0x010a('0xd0')](_0x010a('0xdf'))){_0x44bc1d[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x531867['query'][_0x010a('0x28')]);_0x44bc1d[_0x010a('0x26')]=qs[_0x010a('0x26')](_0x531867['query'][_0x010a('0x26')]);}_0x44bc1d[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x531867['query']['sort']);_0x44bc1d[_0x010a('0xda')]=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0x531867[_0x010a('0x42')],_0x1cc51c[_0x010a('0x5b')]));_0x44bc1d['where'][_0x010a('0xe3')]=_0x1bffd6['id'];if(_0x531867[_0x010a('0x42')][_0x010a('0x36')]){_0x44bc1d[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x44bc1d['where'],{'$or':_['map'](_0x44bc1d['attributes'],function(_0x410f77){var _0x371c61={};_0x371c61[_0x410f77]={'$like':'%'+_0x531867[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x371c61;})});}_0x44bc1d=_[_0x010a('0x5e')]({},_0x44bc1d,_0x531867[_0x010a('0xdc')]);return db[_0x010a('0xe5')][_0x010a('0x29')]({'where':_0x44bc1d[_0x010a('0xda')]})[_0x010a('0x2f')](function(_0x5f1744){_0x486a40[_0x010a('0x29')]=_0x5f1744;if(_0x531867[_0x010a('0x42')][_0x010a('0x43')]){_0x44bc1d[_0x010a('0x46')]=[{'all':!![]}];}return db[_0x010a('0xe5')][_0x010a('0x8e')](_0x44bc1d);})[_0x010a('0x2f')](function(_0x21ee0e){_0x486a40[_0x010a('0x4b')]=_0x21ee0e;return _0x486a40;});}})[_0x010a('0x2f')](respondWithFilteredResult(_0xc09fa3,_0x44bc1d))[_0x010a('0x22')](handleError(_0xc09fa3,null));};exports['getChatInteractions']=function(_0x11d32f,_0x753539){var _0xb23954={};var _0x478e1f={};var _0x8bf5d8;var _0x146f55;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x11d32f['params']['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x753539,null))[_0x010a('0x2f')](function(_0x260d93){if(_0x260d93){_0x8bf5d8=_0x260d93;_0x478e1f[_0x010a('0x57')]=_['keys'](db['ChatInteraction'][_0x010a('0x58')]);_0x478e1f[_0x010a('0x42')]=_['keys'](_0x11d32f[_0x010a('0x42')]);_0x478e1f['filters']=_[_0x010a('0x5c')](_0x478e1f[_0x010a('0x57')],_0x478e1f['query']);_0xb23954[_0x010a('0x48')]=_['intersection'](_0x478e1f['model'],qs[_0x010a('0x5d')](_0x11d32f[_0x010a('0x42')][_0x010a('0x5d')]));_0xb23954[_0x010a('0x48')]=_0xb23954[_0x010a('0x48')]['length']?_0xb23954[_0x010a('0x48')]:_0x478e1f[_0x010a('0x57')];_0xb23954[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x11d32f[_0x010a('0x42')][_0x010a('0xd9')]);_0xb23954['where']=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0x11d32f[_0x010a('0x42')],_0x478e1f[_0x010a('0x5b')]));if(_0x11d32f['query'][_0x010a('0x36')]){_0xb23954[_0x010a('0xda')]=_[_0x010a('0x5e')](_0xb23954[_0x010a('0xda')],{'$or':_[_0x010a('0x37')](_0xb23954[_0x010a('0x48')],function(_0x5f1752){var _0x237d0b={};_0x237d0b[_0x5f1752]={'$like':'%'+_0x11d32f[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x237d0b;})});}_0xb23954=_[_0x010a('0x5e')]({},_0xb23954,_0x11d32f[_0x010a('0xdc')]);return _0x8bf5d8[_0x010a('0xe6')](_0xb23954);}})[_0x010a('0x2f')](function(_0x58216f){if(_0x58216f){_0x146f55=_0x58216f[_0x010a('0x4d')];if(!_0x11d32f[_0x010a('0x42')][_0x010a('0xd0')](_0x010a('0xdf'))){_0xb23954[_0x010a('0x28')]=qs['limit'](_0x11d32f[_0x010a('0x42')][_0x010a('0x28')]);_0xb23954[_0x010a('0x26')]=qs['offset'](_0x11d32f[_0x010a('0x42')][_0x010a('0x26')]);}return _0x8bf5d8[_0x010a('0xe6')](_0xb23954);}})[_0x010a('0x2f')](function(_0x4ec79c){if(_0x4ec79c){return _0x4ec79c?{'count':_0x146f55,'rows':_0x4ec79c}:null;}})['then'](respondWithResult(_0x753539,null))[_0x010a('0x22')](handleError(_0x753539,null));};exports['getOpenchannelInteractions']=function(_0x2c0bca,_0x12b626){var _0x173053={};var _0x25a309={};var _0x2f3314;var _0x1b6c0b;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x2c0bca['params']['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x12b626,null))[_0x010a('0x2f')](function(_0x240bc2){if(_0x240bc2){_0x2f3314=_0x240bc2;_0x25a309[_0x010a('0x57')]=_['keys'](db[_0x010a('0xe7')][_0x010a('0x58')]);_0x25a309[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x2c0bca[_0x010a('0x42')]);_0x25a309[_0x010a('0x5b')]=_['intersection'](_0x25a309[_0x010a('0x57')],_0x25a309[_0x010a('0x42')]);_0x173053[_0x010a('0x48')]=_['intersection'](_0x25a309['model'],qs[_0x010a('0x5d')](_0x2c0bca[_0x010a('0x42')][_0x010a('0x5d')]));_0x173053['attributes']=_0x173053[_0x010a('0x48')][_0x010a('0x4d')]?_0x173053['attributes']:_0x25a309['model'];_0x173053[_0x010a('0xd8')]=qs['sort'](_0x2c0bca[_0x010a('0x42')][_0x010a('0xd9')]);_0x173053[_0x010a('0xda')]=qs['filters'](_[_0x010a('0xdb')](_0x2c0bca[_0x010a('0x42')],_0x25a309['filters']));if(_0x2c0bca[_0x010a('0x42')][_0x010a('0x36')]){_0x173053['where']=_[_0x010a('0x5e')](_0x173053['where'],{'$or':_['map'](_0x173053[_0x010a('0x48')],function(_0x52cf10){var _0xf1615c={};_0xf1615c[_0x52cf10]={'$like':'%'+_0x2c0bca['query'][_0x010a('0x36')]+'%'};return _0xf1615c;})});}_0x173053=_[_0x010a('0x5e')]({},_0x173053,_0x2c0bca[_0x010a('0xdc')]);return _0x2f3314[_0x010a('0xe8')](_0x173053);}})[_0x010a('0x2f')](function(_0x4a6fb2){if(_0x4a6fb2){_0x1b6c0b=_0x4a6fb2[_0x010a('0x4d')];if(!_0x2c0bca[_0x010a('0x42')]['hasOwnProperty']('nolimit')){_0x173053[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x2c0bca[_0x010a('0x42')]['limit']);_0x173053['offset']=qs['offset'](_0x2c0bca[_0x010a('0x42')][_0x010a('0x26')]);}return _0x2f3314[_0x010a('0xe8')](_0x173053);}})['then'](function(_0x31dbbb){if(_0x31dbbb){return _0x31dbbb?{'count':_0x1b6c0b,'rows':_0x31dbbb}:null;}})['then'](respondWithResult(_0x12b626,null))[_0x010a('0x22')](handleError(_0x12b626,null));};exports['getMailInteractions']=function(_0x517417,_0xc8b477){var _0x1f5016={'raw':!![],'where':{}};var _0x51501a={};var _0x304002={'count':0x0,'rows':[]};return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x517417[_0x010a('0x61')]['id']}})['then'](handleEntityNotFound(_0xc8b477,null))[_0x010a('0x2f')](function(_0x164ecd){if(_0x164ecd){_0x51501a[_0x010a('0x57')]=_[_0x010a('0x5a')](db[_0x010a('0xe9')][_0x010a('0x58')]);_0x51501a[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x517417['query']);_0x51501a[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x51501a[_0x010a('0x57')],_0x51501a[_0x010a('0x42')]);_0x1f5016[_0x010a('0x48')]=_[_0x010a('0x5c')](_0x51501a['model'],qs[_0x010a('0x5d')](_0x517417[_0x010a('0x42')][_0x010a('0x5d')]));_0x1f5016[_0x010a('0x48')]=_0x1f5016[_0x010a('0x48')][_0x010a('0x4d')]?_0x1f5016[_0x010a('0x48')]:_0x51501a[_0x010a('0x57')];if(!_0x517417[_0x010a('0x42')][_0x010a('0xd0')](_0x010a('0xdf'))){_0x1f5016['limit']=qs[_0x010a('0x28')](_0x517417[_0x010a('0x42')]['limit']);_0x1f5016['offset']=qs[_0x010a('0x26')](_0x517417['query'][_0x010a('0x26')]);}_0x1f5016[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x517417[_0x010a('0x42')][_0x010a('0xd9')]);_0x1f5016['where']=qs['filters'](_['pick'](_0x517417[_0x010a('0x42')],_0x51501a[_0x010a('0x5b')]));_0x1f5016['where'][_0x010a('0xe3')]=_0x164ecd['id'];if(_0x517417[_0x010a('0x42')]['filter']){_0x1f5016[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x1f5016[_0x010a('0xda')],{'$or':_[_0x010a('0x37')](_0x1f5016[_0x010a('0x48')],function(_0x8477cb){var _0xfa0aa1={};_0xfa0aa1[_0x8477cb]={'$like':'%'+_0x517417['query']['filter']+'%'};return _0xfa0aa1;})});}_0x1f5016=_[_0x010a('0x5e')]({},_0x1f5016,_0x517417[_0x010a('0xdc')]);return db['MailInteraction'][_0x010a('0x29')]({'where':_0x1f5016[_0x010a('0xda')]})['then'](function(_0x5c4c22){_0x304002[_0x010a('0x29')]=_0x5c4c22;if(_0x517417['query']['includeAll']){_0x1f5016[_0x010a('0x46')]=[{'all':!![]}];}return db[_0x010a('0xe9')]['findAll'](_0x1f5016);})[_0x010a('0x2f')](function(_0x506fd3){_0x304002[_0x010a('0x4b')]=_0x506fd3;return _0x304002;});}})[_0x010a('0x2f')](respondWithFilteredResult(_0xc8b477,_0x1f5016))['catch'](handleError(_0xc8b477,null));};exports[_0x010a('0xea')]=function(_0x21a362,_0x38c8f0){var _0x28b134={};var _0x2bcf5e={};var _0xade896;var _0x4f90bf;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x21a362['params']['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x38c8f0,null))[_0x010a('0x2f')](function(_0x4d995d){if(_0x4d995d){_0xade896=_0x4d995d;_0x2bcf5e[_0x010a('0x57')]=_[_0x010a('0x5a')](db[_0x010a('0xeb')][_0x010a('0x58')]);_0x2bcf5e[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x21a362[_0x010a('0x42')]);_0x2bcf5e['filters']=_[_0x010a('0x5c')](_0x2bcf5e[_0x010a('0x57')],_0x2bcf5e[_0x010a('0x42')]);_0x28b134[_0x010a('0x48')]=_[_0x010a('0x5c')](_0x2bcf5e[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x21a362[_0x010a('0x42')]['fields']));_0x28b134['attributes']=_0x28b134[_0x010a('0x48')][_0x010a('0x4d')]?_0x28b134['attributes']:_0x2bcf5e['model'];_0x28b134[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x21a362[_0x010a('0x42')][_0x010a('0xd9')]);_0x28b134[_0x010a('0xda')]=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0x21a362[_0x010a('0x42')],_0x2bcf5e[_0x010a('0x5b')]));if(_0x21a362[_0x010a('0x42')][_0x010a('0x36')]){_0x28b134[_0x010a('0xda')]=_['merge'](_0x28b134[_0x010a('0xda')],{'$or':_[_0x010a('0x37')](_0x28b134['attributes'],function(_0x545142){var _0x525067={};_0x525067[_0x545142]={'$like':'%'+_0x21a362[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x525067;})});}_0x28b134=_[_0x010a('0x5e')]({},_0x28b134,_0x21a362[_0x010a('0xdc')]);return _0xade896['getSmsInteractions'](_0x28b134);}})[_0x010a('0x2f')](function(_0xa31c5e){if(_0xa31c5e){_0x4f90bf=_0xa31c5e['length'];if(!_0x21a362['query']['hasOwnProperty'](_0x010a('0xdf'))){_0x28b134[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x21a362[_0x010a('0x42')][_0x010a('0x28')]);_0x28b134[_0x010a('0x26')]=qs[_0x010a('0x26')](_0x21a362[_0x010a('0x42')]['offset']);}return _0xade896[_0x010a('0xea')](_0x28b134);}})[_0x010a('0x2f')](function(_0x18d856){if(_0x18d856){return _0x18d856?{'count':_0x4f90bf,'rows':_0x18d856}:null;}})[_0x010a('0x2f')](respondWithResult(_0x38c8f0,null))['catch'](handleError(_0x38c8f0,null));};exports[_0x010a('0xec')]=function(_0x2eac22,_0x5924fe){var _0x5743ba={};var _0x343dfe={};var _0x44a5b5;var _0x146d13;return db['User']['findOne']({'where':{'id':_0x2eac22[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x5924fe,null))[_0x010a('0x2f')](function(_0x4c781c){if(_0x4c781c){_0x44a5b5=_0x4c781c;_0x343dfe[_0x010a('0x57')]=_['keys'](db[_0x010a('0xed')][_0x010a('0x58')]);_0x343dfe[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x2eac22[_0x010a('0x42')]);_0x343dfe[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x343dfe[_0x010a('0x57')],_0x343dfe['query']);_0x5743ba[_0x010a('0x48')]=_['intersection'](_0x343dfe[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x2eac22[_0x010a('0x42')][_0x010a('0x5d')]));_0x5743ba[_0x010a('0x48')]=_0x5743ba[_0x010a('0x48')][_0x010a('0x4d')]?_0x5743ba[_0x010a('0x48')]:_0x343dfe[_0x010a('0x57')];_0x5743ba['order']=qs[_0x010a('0xd9')](_0x2eac22['query'][_0x010a('0xd9')]);_0x5743ba['where']=qs['filters'](_['pick'](_0x2eac22[_0x010a('0x42')],_0x343dfe['filters']));if(_0x2eac22[_0x010a('0x42')][_0x010a('0x36')]){_0x5743ba[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x5743ba[_0x010a('0xda')],{'$or':_['map'](_0x5743ba[_0x010a('0x48')],function(_0x3cce5a){var _0x1cf8ea={};_0x1cf8ea[_0x3cce5a]={'$like':'%'+_0x2eac22[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x1cf8ea;})});}_0x5743ba=_[_0x010a('0x5e')]({},_0x5743ba,_0x2eac22[_0x010a('0xdc')]);return _0x44a5b5[_0x010a('0xec')](_0x5743ba);}})['then'](function(_0x3be8a2){if(_0x3be8a2){_0x146d13=_0x3be8a2[_0x010a('0x4d')];if(!_0x2eac22[_0x010a('0x42')]['hasOwnProperty'](_0x010a('0xdf'))){_0x5743ba[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x2eac22[_0x010a('0x42')]['limit']);_0x5743ba[_0x010a('0x26')]=qs[_0x010a('0x26')](_0x2eac22[_0x010a('0x42')][_0x010a('0x26')]);}return _0x44a5b5['getFaxInteractions'](_0x5743ba);}})[_0x010a('0x2f')](function(_0x570eb4){if(_0x570eb4){return _0x570eb4?{'count':_0x146d13,'rows':_0x570eb4}:null;}})[_0x010a('0x2f')](respondWithResult(_0x5924fe,null))[_0x010a('0x22')](handleError(_0x5924fe,null));};exports[_0x010a('0xee')]=function(_0x5671af,_0x4bff51){var _0xde7d={};var _0x1f86f7={};var _0x3f2a1d;var _0x198f49;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x5671af[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x4bff51,null))[_0x010a('0x2f')](function(_0x553652){if(_0x553652){_0x3f2a1d=_0x553652;_0x1f86f7[_0x010a('0x57')]=_[_0x010a('0x5a')](db['WhatsappInteraction'][_0x010a('0x58')]);_0x1f86f7[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x5671af[_0x010a('0x42')]);_0x1f86f7[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0x1f86f7['model'],_0x1f86f7[_0x010a('0x42')]);_0xde7d['attributes']=_[_0x010a('0x5c')](_0x1f86f7[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x5671af[_0x010a('0x42')]['fields']));_0xde7d[_0x010a('0x48')]=_0xde7d['attributes'][_0x010a('0x4d')]?_0xde7d[_0x010a('0x48')]:_0x1f86f7['model'];_0xde7d[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x5671af[_0x010a('0x42')][_0x010a('0xd9')]);_0xde7d[_0x010a('0xda')]=qs['filters'](_['pick'](_0x5671af['query'],_0x1f86f7[_0x010a('0x5b')]));if(_0x5671af['query'][_0x010a('0x36')]){_0xde7d[_0x010a('0xda')]=_[_0x010a('0x5e')](_0xde7d[_0x010a('0xda')],{'$or':_[_0x010a('0x37')](_0xde7d['attributes'],function(_0x44c397){var _0x4cf288={};_0x4cf288[_0x44c397]={'$like':'%'+_0x5671af[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x4cf288;})});}_0xde7d=_[_0x010a('0x5e')]({},_0xde7d,_0x5671af[_0x010a('0xdc')]);return _0x3f2a1d[_0x010a('0xee')](_0xde7d);}})[_0x010a('0x2f')](function(_0x20fd8f){if(_0x20fd8f){_0x198f49=_0x20fd8f[_0x010a('0x4d')];if(!_0x5671af['query'][_0x010a('0xd0')](_0x010a('0xdf'))){_0xde7d[_0x010a('0x28')]=qs['limit'](_0x5671af['query'][_0x010a('0x28')]);_0xde7d['offset']=qs[_0x010a('0x26')](_0x5671af['query']['offset']);}return _0x3f2a1d['getWhatsappInteractions'](_0xde7d);}})[_0x010a('0x2f')](function(_0x476cc9){if(_0x476cc9){return _0x476cc9?{'count':_0x198f49,'rows':_0x476cc9}:null;}})[_0x010a('0x2f')](respondWithResult(_0x4bff51,null))['catch'](handleError(_0x4bff51,null));};exports[_0x010a('0xef')]=function(_0x31c147,_0x4a7a64,_0x5cf052){var _0x33109d;var _0x3c3851;var _0x239567;var _0x39936c=!_[_0x010a('0x6a')](_0x31c147[_0x010a('0x61')]['id'])?_0x31c147['params']['id']:!_[_0x010a('0x6a')](_0x31c147['user']['id'])?_0x31c147['user']['id']:null;return db['User'][_0x010a('0x3a')]({'where':{'id':_0x39936c,'role':{'$or':[_0x010a('0x31'),_0x010a('0x33'),_0x010a('0x2c')]}},'attributes':['id',_0x010a('0x3b'),_0x010a('0xf0'),'mobile',_0x010a('0x2b'),_0x010a('0x65'),_0x010a('0xa5')]})['then'](function(_0x9dd5d6){if(_0x9dd5d6){if(_0x9dd5d6[_0x010a('0x2b')]==='agent'){_0x33109d=_0x9dd5d6;if(_0x31c147[_0x010a('0x60')]['interface']){_0x239567=util[_0x010a('0xce')](_0x010a('0xf1'),_0x33109d[_0x31c147[_0x010a('0x60')]['interface']]);}else if(_0x31c147['body'][_0x010a('0xf2')]){_0x239567=util[_0x010a('0xce')](_0x010a('0xaf'),_0x31c147[_0x010a('0x60')][_0x010a('0xf2')]);}else{_0x239567=util[_0x010a('0xce')](_0x010a('0xaf'),_0x33109d['name']);}socket['to'](util[_0x010a('0xce')]('user:%s',_0x33109d[_0x010a('0x3b')]))[_0x010a('0x2d')](_0x010a('0xf3'),{'user':{'id':_0x33109d['id'],'name':_0x33109d[_0x010a('0x3b')]},'ip':_0x31c147[_0x010a('0xf4')][_0x010a('0xf5')]||_0x31c147[_0x010a('0xf6')][_0x010a('0xf7')]||_0x31c147['socket'][_0x010a('0xf7')]||_0x31c147[_0x010a('0xf6')]['socket'][_0x010a('0xf7')]});return db['UserVoiceQueueRt'][_0x010a('0x2e')]({'where':{'membername':_0x33109d[_0x010a('0x3b')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x010a('0x94'))](_0x010a('0xf8'));}})['then'](function(){if(_0x33109d){return _0x33109d['getVoiceQueues']({'raw':!![]});}})[_0x010a('0x2f')](function(_0x36d3d8){if(_0x33109d){if(_0x36d3d8){_0x3c3851=_0x36d3d8;if(_0x3c3851['length']){var _0x332192=_0x3c3851['map'](function(_0x1af5d6){var _0x4eb91e={'membername':_0x33109d[_0x010a('0x3b')],'UserId':_0x33109d['id'],'queue_name':_0x1af5d6['name'],'VoiceQueueId':_0x1af5d6['id'],'interface':_0x239567,'paused':_0x33109d[_0x010a('0xa5')]||![],'penalty':_0x1af5d6[_0x010a('0xf9')]||0x0};return db[_0x010a('0xb7')][_0x010a('0xfa')](_0x4eb91e);});return Promise[_0x010a('0x55')](_0x332192);}}}})[_0x010a('0x2f')](function(){if(_0x33109d){return db[_0x010a('0xfb')][_0x010a('0x8e')]({'where':{'membername':_0x33109d['name'],'exitAt':null}});}})[_0x010a('0x2f')](function(_0x4e6d14){if(_0x33109d){var _0x5ef3fc=[];_0x4e6d14[_0x010a('0xfc')](function(_0x3d1b2f){_0x5ef3fc[_0x010a('0x49')](_0x3d1b2f[_0x010a('0x5f')]({'exitAt':moment()['format'](_0x010a('0xfd'))}));});return Promise[_0x010a('0x55')](_0x5ef3fc);}})[_0x010a('0x2f')](function(){if(_0x33109d){var _0xcf7e3=[];var _0xbc0040=[];var _0x6c8f4e=utils[_0x010a('0xfe')]();var _0xef3bf9={'membername':_0x33109d[_0x010a('0x3b')],'interface':_0x239567,'enterAt':moment()[_0x010a('0xce')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x33109d[_0x010a('0x2b')],'internal':_0x33109d[_0x010a('0x65')]};_0x6c8f4e[_0x010a('0xfc')](function(_0x17a629){_0xcf7e3[_0x010a('0x49')](_[_0x010a('0x5e')]({'channel':_0x17a629,'type':_0x010a('0xff'),'data1':_0x31c147[_0x010a('0x60')][_0x010a('0x100')],'data2':_0x239567},_0xef3bf9));if(_0x33109d['loginInPause']){_0xbc0040[_0x010a('0x49')](_[_0x010a('0x5e')]({'channel':_0x17a629,'type':_0x010a('0x101'),'data1':_0x010a('0x102')},_0xef3bf9));}});return db[_0x010a('0xfb')][_0x010a('0x88')](_0xcf7e3[_0x010a('0x103')](_0xbc0040),{'individualHooks':!![]});}})[_0x010a('0x2f')](function(){if(_0x33109d){return _0x33109d[_0x010a('0x5f')]({'online':!![],'lastLoginAt':moment()[_0x010a('0xce')](_0x010a('0xfd')),'voicePause':_0x33109d[_0x010a('0xa5')]||![],'mailPause':_0x33109d[_0x010a('0xa5')]||![],'chatPause':_0x33109d['loginInPause']||![],'faxPause':_0x33109d[_0x010a('0xa5')]||![],'smsPause':_0x33109d[_0x010a('0xa5')]||![],'openchannelPause':_0x33109d[_0x010a('0xa5')]||![],'whatsappPause':_0x33109d[_0x010a('0xa5')]||![],'pauseType':_0x33109d[_0x010a('0xa5')]?'LOGININPAUSE':null,'interface':_0x239567,'lastPauseAt':moment()[_0x010a('0xce')](_0x010a('0xfd'))});}})[_0x010a('0x2f')](function(_0x214776){if(_0x31c147[_0x010a('0x104')]){return _0x5cf052();}else{return Promise['resolve'](_0x214776)[_0x010a('0x2f')](respondWithResult(_0x4a7a64,null));}})[_0x010a('0x22')](handleError(_0x4a7a64,null));};exports[_0x010a('0x105')]=function(_0x40e21e,_0xfe7a33){var _0x254872;return db[_0x010a('0x4a')][_0x010a('0x3a')]({'where':{'id':_0x40e21e[_0x010a('0x61')]['id'],'role':_0x010a('0x2c')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0xfe7a33,null))[_0x010a('0x2f')](function(_0x3af50e){if(_0x3af50e){_0x254872=_0x3af50e;return db[_0x010a('0xb7')]['destroy']({'where':{'membername':_0x254872[_0x010a('0x3b')]},'individualHooks':!![]});}})[_0x010a('0x2f')](function(){return db[_0x010a('0xfb')][_0x010a('0x8e')]({'where':{'membername':_0x254872['name'],'exitAt':null}});})[_0x010a('0x2f')](function(_0x4e67a8){var _0x5b0c9d=[];_0x4e67a8[_0x010a('0xfc')](function(_0x3cb327){_0x5b0c9d['push'](_0x3cb327[_0x010a('0x5f')]({'exitAt':moment()[_0x010a('0xce')](_0x010a('0xfd'))}));});return Promise[_0x010a('0x55')](_0x5b0c9d);})[_0x010a('0x2f')](function(){return _0x254872[_0x010a('0x5f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x010a('0x2f')](respondWithResult(_0xfe7a33,null))[_0x010a('0x22')](handleError(_0xfe7a33,null));};exports[_0x010a('0x106')]=function(_0x2230bb,_0x396c1a){var _0x5546bf;return db[_0x010a('0xb7')]['update']({'paused':0x1},{'where':{'UserId':_0x2230bb['params']['id']},'individualHooks':!![]})[_0x010a('0x2f')](function(){return db[_0x010a('0x4a')][_0x010a('0x3a')]({'where':{'id':_0x2230bb[_0x010a('0x61')]['id'],'role':_0x010a('0x2c')},'attributes':['id','name',_0x010a('0x2b'),_0x010a('0x65'),_0x010a('0xa7'),_0x010a('0xa4')]});})[_0x010a('0x2f')](handleEntityNotFound(_0x396c1a,null))[_0x010a('0x2f')](function(_0x3811e7){if(_0x3811e7){_0x5546bf=_0x3811e7;return respondWithRpcPromise(_0x010a('0x107'),_0x010a('0x106'),{'id':_0x5546bf['id'],'name':_0x5546bf['name'],'pause':!![]});}})[_0x010a('0x2f')](function(){if(_0x5546bf){return db[_0x010a('0xfb')][_0x010a('0x8e')]({'where':{'membername':_0x5546bf[_0x010a('0x3b')],'type':'PAUSE','exitAt':null}});}})[_0x010a('0x2f')](function(_0x4c753e){if(_0x4c753e['length']){var _0x4ce5d0=moment()['format'](_0x010a('0xfd'));for(var _0xbdef4c=0x0,_0x58ed59=_0x4c753e[_0x010a('0x4d')];_0xbdef4c<_0x58ed59;_0xbdef4c++){_0x4c753e[_0xbdef4c][_0x010a('0x108')]({'exitAt':_0x4ce5d0});}}})[_0x010a('0x2f')](function(){var _0x10ee1b=[];var _0x34fb64=utils[_0x010a('0xfe')]();_0x34fb64[_0x010a('0xfc')](function(_0x3645ff){_0x10ee1b[_0x010a('0x49')]({'channel':_0x3645ff,'membername':_0x5546bf['name'],'interface':_[_0x010a('0x6a')](_0x5546bf[_0x010a('0xa7')])?util[_0x010a('0xce')]('SIP/%s',_0x5546bf[_0x010a('0x3b')]):_0x5546bf['interface'],'type':_0x010a('0x101'),'enterAt':moment()[_0x010a('0xce')](_0x010a('0xfd')),'data1':_0x2230bb[_0x010a('0x60')][_0x010a('0x109')]||_0x010a('0x10a'),'role':_0x5546bf[_0x010a('0x2b')],'internal':_0x5546bf[_0x010a('0x65')]});});return db[_0x010a('0xfb')][_0x010a('0x88')](_0x10ee1b,{'individualHooks':!![]});})['then'](function(){return _0x5546bf[_0x010a('0x5f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x2230bb[_0x010a('0x60')][_0x010a('0x109')]||_0x010a('0x10a'),'lastPauseAt':moment()[_0x010a('0xce')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x010a('0x2f')](respondWithResult(_0x396c1a,null))[_0x010a('0x22')](handleError(_0x396c1a,null));};exports[_0x010a('0x10b')]=function(_0x5a62d0,_0xa8fa5f){if(_0x5a62d0['body'][_0x010a('0xa3')]&&!utils[_0x010a('0xb2')](_0x5a62d0[_0x010a('0x60')][_0x010a('0xa3')])){throw new APIBadRequestError(util[_0x010a('0xce')](_0x010a('0x10c'),_0x5a62d0[_0x010a('0x60')][_0x010a('0xa3')]));}return db[_0x010a('0x4a')][_0x010a('0x3a')]({'where':{'id':_0x5a62d0['params']['id']},'attributes':['id',_0x010a('0x3b'),_0x010a('0x2b'),_0x010a('0x65'),'interface','online',_0x010a('0xa6'),_0x010a('0x10d'),_0x010a('0x10e'),_0x010a('0x10f'),'openchannelPause',_0x010a('0x110'),_0x010a('0x111'),'pauseType',_0x010a('0x112')]})['then'](function(_0x192b54){if(!_0x192b54){throw new APINotFoundError(util['format'](_0x010a('0xcf'),_0x5a62d0[_0x010a('0x61')]['id']));}return _0x192b54[_0x010a('0x10b')](_0x5a62d0[_0x010a('0x60')][_0x010a('0xa3')]);})[_0x010a('0x2f')](respondWithResult(_0xa8fa5f,null))[_0x010a('0x22')](APIHandleError(_0xa8fa5f));};exports[_0x010a('0x113')]=function(_0x540f5b,_0x10216e){var _0x275f8d={};var _0xe05b70={};var _0x2e1376;var _0x14fec9;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x540f5b[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x10216e,null))[_0x010a('0x2f')](function(_0x51c546){if(_0x51c546){_0x2e1376=_0x51c546;_0xe05b70['model']=_[_0x010a('0x5a')](db['Team']['rawAttributes']);_0xe05b70['query']=_[_0x010a('0x5a')](_0x540f5b[_0x010a('0x42')]);_0xe05b70[_0x010a('0x5b')]=_[_0x010a('0x5c')](_0xe05b70[_0x010a('0x57')],_0xe05b70[_0x010a('0x42')]);_0x275f8d['attributes']=_[_0x010a('0x5c')](_0xe05b70[_0x010a('0x57')],qs['fields'](_0x540f5b[_0x010a('0x42')][_0x010a('0x5d')]));_0x275f8d[_0x010a('0x48')]=_0x275f8d[_0x010a('0x48')][_0x010a('0x4d')]?_0x275f8d[_0x010a('0x48')]:_0xe05b70['model'];_0x275f8d['order']=qs[_0x010a('0xd9')](_0x540f5b[_0x010a('0x42')][_0x010a('0xd9')]);_0x275f8d[_0x010a('0xda')]=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0x540f5b[_0x010a('0x42')],_0xe05b70['filters']));if(_0x540f5b[_0x010a('0x42')][_0x010a('0x36')]){_0x275f8d[_0x010a('0xda')]=_['merge'](_0x275f8d[_0x010a('0xda')],{'$or':_[_0x010a('0x37')](_0x275f8d[_0x010a('0x48')],function(_0x4e6c59){var _0x297534={};_0x297534[_0x4e6c59]={'$like':'%'+_0x540f5b[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x297534;})});}_0x275f8d=_[_0x010a('0x5e')]({},_0x275f8d,_0x540f5b[_0x010a('0xdc')]);return _0x2e1376['getTeams'](_0x275f8d);}})[_0x010a('0x2f')](function(_0x303c2e){if(_0x303c2e){_0x14fec9=_0x303c2e[_0x010a('0x4d')];if(!_0x540f5b[_0x010a('0x42')][_0x010a('0xd0')](_0x010a('0xdf'))){_0x275f8d[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x540f5b[_0x010a('0x42')]['limit']);_0x275f8d[_0x010a('0x26')]=qs[_0x010a('0x26')](_0x540f5b[_0x010a('0x42')]['offset']);}return _0x2e1376['getTeams'](_0x275f8d);}})[_0x010a('0x2f')](function(_0x5ddc8a){if(_0x5ddc8a){return _0x5ddc8a?{'count':_0x14fec9,'rows':_0x5ddc8a}:null;}})[_0x010a('0x2f')](respondWithResult(_0x10216e,null))[_0x010a('0x22')](handleError(_0x10216e,null));};exports[_0x010a('0x114')]=function(_0x1e7b52,_0x5a01ff){var _0x1e237c=_0x1e7b52['params']['id'];var _0x33d420=_0x1e7b52['body']?_0x1e7b52['body']['ids']:null;var _0x431445=[];return Promise[_0x010a('0x115')]()['then'](function(){if(!_0x33d420)throw new APIBadRequestError(_0x010a('0x116'));})[_0x010a('0x2f')](function(){return db[_0x010a('0x4a')]['findOne']({'where':{'id':_0x1e237c}});})[_0x010a('0x2f')](function(_0x69e645){if(!_0x69e645)throw new APINotFoundError(util[_0x010a('0xce')](_0x010a('0xcf'),_0x1e7b52[_0x010a('0x61')]['id']));return db[_0x010a('0x6b')][_0x010a('0x117')](function(_0x3c0f22){return _0x69e645['addTeams'](_0x33d420,{'transaction':_0x3c0f22})[_0x010a('0x2f')](function(){return db[_0x010a('0x118')][_0x010a('0x8e')]({'where':{'id':{'$in':_0x33d420}}});})[_0x010a('0x2f')](function(_0x4b1af4){var _0x4f3849=_[_0x010a('0x37')](_0x4b1af4,function(_0x3cc457){return _0x3cc457['getAssociatedQueues']();});return Promise['all'](_0x4f3849);})[_0x010a('0x2f')](function(_0x2ae668){_0x431445=_[_0x010a('0x119')](_0x2ae668);var _0x1f802f=_[_0x010a('0x37')](_0x431445,function(_0x1e9a5d){return _0x1e9a5d[_0x010a('0x11a')](_0x69e645['id'],{'transaction':_0x3c0f22});});return Promise[_0x010a('0x55')](_0x1f802f);})[_0x010a('0x2f')](function(){if(!_0x69e645[_0x010a('0xa4')])return;var _0x3ffb80=_[_0x010a('0x36')](_0x431445,function(_0x5d6dca){return _0x5d6dca[_0x010a('0x11b')](_0x010a('0xa3'))===_0x010a('0x11c');});var _0x2bd6a7=_[_0x010a('0x37')](_0x3ffb80,function(_0x304e68){return db[_0x010a('0xb7')][_0x010a('0xfa')]({'membername':_0x69e645[_0x010a('0x3b')],'UserId':_0x69e645['id'],'queue_name':_0x304e68[_0x010a('0x3b')],'VoiceQueueId':_0x304e68['id'],'interface':_[_0x010a('0x6a')](_0x69e645[_0x010a('0xa7')])?util['format'](_0x010a('0xaf'),_0x69e645[_0x010a('0x3b')]):_0x69e645[_0x010a('0xa7')],'paused':_0x69e645['voicePause']||![],'penalty':_0x69e645[_0x010a('0xb0')]},{'transaction':_0x3c0f22});});return Promise['all'](_0x2bd6a7);})[_0x010a('0x2f')](function(){return db[_0x010a('0x11d')][_0x010a('0x8e')]({'where':{'teamId':{'$in':_0x33d420}}});})[_0x010a('0x2f')](function(_0x269734){var _0x1d0b71=_[_0x010a('0x37')](_0x269734,function(_0xc34232){return db[_0x010a('0x11e')][_0x010a('0x81')]({'UserId':_0x69e645['id'],'VoicePrefixId':_0xc34232[_0x010a('0x11f')]},{'transaction':_0x3c0f22});});return Promise[_0x010a('0x55')](_0x1d0b71);});});})[_0x010a('0x2f')](function(){for(var _0x5d849d=0x0;_0x5d849d<_0x431445[_0x010a('0x4d')];_0x5d849d++){var _0xa8a2f2=_0x431445[_0x5d849d][_0x010a('0x11b')](_0x010a('0xa3'));var _0x5b437d=_0xa8a2f2+_0x010a('0xb6');socket[_0x010a('0x2d')](_0x010a('0x33')+_0xa8a2f2+'Queue:save',{'UserId':_0x1e237c,['queueField']:_0x431445[_0x5d849d]['id']});}})[_0x010a('0x2f')](respondWithStatusCode(_0x5a01ff,null))[_0x010a('0x22')](APIHandleError(_0x5a01ff));};exports[_0x010a('0x120')]=function(_0x1e376f,_0x573b2e){var _0x6f8d2f=_0x1e376f[_0x010a('0x61')]['id'];var _0x1e18fb=null;if(_0x1e376f['query']['ids']){_0x1e18fb=_['isArray'](_0x1e376f[_0x010a('0x42')][_0x010a('0x64')])?_0x1e376f[_0x010a('0x42')][_0x010a('0x64')]:[_0x1e376f[_0x010a('0x42')][_0x010a('0x64')]];}var _0x2826a6=[];return Promise[_0x010a('0x115')]()['then'](function(){if(!_0x1e18fb)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x010a('0x2f')](function(){return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x6f8d2f}});})['then'](function(_0x57ecca){if(!_0x57ecca)throw new APINotFoundError(util[_0x010a('0xce')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1e376f['params']['id']));return db[_0x010a('0x6b')][_0x010a('0x117')](function(_0x270384){return _0x57ecca[_0x010a('0x120')](_0x1e18fb,{'transaction':_0x270384})[_0x010a('0x2f')](function(){return db[_0x010a('0x118')][_0x010a('0x8e')]({'where':{'id':{'$in':_0x1e18fb}}});})['then'](function(_0x2457ba){var _0xee058a=_[_0x010a('0x37')](_0x2457ba,function(_0x863cc1){return _0x863cc1[_0x010a('0x121')]();});return Promise[_0x010a('0x55')](_0xee058a);})[_0x010a('0x2f')](function(_0x3df6b4){_0x2826a6=_[_0x010a('0x119')](_0x3df6b4);var _0x5f49ab=_['map'](_0x2826a6,function(_0x13e7c3){return _0x13e7c3['removeAgent'](_0x57ecca['id'],{'transaction':_0x270384});});return Promise[_0x010a('0x55')](_0x5f49ab);})[_0x010a('0x2f')](function(){if(!_0x57ecca[_0x010a('0xa4')])return;var _0xb07793=_[_0x010a('0x36')](_0x2826a6,function(_0x477686){return _0x477686[_0x010a('0x11b')](_0x010a('0xa3'))===_0x010a('0x11c');});var _0x2fcd8d=_[_0x010a('0x37')](_0xb07793,function(_0x2f7f32){return db[_0x010a('0xb7')][_0x010a('0x2e')]({'where':{'VoiceQueueId':_0x2f7f32['id'],'UserId':_0x57ecca['id']},'transaction':_0x270384});});return Promise[_0x010a('0x55')](_0x2fcd8d);})['then'](function(){return db[_0x010a('0x11d')][_0x010a('0x8e')]({'where':{'teamId':{'$in':_0x1e18fb}}});})[_0x010a('0x2f')](function(_0x2f6a77){var _0x53d9c8=_['map'](_0x2f6a77,function(_0x451ec6){return db[_0x010a('0x11e')][_0x010a('0x2e')]({'where':{'UserId':_0x57ecca['id'],'VoicePrefixId':_0x451ec6[_0x010a('0x11f')]}},{'transaction':_0x270384});});return Promise[_0x010a('0x55')](_0x53d9c8);});});})['then'](function(){for(var _0xb6c65d=0x0;_0xb6c65d<_0x2826a6['length'];_0xb6c65d++){var _0x42207f=_0x2826a6[_0xb6c65d][_0x010a('0x11b')]('channel');var _0x341020=_0x42207f+'QueueId';socket[_0x010a('0x2d')](_0x010a('0x33')+_0x42207f+_0x010a('0x122'),{'UserId':_0x6f8d2f,['queueField']:_0x2826a6[_0xb6c65d]['id']});}})[_0x010a('0x2f')](respondWithStatusCode(_0x573b2e,null))[_0x010a('0x22')](APIHandleError(_0x573b2e));};exports[_0x010a('0x123')]=function(_0x4c2188,_0x27b197){var _0x3b314e={};var _0xdde605={};var _0x4eb25f;var _0x1c2596;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x4c2188[_0x010a('0x61')]['id']}})['then'](handleEntityNotFound(_0x27b197,null))[_0x010a('0x2f')](function(_0x2fde21){if(_0x2fde21){_0x4eb25f=_0x2fde21;_0xdde605[_0x010a('0x57')]=_[_0x010a('0x5a')](db['CmList']['rawAttributes']);_0xdde605['query']=_[_0x010a('0x5a')](_0x4c2188[_0x010a('0x42')]);_0xdde605['filters']=_[_0x010a('0x5c')](_0xdde605['model'],_0xdde605[_0x010a('0x42')]);_0x3b314e['attributes']=_[_0x010a('0x5c')](_0xdde605['model'],qs[_0x010a('0x5d')](_0x4c2188['query'][_0x010a('0x5d')]));_0x3b314e[_0x010a('0x48')]=_0x3b314e[_0x010a('0x48')][_0x010a('0x4d')]?_0x3b314e[_0x010a('0x48')]:_0xdde605[_0x010a('0x57')];_0x3b314e[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x4c2188['query'][_0x010a('0xd9')]);_0x3b314e['where']=qs['filters'](_[_0x010a('0xdb')](_0x4c2188[_0x010a('0x42')],_0xdde605[_0x010a('0x5b')]));if(_0x4c2188['query'][_0x010a('0x36')]){_0x3b314e['where']=_['merge'](_0x3b314e['where'],{'$or':_[_0x010a('0x37')](_0x3b314e[_0x010a('0x48')],function(_0x3b6cf1){var _0x54b8c3={};_0x54b8c3[_0x3b6cf1]={'$like':'%'+_0x4c2188[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x54b8c3;})});}_0x3b314e=_[_0x010a('0x5e')]({},_0x3b314e,_0x4c2188['options']);return _0x4eb25f[_0x010a('0x123')](_0x3b314e);}})[_0x010a('0x2f')](function(_0x315fc6){if(_0x315fc6){_0x1c2596=_0x315fc6[_0x010a('0x4d')];if(!_0x4c2188[_0x010a('0x42')][_0x010a('0xd0')]('nolimit')){_0x3b314e[_0x010a('0x28')]=qs[_0x010a('0x28')](_0x4c2188[_0x010a('0x42')]['limit']);_0x3b314e[_0x010a('0x26')]=qs['offset'](_0x4c2188[_0x010a('0x42')][_0x010a('0x26')]);}return _0x4eb25f[_0x010a('0x123')](_0x3b314e);}})['then'](function(_0x2dbc9a){if(_0x2dbc9a){return _0x2dbc9a?{'count':_0x1c2596,'rows':_0x2dbc9a}:null;}})[_0x010a('0x2f')](respondWithResult(_0x27b197,null))[_0x010a('0x22')](handleError(_0x27b197,null));};exports[_0x010a('0x124')]=function(_0x58bdd7,_0x6fa1fa){var _0x1d3ed7={};var _0x588a27={};var _0xf9394b;return db[_0x010a('0x4a')][_0x010a('0x9c')]({'where':{'id':_0x58bdd7[_0x010a('0x61')]['id']}})[_0x010a('0x2f')](handleEntityNotFound(_0x6fa1fa,null))[_0x010a('0x2f')](function(_0x5ad0eb){if(_0x5ad0eb){_0xf9394b=_0x5ad0eb;_0x588a27[_0x010a('0x57')]=_['keys'](db['User'][_0x010a('0x58')]);_0x588a27[_0x010a('0x42')]=_[_0x010a('0x5a')](_0x58bdd7[_0x010a('0x42')]);_0x588a27['filters']=_[_0x010a('0x5c')](_0x588a27[_0x010a('0x57')],_0x588a27[_0x010a('0x42')]);_0x1d3ed7[_0x010a('0x48')]=_[_0x010a('0x5c')](_0x588a27[_0x010a('0x57')],qs[_0x010a('0x5d')](_0x58bdd7['query']['fields']));_0x1d3ed7[_0x010a('0x48')]=_0x1d3ed7[_0x010a('0x48')][_0x010a('0x4d')]?_0x1d3ed7[_0x010a('0x48')]:_0x588a27['model'];_0x1d3ed7[_0x010a('0xd8')]=qs[_0x010a('0xd9')](_0x58bdd7['query'][_0x010a('0xd9')]);_0x1d3ed7[_0x010a('0xda')]=qs[_0x010a('0x5b')](_[_0x010a('0xdb')](_0x58bdd7[_0x010a('0x42')],_0x588a27[_0x010a('0x5b')]));if(_0x58bdd7['query'][_0x010a('0x36')]){_0x1d3ed7[_0x010a('0xda')]=_[_0x010a('0x5e')](_0x1d3ed7['where'],{'$or':_[_0x010a('0x37')](_0x1d3ed7['attributes'],function(_0x1dbe85){var _0x1b9719={};_0x1b9719[_0x1dbe85]={'$like':'%'+_0x58bdd7[_0x010a('0x42')][_0x010a('0x36')]+'%'};return _0x1b9719;})});}_0x1d3ed7[_0x010a('0x57')]=db[_0x010a('0x4a')];_0x1d3ed7['as']=_0x010a('0x34');_0x1d3ed7=_[_0x010a('0x5e')]({},_0x1d3ed7,_0x58bdd7[_0x010a('0xdc')]);return _0xf9394b[_0x010a('0x125')]({'include':[_0x1d3ed7]});}})[_0x010a('0x2f')](function(_0x11dd0d){if(_0x11dd0d){var _0x5aebed={},_0x47c0eb=[];for(var _0x12e5f3=0x0;_0x12e5f3<_0x11dd0d[_0x010a('0x4d')];_0x12e5f3+=0x1){for(var _0x4c786c=0x0,_0x3f071a;_0x4c786c<_0x11dd0d[_0x12e5f3][_0x010a('0x34')][_0x010a('0x4d')];_0x4c786c+=0x1){_0x3f071a=_0x11dd0d[_0x12e5f3][_0x010a('0x34')][_0x4c786c][_0x010a('0x30')]({'plain':!![]});_0x5aebed[_0x3f071a['id']]=_0x3f071a;}}_0x5aebed=_[_0x010a('0x126')](_0x5aebed);for(var _0x5e4823=qs['offset'](_0x58bdd7[_0x010a('0x42')][_0x010a('0x26')]);_0x5e4823<_0x5aebed[_0x010a('0x4d')]&&_0x47c0eb[_0x010a('0x4d')]=_0x24ea43){_0x5691ed=_0x24ea43;_0x111e83=0xc8;}else{_0x111e83=0xce;}_0x5d4053[_0x33bb('0x21')](_0x111e83);return _0x5d4053[_0x33bb('0x27')]('Content-Range',_0x433d9e+'-'+_0x5691ed+'/'+_0x24ea43)[_0x33bb('0x28')](_0x62114f);}return null;};}function saveUpdates(_0x1e1ff2){return function(_0x3d18fc){if(_0x3d18fc){return _0x3d18fc[_0x33bb('0x29')](_0x1e1ff2)[_0x33bb('0x15')](function(_0x4c352f){if(_0x4c352f['role']==='agent'){socket[_0x33bb('0x2a')](_0x33bb('0x2b')+_0x4c352f['id'],_0x4c352f);}return _0x4c352f;});}return null;};}function removeEntity(_0x4cf8ed){return function(_0x3a9568){if(_0x3a9568){return _0x3a9568[_0x33bb('0x2c')]()[_0x33bb('0x15')](function(){var _0xd593=_0x3a9568[_0x33bb('0x2d')]({'plain':!![]});if(_0xd593[_0x33bb('0x2e')]===_0x33bb('0x2f'))return;var _0x5948ba=[{'name':_0x33bb('0x30'),'value':_0x33bb('0x31'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x10140b=_(_0x5948ba)[_0x33bb('0x32')](_0x33bb('0x33'))[_0x33bb('0x34')]('value')[_0x33bb('0x35')]();if(_['includes'](_0x10140b,_0xd593[_0x33bb('0x2e')])){return;}var _0x3e2051=_[_0x33bb('0x36')](_0x5948ba,['value',_0xd593['role']])[_0x33bb('0x37')];return db[_0x33bb('0x38')][_0x33bb('0x2c')]({'where':{'type':_0x3e2051,'resourceId':_0xd593['id']}})[_0x33bb('0x15')](function(){return _0x3a9568;});})[_0x33bb('0x15')](function(){_0x4cf8ed[_0x33bb('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db134){return function(_0xfed055){if(!_0xfed055){_0x5db134[_0x33bb('0x20')](0x194);}return _0xfed055;};}function handleError(_0x3e70ed,_0x27a90e){_0x27a90e=_0x27a90e||0x1f4;return function(_0x1bf598){logger['error'](_0x1bf598[_0x33bb('0x39')]);if(_0x1bf598[_0x33bb('0x37')]){delete _0x1bf598[_0x33bb('0x37')];}_0x3e70ed[_0x33bb('0x21')](_0x27a90e)[_0x33bb('0x3a')](_0x1bf598);};}exports[_0x33bb('0x3b')]=function(_0x2cb59d,_0x389cbc){var _0x118e3d={},_0x559a3b={'count':0x0,'rows':[]};var _0x1bebfd=_(db[_0x33bb('0x3c')][_0x33bb('0x3d')])[_0x33bb('0x34')](function(_0x17d9b3){return{'name':_0x17d9b3[_0x33bb('0x3e')],'type':_0x17d9b3[_0x33bb('0x3f')][_0x33bb('0x40')]};})['filter'](function(_0x347575){return!_[_0x33bb('0x41')](['password',_0x33bb('0x42')],_0x347575[_0x33bb('0x37')]);})[_0x33bb('0x35')]();_0x118e3d=qs[_0x33bb('0x43')](_0x1bebfd,_0x2cb59d);var _0x313dfd={'where':_0x118e3d[_0x33bb('0x44')]};return db[_0x33bb('0x3c')][_0x33bb('0x25')](_0x313dfd)['then'](function(_0x2807af){_0x559a3b['count']=_0x2807af;if(_0x2cb59d[_0x33bb('0x45')][_0x33bb('0x46')]){_0x118e3d[_0x33bb('0x47')]=[{'all':!![]}];}if(_0x2cb59d[_0x33bb('0x45')]['userSetting']===_0x33bb('0x48')){_0x118e3d[_0x33bb('0x47')]=[{'model':db[_0x33bb('0x49')],'as':_0x33bb('0x4a')}];}if(!_[_0x33bb('0x41')](_0x118e3d[_0x33bb('0x4b')],'id')){_0x118e3d[_0x33bb('0x4b')][_0x33bb('0x4c')]('id');}return db['User'][_0x33bb('0x4d')](_0x118e3d);})[_0x33bb('0x15')](function(_0x3c48e8){_0x559a3b[_0x33bb('0x4e')]=_0x3c48e8;if(_0x2cb59d[_0x33bb('0x45')][_0x33bb('0x4f')]===_0x33bb('0x48')){var _0x246e92=[];for(var _0x4454f4=0x0;_0x4454f4<_0x559a3b[_0x33bb('0x4e')][_0x33bb('0x50')];_0x4454f4++){_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x51'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4]['dataValues']));_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x52'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x54'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92['push'](get_open_tabs(_0x33bb('0x55'),_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92[_0x33bb('0x4c')](get_open_tabs('openchannel',_0x559a3b[_0x33bb('0x4e')][_0x4454f4][_0x33bb('0x53')]));_0x246e92[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x56'),_0x559a3b['rows'][_0x4454f4][_0x33bb('0x53')]));}return Promise['all'](_0x246e92)[_0x33bb('0x15')](function(){return _0x559a3b;});}else{return _0x559a3b;}})[_0x33bb('0x15')](respondWithFilteredResult(_0x389cbc,_0x118e3d))['catch'](handleError(_0x389cbc,null));};exports['show']=function(_0x12e116,_0x5eb2e8){var _0x1746f8={'raw':![],'where':{'id':_0x12e116[_0x33bb('0x57')]['id']}},_0x4fe931={};_0x4fe931[_0x33bb('0x58')]=_[_0x33bb('0x59')](_[_0x33bb('0x5a')](db[_0x33bb('0x3c')][_0x33bb('0x3d')]),[_0x33bb('0x5b'),_0x33bb('0x42')]);_0x4fe931[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x12e116['query']);_0x4fe931['filters']=_['intersection'](_0x4fe931[_0x33bb('0x58')],_0x4fe931['query']);_0x1746f8['attributes']=_[_0x33bb('0x5c')](_0x4fe931['model'],qs[_0x33bb('0x5d')](_0x12e116['query'][_0x33bb('0x5d')]));_0x1746f8[_0x33bb('0x4b')]=_0x1746f8[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x1746f8[_0x33bb('0x4b')]:_0x4fe931[_0x33bb('0x58')];if(_0x12e116['query']['includeAll']){_0x1746f8[_0x33bb('0x47')]=[{'all':!![]}];}if(_0x12e116[_0x33bb('0x45')][_0x33bb('0x4a')]===_0x33bb('0x48')){_0x1746f8[_0x33bb('0x47')]=[{'model':db[_0x33bb('0x49')],'as':_0x33bb('0x4a')}];}_0x1746f8=_[_0x33bb('0x5e')]({},_0x1746f8,_0x12e116[_0x33bb('0x5f')]);if(!_[_0x33bb('0x41')](_0x1746f8[_0x33bb('0x4b')],'id')){_0x1746f8[_0x33bb('0x4b')][_0x33bb('0x4c')]('id');}return db[_0x33bb('0x3c')][_0x33bb('0x36')](_0x1746f8)[_0x33bb('0x15')](handleEntityNotFound(_0x5eb2e8,null))['then'](function(_0x2a7299){var _0xba2ab3=[];values=_0x2a7299;if(_0x12e116[_0x33bb('0x45')][_0x33bb('0x4f')]==='true'){_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x51'),_0x2a7299['dataValues']));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x52'),_0x2a7299[_0x33bb('0x53')]));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x60'),_0x2a7299[_0x33bb('0x53')]));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x56'),_0x2a7299['dataValues']));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x54'),_0x2a7299[_0x33bb('0x53')]));_0xba2ab3[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x55'),_0x2a7299[_0x33bb('0x53')]));return Promise[_0x33bb('0x61')](_0xba2ab3);}else{return values;}})[_0x33bb('0x15')](function(){return values;})[_0x33bb('0x15')](respondWithResult(_0x5eb2e8,null))[_0x33bb('0x1f')](handleError(_0x5eb2e8,null));};exports[_0x33bb('0x29')]=function(_0x50f390,_0x5ddd80){if(_0x50f390['body']['id']){delete _0x50f390[_0x33bb('0x62')]['id'];}delete _0x50f390[_0x33bb('0x62')][_0x33bb('0x2e')];return db['User'][_0x33bb('0x36')]({'where':{'id':_0x50f390['params']['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x5ddd80,null))['then'](saveUpdates(_0x50f390[_0x33bb('0x62')],null))[_0x33bb('0x15')](respondWithResult(_0x5ddd80,null))[_0x33bb('0x1f')](handleError(_0x5ddd80,null));};exports['describe']=function(_0x1c8420,_0x324f39){return db['User']['describe']()[_0x33bb('0x15')](respondWithResult(_0x324f39,null))[_0x33bb('0x1f')](handleError(_0x324f39,null));};exports[_0x33bb('0x63')]=function(_0x2d03b4,_0x4d586d){return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x2d03b4[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x4d586d,null))[_0x33bb('0x15')](function(_0x5cf250){if(_0x5cf250){return _0x5cf250[_0x33bb('0x63')](_0x2d03b4[_0x33bb('0x62')][_0x33bb('0x64')],_['omit'](_0x2d03b4[_0x33bb('0x62')],[_0x33bb('0x64'),'id'])||{});}})[_0x33bb('0x15')](respondWithResult(_0x4d586d,null))['catch'](handleError(_0x4d586d,null));};function validateUser(_0x27cee7){return new Promise(function(_0x2eaf80,_0x3d36c4){if(_0x27cee7[_0x33bb('0x65')])return _0x2eaf80(_0x27cee7);return db[_0x33bb('0x66')]['findById'](0x1)[_0x33bb('0x15')](function(_0x90a5fb){if(_0x90a5fb[_0x33bb('0x67')])authService[_0x33bb('0x68')](_0x27cee7[_0x33bb('0x5b')]);db[_0x33bb('0x3c')][_0x33bb('0x69')]('internal')['then'](function(_0xf059a2){if(_[_0x33bb('0x6a')](_0xf059a2)){_0x27cee7[_0x33bb('0x65')]=_0x90a5fb['min_internal']||0x1;return;}if(_[_0x33bb('0x6a')](_0x90a5fb[_0x33bb('0x6b')])||_0x90a5fb['min_internal']===_0xf059a2){_0x27cee7[_0x33bb('0x65')]=_0xf059a2+0x1;return;}if(_0x90a5fb[_0x33bb('0x6b')]>_0xf059a2){_0x27cee7['internal']=_0x90a5fb['min_internal'];return;}return db['sequelize'][_0x33bb('0x45')](_0x33bb('0x6c'),{'type':db['sequelize'][_0x33bb('0x6d')][_0x33bb('0x6e')]})[_0x33bb('0x15')](function(_0x1a364b){if(_0x1a364b&&_0x1a364b[_0x33bb('0x50')]){for(var _0x31c9b8=0x0,_0x3b129d=_0x1a364b[_0x33bb('0x50')];_0x31c9b8<_0x3b129d&&_[_0x33bb('0x6a')](_0x27cee7[_0x33bb('0x65')]);_0x31c9b8++){if(_0x90a5fb[_0x33bb('0x6b')]<=_0x1a364b[_0x31c9b8][_0x33bb('0x6f')]){_0x27cee7[_0x33bb('0x65')]=_0x1a364b[_0x31c9b8]['from'];}else if(_0x90a5fb[_0x33bb('0x6b')]>_0x1a364b[_0x31c9b8][_0x33bb('0x6f')]&&_0x90a5fb[_0x33bb('0x6b')]<=_0x1a364b[_0x31c9b8]['to']){_0x27cee7[_0x33bb('0x65')]=_0x90a5fb[_0x33bb('0x6b')];}}}if(_[_0x33bb('0x6a')](_0x27cee7[_0x33bb('0x65')])){_0x27cee7['internal']=_0xf059a2+0x1;}return _0x2eaf80(_0x27cee7);});});})[_0x33bb('0x1f')](function(_0x3e7067){_0x3d36c4(_0x3e7067);});});}function updateUser(_0x4821a9){return new Promise(function(_0x4bdc91,_0x2fcae0){try{if(_0x4821a9[_0x33bb('0x70')]){_0x4821a9['mailbox']=_0x4821a9[_0x33bb('0x65')];_0x4821a9[_0x33bb('0x71')]={'mailbox':_0x4821a9[_0x33bb('0x65')],'password':_0x4821a9[_0x33bb('0x5b')],'fullname':_0x4821a9[_0x33bb('0x72')],'email':_0x4821a9[_0x33bb('0x73')]};}if(_0x4821a9['role']==='agent'){if(!_0x4821a9[_0x33bb('0x74')])_0x4821a9[_0x33bb('0x74')]=[_0x33bb('0x75'),_0x33bb('0x76'),_0x33bb('0x77'),_0x33bb('0x78'),_0x33bb('0x79'),_0x33bb('0x7a'),_0x33bb('0x7b'),_0x33bb('0x7c'),_0x33bb('0x7d'),_0x33bb('0x7e'),_0x33bb('0x7f'),_0x33bb('0x80'),_0x33bb('0x81'),_0x33bb('0x82'),_0x33bb('0x83')];}_0x4bdc91(_0x4821a9);}catch(_0x282640){_0x2fcae0(_0x282640);}});}exports[_0x33bb('0x84')]=function(_0x19ac1b,_0x35736d){if(_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x2e')]==='agent')throw new Error(_0x33bb('0x85'));if(_0x19ac1b[_0x33bb('0x62')][_0x33bb('0x2e')]===_0x33bb('0x31')&&_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error(_0x33bb('0x86'));}if(_0x19ac1b[_0x33bb('0x62')][_0x33bb('0x2e')]===_0x33bb('0x2f')&&_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error(_0x33bb('0x87'));}return licenseUtil['checkUserLimits']([_0x19ac1b[_0x33bb('0x62')]])[_0x33bb('0x15')](function(){return validateUser(_0x19ac1b[_0x33bb('0x62')]);})[_0x33bb('0x15')](function(_0x2df6e7){return updateUser(_0x2df6e7)[_0x33bb('0x15')](function(_0x16c4dc){if(_0x16c4dc[_0x33bb('0x2e')]===_0x33bb('0x2f')){_0x16c4dc[_0x33bb('0x88')]=_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x88')];delete _0x16c4dc[_0x33bb('0x89')];}return _0x16c4dc;});})[_0x33bb('0x15')](function(_0x2c8294){return db[_0x33bb('0x3c')][_0x33bb('0x84')](_0x2c8294,{'include':[{'model':db[_0x33bb('0x71')],'as':'VoiceMail'}]});})['then'](function(_0x49449b){if(_0x19ac1b[_0x33bb('0x62')][_0x33bb('0x2e')]==='user')return _0x49449b;if(_0x19ac1b[_0x33bb('0x31')]['role']!==_0x33bb('0x31'))return _0x49449b;return db[_0x33bb('0x8a')]['find']({'where':{'name':_0x49449b[_0x33bb('0x2e')]==='agent'?_0x33bb('0x8b'):_0x33bb('0x8c'),'userProfileId':_0x19ac1b[_0x33bb('0x31')][_0x33bb('0x89')]},'raw':!![]})[_0x33bb('0x15')](function(_0x571b58){if(!_0x571b58||_0x571b58[_0x33bb('0x8d')]!=0x0)return _0x49449b;return db['UserProfileResource'][_0x33bb('0x84')]({'name':_0x49449b[_0x33bb('0x37')],'resourceId':_0x49449b['id'],'type':_0x571b58[_0x33bb('0x37')],'sectionId':_0x571b58['id']},{})[_0x33bb('0x15')](function(){return _0x49449b;});})['catch'](function(_0x3e5bfc){logger[_0x33bb('0x1c')](_0x33bb('0x8e'),_0x3e5bfc);throw _0x3e5bfc;});})[_0x33bb('0x15')](respondWithResult(_0x35736d,0xc9))['catch'](handleError(_0x35736d,null));};exports[_0x33bb('0x8f')]=function(_0x5026b1,_0x4a8748){var _0x406be1=_0x5026b1['body'];var _0x5c7368=[];if(_0x5026b1[_0x33bb('0x31')]['role']===_0x33bb('0x90'))throw new Error(_0x33bb('0x85'));if(_['some'](_0x406be1,['role',_0x33bb('0x31')])&&_0x5026b1[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error(_0x33bb('0x86'));}if(_[_0x33bb('0x91')](_0x406be1,[_0x33bb('0x2e'),_0x33bb('0x2f')])&&_0x5026b1[_0x33bb('0x31')][_0x33bb('0x2e')]!==_0x33bb('0x2f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x33bb('0x92')](_0x406be1)[_0x33bb('0x15')](function(){return validateUser(_0x406be1[0x0]);})[_0x33bb('0x15')](function(){for(var _0x17745b=0x1;_0x17745b<_0x406be1[_0x33bb('0x50')];_0x17745b++){var _0x28083b=_0x406be1[_0x17745b-0x1][_0x33bb('0x65')];if(!_0x406be1[_0x17745b][_0x33bb('0x65')])_0x406be1[_0x17745b][_0x33bb('0x65')]=_0x28083b+0x1;_0x5c7368['push'](validateUser(_0x406be1[_0x17745b]));}return Promise[_0x33bb('0x61')](_0x5c7368);})['then'](function(){_0x5c7368=[];for(var _0xa971e1=0x0;_0xa971e1<_0x406be1[_0x33bb('0x50')];_0xa971e1++){_0x5c7368['push'](updateUser(_0x406be1[_0xa971e1]));}return Promise[_0x33bb('0x61')](_0x5c7368);})[_0x33bb('0x15')](function(){_0x5c7368=_0x406be1['map'](function(_0x18d6dd){return db[_0x33bb('0x3c')][_0x33bb('0x84')](_0x18d6dd,{'include':[{'model':db[_0x33bb('0x71')],'as':_0x33bb('0x71')}]})[_0x33bb('0x15')](function(_0x119179){_0x18d6dd['id']=_0x119179['id'];return _0x18d6dd;});});return Promise[_0x33bb('0x61')](_0x5c7368);})['then'](function(_0x38c218){if(_0x5026b1[_0x33bb('0x62')][_0x33bb('0x2e')]===_0x33bb('0x31'))return _0x38c218;if(_0x5026b1['user']['role']!==_0x33bb('0x31'))return _0x38c218;var _0x580dca=_[_0x33bb('0x91')](_0x38c218,function(_0x395ea7){return _0x395ea7['role']==='agent'||_0x395ea7[_0x33bb('0x2e')]==='telephone';});if(!_0x580dca)return _0x38c218;return db[_0x33bb('0x8a')][_0x33bb('0x4d')]({'where':{'name':{'$or':[_0x33bb('0x8b'),_0x33bb('0x8c')]},'userProfileId':_0x5026b1[_0x33bb('0x31')]['userProfileId']},'raw':!![]})[_0x33bb('0x15')](function(_0x5549d2){if(_['isEmpty'](_0x5549d2)||!_[_0x33bb('0x91')](_0x5549d2,['autoAssociation',0x0]))return _0x38c218;_0x5c7368=[];var _0x19eaf6=_(_0x5549d2)[_0x33bb('0x34')](function(_0x5794c7){if(_0x5794c7[_0x33bb('0x8d')]===0x1)return;return _0x5794c7[_0x33bb('0x37')]===_0x33bb('0x8b')?_0x33bb('0x90'):_0x33bb('0x93');})['compact']()[_0x33bb('0x35')]();for(var _0x369627=0x0;_0x369627<_0x38c218['length'];_0x369627++){if(!_['includes'](_0x19eaf6,_0x38c218[_0x369627][_0x33bb('0x2e')]))return;var _0xdee4e1=_0x38c218[_0x369627][_0x33bb('0x2e')]==='agent'?_0x33bb('0x8b'):_0x33bb('0x8c');_0x5c7368[_0x33bb('0x4c')](db[_0x33bb('0x38')][_0x33bb('0x84')]({'name':_0x38c218[_0x369627]['name'],'resourceId':_0x38c218[_0x369627]['id'],'type':_0xdee4e1,'sectionId':_[_0x33bb('0x36')](_0x5549d2,[_0x33bb('0x37'),_0xdee4e1])['id']},{}));}return Promise['all'](_0x5c7368);});})[_0x33bb('0x15')](respondWithResult(_0x4a8748,0xc9))['catch'](handleError(_0x4a8748,null));};exports[_0x33bb('0x94')]=function(_0xd2cd85,_0x1baeaa){if(_0xd2cd85[_0x33bb('0x62')]['id']){delete _0xd2cd85[_0x33bb('0x62')]['id'];}return db[_0x33bb('0x3c')]['find']({'where':{'id':_0xd2cd85[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](function(_0x251d5d){if(!_0x251d5d)return null;if(_0x251d5d['id']===_0xd2cd85[_0x33bb('0x31')]['id']){if(!_0xd2cd85[_0x33bb('0x62')][_0x33bb('0x95')]||!_0xd2cd85[_0x33bb('0x62')]['newPassword']){throw new db['Sequelize'][(_0x33bb('0x96'))](_0x33bb('0x97'));}if(!_0x251d5d['authenticate'](_0xd2cd85['body'][_0x33bb('0x95')])){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))]('Wrong\x20credentials');}if(_0xd2cd85[_0x33bb('0x62')][_0x33bb('0x95')]===_0xd2cd85[_0x33bb('0x62')][_0x33bb('0x99')]){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0x9a'));}}else if(_0xd2cd85[_0x33bb('0x31')]['role']===_0x33bb('0x2f')){if(!_0xd2cd85['body']['newPassword']){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0xd2cd85[_0x33bb('0x31')][_0x33bb('0x2e')]===_0x33bb('0x31')){if(!_0xd2cd85['body']['newPassword']){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x251d5d[_0x33bb('0x2e')]!=='agent'){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0x85'));}}else{throw new db['Sequelize'][(_0x33bb('0x96'))](_0x33bb('0x85'));}return _0x251d5d;})[_0x33bb('0x15')](handleEntityNotFound(_0x1baeaa,null))[_0x33bb('0x15')](function(_0x993595){return db['Setting'][_0x33bb('0x9b')]({'attributes':['id',_0x33bb('0x67'),'enforcePasswordHistory',_0x33bb('0x9c')]})[_0x33bb('0x15')](function(_0x8487e7){if(_0x8487e7[_0x33bb('0x67')])authService[_0x33bb('0x68')](_0xd2cd85['body'][_0x33bb('0x99')]);if(!_0x8487e7[_0x33bb('0x9d')]||!_0x993595[_0x33bb('0x9e')])return _0x993595;authService[_0x33bb('0x9f')](_0xd2cd85['body']['newPassword'],_0x993595[_0x33bb('0x9e')],_0x8487e7[_0x33bb('0x9c')]);return _0x993595;})[_0x33bb('0x15')](saveUpdates({'password':_0xd2cd85[_0x33bb('0x62')]['newPassword'],'passwordResetAt':_0xd2cd85[_0x33bb('0x31')]['id']==_0xd2cd85[_0x33bb('0x57')]['id']?moment():null,'previousPasswords':authService[_0x33bb('0xa0')](_0xd2cd85[_0x33bb('0x62')]['newPassword'],_0x993595[_0x33bb('0x9e')])},null));})[_0x33bb('0x15')](respondWithResult(_0x1baeaa,null))[_0x33bb('0x1f')](handleError(_0x1baeaa,null));};exports['addQueues']=function(_0x354557,_0x3e17f7){var _0x3eec26=_0x354557[_0x33bb('0x62')][_0x33bb('0xa1')];return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x354557['params']['id']},'attributes':['id',_0x33bb('0x37'),_0x33bb('0x2e'),_0x33bb('0xa2'),_0x33bb('0xa3'),_0x33bb('0xa4'),_0x33bb('0xa5')]})[_0x33bb('0x15')](handleEntityNotFound(_0x3e17f7,null))[_0x33bb('0x15')](function(_0x5e4cf1){if(_0x5e4cf1){if(!utils[_0x33bb('0xa6')](_0x3eec26)){throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0xa7'));}return _0x5e4cf1[_0x33bb('0xa8')+_[_0x33bb('0xa9')](_0x3eec26[_0x33bb('0xaa')]())+_0x33bb('0xab')](_0x354557['body'][_0x33bb('0x64')],{'penalty':_0x354557[_0x33bb('0x62')][_0x33bb('0xac')]||0x0})[_0x33bb('0xad')](function(_0x4796fe){for(var _0x49bcdd=0x0;_0x49bcdd<_0x354557[_0x33bb('0x62')][_0x33bb('0x64')][_0x33bb('0x50')];_0x49bcdd+=0x1){var _0x456e7a={'UserId':Number(_0x354557[_0x33bb('0x57')]['id'])};_0x456e7a[_['capitalize'](_0x3eec26['toLowerCase']())+_0x33bb('0xae')]=Number(_0x354557['body'][_0x33bb('0x64')][_0x49bcdd]);socket['emit']('user'+_['capitalize'](_0x3eec26[_0x33bb('0xaa')]())+_0x33bb('0xaf'),_0x456e7a);}return _0x4796fe;})['then'](function(){if(_0x3eec26===_0x33bb('0xb0')){return db[_0x33bb('0xb1')][_0x33bb('0x4d')]({'where':{'id':_0x354557[_0x33bb('0x62')][_0x33bb('0x64')]||[]},'raw':!![],'attributes':['id',_0x33bb('0x37')]});}})['then'](function(_0x3e72d8){var _0x5bf78c=_0x5e4cf1[_0x33bb('0x2d')]({'plain':!![]});var _0x458b06=[];if(_0x3eec26===_0x33bb('0xb0')&&_0x5bf78c['role']===_0x33bb('0x90')&&_0x5bf78c[_0x33bb('0xa2')]){for(let _0x4658b7=0x0;_0x4658b7<_0x3e72d8[_0x33bb('0x50')];_0x4658b7+=0x1){_0x458b06[_0x33bb('0x4c')]({'membername':_0x5bf78c[_0x33bb('0x37')],'UserId':_0x5bf78c['id'],'queue_name':_0x3e72d8[_0x4658b7][_0x33bb('0x37')],'VoiceQueueId':_0x3e72d8[_0x4658b7]['id'],'interface':_['isNil'](_0x5bf78c['interface'])?util[_0x33bb('0xb2')]('SIP/%s',_0x5bf78c[_0x33bb('0x37')]):_0x5bf78c[_0x33bb('0xa5')],'paused':_0x5bf78c[_0x33bb('0xa4')]||![],'penalty':_0x354557['body'][_0x33bb('0xac')]||0x0});}return Promise['all'](_0x458b06['map'](function(_0x36ba6f){return db['UserVoiceQueueRt']['upsert'](_0x36ba6f);}));}return _0x5e4cf1;});}})[_0x33bb('0x15')](respondWithStatusCode(_0x3e17f7,null))[_0x33bb('0x1f')](handleError(_0x3e17f7,null));};exports[_0x33bb('0xb3')]=function(_0x8660da,_0x581bec){var _0x2d4549,_0x1eff8f;return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x8660da[_0x33bb('0x57')]['id']},'attributes':['id','name',_0x33bb('0x2e')]})[_0x33bb('0x15')](handleEntityNotFound(_0x581bec,null))[_0x33bb('0x15')](function(_0x287130){if(_0x287130){_0x2d4549=_0x287130;if(!_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')]||!utils[_0x33bb('0xa6')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')])){throw new db[(_0x33bb('0x98'))]['ValidationError'](_0x33bb('0xa7'));}return _0x287130['remove'+_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+'Queues'](_0x8660da[_0x33bb('0x45')]['ids']);}})[_0x33bb('0x15')](function(_0x1059ae){if(_[_0x33bb('0xb4')](_0x8660da[_0x33bb('0x45')][_0x33bb('0x64')])){for(var _0x7d7c3=0x0;_0x7d7c3<_0x8660da[_0x33bb('0x45')]['ids'][_0x33bb('0x50')];_0x7d7c3+=0x1){_0x1eff8f={'UserId':Number(_0x8660da['params']['id'])};_0x1eff8f[_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+_0x33bb('0xae')]=Number(_0x8660da[_0x33bb('0x45')][_0x33bb('0x64')][_0x7d7c3]);socket[_0x33bb('0x2a')](_0x33bb('0x31')+_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+_0x33bb('0xb5'),_0x1eff8f);}}else{_0x1eff8f={'UserId':Number(_0x8660da[_0x33bb('0x57')]['id'])};_0x1eff8f[_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')]['channel'][_0x33bb('0xaa')]())+_0x33bb('0xae')]=Number(_0x8660da[_0x33bb('0x45')][_0x33bb('0x64')]);socket[_0x33bb('0x2a')]('user'+_[_0x33bb('0xa9')](_0x8660da[_0x33bb('0x45')][_0x33bb('0xa1')][_0x33bb('0xaa')]())+'Queue:remove',_0x1eff8f);}return _0x1059ae;})[_0x33bb('0x15')](function(){if(_0x8660da['query']['channel']===_0x33bb('0xb0')){return db[_0x33bb('0xb6')][_0x33bb('0x2c')]({'where':{'UserId':_0x8660da[_0x33bb('0x57')]['id'],'VoiceQueueId':_0x8660da['query'][_0x33bb('0x64')]},'individualHooks':!![]})[_0x33bb('0x15')](function(){return _0x2d4549;});}return _0x2d4549;})['then'](respondWithStatusCode(_0x581bec,null))[_0x33bb('0x1f')](handleError(_0x581bec,null));};exports[_0x33bb('0xb7')]=function(_0x297066,_0xf0114b){_0x297066['body'][_0x33bb('0xb8')]=_0x297066['file'][_0x33bb('0xb9')];return db['User'][_0x33bb('0x36')]({'where':{'id':_0x297066[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0xf0114b,null))[_0x33bb('0x15')](saveUpdates(_0x297066[_0x33bb('0x62')],null))[_0x33bb('0x15')](respondWithResult(_0xf0114b,null))[_0x33bb('0x1f')](handleError(_0xf0114b,null));};exports[_0x33bb('0xba')]=function(_0x41cf88,_0x3ea9cf){var _0x4ed90e=path[_0x33bb('0xbb')](config[_0x33bb('0xbc')],_0x33bb('0xbd'));return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x41cf88[_0x33bb('0x57')]['id']},'attributes':['id',_0x33bb('0xb8')],'raw':!![]})['then'](handleEntityNotFound(_0x3ea9cf,null))[_0x33bb('0x15')](function(_0xd04925){if(_0xd04925){if(_[_0x33bb('0x6a')](_0xd04925['userpic'])){return _0x3ea9cf[_0x33bb('0xbe')](_0x4ed90e);}else{if(!fs[_0x33bb('0xbf')](path[_0x33bb('0xbb')](config[_0x33bb('0xbc')],_0x33bb('0xc0'),_0xd04925[_0x33bb('0xb8')]))){return _0x3ea9cf[_0x33bb('0xbe')](_0x4ed90e);}return _0x3ea9cf[_0x33bb('0xbe')](path[_0x33bb('0xbb')](config[_0x33bb('0xbc')],'server/files/images/',_0xd04925[_0x33bb('0xb8')]));}}})['catch'](handleError(_0x3ea9cf,null));};exports[_0x33bb('0xc1')]=function(_0x5b983b,_0x31958d){return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x5b983b[_0x33bb('0x57')]['id']},'attributes':['id']})[_0x33bb('0x15')](handleEntityNotFound(_0x31958d,null))[_0x33bb('0x15')](function(_0x586e39){var _0x24be80=[];values=_0x586e39[_0x33bb('0x53')];_0x24be80[_0x33bb('0x4c')](get_open_tabs('chat',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('sms',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('openchannel',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('whatsapp',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs('fax',_0x586e39[_0x33bb('0x53')]));_0x24be80[_0x33bb('0x4c')](get_open_tabs(_0x33bb('0x55'),_0x586e39[_0x33bb('0x53')]));return Promise[_0x33bb('0x61')](_0x24be80);})[_0x33bb('0x15')](function(_0x490412){if(_0x490412){var _0x51acf1=_['map'](values[_0x33bb('0xc2')],function(_0x1def77){return{'channel':_0x33bb('0xc3'),'id':_0x1def77['id'],'createdAt':_0x1def77[_0x33bb('0xc4')]};});var _0x2da44d=_['map'](values[_0x33bb('0xc5')],function(_0x250dfa){return{'channel':'FAX','id':_0x250dfa['id'],'createdAt':_0x250dfa[_0x33bb('0xc4')]};});var _0x183c08=_[_0x33bb('0x34')](values[_0x33bb('0xc6')],function(_0x50612f){return{'channel':_0x33bb('0xc7'),'id':_0x50612f['id'],'createdAt':_0x50612f[_0x33bb('0xc4')]};});var _0x27410a=_[_0x33bb('0x34')](values[_0x33bb('0xc8')],function(_0x1d8c43){return{'channel':_0x33bb('0xc9'),'id':_0x1d8c43['id'],'createdAt':_0x1d8c43[_0x33bb('0xc4')]};});var _0x51cf52=_['map'](values[_0x33bb('0xca')],function(_0x35a3fe){return{'channel':'SMS','id':_0x35a3fe['id'],'createdAt':_0x35a3fe['createdAt']};});var _0x100068=_['map'](values[_0x33bb('0xcb')],function(_0x260437){return{'channel':_0x33bb('0xcc'),'id':_0x260437['id'],'createdAt':_0x260437['createdAt']};});var _0x62e38e=_[_0x33bb('0xcd')](_0x51acf1,_0x2da44d,_0x183c08,_0x27410a,_0x51cf52,_0x100068);var _0x30725a={'count':_0x62e38e[_0x33bb('0x50')],'rows':_0x62e38e};return _0x30725a;}else return null;})[_0x33bb('0x15')](respondWithResult(_0x31958d,null))['catch'](handleError(_0x31958d,null));};exports[_0x33bb('0xce')]=function(_0x7a23b2,_0x10dcdc){var _0x32d706={};return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x7a23b2[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](function(_0x5428a8){if(!_0x5428a8){throw new APINotFoundError(util[_0x33bb('0xb2')]('User\x20with\x20id\x20%s\x20not\x20found',_0x7a23b2[_0x33bb('0x57')]['id']));}return contacts['describe']();})[_0x33bb('0x15')](function(_0x280d8d){_0x7a23b2['query'][_0x33bb('0x3c')]=_0x7a23b2[_0x33bb('0x57')]['id'];_0x32d706=qs[_0x33bb('0x43')](_0x280d8d,_0x7a23b2);if(_0x7a23b2[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0x46'))){_0x32d706[_0x33bb('0x47')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x33bb('0x37'),_0x33bb('0xd0')],'where':_0x7a23b2['query'][_0x33bb('0xd1')]?{'id':_0x7a23b2[_0x33bb('0x45')]['tag']}:undefined,'required':_0x7a23b2[_0x33bb('0x45')]['tag']?!![]:![]}];}return contacts[_0x33bb('0x4d')](_0x7a23b2[_0x33bb('0x45')],_0x7a23b2['user'],_0x32d706,_0x280d8d);})['then'](respondWithFilteredResult(_0x10dcdc,_0x32d706))[_0x33bb('0x1f')](APIHandleError(_0x10dcdc));};exports[_0x33bb('0xd2')]=function(_0x4fe4a4,_0x19a6de){var _0x46fb8f;var _0x148d75={};var _0x289171;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x4fe4a4[_0x33bb('0x57')]['id']},'attributes':['id',_0x33bb('0x37'),'role']})[_0x33bb('0x15')](handleEntityNotFound(_0x19a6de,null))['then'](function(_0x34123a){if(!utils[_0x33bb('0xa6')](_0x4fe4a4[_0x33bb('0x45')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x33bb('0xa7'));}_0x46fb8f=_0x34123a;var _0x3541b3={};_0x3541b3['model']=_[_0x33bb('0x5a')](db[_['capitalize'](_0x4fe4a4['query'][_0x33bb('0xa1')])+'Queue'][_0x33bb('0x3d')]);_0x3541b3[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x4fe4a4[_0x33bb('0x45')]);_0x3541b3[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x3541b3['model'],_0x3541b3[_0x33bb('0x45')]);_0x148d75[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x3541b3[_0x33bb('0x58')],qs['fields'](_0x4fe4a4['query']['fields']));_0x148d75[_0x33bb('0x4b')]=_0x148d75[_0x33bb('0x4b')]['length']?_0x148d75['attributes']:_0x3541b3[_0x33bb('0x58')];_0x148d75[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x4fe4a4[_0x33bb('0x45')]['sort']);_0x148d75[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x4fe4a4[_0x33bb('0x45')],_0x3541b3[_0x33bb('0xd3')]));if(_0x4fe4a4[_0x33bb('0x45')]['filter']){_0x148d75[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x148d75['where'],{'$or':_[_0x33bb('0x34')](_0x148d75[_0x33bb('0x4b')],function(_0xd0b91d){var _0x42f023={};_0x42f023[_0xd0b91d]={'$like':'%'+_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x42f023;})});}_0x148d75=_['merge']({},_0x148d75,_0x4fe4a4['options']);switch(_0x46fb8f[_0x33bb('0x2e')]){case _0x33bb('0x2f'):return db[_[_0x33bb('0xa9')](_0x4fe4a4['query'][_0x33bb('0xa1')])+_0x33bb('0xd7')][_0x33bb('0x4d')](_0x148d75);case _0x33bb('0x31'):case _0x33bb('0x90'):return _0x46fb8f[_0x33bb('0x2d')+_[_0x33bb('0xa9')](_0x4fe4a4[_0x33bb('0x45')]['channel'])+_0x33bb('0xab')](_0x148d75);default:throw new db[(_0x33bb('0x98'))][(_0x33bb('0x96'))](_0x33bb('0xd8'));}})[_0x33bb('0x15')](function(_0x4759e1){_0x289171=_0x4759e1[_0x33bb('0x50')];if(!_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x148d75[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0x26')]);_0x148d75[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x4fe4a4[_0x33bb('0x45')]['offset']);}switch(_0x46fb8f[_0x33bb('0x2e')]){case _0x33bb('0x2f'):return db[_[_0x33bb('0xa9')](_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0xa1')])+_0x33bb('0xd7')][_0x33bb('0x4d')](_0x148d75);case _0x33bb('0x31'):case _0x33bb('0x90'):return _0x46fb8f[_0x33bb('0x2d')+_[_0x33bb('0xa9')](_0x4fe4a4[_0x33bb('0x45')][_0x33bb('0xa1')])+_0x33bb('0xab')](_0x148d75);}})['then'](function(_0x25f457){return{'count':_0x289171,'rows':_0x25f457};})['then'](respondWithResult(_0x19a6de,null))[_0x33bb('0x1f')](handleError(_0x19a6de,null));};exports['getVoiceQueuesRt']=function(_0x34d6c7,_0x170911){var _0x7101d7={};var _0x142915={};var _0x369ee4;var _0x128b24;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x34d6c7[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x170911,null))[_0x33bb('0x15')](function(_0x1574b6){if(_0x1574b6){_0x369ee4=_0x1574b6;_0x142915[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db['UserVoiceQueueRt'][_0x33bb('0x3d')]);_0x142915[_0x33bb('0x45')]=_['keys'](_0x34d6c7[_0x33bb('0x45')]);_0x142915[_0x33bb('0xd3')]=_['intersection'](_0x142915[_0x33bb('0x58')],_0x142915[_0x33bb('0x45')]);_0x7101d7[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x142915[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x7101d7['attributes']=_0x7101d7[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x7101d7[_0x33bb('0x4b')]:_0x142915[_0x33bb('0x58')];_0x7101d7[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x7101d7[_0x33bb('0x44')]=qs['filters'](_[_0x33bb('0xd6')](_0x34d6c7[_0x33bb('0x45')],_0x142915['filters']));if(_0x34d6c7['query'][_0x33bb('0x32')]){_0x7101d7['where']=_[_0x33bb('0x5e')](_0x7101d7['where'],{'$or':_[_0x33bb('0x34')](_0x7101d7[_0x33bb('0x4b')],function(_0x236da8){var _0x4cc461={};_0x4cc461[_0x236da8]={'$like':'%'+_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x4cc461;})});}_0x7101d7=_[_0x33bb('0x5e')]({},_0x7101d7,_0x34d6c7[_0x33bb('0x5f')]);return _0x369ee4[_0x33bb('0xda')](_0x7101d7);}})[_0x33bb('0x15')](function(_0x34b63c){if(_0x34b63c){_0x128b24=_0x34b63c[_0x33bb('0x50')];if(!_0x34d6c7['query']['hasOwnProperty'](_0x33bb('0xd9'))){_0x7101d7[_0x33bb('0x26')]=qs['limit'](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x26')]);_0x7101d7['offset']=qs[_0x33bb('0x23')](_0x34d6c7[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x369ee4[_0x33bb('0xda')](_0x7101d7);}})[_0x33bb('0x15')](function(_0x1f5772){if(_0x1f5772){return _0x1f5772?{'count':_0x128b24,'rows':_0x1f5772}:null;}})['then'](respondWithResult(_0x170911,null))['catch'](handleError(_0x170911,null));};exports[_0x33bb('0xdb')]=function(_0x25df54,_0x4e1b48){var _0xcb3e76={};var _0x583e4b={};var _0x587089;var _0x3dcd48;return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x25df54[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x4e1b48,null))[_0x33bb('0x15')](function(_0x1b5beb){if(_0x1b5beb){_0x587089=_0x1b5beb;_0x583e4b[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xdc')]['rawAttributes']);_0x583e4b[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x25df54[_0x33bb('0x45')]);_0x583e4b[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x583e4b[_0x33bb('0x58')],_0x583e4b[_0x33bb('0x45')]);_0xcb3e76['attributes']=_[_0x33bb('0x5c')](_0x583e4b[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x25df54[_0x33bb('0x45')][_0x33bb('0x5d')]));_0xcb3e76[_0x33bb('0x4b')]=_0xcb3e76[_0x33bb('0x4b')]['length']?_0xcb3e76[_0x33bb('0x4b')]:_0x583e4b[_0x33bb('0x58')];_0xcb3e76[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x25df54['query']['sort']);_0xcb3e76[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x25df54['query'],_0x583e4b[_0x33bb('0xd3')]));if(_0x25df54['query'][_0x33bb('0x32')]){_0xcb3e76[_0x33bb('0x44')]=_['merge'](_0xcb3e76[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0xcb3e76['attributes'],function(_0x2d564f){var _0x398b82={};_0x398b82[_0x2d564f]={'$like':'%'+_0x25df54[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x398b82;})});}_0xcb3e76=_[_0x33bb('0x5e')]({},_0xcb3e76,_0x25df54[_0x33bb('0x5f')]);return _0x587089['getGroups'](_0xcb3e76);}})[_0x33bb('0x15')](function(_0x515594){if(_0x515594){_0x3dcd48=_0x515594['length'];if(!_0x25df54[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0xcb3e76[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x25df54[_0x33bb('0x45')][_0x33bb('0x26')]);_0xcb3e76[_0x33bb('0x23')]=qs['offset'](_0x25df54[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x587089[_0x33bb('0xdb')](_0xcb3e76);}})['then'](function(_0x1ad86f){if(_0x1ad86f){return _0x1ad86f?{'count':_0x3dcd48,'rows':_0x1ad86f}:null;}})[_0x33bb('0x15')](respondWithResult(_0x4e1b48,null))[_0x33bb('0x1f')](handleError(_0x4e1b48,null));};exports['getRecordings']=function(_0x343d5f,_0x33900e){var _0x2aa787={'raw':!![],'where':{}};var _0x20ab16={};var _0x4da635={'count':0x0,'rows':[]};return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x343d5f[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x33900e,null))[_0x33bb('0x15')](function(_0x42a5f3){if(_0x42a5f3){_0x20ab16[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xdd')]['rawAttributes']);_0x20ab16['query']=_['keys'](_0x343d5f['query']);_0x20ab16[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x20ab16[_0x33bb('0x58')],_0x20ab16['query']);_0x2aa787[_0x33bb('0x4b')]=_['intersection'](_0x20ab16[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x343d5f[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x2aa787['attributes']=_0x2aa787[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x2aa787[_0x33bb('0x4b')]:_0x20ab16[_0x33bb('0x58')];if(!_0x343d5f[_0x33bb('0x45')][_0x33bb('0xcf')]('nolimit')){_0x2aa787[_0x33bb('0x26')]=qs['limit'](_0x343d5f[_0x33bb('0x45')]['limit']);_0x2aa787['offset']=qs[_0x33bb('0x23')](_0x343d5f[_0x33bb('0x45')]['offset']);}_0x2aa787[_0x33bb('0xd4')]=qs['sort'](_0x343d5f[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x2aa787[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x343d5f[_0x33bb('0x45')],_0x20ab16[_0x33bb('0xd3')]));_0x2aa787[_0x33bb('0x44')][_0x33bb('0xde')]=_0x42a5f3['id'];if(_0x343d5f['query']['filter']){_0x2aa787[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x2aa787[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x2aa787['attributes'],function(_0x147bfa){var _0x28d370={};_0x28d370[_0x147bfa]={'$like':'%'+_0x343d5f[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x28d370;})});}_0x2aa787=_[_0x33bb('0x5e')]({},_0x2aa787,_0x343d5f[_0x33bb('0x5f')]);return db[_0x33bb('0xdd')][_0x33bb('0x25')]({'where':_0x2aa787[_0x33bb('0x44')]})[_0x33bb('0x15')](function(_0x1dc85f){_0x4da635['count']=_0x1dc85f;if(_0x343d5f['query']['includeAll']){_0x2aa787[_0x33bb('0x47')]=[{'all':!![]}];}return db[_0x33bb('0xdd')]['findAll'](_0x2aa787);})[_0x33bb('0x15')](function(_0x3dbbcb){_0x4da635[_0x33bb('0x4e')]=_0x3dbbcb;return _0x4da635;});}})[_0x33bb('0x15')](respondWithFilteredResult(_0x33900e,_0x2aa787))[_0x33bb('0x1f')](handleError(_0x33900e,null));};exports[_0x33bb('0xdf')]=function(_0x5a90f0,_0xfdf667){var _0x2c8132={'raw':!![],'where':{}};var _0x32004d={};var _0x46d74b={'count':0x0,'rows':[]};return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x5a90f0[_0x33bb('0x57')]['id']}})['then'](handleEntityNotFound(_0xfdf667,null))[_0x33bb('0x15')](function(_0x47743f){if(_0x47743f){_0x32004d['model']=_['keys'](db[_0x33bb('0xe0')][_0x33bb('0x3d')]);_0x32004d['query']=_['keys'](_0x5a90f0[_0x33bb('0x45')]);_0x32004d[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x32004d[_0x33bb('0x58')],_0x32004d[_0x33bb('0x45')]);_0x2c8132['attributes']=_[_0x33bb('0x5c')](_0x32004d[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x2c8132[_0x33bb('0x4b')]=_0x2c8132['attributes'][_0x33bb('0x50')]?_0x2c8132[_0x33bb('0x4b')]:_0x32004d[_0x33bb('0x58')];if(!_0x5a90f0[_0x33bb('0x45')][_0x33bb('0xcf')]('nolimit')){_0x2c8132[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x26')]);_0x2c8132['offset']=qs[_0x33bb('0x23')](_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x23')]);}_0x2c8132['order']=qs[_0x33bb('0xd5')](_0x5a90f0['query']['sort']);_0x2c8132[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_['pick'](_0x5a90f0[_0x33bb('0x45')],_0x32004d[_0x33bb('0xd3')]));_0x2c8132[_0x33bb('0x44')]['UserId']=_0x47743f['id'];if(_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x32')]){_0x2c8132[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x2c8132[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x2c8132[_0x33bb('0x4b')],function(_0x325b7a){var _0x53fc4a={};_0x53fc4a[_0x325b7a]={'$like':'%'+_0x5a90f0['query'][_0x33bb('0x32')]+'%'};return _0x53fc4a;})});}_0x2c8132=_[_0x33bb('0x5e')]({},_0x2c8132,_0x5a90f0['options']);return db[_0x33bb('0xe0')][_0x33bb('0x25')]({'where':_0x2c8132[_0x33bb('0x44')]})[_0x33bb('0x15')](function(_0x5b57dd){_0x46d74b[_0x33bb('0x25')]=_0x5b57dd;if(_0x5a90f0[_0x33bb('0x45')][_0x33bb('0x46')]){_0x2c8132[_0x33bb('0x47')]=[{'all':!![]}];}return db[_0x33bb('0xe0')][_0x33bb('0x4d')](_0x2c8132);})[_0x33bb('0x15')](function(_0x17aa57){_0x46d74b[_0x33bb('0x4e')]=_0x17aa57;return _0x46d74b;});}})['then'](respondWithFilteredResult(_0xfdf667,_0x2c8132))[_0x33bb('0x1f')](handleError(_0xfdf667,null));};exports[_0x33bb('0xe1')]=function(_0x4c5fb6,_0x7313a0){var _0x49fc3c={};var _0x26e1a1={};var _0x1ebc9a;var _0x4269e1;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x4c5fb6[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x7313a0,null))[_0x33bb('0x15')](function(_0x2aaa4e){if(_0x2aaa4e){_0x1ebc9a=_0x2aaa4e;_0x26e1a1[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe2')][_0x33bb('0x3d')]);_0x26e1a1[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x4c5fb6['query']);_0x26e1a1[_0x33bb('0xd3')]=_['intersection'](_0x26e1a1[_0x33bb('0x58')],_0x26e1a1[_0x33bb('0x45')]);_0x49fc3c['attributes']=_[_0x33bb('0x5c')](_0x26e1a1[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x49fc3c['attributes']=_0x49fc3c['attributes'][_0x33bb('0x50')]?_0x49fc3c[_0x33bb('0x4b')]:_0x26e1a1['model'];_0x49fc3c[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x49fc3c[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x4c5fb6[_0x33bb('0x45')],_0x26e1a1[_0x33bb('0xd3')]));if(_0x4c5fb6[_0x33bb('0x45')]['filter']){_0x49fc3c[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x49fc3c[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x49fc3c[_0x33bb('0x4b')],function(_0x4cf0cd){var _0x329b81={};_0x329b81[_0x4cf0cd]={'$like':'%'+_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x329b81;})});}_0x49fc3c=_[_0x33bb('0x5e')]({},_0x49fc3c,_0x4c5fb6['options']);return _0x1ebc9a['getChatInteractions'](_0x49fc3c);}})[_0x33bb('0x15')](function(_0x498a1b){if(_0x498a1b){_0x4269e1=_0x498a1b[_0x33bb('0x50')];if(!_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x49fc3c['limit']=qs[_0x33bb('0x26')](_0x4c5fb6[_0x33bb('0x45')][_0x33bb('0x26')]);_0x49fc3c['offset']=qs['offset'](_0x4c5fb6['query'][_0x33bb('0x23')]);}return _0x1ebc9a[_0x33bb('0xe1')](_0x49fc3c);}})['then'](function(_0x1c5902){if(_0x1c5902){return _0x1c5902?{'count':_0x4269e1,'rows':_0x1c5902}:null;}})[_0x33bb('0x15')](respondWithResult(_0x7313a0,null))[_0x33bb('0x1f')](handleError(_0x7313a0,null));};exports[_0x33bb('0xe3')]=function(_0x16f398,_0x342999){var _0xa4cbbe={};var _0x49e500={};var _0x225f2f;var _0x541906;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x16f398['params']['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x342999,null))['then'](function(_0x355fd6){if(_0x355fd6){_0x225f2f=_0x355fd6;_0x49e500[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe4')][_0x33bb('0x3d')]);_0x49e500[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x16f398[_0x33bb('0x45')]);_0x49e500[_0x33bb('0xd3')]=_['intersection'](_0x49e500['model'],_0x49e500[_0x33bb('0x45')]);_0xa4cbbe[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x49e500['model'],qs[_0x33bb('0x5d')](_0x16f398[_0x33bb('0x45')][_0x33bb('0x5d')]));_0xa4cbbe[_0x33bb('0x4b')]=_0xa4cbbe[_0x33bb('0x4b')][_0x33bb('0x50')]?_0xa4cbbe[_0x33bb('0x4b')]:_0x49e500[_0x33bb('0x58')];_0xa4cbbe[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x16f398[_0x33bb('0x45')][_0x33bb('0xd5')]);_0xa4cbbe[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x16f398[_0x33bb('0x45')],_0x49e500['filters']));if(_0x16f398[_0x33bb('0x45')]['filter']){_0xa4cbbe['where']=_['merge'](_0xa4cbbe[_0x33bb('0x44')],{'$or':_['map'](_0xa4cbbe['attributes'],function(_0x4ac6ab){var _0x311bdc={};_0x311bdc[_0x4ac6ab]={'$like':'%'+_0x16f398[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x311bdc;})});}_0xa4cbbe=_[_0x33bb('0x5e')]({},_0xa4cbbe,_0x16f398['options']);return _0x225f2f['getOpenchannelInteractions'](_0xa4cbbe);}})[_0x33bb('0x15')](function(_0x2d3e4d){if(_0x2d3e4d){_0x541906=_0x2d3e4d[_0x33bb('0x50')];if(!_0x16f398[_0x33bb('0x45')]['hasOwnProperty']('nolimit')){_0xa4cbbe['limit']=qs['limit'](_0x16f398['query'][_0x33bb('0x26')]);_0xa4cbbe[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x16f398['query'][_0x33bb('0x23')]);}return _0x225f2f[_0x33bb('0xe3')](_0xa4cbbe);}})[_0x33bb('0x15')](function(_0x59117b){if(_0x59117b){return _0x59117b?{'count':_0x541906,'rows':_0x59117b}:null;}})['then'](respondWithResult(_0x342999,null))[_0x33bb('0x1f')](handleError(_0x342999,null));};exports[_0x33bb('0xe5')]=function(_0x597be5,_0x26d8d1){var _0x2b0b7c={'raw':!![],'where':{}};var _0x41b06f={};var _0x1e7bc1={'count':0x0,'rows':[]};return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x597be5[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x26d8d1,null))[_0x33bb('0x15')](function(_0x36faae){if(_0x36faae){_0x41b06f[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe6')][_0x33bb('0x3d')]);_0x41b06f['query']=_['keys'](_0x597be5[_0x33bb('0x45')]);_0x41b06f[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x41b06f['model'],_0x41b06f['query']);_0x2b0b7c['attributes']=_[_0x33bb('0x5c')](_0x41b06f[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x597be5[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x2b0b7c[_0x33bb('0x4b')]=_0x2b0b7c[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x2b0b7c[_0x33bb('0x4b')]:_0x41b06f[_0x33bb('0x58')];if(!_0x597be5[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x2b0b7c['limit']=qs[_0x33bb('0x26')](_0x597be5[_0x33bb('0x45')][_0x33bb('0x26')]);_0x2b0b7c[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x597be5['query'][_0x33bb('0x23')]);}_0x2b0b7c['order']=qs['sort'](_0x597be5[_0x33bb('0x45')]['sort']);_0x2b0b7c[_0x33bb('0x44')]=qs['filters'](_[_0x33bb('0xd6')](_0x597be5[_0x33bb('0x45')],_0x41b06f['filters']));_0x2b0b7c[_0x33bb('0x44')][_0x33bb('0xde')]=_0x36faae['id'];if(_0x597be5[_0x33bb('0x45')][_0x33bb('0x32')]){_0x2b0b7c[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x2b0b7c[_0x33bb('0x44')],{'$or':_['map'](_0x2b0b7c[_0x33bb('0x4b')],function(_0x8345af){var _0x1327b5={};_0x1327b5[_0x8345af]={'$like':'%'+_0x597be5[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x1327b5;})});}_0x2b0b7c=_[_0x33bb('0x5e')]({},_0x2b0b7c,_0x597be5[_0x33bb('0x5f')]);return db[_0x33bb('0xe6')][_0x33bb('0x25')]({'where':_0x2b0b7c[_0x33bb('0x44')]})[_0x33bb('0x15')](function(_0x30a73f){_0x1e7bc1[_0x33bb('0x25')]=_0x30a73f;if(_0x597be5[_0x33bb('0x45')][_0x33bb('0x46')]){_0x2b0b7c[_0x33bb('0x47')]=[{'all':!![]}];}return db[_0x33bb('0xe6')][_0x33bb('0x4d')](_0x2b0b7c);})[_0x33bb('0x15')](function(_0x37b1f3){_0x1e7bc1[_0x33bb('0x4e')]=_0x37b1f3;return _0x1e7bc1;});}})[_0x33bb('0x15')](respondWithFilteredResult(_0x26d8d1,_0x2b0b7c))['catch'](handleError(_0x26d8d1,null));};exports[_0x33bb('0xe7')]=function(_0x20a450,_0x50c803){var _0x321c98={};var _0x2cea6b={};var _0x102874;var _0x3736b4;return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x20a450[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x50c803,null))['then'](function(_0x1a9dc2){if(_0x1a9dc2){_0x102874=_0x1a9dc2;_0x2cea6b[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe8')][_0x33bb('0x3d')]);_0x2cea6b[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x20a450[_0x33bb('0x45')]);_0x2cea6b[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x2cea6b[_0x33bb('0x58')],_0x2cea6b[_0x33bb('0x45')]);_0x321c98[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x2cea6b[_0x33bb('0x58')],qs[_0x33bb('0x5d')](_0x20a450[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x321c98['attributes']=_0x321c98['attributes']['length']?_0x321c98[_0x33bb('0x4b')]:_0x2cea6b[_0x33bb('0x58')];_0x321c98[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x20a450['query'][_0x33bb('0xd5')]);_0x321c98['where']=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x20a450['query'],_0x2cea6b['filters']));if(_0x20a450['query'][_0x33bb('0x32')]){_0x321c98[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x321c98[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x321c98[_0x33bb('0x4b')],function(_0x27f674){var _0x25e107={};_0x25e107[_0x27f674]={'$like':'%'+_0x20a450[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x25e107;})});}_0x321c98=_[_0x33bb('0x5e')]({},_0x321c98,_0x20a450[_0x33bb('0x5f')]);return _0x102874[_0x33bb('0xe7')](_0x321c98);}})[_0x33bb('0x15')](function(_0x856ad0){if(_0x856ad0){_0x3736b4=_0x856ad0[_0x33bb('0x50')];if(!_0x20a450['query'][_0x33bb('0xcf')]('nolimit')){_0x321c98['limit']=qs['limit'](_0x20a450[_0x33bb('0x45')][_0x33bb('0x26')]);_0x321c98[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x20a450[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x102874[_0x33bb('0xe7')](_0x321c98);}})['then'](function(_0x5915b0){if(_0x5915b0){return _0x5915b0?{'count':_0x3736b4,'rows':_0x5915b0}:null;}})['then'](respondWithResult(_0x50c803,null))[_0x33bb('0x1f')](handleError(_0x50c803,null));};exports['getFaxInteractions']=function(_0x3666d7,_0xe55e46){var _0x56a560={};var _0x3ea7b8={};var _0x266fd7;var _0x5fc823;return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x3666d7[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0xe55e46,null))[_0x33bb('0x15')](function(_0x331724){if(_0x331724){_0x266fd7=_0x331724;_0x3ea7b8[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0xe9')][_0x33bb('0x3d')]);_0x3ea7b8[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x3666d7[_0x33bb('0x45')]);_0x3ea7b8[_0x33bb('0xd3')]=_['intersection'](_0x3ea7b8[_0x33bb('0x58')],_0x3ea7b8['query']);_0x56a560[_0x33bb('0x4b')]=_['intersection'](_0x3ea7b8[_0x33bb('0x58')],qs['fields'](_0x3666d7[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x56a560[_0x33bb('0x4b')]=_0x56a560[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x56a560[_0x33bb('0x4b')]:_0x3ea7b8[_0x33bb('0x58')];_0x56a560['order']=qs[_0x33bb('0xd5')](_0x3666d7[_0x33bb('0x45')]['sort']);_0x56a560[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_['pick'](_0x3666d7[_0x33bb('0x45')],_0x3ea7b8[_0x33bb('0xd3')]));if(_0x3666d7[_0x33bb('0x45')][_0x33bb('0x32')]){_0x56a560[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x56a560[_0x33bb('0x44')],{'$or':_[_0x33bb('0x34')](_0x56a560[_0x33bb('0x4b')],function(_0x5f4218){var _0x1d306d={};_0x1d306d[_0x5f4218]={'$like':'%'+_0x3666d7[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x1d306d;})});}_0x56a560=_[_0x33bb('0x5e')]({},_0x56a560,_0x3666d7[_0x33bb('0x5f')]);return _0x266fd7['getFaxInteractions'](_0x56a560);}})['then'](function(_0x4659eb){if(_0x4659eb){_0x5fc823=_0x4659eb[_0x33bb('0x50')];if(!_0x3666d7['query']['hasOwnProperty'](_0x33bb('0xd9'))){_0x56a560['limit']=qs[_0x33bb('0x26')](_0x3666d7[_0x33bb('0x45')][_0x33bb('0x26')]);_0x56a560[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x3666d7[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x266fd7[_0x33bb('0xea')](_0x56a560);}})[_0x33bb('0x15')](function(_0x2aa03c){if(_0x2aa03c){return _0x2aa03c?{'count':_0x5fc823,'rows':_0x2aa03c}:null;}})[_0x33bb('0x15')](respondWithResult(_0xe55e46,null))[_0x33bb('0x1f')](handleError(_0xe55e46,null));};exports[_0x33bb('0xeb')]=function(_0x339b64,_0x59ccce){var _0x5ce6f6={};var _0x4ec19c={};var _0x3af239;var _0x19055d;return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x339b64[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x59ccce,null))[_0x33bb('0x15')](function(_0x46a801){if(_0x46a801){_0x3af239=_0x46a801;_0x4ec19c[_0x33bb('0x58')]=_['keys'](db[_0x33bb('0xec')][_0x33bb('0x3d')]);_0x4ec19c[_0x33bb('0x45')]=_['keys'](_0x339b64[_0x33bb('0x45')]);_0x4ec19c['filters']=_[_0x33bb('0x5c')](_0x4ec19c[_0x33bb('0x58')],_0x4ec19c[_0x33bb('0x45')]);_0x5ce6f6['attributes']=_[_0x33bb('0x5c')](_0x4ec19c['model'],qs[_0x33bb('0x5d')](_0x339b64['query'][_0x33bb('0x5d')]));_0x5ce6f6[_0x33bb('0x4b')]=_0x5ce6f6[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x5ce6f6['attributes']:_0x4ec19c[_0x33bb('0x58')];_0x5ce6f6[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x339b64[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x5ce6f6[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x339b64[_0x33bb('0x45')],_0x4ec19c[_0x33bb('0xd3')]));if(_0x339b64[_0x33bb('0x45')]['filter']){_0x5ce6f6[_0x33bb('0x44')]=_['merge'](_0x5ce6f6[_0x33bb('0x44')],{'$or':_['map'](_0x5ce6f6['attributes'],function(_0x528de6){var _0x2177fe={};_0x2177fe[_0x528de6]={'$like':'%'+_0x339b64[_0x33bb('0x45')]['filter']+'%'};return _0x2177fe;})});}_0x5ce6f6=_[_0x33bb('0x5e')]({},_0x5ce6f6,_0x339b64[_0x33bb('0x5f')]);return _0x3af239[_0x33bb('0xeb')](_0x5ce6f6);}})['then'](function(_0x1eaf36){if(_0x1eaf36){_0x19055d=_0x1eaf36[_0x33bb('0x50')];if(!_0x339b64[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0x5ce6f6[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x339b64[_0x33bb('0x45')][_0x33bb('0x26')]);_0x5ce6f6['offset']=qs[_0x33bb('0x23')](_0x339b64['query'][_0x33bb('0x23')]);}return _0x3af239[_0x33bb('0xeb')](_0x5ce6f6);}})[_0x33bb('0x15')](function(_0x38865e){if(_0x38865e){return _0x38865e?{'count':_0x19055d,'rows':_0x38865e}:null;}})[_0x33bb('0x15')](respondWithResult(_0x59ccce,null))[_0x33bb('0x1f')](handleError(_0x59ccce,null));};exports[_0x33bb('0xed')]=function(_0x25f861,_0xca5ea9,_0x392ee2){var _0x2eb1cf;var _0x4b680c;var _0xc35bdb;var _0x3c2eb7=!_['isNil'](_0x25f861[_0x33bb('0x57')]['id'])?_0x25f861[_0x33bb('0x57')]['id']:!_[_0x33bb('0x6a')](_0x25f861['user']['id'])?_0x25f861[_0x33bb('0x31')]['id']:null;return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x3c2eb7,'role':{'$or':[_0x33bb('0x2f'),_0x33bb('0x31'),_0x33bb('0x90')]}},'attributes':['id',_0x33bb('0x37'),_0x33bb('0xee'),'mobile',_0x33bb('0x2e'),_0x33bb('0x65'),_0x33bb('0xa3')]})['then'](function(_0x343ad0){if(_0x343ad0){if(_0x343ad0['role']==='agent'){_0x2eb1cf=_0x343ad0;if(_0x25f861[_0x33bb('0x62')]['interface']){_0xc35bdb=util[_0x33bb('0xb2')](_0x33bb('0xef'),_0x2eb1cf[_0x25f861['body'][_0x33bb('0xa5')]]);}else if(_0x25f861['body'][_0x33bb('0xf0')]){_0xc35bdb=util['format'](_0x33bb('0xf1'),_0x25f861[_0x33bb('0x62')][_0x33bb('0xf0')]);}else{_0xc35bdb=util['format'](_0x33bb('0xf1'),_0x2eb1cf[_0x33bb('0x37')]);}socket['to'](util[_0x33bb('0xb2')](_0x33bb('0xf2'),_0x2eb1cf[_0x33bb('0x37')]))[_0x33bb('0x2a')](_0x33bb('0xf3'),{'user':{'id':_0x2eb1cf['id'],'name':_0x2eb1cf['name']},'ip':_0x25f861[_0x33bb('0xf4')][_0x33bb('0xf5')]||_0x25f861['connection'][_0x33bb('0xf6')]||_0x25f861[_0x33bb('0xf7')]['remoteAddress']||_0x25f861[_0x33bb('0xf8')][_0x33bb('0xf7')]['remoteAddress']});return db[_0x33bb('0xb6')][_0x33bb('0x2c')]({'where':{'membername':_0x2eb1cf[_0x33bb('0x37')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x33bb('0x96'))](_0x33bb('0xf9'));}})[_0x33bb('0x15')](function(){if(_0x2eb1cf){return _0x2eb1cf[_0x33bb('0xfa')]({'raw':!![]});}})[_0x33bb('0x15')](function(_0x441d5f){if(_0x2eb1cf){if(_0x441d5f){_0x4b680c=_0x441d5f;if(_0x4b680c[_0x33bb('0x50')]){var _0x13a840=_0x4b680c[_0x33bb('0x34')](function(_0x4a5a29){var _0x230bb9={'membername':_0x2eb1cf[_0x33bb('0x37')],'UserId':_0x2eb1cf['id'],'queue_name':_0x4a5a29['name'],'VoiceQueueId':_0x4a5a29['id'],'interface':_0xc35bdb,'paused':_0x2eb1cf[_0x33bb('0xa3')]||![],'penalty':_0x4a5a29['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x33bb('0xfb')](_0x230bb9);});return Promise[_0x33bb('0x61')](_0x13a840);}}}})['then'](function(){if(_0x2eb1cf){return db[_0x33bb('0xfc')][_0x33bb('0x4d')]({'where':{'membername':_0x2eb1cf['name'],'exitAt':null}});}})['then'](function(_0x3498b2){if(_0x2eb1cf){var _0x5b519d=[];_0x3498b2[_0x33bb('0xfd')](function(_0x2c2664){_0x5b519d[_0x33bb('0x4c')](_0x2c2664[_0x33bb('0x29')]({'exitAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))}));});return Promise[_0x33bb('0x61')](_0x5b519d);}})[_0x33bb('0x15')](function(){if(_0x2eb1cf){var _0x1a9551=[];var _0x1623a9=[];var _0x4b99af=utils[_0x33bb('0xff')]();var _0x34663a={'membername':_0x2eb1cf[_0x33bb('0x37')],'interface':_0xc35bdb,'enterAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe')),'role':_0x2eb1cf[_0x33bb('0x2e')],'internal':_0x2eb1cf['internal']};_0x4b99af['forEach'](function(_0x4130d0){_0x1a9551[_0x33bb('0x4c')](_[_0x33bb('0x5e')]({'channel':_0x4130d0,'type':_0x33bb('0x100'),'data1':_0x25f861[_0x33bb('0x62')][_0x33bb('0x101')],'data2':_0xc35bdb},_0x34663a));if(_0x2eb1cf['loginInPause']){_0x1623a9[_0x33bb('0x4c')](_[_0x33bb('0x5e')]({'channel':_0x4130d0,'type':_0x33bb('0x102'),'data1':_0x33bb('0x103')},_0x34663a));}});return db[_0x33bb('0xfc')][_0x33bb('0x8f')](_0x1a9551['concat'](_0x1623a9),{'individualHooks':!![]});}})[_0x33bb('0x15')](function(){if(_0x2eb1cf){return _0x2eb1cf[_0x33bb('0x29')]({'online':!![],'lastLoginAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe')),'voicePause':_0x2eb1cf['loginInPause']||![],'mailPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'chatPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'faxPause':_0x2eb1cf['loginInPause']||![],'smsPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'openchannelPause':_0x2eb1cf['loginInPause']||![],'whatsappPause':_0x2eb1cf[_0x33bb('0xa3')]||![],'pauseType':_0x2eb1cf[_0x33bb('0xa3')]?_0x33bb('0x103'):null,'interface':_0xc35bdb,'lastPauseAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))});}})[_0x33bb('0x15')](function(_0x3de7d7){if(_0x25f861['isMiddleware']){return _0x392ee2();}else{return Promise[_0x33bb('0x104')](_0x3de7d7)['then'](respondWithResult(_0xca5ea9,null));}})['catch'](handleError(_0xca5ea9,null));};exports[_0x33bb('0x105')]=function(_0x2e7e80,_0x2991b6){var _0x18c7e6;return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x2e7e80[_0x33bb('0x57')]['id'],'role':_0x33bb('0x90')},'attributes':['id',_0x33bb('0x37'),'role']})[_0x33bb('0x15')](handleEntityNotFound(_0x2991b6,null))[_0x33bb('0x15')](function(_0xd77f83){if(_0xd77f83){_0x18c7e6=_0xd77f83;return db[_0x33bb('0xb6')][_0x33bb('0x2c')]({'where':{'membername':_0x18c7e6[_0x33bb('0x37')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport'][_0x33bb('0x4d')]({'where':{'membername':_0x18c7e6[_0x33bb('0x37')],'exitAt':null}});})[_0x33bb('0x15')](function(_0x54c987){var _0x35b366=[];_0x54c987['forEach'](function(_0x1c5954){_0x35b366[_0x33bb('0x4c')](_0x1c5954[_0x33bb('0x29')]({'exitAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))}));});return Promise[_0x33bb('0x61')](_0x35b366);})[_0x33bb('0x15')](function(){return _0x18c7e6[_0x33bb('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x33bb('0x15')](respondWithResult(_0x2991b6,null))[_0x33bb('0x1f')](handleError(_0x2991b6,null));};exports[_0x33bb('0x106')]=function(_0x3e881d,_0x518938){var _0x5d6539;return db[_0x33bb('0xb6')][_0x33bb('0x29')]({'paused':0x1},{'where':{'UserId':_0x3e881d[_0x33bb('0x57')]['id']},'individualHooks':!![]})[_0x33bb('0x15')](function(){return db[_0x33bb('0x3c')][_0x33bb('0x36')]({'where':{'id':_0x3e881d[_0x33bb('0x57')]['id'],'role':_0x33bb('0x90')},'attributes':['id',_0x33bb('0x37'),_0x33bb('0x2e'),_0x33bb('0x65'),_0x33bb('0xa5'),'online']});})[_0x33bb('0x15')](handleEntityNotFound(_0x518938,null))[_0x33bb('0x15')](function(_0x276852){if(_0x276852){_0x5d6539=_0x276852;return respondWithRpcPromise(_0x33bb('0x107'),_0x33bb('0x106'),{'id':_0x5d6539['id'],'name':_0x5d6539[_0x33bb('0x37')],'pause':!![]});}})[_0x33bb('0x15')](function(){if(_0x5d6539){return db[_0x33bb('0xfc')][_0x33bb('0x4d')]({'where':{'membername':_0x5d6539[_0x33bb('0x37')],'type':_0x33bb('0x102'),'exitAt':null}});}})[_0x33bb('0x15')](function(_0x5b0bd3){if(_0x5b0bd3['length']){var _0x439242=moment()[_0x33bb('0xb2')](_0x33bb('0xfe'));for(var _0x50fe6a=0x0,_0x51db53=_0x5b0bd3[_0x33bb('0x50')];_0x50fe6a<_0x51db53;_0x50fe6a++){_0x5b0bd3[_0x50fe6a]['updateAttributes']({'exitAt':_0x439242});}}})[_0x33bb('0x15')](function(){var _0x133c8a=[];var _0x2038af=utils['getChannels']();_0x2038af[_0x33bb('0xfd')](function(_0x30f478){_0x133c8a[_0x33bb('0x4c')]({'channel':_0x30f478,'membername':_0x5d6539[_0x33bb('0x37')],'interface':_[_0x33bb('0x6a')](_0x5d6539['interface'])?util[_0x33bb('0xb2')](_0x33bb('0xf1'),_0x5d6539['name']):_0x5d6539[_0x33bb('0xa5')],'type':_0x33bb('0x102'),'enterAt':moment()['format'](_0x33bb('0xfe')),'data1':_0x3e881d[_0x33bb('0x62')]['type']||_0x33bb('0x108'),'role':_0x5d6539[_0x33bb('0x2e')],'internal':_0x5d6539[_0x33bb('0x65')]});});return db[_0x33bb('0xfc')][_0x33bb('0x8f')](_0x133c8a,{'individualHooks':!![]});})[_0x33bb('0x15')](function(){return _0x5d6539[_0x33bb('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3e881d['body'][_0x33bb('0x3f')]||_0x33bb('0x108'),'lastPauseAt':moment()[_0x33bb('0xb2')](_0x33bb('0xfe'))});})[_0x33bb('0x15')](respondWithResult(_0x518938,null))[_0x33bb('0x1f')](handleError(_0x518938,null));};exports[_0x33bb('0x109')]=function(_0x3706ae,_0x559846){if(_0x3706ae[_0x33bb('0x62')]['channel']&&!utils[_0x33bb('0xa6')](_0x3706ae['body'][_0x33bb('0xa1')])){throw new APIBadRequestError(util['format'](_0x33bb('0x10a'),_0x3706ae[_0x33bb('0x62')]['channel']));}return db[_0x33bb('0x3c')]['find']({'where':{'id':_0x3706ae[_0x33bb('0x57')]['id']},'attributes':['id',_0x33bb('0x37'),_0x33bb('0x2e'),_0x33bb('0x65'),_0x33bb('0xa5'),_0x33bb('0xa2'),_0x33bb('0xa4'),_0x33bb('0x10b'),_0x33bb('0x10c'),_0x33bb('0x10d'),_0x33bb('0x10e'),_0x33bb('0x10f'),'whatsappPause','pauseType',_0x33bb('0x110')]})['then'](function(_0x58d00f){if(!_0x58d00f){throw new APINotFoundError(util[_0x33bb('0xb2')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3706ae[_0x33bb('0x57')]['id']));}return _0x58d00f[_0x33bb('0x109')](_0x3706ae[_0x33bb('0x62')][_0x33bb('0xa1')]);})['then'](respondWithResult(_0x559846,null))['catch'](APIHandleError(_0x559846));};exports[_0x33bb('0x111')]=function(_0x3d563b,_0x4f1c05){var _0xb8af06={};var _0x1f075c={};var _0x1da88f;var _0x20b456;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x3d563b[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x4f1c05,null))[_0x33bb('0x15')](function(_0x5510ac){if(_0x5510ac){_0x1da88f=_0x5510ac;_0x1f075c['model']=_['keys'](db[_0x33bb('0x112')][_0x33bb('0x3d')]);_0x1f075c[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x3d563b['query']);_0x1f075c[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x1f075c[_0x33bb('0x58')],_0x1f075c['query']);_0xb8af06[_0x33bb('0x4b')]=_['intersection'](_0x1f075c['model'],qs[_0x33bb('0x5d')](_0x3d563b[_0x33bb('0x45')][_0x33bb('0x5d')]));_0xb8af06['attributes']=_0xb8af06[_0x33bb('0x4b')][_0x33bb('0x50')]?_0xb8af06[_0x33bb('0x4b')]:_0x1f075c[_0x33bb('0x58')];_0xb8af06['order']=qs['sort'](_0x3d563b[_0x33bb('0x45')][_0x33bb('0xd5')]);_0xb8af06['where']=qs['filters'](_['pick'](_0x3d563b[_0x33bb('0x45')],_0x1f075c[_0x33bb('0xd3')]));if(_0x3d563b[_0x33bb('0x45')][_0x33bb('0x32')]){_0xb8af06[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0xb8af06['where'],{'$or':_[_0x33bb('0x34')](_0xb8af06[_0x33bb('0x4b')],function(_0x3b3041){var _0x13133e={};_0x13133e[_0x3b3041]={'$like':'%'+_0x3d563b['query']['filter']+'%'};return _0x13133e;})});}_0xb8af06=_[_0x33bb('0x5e')]({},_0xb8af06,_0x3d563b[_0x33bb('0x5f')]);return _0x1da88f[_0x33bb('0x111')](_0xb8af06);}})[_0x33bb('0x15')](function(_0x532289){if(_0x532289){_0x20b456=_0x532289['length'];if(!_0x3d563b[_0x33bb('0x45')][_0x33bb('0xcf')](_0x33bb('0xd9'))){_0xb8af06[_0x33bb('0x26')]=qs['limit'](_0x3d563b[_0x33bb('0x45')]['limit']);_0xb8af06[_0x33bb('0x23')]=qs[_0x33bb('0x23')](_0x3d563b[_0x33bb('0x45')]['offset']);}return _0x1da88f['getTeams'](_0xb8af06);}})[_0x33bb('0x15')](function(_0x597b62){if(_0x597b62){return _0x597b62?{'count':_0x20b456,'rows':_0x597b62}:null;}})[_0x33bb('0x15')](respondWithResult(_0x4f1c05,null))[_0x33bb('0x1f')](handleError(_0x4f1c05,null));};exports[_0x33bb('0x113')]=function(_0x45936c,_0x528015){var _0x48febe=_0x45936c[_0x33bb('0x57')]['id'];var _0x5789f9=_0x45936c[_0x33bb('0x62')]?_0x45936c[_0x33bb('0x62')]['ids']:null;var _0x58e70c=[];return Promise['resolve']()[_0x33bb('0x15')](function(){if(!_0x5789f9)throw new APIBadRequestError(_0x33bb('0x114'));})[_0x33bb('0x15')](function(){return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x48febe}});})['then'](function(_0x58be1f){if(!_0x58be1f)throw new APINotFoundError(util[_0x33bb('0xb2')](_0x33bb('0x115'),_0x45936c[_0x33bb('0x57')]['id']));return db[_0x33bb('0x116')]['transaction'](function(_0xb76073){return _0x58be1f['addTeams'](_0x5789f9,{'transaction':_0xb76073})[_0x33bb('0x15')](function(){return db[_0x33bb('0x112')]['findAll']({'where':{'id':{'$in':_0x5789f9}}});})[_0x33bb('0x15')](function(_0x39e354){var _0x2bee8c=_['map'](_0x39e354,function(_0x5d21c5){return _0x5d21c5[_0x33bb('0x117')]();});return Promise[_0x33bb('0x61')](_0x2bee8c);})[_0x33bb('0x15')](function(_0x497411){_0x58e70c=_[_0x33bb('0x118')](_0x497411);var _0x48098e=_[_0x33bb('0x34')](_0x58e70c,function(_0x1d2fdf){return _0x1d2fdf[_0x33bb('0x119')](_0x58be1f['id'],{'transaction':_0xb76073});});return Promise['all'](_0x48098e);})[_0x33bb('0x15')](function(){if(!_0x58be1f[_0x33bb('0xa2')])return;var _0x50af64=_[_0x33bb('0x32')](_0x58e70c,function(_0x41945e){return _0x41945e['getDataValue'](_0x33bb('0xa1'))===_0x33bb('0x11a');});var _0x4d6b15=_[_0x33bb('0x34')](_0x50af64,function(_0x279ab9){return db[_0x33bb('0xb6')]['upsert']({'membername':_0x58be1f[_0x33bb('0x37')],'UserId':_0x58be1f['id'],'queue_name':_0x279ab9[_0x33bb('0x37')],'VoiceQueueId':_0x279ab9['id'],'interface':_[_0x33bb('0x6a')](_0x58be1f[_0x33bb('0xa5')])?util[_0x33bb('0xb2')](_0x33bb('0xf1'),_0x58be1f[_0x33bb('0x37')]):_0x58be1f[_0x33bb('0xa5')],'paused':_0x58be1f[_0x33bb('0xa4')]||![],'penalty':_0x58be1f['penalty']},{'transaction':_0xb76073});});return Promise[_0x33bb('0x61')](_0x4d6b15);})[_0x33bb('0x15')](function(){return db['TeamVoicePrefix'][_0x33bb('0x4d')]({'where':{'teamId':{'$in':_0x5789f9}}});})[_0x33bb('0x15')](function(_0xbdeae8){var _0x491f1e=_[_0x33bb('0x34')](_0xbdeae8,function(_0x49a729){return db[_0x33bb('0x11b')]['create']({'UserId':_0x58be1f['id'],'VoicePrefixId':_0x49a729['VoicePrefixId']},{'transaction':_0xb76073});});return Promise[_0x33bb('0x61')](_0x491f1e);});});})[_0x33bb('0x15')](function(){for(var _0x2e00f0=0x0;_0x2e00f0<_0x58e70c[_0x33bb('0x50')];_0x2e00f0++){var _0x470bb2=_0x58e70c[_0x2e00f0][_0x33bb('0x11c')](_0x33bb('0xa1'));var _0x425b2a=_0x470bb2+'QueueId';socket[_0x33bb('0x2a')]('user'+_0x470bb2+_0x33bb('0xaf'),{'UserId':_0x48febe,['queueField']:_0x58e70c[_0x2e00f0]['id']});}})[_0x33bb('0x15')](respondWithStatusCode(_0x528015,null))['catch'](APIHandleError(_0x528015));};exports[_0x33bb('0x11d')]=function(_0xe159,_0x5b23fb){var _0x3dfb19=_0xe159[_0x33bb('0x57')]['id'];var _0x2d8179=null;if(_0xe159[_0x33bb('0x45')][_0x33bb('0x64')]){_0x2d8179=_[_0x33bb('0xb4')](_0xe159['query']['ids'])?_0xe159[_0x33bb('0x45')][_0x33bb('0x64')]:[_0xe159['query']['ids']];}var _0x3740e6=[];return Promise[_0x33bb('0x104')]()[_0x33bb('0x15')](function(){if(!_0x2d8179)throw new APIBadRequestError(_0x33bb('0x11e'));})[_0x33bb('0x15')](function(){return db[_0x33bb('0x3c')]['findOne']({'where':{'id':_0x3dfb19}});})['then'](function(_0x42f4e7){if(!_0x42f4e7)throw new APINotFoundError(util['format'](_0x33bb('0x115'),_0xe159[_0x33bb('0x57')]['id']));return db['sequelize'][_0x33bb('0x11f')](function(_0x30bd61){return _0x42f4e7[_0x33bb('0x11d')](_0x2d8179,{'transaction':_0x30bd61})[_0x33bb('0x15')](function(){return db[_0x33bb('0x112')][_0x33bb('0x4d')]({'where':{'id':{'$in':_0x2d8179}}});})['then'](function(_0x144542){var _0x267f39=_[_0x33bb('0x34')](_0x144542,function(_0x1d4728){return _0x1d4728['getAssociatedQueues']();});return Promise['all'](_0x267f39);})[_0x33bb('0x15')](function(_0x3b4fed){_0x3740e6=_[_0x33bb('0x118')](_0x3b4fed);var _0x590647=_[_0x33bb('0x34')](_0x3740e6,function(_0x57eea6){return _0x57eea6[_0x33bb('0x120')](_0x42f4e7['id'],{'transaction':_0x30bd61});});return Promise[_0x33bb('0x61')](_0x590647);})[_0x33bb('0x15')](function(){if(!_0x42f4e7[_0x33bb('0xa2')])return;var _0x42e9e4=_['filter'](_0x3740e6,function(_0x146f6e){return _0x146f6e[_0x33bb('0x11c')](_0x33bb('0xa1'))===_0x33bb('0x11a');});var _0x5e167b=_[_0x33bb('0x34')](_0x42e9e4,function(_0xebe97){return db[_0x33bb('0xb6')]['destroy']({'where':{'VoiceQueueId':_0xebe97['id'],'UserId':_0x42f4e7['id']},'transaction':_0x30bd61});});return Promise[_0x33bb('0x61')](_0x5e167b);})['then'](function(){return db[_0x33bb('0x121')][_0x33bb('0x4d')]({'where':{'teamId':{'$in':_0x2d8179}}});})[_0x33bb('0x15')](function(_0xca22d2){var _0xc896c3=_[_0x33bb('0x34')](_0xca22d2,function(_0xd15d5d){return db[_0x33bb('0x11b')][_0x33bb('0x2c')]({'where':{'UserId':_0x42f4e7['id'],'VoicePrefixId':_0xd15d5d[_0x33bb('0x122')]}},{'transaction':_0x30bd61});});return Promise[_0x33bb('0x61')](_0xc896c3);});});})['then'](function(){for(var _0x1e1273=0x0;_0x1e1273<_0x3740e6[_0x33bb('0x50')];_0x1e1273++){var _0x14dbec=_0x3740e6[_0x1e1273][_0x33bb('0x11c')](_0x33bb('0xa1'));var _0x3395fc=_0x14dbec+_0x33bb('0xae');socket[_0x33bb('0x2a')](_0x33bb('0x31')+_0x14dbec+_0x33bb('0xb5'),{'UserId':_0x3dfb19,['queueField']:_0x3740e6[_0x1e1273]['id']});}})[_0x33bb('0x15')](respondWithStatusCode(_0x5b23fb,null))[_0x33bb('0x1f')](APIHandleError(_0x5b23fb));};exports[_0x33bb('0x123')]=function(_0x2c697c,_0x16c854){var _0x3109b2={};var _0x2ba5f1={};var _0x2453cb;var _0x1ba896;return db['User'][_0x33bb('0x9b')]({'where':{'id':_0x2c697c[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x16c854,null))[_0x33bb('0x15')](function(_0x17dcfe){if(_0x17dcfe){_0x2453cb=_0x17dcfe;_0x2ba5f1[_0x33bb('0x58')]=_[_0x33bb('0x5a')](db[_0x33bb('0x124')][_0x33bb('0x3d')]);_0x2ba5f1[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x2c697c['query']);_0x2ba5f1['filters']=_[_0x33bb('0x5c')](_0x2ba5f1[_0x33bb('0x58')],_0x2ba5f1['query']);_0x3109b2[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x2ba5f1['model'],qs[_0x33bb('0x5d')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x3109b2[_0x33bb('0x4b')]=_0x3109b2[_0x33bb('0x4b')][_0x33bb('0x50')]?_0x3109b2['attributes']:_0x2ba5f1[_0x33bb('0x58')];_0x3109b2[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x3109b2[_0x33bb('0x44')]=qs[_0x33bb('0xd3')](_[_0x33bb('0xd6')](_0x2c697c[_0x33bb('0x45')],_0x2ba5f1[_0x33bb('0xd3')]));if(_0x2c697c['query'][_0x33bb('0x32')]){_0x3109b2[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x3109b2[_0x33bb('0x44')],{'$or':_['map'](_0x3109b2[_0x33bb('0x4b')],function(_0x4ea7e8){var _0x5936a1={};_0x5936a1[_0x4ea7e8]={'$like':'%'+_0x2c697c[_0x33bb('0x45')][_0x33bb('0x32')]+'%'};return _0x5936a1;})});}_0x3109b2=_[_0x33bb('0x5e')]({},_0x3109b2,_0x2c697c[_0x33bb('0x5f')]);return _0x2453cb[_0x33bb('0x123')](_0x3109b2);}})[_0x33bb('0x15')](function(_0x115d30){if(_0x115d30){_0x1ba896=_0x115d30[_0x33bb('0x50')];if(!_0x2c697c['query'][_0x33bb('0xcf')]('nolimit')){_0x3109b2[_0x33bb('0x26')]=qs[_0x33bb('0x26')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0x26')]);_0x3109b2['offset']=qs[_0x33bb('0x23')](_0x2c697c[_0x33bb('0x45')][_0x33bb('0x23')]);}return _0x2453cb[_0x33bb('0x123')](_0x3109b2);}})[_0x33bb('0x15')](function(_0x7f950){if(_0x7f950){return _0x7f950?{'count':_0x1ba896,'rows':_0x7f950}:null;}})[_0x33bb('0x15')](respondWithResult(_0x16c854,null))[_0x33bb('0x1f')](handleError(_0x16c854,null));};exports['getAgents']=function(_0x5e5f68,_0x451982){var _0x362475={};var _0x3b0974={};var _0x24353c;return db[_0x33bb('0x3c')][_0x33bb('0x9b')]({'where':{'id':_0x5e5f68[_0x33bb('0x57')]['id']}})[_0x33bb('0x15')](handleEntityNotFound(_0x451982,null))[_0x33bb('0x15')](function(_0x46db8a){if(_0x46db8a){_0x24353c=_0x46db8a;_0x3b0974['model']=_['keys'](db[_0x33bb('0x3c')]['rawAttributes']);_0x3b0974[_0x33bb('0x45')]=_[_0x33bb('0x5a')](_0x5e5f68[_0x33bb('0x45')]);_0x3b0974[_0x33bb('0xd3')]=_[_0x33bb('0x5c')](_0x3b0974[_0x33bb('0x58')],_0x3b0974['query']);_0x362475[_0x33bb('0x4b')]=_[_0x33bb('0x5c')](_0x3b0974[_0x33bb('0x58')],qs['fields'](_0x5e5f68[_0x33bb('0x45')][_0x33bb('0x5d')]));_0x362475[_0x33bb('0x4b')]=_0x362475['attributes']['length']?_0x362475[_0x33bb('0x4b')]:_0x3b0974[_0x33bb('0x58')];_0x362475[_0x33bb('0xd4')]=qs[_0x33bb('0xd5')](_0x5e5f68[_0x33bb('0x45')][_0x33bb('0xd5')]);_0x362475[_0x33bb('0x44')]=qs['filters'](_[_0x33bb('0xd6')](_0x5e5f68[_0x33bb('0x45')],_0x3b0974[_0x33bb('0xd3')]));if(_0x5e5f68[_0x33bb('0x45')]['filter']){_0x362475[_0x33bb('0x44')]=_[_0x33bb('0x5e')](_0x362475[_0x33bb('0x44')],{'$or':_['map'](_0x362475[_0x33bb('0x4b')],function(_0x2b39b1){var _0x592dec={};_0x592dec[_0x2b39b1]={'$like':'%'+_0x5e5f68[_0x33bb('0x45')]['filter']+'%'};return _0x592dec;})});}_0x362475[_0x33bb('0x58')]=db[_0x33bb('0x3c')];_0x362475['as']='Agents';_0x362475=_[_0x33bb('0x5e')]({},_0x362475,_0x5e5f68[_0x33bb('0x5f')]);return _0x24353c[_0x33bb('0xfa')]({'include':[_0x362475]});}})['then'](function(_0x1c7921){if(_0x1c7921){var _0x3b70d3={},_0x37d9ca=[];for(var _0x142ace=0x0;_0x142ace<_0x1c7921[_0x33bb('0x50')];_0x142ace+=0x1){for(var _0x4625c8=0x0,_0x52cf18;_0x4625c8<_0x1c7921[_0x142ace][_0x33bb('0x8b')][_0x33bb('0x50')];_0x4625c8+=0x1){_0x52cf18=_0x1c7921[_0x142ace][_0x33bb('0x8b')][_0x4625c8][_0x33bb('0x2d')]({'plain':!![]});_0x3b70d3[_0x52cf18['id']]=_0x52cf18;}}_0x3b70d3=_[_0x33bb('0x125')](_0x3b70d3);for(var _0x501d0b=qs[_0x33bb('0x23')](_0x5e5f68[_0x33bb('0x45')][_0x33bb('0x23')]);_0x501d0b<_0x3b70d3[_0x33bb('0x50')]&&_0x37d9ca[_0x33bb('0x50')]=_0x2171f4['agents']){throw new Error(_0x5717('0x4b'));}})['then'](function(){if(_0x356218){return db['UserVoiceQueueRt'][_0x5717('0x41')]({'where':{'membername':_0x356218[_0x5717('0x1e')]},'individualHooks':!![]});}})[_0x5717('0x15')](function(){if(_0x356218){return _0x356218['getVoiceQueues']({'raw':!![]});}})[_0x5717('0x15')](function(_0x1c560e){if(_0x356218){if(_0x1c560e){var _0x50243e=[];_0x6c0e89=_0x1c560e;if(_0x6c0e89[_0x5717('0x29')]){for(var _0x2f42dc=0x0;_0x2f42dc<_0x6c0e89[_0x5717('0x29')];_0x2f42dc++){_0x50243e[_0x5717('0x2b')](db[_0x5717('0x24')][_0x5717('0x4c')]({'membername':_0x356218['name'],'UserId':_0x356218['id'],'queue_name':_0x6c0e89[_0x2f42dc][_0x5717('0x1e')],'VoiceQueueId':_0x6c0e89[_0x2f42dc]['id'],'interface':_0x3b288a,'paused':_0x356218['loginInPause']||![],'penalty':_0x6c0e89[_0x2f42dc]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x50243e);}}}})[_0x5717('0x15')](function(){if(_0x356218){return db[_0x5717('0x26')][_0x5717('0xc')]({'where':{'membername':_0x356218[_0x5717('0x1e')],'exitAt':null}});}})[_0x5717('0x15')](function(_0x327cef){if(_0x356218){if(_0x327cef&&_0x327cef['length']){var _0x13c741=[];_0x327cef[_0x5717('0x4d')](function(_0x2b8a60){_0x13c741[_0x5717('0x2b')](_0x2b8a60['update']({'exitAt':moment()['format'](_0x5717('0x28'))}));});return BPromise[_0x5717('0x4e')](_0x13c741);}}})[_0x5717('0x15')](function(){if(_0x356218){var _0x3e81c6=[];var _0x5c5111=[];var _0x4fb34a=utils[_0x5717('0x4f')]();var _0x46f805={'membername':_0x356218['name'],'interface':_0x3b288a,'enterAt':moment()[_0x5717('0x21')](_0x5717('0x28')),'role':_0x356218[_0x5717('0x1f')],'internal':_0x356218[_0x5717('0x2f')]};_0x4fb34a[_0x5717('0x4d')](function(_0x286cba){_0x3e81c6[_0x5717('0x2b')](_['merge']({'channel':_0x286cba,'type':'LOGIN','data1':_0x5717('0x50'),'data2':_0x3b288a},_0x46f805));if(_0x356218[_0x5717('0x45')]){_0x5c5111['push'](_[_0x5717('0x51')]({'channel':_0x286cba,'type':_0x5717('0x27'),'data1':_0x5717('0x52')},_0x46f805));}});return db['MemberReport']['bulkCreate'](_0x3e81c6[_0x5717('0x53')](_0x5c5111),{'individualHooks':!![]});}})[_0x5717('0x15')](function(){if(_0x356218){return _0x356218[_0x5717('0x25')]({'online':!![],'lastLoginAt':moment()[_0x5717('0x21')](_0x5717('0x28')),'voicePause':_0x356218[_0x5717('0x45')]||![],'mailPause':_0x356218[_0x5717('0x45')]||![],'chatPause':_0x356218[_0x5717('0x45')]||![],'faxPause':_0x356218['loginInPause']||![],'smsPause':_0x356218['loginInPause']||![],'openchannelPause':_0x356218[_0x5717('0x45')]||![],'pauseType':_0x356218[_0x5717('0x45')]?_0x5717('0x52'):null,'lastPauseAt':moment()[_0x5717('0x21')](_0x5717('0x28')),'interface':_0x3b288a});}})['then'](function(_0x4c1d78){_0x1be24a(_0x4c1d78);})['catch'](function(_0x242f51){_0x489bd4(_0x52d73b[_0x5717('0x18')](0x1f4,_0x242f51[_0x5717('0x19')]));});});}; \ No newline at end of file +var _0x6339=['map','model','info','debug','stringify','catch','error','message','ShowUser','find','raw','then','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','PAUSE','length','updateAttributes','getChannels','forEach','isNil','YYYY-MM-DD\x20HH:mm:ss','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','params','unpause','system','destroy','push','all','LoginUser','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','callysquare','LOGININPAUSE','concat','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','where','attributes','limit','include'];(function(_0x4f4f6b,_0x5ee6ed){var _0x5b836c=function(_0x317a55){while(--_0x317a55){_0x4f4f6b['push'](_0x4f4f6b['shift']());}};_0x5b836c(++_0x5ee6ed);}(_0x6339,0x1a4));var _0x9633=function(_0x1da74c,_0x5bcf7d){_0x1da74c=_0x1da74c-0x0;var _0x125375=_0x6339[_0x1da74c];return _0x125375;};'use strict';var _=require('lodash');var util=require(_0x9633('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Redis=require(_0x9633('0x1'));var db=require(_0x9633('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x9633('0x3'))(_0x9633('0x4'));var config=require(_0x9633('0x5'));config[_0x9633('0x6')]=_[_0x9633('0x7')](config[_0x9633('0x6')],{'host':_0x9633('0x8'),'port':0x18eb});var socket=require(_0x9633('0x9'))(new Redis(config[_0x9633('0x6')]));require(_0x9633('0xa'))[_0x9633('0xb')](socket);exports[_0x9633('0xc')]=function(_0x54396a){var _0x158a68=this;return new Promise(function(_0x29dd4b,_0x40efa7){return db[_0x9633('0xd')][_0x9633('0xe')]({'raw':_0x54396a[_0x9633('0xf')]?_0x54396a['options']['raw']===undefined?!![]:![]:!![],'where':_0x54396a['options']?_0x54396a['options'][_0x9633('0x10')]||null:null,'attributes':_0x54396a[_0x9633('0xf')]?_0x54396a['options'][_0x9633('0x11')]||null:null,'limit':_0x54396a['options']?_0x54396a['options'][_0x9633('0x12')]||null:null,'include':_0x54396a[_0x9633('0xf')]?_0x54396a['options'][_0x9633('0x13')]?_[_0x9633('0x14')](_0x54396a[_0x9633('0xf')][_0x9633('0x13')],function(_0x10a7c6){return{'model':db[_0x10a7c6[_0x9633('0x15')]],'as':_0x10a7c6['as'],'attributes':_0x10a7c6['attributes'],'include':_0x10a7c6['include']?_[_0x9633('0x14')](_0x10a7c6[_0x9633('0x13')],function(_0x5d440a){return{'model':db[_0x5d440a[_0x9633('0x15')]],'as':_0x5d440a['as'],'attributes':_0x5d440a[_0x9633('0x11')],'include':_0x5d440a[_0x9633('0x13')]?_[_0x9633('0x14')](_0x5d440a[_0x9633('0x13')],function(_0x1ab43c){return{'model':db[_0x1ab43c[_0x9633('0x15')]],'as':_0x1ab43c['as'],'attributes':_0x1ab43c[_0x9633('0x11')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26d28e){logger[_0x9633('0x16')]('GetUser',_0x54396a);logger[_0x9633('0x17')]('GetUser',_0x54396a,JSON[_0x9633('0x18')](_0x26d28e));_0x29dd4b(_0x26d28e);})[_0x9633('0x19')](function(_0x5cd890){logger[_0x9633('0x1a')]('GetUser',_0x5cd890[_0x9633('0x1b')],_0x54396a);_0x40efa7(_0x158a68[_0x9633('0x1a')](0x1f4,_0x5cd890['message']));});});};exports[_0x9633('0x1c')]=function(_0x4b96b4){var _0x167bc9=this;return new Promise(function(_0x3d7d4e,_0x57ff17){return db[_0x9633('0xd')][_0x9633('0x1d')]({'raw':_0x4b96b4[_0x9633('0xf')]?_0x4b96b4[_0x9633('0xf')][_0x9633('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b96b4[_0x9633('0xf')]?_0x4b96b4[_0x9633('0xf')][_0x9633('0x10')]||null:null,'attributes':_0x4b96b4['options']?_0x4b96b4[_0x9633('0xf')][_0x9633('0x11')]||null:null,'include':_0x4b96b4[_0x9633('0xf')]?_0x4b96b4[_0x9633('0xf')]['include']?_['map'](_0x4b96b4[_0x9633('0xf')][_0x9633('0x13')],function(_0xdcf700){return{'model':db[_0xdcf700[_0x9633('0x15')]],'as':_0xdcf700['as'],'attributes':_0xdcf700[_0x9633('0x11')],'include':_0xdcf700[_0x9633('0x13')]?_['map'](_0xdcf700[_0x9633('0x13')],function(_0x5217c8){return{'model':db[_0x5217c8[_0x9633('0x15')]],'as':_0x5217c8['as'],'attributes':_0x5217c8[_0x9633('0x11')],'include':_0x5217c8[_0x9633('0x13')]?_[_0x9633('0x14')](_0x5217c8[_0x9633('0x13')],function(_0x404f00){return{'model':db[_0x404f00[_0x9633('0x15')]],'as':_0x404f00['as'],'attributes':_0x404f00[_0x9633('0x11')]};}):[]};}):[]};}):[]:[]})[_0x9633('0x1f')](function(_0x31a2c1){logger['info'](_0x9633('0x1c'),_0x4b96b4);logger[_0x9633('0x17')](_0x9633('0x1c'),_0x4b96b4,JSON[_0x9633('0x18')](_0x31a2c1));_0x3d7d4e(_0x31a2c1);})[_0x9633('0x19')](function(_0x29a434){logger['error'](_0x9633('0x1c'),_0x29a434[_0x9633('0x1b')],_0x4b96b4);_0x57ff17(_0x167bc9[_0x9633('0x1a')](0x1f4,_0x29a434[_0x9633('0x1b')]));});});};exports[_0x9633('0x20')]=function(_0x2fba06){var _0x2a984f;return db[_0x9633('0xd')]['find']({'where':_0x2fba06[_0x9633('0xf')][_0x9633('0x10')]||{},'attributes':['id',_0x9633('0x21'),_0x9633('0x22'),_0x9633('0x23'),_0x9633('0x24')]})[_0x9633('0x1f')](function(_0x407ace){if(!_0x407ace){throw new Error(util[_0x9633('0x25')](_0x9633('0x26'),_0x2fba06['params']['id']));}_0x2a984f=_0x407ace;return db[_0x9633('0x27')][_0x9633('0x28')]({'paused':0x1},{'where':{'UserId':_0x2a984f['id']},'individualHooks':!![]});})[_0x9633('0x1f')](function(){return db[_0x9633('0x29')]['findAll']({'where':{'membername':_0x2a984f[_0x9633('0x21')],'type':_0x9633('0x2a'),'exitAt':null}});})[_0x9633('0x1f')](function(_0x26f1b7){if(_0x26f1b7&&_0x26f1b7[_0x9633('0x2b')]){var _0x2b4ea7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2c6ac3=0x0,_0x590562=_0x26f1b7[_0x9633('0x2b')];_0x2c6ac3<_0x590562;_0x2c6ac3++){_0x26f1b7[_0x2c6ac3][_0x9633('0x2c')]({'exitAt':_0x2b4ea7});}}})[_0x9633('0x1f')](function(){var _0x928347=[];var _0x2b1bf8=utils[_0x9633('0x2d')]();_0x2b1bf8[_0x9633('0x2e')](function(_0x3f68b1){_0x928347['push']({'channel':_0x3f68b1,'membername':_0x2a984f[_0x9633('0x21')],'interface':_[_0x9633('0x2f')](_0x2a984f[_0x9633('0x24')])?util[_0x9633('0x25')]('SIP/%s',_0x2a984f[_0x9633('0x21')]):_0x2a984f[_0x9633('0x24')],'type':_0x9633('0x2a'),'enterAt':moment()[_0x9633('0x25')](_0x9633('0x30')),'data1':_0x2fba06[_0x9633('0x31')][_0x9633('0x32')]||'DEFAULT\x20PAUSE','role':_0x2a984f[_0x9633('0x22')],'internal':_0x2a984f[_0x9633('0x23')],'uniqueid':_0x2fba06[_0x9633('0x31')][_0x9633('0x33')]||null});});return db['MemberReport'][_0x9633('0x34')](_0x928347,{'individualHooks':!![]});})[_0x9633('0x1f')](function(){return _0x2a984f[_0x9633('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2fba06[_0x9633('0x31')][_0x9633('0x32')]||_0x9633('0x35'),'lastPauseAt':moment()['format'](_0x9633('0x30'))});})[_0x9633('0x19')](function(_0x1d702b){throw _0x1d702b;});};exports['UnpauseUser']=function(_0x468fa6){return Promise['resolve']()[_0x9633('0x1f')](function(){if(_0x468fa6['body'][_0x9633('0x36')]&&!utils['isValidChannel'](_0x468fa6[_0x9633('0x31')][_0x9633('0x36')])){throw new Error(util[_0x9633('0x25')](_0x9633('0x37'),_0x468fa6[_0x9633('0x31')][_0x9633('0x36')]));}return db[_0x9633('0xd')][_0x9633('0x38')]({'where':_0x468fa6[_0x9633('0xf')]['where']||{},'attributes':['id',_0x9633('0x21'),_0x9633('0x22'),_0x9633('0x23'),_0x9633('0x24'),'online',_0x9633('0x39'),_0x9633('0x3a'),'chatPause',_0x9633('0x3b'),_0x9633('0x3c'),_0x9633('0x3d'),_0x9633('0x3e'),_0x9633('0x3f'),_0x9633('0x40')]});})[_0x9633('0x1f')](function(_0x18e683){if(!_0x18e683){throw new Error(util['format'](_0x9633('0x26'),_0x468fa6[_0x9633('0x41')]['id']));}return _0x18e683[_0x9633('0x42')](_0x468fa6['body'][_0x9633('0x36')],_0x9633('0x43'));})['catch'](function(_0x5d9dde){throw _0x5d9dde;});};exports['LogoutUser']=function(_0x135bdb){var _0x46fe99=this;return new Promise(function(_0x3680ba,_0x5e2762){var _0xf2df7b;return db['User']['findOne']({'where':_0x135bdb[_0x9633('0xf')]['where']||{},'attributes':['id',_0x9633('0x21')]})[_0x9633('0x1f')](function(_0x852f8d){if(_0x852f8d){_0xf2df7b=_0x852f8d;return db[_0x9633('0x27')][_0x9633('0x44')]({'where':{'membername':_0xf2df7b[_0x9633('0x21')]},'individualHooks':!![]});}})[_0x9633('0x1f')](function(){if(_0xf2df7b){return db[_0x9633('0x29')][_0x9633('0xe')]({'where':{'membername':_0xf2df7b[_0x9633('0x21')],'exitAt':null}});}})[_0x9633('0x1f')](function(_0x4b02f8){if(_0xf2df7b){if(_0x4b02f8&&_0x4b02f8['length']){var _0x3612cd=[];_0x4b02f8['forEach'](function(_0x583bbb){_0x3612cd[_0x9633('0x45')](_0x583bbb['update']({'exitAt':moment()[_0x9633('0x25')](_0x9633('0x30'))}));});return BPromise[_0x9633('0x46')](_0x3612cd);}}})[_0x9633('0x1f')](function(){if(_0xf2df7b){return _0xf2df7b[_0x9633('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9633('0x1f')](function(_0xcd5b69){_0x3680ba(_0xcd5b69);})[_0x9633('0x19')](function(_0x278185){_0x5e2762(_0x46fe99[_0x9633('0x1a')](0x1f4,_0x278185[_0x9633('0x1b')]));});});};exports[_0x9633('0x47')]=function(_0x27a776){var _0x4b3823=this;return new Promise(function(_0x278cbb,_0x3ce7e2){var _0xec6a80;var _0x1fac2d;var _0x2963e2;var _0x1a8f3f;return db[_0x9633('0xd')]['findOne']({'where':_0x27a776[_0x9633('0xf')]['where']||{},'attributes':['id',_0x9633('0x21'),'role','mobile',_0x9633('0x48'),'internal',_0x9633('0x49'),'interface']})[_0x9633('0x1f')](function(_0x58f4e9){if(_0x58f4e9){_0xec6a80=_0x58f4e9;_0x1a8f3f=_0x27a776[_0x9633('0x31')][_0x9633('0x24')]?_0x27a776['body'][_0x9633('0x24')]:util['format'](_0x9633('0x4a'),_0xec6a80[_0x9633('0x21')]);return db['User'][_0x9633('0x4b')]({'where':{'role':_0x9633('0x4c'),'online':!![],'id':{'$ne':_0xec6a80['id']}}});}})['then'](function(_0x33e415){if(_0x33e415){_0x2963e2=_0x33e415;return require(_0x9633('0x4d'))[_0x9633('0x4e')]();}})['then'](function(_0x1e851d){if(_0x1e851d&&_0x1e851d[_0x9633('0x4f')]&&_0x2963e2>=_0x1e851d[_0x9633('0x4f')]){throw new Error(_0x9633('0x50'));}})['then'](function(){if(_0xec6a80){return db[_0x9633('0x27')][_0x9633('0x44')]({'where':{'membername':_0xec6a80[_0x9633('0x21')]},'individualHooks':!![]});}})[_0x9633('0x1f')](function(){if(_0xec6a80){return _0xec6a80[_0x9633('0x51')]({'raw':!![]});}})[_0x9633('0x1f')](function(_0x22ed26){if(_0xec6a80){if(_0x22ed26){var _0x22737a=[];_0x1fac2d=_0x22ed26;if(_0x1fac2d[_0x9633('0x2b')]){for(var _0x2bdffe=0x0;_0x2bdffe<_0x1fac2d[_0x9633('0x2b')];_0x2bdffe++){_0x22737a[_0x9633('0x45')](db[_0x9633('0x27')][_0x9633('0x52')]({'membername':_0xec6a80[_0x9633('0x21')],'UserId':_0xec6a80['id'],'queue_name':_0x1fac2d[_0x2bdffe]['name'],'VoiceQueueId':_0x1fac2d[_0x2bdffe]['id'],'interface':_0x1a8f3f,'paused':_0xec6a80[_0x9633('0x49')]||![],'penalty':_0x1fac2d[_0x2bdffe][_0x9633('0x53')]||0x0}));}return BPromise[_0x9633('0x46')](_0x22737a);}}}})[_0x9633('0x1f')](function(){if(_0xec6a80){return db[_0x9633('0x29')][_0x9633('0xe')]({'where':{'membername':_0xec6a80['name'],'exitAt':null}});}})[_0x9633('0x1f')](function(_0x476a15){if(_0xec6a80){if(_0x476a15&&_0x476a15['length']){var _0x2b54e5=[];_0x476a15[_0x9633('0x2e')](function(_0x5e1d2a){_0x2b54e5[_0x9633('0x45')](_0x5e1d2a[_0x9633('0x28')]({'exitAt':moment()[_0x9633('0x25')](_0x9633('0x30'))}));});return BPromise[_0x9633('0x46')](_0x2b54e5);}}})['then'](function(){if(_0xec6a80){var _0x54f344=[];var _0x2b03cc=[];var _0x3da88d=utils['getChannels']();var _0x40789d={'membername':_0xec6a80[_0x9633('0x21')],'interface':_0x1a8f3f,'enterAt':moment()[_0x9633('0x25')](_0x9633('0x30')),'role':_0xec6a80[_0x9633('0x22')],'internal':_0xec6a80[_0x9633('0x23')]};_0x3da88d['forEach'](function(_0x3d55b0){_0x54f344[_0x9633('0x45')](_[_0x9633('0x54')]({'channel':_0x3d55b0,'type':'LOGIN','data1':_0x9633('0x55'),'data2':_0x1a8f3f},_0x40789d));if(_0xec6a80[_0x9633('0x49')]){_0x2b03cc[_0x9633('0x45')](_['merge']({'channel':_0x3d55b0,'type':'PAUSE','data1':_0x9633('0x56')},_0x40789d));}});return db[_0x9633('0x29')]['bulkCreate'](_0x54f344[_0x9633('0x57')](_0x2b03cc),{'individualHooks':!![]});}})[_0x9633('0x1f')](function(){if(_0xec6a80){return _0xec6a80[_0x9633('0x28')]({'online':!![],'lastLoginAt':moment()['format'](_0x9633('0x30')),'voicePause':_0xec6a80[_0x9633('0x49')]||![],'mailPause':_0xec6a80['loginInPause']||![],'chatPause':_0xec6a80['loginInPause']||![],'faxPause':_0xec6a80[_0x9633('0x49')]||![],'smsPause':_0xec6a80[_0x9633('0x49')]||![],'openchannelPause':_0xec6a80['loginInPause']||![],'pauseType':_0xec6a80['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x9633('0x25')](_0x9633('0x30')),'interface':_0x1a8f3f});}})['then'](function(_0x5d4a45){_0x278cbb(_0x5d4a45);})['catch'](function(_0x248a72){_0x3ce7e2(_0x4b3823[_0x9633('0x1a')](0x1f4,_0x248a72[_0x9633('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 06f26bd..b0aff96 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 _0xa1bc=['update','removeListener','length','user:','./user.events','save','remove'];(function(_0x28669c,_0x1f62c4){var _0x4a3af6=function(_0x3e25d5){while(--_0x3e25d5){_0x28669c['push'](_0x28669c['shift']());}};_0x4a3af6(++_0x1f62c4);}(_0xa1bc,0x6d));var _0xca1b=function(_0x13e8e0,_0xde8dbe){_0x13e8e0=_0x13e8e0-0x0;var _0x293c5a=_0xa1bc[_0x13e8e0];return _0x293c5a;};'use strict';var UserEvents=require(_0xca1b('0x0'));var events=[_0xca1b('0x1'),_0xca1b('0x2'),_0xca1b('0x3')];function createListener(_0x1cc40b,_0x2e5815){return function(_0x48ccc8){_0x2e5815['emit'](_0x1cc40b,_0x48ccc8);};}function removeListener(_0x166a69,_0x23f60d){return function(){UserEvents[_0xca1b('0x4')](_0x166a69,_0x23f60d);};}exports['register']=function(_0x4c7ba2){for(var _0x1b40bf=0x0,_0x3bff3e=events[_0xca1b('0x5')];_0x1b40bf<_0x3bff3e;_0x1b40bf++){var _0x193d2d=events[_0x1b40bf];var _0x2a2f18=createListener(_0xca1b('0x6')+_0x193d2d,_0x4c7ba2);UserEvents['on'](_0x193d2d,_0x2a2f18);}}; \ No newline at end of file +var _0xcaf1=['user:','./user.events','remove','update','emit','removeListener','register'];(function(_0x153d86,_0x4ec9f8){var _0xb44a8a=function(_0x283ca2){while(--_0x283ca2){_0x153d86['push'](_0x153d86['shift']());}};_0xb44a8a(++_0x4ec9f8);}(_0xcaf1,0xb0));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x1caf('0x0'));var events=['save',_0x1caf('0x1'),_0x1caf('0x2')];function createListener(_0x47d020,_0x223f49){return function(_0x4ca558){_0x223f49[_0x1caf('0x3')](_0x47d020,_0x4ca558);};}function removeListener(_0x428a05,_0x33d23d){return function(){UserEvents[_0x1caf('0x4')](_0x428a05,_0x33d23d);};}exports[_0x1caf('0x5')]=function(_0x5b09cb){for(var _0x6a07df=0x0,_0x49d5ad=events['length'];_0x6a07df<_0x49d5ad;_0x6a07df++){var _0x32996c=events[_0x6a07df];var _0x55dc80=createListener(_0x1caf('0x6')+_0x32996c,_0x5b09cb);UserEvents['on'](_0x32996c,_0x55dc80);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index ad3a55e..b40b982 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2e7087,_0x112eec){var _0xb5b3a6=function(_0x296310){while(--_0x296310){_0x2e7087['push'](_0x2e7087['shift']());}};_0xb5b3a6(++_0x112eec);}(_0x9c44,0x178));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1ab3da,_0x2d321d){var _0x3ffd4e=function(_0x1c49f2){while(--_0x1c49f2){_0x1ab3da['push'](_0x1ab3da['shift']());}};_0x3ffd4e(++_0x2d321d);}(_0x70e0,0x17b));var _0x070e=function(_0x2d94b0,_0x10d2d9){_0x2d94b0=_0x2d94b0-0x0;var _0x1a41f7=_0x70e0[_0x2d94b0];return _0x1a41f7;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index afe5ec6..096b9e2 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 _0xd891=['sequelize','exports'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd891,0x1a8));var _0x1d89=function(_0x2f711f,_0x4e0d95){_0x2f711f=_0x2f711f-0x0;var _0x45d36c=_0xd891[_0x2f711f];return _0x45d36c;};'use strict';var Sequelize=require(_0x1d89('0x0'));module[_0x1d89('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb04c=['INTEGER','exports'];(function(_0x484b50,_0x271400){var _0x37165d=function(_0x3043e5){while(--_0x3043e5){_0x484b50['push'](_0x484b50['shift']());}};_0x37165d(++_0x271400);}(_0xb04c,0x1b7));var _0xcb04=function(_0x9fea9c,_0x30b8e8){_0x9fea9c=_0x9fea9c-0x0;var _0x58945f=_0xb04c[_0x9fea9c];return _0x58945f;};'use strict';var Sequelize=require('sequelize');module[_0xcb04('0x0')]={'penalty':{'type':Sequelize[_0xcb04('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index cd4c5f7..e5982d2 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 _0x8591=['exports','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ac15c,_0x273d6e){var _0x5bfd19=function(_0x35a88f){while(--_0x35a88f){_0x1ac15c['push'](_0x1ac15c['shift']());}};_0x5bfd19(++_0x273d6e);}(_0x8591,0x12f));var _0x1859=function(_0x4eaf63,_0x241f66){_0x4eaf63=_0x4eaf63-0x0;var _0x3266dd=_0x8591[_0x4eaf63];return _0x3266dd;};'use strict';var _=require(_0x1859('0x0'));var util=require('util');var logger=require(_0x1859('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1859('0x2'));var rp=require(_0x1859('0x3'));var fs=require('fs');var path=require(_0x1859('0x4'));var rimraf=require(_0x1859('0x5'));var config=require(_0x1859('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x1859('0x7')]=function(_0x5e4733,_0x4eef5f){return _0x5e4733['define'](_0x1859('0x8'),attributes,{'tableName':_0x1859('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e44=['exports','util','../../config/logger','moment','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4e44,0xe9));var _0x44e4=function(_0x21e96,_0x43a55b){_0x21e96=_0x21e96-0x0;var _0x25273f=_0x4e44[_0x21e96];return _0x25273f;};'use strict';var _=require('lodash');var util=require(_0x44e4('0x0'));var logger=require(_0x44e4('0x1'))('api');var moment=require(_0x44e4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44e4('0x3'));var rimraf=require(_0x44e4('0x4'));var config=require(_0x44e4('0x5'));var attributes=require(_0x44e4('0x6'));module[_0x44e4('0x7')]=function(_0x27c175,_0x375acd){return _0x27c175['define']('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','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 6557c1b..0f07f76 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 _0xa66c=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa66c,0x112));var _0xca66=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa66c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xca66('0x0'));var util=require(_0xca66('0x1'));var moment=require(_0xca66('0x2'));var BPromise=require(_0xca66('0x3'));var rs=require(_0xca66('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xca66('0x5'))(_0xca66('0x6'));var config=require(_0xca66('0x7'));var jayson=require(_0xca66('0x8'));var client=jayson[_0xca66('0x9')][_0xca66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a5bc5,_0x582a03,_0x88b087){return new BPromise(function(_0x32f98a,_0xc573b0){return client[_0xca66('0xb')](_0x3a5bc5,_0x88b087)[_0xca66('0xc')](function(_0x1eb2b2){logger[_0xca66('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x582a03,_0xca66('0xe'));logger[_0xca66('0xf')](_0xca66('0x10'),_0x582a03,_0xca66('0xe'),JSON[_0xca66('0x11')](_0x1eb2b2));if(_0x1eb2b2[_0xca66('0x12')]){if(_0x1eb2b2[_0xca66('0x12')][_0xca66('0x13')]===0x1f4){logger[_0xca66('0x12')](_0xca66('0x14'),_0x582a03,_0x1eb2b2[_0xca66('0x12')][_0xca66('0x15')]);return _0xc573b0(_0x1eb2b2[_0xca66('0x12')]['message']);}logger[_0xca66('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x582a03,_0x1eb2b2[_0xca66('0x12')][_0xca66('0x15')]);return _0x32f98a(_0x1eb2b2[_0xca66('0x12')][_0xca66('0x15')]);}else{logger[_0xca66('0xd')](_0xca66('0x14'),_0x582a03,_0xca66('0xe'));_0x32f98a(_0x1eb2b2[_0xca66('0x16')][_0xca66('0x15')]);}})[_0xca66('0x17')](function(_0x5ceb47){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x582a03,_0x5ceb47);_0xc573b0(_0x5ceb47);});});} \ No newline at end of file +var _0xdbca=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','info','result'];(function(_0x20cc63,_0x27b068){var _0x44230b=function(_0x1b4c24){while(--_0x1b4c24){_0x20cc63['push'](_0x20cc63['shift']());}};_0x44230b(++_0x27b068);}(_0xdbca,0x114));var _0xadbc=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xdbca[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require(_0xadbc('0x0'));var util=require('util');var moment=require(_0xadbc('0x1'));var BPromise=require(_0xadbc('0x2'));var rs=require(_0xadbc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xadbc('0x4'))['db'];var utils=require(_0xadbc('0x5'));var logger=require(_0xadbc('0x6'))(_0xadbc('0x7'));var config=require(_0xadbc('0x8'));var jayson=require(_0xadbc('0x9'));var client=jayson[_0xadbc('0xa')][_0xadbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f54f8,_0x1915f6,_0x524d2b){return new BPromise(function(_0x8bdc98,_0x23ed58){return client[_0xadbc('0xc')](_0x3f54f8,_0x524d2b)[_0xadbc('0xd')](function(_0x42a016){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1915f6,_0xadbc('0xe'));logger[_0xadbc('0xf')](_0xadbc('0x10'),_0x1915f6,'request\x20sent',JSON[_0xadbc('0x11')](_0x42a016));if(_0x42a016[_0xadbc('0x12')]){if(_0x42a016[_0xadbc('0x12')][_0xadbc('0x13')]===0x1f4){logger[_0xadbc('0x12')](_0xadbc('0x14'),_0x1915f6,_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);return _0x23ed58(_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);}logger[_0xadbc('0x12')](_0xadbc('0x14'),_0x1915f6,_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);return _0x8bdc98(_0x42a016[_0xadbc('0x12')][_0xadbc('0x15')]);}else{logger[_0xadbc('0x16')](_0xadbc('0x14'),_0x1915f6,'request\x20sent');_0x8bdc98(_0x42a016[_0xadbc('0x17')][_0xadbc('0x15')]);}})[_0xadbc('0x18')](function(_0x2e690f){logger[_0xadbc('0x12')](_0xadbc('0x14'),_0x1915f6,_0x2e690f);_0x23ed58(_0x2e690f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index fc65344..390a59d 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2be004,_0x7393c3){var _0x1722ea=function(_0x5642f9){while(--_0x5642f9){_0x2be004['push'](_0x2be004['shift']());}};_0x1722ea(++_0x7393c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2fbf36,_0x167415){var _0x3a7e31=function(_0x5d7795){while(--_0x5d7795){_0x2fbf36['push'](_0x2fbf36['shift']());}};_0x3a7e31(++_0x167415);}(_0x70e0,0x17b));var _0x070e=function(_0x5df9a,_0x2bc4ce){_0x5df9a=_0x5df9a-0x0;var _0x55345a=_0x70e0[_0x5df9a];return _0x55345a;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 12f32ae..739e61b 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 _0xc870=['exports','INTEGER','STRING','sequelize'];(function(_0x2e3997,_0x2a7672){var _0x5ed56c=function(_0x25e9c4){while(--_0x25e9c4){_0x2e3997['push'](_0x2e3997['shift']());}};_0x5ed56c(++_0x2a7672);}(_0xc870,0x1a7));var _0x0c87=function(_0x3f4904,_0x5ee874){_0x3f4904=_0x3f4904-0x0;var _0x395e29=_0xc870[_0x3f4904];return _0x395e29;};'use strict';var Sequelize=require(_0x0c87('0x0'));module[_0x0c87('0x1')]={'penalty':{'type':Sequelize[_0x0c87('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0c87('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0c87('0x3')]}}; \ No newline at end of file +var _0x7cce=['exports','INTEGER','STRING','sequelize'];(function(_0xb8fd40,_0x23030a){var _0x46fcde=function(_0x1a22ff){while(--_0x1a22ff){_0xb8fd40['push'](_0xb8fd40['shift']());}};_0x46fcde(++_0x23030a);}(_0x7cce,0x11b));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe7cc('0x0'));module[_0xe7cc('0x1')]={'penalty':{'type':Sequelize[_0xe7cc('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe7cc('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe7cc('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d19b90a..d6c8fff 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 _0xb173=['define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','path','../../config/environment','./userFaxQueue.attributes'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xb173,0xad));var _0x3b17=function(_0x515cad,_0x1c0f21){_0x515cad=_0x515cad-0x0;var _0x11f932=_0xb173[_0x515cad];return _0x11f932;};'use strict';var _=require(_0x3b17('0x0'));var util=require(_0x3b17('0x1'));var logger=require('../../config/logger')(_0x3b17('0x2'));var moment=require(_0x3b17('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b17('0x4'));var rimraf=require('rimraf');var config=require(_0x3b17('0x5'));var attributes=require(_0x3b17('0x6'));module['exports']=function(_0xd2d589,_0xc80aec){return _0xd2d589[_0x3b17('0x7')](_0x3b17('0x8'),attributes,{'tableName':_0x3b17('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5aec=['rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4c57c5,_0x22fae3){var _0x4ffea3=function(_0x3981af){while(--_0x3981af){_0x4c57c5['push'](_0x4c57c5['shift']());}};_0x4ffea3(++_0x22fae3);}(_0x5aec,0x101));var _0xc5ae=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x5aec[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0xc5ae('0x0'));var util=require(_0xc5ae('0x1'));var logger=require(_0xc5ae('0x2'))(_0xc5ae('0x3'));var moment=require(_0xc5ae('0x4'));var BPromise=require('bluebird');var rp=require(_0xc5ae('0x5'));var fs=require('fs');var path=require(_0xc5ae('0x6'));var rimraf=require(_0xc5ae('0x7'));var config=require(_0xc5ae('0x8'));var attributes=require(_0xc5ae('0x9'));module['exports']=function(_0x406943,_0x13c00e){return _0x406943['define'](_0xc5ae('0xa'),attributes,{'tableName':_0xc5ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 5a377bd..6bb6681 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 _0x262b=['UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x262b,0x1bc));var _0xb262=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x262b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb262('0x0'));var util=require('util');var moment=require(_0xb262('0x1'));var BPromise=require(_0xb262('0x2'));var rs=require(_0xb262('0x3'));var fs=require('fs');var Redis=require(_0xb262('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb262('0x5'));var logger=require(_0xb262('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb262('0x7'));var client=jayson[_0xb262('0x8')][_0xb262('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc10df,_0x54ed2a,_0x40253e){return new BPromise(function(_0x418133,_0x4f9bd7){return client[_0xb262('0xa')](_0xc10df,_0x40253e)[_0xb262('0xb')](function(_0x1c85bf){logger[_0xb262('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x54ed2a,_0xb262('0xd'));logger[_0xb262('0xe')](_0xb262('0xf'),_0x54ed2a,'request\x20sent',JSON['stringify'](_0x1c85bf));if(_0x1c85bf[_0xb262('0x10')]){if(_0x1c85bf[_0xb262('0x10')][_0xb262('0x11')]===0x1f4){logger[_0xb262('0x10')](_0xb262('0x12'),_0x54ed2a,_0x1c85bf[_0xb262('0x10')][_0xb262('0x13')]);return _0x4f9bd7(_0x1c85bf[_0xb262('0x10')][_0xb262('0x13')]);}logger[_0xb262('0x10')](_0xb262('0x12'),_0x54ed2a,_0x1c85bf['error'][_0xb262('0x13')]);return _0x418133(_0x1c85bf[_0xb262('0x10')][_0xb262('0x13')]);}else{logger[_0xb262('0xc')](_0xb262('0x12'),_0x54ed2a,_0xb262('0xd'));_0x418133(_0x1c85bf[_0xb262('0x14')][_0xb262('0x13')]);}})[_0xb262('0x15')](function(_0x5527a3){logger[_0xb262('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x54ed2a,_0x5527a3);_0x4f9bd7(_0x5527a3);});});} \ No newline at end of file +var _0x6e15=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e15,0x13c));var _0x56e1=function(_0x15dc8f,_0x59b8dc){_0x15dc8f=_0x15dc8f-0x0;var _0x105fd2=_0x6e15[_0x15dc8f];return _0x105fd2;};'use strict';var _=require(_0x56e1('0x0'));var util=require(_0x56e1('0x1'));var moment=require(_0x56e1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56e1('0x3'));var db=require(_0x56e1('0x4'))['db'];var utils=require(_0x56e1('0x5'));var logger=require('../../config/logger')(_0x56e1('0x6'));var config=require(_0x56e1('0x7'));var jayson=require(_0x56e1('0x8'));var client=jayson[_0x56e1('0x9')][_0x56e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24cd96,_0x3f768a,_0x40ca9f){return new BPromise(function(_0x2ccecc,_0x55a0e4){return client[_0x56e1('0xb')](_0x24cd96,_0x40ca9f)[_0x56e1('0xc')](function(_0x116194){logger[_0x56e1('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x3f768a,_0x56e1('0xe'));logger['debug'](_0x56e1('0xf'),_0x3f768a,_0x56e1('0xe'),JSON[_0x56e1('0x10')](_0x116194));if(_0x116194[_0x56e1('0x11')]){if(_0x116194[_0x56e1('0x11')][_0x56e1('0x12')]===0x1f4){logger['error'](_0x56e1('0x13'),_0x3f768a,_0x116194[_0x56e1('0x11')][_0x56e1('0x14')]);return _0x55a0e4(_0x116194['error'][_0x56e1('0x14')]);}logger[_0x56e1('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x3f768a,_0x116194[_0x56e1('0x11')]['message']);return _0x2ccecc(_0x116194[_0x56e1('0x11')][_0x56e1('0x14')]);}else{logger[_0x56e1('0xd')](_0x56e1('0x13'),_0x3f768a,'request\x20sent');_0x2ccecc(_0x116194[_0x56e1('0x15')][_0x56e1('0x14')]);}})[_0x56e1('0x16')](function(_0x202782){logger['error'](_0x56e1('0x13'),_0x3f768a,_0x202782);_0x55a0e4(_0x202782);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index d2c3108..11330c2 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xf6461f,_0x13054f){var _0x277a1e=function(_0x365320){while(--_0x365320){_0xf6461f['push'](_0xf6461f['shift']());}};_0x277a1e(++_0x13054f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e9a69,_0x40c0ec){_0x5e9a69=_0x5e9a69-0x0;var _0x5979c8=_0xcb91[_0x5e9a69];return _0x5979c8;};'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(_0x4d82e4,_0x3cf5be){var _0x3a3c8b=function(_0x4f29cf){while(--_0x4f29cf){_0x4d82e4['push'](_0x4d82e4['shift']());}};_0x3a3c8b(++_0x3cf5be);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index be2a3f0..1985822 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 _0xa4c3=['sequelize','exports'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa4c3,0x100));var _0x3a4c=function(_0x29ba20,_0x45bb6e){_0x29ba20=_0x29ba20-0x0;var _0xd9ea4c=_0xa4c3[_0x29ba20];return _0xd9ea4c;};'use strict';var Sequelize=require(_0x3a4c('0x0'));module[_0x3a4c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xabf7=['sequelize','INTEGER'];(function(_0x4e8a37,_0x1ecfe6){var _0x1c8a72=function(_0x3f6141){while(--_0x3f6141){_0x4e8a37['push'](_0x4e8a37['shift']());}};_0x1c8a72(++_0x1ecfe6);}(_0xabf7,0xae));var _0x7abf=function(_0x58c7ab,_0x38a623){_0x58c7ab=_0x58c7ab-0x0;var _0x5623f8=_0xabf7[_0x58c7ab];return _0x5623f8;};'use strict';var Sequelize=require(_0x7abf('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7abf('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 7f37dc5..3a861e6 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 _0x40e4=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','user_has_mail_queues'];(function(_0x53a2d6,_0x3aff58){var _0x3dd809=function(_0x4ecadc){while(--_0x4ecadc){_0x53a2d6['push'](_0x53a2d6['shift']());}};_0x3dd809(++_0x3aff58);}(_0x40e4,0x1a2));var _0x440e=function(_0x1ae975,_0x70b40e){_0x1ae975=_0x1ae975-0x0;var _0x2576ca=_0x40e4[_0x1ae975];return _0x2576ca;};'use strict';var _=require('lodash');var util=require(_0x440e('0x0'));var logger=require(_0x440e('0x1'))(_0x440e('0x2'));var moment=require('moment');var BPromise=require(_0x440e('0x3'));var rp=require(_0x440e('0x4'));var fs=require('fs');var path=require(_0x440e('0x5'));var rimraf=require(_0x440e('0x6'));var config=require('../../config/environment');var attributes=require(_0x440e('0x7'));module[_0x440e('0x8')]=function(_0x527a03,_0x14a5c5){return _0x527a03[_0x440e('0x9')]('UserMailQueue',attributes,{'tableName':_0x440e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa758=['UserMailQueue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userMailQueue.attributes','exports','define'];(function(_0x81e6e2,_0x3565ca){var _0x56bb71=function(_0x49c2b7){while(--_0x49c2b7){_0x81e6e2['push'](_0x81e6e2['shift']());}};_0x56bb71(++_0x3565ca);}(_0xa758,0xc1));var _0x8a75=function(_0x100770,_0x2a6617){_0x100770=_0x100770-0x0;var _0x26c777=_0xa758[_0x100770];return _0x26c777;};'use strict';var _=require(_0x8a75('0x0'));var util=require(_0x8a75('0x1'));var logger=require(_0x8a75('0x2'))(_0x8a75('0x3'));var moment=require(_0x8a75('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a75('0x5'));var fs=require('fs');var path=require(_0x8a75('0x6'));var rimraf=require(_0x8a75('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a75('0x8'));module[_0x8a75('0x9')]=function(_0x5368c8,_0x5dafdc){return _0x5368c8[_0x8a75('0xa')](_0x8a75('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index f43739c..26c2ef7 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(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0xbf0f99,_0x3a6f31){var _0x11838d=function(_0x5ce60a){while(--_0x5ce60a){_0xbf0f99['push'](_0xbf0f99['shift']());}};_0x11838d(++_0x3a6f31);}(_0x3e74,0x175));var _0x43e7=function(_0x29661d,_0x21934e){_0x29661d=_0x29661d-0x0;var _0x30e309=_0x3e74[_0x29661d];return _0x30e309;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 15693b5..d7c4559 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 _0x9149=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x597ff2,_0x2b92a0){var _0x1067bf=function(_0x385ff8){while(--_0x385ff8){_0x597ff2['push'](_0x597ff2['shift']());}};_0x1067bf(++_0x2b92a0);}(_0x9149,0xfb));var _0x9914=function(_0x19a471,_0x42874e){_0x19a471=_0x19a471-0x0;var _0xea5af2=_0x9149[_0x19a471];return _0xea5af2;};'use strict';var multer=require(_0x9914('0x0'));var util=require(_0x9914('0x1'));var path=require(_0x9914('0x2'));var timeout=require(_0x9914('0x3'));var express=require('express');var router=express[_0x9914('0x4')]();var fs_extra=require(_0x9914('0x5'));var auth=require(_0x9914('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9914('0x7'));var controller=require(_0x9914('0x8'));router['post']('/',auth[_0x9914('0x9')](),controller[_0x9914('0xa')]);module[_0x9914('0xb')]=router; \ No newline at end of file +var _0x55fb=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','exports','multer','util'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x55fb,0x17e));var _0xb55f=function(_0x5ad60a,_0x5262c5){_0x5ad60a=_0x5ad60a-0x0;var _0x266de2=_0x55fb[_0x5ad60a];return _0x266de2;};'use strict';var multer=require(_0xb55f('0x0'));var util=require(_0xb55f('0x1'));var path=require(_0xb55f('0x2'));var timeout=require('connect-timeout');var express=require(_0xb55f('0x3'));var router=express[_0xb55f('0x4')]();var fs_extra=require(_0xb55f('0x5'));var auth=require(_0xb55f('0x6'));var interaction=require(_0xb55f('0x7'));var config=require(_0xb55f('0x8'));var controller=require(_0xb55f('0x9'));router['post']('/',auth[_0xb55f('0xa')](),controller['sendUserNotification']);module[_0xb55f('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 2879d6f..3304f77 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 _0x8ef3=['TEXT','STRING','BOOLEAN'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8ef3,0xf0));var _0x38ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ef3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x38ef('0x0')]},'senderName':{'type':Sequelize[_0x38ef('0x1')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x38ef('0x2')]}}; \ No newline at end of file +var _0x2be2=['sequelize','exports','TEXT','BOOLEAN'];(function(_0x427773,_0x4caa67){var _0x4d9df4=function(_0x3f0dac){while(--_0x3f0dac){_0x427773['push'](_0x427773['shift']());}};_0x4d9df4(++_0x4caa67);}(_0x2be2,0xe4));var _0x22be=function(_0x2d73d7,_0x29e178){_0x2d73d7=_0x2d73d7-0x0;var _0x9fc822=_0x2be2[_0x2d73d7];return _0x9fc822;};'use strict';var Sequelize=require(_0x22be('0x0'));module[_0x22be('0x1')]={'body':{'type':Sequelize[_0x22be('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x22be('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x22be('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 20e2463..6999433 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 _0x28e1=['hasOwnProperty','text','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','recipients','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','render','startCase','User','union','ids','replace','queue','push','all','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','sendUserNotification','body'];(function(_0x1053f4,_0x556539){var _0x5c90f9=function(_0x25d7b1){while(--_0x25d7b1){_0x1053f4['push'](_0x1053f4['shift']());}};_0x5c90f9(++_0x556539);}(_0x28e1,0xf2));var _0x128e=function(_0x351903,_0x98e5fa){_0x351903=_0x351903-0x0;var _0x440746=_0x28e1[_0x351903];return _0x440746;};'use strict';var emlformat=require(_0x128e('0x0'));var rimraf=require(_0x128e('0x1'));var zipdir=require(_0x128e('0x2'));var jsonpatch=require(_0x128e('0x3'));var rp=require('request-promise');var moment=require(_0x128e('0x4'));var BPromise=require(_0x128e('0x5'));var Mustache=require(_0x128e('0x6'));var util=require(_0x128e('0x7'));var path=require(_0x128e('0x8'));var sox=require(_0x128e('0x9'));var csv=require(_0x128e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x128e('0xb'));var _=require(_0x128e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x128e('0xd'));var toCsv=require(_0x128e('0xa'));var querystring=require(_0x128e('0xe'));var Papa=require(_0x128e('0xf'));var Redis=require(_0x128e('0x10'));var authService=require(_0x128e('0x11'));var qs=require(_0x128e('0x12'));var as=require(_0x128e('0x13'));var hardwareService=require(_0x128e('0x14'));var logger=require('../../config/logger')(_0x128e('0x15'));var utils=require(_0x128e('0x16'));var config=require(_0x128e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x128e('0x18'))['db'];config[_0x128e('0x19')]=_['defaults'](config[_0x128e('0x19')],{'host':_0x128e('0x1a'),'port':0x18eb});var socket=require(_0x128e('0x1b'))(new Redis(config[_0x128e('0x19')]));require('./userNotification.socket')[_0x128e('0x1c')](socket);function respondWithStatusCode(_0x4266bc,_0x36dc99){_0x36dc99=_0x36dc99||0xcc;return function(_0x2c8a65){if(_0x2c8a65){return _0x4266bc[_0x128e('0x1d')](_0x36dc99);}return _0x4266bc[_0x128e('0x1e')](_0x36dc99)[_0x128e('0x1f')]();};}function respondWithResult(_0x2beace,_0x398836){_0x398836=_0x398836||0xc8;return function(_0x38ffa8){if(_0x38ffa8){return _0x2beace['status'](_0x398836)[_0x128e('0x20')](_0x38ffa8);}};}function respondWithFilteredResult(_0x17e68d,_0x4f0484){return function(_0x14ede6){if(_0x14ede6){var _0x1022e9=typeof _0x4f0484[_0x128e('0x21')]===_0x128e('0x22')&&typeof _0x4f0484['limit']==='undefined';var _0x238b44=_0x14ede6['count'];var _0x4b4dde=_0x1022e9?0x0:_0x4f0484[_0x128e('0x21')];var _0x58a415=_0x1022e9?_0x14ede6[_0x128e('0x23')]:_0x4f0484[_0x128e('0x21')]+_0x4f0484[_0x128e('0x24')];var _0x9f5c67;if(_0x58a415>=_0x238b44){_0x58a415=_0x238b44;_0x9f5c67=0xc8;}else{_0x9f5c67=0xce;}_0x17e68d[_0x128e('0x1e')](_0x9f5c67);return _0x17e68d[_0x128e('0x25')](_0x128e('0x26'),_0x4b4dde+'-'+_0x58a415+'/'+_0x238b44)[_0x128e('0x20')](_0x14ede6);}return null;};}function patchUpdates(_0x6f7c7c){return function(_0x2a730b){try{jsonpatch[_0x128e('0x27')](_0x2a730b,_0x6f7c7c,!![]);}catch(_0x7e6af3){return BPromise[_0x128e('0x28')](_0x7e6af3);}return _0x2a730b[_0x128e('0x29')]();};}function saveUpdates(_0xe1f335,_0x1a571b){return function(_0x1a8291){if(_0x1a8291){return _0x1a8291['update'](_0xe1f335)[_0x128e('0x2a')](function(_0x326ebc){return _0x326ebc;});}return null;};}function removeEntity(_0x5a60ce,_0x455efc){return function(_0x46db19){if(_0x46db19){return _0x46db19['destroy']()['then'](function(){_0x5a60ce['status'](0xcc)[_0x128e('0x1f')]();});}};}function handleEntityNotFound(_0x58e18c,_0x25362b){return function(_0x4e540d){if(!_0x4e540d){_0x58e18c[_0x128e('0x1d')](0x194);}return _0x4e540d;};}function handleError(_0x3cdb50,_0x572783){_0x572783=_0x572783||0x1f4;return function(_0x746919){logger[_0x128e('0x2b')](_0x746919[_0x128e('0x2c')]);if(_0x746919[_0x128e('0x2d')]){delete _0x746919[_0x128e('0x2d')];}_0x3cdb50[_0x128e('0x1e')](_0x572783)[_0x128e('0x2e')](_0x746919);};}exports[_0x128e('0x2f')]=function(_0xa1a0ec,_0x31ebcf,_0x2aa4ef){if(!_0xa1a0ec[_0x128e('0x30')][_0x128e('0x31')](_0x128e('0x32'))&&!_0xa1a0ec['body'][_0x128e('0x31')]('TemplateId')){throw new db[(_0x128e('0x33'))]['ValidationError'](_0x128e('0x34'));}else{if(_0xa1a0ec[_0x128e('0x30')]['hasOwnProperty'](_0x128e('0x35'))&&!_0xa1a0ec[_0x128e('0x30')][_0x128e('0x31')](_0x128e('0x36'))){throw new db[(_0x128e('0x33'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0xa1a0ec[_0x128e('0x30')][_0x128e('0x31')](_0x128e('0x37'))){throw new db[(_0x128e('0x33'))][(_0x128e('0x38'))](_0x128e('0x39'));}else{try{var _0x4a606c=JSON[_0x128e('0x3a')](_0xa1a0ec[_0x128e('0x30')][_0x128e('0x37')]);}catch(_0x55d738){logger['error'](_0x55d738);throw new db[(_0x128e('0x33'))][(_0x128e('0x38'))](_0x128e('0x3b'));}var _0x3df553=['chatqueue',_0x128e('0x3c'),_0x128e('0x3d'),'openchannelqueue',_0x128e('0x3e'),_0x128e('0x3f'),_0x128e('0x40'),_0x128e('0x41'),_0x128e('0x42')];if(_[_0x128e('0x43')](_0x4a606c,function(_0x22c2fd){return!_[_0x128e('0x44')](_0x3df553,_0x22c2fd[_0x128e('0x45')][_0x128e('0x46')]());})){throw new db['Sequelize'][(_0x128e('0x38'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x24b436={};_0x24b436[_0x128e('0x47')]=_0xa1a0ec['body'][_0x128e('0x31')](_0x128e('0x47'))?_0xa1a0ec[_0x128e('0x30')][_0x128e('0x47')]:_0xa1a0ec[_0x128e('0x42')][_0x128e('0x48')];_0x24b436['recipientsDescription']=_['isEmpty'](_0xa1a0ec[_0x128e('0x30')][_0x128e('0x49')])?null:_0xa1a0ec[_0x128e('0x30')][_0x128e('0x49')];_0x24b436[_0x128e('0x4a')]=_0xa1a0ec[_0x128e('0x30')]['beep']||![];_0x24b436[_0x128e('0x4b')]=_0xa1a0ec['user']['id'];return getContent(_0xa1a0ec[_0x128e('0x30')])[_0x128e('0x2a')](function(_0x4deaeb){_0x24b436[_0x128e('0x30')]=_0x4deaeb;return getRecipients(_0x4a606c);})[_0x128e('0x2a')](function(_0x162021){_0x24b436[_0x128e('0x4c')]=_['sortBy'](_0x162021)['join'](',');return db[_0x128e('0x4d')]['transaction'](function(_0x350f07){return db[_0x128e('0x4e')][_0x128e('0x4f')](_0x24b436,{'raw':!![],'transaction':_0x350f07})[_0x128e('0x2a')](function(_0x59d14f){var _0x38ae4b={'sender':_0x24b436['senderName'],'description':_0x24b436['recipientsDescription'],'content':_0x24b436[_0x128e('0x30')],'beep':_0x24b436[_0x128e('0x4a')]};_0x162021[_0x128e('0x50')](function(_0x2ef457){_0x38ae4b[_0x128e('0x51')]=_0x2ef457;socket[_0x128e('0x52')](_0x128e('0x53'),_0x38ae4b);});return _0x59d14f;});});})[_0x128e('0x2a')](respondWithResult(_0x31ebcf,0xc9))[_0x128e('0x54')](handleError(_0x31ebcf,null));};function getContent(_0x13a083){return new BPromise(function(_0x3e9a8d,_0x19efdb){if(_0x13a083[_0x128e('0x32')]){_0x3e9a8d(_0x13a083[_0x128e('0x32')]);return;}return db[_0x128e('0x55')]['findOne']({'attributes':[_0x128e('0x56')],'where':{'id':_0x13a083['TemplateId']},'raw':!![]})[_0x128e('0x2a')](function(_0x2ff746){if(!_0x2ff746)throw new db['Sequelize'][(_0x128e('0x38'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x3bb5fe=Mustache[_0x128e('0x57')](_0x2ff746['html'],_0x13a083[_0x128e('0x36')]);_0x3e9a8d(_0x3bb5fe);})['catch'](function(_0x54511d){_0x19efdb(_0x54511d);});});}function getRecipients(_0x366f31){return new BPromise(function(_0x5c0490,_0x1170db){var _0x3a75eb=[];var _0x309f93=[];_0x366f31[_0x128e('0x50')](function(_0x2bf077){var _0x730873=_[_0x128e('0x58')](_0x2bf077[_0x128e('0x45')]['toLowerCase']());if(_0x730873===_0x128e('0x59')){_0x3a75eb=_[_0x128e('0x5a')](_0x3a75eb,_0x2bf077[_0x128e('0x5b')]);}else{if(_[_0x128e('0x44')](_0x730873,'queue'))_0x730873=_0x730873[_0x128e('0x5c')](_0x128e('0x5d'),'Queue');_0x2bf077[_0x128e('0x5b')][_0x128e('0x50')](function(_0x5bc287){_0x309f93[_0x128e('0x5e')](getAgents(_0x730873,_0x5bc287));});}});return BPromise[_0x128e('0x5f')](_0x309f93)['then'](function(_0x4e6283){_0x3a75eb=_[_0x128e('0x5a')](_0x3a75eb,_['flatten'](_0x4e6283));_0x5c0490(_0x3a75eb);})[_0x128e('0x54')](function(_0x23d4ef){_0x1170db(_0x23d4ef);});});}function getAgents(_0x1eeb07,_0x2a76fe){return new BPromise(function(_0x355960,_0xbcec69){return db[_0x1eeb07]['findOne']({'where':{'id':_0x2a76fe}})[_0x128e('0x2a')](function(_0x10fb42){return _0x10fb42['getAgents']({'attributes':['id'],'raw':!![]})[_0x128e('0x2a')](function(_0x1a2984){var _0x4d7ac7=_[_0x128e('0x60')](_0x1a2984,'id');_0x355960(_0x4d7ac7);});})[_0x128e('0x54')](function(_0x52e8ad){_0xbcec69(_0x52e8ad);});});} \ No newline at end of file +var _0xfd49=['create','forEach','recipient','emit','userNotification:send','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','ids','queue','replace','Queue','push','all','union','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','./userNotification.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join'];(function(_0x49fde0,_0x24da3f){var _0x6c9465=function(_0x26d7d4){while(--_0x26d7d4){_0x49fde0['push'](_0x49fde0['shift']());}};_0x6c9465(++_0x24da3f);}(_0xfd49,0xdf));var _0x9fd4=function(_0x32701d,_0x15130b){_0x32701d=_0x32701d-0x0;var _0x318a72=_0xfd49[_0x32701d];return _0x318a72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fd4('0x0'));var zipdir=require(_0x9fd4('0x1'));var jsonpatch=require(_0x9fd4('0x2'));var rp=require(_0x9fd4('0x3'));var moment=require(_0x9fd4('0x4'));var BPromise=require(_0x9fd4('0x5'));var Mustache=require('mustache');var util=require(_0x9fd4('0x6'));var path=require('path');var sox=require(_0x9fd4('0x7'));var csv=require(_0x9fd4('0x8'));var ejs=require(_0x9fd4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fd4('0xa'));var squel=require(_0x9fd4('0xb'));var crypto=require('crypto');var jsforce=require(_0x9fd4('0xc'));var deskjs=require(_0x9fd4('0xd'));var toCsv=require(_0x9fd4('0x8'));var querystring=require(_0x9fd4('0xe'));var Papa=require(_0x9fd4('0xf'));var Redis=require(_0x9fd4('0x10'));var authService=require(_0x9fd4('0x11'));var qs=require(_0x9fd4('0x12'));var as=require(_0x9fd4('0x13'));var hardwareService=require(_0x9fd4('0x14'));var logger=require(_0x9fd4('0x15'))(_0x9fd4('0x16'));var utils=require(_0x9fd4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9fd4('0x18'))['db'];config['redis']=_[_0x9fd4('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9fd4('0x1a')]));require(_0x9fd4('0x1b'))[_0x9fd4('0x1c')](socket);function respondWithStatusCode(_0x1194cc,_0x3643d5){_0x3643d5=_0x3643d5||0xcc;return function(_0x1564aa){if(_0x1564aa){return _0x1194cc['sendStatus'](_0x3643d5);}return _0x1194cc['status'](_0x3643d5)[_0x9fd4('0x1d')]();};}function respondWithResult(_0x42f330,_0x5120de){_0x5120de=_0x5120de||0xc8;return function(_0x493986){if(_0x493986){return _0x42f330[_0x9fd4('0x1e')](_0x5120de)['json'](_0x493986);}};}function respondWithFilteredResult(_0x3f4a62,_0x2f6f97){return function(_0x452360){if(_0x452360){var _0x362c4d=typeof _0x2f6f97[_0x9fd4('0x1f')]===_0x9fd4('0x20')&&typeof _0x2f6f97[_0x9fd4('0x21')]===_0x9fd4('0x20');var _0x4c2f34=_0x452360[_0x9fd4('0x22')];var _0x17cc82=_0x362c4d?0x0:_0x2f6f97[_0x9fd4('0x1f')];var _0x3d61b7=_0x362c4d?_0x452360['count']:_0x2f6f97[_0x9fd4('0x1f')]+_0x2f6f97[_0x9fd4('0x21')];var _0x1fc068;if(_0x3d61b7>=_0x4c2f34){_0x3d61b7=_0x4c2f34;_0x1fc068=0xc8;}else{_0x1fc068=0xce;}_0x3f4a62[_0x9fd4('0x1e')](_0x1fc068);return _0x3f4a62[_0x9fd4('0x23')](_0x9fd4('0x24'),_0x17cc82+'-'+_0x3d61b7+'/'+_0x4c2f34)[_0x9fd4('0x25')](_0x452360);}return null;};}function patchUpdates(_0x4bdd3d){return function(_0x28ea73){try{jsonpatch['apply'](_0x28ea73,_0x4bdd3d,!![]);}catch(_0x2f7dcc){return BPromise[_0x9fd4('0x26')](_0x2f7dcc);}return _0x28ea73[_0x9fd4('0x27')]();};}function saveUpdates(_0x1c409f,_0x3fa7a2){return function(_0x4d9a67){if(_0x4d9a67){return _0x4d9a67[_0x9fd4('0x28')](_0x1c409f)['then'](function(_0x493e08){return _0x493e08;});}return null;};}function removeEntity(_0x4e7176,_0x429c7d){return function(_0x3e3799){if(_0x3e3799){return _0x3e3799[_0x9fd4('0x29')]()[_0x9fd4('0x2a')](function(){_0x4e7176[_0x9fd4('0x1e')](0xcc)[_0x9fd4('0x1d')]();});}};}function handleEntityNotFound(_0x56202a,_0x4d5666){return function(_0x1557bc){if(!_0x1557bc){_0x56202a['sendStatus'](0x194);}return _0x1557bc;};}function handleError(_0x1d845f,_0x971d2a){_0x971d2a=_0x971d2a||0x1f4;return function(_0x137790){logger[_0x9fd4('0x2b')](_0x137790[_0x9fd4('0x2c')]);if(_0x137790[_0x9fd4('0x2d')]){delete _0x137790[_0x9fd4('0x2d')];}_0x1d845f[_0x9fd4('0x1e')](_0x971d2a)[_0x9fd4('0x2e')](_0x137790);};}exports[_0x9fd4('0x2f')]=function(_0x213a08,_0x3b680d,_0x11df6e){if(!_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x31')](_0x9fd4('0x32'))&&!_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x31')](_0x9fd4('0x33'))){throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x36'));}else{if(_0x213a08[_0x9fd4('0x30')]['hasOwnProperty'](_0x9fd4('0x33'))&&!_0x213a08[_0x9fd4('0x30')]['hasOwnProperty'](_0x9fd4('0x37'))){throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x213a08['body'][_0x9fd4('0x31')](_0x9fd4('0x38'))){throw new db[(_0x9fd4('0x34'))]['ValidationError'](_0x9fd4('0x39'));}else{try{var _0x5de72e=JSON[_0x9fd4('0x3a')](_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x38')]);}catch(_0x21d9b2){logger['error'](_0x21d9b2);throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x3b'));}var _0x555dd5=[_0x9fd4('0x3c'),'faxqueue',_0x9fd4('0x3d'),_0x9fd4('0x3e'),_0x9fd4('0x3f'),_0x9fd4('0x40'),_0x9fd4('0x41'),_0x9fd4('0x42'),_0x9fd4('0x43')];if(_[_0x9fd4('0x44')](_0x5de72e,function(_0x1665f6){return!_[_0x9fd4('0x45')](_0x555dd5,_0x1665f6[_0x9fd4('0x46')][_0x9fd4('0x47')]());})){throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x48'));}}}var _0x31202b={};_0x31202b[_0x9fd4('0x49')]=_0x213a08[_0x9fd4('0x30')]['hasOwnProperty'](_0x9fd4('0x49'))?_0x213a08['body'][_0x9fd4('0x49')]:_0x213a08['user']['fullname'];_0x31202b[_0x9fd4('0x4a')]=_[_0x9fd4('0x4b')](_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x4a')])?null:_0x213a08['body']['recipientsDescription'];_0x31202b[_0x9fd4('0x4c')]=_0x213a08[_0x9fd4('0x30')][_0x9fd4('0x4c')]||![];_0x31202b['SenderId']=_0x213a08[_0x9fd4('0x43')]['id'];return getContent(_0x213a08[_0x9fd4('0x30')])['then'](function(_0x48d6ef){_0x31202b[_0x9fd4('0x30')]=_0x48d6ef;return getRecipients(_0x5de72e);})[_0x9fd4('0x2a')](function(_0x485b7e){_0x31202b[_0x9fd4('0x4d')]=_[_0x9fd4('0x4e')](_0x485b7e)[_0x9fd4('0x4f')](',');return db['sequelize']['transaction'](function(_0x2c94b1){return db['UserNotification'][_0x9fd4('0x50')](_0x31202b,{'raw':!![],'transaction':_0x2c94b1})[_0x9fd4('0x2a')](function(_0x1eddf0){var _0x5f4941={'sender':_0x31202b[_0x9fd4('0x49')],'description':_0x31202b[_0x9fd4('0x4a')],'content':_0x31202b[_0x9fd4('0x30')],'beep':_0x31202b[_0x9fd4('0x4c')]};_0x485b7e[_0x9fd4('0x51')](function(_0x294dfa){_0x5f4941[_0x9fd4('0x52')]=_0x294dfa;socket[_0x9fd4('0x53')](_0x9fd4('0x54'),_0x5f4941);});return _0x1eddf0;});});})[_0x9fd4('0x2a')](respondWithResult(_0x3b680d,0xc9))['catch'](handleError(_0x3b680d,null));};function getContent(_0x58f7f0){return new BPromise(function(_0x59d8ec,_0x10d595){if(_0x58f7f0[_0x9fd4('0x32')]){_0x59d8ec(_0x58f7f0[_0x9fd4('0x32')]);return;}return db['Template'][_0x9fd4('0x55')]({'attributes':[_0x9fd4('0x56')],'where':{'id':_0x58f7f0[_0x9fd4('0x33')]},'raw':!![]})[_0x9fd4('0x2a')](function(_0x9ae96d){if(!_0x9ae96d)throw new db[(_0x9fd4('0x34'))][(_0x9fd4('0x35'))](_0x9fd4('0x57'));var _0x16cf6e=Mustache[_0x9fd4('0x58')](_0x9ae96d['html'],_0x58f7f0[_0x9fd4('0x37')]);_0x59d8ec(_0x16cf6e);})[_0x9fd4('0x59')](function(_0x19ef8d){_0x10d595(_0x19ef8d);});});}function getRecipients(_0x3c442d){return new BPromise(function(_0x15fc22,_0x2e8a43){var _0x4d6ffe=[];var _0x193a7c=[];_0x3c442d[_0x9fd4('0x51')](function(_0x115d1d){var _0x472434=_[_0x9fd4('0x5a')](_0x115d1d[_0x9fd4('0x46')][_0x9fd4('0x47')]());if(_0x472434===_0x9fd4('0x5b')){_0x4d6ffe=_['union'](_0x4d6ffe,_0x115d1d[_0x9fd4('0x5c')]);}else{if(_[_0x9fd4('0x45')](_0x472434,_0x9fd4('0x5d')))_0x472434=_0x472434[_0x9fd4('0x5e')](_0x9fd4('0x5d'),_0x9fd4('0x5f'));_0x115d1d[_0x9fd4('0x5c')][_0x9fd4('0x51')](function(_0x25eaea){_0x193a7c[_0x9fd4('0x60')](getAgents(_0x472434,_0x25eaea));});}});return BPromise[_0x9fd4('0x61')](_0x193a7c)[_0x9fd4('0x2a')](function(_0x5b1a8d){_0x4d6ffe=_[_0x9fd4('0x62')](_0x4d6ffe,_['flatten'](_0x5b1a8d));_0x15fc22(_0x4d6ffe);})['catch'](function(_0x128dfd){_0x2e8a43(_0x128dfd);});});}function getAgents(_0xa4ee48,_0x8dedec){return new BPromise(function(_0x3fb7ac,_0x270c80){return db[_0xa4ee48][_0x9fd4('0x55')]({'where':{'id':_0x8dedec}})['then'](function(_0x55e1e6){return _0x55e1e6[_0x9fd4('0x63')]({'attributes':['id'],'raw':!![]})[_0x9fd4('0x2a')](function(_0x4947fb){var _0x114bb4=_[_0x9fd4('0x64')](_0x4947fb,'id');_0x3fb7ac(_0x114bb4);});})[_0x9fd4('0x59')](function(_0x5aa5ac){_0x270c80(_0x5aa5ac);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 74ea2cd..c77efdb 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 _0x6c6e=['exports','events','UserNotification','setMaxListeners','save','emit','hook'];(function(_0x1bedf1,_0x196571){var _0xc0a2ea=function(_0xe8c187){while(--_0xe8c187){_0x1bedf1['push'](_0x1bedf1['shift']());}};_0xc0a2ea(++_0x196571);}(_0x6c6e,0x1a5));var _0xe6c6=function(_0x4d6263,_0x4808f9){_0x4d6263=_0x4d6263-0x0;var _0x5ee8f4=_0x6c6e[_0x4d6263];return _0x5ee8f4;};'use strict';var EventEmitter=require(_0xe6c6('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xe6c6('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe6c6('0x2')](0x0);var events={'afterCreate':_0xe6c6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ee30c){return function(_0x1bf4ae,_0x610507,_0xec2e0){UserNotificationEvents[_0xe6c6('0x4')](_0x4ee30c+':'+_0x1bf4ae['id'],_0x1bf4ae);UserNotificationEvents[_0xe6c6('0x4')](_0x4ee30c,_0x1bf4ae);_0xec2e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xe6c6('0x5')](e,emitEvent(event));}}module[_0xe6c6('0x6')]=UserNotificationEvents; \ No newline at end of file +var _0x6d36=['events','../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x17b6ba,_0x53a9bb){var _0x34186a=function(_0x11de73){while(--_0x11de73){_0x17b6ba['push'](_0x17b6ba['shift']());}};_0x34186a(++_0x53a9bb);}(_0x6d36,0xab));var _0x66d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d36[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x66d3('0x0'));var UserNotification=require(_0x66d3('0x1'))['db'][_0x66d3('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x66d3('0x3')](0x0);var events={'afterCreate':_0x66d3('0x4'),'afterUpdate':'update','afterDestroy':_0x66d3('0x5')};function emitEvent(_0x2dfd6f){return function(_0x2af8a8,_0x3286c6,_0x1cf8f1){UserNotificationEvents[_0x66d3('0x6')](_0x2dfd6f+':'+_0x2af8a8['id'],_0x2af8a8);UserNotificationEvents[_0x66d3('0x6')](_0x2dfd6f,_0x2af8a8);_0x1cf8f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x66d3('0x7')](e,emitEvent(event));}}module[_0x66d3('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index e08982d..ca66fa0 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 _0x6e0f=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4'];(function(_0x17afad,_0x26271e){var _0x4b58cd=function(_0x7f4bef){while(--_0x7f4bef){_0x17afad['push'](_0x17afad['shift']());}};_0x4b58cd(++_0x26271e);}(_0x6e0f,0x1c8));var _0xf6e0=function(_0x5c9e3e,_0xcb60fd){_0x5c9e3e=_0x5c9e3e-0x0;var _0x1e3b33=_0x6e0f[_0x5c9e3e];return _0x1e3b33;};'use strict';var _=require(_0xf6e0('0x0'));var util=require('util');var logger=require(_0xf6e0('0x1'))(_0xf6e0('0x2'));var moment=require(_0xf6e0('0x3'));var BPromise=require(_0xf6e0('0x4'));var rp=require(_0xf6e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf6e0('0x6'));var attributes=require('./userNotification.attributes');module[_0xf6e0('0x7')]=function(_0x333c3a,_0x370861){return _0x333c3a[_0xf6e0('0x8')](_0xf6e0('0x9'),attributes,{'tableName':_0xf6e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6e0('0xb'),'collate':_0xf6e0('0xc')});}; \ No newline at end of file +var _0xeda3=['api','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4b34ba,_0x4e4757){var _0x541d00=function(_0x3bb310){while(--_0x3bb310){_0x4b34ba['push'](_0x4b34ba['shift']());}};_0x541d00(++_0x4e4757);}(_0xeda3,0x17f));var _0x3eda=function(_0x778eae,_0x1b6ba0){_0x778eae=_0x778eae-0x0;var _0x262771=_0xeda3[_0x778eae];return _0x262771;};'use strict';var _=require(_0x3eda('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3eda('0x1'));var moment=require('moment');var BPromise=require(_0x3eda('0x2'));var rp=require(_0x3eda('0x3'));var fs=require('fs');var path=require(_0x3eda('0x4'));var rimraf=require(_0x3eda('0x5'));var config=require('../../config/environment');var attributes=require(_0x3eda('0x6'));module[_0x3eda('0x7')]=function(_0x4141d9,_0x79e166){return _0x4141d9[_0x3eda('0x8')]('UserNotification',attributes,{'tableName':_0x3eda('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3eda('0xa'),'collate':_0x3eda('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index b033e95..f283de7 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 _0xd523=['message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserNotification,\x20%s,\x20%s','stringify','error','code'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0xd523,0xb9));var _0x3d52=function(_0x557ae7,_0x18b4d8){_0x557ae7=_0x557ae7-0x0;var _0x4c2363=_0xd523[_0x557ae7];return _0x4c2363;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require(_0x3d52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require(_0x3d52('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3d52('0x8'));var client=jayson[_0x3d52('0x9')][_0x3d52('0xa')]({'port':0x232a});config[_0x3d52('0xb')]=_[_0x3d52('0xc')](config['redis'],{'host':_0x3d52('0xd'),'port':0x18eb});var socket=require(_0x3d52('0xe'))(new Redis(config[_0x3d52('0xb')]));require('./userNotification.socket')[_0x3d52('0xf')](socket);function respondWithRpcPromise(_0xf9278c,_0x1a1bde,_0xf67988){return new BPromise(function(_0x4cbc07,_0x3d6764){return client[_0x3d52('0x10')](_0xf9278c,_0xf67988)[_0x3d52('0x11')](function(_0x12f92e){logger[_0x3d52('0x12')](_0x3d52('0x13'),_0x1a1bde,'request\x20sent');logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x1a1bde,'request\x20sent',JSON[_0x3d52('0x14')](_0x12f92e));if(_0x12f92e[_0x3d52('0x15')]){if(_0x12f92e[_0x3d52('0x15')][_0x3d52('0x16')]===0x1f4){logger[_0x3d52('0x15')]('UserNotification,\x20%s,\x20%s',_0x1a1bde,_0x12f92e[_0x3d52('0x15')][_0x3d52('0x17')]);return _0x3d6764(_0x12f92e[_0x3d52('0x15')][_0x3d52('0x17')]);}logger[_0x3d52('0x15')](_0x3d52('0x13'),_0x1a1bde,_0x12f92e[_0x3d52('0x15')][_0x3d52('0x17')]);return _0x4cbc07(_0x12f92e[_0x3d52('0x15')][_0x3d52('0x17')]);}else{logger[_0x3d52('0x12')](_0x3d52('0x13'),_0x1a1bde,_0x3d52('0x18'));_0x4cbc07(_0x12f92e['result'][_0x3d52('0x17')]);}})[_0x3d52('0x19')](function(_0x314319){logger[_0x3d52('0x15')](_0x3d52('0x13'),_0x1a1bde,_0x314319);_0x3d6764(_0x314319);});});} \ No newline at end of file +var _0xe30c=['debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x26acc2,_0x16a76d){var _0x4eec8f=function(_0xd58f2d){while(--_0xd58f2d){_0x26acc2['push'](_0x26acc2['shift']());}};_0x4eec8f(++_0x16a76d);}(_0xe30c,0x1aa));var _0xce30=function(_0x4f5959,_0x3f40fd){_0x4f5959=_0x4f5959-0x0;var _0x135ef2=_0xe30c[_0x4f5959];return _0x135ef2;};'use strict';var _=require(_0xce30('0x0'));var util=require(_0xce30('0x1'));var moment=require(_0xce30('0x2'));var BPromise=require(_0xce30('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce30('0x4'));var db=require(_0xce30('0x5'))['db'];var utils=require(_0xce30('0x6'));var logger=require(_0xce30('0x7'))('rpc');var config=require(_0xce30('0x8'));var jayson=require(_0xce30('0x9'));var client=jayson[_0xce30('0xa')][_0xce30('0xb')]({'port':0x232a});config[_0xce30('0xc')]=_[_0xce30('0xd')](config[_0xce30('0xc')],{'host':_0xce30('0xe'),'port':0x18eb});var socket=require(_0xce30('0xf'))(new Redis(config[_0xce30('0xc')]));require(_0xce30('0x10'))[_0xce30('0x11')](socket);function respondWithRpcPromise(_0x2c1a61,_0xa685f4,_0x4fc2d2){return new BPromise(function(_0x356a0e,_0xb26515){return client[_0xce30('0x12')](_0x2c1a61,_0x4fc2d2)['then'](function(_0x107301){logger[_0xce30('0x13')](_0xce30('0x14'),_0xa685f4,_0xce30('0x15'));logger[_0xce30('0x16')](_0xce30('0x17'),_0xa685f4,_0xce30('0x15'),JSON['stringify'](_0x107301));if(_0x107301[_0xce30('0x18')]){if(_0x107301[_0xce30('0x18')][_0xce30('0x19')]===0x1f4){logger[_0xce30('0x18')](_0xce30('0x14'),_0xa685f4,_0x107301['error'][_0xce30('0x1a')]);return _0xb26515(_0x107301[_0xce30('0x18')][_0xce30('0x1a')]);}logger[_0xce30('0x18')](_0xce30('0x14'),_0xa685f4,_0x107301[_0xce30('0x18')][_0xce30('0x1a')]);return _0x356a0e(_0x107301['error']['message']);}else{logger[_0xce30('0x13')](_0xce30('0x14'),_0xa685f4,_0xce30('0x15'));_0x356a0e(_0x107301[_0xce30('0x1b')][_0xce30('0x1a')]);}})['catch'](function(_0x7cbe06){logger[_0xce30('0x18')](_0xce30('0x14'),_0xa685f4,_0x7cbe06);_0xb26515(_0x7cbe06);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 8fe7029..2ea38e7 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 _0xe576=['register','./userNotification.events','remove','emit','removeListener'];(function(_0x1bec53,_0x2278cb){var _0x39d8ff=function(_0xb89cad){while(--_0xb89cad){_0x1bec53['push'](_0x1bec53['shift']());}};_0x39d8ff(++_0x2278cb);}(_0xe576,0x9c));var _0x6e57=function(_0x3a1d7d,_0x11dfbd){_0x3a1d7d=_0x3a1d7d-0x0;var _0x2af564=_0xe576[_0x3a1d7d];return _0x2af564;};'use strict';var UserNotificationEvents=require(_0x6e57('0x0'));var events=['save',_0x6e57('0x1'),'update'];function createListener(_0x2e0aeb,_0xa0ee5b){return function(_0x54e8cb){_0xa0ee5b[_0x6e57('0x2')](_0x2e0aeb,_0x54e8cb);};}function removeListener(_0x193144,_0x33f79b){return function(){UserNotificationEvents[_0x6e57('0x3')](_0x193144,_0x33f79b);};}exports[_0x6e57('0x4')]=function(_0x49976f){for(var _0x578d07=0x0,_0x400362=events['length'];_0x578d07<_0x400362;_0x578d07++){var _0x3d19b7=events[_0x578d07];var _0x3a386a=createListener('userNotification:'+_0x3d19b7,_0x49976f);UserNotificationEvents['on'](_0x3d19b7,_0x3a386a);}}; \ No newline at end of file +var _0xc87a=['register','userNotification:','./userNotification.events','save','remove','emit','removeListener'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc87a,0x136));var _0xac87=function(_0x32809a,_0x2a7e5){_0x32809a=_0x32809a-0x0;var _0x5eff3d=_0xc87a[_0x32809a];return _0x5eff3d;};'use strict';var UserNotificationEvents=require(_0xac87('0x0'));var events=[_0xac87('0x1'),_0xac87('0x2'),'update'];function createListener(_0x3135d8,_0x1cf4fc){return function(_0x915834){_0x1cf4fc[_0xac87('0x3')](_0x3135d8,_0x915834);};}function removeListener(_0x4f4ee3,_0xfaebae){return function(){UserNotificationEvents[_0xac87('0x4')](_0x4f4ee3,_0xfaebae);};}exports[_0xac87('0x5')]=function(_0x304761){for(var _0x4fd280=0x0,_0x59e6aa=events['length'];_0x4fd280<_0x59e6aa;_0x4fd280++){var _0x1a44f6=events[_0x4fd280];var _0x58e3e0=createListener(_0xac87('0x6')+_0x1a44f6,_0x304761);UserNotificationEvents['on'](_0x1a44f6,_0x58e3e0);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 0a531bf..3aaeb46 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2d23d2,_0x494788){var _0xcc59f1=function(_0x28aaab){while(--_0x28aaab){_0x2d23d2['push'](_0x2d23d2['shift']());}};_0xcc59f1(++_0x494788);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3fb560,_0x1e301f){var _0x4999b3=function(_0x4ad22e){while(--_0x4ad22e){_0x3fb560['push'](_0x3fb560['shift']());}};_0x4999b3(++_0x1e301f);}(_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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e6b68e2..d915b38 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 _0x192f=['exports','INTEGER','sequelize'];(function(_0x40c208,_0x5e1098){var _0x416ff4=function(_0x423555){while(--_0x423555){_0x40c208['push'](_0x40c208['shift']());}};_0x416ff4(++_0x5e1098);}(_0x192f,0x19a));var _0xf192=function(_0x333a41,_0x355250){_0x333a41=_0x333a41-0x0;var _0x1d663e=_0x192f[_0x333a41];return _0x1d663e;};'use strict';var Sequelize=require(_0xf192('0x0'));module[_0xf192('0x1')]={'penalty':{'type':Sequelize[_0xf192('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3ff5=['INTEGER','sequelize','exports'];(function(_0x246555,_0x4d9844){var _0x3918b5=function(_0x3dffae){while(--_0x3dffae){_0x246555['push'](_0x246555['shift']());}};_0x3918b5(++_0x4d9844);}(_0x3ff5,0x1e1));var _0x53ff=function(_0x26b25,_0x1c51d5){_0x26b25=_0x26b25-0x0;var _0x27f9ff=_0x3ff5[_0x26b25];return _0x27f9ff;};'use strict';var Sequelize=require(_0x53ff('0x0'));module[_0x53ff('0x1')]={'penalty':{'type':Sequelize[_0x53ff('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index f7ef68d..619e818 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 _0xb260=['UserOpenchannelQueue','api','moment','bluebird','request-promise','./userOpenchannelQueue.attributes','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb260,0x119));var _0x0b26=function(_0x441c45,_0x381388){_0x441c45=_0x441c45-0x0;var _0x52cd6f=_0xb260[_0x441c45];return _0x52cd6f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0b26('0x0'));var moment=require(_0x0b26('0x1'));var BPromise=require(_0x0b26('0x2'));var rp=require(_0x0b26('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0b26('0x4'));module[_0x0b26('0x5')]=function(_0x3b2e9f,_0x6b6b10){return _0x3b2e9f[_0x0b26('0x6')](_0x0b26('0x7'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x438f=['rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xde12cd,_0x269a1f){var _0x93a6e2=function(_0x4b5236){while(--_0x4b5236){_0xde12cd['push'](_0xde12cd['shift']());}};_0x93a6e2(++_0x269a1f);}(_0x438f,0x17f));var _0xf438=function(_0x21b44e,_0x4e602e){_0x21b44e=_0x21b44e-0x0;var _0x225277=_0x438f[_0x21b44e];return _0x225277;};'use strict';var _=require(_0xf438('0x0'));var util=require(_0xf438('0x1'));var logger=require(_0xf438('0x2'))(_0xf438('0x3'));var moment=require('moment');var BPromise=require(_0xf438('0x4'));var rp=require(_0xf438('0x5'));var fs=require('fs');var path=require(_0xf438('0x6'));var rimraf=require(_0xf438('0x7'));var config=require('../../config/environment');var attributes=require(_0xf438('0x8'));module[_0xf438('0x9')]=function(_0x3b7d32,_0x3c7066){return _0x3b7d32[_0xf438('0xa')](_0xf438('0xb'),attributes,{'tableName':_0xf438('0xc'),'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 26804e0..7d817e9 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 _0xa5f6=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','bluebird','ioredis'];(function(_0x59b0c5,_0x26caa2){var _0x2c9b11=function(_0x325360){while(--_0x325360){_0x59b0c5['push'](_0x59b0c5['shift']());}};_0x2c9b11(++_0x26caa2);}(_0xa5f6,0xe1));var _0x6a5f=function(_0x35367f,_0x411c08){_0x35367f=_0x35367f-0x0;var _0x244ae9=_0xa5f6[_0x35367f];return _0x244ae9;};'use strict';var _=require('lodash');var util=require(_0x6a5f('0x0'));var moment=require('moment');var BPromise=require(_0x6a5f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a5f('0x2'));var db=require(_0x6a5f('0x3'))['db'];var utils=require(_0x6a5f('0x4'));var logger=require(_0x6a5f('0x5'))('rpc');var config=require(_0x6a5f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6a5f('0x7')][_0x6a5f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d2ef1,_0x52f655,_0x5dcaaf){return new BPromise(function(_0x218a43,_0xf393cf){return client['request'](_0x5d2ef1,_0x5dcaaf)[_0x6a5f('0x9')](function(_0x5b4c5d){logger[_0x6a5f('0xa')](_0x6a5f('0xb'),_0x52f655,_0x6a5f('0xc'));logger[_0x6a5f('0xd')](_0x6a5f('0xe'),_0x52f655,_0x6a5f('0xc'),JSON[_0x6a5f('0xf')](_0x5b4c5d));if(_0x5b4c5d[_0x6a5f('0x10')]){if(_0x5b4c5d[_0x6a5f('0x10')][_0x6a5f('0x11')]===0x1f4){logger[_0x6a5f('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x52f655,_0x5b4c5d['error'][_0x6a5f('0x12')]);return _0xf393cf(_0x5b4c5d[_0x6a5f('0x10')][_0x6a5f('0x12')]);}logger[_0x6a5f('0x10')](_0x6a5f('0xb'),_0x52f655,_0x5b4c5d['error'][_0x6a5f('0x12')]);return _0x218a43(_0x5b4c5d[_0x6a5f('0x10')][_0x6a5f('0x12')]);}else{logger[_0x6a5f('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x52f655,_0x6a5f('0xc'));_0x218a43(_0x5b4c5d['result'][_0x6a5f('0x12')]);}})['catch'](function(_0x43dd3f){logger[_0x6a5f('0x10')](_0x6a5f('0xb'),_0x52f655,_0x43dd3f);_0xf393cf(_0x43dd3f);});});} \ No newline at end of file +var _0x65cb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x18843c,_0x6bc7a9){var _0x1acd40=function(_0x4f32b6){while(--_0x4f32b6){_0x18843c['push'](_0x18843c['shift']());}};_0x1acd40(++_0x6bc7a9);}(_0x65cb,0xa4));var _0xb65c=function(_0x477500,_0x13549a){_0x477500=_0x477500-0x0;var _0x52b4ff=_0x65cb[_0x477500];return _0x52b4ff;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var moment=require(_0xb65c('0x1'));var BPromise=require(_0xb65c('0x2'));var rs=require(_0xb65c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))(_0xb65c('0x7'));var config=require(_0xb65c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb65c('0x9')][_0xb65c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25087d,_0xacb77d,_0x112f07){return new BPromise(function(_0x23dffb,_0x22b6a3){return client[_0xb65c('0xb')](_0x25087d,_0x112f07)['then'](function(_0x43e68f){logger[_0xb65c('0xc')](_0xb65c('0xd'),_0xacb77d,_0xb65c('0xe'));logger['debug'](_0xb65c('0xf'),_0xacb77d,'request\x20sent',JSON[_0xb65c('0x10')](_0x43e68f));if(_0x43e68f[_0xb65c('0x11')]){if(_0x43e68f[_0xb65c('0x11')][_0xb65c('0x12')]===0x1f4){logger[_0xb65c('0x11')](_0xb65c('0xd'),_0xacb77d,_0x43e68f['error'][_0xb65c('0x13')]);return _0x22b6a3(_0x43e68f[_0xb65c('0x11')][_0xb65c('0x13')]);}logger[_0xb65c('0x11')](_0xb65c('0xd'),_0xacb77d,_0x43e68f[_0xb65c('0x11')][_0xb65c('0x13')]);return _0x23dffb(_0x43e68f['error'][_0xb65c('0x13')]);}else{logger[_0xb65c('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xacb77d,_0xb65c('0xe'));_0x23dffb(_0x43e68f['result'][_0xb65c('0x13')]);}})[_0xb65c('0x14')](function(_0x2666e4){logger[_0xb65c('0x11')](_0xb65c('0xd'),_0xacb77d,_0x2666e4);_0x22b6a3(_0x2666e4);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 702c292..7e45ca5 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 _0xaa7c=['./userProfile.controller','get','/describe','/:id','isAuthenticated','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x262c27,_0x13aa51){var _0xee728a=function(_0x2d1388){while(--_0x2d1388){_0x262c27['push'](_0x262c27['shift']());}};_0xee728a(++_0x13aa51);}(_0xaa7c,0x1a9));var _0xcaa7=function(_0x204fa0,_0x52fcd1){_0x204fa0=_0x204fa0-0x0;var _0x4832e6=_0xaa7c[_0x204fa0];return _0x4832e6;};'use strict';var multer=require(_0xcaa7('0x0'));var util=require(_0xcaa7('0x1'));var path=require('path');var timeout=require(_0xcaa7('0x2'));var express=require('express');var router=express[_0xcaa7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xcaa7('0x4'));var interaction=require(_0xcaa7('0x5'));var config=require(_0xcaa7('0x6'));var controller=require(_0xcaa7('0x7'));router[_0xcaa7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcaa7('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xcaa7('0x8')](_0xcaa7('0xa'),auth[_0xcaa7('0xb')](),controller['show']);router[_0xcaa7('0x8')](_0xcaa7('0xc'),auth[_0xcaa7('0xb')](),controller['getSections']);router[_0xcaa7('0x8')](_0xcaa7('0xd'),auth[_0xcaa7('0xb')](),controller[_0xcaa7('0xe')]);router[_0xcaa7('0xf')]('/',auth[_0xcaa7('0xb')](),controller[_0xcaa7('0x10')]);router[_0xcaa7('0xf')](_0xcaa7('0x11'),auth[_0xcaa7('0xb')](),controller[_0xcaa7('0x12')]);router[_0xcaa7('0xf')](_0xcaa7('0xc'),auth[_0xcaa7('0xb')](),controller['addSections']);router[_0xcaa7('0xf')](_0xcaa7('0xd'),auth['isAuthenticated'](),controller['addResources']);router[_0xcaa7('0x13')]('/:id',auth[_0xcaa7('0xb')](),controller[_0xcaa7('0x14')]);router[_0xcaa7('0x15')](_0xcaa7('0xa'),auth[_0xcaa7('0xb')](),controller[_0xcaa7('0x16')]);router[_0xcaa7('0x15')](_0xcaa7('0xc'),auth[_0xcaa7('0xb')](),controller['removeSections']);router[_0xcaa7('0x15')](_0xcaa7('0xd'),auth[_0xcaa7('0xb')](),controller['removeResources']);module[_0xcaa7('0x17')]=router; \ No newline at end of file +var _0x28c8=['clone','addSections','addResources','update','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/sections','getSections','/:id/resources','getResources','post','create'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0x28c8,0xac));var _0x828c=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x28c8[_0x102ff9];return _0x24fa97;};'use strict';var multer=require(_0x828c('0x0'));var util=require(_0x828c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x828c('0x2')]();var fs_extra=require(_0x828c('0x3'));var auth=require(_0x828c('0x4'));var interaction=require(_0x828c('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x828c('0x6')]('/',auth[_0x828c('0x7')](),controller[_0x828c('0x8')]);router[_0x828c('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x828c('0x9')]);router['get']('/:id',auth[_0x828c('0x7')](),controller[_0x828c('0xa')]);router[_0x828c('0x6')](_0x828c('0xb'),auth[_0x828c('0x7')](),controller[_0x828c('0xc')]);router['get'](_0x828c('0xd'),auth[_0x828c('0x7')](),controller[_0x828c('0xe')]);router[_0x828c('0xf')]('/',auth['isAuthenticated'](),controller[_0x828c('0x10')]);router[_0x828c('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0x828c('0x11')]);router[_0x828c('0xf')](_0x828c('0xb'),auth['isAuthenticated'](),controller[_0x828c('0x12')]);router['post'](_0x828c('0xd'),auth['isAuthenticated'](),controller[_0x828c('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x828c('0x14')]);router[_0x828c('0x15')](_0x828c('0x16'),auth[_0x828c('0x7')](),controller[_0x828c('0x17')]);router[_0x828c('0x15')](_0x828c('0xb'),auth[_0x828c('0x7')](),controller[_0x828c('0x18')]);router['delete']('/:id/resources',auth[_0x828c('0x7')](),controller[_0x828c('0x19')]);module[_0x828c('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 63d26de..94033dc 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 _0x439e=['BOOLEAN','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x439e,0x171));var _0xe439=function(_0x41adfb,_0x1ca790){_0x41adfb=_0x41adfb-0x0;var _0x3cf1d3=_0x439e[_0x41adfb];return _0x3cf1d3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe439('0x0')],'allowNull':![],'unique':_0xe439('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x51ad24){this[_0xe439('0x2')](_0xe439('0x3'),_0x51ad24?_0x51ad24[_0xe439('0x4')](''):[]);},'get':function(){return this[_0xe439('0x5')](_0xe439('0x3'))?this['getDataValue'](_0xe439('0x3'))[_0xe439('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xe439('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe439('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe439('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe439('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe439('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xe439('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xe439('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6181=['STRING','crudPermissions','getDataValue','BOOLEAN','sequelize','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6181,0xa6));var _0x1618=function(_0x587dc0,_0x2a409f){_0x587dc0=_0x587dc0-0x0;var _0x4abb3e=_0x6181[_0x587dc0];return _0x4abb3e;};'use strict';var Sequelize=require(_0x1618('0x0'));module[_0x1618('0x1')]={'name':{'type':Sequelize[_0x1618('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x1618('0x2')],'set':function(_0x510b08){this['setDataValue'](_0x1618('0x3'),_0x510b08?_0x510b08['join'](''):[]);},'get':function(){return this[_0x1618('0x4')](_0x1618('0x3'))?this[_0x1618('0x4')](_0x1618('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1618('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1618('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1002bb4..7139f6c 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 _0x3474=['params','find','create','body','clone','length','merge','createdAt','omit','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','findAll','sectionId','userProfileId','Resources','describe','addSections','push','get','removeSections','ids','getSections','enabled','includes','subsections','concat','findOne','Dashboard','forEach','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4c9f70,_0x53990b){var _0x3b1dd9=function(_0x1548fa){while(--_0x1548fa){_0x4c9f70['push'](_0x4c9f70['shift']());}};_0x3b1dd9(++_0x53990b);}(_0x3474,0x179));var _0x4347=function(_0xef1be3,_0x46a62c){_0xef1be3=_0xef1be3-0x0;var _0x41bdef=_0x3474[_0xef1be3];return _0x41bdef;};'use strict';var emlformat=require(_0x4347('0x0'));var rimraf=require(_0x4347('0x1'));var zipdir=require(_0x4347('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4347('0x3'));var BPromise=require(_0x4347('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4347('0x5'));var sox=require('sox');var csv=require(_0x4347('0x6'));var ejs=require(_0x4347('0x7'));var fs=require('fs');var fs_extra=require(_0x4347('0x8'));var _=require(_0x4347('0x9'));var squel=require(_0x4347('0xa'));var crypto=require(_0x4347('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4347('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4347('0xd'));var Papa=require(_0x4347('0xe'));var Redis=require(_0x4347('0xf'));var authService=require(_0x4347('0x10'));var qs=require(_0x4347('0x11'));var as=require(_0x4347('0x12'));var hardwareService=require(_0x4347('0x13'));var logger=require('../../config/logger')(_0x4347('0x14'));var utils=require(_0x4347('0x15'));var config=require(_0x4347('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4347('0x17'))['db'];config[_0x4347('0x18')]=_[_0x4347('0x19')](config[_0x4347('0x18')],{'host':_0x4347('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4347('0x18')]));require('./userProfile.socket')[_0x4347('0x1b')](socket);function respondWithStatusCode(_0x370f8e,_0x3d8a09){_0x3d8a09=_0x3d8a09||0xcc;return function(_0x3bec74){if(_0x3bec74){return _0x370f8e[_0x4347('0x1c')](_0x3d8a09);}return _0x370f8e['status'](_0x3d8a09)[_0x4347('0x1d')]();};}function respondWithResult(_0x253607,_0x6e7d25){_0x6e7d25=_0x6e7d25||0xc8;return function(_0xdfade6){if(_0xdfade6){return _0x253607['status'](_0x6e7d25)[_0x4347('0x1e')](_0xdfade6);}};}function respondWithFilteredResult(_0x2df2ba,_0x2f10e4){return function(_0x362e1c){if(_0x362e1c){var _0x96a075=typeof _0x2f10e4[_0x4347('0x1f')]===_0x4347('0x20')&&typeof _0x2f10e4['limit']==='undefined';var _0x60afc0=_0x362e1c[_0x4347('0x21')];var _0x22486a=_0x96a075?0x0:_0x2f10e4['offset'];var _0x4ffe74=_0x96a075?_0x362e1c[_0x4347('0x21')]:_0x2f10e4['offset']+_0x2f10e4[_0x4347('0x22')];var _0x212d16;if(_0x4ffe74>=_0x60afc0){_0x4ffe74=_0x60afc0;_0x212d16=0xc8;}else{_0x212d16=0xce;}_0x2df2ba[_0x4347('0x23')](_0x212d16);return _0x2df2ba['set'](_0x4347('0x24'),_0x22486a+'-'+_0x4ffe74+'/'+_0x60afc0)[_0x4347('0x1e')](_0x362e1c);}return null;};}function patchUpdates(_0x5d0b89){return function(_0x5e6d61){try{jsonpatch[_0x4347('0x25')](_0x5e6d61,_0x5d0b89,!![]);}catch(_0x46d7ac){return BPromise[_0x4347('0x26')](_0x46d7ac);}return _0x5e6d61['save']();};}function saveUpdates(_0x394b86,_0x55ff46){return function(_0xf549bc){if(_0xf549bc){return _0xf549bc[_0x4347('0x27')](_0x394b86)[_0x4347('0x28')](function(_0x54a4fa){return _0x54a4fa;});}return null;};}function removeEntity(_0x50b3c5,_0x296664){return function(_0x74c5c){if(_0x74c5c){return _0x74c5c[_0x4347('0x29')]()[_0x4347('0x28')](function(){_0x50b3c5[_0x4347('0x23')](0xcc)[_0x4347('0x1d')]();});}};}function handleEntityNotFound(_0x4be15a,_0x499ae9){return function(_0x4288be){if(!_0x4288be){_0x4be15a['sendStatus'](0x194);}return _0x4288be;};}function handleError(_0xe72d34,_0x5913c2){_0x5913c2=_0x5913c2||0x1f4;return function(_0x25b562){logger[_0x4347('0x2a')](_0x25b562[_0x4347('0x2b')]);if(_0x25b562[_0x4347('0x2c')]){delete _0x25b562[_0x4347('0x2c')];}_0xe72d34[_0x4347('0x23')](_0x5913c2)[_0x4347('0x2d')](_0x25b562);};}exports[_0x4347('0x2e')]=function(_0x331b26,_0x516171){var _0x3dffff={},_0x258152={},_0x344860={'count':0x0,'rows':[]};var _0x566a19=_[_0x4347('0x2f')](db[_0x4347('0x30')][_0x4347('0x31')],function(_0x5eabb6){return{'name':_0x5eabb6['fieldName'],'type':_0x5eabb6['type'][_0x4347('0x32')]};});_0x258152[_0x4347('0x33')]=_[_0x4347('0x2f')](_0x566a19,'name');_0x258152[_0x4347('0x34')]=_[_0x4347('0x35')](_0x331b26[_0x4347('0x34')]);_0x258152[_0x4347('0x36')]=_[_0x4347('0x37')](_0x258152['model'],_0x258152[_0x4347('0x34')]);_0x3dffff['attributes']=_[_0x4347('0x37')](_0x258152['model'],qs[_0x4347('0x38')](_0x331b26[_0x4347('0x34')]['fields']));_0x3dffff[_0x4347('0x39')]=_0x3dffff[_0x4347('0x39')]['length']?_0x3dffff[_0x4347('0x39')]:_0x258152['model'];if(!_0x331b26[_0x4347('0x34')][_0x4347('0x3a')](_0x4347('0x3b'))){_0x3dffff[_0x4347('0x22')]=qs[_0x4347('0x22')](_0x331b26[_0x4347('0x34')][_0x4347('0x22')]);_0x3dffff['offset']=qs[_0x4347('0x1f')](_0x331b26[_0x4347('0x34')][_0x4347('0x1f')]);}_0x3dffff[_0x4347('0x3c')]=qs[_0x4347('0x3d')](_0x331b26[_0x4347('0x34')]['sort']);_0x3dffff[_0x4347('0x3e')]=qs[_0x4347('0x36')](_[_0x4347('0x3f')](_0x331b26['query'],_0x258152[_0x4347('0x36')]),_0x566a19);if(_0x331b26[_0x4347('0x34')][_0x4347('0x40')]){_0x3dffff['where']=_['merge'](_0x3dffff[_0x4347('0x3e')],{'$or':_[_0x4347('0x2f')](_0x566a19,function(_0x1a0dc6){if(_0x1a0dc6['type']!==_0x4347('0x41')){var _0x50f6ac={};_0x50f6ac[_0x1a0dc6[_0x4347('0x2c')]]={'$like':'%'+_0x331b26[_0x4347('0x34')][_0x4347('0x40')]+'%'};return _0x50f6ac;}})});}_0x3dffff=_['merge']({},_0x3dffff,_0x331b26[_0x4347('0x42')]);var _0x2cf953={'where':_0x3dffff[_0x4347('0x3e')]};return db[_0x4347('0x30')]['count'](_0x2cf953)[_0x4347('0x28')](function(_0x10a975){_0x344860['count']=_0x10a975;if(_0x331b26[_0x4347('0x34')][_0x4347('0x43')]){_0x3dffff[_0x4347('0x44')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x3dffff);})[_0x4347('0x28')](function(_0x20221e){_0x344860[_0x4347('0x45')]=_0x20221e;return _0x344860;})[_0x4347('0x28')](respondWithFilteredResult(_0x516171,_0x3dffff))[_0x4347('0x46')](handleError(_0x516171,null));};exports['show']=function(_0x49cc7e,_0x375c73){var _0x1cdb65={'raw':![],'where':{'id':_0x49cc7e[_0x4347('0x47')]['id']}},_0x17ec62={};_0x17ec62[_0x4347('0x33')]=_[_0x4347('0x35')](db[_0x4347('0x30')][_0x4347('0x31')]);_0x17ec62['query']=_[_0x4347('0x35')](_0x49cc7e[_0x4347('0x34')]);_0x17ec62[_0x4347('0x36')]=_[_0x4347('0x37')](_0x17ec62[_0x4347('0x33')],_0x17ec62['query']);_0x1cdb65[_0x4347('0x39')]=_[_0x4347('0x37')](_0x17ec62[_0x4347('0x33')],qs[_0x4347('0x38')](_0x49cc7e[_0x4347('0x34')][_0x4347('0x38')]));_0x1cdb65[_0x4347('0x39')]=_0x1cdb65['attributes']['length']?_0x1cdb65[_0x4347('0x39')]:_0x17ec62['model'];if(_0x49cc7e[_0x4347('0x34')][_0x4347('0x43')]){_0x1cdb65[_0x4347('0x44')]=[{'all':!![]}];}_0x1cdb65=_['merge']({},_0x1cdb65,_0x49cc7e[_0x4347('0x42')]);return db['UserProfile'][_0x4347('0x48')](_0x1cdb65)[_0x4347('0x28')](handleEntityNotFound(_0x375c73,null))[_0x4347('0x28')](respondWithResult(_0x375c73,null))['catch'](handleError(_0x375c73,null));};exports[_0x4347('0x49')]=function(_0x1402c9,_0x351038){return db[_0x4347('0x30')][_0x4347('0x49')](_0x1402c9[_0x4347('0x4a')],{})[_0x4347('0x28')](respondWithResult(_0x351038,0xc9))[_0x4347('0x46')](handleError(_0x351038,null));};exports[_0x4347('0x4b')]=function(_0x4acd73,_0x4d6a02){var _0x3752d5={'where':{'id':_0x4acd73[_0x4347('0x47')]['id']}},_0x10c04a={};_0x10c04a['model']=_[_0x4347('0x35')](db[_0x4347('0x30')][_0x4347('0x31')]);_0x3752d5[_0x4347('0x39')]=_[_0x4347('0x37')](_0x10c04a[_0x4347('0x33')],qs[_0x4347('0x38')](_0x4acd73[_0x4347('0x34')][_0x4347('0x38')]));_0x3752d5[_0x4347('0x39')]=_0x3752d5['attributes'][_0x4347('0x4c')]?_0x3752d5[_0x4347('0x39')]:_0x10c04a[_0x4347('0x33')];if(_0x4acd73['query'][_0x4347('0x43')]){_0x3752d5['include']=[{'all':!![]}];}_0x3752d5=_[_0x4347('0x4d')]({},_0x3752d5,_0x4acd73[_0x4347('0x42')]);return db[_0x4347('0x30')]['find'](_0x3752d5)[_0x4347('0x28')](handleEntityNotFound(_0x4d6a02,null))[_0x4347('0x28')](function(_0x305de2){if(_0x305de2){var _0x3a7099=_0x305de2['get']({'plain':!![]});_0x3a7099=qs['omit'](_0x3a7099,['id',_0x4347('0x4e'),'updatedAt','crudPermissions']);_0x4acd73[_0x4347('0x4a')]=_[_0x4347('0x4f')](_0x4acd73[_0x4347('0x4a')],['id','createdAt',_0x4347('0x50')]);return db[_0x4347('0x51')][_0x4347('0x52')](function(_0x1c5732){return db[_0x4347('0x30')][_0x4347('0x49')](_['merge'](_0x3a7099,_0x4acd73['body']),{'include':_0x4acd73['query'][_0x4347('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x1c5732})[_0x4347('0x28')](function(_0x6f825f){var _0x45a7a3=_0x6f825f['get']({'plain':!![]});return db[_0x4347('0x53')]['findAll']({'where':{'userProfileId':_0x4acd73[_0x4347('0x47')]['id']},'raw':!![]})[_0x4347('0x28')](function(_0x3483d6){if(_0x3483d6){return BPromise[_0x4347('0x54')](_0x3483d6,function(_0x4d31fd){return new BPromise(function(_0x4f4aa3,_0x2cbb97){if(_0x4d31fd['autoAssociation']===null||_0x4d31fd[_0x4347('0x55')]===0x1)_0x4f4aa3(null);return db[_0x4347('0x56')][_0x4347('0x57')]({'where':{'sectionId':_0x4d31fd['id']},'raw':!![]})['then'](function(_0x2b1f86){var _0x17d04d=_[_0x4347('0x2f')](_0x2b1f86,function(_0x35abe7){return qs['omit'](_0x35abe7,['id','createdAt',_0x4347('0x50'),_0x4347('0x58')]);});_0x4f4aa3(_0x17d04d);})[_0x4347('0x46')](function(_0x3065ff){_0x2cbb97(_0x3065ff);});})[_0x4347('0x28')](function(_0x3fe664){var _0x2021c7=qs[_0x4347('0x4f')](_0x4d31fd,['id',_0x4347('0x4e'),'updatedAt']);_0x2021c7[_0x4347('0x59')]=_0x45a7a3['id'];if(_0x3fe664)_0x2021c7[_0x4347('0x5a')]=_0x3fe664;return _0x2021c7;})[_0x4347('0x28')](function(_0x416ff6){return db[_0x4347('0x53')]['create'](_0x416ff6,{'include':[{'model':db[_0x4347('0x56')],'as':_0x4347('0x5a')}],'raw':!![],'transaction':_0x1c5732});});})[_0x4347('0x28')](function(){return _0x45a7a3;});}});});});}})[_0x4347('0x28')](respondWithResult(_0x4d6a02,0xc9))[_0x4347('0x46')](handleError(_0x4d6a02,null));};exports[_0x4347('0x27')]=function(_0x397b27,_0xe4fe1c){if(_0x397b27['body']['id']){delete _0x397b27[_0x4347('0x4a')]['id'];}return db[_0x4347('0x30')][_0x4347('0x48')]({'where':{'id':_0x397b27['params']['id']}})[_0x4347('0x28')](handleEntityNotFound(_0xe4fe1c,null))[_0x4347('0x28')](saveUpdates(_0x397b27[_0x4347('0x4a')],null))['then'](respondWithResult(_0xe4fe1c,null))[_0x4347('0x46')](handleError(_0xe4fe1c,null));};exports[_0x4347('0x29')]=function(_0x8706e4,_0x5ad1a5){return db[_0x4347('0x30')][_0x4347('0x48')]({'where':{'id':_0x8706e4['params']['id']}})['then'](handleEntityNotFound(_0x5ad1a5,null))['then'](removeEntity(_0x5ad1a5,null))['catch'](handleError(_0x5ad1a5,null));};exports[_0x4347('0x5b')]=function(_0x547d28,_0x4ee03d){return db[_0x4347('0x30')][_0x4347('0x5b')]()[_0x4347('0x28')](respondWithResult(_0x4ee03d,null))[_0x4347('0x46')](handleError(_0x4ee03d,null));};exports[_0x4347('0x5c')]=function(_0x50ff97,_0x2d65fe){var _0x235a06=_0x50ff97[_0x4347('0x4a')];return db['UserProfile'][_0x4347('0x48')]({'where':{'id':_0x50ff97['params']['id']}})['then'](handleEntityNotFound(_0x2d65fe,null))['then'](function(_0x589276){if(_0x589276){return db[_0x4347('0x51')]['transaction'](function(_0x2b93f0){return db['UserProfileSection'][_0x4347('0x29')]({'where':{'userProfileId':_0x50ff97['params']['id'],'sectionId':_[_0x4347('0x2f')](_0x235a06,function(_0x3c9bc3){return _0x3c9bc3[_0x4347('0x58')];})},'transaction':_0x2b93f0})[_0x4347('0x28')](function(){var _0x22b27b=_[_0x4347('0x2f')](_0x235a06,function(_0x4c0a22){_0x4c0a22[_0x4347('0x59')]=_0x50ff97['params']['id'];return _0x4c0a22;});var _0x436abf=[];return BPromise[_0x4347('0x54')](_0x22b27b,function(_0x15c5e9){return db[_0x4347('0x53')][_0x4347('0x49')](_0x15c5e9,{'include':[{'model':db[_0x4347('0x56')],'as':_0x4347('0x5a')}],'raw':!![],'transaction':_0x2b93f0})[_0x4347('0x28')](function(_0x24a5d4){_0x436abf[_0x4347('0x5d')](_0x24a5d4[_0x4347('0x5e')]({'plain':!![]}));});})[_0x4347('0x28')](function(){return _0x436abf;});});});}})['then'](function(_0x14a730){return _0x14a730;})[_0x4347('0x28')](respondWithResult(_0x2d65fe,null))[_0x4347('0x46')](handleError(_0x2d65fe,null));};exports[_0x4347('0x5f')]=function(_0x1ff18b,_0x315fd8){var _0x3e771a;return db[_0x4347('0x30')][_0x4347('0x48')]({'where':{'id':_0x1ff18b[_0x4347('0x47')]['id']},'attributes':['id','name']})[_0x4347('0x28')](handleEntityNotFound(_0x315fd8,null))[_0x4347('0x28')](function(_0x123ce6){if(_0x123ce6){_0x3e771a=_0x123ce6;return db[_0x4347('0x53')][_0x4347('0x29')]({'where':{'userProfileId':_0x1ff18b[_0x4347('0x47')]['id'],'sectionId':_0x1ff18b[_0x4347('0x34')][_0x4347('0x60')]}});}})[_0x4347('0x28')](function(){return _0x3e771a;})[_0x4347('0x28')](respondWithStatusCode(_0x315fd8,null))[_0x4347('0x46')](handleError(_0x315fd8,null));};exports[_0x4347('0x61')]=function(_0x257f46,_0x3faa21){var _0x33bf93=[];var _0x27ec37=[];return db[_0x4347('0x53')][_0x4347('0x57')]({'where':{'userProfileId':_0x257f46[_0x4347('0x47')]['id']},'raw':!![]})[_0x4347('0x28')](function(_0xdb5f6a){_0x33bf93=_['filter'](_0xdb5f6a,function(_0x477b42){return _0x477b42[_0x4347('0x62')]===0x1||_['includes']([0x3eb,0x709],_0x477b42[_0x4347('0x58')]);});if(!_['isEmpty'](_0x33bf93)){return _['map'](_0x33bf93,function(_0x1aef3e){return _0x1aef3e[_0x4347('0x58')];});}else{return;}})[_0x4347('0x28')](function(_0x580e6e){if(_0x580e6e)_0x27ec37=_0x580e6e;if(_[_0x4347('0x63')](_0x27ec37,0x64)){var _0x45f144=_[_0x4347('0x48')](_0x33bf93,{'sectionId':0x64});return hasDefaultDashboard(_0x45f144)['then'](function(_0x1e1e91){return _[_0x4347('0x2f')](_0x33bf93,function(_0x1cda2b){if(_0x1cda2b['sectionId']===0x64){_0x1cda2b['subsections']=_0x1e1e91;}return _0x1cda2b;});});}else{return;}})[_0x4347('0x28')](function(_0x2791bc){if(_0x2791bc)_0x33bf93=_0x2791bc;if(_['includes'](_0x27ec37,0x3eb)){var _0x296e37=_[_0x4347('0x48')](_0x33bf93,{'sectionId':0x3eb});return getCustomDashboards(_0x296e37)['then'](function(_0x3fc698){return _[_0x4347('0x2f')](_0x33bf93,function(_0x10276e){if(_0x296e37[_0x4347('0x62')]){if(_0x10276e[_0x4347('0x58')]===0x3eb){_0x10276e[_0x4347('0x64')]=_0x3fc698;}}else{if(_0x10276e[_0x4347('0x58')]===0x64){if(!_0x10276e['subsections']){_0x10276e['subsections']=[];}_0x10276e[_0x4347('0x64')]=_0x10276e[_0x4347('0x64')][_0x4347('0x65')](_0x3fc698);}}return _0x10276e;});});}else{return;}})[_0x4347('0x28')](function(_0x470a27){if(_0x470a27)_0x33bf93=_0x470a27;if(_['includes'](_0x27ec37,0x709)){var _0x1dcd34=_['find'](_0x33bf93,{'sectionId':0x709});return getPlugins(_0x1dcd34)[_0x4347('0x28')](function(_0x3b5dcd){if(_0x1dcd34[_0x4347('0x62')]){return _['map'](_0x33bf93,function(_0x4d304e){if(_0x4d304e[_0x4347('0x58')]===0x709){_0x4d304e[_0x4347('0x64')]=_0x3b5dcd;}return _0x4d304e;});}else{var _0x46e524={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3b5dcd};var _0x4e1f20=_[_0x4347('0x2f')](_0x33bf93);_0x4e1f20[_0x4347('0x5d')](_0x46e524);return _0x4e1f20;}});}else{return;}})[_0x4347('0x28')](function(_0x3ee8ef){if(_0x3ee8ef)_0x33bf93=_0x3ee8ef;return _['filter'](_0x33bf93,[_0x4347('0x62'),0x1]);})[_0x4347('0x28')](respondWithResult(_0x3faa21,null))['catch'](handleError(_0x3faa21,null));};function hasDefaultDashboard(_0x9785fa){var _0x4c0952=[0x65];return new BPromise(function(_0x2c433b,_0x4ab209){try{if(_0x9785fa['autoAssociation']){_0x2c433b(_0x4c0952);}else{return db[_0x4347('0x56')][_0x4347('0x66')]({'where':{'sectionId':_0x9785fa['id']},'raw':!![]})[_0x4347('0x28')](function(_0x122ec2){_0x122ec2?_0x2c433b(_0x4c0952):_0x2c433b();});}}catch(_0x339c38){_0x4ab209(_0x339c38);}});}function getCustomDashboards(_0xd48db1){var _0x1cba5a=[];return new BPromise(function(_0x5b9dd8,_0x2841c7){try{if(_0xd48db1['autoAssociation']){return db[_0x4347('0x67')][_0x4347('0x57')]({'raw':!![]})[_0x4347('0x28')](function(_0x1db945){_0x1db945[_0x4347('0x68')](function(_0x289213){_0x1cba5a[_0x4347('0x5d')](_0x289213['id']+0x1869f);});_0x5b9dd8(_0x1cba5a);});}else{return db['UserProfileResource'][_0x4347('0x57')]({'where':{'sectionId':_0xd48db1['id']},'raw':!![]})['then'](function(_0x37ed9a){_0x37ed9a[_0x4347('0x68')](function(_0x41af6d){_0x1cba5a[_0x4347('0x5d')](_0x41af6d[_0x4347('0x69')]+0x1869f);});_0x5b9dd8(_0x1cba5a);});}}catch(_0x3dcf50){_0x2841c7(_0x3dcf50);}});}function getPlugins(_0x351a1a){var _0x428f81=[];return new BPromise(function(_0x256f75,_0x17d1f3){try{if(_0x351a1a[_0x4347('0x55')]){return db['Plugin'][_0x4347('0x57')]({'raw':!![]})[_0x4347('0x28')](function(_0x204871){_0x204871[_0x4347('0x68')](function(_0x4b91ab){_0x428f81['push'](_0x4b91ab['id']+0x15b38);});_0x256f75(_0x428f81);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x351a1a['id']},'raw':!![]})[_0x4347('0x28')](function(_0x30ef88){_0x30ef88[_0x4347('0x68')](function(_0x395231){_0x428f81['push'](_0x395231['resourceId']+0x15b38);});_0x256f75(_0x428f81);});}}catch(_0x1f92b7){_0x17d1f3(_0x1f92b7);}});}exports['addResources']=function(_0x1cd9e1,_0x5117d0){return db[_0x4347('0x30')][_0x4347('0x48')]({'where':{'id':_0x1cd9e1[_0x4347('0x47')]['id']}})['then'](handleEntityNotFound(_0x5117d0,null))[_0x4347('0x28')](function(_0x2ba20d){if(_0x2ba20d){return db[_0x4347('0x51')][_0x4347('0x52')](function(_0x43f164){return db[_0x4347('0x53')][_0x4347('0x57')]({'where':{'userProfileId':_0x1cd9e1['params']['id']},'attributes':['id'],'raw':!![]})[_0x4347('0x28')](function(_0x52548a){if(_0x52548a){return db[_0x4347('0x53')][_0x4347('0x29')]({'where':{'userProfileId':_0x1cd9e1[_0x4347('0x47')]['id'],'id':_[_0x4347('0x2f')](_0x52548a,function(_0x580eaa){return _0x580eaa['id'];})},'transaction':_0x43f164});}})[_0x4347('0x28')](function(_0x4d943){var _0x416fd2=_['map'](_0x1cd9e1[_0x4347('0x4a')],function(_0xebf565){_0xebf565[_0x4347('0x59')]=_0x1cd9e1[_0x4347('0x47')]['id'];return _0xebf565;});return db[_0x4347('0x53')][_0x4347('0x6a')](_0x416fd2,{'raw':!![],'transaction':_0x43f164});})[_0x4347('0x28')](function(_0x1d1809){var _0x17518d=_[_0x4347('0x40')](_[_0x4347('0x2f')](_0x1d1809,function(_0x56bd2e){return _0x56bd2e[_0x4347('0x5e')]({'plain':!![]});}),{'includeAll':![]});if(_0x17518d){return db[_0x4347('0x53')][_0x4347('0x57')]({'where':{'userProfileId':_0x1cd9e1[_0x4347('0x47')]['id'],'sectionId':_[_0x4347('0x2f')](_0x17518d,function(_0x5dbcba){return _0x5dbcba[_0x4347('0x58')];})},'attributes':['id',_0x4347('0x58')],'raw':!![]})[_0x4347('0x28')](function(_0xfdcdb9){var _0x212bad=_[_0x4347('0x2f')](_0x1cd9e1[_0x4347('0x4a')],function(_0x3630c4){_0x3630c4[_0x4347('0x59')]=_0x1cd9e1[_0x4347('0x47')]['id'];return _0x3630c4;});return db[_0x4347('0x56')][_0x4347('0x6a')](_0x212bad,{'raw':!![],'transaction':_0x43f164});});}})['catch'](handleError(_0x5117d0,null));});}})['then'](function(_0x529ea2){var _0xea0f3d=_[_0x4347('0x2f')](_0x529ea2,function(_0x17e1e5){return _0x17e1e5[_0x4347('0x5e')]({'plain':!![]});});})['then'](respondWithResult(_0x5117d0,null))[_0x4347('0x46')](handleError(_0x5117d0,null));};exports[_0x4347('0x6b')]=function(_0x399124,_0x1defc7,_0x44aba2){return db[_0x4347('0x30')][_0x4347('0x48')]({'where':{'id':_0x399124[_0x4347('0x47')]['id']}})[_0x4347('0x28')](handleEntityNotFound(_0x1defc7,null))[_0x4347('0x28')](function(_0x43a994){if(_0x43a994){return _0x43a994[_0x4347('0x6b')](_0x399124[_0x4347('0x34')][_0x4347('0x60')]);}})['then'](respondWithStatusCode(_0x1defc7,null))['catch'](handleError(_0x1defc7,null));};exports[_0x4347('0x6c')]=function(_0x29000b,_0x24ad6c){var _0x2e25c3={};if(!_0x29000b[_0x4347('0x34')][_0x4347('0x6d')])throw new Error(_0x4347('0x6e'));if(!_0x29000b[_0x4347('0x34')][_0x4347('0x3a')](_0x4347('0x3b'))){_0x2e25c3[_0x4347('0x22')]=qs[_0x4347('0x22')](_0x29000b[_0x4347('0x34')]['limit']);_0x2e25c3[_0x4347('0x1f')]=qs[_0x4347('0x1f')](_0x29000b[_0x4347('0x34')][_0x4347('0x1f')]);}return db['UserProfile'][_0x4347('0x48')]({'where':{'id':_0x29000b[_0x4347('0x47')]['id']}})[_0x4347('0x28')](function(_0x337ff3){if(!_0x337ff3)throw new Error(_0x4347('0x6f')+_0x29000b[_0x4347('0x47')]['id']);return db['UserProfile'][_0x4347('0x6c')](_0x29000b);})['then'](respondWithFilteredResult(_0x24ad6c,_0x2e25c3))[_0x4347('0x46')](handleError(_0x24ad6c,null));}; \ No newline at end of file +var _0x332d=['querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./userProfile.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','sendStatus','error','stack','name','send','index','UserProfile','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','then','rows','catch','show','params','rawAttributes','length','include','find','create','body','clone','get','omit','createdAt','updatedAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','update','describe','addSections','map','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','hasOwnProperty','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0xf9cdbe,_0x1a692c){var _0x47b102=function(_0x5db4f9){while(--_0x5db4f9){_0xf9cdbe['push'](_0xf9cdbe['shift']());}};_0x47b102(++_0x1a692c);}(_0x332d,0x1c4));var _0xd332=function(_0x4b3720,_0x6b7238){_0x4b3720=_0x4b3720-0x0;var _0x3f7e7d=_0x332d[_0x4b3720];return _0x3f7e7d;};'use strict';var emlformat=require(_0xd332('0x0'));var rimraf=require(_0xd332('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd332('0x2'));var rp=require('request-promise');var moment=require(_0xd332('0x3'));var BPromise=require(_0xd332('0x4'));var Mustache=require(_0xd332('0x5'));var util=require(_0xd332('0x6'));var path=require(_0xd332('0x7'));var sox=require(_0xd332('0x8'));var csv=require('to-csv');var ejs=require(_0xd332('0x9'));var fs=require('fs');var fs_extra=require(_0xd332('0xa'));var _=require(_0xd332('0xb'));var squel=require(_0xd332('0xc'));var crypto=require(_0xd332('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd332('0xe'));var toCsv=require(_0xd332('0xf'));var querystring=require(_0xd332('0x10'));var Papa=require('papaparse');var Redis=require(_0xd332('0x11'));var authService=require(_0xd332('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd332('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd332('0x14'))(_0xd332('0x15'));var utils=require(_0xd332('0x16'));var config=require(_0xd332('0x17'));var licenseUtil=require(_0xd332('0x18'));var db=require(_0xd332('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd332('0x1a'),'port':0x18eb});var socket=require(_0xd332('0x1b'))(new Redis(config[_0xd332('0x1c')]));require(_0xd332('0x1d'))[_0xd332('0x1e')](socket);function respondWithStatusCode(_0x25a536,_0x48aeee){_0x48aeee=_0x48aeee||0xcc;return function(_0x5573ca){if(_0x5573ca){return _0x25a536['sendStatus'](_0x48aeee);}return _0x25a536[_0xd332('0x1f')](_0x48aeee)[_0xd332('0x20')]();};}function respondWithResult(_0x586aba,_0x23ce04){_0x23ce04=_0x23ce04||0xc8;return function(_0x4d29c3){if(_0x4d29c3){return _0x586aba[_0xd332('0x1f')](_0x23ce04)[_0xd332('0x21')](_0x4d29c3);}};}function respondWithFilteredResult(_0x5bd5c3,_0x5f3aca){return function(_0x3b0412){if(_0x3b0412){var _0xba7843=typeof _0x5f3aca[_0xd332('0x22')]===_0xd332('0x23')&&typeof _0x5f3aca['limit']===_0xd332('0x23');var _0x53ba53=_0x3b0412[_0xd332('0x24')];var _0x4f3437=_0xba7843?0x0:_0x5f3aca[_0xd332('0x22')];var _0x11e67c=_0xba7843?_0x3b0412[_0xd332('0x24')]:_0x5f3aca[_0xd332('0x22')]+_0x5f3aca[_0xd332('0x25')];var _0x19a7c3;if(_0x11e67c>=_0x53ba53){_0x11e67c=_0x53ba53;_0x19a7c3=0xc8;}else{_0x19a7c3=0xce;}_0x5bd5c3[_0xd332('0x1f')](_0x19a7c3);return _0x5bd5c3[_0xd332('0x26')](_0xd332('0x27'),_0x4f3437+'-'+_0x11e67c+'/'+_0x53ba53)[_0xd332('0x21')](_0x3b0412);}return null;};}function patchUpdates(_0x150baa){return function(_0xa5ef3){try{jsonpatch[_0xd332('0x28')](_0xa5ef3,_0x150baa,!![]);}catch(_0x5b1302){return BPromise[_0xd332('0x29')](_0x5b1302);}return _0xa5ef3['save']();};}function saveUpdates(_0xce8947,_0x1e03a4){return function(_0x12d4e0){if(_0x12d4e0){return _0x12d4e0['update'](_0xce8947)['then'](function(_0xa2024d){return _0xa2024d;});}return null;};}function removeEntity(_0xdc2bc4,_0x17399e){return function(_0x12b795){if(_0x12b795){return _0x12b795[_0xd332('0x2a')]()['then'](function(){_0xdc2bc4[_0xd332('0x1f')](0xcc)[_0xd332('0x20')]();});}};}function handleEntityNotFound(_0x4f13c2,_0x16fad8){return function(_0x262d3b){if(!_0x262d3b){_0x4f13c2[_0xd332('0x2b')](0x194);}return _0x262d3b;};}function handleError(_0x2799ba,_0x16d437){_0x16d437=_0x16d437||0x1f4;return function(_0x31fba7){logger[_0xd332('0x2c')](_0x31fba7[_0xd332('0x2d')]);if(_0x31fba7[_0xd332('0x2e')]){delete _0x31fba7[_0xd332('0x2e')];}_0x2799ba[_0xd332('0x1f')](_0x16d437)[_0xd332('0x2f')](_0x31fba7);};}exports[_0xd332('0x30')]=function(_0x342f0c,_0x516bcf){var _0x4ec0ec={},_0x356b8b={},_0x282152={'count':0x0,'rows':[]};var _0x360ca2=_['map'](db[_0xd332('0x31')]['rawAttributes'],function(_0x410638){return{'name':_0x410638[_0xd332('0x32')],'type':_0x410638['type'][_0xd332('0x33')]};});_0x356b8b[_0xd332('0x34')]=_['map'](_0x360ca2,_0xd332('0x2e'));_0x356b8b[_0xd332('0x35')]=_[_0xd332('0x36')](_0x342f0c[_0xd332('0x35')]);_0x356b8b[_0xd332('0x37')]=_[_0xd332('0x38')](_0x356b8b[_0xd332('0x34')],_0x356b8b[_0xd332('0x35')]);_0x4ec0ec[_0xd332('0x39')]=_[_0xd332('0x38')](_0x356b8b[_0xd332('0x34')],qs[_0xd332('0x3a')](_0x342f0c[_0xd332('0x35')][_0xd332('0x3a')]));_0x4ec0ec[_0xd332('0x39')]=_0x4ec0ec[_0xd332('0x39')]['length']?_0x4ec0ec[_0xd332('0x39')]:_0x356b8b[_0xd332('0x34')];if(!_0x342f0c[_0xd332('0x35')]['hasOwnProperty']('nolimit')){_0x4ec0ec[_0xd332('0x25')]=qs[_0xd332('0x25')](_0x342f0c[_0xd332('0x35')][_0xd332('0x25')]);_0x4ec0ec['offset']=qs[_0xd332('0x22')](_0x342f0c[_0xd332('0x35')][_0xd332('0x22')]);}_0x4ec0ec[_0xd332('0x3b')]=qs[_0xd332('0x3c')](_0x342f0c['query'][_0xd332('0x3c')]);_0x4ec0ec[_0xd332('0x3d')]=qs[_0xd332('0x37')](_[_0xd332('0x3e')](_0x342f0c[_0xd332('0x35')],_0x356b8b[_0xd332('0x37')]),_0x360ca2);if(_0x342f0c['query']['filter']){_0x4ec0ec[_0xd332('0x3d')]=_['merge'](_0x4ec0ec[_0xd332('0x3d')],{'$or':_['map'](_0x360ca2,function(_0x57a6c2){if(_0x57a6c2['type']!==_0xd332('0x3f')){var _0x37b7aa={};_0x37b7aa[_0x57a6c2['name']]={'$like':'%'+_0x342f0c['query'][_0xd332('0x40')]+'%'};return _0x37b7aa;}})});}_0x4ec0ec=_[_0xd332('0x41')]({},_0x4ec0ec,_0x342f0c[_0xd332('0x42')]);var _0x54daf4={'where':_0x4ec0ec[_0xd332('0x3d')]};return db[_0xd332('0x31')]['count'](_0x54daf4)['then'](function(_0xb23ad){_0x282152[_0xd332('0x24')]=_0xb23ad;if(_0x342f0c[_0xd332('0x35')][_0xd332('0x43')]){_0x4ec0ec['include']=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x4ec0ec);})[_0xd332('0x44')](function(_0x3c9f0a){_0x282152[_0xd332('0x45')]=_0x3c9f0a;return _0x282152;})['then'](respondWithFilteredResult(_0x516bcf,_0x4ec0ec))[_0xd332('0x46')](handleError(_0x516bcf,null));};exports[_0xd332('0x47')]=function(_0x1c1ac5,_0x259b47){var _0x430726={'raw':![],'where':{'id':_0x1c1ac5[_0xd332('0x48')]['id']}},_0x3afc21={};_0x3afc21['model']=_[_0xd332('0x36')](db['UserProfile'][_0xd332('0x49')]);_0x3afc21[_0xd332('0x35')]=_[_0xd332('0x36')](_0x1c1ac5[_0xd332('0x35')]);_0x3afc21[_0xd332('0x37')]=_[_0xd332('0x38')](_0x3afc21[_0xd332('0x34')],_0x3afc21['query']);_0x430726[_0xd332('0x39')]=_[_0xd332('0x38')](_0x3afc21[_0xd332('0x34')],qs['fields'](_0x1c1ac5[_0xd332('0x35')]['fields']));_0x430726[_0xd332('0x39')]=_0x430726[_0xd332('0x39')][_0xd332('0x4a')]?_0x430726['attributes']:_0x3afc21[_0xd332('0x34')];if(_0x1c1ac5[_0xd332('0x35')]['includeAll']){_0x430726[_0xd332('0x4b')]=[{'all':!![]}];}_0x430726=_[_0xd332('0x41')]({},_0x430726,_0x1c1ac5[_0xd332('0x42')]);return db[_0xd332('0x31')][_0xd332('0x4c')](_0x430726)[_0xd332('0x44')](handleEntityNotFound(_0x259b47,null))['then'](respondWithResult(_0x259b47,null))['catch'](handleError(_0x259b47,null));};exports['create']=function(_0x1bebec,_0x38e3b8){return db[_0xd332('0x31')][_0xd332('0x4d')](_0x1bebec[_0xd332('0x4e')],{})[_0xd332('0x44')](respondWithResult(_0x38e3b8,0xc9))[_0xd332('0x46')](handleError(_0x38e3b8,null));};exports[_0xd332('0x4f')]=function(_0x26881e,_0x4c0ebd){var _0x45e71d={'where':{'id':_0x26881e[_0xd332('0x48')]['id']}},_0x165338={};_0x165338[_0xd332('0x34')]=_[_0xd332('0x36')](db[_0xd332('0x31')]['rawAttributes']);_0x45e71d['attributes']=_[_0xd332('0x38')](_0x165338[_0xd332('0x34')],qs['fields'](_0x26881e[_0xd332('0x35')]['fields']));_0x45e71d['attributes']=_0x45e71d['attributes'][_0xd332('0x4a')]?_0x45e71d[_0xd332('0x39')]:_0x165338[_0xd332('0x34')];if(_0x26881e['query'][_0xd332('0x43')]){_0x45e71d['include']=[{'all':!![]}];}_0x45e71d=_['merge']({},_0x45e71d,_0x26881e['options']);return db[_0xd332('0x31')][_0xd332('0x4c')](_0x45e71d)[_0xd332('0x44')](handleEntityNotFound(_0x4c0ebd,null))[_0xd332('0x44')](function(_0x4c535e){if(_0x4c535e){var _0x3af939=_0x4c535e[_0xd332('0x50')]({'plain':!![]});_0x3af939=qs[_0xd332('0x51')](_0x3af939,['id',_0xd332('0x52'),_0xd332('0x53'),'crudPermissions']);_0x26881e['body']=_[_0xd332('0x51')](_0x26881e[_0xd332('0x4e')],['id',_0xd332('0x52'),_0xd332('0x53')]);return db[_0xd332('0x54')][_0xd332('0x55')](function(_0x5b6531){return db[_0xd332('0x31')][_0xd332('0x4d')](_['merge'](_0x3af939,_0x26881e[_0xd332('0x4e')]),{'include':_0x26881e[_0xd332('0x35')][_0xd332('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x5b6531})['then'](function(_0x37b478){var _0x5537b7=_0x37b478[_0xd332('0x50')]({'plain':!![]});return db[_0xd332('0x56')][_0xd332('0x57')]({'where':{'userProfileId':_0x26881e[_0xd332('0x48')]['id']},'raw':!![]})['then'](function(_0x87aa24){if(_0x87aa24){return BPromise[_0xd332('0x58')](_0x87aa24,function(_0x3f7d8a){return new BPromise(function(_0x41e081,_0xcb86de){if(_0x3f7d8a[_0xd332('0x59')]===null||_0x3f7d8a['autoAssociation']===0x1)_0x41e081(null);return db[_0xd332('0x5a')]['findAll']({'where':{'sectionId':_0x3f7d8a['id']},'raw':!![]})[_0xd332('0x44')](function(_0x32e92b){var _0x4fd034=_['map'](_0x32e92b,function(_0x4caa8c){return qs[_0xd332('0x51')](_0x4caa8c,['id',_0xd332('0x52'),'updatedAt','sectionId']);});_0x41e081(_0x4fd034);})[_0xd332('0x46')](function(_0x208336){_0xcb86de(_0x208336);});})[_0xd332('0x44')](function(_0x1806df){var _0x42ec45=qs['omit'](_0x3f7d8a,['id',_0xd332('0x52'),_0xd332('0x53')]);_0x42ec45[_0xd332('0x5b')]=_0x5537b7['id'];if(_0x1806df)_0x42ec45[_0xd332('0x5c')]=_0x1806df;return _0x42ec45;})[_0xd332('0x44')](function(_0x4c9074){return db['UserProfileSection']['create'](_0x4c9074,{'include':[{'model':db[_0xd332('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x5b6531});});})[_0xd332('0x44')](function(){return _0x5537b7;});}});});});}})[_0xd332('0x44')](respondWithResult(_0x4c0ebd,0xc9))['catch'](handleError(_0x4c0ebd,null));};exports[_0xd332('0x5d')]=function(_0x5d70a3,_0x3f773f){if(_0x5d70a3[_0xd332('0x4e')]['id']){delete _0x5d70a3[_0xd332('0x4e')]['id'];}return db['UserProfile'][_0xd332('0x4c')]({'where':{'id':_0x5d70a3[_0xd332('0x48')]['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x3f773f,null))['then'](saveUpdates(_0x5d70a3[_0xd332('0x4e')],null))['then'](respondWithResult(_0x3f773f,null))[_0xd332('0x46')](handleError(_0x3f773f,null));};exports[_0xd332('0x2a')]=function(_0x27e8c1,_0x4e9209){return db[_0xd332('0x31')][_0xd332('0x4c')]({'where':{'id':_0x27e8c1['params']['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x4e9209,null))[_0xd332('0x44')](removeEntity(_0x4e9209,null))[_0xd332('0x46')](handleError(_0x4e9209,null));};exports[_0xd332('0x5e')]=function(_0x101864,_0x3f18eb){return db['UserProfile'][_0xd332('0x5e')]()['then'](respondWithResult(_0x3f18eb,null))[_0xd332('0x46')](handleError(_0x3f18eb,null));};exports[_0xd332('0x5f')]=function(_0x4c8554,_0x2a3d32){var _0x4c6dc5=_0x4c8554['body'];return db[_0xd332('0x31')]['find']({'where':{'id':_0x4c8554[_0xd332('0x48')]['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x2a3d32,null))[_0xd332('0x44')](function(_0x5b53d5){if(_0x5b53d5){return db[_0xd332('0x54')]['transaction'](function(_0x3d10d9){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x4c8554[_0xd332('0x48')]['id'],'sectionId':_[_0xd332('0x60')](_0x4c6dc5,function(_0x423892){return _0x423892[_0xd332('0x61')];})},'transaction':_0x3d10d9})[_0xd332('0x44')](function(){var _0x4ced6a=_[_0xd332('0x60')](_0x4c6dc5,function(_0x30a9ed){_0x30a9ed[_0xd332('0x5b')]=_0x4c8554[_0xd332('0x48')]['id'];return _0x30a9ed;});var _0x45f1e2=[];return BPromise[_0xd332('0x58')](_0x4ced6a,function(_0x3bb90a){return db['UserProfileSection'][_0xd332('0x4d')](_0x3bb90a,{'include':[{'model':db[_0xd332('0x5a')],'as':_0xd332('0x5c')}],'raw':!![],'transaction':_0x3d10d9})[_0xd332('0x44')](function(_0x415308){_0x45f1e2[_0xd332('0x62')](_0x415308[_0xd332('0x50')]({'plain':!![]}));});})[_0xd332('0x44')](function(){return _0x45f1e2;});});});}})['then'](function(_0x5f0bc2){return _0x5f0bc2;})[_0xd332('0x44')](respondWithResult(_0x2a3d32,null))[_0xd332('0x46')](handleError(_0x2a3d32,null));};exports[_0xd332('0x63')]=function(_0x52ee2f,_0x22694d){var _0x3409de;return db[_0xd332('0x31')]['find']({'where':{'id':_0x52ee2f[_0xd332('0x48')]['id']},'attributes':['id',_0xd332('0x2e')]})['then'](handleEntityNotFound(_0x22694d,null))[_0xd332('0x44')](function(_0x27e9cc){if(_0x27e9cc){_0x3409de=_0x27e9cc;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x52ee2f[_0xd332('0x48')]['id'],'sectionId':_0x52ee2f[_0xd332('0x35')][_0xd332('0x64')]}});}})[_0xd332('0x44')](function(){return _0x3409de;})[_0xd332('0x44')](respondWithStatusCode(_0x22694d,null))[_0xd332('0x46')](handleError(_0x22694d,null));};exports[_0xd332('0x65')]=function(_0x21ccc4,_0x3d3b03){var _0x5616f3=[];var _0x456309=[];return db['UserProfileSection'][_0xd332('0x57')]({'where':{'userProfileId':_0x21ccc4['params']['id']},'raw':!![]})[_0xd332('0x44')](function(_0x3e8fb1){_0x5616f3=_[_0xd332('0x40')](_0x3e8fb1,function(_0x38ecd9){return _0x38ecd9[_0xd332('0x66')]===0x1||_[_0xd332('0x67')]([0x3eb,0x709],_0x38ecd9[_0xd332('0x61')]);});if(!_[_0xd332('0x68')](_0x5616f3)){return _[_0xd332('0x60')](_0x5616f3,function(_0x410b0f){return _0x410b0f[_0xd332('0x61')];});}else{return;}})['then'](function(_0x3e37b5){if(_0x3e37b5)_0x456309=_0x3e37b5;if(_[_0xd332('0x67')](_0x456309,0x64)){var _0x36843a=_[_0xd332('0x4c')](_0x5616f3,{'sectionId':0x64});return hasDefaultDashboard(_0x36843a)[_0xd332('0x44')](function(_0x149478){return _[_0xd332('0x60')](_0x5616f3,function(_0x15d366){if(_0x15d366[_0xd332('0x61')]===0x64){_0x15d366[_0xd332('0x69')]=_0x149478;}return _0x15d366;});});}else{return;}})['then'](function(_0x1f53ee){if(_0x1f53ee)_0x5616f3=_0x1f53ee;if(_[_0xd332('0x67')](_0x456309,0x3eb)){var _0x19db86=_[_0xd332('0x4c')](_0x5616f3,{'sectionId':0x3eb});return getCustomDashboards(_0x19db86)['then'](function(_0x3b9378){return _[_0xd332('0x60')](_0x5616f3,function(_0x45f7cb){if(_0x19db86[_0xd332('0x66')]){if(_0x45f7cb[_0xd332('0x61')]===0x3eb){_0x45f7cb['subsections']=_0x3b9378;}}else{if(_0x45f7cb[_0xd332('0x61')]===0x64){if(!_0x45f7cb['subsections']){_0x45f7cb['subsections']=[];}_0x45f7cb['subsections']=_0x45f7cb['subsections']['concat'](_0x3b9378);}}return _0x45f7cb;});});}else{return;}})[_0xd332('0x44')](function(_0x1e1393){if(_0x1e1393)_0x5616f3=_0x1e1393;if(_['includes'](_0x456309,0x709)){var _0x28f0ed=_[_0xd332('0x4c')](_0x5616f3,{'sectionId':0x709});return getPlugins(_0x28f0ed)[_0xd332('0x44')](function(_0x2fd874){if(_0x28f0ed[_0xd332('0x66')]){return _['map'](_0x5616f3,function(_0x1fb956){if(_0x1fb956[_0xd332('0x61')]===0x709){_0x1fb956[_0xd332('0x69')]=_0x2fd874;}return _0x1fb956;});}else{var _0x44a014={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2fd874};var _0x83c3cd=_[_0xd332('0x60')](_0x5616f3);_0x83c3cd[_0xd332('0x62')](_0x44a014);return _0x83c3cd;}});}else{return;}})[_0xd332('0x44')](function(_0x518ba6){if(_0x518ba6)_0x5616f3=_0x518ba6;return _['filter'](_0x5616f3,[_0xd332('0x66'),0x1]);})[_0xd332('0x44')](respondWithResult(_0x3d3b03,null))[_0xd332('0x46')](handleError(_0x3d3b03,null));};function hasDefaultDashboard(_0x3ff198){var _0x24c12f=[0x65];return new BPromise(function(_0xdf8ba1,_0x3b7179){try{if(_0x3ff198[_0xd332('0x59')]){_0xdf8ba1(_0x24c12f);}else{return db['UserProfileResource'][_0xd332('0x6a')]({'where':{'sectionId':_0x3ff198['id']},'raw':!![]})['then'](function(_0x23b1da){_0x23b1da?_0xdf8ba1(_0x24c12f):_0xdf8ba1();});}}catch(_0x22af0b){_0x3b7179(_0x22af0b);}});}function getCustomDashboards(_0x247afa){var _0x398f5b=[];return new BPromise(function(_0x417c35,_0x50f771){try{if(_0x247afa[_0xd332('0x59')]){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x67de1a){_0x67de1a[_0xd332('0x6b')](function(_0xe9d63a){_0x398f5b['push'](_0xe9d63a['id']+0x1869f);});_0x417c35(_0x398f5b);});}else{return db[_0xd332('0x5a')][_0xd332('0x57')]({'where':{'sectionId':_0x247afa['id']},'raw':!![]})['then'](function(_0x216c53){_0x216c53[_0xd332('0x6b')](function(_0x3c0f9d){_0x398f5b[_0xd332('0x62')](_0x3c0f9d['resourceId']+0x1869f);});_0x417c35(_0x398f5b);});}}catch(_0x1010e4){_0x50f771(_0x1010e4);}});}function getPlugins(_0x5c4522){var _0x3c6f74=[];return new BPromise(function(_0x27fdd1,_0x19575e){try{if(_0x5c4522[_0xd332('0x59')]){return db[_0xd332('0x6c')]['findAll']({'raw':!![]})[_0xd332('0x44')](function(_0x35d455){_0x35d455['forEach'](function(_0x144a20){_0x3c6f74['push'](_0x144a20['id']+0x15b38);});_0x27fdd1(_0x3c6f74);});}else{return db[_0xd332('0x5a')][_0xd332('0x57')]({'where':{'sectionId':_0x5c4522['id']},'raw':!![]})['then'](function(_0x5b6e21){_0x5b6e21[_0xd332('0x6b')](function(_0x3d9125){_0x3c6f74[_0xd332('0x62')](_0x3d9125['resourceId']+0x15b38);});_0x27fdd1(_0x3c6f74);});}}catch(_0x4ca96b){_0x19575e(_0x4ca96b);}});}exports[_0xd332('0x6d')]=function(_0x33dcb7,_0x167ded){return db[_0xd332('0x31')][_0xd332('0x4c')]({'where':{'id':_0x33dcb7[_0xd332('0x48')]['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x167ded,null))[_0xd332('0x44')](function(_0x35dbc3){if(_0x35dbc3){return db[_0xd332('0x54')][_0xd332('0x55')](function(_0x37ab15){return db[_0xd332('0x56')][_0xd332('0x57')]({'where':{'userProfileId':_0x33dcb7[_0xd332('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0xd332('0x44')](function(_0xe04d8){if(_0xe04d8){return db[_0xd332('0x56')][_0xd332('0x2a')]({'where':{'userProfileId':_0x33dcb7[_0xd332('0x48')]['id'],'id':_[_0xd332('0x60')](_0xe04d8,function(_0x1492f5){return _0x1492f5['id'];})},'transaction':_0x37ab15});}})['then'](function(_0x509dde){var _0x155201=_[_0xd332('0x60')](_0x33dcb7[_0xd332('0x4e')],function(_0x40ebeb){_0x40ebeb[_0xd332('0x5b')]=_0x33dcb7['params']['id'];return _0x40ebeb;});return db[_0xd332('0x56')]['bulkCreate'](_0x155201,{'raw':!![],'transaction':_0x37ab15});})[_0xd332('0x44')](function(_0x3671e0){var _0x12df65=_['filter'](_['map'](_0x3671e0,function(_0xb7d0a9){return _0xb7d0a9[_0xd332('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x12df65){return db[_0xd332('0x56')][_0xd332('0x57')]({'where':{'userProfileId':_0x33dcb7[_0xd332('0x48')]['id'],'sectionId':_[_0xd332('0x60')](_0x12df65,function(_0x17eca9){return _0x17eca9[_0xd332('0x61')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd332('0x44')](function(_0x4c6cef){var _0x457587=_[_0xd332('0x60')](_0x33dcb7[_0xd332('0x4e')],function(_0x2e2b00){_0x2e2b00[_0xd332('0x5b')]=_0x33dcb7[_0xd332('0x48')]['id'];return _0x2e2b00;});return db[_0xd332('0x5a')][_0xd332('0x6e')](_0x457587,{'raw':!![],'transaction':_0x37ab15});});}})['catch'](handleError(_0x167ded,null));});}})[_0xd332('0x44')](function(_0x219d5a){var _0x37aae4=_[_0xd332('0x60')](_0x219d5a,function(_0x54a348){return _0x54a348['get']({'plain':!![]});});})['then'](respondWithResult(_0x167ded,null))[_0xd332('0x46')](handleError(_0x167ded,null));};exports[_0xd332('0x6f')]=function(_0x278672,_0x340b7b,_0x47914a){return db['UserProfile'][_0xd332('0x4c')]({'where':{'id':_0x278672['params']['id']}})[_0xd332('0x44')](handleEntityNotFound(_0x340b7b,null))[_0xd332('0x44')](function(_0x1cdb7e){if(_0x1cdb7e){return _0x1cdb7e['removeResources'](_0x278672['query'][_0xd332('0x64')]);}})[_0xd332('0x44')](respondWithStatusCode(_0x340b7b,null))[_0xd332('0x46')](handleError(_0x340b7b,null));};exports[_0xd332('0x70')]=function(_0x760d2f,_0x2462bf){var _0x2d425b={};if(!_0x760d2f['query']['section'])throw new Error(_0xd332('0x71'));if(!_0x760d2f[_0xd332('0x35')][_0xd332('0x72')](_0xd332('0x73'))){_0x2d425b[_0xd332('0x25')]=qs[_0xd332('0x25')](_0x760d2f[_0xd332('0x35')][_0xd332('0x25')]);_0x2d425b['offset']=qs[_0xd332('0x22')](_0x760d2f[_0xd332('0x35')][_0xd332('0x22')]);}return db[_0xd332('0x31')][_0xd332('0x4c')]({'where':{'id':_0x760d2f[_0xd332('0x48')]['id']}})[_0xd332('0x44')](function(_0x32bee7){if(!_0x32bee7)throw new Error(_0xd332('0x74')+_0x760d2f['params']['id']);return db[_0xd332('0x31')][_0xd332('0x70')](_0x760d2f);})[_0xd332('0x44')](respondWithFilteredResult(_0x2462bf,_0x2d425b))[_0xd332('0x46')](handleError(_0x2462bf,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a1a4958..66ed6fa 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 _0x46cb=['update','remove','emit','hook','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x6243bb,_0x269bd7){var _0x16ef17=function(_0x5771f1){while(--_0x5771f1){_0x6243bb['push'](_0x6243bb['shift']());}};_0x16ef17(++_0x269bd7);}(_0x46cb,0x84));var _0xb46c=function(_0x23a042,_0x169361){_0x23a042=_0x23a042-0x0;var _0x57543a=_0x46cb[_0x23a042];return _0x57543a;};'use strict';var EventEmitter=require(_0xb46c('0x0'));var UserProfile=require(_0xb46c('0x1'))['db'][_0xb46c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb46c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb46c('0x4'),'afterDestroy':_0xb46c('0x5')};function emitEvent(_0x704ab0){return function(_0x25157d,_0x5d3e63,_0x354f49){UserProfileEvents[_0xb46c('0x6')](_0x704ab0+':'+_0x25157d['id'],_0x25157d);UserProfileEvents[_0xb46c('0x6')](_0x704ab0,_0x25157d);_0x354f49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xb46c('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x9582=['../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x234fec,_0x5f51bf){var _0x449cd8=function(_0x51b9e2){while(--_0x51b9e2){_0x234fec['push'](_0x234fec['shift']());}};_0x449cd8(++_0x5f51bf);}(_0x9582,0x95));var _0x2958=function(_0x170e7e,_0x48f71e){_0x170e7e=_0x170e7e-0x0;var _0x50e30a=_0x9582[_0x170e7e];return _0x50e30a;};'use strict';var EventEmitter=require(_0x2958('0x0'));var UserProfile=require(_0x2958('0x1'))['db'][_0x2958('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2958('0x3')](0x0);var events={'afterCreate':_0x2958('0x4'),'afterUpdate':_0x2958('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a44fa){return function(_0x3b907e,_0x136c77,_0x195138){UserProfileEvents[_0x2958('0x6')](_0x2a44fa+':'+_0x3b907e['id'],_0x3b907e);UserProfileEvents[_0x2958('0x6')](_0x2a44fa,_0x3b907e);_0x195138(null);};}for(var e in events){if(events[_0x2958('0x7')](e)){var event=events[e];UserProfile[_0x2958('0x8')](e,emitEvent(event));}}module[_0x2958('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index cc2f101..69b33fb 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 _0x9b30=['count','ids','customSorting','extraQueryConditions','Tags','tag','color','openTabs','rows','chat','dataValues','sms','mail','all','lodash','./userProfile.attributes','squel','models','filter','value','then','associatedResources','map','field','model','name','catch','resolve','UserProfileResource','findAll','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','Agents','membername','User','role','agent','telephone','VoiceQueues','queue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueue','users','agents','Users','admin','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','tags','Tag','templates','Template','triggers','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','options','includeAll','include','default','DefaultReports','custom'];(function(_0x592097,_0x1d7e60){var _0x42cccb=function(_0x36827a){while(--_0x36827a){_0x592097['push'](_0x592097['shift']());}};_0x42cccb(++_0x1d7e60);}(_0x9b30,0x180));var _0x09b3=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x9b30[_0x3207aa];return _0x51758f;};'use strict';var _=require(_0x09b3('0x0'));var attributes=require(_0x09b3('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x09b3('0x2'));module['exports']=function(_0x15c3d6){var _0x5eaf6d=_0x15c3d6[_0x09b3('0x3')];function _0x16c0f9(_0x4ba289,_0x12ae38){return new Promise(function(_0x288c8c,_0x9914a5){if(!_0x12ae38)return _0x288c8c(null);var _0x42ae50=_0x12ae38[_0x09b3('0x4')]?{[_0x12ae38[_0x09b3('0x4')]['field']]:_0x12ae38[_0x09b3('0x4')][_0x09b3('0x5')]}:undefined;return _0x5eaf6d[_0x4ba289]['findAll']({'where':_0x42ae50,'raw':!![]})[_0x09b3('0x6')](function(_0x5ef3c8){_0x12ae38[_0x09b3('0x7')]=_[_0x09b3('0x8')](_0x5ef3c8,'id');_0x288c8c(_0x12ae38);})['catch'](function(_0x217187){_0x9914a5(_0x217187);});});}function _0x578b78(_0x2ff0cc,_0x1ec2d0){return new Promise(function(_0x3dccb8,_0x3b3263){var _0x1db8cf=_0x2ff0cc[_0x09b3('0x4')]?{[_0x2ff0cc[_0x09b3('0x4')][_0x09b3('0x9')]]:_0x2ff0cc[_0x09b3('0x4')][_0x09b3('0x5')]}:undefined;return _0x5eaf6d[_0x2ff0cc[_0x09b3('0xa')]]['findAll']({'where':_0x1db8cf,'raw':!![]})[_0x09b3('0x6')](function(_0x5be5f8){_0x1ec2d0[_0x09b3('0x7')]=_[_0x09b3('0x8')](_0x5be5f8,function(_0xa62824){return _0xa62824[_0x09b3('0xb')];});_0x3dccb8(_0x1ec2d0);})[_0x09b3('0xc')](function(_0x5f4aec){_0x3b3263(_0x5f4aec);});});}function _0x319af6(_0x56471c,_0x23eee5,_0x555694){if(!_0x23eee5)return Promise[_0x09b3('0xd')](null);return new Promise(function(_0x1cb0f,_0x5e81d6){return _0x5eaf6d[_0x09b3('0xe')][_0x09b3('0xf')]({'where':{'sectionId':_0x23eee5['id']},'raw':!![]})['then'](function(_0xdaec3a){if(_0x56471c[_0x09b3('0x9')]&&_0x56471c[_0x09b3('0x9')]!=='id'){_0x23eee5['associatedResources']=_[_0x09b3('0x8')](_0xdaec3a,function(_0x233469){return _0x233469[_0x56471c[_0x09b3('0x9')]];});}else{if(_0x555694==='AnalyticExtractedReport'){_0x23eee5[_0x09b3('0x7')]=_[_0x09b3('0x8')](_0xdaec3a,function(_0x5278a1){return{'id':_0x5278a1[_0x09b3('0x10')],'type':_0x5278a1[_0x09b3('0x11')]};});}else{_0x23eee5[_0x09b3('0x7')]=_[_0x09b3('0x8')](_0xdaec3a,function(_0x1cb2ff){return _0x1cb2ff[_0x09b3('0x10')];});}}_0x1cb0f(_0x23eee5);})['catch'](function(_0x29557e){_0x5e81d6(_0x29557e);});});}function _0x877372(_0x206903,_0x5855eb){var _0x4845b0={'parentSections':[]};switch(_0x206903['toLowerCase']()){case _0x09b3('0x12'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x14');break;case _0x09b3('0x15'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x16');break;case'squarerecordings':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x17');_0x4845b0[_0x09b3('0x18')]=[{'name':_0x09b3('0x19'),'field':_0x09b3('0xb'),'foreignKey':_0x09b3('0x1a')}];break;case _0x09b3('0x1b'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x1c');break;case _0x09b3('0x1d'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x1e');_0x4845b0[_0x09b3('0x18')]=[{'name':_0x09b3('0x1f'),'field':'id','foreignKey':_0x09b3('0x20')}];break;case _0x09b3('0x21'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x22');break;case _0x09b3('0x23'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x24');break;case _0x09b3('0x25'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x26');break;case _0x09b3('0x27'):_0x4845b0['childModel']=_0x09b3('0x28');break;case'chatwebsites':_0x4845b0[_0x09b3('0x13')]='ChatWebsite';break;case _0x09b3('0x29'):_0x4845b0['childModel']=_0x09b3('0x2a');break;case _0x09b3('0x2b'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x2c');break;case _0x09b3('0x2d'):case'internalroutes':case _0x09b3('0x2e'):_0x4845b0['childModel']=_0x09b3('0x2f');break;case _0x09b3('0x30'):_0x4845b0[_0x09b3('0x13')]='VoiceContext';break;case _0x09b3('0x31'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x32');break;case _0x09b3('0x33'):_0x4845b0['childModel']='VoiceRecording';_0x4845b0[_0x09b3('0x18')]=[{'name':_0x09b3('0x34'),'field':_0x09b3('0xb'),'foreignKey':_0x09b3('0x35'),'model':_0x09b3('0x36'),'filter':{'field':_0x09b3('0x37'),'value':[_0x09b3('0x38')]}},{'name':'Telephones','field':_0x09b3('0xb'),'foreignKey':'membername','model':_0x09b3('0x36'),'filter':{'field':_0x09b3('0x37'),'value':[_0x09b3('0x39')]}},{'name':_0x09b3('0x3a'),'field':'name','foreignKey':_0x09b3('0x3b'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x09b3('0x3c')]}},{'name':_0x09b3('0x3d'),'field':'name','foreignKey':_0x09b3('0x3b'),'model':'VoiceQueue','filter':{'field':_0x09b3('0x11'),'value':[_0x09b3('0x3e')]}}];break;case _0x09b3('0x3f'):_0x4845b0[_0x09b3('0x13')]='VoiceMusicOnHold';break;case _0x09b3('0x40'):_0x4845b0['childModel']=_0x09b3('0x41');break;case'voiceprefixes':_0x4845b0[_0x09b3('0x13')]='VoicePrefix';break;case'ivrcampaigns':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x42');break;case _0x09b3('0x43'):_0x4845b0['childModel']='MailQueue';break;case _0x09b3('0x44'):_0x4845b0['childModel']=_0x09b3('0x45');break;case _0x09b3('0x46'):_0x4845b0['childModel']=_0x09b3('0x47');break;case'openchannelqueues':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x48');break;case _0x09b3('0x49'):_0x4845b0[_0x09b3('0x13')]='OpenchannelAccount';break;case _0x09b3('0x4a'):_0x4845b0[_0x09b3('0x13')]='SmsQueue';break;case _0x09b3('0x4b'):_0x4845b0[_0x09b3('0x13')]='SmsAccount';break;case _0x09b3('0x4c'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x4d');break;case _0x09b3('0x4e'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x4f');break;case _0x09b3('0x50'):_0x4845b0['childModel']=_0x09b3('0x51');break;case _0x09b3('0x52'):case _0x09b3('0x53'):_0x4845b0['childModel']=_0x09b3('0x54');if(_0x5855eb){_0x4845b0[_0x09b3('0x18')]=[{'name':_0x09b3('0x3a')},{'name':'QueueCampaigns'}];}break;case _0x09b3('0x55'):case _0x09b3('0x56'):case'telephones':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x36');if(_0x5855eb){_0x4845b0[_0x09b3('0x18')]=[{'name':_0x09b3('0x57'),'filter':{'field':_0x09b3('0x37'),'value':[_0x09b3('0x58'),'user']},'ignore':!![]},{'name':_0x09b3('0x34')},{'name':_0x09b3('0x59')}];}break;case _0x09b3('0x5a'):_0x4845b0['childModel']=_0x09b3('0x5b');break;case _0x09b3('0x5c'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x5d');break;case _0x09b3('0x5e'):_0x4845b0[_0x09b3('0x13')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x5f');break;case'deskaccounts':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x60');break;case _0x09b3('0x61'):_0x4845b0[_0x09b3('0x13')]='ZohoAccount';break;case'vtigeraccounts':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x36');break;case _0x09b3('0x62'):_0x4845b0[_0x09b3('0x13')]='CannedAnswer';break;case _0x09b3('0x63'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x64');break;case _0x09b3('0x65'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x66');break;case _0x09b3('0x67'):_0x4845b0['childModel']=_0x09b3('0x68');break;case _0x09b3('0x69'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x6a');break;case'scheduler':_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x6b');break;case _0x09b3('0x6c'):_0x4845b0[_0x09b3('0x13')]='Sound';break;case _0x09b3('0x6d'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x6e');break;case _0x09b3('0x6f'):_0x4845b0['childModel']=_0x09b3('0x70');break;case _0x09b3('0x71'):_0x4845b0[_0x09b3('0x13')]='Trigger';break;case _0x09b3('0x72'):_0x4845b0[_0x09b3('0x13')]='Trunk';break;case _0x09b3('0x73'):_0x4845b0[_0x09b3('0x13')]=_0x09b3('0x74');break;case _0x09b3('0x75'):_0x4845b0['childModel']=_0x09b3('0x76');break;case _0x09b3('0x77'):_0x4845b0['childModel']='AnalyticExtractedReport';_0x4845b0['parentSections']=[{'name':_0x09b3('0x78'),'field':'id','foreignKey':_0x09b3('0x79')}];break;case _0x09b3('0x7a'):_0x4845b0['childModel']='AnalyticMetric';break;}return _0x4845b0;}function _0x3b49f2(_0x37f3f8,_0xb82f56){var _0x323146=_0x37f3f8['charAt'](0x0)[_0x09b3('0x7b')]()+_0x37f3f8[_0x09b3('0x7c')](0x1);var _0x778b9={'type':_0x5eaf6d[_0x09b3('0x7d')][_0x09b3('0x7e')]['SELECT'],'raw':!![]};return new Promise(function(_0x36557c,_0x4c13a6){var _0x3c76c6=squel[_0x09b3('0x7f')]()[_0x09b3('0x9')](_0x09b3('0x80')+_0x323146+_0x09b3('0x81'),'id')[_0x09b3('0x9')](_0x09b3('0x82'))[_0x09b3('0x83')]('user_has_'+_0x37f3f8+_0x09b3('0x84'),'ui')[_0x09b3('0x85')](_0x09b3('0x86'),_0xb82f56['id']);return _0x5eaf6d[_0x09b3('0x87')][_0x09b3('0x88')](_0x3c76c6['toString'](),_0x778b9)[_0x09b3('0x6')](function(_0xedf2be){_0xb82f56[_0x323146+_0x09b3('0x89')]=_0xedf2be;_0x36557c(_0xedf2be);})[_0x09b3('0xc')](function(_0x179597){_0x4c13a6(_0x179597);});});}return _0x15c3d6[_0x09b3('0x8a')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1ec055){var _0x3b38d2={'raw':_0x1ec055[_0x09b3('0x88')]['raw'],'where':{}};var _0x15196d={};var _0x54d0c9={'count':0x0,'rows':[]};var _0x3bec4b=_0x1ec055[_0x09b3('0x88')][_0x09b3('0x8b')];var _0x5988f4=_0x1ec055['query'][_0x09b3('0x8c')]||![];var _0x2b665a=_0x877372(_0x3bec4b,_0x5988f4);if(!_0x2b665a['childModel'])throw new Error(_0x09b3('0x8d')+_0x3bec4b+'\x27');var _0x3705f2=[{'name':_0x3bec4b}];if(!_[_0x09b3('0x8e')](_0x2b665a[_0x09b3('0x18')]))_0x3705f2=_0x2b665a[_0x09b3('0x18')];var _0x4c91a2=[];for(var _0x178615=0x0;_0x178615<_0x3705f2[_0x09b3('0x8f')];_0x178615++){_0x4c91a2[_0x09b3('0x90')](_0x5eaf6d['UserProfileSection'][_0x09b3('0x91')]({'where':{'userProfileId':_0x1ec055['params']['id'],'name':_0x3705f2[_0x178615][_0x09b3('0xb')]},'raw':!![]}));}return Promise['all'](_0x4c91a2)[_0x09b3('0x6')](function(_0x4ea3bd){var _0xf597b1=_[_0x09b3('0x4')](_0x4ea3bd,function(_0x333aa5){return _0x333aa5?_0x333aa5:undefined;});var _0x42395b=_[_0x09b3('0x4')](_0x3705f2,['ignore',!![]]);var _0x45fe11=_[_0x09b3('0x8e')](_0xf597b1)&&_['isEmpty'](_0x42395b)?null:_['union'](_0x42395b,_0xf597b1);if(!_0x45fe11)return null;var _0x409e92=[];for(var _0x2dbf9e=0x0;_0x2dbf9e<_0x45fe11[_0x09b3('0x8f')];_0x2dbf9e++){var _0x18d5b7=_['find'](_0x3705f2,function(_0x1f31b3){return _0x45fe11[_0x2dbf9e]?_0x1f31b3['name']===_0x45fe11[_0x2dbf9e][_0x09b3('0xb')]:null;});if(_0x18d5b7){if(_0x45fe11[_0x2dbf9e][_0x09b3('0x92')]){_0x409e92[_0x09b3('0x90')](_0x16c0f9(_0x2b665a[_0x09b3('0x13')],_0x45fe11[_0x2dbf9e]));}else{if(!_0x45fe11[_0x2dbf9e][_0x09b3('0x93')]){_0x409e92[_0x09b3('0x90')](_0x319af6(_0x18d5b7,_0x45fe11[_0x2dbf9e],_0x2b665a[_0x09b3('0x13')]));}else{if(_0x18d5b7['model']){_0x409e92[_0x09b3('0x90')](_0x578b78(_0x18d5b7,_0x45fe11[_0x2dbf9e]));}}}}}return Promise['all'](_0x409e92);})[_0x09b3('0x6')](function(_0x220b30){var _0x21e2f6=_0x220b30;var _0x4f6c72=null;if(_0x21e2f6){_0x4f6c72=_0x21e2f6[_0x09b3('0x8f')]===0x1?_0x21e2f6[0x0]:null;}if(!_0x4f6c72&&!_0x21e2f6)return _0x54d0c9;var _0x5c0e0c=_0x5eaf6d[_0x2b665a[_0x09b3('0x13')]][_0x09b3('0x94')];_0x15196d['model']=_[_0x09b3('0x95')](_0x5c0e0c);_0x15196d['query']=_[_0x09b3('0x95')](_0x1ec055[_0x09b3('0x88')]);_0x15196d[_0x09b3('0x96')]=_[_0x09b3('0x97')](_0x15196d[_0x09b3('0xa')],_0x15196d[_0x09b3('0x88')]);_0x3b38d2[_0x09b3('0x98')]=_[_0x09b3('0x97')](_0x15196d[_0x09b3('0xa')],qs[_0x09b3('0x99')](_0x1ec055[_0x09b3('0x88')][_0x09b3('0x99')]));_0x3b38d2[_0x09b3('0x98')]=_0x3b38d2['attributes'][_0x09b3('0x8f')]?_0x3b38d2[_0x09b3('0x98')]:_0x15196d['model'];if(!_0x1ec055['query'][_0x09b3('0x9a')](_0x09b3('0x9b'))){_0x3b38d2['limit']=qs[_0x09b3('0x9c')](_0x1ec055['query'][_0x09b3('0x9c')]);_0x3b38d2[_0x09b3('0x9d')]=qs['offset'](_0x1ec055[_0x09b3('0x88')][_0x09b3('0x9d')]);}_0x3b38d2['order']=qs[_0x09b3('0x9e')](_0x1ec055[_0x09b3('0x88')]['sort']);_0x3b38d2[_0x09b3('0x85')]=qs['filters'](_[_0x09b3('0x9f')](_0x1ec055['query'],_0x15196d['filters']));if(_0x1ec055[_0x09b3('0x88')][_0x09b3('0x4')]){_0x3b38d2[_0x09b3('0x85')]=_[_0x09b3('0xa0')](_0x3b38d2[_0x09b3('0x85')],{'$or':_[_0x09b3('0x8')](_0x5c0e0c,function(_0x59f9f9){if(_0x59f9f9['type']['key']!==_0x09b3('0xa1')){var _0x196640={};_0x196640[_0x59f9f9['field']]={'$like':'%'+_0x1ec055[_0x09b3('0x88')][_0x09b3('0x4')]+'%'};return _0x196640;}})});}var _0x757502=[];var _0x58322d=null;var _0x3bb11f={};if(_0x4f6c72){_0x58322d=_[_0x09b3('0x91')](_0x3705f2,[_0x09b3('0xb'),_0x4f6c72[_0x09b3('0xb')]]);if(_0x58322d[_0x09b3('0x9')]){_0x3bb11f={};if(_0x2b665a[_0x09b3('0x13')]===_0x09b3('0xa2')){_0x3bb11f[_0x58322d[_0x09b3('0xa3')]]=_[_0x09b3('0x8')](_0x4f6c72[_0x09b3('0x7')],'id');}else{_0x3bb11f[_0x58322d[_0x09b3('0xa3')]]=_0x4f6c72['associatedResources'];}_0x757502[_0x09b3('0x90')](_0x3bb11f);}else{_0x3b38d2['where']['id']=_0x4f6c72[_0x09b3('0x7')];}}else{for(var _0x283e66=0x0;_0x283e66<_0x21e2f6[_0x09b3('0x8f')];_0x283e66++){_0x58322d=_[_0x09b3('0x91')](_0x3705f2,[_0x09b3('0xb'),_0x21e2f6[_0x283e66]['name']]);if(_0x58322d[_0x09b3('0x9')]){_0x3bb11f={};_0x3bb11f[_0x58322d[_0x09b3('0xa3')]]=_0x21e2f6[_0x283e66]['associatedResources'];_0x757502[_0x09b3('0x90')](_0x3bb11f);}else{if(!_0x3b38d2[_0x09b3('0x85')]['id'])_0x3b38d2[_0x09b3('0x85')]['id']=[];_0x21e2f6[_0x283e66][_0x09b3('0x7')][_0x09b3('0xa4')](function(_0x1b7b8f){_0x3b38d2['where']['id'][_0x09b3('0x90')](_0x1b7b8f);});}}}if(!_['isEmpty'](_0x757502)){_0x3b38d2[_0x09b3('0x85')]=_['merge'](_0x3b38d2[_0x09b3('0x85')],{'$and':{'$or':_0x757502}});}_0x3b38d2=_[_0x09b3('0xa0')]({},_0x3b38d2,_0x1ec055[_0x09b3('0xa5')]);if(_0x4f6c72&&!_0x4f6c72[_0x09b3('0x93')]&&_0x2b665a[_0x09b3('0x13')]==='AnalyticExtractedReport'){if(_0x1ec055[_0x09b3('0x88')][_0x09b3('0xa6')]){_0x3b38d2[_0x09b3('0xa7')]=[{'all':!![]}];}return _0x5eaf6d[_0x2b665a[_0x09b3('0x13')]][_0x09b3('0xf')](_0x3b38d2)[_0x09b3('0x6')](function(_0x4bdf8e){var _0x22e71f=[];_0x4bdf8e[_0x09b3('0xa4')](function(_0x117de2){var _0x51a178;switch(_0x117de2['reportType']){case _0x09b3('0xa8'):_0x51a178=_[_0x09b3('0x91')](_0x4f6c72[_0x09b3('0x7')],function(_0x2ee399){return _0x2ee399['id']===_0x117de2[_0x09b3('0x79')]&&_0x2ee399[_0x09b3('0x11')]===_0x09b3('0xa9');});break;case _0x09b3('0xaa'):_0x51a178=_[_0x09b3('0x91')](_0x4f6c72[_0x09b3('0x7')],function(_0x4ae4ca){return _0x4ae4ca['id']===_0x117de2['reportId']&&_0x4ae4ca[_0x09b3('0x11')]==='CustomReports';});break;}if(_0x51a178)_0x22e71f[_0x09b3('0x90')](_0x117de2);});_0x54d0c9[_0x09b3('0xab')]=_0x22e71f[_0x09b3('0x8f')];_0x54d0c9['rows']=_0x22e71f;return _0x54d0c9;});}else{if(!_['isEmpty'](_0x1ec055[_0x09b3('0x88')][_0x09b3('0xac')])){_0x3b38d2['where']['id']=_0x3b38d2['where']['id']?_[_0x09b3('0x97')](_0x3b38d2[_0x09b3('0x85')]['id'],_0x1ec055[_0x09b3('0x88')][_0x09b3('0xac')]):_0x1ec055[_0x09b3('0x88')][_0x09b3('0xac')];if(_0x1ec055[_0x09b3('0x88')][_0x09b3('0xad')]){_0x3b38d2['order']=_0x1ec055[_0x09b3('0x88')][_0x09b3('0xad')];}}if(_0x1ec055[_0x09b3('0x88')][_0x09b3('0xae')]){_0x3b38d2[_0x09b3('0x85')]=_[_0x09b3('0xa0')](_0x3b38d2[_0x09b3('0x85')],{'$and':_0x1ec055[_0x09b3('0x88')]['extraQueryConditions']});}return _0x5eaf6d[_0x2b665a['childModel']][_0x09b3('0xab')]({'where':_0x3b38d2[_0x09b3('0x85')]})[_0x09b3('0x6')](function(_0x4d0094){_0x54d0c9['count']=_0x4d0094;if(_0x1ec055[_0x09b3('0x88')][_0x09b3('0xa6')]){if(_0x2b665a[_0x09b3('0x13')]===_0x09b3('0x1e')){_0x3b38d2['include']=[{'model':_0x5eaf6d[_0x09b3('0x6e')],'as':_0x09b3('0xaf'),'attributes':['id','name','color'],'required':_0x1ec055['query'][_0x09b3('0xb0')]?!![]:![]},{'model':_0x5eaf6d[_0x09b3('0x6e')],'as':'ThroughTags','attributes':['id',_0x09b3('0xb'),_0x09b3('0xb1')],'through':_0x1ec055[_0x09b3('0x88')][_0x09b3('0xb0')]?{'attributes':[],'where':{'TagId':_0x1ec055['query'][_0x09b3('0xb0')]||undefined}}:{},'required':_0x1ec055['query'][_0x09b3('0xb0')]?!![]:![]}];}else{_0x3b38d2[_0x09b3('0xa7')]=[{'all':!![]}];}}return _0x5eaf6d[_0x2b665a['childModel']][_0x09b3('0xf')](_0x3b38d2);})[_0x09b3('0x6')](function(_0x875ecd){_0x54d0c9['rows']=_0x875ecd;if(_0x3bec4b===_0x09b3('0x34')&&_0x1ec055[_0x09b3('0x88')][_0x09b3('0xb2')]==='true'){var _0x2c77d2=[];for(var _0x5bc171=0x0;_0x5bc171<_0x54d0c9[_0x09b3('0xb3')][_0x09b3('0x8f')];_0x5bc171++){_0x2c77d2[_0x09b3('0x90')](_0x3b49f2(_0x09b3('0xb4'),_0x54d0c9[_0x09b3('0xb3')][_0x5bc171][_0x09b3('0xb5')]));_0x2c77d2[_0x09b3('0x90')](_0x3b49f2(_0x09b3('0xb6'),_0x54d0c9[_0x09b3('0xb3')][_0x5bc171][_0x09b3('0xb5')]));_0x2c77d2['push'](_0x3b49f2('fax',_0x54d0c9[_0x09b3('0xb3')][_0x5bc171][_0x09b3('0xb5')]));_0x2c77d2[_0x09b3('0x90')](_0x3b49f2(_0x09b3('0xb7'),_0x54d0c9['rows'][_0x5bc171][_0x09b3('0xb5')]));_0x2c77d2[_0x09b3('0x90')](_0x3b49f2('openchannel',_0x54d0c9['rows'][_0x5bc171][_0x09b3('0xb5')]));_0x2c77d2[_0x09b3('0x90')](_0x3b49f2('whatsapp',_0x54d0c9[_0x09b3('0xb3')][_0x5bc171][_0x09b3('0xb5')]));}return Promise[_0x09b3('0xb8')](_0x2c77d2)['then'](function(){return _0x54d0c9;});}return _0x54d0c9;});}});}}});}; \ No newline at end of file +var _0x13da=['ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','pauses','Pause','scheduler','Sound','tags','Tag','templates','triggers','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','toString','define','user_profiles','query','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','ignore','union','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','includeAll','Tags','color','tag','ThroughTags','openTabs','dataValues','sms','mail','openchannel','whatsapp','lodash','../../components/parsers/qs','squel','exports','models','filter','field','value','then','associatedResources','catch','model','findAll','map','name','UserProfileResource','AnalyticExtractedReport','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','voicemails','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','inbound','VoiceQueue','outbound','musiconholds','voiceprefixes','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','user','zendeskaccounts'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x13da,0x67));var _0xa13d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa13d('0x0'));var attributes=require('./userProfile.attributes');var qs=require(_0xa13d('0x1'));var squel=require(_0xa13d('0x2'));module[_0xa13d('0x3')]=function(_0x463e1a){var _0x267a43=_0x463e1a[_0xa13d('0x4')];function _0x2fafa6(_0x9619a0,_0x5f2ce2){return new Promise(function(_0x284255,_0x3d1545){if(!_0x5f2ce2)return _0x284255(null);var _0x114008=_0x5f2ce2['filter']?{[_0x5f2ce2[_0xa13d('0x5')][_0xa13d('0x6')]]:_0x5f2ce2[_0xa13d('0x5')][_0xa13d('0x7')]}:undefined;return _0x267a43[_0x9619a0]['findAll']({'where':_0x114008,'raw':!![]})[_0xa13d('0x8')](function(_0x4b2b78){_0x5f2ce2[_0xa13d('0x9')]=_['map'](_0x4b2b78,'id');_0x284255(_0x5f2ce2);})[_0xa13d('0xa')](function(_0x26de4e){_0x3d1545(_0x26de4e);});});}function _0x44b819(_0x11557b,_0x3447bf){return new Promise(function(_0x2f6580,_0x2feb10){var _0x2d8b37=_0x11557b[_0xa13d('0x5')]?{[_0x11557b['filter']['field']]:_0x11557b['filter'][_0xa13d('0x7')]}:undefined;return _0x267a43[_0x11557b[_0xa13d('0xb')]][_0xa13d('0xc')]({'where':_0x2d8b37,'raw':!![]})[_0xa13d('0x8')](function(_0x5f4795){_0x3447bf['associatedResources']=_[_0xa13d('0xd')](_0x5f4795,function(_0xe9ec6a){return _0xe9ec6a[_0xa13d('0xe')];});_0x2f6580(_0x3447bf);})[_0xa13d('0xa')](function(_0x1e0b6f){_0x2feb10(_0x1e0b6f);});});}function _0x2a3701(_0x308ae5,_0xe4f5ca,_0x89aa40){if(!_0xe4f5ca)return Promise['resolve'](null);return new Promise(function(_0x31a8db,_0x3c7195){return _0x267a43[_0xa13d('0xf')][_0xa13d('0xc')]({'where':{'sectionId':_0xe4f5ca['id']},'raw':!![]})[_0xa13d('0x8')](function(_0x48620a){if(_0x308ae5['field']&&_0x308ae5[_0xa13d('0x6')]!=='id'){_0xe4f5ca[_0xa13d('0x9')]=_['map'](_0x48620a,function(_0x173c0e){return _0x173c0e[_0x308ae5['field']];});}else{if(_0x89aa40===_0xa13d('0x10')){_0xe4f5ca[_0xa13d('0x9')]=_['map'](_0x48620a,function(_0x1069bc){return{'id':_0x1069bc['resourceId'],'type':_0x1069bc[_0xa13d('0x11')]};});}else{_0xe4f5ca[_0xa13d('0x9')]=_[_0xa13d('0xd')](_0x48620a,function(_0x178457){return _0x178457['resourceId'];});}}_0x31a8db(_0xe4f5ca);})['catch'](function(_0xa2a09a){_0x3c7195(_0xa2a09a);});});}function _0x24aabf(_0x4b0547,_0x2da16d){var _0x366fb9={'parentSections':[]};switch(_0x4b0547[_0xa13d('0x12')]()){case _0xa13d('0x13'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x15');break;case _0xa13d('0x16'):_0x366fb9[_0xa13d('0x14')]='SquareOdbc';break;case _0xa13d('0x17'):_0x366fb9['childModel']=_0xa13d('0x18');_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x1a'),'field':'name','foreignKey':_0xa13d('0x1b')}];break;case _0xa13d('0x1c'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x1d');break;case _0xa13d('0x1e'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x1f');_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x20'),'field':'id','foreignKey':_0xa13d('0x21')}];break;case'lists':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x22');break;case _0xa13d('0x23'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x24');break;case _0xa13d('0x25'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x26');break;case _0xa13d('0x27'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x28');break;case _0xa13d('0x29'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x2a');break;case _0xa13d('0x2b'):_0x366fb9['childModel']=_0xa13d('0x2c');break;case _0xa13d('0x2d'):_0x366fb9['childModel']=_0xa13d('0x2e');break;case _0xa13d('0x2f'):case _0xa13d('0x30'):case'outboundroutes':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x31');break;case _0xa13d('0x32'):_0x366fb9[_0xa13d('0x14')]='VoiceContext';break;case _0xa13d('0x33'):_0x366fb9['childModel']='VoiceMail';break;case'voicerecordings':_0x366fb9[_0xa13d('0x14')]='VoiceRecording';_0x366fb9['parentSections']=[{'name':_0xa13d('0x34'),'field':_0xa13d('0xe'),'foreignKey':'membername','model':_0xa13d('0x35'),'filter':{'field':_0xa13d('0x36'),'value':[_0xa13d('0x37')]}},{'name':_0xa13d('0x38'),'field':'name','foreignKey':_0xa13d('0x39'),'model':_0xa13d('0x35'),'filter':{'field':_0xa13d('0x36'),'value':[_0xa13d('0x3a')]}},{'name':_0xa13d('0x3b'),'field':_0xa13d('0xe'),'foreignKey':_0xa13d('0x3c'),'model':'VoiceQueue','filter':{'field':_0xa13d('0x11'),'value':[_0xa13d('0x3d')]}},{'name':'QueueCampaigns','field':_0xa13d('0xe'),'foreignKey':'queue','model':_0xa13d('0x3e'),'filter':{'field':'type','value':[_0xa13d('0x3f')]}}];break;case _0xa13d('0x40'):_0x366fb9[_0xa13d('0x14')]='VoiceMusicOnHold';break;case'chanspies':_0x366fb9[_0xa13d('0x14')]='VoiceChanSpy';break;case _0xa13d('0x41'):_0x366fb9['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x366fb9[_0xa13d('0x14')]='Campaign';break;case _0xa13d('0x42'):_0x366fb9[_0xa13d('0x14')]='MailQueue';break;case _0xa13d('0x43'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x44');break;case _0xa13d('0x45'):_0x366fb9[_0xa13d('0x14')]='MailSubstatus';break;case _0xa13d('0x46'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x47');break;case _0xa13d('0x48'):_0x366fb9['childModel']=_0xa13d('0x49');break;case'smsqueues':_0x366fb9[_0xa13d('0x14')]='SmsQueue';break;case'smsaccounts':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x4a');break;case'whatsappqueues':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x4b');break;case _0xa13d('0x4c'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x4d');break;case _0xa13d('0x4e'):_0x366fb9['childModel']='Team';break;case _0xa13d('0x4f'):case _0xa13d('0x50'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x3e');if(_0x2da16d){_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x3b')},{'name':_0xa13d('0x51')}];}break;case _0xa13d('0x52'):case _0xa13d('0x53'):case _0xa13d('0x54'):_0x366fb9['childModel']=_0xa13d('0x35');if(_0x2da16d){_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x55'),'filter':{'field':_0xa13d('0x36'),'value':['admin',_0xa13d('0x56')]},'ignore':!![]},{'name':_0xa13d('0x34')},{'name':_0xa13d('0x38')}];}break;case _0xa13d('0x57'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x58');break;case _0xa13d('0x59'):_0x366fb9[_0xa13d('0x14')]='SalesforceAccount';break;case _0xa13d('0x5a'):_0x366fb9['childModel']=_0xa13d('0x5b');break;case _0xa13d('0x5c'):_0x366fb9[_0xa13d('0x14')]='SugarcrmAccount';break;case _0xa13d('0x5d'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x5e');break;case'zohoaccounts':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x5f');break;case _0xa13d('0x60'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x35');break;case _0xa13d('0x61'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x62');break;case _0xa13d('0x63'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x64');break;case _0xa13d('0x65'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x66');break;case _0xa13d('0x67'):_0x366fb9[_0xa13d('0x14')]='Interval';break;case _0xa13d('0x68'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x69');break;case _0xa13d('0x6a'):_0x366fb9[_0xa13d('0x14')]='Schedule';break;case'sounds':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x6b');break;case _0xa13d('0x6c'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x6d');break;case _0xa13d('0x6e'):_0x366fb9[_0xa13d('0x14')]='Template';break;case _0xa13d('0x6f'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x70');break;case _0xa13d('0x71'):_0x366fb9[_0xa13d('0x14')]='Trunk';break;case _0xa13d('0x72'):_0x366fb9['childModel']=_0xa13d('0x73');break;case'plugins':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x74');break;case _0xa13d('0x75'):_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x10');_0x366fb9[_0xa13d('0x19')]=[{'name':_0xa13d('0x76'),'field':'id','foreignKey':_0xa13d('0x77')}];break;case'metrics':_0x366fb9[_0xa13d('0x14')]=_0xa13d('0x78');break;}return _0x366fb9;}function _0xd910c6(_0x362e38,_0x15d491){var _0x5588b8=_0x362e38[_0xa13d('0x79')](0x0)[_0xa13d('0x7a')]()+_0x362e38[_0xa13d('0x7b')](0x1);var _0x52a8ab={'type':_0x267a43[_0xa13d('0x7c')][_0xa13d('0x7d')][_0xa13d('0x7e')],'raw':!![]};return new Promise(function(_0xdc83f6,_0x3903a3){var _0xe45c75=squel[_0xa13d('0x7f')]()[_0xa13d('0x6')](_0xa13d('0x80')+_0x5588b8+_0xa13d('0x81'),'id')[_0xa13d('0x6')](_0xa13d('0x82'))[_0xa13d('0x83')](_0xa13d('0x84')+_0x362e38+_0xa13d('0x85'),'ui')[_0xa13d('0x86')]('ui.UserId\x20=\x20?',_0x15d491['id']);return _0x267a43['sequelize']['query'](_0xe45c75[_0xa13d('0x87')](),_0x52a8ab)[_0xa13d('0x8')](function(_0x387ab7){_0x15d491[_0x5588b8+'OpenTabs']=_0x387ab7;_0xdc83f6(_0x387ab7);})[_0xa13d('0xa')](function(_0x28849c){_0x3903a3(_0x28849c);});});}return _0x463e1a[_0xa13d('0x88')]('UserProfile',attributes,{'tableName':_0xa13d('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2ace95){var _0xbb260f={'raw':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x8b')],'where':{}};var _0x16b0cb={};var _0xfa08ad={'count':0x0,'rows':[]};var _0x97b2c2=_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x8c')];var _0x3c0bdd=_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x8d')]||![];var _0x2a5a06=_0x24aabf(_0x97b2c2,_0x3c0bdd);if(!_0x2a5a06[_0xa13d('0x14')])throw new Error(_0xa13d('0x8e')+_0x97b2c2+'\x27');var _0x49941e=[{'name':_0x97b2c2}];if(!_[_0xa13d('0x8f')](_0x2a5a06['parentSections']))_0x49941e=_0x2a5a06[_0xa13d('0x19')];var _0x4d3eb5=[];for(var _0x30eed9=0x0;_0x30eed9<_0x49941e[_0xa13d('0x90')];_0x30eed9++){_0x4d3eb5[_0xa13d('0x91')](_0x267a43['UserProfileSection'][_0xa13d('0x92')]({'where':{'userProfileId':_0x2ace95[_0xa13d('0x93')]['id'],'name':_0x49941e[_0x30eed9][_0xa13d('0xe')]},'raw':!![]}));}return Promise['all'](_0x4d3eb5)[_0xa13d('0x8')](function(_0x16d44e){var _0x3e3b4a=_[_0xa13d('0x5')](_0x16d44e,function(_0x53e4f1){return _0x53e4f1?_0x53e4f1:undefined;});var _0x2139ca=_[_0xa13d('0x5')](_0x49941e,[_0xa13d('0x94'),!![]]);var _0x359806=_[_0xa13d('0x8f')](_0x3e3b4a)&&_['isEmpty'](_0x2139ca)?null:_[_0xa13d('0x95')](_0x2139ca,_0x3e3b4a);if(!_0x359806)return null;var _0x3261bf=[];for(var _0x2805fe=0x0;_0x2805fe<_0x359806['length'];_0x2805fe++){var _0x5bfaf1=_['find'](_0x49941e,function(_0x59c53e){return _0x359806[_0x2805fe]?_0x59c53e['name']===_0x359806[_0x2805fe][_0xa13d('0xe')]:null;});if(_0x5bfaf1){if(_0x359806[_0x2805fe][_0xa13d('0x94')]){_0x3261bf[_0xa13d('0x91')](_0x2fafa6(_0x2a5a06[_0xa13d('0x14')],_0x359806[_0x2805fe]));}else{if(!_0x359806[_0x2805fe][_0xa13d('0x96')]){_0x3261bf['push'](_0x2a3701(_0x5bfaf1,_0x359806[_0x2805fe],_0x2a5a06[_0xa13d('0x14')]));}else{if(_0x5bfaf1[_0xa13d('0xb')]){_0x3261bf[_0xa13d('0x91')](_0x44b819(_0x5bfaf1,_0x359806[_0x2805fe]));}}}}}return Promise[_0xa13d('0x97')](_0x3261bf);})['then'](function(_0xf33335){var _0x179ba7=_0xf33335;var _0x580f2d=null;if(_0x179ba7){_0x580f2d=_0x179ba7[_0xa13d('0x90')]===0x1?_0x179ba7[0x0]:null;}if(!_0x580f2d&&!_0x179ba7)return _0xfa08ad;var _0x25a45f=_0x267a43[_0x2a5a06[_0xa13d('0x14')]][_0xa13d('0x98')];_0x16b0cb['model']=_[_0xa13d('0x99')](_0x25a45f);_0x16b0cb['query']=_[_0xa13d('0x99')](_0x2ace95[_0xa13d('0x8a')]);_0x16b0cb[_0xa13d('0x9a')]=_[_0xa13d('0x9b')](_0x16b0cb[_0xa13d('0xb')],_0x16b0cb[_0xa13d('0x8a')]);_0xbb260f[_0xa13d('0x9c')]=_['intersection'](_0x16b0cb['model'],qs[_0xa13d('0x9d')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x9d')]));_0xbb260f['attributes']=_0xbb260f[_0xa13d('0x9c')][_0xa13d('0x90')]?_0xbb260f[_0xa13d('0x9c')]:_0x16b0cb[_0xa13d('0xb')];if(!_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x9e')](_0xa13d('0x9f'))){_0xbb260f[_0xa13d('0xa0')]=qs['limit'](_0x2ace95[_0xa13d('0x8a')]['limit']);_0xbb260f[_0xa13d('0xa1')]=qs[_0xa13d('0xa1')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xa1')]);}_0xbb260f[_0xa13d('0xa2')]=qs[_0xa13d('0xa3')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xa3')]);_0xbb260f[_0xa13d('0x86')]=qs['filters'](_['pick'](_0x2ace95[_0xa13d('0x8a')],_0x16b0cb[_0xa13d('0x9a')]));if(_0x2ace95['query'][_0xa13d('0x5')]){_0xbb260f[_0xa13d('0x86')]=_[_0xa13d('0xa4')](_0xbb260f['where'],{'$or':_[_0xa13d('0xd')](_0x25a45f,function(_0xf22312){if(_0xf22312['type']['key']!==_0xa13d('0xa5')){var _0x1f7eba={};_0x1f7eba[_0xf22312['field']]={'$like':'%'+_0x2ace95[_0xa13d('0x8a')][_0xa13d('0x5')]+'%'};return _0x1f7eba;}})});}var _0x37ef89=[];var _0x5ad4cc=null;var _0x23f93a={};if(_0x580f2d){_0x5ad4cc=_[_0xa13d('0x92')](_0x49941e,['name',_0x580f2d[_0xa13d('0xe')]]);if(_0x5ad4cc[_0xa13d('0x6')]){_0x23f93a={};if(_0x2a5a06['childModel']==='AnalyticExtractedReport'){_0x23f93a[_0x5ad4cc[_0xa13d('0xa6')]]=_[_0xa13d('0xd')](_0x580f2d[_0xa13d('0x9')],'id');}else{_0x23f93a[_0x5ad4cc[_0xa13d('0xa6')]]=_0x580f2d[_0xa13d('0x9')];}_0x37ef89[_0xa13d('0x91')](_0x23f93a);}else{_0xbb260f[_0xa13d('0x86')]['id']=_0x580f2d['associatedResources'];}}else{for(var _0x5f0208=0x0;_0x5f0208<_0x179ba7[_0xa13d('0x90')];_0x5f0208++){_0x5ad4cc=_[_0xa13d('0x92')](_0x49941e,[_0xa13d('0xe'),_0x179ba7[_0x5f0208][_0xa13d('0xe')]]);if(_0x5ad4cc[_0xa13d('0x6')]){_0x23f93a={};_0x23f93a[_0x5ad4cc[_0xa13d('0xa6')]]=_0x179ba7[_0x5f0208]['associatedResources'];_0x37ef89[_0xa13d('0x91')](_0x23f93a);}else{if(!_0xbb260f[_0xa13d('0x86')]['id'])_0xbb260f[_0xa13d('0x86')]['id']=[];_0x179ba7[_0x5f0208]['associatedResources'][_0xa13d('0xa7')](function(_0x1c9690){_0xbb260f[_0xa13d('0x86')]['id'][_0xa13d('0x91')](_0x1c9690);});}}}if(!_[_0xa13d('0x8f')](_0x37ef89)){_0xbb260f['where']=_[_0xa13d('0xa4')](_0xbb260f['where'],{'$and':{'$or':_0x37ef89}});}_0xbb260f=_[_0xa13d('0xa4')]({},_0xbb260f,_0x2ace95[_0xa13d('0xa8')]);if(_0x580f2d&&!_0x580f2d[_0xa13d('0x96')]&&_0x2a5a06['childModel']===_0xa13d('0x10')){if(_0x2ace95['query']['includeAll']){_0xbb260f[_0xa13d('0xa9')]=[{'all':!![]}];}return _0x267a43[_0x2a5a06['childModel']][_0xa13d('0xc')](_0xbb260f)[_0xa13d('0x8')](function(_0x2509b3){var _0x2eeb92=[];_0x2509b3['forEach'](function(_0x50519b){var _0x80f8c;switch(_0x50519b[_0xa13d('0xaa')]){case _0xa13d('0xab'):_0x80f8c=_['find'](_0x580f2d['associatedResources'],function(_0x33c302){return _0x33c302['id']===_0x50519b[_0xa13d('0x77')]&&_0x33c302['type']===_0xa13d('0xac');});break;case _0xa13d('0xad'):_0x80f8c=_[_0xa13d('0x92')](_0x580f2d[_0xa13d('0x9')],function(_0x449913){return _0x449913['id']===_0x50519b[_0xa13d('0x77')]&&_0x449913[_0xa13d('0x11')]===_0xa13d('0xae');});break;}if(_0x80f8c)_0x2eeb92[_0xa13d('0x91')](_0x50519b);});_0xfa08ad['count']=_0x2eeb92[_0xa13d('0x90')];_0xfa08ad[_0xa13d('0xaf')]=_0x2eeb92;return _0xfa08ad;});}else{if(!_[_0xa13d('0x8f')](_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb0')])){_0xbb260f[_0xa13d('0x86')]['id']=_0xbb260f[_0xa13d('0x86')]['id']?_['intersection'](_0xbb260f['where']['id'],_0x2ace95[_0xa13d('0x8a')]['ids']):_0x2ace95[_0xa13d('0x8a')]['ids'];if(_0x2ace95['query'][_0xa13d('0xb1')]){_0xbb260f[_0xa13d('0xa2')]=_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb1')];}}if(_0x2ace95['query'][_0xa13d('0xb2')]){_0xbb260f[_0xa13d('0x86')]=_['merge'](_0xbb260f[_0xa13d('0x86')],{'$and':_0x2ace95['query'][_0xa13d('0xb2')]});}return _0x267a43[_0x2a5a06[_0xa13d('0x14')]]['count']({'where':_0xbb260f[_0xa13d('0x86')]})[_0xa13d('0x8')](function(_0x350945){_0xfa08ad[_0xa13d('0xb3')]=_0x350945;if(_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb4')]){if(_0x2a5a06[_0xa13d('0x14')]===_0xa13d('0x1f')){_0xbb260f[_0xa13d('0xa9')]=[{'model':_0x267a43['Tag'],'as':_0xa13d('0xb5'),'attributes':['id',_0xa13d('0xe'),_0xa13d('0xb6')],'required':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb7')]?!![]:![]},{'model':_0x267a43['Tag'],'as':_0xa13d('0xb8'),'attributes':['id',_0xa13d('0xe'),'color'],'through':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb7')]?{'attributes':[],'where':{'TagId':_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb7')]||undefined}}:{},'required':_0x2ace95[_0xa13d('0x8a')]['tag']?!![]:![]}];}else{_0xbb260f[_0xa13d('0xa9')]=[{'all':!![]}];}}return _0x267a43[_0x2a5a06[_0xa13d('0x14')]]['findAll'](_0xbb260f);})['then'](function(_0x435e1a){_0xfa08ad['rows']=_0x435e1a;if(_0x97b2c2===_0xa13d('0x34')&&_0x2ace95[_0xa13d('0x8a')][_0xa13d('0xb9')]==='true'){var _0x54c0aa=[];for(var _0x5c84cb=0x0;_0x5c84cb<_0xfa08ad['rows'][_0xa13d('0x90')];_0x5c84cb++){_0x54c0aa[_0xa13d('0x91')](_0xd910c6('chat',_0xfa08ad['rows'][_0x5c84cb][_0xa13d('0xba')]));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbb'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb][_0xa13d('0xba')]));_0x54c0aa[_0xa13d('0x91')](_0xd910c6('fax',_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb]['dataValues']));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbc'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb][_0xa13d('0xba')]));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbd'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb]['dataValues']));_0x54c0aa[_0xa13d('0x91')](_0xd910c6(_0xa13d('0xbe'),_0xfa08ad[_0xa13d('0xaf')][_0x5c84cb]['dataValues']));}return Promise[_0xa13d('0x97')](_0x54c0aa)[_0xa13d('0x8')](function(){return _0xfa08ad;});}return _0xfa08ad;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 31f0e8b..ab55057 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 _0x4f81=['localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x4f81,0x1e3));var _0x14f8=function(_0xc2ff25,_0x410ae7){_0xc2ff25=_0xc2ff25-0x0;var _0x176093=_0x4f81[_0xc2ff25];return _0x176093;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x14f8('0x1'));var fs=require('fs');var Redis=require(_0x14f8('0x2'));var db=require(_0x14f8('0x3'))['db'];var utils=require(_0x14f8('0x4'));var logger=require(_0x14f8('0x5'))(_0x14f8('0x6'));var config=require(_0x14f8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14f8('0x8')]['http']({'port':0x232a});config[_0x14f8('0x9')]=_[_0x14f8('0xa')](config['redis'],{'host':_0x14f8('0xb'),'port':0x18eb});var socket=require(_0x14f8('0xc'))(new Redis(config['redis']));require(_0x14f8('0xd'))['register'](socket);function respondWithRpcPromise(_0x496303,_0x19a1d0,_0x40a43d){return new BPromise(function(_0xbfbf2a,_0xd10497){return client[_0x14f8('0xe')](_0x496303,_0x40a43d)[_0x14f8('0xf')](function(_0x1fa3e8){logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,_0x14f8('0x12'));logger[_0x14f8('0x13')](_0x14f8('0x14'),_0x19a1d0,'request\x20sent',JSON[_0x14f8('0x15')](_0x1fa3e8));if(_0x1fa3e8[_0x14f8('0x16')]){if(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x17')]===0x1f4){logger[_0x14f8('0x16')](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xd10497(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xbfbf2a(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}else{logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,'request\x20sent');_0xbfbf2a(_0x1fa3e8[_0x14f8('0x19')][_0x14f8('0x18')]);}})['catch'](function(_0x4f5720){logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x4f5720);_0xd10497(_0x4f5720);});});} \ No newline at end of file +var _0x22e3=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x516bcf,_0x154b52){var _0x405746=function(_0x53e1d9){while(--_0x53e1d9){_0x516bcf['push'](_0x516bcf['shift']());}};_0x405746(++_0x154b52);}(_0x22e3,0xf3));var _0x322e=function(_0x18d9aa,_0x560c05){_0x18d9aa=_0x18d9aa-0x0;var _0x1ff1c0=_0x22e3[_0x18d9aa];return _0x1ff1c0;};'use strict';var _=require(_0x322e('0x0'));var util=require(_0x322e('0x1'));var moment=require(_0x322e('0x2'));var BPromise=require('bluebird');var rs=require(_0x322e('0x3'));var fs=require('fs');var Redis=require(_0x322e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x322e('0x5'));var logger=require(_0x322e('0x6'))(_0x322e('0x7'));var config=require(_0x322e('0x8'));var jayson=require(_0x322e('0x9'));var client=jayson['client'][_0x322e('0xa')]({'port':0x232a});config[_0x322e('0xb')]=_[_0x322e('0xc')](config[_0x322e('0xb')],{'host':_0x322e('0xd'),'port':0x18eb});var socket=require(_0x322e('0xe'))(new Redis(config[_0x322e('0xb')]));require(_0x322e('0xf'))[_0x322e('0x10')](socket);function respondWithRpcPromise(_0x4c03ba,_0x4efb79,_0x311486){return new BPromise(function(_0x503f20,_0x35625d){return client['request'](_0x4c03ba,_0x311486)['then'](function(_0x4c9c99){logger[_0x322e('0x11')](_0x322e('0x12'),_0x4efb79,'request\x20sent');logger[_0x322e('0x13')](_0x322e('0x14'),_0x4efb79,_0x322e('0x15'),JSON['stringify'](_0x4c9c99));if(_0x4c9c99[_0x322e('0x16')]){if(_0x4c9c99[_0x322e('0x16')][_0x322e('0x17')]===0x1f4){logger[_0x322e('0x16')]('UserProfile,\x20%s,\x20%s',_0x4efb79,_0x4c9c99['error'][_0x322e('0x18')]);return _0x35625d(_0x4c9c99[_0x322e('0x16')]['message']);}logger[_0x322e('0x16')](_0x322e('0x12'),_0x4efb79,_0x4c9c99[_0x322e('0x16')][_0x322e('0x18')]);return _0x503f20(_0x4c9c99[_0x322e('0x16')]['message']);}else{logger[_0x322e('0x11')](_0x322e('0x12'),_0x4efb79,_0x322e('0x15'));_0x503f20(_0x4c9c99[_0x322e('0x19')]['message']);}})[_0x322e('0x1a')](function(_0x1f0771){logger[_0x322e('0x16')](_0x322e('0x12'),_0x4efb79,_0x1f0771);_0x35625d(_0x1f0771);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 4314324..7ee3a79 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 _0xb6fc=['removeListener','length','./userProfile.events','save','update','emit'];(function(_0x8a65e2,_0x25cc4e){var _0x1f88db=function(_0x559147){while(--_0x559147){_0x8a65e2['push'](_0x8a65e2['shift']());}};_0x1f88db(++_0x25cc4e);}(_0xb6fc,0x19a));var _0xcb6f=function(_0x145355,_0x3e1901){_0x145355=_0x145355-0x0;var _0x35a1e0=_0xb6fc[_0x145355];return _0x35a1e0;};'use strict';var UserProfileEvents=require(_0xcb6f('0x0'));var events=[_0xcb6f('0x1'),'remove',_0xcb6f('0x2')];function createListener(_0x1f7bff,_0x5244d7){return function(_0x23a426){_0x5244d7[_0xcb6f('0x3')](_0x1f7bff,_0x23a426);};}function removeListener(_0x4b11ff,_0x24307f){return function(){UserProfileEvents[_0xcb6f('0x4')](_0x4b11ff,_0x24307f);};}exports['register']=function(_0x5b8c2b){for(var _0x185857=0x0,_0x5e4449=events[_0xcb6f('0x5')];_0x185857<_0x5e4449;_0x185857++){var _0x33b512=events[_0x185857];var _0x29a772=createListener('userProfile:'+_0x33b512,_0x5b8c2b);UserProfileEvents['on'](_0x33b512,_0x29a772);}}; \ No newline at end of file +var _0xb149=['remove','update','emit','length','./userProfile.events','save'];(function(_0x239e01,_0x1217d3){var _0x4619c9=function(_0x7a9326){while(--_0x7a9326){_0x239e01['push'](_0x239e01['shift']());}};_0x4619c9(++_0x1217d3);}(_0xb149,0x130));var _0x9b14=function(_0x1ca882,_0x14f6e6){_0x1ca882=_0x1ca882-0x0;var _0x357d7e=_0xb149[_0x1ca882];return _0x357d7e;};'use strict';var UserProfileEvents=require(_0x9b14('0x0'));var events=[_0x9b14('0x1'),_0x9b14('0x2'),_0x9b14('0x3')];function createListener(_0x1f8dd7,_0x5c7d59){return function(_0x273e33){_0x5c7d59[_0x9b14('0x4')](_0x1f8dd7,_0x273e33);};}function removeListener(_0x5079cc,_0x2c9027){return function(){UserProfileEvents['removeListener'](_0x5079cc,_0x2c9027);};}exports['register']=function(_0x70ab78){for(var _0x3e0689=0x0,_0x1374ab=events[_0x9b14('0x5')];_0x3e0689<_0x1374ab;_0x3e0689++){var _0x38944b=events[_0x3e0689];var _0x24cdeb=createListener('userProfile:'+_0x38944b,_0x70ab78);UserProfileEvents['on'](_0x38944b,_0x24cdeb);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 6de463e..bb0e229 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 _0x8fbb=['put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x1c82e5,_0x1c3a9f){var _0xf1d539=function(_0x47e39b){while(--_0x47e39b){_0x1c82e5['push'](_0x1c82e5['shift']());}};_0xf1d539(++_0x1c3a9f);}(_0x8fbb,0x1bc));var _0xb8fb=function(_0x17a862,_0x220cef){_0x17a862=_0x17a862-0x0;var _0x1d0131=_0x8fbb[_0x17a862];return _0x1d0131;};'use strict';var multer=require('multer');var util=require(_0xb8fb('0x0'));var path=require(_0xb8fb('0x1'));var timeout=require('connect-timeout');var express=require(_0xb8fb('0x2'));var router=express[_0xb8fb('0x3')]();var fs_extra=require(_0xb8fb('0x4'));var auth=require(_0xb8fb('0x5'));var interaction=require(_0xb8fb('0x6'));var config=require('../../config/environment');var controller=require(_0xb8fb('0x7'));router[_0xb8fb('0x8')]('/',auth[_0xb8fb('0x9')](),controller['index']);router['get'](_0xb8fb('0xa'),auth['isAuthenticated'](),controller[_0xb8fb('0xb')]);router[_0xb8fb('0x8')](_0xb8fb('0xc'),auth[_0xb8fb('0x9')](),controller[_0xb8fb('0xd')]);router[_0xb8fb('0xe')]('/',auth['isAuthenticated'](),controller[_0xb8fb('0xf')]);router[_0xb8fb('0x10')](_0xb8fb('0xc'),auth[_0xb8fb('0x9')](),controller['update']);router[_0xb8fb('0x11')]('/:id',auth[_0xb8fb('0x9')](),controller[_0xb8fb('0x12')]);module[_0xb8fb('0x13')]=router; \ No newline at end of file +var _0x2a4b=['show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x17a112,_0x29bb37){_0x17a112=_0x17a112-0x0;var _0x1bbe7b=_0x2a4b[_0x17a112];return _0x1bbe7b;};'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('./userProfileResource.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('0xe')]('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xf')]);router['put'](_0xb2a4('0xc'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x10')]);router[_0xb2a4('0x11')](_0xb2a4('0xc'),auth['isAuthenticated'](),controller[_0xb2a4('0x12')]);module[_0xb2a4('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3184fdf..36e930f 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 _0xd545=['INTEGER','STRING'];(function(_0x2d5d8f,_0x2edbda){var _0x183a00=function(_0xe86c4){while(--_0xe86c4){_0x2d5d8f['push'](_0x2d5d8f['shift']());}};_0x183a00(++_0x2edbda);}(_0xd545,0xcf));var _0x5d54=function(_0x3c19e2,_0x4a1dfa){_0x3c19e2=_0x3c19e2-0x0;var _0x3073a4=_0xd545[_0x3c19e2];return _0x3073a4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5d54('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5d54('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xa429=['STRING','INTEGER','sequelize','exports'];(function(_0x546f1b,_0x20e863){var _0x4b34bd=function(_0x3af9a2){while(--_0x3af9a2){_0x546f1b['push'](_0x546f1b['shift']());}};_0x4b34bd(++_0x20e863);}(_0xa429,0x17a));var _0x9a42=function(_0x45451b,_0x283140){_0x45451b=_0x45451b-0x0;var _0x48cfd8=_0xa429[_0x45451b];return _0x48cfd8;};'use strict';var Sequelize=require(_0x9a42('0x0'));module[_0x9a42('0x1')]={'name':{'type':Sequelize[_0x9a42('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9a42('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9a42('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 10d7313..f910be5 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 _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5f4f2a,_0x803d33){var _0x1256da=function(_0x2885c3){while(--_0x2885c3){_0x5f4f2a['push'](_0x5f4f2a['shift']());}};_0x1256da(++_0x803d33);}(_0x524e,0x15e));var _0xe524=function(_0x41ca02,_0x460a5b){_0x41ca02=_0x41ca02-0x0;var _0x4e9f46=_0x524e[_0x41ca02];return _0x4e9f46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));}; \ No newline at end of file +var _0x01d9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','UserProfileResource'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['UserProfileResource'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['UserProfileResource'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));};exports[_0x901d('0x4d')]=function(_0x52aa2d,_0x3a3ea6){return db[_0x901d('0x2f')][_0x901d('0x4d')]()[_0x901d('0x28')](respondWithResult(_0x3a3ea6,null))[_0x901d('0x46')](handleError(_0x3a3ea6,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 61f659c..178ea69 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 _0x7bda=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x7bda,0xec));var _0xa7bd=function(_0x1f1063,_0x35d121){_0x1f1063=_0x1f1063-0x0;var _0x4c31b2=_0x7bda[_0x1f1063];return _0x4c31b2;};'use strict';var _=require(_0xa7bd('0x0'));var util=require('util');var logger=require(_0xa7bd('0x1'))(_0xa7bd('0x2'));var moment=require(_0xa7bd('0x3'));var BPromise=require(_0xa7bd('0x4'));var rp=require(_0xa7bd('0x5'));var fs=require('fs');var path=require(_0xa7bd('0x6'));var rimraf=require(_0xa7bd('0x7'));var config=require(_0xa7bd('0x8'));var attributes=require('./userProfileResource.attributes');module[_0xa7bd('0x9')]=function(_0x51d66d,_0x32af3f){return _0x51d66d[_0xa7bd('0xa')](_0xa7bd('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xa7bd('0xc'),'fields':[_0xa7bd('0xd'),_0xa7bd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd2b7=['UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd2b7,0x1d8));var _0x7d2b=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0xd2b7[_0x369a98];return _0x29565c;};'use strict';var _=require(_0x7d2b('0x0'));var util=require(_0x7d2b('0x1'));var logger=require(_0x7d2b('0x2'))(_0x7d2b('0x3'));var moment=require(_0x7d2b('0x4'));var BPromise=require('bluebird');var rp=require(_0x7d2b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d2b('0x6'));var config=require(_0x7d2b('0x7'));var attributes=require(_0x7d2b('0x8'));module['exports']=function(_0x40345d,_0x11262d){return _0x40345d['define'](_0x7d2b('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x7d2b('0xa'),'fields':[_0x7d2b('0xb'),_0x7d2b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ec400ea..5e3da03 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 _0x3100=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x17ac74,_0x2cae64){var _0x4d37db=function(_0x2bc194){while(--_0x2bc194){_0x17ac74['push'](_0x17ac74['shift']());}};_0x4d37db(++_0x2cae64);}(_0x3100,0x7d));var _0x0310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3100[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0310('0x0'));var util=require(_0x0310('0x1'));var moment=require(_0x0310('0x2'));var BPromise=require(_0x0310('0x3'));var rs=require(_0x0310('0x4'));var fs=require('fs');var Redis=require(_0x0310('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0310('0x6'));var logger=require(_0x0310('0x7'))(_0x0310('0x8'));var config=require('../../config/environment');var jayson=require(_0x0310('0x9'));var client=jayson['client'][_0x0310('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59855c,_0x18265c,_0x460801){return new BPromise(function(_0x2b77e4,_0x5405a){return client['request'](_0x59855c,_0x460801)[_0x0310('0xb')](function(_0x449663){logger[_0x0310('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x18265c,'request\x20sent');logger['debug'](_0x0310('0xd'),_0x18265c,_0x0310('0xe'),JSON[_0x0310('0xf')](_0x449663));if(_0x449663[_0x0310('0x10')]){if(_0x449663['error']['code']===0x1f4){logger[_0x0310('0x10')](_0x0310('0x11'),_0x18265c,_0x449663[_0x0310('0x10')][_0x0310('0x12')]);return _0x5405a(_0x449663[_0x0310('0x10')][_0x0310('0x12')]);}logger[_0x0310('0x10')](_0x0310('0x11'),_0x18265c,_0x449663['error'][_0x0310('0x12')]);return _0x2b77e4(_0x449663[_0x0310('0x10')]['message']);}else{logger[_0x0310('0xc')](_0x0310('0x11'),_0x18265c,_0x0310('0xe'));_0x2b77e4(_0x449663[_0x0310('0x13')][_0x0310('0x12')]);}})[_0x0310('0x14')](function(_0x10e1a5){logger[_0x0310('0x10')](_0x0310('0x11'),_0x18265c,_0x10e1a5);_0x5405a(_0x10e1a5);});});} \ No newline at end of file +var _0xfcfc=['info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x59107b,_0x1df703){var _0x393f6f=function(_0x3bbf94){while(--_0x3bbf94){_0x59107b['push'](_0x59107b['shift']());}};_0x393f6f(++_0x1df703);}(_0xfcfc,0x150));var _0xcfcf=function(_0x148061,_0x12979e){_0x148061=_0x148061-0x0;var _0x2cc3e0=_0xfcfc[_0x148061];return _0x2cc3e0;};'use strict';var _=require(_0xcfcf('0x0'));var util=require(_0xcfcf('0x1'));var moment=require(_0xcfcf('0x2'));var BPromise=require(_0xcfcf('0x3'));var rs=require(_0xcfcf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfcf('0x5'))['db'];var utils=require(_0xcfcf('0x6'));var logger=require(_0xcfcf('0x7'))(_0xcfcf('0x8'));var config=require('../../config/environment');var jayson=require(_0xcfcf('0x9'));var client=jayson[_0xcfcf('0xa')][_0xcfcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x396d64,_0x386dc5,_0x3b6ac0){return new BPromise(function(_0x22d1f4,_0x1c8b00){return client[_0xcfcf('0xc')](_0x396d64,_0x3b6ac0)[_0xcfcf('0xd')](function(_0x4f5a7e){logger[_0xcfcf('0xe')](_0xcfcf('0xf'),_0x386dc5,_0xcfcf('0x10'));logger[_0xcfcf('0x11')](_0xcfcf('0x12'),_0x386dc5,'request\x20sent',JSON[_0xcfcf('0x13')](_0x4f5a7e));if(_0x4f5a7e[_0xcfcf('0x14')]){if(_0x4f5a7e[_0xcfcf('0x14')][_0xcfcf('0x15')]===0x1f4){logger[_0xcfcf('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x386dc5,_0x4f5a7e[_0xcfcf('0x14')][_0xcfcf('0x16')]);return _0x1c8b00(_0x4f5a7e['error']['message']);}logger['error'](_0xcfcf('0xf'),_0x386dc5,_0x4f5a7e['error'][_0xcfcf('0x16')]);return _0x22d1f4(_0x4f5a7e[_0xcfcf('0x14')][_0xcfcf('0x16')]);}else{logger['info'](_0xcfcf('0xf'),_0x386dc5,_0xcfcf('0x10'));_0x22d1f4(_0x4f5a7e[_0xcfcf('0x17')][_0xcfcf('0x16')]);}})[_0xcfcf('0x18')](function(_0xefa269){logger['error'](_0xcfcf('0xf'),_0x386dc5,_0xefa269);_0x1c8b00(_0xefa269);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c51ac2a..4de6704 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 _0x4353=['create','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id','post'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x4353,0x81));var _0x3435=function(_0x17db17,_0x169a82){_0x17db17=_0x17db17-0x0;var _0x1a8f83=_0x4353[_0x17db17];return _0x1a8f83;};'use strict';var multer=require(_0x3435('0x0'));var util=require(_0x3435('0x1'));var path=require(_0x3435('0x2'));var timeout=require(_0x3435('0x3'));var express=require(_0x3435('0x4'));var router=express['Router']();var fs_extra=require(_0x3435('0x5'));var auth=require(_0x3435('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3435('0x7'));var controller=require(_0x3435('0x8'));router[_0x3435('0x9')]('/',auth[_0x3435('0xa')](),controller[_0x3435('0xb')]);router[_0x3435('0x9')](_0x3435('0xc'),auth[_0x3435('0xa')](),controller['describe']);router['get'](_0x3435('0xd'),auth[_0x3435('0xa')](),controller['show']);router[_0x3435('0xe')]('/',auth[_0x3435('0xa')](),controller[_0x3435('0xf')]);router['put'](_0x3435('0xd'),auth[_0x3435('0xa')](),controller[_0x3435('0x10')]);router[_0x3435('0x11')](_0x3435('0xd'),auth[_0x3435('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b4b=['isAuthenticated','index','describe','/:id','show','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x455ebc,_0xaa565e){var _0x156d98=function(_0x1ad93b){while(--_0x1ad93b){_0x455ebc['push'](_0x455ebc['shift']());}};_0x156d98(++_0xaa565e);}(_0x3b4b,0xe6));var _0xb3b4=function(_0x54bbdd,_0x42ec26){_0x54bbdd=_0x54bbdd-0x0;var _0x5a4bfa=_0x3b4b[_0x54bbdd];return _0x5a4bfa;};'use strict';var multer=require('multer');var util=require(_0xb3b4('0x0'));var path=require(_0xb3b4('0x1'));var timeout=require('connect-timeout');var express=require(_0xb3b4('0x2'));var router=express[_0xb3b4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb3b4('0x5'));var controller=require(_0xb3b4('0x6'));router[_0xb3b4('0x7')]('/',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0x9')]);router[_0xb3b4('0x7')]('/describe',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0xa')]);router[_0xb3b4('0x7')](_0xb3b4('0xb'),auth['isAuthenticated'](),controller[_0xb3b4('0xc')]);router['post']('/',auth[_0xb3b4('0x8')](),controller['create']);router['put'](_0xb3b4('0xb'),auth['isAuthenticated'](),controller[_0xb3b4('0xd')]);router[_0xb3b4('0xe')]('/:id',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0xf')]);module[_0xb3b4('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index dd322c2..9e62de9 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 _0x63a5=['STRING','INTEGER','BOOLEAN','setDataValue','getDataValue','crudPermissions','sequelize','exports'];(function(_0x496c30,_0x4f32cf){var _0x168fbb=function(_0x26a112){while(--_0x26a112){_0x496c30['push'](_0x496c30['shift']());}};_0x168fbb(++_0x4f32cf);}(_0x63a5,0x18e));var _0x563a=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x63a5[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x563a('0x0'));module[_0x563a('0x1')]={'name':{'type':Sequelize[_0x563a('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x563a('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x563a('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x563a('0x2')],'set':function(_0x386400){this[_0x563a('0x5')]('crudPermissions',_0x386400?_0x386400['join'](''):[]);},'get':function(){return this[_0x563a('0x6')]('crudPermissions')?this[_0x563a('0x6')](_0x563a('0x7'))['split'](''):[];}}}; \ No newline at end of file +var _0x1c7c=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','BOOLEAN'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0x1c7c,0x164));var _0xc1c7=function(_0x3c2141,_0x4b49ce){_0x3c2141=_0x3c2141-0x0;var _0x3b23db=_0x1c7c[_0x3c2141];return _0x3b23db;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'name':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc1c7('0x2')],'set':function(_0x20dad3){this[_0xc1c7('0x4')](_0xc1c7('0x5'),_0x20dad3?_0x20dad3[_0xc1c7('0x6')](''):[]);},'get':function(){return this[_0xc1c7('0x7')](_0xc1c7('0x5'))?this[_0xc1c7('0x7')](_0xc1c7('0x5'))[_0xc1c7('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6ac1b5d..c9582b5 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 _0xa0ee=['../../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','reject','update','then','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','catch','show','params','find','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x351c3a,_0x542614){var _0x30e177=function(_0x5214fe){while(--_0x5214fe){_0x351c3a['push'](_0x351c3a['shift']());}};_0x30e177(++_0x542614);}(_0xa0ee,0xc2));var _0xea0e=function(_0x526dc2,_0x37ebb8){_0x526dc2=_0x526dc2-0x0;var _0x54e521=_0xa0ee[_0x526dc2];return _0x54e521;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea0e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xea0e('0x1'));var moment=require(_0xea0e('0x2'));var BPromise=require(_0xea0e('0x3'));var Mustache=require(_0xea0e('0x4'));var util=require(_0xea0e('0x5'));var path=require(_0xea0e('0x6'));var sox=require(_0xea0e('0x7'));var csv=require(_0xea0e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea0e('0x9'));var _=require(_0xea0e('0xa'));var squel=require('squel');var crypto=require(_0xea0e('0xb'));var jsforce=require(_0xea0e('0xc'));var deskjs=require(_0xea0e('0xd'));var toCsv=require(_0xea0e('0x8'));var querystring=require(_0xea0e('0xe'));var Papa=require('papaparse');var Redis=require(_0xea0e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea0e('0x10'));var logger=require(_0xea0e('0x11'))(_0xea0e('0x12'));var utils=require(_0xea0e('0x13'));var config=require(_0xea0e('0x14'));var licenseUtil=require(_0xea0e('0x15'));var db=require(_0xea0e('0x16'))['db'];function respondWithStatusCode(_0x597806,_0x382b2a){_0x382b2a=_0x382b2a||0xcc;return function(_0x47f226){if(_0x47f226){return _0x597806[_0xea0e('0x17')](_0x382b2a);}return _0x597806[_0xea0e('0x18')](_0x382b2a)[_0xea0e('0x19')]();};}function respondWithResult(_0x343074,_0x2b87dc){_0x2b87dc=_0x2b87dc||0xc8;return function(_0x30adc6){if(_0x30adc6){return _0x343074[_0xea0e('0x18')](_0x2b87dc)['json'](_0x30adc6);}};}function respondWithFilteredResult(_0x14cbcc,_0x4a4c9e){return function(_0x2c59ed){if(_0x2c59ed){var _0x5593d8=typeof _0x4a4c9e[_0xea0e('0x1a')]===_0xea0e('0x1b')&&typeof _0x4a4c9e[_0xea0e('0x1c')]===_0xea0e('0x1b');var _0x503484=_0x2c59ed[_0xea0e('0x1d')];var _0x2e99d9=_0x5593d8?0x0:_0x4a4c9e['offset'];var _0x4dfbd6=_0x5593d8?_0x2c59ed[_0xea0e('0x1d')]:_0x4a4c9e[_0xea0e('0x1a')]+_0x4a4c9e[_0xea0e('0x1c')];var _0x7d3745;if(_0x4dfbd6>=_0x503484){_0x4dfbd6=_0x503484;_0x7d3745=0xc8;}else{_0x7d3745=0xce;}_0x14cbcc[_0xea0e('0x18')](_0x7d3745);return _0x14cbcc[_0xea0e('0x1e')](_0xea0e('0x1f'),_0x2e99d9+'-'+_0x4dfbd6+'/'+_0x503484)[_0xea0e('0x20')](_0x2c59ed);}return null;};}function patchUpdates(_0x5837fa){return function(_0x108bc3){try{jsonpatch['apply'](_0x108bc3,_0x5837fa,!![]);}catch(_0x554dc4){return BPromise[_0xea0e('0x21')](_0x554dc4);}return _0x108bc3['save']();};}function saveUpdates(_0x39e140,_0x5b0933){return function(_0x5b1941){if(_0x5b1941){return _0x5b1941[_0xea0e('0x22')](_0x39e140)['then'](function(_0x4c8303){return _0x4c8303;});}return null;};}function removeEntity(_0x57ebbc,_0x98520d){return function(_0x290eae){if(_0x290eae){return _0x290eae['destroy']()[_0xea0e('0x23')](function(){_0x57ebbc[_0xea0e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130168,_0x4c936f){return function(_0x1adb00){if(!_0x1adb00){_0x130168[_0xea0e('0x17')](0x194);}return _0x1adb00;};}function handleError(_0x220081,_0x5d0029){_0x5d0029=_0x5d0029||0x1f4;return function(_0x59ead9){logger[_0xea0e('0x24')](_0x59ead9['stack']);if(_0x59ead9[_0xea0e('0x25')]){delete _0x59ead9['name'];}_0x220081[_0xea0e('0x18')](_0x5d0029)[_0xea0e('0x26')](_0x59ead9);};}exports[_0xea0e('0x27')]=function(_0x2c69b3,_0x797eef){var _0x581fea={},_0x984926={},_0x59e1f9={'count':0x0,'rows':[]};var _0x5eddcf=_[_0xea0e('0x28')](db[_0xea0e('0x29')][_0xea0e('0x2a')],function(_0x51fa7a){return{'name':_0x51fa7a[_0xea0e('0x2b')],'type':_0x51fa7a['type'][_0xea0e('0x2c')]};});_0x984926['model']=_['map'](_0x5eddcf,_0xea0e('0x25'));_0x984926[_0xea0e('0x2d')]=_[_0xea0e('0x2e')](_0x2c69b3['query']);_0x984926[_0xea0e('0x2f')]=_[_0xea0e('0x30')](_0x984926[_0xea0e('0x31')],_0x984926[_0xea0e('0x2d')]);_0x581fea[_0xea0e('0x32')]=_[_0xea0e('0x30')](_0x984926[_0xea0e('0x31')],qs['fields'](_0x2c69b3[_0xea0e('0x2d')][_0xea0e('0x33')]));_0x581fea[_0xea0e('0x32')]=_0x581fea['attributes'][_0xea0e('0x34')]?_0x581fea[_0xea0e('0x32')]:_0x984926[_0xea0e('0x31')];if(!_0x2c69b3[_0xea0e('0x2d')]['hasOwnProperty']('nolimit')){_0x581fea[_0xea0e('0x1c')]=qs[_0xea0e('0x1c')](_0x2c69b3['query'][_0xea0e('0x1c')]);_0x581fea[_0xea0e('0x1a')]=qs[_0xea0e('0x1a')](_0x2c69b3['query'][_0xea0e('0x1a')]);}_0x581fea[_0xea0e('0x35')]=qs['sort'](_0x2c69b3['query'][_0xea0e('0x36')]);_0x581fea[_0xea0e('0x37')]=qs[_0xea0e('0x2f')](_[_0xea0e('0x38')](_0x2c69b3['query'],_0x984926['filters']),_0x5eddcf);if(_0x2c69b3[_0xea0e('0x2d')]['filter']){_0x581fea[_0xea0e('0x37')]=_[_0xea0e('0x39')](_0x581fea[_0xea0e('0x37')],{'$or':_[_0xea0e('0x28')](_0x5eddcf,function(_0x5410a4){if(_0x5410a4[_0xea0e('0x3a')]!=='VIRTUAL'){var _0x33b249={};_0x33b249[_0x5410a4[_0xea0e('0x25')]]={'$like':'%'+_0x2c69b3[_0xea0e('0x2d')][_0xea0e('0x3b')]+'%'};return _0x33b249;}})});}_0x581fea=_[_0xea0e('0x39')]({},_0x581fea,_0x2c69b3[_0xea0e('0x3c')]);var _0x22f5e3={'where':_0x581fea['where']};return db['UserProfileSection']['count'](_0x22f5e3)[_0xea0e('0x23')](function(_0x3de676){_0x59e1f9[_0xea0e('0x1d')]=_0x3de676;if(_0x2c69b3[_0xea0e('0x2d')][_0xea0e('0x3d')]){_0x581fea[_0xea0e('0x3e')]=[{'all':!![]}];}return db[_0xea0e('0x29')][_0xea0e('0x3f')](_0x581fea);})[_0xea0e('0x23')](function(_0x4011cf){_0x59e1f9['rows']=_0x4011cf;return _0x59e1f9;})[_0xea0e('0x23')](respondWithFilteredResult(_0x797eef,_0x581fea))[_0xea0e('0x40')](handleError(_0x797eef,null));};exports[_0xea0e('0x41')]=function(_0x36a632,_0xc04299){var _0x3c007e={'raw':![],'where':{'id':_0x36a632[_0xea0e('0x42')]['id']}},_0x4b5561={};_0x4b5561[_0xea0e('0x31')]=_[_0xea0e('0x2e')](db['UserProfileSection'][_0xea0e('0x2a')]);_0x4b5561[_0xea0e('0x2d')]=_[_0xea0e('0x2e')](_0x36a632[_0xea0e('0x2d')]);_0x4b5561[_0xea0e('0x2f')]=_[_0xea0e('0x30')](_0x4b5561[_0xea0e('0x31')],_0x4b5561[_0xea0e('0x2d')]);_0x3c007e['attributes']=_[_0xea0e('0x30')](_0x4b5561[_0xea0e('0x31')],qs[_0xea0e('0x33')](_0x36a632['query'][_0xea0e('0x33')]));_0x3c007e[_0xea0e('0x32')]=_0x3c007e[_0xea0e('0x32')][_0xea0e('0x34')]?_0x3c007e[_0xea0e('0x32')]:_0x4b5561['model'];if(_0x36a632[_0xea0e('0x2d')][_0xea0e('0x3d')]){_0x3c007e['include']=[{'all':!![]}];}_0x3c007e=_[_0xea0e('0x39')]({},_0x3c007e,_0x36a632['options']);return db[_0xea0e('0x29')][_0xea0e('0x43')](_0x3c007e)[_0xea0e('0x23')](handleEntityNotFound(_0xc04299,null))[_0xea0e('0x23')](respondWithResult(_0xc04299,null))[_0xea0e('0x40')](handleError(_0xc04299,null));};exports['create']=function(_0x448e49,_0x14474f){return db[_0xea0e('0x29')]['create'](_0x448e49[_0xea0e('0x44')],{})['then'](respondWithResult(_0x14474f,0xc9))[_0xea0e('0x40')](handleError(_0x14474f,null));};exports['update']=function(_0x1382fa,_0x398e39){if(_0x1382fa['body']['id']){delete _0x1382fa[_0xea0e('0x44')]['id'];}return db[_0xea0e('0x29')]['find']({'where':{'id':_0x1382fa['params']['id']}})[_0xea0e('0x23')](handleEntityNotFound(_0x398e39,null))[_0xea0e('0x23')](saveUpdates(_0x1382fa[_0xea0e('0x44')],null))[_0xea0e('0x23')](respondWithResult(_0x398e39,null))[_0xea0e('0x40')](handleError(_0x398e39,null));};exports['destroy']=function(_0x2ea601,_0x1eeeb8){return db[_0xea0e('0x29')][_0xea0e('0x43')]({'where':{'id':_0x2ea601['params']['id']}})[_0xea0e('0x23')](handleEntityNotFound(_0x1eeeb8,null))[_0xea0e('0x23')](removeEntity(_0x1eeeb8,null))[_0xea0e('0x40')](handleError(_0x1eeeb8,null));};exports[_0xea0e('0x45')]=function(_0x1003e1,_0x2e7cf7){return db[_0xea0e('0x29')][_0xea0e('0x45')]()[_0xea0e('0x23')](respondWithResult(_0x2e7cf7,null))[_0xea0e('0x40')](handleError(_0x2e7cf7,null));}; \ No newline at end of file +var _0x100a=['show','length','create','body','params','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','rows','catch'];(function(_0x38905e,_0xd979c7){var _0x1846e5=function(_0x5479c1){while(--_0x5479c1){_0x38905e['push'](_0x38905e['shift']());}};_0x1846e5(++_0xd979c7);}(_0x100a,0x9f));var _0xa100=function(_0x4ab986,_0x6de6fc){_0x4ab986=_0x4ab986-0x0;var _0x55181e=_0x100a[_0x4ab986];return _0x55181e;};'use strict';var emlformat=require(_0xa100('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa100('0x1'));var jsonpatch=require(_0xa100('0x2'));var rp=require(_0xa100('0x3'));var moment=require(_0xa100('0x4'));var BPromise=require(_0xa100('0x5'));var Mustache=require('mustache');var util=require(_0xa100('0x6'));var path=require('path');var sox=require(_0xa100('0x7'));var csv=require(_0xa100('0x8'));var ejs=require(_0xa100('0x9'));var fs=require('fs');var fs_extra=require(_0xa100('0xa'));var _=require('lodash');var squel=require(_0xa100('0xb'));var crypto=require(_0xa100('0xc'));var jsforce=require(_0xa100('0xd'));var deskjs=require(_0xa100('0xe'));var toCsv=require(_0xa100('0x8'));var querystring=require(_0xa100('0xf'));var Papa=require(_0xa100('0x10'));var Redis=require(_0xa100('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa100('0x12'));var as=require(_0xa100('0x13'));var hardwareService=require(_0xa100('0x14'));var logger=require('../../config/logger')(_0xa100('0x15'));var utils=require(_0xa100('0x16'));var config=require(_0xa100('0x17'));var licenseUtil=require(_0xa100('0x18'));var db=require(_0xa100('0x19'))['db'];function respondWithStatusCode(_0x4ab943,_0x131b14){_0x131b14=_0x131b14||0xcc;return function(_0xfc8a5c){if(_0xfc8a5c){return _0x4ab943[_0xa100('0x1a')](_0x131b14);}return _0x4ab943['status'](_0x131b14)[_0xa100('0x1b')]();};}function respondWithResult(_0x54186f,_0x50993e){_0x50993e=_0x50993e||0xc8;return function(_0x39bd50){if(_0x39bd50){return _0x54186f[_0xa100('0x1c')](_0x50993e)[_0xa100('0x1d')](_0x39bd50);}};}function respondWithFilteredResult(_0x61bdd0,_0x1f527c){return function(_0x47ecfb){if(_0x47ecfb){var _0x24815f=typeof _0x1f527c[_0xa100('0x1e')]===_0xa100('0x1f')&&typeof _0x1f527c[_0xa100('0x20')]==='undefined';var _0x2f0f62=_0x47ecfb[_0xa100('0x21')];var _0x1cf4b8=_0x24815f?0x0:_0x1f527c[_0xa100('0x1e')];var _0x38a67b=_0x24815f?_0x47ecfb[_0xa100('0x21')]:_0x1f527c[_0xa100('0x1e')]+_0x1f527c[_0xa100('0x20')];var _0x5151ef;if(_0x38a67b>=_0x2f0f62){_0x38a67b=_0x2f0f62;_0x5151ef=0xc8;}else{_0x5151ef=0xce;}_0x61bdd0[_0xa100('0x1c')](_0x5151ef);return _0x61bdd0[_0xa100('0x22')](_0xa100('0x23'),_0x1cf4b8+'-'+_0x38a67b+'/'+_0x2f0f62)[_0xa100('0x1d')](_0x47ecfb);}return null;};}function patchUpdates(_0x1061d6){return function(_0x5dd189){try{jsonpatch[_0xa100('0x24')](_0x5dd189,_0x1061d6,!![]);}catch(_0x179c73){return BPromise[_0xa100('0x25')](_0x179c73);}return _0x5dd189[_0xa100('0x26')]();};}function saveUpdates(_0x197da9,_0x5d514c){return function(_0xda36b8){if(_0xda36b8){return _0xda36b8[_0xa100('0x27')](_0x197da9)[_0xa100('0x28')](function(_0xc6f37e){return _0xc6f37e;});}return null;};}function removeEntity(_0x385580,_0xc41ed0){return function(_0x44252f){if(_0x44252f){return _0x44252f['destroy']()[_0xa100('0x28')](function(){_0x385580['status'](0xcc)[_0xa100('0x1b')]();});}};}function handleEntityNotFound(_0x580831,_0x3ed0dc){return function(_0x55190e){if(!_0x55190e){_0x580831['sendStatus'](0x194);}return _0x55190e;};}function handleError(_0x3361f9,_0xd837ea){_0xd837ea=_0xd837ea||0x1f4;return function(_0x5c454b){logger[_0xa100('0x29')](_0x5c454b[_0xa100('0x2a')]);if(_0x5c454b['name']){delete _0x5c454b[_0xa100('0x2b')];}_0x3361f9[_0xa100('0x1c')](_0xd837ea)[_0xa100('0x2c')](_0x5c454b);};}exports[_0xa100('0x2d')]=function(_0x429400,_0x52016a){var _0xe00279={},_0x1b4735={},_0x121843={'count':0x0,'rows':[]};var _0x4b3188=_[_0xa100('0x2e')](db[_0xa100('0x2f')][_0xa100('0x30')],function(_0x2c94b2){return{'name':_0x2c94b2[_0xa100('0x31')],'type':_0x2c94b2[_0xa100('0x32')]['key']};});_0x1b4735['model']=_[_0xa100('0x2e')](_0x4b3188,_0xa100('0x2b'));_0x1b4735[_0xa100('0x33')]=_[_0xa100('0x34')](_0x429400[_0xa100('0x33')]);_0x1b4735[_0xa100('0x35')]=_[_0xa100('0x36')](_0x1b4735['model'],_0x1b4735[_0xa100('0x33')]);_0xe00279[_0xa100('0x37')]=_[_0xa100('0x36')](_0x1b4735[_0xa100('0x38')],qs[_0xa100('0x39')](_0x429400['query'][_0xa100('0x39')]));_0xe00279[_0xa100('0x37')]=_0xe00279[_0xa100('0x37')]['length']?_0xe00279[_0xa100('0x37')]:_0x1b4735['model'];if(!_0x429400[_0xa100('0x33')]['hasOwnProperty'](_0xa100('0x3a'))){_0xe00279['limit']=qs['limit'](_0x429400[_0xa100('0x33')][_0xa100('0x20')]);_0xe00279['offset']=qs[_0xa100('0x1e')](_0x429400[_0xa100('0x33')][_0xa100('0x1e')]);}_0xe00279[_0xa100('0x3b')]=qs[_0xa100('0x3c')](_0x429400[_0xa100('0x33')][_0xa100('0x3c')]);_0xe00279[_0xa100('0x3d')]=qs[_0xa100('0x35')](_[_0xa100('0x3e')](_0x429400['query'],_0x1b4735['filters']),_0x4b3188);if(_0x429400[_0xa100('0x33')]['filter']){_0xe00279[_0xa100('0x3d')]=_[_0xa100('0x3f')](_0xe00279[_0xa100('0x3d')],{'$or':_[_0xa100('0x2e')](_0x4b3188,function(_0x1545af){if(_0x1545af['type']!=='VIRTUAL'){var _0x65d99a={};_0x65d99a[_0x1545af[_0xa100('0x2b')]]={'$like':'%'+_0x429400[_0xa100('0x33')]['filter']+'%'};return _0x65d99a;}})});}_0xe00279=_[_0xa100('0x3f')]({},_0xe00279,_0x429400[_0xa100('0x40')]);var _0x19dcd2={'where':_0xe00279['where']};return db[_0xa100('0x2f')][_0xa100('0x21')](_0x19dcd2)[_0xa100('0x28')](function(_0x22f338){_0x121843[_0xa100('0x21')]=_0x22f338;if(_0x429400[_0xa100('0x33')][_0xa100('0x41')]){_0xe00279[_0xa100('0x42')]=[{'all':!![]}];}return db[_0xa100('0x2f')]['findAll'](_0xe00279);})['then'](function(_0x368b12){_0x121843[_0xa100('0x43')]=_0x368b12;return _0x121843;})['then'](respondWithFilteredResult(_0x52016a,_0xe00279))[_0xa100('0x44')](handleError(_0x52016a,null));};exports[_0xa100('0x45')]=function(_0x47b99b,_0xda0764){var _0x351d24={'raw':![],'where':{'id':_0x47b99b['params']['id']}},_0x5097d3={};_0x5097d3['model']=_['keys'](db[_0xa100('0x2f')]['rawAttributes']);_0x5097d3[_0xa100('0x33')]=_[_0xa100('0x34')](_0x47b99b[_0xa100('0x33')]);_0x5097d3[_0xa100('0x35')]=_['intersection'](_0x5097d3[_0xa100('0x38')],_0x5097d3[_0xa100('0x33')]);_0x351d24[_0xa100('0x37')]=_['intersection'](_0x5097d3[_0xa100('0x38')],qs[_0xa100('0x39')](_0x47b99b[_0xa100('0x33')][_0xa100('0x39')]));_0x351d24[_0xa100('0x37')]=_0x351d24['attributes'][_0xa100('0x46')]?_0x351d24[_0xa100('0x37')]:_0x5097d3[_0xa100('0x38')];if(_0x47b99b[_0xa100('0x33')][_0xa100('0x41')]){_0x351d24[_0xa100('0x42')]=[{'all':!![]}];}_0x351d24=_[_0xa100('0x3f')]({},_0x351d24,_0x47b99b['options']);return db['UserProfileSection']['find'](_0x351d24)[_0xa100('0x28')](handleEntityNotFound(_0xda0764,null))[_0xa100('0x28')](respondWithResult(_0xda0764,null))[_0xa100('0x44')](handleError(_0xda0764,null));};exports[_0xa100('0x47')]=function(_0x397e44,_0x149a2e){return db[_0xa100('0x2f')][_0xa100('0x47')](_0x397e44[_0xa100('0x48')],{})[_0xa100('0x28')](respondWithResult(_0x149a2e,0xc9))[_0xa100('0x44')](handleError(_0x149a2e,null));};exports[_0xa100('0x27')]=function(_0x51f6dd,_0x22a467){if(_0x51f6dd[_0xa100('0x48')]['id']){delete _0x51f6dd['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x51f6dd[_0xa100('0x49')]['id']}})[_0xa100('0x28')](handleEntityNotFound(_0x22a467,null))[_0xa100('0x28')](saveUpdates(_0x51f6dd['body'],null))['then'](respondWithResult(_0x22a467,null))['catch'](handleError(_0x22a467,null));};exports['destroy']=function(_0x19e009,_0x5e949f){return db[_0xa100('0x2f')][_0xa100('0x4a')]({'where':{'id':_0x19e009['params']['id']}})[_0xa100('0x28')](handleEntityNotFound(_0x5e949f,null))[_0xa100('0x28')](removeEntity(_0x5e949f,null))[_0xa100('0x44')](handleError(_0x5e949f,null));};exports[_0xa100('0x4b')]=function(_0x1a6d8d,_0x3329fb){return db[_0xa100('0x2f')]['describe']()['then'](respondWithResult(_0x3329fb,null))['catch'](handleError(_0x3329fb,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 260ea0e..0311016 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 _0x45f1=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId'];(function(_0x37d422,_0x4e0dc7){var _0x1efad4=function(_0x20ada9){while(--_0x20ada9){_0x37d422['push'](_0x37d422['shift']());}};_0x1efad4(++_0x4e0dc7);}(_0x45f1,0x1d1));var _0x145f=function(_0x247fd3,_0x1d3e29){_0x247fd3=_0x247fd3-0x0;var _0xf0fa0e=_0x45f1[_0x247fd3];return _0xf0fa0e;};'use strict';var _=require(_0x145f('0x0'));var util=require(_0x145f('0x1'));var logger=require(_0x145f('0x2'))(_0x145f('0x3'));var moment=require(_0x145f('0x4'));var BPromise=require(_0x145f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x145f('0x6'));var rimraf=require(_0x145f('0x7'));var config=require(_0x145f('0x8'));var attributes=require(_0x145f('0x9'));module[_0x145f('0xa')]=function(_0x3c4783,_0x25d390){return _0x3c4783[_0x145f('0xb')](_0x145f('0xc'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x145f('0xd'),'fields':[_0x145f('0xe'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b19=['bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','lodash','../../config/logger','api'];(function(_0x4d8f88,_0x535b00){var _0x99c796=function(_0x2001b7){while(--_0x2001b7){_0x4d8f88['push'](_0x4d8f88['shift']());}};_0x99c796(++_0x535b00);}(_0x6b19,0xf4));var _0x96b1=function(_0x3bb996,_0x1fbe79){_0x3bb996=_0x3bb996-0x0;var _0x10bc1c=_0x6b19[_0x3bb996];return _0x10bc1c;};'use strict';var _=require(_0x96b1('0x0'));var util=require('util');var logger=require(_0x96b1('0x1'))(_0x96b1('0x2'));var moment=require('moment');var BPromise=require(_0x96b1('0x3'));var rp=require(_0x96b1('0x4'));var fs=require('fs');var path=require(_0x96b1('0x5'));var rimraf=require(_0x96b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x96b1('0x7'));module[_0x96b1('0x8')]=function(_0x4c6d60,_0x5e55b7){return _0x4c6d60[_0x96b1('0x9')](_0x96b1('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x96b1('0xb'),'fields':[_0x96b1('0xc'),'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 e23e4a1..d19f23a 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 _0xbc6b=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0xbc6b,0x14b));var _0xbbc6=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xbc6b[_0x489b87];return _0x1823b6;};'use strict';var _=require(_0xbbc6('0x0'));var util=require(_0xbbc6('0x1'));var moment=require(_0xbbc6('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbc6('0x3'));var fs=require('fs');var Redis=require(_0xbbc6('0x4'));var db=require(_0xbbc6('0x5'))['db'];var utils=require(_0xbbc6('0x6'));var logger=require('../../config/logger')(_0xbbc6('0x7'));var config=require(_0xbbc6('0x8'));var jayson=require(_0xbbc6('0x9'));var client=jayson[_0xbbc6('0xa')][_0xbbc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bf6ef,_0x5b915c,_0x474003){return new BPromise(function(_0x229910,_0x2485bc){return client[_0xbbc6('0xc')](_0x5bf6ef,_0x474003)[_0xbbc6('0xd')](function(_0x56a325){logger['info'](_0xbbc6('0xe'),_0x5b915c,_0xbbc6('0xf'));logger[_0xbbc6('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x5b915c,_0xbbc6('0xf'),JSON[_0xbbc6('0x11')](_0x56a325));if(_0x56a325[_0xbbc6('0x12')]){if(_0x56a325[_0xbbc6('0x12')][_0xbbc6('0x13')]===0x1f4){logger[_0xbbc6('0x12')](_0xbbc6('0xe'),_0x5b915c,_0x56a325[_0xbbc6('0x12')][_0xbbc6('0x14')]);return _0x2485bc(_0x56a325[_0xbbc6('0x12')][_0xbbc6('0x14')]);}logger[_0xbbc6('0x12')](_0xbbc6('0xe'),_0x5b915c,_0x56a325[_0xbbc6('0x12')][_0xbbc6('0x14')]);return _0x229910(_0x56a325[_0xbbc6('0x12')][_0xbbc6('0x14')]);}else{logger['info'](_0xbbc6('0xe'),_0x5b915c,_0xbbc6('0xf'));_0x229910(_0x56a325['result'][_0xbbc6('0x14')]);}})[_0xbbc6('0x15')](function(_0x487b26){logger[_0xbbc6('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5b915c,_0x487b26);_0x2485bc(_0x487b26);});});} \ No newline at end of file +var _0x0842=['info','UserProfileSection,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4bbee2,_0x23b07f){var _0x330051=function(_0xcbc479){while(--_0xcbc479){_0x4bbee2['push'](_0x4bbee2['shift']());}};_0x330051(++_0x23b07f);}(_0x0842,0xeb));var _0x2084=function(_0x25700a,_0x2c5dd4){_0x25700a=_0x25700a-0x0;var _0x23639a=_0x0842[_0x25700a];return _0x23639a;};'use strict';var _=require(_0x2084('0x0'));var util=require('util');var moment=require(_0x2084('0x1'));var BPromise=require(_0x2084('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2084('0x3'))['db'];var utils=require(_0x2084('0x4'));var logger=require(_0x2084('0x5'))('rpc');var config=require(_0x2084('0x6'));var jayson=require(_0x2084('0x7'));var client=jayson[_0x2084('0x8')][_0x2084('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7bfe05,_0x444bd3,_0x1d79f5){return new BPromise(function(_0x10045a,_0x1d5aaa){return client[_0x2084('0xa')](_0x7bfe05,_0x1d79f5)[_0x2084('0xb')](function(_0x25663f){logger[_0x2084('0xc')](_0x2084('0xd'),_0x444bd3,_0x2084('0xe'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x444bd3,_0x2084('0xe'),JSON['stringify'](_0x25663f));if(_0x25663f['error']){if(_0x25663f[_0x2084('0xf')][_0x2084('0x10')]===0x1f4){logger[_0x2084('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x444bd3,_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);return _0x1d5aaa(_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);}logger[_0x2084('0xf')](_0x2084('0xd'),_0x444bd3,_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);return _0x10045a(_0x25663f[_0x2084('0xf')][_0x2084('0x11')]);}else{logger[_0x2084('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x444bd3,_0x2084('0xe'));_0x10045a(_0x25663f[_0x2084('0x12')]['message']);}})['catch'](function(_0x570cc9){logger['error'](_0x2084('0xd'),_0x444bd3,_0x570cc9);_0x1d5aaa(_0x570cc9);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 755313f..0493d54 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x9f9904,_0x30393b){var _0x4a8427=function(_0x372c7e){while(--_0x372c7e){_0x9f9904['push'](_0x9f9904['shift']());}};_0x4a8427(++_0x30393b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x243217,_0x522951){_0x243217=_0x243217-0x0;var _0x478029=_0xcb91[_0x243217];return _0x478029;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xf97ab0,_0xf989eb){var _0x5bd077=function(_0x3e5653){while(--_0x3e5653){_0xf97ab0['push'](_0xf97ab0['shift']());}};_0x5bd077(++_0xf989eb);}(_0xe706,0xa3));var _0x6e70=function(_0x1446fc,_0x13d287){_0x1446fc=_0x1446fc-0x0;var _0x184ce1=_0xe706[_0x1446fc];return _0x184ce1;};'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 c82930d..8899ba0 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 _0x68f5=['sequelize','exports','INTEGER'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x68f5,0x11a));var _0x568f=function(_0x547e20,_0x284545){_0x547e20=_0x547e20-0x0;var _0x359171=_0x68f5[_0x547e20];return _0x359171;};'use strict';var Sequelize=require(_0x568f('0x0'));module[_0x568f('0x1')]={'penalty':{'type':Sequelize[_0x568f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x02e2=['sequelize'];(function(_0x5b8608,_0x527731){var _0x3f8d3d=function(_0x131b70){while(--_0x131b70){_0x5b8608['push'](_0x5b8608['shift']());}};_0x3f8d3d(++_0x527731);}(_0x02e2,0x155));var _0x202e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x02e2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x202e('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index b406fae..7c6a512 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(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x90ec,0x1d4));var _0xc90e=function(_0x5be52f,_0x24a872){_0x5be52f=_0x5be52f-0x0;var _0x529c08=_0x90ec[_0x5be52f];return _0x529c08;};'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 _0x4ccb=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x3dc328,_0x242926){var _0xd3135d=function(_0x2e82dd){while(--_0x2e82dd){_0x3dc328['push'](_0x3dc328['shift']());}};_0xd3135d(++_0x242926);}(_0x4ccb,0x196));var _0xb4cc=function(_0x24c375,_0x3c8ae6){_0x24c375=_0x24c375-0x0;var _0x37a06d=_0x4ccb[_0x24c375];return _0x37a06d;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 3942fe3..f4fe0b8 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 _0x14d8=['catch','UserSmsQueue,\x20%s,\x20%s','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1ec2b2,_0x1ff530){var _0x2a6db4=function(_0x45bdb8){while(--_0x45bdb8){_0x1ec2b2['push'](_0x1ec2b2['shift']());}};_0x2a6db4(++_0x1ff530);}(_0x14d8,0xaa));var _0x814d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x14d8[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x814d('0x0'));var util=require(_0x814d('0x1'));var moment=require('moment');var BPromise=require(_0x814d('0x2'));var rs=require(_0x814d('0x3'));var fs=require('fs');var Redis=require(_0x814d('0x4'));var db=require(_0x814d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x814d('0x6'))(_0x814d('0x7'));var config=require('../../config/environment');var jayson=require(_0x814d('0x8'));var client=jayson[_0x814d('0x9')][_0x814d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ec42f,_0x50909a,_0x1999a6){return new BPromise(function(_0x45a984,_0x1fb9af){return client[_0x814d('0xb')](_0x2ec42f,_0x1999a6)[_0x814d('0xc')](function(_0x442df8){logger[_0x814d('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x50909a,_0x814d('0xe'));logger[_0x814d('0xf')](_0x814d('0x10'),_0x50909a,'request\x20sent',JSON[_0x814d('0x11')](_0x442df8));if(_0x442df8[_0x814d('0x12')]){if(_0x442df8[_0x814d('0x12')][_0x814d('0x13')]===0x1f4){logger[_0x814d('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x50909a,_0x442df8[_0x814d('0x12')][_0x814d('0x14')]);return _0x1fb9af(_0x442df8['error'][_0x814d('0x14')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x50909a,_0x442df8[_0x814d('0x12')][_0x814d('0x14')]);return _0x45a984(_0x442df8[_0x814d('0x12')][_0x814d('0x14')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x50909a,_0x814d('0xe'));_0x45a984(_0x442df8[_0x814d('0x15')][_0x814d('0x14')]);}})[_0x814d('0x16')](function(_0xb9e6fc){logger[_0x814d('0x12')](_0x814d('0x17'),_0x50909a,_0xb9e6fc);_0x1fb9af(_0xb9e6fc);});});} \ No newline at end of file +var _0x70d9=['client','http','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5624ad,_0x44c3f7){var _0x542602=function(_0x2cb7fb){while(--_0x2cb7fb){_0x5624ad['push'](_0x5624ad['shift']());}};_0x542602(++_0x44c3f7);}(_0x70d9,0xfc));var _0x970d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x70d9[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x970d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x970d('0x1'));var fs=require('fs');var Redis=require(_0x970d('0x2'));var db=require(_0x970d('0x3'))['db'];var utils=require(_0x970d('0x4'));var logger=require(_0x970d('0x5'))(_0x970d('0x6'));var config=require(_0x970d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x970d('0x8')][_0x970d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3febf3,_0x4ba94a,_0x550097){return new BPromise(function(_0x4cdedf,_0x50658a){return client['request'](_0x3febf3,_0x550097)[_0x970d('0xa')](function(_0x32685a){logger[_0x970d('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x4ba94a,_0x970d('0xc'));logger['debug'](_0x970d('0xd'),_0x4ba94a,_0x970d('0xc'),JSON['stringify'](_0x32685a));if(_0x32685a[_0x970d('0xe')]){if(_0x32685a[_0x970d('0xe')][_0x970d('0xf')]===0x1f4){logger[_0x970d('0xe')](_0x970d('0x10'),_0x4ba94a,_0x32685a[_0x970d('0xe')][_0x970d('0x11')]);return _0x50658a(_0x32685a[_0x970d('0xe')][_0x970d('0x11')]);}logger[_0x970d('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x4ba94a,_0x32685a[_0x970d('0xe')][_0x970d('0x11')]);return _0x4cdedf(_0x32685a['error'][_0x970d('0x11')]);}else{logger['info'](_0x970d('0x10'),_0x4ba94a,_0x970d('0xc'));_0x4cdedf(_0x32685a[_0x970d('0x12')][_0x970d('0x11')]);}})[_0x970d('0x13')](function(_0x32cd90){logger[_0x970d('0xe')](_0x970d('0x10'),_0x4ba94a,_0x32cd90);_0x50658a(_0x32cd90);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index bd630ad..da84f94 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 _0xfdf5=['exports','INTEGER','sequelize'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfdf5,0xf2));var _0x5fdf=function(_0x5ae2bd,_0x37c17a){_0x5ae2bd=_0x5ae2bd-0x0;var _0xd3aabe=_0xfdf5[_0x5ae2bd];return _0xd3aabe;};'use strict';var Sequelize=require(_0x5fdf('0x0'));module[_0x5fdf('0x1')]={'UserId':{'type':Sequelize[_0x5fdf('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5fdf('0x2')]}}; \ No newline at end of file +var _0x9f6f=['exports','INTEGER','sequelize'];(function(_0x4391e0,_0x5170bb){var _0x388986=function(_0x67f020){while(--_0x67f020){_0x4391e0['push'](_0x4391e0['shift']());}};_0x388986(++_0x5170bb);}(_0x9f6f,0x137));var _0xf9f6=function(_0x350408,_0x5b5948){_0x350408=_0x350408-0x0;var _0x243444=_0x9f6f[_0x350408];return _0x243444;};'use strict';var Sequelize=require(_0xf9f6('0x0'));module[_0xf9f6('0x1')]={'UserId':{'type':Sequelize[_0xf9f6('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index e2c605f..20f6048 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(_0x10fece,_0x733687){var _0x91d8bd=function(_0x1f40b2){while(--_0x1f40b2){_0x10fece['push'](_0x10fece['shift']());}};_0x91d8bd(++_0x733687);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x2dfee7,_0x4979b3){var _0xdeeb0c=function(_0x18cfff){while(--_0x18cfff){_0x2dfee7['push'](_0x2dfee7['shift']());}};_0xdeeb0c(++_0x4979b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 1bb1567..2622ed4 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x44261f,_0x431a91){var _0x29eba3=function(_0x33a546){while(--_0x33a546){_0x44261f['push'](_0x44261f['shift']());}};_0x29eba3(++_0x431a91);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x22b5d2,_0x255b74){var _0x1ddf08=function(_0xb8e1ac){while(--_0xb8e1ac){_0x22b5d2['push'](_0x22b5d2['shift']());}};_0x1ddf08(++_0x255b74);}(_0xe706,0xa3));var _0x6e70=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xe706[_0x22663b];return _0x310d0a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 654dd63..60d9a8a 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 _0xa0d8=['INTEGER','sequelize','exports'];(function(_0x27ea1a,_0x595064){var _0x280967=function(_0x52bdd6){while(--_0x52bdd6){_0x27ea1a['push'](_0x27ea1a['shift']());}};_0x280967(++_0x595064);}(_0xa0d8,0x1c6));var _0x8a0d=function(_0x35c04e,_0x5339d7){_0x35c04e=_0x35c04e-0x0;var _0x2885ba=_0xa0d8[_0x35c04e];return _0x2885ba;};'use strict';var Sequelize=require(_0x8a0d('0x0'));module[_0x8a0d('0x1')]={'penalty':{'type':Sequelize[_0x8a0d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x160d=['exports','sequelize'];(function(_0x5cf3a8,_0x4455db){var _0x1ecdcb=function(_0x3efdee){while(--_0x3efdee){_0x5cf3a8['push'](_0x5cf3a8['shift']());}};_0x1ecdcb(++_0x4455db);}(_0x160d,0x16f));var _0xd160=function(_0x41ac22,_0x46c1a9){_0x41ac22=_0x41ac22-0x0;var _0x337267=_0x160d[_0x41ac22];return _0x337267;};'use strict';var Sequelize=require(_0xd160('0x0'));module[_0xd160('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 4b15727..2515d04 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 _0xe83b=['define','UserVoiceQueue','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','exports'];(function(_0x4d5c76,_0xf84619){var _0x570569=function(_0x2e9e03){while(--_0x2e9e03){_0x4d5c76['push'](_0x4d5c76['shift']());}};_0x570569(++_0xf84619);}(_0xe83b,0xf2));var _0xbe83=function(_0xe89347,_0x4590e1){_0xe89347=_0xe89347-0x0;var _0x372533=_0xe83b[_0xe89347];return _0x372533;};'use strict';var _=require(_0xbe83('0x0'));var util=require(_0xbe83('0x1'));var logger=require('../../config/logger')(_0xbe83('0x2'));var moment=require(_0xbe83('0x3'));var BPromise=require(_0xbe83('0x4'));var rp=require(_0xbe83('0x5'));var fs=require('fs');var path=require(_0xbe83('0x6'));var rimraf=require('rimraf');var config=require(_0xbe83('0x7'));var attributes=require(_0xbe83('0x8'));module[_0xbe83('0x9')]=function(_0x1a549a,_0x539b30){return _0x1a549a[_0xbe83('0xa')](_0xbe83('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95bc=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x574097,_0x1f2194){var _0x1e0e4a=function(_0x1f408f){while(--_0x1f408f){_0x574097['push'](_0x574097['shift']());}};_0x1e0e4a(++_0x1f2194);}(_0x95bc,0x19e));var _0xc95b=function(_0x43c151,_0x1a5ac1){_0x43c151=_0x43c151-0x0;var _0x8213e3=_0x95bc[_0x43c151];return _0x8213e3;};'use strict';var _=require(_0xc95b('0x0'));var util=require(_0xc95b('0x1'));var logger=require('../../config/logger')(_0xc95b('0x2'));var moment=require('moment');var BPromise=require(_0xc95b('0x3'));var rp=require(_0xc95b('0x4'));var fs=require('fs');var path=require(_0xc95b('0x5'));var rimraf=require(_0xc95b('0x6'));var config=require(_0xc95b('0x7'));var attributes=require(_0xc95b('0x8'));module[_0xc95b('0x9')]=function(_0x59d615,_0x183676){return _0x59d615['define'](_0xc95b('0xa'),attributes,{'tableName':_0xc95b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index c4cd998..40fbd69 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 _0x0c69=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0c69,0x161));var _0x90c6=function(_0x13c43d,_0x59f052){_0x13c43d=_0x13c43d-0x0;var _0xb07df8=_0x0c69[_0x13c43d];return _0xb07df8;};'use strict';var _=require(_0x90c6('0x0'));var util=require(_0x90c6('0x1'));var moment=require(_0x90c6('0x2'));var BPromise=require(_0x90c6('0x3'));var rs=require(_0x90c6('0x4'));var fs=require('fs');var Redis=require(_0x90c6('0x5'));var db=require(_0x90c6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x90c6('0x7'))(_0x90c6('0x8'));var config=require('../../config/environment');var jayson=require(_0x90c6('0x9'));var client=jayson[_0x90c6('0xa')][_0x90c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2626b4,_0x366e48,_0x2acd39){return new BPromise(function(_0x3ccbe3,_0x37ff84){return client[_0x90c6('0xc')](_0x2626b4,_0x2acd39)['then'](function(_0x33e4f1){logger[_0x90c6('0xd')](_0x90c6('0xe'),_0x366e48,'request\x20sent');logger[_0x90c6('0xf')](_0x90c6('0x10'),_0x366e48,_0x90c6('0x11'),JSON[_0x90c6('0x12')](_0x33e4f1));if(_0x33e4f1[_0x90c6('0x13')]){if(_0x33e4f1['error'][_0x90c6('0x14')]===0x1f4){logger[_0x90c6('0x13')](_0x90c6('0xe'),_0x366e48,_0x33e4f1['error'][_0x90c6('0x15')]);return _0x37ff84(_0x33e4f1[_0x90c6('0x13')][_0x90c6('0x15')]);}logger[_0x90c6('0x13')](_0x90c6('0xe'),_0x366e48,_0x33e4f1['error']['message']);return _0x3ccbe3(_0x33e4f1[_0x90c6('0x13')][_0x90c6('0x15')]);}else{logger[_0x90c6('0xd')](_0x90c6('0xe'),_0x366e48,_0x90c6('0x11'));_0x3ccbe3(_0x33e4f1['result']['message']);}})['catch'](function(_0x1cca71){logger[_0x90c6('0x13')](_0x90c6('0xe'),_0x366e48,_0x1cca71);_0x37ff84(_0x1cca71);});});} \ No newline at end of file +var _0x8b31=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x5bdab7,_0x2f0eb6){var _0x1d3b5b=function(_0x27afb3){while(--_0x27afb3){_0x5bdab7['push'](_0x5bdab7['shift']());}};_0x1d3b5b(++_0x2f0eb6);}(_0x8b31,0x129));var _0x18b3=function(_0x2e1391,_0xe54900){_0x2e1391=_0x2e1391-0x0;var _0xab79db=_0x8b31[_0x2e1391];return _0xab79db;};'use strict';var _=require('lodash');var util=require(_0x18b3('0x0'));var moment=require(_0x18b3('0x1'));var BPromise=require(_0x18b3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x18b3('0x4'));var logger=require(_0x18b3('0x5'))(_0x18b3('0x6'));var config=require(_0x18b3('0x7'));var jayson=require(_0x18b3('0x8'));var client=jayson[_0x18b3('0x9')][_0x18b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444f0c,_0x30f0db,_0x4736a1){return new BPromise(function(_0x54f9b5,_0x476a5e){return client[_0x18b3('0xb')](_0x444f0c,_0x4736a1)[_0x18b3('0xc')](function(_0x2f6e90){logger['info'](_0x18b3('0xd'),_0x30f0db,'request\x20sent');logger[_0x18b3('0xe')](_0x18b3('0xf'),_0x30f0db,_0x18b3('0x10'),JSON[_0x18b3('0x11')](_0x2f6e90));if(_0x2f6e90[_0x18b3('0x12')]){if(_0x2f6e90[_0x18b3('0x12')][_0x18b3('0x13')]===0x1f4){logger[_0x18b3('0x12')](_0x18b3('0xd'),_0x30f0db,_0x2f6e90['error']['message']);return _0x476a5e(_0x2f6e90['error'][_0x18b3('0x14')]);}logger[_0x18b3('0x12')](_0x18b3('0xd'),_0x30f0db,_0x2f6e90[_0x18b3('0x12')][_0x18b3('0x14')]);return _0x54f9b5(_0x2f6e90[_0x18b3('0x12')][_0x18b3('0x14')]);}else{logger[_0x18b3('0x15')](_0x18b3('0xd'),_0x30f0db,'request\x20sent');_0x54f9b5(_0x2f6e90[_0x18b3('0x16')][_0x18b3('0x14')]);}})[_0x18b3('0x17')](function(_0x25dbe4){logger[_0x18b3('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x30f0db,_0x25dbe4);_0x476a5e(_0x25dbe4);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 38cfff7..42530c8 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e43f5,_0x44bf53){var _0x47161b=function(_0x3bd6ba){while(--_0x3bd6ba){_0x3e43f5['push'](_0x3e43f5['shift']());}};_0x47161b(++_0x44bf53);}(_0xe706,0xa3));var _0x6e70=function(_0x1415ef,_0x5c219e){_0x1415ef=_0x1415ef-0x0;var _0x234acc=_0xe706[_0x1415ef];return _0x234acc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x449938,_0x396dae){var _0x1f8ce2=function(_0x3d1a8c){while(--_0x3d1a8c){_0x449938['push'](_0x449938['shift']());}};_0x1f8ce2(++_0x396dae);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xcb91[_0x79b649];return _0x1af9b1;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index dc8e2a5..f2d4972 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 _0x533c=['Required\x20by\x20Asterisk','INTEGER','queue_interface','exports','STRING'];(function(_0x40d999,_0x4401cb){var _0x4ad398=function(_0x20692f){while(--_0x20692f){_0x40d999['push'](_0x40d999['shift']());}};_0x4ad398(++_0x4401cb);}(_0x533c,0x125));var _0xc533=function(_0x5ecdd5,_0x2fcdd4){_0x5ecdd5=_0x5ecdd5-0x0;var _0x1f777b=_0x533c[_0x5ecdd5];return _0x1f777b;};'use strict';var Sequelize=require('sequelize');module[_0xc533('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xc533('0x1')],'allowNull':![],'comment':_0xc533('0x2')},'UserId':{'type':Sequelize[_0xc533('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc533('0x1')],'allowNull':![],'unique':'queue_interface','comment':_0xc533('0x2')},'VoiceQueueId':{'type':Sequelize[_0xc533('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc533('0x4'),'comment':_0xc533('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xc533('0x2')},'paused':{'type':Sequelize[_0xc533('0x3')](0xb),'defaultValue':0x0,'comment':_0xc533('0x2')}}; \ No newline at end of file +var _0x2e09=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x2e09,0xc8));var _0x92e0=function(_0x3d7134,_0x96e720){_0x3d7134=_0x3d7134-0x0;var _0x19422b=_0x2e09[_0x3d7134];return _0x19422b;};'use strict';var Sequelize=require(_0x92e0('0x0'));module[_0x92e0('0x1')]={'uniqueid':{'type':Sequelize[_0x92e0('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x92e0('0x3')},'membername':{'type':Sequelize[_0x92e0('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x92e0('0x4')],'allowNull':![],'unique':_0x92e0('0x5'),'comment':_0x92e0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x92e0('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x92e0('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x92e0('0x2')](0xb),'defaultValue':0x0,'comment':_0x92e0('0x3')},'paused':{'type':Sequelize[_0x92e0('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 4372229..ad4537d 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 _0xaa03=['remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xaa03,0xaf));var _0x3aa0=function(_0x15e143,_0xece6ce){_0x15e143=_0x15e143-0x0;var _0x1e6ab3=_0xaa03[_0x15e143];return _0x1e6ab3;};'use strict';var EventEmitter=require(_0x3aa0('0x0'));var UserVoiceQueueRt=require(_0x3aa0('0x1'))['db'][_0x3aa0('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3aa0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3aa0('0x4'),'afterDestroy':_0x3aa0('0x5')};function emitEvent(_0x2d8cdf){return function(_0x814f2c,_0xc15594,_0x1b5551){UserVoiceQueueRtEvents[_0x3aa0('0x6')](_0x2d8cdf+':'+_0x814f2c['id'],_0x814f2c);UserVoiceQueueRtEvents[_0x3aa0('0x6')](_0x2d8cdf,_0x814f2c);_0x1b5551(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3aa0('0x7')](e,emitEvent(event));}}module[_0x3aa0('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x7034=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt'];(function(_0x524516,_0x820c3a){var _0x236654=function(_0x6126cd){while(--_0x6126cd){_0x524516['push'](_0x524516['shift']());}};_0x236654(++_0x820c3a);}(_0x7034,0x1be));var _0x4703=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x7034[_0x2e4aa2];return _0x5e6092;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x4703('0x0'))['db'][_0x4703('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4703('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4703('0x3'),'afterDestroy':_0x4703('0x4')};function emitEvent(_0xe964e5){return function(_0xa23e17,_0x96ae4c,_0x39642f){UserVoiceQueueRtEvents[_0x4703('0x5')](_0xe964e5+':'+_0xa23e17['id'],_0xa23e17);UserVoiceQueueRtEvents[_0x4703('0x5')](_0xe964e5,_0xa23e17);_0x39642f(null);};}for(var e in events){if(events[_0x4703('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4703('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 7d36b5c..d1056fa 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 _0x72a0=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x72a0,0x19d));var _0x072a=function(_0x5b7fef,_0x3e7801){_0x5b7fef=_0x5b7fef-0x0;var _0x1629e0=_0x72a0[_0x5b7fef];return _0x1629e0;};'use strict';var _=require(_0x072a('0x0'));var util=require('util');var logger=require(_0x072a('0x1'))(_0x072a('0x2'));var moment=require(_0x072a('0x3'));var BPromise=require(_0x072a('0x4'));var rp=require(_0x072a('0x5'));var fs=require('fs');var path=require(_0x072a('0x6'));var rimraf=require('rimraf');var config=require(_0x072a('0x7'));var attributes=require(_0x072a('0x8'));module[_0x072a('0x9')]=function(_0x430498,_0x412a95){return _0x430498[_0x072a('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x072a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x766a=['../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x766a,0x116));var _0xa766=function(_0x9db5d3,_0x4eea5e){_0x9db5d3=_0x9db5d3-0x0;var _0x477a81=_0x766a[_0x9db5d3];return _0x477a81;};'use strict';var _=require(_0xa766('0x0'));var util=require(_0xa766('0x1'));var logger=require(_0xa766('0x2'))(_0xa766('0x3'));var moment=require(_0xa766('0x4'));var BPromise=require(_0xa766('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa766('0x6'));var rimraf=require(_0xa766('0x7'));var config=require(_0xa766('0x8'));var attributes=require(_0xa766('0x9'));module[_0xa766('0xa')]=function(_0x59eb4a,_0xc14a80){return _0x59eb4a['define'](_0xa766('0xb'),attributes,{'tableName':_0xa766('0xc'),'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 ae62016..b2fe5ce 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 _0xef6b=['moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','raw','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util'];(function(_0x1f0416,_0x59126a){var _0xf882b4=function(_0x400515){while(--_0x400515){_0x1f0416['push'](_0x1f0416['shift']());}};_0xf882b4(++_0x59126a);}(_0xef6b,0x8a));var _0xbef6=function(_0xadd448,_0x457a3b){_0xadd448=_0xadd448-0x0;var _0x186c75=_0xef6b[_0xadd448];return _0x186c75;};'use strict';var _=require(_0xbef6('0x0'));var util=require(_0xbef6('0x1'));var moment=require(_0xbef6('0x2'));var BPromise=require(_0xbef6('0x3'));var rs=require(_0xbef6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbef6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbef6('0x6'));var config=require(_0xbef6('0x7'));var jayson=require(_0xbef6('0x8'));var client=jayson[_0xbef6('0x9')][_0xbef6('0xa')]({'port':0x232a});config[_0xbef6('0xb')]=_[_0xbef6('0xc')](config[_0xbef6('0xb')],{'host':_0xbef6('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbef6('0xb')]));require(_0xbef6('0xe'))[_0xbef6('0xf')](socket);function respondWithRpcPromise(_0x5d1126,_0x25f172,_0x59cfb3){return new BPromise(function(_0x34f02a,_0x3fa21a){return client[_0xbef6('0x10')](_0x5d1126,_0x59cfb3)[_0xbef6('0x11')](function(_0x2c6207){logger[_0xbef6('0x12')](_0xbef6('0x13'),_0x25f172,_0xbef6('0x14'));logger[_0xbef6('0x15')](_0xbef6('0x16'),_0x25f172,'request\x20sent',JSON['stringify'](_0x2c6207));if(_0x2c6207['error']){if(_0x2c6207[_0xbef6('0x17')][_0xbef6('0x18')]===0x1f4){logger[_0xbef6('0x17')](_0xbef6('0x13'),_0x25f172,_0x2c6207[_0xbef6('0x17')]['message']);return _0x3fa21a(_0x2c6207[_0xbef6('0x17')][_0xbef6('0x19')]);}logger[_0xbef6('0x17')](_0xbef6('0x13'),_0x25f172,_0x2c6207['error']['message']);return _0x34f02a(_0x2c6207[_0xbef6('0x17')][_0xbef6('0x19')]);}else{logger[_0xbef6('0x12')](_0xbef6('0x13'),_0x25f172,_0xbef6('0x14'));_0x34f02a(_0x2c6207[_0xbef6('0x1a')][_0xbef6('0x19')]);}})[_0xbef6('0x1b')](function(_0x5f1aff){logger[_0xbef6('0x17')](_0xbef6('0x13'),_0x25f172,_0x5f1aff);_0x3fa21a(_0x5f1aff);});});}exports[_0xbef6('0x1c')]=function(_0x21cef4){var _0x4841f8=this;return new Promise(function(_0xdf78d6,_0x90e6b5){return db[_0xbef6('0x1d')]['findAll']({'raw':_0x21cef4['options']?_0x21cef4['options'][_0xbef6('0x1e')]===undefined?!![]:![]:!![],'where':_0x21cef4['options']?_0x21cef4['options']['where']||null:null,'attributes':[[db[_0xbef6('0x1f')]['fn']('COUNT',db[_0xbef6('0x1f')]['fn']('IF',db[_0xbef6('0x1f')]['literal'](_0xbef6('0x20')))),_0xbef6('0x21')]]})['then'](function(_0x25ed8b){logger[_0xbef6('0x12')](_0xbef6('0x1c'),_0x21cef4);logger['debug']('GetVoiceQueueRtPauses',_0x21cef4,JSON[_0xbef6('0x22')](_0x25ed8b));_0xdf78d6(_0x25ed8b);})[_0xbef6('0x1b')](function(_0x238c9a){logger[_0xbef6('0x17')](_0xbef6('0x1c'),_0x238c9a[_0xbef6('0x19')],_0x21cef4);_0x90e6b5(_0x4841f8['error'](0x1f4,_0x238c9a['message']));});});}; \ No newline at end of file +var _0x5cb1=['localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults'];(function(_0x338499,_0x316c5c){var _0x90491d=function(_0x403387){while(--_0x403387){_0x338499['push'](_0x338499['shift']());}};_0x90491d(++_0x316c5c);}(_0x5cb1,0x1ed));var _0x15cb=function(_0x43ee7e,_0x78e09b){_0x43ee7e=_0x43ee7e-0x0;var _0x22d326=_0x5cb1[_0x43ee7e];return _0x22d326;};'use strict';var _=require(_0x15cb('0x0'));var util=require(_0x15cb('0x1'));var moment=require(_0x15cb('0x2'));var BPromise=require(_0x15cb('0x3'));var rs=require(_0x15cb('0x4'));var fs=require('fs');var Redis=require(_0x15cb('0x5'));var db=require(_0x15cb('0x6'))['db'];var utils=require(_0x15cb('0x7'));var logger=require(_0x15cb('0x8'))(_0x15cb('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15cb('0xa')][_0x15cb('0xb')]({'port':0x232a});config[_0x15cb('0xc')]=_[_0x15cb('0xd')](config[_0x15cb('0xc')],{'host':_0x15cb('0xe'),'port':0x18eb});var socket=require(_0x15cb('0xf'))(new Redis(config[_0x15cb('0xc')]));require(_0x15cb('0x10'))[_0x15cb('0x11')](socket);function respondWithRpcPromise(_0x475f95,_0x4b3dc7,_0x462207){return new BPromise(function(_0x445c8b,_0x326960){return client[_0x15cb('0x12')](_0x475f95,_0x462207)[_0x15cb('0x13')](function(_0xf45883){logger['info'](_0x15cb('0x14'),_0x4b3dc7,_0x15cb('0x15'));logger[_0x15cb('0x16')](_0x15cb('0x17'),_0x4b3dc7,_0x15cb('0x15'),JSON[_0x15cb('0x18')](_0xf45883));if(_0xf45883[_0x15cb('0x19')]){if(_0xf45883[_0x15cb('0x19')][_0x15cb('0x1a')]===0x1f4){logger[_0x15cb('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b3dc7,_0xf45883[_0x15cb('0x19')]['message']);return _0x326960(_0xf45883[_0x15cb('0x19')]['message']);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b3dc7,_0xf45883[_0x15cb('0x19')][_0x15cb('0x1b')]);return _0x445c8b(_0xf45883[_0x15cb('0x19')]['message']);}else{logger[_0x15cb('0x1c')](_0x15cb('0x14'),_0x4b3dc7,_0x15cb('0x15'));_0x445c8b(_0xf45883[_0x15cb('0x1d')][_0x15cb('0x1b')]);}})[_0x15cb('0x1e')](function(_0x359adc){logger[_0x15cb('0x19')](_0x15cb('0x14'),_0x4b3dc7,_0x359adc);_0x326960(_0x359adc);});});}exports['GetVoiceQueueRtPauses']=function(_0x2b18e4){var _0x5a3be2=this;return new Promise(function(_0x3f8d8f,_0x2c5fda){return db['UserVoiceQueueRt'][_0x15cb('0x1f')]({'raw':_0x2b18e4['options']?_0x2b18e4[_0x15cb('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2b18e4[_0x15cb('0x20')]?_0x2b18e4[_0x15cb('0x20')][_0x15cb('0x21')]||null:null,'attributes':[[db[_0x15cb('0x22')]['fn']('COUNT',db[_0x15cb('0x22')]['fn']('IF',db[_0x15cb('0x22')][_0x15cb('0x23')](_0x15cb('0x24')))),_0x15cb('0x25')]]})['then'](function(_0x1e8797){logger[_0x15cb('0x1c')](_0x15cb('0x26'),_0x2b18e4);logger[_0x15cb('0x16')](_0x15cb('0x26'),_0x2b18e4,JSON[_0x15cb('0x18')](_0x1e8797));_0x3f8d8f(_0x1e8797);})[_0x15cb('0x1e')](function(_0x5d6ee3){logger['error'](_0x15cb('0x26'),_0x5d6ee3[_0x15cb('0x1b')],_0x2b18e4);_0x2c5fda(_0x5a3be2['error'](0x1f4,_0x5d6ee3[_0x15cb('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 2bb1ead..1de2899 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 _0xbe3b=['remove','emit','removeListener','register','length','userVoiceQueueRt:','save'];(function(_0x2530fa,_0x4242bd){var _0x103ba8=function(_0x124930){while(--_0x124930){_0x2530fa['push'](_0x2530fa['shift']());}};_0x103ba8(++_0x4242bd);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x4c6c9f,_0x25c8a9){_0x4c6c9f=_0x4c6c9f-0x0;var _0x31e332=_0xbe3b[_0x4c6c9f];return _0x31e332;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xbbe3('0x0'),_0xbbe3('0x1'),'update'];function createListener(_0x364f65,_0x5b26bc){return function(_0x5bfd65){_0x5b26bc[_0xbbe3('0x2')](_0x364f65,_0x5bfd65);};}function removeListener(_0x497180,_0x5d74ec){return function(){UserVoiceQueueRtEvents[_0xbbe3('0x3')](_0x497180,_0x5d74ec);};}exports[_0xbbe3('0x4')]=function(_0x257eb0){for(var _0x331557=0x0,_0x4c6976=events[_0xbbe3('0x5')];_0x331557<_0x4c6976;_0x331557++){var _0x748756=events[_0x331557];var _0x40199b=createListener(_0xbbe3('0x6')+_0x748756,_0x257eb0);UserVoiceQueueRtEvents['on'](_0x748756,_0x40199b);}}; \ No newline at end of file +var _0xc9b9=['remove','update','length'];(function(_0x70f4ee,_0x44afc1){var _0x2387fa=function(_0x4fd7c3){while(--_0x4fd7c3){_0x70f4ee['push'](_0x70f4ee['shift']());}};_0x2387fa(++_0x44afc1);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xc9b9[_0x503cd5];return _0x1fdf1e;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x9c9b('0x0'),_0x9c9b('0x1')];function createListener(_0x3418ab,_0x4e2e8d){return function(_0x5ee8f8){_0x4e2e8d['emit'](_0x3418ab,_0x5ee8f8);};}function removeListener(_0x497d53,_0x38a64b){return function(){UserVoiceQueueRtEvents['removeListener'](_0x497d53,_0x38a64b);};}exports['register']=function(_0x51abae){for(var _0x1f29f3=0x0,_0x15d94b=events[_0x9c9b('0x2')];_0x1f29f3<_0x15d94b;_0x1f29f3++){var _0x193305=events[_0x1f29f3];var _0xbbd998=createListener('userVoiceQueueRt:'+_0x193305,_0x51abae);UserVoiceQueueRtEvents['on'](_0x193305,_0xbbd998);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index df539bc..142337e 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x685fe,_0x66084a){var _0x44e00c=function(_0x591b1b){while(--_0x591b1b){_0x685fe['push'](_0x685fe['shift']());}};_0x44e00c(++_0x66084a);}(_0x70e0,0x17b));var _0x070e=function(_0x4e773e,_0x55bd47){_0x4e773e=_0x4e773e-0x0;var _0x2d205a=_0x70e0[_0x4e773e];return _0x2d205a;};'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(_0x313868,_0x3310f1){var _0x51ea1c=function(_0x170fcf){while(--_0x170fcf){_0x313868['push'](_0x313868['shift']());}};_0x51ea1c(++_0x3310f1);}(_0xe706,0xa3));var _0x6e70=function(_0xfcc0e,_0x1da886){_0xfcc0e=_0xfcc0e-0x0;var _0x32bb2e=_0xe706[_0xfcc0e];return _0x32bb2e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index e75ebb6..7e4c765 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 _0x88ac=['sequelize'];(function(_0x3b6be8,_0xed83d0){var _0x5851a6=function(_0x5a14d1){while(--_0x5a14d1){_0x3b6be8['push'](_0x3b6be8['shift']());}};_0x5851a6(++_0xed83d0);}(_0x88ac,0x12d));var _0xc88a=function(_0x2de56a,_0x2a0373){_0x2de56a=_0x2de56a-0x0;var _0x39cfab=_0x88ac[_0x2de56a];return _0x39cfab;};'use strict';var Sequelize=require(_0xc88a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x015d=['sequelize'];(function(_0x3976ea,_0x2abd4b){var _0x1725de=function(_0x8c95cf){while(--_0x8c95cf){_0x3976ea['push'](_0x3976ea['shift']());}};_0x1725de(++_0x2abd4b);}(_0x015d,0x78));var _0xd015=function(_0x59616b,_0x38e534){_0x59616b=_0x59616b-0x0;var _0x5c4523=_0x015d[_0x59616b];return _0x5c4523;};'use strict';var Sequelize=require(_0xd015('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 24b233f..9e9469f 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 _0xed61=['bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x986da1,_0x46d6ce){var _0x2133bd=function(_0x3e5c59){while(--_0x3e5c59){_0x986da1['push'](_0x986da1['shift']());}};_0x2133bd(++_0x46d6ce);}(_0xed61,0xcd));var _0x1ed6=function(_0x5d6725,_0x3f6ef9){_0x5d6725=_0x5d6725-0x0;var _0x275399=_0xed61[_0x5d6725];return _0x275399;};'use strict';var _=require(_0x1ed6('0x0'));var util=require(_0x1ed6('0x1'));var logger=require(_0x1ed6('0x2'))(_0x1ed6('0x3'));var moment=require(_0x1ed6('0x4'));var BPromise=require(_0x1ed6('0x5'));var rp=require(_0x1ed6('0x6'));var fs=require('fs');var path=require(_0x1ed6('0x7'));var rimraf=require(_0x1ed6('0x8'));var config=require(_0x1ed6('0x9'));var attributes=require(_0x1ed6('0xa'));module[_0x1ed6('0xb')]=function(_0x184080,_0x4a13e8){return _0x184080[_0x1ed6('0xc')](_0x1ed6('0xd'),attributes,{'tableName':_0x1ed6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d57=['user_has_whatsapp_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x4d57,0xe8));var _0x74d5=function(_0x4867e3,_0x419a6b){_0x4867e3=_0x4867e3-0x0;var _0x32f0fd=_0x4d57[_0x4867e3];return _0x32f0fd;};'use strict';var _=require('lodash');var util=require(_0x74d5('0x0'));var logger=require(_0x74d5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x74d5('0x2'));var rp=require(_0x74d5('0x3'));var fs=require('fs');var path=require(_0x74d5('0x4'));var rimraf=require(_0x74d5('0x5'));var config=require('../../config/environment');var attributes=require(_0x74d5('0x6'));module[_0x74d5('0x7')]=function(_0x5c6a85,_0x24ed92){return _0x5c6a85[_0x74d5('0x8')](_0x74d5('0x9'),attributes,{'tableName':_0x74d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 41cbc65..d9c01e0 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 _0xb311=['client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xcfeefd,_0x31c304){var _0x2845c3=function(_0x1ad9ed){while(--_0x1ad9ed){_0xcfeefd['push'](_0xcfeefd['shift']());}};_0x2845c3(++_0x31c304);}(_0xb311,0x147));var _0x1b31=function(_0x2dff18,_0x444de9){_0x2dff18=_0x2dff18-0x0;var _0x25904d=_0xb311[_0x2dff18];return _0x25904d;};'use strict';var _=require(_0x1b31('0x0'));var util=require(_0x1b31('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b31('0x2'));var db=require(_0x1b31('0x3'))['db'];var utils=require(_0x1b31('0x4'));var logger=require(_0x1b31('0x5'))(_0x1b31('0x6'));var config=require(_0x1b31('0x7'));var jayson=require(_0x1b31('0x8'));var client=jayson[_0x1b31('0x9')][_0x1b31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d1ae,_0x387e7d,_0x19d286){return new BPromise(function(_0x2db2e4,_0x463c68){return client[_0x1b31('0xb')](_0x48d1ae,_0x19d286)[_0x1b31('0xc')](function(_0x39b25d){logger[_0x1b31('0xd')](_0x1b31('0xe'),_0x387e7d,_0x1b31('0xf'));logger[_0x1b31('0x10')](_0x1b31('0x11'),_0x387e7d,_0x1b31('0xf'),JSON[_0x1b31('0x12')](_0x39b25d));if(_0x39b25d[_0x1b31('0x13')]){if(_0x39b25d[_0x1b31('0x13')][_0x1b31('0x14')]===0x1f4){logger[_0x1b31('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x387e7d,_0x39b25d[_0x1b31('0x13')][_0x1b31('0x15')]);return _0x463c68(_0x39b25d[_0x1b31('0x13')][_0x1b31('0x15')]);}logger[_0x1b31('0x13')](_0x1b31('0xe'),_0x387e7d,_0x39b25d[_0x1b31('0x13')][_0x1b31('0x15')]);return _0x2db2e4(_0x39b25d[_0x1b31('0x13')][_0x1b31('0x15')]);}else{logger[_0x1b31('0xd')](_0x1b31('0xe'),_0x387e7d,'request\x20sent');_0x2db2e4(_0x39b25d[_0x1b31('0x16')][_0x1b31('0x15')]);}})[_0x1b31('0x17')](function(_0x974f10){logger[_0x1b31('0x13')](_0x1b31('0xe'),_0x387e7d,_0x974f10);_0x463c68(_0x974f10);});});} \ No newline at end of file +var _0xbe02=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0xf65715,_0x5ddf59){var _0x10d168=function(_0x3d19e1){while(--_0x3d19e1){_0xf65715['push'](_0xf65715['shift']());}};_0x10d168(++_0x5ddf59);}(_0xbe02,0xdb));var _0x2be0=function(_0x2292d9,_0x3398c9){_0x2292d9=_0x2292d9-0x0;var _0x103edc=_0xbe02[_0x2292d9];return _0x103edc;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var moment=require(_0x2be0('0x2'));var BPromise=require(_0x2be0('0x3'));var rs=require(_0x2be0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be0('0x5'))['db'];var utils=require(_0x2be0('0x6'));var logger=require(_0x2be0('0x7'))(_0x2be0('0x8'));var config=require(_0x2be0('0x9'));var jayson=require(_0x2be0('0xa'));var client=jayson['client'][_0x2be0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d77f9,_0x1a03fa,_0x1dc5b7){return new BPromise(function(_0x6e1c86,_0x1ee684){return client[_0x2be0('0xc')](_0x1d77f9,_0x1dc5b7)['then'](function(_0x5f0b4c){logger['info'](_0x2be0('0xd'),_0x1a03fa,'request\x20sent');logger[_0x2be0('0xe')](_0x2be0('0xf'),_0x1a03fa,_0x2be0('0x10'),JSON[_0x2be0('0x11')](_0x5f0b4c));if(_0x5f0b4c['error']){if(_0x5f0b4c['error'][_0x2be0('0x12')]===0x1f4){logger[_0x2be0('0x13')](_0x2be0('0xd'),_0x1a03fa,_0x5f0b4c['error'][_0x2be0('0x14')]);return _0x1ee684(_0x5f0b4c['error']['message']);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x1a03fa,_0x5f0b4c['error'][_0x2be0('0x14')]);return _0x6e1c86(_0x5f0b4c[_0x2be0('0x13')][_0x2be0('0x14')]);}else{logger[_0x2be0('0x15')](_0x2be0('0xd'),_0x1a03fa,_0x2be0('0x10'));_0x6e1c86(_0x5f0b4c[_0x2be0('0x16')][_0x2be0('0x14')]);}})[_0x2be0('0x17')](function(_0x2d9754){logger[_0x2be0('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1a03fa,_0x2d9754);_0x1ee684(_0x2d9754);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 772d96b..419cdfe 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 _0x871e=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','put','delete','destroy','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x871e,0x1b0));var _0xe871=function(_0x2a1899,_0x5a9c64){_0x2a1899=_0x2a1899-0x0;var _0x594109=_0x871e[_0x2a1899];return _0x594109;};'use strict';var multer=require(_0xe871('0x0'));var util=require('util');var path=require(_0xe871('0x1'));var timeout=require(_0xe871('0x2'));var express=require(_0xe871('0x3'));var router=express[_0xe871('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe871('0x5'));var interaction=require(_0xe871('0x6'));var config=require(_0xe871('0x7'));var controller=require(_0xe871('0x8'));router[_0xe871('0x9')]('/',auth[_0xe871('0xa')](),controller[_0xe871('0xb')]);router[_0xe871('0x9')](_0xe871('0xc'),auth[_0xe871('0xa')](),controller['show']);router[_0xe871('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe871('0xe')](_0xe871('0xc'),auth[_0xe871('0xa')](),controller['update']);router[_0xe871('0xf')](_0xe871('0xc'),auth[_0xe871('0xa')](),controller[_0xe871('0x10')]);module[_0xe871('0x11')]=router; \ No newline at end of file +var _0xb647=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util'];(function(_0x2dbe37,_0xf018cf){var _0x73a2bc=function(_0x35db31){while(--_0x35db31){_0x2dbe37['push'](_0x2dbe37['shift']());}};_0x73a2bc(++_0xf018cf);}(_0xb647,0xdb));var _0x7b64=function(_0x5da1f0,_0x262a6d){_0x5da1f0=_0x5da1f0-0x0;var _0x37d646=_0xb647[_0x5da1f0];return _0x37d646;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./variable.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0xe')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0xf')]('/:id',auth[_0x7b64('0xa')](),controller['update']);router['delete'](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller['destroy']);module[_0x7b64('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1488bd4..730af9a 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 _0x7d6a=['STRING','name','sequelize','exports'];(function(_0x2da357,_0x1f9b2f){var _0x138fdd=function(_0xe3077d){while(--_0xe3077d){_0x2da357['push'](_0x2da357['shift']());}};_0x138fdd(++_0x1f9b2f);}(_0x7d6a,0xf6));var _0xa7d6=function(_0x379665,_0x478c13){_0x379665=_0x379665-0x0;var _0x11691a=_0x7d6a[_0x379665];return _0x11691a;};'use strict';var Sequelize=require(_0xa7d6('0x0'));module[_0xa7d6('0x1')]={'name':{'type':Sequelize[_0xa7d6('0x2')],'unique':_0xa7d6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa7d6('0x2')]}}; \ No newline at end of file +var _0x80d0=['STRING','name','sequelize'];(function(_0x33b656,_0x5ecb2c){var _0x2e6687=function(_0x3d364b){while(--_0x3d364b){_0x33b656['push'](_0x33b656['shift']());}};_0x2e6687(++_0x5ecb2c);}(_0x80d0,0x1b5));var _0x080d=function(_0x54a8b8,_0x1358af){_0x54a8b8=_0x54a8b8-0x0;var _0x577ed1=_0x80d0[_0x54a8b8];return _0x577ed1;};'use strict';var Sequelize=require(_0x080d('0x0'));module['exports']={'name':{'type':Sequelize[_0x080d('0x1')],'unique':_0x080d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x080d('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 76d7afd..81cdc74 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 _0xcf73=['status','end','offset','undefined','count','limit','apply','reject','save','destroy','then','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x51352f,_0x3f8caa){var _0x21db5c=function(_0x255700){while(--_0x255700){_0x51352f['push'](_0x51352f['shift']());}};_0x21db5c(++_0x3f8caa);}(_0xcf73,0xd1));var _0x3cf7=function(_0x29abfc,_0x1317da){_0x29abfc=_0x29abfc-0x0;var _0x4e94cf=_0xcf73[_0x29abfc];return _0x4e94cf;};'use strict';var emlformat=require(_0x3cf7('0x0'));var rimraf=require(_0x3cf7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3cf7('0x2'));var moment=require(_0x3cf7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3cf7('0x4'));var util=require(_0x3cf7('0x5'));var path=require('path');var sox=require(_0x3cf7('0x6'));var csv=require('to-csv');var ejs=require(_0x3cf7('0x7'));var fs=require('fs');var fs_extra=require(_0x3cf7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3cf7('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3cf7('0xa'));var querystring=require(_0x3cf7('0xb'));var Papa=require(_0x3cf7('0xc'));var Redis=require('ioredis');var authService=require(_0x3cf7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3cf7('0xe'));var hardwareService=require(_0x3cf7('0xf'));var logger=require(_0x3cf7('0x10'))(_0x3cf7('0x11'));var utils=require(_0x3cf7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3cf7('0x13'));var db=require(_0x3cf7('0x14'))['db'];function respondWithStatusCode(_0x106732,_0x38c689){_0x38c689=_0x38c689||0xcc;return function(_0x151eea){if(_0x151eea){return _0x106732[_0x3cf7('0x15')](_0x38c689);}return _0x106732[_0x3cf7('0x16')](_0x38c689)[_0x3cf7('0x17')]();};}function respondWithResult(_0x1b7b2c,_0x54a769){_0x54a769=_0x54a769||0xc8;return function(_0x8e1462){if(_0x8e1462){return _0x1b7b2c[_0x3cf7('0x16')](_0x54a769)['json'](_0x8e1462);}};}function respondWithFilteredResult(_0x5c68c4,_0x3b4d18){return function(_0x107a89){if(_0x107a89){var _0x1e846f=typeof _0x3b4d18[_0x3cf7('0x18')]===_0x3cf7('0x19')&&typeof _0x3b4d18['limit']===_0x3cf7('0x19');var _0x265258=_0x107a89[_0x3cf7('0x1a')];var _0x36168d=_0x1e846f?0x0:_0x3b4d18['offset'];var _0x569c26=_0x1e846f?_0x107a89[_0x3cf7('0x1a')]:_0x3b4d18[_0x3cf7('0x18')]+_0x3b4d18[_0x3cf7('0x1b')];var _0x30d790;if(_0x569c26>=_0x265258){_0x569c26=_0x265258;_0x30d790=0xc8;}else{_0x30d790=0xce;}_0x5c68c4[_0x3cf7('0x16')](_0x30d790);return _0x5c68c4['set']('Content-Range',_0x36168d+'-'+_0x569c26+'/'+_0x265258)['json'](_0x107a89);}return null;};}function patchUpdates(_0x33a75f){return function(_0x47bdc8){try{jsonpatch[_0x3cf7('0x1c')](_0x47bdc8,_0x33a75f,!![]);}catch(_0x168fca){return BPromise[_0x3cf7('0x1d')](_0x168fca);}return _0x47bdc8[_0x3cf7('0x1e')]();};}function saveUpdates(_0x47b240,_0x216527){return function(_0x3acd63){if(_0x3acd63){return _0x3acd63['update'](_0x47b240)['then'](function(_0x12be7c){return _0x12be7c;});}return null;};}function removeEntity(_0x35ba0d,_0x49a198){return function(_0x5e6159){if(_0x5e6159){return _0x5e6159[_0x3cf7('0x1f')]()[_0x3cf7('0x20')](function(){var _0x51965d=_0x5e6159['get']({'plain':!![]});var _0x244199=_0x3cf7('0x21');return db[_0x3cf7('0x22')]['destroy']({'where':{'type':_0x244199,'resourceId':_0x51965d['id']}})[_0x3cf7('0x20')](function(){return _0x5e6159;});})[_0x3cf7('0x20')](function(){_0x35ba0d[_0x3cf7('0x16')](0xcc)[_0x3cf7('0x17')]();});}};}function handleEntityNotFound(_0x2d21ab,_0x3b8363){return function(_0x577c31){if(!_0x577c31){_0x2d21ab[_0x3cf7('0x15')](0x194);}return _0x577c31;};}function handleError(_0x39e134,_0x22ad60){_0x22ad60=_0x22ad60||0x1f4;return function(_0x4afdc8){logger[_0x3cf7('0x23')](_0x4afdc8[_0x3cf7('0x24')]);if(_0x4afdc8[_0x3cf7('0x25')]){delete _0x4afdc8['name'];}_0x39e134[_0x3cf7('0x16')](_0x22ad60)[_0x3cf7('0x26')](_0x4afdc8);};}exports[_0x3cf7('0x27')]=function(_0x51ebfa,_0x50e00e){var _0x3d3156={},_0x2409ea={},_0x299bbf={'count':0x0,'rows':[]};var _0x261c53=_[_0x3cf7('0x28')](db[_0x3cf7('0x29')][_0x3cf7('0x2a')],function(_0x2caf47){return{'name':_0x2caf47[_0x3cf7('0x2b')],'type':_0x2caf47[_0x3cf7('0x2c')]['key']};});_0x2409ea['model']=_[_0x3cf7('0x28')](_0x261c53,_0x3cf7('0x25'));_0x2409ea[_0x3cf7('0x2d')]=_[_0x3cf7('0x2e')](_0x51ebfa[_0x3cf7('0x2d')]);_0x2409ea['filters']=_[_0x3cf7('0x2f')](_0x2409ea[_0x3cf7('0x30')],_0x2409ea[_0x3cf7('0x2d')]);_0x3d3156[_0x3cf7('0x31')]=_[_0x3cf7('0x2f')](_0x2409ea[_0x3cf7('0x30')],qs[_0x3cf7('0x32')](_0x51ebfa['query'][_0x3cf7('0x32')]));_0x3d3156['attributes']=_0x3d3156[_0x3cf7('0x31')][_0x3cf7('0x33')]?_0x3d3156[_0x3cf7('0x31')]:_0x2409ea['model'];if(!_0x51ebfa[_0x3cf7('0x2d')][_0x3cf7('0x34')]('nolimit')){_0x3d3156[_0x3cf7('0x1b')]=qs[_0x3cf7('0x1b')](_0x51ebfa[_0x3cf7('0x2d')][_0x3cf7('0x1b')]);_0x3d3156['offset']=qs[_0x3cf7('0x18')](_0x51ebfa[_0x3cf7('0x2d')]['offset']);}_0x3d3156[_0x3cf7('0x35')]=qs[_0x3cf7('0x36')](_0x51ebfa[_0x3cf7('0x2d')][_0x3cf7('0x36')]);_0x3d3156[_0x3cf7('0x37')]=qs['filters'](_[_0x3cf7('0x38')](_0x51ebfa[_0x3cf7('0x2d')],_0x2409ea[_0x3cf7('0x39')]),_0x261c53);if(_0x51ebfa['query'][_0x3cf7('0x3a')]){_0x3d3156['where']=_['merge'](_0x3d3156[_0x3cf7('0x37')],{'$or':_[_0x3cf7('0x28')](_0x261c53,function(_0xd707bd){if(_0xd707bd['type']!==_0x3cf7('0x3b')){var _0x2f81bf={};_0x2f81bf[_0xd707bd[_0x3cf7('0x25')]]={'$like':'%'+_0x51ebfa[_0x3cf7('0x2d')][_0x3cf7('0x3a')]+'%'};return _0x2f81bf;}})});}_0x3d3156=_[_0x3cf7('0x3c')]({},_0x3d3156,_0x51ebfa[_0x3cf7('0x3d')]);var _0x8b564={'where':_0x3d3156['where']};return db[_0x3cf7('0x29')][_0x3cf7('0x1a')](_0x8b564)[_0x3cf7('0x20')](function(_0x5e1871){_0x299bbf[_0x3cf7('0x1a')]=_0x5e1871;if(_0x51ebfa['query'][_0x3cf7('0x3e')]){_0x3d3156[_0x3cf7('0x3f')]=[{'all':!![]}];}return db[_0x3cf7('0x29')][_0x3cf7('0x40')](_0x3d3156);})[_0x3cf7('0x20')](function(_0x142dd2){_0x299bbf['rows']=_0x142dd2;return _0x299bbf;})[_0x3cf7('0x20')](respondWithFilteredResult(_0x50e00e,_0x3d3156))[_0x3cf7('0x41')](handleError(_0x50e00e,null));};exports[_0x3cf7('0x42')]=function(_0x1defac,_0x18e39a){var _0x512382={'raw':!![],'where':{'id':_0x1defac[_0x3cf7('0x43')]['id']}},_0x5840b4={};_0x5840b4['model']=_[_0x3cf7('0x2e')](db[_0x3cf7('0x29')][_0x3cf7('0x2a')]);_0x5840b4[_0x3cf7('0x2d')]=_['keys'](_0x1defac[_0x3cf7('0x2d')]);_0x5840b4[_0x3cf7('0x39')]=_[_0x3cf7('0x2f')](_0x5840b4[_0x3cf7('0x30')],_0x5840b4[_0x3cf7('0x2d')]);_0x512382[_0x3cf7('0x31')]=_[_0x3cf7('0x2f')](_0x5840b4[_0x3cf7('0x30')],qs[_0x3cf7('0x32')](_0x1defac[_0x3cf7('0x2d')][_0x3cf7('0x32')]));_0x512382['attributes']=_0x512382['attributes'][_0x3cf7('0x33')]?_0x512382[_0x3cf7('0x31')]:_0x5840b4[_0x3cf7('0x30')];if(_0x1defac[_0x3cf7('0x2d')][_0x3cf7('0x3e')]){_0x512382['include']=[{'all':!![]}];}_0x512382=_[_0x3cf7('0x3c')]({},_0x512382,_0x1defac[_0x3cf7('0x3d')]);return db[_0x3cf7('0x29')][_0x3cf7('0x44')](_0x512382)['then'](handleEntityNotFound(_0x18e39a,null))['then'](respondWithResult(_0x18e39a,null))[_0x3cf7('0x41')](handleError(_0x18e39a,null));};exports[_0x3cf7('0x45')]=function(_0x55146b,_0x4f2695){return db[_0x3cf7('0x29')][_0x3cf7('0x45')](_0x55146b[_0x3cf7('0x46')],{})[_0x3cf7('0x20')](function(_0x477afd){var _0x34415c=_0x55146b[_0x3cf7('0x47')]['get']({'plain':!![]});if(!_0x34415c)throw new Error(_0x3cf7('0x48'));if(_0x34415c[_0x3cf7('0x49')]===_0x3cf7('0x47')){var _0x32b919=_0x477afd['get']({'plain':!![]});var _0x14b546='Variables';return db[_0x3cf7('0x4a')][_0x3cf7('0x44')]({'where':{'name':_0x14b546,'userProfileId':_0x34415c[_0x3cf7('0x4b')]},'raw':!![]})[_0x3cf7('0x20')](function(_0x470c7b){if(_0x470c7b&&_0x470c7b['autoAssociation']===0x0){return db['UserProfileResource'][_0x3cf7('0x45')]({'name':_0x32b919[_0x3cf7('0x25')],'resourceId':_0x32b919['id'],'type':_0x470c7b[_0x3cf7('0x25')],'sectionId':_0x470c7b['id']},{})[_0x3cf7('0x20')](function(){return _0x477afd;});}else{return _0x477afd;}})[_0x3cf7('0x41')](function(_0x2ce6f9){logger[_0x3cf7('0x23')](_0x3cf7('0x4c'),_0x2ce6f9);throw _0x2ce6f9;});}return _0x477afd;})[_0x3cf7('0x20')](respondWithResult(_0x4f2695,0xc9))[_0x3cf7('0x41')](handleError(_0x4f2695,null));};exports['update']=function(_0x287b2f,_0x37dc7d){if(_0x287b2f[_0x3cf7('0x46')]['id']){delete _0x287b2f[_0x3cf7('0x46')]['id'];}return db[_0x3cf7('0x29')][_0x3cf7('0x44')]({'where':{'id':_0x287b2f[_0x3cf7('0x43')]['id']}})[_0x3cf7('0x20')](handleEntityNotFound(_0x37dc7d,null))['then'](saveUpdates(_0x287b2f[_0x3cf7('0x46')],null))[_0x3cf7('0x20')](respondWithResult(_0x37dc7d,null))[_0x3cf7('0x41')](handleError(_0x37dc7d,null));};exports['destroy']=function(_0x3b5c4b,_0x29cd9b){return db['Variable']['find']({'where':{'id':_0x3b5c4b[_0x3cf7('0x43')]['id']}})[_0x3cf7('0x20')](handleEntityNotFound(_0x29cd9b,null))['then'](removeEntity(_0x29cd9b,null))[_0x3cf7('0x41')](handleError(_0x29cd9b,null));}; \ No newline at end of file +var _0x966e=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','stack','name','send','index','Variable','rawAttributes','fieldName','model','map','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','length'];(function(_0x270fe8,_0x5505a9){var _0x2b28e2=function(_0x52aa7f){while(--_0x52aa7f){_0x270fe8['push'](_0x270fe8['shift']());}};_0x2b28e2(++_0x5505a9);}(_0x966e,0x1af));var _0xe966=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x966e[_0x136619];return _0x38c4a5;};'use strict';var emlformat=require(_0xe966('0x0'));var rimraf=require(_0xe966('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe966('0x2'));var rp=require('request-promise');var moment=require(_0xe966('0x3'));var BPromise=require(_0xe966('0x4'));var Mustache=require('mustache');var util=require(_0xe966('0x5'));var path=require(_0xe966('0x6'));var sox=require(_0xe966('0x7'));var csv=require(_0xe966('0x8'));var ejs=require(_0xe966('0x9'));var fs=require('fs');var fs_extra=require(_0xe966('0xa'));var _=require(_0xe966('0xb'));var squel=require('squel');var crypto=require(_0xe966('0xc'));var jsforce=require(_0xe966('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe966('0x8'));var querystring=require('querystring');var Papa=require(_0xe966('0xe'));var Redis=require(_0xe966('0xf'));var authService=require(_0xe966('0x10'));var qs=require(_0xe966('0x11'));var as=require(_0xe966('0x12'));var hardwareService=require(_0xe966('0x13'));var logger=require('../../config/logger')(_0xe966('0x14'));var utils=require(_0xe966('0x15'));var config=require(_0xe966('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe966('0x17'))['db'];function respondWithStatusCode(_0x484fb4,_0x1ab37c){_0x1ab37c=_0x1ab37c||0xcc;return function(_0x7ea9d9){if(_0x7ea9d9){return _0x484fb4[_0xe966('0x18')](_0x1ab37c);}return _0x484fb4[_0xe966('0x19')](_0x1ab37c)[_0xe966('0x1a')]();};}function respondWithResult(_0x36e6c7,_0x5bce43){_0x5bce43=_0x5bce43||0xc8;return function(_0x1dd59c){if(_0x1dd59c){return _0x36e6c7['status'](_0x5bce43)[_0xe966('0x1b')](_0x1dd59c);}};}function respondWithFilteredResult(_0x46421a,_0x1b42f1){return function(_0x1a836b){if(_0x1a836b){var _0x33c603=typeof _0x1b42f1['offset']===_0xe966('0x1c')&&typeof _0x1b42f1[_0xe966('0x1d')]==='undefined';var _0xba523f=_0x1a836b[_0xe966('0x1e')];var _0x1434cb=_0x33c603?0x0:_0x1b42f1[_0xe966('0x1f')];var _0x10c6f1=_0x33c603?_0x1a836b[_0xe966('0x1e')]:_0x1b42f1[_0xe966('0x1f')]+_0x1b42f1['limit'];var _0x456e07;if(_0x10c6f1>=_0xba523f){_0x10c6f1=_0xba523f;_0x456e07=0xc8;}else{_0x456e07=0xce;}_0x46421a[_0xe966('0x19')](_0x456e07);return _0x46421a['set'](_0xe966('0x20'),_0x1434cb+'-'+_0x10c6f1+'/'+_0xba523f)[_0xe966('0x1b')](_0x1a836b);}return null;};}function patchUpdates(_0x30f9bb){return function(_0x5de752){try{jsonpatch[_0xe966('0x21')](_0x5de752,_0x30f9bb,!![]);}catch(_0x21c587){return BPromise['reject'](_0x21c587);}return _0x5de752[_0xe966('0x22')]();};}function saveUpdates(_0x58f614,_0x3839f3){return function(_0x28f219){if(_0x28f219){return _0x28f219[_0xe966('0x23')](_0x58f614)[_0xe966('0x24')](function(_0x5ac7ae){return _0x5ac7ae;});}return null;};}function removeEntity(_0x1a5f7a,_0xa7e7ef){return function(_0xd3cfe6){if(_0xd3cfe6){return _0xd3cfe6[_0xe966('0x25')]()['then'](function(){var _0x5cf943=_0xd3cfe6[_0xe966('0x26')]({'plain':!![]});var _0x521180=_0xe966('0x27');return db[_0xe966('0x28')][_0xe966('0x25')]({'where':{'type':_0x521180,'resourceId':_0x5cf943['id']}})[_0xe966('0x24')](function(){return _0xd3cfe6;});})[_0xe966('0x24')](function(){_0x1a5f7a[_0xe966('0x19')](0xcc)[_0xe966('0x1a')]();});}};}function handleEntityNotFound(_0x220c07,_0x53dff9){return function(_0x268dcd){if(!_0x268dcd){_0x220c07[_0xe966('0x18')](0x194);}return _0x268dcd;};}function handleError(_0x449b67,_0x357cd1){_0x357cd1=_0x357cd1||0x1f4;return function(_0x3c3974){logger['error'](_0x3c3974[_0xe966('0x29')]);if(_0x3c3974[_0xe966('0x2a')]){delete _0x3c3974['name'];}_0x449b67[_0xe966('0x19')](_0x357cd1)[_0xe966('0x2b')](_0x3c3974);};}exports[_0xe966('0x2c')]=function(_0x4a0f31,_0x2edc73){var _0x15b709={},_0x345ba2={},_0x3b74fe={'count':0x0,'rows':[]};var _0x179a34=_['map'](db[_0xe966('0x2d')][_0xe966('0x2e')],function(_0x43580e){return{'name':_0x43580e[_0xe966('0x2f')],'type':_0x43580e['type']['key']};});_0x345ba2[_0xe966('0x30')]=_[_0xe966('0x31')](_0x179a34,_0xe966('0x2a'));_0x345ba2['query']=_['keys'](_0x4a0f31[_0xe966('0x32')]);_0x345ba2['filters']=_[_0xe966('0x33')](_0x345ba2[_0xe966('0x30')],_0x345ba2['query']);_0x15b709['attributes']=_['intersection'](_0x345ba2[_0xe966('0x30')],qs['fields'](_0x4a0f31['query'][_0xe966('0x34')]));_0x15b709['attributes']=_0x15b709[_0xe966('0x35')]['length']?_0x15b709[_0xe966('0x35')]:_0x345ba2[_0xe966('0x30')];if(!_0x4a0f31[_0xe966('0x32')][_0xe966('0x36')](_0xe966('0x37'))){_0x15b709['limit']=qs[_0xe966('0x1d')](_0x4a0f31[_0xe966('0x32')][_0xe966('0x1d')]);_0x15b709['offset']=qs[_0xe966('0x1f')](_0x4a0f31[_0xe966('0x32')][_0xe966('0x1f')]);}_0x15b709[_0xe966('0x38')]=qs[_0xe966('0x39')](_0x4a0f31[_0xe966('0x32')][_0xe966('0x39')]);_0x15b709['where']=qs[_0xe966('0x3a')](_[_0xe966('0x3b')](_0x4a0f31[_0xe966('0x32')],_0x345ba2[_0xe966('0x3a')]),_0x179a34);if(_0x4a0f31[_0xe966('0x32')]['filter']){_0x15b709[_0xe966('0x3c')]=_[_0xe966('0x3d')](_0x15b709[_0xe966('0x3c')],{'$or':_['map'](_0x179a34,function(_0x563f2f){if(_0x563f2f['type']!==_0xe966('0x3e')){var _0x24ce80={};_0x24ce80[_0x563f2f[_0xe966('0x2a')]]={'$like':'%'+_0x4a0f31[_0xe966('0x32')][_0xe966('0x3f')]+'%'};return _0x24ce80;}})});}_0x15b709=_[_0xe966('0x3d')]({},_0x15b709,_0x4a0f31[_0xe966('0x40')]);var _0x14f5f5={'where':_0x15b709[_0xe966('0x3c')]};return db[_0xe966('0x2d')][_0xe966('0x1e')](_0x14f5f5)[_0xe966('0x24')](function(_0x5104a3){_0x3b74fe[_0xe966('0x1e')]=_0x5104a3;if(_0x4a0f31[_0xe966('0x32')][_0xe966('0x41')]){_0x15b709[_0xe966('0x42')]=[{'all':!![]}];}return db[_0xe966('0x2d')][_0xe966('0x43')](_0x15b709);})[_0xe966('0x24')](function(_0x4e4fcb){_0x3b74fe[_0xe966('0x44')]=_0x4e4fcb;return _0x3b74fe;})['then'](respondWithFilteredResult(_0x2edc73,_0x15b709))['catch'](handleError(_0x2edc73,null));};exports[_0xe966('0x45')]=function(_0x48cd66,_0x23119c){var _0x510b59={'raw':!![],'where':{'id':_0x48cd66[_0xe966('0x46')]['id']}},_0x374ec6={};_0x374ec6[_0xe966('0x30')]=_[_0xe966('0x47')](db[_0xe966('0x2d')][_0xe966('0x2e')]);_0x374ec6[_0xe966('0x32')]=_[_0xe966('0x47')](_0x48cd66['query']);_0x374ec6['filters']=_[_0xe966('0x33')](_0x374ec6[_0xe966('0x30')],_0x374ec6[_0xe966('0x32')]);_0x510b59['attributes']=_['intersection'](_0x374ec6[_0xe966('0x30')],qs[_0xe966('0x34')](_0x48cd66['query'][_0xe966('0x34')]));_0x510b59['attributes']=_0x510b59['attributes'][_0xe966('0x48')]?_0x510b59['attributes']:_0x374ec6[_0xe966('0x30')];if(_0x48cd66[_0xe966('0x32')][_0xe966('0x41')]){_0x510b59['include']=[{'all':!![]}];}_0x510b59=_[_0xe966('0x3d')]({},_0x510b59,_0x48cd66[_0xe966('0x40')]);return db[_0xe966('0x2d')][_0xe966('0x49')](_0x510b59)[_0xe966('0x24')](handleEntityNotFound(_0x23119c,null))[_0xe966('0x24')](respondWithResult(_0x23119c,null))['catch'](handleError(_0x23119c,null));};exports[_0xe966('0x4a')]=function(_0x1833c9,_0x57a115){return db[_0xe966('0x2d')][_0xe966('0x4a')](_0x1833c9[_0xe966('0x4b')],{})[_0xe966('0x24')](function(_0x4b4e2e){var _0x49219d=_0x1833c9['user'][_0xe966('0x26')]({'plain':!![]});if(!_0x49219d)throw new Error(_0xe966('0x4c'));if(_0x49219d[_0xe966('0x4d')]===_0xe966('0x4e')){var _0x25760d=_0x4b4e2e[_0xe966('0x26')]({'plain':!![]});var _0x15fa6e=_0xe966('0x27');return db[_0xe966('0x4f')]['find']({'where':{'name':_0x15fa6e,'userProfileId':_0x49219d[_0xe966('0x50')]},'raw':!![]})[_0xe966('0x24')](function(_0x1b82cb){if(_0x1b82cb&&_0x1b82cb['autoAssociation']===0x0){return db[_0xe966('0x28')]['create']({'name':_0x25760d[_0xe966('0x2a')],'resourceId':_0x25760d['id'],'type':_0x1b82cb['name'],'sectionId':_0x1b82cb['id']},{})[_0xe966('0x24')](function(){return _0x4b4e2e;});}else{return _0x4b4e2e;}})[_0xe966('0x51')](function(_0x5da4b0){logger[_0xe966('0x52')](_0xe966('0x53'),_0x5da4b0);throw _0x5da4b0;});}return _0x4b4e2e;})[_0xe966('0x24')](respondWithResult(_0x57a115,0xc9))[_0xe966('0x51')](handleError(_0x57a115,null));};exports[_0xe966('0x23')]=function(_0x1c753e,_0x209828){if(_0x1c753e['body']['id']){delete _0x1c753e[_0xe966('0x4b')]['id'];}return db['Variable'][_0xe966('0x49')]({'where':{'id':_0x1c753e[_0xe966('0x46')]['id']}})[_0xe966('0x24')](handleEntityNotFound(_0x209828,null))['then'](saveUpdates(_0x1c753e['body'],null))[_0xe966('0x24')](respondWithResult(_0x209828,null))[_0xe966('0x51')](handleError(_0x209828,null));};exports['destroy']=function(_0x2423a1,_0xfbb6ef){return db[_0xe966('0x2d')][_0xe966('0x49')]({'where':{'id':_0x2423a1['params']['id']}})[_0xe966('0x24')](handleEntityNotFound(_0xfbb6ef,null))[_0xe966('0x24')](removeEntity(_0xfbb6ef,null))[_0xe966('0x51')](handleError(_0xfbb6ef,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 39ed1b8..e85e423 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 _0x6234=['Variable','tools_variables','lodash','api','moment','request-promise','rimraf','./variable.attributes','exports','define'];(function(_0x1d0381,_0x3cff96){var _0x37b362=function(_0x3895ce){while(--_0x3895ce){_0x1d0381['push'](_0x1d0381['shift']());}};_0x37b362(++_0x3cff96);}(_0x6234,0x1e2));var _0x4623=function(_0x326b8f,_0x29597e){_0x326b8f=_0x326b8f-0x0;var _0x11b80b=_0x6234[_0x326b8f];return _0x11b80b;};'use strict';var _=require(_0x4623('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4623('0x1'));var moment=require(_0x4623('0x2'));var BPromise=require('bluebird');var rp=require(_0x4623('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4623('0x4'));var config=require('../../config/environment');var attributes=require(_0x4623('0x5'));module[_0x4623('0x6')]=function(_0x474452,_0x21659d){return _0x474452[_0x4623('0x7')](_0x4623('0x8'),attributes,{'tableName':_0x4623('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47dd=['Variable','tools_variables','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','define'];(function(_0x13c744,_0x25b355){var _0x317c3c=function(_0x71c4d8){while(--_0x71c4d8){_0x13c744['push'](_0x13c744['shift']());}};_0x317c3c(++_0x25b355);}(_0x47dd,0x7b));var _0xd47d=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x47dd[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0xd47d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd47d('0x1'));var moment=require(_0xd47d('0x2'));var BPromise=require(_0xd47d('0x3'));var rp=require(_0xd47d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd47d('0x5'));var config=require(_0xd47d('0x6'));var attributes=require(_0xd47d('0x7'));module['exports']=function(_0x4d70c4,_0x3b8b1b){return _0x4d70c4[_0xd47d('0x8')](_0xd47d('0x9'),attributes,{'tableName':_0xd47d('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 9af6e88..44c7be5 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 _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x26f1e9,_0x10d5df){var _0x122595=function(_0x4fa546){while(--_0x4fa546){_0x26f1e9['push'](_0x26f1e9['shift']());}};_0x122595(++_0x10d5df);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x33ee4d,_0x14c274){_0x33ee4d=_0x33ee4d-0x0;var _0x1a2de6=_0x7fbe[_0x33ee4d];return _0x1a2de6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x550417,_0x36a845){var _0x324704=function(_0x1faa0f){while(--_0x1faa0f){_0x550417['push'](_0x550417['shift']());}};_0x324704(++_0x36a845);}(_0x7217,0x19e));var _0x7721=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7217[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index bfa276a..dd06761 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 _0xaef0=['restart','/migrations','migrations','exports','express','Router','./version.controller','get','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart'];(function(_0x4ae299,_0x21a6c6){var _0x5206f2=function(_0x295e70){while(--_0x295e70){_0x4ae299['push'](_0x4ae299['shift']());}};_0x5206f2(++_0x21a6c6);}(_0xaef0,0x16c));var _0x0aef=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xaef0[_0x29e35f];return _0x266b74;};'use strict';var express=require(_0x0aef('0x0'));var router=express[_0x0aef('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0aef('0x2'));router[_0x0aef('0x3')]('/',controller['index']);router['get']('/fetch',auth[_0x0aef('0x4')](),auth[_0x0aef('0x5')](),controller[_0x0aef('0x6')]);router[_0x0aef('0x3')](_0x0aef('0x7'),auth[_0x0aef('0x4')](),auth[_0x0aef('0x5')](),controller[_0x0aef('0x8')]);router[_0x0aef('0x3')]('/pull',auth[_0x0aef('0x4')](),auth['canUpdate'](),controller[_0x0aef('0x9')]);router[_0x0aef('0x3')](_0x0aef('0xa'),auth[_0x0aef('0x4')](),controller[_0x0aef('0xb')]);router[_0x0aef('0x3')](_0x0aef('0xc'),controller[_0x0aef('0xd')]);module[_0x0aef('0xe')]=router; \ No newline at end of file +var _0x9543=['express','Router','../../components/auth/service','get','index','/fetch','canUpdate','isAuthenticated','reset','/pull','pull','restart','migrations','exports'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x9543,0x188));var _0x3954=function(_0x4e3974,_0x41a63b){_0x4e3974=_0x4e3974-0x0;var _0x7162d5=_0x9543[_0x4e3974];return _0x7162d5;};'use strict';var express=require(_0x3954('0x0'));var router=express[_0x3954('0x1')]();var auth=require(_0x3954('0x2'));var controller=require('./version.controller');router[_0x3954('0x3')]('/',controller[_0x3954('0x4')]);router[_0x3954('0x3')](_0x3954('0x5'),auth['isAuthenticated'](),auth[_0x3954('0x6')](),controller['fetch']);router['get']('/reset',auth[_0x3954('0x7')](),auth[_0x3954('0x6')](),controller[_0x3954('0x8')]);router[_0x3954('0x3')](_0x3954('0x9'),auth[_0x3954('0x7')](),auth[_0x3954('0x6')](),controller[_0x3954('0xa')]);router[_0x3954('0x3')]('/restart',auth[_0x3954('0x7')](),controller[_0x3954('0xb')]);router['get']('/migrations',controller[_0x3954('0xc')]);module[_0x3954('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index feaefd7..4b8ef42 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 _0x6fcf=['version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','query','fetch','tags','latest','exports','2.0.0','json','status','origin','master','info','git\x20fetch','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','readdirSync','join','server','length','replace','.js','push','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash'];(function(_0x35596c,_0x57b957){var _0x49f5e7=function(_0x5789f9){while(--_0x5789f9){_0x35596c['push'](_0x35596c['shift']());}};_0x49f5e7(++_0x57b957);}(_0x6fcf,0xf7));var _0xf6fc=function(_0x2fe9d3,_0x2fcde6){_0x2fe9d3=_0x2fe9d3-0x0;var _0x16f31b=_0x6fcf[_0x2fe9d3];return _0x16f31b;};'use strict';var Umzug=require(_0xf6fc('0x0'));var path=require(_0xf6fc('0x1'));var fs=require('fs');var _=require(_0xf6fc('0x2'));var pkginfo=require('pkginfo')(module,_0xf6fc('0x3'));var compareVersions=require(_0xf6fc('0x4'));var exec=require(_0xf6fc('0x5'))[_0xf6fc('0x6')];var db=require(_0xf6fc('0x7'))['db'];var config=require(_0xf6fc('0x8'));var pm2=require(_0xf6fc('0x9'));var logger=require('../../config/logger')(_0xf6fc('0xa'));var git=require('simple-git')(config[_0xf6fc('0xb')]);exports[_0xf6fc('0xc')]=function(_0xdaa426,_0x101669){var _0x160571={'current':module['exports'][_0xf6fc('0x3')],'phonebar':0x2};if(_0xdaa426['query']&&_0xdaa426[_0xf6fc('0xd')]['latest']){return git[_0xf6fc('0xe')]()[_0xf6fc('0xf')](function(_0x574fe1,_0x38e580){_0x160571[_0xf6fc('0x10')]=(_0x574fe1?module[_0xf6fc('0x11')][_0xf6fc('0x3')]:_0x38e580[_0xf6fc('0x10')])||_0xf6fc('0x12');return _0x101669['status'](0xc8)[_0xf6fc('0x13')](_0x160571);});}else{return _0x101669[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')](_0x160571);}};exports[_0xf6fc('0xe')]=function(_0x4e4678,_0x4b8a86){return git[_0xf6fc('0xe')]([_0xf6fc('0x15'),_0xf6fc('0x16')],function(_0x39ba93){if(_0x39ba93){logger['error'](_0x39ba93);return _0x4b8a86[_0xf6fc('0x14')](0x1f4)[_0xf6fc('0x13')](_0x39ba93);}logger[_0xf6fc('0x17')](_0xf6fc('0x18'));return _0x4b8a86[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x30fe6c,_0x450314){return git['reset']([_0xf6fc('0x19'),_0xf6fc('0x1a')],function(_0x26b952){if(_0x26b952){logger[_0xf6fc('0x1b')](_0x26b952);return _0x450314['status'](0x1f4)[_0xf6fc('0x13')](_0x26b952);}logger['info'](_0xf6fc('0x1c'));return _0x450314[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x2a2612,_0x1d5a61){exec(_0xf6fc('0x1d'),function(_0x2a5212,_0x34b8e1,_0x2a180b){logger[_0xf6fc('0x17')](_0x34b8e1);logger[_0xf6fc('0x17')](_0x2a180b);if(_0x2a5212){logger[_0xf6fc('0x1b')](_0x2a5212);return _0x1d5a61[_0xf6fc('0x14')](0x1f4)[_0xf6fc('0x13')](_0x2a5212);}return _0x1d5a61[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':_0x34b8e1});});};exports[_0xf6fc('0x1e')]=function(_0x488956,_0x39bfe8){return pm2[_0xf6fc('0x1e')](_0xf6fc('0x1f'))[_0xf6fc('0x20')](function(_0x54ca05){logger['info'](_0xf6fc('0x21'),_0x54ca05);return _0x39bfe8[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xf6fc('0x22')](function(_0x17eed3){logger['error'](_0x17eed3);return _0x39bfe8['status'](0x1f4)['json'](_0x17eed3);});};exports[_0xf6fc('0x23')]=function(_0x52fb9d,_0x5d50e6){var _0x41c469=fs[_0xf6fc('0x24')](path[_0xf6fc('0x25')](config[_0xf6fc('0xb')],_0xf6fc('0x26'),_0xf6fc('0x23')));var _0x1d26f2=[];for(var _0x122ccd=0x0;_0x122ccd<_0x41c469[_0xf6fc('0x27')];_0x122ccd++){var _0xfdb8a3=_0x41c469[_0x122ccd][_0xf6fc('0x28')](_0xf6fc('0x29'),'');if(compareVersions(module[_0xf6fc('0x11')][_0xf6fc('0x3')],_0xfdb8a3)===-0x1){_0x1d26f2[_0xf6fc('0x2a')](_0xfdb8a3);}}if(_0x1d26f2[_0xf6fc('0x27')]){var _0x288edc=_0x1d26f2['sort'](compareVersions);var _0x3f7ebf=new Umzug({'storage':_0xf6fc('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0xf6fc('0x3')},'migrations':{'params':[db[_0xf6fc('0x2b')]['getQueryInterface'](),db[_0xf6fc('0x2b')][_0xf6fc('0x2c')],function(){throw new Error(_0xf6fc('0x2d'));}],'path':path[_0xf6fc('0x25')](config[_0xf6fc('0xb')],'server',_0xf6fc('0x23')),'pattern':/\.js$/}});_0x3f7ebf['up']({'migrations':_[_0xf6fc('0x2e')](_0x288edc,function(_0x4ddba1){return _0x4ddba1+_0xf6fc('0x29');})})[_0xf6fc('0x20')](function(){return _0x5d50e6[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xf6fc('0x11')]['version']+'\x20to\x20'+_[_0xf6fc('0x2f')](_0x288edc),'migrations':_[_0xf6fc('0x25')](_0x288edc)});})['catch'](function(_0x5afad7){if(_0x5afad7 instanceof db[_0xf6fc('0x2b')][_0xf6fc('0x30')]){return _0x5d50e6[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':_0xf6fc('0x31')});}else{return _0x5d50e6[_0xf6fc('0x14')](0x1f4)['json'](_0x5afad7);}});}else{return _0x5d50e6[_0xf6fc('0x14')](0xc8)[_0xf6fc('0x13')]({'output':_0xf6fc('0x31')});}}; \ No newline at end of file +var _0x482b=['query','latest','tags','2.0.0','status','json','fetch','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','.js','push','sequelize','Migration','getQueryInterface','constructor','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','index','exports'];(function(_0x29ce10,_0xd29f22){var _0x15f171=function(_0x3a8144){while(--_0x3a8144){_0x29ce10['push'](_0x29ce10['shift']());}};_0x15f171(++_0xd29f22);}(_0x482b,0x18b));var _0xb482=function(_0x206c75,_0x31b28c){_0x206c75=_0x206c75-0x0;var _0x207949=_0x482b[_0x206c75];return _0x207949;};'use strict';var Umzug=require('umzug');var path=require(_0xb482('0x0'));var fs=require('fs');var _=require(_0xb482('0x1'));var pkginfo=require(_0xb482('0x2'))(module,_0xb482('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xb482('0x4'))[_0xb482('0x5')];var db=require(_0xb482('0x6'))['db'];var config=require(_0xb482('0x7'));var pm2=require(_0xb482('0x8'));var logger=require(_0xb482('0x9'))('update');var git=require('simple-git')(config[_0xb482('0xa')]);exports[_0xb482('0xb')]=function(_0x38bb42,_0x49fc37){var _0x2da70d={'current':module[_0xb482('0xc')][_0xb482('0x3')],'phonebar':0x2};if(_0x38bb42['query']&&_0x38bb42[_0xb482('0xd')][_0xb482('0xe')]){return git['fetch']()[_0xb482('0xf')](function(_0xc2f979,_0x64234d){_0x2da70d[_0xb482('0xe')]=(_0xc2f979?module[_0xb482('0xc')][_0xb482('0x3')]:_0x64234d[_0xb482('0xe')])||_0xb482('0x10');return _0x49fc37[_0xb482('0x11')](0xc8)[_0xb482('0x12')](_0x2da70d);});}else{return _0x49fc37[_0xb482('0x11')](0xc8)[_0xb482('0x12')](_0x2da70d);}};exports['fetch']=function(_0x30342b,_0x360908){return git[_0xb482('0x13')]([_0xb482('0x14'),_0xb482('0x15')],function(_0xc4a184){if(_0xc4a184){logger['error'](_0xc4a184);return _0x360908[_0xb482('0x11')](0x1f4)[_0xb482('0x12')](_0xc4a184);}logger[_0xb482('0x16')]('git\x20fetch');return _0x360908[_0xb482('0x11')](0xc8)['json']({'output':_0xb482('0x17')});});};exports[_0xb482('0x18')]=function(_0x48f467,_0x2db97e){return git['reset']([_0xb482('0x19'),_0xb482('0x1a')],function(_0x24f78f){if(_0x24f78f){logger['error'](_0x24f78f);return _0x2db97e[_0xb482('0x11')](0x1f4)[_0xb482('0x12')](_0x24f78f);}logger[_0xb482('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2db97e['status'](0xc8)[_0xb482('0x12')]({'output':_0xb482('0x1b')});});};exports[_0xb482('0x1c')]=function(_0x48d559,_0x55ed66){exec(_0xb482('0x1d'),function(_0x5d774a,_0x386ac3,_0x39657f){logger['info'](_0x386ac3);logger['info'](_0x39657f);if(_0x5d774a){logger[_0xb482('0x1e')](_0x5d774a);return _0x55ed66[_0xb482('0x11')](0x1f4)['json'](_0x5d774a);}return _0x55ed66['status'](0xc8)[_0xb482('0x12')]({'output':_0x386ac3});});};exports['restart']=function(_0x4275ed,_0x1b60ab){return pm2[_0xb482('0x1f')](_0xb482('0x20'))[_0xb482('0x21')](function(_0x2b08c4){logger[_0xb482('0x16')](_0xb482('0x22'),_0x2b08c4);return _0x1b60ab['status'](0xc8)[_0xb482('0x12')]({'output':_0xb482('0x23')});})[_0xb482('0x24')](function(_0xaa4a7f){logger[_0xb482('0x1e')](_0xaa4a7f);return _0x1b60ab[_0xb482('0x11')](0x1f4)['json'](_0xaa4a7f);});};exports['migrations']=function(_0xc9808e,_0x4eb57f){var _0x1d48c0=fs[_0xb482('0x25')](path[_0xb482('0x26')](config[_0xb482('0xa')],_0xb482('0x27'),_0xb482('0x28')));var _0x1a9886=[];for(var _0x4e1ec6=0x0;_0x4e1ec6<_0x1d48c0[_0xb482('0x29')];_0x4e1ec6++){var _0x37cc72=_0x1d48c0[_0x4e1ec6]['replace'](_0xb482('0x2a'),'');if(compareVersions(module[_0xb482('0xc')][_0xb482('0x3')],_0x37cc72)===-0x1){_0x1a9886[_0xb482('0x2b')](_0x37cc72);}}if(_0x1a9886[_0xb482('0x29')]){var _0xf884c2=_0x1a9886['sort'](compareVersions);var _0x36ee9a=new Umzug({'storage':_0xb482('0x2c'),'storageOptions':{'model':db[_0xb482('0x2d')],'modelName':_0xb482('0x2d'),'columnName':_0xb482('0x3')},'migrations':{'params':[db[_0xb482('0x2c')][_0xb482('0x2e')](),db['sequelize'][_0xb482('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xb482('0x26')](config[_0xb482('0xa')],_0xb482('0x27'),_0xb482('0x28')),'pattern':/\.js$/}});_0x36ee9a['up']({'migrations':_['map'](_0xf884c2,function(_0x42224c){return _0x42224c+_0xb482('0x2a');})})[_0xb482('0x21')](function(){return _0x4eb57f[_0xb482('0x11')](0xc8)['json']({'output':_0xb482('0x30')+module[_0xb482('0xc')][_0xb482('0x3')]+_0xb482('0x31')+_['last'](_0xf884c2),'migrations':_[_0xb482('0x26')](_0xf884c2)});})[_0xb482('0x24')](function(_0x3acb99){if(_0x3acb99 instanceof db[_0xb482('0x2c')]['UniqueConstraintError']){return _0x4eb57f['status'](0xc8)[_0xb482('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4eb57f['status'](0x1f4)[_0xb482('0x12')](_0x3acb99);}});}else{return _0x4eb57f[_0xb482('0x11')](0xc8)[_0xb482('0x12')]({'output':_0xb482('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index bfad53f..56c4afc 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 _0x06b1=['create','put','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x44b3f6,_0x2f0b79){var _0x4a6207=function(_0x5835fb){while(--_0x5835fb){_0x44b3f6['push'](_0x44b3f6['shift']());}};_0x4a6207(++_0x2f0b79);}(_0x06b1,0x15a));var _0x106b=function(_0x59fabd,_0x2d4f1d){_0x59fabd=_0x59fabd-0x0;var _0x1b89a8=_0x06b1[_0x59fabd];return _0x1b89a8;};'use strict';var multer=require('multer');var util=require(_0x106b('0x0'));var path=require(_0x106b('0x1'));var timeout=require('connect-timeout');var express=require(_0x106b('0x2'));var router=express['Router']();var fs_extra=require(_0x106b('0x3'));var auth=require(_0x106b('0x4'));var interaction=require(_0x106b('0x5'));var config=require(_0x106b('0x6'));var controller=require(_0x106b('0x7'));router[_0x106b('0x8')]('/',auth['isAuthenticated'](),controller[_0x106b('0x9')]);router['get']('/describe',auth[_0x106b('0xa')](),controller[_0x106b('0xb')]);router[_0x106b('0x8')](_0x106b('0xc'),auth['isAuthenticated'](),controller[_0x106b('0xd')]);router[_0x106b('0xe')]('/',auth['isAuthenticated'](),controller[_0x106b('0xf')]);router[_0x106b('0x10')]('/:id',auth[_0x106b('0xa')](),controller['update']);router['delete'](_0x106b('0xc'),auth['isAuthenticated'](),controller[_0x106b('0x11')]);module[_0x106b('0x12')]=router; \ No newline at end of file +var _0xdb92=['../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d38da,_0x4791a9){var _0x2dda65=function(_0xd75a9e){while(--_0xd75a9e){_0x1d38da['push'](_0x1d38da['shift']());}};_0x2dda65(++_0x4791a9);}(_0xdb92,0x19b));var _0x2db9=function(_0x4febd4,_0xad6972){_0x4febd4=_0x4febd4-0x0;var _0x35ac11=_0xdb92[_0x4febd4];return _0x35ac11;};'use strict';var multer=require(_0x2db9('0x0'));var util=require(_0x2db9('0x1'));var path=require('path');var timeout=require(_0x2db9('0x2'));var express=require('express');var router=express[_0x2db9('0x3')]();var fs_extra=require(_0x2db9('0x4'));var auth=require(_0x2db9('0x5'));var interaction=require(_0x2db9('0x6'));var config=require(_0x2db9('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x2db9('0x8')](),controller['index']);router[_0x2db9('0x9')](_0x2db9('0xa'),auth[_0x2db9('0x8')](),controller[_0x2db9('0xb')]);router[_0x2db9('0x9')](_0x2db9('0xc'),auth[_0x2db9('0x8')](),controller[_0x2db9('0xd')]);router[_0x2db9('0xe')]('/',auth[_0x2db9('0x8')](),controller[_0x2db9('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2db9('0x10')]('/:id',auth[_0x2db9('0x8')](),controller[_0x2db9('0x11')]);module[_0x2db9('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 9d6e30a..b0b89da 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 _0xa866=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x431a4c,_0xc9f2a7){var _0xc53f03=function(_0x38350d){while(--_0x38350d){_0x431a4c['push'](_0x431a4c['shift']());}};_0xc53f03(++_0xc9f2a7);}(_0xa866,0x6a));var _0x6a86=function(_0x33f88f,_0x43081f){_0x33f88f=_0x33f88f-0x0;var _0x485ea2=_0xa866[_0x33f88f];return _0x485ea2;};'use strict';var Sequelize=require(_0x6a86('0x0'));module[_0x6a86('0x1')]={'type':{'type':Sequelize[_0x6a86('0x2')]},'uniqueid':{'type':Sequelize[_0x6a86('0x2')]},'calleridnum':{'type':Sequelize[_0x6a86('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x6a86('0x2')]},'interface':{'type':Sequelize[_0x6a86('0x2')]},'membername':{'type':Sequelize[_0x6a86('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x6a86('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x6a86('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x6a86('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x6a86('0x4')]},'agentcomplete':{'type':Sequelize[_0x6a86('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6a86('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6a86('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6a86('0x4')]},'agentacw':{'type':Sequelize[_0x6a86('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6a86('0x4')]},'reason':{'type':Sequelize[_0x6a86('0x2')]},'lastevent':{'type':Sequelize[_0x6a86('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6a86('0x4')]},'channelstatedesc':{'type':Sequelize[_0x6a86('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6a86('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x6a86('0x2')]},'accountcode':{'type':Sequelize[_0x6a86('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6a86('0x2')]},'destchannel':{'type':Sequelize[_0x6a86('0x2')]},'destchannelstate':{'type':Sequelize[_0x6a86('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x6a86('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6a86('0x2')]},'destcalleridname':{'type':Sequelize[_0x6a86('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6a86('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6a86('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6a86('0x2')]},'destcontext':{'type':Sequelize[_0x6a86('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6a86('0x2')]},'destuniqueid':{'type':Sequelize[_0x6a86('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6a86('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x6a86('0x2')]},'transfer':{'type':Sequelize[_0x6a86('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6a86('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x6a86('0x2')]},'transferuniqueid':{'type':Sequelize[_0x6a86('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb62e=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5453d6,_0x4ffa9a){var _0x4dd4c2=function(_0x5c95dd){while(--_0x5c95dd){_0x5453d6['push'](_0x5453d6['shift']());}};_0x4dd4c2(++_0x4ffa9a);}(_0xb62e,0x1de));var _0xeb62=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb62e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'type':{'type':Sequelize[_0xeb62('0x2')]},'uniqueid':{'type':Sequelize[_0xeb62('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xeb62('0x2')]},'queue':{'type':Sequelize[_0xeb62('0x2')]},'interface':{'type':Sequelize[_0xeb62('0x2')]},'membername':{'type':Sequelize[_0xeb62('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeb62('0x3')]},'agentconnectAt':{'type':Sequelize[_0xeb62('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xeb62('0x3')]},'agentdumpAt':{'type':Sequelize[_0xeb62('0x3')]},'holdtime':{'type':Sequelize[_0xeb62('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xeb62('0x4')]},'agentacw':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xeb62('0x2')]},'channel':{'type':Sequelize[_0xeb62('0x2')]},'channelstate':{'type':Sequelize[_0xeb62('0x4')]},'channelstatedesc':{'type':Sequelize[_0xeb62('0x2')]},'connectedlinenum':{'type':Sequelize[_0xeb62('0x2')]},'connectedlinename':{'type':Sequelize[_0xeb62('0x2')]},'language':{'type':Sequelize[_0xeb62('0x2')]},'accountcode':{'type':Sequelize[_0xeb62('0x2')]},'context':{'type':Sequelize[_0xeb62('0x2')]},'exten':{'type':Sequelize[_0xeb62('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xeb62('0x2')]},'destchannelstate':{'type':Sequelize[_0xeb62('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xeb62('0x2')]},'destcalleridnum':{'type':Sequelize[_0xeb62('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xeb62('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeb62('0x2')]},'destlanguage':{'type':Sequelize[_0xeb62('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xeb62('0x2')]},'destexten':{'type':Sequelize[_0xeb62('0x2')]},'destpriority':{'type':Sequelize[_0xeb62('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xeb62('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xeb62('0x2')]},'transfer':{'type':Sequelize[_0xeb62('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xeb62('0x2')],'comment':_0xeb62('0x6')},'transferexten':{'type':Sequelize[_0xeb62('0x2')]},'transferuniqueid':{'type':Sequelize[_0xeb62('0x2')]},'agententerreason':{'type':Sequelize[_0xeb62('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 29bdff8..da060c9 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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 d01b36c..ec00927 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 _0x5ad3=['uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x38223f,_0x3a0dfc){_0x38223f=_0x38223f-0x0;var _0x3e3fab=_0x5ad3[_0x38223f];return _0x3e3fab;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[{'fields':[_0x35ad('0xd'),_0x35ad('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72b1=['path','rimraf','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x72b1,0x16e));var _0x172b=function(_0x408b8f,_0x44093c){_0x408b8f=_0x408b8f-0x0;var _0x4dda23=_0x72b1[_0x408b8f];return _0x4dda23;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x172b('0xb'),'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 d107ffd..2e6d43f 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 _0xc146=['../../config/environment','client','http','request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','catch','CreateVoiceAgentReport','VoiceAgentReport','options','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2edf42,_0x580893){var _0x57f40a=function(_0x277006){while(--_0x277006){_0x2edf42['push'](_0x2edf42['shift']());}};_0x57f40a(++_0x580893);}(_0xc146,0xde));var _0x6c14=function(_0x165354,_0x2c6a20){_0x165354=_0x165354-0x0;var _0x3462f6=_0xc146[_0x165354];return _0x3462f6;};'use strict';var _=require(_0x6c14('0x0'));var util=require(_0x6c14('0x1'));var moment=require(_0x6c14('0x2'));var BPromise=require(_0x6c14('0x3'));var rs=require(_0x6c14('0x4'));var fs=require('fs');var Redis=require(_0x6c14('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c14('0x6'));var logger=require(_0x6c14('0x7'))(_0x6c14('0x8'));var config=require(_0x6c14('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c14('0xa')][_0x6c14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b6c9a,_0x88bbde,_0x1f2634){return new BPromise(function(_0x55cf22,_0x195e05){return client[_0x6c14('0xc')](_0x4b6c9a,_0x1f2634)[_0x6c14('0xd')](function(_0x5266c9){logger[_0x6c14('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x88bbde,'request\x20sent');logger[_0x6c14('0xf')](_0x6c14('0x10'),_0x88bbde,_0x6c14('0x11'),JSON[_0x6c14('0x12')](_0x5266c9));if(_0x5266c9[_0x6c14('0x13')]){if(_0x5266c9[_0x6c14('0x13')][_0x6c14('0x14')]===0x1f4){logger[_0x6c14('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x88bbde,_0x5266c9[_0x6c14('0x13')][_0x6c14('0x15')]);return _0x195e05(_0x5266c9[_0x6c14('0x13')][_0x6c14('0x15')]);}logger['error'](_0x6c14('0x16'),_0x88bbde,_0x5266c9[_0x6c14('0x13')]['message']);return _0x55cf22(_0x5266c9[_0x6c14('0x13')][_0x6c14('0x15')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x88bbde,_0x6c14('0x11'));_0x55cf22(_0x5266c9[_0x6c14('0x17')]['message']);}})[_0x6c14('0x18')](function(_0x152573){logger[_0x6c14('0x13')](_0x6c14('0x16'),_0x88bbde,_0x152573);_0x195e05(_0x152573);});});}exports[_0x6c14('0x19')]=function(_0xfc814b){var _0x1ab526=this;return new Promise(function(_0x23110a,_0x38dd5a){return db[_0x6c14('0x1a')]['create'](_0xfc814b['body'],{'raw':_0xfc814b[_0x6c14('0x1b')]?_0xfc814b[_0x6c14('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x6c14('0xd')](function(_0x419b9a){logger[_0x6c14('0xe')](_0x6c14('0x19'),_0xfc814b);logger[_0x6c14('0xf')](_0x6c14('0x19'),_0xfc814b,JSON[_0x6c14('0x12')](_0x419b9a));_0x23110a(_0x419b9a);})[_0x6c14('0x18')](function(_0x3a4f24){logger[_0x6c14('0x13')]('CreateVoiceAgentReport',_0x3a4f24[_0x6c14('0x15')],_0xfc814b);_0x38dd5a(_0x1ab526[_0x6c14('0x13')](0x1f4,_0x3a4f24[_0x6c14('0x15')]));});});};exports[_0x6c14('0x1c')]=function(_0xdf9ce0){var _0x373228=this;return new Promise(function(_0x5af774,_0x5858f0){return db[_0x6c14('0x1a')][_0x6c14('0x1d')](_0xdf9ce0['body'],{'raw':_0xdf9ce0[_0x6c14('0x1b')]?_0xdf9ce0[_0x6c14('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf9ce0[_0x6c14('0x1b')]?_0xdf9ce0[_0x6c14('0x1b')][_0x6c14('0x1e')]||null:null,'attributes':_0xdf9ce0['options']?_0xdf9ce0['options'][_0x6c14('0x1f')]||null:null,'limit':_0xdf9ce0[_0x6c14('0x1b')]?_0xdf9ce0[_0x6c14('0x1b')][_0x6c14('0x20')]||null:null})[_0x6c14('0xd')](function(_0x24c6cc){logger[_0x6c14('0xe')](_0x6c14('0x1c'),_0xdf9ce0);logger['debug'](_0x6c14('0x1c'),_0xdf9ce0,JSON[_0x6c14('0x12')](_0x24c6cc));_0x5af774(_0x24c6cc);})[_0x6c14('0x18')](function(_0x37c1e1){logger[_0x6c14('0x13')]('UpdateVoiceAgentReport',_0x37c1e1['message'],_0xdf9ce0);_0x5858f0(_0x373228[_0x6c14('0x13')](0x1f4,_0x37c1e1[_0x6c14('0x15')]));});});}; \ No newline at end of file +var _0xa33b=['error','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','UpdateVoiceAgentReport','options','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a1c49,_0x16920a){var _0x4ba92d=function(_0x36dfe0){while(--_0x36dfe0){_0x4a1c49['push'](_0x4a1c49['shift']());}};_0x4ba92d(++_0x16920a);}(_0xa33b,0xae));var _0xba33=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xa33b[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xba33('0x0'));var util=require('util');var moment=require(_0xba33('0x1'));var BPromise=require(_0xba33('0x2'));var rs=require(_0xba33('0x3'));var fs=require('fs');var Redis=require(_0xba33('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba33('0x5'));var logger=require(_0xba33('0x6'))(_0xba33('0x7'));var config=require(_0xba33('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xba33('0x9')][_0xba33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a7078,_0x5b8c62,_0x485d27){return new BPromise(function(_0x5ac69e,_0x1425da){return client[_0xba33('0xb')](_0x2a7078,_0x485d27)[_0xba33('0xc')](function(_0x425501){logger['info'](_0xba33('0xd'),_0x5b8c62,_0xba33('0xe'));logger[_0xba33('0xf')](_0xba33('0x10'),_0x5b8c62,_0xba33('0xe'),JSON[_0xba33('0x11')](_0x425501));if(_0x425501['error']){if(_0x425501[_0xba33('0x12')]['code']===0x1f4){logger[_0xba33('0x12')](_0xba33('0xd'),_0x5b8c62,_0x425501['error'][_0xba33('0x13')]);return _0x1425da(_0x425501[_0xba33('0x12')][_0xba33('0x13')]);}logger[_0xba33('0x12')](_0xba33('0xd'),_0x5b8c62,_0x425501[_0xba33('0x12')]['message']);return _0x5ac69e(_0x425501[_0xba33('0x12')][_0xba33('0x13')]);}else{logger[_0xba33('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x5b8c62,_0xba33('0xe'));_0x5ac69e(_0x425501[_0xba33('0x15')]['message']);}})[_0xba33('0x16')](function(_0x1959ab){logger[_0xba33('0x12')](_0xba33('0xd'),_0x5b8c62,_0x1959ab);_0x1425da(_0x1959ab);});});}exports[_0xba33('0x17')]=function(_0x2de4b4){var _0x48fe2f=this;return new Promise(function(_0xd6ed4a,_0x4d5da1){return db[_0xba33('0x18')][_0xba33('0x19')](_0x2de4b4[_0xba33('0x1a')],{'raw':_0x2de4b4['options']?_0x2de4b4['options'][_0xba33('0x1b')]===undefined?!![]:![]:!![]})[_0xba33('0xc')](function(_0x114244){logger[_0xba33('0x14')](_0xba33('0x17'),_0x2de4b4);logger[_0xba33('0xf')]('CreateVoiceAgentReport',_0x2de4b4,JSON['stringify'](_0x114244));_0xd6ed4a(_0x114244);})[_0xba33('0x16')](function(_0x14f24d){logger[_0xba33('0x12')](_0xba33('0x17'),_0x14f24d[_0xba33('0x13')],_0x2de4b4);_0x4d5da1(_0x48fe2f[_0xba33('0x12')](0x1f4,_0x14f24d[_0xba33('0x13')]));});});};exports[_0xba33('0x1c')]=function(_0x1a7a4b){var _0x3baae6=this;return new Promise(function(_0x4e38c9,_0x2e884a){return db[_0xba33('0x18')]['update'](_0x1a7a4b[_0xba33('0x1a')],{'raw':_0x1a7a4b['options']?_0x1a7a4b[_0xba33('0x1d')][_0xba33('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7a4b['options']?_0x1a7a4b[_0xba33('0x1d')][_0xba33('0x1e')]||null:null,'attributes':_0x1a7a4b['options']?_0x1a7a4b[_0xba33('0x1d')][_0xba33('0x1f')]||null:null,'limit':_0x1a7a4b['options']?_0x1a7a4b['options']['limit']||null:null})[_0xba33('0xc')](function(_0x577afc){logger[_0xba33('0x14')](_0xba33('0x1c'),_0x1a7a4b);logger['debug'](_0xba33('0x1c'),_0x1a7a4b,JSON[_0xba33('0x11')](_0x577afc));_0x4e38c9(_0x577afc);})['catch'](function(_0x464fd5){logger[_0xba33('0x12')](_0xba33('0x1c'),_0x464fd5[_0xba33('0x13')],_0x1a7a4b);_0x2e884a(_0x3baae6[_0xba33('0x12')](0x1f4,_0x464fd5[_0xba33('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index fbdc23e..27868de 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 _0x5292=['../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','/describe','/:id','show','post','isAuthenticated','create','put','update','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x3fd20c,_0x287787){var _0x11c8c7=function(_0x2e776b){while(--_0x2e776b){_0x3fd20c['push'](_0x3fd20c['shift']());}};_0x11c8c7(++_0x287787);}(_0x5292,0xf7));var _0x2529=function(_0x56e2ed,_0x1c4781){_0x56e2ed=_0x56e2ed-0x0;var _0x5237b2=_0x5292[_0x56e2ed];return _0x5237b2;};'use strict';var multer=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var path=require('path');var timeout=require(_0x2529('0x2'));var express=require('express');var router=express[_0x2529('0x3')]();var fs_extra=require(_0x2529('0x4'));var auth=require(_0x2529('0x5'));var interaction=require(_0x2529('0x6'));var config=require('../../config/environment');var controller=require(_0x2529('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2529('0x8')](_0x2529('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x2529('0x8')](_0x2529('0xa'),auth['isAuthenticated'](),controller[_0x2529('0xb')]);router[_0x2529('0xc')]('/',auth[_0x2529('0xd')](),controller[_0x2529('0xe')]);router[_0x2529('0xf')](_0x2529('0xa'),auth[_0x2529('0xd')](),controller[_0x2529('0x10')]);router['delete'](_0x2529('0xa'),auth[_0x2529('0xd')](),controller['destroy']);module[_0x2529('0x11')]=router; \ No newline at end of file +var _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x3e3737,_0x2bf85d){var _0x5a0f97=function(_0x3bd15d){while(--_0x3bd15d){_0x3e3737['push'](_0x3e3737['shift']());}};_0x5a0f97(++_0x2bf85d);}(_0x4bc3,0x16e));var _0x34bc=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4bc3[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index d2de833..6bad8d1 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 _0xc936=['ENUM','inbound','internal','inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER','exports'];(function(_0x45416d,_0x1f42bf){var _0x4d8666=function(_0x28e8a4){while(--_0x28e8a4){_0x45416d['push'](_0x45416d['shift']());}};_0x4d8666(++_0x1f42bf);}(_0xc936,0x153));var _0x6c93=function(_0x542e3c,_0x867b7d){_0x542e3c=_0x542e3c-0x0;var _0x8e8f2d=_0xc936[_0x542e3c];return _0x8e8f2d;};'use strict';var Sequelize=require('sequelize');module[_0x6c93('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6c93('0x1')](_0x6c93('0x2'),_0x6c93('0x3'),'outbound',_0x6c93('0x4'),_0x6c93('0x5'),'dialer')},'tag':{'type':Sequelize[_0x6c93('0x6')]},'accountcode':{'type':Sequelize[_0x6c93('0x6')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x6c93('0x6')]},'callerid':{'type':Sequelize[_0x6c93('0x6')]},'channel':{'type':Sequelize[_0x6c93('0x6')]},'destinationchannel':{'type':Sequelize[_0x6c93('0x6')]},'lastapplication':{'type':Sequelize[_0x6c93('0x6')]},'lastdata':{'type':Sequelize[_0x6c93('0x7')]},'starttime':{'type':Sequelize[_0x6c93('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6c93('0x8')]},'endtime':{'type':Sequelize[_0x6c93('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x6c93('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6c93('0x6')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6c93('0x6')]},'userDisposition':{'type':Sequelize[_0x6c93('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x6c93('0x6')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x6c93('0x6')]},'routeid':{'type':Sequelize[_0x6c93('0x9')]},'sipcallid':{'type':Sequelize[_0x6c93('0x6')]}}; \ No newline at end of file +var _0x9173=['inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','outbound'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x9173,0x7e));var _0x3917=function(_0x2a7202,_0x1b57ed){_0x2a7202=_0x2a7202-0x0;var _0x4a6394=_0x9173[_0x2a7202];return _0x4a6394;};'use strict';var Sequelize=require(_0x3917('0x0'));module[_0x3917('0x1')]={'uniqueid':{'type':Sequelize[_0x3917('0x2')]},'type':{'type':Sequelize[_0x3917('0x3')](_0x3917('0x4'),'internal',_0x3917('0x5'),_0x3917('0x6'),'outbound-fax',_0x3917('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3917('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x3917('0x2')]},'destinationcontext':{'type':Sequelize[_0x3917('0x2')]},'callerid':{'type':Sequelize[_0x3917('0x2')]},'channel':{'type':Sequelize[_0x3917('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x3917('0x2')]},'lastdata':{'type':Sequelize[_0x3917('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x3917('0x9')]},'answertime':{'type':Sequelize[_0x3917('0x9')]},'endtime':{'type':Sequelize[_0x3917('0x9')]},'duration':{'type':Sequelize[_0x3917('0xa')]},'billableseconds':{'type':Sequelize[_0x3917('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3917('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x3917('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3917('0x2')]},'prefix':{'type':Sequelize[_0x3917('0x2')]},'routeid':{'type':Sequelize[_0x3917('0xa')]},'sipcallid':{'type':Sequelize[_0x3917('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b197aa4..1ff4142 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5365fc,_0x4960d9){_0x5365fc=_0x5365fc-0x0;var _0x561309=_0x2032[_0x5365fc];return _0x561309;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5adcee,_0xfdda97){_0x5adcee=_0x5adcee-0x0;var _0x1beaa3=_0x5f2f[_0x5adcee];return _0x1beaa3;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 0531ef5..c79a399 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 _0x3ef3=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid'];(function(_0x3dfb9f,_0x1e7285){var _0x2d452b=function(_0x2055e2){while(--_0x2055e2){_0x3dfb9f['push'](_0x3dfb9f['shift']());}};_0x2d452b(++_0x1e7285);}(_0x3ef3,0x1ee));var _0x33ef=function(_0x468dd3,_0x10ab45){_0x468dd3=_0x468dd3-0x0;var _0x44bea8=_0x3ef3[_0x468dd3];return _0x44bea8;};'use strict';var _=require(_0x33ef('0x0'));var util=require(_0x33ef('0x1'));var logger=require(_0x33ef('0x2'))('api');var moment=require(_0x33ef('0x3'));var BPromise=require(_0x33ef('0x4'));var rp=require(_0x33ef('0x5'));var fs=require('fs');var path=require(_0x33ef('0x6'));var rimraf=require(_0x33ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x33ef('0x8'));module['exports']=function(_0x1a3ec2,_0xe5b9a0){return _0x1a3ec2[_0x33ef('0x9')](_0x33ef('0xa'),attributes,{'tableName':_0x33ef('0xb'),'paranoid':![],'indexes':[{'fields':[_0x33ef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0962=['lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid'];(function(_0x7ca8a2,_0x565d13){var _0x572603=function(_0x2939d3){while(--_0x2939d3){_0x7ca8a2['push'](_0x7ca8a2['shift']());}};_0x572603(++_0x565d13);}(_0x0962,0x198));var _0x2096=function(_0x5a436d,_0x1403d5){_0x5a436d=_0x5a436d-0x0;var _0x98389b=_0x0962[_0x5a436d];return _0x98389b;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var logger=require(_0x2096('0x2'))(_0x2096('0x3'));var moment=require('moment');var BPromise=require(_0x2096('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2096('0x5'));var config=require(_0x2096('0x6'));var attributes=require(_0x2096('0x7'));module[_0x2096('0x8')]=function(_0x1ce10d,_0x462564){return _0x1ce10d[_0x2096('0x9')](_0x2096('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x2096('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d07a1ea..ec8ded2 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 _0xde2b=['request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceCallReport,\x20%s,\x20%s','result','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','model','map','then','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xde2b,0x131));var _0xbde2=function(_0x594e61,_0x4e9cc4){_0x594e61=_0x594e61-0x0;var _0xc8477f=_0xde2b[_0x594e61];return _0xc8477f;};'use strict';var _=require(_0xbde2('0x0'));var util=require(_0xbde2('0x1'));var moment=require(_0xbde2('0x2'));var BPromise=require(_0xbde2('0x3'));var rs=require(_0xbde2('0x4'));var fs=require('fs');var Redis=require(_0xbde2('0x5'));var db=require(_0xbde2('0x6'))['db'];var utils=require(_0xbde2('0x7'));var logger=require(_0xbde2('0x8'))('rpc');var config=require(_0xbde2('0x9'));var jayson=require(_0xbde2('0xa'));var client=jayson[_0xbde2('0xb')][_0xbde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24f888,_0x5dc6af,_0xc00f8a){return new BPromise(function(_0x2f521d,_0x18716b){return client[_0xbde2('0xd')](_0x24f888,_0xc00f8a)['then'](function(_0x1e4426){logger[_0xbde2('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x5dc6af,_0xbde2('0xf'));logger[_0xbde2('0x10')](_0xbde2('0x11'),_0x5dc6af,_0xbde2('0xf'),JSON[_0xbde2('0x12')](_0x1e4426));if(_0x1e4426['error']){if(_0x1e4426[_0xbde2('0x13')]['code']===0x1f4){logger[_0xbde2('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x5dc6af,_0x1e4426[_0xbde2('0x13')][_0xbde2('0x14')]);return _0x18716b(_0x1e4426['error'][_0xbde2('0x14')]);}logger[_0xbde2('0x13')](_0xbde2('0x15'),_0x5dc6af,_0x1e4426[_0xbde2('0x13')][_0xbde2('0x14')]);return _0x2f521d(_0x1e4426[_0xbde2('0x13')]['message']);}else{logger[_0xbde2('0xe')](_0xbde2('0x15'),_0x5dc6af,'request\x20sent');_0x2f521d(_0x1e4426[_0xbde2('0x16')][_0xbde2('0x14')]);}})[_0xbde2('0x17')](function(_0x3e837f){logger[_0xbde2('0x13')](_0xbde2('0x15'),_0x5dc6af,_0x3e837f);_0x18716b(_0x3e837f);});});}exports['GetVoiceCallReport']=function(_0x1f2b6e){var _0x19b07c=this;return new Promise(function(_0x148f2d,_0x347427){return db[_0xbde2('0x18')][_0xbde2('0x19')]({'raw':_0x1f2b6e[_0xbde2('0x1a')]?_0x1f2b6e[_0xbde2('0x1a')][_0xbde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f2b6e[_0xbde2('0x1a')]?_0x1f2b6e[_0xbde2('0x1a')][_0xbde2('0x1c')]||null:null,'attributes':_0x1f2b6e[_0xbde2('0x1a')]?_0x1f2b6e[_0xbde2('0x1a')][_0xbde2('0x1d')]||null:null,'limit':_0x1f2b6e[_0xbde2('0x1a')]?_0x1f2b6e[_0xbde2('0x1a')][_0xbde2('0x1e')]||null:null,'include':_0x1f2b6e[_0xbde2('0x1a')]?_0x1f2b6e['options'][_0xbde2('0x1f')]?_['map'](_0x1f2b6e['options']['include'],function(_0xf008c7){return{'model':db[_0xf008c7[_0xbde2('0x20')]],'as':_0xf008c7['as'],'attributes':_0xf008c7[_0xbde2('0x1d')],'include':_0xf008c7[_0xbde2('0x1f')]?_[_0xbde2('0x21')](_0xf008c7[_0xbde2('0x1f')],function(_0x5b0c8e){return{'model':db[_0x5b0c8e[_0xbde2('0x20')]],'as':_0x5b0c8e['as'],'attributes':_0x5b0c8e[_0xbde2('0x1d')],'include':_0x5b0c8e[_0xbde2('0x1f')]?_[_0xbde2('0x21')](_0x5b0c8e[_0xbde2('0x1f')],function(_0x1f902d){return{'model':db[_0x1f902d[_0xbde2('0x20')]],'as':_0x1f902d['as'],'attributes':_0x1f902d[_0xbde2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbde2('0x22')](function(_0x1c190e){logger[_0xbde2('0xe')](_0xbde2('0x23'),_0x1f2b6e);logger[_0xbde2('0x10')](_0xbde2('0x23'),_0x1f2b6e,JSON[_0xbde2('0x12')](_0x1c190e));_0x148f2d(_0x1c190e);})[_0xbde2('0x17')](function(_0x3cb8ac){logger['error']('GetVoiceCallReport',_0x3cb8ac[_0xbde2('0x14')],_0x1f2b6e);_0x347427(_0x19b07c[_0xbde2('0x13')](0x1f4,_0x3cb8ac[_0xbde2('0x14')]));});});};exports[_0xbde2('0x24')]=function(_0x32161b){var _0x4ad9bf=this;return new Promise(function(_0x4b60c3,_0x1fc403){return db[_0xbde2('0x18')][_0xbde2('0x25')](_0x32161b[_0xbde2('0x26')],{'raw':_0x32161b[_0xbde2('0x1a')]?_0x32161b[_0xbde2('0x1a')][_0xbde2('0x1b')]===undefined?!![]:![]:!![]})[_0xbde2('0x22')](function(_0x2df53e){logger['info'](_0xbde2('0x24'),_0x32161b);logger[_0xbde2('0x10')](_0xbde2('0x24'),_0x32161b,JSON[_0xbde2('0x12')](_0x2df53e));_0x4b60c3(_0x2df53e);})[_0xbde2('0x17')](function(_0x170403){logger['error'](_0xbde2('0x24'),_0x170403[_0xbde2('0x14')],_0x32161b);_0x1fc403(_0x4ad9bf['error'](0x1f4,_0x170403['message']));});});};exports[_0xbde2('0x27')]=function(_0x215e2d){var _0x4f997c=this;return new Promise(function(_0x349e7a,_0x43120e){return db[_0xbde2('0x18')]['update'](_0x215e2d[_0xbde2('0x26')],{'raw':_0x215e2d[_0xbde2('0x1a')]?_0x215e2d[_0xbde2('0x1a')][_0xbde2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x215e2d[_0xbde2('0x1a')]?_0x215e2d[_0xbde2('0x1a')][_0xbde2('0x1c')]||null:null,'attributes':_0x215e2d[_0xbde2('0x1a')]?_0x215e2d[_0xbde2('0x1a')][_0xbde2('0x1d')]||null:null,'limit':_0x215e2d['options']?_0x215e2d[_0xbde2('0x1a')][_0xbde2('0x1e')]||null:null})[_0xbde2('0x22')](function(_0x4cc83f){logger[_0xbde2('0xe')](_0xbde2('0x27'),_0x215e2d);logger[_0xbde2('0x10')](_0xbde2('0x27'),_0x215e2d,JSON[_0xbde2('0x12')](_0x4cc83f));_0x349e7a(_0x4cc83f);})[_0xbde2('0x17')](function(_0x1825a3){logger['error'](_0xbde2('0x27'),_0x1825a3['message'],_0x215e2d);_0x43120e(_0x4f997c[_0xbde2('0x13')](0x1f4,_0x1825a3[_0xbde2('0x14')]));});});}; \ No newline at end of file +var _0x126c=['request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','model','include','CreateVoiceCallReport','create','info','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','VoiceCallReport,\x20%s,\x20%s','debug'];(function(_0x125071,_0x489596){var _0x4b6523=function(_0x2776df){while(--_0x2776df){_0x125071['push'](_0x125071['shift']());}};_0x4b6523(++_0x489596);}(_0x126c,0xed));var _0xc126=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x126c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc126('0x0'));var util=require(_0xc126('0x1'));var moment=require(_0xc126('0x2'));var BPromise=require(_0xc126('0x3'));var rs=require(_0xc126('0x4'));var fs=require('fs');var Redis=require(_0xc126('0x5'));var db=require(_0xc126('0x6'))['db'];var utils=require(_0xc126('0x7'));var logger=require('../../config/logger')(_0xc126('0x8'));var config=require(_0xc126('0x9'));var jayson=require(_0xc126('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f91bb,_0x1e15b8,_0xc12d50){return new BPromise(function(_0x5c7486,_0x4947e2){return client[_0xc126('0xb')](_0x2f91bb,_0xc12d50)[_0xc126('0xc')](function(_0x5dda7e){logger['info'](_0xc126('0xd'),_0x1e15b8,'request\x20sent');logger[_0xc126('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1e15b8,_0xc126('0xf'),JSON[_0xc126('0x10')](_0x5dda7e));if(_0x5dda7e[_0xc126('0x11')]){if(_0x5dda7e['error']['code']===0x1f4){logger[_0xc126('0x11')](_0xc126('0xd'),_0x1e15b8,_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);return _0x4947e2(_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);}logger[_0xc126('0x11')](_0xc126('0xd'),_0x1e15b8,_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);return _0x5c7486(_0x5dda7e[_0xc126('0x11')][_0xc126('0x12')]);}else{logger['info'](_0xc126('0xd'),_0x1e15b8,'request\x20sent');_0x5c7486(_0x5dda7e[_0xc126('0x13')]['message']);}})[_0xc126('0x14')](function(_0x37a5a1){logger[_0xc126('0x11')](_0xc126('0xd'),_0x1e15b8,_0x37a5a1);_0x4947e2(_0x37a5a1);});});}exports[_0xc126('0x15')]=function(_0x57bc4d){var _0x3cf7dd=this;return new Promise(function(_0x5ed307,_0x12bd6c){return db[_0xc126('0x16')][_0xc126('0x17')]({'raw':_0x57bc4d['options']?_0x57bc4d[_0xc126('0x18')][_0xc126('0x19')]===undefined?!![]:![]:!![],'where':_0x57bc4d['options']?_0x57bc4d[_0xc126('0x18')][_0xc126('0x1a')]||null:null,'attributes':_0x57bc4d['options']?_0x57bc4d['options'][_0xc126('0x1b')]||null:null,'limit':_0x57bc4d['options']?_0x57bc4d['options'][_0xc126('0x1c')]||null:null,'include':_0x57bc4d['options']?_0x57bc4d[_0xc126('0x18')]['include']?_[_0xc126('0x1d')](_0x57bc4d[_0xc126('0x18')]['include'],function(_0x6f90e6){return{'model':db[_0x6f90e6[_0xc126('0x1e')]],'as':_0x6f90e6['as'],'attributes':_0x6f90e6['attributes'],'include':_0x6f90e6[_0xc126('0x1f')]?_['map'](_0x6f90e6[_0xc126('0x1f')],function(_0x1dfd42){return{'model':db[_0x1dfd42[_0xc126('0x1e')]],'as':_0x1dfd42['as'],'attributes':_0x1dfd42[_0xc126('0x1b')],'include':_0x1dfd42[_0xc126('0x1f')]?_['map'](_0x1dfd42[_0xc126('0x1f')],function(_0x284884){return{'model':db[_0x284884[_0xc126('0x1e')]],'as':_0x284884['as'],'attributes':_0x284884[_0xc126('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x523b1d){logger['info'](_0xc126('0x15'),_0x57bc4d);logger[_0xc126('0xe')](_0xc126('0x15'),_0x57bc4d,JSON['stringify'](_0x523b1d));_0x5ed307(_0x523b1d);})['catch'](function(_0x4bd454){logger[_0xc126('0x11')]('GetVoiceCallReport',_0x4bd454[_0xc126('0x12')],_0x57bc4d);_0x12bd6c(_0x3cf7dd[_0xc126('0x11')](0x1f4,_0x4bd454[_0xc126('0x12')]));});});};exports[_0xc126('0x20')]=function(_0x352142){var _0x19be0a=this;return new Promise(function(_0x4d9320,_0x5d0ac0){return db[_0xc126('0x16')][_0xc126('0x21')](_0x352142['body'],{'raw':_0x352142[_0xc126('0x18')]?_0x352142[_0xc126('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc126('0xc')](function(_0x3a9684){logger[_0xc126('0x22')](_0xc126('0x20'),_0x352142);logger[_0xc126('0xe')](_0xc126('0x20'),_0x352142,JSON['stringify'](_0x3a9684));_0x4d9320(_0x3a9684);})[_0xc126('0x14')](function(_0x83b160){logger[_0xc126('0x11')]('CreateVoiceCallReport',_0x83b160[_0xc126('0x12')],_0x352142);_0x5d0ac0(_0x19be0a['error'](0x1f4,_0x83b160[_0xc126('0x12')]));});});};exports[_0xc126('0x23')]=function(_0x5f477b){var _0x1c37a5=this;return new Promise(function(_0x351732,_0x2564c4){return db[_0xc126('0x16')]['update'](_0x5f477b['body'],{'raw':_0x5f477b[_0xc126('0x18')]?_0x5f477b[_0xc126('0x18')][_0xc126('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f477b['options']?_0x5f477b[_0xc126('0x18')][_0xc126('0x1a')]||null:null,'attributes':_0x5f477b[_0xc126('0x18')]?_0x5f477b['options'][_0xc126('0x1b')]||null:null,'limit':_0x5f477b[_0xc126('0x18')]?_0x5f477b[_0xc126('0x18')]['limit']||null:null})[_0xc126('0xc')](function(_0x5c56f2){logger[_0xc126('0x22')](_0xc126('0x23'),_0x5f477b);logger[_0xc126('0xe')](_0xc126('0x23'),_0x5f477b,JSON[_0xc126('0x10')](_0x5c56f2));_0x351732(_0x5c56f2);})[_0xc126('0x14')](function(_0xc20e02){logger[_0xc126('0x11')](_0xc126('0x23'),_0xc20e02[_0xc126('0x12')],_0x5f477b);_0x2564c4(_0x1c37a5[_0xc126('0x11')](0x1f4,_0xc20e02[_0xc126('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 6a54fc0..171a486 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 _0x92ce=['post','create','put','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5e3182,_0x235c34){var _0x165446=function(_0x40980a){while(--_0x40980a){_0x5e3182['push'](_0x5e3182['shift']());}};_0x165446(++_0x235c34);}(_0x92ce,0x15a));var _0xe92c=function(_0x4328f5,_0x5b5330){_0x4328f5=_0x4328f5-0x0;var _0x5e2af8=_0x92ce[_0x4328f5];return _0x5e2af8;};'use strict';var multer=require(_0xe92c('0x0'));var util=require(_0xe92c('0x1'));var path=require(_0xe92c('0x2'));var timeout=require(_0xe92c('0x3'));var express=require(_0xe92c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe92c('0x5'));var interaction=require(_0xe92c('0x6'));var config=require(_0xe92c('0x7'));var controller=require(_0xe92c('0x8'));router[_0xe92c('0x9')]('/',auth[_0xe92c('0xa')](),controller[_0xe92c('0xb')]);router[_0xe92c('0x9')](_0xe92c('0xc'),auth[_0xe92c('0xa')](),controller[_0xe92c('0xd')]);router[_0xe92c('0xe')]('/',auth['isAuthenticated'](),controller[_0xe92c('0xf')]);router[_0xe92c('0x10')](_0xe92c('0xc'),auth[_0xe92c('0xa')](),controller['update']);router['delete']('/:id',auth[_0xe92c('0xa')](),controller[_0xe92c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8913=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','index','get','show','post','isAuthenticated','create','put','/:id','update'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x8913,0x7f));var _0x3891=function(_0x4e227b,_0x560195){_0x4e227b=_0x4e227b-0x0;var _0x584427=_0x8913[_0x4e227b];return _0x584427;};'use strict';var multer=require(_0x3891('0x0'));var util=require('util');var path=require(_0x3891('0x1'));var timeout=require(_0x3891('0x2'));var express=require(_0x3891('0x3'));var router=express[_0x3891('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3891('0x5'));var interaction=require(_0x3891('0x6'));var config=require('../../config/environment');var controller=require(_0x3891('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3891('0x8')]);router[_0x3891('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3891('0xa')]);router[_0x3891('0xb')]('/',auth[_0x3891('0xc')](),controller[_0x3891('0xd')]);router[_0x3891('0xe')](_0x3891('0xf'),auth[_0x3891('0xc')](),controller[_0x3891('0x10')]);router['delete'](_0x3891('0xf'),auth[_0x3891('0xc')](),controller['destroy']);module[_0x3891('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 49f978b..e6ab757 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 _0x3adb=['getDataValue','BOOLEAN','sequelize','STRING','name','setDataValue','options','join'];(function(_0x4ed1ba,_0x437960){var _0x2cc328=function(_0x17b6b3){while(--_0x17b6b3){_0x4ed1ba['push'](_0x4ed1ba['shift']());}};_0x2cc328(++_0x437960);}(_0x3adb,0x11a));var _0xb3ad=function(_0x129dbb,_0x374fe7){_0x129dbb=_0x129dbb-0x0;var _0xeb546e=_0x3adb[_0x129dbb];return _0xeb546e;};'use strict';var Sequelize=require(_0xb3ad('0x0'));module['exports']={'name':{'type':Sequelize[_0xb3ad('0x1')]},'prefix':{'type':Sequelize[_0xb3ad('0x1')],'unique':_0xb3ad('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xb3ad('0x1')],'set':function(_0xca3e29){this[_0xb3ad('0x3')](_0xb3ad('0x4'),_0xca3e29?_0xca3e29[_0xb3ad('0x5')](''):[]);},'get':function(){return this[_0xb3ad('0x6')](_0xb3ad('0x4'))?this['getDataValue'](_0xb3ad('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xb3ad('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xb3ad('0x1')]},'record':{'type':Sequelize[_0xb3ad('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x37a4=['name','getDataValue','options','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x54c608,_0x2e25ba){var _0x14aed7=function(_0x2f7095){while(--_0x2f7095){_0x54c608['push'](_0x54c608['shift']());}};_0x14aed7(++_0x2e25ba);}(_0x37a4,0x13d));var _0x437a=function(_0x27d967,_0x5e429d){_0x27d967=_0x27d967-0x0;var _0x7d38c3=_0x37a4[_0x27d967];return _0x7d38c3;};'use strict';var Sequelize=require(_0x437a('0x0'));module[_0x437a('0x1')]={'name':{'type':Sequelize[_0x437a('0x2')]},'prefix':{'type':Sequelize[_0x437a('0x2')],'unique':_0x437a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x437a('0x2')],'set':function(_0x289a0d){this['setDataValue']('options',_0x289a0d?_0x289a0d['join'](''):[]);},'get':function(){return this[_0x437a('0x4')](_0x437a('0x5'))?this[_0x437a('0x4')]('options')[_0x437a('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x437a('0x2')]},'record':{'type':Sequelize[_0x437a('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 19d1c25..06dc865 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 _0x2392=['update','then','destroy','get','ChanSpies','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','catch','params','keys','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply'];(function(_0x44bf67,_0x2dccf4){var _0x1e01e2=function(_0x59bc3a){while(--_0x59bc3a){_0x44bf67['push'](_0x44bf67['shift']());}};_0x1e01e2(++_0x2dccf4);}(_0x2392,0xd0));var _0x2239=function(_0x314240,_0xb5b5cc){_0x314240=_0x314240-0x0;var _0x87cfef=_0x2392[_0x314240];return _0x87cfef;};'use strict';var emlformat=require(_0x2239('0x0'));var rimraf=require(_0x2239('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2239('0x2'));var rp=require(_0x2239('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2239('0x4'));var util=require(_0x2239('0x5'));var path=require(_0x2239('0x6'));var sox=require(_0x2239('0x7'));var csv=require(_0x2239('0x8'));var ejs=require(_0x2239('0x9'));var fs=require('fs');var fs_extra=require(_0x2239('0xa'));var _=require(_0x2239('0xb'));var squel=require(_0x2239('0xc'));var crypto=require(_0x2239('0xd'));var jsforce=require(_0x2239('0xe'));var deskjs=require(_0x2239('0xf'));var toCsv=require(_0x2239('0x8'));var querystring=require('querystring');var Papa=require(_0x2239('0x10'));var Redis=require(_0x2239('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2239('0x12'));var hardwareService=require(_0x2239('0x13'));var logger=require(_0x2239('0x14'))(_0x2239('0x15'));var utils=require(_0x2239('0x16'));var config=require(_0x2239('0x17'));var licenseUtil=require(_0x2239('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4702dd,_0x3cee95){_0x3cee95=_0x3cee95||0xcc;return function(_0x4af7b7){if(_0x4af7b7){return _0x4702dd[_0x2239('0x19')](_0x3cee95);}return _0x4702dd[_0x2239('0x1a')](_0x3cee95)[_0x2239('0x1b')]();};}function respondWithResult(_0x3338b0,_0x5165dc){_0x5165dc=_0x5165dc||0xc8;return function(_0x367c82){if(_0x367c82){return _0x3338b0['status'](_0x5165dc)[_0x2239('0x1c')](_0x367c82);}};}function respondWithFilteredResult(_0x163e09,_0x4236da){return function(_0x472ce2){if(_0x472ce2){var _0x4f23ce=typeof _0x4236da[_0x2239('0x1d')]===_0x2239('0x1e')&&typeof _0x4236da['limit']===_0x2239('0x1e');var _0x4f218a=_0x472ce2[_0x2239('0x1f')];var _0x558138=_0x4f23ce?0x0:_0x4236da[_0x2239('0x1d')];var _0x594f20=_0x4f23ce?_0x472ce2[_0x2239('0x1f')]:_0x4236da[_0x2239('0x1d')]+_0x4236da[_0x2239('0x20')];var _0x3d8fd9;if(_0x594f20>=_0x4f218a){_0x594f20=_0x4f218a;_0x3d8fd9=0xc8;}else{_0x3d8fd9=0xce;}_0x163e09['status'](_0x3d8fd9);return _0x163e09[_0x2239('0x21')]('Content-Range',_0x558138+'-'+_0x594f20+'/'+_0x4f218a)[_0x2239('0x1c')](_0x472ce2);}return null;};}function patchUpdates(_0x4917cb){return function(_0x174bf7){try{jsonpatch[_0x2239('0x22')](_0x174bf7,_0x4917cb,!![]);}catch(_0x2c2d74){return BPromise['reject'](_0x2c2d74);}return _0x174bf7['save']();};}function saveUpdates(_0x2b2000,_0x521079){return function(_0x2f625d){if(_0x2f625d){return _0x2f625d[_0x2239('0x23')](_0x2b2000)[_0x2239('0x24')](function(_0x407581){return _0x407581;});}return null;};}function removeEntity(_0x54af84,_0x1f1f49){return function(_0x12133e){if(_0x12133e){return _0x12133e[_0x2239('0x25')]()[_0x2239('0x24')](function(){var _0x5c0fa7=_0x12133e[_0x2239('0x26')]({'plain':!![]});var _0x44e671=_0x2239('0x27');return db['UserProfileResource'][_0x2239('0x25')]({'where':{'type':_0x44e671,'resourceId':_0x5c0fa7['id']}})[_0x2239('0x24')](function(){return _0x12133e;});})[_0x2239('0x24')](function(){_0x54af84[_0x2239('0x1a')](0xcc)[_0x2239('0x1b')]();});}};}function handleEntityNotFound(_0x1937ee,_0xcb6711){return function(_0x4f4135){if(!_0x4f4135){_0x1937ee['sendStatus'](0x194);}return _0x4f4135;};}function handleError(_0x4a970a,_0x587ebc){_0x587ebc=_0x587ebc||0x1f4;return function(_0x576ac9){logger[_0x2239('0x28')](_0x576ac9[_0x2239('0x29')]);if(_0x576ac9[_0x2239('0x2a')]){delete _0x576ac9[_0x2239('0x2a')];}_0x4a970a['status'](_0x587ebc)[_0x2239('0x2b')](_0x576ac9);};}exports[_0x2239('0x2c')]=function(_0x3e164a,_0x23fab8){var _0xbf989f={},_0xac6fe8={},_0x26f3f2={'count':0x0,'rows':[]};var _0x5a9cdf=_[_0x2239('0x2d')](db[_0x2239('0x2e')][_0x2239('0x2f')],function(_0x3cc74c){return{'name':_0x3cc74c[_0x2239('0x30')],'type':_0x3cc74c['type'][_0x2239('0x31')]};});_0xac6fe8[_0x2239('0x32')]=_['map'](_0x5a9cdf,'name');_0xac6fe8['query']=_['keys'](_0x3e164a['query']);_0xac6fe8[_0x2239('0x33')]=_[_0x2239('0x34')](_0xac6fe8[_0x2239('0x32')],_0xac6fe8[_0x2239('0x35')]);_0xbf989f[_0x2239('0x36')]=_['intersection'](_0xac6fe8[_0x2239('0x32')],qs[_0x2239('0x37')](_0x3e164a[_0x2239('0x35')]['fields']));_0xbf989f[_0x2239('0x36')]=_0xbf989f[_0x2239('0x36')][_0x2239('0x38')]?_0xbf989f['attributes']:_0xac6fe8['model'];if(!_0x3e164a['query'][_0x2239('0x39')](_0x2239('0x3a'))){_0xbf989f[_0x2239('0x20')]=qs['limit'](_0x3e164a['query'][_0x2239('0x20')]);_0xbf989f['offset']=qs[_0x2239('0x1d')](_0x3e164a[_0x2239('0x35')][_0x2239('0x1d')]);}_0xbf989f[_0x2239('0x3b')]=qs['sort'](_0x3e164a[_0x2239('0x35')][_0x2239('0x3c')]);_0xbf989f[_0x2239('0x3d')]=qs[_0x2239('0x33')](_[_0x2239('0x3e')](_0x3e164a[_0x2239('0x35')],_0xac6fe8[_0x2239('0x33')]),_0x5a9cdf);if(_0x3e164a[_0x2239('0x35')]['filter']){_0xbf989f[_0x2239('0x3d')]=_[_0x2239('0x3f')](_0xbf989f[_0x2239('0x3d')],{'$or':_[_0x2239('0x2d')](_0x5a9cdf,function(_0x45136b){if(_0x45136b[_0x2239('0x40')]!==_0x2239('0x41')){var _0x1c55ef={};_0x1c55ef[_0x45136b[_0x2239('0x2a')]]={'$like':'%'+_0x3e164a[_0x2239('0x35')]['filter']+'%'};return _0x1c55ef;}})});}_0xbf989f=_[_0x2239('0x3f')]({},_0xbf989f,_0x3e164a[_0x2239('0x42')]);var _0x16304d={'where':_0xbf989f[_0x2239('0x3d')]};return db['VoiceChanSpy']['count'](_0x16304d)[_0x2239('0x24')](function(_0x546862){_0x26f3f2[_0x2239('0x1f')]=_0x546862;if(_0x3e164a['query'][_0x2239('0x43')]){_0xbf989f[_0x2239('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0xbf989f);})['then'](function(_0x4242c2){_0x26f3f2['rows']=_0x4242c2;return _0x26f3f2;})[_0x2239('0x24')](respondWithFilteredResult(_0x23fab8,_0xbf989f))[_0x2239('0x45')](handleError(_0x23fab8,null));};exports['show']=function(_0x2a2a6a,_0x1f9aa1){var _0x153449={'raw':![],'where':{'id':_0x2a2a6a[_0x2239('0x46')]['id']}},_0x1f6288={};_0x1f6288[_0x2239('0x32')]=_[_0x2239('0x47')](db[_0x2239('0x2e')][_0x2239('0x2f')]);_0x1f6288['query']=_[_0x2239('0x47')](_0x2a2a6a['query']);_0x1f6288[_0x2239('0x33')]=_['intersection'](_0x1f6288[_0x2239('0x32')],_0x1f6288[_0x2239('0x35')]);_0x153449['attributes']=_[_0x2239('0x34')](_0x1f6288['model'],qs[_0x2239('0x37')](_0x2a2a6a[_0x2239('0x35')][_0x2239('0x37')]));_0x153449['attributes']=_0x153449['attributes']['length']?_0x153449[_0x2239('0x36')]:_0x1f6288[_0x2239('0x32')];if(_0x2a2a6a[_0x2239('0x35')][_0x2239('0x43')]){_0x153449[_0x2239('0x44')]=[{'all':!![]}];}_0x153449=_[_0x2239('0x3f')]({},_0x153449,_0x2a2a6a['options']);return db[_0x2239('0x2e')][_0x2239('0x48')](_0x153449)[_0x2239('0x24')](handleEntityNotFound(_0x1f9aa1,null))['then'](respondWithResult(_0x1f9aa1,null))[_0x2239('0x45')](handleError(_0x1f9aa1,null));};exports['create']=function(_0x4a9c3c,_0x410bc6){return db[_0x2239('0x2e')][_0x2239('0x49')](_0x4a9c3c[_0x2239('0x4a')],{})[_0x2239('0x24')](function(_0x51bcad){var _0xba071b=_0x4a9c3c[_0x2239('0x4b')]['get']({'plain':!![]});if(!_0xba071b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xba071b['role']===_0x2239('0x4b')){var _0x51f5d3=_0x51bcad[_0x2239('0x26')]({'plain':!![]});var _0x4b674b=_0x2239('0x27');return db[_0x2239('0x4c')][_0x2239('0x48')]({'where':{'name':_0x4b674b,'userProfileId':_0xba071b[_0x2239('0x4d')]},'raw':!![]})['then'](function(_0x509651){if(_0x509651&&_0x509651[_0x2239('0x4e')]===0x0){return db[_0x2239('0x4f')][_0x2239('0x49')]({'name':_0x51f5d3[_0x2239('0x2a')],'resourceId':_0x51f5d3['id'],'type':_0x509651[_0x2239('0x2a')],'sectionId':_0x509651['id']},{})['then'](function(){return _0x51bcad;});}else{return _0x51bcad;}})[_0x2239('0x45')](function(_0x430c56){logger[_0x2239('0x28')](_0x2239('0x50'),_0x430c56);throw _0x430c56;});}return _0x51bcad;})[_0x2239('0x24')](respondWithResult(_0x410bc6,0xc9))['catch'](handleError(_0x410bc6,null));};exports[_0x2239('0x23')]=function(_0x2286f6,_0x4bf50f){if(_0x2286f6[_0x2239('0x4a')]['id']){delete _0x2286f6[_0x2239('0x4a')]['id'];}return db['VoiceChanSpy'][_0x2239('0x48')]({'where':{'id':_0x2286f6[_0x2239('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bf50f,null))[_0x2239('0x24')](saveUpdates(_0x2286f6[_0x2239('0x4a')],null))['then'](respondWithResult(_0x4bf50f,null))[_0x2239('0x45')](handleError(_0x4bf50f,null));};exports[_0x2239('0x25')]=function(_0x3ef97,_0x1ffbb6){return db[_0x2239('0x2e')][_0x2239('0x48')]({'where':{'id':_0x3ef97[_0x2239('0x46')]['id']}})[_0x2239('0x24')](handleEntityNotFound(_0x1ffbb6,null))[_0x2239('0x24')](removeEntity(_0x1ffbb6,null))[_0x2239('0x45')](handleError(_0x1ffbb6,null));}; \ No newline at end of file +var _0x559a=['order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','get','ChanSpies','then','end','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xefd81c,_0x5b2089){var _0x19ec2b=function(_0x55d1e3){while(--_0x55d1e3){_0xefd81c['push'](_0xefd81c['shift']());}};_0x19ec2b(++_0x5b2089);}(_0x559a,0xb3));var _0xa559=function(_0x330617,_0x32444d){_0x330617=_0x330617-0x0;var _0x5cbe6c=_0x559a[_0x330617];return _0x5cbe6c;};'use strict';var emlformat=require(_0xa559('0x0'));var rimraf=require(_0xa559('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa559('0x2'));var rp=require(_0xa559('0x3'));var moment=require(_0xa559('0x4'));var BPromise=require(_0xa559('0x5'));var Mustache=require(_0xa559('0x6'));var util=require(_0xa559('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa559('0x8'));var ejs=require(_0xa559('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa559('0xa'));var squel=require(_0xa559('0xb'));var crypto=require('crypto');var jsforce=require(_0xa559('0xc'));var deskjs=require(_0xa559('0xd'));var toCsv=require(_0xa559('0x8'));var querystring=require(_0xa559('0xe'));var Papa=require('papaparse');var Redis=require(_0xa559('0xf'));var authService=require(_0xa559('0x10'));var qs=require(_0xa559('0x11'));var as=require(_0xa559('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa559('0x13'));var utils=require(_0xa559('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa559('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442e26,_0x5f0463){_0x5f0463=_0x5f0463||0xcc;return function(_0x2a646e){if(_0x2a646e){return _0x442e26[_0xa559('0x16')](_0x5f0463);}return _0x442e26[_0xa559('0x17')](_0x5f0463)['end']();};}function respondWithResult(_0xe93c61,_0x3853fd){_0x3853fd=_0x3853fd||0xc8;return function(_0x5ed915){if(_0x5ed915){return _0xe93c61[_0xa559('0x17')](_0x3853fd)[_0xa559('0x18')](_0x5ed915);}};}function respondWithFilteredResult(_0x369d26,_0x1e48b3){return function(_0x539a4b){if(_0x539a4b){var _0x309c27=typeof _0x1e48b3['offset']===_0xa559('0x19')&&typeof _0x1e48b3[_0xa559('0x1a')]==='undefined';var _0x2c6993=_0x539a4b[_0xa559('0x1b')];var _0x163405=_0x309c27?0x0:_0x1e48b3[_0xa559('0x1c')];var _0x1a4c42=_0x309c27?_0x539a4b[_0xa559('0x1b')]:_0x1e48b3[_0xa559('0x1c')]+_0x1e48b3[_0xa559('0x1a')];var _0x329d59;if(_0x1a4c42>=_0x2c6993){_0x1a4c42=_0x2c6993;_0x329d59=0xc8;}else{_0x329d59=0xce;}_0x369d26[_0xa559('0x17')](_0x329d59);return _0x369d26['set']('Content-Range',_0x163405+'-'+_0x1a4c42+'/'+_0x2c6993)[_0xa559('0x18')](_0x539a4b);}return null;};}function patchUpdates(_0x3aa532){return function(_0x47cb65){try{jsonpatch[_0xa559('0x1d')](_0x47cb65,_0x3aa532,!![]);}catch(_0x190a9e){return BPromise[_0xa559('0x1e')](_0x190a9e);}return _0x47cb65[_0xa559('0x1f')]();};}function saveUpdates(_0x1812ef,_0x2dd8cf){return function(_0x572046){if(_0x572046){return _0x572046[_0xa559('0x20')](_0x1812ef)['then'](function(_0x1d4370){return _0x1d4370;});}return null;};}function removeEntity(_0x396fe9,_0x314fef){return function(_0x487a60){if(_0x487a60){return _0x487a60[_0xa559('0x21')]()['then'](function(){var _0xad00b0=_0x487a60[_0xa559('0x22')]({'plain':!![]});var _0x5834c6=_0xa559('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x5834c6,'resourceId':_0xad00b0['id']}})[_0xa559('0x24')](function(){return _0x487a60;});})[_0xa559('0x24')](function(){_0x396fe9[_0xa559('0x17')](0xcc)[_0xa559('0x25')]();});}};}function handleEntityNotFound(_0x4311db,_0x16a1e3){return function(_0x31e24b){if(!_0x31e24b){_0x4311db[_0xa559('0x16')](0x194);}return _0x31e24b;};}function handleError(_0x48f385,_0x11a3d2){_0x11a3d2=_0x11a3d2||0x1f4;return function(_0x30a781){logger[_0xa559('0x26')](_0x30a781[_0xa559('0x27')]);if(_0x30a781['name']){delete _0x30a781[_0xa559('0x28')];}_0x48f385[_0xa559('0x17')](_0x11a3d2)[_0xa559('0x29')](_0x30a781);};}exports['index']=function(_0x854bd,_0x224a3a){var _0xd0481e={},_0x469a4e={},_0x15a3ed={'count':0x0,'rows':[]};var _0x189267=_[_0xa559('0x2a')](db[_0xa559('0x2b')][_0xa559('0x2c')],function(_0x5a9f8d){return{'name':_0x5a9f8d[_0xa559('0x2d')],'type':_0x5a9f8d[_0xa559('0x2e')][_0xa559('0x2f')]};});_0x469a4e[_0xa559('0x30')]=_['map'](_0x189267,_0xa559('0x28'));_0x469a4e['query']=_[_0xa559('0x31')](_0x854bd[_0xa559('0x32')]);_0x469a4e[_0xa559('0x33')]=_[_0xa559('0x34')](_0x469a4e[_0xa559('0x30')],_0x469a4e[_0xa559('0x32')]);_0xd0481e['attributes']=_[_0xa559('0x34')](_0x469a4e[_0xa559('0x30')],qs[_0xa559('0x35')](_0x854bd[_0xa559('0x32')][_0xa559('0x35')]));_0xd0481e[_0xa559('0x36')]=_0xd0481e[_0xa559('0x36')][_0xa559('0x37')]?_0xd0481e['attributes']:_0x469a4e[_0xa559('0x30')];if(!_0x854bd[_0xa559('0x32')][_0xa559('0x38')](_0xa559('0x39'))){_0xd0481e[_0xa559('0x1a')]=qs[_0xa559('0x1a')](_0x854bd[_0xa559('0x32')]['limit']);_0xd0481e[_0xa559('0x1c')]=qs[_0xa559('0x1c')](_0x854bd[_0xa559('0x32')][_0xa559('0x1c')]);}_0xd0481e[_0xa559('0x3a')]=qs[_0xa559('0x3b')](_0x854bd[_0xa559('0x32')][_0xa559('0x3b')]);_0xd0481e[_0xa559('0x3c')]=qs[_0xa559('0x33')](_[_0xa559('0x3d')](_0x854bd[_0xa559('0x32')],_0x469a4e[_0xa559('0x33')]),_0x189267);if(_0x854bd['query'][_0xa559('0x3e')]){_0xd0481e['where']=_[_0xa559('0x3f')](_0xd0481e['where'],{'$or':_[_0xa559('0x2a')](_0x189267,function(_0x4be2c9){if(_0x4be2c9[_0xa559('0x2e')]!==_0xa559('0x40')){var _0x1ba33c={};_0x1ba33c[_0x4be2c9[_0xa559('0x28')]]={'$like':'%'+_0x854bd[_0xa559('0x32')][_0xa559('0x3e')]+'%'};return _0x1ba33c;}})});}_0xd0481e=_[_0xa559('0x3f')]({},_0xd0481e,_0x854bd['options']);var _0x34caf4={'where':_0xd0481e[_0xa559('0x3c')]};return db[_0xa559('0x2b')][_0xa559('0x1b')](_0x34caf4)[_0xa559('0x24')](function(_0x278f31){_0x15a3ed['count']=_0x278f31;if(_0x854bd[_0xa559('0x32')][_0xa559('0x41')]){_0xd0481e[_0xa559('0x42')]=[{'all':!![]}];}return db[_0xa559('0x2b')]['findAll'](_0xd0481e);})[_0xa559('0x24')](function(_0x2af622){_0x15a3ed[_0xa559('0x43')]=_0x2af622;return _0x15a3ed;})[_0xa559('0x24')](respondWithFilteredResult(_0x224a3a,_0xd0481e))[_0xa559('0x44')](handleError(_0x224a3a,null));};exports['show']=function(_0xdd0241,_0x41ee5d){var _0xfea9db={'raw':![],'where':{'id':_0xdd0241[_0xa559('0x45')]['id']}},_0x105f94={};_0x105f94[_0xa559('0x30')]=_[_0xa559('0x31')](db['VoiceChanSpy'][_0xa559('0x2c')]);_0x105f94[_0xa559('0x32')]=_[_0xa559('0x31')](_0xdd0241[_0xa559('0x32')]);_0x105f94[_0xa559('0x33')]=_[_0xa559('0x34')](_0x105f94[_0xa559('0x30')],_0x105f94[_0xa559('0x32')]);_0xfea9db[_0xa559('0x36')]=_['intersection'](_0x105f94[_0xa559('0x30')],qs[_0xa559('0x35')](_0xdd0241[_0xa559('0x32')][_0xa559('0x35')]));_0xfea9db[_0xa559('0x36')]=_0xfea9db[_0xa559('0x36')][_0xa559('0x37')]?_0xfea9db['attributes']:_0x105f94[_0xa559('0x30')];if(_0xdd0241[_0xa559('0x32')][_0xa559('0x41')]){_0xfea9db[_0xa559('0x42')]=[{'all':!![]}];}_0xfea9db=_[_0xa559('0x3f')]({},_0xfea9db,_0xdd0241['options']);return db[_0xa559('0x2b')][_0xa559('0x46')](_0xfea9db)['then'](handleEntityNotFound(_0x41ee5d,null))[_0xa559('0x24')](respondWithResult(_0x41ee5d,null))[_0xa559('0x44')](handleError(_0x41ee5d,null));};exports['create']=function(_0x56a722,_0x140490){return db[_0xa559('0x2b')][_0xa559('0x47')](_0x56a722[_0xa559('0x48')],{})[_0xa559('0x24')](function(_0x166d1b){var _0x4f3eb7=_0x56a722[_0xa559('0x49')]['get']({'plain':!![]});if(!_0x4f3eb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f3eb7['role']===_0xa559('0x49')){var _0x2c200e=_0x166d1b[_0xa559('0x22')]({'plain':!![]});var _0xad03d0=_0xa559('0x23');return db[_0xa559('0x4a')][_0xa559('0x46')]({'where':{'name':_0xad03d0,'userProfileId':_0x4f3eb7[_0xa559('0x4b')]},'raw':!![]})[_0xa559('0x24')](function(_0x3ede86){if(_0x3ede86&&_0x3ede86[_0xa559('0x4c')]===0x0){return db[_0xa559('0x4d')][_0xa559('0x47')]({'name':_0x2c200e[_0xa559('0x28')],'resourceId':_0x2c200e['id'],'type':_0x3ede86[_0xa559('0x28')],'sectionId':_0x3ede86['id']},{})[_0xa559('0x24')](function(){return _0x166d1b;});}else{return _0x166d1b;}})[_0xa559('0x44')](function(_0x5da1aa){logger[_0xa559('0x26')](_0xa559('0x4e'),_0x5da1aa);throw _0x5da1aa;});}return _0x166d1b;})[_0xa559('0x24')](respondWithResult(_0x140490,0xc9))[_0xa559('0x44')](handleError(_0x140490,null));};exports[_0xa559('0x20')]=function(_0x3b0fdb,_0x39648c){if(_0x3b0fdb[_0xa559('0x48')]['id']){delete _0x3b0fdb['body']['id'];}return db[_0xa559('0x2b')][_0xa559('0x46')]({'where':{'id':_0x3b0fdb[_0xa559('0x45')]['id']}})['then'](handleEntityNotFound(_0x39648c,null))['then'](saveUpdates(_0x3b0fdb[_0xa559('0x48')],null))[_0xa559('0x24')](respondWithResult(_0x39648c,null))['catch'](handleError(_0x39648c,null));};exports[_0xa559('0x21')]=function(_0x103fba,_0x2c8e60){return db['VoiceChanSpy'][_0xa559('0x46')]({'where':{'id':_0x103fba[_0xa559('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c8e60,null))['then'](removeEntity(_0x2c8e60,null))['catch'](handleError(_0x2c8e60,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 0bac51c..aee7b35 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 _0xa937=['User','findAll','agent','catch','VoiceChanSpy','then','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','format','%s%s','prefix','push','merge','Set','record','MixMonitor','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','internal','concat'];(function(_0x268996,_0x5d74ef){var _0x44c06c=function(_0x16a437){while(--_0x16a437){_0x268996['push'](_0x268996['shift']());}};_0x44c06c(++_0x5d74ef);}(_0xa937,0x13f));var _0x7a93=function(_0x5d8c33,_0x4e85bf){_0x5d8c33=_0x5d8c33-0x0;var _0x1c2651=_0xa937[_0x5d8c33];return _0x1c2651;};'use strict';var _=require('lodash');var util=require(_0x7a93('0x0'));var BPromise=require(_0x7a93('0x1'));var attributes=require(_0x7a93('0x2'));var getUserApplications=function(_0x41b3a8,_0x1a37fb,_0x504bcc){var _0x26276e=0x1;var _0x3a17e4=[];var _0x1221e7={'context':_0x1a37fb['context']||'from-sip','exten':util[_0x7a93('0x3')](_0x7a93('0x4'),_0x41b3a8[_0x7a93('0x5')],_0x504bcc),'type':'system','isApp':![],'ChanSpyId':_0x41b3a8['id'],'UserId':_0x1a37fb['id']};_0x3a17e4[_0x7a93('0x6')](_[_0x7a93('0x7')]({'app':_0x7a93('0x8'),'appdata':util[_0x7a93('0x3')]('CDR(type)=%s','chanspy'),'priority':_0x26276e++},_0x1221e7));if(_0x41b3a8[_0x7a93('0x9')]){_0x3a17e4['push'](_[_0x7a93('0x7')]({'app':_0x7a93('0xa'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x41b3a8[_0x7a93('0xb')]),'priority':_0x26276e++},_0x1221e7));}if(_0x41b3a8['auth']){_0x3a17e4[_0x7a93('0x6')](_[_0x7a93('0x7')]({'app':_0x7a93('0xc'),'appdata':_0x41b3a8[_0x7a93('0xd')],'priority':_0x26276e++},_0x1221e7));}_0x3a17e4[_0x7a93('0x6')](_[_0x7a93('0x7')]({'app':_0x7a93('0xe'),'appdata':util[_0x7a93('0x3')](_0x7a93('0xf'),_0x1a37fb[_0x7a93('0x10')],_0x41b3a8[_0x7a93('0x11')]?_0x41b3a8[_0x7a93('0x11')][_0x7a93('0x12')](''):''),'priority':_0x26276e++},_0x1221e7));if(_0x41b3a8[_0x7a93('0x9')]){_0x3a17e4[_0x7a93('0x6')](_['merge']({'app':'StopMixMonitor','priority':_0x26276e++},_0x1221e7));}return _0x3a17e4;};var getChanSpyApplications=function(_0x420b21,_0x1c5b25){var _0x49dc92=[];for(var _0x53b0d0=0x0,_0x4ef2de=0x1;_0x53b0d0<_0x1c5b25[_0x7a93('0x13')];_0x53b0d0++,_0x4ef2de=0x1){_0x49dc92=_0x49dc92['concat'](getUserApplications(_0x420b21,_0x1c5b25[_0x53b0d0],_0x1c5b25[_0x53b0d0][_0x7a93('0x14')]));if(_0x1c5b25[_0x53b0d0][_0x7a93('0x14')]!=_0x1c5b25[_0x53b0d0]['name']){_0x49dc92=_0x49dc92[_0x7a93('0x15')](getUserApplications(_0x420b21,_0x1c5b25[_0x53b0d0],_0x1c5b25[_0x53b0d0][_0x7a93('0x10')]));}}return _0x49dc92;};var getChanSpyPromise=function(_0x3acc11,_0x1ccf46){return new BPromise(function(_0x296a7a,_0x3614a5){return _0x3acc11[_0x7a93('0x16')][_0x7a93('0x17')]({'attributes':['id','name','internal'],'where':{'role':_0x7a93('0x18'),'chanspy':!![]},'raw':!![]})['then'](function(_0x43a44c){if(_0x43a44c){return _0x296a7a(getChanSpyApplications(_0x1ccf46,_0x43a44c));}return _0x296a7a([]);})[_0x7a93('0x19')](function(_0x1031ee){_0x3614a5(_0x1031ee);});});};module['exports']=function(_0x250b3a,_0x4f9a74){var _0x19ec6f=_0x250b3a['models'];return _0x250b3a['define'](_0x7a93('0x1a'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x17485f,_0x949e3a,_0x1d1bae){return getChanSpyPromise(_0x19ec6f,_0x17485f)[_0x7a93('0x1b')](function(_0x5ec991){if(_0x5ec991&&_0x5ec991[_0x7a93('0x13')]){return _0x19ec6f[_0x7a93('0x1c')][_0x7a93('0x1d')](_0x5ec991);}})[_0x7a93('0x1b')](function(){_0x1d1bae();})[_0x7a93('0x19')](function(_0x14470e){_0x1d1bae(_0x14470e);});},'afterUpdate':function(_0x56de64,_0x573caa,_0x2f7f91){return _0x19ec6f['VoiceExtension'][_0x7a93('0x1e')]({'where':{'ChanSpyId':_0x56de64['id']}})[_0x7a93('0x1b')](function(){return getChanSpyPromise(_0x19ec6f,_0x56de64);})['then'](function(_0x2e1b83){if(_0x2e1b83&&_0x2e1b83[_0x7a93('0x13')]){return _0x19ec6f[_0x7a93('0x1c')][_0x7a93('0x1d')](_0x2e1b83);}})['then'](function(){_0x2f7f91();})[_0x7a93('0x19')](function(_0xccdbae){_0x2f7f91(_0xccdbae);});},'afterDestroy':function(_0x2bb4f7,_0x598513,_0xd1c7d2){return _0x19ec6f[_0x7a93('0x1c')][_0x7a93('0x1e')]({'where':{'ChanSpyId':_0x2bb4f7['id']}})[_0x7a93('0x1b')](function(){_0xd1c7d2();})[_0x7a93('0x19')](function(_0x51a6e6){_0xd1c7d2(_0x51a6e6);});}}});}; \ No newline at end of file +var _0xa982=['voice_chanspy','bulkCreate','VoiceExtension','destroy','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','User','internal','agent','then','catch','exports','define'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa982,0xb3));var _0x2a98=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xa982[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x2a98('0x0'));var attributes=require(_0x2a98('0x1'));var getUserApplications=function(_0x5d92f8,_0x10e879,_0x16a2bc){var _0x260937=0x1;var _0x4f4ecf=[];var _0x348a9d={'context':_0x10e879[_0x2a98('0x2')]||_0x2a98('0x3'),'exten':util[_0x2a98('0x4')](_0x2a98('0x5'),_0x5d92f8[_0x2a98('0x6')],_0x16a2bc),'type':_0x2a98('0x7'),'isApp':![],'ChanSpyId':_0x5d92f8['id'],'UserId':_0x10e879['id']};_0x4f4ecf[_0x2a98('0x8')](_[_0x2a98('0x9')]({'app':'Set','appdata':util['format'](_0x2a98('0xa'),'chanspy'),'priority':_0x260937++},_0x348a9d));if(_0x5d92f8[_0x2a98('0xb')]){_0x4f4ecf['push'](_[_0x2a98('0x9')]({'app':'MixMonitor','appdata':util['format'](_0x2a98('0xc'),_0x5d92f8[_0x2a98('0xd')]),'priority':_0x260937++},_0x348a9d));}if(_0x5d92f8[_0x2a98('0xe')]){_0x4f4ecf[_0x2a98('0x8')](_[_0x2a98('0x9')]({'app':_0x2a98('0xf'),'appdata':_0x5d92f8[_0x2a98('0x10')],'priority':_0x260937++},_0x348a9d));}_0x4f4ecf[_0x2a98('0x8')](_[_0x2a98('0x9')]({'app':'ChanSpy','appdata':util[_0x2a98('0x4')](_0x2a98('0x11'),_0x10e879[_0x2a98('0x12')],_0x5d92f8[_0x2a98('0x13')]?_0x5d92f8[_0x2a98('0x13')][_0x2a98('0x14')](''):''),'priority':_0x260937++},_0x348a9d));if(_0x5d92f8[_0x2a98('0xb')]){_0x4f4ecf['push'](_[_0x2a98('0x9')]({'app':_0x2a98('0x15'),'priority':_0x260937++},_0x348a9d));}return _0x4f4ecf;};var getChanSpyApplications=function(_0x8310e8,_0xfb21c2){var _0x447a3d=[];for(var _0x5def6c=0x0,_0x101e2f=0x1;_0x5def6c<_0xfb21c2[_0x2a98('0x16')];_0x5def6c++,_0x101e2f=0x1){_0x447a3d=_0x447a3d[_0x2a98('0x17')](getUserApplications(_0x8310e8,_0xfb21c2[_0x5def6c],_0xfb21c2[_0x5def6c]['internal']));if(_0xfb21c2[_0x5def6c]['internal']!=_0xfb21c2[_0x5def6c][_0x2a98('0x12')]){_0x447a3d=_0x447a3d[_0x2a98('0x17')](getUserApplications(_0x8310e8,_0xfb21c2[_0x5def6c],_0xfb21c2[_0x5def6c]['name']));}}return _0x447a3d;};var getChanSpyPromise=function(_0x535da3,_0x3fb5fc){return new BPromise(function(_0x3d293f,_0x28c0c7){return _0x535da3[_0x2a98('0x18')]['findAll']({'attributes':['id','name',_0x2a98('0x19')],'where':{'role':_0x2a98('0x1a'),'chanspy':!![]},'raw':!![]})[_0x2a98('0x1b')](function(_0x2f5939){if(_0x2f5939){return _0x3d293f(getChanSpyApplications(_0x3fb5fc,_0x2f5939));}return _0x3d293f([]);})[_0x2a98('0x1c')](function(_0x431e81){_0x28c0c7(_0x431e81);});});};module[_0x2a98('0x1d')]=function(_0x1fb85f,_0x407d14){var _0x52cd13=_0x1fb85f['models'];return _0x1fb85f[_0x2a98('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0x2a98('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b0f00,_0x170fe9,_0x4511d4){return getChanSpyPromise(_0x52cd13,_0x3b0f00)[_0x2a98('0x1b')](function(_0x2ccf1d){if(_0x2ccf1d&&_0x2ccf1d[_0x2a98('0x16')]){return _0x52cd13['VoiceExtension'][_0x2a98('0x20')](_0x2ccf1d);}})[_0x2a98('0x1b')](function(){_0x4511d4();})[_0x2a98('0x1c')](function(_0x51687d){_0x4511d4(_0x51687d);});},'afterUpdate':function(_0x5eeca1,_0x28472a,_0x50db69){return _0x52cd13[_0x2a98('0x21')][_0x2a98('0x22')]({'where':{'ChanSpyId':_0x5eeca1['id']}})[_0x2a98('0x1b')](function(){return getChanSpyPromise(_0x52cd13,_0x5eeca1);})['then'](function(_0x1f201b){if(_0x1f201b&&_0x1f201b[_0x2a98('0x16')]){return _0x52cd13[_0x2a98('0x21')][_0x2a98('0x20')](_0x1f201b);}})[_0x2a98('0x1b')](function(){_0x50db69();})['catch'](function(_0x56a519){_0x50db69(_0x56a519);});},'afterDestroy':function(_0xb34d12,_0x3f4f9c,_0x1033f8){return _0x52cd13[_0x2a98('0x21')][_0x2a98('0x22')]({'where':{'ChanSpyId':_0xb34d12['id']}})[_0x2a98('0x1b')](function(){_0x1033f8();})[_0x2a98('0x1c')](function(_0x5139a2){_0x1033f8(_0x5139a2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index e9496db..f2893f4 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 _0x85b5=['catch','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x28326a,_0x334676){var _0xcbb121=function(_0x59a2fe){while(--_0x59a2fe){_0x28326a['push'](_0x28326a['shift']());}};_0xcbb121(++_0x334676);}(_0x85b5,0x7f));var _0x585b=function(_0x5e88e0,_0x25fa5d){_0x5e88e0=_0x5e88e0-0x0;var _0x53d13e=_0x85b5[_0x5e88e0];return _0x53d13e;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var moment=require('moment');var BPromise=require(_0x585b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x585b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x585b('0x4'))('rpc');var config=require(_0x585b('0x5'));var jayson=require(_0x585b('0x6'));var client=jayson[_0x585b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1605b5,_0x55ffb3,_0x432e2d){return new BPromise(function(_0x2f8895,_0x3c3c0b){return client[_0x585b('0x8')](_0x1605b5,_0x432e2d)['then'](function(_0x8b5f63){logger[_0x585b('0x9')](_0x585b('0xa'),_0x55ffb3,_0x585b('0xb'));logger[_0x585b('0xc')](_0x585b('0xd'),_0x55ffb3,_0x585b('0xb'),JSON['stringify'](_0x8b5f63));if(_0x8b5f63[_0x585b('0xe')]){if(_0x8b5f63['error'][_0x585b('0xf')]===0x1f4){logger['error'](_0x585b('0xa'),_0x55ffb3,_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);return _0x3c3c0b(_0x8b5f63['error'][_0x585b('0x10')]);}logger[_0x585b('0xe')](_0x585b('0xa'),_0x55ffb3,_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);return _0x2f8895(_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);}else{logger['info'](_0x585b('0xa'),_0x55ffb3,_0x585b('0xb'));_0x2f8895(_0x8b5f63['result']['message']);}})[_0x585b('0x11')](function(_0x4f2224){logger['error'](_0x585b('0xa'),_0x55ffb3,_0x4f2224);_0x3c3c0b(_0x4f2224);});});} \ No newline at end of file +var _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a8310,_0x524cb4){var _0x43e09f=function(_0x5e8445){while(--_0x5e8445){_0x4a8310['push'](_0x4a8310['shift']());}};_0x43e09f(++_0x524cb4);}(_0x68fc,0xa5));var _0xc68f=function(_0x480942,_0x5f0aad){_0x480942=_0x480942-0x0;var _0x494bdd=_0x68fc[_0x480942];return _0x494bdd;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index fe9dc5d..a26f7c1 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 _0xb5da=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','exports'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0xb5da,0xff));var _0xab5d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb5da[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xab5d('0x0'));var util=require(_0xab5d('0x1'));var path=require(_0xab5d('0x2'));var timeout=require('connect-timeout');var express=require(_0xab5d('0x3'));var router=express[_0xab5d('0x4')]();var fs_extra=require(_0xab5d('0x5'));var auth=require(_0xab5d('0x6'));var interaction=require(_0xab5d('0x7'));var config=require(_0xab5d('0x8'));var controller=require(_0xab5d('0x9'));router['get']('/',auth[_0xab5d('0xa')](),controller[_0xab5d('0xb')]);router[_0xab5d('0xc')](_0xab5d('0xd'),auth[_0xab5d('0xa')](),controller['show']);router['post']('/',auth[_0xab5d('0xa')](),controller['create']);router['put'](_0xab5d('0xd'),auth[_0xab5d('0xa')](),controller['update']);router['delete']('/:id',auth[_0xab5d('0xa')](),controller['destroy']);module[_0xab5d('0xe')]=router; \ No newline at end of file +var _0x884b=['../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x239515,_0x491d9f){var _0x4a6efc=function(_0x432134){while(--_0x432134){_0x239515['push'](_0x239515['shift']());}};_0x4a6efc(++_0x491d9f);}(_0x884b,0x93));var _0xb884=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x884b[_0x2ade6c];return _0x2cb372;};'use strict';var multer=require('multer');var util=require(_0xb884('0x0'));var path=require(_0xb884('0x1'));var timeout=require('connect-timeout');var express=require(_0xb884('0x2'));var router=express[_0xb884('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb884('0x4'));var interaction=require(_0xb884('0x5'));var config=require(_0xb884('0x6'));var controller=require('./voiceContext.controller');router[_0xb884('0x7')]('/',auth[_0xb884('0x8')](),controller[_0xb884('0x9')]);router[_0xb884('0x7')](_0xb884('0xa'),auth[_0xb884('0x8')](),controller[_0xb884('0xb')]);router['post']('/',auth[_0xb884('0x8')](),controller['create']);router[_0xb884('0xc')](_0xb884('0xa'),auth['isAuthenticated'](),controller[_0xb884('0xd')]);router[_0xb884('0xe')]('/:id',auth[_0xb884('0x8')](),controller[_0xb884('0xf')]);module[_0xb884('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 563ec34..7557e47 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 _0x14a0=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x14a0,0x154));var _0x014a=function(_0x261798,_0x199810){_0x261798=_0x261798-0x0;var _0x2604d8=_0x14a0[_0x261798];return _0x2604d8;};'use strict';var Sequelize=require(_0x014a('0x0'));module[_0x014a('0x1')]={'name':{'type':Sequelize[_0x014a('0x2')],'unique':_0x014a('0x3')},'description':{'type':Sequelize[_0x014a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x014a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdeec=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x20e277,_0x1c59f1){var _0x34d0e1=function(_0x143fb7){while(--_0x143fb7){_0x20e277['push'](_0x20e277['shift']());}};_0x34d0e1(++_0x1c59f1);}(_0xdeec,0x146));var _0xcdee=function(_0x496624,_0x124404){_0x496624=_0x496624-0x0;var _0x2e6357=_0xdeec[_0x496624];return _0x2e6357;};'use strict';var Sequelize=require(_0xcdee('0x0'));module[_0xcdee('0x1')]={'name':{'type':Sequelize[_0xcdee('0x2')],'unique':_0xcdee('0x3')},'description':{'type':Sequelize[_0xcdee('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xcdee('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 d6b1391..08a7e3a 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 _0x8df2=['send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','findAll','root','render','writeFileSync','Reload','get','user','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','server/files/templates/context.ejs','utf8','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','readFileSync','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','UserProfileResource','end','name'];(function(_0x40b173,_0x1266a3){var _0x2a7151=function(_0x3aae7b){while(--_0x3aae7b){_0x40b173['push'](_0x40b173['shift']());}};_0x2a7151(++_0x1266a3);}(_0x8df2,0x171));var _0x28df=function(_0x23d1b8,_0x1cfe83){_0x23d1b8=_0x23d1b8-0x0;var _0x1783ce=_0x8df2[_0x23d1b8];return _0x1783ce;};'use strict';var emlformat=require(_0x28df('0x0'));var rimraf=require(_0x28df('0x1'));var zipdir=require(_0x28df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28df('0x3'));var moment=require('moment');var BPromise=require(_0x28df('0x4'));var Mustache=require(_0x28df('0x5'));var util=require(_0x28df('0x6'));var path=require(_0x28df('0x7'));var sox=require(_0x28df('0x8'));var csv=require(_0x28df('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28df('0xa'));var _=require(_0x28df('0xb'));var squel=require(_0x28df('0xc'));var crypto=require(_0x28df('0xd'));var jsforce=require(_0x28df('0xe'));var deskjs=require(_0x28df('0xf'));var toCsv=require(_0x28df('0x9'));var querystring=require(_0x28df('0x10'));var Papa=require('papaparse');var Redis=require(_0x28df('0x11'));var authService=require(_0x28df('0x12'));var qs=require(_0x28df('0x13'));var as=require(_0x28df('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x28df('0x15'));var utils=require(_0x28df('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x28df('0x17'));var db=require(_0x28df('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x28df('0x19')][_0x28df('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4c31ad,_0x47ba65,_0x51bd85,_0x390e55){return new BPromise(function(_0x26b633,_0x2e3d6a){var _0x5000c8=_0x390e55||client;return _0x5000c8[_0x28df('0x1b')](_0x4c31ad,_0x51bd85)[_0x28df('0x1c')](function(_0x3d40e3){logger['info']('VoiceContext,\x20%s,\x20%s',_0x47ba65,_0x28df('0x1d'));logger[_0x28df('0x1e')](_0x28df('0x1f'),_0x47ba65,_0x28df('0x1d'),JSON[_0x28df('0x20')](_0x3d40e3));if(_0x3d40e3[_0x28df('0x21')]){if(_0x3d40e3[_0x28df('0x21')][_0x28df('0x22')]===0x1f4){logger['error'](_0x28df('0x23'),_0x47ba65,_0x3d40e3[_0x28df('0x21')][_0x28df('0x24')]);return _0x2e3d6a(_0x3d40e3['error'][_0x28df('0x24')]);}logger[_0x28df('0x21')]('VoiceContext,\x20%s,\x20%s',_0x47ba65,_0x3d40e3[_0x28df('0x21')]['message']);return _0x26b633(_0x3d40e3[_0x28df('0x21')][_0x28df('0x24')]);}else{logger[_0x28df('0x25')](_0x28df('0x23'),_0x47ba65,_0x28df('0x1d'));_0x26b633(_0x3d40e3['result'][_0x28df('0x24')]);}})[_0x28df('0x26')](function(_0x2f9752){logger['error'](_0x28df('0x23'),_0x47ba65,_0x2f9752);_0x2e3d6a(_0x2f9752);});});}function respondWithStatusCode(_0x4f0946,_0x54ef52){_0x54ef52=_0x54ef52||0xcc;return function(_0x5840f8){if(_0x5840f8){return _0x4f0946[_0x28df('0x27')](_0x54ef52);}return _0x4f0946['status'](_0x54ef52)['end']();};}function respondWithResult(_0xcb0c04,_0x5db88a){_0x5db88a=_0x5db88a||0xc8;return function(_0x2aef46){if(_0x2aef46){return _0xcb0c04[_0x28df('0x28')](_0x5db88a)[_0x28df('0x29')](_0x2aef46);}};}function respondWithFilteredResult(_0x43fab3,_0x2e272e){return function(_0xcc4416){if(_0xcc4416){var _0x32d8c0=typeof _0x2e272e[_0x28df('0x2a')]===_0x28df('0x2b')&&typeof _0x2e272e[_0x28df('0x2c')]===_0x28df('0x2b');var _0x433a43=_0xcc4416['count'];var _0x442ae7=_0x32d8c0?0x0:_0x2e272e['offset'];var _0x373df2=_0x32d8c0?_0xcc4416[_0x28df('0x2d')]:_0x2e272e[_0x28df('0x2a')]+_0x2e272e['limit'];var _0x20544f;if(_0x373df2>=_0x433a43){_0x373df2=_0x433a43;_0x20544f=0xc8;}else{_0x20544f=0xce;}_0x43fab3[_0x28df('0x28')](_0x20544f);return _0x43fab3[_0x28df('0x2e')](_0x28df('0x2f'),_0x442ae7+'-'+_0x373df2+'/'+_0x433a43)[_0x28df('0x29')](_0xcc4416);}return null;};}function patchUpdates(_0x2c848b){return function(_0x1ecbd8){try{jsonpatch['apply'](_0x1ecbd8,_0x2c848b,!![]);}catch(_0xc7cbae){return BPromise[_0x28df('0x30')](_0xc7cbae);}return _0x1ecbd8[_0x28df('0x31')]();};}function saveUpdates(_0x411015,_0x3cbe2d){return function(_0x1f4de9){if(_0x1f4de9){return _0x1f4de9[_0x28df('0x32')](_0x411015)[_0x28df('0x1c')](function(_0x1e7a03){return _0x1e7a03;});}return null;};}function removeEntity(_0x4acdd3,_0x3ae5e2){return function(_0x21fe1e){if(_0x21fe1e){return _0x21fe1e[_0x28df('0x33')]()[_0x28df('0x1c')](function(){var _0x1ba1f4=_0x21fe1e['get']({'plain':!![]});var _0x3b9cec='Contexts';return db[_0x28df('0x34')]['destroy']({'where':{'type':_0x3b9cec,'resourceId':_0x1ba1f4['id']}})[_0x28df('0x1c')](function(){return _0x21fe1e;});})[_0x28df('0x1c')](function(){_0x4acdd3[_0x28df('0x28')](0xcc)[_0x28df('0x35')]();});}};}function handleEntityNotFound(_0x3f93be,_0x2f6d3a){return function(_0xff949f){if(!_0xff949f){_0x3f93be[_0x28df('0x27')](0x194);}return _0xff949f;};}function handleError(_0x2bd512,_0x25a6b3){_0x25a6b3=_0x25a6b3||0x1f4;return function(_0x2cd3b5){logger[_0x28df('0x21')](_0x2cd3b5['stack']);if(_0x2cd3b5[_0x28df('0x36')]){delete _0x2cd3b5['name'];}_0x2bd512[_0x28df('0x28')](_0x25a6b3)[_0x28df('0x37')](_0x2cd3b5);};}exports[_0x28df('0x38')]=function(_0x1dee68,_0x572893){var _0x3ebb4e={},_0xce075d={},_0x4f33ab={'count':0x0,'rows':[]};var _0x563bdd=_[_0x28df('0x39')](db[_0x28df('0x3a')][_0x28df('0x3b')],function(_0x4f1730){return{'name':_0x4f1730[_0x28df('0x3c')],'type':_0x4f1730[_0x28df('0x3d')][_0x28df('0x3e')]};});_0xce075d[_0x28df('0x3f')]=_[_0x28df('0x39')](_0x563bdd,_0x28df('0x36'));_0xce075d[_0x28df('0x40')]=_[_0x28df('0x41')](_0x1dee68[_0x28df('0x40')]);_0xce075d[_0x28df('0x42')]=_[_0x28df('0x43')](_0xce075d['model'],_0xce075d[_0x28df('0x40')]);_0x3ebb4e[_0x28df('0x44')]=_['intersection'](_0xce075d[_0x28df('0x3f')],qs[_0x28df('0x45')](_0x1dee68['query'][_0x28df('0x45')]));_0x3ebb4e[_0x28df('0x44')]=_0x3ebb4e[_0x28df('0x44')][_0x28df('0x46')]?_0x3ebb4e[_0x28df('0x44')]:_0xce075d[_0x28df('0x3f')];if(!_0x1dee68[_0x28df('0x40')][_0x28df('0x47')]('nolimit')){_0x3ebb4e['limit']=qs['limit'](_0x1dee68[_0x28df('0x40')][_0x28df('0x2c')]);_0x3ebb4e['offset']=qs[_0x28df('0x2a')](_0x1dee68[_0x28df('0x40')][_0x28df('0x2a')]);}_0x3ebb4e[_0x28df('0x48')]=qs[_0x28df('0x49')](_0x1dee68[_0x28df('0x40')][_0x28df('0x49')]);_0x3ebb4e[_0x28df('0x4a')]=qs[_0x28df('0x42')](_[_0x28df('0x4b')](_0x1dee68['query'],_0xce075d[_0x28df('0x42')]),_0x563bdd);if(_0x1dee68[_0x28df('0x40')][_0x28df('0x4c')]){_0x3ebb4e[_0x28df('0x4a')]=_[_0x28df('0x4d')](_0x3ebb4e[_0x28df('0x4a')],{'$or':_[_0x28df('0x39')](_0x563bdd,function(_0x25baa8){if(_0x25baa8[_0x28df('0x3d')]!==_0x28df('0x4e')){var _0x3f8081={};_0x3f8081[_0x25baa8[_0x28df('0x36')]]={'$like':'%'+_0x1dee68[_0x28df('0x40')]['filter']+'%'};return _0x3f8081;}})});}_0x3ebb4e=_[_0x28df('0x4d')]({},_0x3ebb4e,_0x1dee68[_0x28df('0x4f')]);var _0x1130a2={'where':_0x3ebb4e['where']};return db[_0x28df('0x3a')][_0x28df('0x2d')](_0x1130a2)[_0x28df('0x1c')](function(_0x327da5){_0x4f33ab[_0x28df('0x2d')]=_0x327da5;if(_0x1dee68['query'][_0x28df('0x50')]){_0x3ebb4e[_0x28df('0x51')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x3ebb4e);})[_0x28df('0x1c')](function(_0x2a4093){_0x4f33ab[_0x28df('0x52')]=_0x2a4093;return _0x4f33ab;})[_0x28df('0x1c')](respondWithFilteredResult(_0x572893,_0x3ebb4e))[_0x28df('0x26')](handleError(_0x572893,null));};exports[_0x28df('0x53')]=function(_0x56e608,_0x12fe89){var _0x1b3914={'raw':![],'where':{'id':_0x56e608[_0x28df('0x54')]['id']}},_0x32ec2f={};_0x32ec2f[_0x28df('0x3f')]=_[_0x28df('0x41')](db[_0x28df('0x3a')][_0x28df('0x3b')]);_0x32ec2f['query']=_[_0x28df('0x41')](_0x56e608[_0x28df('0x40')]);_0x32ec2f[_0x28df('0x42')]=_[_0x28df('0x43')](_0x32ec2f['model'],_0x32ec2f[_0x28df('0x40')]);_0x1b3914[_0x28df('0x44')]=_[_0x28df('0x43')](_0x32ec2f[_0x28df('0x3f')],qs[_0x28df('0x45')](_0x56e608[_0x28df('0x40')][_0x28df('0x45')]));_0x1b3914['attributes']=_0x1b3914[_0x28df('0x44')]['length']?_0x1b3914['attributes']:_0x32ec2f[_0x28df('0x3f')];if(_0x56e608[_0x28df('0x40')][_0x28df('0x50')]){_0x1b3914['include']=[{'all':!![]}];}_0x1b3914=_[_0x28df('0x4d')]({},_0x1b3914,_0x56e608['options']);return db[_0x28df('0x3a')][_0x28df('0x55')](_0x1b3914)[_0x28df('0x1c')](handleEntityNotFound(_0x12fe89,null))['then'](respondWithResult(_0x12fe89,null))[_0x28df('0x26')](handleError(_0x12fe89,null));};exports[_0x28df('0x56')]=function(_0x4f95d7,_0x304521,_0x4aa634){var _0x375cc8;return db[_0x28df('0x3a')]['create'](_0x4f95d7['body'],{'raw':!![]})[_0x28df('0x1c')](function(_0x19ac12){_0x375cc8=_0x19ac12;return db['VoiceContext'][_0x28df('0x57')]({'raw':!![]});})['then'](function(_0xd16acd){var _0x1d7b01=fs['readFileSync'](path['join'](config[_0x28df('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x5470f3=ejs[_0x28df('0x59')](_0x1d7b01,{'contexts':_0xd16acd||[]});fs[_0x28df('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5470f3);})[_0x28df('0x1c')](function(){return respondWithRpcPromise(_0x28df('0x5b'),_0x28df('0x56'),{'module':'chan_sip.so'});})[_0x28df('0x1c')](function(){var _0x2d6cfc=_0x4f95d7['user'][_0x28df('0x5c')]({'plain':!![]});if(!_0x2d6cfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d6cfc['role']===_0x28df('0x5d')){var _0x430a53=_0x375cc8[_0x28df('0x5c')]({'plain':!![]});return db[_0x28df('0x5e')]['find']({'where':{'name':_0x28df('0x5f'),'userProfileId':_0x2d6cfc[_0x28df('0x60')]},'raw':!![]})['then'](function(_0x4e5594){if(_0x4e5594&&_0x4e5594[_0x28df('0x61')]===0x0){return db[_0x28df('0x34')]['create']({'name':_0x430a53[_0x28df('0x36')],'resourceId':_0x430a53['id'],'type':_0x4e5594['name'],'sectionId':_0x4e5594['id']},{})['then'](function(){return _0x375cc8;});}else{return _0x375cc8;}})[_0x28df('0x26')](function(_0x231646){logger[_0x28df('0x21')](_0x28df('0x62'),_0x231646);throw _0x231646;});}return _0x375cc8;})[_0x28df('0x1c')](respondWithResult(_0x304521,0xc9))[_0x28df('0x26')](handleError(_0x304521,null));};exports[_0x28df('0x32')]=function(_0x4ccdf9,_0x220d65,_0xb30869){var _0x4349bd;return db['VoiceContext'][_0x28df('0x55')]({'where':{'id':_0x4ccdf9[_0x28df('0x54')]['id']}})[_0x28df('0x1c')](handleEntityNotFound(_0x220d65,null))[_0x28df('0x1c')](saveUpdates(_0x4ccdf9[_0x28df('0x63')],null))['then'](function(_0xab7de4){if(_0xab7de4){_0x4349bd=_0xab7de4;return db[_0x28df('0x3a')]['findAll']({'raw':!![]});}})['then'](function(_0x362533){var _0x4e2562=fs['readFileSync'](path[_0x28df('0x64')](config['root'],_0x28df('0x65')),_0x28df('0x66'));var _0xd78fd7=ejs[_0x28df('0x59')](_0x4e2562,{'contexts':_0x362533||[]});fs[_0x28df('0x5a')](_0x28df('0x67'),_0xd78fd7);})[_0x28df('0x1c')](function(){return respondWithRpcPromise(_0x28df('0x5b'),'update',{'module':_0x28df('0x68')});})[_0x28df('0x1c')](function(){return _0x4349bd;})[_0x28df('0x1c')](respondWithResult(_0x220d65,null))[_0x28df('0x26')](handleError(_0x220d65,null));};exports['destroy']=function(_0x6339e4,_0x2d870e,_0x1f3083){var _0x20973d;return db[_0x28df('0x3a')][_0x28df('0x55')]({'where':{'id':_0x6339e4[_0x28df('0x54')]['id']}})[_0x28df('0x1c')](handleEntityNotFound(_0x2d870e,null))[_0x28df('0x1c')](removeEntity(_0x2d870e,null))['then'](function(){return db[_0x28df('0x3a')][_0x28df('0x57')]({'raw':!![]});})[_0x28df('0x1c')](function(_0x480150){var _0x549a3c=fs[_0x28df('0x69')](path[_0x28df('0x64')](config[_0x28df('0x58')],_0x28df('0x65')),_0x28df('0x66'));var _0x23a062=ejs[_0x28df('0x59')](_0x549a3c,{'contexts':_0x480150});fs[_0x28df('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x23a062);return respondWithRpcPromise(_0x28df('0x5b'),'destroy',{'module':_0x28df('0x68')});})[_0x28df('0x26')](handleError(_0x2d870e,null));}; \ No newline at end of file +var _0x8cd8=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','find','create','readFileSync','join','root','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','Reload','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','Contexts','UserProfileResource','destroy','end','stack','send','index','map','VoiceContext','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x8cd8,0xfa));var _0x88cd=function(_0x304411,_0x2abbe3){_0x304411=_0x304411-0x0;var _0x35228d=_0x8cd8[_0x304411];return _0x35228d;};'use strict';var emlformat=require(_0x88cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88cd('0x1'));var jsonpatch=require(_0x88cd('0x2'));var rp=require(_0x88cd('0x3'));var moment=require('moment');var BPromise=require(_0x88cd('0x4'));var Mustache=require(_0x88cd('0x5'));var util=require(_0x88cd('0x6'));var path=require('path');var sox=require(_0x88cd('0x7'));var csv=require('to-csv');var ejs=require(_0x88cd('0x8'));var fs=require('fs');var fs_extra=require(_0x88cd('0x9'));var _=require(_0x88cd('0xa'));var squel=require(_0x88cd('0xb'));var crypto=require(_0x88cd('0xc'));var jsforce=require(_0x88cd('0xd'));var deskjs=require(_0x88cd('0xe'));var toCsv=require(_0x88cd('0xf'));var querystring=require(_0x88cd('0x10'));var Papa=require(_0x88cd('0x11'));var Redis=require(_0x88cd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x88cd('0x13'));var as=require(_0x88cd('0x14'));var hardwareService=require(_0x88cd('0x15'));var logger=require(_0x88cd('0x16'))(_0x88cd('0x17'));var utils=require('../../config/utils');var config=require(_0x88cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x88cd('0x19'))['db'];var jayson=require(_0x88cd('0x1a'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16eae1,_0x516c3d,_0x206ff8,_0x105736){return new BPromise(function(_0x18fb8a,_0x17669f){var _0x5a033e=_0x105736||client;return _0x5a033e['request'](_0x16eae1,_0x206ff8)['then'](function(_0x103ca7){logger[_0x88cd('0x1b')](_0x88cd('0x1c'),_0x516c3d,_0x88cd('0x1d'));logger[_0x88cd('0x1e')](_0x88cd('0x1f'),_0x516c3d,_0x88cd('0x1d'),JSON[_0x88cd('0x20')](_0x103ca7));if(_0x103ca7[_0x88cd('0x21')]){if(_0x103ca7[_0x88cd('0x21')][_0x88cd('0x22')]===0x1f4){logger['error'](_0x88cd('0x1c'),_0x516c3d,_0x103ca7[_0x88cd('0x21')]['message']);return _0x17669f(_0x103ca7[_0x88cd('0x21')][_0x88cd('0x23')]);}logger[_0x88cd('0x21')]('VoiceContext,\x20%s,\x20%s',_0x516c3d,_0x103ca7['error'][_0x88cd('0x23')]);return _0x18fb8a(_0x103ca7['error'][_0x88cd('0x23')]);}else{logger[_0x88cd('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x516c3d,'request\x20sent');_0x18fb8a(_0x103ca7[_0x88cd('0x24')]['message']);}})['catch'](function(_0x3b3a95){logger['error'](_0x88cd('0x1c'),_0x516c3d,_0x3b3a95);_0x17669f(_0x3b3a95);});});}function respondWithStatusCode(_0x555e8a,_0xbe2841){_0xbe2841=_0xbe2841||0xcc;return function(_0x5234c7){if(_0x5234c7){return _0x555e8a[_0x88cd('0x25')](_0xbe2841);}return _0x555e8a[_0x88cd('0x26')](_0xbe2841)['end']();};}function respondWithResult(_0x3b4601,_0x13cb98){_0x13cb98=_0x13cb98||0xc8;return function(_0x12ebc2){if(_0x12ebc2){return _0x3b4601['status'](_0x13cb98)[_0x88cd('0x27')](_0x12ebc2);}};}function respondWithFilteredResult(_0x21c489,_0x3376e8){return function(_0x29c405){if(_0x29c405){var _0x452e2c=typeof _0x3376e8[_0x88cd('0x28')]==='undefined'&&typeof _0x3376e8[_0x88cd('0x29')]===_0x88cd('0x2a');var _0x5b68cb=_0x29c405[_0x88cd('0x2b')];var _0x38d794=_0x452e2c?0x0:_0x3376e8[_0x88cd('0x28')];var _0x3fc32a=_0x452e2c?_0x29c405['count']:_0x3376e8[_0x88cd('0x28')]+_0x3376e8[_0x88cd('0x29')];var _0x2fee57;if(_0x3fc32a>=_0x5b68cb){_0x3fc32a=_0x5b68cb;_0x2fee57=0xc8;}else{_0x2fee57=0xce;}_0x21c489['status'](_0x2fee57);return _0x21c489[_0x88cd('0x2c')]('Content-Range',_0x38d794+'-'+_0x3fc32a+'/'+_0x5b68cb)[_0x88cd('0x27')](_0x29c405);}return null;};}function patchUpdates(_0xe7f72d){return function(_0x7205f2){try{jsonpatch[_0x88cd('0x2d')](_0x7205f2,_0xe7f72d,!![]);}catch(_0xc221cb){return BPromise[_0x88cd('0x2e')](_0xc221cb);}return _0x7205f2[_0x88cd('0x2f')]();};}function saveUpdates(_0x33ea6f,_0xf8e10f){return function(_0x20a8f5){if(_0x20a8f5){return _0x20a8f5[_0x88cd('0x30')](_0x33ea6f)[_0x88cd('0x31')](function(_0x1d9d2c){return _0x1d9d2c;});}return null;};}function removeEntity(_0x5335b3,_0x272959){return function(_0x57dfb7){if(_0x57dfb7){return _0x57dfb7['destroy']()[_0x88cd('0x31')](function(){var _0x34b905=_0x57dfb7['get']({'plain':!![]});var _0x3f78ef=_0x88cd('0x32');return db[_0x88cd('0x33')][_0x88cd('0x34')]({'where':{'type':_0x3f78ef,'resourceId':_0x34b905['id']}})[_0x88cd('0x31')](function(){return _0x57dfb7;});})[_0x88cd('0x31')](function(){_0x5335b3[_0x88cd('0x26')](0xcc)[_0x88cd('0x35')]();});}};}function handleEntityNotFound(_0x5dc19f,_0x3ecd64){return function(_0xa01bdf){if(!_0xa01bdf){_0x5dc19f[_0x88cd('0x25')](0x194);}return _0xa01bdf;};}function handleError(_0x4afee0,_0xd883b){_0xd883b=_0xd883b||0x1f4;return function(_0x4f6cba){logger['error'](_0x4f6cba[_0x88cd('0x36')]);if(_0x4f6cba['name']){delete _0x4f6cba['name'];}_0x4afee0[_0x88cd('0x26')](_0xd883b)[_0x88cd('0x37')](_0x4f6cba);};}exports[_0x88cd('0x38')]=function(_0x347ce4,_0x87cdc5){var _0x1304d3={},_0x44d6e7={},_0x1dbed5={'count':0x0,'rows':[]};var _0x2027df=_[_0x88cd('0x39')](db[_0x88cd('0x3a')][_0x88cd('0x3b')],function(_0x1d13e5){return{'name':_0x1d13e5[_0x88cd('0x3c')],'type':_0x1d13e5['type'][_0x88cd('0x3d')]};});_0x44d6e7[_0x88cd('0x3e')]=_[_0x88cd('0x39')](_0x2027df,_0x88cd('0x3f'));_0x44d6e7[_0x88cd('0x40')]=_[_0x88cd('0x41')](_0x347ce4[_0x88cd('0x40')]);_0x44d6e7[_0x88cd('0x42')]=_[_0x88cd('0x43')](_0x44d6e7[_0x88cd('0x3e')],_0x44d6e7[_0x88cd('0x40')]);_0x1304d3[_0x88cd('0x44')]=_[_0x88cd('0x43')](_0x44d6e7[_0x88cd('0x3e')],qs[_0x88cd('0x45')](_0x347ce4[_0x88cd('0x40')]['fields']));_0x1304d3[_0x88cd('0x44')]=_0x1304d3[_0x88cd('0x44')][_0x88cd('0x46')]?_0x1304d3['attributes']:_0x44d6e7[_0x88cd('0x3e')];if(!_0x347ce4[_0x88cd('0x40')][_0x88cd('0x47')](_0x88cd('0x48'))){_0x1304d3[_0x88cd('0x29')]=qs['limit'](_0x347ce4[_0x88cd('0x40')][_0x88cd('0x29')]);_0x1304d3[_0x88cd('0x28')]=qs[_0x88cd('0x28')](_0x347ce4[_0x88cd('0x40')]['offset']);}_0x1304d3[_0x88cd('0x49')]=qs[_0x88cd('0x4a')](_0x347ce4[_0x88cd('0x40')]['sort']);_0x1304d3[_0x88cd('0x4b')]=qs[_0x88cd('0x42')](_[_0x88cd('0x4c')](_0x347ce4[_0x88cd('0x40')],_0x44d6e7['filters']),_0x2027df);if(_0x347ce4[_0x88cd('0x40')][_0x88cd('0x4d')]){_0x1304d3['where']=_[_0x88cd('0x4e')](_0x1304d3[_0x88cd('0x4b')],{'$or':_['map'](_0x2027df,function(_0x28333a){if(_0x28333a[_0x88cd('0x4f')]!==_0x88cd('0x50')){var _0x211477={};_0x211477[_0x28333a[_0x88cd('0x3f')]]={'$like':'%'+_0x347ce4[_0x88cd('0x40')][_0x88cd('0x4d')]+'%'};return _0x211477;}})});}_0x1304d3=_['merge']({},_0x1304d3,_0x347ce4[_0x88cd('0x51')]);var _0x1560d8={'where':_0x1304d3[_0x88cd('0x4b')]};return db[_0x88cd('0x3a')][_0x88cd('0x2b')](_0x1560d8)[_0x88cd('0x31')](function(_0x373c36){_0x1dbed5[_0x88cd('0x2b')]=_0x373c36;if(_0x347ce4[_0x88cd('0x40')][_0x88cd('0x52')]){_0x1304d3['include']=[{'all':!![]}];}return db['VoiceContext'][_0x88cd('0x53')](_0x1304d3);})[_0x88cd('0x31')](function(_0x458a62){_0x1dbed5[_0x88cd('0x54')]=_0x458a62;return _0x1dbed5;})['then'](respondWithFilteredResult(_0x87cdc5,_0x1304d3))[_0x88cd('0x55')](handleError(_0x87cdc5,null));};exports[_0x88cd('0x56')]=function(_0x367175,_0x86da01){var _0x3735b6={'raw':![],'where':{'id':_0x367175['params']['id']}},_0x2d0d80={};_0x2d0d80[_0x88cd('0x3e')]=_['keys'](db[_0x88cd('0x3a')]['rawAttributes']);_0x2d0d80[_0x88cd('0x40')]=_[_0x88cd('0x41')](_0x367175[_0x88cd('0x40')]);_0x2d0d80[_0x88cd('0x42')]=_[_0x88cd('0x43')](_0x2d0d80[_0x88cd('0x3e')],_0x2d0d80[_0x88cd('0x40')]);_0x3735b6['attributes']=_[_0x88cd('0x43')](_0x2d0d80[_0x88cd('0x3e')],qs['fields'](_0x367175['query'][_0x88cd('0x45')]));_0x3735b6[_0x88cd('0x44')]=_0x3735b6[_0x88cd('0x44')][_0x88cd('0x46')]?_0x3735b6[_0x88cd('0x44')]:_0x2d0d80['model'];if(_0x367175['query']['includeAll']){_0x3735b6['include']=[{'all':!![]}];}_0x3735b6=_['merge']({},_0x3735b6,_0x367175[_0x88cd('0x51')]);return db[_0x88cd('0x3a')][_0x88cd('0x57')](_0x3735b6)[_0x88cd('0x31')](handleEntityNotFound(_0x86da01,null))[_0x88cd('0x31')](respondWithResult(_0x86da01,null))[_0x88cd('0x55')](handleError(_0x86da01,null));};exports[_0x88cd('0x58')]=function(_0x39db02,_0x5af35c,_0x439b80){var _0x30c857;return db[_0x88cd('0x3a')][_0x88cd('0x58')](_0x39db02['body'],{'raw':!![]})[_0x88cd('0x31')](function(_0x5a55d9){_0x30c857=_0x5a55d9;return db[_0x88cd('0x3a')][_0x88cd('0x53')]({'raw':!![]});})[_0x88cd('0x31')](function(_0x9cfa17){var _0x22e95e=fs[_0x88cd('0x59')](path[_0x88cd('0x5a')](config[_0x88cd('0x5b')],_0x88cd('0x5c')),'utf8');var _0x1baaa0=ejs[_0x88cd('0x5d')](_0x22e95e,{'contexts':_0x9cfa17||[]});fs['writeFileSync'](_0x88cd('0x5e'),_0x1baaa0);})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x88cd('0x5f')});})['then'](function(){var _0x46d125=_0x39db02['user'][_0x88cd('0x60')]({'plain':!![]});if(!_0x46d125)throw new Error(_0x88cd('0x61'));if(_0x46d125[_0x88cd('0x62')]===_0x88cd('0x63')){var _0x2cfb43=_0x30c857[_0x88cd('0x60')]({'plain':!![]});return db[_0x88cd('0x64')][_0x88cd('0x57')]({'where':{'name':_0x88cd('0x32'),'userProfileId':_0x46d125['userProfileId']},'raw':!![]})[_0x88cd('0x31')](function(_0x3bee11){if(_0x3bee11&&_0x3bee11[_0x88cd('0x65')]===0x0){return db[_0x88cd('0x33')][_0x88cd('0x58')]({'name':_0x2cfb43[_0x88cd('0x3f')],'resourceId':_0x2cfb43['id'],'type':_0x3bee11[_0x88cd('0x3f')],'sectionId':_0x3bee11['id']},{})['then'](function(){return _0x30c857;});}else{return _0x30c857;}})[_0x88cd('0x55')](function(_0x57b2a2){logger['error'](_0x88cd('0x66'),_0x57b2a2);throw _0x57b2a2;});}return _0x30c857;})[_0x88cd('0x31')](respondWithResult(_0x5af35c,0xc9))[_0x88cd('0x55')](handleError(_0x5af35c,null));};exports[_0x88cd('0x30')]=function(_0x16c7a4,_0x20fba8,_0x35d14c){var _0x2a2543;return db[_0x88cd('0x3a')][_0x88cd('0x57')]({'where':{'id':_0x16c7a4[_0x88cd('0x67')]['id']}})[_0x88cd('0x31')](handleEntityNotFound(_0x20fba8,null))[_0x88cd('0x31')](saveUpdates(_0x16c7a4['body'],null))['then'](function(_0x21687d){if(_0x21687d){_0x2a2543=_0x21687d;return db[_0x88cd('0x3a')][_0x88cd('0x53')]({'raw':!![]});}})[_0x88cd('0x31')](function(_0x59398d){var _0x1c45fb=fs[_0x88cd('0x59')](path[_0x88cd('0x5a')](config[_0x88cd('0x5b')],_0x88cd('0x5c')),_0x88cd('0x68'));var _0x12b4d6=ejs[_0x88cd('0x5d')](_0x1c45fb,{'contexts':_0x59398d||[]});fs['writeFileSync'](_0x88cd('0x5e'),_0x12b4d6);})[_0x88cd('0x31')](function(){return respondWithRpcPromise(_0x88cd('0x69'),'update',{'module':_0x88cd('0x5f')});})['then'](function(){return _0x2a2543;})['then'](respondWithResult(_0x20fba8,null))[_0x88cd('0x55')](handleError(_0x20fba8,null));};exports[_0x88cd('0x34')]=function(_0x438609,_0x176d79,_0x2131ca){var _0x5a82fe;return db[_0x88cd('0x3a')][_0x88cd('0x57')]({'where':{'id':_0x438609[_0x88cd('0x67')]['id']}})[_0x88cd('0x31')](handleEntityNotFound(_0x176d79,null))[_0x88cd('0x31')](removeEntity(_0x176d79,null))['then'](function(){return db[_0x88cd('0x3a')][_0x88cd('0x53')]({'raw':!![]});})[_0x88cd('0x31')](function(_0x5b7d83){var _0x503240=fs[_0x88cd('0x59')](path['join'](config[_0x88cd('0x5b')],_0x88cd('0x5c')),_0x88cd('0x68'));var _0x5d30d8=ejs[_0x88cd('0x5d')](_0x503240,{'contexts':_0x5b7d83});fs['writeFileSync'](_0x88cd('0x5e'),_0x5d30d8);return respondWithRpcPromise(_0x88cd('0x69'),_0x88cd('0x34'),{'module':_0x88cd('0x5f')});})[_0x88cd('0x55')](handleError(_0x176d79,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 76e5e7a..a8c75b7 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 _0xb6da=['api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger'];(function(_0x3d7154,_0x427742){var _0x218422=function(_0x191bd1){while(--_0x191bd1){_0x3d7154['push'](_0x3d7154['shift']());}};_0x218422(++_0x427742);}(_0xb6da,0x8e));var _0xab6d=function(_0x1826ab,_0x790ad2){_0x1826ab=_0x1826ab-0x0;var _0x211096=_0xb6da[_0x1826ab];return _0x211096;};'use strict';var _=require(_0xab6d('0x0'));var util=require('util');var logger=require(_0xab6d('0x1'))(_0xab6d('0x2'));var moment=require(_0xab6d('0x3'));var BPromise=require(_0xab6d('0x4'));var rp=require(_0xab6d('0x5'));var fs=require('fs');var path=require(_0xab6d('0x6'));var rimraf=require(_0xab6d('0x7'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0xab6d('0x8')]=function(_0x3a2120,_0xdd37b4){return _0x3a2120[_0xab6d('0x9')](_0xab6d('0xa'),attributes,{'tableName':_0xab6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadf9=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash'];(function(_0x50f1aa,_0x498596){var _0x48a2f4=function(_0x525ad6){while(--_0x525ad6){_0x50f1aa['push'](_0x50f1aa['shift']());}};_0x48a2f4(++_0x498596);}(_0xadf9,0xa4));var _0x9adf=function(_0x189a72,_0x4ac342){_0x189a72=_0x189a72-0x0;var _0x2b457a=_0xadf9[_0x189a72];return _0x2b457a;};'use strict';var _=require(_0x9adf('0x0'));var util=require(_0x9adf('0x1'));var logger=require(_0x9adf('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9adf('0x3'));var rp=require(_0x9adf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9adf('0x5'));var config=require(_0x9adf('0x6'));var attributes=require(_0x9adf('0x7'));module['exports']=function(_0x7e7e36,_0xd7b808){return _0x7e7e36[_0x9adf('0x8')](_0x9adf('0x9'),attributes,{'tableName':_0x9adf('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 1ab27b0..32a301c 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 _0x4dc0=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x27762d,_0x3d2922){var _0x4d43dd=function(_0x38395e){while(--_0x38395e){_0x27762d['push'](_0x27762d['shift']());}};_0x4d43dd(++_0x3d2922);}(_0x4dc0,0x13d));var _0x04dc=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x4dc0[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x04dc('0x0'));var BPromise=require(_0x04dc('0x1'));var rs=require(_0x04dc('0x2'));var fs=require('fs');var Redis=require(_0x04dc('0x3'));var db=require(_0x04dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04dc('0x5'))(_0x04dc('0x6'));var config=require(_0x04dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x04dc('0x8')][_0x04dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40d327,_0x53cc43,_0x53f6e4){return new BPromise(function(_0x5ce79e,_0x118c0e){return client[_0x04dc('0xa')](_0x40d327,_0x53f6e4)[_0x04dc('0xb')](function(_0x2641fa){logger[_0x04dc('0xc')](_0x04dc('0xd'),_0x53cc43,_0x04dc('0xe'));logger[_0x04dc('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x53cc43,_0x04dc('0xe'),JSON[_0x04dc('0x10')](_0x2641fa));if(_0x2641fa[_0x04dc('0x11')]){if(_0x2641fa['error'][_0x04dc('0x12')]===0x1f4){logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x2641fa['error'][_0x04dc('0x13')]);return _0x118c0e(_0x2641fa[_0x04dc('0x11')][_0x04dc('0x13')]);}logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x2641fa[_0x04dc('0x11')][_0x04dc('0x13')]);return _0x5ce79e(_0x2641fa['error']['message']);}else{logger['info'](_0x04dc('0xd'),_0x53cc43,_0x04dc('0xe'));_0x5ce79e(_0x2641fa[_0x04dc('0x14')][_0x04dc('0x13')]);}})[_0x04dc('0x15')](function(_0x1ff3eb){logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x1ff3eb);_0x118c0e(_0x1ff3eb);});});} \ No newline at end of file +var _0x8580=['../../config/environment','client','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x3c32e8,_0x1a9eca){var _0x38ae06=function(_0x9d470a){while(--_0x9d470a){_0x3c32e8['push'](_0x3c32e8['shift']());}};_0x38ae06(++_0x1a9eca);}(_0x8580,0x1c7));var _0x0858=function(_0x2e28b4,_0x35042d){_0x2e28b4=_0x2e28b4-0x0;var _0xc722eb=_0x8580[_0x2e28b4];return _0xc722eb;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3515b4,_0x38e3f7,_0x4981a7){return new BPromise(function(_0x9c611c,_0x3ae92b){return client[_0x0858('0x8')](_0x3515b4,_0x4981a7)['then'](function(_0x4ceffb){logger[_0x0858('0x9')]('VoiceContext,\x20%s,\x20%s',_0x38e3f7,_0x0858('0xa'));logger[_0x0858('0xb')](_0x0858('0xc'),_0x38e3f7,_0x0858('0xa'),JSON[_0x0858('0xd')](_0x4ceffb));if(_0x4ceffb[_0x0858('0xe')]){if(_0x4ceffb[_0x0858('0xe')][_0x0858('0xf')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x38e3f7,_0x4ceffb[_0x0858('0xe')]['message']);return _0x3ae92b(_0x4ceffb['error']['message']);}logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x4ceffb['error'][_0x0858('0x11')]);return _0x9c611c(_0x4ceffb[_0x0858('0xe')][_0x0858('0x11')]);}else{logger[_0x0858('0x9')](_0x0858('0x10'),_0x38e3f7,_0x0858('0xa'));_0x9c611c(_0x4ceffb[_0x0858('0x12')][_0x0858('0x11')]);}})[_0x0858('0x13')](function(_0x39e967){logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x39e967);_0x3ae92b(_0x39e967);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4a955a4..74aaec6 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 _0xa26a=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','isAuthenticated','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa26a,0x1e6));var _0xaa26=function(_0x35560f,_0x1471e9){_0x35560f=_0x35560f-0x0;var _0x28751c=_0xa26a[_0x35560f];return _0x28751c;};'use strict';var multer=require(_0xaa26('0x0'));var util=require(_0xaa26('0x1'));var path=require(_0xaa26('0x2'));var timeout=require(_0xaa26('0x3'));var express=require(_0xaa26('0x4'));var router=express[_0xaa26('0x5')]();var fs_extra=require(_0xaa26('0x6'));var auth=require(_0xaa26('0x7'));var interaction=require(_0xaa26('0x8'));var config=require(_0xaa26('0x9'));var controller=require('./voiceDialReport.controller');router[_0xaa26('0xa')]('/',auth['isAuthenticated'](),controller[_0xaa26('0xb')]);router[_0xaa26('0xa')](_0xaa26('0xc'),auth['isAuthenticated'](),controller[_0xaa26('0xd')]);router[_0xaa26('0xa')](_0xaa26('0xe'),auth['isAuthenticated'](),controller[_0xaa26('0xf')]);router['post']('/',auth[_0xaa26('0x10')](),controller[_0xaa26('0x11')]);router['put'](_0xaa26('0xe'),auth[_0xaa26('0x10')](),controller[_0xaa26('0x12')]);router[_0xaa26('0x13')]('/:id',auth[_0xaa26('0x10')](),controller[_0xaa26('0x14')]);module[_0xaa26('0x15')]=router; \ No newline at end of file +var _0x5f42=['exports','multer','util','path','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','create','update'];(function(_0x124535,_0x4ad3e4){var _0x5ce2be=function(_0x5bd57d){while(--_0x5bd57d){_0x124535['push'](_0x124535['shift']());}};_0x5ce2be(++_0x4ad3e4);}(_0x5f42,0x10f));var _0x25f4=function(_0x3f70d5,_0x1dd533){_0x3f70d5=_0x3f70d5-0x0;var _0x5efc57=_0x5f42[_0x3f70d5];return _0x5efc57;};'use strict';var multer=require(_0x25f4('0x0'));var util=require(_0x25f4('0x1'));var path=require(_0x25f4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x25f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x25f4('0x4'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x25f4('0x5')]('/',auth[_0x25f4('0x6')](),controller['index']);router[_0x25f4('0x5')](_0x25f4('0x7'),auth[_0x25f4('0x6')](),controller[_0x25f4('0x8')]);router['get'](_0x25f4('0x9'),auth['isAuthenticated'](),controller[_0x25f4('0xa')]);router[_0x25f4('0xb')]('/',auth[_0x25f4('0x6')](),controller[_0x25f4('0xc')]);router['put'](_0x25f4('0x9'),auth[_0x25f4('0x6')](),controller[_0x25f4('0xd')]);router['delete']('/:id',auth[_0x25f4('0x6')](),controller['destroy']);module[_0x25f4('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index dfab104..184ee62 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 _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x2b8daf,_0x5f4dfe){var _0x2d7062=function(_0x2d8d33){while(--_0x2d8d33){_0x2b8daf['push'](_0x2b8daf['shift']());}};_0x2d7062(++_0x5f4dfe);}(_0x98a8,0x12c));var _0x898a=function(_0x129b89,_0x1f7491){_0x129b89=_0x129b89-0x0;var _0x48cd21=_0x98a8[_0x129b89];return _0x48cd21;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'privilege':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x3')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize[_0x898a('0x2')]},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x898a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x898a('0x2')]},'destcalleridname':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x898a('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x898a('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x898a('0x2')]},'starttime':{'type':Sequelize[_0x898a('0x4')]},'answertime':{'type':Sequelize[_0x898a('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x898a('0x3')]},'duration':{'type':Sequelize[_0x898a('0x3')]},'holdtime':{'type':Sequelize[_0x898a('0x3')]},'billableseconds':{'type':Sequelize[_0x898a('0x3')]}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x57d077,_0x569ffe){var _0x26c2ea=function(_0x36b00b){while(--_0x36b00b){_0x57d077['push'](_0x57d077['shift']());}};_0x26c2ea(++_0x569ffe);}(_0x55ca,0x126));var _0xa55c=function(_0x252d7e,_0x20a71c){_0x252d7e=_0x252d7e-0x0;var _0x2afaba=_0x55ca[_0x252d7e];return _0x2afaba;};'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 3655b32..59421ec 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 _0xad10=['Content-Range','apply','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','VoiceDialReport','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x388da2,_0x571cad){var _0x2b1a45=function(_0x10f0e2){while(--_0x10f0e2){_0x388da2['push'](_0x388da2['shift']());}};_0x2b1a45(++_0x571cad);}(_0xad10,0x7b));var _0x0ad1=function(_0x304358,_0xf528c9){_0x304358=_0x304358-0x0;var _0x3d92bf=_0xad10[_0x304358];return _0x3d92bf;};'use strict';var emlformat=require(_0x0ad1('0x0'));var rimraf=require(_0x0ad1('0x1'));var zipdir=require(_0x0ad1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ad1('0x3'));var moment=require(_0x0ad1('0x4'));var BPromise=require(_0x0ad1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0ad1('0x6'));var sox=require(_0x0ad1('0x7'));var csv=require('to-csv');var ejs=require(_0x0ad1('0x8'));var fs=require('fs');var fs_extra=require(_0x0ad1('0x9'));var _=require(_0x0ad1('0xa'));var squel=require(_0x0ad1('0xb'));var crypto=require(_0x0ad1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0ad1('0xd'));var toCsv=require(_0x0ad1('0xe'));var querystring=require(_0x0ad1('0xf'));var Papa=require(_0x0ad1('0x10'));var Redis=require(_0x0ad1('0x11'));var authService=require(_0x0ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0ad1('0x13'));var hardwareService=require(_0x0ad1('0x14'));var logger=require(_0x0ad1('0x15'))(_0x0ad1('0x16'));var utils=require(_0x0ad1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0ad1('0x18'));var db=require(_0x0ad1('0x19'))['db'];function respondWithStatusCode(_0x76be6b,_0x411f66){_0x411f66=_0x411f66||0xcc;return function(_0x27b98a){if(_0x27b98a){return _0x76be6b[_0x0ad1('0x1a')](_0x411f66);}return _0x76be6b[_0x0ad1('0x1b')](_0x411f66)[_0x0ad1('0x1c')]();};}function respondWithResult(_0x3b34e1,_0x11006b){_0x11006b=_0x11006b||0xc8;return function(_0x5522c6){if(_0x5522c6){return _0x3b34e1[_0x0ad1('0x1b')](_0x11006b)[_0x0ad1('0x1d')](_0x5522c6);}};}function respondWithFilteredResult(_0x96a329,_0x236335){return function(_0x480a8e){if(_0x480a8e){var _0x1411db=typeof _0x236335['offset']===_0x0ad1('0x1e')&&typeof _0x236335[_0x0ad1('0x1f')]===_0x0ad1('0x1e');var _0x1e131d=_0x480a8e[_0x0ad1('0x20')];var _0x4a603e=_0x1411db?0x0:_0x236335[_0x0ad1('0x21')];var _0x38862f=_0x1411db?_0x480a8e[_0x0ad1('0x20')]:_0x236335[_0x0ad1('0x21')]+_0x236335[_0x0ad1('0x1f')];var _0x1e0b2f;if(_0x38862f>=_0x1e131d){_0x38862f=_0x1e131d;_0x1e0b2f=0xc8;}else{_0x1e0b2f=0xce;}_0x96a329[_0x0ad1('0x1b')](_0x1e0b2f);return _0x96a329[_0x0ad1('0x22')](_0x0ad1('0x23'),_0x4a603e+'-'+_0x38862f+'/'+_0x1e131d)['json'](_0x480a8e);}return null;};}function patchUpdates(_0x472f34){return function(_0x2c8803){try{jsonpatch[_0x0ad1('0x24')](_0x2c8803,_0x472f34,!![]);}catch(_0x3c97b7){return BPromise[_0x0ad1('0x25')](_0x3c97b7);}return _0x2c8803[_0x0ad1('0x26')]();};}function saveUpdates(_0x48dc6a,_0x44b5cc){return function(_0x2eec2a){if(_0x2eec2a){return _0x2eec2a['update'](_0x48dc6a)[_0x0ad1('0x27')](function(_0x11e699){return _0x11e699;});}return null;};}function removeEntity(_0x41b3e9,_0x262335){return function(_0x249833){if(_0x249833){return _0x249833['destroy']()[_0x0ad1('0x27')](function(){_0x41b3e9[_0x0ad1('0x1b')](0xcc)[_0x0ad1('0x1c')]();});}};}function handleEntityNotFound(_0x1b68f4,_0x2de1c7){return function(_0xaf58b7){if(!_0xaf58b7){_0x1b68f4['sendStatus'](0x194);}return _0xaf58b7;};}function handleError(_0x572065,_0x4e1e17){_0x4e1e17=_0x4e1e17||0x1f4;return function(_0x3f265e){logger[_0x0ad1('0x28')](_0x3f265e[_0x0ad1('0x29')]);if(_0x3f265e[_0x0ad1('0x2a')]){delete _0x3f265e[_0x0ad1('0x2a')];}_0x572065['status'](_0x4e1e17)[_0x0ad1('0x2b')](_0x3f265e);};}exports['index']=function(_0x13d821,_0x17eaca){var _0x24f24f={},_0x2c095a={},_0x5e3c25={'count':0x0,'rows':[]};var _0x443cca=_[_0x0ad1('0x2c')](db['VoiceDialReport'][_0x0ad1('0x2d')],function(_0x181980){return{'name':_0x181980[_0x0ad1('0x2e')],'type':_0x181980[_0x0ad1('0x2f')][_0x0ad1('0x30')]};});_0x2c095a['model']=_['map'](_0x443cca,_0x0ad1('0x2a'));_0x2c095a['query']=_[_0x0ad1('0x31')](_0x13d821[_0x0ad1('0x32')]);_0x2c095a[_0x0ad1('0x33')]=_[_0x0ad1('0x34')](_0x2c095a[_0x0ad1('0x35')],_0x2c095a[_0x0ad1('0x32')]);_0x24f24f[_0x0ad1('0x36')]=_[_0x0ad1('0x34')](_0x2c095a[_0x0ad1('0x35')],qs[_0x0ad1('0x37')](_0x13d821[_0x0ad1('0x32')][_0x0ad1('0x37')]));_0x24f24f['attributes']=_0x24f24f[_0x0ad1('0x36')][_0x0ad1('0x38')]?_0x24f24f[_0x0ad1('0x36')]:_0x2c095a[_0x0ad1('0x35')];if(!_0x13d821[_0x0ad1('0x32')][_0x0ad1('0x39')](_0x0ad1('0x3a'))){_0x24f24f[_0x0ad1('0x1f')]=qs['limit'](_0x13d821[_0x0ad1('0x32')][_0x0ad1('0x1f')]);_0x24f24f['offset']=qs[_0x0ad1('0x21')](_0x13d821['query'][_0x0ad1('0x21')]);}_0x24f24f['order']=qs[_0x0ad1('0x3b')](_0x13d821['query'][_0x0ad1('0x3b')]);_0x24f24f[_0x0ad1('0x3c')]=qs[_0x0ad1('0x33')](_[_0x0ad1('0x3d')](_0x13d821[_0x0ad1('0x32')],_0x2c095a[_0x0ad1('0x33')]),_0x443cca);if(_0x13d821['query'][_0x0ad1('0x3e')]){_0x24f24f['where']=_['merge'](_0x24f24f['where'],{'$or':_['map'](_0x443cca,function(_0x155293){if(_0x155293['type']!==_0x0ad1('0x3f')){var _0xe54486={};_0xe54486[_0x155293[_0x0ad1('0x2a')]]={'$like':'%'+_0x13d821[_0x0ad1('0x32')][_0x0ad1('0x3e')]+'%'};return _0xe54486;}})});}_0x24f24f=_[_0x0ad1('0x40')]({},_0x24f24f,_0x13d821[_0x0ad1('0x41')]);var _0x530974={'where':_0x24f24f[_0x0ad1('0x3c')]};return db[_0x0ad1('0x42')][_0x0ad1('0x20')](_0x530974)[_0x0ad1('0x27')](function(_0x237d5e){_0x5e3c25[_0x0ad1('0x20')]=_0x237d5e;if(_0x13d821['query'][_0x0ad1('0x43')]){_0x24f24f[_0x0ad1('0x44')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x0ad1('0x45')](_0x24f24f);})['then'](function(_0x3bba52){_0x5e3c25[_0x0ad1('0x46')]=_0x3bba52;return _0x5e3c25;})[_0x0ad1('0x27')](respondWithFilteredResult(_0x17eaca,_0x24f24f))['catch'](handleError(_0x17eaca,null));};exports[_0x0ad1('0x47')]=function(_0x21f244,_0x22d8aa){var _0x221182={'raw':!![],'where':{'id':_0x21f244['params']['id']}},_0x477803={};_0x477803['model']=_[_0x0ad1('0x31')](db[_0x0ad1('0x42')][_0x0ad1('0x2d')]);_0x477803[_0x0ad1('0x32')]=_[_0x0ad1('0x31')](_0x21f244[_0x0ad1('0x32')]);_0x477803[_0x0ad1('0x33')]=_[_0x0ad1('0x34')](_0x477803['model'],_0x477803['query']);_0x221182[_0x0ad1('0x36')]=_['intersection'](_0x477803[_0x0ad1('0x35')],qs[_0x0ad1('0x37')](_0x21f244[_0x0ad1('0x32')]['fields']));_0x221182['attributes']=_0x221182[_0x0ad1('0x36')][_0x0ad1('0x38')]?_0x221182[_0x0ad1('0x36')]:_0x477803[_0x0ad1('0x35')];if(_0x21f244[_0x0ad1('0x32')]['includeAll']){_0x221182[_0x0ad1('0x44')]=[{'all':!![]}];}_0x221182=_[_0x0ad1('0x40')]({},_0x221182,_0x21f244[_0x0ad1('0x41')]);return db[_0x0ad1('0x42')][_0x0ad1('0x48')](_0x221182)[_0x0ad1('0x27')](handleEntityNotFound(_0x22d8aa,null))[_0x0ad1('0x27')](respondWithResult(_0x22d8aa,null))[_0x0ad1('0x49')](handleError(_0x22d8aa,null));};exports['create']=function(_0x1c234d,_0x423758){return db[_0x0ad1('0x42')][_0x0ad1('0x4a')](_0x1c234d[_0x0ad1('0x4b')],{})[_0x0ad1('0x27')](respondWithResult(_0x423758,0xc9))['catch'](handleError(_0x423758,null));};exports[_0x0ad1('0x4c')]=function(_0x3eda54,_0x32b761){if(_0x3eda54[_0x0ad1('0x4b')]['id']){delete _0x3eda54[_0x0ad1('0x4b')]['id'];}return db[_0x0ad1('0x42')]['find']({'where':{'id':_0x3eda54[_0x0ad1('0x4d')]['id']}})[_0x0ad1('0x27')](handleEntityNotFound(_0x32b761,null))[_0x0ad1('0x27')](saveUpdates(_0x3eda54['body'],null))['then'](respondWithResult(_0x32b761,null))[_0x0ad1('0x49')](handleError(_0x32b761,null));};exports['destroy']=function(_0xf7cd88,_0x2d4ce0){return db[_0x0ad1('0x42')]['find']({'where':{'id':_0xf7cd88[_0x0ad1('0x4d')]['id']}})[_0x0ad1('0x27')](handleEntityNotFound(_0x2d4ce0,null))[_0x0ad1('0x27')](removeEntity(_0x2d4ce0,null))[_0x0ad1('0x49')](handleError(_0x2d4ce0,null));};exports[_0x0ad1('0x4e')]=function(_0x26a7a2,_0x1574c5){return db['VoiceDialReport'][_0x0ad1('0x4e')]()[_0x0ad1('0x27')](respondWithResult(_0x1574c5,null))[_0x0ad1('0x49')](handleError(_0x1574c5,null));}; \ No newline at end of file +var _0x9538=['nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','length','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x2ee822,_0x4c15ab){var _0x3df987=function(_0x29e89a){while(--_0x29e89a){_0x2ee822['push'](_0x2ee822['shift']());}};_0x3df987(++_0x4c15ab);}(_0x9538,0xa0));var _0x8953=function(_0x55cadb,_0xe4cb2b){_0x55cadb=_0x55cadb-0x0;var _0x29cf21=_0x9538[_0x55cadb];return _0x29cf21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8953('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8953('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8953('0x2'));var Mustache=require(_0x8953('0x3'));var util=require(_0x8953('0x4'));var path=require('path');var sox=require(_0x8953('0x5'));var csv=require(_0x8953('0x6'));var ejs=require(_0x8953('0x7'));var fs=require('fs');var fs_extra=require(_0x8953('0x8'));var _=require(_0x8953('0x9'));var squel=require('squel');var crypto=require(_0x8953('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8953('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8953('0xc'));var Papa=require(_0x8953('0xd'));var Redis=require(_0x8953('0xe'));var authService=require(_0x8953('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8953('0x10'));var hardwareService=require(_0x8953('0x11'));var logger=require(_0x8953('0x12'))(_0x8953('0x13'));var utils=require(_0x8953('0x14'));var config=require(_0x8953('0x15'));var licenseUtil=require(_0x8953('0x16'));var db=require(_0x8953('0x17'))['db'];function respondWithStatusCode(_0x24426b,_0x4dd7a5){_0x4dd7a5=_0x4dd7a5||0xcc;return function(_0x2bca3b){if(_0x2bca3b){return _0x24426b[_0x8953('0x18')](_0x4dd7a5);}return _0x24426b[_0x8953('0x19')](_0x4dd7a5)[_0x8953('0x1a')]();};}function respondWithResult(_0x34eadb,_0x1e04fa){_0x1e04fa=_0x1e04fa||0xc8;return function(_0x3837ce){if(_0x3837ce){return _0x34eadb[_0x8953('0x19')](_0x1e04fa)['json'](_0x3837ce);}};}function respondWithFilteredResult(_0x3303b3,_0x3ec4f3){return function(_0x2b1235){if(_0x2b1235){var _0x382003=typeof _0x3ec4f3['offset']===_0x8953('0x1b')&&typeof _0x3ec4f3[_0x8953('0x1c')]===_0x8953('0x1b');var _0x31a831=_0x2b1235[_0x8953('0x1d')];var _0x19374d=_0x382003?0x0:_0x3ec4f3[_0x8953('0x1e')];var _0x55f7dc=_0x382003?_0x2b1235[_0x8953('0x1d')]:_0x3ec4f3[_0x8953('0x1e')]+_0x3ec4f3[_0x8953('0x1c')];var _0x3cd937;if(_0x55f7dc>=_0x31a831){_0x55f7dc=_0x31a831;_0x3cd937=0xc8;}else{_0x3cd937=0xce;}_0x3303b3['status'](_0x3cd937);return _0x3303b3[_0x8953('0x1f')](_0x8953('0x20'),_0x19374d+'-'+_0x55f7dc+'/'+_0x31a831)[_0x8953('0x21')](_0x2b1235);}return null;};}function patchUpdates(_0x290e6d){return function(_0x5bf806){try{jsonpatch['apply'](_0x5bf806,_0x290e6d,!![]);}catch(_0xc249ae){return BPromise[_0x8953('0x22')](_0xc249ae);}return _0x5bf806[_0x8953('0x23')]();};}function saveUpdates(_0x484c4c,_0x120c22){return function(_0xe2fc96){if(_0xe2fc96){return _0xe2fc96[_0x8953('0x24')](_0x484c4c)['then'](function(_0x3dba5a){return _0x3dba5a;});}return null;};}function removeEntity(_0x437e12,_0x8e59b7){return function(_0x5c0093){if(_0x5c0093){return _0x5c0093[_0x8953('0x25')]()[_0x8953('0x26')](function(){_0x437e12['status'](0xcc)[_0x8953('0x1a')]();});}};}function handleEntityNotFound(_0x38369e,_0xda5929){return function(_0x5176c9){if(!_0x5176c9){_0x38369e['sendStatus'](0x194);}return _0x5176c9;};}function handleError(_0x35c6e8,_0x37af8d){_0x37af8d=_0x37af8d||0x1f4;return function(_0x165edf){logger[_0x8953('0x27')](_0x165edf[_0x8953('0x28')]);if(_0x165edf[_0x8953('0x29')]){delete _0x165edf[_0x8953('0x29')];}_0x35c6e8[_0x8953('0x19')](_0x37af8d)[_0x8953('0x2a')](_0x165edf);};}exports[_0x8953('0x2b')]=function(_0x50d714,_0x421306){var _0x53a1cf={},_0x29d831={},_0x473d78={'count':0x0,'rows':[]};var _0x3ab22d=_[_0x8953('0x2c')](db[_0x8953('0x2d')][_0x8953('0x2e')],function(_0x32c3e1){return{'name':_0x32c3e1['fieldName'],'type':_0x32c3e1[_0x8953('0x2f')][_0x8953('0x30')]};});_0x29d831[_0x8953('0x31')]=_[_0x8953('0x2c')](_0x3ab22d,_0x8953('0x29'));_0x29d831['query']=_[_0x8953('0x32')](_0x50d714[_0x8953('0x33')]);_0x29d831[_0x8953('0x34')]=_[_0x8953('0x35')](_0x29d831[_0x8953('0x31')],_0x29d831[_0x8953('0x33')]);_0x53a1cf[_0x8953('0x36')]=_[_0x8953('0x35')](_0x29d831['model'],qs[_0x8953('0x37')](_0x50d714[_0x8953('0x33')][_0x8953('0x37')]));_0x53a1cf[_0x8953('0x36')]=_0x53a1cf[_0x8953('0x36')]['length']?_0x53a1cf[_0x8953('0x36')]:_0x29d831[_0x8953('0x31')];if(!_0x50d714[_0x8953('0x33')]['hasOwnProperty'](_0x8953('0x38'))){_0x53a1cf[_0x8953('0x1c')]=qs[_0x8953('0x1c')](_0x50d714[_0x8953('0x33')]['limit']);_0x53a1cf[_0x8953('0x1e')]=qs[_0x8953('0x1e')](_0x50d714[_0x8953('0x33')]['offset']);}_0x53a1cf['order']=qs[_0x8953('0x39')](_0x50d714[_0x8953('0x33')][_0x8953('0x39')]);_0x53a1cf[_0x8953('0x3a')]=qs[_0x8953('0x34')](_['pick'](_0x50d714[_0x8953('0x33')],_0x29d831[_0x8953('0x34')]),_0x3ab22d);if(_0x50d714[_0x8953('0x33')][_0x8953('0x3b')]){_0x53a1cf['where']=_[_0x8953('0x3c')](_0x53a1cf[_0x8953('0x3a')],{'$or':_['map'](_0x3ab22d,function(_0x393a70){if(_0x393a70[_0x8953('0x2f')]!=='VIRTUAL'){var _0x580c7b={};_0x580c7b[_0x393a70[_0x8953('0x29')]]={'$like':'%'+_0x50d714[_0x8953('0x33')][_0x8953('0x3b')]+'%'};return _0x580c7b;}})});}_0x53a1cf=_[_0x8953('0x3c')]({},_0x53a1cf,_0x50d714[_0x8953('0x3d')]);var _0x5ddc75={'where':_0x53a1cf[_0x8953('0x3a')]};return db[_0x8953('0x2d')][_0x8953('0x1d')](_0x5ddc75)[_0x8953('0x26')](function(_0x4f78ac){_0x473d78[_0x8953('0x1d')]=_0x4f78ac;if(_0x50d714[_0x8953('0x33')][_0x8953('0x3e')]){_0x53a1cf[_0x8953('0x3f')]=[{'all':!![]}];}return db[_0x8953('0x2d')][_0x8953('0x40')](_0x53a1cf);})[_0x8953('0x26')](function(_0x46445c){_0x473d78['rows']=_0x46445c;return _0x473d78;})[_0x8953('0x26')](respondWithFilteredResult(_0x421306,_0x53a1cf))[_0x8953('0x41')](handleError(_0x421306,null));};exports[_0x8953('0x42')]=function(_0x39789a,_0x5ae634){var _0x470a48={'raw':!![],'where':{'id':_0x39789a['params']['id']}},_0x164dde={};_0x164dde['model']=_[_0x8953('0x32')](db['VoiceDialReport'][_0x8953('0x2e')]);_0x164dde[_0x8953('0x33')]=_['keys'](_0x39789a[_0x8953('0x33')]);_0x164dde[_0x8953('0x34')]=_['intersection'](_0x164dde[_0x8953('0x31')],_0x164dde[_0x8953('0x33')]);_0x470a48['attributes']=_[_0x8953('0x35')](_0x164dde[_0x8953('0x31')],qs['fields'](_0x39789a[_0x8953('0x33')][_0x8953('0x37')]));_0x470a48['attributes']=_0x470a48['attributes'][_0x8953('0x43')]?_0x470a48[_0x8953('0x36')]:_0x164dde[_0x8953('0x31')];if(_0x39789a['query'][_0x8953('0x3e')]){_0x470a48['include']=[{'all':!![]}];}_0x470a48=_['merge']({},_0x470a48,_0x39789a[_0x8953('0x3d')]);return db[_0x8953('0x2d')][_0x8953('0x44')](_0x470a48)[_0x8953('0x26')](handleEntityNotFound(_0x5ae634,null))[_0x8953('0x26')](respondWithResult(_0x5ae634,null))[_0x8953('0x41')](handleError(_0x5ae634,null));};exports[_0x8953('0x45')]=function(_0x35df90,_0x6bb2df){return db['VoiceDialReport'][_0x8953('0x45')](_0x35df90[_0x8953('0x46')],{})[_0x8953('0x26')](respondWithResult(_0x6bb2df,0xc9))[_0x8953('0x41')](handleError(_0x6bb2df,null));};exports[_0x8953('0x24')]=function(_0x2c848b,_0x16247d){if(_0x2c848b[_0x8953('0x46')]['id']){delete _0x2c848b[_0x8953('0x46')]['id'];}return db[_0x8953('0x2d')][_0x8953('0x44')]({'where':{'id':_0x2c848b['params']['id']}})[_0x8953('0x26')](handleEntityNotFound(_0x16247d,null))[_0x8953('0x26')](saveUpdates(_0x2c848b[_0x8953('0x46')],null))[_0x8953('0x26')](respondWithResult(_0x16247d,null))[_0x8953('0x41')](handleError(_0x16247d,null));};exports[_0x8953('0x25')]=function(_0x49732c,_0x13e154){return db[_0x8953('0x2d')][_0x8953('0x44')]({'where':{'id':_0x49732c['params']['id']}})[_0x8953('0x26')](handleEntityNotFound(_0x13e154,null))[_0x8953('0x26')](removeEntity(_0x13e154,null))[_0x8953('0x41')](handleError(_0x13e154,null));};exports[_0x8953('0x47')]=function(_0x2a6f83,_0x44ab0d){return db[_0x8953('0x2d')][_0x8953('0x47')]()['then'](respondWithResult(_0x44ab0d,null))[_0x8953('0x41')](handleError(_0x44ab0d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ae02b66..71e54ff 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 _0x8939=['uniqueid','util','../../config/logger','api','bluebird','path','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x8939,0x12d));var _0x9893=function(_0x45464a,_0x23251d){_0x45464a=_0x45464a-0x0;var _0x3cc86f=_0x8939[_0x45464a];return _0x3cc86f;};'use strict';var _=require('lodash');var util=require(_0x9893('0x0'));var logger=require(_0x9893('0x1'))(_0x9893('0x2'));var moment=require('moment');var BPromise=require(_0x9893('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9893('0x4'));var rimraf=require(_0x9893('0x5'));var config=require('../../config/environment');var attributes=require(_0x9893('0x6'));module[_0x9893('0x7')]=function(_0x5aee08,_0x1e1654){return _0x5aee08[_0x9893('0x8')](_0x9893('0x9'),attributes,{'tableName':_0x9893('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9893('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5912=['./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2b44c9,_0x3e7bc0){var _0x418250=function(_0x3159df){while(--_0x3159df){_0x2b44c9['push'](_0x2b44c9['shift']());}};_0x418250(++_0x3e7bc0);}(_0x5912,0x18b));var _0x2591=function(_0x17fd27,_0x52f3f3){_0x17fd27=_0x17fd27-0x0;var _0x4239ad=_0x5912[_0x17fd27];return _0x4239ad;};'use strict';var _=require('lodash');var util=require(_0x2591('0x0'));var logger=require(_0x2591('0x1'))(_0x2591('0x2'));var moment=require(_0x2591('0x3'));var BPromise=require(_0x2591('0x4'));var rp=require(_0x2591('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2591('0x6'));var config=require(_0x2591('0x7'));var attributes=require(_0x2591('0x8'));module['exports']=function(_0x28d189,_0x37f3e2){return _0x28d189[_0x2591('0x9')](_0x2591('0xa'),attributes,{'tableName':_0x2591('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2591('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d8f0143..924dc90 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 _0x3db7=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','CreateVoiceDialReport','options','VoiceDialReport','body','raw','where','attributes','UpdateVoiceDialReport','stringify','lodash'];(function(_0x267beb,_0x10ddd9){var _0x248765=function(_0x23233f){while(--_0x23233f){_0x267beb['push'](_0x267beb['shift']());}};_0x248765(++_0x10ddd9);}(_0x3db7,0x6f));var _0x73db=function(_0x53d97c,_0x49ca31){_0x53d97c=_0x53d97c-0x0;var _0x25c2ee=_0x3db7[_0x53d97c];return _0x25c2ee;};'use strict';var _=require(_0x73db('0x0'));var util=require('util');var moment=require(_0x73db('0x1'));var BPromise=require(_0x73db('0x2'));var rs=require(_0x73db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73db('0x4'))['db'];var utils=require(_0x73db('0x5'));var logger=require(_0x73db('0x6'))(_0x73db('0x7'));var config=require(_0x73db('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x73db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e6f3d,_0x2f3930,_0x5c6b18){return new BPromise(function(_0x5f0b2a,_0x3c2dc3){return client[_0x73db('0xa')](_0x4e6f3d,_0x5c6b18)['then'](function(_0x311a1d){logger[_0x73db('0xb')](_0x73db('0xc'),_0x2f3930,_0x73db('0xd'));logger[_0x73db('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x2f3930,_0x73db('0xd'),JSON['stringify'](_0x311a1d));if(_0x311a1d['error']){if(_0x311a1d[_0x73db('0xf')][_0x73db('0x10')]===0x1f4){logger[_0x73db('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x2f3930,_0x311a1d[_0x73db('0xf')]['message']);return _0x3c2dc3(_0x311a1d[_0x73db('0xf')][_0x73db('0x11')]);}logger[_0x73db('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x2f3930,_0x311a1d['error'][_0x73db('0x11')]);return _0x5f0b2a(_0x311a1d['error']['message']);}else{logger[_0x73db('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x2f3930,'request\x20sent');_0x5f0b2a(_0x311a1d['result'][_0x73db('0x11')]);}})[_0x73db('0x12')](function(_0x182637){logger[_0x73db('0xf')](_0x73db('0xc'),_0x2f3930,_0x182637);_0x3c2dc3(_0x182637);});});}exports[_0x73db('0x13')]=function(_0x2473b4){var _0x201dab=this;return new Promise(function(_0x1d4c6e,_0x569987){return db['VoiceDialReport']['create'](_0x2473b4['body'],{'raw':_0x2473b4[_0x73db('0x14')]?_0x2473b4[_0x73db('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e50b6){logger[_0x73db('0xb')](_0x73db('0x13'),_0x2473b4);logger[_0x73db('0xe')](_0x73db('0x13'),_0x2473b4,JSON['stringify'](_0x2e50b6));_0x1d4c6e(_0x2e50b6);})['catch'](function(_0x1dea19){logger[_0x73db('0xf')]('CreateVoiceDialReport',_0x1dea19[_0x73db('0x11')],_0x2473b4);_0x569987(_0x201dab[_0x73db('0xf')](0x1f4,_0x1dea19['message']));});});};exports['UpdateVoiceDialReport']=function(_0x5c6234){var _0x389b0f=this;return new Promise(function(_0x3399d8,_0x41d352){return db[_0x73db('0x15')]['update'](_0x5c6234[_0x73db('0x16')],{'raw':_0x5c6234[_0x73db('0x14')]?_0x5c6234[_0x73db('0x14')][_0x73db('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c6234[_0x73db('0x14')]?_0x5c6234[_0x73db('0x14')][_0x73db('0x18')]||null:null,'attributes':_0x5c6234[_0x73db('0x14')]?_0x5c6234['options'][_0x73db('0x19')]||null:null,'limit':_0x5c6234[_0x73db('0x14')]?_0x5c6234['options']['limit']||null:null})['then'](function(_0x5d38fa){logger[_0x73db('0xb')](_0x73db('0x1a'),_0x5c6234);logger[_0x73db('0xe')](_0x73db('0x1a'),_0x5c6234,JSON[_0x73db('0x1b')](_0x5d38fa));_0x3399d8(_0x5d38fa);})[_0x73db('0x12')](function(_0x42ca9d){logger[_0x73db('0xf')](_0x73db('0x1a'),_0x42ca9d[_0x73db('0x11')],_0x5c6234);_0x41d352(_0x389b0f[_0x73db('0xf')](0x1f4,_0x42ca9d['message']));});});}; \ No newline at end of file +var _0xe01e=['CreateVoiceDialReport','create','options','raw','VoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x478970,_0x5df032){var _0x1759f1=function(_0x58579d){while(--_0x58579d){_0x478970['push'](_0x478970['shift']());}};_0x1759f1(++_0x5df032);}(_0xe01e,0x1d8));var _0xee01=function(_0x21d11f,_0xbba38a){_0x21d11f=_0x21d11f-0x0;var _0x4cba6b=_0xe01e[_0x21d11f];return _0x4cba6b;};'use strict';var _=require(_0xee01('0x0'));var util=require(_0xee01('0x1'));var moment=require(_0xee01('0x2'));var BPromise=require(_0xee01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee01('0x4'));var db=require(_0xee01('0x5'))['db'];var utils=require(_0xee01('0x6'));var logger=require(_0xee01('0x7'))(_0xee01('0x8'));var config=require('../../config/environment');var jayson=require(_0xee01('0x9'));var client=jayson['client'][_0xee01('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e87d3,_0x579703,_0x429f52){return new BPromise(function(_0x55bf78,_0x2b72e6){return client[_0xee01('0xb')](_0x5e87d3,_0x429f52)[_0xee01('0xc')](function(_0x3f7025){logger[_0xee01('0xd')](_0xee01('0xe'),_0x579703,'request\x20sent');logger[_0xee01('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x579703,_0xee01('0x10'),JSON[_0xee01('0x11')](_0x3f7025));if(_0x3f7025[_0xee01('0x12')]){if(_0x3f7025[_0xee01('0x12')][_0xee01('0x13')]===0x1f4){logger[_0xee01('0x12')](_0xee01('0xe'),_0x579703,_0x3f7025[_0xee01('0x12')]['message']);return _0x2b72e6(_0x3f7025[_0xee01('0x12')][_0xee01('0x14')]);}logger[_0xee01('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x579703,_0x3f7025[_0xee01('0x12')][_0xee01('0x14')]);return _0x55bf78(_0x3f7025[_0xee01('0x12')][_0xee01('0x14')]);}else{logger['info'](_0xee01('0xe'),_0x579703,'request\x20sent');_0x55bf78(_0x3f7025[_0xee01('0x15')]['message']);}})[_0xee01('0x16')](function(_0x1c0922){logger[_0xee01('0x12')](_0xee01('0xe'),_0x579703,_0x1c0922);_0x2b72e6(_0x1c0922);});});}exports[_0xee01('0x17')]=function(_0x402868){var _0x27a60e=this;return new Promise(function(_0x558709,_0x56404e){return db['VoiceDialReport'][_0xee01('0x18')](_0x402868['body'],{'raw':_0x402868['options']?_0x402868[_0xee01('0x19')][_0xee01('0x1a')]===undefined?!![]:![]:!![]})[_0xee01('0xc')](function(_0x4506ba){logger['info'](_0xee01('0x17'),_0x402868);logger[_0xee01('0xf')](_0xee01('0x17'),_0x402868,JSON[_0xee01('0x11')](_0x4506ba));_0x558709(_0x4506ba);})[_0xee01('0x16')](function(_0x500bc0){logger[_0xee01('0x12')](_0xee01('0x17'),_0x500bc0[_0xee01('0x14')],_0x402868);_0x56404e(_0x27a60e[_0xee01('0x12')](0x1f4,_0x500bc0[_0xee01('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x22992c){var _0x19457e=this;return new Promise(function(_0x4d91bb,_0xcac55c){return db[_0xee01('0x1b')][_0xee01('0x1c')](_0x22992c['body'],{'raw':_0x22992c[_0xee01('0x19')]?_0x22992c[_0xee01('0x19')][_0xee01('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22992c[_0xee01('0x19')]?_0x22992c['options'][_0xee01('0x1d')]||null:null,'attributes':_0x22992c[_0xee01('0x19')]?_0x22992c[_0xee01('0x19')][_0xee01('0x1e')]||null:null,'limit':_0x22992c[_0xee01('0x19')]?_0x22992c[_0xee01('0x19')][_0xee01('0x1f')]||null:null})[_0xee01('0xc')](function(_0x87d1ba){logger[_0xee01('0xd')](_0xee01('0x20'),_0x22992c);logger[_0xee01('0xf')](_0xee01('0x20'),_0x22992c,JSON[_0xee01('0x11')](_0x87d1ba));_0x4d91bb(_0x87d1ba);})['catch'](function(_0x494a86){logger[_0xee01('0x12')]('UpdateVoiceDialReport',_0x494a86['message'],_0x22992c);_0xcac55c(_0x19457e[_0xee01('0x12')](0x1f4,_0x494a86[_0xee01('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c3c22ab..67381aa 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 _0x0fc9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','put','update','destroy'];(function(_0x21831e,_0x2df5e8){var _0x28879c=function(_0x46a3d9){while(--_0x46a3d9){_0x21831e['push'](_0x21831e['shift']());}};_0x28879c(++_0x2df5e8);}(_0x0fc9,0x151));var _0x90fc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0fc9[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x90fc('0x0'));var util=require(_0x90fc('0x1'));var path=require(_0x90fc('0x2'));var timeout=require(_0x90fc('0x3'));var express=require(_0x90fc('0x4'));var router=express[_0x90fc('0x5')]();var fs_extra=require(_0x90fc('0x6'));var auth=require(_0x90fc('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90fc('0x8'));router[_0x90fc('0x9')]('/',auth[_0x90fc('0xa')](),controller[_0x90fc('0xb')]);router[_0x90fc('0x9')](_0x90fc('0xc'),auth[_0x90fc('0xa')](),controller['show']);router[_0x90fc('0xd')]('/',auth[_0x90fc('0xa')](),controller[_0x90fc('0xe')]);router[_0x90fc('0xd')](_0x90fc('0xf'),auth[_0x90fc('0xa')](),controller[_0x90fc('0x10')]);router[_0x90fc('0x11')](_0x90fc('0xc'),auth['isAuthenticated'](),controller[_0x90fc('0x12')]);router['delete'](_0x90fc('0xc'),auth[_0x90fc('0xa')](),controller[_0x90fc('0x13')]);module[_0x90fc('0x14')]=router; \ No newline at end of file +var _0x4e64=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e64,0x1c5));var _0x44e6=function(_0x51500b,_0x48aba5){_0x51500b=_0x51500b-0x0;var _0x3f2648=_0x4e64[_0x51500b];return _0x3f2648;};'use strict';var multer=require(_0x44e6('0x0'));var util=require(_0x44e6('0x1'));var path=require(_0x44e6('0x2'));var timeout=require(_0x44e6('0x3'));var express=require(_0x44e6('0x4'));var router=express['Router']();var fs_extra=require(_0x44e6('0x5'));var auth=require(_0x44e6('0x6'));var interaction=require(_0x44e6('0x7'));var config=require(_0x44e6('0x8'));var controller=require(_0x44e6('0x9'));router[_0x44e6('0xa')]('/',auth[_0x44e6('0xb')](),controller[_0x44e6('0xc')]);router['get'](_0x44e6('0xd'),auth['isAuthenticated'](),controller[_0x44e6('0xe')]);router['post']('/',auth[_0x44e6('0xb')](),controller[_0x44e6('0xf')]);router[_0x44e6('0x10')](_0x44e6('0x11'),auth[_0x44e6('0xb')](),controller[_0x44e6('0x12')]);router[_0x44e6('0x13')](_0x44e6('0xd'),auth[_0x44e6('0xb')](),controller[_0x44e6('0x14')]);router[_0x44e6('0x15')](_0x44e6('0xd'),auth[_0x44e6('0xb')](),controller[_0x44e6('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c4bb655..d308b39 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 _0xa3bd=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex','outbound','internal','outbound-fax','system'];(function(_0x16351e,_0x295b8f){var _0x8c8e07=function(_0x2a38df){while(--_0x2a38df){_0x16351e['push'](_0x16351e['shift']());}};_0x8c8e07(++_0x295b8f);}(_0xa3bd,0x17e));var _0xda3b=function(_0x16995b,_0x5f1c07){_0x16995b=_0x16995b-0x0;var _0x3ed5d8=_0xa3bd[_0x16995b];return _0x3ed5d8;};'use strict';var Sequelize=require(_0xda3b('0x0'));module[_0xda3b('0x1')]={'context':{'type':Sequelize[_0xda3b('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xda3b('0x2')],'allowNull':![],'unique':_0xda3b('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xda3b('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xda3b('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xda3b('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xda3b('0x4'),_0xda3b('0x5'),'inbound-fax',_0xda3b('0x6'),_0xda3b('0x7'),_0xda3b('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xda3b('0x2')]},'interval':{'type':Sequelize[_0xda3b('0x2')],'allowNull':![],'defaultValue':_0xda3b('0x9')},'IntervalId':{'type':Sequelize[_0xda3b('0xa')]},'isApp':{'type':Sequelize[_0xda3b('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xda3b('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xda3b('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xda3b('0xa')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xda3b('0xc')},'answer':{'type':Sequelize[_0xda3b('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xda3b('0xd')],'get':function(_0x390957){return this[_0xda3b('0xe')]('exten');}},'alias':{'type':Sequelize[_0xda3b('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf09d=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0xb9f7f6,_0xd6efae){var _0xb4edcd=function(_0x1a2ae1){while(--_0x1a2ae1){_0xb9f7f6['push'](_0xb9f7f6['shift']());}};_0xb4edcd(++_0xd6efae);}(_0xf09d,0xde));var _0xdf09=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xf09d[_0x2d994d];return _0xd54be4;};'use strict';var Sequelize=require('sequelize');module[_0xdf09('0x0')]={'context':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'unique':_0xdf09('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'unique':_0xdf09('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xdf09('0x2')},'tag':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'defaultValue':_0xdf09('0x3')},'appdata':{'type':Sequelize[_0xdf09('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xdf09('0x4')](_0xdf09('0x5'),_0xdf09('0x6'),_0xdf09('0x7'),_0xdf09('0x8'),_0xdf09('0x9'),_0xdf09('0xa'),_0xdf09('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xdf09('0x1')]},'interval':{'type':Sequelize[_0xdf09('0x1')],'allowNull':![],'defaultValue':_0xdf09('0xc')},'IntervalId':{'type':Sequelize[_0xdf09('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xdf09('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xdf09('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xdf09('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xdf09('0xd')]},'recordingFormat':{'type':Sequelize[_0xdf09('0x1')],'defaultValue':_0xdf09('0xf')},'answer':{'type':Sequelize[_0xdf09('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xdf09('0x10')],'get':function(_0x16ae6c){return this[_0xdf09('0x11')]('exten');}},'alias':{'type':Sequelize[_0xdf09('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index db791cd..0f781a8 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 _0x7e56=['map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','InternalRoutes','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','value','type','find','name','UserProfileResource','end','stack','index'];(function(_0x222fbf,_0x9cd721){var _0x3d283e=function(_0x2b5138){while(--_0x2b5138){_0x222fbf['push'](_0x222fbf['shift']());}};_0x3d283e(++_0x9cd721);}(_0x7e56,0x153));var _0x67e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e56[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x67e5('0x0'));var Redis=require(_0x67e5('0x1'));var qs=require(_0x67e5('0x2'));var logger=require(_0x67e5('0x3'))('api');var config=require(_0x67e5('0x4'));var db=require(_0x67e5('0x5'))['db'];config['redis']=_[_0x67e5('0x6')](config[_0x67e5('0x7')],{'host':_0x67e5('0x8'),'port':0x18eb});var socket=require(_0x67e5('0x9'))(new Redis(config[_0x67e5('0x7')]));require('./voiceExtension.socket')[_0x67e5('0xa')](socket);function respondWithStatusCode(_0x4ba612,_0x37b232){_0x37b232=_0x37b232||0xcc;return function(_0x31a728){if(_0x31a728){return _0x4ba612[_0x67e5('0xb')](_0x37b232);}return _0x4ba612[_0x67e5('0xc')](_0x37b232)['end']();};}function respondWithResult(_0x5c6809,_0x202481){_0x202481=_0x202481||0xc8;return function(_0x1d035f){if(_0x1d035f){return _0x5c6809[_0x67e5('0xc')](_0x202481)[_0x67e5('0xd')](_0x1d035f);}};}function respondWithFilteredResult(_0x2e9f3f,_0x2ae0d3){return function(_0x39497d){if(_0x39497d){var _0x42b3d1=typeof _0x2ae0d3['offset']===_0x67e5('0xe')&&typeof _0x2ae0d3[_0x67e5('0xf')]===_0x67e5('0xe');var _0x12361f=_0x39497d[_0x67e5('0x10')];var _0x3dc2ba=_0x42b3d1?0x0:_0x2ae0d3[_0x67e5('0x11')];var _0x401271=_0x42b3d1?_0x39497d[_0x67e5('0x10')]:_0x2ae0d3[_0x67e5('0x11')]+_0x2ae0d3[_0x67e5('0xf')];var _0x2c4fd9;if(_0x401271>=_0x12361f){_0x401271=_0x12361f;_0x2c4fd9=0xc8;}else{_0x2c4fd9=0xce;}_0x2e9f3f[_0x67e5('0xc')](_0x2c4fd9);return _0x2e9f3f[_0x67e5('0x12')](_0x67e5('0x13'),_0x3dc2ba+'-'+_0x401271+'/'+_0x12361f)[_0x67e5('0xd')](_0x39497d);}return null;};}function removeEntity(_0x3ad00c){return function(_0x227af3){if(_0x227af3){return _0x227af3[_0x67e5('0x14')]()[_0x67e5('0x15')](function(){var _0x3f7862=_0x227af3[_0x67e5('0x16')]({'plain':!![]});var _0x1cbca3=[{'name':_0x67e5('0x17'),'value':_0x67e5('0x18'),'ignore':![]},{'name':_0x67e5('0x19'),'value':_0x67e5('0x1a'),'ignore':![]},{'name':'InternalRoutes','value':_0x67e5('0x1b'),'ignore':![]}];var _0x292ac3=_(_0x1cbca3)[_0x67e5('0x1c')]('ignore')['map'](_0x67e5('0x1d'))[_0x67e5('0x1d')]();if(_['includes'](_0x292ac3,_0x3f7862[_0x67e5('0x1e')])){return;}var _0x253f39=_[_0x67e5('0x1f')](_0x1cbca3,[_0x67e5('0x1d'),_0x3f7862[_0x67e5('0x1e')]])[_0x67e5('0x20')];return db[_0x67e5('0x21')][_0x67e5('0x14')]({'where':{'type':_0x253f39,'resourceId':_0x3f7862['id']}})[_0x67e5('0x15')](function(){return _0x227af3;});})['then'](function(){_0x3ad00c['status'](0xcc)[_0x67e5('0x22')]();});}};}function handleEntityNotFound(_0xc06173){return function(_0x1409ff){if(!_0x1409ff){_0xc06173[_0x67e5('0xb')](0x194);}return _0x1409ff;};}function handleError(_0x29871f,_0x7f59c9){_0x7f59c9=_0x7f59c9||0x1f4;return function(_0x31368a){logger['error'](_0x31368a[_0x67e5('0x23')]);if(_0x31368a['name']){delete _0x31368a[_0x67e5('0x20')];}_0x29871f['status'](_0x7f59c9)['send'](_0x31368a);};}exports[_0x67e5('0x24')]=function(_0x3e54d5,_0x204f3b){var _0x7d9058={},_0x5c53b0={},_0x299360={'count':0x0,'rows':[]};var _0x18fa03=_[_0x67e5('0x25')](db['VoiceExtension']['rawAttributes'],function(_0x160a93){return{'name':_0x160a93[_0x67e5('0x26')],'type':_0x160a93[_0x67e5('0x1e')][_0x67e5('0x27')]};});_0x5c53b0[_0x67e5('0x28')]=_[_0x67e5('0x25')](_0x18fa03,'name');_0x5c53b0[_0x67e5('0x29')]=_['keys'](_0x3e54d5[_0x67e5('0x29')]);_0x5c53b0[_0x67e5('0x2a')]=_[_0x67e5('0x2b')](_0x5c53b0[_0x67e5('0x28')],_0x5c53b0[_0x67e5('0x29')]);_0x7d9058[_0x67e5('0x2c')]=_[_0x67e5('0x2b')](_0x5c53b0[_0x67e5('0x28')],qs['fields'](_0x3e54d5[_0x67e5('0x29')][_0x67e5('0x2d')]));_0x7d9058[_0x67e5('0x2c')]=_0x7d9058[_0x67e5('0x2c')][_0x67e5('0x2e')]?_0x7d9058[_0x67e5('0x2c')]:_0x5c53b0['model'];if(!_0x3e54d5[_0x67e5('0x29')][_0x67e5('0x2f')](_0x67e5('0x30'))){_0x7d9058[_0x67e5('0xf')]=qs[_0x67e5('0xf')](_0x3e54d5[_0x67e5('0x29')]['limit']);_0x7d9058[_0x67e5('0x11')]=qs['offset'](_0x3e54d5[_0x67e5('0x29')][_0x67e5('0x11')]);}_0x7d9058['order']=qs[_0x67e5('0x31')](_0x3e54d5[_0x67e5('0x29')][_0x67e5('0x31')]);_0x7d9058[_0x67e5('0x32')]=qs[_0x67e5('0x2a')](_[_0x67e5('0x33')](_0x3e54d5['query'],_0x5c53b0['filters']),_0x18fa03);if(_0x3e54d5['query']['filter']){_0x7d9058['where']=_[_0x67e5('0x34')](_0x7d9058[_0x67e5('0x32')],{'$or':_[_0x67e5('0x25')](_0x18fa03,function(_0x25b971){if(_0x25b971[_0x67e5('0x1e')]!==_0x67e5('0x35')){var _0x484fd6={};_0x484fd6[_0x25b971[_0x67e5('0x20')]]={'$like':'%'+_0x3e54d5[_0x67e5('0x29')][_0x67e5('0x1c')]+'%'};return _0x484fd6;}})});}_0x7d9058=_[_0x67e5('0x34')]({},_0x7d9058,_0x3e54d5[_0x67e5('0x36')]);var _0x27583c={'where':_0x7d9058[_0x67e5('0x32')]};return db[_0x67e5('0x37')][_0x67e5('0x10')](_0x27583c)[_0x67e5('0x15')](function(_0x24539a){_0x299360[_0x67e5('0x10')]=_0x24539a;if(_0x3e54d5[_0x67e5('0x29')][_0x67e5('0x38')]){_0x7d9058[_0x67e5('0x39')]=[{'all':!![]}];}return db[_0x67e5('0x37')][_0x67e5('0x3a')](_0x7d9058);})[_0x67e5('0x15')](function(_0x55fd6f){_0x299360['rows']=_0x55fd6f;return _0x299360;})['then'](respondWithFilteredResult(_0x204f3b,_0x7d9058))[_0x67e5('0x3b')](handleError(_0x204f3b,null));};exports[_0x67e5('0x3c')]=function(_0x3daa58,_0x325649){var _0x16c633={'raw':![],'where':{'id':_0x3daa58[_0x67e5('0x3d')]['id']}},_0x4875d4={};_0x4875d4[_0x67e5('0x28')]=_[_0x67e5('0x3e')](db[_0x67e5('0x37')][_0x67e5('0x3f')]);_0x4875d4[_0x67e5('0x29')]=_[_0x67e5('0x3e')](_0x3daa58['query']);_0x4875d4['filters']=_[_0x67e5('0x2b')](_0x4875d4[_0x67e5('0x28')],_0x4875d4[_0x67e5('0x29')]);_0x16c633[_0x67e5('0x2c')]=_[_0x67e5('0x2b')](_0x4875d4[_0x67e5('0x28')],qs[_0x67e5('0x2d')](_0x3daa58[_0x67e5('0x29')][_0x67e5('0x2d')]));_0x16c633['attributes']=_0x16c633['attributes'][_0x67e5('0x2e')]?_0x16c633[_0x67e5('0x2c')]:_0x4875d4[_0x67e5('0x28')];if(_0x3daa58[_0x67e5('0x29')][_0x67e5('0x38')]){_0x16c633['include']=[{'all':!![]}];}_0x16c633=_[_0x67e5('0x34')]({},_0x16c633,_0x3daa58[_0x67e5('0x36')]);return db[_0x67e5('0x37')][_0x67e5('0x1f')](_0x16c633)[_0x67e5('0x15')](handleEntityNotFound(_0x325649,null))[_0x67e5('0x15')](respondWithResult(_0x325649,null))['catch'](handleError(_0x325649,null));};exports['destroy']=function(_0x32695d,_0x2dcafd){return db[_0x67e5('0x37')][_0x67e5('0x1f')]({'where':{'id':_0x32695d['params']['id']}})[_0x67e5('0x15')](handleEntityNotFound(_0x2dcafd,null))['then'](removeEntity(_0x2dcafd,null))[_0x67e5('0x3b')](handleError(_0x2dcafd,null));};exports[_0x67e5('0x40')]=function(_0x36537d,_0x13e6a0){if(_0x36537d[_0x67e5('0x41')]['type']===_0x67e5('0x1a')&&!_['startsWith'](_0x36537d['body'][_0x67e5('0x42')],'_')){_0x36537d[_0x67e5('0x41')]['exten']='_'[_0x67e5('0x43')](_0x36537d['body'][_0x67e5('0x42')]);}return db['VoiceExtension'][_0x67e5('0x40')](_0x36537d[_0x67e5('0x41')],{'raw':![]})[_0x67e5('0x15')](function(_0x4194c2){var _0x40aea7=_0x36537d['user'][_0x67e5('0x16')]({'plain':!![]});if(!_0x40aea7)throw new Error(_0x67e5('0x44'));if(_0x40aea7['role']===_0x67e5('0x45')){var _0x2db72b=_0x4194c2[_0x67e5('0x16')]({'plain':!![]});var _0x315fee=[{'name':_0x67e5('0x17'),'value':_0x67e5('0x18')},{'name':_0x67e5('0x19'),'value':_0x67e5('0x1a')},{'name':_0x67e5('0x46'),'value':_0x67e5('0x1b')}];var _0x49fab7=_['find'](_0x315fee,['value',_0x2db72b[_0x67e5('0x1e')]])[_0x67e5('0x20')];return db[_0x67e5('0x47')][_0x67e5('0x1f')]({'where':{'name':_0x49fab7,'userProfileId':_0x40aea7['userProfileId']},'raw':!![]})['then'](function(_0x4b5dfe){if(_0x4b5dfe&&_0x4b5dfe[_0x67e5('0x48')]===0x0){return db[_0x67e5('0x21')][_0x67e5('0x40')]({'name':_0x2db72b['name'],'resourceId':_0x2db72b['id'],'type':_0x4b5dfe[_0x67e5('0x20')],'sectionId':_0x4b5dfe['id']},{})[_0x67e5('0x15')](function(){return _0x4194c2;});}else{return _0x4194c2;}})[_0x67e5('0x3b')](function(_0x558a34){logger[_0x67e5('0x49')](_0x67e5('0x4a'),_0x558a34);throw _0x558a34;});}return _0x4194c2;})[_0x67e5('0x15')](respondWithResult(_0x13e6a0,0xc9))[_0x67e5('0x3b')](handleError(_0x13e6a0,null));};exports[_0x67e5('0x4b')]=function(_0x461768,_0x1875c0){if(_0x461768[_0x67e5('0x41')]['id']){delete _0x461768['body']['id'];}return db[_0x67e5('0x37')][_0x67e5('0x1f')]({'where':{'id':_0x461768[_0x67e5('0x3d')]['id']}})[_0x67e5('0x15')](handleEntityNotFound(_0x1875c0,null))[_0x67e5('0x15')](function(_0xa591d3){if(_0xa591d3){return db[_0x67e5('0x37')][_0x67e5('0x4b')](_[_0x67e5('0x33')](_0x461768[_0x67e5('0x41')],[_0x67e5('0x42'),'context','description',_0x67e5('0x4c'),_0x67e5('0x4d'),_0x67e5('0x4e'),_0x67e5('0x4f')]),{'where':{'context':_0xa591d3[_0x67e5('0x50')],'exten':_0xa591d3[_0x67e5('0x42')]},'individualHooks':!![]})[_0x67e5('0x15')](function(_0x55cc58){return _0x55cc58;});}return null;})[_0x67e5('0x15')](respondWithStatusCode(_0x1875c0,null))[_0x67e5('0x3b')](handleError(_0x1875c0,null));};exports['addApplications']=function(_0xc8f138,_0x5666ee){var _0x5142c7=_0xc8f138[_0x67e5('0x3d')]['id'];var _0x2fe019=_0xc8f138[_0x67e5('0x41')];var _0x5acbac=0xc8;var _0x2ce9f1=null;return db[_0x67e5('0x51')]['transaction']({'isolationLevel':db[_0x67e5('0x51')][_0x67e5('0x52')][_0x67e5('0x53')][_0x67e5('0x54')]},function(_0x1dddc7){return db[_0x67e5('0x37')][_0x67e5('0x55')]({'where':{'id':_0x5142c7},'transaction':_0x1dddc7})[_0x67e5('0x15')](function(_0x1baad1){if(_0x1baad1){return db[_0x67e5('0x37')][_0x67e5('0x14')]({'where':{'VoiceExtensionId':_0x5142c7},'transaction':_0x1dddc7})[_0x67e5('0x15')](function(){var _0x3012e8=_['map'](_0x2fe019,function(_0x2bc9be){_0x2bc9be[_0x67e5('0x56')]=_0x5142c7;_0x2bc9be[_0x67e5('0x57')]=!![];return _0x2bc9be;});return _0x1baad1[_0x67e5('0x58')](_0x3012e8);})['then'](function(_0x1c6a2c){return db['VoiceExtension'][_0x67e5('0x59')](_0x1c6a2c,{'transaction':_0x1dddc7});});}else{_0x5acbac=0x194;_0x2ce9f1=[];}});})['then'](function(){if(_0x5acbac!==0x194){return db['VoiceExtension'][_0x67e5('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5142c7},'order':_0x67e5('0x5b')})[_0x67e5('0x15')](function(_0x2d1646){_0x2ce9f1=_0x2d1646;});}})[_0x67e5('0x3b')](function(_0xa5ac02){_0x5acbac=0x1f4;logger[_0x67e5('0x49')](_0xa5ac02[_0x67e5('0x23')]);if(_0xa5ac02[_0x67e5('0x20')]){delete _0xa5ac02[_0x67e5('0x20')];}_0x2ce9f1=_0xa5ac02;})[_0x67e5('0x5c')](function(){if(_0x2ce9f1===null){_0x5666ee[_0x67e5('0xb')](_0x5acbac);}else{if(_0x5acbac===0x1f4){_0x5666ee[_0x67e5('0xc')](_0x5acbac)[_0x67e5('0x5d')](_0x2ce9f1);}else{_0x5666ee[_0x67e5('0xc')](_0x5acbac)[_0x67e5('0xd')](_0x2ce9f1);}}});}; \ No newline at end of file +var _0x4d2f=['filters','filter','merge','VIRTUAL','includeAll','include','VoiceExtension','findAll','rows','catch','show','params','find','destroy','create','body','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','createRouting','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','type','name','status','error','send','index','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x5786f9,_0x59a148){var _0x22c3cf=function(_0x360be2){while(--_0x360be2){_0x5786f9['push'](_0x5786f9['shift']());}};_0x22c3cf(++_0x59a148);}(_0x4d2f,0xda));var _0xf4d2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4d2f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf4d2('0x0'));var Redis=require(_0xf4d2('0x1'));var qs=require(_0xf4d2('0x2'));var logger=require(_0xf4d2('0x3'))(_0xf4d2('0x4'));var config=require(_0xf4d2('0x5'));var db=require(_0xf4d2('0x6'))['db'];config[_0xf4d2('0x7')]=_[_0xf4d2('0x8')](config[_0xf4d2('0x7')],{'host':_0xf4d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf4d2('0x7')]));require(_0xf4d2('0xa'))[_0xf4d2('0xb')](socket);function respondWithStatusCode(_0x2324c9,_0x4000fb){_0x4000fb=_0x4000fb||0xcc;return function(_0x3cc97a){if(_0x3cc97a){return _0x2324c9[_0xf4d2('0xc')](_0x4000fb);}return _0x2324c9['status'](_0x4000fb)[_0xf4d2('0xd')]();};}function respondWithResult(_0x125638,_0x2cbf71){_0x2cbf71=_0x2cbf71||0xc8;return function(_0x57f500){if(_0x57f500){return _0x125638['status'](_0x2cbf71)['json'](_0x57f500);}};}function respondWithFilteredResult(_0x4b8fed,_0x4f3e0b){return function(_0x47cec6){if(_0x47cec6){var _0x4422cd=typeof _0x4f3e0b[_0xf4d2('0xe')]===_0xf4d2('0xf')&&typeof _0x4f3e0b[_0xf4d2('0x10')]===_0xf4d2('0xf');var _0x2c473b=_0x47cec6['count'];var _0x259615=_0x4422cd?0x0:_0x4f3e0b['offset'];var _0x7982fb=_0x4422cd?_0x47cec6[_0xf4d2('0x11')]:_0x4f3e0b[_0xf4d2('0xe')]+_0x4f3e0b[_0xf4d2('0x10')];var _0x443ed0;if(_0x7982fb>=_0x2c473b){_0x7982fb=_0x2c473b;_0x443ed0=0xc8;}else{_0x443ed0=0xce;}_0x4b8fed['status'](_0x443ed0);return _0x4b8fed[_0xf4d2('0x12')](_0xf4d2('0x13'),_0x259615+'-'+_0x7982fb+'/'+_0x2c473b)[_0xf4d2('0x14')](_0x47cec6);}return null;};}function removeEntity(_0x1e33f7){return function(_0x475112){if(_0x475112){return _0x475112['destroy']()[_0xf4d2('0x15')](function(){var _0x1b100f=_0x475112['get']({'plain':!![]});var _0xa06cf6=[{'name':_0xf4d2('0x16'),'value':_0xf4d2('0x17'),'ignore':![]},{'name':_0xf4d2('0x18'),'value':_0xf4d2('0x19'),'ignore':![]},{'name':_0xf4d2('0x1a'),'value':_0xf4d2('0x1b'),'ignore':![]}];var _0x5794dd=_(_0xa06cf6)['filter']('ignore')[_0xf4d2('0x1c')](_0xf4d2('0x1d'))[_0xf4d2('0x1d')]();if(_[_0xf4d2('0x1e')](_0x5794dd,_0x1b100f[_0xf4d2('0x1f')])){return;}var _0x12f735=_['find'](_0xa06cf6,[_0xf4d2('0x1d'),_0x1b100f['type']])[_0xf4d2('0x20')];return db['UserProfileResource']['destroy']({'where':{'type':_0x12f735,'resourceId':_0x1b100f['id']}})[_0xf4d2('0x15')](function(){return _0x475112;});})[_0xf4d2('0x15')](function(){_0x1e33f7[_0xf4d2('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe53789){return function(_0x588e5a){if(!_0x588e5a){_0xe53789[_0xf4d2('0xc')](0x194);}return _0x588e5a;};}function handleError(_0x145378,_0x3d78c6){_0x3d78c6=_0x3d78c6||0x1f4;return function(_0x42fcc8){logger[_0xf4d2('0x22')](_0x42fcc8['stack']);if(_0x42fcc8[_0xf4d2('0x20')]){delete _0x42fcc8[_0xf4d2('0x20')];}_0x145378[_0xf4d2('0x21')](_0x3d78c6)[_0xf4d2('0x23')](_0x42fcc8);};}exports[_0xf4d2('0x24')]=function(_0x3e8896,_0x2214d5){var _0x7eb6ec={},_0x3ab8ea={},_0x176d3e={'count':0x0,'rows':[]};var _0x4aae6f=_[_0xf4d2('0x1c')](db['VoiceExtension'][_0xf4d2('0x25')],function(_0x5353c7){return{'name':_0x5353c7[_0xf4d2('0x26')],'type':_0x5353c7[_0xf4d2('0x1f')][_0xf4d2('0x27')]};});_0x3ab8ea[_0xf4d2('0x28')]=_['map'](_0x4aae6f,_0xf4d2('0x20'));_0x3ab8ea[_0xf4d2('0x29')]=_[_0xf4d2('0x2a')](_0x3e8896[_0xf4d2('0x29')]);_0x3ab8ea['filters']=_[_0xf4d2('0x2b')](_0x3ab8ea[_0xf4d2('0x28')],_0x3ab8ea[_0xf4d2('0x29')]);_0x7eb6ec[_0xf4d2('0x2c')]=_[_0xf4d2('0x2b')](_0x3ab8ea[_0xf4d2('0x28')],qs[_0xf4d2('0x2d')](_0x3e8896['query'][_0xf4d2('0x2d')]));_0x7eb6ec['attributes']=_0x7eb6ec[_0xf4d2('0x2c')][_0xf4d2('0x2e')]?_0x7eb6ec[_0xf4d2('0x2c')]:_0x3ab8ea[_0xf4d2('0x28')];if(!_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x2f')](_0xf4d2('0x30'))){_0x7eb6ec[_0xf4d2('0x10')]=qs[_0xf4d2('0x10')](_0x3e8896[_0xf4d2('0x29')]['limit']);_0x7eb6ec[_0xf4d2('0xe')]=qs[_0xf4d2('0xe')](_0x3e8896['query']['offset']);}_0x7eb6ec['order']=qs[_0xf4d2('0x31')](_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x31')]);_0x7eb6ec[_0xf4d2('0x32')]=qs['filters'](_[_0xf4d2('0x33')](_0x3e8896['query'],_0x3ab8ea[_0xf4d2('0x34')]),_0x4aae6f);if(_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x35')]){_0x7eb6ec[_0xf4d2('0x32')]=_[_0xf4d2('0x36')](_0x7eb6ec[_0xf4d2('0x32')],{'$or':_[_0xf4d2('0x1c')](_0x4aae6f,function(_0x4905c7){if(_0x4905c7['type']!==_0xf4d2('0x37')){var _0x4221c7={};_0x4221c7[_0x4905c7['name']]={'$like':'%'+_0x3e8896[_0xf4d2('0x29')]['filter']+'%'};return _0x4221c7;}})});}_0x7eb6ec=_['merge']({},_0x7eb6ec,_0x3e8896['options']);var _0x208d79={'where':_0x7eb6ec[_0xf4d2('0x32')]};return db['VoiceExtension']['count'](_0x208d79)[_0xf4d2('0x15')](function(_0x5b7a5f){_0x176d3e[_0xf4d2('0x11')]=_0x5b7a5f;if(_0x3e8896[_0xf4d2('0x29')][_0xf4d2('0x38')]){_0x7eb6ec[_0xf4d2('0x39')]=[{'all':!![]}];}return db[_0xf4d2('0x3a')][_0xf4d2('0x3b')](_0x7eb6ec);})[_0xf4d2('0x15')](function(_0x5785a1){_0x176d3e[_0xf4d2('0x3c')]=_0x5785a1;return _0x176d3e;})['then'](respondWithFilteredResult(_0x2214d5,_0x7eb6ec))[_0xf4d2('0x3d')](handleError(_0x2214d5,null));};exports[_0xf4d2('0x3e')]=function(_0x4e6405,_0x182143){var _0x25cfb8={'raw':![],'where':{'id':_0x4e6405[_0xf4d2('0x3f')]['id']}},_0x3cd2d6={};_0x3cd2d6['model']=_[_0xf4d2('0x2a')](db[_0xf4d2('0x3a')]['rawAttributes']);_0x3cd2d6[_0xf4d2('0x29')]=_[_0xf4d2('0x2a')](_0x4e6405[_0xf4d2('0x29')]);_0x3cd2d6['filters']=_[_0xf4d2('0x2b')](_0x3cd2d6[_0xf4d2('0x28')],_0x3cd2d6[_0xf4d2('0x29')]);_0x25cfb8[_0xf4d2('0x2c')]=_[_0xf4d2('0x2b')](_0x3cd2d6[_0xf4d2('0x28')],qs[_0xf4d2('0x2d')](_0x4e6405[_0xf4d2('0x29')][_0xf4d2('0x2d')]));_0x25cfb8[_0xf4d2('0x2c')]=_0x25cfb8[_0xf4d2('0x2c')]['length']?_0x25cfb8['attributes']:_0x3cd2d6['model'];if(_0x4e6405[_0xf4d2('0x29')][_0xf4d2('0x38')]){_0x25cfb8['include']=[{'all':!![]}];}_0x25cfb8=_[_0xf4d2('0x36')]({},_0x25cfb8,_0x4e6405['options']);return db[_0xf4d2('0x3a')][_0xf4d2('0x40')](_0x25cfb8)[_0xf4d2('0x15')](handleEntityNotFound(_0x182143,null))[_0xf4d2('0x15')](respondWithResult(_0x182143,null))[_0xf4d2('0x3d')](handleError(_0x182143,null));};exports[_0xf4d2('0x41')]=function(_0x2efe70,_0x138114){return db[_0xf4d2('0x3a')]['find']({'where':{'id':_0x2efe70[_0xf4d2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x138114,null))[_0xf4d2('0x15')](removeEntity(_0x138114,null))[_0xf4d2('0x3d')](handleError(_0x138114,null));};exports[_0xf4d2('0x42')]=function(_0x39006d,_0x376c21){if(_0x39006d[_0xf4d2('0x43')][_0xf4d2('0x1f')]==='outbound'&&!_['startsWith'](_0x39006d[_0xf4d2('0x43')]['exten'],'_')){_0x39006d[_0xf4d2('0x43')][_0xf4d2('0x44')]='_'[_0xf4d2('0x45')](_0x39006d[_0xf4d2('0x43')]['exten']);}return db[_0xf4d2('0x3a')][_0xf4d2('0x42')](_0x39006d[_0xf4d2('0x43')],{'raw':![]})['then'](function(_0x509663){var _0x4d8082=_0x39006d['user'][_0xf4d2('0x46')]({'plain':!![]});if(!_0x4d8082)throw new Error(_0xf4d2('0x47'));if(_0x4d8082['role']===_0xf4d2('0x48')){var _0x3c5502=_0x509663[_0xf4d2('0x46')]({'plain':!![]});var _0x4653be=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xf4d2('0x18'),'value':_0xf4d2('0x19')},{'name':'InternalRoutes','value':_0xf4d2('0x1b')}];var _0x46fd00=_[_0xf4d2('0x40')](_0x4653be,[_0xf4d2('0x1d'),_0x3c5502[_0xf4d2('0x1f')]])[_0xf4d2('0x20')];return db[_0xf4d2('0x49')][_0xf4d2('0x40')]({'where':{'name':_0x46fd00,'userProfileId':_0x4d8082['userProfileId']},'raw':!![]})['then'](function(_0x39925c){if(_0x39925c&&_0x39925c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf4d2('0x42')]({'name':_0x3c5502[_0xf4d2('0x20')],'resourceId':_0x3c5502['id'],'type':_0x39925c[_0xf4d2('0x20')],'sectionId':_0x39925c['id']},{})[_0xf4d2('0x15')](function(){return _0x509663;});}else{return _0x509663;}})[_0xf4d2('0x3d')](function(_0x46f0b5){logger[_0xf4d2('0x22')](_0xf4d2('0x4a'),_0x46f0b5);throw _0x46f0b5;});}return _0x509663;})[_0xf4d2('0x15')](respondWithResult(_0x376c21,0xc9))['catch'](handleError(_0x376c21,null));};exports[_0xf4d2('0x4b')]=function(_0x588c99,_0xe305c6){if(_0x588c99[_0xf4d2('0x43')]['id']){delete _0x588c99[_0xf4d2('0x43')]['id'];}return db[_0xf4d2('0x3a')][_0xf4d2('0x40')]({'where':{'id':_0x588c99[_0xf4d2('0x3f')]['id']}})[_0xf4d2('0x15')](handleEntityNotFound(_0xe305c6,null))[_0xf4d2('0x15')](function(_0xd9383a){if(_0xd9383a){return db['VoiceExtension'][_0xf4d2('0x4b')](_[_0xf4d2('0x33')](_0x588c99[_0xf4d2('0x43')],['exten','context',_0xf4d2('0x4c'),_0xf4d2('0x4d'),'cutdigits',_0xf4d2('0x4e'),_0xf4d2('0x4f')]),{'where':{'context':_0xd9383a[_0xf4d2('0x50')],'exten':_0xd9383a['exten']},'individualHooks':!![]})[_0xf4d2('0x15')](function(_0x53afaa){return _0x53afaa;});}return null;})[_0xf4d2('0x15')](respondWithStatusCode(_0xe305c6,null))[_0xf4d2('0x3d')](handleError(_0xe305c6,null));};exports[_0xf4d2('0x51')]=function(_0x404261,_0x55f25f){var _0x4dbae8=_0x404261[_0xf4d2('0x3f')]['id'];var _0x3fc8c6=_0x404261[_0xf4d2('0x43')];var _0x2ea762=0xc8;var _0x35ec80=null;return db[_0xf4d2('0x52')][_0xf4d2('0x53')]({'isolationLevel':db[_0xf4d2('0x52')][_0xf4d2('0x54')][_0xf4d2('0x55')]['READ_COMMITTED']},function(_0x2011b2){return db[_0xf4d2('0x3a')][_0xf4d2('0x56')]({'where':{'id':_0x4dbae8},'transaction':_0x2011b2})[_0xf4d2('0x15')](function(_0xf5dc33){if(_0xf5dc33){return db[_0xf4d2('0x3a')][_0xf4d2('0x41')]({'where':{'VoiceExtensionId':_0x4dbae8},'transaction':_0x2011b2})[_0xf4d2('0x15')](function(){var _0x4bfa00=_['map'](_0x3fc8c6,function(_0x188408){_0x188408['VoiceExtensionId']=_0x4dbae8;_0x188408['isApp']=!![];return _0x188408;});return _0xf5dc33[_0xf4d2('0x57')](_0x4bfa00);})[_0xf4d2('0x15')](function(_0x562145){return db[_0xf4d2('0x3a')]['bulkCreate'](_0x562145,{'transaction':_0x2011b2});});}else{_0x2ea762=0x194;_0x35ec80=[];}});})[_0xf4d2('0x15')](function(){if(_0x2ea762!==0x194){return db[_0xf4d2('0x3a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4dbae8},'order':'cast(priority\x20as\x20unsigned)'})[_0xf4d2('0x15')](function(_0x2f51fe){_0x35ec80=_0x2f51fe;});}})[_0xf4d2('0x3d')](function(_0x151d00){_0x2ea762=0x1f4;logger[_0xf4d2('0x22')](_0x151d00[_0xf4d2('0x58')]);if(_0x151d00[_0xf4d2('0x20')]){delete _0x151d00[_0xf4d2('0x20')];}_0x35ec80=_0x151d00;})[_0xf4d2('0x59')](function(){if(_0x35ec80===null){_0x55f25f[_0xf4d2('0xc')](_0x2ea762);}else{if(_0x2ea762===0x1f4){_0x55f25f[_0xf4d2('0x21')](_0x2ea762)[_0xf4d2('0x23')](_0x35ec80);}else{_0x55f25f[_0xf4d2('0x21')](_0x2ea762)[_0xf4d2('0x14')](_0x35ec80);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index bc86c2d..56b7f9b 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 _0xacf3=['emit','hasOwnProperty','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove'];(function(_0x2d9b68,_0x62ae0e){var _0x8811f0=function(_0x43f296){while(--_0x43f296){_0x2d9b68['push'](_0x2d9b68['shift']());}};_0x8811f0(++_0x62ae0e);}(_0xacf3,0xad));var _0x3acf=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xacf3[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0x3acf('0x0'));var VoiceExtension=require(_0x3acf('0x1'))['db'][_0x3acf('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3acf('0x3')](0x0);var events={'afterCreate':_0x3acf('0x4'),'afterUpdate':_0x3acf('0x5'),'afterDestroy':_0x3acf('0x6')};function emitEvent(_0x110293){return function(_0x649a07,_0x122006,_0xe70ffe){VoiceExtensionEvents[_0x3acf('0x7')](_0x110293+':'+_0x649a07['id'],_0x649a07);VoiceExtensionEvents[_0x3acf('0x7')](_0x110293,_0x649a07);_0xe70ffe(null);};}for(var e in events){if(events[_0x3acf('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x998a=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x998a,0xa8));var _0xa998=function(_0x3c1dae,_0xf40459){_0x3c1dae=_0x3c1dae-0x0;var _0x29e521=_0x998a[_0x3c1dae];return _0x29e521;};'use strict';var EventEmitter=require(_0xa998('0x0'));var VoiceExtension=require(_0xa998('0x1'))['db'][_0xa998('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa998('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa998('0x4'),'afterDestroy':_0xa998('0x5')};function emitEvent(_0x2a17a0){return function(_0x18731a,_0x1cb2e7,_0x5f0510){VoiceExtensionEvents[_0xa998('0x6')](_0x2a17a0+':'+_0x18731a['id'],_0x18731a);VoiceExtensionEvents[_0xa998('0x6')](_0x2a17a0,_0x18731a);_0x5f0510(null);};}for(var e in events){if(events[_0xa998('0x7')](e)){var event=events[e];VoiceExtension[_0xa998('0x8')](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 2a473b3..785a15a 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 _0xceae=['trunk','timeout','options','url','split','length','name','param','phone','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','toLowerCase','hasOwnProperty','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','playback','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','last','priority','define','VoiceExtension','voice_extensions','get','concat','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0xceae,0x122));var _0xecea=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0xceae[_0xadde88];return _0x3b8eb6;};'use strict';var _=require(_0xecea('0x0'));var attributes=require(_0xecea('0x1'));module['exports']=function(_0x5533c7){var _0x5f37e7=_0x5533c7[_0xecea('0x2')];function _0x5cecf4(_0x5bba59){var _0x28b2cf=0x2;var _0x457d37=[{'type':_0x5bba59[_0xecea('0x3')],'app':_0xecea('0x4'),'appdata':_0xecea('0x5')+_0x5bba59[_0xecea('0x3')],'context':_0x5bba59[_0xecea('0x6')],'exten':_0x5bba59[_0xecea('0x7')],'priority':_0x28b2cf++,'VoiceExtensionId':_0x5bba59['id']},{'type':_0x5bba59[_0xecea('0x3')],'app':_0x5bba59[_0xecea('0x8')]?'Set':_0xecea('0x9'),'appdata':_0x5bba59['alias']?_0xecea('0xa')+_0x5bba59[_0xecea('0x8')]:_0xecea('0xb'),'context':_0x5bba59[_0xecea('0x6')],'exten':_0x5bba59[_0xecea('0x7')],'priority':_0x28b2cf++,'VoiceExtensionId':_0x5bba59['id']}];if(_0x5bba59[_0xecea('0x3')]===_0xecea('0xc')){_0x457d37[_0xecea('0xd')]({'type':_0xecea('0xc'),'app':_0xecea('0x4'),'appdata':_0xecea('0xe')+_0x5bba59['id'],'context':_0x5bba59['context'],'exten':_0x5bba59['exten'],'priority':_0x28b2cf++,'VoiceExtensionId':_0x5bba59['id']});}_0x457d37['push']({'type':_0x5bba59[_0xecea('0x3')],'app':'Set','appdata':_0xecea('0xf'),'context':_0x5bba59[_0xecea('0x6')],'exten':_0x5bba59[_0xecea('0x7')],'priority':_0x28b2cf++,'VoiceExtensionId':_0x5bba59['id']},{'type':_0x5bba59[_0xecea('0x3')],'app':_0xecea('0x4'),'appdata':_0xecea('0x10'),'context':_0x5bba59['context'],'exten':_0x5bba59[_0xecea('0x7')],'priority':_0x28b2cf++,'VoiceExtensionId':_0x5bba59['id']},{'type':_0x5bba59[_0xecea('0x3')],'app':_0xecea('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5bba59[_0xecea('0x6')],'exten':_0x5bba59['exten'],'priority':_0x28b2cf++,'VoiceExtensionId':_0x5bba59['id']});return _0x457d37;}function _0x308efc(_0x56de8e){var _0x2d3aa6=0x2;var _0x24b490=[{'type':_0xecea('0x11'),'app':_0xecea('0x4'),'appdata':_0xecea('0x12'),'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':_0x56de8e['alias']?_0xecea('0x4'):_0xecea('0x9'),'appdata':_0x56de8e['alias']?_0xecea('0xa')+_0x56de8e['alias']:_0xecea('0xb'),'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e['exten'],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':'outbound','app':_0xecea('0x4'),'appdata':_0xecea('0x13')+(_0x56de8e['cutdigits']?_0xecea('0x14')+_0x56de8e[_0xecea('0x15')]+'}':_0xecea('0x16')),'context':_0x56de8e['context'],'exten':_0x56de8e['exten'],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':_0xecea('0x4'),'appdata':_0xecea('0xe')+_0x56de8e['id'],'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e['exten'],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':_0xecea('0x17'),'appdata':_0xecea('0x18')+(_0x2d3aa6+0x2)+_0xecea('0x19')+(_0x2d3aa6+0x1)+')','context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':_0xecea('0x4'),'appdata':_0x56de8e[_0xecea('0x15')]?_0xecea('0x1a')+_0x56de8e['cutdigits']+'}':_0xecea('0x1b'),'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':'outbound','app':_0xecea('0x4'),'appdata':_0xecea('0xf'),'context':_0x56de8e['context'],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':'outbound','app':_0xecea('0x4'),'appdata':_0xecea('0x10'),'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':'Set','appdata':_0xecea('0x1c'),'context':_0x56de8e['context'],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':_0xecea('0x4'),'appdata':'outboundrouteid='+_0x56de8e['id'],'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']}];if(_0x56de8e['hasOwnProperty'](_0xecea('0x1d'))&&_0x56de8e['recordingFormat']!==_0xecea('0x1e')){_0x24b490[_0xecea('0xd')]({'type':_0xecea('0x11'),'app':_0xecea('0x4'),'appdata':_0xecea('0x1f'),'context':_0x56de8e['context'],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']},{'type':_0xecea('0x11'),'app':'Set','appdata':_0xecea('0x20')+_0x56de8e[_0xecea('0x1d')]||_0xecea('0x21'),'context':_0x56de8e[_0xecea('0x6')],'exten':_0x56de8e[_0xecea('0x7')],'priority':_0x2d3aa6++,'VoiceExtensionId':_0x56de8e['id']});}return _0x24b490;}function _0x5c244f(_0x4ea78c,_0x36f08){var _0x542f6a=[{'name':_0xecea('0x22'),'param':0x0},{'name':_0xecea('0x23'),'param':0x1},{'name':_0xecea('0x24'),'param':0x2},{'name':_0xecea('0x25'),'param':0x3}];var _0x10cb6e={};var _0x16e927=_0x36f08[_0xecea('0x26')](',');var _0x5040d0=[];for(var _0x3ec9de=0x0;_0x3ec9de<_0x542f6a[_0xecea('0x27')];_0x3ec9de++){switch(_0x542f6a[_0x3ec9de][_0xecea('0x28')]){case _0xecea('0x22'):_0x10cb6e[_0xecea('0x22')]=_0x16e927[_0x542f6a[_0x3ec9de][_0xecea('0x29')]][_0xecea('0x26')]('/')[0x1];_0x10cb6e[_0xecea('0x2a')]=_0x16e927[_0x542f6a[_0x3ec9de][_0xecea('0x29')]]['split']('/')[0x2];_0x10cb6e['prefix']=_0x10cb6e['phone']?_0x10cb6e['phone'][_0xecea('0x26')]('$')[0x0]:undefined;_0x10cb6e['phone']=_0x4ea78c[_0xecea('0x15')]?(_0x10cb6e['prefix']||'')+_0xecea('0x14')+_0x4ea78c['cutdigits']+'}':(_0x10cb6e['prefix']||'')+_0xecea('0x16');_0x5040d0[_0x542f6a[_0x3ec9de]['param']]=[_0xecea('0x2b'),_0x10cb6e[_0xecea('0x22')],_0x10cb6e[_0xecea('0x2a')]][_0xecea('0x2c')]('/');break;case'options':_0x10cb6e[_0xecea('0x24')]=_0x16e927[_0x542f6a[_0x3ec9de][_0xecea('0x29')]];if(_0x4ea78c[_0xecea('0x1d')]!==_0xecea('0x1e')){if(_0x10cb6e['options']['indexOf'](_0xecea('0x2d'))<0x0){_0x10cb6e['options']+=_0xecea('0x2d');}}else{_0x10cb6e['options']=_0x10cb6e['options'][_0xecea('0x2e')](_0xecea('0x2d'),'');}_0x5040d0[_0x542f6a[_0x3ec9de]['param']]=_0x10cb6e[_0xecea('0x24')];break;default:_0x5040d0[_0x542f6a[_0x3ec9de]['param']]=_0x16e927[_0x542f6a[_0x3ec9de][_0xecea('0x29')]];}}return _0x5040d0[_0xecea('0x2c')](',');}function _0x2c043c(_0x2ae20e,_0x4244bc,_0x58dd80){return new Promise(function(_0x315b1d,_0x5a846d){var _0x4f09b4=[];if(_[_0xecea('0x2f')](_0x4244bc))return _0x315b1d(_0x4f09b4);_0x5f37e7[_0xecea('0x30')][_0xecea('0x31')]({'attributes':['id',_0xecea('0x32'),_0xecea('0x33')],'raw':!![]})[_0xecea('0x34')](function(_0x180074){for(var _0x2305e6=0x0,_0x217c02=0x0;_0x2305e6<_0x4244bc[_0xecea('0x27')];_0x2305e6++,_0x217c02=0x0){var _0x33fbf4=_0x4244bc[_0x2305e6];var _0x435778=[];var _0x502276=[];delete _0x33fbf4['id'];if(_0x33fbf4[_0xecea('0x32')]!==_0xecea('0x35')){_0x33fbf4[_0xecea('0x36')]=[_0x33fbf4[_0xecea('0x32')]];}else{_0x33fbf4[_0xecea('0x36')]=_0x33fbf4[_0xecea('0x33')]?_[_0xecea('0x37')](_['filter'](_0x180074,{'IntervalId':_0x33fbf4[_0xecea('0x33')]}),_0xecea('0x32')):[];}_0x33fbf4['context']=_0x2ae20e[_0xecea('0x6')];_0x33fbf4[_0xecea('0x7')]=_0x2ae20e[_0xecea('0x7')];if(_0x33fbf4['type'])_0x33fbf4['type']=_0x33fbf4[_0xecea('0x3')][_0xecea('0x38')]();if(_0x2ae20e[_0xecea('0x3')]==='outbound'){if(_0x33fbf4[_0xecea('0x39')](_0xecea('0x3a'))&&_0x33fbf4[_0xecea('0x3a')]&&_0x33fbf4[_0xecea('0x3a')]!=='--'){_0x435778['push']({'type':_0x33fbf4[_0xecea('0x3')][_0xecea('0x38')](),'app':_0xecea('0x4'),'appdata':_0xecea('0x3b')+_0x33fbf4['tag'],'context':_0x2ae20e[_0xecea('0x6')],'exten':_0x2ae20e[_0xecea('0x7')],'priority':_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')]+_0x58dd80+_0x217c02++,'VoiceExtensionId':_0x2ae20e['id']});}_0x435778['push']({'type':_0x33fbf4['type'][_0xecea('0x38')](),'app':'ExecIf','appdata':_0xecea('0x3c')+(_0x33fbf4[_0xecea('0x3d')]?_0xecea('0x3e')+_0x33fbf4[_0xecea('0x3d')]+')':'NoOp(No\x20number\x20available)'),'context':_0x2ae20e[_0xecea('0x6')],'exten':_0x2ae20e[_0xecea('0x7')],'priority':_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')]+_0x58dd80+_0x217c02++,'VoiceExtensionId':_0x2ae20e['id']});}else{if(_0x33fbf4[_0xecea('0x39')]('answer')){if([_0xecea('0x3f'),_0xecea('0x40')]['includes'](_0x33fbf4[_0xecea('0x41')]['toLowerCase']())&&_0x33fbf4[_0xecea('0x42')]!=='custom'){if(_0x33fbf4['answer']){_0x435778['push']({'type':_0x33fbf4[_0xecea('0x3')]['toLowerCase'](),'app':_0xecea('0x17'),'appdata':_0xecea('0x43'),'context':_0x2ae20e[_0xecea('0x6')],'exten':_0x2ae20e[_0xecea('0x7')],'priority':_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')]+_0x58dd80+_0x217c02++,'VoiceExtensionId':_0x2ae20e['id']});_0x435778['push']({'type':_0x33fbf4['type'][_0xecea('0x38')](),'app':_0xecea('0x4'),'appdata':_0xecea('0x44'),'context':_0x2ae20e[_0xecea('0x6')],'exten':_0x2ae20e[_0xecea('0x7')],'priority':_0x33fbf4[_0xecea('0x36')]['length']+_0x58dd80+_0x217c02++,'VoiceExtensionId':_0x2ae20e['id']});}else{_0x435778['push']({'type':_0x33fbf4[_0xecea('0x3')][_0xecea('0x38')](),'app':_0xecea('0x17'),'appdata':_0xecea('0x45'),'context':_0x2ae20e[_0xecea('0x6')],'exten':_0x2ae20e[_0xecea('0x7')],'priority':_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')]+_0x58dd80+_0x217c02++,'VoiceExtensionId':_0x2ae20e['id']});_0x435778[_0xecea('0xd')]({'type':_0x33fbf4[_0xecea('0x3')][_0xecea('0x38')](),'app':'Set','appdata':_0xecea('0x46'),'context':_0x2ae20e[_0xecea('0x6')],'exten':_0x2ae20e[_0xecea('0x7')],'priority':_0x33fbf4[_0xecea('0x36')]['length']+_0x58dd80+_0x217c02++,'VoiceExtensionId':_0x2ae20e['id']});}}}}for(var _0x50213c=0x0;_0x50213c<_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')];_0x50213c++){var _0x3b0c12=_0x58dd80+_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')];var _0x3742e4=_0x50213c===_0x33fbf4[_0xecea('0x36')][_0xecea('0x27')]-0x1?_0x58dd80+_0x435778[_0xecea('0x27')]+_0x502276[_0xecea('0x27')]+0x2:_0x58dd80+_0x50213c+0x1;_0x435778[_0xecea('0x47')](_0x50213c,0x0,{'type':_0x2ae20e[_0xecea('0x3')],'app':'GotoIfTime','appdata':_0x33fbf4[_0xecea('0x36')][_0x50213c]+'?'+_0x2ae20e[_0xecea('0x6')]+_0xecea('0x48')+_0x3b0c12+':'+_0x2ae20e['context']+_0xecea('0x48')+_0x3742e4,'exten':_0x2ae20e[_0xecea('0x7')],'context':_0x2ae20e[_0xecea('0x6')],'priority':_0x58dd80+_0x50213c,'VoiceExtensionId':_0x2ae20e['id']});}if(_0x33fbf4[_0xecea('0x42')]==='outboundDial')_0x33fbf4[_0xecea('0x49')]=_0x5c244f(_0x2ae20e,_0x33fbf4[_0xecea('0x49')]);_0x33fbf4['priority']=_0x435778[_0xecea('0x27')]?_[_0xecea('0x4a')](_0x435778)[_0xecea('0x4b')]+0x1:_0x58dd80;_0x4f09b4=_['concat'](_0x4f09b4,_0x435778,[_0x33fbf4],_0x502276);_0x58dd80=_[_0xecea('0x4a')](_0x4f09b4)['priority']+0x1;}return _0x315b1d(_0x4f09b4);})['catch'](function(_0x11ae93){_0x5a846d(_0x11ae93);});});}return _0x5533c7[_0xecea('0x4c')](_0xecea('0x4d'),attributes,{'tableName':_0xecea('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x9fbf66){var _0x167117=this[_0xecea('0x4f')]({'plain':!![]});var _0x4751de=_0x167117[_0xecea('0x3')]===_0xecea('0x11')?_0x308efc(_0x167117):_0x5cecf4(_0x167117);return _0x2c043c(_0x167117,_0x9fbf66,_['last'](_0x4751de)['priority']+0x1)[_0xecea('0x34')](function(_0x18e130){var _0x12ae63=_[_0xecea('0x50')](_0x4751de,_0x18e130);_0x12ae63[_0xecea('0xd')]({'type':_0x167117['type'],'app':'Hangup','exten':_0x167117[_0xecea('0x7')],'context':_0x167117[_0xecea('0x6')],'priority':_[_0xecea('0x4a')](_0x12ae63)[_0xecea('0x4b')]+0x1,'VoiceExtensionId':_0x167117['id']});return _0x12ae63;});}}});}; \ No newline at end of file +var _0x661e=['url','split','name','phone','param','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','intervals','map','filter','toLowerCase','tag','CDR(tag)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','queue','playback','includes','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','catch','define','get','then','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout'];(function(_0x343bdd,_0x486e08){var _0x33bd12=function(_0xc51289){while(--_0xc51289){_0x343bdd['push'](_0x343bdd['shift']());}};_0x33bd12(++_0x486e08);}(_0x661e,0x7d));var _0xe661=function(_0x3af7d2,_0x19121c){_0x3af7d2=_0x3af7d2-0x0;var _0x41a40c=_0x661e[_0x3af7d2];return _0x41a40c;};'use strict';var _=require('lodash');var attributes=require(_0xe661('0x0'));module[_0xe661('0x1')]=function(_0x514e17){var _0x5a9a94=_0x514e17[_0xe661('0x2')];function _0x2ac6c5(_0x29caa1){var _0x5d412b=0x2;var _0x42cd8f=[{'type':_0x29caa1[_0xe661('0x3')],'app':_0xe661('0x4'),'appdata':'CDR(type)='+_0x29caa1['type'],'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1[_0xe661('0x6')],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']},{'type':_0x29caa1[_0xe661('0x3')],'app':_0x29caa1[_0xe661('0x7')]?_0xe661('0x4'):_0xe661('0x8'),'appdata':_0x29caa1[_0xe661('0x7')]?_0xe661('0x9')+_0x29caa1[_0xe661('0x7')]:_0xe661('0xa'),'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1[_0xe661('0x6')],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']}];if(_0x29caa1['type']===_0xe661('0xb')){_0x42cd8f['push']({'type':_0xe661('0xb'),'app':_0xe661('0x4'),'appdata':_0xe661('0xc')+_0x29caa1['id'],'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1['exten'],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']});}_0x42cd8f[_0xe661('0xd')]({'type':_0x29caa1[_0xe661('0x3')],'app':_0xe661('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x29caa1['context'],'exten':_0x29caa1['exten'],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']},{'type':_0x29caa1['type'],'app':_0xe661('0x4'),'appdata':_0xe661('0xe'),'context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1['exten'],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']},{'type':_0x29caa1[_0xe661('0x3')],'app':_0xe661('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x29caa1[_0xe661('0x5')],'exten':_0x29caa1[_0xe661('0x6')],'priority':_0x5d412b++,'VoiceExtensionId':_0x29caa1['id']});return _0x42cd8f;}function _0x16364d(_0x34cf6d){var _0x124fa0=0x2;var _0x1c8400=[{'type':_0xe661('0xf'),'app':'Set','appdata':_0xe661('0x10'),'context':_0x34cf6d['context'],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':_0x34cf6d[_0xe661('0x7')]?_0xe661('0x4'):'NoOp','appdata':_0x34cf6d[_0xe661('0x7')]?_0xe661('0x9')+_0x34cf6d[_0xe661('0x7')]:_0xe661('0xa'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d['exten'],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':'Set','appdata':'CDR(destination)='+(_0x34cf6d[_0xe661('0x11')]?_0xe661('0x12')+_0x34cf6d[_0xe661('0x11')]+'}':'${EXTEN}'),'context':_0x34cf6d['context'],'exten':_0x34cf6d['exten'],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':_0xe661('0x4'),'appdata':'CDR(routeid)='+_0x34cf6d['id'],'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':_0xe661('0x13'),'appdata':_0xe661('0x14')+(_0x124fa0+0x2)+'):Goto('+(_0x124fa0+0x1)+')','context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':_0xe661('0x4'),'appdata':_0x34cf6d[_0xe661('0x11')]?_0xe661('0x15')+_0x34cf6d[_0xe661('0x11')]+'}':_0xe661('0x16'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':'Set','appdata':_0xe661('0x17'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':_0xe661('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':_0xe661('0x4'),'appdata':_0xe661('0x18'),'context':_0x34cf6d['context'],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':'outbound','app':'Set','appdata':_0xe661('0x19')+_0x34cf6d['id'],'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']}];if(_0x34cf6d[_0xe661('0x1a')](_0xe661('0x1b'))&&_0x34cf6d[_0xe661('0x1b')]!==_0xe661('0x1c')){_0x1c8400[_0xe661('0xd')]({'type':'outbound','app':_0xe661('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']},{'type':_0xe661('0xf'),'app':'Set','appdata':_0xe661('0x1d')+_0x34cf6d['recordingFormat']||_0xe661('0x1e'),'context':_0x34cf6d[_0xe661('0x5')],'exten':_0x34cf6d[_0xe661('0x6')],'priority':_0x124fa0++,'VoiceExtensionId':_0x34cf6d['id']});}return _0x1c8400;}function _0x13cc59(_0x5eb5e4,_0x5f197a){var _0xa4e1e=[{'name':_0xe661('0x1f'),'param':0x0},{'name':_0xe661('0x20'),'param':0x1},{'name':'options','param':0x2},{'name':_0xe661('0x21'),'param':0x3}];var _0x25e036={};var _0x3d7ee4=_0x5f197a[_0xe661('0x22')](',');var _0x567e7c=[];for(var _0x273115=0x0;_0x273115<_0xa4e1e['length'];_0x273115++){switch(_0xa4e1e[_0x273115][_0xe661('0x23')]){case _0xe661('0x1f'):_0x25e036[_0xe661('0x1f')]=_0x3d7ee4[_0xa4e1e[_0x273115]['param']][_0xe661('0x22')]('/')[0x1];_0x25e036[_0xe661('0x24')]=_0x3d7ee4[_0xa4e1e[_0x273115][_0xe661('0x25')]][_0xe661('0x22')]('/')[0x2];_0x25e036[_0xe661('0x26')]=_0x25e036[_0xe661('0x24')]?_0x25e036[_0xe661('0x24')][_0xe661('0x22')]('$')[0x0]:undefined;_0x25e036[_0xe661('0x24')]=_0x5eb5e4[_0xe661('0x11')]?(_0x25e036['prefix']||'')+_0xe661('0x12')+_0x5eb5e4['cutdigits']+'}':(_0x25e036[_0xe661('0x26')]||'')+'${EXTEN}';_0x567e7c[_0xa4e1e[_0x273115]['param']]=['SIP',_0x25e036[_0xe661('0x1f')],_0x25e036[_0xe661('0x24')]][_0xe661('0x27')]('/');break;case'options':_0x25e036[_0xe661('0x28')]=_0x3d7ee4[_0xa4e1e[_0x273115]['param']];if(_0x5eb5e4[_0xe661('0x1b')]!=='none'){if(_0x25e036[_0xe661('0x28')][_0xe661('0x29')](_0xe661('0x2a'))<0x0){_0x25e036[_0xe661('0x28')]+=_0xe661('0x2a');}}else{_0x25e036[_0xe661('0x28')]=_0x25e036['options'][_0xe661('0x2b')](_0xe661('0x2a'),'');}_0x567e7c[_0xa4e1e[_0x273115][_0xe661('0x25')]]=_0x25e036[_0xe661('0x28')];break;default:_0x567e7c[_0xa4e1e[_0x273115][_0xe661('0x25')]]=_0x3d7ee4[_0xa4e1e[_0x273115][_0xe661('0x25')]];}}return _0x567e7c[_0xe661('0x27')](',');}function _0x55f0ee(_0x5b9fd1,_0x41abdd,_0x4c2370){return new Promise(function(_0x48c221,_0x52f29f){var _0x18d4da=[];if(_['isEmpty'](_0x41abdd))return _0x48c221(_0x18d4da);_0x5a9a94[_0xe661('0x2c')]['findAll']({'attributes':['id',_0xe661('0x2d'),_0xe661('0x2e')],'raw':!![]})['then'](function(_0xdd02ce){for(var _0x1f3d4e=0x0,_0x229b1f=0x0;_0x1f3d4e<_0x41abdd['length'];_0x1f3d4e++,_0x229b1f=0x0){var _0x18c2b9=_0x41abdd[_0x1f3d4e];var _0x5cd903=[];var _0x5bb0a3=[];delete _0x18c2b9['id'];if(_0x18c2b9[_0xe661('0x2d')]!=='*,*,*,*'){_0x18c2b9[_0xe661('0x2f')]=[_0x18c2b9[_0xe661('0x2d')]];}else{_0x18c2b9[_0xe661('0x2f')]=_0x18c2b9[_0xe661('0x2e')]?_[_0xe661('0x30')](_[_0xe661('0x31')](_0xdd02ce,{'IntervalId':_0x18c2b9[_0xe661('0x2e')]}),'interval'):[];}_0x18c2b9[_0xe661('0x5')]=_0x5b9fd1['context'];_0x18c2b9['exten']=_0x5b9fd1[_0xe661('0x6')];if(_0x18c2b9['type'])_0x18c2b9[_0xe661('0x3')]=_0x18c2b9[_0xe661('0x3')][_0xe661('0x32')]();if(_0x5b9fd1['type']===_0xe661('0xf')){if(_0x18c2b9[_0xe661('0x1a')](_0xe661('0x33'))&&_0x18c2b9[_0xe661('0x33')]&&_0x18c2b9[_0xe661('0x33')]!=='--'){_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9['type']['toLowerCase'](),'app':_0xe661('0x4'),'appdata':_0xe661('0x34')+_0x18c2b9['tag'],'context':_0x5b9fd1['context'],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9['intervals'][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9[_0xe661('0x3')][_0xe661('0x32')](),'app':_0xe661('0x13'),'appdata':_0xe661('0x36')+(_0x18c2b9['callerID']?'Set(CALLERID(all)='+_0x18c2b9[_0xe661('0x37')]+')':'NoOp(No\x20number\x20available)'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9[_0xe661('0x2f')]['length']+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}else{if(_0x18c2b9['hasOwnProperty']('answer')){if([_0xe661('0x38'),_0xe661('0x39')][_0xe661('0x3a')](_0x18c2b9[_0xe661('0x3b')][_0xe661('0x32')]())&&_0x18c2b9[_0xe661('0x3c')]!==_0xe661('0x3d')){if(_0x18c2b9[_0xe661('0x3e')]){_0x5cd903['push']({'type':_0x18c2b9[_0xe661('0x3')][_0xe661('0x32')](),'app':_0xe661('0x13'),'appdata':_0xe661('0x3f'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9[_0xe661('0x2f')]['length']+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9['type'][_0xe661('0x32')](),'app':_0xe661('0x4'),'appdata':_0xe661('0x40'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1[_0xe661('0x6')],'priority':_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}else{_0x5cd903[_0xe661('0xd')]({'type':_0x18c2b9[_0xe661('0x3')]['toLowerCase'](),'app':_0xe661('0x13'),'appdata':_0xe661('0x41'),'context':_0x5b9fd1[_0xe661('0x5')],'exten':_0x5b9fd1['exten'],'priority':_0x18c2b9['intervals'][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});_0x5cd903['push']({'type':_0x18c2b9[_0xe661('0x3')]['toLowerCase'](),'app':_0xe661('0x4'),'appdata':_0xe661('0x42'),'context':_0x5b9fd1['context'],'exten':_0x5b9fd1['exten'],'priority':_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')]+_0x4c2370+_0x229b1f++,'VoiceExtensionId':_0x5b9fd1['id']});}}}}for(var _0x25be48=0x0;_0x25be48<_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')];_0x25be48++){var _0x38eaab=_0x4c2370+_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')];var _0x5ef4a1=_0x25be48===_0x18c2b9[_0xe661('0x2f')][_0xe661('0x35')]-0x1?_0x4c2370+_0x5cd903['length']+_0x5bb0a3['length']+0x2:_0x4c2370+_0x25be48+0x1;_0x5cd903[_0xe661('0x43')](_0x25be48,0x0,{'type':_0x5b9fd1[_0xe661('0x3')],'app':_0xe661('0x44'),'appdata':_0x18c2b9['intervals'][_0x25be48]+'?'+_0x5b9fd1[_0xe661('0x5')]+_0xe661('0x45')+_0x38eaab+':'+_0x5b9fd1[_0xe661('0x5')]+_0xe661('0x45')+_0x5ef4a1,'exten':_0x5b9fd1[_0xe661('0x6')],'context':_0x5b9fd1['context'],'priority':_0x4c2370+_0x25be48,'VoiceExtensionId':_0x5b9fd1['id']});}if(_0x18c2b9[_0xe661('0x3c')]===_0xe661('0x46'))_0x18c2b9[_0xe661('0x47')]=_0x13cc59(_0x5b9fd1,_0x18c2b9['appdata']);_0x18c2b9['priority']=_0x5cd903[_0xe661('0x35')]?_[_0xe661('0x48')](_0x5cd903)['priority']+0x1:_0x4c2370;_0x18d4da=_[_0xe661('0x49')](_0x18d4da,_0x5cd903,[_0x18c2b9],_0x5bb0a3);_0x4c2370=_[_0xe661('0x48')](_0x18d4da)[_0xe661('0x4a')]+0x1;}return _0x48c221(_0x18d4da);})[_0xe661('0x4b')](function(_0xf18686){_0x52f29f(_0xf18686);});});}return _0x514e17[_0xe661('0x4c')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x52801a){var _0x26df44=this[_0xe661('0x4d')]({'plain':!![]});var _0x537346=_0x26df44[_0xe661('0x3')]===_0xe661('0xf')?_0x16364d(_0x26df44):_0x2ac6c5(_0x26df44);return _0x55f0ee(_0x26df44,_0x52801a,_[_0xe661('0x48')](_0x537346)[_0xe661('0x4a')]+0x1)[_0xe661('0x4e')](function(_0x17e1c6){var _0x288227=_['concat'](_0x537346,_0x17e1c6);_0x288227['push']({'type':_0x26df44[_0xe661('0x3')],'app':'Hangup','exten':_0x26df44['exten'],'context':_0x26df44[_0xe661('0x5')],'priority':_[_0xe661('0x48')](_0x288227)[_0xe661('0x4a')]+0x1,'VoiceExtensionId':_0x26df44['id']});return _0x288227;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 60d7f2c..be2c8bb 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 _0xd2bb=['limit','map','include','model','attributes','GetVoiceExtension','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceExtension','findAll','options'];(function(_0x2281a0,_0x2337ba){var _0x837aa0=function(_0x3eb37a){while(--_0x3eb37a){_0x2281a0['push'](_0x2281a0['shift']());}};_0x837aa0(++_0x2337ba);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x5e0f1f,_0x1bb674){_0x5e0f1f=_0x5e0f1f-0x0;var _0x44aeb5=_0xd2bb[_0x5e0f1f];return _0x44aeb5;};'use strict';var _=require('lodash');var util=require(_0xbd2b('0x0'));var moment=require('moment');var BPromise=require(_0xbd2b('0x1'));var rs=require(_0xbd2b('0x2'));var fs=require('fs');var Redis=require(_0xbd2b('0x3'));var db=require(_0xbd2b('0x4'))['db'];var utils=require(_0xbd2b('0x5'));var logger=require(_0xbd2b('0x6'))('rpc');var config=require(_0xbd2b('0x7'));var jayson=require(_0xbd2b('0x8'));var client=jayson[_0xbd2b('0x9')][_0xbd2b('0xa')]({'port':0x232a});config[_0xbd2b('0xb')]=_[_0xbd2b('0xc')](config[_0xbd2b('0xb')],{'host':_0xbd2b('0xd'),'port':0x18eb});var socket=require(_0xbd2b('0xe'))(new Redis(config[_0xbd2b('0xb')]));require('./voiceExtension.socket')[_0xbd2b('0xf')](socket);function respondWithRpcPromise(_0x517862,_0x335b9b,_0x3bcbea){return new BPromise(function(_0x4e9572,_0x2092d0){return client[_0xbd2b('0x10')](_0x517862,_0x3bcbea)[_0xbd2b('0x11')](function(_0x27fdd2){logger[_0xbd2b('0x12')](_0xbd2b('0x13'),_0x335b9b,_0xbd2b('0x14'));logger[_0xbd2b('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x335b9b,_0xbd2b('0x14'),JSON[_0xbd2b('0x16')](_0x27fdd2));if(_0x27fdd2[_0xbd2b('0x17')]){if(_0x27fdd2[_0xbd2b('0x17')][_0xbd2b('0x18')]===0x1f4){logger['error'](_0xbd2b('0x13'),_0x335b9b,_0x27fdd2[_0xbd2b('0x17')][_0xbd2b('0x19')]);return _0x2092d0(_0x27fdd2[_0xbd2b('0x17')][_0xbd2b('0x19')]);}logger[_0xbd2b('0x17')](_0xbd2b('0x13'),_0x335b9b,_0x27fdd2[_0xbd2b('0x17')][_0xbd2b('0x19')]);return _0x4e9572(_0x27fdd2['error'][_0xbd2b('0x19')]);}else{logger[_0xbd2b('0x12')](_0xbd2b('0x13'),_0x335b9b,_0xbd2b('0x14'));_0x4e9572(_0x27fdd2[_0xbd2b('0x1a')][_0xbd2b('0x19')]);}})[_0xbd2b('0x1b')](function(_0xe4eaa6){logger[_0xbd2b('0x17')](_0xbd2b('0x13'),_0x335b9b,_0xe4eaa6);_0x2092d0(_0xe4eaa6);});});}exports['GetVoiceExtension']=function(_0x21a4e2){var _0x1e6ad0=this;return new Promise(function(_0x2b6af4,_0x12d252){return db[_0xbd2b('0x1c')][_0xbd2b('0x1d')]({'raw':_0x21a4e2[_0xbd2b('0x1e')]?_0x21a4e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x21a4e2['options']?_0x21a4e2[_0xbd2b('0x1e')]['where']||null:null,'attributes':_0x21a4e2[_0xbd2b('0x1e')]?_0x21a4e2[_0xbd2b('0x1e')]['attributes']||null:null,'limit':_0x21a4e2['options']?_0x21a4e2[_0xbd2b('0x1e')][_0xbd2b('0x1f')]||null:null,'include':_0x21a4e2['options']?_0x21a4e2['options']['include']?_[_0xbd2b('0x20')](_0x21a4e2[_0xbd2b('0x1e')][_0xbd2b('0x21')],function(_0xf22365){return{'model':db[_0xf22365[_0xbd2b('0x22')]],'as':_0xf22365['as'],'attributes':_0xf22365[_0xbd2b('0x23')],'include':_0xf22365['include']?_['map'](_0xf22365[_0xbd2b('0x21')],function(_0x3925ab){return{'model':db[_0x3925ab['model']],'as':_0x3925ab['as'],'attributes':_0x3925ab[_0xbd2b('0x23')],'include':_0x3925ab[_0xbd2b('0x21')]?_[_0xbd2b('0x20')](_0x3925ab[_0xbd2b('0x21')],function(_0x54ad15){return{'model':db[_0x54ad15[_0xbd2b('0x22')]],'as':_0x54ad15['as'],'attributes':_0x54ad15['attributes']};}):[]};}):[]};}):[]:[]})[_0xbd2b('0x11')](function(_0x364755){logger[_0xbd2b('0x12')](_0xbd2b('0x24'),_0x21a4e2);logger[_0xbd2b('0x15')](_0xbd2b('0x24'),_0x21a4e2,JSON[_0xbd2b('0x16')](_0x364755));_0x2b6af4(_0x364755);})['catch'](function(_0x25aaa5){logger['error'](_0xbd2b('0x24'),_0x25aaa5[_0xbd2b('0x19')],_0x21a4e2);_0x12d252(_0x1e6ad0['error'](0x1f4,_0x25aaa5['message']));});});}; \ No newline at end of file +var _0xdc97=['GetVoiceExtension','VoiceExtension','findAll','options','limit','include','map','model','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceExtension,\x20%s,\x20%s','message','info','catch'];(function(_0x4b1032,_0x36952e){var _0x5a1d55=function(_0x282e9b){while(--_0x282e9b){_0x4b1032['push'](_0x4b1032['shift']());}};_0x5a1d55(++_0x36952e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x33837b,_0x5d0951){_0x33837b=_0x33837b-0x0;var _0x1b50c4=_0xdc97[_0x33837b];return _0x1b50c4;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});config[_0x7dc9('0xa')]=_['defaults'](config['redis'],{'host':_0x7dc9('0xb'),'port':0x18eb});var socket=require(_0x7dc9('0xc'))(new Redis(config[_0x7dc9('0xa')]));require(_0x7dc9('0xd'))[_0x7dc9('0xe')](socket);function respondWithRpcPromise(_0x5ca05b,_0xb2fa2a,_0x44fe24){return new BPromise(function(_0x37dfc,_0x1dc3f7){return client[_0x7dc9('0xf')](_0x5ca05b,_0x44fe24)[_0x7dc9('0x10')](function(_0x1e336a){logger['info']('VoiceExtension,\x20%s,\x20%s',_0xb2fa2a,'request\x20sent');logger['debug'](_0x7dc9('0x11'),_0xb2fa2a,_0x7dc9('0x12'),JSON['stringify'](_0x1e336a));if(_0x1e336a[_0x7dc9('0x13')]){if(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x14')]===0x1f4){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')]['message']);return _0x1dc3f7(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);return _0x37dfc(_0x1e336a[_0x7dc9('0x13')][_0x7dc9('0x16')]);}else{logger[_0x7dc9('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xb2fa2a,_0x7dc9('0x12'));_0x37dfc(_0x1e336a['result'][_0x7dc9('0x16')]);}})[_0x7dc9('0x18')](function(_0x5d61d7){logger[_0x7dc9('0x13')](_0x7dc9('0x15'),_0xb2fa2a,_0x5d61d7);_0x1dc3f7(_0x5d61d7);});});}exports[_0x7dc9('0x19')]=function(_0x4b2703){var _0x43ec33=this;return new Promise(function(_0x184bfd,_0x2dad65){return db[_0x7dc9('0x1a')][_0x7dc9('0x1b')]({'raw':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703[_0x7dc9('0x1c')]['where']||null:null,'attributes':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703[_0x7dc9('0x1c')]['attributes']||null:null,'limit':_0x4b2703[_0x7dc9('0x1c')]?_0x4b2703[_0x7dc9('0x1c')][_0x7dc9('0x1d')]||null:null,'include':_0x4b2703['options']?_0x4b2703[_0x7dc9('0x1c')][_0x7dc9('0x1e')]?_[_0x7dc9('0x1f')](_0x4b2703['options']['include'],function(_0x4b9ba6){return{'model':db[_0x4b9ba6[_0x7dc9('0x20')]],'as':_0x4b9ba6['as'],'attributes':_0x4b9ba6[_0x7dc9('0x21')],'include':_0x4b9ba6['include']?_['map'](_0x4b9ba6[_0x7dc9('0x1e')],function(_0x5afb7d){return{'model':db[_0x5afb7d[_0x7dc9('0x20')]],'as':_0x5afb7d['as'],'attributes':_0x5afb7d[_0x7dc9('0x21')],'include':_0x5afb7d[_0x7dc9('0x1e')]?_[_0x7dc9('0x1f')](_0x5afb7d[_0x7dc9('0x1e')],function(_0x450124){return{'model':db[_0x450124[_0x7dc9('0x20')]],'as':_0x450124['as'],'attributes':_0x450124[_0x7dc9('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7dc9('0x10')](function(_0x3c4379){logger[_0x7dc9('0x17')](_0x7dc9('0x19'),_0x4b2703);logger['debug']('GetVoiceExtension',_0x4b2703,JSON['stringify'](_0x3c4379));_0x184bfd(_0x3c4379);})['catch'](function(_0x4a68f0){logger['error']('GetVoiceExtension',_0x4a68f0['message'],_0x4b2703);_0x2dad65(_0x43ec33[_0x7dc9('0x13')](0x1f4,_0x4a68f0[_0x7dc9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index ae351f9..13a7d6f 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x3248e8,_0x57b9ae){var _0x1a1373=function(_0x18e476){while(--_0x18e476){_0x3248e8['push'](_0x3248e8['shift']());}};_0x1a1373(++_0x57b9ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x697d17,_0x37b80b){_0x697d17=_0x697d17-0x0;var _0x3b3cd9=_0x2ef3[_0x697d17];return _0x3b3cd9;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4e71da,_0x345f22){_0x4e71da=_0x4e71da-0x0;var _0x4190ca=_0x1cb9[_0x4e71da];return _0x4190ca;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index d9c243d..e4f4b9f 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 _0x8ace=['isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x17a9a4,_0x103238){_0x17a9a4=_0x17a9a4-0x0;var _0x148d98=_0x8ace[_0x17a9a4];return _0x148d98;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['show']);router['get'](_0xe8ac('0xf'),auth['isAuthenticated'](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x12')]);router[_0xe8ac('0x13')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x14')]);router[_0xe8ac('0x15')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x16')]);module[_0xe8ac('0x17')]=router; \ No newline at end of file +var _0x66fa=['isAuthenticated','index','get','/:id','post','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x487d0a,_0x1b7cb4){var _0x3d740c=function(_0xa714f2){while(--_0xa714f2){_0x487d0a['push'](_0x487d0a['shift']());}};_0x3d740c(++_0x1b7cb4);}(_0x66fa,0x117));var _0xa66f=function(_0x44d500,_0x38c8ab){_0x44d500=_0x44d500-0x0;var _0x42c3e3=_0x66fa[_0x44d500];return _0x42c3e3;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/messages',auth[_0xa66f('0x9')](),controller['getMessages']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xe')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 7a866ba..6289ca2 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 _0x6a67=['central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email','string','trim'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0x6a67,0x15e));var _0x76a6=function(_0x597992,_0x516580){_0x597992=_0x597992-0x0;var _0x2bea67=_0x6a67[_0x597992];return _0x2bea67;};'use strict';var Sequelize=require(_0x76a6('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x76a6('0x1')]},'context':{'type':Sequelize[_0x76a6('0x1')],'defaultValue':'from-voicemail','unique':_0x76a6('0x2')},'mailbox':{'type':Sequelize[_0x76a6('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x76a6('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x76a6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1f0413){this[_0x76a6('0x3')](_0x76a6('0x4'),typeof _0x1f0413===_0x76a6('0x5')&&_0x1f0413[_0x76a6('0x6')]()?_0x1f0413[_0x76a6('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x76a6('0x1')],'defaultValue':_0x76a6('0x7')},'attach':{'type':Sequelize[_0x76a6('0x8')]('yes','no'),'defaultValue':_0x76a6('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':_0x76a6('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x76a6('0x1')]},'callback':{'type':Sequelize[_0x76a6('0x1')]},'review':{'type':Sequelize[_0x76a6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x76a6('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x76a6('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x76a6('0x8')](_0x76a6('0x9'),'no'),'defaultValue':_0x76a6('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x76a6('0x1')]},'emailbody':{'type':Sequelize[_0x76a6('0x1')]},'maxsecs':{'type':Sequelize[_0x76a6('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x76a6('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x76a6('0xc')],'get':function(){return this[_0x76a6('0xd')](_0x76a6('0xe'))+_0x76a6('0xf')+this[_0x76a6('0xd')](_0x76a6('0x10'));}}}; \ No newline at end of file +var _0x6cae=['yes','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','central','ENUM'];(function(_0x16d3e8,_0x3141c4){var _0x212402=function(_0x28ac2c){while(--_0x28ac2c){_0x16d3e8['push'](_0x16d3e8['shift']());}};_0x212402(++_0x3141c4);}(_0x6cae,0x106));var _0xe6ca=function(_0x32fcc6,_0x3fc921){_0x32fcc6=_0x32fcc6-0x0;var _0xa0c08e=_0x6cae[_0x32fcc6];return _0xa0c08e;};'use strict';var Sequelize=require(_0xe6ca('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe6ca('0x1')],'defaultValue':_0xe6ca('0x2'),'unique':_0xe6ca('0x3')},'mailbox':{'type':Sequelize[_0xe6ca('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xe6ca('0x1')]},'fullname':{'type':Sequelize[_0xe6ca('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x30328f){this['setDataValue'](_0xe6ca('0x4'),typeof _0x30328f===_0xe6ca('0x5')&&_0x30328f['trim']()?_0x30328f['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xe6ca('0x1')],'defaultValue':_0xe6ca('0x6')},'attach':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':_0xe6ca('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':_0xe6ca('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe6ca('0x1')]},'callback':{'type':Sequelize[_0xe6ca('0x1')]},'review':{'type':Sequelize['ENUM'](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe6ca('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':_0xe6ca('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xe6ca('0x7')](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xe6ca('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xe6ca('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xe6ca('0x1')]},'maxsecs':{'type':Sequelize[_0xe6ca('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe6ca('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe6ca('0xb')](_0xe6ca('0xc'))+_0xe6ca('0xd')+this[_0xe6ca('0xb')](_0xe6ca('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 8448236..033e691 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 _0xb7e7=['sort','where','pick','filter','options','show','params','keys','rawAttributes','intersection','includeAll','include','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','findAndCountAll','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','destroy','error','name','send','index','VoiceMail','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x40a29b,_0x275b30){var _0x56e29d=function(_0x572a8f){while(--_0x572a8f){_0x40a29b['push'](_0x40a29b['shift']());}};_0x56e29d(++_0x275b30);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];function respondWithStatusCode(_0xaadda,_0x54d8ce){_0x54d8ce=_0x54d8ce||0xcc;return function(_0x267446){if(_0x267446){return _0xaadda[_0x7b7e('0x19')](_0x54d8ce);}return _0xaadda['status'](_0x54d8ce)[_0x7b7e('0x1a')]();};}function respondWithResult(_0x5976ac,_0x4c6011){_0x4c6011=_0x4c6011||0xc8;return function(_0x2889ed){if(_0x2889ed){return _0x5976ac[_0x7b7e('0x1b')](_0x4c6011)[_0x7b7e('0x1c')](_0x2889ed);}};}function respondWithFilteredResult(_0x457ec5,_0x3d2fb2){return function(_0x5703fd){if(_0x5703fd){var _0x51baf6=typeof _0x3d2fb2[_0x7b7e('0x1d')]===_0x7b7e('0x1e')&&typeof _0x3d2fb2[_0x7b7e('0x1f')]===_0x7b7e('0x1e');var _0x2cc400=_0x5703fd[_0x7b7e('0x20')];var _0x242368=_0x51baf6?0x0:_0x3d2fb2[_0x7b7e('0x1d')];var _0x2acb8c=_0x51baf6?_0x5703fd[_0x7b7e('0x20')]:_0x3d2fb2[_0x7b7e('0x1d')]+_0x3d2fb2[_0x7b7e('0x1f')];var _0x448980;if(_0x2acb8c>=_0x2cc400){_0x2acb8c=_0x2cc400;_0x448980=0xc8;}else{_0x448980=0xce;}_0x457ec5[_0x7b7e('0x1b')](_0x448980);return _0x457ec5[_0x7b7e('0x21')](_0x7b7e('0x22'),_0x242368+'-'+_0x2acb8c+'/'+_0x2cc400)[_0x7b7e('0x1c')](_0x5703fd);}return null;};}function patchUpdates(_0x49eddb){return function(_0x69262b){try{jsonpatch[_0x7b7e('0x23')](_0x69262b,_0x49eddb,!![]);}catch(_0x24718c){return BPromise['reject'](_0x24718c);}return _0x69262b[_0x7b7e('0x24')]();};}function saveUpdates(_0xbf0cb3,_0x14243b){return function(_0x200156){if(_0x200156){return _0x200156[_0x7b7e('0x25')](_0xbf0cb3)[_0x7b7e('0x26')](function(_0x28bf43){return _0x28bf43;});}return null;};}function removeEntity(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(_0x5d6215){return _0x5d6215['destroy']()[_0x7b7e('0x26')](function(){var _0x22598e=_0x5d6215[_0x7b7e('0x27')]({'plain':!![]});var _0x483c6f='Voicemails';return db['UserProfileResource'][_0x7b7e('0x28')]({'where':{'type':_0x483c6f,'resourceId':_0x22598e['id']}})[_0x7b7e('0x26')](function(){return _0x5d6215;});})[_0x7b7e('0x26')](function(){_0x10a66a[_0x7b7e('0x1b')](0xcc)[_0x7b7e('0x1a')]();});}};}function handleEntityNotFound(_0x48fad1,_0x6a1e71){return function(_0x21a15){if(!_0x21a15){_0x48fad1['sendStatus'](0x194);}return _0x21a15;};}function handleError(_0x57b9da,_0x4e5de7){_0x4e5de7=_0x4e5de7||0x1f4;return function(_0x12ef0b){logger[_0x7b7e('0x29')](_0x12ef0b['stack']);if(_0x12ef0b[_0x7b7e('0x2a')]){delete _0x12ef0b['name'];}_0x57b9da[_0x7b7e('0x1b')](_0x4e5de7)[_0x7b7e('0x2b')](_0x12ef0b);};}exports[_0x7b7e('0x2c')]=function(_0x5515ca,_0x3960b8){var _0xe31336={},_0x35602a={},_0x326dd2={'count':0x0,'rows':[]};var _0x33f9a1=_['map'](db[_0x7b7e('0x2d')]['rawAttributes'],function(_0x23a453){return{'name':_0x23a453[_0x7b7e('0x2e')],'type':_0x23a453[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x35602a[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x33f9a1,_0x7b7e('0x2a'));_0x35602a['query']=_['keys'](_0x5515ca[_0x7b7e('0x33')]);_0x35602a[_0x7b7e('0x34')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],_0x35602a[_0x7b7e('0x33')]);_0xe31336[_0x7b7e('0x35')]=_['intersection'](_0x35602a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0xe31336[_0x7b7e('0x35')]=_0xe31336[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0xe31336[_0x7b7e('0x35')]:_0x35602a[_0x7b7e('0x31')];if(!_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0xe31336[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1f')]);_0xe31336['offset']=qs[_0x7b7e('0x1d')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x1d')]);}_0xe31336[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3b')]);_0xe31336[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x5515ca['query'],_0x35602a[_0x7b7e('0x34')]),_0x33f9a1);if(_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]){_0xe31336[_0x7b7e('0x3c')]=_['merge'](_0xe31336[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x32')](_0x33f9a1,function(_0x3d5280){if(_0x3d5280['type']!=='VIRTUAL'){var _0x22651e={};_0x22651e[_0x3d5280['name']]={'$like':'%'+_0x5515ca[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x22651e;}})});}_0xe31336=_['merge']({},_0xe31336,_0x5515ca[_0x7b7e('0x3f')]);var _0x2074d1={'where':_0xe31336[_0x7b7e('0x3c')]};return db[_0x7b7e('0x2d')][_0x7b7e('0x20')](_0x2074d1)[_0x7b7e('0x26')](function(_0xc888e4){_0x326dd2[_0x7b7e('0x20')]=_0xc888e4;if(_0x5515ca[_0x7b7e('0x33')]['includeAll']){_0xe31336['include']=[{'all':!![]}];}return db[_0x7b7e('0x2d')]['findAll'](_0xe31336);})[_0x7b7e('0x26')](function(_0x5e8b5d){_0x326dd2['rows']=_0x5e8b5d;return _0x326dd2;})[_0x7b7e('0x26')](respondWithFilteredResult(_0x3960b8,_0xe31336))['catch'](handleError(_0x3960b8,null));};exports[_0x7b7e('0x40')]=function(_0x52051c,_0xa8521d){var _0x3e58be={'raw':!![],'where':{'id':_0x52051c[_0x7b7e('0x41')]['id']}},_0x7ea84c={};_0x7ea84c['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x2d')][_0x7b7e('0x43')]);_0x7ea84c[_0x7b7e('0x33')]=_[_0x7b7e('0x42')](_0x52051c[_0x7b7e('0x33')]);_0x7ea84c['filters']=_['intersection'](_0x7ea84c['model'],_0x7ea84c[_0x7b7e('0x33')]);_0x3e58be[_0x7b7e('0x35')]=_[_0x7b7e('0x44')](_0x7ea84c[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x52051c[_0x7b7e('0x33')]['fields']));_0x3e58be[_0x7b7e('0x35')]=_0x3e58be[_0x7b7e('0x35')]['length']?_0x3e58be['attributes']:_0x7ea84c[_0x7b7e('0x31')];if(_0x52051c[_0x7b7e('0x33')][_0x7b7e('0x45')]){_0x3e58be[_0x7b7e('0x46')]=[{'all':!![]}];}_0x3e58be=_[_0x7b7e('0x47')]({},_0x3e58be,_0x52051c[_0x7b7e('0x3f')]);return db['VoiceMail'][_0x7b7e('0x48')](_0x3e58be)['then'](handleEntityNotFound(_0xa8521d,null))[_0x7b7e('0x26')](respondWithResult(_0xa8521d,null))[_0x7b7e('0x49')](handleError(_0xa8521d,null));};exports[_0x7b7e('0x4a')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x2d')][_0x7b7e('0x4a')](_0x5874e2[_0x7b7e('0x4b')],{})[_0x7b7e('0x26')](function(_0x1f9d0f){var _0x5cce7c=_0x5874e2[_0x7b7e('0x4c')][_0x7b7e('0x27')]({'plain':!![]});if(!_0x5cce7c)throw new Error(_0x7b7e('0x4d'));if(_0x5cce7c[_0x7b7e('0x4e')]===_0x7b7e('0x4c')){var _0x5a9697=_0x1f9d0f[_0x7b7e('0x27')]({'plain':!![]});var _0x29024e=_0x7b7e('0x4f');return db[_0x7b7e('0x50')][_0x7b7e('0x48')]({'where':{'name':_0x29024e,'userProfileId':_0x5cce7c[_0x7b7e('0x51')]},'raw':!![]})[_0x7b7e('0x26')](function(_0x4a7be0){if(_0x4a7be0&&_0x4a7be0[_0x7b7e('0x52')]===0x0){return db['UserProfileResource'][_0x7b7e('0x4a')]({'name':_0x5a9697[_0x7b7e('0x2a')],'resourceId':_0x5a9697['id'],'type':_0x4a7be0['name'],'sectionId':_0x4a7be0['id']},{})[_0x7b7e('0x26')](function(){return _0x1f9d0f;});}else{return _0x1f9d0f;}})[_0x7b7e('0x49')](function(_0x16c81d){logger[_0x7b7e('0x29')](_0x7b7e('0x53'),_0x16c81d);throw _0x16c81d;});}return _0x1f9d0f;})[_0x7b7e('0x26')](respondWithResult(_0x58e4e6,0xc9))[_0x7b7e('0x49')](handleError(_0x58e4e6,null));};exports['update']=function(_0xbf044d,_0x3ff731){if(_0xbf044d[_0x7b7e('0x4b')]['id']){delete _0xbf044d[_0x7b7e('0x4b')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0xbf044d['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3ff731,null))[_0x7b7e('0x26')](saveUpdates(_0xbf044d[_0x7b7e('0x4b')],null))['then'](respondWithResult(_0x3ff731,null))['catch'](handleError(_0x3ff731,null));};exports[_0x7b7e('0x28')]=function(_0x39efb5,_0x4fecf7){return db[_0x7b7e('0x2d')][_0x7b7e('0x48')]({'where':{'id':_0x39efb5[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x4fecf7,null))[_0x7b7e('0x26')](removeEntity(_0x4fecf7,null))[_0x7b7e('0x49')](handleError(_0x4fecf7,null));};exports['getMessages']=function(_0x25c933,_0x441c3c,_0x1d7db1){return db[_0x7b7e('0x2d')][_0x7b7e('0x54')]({'where':{'id':_0x25c933[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x441c3c,null))[_0x7b7e('0x26')](function(_0x45fff9){var _0x5509ad;var _0x29d0af={},_0x20108a={};_0x20108a['model']=_[_0x7b7e('0x42')](db[_0x7b7e('0x55')][_0x7b7e('0x43')]);_0x20108a['query']=_[_0x7b7e('0x42')](_0x25c933['query']);_0x20108a[_0x7b7e('0x34')]=_[_0x7b7e('0x44')](_0x20108a['model'],_0x20108a[_0x7b7e('0x33')]);_0x29d0af[_0x7b7e('0x35')]=_['intersection'](_0x20108a[_0x7b7e('0x31')],qs[_0x7b7e('0x36')](_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x36')]));_0x29d0af['attributes']=_0x29d0af[_0x7b7e('0x35')][_0x7b7e('0x37')]?_0x29d0af[_0x7b7e('0x35')]:_0x20108a[_0x7b7e('0x31')];if(!_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x29d0af[_0x7b7e('0x1f')]=qs[_0x7b7e('0x1f')](_0x25c933[_0x7b7e('0x33')]['limit']);_0x29d0af[_0x7b7e('0x1d')]=qs['offset'](_0x25c933['query'][_0x7b7e('0x1d')]);}_0x29d0af[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x25c933[_0x7b7e('0x33')]['sort']);_0x29d0af[_0x7b7e('0x3c')]=qs[_0x7b7e('0x34')](_[_0x7b7e('0x3d')](_0x25c933[_0x7b7e('0x33')],_0x20108a[_0x7b7e('0x34')]));if(_0x25c933[_0x7b7e('0x33')]['filter']){_0x29d0af[_0x7b7e('0x3c')]=_['merge'](_0x29d0af['where'],{'$or':_[_0x7b7e('0x32')](_0x29d0af['attributes'],function(_0x47aa4c){var _0x4a2378={};_0x4a2378[_0x47aa4c]={'$like':'%'+_0x25c933[_0x7b7e('0x33')][_0x7b7e('0x3e')]+'%'};return _0x4a2378;})});}_0x29d0af['where']=_[_0x7b7e('0x47')](_0x29d0af[_0x7b7e('0x3c')],{'mailboxuser':_0x45fff9['mailbox']});_0x29d0af=_[_0x7b7e('0x47')]({},_0x29d0af,_0x25c933[_0x7b7e('0x3f')]);return db[_0x7b7e('0x55')][_0x7b7e('0x56')](_0x29d0af)[_0x7b7e('0x26')](respondWithFilteredResult(_0x441c3c,_0x29d0af));})[_0x7b7e('0x49')](handleError(_0x441c3c,null));}; \ No newline at end of file +var _0x4024=['limit','count','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xf5dbed,_0x28884b){var _0x1b102f=function(_0x198396){while(--_0x198396){_0xf5dbed['push'](_0xf5dbed['shift']());}};_0x1b102f(++_0x28884b);}(_0x4024,0x89));var _0x4402=function(_0x30a916,_0x3e2140){_0x30a916=_0x30a916-0x0;var _0x443edd=_0x4024[_0x30a916];return _0x443edd;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['VoiceMail'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['VoiceMail'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':!![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['VoiceMail'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['update']=function(_0xe8a8e9,_0x642ab4){if(_0xe8a8e9[_0x4402('0x44')]['id']){delete _0xe8a8e9[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x642ab4,null))['then'](saveUpdates(_0xe8a8e9[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x642ab4,null))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['destroy']=function(_0x5a076a,_0x258926){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x5a076a[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x258926,null))[_0x4402('0x1f')](removeEntity(_0x258926,null))[_0x4402('0x3c')](handleError(_0x258926,null));};exports[_0x4402('0x4a')]=function(_0x394ac9,_0x3f2599,_0x353679){return db[_0x4402('0x28')][_0x4402('0x4b')]({'where':{'id':_0x394ac9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x3f2599,null))['then'](function(_0xe4530a){var _0x55922e;var _0x3fb9f0={},_0x1e5891={};_0x1e5891[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x4c')][_0x4402('0x29')]);_0x1e5891['query']=_[_0x4402('0x2d')](_0x394ac9[_0x4402('0x2c')]);_0x1e5891[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],_0x1e5891['query']);_0x3fb9f0[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x394ac9[_0x4402('0x2c')][_0x4402('0x30')]));_0x3fb9f0[_0x4402('0x2f')]=_0x3fb9f0[_0x4402('0x2f')]['length']?_0x3fb9f0[_0x4402('0x2f')]:_0x1e5891[_0x4402('0x2b')];if(!_0x394ac9['query'][_0x4402('0x32')](_0x4402('0x33'))){_0x3fb9f0['limit']=qs['limit'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x19')]);_0x3fb9f0[_0x4402('0x17')]=qs['offset'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3fb9f0[_0x4402('0x4d')]=qs['sort'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x34')]);_0x3fb9f0[_0x4402('0x35')]=qs['filters'](_[_0x4402('0x4e')](_0x394ac9[_0x4402('0x2c')],_0x1e5891['filters']));if(_0x394ac9['query'][_0x4402('0x36')]){_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'$or':_['map'](_0x3fb9f0['attributes'],function(_0x432c2e){var _0x42cdd6={};_0x42cdd6[_0x432c2e]={'$like':'%'+_0x394ac9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x42cdd6;})});}_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'mailboxuser':_0xe4530a[_0x4402('0x4f')]});_0x3fb9f0=_[_0x4402('0x38')]({},_0x3fb9f0,_0x394ac9[_0x4402('0x41')]);return db[_0x4402('0x4c')][_0x4402('0x50')](_0x3fb9f0)['then'](respondWithFilteredResult(_0x3f2599,_0x3fb9f0));})[_0x4402('0x3c')](handleError(_0x3f2599,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b36567f..6fae16d 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 _0xb199=['../../config/logger','api','moment','request-promise','path','rimraf','./voiceMail.attributes','define','VoiceMail','mailbox','util'];(function(_0x33a5ec,_0x10c014){var _0x38f89c=function(_0x15f7ee){while(--_0x15f7ee){_0x33a5ec['push'](_0x33a5ec['shift']());}};_0x38f89c(++_0x10c014);}(_0xb199,0x107));var _0x9b19=function(_0xc56722,_0x19aa94){_0xc56722=_0xc56722-0x0;var _0xacb86d=_0xb199[_0xc56722];return _0xacb86d;};'use strict';var _=require('lodash');var util=require(_0x9b19('0x0'));var logger=require(_0x9b19('0x1'))(_0x9b19('0x2'));var moment=require(_0x9b19('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b19('0x4'));var fs=require('fs');var path=require(_0x9b19('0x5'));var rimraf=require(_0x9b19('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b19('0x7'));module['exports']=function(_0x4385f5,_0x3ad803){return _0x4385f5[_0x9b19('0x8')](_0x9b19('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x9b19('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c87=['voice_voicemail','mailbox_context','context','lodash','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMail'];(function(_0x95dc95,_0x3002fe){var _0x66cc35=function(_0x35355f){while(--_0x35355f){_0x95dc95['push'](_0x95dc95['shift']());}};_0x66cc35(++_0x3002fe);}(_0x7c87,0x78));var _0x77c8=function(_0x12b77c,_0x6bc6a1){_0x12b77c=_0x12b77c-0x0;var _0x47e93e=_0x7c87[_0x12b77c];return _0x47e93e;};'use strict';var _=require(_0x77c8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x77c8('0x1'));var moment=require(_0x77c8('0x2'));var BPromise=require('bluebird');var rp=require(_0x77c8('0x3'));var fs=require('fs');var path=require(_0x77c8('0x4'));var rimraf=require(_0x77c8('0x5'));var config=require(_0x77c8('0x6'));var attributes=require('./voiceMail.attributes');module[_0x77c8('0x7')]=function(_0x5f3b67,_0x212c0d){return _0x5f3b67[_0x77c8('0x8')](_0x77c8('0x9'),attributes,{'tableName':_0x77c8('0xa'),'paranoid':![],'indexes':[{'name':_0x77c8('0xb'),'fields':['mailbox',_0x77c8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 41b6bae..20a852a 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 _0x500c=['debug','request\x20sent','stringify','code','error','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info'];(function(_0xf11569,_0x4fdb60){var _0x33c661=function(_0x3b0a61){while(--_0x3b0a61){_0xf11569['push'](_0xf11569['shift']());}};_0x33c661(++_0x4fdb60);}(_0x500c,0x9c));var _0xc500=function(_0x2f9388,_0x5b58a4){_0x2f9388=_0x2f9388-0x0;var _0x631658=_0x500c[_0x2f9388];return _0x631658;};'use strict';var _=require(_0xc500('0x0'));var util=require(_0xc500('0x1'));var moment=require(_0xc500('0x2'));var BPromise=require(_0xc500('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc500('0x4'));var db=require(_0xc500('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc500('0x6'))('rpc');var config=require(_0xc500('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc500('0x8')][_0xc500('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x317fbe,_0x4c66b0,_0x10352a){return new BPromise(function(_0x2a92b5,_0xd23102){return client[_0xc500('0xa')](_0x317fbe,_0x10352a)['then'](function(_0x240818){logger[_0xc500('0xb')]('VoiceMail,\x20%s,\x20%s',_0x4c66b0,'request\x20sent');logger[_0xc500('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4c66b0,_0xc500('0xd'),JSON[_0xc500('0xe')](_0x240818));if(_0x240818['error']){if(_0x240818['error'][_0xc500('0xf')]===0x1f4){logger[_0xc500('0x10')]('VoiceMail,\x20%s,\x20%s',_0x4c66b0,_0x240818['error'][_0xc500('0x11')]);return _0xd23102(_0x240818[_0xc500('0x10')][_0xc500('0x11')]);}logger[_0xc500('0x10')]('VoiceMail,\x20%s,\x20%s',_0x4c66b0,_0x240818[_0xc500('0x10')][_0xc500('0x11')]);return _0x2a92b5(_0x240818[_0xc500('0x10')]['message']);}else{logger[_0xc500('0xb')](_0xc500('0x12'),_0x4c66b0,_0xc500('0xd'));_0x2a92b5(_0x240818[_0xc500('0x13')]['message']);}})[_0xc500('0x14')](function(_0x2373a8){logger[_0xc500('0x10')](_0xc500('0x12'),_0x4c66b0,_0x2373a8);_0xd23102(_0x2373a8);});});} \ No newline at end of file +var _0x6d8f=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x4ecd70,_0x562d3d){var _0x53c2b6=function(_0x75cbec){while(--_0x75cbec){_0x4ecd70['push'](_0x4ecd70['shift']());}};_0x53c2b6(++_0x562d3d);}(_0x6d8f,0x79));var _0xf6d8=function(_0x2174fd,_0x259235){_0x2174fd=_0x2174fd-0x0;var _0x3bfd50=_0x6d8f[_0x2174fd];return _0x3bfd50;};'use strict';var _=require(_0xf6d8('0x0'));var util=require(_0xf6d8('0x1'));var moment=require(_0xf6d8('0x2'));var BPromise=require(_0xf6d8('0x3'));var rs=require(_0xf6d8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6d8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6d8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6d8('0x7'));var client=jayson[_0xf6d8('0x8')][_0xf6d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aa738,_0xd5ad26,_0x596bdf){return new BPromise(function(_0x4664c2,_0x5a226a){return client[_0xf6d8('0xa')](_0x1aa738,_0x596bdf)[_0xf6d8('0xb')](function(_0x136d3e){logger[_0xf6d8('0xc')](_0xf6d8('0xd'),_0xd5ad26,_0xf6d8('0xe'));logger[_0xf6d8('0xf')](_0xf6d8('0x10'),_0xd5ad26,_0xf6d8('0xe'),JSON[_0xf6d8('0x11')](_0x136d3e));if(_0x136d3e[_0xf6d8('0x12')]){if(_0x136d3e[_0xf6d8('0x12')][_0xf6d8('0x13')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0xd5ad26,_0x136d3e[_0xf6d8('0x12')][_0xf6d8('0x14')]);return _0x5a226a(_0x136d3e['error'][_0xf6d8('0x14')]);}logger[_0xf6d8('0x12')](_0xf6d8('0xd'),_0xd5ad26,_0x136d3e[_0xf6d8('0x12')][_0xf6d8('0x14')]);return _0x4664c2(_0x136d3e[_0xf6d8('0x12')]['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0xd5ad26,_0xf6d8('0xe'));_0x4664c2(_0x136d3e[_0xf6d8('0x15')][_0xf6d8('0x14')]);}})[_0xf6d8('0x16')](function(_0x33a2ce){logger[_0xf6d8('0x12')](_0xf6d8('0xd'),_0xd5ad26,_0x33a2ce);_0x5a226a(_0x33a2ce);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f372c3f..bcb04c9 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 _0x5280=['create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','post'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5280,0x134));var _0x0528=function(_0x568bd7,_0x23eea6){_0x568bd7=_0x568bd7-0x0;var _0x203cda=_0x5280[_0x568bd7];return _0x203cda;};'use strict';var multer=require(_0x0528('0x0'));var util=require(_0x0528('0x1'));var path=require('path');var timeout=require(_0x0528('0x2'));var express=require(_0x0528('0x3'));var router=express[_0x0528('0x4')]();var fs_extra=require(_0x0528('0x5'));var auth=require(_0x0528('0x6'));var interaction=require(_0x0528('0x7'));var config=require(_0x0528('0x8'));var controller=require(_0x0528('0x9'));router[_0x0528('0xa')]('/',auth[_0x0528('0xb')](),controller[_0x0528('0xc')]);router['get'](_0x0528('0xd'),auth[_0x0528('0xb')](),controller['show']);router[_0x0528('0xa')]('/:id/download',auth[_0x0528('0xb')](),controller['download']);router[_0x0528('0xe')]('/',auth[_0x0528('0xb')](),controller[_0x0528('0xf')]);router[_0x0528('0x10')](_0x0528('0xd'),auth[_0x0528('0xb')](),controller[_0x0528('0x11')]);router['delete'](_0x0528('0xd'),auth[_0x0528('0xb')](),controller['destroy']);module[_0x0528('0x12')]=router; \ No newline at end of file +var _0x4de0=['index','get','/:id','show','/:id/download','download','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x438150,_0x115ac5){var _0x346964=function(_0x261d14){while(--_0x261d14){_0x438150['push'](_0x438150['shift']());}};_0x346964(++_0x115ac5);}(_0x4de0,0x1c1));var _0x04de=function(_0x5376ea,_0x2c4d7d){_0x5376ea=_0x5376ea-0x0;var _0xee86bb=_0x4de0[_0x5376ea];return _0xee86bb;};'use strict';var multer=require('multer');var util=require(_0x04de('0x0'));var path=require(_0x04de('0x1'));var timeout=require(_0x04de('0x2'));var express=require(_0x04de('0x3'));var router=express[_0x04de('0x4')]();var fs_extra=require(_0x04de('0x5'));var auth=require(_0x04de('0x6'));var interaction=require(_0x04de('0x7'));var config=require(_0x04de('0x8'));var controller=require(_0x04de('0x9'));router['get']('/',auth[_0x04de('0xa')](),controller[_0x04de('0xb')]);router[_0x04de('0xc')](_0x04de('0xd'),auth['isAuthenticated'](),controller[_0x04de('0xe')]);router[_0x04de('0xc')](_0x04de('0xf'),auth[_0x04de('0xa')](),controller[_0x04de('0x10')]);router['post']('/',auth[_0x04de('0xa')](),controller[_0x04de('0x11')]);router[_0x04de('0x12')](_0x04de('0xd'),auth[_0x04de('0xa')](),controller[_0x04de('0x13')]);router[_0x04de('0x14')](_0x04de('0xd'),auth[_0x04de('0xa')](),controller[_0x04de('0x15')]);module[_0x04de('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 0f1d4bf..5974d0a 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 _0x2f12=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x2f12,0xd4));var _0x22f1=function(_0x1eac9b,_0x24bf2f){_0x1eac9b=_0x1eac9b-0x0;var _0x33dfd6=_0x2f12[_0x1eac9b];return _0x33dfd6;};'use strict';var Sequelize=require('sequelize');module[_0x22f1('0x0')]={'name':{'type':Sequelize[_0x22f1('0x1')],'get':function(_0x58ff98){return this[_0x22f1('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x22f1('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x22f1('0x5')](_0x22f1('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x22f1('0x4')],'defaultValue':''},'stamp':{'type':_0x22f1('0x7'),'defaultValue':Sequelize[_0x22f1('0x8')](_0x22f1('0x9'))}}; \ No newline at end of file +var _0xd51e=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x1feb91,_0x2d6c7f){var _0x41de30=function(_0x1263df){while(--_0x1263df){_0x1feb91['push'](_0x1feb91['shift']());}};_0x41de30(++_0x2d6c7f);}(_0xd51e,0x1ec));var _0xed51=function(_0x38bf64,_0x1ba17f){_0x38bf64=_0x38bf64-0x0;var _0x417f34=_0xd51e[_0x38bf64];return _0x417f34;};'use strict';var Sequelize=require(_0xed51('0x0'));module['exports']={'name':{'type':Sequelize[_0xed51('0x1')],'get':function(_0x5416cb){return this[_0xed51('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xed51('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xed51('0x5')](_0xed51('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xed51('0x4')],'defaultValue':''},'stamp':{'type':_0xed51('0x7'),'defaultValue':Sequelize[_0xed51('0x8')](_0xed51('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 176fb6a..15205b1 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 _0x3fc3=['.wav\x22','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','model','differenceBy','keys','filters','attributes','intersection','fields','query','length','nolimit','order','sort','where','filter','merge','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','body','destroy','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition'];(function(_0x1b9025,_0x57ca6c){var _0x125c02=function(_0x2c8f3c){while(--_0x2c8f3c){_0x1b9025['push'](_0x1b9025['shift']());}};_0x125c02(++_0x57ca6c);}(_0x3fc3,0xf7));var _0x33fc=function(_0x2c5803,_0x35fa03){_0x2c5803=_0x2c5803-0x0;var _0x18a0ec=_0x3fc3[_0x2c5803];return _0x18a0ec;};'use strict';var emlformat=require(_0x33fc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x33fc('0x1'));var moment=require(_0x33fc('0x2'));var BPromise=require(_0x33fc('0x3'));var Mustache=require(_0x33fc('0x4'));var util=require(_0x33fc('0x5'));var path=require(_0x33fc('0x6'));var sox=require(_0x33fc('0x7'));var csv=require(_0x33fc('0x8'));var ejs=require(_0x33fc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33fc('0xa'));var squel=require(_0x33fc('0xb'));var crypto=require(_0x33fc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x33fc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x33fc('0xe'));var Papa=require('papaparse');var Redis=require(_0x33fc('0xf'));var authService=require(_0x33fc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x33fc('0x11'));var hardwareService=require(_0x33fc('0x12'));var logger=require(_0x33fc('0x13'))(_0x33fc('0x14'));var utils=require(_0x33fc('0x15'));var config=require(_0x33fc('0x16'));var licenseUtil=require(_0x33fc('0x17'));var db=require(_0x33fc('0x18'))['db'];function respondWithStatusCode(_0x422038,_0x2b2721){_0x2b2721=_0x2b2721||0xcc;return function(_0x1e385b){if(_0x1e385b){return _0x422038[_0x33fc('0x19')](_0x2b2721);}return _0x422038['status'](_0x2b2721)['end']();};}function respondWithResult(_0x305811,_0x52724c){_0x52724c=_0x52724c||0xc8;return function(_0x2be0f7){if(_0x2be0f7){return _0x305811[_0x33fc('0x1a')](_0x52724c)['json'](_0x2be0f7);}};}function respondWithFilteredResult(_0x44d1a5,_0x4ffcf1){return function(_0x298100){if(_0x298100){var _0x35355f=typeof _0x4ffcf1[_0x33fc('0x1b')]===_0x33fc('0x1c')&&typeof _0x4ffcf1[_0x33fc('0x1d')]===_0x33fc('0x1c');var _0x2f7285=_0x298100['count'];var _0x11dc9a=_0x35355f?0x0:_0x4ffcf1[_0x33fc('0x1b')];var _0x163cd8=_0x35355f?_0x298100[_0x33fc('0x1e')]:_0x4ffcf1['offset']+_0x4ffcf1[_0x33fc('0x1d')];var _0x33905d;if(_0x163cd8>=_0x2f7285){_0x163cd8=_0x2f7285;_0x33905d=0xc8;}else{_0x33905d=0xce;}_0x44d1a5[_0x33fc('0x1a')](_0x33905d);return _0x44d1a5[_0x33fc('0x1f')](_0x33fc('0x20'),_0x11dc9a+'-'+_0x163cd8+'/'+_0x2f7285)[_0x33fc('0x21')](_0x298100);}return null;};}function patchUpdates(_0x523f02){return function(_0x45acaa){try{jsonpatch[_0x33fc('0x22')](_0x45acaa,_0x523f02,!![]);}catch(_0x3dfdd3){return BPromise['reject'](_0x3dfdd3);}return _0x45acaa[_0x33fc('0x23')]();};}function saveUpdates(_0x2ae023,_0x19c9d9){return function(_0x293999){if(_0x293999){return _0x293999[_0x33fc('0x24')](_0x2ae023)[_0x33fc('0x25')](function(_0x359b10){return _0x359b10;});}return null;};}function removeEntity(_0x7e6cc8,_0x193d45){return function(_0x1ed190){if(_0x1ed190){return _0x1ed190['destroy']()['then'](function(){_0x7e6cc8[_0x33fc('0x1a')](0xcc)[_0x33fc('0x26')]();});}};}function handleEntityNotFound(_0x2068cb,_0x439472){return function(_0x2d4547){if(!_0x2d4547){_0x2068cb[_0x33fc('0x19')](0x194);}return _0x2d4547;};}function handleError(_0x259dbe,_0x5d99e5){_0x5d99e5=_0x5d99e5||0x1f4;return function(_0x31ffa6){logger[_0x33fc('0x27')](_0x31ffa6[_0x33fc('0x28')]);if(_0x31ffa6[_0x33fc('0x29')]){delete _0x31ffa6[_0x33fc('0x29')];}_0x259dbe[_0x33fc('0x1a')](_0x5d99e5)[_0x33fc('0x2a')](_0x31ffa6);};}exports[_0x33fc('0x2b')]=function(_0xd9f656,_0x136ba7){var _0x57225a={},_0x4dd2c9={},_0x3c649a={'count':0x0,'rows':[]};var _0x512a26=_[_0x33fc('0x2c')](db[_0x33fc('0x2d')]['rawAttributes'],function(_0x207d78){return{'name':_0x207d78[_0x33fc('0x2e')],'type':_0x207d78[_0x33fc('0x2f')][_0x33fc('0x30')]};});_0x4dd2c9[_0x33fc('0x31')]=_[_0x33fc('0x32')](_[_0x33fc('0x2c')](_0x512a26,_0x33fc('0x29')),[_0x33fc('0x29')]);_0x4dd2c9['query']=_[_0x33fc('0x33')](_0xd9f656['query']);_0x4dd2c9[_0x33fc('0x34')]=_['intersection'](_0x4dd2c9[_0x33fc('0x31')],_0x4dd2c9['query']);_0x57225a[_0x33fc('0x35')]=_[_0x33fc('0x36')](_0x4dd2c9[_0x33fc('0x31')],qs[_0x33fc('0x37')](_0xd9f656[_0x33fc('0x38')][_0x33fc('0x37')]));_0x57225a[_0x33fc('0x35')]=_0x57225a[_0x33fc('0x35')][_0x33fc('0x39')]?_0x57225a[_0x33fc('0x35')]:_0x4dd2c9[_0x33fc('0x31')];if(!_0xd9f656[_0x33fc('0x38')]['hasOwnProperty'](_0x33fc('0x3a'))){_0x57225a[_0x33fc('0x1d')]=qs[_0x33fc('0x1d')](_0xd9f656['query'][_0x33fc('0x1d')]);_0x57225a[_0x33fc('0x1b')]=qs[_0x33fc('0x1b')](_0xd9f656[_0x33fc('0x38')]['offset']);}_0x57225a[_0x33fc('0x3b')]=qs[_0x33fc('0x3c')](_0xd9f656[_0x33fc('0x38')][_0x33fc('0x3c')]);_0x57225a[_0x33fc('0x3d')]=qs[_0x33fc('0x34')](_['pick'](_0xd9f656[_0x33fc('0x38')],_0x4dd2c9[_0x33fc('0x34')]),_0x512a26);if(_0xd9f656['query'][_0x33fc('0x3e')]){_0x57225a[_0x33fc('0x3d')]=_[_0x33fc('0x3f')](_0x57225a[_0x33fc('0x3d')],{'$or':_[_0x33fc('0x2c')](_0x512a26,function(_0x10056d){if(_0x10056d[_0x33fc('0x2f')]!=='VIRTUAL'){var _0x4c1160={};_0x4c1160[_0x10056d[_0x33fc('0x29')]]={'$like':'%'+_0xd9f656[_0x33fc('0x38')][_0x33fc('0x3e')]+'%'};return _0x4c1160;}})});}_0x57225a=_[_0x33fc('0x3f')]({},_0x57225a,_0xd9f656['options']);var _0x5b5a1f={'where':_0x57225a['where']};return db[_0x33fc('0x2d')][_0x33fc('0x1e')](_0x5b5a1f)[_0x33fc('0x25')](function(_0x1def5b){_0x3c649a['count']=_0x1def5b;if(_0xd9f656[_0x33fc('0x38')]['includeAll']){_0x57225a['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x33fc('0x40')](_0x57225a);})[_0x33fc('0x25')](function(_0x42e0d9){_0x3c649a[_0x33fc('0x41')]=_0x42e0d9;return _0x3c649a;})[_0x33fc('0x25')](respondWithFilteredResult(_0x136ba7,_0x57225a))[_0x33fc('0x42')](handleError(_0x136ba7,null));};exports[_0x33fc('0x43')]=function(_0x46a1e9,_0x117706){var _0x36888d={'raw':!![],'where':{'id':_0x46a1e9[_0x33fc('0x44')]['id']}},_0x5efcd6={};_0x5efcd6[_0x33fc('0x31')]=_[_0x33fc('0x33')](db[_0x33fc('0x2d')][_0x33fc('0x45')]);_0x5efcd6[_0x33fc('0x38')]=_[_0x33fc('0x33')](_0x46a1e9[_0x33fc('0x38')]);_0x5efcd6[_0x33fc('0x34')]=_['intersection'](_0x5efcd6[_0x33fc('0x31')],_0x5efcd6[_0x33fc('0x38')]);_0x36888d[_0x33fc('0x35')]=_[_0x33fc('0x36')](_0x5efcd6[_0x33fc('0x31')],qs[_0x33fc('0x37')](_0x46a1e9[_0x33fc('0x38')][_0x33fc('0x37')]));_0x36888d[_0x33fc('0x35')]=_0x36888d[_0x33fc('0x35')][_0x33fc('0x39')]?_0x36888d[_0x33fc('0x35')]:_0x5efcd6['model'];if(_0x46a1e9[_0x33fc('0x38')][_0x33fc('0x46')]){_0x36888d[_0x33fc('0x47')]=[{'all':!![]}];}_0x36888d=_[_0x33fc('0x3f')]({},_0x36888d,_0x46a1e9['options']);return db[_0x33fc('0x2d')][_0x33fc('0x48')](_0x36888d)['then'](handleEntityNotFound(_0x117706,null))['then'](respondWithResult(_0x117706,null))[_0x33fc('0x42')](handleError(_0x117706,null));};exports['create']=function(_0x12990b,_0x76cce8){return db[_0x33fc('0x2d')]['create'](_0x12990b['body'],{})[_0x33fc('0x25')](respondWithResult(_0x76cce8,0xc9))[_0x33fc('0x42')](handleError(_0x76cce8,null));};exports[_0x33fc('0x24')]=function(_0x134cf3,_0x503a4d){if(_0x134cf3[_0x33fc('0x49')]['id']){delete _0x134cf3[_0x33fc('0x49')]['id'];}return db[_0x33fc('0x2d')]['find']({'where':{'id':_0x134cf3['params']['id']}})[_0x33fc('0x25')](handleEntityNotFound(_0x503a4d,null))['then'](saveUpdates(_0x134cf3[_0x33fc('0x49')],null))[_0x33fc('0x25')](respondWithResult(_0x503a4d,null))['catch'](handleError(_0x503a4d,null));};exports[_0x33fc('0x4a')]=function(_0x265f80,_0x245ba3){return db[_0x33fc('0x2d')][_0x33fc('0x48')]({'where':{'id':_0x265f80['params']['id']}})['then'](handleEntityNotFound(_0x245ba3,null))[_0x33fc('0x25')](removeEntity(_0x245ba3,null))[_0x33fc('0x42')](handleError(_0x245ba3,null));};exports['download']=function(_0x27d12a,_0xf60eb7,_0x2d6268){return db[_0x33fc('0x2d')]['find']({'where':{'id':_0x27d12a[_0x33fc('0x44')]['id']},'attributes':['id',_0x33fc('0x4b'),_0x33fc('0x4c')]})[_0x33fc('0x25')](handleEntityNotFound(_0xf60eb7,null))[_0x33fc('0x25')](function(_0x5768d2){if(_0x5768d2){if(!_0x5768d2['recording']){throw new db[(_0x33fc('0x4d'))]['ValidationError'](_0x33fc('0x4e'));}var _0x274f0e={'Content-Type':'audio/wav','Content-Disposition':_0x33fc('0x4f')};if(_0x5768d2[_0x33fc('0x4c')]){_0x274f0e[_0x33fc('0x50')]='attachment;\x20filename=\x22'+_0x5768d2[_0x33fc('0x4c')]+_0x33fc('0x51');}_0xf60eb7[_0x33fc('0x1f')](_0x274f0e);return _0xf60eb7[_0x33fc('0x2a')](new Buffer(_0x5768d2['recording']));}})[_0x33fc('0x42')](handleError(_0xf60eb7,null));}; \ No newline at end of file +var _0x8a3f=['attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','VoiceMailMessage','type','key','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav'];(function(_0x59bac2,_0x298ff5){var _0x1c9eae=function(_0xbb9fa1){while(--_0xbb9fa1){_0x59bac2['push'](_0x59bac2['shift']());}};_0x1c9eae(++_0x298ff5);}(_0x8a3f,0xfd));var _0xf8a3=function(_0x2276ea,_0x3c20b7){_0x2276ea=_0x2276ea-0x0;var _0x239c5d=_0x8a3f[_0x2276ea];return _0x239c5d;};'use strict';var emlformat=require(_0xf8a3('0x0'));var rimraf=require(_0xf8a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8a3('0x2'));var rp=require(_0xf8a3('0x3'));var moment=require('moment');var BPromise=require(_0xf8a3('0x4'));var Mustache=require(_0xf8a3('0x5'));var util=require(_0xf8a3('0x6'));var path=require(_0xf8a3('0x7'));var sox=require('sox');var csv=require(_0xf8a3('0x8'));var ejs=require(_0xf8a3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8a3('0xa'));var _=require('lodash');var squel=require(_0xf8a3('0xb'));var crypto=require(_0xf8a3('0xc'));var jsforce=require(_0xf8a3('0xd'));var deskjs=require(_0xf8a3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8a3('0xf'));var Papa=require(_0xf8a3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8a3('0x11'))(_0xf8a3('0x12'));var utils=require(_0xf8a3('0x13'));var config=require(_0xf8a3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8a3('0x15'))['db'];function respondWithStatusCode(_0x5802de,_0x3624bc){_0x3624bc=_0x3624bc||0xcc;return function(_0x201db2){if(_0x201db2){return _0x5802de[_0xf8a3('0x16')](_0x3624bc);}return _0x5802de[_0xf8a3('0x17')](_0x3624bc)[_0xf8a3('0x18')]();};}function respondWithResult(_0x595f3b,_0x565812){_0x565812=_0x565812||0xc8;return function(_0x3c11a7){if(_0x3c11a7){return _0x595f3b['status'](_0x565812)[_0xf8a3('0x19')](_0x3c11a7);}};}function respondWithFilteredResult(_0x5388c1,_0x77be87){return function(_0x5081ea){if(_0x5081ea){var _0x48cf31=typeof _0x77be87['offset']===_0xf8a3('0x1a')&&typeof _0x77be87[_0xf8a3('0x1b')]==='undefined';var _0x17a658=_0x5081ea['count'];var _0x168244=_0x48cf31?0x0:_0x77be87['offset'];var _0x274eed=_0x48cf31?_0x5081ea[_0xf8a3('0x1c')]:_0x77be87[_0xf8a3('0x1d')]+_0x77be87[_0xf8a3('0x1b')];var _0x20bac;if(_0x274eed>=_0x17a658){_0x274eed=_0x17a658;_0x20bac=0xc8;}else{_0x20bac=0xce;}_0x5388c1[_0xf8a3('0x17')](_0x20bac);return _0x5388c1[_0xf8a3('0x1e')](_0xf8a3('0x1f'),_0x168244+'-'+_0x274eed+'/'+_0x17a658)[_0xf8a3('0x19')](_0x5081ea);}return null;};}function patchUpdates(_0x36910d){return function(_0x3c0e5f){try{jsonpatch[_0xf8a3('0x20')](_0x3c0e5f,_0x36910d,!![]);}catch(_0x37a604){return BPromise[_0xf8a3('0x21')](_0x37a604);}return _0x3c0e5f[_0xf8a3('0x22')]();};}function saveUpdates(_0xa8dee4,_0xb21465){return function(_0x269230){if(_0x269230){return _0x269230[_0xf8a3('0x23')](_0xa8dee4)[_0xf8a3('0x24')](function(_0x4ea29d){return _0x4ea29d;});}return null;};}function removeEntity(_0x2d5109,_0x3df1e3){return function(_0x38ef39){if(_0x38ef39){return _0x38ef39[_0xf8a3('0x25')]()['then'](function(){_0x2d5109['status'](0xcc)[_0xf8a3('0x18')]();});}};}function handleEntityNotFound(_0x42746e,_0x3d03d8){return function(_0x146a96){if(!_0x146a96){_0x42746e[_0xf8a3('0x16')](0x194);}return _0x146a96;};}function handleError(_0x401169,_0x620801){_0x620801=_0x620801||0x1f4;return function(_0x415bc8){logger['error'](_0x415bc8['stack']);if(_0x415bc8['name']){delete _0x415bc8[_0xf8a3('0x26')];}_0x401169[_0xf8a3('0x17')](_0x620801)[_0xf8a3('0x27')](_0x415bc8);};}exports[_0xf8a3('0x28')]=function(_0x4672b5,_0x934192){var _0x32f247={},_0x3dd9b2={},_0x40eb07={'count':0x0,'rows':[]};var _0x1b181f=_[_0xf8a3('0x29')](db[_0xf8a3('0x2a')]['rawAttributes'],function(_0x10c017){return{'name':_0x10c017['fieldName'],'type':_0x10c017[_0xf8a3('0x2b')][_0xf8a3('0x2c')]};});_0x3dd9b2[_0xf8a3('0x2d')]=_[_0xf8a3('0x2e')](_[_0xf8a3('0x29')](_0x1b181f,_0xf8a3('0x26')),[_0xf8a3('0x26')]);_0x3dd9b2['query']=_[_0xf8a3('0x2f')](_0x4672b5[_0xf8a3('0x30')]);_0x3dd9b2[_0xf8a3('0x31')]=_[_0xf8a3('0x32')](_0x3dd9b2[_0xf8a3('0x2d')],_0x3dd9b2['query']);_0x32f247['attributes']=_[_0xf8a3('0x32')](_0x3dd9b2['model'],qs[_0xf8a3('0x33')](_0x4672b5[_0xf8a3('0x30')]['fields']));_0x32f247['attributes']=_0x32f247[_0xf8a3('0x34')][_0xf8a3('0x35')]?_0x32f247[_0xf8a3('0x34')]:_0x3dd9b2[_0xf8a3('0x2d')];if(!_0x4672b5[_0xf8a3('0x30')]['hasOwnProperty']('nolimit')){_0x32f247[_0xf8a3('0x1b')]=qs[_0xf8a3('0x1b')](_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x1b')]);_0x32f247[_0xf8a3('0x1d')]=qs['offset'](_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x1d')]);}_0x32f247[_0xf8a3('0x36')]=qs[_0xf8a3('0x37')](_0x4672b5['query']['sort']);_0x32f247[_0xf8a3('0x38')]=qs['filters'](_[_0xf8a3('0x39')](_0x4672b5['query'],_0x3dd9b2[_0xf8a3('0x31')]),_0x1b181f);if(_0x4672b5[_0xf8a3('0x30')]['filter']){_0x32f247[_0xf8a3('0x38')]=_[_0xf8a3('0x3a')](_0x32f247[_0xf8a3('0x38')],{'$or':_[_0xf8a3('0x29')](_0x1b181f,function(_0x4820ba){if(_0x4820ba[_0xf8a3('0x2b')]!=='VIRTUAL'){var _0x46a7ed={};_0x46a7ed[_0x4820ba[_0xf8a3('0x26')]]={'$like':'%'+_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x3b')]+'%'};return _0x46a7ed;}})});}_0x32f247=_['merge']({},_0x32f247,_0x4672b5[_0xf8a3('0x3c')]);var _0x1e6bfd={'where':_0x32f247[_0xf8a3('0x38')]};return db[_0xf8a3('0x2a')][_0xf8a3('0x1c')](_0x1e6bfd)['then'](function(_0x3affde){_0x40eb07[_0xf8a3('0x1c')]=_0x3affde;if(_0x4672b5[_0xf8a3('0x30')][_0xf8a3('0x3d')]){_0x32f247[_0xf8a3('0x3e')]=[{'all':!![]}];}return db[_0xf8a3('0x2a')][_0xf8a3('0x3f')](_0x32f247);})[_0xf8a3('0x24')](function(_0x416d9b){_0x40eb07[_0xf8a3('0x40')]=_0x416d9b;return _0x40eb07;})[_0xf8a3('0x24')](respondWithFilteredResult(_0x934192,_0x32f247))[_0xf8a3('0x41')](handleError(_0x934192,null));};exports[_0xf8a3('0x42')]=function(_0x6fff99,_0x4b54c5){var _0x31646d={'raw':!![],'where':{'id':_0x6fff99[_0xf8a3('0x43')]['id']}},_0x5934ca={};_0x5934ca[_0xf8a3('0x2d')]=_[_0xf8a3('0x2f')](db[_0xf8a3('0x2a')][_0xf8a3('0x44')]);_0x5934ca[_0xf8a3('0x30')]=_['keys'](_0x6fff99['query']);_0x5934ca[_0xf8a3('0x31')]=_[_0xf8a3('0x32')](_0x5934ca[_0xf8a3('0x2d')],_0x5934ca[_0xf8a3('0x30')]);_0x31646d[_0xf8a3('0x34')]=_[_0xf8a3('0x32')](_0x5934ca['model'],qs[_0xf8a3('0x33')](_0x6fff99[_0xf8a3('0x30')][_0xf8a3('0x33')]));_0x31646d[_0xf8a3('0x34')]=_0x31646d[_0xf8a3('0x34')][_0xf8a3('0x35')]?_0x31646d[_0xf8a3('0x34')]:_0x5934ca[_0xf8a3('0x2d')];if(_0x6fff99[_0xf8a3('0x30')][_0xf8a3('0x3d')]){_0x31646d[_0xf8a3('0x3e')]=[{'all':!![]}];}_0x31646d=_[_0xf8a3('0x3a')]({},_0x31646d,_0x6fff99[_0xf8a3('0x3c')]);return db['VoiceMailMessage'][_0xf8a3('0x45')](_0x31646d)[_0xf8a3('0x24')](handleEntityNotFound(_0x4b54c5,null))[_0xf8a3('0x24')](respondWithResult(_0x4b54c5,null))[_0xf8a3('0x41')](handleError(_0x4b54c5,null));};exports['create']=function(_0x58df3c,_0x43a4bc){return db[_0xf8a3('0x2a')][_0xf8a3('0x46')](_0x58df3c[_0xf8a3('0x47')],{})[_0xf8a3('0x24')](respondWithResult(_0x43a4bc,0xc9))[_0xf8a3('0x41')](handleError(_0x43a4bc,null));};exports['update']=function(_0x1adc52,_0x1253b5){if(_0x1adc52[_0xf8a3('0x47')]['id']){delete _0x1adc52[_0xf8a3('0x47')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x1adc52[_0xf8a3('0x43')]['id']}})['then'](handleEntityNotFound(_0x1253b5,null))[_0xf8a3('0x24')](saveUpdates(_0x1adc52[_0xf8a3('0x47')],null))[_0xf8a3('0x24')](respondWithResult(_0x1253b5,null))[_0xf8a3('0x41')](handleError(_0x1253b5,null));};exports[_0xf8a3('0x25')]=function(_0x1cf038,_0x84e279){return db[_0xf8a3('0x2a')][_0xf8a3('0x45')]({'where':{'id':_0x1cf038['params']['id']}})[_0xf8a3('0x24')](handleEntityNotFound(_0x84e279,null))[_0xf8a3('0x24')](removeEntity(_0x84e279,null))[_0xf8a3('0x41')](handleError(_0x84e279,null));};exports[_0xf8a3('0x48')]=function(_0xe9d239,_0x35ab85,_0x2e7d12){return db[_0xf8a3('0x2a')][_0xf8a3('0x45')]({'where':{'id':_0xe9d239[_0xf8a3('0x43')]['id']},'attributes':['id',_0xf8a3('0x49'),_0xf8a3('0x4a')]})[_0xf8a3('0x24')](handleEntityNotFound(_0x35ab85,null))['then'](function(_0xb47b6){if(_0xb47b6){if(!_0xb47b6[_0xf8a3('0x49')]){throw new db[(_0xf8a3('0x4b'))][(_0xf8a3('0x4c'))](_0xf8a3('0x4d'));}var _0x4ce969={'Content-Type':_0xf8a3('0x4e'),'Content-Disposition':_0xf8a3('0x4f')};if(_0xb47b6[_0xf8a3('0x4a')]){_0x4ce969[_0xf8a3('0x50')]=_0xf8a3('0x51')+_0xb47b6['msg_id']+_0xf8a3('0x52');}_0x35ab85[_0xf8a3('0x1e')](_0x4ce969);return _0x35ab85[_0xf8a3('0x27')](new Buffer(_0xb47b6[_0xf8a3('0x49')]));}})[_0xf8a3('0x41')](handleError(_0x35ab85,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2ba8f83..22a4795 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 _0xf4e5=['./voiceMailMessage.attributes','exports','define','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x44f6bb,_0x2f6963){var _0x4ae544=function(_0x4dc4ef){while(--_0x4dc4ef){_0x44f6bb['push'](_0x44f6bb['shift']());}};_0x4ae544(++_0x2f6963);}(_0xf4e5,0xe8));var _0x5f4e=function(_0x4fb1bd,_0x8ff470){_0x4fb1bd=_0x4fb1bd-0x0;var _0xfe682=_0xf4e5[_0x4fb1bd];return _0xfe682;};'use strict';var _=require('lodash');var util=require(_0x5f4e('0x0'));var logger=require(_0x5f4e('0x1'))(_0x5f4e('0x2'));var moment=require(_0x5f4e('0x3'));var BPromise=require(_0x5f4e('0x4'));var rp=require(_0x5f4e('0x5'));var fs=require('fs');var path=require(_0x5f4e('0x6'));var rimraf=require('rimraf');var config=require(_0x5f4e('0x7'));var attributes=require(_0x5f4e('0x8'));module[_0x5f4e('0x9')]=function(_0xdeb419,_0xa99f41){return _0xdeb419[_0x5f4e('0xa')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x5f4e('0xb'),'fields':[_0x5f4e('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3cb7=['voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceMailMessage'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x3cb7,0x1f0));var _0x73cb=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x3cb7[_0x2d982d];return _0x4f36b0;};'use strict';var _=require('lodash');var util=require(_0x73cb('0x0'));var logger=require(_0x73cb('0x1'))(_0x73cb('0x2'));var moment=require(_0x73cb('0x3'));var BPromise=require(_0x73cb('0x4'));var rp=require(_0x73cb('0x5'));var fs=require('fs');var path=require(_0x73cb('0x6'));var rimraf=require(_0x73cb('0x7'));var config=require(_0x73cb('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x73cb('0x9')]=function(_0x36a4f2,_0x17e1a2){return _0x36a4f2['define'](_0x73cb('0xa'),attributes,{'tableName':_0x73cb('0xb'),'paranoid':![],'indexes':[{'name':_0x73cb('0xc'),'fields':[_0x73cb('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 27e6833..8266a2f 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 _0xa8c5=['../../config/environment','jayson/promise','client','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x5c1d05,_0x380427){var _0x5b8e91=function(_0x212751){while(--_0x212751){_0x5c1d05['push'](_0x5c1d05['shift']());}};_0x5b8e91(++_0x380427);}(_0xa8c5,0xd5));var _0x5a8c=function(_0x86e23c,_0x5c6ba0){_0x86e23c=_0x86e23c-0x0;var _0x26a8a6=_0xa8c5[_0x86e23c];return _0x26a8a6;};'use strict';var _=require('lodash');var util=require(_0x5a8c('0x0'));var moment=require(_0x5a8c('0x1'));var BPromise=require(_0x5a8c('0x2'));var rs=require(_0x5a8c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a8c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a8c('0x5'))(_0x5a8c('0x6'));var config=require(_0x5a8c('0x7'));var jayson=require(_0x5a8c('0x8'));var client=jayson[_0x5a8c('0x9')][_0x5a8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f003d,_0xde6377,_0x2a7cba){return new BPromise(function(_0x57061c,_0x4ea3a1){return client['request'](_0x3f003d,_0x2a7cba)['then'](function(_0x53e75c){logger[_0x5a8c('0xb')](_0x5a8c('0xc'),_0xde6377,_0x5a8c('0xd'));logger[_0x5a8c('0xe')](_0x5a8c('0xf'),_0xde6377,'request\x20sent',JSON['stringify'](_0x53e75c));if(_0x53e75c[_0x5a8c('0x10')]){if(_0x53e75c[_0x5a8c('0x10')][_0x5a8c('0x11')]===0x1f4){logger[_0x5a8c('0x10')](_0x5a8c('0xc'),_0xde6377,_0x53e75c[_0x5a8c('0x10')][_0x5a8c('0x12')]);return _0x4ea3a1(_0x53e75c[_0x5a8c('0x10')][_0x5a8c('0x12')]);}logger[_0x5a8c('0x10')](_0x5a8c('0xc'),_0xde6377,_0x53e75c[_0x5a8c('0x10')][_0x5a8c('0x12')]);return _0x57061c(_0x53e75c[_0x5a8c('0x10')][_0x5a8c('0x12')]);}else{logger[_0x5a8c('0xb')](_0x5a8c('0xc'),_0xde6377,_0x5a8c('0xd'));_0x57061c(_0x53e75c[_0x5a8c('0x13')][_0x5a8c('0x12')]);}})['catch'](function(_0x216585){logger[_0x5a8c('0x10')](_0x5a8c('0xc'),_0xde6377,_0x216585);_0x4ea3a1(_0x216585);});});} \ No newline at end of file +var _0x4e65=['../../config/environment','jayson/promise','client','http','request','then','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceMailMessage,\x20%s,\x20%s','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5a5c6b,_0x5baa12){var _0x5e24fc=function(_0x436b7a){while(--_0x436b7a){_0x5a5c6b['push'](_0x5a5c6b['shift']());}};_0x5e24fc(++_0x5baa12);}(_0x4e65,0x64));var _0x54e6=function(_0x3c05f3,_0x3f3ddf){_0x3c05f3=_0x3c05f3-0x0;var _0x13cacb=_0x4e65[_0x3c05f3];return _0x13cacb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x54e6('0x0'));var BPromise=require(_0x54e6('0x1'));var rs=require(_0x54e6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54e6('0x3'))['db'];var utils=require(_0x54e6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x54e6('0x5'));var jayson=require(_0x54e6('0x6'));var client=jayson[_0x54e6('0x7')][_0x54e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8ac4f5,_0x1735ff,_0x40007c){return new BPromise(function(_0x41180c,_0x47f6dc){return client[_0x54e6('0x9')](_0x8ac4f5,_0x40007c)[_0x54e6('0xa')](function(_0x34cf64){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x1735ff,'request\x20sent');logger[_0x54e6('0xb')](_0x54e6('0xc'),_0x1735ff,_0x54e6('0xd'),JSON[_0x54e6('0xe')](_0x34cf64));if(_0x34cf64[_0x54e6('0xf')]){if(_0x34cf64[_0x54e6('0xf')]['code']===0x1f4){logger[_0x54e6('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1735ff,_0x34cf64[_0x54e6('0xf')][_0x54e6('0x10')]);return _0x47f6dc(_0x34cf64[_0x54e6('0xf')][_0x54e6('0x10')]);}logger['error'](_0x54e6('0x11'),_0x1735ff,_0x34cf64['error']['message']);return _0x41180c(_0x34cf64[_0x54e6('0xf')][_0x54e6('0x10')]);}else{logger[_0x54e6('0x12')](_0x54e6('0x11'),_0x1735ff,_0x54e6('0xd'));_0x41180c(_0x34cf64[_0x54e6('0x13')][_0x54e6('0x10')]);}})[_0x54e6('0x14')](function(_0x3e107e){logger['error'](_0x54e6('0x11'),_0x1735ff,_0x3e107e);_0x47f6dc(_0x3e107e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 34d78e1..6fe1617 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 _0x09ab=['get','/:id','isAuthenticated','show','/:id/sounds','create','post','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./voiceMusicOnHold.controller','index'];(function(_0xadcfe2,_0x208339){var _0x29089e=function(_0x205824){while(--_0x205824){_0xadcfe2['push'](_0xadcfe2['shift']());}};_0x29089e(++_0x208339);}(_0x09ab,0x1b0));var _0xb09a=function(_0xfb7ecb,_0x2837dc){_0xfb7ecb=_0xfb7ecb-0x0;var _0x4deac2=_0x09ab[_0xfb7ecb];return _0x4deac2;};'use strict';var multer=require(_0xb09a('0x0'));var util=require(_0xb09a('0x1'));var path=require(_0xb09a('0x2'));var timeout=require(_0xb09a('0x3'));var express=require('express');var router=express[_0xb09a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb09a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb09a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb09a('0x7')]);router[_0xb09a('0x8')](_0xb09a('0x9'),auth[_0xb09a('0xa')](),controller[_0xb09a('0xb')]);router['get'](_0xb09a('0xc'),auth[_0xb09a('0xa')](),controller['getSounds']);router['post']('/',auth['isAuthenticated'](),controller[_0xb09a('0xd')]);router[_0xb09a('0xe')](_0xb09a('0xc'),auth['isAuthenticated'](),controller['addSound']);router['put'](_0xb09a('0x9'),auth['isAuthenticated'](),controller[_0xb09a('0xf')]);router[_0xb09a('0x10')](_0xb09a('0x9'),auth['isAuthenticated'](),controller[_0xb09a('0x11')]);router[_0xb09a('0x10')]('/:id/sounds/:id2',auth[_0xb09a('0xa')](),controller[_0xb09a('0x12')]);module[_0xb09a('0x13')]=router; \ No newline at end of file +var _0x17c5=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/sounds','getSounds','post','create','addSound','put','update'];(function(_0x2484be,_0x12368d){var _0x2953f1=function(_0x550863){while(--_0x550863){_0x2484be['push'](_0x2484be['shift']());}};_0x2953f1(++_0x12368d);}(_0x17c5,0xc3));var _0x517c=function(_0x5a0d6c,_0x180ba4){_0x5a0d6c=_0x5a0d6c-0x0;var _0x1b9fc1=_0x17c5[_0x5a0d6c];return _0x1b9fc1;};'use strict';var multer=require(_0x517c('0x0'));var util=require(_0x517c('0x1'));var path=require(_0x517c('0x2'));var timeout=require(_0x517c('0x3'));var express=require('express');var router=express[_0x517c('0x4')]();var fs_extra=require(_0x517c('0x5'));var auth=require(_0x517c('0x6'));var interaction=require(_0x517c('0x7'));var config=require(_0x517c('0x8'));var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0x517c('0x9')](),controller[_0x517c('0xa')]);router['get'](_0x517c('0xb'),auth[_0x517c('0x9')](),controller[_0x517c('0xc')]);router[_0x517c('0xd')](_0x517c('0xe'),auth['isAuthenticated'](),controller[_0x517c('0xf')]);router[_0x517c('0x10')]('/',auth['isAuthenticated'](),controller[_0x517c('0x11')]);router[_0x517c('0x10')]('/:id/sounds',auth[_0x517c('0x9')](),controller[_0x517c('0x12')]);router[_0x517c('0x13')]('/:id',auth[_0x517c('0x9')](),controller[_0x517c('0x14')]);router[_0x517c('0x15')](_0x517c('0xb'),auth[_0x517c('0x9')](),controller[_0x517c('0x16')]);router[_0x517c('0x15')]('/:id/sounds/:id2',auth[_0x517c('0x9')](),controller['removeSound']);module[_0x517c('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 9887c01..99b5b86 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 _0x7b4a=['sequelize','exports','name','ENUM','mp3nb','quietmp3','files','STRING','alpha','BOOLEAN'];(function(_0x13863a,_0x305458){var _0x15981e=function(_0x379d04){while(--_0x379d04){_0x13863a['push'](_0x13863a['shift']());}};_0x15981e(++_0x305458);}(_0x7b4a,0x1ea));var _0xa7b4=function(_0x2486be,_0x5d7dd2){_0x2486be=_0x2486be-0x0;var _0x24042b=_0x7b4a[_0x2486be];return _0x24042b;};'use strict';var Sequelize=require(_0xa7b4('0x0'));module[_0xa7b4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa7b4('0x2')},'mode':{'type':Sequelize[_0xa7b4('0x3')]('custom','files',_0xa7b4('0x4'),'quietmp3nb',_0xa7b4('0x5'),'mp3'),'allowNull':!![],'defaultValue':_0xa7b4('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa7b4('0x7')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xa7b4('0x7')],'allowNull':!![],'defaultValue':_0xa7b4('0x8')},'format':{'type':Sequelize[_0xa7b4('0x7')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xa7b4('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd981=['ENUM','custom','mp3nb','quietmp3nb','mp3','files','TIMESTAMP','STRING','name'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd981,0x85));var _0x1d98=function(_0x80a2cd,_0x88c072){_0x80a2cd=_0x80a2cd-0x0;var _0x24915d=_0xd981[_0x80a2cd];return _0x24915d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1d98('0x0')],'allowNull':![],'unique':_0x1d98('0x1')},'mode':{'type':Sequelize[_0x1d98('0x2')](_0x1d98('0x3'),'files',_0x1d98('0x4'),_0x1d98('0x5'),'quietmp3',_0x1d98('0x6')),'allowNull':!![],'defaultValue':_0x1d98('0x7')},'directory':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x1d98('0x0')],'allowNull':!![]},'stamp':{'type':_0x1d98('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 77aaea2..0c146cb 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 _0xd9b1=['server/files/moh','mkdirSync','directory','0777','user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','unlinkSync','ValidationError','message','addSound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','extname','root','removeSound','Sound','id2','Sequelize','getSounds','keys','length','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','index','map','type','key','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','VoiceMusicOnHold','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','find','body','create','sequelize','mode','files','join'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd9b1,0x165));var _0x1d9b=function(_0x56aaf5,_0x4fd575){_0x56aaf5=_0x56aaf5-0x0;var _0x411fd4=_0xd9b1[_0x56aaf5];return _0x411fd4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d9b('0x0'));var jsonpatch=require(_0x1d9b('0x1'));var rp=require('request-promise');var moment=require(_0x1d9b('0x2'));var BPromise=require(_0x1d9b('0x3'));var Mustache=require(_0x1d9b('0x4'));var util=require(_0x1d9b('0x5'));var path=require(_0x1d9b('0x6'));var sox=require(_0x1d9b('0x7'));var csv=require(_0x1d9b('0x8'));var ejs=require(_0x1d9b('0x9'));var fs=require('fs');var fs_extra=require(_0x1d9b('0xa'));var _=require(_0x1d9b('0xb'));var squel=require('squel');var crypto=require(_0x1d9b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d9b('0xd'));var toCsv=require(_0x1d9b('0x8'));var querystring=require(_0x1d9b('0xe'));var Papa=require(_0x1d9b('0xf'));var Redis=require(_0x1d9b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d9b('0x11'));var logger=require(_0x1d9b('0x12'))(_0x1d9b('0x13'));var utils=require(_0x1d9b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1d9b('0x15'));var db=require(_0x1d9b('0x16'))['db'];function respondWithStatusCode(_0xf3c9b4,_0x3193f0){_0x3193f0=_0x3193f0||0xcc;return function(_0x568e3d){if(_0x568e3d){return _0xf3c9b4[_0x1d9b('0x17')](_0x3193f0);}return _0xf3c9b4['status'](_0x3193f0)[_0x1d9b('0x18')]();};}function respondWithResult(_0x13d481,_0x118aca){_0x118aca=_0x118aca||0xc8;return function(_0x53883f){if(_0x53883f){return _0x13d481[_0x1d9b('0x19')](_0x118aca)[_0x1d9b('0x1a')](_0x53883f);}};}function respondWithFilteredResult(_0x152112,_0x5dbc18){return function(_0x5226ad){if(_0x5226ad){var _0x16a957=typeof _0x5dbc18['offset']===_0x1d9b('0x1b')&&typeof _0x5dbc18['limit']===_0x1d9b('0x1b');var _0xf4fa61=_0x5226ad[_0x1d9b('0x1c')];var _0x22aea2=_0x16a957?0x0:_0x5dbc18[_0x1d9b('0x1d')];var _0x1bd0c2=_0x16a957?_0x5226ad[_0x1d9b('0x1c')]:_0x5dbc18[_0x1d9b('0x1d')]+_0x5dbc18[_0x1d9b('0x1e')];var _0x3c1da9;if(_0x1bd0c2>=_0xf4fa61){_0x1bd0c2=_0xf4fa61;_0x3c1da9=0xc8;}else{_0x3c1da9=0xce;}_0x152112['status'](_0x3c1da9);return _0x152112[_0x1d9b('0x1f')](_0x1d9b('0x20'),_0x22aea2+'-'+_0x1bd0c2+'/'+_0xf4fa61)['json'](_0x5226ad);}return null;};}function patchUpdates(_0x15804e){return function(_0x246879){try{jsonpatch[_0x1d9b('0x21')](_0x246879,_0x15804e,!![]);}catch(_0x181261){return BPromise['reject'](_0x181261);}return _0x246879['save']();};}function saveUpdates(_0xd9e2f6,_0x8a7812){return function(_0x5c1e2b){if(_0x5c1e2b){return _0x5c1e2b[_0x1d9b('0x22')](_0xd9e2f6)[_0x1d9b('0x23')](function(_0x427b1b){return _0x427b1b;});}return null;};}function removeEntity(_0x25840a,_0x5ecadb){return function(_0x32d1da){if(_0x32d1da){return _0x32d1da[_0x1d9b('0x24')]()['then'](function(){var _0x2fcc11=_0x32d1da[_0x1d9b('0x25')]({'plain':!![]});var _0x275699=_0x1d9b('0x26');return db[_0x1d9b('0x27')]['destroy']({'where':{'type':_0x275699,'resourceId':_0x2fcc11['id']}})[_0x1d9b('0x23')](function(){return _0x32d1da;});})[_0x1d9b('0x23')](function(){_0x25840a[_0x1d9b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2618ad,_0x2421e0){return function(_0x1babf6){if(!_0x1babf6){_0x2618ad['sendStatus'](0x194);}return _0x1babf6;};}function handleError(_0x108eaa,_0x2b7778){_0x2b7778=_0x2b7778||0x1f4;return function(_0x19d041){logger['error'](_0x19d041[_0x1d9b('0x28')]);if(_0x19d041[_0x1d9b('0x29')]){delete _0x19d041['name'];}_0x108eaa[_0x1d9b('0x19')](_0x2b7778)[_0x1d9b('0x2a')](_0x19d041);};}exports[_0x1d9b('0x2b')]=function(_0x180a81,_0x2ba806){var _0x46c7be={},_0x3c93d4={},_0x11752b={'count':0x0,'rows':[]};var _0x2531e8=_[_0x1d9b('0x2c')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x14cdb0){return{'name':_0x14cdb0['fieldName'],'type':_0x14cdb0[_0x1d9b('0x2d')][_0x1d9b('0x2e')]};});_0x3c93d4['model']=_['map'](_0x2531e8,_0x1d9b('0x29'));_0x3c93d4['query']=_['keys'](_0x180a81['query']);_0x3c93d4['filters']=_[_0x1d9b('0x2f')](_0x3c93d4[_0x1d9b('0x30')],_0x3c93d4[_0x1d9b('0x31')]);_0x46c7be[_0x1d9b('0x32')]=_['intersection'](_0x3c93d4['model'],qs[_0x1d9b('0x33')](_0x180a81[_0x1d9b('0x31')][_0x1d9b('0x33')]));_0x46c7be['attributes']=_0x46c7be[_0x1d9b('0x32')]['length']?_0x46c7be['attributes']:_0x3c93d4[_0x1d9b('0x30')];if(!_0x180a81[_0x1d9b('0x31')][_0x1d9b('0x34')](_0x1d9b('0x35'))){_0x46c7be[_0x1d9b('0x1e')]=qs[_0x1d9b('0x1e')](_0x180a81[_0x1d9b('0x31')][_0x1d9b('0x1e')]);_0x46c7be[_0x1d9b('0x1d')]=qs[_0x1d9b('0x1d')](_0x180a81[_0x1d9b('0x31')][_0x1d9b('0x1d')]);}_0x46c7be[_0x1d9b('0x36')]=qs[_0x1d9b('0x37')](_0x180a81[_0x1d9b('0x31')][_0x1d9b('0x37')]);delete _0x180a81[_0x1d9b('0x31')][_0x1d9b('0x37')];_0x46c7be[_0x1d9b('0x38')]=qs[_0x1d9b('0x39')](_[_0x1d9b('0x3a')](_0x180a81['query'],_0x3c93d4[_0x1d9b('0x39')]),_0x2531e8);if(_0x180a81[_0x1d9b('0x31')]['filter']){_0x46c7be[_0x1d9b('0x38')]=_['merge'](_0x46c7be[_0x1d9b('0x38')],{'$or':_[_0x1d9b('0x2c')](_0x2531e8,function(_0xd6e6aa){if(_0xd6e6aa[_0x1d9b('0x2d')]!==_0x1d9b('0x3b')){var _0x51a723={};_0x51a723[_0xd6e6aa[_0x1d9b('0x29')]]={'$like':'%'+_0x180a81['query'][_0x1d9b('0x3c')]+'%'};return _0x51a723;}})});}_0x46c7be=_['merge']({},_0x46c7be,_0x180a81[_0x1d9b('0x3d')]);var _0x5693ea={'where':_0x46c7be[_0x1d9b('0x38')]};return db[_0x1d9b('0x3e')][_0x1d9b('0x1c')](_0x5693ea)[_0x1d9b('0x23')](function(_0xb3b35b){_0x11752b[_0x1d9b('0x1c')]=_0xb3b35b;if(_0x180a81[_0x1d9b('0x31')]['includeAll']){_0x46c7be[_0x1d9b('0x3f')]=[{'all':!![]}];}return db[_0x1d9b('0x3e')][_0x1d9b('0x40')](_0x46c7be);})[_0x1d9b('0x23')](function(_0x254a8c){_0x11752b[_0x1d9b('0x41')]=_0x254a8c;return _0x11752b;})[_0x1d9b('0x23')](respondWithFilteredResult(_0x2ba806,_0x46c7be))[_0x1d9b('0x42')](handleError(_0x2ba806,null));};exports[_0x1d9b('0x43')]=function(_0x4bade1,_0x4f1353){var _0x3d052f={'raw':![],'where':{'id':_0x4bade1[_0x1d9b('0x44')]['id']}},_0x3925f5={};_0x3925f5[_0x1d9b('0x30')]=_['keys'](db['VoiceMusicOnHold'][_0x1d9b('0x45')]);_0x3925f5[_0x1d9b('0x31')]=_['keys'](_0x4bade1['query']);_0x3925f5[_0x1d9b('0x39')]=_[_0x1d9b('0x2f')](_0x3925f5[_0x1d9b('0x30')],_0x3925f5[_0x1d9b('0x31')]);_0x3d052f[_0x1d9b('0x32')]=_[_0x1d9b('0x2f')](_0x3925f5[_0x1d9b('0x30')],qs['fields'](_0x4bade1['query'][_0x1d9b('0x33')]));_0x3d052f[_0x1d9b('0x32')]=_0x3d052f[_0x1d9b('0x32')]['length']?_0x3d052f[_0x1d9b('0x32')]:_0x3925f5[_0x1d9b('0x30')];if(_0x4bade1[_0x1d9b('0x31')][_0x1d9b('0x46')]){_0x3d052f[_0x1d9b('0x3f')]=[{'all':!![]}];}_0x3d052f=_[_0x1d9b('0x47')]({},_0x3d052f,_0x4bade1[_0x1d9b('0x3d')]);return db[_0x1d9b('0x3e')][_0x1d9b('0x48')](_0x3d052f)[_0x1d9b('0x23')](handleEntityNotFound(_0x4f1353,null))[_0x1d9b('0x23')](respondWithResult(_0x4f1353,null))[_0x1d9b('0x42')](handleError(_0x4f1353,null));};exports[_0x1d9b('0x22')]=function(_0x4aac1,_0x1bfb06){if(_0x4aac1[_0x1d9b('0x49')]['id']){delete _0x4aac1[_0x1d9b('0x49')]['id'];}return db[_0x1d9b('0x3e')][_0x1d9b('0x48')]({'where':{'id':_0x4aac1['params']['id']}})[_0x1d9b('0x23')](handleEntityNotFound(_0x1bfb06,null))['then'](saveUpdates(_0x4aac1[_0x1d9b('0x49')],null))['then'](respondWithResult(_0x1bfb06,null))[_0x1d9b('0x42')](handleError(_0x1bfb06,null));};exports[_0x1d9b('0x4a')]=function(_0x5aec6c,_0x2e0aad,_0x3e9d3f){return db[_0x1d9b('0x4b')]['transaction'](function(_0x3510a8){if(_0x5aec6c[_0x1d9b('0x49')][_0x1d9b('0x4c')]===_0x1d9b('0x4d')){_0x5aec6c[_0x1d9b('0x49')]['directory']=path[_0x1d9b('0x4e')](config['root'],_0x1d9b('0x4f'),_0x5aec6c[_0x1d9b('0x49')][_0x1d9b('0x29')]);}return db[_0x1d9b('0x3e')]['create'](_0x5aec6c['body'],{'transaction':_0x3510a8})['then'](function(_0x112989){if(_0x5aec6c['body'][_0x1d9b('0x4c')]===_0x1d9b('0x4d')){fs[_0x1d9b('0x50')](_0x112989[_0x1d9b('0x51')],parseInt(_0x1d9b('0x52'),0x8));}var _0x2665d6=_0x5aec6c[_0x1d9b('0x53')][_0x1d9b('0x25')]({'plain':!![]});if(!_0x2665d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2665d6['role']===_0x1d9b('0x53')){var _0x42414c=_0x112989['get']({'plain':!![]});return db[_0x1d9b('0x54')]['find']({'where':{'name':_0x1d9b('0x26'),'userProfileId':_0x2665d6['userProfileId']},'raw':!![]})['then'](function(_0x120897){if(_0x120897&&_0x120897['autoAssociation']===0x0){return db[_0x1d9b('0x27')][_0x1d9b('0x4a')]({'name':_0x42414c['name'],'resourceId':_0x42414c['id'],'type':_0x120897[_0x1d9b('0x29')],'sectionId':_0x120897['id']},{})[_0x1d9b('0x23')](function(){return _0x112989;});}else{return _0x112989;}})[_0x1d9b('0x42')](function(_0x4bbc6c){logger[_0x1d9b('0x55')](_0x1d9b('0x56'),_0x4bbc6c);});}return _0x112989;});})[_0x1d9b('0x23')](respondWithResult(_0x2e0aad,0xc9))[_0x1d9b('0x42')](handleError(_0x2e0aad,null));};exports[_0x1d9b('0x24')]=function(_0x4742c2,_0x2a348c,_0x4ec96e){var _0x1cee31;return db[_0x1d9b('0x3e')][_0x1d9b('0x48')]({'where':{'id':_0x4742c2[_0x1d9b('0x44')]['id']}})[_0x1d9b('0x23')](function(_0x5ebea9){if(_0x5ebea9){return db[_0x1d9b('0x4b')][_0x1d9b('0x57')](function(_0x4cb40c){return _0x5ebea9[_0x1d9b('0x24')]({'transaction':_0x4cb40c,'raw':!![]})[_0x1d9b('0x23')](function(_0x2c2b5d){if(_0x2c2b5d[_0x1d9b('0x51')]){fs[_0x1d9b('0x58')](_0x2c2b5d[_0x1d9b('0x51')])['forEach'](function(_0x21411d){fs[_0x1d9b('0x59')](path['join'](_0x2c2b5d[_0x1d9b('0x51')],_0x21411d));});fs['rmdirSync'](_0x2c2b5d['directory']);}return _0x2c2b5d;});})[_0x1d9b('0x42')](function(_0x1efc63){throw new db['Sequelize'][(_0x1d9b('0x5a'))](_0x1efc63[_0x1d9b('0x5b')]);});}})[_0x1d9b('0x23')](handleEntityNotFound(_0x2a348c,null))['then'](removeEntity(_0x2a348c,null))[_0x1d9b('0x42')](handleError(_0x2a348c,null));};exports[_0x1d9b('0x5c')]=function(_0x510769,_0x15d2a4,_0x4c4143){return db[_0x1d9b('0x4b')][_0x1d9b('0x57')](function(_0x30ccdf){var _0x1758cf;return db[_0x1d9b('0x3e')][_0x1d9b('0x48')]({'where':{'id':_0x510769['params']['id']}})[_0x1d9b('0x23')](function(_0x3bc769){if(_0x3bc769){_0x1758cf=_0x3bc769;return _0x3bc769[_0x1d9b('0x5c')](_0x510769['body']['id'],{'transaction':_0x30ccdf});}})['then'](function(_0xe1b9be){if(_0xe1b9be){return db['Sound'][_0x1d9b('0x5d')]({'where':{'id':_0x510769['body']['id']},'attributes':['id',_0x1d9b('0x29'),_0x1d9b('0x5e'),_0x1d9b('0x5f'),_0x1d9b('0x60')],'raw':!![]});}})['then'](function(_0x4f91a9){if(_0x4f91a9){var _0x3b6eee=path[_0x1d9b('0x4e')](config['root'],'server/files/sounds/converted',util[_0x1d9b('0x61')](_0x1d9b('0x62'),path[_0x1d9b('0x63')](_0x4f91a9[_0x1d9b('0x5e')],path[_0x1d9b('0x64')](_0x4f91a9[_0x1d9b('0x5e')])),_0x4f91a9[_0x1d9b('0x5f')]));var _0x3ee427=path['join'](config[_0x1d9b('0x65')],_0x1d9b('0x4f'),_0x1758cf[_0x1d9b('0x29')],util[_0x1d9b('0x61')]('%s.%s',_0x4f91a9[_0x1d9b('0x29')],_0x4f91a9[_0x1d9b('0x5f')]));fs['symlinkSync'](_0x3b6eee,_0x3ee427);return _0x4f91a9;}})[_0x1d9b('0x42')](function(_0x14bb3d){throw new db['Sequelize'][(_0x1d9b('0x5a'))](_0x14bb3d[_0x1d9b('0x5b')]);});})[_0x1d9b('0x23')](handleEntityNotFound(_0x15d2a4,null))[_0x1d9b('0x23')](respondWithResult(_0x15d2a4,0xc9))[_0x1d9b('0x42')](handleError(_0x15d2a4,null));};exports[_0x1d9b('0x66')]=function(_0x13abdc,_0x2648f9,_0x4956b3){return db[_0x1d9b('0x4b')][_0x1d9b('0x57')](function(_0x2b4280){var _0x1c4830;return db['VoiceMusicOnHold'][_0x1d9b('0x5d')]({'where':{'id':_0x13abdc[_0x1d9b('0x44')]['id']}})[_0x1d9b('0x23')](handleEntityNotFound(_0x2648f9,null))[_0x1d9b('0x23')](function(_0x4ac903){if(_0x4ac903){_0x1c4830=_0x4ac903;return _0x4ac903[_0x1d9b('0x66')](_0x13abdc[_0x1d9b('0x44')]['id2']);}})['then'](function(_0x1c4e67){if(_0x1c4e67){return db[_0x1d9b('0x67')][_0x1d9b('0x5d')]({'where':{'id':_0x13abdc[_0x1d9b('0x44')][_0x1d9b('0x68')]},'attributes':['id',_0x1d9b('0x29'),'save_name',_0x1d9b('0x5f'),_0x1d9b('0x60')],'raw':!![]});}})[_0x1d9b('0x23')](function(_0x4f0b0a){if(_0x4f0b0a){fs[_0x1d9b('0x59')](path[_0x1d9b('0x4e')](_0x1c4830['directory'],util[_0x1d9b('0x61')](_0x1d9b('0x62'),_0x4f0b0a[_0x1d9b('0x29')],_0x4f0b0a[_0x1d9b('0x5f')])));return _0x4f0b0a;}})[_0x1d9b('0x42')](function(_0x184559){throw new db[(_0x1d9b('0x69'))][(_0x1d9b('0x5a'))](_0x184559['message']);});})['then'](handleEntityNotFound(_0x2648f9,null))[_0x1d9b('0x23')](respondWithStatusCode(_0x2648f9,0xcc))['catch'](handleError(_0x2648f9,null));};exports[_0x1d9b('0x6a')]=function(_0x40f2f3,_0x46208b,_0x7569cc){var _0x19555c={};var _0x574a6a={};var _0x407642;var _0x2b2af5;return db['VoiceMusicOnHold'][_0x1d9b('0x5d')]({'where':{'id':_0x40f2f3['params']['id']}})[_0x1d9b('0x23')](handleEntityNotFound(_0x46208b,null))[_0x1d9b('0x23')](function(_0x3df880){if(_0x3df880){_0x407642=_0x3df880;_0x574a6a['model']=_['keys'](db[_0x1d9b('0x67')][_0x1d9b('0x45')]);_0x574a6a['query']=_[_0x1d9b('0x6b')](_0x40f2f3[_0x1d9b('0x31')]);_0x574a6a[_0x1d9b('0x39')]=_[_0x1d9b('0x2f')](_0x574a6a[_0x1d9b('0x30')],_0x574a6a[_0x1d9b('0x31')]);_0x19555c[_0x1d9b('0x32')]=_['intersection'](_0x574a6a['model'],qs[_0x1d9b('0x33')](_0x40f2f3[_0x1d9b('0x31')][_0x1d9b('0x33')]));_0x19555c[_0x1d9b('0x32')]=_0x19555c[_0x1d9b('0x32')][_0x1d9b('0x6c')]?_0x19555c[_0x1d9b('0x32')]:_0x574a6a[_0x1d9b('0x30')];_0x19555c[_0x1d9b('0x36')]=qs[_0x1d9b('0x37')](_0x40f2f3[_0x1d9b('0x31')][_0x1d9b('0x37')]);_0x19555c['where']=qs['filters'](_[_0x1d9b('0x3a')](_0x40f2f3[_0x1d9b('0x31')],_0x574a6a[_0x1d9b('0x39')]));if(_0x40f2f3['query'][_0x1d9b('0x3c')]){_0x19555c[_0x1d9b('0x38')]=_[_0x1d9b('0x47')](_0x19555c[_0x1d9b('0x38')],{'$or':_[_0x1d9b('0x2c')](_0x19555c[_0x1d9b('0x32')],function(_0x5100ad){var _0x47f24e={};_0x47f24e[_0x5100ad]={'$like':'%'+_0x40f2f3['query'][_0x1d9b('0x3c')]+'%'};return _0x47f24e;})});}_0x19555c=_[_0x1d9b('0x47')]({},_0x19555c,_0x40f2f3[_0x1d9b('0x3d')]);return _0x407642['getSounds'](_0x19555c);}})[_0x1d9b('0x23')](function(_0xfb291f){if(_0xfb291f){_0x2b2af5=_0xfb291f[_0x1d9b('0x6c')];if(!_0x40f2f3[_0x1d9b('0x31')]['hasOwnProperty']('nolimit')){_0x19555c['limit']=qs[_0x1d9b('0x1e')](_0x40f2f3[_0x1d9b('0x31')][_0x1d9b('0x1e')]);_0x19555c[_0x1d9b('0x1d')]=qs[_0x1d9b('0x1d')](_0x40f2f3[_0x1d9b('0x31')][_0x1d9b('0x1d')]);}return _0x407642[_0x1d9b('0x6a')](_0x19555c);}})[_0x1d9b('0x23')](function(_0x495848){if(_0x495848){return _0x495848?{'count':_0x2b2af5,'rows':_0x495848}:null;}})[_0x1d9b('0x23')](respondWithResult(_0x46208b,null))[_0x1d9b('0x42')](handleError(_0x46208b,null));}; \ No newline at end of file +var _0x0556=['extname','%s.%s','symlinkSync','Sequelize','removeSound','id2','unlinkSync','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','name','send','map','VoiceMusicOnHold','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','create','sequelize','mode','files','directory','server/files/moh','mkdirSync','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','join','root','format','basename'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0556,0x1d8));var _0x6055=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0x0556[_0xf61586];return _0x2b6eb3;};'use strict';var emlformat=require(_0x6055('0x0'));var rimraf=require(_0x6055('0x1'));var zipdir=require(_0x6055('0x2'));var jsonpatch=require(_0x6055('0x3'));var rp=require(_0x6055('0x4'));var moment=require(_0x6055('0x5'));var BPromise=require(_0x6055('0x6'));var Mustache=require(_0x6055('0x7'));var util=require(_0x6055('0x8'));var path=require(_0x6055('0x9'));var sox=require(_0x6055('0xa'));var csv=require(_0x6055('0xb'));var ejs=require(_0x6055('0xc'));var fs=require('fs');var fs_extra=require(_0x6055('0xd'));var _=require(_0x6055('0xe'));var squel=require('squel');var crypto=require(_0x6055('0xf'));var jsforce=require(_0x6055('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6055('0xb'));var querystring=require(_0x6055('0x11'));var Papa=require(_0x6055('0x12'));var Redis=require(_0x6055('0x13'));var authService=require(_0x6055('0x14'));var qs=require(_0x6055('0x15'));var as=require(_0x6055('0x16'));var hardwareService=require(_0x6055('0x17'));var logger=require(_0x6055('0x18'))(_0x6055('0x19'));var utils=require(_0x6055('0x1a'));var config=require(_0x6055('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x6055('0x1c'))['db'];function respondWithStatusCode(_0x2ea43d,_0x1c6683){_0x1c6683=_0x1c6683||0xcc;return function(_0x2f270e){if(_0x2f270e){return _0x2ea43d[_0x6055('0x1d')](_0x1c6683);}return _0x2ea43d[_0x6055('0x1e')](_0x1c6683)[_0x6055('0x1f')]();};}function respondWithResult(_0x1e262b,_0x5d2bac){_0x5d2bac=_0x5d2bac||0xc8;return function(_0x4a12f3){if(_0x4a12f3){return _0x1e262b['status'](_0x5d2bac)[_0x6055('0x20')](_0x4a12f3);}};}function respondWithFilteredResult(_0x11eb96,_0x35345d){return function(_0x42cf3f){if(_0x42cf3f){var _0x2ebd57=typeof _0x35345d['offset']===_0x6055('0x21')&&typeof _0x35345d['limit']==='undefined';var _0x33e521=_0x42cf3f[_0x6055('0x22')];var _0x1b47a0=_0x2ebd57?0x0:_0x35345d['offset'];var _0x5ef26b=_0x2ebd57?_0x42cf3f['count']:_0x35345d[_0x6055('0x23')]+_0x35345d[_0x6055('0x24')];var _0x467286;if(_0x5ef26b>=_0x33e521){_0x5ef26b=_0x33e521;_0x467286=0xc8;}else{_0x467286=0xce;}_0x11eb96['status'](_0x467286);return _0x11eb96[_0x6055('0x25')](_0x6055('0x26'),_0x1b47a0+'-'+_0x5ef26b+'/'+_0x33e521)['json'](_0x42cf3f);}return null;};}function patchUpdates(_0x11ceab){return function(_0x4ea721){try{jsonpatch[_0x6055('0x27')](_0x4ea721,_0x11ceab,!![]);}catch(_0x3be8d5){return BPromise[_0x6055('0x28')](_0x3be8d5);}return _0x4ea721['save']();};}function saveUpdates(_0x27c48a,_0x31898b){return function(_0xa25c29){if(_0xa25c29){return _0xa25c29[_0x6055('0x29')](_0x27c48a)[_0x6055('0x2a')](function(_0xd8b529){return _0xd8b529;});}return null;};}function removeEntity(_0xeef4c6,_0x1df9af){return function(_0x531643){if(_0x531643){return _0x531643[_0x6055('0x2b')]()[_0x6055('0x2a')](function(){var _0x374fb5=_0x531643['get']({'plain':!![]});var _0xf98736=_0x6055('0x2c');return db['UserProfileResource'][_0x6055('0x2b')]({'where':{'type':_0xf98736,'resourceId':_0x374fb5['id']}})['then'](function(){return _0x531643;});})[_0x6055('0x2a')](function(){_0xeef4c6[_0x6055('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21b452,_0x3635f3){return function(_0x5266bc){if(!_0x5266bc){_0x21b452[_0x6055('0x1d')](0x194);}return _0x5266bc;};}function handleError(_0x331d53,_0x5c8273){_0x5c8273=_0x5c8273||0x1f4;return function(_0x19dd84){logger['error'](_0x19dd84['stack']);if(_0x19dd84[_0x6055('0x2d')]){delete _0x19dd84['name'];}_0x331d53[_0x6055('0x1e')](_0x5c8273)[_0x6055('0x2e')](_0x19dd84);};}exports['index']=function(_0x47c11f,_0x44d69a){var _0x5b1ddc={},_0x536a13={},_0x26baee={'count':0x0,'rows':[]};var _0x596e05=_[_0x6055('0x2f')](db[_0x6055('0x30')]['rawAttributes'],function(_0x350534){return{'name':_0x350534[_0x6055('0x31')],'type':_0x350534[_0x6055('0x32')][_0x6055('0x33')]};});_0x536a13[_0x6055('0x34')]=_[_0x6055('0x2f')](_0x596e05,_0x6055('0x2d'));_0x536a13[_0x6055('0x35')]=_[_0x6055('0x36')](_0x47c11f['query']);_0x536a13[_0x6055('0x37')]=_[_0x6055('0x38')](_0x536a13[_0x6055('0x34')],_0x536a13[_0x6055('0x35')]);_0x5b1ddc['attributes']=_[_0x6055('0x38')](_0x536a13[_0x6055('0x34')],qs[_0x6055('0x39')](_0x47c11f[_0x6055('0x35')][_0x6055('0x39')]));_0x5b1ddc[_0x6055('0x3a')]=_0x5b1ddc[_0x6055('0x3a')]['length']?_0x5b1ddc[_0x6055('0x3a')]:_0x536a13[_0x6055('0x34')];if(!_0x47c11f[_0x6055('0x35')][_0x6055('0x3b')](_0x6055('0x3c'))){_0x5b1ddc[_0x6055('0x24')]=qs[_0x6055('0x24')](_0x47c11f[_0x6055('0x35')][_0x6055('0x24')]);_0x5b1ddc['offset']=qs[_0x6055('0x23')](_0x47c11f[_0x6055('0x35')][_0x6055('0x23')]);}_0x5b1ddc[_0x6055('0x3d')]=qs['sort'](_0x47c11f[_0x6055('0x35')]['sort']);delete _0x47c11f[_0x6055('0x35')][_0x6055('0x3e')];_0x5b1ddc[_0x6055('0x3f')]=qs[_0x6055('0x37')](_[_0x6055('0x40')](_0x47c11f['query'],_0x536a13[_0x6055('0x37')]),_0x596e05);if(_0x47c11f[_0x6055('0x35')][_0x6055('0x41')]){_0x5b1ddc[_0x6055('0x3f')]=_[_0x6055('0x42')](_0x5b1ddc[_0x6055('0x3f')],{'$or':_['map'](_0x596e05,function(_0x103813){if(_0x103813[_0x6055('0x32')]!==_0x6055('0x43')){var _0x5c09df={};_0x5c09df[_0x103813[_0x6055('0x2d')]]={'$like':'%'+_0x47c11f[_0x6055('0x35')][_0x6055('0x41')]+'%'};return _0x5c09df;}})});}_0x5b1ddc=_[_0x6055('0x42')]({},_0x5b1ddc,_0x47c11f[_0x6055('0x44')]);var _0x12063b={'where':_0x5b1ddc[_0x6055('0x3f')]};return db[_0x6055('0x30')][_0x6055('0x22')](_0x12063b)['then'](function(_0x4c2f32){_0x26baee[_0x6055('0x22')]=_0x4c2f32;if(_0x47c11f[_0x6055('0x35')][_0x6055('0x45')]){_0x5b1ddc[_0x6055('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x6055('0x47')](_0x5b1ddc);})['then'](function(_0x15d1df){_0x26baee[_0x6055('0x48')]=_0x15d1df;return _0x26baee;})[_0x6055('0x2a')](respondWithFilteredResult(_0x44d69a,_0x5b1ddc))[_0x6055('0x49')](handleError(_0x44d69a,null));};exports[_0x6055('0x4a')]=function(_0x407aac,_0x313327){var _0x1e3973={'raw':![],'where':{'id':_0x407aac[_0x6055('0x4b')]['id']}},_0x1f494f={};_0x1f494f['model']=_[_0x6055('0x36')](db[_0x6055('0x30')][_0x6055('0x4c')]);_0x1f494f[_0x6055('0x35')]=_[_0x6055('0x36')](_0x407aac['query']);_0x1f494f['filters']=_['intersection'](_0x1f494f[_0x6055('0x34')],_0x1f494f[_0x6055('0x35')]);_0x1e3973[_0x6055('0x3a')]=_[_0x6055('0x38')](_0x1f494f[_0x6055('0x34')],qs[_0x6055('0x39')](_0x407aac['query'][_0x6055('0x39')]));_0x1e3973[_0x6055('0x3a')]=_0x1e3973[_0x6055('0x3a')][_0x6055('0x4d')]?_0x1e3973[_0x6055('0x3a')]:_0x1f494f['model'];if(_0x407aac['query']['includeAll']){_0x1e3973['include']=[{'all':!![]}];}_0x1e3973=_[_0x6055('0x42')]({},_0x1e3973,_0x407aac[_0x6055('0x44')]);return db[_0x6055('0x30')][_0x6055('0x4e')](_0x1e3973)[_0x6055('0x2a')](handleEntityNotFound(_0x313327,null))['then'](respondWithResult(_0x313327,null))[_0x6055('0x49')](handleError(_0x313327,null));};exports['update']=function(_0x404191,_0x1dcf78){if(_0x404191[_0x6055('0x4f')]['id']){delete _0x404191[_0x6055('0x4f')]['id'];}return db['VoiceMusicOnHold'][_0x6055('0x4e')]({'where':{'id':_0x404191[_0x6055('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1dcf78,null))[_0x6055('0x2a')](saveUpdates(_0x404191['body'],null))[_0x6055('0x2a')](respondWithResult(_0x1dcf78,null))['catch'](handleError(_0x1dcf78,null));};exports[_0x6055('0x50')]=function(_0x4965cf,_0x3381ff,_0x3ad6d7){return db[_0x6055('0x51')]['transaction'](function(_0x41e807){if(_0x4965cf[_0x6055('0x4f')][_0x6055('0x52')]===_0x6055('0x53')){_0x4965cf[_0x6055('0x4f')][_0x6055('0x54')]=path['join'](config['root'],_0x6055('0x55'),_0x4965cf['body'][_0x6055('0x2d')]);}return db[_0x6055('0x30')][_0x6055('0x50')](_0x4965cf[_0x6055('0x4f')],{'transaction':_0x41e807})[_0x6055('0x2a')](function(_0x3eee51){if(_0x4965cf['body'][_0x6055('0x52')]===_0x6055('0x53')){fs[_0x6055('0x56')](_0x3eee51[_0x6055('0x54')],parseInt('0777',0x8));}var _0x4fcfb5=_0x4965cf['user']['get']({'plain':!![]});if(!_0x4fcfb5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fcfb5[_0x6055('0x57')]===_0x6055('0x58')){var _0x3f575e=_0x3eee51[_0x6055('0x59')]({'plain':!![]});return db[_0x6055('0x5a')][_0x6055('0x4e')]({'where':{'name':_0x6055('0x2c'),'userProfileId':_0x4fcfb5[_0x6055('0x5b')]},'raw':!![]})['then'](function(_0xe74bcc){if(_0xe74bcc&&_0xe74bcc['autoAssociation']===0x0){return db['UserProfileResource'][_0x6055('0x50')]({'name':_0x3f575e['name'],'resourceId':_0x3f575e['id'],'type':_0xe74bcc[_0x6055('0x2d')],'sectionId':_0xe74bcc['id']},{})[_0x6055('0x2a')](function(){return _0x3eee51;});}else{return _0x3eee51;}})[_0x6055('0x49')](function(_0x416efe){logger['error'](_0x6055('0x5c'),_0x416efe);});}return _0x3eee51;});})[_0x6055('0x2a')](respondWithResult(_0x3381ff,0xc9))['catch'](handleError(_0x3381ff,null));};exports[_0x6055('0x2b')]=function(_0x538bdb,_0x51cac3,_0x31954f){var _0x27e62d;return db['VoiceMusicOnHold'][_0x6055('0x4e')]({'where':{'id':_0x538bdb[_0x6055('0x4b')]['id']}})[_0x6055('0x2a')](function(_0x1625c5){if(_0x1625c5){return db[_0x6055('0x51')][_0x6055('0x5d')](function(_0x28cb03){return _0x1625c5[_0x6055('0x2b')]({'transaction':_0x28cb03,'raw':!![]})[_0x6055('0x2a')](function(_0x5019b7){if(_0x5019b7[_0x6055('0x54')]){fs[_0x6055('0x5e')](_0x5019b7['directory'])[_0x6055('0x5f')](function(_0x5dc307){fs['unlinkSync'](path['join'](_0x5019b7[_0x6055('0x54')],_0x5dc307));});fs['rmdirSync'](_0x5019b7[_0x6055('0x54')]);}return _0x5019b7;});})[_0x6055('0x49')](function(_0x464862){throw new db['Sequelize'][(_0x6055('0x60'))](_0x464862[_0x6055('0x61')]);});}})[_0x6055('0x2a')](handleEntityNotFound(_0x51cac3,null))['then'](removeEntity(_0x51cac3,null))[_0x6055('0x49')](handleError(_0x51cac3,null));};exports[_0x6055('0x62')]=function(_0x21ca69,_0x2b88c8,_0x5cd282){return db['sequelize'][_0x6055('0x5d')](function(_0x275d50){var _0x105658;return db[_0x6055('0x30')][_0x6055('0x4e')]({'where':{'id':_0x21ca69['params']['id']}})['then'](function(_0x55ad7f){if(_0x55ad7f){_0x105658=_0x55ad7f;return _0x55ad7f['addSound'](_0x21ca69['body']['id'],{'transaction':_0x275d50});}})[_0x6055('0x2a')](function(_0x2a076f){if(_0x2a076f){return db[_0x6055('0x63')][_0x6055('0x64')]({'where':{'id':_0x21ca69[_0x6055('0x4f')]['id']},'attributes':['id',_0x6055('0x2d'),_0x6055('0x65'),_0x6055('0x66'),_0x6055('0x67')],'raw':!![]});}})[_0x6055('0x2a')](function(_0x5b1987){if(_0x5b1987){var _0x42eada=path[_0x6055('0x68')](config[_0x6055('0x69')],'server/files/sounds/converted',util[_0x6055('0x6a')]('%s.%s',path[_0x6055('0x6b')](_0x5b1987[_0x6055('0x65')],path[_0x6055('0x6c')](_0x5b1987[_0x6055('0x65')])),_0x5b1987[_0x6055('0x66')]));var _0x27ada2=path[_0x6055('0x68')](config[_0x6055('0x69')],_0x6055('0x55'),_0x105658[_0x6055('0x2d')],util['format'](_0x6055('0x6d'),_0x5b1987[_0x6055('0x2d')],_0x5b1987[_0x6055('0x66')]));fs[_0x6055('0x6e')](_0x42eada,_0x27ada2);return _0x5b1987;}})[_0x6055('0x49')](function(_0x4a6f6c){throw new db[(_0x6055('0x6f'))]['ValidationError'](_0x4a6f6c[_0x6055('0x61')]);});})[_0x6055('0x2a')](handleEntityNotFound(_0x2b88c8,null))[_0x6055('0x2a')](respondWithResult(_0x2b88c8,0xc9))[_0x6055('0x49')](handleError(_0x2b88c8,null));};exports[_0x6055('0x70')]=function(_0x130dcc,_0x56dbc3,_0x390328){return db[_0x6055('0x51')]['transaction'](function(_0x35d996){var _0x319154;return db[_0x6055('0x30')]['findOne']({'where':{'id':_0x130dcc['params']['id']}})[_0x6055('0x2a')](handleEntityNotFound(_0x56dbc3,null))[_0x6055('0x2a')](function(_0xc1c127){if(_0xc1c127){_0x319154=_0xc1c127;return _0xc1c127[_0x6055('0x70')](_0x130dcc[_0x6055('0x4b')][_0x6055('0x71')]);}})[_0x6055('0x2a')](function(_0x5dfe25){if(_0x5dfe25){return db['Sound'][_0x6055('0x64')]({'where':{'id':_0x130dcc[_0x6055('0x4b')]['id2']},'attributes':['id','name',_0x6055('0x65'),_0x6055('0x66'),_0x6055('0x67')],'raw':!![]});}})['then'](function(_0x5dd48a){if(_0x5dd48a){fs[_0x6055('0x72')](path[_0x6055('0x68')](_0x319154[_0x6055('0x54')],util[_0x6055('0x6a')]('%s.%s',_0x5dd48a[_0x6055('0x2d')],_0x5dd48a[_0x6055('0x66')])));return _0x5dd48a;}})[_0x6055('0x49')](function(_0x1d8f78){throw new db['Sequelize'][(_0x6055('0x60'))](_0x1d8f78[_0x6055('0x61')]);});})[_0x6055('0x2a')](handleEntityNotFound(_0x56dbc3,null))[_0x6055('0x2a')](respondWithStatusCode(_0x56dbc3,0xcc))[_0x6055('0x49')](handleError(_0x56dbc3,null));};exports['getSounds']=function(_0x4efa27,_0x2c16d4,_0x12a349){var _0x4aeed4={};var _0x2b80df={};var _0x425294;var _0x32eb3c;return db[_0x6055('0x30')][_0x6055('0x64')]({'where':{'id':_0x4efa27[_0x6055('0x4b')]['id']}})[_0x6055('0x2a')](handleEntityNotFound(_0x2c16d4,null))[_0x6055('0x2a')](function(_0x1e5aec){if(_0x1e5aec){_0x425294=_0x1e5aec;_0x2b80df[_0x6055('0x34')]=_['keys'](db[_0x6055('0x63')]['rawAttributes']);_0x2b80df['query']=_[_0x6055('0x36')](_0x4efa27[_0x6055('0x35')]);_0x2b80df[_0x6055('0x37')]=_[_0x6055('0x38')](_0x2b80df[_0x6055('0x34')],_0x2b80df[_0x6055('0x35')]);_0x4aeed4[_0x6055('0x3a')]=_[_0x6055('0x38')](_0x2b80df[_0x6055('0x34')],qs['fields'](_0x4efa27['query'][_0x6055('0x39')]));_0x4aeed4[_0x6055('0x3a')]=_0x4aeed4[_0x6055('0x3a')][_0x6055('0x4d')]?_0x4aeed4['attributes']:_0x2b80df[_0x6055('0x34')];_0x4aeed4['order']=qs[_0x6055('0x3e')](_0x4efa27[_0x6055('0x35')][_0x6055('0x3e')]);_0x4aeed4[_0x6055('0x3f')]=qs[_0x6055('0x37')](_[_0x6055('0x40')](_0x4efa27['query'],_0x2b80df[_0x6055('0x37')]));if(_0x4efa27[_0x6055('0x35')]['filter']){_0x4aeed4[_0x6055('0x3f')]=_['merge'](_0x4aeed4['where'],{'$or':_['map'](_0x4aeed4[_0x6055('0x3a')],function(_0x5bb8d1){var _0x2e4c2b={};_0x2e4c2b[_0x5bb8d1]={'$like':'%'+_0x4efa27[_0x6055('0x35')]['filter']+'%'};return _0x2e4c2b;})});}_0x4aeed4=_[_0x6055('0x42')]({},_0x4aeed4,_0x4efa27[_0x6055('0x44')]);return _0x425294['getSounds'](_0x4aeed4);}})[_0x6055('0x2a')](function(_0x4430c8){if(_0x4430c8){_0x32eb3c=_0x4430c8[_0x6055('0x4d')];if(!_0x4efa27['query'][_0x6055('0x3b')](_0x6055('0x3c'))){_0x4aeed4[_0x6055('0x24')]=qs[_0x6055('0x24')](_0x4efa27[_0x6055('0x35')][_0x6055('0x24')]);_0x4aeed4[_0x6055('0x23')]=qs['offset'](_0x4efa27['query'][_0x6055('0x23')]);}return _0x425294[_0x6055('0x73')](_0x4aeed4);}})[_0x6055('0x2a')](function(_0x23a17e){if(_0x23a17e){return _0x23a17e?{'count':_0x32eb3c,'rows':_0x23a17e}:null;}})[_0x6055('0x2a')](respondWithResult(_0x2c16d4,null))['catch'](handleError(_0x2c16d4,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 580080c..bd161f5 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 _0xf3fa=['exports','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xf3fa,0x121));var _0xaf3f=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0xf3fa[_0xc8a11];return _0x55a500;};'use strict';var _=require(_0xaf3f('0x0'));var util=require('util');var logger=require(_0xaf3f('0x1'))(_0xaf3f('0x2'));var moment=require(_0xaf3f('0x3'));var BPromise=require(_0xaf3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf3f('0x5'));var rimraf=require(_0xaf3f('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0xaf3f('0x7')]=function(_0x11a87d,_0x1ffd49){return _0x11a87d['define']('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4bc=['api','moment','bluebird','request-promise','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','../../config/logger'];(function(_0x86bed5,_0xa2634d){var _0x252d3a=function(_0x204248){while(--_0x204248){_0x86bed5['push'](_0x86bed5['shift']());}};_0x252d3a(++_0xa2634d);}(_0xd4bc,0x1d4));var _0xcd4b=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0xd4bc[_0x2b9e8a];return _0x520e67;};'use strict';var _=require(_0xcd4b('0x0'));var util=require('util');var logger=require(_0xcd4b('0x1'))(_0xcd4b('0x2'));var moment=require(_0xcd4b('0x3'));var BPromise=require(_0xcd4b('0x4'));var rp=require(_0xcd4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd4b('0x6'));module[_0xcd4b('0x7')]=function(_0x31899e,_0x234635){return _0x31899e[_0xcd4b('0x8')](_0xcd4b('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index d7a8e1e..60318e3 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc990fd,_0x133ddd){var _0x3066d9=function(_0x517270){while(--_0x517270){_0xc990fd['push'](_0xc990fd['shift']());}};_0x3066d9(++_0x133ddd);}(_0x70e0,0x17b));var _0x070e=function(_0xa490de,_0x2a1aff){_0xa490de=_0xa490de-0x0;var _0x298bf5=_0x70e0[_0xa490de];return _0x298bf5;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _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(_0xbe4d20,_0x3506eb){var _0xda7ffc=function(_0x38bd44){while(--_0x38bd44){_0xbe4d20['push'](_0xbe4d20['shift']());}};_0xda7ffc(++_0x3506eb);}(_0x70e0,0x17b));var _0x070e=function(_0x42bf24,_0x160ab4){_0x42bf24=_0x42bf24-0x0;var _0x382efc=_0x70e0[_0x42bf24];return _0x382efc;};'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 c800f8f..8a7f519 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 _0x131a=['removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getAgents','getTeams','create','/:id/users','/:id/teams','addTeams','put','update','delete','destroy'];(function(_0x4dbe5c,_0x36ed26){var _0x57bd05=function(_0x2ad3e2){while(--_0x2ad3e2){_0x4dbe5c['push'](_0x4dbe5c['shift']());}};_0x57bd05(++_0x36ed26);}(_0x131a,0x18b));var _0xa131=function(_0x4c25c2,_0x1821a3){_0x4c25c2=_0x4c25c2-0x0;var _0x2385ba=_0x131a[_0x4c25c2];return _0x2385ba;};'use strict';var multer=require(_0xa131('0x0'));var util=require(_0xa131('0x1'));var path=require(_0xa131('0x2'));var timeout=require(_0xa131('0x3'));var express=require(_0xa131('0x4'));var router=express['Router']();var fs_extra=require(_0xa131('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa131('0x6'));var config=require(_0xa131('0x7'));var controller=require('./voicePrefix.controller');router[_0xa131('0x8')]('/',auth[_0xa131('0x9')](),controller[_0xa131('0xa')]);router[_0xa131('0x8')](_0xa131('0xb'),auth[_0xa131('0x9')](),controller[_0xa131('0xc')]);router[_0xa131('0x8')](_0xa131('0xd'),auth['isAuthenticated'](),controller[_0xa131('0xe')]);router[_0xa131('0x8')]('/:id/users',auth[_0xa131('0x9')](),controller[_0xa131('0xf')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xa131('0x10')]);router['post']('/',auth[_0xa131('0x9')](),controller[_0xa131('0x11')]);router['post'](_0xa131('0x12'),auth[_0xa131('0x9')](),controller['addAgents']);router['post'](_0xa131('0x13'),auth[_0xa131('0x9')](),controller[_0xa131('0x14')]);router[_0xa131('0x15')](_0xa131('0xd'),auth[_0xa131('0x9')](),controller[_0xa131('0x16')]);router[_0xa131('0x17')](_0xa131('0xd'),auth[_0xa131('0x9')](),controller[_0xa131('0x18')]);router[_0xa131('0x17')](_0xa131('0x12'),auth[_0xa131('0x9')](),controller[_0xa131('0x19')]);router[_0xa131('0x17')](_0xa131('0x13'),auth['isAuthenticated'](),controller[_0xa131('0x1a')]);module[_0xa131('0x1b')]=router; \ No newline at end of file +var _0x0d4d=['../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','show','getAgents','/:id/teams','getTeams','create','post','/:id/users','addAgents','addTeams','update','/:id','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0d4d,0x132));var _0xd0d4=function(_0x535903,_0x2c9af1){_0x535903=_0x535903-0x0;var _0x5ef770=_0x0d4d[_0x535903];return _0x5ef770;};'use strict';var multer=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var path=require(_0xd0d4('0x2'));var timeout=require(_0xd0d4('0x3'));var express=require(_0xd0d4('0x4'));var router=express[_0xd0d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0d4('0x7'));var controller=require(_0xd0d4('0x8'));router['get']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xa')]);router[_0xd0d4('0xb')]('/describe',auth[_0xd0d4('0x9')](),controller['describe']);router[_0xd0d4('0xb')]('/:id',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xc')]);router[_0xd0d4('0xb')]('/:id/users',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xd')]);router[_0xd0d4('0xb')](_0xd0d4('0xe'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xf')]);router['post']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x10')]);router[_0xd0d4('0x11')](_0xd0d4('0x12'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x13')]);router['post'](_0xd0d4('0xe'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x14')]);router['put']('/:id',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x15')]);router['delete'](_0xd0d4('0x16'),auth[_0xd0d4('0x9')](),controller['destroy']);router['delete'](_0xd0d4('0x12'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x17')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xd0d4('0x18')]);module[_0xd0d4('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 510bcb1..eb14170 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 _0x15a4=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x59f6b1,_0x5e1914){var _0x1fd0c6=function(_0xe4b421){while(--_0xe4b421){_0x59f6b1['push'](_0x59f6b1['shift']());}};_0x1fd0c6(++_0x5e1914);}(_0x15a4,0x124));var _0x415a=function(_0x228dfc,_0x5a56fe){_0x228dfc=_0x228dfc-0x0;var _0x515c7a=_0x15a4[_0x228dfc];return _0x515c7a;};'use strict';var Sequelize=require(_0x415a('0x0'));module[_0x415a('0x1')]={'name':{'type':Sequelize[_0x415a('0x2')],'allowNull':![],'unique':_0x415a('0x3')},'prefix':{'type':Sequelize[_0x415a('0x4')],'get':function(_0xadec32){return _0x415a('0x5')+this[_0x415a('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0x415a('0x2')]},'callerIdAll':{'type':Sequelize[_0x415a('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x415a('0x7')]}}; \ No newline at end of file +var _0x9a08=['sequelize','name','VIRTUAL','system-','STRING'];(function(_0x263e2e,_0x47a7e9){var _0x4c0fec=function(_0x20ebb5){while(--_0x20ebb5){_0x263e2e['push'](_0x263e2e['shift']());}};_0x4c0fec(++_0x47a7e9);}(_0x9a08,0x122));var _0x89a0=function(_0x2e846f,_0x57929a){_0x2e846f=_0x2e846f-0x0;var _0x42f147=_0x9a08[_0x2e846f];return _0x42f147;};'use strict';var Sequelize=require(_0x89a0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x89a0('0x1')},'prefix':{'type':Sequelize[_0x89a0('0x2')],'get':function(_0xfa54eb){return _0x89a0('0x3')+this['getDataValue'](_0x89a0('0x1'))+'-';}},'description':{'type':Sequelize[_0x89a0('0x4')]},'callerIdAll':{'type':Sequelize[_0x89a0('0x4')]},'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 ae657c1..c3d10b3 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 _0x58a4=['addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','getTeams','Team','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','catch','describe','create','sequelize','transaction','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','findById'];(function(_0x2ad870,_0x201e38){var _0x84b464=function(_0xdd3903){while(--_0xdd3903){_0x2ad870['push'](_0x2ad870['shift']());}};_0x84b464(++_0x201e38);}(_0x58a4,0xbf));var _0x458a=function(_0x517586,_0xc97d01){_0x517586=_0x517586-0x0;var _0x4d7494=_0x58a4[_0x517586];return _0x4d7494;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];config[_0x458a('0x1a')]=_[_0x458a('0x1b')](config[_0x458a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458a('0x1a')]));require('./voicePrefix.socket')[_0x458a('0x1c')](socket);function respondWithStatusCode(_0x44f683,_0x10133b){_0x10133b=_0x10133b||0xcc;return function(_0x3b74f9){if(_0x3b74f9){return _0x44f683[_0x458a('0x1d')](_0x10133b);}return _0x44f683[_0x458a('0x1e')](_0x10133b)['end']();};}function respondWithResult(_0x4b26be,_0x5c7993){_0x5c7993=_0x5c7993||0xc8;return function(_0x2faf6a){if(_0x2faf6a){return _0x4b26be[_0x458a('0x1e')](_0x5c7993)[_0x458a('0x1f')](_0x2faf6a);}};}function respondWithFilteredResult(_0x5c5b41,_0x310569){return function(_0x260c87){if(_0x260c87){var _0x18504d=typeof _0x310569[_0x458a('0x20')]===_0x458a('0x21')&&typeof _0x310569['limit']==='undefined';var _0x178db9=_0x260c87['count'];var _0x3302b7=_0x18504d?0x0:_0x310569[_0x458a('0x20')];var _0x47a202=_0x18504d?_0x260c87[_0x458a('0x22')]:_0x310569['offset']+_0x310569[_0x458a('0x23')];var _0x1c79cb;if(_0x47a202>=_0x178db9){_0x47a202=_0x178db9;_0x1c79cb=0xc8;}else{_0x1c79cb=0xce;}_0x5c5b41['status'](_0x1c79cb);return _0x5c5b41[_0x458a('0x24')](_0x458a('0x25'),_0x3302b7+'-'+_0x47a202+'/'+_0x178db9)['json'](_0x260c87);}return null;};}function patchUpdates(_0xa6b8ff){return function(_0x5ad95a){try{jsonpatch[_0x458a('0x26')](_0x5ad95a,_0xa6b8ff,!![]);}catch(_0x5bca42){return BPromise[_0x458a('0x27')](_0x5bca42);}return _0x5ad95a['save']();};}function saveUpdates(_0x36b08e,_0x911eaf){return function(_0xcb0756){if(_0xcb0756){return _0xcb0756[_0x458a('0x28')](_0x36b08e)[_0x458a('0x29')](function(_0x19bd5){return _0x19bd5;});}return null;};}function removeEntity(_0x340375,_0x3012c7){return function(_0x1f2d0){if(_0x1f2d0){return _0x1f2d0[_0x458a('0x2a')]()[_0x458a('0x29')](function(){var _0x327fcb=_0x1f2d0[_0x458a('0x2b')]({'plain':!![]});var _0x5a55b7=_0x458a('0x2c');return db[_0x458a('0x2d')]['destroy']({'where':{'type':_0x5a55b7,'resourceId':_0x327fcb['id']}})['then'](function(){return _0x1f2d0;});})[_0x458a('0x29')](function(){_0x340375['status'](0xcc)[_0x458a('0x2e')]();});}};}function handleEntityNotFound(_0x29f9b5,_0x223f73){return function(_0x4a49e4){if(!_0x4a49e4){_0x29f9b5[_0x458a('0x1d')](0x194);}return _0x4a49e4;};}function handleError(_0x2531f7,_0x1426a8){_0x1426a8=_0x1426a8||0x1f4;return function(_0x562c36){logger['error'](_0x562c36[_0x458a('0x2f')]);if(_0x562c36['name']){delete _0x562c36[_0x458a('0x30')];}_0x2531f7['status'](_0x1426a8)[_0x458a('0x31')](_0x562c36);};}exports[_0x458a('0x32')]=function(_0x492843,_0x309a6a){var _0x269f53={},_0x625ae3={},_0x525caf={'count':0x0,'rows':[]};var _0x3371c3=_[_0x458a('0x33')](db[_0x458a('0x34')][_0x458a('0x35')],function(_0x5267fe){return{'name':_0x5267fe['fieldName'],'type':_0x5267fe[_0x458a('0x36')][_0x458a('0x37')]};});_0x625ae3[_0x458a('0x38')]=_[_0x458a('0x33')](_0x3371c3,_0x458a('0x30'));_0x625ae3[_0x458a('0x39')]=_['keys'](_0x492843[_0x458a('0x39')]);_0x625ae3[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],_0x625ae3[_0x458a('0x39')]);_0x269f53[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x492843['query'][_0x458a('0x3d')]));_0x269f53[_0x458a('0x3c')]=_0x269f53[_0x458a('0x3c')][_0x458a('0x3e')]?_0x269f53[_0x458a('0x3c')]:_0x625ae3[_0x458a('0x38')];if(!_0x492843[_0x458a('0x39')][_0x458a('0x3f')](_0x458a('0x40'))){_0x269f53[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x492843[_0x458a('0x39')][_0x458a('0x23')]);_0x269f53[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x492843['query'][_0x458a('0x20')]);}_0x269f53[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x492843[_0x458a('0x39')][_0x458a('0x42')]);_0x269f53[_0x458a('0x43')]=qs[_0x458a('0x3a')](_[_0x458a('0x44')](_0x492843[_0x458a('0x39')],_0x625ae3[_0x458a('0x3a')]),_0x3371c3);if(_0x492843[_0x458a('0x39')]['filter']){_0x269f53[_0x458a('0x43')]=_[_0x458a('0x45')](_0x269f53['where'],{'$or':_[_0x458a('0x33')](_0x3371c3,function(_0x422b45){if(_0x422b45[_0x458a('0x36')]!=='VIRTUAL'){var _0x406312={};_0x406312[_0x422b45[_0x458a('0x30')]]={'$like':'%'+_0x492843[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0x406312;}})});}_0x269f53=_[_0x458a('0x45')]({},_0x269f53,_0x492843[_0x458a('0x47')]);var _0x21d2d4={'where':_0x269f53[_0x458a('0x43')]};return db['VoicePrefix'][_0x458a('0x22')](_0x21d2d4)[_0x458a('0x29')](function(_0x2b9030){_0x525caf['count']=_0x2b9030;if(_0x492843[_0x458a('0x39')][_0x458a('0x48')]){_0x269f53['include']=[{'all':!![]}];}return db[_0x458a('0x34')][_0x458a('0x49')](_0x269f53);})[_0x458a('0x29')](function(_0x36c391){_0x525caf[_0x458a('0x4a')]=_0x36c391;return _0x525caf;})['then'](respondWithFilteredResult(_0x309a6a,_0x269f53))['catch'](handleError(_0x309a6a,null));};exports[_0x458a('0x4b')]=function(_0x301e61,_0x33a31d){var _0x18e4e2={'raw':![],'where':{'id':_0x301e61[_0x458a('0x4c')]['id']}},_0x5afd24={};_0x5afd24[_0x458a('0x38')]=_['keys'](db[_0x458a('0x34')]['rawAttributes']);_0x5afd24[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x301e61[_0x458a('0x39')]);_0x5afd24['filters']=_[_0x458a('0x3b')](_0x5afd24[_0x458a('0x38')],_0x5afd24[_0x458a('0x39')]);_0x18e4e2['attributes']=_['intersection'](_0x5afd24[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x301e61[_0x458a('0x39')]['fields']));_0x18e4e2['attributes']=_0x18e4e2[_0x458a('0x3c')][_0x458a('0x3e')]?_0x18e4e2[_0x458a('0x3c')]:_0x5afd24[_0x458a('0x38')];if(_0x301e61[_0x458a('0x39')][_0x458a('0x48')]){_0x18e4e2[_0x458a('0x4e')]=[{'all':!![]}];}_0x18e4e2=_[_0x458a('0x45')]({},_0x18e4e2,_0x301e61[_0x458a('0x47')]);return db[_0x458a('0x34')][_0x458a('0x4f')](_0x18e4e2)[_0x458a('0x29')](handleEntityNotFound(_0x33a31d,null))[_0x458a('0x29')](respondWithResult(_0x33a31d,null))[_0x458a('0x50')](handleError(_0x33a31d,null));};exports[_0x458a('0x2a')]=function(_0x25b44c,_0x51669b){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x25b44c[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x51669b,null))[_0x458a('0x29')](removeEntity(_0x51669b,null))['catch'](handleError(_0x51669b,null));};exports['describe']=function(_0x514d82,_0x2abf75){return db['VoicePrefix'][_0x458a('0x51')]()[_0x458a('0x29')](respondWithResult(_0x2abf75,null))[_0x458a('0x50')](handleError(_0x2abf75,null));};exports[_0x458a('0x52')]=function(_0xfa6e65,_0x5f0151){var _0x48f68e;return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x2587a1){return db[_0x458a('0x34')][_0x458a('0x52')](_0xfa6e65['body'],{'transaction':_0x2587a1})[_0x458a('0x29')](function(_0x4eed01){_0x48f68e=_0x4eed01[_0x458a('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x458a('0x4f')]({'where':{'id':_0x48f68e['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b9928){return createVoicePrefixExtensions(_0x48f68e,_0x4b9928,_0x2587a1);});});})[_0x458a('0x29')](function(){var _0x3eb267=_0xfa6e65['user'][_0x458a('0x2b')]({'plain':!![]});if(!_0x3eb267)throw new Error(_0x458a('0x55'));if(_0x3eb267[_0x458a('0x56')]==='user'){var _0x2c1230=_0x48f68e;return db[_0x458a('0x57')][_0x458a('0x4f')]({'where':{'name':_0x458a('0x2c'),'userProfileId':_0x3eb267[_0x458a('0x58')]},'raw':!![]})[_0x458a('0x29')](function(_0x597e74){if(_0x597e74&&_0x597e74[_0x458a('0x59')]===0x0){return db[_0x458a('0x2d')][_0x458a('0x52')]({'name':_0x2c1230[_0x458a('0x30')],'resourceId':_0x2c1230['id'],'type':_0x597e74[_0x458a('0x30')],'sectionId':_0x597e74['id']},{})[_0x458a('0x29')](function(){return _0x48f68e;});}else{return _0x48f68e;}})[_0x458a('0x50')](function(_0x3b6cf9){logger['error'](_0x458a('0x5a'),_0x3b6cf9);throw _0x3b6cf9;});}return _0x48f68e;})['then'](respondWithResult(_0x5f0151,null))[_0x458a('0x50')](handleError(_0x5f0151,null));};function Extension(_0x2921ba,_0x222aa4,_0x42b748,_0x4da240){this['context']=_0x458a('0x5b');this[_0x458a('0x5c')]=_0x2921ba;this[_0x458a('0x5d')]=_0x42b748;this[_0x458a('0x36')]=_0x458a('0x5e');this[_0x458a('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x458a('0x60')]=_0x222aa4;this[_0x458a('0x61')]=_0x4da240;}function createVoicePrefixExtensions(_0x4f6913,_0x18d83a,_0x47b334){return new BPromise(function(_0x425a0f,_0x338127){var _0xa37d44=new Extension(formatPrefixName(_0x4f6913[_0x458a('0x62')]),0x1,_0x458a('0x63'),_0x458a('0x64'));_0xa37d44[_0x458a('0x65')]=_0x4f6913['id'];return db[_0x458a('0x66')]['create'](_0xa37d44,{'transaction':_0x47b334})[_0x458a('0x29')](function(_0x3ed05d){var _0x5d41a2=_0x3ed05d[_0x458a('0x2b')]({'plain':!![]});var _0x3da617=_['map'](addVoicePrefixExtensions(_0x4f6913,_0x18d83a),function(_0xaf7b50){_0xaf7b50[_0x458a('0x67')]=_0x5d41a2['id'];_0xaf7b50['VoicePrefixId']=_0x4f6913['id'];return _0xaf7b50;});return db[_0x458a('0x66')][_0x458a('0x68')](_0x3da617,{'transaction':_0x47b334})['then'](function(_0x16f82f){if(!_0x16f82f){return _0x338127(_0x458a('0x69'));}else{return _0x425a0f(_0x16f82f);}})[_0x458a('0x50')](function(_0x404d93){return _0x338127(_0x404d93);});});;});};function addVoicePrefixExtensions(_0x541375,_0x27d1f2){var _0x4199a7=[];var _0x397595=formatPrefixName(_0x541375['prefix']);_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x2,_0x458a('0x6b'),_0x458a('0x6c')+_0x541375[_0x458a('0x30')]));if(_0x541375[_0x458a('0x6d')]){_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,_0x458a('0x6b'),_0x458a('0x6e')+_0x541375[_0x458a('0x6d')]));}else{_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,'NoOp',_0x458a('0x6f')));}_0x4199a7['push'](new Extension(_0x397595,0x4,_0x458a('0x70'),_0x27d1f2[_0x458a('0x71')]+','+_0x458a('0x72')+(0x8+_0x541375[_0x458a('0x30')][_0x458a('0x3e')])+'}'+','+0x1));return _0x4199a7;}function formatPrefixName(_0x3d1d37){var _0x2c6a00='_';for(var _0x3745d5=0x0;_0x3745d5<_0x3d1d37[_0x458a('0x3e')];_0x3745d5++){if(_0x3d1d37[_0x458a('0x73')](_0x3745d5)=='-'){_0x2c6a00+=_0x3d1d37[_0x458a('0x73')](_0x3745d5);}else{_0x2c6a00+='['+_0x3d1d37[_0x458a('0x73')](_0x3745d5)+']';}}_0x2c6a00+='.';return _0x2c6a00;}exports[_0x458a('0x28')]=function(_0x435884,_0x3948aa,_0x2c131b){var _0x4c426a=_0x435884[_0x458a('0x74')];_0x4c426a['prefix']=_0x458a('0x75')+_0x4c426a[_0x458a('0x30')]+'-';return db['sequelize'][_0x458a('0x54')](function(_0xb028b3){return db[_0x458a('0x34')]['update'](_0x4c426a,{'where':{'id':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x2a')]({'where':{'VoicePrefixId':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x4f')]({'where':{'id':_0x4c426a['VoiceExtensionId']},'raw':!![]})[_0x458a('0x29')](function(_0x54abb1){return createVoicePrefixExtensions(_0x4c426a,_0x54abb1,_0xb028b3);});});});})['then'](function(){return db[_0x458a('0x34')][_0x458a('0x76')](_0x4c426a['id']);})[_0x458a('0x29')](respondWithResult(_0x3948aa,null))[_0x458a('0x50')](handleError(_0x3948aa,null));};exports[_0x458a('0x77')]=function(_0x434d04,_0x42eae7,_0x5aee0d){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x434d04[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x42eae7,null))[_0x458a('0x29')](function(_0x17398f){if(_0x17398f){return _0x17398f['addAgents'](_0x434d04['body']['ids'],_[_0x458a('0x78')](_0x434d04['body'],[_0x458a('0x79'),'id'])||{})[_0x458a('0x7a')](function(_0x46ef02){for(var _0x3d73d1=0x0;_0x3d73d1<_0x434d04[_0x458a('0x74')][_0x458a('0x79')][_0x458a('0x3e')];_0x3d73d1+=0x1){socket['emit'](_0x458a('0x7b'),{'UserId':Number(_0x434d04[_0x458a('0x74')]['ids'][_0x3d73d1]),'VoicePrefixId':Number(_0x434d04[_0x458a('0x4c')]['id'])});}return _0x46ef02;});}})['then'](respondWithResult(_0x42eae7,null))[_0x458a('0x50')](handleError(_0x42eae7,null));};exports['removeAgents']=function(_0x26b3f7,_0x177457,_0xce45b5){return db[_0x458a('0x34')]['find']({'where':{'id':_0x26b3f7[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x177457,null))[_0x458a('0x29')](function(_0x239e2f){if(_0x239e2f){return _0x239e2f[_0x458a('0x7c')](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])[_0x458a('0x29')](function(){if(_['isArray'](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])){for(var _0x12e367=0x0;_0x12e367<_0x26b3f7[_0x458a('0x39')]['ids'][_0x458a('0x3e')];_0x12e367+=0x1){socket[_0x458a('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')][_0x12e367]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}}else{socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':Number(_0x26b3f7['query'][_0x458a('0x79')]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}});}})[_0x458a('0x29')](respondWithStatusCode(_0x177457,null))[_0x458a('0x50')](handleError(_0x177457,null));};exports[_0x458a('0x7f')]=function(_0x46ac5c,_0x2eecf0,_0x573f46){var _0x1f9925={};var _0x4d3790={};var _0x396af9;var _0x36e650;return db[_0x458a('0x34')]['findOne']({'where':{'id':_0x46ac5c[_0x458a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2eecf0,null))['then'](function(_0x2574a3){if(_0x2574a3){_0x396af9=_0x2574a3;_0x4d3790[_0x458a('0x38')]=_['keys'](db['User'][_0x458a('0x35')]);_0x4d3790[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x46ac5c[_0x458a('0x39')]);_0x4d3790[_0x458a('0x3a')]=_['intersection'](_0x4d3790[_0x458a('0x38')],_0x4d3790['query']);_0x1f9925[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x4d3790[_0x458a('0x38')],qs['fields'](_0x46ac5c[_0x458a('0x39')][_0x458a('0x3d')]));_0x1f9925['attributes']=_0x1f9925[_0x458a('0x3c')]['length']?_0x1f9925[_0x458a('0x3c')]:_0x4d3790[_0x458a('0x38')];_0x1f9925[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x46ac5c['query'][_0x458a('0x42')]);_0x1f9925['where']=qs['filters'](_[_0x458a('0x44')](_0x46ac5c[_0x458a('0x39')],_0x4d3790[_0x458a('0x3a')]));if(_0x46ac5c[_0x458a('0x39')][_0x458a('0x46')]){_0x1f9925[_0x458a('0x43')]=_['merge'](_0x1f9925[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x1f9925[_0x458a('0x3c')],function(_0x222dcb){var _0x17099e={};_0x17099e[_0x222dcb]={'$like':'%'+_0x46ac5c[_0x458a('0x39')]['filter']+'%'};return _0x17099e;})});}_0x1f9925=_[_0x458a('0x45')]({},_0x1f9925,_0x46ac5c[_0x458a('0x47')]);return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})['then'](function(_0x2903c2){if(_0x2903c2){_0x36e650=_0x2903c2[_0x458a('0x3e')];if(!_0x46ac5c[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x1f9925[_0x458a('0x23')]=qs['limit'](_0x46ac5c['query']['limit']);_0x1f9925['offset']=qs['offset'](_0x46ac5c[_0x458a('0x39')]['offset']);}return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})[_0x458a('0x29')](function(_0x2adefe){if(_0x2adefe){return _0x2adefe?{'count':_0x36e650,'rows':_0x2adefe}:null;}})[_0x458a('0x29')](respondWithResult(_0x2eecf0,null))[_0x458a('0x50')](handleError(_0x2eecf0,null));};exports[_0x458a('0x80')]=function(_0x555190,_0x11ebe7,_0x59ad9c){var _0x24b1ee={};var _0x4e1d44={};var _0x23428c;var _0x333d74;return db['VoicePrefix']['findOne']({'where':{'id':_0x555190['params']['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x11ebe7,null))[_0x458a('0x29')](function(_0x21d8a9){if(_0x21d8a9){_0x23428c=_0x21d8a9;_0x4e1d44[_0x458a('0x38')]=_[_0x458a('0x4d')](db['Team'][_0x458a('0x35')]);_0x4e1d44[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x555190[_0x458a('0x39')]);_0x4e1d44[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],_0x4e1d44[_0x458a('0x39')]);_0x24b1ee['attributes']=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x555190[_0x458a('0x39')][_0x458a('0x3d')]));_0x24b1ee[_0x458a('0x3c')]=_0x24b1ee[_0x458a('0x3c')]['length']?_0x24b1ee['attributes']:_0x4e1d44['model'];_0x24b1ee['order']=qs[_0x458a('0x42')](_0x555190[_0x458a('0x39')][_0x458a('0x42')]);_0x24b1ee[_0x458a('0x43')]=qs['filters'](_[_0x458a('0x44')](_0x555190[_0x458a('0x39')],_0x4e1d44[_0x458a('0x3a')]));if(_0x555190[_0x458a('0x39')]['filter']){_0x24b1ee['where']=_[_0x458a('0x45')](_0x24b1ee[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x24b1ee[_0x458a('0x3c')],function(_0x4ff826){var _0xbb80ab={};_0xbb80ab[_0x4ff826]={'$like':'%'+_0x555190[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0xbb80ab;})});}_0x24b1ee=_[_0x458a('0x45')]({},_0x24b1ee,_0x555190[_0x458a('0x47')]);return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})[_0x458a('0x29')](function(_0xd05241){if(_0xd05241){_0x333d74=_0xd05241[_0x458a('0x3e')];if(!_0x555190[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x24b1ee[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x555190[_0x458a('0x39')][_0x458a('0x23')]);_0x24b1ee[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x555190[_0x458a('0x39')]['offset']);}return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})['then'](function(_0x165b0d){if(_0x165b0d){return _0x165b0d?{'count':_0x333d74,'rows':_0x165b0d}:null;}})[_0x458a('0x29')](respondWithResult(_0x11ebe7,null))[_0x458a('0x50')](handleError(_0x11ebe7,null));};exports['addTeams']=function(_0x589496,_0x4ee34,_0x1c9f4c){var _0x241c72=_0x589496[_0x458a('0x74')][_0x458a('0x79')];var _0x53d065;return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x241c72},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id',_0x458a('0x30'),_0x458a('0x84'),_0x458a('0x85'),_0x458a('0x86')],'raw':!![]}]})[_0x458a('0x29')](function(_0x52b844){if(_0x52b844){_0x53d065=_0x52b844;var _0x3051d2=_['flatMap'](_0x52b844,function(_0x2e496b){var _0x442b4a=_0x2e496b[_0x458a('0x2b')]({'plain':!![]});return _0x442b4a['Agents'];});return db['VoicePrefix'][_0x458a('0x4f')]({'where':{'id':_0x589496['params']['id']}})[_0x458a('0x29')](function(_0x5d97cc){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x1b8558){return _0x5d97cc['addTeams'](_0x241c72,{'transaction':_0x1b8558})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x53d065,function(_0x5dbeed){return db[_0x458a('0x88')]['upsert']({'TeamId':_0x5dbeed['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},{'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x3051d2,function(_0x49bdfc){return db[_0x458a('0x89')][_0x458a('0x8a')]({'where':{'UserId':_0x49bdfc['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){_0x3051d2[_0x458a('0x8b')](function(_0x477402){socket['emit'](_0x458a('0x7b'),{'UserId':_0x477402['id'],'VoicePrefixId':_0x5d97cc['id']});});});});});}})[_0x458a('0x29')](respondWithStatusCode(_0x4ee34,null))['catch'](handleError(_0x4ee34,null));};exports[_0x458a('0x8c')]=function(_0x187bc8,_0x197858,_0x48622f){return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x187bc8[_0x458a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id'],'raw':!![]}]})[_0x458a('0x29')](handleEntityNotFound(_0x197858,null))[_0x458a('0x29')](function(_0x2334f3){var _0x46bfc7=_[_0x458a('0x33')](_0x2334f3,'id');var _0x43cb92=[];var _0x5c42a4=[];var _0x3c3c7b=squel['select']();_0x3c3c7b['field'](_0x458a('0x8d'))[_0x458a('0x8e')]('team_has_voice_prefixes','tq')[_0x458a('0x8f')]('user_has_teams','ut',_0x458a('0x90'))['where'](_0x458a('0x91'),_0x187bc8[_0x458a('0x4c')]['id']);for(var _0x20ad0b=0x0;_0x20ad0b<_0x2334f3[_0x458a('0x3e')];_0x20ad0b+=0x1){let _0x55eab3=_0x2334f3[_0x20ad0b];for(var _0x4677a6=0x0;_0x4677a6<_0x55eab3[_0x458a('0x83')][_0x458a('0x3e')];_0x4677a6+=0x1){let _0x4df0b4=_0x55eab3[_0x458a('0x83')][_0x4677a6];var _0xfd1b68=_0x3c3c7b[_0x458a('0x92')]();_0xfd1b68[_0x458a('0x43')]('ut.UserId\x20=\x20?',_0x4df0b4['id']);_0x5c42a4[_0x458a('0x6a')](db['sequelize']['query'](_0xfd1b68['toString'](),{'type':db[_0x458a('0x53')][_0x458a('0x93')]['SELECT']})[_0x458a('0x29')](function(_0x49297c){if(_0x49297c[_0x458a('0x3e')]===0x1){return _0x4df0b4['id'];}else{var _0x4bfd6b=_[_0x458a('0x94')](_['map'](_0x49297c,_0x458a('0x95')),function(_0x3c9685){return _[_0x458a('0x96')](_0x46bfc7,_0x3c9685);});if(_0x4bfd6b){return _0x4df0b4['id'];}}}));}}return BPromise[_0x458a('0x97')](_0x5c42a4)[_0x458a('0x29')](function(_0x2e24aa){_0x43cb92=_(_0x43cb92)[_0x458a('0x98')](_0x2e24aa)['compact']()[_0x458a('0x99')]();return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x187bc8['params']['id']}})['then'](function(_0x334129){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x330330){return _0x334129[_0x458a('0x8c')](_0x187bc8['query'][_0x458a('0x79')],{'transaction':_0x330330})[_0x458a('0x29')](function(){if(!_[_0x458a('0x9a')](_0x43cb92)){return _0x334129[_0x458a('0x7c')](_0x43cb92,{'transaction':_0x330330});}})[_0x458a('0x29')](function(){_0x43cb92['forEach'](function(_0x16a747){socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':_0x16a747,'VoicePrefixId':_0x334129['id']});});});});});});})[_0x458a('0x29')](respondWithStatusCode(_0x197858,null))[_0x458a('0x50')](handleError(_0x197858,null));}; \ No newline at end of file +var _0xc900=['voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VoicePrefix','includeAll','include','findAll','show','params','options','catch','destroy','find','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','context','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','update','system-','sequelize','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','Team','getTeams','addTeams','Agents'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xc900,0xb3));var _0x0c90=function(_0x159683,_0x2a8ca9){_0x159683=_0x159683-0x0;var _0x4ed2c0=_0xc900[_0x159683];return _0x4ed2c0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];config['redis']=_[_0x0c90('0x19')](config[_0x0c90('0x1a')],{'host':_0x0c90('0x1b'),'port':0x18eb});var socket=require(_0x0c90('0x1c'))(new Redis(config[_0x0c90('0x1a')]));require('./voicePrefix.socket')[_0x0c90('0x1d')](socket);function respondWithStatusCode(_0x4451e0,_0x4f35f4){_0x4f35f4=_0x4f35f4||0xcc;return function(_0x2c82a4){if(_0x2c82a4){return _0x4451e0[_0x0c90('0x1e')](_0x4f35f4);}return _0x4451e0[_0x0c90('0x1f')](_0x4f35f4)['end']();};}function respondWithResult(_0x5daeb7,_0x412635){_0x412635=_0x412635||0xc8;return function(_0x15ca42){if(_0x15ca42){return _0x5daeb7[_0x0c90('0x1f')](_0x412635)[_0x0c90('0x20')](_0x15ca42);}};}function respondWithFilteredResult(_0x276b92,_0x2cab22){return function(_0x42321a){if(_0x42321a){var _0x57b9a6=typeof _0x2cab22[_0x0c90('0x21')]===_0x0c90('0x22')&&typeof _0x2cab22[_0x0c90('0x23')]===_0x0c90('0x22');var _0x594267=_0x42321a[_0x0c90('0x24')];var _0xd129ca=_0x57b9a6?0x0:_0x2cab22[_0x0c90('0x21')];var _0x1241a9=_0x57b9a6?_0x42321a[_0x0c90('0x24')]:_0x2cab22[_0x0c90('0x21')]+_0x2cab22['limit'];var _0x365a42;if(_0x1241a9>=_0x594267){_0x1241a9=_0x594267;_0x365a42=0xc8;}else{_0x365a42=0xce;}_0x276b92['status'](_0x365a42);return _0x276b92[_0x0c90('0x25')](_0x0c90('0x26'),_0xd129ca+'-'+_0x1241a9+'/'+_0x594267)['json'](_0x42321a);}return null;};}function patchUpdates(_0x2a053a){return function(_0x43ddc3){try{jsonpatch[_0x0c90('0x27')](_0x43ddc3,_0x2a053a,!![]);}catch(_0x86dee){return BPromise[_0x0c90('0x28')](_0x86dee);}return _0x43ddc3[_0x0c90('0x29')]();};}function saveUpdates(_0x4dfbc3,_0x26f0a3){return function(_0x12f22c){if(_0x12f22c){return _0x12f22c['update'](_0x4dfbc3)['then'](function(_0x28d005){return _0x28d005;});}return null;};}function removeEntity(_0x3ea861,_0x35c243){return function(_0x109a5f){if(_0x109a5f){return _0x109a5f['destroy']()[_0x0c90('0x2a')](function(){var _0x438652=_0x109a5f[_0x0c90('0x2b')]({'plain':!![]});var _0x277d4a=_0x0c90('0x2c');return db[_0x0c90('0x2d')]['destroy']({'where':{'type':_0x277d4a,'resourceId':_0x438652['id']}})[_0x0c90('0x2a')](function(){return _0x109a5f;});})[_0x0c90('0x2a')](function(){_0x3ea861[_0x0c90('0x1f')](0xcc)[_0x0c90('0x2e')]();});}};}function handleEntityNotFound(_0x52d28d,_0x4c8603){return function(_0x1f27f1){if(!_0x1f27f1){_0x52d28d[_0x0c90('0x1e')](0x194);}return _0x1f27f1;};}function handleError(_0x3bff04,_0x122a4f){_0x122a4f=_0x122a4f||0x1f4;return function(_0x119e09){logger['error'](_0x119e09[_0x0c90('0x2f')]);if(_0x119e09[_0x0c90('0x30')]){delete _0x119e09[_0x0c90('0x30')];}_0x3bff04['status'](_0x122a4f)[_0x0c90('0x31')](_0x119e09);};}exports['index']=function(_0x54a3f5,_0x886634){var _0x5071b={},_0x2f0835={},_0x41189f={'count':0x0,'rows':[]};var _0x58c01a=_[_0x0c90('0x32')](db['VoicePrefix'][_0x0c90('0x33')],function(_0x5a0e75){return{'name':_0x5a0e75[_0x0c90('0x34')],'type':_0x5a0e75[_0x0c90('0x35')]['key']};});_0x2f0835[_0x0c90('0x36')]=_[_0x0c90('0x32')](_0x58c01a,_0x0c90('0x30'));_0x2f0835[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x54a3f5[_0x0c90('0x37')]);_0x2f0835[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x2f0835['model'],_0x2f0835[_0x0c90('0x37')]);_0x5071b[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x2f0835[_0x0c90('0x36')],qs['fields'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x5071b[_0x0c90('0x3b')]=_0x5071b[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x5071b[_0x0c90('0x3b')]:_0x2f0835[_0x0c90('0x36')];if(!_0x54a3f5[_0x0c90('0x37')]['hasOwnProperty'](_0x0c90('0x3e'))){_0x5071b[_0x0c90('0x23')]=qs['limit'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x23')]);_0x5071b[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x54a3f5[_0x0c90('0x37')]['offset']);}_0x5071b[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x40')]);_0x5071b[_0x0c90('0x41')]=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x54a3f5[_0x0c90('0x37')],_0x2f0835[_0x0c90('0x39')]),_0x58c01a);if(_0x54a3f5['query'][_0x0c90('0x43')]){_0x5071b['where']=_[_0x0c90('0x44')](_0x5071b['where'],{'$or':_[_0x0c90('0x32')](_0x58c01a,function(_0x62e316){if(_0x62e316['type']!=='VIRTUAL'){var _0x27ef6f={};_0x27ef6f[_0x62e316['name']]={'$like':'%'+_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x27ef6f;}})});}_0x5071b=_[_0x0c90('0x44')]({},_0x5071b,_0x54a3f5['options']);var _0x2ad8eb={'where':_0x5071b[_0x0c90('0x41')]};return db[_0x0c90('0x45')][_0x0c90('0x24')](_0x2ad8eb)[_0x0c90('0x2a')](function(_0x1184c4){_0x41189f['count']=_0x1184c4;if(_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x46')]){_0x5071b[_0x0c90('0x47')]=[{'all':!![]}];}return db[_0x0c90('0x45')][_0x0c90('0x48')](_0x5071b);})[_0x0c90('0x2a')](function(_0x30b9df){_0x41189f['rows']=_0x30b9df;return _0x41189f;})[_0x0c90('0x2a')](respondWithFilteredResult(_0x886634,_0x5071b))['catch'](handleError(_0x886634,null));};exports[_0x0c90('0x49')]=function(_0x2470ce,_0x1a7a36){var _0x1179b0={'raw':![],'where':{'id':_0x2470ce[_0x0c90('0x4a')]['id']}},_0x38842c={};_0x38842c[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x45')][_0x0c90('0x33')]);_0x38842c[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2470ce[_0x0c90('0x37')]);_0x38842c[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x38842c['model'],_0x38842c[_0x0c90('0x37')]);_0x1179b0[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x38842c[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x2470ce[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x1179b0[_0x0c90('0x3b')]=_0x1179b0[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x1179b0[_0x0c90('0x3b')]:_0x38842c[_0x0c90('0x36')];if(_0x2470ce[_0x0c90('0x37')][_0x0c90('0x46')]){_0x1179b0['include']=[{'all':!![]}];}_0x1179b0=_[_0x0c90('0x44')]({},_0x1179b0,_0x2470ce[_0x0c90('0x4b')]);return db['VoicePrefix']['find'](_0x1179b0)['then'](handleEntityNotFound(_0x1a7a36,null))[_0x0c90('0x2a')](respondWithResult(_0x1a7a36,null))[_0x0c90('0x4c')](handleError(_0x1a7a36,null));};exports[_0x0c90('0x4d')]=function(_0x3fbdfc,_0x11d2de){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x3fbdfc[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x11d2de,null))['then'](removeEntity(_0x11d2de,null))[_0x0c90('0x4c')](handleError(_0x11d2de,null));};exports[_0x0c90('0x4f')]=function(_0xd639a1,_0xb483e7){return db[_0x0c90('0x45')][_0x0c90('0x4f')]()[_0x0c90('0x2a')](respondWithResult(_0xb483e7,null))[_0x0c90('0x4c')](handleError(_0xb483e7,null));};exports[_0x0c90('0x50')]=function(_0xeeee3b,_0x5e288e){var _0xac80b2;return db['sequelize'][_0x0c90('0x51')](function(_0x67539d){return db[_0x0c90('0x45')][_0x0c90('0x50')](_0xeeee3b[_0x0c90('0x52')],{'transaction':_0x67539d})[_0x0c90('0x2a')](function(_0x58dcfc){_0xac80b2=_0x58dcfc['get']({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xac80b2[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x3bf5de){return createVoicePrefixExtensions(_0xac80b2,_0x3bf5de,_0x67539d);});});})['then'](function(){var _0x202666=_0xeeee3b[_0x0c90('0x54')]['get']({'plain':!![]});if(!_0x202666)throw new Error(_0x0c90('0x55'));if(_0x202666['role']===_0x0c90('0x54')){var _0x8951f2=_0xac80b2;return db[_0x0c90('0x56')][_0x0c90('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x202666[_0x0c90('0x57')]},'raw':!![]})['then'](function(_0x344613){if(_0x344613&&_0x344613[_0x0c90('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x8951f2['name'],'resourceId':_0x8951f2['id'],'type':_0x344613[_0x0c90('0x30')],'sectionId':_0x344613['id']},{})[_0x0c90('0x2a')](function(){return _0xac80b2;});}else{return _0xac80b2;}})[_0x0c90('0x4c')](function(_0x2f61cb){logger[_0x0c90('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f61cb);throw _0x2f61cb;});}return _0xac80b2;})[_0x0c90('0x2a')](respondWithResult(_0x5e288e,null))[_0x0c90('0x4c')](handleError(_0x5e288e,null));};function Extension(_0x5ee971,_0x3eb725,_0x5a11e5,_0x24326b){this[_0x0c90('0x5a')]='from-sip';this[_0x0c90('0x5b')]=_0x5ee971;this['app']=_0x5a11e5;this['type']='system';this[_0x0c90('0x5c')]=_0x0c90('0x5d');this[_0x0c90('0x5e')]=_0x3eb725;this[_0x0c90('0x5f')]=_0x24326b;}function createVoicePrefixExtensions(_0x536a26,_0x5b385b,_0x426f65){return new BPromise(function(_0xd982c5,_0x120b88){var _0x4c4e5a=new Extension(formatPrefixName(_0x536a26[_0x0c90('0x60')]),0x1,_0x0c90('0x61'),_0x0c90('0x62'));_0x4c4e5a['VoicePrefixId']=_0x536a26['id'];return db[_0x0c90('0x63')][_0x0c90('0x50')](_0x4c4e5a,{'transaction':_0x426f65})[_0x0c90('0x2a')](function(_0x521436){var _0x31343b=_0x521436[_0x0c90('0x2b')]({'plain':!![]});var _0x1a198b=_[_0x0c90('0x32')](addVoicePrefixExtensions(_0x536a26,_0x5b385b),function(_0xf58a25){_0xf58a25[_0x0c90('0x53')]=_0x31343b['id'];_0xf58a25[_0x0c90('0x64')]=_0x536a26['id'];return _0xf58a25;});return db[_0x0c90('0x63')][_0x0c90('0x65')](_0x1a198b,{'transaction':_0x426f65})['then'](function(_0x530bbe){if(!_0x530bbe){return _0x120b88(_0x0c90('0x66'));}else{return _0xd982c5(_0x530bbe);}})[_0x0c90('0x4c')](function(_0x3a44df){return _0x120b88(_0x3a44df);});});;});};function addVoicePrefixExtensions(_0x2faf14,_0x19dae5){var _0x2dad30=[];var _0x2f1459=formatPrefixName(_0x2faf14[_0x0c90('0x60')]);_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x2,_0x0c90('0x68'),_0x0c90('0x69')+_0x2faf14[_0x0c90('0x30')]));if(_0x2faf14[_0x0c90('0x6a')]){_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x68'),'PREFIX-CALLERIDALL='+_0x2faf14[_0x0c90('0x6a')]));}else{_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x61'),'No\x20callerid\x20available'));}_0x2dad30['push'](new Extension(_0x2f1459,0x4,_0x0c90('0x6b'),_0x19dae5['context']+','+_0x0c90('0x6c')+(0x8+_0x2faf14[_0x0c90('0x30')]['length'])+'}'+','+0x1));return _0x2dad30;}function formatPrefixName(_0x2c64e0){var _0x3f4819='_';for(var _0x25ef97=0x0;_0x25ef97<_0x2c64e0[_0x0c90('0x3d')];_0x25ef97++){if(_0x2c64e0['charAt'](_0x25ef97)=='-'){_0x3f4819+=_0x2c64e0['charAt'](_0x25ef97);}else{_0x3f4819+='['+_0x2c64e0['charAt'](_0x25ef97)+']';}}_0x3f4819+='.';return _0x3f4819;}exports[_0x0c90('0x6d')]=function(_0x2d3287,_0x3bc90d,_0x2d5fe3){var _0x4a801f=_0x2d3287[_0x0c90('0x52')];_0x4a801f['prefix']=_0x0c90('0x6e')+_0x4a801f[_0x0c90('0x30')]+'-';return db[_0x0c90('0x6f')]['transaction'](function(_0x10f686){return db[_0x0c90('0x45')][_0x0c90('0x6d')](_0x4a801f,{'where':{'id':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension'][_0x0c90('0x4e')]({'where':{'id':_0x4a801f[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x4a59b5){return createVoicePrefixExtensions(_0x4a801f,_0x4a59b5,_0x10f686);});});});})[_0x0c90('0x2a')](function(){return db[_0x0c90('0x45')][_0x0c90('0x70')](_0x4a801f['id']);})[_0x0c90('0x2a')](respondWithResult(_0x3bc90d,null))[_0x0c90('0x4c')](handleError(_0x3bc90d,null));};exports[_0x0c90('0x71')]=function(_0x53779b,_0x28a2f0,_0x431828){return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x53779b[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x28a2f0,null))[_0x0c90('0x2a')](function(_0x1777ac){if(_0x1777ac){return _0x1777ac[_0x0c90('0x71')](_0x53779b[_0x0c90('0x52')]['ids'],_[_0x0c90('0x72')](_0x53779b[_0x0c90('0x52')],[_0x0c90('0x73'),'id'])||{})[_0x0c90('0x74')](function(_0x4e8330){for(var _0x2e68ea=0x0;_0x2e68ea<_0x53779b[_0x0c90('0x52')][_0x0c90('0x73')]['length'];_0x2e68ea+=0x1){socket[_0x0c90('0x75')](_0x0c90('0x76'),{'UserId':Number(_0x53779b['body'][_0x0c90('0x73')][_0x2e68ea]),'VoicePrefixId':Number(_0x53779b['params']['id'])});}return _0x4e8330;});}})[_0x0c90('0x2a')](respondWithResult(_0x28a2f0,null))['catch'](handleError(_0x28a2f0,null));};exports['removeAgents']=function(_0x42e76a,_0x137c30,_0x56a38b){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x42e76a[_0x0c90('0x4a')]['id']}})['then'](handleEntityNotFound(_0x137c30,null))['then'](function(_0x250d41){if(_0x250d41){return _0x250d41['removeAgents'](_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')])[_0x0c90('0x2a')](function(){if(_[_0x0c90('0x77')](_0x42e76a[_0x0c90('0x37')]['ids'])){for(var _0x471caa=0x0;_0x471caa<_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')]['length'];_0x471caa+=0x1){socket['emit'](_0x0c90('0x78'),{'UserId':Number(_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')][_0x471caa]),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x42e76a[_0x0c90('0x37')]['ids']),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x137c30,null))['catch'](handleError(_0x137c30,null));};exports[_0x0c90('0x79')]=function(_0x2ca017,_0x1bf6e0,_0x29ede1){var _0x16c383={};var _0x56a3bc={};var _0x5562cc;var _0x57eab8;return db[_0x0c90('0x45')][_0x0c90('0x7a')]({'where':{'id':_0x2ca017[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x1bf6e0,null))[_0x0c90('0x2a')](function(_0x3d5521){if(_0x3d5521){_0x5562cc=_0x3d5521;_0x56a3bc['model']=_[_0x0c90('0x38')](db[_0x0c90('0x7b')][_0x0c90('0x33')]);_0x56a3bc[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2ca017[_0x0c90('0x37')]);_0x56a3bc[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x56a3bc[_0x0c90('0x36')],_0x56a3bc[_0x0c90('0x37')]);_0x16c383[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x56a3bc['model'],qs[_0x0c90('0x3c')](_0x2ca017['query'][_0x0c90('0x3c')]));_0x16c383['attributes']=_0x16c383[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x16c383[_0x0c90('0x3b')]:_0x56a3bc[_0x0c90('0x36')];_0x16c383['order']=qs['sort'](_0x2ca017[_0x0c90('0x37')][_0x0c90('0x40')]);_0x16c383['where']=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x2ca017['query'],_0x56a3bc[_0x0c90('0x39')]));if(_0x2ca017[_0x0c90('0x37')]['filter']){_0x16c383[_0x0c90('0x41')]=_['merge'](_0x16c383[_0x0c90('0x41')],{'$or':_[_0x0c90('0x32')](_0x16c383[_0x0c90('0x3b')],function(_0x1b95db){var _0x519f74={};_0x519f74[_0x1b95db]={'$like':'%'+_0x2ca017[_0x0c90('0x37')]['filter']+'%'};return _0x519f74;})});}_0x16c383=_[_0x0c90('0x44')]({},_0x16c383,_0x2ca017[_0x0c90('0x4b')]);return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})[_0x0c90('0x2a')](function(_0x1306bb){if(_0x1306bb){_0x57eab8=_0x1306bb['length'];if(!_0x2ca017[_0x0c90('0x37')][_0x0c90('0x7c')](_0x0c90('0x3e'))){_0x16c383[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x2ca017[_0x0c90('0x37')]['limit']);_0x16c383[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x2ca017['query'][_0x0c90('0x21')]);}return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})['then'](function(_0x199d05){if(_0x199d05){return _0x199d05?{'count':_0x57eab8,'rows':_0x199d05}:null;}})[_0x0c90('0x2a')](respondWithResult(_0x1bf6e0,null))['catch'](handleError(_0x1bf6e0,null));};exports['getTeams']=function(_0x13c69c,_0x407c6e,_0x4859e9){var _0x391e3f={};var _0x4fee0e={};var _0x37d1d5;var _0x4c142b;return db['VoicePrefix'][_0x0c90('0x7a')]({'where':{'id':_0x13c69c[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x407c6e,null))['then'](function(_0x54846c){if(_0x54846c){_0x37d1d5=_0x54846c;_0x4fee0e[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x7d')][_0x0c90('0x33')]);_0x4fee0e[_0x0c90('0x37')]=_['keys'](_0x13c69c[_0x0c90('0x37')]);_0x4fee0e['filters']=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],_0x4fee0e[_0x0c90('0x37')]);_0x391e3f[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x13c69c['query']['fields']));_0x391e3f[_0x0c90('0x3b')]=_0x391e3f[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x391e3f[_0x0c90('0x3b')]:_0x4fee0e[_0x0c90('0x36')];_0x391e3f[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x13c69c[_0x0c90('0x37')]['sort']);_0x391e3f[_0x0c90('0x41')]=qs['filters'](_[_0x0c90('0x42')](_0x13c69c[_0x0c90('0x37')],_0x4fee0e[_0x0c90('0x39')]));if(_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]){_0x391e3f[_0x0c90('0x41')]=_[_0x0c90('0x44')](_0x391e3f['where'],{'$or':_['map'](_0x391e3f[_0x0c90('0x3b')],function(_0x4a001d){var _0x2204fe={};_0x2204fe[_0x4a001d]={'$like':'%'+_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x2204fe;})});}_0x391e3f=_['merge']({},_0x391e3f,_0x13c69c[_0x0c90('0x4b')]);return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x30be13){if(_0x30be13){_0x4c142b=_0x30be13[_0x0c90('0x3d')];if(!_0x13c69c['query']['hasOwnProperty'](_0x0c90('0x3e'))){_0x391e3f[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x23')]);_0x391e3f[_0x0c90('0x21')]=qs['offset'](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x21')]);}return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x5103ae){if(_0x5103ae){return _0x5103ae?{'count':_0x4c142b,'rows':_0x5103ae}:null;}})['then'](respondWithResult(_0x407c6e,null))[_0x0c90('0x4c')](handleError(_0x407c6e,null));};exports[_0x0c90('0x7f')]=function(_0x59e8d9,_0x9bed36,_0x379a0e){var _0x19a144=_0x59e8d9[_0x0c90('0x52')][_0x0c90('0x73')];var _0x5379bc;return db[_0x0c90('0x7d')]['findAll']({'where':{'id':_0x19a144},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id',_0x0c90('0x30'),'online',_0x0c90('0x81'),_0x0c90('0x82')],'raw':!![]}]})[_0x0c90('0x2a')](function(_0x5f295e){if(_0x5f295e){_0x5379bc=_0x5f295e;var _0x5a2961=_['flatMap'](_0x5f295e,function(_0x4930cd){var _0x2858a9=_0x4930cd[_0x0c90('0x2b')]({'plain':!![]});return _0x2858a9['Agents'];});return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x59e8d9['params']['id']}})[_0x0c90('0x2a')](function(_0x13c0f2){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x1091fb){return _0x13c0f2['addTeams'](_0x19a144,{'transaction':_0x1091fb})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5379bc,function(_0x35ee25){return db[_0x0c90('0x84')][_0x0c90('0x85')]({'TeamId':_0x35ee25['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},{'transaction':_0x1091fb});});})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5a2961,function(_0x3614d1){return db[_0x0c90('0x86')]['findOrCreate']({'where':{'UserId':_0x3614d1['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},'transaction':_0x1091fb});});})['then'](function(){_0x5a2961[_0x0c90('0x87')](function(_0x40dd25){socket[_0x0c90('0x75')]('userVoicePrefix:save',{'UserId':_0x40dd25['id'],'VoicePrefixId':_0x13c0f2['id']});});});});});}})[_0x0c90('0x2a')](respondWithStatusCode(_0x9bed36,null))['catch'](handleError(_0x9bed36,null));};exports[_0x0c90('0x88')]=function(_0x1c2814,_0x2f542b,_0x3f3787){return db[_0x0c90('0x7d')][_0x0c90('0x48')]({'where':{'id':_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')]},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f542b,null))[_0x0c90('0x2a')](function(_0x31dde9){var _0x37acdc=_['map'](_0x31dde9,'id');var _0x5f431d=[];var _0x2dabe6=[];var _0x28736e=squel['select']();_0x28736e['field'](_0x0c90('0x89'))[_0x0c90('0x8a')]('team_has_voice_prefixes','tq')[_0x0c90('0x8b')](_0x0c90('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0c90('0x41')](_0x0c90('0x8d'),_0x1c2814['params']['id']);for(var _0x1fb55a=0x0;_0x1fb55a<_0x31dde9['length'];_0x1fb55a+=0x1){let _0x5aa532=_0x31dde9[_0x1fb55a];for(var _0x8e8e30=0x0;_0x8e8e30<_0x5aa532[_0x0c90('0x80')]['length'];_0x8e8e30+=0x1){let _0x5c942d=_0x5aa532[_0x0c90('0x80')][_0x8e8e30];var _0x155915=_0x28736e[_0x0c90('0x8e')]();_0x155915[_0x0c90('0x41')](_0x0c90('0x8f'),_0x5c942d['id']);_0x2dabe6['push'](db[_0x0c90('0x6f')][_0x0c90('0x37')](_0x155915[_0x0c90('0x90')](),{'type':db[_0x0c90('0x6f')][_0x0c90('0x91')][_0x0c90('0x92')]})['then'](function(_0x18cc89){if(_0x18cc89['length']===0x1){return _0x5c942d['id'];}else{var _0x5e6e8f=_['every'](_[_0x0c90('0x32')](_0x18cc89,_0x0c90('0x93')),function(_0x53c760){return _[_0x0c90('0x94')](_0x37acdc,_0x53c760);});if(_0x5e6e8f){return _0x5c942d['id'];}}}));}}return BPromise['all'](_0x2dabe6)['then'](function(_0x22b3df){_0x5f431d=_(_0x5f431d)[_0x0c90('0x95')](_0x22b3df)[_0x0c90('0x96')]()[_0x0c90('0x97')]();return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x1c2814[_0x0c90('0x4a')]['id']}})['then'](function(_0x2eece9){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x3817a4){return _0x2eece9[_0x0c90('0x88')](_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')],{'transaction':_0x3817a4})[_0x0c90('0x2a')](function(){if(!_[_0x0c90('0x98')](_0x5f431d)){return _0x2eece9[_0x0c90('0x99')](_0x5f431d,{'transaction':_0x3817a4});}})[_0x0c90('0x2a')](function(){_0x5f431d[_0x0c90('0x87')](function(_0x9187af){socket[_0x0c90('0x75')]('userVoicePrefix:remove',{'UserId':_0x9187af,'VoicePrefixId':_0x2eece9['id']});});});});});});})[_0x0c90('0x2a')](respondWithStatusCode(_0x2f542b,null))[_0x0c90('0x4c')](handleError(_0x2f542b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0d6b930..6a154c7 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 _0x7757=['save','update','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3c61a2,_0x51e7eb){var _0x1a0f03=function(_0x451fd2){while(--_0x451fd2){_0x3c61a2['push'](_0x3c61a2['shift']());}};_0x1a0f03(++_0x51e7eb);}(_0x7757,0x12a));var _0x7775=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x7757[_0x47e7cb];return _0x2a8874;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x7775('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7775('0x1')](0x0);var events={'afterCreate':_0x7775('0x2'),'afterUpdate':_0x7775('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5b1529){return function(_0x6aa140,_0x5d72dd,_0x477451){VoicePrefixEvents['emit'](_0x5b1529+':'+_0x6aa140['id'],_0x6aa140);VoicePrefixEvents['emit'](_0x5b1529,_0x6aa140);_0x477451(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7775('0x4')](e,emitEvent(event));}}module[_0x7775('0x5')]=VoicePrefixEvents; \ No newline at end of file +var _0x6d74=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0xf0c4b6,_0x48163b){var _0x7e5152=function(_0x4672ef){while(--_0x4672ef){_0xf0c4b6['push'](_0xf0c4b6['shift']());}};_0x7e5152(++_0x48163b);}(_0x6d74,0x18d));var _0x46d7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6d74[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x46d7('0x0'));var VoicePrefix=require(_0x46d7('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x46d7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x46d7('0x3'),'afterDestroy':_0x46d7('0x4')};function emitEvent(_0x33ca44){return function(_0x1f0fe5,_0x3fe40c,_0xcd8353){VoicePrefixEvents[_0x46d7('0x5')](_0x33ca44+':'+_0x1f0fe5['id'],_0x1f0fe5);VoicePrefixEvents[_0x46d7('0x5')](_0x33ca44,_0x1f0fe5);_0xcd8353(null);};}for(var e in events){if(events[_0x46d7('0x6')](e)){var event=events[e];VoicePrefix[_0x46d7('0x7')](e,emitEvent(event));}}module[_0x46d7('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 9c01c38..fc81939 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 _0x6b36=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3beea0,_0x416691){var _0x314eb1=function(_0x937185){while(--_0x937185){_0x3beea0['push'](_0x3beea0['shift']());}};_0x314eb1(++_0x416691);}(_0x6b36,0x89));var _0x66b3=function(_0x1428c2,_0x21cb2d){_0x1428c2=_0x1428c2-0x0;var _0x1ad3a1=_0x6b36[_0x1428c2];return _0x1ad3a1;};'use strict';var _=require(_0x66b3('0x0'));var util=require(_0x66b3('0x1'));var logger=require(_0x66b3('0x2'))(_0x66b3('0x3'));var moment=require(_0x66b3('0x4'));var BPromise=require(_0x66b3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66b3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x66b3('0x7'));module[_0x66b3('0x8')]=function(_0x879289,_0x56d7d0){return _0x879289[_0x66b3('0x9')](_0x66b3('0xa'),attributes,{'tableName':_0x66b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc289=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','util'];(function(_0x22303a,_0x5f3cb9){var _0x5c485e=function(_0x1f9f2a){while(--_0x1f9f2a){_0x22303a['push'](_0x22303a['shift']());}};_0x5c485e(++_0x5f3cb9);}(_0xc289,0x1a3));var _0x9c28=function(_0x28abf0,_0x37f9e5){_0x28abf0=_0x28abf0-0x0;var _0x4e63aa=_0xc289[_0x28abf0];return _0x4e63aa;};'use strict';var _=require('lodash');var util=require(_0x9c28('0x0'));var logger=require(_0x9c28('0x1'))('api');var moment=require(_0x9c28('0x2'));var BPromise=require(_0x9c28('0x3'));var rp=require(_0x9c28('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c28('0x5'));var config=require(_0x9c28('0x6'));var attributes=require(_0x9c28('0x7'));module[_0x9c28('0x8')]=function(_0x10e9af,_0x507122){return _0x10e9af['define'](_0x9c28('0x9'),attributes,{'tableName':'voice_prefixes','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 998b446..d7fd571 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 _0x6fad=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x30fe0f,_0x558c65){var _0x4910c0=function(_0x3fef6d){while(--_0x3fef6d){_0x30fe0f['push'](_0x30fe0f['shift']());}};_0x4910c0(++_0x558c65);}(_0x6fad,0x17a));var _0xd6fa=function(_0xa43518,_0x2a4c6b){_0xa43518=_0xa43518-0x0;var _0x5e9b94=_0x6fad[_0xa43518];return _0x5e9b94;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));var BPromise=require(_0xd6fa('0x3'));var rs=require(_0xd6fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6fa('0x6'))('rpc');var config=require(_0xd6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6fa('0x8')][_0xd6fa('0x9')]({'port':0x232a});config[_0xd6fa('0xa')]=_[_0xd6fa('0xb')](config[_0xd6fa('0xa')],{'host':_0xd6fa('0xc'),'port':0x18eb});var socket=require(_0xd6fa('0xd'))(new Redis(config['redis']));require(_0xd6fa('0xe'))['register'](socket);function respondWithRpcPromise(_0x1f7672,_0x23cb2b,_0x41a335){return new BPromise(function(_0x1cc80c,_0x31286a){return client['request'](_0x1f7672,_0x41a335)['then'](function(_0x28f2e6){logger[_0xd6fa('0xf')](_0xd6fa('0x10'),_0x23cb2b,'request\x20sent');logger[_0xd6fa('0x11')](_0xd6fa('0x12'),_0x23cb2b,_0xd6fa('0x13'),JSON[_0xd6fa('0x14')](_0x28f2e6));if(_0x28f2e6[_0xd6fa('0x15')]){if(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x16')]===0x1f4){logger['error'](_0xd6fa('0x10'),_0x23cb2b,_0x28f2e6['error']['message']);return _0x31286a(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x17')]);}logger['error'](_0xd6fa('0x10'),_0x23cb2b,_0x28f2e6[_0xd6fa('0x15')]['message']);return _0x1cc80c(_0x28f2e6[_0xd6fa('0x15')][_0xd6fa('0x17')]);}else{logger[_0xd6fa('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x23cb2b,_0xd6fa('0x13'));_0x1cc80c(_0x28f2e6['result'][_0xd6fa('0x17')]);}})[_0xd6fa('0x18')](function(_0x6a8922){logger[_0xd6fa('0x15')](_0xd6fa('0x10'),_0x23cb2b,_0x6a8922);_0x31286a(_0x6a8922);});});} \ No newline at end of file +var _0x3974=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0x293edb,_0x51b106){var _0x50e2ff=function(_0x5c1cee){while(--_0x5c1cee){_0x293edb['push'](_0x293edb['shift']());}};_0x50e2ff(++_0x51b106);}(_0x3974,0xbc));var _0x4397=function(_0x2868cc,_0x36c6da){_0x2868cc=_0x2868cc-0x0;var _0xc2eba1=_0x3974[_0x2868cc];return _0xc2eba1;};'use strict';var _=require(_0x4397('0x0'));var util=require(_0x4397('0x1'));var moment=require(_0x4397('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4397('0x3'));var db=require(_0x4397('0x4'))['db'];var utils=require(_0x4397('0x5'));var logger=require(_0x4397('0x6'))(_0x4397('0x7'));var config=require('../../config/environment');var jayson=require(_0x4397('0x8'));var client=jayson[_0x4397('0x9')][_0x4397('0xa')]({'port':0x232a});config[_0x4397('0xb')]=_['defaults'](config[_0x4397('0xb')],{'host':_0x4397('0xc'),'port':0x18eb});var socket=require(_0x4397('0xd'))(new Redis(config[_0x4397('0xb')]));require('./voicePrefix.socket')[_0x4397('0xe')](socket);function respondWithRpcPromise(_0x26f0ab,_0x13a0e8,_0x54419f){return new BPromise(function(_0x47e207,_0x41d0da){return client[_0x4397('0xf')](_0x26f0ab,_0x54419f)[_0x4397('0x10')](function(_0x4afa76){logger[_0x4397('0x11')](_0x4397('0x12'),_0x13a0e8,_0x4397('0x13'));logger['debug'](_0x4397('0x14'),_0x13a0e8,_0x4397('0x13'),JSON[_0x4397('0x15')](_0x4afa76));if(_0x4afa76['error']){if(_0x4afa76[_0x4397('0x16')]['code']===0x1f4){logger[_0x4397('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x13a0e8,_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);return _0x41d0da(_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);}logger[_0x4397('0x16')](_0x4397('0x12'),_0x13a0e8,_0x4afa76['error'][_0x4397('0x17')]);return _0x47e207(_0x4afa76[_0x4397('0x16')][_0x4397('0x17')]);}else{logger[_0x4397('0x11')](_0x4397('0x12'),_0x13a0e8,_0x4397('0x13'));_0x47e207(_0x4afa76[_0x4397('0x18')][_0x4397('0x17')]);}})[_0x4397('0x19')](function(_0x5270d7){logger['error'](_0x4397('0x12'),_0x13a0e8,_0x5270d7);_0x41d0da(_0x5270d7);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 5e109c7..89aa8ce 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 _0x342b=['register','length','./voicePrefix.events','remove','update','removeListener'];(function(_0x40bf9e,_0x2d09cb){var _0x2ff911=function(_0x1821f3){while(--_0x1821f3){_0x40bf9e['push'](_0x40bf9e['shift']());}};_0x2ff911(++_0x2d09cb);}(_0x342b,0xbc));var _0xb342=function(_0x4c7a36,_0x25a18f){_0x4c7a36=_0x4c7a36-0x0;var _0x3b8dfc=_0x342b[_0x4c7a36];return _0x3b8dfc;};'use strict';var VoicePrefixEvents=require(_0xb342('0x0'));var events=['save',_0xb342('0x1'),_0xb342('0x2')];function createListener(_0x21d8fb,_0x586739){return function(_0x509812){_0x586739['emit'](_0x21d8fb,_0x509812);};}function removeListener(_0x5b7c7f,_0x1b1604){return function(){VoicePrefixEvents[_0xb342('0x3')](_0x5b7c7f,_0x1b1604);};}exports[_0xb342('0x4')]=function(_0x28bca8){for(var _0x25ecba=0x0,_0x2f6281=events[_0xb342('0x5')];_0x25ecba<_0x2f6281;_0x25ecba++){var _0x3c7ac7=events[_0x25ecba];var _0x54175e=createListener('voicePrefix:'+_0x3c7ac7,_0x28bca8);VoicePrefixEvents['on'](_0x3c7ac7,_0x54175e);}}; \ No newline at end of file +var _0xbf83=['remove','update','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0xbf83,0x11e));var _0x3bf8=function(_0xbd2dc5,_0x181bdd){_0xbd2dc5=_0xbd2dc5-0x0;var _0x40a997=_0xbf83[_0xbd2dc5];return _0x40a997;};'use strict';var VoicePrefixEvents=require(_0x3bf8('0x0'));var events=['save',_0x3bf8('0x1'),_0x3bf8('0x2')];function createListener(_0x3cbf10,_0x21c4ac){return function(_0x2b1141){_0x21c4ac['emit'](_0x3cbf10,_0x2b1141);};}function removeListener(_0x565784,_0x459aef){return function(){VoicePrefixEvents[_0x3bf8('0x3')](_0x565784,_0x459aef);};}exports[_0x3bf8('0x4')]=function(_0x251445){for(var _0x5be89b=0x0,_0x5b0c12=events[_0x3bf8('0x5')];_0x5be89b<_0x5b0c12;_0x5be89b++){var _0x2df7c9=events[_0x5be89b];var _0x4adc52=createListener(_0x3bf8('0x6')+_0x2df7c9,_0x251445);VoicePrefixEvents['on'](_0x2df7c9,_0x4adc52);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 9efbed2..bd7ebd9 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 _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(_0x1293f8,_0x4eb604){var _0x37457f=function(_0x52453c){while(--_0x52453c){_0x1293f8['push'](_0x1293f8['shift']());}};_0x37457f(++_0x4eb604);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 +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(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0xb10b,0x12a));var _0xbb10=function(_0x21ae22,_0x54911f){_0x21ae22=_0x21ae22-0x0;var _0x1e610a=_0xb10b[_0x21ae22];return _0x1e610a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 3c3dc70..986a831 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 _0x2bf0=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','inbound','outbound','default','STRING','ENUM','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','getDataValue','type','dialMethod','strategy','preview','booked','roundrobin','setDataValue','INTEGER','yes','all','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x5b3315,_0x3f14a3){var _0x5f33bb=function(_0x13669d){while(--_0x13669d){_0x5b3315['push'](_0x5b3315['shift']());}};_0x5f33bb(++_0x3f14a3);}(_0x2bf0,0x65));var _0x02bf=function(_0x59531c,_0x2ec7e8){_0x59531c=_0x59531c-0x0;var _0x1dac56=_0x2bf0[_0x59531c];return _0x1dac56;};'use strict';var Sequelize=require(_0x02bf('0x0'));module[_0x02bf('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x02bf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x02bf('0x3'),_0x02bf('0x4')),'allowNull':![],'defaultValue':_0x02bf('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x02bf('0x5')},'announce':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x02bf('0x7')]('rr',_0x02bf('0x8'),_0x02bf('0x9'),_0x02bf('0xa'),_0x02bf('0xb'),_0x02bf('0xc'),_0x02bf('0xd'),'wrandom',_0x02bf('0xe')),'allowNull':![],'defaultValue':_0x02bf('0x8'),'set':function(_0x181fdf){this['setDataValue']('strategy',_0x181fdf?_0x181fdf:_0x02bf('0xc'));},'get':function(){var _0x1ea219=this[_0x02bf('0xf')](_0x02bf('0x10'));var _0x562c2d=this['getDataValue'](_0x02bf('0x11'));var _0x49142d=this[_0x02bf('0xf')](_0x02bf('0x12'));if(_0x1ea219==='outbound'){if(_0x562c2d===_0x02bf('0x13')){return null;}if(_0x562c2d===_0x02bf('0x14')&&![_0x02bf('0xc'),_0x02bf('0x15')]['includes'](_0x49142d)){this[_0x02bf('0x16')](_0x02bf('0x12'),'rrmemory');}}return _0x49142d;}},'servicelevel':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x02bf('0x17')](0xb)},'timeout':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x02bf('0x6')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no',_0x02bf('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x02bf('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x02bf('0x7')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x02bf('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x02bf('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x02bf('0x18'),'no'),'defaultValue':_0x02bf('0x18')},'announce_holdtime':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x02bf('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x02bf('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x02bf('0x6')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x02bf('0x6')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x7ff90d){this[_0x02bf('0x16')](_0x02bf('0x1a'),_0x7ff90d?_0x7ff90d[_0x02bf('0x1b')](','):[]);},'get':function(){return this[_0x02bf('0xf')](_0x02bf('0x1a'))?this[_0x02bf('0xf')](_0x02bf('0x1a'))[_0x02bf('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':_0x02bf('0x18'),'set':function(_0xb06940){this['setDataValue'](_0x02bf('0x1d'),_0xb06940?_0xb06940['join'](','):undefined);},'get':function(){return this[_0x02bf('0xf')](_0x02bf('0x1d'))?this['getDataValue'](_0x02bf('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':'no','set':function(_0x3032cd){this['setDataValue'](_0x02bf('0x1e'),_0x3032cd?_0x3032cd[_0x02bf('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x02bf('0x1e'))?this[_0x02bf('0xf')](_0x02bf('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x02bf('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x02bf('0x6')]},'description':{'type':Sequelize[_0x02bf('0x6')]},'acw':{'type':Sequelize[_0x02bf('0x1f')],'defaultValue':0x0,'set':function(_0x171e6a){this[_0x02bf('0x16')](_0x02bf('0x20'),_0x171e6a);if(_0x171e6a){if(this[_0x02bf('0xf')](_0x02bf('0x21'))<0x2){this[_0x02bf('0x16')](_0x02bf('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x02bf('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x02bf('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x13'),_0x02bf('0x22'),_0x02bf('0x23'),_0x02bf('0x24'),_0x02bf('0x14')),'defaultValue':_0x02bf('0x22'),'comment':_0x02bf('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x02bf('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x02bf('0x17')](0x4)[_0x02bf('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x02bf('0x27')},'dialPowerLevel':{'type':Sequelize[_0x02bf('0x28')](0x2)[_0x02bf('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x02bf('0x29')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x02bf('0x2a'),_0x02bf('0x2b')),'defaultValue':'dropRate','comment':_0x02bf('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x02bf('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x02bf('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x02bf('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x02bf('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':_0x02bf('0x2f'),'comment':_0x02bf('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x02bf('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x02bf('0x17')](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x02bf('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x35')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x02bf('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'comment':_0x02bf('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x02bf('0x38')},'dialTimezone':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x02bf('0x39')},'dialPrefix':{'type':Sequelize[_0x02bf('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x02bf('0x3a'),'never',_0x02bf('0x3b')),'defaultValue':_0x02bf('0x3a')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x02bf('0x3c')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x02bf('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x02bf('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x02bf('0x17')](0x9)[_0x02bf('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x02bf('0x17')](0x9)[_0x02bf('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x02bf('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x02bf('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x02bf('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x02bf('0x17')](0x9)[_0x02bf('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x02bf('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x02bf('0x17')](0x9)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x02bf('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x02bf('0x17')](0x5)[_0x02bf('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x02bf('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x02bf('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x02bf('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x02bf('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x02bf('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x02bf('0x1f')],'defaultValue':0x0,'comment':_0x02bf('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x02bf('0x7')](_0x02bf('0x45'),_0x02bf('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x02bf('0x6')],'comment':_0x02bf('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x02bf('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x02bf('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x02bf('0x47')},'dialCutDigit':{'type':Sequelize[_0x02bf('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x02bf('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x02bf('0x49')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x02bf('0x17')](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x02bf('0x17')](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x02bf('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x02bf('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x02bf('0x17')](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x02bf('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x02bf('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x02bf('0x17')](0x5)[_0x02bf('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x02bf('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x02bf('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x02bf('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3773d6){if(!_0x3773d6)this[_0x02bf('0x16')](_0x02bf('0x51'),null);this['setDataValue'](_0x02bf('0x52'),_0x3773d6);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x02bf('0x17')](0x3)[_0x02bf('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x02bf('0x17')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x02bf('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0xc339=['leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','rrordered','strategy','getDataValue','type','dialMethod','roundrobin','setDataValue','INTEGER','yes','all','once','TEXT','periodic_announce','split','join','joinempty'];(function(_0x4158d7,_0x592c8e){var _0x369b83=function(_0x435ff4){while(--_0x435ff4){_0x4158d7['push'](_0x4158d7['shift']());}};_0x369b83(++_0x592c8e);}(_0xc339,0x173));var _0x9c33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc339[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c33('0x0'));module[_0x9c33('0x1')]={'name':{'type':Sequelize[_0x9c33('0x2')],'allowNull':![],'unique':_0x9c33('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x5'),_0x9c33('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':_0x9c33('0x7')},'announce':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9c33('0x4')]('rr',_0x9c33('0x8'),_0x9c33('0x9'),_0x9c33('0xa'),_0x9c33('0xb'),_0x9c33('0xc'),'linear','wrandom',_0x9c33('0xd')),'allowNull':![],'defaultValue':_0x9c33('0x8'),'set':function(_0x1f23b0){this['setDataValue'](_0x9c33('0xe'),_0x1f23b0?_0x1f23b0:_0x9c33('0xc'));},'get':function(){var _0x984005=this[_0x9c33('0xf')](_0x9c33('0x10'));var _0x371c94=this[_0x9c33('0xf')](_0x9c33('0x11'));var _0x3ae655=this['getDataValue'](_0x9c33('0xe'));if(_0x984005===_0x9c33('0x6')){if(_0x371c94==='preview'){return null;}if(_0x371c94==='booked'&&![_0x9c33('0xc'),_0x9c33('0x12')]['includes'](_0x3ae655)){this[_0x9c33('0x13')](_0x9c33('0xe'),_0x9c33('0xc'));}}return _0x3ae655;}},'servicelevel':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9c33('0x14')](0xb)},'timeout':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9c33('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':_0x9c33('0x15')},'autopause':{'type':Sequelize[_0x9c33('0x4')]('yes','no',_0x9c33('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9c33('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x9c33('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9c33('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9c33('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9c33('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9c33('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x9c33('0x15'),'no'),'defaultValue':_0x9c33('0x15')},'announce_holdtime':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no',_0x9c33('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9c33('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x9c33('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9c33('0x2')]},'queue_youarenext':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9c33('0x2')]},'queue_quantity1':{'type':Sequelize[_0x9c33('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x9c33('0x2')]},'queue_less_than':{'type':Sequelize[_0x9c33('0x2')]},'periodic_announce':{'type':Sequelize[_0x9c33('0x18')],'set':function(_0x56949c){this['setDataValue'](_0x9c33('0x19'),_0x56949c?_0x56949c['join'](','):[]);},'get':function(){return this[_0x9c33('0xf')](_0x9c33('0x19'))?this[_0x9c33('0xf')]('periodic_announce')[_0x9c33('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':_0x9c33('0x15'),'set':function(_0x36f60f){this[_0x9c33('0x13')]('joinempty',_0x36f60f?_0x36f60f[_0x9c33('0x1b')](','):undefined);},'get':function(){return this[_0x9c33('0xf')]('joinempty')?this['getDataValue'](_0x9c33('0x1c'))[_0x9c33('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':'no','set':function(_0x35cd8e){this[_0x9c33('0x13')](_0x9c33('0x1d'),_0x35cd8e?_0x35cd8e[_0x9c33('0x1b')](','):undefined);},'get':function(){return this[_0x9c33('0xf')](_0x9c33('0x1d'))?this['getDataValue']('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9c33('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':0x0,'set':function(_0x234879){this[_0x9c33('0x13')](_0x9c33('0x1f'),_0x234879);if(_0x234879){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x9c33('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9c33('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9c33('0x21')},'dialMethod':{'type':Sequelize[_0x9c33('0x4')]('preview',_0x9c33('0x22'),_0x9c33('0x23'),'predictive',_0x9c33('0x24')),'defaultValue':_0x9c33('0x22'),'comment':_0x9c33('0x25')},'dialLimitChannel':{'type':Sequelize[_0x9c33('0x14')](0x4)[_0x9c33('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9c33('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x9c33('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9c33('0x28')},'dialPowerLevel':{'type':Sequelize[_0x9c33('0x29')](0x2)[_0x9c33('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x9c33('0x2a'),_0x9c33('0x2b')),'defaultValue':_0x9c33('0x2b'),'comment':_0x9c33('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9c33('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9c33('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9c33('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9c33('0x30'),'comment':_0x9c33('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x9c33('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c33('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x36')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'comment':_0x9c33('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c33('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9c33('0x39')},'dialTimezone':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9c33('0x3a')},'dialPrefix':{'type':Sequelize[_0x9c33('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9c33('0x4')](_0x9c33('0x3b'),_0x9c33('0x3c'),_0x9c33('0x3d')),'defaultValue':_0x9c33('0x3b')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9c33('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9c33('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9c33('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x9c33('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9c33('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9c33('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9c33('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x9c33('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9c33('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9c33('0x14')](0x9)[_0x9c33('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9c33('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x9c33('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':0x0,'comment':_0x9c33('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x9c33('0x45'),_0x9c33('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x9c33('0x2')],'comment':_0x9c33('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9c33('0x47')},'dialCutDigit':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x49')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c33('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9c33('0x14')](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c33('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9c33('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9c33('0x14')],'allowNull':!![],'comment':_0x9c33('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':![],'comment':_0x9c33('0x4f'),'set':function(_0x2db2dd){if(!_0x2db2dd)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x2db2dd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9c33('0x14')](0x3)[_0x9c33('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x9c33('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x9c33('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 6e9b622..432083b 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 _0xd634=['ids','field','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','CmListId','ListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','select','onlyIfOpen','cm_hopper','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','cm_contacts','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','error','stack','send','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','create','body','user','role','find','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','length','order','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','online','voicePause','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','emit','userVoiceQueue:save'];(function(_0x2256ee,_0x1cff44){var _0xcf87ce=function(_0x2dbd79){while(--_0x2dbd79){_0x2256ee['push'](_0x2256ee['shift']());}};_0xcf87ce(++_0x1cff44);}(_0xd634,0xf4));var _0x4d63=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0xd634[_0x289891];return _0x31cf2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d63('0x0'));var zipdir=require(_0x4d63('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4d63('0x2'));var BPromise=require(_0x4d63('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4d63('0x4'));var sox=require(_0x4d63('0x5'));var csv=require(_0x4d63('0x6'));var ejs=require(_0x4d63('0x7'));var fs=require('fs');var fs_extra=require(_0x4d63('0x8'));var _=require(_0x4d63('0x9'));var squel=require(_0x4d63('0xa'));var crypto=require(_0x4d63('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d63('0xc'));var authService=require(_0x4d63('0xd'));var qs=require(_0x4d63('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d63('0xf'));var logger=require(_0x4d63('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4d63('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d63('0x12'))['db'];config[_0x4d63('0x13')]=_[_0x4d63('0x14')](config[_0x4d63('0x13')],{'host':_0x4d63('0x15'),'port':0x18eb});var socket=require(_0x4d63('0x16'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x29065c,_0x42571c){_0x42571c=_0x42571c||0xcc;return function(_0x251970){if(_0x251970){return _0x29065c[_0x4d63('0x17')](_0x42571c);}return _0x29065c['status'](_0x42571c)[_0x4d63('0x18')]();};}function respondWithResult(_0x2ca49a,_0x26d6fa){_0x26d6fa=_0x26d6fa||0xc8;return function(_0x44c1d8){if(_0x44c1d8){return _0x2ca49a[_0x4d63('0x19')](_0x26d6fa)[_0x4d63('0x1a')](_0x44c1d8);}};}function respondWithFilteredResult(_0x43dc31,_0x165c17){return function(_0x53bbb8){if(_0x53bbb8){var _0x4fe175=typeof _0x165c17[_0x4d63('0x1b')]==='undefined'&&typeof _0x165c17[_0x4d63('0x1c')]===_0x4d63('0x1d');var _0x37a03f=_0x53bbb8[_0x4d63('0x1e')];var _0x1cf455=_0x4fe175?0x0:_0x165c17['offset'];var _0x2feb4d=_0x4fe175?_0x53bbb8[_0x4d63('0x1e')]:_0x165c17['offset']+_0x165c17[_0x4d63('0x1c')];var _0xc2d3ab;if(_0x2feb4d>=_0x37a03f){_0x2feb4d=_0x37a03f;_0xc2d3ab=0xc8;}else{_0xc2d3ab=0xce;}_0x43dc31[_0x4d63('0x19')](_0xc2d3ab);return _0x43dc31['set'](_0x4d63('0x1f'),_0x1cf455+'-'+_0x2feb4d+'/'+_0x37a03f)[_0x4d63('0x1a')](_0x53bbb8);}return null;};}function patchUpdates(_0xcc4333){return function(_0x4702aa){try{jsonpatch['apply'](_0x4702aa,_0xcc4333,!![]);}catch(_0x3bb2f5){return BPromise['reject'](_0x3bb2f5);}return _0x4702aa['save']();};}function saveUpdates(_0x2ce377,_0x240d7d){return function(_0x63f87d){if(_0x63f87d){return _0x63f87d[_0x4d63('0x20')](_0x2ce377)[_0x4d63('0x21')](function(_0x2b4423){return _0x2b4423;});}return null;};}function removeEntity(_0x2beb3b,_0x2195a9){return function(_0x147150){if(_0x147150){return _0x147150[_0x4d63('0x22')]()['then'](function(){var _0x410bd9=_0x147150[_0x4d63('0x23')]({'plain':!![]});var _0x475c08=[{'name':_0x4d63('0x24'),'value':_0x4d63('0x25'),'ignore':![]},{'name':_0x4d63('0x26'),'value':_0x4d63('0x27'),'ignore':![]}];var _0x1e7047=_(_0x475c08)[_0x4d63('0x28')](_0x4d63('0x29'))[_0x4d63('0x2a')](_0x4d63('0x2b'))[_0x4d63('0x2b')]();if(_[_0x4d63('0x2c')](_0x1e7047,_0x410bd9[_0x4d63('0x2d')])){return;}var _0x26968f=_['find'](_0x475c08,[_0x4d63('0x2b'),_0x410bd9[_0x4d63('0x2d')]])[_0x4d63('0x2e')];return db[_0x4d63('0x2f')][_0x4d63('0x22')]({'where':{'type':_0x26968f,'resourceId':_0x410bd9['id']}})[_0x4d63('0x21')](function(){return _0x147150;});})['then'](function(){_0x2beb3b[_0x4d63('0x19')](0xcc)[_0x4d63('0x18')]();});}};}function handleEntityNotFound(_0x3def9c,_0x21d6cd){return function(_0x670658){if(!_0x670658){_0x3def9c['sendStatus'](0x194);}return _0x670658;};}function handleError(_0x17d11b,_0x3b231c){_0x3b231c=_0x3b231c||0x1f4;return function(_0x50d9e6){logger[_0x4d63('0x30')](_0x50d9e6[_0x4d63('0x31')]);if(_0x50d9e6[_0x4d63('0x2e')]){delete _0x50d9e6['name'];}_0x17d11b[_0x4d63('0x19')](_0x3b231c)[_0x4d63('0x32')](_0x50d9e6);};}exports['index']=function(_0x282b15,_0x511ff5){var _0x50d5ae={},_0x2ed2dd={},_0x2a70e3={'count':0x0,'rows':[]};var _0x27affe=_[_0x4d63('0x2a')](db[_0x4d63('0x33')][_0x4d63('0x34')],function(_0x5026ff){return{'name':_0x5026ff[_0x4d63('0x35')],'type':_0x5026ff[_0x4d63('0x2d')][_0x4d63('0x36')]};});_0x2ed2dd[_0x4d63('0x37')]=_['map'](_0x27affe,_0x4d63('0x2e'));_0x2ed2dd[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0x282b15[_0x4d63('0x38')]);_0x2ed2dd[_0x4d63('0x3a')]=_['intersection'](_0x2ed2dd['model'],_0x2ed2dd[_0x4d63('0x38')]);_0x50d5ae[_0x4d63('0x3b')]=_['intersection'](_0x2ed2dd['model'],qs[_0x4d63('0x3c')](_0x282b15['query'][_0x4d63('0x3c')]));_0x50d5ae[_0x4d63('0x3b')]=_0x50d5ae[_0x4d63('0x3b')]['length']?_0x50d5ae[_0x4d63('0x3b')]:_0x2ed2dd[_0x4d63('0x37')];if(!_0x282b15['query'][_0x4d63('0x3d')](_0x4d63('0x3e'))){_0x50d5ae[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x282b15[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x50d5ae[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0x282b15[_0x4d63('0x38')][_0x4d63('0x1b')]);}_0x50d5ae['order']=qs[_0x4d63('0x3f')](_0x282b15[_0x4d63('0x38')][_0x4d63('0x3f')]);_0x50d5ae[_0x4d63('0x40')]=qs['filters'](_[_0x4d63('0x41')](_0x282b15['query'],_0x2ed2dd[_0x4d63('0x3a')]),_0x27affe);if(_0x282b15[_0x4d63('0x38')][_0x4d63('0x28')]){_0x50d5ae['where']=_[_0x4d63('0x42')](_0x50d5ae['where'],{'$or':_[_0x4d63('0x2a')](_0x27affe,function(_0x116eb5){if(_0x116eb5[_0x4d63('0x2d')]!==_0x4d63('0x43')){var _0x12b48c={};_0x12b48c[_0x116eb5[_0x4d63('0x2e')]]={'$like':'%'+_0x282b15['query'][_0x4d63('0x28')]+'%'};return _0x12b48c;}})});}_0x50d5ae=_[_0x4d63('0x42')]({},_0x50d5ae,_0x282b15[_0x4d63('0x44')]);var _0x54a3f1={'where':_0x50d5ae[_0x4d63('0x40')]};return db[_0x4d63('0x33')][_0x4d63('0x1e')](_0x54a3f1)[_0x4d63('0x21')](function(_0x46e82f){_0x2a70e3[_0x4d63('0x1e')]=_0x46e82f;if(_0x282b15['query'][_0x4d63('0x45')]){_0x50d5ae[_0x4d63('0x46')]=[{'all':!![]}];}return db[_0x4d63('0x33')][_0x4d63('0x47')](_0x50d5ae);})[_0x4d63('0x21')](function(_0x2f86f8){_0x2a70e3[_0x4d63('0x48')]=_0x2f86f8;return _0x2a70e3;})['then'](respondWithFilteredResult(_0x511ff5,_0x50d5ae))[_0x4d63('0x49')](handleError(_0x511ff5,null));};exports['show']=function(_0x5634db,_0x4e954b){var _0x5a972d={'raw':![],'where':{'id':_0x5634db[_0x4d63('0x4a')]['id']}},_0x687738={};_0x687738[_0x4d63('0x37')]=_[_0x4d63('0x39')](db['VoiceQueue'][_0x4d63('0x34')]);_0x687738[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0x5634db[_0x4d63('0x38')]);_0x687738[_0x4d63('0x3a')]=_[_0x4d63('0x4b')](_0x687738[_0x4d63('0x37')],_0x687738[_0x4d63('0x38')]);_0x5a972d[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x687738[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x5634db[_0x4d63('0x38')]['fields']));_0x5a972d[_0x4d63('0x3b')]=_0x5a972d[_0x4d63('0x3b')]['length']?_0x5a972d['attributes']:_0x687738[_0x4d63('0x37')];if(_0x5634db['query'][_0x4d63('0x45')]){_0x5a972d[_0x4d63('0x46')]=[{'all':!![]}];}_0x5a972d=_[_0x4d63('0x42')]({},_0x5a972d,_0x5634db['options']);return db[_0x4d63('0x33')]['find'](_0x5a972d)[_0x4d63('0x21')](handleEntityNotFound(_0x4e954b,null))['then'](respondWithResult(_0x4e954b,null))[_0x4d63('0x49')](handleError(_0x4e954b,null));};exports[_0x4d63('0x4c')]=function(_0x435bc8,_0x3cb5c8){return db['VoiceQueue'][_0x4d63('0x4c')](_0x435bc8[_0x4d63('0x4d')],{})[_0x4d63('0x21')](function(_0x1ffbef){var _0x2cdca2=_0x435bc8[_0x4d63('0x4e')][_0x4d63('0x23')]({'plain':!![]});if(!_0x2cdca2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cdca2[_0x4d63('0x4f')]===_0x4d63('0x4e')){var _0x2e7114=_0x1ffbef[_0x4d63('0x23')]({'plain':!![]});var _0x3bad26=[{'name':_0x4d63('0x24'),'value':_0x4d63('0x25')},{'name':_0x4d63('0x26'),'value':_0x4d63('0x27')}];var _0x52a963=_[_0x4d63('0x50')](_0x3bad26,[_0x4d63('0x2b'),_0x2e7114[_0x4d63('0x2d')]])[_0x4d63('0x2e')];return db[_0x4d63('0x51')][_0x4d63('0x50')]({'where':{'name':_0x52a963,'userProfileId':_0x2cdca2[_0x4d63('0x52')]},'raw':!![]})[_0x4d63('0x21')](function(_0x267d48){if(_0x267d48&&_0x267d48[_0x4d63('0x53')]===0x0){return db[_0x4d63('0x2f')][_0x4d63('0x4c')]({'name':_0x2e7114['name'],'resourceId':_0x2e7114['id'],'type':_0x267d48[_0x4d63('0x2e')],'sectionId':_0x267d48['id']},{})[_0x4d63('0x21')](function(){return _0x1ffbef;});}else{return _0x1ffbef;}})[_0x4d63('0x49')](function(_0x1fdc95){logger[_0x4d63('0x30')](_0x4d63('0x54'),_0x1fdc95);throw _0x1fdc95;});}return _0x1ffbef;})['then'](respondWithResult(_0x3cb5c8,0xc9))[_0x4d63('0x49')](handleError(_0x3cb5c8,null));};exports[_0x4d63('0x55')]=function(_0x23166e,_0x3f29e0){var _0x939273={'where':{'id':_0x23166e[_0x4d63('0x4a')]['id']}},_0x3f4caf={};_0x3f4caf[_0x4d63('0x37')]=_[_0x4d63('0x39')](db[_0x4d63('0x33')][_0x4d63('0x34')]);_0x939273['attributes']=_[_0x4d63('0x4b')](_0x3f4caf[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x23166e['query'][_0x4d63('0x3c')]));_0x939273[_0x4d63('0x3b')]=_0x939273[_0x4d63('0x3b')]['length']?_0x939273[_0x4d63('0x3b')]:_0x3f4caf['model'];if(_0x23166e[_0x4d63('0x38')]['includeAll']){_0x939273['include']=[{'all':!![]}];}_0x939273=_[_0x4d63('0x42')]({},_0x939273,_0x23166e[_0x4d63('0x44')]);return db[_0x4d63('0x33')][_0x4d63('0x50')](_0x939273)[_0x4d63('0x21')](handleEntityNotFound(_0x3f29e0,null))[_0x4d63('0x21')](function(_0x34ee39){if(_0x34ee39){var _0x470aec=_0x34ee39[_0x4d63('0x23')]({'plain':!![]});_0x470aec=qs[_0x4d63('0x56')](_0x470aec,['id','createdAt',_0x4d63('0x57')]);_0x23166e[_0x4d63('0x4d')]=_[_0x4d63('0x56')](_0x23166e[_0x4d63('0x4d')],['id',_0x4d63('0x58'),_0x4d63('0x57')]);return db[_0x4d63('0x33')][_0x4d63('0x4c')](_[_0x4d63('0x42')](_0x470aec,_0x23166e[_0x4d63('0x4d')]),{'include':_0x23166e[_0x4d63('0x38')][_0x4d63('0x45')]?[{'all':!![]}]:undefined})[_0x4d63('0x21')](function(_0x2d2070){var _0x521e19=_0x23166e['user'][_0x4d63('0x23')]({'plain':!![]});if(!_0x521e19)throw new Error(_0x4d63('0x59'));if(_0x521e19['role']===_0x4d63('0x4e')){var _0xaccb49=_0x2d2070['get']({'plain':!![]});var _0x222d33=[{'name':_0x4d63('0x24'),'value':'inbound'},{'name':_0x4d63('0x26'),'value':_0x4d63('0x27')}];var _0x157420=_['find'](_0x222d33,[_0x4d63('0x2b'),_0xaccb49[_0x4d63('0x2d')]])[_0x4d63('0x2e')];return db[_0x4d63('0x51')][_0x4d63('0x50')]({'where':{'name':_0x157420,'userProfileId':_0x521e19[_0x4d63('0x52')]},'raw':!![]})[_0x4d63('0x21')](function(_0x31daa6){if(_0x31daa6&&_0x31daa6[_0x4d63('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0xaccb49[_0x4d63('0x2e')],'resourceId':_0xaccb49['id'],'type':_0x31daa6[_0x4d63('0x2e')],'sectionId':_0x31daa6['id']},{})[_0x4d63('0x21')](function(){return _0x2d2070;});}else{return _0x2d2070;}})['catch'](function(_0x1d8944){logger[_0x4d63('0x30')](_0x4d63('0x54'),_0x1d8944);throw _0x1d8944;});}return _0x2d2070;});}})[_0x4d63('0x21')](respondWithResult(_0x3f29e0,0xc9))[_0x4d63('0x49')](handleError(_0x3f29e0,null));};exports[_0x4d63('0x20')]=function(_0x26dbea,_0xaf226b){if(_0x26dbea[_0x4d63('0x4d')]['id']){delete _0x26dbea[_0x4d63('0x4d')]['id'];}return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x26dbea[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0xaf226b,null))[_0x4d63('0x21')](saveUpdates(_0x26dbea[_0x4d63('0x4d')],null))[_0x4d63('0x21')](respondWithResult(_0xaf226b,null))[_0x4d63('0x49')](handleError(_0xaf226b,null));};exports[_0x4d63('0x22')]=function(_0x2a830e,_0x3abb8a){return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x2a830e[_0x4d63('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3abb8a,null))[_0x4d63('0x21')](removeEntity(_0x3abb8a,null))['catch'](handleError(_0x3abb8a,null));};exports[_0x4d63('0x5a')]=function(_0xbe49f5,_0x3bf227,_0x485be0){var _0x578471={'raw':![],'where':{}};var _0x39b27d={};var _0x51a9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4d63('0x5b')]({'where':{'id':_0xbe49f5[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x3bf227,null))['then'](function(_0x38b7b1){if(_0x38b7b1){_0x39b27d[_0x4d63('0x37')]=_[_0x4d63('0x39')](db[_0x4d63('0x5c')][_0x4d63('0x34')]);_0x39b27d[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0xbe49f5[_0x4d63('0x38')]);_0x39b27d[_0x4d63('0x3a')]=_['intersection'](_0x39b27d[_0x4d63('0x37')],_0x39b27d['query']);_0x578471[_0x4d63('0x3b')]=_['intersection'](_0x39b27d['model'],qs[_0x4d63('0x3c')](_0xbe49f5[_0x4d63('0x38')]['fields']));_0x578471[_0x4d63('0x3b')]=_0x578471[_0x4d63('0x3b')][_0x4d63('0x5d')]?_0x578471[_0x4d63('0x3b')]:_0x39b27d[_0x4d63('0x37')];if(!_0xbe49f5['query'][_0x4d63('0x3d')](_0x4d63('0x3e'))){_0x578471['limit']=qs[_0x4d63('0x1c')](_0xbe49f5[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x578471[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0xbe49f5['query'][_0x4d63('0x1b')]);}_0x578471[_0x4d63('0x5e')]=qs[_0x4d63('0x3f')](_0xbe49f5[_0x4d63('0x38')][_0x4d63('0x3f')]);_0x578471['where']=qs[_0x4d63('0x3a')](_['pick'](_0xbe49f5[_0x4d63('0x38')],_0x39b27d[_0x4d63('0x3a')]));_0x578471[_0x4d63('0x40')][_0x4d63('0x5f')]=_0x38b7b1['id'];if(_0xbe49f5[_0x4d63('0x38')][_0x4d63('0x28')]){_0x578471[_0x4d63('0x40')]=_[_0x4d63('0x42')](_0x578471[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x578471[_0x4d63('0x3b')],function(_0x4459e0){var _0xe70302={};_0xe70302[_0x4459e0]={'$like':'%'+_0xbe49f5[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0xe70302;})});}_0x578471=_['merge']({},_0x578471,_0xbe49f5[_0x4d63('0x44')]);return db['CmHopper'][_0x4d63('0x1e')]({'where':_0x578471[_0x4d63('0x40')]})[_0x4d63('0x21')](function(_0x31d5b4){_0x51a9[_0x4d63('0x1e')]=_0x31d5b4;if(_0xbe49f5[_0x4d63('0x38')][_0x4d63('0x45')]){_0x578471[_0x4d63('0x46')]=[{'all':!![]}];}return db[_0x4d63('0x5c')][_0x4d63('0x47')](_0x578471);})[_0x4d63('0x21')](function(_0x359532){_0x51a9[_0x4d63('0x48')]=_0x359532;return _0x51a9;});}})[_0x4d63('0x21')](respondWithFilteredResult(_0x3bf227,_0x578471))[_0x4d63('0x49')](handleError(_0x3bf227,null));};exports[_0x4d63('0x60')]=function(_0x55c1e1,_0x3a40ea,_0x54a0b8){var _0x531c10={'raw':!![],'where':{}};var _0x289b6c={};var _0x580ad3={'count':0x0,'rows':[]};return db[_0x4d63('0x33')][_0x4d63('0x5b')]({'where':{'id':_0x55c1e1['params']['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x3a40ea,null))[_0x4d63('0x21')](function(_0x4d1f0f){if(_0x4d1f0f){_0x289b6c[_0x4d63('0x37')]=_[_0x4d63('0x39')](db[_0x4d63('0x61')][_0x4d63('0x34')]);_0x289b6c[_0x4d63('0x38')]=_['keys'](_0x55c1e1[_0x4d63('0x38')]);_0x289b6c[_0x4d63('0x3a')]=_['intersection'](_0x289b6c[_0x4d63('0x37')],_0x289b6c['query']);_0x531c10[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x289b6c[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x55c1e1[_0x4d63('0x38')]['fields']));_0x531c10['attributes']=_0x531c10[_0x4d63('0x3b')][_0x4d63('0x5d')]?_0x531c10[_0x4d63('0x3b')]:_0x289b6c[_0x4d63('0x37')];if(!_0x55c1e1['query'][_0x4d63('0x3d')]('nolimit')){_0x531c10[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x55c1e1['query']['limit']);_0x531c10[_0x4d63('0x1b')]=qs['offset'](_0x55c1e1[_0x4d63('0x38')][_0x4d63('0x1b')]);}_0x531c10[_0x4d63('0x5e')]=qs['sort'](_0x55c1e1['query'][_0x4d63('0x3f')]);_0x531c10[_0x4d63('0x40')]=qs['filters'](_['pick'](_0x55c1e1[_0x4d63('0x38')],_0x289b6c[_0x4d63('0x3a')]));_0x531c10[_0x4d63('0x40')][_0x4d63('0x5f')]=_0x4d1f0f['id'];if(_0x55c1e1[_0x4d63('0x38')][_0x4d63('0x28')]){_0x531c10[_0x4d63('0x40')]=_[_0x4d63('0x42')](_0x531c10[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x531c10[_0x4d63('0x3b')],function(_0x33bd3f){var _0x675298={};_0x675298[_0x33bd3f]={'$like':'%'+_0x55c1e1[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0x675298;})});}_0x531c10=_['merge']({},_0x531c10,_0x55c1e1['options']);return db[_0x4d63('0x61')][_0x4d63('0x1e')]({'where':_0x531c10[_0x4d63('0x40')]})[_0x4d63('0x21')](function(_0x40ac84){_0x580ad3[_0x4d63('0x1e')]=_0x40ac84;if(_0x55c1e1['query'][_0x4d63('0x45')]){_0x531c10[_0x4d63('0x46')]=[{'all':!![]}];}return db[_0x4d63('0x61')][_0x4d63('0x47')](_0x531c10);})['then'](function(_0x23c2fb){_0x580ad3['rows']=_0x23c2fb;return _0x580ad3;});}})[_0x4d63('0x21')](respondWithFilteredResult(_0x3a40ea,_0x531c10))[_0x4d63('0x49')](handleError(_0x3a40ea,null));};exports[_0x4d63('0x62')]=function(_0x5fac2e,_0x13149e,_0x4a83c6){var _0x32259d={'raw':!![],'where':{}};var _0x52e8cc={};var _0x63f36d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4d63('0x5b')]({'where':{'id':_0x5fac2e['params']['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x13149e,null))[_0x4d63('0x21')](function(_0x41576c){if(_0x41576c){_0x52e8cc['model']=_[_0x4d63('0x39')](db[_0x4d63('0x63')][_0x4d63('0x34')]);_0x52e8cc[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0x5fac2e[_0x4d63('0x38')]);_0x52e8cc[_0x4d63('0x3a')]=_[_0x4d63('0x4b')](_0x52e8cc[_0x4d63('0x37')],_0x52e8cc['query']);_0x32259d[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x52e8cc[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x5fac2e[_0x4d63('0x38')][_0x4d63('0x3c')]));_0x32259d[_0x4d63('0x3b')]=_0x32259d['attributes'][_0x4d63('0x5d')]?_0x32259d[_0x4d63('0x3b')]:_0x52e8cc[_0x4d63('0x37')];if(!_0x5fac2e['query'][_0x4d63('0x3d')]('nolimit')){_0x32259d[_0x4d63('0x1c')]=qs['limit'](_0x5fac2e[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x32259d[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0x5fac2e['query']['offset']);}_0x32259d[_0x4d63('0x5e')]=qs['sort'](_0x5fac2e[_0x4d63('0x38')]['sort']);_0x32259d[_0x4d63('0x40')]=qs[_0x4d63('0x3a')](_[_0x4d63('0x41')](_0x5fac2e[_0x4d63('0x38')],_0x52e8cc[_0x4d63('0x3a')]));_0x32259d['where'][_0x4d63('0x5f')]=_0x41576c['id'];if(_0x5fac2e[_0x4d63('0x38')]['filter']){_0x32259d['where']=_['merge'](_0x32259d['where'],{'$or':_[_0x4d63('0x2a')](_0x32259d[_0x4d63('0x3b')],function(_0x3b6d95){var _0x240bd2={};_0x240bd2[_0x3b6d95]={'$like':'%'+_0x5fac2e[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0x240bd2;})});}_0x32259d=_[_0x4d63('0x42')]({},_0x32259d,_0x5fac2e[_0x4d63('0x44')]);return db[_0x4d63('0x63')][_0x4d63('0x1e')]({'where':_0x32259d[_0x4d63('0x40')]})[_0x4d63('0x21')](function(_0x5708b0){_0x63f36d[_0x4d63('0x1e')]=_0x5708b0;if(_0x5fac2e['query'][_0x4d63('0x45')]){_0x32259d[_0x4d63('0x46')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x32259d);})[_0x4d63('0x21')](function(_0x38df36){_0x63f36d[_0x4d63('0x48')]=_0x38df36;return _0x63f36d;});}})['then'](respondWithFilteredResult(_0x13149e,_0x32259d))[_0x4d63('0x49')](handleError(_0x13149e,null));};exports[_0x4d63('0x64')]=function(_0x1cdacd,_0x483a1c,_0x14b53){var _0x3301d7={'raw':!![],'where':{}};var _0x325abf={};var _0x47dcb4={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4d63('0x5b')]({'where':{'id':_0x1cdacd[_0x4d63('0x4a')]['id']}})['then'](handleEntityNotFound(_0x483a1c,null))['then'](function(_0x10b7ce){if(_0x10b7ce){_0x325abf[_0x4d63('0x37')]=_['keys'](db['CmHopperBlack'][_0x4d63('0x34')]);_0x325abf[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0x1cdacd[_0x4d63('0x38')]);_0x325abf[_0x4d63('0x3a')]=_['intersection'](_0x325abf['model'],_0x325abf['query']);_0x3301d7[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x325abf['model'],qs[_0x4d63('0x3c')](_0x1cdacd[_0x4d63('0x38')][_0x4d63('0x3c')]));_0x3301d7['attributes']=_0x3301d7[_0x4d63('0x3b')]['length']?_0x3301d7[_0x4d63('0x3b')]:_0x325abf[_0x4d63('0x37')];if(!_0x1cdacd[_0x4d63('0x38')][_0x4d63('0x3d')](_0x4d63('0x3e'))){_0x3301d7[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x1cdacd[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x3301d7[_0x4d63('0x1b')]=qs['offset'](_0x1cdacd['query']['offset']);}_0x3301d7[_0x4d63('0x5e')]=qs[_0x4d63('0x3f')](_0x1cdacd[_0x4d63('0x38')][_0x4d63('0x3f')]);_0x3301d7['where']=qs[_0x4d63('0x3a')](_[_0x4d63('0x41')](_0x1cdacd[_0x4d63('0x38')],_0x325abf['filters']));_0x3301d7['where'][_0x4d63('0x5f')]=_0x10b7ce['id'];if(_0x1cdacd['query'][_0x4d63('0x28')]){_0x3301d7[_0x4d63('0x40')]=_[_0x4d63('0x42')](_0x3301d7[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x3301d7[_0x4d63('0x3b')],function(_0x27d390){var _0x5d3b38={};_0x5d3b38[_0x27d390]={'$like':'%'+_0x1cdacd[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0x5d3b38;})});}_0x3301d7=_[_0x4d63('0x42')]({},_0x3301d7,_0x1cdacd[_0x4d63('0x44')]);return db[_0x4d63('0x65')]['count']({'where':_0x3301d7[_0x4d63('0x40')]})['then'](function(_0x5ca785){_0x47dcb4[_0x4d63('0x1e')]=_0x5ca785;if(_0x1cdacd['query'][_0x4d63('0x45')]){_0x3301d7[_0x4d63('0x46')]=[{'all':!![]}];}return db[_0x4d63('0x65')][_0x4d63('0x47')](_0x3301d7);})['then'](function(_0x999a83){_0x47dcb4['rows']=_0x999a83;return _0x47dcb4;});}})[_0x4d63('0x21')](respondWithFilteredResult(_0x483a1c,_0x3301d7))['catch'](handleError(_0x483a1c,null));};exports['getTeams']=function(_0x393454,_0x256d2a,_0xa2a747){var _0x11c18f={};var _0x2a6573={};var _0x12c5a6;var _0x4d40f5;return db[_0x4d63('0x33')][_0x4d63('0x5b')]({'where':{'id':_0x393454[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x256d2a,null))[_0x4d63('0x21')](function(_0xdbe2e1){if(_0xdbe2e1){_0x12c5a6=_0xdbe2e1;_0x2a6573[_0x4d63('0x37')]=_[_0x4d63('0x39')](db[_0x4d63('0x66')][_0x4d63('0x34')]);_0x2a6573['query']=_[_0x4d63('0x39')](_0x393454[_0x4d63('0x38')]);_0x2a6573[_0x4d63('0x3a')]=_['intersection'](_0x2a6573[_0x4d63('0x37')],_0x2a6573[_0x4d63('0x38')]);_0x11c18f[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x2a6573[_0x4d63('0x37')],qs['fields'](_0x393454[_0x4d63('0x38')][_0x4d63('0x3c')]));_0x11c18f[_0x4d63('0x3b')]=_0x11c18f[_0x4d63('0x3b')]['length']?_0x11c18f['attributes']:_0x2a6573[_0x4d63('0x37')];_0x11c18f[_0x4d63('0x5e')]=qs['sort'](_0x393454[_0x4d63('0x38')][_0x4d63('0x3f')]);_0x11c18f['where']=qs['filters'](_[_0x4d63('0x41')](_0x393454[_0x4d63('0x38')],_0x2a6573['filters']));if(_0x393454[_0x4d63('0x38')][_0x4d63('0x28')]){_0x11c18f['where']=_[_0x4d63('0x42')](_0x11c18f[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x11c18f[_0x4d63('0x3b')],function(_0x805ad7){var _0x261c8f={};_0x261c8f[_0x805ad7]={'$like':'%'+_0x393454[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0x261c8f;})});}_0x11c18f=_[_0x4d63('0x42')]({},_0x11c18f,_0x393454[_0x4d63('0x44')]);return _0x12c5a6['getTeams'](_0x11c18f);}})[_0x4d63('0x21')](function(_0x51c357){if(_0x51c357){_0x4d40f5=_0x51c357[_0x4d63('0x5d')];if(!_0x393454[_0x4d63('0x38')]['hasOwnProperty'](_0x4d63('0x3e'))){_0x11c18f['limit']=qs[_0x4d63('0x1c')](_0x393454[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x11c18f[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0x393454[_0x4d63('0x38')]['offset']);}return _0x12c5a6[_0x4d63('0x67')](_0x11c18f);}})[_0x4d63('0x21')](function(_0x34784c){if(_0x34784c){return _0x34784c?{'count':_0x4d40f5,'rows':_0x34784c}:null;}})[_0x4d63('0x21')](respondWithResult(_0x256d2a,null))['catch'](handleError(_0x256d2a,null));};exports[_0x4d63('0x68')]=function(_0x905114,_0x28d132,_0x10059b){var _0x4e6a7c=_0x905114[_0x4d63('0x4d')]['teams'];var _0x5efd67=_['map'](_0x4e6a7c,'id');return db['Team']['findAll']({'where':{'id':_0x5efd67},'attributes':['id'],'include':[{'model':db[_0x4d63('0x69')],'as':_0x4d63('0x6a'),'attributes':['id',_0x4d63('0x2e'),_0x4d63('0x6b'),_0x4d63('0x6c'),'interface'],'raw':!![]}]})['then'](function(_0xd927e){if(_0xd927e){var _0x3c9e86=_[_0x4d63('0x6d')](_0xd927e,function(_0x56c85b){var _0x849653=_0x56c85b['get']({'plain':!![]});_0x849653[_0x4d63('0x6a')][_0x4d63('0x6e')](function(_0x5af8e1){_0x5af8e1['penalty']=_['find'](_0x4e6a7c,{'id':_0x849653['id']})[_0x4d63('0x6f')];});return _0x849653[_0x4d63('0x6a')];});return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x905114['params']['id']}})[_0x4d63('0x21')](function(_0x369c92){return db[_0x4d63('0x70')][_0x4d63('0x71')](function(_0x3c233d){return _0x369c92[_0x4d63('0x68')](_0x5efd67,{'transaction':_0x3c233d})[_0x4d63('0x21')](function(){return BPromise[_0x4d63('0x72')](_0x4e6a7c,function(_0x38ca07){return db[_0x4d63('0x73')][_0x4d63('0x74')]({'TeamId':_0x38ca07['id'],'VoiceQueueId':_0x905114[_0x4d63('0x4a')]['id'],'penalty':_0x38ca07[_0x4d63('0x6f')]},{'transaction':_0x3c233d});});})['then'](function(){return BPromise[_0x4d63('0x72')](_0x3c9e86,function(_0x50eb4b){return db['UserVoiceQueue'][_0x4d63('0x75')]({'where':{'UserId':_0x50eb4b['id'],'VoiceQueueId':_0x905114['params']['id']},'defaults':{'penalty':_0x50eb4b[_0x4d63('0x6f')]},'transaction':_0x3c233d});});})['then'](function(){return BPromise[_0x4d63('0x72')](_[_0x4d63('0x28')](_0x3c9e86,{'online':!![]}),function(_0x40e6f3){return db[_0x4d63('0x76')][_0x4d63('0x74')]({'membername':_0x40e6f3[_0x4d63('0x2e')],'UserId':_0x40e6f3['id'],'queue_name':_0x369c92[_0x4d63('0x2e')],'VoiceQueueId':_0x369c92['id'],'interface':_[_0x4d63('0x77')](_0x40e6f3[_0x4d63('0x78')])?util[_0x4d63('0x79')]('SIP/%s',_0x40e6f3[_0x4d63('0x2e')]):_0x40e6f3[_0x4d63('0x78')],'paused':_0x40e6f3[_0x4d63('0x6c')]||![],'penalty':_0x40e6f3[_0x4d63('0x6f')]},{'transaction':_0x3c233d});});})[_0x4d63('0x21')](function(){_0x3c9e86[_0x4d63('0x6e')](function(_0x844d94){socket[_0x4d63('0x7a')](_0x4d63('0x7b'),{'UserId':_0x844d94['id'],'VoiceQueueId':_0x369c92['id']});});});});});}})[_0x4d63('0x21')](respondWithStatusCode(_0x28d132,null))[_0x4d63('0x49')](handleError(_0x28d132,null));};exports['removeTeams']=function(_0x1803ab,_0x4e5008,_0x13dbba){return db[_0x4d63('0x66')][_0x4d63('0x47')]({'where':{'id':_0x1803ab['query'][_0x4d63('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x4d63('0x69')],'as':_0x4d63('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x4d63('0x21')](handleEntityNotFound(_0x4e5008,null))['then'](function(_0x560ff8){var _0x4c136b=_[_0x4d63('0x2a')](_0x560ff8,'id');var _0x2fc8f4=[];var _0x11e0b4=[];var _0x2d2ce3=squel['select']();_0x2d2ce3[_0x4d63('0x7d')]('tq.TeamId')[_0x4d63('0x7e')](_0x4d63('0x7f'),'tq')[_0x4d63('0x80')](_0x4d63('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4d63('0x82'),_0x1803ab['params']['id']);for(var _0x10af7d=0x0;_0x10af7d<_0x560ff8[_0x4d63('0x5d')];_0x10af7d+=0x1){let _0x79dd71=_0x560ff8[_0x10af7d];for(var _0x533a2c=0x0;_0x533a2c<_0x79dd71[_0x4d63('0x6a')][_0x4d63('0x5d')];_0x533a2c+=0x1){let _0x38016b=_0x79dd71['Agents'][_0x533a2c];var _0x1354e6=_0x2d2ce3[_0x4d63('0x55')]();_0x1354e6[_0x4d63('0x40')](_0x4d63('0x83'),_0x38016b['id']);_0x11e0b4[_0x4d63('0x84')](db[_0x4d63('0x70')]['query'](_0x1354e6[_0x4d63('0x85')](),{'type':db[_0x4d63('0x70')][_0x4d63('0x86')][_0x4d63('0x87')]})[_0x4d63('0x21')](function(_0x19c707){if(_0x19c707[_0x4d63('0x5d')]===0x1){return _0x38016b['id'];}else{var _0x436cb8=_['every'](_['map'](_0x19c707,_0x4d63('0x88')),function(_0x567da3){return _[_0x4d63('0x2c')](_0x4c136b,_0x567da3);});if(_0x436cb8){return _0x38016b['id'];}}}));}}return BPromise[_0x4d63('0x89')](_0x11e0b4)[_0x4d63('0x21')](function(_0x1f66b7){_0x2fc8f4=_(_0x2fc8f4)[_0x4d63('0x8a')](_0x1f66b7)[_0x4d63('0x8b')]()['value']();return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x1803ab[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](function(_0x306272){return db[_0x4d63('0x70')][_0x4d63('0x71')](function(_0x26ef5e){return _0x306272[_0x4d63('0x8c')](_0x1803ab[_0x4d63('0x38')]['ids'],{'transaction':_0x26ef5e})[_0x4d63('0x21')](function(){if(!_[_0x4d63('0x8d')](_0x2fc8f4)){return _0x306272[_0x4d63('0x8e')](_0x2fc8f4,{'transaction':_0x26ef5e})['then'](function(){return db[_0x4d63('0x76')][_0x4d63('0x22')]({'where':{'VoiceQueueId':_0x1803ab[_0x4d63('0x4a')]['id'],'UserId':_0x2fc8f4},'transaction':_0x26ef5e});});}})[_0x4d63('0x21')](function(){_0x2fc8f4[_0x4d63('0x6e')](function(_0x5ec5ee){socket[_0x4d63('0x7a')](_0x4d63('0x8f'),{'UserId':_0x5ec5ee,'VoiceQueueId':_0x306272['id']});});});});});});})['then'](respondWithStatusCode(_0x4e5008,null))[_0x4d63('0x49')](handleError(_0x4e5008,null));};exports[_0x4d63('0x90')]=function(_0x431b84,_0xbecffb,_0x414442){var _0x1dceb3,_0x28ebd0;return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x431b84[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0xbecffb,null))[_0x4d63('0x21')](function(_0x255556){if(_0x255556){_0x28ebd0=_0x255556;return _0x255556[_0x4d63('0x90')](_0x431b84[_0x4d63('0x4d')][_0x4d63('0x7c')],_['omit'](_0x431b84['body'],[_0x4d63('0x7c'),'id'])||{})[_0x4d63('0x91')](function(_0x12c221){for(var _0x450eed=0x0;_0x450eed<_0x431b84['body']['ids'][_0x4d63('0x5d')];_0x450eed+=0x1){socket[_0x4d63('0x7a')](_0x4d63('0x7b'),{'UserId':Number(_0x431b84[_0x4d63('0x4d')][_0x4d63('0x7c')][_0x450eed]),'VoiceQueueId':Number(_0x431b84[_0x4d63('0x4a')]['id'])});}return _0x12c221;});}})[_0x4d63('0x21')](function(_0x1116a1){_0x1dceb3=_0x1116a1||[];if(_0x28ebd0){return db['User'][_0x4d63('0x47')]({'where':{'id':_0x431b84[_0x4d63('0x4d')][_0x4d63('0x7c')]},'attributes':['id',_0x4d63('0x2e'),_0x4d63('0x6b'),'voicePause',_0x4d63('0x78')],'raw':!![]});}})[_0x4d63('0x21')](function(_0x4de8a2){if(!_[_0x4d63('0x8d')](_0x4de8a2)){var _0xdd1863=[];for(var _0x1a041b=0x0;_0x1a041b<_0x4de8a2[_0x4d63('0x5d')];_0x1a041b++){if(_0x4de8a2[_0x1a041b][_0x4d63('0x6b')]){_0xdd1863[_0x4d63('0x84')](db[_0x4d63('0x76')][_0x4d63('0x74')]({'membername':_0x4de8a2[_0x1a041b][_0x4d63('0x2e')],'UserId':_0x4de8a2[_0x1a041b]['id'],'queue_name':_0x28ebd0[_0x4d63('0x2e')],'VoiceQueueId':_0x28ebd0['id'],'interface':_[_0x4d63('0x77')](_0x4de8a2[_0x1a041b][_0x4d63('0x78')])?util[_0x4d63('0x79')]('SIP/%s',_0x4de8a2[_0x1a041b][_0x4d63('0x2e')]):_0x4de8a2[_0x1a041b][_0x4d63('0x78')],'paused':_0x4de8a2[_0x1a041b][_0x4d63('0x6c')]||![],'penalty':_0x431b84[_0x4d63('0x4d')]['penalty']||0x0}));}}return BPromise[_0x4d63('0x89')](_0xdd1863);}})[_0x4d63('0x21')](function(){return _0x1dceb3;})['then'](respondWithResult(_0xbecffb,null))[_0x4d63('0x49')](handleError(_0xbecffb,null));};exports[_0x4d63('0x8e')]=function(_0x137a28,_0x12777f,_0x4e73f7){return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x137a28[_0x4d63('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12777f,null))[_0x4d63('0x21')](function(_0x196c6e){if(_0x196c6e){return _0x196c6e[_0x4d63('0x8e')](_0x137a28['query'][_0x4d63('0x7c')])[_0x4d63('0x21')](function(){if(_[_0x4d63('0x92')](_0x137a28[_0x4d63('0x38')][_0x4d63('0x7c')])){for(var _0xb91d9e=0x0;_0xb91d9e<_0x137a28['query'][_0x4d63('0x7c')][_0x4d63('0x5d')];_0xb91d9e+=0x1){socket[_0x4d63('0x7a')](_0x4d63('0x8f'),{'UserId':Number(_0x137a28[_0x4d63('0x38')]['ids'][_0xb91d9e]),'VoiceQueueId':Number(_0x137a28[_0x4d63('0x4a')]['id'])});}}else{socket[_0x4d63('0x7a')](_0x4d63('0x8f'),{'UserId':Number(_0x137a28['query'][_0x4d63('0x7c')]),'VoiceQueueId':Number(_0x137a28[_0x4d63('0x4a')]['id'])});}});}})['then'](function(_0x19be36){return db[_0x4d63('0x76')][_0x4d63('0x22')]({'where':{'VoiceQueueId':_0x137a28[_0x4d63('0x4a')]['id'],'UserId':_0x137a28[_0x4d63('0x38')][_0x4d63('0x7c')]}})[_0x4d63('0x21')](function(){return _0x19be36;});})['then'](respondWithStatusCode(_0x12777f,null))[_0x4d63('0x49')](handleError(_0x12777f,null));};exports[_0x4d63('0x93')]=function(_0x11dedb,_0x32fd4a,_0x4a6e90){var _0x1d3605={};var _0x4edda4={};var _0x21d36b;var _0x16d7c6;return db[_0x4d63('0x33')][_0x4d63('0x5b')]({'where':{'id':_0x11dedb['params']['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x32fd4a,null))[_0x4d63('0x21')](function(_0x4b03e1){if(_0x4b03e1){_0x21d36b=_0x4b03e1;_0x4edda4[_0x4d63('0x37')]=_[_0x4d63('0x39')](db[_0x4d63('0x69')][_0x4d63('0x34')]);_0x4edda4[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0x11dedb[_0x4d63('0x38')]);_0x4edda4['filters']=_[_0x4d63('0x4b')](_0x4edda4[_0x4d63('0x37')],_0x4edda4[_0x4d63('0x38')]);_0x1d3605['attributes']=_[_0x4d63('0x4b')](_0x4edda4[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x11dedb[_0x4d63('0x38')][_0x4d63('0x3c')]));_0x1d3605[_0x4d63('0x3b')]=_0x1d3605[_0x4d63('0x3b')][_0x4d63('0x5d')]?_0x1d3605[_0x4d63('0x3b')]:_0x4edda4[_0x4d63('0x37')];_0x1d3605['order']=qs['sort'](_0x11dedb['query']['sort']);_0x1d3605[_0x4d63('0x40')]=qs[_0x4d63('0x3a')](_[_0x4d63('0x41')](_0x11dedb[_0x4d63('0x38')],_0x4edda4[_0x4d63('0x3a')]));if(_0x11dedb[_0x4d63('0x38')][_0x4d63('0x28')]){_0x1d3605[_0x4d63('0x40')]=_[_0x4d63('0x42')](_0x1d3605[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x1d3605[_0x4d63('0x3b')],function(_0x15205b){var _0x2495b4={};_0x2495b4[_0x15205b]={'$like':'%'+_0x11dedb['query'][_0x4d63('0x28')]+'%'};return _0x2495b4;})});}_0x1d3605=_[_0x4d63('0x42')]({},_0x1d3605,_0x11dedb[_0x4d63('0x44')]);return _0x21d36b[_0x4d63('0x93')](_0x1d3605);}})[_0x4d63('0x21')](function(_0x17e178){if(_0x17e178){_0x16d7c6=_0x17e178[_0x4d63('0x5d')];if(!_0x11dedb[_0x4d63('0x38')][_0x4d63('0x3d')](_0x4d63('0x3e'))){_0x1d3605[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x11dedb[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x1d3605[_0x4d63('0x1b')]=qs['offset'](_0x11dedb[_0x4d63('0x38')][_0x4d63('0x1b')]);}return _0x21d36b[_0x4d63('0x93')](_0x1d3605);}})[_0x4d63('0x21')](function(_0x2920d1){if(_0x2920d1){return _0x2920d1?{'count':_0x16d7c6,'rows':_0x2920d1}:null;}})['then'](respondWithResult(_0x32fd4a,null))['catch'](handleError(_0x32fd4a,null));};exports[_0x4d63('0x94')]=function(_0x25294b,_0x50f96f,_0x4e4f69){var _0x53f44c={};var _0x33f09c={};var _0x44b1a7;var _0x14be3d;return db['VoiceQueue'][_0x4d63('0x5b')]({'where':{'id':_0x25294b[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x50f96f,null))[_0x4d63('0x21')](function(_0x16319c){if(_0x16319c){_0x44b1a7=_0x16319c;_0x33f09c[_0x4d63('0x37')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x33f09c[_0x4d63('0x38')]=_[_0x4d63('0x39')](_0x25294b[_0x4d63('0x38')]);_0x33f09c[_0x4d63('0x3a')]=_[_0x4d63('0x4b')](_0x33f09c[_0x4d63('0x37')],_0x33f09c[_0x4d63('0x38')]);_0x53f44c[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x33f09c[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x25294b['query']['fields']));_0x53f44c['attributes']=_0x53f44c[_0x4d63('0x3b')][_0x4d63('0x5d')]?_0x53f44c[_0x4d63('0x3b')]:_0x33f09c[_0x4d63('0x37')];_0x53f44c[_0x4d63('0x5e')]=qs[_0x4d63('0x3f')](_0x25294b[_0x4d63('0x38')][_0x4d63('0x3f')]);_0x53f44c[_0x4d63('0x40')]=qs['filters'](_[_0x4d63('0x41')](_0x25294b['query'],_0x33f09c[_0x4d63('0x3a')]));if(_0x25294b[_0x4d63('0x38')]['filter']){_0x53f44c[_0x4d63('0x40')]=_['merge'](_0x53f44c['where'],{'$or':_[_0x4d63('0x2a')](_0x53f44c['attributes'],function(_0x2d0915){var _0x148a74={};_0x148a74[_0x2d0915]={'$like':'%'+_0x25294b[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0x148a74;})});}_0x53f44c=_['merge']({},_0x53f44c,_0x25294b['options']);return _0x44b1a7[_0x4d63('0x94')](_0x53f44c);}})['then'](function(_0x52428b){if(_0x52428b){_0x14be3d=_0x52428b[_0x4d63('0x5d')];if(!_0x25294b[_0x4d63('0x38')][_0x4d63('0x3d')]('nolimit')){_0x53f44c[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x25294b[_0x4d63('0x38')][_0x4d63('0x1c')]);_0x53f44c[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0x25294b['query'][_0x4d63('0x1b')]);}return _0x44b1a7[_0x4d63('0x94')](_0x53f44c);}})['then'](function(_0x53a229){return _0x53a229?{'count':_0x14be3d,'rows':_0x53a229}:null;})[_0x4d63('0x21')](respondWithResult(_0x50f96f,null))[_0x4d63('0x49')](handleError(_0x50f96f,null));};exports[_0x4d63('0x95')]=function(_0x2d7382,_0xb07e46,_0x8b926a){var _0x475cb1={};var _0x308f69={};var _0x3757ef;var _0x59477e;return db['VoiceQueue'][_0x4d63('0x5b')]({'where':{'id':_0x2d7382[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0xb07e46,null))['then'](function(_0x1c0e28){if(_0x1c0e28){_0x3757ef=_0x1c0e28;_0x308f69[_0x4d63('0x37')]=_[_0x4d63('0x39')](db[_0x4d63('0x96')][_0x4d63('0x34')]);_0x308f69[_0x4d63('0x38')]=_['keys'](_0x2d7382[_0x4d63('0x38')]);_0x308f69[_0x4d63('0x3a')]=_[_0x4d63('0x4b')](_0x308f69[_0x4d63('0x37')],_0x308f69[_0x4d63('0x38')]);_0x475cb1[_0x4d63('0x3b')]=_['intersection'](_0x308f69[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x2d7382['query'][_0x4d63('0x3c')]));_0x475cb1[_0x4d63('0x3b')]=_0x475cb1[_0x4d63('0x3b')][_0x4d63('0x5d')]?_0x475cb1[_0x4d63('0x3b')]:_0x308f69[_0x4d63('0x37')];_0x475cb1['order']=qs['sort'](_0x2d7382['query'][_0x4d63('0x3f')]);_0x475cb1[_0x4d63('0x40')]=qs[_0x4d63('0x3a')](_[_0x4d63('0x41')](_0x2d7382[_0x4d63('0x38')],_0x308f69[_0x4d63('0x3a')]));if(_0x2d7382[_0x4d63('0x38')]['filter']){_0x475cb1['where']=_[_0x4d63('0x42')](_0x475cb1[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x475cb1['attributes'],function(_0x21823f){var _0x9c4133={};_0x9c4133[_0x21823f]={'$like':'%'+_0x2d7382[_0x4d63('0x38')][_0x4d63('0x28')]+'%'};return _0x9c4133;})});}_0x475cb1=_['merge']({},_0x475cb1,_0x2d7382[_0x4d63('0x44')]);return _0x3757ef[_0x4d63('0x95')](_0x475cb1);}})['then'](function(_0x4e8467){if(_0x4e8467){_0x59477e=_0x4e8467[_0x4d63('0x5d')];if(!_0x2d7382[_0x4d63('0x38')][_0x4d63('0x3d')](_0x4d63('0x3e'))){_0x475cb1[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x2d7382['query'][_0x4d63('0x1c')]);_0x475cb1[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0x2d7382[_0x4d63('0x38')][_0x4d63('0x1b')]);}return _0x3757ef['getLists'](_0x475cb1);}})['then'](function(_0x1c4272){if(_0x1c4272){return _0x1c4272?{'count':_0x59477e,'rows':_0x1c4272}:null;}})[_0x4d63('0x21')](respondWithResult(_0xb07e46,null))[_0x4d63('0x49')](handleError(_0xb07e46,null));};exports['addLists']=function(_0x598843,_0x230581,_0xf5a1ac){var _0xd81895=moment()[_0x4d63('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2d6416,_0x174063;return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x598843[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x230581,null))[_0x4d63('0x21')](function(_0x10a52d){if(_0x10a52d){_0x174063=_0x10a52d;return _0x10a52d[_0x4d63('0x97')](_0x598843[_0x4d63('0x4d')]['ids'],_[_0x4d63('0x56')](_0x598843[_0x4d63('0x4d')],[_0x4d63('0x7c'),'id'])||{});}return null;})[_0x4d63('0x91')](function(_0x78a4d9){var _0x2ee86f;_0x2d6416=_0x78a4d9||[];var _0xe5d186=[];if(_0x78a4d9){for(var _0x49405a=0x0;_0x49405a<_0x78a4d9[_0x4d63('0x5d')];_0x49405a+=0x1){var _0x25cc8c=_0x78a4d9[_0x49405a][_0x4d63('0x23')]({'plain':!![]});_0x174063[_0x4d63('0x98')]=_0x598843[_0x4d63('0x4d')][_0x4d63('0x98')]?_0x598843[_0x4d63('0x4d')][_0x4d63('0x98')]:_0x174063[_0x4d63('0x98')];switch(_0x174063['dialCheckDuplicateType']){case'always':_0x2ee86f=squel[_0x4d63('0x99')]()[_0x4d63('0x9a')]('cm_hopper')[_0x4d63('0x9b')]([_0x4d63('0x9c'),'scheduledAt','ContactId','ListId',_0x4d63('0x5f'),_0x4d63('0x58'),_0x4d63('0x57')],squel['select']()[_0x4d63('0x7d')](_0x4d63('0x9c'),'phone')[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27',_0x4d63('0x9d'))[_0x4d63('0x7d')]('id',_0x4d63('0x9e'))[_0x4d63('0x7d')](_0x25cc8c[_0x4d63('0x9f')][_0x4d63('0x85')](),_0x4d63('0xa0'))[_0x4d63('0x7d')](_0x598843[_0x4d63('0x4a')]['id'][_0x4d63('0x85')](),_0x4d63('0x5f'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27','createdAt')['field']('\x27'+_0xd81895+'\x27','updatedAt')['from']('cm_contacts')[_0x4d63('0x40')]('deletedAt\x20IS\x20NULL')[_0x4d63('0x40')](_0x4d63('0xa1'),_0x25cc8c[_0x4d63('0x9f')][_0x4d63('0x85')]())['where'](_0x4d63('0xa2'))[_0x4d63('0x40')](_0x4d63('0xa3'),squel['select']()[_0x4d63('0x7d')](_0x4d63('0xa4'))[_0x4d63('0x7e')]('cm_hopper_final')[_0x4d63('0x40')]('VoiceQueueId\x20=\x20?',_0x598843[_0x4d63('0x4a')]['id'][_0x4d63('0x85')]()))[_0x4d63('0x40')](_0x4d63('0xa3'),squel[_0x4d63('0xa5')]()['field']('COALESCE(phone,\x27\x27)')[_0x4d63('0x7e')]('cm_hopper')[_0x4d63('0x40')]('VoiceQueueId\x20=\x20?',_0x598843[_0x4d63('0x4a')]['id'][_0x4d63('0x85')]())))['toString']();break;case _0x4d63('0xa6'):_0x2ee86f=squel[_0x4d63('0x99')]()[_0x4d63('0x9a')](_0x4d63('0xa7'))[_0x4d63('0x9b')]([_0x4d63('0x9c'),_0x4d63('0x9d'),'ContactId',_0x4d63('0xa0'),_0x4d63('0x5f'),_0x4d63('0x58'),'updatedAt'],squel['select']()['field']('phone',_0x4d63('0x9c'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27',_0x4d63('0x9d'))[_0x4d63('0x7d')]('id',_0x4d63('0x9e'))[_0x4d63('0x7d')](_0x25cc8c[_0x4d63('0x9f')][_0x4d63('0x85')](),'ListId')[_0x4d63('0x7d')](_0x598843[_0x4d63('0x4a')]['id'][_0x4d63('0x85')](),_0x4d63('0x5f'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27',_0x4d63('0x58'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27',_0x4d63('0x57'))[_0x4d63('0x7e')]('cm_contacts')[_0x4d63('0x40')](_0x4d63('0xa8'))['where'](_0x4d63('0xa1'),_0x25cc8c[_0x4d63('0x9f')][_0x4d63('0x85')]())[_0x4d63('0x40')](_0x4d63('0xa2'))[_0x4d63('0x40')](_0x4d63('0xa3'),squel['select']()[_0x4d63('0x7d')](_0x4d63('0xa9'))[_0x4d63('0x7e')](_0x4d63('0xa7'))[_0x4d63('0x40')]('VoiceQueueId\x20=\x20?',_0x598843[_0x4d63('0x4a')]['id'][_0x4d63('0x85')]())))[_0x4d63('0x85')]();break;default:_0x2ee86f=squel['insert']()[_0x4d63('0x9a')](_0x4d63('0xa7'))[_0x4d63('0x9b')]([_0x4d63('0x9c'),'scheduledAt','ContactId',_0x4d63('0xa0'),_0x4d63('0x5f'),_0x4d63('0x58'),_0x4d63('0x57')],squel['select']()['field'](_0x4d63('0x9c'),_0x4d63('0x9c'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27','scheduledAt')[_0x4d63('0x7d')]('id',_0x4d63('0x9e'))[_0x4d63('0x7d')](_0x25cc8c[_0x4d63('0x9f')][_0x4d63('0x85')](),_0x4d63('0xa0'))[_0x4d63('0x7d')](_0x598843['params']['id'][_0x4d63('0x85')](),'VoiceQueueId')['field']('\x27'+_0xd81895+'\x27',_0x4d63('0x58'))['field']('\x27'+_0xd81895+'\x27',_0x4d63('0x57'))[_0x4d63('0x7e')](_0x4d63('0xaa'))[_0x4d63('0x40')](_0x4d63('0xa8'))[_0x4d63('0x40')](_0x4d63('0xa1'),_0x25cc8c[_0x4d63('0x9f')][_0x4d63('0x85')]())[_0x4d63('0x40')](_0x4d63('0xa2')))[_0x4d63('0x85')]();}_0xe5d186[_0x4d63('0x84')](db['sequelize'][_0x4d63('0x38')](_0x2ee86f));}return BPromise['all'](_0xe5d186);}})[_0x4d63('0x21')](function(){var _0x3263a6=[];var _0x184ba2=squel[_0x4d63('0x99')]()[_0x4d63('0x9a')]('cm_hopper_additional_phones')[_0x4d63('0x9b')]([_0x4d63('0xab'),_0x4d63('0x9c'),_0x4d63('0xac'),_0x4d63('0x58'),_0x4d63('0x57')],squel['select']()[_0x4d63('0x7d')](_0x4d63('0xad'))['field'](_0x4d63('0xae'))[_0x4d63('0x7d')](_0x4d63('0xaf'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27',_0x4d63('0x58'))[_0x4d63('0x7d')]('\x27'+_0xd81895+'\x27',_0x4d63('0x57'))[_0x4d63('0x7e')]('cm_contact_has_items','ci')[_0x4d63('0x80')]('cm_hopper','h',_0x4d63('0xb0'))[_0x4d63('0x40')]('h.scheduledat=?',_0xd81895)[_0x4d63('0x40')]('ci.ItemClass=?',_0x4d63('0xb1')))['toString']();_0x3263a6['push'](db[_0x4d63('0x70')][_0x4d63('0x38')](_0x184ba2));return BPromise[_0x4d63('0x89')](_0x3263a6);})[_0x4d63('0x21')](function(){return _0x2d6416;})['then'](respondWithResult(_0x230581,null))[_0x4d63('0x49')](handleError(_0x230581,null));};exports[_0x4d63('0xb2')]=function(_0x4bd424,_0x39bc49,_0x7be4a2){return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x4bd424['params']['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x39bc49,null))[_0x4d63('0x21')](function(_0x11453e){if(_0x11453e){return _0x11453e[_0x4d63('0xb2')](_0x4bd424['query'][_0x4d63('0x7c')]);}})[_0x4d63('0x21')](function(_0x60c727){if(_0x60c727){return db[_0x4d63('0x5c')][_0x4d63('0x22')]({'where':{'ListId':_0x4bd424[_0x4d63('0x38')][_0x4d63('0x7c')],'VoiceQueueId':_0x4bd424[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](function(){return _0x60c727;});}})[_0x4d63('0x21')](respondWithStatusCode(_0x39bc49,null))[_0x4d63('0x49')](handleError(_0x39bc49,null));};exports[_0x4d63('0xb3')]=function(_0x3499ac,_0x8bb1e0,_0x348167){var _0x5dcc36={};var _0x370585={};var _0x190e67;var _0x2c5b87;return db[_0x4d63('0x33')][_0x4d63('0x5b')]({'where':{'id':_0x3499ac[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x8bb1e0,null))[_0x4d63('0x21')](function(_0x192dc4){if(_0x192dc4){_0x190e67=_0x192dc4;_0x370585['model']=_[_0x4d63('0x39')](db[_0x4d63('0x96')]['rawAttributes']);_0x370585[_0x4d63('0x38')]=_['keys'](_0x3499ac[_0x4d63('0x38')]);_0x370585[_0x4d63('0x3a')]=_[_0x4d63('0x4b')](_0x370585[_0x4d63('0x37')],_0x370585[_0x4d63('0x38')]);_0x5dcc36[_0x4d63('0x3b')]=_[_0x4d63('0x4b')](_0x370585[_0x4d63('0x37')],qs[_0x4d63('0x3c')](_0x3499ac[_0x4d63('0x38')][_0x4d63('0x3c')]));_0x5dcc36[_0x4d63('0x3b')]=_0x5dcc36['attributes']['length']?_0x5dcc36[_0x4d63('0x3b')]:_0x370585[_0x4d63('0x37')];_0x5dcc36[_0x4d63('0x5e')]=qs[_0x4d63('0x3f')](_0x3499ac[_0x4d63('0x38')]['sort']);_0x5dcc36[_0x4d63('0x40')]=qs[_0x4d63('0x3a')](_[_0x4d63('0x41')](_0x3499ac[_0x4d63('0x38')],_0x370585[_0x4d63('0x3a')]));if(_0x3499ac[_0x4d63('0x38')][_0x4d63('0x28')]){_0x5dcc36[_0x4d63('0x40')]=_[_0x4d63('0x42')](_0x5dcc36[_0x4d63('0x40')],{'$or':_[_0x4d63('0x2a')](_0x5dcc36[_0x4d63('0x3b')],function(_0x2180c6){var _0x496532={};_0x496532[_0x2180c6]={'$like':'%'+_0x3499ac['query']['filter']+'%'};return _0x496532;})});}_0x5dcc36=_[_0x4d63('0x42')]({},_0x5dcc36,_0x3499ac['options']);return _0x190e67[_0x4d63('0xb3')](_0x5dcc36);}})[_0x4d63('0x21')](function(_0x107d35){if(_0x107d35){_0x2c5b87=_0x107d35[_0x4d63('0x5d')];if(!_0x3499ac[_0x4d63('0x38')][_0x4d63('0x3d')](_0x4d63('0x3e'))){_0x5dcc36[_0x4d63('0x1c')]=qs[_0x4d63('0x1c')](_0x3499ac[_0x4d63('0x38')]['limit']);_0x5dcc36[_0x4d63('0x1b')]=qs[_0x4d63('0x1b')](_0x3499ac[_0x4d63('0x38')][_0x4d63('0x1b')]);}return _0x190e67['getBlackLists'](_0x5dcc36);}})[_0x4d63('0x21')](function(_0x11b836){if(_0x11b836){return _0x11b836?{'count':_0x2c5b87,'rows':_0x11b836}:null;}})[_0x4d63('0x21')](respondWithResult(_0x8bb1e0,null))[_0x4d63('0x49')](handleError(_0x8bb1e0,null));};exports[_0x4d63('0xb4')]=function(_0x382d6b,_0x33a957,_0x1489c0){var _0x29e09d,_0x264062;return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x382d6b[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x33a957,null))[_0x4d63('0x21')](function(_0x2d2e7b){if(_0x2d2e7b){_0x264062=_0x2d2e7b;return _0x2d2e7b['addBlackLists'](_0x382d6b['body'][_0x4d63('0x7c')],_['omit'](_0x382d6b[_0x4d63('0x4d')],[_0x4d63('0x7c'),'id'])||{});}return null;})[_0x4d63('0x91')](function(_0x1972a1){var _0x7c0c40;_0x29e09d=_0x1972a1||[];var _0x232648=[];if(_0x1972a1){for(var _0x43c10b=0x0;_0x43c10b<_0x1972a1[_0x4d63('0x5d')];_0x43c10b+=0x1){var _0x4c9d90=_0x1972a1[_0x43c10b][_0x4d63('0x23')]({'plain':!![]});_0x7c0c40=squel[_0x4d63('0x99')]()[_0x4d63('0x9a')](_0x4d63('0xb5'))[_0x4d63('0x9b')]([_0x4d63('0x9c'),_0x4d63('0x9e'),_0x4d63('0xa0'),'VoiceQueueId',_0x4d63('0x58'),'updatedAt'],squel[_0x4d63('0xa5')]()['field'](_0x4d63('0x9c'),_0x4d63('0x9c'))[_0x4d63('0x7d')]('id','ContactId')[_0x4d63('0x7d')](_0x4c9d90[_0x4d63('0x9f')][_0x4d63('0x85')](),_0x4d63('0xa0'))['field'](_0x382d6b[_0x4d63('0x4a')]['id'][_0x4d63('0x85')](),_0x4d63('0x5f'))[_0x4d63('0x7d')](_0x4d63('0xb6'),'createdAt')['field'](_0x4d63('0xb6'),'updatedAt')[_0x4d63('0x7e')](_0x4d63('0xaa'))[_0x4d63('0x40')]('deletedAt\x20IS\x20NULL')[_0x4d63('0x40')](_0x4d63('0xa1'),_0x4c9d90[_0x4d63('0x9f')]['toString']())['where'](_0x4d63('0xa2')))['toString']();_0x232648[_0x4d63('0x84')](db[_0x4d63('0x70')][_0x4d63('0x38')](_0x7c0c40));}return BPromise['all'](_0x232648);}})[_0x4d63('0x21')](function(){return _0x29e09d;})['then'](respondWithResult(_0x33a957,null))[_0x4d63('0x49')](handleError(_0x33a957,null));};exports[_0x4d63('0xb7')]=function(_0x4b7423,_0x3afa38,_0x553646){return db[_0x4d63('0x33')][_0x4d63('0x50')]({'where':{'id':_0x4b7423[_0x4d63('0x4a')]['id']}})[_0x4d63('0x21')](handleEntityNotFound(_0x3afa38,null))[_0x4d63('0x21')](function(_0x27fce0){if(_0x27fce0){return _0x27fce0[_0x4d63('0xb7')](_0x4b7423[_0x4d63('0x38')][_0x4d63('0x7c')]);}})[_0x4d63('0x21')](function(_0x3ae70b){if(_0x3ae70b){return db[_0x4d63('0x65')][_0x4d63('0x22')]({'where':{'ListId':_0x4b7423[_0x4d63('0x38')][_0x4d63('0x7c')],'VoiceQueueId':_0x4b7423['params']['id']}})[_0x4d63('0x21')](function(){return _0x3ae70b;});}})[_0x4d63('0x21')](respondWithStatusCode(_0x3afa38,null))[_0x4d63('0x49')](handleError(_0x3afa38,null));}; \ No newline at end of file +var _0xc599=['removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','union','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','emit','push','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','into','cm_hopper','fromQuery','ListId','phone','scheduledAt','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ContactId','all','cm_hopper_additional_phones','CmHopperId','h.id','ci.item','h.ContactId=ci.CmContactId','PHONE','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','register','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','value','includes','type','find','name','sendStatus','error','index','VoiceQueue','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','map','options','includeAll','include','findAll','rows','show','params','keys','create','user','role','outbound','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','updatedAt','omit','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','online','voicePause','interface','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','userVoiceQueue:save'];(function(_0x2bd70f,_0xd51d8a){var _0x19aeea=function(_0x5a2fbe){while(--_0x5a2fbe){_0x2bd70f['push'](_0x2bd70f['shift']());}};_0x19aeea(++_0xd51d8a);}(_0xc599,0x1b2));var _0x9c59=function(_0x536851,_0x2302b2){_0x536851=_0x536851-0x0;var _0x30e3bf=_0xc599[_0x536851];return _0x30e3bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c59('0x1'));var rp=require(_0x9c59('0x2'));var moment=require(_0x9c59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c59('0x4'));var util=require(_0x9c59('0x5'));var path=require(_0x9c59('0x6'));var sox=require(_0x9c59('0x7'));var csv=require(_0x9c59('0x8'));var ejs=require(_0x9c59('0x9'));var fs=require('fs');var fs_extra=require(_0x9c59('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c59('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c59('0xd'));var Papa=require(_0x9c59('0xe'));var Redis=require(_0x9c59('0xf'));var authService=require(_0x9c59('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c59('0x11'));var logger=require('../../config/logger')(_0x9c59('0x12'));var utils=require('../../config/utils');var config=require(_0x9c59('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c59('0x14'))['db'];config[_0x9c59('0x15')]=_[_0x9c59('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0x9c59('0x17')](socket);function respondWithStatusCode(_0xdfa957,_0x1b0f0d){_0x1b0f0d=_0x1b0f0d||0xcc;return function(_0xaa3cbe){if(_0xaa3cbe){return _0xdfa957['sendStatus'](_0x1b0f0d);}return _0xdfa957[_0x9c59('0x18')](_0x1b0f0d)[_0x9c59('0x19')]();};}function respondWithResult(_0x1d07fd,_0x562069){_0x562069=_0x562069||0xc8;return function(_0x5792d3){if(_0x5792d3){return _0x1d07fd['status'](_0x562069)[_0x9c59('0x1a')](_0x5792d3);}};}function respondWithFilteredResult(_0x36983f,_0x2081bd){return function(_0x19f372){if(_0x19f372){var _0x3faae5=typeof _0x2081bd[_0x9c59('0x1b')]===_0x9c59('0x1c')&&typeof _0x2081bd[_0x9c59('0x1d')]==='undefined';var _0x4eb316=_0x19f372['count'];var _0x43371d=_0x3faae5?0x0:_0x2081bd[_0x9c59('0x1b')];var _0x12402e=_0x3faae5?_0x19f372[_0x9c59('0x1e')]:_0x2081bd['offset']+_0x2081bd[_0x9c59('0x1d')];var _0x523dff;if(_0x12402e>=_0x4eb316){_0x12402e=_0x4eb316;_0x523dff=0xc8;}else{_0x523dff=0xce;}_0x36983f[_0x9c59('0x18')](_0x523dff);return _0x36983f[_0x9c59('0x1f')]('Content-Range',_0x43371d+'-'+_0x12402e+'/'+_0x4eb316)[_0x9c59('0x1a')](_0x19f372);}return null;};}function patchUpdates(_0x3611ca){return function(_0x1f5938){try{jsonpatch[_0x9c59('0x20')](_0x1f5938,_0x3611ca,!![]);}catch(_0x1e5853){return BPromise['reject'](_0x1e5853);}return _0x1f5938[_0x9c59('0x21')]();};}function saveUpdates(_0x2eb93e,_0x2405d2){return function(_0x5e1146){if(_0x5e1146){return _0x5e1146[_0x9c59('0x22')](_0x2eb93e)[_0x9c59('0x23')](function(_0x335e36){return _0x335e36;});}return null;};}function removeEntity(_0x20ad5c,_0x4f5542){return function(_0x41e458){if(_0x41e458){return _0x41e458[_0x9c59('0x24')]()[_0x9c59('0x23')](function(){var _0x597ffc=_0x41e458[_0x9c59('0x25')]({'plain':!![]});var _0x27e6b2=[{'name':_0x9c59('0x26'),'value':_0x9c59('0x27'),'ignore':![]},{'name':_0x9c59('0x28'),'value':'outbound','ignore':![]}];var _0x1e2a4b=_(_0x27e6b2)[_0x9c59('0x29')]('ignore')['map'](_0x9c59('0x2a'))[_0x9c59('0x2a')]();if(_[_0x9c59('0x2b')](_0x1e2a4b,_0x597ffc[_0x9c59('0x2c')])){return;}var _0x4a0e32=_[_0x9c59('0x2d')](_0x27e6b2,[_0x9c59('0x2a'),_0x597ffc[_0x9c59('0x2c')]])[_0x9c59('0x2e')];return db['UserProfileResource'][_0x9c59('0x24')]({'where':{'type':_0x4a0e32,'resourceId':_0x597ffc['id']}})[_0x9c59('0x23')](function(){return _0x41e458;});})[_0x9c59('0x23')](function(){_0x20ad5c[_0x9c59('0x18')](0xcc)[_0x9c59('0x19')]();});}};}function handleEntityNotFound(_0x450588,_0x1bad5f){return function(_0x29825e){if(!_0x29825e){_0x450588[_0x9c59('0x2f')](0x194);}return _0x29825e;};}function handleError(_0x41726e,_0x24b223){_0x24b223=_0x24b223||0x1f4;return function(_0xedf388){logger[_0x9c59('0x30')](_0xedf388['stack']);if(_0xedf388[_0x9c59('0x2e')]){delete _0xedf388[_0x9c59('0x2e')];}_0x41726e['status'](_0x24b223)['send'](_0xedf388);};}exports[_0x9c59('0x31')]=function(_0x288f12,_0x2c4d54){var _0x3b9aa5={},_0x56434e={},_0x2b244d={'count':0x0,'rows':[]};var _0x4407d7=_['map'](db[_0x9c59('0x32')][_0x9c59('0x33')],function(_0x47c725){return{'name':_0x47c725[_0x9c59('0x34')],'type':_0x47c725['type'][_0x9c59('0x35')]};});_0x56434e[_0x9c59('0x36')]=_['map'](_0x4407d7,_0x9c59('0x2e'));_0x56434e['query']=_['keys'](_0x288f12[_0x9c59('0x37')]);_0x56434e['filters']=_[_0x9c59('0x38')](_0x56434e['model'],_0x56434e['query']);_0x3b9aa5['attributes']=_[_0x9c59('0x38')](_0x56434e[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x288f12[_0x9c59('0x37')][_0x9c59('0x39')]));_0x3b9aa5[_0x9c59('0x3a')]=_0x3b9aa5['attributes'][_0x9c59('0x3b')]?_0x3b9aa5['attributes']:_0x56434e[_0x9c59('0x36')];if(!_0x288f12[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x3b9aa5[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x288f12['query'][_0x9c59('0x1d')]);_0x3b9aa5[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x288f12[_0x9c59('0x37')][_0x9c59('0x1b')]);}_0x3b9aa5[_0x9c59('0x3e')]=qs['sort'](_0x288f12[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x3b9aa5[_0x9c59('0x40')]=qs['filters'](_[_0x9c59('0x41')](_0x288f12[_0x9c59('0x37')],_0x56434e[_0x9c59('0x42')]),_0x4407d7);if(_0x288f12[_0x9c59('0x37')]['filter']){_0x3b9aa5[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x3b9aa5[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x4407d7,function(_0x1397aa){if(_0x1397aa[_0x9c59('0x2c')]!=='VIRTUAL'){var _0x593ccf={};_0x593ccf[_0x1397aa['name']]={'$like':'%'+_0x288f12['query'][_0x9c59('0x29')]+'%'};return _0x593ccf;}})});}_0x3b9aa5=_[_0x9c59('0x43')]({},_0x3b9aa5,_0x288f12[_0x9c59('0x45')]);var _0x470c5e={'where':_0x3b9aa5[_0x9c59('0x40')]};return db['VoiceQueue']['count'](_0x470c5e)[_0x9c59('0x23')](function(_0x1fd06b){_0x2b244d[_0x9c59('0x1e')]=_0x1fd06b;if(_0x288f12[_0x9c59('0x37')][_0x9c59('0x46')]){_0x3b9aa5[_0x9c59('0x47')]=[{'all':!![]}];}return db[_0x9c59('0x32')][_0x9c59('0x48')](_0x3b9aa5);})[_0x9c59('0x23')](function(_0x169ded){_0x2b244d[_0x9c59('0x49')]=_0x169ded;return _0x2b244d;})[_0x9c59('0x23')](respondWithFilteredResult(_0x2c4d54,_0x3b9aa5))['catch'](handleError(_0x2c4d54,null));};exports[_0x9c59('0x4a')]=function(_0x2c10c9,_0x4b2d14){var _0x2db0ba={'raw':![],'where':{'id':_0x2c10c9[_0x9c59('0x4b')]['id']}},_0x23affc={};_0x23affc[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x32')][_0x9c59('0x33')]);_0x23affc[_0x9c59('0x37')]=_['keys'](_0x2c10c9[_0x9c59('0x37')]);_0x23affc['filters']=_[_0x9c59('0x38')](_0x23affc[_0x9c59('0x36')],_0x23affc[_0x9c59('0x37')]);_0x2db0ba[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x23affc[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x2c10c9[_0x9c59('0x37')]['fields']));_0x2db0ba[_0x9c59('0x3a')]=_0x2db0ba[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x2db0ba[_0x9c59('0x3a')]:_0x23affc[_0x9c59('0x36')];if(_0x2c10c9[_0x9c59('0x37')][_0x9c59('0x46')]){_0x2db0ba[_0x9c59('0x47')]=[{'all':!![]}];}_0x2db0ba=_[_0x9c59('0x43')]({},_0x2db0ba,_0x2c10c9['options']);return db[_0x9c59('0x32')][_0x9c59('0x2d')](_0x2db0ba)[_0x9c59('0x23')](handleEntityNotFound(_0x4b2d14,null))[_0x9c59('0x23')](respondWithResult(_0x4b2d14,null))['catch'](handleError(_0x4b2d14,null));};exports[_0x9c59('0x4d')]=function(_0x46e6c0,_0x479f67){return db[_0x9c59('0x32')]['create'](_0x46e6c0['body'],{})[_0x9c59('0x23')](function(_0x8e2b39){var _0x3ecc91=_0x46e6c0[_0x9c59('0x4e')][_0x9c59('0x25')]({'plain':!![]});if(!_0x3ecc91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ecc91[_0x9c59('0x4f')]===_0x9c59('0x4e')){var _0x36f6ef=_0x8e2b39[_0x9c59('0x25')]({'plain':!![]});var _0x422fb0=[{'name':_0x9c59('0x26'),'value':_0x9c59('0x27')},{'name':'QueueCampaigns','value':_0x9c59('0x50')}];var _0x447e4f=_['find'](_0x422fb0,[_0x9c59('0x2a'),_0x36f6ef[_0x9c59('0x2c')]])[_0x9c59('0x2e')];return db[_0x9c59('0x51')][_0x9c59('0x2d')]({'where':{'name':_0x447e4f,'userProfileId':_0x3ecc91['userProfileId']},'raw':!![]})[_0x9c59('0x23')](function(_0x19cd40){if(_0x19cd40&&_0x19cd40[_0x9c59('0x52')]===0x0){return db[_0x9c59('0x53')][_0x9c59('0x4d')]({'name':_0x36f6ef[_0x9c59('0x2e')],'resourceId':_0x36f6ef['id'],'type':_0x19cd40[_0x9c59('0x2e')],'sectionId':_0x19cd40['id']},{})['then'](function(){return _0x8e2b39;});}else{return _0x8e2b39;}})['catch'](function(_0x3375b4){logger[_0x9c59('0x30')](_0x9c59('0x54'),_0x3375b4);throw _0x3375b4;});}return _0x8e2b39;})[_0x9c59('0x23')](respondWithResult(_0x479f67,0xc9))[_0x9c59('0x55')](handleError(_0x479f67,null));};exports['clone']=function(_0x1acd80,_0x4cd16f){var _0x2357b0={'where':{'id':_0x1acd80[_0x9c59('0x4b')]['id']}},_0x553599={};_0x553599[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x32')][_0x9c59('0x33')]);_0x2357b0[_0x9c59('0x3a')]=_['intersection'](_0x553599['model'],qs[_0x9c59('0x39')](_0x1acd80[_0x9c59('0x37')][_0x9c59('0x39')]));_0x2357b0[_0x9c59('0x3a')]=_0x2357b0['attributes'][_0x9c59('0x3b')]?_0x2357b0[_0x9c59('0x3a')]:_0x553599['model'];if(_0x1acd80[_0x9c59('0x37')][_0x9c59('0x46')]){_0x2357b0[_0x9c59('0x47')]=[{'all':!![]}];}_0x2357b0=_[_0x9c59('0x43')]({},_0x2357b0,_0x1acd80[_0x9c59('0x45')]);return db[_0x9c59('0x32')][_0x9c59('0x2d')](_0x2357b0)[_0x9c59('0x23')](handleEntityNotFound(_0x4cd16f,null))[_0x9c59('0x23')](function(_0x386ebd){if(_0x386ebd){var _0x1a638c=_0x386ebd[_0x9c59('0x25')]({'plain':!![]});_0x1a638c=qs['omit'](_0x1a638c,['id','createdAt',_0x9c59('0x56')]);_0x1acd80['body']=_[_0x9c59('0x57')](_0x1acd80[_0x9c59('0x58')],['id',_0x9c59('0x59'),'updatedAt']);return db[_0x9c59('0x32')][_0x9c59('0x4d')](_['merge'](_0x1a638c,_0x1acd80[_0x9c59('0x58')]),{'include':_0x1acd80[_0x9c59('0x37')][_0x9c59('0x46')]?[{'all':!![]}]:undefined})[_0x9c59('0x23')](function(_0xf5e341){var _0x431f2f=_0x1acd80[_0x9c59('0x4e')]['get']({'plain':!![]});if(!_0x431f2f)throw new Error(_0x9c59('0x5a'));if(_0x431f2f[_0x9c59('0x4f')]===_0x9c59('0x4e')){var _0x3f6077=_0xf5e341[_0x9c59('0x25')]({'plain':!![]});var _0x269f0e=[{'name':_0x9c59('0x26'),'value':_0x9c59('0x27')},{'name':_0x9c59('0x28'),'value':'outbound'}];var _0x30dc57=_[_0x9c59('0x2d')](_0x269f0e,[_0x9c59('0x2a'),_0x3f6077['type']])[_0x9c59('0x2e')];return db['UserProfileSection'][_0x9c59('0x2d')]({'where':{'name':_0x30dc57,'userProfileId':_0x431f2f[_0x9c59('0x5b')]},'raw':!![]})[_0x9c59('0x23')](function(_0x574ad2){if(_0x574ad2&&_0x574ad2[_0x9c59('0x52')]===0x0){return db[_0x9c59('0x53')][_0x9c59('0x4d')]({'name':_0x3f6077['name'],'resourceId':_0x3f6077['id'],'type':_0x574ad2[_0x9c59('0x2e')],'sectionId':_0x574ad2['id']},{})['then'](function(){return _0xf5e341;});}else{return _0xf5e341;}})[_0x9c59('0x55')](function(_0x43de6f){logger[_0x9c59('0x30')](_0x9c59('0x54'),_0x43de6f);throw _0x43de6f;});}return _0xf5e341;});}})[_0x9c59('0x23')](respondWithResult(_0x4cd16f,0xc9))['catch'](handleError(_0x4cd16f,null));};exports[_0x9c59('0x22')]=function(_0x30947f,_0x88c569){if(_0x30947f[_0x9c59('0x58')]['id']){delete _0x30947f['body']['id'];}return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x30947f[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x88c569,null))[_0x9c59('0x23')](saveUpdates(_0x30947f[_0x9c59('0x58')],null))[_0x9c59('0x23')](respondWithResult(_0x88c569,null))[_0x9c59('0x55')](handleError(_0x88c569,null));};exports['destroy']=function(_0x5a86b7,_0x261845){return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x5a86b7[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x261845,null))['then'](removeEntity(_0x261845,null))[_0x9c59('0x55')](handleError(_0x261845,null));};exports[_0x9c59('0x5c')]=function(_0x447c42,_0x328010,_0x5b3b6){var _0x3a920b={'raw':![],'where':{}};var _0x21075f={};var _0x35033d={'count':0x0,'rows':[]};return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x447c42['params']['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x328010,null))[_0x9c59('0x23')](function(_0x35744b){if(_0x35744b){_0x21075f['model']=_[_0x9c59('0x4c')](db[_0x9c59('0x5e')][_0x9c59('0x33')]);_0x21075f[_0x9c59('0x37')]=_['keys'](_0x447c42[_0x9c59('0x37')]);_0x21075f['filters']=_[_0x9c59('0x38')](_0x21075f[_0x9c59('0x36')],_0x21075f[_0x9c59('0x37')]);_0x3a920b[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x21075f[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x447c42[_0x9c59('0x37')]['fields']));_0x3a920b['attributes']=_0x3a920b['attributes'][_0x9c59('0x3b')]?_0x3a920b[_0x9c59('0x3a')]:_0x21075f[_0x9c59('0x36')];if(!_0x447c42[_0x9c59('0x37')][_0x9c59('0x3c')]('nolimit')){_0x3a920b[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x447c42['query'][_0x9c59('0x1d')]);_0x3a920b[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x447c42[_0x9c59('0x37')][_0x9c59('0x1b')]);}_0x3a920b[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x447c42[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x3a920b[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x447c42[_0x9c59('0x37')],_0x21075f[_0x9c59('0x42')]));_0x3a920b['where'][_0x9c59('0x5f')]=_0x35744b['id'];if(_0x447c42[_0x9c59('0x37')][_0x9c59('0x29')]){_0x3a920b[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x3a920b[_0x9c59('0x40')],{'$or':_['map'](_0x3a920b['attributes'],function(_0x22b2ea){var _0xe1c117={};_0xe1c117[_0x22b2ea]={'$like':'%'+_0x447c42[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0xe1c117;})});}_0x3a920b=_[_0x9c59('0x43')]({},_0x3a920b,_0x447c42[_0x9c59('0x45')]);return db[_0x9c59('0x5e')][_0x9c59('0x1e')]({'where':_0x3a920b[_0x9c59('0x40')]})[_0x9c59('0x23')](function(_0x1dae4f){_0x35033d['count']=_0x1dae4f;if(_0x447c42['query'][_0x9c59('0x46')]){_0x3a920b['include']=[{'all':!![]}];}return db[_0x9c59('0x5e')][_0x9c59('0x48')](_0x3a920b);})[_0x9c59('0x23')](function(_0x4fd5f){_0x35033d[_0x9c59('0x49')]=_0x4fd5f;return _0x35033d;});}})[_0x9c59('0x23')](respondWithFilteredResult(_0x328010,_0x3a920b))[_0x9c59('0x55')](handleError(_0x328010,null));};exports['getHopperHistories']=function(_0x4cee27,_0x518443,_0x233645){var _0x3daff9={'raw':!![],'where':{}};var _0x45db7d={};var _0x4d50b5={'count':0x0,'rows':[]};return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x4cee27[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x518443,null))[_0x9c59('0x23')](function(_0x227d4e){if(_0x227d4e){_0x45db7d[_0x9c59('0x36')]=_['keys'](db[_0x9c59('0x60')][_0x9c59('0x33')]);_0x45db7d['query']=_[_0x9c59('0x4c')](_0x4cee27[_0x9c59('0x37')]);_0x45db7d['filters']=_[_0x9c59('0x38')](_0x45db7d[_0x9c59('0x36')],_0x45db7d[_0x9c59('0x37')]);_0x3daff9['attributes']=_[_0x9c59('0x38')](_0x45db7d['model'],qs[_0x9c59('0x39')](_0x4cee27['query'][_0x9c59('0x39')]));_0x3daff9['attributes']=_0x3daff9[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x3daff9['attributes']:_0x45db7d[_0x9c59('0x36')];if(!_0x4cee27[_0x9c59('0x37')][_0x9c59('0x3c')]('nolimit')){_0x3daff9[_0x9c59('0x1d')]=qs['limit'](_0x4cee27[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x3daff9[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x4cee27[_0x9c59('0x37')][_0x9c59('0x1b')]);}_0x3daff9[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x4cee27['query'][_0x9c59('0x3f')]);_0x3daff9['where']=qs['filters'](_[_0x9c59('0x41')](_0x4cee27[_0x9c59('0x37')],_0x45db7d[_0x9c59('0x42')]));_0x3daff9[_0x9c59('0x40')][_0x9c59('0x5f')]=_0x227d4e['id'];if(_0x4cee27['query']['filter']){_0x3daff9[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x3daff9[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x3daff9[_0x9c59('0x3a')],function(_0x31421c){var _0x4b6915={};_0x4b6915[_0x31421c]={'$like':'%'+_0x4cee27[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x4b6915;})});}_0x3daff9=_[_0x9c59('0x43')]({},_0x3daff9,_0x4cee27['options']);return db[_0x9c59('0x60')][_0x9c59('0x1e')]({'where':_0x3daff9['where']})[_0x9c59('0x23')](function(_0x3e67d3){_0x4d50b5[_0x9c59('0x1e')]=_0x3e67d3;if(_0x4cee27[_0x9c59('0x37')][_0x9c59('0x46')]){_0x3daff9[_0x9c59('0x47')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3daff9);})[_0x9c59('0x23')](function(_0x43b5c1){_0x4d50b5[_0x9c59('0x49')]=_0x43b5c1;return _0x4d50b5;});}})['then'](respondWithFilteredResult(_0x518443,_0x3daff9))[_0x9c59('0x55')](handleError(_0x518443,null));};exports[_0x9c59('0x61')]=function(_0x12b242,_0x246518,_0x5f19c8){var _0x109c38={'raw':!![],'where':{}};var _0x56c179={};var _0x5a2b37={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9c59('0x5d')]({'where':{'id':_0x12b242[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x246518,null))['then'](function(_0x160096){if(_0x160096){_0x56c179[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x62')][_0x9c59('0x33')]);_0x56c179[_0x9c59('0x37')]=_['keys'](_0x12b242['query']);_0x56c179['filters']=_[_0x9c59('0x38')](_0x56c179[_0x9c59('0x36')],_0x56c179[_0x9c59('0x37')]);_0x109c38['attributes']=_['intersection'](_0x56c179['model'],qs[_0x9c59('0x39')](_0x12b242[_0x9c59('0x37')][_0x9c59('0x39')]));_0x109c38[_0x9c59('0x3a')]=_0x109c38[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x109c38[_0x9c59('0x3a')]:_0x56c179[_0x9c59('0x36')];if(!_0x12b242['query'][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x109c38[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x12b242['query']['limit']);_0x109c38[_0x9c59('0x1b')]=qs['offset'](_0x12b242['query'][_0x9c59('0x1b')]);}_0x109c38[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x12b242[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x109c38[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x12b242[_0x9c59('0x37')],_0x56c179[_0x9c59('0x42')]));_0x109c38[_0x9c59('0x40')][_0x9c59('0x5f')]=_0x160096['id'];if(_0x12b242[_0x9c59('0x37')][_0x9c59('0x29')]){_0x109c38[_0x9c59('0x40')]=_['merge'](_0x109c38[_0x9c59('0x40')],{'$or':_['map'](_0x109c38['attributes'],function(_0x37e5ae){var _0x2384ec={};_0x2384ec[_0x37e5ae]={'$like':'%'+_0x12b242[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x2384ec;})});}_0x109c38=_['merge']({},_0x109c38,_0x12b242[_0x9c59('0x45')]);return db[_0x9c59('0x62')][_0x9c59('0x1e')]({'where':_0x109c38[_0x9c59('0x40')]})[_0x9c59('0x23')](function(_0x45d1d7){_0x5a2b37[_0x9c59('0x1e')]=_0x45d1d7;if(_0x12b242[_0x9c59('0x37')][_0x9c59('0x46')]){_0x109c38[_0x9c59('0x47')]=[{'all':!![]}];}return db[_0x9c59('0x62')][_0x9c59('0x48')](_0x109c38);})[_0x9c59('0x23')](function(_0x5c1dc2){_0x5a2b37[_0x9c59('0x49')]=_0x5c1dc2;return _0x5a2b37;});}})['then'](respondWithFilteredResult(_0x246518,_0x109c38))[_0x9c59('0x55')](handleError(_0x246518,null));};exports[_0x9c59('0x63')]=function(_0x137a4f,_0x3ce6c4,_0x403e48){var _0x2dbc60={'raw':!![],'where':{}};var _0x3fd0b7={};var _0x275be5={'count':0x0,'rows':[]};return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x137a4f[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x3ce6c4,null))[_0x9c59('0x23')](function(_0x35b214){if(_0x35b214){_0x3fd0b7[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x64')][_0x9c59('0x33')]);_0x3fd0b7['query']=_[_0x9c59('0x4c')](_0x137a4f[_0x9c59('0x37')]);_0x3fd0b7[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x3fd0b7[_0x9c59('0x36')],_0x3fd0b7[_0x9c59('0x37')]);_0x2dbc60[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x3fd0b7[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x137a4f[_0x9c59('0x37')]['fields']));_0x2dbc60['attributes']=_0x2dbc60[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x2dbc60[_0x9c59('0x3a')]:_0x3fd0b7[_0x9c59('0x36')];if(!_0x137a4f[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x2dbc60['limit']=qs['limit'](_0x137a4f[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x2dbc60[_0x9c59('0x1b')]=qs['offset'](_0x137a4f['query']['offset']);}_0x2dbc60[_0x9c59('0x3e')]=qs['sort'](_0x137a4f['query'][_0x9c59('0x3f')]);_0x2dbc60['where']=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x137a4f[_0x9c59('0x37')],_0x3fd0b7[_0x9c59('0x42')]));_0x2dbc60[_0x9c59('0x40')]['VoiceQueueId']=_0x35b214['id'];if(_0x137a4f[_0x9c59('0x37')][_0x9c59('0x29')]){_0x2dbc60[_0x9c59('0x40')]=_['merge'](_0x2dbc60[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x2dbc60[_0x9c59('0x3a')],function(_0x7e9e64){var _0x10dd7f={};_0x10dd7f[_0x7e9e64]={'$like':'%'+_0x137a4f[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x10dd7f;})});}_0x2dbc60=_[_0x9c59('0x43')]({},_0x2dbc60,_0x137a4f['options']);return db[_0x9c59('0x64')]['count']({'where':_0x2dbc60[_0x9c59('0x40')]})[_0x9c59('0x23')](function(_0x199679){_0x275be5[_0x9c59('0x1e')]=_0x199679;if(_0x137a4f[_0x9c59('0x37')][_0x9c59('0x46')]){_0x2dbc60[_0x9c59('0x47')]=[{'all':!![]}];}return db[_0x9c59('0x64')][_0x9c59('0x48')](_0x2dbc60);})[_0x9c59('0x23')](function(_0x450e2a){_0x275be5['rows']=_0x450e2a;return _0x275be5;});}})[_0x9c59('0x23')](respondWithFilteredResult(_0x3ce6c4,_0x2dbc60))['catch'](handleError(_0x3ce6c4,null));};exports[_0x9c59('0x65')]=function(_0x2cc893,_0x9a813a,_0x51329c){var _0x36696b={};var _0x1b0475={};var _0x44762a;var _0x575da6;return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x2cc893[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x9a813a,null))[_0x9c59('0x23')](function(_0x39b201){if(_0x39b201){_0x44762a=_0x39b201;_0x1b0475[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db['Team'][_0x9c59('0x33')]);_0x1b0475[_0x9c59('0x37')]=_[_0x9c59('0x4c')](_0x2cc893['query']);_0x1b0475[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x1b0475['model'],_0x1b0475[_0x9c59('0x37')]);_0x36696b[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x1b0475[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x2cc893[_0x9c59('0x37')][_0x9c59('0x39')]));_0x36696b['attributes']=_0x36696b[_0x9c59('0x3a')]['length']?_0x36696b['attributes']:_0x1b0475['model'];_0x36696b[_0x9c59('0x3e')]=qs['sort'](_0x2cc893[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x36696b[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x2cc893[_0x9c59('0x37')],_0x1b0475[_0x9c59('0x42')]));if(_0x2cc893[_0x9c59('0x37')][_0x9c59('0x29')]){_0x36696b['where']=_[_0x9c59('0x43')](_0x36696b['where'],{'$or':_[_0x9c59('0x44')](_0x36696b[_0x9c59('0x3a')],function(_0x32a78a){var _0x41f665={};_0x41f665[_0x32a78a]={'$like':'%'+_0x2cc893[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x41f665;})});}_0x36696b=_[_0x9c59('0x43')]({},_0x36696b,_0x2cc893['options']);return _0x44762a[_0x9c59('0x65')](_0x36696b);}})[_0x9c59('0x23')](function(_0x106faf){if(_0x106faf){_0x575da6=_0x106faf['length'];if(!_0x2cc893[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x36696b['limit']=qs[_0x9c59('0x1d')](_0x2cc893['query'][_0x9c59('0x1d')]);_0x36696b[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x2cc893[_0x9c59('0x37')][_0x9c59('0x1b')]);}return _0x44762a[_0x9c59('0x65')](_0x36696b);}})[_0x9c59('0x23')](function(_0x35ffa6){if(_0x35ffa6){return _0x35ffa6?{'count':_0x575da6,'rows':_0x35ffa6}:null;}})[_0x9c59('0x23')](respondWithResult(_0x9a813a,null))[_0x9c59('0x55')](handleError(_0x9a813a,null));};exports[_0x9c59('0x66')]=function(_0x15a407,_0x1c7c0b,_0x184d8){var _0x15d277=_0x15a407['body']['teams'];var _0x483143=_[_0x9c59('0x44')](_0x15d277,'id');return db[_0x9c59('0x67')]['findAll']({'where':{'id':_0x483143},'attributes':['id'],'include':[{'model':db[_0x9c59('0x68')],'as':'Agents','attributes':['id','name',_0x9c59('0x69'),_0x9c59('0x6a'),_0x9c59('0x6b')],'raw':!![]}]})[_0x9c59('0x23')](function(_0x5d2e58){if(_0x5d2e58){var _0x3d05c1=_['flatMap'](_0x5d2e58,function(_0xf2e33b){var _0x51ec5c=_0xf2e33b[_0x9c59('0x25')]({'plain':!![]});_0x51ec5c[_0x9c59('0x6c')][_0x9c59('0x6d')](function(_0x5c5ec2){_0x5c5ec2['penalty']=_[_0x9c59('0x2d')](_0x15d277,{'id':_0x51ec5c['id']})[_0x9c59('0x6e')];});return _0x51ec5c[_0x9c59('0x6c')];});return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x15a407[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](function(_0x4a1261){return db[_0x9c59('0x6f')][_0x9c59('0x70')](function(_0x4be839){return _0x4a1261[_0x9c59('0x66')](_0x483143,{'transaction':_0x4be839})[_0x9c59('0x23')](function(){return BPromise[_0x9c59('0x71')](_0x15d277,function(_0x47680e){return db[_0x9c59('0x72')]['upsert']({'TeamId':_0x47680e['id'],'VoiceQueueId':_0x15a407['params']['id'],'penalty':_0x47680e['penalty']},{'transaction':_0x4be839});});})[_0x9c59('0x23')](function(){return BPromise[_0x9c59('0x71')](_0x3d05c1,function(_0x571ff0){return db[_0x9c59('0x73')]['findOrCreate']({'where':{'UserId':_0x571ff0['id'],'VoiceQueueId':_0x15a407[_0x9c59('0x4b')]['id']},'defaults':{'penalty':_0x571ff0[_0x9c59('0x6e')]},'transaction':_0x4be839});});})[_0x9c59('0x23')](function(){return BPromise['each'](_[_0x9c59('0x29')](_0x3d05c1,{'online':!![]}),function(_0x225eb6){return db[_0x9c59('0x74')][_0x9c59('0x75')]({'membername':_0x225eb6[_0x9c59('0x2e')],'UserId':_0x225eb6['id'],'queue_name':_0x4a1261[_0x9c59('0x2e')],'VoiceQueueId':_0x4a1261['id'],'interface':_[_0x9c59('0x76')](_0x225eb6[_0x9c59('0x6b')])?util[_0x9c59('0x77')]('SIP/%s',_0x225eb6[_0x9c59('0x2e')]):_0x225eb6['interface'],'paused':_0x225eb6['voicePause']||![],'penalty':_0x225eb6[_0x9c59('0x6e')]},{'transaction':_0x4be839});});})['then'](function(){_0x3d05c1['forEach'](function(_0x31c4e7){socket['emit'](_0x9c59('0x78'),{'UserId':_0x31c4e7['id'],'VoiceQueueId':_0x4a1261['id']});});});});});}})['then'](respondWithStatusCode(_0x1c7c0b,null))[_0x9c59('0x55')](handleError(_0x1c7c0b,null));};exports[_0x9c59('0x79')]=function(_0x55043a,_0x58c2f1,_0x218b55){return db[_0x9c59('0x67')][_0x9c59('0x48')]({'where':{'id':_0x55043a[_0x9c59('0x37')][_0x9c59('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x9c59('0x68')],'as':_0x9c59('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x9c59('0x23')](handleEntityNotFound(_0x58c2f1,null))[_0x9c59('0x23')](function(_0x40e684){var _0x1e6f0d=_[_0x9c59('0x44')](_0x40e684,'id');var _0xc80265=[];var _0x28f3bc=[];var _0x252f03=squel[_0x9c59('0x7b')]();_0x252f03[_0x9c59('0x7c')](_0x9c59('0x7d'))[_0x9c59('0x7e')](_0x9c59('0x7f'),'tq')[_0x9c59('0x80')](_0x9c59('0x81'),'ut',_0x9c59('0x82'))[_0x9c59('0x40')](_0x9c59('0x83'),_0x55043a['params']['id']);for(var _0x1aab32=0x0;_0x1aab32<_0x40e684['length'];_0x1aab32+=0x1){let _0x30154e=_0x40e684[_0x1aab32];for(var _0x3e4992=0x0;_0x3e4992<_0x30154e[_0x9c59('0x6c')][_0x9c59('0x3b')];_0x3e4992+=0x1){let _0x12b147=_0x30154e[_0x9c59('0x6c')][_0x3e4992];var _0x43742c=_0x252f03[_0x9c59('0x84')]();_0x43742c[_0x9c59('0x40')](_0x9c59('0x85'),_0x12b147['id']);_0x28f3bc['push'](db['sequelize'][_0x9c59('0x37')](_0x43742c[_0x9c59('0x86')](),{'type':db[_0x9c59('0x6f')][_0x9c59('0x87')][_0x9c59('0x88')]})['then'](function(_0x4b819b){if(_0x4b819b[_0x9c59('0x3b')]===0x1){return _0x12b147['id'];}else{var _0x363e34=_[_0x9c59('0x89')](_[_0x9c59('0x44')](_0x4b819b,_0x9c59('0x8a')),function(_0x4c47e2){return _[_0x9c59('0x2b')](_0x1e6f0d,_0x4c47e2);});if(_0x363e34){return _0x12b147['id'];}}}));}}return BPromise['all'](_0x28f3bc)[_0x9c59('0x23')](function(_0x581941){_0xc80265=_(_0xc80265)[_0x9c59('0x8b')](_0x581941)[_0x9c59('0x8c')]()['value']();return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x55043a[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](function(_0x25f08b){return db['sequelize'][_0x9c59('0x70')](function(_0x2e5c92){return _0x25f08b[_0x9c59('0x79')](_0x55043a[_0x9c59('0x37')][_0x9c59('0x7a')],{'transaction':_0x2e5c92})['then'](function(){if(!_[_0x9c59('0x8d')](_0xc80265)){return _0x25f08b['removeAgents'](_0xc80265,{'transaction':_0x2e5c92})['then'](function(){return db[_0x9c59('0x74')][_0x9c59('0x24')]({'where':{'VoiceQueueId':_0x55043a[_0x9c59('0x4b')]['id'],'UserId':_0xc80265},'transaction':_0x2e5c92});});}})[_0x9c59('0x23')](function(){_0xc80265[_0x9c59('0x6d')](function(_0x2e3cbc){socket['emit'](_0x9c59('0x8e'),{'UserId':_0x2e3cbc,'VoiceQueueId':_0x25f08b['id']});});});});});});})[_0x9c59('0x23')](respondWithStatusCode(_0x58c2f1,null))[_0x9c59('0x55')](handleError(_0x58c2f1,null));};exports[_0x9c59('0x8f')]=function(_0x19eaab,_0x771c90,_0x27d567){var _0x34415d,_0x3037e0;return db[_0x9c59('0x32')]['find']({'where':{'id':_0x19eaab[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x771c90,null))[_0x9c59('0x23')](function(_0x593799){if(_0x593799){_0x3037e0=_0x593799;return _0x593799[_0x9c59('0x8f')](_0x19eaab[_0x9c59('0x58')][_0x9c59('0x7a')],_[_0x9c59('0x57')](_0x19eaab[_0x9c59('0x58')],[_0x9c59('0x7a'),'id'])||{})[_0x9c59('0x90')](function(_0x20d05e){for(var _0x47b277=0x0;_0x47b277<_0x19eaab['body']['ids']['length'];_0x47b277+=0x1){socket[_0x9c59('0x91')](_0x9c59('0x78'),{'UserId':Number(_0x19eaab[_0x9c59('0x58')][_0x9c59('0x7a')][_0x47b277]),'VoiceQueueId':Number(_0x19eaab['params']['id'])});}return _0x20d05e;});}})['then'](function(_0x1629f5){_0x34415d=_0x1629f5||[];if(_0x3037e0){return db[_0x9c59('0x68')][_0x9c59('0x48')]({'where':{'id':_0x19eaab[_0x9c59('0x58')][_0x9c59('0x7a')]},'attributes':['id',_0x9c59('0x2e'),_0x9c59('0x69'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x3cde22){if(!_[_0x9c59('0x8d')](_0x3cde22)){var _0x96b4be=[];for(var _0x48250d=0x0;_0x48250d<_0x3cde22[_0x9c59('0x3b')];_0x48250d++){if(_0x3cde22[_0x48250d][_0x9c59('0x69')]){_0x96b4be[_0x9c59('0x92')](db[_0x9c59('0x74')][_0x9c59('0x75')]({'membername':_0x3cde22[_0x48250d][_0x9c59('0x2e')],'UserId':_0x3cde22[_0x48250d]['id'],'queue_name':_0x3037e0['name'],'VoiceQueueId':_0x3037e0['id'],'interface':_[_0x9c59('0x76')](_0x3cde22[_0x48250d]['interface'])?util[_0x9c59('0x77')](_0x9c59('0x93'),_0x3cde22[_0x48250d]['name']):_0x3cde22[_0x48250d][_0x9c59('0x6b')],'paused':_0x3cde22[_0x48250d][_0x9c59('0x6a')]||![],'penalty':_0x19eaab[_0x9c59('0x58')][_0x9c59('0x6e')]||0x0}));}}return BPromise['all'](_0x96b4be);}})[_0x9c59('0x23')](function(){return _0x34415d;})[_0x9c59('0x23')](respondWithResult(_0x771c90,null))[_0x9c59('0x55')](handleError(_0x771c90,null));};exports['removeAgents']=function(_0x2f9e6a,_0x4a98b8,_0x2ff9e7){return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x2f9e6a['params']['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x4a98b8,null))['then'](function(_0x9e046c){if(_0x9e046c){return _0x9e046c['removeAgents'](_0x2f9e6a[_0x9c59('0x37')]['ids'])[_0x9c59('0x23')](function(){if(_['isArray'](_0x2f9e6a[_0x9c59('0x37')][_0x9c59('0x7a')])){for(var _0x37bc52=0x0;_0x37bc52<_0x2f9e6a[_0x9c59('0x37')][_0x9c59('0x7a')][_0x9c59('0x3b')];_0x37bc52+=0x1){socket[_0x9c59('0x91')](_0x9c59('0x8e'),{'UserId':Number(_0x2f9e6a[_0x9c59('0x37')][_0x9c59('0x7a')][_0x37bc52]),'VoiceQueueId':Number(_0x2f9e6a['params']['id'])});}}else{socket['emit'](_0x9c59('0x8e'),{'UserId':Number(_0x2f9e6a['query']['ids']),'VoiceQueueId':Number(_0x2f9e6a[_0x9c59('0x4b')]['id'])});}});}})[_0x9c59('0x23')](function(_0xd0d643){return db['UserVoiceQueueRt'][_0x9c59('0x24')]({'where':{'VoiceQueueId':_0x2f9e6a[_0x9c59('0x4b')]['id'],'UserId':_0x2f9e6a['query'][_0x9c59('0x7a')]}})[_0x9c59('0x23')](function(){return _0xd0d643;});})['then'](respondWithStatusCode(_0x4a98b8,null))[_0x9c59('0x55')](handleError(_0x4a98b8,null));};exports['getAgents']=function(_0x216394,_0x5a3968,_0x599f2d){var _0x23fe93={};var _0x156ae4={};var _0x370930;var _0x133bf5;return db['VoiceQueue'][_0x9c59('0x5d')]({'where':{'id':_0x216394['params']['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x5a3968,null))[_0x9c59('0x23')](function(_0x5eb407){if(_0x5eb407){_0x370930=_0x5eb407;_0x156ae4[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x68')][_0x9c59('0x33')]);_0x156ae4[_0x9c59('0x37')]=_[_0x9c59('0x4c')](_0x216394[_0x9c59('0x37')]);_0x156ae4[_0x9c59('0x42')]=_['intersection'](_0x156ae4[_0x9c59('0x36')],_0x156ae4[_0x9c59('0x37')]);_0x23fe93[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x156ae4[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x216394[_0x9c59('0x37')]['fields']));_0x23fe93[_0x9c59('0x3a')]=_0x23fe93[_0x9c59('0x3a')]['length']?_0x23fe93[_0x9c59('0x3a')]:_0x156ae4['model'];_0x23fe93[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x216394['query'][_0x9c59('0x3f')]);_0x23fe93[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_['pick'](_0x216394['query'],_0x156ae4[_0x9c59('0x42')]));if(_0x216394[_0x9c59('0x37')][_0x9c59('0x29')]){_0x23fe93[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x23fe93[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x23fe93['attributes'],function(_0x49523c){var _0x5e26be={};_0x5e26be[_0x49523c]={'$like':'%'+_0x216394[_0x9c59('0x37')]['filter']+'%'};return _0x5e26be;})});}_0x23fe93=_[_0x9c59('0x43')]({},_0x23fe93,_0x216394[_0x9c59('0x45')]);return _0x370930[_0x9c59('0x94')](_0x23fe93);}})[_0x9c59('0x23')](function(_0x47bd44){if(_0x47bd44){_0x133bf5=_0x47bd44[_0x9c59('0x3b')];if(!_0x216394[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x23fe93[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x216394[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x23fe93[_0x9c59('0x1b')]=qs[_0x9c59('0x1b')](_0x216394[_0x9c59('0x37')]['offset']);}return _0x370930[_0x9c59('0x94')](_0x23fe93);}})[_0x9c59('0x23')](function(_0x203531){if(_0x203531){return _0x203531?{'count':_0x133bf5,'rows':_0x203531}:null;}})[_0x9c59('0x23')](respondWithResult(_0x5a3968,null))[_0x9c59('0x55')](handleError(_0x5a3968,null));};exports[_0x9c59('0x95')]=function(_0x4fb693,_0x44f1c3,_0x4385e9){var _0x93fb86={};var _0x1324ef={};var _0x1eff8d;var _0x2ecb59;return db[_0x9c59('0x32')]['findOne']({'where':{'id':_0x4fb693[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x44f1c3,null))[_0x9c59('0x23')](function(_0x461cd9){if(_0x461cd9){_0x1eff8d=_0x461cd9;_0x1324ef[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x74')][_0x9c59('0x33')]);_0x1324ef[_0x9c59('0x37')]=_[_0x9c59('0x4c')](_0x4fb693[_0x9c59('0x37')]);_0x1324ef[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x1324ef['model'],_0x1324ef[_0x9c59('0x37')]);_0x93fb86[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x1324ef[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x4fb693[_0x9c59('0x37')][_0x9c59('0x39')]));_0x93fb86[_0x9c59('0x3a')]=_0x93fb86[_0x9c59('0x3a')]['length']?_0x93fb86[_0x9c59('0x3a')]:_0x1324ef[_0x9c59('0x36')];_0x93fb86[_0x9c59('0x3e')]=qs[_0x9c59('0x3f')](_0x4fb693[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x93fb86['where']=qs['filters'](_[_0x9c59('0x41')](_0x4fb693[_0x9c59('0x37')],_0x1324ef[_0x9c59('0x42')]));if(_0x4fb693[_0x9c59('0x37')]['filter']){_0x93fb86[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x93fb86['where'],{'$or':_[_0x9c59('0x44')](_0x93fb86[_0x9c59('0x3a')],function(_0x5e9ba9){var _0x15cb14={};_0x15cb14[_0x5e9ba9]={'$like':'%'+_0x4fb693[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x15cb14;})});}_0x93fb86=_[_0x9c59('0x43')]({},_0x93fb86,_0x4fb693['options']);return _0x1eff8d[_0x9c59('0x95')](_0x93fb86);}})[_0x9c59('0x23')](function(_0x4f55aa){if(_0x4f55aa){_0x2ecb59=_0x4f55aa['length'];if(!_0x4fb693[_0x9c59('0x37')][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x93fb86[_0x9c59('0x1d')]=qs[_0x9c59('0x1d')](_0x4fb693[_0x9c59('0x37')]['limit']);_0x93fb86['offset']=qs['offset'](_0x4fb693[_0x9c59('0x37')][_0x9c59('0x1b')]);}return _0x1eff8d['getMembers'](_0x93fb86);}})[_0x9c59('0x23')](function(_0x97506f){return _0x97506f?{'count':_0x2ecb59,'rows':_0x97506f}:null;})[_0x9c59('0x23')](respondWithResult(_0x44f1c3,null))[_0x9c59('0x55')](handleError(_0x44f1c3,null));};exports[_0x9c59('0x96')]=function(_0x41ecf9,_0x3c630f,_0x4925e3){var _0x113f1f={};var _0x65ab44={};var _0x3fa95a;var _0x3814e3;return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x41ecf9[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c630f,null))[_0x9c59('0x23')](function(_0x3619d0){if(_0x3619d0){_0x3fa95a=_0x3619d0;_0x65ab44[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x97')][_0x9c59('0x33')]);_0x65ab44['query']=_[_0x9c59('0x4c')](_0x41ecf9[_0x9c59('0x37')]);_0x65ab44[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x65ab44[_0x9c59('0x36')],_0x65ab44[_0x9c59('0x37')]);_0x113f1f['attributes']=_['intersection'](_0x65ab44[_0x9c59('0x36')],qs['fields'](_0x41ecf9[_0x9c59('0x37')]['fields']));_0x113f1f[_0x9c59('0x3a')]=_0x113f1f[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x113f1f['attributes']:_0x65ab44[_0x9c59('0x36')];_0x113f1f[_0x9c59('0x3e')]=qs['sort'](_0x41ecf9[_0x9c59('0x37')][_0x9c59('0x3f')]);_0x113f1f[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x41ecf9[_0x9c59('0x37')],_0x65ab44[_0x9c59('0x42')]));if(_0x41ecf9[_0x9c59('0x37')][_0x9c59('0x29')]){_0x113f1f[_0x9c59('0x40')]=_[_0x9c59('0x43')](_0x113f1f[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x113f1f['attributes'],function(_0x505d45){var _0x2705c9={};_0x2705c9[_0x505d45]={'$like':'%'+_0x41ecf9['query'][_0x9c59('0x29')]+'%'};return _0x2705c9;})});}_0x113f1f=_['merge']({},_0x113f1f,_0x41ecf9[_0x9c59('0x45')]);return _0x3fa95a[_0x9c59('0x96')](_0x113f1f);}})[_0x9c59('0x23')](function(_0x2fa625){if(_0x2fa625){_0x3814e3=_0x2fa625['length'];if(!_0x41ecf9['query'][_0x9c59('0x3c')](_0x9c59('0x3d'))){_0x113f1f['limit']=qs[_0x9c59('0x1d')](_0x41ecf9[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x113f1f[_0x9c59('0x1b')]=qs['offset'](_0x41ecf9[_0x9c59('0x37')]['offset']);}return _0x3fa95a[_0x9c59('0x96')](_0x113f1f);}})[_0x9c59('0x23')](function(_0x11a642){if(_0x11a642){return _0x11a642?{'count':_0x3814e3,'rows':_0x11a642}:null;}})['then'](respondWithResult(_0x3c630f,null))[_0x9c59('0x55')](handleError(_0x3c630f,null));};exports[_0x9c59('0x98')]=function(_0x3793ab,_0x5e38ed,_0x412f0a){var _0x5028d8=moment()[_0x9c59('0x77')](_0x9c59('0x99'));var _0x57c996,_0x4ee302;return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x3793ab[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](handleEntityNotFound(_0x5e38ed,null))['then'](function(_0x2b4d3e){if(_0x2b4d3e){_0x4ee302=_0x2b4d3e;return _0x2b4d3e['addLists'](_0x3793ab[_0x9c59('0x58')]['ids'],_[_0x9c59('0x57')](_0x3793ab['body'],[_0x9c59('0x7a'),'id'])||{});}return null;})[_0x9c59('0x90')](function(_0x264468){var _0x44de0c;_0x57c996=_0x264468||[];var _0x7b0747=[];if(_0x264468){for(var _0x28837d=0x0;_0x28837d<_0x264468[_0x9c59('0x3b')];_0x28837d+=0x1){var _0x55429e=_0x264468[_0x28837d][_0x9c59('0x25')]({'plain':!![]});_0x4ee302[_0x9c59('0x9a')]=_0x3793ab['body'][_0x9c59('0x9a')]?_0x3793ab[_0x9c59('0x58')][_0x9c59('0x9a')]:_0x4ee302[_0x9c59('0x9a')];switch(_0x4ee302['dialCheckDuplicateType']){case'always':_0x44de0c=squel['insert']()[_0x9c59('0x9b')](_0x9c59('0x9c'))[_0x9c59('0x9d')](['phone','scheduledAt','ContactId',_0x9c59('0x9e'),_0x9c59('0x5f'),_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0x9f'),'phone')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0xa0'))[_0x9c59('0x7c')]('id','ContactId')[_0x9c59('0x7c')](_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')](),_0x9c59('0x9e'))[_0x9c59('0x7c')](_0x3793ab[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),_0x9c59('0x5f'))['field']('\x27'+_0x5028d8+'\x27','createdAt')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27','updatedAt')[_0x9c59('0x7e')](_0x9c59('0xa2'))[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')](_0x9c59('0xa4'),_0x55429e[_0x9c59('0xa1')]['toString']())['where'](_0x9c59('0xa5'))[_0x9c59('0x40')](_0x9c59('0xa6'),squel[_0x9c59('0x7b')]()['field'](_0x9c59('0xa7'))['from'](_0x9c59('0xa8'))[_0x9c59('0x40')](_0x9c59('0x83'),_0x3793ab['params']['id'][_0x9c59('0x86')]()))[_0x9c59('0x40')](_0x9c59('0xa6'),squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0xa9'))['from'](_0x9c59('0x9c'))['where'](_0x9c59('0x83'),_0x3793ab['params']['id']['toString']())))[_0x9c59('0x86')]();break;case _0x9c59('0xaa'):_0x44de0c=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0x9c'))['fromQuery'](['phone',_0x9c59('0xa0'),_0x9c59('0xac'),_0x9c59('0x9e'),_0x9c59('0x5f'),_0x9c59('0x59'),'updatedAt'],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0x9f'),'phone')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27','scheduledAt')[_0x9c59('0x7c')]('id','ContactId')[_0x9c59('0x7c')](_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')](),_0x9c59('0x9e'))['field'](_0x3793ab[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),'VoiceQueueId')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x59'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x56'))[_0x9c59('0x7e')]('cm_contacts')[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')](_0x9c59('0xa4'),_0x55429e[_0x9c59('0xa1')]['toString']())[_0x9c59('0x40')](_0x9c59('0xa5'))['where'](_0x9c59('0xa6'),squel['select']()[_0x9c59('0x7c')]('COALESCE(phone,\x27\x27)')[_0x9c59('0x7e')](_0x9c59('0x9c'))[_0x9c59('0x40')]('VoiceQueueId\x20=\x20?',_0x3793ab['params']['id'][_0x9c59('0x86')]())))[_0x9c59('0x86')]();break;default:_0x44de0c=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0x9c'))['fromQuery']([_0x9c59('0x9f'),'scheduledAt',_0x9c59('0xac'),_0x9c59('0x9e'),_0x9c59('0x5f'),_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')]('phone',_0x9c59('0x9f'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0xa0'))[_0x9c59('0x7c')]('id',_0x9c59('0xac'))[_0x9c59('0x7c')](_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')](),_0x9c59('0x9e'))[_0x9c59('0x7c')](_0x3793ab[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),_0x9c59('0x5f'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x59'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27','updatedAt')[_0x9c59('0x7e')]('cm_contacts')[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')]('ListId\x20=\x20?',_0x55429e[_0x9c59('0xa1')][_0x9c59('0x86')]())[_0x9c59('0x40')](_0x9c59('0xa5')))[_0x9c59('0x86')]();}_0x7b0747[_0x9c59('0x92')](db[_0x9c59('0x6f')][_0x9c59('0x37')](_0x44de0c));}return BPromise[_0x9c59('0xad')](_0x7b0747);}})[_0x9c59('0x23')](function(){var _0x1ca599=[];var _0x5603a8=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0xae'))['fromQuery']([_0x9c59('0xaf'),'phone','OrderBy',_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0xb0'))[_0x9c59('0x7c')](_0x9c59('0xb1'))[_0x9c59('0x7c')]('ci.OrderBy+1')[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x59'))[_0x9c59('0x7c')]('\x27'+_0x5028d8+'\x27',_0x9c59('0x56'))[_0x9c59('0x7e')]('cm_contact_has_items','ci')[_0x9c59('0x80')](_0x9c59('0x9c'),'h',_0x9c59('0xb2'))[_0x9c59('0x40')]('h.scheduledat=?',_0x5028d8)[_0x9c59('0x40')]('ci.ItemClass=?',_0x9c59('0xb3')))[_0x9c59('0x86')]();_0x1ca599[_0x9c59('0x92')](db[_0x9c59('0x6f')][_0x9c59('0x37')](_0x5603a8));return BPromise[_0x9c59('0xad')](_0x1ca599);})[_0x9c59('0x23')](function(){return _0x57c996;})[_0x9c59('0x23')](respondWithResult(_0x5e38ed,null))[_0x9c59('0x55')](handleError(_0x5e38ed,null));};exports['removeLists']=function(_0x7ee9eb,_0x5a533b,_0x3f2aa9){return db[_0x9c59('0x32')]['find']({'where':{'id':_0x7ee9eb[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a533b,null))[_0x9c59('0x23')](function(_0x4f24f4){if(_0x4f24f4){return _0x4f24f4['removeLists'](_0x7ee9eb[_0x9c59('0x37')]['ids']);}})['then'](function(_0xba4ad9){if(_0xba4ad9){return db['CmHopper'][_0x9c59('0x24')]({'where':{'ListId':_0x7ee9eb[_0x9c59('0x37')][_0x9c59('0x7a')],'VoiceQueueId':_0x7ee9eb[_0x9c59('0x4b')]['id']}})['then'](function(){return _0xba4ad9;});}})[_0x9c59('0x23')](respondWithStatusCode(_0x5a533b,null))[_0x9c59('0x55')](handleError(_0x5a533b,null));};exports[_0x9c59('0xb4')]=function(_0x11d04a,_0x1094fb,_0x54b0e7){var _0x542f33={};var _0x3a380e={};var _0x22e860;var _0x17566e;return db[_0x9c59('0x32')][_0x9c59('0x5d')]({'where':{'id':_0x11d04a[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1094fb,null))[_0x9c59('0x23')](function(_0x1cb60b){if(_0x1cb60b){_0x22e860=_0x1cb60b;_0x3a380e[_0x9c59('0x36')]=_[_0x9c59('0x4c')](db[_0x9c59('0x97')]['rawAttributes']);_0x3a380e[_0x9c59('0x37')]=_['keys'](_0x11d04a[_0x9c59('0x37')]);_0x3a380e[_0x9c59('0x42')]=_[_0x9c59('0x38')](_0x3a380e[_0x9c59('0x36')],_0x3a380e[_0x9c59('0x37')]);_0x542f33[_0x9c59('0x3a')]=_[_0x9c59('0x38')](_0x3a380e[_0x9c59('0x36')],qs[_0x9c59('0x39')](_0x11d04a['query'][_0x9c59('0x39')]));_0x542f33[_0x9c59('0x3a')]=_0x542f33[_0x9c59('0x3a')][_0x9c59('0x3b')]?_0x542f33[_0x9c59('0x3a')]:_0x3a380e[_0x9c59('0x36')];_0x542f33[_0x9c59('0x3e')]=qs['sort'](_0x11d04a['query'][_0x9c59('0x3f')]);_0x542f33[_0x9c59('0x40')]=qs[_0x9c59('0x42')](_[_0x9c59('0x41')](_0x11d04a[_0x9c59('0x37')],_0x3a380e[_0x9c59('0x42')]));if(_0x11d04a[_0x9c59('0x37')][_0x9c59('0x29')]){_0x542f33[_0x9c59('0x40')]=_['merge'](_0x542f33[_0x9c59('0x40')],{'$or':_[_0x9c59('0x44')](_0x542f33[_0x9c59('0x3a')],function(_0x49f161){var _0x35a275={};_0x35a275[_0x49f161]={'$like':'%'+_0x11d04a[_0x9c59('0x37')][_0x9c59('0x29')]+'%'};return _0x35a275;})});}_0x542f33=_[_0x9c59('0x43')]({},_0x542f33,_0x11d04a[_0x9c59('0x45')]);return _0x22e860[_0x9c59('0xb4')](_0x542f33);}})[_0x9c59('0x23')](function(_0x17892a){if(_0x17892a){_0x17566e=_0x17892a[_0x9c59('0x3b')];if(!_0x11d04a[_0x9c59('0x37')][_0x9c59('0x3c')]('nolimit')){_0x542f33['limit']=qs['limit'](_0x11d04a[_0x9c59('0x37')][_0x9c59('0x1d')]);_0x542f33['offset']=qs[_0x9c59('0x1b')](_0x11d04a[_0x9c59('0x37')][_0x9c59('0x1b')]);}return _0x22e860[_0x9c59('0xb4')](_0x542f33);}})[_0x9c59('0x23')](function(_0x2c938f){if(_0x2c938f){return _0x2c938f?{'count':_0x17566e,'rows':_0x2c938f}:null;}})['then'](respondWithResult(_0x1094fb,null))[_0x9c59('0x55')](handleError(_0x1094fb,null));};exports['addBlackLists']=function(_0x315e21,_0x20fd77,_0x31b631){var _0x2aceb3,_0xb8e48b;return db[_0x9c59('0x32')][_0x9c59('0x2d')]({'where':{'id':_0x315e21['params']['id']}})['then'](handleEntityNotFound(_0x20fd77,null))[_0x9c59('0x23')](function(_0x521104){if(_0x521104){_0xb8e48b=_0x521104;return _0x521104[_0x9c59('0xb5')](_0x315e21[_0x9c59('0x58')][_0x9c59('0x7a')],_['omit'](_0x315e21[_0x9c59('0x58')],[_0x9c59('0x7a'),'id'])||{});}return null;})[_0x9c59('0x90')](function(_0x1497ce){var _0x39ab34;_0x2aceb3=_0x1497ce||[];var _0x58e51d=[];if(_0x1497ce){for(var _0x153d2a=0x0;_0x153d2a<_0x1497ce['length'];_0x153d2a+=0x1){var _0x6eb43f=_0x1497ce[_0x153d2a][_0x9c59('0x25')]({'plain':!![]});_0x39ab34=squel[_0x9c59('0xab')]()[_0x9c59('0x9b')](_0x9c59('0xb6'))[_0x9c59('0x9d')](['phone','ContactId','ListId',_0x9c59('0x5f'),_0x9c59('0x59'),_0x9c59('0x56')],squel[_0x9c59('0x7b')]()[_0x9c59('0x7c')](_0x9c59('0x9f'),'phone')[_0x9c59('0x7c')]('id',_0x9c59('0xac'))[_0x9c59('0x7c')](_0x6eb43f[_0x9c59('0xa1')]['toString'](),'ListId')['field'](_0x315e21[_0x9c59('0x4b')]['id'][_0x9c59('0x86')](),_0x9c59('0x5f'))[_0x9c59('0x7c')]('NOW()',_0x9c59('0x59'))[_0x9c59('0x7c')](_0x9c59('0xb7'),_0x9c59('0x56'))[_0x9c59('0x7e')](_0x9c59('0xa2'))[_0x9c59('0x40')](_0x9c59('0xa3'))[_0x9c59('0x40')](_0x9c59('0xa4'),_0x6eb43f[_0x9c59('0xa1')]['toString']())[_0x9c59('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x9c59('0x86')]();_0x58e51d[_0x9c59('0x92')](db[_0x9c59('0x6f')][_0x9c59('0x37')](_0x39ab34));}return BPromise[_0x9c59('0xad')](_0x58e51d);}})[_0x9c59('0x23')](function(){return _0x2aceb3;})[_0x9c59('0x23')](respondWithResult(_0x20fd77,null))['catch'](handleError(_0x20fd77,null));};exports[_0x9c59('0xb8')]=function(_0x47f729,_0x224f71,_0x3a342f){return db['VoiceQueue'][_0x9c59('0x2d')]({'where':{'id':_0x47f729[_0x9c59('0x4b')]['id']}})['then'](handleEntityNotFound(_0x224f71,null))[_0x9c59('0x23')](function(_0x1b3dbe){if(_0x1b3dbe){return _0x1b3dbe[_0x9c59('0xb8')](_0x47f729[_0x9c59('0x37')]['ids']);}})[_0x9c59('0x23')](function(_0x3735d0){if(_0x3735d0){return db[_0x9c59('0x64')]['destroy']({'where':{'ListId':_0x47f729[_0x9c59('0x37')][_0x9c59('0x7a')],'VoiceQueueId':_0x47f729[_0x9c59('0x4b')]['id']}})[_0x9c59('0x23')](function(){return _0x3735d0;});}})[_0x9c59('0x23')](respondWithStatusCode(_0x224f71,null))[_0x9c59('0x55')](handleError(_0x224f71,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b51a1d5..b054179 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 _0x4541=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x4541,0x15e));var _0x1454=function(_0x95e8e,_0x2884c2){_0x95e8e=_0x95e8e-0x0;var _0x4ac2b1=_0x4541[_0x95e8e];return _0x4ac2b1;};'use strict';var EventEmitter=require(_0x1454('0x0'));var VoiceQueue=require(_0x1454('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1454('0x2')](0x0);var events={'afterCreate':_0x1454('0x3'),'afterUpdate':_0x1454('0x4'),'afterDestroy':_0x1454('0x5')};function emitEvent(_0x5f3fd1){return function(_0x34ffee,_0x5aa400,_0x21dc20){VoiceQueueEvents[_0x1454('0x6')](_0x5f3fd1+':'+_0x34ffee['id'],_0x34ffee);VoiceQueueEvents['emit'](_0x5f3fd1,_0x34ffee);_0x21dc20(null);};}for(var e in events){if(events[_0x1454('0x7')](e)){var event=events[e];VoiceQueue[_0x1454('0x8')](e,emitEvent(event));}}module[_0x1454('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xea5f=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','update','remove'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xea5f,0x100));var _0xfea5=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xea5f[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xfea5('0x0'));var VoiceQueue=require(_0xfea5('0x1'))['db'][_0xfea5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfea5('0x3'),'afterDestroy':_0xfea5('0x4')};function emitEvent(_0x101fab){return function(_0x5b7de8,_0x6db69c,_0x562fc8){VoiceQueueEvents[_0xfea5('0x5')](_0x101fab+':'+_0x5b7de8['id'],_0x5b7de8);VoiceQueueEvents[_0xfea5('0x5')](_0x101fab,_0x5b7de8);_0x562fc8(null);};}for(var e in events){if(events[_0xfea5('0x6')](e)){var event=events[e];VoiceQueue[_0xfea5('0x7')](e,emitEvent(event));}}module[_0xfea5('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 0b5c5c8..7583a84 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x238830,_0x545f75){var _0x5917f0=function(_0x12f821){while(--_0x12f821){_0x238830['push'](_0x238830['shift']());}};_0x5917f0(++_0x545f75);}(_0x008c,0x188));var _0xc008=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x008c[_0x29771f];return _0x279baf;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x21fd29,_0x3887a3){var _0x364d4e=function(_0x49fcbc){while(--_0x49fcbc){_0x21fd29['push'](_0x21fd29['shift']());}};_0x364d4e(++_0x3887a3);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index b9b40c2..9103e2b 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 _0xf663=['defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','VoiceQueue','options','attributes','limit','map','include','model','GetVoiceQueue','stringify','ShowVoiceQueue','find','raw','where','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xf663,0x1f0));var _0x3f66=function(_0x29fa5f,_0x457445){_0x29fa5f=_0x29fa5f-0x0;var _0x6bb4ff=_0xf663[_0x29fa5f];return _0x6bb4ff;};'use strict';var _=require('lodash');var util=require(_0x3f66('0x0'));var moment=require(_0x3f66('0x1'));var BPromise=require(_0x3f66('0x2'));var rs=require(_0x3f66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3f66('0x4'));var logger=require('../../config/logger')(_0x3f66('0x5'));var config=require(_0x3f66('0x6'));var jayson=require(_0x3f66('0x7'));var client=jayson[_0x3f66('0x8')][_0x3f66('0x9')]({'port':0x232a});config[_0x3f66('0xa')]=_[_0x3f66('0xb')](config['redis'],{'host':_0x3f66('0xc'),'port':0x18eb});var socket=require(_0x3f66('0xd'))(new Redis(config[_0x3f66('0xa')]));require(_0x3f66('0xe'))['register'](socket);function respondWithRpcPromise(_0x4e23c2,_0x1c1345,_0x5702b6){return new BPromise(function(_0x22d77a,_0x215d68){return client[_0x3f66('0xf')](_0x4e23c2,_0x5702b6)[_0x3f66('0x10')](function(_0xca9f96){logger[_0x3f66('0x11')](_0x3f66('0x12'),_0x1c1345,_0x3f66('0x13'));logger[_0x3f66('0x14')](_0x3f66('0x15'),_0x1c1345,_0x3f66('0x13'),JSON['stringify'](_0xca9f96));if(_0xca9f96[_0x3f66('0x16')]){if(_0xca9f96[_0x3f66('0x16')]['code']===0x1f4){logger[_0x3f66('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1c1345,_0xca9f96[_0x3f66('0x16')][_0x3f66('0x17')]);return _0x215d68(_0xca9f96[_0x3f66('0x16')][_0x3f66('0x17')]);}logger['error'](_0x3f66('0x12'),_0x1c1345,_0xca9f96[_0x3f66('0x16')][_0x3f66('0x17')]);return _0x22d77a(_0xca9f96['error']['message']);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x1c1345,'request\x20sent');_0x22d77a(_0xca9f96[_0x3f66('0x18')][_0x3f66('0x17')]);}})[_0x3f66('0x19')](function(_0xc50437){logger[_0x3f66('0x16')](_0x3f66('0x12'),_0x1c1345,_0xc50437);_0x215d68(_0xc50437);});});}exports['GetVoiceQueue']=function(_0x56d187){var _0x4a8001=this;return new Promise(function(_0x29ec92,_0x3f7351){return db[_0x3f66('0x1a')]['findAll']({'raw':_0x56d187[_0x3f66('0x1b')]?_0x56d187[_0x3f66('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x56d187['options']?_0x56d187[_0x3f66('0x1b')]['where']||null:null,'attributes':_0x56d187['options']?_0x56d187[_0x3f66('0x1b')][_0x3f66('0x1c')]||null:null,'limit':_0x56d187[_0x3f66('0x1b')]?_0x56d187['options'][_0x3f66('0x1d')]||null:null,'include':_0x56d187[_0x3f66('0x1b')]?_0x56d187[_0x3f66('0x1b')]['include']?_[_0x3f66('0x1e')](_0x56d187[_0x3f66('0x1b')][_0x3f66('0x1f')],function(_0x3e5812){return{'model':db[_0x3e5812[_0x3f66('0x20')]],'as':_0x3e5812['as'],'attributes':_0x3e5812[_0x3f66('0x1c')],'include':_0x3e5812[_0x3f66('0x1f')]?_[_0x3f66('0x1e')](_0x3e5812['include'],function(_0xb93fa5){return{'model':db[_0xb93fa5['model']],'as':_0xb93fa5['as'],'attributes':_0xb93fa5[_0x3f66('0x1c')],'include':_0xb93fa5['include']?_[_0x3f66('0x1e')](_0xb93fa5[_0x3f66('0x1f')],function(_0x2376ea){return{'model':db[_0x2376ea[_0x3f66('0x20')]],'as':_0x2376ea['as'],'attributes':_0x2376ea[_0x3f66('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x343a18){logger[_0x3f66('0x11')](_0x3f66('0x21'),_0x56d187);logger['debug'](_0x3f66('0x21'),_0x56d187,JSON[_0x3f66('0x22')](_0x343a18));_0x29ec92(_0x343a18);})[_0x3f66('0x19')](function(_0x4f0c61){logger['error'](_0x3f66('0x21'),_0x4f0c61[_0x3f66('0x17')],_0x56d187);_0x3f7351(_0x4a8001[_0x3f66('0x16')](0x1f4,_0x4f0c61[_0x3f66('0x17')]));});});};exports[_0x3f66('0x23')]=function(_0x52362a){var _0x53d5ad=this;return new Promise(function(_0x2fc0d8,_0x641024){return db[_0x3f66('0x1a')][_0x3f66('0x24')]({'raw':_0x52362a[_0x3f66('0x1b')]?_0x52362a['options'][_0x3f66('0x25')]===undefined?!![]:![]:!![],'where':_0x52362a[_0x3f66('0x1b')]?_0x52362a['options'][_0x3f66('0x26')]||null:null,'attributes':_0x52362a[_0x3f66('0x1b')]?_0x52362a[_0x3f66('0x1b')][_0x3f66('0x1c')]||null:null,'include':_0x52362a[_0x3f66('0x1b')]?_0x52362a['options'][_0x3f66('0x1f')]?_[_0x3f66('0x1e')](_0x52362a[_0x3f66('0x1b')][_0x3f66('0x1f')],function(_0xcee10e){return{'model':db[_0xcee10e[_0x3f66('0x20')]],'as':_0xcee10e['as'],'attributes':_0xcee10e[_0x3f66('0x1c')],'include':_0xcee10e['include']?_[_0x3f66('0x1e')](_0xcee10e['include'],function(_0x5b1800){return{'model':db[_0x5b1800[_0x3f66('0x20')]],'as':_0x5b1800['as'],'attributes':_0x5b1800[_0x3f66('0x1c')],'include':_0x5b1800[_0x3f66('0x1f')]?_[_0x3f66('0x1e')](_0x5b1800[_0x3f66('0x1f')],function(_0x534b9d){return{'model':db[_0x534b9d['model']],'as':_0x534b9d['as'],'attributes':_0x534b9d[_0x3f66('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47259a){logger[_0x3f66('0x11')](_0x3f66('0x23'),_0x52362a);logger['debug'](_0x3f66('0x23'),_0x52362a,JSON['stringify'](_0x47259a));_0x2fc0d8(_0x47259a);})[_0x3f66('0x19')](function(_0xcdfe11){logger[_0x3f66('0x16')](_0x3f66('0x23'),_0xcdfe11[_0x3f66('0x17')],_0x52362a);_0x641024(_0x53d5ad['error'](0x1f4,_0xcdfe11[_0x3f66('0x17')]));});});}; \ No newline at end of file +var _0x66e4=['VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceQueue,\x20%s,\x20%s','result','catch','VoiceQueue','findAll','options','raw','limit','map','attributes','include','model','GetVoiceQueue','ShowVoiceQueue','find','where','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','then','request\x20sent','debug'];(function(_0x2ad6e4,_0x544768){var _0x20006c=function(_0x3543f1){while(--_0x3543f1){_0x2ad6e4['push'](_0x2ad6e4['shift']());}};_0x20006c(++_0x544768);}(_0x66e4,0x12d));var _0x466e=function(_0x22e645,_0x47c117){_0x22e645=_0x22e645-0x0;var _0x242f12=_0x66e4[_0x22e645];return _0x242f12;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x466e('0x0'));var BPromise=require(_0x466e('0x1'));var rs=require(_0x466e('0x2'));var fs=require('fs');var Redis=require(_0x466e('0x3'));var db=require(_0x466e('0x4'))['db'];var utils=require(_0x466e('0x5'));var logger=require('../../config/logger')(_0x466e('0x6'));var config=require(_0x466e('0x7'));var jayson=require(_0x466e('0x8'));var client=jayson[_0x466e('0x9')][_0x466e('0xa')]({'port':0x232a});config[_0x466e('0xb')]=_[_0x466e('0xc')](config[_0x466e('0xb')],{'host':_0x466e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x466e('0xb')]));require(_0x466e('0xe'))[_0x466e('0xf')](socket);function respondWithRpcPromise(_0x3f33f4,_0x305548,_0x37db2c){return new BPromise(function(_0x320309,_0x34c2e3){return client['request'](_0x3f33f4,_0x37db2c)[_0x466e('0x10')](function(_0x16b368){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x305548,_0x466e('0x11'));logger[_0x466e('0x12')](_0x466e('0x13'),_0x305548,_0x466e('0x11'),JSON[_0x466e('0x14')](_0x16b368));if(_0x16b368[_0x466e('0x15')]){if(_0x16b368[_0x466e('0x15')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x305548,_0x16b368[_0x466e('0x15')][_0x466e('0x16')]);return _0x34c2e3(_0x16b368['error'][_0x466e('0x16')]);}logger[_0x466e('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x305548,_0x16b368['error'][_0x466e('0x16')]);return _0x320309(_0x16b368[_0x466e('0x15')][_0x466e('0x16')]);}else{logger['info'](_0x466e('0x17'),_0x305548,'request\x20sent');_0x320309(_0x16b368[_0x466e('0x18')][_0x466e('0x16')]);}})[_0x466e('0x19')](function(_0x312592){logger[_0x466e('0x15')](_0x466e('0x17'),_0x305548,_0x312592);_0x34c2e3(_0x312592);});});}exports['GetVoiceQueue']=function(_0x4caed6){var _0x3fc3af=this;return new Promise(function(_0x131b9c,_0x122c51){return db[_0x466e('0x1a')][_0x466e('0x1b')]({'raw':_0x4caed6[_0x466e('0x1c')]?_0x4caed6[_0x466e('0x1c')][_0x466e('0x1d')]===undefined?!![]:![]:!![],'where':_0x4caed6[_0x466e('0x1c')]?_0x4caed6[_0x466e('0x1c')]['where']||null:null,'attributes':_0x4caed6['options']?_0x4caed6[_0x466e('0x1c')]['attributes']||null:null,'limit':_0x4caed6[_0x466e('0x1c')]?_0x4caed6[_0x466e('0x1c')][_0x466e('0x1e')]||null:null,'include':_0x4caed6['options']?_0x4caed6['options']['include']?_[_0x466e('0x1f')](_0x4caed6[_0x466e('0x1c')]['include'],function(_0x4aeb8f){return{'model':db[_0x4aeb8f['model']],'as':_0x4aeb8f['as'],'attributes':_0x4aeb8f[_0x466e('0x20')],'include':_0x4aeb8f['include']?_['map'](_0x4aeb8f[_0x466e('0x21')],function(_0x33344c){return{'model':db[_0x33344c[_0x466e('0x22')]],'as':_0x33344c['as'],'attributes':_0x33344c['attributes'],'include':_0x33344c['include']?_[_0x466e('0x1f')](_0x33344c[_0x466e('0x21')],function(_0x19c3f9){return{'model':db[_0x19c3f9[_0x466e('0x22')]],'as':_0x19c3f9['as'],'attributes':_0x19c3f9[_0x466e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49ed62){logger['info'](_0x466e('0x23'),_0x4caed6);logger[_0x466e('0x12')](_0x466e('0x23'),_0x4caed6,JSON[_0x466e('0x14')](_0x49ed62));_0x131b9c(_0x49ed62);})[_0x466e('0x19')](function(_0x418634){logger['error']('GetVoiceQueue',_0x418634[_0x466e('0x16')],_0x4caed6);_0x122c51(_0x3fc3af[_0x466e('0x15')](0x1f4,_0x418634[_0x466e('0x16')]));});});};exports[_0x466e('0x24')]=function(_0x384e00){var _0x3f7ed2=this;return new Promise(function(_0x316b18,_0xeaf69){return db[_0x466e('0x1a')][_0x466e('0x25')]({'raw':_0x384e00['options']?_0x384e00[_0x466e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x384e00['options']?_0x384e00['options'][_0x466e('0x26')]||null:null,'attributes':_0x384e00[_0x466e('0x1c')]?_0x384e00[_0x466e('0x1c')][_0x466e('0x20')]||null:null,'include':_0x384e00[_0x466e('0x1c')]?_0x384e00[_0x466e('0x1c')][_0x466e('0x21')]?_[_0x466e('0x1f')](_0x384e00[_0x466e('0x1c')]['include'],function(_0x5f51fb){return{'model':db[_0x5f51fb[_0x466e('0x22')]],'as':_0x5f51fb['as'],'attributes':_0x5f51fb[_0x466e('0x20')],'include':_0x5f51fb[_0x466e('0x21')]?_[_0x466e('0x1f')](_0x5f51fb[_0x466e('0x21')],function(_0x380188){return{'model':db[_0x380188['model']],'as':_0x380188['as'],'attributes':_0x380188[_0x466e('0x20')],'include':_0x380188[_0x466e('0x21')]?_['map'](_0x380188['include'],function(_0x2091ca){return{'model':db[_0x2091ca['model']],'as':_0x2091ca['as'],'attributes':_0x2091ca['attributes']};}):[]};}):[]};}):[]:[]})[_0x466e('0x10')](function(_0xc414f5){logger[_0x466e('0x27')](_0x466e('0x24'),_0x384e00);logger[_0x466e('0x12')](_0x466e('0x24'),_0x384e00,JSON['stringify'](_0xc414f5));_0x316b18(_0xc414f5);})[_0x466e('0x19')](function(_0x32074c){logger['error'](_0x466e('0x24'),_0x32074c['message'],_0x384e00);_0xeaf69(_0x3f7ed2[_0x466e('0x15')](0x1f4,_0x32074c[_0x466e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e972795..ce1277d 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 _0xd97b=['voiceQueue:','./voiceQueue.events','remove','emit','removeListener','register'];(function(_0x459a3b,_0x3aa784){var _0x27d696=function(_0x32b378){while(--_0x32b378){_0x459a3b['push'](_0x459a3b['shift']());}};_0x27d696(++_0x3aa784);}(_0xd97b,0x1a5));var _0xbd97=function(_0x1a6575,_0x3f2768){_0x1a6575=_0x1a6575-0x0;var _0x254b03=_0xd97b[_0x1a6575];return _0x254b03;};'use strict';var VoiceQueueEvents=require(_0xbd97('0x0'));var events=['save',_0xbd97('0x1'),'update'];function createListener(_0x14f9c0,_0x44ec9f){return function(_0x5b08af){_0x44ec9f[_0xbd97('0x2')](_0x14f9c0,_0x5b08af);};}function removeListener(_0x100874,_0x34e8ce){return function(){VoiceQueueEvents[_0xbd97('0x3')](_0x100874,_0x34e8ce);};}exports[_0xbd97('0x4')]=function(_0x3d9c75){for(var _0x51c66a=0x0,_0x32c01f=events['length'];_0x51c66a<_0x32c01f;_0x51c66a++){var _0x1acb2b=events[_0x51c66a];var _0x210a06=createListener(_0xbd97('0x5')+_0x1acb2b,_0x3d9c75);VoiceQueueEvents['on'](_0x1acb2b,_0x210a06);}}; \ No newline at end of file +var _0xb93f=['./voiceQueue.events','update','emit','register','voiceQueue:'];(function(_0x243bba,_0x1ea69f){var _0x12e696=function(_0x5d3ab5){while(--_0x5d3ab5){_0x243bba['push'](_0x243bba['shift']());}};_0x12e696(++_0x1ea69f);}(_0xb93f,0xc3));var _0xfb93=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb93f[_0x16d10f];return _0x50c823;};'use strict';var VoiceQueueEvents=require(_0xfb93('0x0'));var events=['save','remove',_0xfb93('0x1')];function createListener(_0x16f6bb,_0x545387){return function(_0x46f3aa){_0x545387[_0xfb93('0x2')](_0x16f6bb,_0x46f3aa);};}function removeListener(_0x47a3d1,_0x2f2cf9){return function(){VoiceQueueEvents['removeListener'](_0x47a3d1,_0x2f2cf9);};}exports[_0xfb93('0x3')]=function(_0x417ec8){for(var _0x248072=0x0,_0x70fe33=events['length'];_0x248072<_0x70fe33;_0x248072++){var _0x36d139=events[_0x248072];var _0x4f80a2=createListener(_0xfb93('0x4')+_0x36d139,_0x417ec8);VoiceQueueEvents['on'](_0x36d139,_0x4f80a2);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 61f1290..937edf6 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 _0x2787=['fs-extra','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x25fd12,_0x1d2715){var _0x18cc67=function(_0x151df3){while(--_0x151df3){_0x25fd12['push'](_0x25fd12['shift']());}};_0x18cc67(++_0x1d2715);}(_0x2787,0x1e0));var _0x7278=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x2787[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x7278('0x0'));var util=require(_0x7278('0x1'));var path=require(_0x7278('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7278('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7278('0x4'));var config=require(_0x7278('0x5'));var controller=require(_0x7278('0x6'));router[_0x7278('0x7')]('/',auth[_0x7278('0x8')](),controller[_0x7278('0x9')]);router[_0x7278('0x7')](_0x7278('0xa'),auth[_0x7278('0x8')](),controller[_0x7278('0xb')]);router['get'](_0x7278('0xc'),auth['isAuthenticated'](),controller[_0x7278('0xd')]);router['get'](_0x7278('0xe'),auth[_0x7278('0x8')](),controller[_0x7278('0xf')]);router['post']('/',auth[_0x7278('0x8')](),controller[_0x7278('0x10')]);router[_0x7278('0x11')](_0x7278('0xe'),auth[_0x7278('0x8')](),controller[_0x7278('0x12')]);router['delete'](_0x7278('0xe'),auth[_0x7278('0x8')](),controller[_0x7278('0x13')]);module[_0x7278('0x14')]=router; \ No newline at end of file +var _0x2856=['./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','destroy','multer','util','express','../../components/auth/service'];(function(_0x56342f,_0x501e38){var _0x4b009d=function(_0x636e25){while(--_0x636e25){_0x56342f['push'](_0x56342f['shift']());}};_0x4b009d(++_0x501e38);}(_0x2856,0x8c));var _0x6285=function(_0x5a9b6c,_0x30ccd0){_0x5a9b6c=_0x5a9b6c-0x0;var _0x72bed=_0x2856[_0x5a9b6c];return _0x72bed;};'use strict';var multer=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6285('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6285('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6285('0x4'));router[_0x6285('0x5')]('/',auth[_0x6285('0x6')](),controller[_0x6285('0x7')]);router[_0x6285('0x5')]('/describe',auth[_0x6285('0x6')](),controller[_0x6285('0x8')]);router[_0x6285('0x5')](_0x6285('0x9'),auth['isAuthenticated'](),controller[_0x6285('0xa')]);router[_0x6285('0x5')](_0x6285('0xb'),auth[_0x6285('0x6')](),controller[_0x6285('0xc')]);router[_0x6285('0xd')]('/',auth[_0x6285('0x6')](),controller[_0x6285('0xe')]);router[_0x6285('0xf')](_0x6285('0xb'),auth[_0x6285('0x6')](),controller[_0x6285('0x10')]);router['delete'](_0x6285('0xb'),auth[_0x6285('0x6')](),controller[_0x6285('0x11')]);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 ce6bcc9..613b53a 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 _0xc3ce=['STRING','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','INTEGER','BOOLEAN','DATE','sequelize','moment','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xc3ce,0x129));var _0xec3c=function(_0x44160a,_0x429498){_0x44160a=_0x44160a-0x0;var _0x25745f=_0xc3ce[_0x44160a];return _0x25745f;};'use strict';var Sequelize=require(_0xec3c('0x0'));var moment=require(_0xec3c('0x1'));module[_0xec3c('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xec3c('0x3')]},'calleridnum':{'type':Sequelize[_0xec3c('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xec3c('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1cb278){var _0x10a05e=moment(_0x1cb278);var _0x570d17=moment(this[_0xec3c('0x4')]('queuecallerjoinAt'))['format'](_0xec3c('0x5'));var _0x55ac0a=_0x10a05e[_0xec3c('0x6')](_0x570d17,'seconds');this['setDataValue']('queuecallerleaveAt',_0x1cb278);this['setDataValue']('holdtime',_0x55ac0a||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xec3c('0x7')]},'queuecallerabandon':{'type':Sequelize[_0xec3c('0x8')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xec3c('0x9')]},'queuecallercomplete':{'type':Sequelize[_0xec3c('0x8')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xec3c('0x9')]},'queuecallerexit':{'type':Sequelize[_0xec3c('0x8')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xec3c('0x9')]},'queuecallerexitreason':{'type':Sequelize[_0xec3c('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xec3c('0x3')]},'accountcode':{'type':Sequelize[_0xec3c('0x3')]},'context':{'type':Sequelize[_0xec3c('0x3')]},'exten':{'type':Sequelize[_0xec3c('0x3')]},'priority':{'type':Sequelize[_0xec3c('0x3')]},'holdtime':{'type':Sequelize[_0xec3c('0x7')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xec3c('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xec3c('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xec3c('0x3')]},'transferuniqueid':{'type':Sequelize[_0xec3c('0x3')]},'disposition':{'type':Sequelize[_0xec3c('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xec3c('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf71c=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue'];(function(_0x595151,_0x1f1f72){var _0x5776df=function(_0x4930fa){while(--_0x4930fa){_0x595151['push'](_0x595151['shift']());}};_0x5776df(++_0x1f1f72);}(_0xf71c,0x135));var _0xcf71=function(_0x56e516,_0x382b9d){_0x56e516=_0x56e516-0x0;var _0x5bb373=_0xf71c[_0x56e516];return _0x5bb373;};'use strict';var Sequelize=require(_0xcf71('0x0'));var moment=require(_0xcf71('0x1'));module[_0xcf71('0x2')]={'type':{'type':Sequelize[_0xcf71('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xcf71('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xcf71('0x4')],'set':function(_0x32f696){var _0x11435b=moment(_0x32f696);var _0x2bac88=moment(this[_0xcf71('0x5')](_0xcf71('0x6')))[_0xcf71('0x7')](_0xcf71('0x8'));var _0xcd9c5e=_0x11435b[_0xcf71('0x9')](_0x2bac88,'seconds');this[_0xcf71('0xa')](_0xcf71('0xb'),_0x32f696);this[_0xcf71('0xa')](_0xcf71('0xc'),_0xcd9c5e||null);}},'position':{'type':Sequelize[_0xcf71('0xd')]},'count':{'type':Sequelize[_0xcf71('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcf71('0x4')]},'queuecallerexit':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcf71('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xcf71('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xcf71('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xcf71('0x3')]},'accountcode':{'type':Sequelize[_0xcf71('0x3')]},'context':{'type':Sequelize[_0xcf71('0x3')]},'exten':{'type':Sequelize[_0xcf71('0x3')]},'priority':{'type':Sequelize[_0xcf71('0x3')]},'holdtime':{'type':Sequelize[_0xcf71('0xd')]},'mohtime':{'type':Sequelize[_0xcf71('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcf71('0x3')]},'transfer':{'type':Sequelize[_0xcf71('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcf71('0x3')],'comment':_0xcf71('0xf')},'transferexten':{'type':Sequelize[_0xcf71('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xcf71('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcf71('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xcf71('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xcf71('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 731ab75..76a5603 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 _0x7b56=['apply','update','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','offset','undefined','limit','count','set','json'];(function(_0x114760,_0x403eb8){var _0x4ad020=function(_0x21a916){while(--_0x21a916){_0x114760['push'](_0x114760['shift']());}};_0x4ad020(++_0x403eb8);}(_0x7b56,0x77));var _0x67b5=function(_0x3902fe,_0x21c6ef){_0x3902fe=_0x3902fe-0x0;var _0x3fad77=_0x7b56[_0x3902fe];return _0x3fad77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67b5('0x0'));var zipdir=require(_0x67b5('0x1'));var jsonpatch=require(_0x67b5('0x2'));var rp=require(_0x67b5('0x3'));var moment=require(_0x67b5('0x4'));var BPromise=require(_0x67b5('0x5'));var Mustache=require(_0x67b5('0x6'));var util=require(_0x67b5('0x7'));var path=require('path');var sox=require(_0x67b5('0x8'));var csv=require(_0x67b5('0x9'));var ejs=require(_0x67b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67b5('0xb'));var squel=require(_0x67b5('0xc'));var crypto=require(_0x67b5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x67b5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x67b5('0xf'));var Papa=require(_0x67b5('0x10'));var Redis=require('ioredis');var authService=require(_0x67b5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x67b5('0x12'));var hardwareService=require(_0x67b5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x67b5('0x14'));var config=require(_0x67b5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x67b5('0x16'))['db'];config['redis']=_[_0x67b5('0x17')](config[_0x67b5('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x67b5('0x19'))(new Redis(config['redis']));require(_0x67b5('0x1a'))['register'](socket);function respondWithStatusCode(_0xdac265,_0x5cf44e){_0x5cf44e=_0x5cf44e||0xcc;return function(_0x11f5e1){if(_0x11f5e1){return _0xdac265[_0x67b5('0x1b')](_0x5cf44e);}return _0xdac265[_0x67b5('0x1c')](_0x5cf44e)['end']();};}function respondWithResult(_0x1260e4,_0x35d8b1){_0x35d8b1=_0x35d8b1||0xc8;return function(_0x31021a){if(_0x31021a){return _0x1260e4[_0x67b5('0x1c')](_0x35d8b1)['json'](_0x31021a);}};}function respondWithFilteredResult(_0x1a2829,_0x200ac6){return function(_0x56daee){if(_0x56daee){var _0x15e475=typeof _0x200ac6[_0x67b5('0x1d')]===_0x67b5('0x1e')&&typeof _0x200ac6[_0x67b5('0x1f')]===_0x67b5('0x1e');var _0x560e0a=_0x56daee[_0x67b5('0x20')];var _0x545b70=_0x15e475?0x0:_0x200ac6['offset'];var _0x20e803=_0x15e475?_0x56daee[_0x67b5('0x20')]:_0x200ac6['offset']+_0x200ac6[_0x67b5('0x1f')];var _0x6d40de;if(_0x20e803>=_0x560e0a){_0x20e803=_0x560e0a;_0x6d40de=0xc8;}else{_0x6d40de=0xce;}_0x1a2829[_0x67b5('0x1c')](_0x6d40de);return _0x1a2829[_0x67b5('0x21')]('Content-Range',_0x545b70+'-'+_0x20e803+'/'+_0x560e0a)[_0x67b5('0x22')](_0x56daee);}return null;};}function patchUpdates(_0x3b06a4){return function(_0x6f1182){try{jsonpatch[_0x67b5('0x23')](_0x6f1182,_0x3b06a4,!![]);}catch(_0x410934){return BPromise['reject'](_0x410934);}return _0x6f1182['save']();};}function saveUpdates(_0x227081,_0x2163f2){return function(_0x6252e3){if(_0x6252e3){return _0x6252e3[_0x67b5('0x24')](_0x227081)[_0x67b5('0x25')](function(_0xfef476){return _0xfef476;});}return null;};}function removeEntity(_0xf76d9b,_0xb0b09b){return function(_0xbdc06b){if(_0xbdc06b){return _0xbdc06b[_0x67b5('0x26')]()[_0x67b5('0x25')](function(){_0xf76d9b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x531ce7,_0x3a10ed){return function(_0x73d209){if(!_0x73d209){_0x531ce7[_0x67b5('0x1b')](0x194);}return _0x73d209;};}function handleError(_0x236a5c,_0x42064b){_0x42064b=_0x42064b||0x1f4;return function(_0x85b462){logger[_0x67b5('0x27')](_0x85b462[_0x67b5('0x28')]);if(_0x85b462[_0x67b5('0x29')]){delete _0x85b462[_0x67b5('0x29')];}_0x236a5c[_0x67b5('0x1c')](_0x42064b)[_0x67b5('0x2a')](_0x85b462);};}exports[_0x67b5('0x2b')]=function(_0x1f3dfa,_0x3b68a1){var _0x1ec386={},_0x1a8ecb={},_0x4776c5={'count':0x0,'rows':[]};var _0x18848b=_[_0x67b5('0x2c')](db[_0x67b5('0x2d')][_0x67b5('0x2e')],function(_0x422fb5){return{'name':_0x422fb5['fieldName'],'type':_0x422fb5[_0x67b5('0x2f')][_0x67b5('0x30')]};});_0x1a8ecb[_0x67b5('0x31')]=_[_0x67b5('0x2c')](_0x18848b,_0x67b5('0x29'));_0x1a8ecb['query']=_[_0x67b5('0x32')](_0x1f3dfa['query']);_0x1a8ecb[_0x67b5('0x33')]=_[_0x67b5('0x34')](_0x1a8ecb[_0x67b5('0x31')],_0x1a8ecb[_0x67b5('0x35')]);_0x1ec386[_0x67b5('0x36')]=_[_0x67b5('0x34')](_0x1a8ecb[_0x67b5('0x31')],qs[_0x67b5('0x37')](_0x1f3dfa['query']['fields']));_0x1ec386['attributes']=_0x1ec386[_0x67b5('0x36')]['length']?_0x1ec386['attributes']:_0x1a8ecb['model'];if(!_0x1f3dfa[_0x67b5('0x35')][_0x67b5('0x38')]('nolimit')){_0x1ec386[_0x67b5('0x1f')]=qs['limit'](_0x1f3dfa[_0x67b5('0x35')]['limit']);_0x1ec386[_0x67b5('0x1d')]=qs['offset'](_0x1f3dfa[_0x67b5('0x35')][_0x67b5('0x1d')]);}_0x1ec386[_0x67b5('0x39')]=qs[_0x67b5('0x3a')](_0x1f3dfa[_0x67b5('0x35')][_0x67b5('0x3a')]);_0x1ec386['where']=qs[_0x67b5('0x33')](_[_0x67b5('0x3b')](_0x1f3dfa[_0x67b5('0x35')],_0x1a8ecb[_0x67b5('0x33')]),_0x18848b);if(_0x1f3dfa[_0x67b5('0x35')][_0x67b5('0x3c')]){_0x1ec386['where']=_[_0x67b5('0x3d')](_0x1ec386['where'],{'$or':_[_0x67b5('0x2c')](_0x18848b,function(_0x7381d6){if(_0x7381d6[_0x67b5('0x2f')]!==_0x67b5('0x3e')){var _0x4f08fd={};_0x4f08fd[_0x7381d6['name']]={'$like':'%'+_0x1f3dfa[_0x67b5('0x35')]['filter']+'%'};return _0x4f08fd;}})});}_0x1ec386=_[_0x67b5('0x3d')]({},_0x1ec386,_0x1f3dfa[_0x67b5('0x3f')]);var _0x2879a1={'where':_0x1ec386[_0x67b5('0x40')]};return db['VoiceQueueReport']['count'](_0x2879a1)[_0x67b5('0x25')](function(_0x3acf69){_0x4776c5[_0x67b5('0x20')]=_0x3acf69;if(_0x1f3dfa[_0x67b5('0x35')][_0x67b5('0x41')]){_0x1ec386[_0x67b5('0x42')]=[{'all':!![]}];}return db[_0x67b5('0x2d')]['findAll'](_0x1ec386);})[_0x67b5('0x25')](function(_0x104fe2){_0x4776c5[_0x67b5('0x43')]=_0x104fe2;return _0x4776c5;})[_0x67b5('0x25')](respondWithFilteredResult(_0x3b68a1,_0x1ec386))[_0x67b5('0x44')](handleError(_0x3b68a1,null));};exports[_0x67b5('0x45')]=function(_0x1d778d,_0x395c70){var _0x3b3a3c={'raw':![],'where':{'id':_0x1d778d[_0x67b5('0x46')]['id']}},_0x1c87df={};_0x1c87df[_0x67b5('0x31')]=_[_0x67b5('0x32')](db['VoiceQueueReport'][_0x67b5('0x2e')]);_0x1c87df[_0x67b5('0x35')]=_['keys'](_0x1d778d[_0x67b5('0x35')]);_0x1c87df[_0x67b5('0x33')]=_[_0x67b5('0x34')](_0x1c87df[_0x67b5('0x31')],_0x1c87df['query']);_0x3b3a3c[_0x67b5('0x36')]=_[_0x67b5('0x34')](_0x1c87df[_0x67b5('0x31')],qs[_0x67b5('0x37')](_0x1d778d['query'][_0x67b5('0x37')]));_0x3b3a3c['attributes']=_0x3b3a3c[_0x67b5('0x36')]['length']?_0x3b3a3c[_0x67b5('0x36')]:_0x1c87df[_0x67b5('0x31')];if(_0x1d778d[_0x67b5('0x35')][_0x67b5('0x41')]){_0x3b3a3c[_0x67b5('0x42')]=[{'all':!![]}];}_0x3b3a3c=_['merge']({},_0x3b3a3c,_0x1d778d[_0x67b5('0x3f')]);return db[_0x67b5('0x2d')][_0x67b5('0x47')](_0x3b3a3c)[_0x67b5('0x25')](handleEntityNotFound(_0x395c70,null))['then'](respondWithResult(_0x395c70,null))['catch'](handleError(_0x395c70,null));};exports['create']=function(_0x463329,_0x4bbb03){return db['VoiceQueueReport'][_0x67b5('0x48')](_0x463329[_0x67b5('0x49')],{})[_0x67b5('0x25')](respondWithResult(_0x4bbb03,0xc9))['catch'](handleError(_0x4bbb03,null));};exports[_0x67b5('0x24')]=function(_0x128144,_0x107665){if(_0x128144[_0x67b5('0x49')]['id']){delete _0x128144['body']['id'];}return db[_0x67b5('0x2d')][_0x67b5('0x47')]({'where':{'id':_0x128144[_0x67b5('0x46')]['id']}})[_0x67b5('0x25')](handleEntityNotFound(_0x107665,null))['then'](saveUpdates(_0x128144['body'],null))[_0x67b5('0x25')](respondWithResult(_0x107665,null))['catch'](handleError(_0x107665,null));};exports[_0x67b5('0x26')]=function(_0x569a5c,_0x35a1da){return db[_0x67b5('0x2d')][_0x67b5('0x47')]({'where':{'id':_0x569a5c[_0x67b5('0x46')]['id']}})[_0x67b5('0x25')](handleEntityNotFound(_0x35a1da,null))['then'](removeEntity(_0x35a1da,null))[_0x67b5('0x44')](handleError(_0x35a1da,null));};exports[_0x67b5('0x4a')]=function(_0x4add77,_0x2fbfb9){return db['VoiceQueueReport'][_0x67b5('0x4a')]()[_0x67b5('0x25')](respondWithResult(_0x2fbfb9,null))[_0x67b5('0x44')](handleError(_0x2fbfb9,null));};exports[_0x67b5('0x4b')]=function(_0xe8e75c,_0x1f02ed){var _0x11148f={},_0x2ea81f={},_0x3b47b7={'count':0x0,'rows':[]};_0x2ea81f[_0x67b5('0x31')]=_[_0x67b5('0x32')](db['VoiceQueueReport'][_0x67b5('0x2e')]);_0x2ea81f[_0x67b5('0x35')]=_['keys'](_0xe8e75c[_0x67b5('0x35')]);_0x2ea81f['filters']=_[_0x67b5('0x34')](_0x2ea81f[_0x67b5('0x31')],_0x2ea81f[_0x67b5('0x35')]);_0x11148f[_0x67b5('0x36')]=_[_0x67b5('0x34')](_0x2ea81f[_0x67b5('0x31')],qs[_0x67b5('0x37')](_0xe8e75c[_0x67b5('0x35')][_0x67b5('0x37')]));_0x11148f['attributes']=_0x11148f['attributes']['length']?_0x11148f[_0x67b5('0x36')]:_0x2ea81f[_0x67b5('0x31')];if(!_0xe8e75c['query'][_0x67b5('0x38')](_0x67b5('0x4c'))){_0x11148f[_0x67b5('0x1f')]=qs[_0x67b5('0x1f')](_0xe8e75c[_0x67b5('0x35')][_0x67b5('0x1f')]);_0x11148f[_0x67b5('0x1d')]=qs['offset'](_0xe8e75c[_0x67b5('0x35')][_0x67b5('0x1d')]);}_0x11148f[_0x67b5('0x39')]=qs[_0x67b5('0x3a')](_0xe8e75c['query'][_0x67b5('0x3a')]);_0x11148f['where']=qs['filters'](_['pick'](_0xe8e75c[_0x67b5('0x35')],_0x2ea81f[_0x67b5('0x33')]));if(_0xe8e75c['query'][_0x67b5('0x3c')]){_0x11148f[_0x67b5('0x40')]=_[_0x67b5('0x3d')](_0x11148f[_0x67b5('0x40')],{'$or':_[_0x67b5('0x2c')](_0x11148f[_0x67b5('0x36')],function(_0x451e0b){var _0xc39605={};_0xc39605[_0x451e0b]={'$like':'%'+_0xe8e75c[_0x67b5('0x35')][_0x67b5('0x3c')]+'%'};return _0xc39605;})});}_0x11148f=_['merge']({},_0x11148f,_0xe8e75c[_0x67b5('0x3f')]);var _0x3be9ee={'where':_0x11148f[_0x67b5('0x40')]};return db['VoiceQueueReport'][_0x67b5('0x20')](_0x3be9ee)[_0x67b5('0x25')](function(_0x350d9c){_0x3b47b7['count']=_0x350d9c;if(_0xe8e75c[_0x67b5('0x35')][_0x67b5('0x41')]){_0x11148f['include']=[{'all':!![]}];}return db[_0x67b5('0x2d')]['findAll'](_0x11148f);})[_0x67b5('0x25')](function(_0x4b56a7){_0x3b47b7['rows']=_0x4b56a7;return _0x3b47b7;})[_0x67b5('0x25')](respondWithFilteredResult(_0x1f02ed,_0x11148f,_0x67b5('0x4b')))[_0x67b5('0x44')](handleError(_0x1f02ed,null,_0x67b5('0x4b')));}; \ No newline at end of file +var _0x26c3=['offset','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','describe','getVoiceQueuesReport','nolimit','includeAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','status','undefined','limit','count'];(function(_0x53f125,_0x4ba12e){var _0x209b38=function(_0x67892c){while(--_0x67892c){_0x53f125['push'](_0x53f125['shift']());}};_0x209b38(++_0x4ba12e);}(_0x26c3,0x177));var _0x326c=function(_0x3dc1a3,_0x4d82e6){_0x3dc1a3=_0x3dc1a3-0x0;var _0x49721f=_0x26c3[_0x3dc1a3];return _0x49721f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x326c('0x0'));var zipdir=require(_0x326c('0x1'));var jsonpatch=require(_0x326c('0x2'));var rp=require(_0x326c('0x3'));var moment=require(_0x326c('0x4'));var BPromise=require(_0x326c('0x5'));var Mustache=require(_0x326c('0x6'));var util=require('util');var path=require(_0x326c('0x7'));var sox=require(_0x326c('0x8'));var csv=require(_0x326c('0x9'));var ejs=require(_0x326c('0xa'));var fs=require('fs');var fs_extra=require(_0x326c('0xb'));var _=require('lodash');var squel=require(_0x326c('0xc'));var crypto=require('crypto');var jsforce=require(_0x326c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x326c('0x9'));var querystring=require(_0x326c('0xe'));var Papa=require(_0x326c('0xf'));var Redis=require(_0x326c('0x10'));var authService=require(_0x326c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x326c('0x12'));var hardwareService=require(_0x326c('0x13'));var logger=require(_0x326c('0x14'))(_0x326c('0x15'));var utils=require(_0x326c('0x16'));var config=require(_0x326c('0x17'));var licenseUtil=require(_0x326c('0x18'));var db=require(_0x326c('0x19'))['db'];config[_0x326c('0x1a')]=_[_0x326c('0x1b')](config[_0x326c('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x326c('0x1c'))(new Redis(config[_0x326c('0x1a')]));require(_0x326c('0x1d'))[_0x326c('0x1e')](socket);function respondWithStatusCode(_0x1db7a8,_0x5db574){_0x5db574=_0x5db574||0xcc;return function(_0x8a90cd){if(_0x8a90cd){return _0x1db7a8['sendStatus'](_0x5db574);}return _0x1db7a8['status'](_0x5db574)['end']();};}function respondWithResult(_0x5864ad,_0x192210){_0x192210=_0x192210||0xc8;return function(_0x5e50de){if(_0x5e50de){return _0x5864ad[_0x326c('0x1f')](_0x192210)['json'](_0x5e50de);}};}function respondWithFilteredResult(_0x122963,_0x9408b7){return function(_0xc1b805){if(_0xc1b805){var _0x788be5=typeof _0x9408b7['offset']===_0x326c('0x20')&&typeof _0x9408b7[_0x326c('0x21')]==='undefined';var _0x5bd85a=_0xc1b805[_0x326c('0x22')];var _0x2fa4fe=_0x788be5?0x0:_0x9408b7[_0x326c('0x23')];var _0x561933=_0x788be5?_0xc1b805[_0x326c('0x22')]:_0x9408b7[_0x326c('0x23')]+_0x9408b7[_0x326c('0x21')];var _0x2e916a;if(_0x561933>=_0x5bd85a){_0x561933=_0x5bd85a;_0x2e916a=0xc8;}else{_0x2e916a=0xce;}_0x122963[_0x326c('0x1f')](_0x2e916a);return _0x122963['set'](_0x326c('0x24'),_0x2fa4fe+'-'+_0x561933+'/'+_0x5bd85a)[_0x326c('0x25')](_0xc1b805);}return null;};}function patchUpdates(_0x3f6149){return function(_0x333d18){try{jsonpatch['apply'](_0x333d18,_0x3f6149,!![]);}catch(_0x3e9853){return BPromise[_0x326c('0x26')](_0x3e9853);}return _0x333d18[_0x326c('0x27')]();};}function saveUpdates(_0x56a205,_0x77c017){return function(_0x1e86a9){if(_0x1e86a9){return _0x1e86a9[_0x326c('0x28')](_0x56a205)[_0x326c('0x29')](function(_0x3b3cb8){return _0x3b3cb8;});}return null;};}function removeEntity(_0x2e111e,_0x494b88){return function(_0x169557){if(_0x169557){return _0x169557[_0x326c('0x2a')]()[_0x326c('0x29')](function(){_0x2e111e[_0x326c('0x1f')](0xcc)[_0x326c('0x2b')]();});}};}function handleEntityNotFound(_0x1b746f,_0x33a92f){return function(_0x1a4e92){if(!_0x1a4e92){_0x1b746f['sendStatus'](0x194);}return _0x1a4e92;};}function handleError(_0x59f88f,_0x3a49d2){_0x3a49d2=_0x3a49d2||0x1f4;return function(_0x545cfd){logger[_0x326c('0x2c')](_0x545cfd[_0x326c('0x2d')]);if(_0x545cfd[_0x326c('0x2e')]){delete _0x545cfd['name'];}_0x59f88f['status'](_0x3a49d2)[_0x326c('0x2f')](_0x545cfd);};}exports[_0x326c('0x30')]=function(_0x387d97,_0x1cf56a){var _0x5b90ee={},_0x48c344={},_0x59447b={'count':0x0,'rows':[]};var _0x24053a=_[_0x326c('0x31')](db[_0x326c('0x32')][_0x326c('0x33')],function(_0x556e8b){return{'name':_0x556e8b['fieldName'],'type':_0x556e8b[_0x326c('0x34')]['key']};});_0x48c344[_0x326c('0x35')]=_[_0x326c('0x31')](_0x24053a,_0x326c('0x2e'));_0x48c344[_0x326c('0x36')]=_[_0x326c('0x37')](_0x387d97[_0x326c('0x36')]);_0x48c344[_0x326c('0x38')]=_[_0x326c('0x39')](_0x48c344[_0x326c('0x35')],_0x48c344[_0x326c('0x36')]);_0x5b90ee['attributes']=_[_0x326c('0x39')](_0x48c344[_0x326c('0x35')],qs[_0x326c('0x3a')](_0x387d97['query'][_0x326c('0x3a')]));_0x5b90ee['attributes']=_0x5b90ee[_0x326c('0x3b')][_0x326c('0x3c')]?_0x5b90ee[_0x326c('0x3b')]:_0x48c344['model'];if(!_0x387d97['query'][_0x326c('0x3d')]('nolimit')){_0x5b90ee[_0x326c('0x21')]=qs[_0x326c('0x21')](_0x387d97['query'][_0x326c('0x21')]);_0x5b90ee['offset']=qs[_0x326c('0x23')](_0x387d97['query'][_0x326c('0x23')]);}_0x5b90ee[_0x326c('0x3e')]=qs[_0x326c('0x3f')](_0x387d97[_0x326c('0x36')][_0x326c('0x3f')]);_0x5b90ee['where']=qs[_0x326c('0x38')](_[_0x326c('0x40')](_0x387d97[_0x326c('0x36')],_0x48c344[_0x326c('0x38')]),_0x24053a);if(_0x387d97[_0x326c('0x36')][_0x326c('0x41')]){_0x5b90ee[_0x326c('0x42')]=_[_0x326c('0x43')](_0x5b90ee[_0x326c('0x42')],{'$or':_[_0x326c('0x31')](_0x24053a,function(_0x1388fb){if(_0x1388fb[_0x326c('0x34')]!==_0x326c('0x44')){var _0x347d49={};_0x347d49[_0x1388fb['name']]={'$like':'%'+_0x387d97[_0x326c('0x36')][_0x326c('0x41')]+'%'};return _0x347d49;}})});}_0x5b90ee=_[_0x326c('0x43')]({},_0x5b90ee,_0x387d97[_0x326c('0x45')]);var _0x2a0f96={'where':_0x5b90ee['where']};return db[_0x326c('0x32')][_0x326c('0x22')](_0x2a0f96)[_0x326c('0x29')](function(_0x1510ac){_0x59447b[_0x326c('0x22')]=_0x1510ac;if(_0x387d97[_0x326c('0x36')]['includeAll']){_0x5b90ee[_0x326c('0x46')]=[{'all':!![]}];}return db[_0x326c('0x32')][_0x326c('0x47')](_0x5b90ee);})[_0x326c('0x29')](function(_0x1f8fa3){_0x59447b[_0x326c('0x48')]=_0x1f8fa3;return _0x59447b;})[_0x326c('0x29')](respondWithFilteredResult(_0x1cf56a,_0x5b90ee))[_0x326c('0x49')](handleError(_0x1cf56a,null));};exports['show']=function(_0x2940f1,_0x1649ee){var _0x497674={'raw':![],'where':{'id':_0x2940f1[_0x326c('0x4a')]['id']}},_0x309917={};_0x309917['model']=_[_0x326c('0x37')](db['VoiceQueueReport']['rawAttributes']);_0x309917[_0x326c('0x36')]=_['keys'](_0x2940f1[_0x326c('0x36')]);_0x309917[_0x326c('0x38')]=_[_0x326c('0x39')](_0x309917[_0x326c('0x35')],_0x309917[_0x326c('0x36')]);_0x497674['attributes']=_['intersection'](_0x309917[_0x326c('0x35')],qs[_0x326c('0x3a')](_0x2940f1[_0x326c('0x36')][_0x326c('0x3a')]));_0x497674[_0x326c('0x3b')]=_0x497674[_0x326c('0x3b')]['length']?_0x497674[_0x326c('0x3b')]:_0x309917[_0x326c('0x35')];if(_0x2940f1['query']['includeAll']){_0x497674[_0x326c('0x46')]=[{'all':!![]}];}_0x497674=_[_0x326c('0x43')]({},_0x497674,_0x2940f1['options']);return db['VoiceQueueReport'][_0x326c('0x4b')](_0x497674)[_0x326c('0x29')](handleEntityNotFound(_0x1649ee,null))['then'](respondWithResult(_0x1649ee,null))[_0x326c('0x49')](handleError(_0x1649ee,null));};exports[_0x326c('0x4c')]=function(_0x734d43,_0x190167){return db[_0x326c('0x32')][_0x326c('0x4c')](_0x734d43[_0x326c('0x4d')],{})['then'](respondWithResult(_0x190167,0xc9))[_0x326c('0x49')](handleError(_0x190167,null));};exports['update']=function(_0x53225c,_0x522da5){if(_0x53225c[_0x326c('0x4d')]['id']){delete _0x53225c[_0x326c('0x4d')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x53225c[_0x326c('0x4a')]['id']}})[_0x326c('0x29')](handleEntityNotFound(_0x522da5,null))['then'](saveUpdates(_0x53225c[_0x326c('0x4d')],null))[_0x326c('0x29')](respondWithResult(_0x522da5,null))[_0x326c('0x49')](handleError(_0x522da5,null));};exports[_0x326c('0x2a')]=function(_0x47eed2,_0x19165a){return db['VoiceQueueReport'][_0x326c('0x4b')]({'where':{'id':_0x47eed2[_0x326c('0x4a')]['id']}})[_0x326c('0x29')](handleEntityNotFound(_0x19165a,null))[_0x326c('0x29')](removeEntity(_0x19165a,null))[_0x326c('0x49')](handleError(_0x19165a,null));};exports[_0x326c('0x4e')]=function(_0x506f6a,_0x4e08ed){return db[_0x326c('0x32')]['describe']()[_0x326c('0x29')](respondWithResult(_0x4e08ed,null))['catch'](handleError(_0x4e08ed,null));};exports[_0x326c('0x4f')]=function(_0x20f24e,_0x597488){var _0x3f1f4f={},_0x9e2f54={},_0x5e3774={'count':0x0,'rows':[]};_0x9e2f54[_0x326c('0x35')]=_[_0x326c('0x37')](db[_0x326c('0x32')][_0x326c('0x33')]);_0x9e2f54['query']=_[_0x326c('0x37')](_0x20f24e[_0x326c('0x36')]);_0x9e2f54[_0x326c('0x38')]=_['intersection'](_0x9e2f54[_0x326c('0x35')],_0x9e2f54['query']);_0x3f1f4f['attributes']=_[_0x326c('0x39')](_0x9e2f54[_0x326c('0x35')],qs[_0x326c('0x3a')](_0x20f24e['query'][_0x326c('0x3a')]));_0x3f1f4f[_0x326c('0x3b')]=_0x3f1f4f['attributes'][_0x326c('0x3c')]?_0x3f1f4f[_0x326c('0x3b')]:_0x9e2f54[_0x326c('0x35')];if(!_0x20f24e[_0x326c('0x36')][_0x326c('0x3d')](_0x326c('0x50'))){_0x3f1f4f['limit']=qs[_0x326c('0x21')](_0x20f24e[_0x326c('0x36')][_0x326c('0x21')]);_0x3f1f4f[_0x326c('0x23')]=qs[_0x326c('0x23')](_0x20f24e[_0x326c('0x36')][_0x326c('0x23')]);}_0x3f1f4f[_0x326c('0x3e')]=qs['sort'](_0x20f24e[_0x326c('0x36')]['sort']);_0x3f1f4f['where']=qs[_0x326c('0x38')](_['pick'](_0x20f24e[_0x326c('0x36')],_0x9e2f54[_0x326c('0x38')]));if(_0x20f24e[_0x326c('0x36')][_0x326c('0x41')]){_0x3f1f4f[_0x326c('0x42')]=_[_0x326c('0x43')](_0x3f1f4f['where'],{'$or':_[_0x326c('0x31')](_0x3f1f4f[_0x326c('0x3b')],function(_0x2198f1){var _0x1dabed={};_0x1dabed[_0x2198f1]={'$like':'%'+_0x20f24e[_0x326c('0x36')][_0x326c('0x41')]+'%'};return _0x1dabed;})});}_0x3f1f4f=_[_0x326c('0x43')]({},_0x3f1f4f,_0x20f24e['options']);var _0xe93995={'where':_0x3f1f4f['where']};return db[_0x326c('0x32')][_0x326c('0x22')](_0xe93995)['then'](function(_0x210ed3){_0x5e3774[_0x326c('0x22')]=_0x210ed3;if(_0x20f24e[_0x326c('0x36')][_0x326c('0x51')]){_0x3f1f4f[_0x326c('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x326c('0x47')](_0x3f1f4f);})[_0x326c('0x29')](function(_0x348b13){_0x5e3774[_0x326c('0x48')]=_0x348b13;return _0x5e3774;})[_0x326c('0x29')](respondWithFilteredResult(_0x597488,_0x3f1f4f,'getVoiceQueuesReport'))['catch'](handleError(_0x597488,null,_0x326c('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6529fb2..3f3a2ce 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 _0xeef1=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x4bad5c,_0x42a598){var _0x5cd90e=function(_0x4a3dc7){while(--_0x4a3dc7){_0x4bad5c['push'](_0x4bad5c['shift']());}};_0x5cd90e(++_0x42a598);}(_0xeef1,0x15c));var _0x1eef=function(_0x3e60c3,_0x2aac71){_0x3e60c3=_0x3e60c3-0x0;var _0x15aaee=_0xeef1[_0x3e60c3];return _0x15aaee;};'use strict';var EventEmitter=require(_0x1eef('0x0'));var VoiceQueueReport=require(_0x1eef('0x1'))['db'][_0x1eef('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1eef('0x3')](0x0);var events={'afterCreate':_0x1eef('0x4'),'afterUpdate':_0x1eef('0x5'),'afterDestroy':_0x1eef('0x6')};function emitEvent(_0x54d0d1){return function(_0x2308b8,_0x9d651e,_0x1de0b5){VoiceQueueReportEvents[_0x1eef('0x7')](_0x54d0d1+':'+_0x2308b8['id'],_0x2308b8);VoiceQueueReportEvents[_0x1eef('0x7')](_0x54d0d1,_0x2308b8);_0x1de0b5(null);};}for(var e in events){if(events[_0x1eef('0x8')](e)){var event=events[e];VoiceQueueReport[_0x1eef('0x9')](e,emitEvent(event));}}module[_0x1eef('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xa002=['hook','exports','events','../../mysqldb','VoiceQueueReport','remove'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xa002,0x1dc));var _0x2a00=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa002[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x2a00('0x0'));var VoiceQueueReport=require(_0x2a00('0x1'))['db'][_0x2a00('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2a00('0x3')};function emitEvent(_0x8fb53f){return function(_0xffdc93,_0x4b7f1d,_0x1e614b){VoiceQueueReportEvents['emit'](_0x8fb53f+':'+_0xffdc93['id'],_0xffdc93);VoiceQueueReportEvents['emit'](_0x8fb53f,_0xffdc93);_0x1e614b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x2a00('0x4')](e,emitEvent(event));}}module[_0x2a00('0x5')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ad1a278..aed5811 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 _0x407b=['bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','calleridnum','util','../../config/logger','api','moment'];(function(_0x3fe4ab,_0x3eda85){var _0x1ca2a4=function(_0x211164){while(--_0x211164){_0x3fe4ab['push'](_0x3fe4ab['shift']());}};_0x1ca2a4(++_0x3eda85);}(_0x407b,0x14e));var _0xb407=function(_0x4dad79,_0x1c5e5a){_0x4dad79=_0x4dad79-0x0;var _0x7b557=_0x407b[_0x4dad79];return _0x7b557;};'use strict';var _=require('lodash');var util=require(_0xb407('0x0'));var logger=require(_0xb407('0x1'))(_0xb407('0x2'));var moment=require(_0xb407('0x3'));var BPromise=require(_0xb407('0x4'));var rp=require(_0xb407('0x5'));var fs=require('fs');var path=require(_0xb407('0x6'));var rimraf=require(_0xb407('0x7'));var config=require('../../config/environment');var attributes=require(_0xb407('0x8'));module[_0xb407('0x9')]=function(_0x41822e,_0x28d54f){return _0x41822e['define'](_0xb407('0xa'),attributes,{'tableName':_0xb407('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xb407('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a31=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x4a31,0x12f));var _0x14a3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a31[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x14a3('0x0'));var util=require(_0x14a3('0x1'));var logger=require(_0x14a3('0x2'))(_0x14a3('0x3'));var moment=require(_0x14a3('0x4'));var BPromise=require(_0x14a3('0x5'));var rp=require(_0x14a3('0x6'));var fs=require('fs');var path=require(_0x14a3('0x7'));var rimraf=require('rimraf');var config=require(_0x14a3('0x8'));var attributes=require(_0x14a3('0x9'));module[_0x14a3('0xa')]=function(_0x684313,_0x35bb34){return _0x684313[_0x14a3('0xb')](_0x14a3('0xc'),attributes,{'tableName':_0x14a3('0xd'),'paranoid':![],'indexes':[{'fields':[_0x14a3('0xe')]},{'fields':[_0x14a3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 9024123..1769f98 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 _0xf429=['info','request\x20sent','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','include','map','model','attributes','then','debug','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','redis','localhost','./voiceQueueReport.socket','request'];(function(_0x5b0d7d,_0x48635e){var _0x55951e=function(_0x3792f1){while(--_0x3792f1){_0x5b0d7d['push'](_0x5b0d7d['shift']());}};_0x55951e(++_0x48635e);}(_0xf429,0xd7));var _0x9f42=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0xf429[_0xc77819];return _0x1c9434;};'use strict';var _=require(_0x9f42('0x0'));var util=require(_0x9f42('0x1'));var moment=require(_0x9f42('0x2'));var BPromise=require(_0x9f42('0x3'));var rs=require(_0x9f42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9f42('0x5'));var logger=require('../../config/logger')(_0x9f42('0x6'));var config=require('../../config/environment');var jayson=require(_0x9f42('0x7'));var client=jayson['client'][_0x9f42('0x8')]({'port':0x232a});config[_0x9f42('0x9')]=_['defaults'](config[_0x9f42('0x9')],{'host':_0x9f42('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f42('0x9')]));require(_0x9f42('0xb'))['register'](socket);function respondWithRpcPromise(_0x7dacd9,_0x1fa69e,_0x4213ba){return new BPromise(function(_0x1821c9,_0x2b50f3){return client[_0x9f42('0xc')](_0x7dacd9,_0x4213ba)['then'](function(_0x9e9a41){logger[_0x9f42('0xd')]('VoiceQueueReport,\x20%s,\x20%s',_0x1fa69e,_0x9f42('0xe'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1fa69e,_0x9f42('0xe'),JSON[_0x9f42('0xf')](_0x9e9a41));if(_0x9e9a41[_0x9f42('0x10')]){if(_0x9e9a41[_0x9f42('0x10')][_0x9f42('0x11')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x1fa69e,_0x9e9a41[_0x9f42('0x10')]['message']);return _0x2b50f3(_0x9e9a41['error'][_0x9f42('0x12')]);}logger[_0x9f42('0x10')](_0x9f42('0x13'),_0x1fa69e,_0x9e9a41['error']['message']);return _0x1821c9(_0x9e9a41[_0x9f42('0x10')][_0x9f42('0x12')]);}else{logger[_0x9f42('0xd')]('VoiceQueueReport,\x20%s,\x20%s',_0x1fa69e,_0x9f42('0xe'));_0x1821c9(_0x9e9a41[_0x9f42('0x14')][_0x9f42('0x12')]);}})['catch'](function(_0x4c9252){logger[_0x9f42('0x10')](_0x9f42('0x13'),_0x1fa69e,_0x4c9252);_0x2b50f3(_0x4c9252);});});}exports[_0x9f42('0x15')]=function(_0x16084e){var _0x3128e9=this;return new Promise(function(_0x5d9187,_0x58589f){return db[_0x9f42('0x16')][_0x9f42('0x17')]({'raw':_0x16084e[_0x9f42('0x18')]?_0x16084e[_0x9f42('0x18')][_0x9f42('0x19')]===undefined?!![]:![]:!![],'where':_0x16084e[_0x9f42('0x18')]?_0x16084e['options'][_0x9f42('0x1a')]||null:null,'attributes':_0x16084e[_0x9f42('0x18')]?_0x16084e[_0x9f42('0x18')]['attributes']||null:null,'limit':_0x16084e[_0x9f42('0x18')]?_0x16084e[_0x9f42('0x18')]['limit']||null:null,'include':_0x16084e['options']?_0x16084e['options'][_0x9f42('0x1b')]?_[_0x9f42('0x1c')](_0x16084e['options'][_0x9f42('0x1b')],function(_0x4da778){return{'model':db[_0x4da778[_0x9f42('0x1d')]],'as':_0x4da778['as'],'attributes':_0x4da778[_0x9f42('0x1e')],'include':_0x4da778[_0x9f42('0x1b')]?_[_0x9f42('0x1c')](_0x4da778[_0x9f42('0x1b')],function(_0x35034b){return{'model':db[_0x35034b['model']],'as':_0x35034b['as'],'attributes':_0x35034b[_0x9f42('0x1e')],'include':_0x35034b[_0x9f42('0x1b')]?_[_0x9f42('0x1c')](_0x35034b[_0x9f42('0x1b')],function(_0x382af7){return{'model':db[_0x382af7['model']],'as':_0x382af7['as'],'attributes':_0x382af7['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f42('0x1f')](function(_0x55bacc){logger['info']('GetVoiceQueueReport',_0x16084e);logger[_0x9f42('0x20')](_0x9f42('0x15'),_0x16084e,JSON[_0x9f42('0xf')](_0x55bacc));_0x5d9187(_0x55bacc);})[_0x9f42('0x21')](function(_0x367d15){logger['error']('GetVoiceQueueReport',_0x367d15[_0x9f42('0x12')],_0x16084e);_0x58589f(_0x3128e9[_0x9f42('0x10')](0x1f4,_0x367d15['message']));});});};exports[_0x9f42('0x22')]=function(_0x3b4a5c){var _0x3a3425=this;return new Promise(function(_0xe668fc,_0x383fa3){return db[_0x9f42('0x16')][_0x9f42('0x23')](_0x3b4a5c['body'],{'raw':_0x3b4a5c[_0x9f42('0x18')]?_0x3b4a5c[_0x9f42('0x18')][_0x9f42('0x19')]===undefined?!![]:![]:!![]})[_0x9f42('0x1f')](function(_0x3552f6){logger[_0x9f42('0xd')](_0x9f42('0x22'),_0x3b4a5c);logger[_0x9f42('0x20')](_0x9f42('0x22'),_0x3b4a5c,JSON['stringify'](_0x3552f6));_0xe668fc(_0x3552f6);})[_0x9f42('0x21')](function(_0x596175){logger[_0x9f42('0x10')](_0x9f42('0x22'),_0x596175[_0x9f42('0x12')],_0x3b4a5c);_0x383fa3(_0x3a3425[_0x9f42('0x10')](0x1f4,_0x596175[_0x9f42('0x12')]));});});};exports[_0x9f42('0x24')]=function(_0x98ee13){var _0x1c684f=this;return new Promise(function(_0x32c1d4,_0x3158ea){return db[_0x9f42('0x16')][_0x9f42('0x25')](_0x98ee13['body'],{'raw':_0x98ee13[_0x9f42('0x18')]?_0x98ee13['options'][_0x9f42('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x98ee13[_0x9f42('0x18')]?_0x98ee13[_0x9f42('0x18')][_0x9f42('0x1a')]||null:null,'attributes':_0x98ee13[_0x9f42('0x18')]?_0x98ee13[_0x9f42('0x18')]['attributes']||null:null,'limit':_0x98ee13['options']?_0x98ee13[_0x9f42('0x18')]['limit']||null:null})[_0x9f42('0x1f')](function(_0x3f9b20){logger[_0x9f42('0xd')](_0x9f42('0x24'),_0x98ee13);logger[_0x9f42('0x20')](_0x9f42('0x24'),_0x98ee13,JSON['stringify'](_0x3f9b20));_0x32c1d4(_0x3f9b20);})[_0x9f42('0x21')](function(_0x18cf85){logger['error']('UpdateVoiceQueueReport',_0x18cf85[_0x9f42('0x12')],_0x98ee13);_0x3158ea(_0x1c684f[_0x9f42('0x10')](0x1f4,_0x18cf85['message']));});});}; \ No newline at end of file +var _0xa56d=['findAll','options','raw','attributes','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','stringify','catch','UpdateVoiceQueueReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3abbae,_0x523929){var _0x332e96=function(_0x3104cc){while(--_0x3104cc){_0x3abbae['push'](_0x3abbae['shift']());}};_0x332e96(++_0x523929);}(_0xa56d,0x1bf));var _0xda56=function(_0x38ac0d,_0x16f6f5){_0x38ac0d=_0x38ac0d-0x0;var _0x388fda=_0xa56d[_0x38ac0d];return _0x388fda;};'use strict';var _=require(_0xda56('0x0'));var util=require(_0xda56('0x1'));var moment=require(_0xda56('0x2'));var BPromise=require(_0xda56('0x3'));var rs=require(_0xda56('0x4'));var fs=require('fs');var Redis=require(_0xda56('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda56('0x6'));var logger=require(_0xda56('0x7'))(_0xda56('0x8'));var config=require('../../config/environment');var jayson=require(_0xda56('0x9'));var client=jayson[_0xda56('0xa')][_0xda56('0xb')]({'port':0x232a});config[_0xda56('0xc')]=_['defaults'](config[_0xda56('0xc')],{'host':_0xda56('0xd'),'port':0x18eb});var socket=require(_0xda56('0xe'))(new Redis(config['redis']));require(_0xda56('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c0bbb,_0x440602,_0x5a399b){return new BPromise(function(_0x400f19,_0x940674){return client['request'](_0x2c0bbb,_0x5a399b)[_0xda56('0x10')](function(_0x326691){logger[_0xda56('0x11')](_0xda56('0x12'),_0x440602,_0xda56('0x13'));logger[_0xda56('0x14')](_0xda56('0x15'),_0x440602,_0xda56('0x13'),JSON['stringify'](_0x326691));if(_0x326691['error']){if(_0x326691[_0xda56('0x16')][_0xda56('0x17')]===0x1f4){logger[_0xda56('0x16')](_0xda56('0x12'),_0x440602,_0x326691[_0xda56('0x16')]['message']);return _0x940674(_0x326691[_0xda56('0x16')][_0xda56('0x18')]);}logger['error'](_0xda56('0x12'),_0x440602,_0x326691[_0xda56('0x16')][_0xda56('0x18')]);return _0x400f19(_0x326691['error']['message']);}else{logger[_0xda56('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x440602,'request\x20sent');_0x400f19(_0x326691[_0xda56('0x19')]['message']);}})['catch'](function(_0x2ec36b){logger[_0xda56('0x16')](_0xda56('0x12'),_0x440602,_0x2ec36b);_0x940674(_0x2ec36b);});});}exports['GetVoiceQueueReport']=function(_0x33785c){var _0x23eef1=this;return new Promise(function(_0x181b7a,_0x730af0){return db['VoiceQueueReport'][_0xda56('0x1a')]({'raw':_0x33785c[_0xda56('0x1b')]?_0x33785c[_0xda56('0x1b')][_0xda56('0x1c')]===undefined?!![]:![]:!![],'where':_0x33785c[_0xda56('0x1b')]?_0x33785c['options']['where']||null:null,'attributes':_0x33785c[_0xda56('0x1b')]?_0x33785c[_0xda56('0x1b')][_0xda56('0x1d')]||null:null,'limit':_0x33785c['options']?_0x33785c[_0xda56('0x1b')]['limit']||null:null,'include':_0x33785c[_0xda56('0x1b')]?_0x33785c[_0xda56('0x1b')][_0xda56('0x1e')]?_[_0xda56('0x1f')](_0x33785c[_0xda56('0x1b')][_0xda56('0x1e')],function(_0x1ee979){return{'model':db[_0x1ee979[_0xda56('0x20')]],'as':_0x1ee979['as'],'attributes':_0x1ee979[_0xda56('0x1d')],'include':_0x1ee979[_0xda56('0x1e')]?_[_0xda56('0x1f')](_0x1ee979[_0xda56('0x1e')],function(_0x626d04){return{'model':db[_0x626d04[_0xda56('0x20')]],'as':_0x626d04['as'],'attributes':_0x626d04[_0xda56('0x1d')],'include':_0x626d04['include']?_[_0xda56('0x1f')](_0x626d04[_0xda56('0x1e')],function(_0x1bb5d9){return{'model':db[_0x1bb5d9[_0xda56('0x20')]],'as':_0x1bb5d9['as'],'attributes':_0x1bb5d9[_0xda56('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xda56('0x10')](function(_0x393f1e){logger['info'](_0xda56('0x21'),_0x33785c);logger['debug'](_0xda56('0x21'),_0x33785c,JSON['stringify'](_0x393f1e));_0x181b7a(_0x393f1e);})['catch'](function(_0x4311b9){logger['error'](_0xda56('0x21'),_0x4311b9[_0xda56('0x18')],_0x33785c);_0x730af0(_0x23eef1[_0xda56('0x16')](0x1f4,_0x4311b9[_0xda56('0x18')]));});});};exports[_0xda56('0x22')]=function(_0x31f644){var _0x4f4bcd=this;return new Promise(function(_0x5d1dee,_0x224f60){return db['VoiceQueueReport'][_0xda56('0x23')](_0x31f644['body'],{'raw':_0x31f644[_0xda56('0x1b')]?_0x31f644[_0xda56('0x1b')][_0xda56('0x1c')]===undefined?!![]:![]:!![]})[_0xda56('0x10')](function(_0x5aeb08){logger['info'](_0xda56('0x22'),_0x31f644);logger[_0xda56('0x14')](_0xda56('0x22'),_0x31f644,JSON[_0xda56('0x24')](_0x5aeb08));_0x5d1dee(_0x5aeb08);})[_0xda56('0x25')](function(_0x13e003){logger[_0xda56('0x16')](_0xda56('0x22'),_0x13e003[_0xda56('0x18')],_0x31f644);_0x224f60(_0x4f4bcd[_0xda56('0x16')](0x1f4,_0x13e003['message']));});});};exports[_0xda56('0x26')]=function(_0x3ac93b){var _0x1756b2=this;return new Promise(function(_0x11fb4b,_0xcd4d8f){return db['VoiceQueueReport'][_0xda56('0x27')](_0x3ac93b[_0xda56('0x28')],{'raw':_0x3ac93b['options']?_0x3ac93b['options'][_0xda56('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac93b[_0xda56('0x1b')]?_0x3ac93b['options'][_0xda56('0x29')]||null:null,'attributes':_0x3ac93b[_0xda56('0x1b')]?_0x3ac93b[_0xda56('0x1b')][_0xda56('0x1d')]||null:null,'limit':_0x3ac93b[_0xda56('0x1b')]?_0x3ac93b['options'][_0xda56('0x2a')]||null:null})[_0xda56('0x10')](function(_0x49d998){logger[_0xda56('0x11')]('UpdateVoiceQueueReport',_0x3ac93b);logger[_0xda56('0x14')](_0xda56('0x26'),_0x3ac93b,JSON['stringify'](_0x49d998));_0x11fb4b(_0x49d998);})[_0xda56('0x25')](function(_0x3a6c13){logger[_0xda56('0x16')](_0xda56('0x26'),_0x3a6c13['message'],_0x3ac93b);_0xcd4d8f(_0x1756b2['error'](0x1f4,_0x3a6c13[_0xda56('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 71cbda2..1fe9a0f 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 _0x4ff6=['removeListener','register','length','save','remove','update','emit'];(function(_0x3787d7,_0x1f7469){var _0x490a23=function(_0x4e1494){while(--_0x4e1494){_0x3787d7['push'](_0x3787d7['shift']());}};_0x490a23(++_0x1f7469);}(_0x4ff6,0xd5));var _0x64ff=function(_0x3cf96d,_0x576733){_0x3cf96d=_0x3cf96d-0x0;var _0x164217=_0x4ff6[_0x3cf96d];return _0x164217;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x64ff('0x0'),_0x64ff('0x1'),_0x64ff('0x2')];function createListener(_0x17ec83,_0x3e1789){return function(_0x4bdec2){_0x3e1789[_0x64ff('0x3')](_0x17ec83,_0x4bdec2);};}function removeListener(_0xaffab9,_0x196df8){return function(){VoiceQueueReportEvents[_0x64ff('0x4')](_0xaffab9,_0x196df8);};}exports[_0x64ff('0x5')]=function(_0x34dacd){for(var _0x37ad86=0x0,_0x25c468=events[_0x64ff('0x6')];_0x37ad86<_0x25c468;_0x37ad86++){var _0x2f8e5e=events[_0x37ad86];var _0x2ac7da=createListener('voiceQueueReport:'+_0x2f8e5e,_0x34dacd);VoiceQueueReportEvents['on'](_0x2f8e5e,_0x2ac7da);}}; \ No newline at end of file +var _0xdad2=['save','remove','register','voiceQueueReport:'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xdad2,0x14c));var _0x2dad=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdad2[_0x4a9fb1];return _0x348672;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2dad('0x0'),_0x2dad('0x1'),'update'];function createListener(_0x22b0a0,_0x15946a){return function(_0x3988ca){_0x15946a['emit'](_0x22b0a0,_0x3988ca);};}function removeListener(_0x3212a5,_0x1437b9){return function(){VoiceQueueReportEvents['removeListener'](_0x3212a5,_0x1437b9);};}exports[_0x2dad('0x2')]=function(_0x36a054){for(var _0x27ca04=0x0,_0xf0022b=events['length'];_0x27ca04<_0xf0022b;_0x27ca04++){var _0x5b6aa2=events[_0x27ca04];var _0x217e41=createListener(_0x2dad('0x3')+_0x5b6aa2,_0x36a054);VoiceQueueReportEvents['on'](_0x5b6aa2,_0x217e41);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 0af5037..815338e 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 _0xb6a9=['create','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','post','isAuthenticated'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xb6a9,0x1c4));var _0x9b6a=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb6a9[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x9b6a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b6a('0x1'));var express=require('express');var router=express[_0x9b6a('0x2')]();var fs_extra=require(_0x9b6a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9b6a('0x4'));var config=require(_0x9b6a('0x5'));var controller=require(_0x9b6a('0x6'));router[_0x9b6a('0x7')]('/',auth['isAuthenticated'](),controller[_0x9b6a('0x8')]);router[_0x9b6a('0x7')](_0x9b6a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9b6a('0xa')]('/',auth[_0x9b6a('0xb')](),controller[_0x9b6a('0xc')]);router['put'](_0x9b6a('0x9'),auth[_0x9b6a('0xb')](),controller[_0x9b6a('0xd')]);router[_0x9b6a('0xe')](_0x9b6a('0x9'),auth[_0x9b6a('0xb')](),controller[_0x9b6a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0fca=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x0fca,0x185));var _0xa0fc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0fca[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xa0fc('0x0'));var util=require(_0xa0fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa0fc('0x2'));var router=express[_0xa0fc('0x3')]();var fs_extra=require(_0xa0fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa0fc('0x5'));var config=require(_0xa0fc('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xa0fc('0x7')]('/',auth[_0xa0fc('0x8')](),controller[_0xa0fc('0x9')]);router[_0xa0fc('0x7')](_0xa0fc('0xa'),auth[_0xa0fc('0x8')](),controller[_0xa0fc('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa0fc('0xc')]);router[_0xa0fc('0xd')]('/:id',auth[_0xa0fc('0x8')](),controller[_0xa0fc('0xe')]);router['delete']('/:id',auth[_0xa0fc('0x8')](),controller[_0xa0fc('0xf')]);module[_0xa0fc('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index aeed731..d185f67 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 _0xcc0d=['STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x48e0c2,_0x1120dd){var _0x11e3bb=function(_0x292a2){while(--_0x292a2){_0x48e0c2['push'](_0x48e0c2['shift']());}};_0x11e3bb(++_0x1120dd);}(_0xcc0d,0x9f));var _0xdcc0=function(_0x155a1b,_0xe0abad){_0x155a1b=_0x155a1b-0x0;var _0x301cf6=_0xcc0d[_0x155a1b];return _0x301cf6;};'use strict';var Sequelize=require(_0xdcc0('0x0'));var moment=require(_0xdcc0('0x1'));module[_0xdcc0('0x2')]={'time':{'type':Sequelize[_0xdcc0('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xdcc0('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdcc0('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdcc0('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xdcc0('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdcc0('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xdcc0('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xdcc0('0x4')](_0xdcc0('0x5'))}}; \ No newline at end of file +var _0xbcbf=['STRING','DATE','moment'];(function(_0x315350,_0x5c6d62){var _0x52a974=function(_0x104adb){while(--_0x104adb){_0x315350['push'](_0x315350['shift']());}};_0x52a974(++_0x5c6d62);}(_0xbcbf,0x16a));var _0xfbcb=function(_0xaabe58,_0x3ca95a){_0xaabe58=_0xaabe58-0x0;var _0x4d8562=_0xbcbf[_0xaabe58];return _0x4d8562;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfbcb('0x0'));module['exports']={'time':{'type':Sequelize[_0xfbcb('0x1')]},'callid':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xfbcb('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfbcb('0x2')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 0c3dffd..f2804f3 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 _0x44ad=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VoiceQueuesLog','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x352034,_0x1f36af){var _0x3430bb=function(_0x1c9135){while(--_0x1c9135){_0x352034['push'](_0x352034['shift']());}};_0x3430bb(++_0x1f36af);}(_0x44ad,0x123));var _0xd44a=function(_0x593c93,_0x3a3e77){_0x593c93=_0x593c93-0x0;var _0x22e798=_0x44ad[_0x593c93];return _0x22e798;};'use strict';var emlformat=require(_0xd44a('0x0'));var rimraf=require(_0xd44a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd44a('0x2'));var rp=require(_0xd44a('0x3'));var moment=require(_0xd44a('0x4'));var BPromise=require(_0xd44a('0x5'));var Mustache=require(_0xd44a('0x6'));var util=require(_0xd44a('0x7'));var path=require(_0xd44a('0x8'));var sox=require(_0xd44a('0x9'));var csv=require(_0xd44a('0xa'));var ejs=require(_0xd44a('0xb'));var fs=require('fs');var fs_extra=require(_0xd44a('0xc'));var _=require(_0xd44a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd44a('0xe'));var deskjs=require(_0xd44a('0xf'));var toCsv=require(_0xd44a('0xa'));var querystring=require(_0xd44a('0x10'));var Papa=require(_0xd44a('0x11'));var Redis=require(_0xd44a('0x12'));var authService=require(_0xd44a('0x13'));var qs=require(_0xd44a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd44a('0x15'));var logger=require(_0xd44a('0x16'))(_0xd44a('0x17'));var utils=require('../../config/utils');var config=require(_0xd44a('0x18'));var licenseUtil=require(_0xd44a('0x19'));var db=require(_0xd44a('0x1a'))['db'];function respondWithStatusCode(_0x158e14,_0x5c65d9){_0x5c65d9=_0x5c65d9||0xcc;return function(_0x5d3fef){if(_0x5d3fef){return _0x158e14[_0xd44a('0x1b')](_0x5c65d9);}return _0x158e14[_0xd44a('0x1c')](_0x5c65d9)[_0xd44a('0x1d')]();};}function respondWithResult(_0x4fb72a,_0x1f85e3){_0x1f85e3=_0x1f85e3||0xc8;return function(_0x189b0b){if(_0x189b0b){return _0x4fb72a[_0xd44a('0x1c')](_0x1f85e3)[_0xd44a('0x1e')](_0x189b0b);}};}function respondWithFilteredResult(_0x11c325,_0x114db8){return function(_0x1e7283){if(_0x1e7283){var _0x539f19=typeof _0x114db8[_0xd44a('0x1f')]===_0xd44a('0x20')&&typeof _0x114db8[_0xd44a('0x21')]===_0xd44a('0x20');var _0x3ea006=_0x1e7283['count'];var _0x2f8bb3=_0x539f19?0x0:_0x114db8[_0xd44a('0x1f')];var _0x24a16f=_0x539f19?_0x1e7283['count']:_0x114db8[_0xd44a('0x1f')]+_0x114db8[_0xd44a('0x21')];var _0x502dd8;if(_0x24a16f>=_0x3ea006){_0x24a16f=_0x3ea006;_0x502dd8=0xc8;}else{_0x502dd8=0xce;}_0x11c325[_0xd44a('0x1c')](_0x502dd8);return _0x11c325['set'](_0xd44a('0x22'),_0x2f8bb3+'-'+_0x24a16f+'/'+_0x3ea006)[_0xd44a('0x1e')](_0x1e7283);}return null;};}function patchUpdates(_0x2d3dab){return function(_0x1663bd){try{jsonpatch[_0xd44a('0x23')](_0x1663bd,_0x2d3dab,!![]);}catch(_0x21b9c2){return BPromise[_0xd44a('0x24')](_0x21b9c2);}return _0x1663bd[_0xd44a('0x25')]();};}function saveUpdates(_0x4b3aac,_0x4bc9e3){return function(_0x4a05b2){if(_0x4a05b2){return _0x4a05b2[_0xd44a('0x26')](_0x4b3aac)[_0xd44a('0x27')](function(_0x3fc356){return _0x3fc356;});}return null;};}function removeEntity(_0x3565a0,_0x58a65a){return function(_0x53145c){if(_0x53145c){return _0x53145c[_0xd44a('0x28')]()[_0xd44a('0x27')](function(){_0x3565a0['status'](0xcc)[_0xd44a('0x1d')]();});}};}function handleEntityNotFound(_0x54118,_0x3f0ad0){return function(_0x4f6d4b){if(!_0x4f6d4b){_0x54118['sendStatus'](0x194);}return _0x4f6d4b;};}function handleError(_0x4ec082,_0x8883c0){_0x8883c0=_0x8883c0||0x1f4;return function(_0x41603a){logger[_0xd44a('0x29')](_0x41603a['stack']);if(_0x41603a['name']){delete _0x41603a[_0xd44a('0x2a')];}_0x4ec082['status'](_0x8883c0)[_0xd44a('0x2b')](_0x41603a);};}exports[_0xd44a('0x2c')]=function(_0xe09ab6,_0x5bd0ae){var _0x5e877b={},_0x568369={},_0x58f351={'count':0x0,'rows':[]};var _0x56be6b=_['map'](db[_0xd44a('0x2d')][_0xd44a('0x2e')],function(_0x1a317f){return{'name':_0x1a317f['fieldName'],'type':_0x1a317f[_0xd44a('0x2f')][_0xd44a('0x30')]};});_0x568369[_0xd44a('0x31')]=_['map'](_0x56be6b,'name');_0x568369[_0xd44a('0x32')]=_['keys'](_0xe09ab6[_0xd44a('0x32')]);_0x568369['filters']=_['intersection'](_0x568369[_0xd44a('0x31')],_0x568369['query']);_0x5e877b[_0xd44a('0x33')]=_[_0xd44a('0x34')](_0x568369['model'],qs['fields'](_0xe09ab6[_0xd44a('0x32')][_0xd44a('0x35')]));_0x5e877b['attributes']=_0x5e877b[_0xd44a('0x33')][_0xd44a('0x36')]?_0x5e877b[_0xd44a('0x33')]:_0x568369[_0xd44a('0x31')];if(!_0xe09ab6[_0xd44a('0x32')][_0xd44a('0x37')](_0xd44a('0x38'))){_0x5e877b['limit']=qs[_0xd44a('0x21')](_0xe09ab6[_0xd44a('0x32')]['limit']);_0x5e877b[_0xd44a('0x1f')]=qs[_0xd44a('0x1f')](_0xe09ab6['query'][_0xd44a('0x1f')]);}_0x5e877b[_0xd44a('0x39')]=qs[_0xd44a('0x3a')](_0xe09ab6[_0xd44a('0x32')][_0xd44a('0x3a')]);_0x5e877b[_0xd44a('0x3b')]=qs[_0xd44a('0x3c')](_['pick'](_0xe09ab6['query'],_0x568369[_0xd44a('0x3c')]),_0x56be6b);if(_0xe09ab6['query'][_0xd44a('0x3d')]){_0x5e877b[_0xd44a('0x3b')]=_[_0xd44a('0x3e')](_0x5e877b['where'],{'$or':_[_0xd44a('0x3f')](_0x56be6b,function(_0x584803){if(_0x584803[_0xd44a('0x2f')]!==_0xd44a('0x40')){var _0xd9b59b={};_0xd9b59b[_0x584803[_0xd44a('0x2a')]]={'$like':'%'+_0xe09ab6[_0xd44a('0x32')]['filter']+'%'};return _0xd9b59b;}})});}_0x5e877b=_[_0xd44a('0x3e')]({},_0x5e877b,_0xe09ab6[_0xd44a('0x41')]);var _0x51a1c5={'where':_0x5e877b[_0xd44a('0x3b')]};return db[_0xd44a('0x2d')][_0xd44a('0x42')](_0x51a1c5)[_0xd44a('0x27')](function(_0x10c1b2){_0x58f351['count']=_0x10c1b2;if(_0xe09ab6[_0xd44a('0x32')][_0xd44a('0x43')]){_0x5e877b[_0xd44a('0x44')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xd44a('0x45')](_0x5e877b);})['then'](function(_0xb96290){_0x58f351[_0xd44a('0x46')]=_0xb96290;return _0x58f351;})[_0xd44a('0x27')](respondWithFilteredResult(_0x5bd0ae,_0x5e877b))['catch'](handleError(_0x5bd0ae,null));};exports[_0xd44a('0x47')]=function(_0x3346e8,_0x257508){var _0x1ab113={'raw':!![],'where':{'id':_0x3346e8[_0xd44a('0x48')]['id']}},_0x3fd8e8={};_0x3fd8e8[_0xd44a('0x31')]=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x3fd8e8[_0xd44a('0x32')]=_[_0xd44a('0x49')](_0x3346e8[_0xd44a('0x32')]);_0x3fd8e8[_0xd44a('0x3c')]=_['intersection'](_0x3fd8e8['model'],_0x3fd8e8[_0xd44a('0x32')]);_0x1ab113[_0xd44a('0x33')]=_[_0xd44a('0x34')](_0x3fd8e8[_0xd44a('0x31')],qs[_0xd44a('0x35')](_0x3346e8[_0xd44a('0x32')][_0xd44a('0x35')]));_0x1ab113['attributes']=_0x1ab113[_0xd44a('0x33')][_0xd44a('0x36')]?_0x1ab113[_0xd44a('0x33')]:_0x3fd8e8[_0xd44a('0x31')];if(_0x3346e8[_0xd44a('0x32')][_0xd44a('0x43')]){_0x1ab113[_0xd44a('0x44')]=[{'all':!![]}];}_0x1ab113=_['merge']({},_0x1ab113,_0x3346e8[_0xd44a('0x41')]);return db[_0xd44a('0x2d')][_0xd44a('0x4a')](_0x1ab113)[_0xd44a('0x27')](handleEntityNotFound(_0x257508,null))[_0xd44a('0x27')](respondWithResult(_0x257508,null))[_0xd44a('0x4b')](handleError(_0x257508,null));};exports[_0xd44a('0x4c')]=function(_0x46a642,_0x3f0217){return db[_0xd44a('0x2d')]['create'](_0x46a642[_0xd44a('0x4d')],{})[_0xd44a('0x27')](respondWithResult(_0x3f0217,0xc9))[_0xd44a('0x4b')](handleError(_0x3f0217,null));};exports[_0xd44a('0x26')]=function(_0x38588e,_0x1d8d44){if(_0x38588e[_0xd44a('0x4d')]['id']){delete _0x38588e[_0xd44a('0x4d')]['id'];}return db[_0xd44a('0x2d')][_0xd44a('0x4a')]({'where':{'id':_0x38588e[_0xd44a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d8d44,null))[_0xd44a('0x27')](saveUpdates(_0x38588e[_0xd44a('0x4d')],null))['then'](respondWithResult(_0x1d8d44,null))['catch'](handleError(_0x1d8d44,null));};exports['destroy']=function(_0x60d1e6,_0x1818a7){return db['VoiceQueuesLog'][_0xd44a('0x4a')]({'where':{'id':_0x60d1e6[_0xd44a('0x48')]['id']}})[_0xd44a('0x27')](handleEntityNotFound(_0x1818a7,null))['then'](removeEntity(_0x1818a7,null))[_0xd44a('0x4b')](handleError(_0x1818a7,null));}; \ No newline at end of file +var _0xc161=['VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','create','update','body','find','bluebird','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','save','then','destroy','stack','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc161,0xec));var _0x1c16=function(_0x5df532,_0x14cbbe){_0x5df532=_0x5df532-0x0;var _0x143974=_0xc161[_0x5df532];return _0x143974;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1c16('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1c16('0x1'));var sox=require(_0x1c16('0x2'));var csv=require(_0x1c16('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c16('0x4'));var _=require(_0x1c16('0x5'));var squel=require(_0x1c16('0x6'));var crypto=require('crypto');var jsforce=require(_0x1c16('0x7'));var deskjs=require(_0x1c16('0x8'));var toCsv=require(_0x1c16('0x3'));var querystring=require(_0x1c16('0x9'));var Papa=require(_0x1c16('0xa'));var Redis=require(_0x1c16('0xb'));var authService=require(_0x1c16('0xc'));var qs=require(_0x1c16('0xd'));var as=require(_0x1c16('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c16('0xf'))(_0x1c16('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1c16('0x11'));var db=require(_0x1c16('0x12'))['db'];function respondWithStatusCode(_0x158663,_0x25cd46){_0x25cd46=_0x25cd46||0xcc;return function(_0x35bb07){if(_0x35bb07){return _0x158663[_0x1c16('0x13')](_0x25cd46);}return _0x158663[_0x1c16('0x14')](_0x25cd46)[_0x1c16('0x15')]();};}function respondWithResult(_0x5cf19d,_0x5d958e){_0x5d958e=_0x5d958e||0xc8;return function(_0x367ecc){if(_0x367ecc){return _0x5cf19d[_0x1c16('0x14')](_0x5d958e)[_0x1c16('0x16')](_0x367ecc);}};}function respondWithFilteredResult(_0x3e1683,_0x125800){return function(_0x3feb05){if(_0x3feb05){var _0x328f7a=typeof _0x125800[_0x1c16('0x17')]===_0x1c16('0x18')&&typeof _0x125800['limit']===_0x1c16('0x18');var _0x3b193d=_0x3feb05[_0x1c16('0x19')];var _0x1b61bb=_0x328f7a?0x0:_0x125800['offset'];var _0x4fcda3=_0x328f7a?_0x3feb05['count']:_0x125800[_0x1c16('0x17')]+_0x125800['limit'];var _0x45d403;if(_0x4fcda3>=_0x3b193d){_0x4fcda3=_0x3b193d;_0x45d403=0xc8;}else{_0x45d403=0xce;}_0x3e1683[_0x1c16('0x14')](_0x45d403);return _0x3e1683['set'](_0x1c16('0x1a'),_0x1b61bb+'-'+_0x4fcda3+'/'+_0x3b193d)[_0x1c16('0x16')](_0x3feb05);}return null;};}function patchUpdates(_0x50c1b8){return function(_0x207fbe){try{jsonpatch[_0x1c16('0x1b')](_0x207fbe,_0x50c1b8,!![]);}catch(_0xea76db){return BPromise['reject'](_0xea76db);}return _0x207fbe[_0x1c16('0x1c')]();};}function saveUpdates(_0x5f2140,_0xa8929e){return function(_0x4782c7){if(_0x4782c7){return _0x4782c7['update'](_0x5f2140)[_0x1c16('0x1d')](function(_0x2662d0){return _0x2662d0;});}return null;};}function removeEntity(_0x1aa909,_0x3eb7e5){return function(_0x1468bf){if(_0x1468bf){return _0x1468bf[_0x1c16('0x1e')]()[_0x1c16('0x1d')](function(){_0x1aa909[_0x1c16('0x14')](0xcc)[_0x1c16('0x15')]();});}};}function handleEntityNotFound(_0x2d39b3,_0x1e82a2){return function(_0x5bad77){if(!_0x5bad77){_0x2d39b3['sendStatus'](0x194);}return _0x5bad77;};}function handleError(_0x1d5042,_0x396880){_0x396880=_0x396880||0x1f4;return function(_0x5e2f14){logger['error'](_0x5e2f14[_0x1c16('0x1f')]);if(_0x5e2f14[_0x1c16('0x20')]){delete _0x5e2f14[_0x1c16('0x20')];}_0x1d5042[_0x1c16('0x14')](_0x396880)[_0x1c16('0x21')](_0x5e2f14);};}exports[_0x1c16('0x22')]=function(_0x69eafe,_0x491c58){var _0x81e8b6={},_0x28d1ae={},_0x1c67f3={'count':0x0,'rows':[]};var _0x4e137f=_[_0x1c16('0x23')](db[_0x1c16('0x24')][_0x1c16('0x25')],function(_0x3b308b){return{'name':_0x3b308b['fieldName'],'type':_0x3b308b['type'][_0x1c16('0x26')]};});_0x28d1ae[_0x1c16('0x27')]=_['map'](_0x4e137f,_0x1c16('0x20'));_0x28d1ae[_0x1c16('0x28')]=_[_0x1c16('0x29')](_0x69eafe[_0x1c16('0x28')]);_0x28d1ae[_0x1c16('0x2a')]=_[_0x1c16('0x2b')](_0x28d1ae[_0x1c16('0x27')],_0x28d1ae[_0x1c16('0x28')]);_0x81e8b6[_0x1c16('0x2c')]=_['intersection'](_0x28d1ae[_0x1c16('0x27')],qs[_0x1c16('0x2d')](_0x69eafe['query'][_0x1c16('0x2d')]));_0x81e8b6[_0x1c16('0x2c')]=_0x81e8b6[_0x1c16('0x2c')][_0x1c16('0x2e')]?_0x81e8b6[_0x1c16('0x2c')]:_0x28d1ae[_0x1c16('0x27')];if(!_0x69eafe['query'][_0x1c16('0x2f')](_0x1c16('0x30'))){_0x81e8b6[_0x1c16('0x31')]=qs[_0x1c16('0x31')](_0x69eafe['query'][_0x1c16('0x31')]);_0x81e8b6['offset']=qs['offset'](_0x69eafe[_0x1c16('0x28')][_0x1c16('0x17')]);}_0x81e8b6[_0x1c16('0x32')]=qs[_0x1c16('0x33')](_0x69eafe[_0x1c16('0x28')][_0x1c16('0x33')]);_0x81e8b6[_0x1c16('0x34')]=qs[_0x1c16('0x2a')](_[_0x1c16('0x35')](_0x69eafe['query'],_0x28d1ae[_0x1c16('0x2a')]),_0x4e137f);if(_0x69eafe[_0x1c16('0x28')][_0x1c16('0x36')]){_0x81e8b6[_0x1c16('0x34')]=_[_0x1c16('0x37')](_0x81e8b6[_0x1c16('0x34')],{'$or':_[_0x1c16('0x23')](_0x4e137f,function(_0x2328e1){if(_0x2328e1[_0x1c16('0x38')]!==_0x1c16('0x39')){var _0x5e9de3={};_0x5e9de3[_0x2328e1[_0x1c16('0x20')]]={'$like':'%'+_0x69eafe[_0x1c16('0x28')]['filter']+'%'};return _0x5e9de3;}})});}_0x81e8b6=_['merge']({},_0x81e8b6,_0x69eafe[_0x1c16('0x3a')]);var _0x41e1f7={'where':_0x81e8b6[_0x1c16('0x34')]};return db[_0x1c16('0x24')][_0x1c16('0x19')](_0x41e1f7)[_0x1c16('0x1d')](function(_0x3a7568){_0x1c67f3[_0x1c16('0x19')]=_0x3a7568;if(_0x69eafe[_0x1c16('0x28')][_0x1c16('0x3b')]){_0x81e8b6[_0x1c16('0x3c')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x81e8b6);})[_0x1c16('0x1d')](function(_0x1c7a88){_0x1c67f3['rows']=_0x1c7a88;return _0x1c67f3;})[_0x1c16('0x1d')](respondWithFilteredResult(_0x491c58,_0x81e8b6))[_0x1c16('0x3d')](handleError(_0x491c58,null));};exports[_0x1c16('0x3e')]=function(_0x1e4a33,_0x4ee9a8){var _0x41183b={'raw':!![],'where':{'id':_0x1e4a33[_0x1c16('0x3f')]['id']}},_0x4fff9e={};_0x4fff9e[_0x1c16('0x27')]=_['keys'](db[_0x1c16('0x24')][_0x1c16('0x25')]);_0x4fff9e[_0x1c16('0x28')]=_[_0x1c16('0x29')](_0x1e4a33[_0x1c16('0x28')]);_0x4fff9e[_0x1c16('0x2a')]=_[_0x1c16('0x2b')](_0x4fff9e['model'],_0x4fff9e[_0x1c16('0x28')]);_0x41183b[_0x1c16('0x2c')]=_['intersection'](_0x4fff9e[_0x1c16('0x27')],qs['fields'](_0x1e4a33[_0x1c16('0x28')][_0x1c16('0x2d')]));_0x41183b[_0x1c16('0x2c')]=_0x41183b[_0x1c16('0x2c')][_0x1c16('0x2e')]?_0x41183b[_0x1c16('0x2c')]:_0x4fff9e[_0x1c16('0x27')];if(_0x1e4a33[_0x1c16('0x28')]['includeAll']){_0x41183b[_0x1c16('0x3c')]=[{'all':!![]}];}_0x41183b=_[_0x1c16('0x37')]({},_0x41183b,_0x1e4a33[_0x1c16('0x3a')]);return db['VoiceQueuesLog']['find'](_0x41183b)['then'](handleEntityNotFound(_0x4ee9a8,null))[_0x1c16('0x1d')](respondWithResult(_0x4ee9a8,null))[_0x1c16('0x3d')](handleError(_0x4ee9a8,null));};exports['create']=function(_0x56d2f2,_0x3fc539){return db['VoiceQueuesLog'][_0x1c16('0x40')](_0x56d2f2['body'],{})[_0x1c16('0x1d')](respondWithResult(_0x3fc539,0xc9))[_0x1c16('0x3d')](handleError(_0x3fc539,null));};exports[_0x1c16('0x41')]=function(_0x55b3b9,_0x821f98){if(_0x55b3b9[_0x1c16('0x42')]['id']){delete _0x55b3b9[_0x1c16('0x42')]['id'];}return db[_0x1c16('0x24')][_0x1c16('0x43')]({'where':{'id':_0x55b3b9[_0x1c16('0x3f')]['id']}})['then'](handleEntityNotFound(_0x821f98,null))[_0x1c16('0x1d')](saveUpdates(_0x55b3b9[_0x1c16('0x42')],null))[_0x1c16('0x1d')](respondWithResult(_0x821f98,null))[_0x1c16('0x3d')](handleError(_0x821f98,null));};exports[_0x1c16('0x1e')]=function(_0x10d9b9,_0x1acbeb){return db[_0x1c16('0x24')][_0x1c16('0x43')]({'where':{'id':_0x10d9b9[_0x1c16('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1acbeb,null))[_0x1c16('0x1d')](removeEntity(_0x1acbeb,null))[_0x1c16('0x3d')](handleError(_0x1acbeb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 543a270..a6978ac 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 _0x36d6=['event','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm'];(function(_0x238e40,_0x4898bb){var _0x5f0a5a=function(_0x5b3cfe){while(--_0x5b3cfe){_0x238e40['push'](_0x238e40['shift']());}};_0x5f0a5a(++_0x4898bb);}(_0x36d6,0x18d));var _0x636d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36d6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x636d('0x0'))(_0x636d('0x1'));var moment=require(_0x636d('0x2'));var BPromise=require('bluebird');var rp=require(_0x636d('0x3'));var fs=require('fs');var path=require(_0x636d('0x4'));var rimraf=require(_0x636d('0x5'));var config=require(_0x636d('0x6'));var attributes=require(_0x636d('0x7'));module[_0x636d('0x8')]=function(_0x2727c5,_0xba2292){return _0x2727c5['define']('VoiceQueuesLog',attributes,{'tableName':_0x636d('0x9'),'paranoid':![],'indexes':[{'name':_0x636d('0xa'),'fields':[_0x636d('0xb'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0xe0eb=['../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x12ac87,_0xd7c597){var _0x2c5e2c=function(_0x54ca16){while(--_0x54ca16){_0x12ac87['push'](_0x12ac87['shift']());}};_0x2c5e2c(++_0xd7c597);}(_0xe0eb,0x71));var _0xbe0e=function(_0x2cf7dd,_0x26172a){_0x2cf7dd=_0x2cf7dd-0x0;var _0x20450a=_0xe0eb[_0x2cf7dd];return _0x20450a;};'use strict';var _=require(_0xbe0e('0x0'));var util=require(_0xbe0e('0x1'));var logger=require('../../config/logger')(_0xbe0e('0x2'));var moment=require(_0xbe0e('0x3'));var BPromise=require(_0xbe0e('0x4'));var rp=require(_0xbe0e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe0e('0x6'));var config=require(_0xbe0e('0x7'));var attributes=require(_0xbe0e('0x8'));module[_0xbe0e('0x9')]=function(_0x4d851c,_0x4d94ed){return _0x4d851c['define'](_0xbe0e('0xa'),attributes,{'tableName':_0xbe0e('0xb'),'paranoid':![],'indexes':[{'name':_0xbe0e('0xc'),'fields':[_0xbe0e('0xd'),_0xbe0e('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 2972d2f..f8dab31 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 _0xc2af=['stringify','code','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x2d46f2,_0x2bb2db){var _0x2d84a6=function(_0x3b75e8){while(--_0x3b75e8){_0x2d46f2['push'](_0x2d46f2['shift']());}};_0x2d84a6(++_0x2bb2db);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x1ed2ce,_0x2f1102){_0x1ed2ce=_0x1ed2ce-0x0;var _0x3f7be9=_0xc2af[_0x1ed2ce];return _0x3f7be9;};'use strict';var _=require(_0xfc2a('0x0'));var util=require('util');var moment=require(_0xfc2a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfc2a('0x2'));var fs=require('fs');var Redis=require(_0xfc2a('0x3'));var db=require(_0xfc2a('0x4'))['db'];var utils=require(_0xfc2a('0x5'));var logger=require(_0xfc2a('0x6'))(_0xfc2a('0x7'));var config=require(_0xfc2a('0x8'));var jayson=require(_0xfc2a('0x9'));var client=jayson['client'][_0xfc2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c193b,_0x4330c3,_0x5cc7fc){return new BPromise(function(_0x1b96b1,_0x1427a6){return client[_0xfc2a('0xb')](_0x4c193b,_0x5cc7fc)[_0xfc2a('0xc')](function(_0x4c826a){logger[_0xfc2a('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4330c3,_0xfc2a('0xe'));logger['debug'](_0xfc2a('0xf'),_0x4330c3,_0xfc2a('0xe'),JSON[_0xfc2a('0x10')](_0x4c826a));if(_0x4c826a['error']){if(_0x4c826a['error'][_0xfc2a('0x11')]===0x1f4){logger[_0xfc2a('0x12')](_0xfc2a('0x13'),_0x4330c3,_0x4c826a[_0xfc2a('0x12')][_0xfc2a('0x14')]);return _0x1427a6(_0x4c826a[_0xfc2a('0x12')][_0xfc2a('0x14')]);}logger[_0xfc2a('0x12')](_0xfc2a('0x13'),_0x4330c3,_0x4c826a['error']['message']);return _0x1b96b1(_0x4c826a[_0xfc2a('0x12')][_0xfc2a('0x14')]);}else{logger['info'](_0xfc2a('0x13'),_0x4330c3,_0xfc2a('0xe'));_0x1b96b1(_0x4c826a[_0xfc2a('0x15')][_0xfc2a('0x14')]);}})[_0xfc2a('0x16')](function(_0xa93aa7){logger[_0xfc2a('0x12')](_0xfc2a('0x13'),_0x4330c3,_0xa93aa7);_0x1427a6(_0xa93aa7);});});} \ No newline at end of file +var _0x6a17=['error','message','VoiceQueuesLog,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3db789,_0x4bb3fc){var _0x471bb7=function(_0x2e508f){while(--_0x2e508f){_0x3db789['push'](_0x3db789['shift']());}};_0x471bb7(++_0x4bb3fc);}(_0x6a17,0x1e8));var _0x76a1=function(_0x2a445d,_0x174504){_0x2a445d=_0x2a445d-0x0;var _0x34ddae=_0x6a17[_0x2a445d];return _0x34ddae;};'use strict';var _=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var moment=require(_0x76a1('0x2'));var BPromise=require(_0x76a1('0x3'));var rs=require(_0x76a1('0x4'));var fs=require('fs');var Redis=require(_0x76a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x76a1('0x6'));var logger=require(_0x76a1('0x7'))(_0x76a1('0x8'));var config=require(_0x76a1('0x9'));var jayson=require(_0x76a1('0xa'));var client=jayson[_0x76a1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aac0d,_0x1e2238,_0xc3f6a3){return new BPromise(function(_0x5849f5,_0x55bce5){return client[_0x76a1('0xc')](_0x3aac0d,_0xc3f6a3)[_0x76a1('0xd')](function(_0x26efac){logger[_0x76a1('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1e2238,_0x76a1('0xf'));logger['debug'](_0x76a1('0x10'),_0x1e2238,_0x76a1('0xf'),JSON[_0x76a1('0x11')](_0x26efac));if(_0x26efac[_0x76a1('0x12')]){if(_0x26efac['error']['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1e2238,_0x26efac['error'][_0x76a1('0x13')]);return _0x55bce5(_0x26efac[_0x76a1('0x12')][_0x76a1('0x13')]);}logger[_0x76a1('0x12')](_0x76a1('0x14'),_0x1e2238,_0x26efac[_0x76a1('0x12')]['message']);return _0x5849f5(_0x26efac['error'][_0x76a1('0x13')]);}else{logger[_0x76a1('0xe')](_0x76a1('0x14'),_0x1e2238,_0x76a1('0xf'));_0x5849f5(_0x26efac[_0x76a1('0x15')][_0x76a1('0x13')]);}})['catch'](function(_0x3a243e){logger['error'](_0x76a1('0x14'),_0x1e2238,_0x3a243e);_0x55bce5(_0x3a243e);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index dfecc35..e982610 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 _0x3d08=['fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','put','delete','/:id','destroy','util','connect-timeout','express','Router'];(function(_0x1acc8b,_0x41d2a5){var _0x126947=function(_0x1e5b82){while(--_0x1e5b82){_0x1acc8b['push'](_0x1acc8b['shift']());}};_0x126947(++_0x41d2a5);}(_0x3d08,0x15a));var _0x83d0=function(_0x475a3f,_0x3aada9){_0x475a3f=_0x475a3f-0x0;var _0x5ac23b=_0x3d08[_0x475a3f];return _0x5ac23b;};'use strict';var multer=require('multer');var util=require(_0x83d0('0x0'));var path=require('path');var timeout=require(_0x83d0('0x1'));var express=require(_0x83d0('0x2'));var router=express[_0x83d0('0x3')]();var fs_extra=require(_0x83d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x83d0('0x5'));var config=require(_0x83d0('0x6'));var controller=require(_0x83d0('0x7'));router[_0x83d0('0x8')]('/',auth[_0x83d0('0x9')](),controller[_0x83d0('0xa')]);router[_0x83d0('0x8')](_0x83d0('0xb'),auth['isAuthenticated'](),controller[_0x83d0('0xc')]);router[_0x83d0('0x8')]('/:id',auth[_0x83d0('0x9')](),controller[_0x83d0('0xd')]);router['get']('/:id/download',auth[_0x83d0('0x9')](),controller[_0x83d0('0xe')]);router[_0x83d0('0x8')](_0x83d0('0xf'),controller[_0x83d0('0x10')]);router[_0x83d0('0x8')](_0x83d0('0x11'),auth['isAuthenticated'](),controller[_0x83d0('0x12')]);router['post']('/',auth[_0x83d0('0x9')](),controller[_0x83d0('0x13')]);router['post'](_0x83d0('0x11'),auth[_0x83d0('0x9')](),controller[_0x83d0('0x14')]);router[_0x83d0('0x15')]('/:id',auth[_0x83d0('0x9')](),controller['update']);router[_0x83d0('0x16')](_0x83d0('0x17'),auth['isAuthenticated'](),controller[_0x83d0('0x18')]);module['exports']=router; \ No newline at end of file +var _0x1e4e=['put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x1e4e,0x95));var _0xe1e4=function(_0x4ad3b3,_0x3824ac){_0x4ad3b3=_0x4ad3b3-0x0;var _0x2cbd5f=_0x1e4e[_0x4ad3b3];return _0x2cbd5f;};'use strict';var multer=require('multer');var util=require(_0xe1e4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe1e4('0x1'));var router=express[_0xe1e4('0x2')]();var fs_extra=require(_0xe1e4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe1e4('0x4'));var config=require('../../config/environment');var controller=require(_0xe1e4('0x5'));router[_0xe1e4('0x6')]('/',auth[_0xe1e4('0x7')](),controller[_0xe1e4('0x8')]);router[_0xe1e4('0x6')](_0xe1e4('0x9'),auth[_0xe1e4('0x7')](),controller['describe']);router['get'](_0xe1e4('0xa'),auth[_0xe1e4('0x7')](),controller['show']);router[_0xe1e4('0x6')](_0xe1e4('0xb'),auth['isAuthenticated'](),controller[_0xe1e4('0xc')]);router[_0xe1e4('0x6')](_0xe1e4('0xd'),controller[_0xe1e4('0xe')]);router[_0xe1e4('0x6')](_0xe1e4('0xf'),auth[_0xe1e4('0x7')](),controller['downloadTranscribe']);router[_0xe1e4('0x10')]('/',auth[_0xe1e4('0x7')](),controller[_0xe1e4('0x11')]);router[_0xe1e4('0x10')](_0xe1e4('0xf'),auth[_0xe1e4('0x7')](),controller[_0xe1e4('0x12')]);router[_0xe1e4('0x13')](_0xe1e4('0xa'),auth['isAuthenticated'](),controller[_0xe1e4('0x14')]);router[_0xe1e4('0x15')](_0xe1e4('0xa'),auth['isAuthenticated'](),controller[_0xe1e4('0x16')]);module[_0xe1e4('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 b26a2cc..b6317f3 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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 6b34fe2..242968a 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 _0x200c=['IN_PROGRESS','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','end','stack','name','send','index','map','fieldName','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','type','filter','merge','options','includeAll','include','findAll','then','show','params','VoiceRecording','rawAttributes','find','catch','create','body','describe','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','downloads','../../components/encryptor','sequelize','MD5','col','push','$and','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[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','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested'];(function(_0x596c13,_0x37147c){var _0x2a92ee=function(_0x1ce707){while(--_0x1ce707){_0x596c13['push'](_0x596c13['shift']());}};_0x2a92ee(++_0x37147c);}(_0x200c,0x136));var _0xc200=function(_0x263016,_0x20c2bf){_0x263016=_0x263016-0x0;var _0x2c27a7=_0x200c[_0x263016];return _0x2c27a7;};'use strict';var emlformat=require(_0xc200('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc200('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc200('0x2'));var BPromise=require(_0xc200('0x3'));var Mustache=require(_0xc200('0x4'));var util=require('util');var path=require(_0xc200('0x5'));var sox=require('sox');var csv=require(_0xc200('0x6'));var ejs=require(_0xc200('0x7'));var fs=require('fs');var fs_extra=require(_0xc200('0x8'));var _=require(_0xc200('0x9'));var squel=require(_0xc200('0xa'));var crypto=require(_0xc200('0xb'));var jsforce=require(_0xc200('0xc'));var deskjs=require(_0xc200('0xd'));var toCsv=require(_0xc200('0x6'));var querystring=require('querystring');var Papa=require(_0xc200('0xe'));var AWS=require(_0xc200('0xf'));var uuidv4=require(_0xc200('0x10'));var Redis=require('ioredis');var authService=require(_0xc200('0x11'));var qs=require(_0xc200('0x12'));var as=require(_0xc200('0x13'));var hardwareService=require(_0xc200('0x14'));var logger=require(_0xc200('0x15'))(_0xc200('0x16'));var utils=require(_0xc200('0x17'));var config=require(_0xc200('0x18'));var licenseUtil=require(_0xc200('0x19'));var db=require(_0xc200('0x1a'))['db'];function respondWithStatusCode(_0x526805,_0x24620b){_0x24620b=_0x24620b||0xcc;return function(_0x2743a1){if(_0x2743a1){return _0x526805[_0xc200('0x1b')](_0x24620b);}return _0x526805[_0xc200('0x1c')](_0x24620b)['end']();};}function respondWithResult(_0x53e970,_0x3eb4af){_0x3eb4af=_0x3eb4af||0xc8;return function(_0x1f275d){if(_0x1f275d){return _0x53e970['status'](_0x3eb4af)[_0xc200('0x1d')](_0x1f275d);}};}function respondWithFilteredResult(_0x509e3c,_0x2a646f){return function(_0x1cbecc){if(_0x1cbecc){var _0x327e99=typeof _0x2a646f[_0xc200('0x1e')]===_0xc200('0x1f')&&typeof _0x2a646f[_0xc200('0x20')]===_0xc200('0x1f');var _0x45e4c7=_0x1cbecc[_0xc200('0x21')];var _0x13904d=_0x327e99?0x0:_0x2a646f[_0xc200('0x1e')];var _0x3224b7=_0x327e99?_0x1cbecc[_0xc200('0x21')]:_0x2a646f[_0xc200('0x1e')]+_0x2a646f[_0xc200('0x20')];var _0x5830de;if(_0x3224b7>=_0x45e4c7){_0x3224b7=_0x45e4c7;_0x5830de=0xc8;}else{_0x5830de=0xce;}_0x509e3c[_0xc200('0x1c')](_0x5830de);return _0x509e3c[_0xc200('0x22')]('Content-Range',_0x13904d+'-'+_0x3224b7+'/'+_0x45e4c7)['json'](_0x1cbecc);}return null;};}function patchUpdates(_0x5599d9){return function(_0x3af45d){try{jsonpatch[_0xc200('0x23')](_0x3af45d,_0x5599d9,!![]);}catch(_0xc14c83){return BPromise['reject'](_0xc14c83);}return _0x3af45d[_0xc200('0x24')]();};}function saveUpdates(_0x37a737,_0xbe9cc9){return function(_0x214e94){if(_0x214e94){return _0x214e94[_0xc200('0x25')](_0x37a737)['then'](function(_0x4c8e65){return _0x4c8e65;});}return null;};}function removeEntity(_0x393199,_0x15e64c){return function(_0x51f284){if(_0x51f284){return _0x51f284[_0xc200('0x26')]()['then'](function(){_0x393199[_0xc200('0x1c')](0xcc)[_0xc200('0x27')]();});}};}function handleEntityNotFound(_0x5153cf,_0x22d3fe){return function(_0x12ca2b){if(!_0x12ca2b){_0x5153cf['sendStatus'](0x194);}return _0x12ca2b;};}function handleError(_0x3c2271,_0x5598c8){_0x5598c8=_0x5598c8||0x1f4;return function(_0x3f3638){logger['error'](_0x3f3638[_0xc200('0x28')]);if(_0x3f3638[_0xc200('0x29')]){delete _0x3f3638['name'];}_0x3c2271[_0xc200('0x1c')](_0x5598c8)[_0xc200('0x2a')](_0x3f3638);};}exports[_0xc200('0x2b')]=function(_0x28bdd7,_0x2e8066){var _0x12d4d4={},_0x8fe8c5={},_0x1eeb10={'count':0x0,'rows':[]};var _0x29baab=_[_0xc200('0x2c')](db['VoiceRecording']['rawAttributes'],function(_0x41432b){return{'name':_0x41432b[_0xc200('0x2d')],'type':_0x41432b['type'][_0xc200('0x2e')]};});_0x8fe8c5[_0xc200('0x2f')]=_[_0xc200('0x30')](_[_0xc200('0x2c')](_0x29baab,_0xc200('0x29')),['format']);_0x8fe8c5[_0xc200('0x31')]=_[_0xc200('0x32')](_0x28bdd7['query']);_0x8fe8c5[_0xc200('0x33')]=_[_0xc200('0x34')](_0x8fe8c5[_0xc200('0x2f')],_0x8fe8c5[_0xc200('0x31')]);_0x12d4d4['attributes']=_[_0xc200('0x34')](_0x8fe8c5[_0xc200('0x2f')],qs[_0xc200('0x35')](_0x28bdd7['query']['fields']));_0x12d4d4[_0xc200('0x36')]=_0x12d4d4[_0xc200('0x36')][_0xc200('0x37')]?_0x12d4d4[_0xc200('0x36')]:_0x8fe8c5['model'];if(!_0x28bdd7[_0xc200('0x31')][_0xc200('0x38')]('nolimit')){_0x12d4d4[_0xc200('0x20')]=qs[_0xc200('0x20')](_0x28bdd7[_0xc200('0x31')]['limit']);_0x12d4d4[_0xc200('0x1e')]=qs['offset'](_0x28bdd7[_0xc200('0x31')][_0xc200('0x1e')]);}_0x12d4d4[_0xc200('0x39')]=qs[_0xc200('0x3a')](_0x28bdd7[_0xc200('0x31')][_0xc200('0x3a')]);_0x12d4d4[_0xc200('0x3b')]=qs['filters'](_[_0xc200('0x3c')](_0x28bdd7[_0xc200('0x31')],_0x8fe8c5[_0xc200('0x33')]),_0x29baab);if(_0x28bdd7['query']['filter']){_0x12d4d4[_0xc200('0x3b')]=_['merge'](_0x12d4d4['where'],{'$or':_[_0xc200('0x2c')](_0x29baab,function(_0x18ced9){if(_0x18ced9[_0xc200('0x3d')]!=='VIRTUAL'){var _0x49afd3={};_0x49afd3[_0x18ced9['name']]={'$like':'%'+_0x28bdd7[_0xc200('0x31')][_0xc200('0x3e')]+'%'};return _0x49afd3;}})});}_0x12d4d4=_[_0xc200('0x3f')]({},_0x12d4d4,_0x28bdd7[_0xc200('0x40')]);var _0x5477f8={'where':_0x12d4d4[_0xc200('0x3b')]};return db['VoiceRecording'][_0xc200('0x21')](_0x5477f8)['then'](function(_0x259d11){_0x1eeb10['count']=_0x259d11;if(_0x28bdd7[_0xc200('0x31')][_0xc200('0x41')]){_0x12d4d4[_0xc200('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0xc200('0x43')](_0x12d4d4);})[_0xc200('0x44')](function(_0x4bb099){_0x1eeb10['rows']=_0x4bb099;return _0x1eeb10;})[_0xc200('0x44')](respondWithFilteredResult(_0x2e8066,_0x12d4d4))['catch'](handleError(_0x2e8066,null));};exports[_0xc200('0x45')]=function(_0x1b4fd8,_0x52b047){var _0x1019e2={'raw':![],'where':{'id':_0x1b4fd8[_0xc200('0x46')]['id']}},_0x24c2c7={};_0x24c2c7[_0xc200('0x2f')]=_['keys'](db[_0xc200('0x47')][_0xc200('0x48')]);_0x24c2c7['query']=_[_0xc200('0x32')](_0x1b4fd8[_0xc200('0x31')]);_0x24c2c7[_0xc200('0x33')]=_[_0xc200('0x34')](_0x24c2c7['model'],_0x24c2c7['query']);_0x1019e2[_0xc200('0x36')]=_['intersection'](_0x24c2c7['model'],qs[_0xc200('0x35')](_0x1b4fd8[_0xc200('0x31')][_0xc200('0x35')]));_0x1019e2[_0xc200('0x36')]=_0x1019e2[_0xc200('0x36')][_0xc200('0x37')]?_0x1019e2[_0xc200('0x36')]:_0x24c2c7[_0xc200('0x2f')];if(_0x1b4fd8['query']['includeAll']){_0x1019e2[_0xc200('0x42')]=[{'all':!![]}];}_0x1019e2=_[_0xc200('0x3f')]({},_0x1019e2,_0x1b4fd8[_0xc200('0x40')]);return db[_0xc200('0x47')][_0xc200('0x49')](_0x1019e2)[_0xc200('0x44')](handleEntityNotFound(_0x52b047,null))[_0xc200('0x44')](respondWithResult(_0x52b047,null))[_0xc200('0x4a')](handleError(_0x52b047,null));};exports['create']=function(_0x38fa38,_0x59b0f8){return db[_0xc200('0x47')][_0xc200('0x4b')](_0x38fa38[_0xc200('0x4c')],{})['then'](respondWithResult(_0x59b0f8,0xc9))['catch'](handleError(_0x59b0f8,null));};exports[_0xc200('0x25')]=function(_0x7c967,_0xfeaf60){if(_0x7c967[_0xc200('0x4c')]['id']){delete _0x7c967['body']['id'];}return db[_0xc200('0x47')][_0xc200('0x49')]({'where':{'id':_0x7c967[_0xc200('0x46')]['id']}})[_0xc200('0x44')](handleEntityNotFound(_0xfeaf60,null))[_0xc200('0x44')](saveUpdates(_0x7c967[_0xc200('0x4c')],null))[_0xc200('0x44')](respondWithResult(_0xfeaf60,null))[_0xc200('0x4a')](handleError(_0xfeaf60,null));};exports['describe']=function(_0xd68eae,_0x29a1a9){return db['VoiceRecording'][_0xc200('0x4d')]()[_0xc200('0x44')](respondWithResult(_0x29a1a9,null))['catch'](handleError(_0x29a1a9,null));};exports['download']=function(_0x23abd7,_0x290259,_0x1f63cb){var _0x4ab748=require('../../components/encryptor');var _0x33bd6e=![];var _0x4d1a71={};if(_0x23abd7[_0xc200('0x31')][_0xc200('0x3d')]&&_0x23abd7[_0xc200('0x31')][_0xc200('0x3d')]===_0xc200('0x4e')){_0x4d1a71[_0xc200('0x4e')]=_0x23abd7['params']['id'];}else{_0x4d1a71['id']=_0x23abd7[_0xc200('0x46')]['id'];}return db[_0xc200('0x47')][_0xc200('0x49')]({'where':_0x4d1a71,'attributes':['id',_0xc200('0x4f')],'raw':!![]})[_0xc200('0x44')](handleEntityNotFound(_0x290259,null))[_0xc200('0x44')](function(_0x5ad11b){if(_0x5ad11b){var _0x114c06=_0x5ad11b[_0xc200('0x4f')];var _0x568d16=util[_0xc200('0x50')](_0xc200('0x51'),_0x114c06);if(fs[_0xc200('0x52')](_0x568d16)){_0x33bd6e=!![];return _0x4ab748[_0xc200('0x53')](_0x568d16,_0x114c06,config[_0xc200('0x54')][_0xc200('0x55')])['then'](function(){return _0x5ad11b;});}return _0x5ad11b;}})[_0xc200('0x44')](function(_0x537b3a){if(_0x537b3a){var _0xc5d1be=_0x537b3a['value'];if(!fs[_0xc200('0x52')](_0xc5d1be)){throw new db[(_0xc200('0x56'))]['ValidationError'](_0xc200('0x57'));}if(_0x537b3a[_0xc200('0x58')]){return _0x290259[_0xc200('0x59')](_0xc5d1be,_0x537b3a[_0xc200('0x58')]+path[_0xc200('0x5a')](_0xc5d1be),function(){if(_0x33bd6e){fs[_0xc200('0x5b')](_0xc5d1be);}});}else{return _0x290259[_0xc200('0x59')](_0xc5d1be,function(_0x2f0f5d){if(_0x33bd6e){fs[_0xc200('0x5b')](_0xc5d1be);}});}}})[_0xc200('0x4a')](function(_0x41155a){if(_0x41155a['message']==='VoiceRecording\x20not\x20found'){_0x290259['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x290259,null);}});};exports[_0xc200('0x5c')]=function(_0x587df1,_0x2e9bf2,_0x8af0c3){var _0x4b0223=require(_0xc200('0x5d'));var _0x304359=![];var _0x17157c={'$and':[db[_0xc200('0x5e')][_0xc200('0x3b')](db[_0xc200('0x5e')]['fn'](_0xc200('0x5f'),db[_0xc200('0x5e')][_0xc200('0x60')](_0xc200('0x4e'))),_0x587df1['query']['token'])]};if(_0x587df1['query']['type']&&_0x587df1[_0xc200('0x31')]['type']==='uniqueid'){_0x17157c['$and'][_0xc200('0x61')]({'uniqueid':_0x587df1[_0xc200('0x46')]['id']});}else{_0x17157c[_0xc200('0x62')][_0xc200('0x61')]({'id':_0x587df1[_0xc200('0x46')]['id']});}return db[_0xc200('0x47')][_0xc200('0x49')]({'where':_0x17157c,'attributes':['id',_0xc200('0x4f')],'raw':!![]})[_0xc200('0x44')](handleEntityNotFound(_0x2e9bf2,null))[_0xc200('0x44')](function(_0xa2acf7){if(_0xa2acf7){var _0x32d7ed=util[_0xc200('0x50')]('%s.cypher',_0xa2acf7[_0xc200('0x4f')]);if(fs['existsSync'](_0x32d7ed)){_0x304359=!![];return _0x4b0223[_0xc200('0x53')](_0x32d7ed,_0xa2acf7['value'],config[_0xc200('0x54')][_0xc200('0x55')])[_0xc200('0x44')](function(){return _0xa2acf7;});}return _0xa2acf7;}})[_0xc200('0x44')](function(_0x1e22b4){if(_0x1e22b4){if(!fs[_0xc200('0x52')](_0x1e22b4['value'])){throw new db[(_0xc200('0x56'))][(_0xc200('0x63'))](_0xc200('0x57'));}if(_0x1e22b4[_0xc200('0x58')]){return _0x2e9bf2[_0xc200('0x59')](_0x1e22b4[_0xc200('0x4f')],_0x1e22b4['filename']+path[_0xc200('0x5a')](_0x1e22b4['value']),function(){if(_0x304359){fs[_0xc200('0x5b')](_0x1e22b4[_0xc200('0x4f')]);}});}else{return _0x2e9bf2[_0xc200('0x59')](_0x1e22b4[_0xc200('0x4f')],function(_0x2738f8){if(_0x304359){fs[_0xc200('0x5b')](_0x1e22b4[_0xc200('0x4f')]);}});}}})[_0xc200('0x4a')](handleError(_0x2e9bf2,null));};exports['destroy']=function(_0x42cc51,_0x430b3b){return db[_0xc200('0x47')]['find']({'where':{'id':_0x42cc51[_0xc200('0x46')]['id']}})[_0xc200('0x44')](function(_0x2949bf){if(_[_0xc200('0x64')](_0x2949bf)){throw new ReferenceError(_0xc200('0x65'));}return _0x2949bf;})['then'](function(_0x1a293c){var _0x2142a4=_0x1a293c[_0xc200('0x4f')];logger[_0xc200('0x66')](_0xc200('0x67'),_0x2142a4);if(!_[_0xc200('0x64')](_0x1a293c[_0xc200('0x4f')])&&fs[_0xc200('0x52')](_0x2142a4)){logger[_0xc200('0x66')](_0xc200('0x68')+_0x2142a4+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2142a4);}_0x2142a4=_0x2142a4+_0xc200('0x69');if(!_[_0xc200('0x64')](_0x1a293c[_0xc200('0x4f')])&&fs[_0xc200('0x52')](_0x2142a4)){logger[_0xc200('0x66')](_0xc200('0x68')+_0x2142a4+_0xc200('0x6a'));fs[_0xc200('0x6b')](_0x2142a4);}return _0x1a293c;})['then'](function(_0x1aa347){if(!_0x1aa347)throw new InternalError();return _0x1aa347[_0xc200('0x26')]();})[_0xc200('0x44')](function(){_0x430b3b[_0xc200('0x1c')](0xcc)[_0xc200('0x27')]();})[_0xc200('0x4a')](handleError(_0x430b3b,null));};function getBucketslist(_0x520646,_0x56a31b,_0x17f011){return new Promise(function(_0x123a65,_0x22562a){var _0x3c120d=new AWS['S3']({'accessKeyId':_0x56a31b,'secretAccessKey':_0x520646,'region':_0x17f011});_0x3c120d[_0xc200('0x6c')]({},function(_0x1e0149,_0x15387a){if(_0x1e0149){return _0x22562a(_0x1e0149);}else{return _0x123a65(_0x15387a);}});});}function createBucket(_0x2ce19e,_0x3a456d,_0x2f557e,_0x3d2128){return new Promise(function(_0x391339,_0x6d9487){var _0x117a2b=new AWS['S3']({'accessKeyId':_0x3a456d,'secretAccessKey':_0x2ce19e,'region':_0x2f557e});_0x117a2b['createBucket']({'Bucket':_0x3d2128},function(_0x506beb,_0x240195){if(_0x506beb){return _0x6d9487(_0x506beb);}else{return _0x391339(_0x240195);}});});}function uploadFile(_0x4c0778,_0x1cf9e0,_0x4f88d6,_0x22f55b,_0x20e16a,_0x127727){return new Promise(function(_0x2b8002,_0x3a8b23){var _0x3283bf=new AWS['S3']({'accessKeyId':_0x1cf9e0,'secretAccessKey':_0x4c0778,'region':_0x4f88d6});_0x3283bf[_0xc200('0x6d')]({'Bucket':_0x22f55b,'Key':_0x20e16a,'Body':_0x127727},function(_0x4ed49c,_0x50e6c5){if(_0x4ed49c){return _0x3a8b23(_0x4ed49c);}else{return _0x2b8002(_0x50e6c5);}});});}function startTranscribe(_0x49c73d,_0x16f205,_0x3f840a,_0x317202,_0x156e61,_0x371c7f){return new Promise(function(_0x5c0433,_0x1444b4){var _0x53ea24=new AWS[(_0xc200('0x6e'))]({'accessKeyId':_0x16f205,'secretAccessKey':_0x49c73d,'region':_0x3f840a});_0x53ea24[_0xc200('0x6f')]({'TranscriptionJobName':_0x317202,'LanguageCode':_0x156e61,'Media':{'MediaFileUri':_0x371c7f}},function(_0x3d57ea,_0x4ccf9d){if(_0x3d57ea){return _0x1444b4(_0x3d57ea);}else{return _0x5c0433(_0x4ccf9d);}});});}function transcribe(_0x5d460a,_0x3c7d8c,_0x24d7b9,_0x214e51,_0x5cc5a5,_0x1940d7,_0x400fd8){return new Promise(function(_0x38232a,_0x28dd97){var _0x59602c={};logger[_0xc200('0x66')](util['format'](_0xc200('0x70'),_0x5d460a,_0x5cc5a5));return uploadFile(_0x3c7d8c,_0x24d7b9,_0x214e51,_0x5cc5a5,path[_0xc200('0x71')](_0x1940d7),fs['readFileSync'](_0x1940d7))['then'](function(_0x3a6526){logger[_0xc200('0x66')](util['format'](_0xc200('0x72'),_0x5d460a,_0x5cc5a5,_0x3a6526[_0xc200('0x73')]));_0x59602c['bucket']=_0x3a6526[_0xc200('0x74')];_0x59602c[_0xc200('0x75')]=_0x3a6526['Location'];logger[_0xc200('0x66')](util[_0xc200('0x50')](_0xc200('0x76'),_0x5d460a));return startTranscribe(_0x3c7d8c,_0x24d7b9,_0x214e51,uuidv4(),_0x400fd8,_0x3a6526[_0xc200('0x73')]);})['then'](function(_0x22d140){logger[_0xc200('0x66')](util['format'](_0xc200('0x77'),_0x5d460a,_0x22d140[_0xc200('0x78')][_0xc200('0x79')]));_0x59602c['transcribeName']=_0x22d140[_0xc200('0x78')][_0xc200('0x79')];_0x59602c['transcribeStatus']=_0x22d140[_0xc200('0x78')][_0xc200('0x7a')];return _0x38232a(_0x59602c);})[_0xc200('0x4a')](function(_0x2ae074){return _0x28dd97(_0x2ae074);});});}exports[_0xc200('0x7b')]=function(_0x7a701f,_0x176d55,_0x23ddc5){var _0x193299;var _0x57f459;var _0x14fd41;var _0x2bcca9=require('../../components/encryptor');return db[_0xc200('0x47')][_0xc200('0x7c')]({'where':{'id':_0x7a701f['params']['id']}})[_0xc200('0x44')](function(_0x344f5b){if(_0x344f5b){var _0x36b420=util[_0xc200('0x50')](_0xc200('0x51'),_0x344f5b['value']);if(fs['existsSync'](_0x36b420)){cypher=!![];return _0x2bcca9[_0xc200('0x53')](_0x36b420,_0x344f5b['value'],config['secrets']['recording'])[_0xc200('0x44')](function(){return _0x344f5b;});}return _0x344f5b;}})[_0xc200('0x44')](function(_0x38ee66){if(!_0x38ee66){throw new db[(_0xc200('0x56'))][(_0xc200('0x63'))](_0xc200('0x7d'));}_0x57f459=_0x38ee66;return db[_0xc200('0x7e')][_0xc200('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x176d55,null))['then'](function(_0x518d37){if(_0x518d37){_0x193299=_0x518d37;if(!_0x193299[_0xc200('0x7f')]||!_0x193299[_0xc200('0x80')]||!_0x193299[_0xc200('0x81')]||!_0x193299[_0xc200('0x82')]||!_0x193299['bucket']){throw new db[(_0xc200('0x56'))][(_0xc200('0x63'))](_0xc200('0x83'));}if(_0x7a701f['body'][_0xc200('0x84')]&&(!_0x193299[_0xc200('0x85')]||!_0x193299['sentimentAccountId']||!_0x193299['sentimentRegion']||!_0x193299['language']||!_0x193299[_0xc200('0x86')])){throw new db[(_0xc200('0x56'))][(_0xc200('0x63'))](_0xc200('0x87'));}return db[_0xc200('0x88')][_0xc200('0x7c')]({'where':{'id':_0x193299['transcribeAccountId']}});}})[_0xc200('0x44')](function(_0x488467){if(!_0x488467){throw new db[(_0xc200('0x56'))][(_0xc200('0x63'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x488467[_0xc200('0x89')]||!_0x488467[_0xc200('0x8a')]){throw new db[(_0xc200('0x56'))][(_0xc200('0x63'))]('Cloud\x20Provider\x20not\x20configured');}_0x14fd41=_0x488467;return getBucketslist(_0x14fd41[_0xc200('0x89')],_0x14fd41[_0xc200('0x8a')],_0x193299[_0xc200('0x81')]);})[_0xc200('0x44')](function(_0x1b44b3){if(_0x1b44b3&&_0x1b44b3[_0xc200('0x8b')]){var _0x5180df=_[_0xc200('0x49')](_0x1b44b3['Buckets'],function(_0x16643a){return _0x16643a[_0xc200('0x8c')]===_0x193299[_0xc200('0x86')];});if(!_0x5180df){logger[_0xc200('0x66')](util['format'](_0xc200('0x8d'),_0x7a701f[_0xc200('0x46')]['id'],_0x193299[_0xc200('0x86')]));return createBucket(_0x14fd41[_0xc200('0x89')],_0x14fd41[_0xc200('0x8a')],_0x193299[_0xc200('0x81')],_0x193299['bucket']);}logger[_0xc200('0x66')](util['format'](_0xc200('0x8e'),_0x7a701f['params']['id'],_0x193299['bucket']));return;}})[_0xc200('0x44')](function(_0x1c79df){if(_0x57f459[_0xc200('0x8f')]===_0xc200('0x90')){return transcribe(_0x7a701f[_0xc200('0x46')]['id'],_0x14fd41[_0xc200('0x89')],_0x14fd41[_0xc200('0x8a')],_0x193299[_0xc200('0x81')],_0x193299[_0xc200('0x86')],_0x57f459['value'],_0x193299[_0xc200('0x82')]);}else{logger['info'](util[_0xc200('0x50')](_0xc200('0x91'),_0x7a701f[_0xc200('0x46')]['id']));return{'transcribeStatus':_0xc200('0x92')};}})[_0xc200('0x44')](function(_0x3d7b12){if(_0x3d7b12){_0x3d7b12['tempSentiment']=_0x7a701f[_0xc200('0x4c')][_0xc200('0x84')];return _0x57f459['updateAttributes'](_0x3d7b12);}})[_0xc200('0x44')](respondWithResult(_0x176d55,null))[_0xc200('0x4a')](handleError(_0x176d55,null));};function writeFile(_0x9498f,_0x33af3e){return new Promise(function(_0x9b5785,_0x234997){fs['writeFile'](_0x33af3e,_0x9498f,function(_0x5aa37d,_0x23f045){if(_0x5aa37d){return _0x234997(_0x5aa37d);}else{return _0x9b5785(_0x23f045);}});});}exports[_0xc200('0x93')]=function(_0x4621f1,_0x29cbc4,_0x45aa90){return db[_0xc200('0x47')][_0xc200('0x7c')]({'where':{'id':_0x4621f1['params']['id']}})[_0xc200('0x44')](handleEntityNotFound(_0x29cbc4))[_0xc200('0x44')](function(_0x414ef9){if(_0x414ef9&&_0x414ef9[_0xc200('0x94')]){var _0x1539d2=_0x414ef9['fileText'];var _0x4090ae=config[_0xc200('0x95')]+_0xc200('0x96')+_0x414ef9['id']+_0xc200('0x97');if(fs[_0xc200('0x52')](_0x4090ae)){return _0x4090ae;}return writeFile(_0x1539d2,_0x4090ae)[_0xc200('0x44')](function(){return _0x4090ae;});}else{throw new db[(_0xc200('0x56'))]['ValidationError']('Transcript\x20not\x20available');}})[_0xc200('0x44')](function(_0x1b18ce){return _0x29cbc4[_0xc200('0x59')](_0x1b18ce);})['catch'](handleError(_0x29cbc4));}; \ No newline at end of file +var _0xfbec=['readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','format','keys','filters','intersection','model','query','attributes','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','fields','length','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','message','downloads','MD5','sequelize','col','token','$and','push','decryptFile','secrets','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename'];(function(_0x27e498,_0x4507b0){var _0x5c9f86=function(_0x39fb44){while(--_0x39fb44){_0x27e498['push'](_0x27e498['shift']());}};_0x5c9f86(++_0x4507b0);}(_0xfbec,0x1f3));var _0xcfbe=function(_0x153415,_0x750e96){_0x153415=_0x153415-0x0;var _0x3dc629=_0xfbec[_0x153415];return _0x3dc629;};'use strict';var emlformat=require(_0xcfbe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcfbe('0x1'));var jsonpatch=require(_0xcfbe('0x2'));var rp=require(_0xcfbe('0x3'));var moment=require(_0xcfbe('0x4'));var BPromise=require(_0xcfbe('0x5'));var Mustache=require(_0xcfbe('0x6'));var util=require(_0xcfbe('0x7'));var path=require(_0xcfbe('0x8'));var sox=require(_0xcfbe('0x9'));var csv=require('to-csv');var ejs=require(_0xcfbe('0xa'));var fs=require('fs');var fs_extra=require(_0xcfbe('0xb'));var _=require(_0xcfbe('0xc'));var squel=require(_0xcfbe('0xd'));var crypto=require(_0xcfbe('0xe'));var jsforce=require(_0xcfbe('0xf'));var deskjs=require(_0xcfbe('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcfbe('0x11'));var Papa=require('papaparse');var AWS=require(_0xcfbe('0x12'));var uuidv4=require(_0xcfbe('0x13'));var Redis=require(_0xcfbe('0x14'));var authService=require(_0xcfbe('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xcfbe('0x16'));var hardwareService=require(_0xcfbe('0x17'));var logger=require(_0xcfbe('0x18'))('api');var utils=require(_0xcfbe('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcfbe('0x1a'))['db'];function respondWithStatusCode(_0x34425d,_0x293602){_0x293602=_0x293602||0xcc;return function(_0xe2aab5){if(_0xe2aab5){return _0x34425d[_0xcfbe('0x1b')](_0x293602);}return _0x34425d['status'](_0x293602)[_0xcfbe('0x1c')]();};}function respondWithResult(_0x234b64,_0x5804a4){_0x5804a4=_0x5804a4||0xc8;return function(_0xadab75){if(_0xadab75){return _0x234b64[_0xcfbe('0x1d')](_0x5804a4)[_0xcfbe('0x1e')](_0xadab75);}};}function respondWithFilteredResult(_0x1cc0e2,_0xa7fb09){return function(_0x3f99b1){if(_0x3f99b1){var _0x1ab8a8=typeof _0xa7fb09[_0xcfbe('0x1f')]===_0xcfbe('0x20')&&typeof _0xa7fb09[_0xcfbe('0x21')]===_0xcfbe('0x20');var _0x27c051=_0x3f99b1['count'];var _0x2b01c9=_0x1ab8a8?0x0:_0xa7fb09[_0xcfbe('0x1f')];var _0x3f43fa=_0x1ab8a8?_0x3f99b1['count']:_0xa7fb09['offset']+_0xa7fb09['limit'];var _0x3b6884;if(_0x3f43fa>=_0x27c051){_0x3f43fa=_0x27c051;_0x3b6884=0xc8;}else{_0x3b6884=0xce;}_0x1cc0e2['status'](_0x3b6884);return _0x1cc0e2[_0xcfbe('0x22')](_0xcfbe('0x23'),_0x2b01c9+'-'+_0x3f43fa+'/'+_0x27c051)[_0xcfbe('0x1e')](_0x3f99b1);}return null;};}function patchUpdates(_0x26dcf8){return function(_0x5268c1){try{jsonpatch['apply'](_0x5268c1,_0x26dcf8,!![]);}catch(_0xcd8a12){return BPromise[_0xcfbe('0x24')](_0xcd8a12);}return _0x5268c1[_0xcfbe('0x25')]();};}function saveUpdates(_0xaeeaeb,_0x541832){return function(_0x2d74ed){if(_0x2d74ed){return _0x2d74ed[_0xcfbe('0x26')](_0xaeeaeb)[_0xcfbe('0x27')](function(_0x5bd56a){return _0x5bd56a;});}return null;};}function removeEntity(_0x28d00d,_0x1fb36e){return function(_0x1fe782){if(_0x1fe782){return _0x1fe782[_0xcfbe('0x28')]()[_0xcfbe('0x27')](function(){_0x28d00d[_0xcfbe('0x1d')](0xcc)[_0xcfbe('0x1c')]();});}};}function handleEntityNotFound(_0x558a1b,_0x528237){return function(_0x4630dd){if(!_0x4630dd){_0x558a1b[_0xcfbe('0x1b')](0x194);}return _0x4630dd;};}function handleError(_0x1f669c,_0x7ca45e){_0x7ca45e=_0x7ca45e||0x1f4;return function(_0x39ceba){logger[_0xcfbe('0x29')](_0x39ceba['stack']);if(_0x39ceba[_0xcfbe('0x2a')]){delete _0x39ceba['name'];}_0x1f669c[_0xcfbe('0x1d')](_0x7ca45e)[_0xcfbe('0x2b')](_0x39ceba);};}exports[_0xcfbe('0x2c')]=function(_0x11ff87,_0x443134){var _0x542f11={},_0x53e531={},_0x54c18e={'count':0x0,'rows':[]};var _0x1e81e6=_[_0xcfbe('0x2d')](db[_0xcfbe('0x2e')][_0xcfbe('0x2f')],function(_0x345128){return{'name':_0x345128[_0xcfbe('0x30')],'type':_0x345128[_0xcfbe('0x31')][_0xcfbe('0x32')]};});_0x53e531['model']=_['differenceBy'](_['map'](_0x1e81e6,_0xcfbe('0x2a')),[_0xcfbe('0x33')]);_0x53e531['query']=_[_0xcfbe('0x34')](_0x11ff87['query']);_0x53e531[_0xcfbe('0x35')]=_[_0xcfbe('0x36')](_0x53e531[_0xcfbe('0x37')],_0x53e531[_0xcfbe('0x38')]);_0x542f11[_0xcfbe('0x39')]=_[_0xcfbe('0x36')](_0x53e531['model'],qs['fields'](_0x11ff87[_0xcfbe('0x38')]['fields']));_0x542f11[_0xcfbe('0x39')]=_0x542f11[_0xcfbe('0x39')]['length']?_0x542f11['attributes']:_0x53e531[_0xcfbe('0x37')];if(!_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x3a')]('nolimit')){_0x542f11[_0xcfbe('0x21')]=qs[_0xcfbe('0x21')](_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x21')]);_0x542f11['offset']=qs[_0xcfbe('0x1f')](_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x1f')]);}_0x542f11['order']=qs[_0xcfbe('0x3b')](_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x3b')]);_0x542f11[_0xcfbe('0x3c')]=qs[_0xcfbe('0x35')](_[_0xcfbe('0x3d')](_0x11ff87[_0xcfbe('0x38')],_0x53e531['filters']),_0x1e81e6);if(_0x11ff87[_0xcfbe('0x38')]['filter']){_0x542f11[_0xcfbe('0x3c')]=_[_0xcfbe('0x3e')](_0x542f11[_0xcfbe('0x3c')],{'$or':_[_0xcfbe('0x2d')](_0x1e81e6,function(_0x2997da){if(_0x2997da[_0xcfbe('0x31')]!==_0xcfbe('0x3f')){var _0x491580={};_0x491580[_0x2997da['name']]={'$like':'%'+_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x40')]+'%'};return _0x491580;}})});}_0x542f11=_['merge']({},_0x542f11,_0x11ff87[_0xcfbe('0x41')]);var _0x3307fa={'where':_0x542f11[_0xcfbe('0x3c')]};return db[_0xcfbe('0x2e')]['count'](_0x3307fa)[_0xcfbe('0x27')](function(_0x467953){_0x54c18e['count']=_0x467953;if(_0x11ff87[_0xcfbe('0x38')][_0xcfbe('0x42')]){_0x542f11[_0xcfbe('0x43')]=[{'all':!![]}];}return db[_0xcfbe('0x2e')][_0xcfbe('0x44')](_0x542f11);})[_0xcfbe('0x27')](function(_0x3ce83f){_0x54c18e[_0xcfbe('0x45')]=_0x3ce83f;return _0x54c18e;})['then'](respondWithFilteredResult(_0x443134,_0x542f11))[_0xcfbe('0x46')](handleError(_0x443134,null));};exports['show']=function(_0x1bc8ef,_0x1f070a){var _0x2d9f07={'raw':![],'where':{'id':_0x1bc8ef[_0xcfbe('0x47')]['id']}},_0x289277={};_0x289277['model']=_[_0xcfbe('0x34')](db[_0xcfbe('0x2e')][_0xcfbe('0x2f')]);_0x289277[_0xcfbe('0x38')]=_[_0xcfbe('0x34')](_0x1bc8ef['query']);_0x289277[_0xcfbe('0x35')]=_[_0xcfbe('0x36')](_0x289277[_0xcfbe('0x37')],_0x289277[_0xcfbe('0x38')]);_0x2d9f07[_0xcfbe('0x39')]=_[_0xcfbe('0x36')](_0x289277[_0xcfbe('0x37')],qs[_0xcfbe('0x48')](_0x1bc8ef['query'][_0xcfbe('0x48')]));_0x2d9f07[_0xcfbe('0x39')]=_0x2d9f07[_0xcfbe('0x39')][_0xcfbe('0x49')]?_0x2d9f07[_0xcfbe('0x39')]:_0x289277[_0xcfbe('0x37')];if(_0x1bc8ef[_0xcfbe('0x38')][_0xcfbe('0x42')]){_0x2d9f07[_0xcfbe('0x43')]=[{'all':!![]}];}_0x2d9f07=_['merge']({},_0x2d9f07,_0x1bc8ef[_0xcfbe('0x41')]);return db['VoiceRecording']['find'](_0x2d9f07)[_0xcfbe('0x27')](handleEntityNotFound(_0x1f070a,null))[_0xcfbe('0x27')](respondWithResult(_0x1f070a,null))[_0xcfbe('0x46')](handleError(_0x1f070a,null));};exports['create']=function(_0x4777bf,_0x1b9b8d){return db[_0xcfbe('0x2e')]['create'](_0x4777bf[_0xcfbe('0x4a')],{})[_0xcfbe('0x27')](respondWithResult(_0x1b9b8d,0xc9))[_0xcfbe('0x46')](handleError(_0x1b9b8d,null));};exports[_0xcfbe('0x26')]=function(_0x3927ea,_0x571bb4){if(_0x3927ea[_0xcfbe('0x4a')]['id']){delete _0x3927ea[_0xcfbe('0x4a')]['id'];}return db[_0xcfbe('0x2e')][_0xcfbe('0x4b')]({'where':{'id':_0x3927ea[_0xcfbe('0x47')]['id']}})[_0xcfbe('0x27')](handleEntityNotFound(_0x571bb4,null))[_0xcfbe('0x27')](saveUpdates(_0x3927ea[_0xcfbe('0x4a')],null))[_0xcfbe('0x27')](respondWithResult(_0x571bb4,null))[_0xcfbe('0x46')](handleError(_0x571bb4,null));};exports[_0xcfbe('0x4c')]=function(_0x340f63,_0x196ff0){return db[_0xcfbe('0x2e')]['describe']()[_0xcfbe('0x27')](respondWithResult(_0x196ff0,null))['catch'](handleError(_0x196ff0,null));};exports['download']=function(_0x1f3017,_0x47f691,_0x5a8907){var _0x4b53a=require(_0xcfbe('0x4d'));var _0x53c1f5=![];var _0x4a62a5={};if(_0x1f3017[_0xcfbe('0x38')][_0xcfbe('0x31')]&&_0x1f3017[_0xcfbe('0x38')][_0xcfbe('0x31')]==='uniqueid'){_0x4a62a5[_0xcfbe('0x4e')]=_0x1f3017[_0xcfbe('0x47')]['id'];}else{_0x4a62a5['id']=_0x1f3017['params']['id'];}return db['VoiceRecording'][_0xcfbe('0x4b')]({'where':_0x4a62a5,'attributes':['id',_0xcfbe('0x4f')],'raw':!![]})[_0xcfbe('0x27')](handleEntityNotFound(_0x47f691,null))[_0xcfbe('0x27')](function(_0x2e9426){if(_0x2e9426){var _0x8d0a8=_0x2e9426[_0xcfbe('0x4f')];var _0x2287bf=util[_0xcfbe('0x33')](_0xcfbe('0x50'),_0x8d0a8);if(fs[_0xcfbe('0x51')](_0x2287bf)){_0x53c1f5=!![];return _0x4b53a['decryptFile'](_0x2287bf,_0x8d0a8,config['secrets']['recording'])[_0xcfbe('0x27')](function(){return _0x2e9426;});}return _0x2e9426;}})[_0xcfbe('0x27')](function(_0x27db00){if(_0x27db00){var _0x21fdce=_0x27db00['value'];if(!fs['existsSync'](_0x21fdce)){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))](_0xcfbe('0x54'));}if(_0x27db00[_0xcfbe('0x55')]){return _0x47f691['download'](_0x21fdce,_0x27db00[_0xcfbe('0x55')]+path[_0xcfbe('0x56')](_0x21fdce),function(){if(_0x53c1f5){fs[_0xcfbe('0x57')](_0x21fdce);}});}else{return _0x47f691[_0xcfbe('0x58')](_0x21fdce,function(_0x3b509b){if(_0x53c1f5){fs[_0xcfbe('0x57')](_0x21fdce);}});}}})[_0xcfbe('0x46')](function(_0x370196){if(_0x370196[_0xcfbe('0x59')]===_0xcfbe('0x54')){_0x47f691[_0xcfbe('0x1d')](0x194)[_0xcfbe('0x2b')]('Not\x20found');}else{return handleError(_0x47f691,null);}});};exports[_0xcfbe('0x5a')]=function(_0x11808d,_0x26a9cf,_0x5ec3e5){var _0x5db03e=require(_0xcfbe('0x4d'));var _0x1151a0=![];var _0x1177bb={'$and':[db['sequelize'][_0xcfbe('0x3c')](db['sequelize']['fn'](_0xcfbe('0x5b'),db[_0xcfbe('0x5c')][_0xcfbe('0x5d')]('uniqueid')),_0x11808d[_0xcfbe('0x38')][_0xcfbe('0x5e')])]};if(_0x11808d[_0xcfbe('0x38')][_0xcfbe('0x31')]&&_0x11808d[_0xcfbe('0x38')][_0xcfbe('0x31')]===_0xcfbe('0x4e')){_0x1177bb[_0xcfbe('0x5f')][_0xcfbe('0x60')]({'uniqueid':_0x11808d[_0xcfbe('0x47')]['id']});}else{_0x1177bb[_0xcfbe('0x5f')]['push']({'id':_0x11808d[_0xcfbe('0x47')]['id']});}return db[_0xcfbe('0x2e')][_0xcfbe('0x4b')]({'where':_0x1177bb,'attributes':['id',_0xcfbe('0x4f')],'raw':!![]})[_0xcfbe('0x27')](handleEntityNotFound(_0x26a9cf,null))[_0xcfbe('0x27')](function(_0x3848a6){if(_0x3848a6){var _0xbe75b7=util[_0xcfbe('0x33')](_0xcfbe('0x50'),_0x3848a6[_0xcfbe('0x4f')]);if(fs[_0xcfbe('0x51')](_0xbe75b7)){_0x1151a0=!![];return _0x5db03e[_0xcfbe('0x61')](_0xbe75b7,_0x3848a6[_0xcfbe('0x4f')],config[_0xcfbe('0x62')]['recording'])['then'](function(){return _0x3848a6;});}return _0x3848a6;}})[_0xcfbe('0x27')](function(_0x11decb){if(_0x11decb){if(!fs[_0xcfbe('0x51')](_0x11decb[_0xcfbe('0x4f')])){throw new db['Sequelize'][(_0xcfbe('0x53'))](_0xcfbe('0x54'));}if(_0x11decb[_0xcfbe('0x55')]){return _0x26a9cf['download'](_0x11decb[_0xcfbe('0x4f')],_0x11decb[_0xcfbe('0x55')]+path[_0xcfbe('0x56')](_0x11decb[_0xcfbe('0x4f')]),function(){if(_0x1151a0){fs['unlink'](_0x11decb[_0xcfbe('0x4f')]);}});}else{return _0x26a9cf[_0xcfbe('0x58')](_0x11decb['value'],function(_0xdc7fe9){if(_0x1151a0){fs[_0xcfbe('0x57')](_0x11decb[_0xcfbe('0x4f')]);}});}}})[_0xcfbe('0x46')](handleError(_0x26a9cf,null));};exports[_0xcfbe('0x28')]=function(_0x60375c,_0x224b8c){return db[_0xcfbe('0x2e')][_0xcfbe('0x4b')]({'where':{'id':_0x60375c[_0xcfbe('0x47')]['id']}})[_0xcfbe('0x27')](function(_0x2632a8){if(_[_0xcfbe('0x63')](_0x2632a8)){throw new ReferenceError(_0xcfbe('0x64'));}return _0x2632a8;})[_0xcfbe('0x27')](function(_0x3259c2){var _0x2bb9a7=_0x3259c2[_0xcfbe('0x4f')];logger[_0xcfbe('0x65')](_0xcfbe('0x66'),_0x2bb9a7);if(!_['isNil'](_0x3259c2[_0xcfbe('0x4f')])&&fs['existsSync'](_0x2bb9a7)){logger['info'](_0xcfbe('0x67')+_0x2bb9a7+_0xcfbe('0x68'));fs['unlinkSync'](_0x2bb9a7);}_0x2bb9a7=_0x2bb9a7+_0xcfbe('0x69');if(!_['isNil'](_0x3259c2[_0xcfbe('0x4f')])&&fs[_0xcfbe('0x51')](_0x2bb9a7)){logger[_0xcfbe('0x65')](_0xcfbe('0x67')+_0x2bb9a7+_0xcfbe('0x68'));fs['unlinkSync'](_0x2bb9a7);}return _0x3259c2;})[_0xcfbe('0x27')](function(_0x2a1a2b){if(!_0x2a1a2b)throw new InternalError();return _0x2a1a2b[_0xcfbe('0x28')]();})['then'](function(){_0x224b8c['status'](0xcc)[_0xcfbe('0x1c')]();})[_0xcfbe('0x46')](handleError(_0x224b8c,null));};function getBucketslist(_0x597aa9,_0x48abc0,_0x271d96){return new Promise(function(_0x5ef810,_0x229854){var _0x4a709d=new AWS['S3']({'accessKeyId':_0x48abc0,'secretAccessKey':_0x597aa9,'region':_0x271d96});_0x4a709d[_0xcfbe('0x6a')]({},function(_0x2da4cd,_0x5a9434){if(_0x2da4cd){return _0x229854(_0x2da4cd);}else{return _0x5ef810(_0x5a9434);}});});}function createBucket(_0x2ec94f,_0x4a7f45,_0x2671f2,_0x440c6f){return new Promise(function(_0x208dde,_0x2943af){var _0x4ceebe=new AWS['S3']({'accessKeyId':_0x4a7f45,'secretAccessKey':_0x2ec94f,'region':_0x2671f2});_0x4ceebe[_0xcfbe('0x6b')]({'Bucket':_0x440c6f},function(_0x2cbdc2,_0x4d6807){if(_0x2cbdc2){return _0x2943af(_0x2cbdc2);}else{return _0x208dde(_0x4d6807);}});});}function uploadFile(_0x139ee3,_0x536d95,_0x36df4e,_0x2dc057,_0xa7dbcb,_0xabecbd){return new Promise(function(_0x5776,_0x51428e){var _0x2b6ddb=new AWS['S3']({'accessKeyId':_0x536d95,'secretAccessKey':_0x139ee3,'region':_0x36df4e});_0x2b6ddb[_0xcfbe('0x6c')]({'Bucket':_0x2dc057,'Key':_0xa7dbcb,'Body':_0xabecbd},function(_0x2adbbd,_0x2b0a59){if(_0x2adbbd){return _0x51428e(_0x2adbbd);}else{return _0x5776(_0x2b0a59);}});});}function startTranscribe(_0xd0276c,_0x40f2b3,_0x2f2abc,_0x15fe28,_0x299786,_0x36b94f){return new Promise(function(_0x1f3a6b,_0x30e099){var _0x406512=new AWS[(_0xcfbe('0x6d'))]({'accessKeyId':_0x40f2b3,'secretAccessKey':_0xd0276c,'region':_0x2f2abc});_0x406512[_0xcfbe('0x6e')]({'TranscriptionJobName':_0x15fe28,'LanguageCode':_0x299786,'Media':{'MediaFileUri':_0x36b94f}},function(_0x43be84,_0x5f5cf4){if(_0x43be84){return _0x30e099(_0x43be84);}else{return _0x1f3a6b(_0x5f5cf4);}});});}function transcribe(_0x58f84e,_0x3980f6,_0x47b956,_0x5a60a6,_0x580a41,_0x542f6a,_0x51f814){return new Promise(function(_0xf7706e,_0x49b07a){var _0x3b022c={};logger[_0xcfbe('0x65')](util[_0xcfbe('0x33')](_0xcfbe('0x6f'),_0x58f84e,_0x580a41));return uploadFile(_0x3980f6,_0x47b956,_0x5a60a6,_0x580a41,path[_0xcfbe('0x70')](_0x542f6a),fs[_0xcfbe('0x71')](_0x542f6a))[_0xcfbe('0x27')](function(_0x53dcf7){logger[_0xcfbe('0x65')](util[_0xcfbe('0x33')](_0xcfbe('0x72'),_0x58f84e,_0x580a41,_0x53dcf7[_0xcfbe('0x73')]));_0x3b022c['bucket']=_0x53dcf7[_0xcfbe('0x74')];_0x3b022c[_0xcfbe('0x75')]=_0x53dcf7['Location'];logger[_0xcfbe('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x58f84e));return startTranscribe(_0x3980f6,_0x47b956,_0x5a60a6,uuidv4(),_0x51f814,_0x53dcf7[_0xcfbe('0x73')]);})[_0xcfbe('0x27')](function(_0x430e35){logger['info'](util[_0xcfbe('0x33')](_0xcfbe('0x76'),_0x58f84e,_0x430e35['TranscriptionJob']['TranscriptionJobName']));_0x3b022c[_0xcfbe('0x77')]=_0x430e35[_0xcfbe('0x78')][_0xcfbe('0x79')];_0x3b022c[_0xcfbe('0x7a')]=_0x430e35[_0xcfbe('0x78')]['TranscriptionJobStatus'];return _0xf7706e(_0x3b022c);})[_0xcfbe('0x46')](function(_0x31ba51){return _0x49b07a(_0x31ba51);});});}exports[_0xcfbe('0x7b')]=function(_0x4ff5b1,_0x137a43,_0x130f4d){var _0xc5fdb3;var _0x493750;var _0x4d6afa;var _0x4a881e=require(_0xcfbe('0x4d'));return db[_0xcfbe('0x2e')][_0xcfbe('0x7c')]({'where':{'id':_0x4ff5b1[_0xcfbe('0x47')]['id']}})['then'](function(_0x52087c){if(_0x52087c){var _0x4741ed=util[_0xcfbe('0x33')](_0xcfbe('0x50'),_0x52087c['value']);if(fs['existsSync'](_0x4741ed)){cypher=!![];return _0x4a881e[_0xcfbe('0x61')](_0x4741ed,_0x52087c[_0xcfbe('0x4f')],config['secrets'][_0xcfbe('0x7d')])['then'](function(){return _0x52087c;});}return _0x52087c;}})['then'](function(_0x10a9a5){if(!_0x10a9a5){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))](_0xcfbe('0x7e'));}_0x493750=_0x10a9a5;return db['Setting'][_0xcfbe('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x137a43,null))[_0xcfbe('0x27')](function(_0x3072d3){if(_0x3072d3){_0xc5fdb3=_0x3072d3;if(!_0xc5fdb3[_0xcfbe('0x7f')]||!_0xc5fdb3[_0xcfbe('0x80')]||!_0xc5fdb3[_0xcfbe('0x81')]||!_0xc5fdb3[_0xcfbe('0x82')]||!_0xc5fdb3[_0xcfbe('0x83')]){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))]('Transcribe\x20not\x20configured');}if(_0x4ff5b1[_0xcfbe('0x4a')][_0xcfbe('0x84')]&&(!_0xc5fdb3[_0xcfbe('0x85')]||!_0xc5fdb3['sentimentAccountId']||!_0xc5fdb3['sentimentRegion']||!_0xc5fdb3['language']||!_0xc5fdb3[_0xcfbe('0x83')])){throw new db[(_0xcfbe('0x52'))]['ValidationError'](_0xcfbe('0x86'));}return db[_0xcfbe('0x87')][_0xcfbe('0x7c')]({'where':{'id':_0xc5fdb3['transcribeAccountId']}});}})[_0xcfbe('0x27')](function(_0x2805f4){if(!_0x2805f4){throw new db['Sequelize'][(_0xcfbe('0x53'))](_0xcfbe('0x88'));}if(!_0x2805f4['data1']||!_0x2805f4[_0xcfbe('0x89')]){throw new db[(_0xcfbe('0x52'))][(_0xcfbe('0x53'))](_0xcfbe('0x8a'));}_0x4d6afa=_0x2805f4;return getBucketslist(_0x4d6afa[_0xcfbe('0x8b')],_0x4d6afa[_0xcfbe('0x89')],_0xc5fdb3['transcribeRegion']);})[_0xcfbe('0x27')](function(_0x27582a){if(_0x27582a&&_0x27582a[_0xcfbe('0x8c')]){var _0x396c68=_[_0xcfbe('0x4b')](_0x27582a[_0xcfbe('0x8c')],function(_0x2c2cf7){return _0x2c2cf7[_0xcfbe('0x8d')]===_0xc5fdb3[_0xcfbe('0x83')];});if(!_0x396c68){logger[_0xcfbe('0x65')](util['format'](_0xcfbe('0x8e'),_0x4ff5b1['params']['id'],_0xc5fdb3[_0xcfbe('0x83')]));return createBucket(_0x4d6afa[_0xcfbe('0x8b')],_0x4d6afa[_0xcfbe('0x89')],_0xc5fdb3[_0xcfbe('0x81')],_0xc5fdb3[_0xcfbe('0x83')]);}logger[_0xcfbe('0x65')](util[_0xcfbe('0x33')](_0xcfbe('0x8f'),_0x4ff5b1['params']['id'],_0xc5fdb3[_0xcfbe('0x83')]));return;}})[_0xcfbe('0x27')](function(_0x230044){if(_0x493750['transcribeStatus']===_0xcfbe('0x90')){return transcribe(_0x4ff5b1[_0xcfbe('0x47')]['id'],_0x4d6afa['data1'],_0x4d6afa[_0xcfbe('0x89')],_0xc5fdb3[_0xcfbe('0x81')],_0xc5fdb3[_0xcfbe('0x83')],_0x493750['value'],_0xc5fdb3[_0xcfbe('0x82')]);}else{logger['info'](util[_0xcfbe('0x33')](_0xcfbe('0x91'),_0x4ff5b1['params']['id']));return{'transcribeStatus':_0xcfbe('0x92')};}})[_0xcfbe('0x27')](function(_0xb45ca0){if(_0xb45ca0){_0xb45ca0['tempSentiment']=_0x4ff5b1[_0xcfbe('0x4a')][_0xcfbe('0x84')];return _0x493750[_0xcfbe('0x93')](_0xb45ca0);}})[_0xcfbe('0x27')](respondWithResult(_0x137a43,null))['catch'](handleError(_0x137a43,null));};function writeFile(_0x1e6199,_0x3a0c9c){return new Promise(function(_0x2f9f1b,_0x59c7c3){fs[_0xcfbe('0x94')](_0x3a0c9c,_0x1e6199,function(_0x58d6b6,_0x413cca){if(_0x58d6b6){return _0x59c7c3(_0x58d6b6);}else{return _0x2f9f1b(_0x413cca);}});});}exports['downloadTranscribe']=function(_0x179686,_0x4532e9,_0x4e2375){return db[_0xcfbe('0x2e')]['findOne']({'where':{'id':_0x179686[_0xcfbe('0x47')]['id']}})['then'](handleEntityNotFound(_0x4532e9))[_0xcfbe('0x27')](function(_0x16edb9){if(_0x16edb9&&_0x16edb9['fileText']){var _0x2a032a=_0x16edb9['fileText'];var _0xbbf9bd=config[_0xcfbe('0x95')]+_0xcfbe('0x96')+_0x16edb9['id']+_0xcfbe('0x97');if(fs[_0xcfbe('0x51')](_0xbbf9bd)){return _0xbbf9bd;}return writeFile(_0x2a032a,_0xbbf9bd)[_0xcfbe('0x27')](function(){return _0xbbf9bd;});}else{throw new db[(_0xcfbe('0x52'))]['ValidationError'](_0xcfbe('0x98'));}})[_0xcfbe('0x27')](function(_0x98efdc){return _0x4532e9['download'](_0x98efdc);})[_0xcfbe('0x46')](handleError(_0x4532e9));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d2f319d..5c783f1 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 _0xd847=['exports','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x4f46f1,_0x2a39b9){var _0x5e146b=function(_0x5aed22){while(--_0x5aed22){_0x4f46f1['push'](_0x4f46f1['shift']());}};_0x5e146b(++_0x2a39b9);}(_0xd847,0x18a));var _0x7d84=function(_0x211a4b,_0x2ab307){_0x211a4b=_0x211a4b-0x0;var _0x35b470=_0xd847[_0x211a4b];return _0x35b470;};'use strict';var attributes=require(_0x7d84('0x0'));module[_0x7d84('0x1')]=function(_0x3e5e53,_0x1d94dd){return _0x3e5e53['define']('VoiceRecording',attributes,{'tableName':_0x7d84('0x2'),'paranoid':![],'indexes':[{'name':_0x7d84('0x3'),'fields':[_0x7d84('0x3')]},{'name':_0x7d84('0x4'),'fields':[_0x7d84('0x4')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d70=['transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3e1e25,_0x39c3bd){var _0xbde8b8=function(_0x29444e){while(--_0x29444e){_0x3e1e25['push'](_0x3e1e25['shift']());}};_0xbde8b8(++_0x39c3bd);}(_0x5d70,0x8d));var _0x05d7=function(_0x2009ec,_0x15fc89){_0x2009ec=_0x2009ec-0x0;var _0xf983df=_0x5d70[_0x2009ec];return _0xf983df;};'use strict';var attributes=require(_0x05d7('0x0'));module[_0x05d7('0x1')]=function(_0x54771b,_0x17a801){return _0x54771b[_0x05d7('0x2')](_0x05d7('0x3'),attributes,{'tableName':_0x05d7('0x4'),'paranoid':![],'indexes':[{'name':_0x05d7('0x5'),'fields':[_0x05d7('0x5')]},{'name':'transcribeStatus','fields':[_0x05d7('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d7d3dc8..d4f380c 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 _0xc1c6=['format','%s.cypher','value','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','update','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','callRecordingEncryption','VoiceRecording','create','existsSync'];(function(_0x10a5c5,_0x378010){var _0x2c1242=function(_0x4c7d8b){while(--_0x4c7d8b){_0x10a5c5['push'](_0x10a5c5['shift']());}};_0x2c1242(++_0x378010);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4cccbd,_0x760a1b){_0x4cccbd=_0x4cccbd-0x0;var _0x5d16ce=_0xc1c6[_0x4cccbd];return _0x5d16ce;};'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);});});}exports['UpdateVoiceRecording']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['VoiceRecording'][_0x6c1c('0x13')](_0x137770['body'],{'raw':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null})[_0x6c1c('0x9')](function(_0x9c6c55){logger[_0x6c1c('0x11')](_0x6c1c('0x19'),_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x19'),_0x137770,JSON[_0x6c1c('0xe')](_0x9c6c55));_0x338dc2(_0x9c6c55);})[_0x6c1c('0x12')](function(_0x96046a){logger[_0x6c1c('0xf')](_0x6c1c('0x19'),_0x96046a[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x96046a[_0x6c1c('0x10')]));});});};exports[_0x6c1c('0x1a')]=function(_0x1b9d7d){var _0x2feaf4=this;return new Promise(function(_0x5f4568,_0x2595c3){var _0x4d73aa=require(_0x6c1c('0x1b'));var _0x4c23f8;return db[_0x6c1c('0x1c')]['findOne']({'attributes':['id',_0x6c1c('0x1d')],'where':{'id':0x1},'raw':!![]})[_0x6c1c('0x9')](function(_0x504348){_0x4c23f8=_0x504348;return db[_0x6c1c('0x1e')][_0x6c1c('0x1f')](_0x1b9d7d['body']);})[_0x6c1c('0x9')](function(_0x19a8f1){if(_0x4c23f8[_0x6c1c('0x1d')]&&fs[_0x6c1c('0x20')](_0x19a8f1['value'])){var _0x52c036=util[_0x6c1c('0x21')](_0x6c1c('0x22'),_0x19a8f1[_0x6c1c('0x23')]);return _0x4d73aa[_0x6c1c('0x24')](_0x19a8f1[_0x6c1c('0x23')],_0x52c036,config[_0x6c1c('0x25')]['recording'])[_0x6c1c('0x9')](function(){fs[_0x6c1c('0x26')](_0x19a8f1['value']);logger[_0x6c1c('0x11')](_0x6c1c('0x27'));return _0x19a8f1;});}return _0x19a8f1;})[_0x6c1c('0x9')](function(_0x15b6d2){logger['info'](_0x6c1c('0x1a'),_0x1b9d7d);logger[_0x6c1c('0xc')](_0x6c1c('0x1a'),_0x1b9d7d,JSON['stringify'](_0x15b6d2));_0x5f4568(_0x15b6d2);})[_0x6c1c('0x12')](function(_0x4e5767){logger[_0x6c1c('0xf')]('CreateVoiceRecording',_0x4e5767[_0x6c1c('0x10')],_0x1b9d7d);_0x2595c3(_0x2feaf4[_0x6c1c('0xf')](0x1f4,_0x4e5767[_0x6c1c('0x10')]));});});}; \ No newline at end of file +var _0xe3da=['CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceRecording','update','body','options','where','attributes','limit','then','UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink'];(function(_0x477af7,_0x2990be){var _0x1ad758=function(_0x4fcb0a){while(--_0x4fcb0a){_0x477af7['push'](_0x477af7['shift']());}};_0x1ad758(++_0x2990be);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['UpdateVoiceRecording']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')](_0x3f8cf9[_0xae3d('0x1a')],{'raw':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9['options'][_0xae3d('0x1c')]||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null})[_0xae3d('0x1f')](function(_0x3224ff){logger[_0xae3d('0xe')](_0xae3d('0x20'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x20'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x3224ff));_0x558e42(_0x3224ff);})[_0xae3d('0x21')](function(_0x1fe90f){logger[_0xae3d('0x14')](_0xae3d('0x20'),_0x1fe90f[_0xae3d('0x16')],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x1fe90f['message']));});});};exports[_0xae3d('0x22')]=function(_0x185e71){var _0xb5940=this;return new Promise(function(_0x52df0f,_0x256bd0){var _0x4391db=require(_0xae3d('0x23'));var _0x54c1e1;return db['Setting'][_0xae3d('0x24')]({'attributes':['id',_0xae3d('0x25')],'where':{'id':0x1},'raw':!![]})[_0xae3d('0x1f')](function(_0x3114f9){_0x54c1e1=_0x3114f9;return db[_0xae3d('0x18')]['create'](_0x185e71[_0xae3d('0x1a')]);})[_0xae3d('0x1f')](function(_0x5a39c5){if(_0x54c1e1[_0xae3d('0x25')]&&fs[_0xae3d('0x26')](_0x5a39c5[_0xae3d('0x27')])){var _0x46f484=util[_0xae3d('0x28')](_0xae3d('0x29'),_0x5a39c5['value']);return _0x4391db['encryptFile'](_0x5a39c5['value'],_0x46f484,config[_0xae3d('0x2a')][_0xae3d('0x2b')])[_0xae3d('0x1f')](function(){fs[_0xae3d('0x2c')](_0x5a39c5['value']);logger[_0xae3d('0xe')](_0xae3d('0x2d'));return _0x5a39c5;});}return _0x5a39c5;})[_0xae3d('0x1f')](function(_0x3748d2){logger[_0xae3d('0xe')](_0xae3d('0x22'),_0x185e71);logger[_0xae3d('0x11')]('CreateVoiceRecording',_0x185e71,JSON[_0xae3d('0x13')](_0x3748d2));_0x52df0f(_0x3748d2);})['catch'](function(_0x55aae4){logger[_0xae3d('0x14')]('CreateVoiceRecording',_0x55aae4[_0xae3d('0x16')],_0x185e71);_0x256bd0(_0xb5940['error'](0x1f4,_0x55aae4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 8f096ce..e06e15b 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 _0x4f89=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','delete','multer','connect-timeout'];(function(_0x2b3f36,_0x14044d){var _0x5e7d05=function(_0x1dbaad){while(--_0x1dbaad){_0x2b3f36['push'](_0x2b3f36['shift']());}};_0x5e7d05(++_0x14044d);}(_0x4f89,0x1be));var _0x94f8=function(_0x2c0546,_0x316d34){_0x2c0546=_0x2c0546-0x0;var _0x391857=_0x4f89[_0x2c0546];return _0x391857;};'use strict';var multer=require(_0x94f8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x94f8('0x1'));var express=require(_0x94f8('0x2'));var router=express[_0x94f8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x94f8('0x4'));var interaction=require(_0x94f8('0x5'));var config=require(_0x94f8('0x6'));var controller=require(_0x94f8('0x7'));router[_0x94f8('0x8')]('/',auth[_0x94f8('0x9')](),controller[_0x94f8('0xa')]);router[_0x94f8('0x8')](_0x94f8('0xb'),auth[_0x94f8('0x9')](),controller[_0x94f8('0xc')]);router['get'](_0x94f8('0xd'),auth[_0x94f8('0x9')](),controller['show']);router['post']('/',auth[_0x94f8('0x9')](),controller['create']);router[_0x94f8('0xe')](_0x94f8('0xd'),auth[_0x94f8('0x9')](),controller['update']);router[_0x94f8('0xf')]('/:id',auth[_0x94f8('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xac4f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xac4f,0xe1));var _0xfac4=function(_0x45d56b,_0x3b99e4){_0x45d56b=_0x45d56b-0x0;var _0xd62e37=_0xac4f[_0x45d56b];return _0xd62e37;};'use strict';var multer=require(_0xfac4('0x0'));var util=require(_0xfac4('0x1'));var path=require(_0xfac4('0x2'));var timeout=require(_0xfac4('0x3'));var express=require(_0xfac4('0x4'));var router=express[_0xfac4('0x5')]();var fs_extra=require(_0xfac4('0x6'));var auth=require(_0xfac4('0x7'));var interaction=require(_0xfac4('0x8'));var config=require(_0xfac4('0x9'));var controller=require(_0xfac4('0xa'));router[_0xfac4('0xb')]('/',auth[_0xfac4('0xc')](),controller[_0xfac4('0xd')]);router[_0xfac4('0xb')](_0xfac4('0xe'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfac4('0xf'),auth[_0xfac4('0xc')](),controller[_0xfac4('0x10')]);router[_0xfac4('0x11')]('/',auth[_0xfac4('0xc')](),controller['create']);router[_0xfac4('0x12')](_0xfac4('0xf'),auth[_0xfac4('0xc')](),controller['update']);router['delete'](_0xfac4('0xf'),auth[_0xfac4('0xc')](),controller[_0xfac4('0x13')]);module[_0xfac4('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index d927968..212815c 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 _0xf099=['moment','ENUM','attended','STRING','Yes','sequelize'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xf099,0x1d9));var _0x9f09=function(_0x5c883f,_0x38f092){_0x5c883f=_0x5c883f-0x0;var _0x4210cc=_0xf099[_0x5c883f];return _0x4210cc;};'use strict';var Sequelize=require(_0x9f09('0x0'));var moment=require(_0x9f09('0x1'));module['exports']={'type':{'type':Sequelize[_0x9f09('0x2')]('blind',_0x9f09('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x9f09('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x9f09('0x4')]},'transferercalleridname':{'type':Sequelize[_0x9f09('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x9f09('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x9f09('0x4')]},'transferercontext':{'type':Sequelize[_0x9f09('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x9f09('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x9f09('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x9f09('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9f09('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9f09('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x9f09('0x4')]},'transfereecontext':{'type':Sequelize[_0x9f09('0x4')]},'transfereeexten':{'type':Sequelize[_0x9f09('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x9f09('0x4')]},'isexternal':{'type':Sequelize[_0x9f09('0x2')](_0x9f09('0x5'),'No')},'context':{'type':Sequelize[_0x9f09('0x4')]},'extension':{'type':Sequelize[_0x9f09('0x4')]}}; \ No newline at end of file +var _0x1bfd=['exports','ENUM','attended','STRING','Yes','moment'];(function(_0x33eb07,_0x2b5296){var _0x71843b=function(_0x4dd25e){while(--_0x4dd25e){_0x33eb07['push'](_0x33eb07['shift']());}};_0x71843b(++_0x2b5296);}(_0x1bfd,0x107));var _0xd1bf=function(_0x342b1d,_0x58fb84){_0x342b1d=_0x342b1d-0x0;var _0x49c372=_0x1bfd[_0x342b1d];return _0x49c372;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd1bf('0x0'));module[_0xd1bf('0x1')]={'type':{'type':Sequelize[_0xd1bf('0x2')]('blind',_0xd1bf('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xd1bf('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xd1bf('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd1bf('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xd1bf('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xd1bf('0x4')]},'transferercontext':{'type':Sequelize[_0xd1bf('0x4')]},'transfererexten':{'type':Sequelize[_0xd1bf('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xd1bf('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xd1bf('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xd1bf('0x4')]},'transfereecontext':{'type':Sequelize[_0xd1bf('0x4')]},'transfereeexten':{'type':Sequelize[_0xd1bf('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd1bf('0x2')](_0xd1bf('0x5'),'No')},'context':{'type':Sequelize[_0xd1bf('0x4')]},'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 bfbe982..c7556c5 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 _0xc6d3=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','reject','save','update','then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','filters'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc6d3,0x67));var _0x3c6d=function(_0x3fb7da,_0xfa8f6f){_0x3fb7da=_0x3fb7da-0x0;var _0x43d019=_0xc6d3[_0x3fb7da];return _0x43d019;};'use strict';var emlformat=require(_0x3c6d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c6d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c6d('0x2'));var moment=require(_0x3c6d('0x3'));var BPromise=require(_0x3c6d('0x4'));var Mustache=require(_0x3c6d('0x5'));var util=require(_0x3c6d('0x6'));var path=require(_0x3c6d('0x7'));var sox=require('sox');var csv=require(_0x3c6d('0x8'));var ejs=require(_0x3c6d('0x9'));var fs=require('fs');var fs_extra=require(_0x3c6d('0xa'));var _=require(_0x3c6d('0xb'));var squel=require(_0x3c6d('0xc'));var crypto=require('crypto');var jsforce=require(_0x3c6d('0xd'));var deskjs=require(_0x3c6d('0xe'));var toCsv=require(_0x3c6d('0x8'));var querystring=require('querystring');var Papa=require(_0x3c6d('0xf'));var Redis=require(_0x3c6d('0x10'));var authService=require(_0x3c6d('0x11'));var qs=require(_0x3c6d('0x12'));var as=require(_0x3c6d('0x13'));var hardwareService=require(_0x3c6d('0x14'));var logger=require(_0x3c6d('0x15'))('api');var utils=require(_0x3c6d('0x16'));var config=require(_0x3c6d('0x17'));var licenseUtil=require(_0x3c6d('0x18'));var db=require(_0x3c6d('0x19'))['db'];function respondWithStatusCode(_0x531529,_0x2b816c){_0x2b816c=_0x2b816c||0xcc;return function(_0x5366b0){if(_0x5366b0){return _0x531529[_0x3c6d('0x1a')](_0x2b816c);}return _0x531529['status'](_0x2b816c)[_0x3c6d('0x1b')]();};}function respondWithResult(_0x228f39,_0xd94ed2){_0xd94ed2=_0xd94ed2||0xc8;return function(_0x5e71b7){if(_0x5e71b7){return _0x228f39[_0x3c6d('0x1c')](_0xd94ed2)[_0x3c6d('0x1d')](_0x5e71b7);}};}function respondWithFilteredResult(_0x4c8679,_0x459598){return function(_0xa050ba){if(_0xa050ba){var _0x5294ef=typeof _0x459598['offset']==='undefined'&&typeof _0x459598[_0x3c6d('0x1e')]==='undefined';var _0x3476df=_0xa050ba[_0x3c6d('0x1f')];var _0x328c25=_0x5294ef?0x0:_0x459598['offset'];var _0x5b651b=_0x5294ef?_0xa050ba['count']:_0x459598[_0x3c6d('0x20')]+_0x459598[_0x3c6d('0x1e')];var _0x52670d;if(_0x5b651b>=_0x3476df){_0x5b651b=_0x3476df;_0x52670d=0xc8;}else{_0x52670d=0xce;}_0x4c8679[_0x3c6d('0x1c')](_0x52670d);return _0x4c8679[_0x3c6d('0x21')]('Content-Range',_0x328c25+'-'+_0x5b651b+'/'+_0x3476df)['json'](_0xa050ba);}return null;};}function patchUpdates(_0x594bc5){return function(_0x118082){try{jsonpatch['apply'](_0x118082,_0x594bc5,!![]);}catch(_0x5f1025){return BPromise[_0x3c6d('0x22')](_0x5f1025);}return _0x118082[_0x3c6d('0x23')]();};}function saveUpdates(_0x58f8e7,_0x4fc24e){return function(_0x4026f9){if(_0x4026f9){return _0x4026f9[_0x3c6d('0x24')](_0x58f8e7)[_0x3c6d('0x25')](function(_0x1fa2a8){return _0x1fa2a8;});}return null;};}function removeEntity(_0x25eb69,_0x4fcddc){return function(_0x479619){if(_0x479619){return _0x479619[_0x3c6d('0x26')]()[_0x3c6d('0x25')](function(){_0x25eb69['status'](0xcc)[_0x3c6d('0x1b')]();});}};}function handleEntityNotFound(_0x30508f,_0x75bf09){return function(_0x5f35d5){if(!_0x5f35d5){_0x30508f[_0x3c6d('0x1a')](0x194);}return _0x5f35d5;};}function handleError(_0x5c68f9,_0x3ff564){_0x3ff564=_0x3ff564||0x1f4;return function(_0x49df3c){logger['error'](_0x49df3c[_0x3c6d('0x27')]);if(_0x49df3c[_0x3c6d('0x28')]){delete _0x49df3c[_0x3c6d('0x28')];}_0x5c68f9[_0x3c6d('0x1c')](_0x3ff564)[_0x3c6d('0x29')](_0x49df3c);};}exports[_0x3c6d('0x2a')]=function(_0x1032e5,_0x5ead45){var _0xe07aba={},_0x1f6bf5={},_0x374428={'count':0x0,'rows':[]};var _0x1a93f7=_[_0x3c6d('0x2b')](db[_0x3c6d('0x2c')][_0x3c6d('0x2d')],function(_0x5374b4){return{'name':_0x5374b4[_0x3c6d('0x2e')],'type':_0x5374b4[_0x3c6d('0x2f')][_0x3c6d('0x30')]};});_0x1f6bf5['model']=_['map'](_0x1a93f7,'name');_0x1f6bf5[_0x3c6d('0x31')]=_['keys'](_0x1032e5[_0x3c6d('0x31')]);_0x1f6bf5[_0x3c6d('0x32')]=_[_0x3c6d('0x33')](_0x1f6bf5[_0x3c6d('0x34')],_0x1f6bf5[_0x3c6d('0x31')]);_0xe07aba[_0x3c6d('0x35')]=_[_0x3c6d('0x33')](_0x1f6bf5['model'],qs[_0x3c6d('0x36')](_0x1032e5[_0x3c6d('0x31')][_0x3c6d('0x36')]));_0xe07aba['attributes']=_0xe07aba[_0x3c6d('0x35')][_0x3c6d('0x37')]?_0xe07aba[_0x3c6d('0x35')]:_0x1f6bf5[_0x3c6d('0x34')];if(!_0x1032e5[_0x3c6d('0x31')][_0x3c6d('0x38')](_0x3c6d('0x39'))){_0xe07aba[_0x3c6d('0x1e')]=qs['limit'](_0x1032e5['query'][_0x3c6d('0x1e')]);_0xe07aba[_0x3c6d('0x20')]=qs[_0x3c6d('0x20')](_0x1032e5['query'][_0x3c6d('0x20')]);}_0xe07aba[_0x3c6d('0x3a')]=qs['sort'](_0x1032e5[_0x3c6d('0x31')][_0x3c6d('0x3b')]);_0xe07aba[_0x3c6d('0x3c')]=qs['filters'](_[_0x3c6d('0x3d')](_0x1032e5['query'],_0x1f6bf5[_0x3c6d('0x32')]),_0x1a93f7);if(_0x1032e5[_0x3c6d('0x31')][_0x3c6d('0x3e')]){_0xe07aba['where']=_['merge'](_0xe07aba[_0x3c6d('0x3c')],{'$or':_[_0x3c6d('0x2b')](_0x1a93f7,function(_0x5e88bb){if(_0x5e88bb[_0x3c6d('0x2f')]!=='VIRTUAL'){var _0x514441={};_0x514441[_0x5e88bb['name']]={'$like':'%'+_0x1032e5['query'][_0x3c6d('0x3e')]+'%'};return _0x514441;}})});}_0xe07aba=_[_0x3c6d('0x3f')]({},_0xe07aba,_0x1032e5['options']);var _0x3a77d6={'where':_0xe07aba[_0x3c6d('0x3c')]};return db[_0x3c6d('0x2c')]['count'](_0x3a77d6)[_0x3c6d('0x25')](function(_0x3f00ac){_0x374428[_0x3c6d('0x1f')]=_0x3f00ac;if(_0x1032e5['query']['includeAll']){_0xe07aba[_0x3c6d('0x40')]=[{'all':!![]}];}return db[_0x3c6d('0x2c')][_0x3c6d('0x41')](_0xe07aba);})['then'](function(_0x48e360){_0x374428[_0x3c6d('0x42')]=_0x48e360;return _0x374428;})['then'](respondWithFilteredResult(_0x5ead45,_0xe07aba))[_0x3c6d('0x43')](handleError(_0x5ead45,null));};exports[_0x3c6d('0x44')]=function(_0x5a039a,_0xb09a98){var _0xf6e959={'raw':!![],'where':{'id':_0x5a039a[_0x3c6d('0x45')]['id']}},_0x2d0f3b={};_0x2d0f3b[_0x3c6d('0x34')]=_['keys'](db[_0x3c6d('0x2c')][_0x3c6d('0x2d')]);_0x2d0f3b[_0x3c6d('0x31')]=_[_0x3c6d('0x46')](_0x5a039a['query']);_0x2d0f3b[_0x3c6d('0x32')]=_[_0x3c6d('0x33')](_0x2d0f3b['model'],_0x2d0f3b[_0x3c6d('0x31')]);_0xf6e959[_0x3c6d('0x35')]=_[_0x3c6d('0x33')](_0x2d0f3b[_0x3c6d('0x34')],qs[_0x3c6d('0x36')](_0x5a039a[_0x3c6d('0x31')][_0x3c6d('0x36')]));_0xf6e959[_0x3c6d('0x35')]=_0xf6e959[_0x3c6d('0x35')][_0x3c6d('0x37')]?_0xf6e959['attributes']:_0x2d0f3b[_0x3c6d('0x34')];if(_0x5a039a[_0x3c6d('0x31')][_0x3c6d('0x47')]){_0xf6e959[_0x3c6d('0x40')]=[{'all':!![]}];}_0xf6e959=_[_0x3c6d('0x3f')]({},_0xf6e959,_0x5a039a[_0x3c6d('0x48')]);return db[_0x3c6d('0x2c')]['find'](_0xf6e959)[_0x3c6d('0x25')](handleEntityNotFound(_0xb09a98,null))[_0x3c6d('0x25')](respondWithResult(_0xb09a98,null))[_0x3c6d('0x43')](handleError(_0xb09a98,null));};exports[_0x3c6d('0x49')]=function(_0x4c08a6,_0x19e9c2){return db[_0x3c6d('0x2c')][_0x3c6d('0x49')](_0x4c08a6[_0x3c6d('0x4a')],{})[_0x3c6d('0x25')](respondWithResult(_0x19e9c2,0xc9))['catch'](handleError(_0x19e9c2,null));};exports[_0x3c6d('0x24')]=function(_0x277051,_0x28d947){if(_0x277051[_0x3c6d('0x4a')]['id']){delete _0x277051[_0x3c6d('0x4a')]['id'];}return db[_0x3c6d('0x2c')][_0x3c6d('0x4b')]({'where':{'id':_0x277051[_0x3c6d('0x45')]['id']}})[_0x3c6d('0x25')](handleEntityNotFound(_0x28d947,null))[_0x3c6d('0x25')](saveUpdates(_0x277051[_0x3c6d('0x4a')],null))[_0x3c6d('0x25')](respondWithResult(_0x28d947,null))[_0x3c6d('0x43')](handleError(_0x28d947,null));};exports[_0x3c6d('0x26')]=function(_0x1f45ba,_0x1ffa7e){return db[_0x3c6d('0x2c')][_0x3c6d('0x4b')]({'where':{'id':_0x1f45ba['params']['id']}})['then'](handleEntityNotFound(_0x1ffa7e,null))[_0x3c6d('0x25')](removeEntity(_0x1ffa7e,null))[_0x3c6d('0x43')](handleError(_0x1ffa7e,null));};exports[_0x3c6d('0x4c')]=function(_0x20766a,_0x33fdb2){return db[_0x3c6d('0x2c')][_0x3c6d('0x4c')]()[_0x3c6d('0x25')](respondWithResult(_0x33fdb2,null))[_0x3c6d('0x43')](handleError(_0x33fdb2,null));}; \ No newline at end of file +var _0x731d=['key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','options','then','includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','reject','update','destroy','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0x36f9cb,_0x7a4ca2){var _0x47b3ab=function(_0x1c66b1){while(--_0x1c66b1){_0x36f9cb['push'](_0x36f9cb['shift']());}};_0x47b3ab(++_0x7a4ca2);}(_0x731d,0xaa));var _0xd731=function(_0x1d6aa6,_0x58de49){_0x1d6aa6=_0x1d6aa6-0x0;var _0x1a97b9=_0x731d[_0x1d6aa6];return _0x1a97b9;};'use strict';var emlformat=require(_0xd731('0x0'));var rimraf=require(_0xd731('0x1'));var zipdir=require(_0xd731('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd731('0x3'));var moment=require(_0xd731('0x4'));var BPromise=require(_0xd731('0x5'));var Mustache=require(_0xd731('0x6'));var util=require('util');var path=require(_0xd731('0x7'));var sox=require(_0xd731('0x8'));var csv=require(_0xd731('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd731('0xa'));var squel=require(_0xd731('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd731('0xc'));var toCsv=require(_0xd731('0x9'));var querystring=require(_0xd731('0xd'));var Papa=require('papaparse');var Redis=require(_0xd731('0xe'));var authService=require(_0xd731('0xf'));var qs=require(_0xd731('0x10'));var as=require(_0xd731('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd731('0x12'));var licenseUtil=require(_0xd731('0x13'));var db=require(_0xd731('0x14'))['db'];function respondWithStatusCode(_0x385523,_0x5a88d3){_0x5a88d3=_0x5a88d3||0xcc;return function(_0x15b635){if(_0x15b635){return _0x385523[_0xd731('0x15')](_0x5a88d3);}return _0x385523[_0xd731('0x16')](_0x5a88d3)['end']();};}function respondWithResult(_0x4fa53c,_0x5846e8){_0x5846e8=_0x5846e8||0xc8;return function(_0x5882fe){if(_0x5882fe){return _0x4fa53c[_0xd731('0x16')](_0x5846e8)[_0xd731('0x17')](_0x5882fe);}};}function respondWithFilteredResult(_0x4c20b9,_0x1a332c){return function(_0x3c3eb3){if(_0x3c3eb3){var _0x2a00d2=typeof _0x1a332c['offset']===_0xd731('0x18')&&typeof _0x1a332c[_0xd731('0x19')]===_0xd731('0x18');var _0x21a0f3=_0x3c3eb3[_0xd731('0x1a')];var _0x1e324b=_0x2a00d2?0x0:_0x1a332c['offset'];var _0x23a772=_0x2a00d2?_0x3c3eb3[_0xd731('0x1a')]:_0x1a332c[_0xd731('0x1b')]+_0x1a332c['limit'];var _0x2ea06a;if(_0x23a772>=_0x21a0f3){_0x23a772=_0x21a0f3;_0x2ea06a=0xc8;}else{_0x2ea06a=0xce;}_0x4c20b9['status'](_0x2ea06a);return _0x4c20b9[_0xd731('0x1c')]('Content-Range',_0x1e324b+'-'+_0x23a772+'/'+_0x21a0f3)[_0xd731('0x17')](_0x3c3eb3);}return null;};}function patchUpdates(_0x2df227){return function(_0x549c1a){try{jsonpatch['apply'](_0x549c1a,_0x2df227,!![]);}catch(_0x41a01c){return BPromise[_0xd731('0x1d')](_0x41a01c);}return _0x549c1a['save']();};}function saveUpdates(_0x540498,_0x3100c0){return function(_0x561a21){if(_0x561a21){return _0x561a21[_0xd731('0x1e')](_0x540498)['then'](function(_0x34ffd0){return _0x34ffd0;});}return null;};}function removeEntity(_0x31b033,_0x327169){return function(_0x25ce79){if(_0x25ce79){return _0x25ce79[_0xd731('0x1f')]()['then'](function(){_0x31b033[_0xd731('0x16')](0xcc)[_0xd731('0x20')]();});}};}function handleEntityNotFound(_0x289037,_0x589257){return function(_0x5cb92f){if(!_0x5cb92f){_0x289037[_0xd731('0x15')](0x194);}return _0x5cb92f;};}function handleError(_0x3ed639,_0x54149f){_0x54149f=_0x54149f||0x1f4;return function(_0x32193e){logger[_0xd731('0x21')](_0x32193e[_0xd731('0x22')]);if(_0x32193e[_0xd731('0x23')]){delete _0x32193e[_0xd731('0x23')];}_0x3ed639['status'](_0x54149f)[_0xd731('0x24')](_0x32193e);};}exports[_0xd731('0x25')]=function(_0x2aee86,_0x1b9626){var _0x45793c={},_0x560eb5={},_0x3f8bc4={'count':0x0,'rows':[]};var _0x1cdb40=_[_0xd731('0x26')](db[_0xd731('0x27')][_0xd731('0x28')],function(_0x52c51a){return{'name':_0x52c51a[_0xd731('0x29')],'type':_0x52c51a[_0xd731('0x2a')][_0xd731('0x2b')]};});_0x560eb5[_0xd731('0x2c')]=_['map'](_0x1cdb40,_0xd731('0x23'));_0x560eb5['query']=_[_0xd731('0x2d')](_0x2aee86[_0xd731('0x2e')]);_0x560eb5['filters']=_['intersection'](_0x560eb5['model'],_0x560eb5['query']);_0x45793c[_0xd731('0x2f')]=_[_0xd731('0x30')](_0x560eb5[_0xd731('0x2c')],qs[_0xd731('0x31')](_0x2aee86[_0xd731('0x2e')][_0xd731('0x31')]));_0x45793c[_0xd731('0x2f')]=_0x45793c['attributes'][_0xd731('0x32')]?_0x45793c[_0xd731('0x2f')]:_0x560eb5[_0xd731('0x2c')];if(!_0x2aee86[_0xd731('0x2e')]['hasOwnProperty'](_0xd731('0x33'))){_0x45793c['limit']=qs[_0xd731('0x19')](_0x2aee86[_0xd731('0x2e')]['limit']);_0x45793c[_0xd731('0x1b')]=qs[_0xd731('0x1b')](_0x2aee86['query'][_0xd731('0x1b')]);}_0x45793c[_0xd731('0x34')]=qs[_0xd731('0x35')](_0x2aee86[_0xd731('0x2e')][_0xd731('0x35')]);_0x45793c['where']=qs[_0xd731('0x36')](_['pick'](_0x2aee86['query'],_0x560eb5['filters']),_0x1cdb40);if(_0x2aee86['query'][_0xd731('0x37')]){_0x45793c[_0xd731('0x38')]=_[_0xd731('0x39')](_0x45793c[_0xd731('0x38')],{'$or':_['map'](_0x1cdb40,function(_0x41e49c){if(_0x41e49c[_0xd731('0x2a')]!=='VIRTUAL'){var _0x510643={};_0x510643[_0x41e49c[_0xd731('0x23')]]={'$like':'%'+_0x2aee86[_0xd731('0x2e')]['filter']+'%'};return _0x510643;}})});}_0x45793c=_[_0xd731('0x39')]({},_0x45793c,_0x2aee86[_0xd731('0x3a')]);var _0x216a98={'where':_0x45793c[_0xd731('0x38')]};return db[_0xd731('0x27')][_0xd731('0x1a')](_0x216a98)[_0xd731('0x3b')](function(_0x41479e){_0x3f8bc4['count']=_0x41479e;if(_0x2aee86[_0xd731('0x2e')][_0xd731('0x3c')]){_0x45793c['include']=[{'all':!![]}];}return db[_0xd731('0x27')][_0xd731('0x3d')](_0x45793c);})[_0xd731('0x3b')](function(_0x2ec5db){_0x3f8bc4[_0xd731('0x3e')]=_0x2ec5db;return _0x3f8bc4;})[_0xd731('0x3b')](respondWithFilteredResult(_0x1b9626,_0x45793c))['catch'](handleError(_0x1b9626,null));};exports[_0xd731('0x3f')]=function(_0x312808,_0x1d809e){var _0x4de43b={'raw':!![],'where':{'id':_0x312808['params']['id']}},_0x46ef01={};_0x46ef01[_0xd731('0x2c')]=_[_0xd731('0x2d')](db[_0xd731('0x27')]['rawAttributes']);_0x46ef01['query']=_[_0xd731('0x2d')](_0x312808['query']);_0x46ef01[_0xd731('0x36')]=_[_0xd731('0x30')](_0x46ef01[_0xd731('0x2c')],_0x46ef01['query']);_0x4de43b[_0xd731('0x2f')]=_[_0xd731('0x30')](_0x46ef01[_0xd731('0x2c')],qs[_0xd731('0x31')](_0x312808[_0xd731('0x2e')][_0xd731('0x31')]));_0x4de43b[_0xd731('0x2f')]=_0x4de43b[_0xd731('0x2f')][_0xd731('0x32')]?_0x4de43b[_0xd731('0x2f')]:_0x46ef01[_0xd731('0x2c')];if(_0x312808[_0xd731('0x2e')]['includeAll']){_0x4de43b[_0xd731('0x40')]=[{'all':!![]}];}_0x4de43b=_[_0xd731('0x39')]({},_0x4de43b,_0x312808[_0xd731('0x3a')]);return db[_0xd731('0x27')][_0xd731('0x41')](_0x4de43b)['then'](handleEntityNotFound(_0x1d809e,null))['then'](respondWithResult(_0x1d809e,null))[_0xd731('0x42')](handleError(_0x1d809e,null));};exports[_0xd731('0x43')]=function(_0x3d7ea3,_0x3b74b8){return db[_0xd731('0x27')][_0xd731('0x43')](_0x3d7ea3[_0xd731('0x44')],{})[_0xd731('0x3b')](respondWithResult(_0x3b74b8,0xc9))[_0xd731('0x42')](handleError(_0x3b74b8,null));};exports[_0xd731('0x1e')]=function(_0x8f42ea,_0x19b416){if(_0x8f42ea['body']['id']){delete _0x8f42ea[_0xd731('0x44')]['id'];}return db[_0xd731('0x27')][_0xd731('0x41')]({'where':{'id':_0x8f42ea[_0xd731('0x45')]['id']}})[_0xd731('0x3b')](handleEntityNotFound(_0x19b416,null))[_0xd731('0x3b')](saveUpdates(_0x8f42ea['body'],null))['then'](respondWithResult(_0x19b416,null))[_0xd731('0x42')](handleError(_0x19b416,null));};exports[_0xd731('0x1f')]=function(_0x501500,_0x3a98a0){return db[_0xd731('0x27')][_0xd731('0x41')]({'where':{'id':_0x501500[_0xd731('0x45')]['id']}})[_0xd731('0x3b')](handleEntityNotFound(_0x3a98a0,null))['then'](removeEntity(_0x3a98a0,null))[_0xd731('0x42')](handleError(_0x3a98a0,null));};exports[_0xd731('0x46')]=function(_0x4267b,_0x2417d9){return db[_0xd731('0x27')][_0xd731('0x46')]()[_0xd731('0x3b')](respondWithResult(_0x2417d9,null))[_0xd731('0x42')](handleError(_0x2417d9,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ede70e8..36daddd 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 _0xcd53=['request-promise','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x3cd1da,_0x320f6a){var _0x3796bd=function(_0x5e446a){while(--_0x5e446a){_0x3cd1da['push'](_0x3cd1da['shift']());}};_0x3796bd(++_0x320f6a);}(_0xcd53,0x13a));var _0x3cd5=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xcd53[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0x3cd5('0x0'));var util=require(_0x3cd5('0x1'));var logger=require(_0x3cd5('0x2'))(_0x3cd5('0x3'));var moment=require('moment');var BPromise=require(_0x3cd5('0x4'));var rp=require(_0x3cd5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3cd5('0x6'));var attributes=require(_0x3cd5('0x7'));module[_0x3cd5('0x8')]=function(_0x21109c,_0x5ad58d){return _0x21109c[_0x3cd5('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x3cd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa67b=['report_call_transfer','api','moment','path','rimraf','./voiceTransferReport.attributes','define','VoiceTransferReport'];(function(_0x1f0d02,_0x544507){var _0x7cb25=function(_0x12d57b){while(--_0x12d57b){_0x1f0d02['push'](_0x1f0d02['shift']());}};_0x7cb25(++_0x544507);}(_0xa67b,0x179));var _0xba67=function(_0x3c6397,_0x73d921){_0x3c6397=_0x3c6397-0x0;var _0x15bc50=_0xa67b[_0x3c6397];return _0x15bc50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xba67('0x0'));var moment=require(_0xba67('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba67('0x2'));var rimraf=require(_0xba67('0x3'));var config=require('../../config/environment');var attributes=require(_0xba67('0x4'));module['exports']=function(_0x4c3cb5,_0x40452e){return _0x4c3cb5[_0xba67('0x5')](_0xba67('0x6'),attributes,{'tableName':_0xba67('0x7'),'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 09225b5..78b22bb 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 _0xf70b=['create','body','raw','lodash','ioredis','../../mysqldb','../../config/logger','rpc','client','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xf70b,0x1bb));var _0xbf70=function(_0x62e9cd,_0x56da8a){_0x62e9cd=_0x62e9cd-0x0;var _0x38babb=_0xf70b[_0x62e9cd];return _0x38babb;};'use strict';var _=require(_0xbf70('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf70('0x1'));var db=require(_0xbf70('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf70('0x3'))(_0xbf70('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf70('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407410,_0x1670c6,_0x19fb96){return new BPromise(function(_0x5476c7,_0x5a9d76){return client['request'](_0x407410,_0x19fb96)[_0xbf70('0x6')](function(_0x476225){logger['info'](_0xbf70('0x7'),_0x1670c6,_0xbf70('0x8'));logger[_0xbf70('0x9')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1670c6,_0xbf70('0x8'),JSON[_0xbf70('0xa')](_0x476225));if(_0x476225['error']){if(_0x476225['error'][_0xbf70('0xb')]===0x1f4){logger[_0xbf70('0xc')](_0xbf70('0x7'),_0x1670c6,_0x476225['error']['message']);return _0x5a9d76(_0x476225['error']['message']);}logger[_0xbf70('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x1670c6,_0x476225['error'][_0xbf70('0xd')]);return _0x5476c7(_0x476225[_0xbf70('0xc')][_0xbf70('0xd')]);}else{logger[_0xbf70('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x1670c6,_0xbf70('0x8'));_0x5476c7(_0x476225[_0xbf70('0xf')][_0xbf70('0xd')]);}})[_0xbf70('0x10')](function(_0x3d4110){logger[_0xbf70('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x1670c6,_0x3d4110);_0x5a9d76(_0x3d4110);});});}exports[_0xbf70('0x11')]=function(_0xe5fd8c){var _0x1dfffc=this;return new Promise(function(_0x150022,_0x572707){return db[_0xbf70('0x12')][_0xbf70('0x13')](_0xe5fd8c[_0xbf70('0x14')],{'raw':_0xe5fd8c['options']?_0xe5fd8c['options'][_0xbf70('0x15')]===undefined?!![]:![]:!![]})[_0xbf70('0x6')](function(_0x2c5cd7){logger[_0xbf70('0xe')](_0xbf70('0x11'),_0xe5fd8c);logger[_0xbf70('0x9')](_0xbf70('0x11'),_0xe5fd8c,JSON[_0xbf70('0xa')](_0x2c5cd7));_0x150022(_0x2c5cd7);})['catch'](function(_0x59e2aa){logger[_0xbf70('0xc')](_0xbf70('0x11'),_0x59e2aa[_0xbf70('0xd')],_0xe5fd8c);_0x572707(_0x1dfffc['error'](0x1f4,_0x59e2aa[_0xbf70('0xd')]));});});}; \ No newline at end of file +var _0xbda8=['raw','debug','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceTransferReport','body','options'];(function(_0x90d39c,_0x4712a0){var _0x4ac0b0=function(_0x4a0961){while(--_0x4a0961){_0x90d39c['push'](_0x90d39c['shift']());}};_0x4ac0b0(++_0x4712a0);}(_0xbda8,0xe3));var _0x8bda=function(_0xc1a8fc,_0x24f513){_0xc1a8fc=_0xc1a8fc-0x0;var _0x3dd6a3=_0xbda8[_0xc1a8fc];return _0x3dd6a3;};'use strict';var _=require('lodash');var util=require(_0x8bda('0x0'));var moment=require(_0x8bda('0x1'));var BPromise=require(_0x8bda('0x2'));var rs=require(_0x8bda('0x3'));var fs=require('fs');var Redis=require(_0x8bda('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bda('0x5'));var logger=require(_0x8bda('0x6'))(_0x8bda('0x7'));var config=require(_0x8bda('0x8'));var jayson=require(_0x8bda('0x9'));var client=jayson[_0x8bda('0xa')][_0x8bda('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2673ca,_0x4502d2,_0x585c8e){return new BPromise(function(_0x403c77,_0x57cac0){return client['request'](_0x2673ca,_0x585c8e)[_0x8bda('0xc')](function(_0x28473d){logger[_0x8bda('0xd')](_0x8bda('0xe'),_0x4502d2,_0x8bda('0xf'));logger['debug'](_0x8bda('0x10'),_0x4502d2,_0x8bda('0xf'),JSON[_0x8bda('0x11')](_0x28473d));if(_0x28473d[_0x8bda('0x12')]){if(_0x28473d[_0x8bda('0x12')][_0x8bda('0x13')]===0x1f4){logger[_0x8bda('0x12')](_0x8bda('0xe'),_0x4502d2,_0x28473d['error']['message']);return _0x57cac0(_0x28473d['error'][_0x8bda('0x14')]);}logger[_0x8bda('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4502d2,_0x28473d[_0x8bda('0x12')][_0x8bda('0x14')]);return _0x403c77(_0x28473d[_0x8bda('0x12')][_0x8bda('0x14')]);}else{logger['info'](_0x8bda('0xe'),_0x4502d2,_0x8bda('0xf'));_0x403c77(_0x28473d[_0x8bda('0x15')]['message']);}})['catch'](function(_0x236446){logger[_0x8bda('0x12')](_0x8bda('0xe'),_0x4502d2,_0x236446);_0x57cac0(_0x236446);});});}exports['CreateVoiceTransferReport']=function(_0x21cbd4){var _0x222bb3=this;return new Promise(function(_0x2e90eb,_0x20b035){return db[_0x8bda('0x16')]['create'](_0x21cbd4[_0x8bda('0x17')],{'raw':_0x21cbd4[_0x8bda('0x18')]?_0x21cbd4[_0x8bda('0x18')][_0x8bda('0x19')]===undefined?!![]:![]:!![]})[_0x8bda('0xc')](function(_0x29985c){logger['info']('CreateVoiceTransferReport',_0x21cbd4);logger[_0x8bda('0x1a')](_0x8bda('0x1b'),_0x21cbd4,JSON[_0x8bda('0x11')](_0x29985c));_0x2e90eb(_0x29985c);})['catch'](function(_0x3bc900){logger['error'](_0x8bda('0x1b'),_0x3bc900[_0x8bda('0x14')],_0x21cbd4);_0x20b035(_0x222bb3[_0x8bda('0x12')](0x1f4,_0x3bc900[_0x8bda('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ad92807..e3c0403 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 _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3e0b61,_0x36b6e5){_0x3e0b61=_0x3e0b61-0x0;var _0x2cb86b=_0xb43b[_0x3e0b61];return _0x2cb86b;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x2021c1,_0xf2a55c){var _0x4c16c7=function(_0x1716e7){while(--_0x1716e7){_0x2021c1['push'](_0x2021c1['shift']());}};_0x4c16c7(++_0xf2a55c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 7f85b50..3774c8d 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 _0x24cd=['number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','sessionId','length','originate','info','body','json','callerId','callbackUrl','entityFound:','format','user:%s','hangup','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../config/environment','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x24cd,0x83));var _0xd24c=function(_0x2b0a6a,_0x3a9be2){_0x2b0a6a=_0x2b0a6a-0x0;var _0x111bfb=_0x24cd[_0x2b0a6a];return _0x111bfb;};'use strict';var path=require(_0xd24c('0x0'));var fs=require('fs');var _=require(_0xd24c('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xd24c('0x2'));var util=require('util');var BPromise=require(_0xd24c('0x3'));var jayson=require(_0xd24c('0x4'));var amiClient=jayson[_0xd24c('0x5')]['http']({'port':0x232a});var logger=require(_0xd24c('0x6'))(_0xd24c('0x7'));var Redis=require('ioredis');config[_0xd24c('0x8')]=_[_0xd24c('0x9')](config[_0xd24c('0x8')],{'host':_0xd24c('0xa'),'port':0x18eb});var io=require(_0xd24c('0xb'))(new Redis(config[_0xd24c('0x8')]));var Schema=require(_0xd24c('0xc'));var originateValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xd24c('0xe')]},'callerId':{'type':_0xd24c('0xf')},'callbackUrl':{'type':_0xd24c('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':_0xd24c('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':[!![],_0xd24c('0x11')]},'transferNumber':{'type':_0xd24c('0xf'),'required':[!![],_0xd24c('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':_0xd24c('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd24c('0xd'),'required':[!![],_0xd24c('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd24c('0x10')]}});function emit(_0x3aa193,_0x1a1111,_0x3221a8){logger['info'](_0x3aa193,_0x1a1111,JSON['stringify'](_0x3221a8));io['to'](_0x3aa193)[_0xd24c('0x13')](_0x1a1111,_0x3221a8);}function handleError(_0x34f882){return function(_0x170d59){console['log'](_0xd24c('0x14'),_0x170d59,_0x170d59 instanceof RangeError);logger[_0xd24c('0x15')](_0x170d59[_0xd24c('0x16')]);if(_0x170d59 instanceof RangeError){if(_0x170d59[_0xd24c('0x17')]){delete _0x170d59['name'];}_0x34f882[_0xd24c('0x18')](0x194)['send'](_0x170d59);}else{if(_0x170d59[_0xd24c('0x17')]){delete _0x170d59[_0xd24c('0x17')];}_0x34f882[_0xd24c('0x18')](0x1f4)[_0xd24c('0x19')](_0x170d59);}};}function checkError(){return function(_0x333416){if(!_0x333416){throw new RangeError(_0xd24c('0x1a'));}return _0x333416;};}function respondWithRpcPromise(_0x2f7439,_0x298d73){return new BPromise(function(_0x17375b,_0x206ce7){var _0x48fffd=amiClient;return _0x48fffd[_0xd24c('0x1b')](_0x2f7439,_0x298d73)[_0xd24c('0x1c')](function(_0x2549d0){if(_0x2549d0['error']){if(_0x2549d0[_0xd24c('0x15')][_0xd24c('0x1d')]===0x1f4){return _0x206ce7(_0x2549d0[_0xd24c('0x15')]['message']);}return _0x17375b(_0x2549d0[_0xd24c('0x15')][_0xd24c('0x1e')]);}else{_0x17375b(_0x2549d0[_0xd24c('0x1f')]);}})[_0xd24c('0x20')](function(_0x574cd4){_0x206ce7(_0x574cd4);});});}function getAgent(_0x5ec0b1){return db[_0xd24c('0x21')]['findOne']({'where':{'id':_0x5ec0b1,'role':_0xd24c('0x22')}})[_0xd24c('0x1c')](checkError());}function getAgentCheckSession(_0x325fcc,_0x4c0d99){return new BPromise(function(_0x4cb1b3,_0x26fd85){var _0x14d44a=respondWithRpcPromise(_0xd24c('0x23'));var _0x160f03=getAgent(_0x325fcc);Promise[_0xd24c('0x24')]([_0x14d44a,_0x160f03])[_0xd24c('0x1c')](function(_0x1be144){var _0x20d37f=_0x1be144[0x0];var _0x1c48d6=_0x1be144[0x1];var _0x3b14c7=_[_0xd24c('0x25')](_0x20d37f['rows'],function(_0x4e128b){return _0x4e128b[_0xd24c('0x26')]==_0x1c48d6['id']&&_0x4e128b[_0xd24c('0x27')]==_0x4c0d99;});if(_0x3b14c7[_0xd24c('0x28')]==0x1){_0x4cb1b3(_0x1c48d6);}else{_0x26fd85(new RangeError('sessionId\x20'+_0x4c0d99+'\x20not\x20found!'));}});});}exports[_0xd24c('0x29')]=function(_0x1678e4,_0x34a64c){logger[_0xd24c('0x2a')]('originate\x20fired:',_0x1678e4[_0xd24c('0x2b')]);var _0x2ae0ce=originateValidation[_0xd24c('0xc')](_0x1678e4[_0xd24c('0x2b')]);if(_0x2ae0ce[_0xd24c('0x28')]>0x0){return _0x34a64c[_0xd24c('0x18')](0x190)[_0xd24c('0x2c')](_0x2ae0ce);}var _0x1935f3=_0x1678e4[_0xd24c('0x2b')]['userId'];var _0x4be898=_0x1678e4['body']['callNumber'];var _0x23d014=_0x1678e4[_0xd24c('0x2b')][_0xd24c('0x2d')];var _0x1113a6=_0x1678e4[_0xd24c('0x2b')][_0xd24c('0x2e')];return getAgent(_0x1935f3)[_0xd24c('0x1c')](function(_0x483e3f){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x483e3f[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x483e3f[_0xd24c('0x17')]),'webbar:originate',{'callNumber':_0x4be898,'callerId':_0x23d014,'callbackUrl':_0x1113a6});return _0x34a64c[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'originate\x20executed!'});})[_0xd24c('0x20')](handleError(_0x34a64c));};exports[_0xd24c('0x32')]=function(_0x4bf183,_0x1e5718){logger[_0xd24c('0x2a')]('hangup\x20fired:',_0x4bf183[_0xd24c('0x2b')]);var _0x36d013=hangupValidation[_0xd24c('0xc')](_0x4bf183[_0xd24c('0x2b')]);if(_0x36d013['length']>0x0){return _0x1e5718[_0xd24c('0x18')](0x190)['json'](_0x36d013);}var _0x2a93af=_0x4bf183['body']['userId'];var _0x4b1a7e=_0x4bf183[_0xd24c('0x2b')]['sessionId'];return getAgent(_0x2a93af)['then'](function(_0x66f45){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x66f45[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0x66f45['name']),_0xd24c('0x33'),{'sessionId':_0x4b1a7e});return _0x1e5718[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x34')});})[_0xd24c('0x20')](handleError(_0x1e5718));};exports[_0xd24c('0x35')]=function(_0x17f070,_0xd20086){logger[_0xd24c('0x2a')](_0xd24c('0x36'),_0x17f070['body']);var _0x2607e5=answerValidation[_0xd24c('0xc')](_0x17f070['body']);if(_0x2607e5[_0xd24c('0x28')]>0x0){return _0xd20086[_0xd24c('0x18')](0x190)['json'](_0x2607e5);}var _0x2f2981=_0x17f070['body'][_0xd24c('0x37')];var _0x2d46b8=_0x17f070[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x2f2981)[_0xd24c('0x1c')](function(_0x5bd78b){logger[_0xd24c('0x2a')]('entityFound:',_0x5bd78b[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0x5bd78b[_0xd24c('0x17')]),'webbar:answer',{'sessionId':_0x2d46b8});return _0xd20086[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'answer\x20executed!'});})[_0xd24c('0x20')](handleError(_0xd20086));};exports['hold']=function(_0x548080,_0x5dd31a){logger[_0xd24c('0x2a')](_0xd24c('0x38'),_0x548080['body']);var _0x516734=holdValidation[_0xd24c('0xc')](_0x548080[_0xd24c('0x2b')]);if(_0x516734[_0xd24c('0x28')]>0x0){return _0x5dd31a[_0xd24c('0x18')](0x190)['json'](_0x516734);}var _0x2931b7=_0x548080[_0xd24c('0x2b')]['userId'];var _0x1ee699=_0x548080[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x2931b7)['then'](function(_0x3039aa){logger['info'](_0xd24c('0x2f'),_0x3039aa[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x3039aa['name']),_0xd24c('0x39'),{'sessionId':_0x1ee699});return _0x5dd31a[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x3a')});})[_0xd24c('0x20')](handleError(_0x5dd31a));};exports[_0xd24c('0x3b')]=function(_0x3ce7d0,_0x34321f){logger[_0xd24c('0x2a')](_0xd24c('0x3c'),_0x3ce7d0[_0xd24c('0x2b')]);var _0x5c2b2c=unholdValidation[_0xd24c('0xc')](_0x3ce7d0[_0xd24c('0x2b')]);if(_0x5c2b2c['length']>0x0){return _0x34321f['status'](0x190)['json'](_0x5c2b2c);}var _0x252f2e=_0x3ce7d0[_0xd24c('0x2b')][_0xd24c('0x37')];var _0x4668d2=_0x3ce7d0[_0xd24c('0x2b')][_0xd24c('0x27')];return getAgent(_0x252f2e)[_0xd24c('0x1c')](function(_0xd9b530){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0xd9b530[_0xd24c('0x17')]);emit(util['format'](_0xd24c('0x31'),_0xd9b530[_0xd24c('0x17')]),'webbar:unhold',{'sessionId':_0x4668d2});return _0x34321f[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x3d')});})['catch'](handleError(_0x34321f));};exports['calls']=function(_0xdf1f18,_0xd35f63){logger[_0xd24c('0x2a')](_0xd24c('0x3e'),_0xd35f63[_0xd24c('0x2b')]);var _0x3dee09=callsValidation[_0xd24c('0xc')](_0xdf1f18[_0xd24c('0x2b')]);if(_0x3dee09['length']>0x0){return _0xd35f63[_0xd24c('0x18')](0x190)['json'](_0x3dee09);}var _0x4844fc=_0xdf1f18[_0xd24c('0x2b')]['userId'];var _0x4f6b11=respondWithRpcPromise(_0xd24c('0x23'));var _0x1b649e=getAgent(_0x4844fc);return Promise[_0xd24c('0x24')]([_0x4f6b11,_0x1b649e])[_0xd24c('0x1c')](function(_0x4890d6){var _0x66db4a=_0x4890d6[0x0];var _0x1e99e7=_0x4890d6[0x1];var _0x3e6c3b=_[_0xd24c('0x25')](_0x66db4a[_0xd24c('0x3f')],function(_0xcb46e8){return _0xcb46e8[_0xd24c('0x26')]==_0x1e99e7['id'];});return _0xd35f63['status'](0xc8)['json']({'count':_0x3e6c3b['length'],'rows':_0x3e6c3b});})[_0xd24c('0x20')](handleError(_0xd35f63));};exports[_0xd24c('0x40')]=function(_0x42a917,_0x186042){logger[_0xd24c('0x2a')](_0xd24c('0x41'),_0x42a917['body']);var _0x1f2632=conferenceValidation[_0xd24c('0xc')](_0x42a917['body']);if(_0x1f2632[_0xd24c('0x28')]>0x0){return _0x186042[_0xd24c('0x18')](0x190)[_0xd24c('0x2c')](_0x1f2632);}var _0x45030d=_0x42a917[_0xd24c('0x2b')]['userId'];return getAgent(_0x45030d)['then'](function(_0x2a6d13){logger[_0xd24c('0x2a')]('entityFound:',_0x2a6d13[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')]('user:%s',_0x2a6d13[_0xd24c('0x17')]),_0xd24c('0x42'));return _0x186042[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':_0xd24c('0x43')});})[_0xd24c('0x20')](handleError(_0x186042));};exports[_0xd24c('0x44')]=function(_0x4af868,_0x522587){logger['info'](_0xd24c('0x45'),_0x4af868['body']);var _0x5293b4=transferValidation['validate'](_0x4af868[_0xd24c('0x2b')]);if(_0x5293b4[_0xd24c('0x28')]>0x0){return _0x522587[_0xd24c('0x18')](0x190)['json'](_0x5293b4);}var _0x312c4c=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x37')];var _0x2daf65=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x27')];var _0x52567d=_0x4af868[_0xd24c('0x2b')][_0xd24c('0x46')];return getAgent(_0x312c4c)['then'](function(_0x24ede8){logger[_0xd24c('0x2a')](_0xd24c('0x2f'),_0x24ede8[_0xd24c('0x17')]);emit(util[_0xd24c('0x30')](_0xd24c('0x31'),_0x24ede8[_0xd24c('0x17')]),_0xd24c('0x47'),{'sessionId':_0x2daf65,'transferNumber':_0x52567d});return _0x522587[_0xd24c('0x18')](0xc8)[_0xd24c('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0xd24c('0x20')](handleError(_0x522587));}; \ No newline at end of file +var _0xf021=['conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','log','handleError:','stack','name','status','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','info','originate\x20fired:','body','json','userId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','format','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','VoiceChannels'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xf021,0x18f));var _0x1f02=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0xf021[_0x5d4f12];return _0x4eb577;};'use strict';var path=require(_0x1f02('0x0'));var fs=require('fs');var _=require(_0x1f02('0x1'));var db=require(_0x1f02('0x2'))['db'];var config=require(_0x1f02('0x3'));var util=require(_0x1f02('0x4'));var BPromise=require('bluebird');var jayson=require(_0x1f02('0x5'));var amiClient=jayson['client'][_0x1f02('0x6')]({'port':0x232a});var logger=require(_0x1f02('0x7'))('webbarapi');var Redis=require('ioredis');config[_0x1f02('0x8')]=_['defaults'](config[_0x1f02('0x8')],{'host':_0x1f02('0x9'),'port':0x18eb});var io=require(_0x1f02('0xa'))(new Redis(config[_0x1f02('0x8')]));var Schema=require(_0x1f02('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1f02('0xc')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x1f02('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]},'sessionId':{'type':_0x1f02('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1f02('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]},'sessionId':{'type':'string','required':[!![],_0x1f02('0xf')]},'transferNumber':{'type':_0x1f02('0xd'),'required':[!![],_0x1f02('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]},'sessionId':{'type':_0x1f02('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1f02('0xe'),'required':[!![],_0x1f02('0xc')]}});function emit(_0x3b0a3d,_0x4b76f7,_0x2e602d){logger['info'](_0x3b0a3d,_0x4b76f7,JSON['stringify'](_0x2e602d));io['to'](_0x3b0a3d)['emit'](_0x4b76f7,_0x2e602d);}function handleError(_0x5f4e55){return function(_0x4d1e4f){console[_0x1f02('0x11')](_0x1f02('0x12'),_0x4d1e4f,_0x4d1e4f instanceof RangeError);logger['error'](_0x4d1e4f[_0x1f02('0x13')]);if(_0x4d1e4f instanceof RangeError){if(_0x4d1e4f[_0x1f02('0x14')]){delete _0x4d1e4f[_0x1f02('0x14')];}_0x5f4e55[_0x1f02('0x15')](0x194)['send'](_0x4d1e4f);}else{if(_0x4d1e4f['name']){delete _0x4d1e4f[_0x1f02('0x14')];}_0x5f4e55[_0x1f02('0x15')](0x1f4)['send'](_0x4d1e4f);}};}function checkError(){return function(_0x5b399a){if(!_0x5b399a){throw new RangeError(_0x1f02('0x16'));}return _0x5b399a;};}function respondWithRpcPromise(_0xbdf82a,_0x2f637d){return new BPromise(function(_0xbabbd7,_0x480297){var _0x12c4af=amiClient;return _0x12c4af[_0x1f02('0x17')](_0xbdf82a,_0x2f637d)[_0x1f02('0x18')](function(_0x2f422c){if(_0x2f422c[_0x1f02('0x19')]){if(_0x2f422c[_0x1f02('0x19')][_0x1f02('0x1a')]===0x1f4){return _0x480297(_0x2f422c['error'][_0x1f02('0x1b')]);}return _0xbabbd7(_0x2f422c[_0x1f02('0x19')]['message']);}else{_0xbabbd7(_0x2f422c[_0x1f02('0x1c')]);}})[_0x1f02('0x1d')](function(_0x575a86){_0x480297(_0x575a86);});});}function getAgent(_0x57bb58){return db[_0x1f02('0x1e')][_0x1f02('0x1f')]({'where':{'id':_0x57bb58,'role':_0x1f02('0x20')}})[_0x1f02('0x18')](checkError());}function getAgentCheckSession(_0x3f5c5e,_0x3f5577){return new BPromise(function(_0x297cf4,_0x4c8891){var _0x4d5f7e=respondWithRpcPromise('VoiceChannels');var _0x3ef4bf=getAgent(_0x3f5c5e);Promise[_0x1f02('0x21')]([_0x4d5f7e,_0x3ef4bf])[_0x1f02('0x18')](function(_0x496afd){var _0x5c2c42=_0x496afd[0x0];var _0x227567=_0x496afd[0x1];var _0x6e88d5=_[_0x1f02('0x22')](_0x5c2c42[_0x1f02('0x23')],function(_0x220345){return _0x220345[_0x1f02('0x24')]==_0x227567['id']&&_0x220345[_0x1f02('0x25')]==_0x3f5577;});if(_0x6e88d5[_0x1f02('0x26')]==0x1){_0x297cf4(_0x227567);}else{_0x4c8891(new RangeError(_0x1f02('0x27')+_0x3f5577+_0x1f02('0x28')));}});});}exports['originate']=function(_0x137e06,_0x5ab7a2){logger[_0x1f02('0x29')](_0x1f02('0x2a'),_0x137e06[_0x1f02('0x2b')]);var _0x2bf78e=originateValidation[_0x1f02('0xb')](_0x137e06[_0x1f02('0x2b')]);if(_0x2bf78e['length']>0x0){return _0x5ab7a2['status'](0x190)[_0x1f02('0x2c')](_0x2bf78e);}var _0x15e655=_0x137e06['body'][_0x1f02('0x2d')];var _0x4d1aec=_0x137e06[_0x1f02('0x2b')]['callNumber'];var _0x3c473f=_0x137e06['body']['callerId'];var _0x26f33e=_0x137e06[_0x1f02('0x2b')][_0x1f02('0x2e')];return getAgent(_0x15e655)[_0x1f02('0x18')](function(_0x55c9a3){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x55c9a3[_0x1f02('0x14')]);emit(util['format'](_0x1f02('0x30'),_0x55c9a3[_0x1f02('0x14')]),_0x1f02('0x31'),{'callNumber':_0x4d1aec,'callerId':_0x3c473f,'callbackUrl':_0x26f33e});return _0x5ab7a2[_0x1f02('0x15')](0xc8)[_0x1f02('0x2c')]({'error':![],'message':_0x1f02('0x32')});})['catch'](handleError(_0x5ab7a2));};exports[_0x1f02('0x33')]=function(_0x143e18,_0x1ad162){logger['info'](_0x1f02('0x34'),_0x143e18['body']);var _0x1e4fe5=hangupValidation['validate'](_0x143e18['body']);if(_0x1e4fe5[_0x1f02('0x26')]>0x0){return _0x1ad162['status'](0x190)['json'](_0x1e4fe5);}var _0x3ec5bd=_0x143e18[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x9b0e0=_0x143e18['body'][_0x1f02('0x25')];return getAgent(_0x3ec5bd)['then'](function(_0x2cd179){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x2cd179[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x2cd179[_0x1f02('0x14')]),_0x1f02('0x36'),{'sessionId':_0x9b0e0});return _0x1ad162[_0x1f02('0x15')](0xc8)['json']({'error':![],'message':_0x1f02('0x37')});})['catch'](handleError(_0x1ad162));};exports[_0x1f02('0x38')]=function(_0x544301,_0x3d895a){logger[_0x1f02('0x29')](_0x1f02('0x39'),_0x544301['body']);var _0x5938e1=answerValidation[_0x1f02('0xb')](_0x544301[_0x1f02('0x2b')]);if(_0x5938e1[_0x1f02('0x26')]>0x0){return _0x3d895a[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x5938e1);}var _0x15fb49=_0x544301[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x391b57=_0x544301['body'][_0x1f02('0x25')];return getAgent(_0x15fb49)['then'](function(_0x51c8be){logger[_0x1f02('0x29')]('entityFound:',_0x51c8be['name']);emit(util[_0x1f02('0x35')]('user:%s',_0x51c8be['name']),_0x1f02('0x3a'),{'sessionId':_0x391b57});return _0x3d895a[_0x1f02('0x15')](0xc8)['json']({'error':![],'message':_0x1f02('0x3b')});})[_0x1f02('0x1d')](handleError(_0x3d895a));};exports[_0x1f02('0x3c')]=function(_0x3b1f5b,_0x5d45db){logger[_0x1f02('0x29')](_0x1f02('0x3d'),_0x3b1f5b[_0x1f02('0x2b')]);var _0x4d03ad=holdValidation[_0x1f02('0xb')](_0x3b1f5b[_0x1f02('0x2b')]);if(_0x4d03ad[_0x1f02('0x26')]>0x0){return _0x5d45db[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x4d03ad);}var _0x282e5b=_0x3b1f5b[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x1abfaa=_0x3b1f5b[_0x1f02('0x2b')]['sessionId'];return getAgent(_0x282e5b)[_0x1f02('0x18')](function(_0x50d5ed){logger[_0x1f02('0x29')]('entityFound:',_0x50d5ed[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x50d5ed[_0x1f02('0x14')]),_0x1f02('0x3e'),{'sessionId':_0x1abfaa});return _0x5d45db[_0x1f02('0x15')](0xc8)[_0x1f02('0x2c')]({'error':![],'message':_0x1f02('0x3f')});})[_0x1f02('0x1d')](handleError(_0x5d45db));};exports[_0x1f02('0x40')]=function(_0x1241c5,_0x5792d8){logger[_0x1f02('0x29')](_0x1f02('0x41'),_0x1241c5[_0x1f02('0x2b')]);var _0x102551=unholdValidation[_0x1f02('0xb')](_0x1241c5[_0x1f02('0x2b')]);if(_0x102551[_0x1f02('0x26')]>0x0){return _0x5792d8[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x102551);}var _0x587d60=_0x1241c5[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x3e46c6=_0x1241c5[_0x1f02('0x2b')][_0x1f02('0x25')];return getAgent(_0x587d60)['then'](function(_0x12c1fb){logger['info'](_0x1f02('0x2f'),_0x12c1fb[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x12c1fb[_0x1f02('0x14')]),_0x1f02('0x42'),{'sessionId':_0x3e46c6});return _0x5792d8[_0x1f02('0x15')](0xc8)[_0x1f02('0x2c')]({'error':![],'message':_0x1f02('0x43')});})[_0x1f02('0x1d')](handleError(_0x5792d8));};exports['calls']=function(_0x4a43eb,_0x4d084c){logger[_0x1f02('0x29')]('calls\x20fired:',_0x4d084c[_0x1f02('0x2b')]);var _0x449d58=callsValidation['validate'](_0x4a43eb[_0x1f02('0x2b')]);if(_0x449d58['length']>0x0){return _0x4d084c['status'](0x190)['json'](_0x449d58);}var _0x24192d=_0x4a43eb[_0x1f02('0x2b')][_0x1f02('0x2d')];var _0x390df6=respondWithRpcPromise(_0x1f02('0x44'));var _0x3321b3=getAgent(_0x24192d);return Promise['all']([_0x390df6,_0x3321b3])[_0x1f02('0x18')](function(_0xdd2e2b){var _0x496e3c=_0xdd2e2b[0x0];var _0x5c2745=_0xdd2e2b[0x1];var _0x2b0e0d=_[_0x1f02('0x22')](_0x496e3c[_0x1f02('0x23')],function(_0x47efdf){return _0x47efdf[_0x1f02('0x24')]==_0x5c2745['id'];});return _0x4d084c['status'](0xc8)[_0x1f02('0x2c')]({'count':_0x2b0e0d['length'],'rows':_0x2b0e0d});})[_0x1f02('0x1d')](handleError(_0x4d084c));};exports[_0x1f02('0x45')]=function(_0xd7be3b,_0x2b54ac){logger[_0x1f02('0x29')](_0x1f02('0x46'),_0xd7be3b[_0x1f02('0x2b')]);var _0x4ca1d9=conferenceValidation[_0x1f02('0xb')](_0xd7be3b[_0x1f02('0x2b')]);if(_0x4ca1d9[_0x1f02('0x26')]>0x0){return _0x2b54ac[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x4ca1d9);}var _0x2e9881=_0xd7be3b[_0x1f02('0x2b')][_0x1f02('0x2d')];return getAgent(_0x2e9881)[_0x1f02('0x18')](function(_0x3a465f){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x3a465f['name']);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x3a465f['name']),_0x1f02('0x47'));return _0x2b54ac[_0x1f02('0x15')](0xc8)['json']({'error':![],'message':_0x1f02('0x48')});})[_0x1f02('0x1d')](handleError(_0x2b54ac));};exports[_0x1f02('0x49')]=function(_0x4b3b3e,_0x4b8f28){logger[_0x1f02('0x29')](_0x1f02('0x4a'),_0x4b3b3e[_0x1f02('0x2b')]);var _0x3ce624=transferValidation[_0x1f02('0xb')](_0x4b3b3e[_0x1f02('0x2b')]);if(_0x3ce624[_0x1f02('0x26')]>0x0){return _0x4b8f28[_0x1f02('0x15')](0x190)[_0x1f02('0x2c')](_0x3ce624);}var _0x2ed1d7=_0x4b3b3e['body'][_0x1f02('0x2d')];var _0x5f054b=_0x4b3b3e['body'][_0x1f02('0x25')];var _0xe7dde7=_0x4b3b3e[_0x1f02('0x2b')][_0x1f02('0x4b')];return getAgent(_0x2ed1d7)[_0x1f02('0x18')](function(_0x6b73f5){logger[_0x1f02('0x29')](_0x1f02('0x2f'),_0x6b73f5[_0x1f02('0x14')]);emit(util[_0x1f02('0x35')](_0x1f02('0x30'),_0x6b73f5[_0x1f02('0x14')]),_0x1f02('0x4c'),{'sessionId':_0x5f054b,'transferNumber':_0xe7dde7});return _0x4b8f28['status'](0xc8)['json']({'error':![],'message':_0x1f02('0x4d')});})[_0x1f02('0x1d')](handleError(_0x4b8f28));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 080f27f..63903c7 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 _0x8952=['getAgents','/:id/applications','create','/:id/dispositions','addDisposition','post','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','getAnswers'];(function(_0x2dd12b,_0xfdecd1){var _0x52f081=function(_0x33fea2){while(--_0x33fea2){_0x2dd12b['push'](_0x2dd12b['shift']());}};_0x52f081(++_0xfdecd1);}(_0x8952,0x17e));var _0x2895=function(_0x1535fb,_0x591028){_0x1535fb=_0x1535fb-0x0;var _0x4cbb85=_0x8952[_0x1535fb];return _0x4cbb85;};'use strict';var multer=require('multer');var util=require(_0x2895('0x0'));var path=require(_0x2895('0x1'));var timeout=require(_0x2895('0x2'));var express=require(_0x2895('0x3'));var router=express[_0x2895('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2895('0x5'));var interaction=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var controller=require('./whatsappAccount.controller');router[_0x2895('0x8')]('/',auth[_0x2895('0x9')](),controller[_0x2895('0xa')]);router['get']('/describe',auth[_0x2895('0x9')](),controller[_0x2895('0xb')]);router[_0x2895('0x8')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller['show']);router[_0x2895('0x8')]('/:id/dispositions',auth[_0x2895('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x2895('0x9')](),controller[_0x2895('0xd')]);router[_0x2895('0x8')]('/:id/users',auth[_0x2895('0x9')](),controller[_0x2895('0xe')]);router['get'](_0x2895('0xf'),auth[_0x2895('0x9')](),controller['getApplications']);router['post']('/',auth[_0x2895('0x9')](),controller[_0x2895('0x10')]);router['post'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller[_0x2895('0x12')]);router[_0x2895('0x13')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller[_0x2895('0x15')]);router[_0x2895('0x13')](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x17')]);router[_0x2895('0x13')](_0x2895('0xf'),auth[_0x2895('0x9')](),controller[_0x2895('0x18')]);router[_0x2895('0x13')](_0x2895('0x19'),controller[_0x2895('0x1a')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x2895('0x1b')]);router[_0x2895('0x1c')](_0x2895('0xc'),auth['isAuthenticated'](),controller[_0x2895('0x1d')]);router[_0x2895('0x1e')](_0x2895('0xc'),auth[_0x2895('0x9')](),controller[_0x2895('0x1f')]);router['delete'](_0x2895('0x11'),auth[_0x2895('0x9')](),controller['removeDispositions']);router[_0x2895('0x1e')](_0x2895('0x14'),auth[_0x2895('0x9')](),controller['removeAnswers']);router['delete'](_0x2895('0x16'),auth[_0x2895('0x9')](),controller[_0x2895('0x20')]);module['exports']=router; \ No newline at end of file +var _0xef0f=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','removeAnswers','exports'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xef0f,0x168));var _0xfef0=function(_0x4723f3,_0x19f729){_0x4723f3=_0x4723f3-0x0;var _0x12b53d=_0xef0f[_0x4723f3];return _0x12b53d;};'use strict';var multer=require(_0xfef0('0x0'));var util=require('util');var path=require(_0xfef0('0x1'));var timeout=require(_0xfef0('0x2'));var express=require(_0xfef0('0x3'));var router=express['Router']();var fs_extra=require(_0xfef0('0x4'));var auth=require(_0xfef0('0x5'));var interaction=require(_0xfef0('0x6'));var config=require('../../config/environment');var controller=require(_0xfef0('0x7'));router[_0xfef0('0x8')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0xa')]);router[_0xfef0('0x8')](_0xfef0('0xb'),auth['isAuthenticated'](),controller[_0xfef0('0xc')]);router['get'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller[_0xfef0('0xe')]);router[_0xfef0('0x8')](_0xfef0('0xf'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x8')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x8')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller['getAgents']);router[_0xfef0('0x8')](_0xfef0('0x14'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x15')]);router[_0xfef0('0x16')]('/',auth[_0xfef0('0x9')](),controller[_0xfef0('0x17')]);router['post'](_0xfef0('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x18')]);router[_0xfef0('0x16')](_0xfef0('0x13'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x19')]);router[_0xfef0('0x16')]('/:id/applications',auth[_0xfef0('0x9')](),controller[_0xfef0('0x1a')]);router[_0xfef0('0x16')](_0xfef0('0x1b'),controller[_0xfef0('0x1c')]);router['post'](_0xfef0('0x1d'),auth['isAuthenticated'](),controller[_0xfef0('0x1e')]);router[_0xfef0('0x1f')](_0xfef0('0xd'),auth['isAuthenticated'](),controller[_0xfef0('0x20')]);router['delete'](_0xfef0('0xd'),auth[_0xfef0('0x9')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0xfef0('0x9')](),controller['removeDispositions']);router[_0xfef0('0x21')](_0xfef0('0x11'),auth[_0xfef0('0x9')](),controller[_0xfef0('0x22')]);router[_0xfef0('0x21')](_0xfef0('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xfef0('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 7b76280..791e94a 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 _0x3804=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3804,0xe3));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4380('0x0'));var rs=require(_0x4380('0x1'));module[_0x4380('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x4380('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x4380('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4380('0x4')],'defaultValue':function(){return rs[_0x4380('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4380('0x6')](_0x4380('0x7'),'sinch')},'accountSid':{'type':Sequelize[_0x4380('0x4')]},'baseUrl':{'type':Sequelize[_0x4380('0x4')]},'authToken':{'type':Sequelize[_0x4380('0x4')]},'notificationTemplate':{'type':Sequelize[_0x4380('0x8')],'defaultValue':function(){return _0x4380('0x9');}},'notificationSound':{'type':Sequelize[_0x4380('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4380('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4380('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4380('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4380('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4380('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4380('0xb')],'comment':_0x4380('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x4380('0xa')],'defaultValue':![],'comment':_0x4380('0xd'),'set':function(_0x4ba90f){if(!_0x4ba90f){this[_0x4380('0xe')](_0x4380('0xf'),null);}this[_0x4380('0xe')](_0x4380('0x10'),_0x4ba90f);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x48f6=['generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','name'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x48f6,0x168));var _0x648f=function(_0x1b85fe,_0x1b8b6b){_0x1b85fe=_0x1b85fe-0x0;var _0x50d28a=_0x48f6[_0x1b85fe];return _0x50d28a;};'use strict';var Sequelize=require(_0x648f('0x0'));var rs=require('randomstring');module[_0x648f('0x1')]={'name':{'type':Sequelize[_0x648f('0x2')],'unique':_0x648f('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x648f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x648f('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x648f('0x4')]();}},'phone':{'type':Sequelize[_0x648f('0x2')]},'type':{'type':Sequelize[_0x648f('0x5')]('twilio',_0x648f('0x6'))},'accountSid':{'type':Sequelize[_0x648f('0x2')]},'baseUrl':{'type':Sequelize[_0x648f('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x648f('0x7')],'defaultValue':function(){return _0x648f('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x648f('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x648f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x648f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x648f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x648f('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x648f('0xb'),'set':function(_0x7c79ea){if(!_0x7c79ea){this[_0x648f('0xc')]('mandatoryDispositionPauseId',null);}this[_0x648f('0xc')]('mandatoryDisposition',_0x7c79ea);}},'description':{'type':Sequelize[_0x648f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 12a8256..f2837a7 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 _0xf148=['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','redis','./whatsappAccount.socket','register','jayson/promise','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','WhatsappAccount','includeAll','include','rows','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','update','body','describe','addDisposition','WhatsappAccountId','Disposition','findAll','removeDispositions','ids','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','emit','findOne','getAgents','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','from','replace','Body','messageId','MessageSid','notifications','isNil','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','defaults','contact','WhatsappInteraction','interaction','created','push','close','*,*,*,*','ContactId','AttachmentId','User','UserId','unshift','agent','startRouting','Start','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','text/xml','send','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','spread','dataValues','eml-format','mustache','util','sox','to-csv','ejs'];(function(_0x526b0a,_0x3b7bec){var _0x5570b7=function(_0x3dfdf5){while(--_0x3dfdf5){_0x526b0a['push'](_0x526b0a['shift']());}};_0x5570b7(++_0x3b7bec);}(_0xf148,0xb9));var _0x8f14=function(_0x39ce05,_0x18c6fd){_0x39ce05=_0x39ce05-0x0;var _0x54a842=_0xf148[_0x39ce05];return _0x54a842;};'use strict';var emlformat=require(_0x8f14('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8f14('0x1'));var util=require(_0x8f14('0x2'));var path=require('path');var sox=require(_0x8f14('0x3'));var csv=require(_0x8f14('0x4'));var ejs=require(_0x8f14('0x5'));var fs=require('fs');var fs_extra=require(_0x8f14('0x6'));var _=require(_0x8f14('0x7'));var squel=require(_0x8f14('0x8'));var crypto=require(_0x8f14('0x9'));var jsforce=require(_0x8f14('0xa'));var deskjs=require(_0x8f14('0xb'));var toCsv=require(_0x8f14('0x4'));var querystring=require('querystring');var Papa=require(_0x8f14('0xc'));var Redis=require(_0x8f14('0xd'));var authService=require(_0x8f14('0xe'));var qs=require(_0x8f14('0xf'));var as=require(_0x8f14('0x10'));var hardwareService=require(_0x8f14('0x11'));var logger=require(_0x8f14('0x12'))(_0x8f14('0x13'));var utils=require(_0x8f14('0x14'));var config=require(_0x8f14('0x15'));var licenseUtil=require(_0x8f14('0x16'));var db=require('../../mysqldb')['db'];config[_0x8f14('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f14('0x17')]));require(_0x8f14('0x18'))[_0x8f14('0x19')](socket);var jayson=require(_0x8f14('0x1a'));var client=jayson['client'][_0x8f14('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x306476,_0x490b79,_0x3cd412,_0x1c900f){return new BPromise(function(_0x4c164f,_0x19c2f4){var _0x44ee84=_0x1c900f||client;return _0x44ee84[_0x8f14('0x1c')](_0x306476,_0x3cd412)[_0x8f14('0x1d')](function(_0x11099b){logger[_0x8f14('0x1e')](_0x8f14('0x1f'),_0x490b79,_0x8f14('0x20'));logger[_0x8f14('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x490b79,_0x8f14('0x20'),JSON[_0x8f14('0x22')](_0x11099b));if(_0x11099b['error']){if(_0x11099b[_0x8f14('0x23')][_0x8f14('0x24')]===0x1f4){logger[_0x8f14('0x23')](_0x8f14('0x1f'),_0x490b79,_0x11099b[_0x8f14('0x23')][_0x8f14('0x25')]);return _0x19c2f4(_0x11099b['error'][_0x8f14('0x25')]);}logger[_0x8f14('0x23')](_0x8f14('0x1f'),_0x490b79,_0x11099b['error']['message']);return _0x4c164f(_0x11099b[_0x8f14('0x23')][_0x8f14('0x25')]);}else{logger[_0x8f14('0x1e')](_0x8f14('0x1f'),_0x490b79,_0x8f14('0x20'));_0x4c164f(_0x11099b[_0x8f14('0x26')][_0x8f14('0x25')]);}})[_0x8f14('0x27')](function(_0x42d42f){logger[_0x8f14('0x23')](_0x8f14('0x1f'),_0x490b79,_0x42d42f);_0x19c2f4(_0x42d42f);});});}function respondWithStatusCode(_0x5b02a7,_0x4b13c6){_0x4b13c6=_0x4b13c6||0xcc;return function(_0x34b096){if(_0x34b096){return _0x5b02a7[_0x8f14('0x28')](_0x4b13c6);}return _0x5b02a7['status'](_0x4b13c6)[_0x8f14('0x29')]();};}function respondWithResult(_0x3421bf,_0x4f56fc){_0x4f56fc=_0x4f56fc||0xc8;return function(_0x10a893){if(_0x10a893){return _0x3421bf['status'](_0x4f56fc)[_0x8f14('0x2a')](_0x10a893);}};}function respondWithFilteredResult(_0x1328bf,_0x168cae){return function(_0xa31075){if(_0xa31075){var _0x521021=typeof _0x168cae[_0x8f14('0x2b')]===_0x8f14('0x2c')&&typeof _0x168cae[_0x8f14('0x2d')]===_0x8f14('0x2c');var _0x515ace=_0xa31075[_0x8f14('0x2e')];var _0x277b3a=_0x521021?0x0:_0x168cae[_0x8f14('0x2b')];var _0x245aba=_0x521021?_0xa31075['count']:_0x168cae[_0x8f14('0x2b')]+_0x168cae[_0x8f14('0x2d')];var _0x22759e;if(_0x245aba>=_0x515ace){_0x245aba=_0x515ace;_0x22759e=0xc8;}else{_0x22759e=0xce;}_0x1328bf[_0x8f14('0x2f')](_0x22759e);return _0x1328bf['set'](_0x8f14('0x30'),_0x277b3a+'-'+_0x245aba+'/'+_0x515ace)[_0x8f14('0x2a')](_0xa31075);}return null;};}function patchUpdates(_0x3ecc74){return function(_0x1e9bb8){try{jsonpatch[_0x8f14('0x31')](_0x1e9bb8,_0x3ecc74,!![]);}catch(_0x25dea5){return BPromise['reject'](_0x25dea5);}return _0x1e9bb8[_0x8f14('0x32')]();};}function saveUpdates(_0x1e8425,_0x4a8629){return function(_0x391cc4){if(_0x391cc4){return _0x391cc4['update'](_0x1e8425)[_0x8f14('0x1d')](function(_0x5733e2){return _0x5733e2;});}return null;};}function removeEntity(_0x1e09ff,_0x208fac){return function(_0x29847d){if(_0x29847d){return _0x29847d[_0x8f14('0x33')]()[_0x8f14('0x1d')](function(){var _0x1f2906=_0x29847d[_0x8f14('0x34')]({'plain':!![]});var _0x30a4af=_0x8f14('0x35');return db[_0x8f14('0x36')]['destroy']({'where':{'type':_0x30a4af,'resourceId':_0x1f2906['id']}})[_0x8f14('0x1d')](function(){return _0x29847d;});})[_0x8f14('0x1d')](function(){_0x1e09ff[_0x8f14('0x2f')](0xcc)[_0x8f14('0x29')]();});}};}function handleEntityNotFound(_0x138e04,_0x504137){return function(_0x28b3cf){if(!_0x28b3cf){_0x138e04[_0x8f14('0x28')](0x194);}return _0x28b3cf;};}function handleError(_0x34517d,_0xcb7f00){_0xcb7f00=_0xcb7f00||0x1f4;return function(_0xe13ccc){logger['error'](_0xe13ccc[_0x8f14('0x37')]);if(_0xe13ccc['name']){delete _0xe13ccc[_0x8f14('0x38')];}_0x34517d['status'](_0xcb7f00)['send'](_0xe13ccc);};}exports['index']=function(_0x374f09,_0x190910){var _0x10518a={'include':[{'model':db[_0x8f14('0x39')],'as':_0x8f14('0x3a')}]},_0x4ddf5c={},_0x52d302={'count':0x0,'rows':[]};var _0x55bde8=_[_0x8f14('0x3b')](db['WhatsappAccount'][_0x8f14('0x3c')],function(_0x3c5fa7){return{'name':_0x3c5fa7[_0x8f14('0x3d')],'type':_0x3c5fa7[_0x8f14('0x3e')][_0x8f14('0x3f')]};});_0x4ddf5c[_0x8f14('0x40')]=_[_0x8f14('0x3b')](_0x55bde8,_0x8f14('0x38'));_0x4ddf5c[_0x8f14('0x41')]=_[_0x8f14('0x42')](_0x374f09[_0x8f14('0x41')]);_0x4ddf5c[_0x8f14('0x43')]=_[_0x8f14('0x44')](_0x4ddf5c[_0x8f14('0x40')],_0x4ddf5c[_0x8f14('0x41')]);_0x10518a['attributes']=_[_0x8f14('0x44')](_0x4ddf5c['model'],qs[_0x8f14('0x45')](_0x374f09[_0x8f14('0x41')]['fields']));_0x10518a[_0x8f14('0x46')]=_0x10518a[_0x8f14('0x46')][_0x8f14('0x47')]?_0x10518a[_0x8f14('0x46')]:_0x4ddf5c[_0x8f14('0x40')];if(!_0x374f09[_0x8f14('0x41')]['hasOwnProperty'](_0x8f14('0x48'))){_0x10518a['limit']=qs['limit'](_0x374f09['query'][_0x8f14('0x2d')]);_0x10518a[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0x374f09[_0x8f14('0x41')][_0x8f14('0x2b')]);}_0x10518a[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_0x374f09[_0x8f14('0x41')]['sort']);_0x10518a[_0x8f14('0x4b')]=qs['filters'](_[_0x8f14('0x4c')](_0x374f09[_0x8f14('0x41')],_0x4ddf5c[_0x8f14('0x43')]),_0x55bde8);if(_0x374f09[_0x8f14('0x41')][_0x8f14('0x4d')]){_0x10518a[_0x8f14('0x4b')]=_['merge'](_0x10518a[_0x8f14('0x4b')],{'$or':_[_0x8f14('0x3b')](_0x55bde8,function(_0x5a95f7){if(_0x5a95f7['type']!==_0x8f14('0x4e')){var _0x27de27={};_0x27de27[_0x5a95f7[_0x8f14('0x38')]]={'$like':'%'+_0x374f09[_0x8f14('0x41')][_0x8f14('0x4d')]+'%'};return _0x27de27;}})});}_0x10518a=_[_0x8f14('0x4f')]({},_0x10518a,_0x374f09[_0x8f14('0x50')]);var _0x4ac0bd={'where':_0x10518a[_0x8f14('0x4b')]};return db[_0x8f14('0x51')]['count'](_0x4ac0bd)[_0x8f14('0x1d')](function(_0x16071d){_0x52d302[_0x8f14('0x2e')]=_0x16071d;if(_0x374f09[_0x8f14('0x41')][_0x8f14('0x52')]){_0x10518a[_0x8f14('0x53')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x10518a);})[_0x8f14('0x1d')](function(_0x2b5acf){_0x52d302[_0x8f14('0x54')]=_0x2b5acf;return _0x52d302;})['then'](respondWithFilteredResult(_0x190910,_0x10518a))[_0x8f14('0x27')](handleError(_0x190910,null));};exports['show']=function(_0x2131df,_0x5a4325){var _0x4cd339={'raw':![],'where':{'id':_0x2131df[_0x8f14('0x55')]['id']},'include':[{'model':db[_0x8f14('0x39')],'as':'mandatoryDispositionPause'}]},_0x4bda9c={};_0x4bda9c['model']=_[_0x8f14('0x42')](db[_0x8f14('0x51')][_0x8f14('0x3c')]);_0x4bda9c[_0x8f14('0x41')]=_[_0x8f14('0x42')](_0x2131df['query']);_0x4bda9c[_0x8f14('0x43')]=_[_0x8f14('0x44')](_0x4bda9c[_0x8f14('0x40')],_0x4bda9c[_0x8f14('0x41')]);_0x4cd339[_0x8f14('0x46')]=_[_0x8f14('0x44')](_0x4bda9c[_0x8f14('0x40')],qs['fields'](_0x2131df[_0x8f14('0x41')][_0x8f14('0x45')]));_0x4cd339[_0x8f14('0x46')]=_0x4cd339[_0x8f14('0x46')][_0x8f14('0x47')]?_0x4cd339[_0x8f14('0x46')]:_0x4bda9c['model'];if(_0x2131df['query'][_0x8f14('0x52')]){_0x4cd339[_0x8f14('0x53')]=[{'all':!![]}];}_0x4cd339=_[_0x8f14('0x4f')]({},_0x4cd339,_0x2131df[_0x8f14('0x50')]);return db['WhatsappAccount']['find'](_0x4cd339)[_0x8f14('0x1d')](handleEntityNotFound(_0x5a4325,null))['then'](respondWithResult(_0x5a4325,null))['catch'](handleError(_0x5a4325,null));};exports[_0x8f14('0x56')]=function(_0x5f20b7,_0x38b386){return db[_0x8f14('0x51')][_0x8f14('0x56')](_0x5f20b7['body'],{})[_0x8f14('0x1d')](function(_0xa954bb){var _0x2d4d62=_0x5f20b7[_0x8f14('0x57')]['get']({'plain':!![]});if(!_0x2d4d62)throw new Error(_0x8f14('0x58'));if(_0x2d4d62[_0x8f14('0x59')]===_0x8f14('0x57')){var _0x2a4fbe=_0xa954bb['get']({'plain':!![]});var _0x4cc543=_0x8f14('0x35');return db[_0x8f14('0x5a')][_0x8f14('0x5b')]({'where':{'name':_0x4cc543,'userProfileId':_0x2d4d62[_0x8f14('0x5c')]},'raw':!![]})['then'](function(_0x1043e6){if(_0x1043e6&&_0x1043e6['autoAssociation']===0x0){return db[_0x8f14('0x36')][_0x8f14('0x56')]({'name':_0x2a4fbe['name'],'resourceId':_0x2a4fbe['id'],'type':_0x1043e6[_0x8f14('0x38')],'sectionId':_0x1043e6['id']},{})[_0x8f14('0x1d')](function(){return _0xa954bb;});}else{return _0xa954bb;}})['catch'](function(_0x49d1d6){logger[_0x8f14('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49d1d6);throw _0x49d1d6;});}return _0xa954bb;})[_0x8f14('0x1d')](respondWithResult(_0x38b386,0xc9))[_0x8f14('0x27')](handleError(_0x38b386,null));};exports[_0x8f14('0x5d')]=function(_0x5d92ae,_0x55047d){if(_0x5d92ae['body']['id']){delete _0x5d92ae[_0x8f14('0x5e')]['id'];}return db[_0x8f14('0x51')][_0x8f14('0x5b')]({'where':{'id':_0x5d92ae['params']['id']},'include':[{'model':db['Pause'],'as':_0x8f14('0x3a')}]})[_0x8f14('0x1d')](handleEntityNotFound(_0x55047d,null))['then'](saveUpdates(_0x5d92ae['body'],null))['then'](respondWithResult(_0x55047d,null))[_0x8f14('0x27')](handleError(_0x55047d,null));};exports[_0x8f14('0x33')]=function(_0x6dd774,_0x23abb3){return db[_0x8f14('0x51')]['find']({'where':{'id':_0x6dd774['params']['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x23abb3,null))[_0x8f14('0x1d')](removeEntity(_0x23abb3,null))[_0x8f14('0x27')](handleError(_0x23abb3,null));};exports[_0x8f14('0x5f')]=function(_0x560ade,_0x14476c){return db['WhatsappAccount']['describe']()[_0x8f14('0x1d')](respondWithResult(_0x14476c,null))[_0x8f14('0x27')](handleError(_0x14476c,null));};exports[_0x8f14('0x60')]=function(_0x26b350,_0x5f0817,_0x165f1c){if(_0x26b350['body']['id']){delete _0x26b350['body']['id'];}return db[_0x8f14('0x51')][_0x8f14('0x5b')]({'where':{'id':_0x26b350[_0x8f14('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f0817,null))['then'](function(_0x3cc1ea){if(_0x3cc1ea){_0x26b350[_0x8f14('0x5e')][_0x8f14('0x61')]=_0x3cc1ea['id'];return db[_0x8f14('0x62')][_0x8f14('0x56')](_0x26b350['body']);}})['then'](respondWithResult(_0x5f0817,null))[_0x8f14('0x27')](handleError(_0x5f0817,null));};exports['getDispositions']=function(_0x441ccf,_0x1bc44c,_0x2dcc7f){var _0x5b30c5={'raw':![],'where':{}};var _0x3d6573={};var _0x36024c={'count':0x0,'rows':[]};return db[_0x8f14('0x51')]['findOne']({'where':{'id':_0x441ccf[_0x8f14('0x55')]['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x1bc44c,null))[_0x8f14('0x1d')](function(_0x15c0d){if(_0x15c0d){_0x3d6573[_0x8f14('0x40')]=_[_0x8f14('0x42')](db[_0x8f14('0x62')][_0x8f14('0x3c')]);_0x3d6573[_0x8f14('0x41')]=_['keys'](_0x441ccf[_0x8f14('0x41')]);_0x3d6573[_0x8f14('0x43')]=_['intersection'](_0x3d6573[_0x8f14('0x40')],_0x3d6573[_0x8f14('0x41')]);_0x5b30c5[_0x8f14('0x46')]=_[_0x8f14('0x44')](_0x3d6573[_0x8f14('0x40')],qs[_0x8f14('0x45')](_0x441ccf[_0x8f14('0x41')][_0x8f14('0x45')]));_0x5b30c5[_0x8f14('0x46')]=_0x5b30c5[_0x8f14('0x46')][_0x8f14('0x47')]?_0x5b30c5['attributes']:_0x3d6573[_0x8f14('0x40')];if(!_0x441ccf['query']['hasOwnProperty']('nolimit')){_0x5b30c5[_0x8f14('0x2d')]=qs['limit'](_0x441ccf['query'][_0x8f14('0x2d')]);_0x5b30c5[_0x8f14('0x2b')]=qs['offset'](_0x441ccf['query'][_0x8f14('0x2b')]);}_0x5b30c5[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_0x441ccf[_0x8f14('0x41')]['sort']);_0x5b30c5['where']=qs[_0x8f14('0x43')](_['pick'](_0x441ccf[_0x8f14('0x41')],_0x3d6573[_0x8f14('0x43')]));_0x5b30c5['where']['WhatsappAccountId']=_0x15c0d['id'];if(_0x441ccf[_0x8f14('0x41')]['filter']){_0x5b30c5[_0x8f14('0x4b')]=_['merge'](_0x5b30c5[_0x8f14('0x4b')],{'$or':_['map'](_0x5b30c5['attributes'],function(_0x1da34c){var _0x210f35={};_0x210f35[_0x1da34c]={'$like':'%'+_0x441ccf[_0x8f14('0x41')]['filter']+'%'};return _0x210f35;})});}_0x5b30c5=_[_0x8f14('0x4f')]({},_0x5b30c5,_0x441ccf['options']);return db[_0x8f14('0x62')][_0x8f14('0x2e')]({'where':_0x5b30c5[_0x8f14('0x4b')]})['then'](function(_0x26564c){_0x36024c[_0x8f14('0x2e')]=_0x26564c;if(_0x441ccf[_0x8f14('0x41')][_0x8f14('0x52')]){_0x5b30c5['include']=[{'all':!![]}];}return db[_0x8f14('0x62')][_0x8f14('0x63')](_0x5b30c5);})[_0x8f14('0x1d')](function(_0xfbd866){_0x36024c[_0x8f14('0x54')]=_0xfbd866;return _0x36024c;});}})[_0x8f14('0x1d')](respondWithFilteredResult(_0x1bc44c,_0x5b30c5))[_0x8f14('0x27')](handleError(_0x1bc44c,null));};exports[_0x8f14('0x64')]=function(_0x8707c7,_0x40e128,_0x34a6d0){return db[_0x8f14('0x51')]['find']({'where':{'id':_0x8707c7[_0x8f14('0x55')]['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x40e128,null))[_0x8f14('0x1d')](function(_0x33c466){if(_0x33c466){return _0x33c466[_0x8f14('0x64')](_0x8707c7[_0x8f14('0x41')][_0x8f14('0x65')]);}})['then'](respondWithStatusCode(_0x40e128,null))[_0x8f14('0x27')](handleError(_0x40e128,null));};exports['addAnswer']=function(_0x3a49f6,_0x4f15f4,_0x44ed4f){if(_0x3a49f6['body']['id']){delete _0x3a49f6[_0x8f14('0x5e')]['id'];}return db[_0x8f14('0x51')][_0x8f14('0x5b')]({'where':{'id':_0x3a49f6[_0x8f14('0x55')]['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x4f15f4,null))[_0x8f14('0x1d')](function(_0x1926b0){if(_0x1926b0){_0x3a49f6[_0x8f14('0x5e')][_0x8f14('0x61')]=_0x1926b0['id'];return db['CannedAnswer'][_0x8f14('0x56')](_0x3a49f6['body']);}})[_0x8f14('0x1d')](respondWithResult(_0x4f15f4,null))[_0x8f14('0x27')](handleError(_0x4f15f4,null));};exports[_0x8f14('0x66')]=function(_0x23752d,_0x535f93,_0x21f8fd){var _0x12e6ec={'raw':![],'where':{}};var _0x32bd3d={};var _0x521eab={'count':0x0,'rows':[]};return db[_0x8f14('0x51')]['findOne']({'where':{'id':_0x23752d['params']['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x535f93,null))[_0x8f14('0x1d')](function(_0x2c6a12){if(_0x2c6a12){_0x32bd3d[_0x8f14('0x40')]=_[_0x8f14('0x42')](db[_0x8f14('0x67')][_0x8f14('0x3c')]);_0x32bd3d[_0x8f14('0x41')]=_['keys'](_0x23752d['query']);_0x32bd3d[_0x8f14('0x43')]=_[_0x8f14('0x44')](_0x32bd3d[_0x8f14('0x40')],_0x32bd3d[_0x8f14('0x41')]);_0x12e6ec[_0x8f14('0x46')]=_['intersection'](_0x32bd3d['model'],qs[_0x8f14('0x45')](_0x23752d[_0x8f14('0x41')][_0x8f14('0x45')]));_0x12e6ec[_0x8f14('0x46')]=_0x12e6ec[_0x8f14('0x46')][_0x8f14('0x47')]?_0x12e6ec[_0x8f14('0x46')]:_0x32bd3d[_0x8f14('0x40')];if(!_0x23752d[_0x8f14('0x41')][_0x8f14('0x68')](_0x8f14('0x48'))){_0x12e6ec[_0x8f14('0x2d')]=qs[_0x8f14('0x2d')](_0x23752d[_0x8f14('0x41')][_0x8f14('0x2d')]);_0x12e6ec[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0x23752d[_0x8f14('0x41')][_0x8f14('0x2b')]);}_0x12e6ec['order']=qs[_0x8f14('0x4a')](_0x23752d[_0x8f14('0x41')][_0x8f14('0x4a')]);_0x12e6ec[_0x8f14('0x4b')]=qs[_0x8f14('0x43')](_['pick'](_0x23752d[_0x8f14('0x41')],_0x32bd3d[_0x8f14('0x43')]));_0x12e6ec['where'][_0x8f14('0x61')]=_0x2c6a12['id'];if(_0x23752d[_0x8f14('0x41')][_0x8f14('0x4d')]){_0x12e6ec[_0x8f14('0x4b')]=_[_0x8f14('0x4f')](_0x12e6ec['where'],{'$or':_[_0x8f14('0x3b')](_0x12e6ec[_0x8f14('0x46')],function(_0x2cf977){var _0x5e2e85={};_0x5e2e85[_0x2cf977]={'$like':'%'+_0x23752d['query'][_0x8f14('0x4d')]+'%'};return _0x5e2e85;})});}_0x12e6ec=_[_0x8f14('0x4f')]({},_0x12e6ec,_0x23752d[_0x8f14('0x50')]);return db[_0x8f14('0x67')][_0x8f14('0x2e')]({'where':_0x12e6ec['where']})[_0x8f14('0x1d')](function(_0x34a0ae){_0x521eab[_0x8f14('0x2e')]=_0x34a0ae;if(_0x23752d[_0x8f14('0x41')][_0x8f14('0x52')]){_0x12e6ec[_0x8f14('0x53')]=[{'all':!![]}];}return db[_0x8f14('0x67')]['findAll'](_0x12e6ec);})['then'](function(_0x705a37){_0x521eab[_0x8f14('0x54')]=_0x705a37;return _0x521eab;});}})[_0x8f14('0x1d')](respondWithFilteredResult(_0x535f93,_0x12e6ec))['catch'](handleError(_0x535f93,null));};exports[_0x8f14('0x69')]=function(_0x212840,_0x5be3a1,_0x4efe52){return db[_0x8f14('0x51')][_0x8f14('0x5b')]({'where':{'id':_0x212840[_0x8f14('0x55')]['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x5be3a1,null))[_0x8f14('0x1d')](function(_0x45b7f6){if(_0x45b7f6){return _0x45b7f6['removeAnswers'](_0x212840[_0x8f14('0x41')][_0x8f14('0x65')]);}})[_0x8f14('0x1d')](respondWithStatusCode(_0x5be3a1,null))['catch'](handleError(_0x5be3a1,null));};exports[_0x8f14('0x6a')]=function(_0x409f49,_0xba8f7e,_0x3c420d){return db[_0x8f14('0x51')]['find']({'where':{'id':_0x409f49['params']['id']}})['then'](handleEntityNotFound(_0xba8f7e,null))[_0x8f14('0x1d')](function(_0x496236){if(_0x496236){return _0x496236[_0x8f14('0x6a')](_0x409f49['body'][_0x8f14('0x65')],_[_0x8f14('0x6b')](_0x409f49[_0x8f14('0x5e')],[_0x8f14('0x65'),'id'])||{})['spread'](function(_0x5a93fd){for(var _0x421fdc=0x0;_0x421fdc<_0x409f49[_0x8f14('0x5e')][_0x8f14('0x65')]['length'];_0x421fdc+=0x1){socket['emit'](_0x8f14('0x6c'),{'UserId':Number(_0x409f49[_0x8f14('0x5e')]['ids'][_0x421fdc]),'WhatsappAccountId':Number(_0x409f49['params']['id'])});}return _0x5a93fd;});}})[_0x8f14('0x1d')](respondWithResult(_0xba8f7e,null))['catch'](handleError(_0xba8f7e,null));};exports[_0x8f14('0x6d')]=function(_0x130fcb,_0x1dbdeb,_0x10c8ac){return db[_0x8f14('0x51')][_0x8f14('0x5b')]({'where':{'id':_0x130fcb['params']['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x1dbdeb,null))[_0x8f14('0x1d')](function(_0x5c81a3){if(_0x5c81a3){return _0x5c81a3[_0x8f14('0x6d')](_0x130fcb[_0x8f14('0x41')]['ids'])['then'](function(){if(_[_0x8f14('0x6e')](_0x130fcb[_0x8f14('0x41')][_0x8f14('0x65')])){for(var _0xe96ef7=0x0;_0xe96ef7<_0x130fcb[_0x8f14('0x41')]['ids'][_0x8f14('0x47')];_0xe96ef7+=0x1){socket['emit'](_0x8f14('0x6f'),{'UserId':Number(_0x130fcb[_0x8f14('0x41')][_0x8f14('0x65')][_0xe96ef7]),'WhatsappAccountId':Number(_0x130fcb[_0x8f14('0x55')]['id'])});}}else{socket[_0x8f14('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x130fcb['query'][_0x8f14('0x65')]),'WhatsappAccountId':Number(_0x130fcb[_0x8f14('0x55')]['id'])});}});}})[_0x8f14('0x1d')](respondWithStatusCode(_0x1dbdeb,null))[_0x8f14('0x27')](handleError(_0x1dbdeb,null));};exports['getAgents']=function(_0x4e8ef9,_0x273b56,_0x5c3b84){var _0x23cb76={};var _0x10b653={};var _0x2d5abc;var _0x3ced86;return db[_0x8f14('0x51')][_0x8f14('0x71')]({'where':{'id':_0x4e8ef9['params']['id']}})['then'](handleEntityNotFound(_0x273b56,null))[_0x8f14('0x1d')](function(_0xe1ffd6){if(_0xe1ffd6){_0x2d5abc=_0xe1ffd6;_0x10b653[_0x8f14('0x40')]=_[_0x8f14('0x42')](db['User'][_0x8f14('0x3c')]);_0x10b653['query']=_[_0x8f14('0x42')](_0x4e8ef9[_0x8f14('0x41')]);_0x10b653[_0x8f14('0x43')]=_[_0x8f14('0x44')](_0x10b653[_0x8f14('0x40')],_0x10b653[_0x8f14('0x41')]);_0x23cb76['attributes']=_[_0x8f14('0x44')](_0x10b653['model'],qs[_0x8f14('0x45')](_0x4e8ef9[_0x8f14('0x41')]['fields']));_0x23cb76[_0x8f14('0x46')]=_0x23cb76[_0x8f14('0x46')][_0x8f14('0x47')]?_0x23cb76['attributes']:_0x10b653['model'];_0x23cb76[_0x8f14('0x49')]=qs[_0x8f14('0x4a')](_0x4e8ef9['query']['sort']);_0x23cb76['where']=qs[_0x8f14('0x43')](_[_0x8f14('0x4c')](_0x4e8ef9[_0x8f14('0x41')],_0x10b653[_0x8f14('0x43')]));if(_0x4e8ef9[_0x8f14('0x41')][_0x8f14('0x4d')]){_0x23cb76[_0x8f14('0x4b')]=_['merge'](_0x23cb76[_0x8f14('0x4b')],{'$or':_[_0x8f14('0x3b')](_0x23cb76[_0x8f14('0x46')],function(_0x39bb27){var _0x17d288={};_0x17d288[_0x39bb27]={'$like':'%'+_0x4e8ef9[_0x8f14('0x41')][_0x8f14('0x4d')]+'%'};return _0x17d288;})});}_0x23cb76=_['merge']({},_0x23cb76,_0x4e8ef9['options']);return _0x2d5abc[_0x8f14('0x72')](_0x23cb76);}})[_0x8f14('0x1d')](function(_0x7901e6){if(_0x7901e6){_0x3ced86=_0x7901e6['length'];if(!_0x4e8ef9[_0x8f14('0x41')][_0x8f14('0x68')](_0x8f14('0x48'))){_0x23cb76[_0x8f14('0x2d')]=qs[_0x8f14('0x2d')](_0x4e8ef9[_0x8f14('0x41')][_0x8f14('0x2d')]);_0x23cb76[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0x4e8ef9[_0x8f14('0x41')]['offset']);}return _0x2d5abc[_0x8f14('0x72')](_0x23cb76);}})[_0x8f14('0x1d')](function(_0xfc074c){if(_0xfc074c){return _0xfc074c?{'count':_0x3ced86,'rows':_0xfc074c}:null;}})[_0x8f14('0x1d')](respondWithResult(_0x273b56,null))[_0x8f14('0x27')](handleError(_0x273b56,null));};exports[_0x8f14('0x73')]=function(_0x20df57,_0x336b8b){var _0x3a3c6f=_0x20df57[_0x8f14('0x55')]['id'];var _0x3323ef=_0x20df57[_0x8f14('0x5e')];var _0x56dc12=0xc8;var _0x2adaab=null;return db[_0x8f14('0x74')][_0x8f14('0x75')]({'isolationLevel':db[_0x8f14('0x74')]['Transaction'][_0x8f14('0x76')][_0x8f14('0x77')]},function(_0x1cc7f4){return db[_0x8f14('0x51')][_0x8f14('0x71')]({'where':{'id':_0x3a3c6f},'transaction':_0x1cc7f4})[_0x8f14('0x1d')](function(_0x32d764){if(_0x32d764){return db[_0x8f14('0x78')][_0x8f14('0x33')]({'where':{'WhatsappAccountId':_0x3a3c6f},'transaction':_0x1cc7f4})[_0x8f14('0x1d')](function(){var _0x120550=_['map'](_0x3323ef,function(_0x25d8be){_0x25d8be[_0x8f14('0x61')]=_0x3a3c6f;return _0x25d8be;});return db[_0x8f14('0x78')]['bulkCreate'](_0x120550,{'transaction':_0x1cc7f4});});}else{_0x56dc12=0x194;_0x2adaab=[];}});})[_0x8f14('0x1d')](function(){if(_0x56dc12!==0x194){return db['WhatsappApplication'][_0x8f14('0x79')]({'where':{'WhatsappAccountId':_0x3a3c6f},'order':_0x8f14('0x7a')})['then'](function(_0x828946){_0x2adaab=_0x828946;});}})['catch'](function(_0x40b2c8){_0x56dc12=0x1f4;logger[_0x8f14('0x23')](_0x40b2c8[_0x8f14('0x37')]);if(_0x40b2c8[_0x8f14('0x38')]){delete _0x40b2c8['name'];}_0x2adaab=_0x40b2c8;})[_0x8f14('0x7b')](function(){if(_0x2adaab===null){_0x336b8b['sendStatus'](_0x56dc12);}else{if(_0x56dc12===0x1f4){_0x336b8b['status'](_0x56dc12)['send'](_0x2adaab);}else{_0x336b8b[_0x8f14('0x2f')](_0x56dc12)[_0x8f14('0x2a')](_0x2adaab);}}});};exports[_0x8f14('0x7c')]=function(_0x28b646,_0x411447,_0x3695a4){var _0x2c00de={};var _0x3f1691={};var _0xe5489b;var _0x25000b;return db['WhatsappAccount']['findOne']({'where':{'id':_0x28b646['params']['id']}})[_0x8f14('0x1d')](handleEntityNotFound(_0x411447,null))[_0x8f14('0x1d')](function(_0x19947d){if(_0x19947d){_0xe5489b=_0x19947d;_0x3f1691[_0x8f14('0x40')]=_[_0x8f14('0x42')](db[_0x8f14('0x78')][_0x8f14('0x3c')]);_0x3f1691[_0x8f14('0x41')]=_[_0x8f14('0x42')](_0x28b646[_0x8f14('0x41')]);_0x3f1691['filters']=_['intersection'](_0x3f1691[_0x8f14('0x40')],_0x3f1691[_0x8f14('0x41')]);_0x2c00de[_0x8f14('0x46')]=_[_0x8f14('0x44')](_0x3f1691[_0x8f14('0x40')],qs['fields'](_0x28b646['query'][_0x8f14('0x45')]));_0x2c00de[_0x8f14('0x46')]=_0x2c00de[_0x8f14('0x46')][_0x8f14('0x47')]?_0x2c00de[_0x8f14('0x46')]:_0x3f1691[_0x8f14('0x40')];_0x2c00de[_0x8f14('0x49')]=qs['sort'](_0x28b646[_0x8f14('0x41')][_0x8f14('0x4a')]);_0x2c00de[_0x8f14('0x4b')]=qs['filters'](_[_0x8f14('0x4c')](_0x28b646[_0x8f14('0x41')],_0x3f1691[_0x8f14('0x43')]));if(_0x28b646[_0x8f14('0x41')]['filter']){_0x2c00de['where']=_[_0x8f14('0x4f')](_0x2c00de[_0x8f14('0x4b')],{'$or':_[_0x8f14('0x3b')](_0x2c00de[_0x8f14('0x46')],function(_0x57223e){var _0x51de18={};_0x51de18[_0x57223e]={'$like':'%'+_0x28b646[_0x8f14('0x41')][_0x8f14('0x4d')]+'%'};return _0x51de18;})});}_0x2c00de=_[_0x8f14('0x4f')]({},_0x2c00de,_0x28b646[_0x8f14('0x50')]);return _0xe5489b[_0x8f14('0x7c')](_0x2c00de);}})[_0x8f14('0x1d')](function(_0x542e97){if(_0x542e97){_0x25000b=_0x542e97[_0x8f14('0x47')];if(!_0x28b646[_0x8f14('0x41')][_0x8f14('0x68')](_0x8f14('0x48'))){_0x2c00de[_0x8f14('0x2d')]=qs[_0x8f14('0x2d')](_0x28b646[_0x8f14('0x41')]['limit']);_0x2c00de[_0x8f14('0x2b')]=qs[_0x8f14('0x2b')](_0x28b646['query'][_0x8f14('0x2b')]);}return _0xe5489b[_0x8f14('0x7c')](_0x2c00de);}})[_0x8f14('0x1d')](function(_0x3eda51){if(_0x3eda51){return _0x3eda51?{'count':_0x25000b,'rows':_0x3eda51}:null;}})[_0x8f14('0x1d')](respondWithResult(_0x411447,null))['catch'](handleError(_0x411447,null));};exports['notify']=function(_0x2b5107,_0x585b4d,_0x5b274c){var _0x211ca1={'channel':_0x8f14('0x7d')};var _0x2380f1=[];var _0x7a787e=[];var _0x434e4c={};return db['WhatsappAccount'][_0x8f14('0x5b')]({'where':{'id':_0x2b5107[_0x8f14('0x55')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x8f14('0x7e')}]})[_0x8f14('0x1d')](handleEntityNotFound(_0x585b4d,null))['then'](function(_0xf77ff){_0x211ca1[_0x8f14('0x7f')]=_0xf77ff;if(_0x211ca1[_0x8f14('0x7f')]&&_0x211ca1['account'][_0x8f14('0x3e')]===_0x8f14('0x80')&&_0x2b5107['body'][_0x8f14('0x81')]){if(_0x2b5107['body'][_0x8f14('0x81')][_0x8f14('0x47')]===0x0)return;if(_0x2b5107[_0x8f14('0x5e')][_0x8f14('0x81')][0x0][_0x8f14('0x82')]!=='read')return;return db[_0x8f14('0x83')][_0x8f14('0x5d')]({'read':!![],'readAt':_0x2b5107[_0x8f14('0x5e')][_0x8f14('0x81')][0x0][_0x8f14('0x84')]},{'where':{'messageId':_0x2b5107[_0x8f14('0x5e')]['statuses'][0x0][_0x8f14('0x85')]},'individualHooks':!![]})[_0x8f14('0x1d')](function(_0x305f01){return _0x585b4d[_0x8f14('0x2f')](0xc8)[_0x8f14('0x2a')](_0x305f01);});}_0x211ca1[_0x8f14('0x86')]=_['orderBy'](_0xf77ff[_0x8f14('0x7e')],[_0x8f14('0x7a')],[_0x8f14('0x87')]);if(_0x211ca1[_0x8f14('0x7f')][_0x8f14('0x7e')]){delete _0x211ca1[_0x8f14('0x7f')]['Applications'];}return db[_0x8f14('0x88')]['describe']()[_0x8f14('0x1d')](function(_0x51c296){if(!_0x51c296){throw new db['Sequelize'][(_0x8f14('0x89'))](_0x8f14('0x8a'));}_0x2380f1=_['difference'](_[_0x8f14('0x42')](_0x51c296),['createdAt','updatedAt']);_0x7a787e=_['difference'](_[_0x8f14('0x42')](_0x51c296),[_0x8f14('0x8b'),_0x8f14('0x8c'),_0x8f14('0x8d'),_0x8f14('0x8e')]);_0x211ca1[_0x8f14('0x5e')]={'mapKey':_0x8f14('0x8f')};if(_0x211ca1['account']&&_0x211ca1[_0x8f14('0x7f')][_0x8f14('0x3e')]==='twilio'){_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x90')]=_0x2b5107[_0x8f14('0x5e')]['From'][_0x8f14('0x91')]('whatsapp:','');_0x211ca1[_0x8f14('0x5e')]['body']=_0x2b5107[_0x8f14('0x5e')][_0x8f14('0x92')];_0x211ca1['body'][_0x8f14('0x93')]=_0x2b5107[_0x8f14('0x5e')][_0x8f14('0x94')];}if(_0x211ca1['account']&&_0x211ca1[_0x8f14('0x7f')]['type']==='sinch'){_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x90')]=_0x2b5107[_0x8f14('0x5e')]['notifications'][0x0][_0x8f14('0x90')];_0x211ca1[_0x8f14('0x5e')]['body']=_0x2b5107[_0x8f14('0x5e')][_0x8f14('0x95')][0x0][_0x8f14('0x25')][_0x8f14('0x5e')];_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x93')]=_0x2b5107[_0x8f14('0x5e')][_0x8f14('0x95')][0x0][_0x8f14('0x85')];}if(_0x211ca1['body']['id']){delete _0x211ca1['body']['id'];}if(_[_0x8f14('0x96')](_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x90')])){throw new db[(_0x8f14('0x97'))][(_0x8f14('0x89'))](_0x8f14('0x98'));}if(_[_0x8f14('0x96')](_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x5e')])||_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x5e')]===''){throw new db['Sequelize'][(_0x8f14('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8f14('0x96')](_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x99')])){throw new db[(_0x8f14('0x97'))][(_0x8f14('0x89'))](_0x8f14('0x9a')+_0x7a787e);}if(!_[_0x8f14('0x9b')](_0x7a787e,_0x211ca1[_0x8f14('0x5e')]['mapKey'])){throw new db[(_0x8f14('0x97'))]['ValidationError'](_0x8f14('0x9c')+_0x7a787e);}_0x434e4c[_0x211ca1[_0x8f14('0x5e')]['mapKey']]=_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x90')];return db[_0x8f14('0x9d')][_0x8f14('0x5b')]({'where':{'id':_0x211ca1[_0x8f14('0x7f')][_0x8f14('0x8e')]},'include':[{'model':db[_0x8f14('0x88')],'as':'Contacts','where':_0x434e4c,'limit':0x1,'order':[[_0x8f14('0x8c'),_0x8f14('0x9e')]]}]});})[_0x8f14('0x1d')](handleEntityNotFound(_0x585b4d,null))[_0x8f14('0x1d')](function(_0x47102c){if(_0x47102c){_0x211ca1['list']=_[_0x8f14('0x6b')](_0x47102c,['Contacts']);if(_0x47102c[_0x8f14('0x9f')]['length']){return _0x47102c['Contacts'][0x0];}var _0x480127=_[_0x8f14('0xa0')](_0x211ca1[_0x8f14('0x5e')],{'firstName':_0x211ca1[_0x8f14('0x5e')]['from'],'ListId':_0x47102c['id']});_0x480127[_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x99')]]=_0x211ca1['body'][_0x8f14('0x90')];return db['CmContact'][_0x8f14('0x56')](_0x480127,{'fields':_0x2380f1,'raw':!![]});}})[_0x8f14('0x1d')](handleEntityNotFound(_0x585b4d,null))[_0x8f14('0x1d')](function(_0x289f39){if(_0x289f39){_0x211ca1[_0x8f14('0xa1')]=_0x289f39;var _0x2ffb11={'ContactId':_0x289f39['id'],'phone':_0x211ca1['body'][_0x8f14('0x90')],'WhatsappAccountId':_0x2b5107[_0x8f14('0x55')]['id']};var _0x142dc5={'ContactId':_0x289f39['id'],'WhatsappAccountId':_0x2b5107['params']['id'],'closed':![]};return db[_0x8f14('0xa2')]['find']({'where':_0x142dc5})[_0x8f14('0x1d')](function(_0x486d28){if(_0x486d28){return[_0x486d28,![]];}return db[_0x8f14('0xa2')]['create'](_0x2ffb11)[_0x8f14('0x1d')](function(_0x413648){return[_0x413648,!![]];});});}})['spread'](function(_0x4b23bb,_0x17e5d4){_0x211ca1[_0x8f14('0xa3')]=_0x4b23bb[_0x8f14('0x34')]({'plain':!![]});_0x211ca1['interaction'][_0x8f14('0xa4')]=![];if(_0x17e5d4){if(_0x211ca1[_0x8f14('0x7f')]['autoclose']){_0x211ca1['applications'][_0x8f14('0xa5')]({'id':0x0,'priority':_0x211ca1[_0x8f14('0x86')][_0x8f14('0x47')]+0x1,'app':_0x8f14('0xa6'),'appdata':'unmanaged','interval':_0x8f14('0xa7')});}_0x211ca1[_0x8f14('0xa3')][_0x8f14('0xa4')]=!![];}return db[_0x8f14('0x83')][_0x8f14('0x56')]({'phone':_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x90')],'messageId':_0x211ca1[_0x8f14('0x5e')][_0x8f14('0x93')],'body':_0x211ca1['body'][_0x8f14('0x5e')],'WhatsappAccountId':_0x2b5107[_0x8f14('0x55')]['id'],'WhatsappInteractionId':_0x4b23bb['id'],'direction':'in','ContactId':_0x4b23bb[_0x8f14('0xa8')],'AttachmentId':_0x211ca1[_0x8f14('0x5e')][_0x8f14('0xa9')]});})['then'](function(_0x3223dc){_0x211ca1[_0x8f14('0x25')]=_0x3223dc;if(_0x211ca1[_0x8f14('0xa3')]['UserId']){return db[_0x8f14('0xaa')]['find']({'attributes':['id',_0x8f14('0x38')],'where':{'id':_0x211ca1['interaction'][_0x8f14('0xab')]}})[_0x8f14('0x1d')](function(_0x571848){if(_0x571848){_0x211ca1[_0x8f14('0x86')][_0x8f14('0xac')]({'id':0x0,'priority':0x0,'app':_0x8f14('0xad'),'appdata':_0x571848['name']+','+(_0x211ca1[_0x8f14('0x7f')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x8f14('0xae'),_0x211ca1);});}return respondWithRpcPromise(_0x8f14('0xaf'),_0x8f14('0xae'),_0x211ca1);})['then'](function(_0x2706eb){if(_0x2706eb){var _0x4d57f7=0xc8;var _0x41f2db='receiveMessage';logger[_0x8f14('0x1e')](_0x8f14('0xb0'),_0x41f2db,_0x4d57f7,_0x8f14('0xb1'));logger[_0x8f14('0x21')](_0x8f14('0xb2'),_0x41f2db,_0x4d57f7,_0x8f14('0xb1'),JSON[_0x8f14('0x22')](_0x2706eb));if(_0x211ca1[_0x8f14('0x7f')][_0x8f14('0x3e')]===_0x8f14('0xb3')){return _0x585b4d['status'](_0x4d57f7)[_0x8f14('0xb4')](_0x8f14('0xb5'),_0x8f14('0xb6'))[_0x8f14('0xb7')]('\x0a');}else{return _0x585b4d['status'](_0x4d57f7)[_0x8f14('0x2a')](_0x2706eb);}}});})[_0x8f14('0x27')](handleError(_0x585b4d,null));};exports[_0x8f14('0xb7')]=function(_0x4e1b1a,_0x3cfdc2,_0x391cfb){var _0x3f0e0a,_0x533987,_0x27ba37;if(_[_0x8f14('0x96')](_0x4e1b1a['body'][_0x8f14('0x5e')])||_0x4e1b1a[_0x8f14('0x5e')][_0x8f14('0x5e')]===''){throw new db[(_0x8f14('0x97'))]['ValidationError'](_0x8f14('0xb8'));}if(_['isNil'](_0x4e1b1a[_0x8f14('0x5e')]['to'])){throw new db[(_0x8f14('0x97'))][(_0x8f14('0x89'))](_0x8f14('0xb9'));}_0x3f0e0a=_0x4e1b1a[_0x8f14('0x5e')]['to'];return db[_0x8f14('0x51')]['find']({'where':{'id':_0x4e1b1a[_0x8f14('0x55')]['id']},'include':[{'model':db[_0x8f14('0x9d')],'as':_0x8f14('0xba'),'include':[{'model':db[_0x8f14('0x88')],'as':_0x8f14('0x9f'),'where':{'mobile':_0x3f0e0a},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8f14('0x1d')](handleEntityNotFound(_0x3cfdc2,null))[_0x8f14('0x1d')](function(_0x29bc77){if(_0x29bc77&&_0x29bc77['List']){_0x533987=_0x29bc77['get']({'plain':!![]});if(_0x533987['List']&&_0x533987[_0x8f14('0xba')][_0x8f14('0x9f')]['length']){return _0x533987['List'][_0x8f14('0x9f')][0x0];}return db[_0x8f14('0x88')][_0x8f14('0x56')](_[_0x8f14('0xa0')](_0x4e1b1a[_0x8f14('0x5e')],{'firstName':_0x3f0e0a,'mobile':_0x3f0e0a,'phone':_0x3f0e0a,'ListId':_0x533987[_0x8f14('0x8e')]}));}})[_0x8f14('0x1d')](handleEntityNotFound(_0x3cfdc2,null))[_0x8f14('0x1d')](function(_0x16f8c6){if(_0x16f8c6){_0x27ba37=_0x16f8c6;return db['WhatsappInteraction'][_0x8f14('0x5b')]({'where':{'ContactId':_0x27ba37['id'],'closed':![],'WhatsappAccountId':_0x533987['id']}})[_0x8f14('0x1d')](function(_0x34fb09){if(_0x34fb09){return[_0x34fb09,![]];}return db['WhatsappInteraction'][_0x8f14('0x56')]({'UserId':_0x4e1b1a[_0x8f14('0x57')]['id'],'ContactId':_0x27ba37['id'],'WhatsappAccountId':_0x533987['id'],'phone':_0x3f0e0a,'firstMsgDirection':_0x8f14('0xbb'),'Messages':[_['merge'](_0x4e1b1a[_0x8f14('0x5e')],{'read':![],'body':_0x4e1b1a[_0x8f14('0x5e')][_0x8f14('0x5e')],'phone':_0x3f0e0a,'WhatsappAccountId':_0x533987['id'],'UserId':_0x4e1b1a[_0x8f14('0x57')]['id'],'ContactId':_0x27ba37['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x8f14('0xbc')}]})[_0x8f14('0x1d')](function(_0x1b586e){return[_0x1b586e,!![]];});});}})[_0x8f14('0xbd')](function(_0x53a91e,_0x30719f){if(_0x30719f){return _0x53a91e;}return db['WhatsappMessage'][_0x8f14('0x56')](_[_0x8f14('0x4f')](_0x4e1b1a[_0x8f14('0x5e')],{'read':![],'body':_0x4e1b1a[_0x8f14('0x5e')][_0x8f14('0x5e')],'phone':_0x3f0e0a,'WhatsappAccountId':_0x533987['id'],'WhatsappInteractionId':_0x53a91e['id'],'UserId':_0x4e1b1a['user']['id'],'ContactId':_0x27ba37['id']}))[_0x8f14('0x1d')](function(_0x58c2fd){_0x53a91e[_0x8f14('0xbe')][_0x8f14('0xbc')]=[];_0x53a91e[_0x8f14('0xbe')][_0x8f14('0xbc')]['push'](_0x58c2fd[_0x8f14('0xbe')]);return _0x53a91e;});})[_0x8f14('0x1d')](respondWithResult(_0x3cfdc2,null))[_0x8f14('0x27')](handleError(_0x3cfdc2,null));}; \ No newline at end of file +var _0x8ee8=['Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','Pause','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','getDispositions','findOne','Disposition','nolimit','order','WhatsappAccountId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','orderBy','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','notifications','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x8ee8,0x192));var _0x88ee=function(_0x2c50e4,_0x15cd2f){_0x2c50e4=_0x2c50e4-0x0;var _0x474118=_0x8ee8[_0x2c50e4];return _0x474118;};'use strict';var emlformat=require(_0x88ee('0x0'));var rimraf=require(_0x88ee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x88ee('0x2'));var moment=require(_0x88ee('0x3'));var BPromise=require(_0x88ee('0x4'));var Mustache=require(_0x88ee('0x5'));var util=require(_0x88ee('0x6'));var path=require(_0x88ee('0x7'));var sox=require(_0x88ee('0x8'));var csv=require(_0x88ee('0x9'));var ejs=require(_0x88ee('0xa'));var fs=require('fs');var fs_extra=require(_0x88ee('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x88ee('0xc'));var jsforce=require(_0x88ee('0xd'));var deskjs=require(_0x88ee('0xe'));var toCsv=require(_0x88ee('0x9'));var querystring=require(_0x88ee('0xf'));var Papa=require(_0x88ee('0x10'));var Redis=require(_0x88ee('0x11'));var authService=require(_0x88ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x88ee('0x13'));var hardwareService=require(_0x88ee('0x14'));var logger=require(_0x88ee('0x15'))('api');var utils=require(_0x88ee('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x88ee('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x88ee('0x18')](config['redis'],{'host':_0x88ee('0x19'),'port':0x18eb});var socket=require(_0x88ee('0x1a'))(new Redis(config[_0x88ee('0x1b')]));require(_0x88ee('0x1c'))[_0x88ee('0x1d')](socket);var jayson=require(_0x88ee('0x1e'));var client=jayson[_0x88ee('0x1f')][_0x88ee('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x21388e,_0x2a7abd,_0x584353,_0x1ad5bd){return new BPromise(function(_0x44f1c3,_0x4b1410){var _0x441b45=_0x1ad5bd||client;return _0x441b45[_0x88ee('0x21')](_0x21388e,_0x584353)[_0x88ee('0x22')](function(_0x19eee9){logger[_0x88ee('0x23')](_0x88ee('0x24'),_0x2a7abd,'request\x20sent');logger[_0x88ee('0x25')](_0x88ee('0x26'),_0x2a7abd,_0x88ee('0x27'),JSON[_0x88ee('0x28')](_0x19eee9));if(_0x19eee9[_0x88ee('0x29')]){if(_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2a')]===0x1f4){logger[_0x88ee('0x29')](_0x88ee('0x24'),_0x2a7abd,_0x19eee9['error']['message']);return _0x4b1410(_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2b')]);}logger[_0x88ee('0x29')](_0x88ee('0x24'),_0x2a7abd,_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2b')]);return _0x44f1c3(_0x19eee9[_0x88ee('0x29')][_0x88ee('0x2b')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2a7abd,'request\x20sent');_0x44f1c3(_0x19eee9['result'][_0x88ee('0x2b')]);}})[_0x88ee('0x2c')](function(_0x5b914a){logger[_0x88ee('0x29')](_0x88ee('0x24'),_0x2a7abd,_0x5b914a);_0x4b1410(_0x5b914a);});});}function respondWithStatusCode(_0x433757,_0x4f114f){_0x4f114f=_0x4f114f||0xcc;return function(_0x5e21cb){if(_0x5e21cb){return _0x433757[_0x88ee('0x2d')](_0x4f114f);}return _0x433757[_0x88ee('0x2e')](_0x4f114f)[_0x88ee('0x2f')]();};}function respondWithResult(_0x57bf64,_0x31bc3f){_0x31bc3f=_0x31bc3f||0xc8;return function(_0x3c4f54){if(_0x3c4f54){return _0x57bf64[_0x88ee('0x2e')](_0x31bc3f)[_0x88ee('0x30')](_0x3c4f54);}};}function respondWithFilteredResult(_0x34f833,_0x3bcc16){return function(_0x481b29){if(_0x481b29){var _0x2d0b73=typeof _0x3bcc16[_0x88ee('0x31')]==='undefined'&&typeof _0x3bcc16['limit']===_0x88ee('0x32');var _0x1e9d13=_0x481b29[_0x88ee('0x33')];var _0xe5217b=_0x2d0b73?0x0:_0x3bcc16[_0x88ee('0x31')];var _0x270991=_0x2d0b73?_0x481b29[_0x88ee('0x33')]:_0x3bcc16[_0x88ee('0x31')]+_0x3bcc16['limit'];var _0x3308a7;if(_0x270991>=_0x1e9d13){_0x270991=_0x1e9d13;_0x3308a7=0xc8;}else{_0x3308a7=0xce;}_0x34f833[_0x88ee('0x2e')](_0x3308a7);return _0x34f833[_0x88ee('0x34')](_0x88ee('0x35'),_0xe5217b+'-'+_0x270991+'/'+_0x1e9d13)['json'](_0x481b29);}return null;};}function patchUpdates(_0x1409a1){return function(_0x59f938){try{jsonpatch[_0x88ee('0x36')](_0x59f938,_0x1409a1,!![]);}catch(_0x3ab1e7){return BPromise[_0x88ee('0x37')](_0x3ab1e7);}return _0x59f938[_0x88ee('0x38')]();};}function saveUpdates(_0xb4c778,_0x6fa959){return function(_0x5b9fbd){if(_0x5b9fbd){return _0x5b9fbd[_0x88ee('0x39')](_0xb4c778)[_0x88ee('0x22')](function(_0x2f2ae0){return _0x2f2ae0;});}return null;};}function removeEntity(_0x49451a,_0x1472b3){return function(_0x40e6bd){if(_0x40e6bd){return _0x40e6bd[_0x88ee('0x3a')]()[_0x88ee('0x22')](function(){var _0x4a6c2e=_0x40e6bd[_0x88ee('0x3b')]({'plain':!![]});var _0x2ff27c=_0x88ee('0x3c');return db[_0x88ee('0x3d')][_0x88ee('0x3a')]({'where':{'type':_0x2ff27c,'resourceId':_0x4a6c2e['id']}})[_0x88ee('0x22')](function(){return _0x40e6bd;});})['then'](function(){_0x49451a[_0x88ee('0x2e')](0xcc)[_0x88ee('0x2f')]();});}};}function handleEntityNotFound(_0x5abf6f,_0x2b8153){return function(_0x7006c4){if(!_0x7006c4){_0x5abf6f[_0x88ee('0x2d')](0x194);}return _0x7006c4;};}function handleError(_0x430af7,_0x2d3141){_0x2d3141=_0x2d3141||0x1f4;return function(_0x4e31cf){logger['error'](_0x4e31cf['stack']);if(_0x4e31cf[_0x88ee('0x3e')]){delete _0x4e31cf[_0x88ee('0x3e')];}_0x430af7['status'](_0x2d3141)[_0x88ee('0x3f')](_0x4e31cf);};}exports[_0x88ee('0x40')]=function(_0x17d216,_0x422854){var _0x242868={'include':[{'model':db['Pause'],'as':_0x88ee('0x41')}]},_0x2ba365={},_0x50bf40={'count':0x0,'rows':[]};var _0xd0cb80=_[_0x88ee('0x42')](db[_0x88ee('0x43')][_0x88ee('0x44')],function(_0x13c1b9){return{'name':_0x13c1b9[_0x88ee('0x45')],'type':_0x13c1b9[_0x88ee('0x46')][_0x88ee('0x47')]};});_0x2ba365['model']=_['map'](_0xd0cb80,'name');_0x2ba365[_0x88ee('0x48')]=_['keys'](_0x17d216[_0x88ee('0x48')]);_0x2ba365[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x2ba365[_0x88ee('0x4b')],_0x2ba365[_0x88ee('0x48')]);_0x242868[_0x88ee('0x4c')]=_[_0x88ee('0x4a')](_0x2ba365[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x17d216[_0x88ee('0x48')][_0x88ee('0x4d')]));_0x242868[_0x88ee('0x4c')]=_0x242868[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x242868[_0x88ee('0x4c')]:_0x2ba365['model'];if(!_0x17d216[_0x88ee('0x48')][_0x88ee('0x4f')]('nolimit')){_0x242868[_0x88ee('0x50')]=qs[_0x88ee('0x50')](_0x17d216['query'][_0x88ee('0x50')]);_0x242868['offset']=qs['offset'](_0x17d216[_0x88ee('0x48')][_0x88ee('0x31')]);}_0x242868['order']=qs[_0x88ee('0x51')](_0x17d216['query'][_0x88ee('0x51')]);_0x242868[_0x88ee('0x52')]=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x17d216['query'],_0x2ba365[_0x88ee('0x49')]),_0xd0cb80);if(_0x17d216['query'][_0x88ee('0x54')]){_0x242868[_0x88ee('0x52')]=_['merge'](_0x242868[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0xd0cb80,function(_0x211bc5){if(_0x211bc5[_0x88ee('0x46')]!==_0x88ee('0x55')){var _0x1ce090={};_0x1ce090[_0x211bc5[_0x88ee('0x3e')]]={'$like':'%'+_0x17d216[_0x88ee('0x48')][_0x88ee('0x54')]+'%'};return _0x1ce090;}})});}_0x242868=_[_0x88ee('0x56')]({},_0x242868,_0x17d216[_0x88ee('0x57')]);var _0x22ab7f={'where':_0x242868['where']};return db['WhatsappAccount'][_0x88ee('0x33')](_0x22ab7f)[_0x88ee('0x22')](function(_0x53ce46){_0x50bf40[_0x88ee('0x33')]=_0x53ce46;if(_0x17d216[_0x88ee('0x48')][_0x88ee('0x58')]){_0x242868[_0x88ee('0x59')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x88ee('0x5a')](_0x242868);})['then'](function(_0x22eb97){_0x50bf40[_0x88ee('0x5b')]=_0x22eb97;return _0x50bf40;})[_0x88ee('0x22')](respondWithFilteredResult(_0x422854,_0x242868))['catch'](handleError(_0x422854,null));};exports[_0x88ee('0x5c')]=function(_0x6de4e6,_0x89f756){var _0x57b04e={'raw':![],'where':{'id':_0x6de4e6['params']['id']},'include':[{'model':db[_0x88ee('0x5d')],'as':_0x88ee('0x41')}]},_0x4771cf={};_0x4771cf['model']=_[_0x88ee('0x5e')](db[_0x88ee('0x43')][_0x88ee('0x44')]);_0x4771cf['query']=_[_0x88ee('0x5e')](_0x6de4e6[_0x88ee('0x48')]);_0x4771cf[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x4771cf[_0x88ee('0x4b')],_0x4771cf[_0x88ee('0x48')]);_0x57b04e[_0x88ee('0x4c')]=_[_0x88ee('0x4a')](_0x4771cf[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x6de4e6['query']['fields']));_0x57b04e[_0x88ee('0x4c')]=_0x57b04e[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x57b04e['attributes']:_0x4771cf[_0x88ee('0x4b')];if(_0x6de4e6['query'][_0x88ee('0x58')]){_0x57b04e[_0x88ee('0x59')]=[{'all':!![]}];}_0x57b04e=_[_0x88ee('0x56')]({},_0x57b04e,_0x6de4e6[_0x88ee('0x57')]);return db[_0x88ee('0x43')][_0x88ee('0x5f')](_0x57b04e)[_0x88ee('0x22')](handleEntityNotFound(_0x89f756,null))[_0x88ee('0x22')](respondWithResult(_0x89f756,null))[_0x88ee('0x2c')](handleError(_0x89f756,null));};exports[_0x88ee('0x60')]=function(_0x686903,_0x225a5){return db[_0x88ee('0x43')][_0x88ee('0x60')](_0x686903[_0x88ee('0x61')],{})[_0x88ee('0x22')](function(_0x3330dc){var _0x5215e3=_0x686903['user'][_0x88ee('0x3b')]({'plain':!![]});if(!_0x5215e3)throw new Error(_0x88ee('0x62'));if(_0x5215e3[_0x88ee('0x63')]===_0x88ee('0x64')){var _0x5600b6=_0x3330dc[_0x88ee('0x3b')]({'plain':!![]});var _0x4bcffa=_0x88ee('0x3c');return db['UserProfileSection'][_0x88ee('0x5f')]({'where':{'name':_0x4bcffa,'userProfileId':_0x5215e3[_0x88ee('0x65')]},'raw':!![]})[_0x88ee('0x22')](function(_0x268ba0){if(_0x268ba0&&_0x268ba0[_0x88ee('0x66')]===0x0){return db[_0x88ee('0x3d')][_0x88ee('0x60')]({'name':_0x5600b6[_0x88ee('0x3e')],'resourceId':_0x5600b6['id'],'type':_0x268ba0[_0x88ee('0x3e')],'sectionId':_0x268ba0['id']},{})[_0x88ee('0x22')](function(){return _0x3330dc;});}else{return _0x3330dc;}})[_0x88ee('0x2c')](function(_0x3450b5){logger[_0x88ee('0x29')](_0x88ee('0x67'),_0x3450b5);throw _0x3450b5;});}return _0x3330dc;})[_0x88ee('0x22')](respondWithResult(_0x225a5,0xc9))[_0x88ee('0x2c')](handleError(_0x225a5,null));};exports[_0x88ee('0x39')]=function(_0x205c8d,_0x4fa6ff){if(_0x205c8d[_0x88ee('0x61')]['id']){delete _0x205c8d[_0x88ee('0x61')]['id'];}return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x205c8d[_0x88ee('0x68')]['id']},'include':[{'model':db[_0x88ee('0x5d')],'as':_0x88ee('0x41')}]})[_0x88ee('0x22')](handleEntityNotFound(_0x4fa6ff,null))[_0x88ee('0x22')](saveUpdates(_0x205c8d[_0x88ee('0x61')],null))[_0x88ee('0x22')](respondWithResult(_0x4fa6ff,null))['catch'](handleError(_0x4fa6ff,null));};exports[_0x88ee('0x3a')]=function(_0x3803cc,_0x1a81e0){return db['WhatsappAccount']['find']({'where':{'id':_0x3803cc['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x1a81e0,null))[_0x88ee('0x22')](removeEntity(_0x1a81e0,null))[_0x88ee('0x2c')](handleError(_0x1a81e0,null));};exports[_0x88ee('0x69')]=function(_0x1cc6e7,_0x5bbc37){return db[_0x88ee('0x43')][_0x88ee('0x69')]()['then'](respondWithResult(_0x5bbc37,null))[_0x88ee('0x2c')](handleError(_0x5bbc37,null));};exports[_0x88ee('0x6a')]=function(_0xe17e29,_0x254e41,_0x174821){if(_0xe17e29[_0x88ee('0x61')]['id']){delete _0xe17e29[_0x88ee('0x61')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0xe17e29['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x254e41,null))[_0x88ee('0x22')](function(_0xcdacb9){if(_0xcdacb9){_0xe17e29[_0x88ee('0x61')]['WhatsappAccountId']=_0xcdacb9['id'];return db['Disposition']['create'](_0xe17e29[_0x88ee('0x61')]);}})['then'](respondWithResult(_0x254e41,null))[_0x88ee('0x2c')](handleError(_0x254e41,null));};exports[_0x88ee('0x6b')]=function(_0x46cd2b,_0x530903,_0x3be9a5){var _0x5ac16e={'raw':![],'where':{}};var _0x1717eb={};var _0x264165={'count':0x0,'rows':[]};return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x46cd2b['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x530903,null))[_0x88ee('0x22')](function(_0x594e4b){if(_0x594e4b){_0x1717eb[_0x88ee('0x4b')]=_[_0x88ee('0x5e')](db[_0x88ee('0x6d')][_0x88ee('0x44')]);_0x1717eb[_0x88ee('0x48')]=_['keys'](_0x46cd2b[_0x88ee('0x48')]);_0x1717eb[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x1717eb[_0x88ee('0x4b')],_0x1717eb[_0x88ee('0x48')]);_0x5ac16e['attributes']=_[_0x88ee('0x4a')](_0x1717eb[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x46cd2b['query']['fields']));_0x5ac16e[_0x88ee('0x4c')]=_0x5ac16e[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x5ac16e[_0x88ee('0x4c')]:_0x1717eb[_0x88ee('0x4b')];if(!_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x5ac16e[_0x88ee('0x50')]=qs[_0x88ee('0x50')](_0x46cd2b['query'][_0x88ee('0x50')]);_0x5ac16e['offset']=qs[_0x88ee('0x31')](_0x46cd2b['query']['offset']);}_0x5ac16e[_0x88ee('0x6f')]=qs[_0x88ee('0x51')](_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x51')]);_0x5ac16e['where']=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x46cd2b[_0x88ee('0x48')],_0x1717eb[_0x88ee('0x49')]));_0x5ac16e[_0x88ee('0x52')][_0x88ee('0x70')]=_0x594e4b['id'];if(_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x54')]){_0x5ac16e[_0x88ee('0x52')]=_[_0x88ee('0x56')](_0x5ac16e[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x5ac16e[_0x88ee('0x4c')],function(_0x5a88c0){var _0x3e65ff={};_0x3e65ff[_0x5a88c0]={'$like':'%'+_0x46cd2b[_0x88ee('0x48')]['filter']+'%'};return _0x3e65ff;})});}_0x5ac16e=_[_0x88ee('0x56')]({},_0x5ac16e,_0x46cd2b['options']);return db[_0x88ee('0x6d')][_0x88ee('0x33')]({'where':_0x5ac16e['where']})[_0x88ee('0x22')](function(_0x1b26ae){_0x264165[_0x88ee('0x33')]=_0x1b26ae;if(_0x46cd2b[_0x88ee('0x48')][_0x88ee('0x58')]){_0x5ac16e[_0x88ee('0x59')]=[{'all':!![]}];}return db[_0x88ee('0x6d')]['findAll'](_0x5ac16e);})['then'](function(_0x5613c4){_0x264165['rows']=_0x5613c4;return _0x264165;});}})['then'](respondWithFilteredResult(_0x530903,_0x5ac16e))[_0x88ee('0x2c')](handleError(_0x530903,null));};exports['removeDispositions']=function(_0x3911a7,_0x12bfed,_0x30e6b5){return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x3911a7[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x12bfed,null))[_0x88ee('0x22')](function(_0x1652bc){if(_0x1652bc){return _0x1652bc[_0x88ee('0x71')](_0x3911a7['query'][_0x88ee('0x72')]);}})[_0x88ee('0x22')](respondWithStatusCode(_0x12bfed,null))[_0x88ee('0x2c')](handleError(_0x12bfed,null));};exports[_0x88ee('0x73')]=function(_0x1fbbc4,_0x2b473d,_0x4c27da){if(_0x1fbbc4[_0x88ee('0x61')]['id']){delete _0x1fbbc4[_0x88ee('0x61')]['id'];}return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x1fbbc4[_0x88ee('0x68')]['id']}})['then'](handleEntityNotFound(_0x2b473d,null))[_0x88ee('0x22')](function(_0x182751){if(_0x182751){_0x1fbbc4[_0x88ee('0x61')][_0x88ee('0x70')]=_0x182751['id'];return db['CannedAnswer'][_0x88ee('0x60')](_0x1fbbc4['body']);}})['then'](respondWithResult(_0x2b473d,null))['catch'](handleError(_0x2b473d,null));};exports[_0x88ee('0x74')]=function(_0x5c4741,_0x484514,_0x1735b6){var _0x5948bc={'raw':![],'where':{}};var _0x451557={};var _0x37894b={'count':0x0,'rows':[]};return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x5c4741['params']['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x484514,null))[_0x88ee('0x22')](function(_0x434b19){if(_0x434b19){_0x451557['model']=_[_0x88ee('0x5e')](db[_0x88ee('0x75')][_0x88ee('0x44')]);_0x451557[_0x88ee('0x48')]=_[_0x88ee('0x5e')](_0x5c4741['query']);_0x451557['filters']=_[_0x88ee('0x4a')](_0x451557['model'],_0x451557[_0x88ee('0x48')]);_0x5948bc[_0x88ee('0x4c')]=_[_0x88ee('0x4a')](_0x451557[_0x88ee('0x4b')],qs[_0x88ee('0x4d')](_0x5c4741[_0x88ee('0x48')][_0x88ee('0x4d')]));_0x5948bc['attributes']=_0x5948bc['attributes'][_0x88ee('0x4e')]?_0x5948bc[_0x88ee('0x4c')]:_0x451557[_0x88ee('0x4b')];if(!_0x5c4741[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x5948bc[_0x88ee('0x50')]=qs[_0x88ee('0x50')](_0x5c4741['query']['limit']);_0x5948bc[_0x88ee('0x31')]=qs[_0x88ee('0x31')](_0x5c4741[_0x88ee('0x48')][_0x88ee('0x31')]);}_0x5948bc[_0x88ee('0x6f')]=qs[_0x88ee('0x51')](_0x5c4741[_0x88ee('0x48')][_0x88ee('0x51')]);_0x5948bc['where']=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x5c4741[_0x88ee('0x48')],_0x451557[_0x88ee('0x49')]));_0x5948bc['where'][_0x88ee('0x70')]=_0x434b19['id'];if(_0x5c4741[_0x88ee('0x48')][_0x88ee('0x54')]){_0x5948bc[_0x88ee('0x52')]=_[_0x88ee('0x56')](_0x5948bc[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x5948bc['attributes'],function(_0x52a3f2){var _0x5082c7={};_0x5082c7[_0x52a3f2]={'$like':'%'+_0x5c4741['query'][_0x88ee('0x54')]+'%'};return _0x5082c7;})});}_0x5948bc=_[_0x88ee('0x56')]({},_0x5948bc,_0x5c4741['options']);return db[_0x88ee('0x75')][_0x88ee('0x33')]({'where':_0x5948bc['where']})[_0x88ee('0x22')](function(_0x54d5e3){_0x37894b[_0x88ee('0x33')]=_0x54d5e3;if(_0x5c4741[_0x88ee('0x48')][_0x88ee('0x58')]){_0x5948bc['include']=[{'all':!![]}];}return db[_0x88ee('0x75')][_0x88ee('0x5a')](_0x5948bc);})[_0x88ee('0x22')](function(_0x11c704){_0x37894b['rows']=_0x11c704;return _0x37894b;});}})[_0x88ee('0x22')](respondWithFilteredResult(_0x484514,_0x5948bc))[_0x88ee('0x2c')](handleError(_0x484514,null));};exports[_0x88ee('0x76')]=function(_0xbd70e2,_0x5f565a,_0x1ddb16){return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0xbd70e2[_0x88ee('0x68')]['id']}})['then'](handleEntityNotFound(_0x5f565a,null))[_0x88ee('0x22')](function(_0x14f94e){if(_0x14f94e){return _0x14f94e[_0x88ee('0x76')](_0xbd70e2[_0x88ee('0x48')][_0x88ee('0x72')]);}})[_0x88ee('0x22')](respondWithStatusCode(_0x5f565a,null))['catch'](handleError(_0x5f565a,null));};exports['addAgents']=function(_0x513714,_0x4da960,_0x26bc9a){return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x513714[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x4da960,null))['then'](function(_0x5987cb){if(_0x5987cb){return _0x5987cb[_0x88ee('0x77')](_0x513714[_0x88ee('0x61')][_0x88ee('0x72')],_[_0x88ee('0x78')](_0x513714['body'],[_0x88ee('0x72'),'id'])||{})[_0x88ee('0x79')](function(_0x548899){for(var _0x57edf9=0x0;_0x57edf9<_0x513714[_0x88ee('0x61')][_0x88ee('0x72')][_0x88ee('0x4e')];_0x57edf9+=0x1){socket[_0x88ee('0x7a')]('userWhatsappAccount:save',{'UserId':Number(_0x513714[_0x88ee('0x61')][_0x88ee('0x72')][_0x57edf9]),'WhatsappAccountId':Number(_0x513714[_0x88ee('0x68')]['id'])});}return _0x548899;});}})[_0x88ee('0x22')](respondWithResult(_0x4da960,null))['catch'](handleError(_0x4da960,null));};exports[_0x88ee('0x7b')]=function(_0x5da24f,_0x25f122,_0x407a0b){return db['WhatsappAccount'][_0x88ee('0x5f')]({'where':{'id':_0x5da24f[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x25f122,null))['then'](function(_0x3642ec){if(_0x3642ec){return _0x3642ec[_0x88ee('0x7b')](_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')])[_0x88ee('0x22')](function(){if(_[_0x88ee('0x7c')](_0x5da24f['query']['ids'])){for(var _0x569f8a=0x0;_0x569f8a<_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')][_0x88ee('0x4e')];_0x569f8a+=0x1){socket[_0x88ee('0x7a')]('userWhatsappAccount:remove',{'UserId':Number(_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')][_0x569f8a]),'WhatsappAccountId':Number(_0x5da24f[_0x88ee('0x68')]['id'])});}}else{socket['emit'](_0x88ee('0x7d'),{'UserId':Number(_0x5da24f[_0x88ee('0x48')][_0x88ee('0x72')]),'WhatsappAccountId':Number(_0x5da24f[_0x88ee('0x68')]['id'])});}});}})[_0x88ee('0x22')](respondWithStatusCode(_0x25f122,null))['catch'](handleError(_0x25f122,null));};exports[_0x88ee('0x7e')]=function(_0x58404f,_0x3d7690,_0x108507){var _0x2c1eac={};var _0x5a908d={};var _0x3f7a1e;var _0x4d52ac;return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x58404f[_0x88ee('0x68')]['id']}})['then'](handleEntityNotFound(_0x3d7690,null))[_0x88ee('0x22')](function(_0x38da6e){if(_0x38da6e){_0x3f7a1e=_0x38da6e;_0x5a908d[_0x88ee('0x4b')]=_[_0x88ee('0x5e')](db[_0x88ee('0x7f')]['rawAttributes']);_0x5a908d[_0x88ee('0x48')]=_[_0x88ee('0x5e')](_0x58404f[_0x88ee('0x48')]);_0x5a908d[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x5a908d[_0x88ee('0x4b')],_0x5a908d[_0x88ee('0x48')]);_0x2c1eac[_0x88ee('0x4c')]=_['intersection'](_0x5a908d[_0x88ee('0x4b')],qs['fields'](_0x58404f[_0x88ee('0x48')][_0x88ee('0x4d')]));_0x2c1eac[_0x88ee('0x4c')]=_0x2c1eac['attributes'][_0x88ee('0x4e')]?_0x2c1eac[_0x88ee('0x4c')]:_0x5a908d[_0x88ee('0x4b')];_0x2c1eac[_0x88ee('0x6f')]=qs[_0x88ee('0x51')](_0x58404f['query']['sort']);_0x2c1eac['where']=qs[_0x88ee('0x49')](_[_0x88ee('0x53')](_0x58404f[_0x88ee('0x48')],_0x5a908d['filters']));if(_0x58404f['query'][_0x88ee('0x54')]){_0x2c1eac['where']=_[_0x88ee('0x56')](_0x2c1eac[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x2c1eac[_0x88ee('0x4c')],function(_0x2f0509){var _0x1555a8={};_0x1555a8[_0x2f0509]={'$like':'%'+_0x58404f[_0x88ee('0x48')][_0x88ee('0x54')]+'%'};return _0x1555a8;})});}_0x2c1eac=_[_0x88ee('0x56')]({},_0x2c1eac,_0x58404f[_0x88ee('0x57')]);return _0x3f7a1e[_0x88ee('0x7e')](_0x2c1eac);}})['then'](function(_0x24b68a){if(_0x24b68a){_0x4d52ac=_0x24b68a[_0x88ee('0x4e')];if(!_0x58404f[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x2c1eac[_0x88ee('0x50')]=qs['limit'](_0x58404f[_0x88ee('0x48')][_0x88ee('0x50')]);_0x2c1eac[_0x88ee('0x31')]=qs['offset'](_0x58404f['query'][_0x88ee('0x31')]);}return _0x3f7a1e[_0x88ee('0x7e')](_0x2c1eac);}})[_0x88ee('0x22')](function(_0x12dd2a){if(_0x12dd2a){return _0x12dd2a?{'count':_0x4d52ac,'rows':_0x12dd2a}:null;}})['then'](respondWithResult(_0x3d7690,null))[_0x88ee('0x2c')](handleError(_0x3d7690,null));};exports[_0x88ee('0x80')]=function(_0x549b18,_0x182769){var _0x4c3f39=_0x549b18[_0x88ee('0x68')]['id'];var _0x407146=_0x549b18[_0x88ee('0x61')];var _0x286f89=0xc8;var _0x46071f=null;return db[_0x88ee('0x81')][_0x88ee('0x82')]({'isolationLevel':db[_0x88ee('0x81')][_0x88ee('0x83')][_0x88ee('0x84')]['READ_COMMITTED']},function(_0x258273){return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x4c3f39},'transaction':_0x258273})[_0x88ee('0x22')](function(_0x425652){if(_0x425652){return db[_0x88ee('0x85')][_0x88ee('0x3a')]({'where':{'WhatsappAccountId':_0x4c3f39},'transaction':_0x258273})['then'](function(){var _0x1b23ba=_[_0x88ee('0x42')](_0x407146,function(_0x5251e6){_0x5251e6['WhatsappAccountId']=_0x4c3f39;return _0x5251e6;});return db[_0x88ee('0x85')][_0x88ee('0x86')](_0x1b23ba,{'transaction':_0x258273});});}else{_0x286f89=0x194;_0x46071f=[];}});})[_0x88ee('0x22')](function(){if(_0x286f89!==0x194){return db['WhatsappApplication'][_0x88ee('0x87')]({'where':{'WhatsappAccountId':_0x4c3f39},'order':_0x88ee('0x88')})[_0x88ee('0x22')](function(_0x4a1456){_0x46071f=_0x4a1456;});}})['catch'](function(_0x527c10){_0x286f89=0x1f4;logger[_0x88ee('0x29')](_0x527c10[_0x88ee('0x89')]);if(_0x527c10[_0x88ee('0x3e')]){delete _0x527c10[_0x88ee('0x3e')];}_0x46071f=_0x527c10;})[_0x88ee('0x8a')](function(){if(_0x46071f===null){_0x182769[_0x88ee('0x2d')](_0x286f89);}else{if(_0x286f89===0x1f4){_0x182769[_0x88ee('0x2e')](_0x286f89)['send'](_0x46071f);}else{_0x182769['status'](_0x286f89)['json'](_0x46071f);}}});};exports['getApplications']=function(_0x392ade,_0x1f973a,_0x253f6d){var _0x5919d4={};var _0x57e77d={};var _0x5192d9;var _0x2c50a7;return db[_0x88ee('0x43')][_0x88ee('0x6c')]({'where':{'id':_0x392ade[_0x88ee('0x68')]['id']}})[_0x88ee('0x22')](handleEntityNotFound(_0x1f973a,null))['then'](function(_0x368a9b){if(_0x368a9b){_0x5192d9=_0x368a9b;_0x57e77d['model']=_['keys'](db[_0x88ee('0x85')][_0x88ee('0x44')]);_0x57e77d[_0x88ee('0x48')]=_['keys'](_0x392ade['query']);_0x57e77d[_0x88ee('0x49')]=_[_0x88ee('0x4a')](_0x57e77d[_0x88ee('0x4b')],_0x57e77d['query']);_0x5919d4['attributes']=_[_0x88ee('0x4a')](_0x57e77d['model'],qs[_0x88ee('0x4d')](_0x392ade['query'][_0x88ee('0x4d')]));_0x5919d4[_0x88ee('0x4c')]=_0x5919d4[_0x88ee('0x4c')][_0x88ee('0x4e')]?_0x5919d4[_0x88ee('0x4c')]:_0x57e77d['model'];_0x5919d4['order']=qs[_0x88ee('0x51')](_0x392ade[_0x88ee('0x48')][_0x88ee('0x51')]);_0x5919d4[_0x88ee('0x52')]=qs['filters'](_['pick'](_0x392ade[_0x88ee('0x48')],_0x57e77d[_0x88ee('0x49')]));if(_0x392ade[_0x88ee('0x48')][_0x88ee('0x54')]){_0x5919d4[_0x88ee('0x52')]=_[_0x88ee('0x56')](_0x5919d4[_0x88ee('0x52')],{'$or':_[_0x88ee('0x42')](_0x5919d4[_0x88ee('0x4c')],function(_0x5b2f51){var _0x2e2e35={};_0x2e2e35[_0x5b2f51]={'$like':'%'+_0x392ade[_0x88ee('0x48')][_0x88ee('0x54')]+'%'};return _0x2e2e35;})});}_0x5919d4=_[_0x88ee('0x56')]({},_0x5919d4,_0x392ade[_0x88ee('0x57')]);return _0x5192d9[_0x88ee('0x8b')](_0x5919d4);}})['then'](function(_0x59ce8d){if(_0x59ce8d){_0x2c50a7=_0x59ce8d[_0x88ee('0x4e')];if(!_0x392ade[_0x88ee('0x48')][_0x88ee('0x4f')](_0x88ee('0x6e'))){_0x5919d4['limit']=qs[_0x88ee('0x50')](_0x392ade['query']['limit']);_0x5919d4['offset']=qs[_0x88ee('0x31')](_0x392ade[_0x88ee('0x48')][_0x88ee('0x31')]);}return _0x5192d9['getApplications'](_0x5919d4);}})[_0x88ee('0x22')](function(_0x1b579e){if(_0x1b579e){return _0x1b579e?{'count':_0x2c50a7,'rows':_0x1b579e}:null;}})[_0x88ee('0x22')](respondWithResult(_0x1f973a,null))[_0x88ee('0x2c')](handleError(_0x1f973a,null));};exports['notify']=function(_0x3ebf9c,_0x2ab653,_0xe9f417){var _0x178c1a={'channel':'whatsapp'};var _0x3c8937=[];var _0x54da61=[];var _0x51a5e4={};return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x3ebf9c[_0x88ee('0x68')]['id']},'include':[{'model':db[_0x88ee('0x85')],'as':_0x88ee('0x8c')}]})[_0x88ee('0x22')](handleEntityNotFound(_0x2ab653,null))[_0x88ee('0x22')](function(_0x55ea36){_0x178c1a[_0x88ee('0x8d')]=_0x55ea36;if(_0x178c1a[_0x88ee('0x8d')]&&_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]===_0x88ee('0x8e')&&_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')]){if(_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')][_0x88ee('0x4e')]===0x0)return;if(_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')][0x0][_0x88ee('0x90')]!==_0x88ee('0x91'))return;return db['WhatsappMessage'][_0x88ee('0x39')]({'read':!![],'readAt':_0x3ebf9c['body'][_0x88ee('0x8f')][0x0][_0x88ee('0x92')]},{'where':{'messageId':_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0x8f')][0x0][_0x88ee('0x93')]},'individualHooks':!![]})[_0x88ee('0x22')](function(_0x408e54){return _0x2ab653[_0x88ee('0x2e')](0xc8)[_0x88ee('0x30')](_0x408e54);});}_0x178c1a[_0x88ee('0x94')]=_[_0x88ee('0x95')](_0x55ea36['Applications'],[_0x88ee('0x88')],['asc']);if(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x8c')]){delete _0x178c1a[_0x88ee('0x8d')]['Applications'];}return db[_0x88ee('0x96')][_0x88ee('0x69')]()[_0x88ee('0x22')](function(_0x4d7471){if(!_0x4d7471){throw new db['Sequelize'][(_0x88ee('0x97'))](_0x88ee('0x98'));}_0x3c8937=_[_0x88ee('0x99')](_[_0x88ee('0x5e')](_0x4d7471),['createdAt','updatedAt']);_0x54da61=_[_0x88ee('0x99')](_[_0x88ee('0x5e')](_0x4d7471),[_0x88ee('0x9a'),_0x88ee('0x9b'),_0x88ee('0x9c'),_0x88ee('0x9d')]);_0x178c1a[_0x88ee('0x61')]={'mapKey':'mobile'};if(_0x178c1a['account']&&_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]===_0x88ee('0x9e')){_0x178c1a[_0x88ee('0x61')][_0x88ee('0x9f')]=_0x3ebf9c['body'][_0x88ee('0xa0')]['replace']('whatsapp:','');_0x178c1a[_0x88ee('0x61')][_0x88ee('0x61')]=_0x3ebf9c['body'][_0x88ee('0xa1')];_0x178c1a['body'][_0x88ee('0xa2')]=_0x3ebf9c[_0x88ee('0x61')]['MessageSid'];}if(_0x178c1a[_0x88ee('0x8d')]&&_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]===_0x88ee('0x8e')){_0x178c1a['body'][_0x88ee('0x9f')]=_0x3ebf9c[_0x88ee('0x61')][_0x88ee('0xa3')][0x0]['from'];_0x178c1a['body']['body']=_0x3ebf9c['body'][_0x88ee('0xa3')][0x0][_0x88ee('0x2b')]['body'];_0x178c1a[_0x88ee('0x61')][_0x88ee('0xa2')]=_0x3ebf9c[_0x88ee('0x61')]['notifications'][0x0]['message_id'];}if(_0x178c1a[_0x88ee('0x61')]['id']){delete _0x178c1a[_0x88ee('0x61')]['id'];}if(_[_0x88ee('0xa4')](_0x178c1a[_0x88ee('0x61')]['from'])){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))]('from\x20is\x20mandatory');}if(_[_0x88ee('0xa4')](_0x178c1a[_0x88ee('0x61')][_0x88ee('0x61')])||_0x178c1a[_0x88ee('0x61')][_0x88ee('0x61')]===''){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))](_0x88ee('0xa6'));}if(_[_0x88ee('0xa4')](_0x178c1a[_0x88ee('0x61')][_0x88ee('0xa7')])){throw new db['Sequelize'][(_0x88ee('0x97'))](_0x88ee('0xa8')+_0x54da61);}if(!_[_0x88ee('0xa9')](_0x54da61,_0x178c1a['body']['mapKey'])){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))](_0x88ee('0xaa')+_0x54da61);}_0x51a5e4[_0x178c1a['body']['mapKey']]=_0x178c1a[_0x88ee('0x61')][_0x88ee('0x9f')];return db[_0x88ee('0xab')]['find']({'where':{'id':_0x178c1a['account'][_0x88ee('0x9d')]},'include':[{'model':db[_0x88ee('0x96')],'as':_0x88ee('0xac'),'where':_0x51a5e4,'limit':0x1,'order':[[_0x88ee('0x9b'),_0x88ee('0xad')]]}]});})['then'](handleEntityNotFound(_0x2ab653,null))['then'](function(_0x308311){if(_0x308311){_0x178c1a['list']=_['omit'](_0x308311,[_0x88ee('0xac')]);if(_0x308311['Contacts']['length']){return _0x308311['Contacts'][0x0];}var _0x2a6da4=_[_0x88ee('0x18')](_0x178c1a['body'],{'firstName':_0x178c1a['body'][_0x88ee('0x9f')],'ListId':_0x308311['id']});_0x2a6da4[_0x178c1a['body'][_0x88ee('0xa7')]]=_0x178c1a['body']['from'];return db[_0x88ee('0x96')]['create'](_0x2a6da4,{'fields':_0x3c8937,'raw':!![]});}})[_0x88ee('0x22')](handleEntityNotFound(_0x2ab653,null))[_0x88ee('0x22')](function(_0x25d504){if(_0x25d504){_0x178c1a['contact']=_0x25d504;var _0x1110dd={'ContactId':_0x25d504['id'],'phone':_0x178c1a[_0x88ee('0x61')][_0x88ee('0x9f')],'WhatsappAccountId':_0x3ebf9c[_0x88ee('0x68')]['id']};var _0x21a5cc={'ContactId':_0x25d504['id'],'WhatsappAccountId':_0x3ebf9c[_0x88ee('0x68')]['id'],'closed':![]};return db[_0x88ee('0xae')][_0x88ee('0x5f')]({'where':_0x21a5cc})[_0x88ee('0x22')](function(_0x3882f7){if(_0x3882f7){return[_0x3882f7,![]];}return db[_0x88ee('0xae')][_0x88ee('0x60')](_0x1110dd)[_0x88ee('0x22')](function(_0x3b0710){return[_0x3b0710,!![]];});});}})['spread'](function(_0x390f29,_0xd4f42d){_0x178c1a[_0x88ee('0xaf')]=_0x390f29[_0x88ee('0x3b')]({'plain':!![]});_0x178c1a['interaction'][_0x88ee('0xb0')]=![];if(_0xd4f42d){if(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0xb1')]){_0x178c1a[_0x88ee('0x94')][_0x88ee('0xb2')]({'id':0x0,'priority':_0x178c1a[_0x88ee('0x94')][_0x88ee('0x4e')]+0x1,'app':_0x88ee('0xb3'),'appdata':'unmanaged','interval':_0x88ee('0xb4')});}_0x178c1a['interaction'][_0x88ee('0xb0')]=!![];}return db[_0x88ee('0xb5')]['create']({'phone':_0x178c1a['body'][_0x88ee('0x9f')],'messageId':_0x178c1a['body'][_0x88ee('0xa2')],'body':_0x178c1a[_0x88ee('0x61')]['body'],'WhatsappAccountId':_0x3ebf9c[_0x88ee('0x68')]['id'],'WhatsappInteractionId':_0x390f29['id'],'direction':'in','ContactId':_0x390f29[_0x88ee('0xb6')],'AttachmentId':_0x178c1a[_0x88ee('0x61')][_0x88ee('0xb7')]});})[_0x88ee('0x22')](function(_0x6bf510){_0x178c1a[_0x88ee('0x2b')]=_0x6bf510;if(_0x178c1a['interaction'][_0x88ee('0xb8')]){return db[_0x88ee('0x7f')]['find']({'attributes':['id','name'],'where':{'id':_0x178c1a[_0x88ee('0xaf')][_0x88ee('0xb8')]}})[_0x88ee('0x22')](function(_0xad1402){if(_0xad1402){_0x178c1a[_0x88ee('0x94')][_0x88ee('0xb9')]({'id':0x0,'priority':0x0,'app':_0x88ee('0xba'),'appdata':_0xad1402[_0x88ee('0x3e')]+','+(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0xbb')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x88ee('0xbc'),_0x178c1a);});}return respondWithRpcPromise('Start',_0x88ee('0xbc'),_0x178c1a);})[_0x88ee('0x22')](function(_0x2d74f1){if(_0x2d74f1){var _0x5abf63=0xc8;var _0x47a3ca=_0x88ee('0xbd');logger[_0x88ee('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x47a3ca,_0x5abf63,_0x88ee('0xbe'));logger[_0x88ee('0x25')](_0x88ee('0xbf'),_0x47a3ca,_0x5abf63,'entity\x20found',JSON[_0x88ee('0x28')](_0x2d74f1));if(_0x178c1a[_0x88ee('0x8d')][_0x88ee('0x46')]==='twilio'){return _0x2ab653['status'](_0x5abf63)[_0x88ee('0x34')](_0x88ee('0xc0'),_0x88ee('0xc1'))[_0x88ee('0x3f')](_0x88ee('0xc2'));}else{return _0x2ab653[_0x88ee('0x2e')](_0x5abf63)[_0x88ee('0x30')](_0x2d74f1);}}});})[_0x88ee('0x2c')](handleError(_0x2ab653,null));};exports[_0x88ee('0x3f')]=function(_0x518e61,_0x39ed8d,_0x56215d){var _0x11e480,_0x394bea,_0x46acad;if(_['isNil'](_0x518e61['body'][_0x88ee('0x61')])||_0x518e61['body']['body']===''){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x88ee('0xa4')](_0x518e61[_0x88ee('0x61')]['to'])){throw new db[(_0x88ee('0xa5'))][(_0x88ee('0x97'))](_0x88ee('0xc3'));}_0x11e480=_0x518e61[_0x88ee('0x61')]['to'];return db[_0x88ee('0x43')][_0x88ee('0x5f')]({'where':{'id':_0x518e61['params']['id']},'include':[{'model':db[_0x88ee('0xab')],'as':'List','include':[{'model':db[_0x88ee('0x96')],'as':_0x88ee('0xac'),'where':{'mobile':_0x11e480},'limit':0x1,'order':[[_0x88ee('0x9b'),'DESC']]}]}]})[_0x88ee('0x22')](handleEntityNotFound(_0x39ed8d,null))[_0x88ee('0x22')](function(_0x43d80b){if(_0x43d80b&&_0x43d80b[_0x88ee('0xc4')]){_0x394bea=_0x43d80b[_0x88ee('0x3b')]({'plain':!![]});if(_0x394bea[_0x88ee('0xc4')]&&_0x394bea[_0x88ee('0xc4')]['Contacts']['length']){return _0x394bea[_0x88ee('0xc4')][_0x88ee('0xac')][0x0];}return db['CmContact']['create'](_[_0x88ee('0x18')](_0x518e61[_0x88ee('0x61')],{'firstName':_0x11e480,'mobile':_0x11e480,'phone':_0x11e480,'ListId':_0x394bea[_0x88ee('0x9d')]}));}})['then'](handleEntityNotFound(_0x39ed8d,null))['then'](function(_0x178c38){if(_0x178c38){_0x46acad=_0x178c38;return db[_0x88ee('0xae')][_0x88ee('0x5f')]({'where':{'ContactId':_0x46acad['id'],'closed':![],'WhatsappAccountId':_0x394bea['id']}})[_0x88ee('0x22')](function(_0x41446f){if(_0x41446f){return[_0x41446f,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x518e61['user']['id'],'ContactId':_0x46acad['id'],'WhatsappAccountId':_0x394bea['id'],'phone':_0x11e480,'firstMsgDirection':_0x88ee('0xc5'),'Messages':[_[_0x88ee('0x56')](_0x518e61[_0x88ee('0x61')],{'read':![],'body':_0x518e61[_0x88ee('0x61')][_0x88ee('0x61')],'phone':_0x11e480,'WhatsappAccountId':_0x394bea['id'],'UserId':_0x518e61[_0x88ee('0x64')]['id'],'ContactId':_0x46acad['id']})]},{'include':[{'model':db[_0x88ee('0xb5')],'as':_0x88ee('0xc6')}]})['then'](function(_0x415f67){return[_0x415f67,!![]];});});}})[_0x88ee('0x79')](function(_0x4b302e,_0x26a628){if(_0x26a628){return _0x4b302e;}return db['WhatsappMessage']['create'](_[_0x88ee('0x56')](_0x518e61[_0x88ee('0x61')],{'read':![],'body':_0x518e61[_0x88ee('0x61')]['body'],'phone':_0x11e480,'WhatsappAccountId':_0x394bea['id'],'WhatsappInteractionId':_0x4b302e['id'],'UserId':_0x518e61['user']['id'],'ContactId':_0x46acad['id']}))[_0x88ee('0x22')](function(_0x1ce425){_0x4b302e['dataValues'][_0x88ee('0xc6')]=[];_0x4b302e['dataValues']['Messages'][_0x88ee('0xb2')](_0x1ce425[_0x88ee('0xc7')]);return _0x4b302e;});})['then'](respondWithResult(_0x39ed8d,null))[_0x88ee('0x2c')](handleError(_0x39ed8d,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 2045c60..93b1251 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 _0x996a=['events','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x996a,0x128));var _0xa996=function(_0x173fcb,_0x191273){_0x173fcb=_0x173fcb-0x0;var _0x1b681b=_0x996a[_0x173fcb];return _0x1b681b;};'use strict';var EventEmitter=require(_0xa996('0x0'));var WhatsappAccount=require(_0xa996('0x1'))['db'][_0xa996('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa996('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa996('0x4'),'afterDestroy':_0xa996('0x5')};function emitEvent(_0x3983ef){return function(_0x4d7787,_0x5c5877,_0x409682){WhatsappAccountEvents[_0xa996('0x6')](_0x3983ef+':'+_0x4d7787['id'],_0x4d7787);WhatsappAccountEvents[_0xa996('0x6')](_0x3983ef,_0x4d7787);_0x409682(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xa996('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0xd953=['exports','WhatsappAccount','remove','emit','hook'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xd953,0x10f));var _0x3d95=function(_0x63aa4,_0x70d23f){_0x63aa4=_0x63aa4-0x0;var _0x316ad4=_0xd953[_0x63aa4];return _0x316ad4;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x3d95('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3d95('0x1')};function emitEvent(_0x426c74){return function(_0x49bb11,_0x131e3e,_0x224a9b){WhatsappAccountEvents[_0x3d95('0x2')](_0x426c74+':'+_0x49bb11['id'],_0x49bb11);WhatsappAccountEvents[_0x3d95('0x2')](_0x426c74,_0x49bb11);_0x224a9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x3d95('0x3')](e,emitEvent(event));}}module[_0x3d95('0x4')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index ee6b10c..07ac6c2 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 _0x22bc=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash'];(function(_0x22fcfd,_0x5c83a0){var _0x4f0f30=function(_0x46e78f){while(--_0x46e78f){_0x22fcfd['push'](_0x22fcfd['shift']());}};_0x4f0f30(++_0x5c83a0);}(_0x22bc,0x1a1));var _0xc22b=function(_0x2a90e8,_0xfd1fa1){_0x2a90e8=_0x2a90e8-0x0;var _0x472ebf=_0x22bc[_0x2a90e8];return _0x472ebf;};'use strict';var _=require(_0xc22b('0x0'));var util=require('util');var logger=require(_0xc22b('0x1'))('api');var moment=require(_0xc22b('0x2'));var BPromise=require(_0xc22b('0x3'));var rp=require(_0xc22b('0x4'));var fs=require('fs');var path=require(_0xc22b('0x5'));var rimraf=require(_0xc22b('0x6'));var config=require('../../config/environment');var attributes=require(_0xc22b('0x7'));module[_0xc22b('0x8')]=function(_0xc9fc6,_0x1bd6f3){return _0xc9fc6[_0xc22b('0x9')](_0xc22b('0xa'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad6d=['WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define'];(function(_0x30355a,_0x5f4c70){var _0x46e555=function(_0x1fdf41){while(--_0x1fdf41){_0x30355a['push'](_0x30355a['shift']());}};_0x46e555(++_0x5f4c70);}(_0xad6d,0xe9));var _0xdad6=function(_0x3aab3f,_0x2a208b){_0x3aab3f=_0x3aab3f-0x0;var _0x58c335=_0xad6d[_0x3aab3f];return _0x58c335;};'use strict';var _=require(_0xdad6('0x0'));var util=require('util');var logger=require(_0xdad6('0x1'))(_0xdad6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdad6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdad6('0x4'));var config=require(_0xdad6('0x5'));var attributes=require(_0xdad6('0x6'));module[_0xdad6('0x7')]=function(_0x3ff3ed,_0x4d9612){return _0x3ff3ed[_0xdad6('0x8')](_0xdad6('0x9'),attributes,{'tableName':_0xdad6('0xa'),'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 c62f81f..884ee1e 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 _0xf41f=['request\x20sent','stringify','error','message','result','catch','WhatsappAccount','find','options','raw','attributes','include','map','model','ShowWhatsappAccount','debug','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf41f,0x79));var _0xff41=function(_0x259a06,_0x5e8131){_0x259a06=_0x259a06-0x0;var _0x5abf30=_0xf41f[_0x259a06];return _0x5abf30;};'use strict';var _=require('lodash');var util=require(_0xff41('0x0'));var moment=require(_0xff41('0x1'));var BPromise=require(_0xff41('0x2'));var rs=require(_0xff41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xff41('0x4'))(_0xff41('0x5'));var config=require(_0xff41('0x6'));var jayson=require(_0xff41('0x7'));var client=jayson[_0xff41('0x8')][_0xff41('0x9')]({'port':0x232a});config[_0xff41('0xa')]=_[_0xff41('0xb')](config['redis'],{'host':_0xff41('0xc'),'port':0x18eb});var socket=require(_0xff41('0xd'))(new Redis(config[_0xff41('0xa')]));require('./whatsappAccount.socket')[_0xff41('0xe')](socket);function respondWithRpcPromise(_0x100ab6,_0x558654,_0x4c1eae){return new BPromise(function(_0x18a939,_0x5a5ef5){return client['request'](_0x100ab6,_0x4c1eae)[_0xff41('0xf')](function(_0x3570ff){logger[_0xff41('0x10')](_0xff41('0x11'),_0x558654,'request\x20sent');logger['debug'](_0xff41('0x12'),_0x558654,_0xff41('0x13'),JSON[_0xff41('0x14')](_0x3570ff));if(_0x3570ff[_0xff41('0x15')]){if(_0x3570ff[_0xff41('0x15')]['code']===0x1f4){logger[_0xff41('0x15')](_0xff41('0x11'),_0x558654,_0x3570ff['error'][_0xff41('0x16')]);return _0x5a5ef5(_0x3570ff[_0xff41('0x15')][_0xff41('0x16')]);}logger[_0xff41('0x15')](_0xff41('0x11'),_0x558654,_0x3570ff[_0xff41('0x15')][_0xff41('0x16')]);return _0x18a939(_0x3570ff[_0xff41('0x15')][_0xff41('0x16')]);}else{logger[_0xff41('0x10')](_0xff41('0x11'),_0x558654,_0xff41('0x13'));_0x18a939(_0x3570ff[_0xff41('0x17')][_0xff41('0x16')]);}})[_0xff41('0x18')](function(_0xc1dbd3){logger['error'](_0xff41('0x11'),_0x558654,_0xc1dbd3);_0x5a5ef5(_0xc1dbd3);});});}exports['ShowWhatsappAccount']=function(_0x49a238){var _0x3fc137=this;return new Promise(function(_0x11806b,_0x403245){return db[_0xff41('0x19')][_0xff41('0x1a')]({'raw':_0x49a238[_0xff41('0x1b')]?_0x49a238[_0xff41('0x1b')][_0xff41('0x1c')]===undefined?!![]:![]:!![],'where':_0x49a238['options']?_0x49a238[_0xff41('0x1b')]['where']||null:null,'attributes':_0x49a238[_0xff41('0x1b')]?_0x49a238[_0xff41('0x1b')][_0xff41('0x1d')]||null:null,'include':_0x49a238['options']?_0x49a238[_0xff41('0x1b')][_0xff41('0x1e')]?_[_0xff41('0x1f')](_0x49a238[_0xff41('0x1b')]['include'],function(_0x387f23){return{'model':db[_0x387f23['model']],'as':_0x387f23['as'],'attributes':_0x387f23[_0xff41('0x1d')],'include':_0x387f23[_0xff41('0x1e')]?_[_0xff41('0x1f')](_0x387f23['include'],function(_0x55b316){return{'model':db[_0x55b316[_0xff41('0x20')]],'as':_0x55b316['as'],'attributes':_0x55b316[_0xff41('0x1d')],'include':_0x55b316[_0xff41('0x1e')]?_[_0xff41('0x1f')](_0x55b316['include'],function(_0x175f4a){return{'model':db[_0x175f4a[_0xff41('0x20')]],'as':_0x175f4a['as'],'attributes':_0x175f4a[_0xff41('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xff41('0xf')](function(_0x5ef03c){logger[_0xff41('0x10')](_0xff41('0x21'),_0x49a238);logger[_0xff41('0x22')]('ShowWhatsappAccount',_0x49a238,JSON['stringify'](_0x5ef03c));_0x11806b(_0x5ef03c);})['catch'](function(_0x165352){logger['error'](_0xff41('0x21'),_0x165352['message'],_0x49a238);_0x403245(_0x3fc137[_0xff41('0x15')](0x1f4,_0x165352[_0xff41('0x16')]));});});}; \ No newline at end of file +var _0x1753=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount','raw','options','where','attributes','include','model','map','lodash'];(function(_0x4d9d54,_0x1b9bcf){var _0x489b1b=function(_0x50bf0c){while(--_0x50bf0c){_0x4d9d54['push'](_0x4d9d54['shift']());}};_0x489b1b(++_0x1b9bcf);}(_0x1753,0xb3));var _0x3175=function(_0x3335c4,_0x3be639){_0x3335c4=_0x3335c4-0x0;var _0x3810f4=_0x1753[_0x3335c4];return _0x3810f4;};'use strict';var _=require(_0x3175('0x0'));var util=require(_0x3175('0x1'));var moment=require(_0x3175('0x2'));var BPromise=require(_0x3175('0x3'));var rs=require(_0x3175('0x4'));var fs=require('fs');var Redis=require(_0x3175('0x5'));var db=require(_0x3175('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3175('0x7'))('rpc');var config=require(_0x3175('0x8'));var jayson=require(_0x3175('0x9'));var client=jayson['client'][_0x3175('0xa')]({'port':0x232a});config[_0x3175('0xb')]=_[_0x3175('0xc')](config[_0x3175('0xb')],{'host':_0x3175('0xd'),'port':0x18eb});var socket=require(_0x3175('0xe'))(new Redis(config[_0x3175('0xb')]));require(_0x3175('0xf'))['register'](socket);function respondWithRpcPromise(_0x2a2afe,_0x5b4c85,_0x3d58da){return new BPromise(function(_0x25056b,_0x4f7ee8){return client[_0x3175('0x10')](_0x2a2afe,_0x3d58da)[_0x3175('0x11')](function(_0x525ddb){logger['info'](_0x3175('0x12'),_0x5b4c85,_0x3175('0x13'));logger[_0x3175('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5b4c85,'request\x20sent',JSON[_0x3175('0x15')](_0x525ddb));if(_0x525ddb[_0x3175('0x16')]){if(_0x525ddb[_0x3175('0x16')]['code']===0x1f4){logger[_0x3175('0x16')](_0x3175('0x12'),_0x5b4c85,_0x525ddb[_0x3175('0x16')][_0x3175('0x17')]);return _0x4f7ee8(_0x525ddb[_0x3175('0x16')][_0x3175('0x17')]);}logger['error'](_0x3175('0x12'),_0x5b4c85,_0x525ddb['error'][_0x3175('0x17')]);return _0x25056b(_0x525ddb['error'][_0x3175('0x17')]);}else{logger[_0x3175('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x5b4c85,_0x3175('0x13'));_0x25056b(_0x525ddb[_0x3175('0x19')]['message']);}})[_0x3175('0x1a')](function(_0x94fd2f){logger[_0x3175('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x5b4c85,_0x94fd2f);_0x4f7ee8(_0x94fd2f);});});}exports[_0x3175('0x1b')]=function(_0x431e57){var _0x3e9fcc=this;return new Promise(function(_0x4b155e,_0x3c2568){return db[_0x3175('0x1c')]['find']({'raw':_0x431e57['options']?_0x431e57['options'][_0x3175('0x1d')]===undefined?!![]:![]:!![],'where':_0x431e57['options']?_0x431e57[_0x3175('0x1e')][_0x3175('0x1f')]||null:null,'attributes':_0x431e57[_0x3175('0x1e')]?_0x431e57[_0x3175('0x1e')][_0x3175('0x20')]||null:null,'include':_0x431e57['options']?_0x431e57[_0x3175('0x1e')][_0x3175('0x21')]?_['map'](_0x431e57[_0x3175('0x1e')][_0x3175('0x21')],function(_0x3f77a4){return{'model':db[_0x3f77a4[_0x3175('0x22')]],'as':_0x3f77a4['as'],'attributes':_0x3f77a4[_0x3175('0x20')],'include':_0x3f77a4[_0x3175('0x21')]?_[_0x3175('0x23')](_0x3f77a4[_0x3175('0x21')],function(_0x3556c5){return{'model':db[_0x3556c5[_0x3175('0x22')]],'as':_0x3556c5['as'],'attributes':_0x3556c5[_0x3175('0x20')],'include':_0x3556c5[_0x3175('0x21')]?_['map'](_0x3556c5['include'],function(_0x59c169){return{'model':db[_0x59c169[_0x3175('0x22')]],'as':_0x59c169['as'],'attributes':_0x59c169['attributes']};}):[]};}):[]};}):[]:[]})[_0x3175('0x11')](function(_0x14f298){logger[_0x3175('0x18')](_0x3175('0x1b'),_0x431e57);logger[_0x3175('0x14')](_0x3175('0x1b'),_0x431e57,JSON[_0x3175('0x15')](_0x14f298));_0x4b155e(_0x14f298);})[_0x3175('0x1a')](function(_0x1541f6){logger[_0x3175('0x16')](_0x3175('0x1b'),_0x1541f6['message'],_0x431e57);_0x3c2568(_0x3e9fcc['error'](0x1f4,_0x1541f6['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 1e4fcb0..2eb3690 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 _0x61c2=['length','save','remove','update','emit','removeListener','register'];(function(_0x22ae17,_0x1a557d){var _0x3a42a9=function(_0xd2e0f2){while(--_0xd2e0f2){_0x22ae17['push'](_0x22ae17['shift']());}};_0x3a42a9(++_0x1a557d);}(_0x61c2,0x1d6));var _0x261c=function(_0x16af53,_0x56bf7c){_0x16af53=_0x16af53-0x0;var _0x291d0f=_0x61c2[_0x16af53];return _0x291d0f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x261c('0x0'),_0x261c('0x1'),_0x261c('0x2')];function createListener(_0x429ed4,_0x42baf3){return function(_0x4edf43){_0x42baf3[_0x261c('0x3')](_0x429ed4,_0x4edf43);};}function removeListener(_0x3e2d60,_0x5a188d){return function(){WhatsappAccountEvents[_0x261c('0x4')](_0x3e2d60,_0x5a188d);};}exports[_0x261c('0x5')]=function(_0x55592b){for(var _0x33ad7b=0x0,_0x2450e2=events[_0x261c('0x6')];_0x33ad7b<_0x2450e2;_0x33ad7b++){var _0x4e21cf=events[_0x33ad7b];var _0x53ac70=createListener('whatsappAccount:'+_0x4e21cf,_0x55592b);WhatsappAccountEvents['on'](_0x4e21cf,_0x53ac70);}}; \ No newline at end of file +var _0xd0fb=['whatsappAccount:','./whatsappAccount.events','save','remove','update','length'];(function(_0x3ee771,_0x384fea){var _0x286607=function(_0x29a3c5){while(--_0x29a3c5){_0x3ee771['push'](_0x3ee771['shift']());}};_0x286607(++_0x384fea);}(_0xd0fb,0xc1));var _0xbd0f=function(_0x305d5f,_0x530030){_0x305d5f=_0x305d5f-0x0;var _0x58e2c4=_0xd0fb[_0x305d5f];return _0x58e2c4;};'use strict';var WhatsappAccountEvents=require(_0xbd0f('0x0'));var events=[_0xbd0f('0x1'),_0xbd0f('0x2'),_0xbd0f('0x3')];function createListener(_0x4698e7,_0x13f9a2){return function(_0x4864cb){_0x13f9a2['emit'](_0x4698e7,_0x4864cb);};}function removeListener(_0x458ba9,_0x5784ad){return function(){WhatsappAccountEvents['removeListener'](_0x458ba9,_0x5784ad);};}exports['register']=function(_0x2e26c3){for(var _0x178a53=0x0,_0xc2c43b=events[_0xbd0f('0x4')];_0x178a53<_0xc2c43b;_0x178a53++){var _0x440f81=events[_0x178a53];var _0x290f12=createListener(_0xbd0f('0x5')+_0x440f81,_0x2e26c3);WhatsappAccountEvents['on'](_0x440f81,_0x290f12);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 192562a..918f6fe 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 _0x860e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x2dcf58,_0x438ee7){var _0x350794=function(_0x4c4796){while(--_0x4c4796){_0x2dcf58['push'](_0x2dcf58['shift']());}};_0x350794(++_0x438ee7);}(_0x860e,0x18a));var _0xe860=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x860e[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0xe860('0x0'));var util=require(_0xe860('0x1'));var path=require(_0xe860('0x2'));var timeout=require(_0xe860('0x3'));var express=require('express');var router=express[_0xe860('0x4')]();var fs_extra=require(_0xe860('0x5'));var auth=require(_0xe860('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe860('0x7'));router[_0xe860('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe860('0x8')](_0xe860('0x9'),auth[_0xe860('0xa')](),controller[_0xe860('0xb')]);router[_0xe860('0xc')]('/',auth[_0xe860('0xa')](),controller['create']);router[_0xe860('0xd')](_0xe860('0x9'),auth[_0xe860('0xa')](),controller[_0xe860('0xe')]);router[_0xe860('0xf')](_0xe860('0x9'),auth[_0xe860('0xa')](),controller[_0xe860('0x10')]);module[_0xe860('0x11')]=router; \ No newline at end of file +var _0x8682=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x6de21f,_0x18ed5b){var _0xc874fe=function(_0x1921ff){while(--_0x1921ff){_0x6de21f['push'](_0x6de21f['shift']());}};_0xc874fe(++_0x18ed5b);}(_0x8682,0x66));var _0x2868=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x8682[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x2868('0x0'));var util=require(_0x2868('0x1'));var path=require(_0x2868('0x2'));var timeout=require(_0x2868('0x3'));var express=require(_0x2868('0x4'));var router=express[_0x2868('0x5')]();var fs_extra=require(_0x2868('0x6'));var auth=require(_0x2868('0x7'));var interaction=require(_0x2868('0x8'));var config=require(_0x2868('0x9'));var controller=require(_0x2868('0xa'));router['get']('/',auth[_0x2868('0xb')](),controller[_0x2868('0xc')]);router[_0x2868('0xd')](_0x2868('0xe'),auth[_0x2868('0xb')](),controller[_0x2868('0xf')]);router[_0x2868('0x10')]('/',auth[_0x2868('0xb')](),controller[_0x2868('0x11')]);router['put'](_0x2868('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2868('0xe'),auth[_0x2868('0xb')](),controller[_0x2868('0x12')]);module[_0x2868('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 985d329..66a13c7 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 _0xd49b=['noop','TEXT','*,*,*,*','exports'];(function(_0x513e8e,_0x12b851){var _0x12cfda=function(_0xe21cce){while(--_0xe21cce){_0x513e8e['push'](_0x513e8e['shift']());}};_0x12cfda(++_0x12b851);}(_0xd49b,0xd3));var _0xbd49=function(_0x485865,_0x11d29a){_0x485865=_0x485865-0x0;var _0x11ef06=_0xd49b[_0x485865];return _0x11ef06;};'use strict';var Sequelize=require('sequelize');module[_0xbd49('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd49('0x1')},'appdata':{'type':Sequelize[_0xbd49('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xbd49('0x3')}}; \ No newline at end of file +var _0x22f1=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x56cf0b,_0x5a0d72){var _0x59f6c6=function(_0x5b249c){while(--_0x5b249c){_0x56cf0b['push'](_0x56cf0b['shift']());}};_0x59f6c6(++_0x5a0d72);}(_0x22f1,0xe0));var _0x122f=function(_0x442ab3,_0xf176b1){_0x442ab3=_0x442ab3-0x0;var _0x230105=_0x22f1[_0x442ab3];return _0x230105;};'use strict';var Sequelize=require(_0x122f('0x0'));module[_0x122f('0x1')]={'priority':{'type':Sequelize[_0x122f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x122f('0x3')],'allowNull':![],'defaultValue':_0x122f('0x4')},'appdata':{'type':Sequelize[_0x122f('0x5')]()},'description':{'type':Sequelize[_0x122f('0x3')]},'interval':{'type':Sequelize[_0x122f('0x3')],'defaultValue':_0x122f('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 211d389..f54ad51 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 _0x4a03=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x165785,_0x249128){var _0x20bdd5=function(_0x383c40){while(--_0x383c40){_0x165785['push'](_0x165785['shift']());}};_0x20bdd5(++_0x249128);}(_0x4a03,0x16e));var _0x34a0=function(_0x27557a,_0x274124){_0x27557a=_0x27557a-0x0;var _0x206664=_0x4a03[_0x27557a];return _0x206664;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34a0('0x0'));var zipdir=require(_0x34a0('0x1'));var jsonpatch=require(_0x34a0('0x2'));var rp=require('request-promise');var moment=require(_0x34a0('0x3'));var BPromise=require(_0x34a0('0x4'));var Mustache=require(_0x34a0('0x5'));var util=require('util');var path=require(_0x34a0('0x6'));var sox=require(_0x34a0('0x7'));var csv=require('to-csv');var ejs=require(_0x34a0('0x8'));var fs=require('fs');var fs_extra=require(_0x34a0('0x9'));var _=require('lodash');var squel=require(_0x34a0('0xa'));var crypto=require(_0x34a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x34a0('0xc'));var toCsv=require(_0x34a0('0xd'));var querystring=require(_0x34a0('0xe'));var Papa=require(_0x34a0('0xf'));var Redis=require(_0x34a0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x34a0('0x11'));var as=require(_0x34a0('0x12'));var hardwareService=require(_0x34a0('0x13'));var logger=require(_0x34a0('0x14'))(_0x34a0('0x15'));var utils=require(_0x34a0('0x16'));var config=require(_0x34a0('0x17'));var licenseUtil=require(_0x34a0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5506cb,_0x9e08fb){_0x9e08fb=_0x9e08fb||0xcc;return function(_0x220f9a){if(_0x220f9a){return _0x5506cb['sendStatus'](_0x9e08fb);}return _0x5506cb[_0x34a0('0x19')](_0x9e08fb)[_0x34a0('0x1a')]();};}function respondWithResult(_0x126d89,_0x46c0e2){_0x46c0e2=_0x46c0e2||0xc8;return function(_0x1b647a){if(_0x1b647a){return _0x126d89[_0x34a0('0x19')](_0x46c0e2)[_0x34a0('0x1b')](_0x1b647a);}};}function respondWithFilteredResult(_0x1f3d7a,_0x3fb308){return function(_0x22eac3){if(_0x22eac3){var _0x148042=typeof _0x3fb308[_0x34a0('0x1c')]===_0x34a0('0x1d')&&typeof _0x3fb308[_0x34a0('0x1e')]===_0x34a0('0x1d');var _0x1ae2a8=_0x22eac3[_0x34a0('0x1f')];var _0x224cca=_0x148042?0x0:_0x3fb308[_0x34a0('0x1c')];var _0x2c5325=_0x148042?_0x22eac3['count']:_0x3fb308[_0x34a0('0x1c')]+_0x3fb308[_0x34a0('0x1e')];var _0x1d00ef;if(_0x2c5325>=_0x1ae2a8){_0x2c5325=_0x1ae2a8;_0x1d00ef=0xc8;}else{_0x1d00ef=0xce;}_0x1f3d7a[_0x34a0('0x19')](_0x1d00ef);return _0x1f3d7a[_0x34a0('0x20')](_0x34a0('0x21'),_0x224cca+'-'+_0x2c5325+'/'+_0x1ae2a8)['json'](_0x22eac3);}return null;};}function patchUpdates(_0x120780){return function(_0x21aafb){try{jsonpatch[_0x34a0('0x22')](_0x21aafb,_0x120780,!![]);}catch(_0x3943e3){return BPromise[_0x34a0('0x23')](_0x3943e3);}return _0x21aafb[_0x34a0('0x24')]();};}function saveUpdates(_0x518a0c,_0x4358d2){return function(_0xd668e3){if(_0xd668e3){return _0xd668e3[_0x34a0('0x25')](_0x518a0c)[_0x34a0('0x26')](function(_0x412031){return _0x412031;});}return null;};}function removeEntity(_0xbc5c86,_0x5354c7){return function(_0x2a25dd){if(_0x2a25dd){return _0x2a25dd[_0x34a0('0x27')]()['then'](function(){_0xbc5c86[_0x34a0('0x19')](0xcc)[_0x34a0('0x1a')]();});}};}function handleEntityNotFound(_0x4fdbc3,_0x41e278){return function(_0x14b3e8){if(!_0x14b3e8){_0x4fdbc3[_0x34a0('0x28')](0x194);}return _0x14b3e8;};}function handleError(_0x213632,_0x79046f){_0x79046f=_0x79046f||0x1f4;return function(_0x5c49be){logger[_0x34a0('0x29')](_0x5c49be[_0x34a0('0x2a')]);if(_0x5c49be[_0x34a0('0x2b')]){delete _0x5c49be[_0x34a0('0x2b')];}_0x213632[_0x34a0('0x19')](_0x79046f)[_0x34a0('0x2c')](_0x5c49be);};}exports['index']=function(_0x55d52a,_0x2b4c60){var _0x599c30={},_0x333ecf={},_0x2b35c8={'count':0x0,'rows':[]};var _0x11d4d2=_[_0x34a0('0x2d')](db[_0x34a0('0x2e')][_0x34a0('0x2f')],function(_0x5821f1){return{'name':_0x5821f1[_0x34a0('0x30')],'type':_0x5821f1[_0x34a0('0x31')][_0x34a0('0x32')]};});_0x333ecf[_0x34a0('0x33')]=_[_0x34a0('0x2d')](_0x11d4d2,_0x34a0('0x2b'));_0x333ecf[_0x34a0('0x34')]=_[_0x34a0('0x35')](_0x55d52a[_0x34a0('0x34')]);_0x333ecf[_0x34a0('0x36')]=_[_0x34a0('0x37')](_0x333ecf[_0x34a0('0x33')],_0x333ecf[_0x34a0('0x34')]);_0x599c30[_0x34a0('0x38')]=_['intersection'](_0x333ecf[_0x34a0('0x33')],qs[_0x34a0('0x39')](_0x55d52a[_0x34a0('0x34')]['fields']));_0x599c30[_0x34a0('0x38')]=_0x599c30['attributes'][_0x34a0('0x3a')]?_0x599c30[_0x34a0('0x38')]:_0x333ecf[_0x34a0('0x33')];if(!_0x55d52a[_0x34a0('0x34')][_0x34a0('0x3b')](_0x34a0('0x3c'))){_0x599c30['limit']=qs[_0x34a0('0x1e')](_0x55d52a['query'][_0x34a0('0x1e')]);_0x599c30[_0x34a0('0x1c')]=qs[_0x34a0('0x1c')](_0x55d52a['query'][_0x34a0('0x1c')]);}_0x599c30[_0x34a0('0x3d')]=qs[_0x34a0('0x3e')](_0x55d52a[_0x34a0('0x34')]['sort']);_0x599c30['where']=qs[_0x34a0('0x36')](_[_0x34a0('0x3f')](_0x55d52a['query'],_0x333ecf[_0x34a0('0x36')]),_0x11d4d2);if(_0x55d52a[_0x34a0('0x34')]['filter']){_0x599c30['where']=_['merge'](_0x599c30['where'],{'$or':_[_0x34a0('0x2d')](_0x11d4d2,function(_0x371bd1){if(_0x371bd1[_0x34a0('0x31')]!==_0x34a0('0x40')){var _0x253045={};_0x253045[_0x371bd1[_0x34a0('0x2b')]]={'$like':'%'+_0x55d52a[_0x34a0('0x34')][_0x34a0('0x41')]+'%'};return _0x253045;}})});}_0x599c30=_[_0x34a0('0x42')]({},_0x599c30,_0x55d52a[_0x34a0('0x43')]);var _0x2952b4={'where':_0x599c30['where']};return db[_0x34a0('0x2e')]['count'](_0x2952b4)['then'](function(_0x152c28){_0x2b35c8[_0x34a0('0x1f')]=_0x152c28;if(_0x55d52a[_0x34a0('0x34')][_0x34a0('0x44')]){_0x599c30[_0x34a0('0x45')]=[{'all':!![]}];}return db[_0x34a0('0x2e')][_0x34a0('0x46')](_0x599c30);})[_0x34a0('0x26')](function(_0x3c736){_0x2b35c8[_0x34a0('0x47')]=_0x3c736;return _0x2b35c8;})[_0x34a0('0x26')](respondWithFilteredResult(_0x2b4c60,_0x599c30))[_0x34a0('0x48')](handleError(_0x2b4c60,null));};exports[_0x34a0('0x49')]=function(_0x442da2,_0x368af5){var _0x253018={'raw':!![],'where':{'id':_0x442da2[_0x34a0('0x4a')]['id']}},_0x5cddc3={};_0x5cddc3[_0x34a0('0x33')]=_['keys'](db[_0x34a0('0x2e')]['rawAttributes']);_0x5cddc3[_0x34a0('0x34')]=_[_0x34a0('0x35')](_0x442da2[_0x34a0('0x34')]);_0x5cddc3[_0x34a0('0x36')]=_['intersection'](_0x5cddc3['model'],_0x5cddc3['query']);_0x253018[_0x34a0('0x38')]=_[_0x34a0('0x37')](_0x5cddc3['model'],qs[_0x34a0('0x39')](_0x442da2[_0x34a0('0x34')][_0x34a0('0x39')]));_0x253018[_0x34a0('0x38')]=_0x253018[_0x34a0('0x38')][_0x34a0('0x3a')]?_0x253018[_0x34a0('0x38')]:_0x5cddc3[_0x34a0('0x33')];if(_0x442da2['query'][_0x34a0('0x44')]){_0x253018[_0x34a0('0x45')]=[{'all':!![]}];}_0x253018=_[_0x34a0('0x42')]({},_0x253018,_0x442da2[_0x34a0('0x43')]);return db[_0x34a0('0x2e')]['find'](_0x253018)[_0x34a0('0x26')](handleEntityNotFound(_0x368af5,null))[_0x34a0('0x26')](respondWithResult(_0x368af5,null))[_0x34a0('0x48')](handleError(_0x368af5,null));};exports[_0x34a0('0x4b')]=function(_0x3397b4,_0x3bfdf4){return db[_0x34a0('0x2e')][_0x34a0('0x4b')](_0x3397b4[_0x34a0('0x4c')],{})[_0x34a0('0x26')](respondWithResult(_0x3bfdf4,0xc9))['catch'](handleError(_0x3bfdf4,null));};exports[_0x34a0('0x25')]=function(_0x47cfd3,_0x1483c4){if(_0x47cfd3[_0x34a0('0x4c')]['id']){delete _0x47cfd3['body']['id'];}return db['WhatsappApplication'][_0x34a0('0x4d')]({'where':{'id':_0x47cfd3[_0x34a0('0x4a')]['id']}})[_0x34a0('0x26')](handleEntityNotFound(_0x1483c4,null))['then'](saveUpdates(_0x47cfd3['body'],null))['then'](respondWithResult(_0x1483c4,null))[_0x34a0('0x48')](handleError(_0x1483c4,null));};exports['destroy']=function(_0x1ae2a5,_0x2a5c03){return db[_0x34a0('0x2e')][_0x34a0('0x4d')]({'where':{'id':_0x1ae2a5[_0x34a0('0x4a')]['id']}})[_0x34a0('0x26')](handleEntityNotFound(_0x2a5c03,null))[_0x34a0('0x26')](removeEntity(_0x2a5c03,null))[_0x34a0('0x48')](handleError(_0x2a5c03,null));}; \ No newline at end of file +var _0x5f66=['update','catch','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','../../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','WhatsappApplication','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body'];(function(_0x123917,_0x45e5c6){var _0x3352df=function(_0x248ea5){while(--_0x248ea5){_0x123917['push'](_0x123917['shift']());}};_0x3352df(++_0x45e5c6);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'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')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['WhatsappApplication'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 34a1000..b063fc5 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 _0x3c7b=['api','moment','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x2130a2,_0x3a8d4d){_0x2130a2=_0x2130a2-0x0;var _0x93ef5a=_0x3c7b[_0x2130a2];return _0x93ef5a;};'use strict';var _=require(_0xb3c7('0x0'));var util=require(_0xb3c7('0x1'));var logger=require(_0xb3c7('0x2'))(_0xb3c7('0x3'));var moment=require(_0xb3c7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb3c7('0x5'));var attributes=require(_0xb3c7('0x6'));module['exports']=function(_0x396a46,_0x5b810b){return _0x396a46[_0xb3c7('0x7')](_0xb3c7('0x8'),attributes,{'tableName':_0xb3c7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb3c7('0xa'),'collate':_0xb3c7('0xb')});}; \ No newline at end of file +var _0xb0b9=['./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x6bfb2d,_0x482a27){var _0xe35878=function(_0x2ba3f9){while(--_0x2ba3f9){_0x6bfb2d['push'](_0x6bfb2d['shift']());}};_0xe35878(++_0x482a27);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x3ead1b,_0x44b24c){_0x3ead1b=_0x3ead1b-0x0;var _0x3089fd=_0xb0b9[_0x3ead1b];return _0x3089fd;};'use strict';var _=require(_0x9b0b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9b0b('0x1'));var moment=require(_0x9b0b('0x2'));var BPromise=require(_0x9b0b('0x3'));var rp=require(_0x9b0b('0x4'));var fs=require('fs');var path=require(_0x9b0b('0x5'));var rimraf=require(_0x9b0b('0x6'));var config=require(_0x9b0b('0x7'));var attributes=require(_0x9b0b('0x8'));module[_0x9b0b('0x9')]=function(_0x24d4a9,_0x2c3d97){return _0x24d4a9[_0x9b0b('0xa')](_0x9b0b('0xb'),attributes,{'tableName':_0x9b0b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index dbd0b6f..ae311c1 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 _0xd0bb=['debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x163b26,_0x4bb623){var _0x27476d=function(_0x52e58c){while(--_0x52e58c){_0x163b26['push'](_0x163b26['shift']());}};_0x27476d(++_0x4bb623);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4544d3,_0x149a72){_0x4544d3=_0x4544d3-0x0;var _0x36aeca=_0xd0bb[_0x4544d3];return _0x36aeca;};'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});function respondWithRpcPromise(_0x37c205,_0x809599,_0x5eb975){return new BPromise(function(_0x2a4075,_0x4533ff){return client[_0xbd0b('0xa')](_0x37c205,_0x5eb975)[_0xbd0b('0xb')](function(_0x16e185){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'));logger[_0xbd0b('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x809599,_0xbd0b('0xc'),JSON[_0xbd0b('0xe')](_0x16e185));if(_0x16e185['error']){if(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x10')]===0x1f4){logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);return _0x4533ff(_0x16e185[_0xbd0b('0xf')][_0xbd0b('0x12')]);}logger[_0xbd0b('0xf')](_0xbd0b('0x11'),_0x809599,_0x16e185[_0xbd0b('0xf')]['message']);return _0x2a4075(_0x16e185[_0xbd0b('0xf')]['message']);}else{logger['info'](_0xbd0b('0x11'),_0x809599,_0xbd0b('0xc'));_0x2a4075(_0x16e185[_0xbd0b('0x13')][_0xbd0b('0x12')]);}})[_0xbd0b('0x14')](function(_0x546db3){logger['error'](_0xbd0b('0x11'),_0x809599,_0x546db3);_0x4533ff(_0x546db3);});});} \ No newline at end of file +var _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2589a4,_0x5bbc0e){var _0x4951f9=function(_0x267a55){while(--_0x267a55){_0x2589a4['push'](_0x2589a4['shift']());}};_0x4951f9(++_0x5bbc0e);}(_0xac31,0xca));var _0x1ac3=function(_0x3d361e,_0x133e30){_0x3d361e=_0x3d361e-0x0;var _0x52350b=_0xac31[_0x3d361e];return _0x52350b;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 00e3d6a..0706c19 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 _0x885a=['describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x885a,0x180));var _0xa885=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x885a[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0xa885('0x0'));var path=require(_0xa885('0x1'));var timeout=require(_0xa885('0x2'));var express=require(_0xa885('0x3'));var router=express['Router']();var fs_extra=require(_0xa885('0x4'));var auth=require(_0xa885('0x5'));var interaction=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var controller=require(_0xa885('0x8'));router[_0xa885('0x9')]('/',auth['isAuthenticated'](),controller[_0xa885('0xa')]);router[_0xa885('0x9')](_0xa885('0xb'),auth['isAuthenticated'](),controller[_0xa885('0xc')]);router[_0xa885('0x9')](_0xa885('0xd'),auth['isAuthenticated'](),controller[_0xa885('0xe')]);router[_0xa885('0x9')](_0xa885('0xf'),auth[_0xa885('0x10')](),controller[_0xa885('0x11')]);router[_0xa885('0x9')](_0xa885('0x12'),auth['isAuthenticated'](),controller[_0xa885('0x13')]);router[_0xa885('0x14')]('/',auth[_0xa885('0x10')](),controller[_0xa885('0x15')]);router[_0xa885('0x14')](_0xa885('0xf'),auth[_0xa885('0x10')](),controller['addMessage']);router[_0xa885('0x14')](_0xa885('0x16'),auth[_0xa885('0x10')](),interaction[_0xa885('0x17')](_0xa885('0x18'),'whatsappinteraction:addtags'),controller[_0xa885('0x19')]);router[_0xa885('0x1a')]('/:id',auth[_0xa885('0x10')](),interaction[_0xa885('0x17')]('whatsapp',_0xa885('0x1b')),controller[_0xa885('0x1c')]);router['delete'](_0xa885('0xd'),auth['isAuthenticated'](),interaction[_0xa885('0x17')](_0xa885('0x18'),_0xa885('0x1d')),controller['destroy']);router[_0xa885('0x1e')]('/:id/tags',auth[_0xa885('0x10')](),controller[_0xa885('0x1f')]);module[_0xa885('0x20')]=router; \ No newline at end of file +var _0xc949=['post','create','addMessage','/:id/tags','whatsapp','addTags','put','whatsappinteraction:update','delete','tracked','whatsappinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xc949,0x181));var _0x9c94=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc949[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0x8')](_0x9c94('0xf'),auth[_0x9c94('0x9')](),controller['getMessages']);router[_0x9c94('0x8')](_0x9c94('0x10'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);router[_0x9c94('0x12')](_0x9c94('0xf'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x14')]);router[_0x9c94('0x12')](_0x9c94('0x15'),auth[_0x9c94('0x9')](),interaction['tracked'](_0x9c94('0x16'),'whatsappinteraction:addtags'),controller[_0x9c94('0x17')]);router[_0x9c94('0x18')]('/:id',auth[_0x9c94('0x9')](),interaction['tracked']('whatsapp',_0x9c94('0x19')),controller['update']);router[_0x9c94('0x1a')](_0x9c94('0xd'),auth['isAuthenticated'](),interaction[_0x9c94('0x1b')](_0x9c94('0x16'),_0x9c94('0x1c')),controller[_0x9c94('0x1d')]);router[_0x9c94('0x1a')](_0x9c94('0x15'),auth[_0x9c94('0x9')](),controller['removeTags']);module[_0x9c94('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 0190981..46b77a7 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 _0xdcf6=['moment','exports','BOOLEAN','DATE','STRING','out'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x431c26,_0x4b8f47){_0x431c26=_0x431c26-0x0;var _0x3092fd=_0xdcf6[_0x431c26];return _0x3092fd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6dcf('0x0'));module[_0x6dcf('0x1')]={'closed':{'type':Sequelize[_0x6dcf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6dcf('0x3')]},'disposition':{'type':Sequelize[_0x6dcf('0x4')]},'secondDisposition':{'type':Sequelize[_0x6dcf('0x4')]},'thirdDisposition':{'type':Sequelize[_0x6dcf('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x6dcf('0x4')]},'read1stAt':{'type':Sequelize[_0x6dcf('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6dcf('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6dcf('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x37cc=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x37cc,0x185));var _0xc37c=function(_0x1010b7,_0x1420a1){_0x1010b7=_0x1010b7-0x0;var _0x5aec14=_0x37cc[_0x1010b7];return _0x5aec14;};'use strict';var Sequelize=require(_0xc37c('0x0'));var moment=require(_0xc37c('0x1'));module[_0xc37c('0x2')]={'closed':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc37c('0x4')]},'disposition':{'type':Sequelize[_0xc37c('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc37c('0x5')]},'phone':{'type':Sequelize[_0xc37c('0x5')]},'read1stAt':{'type':Sequelize[_0xc37c('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc37c('0x6')]('in',_0xc37c('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc37c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc37c('0x6')]('in',_0xc37c('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc37c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 49eda6c..5de2c05 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 _0x60f2=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','end','status','json','offset','limit','undefined','count','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','key','getOptions','findAll','whatsapp','query','user','catch','show','model','keys','WhatsappInteraction','intersection','fields','attributes','length','includeAll','include','merge','find','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','filters','hasOwnProperty','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','Tag','emit','whatsappInteractionTags:save','removeTags','unix','files','tmp','root','server','transcript-%d-%s.zip','join','push','User','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','Account','Owner','get','Whatsapp','toString','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','read','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment'];(function(_0x43dfb7,_0x1f5b0a){var _0x4f6af6=function(_0x2d6aec){while(--_0x2d6aec){_0x43dfb7['push'](_0x43dfb7['shift']());}};_0x4f6af6(++_0x1f5b0a);}(_0x60f2,0x178));var _0x260f=function(_0x16426c,_0x11c82f){_0x16426c=_0x16426c-0x0;var _0x4e6f84=_0x60f2[_0x16426c];return _0x4e6f84;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x260f('0x0'));var BPromise=require(_0x260f('0x1'));var util=require(_0x260f('0x2'));var path=require(_0x260f('0x3'));var ejs=require(_0x260f('0x4'));var fs=require('fs');var _=require(_0x260f('0x5'));var Redis=require(_0x260f('0x6'));var interaction=require(_0x260f('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x260f('0x8'))(_0x260f('0x9'));var config=require(_0x260f('0xa'));var db=require(_0x260f('0xb'))['db'];config[_0x260f('0xc')]=_[_0x260f('0xd')](config[_0x260f('0xc')],{'host':_0x260f('0xe'),'port':0x18eb});var socket=require(_0x260f('0xf'))(new Redis(config[_0x260f('0xc')]));require(_0x260f('0x10'))[_0x260f('0x11')](socket);function respondWithStatusCode(_0x21b741,_0x2f870e){_0x2f870e=_0x2f870e||0xcc;return function(_0x2ee850){if(_0x2ee850){return _0x21b741['sendStatus'](_0x2f870e);}return _0x21b741['status'](_0x2f870e)[_0x260f('0x12')]();};}function respondWithResult(_0xd170d9,_0x6fc0ed){_0x6fc0ed=_0x6fc0ed||0xc8;return function(_0x58feff){if(_0x58feff){return _0xd170d9[_0x260f('0x13')](_0x6fc0ed)[_0x260f('0x14')](_0x58feff);}};}function respondWithFilteredResult(_0xa65050,_0x52d2a2){return function(_0x1d5a5b){if(_0x1d5a5b){var _0x17c990=typeof _0x52d2a2[_0x260f('0x15')]==='undefined'&&typeof _0x52d2a2[_0x260f('0x16')]===_0x260f('0x17');var _0x35b388=_0x1d5a5b['count'];var _0x2b1560=_0x17c990?0x0:_0x52d2a2[_0x260f('0x15')];var _0x2dc5fc=_0x17c990?_0x1d5a5b[_0x260f('0x18')]:_0x52d2a2['offset']+_0x52d2a2[_0x260f('0x16')];var _0x32c287;if(_0x2dc5fc>=_0x35b388){_0x2dc5fc=_0x35b388;_0x32c287=0xc8;}else{_0x32c287=0xce;}_0xa65050['status'](_0x32c287);return _0xa65050['set']('Content-Range',_0x2b1560+'-'+_0x2dc5fc+'/'+_0x35b388)['json'](_0x1d5a5b);}return null;};}function saveUpdates(_0xaa58fc){return function(_0x54a877){if(_0x54a877){return _0x54a877[_0x260f('0x19')](_0xaa58fc)[_0x260f('0x1a')](function(_0x32c4eb){return _0x32c4eb;});}return null;};}function removeEntity(_0x12f6f7){return function(_0xebbedc){if(_0xebbedc){return _0xebbedc[_0x260f('0x1b')]()[_0x260f('0x1a')](function(){_0x12f6f7[_0x260f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e8bc5){return function(_0x3fd91a){if(!_0x3fd91a){_0x3e8bc5[_0x260f('0x1c')](0x194);}return _0x3fd91a;};}function handleError(_0x467a63,_0x5515d9){_0x5515d9=_0x5515d9||0x1f4;return function(_0xa4e150){logger[_0x260f('0x1d')](_0xa4e150[_0x260f('0x1e')]);if(_0xa4e150[_0x260f('0x1f')]){delete _0xa4e150[_0x260f('0x1f')];}_0x467a63[_0x260f('0x13')](_0x5515d9)[_0x260f('0x20')](_0xa4e150);};}exports['index']=function(_0x2022bc,_0x26602a){var _0x4c4026={};var _0x3f030=_[_0x260f('0x21')](db['WhatsappInteraction'][_0x260f('0x22')],function(_0x3591ac){return{'name':_0x3591ac['fieldName'],'type':_0x3591ac['type'][_0x260f('0x23')]};});_0x4c4026=qs[_0x260f('0x24')](_0x3f030,_0x2022bc);return interaction[_0x260f('0x25')](_0x260f('0x26'),_0x2022bc[_0x260f('0x27')],_0x2022bc[_0x260f('0x28')],_0x4c4026,_0x3f030)[_0x260f('0x1a')](respondWithFilteredResult(_0x26602a,_0x4c4026))[_0x260f('0x29')](handleError(_0x26602a,null));};exports[_0x260f('0x2a')]=function(_0x19bb62,_0x5d138a){var _0x4fa97b={'raw':![],'where':{'id':_0x19bb62['params']['id']}},_0x4fa171={};_0x4fa171[_0x260f('0x2b')]=_[_0x260f('0x2c')](db[_0x260f('0x2d')][_0x260f('0x22')]);_0x4fa171[_0x260f('0x27')]=_['keys'](_0x19bb62[_0x260f('0x27')]);_0x4fa171['filters']=_[_0x260f('0x2e')](_0x4fa171[_0x260f('0x2b')],_0x4fa171['query']);_0x4fa97b['attributes']=_[_0x260f('0x2e')](_0x4fa171[_0x260f('0x2b')],qs[_0x260f('0x2f')](_0x19bb62[_0x260f('0x27')][_0x260f('0x2f')]));_0x4fa97b[_0x260f('0x30')]=_0x4fa97b['attributes'][_0x260f('0x31')]?_0x4fa97b[_0x260f('0x30')]:_0x4fa171[_0x260f('0x2b')];if(_0x19bb62[_0x260f('0x27')][_0x260f('0x32')]){_0x4fa97b[_0x260f('0x33')]=[{'all':!![]}];}_0x4fa97b=_[_0x260f('0x34')]({},_0x4fa97b,_0x19bb62['options']);return db[_0x260f('0x2d')][_0x260f('0x35')](_0x4fa97b)[_0x260f('0x1a')](handleEntityNotFound(_0x5d138a,null))[_0x260f('0x1a')](respondWithResult(_0x5d138a,null))['catch'](handleError(_0x5d138a,null));};exports[_0x260f('0x36')]=function(_0x31be91,_0x31e4a){return db[_0x260f('0x2d')][_0x260f('0x36')](_0x31be91[_0x260f('0x37')],{})['then'](respondWithResult(_0x31e4a,0xc9))[_0x260f('0x29')](handleError(_0x31e4a,null));};exports[_0x260f('0x19')]=function(_0x72c55d,_0x579431){if(_0x72c55d[_0x260f('0x37')]['id']){delete _0x72c55d[_0x260f('0x37')]['id'];}return db['WhatsappInteraction'][_0x260f('0x35')]({'where':{'id':_0x72c55d[_0x260f('0x38')]['id']}})[_0x260f('0x1a')](handleEntityNotFound(_0x579431,null))[_0x260f('0x1a')](saveUpdates(_0x72c55d[_0x260f('0x37')],null))['then'](respondWithResult(_0x579431,null))[_0x260f('0x29')](handleError(_0x579431,null));};exports[_0x260f('0x1b')]=function(_0x4b5ffe,_0x2074ce){return db[_0x260f('0x2d')]['find']({'where':{'id':_0x4b5ffe[_0x260f('0x38')]['id']}})[_0x260f('0x1a')](handleEntityNotFound(_0x2074ce,null))[_0x260f('0x1a')](removeEntity(_0x2074ce,null))[_0x260f('0x29')](handleError(_0x2074ce,null));};exports[_0x260f('0x39')]=function(_0x4d0026,_0x1bb657){return db[_0x260f('0x2d')][_0x260f('0x39')]()[_0x260f('0x1a')](respondWithResult(_0x1bb657,null))[_0x260f('0x29')](handleError(_0x1bb657,null));};exports['addMessage']=function(_0x5cfde3,_0x42fb88){return db['WhatsappMessage']['find']({'where':{'id':_0x5cfde3[_0x260f('0x38')]['id']}})[_0x260f('0x1a')](handleEntityNotFound(_0x42fb88,null))[_0x260f('0x1a')](function(_0x184446){if(_0x184446){return _0x184446[_0x260f('0x3a')](_0x5cfde3[_0x260f('0x37')][_0x260f('0x3b')],_[_0x260f('0x3c')](_0x5cfde3[_0x260f('0x37')],['ids','id'])||{});}})[_0x260f('0x1a')](respondWithResult(_0x42fb88,null))[_0x260f('0x29')](handleError(_0x42fb88,null));};exports[_0x260f('0x3d')]=function(_0x328362,_0x2e90e0){var _0x27a770={'raw':![],'where':{}};var _0x1614ff={};var _0x32129b={'count':0x0,'rows':[]};return db[_0x260f('0x2d')][_0x260f('0x3e')]({'where':{'id':_0x328362[_0x260f('0x38')]['id']}})[_0x260f('0x1a')](handleEntityNotFound(_0x2e90e0,null))[_0x260f('0x1a')](function(_0x4aa6b5){if(_0x4aa6b5){_0x1614ff['model']=_[_0x260f('0x2c')](db[_0x260f('0x3f')]['rawAttributes']);_0x1614ff[_0x260f('0x27')]=_[_0x260f('0x2c')](_0x328362[_0x260f('0x27')]);_0x1614ff[_0x260f('0x40')]=_[_0x260f('0x2e')](_0x1614ff['model'],_0x1614ff['query']);_0x27a770[_0x260f('0x30')]=_[_0x260f('0x2e')](_0x1614ff[_0x260f('0x2b')],qs[_0x260f('0x2f')](_0x328362['query']['fields']));_0x27a770[_0x260f('0x30')]=_0x27a770['attributes'][_0x260f('0x31')]?_0x27a770[_0x260f('0x30')]:_0x1614ff[_0x260f('0x2b')];if(!_0x328362[_0x260f('0x27')][_0x260f('0x41')](_0x260f('0x42'))){_0x27a770[_0x260f('0x16')]=qs['limit'](_0x328362[_0x260f('0x27')][_0x260f('0x16')]);_0x27a770[_0x260f('0x15')]=qs[_0x260f('0x15')](_0x328362[_0x260f('0x27')]['offset']);}_0x27a770[_0x260f('0x43')]=qs[_0x260f('0x44')](_0x328362[_0x260f('0x27')][_0x260f('0x44')]);_0x27a770['where']=qs['filters'](_[_0x260f('0x45')](_0x328362[_0x260f('0x27')],_0x1614ff['filters']));_0x27a770[_0x260f('0x46')][_0x260f('0x47')]=_0x4aa6b5['id'];if(_0x328362['query']['filter']){_0x27a770[_0x260f('0x46')]=_[_0x260f('0x34')](_0x27a770[_0x260f('0x46')],{'$or':_[_0x260f('0x21')](_0x27a770[_0x260f('0x30')],function(_0x3f6328){var _0x341299={};_0x341299[_0x3f6328]={'$like':'%'+_0x328362[_0x260f('0x27')][_0x260f('0x48')]+'%'};return _0x341299;})});}if(_0x328362[_0x260f('0x27')][_0x260f('0x49')]){var _0x3c43c7=_0x328362[_0x260f('0x27')][_0x260f('0x49')][_0x260f('0x4a')](',');var _0x12ed1e={};_0x12ed1e[_0x3c43c7[0x0]]={'$gte':moment(_0x3c43c7[0x1])[_0x260f('0x4b')](_0x260f('0x4c'))};_0x27a770[_0x260f('0x46')]=_[_0x260f('0x34')](_0x27a770[_0x260f('0x46')],_0x12ed1e);}_0x27a770=_[_0x260f('0x34')]({},_0x27a770,_0x328362[_0x260f('0x4d')]);return db['WhatsappMessage'][_0x260f('0x18')]({'where':_0x27a770[_0x260f('0x46')]})['then'](function(_0x30dca5){_0x32129b[_0x260f('0x18')]=_0x30dca5;if(_0x328362[_0x260f('0x27')]['includeAll']){_0x27a770[_0x260f('0x33')]=[{'all':!![]}];}return db[_0x260f('0x3f')]['findAll'](_0x27a770);})[_0x260f('0x1a')](function(_0x5cb8e3){_0x32129b[_0x260f('0x4e')]=_0x5cb8e3;return _0x32129b;});}})['then'](respondWithFilteredResult(_0x2e90e0,_0x27a770))[_0x260f('0x29')](handleError(_0x2e90e0,null));};exports[_0x260f('0x4f')]=function(_0x314ebe,_0x2edd66){return db[_0x260f('0x2d')]['find']({'where':{'id':_0x314ebe['params']['id']}})[_0x260f('0x1a')](handleEntityNotFound(_0x2edd66,null))['then'](function(_0x49b5af){if(_0x49b5af){return _0x49b5af[_0x260f('0x50')](_0x314ebe[_0x260f('0x37')]['ids'],_[_0x260f('0x3c')](_0x314ebe[_0x260f('0x37')],[_0x260f('0x3b'),'id'])||{})['spread'](function(){return db[_0x260f('0x51')][_0x260f('0x25')]({'attributes':['id',_0x260f('0x1f'),'color'],'where':{'id':_0x314ebe['body']['ids']}});})['then'](function(_0x3f215e){socket[_0x260f('0x52')](_0x260f('0x53'),{'id':Number(_0x314ebe['params']['id']),'tags':_0x3f215e||[]});return{'id':Number(_0x314ebe[_0x260f('0x38')]['id']),'tags':_0x3f215e||[]};});}})[_0x260f('0x1a')](respondWithResult(_0x2edd66,null))['catch'](handleError(_0x2edd66,null));};exports[_0x260f('0x54')]=function(_0x521d81,_0x16cb2f){return db['WhatsappInteraction'][_0x260f('0x35')]({'where':{'id':_0x521d81[_0x260f('0x38')]['id']}})[_0x260f('0x1a')](handleEntityNotFound(_0x16cb2f,null))[_0x260f('0x1a')](function(_0x59a2c3){if(_0x59a2c3){return _0x59a2c3[_0x260f('0x54')](_0x521d81[_0x260f('0x27')][_0x260f('0x3b')]);}})['then'](respondWithStatusCode(_0x16cb2f,null))['catch'](handleError(_0x16cb2f,null));};exports['download']=function(_0x1a7a8c,_0xe90c23){var _0x2e41fe=moment()[_0x260f('0x55')]()['toString']();var _0xae5cd=path['join'](config['root'],'server',_0x260f('0x56'),_0x260f('0x57'));var _0x55d473=path['join'](config[_0x260f('0x58')],_0x260f('0x59'),_0x260f('0x56'),'attachments');var _0x32ccdc=path['join'](_0xae5cd,_0x2e41fe);var _0x30ecc=util[_0x260f('0x4b')](_0x260f('0x5a'),_0x1a7a8c[_0x260f('0x38')]['id'],_0x2e41fe);var _0x1dfdeb=path[_0x260f('0x5b')](_0xae5cd,_0x30ecc);var _0x56ac77=[];_0x56ac77[_0x260f('0x5c')]({'model':db[_0x260f('0x5d')],'as':_0x260f('0x5d'),'attributes':['id',_0x260f('0x5e')],'raw':!![]});_0x56ac77[_0x260f('0x5c')]({'model':db[_0x260f('0x5f')],'as':_0x260f('0x60'),'attributes':['id',_0x260f('0x61'),_0x260f('0x62')],'raw':!![]});if(_0x1a7a8c[_0x260f('0x27')][_0x260f('0x63')]){_0x56ac77[_0x260f('0x5c')]({'model':db['Attachment'],'as':_0x260f('0x64'),'raw':!![]});}var _0x5246bd=[{'model':db[_0x260f('0x3f')],'as':_0x260f('0x65'),'attributes':['id','body',_0x260f('0x66'),_0x260f('0x67'),'secret','read'],'include':_0x56ac77}];_0x5246bd['push']({'model':db['WhatsappAccount'],'as':_0x260f('0x68'),'attributes':['id',_0x260f('0x1f')]});_0x5246bd[_0x260f('0x5c')]({'model':db['User'],'as':_0x260f('0x69'),'attributes':['id',_0x260f('0x5e')]});return db[_0x260f('0x2d')][_0x260f('0x35')]({'where':{'id':_0x1a7a8c['params']['id']},'include':_0x5246bd})[_0x260f('0x1a')](handleEntityNotFound(_0xe90c23,null))['then'](function(_0x568eda){if(_0x568eda){var _0x34a80e=_0x568eda[_0x260f('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x32ccdc);var _0x84be1a={'channel':_0x260f('0x6b'),'account':_0x34a80e['Account'][_0x260f('0x1f')],'agent':_0x34a80e[_0x260f('0x69')]?_0x34a80e['Owner'][_0x260f('0x5e')]:'N.A.','createdAt':moment(_0x34a80e[_0x260f('0x66')])[_0x260f('0x4b')](_0x260f('0x4c'))[_0x260f('0x6c')](),'closedAt':_0x34a80e[_0x260f('0x6d')]?moment(_0x34a80e[_0x260f('0x6e')])[_0x260f('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x260f('0x6c')]():'','disposition':_0x34a80e[_0x260f('0x6f')],'messages':_(_0x34a80e[_0x260f('0x65')])['filter']({'secret':![]})['map'](function(_0x59054a){if(_0x59054a['Attachment']){var _0x437e1f=path['join'](_0x55d473,_0x59054a[_0x260f('0x64')][_0x260f('0x70')]);if(fs[_0x260f('0x71')](_0x437e1f)){fs[_0x260f('0x72')](_0x437e1f)[_0x260f('0x73')](fs[_0x260f('0x74')](path[_0x260f('0x5b')](_0x32ccdc,_0x59054a[_0x260f('0x64')][_0x260f('0x70')])));}}return{'date':moment(_0x59054a[_0x260f('0x66')])[_0x260f('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x260f('0x6c')](),'sender':_0x59054a['direction']===_0x260f('0x75')?_0x59054a[_0x260f('0x5d')]?_0x59054a[_0x260f('0x5d')][_0x260f('0x5e')]:_0x260f('0x76'):_0x59054a[_0x260f('0x60')][_0x260f('0x61')]+(_0x59054a[_0x260f('0x60')][_0x260f('0x62')]?'\x20'+_0x59054a[_0x260f('0x60')][_0x260f('0x62')]:''),'body':_0x59054a[_0x260f('0x64')]?_0x59054a[_0x260f('0x64')]['basename']:_0x59054a['body'],'direction':_0x59054a[_0x260f('0x67')]===_0x260f('0x75')?'A':'C','secret':_0x59054a[_0x260f('0x77')],'read':_0x59054a[_0x260f('0x78')],'attachment':_0x59054a[_0x260f('0x64')]};})['value']()};return ejs[_0x260f('0x79')](path['join'](config[_0x260f('0x58')],_0x260f('0x59'),_0x260f('0x7a'),_0x260f('0x7b')),{'interaction':_0x84be1a})[_0x260f('0x1a')](function(_0x29677a){var _0x378939=path['join'](_0x32ccdc,_0x260f('0x7c')+_0x34a80e['id']+'-'+_0x2e41fe+_0x260f('0x7d'));var _0x3e82fe={'path':_0x378939,'channel':_0x260f('0x6b'),'interactionId':_0x34a80e['id']};return pdf['createPdfFromHTML'](_0x29677a,_0x3e82fe);})[_0x260f('0x1a')](function(){return new BPromise(function(_0x1cfcf9,_0x4bb626){zipdir(_0x32ccdc,{'saveTo':_0x1dfdeb},function(_0x464235,_0x4918e6){if(_0x464235)return _0x4bb626(_0x464235);return _0x1cfcf9(_0x4918e6);});})[_0x260f('0x1a')](function(){return new BPromise(function(_0x1a0873,_0x2059dc){rimraf(_0x32ccdc,function(_0x2a14d5){if(_0x2a14d5)_0x2059dc(_0x2a14d5);return _0x1a0873();});});})[_0x260f('0x1a')](function(){return _0xe90c23['download'](_0x1dfdeb,_0x30ecc,function(_0x334cec){if(_0x334cec){console[_0x260f('0x7e')](_0x260f('0x7f'),_0x334cec);}else{fs[_0x260f('0x80')](_0x1dfdeb);}});});});}else{return _0xe90c23[_0x260f('0x1c')](0xc8);}})[_0x260f('0x29')](handleError(_0xe90c23,null));}; \ No newline at end of file +var _0xa988=['spread','Tag','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','mkdirSync','N.A.','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','secret','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','./whatsappInteraction.socket','register','sendStatus','end','status','limit','count','offset','set','Content-Range','update','then','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','whatsapp','query','catch','show','params','model','filters','intersection','fields','attributes','length','includeAll','include','merge','options','create','body','find','destroy','describe','addMessage','ids','omit','findOne','keys','WhatsappMessage','hasOwnProperty','order','sort','where','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows'];(function(_0x4b8548,_0x2b33fd){var _0x2485dc=function(_0x41cad5){while(--_0x41cad5){_0x4b8548['push'](_0x4b8548['shift']());}};_0x2485dc(++_0x2b33fd);}(_0xa988,0x1a7));var _0x8a98=function(_0x180451,_0x3533f1){_0x180451=_0x180451-0x0;var _0x4c3a39=_0xa988[_0x180451];return _0x4c3a39;};'use strict';var rimraf=require(_0x8a98('0x0'));var zipdir=require(_0x8a98('0x1'));var moment=require(_0x8a98('0x2'));var BPromise=require(_0x8a98('0x3'));var util=require(_0x8a98('0x4'));var path=require('path');var ejs=require(_0x8a98('0x5'));var fs=require('fs');var _=require(_0x8a98('0x6'));var Redis=require(_0x8a98('0x7'));var interaction=require(_0x8a98('0x8'));var qs=require(_0x8a98('0x9'));var pdf=require(_0x8a98('0xa'));var logger=require(_0x8a98('0xb'))(_0x8a98('0xc'));var config=require('../../config/environment');var db=require(_0x8a98('0xd'))['db'];config[_0x8a98('0xe')]=_['defaults'](config[_0x8a98('0xe')],{'host':_0x8a98('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8a98('0x10'))[_0x8a98('0x11')](socket);function respondWithStatusCode(_0x51f11f,_0x3cac53){_0x3cac53=_0x3cac53||0xcc;return function(_0xf73acb){if(_0xf73acb){return _0x51f11f[_0x8a98('0x12')](_0x3cac53);}return _0x51f11f['status'](_0x3cac53)[_0x8a98('0x13')]();};}function respondWithResult(_0x282591,_0x100159){_0x100159=_0x100159||0xc8;return function(_0x50fd87){if(_0x50fd87){return _0x282591[_0x8a98('0x14')](_0x100159)['json'](_0x50fd87);}};}function respondWithFilteredResult(_0x55dcde,_0x56e619){return function(_0x12da45){if(_0x12da45){var _0x4a317f=typeof _0x56e619['offset']==='undefined'&&typeof _0x56e619[_0x8a98('0x15')]==='undefined';var _0x28f117=_0x12da45[_0x8a98('0x16')];var _0x304f0b=_0x4a317f?0x0:_0x56e619[_0x8a98('0x17')];var _0xf02e1=_0x4a317f?_0x12da45[_0x8a98('0x16')]:_0x56e619[_0x8a98('0x17')]+_0x56e619[_0x8a98('0x15')];var _0x5d4ac5;if(_0xf02e1>=_0x28f117){_0xf02e1=_0x28f117;_0x5d4ac5=0xc8;}else{_0x5d4ac5=0xce;}_0x55dcde['status'](_0x5d4ac5);return _0x55dcde[_0x8a98('0x18')](_0x8a98('0x19'),_0x304f0b+'-'+_0xf02e1+'/'+_0x28f117)['json'](_0x12da45);}return null;};}function saveUpdates(_0x336cf6){return function(_0x4c91d6){if(_0x4c91d6){return _0x4c91d6[_0x8a98('0x1a')](_0x336cf6)[_0x8a98('0x1b')](function(_0xc9658d){return _0xc9658d;});}return null;};}function removeEntity(_0xf35f5){return function(_0x289a2d){if(_0x289a2d){return _0x289a2d['destroy']()['then'](function(){_0xf35f5[_0x8a98('0x14')](0xcc)[_0x8a98('0x13')]();});}};}function handleEntityNotFound(_0x272ab7){return function(_0x291d03){if(!_0x291d03){_0x272ab7[_0x8a98('0x12')](0x194);}return _0x291d03;};}function handleError(_0x43e3ce,_0x3b9b88){_0x3b9b88=_0x3b9b88||0x1f4;return function(_0xde5a55){logger[_0x8a98('0x1c')](_0xde5a55[_0x8a98('0x1d')]);if(_0xde5a55['name']){delete _0xde5a55[_0x8a98('0x1e')];}_0x43e3ce[_0x8a98('0x14')](_0x3b9b88)[_0x8a98('0x1f')](_0xde5a55);};}exports[_0x8a98('0x20')]=function(_0x4448aa,_0x486164){var _0x1deb61={};var _0x58f590=_['map'](db[_0x8a98('0x21')][_0x8a98('0x22')],function(_0x21c720){return{'name':_0x21c720[_0x8a98('0x23')],'type':_0x21c720[_0x8a98('0x24')][_0x8a98('0x25')]};});_0x1deb61=qs['getOptions'](_0x58f590,_0x4448aa);return interaction[_0x8a98('0x26')](_0x8a98('0x27'),_0x4448aa[_0x8a98('0x28')],_0x4448aa['user'],_0x1deb61,_0x58f590)[_0x8a98('0x1b')](respondWithFilteredResult(_0x486164,_0x1deb61))[_0x8a98('0x29')](handleError(_0x486164,null));};exports[_0x8a98('0x2a')]=function(_0x2f4aba,_0x558bb1){var _0x27f3b1={'raw':![],'where':{'id':_0x2f4aba[_0x8a98('0x2b')]['id']}},_0x5edd60={};_0x5edd60[_0x8a98('0x2c')]=_['keys'](db[_0x8a98('0x21')][_0x8a98('0x22')]);_0x5edd60[_0x8a98('0x28')]=_['keys'](_0x2f4aba[_0x8a98('0x28')]);_0x5edd60[_0x8a98('0x2d')]=_[_0x8a98('0x2e')](_0x5edd60[_0x8a98('0x2c')],_0x5edd60[_0x8a98('0x28')]);_0x27f3b1['attributes']=_['intersection'](_0x5edd60[_0x8a98('0x2c')],qs[_0x8a98('0x2f')](_0x2f4aba[_0x8a98('0x28')][_0x8a98('0x2f')]));_0x27f3b1[_0x8a98('0x30')]=_0x27f3b1[_0x8a98('0x30')][_0x8a98('0x31')]?_0x27f3b1['attributes']:_0x5edd60['model'];if(_0x2f4aba[_0x8a98('0x28')][_0x8a98('0x32')]){_0x27f3b1[_0x8a98('0x33')]=[{'all':!![]}];}_0x27f3b1=_[_0x8a98('0x34')]({},_0x27f3b1,_0x2f4aba[_0x8a98('0x35')]);return db[_0x8a98('0x21')]['find'](_0x27f3b1)[_0x8a98('0x1b')](handleEntityNotFound(_0x558bb1,null))['then'](respondWithResult(_0x558bb1,null))[_0x8a98('0x29')](handleError(_0x558bb1,null));};exports['create']=function(_0x75ef3f,_0x1d88ea){return db[_0x8a98('0x21')][_0x8a98('0x36')](_0x75ef3f[_0x8a98('0x37')],{})[_0x8a98('0x1b')](respondWithResult(_0x1d88ea,0xc9))[_0x8a98('0x29')](handleError(_0x1d88ea,null));};exports['update']=function(_0x54ef1a,_0x166f42){if(_0x54ef1a['body']['id']){delete _0x54ef1a[_0x8a98('0x37')]['id'];}return db[_0x8a98('0x21')][_0x8a98('0x38')]({'where':{'id':_0x54ef1a[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x166f42,null))['then'](saveUpdates(_0x54ef1a[_0x8a98('0x37')],null))[_0x8a98('0x1b')](respondWithResult(_0x166f42,null))[_0x8a98('0x29')](handleError(_0x166f42,null));};exports[_0x8a98('0x39')]=function(_0x8c71bb,_0x3953ff){return db['WhatsappInteraction'][_0x8a98('0x38')]({'where':{'id':_0x8c71bb[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x3953ff,null))[_0x8a98('0x1b')](removeEntity(_0x3953ff,null))[_0x8a98('0x29')](handleError(_0x3953ff,null));};exports[_0x8a98('0x3a')]=function(_0x101301,_0x29385f){return db['WhatsappInteraction'][_0x8a98('0x3a')]()['then'](respondWithResult(_0x29385f,null))[_0x8a98('0x29')](handleError(_0x29385f,null));};exports[_0x8a98('0x3b')]=function(_0x17a946,_0x2f450c){return db['WhatsappMessage'][_0x8a98('0x38')]({'where':{'id':_0x17a946[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x2f450c,null))[_0x8a98('0x1b')](function(_0x12d689){if(_0x12d689){return _0x12d689[_0x8a98('0x3b')](_0x17a946['body'][_0x8a98('0x3c')],_[_0x8a98('0x3d')](_0x17a946['body'],[_0x8a98('0x3c'),'id'])||{});}})[_0x8a98('0x1b')](respondWithResult(_0x2f450c,null))[_0x8a98('0x29')](handleError(_0x2f450c,null));};exports['getMessages']=function(_0x5bdbf7,_0x3a03f3){var _0x15e676={'raw':![],'where':{}};var _0x4c4535={};var _0x1a69ef={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8a98('0x3e')]({'where':{'id':_0x5bdbf7[_0x8a98('0x2b')]['id']}})[_0x8a98('0x1b')](handleEntityNotFound(_0x3a03f3,null))[_0x8a98('0x1b')](function(_0x1df134){if(_0x1df134){_0x4c4535[_0x8a98('0x2c')]=_[_0x8a98('0x3f')](db[_0x8a98('0x40')][_0x8a98('0x22')]);_0x4c4535['query']=_[_0x8a98('0x3f')](_0x5bdbf7[_0x8a98('0x28')]);_0x4c4535[_0x8a98('0x2d')]=_[_0x8a98('0x2e')](_0x4c4535[_0x8a98('0x2c')],_0x4c4535[_0x8a98('0x28')]);_0x15e676['attributes']=_[_0x8a98('0x2e')](_0x4c4535['model'],qs['fields'](_0x5bdbf7['query'][_0x8a98('0x2f')]));_0x15e676[_0x8a98('0x30')]=_0x15e676['attributes']['length']?_0x15e676[_0x8a98('0x30')]:_0x4c4535[_0x8a98('0x2c')];if(!_0x5bdbf7[_0x8a98('0x28')][_0x8a98('0x41')]('nolimit')){_0x15e676['limit']=qs[_0x8a98('0x15')](_0x5bdbf7[_0x8a98('0x28')]['limit']);_0x15e676[_0x8a98('0x17')]=qs[_0x8a98('0x17')](_0x5bdbf7['query'][_0x8a98('0x17')]);}_0x15e676[_0x8a98('0x42')]=qs[_0x8a98('0x43')](_0x5bdbf7['query'][_0x8a98('0x43')]);_0x15e676['where']=qs[_0x8a98('0x2d')](_['pick'](_0x5bdbf7[_0x8a98('0x28')],_0x4c4535[_0x8a98('0x2d')]));_0x15e676[_0x8a98('0x44')][_0x8a98('0x45')]=_0x1df134['id'];if(_0x5bdbf7[_0x8a98('0x28')][_0x8a98('0x46')]){_0x15e676[_0x8a98('0x44')]=_[_0x8a98('0x34')](_0x15e676[_0x8a98('0x44')],{'$or':_[_0x8a98('0x47')](_0x15e676[_0x8a98('0x30')],function(_0x3290d7){var _0x25e850={};_0x25e850[_0x3290d7]={'$like':'%'+_0x5bdbf7['query'][_0x8a98('0x46')]+'%'};return _0x25e850;})});}if(_0x5bdbf7[_0x8a98('0x28')]['$gte']){var _0x3c61b2=_0x5bdbf7['query'][_0x8a98('0x48')][_0x8a98('0x49')](',');var _0x15c3de={};_0x15c3de[_0x3c61b2[0x0]]={'$gte':moment(_0x3c61b2[0x1])[_0x8a98('0x4a')](_0x8a98('0x4b'))};_0x15e676[_0x8a98('0x44')]=_[_0x8a98('0x34')](_0x15e676[_0x8a98('0x44')],_0x15c3de);}_0x15e676=_[_0x8a98('0x34')]({},_0x15e676,_0x5bdbf7['options']);return db[_0x8a98('0x40')][_0x8a98('0x16')]({'where':_0x15e676['where']})[_0x8a98('0x1b')](function(_0x5725e3){_0x1a69ef[_0x8a98('0x16')]=_0x5725e3;if(_0x5bdbf7[_0x8a98('0x28')][_0x8a98('0x32')]){_0x15e676[_0x8a98('0x33')]=[{'all':!![]}];}return db[_0x8a98('0x40')]['findAll'](_0x15e676);})[_0x8a98('0x1b')](function(_0x4a4609){_0x1a69ef[_0x8a98('0x4c')]=_0x4a4609;return _0x1a69ef;});}})[_0x8a98('0x1b')](respondWithFilteredResult(_0x3a03f3,_0x15e676))[_0x8a98('0x29')](handleError(_0x3a03f3,null));};exports['addTags']=function(_0x3eda45,_0x270338){return db[_0x8a98('0x21')][_0x8a98('0x38')]({'where':{'id':_0x3eda45[_0x8a98('0x2b')]['id']}})['then'](handleEntityNotFound(_0x270338,null))[_0x8a98('0x1b')](function(_0x133838){if(_0x133838){return _0x133838['setTags'](_0x3eda45['body'][_0x8a98('0x3c')],_['omit'](_0x3eda45[_0x8a98('0x37')],[_0x8a98('0x3c'),'id'])||{})[_0x8a98('0x4d')](function(){return db[_0x8a98('0x4e')][_0x8a98('0x26')]({'attributes':['id','name','color'],'where':{'id':_0x3eda45[_0x8a98('0x37')][_0x8a98('0x3c')]}});})[_0x8a98('0x1b')](function(_0x41922f){socket['emit'](_0x8a98('0x4f'),{'id':Number(_0x3eda45[_0x8a98('0x2b')]['id']),'tags':_0x41922f||[]});return{'id':Number(_0x3eda45[_0x8a98('0x2b')]['id']),'tags':_0x41922f||[]};});}})['then'](respondWithResult(_0x270338,null))[_0x8a98('0x29')](handleError(_0x270338,null));};exports[_0x8a98('0x50')]=function(_0x4c753f,_0x5af254){return db[_0x8a98('0x21')][_0x8a98('0x38')]({'where':{'id':_0x4c753f[_0x8a98('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af254,null))['then'](function(_0x54ad2a){if(_0x54ad2a){return _0x54ad2a['removeTags'](_0x4c753f[_0x8a98('0x28')][_0x8a98('0x3c')]);}})[_0x8a98('0x1b')](respondWithStatusCode(_0x5af254,null))[_0x8a98('0x29')](handleError(_0x5af254,null));};exports[_0x8a98('0x51')]=function(_0x5caa01,_0x3517a7){var _0x346ecd=moment()[_0x8a98('0x52')]()[_0x8a98('0x53')]();var _0x30a451=path[_0x8a98('0x54')](config[_0x8a98('0x55')],_0x8a98('0x56'),_0x8a98('0x57'),_0x8a98('0x58'));var _0x2c5bd1=path['join'](config[_0x8a98('0x55')],_0x8a98('0x56'),_0x8a98('0x57'),_0x8a98('0x59'));var _0xe2cb84=path[_0x8a98('0x54')](_0x30a451,_0x346ecd);var _0x46df35=util[_0x8a98('0x4a')](_0x8a98('0x5a'),_0x5caa01['params']['id'],_0x346ecd);var _0x10589b=path['join'](_0x30a451,_0x46df35);var _0x2b73b8=[];_0x2b73b8[_0x8a98('0x5b')]({'model':db['User'],'as':_0x8a98('0x5c'),'attributes':['id',_0x8a98('0x5d')],'raw':!![]});_0x2b73b8[_0x8a98('0x5b')]({'model':db[_0x8a98('0x5e')],'as':_0x8a98('0x5f'),'attributes':['id','firstName',_0x8a98('0x60')],'raw':!![]});if(_0x5caa01[_0x8a98('0x28')][_0x8a98('0x59')]){_0x2b73b8[_0x8a98('0x5b')]({'model':db[_0x8a98('0x61')],'as':_0x8a98('0x61'),'raw':!![]});}var _0x488cdf=[{'model':db[_0x8a98('0x40')],'as':_0x8a98('0x62'),'attributes':['id','body',_0x8a98('0x63'),_0x8a98('0x64'),'secret',_0x8a98('0x65')],'include':_0x2b73b8}];_0x488cdf[_0x8a98('0x5b')]({'model':db[_0x8a98('0x66')],'as':_0x8a98('0x67'),'attributes':['id',_0x8a98('0x1e')]});_0x488cdf[_0x8a98('0x5b')]({'model':db[_0x8a98('0x5c')],'as':_0x8a98('0x68'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x8a98('0x38')]({'where':{'id':_0x5caa01[_0x8a98('0x2b')]['id']},'include':_0x488cdf})[_0x8a98('0x1b')](handleEntityNotFound(_0x3517a7,null))[_0x8a98('0x1b')](function(_0x5d4f3e){if(_0x5d4f3e){var _0x191856=_0x5d4f3e['get']({'plain':!![]});fs[_0x8a98('0x69')](_0xe2cb84);var _0x2a4a82={'channel':'Whatsapp','account':_0x191856['Account'][_0x8a98('0x1e')],'agent':_0x191856[_0x8a98('0x68')]?_0x191856[_0x8a98('0x68')][_0x8a98('0x5d')]:_0x8a98('0x6a'),'createdAt':moment(_0x191856[_0x8a98('0x63')])[_0x8a98('0x4a')](_0x8a98('0x4b'))[_0x8a98('0x53')](),'closedAt':_0x191856['closed']?moment(_0x191856[_0x8a98('0x6b')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8a98('0x53')]():'','disposition':_0x191856[_0x8a98('0x6c')],'messages':_(_0x191856[_0x8a98('0x62')])['filter']({'secret':![]})[_0x8a98('0x47')](function(_0x2ca7e0){if(_0x2ca7e0[_0x8a98('0x61')]){var _0x506543=path[_0x8a98('0x54')](_0x2c5bd1,_0x2ca7e0[_0x8a98('0x61')][_0x8a98('0x6d')]);if(fs[_0x8a98('0x6e')](_0x506543)){fs[_0x8a98('0x6f')](_0x506543)[_0x8a98('0x70')](fs[_0x8a98('0x71')](path[_0x8a98('0x54')](_0xe2cb84,_0x2ca7e0[_0x8a98('0x61')][_0x8a98('0x6d')])));}}return{'date':moment(_0x2ca7e0[_0x8a98('0x63')])['format'](_0x8a98('0x4b'))[_0x8a98('0x53')](),'sender':_0x2ca7e0[_0x8a98('0x64')]===_0x8a98('0x72')?_0x2ca7e0[_0x8a98('0x5c')]?_0x2ca7e0[_0x8a98('0x5c')]['fullname']:_0x8a98('0x73'):_0x2ca7e0[_0x8a98('0x5f')][_0x8a98('0x74')]+(_0x2ca7e0[_0x8a98('0x5f')][_0x8a98('0x60')]?'\x20'+_0x2ca7e0[_0x8a98('0x5f')][_0x8a98('0x60')]:''),'body':_0x2ca7e0['Attachment']?_0x2ca7e0['Attachment'][_0x8a98('0x6d')]:_0x2ca7e0[_0x8a98('0x37')],'direction':_0x2ca7e0[_0x8a98('0x64')]===_0x8a98('0x72')?'A':'C','secret':_0x2ca7e0[_0x8a98('0x75')],'read':_0x2ca7e0[_0x8a98('0x65')],'attachment':_0x2ca7e0[_0x8a98('0x61')]};})['value']()};return ejs['renderFile'](path[_0x8a98('0x54')](config[_0x8a98('0x55')],_0x8a98('0x56'),'views','downloadInteraction.ejs'),{'interaction':_0x2a4a82})[_0x8a98('0x1b')](function(_0x19670c){var _0x1ade4a=path[_0x8a98('0x54')](_0xe2cb84,_0x8a98('0x76')+_0x191856['id']+'-'+_0x346ecd+_0x8a98('0x77'));var _0x39ffd1={'path':_0x1ade4a,'channel':_0x8a98('0x78'),'interactionId':_0x191856['id']};return pdf[_0x8a98('0x79')](_0x19670c,_0x39ffd1);})['then'](function(){return new BPromise(function(_0x107aa9,_0x2e1c4f){zipdir(_0xe2cb84,{'saveTo':_0x10589b},function(_0x25f42f,_0x45efe1){if(_0x25f42f)return _0x2e1c4f(_0x25f42f);return _0x107aa9(_0x45efe1);});})[_0x8a98('0x1b')](function(){return new BPromise(function(_0x5c3f57,_0x36644d){rimraf(_0xe2cb84,function(_0x4f7bdd){if(_0x4f7bdd)_0x36644d(_0x4f7bdd);return _0x5c3f57();});});})[_0x8a98('0x1b')](function(){return _0x3517a7[_0x8a98('0x51')](_0x10589b,_0x46df35,function(_0x2929b7){if(_0x2929b7){console[_0x8a98('0x7a')](_0x8a98('0x7b'),_0x2929b7);}else{fs[_0x8a98('0x7c')](_0x10589b);}});});});}else{return _0x3517a7['sendStatus'](0xc8);}})[_0x8a98('0x29')](handleError(_0x3517a7,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 3392637..a653392 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 _0xdb76=['save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x27d602,_0xe15d76){var _0x347975=function(_0x1dae2a){while(--_0x1dae2a){_0x27d602['push'](_0x27d602['shift']());}};_0x347975(++_0xe15d76);}(_0xdb76,0x1be));var _0x6db7=function(_0x1ce04f,_0x3b77e1){_0x1ce04f=_0x1ce04f-0x0;var _0x3bb931=_0xdb76[_0x1ce04f];return _0x3bb931;};'use strict';var EventEmitter=require(_0x6db7('0x0'));var WhatsappInteraction=require(_0x6db7('0x1'))['db'][_0x6db7('0x2')];var WhatsappMessage=require(_0x6db7('0x1'))['db'][_0x6db7('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6db7('0x4'),'afterUpdate':_0x6db7('0x5'),'afterDestroy':_0x6db7('0x6')};function emitEvent(_0x40f6ce){return function(_0x57a095,_0x117f1c,_0x7bba2d){_0x57a095[_0x6db7('0x7')]({'attributes':['id'],'raw':!![]})[_0x6db7('0x8')](function(_0x3b7b8a){_0x57a095['setDataValue'](_0x6db7('0x9'),_0x3b7b8a[_0x6db7('0xa')](function(_0x4e2553){return{'id':_0x4e2553['id']};}));return WhatsappMessage[_0x6db7('0xb')]({'where':{'WhatsappInteractionId':_0x57a095['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6db7('0x8')](function(_0x582d31){_0x57a095[_0x6db7('0xc')](_0x6db7('0xd'),_0x582d31[_0x6db7('0xe')]);WhatsappInteractionEvents['emit'](_0x40f6ce+':'+_0x57a095['id'],_0x57a095);WhatsappInteractionEvents['emit'](_0x40f6ce,_0x57a095);_0x7bba2d(null);})[_0x6db7('0xf')](_0x7bba2d(null));};}for(var e in events){if(events[_0x6db7('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x6db7('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x6be1=['update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6be1,0x12f));var _0x16be=function(_0x5a0c89,_0x5195ea){_0x5a0c89=_0x5a0c89-0x0;var _0x5edcb5=_0x6be1[_0x5a0c89];return _0x5edcb5;};'use strict';var EventEmitter=require(_0x16be('0x0'));var WhatsappInteraction=require(_0x16be('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16be('0x2'),'afterUpdate':_0x16be('0x3'),'afterDestroy':_0x16be('0x4')};function emitEvent(_0x18fafc){return function(_0x8e7a1,_0x5743a,_0x36e4da){_0x8e7a1[_0x16be('0x5')]({'attributes':['id'],'raw':!![]})[_0x16be('0x6')](function(_0x1c5e94){_0x8e7a1['setDataValue'](_0x16be('0x7'),_0x1c5e94[_0x16be('0x8')](function(_0x1c0460){return{'id':_0x1c0460['id']};}));return WhatsappMessage[_0x16be('0x9')]({'where':{'WhatsappInteractionId':_0x8e7a1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x16be('0x6')](function(_0x3227ca){_0x8e7a1[_0x16be('0xa')](_0x16be('0xb'),_0x3227ca[_0x16be('0xc')]);WhatsappInteractionEvents[_0x16be('0xd')](_0x18fafc+':'+_0x8e7a1['id'],_0x8e7a1);WhatsappInteractionEvents[_0x16be('0xd')](_0x18fafc,_0x8e7a1);_0x36e4da(null);})[_0x16be('0xe')](_0x36e4da(null));};}for(var e in events){if(events[_0x16be('0xf')](e)){var event=events[e];WhatsappInteraction[_0x16be('0x10')](e,emitEvent(event));}}module[_0x16be('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index f1f452f..36b2d67 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 _0xa52f=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','lodash'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xa52f,0xb3));var _0xfa52=function(_0x4403b8,_0x596ab6){_0x4403b8=_0x4403b8-0x0;var _0x1df4e4=_0xa52f[_0x4403b8];return _0x1df4e4;};'use strict';var _=require(_0xfa52('0x0'));var util=require(_0xfa52('0x1'));var logger=require(_0xfa52('0x2'))(_0xfa52('0x3'));var moment=require(_0xfa52('0x4'));var BPromise=require(_0xfa52('0x5'));var rp=require(_0xfa52('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa52('0x7'));var config=require(_0xfa52('0x8'));var attributes=require(_0xfa52('0x9'));module[_0xfa52('0xa')]=function(_0x3af3ff,_0x3e6693){return _0x3af3ff[_0xfa52('0xb')](_0xfa52('0xc'),attributes,{'tableName':_0xfa52('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1dae03,_0x5dfb61,_0x2cded2){if(_0x1dae03[_0xfa52('0xe')](_0xfa52('0xf'))){_0x1dae03[_0xfa52('0x10')]=moment()[_0xfa52('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2cded2(null,_0x1dae03);}}});}; \ No newline at end of file +var _0xfaa4=['define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','lodash','util','../../config/logger','moment','./whatsappInteraction.attributes','exports'];(function(_0x4b55e8,_0x41ba7e){var _0x46e844=function(_0x2b1e4f){while(--_0x2b1e4f){_0x4b55e8['push'](_0x4b55e8['shift']());}};_0x46e844(++_0x41ba7e);}(_0xfaa4,0x17a));var _0x4faa=function(_0x1875e5,_0x2e953a){_0x1875e5=_0x1875e5-0x0;var _0x199da0=_0xfaa4[_0x1875e5];return _0x199da0;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var logger=require(_0x4faa('0x2'))('api');var moment=require(_0x4faa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4faa('0x4'));module[_0x4faa('0x5')]=function(_0x26d8ac,_0x6fe7da){return _0x26d8ac[_0x4faa('0x6')](_0x4faa('0x7'),attributes,{'tableName':_0x4faa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x353019,_0x388487,_0x2d2c74){if(_0x353019[_0x4faa('0x9')](_0x4faa('0xa'))){_0x353019['closedAt']=moment()[_0x4faa('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d2c74(null,_0x353019);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 8d60fc6..c149e7c 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 _0x860c=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','catch','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x506372,_0x23e53c){var _0x552825=function(_0x56b4fb){while(--_0x56b4fb){_0x506372['push'](_0x506372['shift']());}};_0x552825(++_0x23e53c);}(_0x860c,0xac));var _0xc860=function(_0x202707,_0x21bdfe){_0x202707=_0x202707-0x0;var _0x1d2e8a=_0x860c[_0x202707];return _0x1d2e8a;};'use strict';var _=require('lodash');var util=require(_0xc860('0x0'));var moment=require(_0xc860('0x1'));var BPromise=require(_0xc860('0x2'));var rs=require(_0xc860('0x3'));var fs=require('fs');var Redis=require(_0xc860('0x4'));var db=require(_0xc860('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc860('0x6'))(_0xc860('0x7'));var config=require(_0xc860('0x8'));var jayson=require(_0xc860('0x9'));var client=jayson[_0xc860('0xa')][_0xc860('0xb')]({'port':0x232a});config[_0xc860('0xc')]=_[_0xc860('0xd')](config[_0xc860('0xc')],{'host':_0xc860('0xe'),'port':0x18eb});var socket=require(_0xc860('0xf'))(new Redis(config[_0xc860('0xc')]));require(_0xc860('0x10'))[_0xc860('0x11')](socket);function respondWithRpcPromise(_0x253278,_0x2c793f,_0x2b7c69){return new BPromise(function(_0x40ca6e,_0x18df99){return client['request'](_0x253278,_0x2b7c69)[_0xc860('0x12')](function(_0x53c2b1){logger[_0xc860('0x13')](_0xc860('0x14'),_0x2c793f,_0xc860('0x15'));logger[_0xc860('0x16')](_0xc860('0x17'),_0x2c793f,'request\x20sent',JSON[_0xc860('0x18')](_0x53c2b1));if(_0x53c2b1[_0xc860('0x19')]){if(_0x53c2b1['error'][_0xc860('0x1a')]===0x1f4){logger['error'](_0xc860('0x14'),_0x2c793f,_0x53c2b1[_0xc860('0x19')]['message']);return _0x18df99(_0x53c2b1[_0xc860('0x19')][_0xc860('0x1b')]);}logger[_0xc860('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x2c793f,_0x53c2b1[_0xc860('0x19')][_0xc860('0x1b')]);return _0x40ca6e(_0x53c2b1[_0xc860('0x19')][_0xc860('0x1b')]);}else{logger[_0xc860('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x2c793f,_0xc860('0x15'));_0x40ca6e(_0x53c2b1[_0xc860('0x1c')][_0xc860('0x1b')]);}})['catch'](function(_0x238ff4){logger[_0xc860('0x19')](_0xc860('0x14'),_0x2c793f,_0x238ff4);_0x18df99(_0x238ff4);});});}exports[_0xc860('0x1d')]=function(_0x368973){var _0x30a02f=this;return new Promise(function(_0x3ce263,_0x19c4d8){return db[_0xc860('0x1e')][_0xc860('0x1f')](_0x368973[_0xc860('0x20')],{'raw':_0x368973[_0xc860('0x21')]?_0x368973['options'][_0xc860('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x368973['options']?_0x368973[_0xc860('0x21')][_0xc860('0x23')]||null:null,'attributes':_0x368973[_0xc860('0x21')]?_0x368973[_0xc860('0x21')]['attributes']||null:null,'limit':_0x368973[_0xc860('0x21')]?_0x368973['options'][_0xc860('0x24')]||null:null})[_0xc860('0x12')](function(_0x1f76fc){logger[_0xc860('0x13')](_0xc860('0x1d'),_0x368973);logger[_0xc860('0x16')](_0xc860('0x1d'),_0x368973,JSON[_0xc860('0x18')](_0x1f76fc));_0x3ce263(_0x1f76fc);})[_0xc860('0x25')](function(_0x487e6e){logger['error']('UpdateWhatsappInteraction',_0x487e6e['message'],_0x368973);_0x19c4d8(_0x30a02f[_0xc860('0x19')](0x1f4,_0x487e6e['message']));});});};exports[_0xc860('0x26')]=function(_0x3f82fa){return new Promise(function(_0x244a91,_0x29f837){return db[_0xc860('0x1e')][_0xc860('0x27')]({'where':_0x3f82fa[_0xc860('0x21')]?_0x3f82fa[_0xc860('0x21')]['where']||null:null})[_0xc860('0x12')](function(_0x2e08ec){if(_0x2e08ec){return _0x2e08ec['addTags'](_0x3f82fa[_0xc860('0x20')][_0xc860('0x28')],_[_0xc860('0x29')](_0x3f82fa[_0xc860('0x20')],[_0xc860('0x28'),'id'])||{});}})[_0xc860('0x2a')](function(_0x1e726f){logger['info']('AddTags',_0x3f82fa);logger[_0xc860('0x16')](_0xc860('0x2b'),_0x3f82fa,JSON['stringify'](_0x1e726f));_0x244a91(_0x1e726f);})[_0xc860('0x25')](function(_0x57ce58){logger[_0xc860('0x19')](_0xc860('0x2b'),_0x57ce58[_0xc860('0x1b')],_0x3f82fa);_0x29f837(_this[_0xc860('0x19')](0x1f4,_0x57ce58[_0xc860('0x1b')]));});});}; \ No newline at end of file +var _0x1ad3=['catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','info','AddTags','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x35c1cf,_0x197400){var _0x56bc59=function(_0x7b52ad){while(--_0x7b52ad){_0x35c1cf['push'](_0x35c1cf['shift']());}};_0x56bc59(++_0x197400);}(_0x1ad3,0x137));var _0x31ad=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0x1ad3[_0x1bb812];return _0x372adb;};'use strict';var _=require('lodash');var util=require(_0x31ad('0x0'));var moment=require(_0x31ad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31ad('0x2'))['db'];var utils=require(_0x31ad('0x3'));var logger=require(_0x31ad('0x4'))(_0x31ad('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x31ad('0x6')]({'port':0x232a});config[_0x31ad('0x7')]=_[_0x31ad('0x8')](config[_0x31ad('0x7')],{'host':_0x31ad('0x9'),'port':0x18eb});var socket=require(_0x31ad('0xa'))(new Redis(config[_0x31ad('0x7')]));require('./whatsappInteraction.socket')[_0x31ad('0xb')](socket);function respondWithRpcPromise(_0x5438ca,_0x22cc8a,_0x2623d0){return new BPromise(function(_0x588dde,_0x4fc79a){return client[_0x31ad('0xc')](_0x5438ca,_0x2623d0)[_0x31ad('0xd')](function(_0x6856e1){logger['info'](_0x31ad('0xe'),_0x22cc8a,_0x31ad('0xf'));logger[_0x31ad('0x10')](_0x31ad('0x11'),_0x22cc8a,'request\x20sent',JSON[_0x31ad('0x12')](_0x6856e1));if(_0x6856e1['error']){if(_0x6856e1[_0x31ad('0x13')]['code']===0x1f4){logger[_0x31ad('0x13')](_0x31ad('0xe'),_0x22cc8a,_0x6856e1[_0x31ad('0x13')][_0x31ad('0x14')]);return _0x4fc79a(_0x6856e1[_0x31ad('0x13')]['message']);}logger[_0x31ad('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x22cc8a,_0x6856e1['error'][_0x31ad('0x14')]);return _0x588dde(_0x6856e1['error']['message']);}else{logger['info'](_0x31ad('0xe'),_0x22cc8a,_0x31ad('0xf'));_0x588dde(_0x6856e1[_0x31ad('0x15')][_0x31ad('0x14')]);}})[_0x31ad('0x16')](function(_0x560b78){logger[_0x31ad('0x13')](_0x31ad('0xe'),_0x22cc8a,_0x560b78);_0x4fc79a(_0x560b78);});});}exports[_0x31ad('0x17')]=function(_0x38fffc){var _0x579264=this;return new Promise(function(_0x1f3a7e,_0x44766c){return db[_0x31ad('0x18')]['update'](_0x38fffc[_0x31ad('0x19')],{'raw':_0x38fffc['options']?_0x38fffc[_0x31ad('0x1a')][_0x31ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38fffc[_0x31ad('0x1a')]?_0x38fffc[_0x31ad('0x1a')][_0x31ad('0x1c')]||null:null,'attributes':_0x38fffc[_0x31ad('0x1a')]?_0x38fffc['options'][_0x31ad('0x1d')]||null:null,'limit':_0x38fffc['options']?_0x38fffc[_0x31ad('0x1a')]['limit']||null:null})[_0x31ad('0xd')](function(_0x502c9f){logger['info'](_0x31ad('0x17'),_0x38fffc);logger[_0x31ad('0x10')](_0x31ad('0x17'),_0x38fffc,JSON['stringify'](_0x502c9f));_0x1f3a7e(_0x502c9f);})[_0x31ad('0x16')](function(_0x371e01){logger[_0x31ad('0x13')]('UpdateWhatsappInteraction',_0x371e01[_0x31ad('0x14')],_0x38fffc);_0x44766c(_0x579264['error'](0x1f4,_0x371e01[_0x31ad('0x14')]));});});};exports[_0x31ad('0x1e')]=function(_0xa71631){return new Promise(function(_0x579a29,_0x1d3e99){return db[_0x31ad('0x18')]['find']({'where':_0xa71631['options']?_0xa71631['options'][_0x31ad('0x1c')]||null:null})[_0x31ad('0xd')](function(_0xa1f858){if(_0xa1f858){return _0xa1f858[_0x31ad('0x1f')](_0xa71631[_0x31ad('0x19')][_0x31ad('0x20')],_[_0x31ad('0x21')](_0xa71631[_0x31ad('0x19')],[_0x31ad('0x20'),'id'])||{});}})[_0x31ad('0x22')](function(_0x52aa11){logger[_0x31ad('0x23')](_0x31ad('0x24'),_0xa71631);logger[_0x31ad('0x10')]('AddTags',_0xa71631,JSON[_0x31ad('0x12')](_0x52aa11));_0x579a29(_0x52aa11);})[_0x31ad('0x16')](function(_0x2806fb){logger[_0x31ad('0x13')]('AddTags',_0x2806fb[_0x31ad('0x14')],_0xa71631);_0x1d3e99(_this[_0x31ad('0x13')](0x1f4,_0x2806fb[_0x31ad('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 9bc90b2..9b0d9d8 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 _0x56a2=['remove','update','emit','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x562bbd,_0xa0d3bd){var _0x4217d0=function(_0xb4133a){while(--_0xb4133a){_0x562bbd['push'](_0x562bbd['shift']());}};_0x4217d0(++_0xa0d3bd);}(_0x56a2,0x19e));var _0x256a=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x56a2[_0x476bf4];return _0x788ffe;};'use strict';var WhatsappInteractionEvents=require(_0x256a('0x0'));var events=[_0x256a('0x1'),_0x256a('0x2'),_0x256a('0x3')];function createListener(_0x52352e,_0xff97c0){return function(_0x567ff0){_0xff97c0[_0x256a('0x4')](_0x52352e,_0x567ff0);};}function removeListener(_0x3d0c26,_0x23149b){return function(){WhatsappInteractionEvents['removeListener'](_0x3d0c26,_0x23149b);};}exports[_0x256a('0x5')]=function(_0x219a04){for(var _0x3cd2e8=0x0,_0xeadc4c=events[_0x256a('0x6')];_0x3cd2e8<_0xeadc4c;_0x3cd2e8++){var _0x1ac41c=events[_0x3cd2e8];var _0x3b0f9e=createListener(_0x256a('0x7')+_0x1ac41c,_0x219a04);WhatsappInteractionEvents['on'](_0x1ac41c,_0x3b0f9e);}}; \ No newline at end of file +var _0x6693=['./whatsappInteraction.events','save','remove','update','emit','length'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x6693,0x120));var _0x3669=function(_0x49804e,_0x21ef26){_0x49804e=_0x49804e-0x0;var _0x4ecfbc=_0x6693[_0x49804e];return _0x4ecfbc;};'use strict';var WhatsappInteractionEvents=require(_0x3669('0x0'));var events=[_0x3669('0x1'),_0x3669('0x2'),_0x3669('0x3')];function createListener(_0x220ec0,_0xf54c5a){return function(_0x2aebbe){_0xf54c5a[_0x3669('0x4')](_0x220ec0,_0x2aebbe);};}function removeListener(_0x7dcb04,_0xd7011a){return function(){WhatsappInteractionEvents['removeListener'](_0x7dcb04,_0xd7011a);};}exports['register']=function(_0x214515){for(var _0x2586ea=0x0,_0x18b470=events[_0x3669('0x5')];_0x2586ea<_0x18b470;_0x2586ea++){var _0x1b670c=events[_0x2586ea];var _0x1e74c7=createListener('whatsappInteraction:'+_0x1b670c,_0x214515);WhatsappInteractionEvents['on'](_0x1b670c,_0x1e74c7);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 1504aef..d72d08d 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 _0xe813=['whatsapp','/:id/status','status','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0xe813,0x196));var _0x3e81=function(_0x5cdc79,_0x24beb1){_0x5cdc79=_0x5cdc79-0x0;var _0x22ddcf=_0xe813[_0x5cdc79];return _0x22ddcf;};'use strict';var multer=require('multer');var util=require(_0x3e81('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3e81('0x1')]();var fs_extra=require(_0x3e81('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3e81('0x3'));var config=require('../../config/environment');var controller=require(_0x3e81('0x4'));router[_0x3e81('0x5')]('/',auth['isAuthenticated'](),controller[_0x3e81('0x6')]);router[_0x3e81('0x5')](_0x3e81('0x7'),auth[_0x3e81('0x8')](),controller[_0x3e81('0x9')]);router[_0x3e81('0x5')](_0x3e81('0xa'),auth[_0x3e81('0x8')](),controller['show']);router[_0x3e81('0xb')]('/',auth[_0x3e81('0x8')](),interaction['tracked'](_0x3e81('0xc'),'whatsappmessage:create'),controller['create']);router[_0x3e81('0xb')](_0x3e81('0xd'),controller[_0x3e81('0xe')]);router['put'](_0x3e81('0xa'),auth[_0x3e81('0x8')](),controller[_0x3e81('0xf')]);router['put'](_0x3e81('0x10'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x3e81('0x11'),auth[_0x3e81('0x8')](),controller[_0x3e81('0x12')]);router[_0x3e81('0x13')](_0x3e81('0xa'),auth[_0x3e81('0x8')](),controller[_0x3e81('0x14')]);module[_0x3e81('0x15')]=router; \ No newline at end of file +var _0x3320=['reject','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','tracked','whatsapp','whatsappmessage:create','status','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4ea9c8,_0x1bb40e){var _0x482d14=function(_0x5e5a9f){while(--_0x5e5a9f){_0x4ea9c8['push'](_0x4ea9c8['shift']());}};_0x482d14(++_0x1bb40e);}(_0x3320,0x12d));var _0x0332=function(_0x39aedb,_0x11ec9c){_0x39aedb=_0x39aedb-0x0;var _0x1e016f=_0x3320[_0x39aedb];return _0x1e016f;};'use strict';var multer=require('multer');var util=require(_0x0332('0x0'));var path=require(_0x0332('0x1'));var timeout=require(_0x0332('0x2'));var express=require(_0x0332('0x3'));var router=express[_0x0332('0x4')]();var fs_extra=require(_0x0332('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0332('0x6'));var config=require(_0x0332('0x7'));var controller=require('./whatsappMessage.controller');router[_0x0332('0x8')]('/',auth[_0x0332('0x9')](),controller[_0x0332('0xa')]);router[_0x0332('0x8')]('/describe',auth[_0x0332('0x9')](),controller['describe']);router['get'](_0x0332('0xb'),auth[_0x0332('0x9')](),controller[_0x0332('0xc')]);router[_0x0332('0xd')]('/',auth[_0x0332('0x9')](),interaction[_0x0332('0xe')](_0x0332('0xf'),_0x0332('0x10')),controller['create']);router['post']('/:id/status',controller[_0x0332('0x11')]);router[_0x0332('0x12')](_0x0332('0xb'),auth[_0x0332('0x9')](),controller[_0x0332('0x13')]);router[_0x0332('0x12')](_0x0332('0x14'),auth[_0x0332('0x9')](),controller[_0x0332('0x15')]);router[_0x0332('0x12')](_0x0332('0x16'),auth[_0x0332('0x9')](),controller[_0x0332('0x17')]);router[_0x0332('0x18')](_0x0332('0xb'),auth[_0x0332('0x9')](),controller[_0x0332('0x19')]);module[_0x0332('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5ea1a62..cbd44f1 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 _0x9839=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x5598b0,_0x4c96c){var _0x173e51=function(_0xdc6e67){while(--_0xdc6e67){_0x5598b0['push'](_0x5598b0['shift']());}};_0x173e51(++_0x4c96c);}(_0x9839,0x163));var _0x9983=function(_0x5913d5,_0xcc7b53){_0x5913d5=_0x5913d5-0x0;var _0x1e6910=_0x9839[_0x5913d5];return _0x1e6910;};'use strict';var Sequelize=require(_0x9983('0x0'));module[_0x9983('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9983('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9983('0x3')]('in',_0x9983('0x4')),'defaultValue':_0x9983('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9983('0x5')](0xbe)},'phone':{'type':Sequelize[_0x9983('0x5')]},'readAt':{'type':Sequelize[_0x9983('0x6')]},'secret':{'type':Sequelize[_0x9983('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb715=['medium','BOOLEAN','out','STRING','TEXT','exports'];(function(_0x5b734b,_0x486a7f){var _0x2a15a3=function(_0x187239){while(--_0x187239){_0x5b734b['push'](_0x5b734b['shift']());}};_0x2a15a3(++_0x486a7f);}(_0xb715,0x16d));var _0x5b71=function(_0x35c805,_0x468612){_0x35c805=_0x35c805-0x0;var _0x4a7a7f=_0xb715[_0x35c805];return _0x4a7a7f;};'use strict';var Sequelize=require('sequelize');module[_0x5b71('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5b71('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5b71('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5b71('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x5b71('0x4')](0xbe)},'phone':{'type':Sequelize[_0x5b71('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x5b71('0x4')]},'providerResponse':{'type':Sequelize[_0x5b71('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 9c6d1c9..3125bf6 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 _0xa9b8=['register','client','http','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','show','options','find','create','body','update','params','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','read1stAt','format','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','WhatsappInteraction','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','MessageSid','messageId','MessageStatus','inspect','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket'];(function(_0x415e5e,_0x17c8f5){var _0x48f4de=function(_0x2caf25){while(--_0x2caf25){_0x415e5e['push'](_0x415e5e['shift']());}};_0x48f4de(++_0x17c8f5);}(_0xa9b8,0x18b));var _0x8a9b=function(_0x54b915,_0x474c7c){_0x54b915=_0x54b915-0x0;var _0x145200=_0xa9b8[_0x54b915];return _0x145200;};'use strict';var emlformat=require(_0x8a9b('0x0'));var rimraf=require(_0x8a9b('0x1'));var zipdir=require(_0x8a9b('0x2'));var jsonpatch=require(_0x8a9b('0x3'));var rp=require('request-promise');var moment=require(_0x8a9b('0x4'));var BPromise=require(_0x8a9b('0x5'));var Mustache=require(_0x8a9b('0x6'));var util=require('util');var path=require(_0x8a9b('0x7'));var sox=require('sox');var csv=require(_0x8a9b('0x8'));var ejs=require(_0x8a9b('0x9'));var fs=require('fs');var fs_extra=require(_0x8a9b('0xa'));var _=require('lodash');var squel=require(_0x8a9b('0xb'));var crypto=require(_0x8a9b('0xc'));var jsforce=require(_0x8a9b('0xd'));var deskjs=require(_0x8a9b('0xe'));var toCsv=require(_0x8a9b('0x8'));var querystring=require(_0x8a9b('0xf'));var Papa=require(_0x8a9b('0x10'));var Redis=require(_0x8a9b('0x11'));var authService=require(_0x8a9b('0x12'));var qs=require(_0x8a9b('0x13'));var as=require(_0x8a9b('0x14'));var hardwareService=require(_0x8a9b('0x15'));var logger=require(_0x8a9b('0x16'))('api');var utils=require(_0x8a9b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8a9b('0x18'));var db=require(_0x8a9b('0x19'))['db'];config[_0x8a9b('0x1a')]=_[_0x8a9b('0x1b')](config['redis'],{'host':_0x8a9b('0x1c'),'port':0x18eb});var socket=require(_0x8a9b('0x1d'))(new Redis(config[_0x8a9b('0x1a')]));require(_0x8a9b('0x1e'))[_0x8a9b('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8a9b('0x20')][_0x8a9b('0x21')]({'port':0x232c});var client9002=jayson[_0x8a9b('0x20')][_0x8a9b('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x462867,_0x118824,_0x5adff7,_0x5db7dd){return new BPromise(function(_0x2dba67,_0x47113){var _0x2f3917=_0x5db7dd||client;return _0x2f3917['request'](_0x462867,_0x5adff7)[_0x8a9b('0x22')](function(_0x41a0e2){logger[_0x8a9b('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x118824,'request\x20sent');logger[_0x8a9b('0x24')](_0x8a9b('0x25'),_0x118824,_0x8a9b('0x26'),JSON[_0x8a9b('0x27')](_0x41a0e2));if(_0x41a0e2[_0x8a9b('0x28')]){if(_0x41a0e2[_0x8a9b('0x28')]['code']===0x1f4){logger[_0x8a9b('0x28')](_0x8a9b('0x29'),_0x118824,_0x41a0e2[_0x8a9b('0x28')][_0x8a9b('0x2a')]);return _0x47113(_0x41a0e2[_0x8a9b('0x28')][_0x8a9b('0x2a')]);}logger[_0x8a9b('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x118824,_0x41a0e2[_0x8a9b('0x28')][_0x8a9b('0x2a')]);return _0x2dba67(_0x41a0e2['error'][_0x8a9b('0x2a')]);}else{logger[_0x8a9b('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x118824,'request\x20sent');_0x2dba67(_0x41a0e2[_0x8a9b('0x2b')][_0x8a9b('0x2a')]);}})[_0x8a9b('0x2c')](function(_0x57acef){logger[_0x8a9b('0x28')](_0x8a9b('0x29'),_0x118824,_0x57acef);_0x47113(_0x57acef);});});}function respondWithStatusCode(_0x22e74f,_0x4204b0){_0x4204b0=_0x4204b0||0xcc;return function(_0x4c394f){if(_0x4c394f){return _0x22e74f[_0x8a9b('0x2d')](_0x4204b0);}return _0x22e74f['status'](_0x4204b0)[_0x8a9b('0x2e')]();};}function respondWithResult(_0x1d5404,_0xa5a4cc){_0xa5a4cc=_0xa5a4cc||0xc8;return function(_0x51e99a){if(_0x51e99a){return _0x1d5404['status'](_0xa5a4cc)[_0x8a9b('0x2f')](_0x51e99a);}};}function respondWithFilteredResult(_0x43902b,_0x52d32d){return function(_0x402394){if(_0x402394){var _0x5a287a=typeof _0x52d32d['offset']==='undefined'&&typeof _0x52d32d['limit']===_0x8a9b('0x30');var _0x23a0a7=_0x402394[_0x8a9b('0x31')];var _0x1734a3=_0x5a287a?0x0:_0x52d32d[_0x8a9b('0x32')];var _0x219e1d=_0x5a287a?_0x402394['count']:_0x52d32d['offset']+_0x52d32d[_0x8a9b('0x33')];var _0x564e6d;if(_0x219e1d>=_0x23a0a7){_0x219e1d=_0x23a0a7;_0x564e6d=0xc8;}else{_0x564e6d=0xce;}_0x43902b[_0x8a9b('0x34')](_0x564e6d);return _0x43902b[_0x8a9b('0x35')](_0x8a9b('0x36'),_0x1734a3+'-'+_0x219e1d+'/'+_0x23a0a7)['json'](_0x402394);}return null;};}function patchUpdates(_0x5dd2f6){return function(_0x3189a3){try{jsonpatch[_0x8a9b('0x37')](_0x3189a3,_0x5dd2f6,!![]);}catch(_0xd3102c){return BPromise[_0x8a9b('0x38')](_0xd3102c);}return _0x3189a3[_0x8a9b('0x39')]();};}function saveUpdates(_0x245824,_0x1d9870){return function(_0x1ed713){if(_0x1ed713){return _0x1ed713['update'](_0x245824)['then'](function(_0x25dd10){return _0x25dd10;});}return null;};}function removeEntity(_0x419b41,_0x32613c){return function(_0x1a39fd){if(_0x1a39fd){return _0x1a39fd['destroy']()['then'](function(){_0x419b41[_0x8a9b('0x34')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10fb48,_0x5ba908){return function(_0x462ed2){if(!_0x462ed2){_0x10fb48[_0x8a9b('0x2d')](0x194);}return _0x462ed2;};}function handleError(_0x44c2e0,_0x31811a){_0x31811a=_0x31811a||0x1f4;return function(_0x490772){logger[_0x8a9b('0x28')](_0x490772[_0x8a9b('0x3a')]);if(_0x490772[_0x8a9b('0x3b')]){delete _0x490772[_0x8a9b('0x3b')];}_0x44c2e0[_0x8a9b('0x34')](_0x31811a)[_0x8a9b('0x3c')](_0x490772);};}exports[_0x8a9b('0x3d')]=function(_0x16aea5,_0x59e53c){var _0x1f8e36={},_0x5d1491={},_0x4aed9a={'count':0x0,'rows':[]};var _0x13ccdf=_['map'](db[_0x8a9b('0x3e')][_0x8a9b('0x3f')],function(_0x1cdbd4){return{'name':_0x1cdbd4[_0x8a9b('0x40')],'type':_0x1cdbd4[_0x8a9b('0x41')][_0x8a9b('0x42')]};});_0x5d1491[_0x8a9b('0x43')]=_[_0x8a9b('0x44')](_0x13ccdf,'name');_0x5d1491[_0x8a9b('0x45')]=_[_0x8a9b('0x46')](_0x16aea5[_0x8a9b('0x45')]);_0x5d1491['filters']=_[_0x8a9b('0x47')](_0x5d1491[_0x8a9b('0x43')],_0x5d1491[_0x8a9b('0x45')]);_0x1f8e36[_0x8a9b('0x48')]=_[_0x8a9b('0x47')](_0x5d1491[_0x8a9b('0x43')],qs[_0x8a9b('0x49')](_0x16aea5[_0x8a9b('0x45')][_0x8a9b('0x49')]));_0x1f8e36[_0x8a9b('0x48')]=_0x1f8e36[_0x8a9b('0x48')][_0x8a9b('0x4a')]?_0x1f8e36[_0x8a9b('0x48')]:_0x5d1491[_0x8a9b('0x43')];if(!_0x16aea5[_0x8a9b('0x45')][_0x8a9b('0x4b')](_0x8a9b('0x4c'))){_0x1f8e36[_0x8a9b('0x33')]=qs[_0x8a9b('0x33')](_0x16aea5[_0x8a9b('0x45')][_0x8a9b('0x33')]);_0x1f8e36['offset']=qs[_0x8a9b('0x32')](_0x16aea5[_0x8a9b('0x45')]['offset']);}_0x1f8e36[_0x8a9b('0x4d')]=qs['sort'](_0x16aea5[_0x8a9b('0x45')][_0x8a9b('0x4e')]);_0x1f8e36[_0x8a9b('0x4f')]=qs[_0x8a9b('0x50')](_['pick'](_0x16aea5['query'],_0x5d1491['filters']),_0x13ccdf);if(_0x16aea5['query'][_0x8a9b('0x51')]){_0x1f8e36[_0x8a9b('0x4f')]=_[_0x8a9b('0x52')](_0x1f8e36[_0x8a9b('0x4f')],{'$or':_['map'](_0x13ccdf,function(_0x21aa9c){if(_0x21aa9c[_0x8a9b('0x41')]!==_0x8a9b('0x53')){var _0x5dd488={};_0x5dd488[_0x21aa9c[_0x8a9b('0x3b')]]={'$like':'%'+_0x16aea5[_0x8a9b('0x45')]['filter']+'%'};return _0x5dd488;}})});}_0x1f8e36=_[_0x8a9b('0x52')]({},_0x1f8e36,_0x16aea5['options']);var _0x248309={'where':_0x1f8e36[_0x8a9b('0x4f')]};return db[_0x8a9b('0x3e')][_0x8a9b('0x31')](_0x248309)[_0x8a9b('0x22')](function(_0x11fa66){_0x4aed9a[_0x8a9b('0x31')]=_0x11fa66;if(_0x16aea5['query'][_0x8a9b('0x54')]){_0x1f8e36[_0x8a9b('0x55')]=[{'all':!![]}];}return db[_0x8a9b('0x3e')][_0x8a9b('0x56')](_0x1f8e36);})[_0x8a9b('0x22')](function(_0x31baef){_0x4aed9a['rows']=_0x31baef;return _0x4aed9a;})['then'](respondWithFilteredResult(_0x59e53c,_0x1f8e36))[_0x8a9b('0x2c')](handleError(_0x59e53c,null));};exports[_0x8a9b('0x57')]=function(_0x363e9d,_0x526d64){var _0x49b029={'raw':!![],'where':{'id':_0x363e9d['params']['id']}},_0x3d022a={};_0x3d022a[_0x8a9b('0x43')]=_[_0x8a9b('0x46')](db[_0x8a9b('0x3e')][_0x8a9b('0x3f')]);_0x3d022a[_0x8a9b('0x45')]=_[_0x8a9b('0x46')](_0x363e9d[_0x8a9b('0x45')]);_0x3d022a[_0x8a9b('0x50')]=_[_0x8a9b('0x47')](_0x3d022a['model'],_0x3d022a[_0x8a9b('0x45')]);_0x49b029[_0x8a9b('0x48')]=_[_0x8a9b('0x47')](_0x3d022a[_0x8a9b('0x43')],qs[_0x8a9b('0x49')](_0x363e9d[_0x8a9b('0x45')][_0x8a9b('0x49')]));_0x49b029[_0x8a9b('0x48')]=_0x49b029[_0x8a9b('0x48')][_0x8a9b('0x4a')]?_0x49b029[_0x8a9b('0x48')]:_0x3d022a[_0x8a9b('0x43')];if(_0x363e9d[_0x8a9b('0x45')][_0x8a9b('0x54')]){_0x49b029['include']=[{'all':!![]}];}_0x49b029=_[_0x8a9b('0x52')]({},_0x49b029,_0x363e9d[_0x8a9b('0x58')]);return db[_0x8a9b('0x3e')][_0x8a9b('0x59')](_0x49b029)[_0x8a9b('0x22')](handleEntityNotFound(_0x526d64,null))[_0x8a9b('0x22')](respondWithResult(_0x526d64,null))[_0x8a9b('0x2c')](handleError(_0x526d64,null));};exports[_0x8a9b('0x5a')]=function(_0x145797,_0x1c500e){return db[_0x8a9b('0x3e')][_0x8a9b('0x5a')](_0x145797[_0x8a9b('0x5b')],{})[_0x8a9b('0x22')](respondWithResult(_0x1c500e,0xc9))[_0x8a9b('0x2c')](handleError(_0x1c500e,null));};exports[_0x8a9b('0x5c')]=function(_0xaac207,_0x2f59d2){if(_0xaac207['body']['id']){delete _0xaac207[_0x8a9b('0x5b')]['id'];}return db['WhatsappMessage'][_0x8a9b('0x59')]({'where':{'id':_0xaac207[_0x8a9b('0x5d')]['id']}})[_0x8a9b('0x22')](handleEntityNotFound(_0x2f59d2,null))[_0x8a9b('0x22')](saveUpdates(_0xaac207['body'],null))[_0x8a9b('0x22')](respondWithResult(_0x2f59d2,null))[_0x8a9b('0x2c')](handleError(_0x2f59d2,null));};exports[_0x8a9b('0x5e')]=function(_0x5b5261,_0x58a5ce){return db[_0x8a9b('0x3e')][_0x8a9b('0x59')]({'where':{'id':_0x5b5261[_0x8a9b('0x5d')]['id']}})[_0x8a9b('0x22')](handleEntityNotFound(_0x58a5ce,null))[_0x8a9b('0x22')](removeEntity(_0x58a5ce,null))[_0x8a9b('0x2c')](handleError(_0x58a5ce,null));};exports[_0x8a9b('0x5f')]=function(_0x5c20fb,_0x4c1d6d){return db[_0x8a9b('0x3e')][_0x8a9b('0x5f')]()['then'](respondWithResult(_0x4c1d6d,null))['catch'](handleError(_0x4c1d6d,null));};var interaction_log=require(_0x8a9b('0x16'))(_0x8a9b('0x60'));exports[_0x8a9b('0x61')]=function(_0xadbfa0,_0x7681a,_0xa1b113){var _0x39b6e3={'agent':{},'channel':_0x8a9b('0x62')};if(_0xadbfa0[_0x8a9b('0x5b')]['id']){delete _0xadbfa0[_0x8a9b('0x5b')]['id'];}_0xadbfa0[_0x8a9b('0x5b')][_0x8a9b('0x63')]=!![];_0xadbfa0[_0x8a9b('0x5b')][_0x8a9b('0x64')]=moment()['format'](_0x8a9b('0x65'));_0xadbfa0[_0x8a9b('0x5b')]['UserId']=_0xadbfa0[_0x8a9b('0x5b')][_0x8a9b('0x66')]||_0xadbfa0[_0x8a9b('0x67')]['id'];_0x39b6e3[_0x8a9b('0x68')]['id']=_0xadbfa0[_0x8a9b('0x5b')][_0x8a9b('0x66')];return db[_0x8a9b('0x3e')]['find']({'where':{'id':_0xadbfa0[_0x8a9b('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7681a,null))[_0x8a9b('0x22')](saveUpdates(_0xadbfa0[_0x8a9b('0x5b')],null))[_0x8a9b('0x22')](function(_0x4f6128){if(_0x4f6128){_0x39b6e3[_0x8a9b('0x2a')]=_0x4f6128['get']({'plain':!![]});return db['WhatsappInteraction'][_0x8a9b('0x59')]({'where':{'id':_0x4f6128[_0x8a9b('0x69')]}});}return null;})[_0x8a9b('0x22')](handleEntityNotFound(_0x7681a,null))[_0x8a9b('0x22')](function(_0x192d1c){if(_0x192d1c){return _0x192d1c[_0x8a9b('0x5c')]({'UserId':_0xadbfa0[_0x8a9b('0x5b')][_0x8a9b('0x66')],'read1stAt':_['isNil'](_0x192d1c[_0x8a9b('0x6a')])?moment()[_0x8a9b('0x6b')](_0x8a9b('0x65')):undefined});}return null;})['then'](function(_0x3b392d){if(_0x3b392d){_0x39b6e3['interaction']=_0x3b392d[_0x8a9b('0x6c')]({'plain':!![]});interaction_log['info'](_0x8a9b('0x6d'),_0xadbfa0[_0x8a9b('0x67')]['id'],_0xadbfa0[_0x8a9b('0x67')]['name'],_0xadbfa0[_0x8a9b('0x67')][_0x8a9b('0x6e')],_0x39b6e3['interaction']['id'],_0xadbfa0['body']?JSON['stringify'](_0xadbfa0[_0x8a9b('0x5b')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8a9b('0x6f'),_0x39b6e3);}return null;})[_0x8a9b('0x22')](function(_0x14b0e1){var _0x23a4a6=_0x8a9b('0x70')+_0x14b0e1[_0x8a9b('0x2a')]['ContactId'];return db[_0x8a9b('0x71')]['query'](_0x23a4a6,{'type':db[_0x8a9b('0x72')][_0x8a9b('0x73')][_0x8a9b('0x74')],'raw':!![]})[_0x8a9b('0x22')](function(_0x1656e5){return _0x1656e5;});})['then'](function(_0x4d3981){if(_0x4d3981){_0x39b6e3[_0x8a9b('0x2a')][_0x8a9b('0x75')]=_0x4d3981[0x0];if(!_0xadbfa0[_0x8a9b('0x5b')]['UserId'])return;return db[_0x8a9b('0x76')][_0x8a9b('0x59')]({'where':{'id':_0xadbfa0['body']['UserId'],'role':_0x8a9b('0x68')},'attributes':['id',_0x8a9b('0x3b'),'fullname',_0x8a9b('0x77'),_0x8a9b('0x78')],'raw':!![]});}return null;})[_0x8a9b('0x22')](function(_0x343284){if(!_0x343284)return null;_0x39b6e3[_0x8a9b('0x2a')]['agent']=_0x343284;return _0x39b6e3;})[_0x8a9b('0x22')](function(_0x2472b2){if(_0x2472b2){if(_0xadbfa0[_0x8a9b('0x5b')][_0x8a9b('0x79')]){_0x39b6e3['message'][_0x8a9b('0x7a')]=util[_0x8a9b('0x6b')](_0x8a9b('0x7b'),_0xadbfa0['user'][_0x8a9b('0x3b')]);_0x39b6e3[_0x8a9b('0x2a')][_0x8a9b('0x7c')]=_0x39b6e3[_0x8a9b('0x7c')];_0x39b6e3[_0x8a9b('0x2a')][_0x8a9b('0x7d')]=_0x39b6e3[_0x8a9b('0x7c')];_0x39b6e3[_0x8a9b('0x2a')][_0x8a9b('0x7e')]=_0x8a9b('0x61');return respondWithRpcPromise(_0x8a9b('0x7f'),_0x8a9b('0x7f'),{'event':'acceptmessage','message':_0x39b6e3['message']},client9002)['then'](function(){return _0x39b6e3;});}return _0x39b6e3;}return null;})['then'](respondWithResult(_0x7681a,null))[_0x8a9b('0x2c')](handleError(_0x7681a,null));};var interaction_log=require(_0x8a9b('0x16'))(_0x8a9b('0x60'));exports[_0x8a9b('0x38')]=function(_0x579f3c,_0xca7bcb,_0x5335b7){var _0x563f30={'agent':{},'channel':'whatsapp'};if(_0x579f3c[_0x8a9b('0x5b')]['id']){delete _0x579f3c[_0x8a9b('0x5b')]['id'];}_0x579f3c[_0x8a9b('0x5b')][_0x8a9b('0x66')]=_0x579f3c[_0x8a9b('0x5b')]['UserId']||_0x579f3c[_0x8a9b('0x67')]['id'];_0x563f30[_0x8a9b('0x68')]['id']=_0x579f3c[_0x8a9b('0x5b')][_0x8a9b('0x66')];return db[_0x8a9b('0x3e')][_0x8a9b('0x59')]({'where':{'id':_0x579f3c['params']['id'],'UserId':null}})[_0x8a9b('0x22')](handleEntityNotFound(_0xca7bcb,null))[_0x8a9b('0x22')](function(_0xe688a8){if(_0xe688a8){_0x563f30['message']=_0xe688a8['get']({'plain':!![]});return db[_0x8a9b('0x80')][_0x8a9b('0x59')]({'where':{'id':_0xe688a8[_0x8a9b('0x69')]}});}return null;})['then'](handleEntityNotFound(_0xca7bcb,null))[_0x8a9b('0x22')](function(_0x143470){if(_0x143470){_0x563f30[_0x8a9b('0x81')]=_0x143470['get']({'plain':!![]});interaction_log[_0x8a9b('0x23')](_0x8a9b('0x82'),_0x579f3c['user']['id'],_0x579f3c[_0x8a9b('0x67')][_0x8a9b('0x3b')],_0x579f3c[_0x8a9b('0x67')][_0x8a9b('0x6e')],_0x563f30[_0x8a9b('0x81')]['id'],_0x579f3c['body']?JSON[_0x8a9b('0x27')](_0x579f3c[_0x8a9b('0x5b')]):_0x8a9b('0x83'));return respondWithRpcPromise(_0x8a9b('0x84'),_0x8a9b('0x85'),_0x563f30);}return null;})['then'](function(_0x3500e8){var _0x24df22=_0x8a9b('0x70')+_0x3500e8['message'][_0x8a9b('0x86')];return db[_0x8a9b('0x71')][_0x8a9b('0x45')](_0x24df22,{'type':db[_0x8a9b('0x72')]['QueryTypes'][_0x8a9b('0x74')],'raw':!![]})[_0x8a9b('0x22')](function(_0x363da7){return _0x363da7;});})[_0x8a9b('0x22')](function(_0x1cb116){if(_0x1cb116){_0x563f30['message'][_0x8a9b('0x75')]=_0x1cb116[0x0];if(!_0x579f3c[_0x8a9b('0x5b')]['UserId'])return;return db[_0x8a9b('0x76')][_0x8a9b('0x59')]({'where':{'id':_0x579f3c[_0x8a9b('0x5b')][_0x8a9b('0x66')],'role':_0x8a9b('0x68')},'attributes':['id',_0x8a9b('0x3b'),'fullname',_0x8a9b('0x77'),_0x8a9b('0x78')],'raw':!![]});}return null;})[_0x8a9b('0x22')](function(_0x72abd1){if(!_0x72abd1)return null;_0x563f30[_0x8a9b('0x2a')]['agent']=_0x72abd1;return _0x563f30;})[_0x8a9b('0x22')](function(_0x5eed08){if(_0x5eed08){_0x5eed08[_0x8a9b('0x2a')]['interface']=util['format'](_0x8a9b('0x7b'),_0x579f3c[_0x8a9b('0x67')][_0x8a9b('0x3b')]);_0x5eed08[_0x8a9b('0x2a')][_0x8a9b('0x7c')]=_0x563f30[_0x8a9b('0x7c')];_0x5eed08[_0x8a9b('0x2a')][_0x8a9b('0x7d')]=_0x563f30[_0x8a9b('0x7c')];_0x5eed08[_0x8a9b('0x2a')][_0x8a9b('0x7e')]='reject';respondWithRpcPromise(_0x8a9b('0x7f'),'EventManager',{'event':'rejectmessage','message':_0x5eed08[_0x8a9b('0x2a')]},client9002);return _0x563f30;}return null;})[_0x8a9b('0x22')](respondWithResult(_0xca7bcb,null))[_0x8a9b('0x2c')](handleError(_0xca7bcb,null));};exports[_0x8a9b('0x34')]=function(_0x4533ac,_0x2989b2,_0x1840af){if(_0x4533ac[_0x8a9b('0x5b')]['id']){delete _0x4533ac[_0x8a9b('0x5b')]['id'];}var _0x5243f7;return db[_0x8a9b('0x3e')][_0x8a9b('0x59')]({'where':{'id':_0x4533ac['params']['id']}})[_0x8a9b('0x22')](handleEntityNotFound(_0x2989b2,null))[_0x8a9b('0x22')](function(_0x448685){if(_0x448685){_0x5243f7=_0x448685;return db[_0x8a9b('0x87')][_0x8a9b('0x59')]({'where':{'id':_0x448685[_0x8a9b('0x88')]}});}})[_0x8a9b('0x22')](handleEntityNotFound(_0x2989b2,null))[_0x8a9b('0x22')](function(_0x56575f){if(_0x56575f){logger[_0x8a9b('0x24')](_0x8a9b('0x89'),_0x8a9b('0x34'),'received\x20delivery\x20report\x20from',_0x56575f[_0x8a9b('0x41')],util['inspect'](_0x4533ac[_0x8a9b('0x5b')],{'showHidden':![],'depth':null}));switch(_0x56575f[_0x8a9b('0x41')]){case'twilio':if(_0x4533ac[_0x8a9b('0x5b')][_0x8a9b('0x8a')]&&_0x4533ac[_0x8a9b('0x5b')][_0x8a9b('0x8a')]===_0x5243f7[_0x8a9b('0x8b')]&&_0x4533ac['body'][_0x8a9b('0x8c')]&&_0x4533ac[_0x8a9b('0x5b')][_0x8a9b('0x8c')]==='read'){return _0x5243f7[_0x8a9b('0x5c')]({'read':!![]});}else{logger[_0x8a9b('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x8a9b('0x8d')](_0x4533ac['body'],{'showHidden':![],'depth':null}));}break;}return _0x5243f7;}})[_0x8a9b('0x22')](respondWithResult(_0x2989b2,null))[_0x8a9b('0x2c')](handleError(_0x2989b2,null));}; \ No newline at end of file +var _0xdc93=['util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','http','client','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','params','options','create','body','find','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','QueryTypes','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x445018,_0x36c4e9){var _0x2e2808=function(_0x37f655){while(--_0x37f655){_0x445018['push'](_0x445018['shift']());}};_0x2e2808(++_0x36c4e9);}(_0xdc93,0x8a));var _0x3dc9=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xdc93[_0x264545];return _0x114d10;};'use strict';var emlformat=require(_0x3dc9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dc9('0x1'));var jsonpatch=require(_0x3dc9('0x2'));var rp=require(_0x3dc9('0x3'));var moment=require(_0x3dc9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3dc9('0x5'));var util=require(_0x3dc9('0x6'));var path=require(_0x3dc9('0x7'));var sox=require(_0x3dc9('0x8'));var csv=require('to-csv');var ejs=require(_0x3dc9('0x9'));var fs=require('fs');var fs_extra=require(_0x3dc9('0xa'));var _=require('lodash');var squel=require(_0x3dc9('0xb'));var crypto=require(_0x3dc9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3dc9('0xd'));var toCsv=require(_0x3dc9('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3dc9('0xf'));var authService=require(_0x3dc9('0x10'));var qs=require(_0x3dc9('0x11'));var as=require(_0x3dc9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dc9('0x13'))(_0x3dc9('0x14'));var utils=require(_0x3dc9('0x15'));var config=require(_0x3dc9('0x16'));var licenseUtil=require(_0x3dc9('0x17'));var db=require(_0x3dc9('0x18'))['db'];config[_0x3dc9('0x19')]=_['defaults'](config['redis'],{'host':_0x3dc9('0x1a'),'port':0x18eb});var socket=require(_0x3dc9('0x1b'))(new Redis(config[_0x3dc9('0x19')]));require(_0x3dc9('0x1c'))[_0x3dc9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3dc9('0x1e')]({'port':0x232c});var client9002=jayson[_0x3dc9('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5af7e5,_0x1cd9a8,_0x5c2bee,_0x4cb985){return new BPromise(function(_0x14d6c3,_0x179055){var _0x42fe4a=_0x4cb985||client;return _0x42fe4a['request'](_0x5af7e5,_0x5c2bee)[_0x3dc9('0x20')](function(_0x39329c){logger[_0x3dc9('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x1cd9a8,_0x3dc9('0x22'));logger['debug'](_0x3dc9('0x23'),_0x1cd9a8,_0x3dc9('0x22'),JSON[_0x3dc9('0x24')](_0x39329c));if(_0x39329c[_0x3dc9('0x25')]){if(_0x39329c['error'][_0x3dc9('0x26')]===0x1f4){logger[_0x3dc9('0x25')](_0x3dc9('0x27'),_0x1cd9a8,_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);return _0x179055(_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);}logger['error'](_0x3dc9('0x27'),_0x1cd9a8,_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);return _0x14d6c3(_0x39329c[_0x3dc9('0x25')][_0x3dc9('0x28')]);}else{logger[_0x3dc9('0x21')](_0x3dc9('0x27'),_0x1cd9a8,_0x3dc9('0x22'));_0x14d6c3(_0x39329c['result']['message']);}})[_0x3dc9('0x29')](function(_0x553c0b){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1cd9a8,_0x553c0b);_0x179055(_0x553c0b);});});}function respondWithStatusCode(_0x7578bb,_0x3ea43b){_0x3ea43b=_0x3ea43b||0xcc;return function(_0x172ae9){if(_0x172ae9){return _0x7578bb[_0x3dc9('0x2a')](_0x3ea43b);}return _0x7578bb[_0x3dc9('0x2b')](_0x3ea43b)['end']();};}function respondWithResult(_0x5b513e,_0x17dd33){_0x17dd33=_0x17dd33||0xc8;return function(_0x35c06a){if(_0x35c06a){return _0x5b513e[_0x3dc9('0x2b')](_0x17dd33)[_0x3dc9('0x2c')](_0x35c06a);}};}function respondWithFilteredResult(_0xff997c,_0x5c0e74){return function(_0x59225b){if(_0x59225b){var _0x2c26ce=typeof _0x5c0e74[_0x3dc9('0x2d')]===_0x3dc9('0x2e')&&typeof _0x5c0e74[_0x3dc9('0x2f')]==='undefined';var _0x513322=_0x59225b['count'];var _0x396a21=_0x2c26ce?0x0:_0x5c0e74[_0x3dc9('0x2d')];var _0x26449c=_0x2c26ce?_0x59225b[_0x3dc9('0x30')]:_0x5c0e74['offset']+_0x5c0e74[_0x3dc9('0x2f')];var _0x1cbade;if(_0x26449c>=_0x513322){_0x26449c=_0x513322;_0x1cbade=0xc8;}else{_0x1cbade=0xce;}_0xff997c['status'](_0x1cbade);return _0xff997c['set'](_0x3dc9('0x31'),_0x396a21+'-'+_0x26449c+'/'+_0x513322)['json'](_0x59225b);}return null;};}function patchUpdates(_0x544b52){return function(_0x5bd6e2){try{jsonpatch['apply'](_0x5bd6e2,_0x544b52,!![]);}catch(_0x4911ca){return BPromise[_0x3dc9('0x32')](_0x4911ca);}return _0x5bd6e2[_0x3dc9('0x33')]();};}function saveUpdates(_0x2435fa,_0x3fdd90){return function(_0xe8114){if(_0xe8114){return _0xe8114[_0x3dc9('0x34')](_0x2435fa)[_0x3dc9('0x20')](function(_0x4e2dfe){return _0x4e2dfe;});}return null;};}function removeEntity(_0x482096,_0x1fbad3){return function(_0x1d9fa7){if(_0x1d9fa7){return _0x1d9fa7[_0x3dc9('0x35')]()[_0x3dc9('0x20')](function(){_0x482096[_0x3dc9('0x2b')](0xcc)[_0x3dc9('0x36')]();});}};}function handleEntityNotFound(_0x5aec12,_0x4fd866){return function(_0x235397){if(!_0x235397){_0x5aec12[_0x3dc9('0x2a')](0x194);}return _0x235397;};}function handleError(_0x2a6a5a,_0x234571){_0x234571=_0x234571||0x1f4;return function(_0x1ad2f9){logger[_0x3dc9('0x25')](_0x1ad2f9[_0x3dc9('0x37')]);if(_0x1ad2f9[_0x3dc9('0x38')]){delete _0x1ad2f9[_0x3dc9('0x38')];}_0x2a6a5a[_0x3dc9('0x2b')](_0x234571)[_0x3dc9('0x39')](_0x1ad2f9);};}exports[_0x3dc9('0x3a')]=function(_0x5a0326,_0x14216a){var _0x5b24a4={},_0x237e34={},_0x50e305={'count':0x0,'rows':[]};var _0x45de9a=_[_0x3dc9('0x3b')](db[_0x3dc9('0x3c')][_0x3dc9('0x3d')],function(_0x4a898d){return{'name':_0x4a898d[_0x3dc9('0x3e')],'type':_0x4a898d[_0x3dc9('0x3f')][_0x3dc9('0x40')]};});_0x237e34[_0x3dc9('0x41')]=_[_0x3dc9('0x3b')](_0x45de9a,_0x3dc9('0x38'));_0x237e34[_0x3dc9('0x42')]=_[_0x3dc9('0x43')](_0x5a0326['query']);_0x237e34['filters']=_['intersection'](_0x237e34[_0x3dc9('0x41')],_0x237e34[_0x3dc9('0x42')]);_0x5b24a4[_0x3dc9('0x44')]=_[_0x3dc9('0x45')](_0x237e34[_0x3dc9('0x41')],qs[_0x3dc9('0x46')](_0x5a0326['query']['fields']));_0x5b24a4[_0x3dc9('0x44')]=_0x5b24a4[_0x3dc9('0x44')][_0x3dc9('0x47')]?_0x5b24a4['attributes']:_0x237e34[_0x3dc9('0x41')];if(!_0x5a0326['query'][_0x3dc9('0x48')](_0x3dc9('0x49'))){_0x5b24a4[_0x3dc9('0x2f')]=qs[_0x3dc9('0x2f')](_0x5a0326[_0x3dc9('0x42')]['limit']);_0x5b24a4['offset']=qs[_0x3dc9('0x2d')](_0x5a0326[_0x3dc9('0x42')][_0x3dc9('0x2d')]);}_0x5b24a4[_0x3dc9('0x4a')]=qs[_0x3dc9('0x4b')](_0x5a0326[_0x3dc9('0x42')]['sort']);_0x5b24a4['where']=qs[_0x3dc9('0x4c')](_['pick'](_0x5a0326[_0x3dc9('0x42')],_0x237e34[_0x3dc9('0x4c')]),_0x45de9a);if(_0x5a0326[_0x3dc9('0x42')][_0x3dc9('0x4d')]){_0x5b24a4['where']=_[_0x3dc9('0x4e')](_0x5b24a4['where'],{'$or':_[_0x3dc9('0x3b')](_0x45de9a,function(_0x33bfa4){if(_0x33bfa4['type']!==_0x3dc9('0x4f')){var _0x2076ea={};_0x2076ea[_0x33bfa4[_0x3dc9('0x38')]]={'$like':'%'+_0x5a0326['query'][_0x3dc9('0x4d')]+'%'};return _0x2076ea;}})});}_0x5b24a4=_[_0x3dc9('0x4e')]({},_0x5b24a4,_0x5a0326['options']);var _0x188a2={'where':_0x5b24a4[_0x3dc9('0x50')]};return db[_0x3dc9('0x3c')][_0x3dc9('0x30')](_0x188a2)[_0x3dc9('0x20')](function(_0x5a0a6e){_0x50e305['count']=_0x5a0a6e;if(_0x5a0326['query'][_0x3dc9('0x51')]){_0x5b24a4[_0x3dc9('0x52')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x3dc9('0x53')](_0x5b24a4);})[_0x3dc9('0x20')](function(_0x451f88){_0x50e305[_0x3dc9('0x54')]=_0x451f88;return _0x50e305;})[_0x3dc9('0x20')](respondWithFilteredResult(_0x14216a,_0x5b24a4))[_0x3dc9('0x29')](handleError(_0x14216a,null));};exports['show']=function(_0x37d476,_0x12e1d3){var _0x3a4b6a={'raw':!![],'where':{'id':_0x37d476[_0x3dc9('0x55')]['id']}},_0x1b6513={};_0x1b6513[_0x3dc9('0x41')]=_[_0x3dc9('0x43')](db['WhatsappMessage']['rawAttributes']);_0x1b6513[_0x3dc9('0x42')]=_[_0x3dc9('0x43')](_0x37d476[_0x3dc9('0x42')]);_0x1b6513['filters']=_[_0x3dc9('0x45')](_0x1b6513[_0x3dc9('0x41')],_0x1b6513[_0x3dc9('0x42')]);_0x3a4b6a[_0x3dc9('0x44')]=_[_0x3dc9('0x45')](_0x1b6513['model'],qs[_0x3dc9('0x46')](_0x37d476[_0x3dc9('0x42')][_0x3dc9('0x46')]));_0x3a4b6a[_0x3dc9('0x44')]=_0x3a4b6a['attributes'][_0x3dc9('0x47')]?_0x3a4b6a['attributes']:_0x1b6513['model'];if(_0x37d476[_0x3dc9('0x42')][_0x3dc9('0x51')]){_0x3a4b6a[_0x3dc9('0x52')]=[{'all':!![]}];}_0x3a4b6a=_[_0x3dc9('0x4e')]({},_0x3a4b6a,_0x37d476[_0x3dc9('0x56')]);return db['WhatsappMessage']['find'](_0x3a4b6a)[_0x3dc9('0x20')](handleEntityNotFound(_0x12e1d3,null))[_0x3dc9('0x20')](respondWithResult(_0x12e1d3,null))[_0x3dc9('0x29')](handleError(_0x12e1d3,null));};exports['create']=function(_0x5b933,_0x5db833){return db[_0x3dc9('0x3c')][_0x3dc9('0x57')](_0x5b933[_0x3dc9('0x58')],{})['then'](respondWithResult(_0x5db833,0xc9))[_0x3dc9('0x29')](handleError(_0x5db833,null));};exports[_0x3dc9('0x34')]=function(_0x16e041,_0x5ed04c){if(_0x16e041[_0x3dc9('0x58')]['id']){delete _0x16e041[_0x3dc9('0x58')]['id'];}return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x16e041[_0x3dc9('0x55')]['id']}})[_0x3dc9('0x20')](handleEntityNotFound(_0x5ed04c,null))['then'](saveUpdates(_0x16e041[_0x3dc9('0x58')],null))[_0x3dc9('0x20')](respondWithResult(_0x5ed04c,null))[_0x3dc9('0x29')](handleError(_0x5ed04c,null));};exports[_0x3dc9('0x35')]=function(_0x1f371d,_0x5d93b1){return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x1f371d['params']['id']}})[_0x3dc9('0x20')](handleEntityNotFound(_0x5d93b1,null))['then'](removeEntity(_0x5d93b1,null))[_0x3dc9('0x29')](handleError(_0x5d93b1,null));};exports[_0x3dc9('0x5a')]=function(_0x481dc1,_0x36e41e){return db[_0x3dc9('0x3c')]['describe']()[_0x3dc9('0x20')](respondWithResult(_0x36e41e,null))['catch'](handleError(_0x36e41e,null));};var interaction_log=require(_0x3dc9('0x13'))(_0x3dc9('0x5b'));exports['accept']=function(_0x248e12,_0x5bf013,_0x2e7cfb){var _0x5812d1={'agent':{},'channel':_0x3dc9('0x5c')};if(_0x248e12['body']['id']){delete _0x248e12[_0x3dc9('0x58')]['id'];}_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x5d')]=!![];_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x5e')]=moment()[_0x3dc9('0x5f')](_0x3dc9('0x60'));_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')]=_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')]||_0x248e12[_0x3dc9('0x62')]['id'];_0x5812d1[_0x3dc9('0x63')]['id']=_0x248e12[_0x3dc9('0x58')]['UserId'];return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x248e12['params']['id'],'UserId':null}})[_0x3dc9('0x20')](handleEntityNotFound(_0x5bf013,null))[_0x3dc9('0x20')](saveUpdates(_0x248e12[_0x3dc9('0x58')],null))[_0x3dc9('0x20')](function(_0x614c1e){if(_0x614c1e){_0x5812d1[_0x3dc9('0x28')]=_0x614c1e[_0x3dc9('0x64')]({'plain':!![]});return db[_0x3dc9('0x65')][_0x3dc9('0x59')]({'where':{'id':_0x614c1e[_0x3dc9('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5bf013,null))['then'](function(_0x5a2120){if(_0x5a2120){return _0x5a2120[_0x3dc9('0x34')]({'UserId':_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')],'read1stAt':_[_0x3dc9('0x67')](_0x5a2120[_0x3dc9('0x68')])?moment()[_0x3dc9('0x5f')](_0x3dc9('0x60')):undefined});}return null;})[_0x3dc9('0x20')](function(_0x4b80ad){if(_0x4b80ad){_0x5812d1[_0x3dc9('0x69')]=_0x4b80ad[_0x3dc9('0x64')]({'plain':!![]});interaction_log['info'](_0x3dc9('0x6a'),_0x248e12['user']['id'],_0x248e12[_0x3dc9('0x62')][_0x3dc9('0x38')],_0x248e12[_0x3dc9('0x62')]['role'],_0x5812d1['interaction']['id'],_0x248e12[_0x3dc9('0x58')]?JSON['stringify'](_0x248e12[_0x3dc9('0x58')]):_0x3dc9('0x6b'));return respondWithRpcPromise(_0x3dc9('0x6c'),_0x3dc9('0x6d'),_0x5812d1);}return null;})[_0x3dc9('0x20')](function(_0x6a7817){var _0x18f5b1=_0x3dc9('0x6e')+_0x6a7817[_0x3dc9('0x28')][_0x3dc9('0x6f')];return db['sequelize'][_0x3dc9('0x42')](_0x18f5b1,{'type':db[_0x3dc9('0x70')]['QueryTypes'][_0x3dc9('0x71')],'raw':!![]})[_0x3dc9('0x20')](function(_0x1fcf2c){return _0x1fcf2c;});})[_0x3dc9('0x20')](function(_0x54ee94){if(_0x54ee94){_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x72')]=_0x54ee94[0x0];if(!_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x61')])return;return db[_0x3dc9('0x73')][_0x3dc9('0x59')]({'where':{'id':_0x248e12['body'][_0x3dc9('0x61')],'role':_0x3dc9('0x63')},'attributes':['id',_0x3dc9('0x38'),_0x3dc9('0x74'),_0x3dc9('0x75'),_0x3dc9('0x76')],'raw':!![]});}return null;})[_0x3dc9('0x20')](function(_0x52e544){if(!_0x52e544)return null;_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x63')]=_0x52e544;return _0x5812d1;})[_0x3dc9('0x20')](function(_0x51c7f2){if(_0x51c7f2){if(_0x248e12[_0x3dc9('0x58')][_0x3dc9('0x77')]){_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x78')]=util[_0x3dc9('0x5f')](_0x3dc9('0x79'),_0x248e12[_0x3dc9('0x62')][_0x3dc9('0x38')]);_0x5812d1[_0x3dc9('0x28')]['channel']=_0x5812d1['channel'];_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x7a')]=_0x5812d1[_0x3dc9('0x7b')];_0x5812d1[_0x3dc9('0x28')][_0x3dc9('0x7c')]=_0x3dc9('0x7d');return respondWithRpcPromise(_0x3dc9('0x7e'),_0x3dc9('0x7e'),{'event':_0x3dc9('0x7f'),'message':_0x5812d1[_0x3dc9('0x28')]},client9002)[_0x3dc9('0x20')](function(){return _0x5812d1;});}return _0x5812d1;}return null;})['then'](respondWithResult(_0x5bf013,null))['catch'](handleError(_0x5bf013,null));};var interaction_log=require(_0x3dc9('0x13'))(_0x3dc9('0x5b'));exports[_0x3dc9('0x32')]=function(_0x6fab32,_0x4e6253,_0x170827){var _0x3fb26a={'agent':{},'channel':_0x3dc9('0x5c')};if(_0x6fab32[_0x3dc9('0x58')]['id']){delete _0x6fab32[_0x3dc9('0x58')]['id'];}_0x6fab32[_0x3dc9('0x58')]['UserId']=_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')]||_0x6fab32['user']['id'];_0x3fb26a[_0x3dc9('0x63')]['id']=_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')];return db[_0x3dc9('0x3c')][_0x3dc9('0x59')]({'where':{'id':_0x6fab32[_0x3dc9('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e6253,null))['then'](function(_0xb8ba67){if(_0xb8ba67){_0x3fb26a[_0x3dc9('0x28')]=_0xb8ba67[_0x3dc9('0x64')]({'plain':!![]});return db[_0x3dc9('0x65')]['find']({'where':{'id':_0xb8ba67['WhatsappInteractionId']}});}return null;})[_0x3dc9('0x20')](handleEntityNotFound(_0x4e6253,null))[_0x3dc9('0x20')](function(_0xc44d2c){if(_0xc44d2c){_0x3fb26a[_0x3dc9('0x69')]=_0xc44d2c['get']({'plain':!![]});interaction_log[_0x3dc9('0x21')](_0x3dc9('0x80'),_0x6fab32['user']['id'],_0x6fab32[_0x3dc9('0x62')][_0x3dc9('0x38')],_0x6fab32[_0x3dc9('0x62')][_0x3dc9('0x81')],_0x3fb26a[_0x3dc9('0x69')]['id'],_0x6fab32[_0x3dc9('0x58')]?JSON[_0x3dc9('0x24')](_0x6fab32[_0x3dc9('0x58')]):'null');return respondWithRpcPromise(_0x3dc9('0x82'),_0x3dc9('0x83'),_0x3fb26a);}return null;})[_0x3dc9('0x20')](function(_0x34e62c){var _0x26f36f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x34e62c[_0x3dc9('0x28')][_0x3dc9('0x6f')];return db[_0x3dc9('0x84')][_0x3dc9('0x42')](_0x26f36f,{'type':db[_0x3dc9('0x70')][_0x3dc9('0x85')][_0x3dc9('0x71')],'raw':!![]})[_0x3dc9('0x20')](function(_0x1478d2){return _0x1478d2;});})[_0x3dc9('0x20')](function(_0x5ae88b){if(_0x5ae88b){_0x3fb26a[_0x3dc9('0x28')]['contact']=_0x5ae88b[0x0];if(!_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')])return;return db[_0x3dc9('0x73')]['find']({'where':{'id':_0x6fab32[_0x3dc9('0x58')][_0x3dc9('0x61')],'role':_0x3dc9('0x63')},'attributes':['id',_0x3dc9('0x38'),'fullname',_0x3dc9('0x75'),_0x3dc9('0x76')],'raw':!![]});}return null;})[_0x3dc9('0x20')](function(_0x1719e0){if(!_0x1719e0)return null;_0x3fb26a['message'][_0x3dc9('0x63')]=_0x1719e0;return _0x3fb26a;})[_0x3dc9('0x20')](function(_0x38c84e){if(_0x38c84e){_0x38c84e[_0x3dc9('0x28')][_0x3dc9('0x78')]=util[_0x3dc9('0x5f')](_0x3dc9('0x79'),_0x6fab32[_0x3dc9('0x62')][_0x3dc9('0x38')]);_0x38c84e[_0x3dc9('0x28')][_0x3dc9('0x7b')]=_0x3fb26a['channel'];_0x38c84e[_0x3dc9('0x28')]['motionChannel']=_0x3fb26a[_0x3dc9('0x7b')];_0x38c84e[_0x3dc9('0x28')][_0x3dc9('0x7c')]=_0x3dc9('0x32');respondWithRpcPromise(_0x3dc9('0x7e'),_0x3dc9('0x7e'),{'event':_0x3dc9('0x86'),'message':_0x38c84e[_0x3dc9('0x28')]},client9002);return _0x3fb26a;}return null;})[_0x3dc9('0x20')](respondWithResult(_0x4e6253,null))[_0x3dc9('0x29')](handleError(_0x4e6253,null));};exports[_0x3dc9('0x2b')]=function(_0x4885bc,_0x4ee047,_0x30b31c){if(_0x4885bc[_0x3dc9('0x58')]['id']){delete _0x4885bc['body']['id'];}var _0x33cbab;return db['WhatsappMessage'][_0x3dc9('0x59')]({'where':{'id':_0x4885bc['params']['id']}})['then'](handleEntityNotFound(_0x4ee047,null))[_0x3dc9('0x20')](function(_0x25e59f){if(_0x25e59f){_0x33cbab=_0x25e59f;return db[_0x3dc9('0x87')]['find']({'where':{'id':_0x25e59f[_0x3dc9('0x88')]}});}})[_0x3dc9('0x20')](handleEntityNotFound(_0x4ee047,null))[_0x3dc9('0x20')](function(_0x2710d1){if(_0x2710d1){logger['debug'](_0x3dc9('0x89'),_0x3dc9('0x2b'),'received\x20delivery\x20report\x20from',_0x2710d1[_0x3dc9('0x3f')],util[_0x3dc9('0x8a')](_0x4885bc[_0x3dc9('0x58')],{'showHidden':![],'depth':null}));switch(_0x2710d1['type']){case'twilio':if(_0x4885bc[_0x3dc9('0x58')][_0x3dc9('0x8b')]&&_0x4885bc[_0x3dc9('0x58')]['MessageSid']===_0x33cbab[_0x3dc9('0x8c')]&&_0x4885bc['body']['MessageStatus']&&_0x4885bc[_0x3dc9('0x58')][_0x3dc9('0x8d')]==='read'){return _0x33cbab['update']({'read':!![]});}else{logger[_0x3dc9('0x25')](_0x3dc9('0x8e'),_0x3dc9('0x2b'),_0x3dc9('0x8f'),util[_0x3dc9('0x8a')](_0x4885bc['body'],{'showHidden':![],'depth':null}));}break;}return _0x33cbab;}})['then'](respondWithResult(_0x4ee047,null))['catch'](handleError(_0x4ee047,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index f989e07..7cf4cae 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 _0x7980=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x3eb2aa,_0x5811e6){var _0x577a82=function(_0x5243a4){while(--_0x5243a4){_0x3eb2aa['push'](_0x3eb2aa['shift']());}};_0x577a82(++_0x5811e6);}(_0x7980,0xab));var _0x0798=function(_0x2841ac,_0x4acb32){_0x2841ac=_0x2841ac-0x0;var _0x298dc8=_0x7980[_0x2841ac];return _0x298dc8;};'use strict';var EventEmitter=require(_0x0798('0x0'));var WhatsappMessage=require(_0x0798('0x1'))['db'][_0x0798('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0798('0x3')](0x0);var events={'afterCreate':_0x0798('0x4'),'afterUpdate':'update','afterDestroy':_0x0798('0x5')};function emitEvent(_0x31597d){return function(_0xecc24f,_0x1637db,_0x1a1fe7){WhatsappMessageEvents['emit'](_0x31597d+':'+_0xecc24f['id'],_0xecc24f);WhatsappMessageEvents[_0x0798('0x6')](_0x31597d,_0xecc24f);_0x1a1fe7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x0798('0x7')](e,emitEvent(event));}}module[_0x0798('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0xf290=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x1cfb1a,_0x1bb622){var _0x4c0d85=function(_0xe0ed83){while(--_0xe0ed83){_0x1cfb1a['push'](_0x1cfb1a['shift']());}};_0x4c0d85(++_0x1bb622);}(_0xf290,0xde));var _0x0f29=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0xf290[_0xe39824];return _0x4bc31e;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x0f29('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0f29('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f29('0x2'),'afterDestroy':_0x0f29('0x3')};function emitEvent(_0x38f5b5){return function(_0x28b644,_0xfdab92,_0x5984ba){WhatsappMessageEvents[_0x0f29('0x4')](_0x38f5b5+':'+_0x28b644['id'],_0x28b644);WhatsappMessageEvents['emit'](_0x38f5b5,_0x28b644);_0x5984ba(null);};}for(var e in events){if(events[_0x0f29('0x5')](e)){var event=events[e];WhatsappMessage[_0x0f29('0x6')](e,emitEvent(event));}}module[_0x0f29('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 3fc9b93..c37bd85 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 _0x85a7=['WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','accountSid','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x16e824,_0x23ab90){var _0x1745ea=function(_0x327e55){while(--_0x327e55){_0x16e824['push'](_0x16e824['shift']());}};_0x1745ea(++_0x23ab90);}(_0x85a7,0x1e9));var _0x785a=function(_0x14e3c5,_0x4a7334){_0x14e3c5=_0x14e3c5-0x0;var _0x23e707=_0x85a7[_0x14e3c5];return _0x23e707;};'use strict';var _=require(_0x785a('0x0'));var util=require('util');var logger=require(_0x785a('0x1'))(_0x785a('0x2'));var moment=require(_0x785a('0x3'));var BPromise=require(_0x785a('0x4'));var rp=require(_0x785a('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x785a('0x6'));var rimraf=require(_0x785a('0x7'));var config=require(_0x785a('0x8'));var attributes=require(_0x785a('0x9'));module['exports']=function(_0x207306,_0x1db648){return _0x207306[_0x785a('0xa')](_0x785a('0xb'),attributes,{'tableName':_0x785a('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x785a('0xd'),'fields':[_0x785a('0xe')],'type':_0x785a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dea32,_0xd55d4,_0x13e529){var _0x2ad529=_0x207306[_0x785a('0x10')];var _0x5b79a8=_0x5dea32['get']({'plain':!![]});if(_0x5b79a8[_0x785a('0x11')][_0x785a('0x12')]()==='in'||_0x5b79a8[_0x785a('0x11')][_0x785a('0x12')]()===_0x785a('0x13')&&!_0x5b79a8[_0x785a('0x14')]&&!_[_0x785a('0x15')](_0x5b79a8[_0x785a('0x16')])){_0x2ad529[_0x785a('0x17')][_0x785a('0x18')]({'where':{'id':_0x5b79a8[_0x785a('0x19')]}})[_0x785a('0x1a')](function(_0x491962){if(_0x491962){_0x491962[_0x785a('0x1b')]({'lastMsgAt':_0x5b79a8[_0x785a('0x1c')],'lastMsgDirection':_0x5b79a8['direction']['toLowerCase']()});}})[_0x785a('0x1d')](function(_0x1a6efb){console['error'](_0x1a6efb);});}if(_0x5b79a8[_0x785a('0x11')]===_0x785a('0x13')&&!_0x5b79a8[_0x785a('0x14')]){var _0x4cea99;_0x2ad529[_0x785a('0x1e')][_0x785a('0x1f')]({'where':{'id':_0x5b79a8[_0x785a('0x20')]},'raw':!![]})[_0x785a('0x1a')](function(_0x3e1e0d){_0x4cea99=_0x3e1e0d;if(_0x4cea99&&_0x4cea99['type']){switch(_0x4cea99[_0x785a('0x21')]){case'twilio':var _0x14820a=require(_0x785a('0x22'));if(_0x4cea99['accountSid']&&_0x4cea99[_0x785a('0x23')]&&_0x4cea99[_0x785a('0x24')]){var _0x424950=new _0x14820a(_0x4cea99['accountSid'],_0x4cea99[_0x785a('0x23')]);_0x424950[_0x785a('0x25')][_0x785a('0x26')]({'body':_0x5b79a8['body'],'to':_0x785a('0x27')+_0x5b79a8[_0x785a('0x24')],'from':_0x785a('0x27')+_0x4cea99['phone'],'statusCallback':_0x4cea99[_0x785a('0x28')]+_0x785a('0x29')+_0x5b79a8['id']+'/status?token='+_0x4cea99[_0x785a('0x2a')]})[_0x785a('0x1a')](function(_0xf80706){if(_0xf80706['sid']){return _0x5dea32[_0x785a('0x1b')]({'messageId':_0xf80706[_0x785a('0x2b')]});}})[_0x785a('0x1d')](function(_0x5fdc24){logger[_0x785a('0x2c')](_0x785a('0x2d'),_0x785a('0x2e'),_0x785a('0x22'),util[_0x785a('0x2f')](_0x5fdc24,{'showHidden':![],'depth':null}));});}else{logger[_0x785a('0x2c')](_0x785a('0x2d'),_0x785a('0x2e'),_0x785a('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x785a('0x30'):var _0x1364be=_0x4cea99[_0x785a('0x31')];var _0x48494d=_0x4cea99[_0x785a('0x23')];var _0x43480d=_0x4cea99[_0x785a('0x32')]+_0x785a('0x33')+_0x1364be+_0x785a('0x34');var _0x2d4e66={'to':[_0x5b79a8[_0x785a('0x24')]],'message':{'type':_0x785a('0x35'),'text':_0x5b79a8[_0x785a('0xe')]}};var _0x2cdf4d={'method':_0x785a('0x36'),'uri':_0x43480d,'headers':{'Authorization':_0x785a('0x37')+_0x48494d,'Content-Type':_0x785a('0x38')},'body':_0x2d4e66,'json':!![]};rp(_0x2cdf4d)['then'](function(_0x128031){if(_0x128031['statuses'][0x0][_0x785a('0x39')]){return _0x5dea32[_0x785a('0x1b')]({'messageId':_0x128031[_0x785a('0x3a')][0x0][_0x785a('0x39')]});}})[_0x785a('0x1d')](function(_0x1e5a24){logger[_0x785a('0x3b')](_0x785a('0x3c'),_0x1e5a24);});break;}}})[_0x785a('0x3d')](function(){_0x13e529();});}else{_0x13e529();}}},'charset':_0x785a('0x3e'),'collate':_0x785a('0x3f')});}; \ No newline at end of file +var _0xca45=['afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','fti_whatsapp_messages','body','get','direction','UserId','WhatsappInteraction','findOne','update','createdAt','toLowerCase','error','out','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','then','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x20de89,_0x59ec59){var _0x561ffc=function(_0x3c53b9){while(--_0x3c53b9){_0x20de89['push'](_0x20de89['shift']());}};_0x561ffc(++_0x59ec59);}(_0xca45,0x1ae));var _0x5ca4=function(_0xf33c0c,_0x4a8fc5){_0xf33c0c=_0xf33c0c-0x0;var _0x80aaa0=_0xca45[_0xf33c0c];return _0x80aaa0;};'use strict';var _=require('lodash');var util=require(_0x5ca4('0x0'));var logger=require(_0x5ca4('0x1'))(_0x5ca4('0x2'));var moment=require(_0x5ca4('0x3'));var BPromise=require(_0x5ca4('0x4'));var rp=require(_0x5ca4('0x5'));var fetch=require(_0x5ca4('0x6'));var fs=require('fs');var path=require(_0x5ca4('0x7'));var rimraf=require(_0x5ca4('0x8'));var config=require(_0x5ca4('0x9'));var attributes=require(_0x5ca4('0xa'));module[_0x5ca4('0xb')]=function(_0x1a3684,_0x5f4a0f){return _0x1a3684[_0x5ca4('0xc')](_0x5ca4('0xd'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x5ca4('0xe'),'fields':[_0x5ca4('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x529cba,_0x29e36b,_0x987054){var _0x42776=_0x1a3684['models'];var _0x540b82=_0x529cba[_0x5ca4('0x10')]({'plain':!![]});if(_0x540b82['direction']['toLowerCase']()==='in'||_0x540b82[_0x5ca4('0x11')]['toLowerCase']()==='out'&&!_0x540b82['secret']&&!_['isNil'](_0x540b82[_0x5ca4('0x12')])){_0x42776[_0x5ca4('0x13')][_0x5ca4('0x14')]({'where':{'id':_0x540b82['WhatsappInteractionId']}})['then'](function(_0x433c77){if(_0x433c77){_0x433c77[_0x5ca4('0x15')]({'lastMsgAt':_0x540b82[_0x5ca4('0x16')],'lastMsgDirection':_0x540b82['direction'][_0x5ca4('0x17')]()});}})['catch'](function(_0x22ddbd){console[_0x5ca4('0x18')](_0x22ddbd);});}if(_0x540b82[_0x5ca4('0x11')]===_0x5ca4('0x19')&&!_0x540b82[_0x5ca4('0x1a')]){var _0x58c565;_0x42776[_0x5ca4('0x1b')][_0x5ca4('0x1c')]({'where':{'id':_0x540b82[_0x5ca4('0x1d')]},'raw':!![]})['then'](function(_0x4d8c47){_0x58c565=_0x4d8c47;if(_0x58c565&&_0x58c565[_0x5ca4('0x1e')]){switch(_0x58c565['type']){case _0x5ca4('0x1f'):var _0x20f205=require(_0x5ca4('0x1f'));if(_0x58c565[_0x5ca4('0x20')]&&_0x58c565[_0x5ca4('0x21')]&&_0x58c565[_0x5ca4('0x22')]){var _0x543c88=new _0x20f205(_0x58c565['accountSid'],_0x58c565[_0x5ca4('0x21')]);_0x543c88[_0x5ca4('0x23')]['create']({'body':_0x540b82['body'],'to':'whatsapp:'+_0x540b82[_0x5ca4('0x22')],'from':_0x5ca4('0x24')+_0x58c565[_0x5ca4('0x22')],'statusCallback':_0x58c565[_0x5ca4('0x25')]+'/api/whatsapp/messages/'+_0x540b82['id']+'/status?token='+_0x58c565['token']})[_0x5ca4('0x26')](function(_0x2fd27d){if(_0x2fd27d[_0x5ca4('0x27')]){return _0x529cba[_0x5ca4('0x15')]({'messageId':_0x2fd27d[_0x5ca4('0x27')]});}})[_0x5ca4('0x28')](function(_0x2b8a9c){logger[_0x5ca4('0x18')](_0x5ca4('0x29'),'afterCreate',_0x5ca4('0x1f'),util['inspect'](_0x2b8a9c,{'showHidden':![],'depth':null}));});}else{logger[_0x5ca4('0x18')](_0x5ca4('0x29'),_0x5ca4('0x2a'),_0x5ca4('0x1f'),_0x5ca4('0x2b'));}break;case _0x5ca4('0x2c'):var _0x11b630=_0x58c565[_0x5ca4('0x20')];var _0xd917bf=_0x58c565['authToken'];var _0x367cca=_0x58c565[_0x5ca4('0x2d')]+_0x5ca4('0x2e')+_0x11b630+_0x5ca4('0x2f');var _0x3f4e24={'to':[_0x540b82[_0x5ca4('0x22')]],'message':{'type':_0x5ca4('0x30'),'text':_0x540b82[_0x5ca4('0xf')]}};var _0x5a39a8={'method':_0x5ca4('0x31'),'uri':_0x367cca,'headers':{'Authorization':_0x5ca4('0x32')+_0xd917bf,'Content-Type':_0x5ca4('0x33')},'body':_0x3f4e24,'json':!![]};rp(_0x5a39a8)[_0x5ca4('0x26')](function(_0x3dc9e5){if(_0x3dc9e5['statuses'][0x0][_0x5ca4('0x34')]){return _0x529cba[_0x5ca4('0x15')]({'messageId':_0x3dc9e5[_0x5ca4('0x35')][0x0][_0x5ca4('0x34')]});}})[_0x5ca4('0x28')](function(_0x255f93){logger[_0x5ca4('0x36')](_0x5ca4('0x37'),_0x255f93);});break;}}})[_0x5ca4('0x38')](function(){_0x987054();});}else{_0x987054();}}},'charset':_0x5ca4('0x39'),'collate':_0x5ca4('0x3a')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index bf9480d..3b946c9 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 _0xe2eb=['request','then','info','request\x20sent','debug','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x533f4a,_0x202330){var _0x394444=function(_0x2c0f5f){while(--_0x2c0f5f){_0x533f4a['push'](_0x533f4a['shift']());}};_0x394444(++_0x202330);}(_0xe2eb,0xc4));var _0xbe2e=function(_0x4456ce,_0x21db63){_0x4456ce=_0x4456ce-0x0;var _0x2837ef=_0xe2eb[_0x4456ce];return _0x2837ef;};'use strict';var _=require(_0xbe2e('0x0'));var util=require(_0xbe2e('0x1'));var moment=require(_0xbe2e('0x2'));var BPromise=require(_0xbe2e('0x3'));var rs=require(_0xbe2e('0x4'));var fs=require('fs');var Redis=require(_0xbe2e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe2e('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbe2e('0x7'));var client=jayson[_0xbe2e('0x8')][_0xbe2e('0x9')]({'port':0x232a});config[_0xbe2e('0xa')]=_['defaults'](config[_0xbe2e('0xa')],{'host':_0xbe2e('0xb'),'port':0x18eb});var socket=require(_0xbe2e('0xc'))(new Redis(config[_0xbe2e('0xa')]));require('./whatsappMessage.socket')[_0xbe2e('0xd')](socket);function respondWithRpcPromise(_0x44226a,_0x46167a,_0x3a1881){return new BPromise(function(_0x5029e2,_0x351497){return client[_0xbe2e('0xe')](_0x44226a,_0x3a1881)[_0xbe2e('0xf')](function(_0x2dddc7){logger[_0xbe2e('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x46167a,_0xbe2e('0x11'));logger[_0xbe2e('0x12')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x46167a,_0xbe2e('0x11'),JSON[_0xbe2e('0x13')](_0x2dddc7));if(_0x2dddc7['error']){if(_0x2dddc7[_0xbe2e('0x14')]['code']===0x1f4){logger[_0xbe2e('0x14')](_0xbe2e('0x15'),_0x46167a,_0x2dddc7['error']['message']);return _0x351497(_0x2dddc7[_0xbe2e('0x14')][_0xbe2e('0x16')]);}logger[_0xbe2e('0x14')](_0xbe2e('0x15'),_0x46167a,_0x2dddc7[_0xbe2e('0x14')][_0xbe2e('0x16')]);return _0x5029e2(_0x2dddc7[_0xbe2e('0x14')][_0xbe2e('0x16')]);}else{logger[_0xbe2e('0x10')](_0xbe2e('0x15'),_0x46167a,_0xbe2e('0x11'));_0x5029e2(_0x2dddc7[_0xbe2e('0x17')][_0xbe2e('0x16')]);}})['catch'](function(_0x3366d4){logger['error'](_0xbe2e('0x15'),_0x46167a,_0x3366d4);_0x351497(_0x3366d4);});});}exports[_0xbe2e('0x18')]=function(_0x18da07){var _0x27fbe4=this;return new Promise(function(_0x38f4d1,_0x2b4429){return db['WhatsappMessage'][_0xbe2e('0x19')](_0x18da07[_0xbe2e('0x1a')],{'raw':_0x18da07[_0xbe2e('0x1b')]?_0x18da07[_0xbe2e('0x1b')][_0xbe2e('0x1c')]===undefined?!![]:![]:!![]})[_0xbe2e('0xf')](function(_0x338a66){logger[_0xbe2e('0x10')](_0xbe2e('0x18'),_0x18da07);logger[_0xbe2e('0x12')]('CreateWhatsappMessage',_0x18da07,JSON['stringify'](_0x338a66));_0x38f4d1(_0x338a66);})[_0xbe2e('0x1d')](function(_0x419062){logger[_0xbe2e('0x14')](_0xbe2e('0x18'),_0x419062['message'],_0x18da07);_0x2b4429(_0x27fbe4['error'](0x1f4,_0x419062[_0xbe2e('0x16')]));});});}; \ No newline at end of file +var _0x0d52=['localhost','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults'];(function(_0x5ad597,_0x3f5fad){var _0x365f59=function(_0x4ffe73){while(--_0x4ffe73){_0x5ad597['push'](_0x5ad597['shift']());}};_0x365f59(++_0x3f5fad);}(_0x0d52,0x6b));var _0x20d5=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0d52[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x20d5('0x0'));var util=require(_0x20d5('0x1'));var moment=require(_0x20d5('0x2'));var BPromise=require(_0x20d5('0x3'));var rs=require(_0x20d5('0x4'));var fs=require('fs');var Redis=require(_0x20d5('0x5'));var db=require(_0x20d5('0x6'))['db'];var utils=require(_0x20d5('0x7'));var logger=require(_0x20d5('0x8'))(_0x20d5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20d5('0xa')]['http']({'port':0x232a});config[_0x20d5('0xb')]=_[_0x20d5('0xc')](config[_0x20d5('0xb')],{'host':_0x20d5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x55cfb8,_0x2d1c49,_0xe9f049){return new BPromise(function(_0x577efe,_0x5ee48f){return client[_0x20d5('0xe')](_0x55cfb8,_0xe9f049)[_0x20d5('0xf')](function(_0x16c30e){logger['info'](_0x20d5('0x10'),_0x2d1c49,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2d1c49,_0x20d5('0x11'),JSON['stringify'](_0x16c30e));if(_0x16c30e[_0x20d5('0x12')]){if(_0x16c30e[_0x20d5('0x12')]['code']===0x1f4){logger[_0x20d5('0x12')](_0x20d5('0x10'),_0x2d1c49,_0x16c30e[_0x20d5('0x12')][_0x20d5('0x13')]);return _0x5ee48f(_0x16c30e[_0x20d5('0x12')][_0x20d5('0x13')]);}logger['error'](_0x20d5('0x10'),_0x2d1c49,_0x16c30e['error'][_0x20d5('0x13')]);return _0x577efe(_0x16c30e['error'][_0x20d5('0x13')]);}else{logger[_0x20d5('0x14')](_0x20d5('0x10'),_0x2d1c49,'request\x20sent');_0x577efe(_0x16c30e[_0x20d5('0x15')]['message']);}})[_0x20d5('0x16')](function(_0x3bb658){logger[_0x20d5('0x12')](_0x20d5('0x10'),_0x2d1c49,_0x3bb658);_0x5ee48f(_0x3bb658);});});}exports[_0x20d5('0x17')]=function(_0x53421f){var _0x1c829e=this;return new Promise(function(_0x10e59d,_0x1feded){return db[_0x20d5('0x18')][_0x20d5('0x19')](_0x53421f[_0x20d5('0x1a')],{'raw':_0x53421f[_0x20d5('0x1b')]?_0x53421f['options'][_0x20d5('0x1c')]===undefined?!![]:![]:!![]})[_0x20d5('0xf')](function(_0xebd6da){logger[_0x20d5('0x14')](_0x20d5('0x17'),_0x53421f);logger['debug'](_0x20d5('0x17'),_0x53421f,JSON[_0x20d5('0x1d')](_0xebd6da));_0x10e59d(_0xebd6da);})[_0x20d5('0x16')](function(_0x2856c8){logger[_0x20d5('0x12')](_0x20d5('0x17'),_0x2856c8[_0x20d5('0x13')],_0x53421f);_0x1feded(_0x1c829e[_0x20d5('0x12')](0x1f4,_0x2856c8[_0x20d5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 295bddd..f4f4d2b 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 _0xa578=['removeListener','register','length','whatsappMessage:','remove','update'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa578,0xc4));var _0x8a57=function(_0x10810a,_0x1fe4a7){_0x10810a=_0x10810a-0x0;var _0x49aca5=_0xa578[_0x10810a];return _0x49aca5;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x8a57('0x0'),_0x8a57('0x1')];function createListener(_0x31bcf9,_0x487dc6){return function(_0x1bf476){_0x487dc6['emit'](_0x31bcf9,_0x1bf476);};}function removeListener(_0xfb2a8c,_0x2ca665){return function(){WhatsappMessageEvents[_0x8a57('0x2')](_0xfb2a8c,_0x2ca665);};}exports[_0x8a57('0x3')]=function(_0x3002aa){for(var _0x278b70=0x0,_0x43bb4b=events[_0x8a57('0x4')];_0x278b70<_0x43bb4b;_0x278b70++){var _0x826ebb=events[_0x278b70];var _0x1a3941=createListener(_0x8a57('0x5')+_0x826ebb,_0x3002aa);WhatsappMessageEvents['on'](_0x826ebb,_0x1a3941);}}; \ No newline at end of file +var _0x8561=['./whatsappMessage.events','save','update','removeListener','register','length'];(function(_0x141834,_0xac4783){var _0x330907=function(_0x47f652){while(--_0x47f652){_0x141834['push'](_0x141834['shift']());}};_0x330907(++_0xac4783);}(_0x8561,0x1f2));var _0x1856=function(_0x461eaa,_0x5b9604){_0x461eaa=_0x461eaa-0x0;var _0x3f2756=_0x8561[_0x461eaa];return _0x3f2756;};'use strict';var WhatsappMessageEvents=require(_0x1856('0x0'));var events=[_0x1856('0x1'),'remove',_0x1856('0x2')];function createListener(_0x33fe8f,_0x2b9015){return function(_0x22648a){_0x2b9015['emit'](_0x33fe8f,_0x22648a);};}function removeListener(_0x75a896,_0x19857f){return function(){WhatsappMessageEvents[_0x1856('0x3')](_0x75a896,_0x19857f);};}exports[_0x1856('0x4')]=function(_0xc62c4c){for(var _0x103d37=0x0,_0x479f07=events[_0x1856('0x5')];_0x103d37<_0x479f07;_0x103d37++){var _0x27d9fd=events[_0x103d37];var _0x1abf25=createListener('whatsappMessage:'+_0x27d9fd,_0xc62c4c);WhatsappMessageEvents['on'](_0x27d9fd,_0x1abf25);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 3a22b22..65de732 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 _0x9a39=['isAuthenticated','get','/describe','/:id','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller'];(function(_0x3e9764,_0x214445){var _0x22b930=function(_0x223791){while(--_0x223791){_0x3e9764['push'](_0x3e9764['shift']());}};_0x22b930(++_0x214445);}(_0x9a39,0xd1));var _0x99a3=function(_0x4381de,_0x5c5ca0){_0x4381de=_0x4381de-0x0;var _0x2a6f52=_0x9a39[_0x4381de];return _0x2a6f52;};'use strict';var multer=require('multer');var util=require(_0x99a3('0x0'));var path=require(_0x99a3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x99a3('0x2')]();var fs_extra=require(_0x99a3('0x3'));var auth=require(_0x99a3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x99a3('0x5'));var controller=require(_0x99a3('0x6'));router['get']('/',auth[_0x99a3('0x7')](),controller['index']);router[_0x99a3('0x8')](_0x99a3('0x9'),auth[_0x99a3('0x7')](),controller['describe']);router['get'](_0x99a3('0xa'),auth[_0x99a3('0x7')](),controller['show']);router[_0x99a3('0x8')](_0x99a3('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0x99a3('0x8')](_0x99a3('0xc'),auth[_0x99a3('0x7')](),controller['getTeams']);router[_0x99a3('0x8')](_0x99a3('0xd'),auth['isAuthenticated'](),controller[_0x99a3('0xe')]);router[_0x99a3('0xf')]('/',auth[_0x99a3('0x7')](),controller[_0x99a3('0x10')]);router[_0x99a3('0xf')]('/:id/teams',auth[_0x99a3('0x7')](),controller[_0x99a3('0x11')]);router[_0x99a3('0xf')](_0x99a3('0xd'),auth[_0x99a3('0x7')](),controller['addAgents']);router['put'](_0x99a3('0xa'),auth[_0x99a3('0x7')](),controller[_0x99a3('0x12')]);router[_0x99a3('0x13')]('/:id',auth[_0x99a3('0x7')](),controller[_0x99a3('0x14')]);router['delete'](_0x99a3('0xc'),auth[_0x99a3('0x7')](),controller[_0x99a3('0x15')]);router[_0x99a3('0x13')](_0x99a3('0xd'),auth[_0x99a3('0x7')](),controller[_0x99a3('0x16')]);module[_0x99a3('0x17')]=router; \ No newline at end of file +var _0xc1bc=['/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams'];(function(_0x3979bb,_0x36f403){var _0xaedec8=function(_0x1821cb){while(--_0x1821cb){_0x3979bb['push'](_0x3979bb['shift']());}};_0xaedec8(++_0x36f403);}(_0xc1bc,0x1cb));var _0xcc1b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc1bc[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xcc1b('0x0'));var util=require(_0xcc1b('0x1'));var path=require(_0xcc1b('0x2'));var timeout=require(_0xcc1b('0x3'));var express=require(_0xcc1b('0x4'));var router=express[_0xcc1b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcc1b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcc1b('0x7'));var controller=require('./whatsappQueue.controller');router[_0xcc1b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcc1b('0x8')](_0xcc1b('0x9'),auth[_0xcc1b('0xa')](),controller[_0xcc1b('0xb')]);router[_0xcc1b('0x8')](_0xcc1b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcc1b('0x8')](_0xcc1b('0xd'),auth['isAuthenticated'](),controller[_0xcc1b('0xe')]);router[_0xcc1b('0x8')](_0xcc1b('0xf'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xcc1b('0x10'),auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x11')]);router['post']('/',auth[_0xcc1b('0xa')](),controller['create']);router[_0xcc1b('0x12')]('/:id/teams',auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x13')]);router['post']('/:id/users',auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x14')]);router[_0xcc1b('0x15')](_0xcc1b('0xc'),auth[_0xcc1b('0xa')](),controller[_0xcc1b('0x16')]);router[_0xcc1b('0x17')](_0xcc1b('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xcc1b('0x17')](_0xcc1b('0xf'),auth[_0xcc1b('0xa')](),controller['removeTeams']);router[_0xcc1b('0x17')]('/:id/users',auth[_0xcc1b('0xa')](),controller['removeAgents']);module[_0xcc1b('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 07cd52d..a29c329 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 _0xb7fc=['ENUM','roundrobin','STRING','sequelize','name','INTEGER'];(function(_0xf0bcbf,_0x196298){var _0x3ab487=function(_0x1f715c){while(--_0x1f715c){_0xf0bcbf['push'](_0xf0bcbf['shift']());}};_0x3ab487(++_0x196298);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0xa4928c,_0x16b89c){_0xa4928c=_0xa4928c-0x0;var _0x27cc29=_0xb7fc[_0xa4928c];return _0x27cc29;};'use strict';var Sequelize=require(_0xcb7f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcb7f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcb7f('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcb7f('0x3')]('rrmemory','beepall',_0xcb7f('0x4'))},'description':{'type':Sequelize[_0xcb7f('0x5')]}}; \ No newline at end of file +var _0xb458=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x285e45,_0x34ecaf){var _0x15d68a=function(_0x248191){while(--_0x248191){_0x285e45['push'](_0x285e45['shift']());}};_0x15d68a(++_0x34ecaf);}(_0xb458,0xca));var _0x8b45=function(_0x416df5,_0x5cd9e7){_0x416df5=_0x416df5-0x0;var _0x53235b=_0xb458[_0x416df5];return _0x53235b;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':_0x8b45('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b45('0x4')](_0x8b45('0x5'),_0x8b45('0x6'),_0x8b45('0x7'))},'description':{'type':Sequelize[_0x8b45('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index bf7f9ef..0b7f813 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 _0x8408=['compact','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','WhatsappQueues','end','error','stack','name','index','WhatsappQueue','rawAttributes','fieldName','type','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','ids','from','team_has_whatsapp_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId'];(function(_0x4d0d85,_0x3250d3){var _0x290a74=function(_0x4762db){while(--_0x4762db){_0x4d0d85['push'](_0x4d0d85['shift']());}};_0x290a74(++_0x3250d3);}(_0x8408,0x8f));var _0x8840=function(_0x477752,_0x564b7d){_0x477752=_0x477752-0x0;var _0x439c7c=_0x8408[_0x477752];return _0x439c7c;};'use strict';var emlformat=require(_0x8840('0x0'));var rimraf=require(_0x8840('0x1'));var zipdir=require(_0x8840('0x2'));var jsonpatch=require(_0x8840('0x3'));var rp=require('request-promise');var moment=require(_0x8840('0x4'));var BPromise=require(_0x8840('0x5'));var Mustache=require(_0x8840('0x6'));var util=require(_0x8840('0x7'));var path=require('path');var sox=require(_0x8840('0x8'));var csv=require(_0x8840('0x9'));var ejs=require(_0x8840('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8840('0xb'));var squel=require(_0x8840('0xc'));var crypto=require(_0x8840('0xd'));var jsforce=require(_0x8840('0xe'));var deskjs=require(_0x8840('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8840('0x10'));var Papa=require(_0x8840('0x11'));var Redis=require('ioredis');var authService=require(_0x8840('0x12'));var qs=require(_0x8840('0x13'));var as=require(_0x8840('0x14'));var hardwareService=require(_0x8840('0x15'));var logger=require(_0x8840('0x16'))('api');var utils=require(_0x8840('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8840('0x18'));var db=require(_0x8840('0x19'))['db'];config['redis']=_['defaults'](config[_0x8840('0x1a')],{'host':_0x8840('0x1b'),'port':0x18eb});var socket=require(_0x8840('0x1c'))(new Redis(config[_0x8840('0x1a')]));require('./whatsappQueue.socket')[_0x8840('0x1d')](socket);function respondWithStatusCode(_0x31238f,_0x22c138){_0x22c138=_0x22c138||0xcc;return function(_0x4ec36a){if(_0x4ec36a){return _0x31238f[_0x8840('0x1e')](_0x22c138);}return _0x31238f[_0x8840('0x1f')](_0x22c138)['end']();};}function respondWithResult(_0x1bf191,_0x1aa945){_0x1aa945=_0x1aa945||0xc8;return function(_0x5ed969){if(_0x5ed969){return _0x1bf191[_0x8840('0x1f')](_0x1aa945)[_0x8840('0x20')](_0x5ed969);}};}function respondWithFilteredResult(_0x3be5cf,_0x25dd63){return function(_0x3c794a){if(_0x3c794a){var _0x10f7fa=typeof _0x25dd63[_0x8840('0x21')]==='undefined'&&typeof _0x25dd63[_0x8840('0x22')]===_0x8840('0x23');var _0xc6f1d0=_0x3c794a[_0x8840('0x24')];var _0x475002=_0x10f7fa?0x0:_0x25dd63[_0x8840('0x21')];var _0x58876b=_0x10f7fa?_0x3c794a['count']:_0x25dd63['offset']+_0x25dd63[_0x8840('0x22')];var _0x41a344;if(_0x58876b>=_0xc6f1d0){_0x58876b=_0xc6f1d0;_0x41a344=0xc8;}else{_0x41a344=0xce;}_0x3be5cf['status'](_0x41a344);return _0x3be5cf[_0x8840('0x25')](_0x8840('0x26'),_0x475002+'-'+_0x58876b+'/'+_0xc6f1d0)[_0x8840('0x20')](_0x3c794a);}return null;};}function patchUpdates(_0x9f243b){return function(_0x1beea2){try{jsonpatch[_0x8840('0x27')](_0x1beea2,_0x9f243b,!![]);}catch(_0xc11106){return BPromise['reject'](_0xc11106);}return _0x1beea2['save']();};}function saveUpdates(_0x1e1d92,_0xc7812){return function(_0x45b2c0){if(_0x45b2c0){return _0x45b2c0[_0x8840('0x28')](_0x1e1d92)[_0x8840('0x29')](function(_0x5372a1){return _0x5372a1;});}return null;};}function removeEntity(_0x18a611,_0xe21f13){return function(_0x16ad66){if(_0x16ad66){return _0x16ad66['destroy']()[_0x8840('0x29')](function(){var _0xc33ce4=_0x16ad66['get']({'plain':!![]});var _0x5872ba=_0x8840('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x5872ba,'resourceId':_0xc33ce4['id']}})[_0x8840('0x29')](function(){return _0x16ad66;});})[_0x8840('0x29')](function(){_0x18a611['status'](0xcc)[_0x8840('0x2b')]();});}};}function handleEntityNotFound(_0x1d43b4,_0x2856ca){return function(_0x8aa4d3){if(!_0x8aa4d3){_0x1d43b4[_0x8840('0x1e')](0x194);}return _0x8aa4d3;};}function handleError(_0x253fe9,_0x433165){_0x433165=_0x433165||0x1f4;return function(_0x2c4e58){logger[_0x8840('0x2c')](_0x2c4e58[_0x8840('0x2d')]);if(_0x2c4e58[_0x8840('0x2e')]){delete _0x2c4e58[_0x8840('0x2e')];}_0x253fe9['status'](_0x433165)['send'](_0x2c4e58);};}exports[_0x8840('0x2f')]=function(_0x1817b1,_0x5c7cb6){var _0x48b7db={},_0x5c7fcc={},_0x21f0c7={'count':0x0,'rows':[]};var _0x4b5d6d=_['map'](db[_0x8840('0x30')][_0x8840('0x31')],function(_0x29ddab){return{'name':_0x29ddab[_0x8840('0x32')],'type':_0x29ddab[_0x8840('0x33')]['key']};});_0x5c7fcc['model']=_[_0x8840('0x34')](_0x4b5d6d,_0x8840('0x2e'));_0x5c7fcc['query']=_[_0x8840('0x35')](_0x1817b1[_0x8840('0x36')]);_0x5c7fcc[_0x8840('0x37')]=_[_0x8840('0x38')](_0x5c7fcc['model'],_0x5c7fcc['query']);_0x48b7db[_0x8840('0x39')]=_[_0x8840('0x38')](_0x5c7fcc[_0x8840('0x3a')],qs[_0x8840('0x3b')](_0x1817b1[_0x8840('0x36')][_0x8840('0x3b')]));_0x48b7db[_0x8840('0x39')]=_0x48b7db[_0x8840('0x39')]['length']?_0x48b7db[_0x8840('0x39')]:_0x5c7fcc['model'];if(!_0x1817b1[_0x8840('0x36')][_0x8840('0x3c')](_0x8840('0x3d'))){_0x48b7db[_0x8840('0x22')]=qs['limit'](_0x1817b1[_0x8840('0x36')][_0x8840('0x22')]);_0x48b7db['offset']=qs[_0x8840('0x21')](_0x1817b1[_0x8840('0x36')][_0x8840('0x21')]);}_0x48b7db[_0x8840('0x3e')]=qs[_0x8840('0x3f')](_0x1817b1['query']['sort']);_0x48b7db[_0x8840('0x40')]=qs['filters'](_[_0x8840('0x41')](_0x1817b1['query'],_0x5c7fcc[_0x8840('0x37')]),_0x4b5d6d);if(_0x1817b1['query'][_0x8840('0x42')]){_0x48b7db['where']=_[_0x8840('0x43')](_0x48b7db['where'],{'$or':_['map'](_0x4b5d6d,function(_0x5ce0cb){if(_0x5ce0cb['type']!==_0x8840('0x44')){var _0x9bb422={};_0x9bb422[_0x5ce0cb[_0x8840('0x2e')]]={'$like':'%'+_0x1817b1[_0x8840('0x36')][_0x8840('0x42')]+'%'};return _0x9bb422;}})});}_0x48b7db=_['merge']({},_0x48b7db,_0x1817b1[_0x8840('0x45')]);var _0x2004a0={'where':_0x48b7db[_0x8840('0x40')]};return db[_0x8840('0x30')]['count'](_0x2004a0)[_0x8840('0x29')](function(_0x2a6bb7){_0x21f0c7[_0x8840('0x24')]=_0x2a6bb7;if(_0x1817b1[_0x8840('0x36')]['includeAll']){_0x48b7db[_0x8840('0x46')]=[{'all':!![]}];}return db[_0x8840('0x30')][_0x8840('0x47')](_0x48b7db);})[_0x8840('0x29')](function(_0x39d4cb){_0x21f0c7[_0x8840('0x48')]=_0x39d4cb;return _0x21f0c7;})[_0x8840('0x29')](respondWithFilteredResult(_0x5c7cb6,_0x48b7db))[_0x8840('0x49')](handleError(_0x5c7cb6,null));};exports[_0x8840('0x4a')]=function(_0x255892,_0x22c083){var _0x1814ef={'raw':!![],'where':{'id':_0x255892['params']['id']}},_0x5e9dbf={};_0x5e9dbf[_0x8840('0x3a')]=_[_0x8840('0x35')](db[_0x8840('0x30')]['rawAttributes']);_0x5e9dbf[_0x8840('0x36')]=_[_0x8840('0x35')](_0x255892[_0x8840('0x36')]);_0x5e9dbf[_0x8840('0x37')]=_[_0x8840('0x38')](_0x5e9dbf['model'],_0x5e9dbf[_0x8840('0x36')]);_0x1814ef[_0x8840('0x39')]=_['intersection'](_0x5e9dbf[_0x8840('0x3a')],qs[_0x8840('0x3b')](_0x255892['query']['fields']));_0x1814ef[_0x8840('0x39')]=_0x1814ef[_0x8840('0x39')][_0x8840('0x4b')]?_0x1814ef[_0x8840('0x39')]:_0x5e9dbf['model'];if(_0x255892[_0x8840('0x36')][_0x8840('0x4c')]){_0x1814ef[_0x8840('0x46')]=[{'all':!![]}];}_0x1814ef=_[_0x8840('0x43')]({},_0x1814ef,_0x255892[_0x8840('0x45')]);return db['WhatsappQueue'][_0x8840('0x4d')](_0x1814ef)[_0x8840('0x29')](handleEntityNotFound(_0x22c083,null))[_0x8840('0x29')](respondWithResult(_0x22c083,null))[_0x8840('0x49')](handleError(_0x22c083,null));};exports[_0x8840('0x4e')]=function(_0x395648,_0x1f4315){return db[_0x8840('0x30')][_0x8840('0x4e')](_0x395648[_0x8840('0x4f')],{})['then'](function(_0xe2ff28){var _0x542413=_0x395648[_0x8840('0x50')][_0x8840('0x51')]({'plain':!![]});if(!_0x542413)throw new Error(_0x8840('0x52'));if(_0x542413[_0x8840('0x53')]===_0x8840('0x50')){var _0x1a1f55=_0xe2ff28[_0x8840('0x51')]({'plain':!![]});var _0x38e532=_0x8840('0x2a');return db[_0x8840('0x54')][_0x8840('0x4d')]({'where':{'name':_0x38e532,'userProfileId':_0x542413['userProfileId']},'raw':!![]})[_0x8840('0x29')](function(_0x1ad28e){if(_0x1ad28e&&_0x1ad28e[_0x8840('0x55')]===0x0){return db[_0x8840('0x56')]['create']({'name':_0x1a1f55[_0x8840('0x2e')],'resourceId':_0x1a1f55['id'],'type':_0x1ad28e[_0x8840('0x2e')],'sectionId':_0x1ad28e['id']},{})[_0x8840('0x29')](function(){return _0xe2ff28;});}else{return _0xe2ff28;}})[_0x8840('0x49')](function(_0x428151){logger[_0x8840('0x2c')](_0x8840('0x57'),_0x428151);throw _0x428151;});}return _0xe2ff28;})[_0x8840('0x29')](respondWithResult(_0x1f4315,0xc9))[_0x8840('0x49')](handleError(_0x1f4315,null));};exports[_0x8840('0x28')]=function(_0x170eef,_0x34517b){if(_0x170eef['body']['id']){delete _0x170eef[_0x8840('0x4f')]['id'];}return db[_0x8840('0x30')]['find']({'where':{'id':_0x170eef[_0x8840('0x58')]['id']}})[_0x8840('0x29')](handleEntityNotFound(_0x34517b,null))['then'](saveUpdates(_0x170eef['body'],null))[_0x8840('0x29')](respondWithResult(_0x34517b,null))['catch'](handleError(_0x34517b,null));};exports[_0x8840('0x59')]=function(_0x34985b,_0x27abb8){return db[_0x8840('0x30')][_0x8840('0x4d')]({'where':{'id':_0x34985b[_0x8840('0x58')]['id']}})[_0x8840('0x29')](handleEntityNotFound(_0x27abb8,null))[_0x8840('0x29')](removeEntity(_0x27abb8,null))[_0x8840('0x49')](handleError(_0x27abb8,null));};exports[_0x8840('0x5a')]=function(_0x489e85,_0x2d0c1b){return db[_0x8840('0x30')][_0x8840('0x5a')]()[_0x8840('0x29')](respondWithResult(_0x2d0c1b,null))[_0x8840('0x49')](handleError(_0x2d0c1b,null));};exports[_0x8840('0x5b')]=function(_0x15e75e,_0x5f31d4,_0x120e18){var _0x2855c5={'raw':!![],'where':{}},_0x1e1a13={},_0x470592;return db[_0x8840('0x30')][_0x8840('0x5c')]({'where':{'id':_0x15e75e['params']['id']}})['then'](handleEntityNotFound(_0x5f31d4,null))[_0x8840('0x29')](function(_0x2160e7){if(_0x2160e7){_0x470592=_0x2160e7[_0x8840('0x51')]({'plain':!![]});_0x1e1a13[_0x8840('0x3a')]=_[_0x8840('0x35')](db[_0x8840('0x5d')]['rawAttributes']);_0x1e1a13['query']=_[_0x8840('0x35')](_0x15e75e[_0x8840('0x36')]);_0x1e1a13[_0x8840('0x37')]=_['intersection'](_0x1e1a13[_0x8840('0x3a')],_0x1e1a13[_0x8840('0x36')]);_0x2855c5[_0x8840('0x39')]=_[_0x8840('0x38')](_0x1e1a13[_0x8840('0x3a')],qs['fields'](_0x15e75e[_0x8840('0x36')][_0x8840('0x3b')]));_0x2855c5[_0x8840('0x39')]=_0x2855c5[_0x8840('0x39')][_0x8840('0x4b')]?_0x2855c5[_0x8840('0x39')]:_0x1e1a13[_0x8840('0x3a')];if(!_0x15e75e[_0x8840('0x36')]['hasOwnProperty'](_0x8840('0x3d'))){_0x2855c5[_0x8840('0x22')]=qs[_0x8840('0x22')](_0x15e75e[_0x8840('0x36')]['limit']);_0x2855c5[_0x8840('0x21')]=qs[_0x8840('0x21')](_0x15e75e[_0x8840('0x36')][_0x8840('0x21')]);}_0x2855c5[_0x8840('0x3e')]=qs[_0x8840('0x3f')](_0x15e75e['query']['sort']);_0x2855c5[_0x8840('0x40')]=qs[_0x8840('0x37')](_[_0x8840('0x41')](_0x15e75e[_0x8840('0x36')],_0x1e1a13[_0x8840('0x37')]));_0x2855c5['where'][_0x8840('0x5e')]=_0x2160e7['id'];if(_0x15e75e[_0x8840('0x36')]['filter']){_0x2855c5[_0x8840('0x40')]=_[_0x8840('0x43')](_0x2855c5['where'],{'$or':_['map'](_0x2855c5[_0x8840('0x39')],function(_0x301890){var _0xa4e257={};_0xa4e257[_0x301890]={'$like':'%'+_0x15e75e[_0x8840('0x36')][_0x8840('0x42')]+'%'};return _0xa4e257;})});}_0x2855c5=_['merge']({},_0x2855c5,_0x15e75e['options']);return db[_0x8840('0x5d')][_0x8840('0x47')](_0x2855c5);}})[_0x8840('0x29')](function(_0x1ddd7b){if(_0x1ddd7b){return db[_0x8840('0x5f')][_0x8840('0x60')]({'where':{'id':_[_0x8840('0x34')](_0x1ddd7b,_0x8840('0x61')),'role':_0x8840('0x62')},'attributes':['id',_0x8840('0x2e'),_0x8840('0x63'),_0x8840('0x64'),_0x8840('0x65')]});}})['then'](function(_0x33f1af){if(_0x33f1af){return{'count':_0x33f1af[_0x8840('0x24')],'rows':_[_0x8840('0x34')](_0x33f1af[_0x8840('0x48')],function(_0x2271c4){return{'membername':_0x2271c4[_0x8840('0x2e')],'UserId':_0x2271c4['id'],'queue_name':_0x470592[_0x8840('0x2e')],'WhatsappQueueId':_0x470592['id'],'interface':util[_0x8840('0x66')](_0x8840('0x67'),'SIP',_0x2271c4[_0x8840('0x2e')]),'penalty':0x0,'paused':_0x2271c4[_0x8840('0x63')],'createdAt':_0x2271c4[_0x8840('0x65')],'updatedAt':_0x2271c4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8840('0x29')](respondWithFilteredResult(_0x5f31d4,_0x2855c5))['catch'](handleError(_0x5f31d4,null));};exports[_0x8840('0x68')]=function(_0x1b243f,_0xc0d743,_0x5ab577){var _0x1ab5f3={};var _0x13836e={};var _0x25897e;var _0x1840b2;return db[_0x8840('0x30')][_0x8840('0x5c')]({'where':{'id':_0x1b243f[_0x8840('0x58')]['id']}})[_0x8840('0x29')](handleEntityNotFound(_0xc0d743,null))[_0x8840('0x29')](function(_0x5aba2d){if(_0x5aba2d){_0x25897e=_0x5aba2d;_0x13836e[_0x8840('0x3a')]=_[_0x8840('0x35')](db[_0x8840('0x69')]['rawAttributes']);_0x13836e[_0x8840('0x36')]=_[_0x8840('0x35')](_0x1b243f['query']);_0x13836e[_0x8840('0x37')]=_[_0x8840('0x38')](_0x13836e[_0x8840('0x3a')],_0x13836e['query']);_0x1ab5f3[_0x8840('0x39')]=_[_0x8840('0x38')](_0x13836e[_0x8840('0x3a')],qs[_0x8840('0x3b')](_0x1b243f[_0x8840('0x36')][_0x8840('0x3b')]));_0x1ab5f3[_0x8840('0x39')]=_0x1ab5f3[_0x8840('0x39')][_0x8840('0x4b')]?_0x1ab5f3[_0x8840('0x39')]:_0x13836e['model'];_0x1ab5f3['order']=qs['sort'](_0x1b243f[_0x8840('0x36')]['sort']);_0x1ab5f3['where']=qs[_0x8840('0x37')](_[_0x8840('0x41')](_0x1b243f[_0x8840('0x36')],_0x13836e['filters']));if(_0x1b243f[_0x8840('0x36')][_0x8840('0x42')]){_0x1ab5f3[_0x8840('0x40')]=_['merge'](_0x1ab5f3[_0x8840('0x40')],{'$or':_[_0x8840('0x34')](_0x1ab5f3['attributes'],function(_0x39eb7c){var _0x226847={};_0x226847[_0x39eb7c]={'$like':'%'+_0x1b243f[_0x8840('0x36')][_0x8840('0x42')]+'%'};return _0x226847;})});}_0x1ab5f3=_[_0x8840('0x43')]({},_0x1ab5f3,_0x1b243f[_0x8840('0x45')]);return _0x25897e[_0x8840('0x68')](_0x1ab5f3);}})[_0x8840('0x29')](function(_0x4964d3){if(_0x4964d3){_0x1840b2=_0x4964d3[_0x8840('0x4b')];if(!_0x1b243f[_0x8840('0x36')][_0x8840('0x3c')]('nolimit')){_0x1ab5f3[_0x8840('0x22')]=qs[_0x8840('0x22')](_0x1b243f[_0x8840('0x36')][_0x8840('0x22')]);_0x1ab5f3[_0x8840('0x21')]=qs[_0x8840('0x21')](_0x1b243f[_0x8840('0x36')][_0x8840('0x21')]);}return _0x25897e['getTeams'](_0x1ab5f3);}})[_0x8840('0x29')](function(_0x55cf98){if(_0x55cf98){return _0x55cf98?{'count':_0x1840b2,'rows':_0x55cf98}:null;}})[_0x8840('0x29')](respondWithResult(_0xc0d743,null))[_0x8840('0x49')](handleError(_0xc0d743,null));};exports[_0x8840('0x6a')]=function(_0x2a1997,_0x5157f1,_0x5320a5){var _0x2614e7=_0x2a1997[_0x8840('0x4f')]['ids'];return db[_0x8840('0x69')][_0x8840('0x47')]({'where':{'id':_0x2614e7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8840('0x6b'),'attributes':['id',_0x8840('0x2e'),_0x8840('0x6c'),_0x8840('0x6d'),_0x8840('0x6e')],'raw':!![]}]})['then'](function(_0x2477f4){if(_0x2477f4){var _0x38a082=_[_0x8840('0x6f')](_0x2477f4,function(_0x563745){var _0x1f8705=_0x563745[_0x8840('0x51')]({'plain':!![]});return _0x1f8705['Agents'];});return db['WhatsappQueue']['find']({'where':{'id':_0x2a1997[_0x8840('0x58')]['id']}})[_0x8840('0x29')](function(_0x59e6b4){return db[_0x8840('0x70')][_0x8840('0x71')](function(_0x351574){return _0x59e6b4[_0x8840('0x6a')](_0x2614e7,{'transaction':_0x351574})[_0x8840('0x29')](function(){return BPromise[_0x8840('0x72')](_0x38a082,function(_0x3878b5){return db[_0x8840('0x5d')]['findOrCreate']({'where':{'UserId':_0x3878b5['id'],'WhatsappQueueId':_0x2a1997[_0x8840('0x58')]['id']},'transaction':_0x351574});});})['then'](function(){_0x38a082[_0x8840('0x73')](function(_0x4dcc5c){socket[_0x8840('0x74')](_0x8840('0x75'),{'UserId':_0x4dcc5c['id'],'WhatsappQueueId':_0x59e6b4['id']});});});});});}})['then'](respondWithStatusCode(_0x5157f1,null))['catch'](handleError(_0x5157f1,null));};exports[_0x8840('0x76')]=function(_0x3690e7,_0xe729e9,_0x1a90a7){return db[_0x8840('0x69')]['findAll']({'where':{'id':_0x3690e7[_0x8840('0x36')][_0x8840('0x77')]},'attributes':['id'],'include':[{'model':db[_0x8840('0x5f')],'as':_0x8840('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x8840('0x29')](handleEntityNotFound(_0xe729e9,null))[_0x8840('0x29')](function(_0x2e6df2){var _0x2df1d0=_['map'](_0x2e6df2,'id');var _0x7ac57e=[];var _0x4b1c3d=[];var _0x41b966=squel['select']();_0x41b966['field']('tq.TeamId')[_0x8840('0x78')](_0x8840('0x79'),'tq')['join'](_0x8840('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8840('0x40')]('WhatsappQueueId\x20=\x20?',_0x3690e7[_0x8840('0x58')]['id']);for(var _0x4fccea=0x0;_0x4fccea<_0x2e6df2[_0x8840('0x4b')];_0x4fccea+=0x1){let _0x36a6cf=_0x2e6df2[_0x4fccea];for(var _0x15282=0x0;_0x15282<_0x36a6cf[_0x8840('0x6b')][_0x8840('0x4b')];_0x15282+=0x1){let _0x1466a6=_0x36a6cf[_0x8840('0x6b')][_0x15282];var _0x4fdb50=_0x41b966[_0x8840('0x7b')]();_0x4fdb50[_0x8840('0x40')](_0x8840('0x7c'),_0x1466a6['id']);_0x4b1c3d[_0x8840('0x7d')](db[_0x8840('0x70')]['query'](_0x4fdb50[_0x8840('0x7e')](),{'type':db[_0x8840('0x70')][_0x8840('0x7f')]['SELECT']})[_0x8840('0x29')](function(_0x66c323){if(_0x66c323['length']===0x1){return _0x1466a6['id'];}else{var _0xae9eb0=_['every'](_[_0x8840('0x34')](_0x66c323,_0x8840('0x80')),function(_0x36541a){return _['includes'](_0x2df1d0,_0x36541a);});if(_0xae9eb0){return _0x1466a6['id'];}}}));}}return BPromise['all'](_0x4b1c3d)['then'](function(_0x208137){_0x7ac57e=_(_0x7ac57e)['union'](_0x208137)[_0x8840('0x81')]()['value']();return db[_0x8840('0x30')]['find']({'where':{'id':_0x3690e7['params']['id']}})['then'](function(_0x3cb126){return db['sequelize'][_0x8840('0x71')](function(_0x3eec3f){return _0x3cb126[_0x8840('0x76')](_0x3690e7[_0x8840('0x36')][_0x8840('0x77')],{'transaction':_0x3eec3f})[_0x8840('0x29')](function(){if(!_['isEmpty'](_0x7ac57e)){return _0x3cb126[_0x8840('0x82')](_0x7ac57e,{'transaction':_0x3eec3f});}})[_0x8840('0x29')](function(){_0x7ac57e['forEach'](function(_0x5cad0e){socket[_0x8840('0x74')](_0x8840('0x83'),{'UserId':_0x5cad0e,'WhatsappQueueId':_0x3cb126['id']});});});});});});})['then'](respondWithStatusCode(_0xe729e9,null))[_0x8840('0x49')](handleError(_0xe729e9,null));};exports[_0x8840('0x84')]=function(_0x5f0934,_0x4156b3,_0x1e6b90){return db[_0x8840('0x30')][_0x8840('0x4d')]({'where':{'id':_0x5f0934['params']['id']}})[_0x8840('0x29')](handleEntityNotFound(_0x4156b3,null))[_0x8840('0x29')](function(_0x72466b){if(_0x72466b){return _0x72466b[_0x8840('0x84')](_0x5f0934[_0x8840('0x4f')][_0x8840('0x77')],_[_0x8840('0x85')](_0x5f0934['body'],[_0x8840('0x77'),'id'])||{})['spread'](function(_0x6809ec){for(var _0x2c1e95=0x0;_0x2c1e95<_0x5f0934[_0x8840('0x4f')]['ids'][_0x8840('0x4b')];_0x2c1e95+=0x1){socket['emit'](_0x8840('0x75'),{'UserId':Number(_0x5f0934[_0x8840('0x4f')][_0x8840('0x77')][_0x2c1e95]),'WhatsappQueueId':Number(_0x5f0934[_0x8840('0x58')]['id'])});}return _0x6809ec;});}})[_0x8840('0x29')](respondWithResult(_0x4156b3,null))[_0x8840('0x49')](handleError(_0x4156b3,null));};exports[_0x8840('0x82')]=function(_0x213e81,_0x39daf0,_0x415dcf){return db[_0x8840('0x30')]['find']({'where':{'id':_0x213e81['params']['id']}})[_0x8840('0x29')](handleEntityNotFound(_0x39daf0,null))[_0x8840('0x29')](function(_0x4a9652){if(_0x4a9652){return _0x4a9652['removeAgents'](_0x213e81[_0x8840('0x36')][_0x8840('0x77')])[_0x8840('0x29')](function(){if(_[_0x8840('0x86')](_0x213e81['query'][_0x8840('0x77')])){for(var _0x17fb1f=0x0;_0x17fb1f<_0x213e81[_0x8840('0x36')][_0x8840('0x77')][_0x8840('0x4b')];_0x17fb1f+=0x1){socket[_0x8840('0x74')](_0x8840('0x83'),{'UserId':Number(_0x213e81[_0x8840('0x36')]['ids'][_0x17fb1f]),'WhatsappQueueId':Number(_0x213e81[_0x8840('0x58')]['id'])});}}else{socket[_0x8840('0x74')](_0x8840('0x83'),{'UserId':Number(_0x213e81[_0x8840('0x36')]['ids']),'WhatsappQueueId':Number(_0x213e81['params']['id'])});}});}})[_0x8840('0x29')](respondWithStatusCode(_0x39daf0,null))[_0x8840('0x49')](handleError(_0x39daf0,null));};exports[_0x8840('0x87')]=function(_0x377d48,_0x49782a,_0x23cdd7){var _0x4f4352={};var _0x4deb63={};var _0x506229;var _0xa79594;return db['WhatsappQueue']['findOne']({'where':{'id':_0x377d48[_0x8840('0x58')]['id']}})[_0x8840('0x29')](handleEntityNotFound(_0x49782a,null))[_0x8840('0x29')](function(_0x161e8d){if(_0x161e8d){_0x506229=_0x161e8d;_0x4deb63['model']=_[_0x8840('0x35')](db[_0x8840('0x5f')]['rawAttributes']);_0x4deb63[_0x8840('0x36')]=_[_0x8840('0x35')](_0x377d48['query']);_0x4deb63['filters']=_[_0x8840('0x38')](_0x4deb63[_0x8840('0x3a')],_0x4deb63[_0x8840('0x36')]);_0x4f4352[_0x8840('0x39')]=_[_0x8840('0x38')](_0x4deb63[_0x8840('0x3a')],qs[_0x8840('0x3b')](_0x377d48['query']['fields']));_0x4f4352[_0x8840('0x39')]=_0x4f4352[_0x8840('0x39')][_0x8840('0x4b')]?_0x4f4352[_0x8840('0x39')]:_0x4deb63[_0x8840('0x3a')];_0x4f4352[_0x8840('0x3e')]=qs[_0x8840('0x3f')](_0x377d48[_0x8840('0x36')][_0x8840('0x3f')]);_0x4f4352[_0x8840('0x40')]=qs[_0x8840('0x37')](_[_0x8840('0x41')](_0x377d48['query'],_0x4deb63[_0x8840('0x37')]));if(_0x377d48[_0x8840('0x36')][_0x8840('0x42')]){_0x4f4352[_0x8840('0x40')]=_[_0x8840('0x43')](_0x4f4352[_0x8840('0x40')],{'$or':_[_0x8840('0x34')](_0x4f4352[_0x8840('0x39')],function(_0x37c3c5){var _0x1eae51={};_0x1eae51[_0x37c3c5]={'$like':'%'+_0x377d48['query'][_0x8840('0x42')]+'%'};return _0x1eae51;})});}_0x4f4352=_[_0x8840('0x43')]({},_0x4f4352,_0x377d48['options']);return _0x506229[_0x8840('0x87')](_0x4f4352);}})['then'](function(_0x54e93d){if(_0x54e93d){_0xa79594=_0x54e93d['length'];if(!_0x377d48[_0x8840('0x36')][_0x8840('0x3c')](_0x8840('0x3d'))){_0x4f4352[_0x8840('0x22')]=qs[_0x8840('0x22')](_0x377d48[_0x8840('0x36')][_0x8840('0x22')]);_0x4f4352['offset']=qs[_0x8840('0x21')](_0x377d48[_0x8840('0x36')]['offset']);}return _0x506229[_0x8840('0x87')](_0x4f4352);}})[_0x8840('0x29')](function(_0xb7eea4){if(_0xb7eea4){return _0xb7eea4?{'count':_0xa79594,'rows':_0xb7eea4}:null;}})[_0x8840('0x29')](respondWithResult(_0x49782a,null))[_0x8840('0x49')](handleError(_0x49782a,null));}; \ No newline at end of file +var _0x1743=['Team','addTeams','ids','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','compact','value','removeAgents','forEach','emit','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappQueue.socket','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','name','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','WhatsappQueue','includeAll','include','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','body','describe','findOne','UserWhatsappQueue','pick','WhatsappQueueId','findAll','User','findAndCountAll','whatsappPause','updatedAt','createdAt','rows','format','getTeams'];(function(_0x82de21,_0x3e5114){var _0x45b924=function(_0x484110){while(--_0x484110){_0x82de21['push'](_0x82de21['shift']());}};_0x45b924(++_0x3e5114);}(_0x1743,0x1b1));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3174('0x0'));var rimraf=require(_0x3174('0x1'));var zipdir=require(_0x3174('0x2'));var jsonpatch=require(_0x3174('0x3'));var rp=require(_0x3174('0x4'));var moment=require(_0x3174('0x5'));var BPromise=require(_0x3174('0x6'));var Mustache=require('mustache');var util=require(_0x3174('0x7'));var path=require(_0x3174('0x8'));var sox=require(_0x3174('0x9'));var csv=require('to-csv');var ejs=require(_0x3174('0xa'));var fs=require('fs');var fs_extra=require(_0x3174('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3174('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3174('0xd'));var toCsv=require(_0x3174('0xe'));var querystring=require(_0x3174('0xf'));var Papa=require('papaparse');var Redis=require(_0x3174('0x10'));var authService=require(_0x3174('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3174('0x12'));var logger=require(_0x3174('0x13'))(_0x3174('0x14'));var utils=require(_0x3174('0x15'));var config=require(_0x3174('0x16'));var licenseUtil=require(_0x3174('0x17'));var db=require('../../mysqldb')['db'];config[_0x3174('0x18')]=_[_0x3174('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3174('0x1a'))(new Redis(config[_0x3174('0x18')]));require(_0x3174('0x1b'))['register'](socket);function respondWithStatusCode(_0x443ff7,_0x47ed12){_0x47ed12=_0x47ed12||0xcc;return function(_0x134492){if(_0x134492){return _0x443ff7['sendStatus'](_0x47ed12);}return _0x443ff7[_0x3174('0x1c')](_0x47ed12)[_0x3174('0x1d')]();};}function respondWithResult(_0x4ff2ff,_0x3d4338){_0x3d4338=_0x3d4338||0xc8;return function(_0x209f21){if(_0x209f21){return _0x4ff2ff[_0x3174('0x1c')](_0x3d4338)['json'](_0x209f21);}};}function respondWithFilteredResult(_0x1f5458,_0x4f232b){return function(_0x4e37d4){if(_0x4e37d4){var _0x226e3d=typeof _0x4f232b[_0x3174('0x1e')]==='undefined'&&typeof _0x4f232b[_0x3174('0x1f')]===_0x3174('0x20');var _0xcb65ae=_0x4e37d4[_0x3174('0x21')];var _0x166cf5=_0x226e3d?0x0:_0x4f232b[_0x3174('0x1e')];var _0xc131af=_0x226e3d?_0x4e37d4['count']:_0x4f232b[_0x3174('0x1e')]+_0x4f232b[_0x3174('0x1f')];var _0x5ae4a5;if(_0xc131af>=_0xcb65ae){_0xc131af=_0xcb65ae;_0x5ae4a5=0xc8;}else{_0x5ae4a5=0xce;}_0x1f5458[_0x3174('0x1c')](_0x5ae4a5);return _0x1f5458[_0x3174('0x22')](_0x3174('0x23'),_0x166cf5+'-'+_0xc131af+'/'+_0xcb65ae)[_0x3174('0x24')](_0x4e37d4);}return null;};}function patchUpdates(_0x253963){return function(_0x20e457){try{jsonpatch[_0x3174('0x25')](_0x20e457,_0x253963,!![]);}catch(_0x31f2f4){return BPromise['reject'](_0x31f2f4);}return _0x20e457[_0x3174('0x26')]();};}function saveUpdates(_0x58f413,_0x1e13c2){return function(_0x5db39c){if(_0x5db39c){return _0x5db39c[_0x3174('0x27')](_0x58f413)[_0x3174('0x28')](function(_0x5899cf){return _0x5899cf;});}return null;};}function removeEntity(_0x3cd9bc,_0x57d52e){return function(_0x493477){if(_0x493477){return _0x493477[_0x3174('0x29')]()[_0x3174('0x28')](function(){var _0x2b9282=_0x493477[_0x3174('0x2a')]({'plain':!![]});var _0x182e9b=_0x3174('0x2b');return db[_0x3174('0x2c')]['destroy']({'where':{'type':_0x182e9b,'resourceId':_0x2b9282['id']}})[_0x3174('0x28')](function(){return _0x493477;});})[_0x3174('0x28')](function(){_0x3cd9bc[_0x3174('0x1c')](0xcc)[_0x3174('0x1d')]();});}};}function handleEntityNotFound(_0x15e286,_0x32b495){return function(_0x12f15e){if(!_0x12f15e){_0x15e286[_0x3174('0x2d')](0x194);}return _0x12f15e;};}function handleError(_0x1e3675,_0x58ac1c){_0x58ac1c=_0x58ac1c||0x1f4;return function(_0x42c195){logger['error'](_0x42c195['stack']);if(_0x42c195[_0x3174('0x2e')]){delete _0x42c195[_0x3174('0x2e')];}_0x1e3675['status'](_0x58ac1c)['send'](_0x42c195);};}exports['index']=function(_0x1c2517,_0x4c6e24){var _0x143c42={},_0x5bde9b={},_0x54d9ce={'count':0x0,'rows':[]};var _0x1cb086=_[_0x3174('0x2f')](db['WhatsappQueue'][_0x3174('0x30')],function(_0x577886){return{'name':_0x577886[_0x3174('0x31')],'type':_0x577886['type']['key']};});_0x5bde9b[_0x3174('0x32')]=_[_0x3174('0x2f')](_0x1cb086,'name');_0x5bde9b[_0x3174('0x33')]=_['keys'](_0x1c2517[_0x3174('0x33')]);_0x5bde9b[_0x3174('0x34')]=_[_0x3174('0x35')](_0x5bde9b[_0x3174('0x32')],_0x5bde9b['query']);_0x143c42[_0x3174('0x36')]=_[_0x3174('0x35')](_0x5bde9b[_0x3174('0x32')],qs[_0x3174('0x37')](_0x1c2517['query'][_0x3174('0x37')]));_0x143c42[_0x3174('0x36')]=_0x143c42[_0x3174('0x36')][_0x3174('0x38')]?_0x143c42[_0x3174('0x36')]:_0x5bde9b[_0x3174('0x32')];if(!_0x1c2517[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x143c42[_0x3174('0x1f')]=qs[_0x3174('0x1f')](_0x1c2517['query'][_0x3174('0x1f')]);_0x143c42[_0x3174('0x1e')]=qs[_0x3174('0x1e')](_0x1c2517['query'][_0x3174('0x1e')]);}_0x143c42[_0x3174('0x3b')]=qs[_0x3174('0x3c')](_0x1c2517[_0x3174('0x33')][_0x3174('0x3c')]);_0x143c42[_0x3174('0x3d')]=qs[_0x3174('0x34')](_['pick'](_0x1c2517['query'],_0x5bde9b['filters']),_0x1cb086);if(_0x1c2517['query'][_0x3174('0x3e')]){_0x143c42[_0x3174('0x3d')]=_['merge'](_0x143c42[_0x3174('0x3d')],{'$or':_['map'](_0x1cb086,function(_0x18bb3b){if(_0x18bb3b[_0x3174('0x3f')]!==_0x3174('0x40')){var _0x4b1276={};_0x4b1276[_0x18bb3b[_0x3174('0x2e')]]={'$like':'%'+_0x1c2517[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x4b1276;}})});}_0x143c42=_[_0x3174('0x41')]({},_0x143c42,_0x1c2517[_0x3174('0x42')]);var _0x2ed8d4={'where':_0x143c42[_0x3174('0x3d')]};return db[_0x3174('0x43')][_0x3174('0x21')](_0x2ed8d4)[_0x3174('0x28')](function(_0x19c9de){_0x54d9ce[_0x3174('0x21')]=_0x19c9de;if(_0x1c2517[_0x3174('0x33')][_0x3174('0x44')]){_0x143c42[_0x3174('0x45')]=[{'all':!![]}];}return db[_0x3174('0x43')]['findAll'](_0x143c42);})['then'](function(_0x3b8920){_0x54d9ce['rows']=_0x3b8920;return _0x54d9ce;})[_0x3174('0x28')](respondWithFilteredResult(_0x4c6e24,_0x143c42))[_0x3174('0x46')](handleError(_0x4c6e24,null));};exports[_0x3174('0x47')]=function(_0x2073df,_0x338463){var _0x16b8dd={'raw':!![],'where':{'id':_0x2073df[_0x3174('0x48')]['id']}},_0x1a135b={};_0x1a135b[_0x3174('0x32')]=_[_0x3174('0x49')](db['WhatsappQueue'][_0x3174('0x30')]);_0x1a135b[_0x3174('0x33')]=_[_0x3174('0x49')](_0x2073df[_0x3174('0x33')]);_0x1a135b['filters']=_[_0x3174('0x35')](_0x1a135b[_0x3174('0x32')],_0x1a135b['query']);_0x16b8dd[_0x3174('0x36')]=_[_0x3174('0x35')](_0x1a135b[_0x3174('0x32')],qs['fields'](_0x2073df[_0x3174('0x33')][_0x3174('0x37')]));_0x16b8dd[_0x3174('0x36')]=_0x16b8dd[_0x3174('0x36')][_0x3174('0x38')]?_0x16b8dd['attributes']:_0x1a135b['model'];if(_0x2073df[_0x3174('0x33')][_0x3174('0x44')]){_0x16b8dd[_0x3174('0x45')]=[{'all':!![]}];}_0x16b8dd=_[_0x3174('0x41')]({},_0x16b8dd,_0x2073df[_0x3174('0x42')]);return db[_0x3174('0x43')][_0x3174('0x4a')](_0x16b8dd)[_0x3174('0x28')](handleEntityNotFound(_0x338463,null))['then'](respondWithResult(_0x338463,null))['catch'](handleError(_0x338463,null));};exports[_0x3174('0x4b')]=function(_0x5a3ad0,_0x540c52){return db[_0x3174('0x43')][_0x3174('0x4b')](_0x5a3ad0['body'],{})[_0x3174('0x28')](function(_0xf6bb66){var _0x32d80c=_0x5a3ad0[_0x3174('0x4c')][_0x3174('0x2a')]({'plain':!![]});if(!_0x32d80c)throw new Error(_0x3174('0x4d'));if(_0x32d80c['role']===_0x3174('0x4c')){var _0x448ac2=_0xf6bb66[_0x3174('0x2a')]({'plain':!![]});var _0x355452=_0x3174('0x2b');return db[_0x3174('0x4e')]['find']({'where':{'name':_0x355452,'userProfileId':_0x32d80c['userProfileId']},'raw':!![]})[_0x3174('0x28')](function(_0x355e26){if(_0x355e26&&_0x355e26['autoAssociation']===0x0){return db[_0x3174('0x2c')][_0x3174('0x4b')]({'name':_0x448ac2[_0x3174('0x2e')],'resourceId':_0x448ac2['id'],'type':_0x355e26[_0x3174('0x2e')],'sectionId':_0x355e26['id']},{})['then'](function(){return _0xf6bb66;});}else{return _0xf6bb66;}})['catch'](function(_0x6f7ca1){logger[_0x3174('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6f7ca1);throw _0x6f7ca1;});}return _0xf6bb66;})[_0x3174('0x28')](respondWithResult(_0x540c52,0xc9))[_0x3174('0x46')](handleError(_0x540c52,null));};exports[_0x3174('0x27')]=function(_0x240d54,_0x10766a){if(_0x240d54['body']['id']){delete _0x240d54[_0x3174('0x50')]['id'];}return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0x240d54[_0x3174('0x48')]['id']}})['then'](handleEntityNotFound(_0x10766a,null))[_0x3174('0x28')](saveUpdates(_0x240d54[_0x3174('0x50')],null))[_0x3174('0x28')](respondWithResult(_0x10766a,null))[_0x3174('0x46')](handleError(_0x10766a,null));};exports[_0x3174('0x29')]=function(_0xc2ae0f,_0x5bbc25){return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0xc2ae0f[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x5bbc25,null))[_0x3174('0x28')](removeEntity(_0x5bbc25,null))[_0x3174('0x46')](handleError(_0x5bbc25,null));};exports[_0x3174('0x51')]=function(_0x280b13,_0x33dc22){return db[_0x3174('0x43')]['describe']()['then'](respondWithResult(_0x33dc22,null))[_0x3174('0x46')](handleError(_0x33dc22,null));};exports['getMembers']=function(_0x5e6a78,_0xe180,_0x587ca5){var _0x42cdd6={'raw':!![],'where':{}},_0x4082df={},_0x4dc4b3;return db[_0x3174('0x43')][_0x3174('0x52')]({'where':{'id':_0x5e6a78[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0xe180,null))[_0x3174('0x28')](function(_0x1f1993){if(_0x1f1993){_0x4dc4b3=_0x1f1993[_0x3174('0x2a')]({'plain':!![]});_0x4082df[_0x3174('0x32')]=_[_0x3174('0x49')](db[_0x3174('0x53')][_0x3174('0x30')]);_0x4082df['query']=_[_0x3174('0x49')](_0x5e6a78[_0x3174('0x33')]);_0x4082df[_0x3174('0x34')]=_[_0x3174('0x35')](_0x4082df[_0x3174('0x32')],_0x4082df['query']);_0x42cdd6['attributes']=_[_0x3174('0x35')](_0x4082df[_0x3174('0x32')],qs[_0x3174('0x37')](_0x5e6a78['query'][_0x3174('0x37')]));_0x42cdd6[_0x3174('0x36')]=_0x42cdd6[_0x3174('0x36')]['length']?_0x42cdd6[_0x3174('0x36')]:_0x4082df['model'];if(!_0x5e6a78[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x42cdd6[_0x3174('0x1f')]=qs['limit'](_0x5e6a78[_0x3174('0x33')][_0x3174('0x1f')]);_0x42cdd6[_0x3174('0x1e')]=qs[_0x3174('0x1e')](_0x5e6a78['query']['offset']);}_0x42cdd6['order']=qs[_0x3174('0x3c')](_0x5e6a78[_0x3174('0x33')][_0x3174('0x3c')]);_0x42cdd6[_0x3174('0x3d')]=qs['filters'](_[_0x3174('0x54')](_0x5e6a78[_0x3174('0x33')],_0x4082df[_0x3174('0x34')]));_0x42cdd6[_0x3174('0x3d')][_0x3174('0x55')]=_0x1f1993['id'];if(_0x5e6a78[_0x3174('0x33')][_0x3174('0x3e')]){_0x42cdd6['where']=_[_0x3174('0x41')](_0x42cdd6[_0x3174('0x3d')],{'$or':_[_0x3174('0x2f')](_0x42cdd6[_0x3174('0x36')],function(_0x333c45){var _0x473e19={};_0x473e19[_0x333c45]={'$like':'%'+_0x5e6a78[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x473e19;})});}_0x42cdd6=_[_0x3174('0x41')]({},_0x42cdd6,_0x5e6a78[_0x3174('0x42')]);return db['UserWhatsappQueue'][_0x3174('0x56')](_0x42cdd6);}})[_0x3174('0x28')](function(_0x29f638){if(_0x29f638){return db[_0x3174('0x57')][_0x3174('0x58')]({'where':{'id':_[_0x3174('0x2f')](_0x29f638,'UserId'),'role':'agent'},'attributes':['id','name',_0x3174('0x59'),_0x3174('0x5a'),_0x3174('0x5b')]});}})[_0x3174('0x28')](function(_0x5f4587){if(_0x5f4587){return{'count':_0x5f4587[_0x3174('0x21')],'rows':_[_0x3174('0x2f')](_0x5f4587[_0x3174('0x5c')],function(_0x29f559){return{'membername':_0x29f559[_0x3174('0x2e')],'UserId':_0x29f559['id'],'queue_name':_0x4dc4b3['name'],'WhatsappQueueId':_0x4dc4b3['id'],'interface':util[_0x3174('0x5d')]('%s/%s','SIP',_0x29f559[_0x3174('0x2e')]),'penalty':0x0,'paused':_0x29f559[_0x3174('0x59')],'createdAt':_0x29f559[_0x3174('0x5b')],'updatedAt':_0x29f559[_0x3174('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3174('0x28')](respondWithFilteredResult(_0xe180,_0x42cdd6))[_0x3174('0x46')](handleError(_0xe180,null));};exports[_0x3174('0x5e')]=function(_0x378157,_0x3174d3,_0x2de6a6){var _0x2cc632={};var _0x55ab8f={};var _0x35af9a;var _0x5751bb;return db[_0x3174('0x43')][_0x3174('0x52')]({'where':{'id':_0x378157[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x3174d3,null))[_0x3174('0x28')](function(_0x17329b){if(_0x17329b){_0x35af9a=_0x17329b;_0x55ab8f[_0x3174('0x32')]=_[_0x3174('0x49')](db[_0x3174('0x5f')][_0x3174('0x30')]);_0x55ab8f['query']=_[_0x3174('0x49')](_0x378157[_0x3174('0x33')]);_0x55ab8f[_0x3174('0x34')]=_[_0x3174('0x35')](_0x55ab8f[_0x3174('0x32')],_0x55ab8f['query']);_0x2cc632[_0x3174('0x36')]=_['intersection'](_0x55ab8f[_0x3174('0x32')],qs['fields'](_0x378157[_0x3174('0x33')][_0x3174('0x37')]));_0x2cc632[_0x3174('0x36')]=_0x2cc632[_0x3174('0x36')]['length']?_0x2cc632['attributes']:_0x55ab8f[_0x3174('0x32')];_0x2cc632[_0x3174('0x3b')]=qs[_0x3174('0x3c')](_0x378157['query']['sort']);_0x2cc632['where']=qs['filters'](_[_0x3174('0x54')](_0x378157[_0x3174('0x33')],_0x55ab8f['filters']));if(_0x378157['query']['filter']){_0x2cc632[_0x3174('0x3d')]=_[_0x3174('0x41')](_0x2cc632[_0x3174('0x3d')],{'$or':_[_0x3174('0x2f')](_0x2cc632[_0x3174('0x36')],function(_0x541232){var _0x5e9cd2={};_0x5e9cd2[_0x541232]={'$like':'%'+_0x378157[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x5e9cd2;})});}_0x2cc632=_['merge']({},_0x2cc632,_0x378157[_0x3174('0x42')]);return _0x35af9a[_0x3174('0x5e')](_0x2cc632);}})[_0x3174('0x28')](function(_0x378727){if(_0x378727){_0x5751bb=_0x378727['length'];if(!_0x378157[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x2cc632[_0x3174('0x1f')]=qs['limit'](_0x378157['query']['limit']);_0x2cc632['offset']=qs[_0x3174('0x1e')](_0x378157[_0x3174('0x33')][_0x3174('0x1e')]);}return _0x35af9a[_0x3174('0x5e')](_0x2cc632);}})[_0x3174('0x28')](function(_0x4f06ba){if(_0x4f06ba){return _0x4f06ba?{'count':_0x5751bb,'rows':_0x4f06ba}:null;}})[_0x3174('0x28')](respondWithResult(_0x3174d3,null))[_0x3174('0x46')](handleError(_0x3174d3,null));};exports[_0x3174('0x60')]=function(_0x16a98d,_0x37ca25,_0x2c559f){var _0x49bc74=_0x16a98d[_0x3174('0x50')][_0x3174('0x61')];return db[_0x3174('0x5f')]['findAll']({'where':{'id':_0x49bc74},'attributes':['id'],'include':[{'model':db[_0x3174('0x57')],'as':'Agents','attributes':['id',_0x3174('0x2e'),'online',_0x3174('0x62'),_0x3174('0x63')],'raw':!![]}]})[_0x3174('0x28')](function(_0x2948d3){if(_0x2948d3){var _0x56b846=_['flatMap'](_0x2948d3,function(_0x2a1496){var _0x5ed3fc=_0x2a1496[_0x3174('0x2a')]({'plain':!![]});return _0x5ed3fc[_0x3174('0x64')];});return db['WhatsappQueue']['find']({'where':{'id':_0x16a98d[_0x3174('0x48')]['id']}})[_0x3174('0x28')](function(_0x1ff3c7){return db[_0x3174('0x65')][_0x3174('0x66')](function(_0x3158f0){return _0x1ff3c7[_0x3174('0x60')](_0x49bc74,{'transaction':_0x3158f0})[_0x3174('0x28')](function(){return BPromise[_0x3174('0x67')](_0x56b846,function(_0x5ce2ae){return db['UserWhatsappQueue'][_0x3174('0x68')]({'where':{'UserId':_0x5ce2ae['id'],'WhatsappQueueId':_0x16a98d[_0x3174('0x48')]['id']},'transaction':_0x3158f0});});})[_0x3174('0x28')](function(){_0x56b846['forEach'](function(_0x2ef45c){socket['emit']('userWhatsappQueue:save',{'UserId':_0x2ef45c['id'],'WhatsappQueueId':_0x1ff3c7['id']});});});});});}})[_0x3174('0x28')](respondWithStatusCode(_0x37ca25,null))[_0x3174('0x46')](handleError(_0x37ca25,null));};exports[_0x3174('0x69')]=function(_0x47c4be,_0x53976c,_0x20c98e){return db[_0x3174('0x5f')][_0x3174('0x56')]({'where':{'id':_0x47c4be[_0x3174('0x33')][_0x3174('0x61')]},'attributes':['id'],'include':[{'model':db[_0x3174('0x57')],'as':_0x3174('0x64'),'attributes':['id'],'raw':!![]}]})[_0x3174('0x28')](handleEntityNotFound(_0x53976c,null))[_0x3174('0x28')](function(_0x4302de){var _0x4158db=_[_0x3174('0x2f')](_0x4302de,'id');var _0x59e33f=[];var _0x37ca6a=[];var _0x490747=squel[_0x3174('0x6a')]();_0x490747[_0x3174('0x6b')](_0x3174('0x6c'))[_0x3174('0x6d')](_0x3174('0x6e'),'tq')[_0x3174('0x6f')](_0x3174('0x70'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3174('0x3d')](_0x3174('0x71'),_0x47c4be['params']['id']);for(var _0x5628aa=0x0;_0x5628aa<_0x4302de[_0x3174('0x38')];_0x5628aa+=0x1){let _0x11730c=_0x4302de[_0x5628aa];for(var _0x293545=0x0;_0x293545<_0x11730c[_0x3174('0x64')][_0x3174('0x38')];_0x293545+=0x1){let _0x3d581b=_0x11730c['Agents'][_0x293545];var _0x4e9860=_0x490747[_0x3174('0x72')]();_0x4e9860['where'](_0x3174('0x73'),_0x3d581b['id']);_0x37ca6a[_0x3174('0x74')](db[_0x3174('0x65')][_0x3174('0x33')](_0x4e9860[_0x3174('0x75')](),{'type':db[_0x3174('0x65')][_0x3174('0x76')][_0x3174('0x77')]})[_0x3174('0x28')](function(_0x9bf65){if(_0x9bf65['length']===0x1){return _0x3d581b['id'];}else{var _0xe5a58=_[_0x3174('0x78')](_[_0x3174('0x2f')](_0x9bf65,_0x3174('0x79')),function(_0x3a852f){return _['includes'](_0x4158db,_0x3a852f);});if(_0xe5a58){return _0x3d581b['id'];}}}));}}return BPromise['all'](_0x37ca6a)['then'](function(_0x2d77b8){_0x59e33f=_(_0x59e33f)['union'](_0x2d77b8)[_0x3174('0x7a')]()[_0x3174('0x7b')]();return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0x47c4be[_0x3174('0x48')]['id']}})[_0x3174('0x28')](function(_0x41b29f){return db[_0x3174('0x65')][_0x3174('0x66')](function(_0x29cafd){return _0x41b29f['removeTeams'](_0x47c4be[_0x3174('0x33')][_0x3174('0x61')],{'transaction':_0x29cafd})[_0x3174('0x28')](function(){if(!_['isEmpty'](_0x59e33f)){return _0x41b29f[_0x3174('0x7c')](_0x59e33f,{'transaction':_0x29cafd});}})[_0x3174('0x28')](function(){_0x59e33f[_0x3174('0x7d')](function(_0x34270f){socket[_0x3174('0x7e')](_0x3174('0x7f'),{'UserId':_0x34270f,'WhatsappQueueId':_0x41b29f['id']});});});});});});})[_0x3174('0x28')](respondWithStatusCode(_0x53976c,null))[_0x3174('0x46')](handleError(_0x53976c,null));};exports[_0x3174('0x80')]=function(_0x76f959,_0x42513b,_0x384665){return db[_0x3174('0x43')][_0x3174('0x4a')]({'where':{'id':_0x76f959[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x42513b,null))[_0x3174('0x28')](function(_0x594b70){if(_0x594b70){return _0x594b70[_0x3174('0x80')](_0x76f959[_0x3174('0x50')]['ids'],_['omit'](_0x76f959[_0x3174('0x50')],[_0x3174('0x61'),'id'])||{})[_0x3174('0x81')](function(_0x2cdb73){for(var _0x350402=0x0;_0x350402<_0x76f959['body'][_0x3174('0x61')]['length'];_0x350402+=0x1){socket[_0x3174('0x7e')]('userWhatsappQueue:save',{'UserId':Number(_0x76f959[_0x3174('0x50')][_0x3174('0x61')][_0x350402]),'WhatsappQueueId':Number(_0x76f959[_0x3174('0x48')]['id'])});}return _0x2cdb73;});}})[_0x3174('0x28')](respondWithResult(_0x42513b,null))[_0x3174('0x46')](handleError(_0x42513b,null));};exports[_0x3174('0x7c')]=function(_0x3b042d,_0x358eb4,_0x458087){return db[_0x3174('0x43')]['find']({'where':{'id':_0x3b042d[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x358eb4,null))[_0x3174('0x28')](function(_0x3bb73a){if(_0x3bb73a){return _0x3bb73a[_0x3174('0x7c')](_0x3b042d[_0x3174('0x33')]['ids'])[_0x3174('0x28')](function(){if(_[_0x3174('0x82')](_0x3b042d[_0x3174('0x33')][_0x3174('0x61')])){for(var _0x37f00f=0x0;_0x37f00f<_0x3b042d[_0x3174('0x33')][_0x3174('0x61')]['length'];_0x37f00f+=0x1){socket[_0x3174('0x7e')](_0x3174('0x7f'),{'UserId':Number(_0x3b042d[_0x3174('0x33')][_0x3174('0x61')][_0x37f00f]),'WhatsappQueueId':Number(_0x3b042d[_0x3174('0x48')]['id'])});}}else{socket[_0x3174('0x7e')](_0x3174('0x7f'),{'UserId':Number(_0x3b042d['query']['ids']),'WhatsappQueueId':Number(_0x3b042d[_0x3174('0x48')]['id'])});}});}})[_0x3174('0x28')](respondWithStatusCode(_0x358eb4,null))[_0x3174('0x46')](handleError(_0x358eb4,null));};exports[_0x3174('0x83')]=function(_0x3cdf83,_0x39112d,_0x19fd75){var _0x74d66f={};var _0x3bc522={};var _0x119e2b;var _0x53f774;return db[_0x3174('0x43')][_0x3174('0x52')]({'where':{'id':_0x3cdf83[_0x3174('0x48')]['id']}})[_0x3174('0x28')](handleEntityNotFound(_0x39112d,null))[_0x3174('0x28')](function(_0x112772){if(_0x112772){_0x119e2b=_0x112772;_0x3bc522[_0x3174('0x32')]=_[_0x3174('0x49')](db[_0x3174('0x57')][_0x3174('0x30')]);_0x3bc522[_0x3174('0x33')]=_[_0x3174('0x49')](_0x3cdf83['query']);_0x3bc522[_0x3174('0x34')]=_['intersection'](_0x3bc522[_0x3174('0x32')],_0x3bc522[_0x3174('0x33')]);_0x74d66f[_0x3174('0x36')]=_[_0x3174('0x35')](_0x3bc522['model'],qs[_0x3174('0x37')](_0x3cdf83['query']['fields']));_0x74d66f[_0x3174('0x36')]=_0x74d66f['attributes'][_0x3174('0x38')]?_0x74d66f['attributes']:_0x3bc522[_0x3174('0x32')];_0x74d66f[_0x3174('0x3b')]=qs['sort'](_0x3cdf83['query']['sort']);_0x74d66f[_0x3174('0x3d')]=qs[_0x3174('0x34')](_[_0x3174('0x54')](_0x3cdf83['query'],_0x3bc522[_0x3174('0x34')]));if(_0x3cdf83[_0x3174('0x33')][_0x3174('0x3e')]){_0x74d66f[_0x3174('0x3d')]=_['merge'](_0x74d66f[_0x3174('0x3d')],{'$or':_['map'](_0x74d66f['attributes'],function(_0x25396d){var _0x5b9414={};_0x5b9414[_0x25396d]={'$like':'%'+_0x3cdf83[_0x3174('0x33')][_0x3174('0x3e')]+'%'};return _0x5b9414;})});}_0x74d66f=_['merge']({},_0x74d66f,_0x3cdf83[_0x3174('0x42')]);return _0x119e2b[_0x3174('0x83')](_0x74d66f);}})['then'](function(_0x424091){if(_0x424091){_0x53f774=_0x424091[_0x3174('0x38')];if(!_0x3cdf83[_0x3174('0x33')][_0x3174('0x39')](_0x3174('0x3a'))){_0x74d66f[_0x3174('0x1f')]=qs['limit'](_0x3cdf83['query'][_0x3174('0x1f')]);_0x74d66f['offset']=qs['offset'](_0x3cdf83[_0x3174('0x33')][_0x3174('0x1e')]);}return _0x119e2b['getAgents'](_0x74d66f);}})['then'](function(_0x19c259){if(_0x19c259){return _0x19c259?{'count':_0x53f774,'rows':_0x19c259}:null;}})[_0x3174('0x28')](respondWithResult(_0x39112d,null))[_0x3174('0x46')](handleError(_0x39112d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index eb8bf26..8a3e8ce 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 _0xb44c=['hook','exports','events','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x89a5f2,_0x1c0cfb){var _0x526482=function(_0x607e9d){while(--_0x607e9d){_0x89a5f2['push'](_0x89a5f2['shift']());}};_0x526482(++_0x1c0cfb);}(_0xb44c,0xfe));var _0xcb44=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0xb44c[_0x2468b5];return _0x1056e4;};'use strict';var EventEmitter=require(_0xcb44('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xcb44('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xcb44('0x2')](0x0);var events={'afterCreate':_0xcb44('0x3'),'afterUpdate':_0xcb44('0x4'),'afterDestroy':_0xcb44('0x5')};function emitEvent(_0x4ab259){return function(_0x4ede30,_0x137004,_0x324c47){WhatsappQueueEvents[_0xcb44('0x6')](_0x4ab259+':'+_0x4ede30['id'],_0x4ede30);WhatsappQueueEvents[_0xcb44('0x6')](_0x4ab259,_0x4ede30);_0x324c47(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xcb44('0x7')](e,emitEvent(event));}}module[_0xcb44('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x6cea=['hasOwnProperty','exports','events','WhatsappQueue','save','update','remove','emit'];(function(_0x1fd675,_0x587658){var _0x521d1c=function(_0x2d16e0){while(--_0x2d16e0){_0x1fd675['push'](_0x1fd675['shift']());}};_0x521d1c(++_0x587658);}(_0x6cea,0xd2));var _0xa6ce=function(_0x4f5fc4,_0x1e4ba8){_0x4f5fc4=_0x4f5fc4-0x0;var _0x3f9b69=_0x6cea[_0x4f5fc4];return _0x3f9b69;};'use strict';var EventEmitter=require(_0xa6ce('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xa6ce('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6ce('0x2'),'afterUpdate':_0xa6ce('0x3'),'afterDestroy':_0xa6ce('0x4')};function emitEvent(_0x2555b7){return function(_0x288884,_0x3303e5,_0x4c47a9){WhatsappQueueEvents[_0xa6ce('0x5')](_0x2555b7+':'+_0x288884['id'],_0x288884);WhatsappQueueEvents[_0xa6ce('0x5')](_0x2555b7,_0x288884);_0x4c47a9(null);};}for(var e in events){if(events[_0xa6ce('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xa6ce('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 774f4aa..5938c09 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 _0x3531=['api','moment','path','rimraf','exports','define','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x3a5b97,_0x2da2ae){var _0x302862=function(_0x4c2daa){while(--_0x4c2daa){_0x3a5b97['push'](_0x3a5b97['shift']());}};_0x302862(++_0x2da2ae);}(_0x3531,0x13e));var _0x1353=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3531[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x1353('0x0'));var util=require(_0x1353('0x1'));var logger=require('../../config/logger')(_0x1353('0x2'));var moment=require(_0x1353('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1353('0x4'));var rimraf=require(_0x1353('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueue.attributes');module[_0x1353('0x6')]=function(_0x17fe45,_0x573df5){return _0x17fe45[_0x1353('0x7')](_0x1353('0x8'),attributes,{'tableName':_0x1353('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe492=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','WhatsappQueue','whatsapp_queues'];(function(_0x673826,_0x6c57d7){var _0x349887=function(_0x1f7da2){while(--_0x1f7da2){_0x673826['push'](_0x673826['shift']());}};_0x349887(++_0x6c57d7);}(_0xe492,0x79));var _0x2e49=function(_0x34a080,_0x25be48){_0x34a080=_0x34a080-0x0;var _0x145ce4=_0xe492[_0x34a080];return _0x145ce4;};'use strict';var _=require(_0x2e49('0x0'));var util=require(_0x2e49('0x1'));var logger=require(_0x2e49('0x2'))(_0x2e49('0x3'));var moment=require(_0x2e49('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e49('0x5'));var fs=require('fs');var path=require(_0x2e49('0x6'));var rimraf=require(_0x2e49('0x7'));var config=require(_0x2e49('0x8'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x5e9445,_0x1019d9){return _0x5e9445['define'](_0x2e49('0x9'),attributes,{'tableName':_0x2e49('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 f9c211c..3ca8aea 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 _0x6bfb=['localhost','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','find','where','ShowWhatsappQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','defaults','redis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6bfb,0xf8));var _0xb6bf=function(_0x8e77cc,_0x20b018){_0x8e77cc=_0x8e77cc-0x0;var _0x5aa13d=_0x6bfb[_0x8e77cc];return _0x5aa13d;};'use strict';var _=require(_0xb6bf('0x0'));var util=require(_0xb6bf('0x1'));var moment=require(_0xb6bf('0x2'));var BPromise=require(_0xb6bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6bf('0x4'));var db=require(_0xb6bf('0x5'))['db'];var utils=require(_0xb6bf('0x6'));var logger=require(_0xb6bf('0x7'))(_0xb6bf('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb6bf('0x9')](config[_0xb6bf('0xa')],{'host':_0xb6bf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6bf('0xa')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x197793,_0x27fa7f,_0x32d245){return new BPromise(function(_0x55b5d8,_0x32336a){return client[_0xb6bf('0xc')](_0x197793,_0x32d245)[_0xb6bf('0xd')](function(_0x17095d){logger[_0xb6bf('0xe')](_0xb6bf('0xf'),_0x27fa7f,_0xb6bf('0x10'));logger[_0xb6bf('0x11')](_0xb6bf('0x12'),_0x27fa7f,_0xb6bf('0x10'),JSON['stringify'](_0x17095d));if(_0x17095d[_0xb6bf('0x13')]){if(_0x17095d[_0xb6bf('0x13')]['code']===0x1f4){logger[_0xb6bf('0x13')](_0xb6bf('0xf'),_0x27fa7f,_0x17095d[_0xb6bf('0x13')][_0xb6bf('0x14')]);return _0x32336a(_0x17095d['error'][_0xb6bf('0x14')]);}logger[_0xb6bf('0x13')](_0xb6bf('0xf'),_0x27fa7f,_0x17095d[_0xb6bf('0x13')][_0xb6bf('0x14')]);return _0x55b5d8(_0x17095d[_0xb6bf('0x13')][_0xb6bf('0x14')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x27fa7f,_0xb6bf('0x10'));_0x55b5d8(_0x17095d[_0xb6bf('0x15')][_0xb6bf('0x14')]);}})[_0xb6bf('0x16')](function(_0x327937){logger[_0xb6bf('0x13')](_0xb6bf('0xf'),_0x27fa7f,_0x327937);_0x32336a(_0x327937);});});}exports[_0xb6bf('0x17')]=function(_0x56dbd2){var _0xa1b7ff=this;return new Promise(function(_0x2a3661,_0x278b49){return db[_0xb6bf('0x18')][_0xb6bf('0x19')]({'raw':_0x56dbd2[_0xb6bf('0x1a')]?_0x56dbd2[_0xb6bf('0x1a')][_0xb6bf('0x1b')]===undefined?!![]:![]:!![],'where':_0x56dbd2[_0xb6bf('0x1a')]?_0x56dbd2[_0xb6bf('0x1a')]['where']||null:null,'attributes':_0x56dbd2[_0xb6bf('0x1a')]?_0x56dbd2[_0xb6bf('0x1a')][_0xb6bf('0x1c')]||null:null,'limit':_0x56dbd2[_0xb6bf('0x1a')]?_0x56dbd2[_0xb6bf('0x1a')][_0xb6bf('0x1d')]||null:null,'include':_0x56dbd2[_0xb6bf('0x1a')]?_0x56dbd2[_0xb6bf('0x1a')][_0xb6bf('0x1e')]?_[_0xb6bf('0x1f')](_0x56dbd2['options'][_0xb6bf('0x1e')],function(_0xc85bec){return{'model':db[_0xc85bec['model']],'as':_0xc85bec['as'],'attributes':_0xc85bec[_0xb6bf('0x1c')],'include':_0xc85bec[_0xb6bf('0x1e')]?_[_0xb6bf('0x1f')](_0xc85bec[_0xb6bf('0x1e')],function(_0x540688){return{'model':db[_0x540688[_0xb6bf('0x20')]],'as':_0x540688['as'],'attributes':_0x540688[_0xb6bf('0x1c')],'include':_0x540688[_0xb6bf('0x1e')]?_[_0xb6bf('0x1f')](_0x540688['include'],function(_0x52b543){return{'model':db[_0x52b543[_0xb6bf('0x20')]],'as':_0x52b543['as'],'attributes':_0x52b543[_0xb6bf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb6bf('0xd')](function(_0x1bb048){logger[_0xb6bf('0xe')](_0xb6bf('0x17'),_0x56dbd2);logger[_0xb6bf('0x11')](_0xb6bf('0x17'),_0x56dbd2,JSON[_0xb6bf('0x21')](_0x1bb048));_0x2a3661(_0x1bb048);})['catch'](function(_0x2e77a0){logger['error'](_0xb6bf('0x17'),_0x2e77a0['message'],_0x56dbd2);_0x278b49(_0xa1b7ff['error'](0x1f4,_0x2e77a0['message']));});});};exports['ShowWhatsappQueue']=function(_0x3b1148){var _0x4c7715=this;return new Promise(function(_0x5474e9,_0x4c2dcc){return db['WhatsappQueue'][_0xb6bf('0x22')]({'raw':_0x3b1148[_0xb6bf('0x1a')]?_0x3b1148[_0xb6bf('0x1a')][_0xb6bf('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b1148[_0xb6bf('0x1a')]?_0x3b1148[_0xb6bf('0x1a')][_0xb6bf('0x23')]||null:null,'attributes':_0x3b1148[_0xb6bf('0x1a')]?_0x3b1148[_0xb6bf('0x1a')][_0xb6bf('0x1c')]||null:null,'include':_0x3b1148[_0xb6bf('0x1a')]?_0x3b1148[_0xb6bf('0x1a')][_0xb6bf('0x1e')]?_[_0xb6bf('0x1f')](_0x3b1148['options'][_0xb6bf('0x1e')],function(_0xe2335c){return{'model':db[_0xe2335c[_0xb6bf('0x20')]],'as':_0xe2335c['as'],'attributes':_0xe2335c['attributes'],'include':_0xe2335c[_0xb6bf('0x1e')]?_['map'](_0xe2335c[_0xb6bf('0x1e')],function(_0x2ab24f){return{'model':db[_0x2ab24f[_0xb6bf('0x20')]],'as':_0x2ab24f['as'],'attributes':_0x2ab24f[_0xb6bf('0x1c')],'include':_0x2ab24f[_0xb6bf('0x1e')]?_[_0xb6bf('0x1f')](_0x2ab24f[_0xb6bf('0x1e')],function(_0x2e6432){return{'model':db[_0x2e6432[_0xb6bf('0x20')]],'as':_0x2e6432['as'],'attributes':_0x2e6432[_0xb6bf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb6bf('0xd')](function(_0x51bc34){logger[_0xb6bf('0xe')](_0xb6bf('0x24'),_0x3b1148);logger[_0xb6bf('0x11')](_0xb6bf('0x24'),_0x3b1148,JSON[_0xb6bf('0x21')](_0x51bc34));_0x5474e9(_0x51bc34);})[_0xb6bf('0x16')](function(_0x11191d){logger[_0xb6bf('0x13')](_0xb6bf('0x24'),_0x11191d[_0xb6bf('0x14')],_0x3b1148);_0x4c2dcc(_0x4c7715[_0xb6bf('0x13')](0x1f4,_0x11191d[_0xb6bf('0x14')]));});});}; \ No newline at end of file +var _0xcbd8=['stringify','code','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43059a,_0x3cd630){var _0x104bb3=function(_0x2457c5){while(--_0x2457c5){_0x43059a['push'](_0x43059a['shift']());}};_0x104bb3(++_0x3cd630);}(_0xcbd8,0x1a3));var _0x8cbd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xcbd8[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x8cbd('0x0'));var util=require('util');var moment=require(_0x8cbd('0x1'));var BPromise=require(_0x8cbd('0x2'));var rs=require(_0x8cbd('0x3'));var fs=require('fs');var Redis=require(_0x8cbd('0x4'));var db=require(_0x8cbd('0x5'))['db'];var utils=require(_0x8cbd('0x6'));var logger=require(_0x8cbd('0x7'))(_0x8cbd('0x8'));var config=require('../../config/environment');var jayson=require(_0x8cbd('0x9'));var client=jayson['client'][_0x8cbd('0xa')]({'port':0x232a});config[_0x8cbd('0xb')]=_[_0x8cbd('0xc')](config[_0x8cbd('0xb')],{'host':_0x8cbd('0xd'),'port':0x18eb});var socket=require(_0x8cbd('0xe'))(new Redis(config[_0x8cbd('0xb')]));require('./whatsappQueue.socket')[_0x8cbd('0xf')](socket);function respondWithRpcPromise(_0x26b01c,_0x282fd3,_0x191252){return new BPromise(function(_0x8f8838,_0x40b205){return client['request'](_0x26b01c,_0x191252)[_0x8cbd('0x10')](function(_0x58f4c4){logger[_0x8cbd('0x11')](_0x8cbd('0x12'),_0x282fd3,_0x8cbd('0x13'));logger[_0x8cbd('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x282fd3,_0x8cbd('0x13'),JSON[_0x8cbd('0x15')](_0x58f4c4));if(_0x58f4c4['error']){if(_0x58f4c4['error'][_0x8cbd('0x16')]===0x1f4){logger['error'](_0x8cbd('0x12'),_0x282fd3,_0x58f4c4[_0x8cbd('0x17')][_0x8cbd('0x18')]);return _0x40b205(_0x58f4c4[_0x8cbd('0x17')][_0x8cbd('0x18')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x282fd3,_0x58f4c4[_0x8cbd('0x17')]['message']);return _0x8f8838(_0x58f4c4[_0x8cbd('0x17')][_0x8cbd('0x18')]);}else{logger[_0x8cbd('0x11')](_0x8cbd('0x12'),_0x282fd3,_0x8cbd('0x13'));_0x8f8838(_0x58f4c4[_0x8cbd('0x19')][_0x8cbd('0x18')]);}})[_0x8cbd('0x1a')](function(_0xfaf163){logger[_0x8cbd('0x17')](_0x8cbd('0x12'),_0x282fd3,_0xfaf163);_0x40b205(_0xfaf163);});});}exports['GetWhatsappQueue']=function(_0xbc918f){var _0x5d1c0=this;return new Promise(function(_0x299f4d,_0x1d158c){return db['WhatsappQueue'][_0x8cbd('0x1b')]({'raw':_0xbc918f['options']?_0xbc918f[_0x8cbd('0x1c')][_0x8cbd('0x1d')]===undefined?!![]:![]:!![],'where':_0xbc918f[_0x8cbd('0x1c')]?_0xbc918f['options'][_0x8cbd('0x1e')]||null:null,'attributes':_0xbc918f['options']?_0xbc918f['options'][_0x8cbd('0x1f')]||null:null,'limit':_0xbc918f[_0x8cbd('0x1c')]?_0xbc918f[_0x8cbd('0x1c')][_0x8cbd('0x20')]||null:null,'include':_0xbc918f['options']?_0xbc918f[_0x8cbd('0x1c')][_0x8cbd('0x21')]?_['map'](_0xbc918f['options'][_0x8cbd('0x21')],function(_0x523b48){return{'model':db[_0x523b48[_0x8cbd('0x22')]],'as':_0x523b48['as'],'attributes':_0x523b48[_0x8cbd('0x1f')],'include':_0x523b48[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x523b48[_0x8cbd('0x21')],function(_0x337e39){return{'model':db[_0x337e39['model']],'as':_0x337e39['as'],'attributes':_0x337e39[_0x8cbd('0x1f')],'include':_0x337e39[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x337e39['include'],function(_0x1d20b5){return{'model':db[_0x1d20b5['model']],'as':_0x1d20b5['as'],'attributes':_0x1d20b5['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cbd('0x10')](function(_0x2fe78f){logger['info'](_0x8cbd('0x24'),_0xbc918f);logger[_0x8cbd('0x14')]('GetWhatsappQueue',_0xbc918f,JSON[_0x8cbd('0x15')](_0x2fe78f));_0x299f4d(_0x2fe78f);})[_0x8cbd('0x1a')](function(_0x4620fc){logger[_0x8cbd('0x17')](_0x8cbd('0x24'),_0x4620fc[_0x8cbd('0x18')],_0xbc918f);_0x1d158c(_0x5d1c0['error'](0x1f4,_0x4620fc[_0x8cbd('0x18')]));});});};exports[_0x8cbd('0x25')]=function(_0x229fcc){var _0x2f8df1=this;return new Promise(function(_0x2e3281,_0x13b55f){return db[_0x8cbd('0x26')][_0x8cbd('0x27')]({'raw':_0x229fcc[_0x8cbd('0x1c')]?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x1d')]===undefined?!![]:![]:!![],'where':_0x229fcc['options']?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x1e')]||null:null,'attributes':_0x229fcc[_0x8cbd('0x1c')]?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x1f')]||null:null,'include':_0x229fcc[_0x8cbd('0x1c')]?_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x21')]?_['map'](_0x229fcc[_0x8cbd('0x1c')][_0x8cbd('0x21')],function(_0x1fad9d){return{'model':db[_0x1fad9d['model']],'as':_0x1fad9d['as'],'attributes':_0x1fad9d[_0x8cbd('0x1f')],'include':_0x1fad9d[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x1fad9d[_0x8cbd('0x21')],function(_0x2544cc){return{'model':db[_0x2544cc['model']],'as':_0x2544cc['as'],'attributes':_0x2544cc['attributes'],'include':_0x2544cc[_0x8cbd('0x21')]?_[_0x8cbd('0x23')](_0x2544cc[_0x8cbd('0x21')],function(_0x451f1f){return{'model':db[_0x451f1f[_0x8cbd('0x22')]],'as':_0x451f1f['as'],'attributes':_0x451f1f[_0x8cbd('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcd71bf){logger[_0x8cbd('0x11')]('ShowWhatsappQueue',_0x229fcc);logger[_0x8cbd('0x14')](_0x8cbd('0x25'),_0x229fcc,JSON[_0x8cbd('0x15')](_0xcd71bf));_0x2e3281(_0xcd71bf);})[_0x8cbd('0x1a')](function(_0x3c1a08){logger[_0x8cbd('0x17')](_0x8cbd('0x25'),_0x3c1a08['message'],_0x229fcc);_0x13b55f(_0x2f8df1['error'](0x1f4,_0x3c1a08[_0x8cbd('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 63281f1..3e7694e 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 _0x744c=['whatsappQueue:','update','emit','removeListener'];(function(_0x214b22,_0x2210dd){var _0x2c8c2e=function(_0x1adfca){while(--_0x1adfca){_0x214b22['push'](_0x214b22['shift']());}};_0x2c8c2e(++_0x2210dd);}(_0x744c,0xe1));var _0xc744=function(_0x58da9c,_0x109e4c){_0x58da9c=_0x58da9c-0x0;var _0x3916c7=_0x744c[_0x58da9c];return _0x3916c7;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save','remove',_0xc744('0x0')];function createListener(_0x5a71bc,_0x5e3d7a){return function(_0x4283c5){_0x5e3d7a[_0xc744('0x1')](_0x5a71bc,_0x4283c5);};}function removeListener(_0x5255e1,_0x499eb1){return function(){WhatsappQueueEvents[_0xc744('0x2')](_0x5255e1,_0x499eb1);};}exports['register']=function(_0xf4bd72){for(var _0xea85b3=0x0,_0x149dda=events['length'];_0xea85b3<_0x149dda;_0xea85b3++){var _0x26a312=events[_0xea85b3];var _0x222fae=createListener(_0xc744('0x3')+_0x26a312,_0xf4bd72);WhatsappQueueEvents['on'](_0x26a312,_0x222fae);}}; \ No newline at end of file +var _0x1a7c=['removeListener','length','whatsappQueue:','./whatsappQueue.events','save','remove','update'];(function(_0xd1f310,_0x57aabb){var _0x66d97f=function(_0x44cb32){while(--_0x44cb32){_0xd1f310['push'](_0xd1f310['shift']());}};_0x66d97f(++_0x57aabb);}(_0x1a7c,0xf1));var _0xc1a7=function(_0x3d07f2,_0x19854d){_0x3d07f2=_0x3d07f2-0x0;var _0x26052a=_0x1a7c[_0x3d07f2];return _0x26052a;};'use strict';var WhatsappQueueEvents=require(_0xc1a7('0x0'));var events=[_0xc1a7('0x1'),_0xc1a7('0x2'),_0xc1a7('0x3')];function createListener(_0x1a1ffd,_0x4ada5b){return function(_0x19e960){_0x4ada5b['emit'](_0x1a1ffd,_0x19e960);};}function removeListener(_0x3788e7,_0x5eea52){return function(){WhatsappQueueEvents[_0xc1a7('0x4')](_0x3788e7,_0x5eea52);};}exports['register']=function(_0x3fcd25){for(var _0x558480=0x0,_0x1a8ba0=events[_0xc1a7('0x5')];_0x558480<_0x1a8ba0;_0x558480++){var _0x55dce7=events[_0x558480];var _0x5a24da=createListener(_0xc1a7('0x6')+_0x55dce7,_0x3fcd25);WhatsappQueueEvents['on'](_0x55dce7,_0x5a24da);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 371ed7b..62bfcd0 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 _0x5c00=['./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5aa3f3,_0xcd64ae){var _0x1bc46d=function(_0xc1bd42){while(--_0xc1bd42){_0x5aa3f3['push'](_0x5aa3f3['shift']());}};_0x1bc46d(++_0xcd64ae);}(_0x5c00,0xea));var _0x05c0=function(_0x5e3191,_0x47fe85){_0x5e3191=_0x5e3191-0x0;var _0xc8d5e6=_0x5c00[_0x5e3191];return _0xc8d5e6;};'use strict';var multer=require('multer');var util=require(_0x05c0('0x0'));var path=require(_0x05c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x2'));var router=express['Router']();var fs_extra=require(_0x05c0('0x3'));var auth=require(_0x05c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05c0('0x5'));var controller=require(_0x05c0('0x6'));router['get']('/',auth[_0x05c0('0x7')](),controller[_0x05c0('0x8')]);router[_0x05c0('0x9')](_0x05c0('0xa'),auth[_0x05c0('0x7')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x9')](_0x05c0('0xc'),auth[_0x05c0('0x7')](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xf')]);router[_0x05c0('0x10')](_0x05c0('0xc'),auth[_0x05c0('0x7')](),controller[_0x05c0('0x11')]);router[_0x05c0('0x12')](_0x05c0('0xc'),auth[_0x05c0('0x7')](),controller[_0x05c0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x26ad=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','put','update','destroy'];(function(_0x4cd2d7,_0x18ae02){var _0x1d4fd2=function(_0x516a51){while(--_0x516a51){_0x4cd2d7['push'](_0x4cd2d7['shift']());}};_0x1d4fd2(++_0x18ae02);}(_0x26ad,0xb1));var _0xd26a=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x26ad[_0xbeb808];return _0x5d6909;};'use strict';var multer=require(_0xd26a('0x0'));var util=require('util');var path=require(_0xd26a('0x1'));var timeout=require(_0xd26a('0x2'));var express=require('express');var router=express[_0xd26a('0x3')]();var fs_extra=require(_0xd26a('0x4'));var auth=require(_0xd26a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd26a('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xd26a('0x7')]('/',auth[_0xd26a('0x8')](),controller['index']);router[_0xd26a('0x7')]('/describe',auth[_0xd26a('0x8')](),controller[_0xd26a('0x9')]);router[_0xd26a('0x7')](_0xd26a('0xa'),auth[_0xd26a('0x8')](),controller[_0xd26a('0xb')]);router['post']('/',auth[_0xd26a('0x8')](),controller['create']);router[_0xd26a('0xc')]('/:id',auth[_0xd26a('0x8')](),controller[_0xd26a('0xd')]);router['delete'](_0xd26a('0xa'),auth[_0xd26a('0x8')](),controller[_0xd26a('0xe')]);module[_0xd26a('0xf')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 0658c9f..c4d4c29 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x38875d,_0x292236){var _0x2351f4=function(_0x27bebe){while(--_0x27bebe){_0x38875d['push'](_0x38875d['shift']());}};_0x2351f4(++_0x292236);}(_0x7a54,0x106));var _0x47a5=function(_0x1670a7,_0xbbfdc7){_0x1670a7=_0x1670a7-0x0;var _0x4c19cb=_0x7a54[_0x1670a7];return _0x4c19cb;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5399cd,_0x2d7c5f){var _0x47a409=function(_0x488808){while(--_0x488808){_0x5399cd['push'](_0x5399cd['shift']());}};_0x47a409(++_0x2d7c5f);}(_0x7a54,0x106));var _0x47a5=function(_0x3b992f,_0x39f461){_0x3b992f=_0x3b992f-0x0;var _0x53c8f1=_0x7a54[_0x3b992f];return _0x53c8f1;};'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 7cb0913..83f80f2 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 _0x3c81=['apply','reject','save','update','then','destroy','end','error','name','send','map','WhatsappQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','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','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x50b3e9,_0x4e5f30){var _0x537540=function(_0x14f1ce){while(--_0x14f1ce){_0x50b3e9['push'](_0x50b3e9['shift']());}};_0x537540(++_0x4e5f30);}(_0x3c81,0x102));var _0x13c8=function(_0xf27b7f,_0x40d944){_0xf27b7f=_0xf27b7f-0x0;var _0x40abca=_0x3c81[_0xf27b7f];return _0x40abca;};'use strict';var emlformat=require(_0x13c8('0x0'));var rimraf=require(_0x13c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13c8('0x2'));var rp=require(_0x13c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x13c8('0x4'));var sox=require(_0x13c8('0x5'));var csv=require(_0x13c8('0x6'));var ejs=require(_0x13c8('0x7'));var fs=require('fs');var fs_extra=require(_0x13c8('0x8'));var _=require(_0x13c8('0x9'));var squel=require(_0x13c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x13c8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x13c8('0x6'));var querystring=require(_0x13c8('0xc'));var Papa=require(_0x13c8('0xd'));var Redis=require(_0x13c8('0xe'));var authService=require(_0x13c8('0xf'));var qs=require(_0x13c8('0x10'));var as=require(_0x13c8('0x11'));var hardwareService=require(_0x13c8('0x12'));var logger=require(_0x13c8('0x13'))(_0x13c8('0x14'));var utils=require(_0x13c8('0x15'));var config=require(_0x13c8('0x16'));var licenseUtil=require(_0x13c8('0x17'));var db=require(_0x13c8('0x18'))['db'];function respondWithStatusCode(_0x5ab91d,_0x21442d){_0x21442d=_0x21442d||0xcc;return function(_0x7b6da8){if(_0x7b6da8){return _0x5ab91d[_0x13c8('0x19')](_0x21442d);}return _0x5ab91d[_0x13c8('0x1a')](_0x21442d)['end']();};}function respondWithResult(_0x42955d,_0x515681){_0x515681=_0x515681||0xc8;return function(_0x4d7a88){if(_0x4d7a88){return _0x42955d['status'](_0x515681)[_0x13c8('0x1b')](_0x4d7a88);}};}function respondWithFilteredResult(_0x5e0e06,_0x337397){return function(_0x17a3c1){if(_0x17a3c1){var _0x23f64e=typeof _0x337397[_0x13c8('0x1c')]==='undefined'&&typeof _0x337397[_0x13c8('0x1d')]===_0x13c8('0x1e');var _0x31ae02=_0x17a3c1[_0x13c8('0x1f')];var _0xce1ad2=_0x23f64e?0x0:_0x337397[_0x13c8('0x1c')];var _0x346417=_0x23f64e?_0x17a3c1[_0x13c8('0x1f')]:_0x337397[_0x13c8('0x1c')]+_0x337397[_0x13c8('0x1d')];var _0xe9386a;if(_0x346417>=_0x31ae02){_0x346417=_0x31ae02;_0xe9386a=0xc8;}else{_0xe9386a=0xce;}_0x5e0e06['status'](_0xe9386a);return _0x5e0e06[_0x13c8('0x20')](_0x13c8('0x21'),_0xce1ad2+'-'+_0x346417+'/'+_0x31ae02)[_0x13c8('0x1b')](_0x17a3c1);}return null;};}function patchUpdates(_0x313ea3){return function(_0x513085){try{jsonpatch[_0x13c8('0x22')](_0x513085,_0x313ea3,!![]);}catch(_0x3c4603){return BPromise[_0x13c8('0x23')](_0x3c4603);}return _0x513085[_0x13c8('0x24')]();};}function saveUpdates(_0x436d5d,_0x2fc123){return function(_0x5ab47f){if(_0x5ab47f){return _0x5ab47f[_0x13c8('0x25')](_0x436d5d)[_0x13c8('0x26')](function(_0x315d6c){return _0x315d6c;});}return null;};}function removeEntity(_0xcf41d2,_0x577df6){return function(_0x1770e5){if(_0x1770e5){return _0x1770e5[_0x13c8('0x27')]()['then'](function(){_0xcf41d2['status'](0xcc)[_0x13c8('0x28')]();});}};}function handleEntityNotFound(_0x4aff35,_0x47e8ae){return function(_0x5ad0dc){if(!_0x5ad0dc){_0x4aff35[_0x13c8('0x19')](0x194);}return _0x5ad0dc;};}function handleError(_0xc7f1b6,_0x53ada9){_0x53ada9=_0x53ada9||0x1f4;return function(_0x4df077){logger[_0x13c8('0x29')](_0x4df077['stack']);if(_0x4df077['name']){delete _0x4df077[_0x13c8('0x2a')];}_0xc7f1b6[_0x13c8('0x1a')](_0x53ada9)[_0x13c8('0x2b')](_0x4df077);};}exports['index']=function(_0x5ef2f7,_0x277a89){var _0x1071a0={},_0x399840={},_0x441182={'count':0x0,'rows':[]};var _0x138017=_[_0x13c8('0x2c')](db[_0x13c8('0x2d')]['rawAttributes'],function(_0x109cb8){return{'name':_0x109cb8[_0x13c8('0x2e')],'type':_0x109cb8['type']['key']};});_0x399840[_0x13c8('0x2f')]=_[_0x13c8('0x2c')](_0x138017,'name');_0x399840[_0x13c8('0x30')]=_[_0x13c8('0x31')](_0x5ef2f7['query']);_0x399840[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],_0x399840[_0x13c8('0x30')]);_0x1071a0[_0x13c8('0x34')]=_[_0x13c8('0x33')](_0x399840[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x5ef2f7['query']['fields']));_0x1071a0[_0x13c8('0x34')]=_0x1071a0[_0x13c8('0x34')]['length']?_0x1071a0[_0x13c8('0x34')]:_0x399840['model'];if(!_0x5ef2f7[_0x13c8('0x30')]['hasOwnProperty'](_0x13c8('0x36'))){_0x1071a0[_0x13c8('0x1d')]=qs[_0x13c8('0x1d')](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x1d')]);_0x1071a0[_0x13c8('0x1c')]=qs[_0x13c8('0x1c')](_0x5ef2f7['query'][_0x13c8('0x1c')]);}_0x1071a0[_0x13c8('0x37')]=qs['sort'](_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x38')]);_0x1071a0[_0x13c8('0x39')]=qs['filters'](_['pick'](_0x5ef2f7['query'],_0x399840[_0x13c8('0x32')]),_0x138017);if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]){_0x1071a0[_0x13c8('0x39')]=_[_0x13c8('0x3b')](_0x1071a0[_0x13c8('0x39')],{'$or':_[_0x13c8('0x2c')](_0x138017,function(_0xe19858){if(_0xe19858[_0x13c8('0x3c')]!=='VIRTUAL'){var _0x5b2a28={};_0x5b2a28[_0xe19858[_0x13c8('0x2a')]]={'$like':'%'+_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3a')]+'%'};return _0x5b2a28;}})});}_0x1071a0=_[_0x13c8('0x3b')]({},_0x1071a0,_0x5ef2f7['options']);var _0x35e1e7={'where':_0x1071a0['where']};return db[_0x13c8('0x2d')][_0x13c8('0x1f')](_0x35e1e7)[_0x13c8('0x26')](function(_0x1cd02c){_0x441182[_0x13c8('0x1f')]=_0x1cd02c;if(_0x5ef2f7[_0x13c8('0x30')][_0x13c8('0x3d')]){_0x1071a0[_0x13c8('0x3e')]=[{'all':!![]}];}return db[_0x13c8('0x2d')][_0x13c8('0x3f')](_0x1071a0);})[_0x13c8('0x26')](function(_0x416169){_0x441182[_0x13c8('0x40')]=_0x416169;return _0x441182;})[_0x13c8('0x26')](respondWithFilteredResult(_0x277a89,_0x1071a0))[_0x13c8('0x41')](handleError(_0x277a89,null));};exports[_0x13c8('0x42')]=function(_0x1b2ada,_0x1505fb){var _0xc5eb86={'raw':!![],'where':{'id':_0x1b2ada[_0x13c8('0x43')]['id']}},_0x1cff99={};_0x1cff99[_0x13c8('0x2f')]=_[_0x13c8('0x31')](db[_0x13c8('0x2d')][_0x13c8('0x44')]);_0x1cff99['query']=_[_0x13c8('0x31')](_0x1b2ada[_0x13c8('0x30')]);_0x1cff99[_0x13c8('0x32')]=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],_0x1cff99['query']);_0xc5eb86['attributes']=_[_0x13c8('0x33')](_0x1cff99[_0x13c8('0x2f')],qs[_0x13c8('0x35')](_0x1b2ada['query']['fields']));_0xc5eb86['attributes']=_0xc5eb86[_0x13c8('0x34')]['length']?_0xc5eb86[_0x13c8('0x34')]:_0x1cff99['model'];if(_0x1b2ada[_0x13c8('0x30')][_0x13c8('0x3d')]){_0xc5eb86[_0x13c8('0x3e')]=[{'all':!![]}];}_0xc5eb86=_[_0x13c8('0x3b')]({},_0xc5eb86,_0x1b2ada[_0x13c8('0x45')]);return db[_0x13c8('0x2d')]['find'](_0xc5eb86)[_0x13c8('0x26')](handleEntityNotFound(_0x1505fb,null))[_0x13c8('0x26')](respondWithResult(_0x1505fb,null))['catch'](handleError(_0x1505fb,null));};exports[_0x13c8('0x46')]=function(_0x26155d,_0x2e925f){return db[_0x13c8('0x2d')][_0x13c8('0x46')](_0x26155d['body'],{})[_0x13c8('0x26')](respondWithResult(_0x2e925f,0xc9))[_0x13c8('0x41')](handleError(_0x2e925f,null));};exports[_0x13c8('0x25')]=function(_0x38418b,_0x185d18){if(_0x38418b['body']['id']){delete _0x38418b[_0x13c8('0x47')]['id'];}return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x38418b[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x185d18,null))[_0x13c8('0x26')](saveUpdates(_0x38418b[_0x13c8('0x47')],null))[_0x13c8('0x26')](respondWithResult(_0x185d18,null))[_0x13c8('0x41')](handleError(_0x185d18,null));};exports[_0x13c8('0x27')]=function(_0x266f4e,_0x5e1fe5){return db[_0x13c8('0x2d')][_0x13c8('0x48')]({'where':{'id':_0x266f4e[_0x13c8('0x43')]['id']}})[_0x13c8('0x26')](handleEntityNotFound(_0x5e1fe5,null))[_0x13c8('0x26')](removeEntity(_0x5e1fe5,null))[_0x13c8('0x41')](handleError(_0x5e1fe5,null));};exports['describe']=function(_0x341fd3,_0x416e4f){return db[_0x13c8('0x2d')]['describe']()['then'](respondWithResult(_0x416e4f,null))[_0x13c8('0x41')](handleError(_0x416e4f,null));}; \ No newline at end of file +var _0x6f7a=['squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','sendStatus','error','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','then','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x16666f,_0x214298){var _0x24593f=function(_0x345eee){while(--_0x345eee){_0x16666f['push'](_0x16666f['shift']());}};_0x24593f(++_0x214298);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x40f21f,_0x51ded7){_0x40f21f=_0x40f21f-0x0;var _0x1cd9c9=_0x6f7a[_0x40f21f];return _0x1cd9c9;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ef97,_0x402d25){return function(_0x5efdce){if(!_0x5efdce){_0x47ef97[_0xa6f7('0x23')](0x194);}return _0x5efdce;};}function handleError(_0x126d24,_0x3c79ea){_0x3c79ea=_0x3c79ea||0x1f4;return function(_0x2b4c6c){logger[_0xa6f7('0x24')](_0x2b4c6c['stack']);if(_0x2b4c6c['name']){delete _0x2b4c6c[_0xa6f7('0x25')];}_0x126d24[_0xa6f7('0x19')](_0x3c79ea)['send'](_0x2b4c6c);};}exports[_0xa6f7('0x26')]=function(_0x27babb,_0x87bccc){var _0x3a7ff9={},_0x224f5a={},_0x10bf77={'count':0x0,'rows':[]};var _0x353de8=_[_0xa6f7('0x27')](db[_0xa6f7('0x28')][_0xa6f7('0x29')],function(_0x40b0f8){return{'name':_0x40b0f8[_0xa6f7('0x2a')],'type':_0x40b0f8['type'][_0xa6f7('0x2b')]};});_0x224f5a[_0xa6f7('0x2c')]=_['map'](_0x353de8,_0xa6f7('0x25'));_0x224f5a[_0xa6f7('0x2d')]=_['keys'](_0x27babb['query']);_0x224f5a[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x224f5a[_0xa6f7('0x2c')],_0x224f5a[_0xa6f7('0x2d')]);_0x3a7ff9[_0xa6f7('0x30')]=_['intersection'](_0x224f5a['model'],qs[_0xa6f7('0x31')](_0x27babb['query'][_0xa6f7('0x31')]));_0x3a7ff9[_0xa6f7('0x30')]=_0x3a7ff9[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x3a7ff9[_0xa6f7('0x30')]:_0x224f5a[_0xa6f7('0x2c')];if(!_0x27babb['query'][_0xa6f7('0x33')](_0xa6f7('0x34'))){_0x3a7ff9[_0xa6f7('0x1d')]=qs['limit'](_0x27babb[_0xa6f7('0x2d')]['limit']);_0x3a7ff9[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x27babb[_0xa6f7('0x2d')]['offset']);}_0x3a7ff9[_0xa6f7('0x35')]=qs[_0xa6f7('0x36')](_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x36')]);_0x3a7ff9[_0xa6f7('0x37')]=qs[_0xa6f7('0x2e')](_['pick'](_0x27babb[_0xa6f7('0x2d')],_0x224f5a[_0xa6f7('0x2e')]),_0x353de8);if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]){_0x3a7ff9[_0xa6f7('0x37')]=_[_0xa6f7('0x39')](_0x3a7ff9[_0xa6f7('0x37')],{'$or':_[_0xa6f7('0x27')](_0x353de8,function(_0x4c2d2e){if(_0x4c2d2e[_0xa6f7('0x3a')]!==_0xa6f7('0x3b')){var _0x353e54={};_0x353e54[_0x4c2d2e['name']]={'$like':'%'+_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x38')]+'%'};return _0x353e54;}})});}_0x3a7ff9=_['merge']({},_0x3a7ff9,_0x27babb[_0xa6f7('0x3c')]);var _0x13c7c4={'where':_0x3a7ff9[_0xa6f7('0x37')]};return db[_0xa6f7('0x28')][_0xa6f7('0x1f')](_0x13c7c4)['then'](function(_0x2e3eb2){_0x10bf77[_0xa6f7('0x1f')]=_0x2e3eb2;if(_0x27babb[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x3a7ff9[_0xa6f7('0x3e')]=[{'all':!![]}];}return db[_0xa6f7('0x28')][_0xa6f7('0x3f')](_0x3a7ff9);})[_0xa6f7('0x40')](function(_0x5646b9){_0x10bf77['rows']=_0x5646b9;return _0x10bf77;})[_0xa6f7('0x40')](respondWithFilteredResult(_0x87bccc,_0x3a7ff9))[_0xa6f7('0x41')](handleError(_0x87bccc,null));};exports[_0xa6f7('0x42')]=function(_0x2546a3,_0x2ac07f){var _0x387714={'raw':!![],'where':{'id':_0x2546a3[_0xa6f7('0x43')]['id']}},_0x21fdd7={};_0x21fdd7[_0xa6f7('0x2c')]=_[_0xa6f7('0x44')](db['WhatsappQueueReport'][_0xa6f7('0x29')]);_0x21fdd7[_0xa6f7('0x2d')]=_['keys'](_0x2546a3[_0xa6f7('0x2d')]);_0x21fdd7[_0xa6f7('0x2e')]=_[_0xa6f7('0x2f')](_0x21fdd7[_0xa6f7('0x2c')],_0x21fdd7['query']);_0x387714[_0xa6f7('0x30')]=_['intersection'](_0x21fdd7['model'],qs[_0xa6f7('0x31')](_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x31')]));_0x387714[_0xa6f7('0x30')]=_0x387714[_0xa6f7('0x30')][_0xa6f7('0x32')]?_0x387714[_0xa6f7('0x30')]:_0x21fdd7['model'];if(_0x2546a3[_0xa6f7('0x2d')][_0xa6f7('0x3d')]){_0x387714['include']=[{'all':!![]}];}_0x387714=_[_0xa6f7('0x39')]({},_0x387714,_0x2546a3[_0xa6f7('0x3c')]);return db[_0xa6f7('0x28')]['find'](_0x387714)[_0xa6f7('0x40')](handleEntityNotFound(_0x2ac07f,null))['then'](respondWithResult(_0x2ac07f,null))[_0xa6f7('0x41')](handleError(_0x2ac07f,null));};exports[_0xa6f7('0x45')]=function(_0x260e77,_0x5f3c84){return db['WhatsappQueueReport'][_0xa6f7('0x45')](_0x260e77['body'],{})[_0xa6f7('0x40')](respondWithResult(_0x5f3c84,0xc9))['catch'](handleError(_0x5f3c84,null));};exports['update']=function(_0x1e7089,_0x2e3a04){if(_0x1e7089[_0xa6f7('0x46')]['id']){delete _0x1e7089[_0xa6f7('0x46')]['id'];}return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x1e7089['params']['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x2e3a04,null))[_0xa6f7('0x40')](saveUpdates(_0x1e7089['body'],null))[_0xa6f7('0x40')](respondWithResult(_0x2e3a04,null))['catch'](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x48')]=function(_0x59091a,_0x488efc){return db[_0xa6f7('0x28')][_0xa6f7('0x47')]({'where':{'id':_0x59091a[_0xa6f7('0x43')]['id']}})[_0xa6f7('0x40')](handleEntityNotFound(_0x488efc,null))[_0xa6f7('0x40')](removeEntity(_0x488efc,null))['catch'](handleError(_0x488efc,null));};exports[_0xa6f7('0x49')]=function(_0x34de29,_0x5cddc9){return db[_0xa6f7('0x28')]['describe']()[_0xa6f7('0x40')](respondWithResult(_0x5cddc9,null))[_0xa6f7('0x41')](handleError(_0x5cddc9,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 6e17b9c..e7eb4ee 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 _0x7071=['moment','bluebird','path','define','WhatsappQueueReport','uniqueid','lodash','../../config/logger','api'];(function(_0x4751d6,_0x2911a1){var _0x55e2c3=function(_0x420a54){while(--_0x420a54){_0x4751d6['push'](_0x4751d6['shift']());}};_0x55e2c3(++_0x2911a1);}(_0x7071,0x15c));var _0x1707=function(_0x30b60f,_0x3d2d8b){_0x30b60f=_0x30b60f-0x0;var _0x4dab91=_0x7071[_0x30b60f];return _0x4dab91;};'use strict';var _=require(_0x1707('0x0'));var util=require('util');var logger=require(_0x1707('0x1'))(_0x1707('0x2'));var moment=require(_0x1707('0x3'));var BPromise=require(_0x1707('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1707('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x17df95,_0x1ee4af){return _0x17df95[_0x1707('0x6')](_0x1707('0x7'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x1707('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1840=['exports','define','WhatsappQueueReport','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x200fc0,_0x4338c6){var _0x212f16=function(_0x375490){while(--_0x375490){_0x200fc0['push'](_0x200fc0['shift']());}};_0x212f16(++_0x4338c6);}(_0x1840,0x12f));var _0x0184=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x1840[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x0184('0x0'));var util=require(_0x0184('0x1'));var logger=require('../../config/logger')(_0x0184('0x2'));var moment=require(_0x0184('0x3'));var BPromise=require('bluebird');var rp=require(_0x0184('0x4'));var fs=require('fs');var path=require(_0x0184('0x5'));var rimraf=require(_0x0184('0x6'));var config=require(_0x0184('0x7'));var attributes=require(_0x0184('0x8'));module[_0x0184('0x9')]=function(_0x1a349f,_0x1ab798){return _0x1a349f[_0x0184('0xa')](_0x0184('0xb'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x0184('0xc'),'fields':[_0x0184('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 29846a3..70a3c37 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 _0x47e6=['result','catch','CreateWhatsappQueueReport','options','raw','UpdateWhatsappQueueReport','update','body','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47e6,0xf9));var _0x647e=function(_0x3efc85,_0x1e6cd1){_0x3efc85=_0x3efc85-0x0;var _0x4ac99b=_0x47e6[_0x3efc85];return _0x4ac99b;};'use strict';var _=require(_0x647e('0x0'));var util=require(_0x647e('0x1'));var moment=require(_0x647e('0x2'));var BPromise=require(_0x647e('0x3'));var rs=require(_0x647e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x647e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x647e('0x6'));var config=require(_0x647e('0x7'));var jayson=require(_0x647e('0x8'));var client=jayson[_0x647e('0x9')][_0x647e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31a88c,_0x501de1,_0x925655){return new BPromise(function(_0x53566d,_0x450d6c){return client[_0x647e('0xb')](_0x31a88c,_0x925655)[_0x647e('0xc')](function(_0x389e66){logger['info'](_0x647e('0xd'),_0x501de1,_0x647e('0xe'));logger[_0x647e('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x501de1,'request\x20sent',JSON[_0x647e('0x10')](_0x389e66));if(_0x389e66['error']){if(_0x389e66['error'][_0x647e('0x11')]===0x1f4){logger[_0x647e('0x12')](_0x647e('0xd'),_0x501de1,_0x389e66['error'][_0x647e('0x13')]);return _0x450d6c(_0x389e66[_0x647e('0x12')][_0x647e('0x13')]);}logger[_0x647e('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x501de1,_0x389e66['error'][_0x647e('0x13')]);return _0x53566d(_0x389e66[_0x647e('0x12')][_0x647e('0x13')]);}else{logger[_0x647e('0x14')](_0x647e('0xd'),_0x501de1,_0x647e('0xe'));_0x53566d(_0x389e66[_0x647e('0x15')][_0x647e('0x13')]);}})[_0x647e('0x16')](function(_0x45a8e6){logger[_0x647e('0x12')](_0x647e('0xd'),_0x501de1,_0x45a8e6);_0x450d6c(_0x45a8e6);});});}exports[_0x647e('0x17')]=function(_0x42a1ac){var _0x584020=this;return new Promise(function(_0x51e4d5,_0x168c1d){return db['WhatsappQueueReport']['create'](_0x42a1ac['body'],{'raw':_0x42a1ac[_0x647e('0x18')]?_0x42a1ac['options'][_0x647e('0x19')]===undefined?!![]:![]:!![]})[_0x647e('0xc')](function(_0x203f2d){logger[_0x647e('0x14')](_0x647e('0x17'),_0x42a1ac);logger[_0x647e('0xf')](_0x647e('0x17'),_0x42a1ac,JSON[_0x647e('0x10')](_0x203f2d));_0x51e4d5(_0x203f2d);})['catch'](function(_0x2a9b70){logger[_0x647e('0x12')]('CreateWhatsappQueueReport',_0x2a9b70[_0x647e('0x13')],_0x42a1ac);_0x168c1d(_0x584020['error'](0x1f4,_0x2a9b70['message']));});});};exports[_0x647e('0x1a')]=function(_0x2f3629){var _0x3a564e=this;return new Promise(function(_0x86ec55,_0x598790){return db['WhatsappQueueReport'][_0x647e('0x1b')](_0x2f3629[_0x647e('0x1c')],{'raw':_0x2f3629['options']?_0x2f3629[_0x647e('0x18')][_0x647e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f3629[_0x647e('0x18')]?_0x2f3629['options'][_0x647e('0x1d')]||null:null,'attributes':_0x2f3629['options']?_0x2f3629['options']['attributes']||null:null,'limit':_0x2f3629['options']?_0x2f3629[_0x647e('0x18')]['limit']||null:null})[_0x647e('0xc')](function(_0x2c63a1){logger[_0x647e('0x14')](_0x647e('0x1a'),_0x2f3629);logger[_0x647e('0xf')](_0x647e('0x1a'),_0x2f3629,JSON['stringify'](_0x2c63a1));_0x86ec55(_0x2c63a1);})[_0x647e('0x16')](function(_0x50b272){logger['error']('UpdateWhatsappQueueReport',_0x50b272[_0x647e('0x13')],_0x2f3629);_0x598790(_0x3a564e[_0x647e('0x12')](0x1f4,_0x50b272[_0x647e('0x13')]));});});}; \ No newline at end of file +var _0xcf7a=['UpdateWhatsappQueueReport','update','body','options','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','raw','debug'];(function(_0x3d2761,_0x2696bf){var _0x531ae9=function(_0x495aa6){while(--_0x495aa6){_0x3d2761['push'](_0x3d2761['shift']());}};_0x531ae9(++_0x2696bf);}(_0xcf7a,0x18b));var _0xacf7=function(_0x500deb,_0x2b5e9d){_0x500deb=_0x500deb-0x0;var _0x4ebe54=_0xcf7a[_0x500deb];return _0x4ebe54;};'use strict';var _=require(_0xacf7('0x0'));var util=require(_0xacf7('0x1'));var moment=require('moment');var BPromise=require(_0xacf7('0x2'));var rs=require(_0xacf7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xacf7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xacf7('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xacf7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x521629,_0x6b5094,_0x87358f){return new BPromise(function(_0x59c664,_0x17b396){return client[_0xacf7('0x7')](_0x521629,_0x87358f)[_0xacf7('0x8')](function(_0x364b9c){logger[_0xacf7('0x9')](_0xacf7('0xa'),_0x6b5094,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x6b5094,_0xacf7('0xb'),JSON[_0xacf7('0xc')](_0x364b9c));if(_0x364b9c[_0xacf7('0xd')]){if(_0x364b9c[_0xacf7('0xd')]['code']===0x1f4){logger[_0xacf7('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x6b5094,_0x364b9c[_0xacf7('0xd')][_0xacf7('0xe')]);return _0x17b396(_0x364b9c['error'][_0xacf7('0xe')]);}logger[_0xacf7('0xd')](_0xacf7('0xa'),_0x6b5094,_0x364b9c[_0xacf7('0xd')][_0xacf7('0xe')]);return _0x59c664(_0x364b9c[_0xacf7('0xd')][_0xacf7('0xe')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x6b5094,_0xacf7('0xb'));_0x59c664(_0x364b9c['result'][_0xacf7('0xe')]);}})[_0xacf7('0xf')](function(_0x5ca9fc){logger[_0xacf7('0xd')](_0xacf7('0xa'),_0x6b5094,_0x5ca9fc);_0x17b396(_0x5ca9fc);});});}exports[_0xacf7('0x10')]=function(_0x58d7e6){var _0x2fc10b=this;return new Promise(function(_0x3d7a36,_0x293979){return db[_0xacf7('0x11')][_0xacf7('0x12')](_0x58d7e6['body'],{'raw':_0x58d7e6['options']?_0x58d7e6['options'][_0xacf7('0x13')]===undefined?!![]:![]:!![]})['then'](function(_0x473ad4){logger['info'](_0xacf7('0x10'),_0x58d7e6);logger[_0xacf7('0x14')](_0xacf7('0x10'),_0x58d7e6,JSON[_0xacf7('0xc')](_0x473ad4));_0x3d7a36(_0x473ad4);})[_0xacf7('0xf')](function(_0x58be3d){logger['error'](_0xacf7('0x10'),_0x58be3d['message'],_0x58d7e6);_0x293979(_0x2fc10b[_0xacf7('0xd')](0x1f4,_0x58be3d[_0xacf7('0xe')]));});});};exports[_0xacf7('0x15')]=function(_0x252424){var _0x4adbb9=this;return new Promise(function(_0x124c4d,_0xfe7d67){return db[_0xacf7('0x11')][_0xacf7('0x16')](_0x252424[_0xacf7('0x17')],{'raw':_0x252424[_0xacf7('0x18')]?_0x252424[_0xacf7('0x18')][_0xacf7('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252424[_0xacf7('0x18')]?_0x252424[_0xacf7('0x18')]['where']||null:null,'attributes':_0x252424['options']?_0x252424['options']['attributes']||null:null,'limit':_0x252424[_0xacf7('0x18')]?_0x252424['options'][_0xacf7('0x19')]||null:null})[_0xacf7('0x8')](function(_0x1c6c6a){logger['info'](_0xacf7('0x15'),_0x252424);logger['debug'](_0xacf7('0x15'),_0x252424,JSON[_0xacf7('0xc')](_0x1c6c6a));_0x124c4d(_0x1c6c6a);})[_0xacf7('0xf')](function(_0x6d69f2){logger[_0xacf7('0xd')](_0xacf7('0x15'),_0x6d69f2[_0xacf7('0xe')],_0x252424);_0xfe7d67(_0x4adbb9[_0xacf7('0xd')](0x1f4,_0x6d69f2['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 51a7cd3..22bcd0e 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 _0x6df3=['../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x31122e,_0x24fbf7){var _0x54922b=function(_0x142778){while(--_0x142778){_0x31122e['push'](_0x31122e['shift']());}};_0x54922b(++_0x24fbf7);}(_0x6df3,0x174));var _0x36df=function(_0x2d2b4e,_0x2ca434){_0x2d2b4e=_0x2d2b4e-0x0;var _0xf3c95d=_0x6df3[_0x2d2b4e];return _0xf3c95d;};'use strict';var multer=require(_0x36df('0x0'));var util=require(_0x36df('0x1'));var path=require(_0x36df('0x2'));var timeout=require(_0x36df('0x3'));var express=require('express');var router=express[_0x36df('0x4')]();var fs_extra=require(_0x36df('0x5'));var auth=require(_0x36df('0x6'));var interaction=require(_0x36df('0x7'));var config=require(_0x36df('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x36df('0x9')]('/',auth[_0x36df('0xa')](),controller[_0x36df('0xb')]);router['get']('/describe',auth[_0x36df('0xa')](),controller['describe']);router[_0x36df('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x36df('0xc')]);router[_0x36df('0xd')]('/',auth[_0x36df('0xa')](),controller[_0x36df('0xe')]);router[_0x36df('0xf')](_0x36df('0x10'),auth[_0x36df('0xa')](),controller[_0x36df('0x11')]);router[_0x36df('0x12')](_0x36df('0x10'),auth[_0x36df('0xa')](),controller['destroy']);module[_0x36df('0x13')]=router; \ No newline at end of file +var _0xd8ff=['index','get','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated'];(function(_0x2efb96,_0x40a4ce){var _0x50d38d=function(_0x22eaa9){while(--_0x22eaa9){_0x2efb96['push'](_0x2efb96['shift']());}};_0x50d38d(++_0x40a4ce);}(_0xd8ff,0x17c));var _0xfd8f=function(_0x195270,_0x412abb){_0x195270=_0x195270-0x0;var _0x5398dd=_0xd8ff[_0x195270];return _0x5398dd;};'use strict';var multer=require(_0xfd8f('0x0'));var util=require(_0xfd8f('0x1'));var path=require(_0xfd8f('0x2'));var timeout=require(_0xfd8f('0x3'));var express=require(_0xfd8f('0x4'));var router=express[_0xfd8f('0x5')]();var fs_extra=require(_0xfd8f('0x6'));var auth=require(_0xfd8f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfd8f('0x8'));var controller=require(_0xfd8f('0x9'));router['get']('/',auth[_0xfd8f('0xa')](),controller[_0xfd8f('0xb')]);router[_0xfd8f('0xc')](_0xfd8f('0xd'),auth[_0xfd8f('0xa')](),controller[_0xfd8f('0xe')]);router[_0xfd8f('0xc')]('/:id',auth[_0xfd8f('0xa')](),controller[_0xfd8f('0xf')]);router['post']('/',auth[_0xfd8f('0xa')](),controller[_0xfd8f('0x10')]);router[_0xfd8f('0x11')](_0xfd8f('0x12'),auth[_0xfd8f('0xa')](),controller[_0xfd8f('0x13')]);router[_0xfd8f('0x14')](_0xfd8f('0x12'),auth[_0xfd8f('0xa')](),controller[_0xfd8f('0x15')]);module[_0xfd8f('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index cb7dc9c..66f40d8 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 _0x4fc2=['sequelize','exports','STRING','ENUM','agent','queue','DATE'];(function(_0x22942f,_0x56e2ae){var _0x17dde5=function(_0x47de28){while(--_0x47de28){_0x22942f['push'](_0x22942f['shift']());}};_0x17dde5(++_0x56e2ae);}(_0x4fc2,0x111));var _0x24fc=function(_0x1e94ae,_0x2fe37a){_0x1e94ae=_0x1e94ae-0x0;var _0x261ef9=_0x4fc2[_0x1e94ae];return _0x261ef9;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'uniqueid':{'type':Sequelize[_0x24fc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x24fc('0x3')]('account',_0x24fc('0x4'),_0x24fc('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x24fc('0x6')]}}; \ No newline at end of file +var _0x85cf=['STRING','ENUM','account','agent','queue','DATE','exports'];(function(_0x2298b9,_0x4e0da9){var _0x2d5fbb=function(_0x2f48bf){while(--_0x2f48bf){_0x2298b9['push'](_0x2298b9['shift']());}};_0x2d5fbb(++_0x4e0da9);}(_0x85cf,0x76));var _0xf85c=function(_0x41a35a,_0xda06ad){_0x41a35a=_0x41a35a-0x0;var _0x33899c=_0x85cf[_0x41a35a];return _0x33899c;};'use strict';var Sequelize=require('sequelize');module[_0xf85c('0x0')]={'uniqueid':{'type':Sequelize[_0xf85c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf85c('0x2')](_0xf85c('0x3'),_0xf85c('0x4'),_0xf85c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xf85c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 4b37522..4ebc4c4 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 _0x6bab=['util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','WhatsappTransferReport','include','rows','catch','show','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3ed2dc,_0x2db471){var _0x629c4b=function(_0x535ea9){while(--_0x535ea9){_0x3ed2dc['push'](_0x3ed2dc['shift']());}};_0x629c4b(++_0x2db471);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x6bab[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0xb6ba('0x0'));var rimraf=require(_0xb6ba('0x1'));var zipdir=require(_0xb6ba('0x2'));var jsonpatch=require(_0xb6ba('0x3'));var rp=require('request-promise');var moment=require(_0xb6ba('0x4'));var BPromise=require(_0xb6ba('0x5'));var Mustache=require(_0xb6ba('0x6'));var util=require(_0xb6ba('0x7'));var path=require(_0xb6ba('0x8'));var sox=require('sox');var csv=require(_0xb6ba('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb6ba('0xa'));var _=require(_0xb6ba('0xb'));var squel=require(_0xb6ba('0xc'));var crypto=require(_0xb6ba('0xd'));var jsforce=require(_0xb6ba('0xe'));var deskjs=require(_0xb6ba('0xf'));var toCsv=require(_0xb6ba('0x9'));var querystring=require(_0xb6ba('0x10'));var Papa=require(_0xb6ba('0x11'));var Redis=require('ioredis');var authService=require(_0xb6ba('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6ba('0x13'))(_0xb6ba('0x14'));var utils=require(_0xb6ba('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb6ba('0x16'));var db=require(_0xb6ba('0x17'))['db'];function respondWithStatusCode(_0xc4497e,_0xba683e){_0xba683e=_0xba683e||0xcc;return function(_0xb7620d){if(_0xb7620d){return _0xc4497e[_0xb6ba('0x18')](_0xba683e);}return _0xc4497e[_0xb6ba('0x19')](_0xba683e)[_0xb6ba('0x1a')]();};}function respondWithResult(_0x36d352,_0x431ce5){_0x431ce5=_0x431ce5||0xc8;return function(_0x210454){if(_0x210454){return _0x36d352[_0xb6ba('0x19')](_0x431ce5)[_0xb6ba('0x1b')](_0x210454);}};}function respondWithFilteredResult(_0x1d8ed6,_0x15d2e8){return function(_0x3a5ad2){if(_0x3a5ad2){var _0x3ec867=typeof _0x15d2e8[_0xb6ba('0x1c')]===_0xb6ba('0x1d')&&typeof _0x15d2e8['limit']===_0xb6ba('0x1d');var _0x4ed16d=_0x3a5ad2['count'];var _0x24fa69=_0x3ec867?0x0:_0x15d2e8[_0xb6ba('0x1c')];var _0x49a48e=_0x3ec867?_0x3a5ad2[_0xb6ba('0x1e')]:_0x15d2e8[_0xb6ba('0x1c')]+_0x15d2e8['limit'];var _0x1cf948;if(_0x49a48e>=_0x4ed16d){_0x49a48e=_0x4ed16d;_0x1cf948=0xc8;}else{_0x1cf948=0xce;}_0x1d8ed6[_0xb6ba('0x19')](_0x1cf948);return _0x1d8ed6[_0xb6ba('0x1f')](_0xb6ba('0x20'),_0x24fa69+'-'+_0x49a48e+'/'+_0x4ed16d)[_0xb6ba('0x1b')](_0x3a5ad2);}return null;};}function patchUpdates(_0x40b66e){return function(_0x213a36){try{jsonpatch[_0xb6ba('0x21')](_0x213a36,_0x40b66e,!![]);}catch(_0x102cb7){return BPromise[_0xb6ba('0x22')](_0x102cb7);}return _0x213a36[_0xb6ba('0x23')]();};}function saveUpdates(_0x444f90,_0x2350a5){return function(_0x35dbc9){if(_0x35dbc9){return _0x35dbc9[_0xb6ba('0x24')](_0x444f90)[_0xb6ba('0x25')](function(_0x57d6e9){return _0x57d6e9;});}return null;};}function removeEntity(_0x4d6345,_0x31e991){return function(_0x48d466){if(_0x48d466){return _0x48d466[_0xb6ba('0x26')]()[_0xb6ba('0x25')](function(){_0x4d6345[_0xb6ba('0x19')](0xcc)[_0xb6ba('0x1a')]();});}};}function handleEntityNotFound(_0x43704b,_0x4e4b6a){return function(_0x5ce5d7){if(!_0x5ce5d7){_0x43704b[_0xb6ba('0x18')](0x194);}return _0x5ce5d7;};}function handleError(_0x57471f,_0x418394){_0x418394=_0x418394||0x1f4;return function(_0x253f32){logger[_0xb6ba('0x27')](_0x253f32[_0xb6ba('0x28')]);if(_0x253f32[_0xb6ba('0x29')]){delete _0x253f32[_0xb6ba('0x29')];}_0x57471f[_0xb6ba('0x19')](_0x418394)[_0xb6ba('0x2a')](_0x253f32);};}exports['index']=function(_0x2d5038,_0x5f0864){var _0x1534fb={},_0x1041e8={},_0x190ee3={'count':0x0,'rows':[]};var _0x563df2=_[_0xb6ba('0x2b')](db['WhatsappTransferReport'][_0xb6ba('0x2c')],function(_0x1d1bc7){return{'name':_0x1d1bc7[_0xb6ba('0x2d')],'type':_0x1d1bc7[_0xb6ba('0x2e')]['key']};});_0x1041e8['model']=_[_0xb6ba('0x2b')](_0x563df2,_0xb6ba('0x29'));_0x1041e8[_0xb6ba('0x2f')]=_[_0xb6ba('0x30')](_0x2d5038[_0xb6ba('0x2f')]);_0x1041e8[_0xb6ba('0x31')]=_[_0xb6ba('0x32')](_0x1041e8['model'],_0x1041e8['query']);_0x1534fb[_0xb6ba('0x33')]=_[_0xb6ba('0x32')](_0x1041e8[_0xb6ba('0x34')],qs['fields'](_0x2d5038[_0xb6ba('0x2f')][_0xb6ba('0x35')]));_0x1534fb[_0xb6ba('0x33')]=_0x1534fb[_0xb6ba('0x33')][_0xb6ba('0x36')]?_0x1534fb[_0xb6ba('0x33')]:_0x1041e8[_0xb6ba('0x34')];if(!_0x2d5038['query'][_0xb6ba('0x37')](_0xb6ba('0x38'))){_0x1534fb[_0xb6ba('0x39')]=qs[_0xb6ba('0x39')](_0x2d5038[_0xb6ba('0x2f')][_0xb6ba('0x39')]);_0x1534fb[_0xb6ba('0x1c')]=qs['offset'](_0x2d5038[_0xb6ba('0x2f')][_0xb6ba('0x1c')]);}_0x1534fb[_0xb6ba('0x3a')]=qs[_0xb6ba('0x3b')](_0x2d5038['query'][_0xb6ba('0x3b')]);_0x1534fb['where']=qs['filters'](_[_0xb6ba('0x3c')](_0x2d5038[_0xb6ba('0x2f')],_0x1041e8[_0xb6ba('0x31')]),_0x563df2);if(_0x2d5038[_0xb6ba('0x2f')][_0xb6ba('0x3d')]){_0x1534fb[_0xb6ba('0x3e')]=_['merge'](_0x1534fb[_0xb6ba('0x3e')],{'$or':_['map'](_0x563df2,function(_0x164491){if(_0x164491[_0xb6ba('0x2e')]!==_0xb6ba('0x3f')){var _0x49231e={};_0x49231e[_0x164491[_0xb6ba('0x29')]]={'$like':'%'+_0x2d5038[_0xb6ba('0x2f')][_0xb6ba('0x3d')]+'%'};return _0x49231e;}})});}_0x1534fb=_[_0xb6ba('0x40')]({},_0x1534fb,_0x2d5038['options']);var _0x41c897={'where':_0x1534fb[_0xb6ba('0x3e')]};return db[_0xb6ba('0x41')][_0xb6ba('0x1e')](_0x41c897)[_0xb6ba('0x25')](function(_0x4205cb){_0x190ee3[_0xb6ba('0x1e')]=_0x4205cb;if(_0x2d5038[_0xb6ba('0x2f')]['includeAll']){_0x1534fb[_0xb6ba('0x42')]=[{'all':!![]}];}return db[_0xb6ba('0x41')]['findAll'](_0x1534fb);})[_0xb6ba('0x25')](function(_0x18ecb1){_0x190ee3[_0xb6ba('0x43')]=_0x18ecb1;return _0x190ee3;})['then'](respondWithFilteredResult(_0x5f0864,_0x1534fb))[_0xb6ba('0x44')](handleError(_0x5f0864,null));};exports[_0xb6ba('0x45')]=function(_0x385278,_0x399326){var _0x8ff870={'raw':!![],'where':{'id':_0x385278['params']['id']}},_0x1c2def={};_0x1c2def[_0xb6ba('0x34')]=_[_0xb6ba('0x30')](db[_0xb6ba('0x41')][_0xb6ba('0x2c')]);_0x1c2def[_0xb6ba('0x2f')]=_['keys'](_0x385278[_0xb6ba('0x2f')]);_0x1c2def['filters']=_[_0xb6ba('0x32')](_0x1c2def['model'],_0x1c2def[_0xb6ba('0x2f')]);_0x8ff870[_0xb6ba('0x33')]=_[_0xb6ba('0x32')](_0x1c2def['model'],qs[_0xb6ba('0x35')](_0x385278[_0xb6ba('0x2f')]['fields']));_0x8ff870[_0xb6ba('0x33')]=_0x8ff870[_0xb6ba('0x33')][_0xb6ba('0x36')]?_0x8ff870['attributes']:_0x1c2def['model'];if(_0x385278[_0xb6ba('0x2f')][_0xb6ba('0x46')]){_0x8ff870[_0xb6ba('0x42')]=[{'all':!![]}];}_0x8ff870=_[_0xb6ba('0x40')]({},_0x8ff870,_0x385278[_0xb6ba('0x47')]);return db[_0xb6ba('0x41')][_0xb6ba('0x48')](_0x8ff870)[_0xb6ba('0x25')](handleEntityNotFound(_0x399326,null))['then'](respondWithResult(_0x399326,null))[_0xb6ba('0x44')](handleError(_0x399326,null));};exports[_0xb6ba('0x49')]=function(_0x5f4b15,_0x5deb50){return db[_0xb6ba('0x41')][_0xb6ba('0x49')](_0x5f4b15[_0xb6ba('0x4a')],{})['then'](respondWithResult(_0x5deb50,0xc9))[_0xb6ba('0x44')](handleError(_0x5deb50,null));};exports[_0xb6ba('0x24')]=function(_0x1c9c8d,_0x39d082){if(_0x1c9c8d[_0xb6ba('0x4a')]['id']){delete _0x1c9c8d[_0xb6ba('0x4a')]['id'];}return db[_0xb6ba('0x41')]['find']({'where':{'id':_0x1c9c8d[_0xb6ba('0x4b')]['id']}})[_0xb6ba('0x25')](handleEntityNotFound(_0x39d082,null))[_0xb6ba('0x25')](saveUpdates(_0x1c9c8d[_0xb6ba('0x4a')],null))['then'](respondWithResult(_0x39d082,null))[_0xb6ba('0x44')](handleError(_0x39d082,null));};exports['destroy']=function(_0x13e9f5,_0x3e8d56){return db[_0xb6ba('0x41')][_0xb6ba('0x48')]({'where':{'id':_0x13e9f5[_0xb6ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e8d56,null))[_0xb6ba('0x25')](removeEntity(_0x3e8d56,null))['catch'](handleError(_0x3e8d56,null));};exports[_0xb6ba('0x4c')]=function(_0x2e6c4a,_0x1e1f1a){return db[_0xb6ba('0x41')][_0xb6ba('0x4c')]()[_0xb6ba('0x25')](respondWithResult(_0x1e1f1a,null))[_0xb6ba('0x44')](handleError(_0x1e1f1a,null));}; \ No newline at end of file +var _0xf431=['catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include'];(function(_0x163eda,_0x4038dc){var _0x344833=function(_0x2ccbe2){while(--_0x2ccbe2){_0x163eda['push'](_0x163eda['shift']());}};_0x344833(++_0x4038dc);}(_0xf431,0x93));var _0x1f43=function(_0x456904,_0x4cb25c){_0x456904=_0x456904-0x0;var _0x4b0063=_0xf431[_0x456904];return _0x4b0063;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f43('0x0'));var zipdir=require(_0x1f43('0x1'));var jsonpatch=require(_0x1f43('0x2'));var rp=require('request-promise');var moment=require(_0x1f43('0x3'));var BPromise=require(_0x1f43('0x4'));var Mustache=require('mustache');var util=require(_0x1f43('0x5'));var path=require(_0x1f43('0x6'));var sox=require(_0x1f43('0x7'));var csv=require(_0x1f43('0x8'));var ejs=require(_0x1f43('0x9'));var fs=require('fs');var fs_extra=require(_0x1f43('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1f43('0xb'));var jsforce=require(_0x1f43('0xc'));var deskjs=require(_0x1f43('0xd'));var toCsv=require(_0x1f43('0x8'));var querystring=require(_0x1f43('0xe'));var Papa=require('papaparse');var Redis=require(_0x1f43('0xf'));var authService=require(_0x1f43('0x10'));var qs=require(_0x1f43('0x11'));var as=require(_0x1f43('0x12'));var hardwareService=require(_0x1f43('0x13'));var logger=require(_0x1f43('0x14'))(_0x1f43('0x15'));var utils=require('../../config/utils');var config=require(_0x1f43('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f9b0d,_0xa25bbc){_0xa25bbc=_0xa25bbc||0xcc;return function(_0x1f0057){if(_0x1f0057){return _0x2f9b0d[_0x1f43('0x17')](_0xa25bbc);}return _0x2f9b0d[_0x1f43('0x18')](_0xa25bbc)[_0x1f43('0x19')]();};}function respondWithResult(_0x94948d,_0xe5e0c1){_0xe5e0c1=_0xe5e0c1||0xc8;return function(_0x5418c5){if(_0x5418c5){return _0x94948d[_0x1f43('0x18')](_0xe5e0c1)[_0x1f43('0x1a')](_0x5418c5);}};}function respondWithFilteredResult(_0x297672,_0x1127f6){return function(_0x23a6f0){if(_0x23a6f0){var _0x9d7d9b=typeof _0x1127f6[_0x1f43('0x1b')]===_0x1f43('0x1c')&&typeof _0x1127f6[_0x1f43('0x1d')]===_0x1f43('0x1c');var _0x37c140=_0x23a6f0[_0x1f43('0x1e')];var _0x1ac7fd=_0x9d7d9b?0x0:_0x1127f6[_0x1f43('0x1b')];var _0x3d1f6c=_0x9d7d9b?_0x23a6f0[_0x1f43('0x1e')]:_0x1127f6[_0x1f43('0x1b')]+_0x1127f6[_0x1f43('0x1d')];var _0x3448b0;if(_0x3d1f6c>=_0x37c140){_0x3d1f6c=_0x37c140;_0x3448b0=0xc8;}else{_0x3448b0=0xce;}_0x297672[_0x1f43('0x18')](_0x3448b0);return _0x297672[_0x1f43('0x1f')]('Content-Range',_0x1ac7fd+'-'+_0x3d1f6c+'/'+_0x37c140)['json'](_0x23a6f0);}return null;};}function patchUpdates(_0x1eced8){return function(_0x3e63c7){try{jsonpatch[_0x1f43('0x20')](_0x3e63c7,_0x1eced8,!![]);}catch(_0x13d9e9){return BPromise['reject'](_0x13d9e9);}return _0x3e63c7['save']();};}function saveUpdates(_0x3c457a,_0x11fb59){return function(_0x1d82e2){if(_0x1d82e2){return _0x1d82e2[_0x1f43('0x21')](_0x3c457a)[_0x1f43('0x22')](function(_0xc32547){return _0xc32547;});}return null;};}function removeEntity(_0x2385d3,_0x634c3a){return function(_0x4fdd4a){if(_0x4fdd4a){return _0x4fdd4a[_0x1f43('0x23')]()['then'](function(){_0x2385d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5409,_0x20bea8){return function(_0x2c0ee8){if(!_0x2c0ee8){_0x5b5409['sendStatus'](0x194);}return _0x2c0ee8;};}function handleError(_0x4aa4eb,_0x4dfbcc){_0x4dfbcc=_0x4dfbcc||0x1f4;return function(_0x21671e){logger['error'](_0x21671e[_0x1f43('0x24')]);if(_0x21671e['name']){delete _0x21671e[_0x1f43('0x25')];}_0x4aa4eb['status'](_0x4dfbcc)[_0x1f43('0x26')](_0x21671e);};}exports[_0x1f43('0x27')]=function(_0x12cf00,_0x1eaa34){var _0x5d5d6a={},_0x335d07={},_0x4199d6={'count':0x0,'rows':[]};var _0x5b49c9=_[_0x1f43('0x28')](db[_0x1f43('0x29')]['rawAttributes'],function(_0x2fc441){return{'name':_0x2fc441[_0x1f43('0x2a')],'type':_0x2fc441[_0x1f43('0x2b')]['key']};});_0x335d07[_0x1f43('0x2c')]=_[_0x1f43('0x28')](_0x5b49c9,_0x1f43('0x25'));_0x335d07[_0x1f43('0x2d')]=_[_0x1f43('0x2e')](_0x12cf00[_0x1f43('0x2d')]);_0x335d07[_0x1f43('0x2f')]=_[_0x1f43('0x30')](_0x335d07[_0x1f43('0x2c')],_0x335d07[_0x1f43('0x2d')]);_0x5d5d6a[_0x1f43('0x31')]=_['intersection'](_0x335d07[_0x1f43('0x2c')],qs[_0x1f43('0x32')](_0x12cf00[_0x1f43('0x2d')]['fields']));_0x5d5d6a[_0x1f43('0x31')]=_0x5d5d6a[_0x1f43('0x31')][_0x1f43('0x33')]?_0x5d5d6a[_0x1f43('0x31')]:_0x335d07[_0x1f43('0x2c')];if(!_0x12cf00[_0x1f43('0x2d')]['hasOwnProperty'](_0x1f43('0x34'))){_0x5d5d6a['limit']=qs[_0x1f43('0x1d')](_0x12cf00[_0x1f43('0x2d')]['limit']);_0x5d5d6a[_0x1f43('0x1b')]=qs[_0x1f43('0x1b')](_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x1b')]);}_0x5d5d6a[_0x1f43('0x35')]=qs[_0x1f43('0x36')](_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x36')]);_0x5d5d6a['where']=qs['filters'](_[_0x1f43('0x37')](_0x12cf00[_0x1f43('0x2d')],_0x335d07['filters']),_0x5b49c9);if(_0x12cf00['query'][_0x1f43('0x38')]){_0x5d5d6a[_0x1f43('0x39')]=_['merge'](_0x5d5d6a[_0x1f43('0x39')],{'$or':_[_0x1f43('0x28')](_0x5b49c9,function(_0x20637d){if(_0x20637d['type']!==_0x1f43('0x3a')){var _0x57fd37={};_0x57fd37[_0x20637d[_0x1f43('0x25')]]={'$like':'%'+_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x38')]+'%'};return _0x57fd37;}})});}_0x5d5d6a=_[_0x1f43('0x3b')]({},_0x5d5d6a,_0x12cf00[_0x1f43('0x3c')]);var _0x72ada6={'where':_0x5d5d6a['where']};return db[_0x1f43('0x29')][_0x1f43('0x1e')](_0x72ada6)[_0x1f43('0x22')](function(_0x451de3){_0x4199d6[_0x1f43('0x1e')]=_0x451de3;if(_0x12cf00[_0x1f43('0x2d')][_0x1f43('0x3d')]){_0x5d5d6a[_0x1f43('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x5d5d6a);})[_0x1f43('0x22')](function(_0x3ec7d6){_0x4199d6['rows']=_0x3ec7d6;return _0x4199d6;})[_0x1f43('0x22')](respondWithFilteredResult(_0x1eaa34,_0x5d5d6a))[_0x1f43('0x3f')](handleError(_0x1eaa34,null));};exports[_0x1f43('0x40')]=function(_0x13459b,_0x5ab397){var _0x50cf4a={'raw':!![],'where':{'id':_0x13459b[_0x1f43('0x41')]['id']}},_0xa4dc92={};_0xa4dc92[_0x1f43('0x2c')]=_[_0x1f43('0x2e')](db[_0x1f43('0x29')]['rawAttributes']);_0xa4dc92[_0x1f43('0x2d')]=_['keys'](_0x13459b[_0x1f43('0x2d')]);_0xa4dc92[_0x1f43('0x2f')]=_[_0x1f43('0x30')](_0xa4dc92[_0x1f43('0x2c')],_0xa4dc92[_0x1f43('0x2d')]);_0x50cf4a[_0x1f43('0x31')]=_[_0x1f43('0x30')](_0xa4dc92[_0x1f43('0x2c')],qs[_0x1f43('0x32')](_0x13459b[_0x1f43('0x2d')][_0x1f43('0x32')]));_0x50cf4a[_0x1f43('0x31')]=_0x50cf4a[_0x1f43('0x31')][_0x1f43('0x33')]?_0x50cf4a[_0x1f43('0x31')]:_0xa4dc92[_0x1f43('0x2c')];if(_0x13459b[_0x1f43('0x2d')][_0x1f43('0x3d')]){_0x50cf4a[_0x1f43('0x3e')]=[{'all':!![]}];}_0x50cf4a=_[_0x1f43('0x3b')]({},_0x50cf4a,_0x13459b[_0x1f43('0x3c')]);return db[_0x1f43('0x29')][_0x1f43('0x42')](_0x50cf4a)[_0x1f43('0x22')](handleEntityNotFound(_0x5ab397,null))['then'](respondWithResult(_0x5ab397,null))[_0x1f43('0x3f')](handleError(_0x5ab397,null));};exports[_0x1f43('0x43')]=function(_0x5542e7,_0x3ef084){return db[_0x1f43('0x29')][_0x1f43('0x43')](_0x5542e7['body'],{})[_0x1f43('0x22')](respondWithResult(_0x3ef084,0xc9))[_0x1f43('0x3f')](handleError(_0x3ef084,null));};exports['update']=function(_0x30bf64,_0x2785e5){if(_0x30bf64[_0x1f43('0x44')]['id']){delete _0x30bf64[_0x1f43('0x44')]['id'];}return db['WhatsappTransferReport'][_0x1f43('0x42')]({'where':{'id':_0x30bf64[_0x1f43('0x41')]['id']}})['then'](handleEntityNotFound(_0x2785e5,null))[_0x1f43('0x22')](saveUpdates(_0x30bf64[_0x1f43('0x44')],null))[_0x1f43('0x22')](respondWithResult(_0x2785e5,null))[_0x1f43('0x3f')](handleError(_0x2785e5,null));};exports[_0x1f43('0x23')]=function(_0x393b8f,_0x4fb78c){return db[_0x1f43('0x29')][_0x1f43('0x42')]({'where':{'id':_0x393b8f[_0x1f43('0x41')]['id']}})[_0x1f43('0x22')](handleEntityNotFound(_0x4fb78c,null))[_0x1f43('0x22')](removeEntity(_0x4fb78c,null))['catch'](handleError(_0x4fb78c,null));};exports[_0x1f43('0x45')]=function(_0x485b38,_0x408256){return db['WhatsappTransferReport'][_0x1f43('0x45')]()[_0x1f43('0x22')](respondWithResult(_0x408256,null))[_0x1f43('0x3f')](handleError(_0x408256,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 191dff8..d4253a9 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 _0x3270=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x2818d1,_0x493ce6){var _0x2e2886=function(_0xecd59){while(--_0xecd59){_0x2818d1['push'](_0x2818d1['shift']());}};_0x2e2886(++_0x493ce6);}(_0x3270,0xfb));var _0x0327=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0x3270[_0x483d8b];return _0x6500f1;};'use strict';var _=require(_0x0327('0x0'));var util=require(_0x0327('0x1'));var logger=require(_0x0327('0x2'))(_0x0327('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0327('0x4'));var rimraf=require(_0x0327('0x5'));var config=require(_0x0327('0x6'));var attributes=require(_0x0327('0x7'));module[_0x0327('0x8')]=function(_0xd7f18a,_0x2d4e06){return _0xd7f18a[_0x0327('0x9')](_0x0327('0xa'),attributes,{'tableName':_0x0327('0xb'),'paranoid':![],'indexes':[{'name':_0x0327('0xc'),'fields':[_0x0327('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcba1=['bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0xcba1,0x14e));var _0x1cba=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0xcba1[_0x2c6120];return _0x5fb114;};'use strict';var _=require(_0x1cba('0x0'));var util=require('util');var logger=require(_0x1cba('0x1'))(_0x1cba('0x2'));var moment=require(_0x1cba('0x3'));var BPromise=require(_0x1cba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cba('0x5'));var rimraf=require(_0x1cba('0x6'));var config=require(_0x1cba('0x7'));var attributes=require(_0x1cba('0x8'));module[_0x1cba('0x9')]=function(_0x1ecec1,_0x2f0d2b){return _0x1ecec1[_0x1cba('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0x1cba('0xb'),'paranoid':![],'indexes':[{'name':_0x1cba('0xc'),'fields':[_0x1cba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index fd7bd55..73a557b 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 _0xe59e=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x879ecb,_0x43b3ec){var _0x4df963=function(_0x527552){while(--_0x527552){_0x879ecb['push'](_0x879ecb['shift']());}};_0x4df963(++_0x43b3ec);}(_0xe59e,0x158));var _0xee59=function(_0x4a8bfe,_0x1831c6){_0x4a8bfe=_0x4a8bfe-0x0;var _0xe768d9=_0xe59e[_0x4a8bfe];return _0xe768d9;};'use strict';var _=require('lodash');var util=require(_0xee59('0x0'));var moment=require(_0xee59('0x1'));var BPromise=require(_0xee59('0x2'));var rs=require(_0xee59('0x3'));var fs=require('fs');var Redis=require(_0xee59('0x4'));var db=require(_0xee59('0x5'))['db'];var utils=require(_0xee59('0x6'));var logger=require(_0xee59('0x7'))(_0xee59('0x8'));var config=require(_0xee59('0x9'));var jayson=require(_0xee59('0xa'));var client=jayson[_0xee59('0xb')][_0xee59('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x553fc3,_0x3fc0d7,_0x5d83e5){return new BPromise(function(_0x2c94fb,_0x5f1d8c){return client[_0xee59('0xd')](_0x553fc3,_0x5d83e5)['then'](function(_0x1fcb37){logger[_0xee59('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3fc0d7,_0xee59('0xf'));logger['debug'](_0xee59('0x10'),_0x3fc0d7,_0xee59('0xf'),JSON[_0xee59('0x11')](_0x1fcb37));if(_0x1fcb37['error']){if(_0x1fcb37[_0xee59('0x12')][_0xee59('0x13')]===0x1f4){logger[_0xee59('0x12')](_0xee59('0x14'),_0x3fc0d7,_0x1fcb37[_0xee59('0x12')][_0xee59('0x15')]);return _0x5f1d8c(_0x1fcb37[_0xee59('0x12')][_0xee59('0x15')]);}logger[_0xee59('0x12')](_0xee59('0x14'),_0x3fc0d7,_0x1fcb37[_0xee59('0x12')][_0xee59('0x15')]);return _0x2c94fb(_0x1fcb37['error'][_0xee59('0x15')]);}else{logger['info'](_0xee59('0x14'),_0x3fc0d7,_0xee59('0xf'));_0x2c94fb(_0x1fcb37[_0xee59('0x16')][_0xee59('0x15')]);}})[_0xee59('0x17')](function(_0x753eaf){logger[_0xee59('0x12')](_0xee59('0x14'),_0x3fc0d7,_0x753eaf);_0x5f1d8c(_0x753eaf);});});} \ No newline at end of file +var _0x984e=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x2168f8,_0x359007){var _0x8ec81a=function(_0x516c4b){while(--_0x516c4b){_0x2168f8['push'](_0x2168f8['shift']());}};_0x8ec81a(++_0x359007);}(_0x984e,0xdb));var _0xe984=function(_0x3f33bd,_0x570aeb){_0x3f33bd=_0x3f33bd-0x0;var _0x5c7677=_0x984e[_0x3f33bd];return _0x5c7677;};'use strict';var _=require('lodash');var util=require(_0xe984('0x0'));var moment=require(_0xe984('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe984('0x2'));var db=require(_0xe984('0x3'))['db'];var utils=require(_0xe984('0x4'));var logger=require(_0xe984('0x5'))(_0xe984('0x6'));var config=require(_0xe984('0x7'));var jayson=require(_0xe984('0x8'));var client=jayson['client'][_0xe984('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c7b55,_0x445515,_0x530733){return new BPromise(function(_0x4870ba,_0x40995d){return client[_0xe984('0xa')](_0x5c7b55,_0x530733)['then'](function(_0x547011){logger['info'](_0xe984('0xb'),_0x445515,_0xe984('0xc'));logger['debug'](_0xe984('0xd'),_0x445515,_0xe984('0xc'),JSON[_0xe984('0xe')](_0x547011));if(_0x547011[_0xe984('0xf')]){if(_0x547011[_0xe984('0xf')][_0xe984('0x10')]===0x1f4){logger[_0xe984('0xf')](_0xe984('0xb'),_0x445515,_0x547011['error'][_0xe984('0x11')]);return _0x40995d(_0x547011['error'][_0xe984('0x11')]);}logger['error'](_0xe984('0xb'),_0x445515,_0x547011[_0xe984('0xf')][_0xe984('0x11')]);return _0x4870ba(_0x547011[_0xe984('0xf')][_0xe984('0x11')]);}else{logger[_0xe984('0x12')](_0xe984('0xb'),_0x445515,_0xe984('0xc'));_0x4870ba(_0x547011['result'][_0xe984('0x11')]);}})[_0xe984('0x13')](function(_0x338786){logger[_0xe984('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x445515,_0x338786);_0x40995d(_0x338786);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 20d44ae..feabd6c 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3641=['name','join','Offline\x20apps:','status','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online'];(function(_0x46b04c,_0x30f846){var _0x3d799c=function(_0x43dc1d){while(--_0x43dc1d){_0x46b04c['push'](_0x46b04c['shift']());}};_0x3d799c(++_0x30f846);}(_0x3641,0x173));var _0x1364=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3641[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var db=require(_0x1364('0x0'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0x1364('0x1'));var config=require(_0x1364('0x2'));var logger=require('./config/logger')(_0x1364('0x3'));var pm2=require(_0x1364('0x4'));var pm2Config=require(_0x1364('0x5'));var schedule=require('./config/schedule');var chat=require(_0x1364('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x1364('0x7'));var provider=require(_0x1364('0x8'));function main(){return db[_0x1364('0x9')]['sync']()[_0x1364('0xa')](function(){if(config[_0x1364('0xb')]){return seedDb[_0x1364('0xc')]();}})[_0x1364('0xa')](function(){return checkLicense[_0x1364('0xc')]();})[_0x1364('0xa')](function(){return rpc[_0x1364('0xd')]();})[_0x1364('0xa')](function(_0x333290){logger[_0x1364('0xe')](_0x333290);return chat[_0x1364('0xf')]();})[_0x1364('0xa')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x1364('0xf')]();})[_0x1364('0xa')](function(){return transcribe[_0x1364('0xf')]();})[_0x1364('0xa')](function(){return provider[_0x1364('0xf')]();})['then'](function(_0x23152d){logger[_0x1364('0xe')](_0x23152d);return pm2['start'](pm2Config);})[_0x1364('0xa')](function(_0x245010){var _0x88fbd7=_0x245010[_0x1364('0x10')](function(_0x54c688){return typeof _0x54c688['exitCode']===_0x1364('0x11')&&_0x54c688[_0x1364('0x12')]>=0x0;});if(_0x88fbd7[_0x1364('0x13')]>0x0){throw new Error(_0x88fbd7[_0x1364('0x13')]+_0x1364('0x14')+_[_0x1364('0x15')](_0x88fbd7,function(_0x2ae4a1){return'\x22'+_0x2ae4a1[_0x1364('0x16')]['name']+'\x22';}));}logger['info'](_0x1364('0x17'),_['map'](_[_0x1364('0x10')](_0x245010,{'status':_0x1364('0x18')}),_0x1364('0x19'))[_0x1364('0x1a')]());logger['info'](_0x1364('0x1b'),_[_0x1364('0x15')](_[_0x1364('0x10')](_0x245010,function(_0x5de543){return _0x5de543[_0x1364('0x1c')]!==_0x1364('0x18');}),_0x1364('0x19'))[_0x1364('0x1a')]()||'None');console[_0x1364('0x1d')](_0x1364('0x1e'));})[_0x1364('0x1f')](function(_0x1b0eec){console[_0x1364('0x1d')](_0x1364('0x20'),_0x1b0eec);logger[_0x1364('0x21')](_0x1364('0x22'),_0x1b0eec);process[_0x1364('0x23')](0x1);});}main(); \ No newline at end of file +var _0x536e=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','default','listen','start','info','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','join','Offline\x20apps:','filter','status','online','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x536e,0x155));var _0xe536=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0x536e[_0x1e081a];return _0x428209;};'use strict';var _=require(_0xe536('0x0'));var db=require(_0xe536('0x1'))['db'];var seedDb=require(_0xe536('0x2'));var checkLicense=require(_0xe536('0x3'));var rpc=require(_0xe536('0x4'));var config=require(_0xe536('0x5'));var logger=require(_0xe536('0x6'))(_0xe536('0x7'));var pm2=require(_0xe536('0x8'));var pm2Config=require(_0xe536('0x9'));var schedule=require(_0xe536('0xa'));var chat=require(_0xe536('0xb'));var whatsapp=require(_0xe536('0xc'));var transcribe=require(_0xe536('0xd'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0xe536('0xe')]()[_0xe536('0xf')](function(){if(config['seedDB']){return seedDb[_0xe536('0x10')]();}})[_0xe536('0xf')](function(){return checkLicense[_0xe536('0x10')]();})[_0xe536('0xf')](function(){return rpc[_0xe536('0x11')]();})[_0xe536('0xf')](function(_0xe08ef0){logger['info'](_0xe08ef0);return chat['start']();})[_0xe536('0xf')](function(){return whatsapp[_0xe536('0x12')]();})['then'](function(){return schedule[_0xe536('0x12')]();})[_0xe536('0xf')](function(){return transcribe[_0xe536('0x12')]();})[_0xe536('0xf')](function(){return provider[_0xe536('0x12')]();})[_0xe536('0xf')](function(_0x498591){logger[_0xe536('0x13')](_0x498591);return pm2[_0xe536('0x12')](pm2Config);})[_0xe536('0xf')](function(_0x32e841){var _0x349020=_0x32e841['filter'](function(_0x410583){return typeof _0x410583[_0xe536('0x14')]===_0xe536('0x15')&&_0x410583['exitCode']>=0x0;});if(_0x349020[_0xe536('0x16')]>0x0){throw new Error(_0x349020[_0xe536('0x16')]+_0xe536('0x17')+_[_0xe536('0x18')](_0x349020,function(_0x4cf519){return'\x22'+_0x4cf519['pm2_env'][_0xe536('0x19')]+'\x22';}));}logger[_0xe536('0x13')](_0xe536('0x1a'),_[_0xe536('0x18')](_['filter'](_0x32e841,{'status':'online'}),_0xe536('0x19'))[_0xe536('0x1b')]());logger[_0xe536('0x13')](_0xe536('0x1c'),_[_0xe536('0x18')](_[_0xe536('0x1d')](_0x32e841,function(_0x3c3e82){return _0x3c3e82[_0xe536('0x1e')]!==_0xe536('0x1f');}),_0xe536('0x19'))[_0xe536('0x1b')]()||'None');console['log'](_0xe536('0x20'));})[_0xe536('0x21')](function(_0x5a034d){console['log'](_0xe536('0x22'),_0x5a034d);logger[_0xe536('0x23')](_0xe536('0x24'),_0x5a034d);process[_0xe536('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 20d30dd..4f6d513 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 _0x008c=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','sign','session','payload','options','promisify','verify','randomBytes','hex','floor','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','privacyEnabled','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','unmanaged','json','headers','startsWith','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x008c,0x188));var _0xc008=function(_0x51380e,_0x55b897){_0x51380e=_0x51380e-0x0;var _0x2ed390=_0x008c[_0x51380e];return _0x2ed390;};'use strict';var db=require(_0xc008('0x0'))['db'];var config=require(_0xc008('0x1'));var hardwareConf=require(_0xc008('0x2'));var licenseUtil=require(_0xc008('0x3'));var encryptor=require(_0xc008('0x4'));var _=require('lodash');var jwt=require(_0xc008('0x5'));var expressJwt=require(_0xc008('0x6'));var compose=require(_0xc008('0x7'));var basicAuth=require(_0xc008('0x8'));var crypto=require(_0xc008('0x9'));var BPromise=require(_0xc008('0xa'));var util=require(_0xc008('0xb'));var moment=require(_0xc008('0xc'));var validateJwt=expressJwt({'secret':config[_0xc008('0xd')]['session']});var userAttributes=['id',_0xc008('0xe'),'fullname',_0xc008('0xf'),'internal','email',_0xc008('0x10'),_0xc008('0x11'),'md5secret','voicePause','chatPause',_0xc008('0x12'),_0xc008('0x13'),'smsPause',_0xc008('0x14'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x17'),_0xc008('0x18'),_0xc008('0x19'),_0xc008('0x1a'),'passwordResetAt','alias',_0xc008('0x1b'),'phoneBarAutoAnswerDelay',_0xc008('0x1c'),_0xc008('0x1d'),_0xc008('0x1e'),_0xc008('0x1f'),_0xc008('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xc008('0x21'),_0xc008('0x22'),_0xc008('0x23'),_0xc008('0x24'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xc008('0x25'),_0xc008('0x26'),'selectRecallMeCampaign',_0xc008('0x27'),'chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer',_0xc008('0x28'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xc008('0x29')];exports[_0xc008('0x2a')]=function(){return this[_0xc008('0x2b')](!![])[_0xc008('0x2c')](function(_0x11cc75,_0x110128,_0x4f43e2){if(_0x11cc75[_0xc008('0x2d')]){_0x4f43e2();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x11cc75[_0xc008('0x2e')]['id']},'attributes':['id',_0xc008('0x2f'),_0xc008('0x30')],'raw':!![]})[_0xc008('0x31')](function(_0x5410f5){if(_0x5410f5&&_0x5410f5['closed']){return _0x110128['status'](_0x5410f5[_0xc008('0x30')]===_0xc008('0x32')?0x195:0x193)[_0xc008('0x33')]({'message':_0x5410f5[_0xc008('0x30')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x4f43e2();}})['catch'](function(_0x4caaf4){_0x4f43e2(_0x4caaf4);});}});};exports[_0xc008('0x2b')]=function isAuthenticated(_0x29ba43){return compose()[_0xc008('0x2c')](function(_0x529961,_0x24c14c,_0x32390d){var _0x209591;if(_0x529961[_0xc008('0x34')]['authorization']){if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],'Basic')){var _0x539766=basicAuth(_0x529961);db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'name':_0x539766[_0xc008('0xf')]}})[_0xc008('0x31')](function(_0x1de04b){if(!_0x1de04b||!_0x1de04b[_0xc008('0x38')](_0x539766[_0xc008('0x39')])){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x3b')});}_0x529961[_0xc008('0x2d')]={'id':_0x1de04b['id']};_0x32390d();})[_0xc008('0x3c')](function(_0x596ee8){_0x32390d(_0x596ee8);});}else if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],_0xc008('0x3d'))){validateJwt(_0x529961,_0x24c14c,_0x32390d);}else{if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}}}else if(_0x529961[_0xc008('0x3f')][_0xc008('0x40')]){try{var _0x7cfbc5={'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};verifyJwt(_0x529961['query'][_0xc008('0x40')],_0x7cfbc5)[_0xc008('0x31')](function(_0x459df4){return db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x459df4[_0xc008('0x42')]}})[_0xc008('0x31')](function(_0x5d0e06){_0x209591=_0x5d0e06;return db[_0xc008('0x43')][_0xc008('0x44')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc008('0x45')],'raw':!![]});})[_0xc008('0x31')](function(_0x5e38d5){if(!_0x209591||!_[_0xc008('0x46')](_0x209591[_0xc008('0x47')],_0x459df4[_0xc008('0x48')])){return _0x24c14c['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x209591[_0xc008('0x49')]){return _0x24c14c['status'](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}if(_0x209591[_0xc008('0x4b')]){if(_0x5e38d5[_0xc008('0x45')]>0x0){if(moment(_0x209591[_0xc008('0x4c')])[_0xc008('0x4d')](_0x5e38d5[_0xc008('0x45')],_0xc008('0x4e'))>moment()){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}else{return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}_0x529961['user']={'id':_0x209591['id']};_0x32390d();});})[_0xc008('0x3c')](function(){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});});}catch(_0x49a16d){_0x32390d(_0x49a16d);}}else if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}})[_0xc008('0x2c')](function(_0x2d142d,_0x5706bb,_0x398cdd){if(_0x2d142d[_0xc008('0x2d')]){db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x2d142d[_0xc008('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0xf4cc4b){if(!_0xf4cc4b){return _0x5706bb[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x4f')});}_0x2d142d['user']=_0xf4cc4b;_0x398cdd();})[_0xc008('0x3c')](function(_0xe37446){_0x398cdd(_0xe37446);});}else if(_0x29ba43){_0x398cdd();}else{return _0x5706bb[_0xc008('0x3a')](0x194)['json']({'message':_0xc008('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc008('0x2c')](function(_0x5d3a72,_0x46fa8f,_0x213014){return licenseUtil['getLicense']()[_0xc008('0x31')](function(_0x24ba0f){if(_0x24ba0f[_0xc008('0x51')]){_0x213014();}else{return _0x46fa8f['status'](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x44fc5d){_0x213014(_0x44fc5d);});});};exports[_0xc008('0x53')]=function isWebrtcLicence(){return compose()[_0xc008('0x2c')](function(_0x59ca2b,_0x47cafa,_0x5283a8){return licenseUtil[_0xc008('0x54')]()[_0xc008('0x31')](function(_0x103a83){if(_0x103a83[_0xc008('0x55')]){_0x5283a8();}else{return _0x47cafa[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x572593){_0x5283a8(_0x572593);});});};exports['isMiddleware']=function(_0x516e43,_0x2d5a49,_0x2651cf){_0x516e43[_0xc008('0x56')]=!![];return _0x2651cf();};exports['signToken']=function signToken(_0x28bc33){return signJwt(_0x28bc33);};exports[_0xc008('0x57')]=function(_0x17ab1a,_0x1c2c50){if(!_0x17ab1a[_0xc008('0x2d')]){return _0x1c2c50[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x58')});}var _0x3fd7d9={'payload':{'id':_0x17ab1a[_0xc008('0x2d')]['id'],'role':_0x17ab1a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd7d9)[_0xc008('0x31')](function(_0x51cb14){_0x1c2c50[_0xc008('0x59')](_0xc008('0x5a'),_0x51cb14);_0x1c2c50[_0xc008('0x5b')]('/dashboards/general');})[_0xc008('0x3c')](function(_0x32b435){return _0x1c2c50[_0xc008('0x3a')](0x1f4)[_0xc008('0x5c')](_0x32b435);});};exports[_0xc008('0x5d')]=function(_0x51105f){if(_[_0xc008('0x5e')](_0x51105f[_0xc008('0x47')])||_['isNil'](_0x51105f[_0xc008('0x5f')])){return null;}else{return createJwt(_0x51105f);}};exports[_0xc008('0x60')]=function(_0x5b5fbf){_0x5b5fbf['apiKeyNonce']=generateNonce();_0x5b5fbf[_0xc008('0x5f')]=generateIssuedAt();return createJwt(_0x5b5fbf);};exports[_0xc008('0x61')]=function(_0x20947b,_0x30d0aa){var _0x14b6a0=_0x20947b['query']['apikey'];if(_0x14b6a0){var _0x34b72a={'nonce':_0x30d0aa['apiKeyNonce'],'iat':_0x30d0aa[_0xc008('0x5f')],'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};return verifyJwt(_0x14b6a0,_0x34b72a)[_0xc008('0x31')](function(){return generateApiKey(_0x30d0aa);});}else{throw{'message':_0xc008('0x62')};}};exports[_0xc008('0x63')]=function(_0x49d8b0){var _0x2ea742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ea742[_0xc008('0x64')](_0x49d8b0))throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0xc008('0x67'));return;};exports['validatePasswordHistory']=function(_0x41fae3,_0x4fdab4,_0x535e6e){var _0x5dbfca=encryptor[_0xc008('0x68')](_0x4fdab4)[_0xc008('0x69')](',');for(var _0x5dfb69=0x0;_0x5dfb69<_0x535e6e;_0x5dfb69++){if(!_0x5dbfca[_0x5dfb69])break;if(_0x41fae3['toLowerCase']()===_0x5dbfca[_0x5dfb69][_0xc008('0x6a')]()){var _0x2d8361=util[_0xc008('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x535e6e);if(_0x535e6e===0x1){_0x2d8361=_0xc008('0x6c');}throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0x2d8361);}}return;};exports[_0xc008('0x6d')]=function(_0x5baff1,_0x4022dd){var _0x4eaa6d=_0x4022dd?encryptor[_0xc008('0x68')](_0x4022dd)[_0xc008('0x69')](','):[];if(_0x4eaa6d[_0xc008('0x6e')]===0x5){_0x4eaa6d[_0xc008('0x6f')](-0x1,0x1);}_0x4eaa6d[_0xc008('0x70')](_0x5baff1);return encryptor[_0xc008('0x71')](_0x4eaa6d['join'](','));};function signJwt(_0x375e71){var _0x570001=BPromise['promisify'](jwt[_0xc008('0x72')],{'context':jwt});var _0x30aa1e=_0x375e71['secret']||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x3e373e,_0x4517c0){_0x570001(_0x375e71[_0xc008('0x74')],_0x30aa1e,_0x375e71[_0xc008('0x75')])[_0xc008('0x31')](function(_0x57ce9a){_0x3e373e(_0x57ce9a);})[_0xc008('0x3c')](function(_0x462e1e){_0x4517c0(_0x462e1e);});});}function verifyJwt(_0x3bfb15,_0x2a60e6,_0xb3ca0f){var _0x167425=BPromise[_0xc008('0x76')](jwt[_0xc008('0x77')],{'context':jwt});var _0xbc430a=_0xb3ca0f||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x2b5eb6,_0x131b81){_0x167425(_0x3bfb15,_0xbc430a,_0x2a60e6)[_0xc008('0x31')](function(_0x4e0251){_0x2b5eb6(_0x4e0251);})[_0xc008('0x3c')](function(_0x2e5467){_0x131b81(_0x2e5467);});});}function generateNonce(){return crypto[_0xc008('0x78')](0x10)['toString'](_0xc008('0x79'));}function generateIssuedAt(){return Math[_0xc008('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1a03fd){var _0x2a4c2b={'payload':{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd[_0xc008('0x47')]},'options':{'algorithm':_0xc008('0x7b'),'subject':_0x1a03fd['id'][_0xc008('0x7c')](),'issuer':hardwareConf[_0xc008('0x41')](),'audience':hardwareConf[_0xc008('0x41')]()}};return signJwt(_0x2a4c2b)[_0xc008('0x31')](function(_0x1b059b){return{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd['apiKeyNonce'],'token':_0x1b059b};});} \ No newline at end of file +var _0x54ef=['../../config/license/hardware','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','moment','secrets','session','fullname','internal','email','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','headers','authorization','Basic','User','find','name','authenticate','Wrong\x20credentials.','catch','startsWith','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','disabled','blocked','blockDuration','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','payload','options','toString','hex','floor','HS512','../../mysqldb','../../config/environment'];(function(_0x1f8784,_0x285f48){var _0x2a4e3e=function(_0x25ec00){while(--_0x25ec00){_0x1f8784['push'](_0x1f8784['shift']());}};_0x2a4e3e(++_0x285f48);}(_0x54ef,0x112));var _0xf54e=function(_0x218439,_0x595bad){_0x218439=_0x218439-0x0;var _0x1fa5c5=_0x54ef[_0x218439];return _0x1fa5c5;};'use strict';var db=require(_0xf54e('0x0'))['db'];var config=require(_0xf54e('0x1'));var hardwareConf=require(_0xf54e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf54e('0x3'));var _=require(_0xf54e('0x4'));var jwt=require(_0xf54e('0x5'));var expressJwt=require(_0xf54e('0x6'));var compose=require(_0xf54e('0x7'));var basicAuth=require(_0xf54e('0x8'));var crypto=require(_0xf54e('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require(_0xf54e('0xa'));var validateJwt=expressJwt({'secret':config[_0xf54e('0xb')][_0xf54e('0xc')]});var userAttributes=['id','role',_0xf54e('0xd'),'name',_0xf54e('0xe'),_0xf54e('0xf'),'userpic',_0xf54e('0x10'),_0xf54e('0x11'),_0xf54e('0x12'),_0xf54e('0x13'),'mailPause',_0xf54e('0x14'),_0xf54e('0x15'),_0xf54e('0x16'),_0xf54e('0x17'),'showWebBar',_0xf54e('0x18'),'lastPauseAt','crudPermissions',_0xf54e('0x19'),_0xf54e('0x1a'),_0xf54e('0x1b'),_0xf54e('0x1c'),'phoneBarAutoAnswerDelay',_0xf54e('0x1d'),_0xf54e('0x1e'),_0xf54e('0x1f'),_0xf54e('0x20'),'phoneBarExpires',_0xf54e('0x21'),_0xf54e('0x22'),_0xf54e('0x23'),'hotdesk','interface',_0xf54e('0x24'),_0xf54e('0x25'),_0xf54e('0x26'),_0xf54e('0x27'),_0xf54e('0x28'),_0xf54e('0x29'),_0xf54e('0x2a'),_0xf54e('0x2b'),_0xf54e('0x2c'),_0xf54e('0x2d'),_0xf54e('0x2e'),'emailAutoanswer','emailAutoanswerDelay',_0xf54e('0x2f'),'smsAutoanswerDelay',_0xf54e('0x30'),_0xf54e('0x31'),_0xf54e('0x32'),_0xf54e('0x33'),_0xf54e('0x34'),_0xf54e('0x35')];exports[_0xf54e('0x36')]=function(){return this[_0xf54e('0x37')](!![])[_0xf54e('0x38')](function(_0x5f9eea,_0x1c58bd,_0x5b83df){if(_0x5f9eea[_0xf54e('0x39')]){_0x5b83df();}else{return db['ChatInteraction'][_0xf54e('0x3a')]({'where':{'id':_0x5f9eea[_0xf54e('0x3b')]['id']},'attributes':['id',_0xf54e('0x3c'),_0xf54e('0x3d')],'raw':!![]})[_0xf54e('0x3e')](function(_0x160160){if(_0x160160&&_0x160160[_0xf54e('0x3c')]){return _0x1c58bd[_0xf54e('0x3f')](_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?0x195:0x193)[_0xf54e('0x41')]({'message':_0x160160[_0xf54e('0x3d')]===_0xf54e('0x40')?'Unmanaged.':_0xf54e('0x42')});}else{_0x5b83df();}})['catch'](function(_0x282c63){_0x5b83df(_0x282c63);});}});};exports['isAuthenticated']=function isAuthenticated(_0x15b888){return compose()[_0xf54e('0x38')](function(_0x21ba00,_0xa13cd0,_0x25b643){var _0x3993e4;if(_0x21ba00[_0xf54e('0x43')]['authorization']){if(_['startsWith'](_0x21ba00[_0xf54e('0x43')][_0xf54e('0x44')],_0xf54e('0x45'))){var _0x16d00f=basicAuth(_0x21ba00);db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'name':_0x16d00f[_0xf54e('0x48')]}})[_0xf54e('0x3e')](function(_0x3ae704){if(!_0x3ae704||!_0x3ae704[_0xf54e('0x49')](_0x16d00f['pass'])){return _0xa13cd0['status'](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x4a')});}_0x21ba00['user']={'id':_0x3ae704['id']};_0x25b643();})[_0xf54e('0x4b')](function(_0x82e313){_0x25b643(_0x82e313);});}else if(_[_0xf54e('0x4c')](_0x21ba00[_0xf54e('0x43')]['authorization'],'Bearer')){validateJwt(_0x21ba00,_0xa13cd0,_0x25b643);}else{if(_0x15b888){_0x25b643();}else{return _0xa13cd0['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x4d')});}}}else if(_0x21ba00[_0xf54e('0x4e')][_0xf54e('0x4f')]){try{var _0x29dc39={'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x21ba00['query']['apikey'],_0x29dc39)[_0xf54e('0x3e')](function(_0x734187){return db['User']['find']({'where':{'id':_0x734187[_0xf54e('0x51')]}})[_0xf54e('0x3e')](function(_0x173e6c){_0x3993e4=_0x173e6c;return db['Setting'][_0xf54e('0x3a')]({'where':{'id':0x1},'attributes':[_0xf54e('0x52'),'blockDuration'],'raw':!![]});})[_0xf54e('0x3e')](function(_0x6e5bdf){if(!_0x3993e4||!_[_0xf54e('0x53')](_0x3993e4[_0xf54e('0x54')],_0x734187[_0xf54e('0x55')])){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x3993e4[_0xf54e('0x56')]){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x3993e4[_0xf54e('0x57')]){if(_0x6e5bdf[_0xf54e('0x58')]>0x0){if(moment(_0x3993e4[_0xf54e('0x59')])[_0xf54e('0x5a')](_0x6e5bdf[_0xf54e('0x58')],_0xf54e('0x5b'))>moment()){return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}else{return _0xa13cd0[_0xf54e('0x3f')](0x191)[_0xf54e('0x41')]({'message':_0xf54e('0x5c')});}}_0x21ba00[_0xf54e('0x39')]={'id':_0x3993e4['id']};_0x25b643();});})[_0xf54e('0x4b')](function(){return _0xa13cd0[_0xf54e('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x533423){_0x25b643(_0x533423);}}else if(_0x15b888){_0x25b643();}else{return _0xa13cd0[_0xf54e('0x3f')](0x193)[_0xf54e('0x41')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf54e('0x38')](function(_0x311ce1,_0x381c03,_0x4f61d7){if(_0x311ce1[_0xf54e('0x39')]){db[_0xf54e('0x46')][_0xf54e('0x47')]({'where':{'id':_0x311ce1[_0xf54e('0x39')]['id']},'attributes':userAttributes})[_0xf54e('0x3e')](function(_0x143a39){if(!_0x143a39){return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5d')});}_0x311ce1['user']=_0x143a39;_0x4f61d7();})[_0xf54e('0x4b')](function(_0x3447fd){_0x4f61d7(_0x3447fd);});}else if(_0x15b888){_0x4f61d7();}else{return _0x381c03[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x5e')});}});};exports[_0xf54e('0x5f')]=function canUpdate(){return compose()['use'](function(_0x23a4a1,_0x59af72,_0x1d16e0){return licenseUtil['getLicense']()[_0xf54e('0x3e')](function(_0x331b16){if(_0x331b16[_0xf54e('0x60')]){_0x1d16e0();}else{return _0x59af72['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0x32fb46){_0x1d16e0(_0x32fb46);});});};exports[_0xf54e('0x62')]=function isWebrtcLicence(){return compose()['use'](function(_0x427799,_0x297737,_0x346bb4){return licenseUtil[_0xf54e('0x63')]()['then'](function(_0x1bdb5a){if(_0x1bdb5a[_0xf54e('0x64')]){_0x346bb4();}else{return _0x297737['status'](0x193)[_0xf54e('0x41')]({'message':_0xf54e('0x61')});}})[_0xf54e('0x4b')](function(_0xca0141){_0x346bb4(_0xca0141);});});};exports['isMiddleware']=function(_0x196e68,_0x2b645e,_0x2527f6){_0x196e68[_0xf54e('0x65')]=!![];return _0x2527f6();};exports[_0xf54e('0x66')]=function signToken(_0x3237ef){return signJwt(_0x3237ef);};exports[_0xf54e('0x67')]=function(_0xd7b0c5,_0x15bfef){if(!_0xd7b0c5[_0xf54e('0x39')]){return _0x15bfef[_0xf54e('0x3f')](0x194)[_0xf54e('0x41')]({'message':_0xf54e('0x68')});}var _0x2de1fe={'payload':{'id':_0xd7b0c5[_0xf54e('0x39')]['id'],'role':_0xd7b0c5[_0xf54e('0x39')][_0xf54e('0x69')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2de1fe)[_0xf54e('0x3e')](function(_0x21fd80){_0x15bfef[_0xf54e('0x6a')]('motion.token',_0x21fd80);_0x15bfef['redirect'](_0xf54e('0x6b'));})[_0xf54e('0x4b')](function(_0x45861b){return _0x15bfef[_0xf54e('0x3f')](0x1f4)[_0xf54e('0x6c')](_0x45861b);});};exports[_0xf54e('0x6d')]=function(_0x22763f){if(_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x54')])||_[_0xf54e('0x6e')](_0x22763f[_0xf54e('0x6f')])){return null;}else{return createJwt(_0x22763f);}};exports['generateApiKey']=function(_0x2aacf6){_0x2aacf6[_0xf54e('0x54')]=generateNonce();_0x2aacf6[_0xf54e('0x6f')]=generateIssuedAt();return createJwt(_0x2aacf6);};exports[_0xf54e('0x70')]=function(_0x1b8f16,_0x30f53b){var _0x18a25f=_0x1b8f16['query'][_0xf54e('0x4f')];if(_0x18a25f){var _0x5fabd2={'nonce':_0x30f53b[_0xf54e('0x54')],'iat':_0x30f53b['apiKeyIat'],'audience':hardwareConf[_0xf54e('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x18a25f,_0x5fabd2)[_0xf54e('0x3e')](function(){return generateApiKey(_0x30f53b);});}else{throw{'message':_0xf54e('0x71')};}};exports[_0xf54e('0x72')]=function(_0x5b882f){var _0x1d8ccf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8ccf[_0xf54e('0x73')](_0x5b882f))throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0xf54e('0x76'));return;};exports[_0xf54e('0x77')]=function(_0x21d485,_0x55d57f,_0x55de5c){var _0x4270e1=encryptor[_0xf54e('0x78')](_0x55d57f)['split'](',');for(var _0x29743e=0x0;_0x29743e<_0x55de5c;_0x29743e++){if(!_0x4270e1[_0x29743e])break;if(_0x21d485['toLowerCase']()===_0x4270e1[_0x29743e][_0xf54e('0x79')]()){var _0x528a64=util[_0xf54e('0x7a')](_0xf54e('0x7b'),_0x55de5c);if(_0x55de5c===0x1){_0x528a64=_0xf54e('0x7c');}throw new db[(_0xf54e('0x74'))][(_0xf54e('0x75'))](_0x528a64);}}return;};exports[_0xf54e('0x7d')]=function(_0x556e55,_0x479572){var _0x79345=_0x479572?encryptor[_0xf54e('0x78')](_0x479572)['split'](','):[];if(_0x79345['length']===0x5){_0x79345[_0xf54e('0x7e')](-0x1,0x1);}_0x79345['unshift'](_0x556e55);return encryptor[_0xf54e('0x7f')](_0x79345[_0xf54e('0x80')](','));};function signJwt(_0x47596c){var _0x2b11f8=BPromise[_0xf54e('0x81')](jwt[_0xf54e('0x82')],{'context':jwt});var _0x3bf476=_0x47596c[_0xf54e('0x83')]||config[_0xf54e('0xb')][_0xf54e('0xc')];return new BPromise(function(_0x1f9dad,_0x2c6d0e){_0x2b11f8(_0x47596c[_0xf54e('0x84')],_0x3bf476,_0x47596c[_0xf54e('0x85')])['then'](function(_0x302f3d){_0x1f9dad(_0x302f3d);})[_0xf54e('0x4b')](function(_0xb7ff4d){_0x2c6d0e(_0xb7ff4d);});});}function verifyJwt(_0x11908b,_0x1e4c0d,_0x494629){var _0xf50b1b=BPromise[_0xf54e('0x81')](jwt['verify'],{'context':jwt});var _0x51ec35=_0x494629||config[_0xf54e('0xb')]['session'];return new BPromise(function(_0x26322a,_0x39c5eb){_0xf50b1b(_0x11908b,_0x51ec35,_0x1e4c0d)[_0xf54e('0x3e')](function(_0x9789b9){_0x26322a(_0x9789b9);})['catch'](function(_0x2ecda1){_0x39c5eb(_0x2ecda1);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xf54e('0x86')](_0xf54e('0x87'));}function generateIssuedAt(){return Math[_0xf54e('0x88')](Date['now']()/0x3e8)[_0xf54e('0x86')]();}function createJwt(_0x504ec7){var _0x3f7224={'payload':{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce']},'options':{'algorithm':_0xf54e('0x89'),'subject':_0x504ec7['id']['toString'](),'issuer':hardwareConf[_0xf54e('0x50')](),'audience':hardwareConf[_0xf54e('0x50')]()}};return signJwt(_0x3f7224)[_0xf54e('0x3e')](function(_0x38405c){return{'iat':_0x504ec7[_0xf54e('0x6f')],'nonce':_0x504ec7['apiKeyNonce'],'token':_0x38405c};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 539e9eb..de54899 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 _0x6376=['skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','where','default','user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','rows','catch','describe','CmContact','keys','filter','startsWith','cf_','map','findOne','slice','all','length','fieldType','type','lodash','findAll'];(function(_0x2c1eab,_0x34c82a){var _0x1ac367=function(_0x58d375){while(--_0x58d375){_0x2c1eab['push'](_0x2c1eab['shift']());}};_0x1ac367(++_0x34c82a);}(_0x6376,0xe2));var _0x6637=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6376[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x6637('0x0'));var sqlUtils=require('./sql-utils');var db=require('../../mysqldb')['db'];exports[_0x6637('0x1')]=function(_0x5abdb7,_0xac468d,_0x1cc3aa,_0x42338f){var _0x4accf5={'count':0x0,'rows':[]};var _0x3af3e3=sqlUtils[_0x6637('0x2')](_0xac468d,_0x5abdb7);if(_0x3af3e3){return Promise[_0x6637('0x3')](_0x4accf5);}var _0x5ca282=sqlUtils[_0x6637('0x4')]();var _0x4e02ac={};var _0x49af8a=![];var _0x535fb2=![];return Promise['resolve']()[_0x6637('0x5')](function(){if(_0x5abdb7[_0x6637('0x6')]){return sqlUtils[_0x6637('0x7')](_0x5abdb7[_0x6637('0x6')],_0x42338f);}else{return sqlUtils['parseQueryParameters'](_0x5abdb7,_0x42338f);}})[_0x6637('0x5')](function(_0x257461){_0x5ca282[_0x6637('0x8')](_0x257461[_0x6637('0x9')]);_0x5ca282[_0x6637('0x8')](_0x257461['fields']);_0x5ca282['where'](_0x257461['filter']);_0x5ca282[_0x6637('0x8')](_0x257461[_0x6637('0xa')][_0x6637('0xb')]);_0x4e02ac=_0x257461[_0x6637('0xc')];_0x535fb2=_0x257461[_0x6637('0xa')][_0x6637('0xd')];return sqlUtils[_0x6637('0xe')](_0xac468d,_0x5abdb7,_0x535fb2);})[_0x6637('0x5')](function(_0xe49dcb){_0x5ca282[_0x6637('0x8')](_0xe49dcb);var _0x24f105=_0x5abdb7[_0x6637('0x6')]?_0x4e02ac[_0x6637('0xf')]:_0x5abdb7[_0x6637('0x10')];_0x49af8a=_0x24f105?!![]:![];return sqlUtils[_0x6637('0x11')](_0x5ca282,_0x24f105);})[_0x6637('0x5')](function(_0x3b9009){_0x4accf5[_0x6637('0x12')]=_0x3b9009;if(_0x4accf5['count']===0x0){return;}if(_0x5abdb7[_0x6637('0x13')]){_0x535fb2=!![];}return sqlUtils[_0x6637('0x14')](_0x5ca282,_0x5abdb7[_0x6637('0x15')],_0x1cc3aa,_0x49af8a,_0x4e02ac[_0x6637('0xb')],_0x535fb2);})[_0x6637('0x5')](function(_0x509dbb){if(!_0x509dbb){return[];}return sqlUtils[_0x6637('0x16')](_0x509dbb,_0x5abdb7,_0x1cc3aa);})[_0x6637('0x5')](function(_0x640101){_0x4accf5[_0x6637('0x17')]=_0x640101;return _0x4accf5;})[_0x6637('0x18')](function(_0x23c706){throw _0x23c706;});};exports[_0x6637('0x19')]=function(){var _0x497f85={};var _0x463eff=[];return db[_0x6637('0x1a')]['describe']()[_0x6637('0x5')](function(_0x3be935){_0x497f85=_0x3be935;var _0x4f4996=Object[_0x6637('0x1b')](_0x497f85)[_0x6637('0x1c')](function(_0x520b46){return _[_0x6637('0x1d')](_0x520b46,_0x6637('0x1e'))?_0x520b46:undefined;});var _0x1d8933=_0x4f4996[_0x6637('0x1f')](function(_0x434220){return db['CmCustomField'][_0x6637('0x20')]({'where':{'id':_0x434220[_0x6637('0x21')](0x3)},'raw':!![]});});return Promise[_0x6637('0x22')](_0x1d8933);})['then'](function(_0x521472){for(var _0x38339c=0x0;_0x38339c<_0x521472[_0x6637('0x23')];_0x38339c++){if(_0x521472[_0x38339c]){var _0xf0c561=_0x6637('0x1e')+_0x521472[_0x38339c]['id'];_0x497f85[_0xf0c561][_0x6637('0x24')]=_0x521472[_0x38339c][_0x6637('0x25')];}}_0x463eff=_[_0x6637('0x1f')](Object['keys'](_0x497f85),function(_0x530003){return{'name':_0x530003,'type':_0x497f85[_0x530003]['type']};});return _0x463eff;})[_0x6637('0x18')](function(_0x4108cd){throw _0x4108cd;});}; \ No newline at end of file +var _0x2b07=['getFilteredContacts','rows','catch','describe','startsWith','cf_','map','CmCustomField','findOne','all','length','fieldType','type','keys','lodash','./sql-utils','../../mysqldb','skipContactsQuery','getContactsSubquery','search','parseAdvancedSearchFilter','then','where','default','fields','filter','clause','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','User','buildContactsQuery'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x2b07,0x103));var _0x72b0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2b07[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x72b0('0x0'));var sqlUtils=require(_0x72b0('0x1'));var db=require(_0x72b0('0x2'))['db'];exports['findAll']=function(_0xce2917,_0x23acca,_0x4b30b1,_0x206985){var _0x153a43={'count':0x0,'rows':[]};var _0x566456=sqlUtils[_0x72b0('0x3')](_0x23acca,_0xce2917);if(_0x566456){return Promise['resolve'](_0x153a43);}var _0x2f246d=sqlUtils[_0x72b0('0x4')]();var _0x446873={};var _0x1b88b5=![];var _0x4d0af1=![];return Promise['resolve']()['then'](function(){if(_0xce2917[_0x72b0('0x5')]){return sqlUtils[_0x72b0('0x6')](_0xce2917[_0x72b0('0x5')],_0x206985);}else{return sqlUtils['parseQueryParameters'](_0xce2917,_0x206985);}})[_0x72b0('0x7')](function(_0x74bf75){_0x2f246d[_0x72b0('0x8')](_0x74bf75[_0x72b0('0x9')]);_0x2f246d[_0x72b0('0x8')](_0x74bf75[_0x72b0('0xa')]);_0x2f246d[_0x72b0('0x8')](_0x74bf75[_0x72b0('0xb')]);_0x2f246d[_0x72b0('0x8')](_0x74bf75['user'][_0x72b0('0xc')]);_0x446873=_0x74bf75['tags'];_0x4d0af1=_0x74bf75['user'][_0x72b0('0xd')];return sqlUtils[_0x72b0('0xe')](_0x23acca,_0xce2917,_0x4d0af1);})[_0x72b0('0x7')](function(_0x3cbd1e){_0x2f246d[_0x72b0('0x8')](_0x3cbd1e);var _0x9bd98b=_0xce2917['search']?_0x446873[_0x72b0('0xf')]:_0xce2917[_0x72b0('0x10')];_0x1b88b5=_0x9bd98b?!![]:![];return sqlUtils[_0x72b0('0x11')](_0x2f246d,_0x9bd98b);})['then'](function(_0x2293be){_0x153a43[_0x72b0('0x12')]=_0x2293be;if(_0x153a43[_0x72b0('0x12')]===0x0){return;}if(_0xce2917[_0x72b0('0x13')]){_0x4d0af1=!![];}return sqlUtils[_0x72b0('0x14')](_0x2f246d,_0xce2917[_0x72b0('0xa')],_0x4b30b1,_0x1b88b5,_0x446873[_0x72b0('0xc')],_0x4d0af1);})[_0x72b0('0x7')](function(_0x191dae){if(!_0x191dae){return[];}return sqlUtils[_0x72b0('0x15')](_0x191dae,_0xce2917,_0x4b30b1);})['then'](function(_0x1e3951){_0x153a43[_0x72b0('0x16')]=_0x1e3951;return _0x153a43;})[_0x72b0('0x17')](function(_0x2b9e94){throw _0x2b9e94;});};exports[_0x72b0('0x18')]=function(){var _0x83c533={};var _0x72c7c5=[];return db['CmContact'][_0x72b0('0x18')]()[_0x72b0('0x7')](function(_0x3fbad1){_0x83c533=_0x3fbad1;var _0x286c89=Object['keys'](_0x83c533)[_0x72b0('0xb')](function(_0x307926){return _[_0x72b0('0x19')](_0x307926,_0x72b0('0x1a'))?_0x307926:undefined;});var _0xed095f=_0x286c89[_0x72b0('0x1b')](function(_0x2646e9){return db[_0x72b0('0x1c')][_0x72b0('0x1d')]({'where':{'id':_0x2646e9['slice'](0x3)},'raw':!![]});});return Promise[_0x72b0('0x1e')](_0xed095f);})[_0x72b0('0x7')](function(_0x7eff39){for(var _0x483932=0x0;_0x483932<_0x7eff39[_0x72b0('0x1f')];_0x483932++){if(_0x7eff39[_0x483932]){var _0x4ef20f=_0x72b0('0x1a')+_0x7eff39[_0x483932]['id'];_0x83c533[_0x4ef20f][_0x72b0('0x20')]=_0x7eff39[_0x483932][_0x72b0('0x21')];}}_0x72c7c5=_[_0x72b0('0x1b')](Object[_0x72b0('0x22')](_0x83c533),function(_0x1bb9be){return{'name':_0x1bb9be,'type':_0x83c533[_0x1bb9be][_0x72b0('0x21')]};});return _0x72c7c5;})['catch'](function(_0x2f0ca5){throw _0x2f0ca5;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 0aaee14..e514cc0 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 _0x9c43=['c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','CompanyId','createdAt','updatedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','type','text','value','start','end','Tag','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','map','some','Contact'];(function(_0xccc0d4,_0x2f6bf7){var _0x27a653=function(_0x285e63){while(--_0x285e63){_0xccc0d4['push'](_0xccc0d4['shift']());}};_0x27a653(++_0x2f6bf7);}(_0x9c43,0x157));var _0x39c4=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x9c43[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require(_0x39c4('0x0'));var squel=require(_0x39c4('0x1'));var as=require(_0x39c4('0x2'));var qs=require(_0x39c4('0x3'));var utils=require(_0x39c4('0x4'));var db=require(_0x39c4('0x5'))['db'];function skipContactsQuery(_0x22fbbf,_0x1bc7ba){var _0x2a64c3=![];if(_0x22fbbf[_0x39c4('0x6')]===_0x39c4('0x7')&&!_0x1bc7ba[_0x39c4('0x8')]&&!_0x1bc7ba[_0x39c4('0x9')]&&_0x1bc7ba[_0x39c4('0xa')]!=='true'){_0x2a64c3=!![];}return _0x2a64c3;}function getContactsSubquery(){return squel[_0x39c4('0xb')]()[_0x39c4('0xc')](_0x39c4('0xd'),'c')[_0x39c4('0xe')](_0x39c4('0xf'));}function applyJoinClauses(_0x4226c1,_0x4e9d08){var _0x4ae2f4=_0x4e9d08?'c':_0x39c4('0x10');_0x4226c1[_0x39c4('0x11')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x4ae2f4+'.id')[_0x39c4('0x11')](_0x39c4('0x12'),'ct',_0x39c4('0x13')+_0x4ae2f4+_0x39c4('0x14'))['left_join']('tools_tags','t',_0x39c4('0x15'));return _0x4226c1;}function addFieldsToQuery(_0x10da0f,_0x4af6bd,_0x3a2578,_0x5813ae,_0xbd06a3){var _0x3a3aed=_0xbd06a3?'c':'subqry';if(!_0x4af6bd){_0x4af6bd=['id',_0x39c4('0x16'),_0x39c4('0x17'),'phone',_0x39c4('0x18'),_0x39c4('0x19'),'email','ListId',_0x39c4('0x1a'),_0x39c4('0x1b'),_0x39c4('0x1c'),'deletedAt','TagIds'];}else if(!_0x4af6bd[_0x39c4('0x1d')]('id')){_0x4af6bd[_0x39c4('0x1e')]('id');}var _0x298540=_0x3a2578&&_0xbd06a3||!_0x3a2578&&!_0xbd06a3;if(_0x5813ae){_0x298540=_0x5813ae&&_0xbd06a3||!_0x5813ae&&!_0xbd06a3;}_0x4af6bd[_0x39c4('0x1f')](function(_0x515b68){if(_0x515b68===_0x39c4('0x20')){if(_0x298540){_0x10da0f[_0x39c4('0x21')](_0x39c4('0x22'),_0x515b68);}else if(_0x3a2578||_0x5813ae){_0x10da0f[_0x39c4('0x21')](_0x3a3aed+'.'+_0x515b68);}}else{_0x10da0f[_0x39c4('0x21')](_0x3a3aed+'.'+_0x515b68);}});return _0x10da0f;}function getSqlClauses(){var _0x5a0fd9={'default':squel[_0x39c4('0x23')](),'fields':squel[_0x39c4('0x23')](),'filter':squel[_0x39c4('0x23')](),'tags':{'clause':squel[_0x39c4('0x23')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x5a0fd9;}function parseTagParameter(_0x510366){var _0x3efaab=squel[_0x39c4('0x23')]();if(_0x510366){var _0x520890=utils[_0x39c4('0x24')](_0x510366);_0x520890[_0x39c4('0x1f')](function(_0x163b7d){_0x3efaab['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x163b7d+',%');});}return _0x3efaab;}function parseSearchFilter(_0x53a22f){var _0x2d1649=squel['expr']();if(_0x53a22f){var _0x4be5e6=_0x53a22f[_0x39c4('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4be5e6[_0x39c4('0x26')]('\x20')[_0x39c4('0x27')]>0x1){_0x2d1649['or'](_0x39c4('0x28'),qs['getFullTextValue'](_0x4be5e6,!![]),null);}else{if(qs['isNumeric'](_0x4be5e6)){_0x2d1649['or'](_0x39c4('0x29'),_0x4be5e6+'%');_0x2d1649['or']('c.phone\x20LIKE\x20?',_0x4be5e6+'%');_0x2d1649['or'](_0x39c4('0x2a'),_0x4be5e6+'%');_0x2d1649['or']('c.fax\x20LIKE\x20?',_0x4be5e6+'%');}else if(qs[_0x39c4('0x2b')](_0x4be5e6)){_0x2d1649['or'](_0x39c4('0x2c'),_0x4be5e6+'%');}else{_0x2d1649['or']('c.firstName\x20LIKE\x20?','%'+_0x4be5e6+'%');_0x2d1649['or'](_0x39c4('0x2d'),'%'+_0x4be5e6+'%');_0x2d1649['or'](_0x39c4('0x2c'),'%'+_0x4be5e6+'%');}}}return _0x2d1649;}function parseAdvancedSearchFilter(_0xc453da,_0x161764){var _0x5a7c7e=getSqlClauses();var _0x39ccc7=as[_0x39c4('0x2e')](_0xc453da);var _0x2bce37=_0x39ccc7[_0x39c4('0x2f')];for(var _0x3a27b1=0x0;_0x3a27b1<_0x39ccc7[_0x39c4('0x30')][_0x39c4('0x27')];_0x3a27b1++){var _0x2598f2=_0x39ccc7[_0x39c4('0x30')][_0x3a27b1];var _0x1a1399='c';var _0x4d4524=_[_0x39c4('0x31')](_0x161764,[_0x39c4('0x32'),_0x2598f2[_0x39c4('0x21')]]);if(_0x4d4524){if(_0x2598f2['field']===_0x39c4('0x33')||_0x4d4524[_0x39c4('0x34')]===_0x39c4('0x35')){_0x2598f2[_0x39c4('0x36')]=_0x39c4('0x37');}var _0xce61de=as['buildExpression'](_0x1a1399,_0x4d4524[_0x39c4('0x38')],_0x2598f2);_0x5a7c7e['default'][_0x2bce37](_0xce61de[_0x39c4('0x39')],_0xce61de[_0x39c4('0x3a')][_0x39c4('0x3b')],_0xce61de['value'][_0x39c4('0x3c')]);}else{if(_0x2598f2[_0x39c4('0x21')]===_0x39c4('0x3d')){var _0x427bab=_0x2598f2['value']['split'](',')['map'](function(_0x54d70a){return Number(_0x54d70a);});var _0x2e3fd7=parseTagParameter(_0x427bab);_0x5a7c7e[_0x39c4('0x3e')][_0x39c4('0x3f')][_0x39c4('0x40')](_0x2e3fd7);_0x5a7c7e[_0x39c4('0x3e')][_0x39c4('0x41')]=_0x427bab;}else if(_0x2598f2[_0x39c4('0x21')]===_0x39c4('0x42')){_0x5a7c7e[_0x39c4('0x43')][_0x39c4('0x3f')][_0x39c4('0x40')](_0x39c4('0x44'),_0x2598f2[_0x39c4('0x3a')]);_0x5a7c7e[_0x39c4('0x43')][_0x39c4('0x45')]=!![];}}}return _0x5a7c7e;}function parseModelFields(_0x11fe8a,_0x5713db){var _0x4238fe=squel[_0x39c4('0x23')]();var _0xeed2ce=_(_0x11fe8a)['keys']()[_0x39c4('0x46')](function(_0x1a3086){return _[_0x39c4('0x47')](_0x5713db,[_0x39c4('0x32'),_0x1a3086])?_0x1a3086:undefined;})['compact']()[_0x39c4('0x3a')]();if(_0x11fe8a[_0x39c4('0x48')]){_0xeed2ce[_0x39c4('0x1e')](_0x39c4('0x48'));}if(_0x11fe8a['User']){_0xeed2ce[_0x39c4('0x1e')]('User');}if(_0xeed2ce[_0x39c4('0x27')]>0x0){_0xeed2ce[_0x39c4('0x1f')](function(_0x5591fc){if(_0x5591fc==='ListId'){_0x4238fe[_0x39c4('0x40')](_0x39c4('0x49'),[]['concat'](_0x11fe8a[_0x5591fc]));}else if(_0x5591fc===_0x39c4('0x48')){var _0x24f88b='%'+_0x11fe8a[_0x5591fc]+'%';_0x4238fe[_0x39c4('0x40')](_0x39c4('0x4a'),_0x24f88b);}else if(_0x5591fc===_0x39c4('0x42')){_0x4238fe[_0x39c4('0x40')](_0x39c4('0x44'),_0x11fe8a[_0x5591fc]);}else{_0x4238fe[_0x39c4('0x40')]('c.'+_0x5591fc+_0x39c4('0x4b'),_0x11fe8a[_0x5591fc]);}});}return _0x4238fe;}function parseQueryParameters(_0x4781ad,_0x4a1831){var _0x2c9396=getSqlClauses();return Promise[_0x39c4('0x4c')]()[_0x39c4('0x4d')](function(){return parseModelFields(_0x4781ad,_0x4a1831);})[_0x39c4('0x4d')](function(_0x243f92){_0x2c9396['fields'][_0x39c4('0x40')](_0x243f92);return parseTagParameter(_0x4781ad[_0x39c4('0x4e')]);})['then'](function(_0x46cf66){_0x2c9396[_0x39c4('0x3e')]['clause'][_0x39c4('0x40')](_0x46cf66);return parseSearchFilter(_0x4781ad[_0x39c4('0x4f')]);})[_0x39c4('0x4d')](function(_0x1f3a1d){_0x2c9396[_0x39c4('0x4f')]=_0x1f3a1d;return _0x2c9396;});}function checkListsRestrictions(_0xc7b505,_0x280de4,_0x3ac1f7){var _0x8a5416=squel[_0x39c4('0x23')]();return Promise[_0x39c4('0x4c')]()[_0x39c4('0x4d')](function(){if(_0x280de4['search']&&_0xc7b505['role']===_0x39c4('0x7')&&!_0x3ac1f7){return _0xc7b505[_0x39c4('0x50')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x1200a0){if(_0x1200a0){if(_0x1200a0[_0x39c4('0x27')]===0x0){_0x8a5416['and'](_0x39c4('0x51'));}else{_0x8a5416[_0x39c4('0x40')]('c.ListId\x20IN\x20?',_[_0x39c4('0x46')](_0x1200a0,'id'));}}})['then'](function(){return _0x8a5416;});}function buildContactsQuery(_0x468d93,_0x15b83c,_0x299b08,_0x13ba1a,_0x282a06,_0x225e82){if(_0x15b83c){_0x15b83c=_0x299b08[_0x39c4('0x52')];}_0x468d93=addFieldsToQuery(_0x468d93,_0x15b83c,_0x13ba1a,_0x225e82,!![]);var _0xce0e60=squel['select']();_0xce0e60=addFieldsToQuery(_0xce0e60,_0x15b83c,_0x13ba1a,_0x225e82,![]);if(_0x13ba1a||_0x225e82){_0x468d93=applyJoinClauses(_0x468d93,!![]);_0x468d93[_0x39c4('0x53')](_0x39c4('0x54'));if(_0x299b08[_0x39c4('0x55')]){_0xce0e60[_0x39c4('0x55')](_0x299b08[_0x39c4('0x55')]);}if(_0x299b08[_0x39c4('0x56')]){_0xce0e60['offset'](_0x299b08[_0x39c4('0x56')]);}}else{_0xce0e60=applyJoinClauses(_0xce0e60,![]);_0xce0e60[_0x39c4('0x53')](_0x39c4('0x57'));if(_0x299b08[_0x39c4('0x55')]){_0x468d93[_0x39c4('0x55')](_0x299b08[_0x39c4('0x55')]);}if(_0x299b08['offset']){_0x468d93[_0x39c4('0x56')](_0x299b08[_0x39c4('0x56')]);}}_0xce0e60[_0x39c4('0x58')](_0x282a06);if(_0x299b08[_0x39c4('0x59')]){_0x299b08[_0x39c4('0x59')][_0x39c4('0x1f')](function(_0x270059){_0x468d93[_0x39c4('0x59')]('c.'+_0x270059[0x0],_0x270059[0x1]===_0x39c4('0x5a')?![]:!![]);_0xce0e60['order']('subqry.'+_0x270059[0x0],_0x270059[0x1]===_0x39c4('0x5a')?![]:!![]);});}_0xce0e60[_0x39c4('0xc')](_0x468d93,_0x39c4('0x10'));return _0xce0e60;}function getFilteredContacts(_0x165253){var _0x36bcec=[];return db[_0x39c4('0x3d')]['findAll']({'attributes':['id','name','color'],'raw':!![]})['then'](function(_0x3d7824){_0x36bcec=_[_0x39c4('0x5b')](_0x3d7824,'id');var _0x26db68={'type':db[_0x39c4('0x5c')]['QueryTypes'][_0x39c4('0x5d')],'model':db[_0x39c4('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x39c4('0x5f')][_0x39c4('0x60')](_0x165253[_0x39c4('0x61')](),_0x26db68);})[_0x39c4('0x4d')](function(_0xb45152){_0xb45152[_0x39c4('0x1f')](function(_0x3ea73e){if(_0x3ea73e[_0x39c4('0x20')]){_0x3ea73e[_0x39c4('0x62')]=[];_0x3ea73e[_0x39c4('0x20')][_0x39c4('0x26')](',')[_0x39c4('0x1f')](function(_0x337451){_0x3ea73e[_0x39c4('0x62')]['push'](_0x36bcec[_0x337451]);});}delete _0x3ea73e[_0x39c4('0x20')];});return _0xb45152;});}function countFilteredContacts(_0x59fca2,_0x232937){var _0x1aa32d=_0x59fca2[_0x39c4('0x63')]();_0x1aa32d['field'](_0x39c4('0x64'));_0x1aa32d=applyJoinClauses(_0x1aa32d,!![]);_0x59fca2['group'](_0x39c4('0x54'));var _0x3402a=utils[_0x39c4('0x24')](_0x232937);if(!_[_0x39c4('0x65')](_0x3402a)){_0x1aa32d[_0x39c4('0xe')](_0x39c4('0x66'),_0x3402a);}var _0xfefb0d={'type':db[_0x39c4('0x5c')][_0x39c4('0x67')][_0x39c4('0x5d')],'raw':!![]};return db['sequelize']['query'](_0x1aa32d['toString'](),_0xfefb0d)[_0x39c4('0x4d')](function(_0x2703cb){return _0x2703cb[0x0][_0x39c4('0x64')];});}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 _0x9e67=['.id','ct.CmContactId\x20=\x20','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','includes','push','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','name','dateOfBirth','datetime','DATE','buildExpression','type','default','text','value','start','end','map','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','c.ListId\x20IN\x20?','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','filter','getLists','attributes','select','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','findAll','color','CmContact','sequelize','query','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','QueryTypes','toString','exports','lodash','squel','../parsers/advancedSearch','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20'];(function(_0x3fcdc2,_0x1d4c33){var _0x998d0b=function(_0x1d62f2){while(--_0x1d62f2){_0x3fcdc2['push'](_0x3fcdc2['shift']());}};_0x998d0b(++_0x1d4c33);}(_0x9e67,0xc8));var _0x79e6=function(_0x5734bc,_0x563194){_0x5734bc=_0x5734bc-0x0;var _0x5875c1=_0x9e67[_0x5734bc];return _0x5875c1;};'use strict';var _=require(_0x79e6('0x0'));var squel=require(_0x79e6('0x1'));var as=require(_0x79e6('0x2'));var qs=require('../parsers/qs');var utils=require('../interaction/utils');var db=require(_0x79e6('0x3'))['db'];function skipContactsQuery(_0x1439d9,_0x53888b){var _0x1d49fb=![];if(_0x1439d9[_0x79e6('0x4')]===_0x79e6('0x5')&&!_0x53888b[_0x79e6('0x6')]&&!_0x53888b[_0x79e6('0x7')]&&_0x53888b[_0x79e6('0x8')]!==_0x79e6('0x9')){_0x1d49fb=!![];}return _0x1d49fb;}function getContactsSubquery(){return squel['select']()[_0x79e6('0xa')](_0x79e6('0xb'),'c')[_0x79e6('0xc')](_0x79e6('0xd'));}function applyJoinClauses(_0x31aa2f,_0x51086e){var _0x336e55=_0x51086e?'c':_0x79e6('0xe');_0x31aa2f[_0x79e6('0xf')](_0x79e6('0x10'),'uc',_0x79e6('0x11')+_0x336e55+_0x79e6('0x12'))[_0x79e6('0xf')]('cm_contact_has_tags','ct',_0x79e6('0x13')+_0x336e55+_0x79e6('0x12'))[_0x79e6('0xf')]('tools_tags','t','t.id\x20=\x20ct.TagId');return _0x31aa2f;}function addFieldsToQuery(_0x14cfe5,_0x406075,_0x7dec00,_0x433241,_0x3c8b3c){var _0x13bc40=_0x3c8b3c?'c':_0x79e6('0xe');if(!_0x406075){_0x406075=['id',_0x79e6('0x14'),_0x79e6('0x15'),_0x79e6('0x16'),_0x79e6('0x17'),_0x79e6('0x18'),_0x79e6('0x19'),_0x79e6('0x7'),'CompanyId',_0x79e6('0x1a'),_0x79e6('0x1b'),_0x79e6('0x1c'),'TagIds'];}else if(!_0x406075[_0x79e6('0x1d')]('id')){_0x406075[_0x79e6('0x1e')]('id');}var _0x3260e9=_0x7dec00&&_0x3c8b3c||!_0x7dec00&&!_0x3c8b3c;if(_0x433241){_0x3260e9=_0x433241&&_0x3c8b3c||!_0x433241&&!_0x3c8b3c;}_0x406075['forEach'](function(_0x32aaa){if(_0x32aaa===_0x79e6('0x1f')){if(_0x3260e9){_0x14cfe5[_0x79e6('0x20')](_0x79e6('0x21'),_0x32aaa);}else if(_0x7dec00||_0x433241){_0x14cfe5['field'](_0x13bc40+'.'+_0x32aaa);}}else{_0x14cfe5[_0x79e6('0x20')](_0x13bc40+'.'+_0x32aaa);}});return _0x14cfe5;}function getSqlClauses(){var _0x4242db={'default':squel['expr'](),'fields':squel[_0x79e6('0x22')](),'filter':squel[_0x79e6('0x22')](),'tags':{'clause':squel[_0x79e6('0x22')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x4242db;}function parseTagParameter(_0x2c63b0){var _0x48e38a=squel[_0x79e6('0x22')]();if(_0x2c63b0){var _0x590597=utils[_0x79e6('0x23')](_0x2c63b0);_0x590597[_0x79e6('0x24')](function(_0x447cc4){_0x48e38a['or'](_0x79e6('0x25'),'%,'+_0x447cc4+',%');});}return _0x48e38a;}function parseSearchFilter(_0x2809ae){var _0x3575e6=squel[_0x79e6('0x22')]();if(_0x2809ae){var _0x489d2f=_0x2809ae[_0x79e6('0x26')]('\x5c','\x5c\x5c')[_0x79e6('0x26')](/'/g,'\x27\x27');if(_0x489d2f[_0x79e6('0x27')]('\x20')['length']>0x1){_0x3575e6['or'](_0x79e6('0x28'),qs[_0x79e6('0x29')](_0x489d2f,!![]),null);}else{if(qs[_0x79e6('0x2a')](_0x489d2f)){_0x3575e6['or'](_0x79e6('0x2b'),_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x2c'),_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x2d'),_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x2e'),_0x489d2f+'%');}else if(qs[_0x79e6('0x2f')](_0x489d2f)){_0x3575e6['or'](_0x79e6('0x30'),_0x489d2f+'%');}else{_0x3575e6['or'](_0x79e6('0x31'),'%'+_0x489d2f+'%');_0x3575e6['or']('c.lastName\x20LIKE\x20?','%'+_0x489d2f+'%');_0x3575e6['or'](_0x79e6('0x30'),'%'+_0x489d2f+'%');}}}return _0x3575e6;}function parseAdvancedSearchFilter(_0x2990e8,_0xca1d81){var _0x3b3990=getSqlClauses();var _0x3aa56a=as[_0x79e6('0x32')](_0x2990e8);var _0x4c7807=_0x3aa56a[_0x79e6('0x33')];for(var _0x3765ec=0x0;_0x3765ec<_0x3aa56a[_0x79e6('0x34')][_0x79e6('0x35')];_0x3765ec++){var _0x3a058b=_0x3aa56a['conditions'][_0x3765ec];var _0x2e6ffc='c';var _0x1a7c86=_['find'](_0xca1d81,[_0x79e6('0x36'),_0x3a058b[_0x79e6('0x20')]]);if(_0x1a7c86){if(_0x3a058b[_0x79e6('0x20')]===_0x79e6('0x37')||_0x1a7c86['fieldType']===_0x79e6('0x38')){_0x3a058b['castTo']=_0x79e6('0x39');}var _0x65f304=as[_0x79e6('0x3a')](_0x2e6ffc,_0x1a7c86[_0x79e6('0x3b')],_0x3a058b);_0x3b3990[_0x79e6('0x3c')][_0x4c7807](_0x65f304[_0x79e6('0x3d')],_0x65f304[_0x79e6('0x3e')][_0x79e6('0x3f')],_0x65f304['value'][_0x79e6('0x40')]);}else{if(_0x3a058b[_0x79e6('0x20')]==='Tag'){var _0x2bfa3b=_0x3a058b[_0x79e6('0x3e')][_0x79e6('0x27')](',')[_0x79e6('0x41')](function(_0x3b1cb5){return Number(_0x3b1cb5);});var _0x2918f7=parseTagParameter(_0x2bfa3b);_0x3b3990['tags'][_0x79e6('0x42')][_0x79e6('0x43')](_0x2918f7);_0x3b3990['tags'][_0x79e6('0x44')]=_0x2bfa3b;}else if(_0x3a058b[_0x79e6('0x20')]===_0x79e6('0x45')){_0x3b3990[_0x79e6('0x46')][_0x79e6('0x42')][_0x79e6('0x43')](_0x79e6('0x47'),_0x3a058b[_0x79e6('0x3e')]);_0x3b3990[_0x79e6('0x46')][_0x79e6('0x48')]=!![];}}}return _0x3b3990;}function parseModelFields(_0x5d0fa0,_0x7783ee){var _0x2eae93=squel[_0x79e6('0x22')]();var _0x1612c8=_(_0x5d0fa0)[_0x79e6('0x49')]()[_0x79e6('0x41')](function(_0x17c8f0){return _[_0x79e6('0x4a')](_0x7783ee,[_0x79e6('0x36'),_0x17c8f0])?_0x17c8f0:undefined;})[_0x79e6('0x4b')]()[_0x79e6('0x3e')]();if(_0x5d0fa0['Contact']){_0x1612c8[_0x79e6('0x1e')]('Contact');}if(_0x5d0fa0[_0x79e6('0x45')]){_0x1612c8[_0x79e6('0x1e')](_0x79e6('0x45'));}if(_0x1612c8['length']>0x0){_0x1612c8['forEach'](function(_0x2bb207){if(_0x2bb207===_0x79e6('0x7')){_0x2eae93[_0x79e6('0x43')](_0x79e6('0x4c'),[][_0x79e6('0x4d')](_0x5d0fa0[_0x2bb207]));}else if(_0x2bb207===_0x79e6('0x4e')){var _0x2c669f='%'+_0x5d0fa0[_0x2bb207]+'%';_0x2eae93[_0x79e6('0x43')](_0x79e6('0x4f'),_0x2c669f);}else if(_0x2bb207===_0x79e6('0x45')){_0x2eae93['and']('uc.UserId\x20=\x20?',_0x5d0fa0[_0x2bb207]);}else{_0x2eae93[_0x79e6('0x43')]('c.'+_0x2bb207+'\x20=\x20?',_0x5d0fa0[_0x2bb207]);}});}return _0x2eae93;}function parseQueryParameters(_0x5b6587,_0xef5007){var _0x112562=getSqlClauses();return Promise[_0x79e6('0x50')]()[_0x79e6('0x51')](function(){return parseModelFields(_0x5b6587,_0xef5007);})[_0x79e6('0x51')](function(_0x13564a){_0x112562[_0x79e6('0x52')][_0x79e6('0x43')](_0x13564a);return parseTagParameter(_0x5b6587['tag']);})['then'](function(_0x161cce){_0x112562['tags'][_0x79e6('0x42')][_0x79e6('0x43')](_0x161cce);return parseSearchFilter(_0x5b6587[_0x79e6('0x53')]);})[_0x79e6('0x51')](function(_0x2b4279){_0x112562[_0x79e6('0x53')]=_0x2b4279;return _0x112562;});}function checkListsRestrictions(_0x3df11d,_0x316c2e,_0x3cc95b){var _0x5992d5=squel[_0x79e6('0x22')]();return Promise[_0x79e6('0x50')]()[_0x79e6('0x51')](function(){if(_0x316c2e[_0x79e6('0x6')]&&_0x3df11d[_0x79e6('0x4')]===_0x79e6('0x5')&&!_0x3cc95b){return _0x3df11d[_0x79e6('0x54')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x8d9aab){if(_0x8d9aab){if(_0x8d9aab[_0x79e6('0x35')]===0x0){_0x5992d5[_0x79e6('0x43')]('c.ListId\x20IS\x20NULL');}else{_0x5992d5[_0x79e6('0x43')](_0x79e6('0x4c'),_[_0x79e6('0x41')](_0x8d9aab,'id'));}}})[_0x79e6('0x51')](function(){return _0x5992d5;});}function buildContactsQuery(_0x1e89c2,_0x460400,_0x2571a8,_0x3f5212,_0x6163fa,_0x313798){if(_0x460400){_0x460400=_0x2571a8[_0x79e6('0x55')];}_0x1e89c2=addFieldsToQuery(_0x1e89c2,_0x460400,_0x3f5212,_0x313798,!![]);var _0xa517fc=squel[_0x79e6('0x56')]();_0xa517fc=addFieldsToQuery(_0xa517fc,_0x460400,_0x3f5212,_0x313798,![]);if(_0x3f5212||_0x313798){_0x1e89c2=applyJoinClauses(_0x1e89c2,!![]);_0x1e89c2[_0x79e6('0x57')](_0x79e6('0x58'));if(_0x2571a8[_0x79e6('0x59')]){_0xa517fc[_0x79e6('0x59')](_0x2571a8[_0x79e6('0x59')]);}if(_0x2571a8[_0x79e6('0x5a')]){_0xa517fc[_0x79e6('0x5a')](_0x2571a8[_0x79e6('0x5a')]);}}else{_0xa517fc=applyJoinClauses(_0xa517fc,![]);_0xa517fc[_0x79e6('0x57')](_0x79e6('0x5b'));if(_0x2571a8[_0x79e6('0x59')]){_0x1e89c2[_0x79e6('0x59')](_0x2571a8[_0x79e6('0x59')]);}if(_0x2571a8[_0x79e6('0x5a')]){_0x1e89c2[_0x79e6('0x5a')](_0x2571a8[_0x79e6('0x5a')]);}}_0xa517fc['having'](_0x6163fa);if(_0x2571a8[_0x79e6('0x5c')]){_0x2571a8[_0x79e6('0x5c')]['forEach'](function(_0x1fe40d){_0x1e89c2[_0x79e6('0x5c')]('c.'+_0x1fe40d[0x0],_0x1fe40d[0x1]===_0x79e6('0x5d')?![]:!![]);_0xa517fc['order'](_0x79e6('0x5e')+_0x1fe40d[0x0],_0x1fe40d[0x1]===_0x79e6('0x5d')?![]:!![]);});}_0xa517fc[_0x79e6('0xa')](_0x1e89c2,_0x79e6('0xe'));return _0xa517fc;}function getFilteredContacts(_0x2939c6){var _0x18b989=[];return db['Tag'][_0x79e6('0x5f')]({'attributes':['id',_0x79e6('0x36'),_0x79e6('0x60')],'raw':!![]})[_0x79e6('0x51')](function(_0x431404){_0x18b989=_['keyBy'](_0x431404,'id');var _0x115cd1={'type':db['Sequelize']['QueryTypes']['SELECT'],'model':db[_0x79e6('0x61')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x79e6('0x62')][_0x79e6('0x63')](_0x2939c6['toString'](),_0x115cd1);})[_0x79e6('0x51')](function(_0x22d80f){_0x22d80f[_0x79e6('0x24')](function(_0x5b4caf){if(_0x5b4caf[_0x79e6('0x1f')]){_0x5b4caf[_0x79e6('0x64')]=[];_0x5b4caf[_0x79e6('0x1f')]['split'](',')[_0x79e6('0x24')](function(_0x3db857){_0x5b4caf[_0x79e6('0x64')][_0x79e6('0x1e')](_0x18b989[_0x3db857]);});}delete _0x5b4caf['TagIds'];});return _0x22d80f;});}function countFilteredContacts(_0x57417f,_0x302a87){var _0x3a2fee=_0x57417f[_0x79e6('0x65')]();_0x3a2fee[_0x79e6('0x20')](_0x79e6('0x66'));_0x3a2fee=applyJoinClauses(_0x3a2fee,!![]);_0x57417f[_0x79e6('0x57')](_0x79e6('0x58'));var _0xb553a3=utils[_0x79e6('0x23')](_0x302a87);if(!_[_0x79e6('0x67')](_0xb553a3)){_0x3a2fee[_0x79e6('0xc')](_0x79e6('0x68'),_0xb553a3);}var _0x396614={'type':db[_0x79e6('0x69')][_0x79e6('0x6a')]['SELECT'],'raw':!![]};return db[_0x79e6('0x62')][_0x79e6('0x63')](_0x3a2fee[_0x79e6('0x6b')](),_0x396614)[_0x79e6('0x51')](function(_0x53cbf6){return _0x53cbf6[0x0][_0x79e6('0x66')];});}module[_0x79e6('0x6c')]={'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 b2f0d2a..b770b77 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 _0x0799=['secrets','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','encryptFile','createReadStream','createWriteStream','createCipher','update','write','end','final','binary','close','unlink','decryptFile','data','encryptString','secret','utf8','createDecipher','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app'];(function(_0x30683f,_0x2fece6){var _0x8fb8ae=function(_0x3395a5){while(--_0x3395a5){_0x30683f['push'](_0x30683f['shift']());}};_0x8fb8ae(++_0x2fece6);}(_0x0799,0x15a));var _0x9079=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x0799[_0xc87d08];return _0x30a714;};'use strict';var crypto=require(_0x9079('0x0'));var fs=require('fs');var BPromise=require(_0x9079('0x1'));var _=require(_0x9079('0x2'));var config=require(_0x9079('0x3'));var logger=require(_0x9079('0x4'))(_0x9079('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9079('0x6')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x9079('0x7')][_0x9079('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x9079('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0x9079('0x7')][_0x9079('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9079('0x9')](',\x20');logger[_0x9079('0xa')](config[_0x9079('0x7')][_0x9079('0x8')],_0x9079('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4d00fa){return AES_SUPPORTED_RX['test'](_0x4d00fa);}function getSupportedCiphers(){return crypto[_0x9079('0xc')]()[_0x9079('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x55b3ea){return getSupportedCiphers()['indexOf'](_0x55b3ea)>-0x1;}function combineOptions(_0xc084db){var _0x454c42={};for(var _0x3c8f67 in fileOptions){if(fileOptions['hasOwnProperty'](_0x3c8f67)){_0x454c42[_0x3c8f67]=fileOptions[_0x3c8f67];}}if(_0xc084db){for(var _0x1f18e5 in _0xc084db){if(_0xc084db['hasOwnProperty'](_0x1f18e5)){_0x454c42[_0x1f18e5]=_0xc084db[_0x1f18e5];}}}return _0x454c42;}exports[_0x9079('0xe')]=function(_0x4f45c0,_0x366c98,_0x1e0efc,_0x2d14f2){return new BPromise(function(_0x3c6b86,_0x16f28e){_0x2d14f2=combineOptions(_0x2d14f2);var _0x5cf176=new Buffer(_0x1e0efc);var _0x2c82c2=fs[_0x9079('0xf')](_0x4f45c0);var _0xe1d138=fs[_0x9079('0x10')](_0x366c98);var _0x55186e=crypto[_0x9079('0x11')](_0x2d14f2['algorithm'],_0x5cf176);_0x2c82c2['on']('data',function(_0x5c6f6a){var _0x4db2e9=new Buffer(_0x55186e[_0x9079('0x12')](_0x5c6f6a),'binary');_0xe1d138[_0x9079('0x13')](_0x4db2e9);});_0x2c82c2['on'](_0x9079('0x14'),function(){try{var _0x204ae9=new Buffer(_0x55186e[_0x9079('0x15')](_0x9079('0x16')),_0x9079('0x16'));_0xe1d138[_0x9079('0x13')](_0x204ae9);_0xe1d138[_0x9079('0x14')]();_0xe1d138['on'](_0x9079('0x17'),function(){return _0x3c6b86(_0x366c98);});}catch(_0xcf9e2){fs[_0x9079('0x18')](_0x366c98);return _0x16f28e(_0xcf9e2);}});});};exports[_0x9079('0x19')]=function(_0x33745b,_0x2f3cf7,_0xb5ee4d,_0x2f6b00){return new BPromise(function(_0x4d0a8b,_0x547242){_0x2f6b00=combineOptions(_0x2f6b00);var _0x3b6974=new Buffer(_0xb5ee4d);var _0x3c6aa9=fs[_0x9079('0xf')](_0x33745b);var _0xcc9e67=fs[_0x9079('0x10')](_0x2f3cf7);var _0x41ca1a=crypto['createDecipher'](_0x2f6b00[_0x9079('0x8')],_0x3b6974);_0x3c6aa9['on'](_0x9079('0x1a'),function(_0x3d3e3c){var _0xcc9119=new Buffer(_0x41ca1a[_0x9079('0x12')](_0x3d3e3c),_0x9079('0x16'));_0xcc9e67['write'](_0xcc9119);});_0x3c6aa9['on'](_0x9079('0x14'),function(){try{var _0x50d31d=new Buffer(_0x41ca1a[_0x9079('0x15')](_0x9079('0x16')),_0x9079('0x16'));_0xcc9e67[_0x9079('0x13')](_0x50d31d);_0xcc9e67[_0x9079('0x14')]();_0xcc9e67['on'](_0x9079('0x17'),function(){return _0x4d0a8b(_0x2f3cf7);});}catch(_0x3c86be){fs['unlink'](_0x2f3cf7);return _0x547242(_0x3c86be);}});});};exports[_0x9079('0x1b')]=function(_0x538cd9,_0x2a2108,_0x2495b2){var _0x3ad17e=_0x2495b2||stringOptions['algorithm'];var _0x2f543a=_0x2a2108||stringOptions[_0x9079('0x1c')];var _0x2d6f50=crypto['createCipher'](_0x3ad17e,_0x2f543a);var _0x478fa8=_0x2d6f50[_0x9079('0x12')](_0x538cd9,_0x9079('0x1d'),'base64');_0x478fa8+=_0x2d6f50[_0x9079('0x15')]('base64');return _0x478fa8;};exports['decryptString']=function(_0x3f71e5,_0x375850,_0x18ea3f){var _0x2bb253=_0x18ea3f||stringOptions['algorithm'];var _0x23e550=_0x375850||stringOptions[_0x9079('0x1c')];var _0x553396=crypto[_0x9079('0x1e')](_0x2bb253,_0x23e550);var _0x553774=_0x553396[_0x9079('0x12')](_0x3f71e5,_0x9079('0x1f'),_0x9079('0x1d'));_0x553774+=_0x553396['final'](_0x9079('0x1d'));return _0x553774;}; \ No newline at end of file +var _0xef39=['../../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','getCiphers','filter','indexOf','encryptFile','createCipher','data','update','binary','write','end','decryptFile','createDecipher','final','close','encryptString','secret','utf8','base64','lodash'];(function(_0x5a82a0,_0xd1584a){var _0x206394=function(_0x2c8150){while(--_0x2c8150){_0x5a82a0['push'](_0x5a82a0['shift']());}};_0x206394(++_0xd1584a);}(_0xef39,0x13f));var _0x9ef3=function(_0x2a0630,_0x7a9c7f){_0x2a0630=_0x2a0630-0x0;var _0x5bdc68=_0xef39[_0x2a0630];return _0x5bdc68;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x9ef3('0x0'));var config=require(_0x9ef3('0x1'));var logger=require(_0x9ef3('0x2'))(_0x9ef3('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9ef3('0x4')][_0x9ef3('0x5')],'algorithm':_0x9ef3('0x6')};const fileOptions={'algorithm':_0x9ef3('0x7')};if(config['encrypt']&&config[_0x9ef3('0x8')][_0x9ef3('0x9')]){var isSupported=isAlgorithmSupported(config[_0x9ef3('0x8')][_0x9ef3('0x9')]);if(isSupported){fileOptions[_0x9ef3('0x9')]=config['encrypt'][_0x9ef3('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9ef3('0xa')](',\x20');logger[_0x9ef3('0xb')](config[_0x9ef3('0x8')]['algorithm'],_0x9ef3('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x1ceb2a){return AES_SUPPORTED_RX[_0x9ef3('0xd')](_0x1ceb2a);}function getSupportedCiphers(){return crypto[_0x9ef3('0xe')]()[_0x9ef3('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x52d787){return getSupportedCiphers()[_0x9ef3('0x10')](_0x52d787)>-0x1;}function combineOptions(_0x23cb14){var _0x25ad73={};for(var _0x5baf59 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5baf59)){_0x25ad73[_0x5baf59]=fileOptions[_0x5baf59];}}if(_0x23cb14){for(var _0x2d0bd0 in _0x23cb14){if(_0x23cb14['hasOwnProperty'](_0x2d0bd0)){_0x25ad73[_0x2d0bd0]=_0x23cb14[_0x2d0bd0];}}}return _0x25ad73;}exports[_0x9ef3('0x11')]=function(_0x2e5a84,_0x3aa507,_0x1baf90,_0x37ce9b){return new BPromise(function(_0x2c2f30,_0x5a4a05){_0x37ce9b=combineOptions(_0x37ce9b);var _0x13b008=new Buffer(_0x1baf90);var _0x30e536=fs['createReadStream'](_0x2e5a84);var _0x557946=fs['createWriteStream'](_0x3aa507);var _0x23b71b=crypto[_0x9ef3('0x12')](_0x37ce9b[_0x9ef3('0x9')],_0x13b008);_0x30e536['on'](_0x9ef3('0x13'),function(_0x32acc7){var _0x952749=new Buffer(_0x23b71b[_0x9ef3('0x14')](_0x32acc7),_0x9ef3('0x15'));_0x557946[_0x9ef3('0x16')](_0x952749);});_0x30e536['on'](_0x9ef3('0x17'),function(){try{var _0x280e47=new Buffer(_0x23b71b['final'](_0x9ef3('0x15')),_0x9ef3('0x15'));_0x557946['write'](_0x280e47);_0x557946[_0x9ef3('0x17')]();_0x557946['on']('close',function(){return _0x2c2f30(_0x3aa507);});}catch(_0x359d0a){fs['unlink'](_0x3aa507);return _0x5a4a05(_0x359d0a);}});});};exports[_0x9ef3('0x18')]=function(_0x228192,_0x2afb5f,_0x5a7567,_0x2ae010){return new BPromise(function(_0x11b8f2,_0x58d136){_0x2ae010=combineOptions(_0x2ae010);var _0x2cf7d4=new Buffer(_0x5a7567);var _0x455632=fs['createReadStream'](_0x228192);var _0x1cfc12=fs['createWriteStream'](_0x2afb5f);var _0x5a9568=crypto[_0x9ef3('0x19')](_0x2ae010[_0x9ef3('0x9')],_0x2cf7d4);_0x455632['on']('data',function(_0x4074be){var _0x3c0bff=new Buffer(_0x5a9568[_0x9ef3('0x14')](_0x4074be),'binary');_0x1cfc12[_0x9ef3('0x16')](_0x3c0bff);});_0x455632['on'](_0x9ef3('0x17'),function(){try{var _0x55eab1=new Buffer(_0x5a9568[_0x9ef3('0x1a')](_0x9ef3('0x15')),_0x9ef3('0x15'));_0x1cfc12[_0x9ef3('0x16')](_0x55eab1);_0x1cfc12[_0x9ef3('0x17')]();_0x1cfc12['on'](_0x9ef3('0x1b'),function(){return _0x11b8f2(_0x2afb5f);});}catch(_0x32ed0b){fs['unlink'](_0x2afb5f);return _0x58d136(_0x32ed0b);}});});};exports[_0x9ef3('0x1c')]=function(_0x232205,_0x5c6aed,_0x3f72c5){var _0x3e7163=_0x3f72c5||stringOptions[_0x9ef3('0x9')];var _0x5d7a8a=_0x5c6aed||stringOptions[_0x9ef3('0x1d')];var _0x88a8a6=crypto[_0x9ef3('0x12')](_0x3e7163,_0x5d7a8a);var _0x4d7d34=_0x88a8a6[_0x9ef3('0x14')](_0x232205,_0x9ef3('0x1e'),_0x9ef3('0x1f'));_0x4d7d34+=_0x88a8a6[_0x9ef3('0x1a')](_0x9ef3('0x1f'));return _0x4d7d34;};exports['decryptString']=function(_0x34720b,_0x51115f,_0x20b68a){var _0x4923ef=_0x20b68a||stringOptions[_0x9ef3('0x9')];var _0x490015=_0x51115f||stringOptions['secret'];var _0x51257e=crypto[_0x9ef3('0x19')](_0x4923ef,_0x490015);var _0x1d16ee=_0x51257e[_0x9ef3('0x14')](_0x34720b,'base64','utf8');_0x1d16ee+=_0x51257e[_0x9ef3('0x1a')](_0x9ef3('0x1e'));return _0x1d16ee;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 3e232cd..9625d4b 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 _0x8722=['to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','mkdirSync','each','%s%d.%s','csv','writeFileSync','join','%s.%s','zip','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','finally','exit','util','lodash'];(function(_0x536237,_0x2dbc20){var _0x540d36=function(_0x4ea6d2){while(--_0x4ea6d2){_0x536237['push'](_0x536237['shift']());}};_0x540d36(++_0x2dbc20);}(_0x8722,0x13c));var _0x2872=function(_0x4eae14,_0x470520){_0x4eae14=_0x4eae14-0x0;var _0x5cd5bd=_0x8722[_0x4eae14];return _0x5cd5bd;};'use strict';var util=require(_0x2872('0x0'));var path=require('path');var _=require(_0x2872('0x1'));var csv=require(_0x2872('0x2'));var fs=require('fs');var BPromise=require(_0x2872('0x3'));var zipdir=require(_0x2872('0x4'));var rimraf=require(_0x2872('0x5'));var db=require(_0x2872('0x6'))['db'];var dbH=require(_0x2872('0x6'))[_0x2872('0x7')];var logger=require(_0x2872('0x8'))(_0x2872('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x2872('0xa')][0x2]);var QUERY=process[_0x2872('0xa')][0x3];var PATH=process[_0x2872('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a7656,_0x4d2612){var _0x2d1782={'status':_0x4a7656};var _0x2b7c07={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d2612){_0x2d1782[_0x2872('0xb')]=_0x4d2612;}return db[_0x2872('0xc')][_0x2872('0xd')](_0x2d1782,_0x2b7c07);}function main(){var _0x4c869c=0x1388;var _0x48a1a6;logger[_0x2872('0xe')](util[_0x2872('0xf')](_0x2872('0x10'),EXTRACTED_REPORT_ID,_0x2872('0x11')));return db[_0x2872('0x12')][_0x2872('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2872('0x14'),_0x2872('0x15')]})[_0x2872('0x16')](function(_0x388fad){if(_0x388fad){_0x48a1a6=_0x388fad;_0x4c869c=_0x48a1a6[_0x2872('0x15')]||0x1388;}})[_0x2872('0x16')](function(){return dbH[_0x2872('0x17')][_0x2872('0x18')](util[_0x2872('0xf')](_0x2872('0x19'),QUERY),{'type':dbH[_0x2872('0x17')][_0x2872('0x1a')][_0x2872('0x1b')]});})[_0x2872('0x16')](function(_0x29868b){if(!_0x29868b[0x0]['num']){return analyticExtractedReport('Empty');}var _0xd79172=[];var _0xef921=0x0;if(_0x48a1a6[_0x2872('0x14')]){if(_0x29868b&&_0x29868b[_0x2872('0x1c')]){var _0x597b69=_['range'](_0x29868b[0x0][_0x2872('0x1d')]/_0x4c869c);var _0x4ac62c=Number[_0x2872('0x1e')](_0x29868b[0x0][_0x2872('0x1d')]/_0x4c869c)?_0x29868b[0x0][_0x2872('0x1d')]%_0x4c869c:0x0;_0x597b69['forEach'](function(_0x16f5b0){if(_0x16f5b0>0x0){_0xef921+=_0x4c869c;}_0xd79172['push'](dbH['sequelize']['query'](util[_0x2872('0xf')](_0x2872('0x1f'),QUERY,_0x4c869c,_0xef921),{'type':dbH[_0x2872('0x17')][_0x2872('0x1a')][_0x2872('0x1b')]}));});if(_0x4ac62c>0x0){_0xef921+=_0x4c869c;_0xd79172[_0x2872('0x20')](dbH[_0x2872('0x17')][_0x2872('0x18')](util['format'](_0x2872('0x1f'),QUERY,_0x4ac62c,_0xef921),{'type':dbH[_0x2872('0x17')]['QueryTypes']['SELECT']}));}}}else{_0xd79172[_0x2872('0x20')](dbH[_0x2872('0x17')]['query'](QUERY,{'type':dbH[_0x2872('0x17')][_0x2872('0x1a')][_0x2872('0x1b')]}));}var _0x2eca9d=path[_0x2872('0x21')](PATH);var _0x182897=path[_0x2872('0x22')](PATH,_0x2872('0x23'));var _0x44f264=_0x48a1a6[_0x2872('0x14')]&&_0xd79172[_0x2872('0x1c')]>0x1;var _0x25663b=[];if(!fs[_0x2872('0x24')](path['join'](_0x2eca9d,_0x182897))&&_0x44f264){fs[_0x2872('0x25')](path['join'](_0x2eca9d,_0x182897));}return BPromise[_0x2872('0x26')](_0xd79172,function(_0x2fb74e){_0x25663b[_0x2872('0x20')](_0x2fb74e);})[_0x2872('0x16')](function(){for(var _0x5388d8=0x0;_0x5388d8<_0x25663b['length'];_0x5388d8+=0x1){var _0x188642;var _0x325950=_0x25663b[_0x5388d8];if(_0x44f264){_0x188642=path['join'](_0x2eca9d,_0x182897,util['format'](_0x2872('0x27'),_0x182897,_0x5388d8,_0x2872('0x28')));}else{_0x188642=path['join'](_0x2eca9d,util[_0x2872('0xf')]('%s.%s',_0x182897,'csv'));}fs[_0x2872('0x29')](_0x188642,csv(_0x325950));}})[_0x2872('0x16')](function(){if(_0x44f264){return new Promise(function(_0x2dc76d){zipdir(path['join'](_0x2eca9d,_0x182897),{'saveTo':path[_0x2872('0x2a')](_0x2eca9d,util[_0x2872('0xf')](_0x2872('0x2b'),_0x182897,_0x2872('0x2c')))},function(_0x1f0bd8,_0x516d72){rimraf(path[_0x2872('0x2a')](_0x2eca9d,_0x182897),function(){});_0x2dc76d('zip\x20finished');});});}})[_0x2872('0x16')](function(){logger[_0x2872('0xe')](util[_0x2872('0xf')](_0x2872('0x2d'),EXTRACTED_REPORT_ID,_0x2872('0x11')));return analyticExtractedReport(_0x2872('0x2e'),_0x44f264?util[_0x2872('0xf')](_0x2872('0x2b'),_0x182897,_0x44f264?_0x2872('0x2c'):_0x2872('0x28')):null);});})[_0x2872('0x2f')](function(_0x3efd75){logger[_0x2872('0xe')](util[_0x2872('0xf')](_0x2872('0x30'),EXTRACTED_REPORT_ID,'CSV'),util[_0x2872('0x31')](_0x3efd75,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2872('0x32'));})[_0x2872('0x33')](function(){process[_0x2872('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xf3bd=['.csv','existsSync','join','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','info','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','splitSizeCsv','then','sequelize','format','QueryTypes','SELECT','num','Empty','length','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname'];(function(_0x4f3255,_0xbd0881){var _0x332e4a=function(_0x393a48){while(--_0x393a48){_0x4f3255['push'](_0x4f3255['shift']());}};_0x332e4a(++_0xbd0881);}(_0xf3bd,0x1a9));var _0xdf3b=function(_0x3e1594,_0x415558){_0x3e1594=_0x3e1594-0x0;var _0x3067a6=_0xf3bd[_0x3e1594];return _0x3067a6;};'use strict';var util=require(_0xdf3b('0x0'));var path=require('path');var _=require(_0xdf3b('0x1'));var csv=require(_0xdf3b('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xdf3b('0x3'));var rimraf=require(_0xdf3b('0x4'));var db=require(_0xdf3b('0x5'))['db'];var dbH=require(_0xdf3b('0x5'))['dbH'];var logger=require('../../config/logger')(_0xdf3b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xdf3b('0x7')][0x2]);var QUERY=process[_0xdf3b('0x7')][0x3];var PATH=process[_0xdf3b('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x33c325,_0x4dd353){var _0x376c0b={'status':_0x33c325};var _0xdc3f33={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4dd353){_0x376c0b[_0xdf3b('0x8')]=_0x4dd353;}return db[_0xdf3b('0x9')]['update'](_0x376c0b,_0xdc3f33);}function main(){var _0x40683c=0x1388;var _0x1f5a28;logger['info'](util['format'](_0xdf3b('0xa'),EXTRACTED_REPORT_ID,_0xdf3b('0xb')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdf3b('0xc')]})[_0xdf3b('0xd')](function(_0x367b5e){if(_0x367b5e){_0x1f5a28=_0x367b5e;_0x40683c=_0x1f5a28[_0xdf3b('0xc')]||0x1388;}})[_0xdf3b('0xd')](function(){return dbH[_0xdf3b('0xe')]['query'](util[_0xdf3b('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xdf3b('0x10')][_0xdf3b('0x11')]});})[_0xdf3b('0xd')](function(_0x14d828){if(!_0x14d828[0x0][_0xdf3b('0x12')]){return analyticExtractedReport(_0xdf3b('0x13'));}var _0x544149=[];var _0x4f8bbb=0x0;if(_0x1f5a28['split']){if(_0x14d828&&_0x14d828[_0xdf3b('0x14')]){var _0x54d15e=_['range'](_0x14d828[0x0][_0xdf3b('0x12')]/_0x40683c);var _0x1486e3=Number['isInteger'](_0x14d828[0x0][_0xdf3b('0x12')]/_0x40683c)?_0x14d828[0x0][_0xdf3b('0x12')]%_0x40683c:0x0;_0x54d15e[_0xdf3b('0x15')](function(_0x98ab8b){if(_0x98ab8b>0x0){_0x4f8bbb+=_0x40683c;}_0x544149[_0xdf3b('0x16')](dbH[_0xdf3b('0xe')][_0xdf3b('0x17')](util[_0xdf3b('0xf')](_0xdf3b('0x18'),QUERY,_0x40683c,_0x4f8bbb),{'type':dbH[_0xdf3b('0xe')][_0xdf3b('0x10')][_0xdf3b('0x11')]}));});if(_0x1486e3>0x0){_0x4f8bbb+=_0x40683c;_0x544149['push'](dbH[_0xdf3b('0xe')][_0xdf3b('0x17')](util[_0xdf3b('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1486e3,_0x4f8bbb),{'type':dbH['sequelize']['QueryTypes'][_0xdf3b('0x11')]}));}}}else{_0x544149[_0xdf3b('0x16')](dbH[_0xdf3b('0xe')][_0xdf3b('0x17')](QUERY,{'type':dbH['sequelize'][_0xdf3b('0x10')][_0xdf3b('0x11')]}));}var _0x4d7619=path[_0xdf3b('0x19')](PATH);var _0xccaf48=path['basename'](PATH,_0xdf3b('0x1a'));var _0x220a55=_0x1f5a28['split']&&_0x544149['length']>0x1;var _0x44f091=[];if(!fs[_0xdf3b('0x1b')](path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48))&&_0x220a55){fs['mkdirSync'](path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48));}return BPromise[_0xdf3b('0x1d')](_0x544149,function(_0x1088d3){_0x44f091[_0xdf3b('0x16')](_0x1088d3);})[_0xdf3b('0xd')](function(){for(var _0x1c733c=0x0;_0x1c733c<_0x44f091[_0xdf3b('0x14')];_0x1c733c+=0x1){var _0x4e3b0e;var _0x32df9f=_0x44f091[_0x1c733c];if(_0x220a55){_0x4e3b0e=path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48,util[_0xdf3b('0xf')](_0xdf3b('0x1e'),_0xccaf48,_0x1c733c,'csv'));}else{_0x4e3b0e=path['join'](_0x4d7619,util[_0xdf3b('0xf')](_0xdf3b('0x1f'),_0xccaf48,_0xdf3b('0x20')));}fs[_0xdf3b('0x21')](_0x4e3b0e,csv(_0x32df9f));}})[_0xdf3b('0xd')](function(){if(_0x220a55){return new Promise(function(_0x585a86){zipdir(path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48),{'saveTo':path[_0xdf3b('0x1c')](_0x4d7619,util['format'](_0xdf3b('0x1f'),_0xccaf48,_0xdf3b('0x22')))},function(_0x5c2183,_0x19fd6f){rimraf(path[_0xdf3b('0x1c')](_0x4d7619,_0xccaf48),function(){});_0x585a86(_0xdf3b('0x23'));});});}})[_0xdf3b('0xd')](function(){logger[_0xdf3b('0x24')](util[_0xdf3b('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xdf3b('0xb')));return analyticExtractedReport(_0xdf3b('0x25'),_0x220a55?util[_0xdf3b('0xf')]('%s.%s',_0xccaf48,_0x220a55?_0xdf3b('0x22'):_0xdf3b('0x20')):null);});})['catch'](function(_0x18143e){logger[_0xdf3b('0x24')](util[_0xdf3b('0xf')](_0xdf3b('0x26'),EXTRACTED_REPORT_ID,_0xdf3b('0xb')),util[_0xdf3b('0x27')](_0x18143e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xdf3b('0x28'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index db04501..fb683ce 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 _0xdddb=['end','createPdfFromHTML','path','util','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','map','pick','fill','length','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','before','margin','landscape','toString','\x20/\x20','footer','black','right','num','Empty','find','split','splitSizePdf','then','range','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','catch','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','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdddb,0xbf));var _0xbddd=function(_0x212be0,_0x552f2c){_0x212be0=_0x212be0-0x0;var _0x5e159d=_0xdddb[_0x212be0];return _0x5e159d;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0xbddd('0x0'));var path=require('path');var moment=require(_0xbddd('0x1'));var htmlToPdfmake=require(_0xbddd('0x2'));var PdfPrinter=require(_0xbddd('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xbddd('0x4'));var JSDOM=require(_0xbddd('0x5'))[_0xbddd('0x6')];var window=new JSDOM('')[_0xbddd('0x7')];var BPromise=require('bluebird');var db=require(_0xbddd('0x8'))['db'];var dbH=require(_0xbddd('0x8'))[_0xbddd('0x9')];var logger=require(_0xbddd('0xa'))(_0xbddd('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbddd('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xbddd('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xeb2787,_0x454864){var _0x9fdc28={'status':_0xeb2787};var _0x402026={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x454864){_0x9fdc28[_0xbddd('0xe')]=_0x454864;}return db[_0xbddd('0xf')]['update'](_0x9fdc28,_0x402026);}function getHeaders(_0x17482a){return _['map'](_0x17482a,function(_0x4cbf7e){return{'text':_0x4cbf7e,'style':_0xbddd('0x10')};});}function getRows(_0x42c333,_0x966ea9){return _[_0xbddd('0x11')](_0x966ea9,function(_0x1bcb01){return _(_0x1bcb01)[_0xbddd('0x12')](_0x42c333)['map'](function(_0x30afbe){return _0x30afbe?_['toString'](_0x30afbe):'';})['value']();});}function createTable(_0x1750a3,_0x229261){var _0x15c963={'widths':_[_0xbddd('0x13')](Array(_0x1750a3[_0xbddd('0x14')]),0x91),'heights':function(_0x207b16){return _0x207b16===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x218f89=getHeaders(_0x1750a3);_0x15c963[_0xbddd('0x15')]['push'](_0x218f89);var _0x1808e9=getRows(_0x1750a3,_0x229261);_0x15c963[_0xbddd('0x15')]=_0x15c963[_0xbddd('0x15')][_0xbddd('0x16')](_0x1808e9);return _0x15c963;}function createTables(_0x2a0188){var _0x25896e=[];var _0x155551=_[_0xbddd('0x17')](Object[_0xbddd('0x18')](_0x2a0188[0x0]),0x5);_0x155551[_0xbddd('0x19')](function(_0x497d69){_0x25896e[_0xbddd('0x1a')](createTable(_0x497d69,_0x2a0188));});return _0x25896e;}function getPDFDocDefinition(_0x35abbe){var _0x547efd=util[_0xbddd('0x1b')](_0xbddd('0x1c'),NAME,EXTRACTED_REPORT[_0xbddd('0x1d')],moment(EXTRACTED_REPORT['startDate'])[_0xbddd('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xbddd('0x1e')])[_0xbddd('0x1b')](FORMAT));var _0x58a337=[];for(var _0x58069b=0x0;_0x58069b<_0x35abbe[_0xbddd('0x14')];_0x58069b++){var _0x1cee16=[];if(_0x58069b===0x0){_0x1cee16[_0xbddd('0x1a')]({'text':_0x547efd,'style':_0xbddd('0x1f')});}var _0x4b8c5e={'table':_0x35abbe[_0x58069b]};if(_0x58069b>0x0){_0x4b8c5e['pageBreak']=_0xbddd('0x20');_0x4b8c5e[_0xbddd('0x21')]=[0x0,0x46,0x0,0x0];}_0x1cee16['push'](_0x4b8c5e);_0x58a337[_0xbddd('0x1a')](_0x1cee16);}return{'pageSize':'A4','pageOrientation':_0xbddd('0x22'),'content':_0x58a337,'footer':function(_0x3b2701,_0x23503b){return{'text':_0x3b2701[_0xbddd('0x23')]()+_0xbddd('0x24')+_0x23503b,'style':_0xbddd('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbddd('0x26')},'footer':{'alignment':_0xbddd('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2b0dc3){var _0xb87dfc=0x1388;var _0x595037;if(!_0x2b0dc3[0x0][_0xbddd('0x28')]){return analyticExtractedReport(_0xbddd('0x29'));}return db['Setting'][_0xbddd('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbddd('0x2b'),_0xbddd('0x2c')]})[_0xbddd('0x2d')](function(_0x300dbe){if(_0x300dbe){_0x595037=_0x300dbe;_0xb87dfc=_0x595037['splitSizePdf']||0x3e8;}})[_0xbddd('0x2d')](function(){var _0x1f53b0=[];var _0x2a520a=0x0;if(_0x595037[_0xbddd('0x2b')]){if(_0x2b0dc3&&_0x2b0dc3[_0xbddd('0x14')]){var _0x271ba2=_[_0xbddd('0x2e')](_0x2b0dc3[0x0][_0xbddd('0x28')]/_0xb87dfc);var _0x4537e0=Number['isInteger'](_0x2b0dc3[0x0][_0xbddd('0x28')]/_0xb87dfc)?_0x2b0dc3[0x0][_0xbddd('0x28')]%_0xb87dfc:0x0;_0x271ba2[_0xbddd('0x19')](function(_0x5dedf2){if(_0x5dedf2>0x0){_0x2a520a+=_0xb87dfc;}_0x1f53b0[_0xbddd('0x1a')](dbH[_0xbddd('0x2f')][_0xbddd('0x30')](util[_0xbddd('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xb87dfc,_0x2a520a),{'type':dbH['sequelize'][_0xbddd('0x31')][_0xbddd('0x32')]}));});if(_0x4537e0>0x0){_0x2a520a+=_0xb87dfc;_0x1f53b0[_0xbddd('0x1a')](dbH[_0xbddd('0x2f')]['query'](util[_0xbddd('0x1b')](_0xbddd('0x33'),QUERY,_0x4537e0,_0x2a520a),{'type':dbH['sequelize'][_0xbddd('0x31')][_0xbddd('0x32')]}));}}}else{_0x1f53b0[_0xbddd('0x1a')](dbH[_0xbddd('0x2f')][_0xbddd('0x30')](QUERY,{'type':dbH[_0xbddd('0x2f')][_0xbddd('0x31')][_0xbddd('0x32')]}));}var _0x4f4d1e=path[_0xbddd('0x34')](PATH);var _0x1c9829=path[_0xbddd('0x35')](PATH,_0xbddd('0x36'));var _0xe31836=_0x595037[_0xbddd('0x2b')]&&_0x1f53b0[_0xbddd('0x14')]>0x1;var _0xfef5b1=[];if(!fs[_0xbddd('0x37')](path[_0xbddd('0x38')](_0x4f4d1e,_0x1c9829))&&_0xe31836){fs[_0xbddd('0x39')](path[_0xbddd('0x38')](_0x4f4d1e,_0x1c9829));}return BPromise[_0xbddd('0x3a')](_0x1f53b0,function(_0x42fcd1){_0xfef5b1['push'](_0x42fcd1);})[_0xbddd('0x2d')](function(){var _0x45761d=[];for(var _0x361e92=0x0;_0x361e92<_0xfef5b1[_0xbddd('0x14')];_0x361e92+=0x1){var _0x300317=_0xfef5b1[_0x361e92];var _0x2bcdce=createTables(_[_0xbddd('0x3b')](_0x300317));var _0x1e9b3e;var _0x16e356=getPDFDocDefinition(_0x2bcdce);var _0x2b78f2=getPDFPrinter();var _0x787eae=_0x2b78f2[_0xbddd('0x3c')](_0x16e356);if(_0xe31836){_0x1e9b3e=path[_0xbddd('0x38')](_0x4f4d1e,_0x1c9829,util[_0xbddd('0x1b')](_0xbddd('0x3d'),_0x1c9829,_0x361e92,_0xbddd('0x3e')));}else{_0x1e9b3e=path['join'](_0x4f4d1e,util[_0xbddd('0x1b')](_0xbddd('0x3f'),_0x1c9829,_0xbddd('0x3e')));}_0x45761d['push'](writePDFDocument(_0x787eae,_0x1e9b3e));}return Promise[_0xbddd('0x40')](_0x45761d);})['then'](function(){if(_0xe31836){return new Promise(function(_0x56ab24){zipdir(path['join'](_0x4f4d1e,_0x1c9829),{'saveTo':path[_0xbddd('0x38')](_0x4f4d1e,util[_0xbddd('0x1b')](_0xbddd('0x3f'),_0x1c9829,_0xbddd('0x41')))},function(){rimraf(path[_0xbddd('0x38')](_0x4f4d1e,_0x1c9829),function(){});_0x56ab24(_0xbddd('0x42'));});});}})[_0xbddd('0x2d')](function(){if(!_0xe31836)return;rimraf(path['join'](_0x4f4d1e,_0x1c9829),function(){});})['then'](function(){logger[_0xbddd('0x43')](util[_0xbddd('0x1b')](_0xbddd('0x44'),EXTRACTED_REPORT_ID,_0xbddd('0x45')));return analyticExtractedReport(_0xbddd('0x46'),_0xe31836?util[_0xbddd('0x1b')](_0xbddd('0x3f'),_0x1c9829,_0xe31836?_0xbddd('0x41'):_0xbddd('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xbddd('0x43')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbddd('0x45')));return db[_0xbddd('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5a0a2b){EXTRACTED_REPORT=_0x5a0a2b;return dbH[_0xbddd('0x2f')][_0xbddd('0x30')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xbddd('0x2f')][_0xbddd('0x31')][_0xbddd('0x32')]});})[_0xbddd('0x2d')](extractReport)[_0xbddd('0x47')](function(_0x5f23e7){logger[_0xbddd('0x43')](util[_0xbddd('0x1b')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbddd('0x45')),util[_0xbddd('0x48')](_0x5f23e7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbddd('0x49'));})[_0xbddd('0x4a')](function(){process[_0xbddd('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4d16c8=new PdfPrinter({'Arial':{'normal':__dirname+_0xbddd('0x4c'),'bold':__dirname+_0xbddd('0x4d'),'italics':__dirname+_0xbddd('0x4e'),'bolditalics':__dirname+_0xbddd('0x4f')}});return _0x4d16c8;}function getPDFDocDefinitionFromHTML(_0x24f922,_0x5f4729){var _0x268be2=util[_0xbddd('0x1b')](_0xbddd('0x50'),_0x5f4729[_0xbddd('0x51')],_0x5f4729['interactionId']);var _0x4c8cd3=moment()['format'](_0xbddd('0x52'))[_0xbddd('0x23')]();var _0x5129e8=htmlToPdfmake(_0x24f922,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5129e8],'defaultStyle':{'font':_0xbddd('0x53')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xbddd('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xbddd('0x54')}},'header':function(){return[{'text':_0xbddd('0x55'),'style':'header'}];},'footer':function(_0x19800b,_0x15a072){return[{'text':util[_0xbddd('0x1b')](_0xbddd('0x56'),_0x268be2,_0x19800b,_0x15a072,_0x4c8cd3),'style':_0xbddd('0x25')}];}};}function writePDFDocument(_0x16673c,_0x203f1f){return new Promise(function(_0x3d1754,_0x4fe042){var _0x57503d=_0x16673c[_0xbddd('0x57')](fs[_0xbddd('0x58')](_0x203f1f));_0x57503d['on']('finish',function(){_0x3d1754(_0xbddd('0x59'));});_0x57503d['on'](_0xbddd('0x5a'),function(_0x4474f8){_0x4fe042(_0x4474f8);});_0x16673c[_0xbddd('0x5b')]();});}exports[_0xbddd('0x5c')]=function(_0x59e096,_0x346156){var _0x4f1e2a=getPDFPrinter();var _0x28abfd=getPDFDocDefinitionFromHTML(_0x59e096,_0x346156);var _0x26a1b4=_0x4f1e2a['createPdfKitDocument'](_0x28abfd);return writePDFDocument(_0x26a1b4,_0x346156[_0xbddd('0x5d')])['catch'](function(_0x509191){throw _0x509191;});}; \ No newline at end of file +var _0x1f04=['all','%s.%s','zip','zip\x20finished','info','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','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','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','end','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','toString','value','fill','length','auto','body','push','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','footer','Arial','black','right','num','Empty','Setting','find','split','then','splitSizePdf','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0x1f04,0x1ce));var _0x41f0=function(_0x4a7e27,_0x1e94fb){_0x4a7e27=_0x4a7e27-0x0;var _0x391f82=_0x1f04[_0x4a7e27];return _0x391f82;};'use strict';var _=require(_0x41f0('0x0'));var fs=require('fs');var util=require(_0x41f0('0x1'));var path=require(_0x41f0('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x41f0('0x3'));var PdfPrinter=require(_0x41f0('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x41f0('0x5')];var window=new JSDOM('')[_0x41f0('0x6')];var BPromise=require(_0x41f0('0x7'));var db=require(_0x41f0('0x8'))['db'];var dbH=require(_0x41f0('0x8'))[_0x41f0('0x9')];var logger=require(_0x41f0('0xa'))(_0x41f0('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x41f0('0xc')][0x3];var PATH=process[_0x41f0('0xc')][0x4];var NAME=process[_0x41f0('0xc')][0x5];var FORMAT=_0x41f0('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3596b9,_0x132ec3){var _0x4ffb3b={'status':_0x3596b9};var _0x1a860a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x132ec3){_0x4ffb3b['savename']=_0x132ec3;}return db[_0x41f0('0xe')][_0x41f0('0xf')](_0x4ffb3b,_0x1a860a);}function getHeaders(_0x16108f){return _['map'](_0x16108f,function(_0x5dc8da){return{'text':_0x5dc8da,'style':'tableHeader'};});}function getRows(_0x18ab8d,_0x3bc8d7){return _['map'](_0x3bc8d7,function(_0x3c2c40){return _(_0x3c2c40)['pick'](_0x18ab8d)[_0x41f0('0x10')](function(_0x524a84){return _0x524a84?_[_0x41f0('0x11')](_0x524a84):'';})[_0x41f0('0x12')]();});}function createTable(_0x285fcc,_0x3c18b7){var _0x538049={'widths':_[_0x41f0('0x13')](Array(_0x285fcc[_0x41f0('0x14')]),0x91),'heights':function(_0x309bc1){return _0x309bc1===0x0?_0x41f0('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x146f6c=getHeaders(_0x285fcc);_0x538049[_0x41f0('0x16')][_0x41f0('0x17')](_0x146f6c);var _0x581e96=getRows(_0x285fcc,_0x3c18b7);_0x538049['body']=_0x538049[_0x41f0('0x16')][_0x41f0('0x18')](_0x581e96);return _0x538049;}function createTables(_0x9bde26){var _0x4c35dc=[];var _0x4e85f0=_[_0x41f0('0x19')](Object[_0x41f0('0x1a')](_0x9bde26[0x0]),0x5);_0x4e85f0['forEach'](function(_0x56568d){_0x4c35dc['push'](createTable(_0x56568d,_0x9bde26));});return _0x4c35dc;}function getPDFDocDefinition(_0x10a74b){var _0x438ce5=util[_0x41f0('0x1b')](_0x41f0('0x1c'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x41f0('0x1d')])[_0x41f0('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x41f0('0x1e')])['format'](FORMAT));var _0x33e4d7=[];for(var _0x3054f9=0x0;_0x3054f9<_0x10a74b[_0x41f0('0x14')];_0x3054f9++){var _0x4f7ee0=[];if(_0x3054f9===0x0){_0x4f7ee0[_0x41f0('0x17')]({'text':_0x438ce5,'style':_0x41f0('0x1f')});}var _0x25cdf5={'table':_0x10a74b[_0x3054f9]};if(_0x3054f9>0x0){_0x25cdf5[_0x41f0('0x20')]=_0x41f0('0x21');_0x25cdf5[_0x41f0('0x22')]=[0x0,0x46,0x0,0x0];}_0x4f7ee0[_0x41f0('0x17')](_0x25cdf5);_0x33e4d7[_0x41f0('0x17')](_0x4f7ee0);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x33e4d7,'footer':function(_0x5d405e,_0x5c8378){return{'text':_0x5d405e['toString']()+'\x20/\x20'+_0x5c8378,'style':_0x41f0('0x23')};},'defaultStyle':{'font':_0x41f0('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x41f0('0x25')},'footer':{'alignment':_0x41f0('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x21269b){var _0xef3eee=0x1388;var _0x389ab0;if(!_0x21269b[0x0][_0x41f0('0x27')]){return analyticExtractedReport(_0x41f0('0x28'));}return db[_0x41f0('0x29')][_0x41f0('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x41f0('0x2b'),'splitSizePdf']})[_0x41f0('0x2c')](function(_0x5d35a3){if(_0x5d35a3){_0x389ab0=_0x5d35a3;_0xef3eee=_0x389ab0[_0x41f0('0x2d')]||0x3e8;}})['then'](function(){var _0x4bbceb=[];var _0x3709e4=0x0;if(_0x389ab0[_0x41f0('0x2b')]){if(_0x21269b&&_0x21269b[_0x41f0('0x14')]){var _0x98abe1=_['range'](_0x21269b[0x0][_0x41f0('0x27')]/_0xef3eee);var _0x509d7c=Number[_0x41f0('0x2e')](_0x21269b[0x0][_0x41f0('0x27')]/_0xef3eee)?_0x21269b[0x0][_0x41f0('0x27')]%_0xef3eee:0x0;_0x98abe1['forEach'](function(_0x32f488){if(_0x32f488>0x0){_0x3709e4+=_0xef3eee;}_0x4bbceb['push'](dbH[_0x41f0('0x2f')][_0x41f0('0x30')](util[_0x41f0('0x1b')](_0x41f0('0x31'),QUERY,_0xef3eee,_0x3709e4),{'type':dbH[_0x41f0('0x2f')]['QueryTypes'][_0x41f0('0x32')]}));});if(_0x509d7c>0x0){_0x3709e4+=_0xef3eee;_0x4bbceb[_0x41f0('0x17')](dbH['sequelize']['query'](util[_0x41f0('0x1b')](_0x41f0('0x31'),QUERY,_0x509d7c,_0x3709e4),{'type':dbH[_0x41f0('0x2f')][_0x41f0('0x33')][_0x41f0('0x32')]}));}}}else{_0x4bbceb[_0x41f0('0x17')](dbH['sequelize'][_0x41f0('0x30')](QUERY,{'type':dbH[_0x41f0('0x2f')][_0x41f0('0x33')][_0x41f0('0x32')]}));}var _0x5b1eaf=path['dirname'](PATH);var _0x5ccad6=path[_0x41f0('0x34')](PATH,'.pdf');var _0x501151=_0x389ab0['split']&&_0x4bbceb[_0x41f0('0x14')]>0x1;var _0x171097=[];if(!fs[_0x41f0('0x35')](path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6))&&_0x501151){fs[_0x41f0('0x37')](path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6));}return BPromise['each'](_0x4bbceb,function(_0x2d1fb4){_0x171097['push'](_0x2d1fb4);})[_0x41f0('0x2c')](function(){var _0x11b105=[];for(var _0x137924=0x0;_0x137924<_0x171097['length'];_0x137924+=0x1){var _0x3b43d3=_0x171097[_0x137924];var _0x4872d7=createTables(_[_0x41f0('0x38')](_0x3b43d3));var _0x189861;var _0x3ffcaf=getPDFDocDefinition(_0x4872d7);var _0x4e90ad=getPDFPrinter();var _0x44532a=_0x4e90ad[_0x41f0('0x39')](_0x3ffcaf);if(_0x501151){_0x189861=path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6,util['format'](_0x41f0('0x3a'),_0x5ccad6,_0x137924,_0x41f0('0x3b')));}else{_0x189861=path[_0x41f0('0x36')](_0x5b1eaf,util['format']('%s.%s',_0x5ccad6,'pdf'));}_0x11b105[_0x41f0('0x17')](writePDFDocument(_0x44532a,_0x189861));}return Promise[_0x41f0('0x3c')](_0x11b105);})[_0x41f0('0x2c')](function(){if(_0x501151){return new Promise(function(_0x47b6fa){zipdir(path['join'](_0x5b1eaf,_0x5ccad6),{'saveTo':path[_0x41f0('0x36')](_0x5b1eaf,util[_0x41f0('0x1b')](_0x41f0('0x3d'),_0x5ccad6,_0x41f0('0x3e')))},function(){rimraf(path['join'](_0x5b1eaf,_0x5ccad6),function(){});_0x47b6fa(_0x41f0('0x3f'));});});}})[_0x41f0('0x2c')](function(){if(!_0x501151)return;rimraf(path[_0x41f0('0x36')](_0x5b1eaf,_0x5ccad6),function(){});})['then'](function(){logger[_0x41f0('0x40')](util[_0x41f0('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x41f0('0x41')));return analyticExtractedReport('Completed',_0x501151?util[_0x41f0('0x1b')](_0x41f0('0x3d'),_0x5ccad6,_0x501151?_0x41f0('0x3e'):_0x41f0('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x41f0('0x40')](util[_0x41f0('0x1b')](_0x41f0('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x41f0('0xe')][_0x41f0('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x41f0('0x2c')](function(_0x57aae9){EXTRACTED_REPORT=_0x57aae9;return dbH[_0x41f0('0x2f')][_0x41f0('0x30')](util[_0x41f0('0x1b')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x41f0('0x2f')][_0x41f0('0x33')][_0x41f0('0x32')]});})['then'](extractReport)[_0x41f0('0x44')](function(_0x5ba138){logger[_0x41f0('0x40')](util[_0x41f0('0x1b')](_0x41f0('0x45'),EXTRACTED_REPORT_ID,_0x41f0('0x41')),util['inspect'](_0x5ba138,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x41f0('0x46'));})[_0x41f0('0x47')](function(){process[_0x41f0('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x130e3f=new PdfPrinter({'Arial':{'normal':__dirname+_0x41f0('0x49'),'bold':__dirname+_0x41f0('0x4a'),'italics':__dirname+_0x41f0('0x4b'),'bolditalics':__dirname+_0x41f0('0x4c')}});return _0x130e3f;}function getPDFDocDefinitionFromHTML(_0xedcb41,_0x37ab17){var _0x2aaeef=util[_0x41f0('0x1b')](_0x41f0('0x4d'),_0x37ab17[_0x41f0('0x4e')],_0x37ab17[_0x41f0('0x4f')]);var _0xffe6ba=moment()['format'](_0x41f0('0x50'))[_0x41f0('0x11')]();var _0x3047c5=htmlToPdfmake(_0xedcb41,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3047c5],'defaultStyle':{'font':_0x41f0('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x41f0('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x41f0('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x41f0('0x51')}},'header':function(){return[{'text':_0x41f0('0x52'),'style':_0x41f0('0x1f')}];},'footer':function(_0x32f987,_0x4e4dcf){return[{'text':util[_0x41f0('0x1b')](_0x41f0('0x53'),_0x2aaeef,_0x32f987,_0x4e4dcf,_0xffe6ba),'style':_0x41f0('0x23')}];}};}function writePDFDocument(_0x4bc5a0,_0x39f9ec){return new Promise(function(_0x44fdfa,_0x37ee1f){var _0x32c7b5=_0x4bc5a0['pipe'](fs[_0x41f0('0x54')](_0x39f9ec));_0x32c7b5['on'](_0x41f0('0x55'),function(){_0x44fdfa(_0x41f0('0x55'));});_0x32c7b5['on']('error',function(_0x3f99ad){_0x37ee1f(_0x3f99ad);});_0x4bc5a0[_0x41f0('0x56')]();});}exports['createPdfFromHTML']=function(_0x169195,_0x38b28b){var _0x150634=getPDFPrinter();var _0x55fe36=getPDFDocDefinitionFromHTML(_0x169195,_0x38b28b);var _0x29085b=_0x150634[_0x41f0('0x39')](_0x55fe36);return writePDFDocument(_0x29085b,_0x38b28b[_0x41f0('0x2')])[_0x41f0('0x44')](function(_0x368707){throw _0x368707;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 0d85be4..7e28561 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 _0xbb35=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','join','mkdirSync','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','query','format'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x552c30,_0x69ed02){_0x552c30=_0x552c30-0x0;var _0x4493f7=_0xbb35[_0x552c30];return _0x4493f7;};'use strict';var util=require('util');var path=require(_0x5bb3('0x0'));var _=require(_0x5bb3('0x1'));var fs=require('fs');var json2xls=require(_0x5bb3('0x2'));var BPromise=require(_0x5bb3('0x3'));var zipdir=require(_0x5bb3('0x4'));var rimraf=require('rimraf');var db=require(_0x5bb3('0x5'))['db'];var dbH=require(_0x5bb3('0x5'))[_0x5bb3('0x6')];var logger=require(_0x5bb3('0x7'))(_0x5bb3('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5bb3('0x9')][0x2]);var QUERY=process[_0x5bb3('0x9')][0x3];var PATH=process[_0x5bb3('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe7fb91,_0x4f59cb){var _0x14986f={'status':_0xe7fb91};var _0x11d7df={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f59cb){_0x14986f[_0x5bb3('0xa')]=_0x4f59cb;}return db[_0x5bb3('0xb')]['update'](_0x14986f,_0x11d7df);}function main(){var _0x399f28=0x1388;var _0x5621a8;logger[_0x5bb3('0xc')](util['format'](_0x5bb3('0xd'),EXTRACTED_REPORT_ID,_0x5bb3('0xe')));return db[_0x5bb3('0xf')][_0x5bb3('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5bb3('0x11'),'splitSizeXlsx']})[_0x5bb3('0x12')](function(_0xdf7055){if(_0xdf7055){_0x5621a8=_0xdf7055;_0x399f28=_0x5621a8[_0x5bb3('0x13')]||0x1388;}})['then'](function(){return dbH[_0x5bb3('0x14')][_0x5bb3('0x15')](util[_0x5bb3('0x16')](_0x5bb3('0x17'),QUERY),{'type':dbH[_0x5bb3('0x14')][_0x5bb3('0x18')][_0x5bb3('0x19')]});})[_0x5bb3('0x12')](function(_0x569002){if(!_0x569002[0x0]['num']){return analyticExtractedReport('Empty');}var _0x3722f3=[];var _0x1da0b6=0x0;if(_0x5621a8[_0x5bb3('0x11')]){if(_0x569002&&_0x569002[_0x5bb3('0x1a')]){var _0x487554=_[_0x5bb3('0x1b')](_0x569002[0x0][_0x5bb3('0x1c')]/_0x399f28);var _0xbbaf0=Number[_0x5bb3('0x1d')](_0x569002[0x0][_0x5bb3('0x1c')]/_0x399f28)?_0x569002[0x0]['num']%_0x399f28:0x0;_0x487554['forEach'](function(_0x69a423){if(_0x69a423>0x0){_0x1da0b6+=_0x399f28;}_0x3722f3[_0x5bb3('0x1e')](dbH[_0x5bb3('0x14')][_0x5bb3('0x15')](util[_0x5bb3('0x16')](_0x5bb3('0x1f'),QUERY,_0x399f28,_0x1da0b6),{'type':dbH[_0x5bb3('0x14')]['QueryTypes'][_0x5bb3('0x19')]}));});if(_0xbbaf0>0x0){_0x1da0b6+=_0x399f28;_0x3722f3[_0x5bb3('0x1e')](dbH[_0x5bb3('0x14')]['query'](util[_0x5bb3('0x16')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xbbaf0,_0x1da0b6),{'type':dbH[_0x5bb3('0x14')]['QueryTypes'][_0x5bb3('0x19')]}));}}}else{_0x3722f3[_0x5bb3('0x1e')](dbH[_0x5bb3('0x14')][_0x5bb3('0x15')](QUERY,{'type':dbH[_0x5bb3('0x14')][_0x5bb3('0x18')][_0x5bb3('0x19')]}));}var _0x4977df=path[_0x5bb3('0x20')](PATH);var _0x41e28f=path['basename'](PATH,_0x5bb3('0x21'));var _0x256a5f=_0x5621a8[_0x5bb3('0x11')]&&_0x3722f3[_0x5bb3('0x1a')]>0x1;var _0x21da73=[];if(!fs[_0x5bb3('0x22')](path[_0x5bb3('0x23')](_0x4977df,_0x41e28f))&&_0x256a5f){fs[_0x5bb3('0x24')](path['join'](_0x4977df,_0x41e28f));}return BPromise['each'](_0x3722f3,function(_0x533922){_0x21da73['push'](_0x533922);})[_0x5bb3('0x12')](function(){for(var _0x4ce15a=0x0;_0x4ce15a<_0x21da73[_0x5bb3('0x1a')];_0x4ce15a+=0x1){var _0xbdc0b5;var _0x104efe=_0x21da73[_0x4ce15a];if(_0x256a5f){_0xbdc0b5=path['join'](_0x4977df,_0x41e28f,util[_0x5bb3('0x16')](_0x5bb3('0x25'),_0x41e28f,_0x4ce15a,_0x5bb3('0x26')));}else{_0xbdc0b5=path[_0x5bb3('0x23')](_0x4977df,util['format']('%s.%s',_0x41e28f,_0x5bb3('0x26')));}fs['writeFileSync'](_0xbdc0b5,json2xls(_0x104efe),_0x5bb3('0x27'));}})[_0x5bb3('0x12')](function(){if(_0x256a5f){return new Promise(function(_0x5217ca){zipdir(path[_0x5bb3('0x23')](_0x4977df,_0x41e28f),{'saveTo':path[_0x5bb3('0x23')](_0x4977df,util[_0x5bb3('0x16')](_0x5bb3('0x28'),_0x41e28f,_0x5bb3('0x29')))},function(_0x1eb669,_0x5a4c12){rimraf(path['join'](_0x4977df,_0x41e28f),function(){});_0x5217ca(_0x5bb3('0x2a'));});});}})['then'](function(){logger[_0x5bb3('0xc')](util[_0x5bb3('0x16')](_0x5bb3('0x2b'),EXTRACTED_REPORT_ID,_0x5bb3('0xe')));return analyticExtractedReport('Completed',_0x256a5f?util['format'](_0x5bb3('0x28'),_0x41e28f,_0x256a5f?_0x5bb3('0x29'):_0x5bb3('0x26')):null);});})[_0x5bb3('0x2c')](function(_0xa39afd){logger[_0x5bb3('0xc')](util['format'](_0x5bb3('0x2d'),EXTRACTED_REPORT_ID,_0x5bb3('0xe')),util[_0x5bb3('0x2e')](_0xa39afd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5bb3('0x2f'));})[_0x5bb3('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4f0f=['writeFileSync','binary','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','range','num','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s'];(function(_0x3a74b9,_0x40b2b7){var _0x56d414=function(_0x472093){while(--_0x472093){_0x3a74b9['push'](_0x3a74b9['shift']());}};_0x56d414(++_0x40b2b7);}(_0x4f0f,0xdf));var _0xf4f0=function(_0x1cb380,_0x8ca874){_0x1cb380=_0x1cb380-0x0;var _0x21aff5=_0x4f0f[_0x1cb380];return _0x21aff5;};'use strict';var util=require(_0xf4f0('0x0'));var path=require(_0xf4f0('0x1'));var _=require(_0xf4f0('0x2'));var fs=require('fs');var json2xls=require(_0xf4f0('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xf4f0('0x4'));var rimraf=require(_0xf4f0('0x5'));var db=require(_0xf4f0('0x6'))['db'];var dbH=require('../../mysqldb')[_0xf4f0('0x7')];var logger=require('../../config/logger')(_0xf4f0('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf4f0('0x9')][0x3];var PATH=process[_0xf4f0('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x595027,_0x127bad){var _0x3157db={'status':_0x595027};var _0x1f3419={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x127bad){_0x3157db[_0xf4f0('0xa')]=_0x127bad;}return db[_0xf4f0('0xb')][_0xf4f0('0xc')](_0x3157db,_0x1f3419);}function main(){var _0x20dfc5=0x1388;var _0x445b76;logger['info'](util[_0xf4f0('0xd')](_0xf4f0('0xe'),EXTRACTED_REPORT_ID,_0xf4f0('0xf')));return db[_0xf4f0('0x10')][_0xf4f0('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf4f0('0x12'),'splitSizeXlsx']})[_0xf4f0('0x13')](function(_0x2a55c0){if(_0x2a55c0){_0x445b76=_0x2a55c0;_0x20dfc5=_0x445b76[_0xf4f0('0x14')]||0x1388;}})[_0xf4f0('0x13')](function(){return dbH[_0xf4f0('0x15')]['query'](util['format'](_0xf4f0('0x16'),QUERY),{'type':dbH[_0xf4f0('0x15')][_0xf4f0('0x17')][_0xf4f0('0x18')]});})['then'](function(_0x34af76){if(!_0x34af76[0x0]['num']){return analyticExtractedReport('Empty');}var _0x246abd=[];var _0x51ef8a=0x0;if(_0x445b76[_0xf4f0('0x12')]){if(_0x34af76&&_0x34af76[_0xf4f0('0x19')]){var _0x2b7468=_[_0xf4f0('0x1a')](_0x34af76[0x0][_0xf4f0('0x1b')]/_0x20dfc5);var _0x3fcd8f=Number[_0xf4f0('0x1c')](_0x34af76[0x0][_0xf4f0('0x1b')]/_0x20dfc5)?_0x34af76[0x0][_0xf4f0('0x1b')]%_0x20dfc5:0x0;_0x2b7468[_0xf4f0('0x1d')](function(_0x18109b){if(_0x18109b>0x0){_0x51ef8a+=_0x20dfc5;}_0x246abd[_0xf4f0('0x1e')](dbH[_0xf4f0('0x15')][_0xf4f0('0x1f')](util[_0xf4f0('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x20dfc5,_0x51ef8a),{'type':dbH[_0xf4f0('0x15')][_0xf4f0('0x17')][_0xf4f0('0x18')]}));});if(_0x3fcd8f>0x0){_0x51ef8a+=_0x20dfc5;_0x246abd[_0xf4f0('0x1e')](dbH[_0xf4f0('0x15')][_0xf4f0('0x1f')](util[_0xf4f0('0xd')](_0xf4f0('0x20'),QUERY,_0x3fcd8f,_0x51ef8a),{'type':dbH[_0xf4f0('0x15')][_0xf4f0('0x17')][_0xf4f0('0x18')]}));}}}else{_0x246abd[_0xf4f0('0x1e')](dbH[_0xf4f0('0x15')]['query'](QUERY,{'type':dbH[_0xf4f0('0x15')]['QueryTypes'][_0xf4f0('0x18')]}));}var _0x4e2173=path[_0xf4f0('0x21')](PATH);var _0x1cfe65=path[_0xf4f0('0x22')](PATH,_0xf4f0('0x23'));var _0x1f7b75=_0x445b76[_0xf4f0('0x12')]&&_0x246abd[_0xf4f0('0x19')]>0x1;var _0x34a3f8=[];if(!fs[_0xf4f0('0x24')](path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65))&&_0x1f7b75){fs[_0xf4f0('0x26')](path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65));}return BPromise[_0xf4f0('0x27')](_0x246abd,function(_0x304326){_0x34a3f8[_0xf4f0('0x1e')](_0x304326);})[_0xf4f0('0x13')](function(){for(var _0x13b84a=0x0;_0x13b84a<_0x34a3f8['length'];_0x13b84a+=0x1){var _0x2059a4;var _0x3d5f1e=_0x34a3f8[_0x13b84a];if(_0x1f7b75){_0x2059a4=path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65,util['format']('%s%d.%s',_0x1cfe65,_0x13b84a,_0xf4f0('0x28')));}else{_0x2059a4=path[_0xf4f0('0x25')](_0x4e2173,util[_0xf4f0('0xd')](_0xf4f0('0x29'),_0x1cfe65,'xlsx'));}fs[_0xf4f0('0x2a')](_0x2059a4,json2xls(_0x3d5f1e),_0xf4f0('0x2b'));}})[_0xf4f0('0x13')](function(){if(_0x1f7b75){return new Promise(function(_0x135101){zipdir(path[_0xf4f0('0x25')](_0x4e2173,_0x1cfe65),{'saveTo':path[_0xf4f0('0x25')](_0x4e2173,util[_0xf4f0('0xd')](_0xf4f0('0x29'),_0x1cfe65,'zip'))},function(_0x1199b4,_0x1eab0b){rimraf(path['join'](_0x4e2173,_0x1cfe65),function(){});_0x135101(_0xf4f0('0x2c'));});});}})[_0xf4f0('0x13')](function(){logger[_0xf4f0('0x2d')](util[_0xf4f0('0xd')](_0xf4f0('0x2e'),EXTRACTED_REPORT_ID,_0xf4f0('0xf')));return analyticExtractedReport(_0xf4f0('0x2f'),_0x1f7b75?util[_0xf4f0('0xd')](_0xf4f0('0x29'),_0x1cfe65,_0x1f7b75?_0xf4f0('0x30'):_0xf4f0('0x28')):null);});})['catch'](function(_0x1d9c4a){logger[_0xf4f0('0x2d')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf4f0('0xf')),util[_0xf4f0('0x31')](_0x1d9c4a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf4f0('0x32'));})[_0xf4f0('0x33')](function(){process[_0xf4f0('0x34')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 249a9ff..baeb7c0 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 _0x2e56=['findAll','IntervalId','models','uniq','map','exten','filter','groupBy','queue','priority','extensions','extension','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','hasOwnProperty','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','bulkCreate','catch','error','rewrite','lodash','util','Interval','then','intervals'];(function(_0x7d1e43,_0x4fa90a){var _0x5c56b8=function(_0x50c663){while(--_0x50c663){_0x7d1e43['push'](_0x7d1e43['shift']());}};_0x5c56b8(++_0x4fa90a);}(_0x2e56,0x15e));var _0x62e5=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0x2e56[_0x53f608];return _0x495b7d;};'use strict';var _=require(_0x62e5('0x0'));var util=require(_0x62e5('0x1'));function rewrite(_0x1f06bb,_0x512ada){var _0x2e6561=this;return _0x1f06bb['models'][_0x62e5('0x2')]['findAll']({'raw':!![]})[_0x62e5('0x3')](function(_0xdac6d2){_0x2e6561[_0x62e5('0x4')]=_0xdac6d2;return _0x1f06bb['models']['VoiceExtension'][_0x62e5('0x5')]({'where':{'IntervalId':_0x512ada[_0x62e5('0x6')]},'raw':!![]});})[_0x62e5('0x3')](function(_0x486b81){return _0x1f06bb[_0x62e5('0x7')]['VoiceExtension'][_0x62e5('0x5')]({'where':{'exten':{'$in':_[_0x62e5('0x8')](_[_0x62e5('0x9')](_0x486b81,_0x62e5('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x62e5('0x3')](function(_0x1a87f2){var _0x3b431d=_[_0x62e5('0xb')](_0x1a87f2,{'priority':'1'});var _0x4c0209=_[_0x62e5('0xb')](_0x1a87f2,{'isApp':0x1});var _0x3fcd85=_[_0x62e5('0xc')](_0x4c0209,_0x62e5('0xa'));var _0x270cd5=[_0x62e5('0xd'),'playback'];var _0x436d33=[];var _0x45bbd0=[];for(var _0x439cde in _0x3fcd85){if(_0x3fcd85['hasOwnProperty'](_0x439cde)){_0x2e6561[_0x62e5('0xe')]=0x2;_0x2e6561[_0x62e5('0xf')]=[];_0x2e6561[_0x62e5('0x10')]=_['find'](_0x3b431d,{'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')]});_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':util[_0x62e5('0x14')](_0x62e5('0x15'),_0x3fcd85[_0x439cde][0x0]['type']),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});if(_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')]===_0x62e5('0x18')){_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':'CDR(routeid)='+_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')],'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});}else if(_0x3fcd85[_0x439cde][0x0]['type']===_0x62e5('0x19')){if(_0x2e6561[_0x62e5('0x10')]){_0x2e6561['extensions'][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x1a')+(_0x2e6561[_0x62e5('0x10')][_0x62e5('0x1b')]?_0x62e5('0x1c')+_0x2e6561[_0x62e5('0x10')][_0x62e5('0x1b')]+'}':_0x62e5('0x1d')),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0]['exten'],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});}_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x1e')+_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')],'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561['priority']++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});var _0x586523=_0x2e6561[_0x62e5('0xe')]++;_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x1f'),'appdata':_0x62e5('0x20')+(_0x586523+0x2)+_0x62e5('0x21')+(_0x586523+0x1)+')','context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x586523,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});if(_0x2e6561[_0x62e5('0x10')]){_0x2e6561['extensions'][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0]['type'],'app':_0x62e5('0x13'),'appdata':_0x2e6561[_0x62e5('0x10')][_0x62e5('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x2e6561[_0x62e5('0x10')][_0x62e5('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0]['VoiceExtensionId']});}_0x2e6561['extensions'][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x22')+_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')],'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561['priority']++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0]['VoiceExtensionId']});if(_0x2e6561[_0x62e5('0x10')]&&_0x2e6561['extension']['hasOwnProperty'](_0x62e5('0x23'))&&_0x2e6561[_0x62e5('0x10')][_0x62e5('0x23')]!=='none'){_0x2e6561[_0x62e5('0xf')]['push']({'type':_0x3fcd85[_0x439cde][0x0]['type'],'app':'Set','appdata':_0x62e5('0x24'),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0]['exten'],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':'Set','appdata':_0x62e5('0x25')+_0x2e6561[_0x62e5('0x10')]['recordingFormat']||_0x62e5('0x26'),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});}}_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x27'),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x28'),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'priority':_0x2e6561['priority']++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0]['type'],'app':'Set','appdata':_0x62e5('0x29'),'context':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x16')],'exten':_0x3fcd85[_0x439cde][0x0]['exten'],'priority':_0x2e6561[_0x62e5('0xe')]++,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});for(var _0x5a9d59=0x0,_0x478861=0x0;_0x5a9d59<_0x3fcd85[_0x439cde][_0x62e5('0x2a')];_0x5a9d59+=0x1,_0x478861=0x0){var _0x3c0122=_0x3fcd85[_0x439cde][_0x5a9d59];if(_0x3c0122['type']){_0x3c0122[_0x62e5('0x12')]=_0x3c0122[_0x62e5('0x12')][_0x62e5('0x2b')]();}var _0x2bbb46=[];var _0x12d2c5=[];delete _0x3c0122['id'];delete _0x3c0122[_0x62e5('0x2c')];delete _0x3c0122[_0x62e5('0x2d')];var _0x513915=_0x3c0122['interval']!=='*,*,*,*'?[_0x3c0122['interval']]:_0x3c0122[_0x62e5('0x6')]?_[_0x62e5('0x9')](_[_0x62e5('0xb')](_0x2e6561['intervals'],{'IntervalId':_0x3c0122['IntervalId']}),_0x62e5('0x2e')):[];if(_0x3c0122[_0x62e5('0x2f')]('tag')){if(_0x3c0122[_0x62e5('0x30')]&&_0x3c0122['tag']!=='--'){_0x2bbb46['push']({'type':_0x3c0122[_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x31')+_0x3c0122[_0x62e5('0x30')],'context':_0x3c0122[_0x62e5('0x16')],'exten':_0x3c0122[_0x62e5('0xa')],'priority':_0x513915[_0x62e5('0x2a')]+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122['VoiceExtensionId']});}}if(_0x3c0122['type']===_0x62e5('0x19')&&_0x3c0122[_0x62e5('0x2f')](_0x62e5('0x32'))){if(_0x3c0122[_0x62e5('0x32')]){_0x2bbb46[_0x62e5('0x11')]({'type':_0x3c0122[_0x62e5('0x12')],'app':'ExecIf','appdata':_0x62e5('0x33')+_0x3c0122['callerID']+')','context':_0x3c0122[_0x62e5('0x16')],'exten':_0x3c0122[_0x62e5('0xa')],'priority':_0x513915[_0x62e5('0x2a')]+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122[_0x62e5('0x17')]});}else{_0x2bbb46[_0x62e5('0x11')]({'type':_0x3c0122[_0x62e5('0x12')],'app':_0x62e5('0x1f'),'appdata':_0x62e5('0x34'),'context':_0x3c0122[_0x62e5('0x16')],'exten':_0x3c0122['exten'],'priority':_0x513915[_0x62e5('0x2a')]+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122[_0x62e5('0x17')]});}}if(_0x3c0122[_0x62e5('0x2f')]('answer')){if(_0x270cd5[_0x62e5('0x35')](_0x3c0122['app'][_0x62e5('0x2b')]())>=0x0&&_0x3c0122[_0x62e5('0x36')]!=='custom'){if(_0x3c0122[_0x62e5('0x37')]){_0x2bbb46['push']({'type':_0x3c0122['type'],'app':_0x62e5('0x1f'),'appdata':_0x62e5('0x38'),'context':_0x3c0122['context'],'exten':_0x3c0122[_0x62e5('0xa')],'priority':_0x513915['length']+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122[_0x62e5('0x17')]});_0x2bbb46['push']({'type':_0x3c0122['type'],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x39'),'context':_0x3c0122[_0x62e5('0x16')],'exten':_0x3c0122[_0x62e5('0xa')],'priority':_0x513915[_0x62e5('0x2a')]+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122['VoiceExtensionId']});}else{_0x2bbb46['push']({'type':_0x3c0122['type'],'app':_0x62e5('0x1f'),'appdata':_0x62e5('0x3a'),'context':_0x3c0122['context'],'exten':_0x3c0122['exten'],'priority':_0x513915[_0x62e5('0x2a')]+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122[_0x62e5('0x17')]});_0x2bbb46['push']({'type':_0x3c0122[_0x62e5('0x12')],'app':_0x62e5('0x13'),'appdata':_0x62e5('0x3b'),'context':_0x3c0122['context'],'exten':_0x3c0122[_0x62e5('0xa')],'priority':_0x513915['length']+_0x2e6561[_0x62e5('0xe')]+_0x478861++,'VoiceExtensionId':_0x3c0122[_0x62e5('0x17')]});}}}for(var _0x3e47ed=0x0;_0x3e47ed<_0x513915[_0x62e5('0x2a')];_0x3e47ed+=0x1){var _0x28bb3e=_0x2e6561[_0x62e5('0xe')]+_0x513915[_0x62e5('0x2a')];var _0x205346=_0x3e47ed===_0x513915[_0x62e5('0x2a')]-0x1?_0x2e6561[_0x62e5('0xe')]+_0x2bbb46['length']+_0x12d2c5[_0x62e5('0x2a')]+0x2:_0x2e6561[_0x62e5('0xe')]+_0x3e47ed+0x1;_0x2bbb46['splice'](_0x3e47ed,0x0,{'type':_0x3c0122[_0x62e5('0x12')],'app':'GotoIfTime','appdata':_0x513915[_0x3e47ed]+'?'+_0x3c0122[_0x62e5('0x16')]+',${EXTEN},'+_0x28bb3e+':'+_0x3c0122[_0x62e5('0x16')]+_0x62e5('0x3c')+_0x205346,'exten':_0x3c0122['exten'],'context':_0x3c0122[_0x62e5('0x16')],'priority':_0x2e6561[_0x62e5('0xe')]+_0x3e47ed,'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});}_0x3c0122['priority']=_0x2bbb46[_0x62e5('0x2a')]?_[_0x62e5('0x3d')](_0x2bbb46)[_0x62e5('0xe')]+0x1:_0x2e6561['priority'];_0x2e6561[_0x62e5('0xe')]=(_0x12d2c5['length']?_[_0x62e5('0x3d')](_0x12d2c5)[_0x62e5('0xe')]:_0x3c0122[_0x62e5('0xe')])+0x1;_0x2e6561['extensions']=_[_0x62e5('0x3e')](_0x2e6561[_0x62e5('0xf')],_0x2bbb46,[_0x3c0122],_0x12d2c5);}_0x2e6561[_0x62e5('0xf')][_0x62e5('0x11')]({'type':_0x3fcd85[_0x439cde][0x0]['type'],'app':_0x62e5('0x3f'),'exten':_0x3fcd85[_0x439cde][0x0][_0x62e5('0xa')],'context':_0x3fcd85[_0x439cde][0x0]['context'],'priority':_0x2e6561[_0x62e5('0xe')],'VoiceExtensionId':_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]});_0x436d33[_0x62e5('0x11')](_0x3fcd85[_0x439cde][0x0][_0x62e5('0x17')]);_0x45bbd0=_[_0x62e5('0x3e')](_0x45bbd0,_0x2e6561[_0x62e5('0xf')]);}}return _0x1f06bb[_0x62e5('0x40')](function(_0x307404){return _0x1f06bb[_0x62e5('0x7')][_0x62e5('0x41')][_0x62e5('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x436d33}},'transaction':_0x307404})[_0x62e5('0x3')](function(_0x3b3b82){return _0x1f06bb['models']['VoiceExtension'][_0x62e5('0x43')](_['sortBy'](_0x45bbd0,'priority'),{'transaction':_0x307404});});});})[_0x62e5('0x44')](function(_0x4cf9b1){console[_0x62e5('0x45')](_0x4cf9b1);});}exports[_0x62e5('0x46')]=rewrite; \ No newline at end of file +var _0xcc39=['findAll','then','intervals','VoiceExtension','IntervalId','map','exten','filter','playback','hasOwnProperty','priority','extensions','find','push','type','Set','format','CDR(type)=%s','context','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','answer','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','bulkCreate','sortBy','error','lodash','util','models','Interval'];(function(_0x5b27ab,_0x2efcdc){var _0x1b45a4=function(_0xd90dcb){while(--_0xd90dcb){_0x5b27ab['push'](_0x5b27ab['shift']());}};_0x1b45a4(++_0x2efcdc);}(_0xcc39,0x1d1));var _0x9cc3=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xcc39[_0x41cfd4];return _0x190f48;};'use strict';var _=require(_0x9cc3('0x0'));var util=require(_0x9cc3('0x1'));function rewrite(_0x186903,_0x221736){var _0x14968d=this;return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x3')][_0x9cc3('0x4')]({'raw':!![]})[_0x9cc3('0x5')](function(_0x5b29fa){_0x14968d[_0x9cc3('0x6')]=_0x5b29fa;return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x7')]['findAll']({'where':{'IntervalId':_0x221736[_0x9cc3('0x8')]},'raw':!![]});})[_0x9cc3('0x5')](function(_0xf74b19){return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x7')][_0x9cc3('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x9cc3('0x9')](_0xf74b19,_0x9cc3('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x5272c4){var _0x4f12b9=_[_0x9cc3('0xb')](_0x5272c4,{'priority':'1'});var _0x5ade90=_[_0x9cc3('0xb')](_0x5272c4,{'isApp':0x1});var _0x6ab743=_['groupBy'](_0x5ade90,_0x9cc3('0xa'));var _0x2b9fe8=['queue',_0x9cc3('0xc')];var _0x3419d3=[];var _0x2f8c9e=[];for(var _0x27211d in _0x6ab743){if(_0x6ab743[_0x9cc3('0xd')](_0x27211d)){_0x14968d[_0x9cc3('0xe')]=0x2;_0x14968d[_0x9cc3('0xf')]=[];_0x14968d['extension']=_[_0x9cc3('0x10')](_0x4f12b9,{'exten':_0x6ab743[_0x27211d][0x0]['exten']});_0x14968d['extensions'][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':util[_0x9cc3('0x14')](_0x9cc3('0x15'),_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')]),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});if(_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')]==='inbound'){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x17')+_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d['priority']++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});}else if(_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')]===_0x9cc3('0x19')){if(_0x14968d['extension']){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x1a')+(_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x1c')]?_0x9cc3('0x1d')+_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x1c')]+'}':_0x9cc3('0x1e')),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});}_0x14968d[_0x9cc3('0xf')]['push']({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':'Set','appdata':_0x9cc3('0x17')+_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});var _0x3f223c=_0x14968d['priority']++;_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':'ExecIf','appdata':_0x9cc3('0x1f')+(_0x3f223c+0x2)+_0x9cc3('0x20')+(_0x3f223c+0x1)+')','context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x3f223c,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});if(_0x14968d[_0x9cc3('0x1b')]){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x14968d['extension'][_0x9cc3('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x14968d['extension']['cutdigits']+'}':_0x9cc3('0x21'),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});}_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':'Set','appdata':_0x9cc3('0x22')+_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});if(_0x14968d[_0x9cc3('0x1b')]&&_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0xd')](_0x9cc3('0x23'))&&_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x23')]!==_0x9cc3('0x24')){_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});_0x14968d['extensions'][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x14968d[_0x9cc3('0x1b')][_0x9cc3('0x23')]||_0x9cc3('0x25'),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});}}_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d['priority']++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x26'),'context':_0x6ab743[_0x27211d][0x0]['context'],'exten':_0x6ab743[_0x27211d][0x0][_0x9cc3('0xa')],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});_0x14968d[_0x9cc3('0xf')][_0x9cc3('0x11')]({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x27'),'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'exten':_0x6ab743[_0x27211d][0x0]['exten'],'priority':_0x14968d[_0x9cc3('0xe')]++,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});for(var _0x1a5219=0x0,_0xe35396=0x0;_0x1a5219<_0x6ab743[_0x27211d]['length'];_0x1a5219+=0x1,_0xe35396=0x0){var _0x10b54e=_0x6ab743[_0x27211d][_0x1a5219];if(_0x10b54e[_0x9cc3('0x12')]){_0x10b54e[_0x9cc3('0x12')]=_0x10b54e[_0x9cc3('0x12')][_0x9cc3('0x28')]();}var _0x36044f=[];var _0x26e516=[];delete _0x10b54e['id'];delete _0x10b54e[_0x9cc3('0x29')];delete _0x10b54e[_0x9cc3('0x2a')];var _0x373c77=_0x10b54e['interval']!==_0x9cc3('0x2b')?[_0x10b54e[_0x9cc3('0x2c')]]:_0x10b54e[_0x9cc3('0x8')]?_[_0x9cc3('0x9')](_[_0x9cc3('0xb')](_0x14968d[_0x9cc3('0x6')],{'IntervalId':_0x10b54e['IntervalId']}),_0x9cc3('0x2c')):[];if(_0x10b54e[_0x9cc3('0xd')]('tag')){if(_0x10b54e[_0x9cc3('0x2d')]&&_0x10b54e['tag']!=='--'){_0x36044f['push']({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x2e')+_0x10b54e[_0x9cc3('0x2d')],'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d['priority']+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}}if(_0x10b54e[_0x9cc3('0x12')]===_0x9cc3('0x19')&&_0x10b54e[_0x9cc3('0xd')](_0x9cc3('0x30'))){if(_0x10b54e[_0x9cc3('0x30')]){_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':'ExecIf','appdata':_0x9cc3('0x31')+_0x10b54e[_0x9cc3('0x30')]+')','context':_0x10b54e['context'],'exten':_0x10b54e['exten'],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}else{_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x32'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77['length']+_0x14968d['priority']+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}}if(_0x10b54e[_0x9cc3('0xd')](_0x9cc3('0x33'))){if(_0x2b9fe8['indexOf'](_0x10b54e[_0x9cc3('0x34')][_0x9cc3('0x28')]())>=0x0&&_0x10b54e[_0x9cc3('0x35')]!=='custom'){if(_0x10b54e[_0x9cc3('0x33')]){_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x32'),'appdata':_0x9cc3('0x36'),'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e['VoiceExtensionId']});_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x37'),'context':_0x10b54e['context'],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77['length']+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});}else{_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e[_0x9cc3('0x12')],'app':_0x9cc3('0x32'),'appdata':_0x9cc3('0x38'),'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77['length']+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e[_0x9cc3('0x18')]});_0x36044f[_0x9cc3('0x11')]({'type':_0x10b54e['type'],'app':_0x9cc3('0x13'),'appdata':_0x9cc3('0x39'),'context':_0x10b54e[_0x9cc3('0x16')],'exten':_0x10b54e[_0x9cc3('0xa')],'priority':_0x373c77[_0x9cc3('0x2f')]+_0x14968d[_0x9cc3('0xe')]+_0xe35396++,'VoiceExtensionId':_0x10b54e['VoiceExtensionId']});}}}for(var _0x4fc8b1=0x0;_0x4fc8b1<_0x373c77[_0x9cc3('0x2f')];_0x4fc8b1+=0x1){var _0x44a44f=_0x14968d[_0x9cc3('0xe')]+_0x373c77['length'];var _0x11f3fd=_0x4fc8b1===_0x373c77['length']-0x1?_0x14968d[_0x9cc3('0xe')]+_0x36044f[_0x9cc3('0x2f')]+_0x26e516[_0x9cc3('0x2f')]+0x2:_0x14968d[_0x9cc3('0xe')]+_0x4fc8b1+0x1;_0x36044f[_0x9cc3('0x3a')](_0x4fc8b1,0x0,{'type':_0x10b54e['type'],'app':_0x9cc3('0x3b'),'appdata':_0x373c77[_0x4fc8b1]+'?'+_0x10b54e[_0x9cc3('0x16')]+_0x9cc3('0x3c')+_0x44a44f+':'+_0x10b54e[_0x9cc3('0x16')]+_0x9cc3('0x3c')+_0x11f3fd,'exten':_0x10b54e['exten'],'context':_0x10b54e['context'],'priority':_0x14968d[_0x9cc3('0xe')]+_0x4fc8b1,'VoiceExtensionId':_0x6ab743[_0x27211d][0x0]['VoiceExtensionId']});}_0x10b54e[_0x9cc3('0xe')]=_0x36044f['length']?_[_0x9cc3('0x3d')](_0x36044f)[_0x9cc3('0xe')]+0x1:_0x14968d[_0x9cc3('0xe')];_0x14968d[_0x9cc3('0xe')]=(_0x26e516[_0x9cc3('0x2f')]?_[_0x9cc3('0x3d')](_0x26e516)[_0x9cc3('0xe')]:_0x10b54e['priority'])+0x1;_0x14968d[_0x9cc3('0xf')]=_[_0x9cc3('0x3e')](_0x14968d['extensions'],_0x36044f,[_0x10b54e],_0x26e516);}_0x14968d['extensions']['push']({'type':_0x6ab743[_0x27211d][0x0]['type'],'app':_0x9cc3('0x3f'),'exten':_0x6ab743[_0x27211d][0x0]['exten'],'context':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x16')],'priority':_0x14968d[_0x9cc3('0xe')],'VoiceExtensionId':_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]});_0x3419d3['push'](_0x6ab743[_0x27211d][0x0][_0x9cc3('0x18')]);_0x2f8c9e=_[_0x9cc3('0x3e')](_0x2f8c9e,_0x14968d[_0x9cc3('0xf')]);}}return _0x186903['transaction'](function(_0x3d16b8){return _0x186903[_0x9cc3('0x2')][_0x9cc3('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3419d3}},'transaction':_0x3d16b8})['then'](function(_0x4f94bd){return _0x186903['models'][_0x9cc3('0x7')][_0x9cc3('0x40')](_[_0x9cc3('0x41')](_0x2f8c9e,_0x9cc3('0xe')),{'transaction':_0x3d16b8});});});})['catch'](function(_0x2de68c){console[_0x9cc3('0x42')](_0x2de68c);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 847a20f..aa50d76 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 _0xac68=['toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','fromQuery','scheduledAt','id\x20IN\x20?','str','calleridnum','cm_hopper_final','ListId\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','always','query','onlyIfOpen','sequelize','VoiceQueueId','outbound','get','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','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','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','cm_hopper','ContactId','ListId','updatedAt','select','field','NOW()','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL'];(function(_0x347bb5,_0x53bef1){var _0x460d71=function(_0x50c900){while(--_0x50c900){_0x347bb5['push'](_0x347bb5['shift']());}};_0x460d71(++_0x53bef1);}(_0xac68,0x1df));var _0x8ac6=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xac68[_0x1d24eb];return _0x1dc576;};'use strict';var BPromise=require(_0x8ac6('0x0'));var util=require(_0x8ac6('0x1'));var _=require(_0x8ac6('0x2'));var fs=require('fs');var squel=require(_0x8ac6('0x3'));var Papa=require(_0x8ac6('0x4'));var Redis=require(_0x8ac6('0x5'));var db=require(_0x8ac6('0x6'))['db'];var config=require(_0x8ac6('0x7'));var logger=require(_0x8ac6('0x8'))('api');config['redis']=_['defaults'](config[_0x8ac6('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x8ac6('0xa')](socket);try{if(!process['argv'][0x2]||process[_0x8ac6('0xb')][0x2]==='undefined'||process[_0x8ac6('0xb')][0x2]==='null'){throw new Error(_0x8ac6('0xc'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x8ac6('0xd')||process['argv'][0x3]===_0x8ac6('0xe')||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process['argv'][0x4]===_0x8ac6('0xe')){throw new Error(_0x8ac6('0xf'));}var FIELDS=_[_0x8ac6('0x10')](process[_0x8ac6('0xb')][0x3][_0x8ac6('0x11')](','),process[_0x8ac6('0xb')][0x4]['split'](','));if(!process[_0x8ac6('0xb')][0x5]||process[_0x8ac6('0xb')][0x5]===_0x8ac6('0xd')||process['argv'][0x5]===_0x8ac6('0xe')){throw new Error(_0x8ac6('0x12'));}var LISTID=process[_0x8ac6('0xb')][0x5];var COMPANYID=process[_0x8ac6('0xb')][0x6]&&process[_0x8ac6('0xb')][0x6]!==_0x8ac6('0xd')&&process[_0x8ac6('0xb')][0x6]!==_0x8ac6('0xe')?process[_0x8ac6('0xb')][0x6]:null;var DUPLICATES=process[_0x8ac6('0xb')][0x7]&&process[_0x8ac6('0xb')][0x7]!==_0x8ac6('0xd')&&process['argv'][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x8ac6('0xb')][0x8]||process['argv'][0x8]===_0x8ac6('0xd')||process[_0x8ac6('0xb')][0x8]===_0x8ac6('0xe')){throw new Error(_0x8ac6('0x13'));}var SOCKET_TIMESTAMP=process[_0x8ac6('0xb')][0x8];}catch(_0x50c800){logger['error'](_0x50c800);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(_0x447a85,_0x7bb47e,_0x1e577c,_0x1e0860){var _0x11bc1e={'message':_0x7bb47e};_0x11bc1e[_0x447a85]=!![];if(_0x1e577c){_0x11bc1e[_0x8ac6('0x14')]=_0x1e577c;}if(_0x1e0860){_0x11bc1e[_0x8ac6('0x15')]=_0x1e0860;}return _0x11bc1e;}function isEmail(_0x5381a1){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))*$/[_0x8ac6('0x16')](_0x5381a1);}function checkRow(_0x5c5fd1,_0x4fa824,_0x52c587){return new BPromise(function(_0x293c02,_0x5dd57e){if(_[_0x8ac6('0x17')](_0x5c5fd1)){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x18'),_0x8ac6('0x19'),null,_0x52c587));}if(_0x5c5fd1[_0x8ac6('0x1a')]&&_0x5c5fd1['errors']['length']){var _0x5b0b5b=_[_0x8ac6('0x1b')](_0x5c5fd1[_0x8ac6('0x1a')],_0x8ac6('0x1c'))[_0x8ac6('0x1d')](';');return _0x5dd57e(handleCheckRowError('error',_0x5b0b5b,null,_0x52c587));}var _0x37e420={};for(var _0x24340e in FIELDS){if(FIELDS['hasOwnProperty'](_0x24340e)&&FIELDS[_0x24340e]){_0x37e420[_0x24340e]=_0x5c5fd1['data'][0x0][FIELDS[_0x24340e]]||_0x5c5fd1[_0x8ac6('0x1e')][0x0]['\ufeff'+FIELDS[_0x24340e]];}}if(!_0x37e420[_0x8ac6('0x1f')]){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x18'),_0x8ac6('0x20'),null,_0x52c587));}if(!_0x37e420[_0x8ac6('0x21')]){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x18'),_0x8ac6('0x22'),null,_0x52c587));}if(_0x37e420[_0x8ac6('0x23')]){var _0x4810cc=moment(_0x37e420[_0x8ac6('0x23')],_0x8ac6('0x24'));if(!_0x4810cc[_0x8ac6('0x25')]()){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x18'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x52c587));}}if(_0x37e420[_0x8ac6('0x26')]){if(!isEmail(_0x37e420[_0x8ac6('0x26')])){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x52c587));}}_0x37e420['ListId']=LISTID;_0x37e420[_0x8ac6('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8ac6('0x28')]&&_0x4fa824){var _0x2b4773={};for(var _0x4e2ebc=0x0,_0x9e6208=DUPLICATES[_0x8ac6('0x28')];_0x4e2ebc<_0x9e6208;_0x4e2ebc+=0x1){_0x2b4773[DUPLICATES[_0x4e2ebc]]=_0x37e420[DUPLICATES[_0x4e2ebc]];}var _0x360277=_[_0x8ac6('0x29')](_0x4fa824,_0x2b4773);if(_0x360277){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x2a'),_0x8ac6('0x2b'),_0x360277,_0x52c587));}}return db[_0x8ac6('0x2c')][_0x8ac6('0x2d')](_0x37e420,{'raw':!![],'hooks':![],'fields':_[_0x8ac6('0x2e')](_0x37e420)})[_0x8ac6('0x2f')](function(_0x4ebe2d){if(DUPLICATES&&DUPLICATES[_0x8ac6('0x28')]&&_0x4fa824){_0x4fa824[_0x8ac6('0x30')](_['pick'](_0x37e420,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4ebe2d['id'];return _0x293c02();})[_0x8ac6('0x31')](function(_0x5546e9){return _0x5dd57e(handleCheckRowError(_0x8ac6('0x18'),_0x8ac6('0x32')+(_0x5546e9['message']||JSON[_0x8ac6('0x33')](_0x5546e9)),null,_0x52c587));});});}function checkHopper(){function _0xb43944(){return function(_0x1b3794){logger['error']('cmContact',_0x8ac6('0x34'),util['inspect'](_0x1b3794,{'showHidden':![],'depth':null}));};}var _0x428d6f=function(_0x33e75f,_0x45fc29){var _0x2a76e6=squel[_0x8ac6('0x35')]()['into'](_0x8ac6('0x36'))['fromQuery']([_0x8ac6('0x21'),'scheduledAt',_0x8ac6('0x37'),_0x8ac6('0x38'),_0x45fc29,'createdAt',_0x8ac6('0x39')],squel[_0x8ac6('0x3a')]()[_0x8ac6('0x3b')](_0x8ac6('0x21'),_0x8ac6('0x21'))[_0x8ac6('0x3b')](_0x8ac6('0x3c'),'scheduledAt')['field']('id',_0x8ac6('0x37'))[_0x8ac6('0x3b')](LISTID['toString'](),_0x8ac6('0x38'))[_0x8ac6('0x3b')](_0x33e75f['id']['toString'](),_0x45fc29)['field'](_0x8ac6('0x3c'),_0x8ac6('0x3d'))['field'](_0x8ac6('0x3c'),_0x8ac6('0x39'))[_0x8ac6('0x3e')](_0x8ac6('0x3f'))[_0x8ac6('0x40')](_0x8ac6('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x8ac6('0x42')]())['where'](_0x8ac6('0x43'))[_0x8ac6('0x40')](_0x8ac6('0x44'),squel[_0x8ac6('0x3a')]()['field']('phone')['from'](_0x8ac6('0x36'))['where'](_0x45fc29+_0x8ac6('0x45'),_0x33e75f['id']['toString']())))[_0x8ac6('0x42')]();return _0x2a76e6;};var _0x14567b=function(_0x37a57e,_0x3939a0){var _0x42640f=squel[_0x8ac6('0x35')]()[_0x8ac6('0x46')]('cm_hopper')[_0x8ac6('0x47')]([_0x8ac6('0x21'),'scheduledAt','ContactId','ListId',_0x3939a0,_0x8ac6('0x3d'),_0x8ac6('0x39')],squel[_0x8ac6('0x3a')]()['field'](_0x8ac6('0x21'),_0x8ac6('0x21'))[_0x8ac6('0x3b')](_0x8ac6('0x3c'),_0x8ac6('0x48'))[_0x8ac6('0x3b')]('id',_0x8ac6('0x37'))['field'](LISTID['toString'](),_0x8ac6('0x38'))[_0x8ac6('0x3b')](_0x37a57e['id'][_0x8ac6('0x42')](),_0x3939a0)['field'](_0x8ac6('0x3c'),_0x8ac6('0x3d'))[_0x8ac6('0x3b')](_0x8ac6('0x3c'),_0x8ac6('0x39'))[_0x8ac6('0x3e')](_0x8ac6('0x3f'))['where'](_0x8ac6('0x41'))[_0x8ac6('0x40')]('ListId\x20=\x20?',LISTID['toString']())[_0x8ac6('0x40')](_0x8ac6('0x49'),squel[_0x8ac6('0x4a')](hopperContacts))[_0x8ac6('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x8ac6('0x40')](_0x8ac6('0x44'),squel[_0x8ac6('0x3a')]()[_0x8ac6('0x3b')](_0x8ac6('0x4b'))[_0x8ac6('0x3e')](_0x8ac6('0x4c'))[_0x8ac6('0x40')](_0x3939a0+_0x8ac6('0x45'),_0x37a57e['id'][_0x8ac6('0x42')]()))[_0x8ac6('0x40')](_0x8ac6('0x44'),squel[_0x8ac6('0x3a')]()[_0x8ac6('0x3b')](_0x8ac6('0x21'))[_0x8ac6('0x3e')]('cm_hopper')[_0x8ac6('0x40')](_0x3939a0+_0x8ac6('0x45'),_0x37a57e['id']['toString']())))['toString']();return _0x42640f;};function _0x4b1e7d(_0x3e5e5d,_0xbd597b){var _0x174260=squel[_0x8ac6('0x35')]()[_0x8ac6('0x46')](_0x8ac6('0x36'))[_0x8ac6('0x47')]([_0x8ac6('0x21'),'scheduledAt','ContactId',_0x8ac6('0x38'),_0xbd597b,_0x8ac6('0x3d'),_0x8ac6('0x39')],squel[_0x8ac6('0x3a')]()['field']('phone',_0x8ac6('0x21'))[_0x8ac6('0x3b')](_0x8ac6('0x3c'),_0x8ac6('0x48'))['field']('id',_0x8ac6('0x37'))[_0x8ac6('0x3b')](LISTID[_0x8ac6('0x42')](),'ListId')[_0x8ac6('0x3b')](_0x3e5e5d['id'][_0x8ac6('0x42')](),_0xbd597b)[_0x8ac6('0x3b')](_0x8ac6('0x3c'),_0x8ac6('0x3d'))['field'](_0x8ac6('0x3c'),'updatedAt')[_0x8ac6('0x3e')](_0x8ac6('0x3f'))['where'](_0x8ac6('0x41'))[_0x8ac6('0x40')](_0x8ac6('0x4d'),LISTID['toString']())[_0x8ac6('0x40')]('id\x20IN\x20?',squel[_0x8ac6('0x4a')](hopperContacts))[_0x8ac6('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0x8ac6('0x42')]();return _0x174260;}function _0x215f16(_0x56dda1,_0xabc835){var _0x3c04da=squel[_0x8ac6('0x35')]()[_0x8ac6('0x46')](_0x8ac6('0x4e'))[_0x8ac6('0x47')](['phone',_0x8ac6('0x37'),_0x8ac6('0x38'),_0xabc835,_0x8ac6('0x3d'),_0x8ac6('0x39')],squel['select']()[_0x8ac6('0x3b')](_0x8ac6('0x21'),_0x8ac6('0x21'))[_0x8ac6('0x3b')]('id',_0x8ac6('0x37'))['field'](LISTID['toString'](),_0x8ac6('0x38'))[_0x8ac6('0x3b')](_0x56dda1['id']['toString'](),_0xabc835)[_0x8ac6('0x3b')](_0x8ac6('0x3c'),'createdAt')[_0x8ac6('0x3b')](_0x8ac6('0x3c'),_0x8ac6('0x39'))[_0x8ac6('0x3e')]('cm_contacts')[_0x8ac6('0x40')](_0x8ac6('0x41'))[_0x8ac6('0x40')](_0x8ac6('0x4d'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x8ac6('0x4a')](hopperContacts))[_0x8ac6('0x40')](_0x8ac6('0x43')))['toString']();return _0x3c04da;}return db[_0x8ac6('0x4f')][_0x8ac6('0x50')]({'where':{'type':'outbound'},'attributes':['id',_0x8ac6('0x51')],'include':[{'model':db[_0x8ac6('0x52')],'as':_0x8ac6('0x53'),'where':{'id':LISTID}}]})[_0x8ac6('0x2f')](function(_0x313b3f){var _0x4e32db=[];if(_0x313b3f){var _0x6122c2;for(var _0x6d6f4e=0x0,_0x4d18a0;_0x6d6f4e<_0x313b3f[_0x8ac6('0x28')];_0x6d6f4e+=0x1){_0x4d18a0=_0x313b3f[_0x6d6f4e]['get']({'plain':!![]});switch(_0x4d18a0[_0x8ac6('0x51')]){case _0x8ac6('0x54'):_0x4e32db['push'](db['sequelize'][_0x8ac6('0x55')](_0x14567b(_0x4d18a0,'VoiceQueueId'))[_0x8ac6('0x2f')](function(){})['catch'](_0xb43944()));break;case _0x8ac6('0x56'):_0x4e32db[_0x8ac6('0x30')](db[_0x8ac6('0x57')][_0x8ac6('0x55')](_0x428d6f(_0x4d18a0,_0x8ac6('0x58')))[_0x8ac6('0x2f')](function(){})[_0x8ac6('0x31')](_0xb43944()));break;default:_0x4e32db['push'](db['sequelize'][_0x8ac6('0x55')](_0x4b1e7d(_0x4d18a0,_0x8ac6('0x58')))['then'](function(){})['catch'](_0xb43944()));}}}return _0x4e32db;})['all']()['then'](function(){return db[_0x8ac6('0x4f')]['findAll']({'where':{'type':_0x8ac6('0x59')},'attributes':['id'],'include':[{'model':db[_0x8ac6('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x8ac6('0x2f')](function(_0x594303){var _0xff9406=[];if(_0x594303){var _0x176729;for(var _0x473d83=0x0,_0x1f36cd;_0x473d83<_0x594303[_0x8ac6('0x28')];_0x473d83+=0x1){_0x1f36cd=_0x594303[_0x473d83][_0x8ac6('0x5a')]({'plain':!![]});_0xff9406[_0x8ac6('0x30')](db[_0x8ac6('0x57')][_0x8ac6('0x55')](_0x215f16(_0x1f36cd,_0x8ac6('0x58')))['then'](function(){})['catch'](_0xb43944()));}}return _0xff9406;})[_0x8ac6('0x5b')]();})['then'](function(){return db[_0x8ac6('0x5c')]['findAll']({'attributes':['id',_0x8ac6('0x51')],'include':[{'model':db[_0x8ac6('0x52')],'as':_0x8ac6('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x968901){var _0x10c70f=[];if(_0x968901){for(var _0x49a538=0x0,_0x30f206;_0x49a538<_0x968901['length'];_0x49a538+=0x1){_0x30f206=_0x968901[_0x49a538]['get']({'plain':!![]});switch(_0x30f206[_0x8ac6('0x51')]){case _0x8ac6('0x54'):_0x10c70f[_0x8ac6('0x30')](db[_0x8ac6('0x57')]['query'](_0x14567b(_0x30f206,_0x8ac6('0x5d')))[_0x8ac6('0x2f')](function(){})['catch'](_0xb43944()));break;case'onlyIfOpen':_0x10c70f[_0x8ac6('0x30')](db[_0x8ac6('0x57')][_0x8ac6('0x55')](_0x428d6f(_0x30f206,_0x8ac6('0x5d')))[_0x8ac6('0x2f')](function(){})[_0x8ac6('0x31')](_0xb43944()));break;default:_0x10c70f[_0x8ac6('0x30')](db[_0x8ac6('0x57')]['query'](_0x4b1e7d(_0x30f206,_0x8ac6('0x5d')))[_0x8ac6('0x2f')](function(){})[_0x8ac6('0x31')](_0xb43944()));}}}return _0x10c70f;})[_0x8ac6('0x5b')]();})[_0x8ac6('0x2f')](function(){return db[_0x8ac6('0x5c')][_0x8ac6('0x50')]({'attributes':['id'],'include':[{'model':db[_0x8ac6('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x8ac6('0x2f')](function(_0x44bb77){var _0x28ae24=[];if(_0x44bb77){for(var _0x1b7d1b=0x0,_0x509407;_0x1b7d1b<_0x44bb77[_0x8ac6('0x28')];_0x1b7d1b+=0x1){_0x509407=_0x44bb77[_0x1b7d1b]['get']({'plain':!![]});_0x28ae24[_0x8ac6('0x30')](db[_0x8ac6('0x57')][_0x8ac6('0x55')](_0x215f16(_0x509407,_0x8ac6('0x5d')))[_0x8ac6('0x2f')](function(){})[_0x8ac6('0x31')](_0xb43944()));}}return _0x28ae24;})[_0x8ac6('0x5b')]();})['catch'](function(_0x585110){logger[_0x8ac6('0x18')](_0x8ac6('0x5e'),'generalCheckHopper',_0x585110['message']);});}var processPromises=function(_0x502edd){return BPromise[_0x8ac6('0x5b')](promises)[_0x8ac6('0x2f')](function(_0x5c0562){})[_0x8ac6('0x31')](function(_0x5e54e8){logger[_0x8ac6('0x18')](_0x8ac6('0x5f'),JSON[_0x8ac6('0x33')](_0x5e54e8));})[_0x8ac6('0x60')](function(){socket[_0x8ac6('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x502edd){return _0x502edd['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x8ac6('0x2f')](function(){socket[_0x8ac6('0x61')](_0x8ac6('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8ac6('0x63')](FILEPATH);}catch(_0x59bbb0){logger[_0x8ac6('0x18')](_0x8ac6('0x64'),JSON[_0x8ac6('0x33')](_0x59bbb0));}finally{process[_0x8ac6('0x65')](0x0);}});};process['on'](_0x8ac6('0x66'),function(){logger[_0x8ac6('0x67')](_0x8ac6('0x68'));endCsv();});function main(){return BPromise['resolve']()[_0x8ac6('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x8ac6('0x2c')][_0x8ac6('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8ac6('0x2f')](function(_0x4dfd06){var _0x5bdcda=fs[_0x8ac6('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8ac6('0x6a')](_0x5bdcda,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3fe251,_0x38214a){total+=0x1;var _0x100acd=total;promises[_0x8ac6('0x30')](checkRow(_0x3fe251,_0x4dfd06,_0x100acd)['then'](function(){success+=0x1;})[_0x8ac6('0x31')](function(_0x217b8f){if(_0x217b8f[_0x8ac6('0x18')]){errors+=0x1;delete _0x217b8f['error'];}else if(_0x217b8f[_0x8ac6('0x2a')]){duplicates+=0x1;delete _0x217b8f['duplicate'];}rows[_0x8ac6('0x30')](_0x217b8f);}));if(total%0xc8===0x0){_0x38214a['pause']();return processPromises(_0x38214a);}},'complete':function(){return processPromises()[_0x8ac6('0x2f')](function(){logger[_0x8ac6('0x67')](_0x8ac6('0x6b'));endCsv();});},'error':function(_0xbc0694,_0x44e2f1){logger[_0x8ac6('0x67')](_0x8ac6('0x6c'),JSON[_0x8ac6('0x33')](_0xbc0694));endCsv();}});})['catch'](function(_0x1c097f){logger[_0x8ac6('0x18')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8ac6('0x33')](_0x1c097f));});}main(); \ No newline at end of file +var _0xb5b4=['error','contact','index','test','errors','message','join','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','always','query','VoiceQueueId','onlyIfOpen','sequelize','findAll','BlackLists','get','all','Campaign','Lists','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb5b4,0x1ab));var _0x4b5b=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xb5b4[_0x5cab28];return _0xa3554d;};'use strict';var BPromise=require(_0x4b5b('0x0'));var util=require('util');var _=require(_0x4b5b('0x1'));var fs=require('fs');var squel=require(_0x4b5b('0x2'));var Papa=require(_0x4b5b('0x3'));var Redis=require(_0x4b5b('0x4'));var db=require(_0x4b5b('0x5'))['db'];var config=require(_0x4b5b('0x6'));var logger=require(_0x4b5b('0x7'))('api');config[_0x4b5b('0x8')]=_['defaults'](config[_0x4b5b('0x8')],{'host':_0x4b5b('0x9'),'port':0x18eb});var socket=require(_0x4b5b('0xa'))(new Redis(config[_0x4b5b('0x8')]));require(_0x4b5b('0xb'))[_0x4b5b('0xc')](socket);try{if(!process[_0x4b5b('0xd')][0x2]||process[_0x4b5b('0xd')][0x2]==='undefined'||process[_0x4b5b('0xd')][0x2]===_0x4b5b('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x4b5b('0xd')][0x2];if(!process['argv'][0x3]||process[_0x4b5b('0xd')][0x3]===_0x4b5b('0xf')||process[_0x4b5b('0xd')][0x3]==='null'||!process[_0x4b5b('0xd')][0x4]||process[_0x4b5b('0xd')][0x4]===_0x4b5b('0xf')||process[_0x4b5b('0xd')][0x4]===_0x4b5b('0xe')){throw new Error(_0x4b5b('0x10'));}var FIELDS=_[_0x4b5b('0x11')](process[_0x4b5b('0xd')][0x3]['split'](','),process[_0x4b5b('0xd')][0x4][_0x4b5b('0x12')](','));if(!process['argv'][0x5]||process[_0x4b5b('0xd')][0x5]==='undefined'||process[_0x4b5b('0xd')][0x5]==='null'){throw new Error(_0x4b5b('0x13'));}var LISTID=process[_0x4b5b('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x4b5b('0xd')][0x6]!==_0x4b5b('0xf')&&process[_0x4b5b('0xd')][0x6]!==_0x4b5b('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x4b5b('0xd')][0x7]&&process['argv'][0x7]!==_0x4b5b('0xf')&&process[_0x4b5b('0xd')][0x7]!=='null'?process[_0x4b5b('0xd')][0x7]:null;if(!process[_0x4b5b('0xd')][0x8]||process[_0x4b5b('0xd')][0x8]==='undefined'||process[_0x4b5b('0xd')][0x8]===_0x4b5b('0xe')){throw new Error(_0x4b5b('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x58afd9){logger[_0x4b5b('0x15')](_0x58afd9);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(_0x33093,_0x420350,_0x56024b,_0x4ca5a4){var _0x526890={'message':_0x420350};_0x526890[_0x33093]=!![];if(_0x56024b){_0x526890[_0x4b5b('0x16')]=_0x56024b;}if(_0x4ca5a4){_0x526890[_0x4b5b('0x17')]=_0x4ca5a4;}return _0x526890;}function isEmail(_0x5e12ad){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))*$/[_0x4b5b('0x18')](_0x5e12ad);}function checkRow(_0x113ed0,_0x1ee05e,_0x36fc3b){return new BPromise(function(_0xc0058c,_0x2fe166){if(_['isNil'](_0x113ed0)){return _0x2fe166(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x36fc3b));}if(_0x113ed0[_0x4b5b('0x19')]&&_0x113ed0[_0x4b5b('0x19')]['length']){var _0xf97a8c=_['map'](_0x113ed0[_0x4b5b('0x19')],_0x4b5b('0x1a'))[_0x4b5b('0x1b')](';');return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0xf97a8c,null,_0x36fc3b));}var _0x178de6={};for(var _0x2aeae4 in FIELDS){if(FIELDS['hasOwnProperty'](_0x2aeae4)&&FIELDS[_0x2aeae4]){_0x178de6[_0x2aeae4]=_0x113ed0[_0x4b5b('0x1c')][0x0][FIELDS[_0x2aeae4]]||_0x113ed0['data'][0x0]['\ufeff'+FIELDS[_0x2aeae4]];}}if(!_0x178de6['firstName']){return _0x2fe166(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x36fc3b));}if(!_0x178de6[_0x4b5b('0x1d')]){return _0x2fe166(handleCheckRowError('error',_0x4b5b('0x1e'),null,_0x36fc3b));}if(_0x178de6['birthDate']){var _0x2dde02=moment(_0x178de6[_0x4b5b('0x1f')],_0x4b5b('0x20'));if(!_0x2dde02[_0x4b5b('0x21')]()){return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0x4b5b('0x22'),null,_0x36fc3b));}}if(_0x178de6[_0x4b5b('0x23')]){if(!isEmail(_0x178de6[_0x4b5b('0x23')])){return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0x4b5b('0x24'),null,_0x36fc3b));}}_0x178de6[_0x4b5b('0x25')]=LISTID;_0x178de6[_0x4b5b('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4b5b('0x27')]&&_0x1ee05e){var _0x131447={};for(var _0xead1d4=0x0,_0x3684aa=DUPLICATES[_0x4b5b('0x27')];_0xead1d4<_0x3684aa;_0xead1d4+=0x1){_0x131447[DUPLICATES[_0xead1d4]]=_0x178de6[DUPLICATES[_0xead1d4]];}var _0x1c5c7c=_[_0x4b5b('0x28')](_0x1ee05e,_0x131447);if(_0x1c5c7c){return _0x2fe166(handleCheckRowError(_0x4b5b('0x29'),_0x4b5b('0x2a'),_0x1c5c7c,_0x36fc3b));}}return db[_0x4b5b('0x2b')][_0x4b5b('0x2c')](_0x178de6,{'raw':!![],'hooks':![],'fields':_[_0x4b5b('0x2d')](_0x178de6)})[_0x4b5b('0x2e')](function(_0x15ec2e){if(DUPLICATES&&DUPLICATES[_0x4b5b('0x27')]&&_0x1ee05e){_0x1ee05e[_0x4b5b('0x2f')](_[_0x4b5b('0x30')](_0x178de6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x15ec2e['id'];return _0xc0058c();})[_0x4b5b('0x31')](function(_0x4a740d){return _0x2fe166(handleCheckRowError(_0x4b5b('0x15'),_0x4b5b('0x32')+(_0x4a740d[_0x4b5b('0x1a')]||JSON[_0x4b5b('0x33')](_0x4a740d)),null,_0x36fc3b));});});}function checkHopper(){function _0x856195(){return function(_0x2fcb36){logger[_0x4b5b('0x15')](_0x4b5b('0x34'),'checkHopper',util[_0x4b5b('0x35')](_0x2fcb36,{'showHidden':![],'depth':null}));};}var _0x3f63db=function(_0x2407bc,_0x31dd23){var _0x4a33b2=squel[_0x4b5b('0x36')]()[_0x4b5b('0x37')]('cm_hopper')[_0x4b5b('0x38')](['phone',_0x4b5b('0x39'),_0x4b5b('0x3a'),_0x4b5b('0x25'),_0x31dd23,_0x4b5b('0x3b'),_0x4b5b('0x3c')],squel['select']()[_0x4b5b('0x3d')](_0x4b5b('0x1d'),'phone')[_0x4b5b('0x3d')]('NOW()',_0x4b5b('0x39'))[_0x4b5b('0x3d')]('id',_0x4b5b('0x3a'))[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))[_0x4b5b('0x3d')](_0x2407bc['id']['toString'](),_0x31dd23)['field'](_0x4b5b('0x3f'),_0x4b5b('0x3b'))[_0x4b5b('0x3d')]('NOW()',_0x4b5b('0x3c'))[_0x4b5b('0x40')](_0x4b5b('0x41'))[_0x4b5b('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x4b5b('0x43'),LISTID['toString']())[_0x4b5b('0x42')](_0x4b5b('0x44'))['where'](_0x4b5b('0x45'),squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x1d'))[_0x4b5b('0x40')](_0x4b5b('0x47'))[_0x4b5b('0x42')](_0x31dd23+_0x4b5b('0x48'),_0x2407bc['id'][_0x4b5b('0x3e')]())))[_0x4b5b('0x3e')]();return _0x4a33b2;};var _0x2d0582=function(_0xf4dcca,_0xdc7ef5){var _0x3c887b=squel[_0x4b5b('0x36')]()['into'](_0x4b5b('0x47'))[_0x4b5b('0x38')]([_0x4b5b('0x1d'),'scheduledAt',_0x4b5b('0x3a'),_0x4b5b('0x25'),_0xdc7ef5,'createdAt','updatedAt'],squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x1d'),'phone')[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x39'))[_0x4b5b('0x3d')]('id',_0x4b5b('0x3a'))[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))[_0x4b5b('0x3d')](_0xf4dcca['id'][_0x4b5b('0x3e')](),_0xdc7ef5)[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x3b'))[_0x4b5b('0x3d')](_0x4b5b('0x3f'),'updatedAt')[_0x4b5b('0x40')](_0x4b5b('0x41'))[_0x4b5b('0x42')](_0x4b5b('0x49'))[_0x4b5b('0x42')](_0x4b5b('0x43'),LISTID[_0x4b5b('0x3e')]())[_0x4b5b('0x42')](_0x4b5b('0x4a'),squel[_0x4b5b('0x4b')](hopperContacts))['where'](_0x4b5b('0x44'))[_0x4b5b('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x4c'))['from'](_0x4b5b('0x4d'))[_0x4b5b('0x42')](_0xdc7ef5+_0x4b5b('0x48'),_0xf4dcca['id'][_0x4b5b('0x3e')]()))[_0x4b5b('0x42')](_0x4b5b('0x45'),squel[_0x4b5b('0x46')]()[_0x4b5b('0x3d')](_0x4b5b('0x1d'))[_0x4b5b('0x40')](_0x4b5b('0x47'))[_0x4b5b('0x42')](_0xdc7ef5+_0x4b5b('0x48'),_0xf4dcca['id']['toString']())))[_0x4b5b('0x3e')]();return _0x3c887b;};function _0x333575(_0x32a702,_0x274a3e){var _0x43fe64=squel['insert']()[_0x4b5b('0x37')]('cm_hopper')[_0x4b5b('0x38')]([_0x4b5b('0x1d'),'scheduledAt','ContactId',_0x4b5b('0x25'),_0x274a3e,_0x4b5b('0x3b'),'updatedAt'],squel['select']()[_0x4b5b('0x3d')](_0x4b5b('0x1d'),_0x4b5b('0x1d'))[_0x4b5b('0x3d')]('NOW()','scheduledAt')['field']('id','ContactId')[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))['field'](_0x32a702['id'][_0x4b5b('0x3e')](),_0x274a3e)[_0x4b5b('0x3d')]('NOW()',_0x4b5b('0x3b'))[_0x4b5b('0x3d')]('NOW()','updatedAt')[_0x4b5b('0x40')](_0x4b5b('0x41'))['where'](_0x4b5b('0x49'))[_0x4b5b('0x42')](_0x4b5b('0x43'),LISTID[_0x4b5b('0x3e')]())[_0x4b5b('0x42')](_0x4b5b('0x4a'),squel['str'](hopperContacts))[_0x4b5b('0x42')](_0x4b5b('0x44')))[_0x4b5b('0x3e')]();return _0x43fe64;}function _0x38bf67(_0x5cf78b,_0x7abdd4){var _0x59b9d0=squel[_0x4b5b('0x36')]()['into'](_0x4b5b('0x4e'))[_0x4b5b('0x38')]([_0x4b5b('0x1d'),_0x4b5b('0x3a'),_0x4b5b('0x25'),_0x7abdd4,'createdAt',_0x4b5b('0x3c')],squel[_0x4b5b('0x46')]()['field'](_0x4b5b('0x1d'),_0x4b5b('0x1d'))[_0x4b5b('0x3d')]('id','ContactId')[_0x4b5b('0x3d')](LISTID[_0x4b5b('0x3e')](),_0x4b5b('0x25'))[_0x4b5b('0x3d')](_0x5cf78b['id'][_0x4b5b('0x3e')](),_0x7abdd4)[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x3b'))[_0x4b5b('0x3d')](_0x4b5b('0x3f'),_0x4b5b('0x3c'))[_0x4b5b('0x40')]('cm_contacts')['where'](_0x4b5b('0x49'))[_0x4b5b('0x42')](_0x4b5b('0x43'),LISTID[_0x4b5b('0x3e')]())[_0x4b5b('0x42')](_0x4b5b('0x4a'),squel[_0x4b5b('0x4b')](hopperContacts))[_0x4b5b('0x42')](_0x4b5b('0x44')))[_0x4b5b('0x3e')]();return _0x59b9d0;}return db[_0x4b5b('0x4f')]['findAll']({'where':{'type':_0x4b5b('0x50')},'attributes':['id',_0x4b5b('0x51')],'include':[{'model':db[_0x4b5b('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x4b5b('0x2e')](function(_0x1a978d){var _0x3e410a=[];if(_0x1a978d){var _0x2bf105;for(var _0x1af440=0x0,_0x4781ac;_0x1af440<_0x1a978d['length'];_0x1af440+=0x1){_0x4781ac=_0x1a978d[_0x1af440]['get']({'plain':!![]});switch(_0x4781ac[_0x4b5b('0x51')]){case _0x4b5b('0x53'):_0x3e410a['push'](db['sequelize'][_0x4b5b('0x54')](_0x2d0582(_0x4781ac,_0x4b5b('0x55')))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));break;case _0x4b5b('0x56'):_0x3e410a[_0x4b5b('0x2f')](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x3f63db(_0x4781ac,'VoiceQueueId'))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));break;default:_0x3e410a['push'](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x333575(_0x4781ac,_0x4b5b('0x55')))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));}}}return _0x3e410a;})['all']()[_0x4b5b('0x2e')](function(){return db[_0x4b5b('0x4f')][_0x4b5b('0x58')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x4b5b('0x52')],'as':_0x4b5b('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x20fcb8){var _0x738543=[];if(_0x20fcb8){var _0x15f400;for(var _0x5f1a4d=0x0,_0x1c2285;_0x5f1a4d<_0x20fcb8[_0x4b5b('0x27')];_0x5f1a4d+=0x1){_0x1c2285=_0x20fcb8[_0x5f1a4d][_0x4b5b('0x5a')]({'plain':!![]});_0x738543['push'](db['sequelize'][_0x4b5b('0x54')](_0x38bf67(_0x1c2285,_0x4b5b('0x55')))['then'](function(){})[_0x4b5b('0x31')](_0x856195()));}}return _0x738543;})[_0x4b5b('0x5b')]();})[_0x4b5b('0x2e')](function(){return db[_0x4b5b('0x5c')][_0x4b5b('0x58')]({'attributes':['id',_0x4b5b('0x51')],'include':[{'model':db[_0x4b5b('0x52')],'as':_0x4b5b('0x5d'),'where':{'id':LISTID}}]})[_0x4b5b('0x2e')](function(_0x5dc1e8){var _0x4398f3=[];if(_0x5dc1e8){for(var _0x27af96=0x0,_0xd1b626;_0x27af96<_0x5dc1e8[_0x4b5b('0x27')];_0x27af96+=0x1){_0xd1b626=_0x5dc1e8[_0x27af96]['get']({'plain':!![]});switch(_0xd1b626[_0x4b5b('0x51')]){case _0x4b5b('0x53'):_0x4398f3[_0x4b5b('0x2f')](db['sequelize'][_0x4b5b('0x54')](_0x2d0582(_0xd1b626,'CampaignId'))['then'](function(){})[_0x4b5b('0x31')](_0x856195()));break;case _0x4b5b('0x56'):_0x4398f3['push'](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x3f63db(_0xd1b626,_0x4b5b('0x5e')))[_0x4b5b('0x2e')](function(){})[_0x4b5b('0x31')](_0x856195()));break;default:_0x4398f3['push'](db['sequelize'][_0x4b5b('0x54')](_0x333575(_0xd1b626,_0x4b5b('0x5e')))[_0x4b5b('0x2e')](function(){})['catch'](_0x856195()));}}}return _0x4398f3;})['all']();})[_0x4b5b('0x2e')](function(){return db[_0x4b5b('0x5c')][_0x4b5b('0x58')]({'attributes':['id'],'include':[{'model':db[_0x4b5b('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x4b5b('0x2e')](function(_0x87b331){var _0x29151d=[];if(_0x87b331){for(var _0x56100d=0x0,_0x4efcfb;_0x56100d<_0x87b331[_0x4b5b('0x27')];_0x56100d+=0x1){_0x4efcfb=_0x87b331[_0x56100d][_0x4b5b('0x5a')]({'plain':!![]});_0x29151d[_0x4b5b('0x2f')](db[_0x4b5b('0x57')][_0x4b5b('0x54')](_0x38bf67(_0x4efcfb,_0x4b5b('0x5e')))[_0x4b5b('0x2e')](function(){})[_0x4b5b('0x31')](_0x856195()));}}return _0x29151d;})[_0x4b5b('0x5b')]();})['catch'](function(_0x561e1b){logger[_0x4b5b('0x15')]('cmContact,\x20%s,\x20%s',_0x4b5b('0x5f'),_0x561e1b[_0x4b5b('0x1a')]);});}var processPromises=function(_0x81a9c4){return BPromise[_0x4b5b('0x5b')](promises)[_0x4b5b('0x2e')](function(_0xb9bb1f){})[_0x4b5b('0x31')](function(_0x4e86d5){logger[_0x4b5b('0x15')](_0x4b5b('0x60'),JSON['stringify'](_0x4e86d5));})[_0x4b5b('0x61')](function(){socket['emit'](_0x4b5b('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x81a9c4){return _0x81a9c4[_0x4b5b('0x63')]();}});};var endCsv=function(){return BPromise[_0x4b5b('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x4b5b('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4b5b('0x65')](FILEPATH);}catch(_0x1a54a8){logger['error'](_0x4b5b('0x66'),JSON[_0x4b5b('0x33')](_0x1a54a8));}finally{process[_0x4b5b('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x4b5b('0x68')](_0x4b5b('0x69'));endCsv();});function main(){return BPromise[_0x4b5b('0x64')]()[_0x4b5b('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4b5b('0x12')](',');return db[_0x4b5b('0x2b')][_0x4b5b('0x58')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4b5b('0x2e')](function(_0x224a5c){var _0x373784=fs[_0x4b5b('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4b5b('0x6b')](_0x373784,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a1bcc,_0x301cb0){total+=0x1;var _0x52f3b3=total;promises['push'](checkRow(_0x5a1bcc,_0x224a5c,_0x52f3b3)[_0x4b5b('0x2e')](function(){success+=0x1;})[_0x4b5b('0x31')](function(_0x1730ec){if(_0x1730ec['error']){errors+=0x1;delete _0x1730ec[_0x4b5b('0x15')];}else if(_0x1730ec[_0x4b5b('0x29')]){duplicates+=0x1;delete _0x1730ec['duplicate'];}rows[_0x4b5b('0x2f')](_0x1730ec);}));if(total%0xc8===0x0){_0x301cb0[_0x4b5b('0x6c')]();return processPromises(_0x301cb0);}},'complete':function(){return processPromises()[_0x4b5b('0x2e')](function(){logger[_0x4b5b('0x68')](_0x4b5b('0x6d'));endCsv();});},'error':function(_0x230bd7,_0x547519){logger[_0x4b5b('0x68')](_0x4b5b('0x6e'),JSON[_0x4b5b('0x33')](_0x230bd7));endCsv();}});})[_0x4b5b('0x31')](function(_0x45d812){logger[_0x4b5b('0x15')](_0x4b5b('0x6f'),JSON['stringify'](_0x45d812));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 443ddbc..5979e48 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 _0x3527=['exit','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','localhost','YYYY-MM-DD\x20HH:mm:ss','format','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','push','all','split','isNil','CmContactHasItem','update','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_hopper_black','ContactId','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','UserId','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','field','MIN(id)','min_id','group','Received\x20SIGINT','message','errors','code','info','sequelize','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists.CmListId=','query','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','utcOffset','set','offset','spread','send','start','binding','clone','socket_timestamp','root','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','rows','data','find','hasOwnProperty','replace','isValid','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','trim','description','SystemRow','appendFileSync','contact:import:','abort','SystemError','duplicates','cm_contacts_','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','affectedRows','emit','unlink'];(function(_0x551dce,_0x485588){var _0x1f6770=function(_0x5ba735){while(--_0x5ba735){_0x551dce['push'](_0x551dce['shift']());}};_0x1f6770(++_0x485588);}(_0x3527,0x166));var _0x7352=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x3527[_0x5a79e2];return _0x266c45;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x7352('0x0'));var Papa=require(_0x7352('0x1'));var util=require(_0x7352('0x2'));var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x7352('0x3'));var Redis=require(_0x7352('0x4'));var db=require(_0x7352('0x5'))['db'];var config=require(_0x7352('0x6'));var shared=require('../../../config/environment/shared');var logger=require('../../../config/logger')(_0x7352('0x7'));config[_0x7352('0x8')]=_['defaults'](config[_0x7352('0x8')],{'host':_0x7352('0x9'),'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'](_0x7352('0xa'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x7352('0xb')](_0x7352('0xa'));function isEmail(_0x3f3c52){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'](_0x3f3c52);}function selectNotIn(_0x557b54,_0x5da198,_0x41d143,_0x26b441,_0x42ed7d){return squel[_0x7352('0xc')]()['field'](_0x7352('0xd'))[_0x7352('0xe')](_0x26b441)[_0x7352('0xf')](_0x5da198,null,_0x5da198+_0x7352('0x10')+_0x26b441+'.'+_0x41d143)[_0x7352('0x11')](_0x26b441+'.'+_0x41d143+_0x7352('0x12')+_0x557b54+'.'+_0x41d143)[_0x7352('0x11')](_0x5da198+_0x7352('0x13')+_0x42ed7d[_0x7352('0xf')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5b282a,_0x21c857){promisesAdditionalPhones=[];return db['CmContact'][_0x7352('0x14')]({'raw':!![],'attributes':['id',_0x7352('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x7352('0x16')](function(_0x433297){if(_0x433297!==null){var _0x4231ae=[];for(var _0x22eeeb=0x0;_0x22eeeb<_0x433297[_0x7352('0x17')];_0x22eeeb++){var _0x2ea196=_0x433297[_0x22eeeb];_0x4231ae[_0x7352('0x18')](insertAdditionalPhones(_0x2ea196));}}Promise[_0x7352('0x19')](_0x4231ae)[_0x7352('0x16')](function(){_0x5b282a({'val':0x1});});});});}function insertAdditionalPhones(_0x153c47){return new Promise(function(_0x4b086b,_0xd3bb0c){var _0x37ba42=_0x153c47[_0x7352('0x15')];var _0x345ba4=_0x37ba42[_0x7352('0x1a')](';');var _0x3e4417=[];orderBy=0x0;for(var _0x3be883=0x0;_0x3be883<_0x345ba4[_0x7352('0x17')];_0x3be883++){_0x3e4417[_0x7352('0x18')](splitAdditionalPhone(_0x153c47['id'],_0x345ba4[_0x3be883]));}Promise[_0x7352('0x19')](_0x3e4417)[_0x7352('0x16')](function(){_0x4b086b({'val':_0x345ba4[_0x7352('0x17')]});});});}function splitAdditionalPhone(_0x34f103,_0x31961c){return new Promise(function(_0x39bcb5,_0x3ca946){var _0x4659f7=_0x31961c[_0x7352('0x1a')](':');var _0x5885fd=_0x4659f7[0x0];var _0x311a98=_0x4659f7[0x1];if(!_[_0x7352('0x1b')](_0x311a98)){var _0x289af5=_0x311a98['split']('|');var _0x4cf829=[];for(var _0x3f8645=0x0;_0x3f8645<_0x289af5['length'];_0x3f8645++){if(_0x289af5[_0x3f8645]!==''){var _0x5135cf=_['filter'](promisesAdditionalPhones,{'contactId':_0x34f103,'phone':_0x289af5[_0x3f8645]});if(_0x5135cf[_0x7352('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x7352('0x18')]({'contactId':_0x34f103,'contactTypeId':_0x5885fd,'phone':_0x289af5[_0x3f8645],'orderBy':orderBy});}}}_0x39bcb5({'ok':0x1});}else _0x39bcb5({'res':0x0});});}function createAdditionalPhone(_0x3ae6ac,_0x418685,_0x58dfb4,_0x3aa948){var _0x38cd20='';var _0x5d37d2='';var _0x543103=_0x58dfb4[_0x7352('0x1a')]('§');_0x38cd20=_0x543103[0x0];if(_0x543103['length']==0x2)_0x5d37d2=_0x543103[0x1];return new Promise(function(_0x5cbb22,_0x47f3e6){return db[_0x7352('0x1c')]['findOne']({'where':{'CmContactId':_0x3ae6ac,'item':_0x38cd20}})[_0x7352('0x16')](function(_0x1a34ad){if(_0x1a34ad){return db[_0x7352('0x1c')][_0x7352('0x1d')]({'ItemTypeId':_0x418685,'description':_0x5d37d2,'OrderBy':_0x3aa948},{'where':{'CmContactId':_0x3ae6ac,'item':_0x38cd20}})[_0x7352('0x16')](function(_0x32b393){_0x5cbb22({'res':'updated'});});}else{return db[_0x7352('0x1c')]['create']({'CmContactId':_0x3ae6ac,'item':_0x38cd20,'description':_0x5d37d2,'ItemTypeId':_0x418685,'OrderBy':_0x3aa948,'ItemClass':'PHONE'})[_0x7352('0x16')](function(_0x59081b){_0x5cbb22({'res':_0x7352('0x1e')});});}});});}function insertCmHopper(_0x452a9e,_0x13ae10,_0x1cc37f,_0x5cd151,_0x169e86){var _0x295128=[_0x7352('0x1f'),_0x7352('0x20'),_0x7352('0x21'),_0x7352('0x22'),_0x13ae10+'.'+_0x5cd151,'cm_contacts.createdAt',_0x7352('0x23'),_0x7352('0x24'),_0x7352('0x25'),'\x22'+_0x169e86+'\x22'];return squel[_0x7352('0x26')]()[_0x7352('0x27')](_0x7352('0x28'))[_0x7352('0x29')]([_0x7352('0xd'),_0x7352('0x2a'),'ContactId',_0x7352('0x2b'),_0x5cd151,_0x7352('0x2c'),_0x7352('0x2d'),_0x7352('0x2e'),'UserId',_0x7352('0x2f')],squel[_0x7352('0xc')]()[_0x7352('0x30')](_0x295128)[_0x7352('0xe')](_0x13ae10)[_0x7352('0xf')](_0x7352('0x31'),null,'cm_contacts.ListId\x20=\x20'+_0x13ae10+_0x7352('0x32'))[_0x7352('0xf')](_0x1cc37f,null,_0x1cc37f+'.id\x20=\x20'+_0x13ae10+'.'+_0x5cd151)[_0x7352('0x11')](_0x13ae10+_0x7352('0x33'),_0x452a9e)['where'](_0x7352('0x34'),NOW)[_0x7352('0x11')](_0x7352('0x35'),selectNotIn(_0x13ae10,_0x1cc37f,_0x5cd151,'cm_hopper',[_0x7352('0x36'),_0x7352('0x37')]))[_0x7352('0x11')](_0x7352('0x35'),selectNotIn(_0x13ae10,_0x1cc37f,_0x5cd151,_0x7352('0x28'),[_0x7352('0x36')])))[_0x7352('0x38')]();}function insertCmHopperBlack(_0x5bbb03,_0x1ec9f1,_0x5bb109,_0x4e9d3c){var _0x29886f=[_0x7352('0x1f'),'cm_contacts.id','cm_contacts.ListId',_0x1ec9f1+'.'+_0x4e9d3c,_0x7352('0x39'),_0x7352('0x23')];return squel[_0x7352('0x26')]()[_0x7352('0x27')](_0x7352('0x3a'))[_0x7352('0x29')]([_0x7352('0xd'),_0x7352('0x3b'),'ListId',_0x4e9d3c,_0x7352('0x2c'),_0x7352('0x2d')],squel[_0x7352('0xc')]()['fields'](_0x29886f)[_0x7352('0xe')](_0x1ec9f1)[_0x7352('0xf')](_0x7352('0x31'),null,_0x7352('0x3c')+_0x1ec9f1+_0x7352('0x32'))[_0x7352('0xf')](_0x5bb109,null,_0x5bb109+'.id\x20=\x20'+_0x1ec9f1+'.'+_0x4e9d3c)[_0x7352('0x11')](_0x1ec9f1+'.CmListId\x20=\x20?',_0x5bbb03)[_0x7352('0x11')](_0x7352('0x34'),NOW)[_0x7352('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7352('0xc')]()['field'](_0x7352('0xd'))[_0x7352('0xe')](_0x7352('0x3a'))[_0x7352('0x11')](_0x7352('0x3d'),_0x5bbb03)['where'](_0x4e9d3c+_0x7352('0x12')+_0x1ec9f1+'.'+_0x4e9d3c)))[_0x7352('0x38')]();}function insertTzCmHopper(_0x2119ad,_0x33dcc5,_0x5dc611,_0x533c7e,_0x2f681c,_0x1903db){var _0x4554cb=[_0x7352('0x1f'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x1903db+_0x7352('0x3e'),_0x7352('0x21'),_0x7352('0x22'),_0x33dcc5+'.'+_0x533c7e,_0x7352('0x39'),_0x7352('0x23'),_0x7352('0x24'),_0x7352('0x25'),'\x22'+_0x2f681c+'\x22'];var _0x4b76a6=squel[_0x7352('0x26')]()[_0x7352('0x27')]('cm_hopper')[_0x7352('0x29')](['phone',_0x7352('0x2a'),_0x7352('0x3b'),_0x7352('0x2b'),_0x533c7e,_0x7352('0x2c'),_0x7352('0x2d'),_0x7352('0x2e'),_0x7352('0x3f'),_0x7352('0x2f')],squel[_0x7352('0xc')]()[_0x7352('0x30')](_0x4554cb)['from'](_0x33dcc5)[_0x7352('0xf')](_0x7352('0x31'),null,_0x7352('0x3c')+_0x33dcc5+_0x7352('0x32'))['join'](_0x5dc611,null,_0x5dc611+_0x7352('0x10')+_0x33dcc5+'.'+_0x533c7e)[_0x7352('0xf')](_0x1903db,null,_0x1903db+_0x7352('0x10')+_0x33dcc5+'.'+_0x533c7e)['where'](_0x33dcc5+'.CmListId\x20=\x20?',_0x2119ad)[_0x7352('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x7352('0x11')](_0x7352('0x35'),selectNotIn(_0x33dcc5,_0x5dc611,_0x533c7e,_0x7352('0x28'),[_0x7352('0x36'),'\x22onlyIfOpen\x22']))[_0x7352('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x33dcc5,_0x5dc611,_0x533c7e,'cm_hopper',[_0x7352('0x36')])))[_0x7352('0x38')]();return _0x4b76a6;}function insertTzCmHopperBlack(_0x5605cb,_0x288c2c,_0x1760da,_0x354ea0){var _0x81a467=[_0x7352('0x1f'),_0x7352('0x21'),_0x7352('0x22'),_0x288c2c+'.'+_0x354ea0,_0x7352('0x39'),_0x7352('0x23')];return squel[_0x7352('0x26')]()[_0x7352('0x27')]('cm_hopper_black')[_0x7352('0x29')]([_0x7352('0xd'),'ContactId',_0x7352('0x2b'),_0x354ea0,_0x7352('0x2c'),'updatedAt'],squel[_0x7352('0xc')]()[_0x7352('0x30')](_0x81a467)[_0x7352('0xe')](_0x288c2c)['join'](_0x7352('0x31'),null,_0x7352('0x3c')+_0x288c2c+_0x7352('0x32'))[_0x7352('0xf')](_0x1760da,null,_0x1760da+_0x7352('0x10')+_0x288c2c+'.'+_0x354ea0)[_0x7352('0x11')](_0x288c2c+'.CmListId\x20=\x20?',_0x5605cb)[_0x7352('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x7352('0x11')](_0x7352('0x35'),squel['select']()['field'](_0x7352('0xd'))['from'](_0x7352('0x3a'))[_0x7352('0x11')](_0x7352('0x3d'),_0x5605cb)['where'](_0x354ea0+_0x7352('0x12')+_0x288c2c+'.'+_0x354ea0)))[_0x7352('0x38')]();}function insertCmHopperAdditionalPhones(_0xc5dfd4){var _0x3a033e=[_0x7352('0x40'),'cm_contact_has_items.item',_0x7352('0x41'),_0x7352('0x42'),'cm_contact_has_items.updatedAt'];return squel[_0x7352('0x26')]()[_0x7352('0x27')](_0x7352('0x43'))[_0x7352('0x29')](['CmHopperId',_0x7352('0xd'),_0x7352('0x44'),_0x7352('0x2c'),_0x7352('0x2d')],squel[_0x7352('0xc')]()[_0x7352('0x30')](_0x3a033e)[_0x7352('0xe')](_0x7352('0x28'))[_0x7352('0xf')](_0x7352('0x31'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')['join'](_0x7352('0x45'),null,_0x7352('0x46'))[_0x7352('0x11')](_0x7352('0x47'),_0xc5dfd4)['where']('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x443402,_0x3f0f57,_0x5c2dea,_0x3ac42e){var _0x491445=_[_0x7352('0x48')](_[_0x7352('0x49')](_0x3ac42e),[_0x7352('0x2b'),_0x7352('0x4a'),_0x7352('0x2c'),_0x7352('0x2d')]);return squel['insert']()[_0x7352('0x27')](_0x7352('0x31'))[_0x7352('0x29')](_0x491445,squel[_0x7352('0xc')]()[_0x7352('0x30')](_0x491445)[_0x7352('0xe')](_0x3f0f57)[_0x7352('0x11')]('('+_0x5c2dea[_0x7352('0xf')](',')+_0x7352('0x4b'),squel[_0x7352('0xc')]()[_0x7352('0x30')](_0x5c2dea)[_0x7352('0xe')](_0x7352('0x31'))['where'](_0x7352('0x3d'),_0x443402)['where'](_0x7352('0x4c')))[_0x7352('0x11')]('id\x20IN\x20?',squel[_0x7352('0xc')]()[_0x7352('0x4d')](_0x7352('0x4e'),_0x7352('0x4f'))[_0x7352('0xe')](_0x3f0f57)[_0x7352('0x50')](_0x5c2dea[_0x7352('0xf')](','))))[_0x7352('0x38')]();}function handleStop(){logger['info'](_0x7352('0x51'));stopped=!![];}function handleUncaughtException(_0x40fd4b){logger['error'](_0x40fd4b[_0x7352('0x52')]);process['exit'](0x1);}function handleError(_0xf6bb19,_0x4c3059){stats[_0x7352('0x53')][_0x7352('0x18')]({'name':_0x4c3059[_0x7352('0x54')],'message':_0x4c3059[_0x7352('0x52')],'row':_0xf6bb19});}function handleQuery(_0x214261){logger[_0x7352('0x55')](_0x214261);return db[_0x7352('0x56')]['query'](_0x214261)['spread'](function(_0x4a16a9){results[_0x7352('0x18')](_0x4a16a9);})[_0x7352('0x57')](function(_0x3b4416){logger[_0x7352('0x58')](_0x3b4416[_0x7352('0x52')]);});}function updateTzCampaigns(_0x11bcff){return new Promise(function(_0x2a91b2,_0x3cbfde){var _0x476280=squel[_0x7352('0xc')]()[_0x7352('0x30')]([_0x7352('0x59'),_0x7352('0x5a')])[_0x7352('0xe')](_0x7352('0x5b'))['join']('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x7352('0x11')](_0x7352('0x5c')+_0x11bcff);db[_0x7352('0x56')][_0x7352('0x5d')](_0x476280[_0x7352('0x38')]())['spread'](function(_0x64281a){var _0x347d73=[];for(var _0x9f186f=0x0;_0x9f186f<_0x64281a[_0x7352('0x17')];_0x9f186f++){_0x347d73[_0x7352('0x18')](getTimezoneData(_0x64281a[_0x9f186f],tmp_campaigns));}BPromise['all'](_0x347d73)[_0x7352('0x16')](function(){_0x2a91b2({'val':0x1});});})[_0x7352('0x57')](function(_0x5ced6d){logger[_0x7352('0x58')](_0x5ced6d[_0x7352('0x52')]);_0x2a91b2({'val':0x0});});});}function updateTzVoiceQueues(_0xebce54){return new Promise(function(_0x1755f0,_0x109c52){var _0x7b17a1=squel[_0x7352('0xc')]()['fields'](['voice_queues.id','voice_queues.dialTimezone'])[_0x7352('0xe')](_0x7352('0x5e'))[_0x7352('0xf')]('voice_queues_has_cm_lists',null,_0x7352('0x5f'))[_0x7352('0x11')](_0x7352('0x60')+_0xebce54);db[_0x7352('0x56')]['query'](_0x7b17a1[_0x7352('0x38')]())['spread'](function(_0x394b3e){var _0x32f384=[];for(var _0x508402=0x0;_0x508402<_0x394b3e[_0x7352('0x17')];_0x508402++){_0x32f384[_0x7352('0x18')](getTimezoneData(_0x394b3e[_0x508402],tmp_voice_queues));}BPromise[_0x7352('0x19')](_0x32f384)[_0x7352('0x16')](function(){_0x1755f0({'val':0x1});});})[_0x7352('0x57')](function(_0x1c0635){logger['error'](_0x1c0635[_0x7352('0x52')]);_0x1755f0({'val':0x0});});});}function getTimezoneData(_0x2f3faf,_0x406690){return new Promise(function(_0x3343ef,_0x41e0a7){var _0xc4b0b1=shared[_0x7352('0x61')];var _0xd18d7d=_0xc4b0b1[_0x2f3faf[_0x7352('0x62')]];if(_[_0x7352('0x1b')](_0xd18d7d)){_0x3343ef({'ret':0x1});}else{var _0x398926=_0xd18d7d[_0x7352('0x63')];var _0x3ab6b3=squel['insert']()[_0x7352('0x27')](_0x406690)[_0x7352('0x64')]('id',_0x2f3faf['id'])[_0x7352('0x64')](_0x7352('0x65'),_0x398926)[_0x7352('0x64')](_0x7352('0x62'),_0x2f3faf[_0x7352('0x62')])[_0x7352('0x38')]();return db[_0x7352('0x56')][_0x7352('0x5d')](_0x3ab6b3)[_0x7352('0x66')](function(_0x282a4d){_0x3343ef({'ret':0x1});})[_0x7352('0x57')](function(_0x265a7d){logger[_0x7352('0x58')](_0x265a7d[_0x7352('0x52')]);_0x41e0a7({'ret':0x1});});}});}function handleTZQuery(_0x1404c8){logger[_0x7352('0x55')](_0x1404c8);return db['sequelize']['query'](_0x1404c8)[_0x7352('0x66')](function(_0x59318e){})[_0x7352('0x57')](function(_0x57f417){logger[_0x7352('0x58')](_0x57f417[_0x7352('0x52')]);});}function main(_0x40c53f,_0x433ba7,_0x4d153d,_0xfc69f){logger[_0x7352('0x55')]('main',_0x40c53f,JSON['stringify'](_0x433ba7));process[_0x7352('0x67')](_0x7352('0x68'));var _0x569514=_0x433ba7[_0x7352('0x69')];var _0x2ef641=_[_0x7352('0x6a')](_0x569514);var _0x38b4f6=_0x433ba7[_0x7352('0x6b')];var _0x18402d=path[_0x7352('0xf')](config[_0x7352('0x6c')],'server/files/tmp',_0x38b4f6+_0x7352('0x6d'));hasTZ=_[_0x7352('0x49')](_0x569514)[_0x7352('0x6e')]('dialTimezone');var _0x13818a=_[_0x7352('0x49')](_0x569514)[_0x7352('0xf')]();logger[_0x7352('0x55')](_0x7352('0x6f'),_0x13818a);db[_0x7352('0x70')]['findAll']({'raw':!![],'attributes':['id',_0x7352('0x71')]})[_0x7352('0x16')](function(_0x5d3320){for(var _0x12d8b1=0x0;_0x12d8b1<_0x5d3320[_0x7352('0x17')];_0x12d8b1++){if(_0x5d3320[_0x12d8b1][_0x7352('0x71')]in _0x569514){contactItemTypes['push'](_0x5d3320[_0x12d8b1]);delete _0x2ef641[_0x5d3320[_0x12d8b1][_0x7352('0x71')]];hasAdditionalPhones=!![];}for(var _0x5c51cc in _0x569514){if(_0x5d3320[_0x12d8b1][_0x7352('0x71')]+_0x7352('0x72')===_0x5c51cc){phoneDescriptions['push']({'itemTypeId':_0x5d3320[_0x12d8b1]['id'],'description':_0x5c51cc});delete _0x2ef641[_0x5c51cc];}}}if(hasAdditionalPhones)_0x2ef641[_0x7352('0x15')]='';var _0x5b193f=_['keys'](_0x2ef641)['join']();logger[_0x7352('0x55')](_0x7352('0x6f'),_0x5b193f);fs[_0x7352('0x73')](_0x18402d,_0x5b193f+'\x0a');Papa[_0x7352('0x74')](fs['createReadStream'](_0x40c53f),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d211b,_0x497661){try{for(var _0x2fd29d=0x0,_0x3bfd33=[];_0x2fd29d<_0x2d211b['data'][_0x7352('0x17')];_0x2fd29d++){stats[_0x7352('0x75')]+=0x1;if(_0x2d211b['errors'][_0x2fd29d]){handleError(_0x2d211b[_0x7352('0x76')][_0x2fd29d],_0x2d211b[_0x7352('0x53')][_0x2fd29d]);}else{var _0x4883f4=[];var _0xd37e8e=[];var _0x550b16={};for(var _0x14ee59 in _0x569514){let _0x4e582b=contactItemTypes[_0x7352('0x77')](_0x16b91e=>_0x16b91e['name']===_0x14ee59);let _0x5e916d=contactItemTypes[_0x7352('0x77')](_0x3ae61d=>_0x3ae61d['name']+'_description'===_0x14ee59);if(_[_0x7352('0x1b')](_0x4e582b)&&_[_0x7352('0x1b')](_0x5e916d)){if(_0x569514[_0x7352('0x78')](_0x14ee59)){if(_0x2d211b[_0x7352('0x76')][_0x2fd29d][_0x569514[_0x14ee59]]){var _0xba1c33=_['trim'](_0x2d211b[_0x7352('0x76')][_0x2fd29d][_0x569514[_0x14ee59]][_0x7352('0x79')](/"/g,'\x27'));switch(_0x14ee59){case _0x7352('0x2a'):var _0x1b4a53=moment(_0xba1c33,_0x7352('0xa'),!![]);if(_0x1b4a53[_0x7352('0x7a')]()){_0x3bfd33[_0x7352('0x18')]('\x22'+_0xba1c33+'\x22');}else{_0x4883f4[_0x7352('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x38881c=parseInt(_0xba1c33);_0xba1c33=_[_0x7352('0x7b')](_0x38881c)||_0x38881c<0x0||_0x38881c>0x4?_0xfc69f?0x3:0x2:_0x38881c;_0x3bfd33['push']('\x22'+_0xba1c33+'\x22');break;case _0x7352('0x3f'):var _0x4a046b=parseInt(_0xba1c33);if(_['isNumber'](_0x4a046b)&&_['includes'](_0x4d153d,_0x4a046b)){_0x3bfd33[_0x7352('0x18')]('\x22'+_0x4a046b+'\x22');}else{_0x4883f4['push'](_0x7352('0x7c'));}break;case _0x7352('0x7d'):if(isEmail(_0xba1c33)){_0x3bfd33[_0x7352('0x18')]('\x22'+_0xba1c33+'\x22');}else{_0x4883f4[_0x7352('0x18')](_0x7352('0x7e'));}break;case _0x7352('0x7f'):var _0x568086=moment(_0xba1c33,_0x7352('0x80'),!![]);if(_0x568086[_0x7352('0x7a')]()){_0x3bfd33[_0x7352('0x18')]('\x22'+_0xba1c33+'\x22');}else{_0x4883f4[_0x7352('0x18')](_0x7352('0x81'));}break;case _0x7352('0x62'):var _0x3615fc=shared['timezones'];var _0x58fe90=_0x3615fc[_0xba1c33];if(!_['isNil'](_0x58fe90)){var _0x5bab86=_0x58fe90[_0x7352('0x63')];_0x3bfd33[_0x7352('0x18')]('\x22'+_0xba1c33+'\x22');_0x3bfd33[_0x7352('0x18')]('\x22'+_0x5bab86+'\x22');}break;default:_0x3bfd33[_0x7352('0x18')]('\x22'+_0xba1c33+'\x22');}}else{switch(_0x14ee59){case _0x7352('0x82'):case'phone':_0x4883f4[_0x7352('0x18')](_0x14ee59+_0x7352('0x83'));break;default:_0x3bfd33[_0x7352('0x18')]('\x22\x22');}}}}else{var _0x14db33='';if(!_[_0x7352('0x1b')](_0x4e582b)){if(!_0x550b16[_0x7352('0x78')](_0x4e582b['id'])){if(!_[_0x7352('0x1b')](_0x2d211b['data'][_0x2fd29d][_0x569514[_0x14ee59]])){var _0xba1c33=_['trim'](_0x2d211b[_0x7352('0x76')][_0x2fd29d][_0x569514[_0x14ee59]][_0x7352('0x79')](/"/g,'\x27'));var _0x3d1564=phoneDescriptions['find'](_0x162c6f=>_0x162c6f[_0x7352('0x84')]===_0x4e582b['id']);if(!_['isNil'](_0x3d1564)){var _0x5431bd=_[_0x7352('0x85')](_0x2d211b[_0x7352('0x76')][_0x2fd29d][_0x569514[_0x3d1564[_0x7352('0x86')]]][_0x7352('0x79')](/"/g,'\x27'));if(!_[_0x7352('0x1b')](_0x5431bd))_0xba1c33=_0xba1c33+'§'+_0x5431bd;}if(_0x14db33=='')_0x14db33=_0xba1c33;else _0x14db33+='|'+_0xba1c33;}_0xd37e8e[_0x7352('0x18')](_0x4e582b['id']+':'+_0x14db33);_0x550b16[_0x4e582b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3bfd33[_0x7352('0x18')]('\x22'+_0xd37e8e[_0x7352('0xf')](';')+'\x22');}if(_0x4883f4['length']){handleError(_0x2d211b['data'][_0x2fd29d],{'code':_0x7352('0x87'),'message':_0x4883f4[_0x7352('0xf')]()});}else{fs[_0x7352('0x88')](_0x18402d,_0x3bfd33[_0x7352('0xf')]()+'\x0a');}_0x3bfd33=[];}if(!(stats[_0x7352('0x75')]%0xc8)){socket['emit'](_0x7352('0x89')+_0x38b4f6,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x497661[_0x7352('0x8a')]();}}catch(_0x27932c){handleError(_0x2d211b[_0x7352('0x76')][_0x2fd29d],{'code':_0x7352('0x8b'),'message':_0x27932c[_0x7352('0x52')]});logger[_0x7352('0x58')]('step',_0x27932c['message']);}},'complete':function(){try{var _0x12e6f6=[];var _0x217ff6=[];var _0x2764b7=_0x7352('0x31');if(_0x433ba7[_0x7352('0x8c')]&&_0x433ba7[_0x7352('0x8c')][_0x7352('0x17')]){_0x2764b7=_0x7352('0x8d')+_0x38b4f6;_0x12e6f6[_0x7352('0x18')]('CREATE\x20TABLE\x20'+_0x2764b7+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x7352('0x8e')+_0x38b4f6;tmp_voice_queues='voice_queues_'+_0x38b4f6;_0x217ff6[_0x7352('0x18')](_0x7352('0x8f')+tmp_campaigns+_0x7352('0x90'));_0x217ff6['push'](_0x7352('0x8f')+tmp_voice_queues+_0x7352('0x90'));BPromise[_0x7352('0x91')](_0x217ff6,handleTZQuery)['then'](function(_0x35c37e){updateTzCampaigns(_0x433ba7[_0x7352('0x2b')])[_0x7352('0x16')](function(_0x4bef7e){updateTzVoiceQueues(_0x433ba7[_0x7352('0x2b')])[_0x7352('0x16')](function(_0x2a4b3a){if(hasTZ)_0x5b193f=_0x5b193f[_0x7352('0x79')](_0x7352('0x62'),_0x7352('0x92'));var _0x2964e8=util[_0x7352('0xb')](_0x7352('0x93'),_0x18402d,_0x2764b7,_0x5b193f,_0x433ba7[_0x7352('0x2b')],_0x433ba7[_0x7352('0x4a')]||null,NOW,NOW);if(_[_0x7352('0x1b')](_0x569514[_0x7352('0x2a')])){_0x2964e8+=_0x7352('0x94');}_0x12e6f6[_0x7352('0x18')](_0x2964e8);if(_0x433ba7[_0x7352('0x8c')]&&_0x433ba7[_0x7352('0x8c')][_0x7352('0x17')]){_0x12e6f6[_0x7352('0x18')](insertCmContact(_0x433ba7['ListId'],_0x2764b7,_0x433ba7[_0x7352('0x8c')],_0x569514));_0x12e6f6[_0x7352('0x18')](_0x7352('0x95')+_0x2764b7+';');}BPromise[_0x7352('0x91')](_0x12e6f6,handleQuery)[_0x7352('0x16')](function(_0x321508){BPromise[_0x7352('0x19')]([handleAdditionalPhones()])[_0x7352('0x16')](function(){_0x12e6f6=[];for(var _0x553d21=0x0;_0x553d21\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','select','fields','from','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','into','cm_hopper_black','updatedAt','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','recallme','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','errors','code','sequelize','query','spread','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','catch','timezones','dialTimezone','utcOffset','set','stringify','send','binding','clone','socket_timestamp','server/files/tmp','includes','header','ContactItemType','name','_description','writeFileSync','data','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','SystemRow','appendFileSync','emit','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId'];(function(_0x446f7d,_0x4d63a4){var _0x11fa79=function(_0x4cf383){while(--_0x4cf383){_0x446f7d['push'](_0x446f7d['shift']());}};_0x11fa79(++_0x4d63a4);}(_0xf0b0,0xc8));var _0x0f0b=function(_0x3f36ee,_0x66bc12){_0x3f36ee=_0x3f36ee-0x0;var _0x3238a4=_0xf0b0[_0x3f36ee];return _0x3238a4;};'use strict';var fs=require('fs');var path=require(_0x0f0b('0x0'));var _=require(_0x0f0b('0x1'));var Papa=require(_0x0f0b('0x2'));var util=require(_0x0f0b('0x3'));var BPromise=require(_0x0f0b('0x4'));var moment=require(_0x0f0b('0x5'));var squel=require(_0x0f0b('0x6'));var Redis=require(_0x0f0b('0x7'));var db=require(_0x0f0b('0x8'))['db'];var config=require('../../../config/environment');var shared=require(_0x0f0b('0x9'));var logger=require('../../../config/logger')(_0x0f0b('0xa'));config[_0x0f0b('0xb')]=_[_0x0f0b('0xc')](config[_0x0f0b('0xb')],{'host':_0x0f0b('0xd'),'port':0x18eb});var socket=require(_0x0f0b('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x0f0b('0xf')](_0x0f0b('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0f0b('0xf')](_0x0f0b('0x10'));function isEmail(_0x5afd74){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))*$/[_0x0f0b('0x11')](_0x5afd74);}function selectNotIn(_0x24fe45,_0x57b118,_0x5ddb1e,_0x4b1c7d,_0x378664){return squel['select']()[_0x0f0b('0x12')](_0x0f0b('0x13'))['from'](_0x4b1c7d)[_0x0f0b('0x14')](_0x57b118,null,_0x57b118+_0x0f0b('0x15')+_0x4b1c7d+'.'+_0x5ddb1e)[_0x0f0b('0x16')](_0x4b1c7d+'.'+_0x5ddb1e+_0x0f0b('0x17')+_0x24fe45+'.'+_0x5ddb1e)[_0x0f0b('0x16')](_0x57b118+_0x0f0b('0x18')+_0x378664[_0x0f0b('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x8cfef5,_0x45e979){promisesAdditionalPhones=[];return db[_0x0f0b('0x19')][_0x0f0b('0x1a')]({'raw':!![],'attributes':['id',_0x0f0b('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x0f0b('0x1c')](function(_0x45fd81){if(_0x45fd81!==null){var _0x5715e5=[];for(var _0x145f49=0x0;_0x145f49<_0x45fd81[_0x0f0b('0x1d')];_0x145f49++){var _0x98d74=_0x45fd81[_0x145f49];_0x5715e5[_0x0f0b('0x1e')](insertAdditionalPhones(_0x98d74));}}Promise[_0x0f0b('0x1f')](_0x5715e5)[_0x0f0b('0x1c')](function(){_0x8cfef5({'val':0x1});});});});}function insertAdditionalPhones(_0x36be02){return new Promise(function(_0x13a875,_0x2b66ca){var _0x548079=_0x36be02[_0x0f0b('0x1b')];var _0x5a2a81=_0x548079[_0x0f0b('0x20')](';');var _0x110406=[];orderBy=0x0;for(var _0x144fab=0x0;_0x144fab<_0x5a2a81[_0x0f0b('0x1d')];_0x144fab++){_0x110406[_0x0f0b('0x1e')](splitAdditionalPhone(_0x36be02['id'],_0x5a2a81[_0x144fab]));}Promise['all'](_0x110406)['then'](function(){_0x13a875({'val':_0x5a2a81[_0x0f0b('0x1d')]});});});}function splitAdditionalPhone(_0x49a016,_0x4da9fc){return new Promise(function(_0x497c67,_0x1b0c11){var _0x44fd9d=_0x4da9fc[_0x0f0b('0x20')](':');var _0x3e4b9f=_0x44fd9d[0x0];var _0x562374=_0x44fd9d[0x1];if(!_[_0x0f0b('0x21')](_0x562374)){var _0x423ddf=_0x562374[_0x0f0b('0x20')]('|');var _0x2f4eb3=[];for(var _0x4f5c3e=0x0;_0x4f5c3e<_0x423ddf['length'];_0x4f5c3e++){if(_0x423ddf[_0x4f5c3e]!==''){var _0x4ff8b3=_[_0x0f0b('0x22')](promisesAdditionalPhones,{'contactId':_0x49a016,'phone':_0x423ddf[_0x4f5c3e]});if(_0x4ff8b3[_0x0f0b('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x0f0b('0x1e')]({'contactId':_0x49a016,'contactTypeId':_0x3e4b9f,'phone':_0x423ddf[_0x4f5c3e],'orderBy':orderBy});}}}_0x497c67({'ok':0x1});}else _0x497c67({'res':0x0});});}function createAdditionalPhone(_0x34aad7,_0x188d53,_0x5c6883,_0x5094f7){var _0x294c70='';var _0x1ad777='';var _0x20841e=_0x5c6883[_0x0f0b('0x20')]('§');_0x294c70=_0x20841e[0x0];if(_0x20841e['length']==0x2)_0x1ad777=_0x20841e[0x1];return new Promise(function(_0x1ba743,_0xccbfaa){return db[_0x0f0b('0x23')][_0x0f0b('0x24')]({'where':{'CmContactId':_0x34aad7,'item':_0x294c70}})[_0x0f0b('0x1c')](function(_0x3ccbb7){if(_0x3ccbb7){return db[_0x0f0b('0x23')][_0x0f0b('0x25')]({'ItemTypeId':_0x188d53,'description':_0x1ad777,'OrderBy':_0x5094f7},{'where':{'CmContactId':_0x34aad7,'item':_0x294c70}})[_0x0f0b('0x1c')](function(_0x250045){_0x1ba743({'res':'updated'});});}else{return db['CmContactHasItem'][_0x0f0b('0x26')]({'CmContactId':_0x34aad7,'item':_0x294c70,'description':_0x1ad777,'ItemTypeId':_0x188d53,'OrderBy':_0x5094f7,'ItemClass':_0x0f0b('0x27')})[_0x0f0b('0x1c')](function(_0x387d38){_0x1ba743({'res':_0x0f0b('0x28')});});}});});}function insertCmHopper(_0x5ecf56,_0x14e6e6,_0x5cfcbe,_0x2c591a,_0x3b3de9){var _0x1ced97=[_0x0f0b('0x29'),_0x0f0b('0x2a'),'cm_contacts.id',_0x0f0b('0x2b'),_0x14e6e6+'.'+_0x2c591a,_0x0f0b('0x2c'),_0x0f0b('0x2d'),_0x0f0b('0x2e'),'cm_contacts.UserId','\x22'+_0x3b3de9+'\x22'];return squel[_0x0f0b('0x2f')]()['into'](_0x0f0b('0x30'))[_0x0f0b('0x31')]([_0x0f0b('0x13'),_0x0f0b('0x32'),_0x0f0b('0x33'),'ListId',_0x2c591a,_0x0f0b('0x34'),'updatedAt',_0x0f0b('0x35'),_0x0f0b('0x36'),'recallme'],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x1ced97)[_0x0f0b('0x39')](_0x14e6e6)[_0x0f0b('0x14')](_0x0f0b('0x3a'),null,_0x0f0b('0x3b')+_0x14e6e6+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x5cfcbe,null,_0x5cfcbe+_0x0f0b('0x15')+_0x14e6e6+'.'+_0x2c591a)['where'](_0x14e6e6+_0x0f0b('0x3d'),_0x5ecf56)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW)[_0x0f0b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x14e6e6,_0x5cfcbe,_0x2c591a,_0x0f0b('0x30'),[_0x0f0b('0x3f'),_0x0f0b('0x40')]))['where'](_0x0f0b('0x41'),selectNotIn(_0x14e6e6,_0x5cfcbe,_0x2c591a,'cm_hopper',[_0x0f0b('0x3f')])))[_0x0f0b('0x42')]();}function insertCmHopperBlack(_0x5052a0,_0x3239cb,_0x16a3a2,_0x539cda){var _0x3c591a=[_0x0f0b('0x29'),'cm_contacts.id','cm_contacts.ListId',_0x3239cb+'.'+_0x539cda,_0x0f0b('0x2c'),_0x0f0b('0x2d')];return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x44'))[_0x0f0b('0x31')]([_0x0f0b('0x13'),_0x0f0b('0x33'),'ListId',_0x539cda,'createdAt',_0x0f0b('0x45')],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x3c591a)[_0x0f0b('0x39')](_0x3239cb)[_0x0f0b('0x14')]('cm_contacts',null,_0x0f0b('0x3b')+_0x3239cb+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x16a3a2,null,_0x16a3a2+_0x0f0b('0x15')+_0x3239cb+'.'+_0x539cda)[_0x0f0b('0x16')](_0x3239cb+'.CmListId\x20=\x20?',_0x5052a0)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW)[_0x0f0b('0x16')](_0x0f0b('0x41'),squel[_0x0f0b('0x37')]()[_0x0f0b('0x12')]('phone')[_0x0f0b('0x39')](_0x0f0b('0x44'))[_0x0f0b('0x16')]('ListId\x20=\x20?',_0x5052a0)[_0x0f0b('0x16')](_0x539cda+_0x0f0b('0x17')+_0x3239cb+'.'+_0x539cda)))['toString']();}function insertTzCmHopper(_0x451048,_0x3012e3,_0x5ae97b,_0x2b116f,_0x4910fe,_0x410cbc){var _0x246701=[_0x0f0b('0x29'),_0x0f0b('0x46')+_0x410cbc+_0x0f0b('0x47'),'cm_contacts.id',_0x0f0b('0x2b'),_0x3012e3+'.'+_0x2b116f,_0x0f0b('0x2c'),_0x0f0b('0x2d'),_0x0f0b('0x2e'),_0x0f0b('0x48'),'\x22'+_0x4910fe+'\x22'];var _0x4becf2=squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')]('cm_hopper')[_0x0f0b('0x31')](['phone',_0x0f0b('0x32'),_0x0f0b('0x33'),'ListId',_0x2b116f,_0x0f0b('0x34'),'updatedAt',_0x0f0b('0x35'),_0x0f0b('0x36'),_0x0f0b('0x49')],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x246701)['from'](_0x3012e3)[_0x0f0b('0x14')]('cm_contacts',null,_0x0f0b('0x3b')+_0x3012e3+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x5ae97b,null,_0x5ae97b+'.id\x20=\x20'+_0x3012e3+'.'+_0x2b116f)[_0x0f0b('0x14')](_0x410cbc,null,_0x410cbc+_0x0f0b('0x15')+_0x3012e3+'.'+_0x2b116f)['where'](_0x3012e3+_0x0f0b('0x3d'),_0x451048)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW)[_0x0f0b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3012e3,_0x5ae97b,_0x2b116f,'cm_hopper',[_0x0f0b('0x3f'),_0x0f0b('0x40')]))[_0x0f0b('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3012e3,_0x5ae97b,_0x2b116f,_0x0f0b('0x30'),[_0x0f0b('0x3f')])))[_0x0f0b('0x42')]();return _0x4becf2;}function insertTzCmHopperBlack(_0x4d09d8,_0x4665ee,_0x27f0c9,_0x62a515){var _0x4cd108=[_0x0f0b('0x29'),'cm_contacts.id',_0x0f0b('0x2b'),_0x4665ee+'.'+_0x62a515,'cm_contacts.createdAt',_0x0f0b('0x2d')];return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x44'))['fromQuery']([_0x0f0b('0x13'),_0x0f0b('0x33'),'ListId',_0x62a515,'createdAt',_0x0f0b('0x45')],squel[_0x0f0b('0x37')]()['fields'](_0x4cd108)[_0x0f0b('0x39')](_0x4665ee)['join'](_0x0f0b('0x3a'),null,_0x0f0b('0x3b')+_0x4665ee+_0x0f0b('0x3c'))[_0x0f0b('0x14')](_0x27f0c9,null,_0x27f0c9+_0x0f0b('0x15')+_0x4665ee+'.'+_0x62a515)[_0x0f0b('0x16')](_0x4665ee+_0x0f0b('0x3d'),_0x4d09d8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x0f0b('0x41'),squel[_0x0f0b('0x37')]()[_0x0f0b('0x12')](_0x0f0b('0x13'))[_0x0f0b('0x39')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x4d09d8)[_0x0f0b('0x16')](_0x62a515+_0x0f0b('0x17')+_0x4665ee+'.'+_0x62a515)))[_0x0f0b('0x42')]();}function insertCmHopperAdditionalPhones(_0x9fcbbc){var _0x4b5551=['cm_hopper.id',_0x0f0b('0x4a'),_0x0f0b('0x4b'),'cm_contact_has_items.createdAt',_0x0f0b('0x4c')];return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x4d'))[_0x0f0b('0x31')]([_0x0f0b('0x4e'),'phone',_0x0f0b('0x4f'),'createdAt','updatedAt'],squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x4b5551)[_0x0f0b('0x39')](_0x0f0b('0x30'))['join']('cm_contacts',null,_0x0f0b('0x50'))[_0x0f0b('0x14')](_0x0f0b('0x51'),null,_0x0f0b('0x52'))['where'](_0x0f0b('0x53'),_0x9fcbbc)[_0x0f0b('0x16')](_0x0f0b('0x3e'),NOW))[_0x0f0b('0x42')]();}function insertCmContact(_0x1493d3,_0x1bca6d,_0x51a8c3,_0x761049){var _0x437c5b=_['concat'](_[_0x0f0b('0x54')](_0x761049),[_0x0f0b('0x55'),_0x0f0b('0x56'),'createdAt',_0x0f0b('0x45')]);return squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0x0f0b('0x3a'))[_0x0f0b('0x31')](_0x437c5b,squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x437c5b)[_0x0f0b('0x39')](_0x1bca6d)[_0x0f0b('0x16')]('('+_0x51a8c3[_0x0f0b('0x14')](',')+_0x0f0b('0x57'),squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](_0x51a8c3)['from'](_0x0f0b('0x3a'))[_0x0f0b('0x16')](_0x0f0b('0x58'),_0x1493d3)['where'](_0x0f0b('0x59')))['where'](_0x0f0b('0x5a'),squel['select']()[_0x0f0b('0x12')](_0x0f0b('0x5b'),_0x0f0b('0x5c'))[_0x0f0b('0x39')](_0x1bca6d)[_0x0f0b('0x5d')](_0x51a8c3[_0x0f0b('0x14')](','))))[_0x0f0b('0x42')]();}function handleStop(){logger[_0x0f0b('0x5e')](_0x0f0b('0x5f'));stopped=!![];}function handleUncaughtException(_0x2dec79){logger[_0x0f0b('0x60')](_0x2dec79[_0x0f0b('0x61')]);process['exit'](0x1);}function handleError(_0x3e556b,_0x6b1900){stats[_0x0f0b('0x62')][_0x0f0b('0x1e')]({'name':_0x6b1900[_0x0f0b('0x63')],'message':_0x6b1900['message'],'row':_0x3e556b});}function handleQuery(_0x1ffb2f){logger[_0x0f0b('0x5e')](_0x1ffb2f);return db[_0x0f0b('0x64')][_0x0f0b('0x65')](_0x1ffb2f)[_0x0f0b('0x66')](function(_0x27f072){results[_0x0f0b('0x1e')](_0x27f072);})['catch'](function(_0x5ecd58){logger[_0x0f0b('0x60')](_0x5ecd58[_0x0f0b('0x61')]);});}function updateTzCampaigns(_0xbd794e){return new Promise(function(_0xd1fa3,_0x463e64){var _0x209669=squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')](['campaigns.id',_0x0f0b('0x67')])['from'](_0x0f0b('0x68'))[_0x0f0b('0x14')](_0x0f0b('0x69'),null,_0x0f0b('0x6a'))['where']('campaigns_has_cm_lists.CmListId='+_0xbd794e);db['sequelize']['query'](_0x209669[_0x0f0b('0x42')]())[_0x0f0b('0x66')](function(_0x3928fe){var _0x59cc7d=[];for(var _0x374f2d=0x0;_0x374f2d<_0x3928fe[_0x0f0b('0x1d')];_0x374f2d++){_0x59cc7d[_0x0f0b('0x1e')](getTimezoneData(_0x3928fe[_0x374f2d],tmp_campaigns));}BPromise[_0x0f0b('0x1f')](_0x59cc7d)[_0x0f0b('0x1c')](function(){_0xd1fa3({'val':0x1});});})['catch'](function(_0x1a91a6){logger['error'](_0x1a91a6[_0x0f0b('0x61')]);_0xd1fa3({'val':0x0});});});}function updateTzVoiceQueues(_0x206776){return new Promise(function(_0x2740bf,_0x3f43a7){var _0x4b7308=squel[_0x0f0b('0x37')]()[_0x0f0b('0x38')]([_0x0f0b('0x6b'),_0x0f0b('0x6c')])[_0x0f0b('0x39')](_0x0f0b('0x6d'))[_0x0f0b('0x14')]('voice_queues_has_cm_lists',null,_0x0f0b('0x6e'))['where']('voice_queues_has_cm_lists.CmListId='+_0x206776);db['sequelize'][_0x0f0b('0x65')](_0x4b7308[_0x0f0b('0x42')]())['spread'](function(_0x2fe9b7){var _0x17214a=[];for(var _0x2ef6e2=0x0;_0x2ef6e2<_0x2fe9b7[_0x0f0b('0x1d')];_0x2ef6e2++){_0x17214a[_0x0f0b('0x1e')](getTimezoneData(_0x2fe9b7[_0x2ef6e2],tmp_voice_queues));}BPromise['all'](_0x17214a)[_0x0f0b('0x1c')](function(){_0x2740bf({'val':0x1});});})[_0x0f0b('0x6f')](function(_0x3b1eae){logger[_0x0f0b('0x60')](_0x3b1eae[_0x0f0b('0x61')]);_0x2740bf({'val':0x0});});});}function getTimezoneData(_0x26eb9b,_0xe26176){return new Promise(function(_0x2d9edd,_0x1fa2fc){var _0x4cc0d8=shared[_0x0f0b('0x70')];var _0x347565=_0x4cc0d8[_0x26eb9b[_0x0f0b('0x71')]];if(_[_0x0f0b('0x21')](_0x347565)){_0x2d9edd({'ret':0x1});}else{var _0x50d9e7=_0x347565[_0x0f0b('0x72')];var _0x2b3415=squel[_0x0f0b('0x2f')]()[_0x0f0b('0x43')](_0xe26176)[_0x0f0b('0x73')]('id',_0x26eb9b['id'])[_0x0f0b('0x73')]('offset',_0x50d9e7)[_0x0f0b('0x73')]('dialTimezone',_0x26eb9b[_0x0f0b('0x71')])['toString']();return db[_0x0f0b('0x64')]['query'](_0x2b3415)['spread'](function(_0x41b82a){_0x2d9edd({'ret':0x1});})[_0x0f0b('0x6f')](function(_0x4814ab){logger[_0x0f0b('0x60')](_0x4814ab[_0x0f0b('0x61')]);_0x1fa2fc({'ret':0x1});});}});}function handleTZQuery(_0x4cc81b){logger['info'](_0x4cc81b);return db[_0x0f0b('0x64')][_0x0f0b('0x65')](_0x4cc81b)['spread'](function(_0x147890){})['catch'](function(_0x45d4e9){logger[_0x0f0b('0x60')](_0x45d4e9[_0x0f0b('0x61')]);});}function main(_0x3cae3d,_0x1dabd7,_0x211d73,_0x55e549){logger[_0x0f0b('0x5e')]('main',_0x3cae3d,JSON[_0x0f0b('0x74')](_0x1dabd7));process[_0x0f0b('0x75')]('start');var _0x1c077b=_0x1dabd7[_0x0f0b('0x76')];var _0x20617a=_[_0x0f0b('0x77')](_0x1c077b);var _0x478ef0=_0x1dabd7[_0x0f0b('0x78')];var _0x26e79c=path[_0x0f0b('0x14')](config['root'],_0x0f0b('0x79'),_0x478ef0+'.csv');hasTZ=_['keys'](_0x1c077b)[_0x0f0b('0x7a')]('dialTimezone');var _0xdf4592=_[_0x0f0b('0x54')](_0x1c077b)['join']();logger[_0x0f0b('0x5e')](_0x0f0b('0x7b'),_0xdf4592);db[_0x0f0b('0x7c')][_0x0f0b('0x1a')]({'raw':!![],'attributes':['id',_0x0f0b('0x7d')]})[_0x0f0b('0x1c')](function(_0x8031e4){for(var _0x50e7c3=0x0;_0x50e7c3<_0x8031e4[_0x0f0b('0x1d')];_0x50e7c3++){if(_0x8031e4[_0x50e7c3][_0x0f0b('0x7d')]in _0x1c077b){contactItemTypes['push'](_0x8031e4[_0x50e7c3]);delete _0x20617a[_0x8031e4[_0x50e7c3][_0x0f0b('0x7d')]];hasAdditionalPhones=!![];}for(var _0x28f2be in _0x1c077b){if(_0x8031e4[_0x50e7c3][_0x0f0b('0x7d')]+_0x0f0b('0x7e')===_0x28f2be){phoneDescriptions[_0x0f0b('0x1e')]({'itemTypeId':_0x8031e4[_0x50e7c3]['id'],'description':_0x28f2be});delete _0x20617a[_0x28f2be];}}}if(hasAdditionalPhones)_0x20617a[_0x0f0b('0x1b')]='';var _0x5dc27f=_[_0x0f0b('0x54')](_0x20617a)[_0x0f0b('0x14')]();logger[_0x0f0b('0x5e')](_0x0f0b('0x7b'),_0x5dc27f);fs[_0x0f0b('0x7f')](_0x26e79c,_0x5dc27f+'\x0a');Papa['parse'](fs['createReadStream'](_0x3cae3d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49abac,_0x156561){try{for(var _0x67e0d5=0x0,_0x280ad8=[];_0x67e0d5<_0x49abac[_0x0f0b('0x80')][_0x0f0b('0x1d')];_0x67e0d5++){stats['rows']+=0x1;if(_0x49abac[_0x0f0b('0x62')][_0x67e0d5]){handleError(_0x49abac[_0x0f0b('0x80')][_0x67e0d5],_0x49abac[_0x0f0b('0x62')][_0x67e0d5]);}else{var _0x3b85c2=[];var _0x4f734f=[];var _0x5738c2={};for(var _0x258796 in _0x1c077b){let _0x274b94=contactItemTypes[_0x0f0b('0x81')](_0x2974ea=>_0x2974ea[_0x0f0b('0x7d')]===_0x258796);let _0x24c067=contactItemTypes[_0x0f0b('0x81')](_0x54a41a=>_0x54a41a[_0x0f0b('0x7d')]+_0x0f0b('0x7e')===_0x258796);if(_[_0x0f0b('0x21')](_0x274b94)&&_[_0x0f0b('0x21')](_0x24c067)){if(_0x1c077b[_0x0f0b('0x82')](_0x258796)){if(_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]]){var _0x11f07e=_[_0x0f0b('0x83')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]][_0x0f0b('0x84')](/"/g,'\x27'));switch(_0x258796){case'scheduledat':var _0x349df6=moment(_0x11f07e,_0x0f0b('0x10'),!![]);if(_0x349df6[_0x0f0b('0x85')]()){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}else{_0x3b85c2['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x5465e4=parseInt(_0x11f07e);_0x11f07e=_[_0x0f0b('0x86')](_0x5465e4)||_0x5465e4<0x0||_0x5465e4>0x4?_0x55e549?0x3:0x2:_0x5465e4;_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');break;case _0x0f0b('0x36'):var _0xc18f2e=parseInt(_0x11f07e);if(_[_0x0f0b('0x87')](_0xc18f2e)&&_['includes'](_0x211d73,_0xc18f2e)){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0xc18f2e+'\x22');}else{_0x3b85c2['push'](_0x0f0b('0x88'));}break;case _0x0f0b('0x89'):if(isEmail(_0x11f07e)){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}else{_0x3b85c2[_0x0f0b('0x1e')]('email\x20wrong\x20format');}break;case _0x0f0b('0x8a'):var _0x564828=moment(_0x11f07e,_0x0f0b('0x8b'),!![]);if(_0x564828['isValid']()){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}else{_0x3b85c2[_0x0f0b('0x1e')](_0x0f0b('0x8c'));}break;case _0x0f0b('0x71'):var _0x139abf=shared[_0x0f0b('0x70')];var _0x4ff917=_0x139abf[_0x11f07e];if(!_[_0x0f0b('0x21')](_0x4ff917)){var _0x189387=_0x4ff917['utcOffset'];_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');_0x280ad8['push']('\x22'+_0x189387+'\x22');}break;default:_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x11f07e+'\x22');}}else{switch(_0x258796){case _0x0f0b('0x8d'):case _0x0f0b('0x13'):_0x3b85c2['push'](_0x258796+_0x0f0b('0x8e'));break;default:_0x280ad8[_0x0f0b('0x1e')]('\x22\x22');}}}}else{var _0x2d30a8='';if(!_[_0x0f0b('0x21')](_0x274b94)){if(!_0x5738c2[_0x0f0b('0x82')](_0x274b94['id'])){if(!_[_0x0f0b('0x21')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]])){var _0x11f07e=_[_0x0f0b('0x83')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x258796]][_0x0f0b('0x84')](/"/g,'\x27'));var _0x53c7d6=phoneDescriptions[_0x0f0b('0x81')](_0x59b0c3=>_0x59b0c3[_0x0f0b('0x8f')]===_0x274b94['id']);if(!_['isNil'](_0x53c7d6)){var _0x23a4c9=_[_0x0f0b('0x83')](_0x49abac[_0x0f0b('0x80')][_0x67e0d5][_0x1c077b[_0x53c7d6['description']]][_0x0f0b('0x84')](/"/g,'\x27'));if(!_[_0x0f0b('0x21')](_0x23a4c9))_0x11f07e=_0x11f07e+'§'+_0x23a4c9;}if(_0x2d30a8=='')_0x2d30a8=_0x11f07e;else _0x2d30a8+='|'+_0x11f07e;}_0x4f734f[_0x0f0b('0x1e')](_0x274b94['id']+':'+_0x2d30a8);_0x5738c2[_0x274b94['id']]=0x1;}}}}if(hasAdditionalPhones){_0x280ad8[_0x0f0b('0x1e')]('\x22'+_0x4f734f['join'](';')+'\x22');}if(_0x3b85c2['length']){handleError(_0x49abac[_0x0f0b('0x80')][_0x67e0d5],{'code':_0x0f0b('0x90'),'message':_0x3b85c2['join']()});}else{fs[_0x0f0b('0x91')](_0x26e79c,_0x280ad8[_0x0f0b('0x14')]()+'\x0a');}_0x280ad8=[];}if(!(stats['rows']%0xc8)){socket[_0x0f0b('0x92')]('contact:import:'+_0x478ef0,stats);stats[_0x0f0b('0x62')]=[];}}if(stopped){logger[_0x0f0b('0x5e')](_0x0f0b('0x93'));_0x156561['abort']();}}catch(_0x4c8f96){handleError(_0x49abac[_0x0f0b('0x80')][_0x67e0d5],{'code':_0x0f0b('0x94'),'message':_0x4c8f96['message']});logger['error'](_0x0f0b('0x95'),_0x4c8f96['message']);}},'complete':function(){try{var _0x3efb01=[];var _0x51f690=[];var _0xe8ed56='cm_contacts';if(_0x1dabd7[_0x0f0b('0x96')]&&_0x1dabd7[_0x0f0b('0x96')][_0x0f0b('0x1d')]){_0xe8ed56=_0x0f0b('0x97')+_0x478ef0;_0x3efb01['push'](_0x0f0b('0x98')+_0xe8ed56+_0x0f0b('0x99'));}tmp_campaigns='campaigns_'+_0x478ef0;tmp_voice_queues='voice_queues_'+_0x478ef0;_0x51f690['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x0f0b('0x9a'));_0x51f690[_0x0f0b('0x1e')](_0x0f0b('0x98')+tmp_voice_queues+_0x0f0b('0x9a'));BPromise[_0x0f0b('0x9b')](_0x51f690,handleTZQuery)[_0x0f0b('0x1c')](function(_0x5088ff){updateTzCampaigns(_0x1dabd7[_0x0f0b('0x55')])[_0x0f0b('0x1c')](function(_0x4c6a98){updateTzVoiceQueues(_0x1dabd7[_0x0f0b('0x55')])[_0x0f0b('0x1c')](function(_0x5ba8e7){if(hasTZ)_0x5dc27f=_0x5dc27f[_0x0f0b('0x84')](_0x0f0b('0x71'),_0x0f0b('0x9c'));var _0x1db19f=util['format']('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',_0x26e79c,_0xe8ed56,_0x5dc27f,_0x1dabd7[_0x0f0b('0x55')],_0x1dabd7[_0x0f0b('0x56')]||null,NOW,NOW);if(_[_0x0f0b('0x21')](_0x1c077b[_0x0f0b('0x32')])){_0x1db19f+=_0x0f0b('0x9d');}_0x3efb01[_0x0f0b('0x1e')](_0x1db19f);if(_0x1dabd7[_0x0f0b('0x96')]&&_0x1dabd7['duplicates'][_0x0f0b('0x1d')]){_0x3efb01['push'](insertCmContact(_0x1dabd7[_0x0f0b('0x55')],_0xe8ed56,_0x1dabd7['duplicates'],_0x1c077b));_0x3efb01['push'](_0x0f0b('0x9e')+_0xe8ed56+';');}BPromise[_0x0f0b('0x9b')](_0x3efb01,handleQuery)[_0x0f0b('0x1c')](function(_0x1e55c2){BPromise[_0x0f0b('0x1f')]([handleAdditionalPhones()])[_0x0f0b('0x1c')](function(){_0x3efb01=[];for(var _0x2a05ee=0x0;_0x2a05ee_0xbed790[_0xc676('0x6b')]===_0x51bbd0);let _0x51e029=contactItemTypes[_0xc676('0x74')](_0x48c4aa=>_0x48c4aa[_0xc676('0x6b')]+'_description'===_0x51bbd0);if(_['isNil'](_0x21b860)&&_['isNil'](_0x51e029)){if(_0xdb0342[_0xc676('0x75')](_0x51bbd0)){if(_0x4ab37a['data'][_0x4c3d34][_0xdb0342[_0x51bbd0]]){var _0x240736=_['trim'](_0x4ab37a['data'][_0x4c3d34][_0xdb0342[_0x51bbd0]]['replace'](/"/g,'\x27'));switch(_0x51bbd0){case _0xc676('0x30'):var _0xfa3d3b=moment(_0x240736,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xfa3d3b[_0xc676('0x76')]()){_0x3e1410[_0xc676('0x1b')]('\x22'+_0x240736+'\x22');}else{_0x38f9ac[_0xc676('0x1b')](_0xc676('0x77'));}break;case _0xc676('0x35'):var _0x3cfb36=parseInt(_0x240736);_0x240736=_['isNaN'](_0x3cfb36)||_0x3cfb36<0x0||_0x3cfb36>0x4?_0x2a4fd6?0x3:0x2:_0x3cfb36;_0x3e1410[_0xc676('0x1b')]('\x22'+_0x240736+'\x22');break;case _0xc676('0x36'):var _0x1f469e=parseInt(_0x240736);if(_[_0xc676('0x78')](_0x1f469e)&&_['includes'](_0x5c5271,_0x1f469e)){_0x3e1410[_0xc676('0x1b')]('\x22'+_0x1f469e+'\x22');}else{_0x38f9ac[_0xc676('0x1b')](_0xc676('0x79'));}break;case'email':if(isEmail(_0x240736)){_0x3e1410['push']('\x22'+_0x240736+'\x22');}else{_0x38f9ac[_0xc676('0x1b')](_0xc676('0x7a'));}break;case'dateOfBirth':var _0x49c22e=moment(_0x240736,_0xc676('0x7b'),!![]);if(_0x49c22e[_0xc676('0x76')]()){_0x3e1410[_0xc676('0x1b')]('\x22'+_0x240736+'\x22');}else{_0x38f9ac[_0xc676('0x1b')](_0xc676('0x7c'));}break;default:_0x3e1410[_0xc676('0x1b')]('\x22'+_0x240736+'\x22');}}else{switch(_0x51bbd0){case _0xc676('0x7d'):case _0xc676('0x12'):_0x38f9ac[_0xc676('0x1b')](_0x51bbd0+'\x20not\x20specified');break;default:_0x3e1410[_0xc676('0x1b')]('\x22\x22');}}}}else{var _0xc1eba8='';if(!_[_0xc676('0x19')](_0x21b860)){if(!_0x228cab[_0xc676('0x75')](_0x21b860['id'])){for(var _0x476ad7=0x0;_0x476ad7<_0xdb0342[_0x51bbd0][_0xc676('0x20')];_0x476ad7++){var _0x240736=_[_0xc676('0x7e')](_0x4ab37a[_0xc676('0x71')][_0x4c3d34][_0xdb0342[_0x51bbd0][_0x476ad7]][_0xc676('0x7f')](/"/g,'\x27'));var _0x14d72a=phoneDescriptions[_0xc676('0x74')](_0x475b27=>_0x475b27[_0xc676('0x80')]===_0x21b860['id']);if(!_['isNil'](_0x14d72a)){var _0x1c744b=_['trim'](_0x4ab37a[_0xc676('0x71')][_0x4c3d34][_0xdb0342[_0x14d72a[_0xc676('0x81')]][0x0]][_0xc676('0x7f')](/"/g,'\x27'));if(!_['isNil'](_0x1c744b))_0x240736=_0x240736+'§'+_0x1c744b;}if(_0xc1eba8=='')_0xc1eba8=_0x240736;else _0xc1eba8+='|'+_0x240736;}_0x387c57['push'](_0x21b860['id']+':'+_0xc1eba8);_0x228cab[_0x21b860['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3e1410['push']('\x22'+_0x387c57['join'](';')+'\x22');}if(_0x38f9ac[_0xc676('0x20')]){handleError(_0x4ab37a['data'][_0x4c3d34],{'code':_0xc676('0x82'),'message':_0x38f9ac[_0xc676('0x13')]()});}else{fs[_0xc676('0x83')](_0x3fa0be,_0x3e1410[_0xc676('0x13')]()+'\x0a');}_0x3e1410=[];}if(!(stats[_0xc676('0x72')]%0xc8)){socket[_0xc676('0x84')]('contact:import:'+_0x223115,stats);stats[_0xc676('0x73')]=[];}}if(stopped){logger[_0xc676('0x5b')](_0xc676('0x85'));_0x1c6699[_0xc676('0x86')]();}}catch(_0x2f9390){handleError(_0x4ab37a[_0xc676('0x71')][_0x4c3d34],{'code':'SystemError','message':_0x2f9390[_0xc676('0x1f')]});logger['error'](_0xc676('0x87'),_0x2f9390[_0xc676('0x1f')]);}},'complete':function(){try{var _0x1c09d0=[];var _0x5b7773=tempTableName;_0x1c09d0[_0xc676('0x1b')](_0xc676('0x88')+_0x5b7773+_0xc676('0x89'));logger[_0xc676('0x5b')]('CIS\x20len',contactItemTypes[_0xc676('0x20')]);var _0x2d8fc6=util['format']('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',_0x3fa0be,_0x5b7773,_0x24ab6d,_0x5beb07[_0xc676('0x32')],_0x5beb07[_0xc676('0x52')]||null,NOW,NOW);if(_[_0xc676('0x19')](_0xdb0342[_0xc676('0x30')])){_0x2d8fc6+=',\x20scheduledAt\x20=\x20NOW()';}_0x1c09d0[_0xc676('0x1b')](_0x2d8fc6);BPromise[_0xc676('0x8a')](_0x1c09d0,handleQuery)[_0xc676('0x1d')](function(_0x102877){BPromise[_0xc676('0x1c')]([handleAdditionalPhones()])['then'](function(){_0x1c09d0=[];for(var _0xd87e2=0x0;_0xd87e2\x20\x20');}var _0xb99b0c=path[_0xc676('0x13')](config[_0xc676('0x65')],_0xc676('0x66'),process[_0xc676('0x95')][0x2]);if(!fs[_0xc676('0x96')](_0xb99b0c)){throw new Error(_0xc676('0x97'));}var _0x143e90={};try{_0x143e90=JSON[_0xc676('0x6f')](process[_0xc676('0x95')][0x3]);if(!_0x143e90[_0xc676('0x62')]){throw new Error(_0xc676('0x98'));}var _0xdc6d41=0x0;if(_0x143e90[_0xc676('0x62')][_0xc676('0x36')]){_0xdc6d41=0x1;}if(!_0x143e90['ListId']){throw new Error(_0xc676('0x99'));}}catch(_0x4d4c4c){throw new Error(_0xc676('0x9a'));}var _0x53ef3d=[];try{_0x53ef3d=_['map'](JSON['parse'](process[_0xc676('0x95')][0x4]),'id');}catch(_0x5a7386){logger[_0xc676('0x5b')](_0xc676('0x9b'));}main(_0xb99b0c,_0x143e90,_0x53ef3d,_0xdc6d41);}validate();process['on'](_0xc676('0x9c'),handleStop);process['on'](_0xc676('0x9d'),handleUncaughtException); \ No newline at end of file +var _0xe35d=['socket_timestamp','root','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','data','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','trim','itemTypeId','description','SystemRow','rows','emit','contact:import:','abort','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','complete','argv','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','select','phone','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','catch','error','message','AdditionalPhones','all','split','filter','CmContactHasItem','findOne','then','update','updated','create','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','from','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','exit','errors','code','main','send','start','binding','clone'];(function(_0x52a592,_0x2926b4){var _0x511e55=function(_0x11afac){while(--_0x11afac){_0x52a592['push'](_0x52a592['shift']());}};_0x511e55(++_0x2926b4);}(_0xe35d,0xd5));var _0xde35=function(_0x57b7f9,_0x45a8e4){_0x57b7f9=_0x57b7f9-0x0;var _0x2cc4fe=_0xe35d[_0x57b7f9];return _0x2cc4fe;};'use strict';var fs=require('fs');var path=require(_0xde35('0x0'));var _=require(_0xde35('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xde35('0x2'));var moment=require(_0xde35('0x3'));var squel=require(_0xde35('0x4'));var Redis=require(_0xde35('0x5'));var db=require(_0xde35('0x6'))['db'];var config=require(_0xde35('0x7'));var logger=require(_0xde35('0x8'))(_0xde35('0x9'));config[_0xde35('0xa')]=_[_0xde35('0xb')](config['redis'],{'host':_0xde35('0xc'),'port':0x18eb});var socket=require(_0xde35('0xd'))(new Redis(config[_0xde35('0xa')]));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()[_0xde35('0xe')](_0xde35('0xf'));var tempTableName='cm_contacts_temp_'+moment()[_0xde35('0xe')](_0xde35('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x37bcfc){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'](_0x37bcfc);}function selectNotIn(_0x382863,_0x2cbb1d,_0x5dfc41,_0x10e21e,_0x5c3db0){return squel[_0xde35('0x11')]()['field'](_0xde35('0x12'))['from'](_0x10e21e)['join'](_0x2cbb1d,null,_0x2cbb1d+'.id\x20=\x20'+_0x10e21e+'.'+_0x5dfc41)['where'](_0x10e21e+'.'+_0x5dfc41+'\x20=\x20'+_0x382863+'.'+_0x5dfc41)[_0xde35('0x13')](_0x2cbb1d+_0xde35('0x14')+_0x5c3db0['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x560d70,_0x8c9864){promisesAdditionalPhones=[];promisesContact=[];return db[_0xde35('0x15')][_0xde35('0x16')](_0xde35('0x17')+tempTableName)[_0xde35('0x18')](function(_0x5d8c6e){if(_0x5d8c6e!==null){var _0x1c87c6=[];for(var _0x16956e=0x0;_0x16956e<_0x5d8c6e[_0xde35('0x19')];_0x16956e++){var _0x3c1c74=_0x5d8c6e[_0x16956e];if(!_[_0xde35('0x1a')](_0x3c1c74[_0xde35('0x12')])){if(!_[_0xde35('0x1a')](_0x3c1c74['AdditionalPhones']))_0x1c87c6[_0xde35('0x1b')](insertAdditionalPhones(_0x3c1c74));promisesContact['push']({'contact':_0x3c1c74});}}}Promise['all'](_0x1c87c6)['then'](function(){_0x560d70({'val':0x1});});})[_0xde35('0x1c')](function(_0x487422){logger[_0xde35('0x1d')](_0x487422[_0xde35('0x1e')]);});});}function insertAdditionalPhones(_0x73c782){return new Promise(function(_0x3d66d6,_0x104a3b){var _0x5f387f=_0x73c782[_0xde35('0x1f')];if(_[_0xde35('0x1a')](_0x5f387f))_0x104a3b({'val':0x0});else{var _0x190ccd=_0x5f387f['split'](';');var _0x48c253=[];orderBy=0x0;for(var _0x560c11=0x0;_0x560c11<_0x190ccd['length'];_0x560c11++){_0x48c253[_0xde35('0x1b')](splitAdditionalPhone(_0x73c782['id'],_0x190ccd[_0x560c11]));}Promise[_0xde35('0x20')](_0x48c253)['then'](function(){_0x3d66d6({'val':_0x190ccd[_0xde35('0x19')]});});}});}function splitAdditionalPhone(_0x126248,_0xbbb922){return new Promise(function(_0x560f3a,_0x9ea752){var _0x304e52=_0xbbb922[_0xde35('0x21')](':');var _0x3af90d=_0x304e52[0x0];var _0x256277=_0x304e52[0x1];if(_0x256277!==''){var _0x1b3a37=_0x256277[_0xde35('0x21')]('|');var _0x4a29a2=[];for(var _0x31a61d=0x0;_0x31a61d<_0x1b3a37['length'];_0x31a61d++){if(_0x1b3a37[_0x31a61d]!==''){var _0x2ff922=_[_0xde35('0x22')](promisesAdditionalPhones,{'contactId':_0x126248,'phone':_0x1b3a37[_0x31a61d]});if(_0x2ff922[_0xde35('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xde35('0x1b')]({'contactId':_0x126248,'contactTypeId':_0x3af90d,'phone':_0x1b3a37[_0x31a61d],'orderBy':orderBy});}}}_0x560f3a({'ok':0x1});}else _0x560f3a({'res':0x0});});}function createAdditionalPhone(_0x52a08a,_0x17f62d,_0x2fcc94,_0x10533a){var _0x17da4e='';var _0x459d29='';var _0x45ca01=_0x2fcc94[_0xde35('0x21')]('§');_0x17da4e=_0x45ca01[0x0];if(_0x45ca01['length']==0x2)_0x459d29=_0x45ca01[0x1];return new Promise(function(_0x15fa11,_0x2ddfe1){return db[_0xde35('0x23')][_0xde35('0x24')]({'where':{'CmContactId':_0x52a08a,'item':_0x17da4e}})[_0xde35('0x25')](function(_0x3f8609){if(_0x3f8609){return db[_0xde35('0x23')][_0xde35('0x26')]({'ItemTypeId':_0x17f62d,'description':_0x459d29,'OrderBy':_0x10533a},{'where':{'CmContactId':_0x52a08a,'item':_0x17da4e}})['then'](function(_0x32ed0d){_0x15fa11({'res':_0xde35('0x27')});});}else{return db[_0xde35('0x23')][_0xde35('0x28')]({'CmContactId':_0x52a08a,'item':_0x17da4e,'ItemTypeId':_0x17f62d,'description':_0x459d29,'OrderBy':_0x10533a,'ItemClass':'PHONE'})['then'](function(_0x31634f){_0x15fa11({'res':_0xde35('0x29')});});}});});}function updateContact(_0x1a5175){return new Promise(function(_0x4ee0b3,_0x3946cd){var _0x27be6e=_0x1a5175['id'];delete _0x1a5175['id'];return db[_0xde35('0x2a')][_0xde35('0x26')](_0x1a5175,{'where':{'id':_0x27be6e}})[_0xde35('0x25')](function(_0x5de9d2){updatedRows+=0x1;return db[_0xde35('0x2b')][_0xde35('0x26')]({'phone':_0x1a5175['phone']},{'where':{'ContactId':_0x27be6e}})[_0xde35('0x25')](function(_0x253f51){_0x4ee0b3({'ret':'OK'});});});});}function insertCmHopper(_0x33ae79,_0x26b8d4,_0x27916d,_0x47aaa,_0x5a8d94){var _0x4f3a61=[_0xde35('0x2c'),_0xde35('0x2d'),_0xde35('0x2e'),'cm_contacts.ListId',_0x26b8d4+'.'+_0x47aaa,_0xde35('0x2f'),_0xde35('0x30'),'cm_contacts.priority',_0xde35('0x31'),'\x22'+_0x5a8d94+'\x22'];return squel[_0xde35('0x32')]()[_0xde35('0x33')]('cm_hopper')[_0xde35('0x34')]([_0xde35('0x12'),_0xde35('0x35'),_0xde35('0x36'),_0xde35('0x37'),_0x47aaa,_0xde35('0x38'),_0xde35('0x39'),'priority',_0xde35('0x3a'),_0xde35('0x3b')],squel[_0xde35('0x11')]()[_0xde35('0x3c')](_0x4f3a61)['from'](_0x26b8d4)[_0xde35('0x3d')](_0xde35('0x3e'),null,_0xde35('0x3f')+_0x26b8d4+_0xde35('0x40'))['join'](_0x27916d,null,_0x27916d+_0xde35('0x41')+_0x26b8d4+'.'+_0x47aaa)[_0xde35('0x13')](_0x26b8d4+_0xde35('0x42'),_0x33ae79)[_0xde35('0x13')](_0xde35('0x43'),NOW)['where'](_0xde35('0x44'),selectNotIn(_0x26b8d4,_0x27916d,_0x47aaa,_0xde35('0x45'),[_0xde35('0x46'),_0xde35('0x47')]))[_0xde35('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x26b8d4,_0x27916d,_0x47aaa,'cm_hopper',['\x22always\x22'])))[_0xde35('0x48')]();}function insertCmHopperBlack(_0x4792d0,_0x13c077,_0x298eaf,_0x4adfbf){var _0x1e04c0=[_0xde35('0x2c'),_0xde35('0x2e'),'cm_contacts.ListId',_0x13c077+'.'+_0x4adfbf,_0xde35('0x2f'),_0xde35('0x30')];return squel[_0xde35('0x32')]()[_0xde35('0x33')](_0xde35('0x49'))[_0xde35('0x34')]([_0xde35('0x12'),_0xde35('0x36'),_0xde35('0x37'),_0x4adfbf,_0xde35('0x38'),_0xde35('0x39')],squel[_0xde35('0x11')]()['fields'](_0x1e04c0)[_0xde35('0x4a')](_0x13c077)[_0xde35('0x3d')](_0xde35('0x3e'),null,_0xde35('0x3f')+_0x13c077+_0xde35('0x40'))[_0xde35('0x3d')](_0x298eaf,null,_0x298eaf+'.id\x20=\x20'+_0x13c077+'.'+_0x4adfbf)[_0xde35('0x13')](_0x13c077+'.CmListId\x20=\x20?',_0x4792d0)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xde35('0x13')](_0xde35('0x44'),squel[_0xde35('0x11')]()[_0xde35('0x4b')](_0xde35('0x12'))[_0xde35('0x4a')](_0xde35('0x49'))[_0xde35('0x13')](_0xde35('0x4c'),_0x4792d0)[_0xde35('0x13')](_0x4adfbf+'\x20=\x20?',_0x13c077+'.'+_0x4adfbf)))[_0xde35('0x48')]();}function insertCmHopperAdditionalPhones(_0x2ff917){var _0x57d37c=[_0xde35('0x4d'),'cm_contact_has_items.item',_0xde35('0x4e'),_0xde35('0x4f'),_0xde35('0x50')];return squel[_0xde35('0x32')]()['into'](_0xde35('0x51'))[_0xde35('0x34')](['CmHopperId',_0xde35('0x12'),_0xde35('0x52'),_0xde35('0x38'),_0xde35('0x39')],squel[_0xde35('0x11')]()['fields'](_0x57d37c)['from'](_0xde35('0x45'))[_0xde35('0x3d')](_0xde35('0x3e'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xde35('0x3d')](_0xde35('0x53'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xde35('0x13')](_0xde35('0x54'),_0x2ff917)[_0xde35('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xde35('0x48')]();}function insertCmContact(_0x108bec,_0x5e8cd7,_0x1a9b20,_0x297564){var _0x5964e7=_[_0xde35('0x55')](_[_0xde35('0x56')](_0x297564),[_0xde35('0x37'),_0xde35('0x57'),_0xde35('0x38'),_0xde35('0x39')]);return squel[_0xde35('0x32')]()[_0xde35('0x33')]('cm_contacts')['fromQuery'](_0x5964e7,squel['select']()[_0xde35('0x3c')](_0x5964e7)['from'](_0x5e8cd7)[_0xde35('0x13')]('('+_0x1a9b20['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xde35('0x11')]()[_0xde35('0x3c')](_0x1a9b20)[_0xde35('0x4a')]('cm_contacts')[_0xde35('0x13')](_0xde35('0x4c'),_0x108bec))[_0xde35('0x13')](_0xde35('0x58'),squel['select']()[_0xde35('0x4b')](_0xde35('0x59'),_0xde35('0x5a'))[_0xde35('0x4a')](_0x5e8cd7)[_0xde35('0x5b')](_0x1a9b20[_0xde35('0x3d')](','))))[_0xde35('0x48')]();}function handleStop(){logger[_0xde35('0x5c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x56e93b){logger[_0xde35('0x1d')](_0x56e93b[_0xde35('0x1e')]);process[_0xde35('0x5d')](0x1);}function handleError(_0x2bfa37,_0x5dff29){stats[_0xde35('0x5e')][_0xde35('0x1b')]({'name':_0x5dff29[_0xde35('0x5f')],'message':_0x5dff29[_0xde35('0x1e')],'row':_0x2bfa37});}function handleQuery(_0x75a47d){logger[_0xde35('0x5c')](_0x75a47d);return db[_0xde35('0x15')][_0xde35('0x16')](_0x75a47d)[_0xde35('0x18')](function(_0x253248){results[_0xde35('0x1b')](_0x253248);})[_0xde35('0x1c')](function(_0x326504){logger['error'](_0x326504[_0xde35('0x1e')]);});}function main(_0x38333e,_0x59bfaf,_0x30e2e5,_0x4322ce){logger[_0xde35('0x5c')](_0xde35('0x60'),_0x38333e,JSON['stringify'](_0x59bfaf));process[_0xde35('0x61')](_0xde35('0x62'));var _0x17e806=_0x59bfaf[_0xde35('0x63')];var _0x381674=_[_0xde35('0x64')](_0x17e806);var _0x48b880=_0x59bfaf[_0xde35('0x65')];var _0x784b38=path['join'](config[_0xde35('0x66')],'server/files/tmp',_0x48b880+_0xde35('0x67'));logger['info'](_0xde35('0x68'),_0x59bfaf);db[_0xde35('0x69')][_0xde35('0x6a')]({'raw':!![],'attributes':['id',_0xde35('0x6b')]})[_0xde35('0x25')](function(_0x2464af){for(var _0xd547ae=0x0;_0xd547ae<_0x2464af[_0xde35('0x19')];_0xd547ae++){if(_0x2464af[_0xd547ae][_0xde35('0x6b')]in _0x17e806){contactItemTypes[_0xde35('0x1b')](_0x2464af[_0xd547ae]);delete _0x381674[_0x2464af[_0xd547ae][_0xde35('0x6b')]];hasAdditionalPhones=!![];}for(var _0x102d27 in _0x17e806){if(_0x2464af[_0xd547ae]['name']+_0xde35('0x6c')===_0x102d27){phoneDescriptions[_0xde35('0x1b')]({'itemTypeId':_0x2464af[_0xd547ae]['id'],'description':_0x102d27});delete _0x381674[_0x102d27];}}}if(hasAdditionalPhones)_0x381674[_0xde35('0x1f')]='';var _0x109243=_[_0xde35('0x56')](_0x381674)[_0xde35('0x3d')]();logger[_0xde35('0x5c')](_0xde35('0x6d'),_0x109243);fs[_0xde35('0x6e')](_0x784b38,_0x109243+'\x0a');Papa[_0xde35('0x6f')](fs['createReadStream'](_0x38333e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x57a8c9,_0x3573ad){try{for(var _0x4b777c=0x0,_0x24832d=[];_0x4b777c<_0x57a8c9[_0xde35('0x70')][_0xde35('0x19')];_0x4b777c++){stats['rows']+=0x1;if(_0x57a8c9[_0xde35('0x5e')][_0x4b777c]){handleError(_0x57a8c9[_0xde35('0x70')][_0x4b777c],_0x57a8c9['errors'][_0x4b777c]);}else{var _0x4f37a4=[];var _0x38602e=[];var _0x53dbbe={};for(var _0x492e05 in _0x17e806){let _0x350540=contactItemTypes['find'](_0x4c99a6=>_0x4c99a6[_0xde35('0x6b')]===_0x492e05);let _0x324806=contactItemTypes[_0xde35('0x71')](_0x105047=>_0x105047['name']+_0xde35('0x6c')===_0x492e05);if(_[_0xde35('0x1a')](_0x350540)&&_[_0xde35('0x1a')](_0x324806)){if(_0x17e806[_0xde35('0x72')](_0x492e05)){if(_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05]]){var _0x434022=_['trim'](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05]][_0xde35('0x73')](/"/g,'\x27'));switch(_0x492e05){case _0xde35('0x35'):var _0x56775f=moment(_0x434022,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x56775f[_0xde35('0x74')]()){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4['push'](_0xde35('0x75'));}break;case _0xde35('0x76'):var _0x15e768=parseInt(_0x434022);_0x434022=_['isNaN'](_0x15e768)||_0x15e768<0x0||_0x15e768>0x4?_0x4322ce?0x3:0x2:_0x15e768;_0x24832d['push']('\x22'+_0x434022+'\x22');break;case _0xde35('0x3a'):var _0x3d8a79=parseInt(_0x434022);if(_[_0xde35('0x77')](_0x3d8a79)&&_[_0xde35('0x78')](_0x30e2e5,_0x3d8a79)){_0x24832d[_0xde35('0x1b')]('\x22'+_0x3d8a79+'\x22');}else{_0x4f37a4[_0xde35('0x1b')]('agent\x20not\x20exists');}break;case _0xde35('0x79'):if(isEmail(_0x434022)){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4[_0xde35('0x1b')](_0xde35('0x7a'));}break;case _0xde35('0x7b'):var _0xd0e970=moment(_0x434022,_0xde35('0x7c'),!![]);if(_0xd0e970['isValid']()){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4[_0xde35('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}}else{switch(_0x492e05){case _0xde35('0x7d'):case _0xde35('0x12'):_0x4f37a4[_0xde35('0x1b')](_0x492e05+_0xde35('0x7e'));break;default:_0x24832d[_0xde35('0x1b')]('\x22\x22');}}}}else{var _0x2f4913='';if(!_[_0xde35('0x1a')](_0x350540)){if(!_0x53dbbe['hasOwnProperty'](_0x350540['id'])){for(var _0x32e8f9=0x0;_0x32e8f9<_0x17e806[_0x492e05]['length'];_0x32e8f9++){var _0x434022=_[_0xde35('0x7f')](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05][_0x32e8f9]][_0xde35('0x73')](/"/g,'\x27'));var _0x25bdf1=phoneDescriptions[_0xde35('0x71')](_0x4585ea=>_0x4585ea[_0xde35('0x80')]===_0x350540['id']);if(!_[_0xde35('0x1a')](_0x25bdf1)){var _0x221f48=_[_0xde35('0x7f')](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x25bdf1[_0xde35('0x81')]][0x0]][_0xde35('0x73')](/"/g,'\x27'));if(!_['isNil'](_0x221f48))_0x434022=_0x434022+'§'+_0x221f48;}if(_0x2f4913=='')_0x2f4913=_0x434022;else _0x2f4913+='|'+_0x434022;}_0x38602e[_0xde35('0x1b')](_0x350540['id']+':'+_0x2f4913);_0x53dbbe[_0x350540['id']]=0x1;}}}}if(hasAdditionalPhones){_0x24832d[_0xde35('0x1b')]('\x22'+_0x38602e[_0xde35('0x3d')](';')+'\x22');}if(_0x4f37a4[_0xde35('0x19')]){handleError(_0x57a8c9[_0xde35('0x70')][_0x4b777c],{'code':_0xde35('0x82'),'message':_0x4f37a4[_0xde35('0x3d')]()});}else{fs['appendFileSync'](_0x784b38,_0x24832d['join']()+'\x0a');}_0x24832d=[];}if(!(stats[_0xde35('0x83')]%0xc8)){socket[_0xde35('0x84')](_0xde35('0x85')+_0x48b880,stats);stats[_0xde35('0x5e')]=[];}}if(stopped){logger[_0xde35('0x5c')]('Abort\x20parser');_0x3573ad[_0xde35('0x86')]();}}catch(_0x5df20d){handleError(_0x57a8c9['data'][_0x4b777c],{'code':'SystemError','message':_0x5df20d[_0xde35('0x1e')]});logger[_0xde35('0x1d')](_0xde35('0x87'),_0x5df20d[_0xde35('0x1e')]);}},'complete':function(){try{var _0x1d04ae=[];var _0xbb9987=tempTableName;_0x1d04ae[_0xde35('0x1b')](_0xde35('0x88')+_0xbb9987+'\x20LIKE\x20cm_contacts;');logger[_0xde35('0x5c')](_0xde35('0x89'),contactItemTypes['length']);var _0x5b87b2=util['format'](_0xde35('0x8a'),_0x784b38,_0xbb9987,_0x109243,_0x59bfaf[_0xde35('0x37')],_0x59bfaf[_0xde35('0x57')]||null,NOW,NOW);if(_[_0xde35('0x1a')](_0x17e806[_0xde35('0x35')])){_0x5b87b2+=_0xde35('0x8b');}_0x1d04ae[_0xde35('0x1b')](_0x5b87b2);BPromise['each'](_0x1d04ae,handleQuery)[_0xde35('0x25')](function(_0x5824e6){BPromise[_0xde35('0x20')]([handleAdditionalPhones()])[_0xde35('0x25')](function(){_0x1d04ae=[];for(var _0xa7a044=0x0;_0xa7a044\x20\x20');}var _0x141b57=path[_0xde35('0x3d')](config[_0xde35('0x66')],_0xde35('0x97'),process[_0xde35('0x96')][0x2]);if(!fs['existsSync'](_0x141b57)){throw new Error(_0xde35('0x98'));}var _0x2a0747={};try{_0x2a0747=JSON[_0xde35('0x6f')](process['argv'][0x3]);if(!_0x2a0747['binding']){throw new Error(_0xde35('0x99'));}var _0xca36d3=0x0;if(_0x2a0747['binding']['UserId']){_0xca36d3=0x1;}if(!_0x2a0747['ListId']){throw new Error(_0xde35('0x9a'));}}catch(_0x211b6a){throw new Error('body\x20id\x20mandatory');}var _0x1b9314=[];try{_0x1b9314=_['map'](JSON[_0xde35('0x6f')](process[_0xde35('0x96')][0x4]),'id');}catch(_0x48f994){logger['info'](_0xde35('0x9b'));}main(_0x141b57,_0x2a0747,_0x1b9314,_0xca36d3);}validate();process['on']('SIGINT',handleStop);process['on'](_0xde35('0x9c'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index e2c0ebb..88f77b4 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63e9=['calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Talk\x20Time','Called\x20Number','Member\x20Name','UniqueId','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','queue'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x63e9,0x124));var _0x963e=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0x63e9[_0x19f5fc];return _0x315fa3;};'use strict';exports[_0x963e('0x0')]=function(_0x3be98b,_0x9a7358){var _0x480fdb=[{'type':_0x963e('0x1'),'content':_0x963e('0x2'),'variableName':null}];switch(_0x3be98b['toLowerCase']()){case _0x963e('0x3'):switch(_0x9a7358[_0x963e('0x4')]()){case _0x963e('0x5'):_0x480fdb[_0x963e('0x6')]({'type':_0x963e('0x7'),'content':'','variableName':_0x963e('0x8')});_0x480fdb['push']({'type':_0x963e('0x7'),'content':'','variableName':_0x963e('0x9')});break;case _0x963e('0xa'):_0x480fdb[_0x963e('0x6')]({'type':_0x963e('0x1'),'content':_0x963e('0xb'),'variableName':null});_0x480fdb[_0x963e('0x6')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x480fdb;};exports[_0x963e('0xc')]=function(_0x2d5f86,_0x3e1345){var _0x378977=[];switch(_0x2d5f86[_0x963e('0x4')]()){case'voice':switch(_0x3e1345[_0x963e('0x4')]()){case'inbound':_0x378977=[{'type':'string','content':_0x963e('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0xf'),'keyType':'variable','variableName':_0x963e('0x9')},{'type':'keyValue','content':'','key':_0x963e('0x10'),'keyType':'variable','variableName':'calleridname'},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x11'),'keyType':_0x963e('0x7'),'variableName':'destexten'},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x12'),'keyType':_0x963e('0x7'),'variableName':_0x963e('0x8')},{'type':_0x963e('0xe'),'content':'','key':'UniqueId','keyType':_0x963e('0x7'),'variableName':_0x963e('0x13')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x14'),'keyType':_0x963e('0x7'),'variableName':_0x963e('0x15')},{'type':_0x963e('0x1'),'content':_0x963e('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x17'),'keyType':_0x963e('0x7'),'variableName':'destcalleridname'},{'type':_0x963e('0xe'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0x963e('0x18')},{'type':_0x963e('0x1'),'content':_0x963e('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x1a'),'keyType':_0x963e('0x7'),'variableName':_0x963e('0x15')},{'type':'keyValue','content':'','key':_0x963e('0x1b'),'keyType':_0x963e('0x7'),'variableName':_0x963e('0x1c')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x1d'),'keyType':_0x963e('0x7'),'variableName':'agentcompleteAt'},{'type':_0x963e('0xe'),'content':'','key':'Hold\x20Time','keyType':_0x963e('0x7'),'variableName':'holdtime'},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x1e'),'keyType':_0x963e('0x7'),'variableName':'talktime'}];break;case _0x963e('0xa'):_0x378977=[{'type':_0x963e('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x963e('0x1f'),'keyType':'variable','keyContent':'','variableName':_0x963e('0x18')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x20'),'keyType':_0x963e('0x7'),'keyContent':'','variableName':'membername'},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x21'),'keyType':_0x963e('0x7'),'keyContent':'','variableName':_0x963e('0x13')},{'type':'keyValue','content':'','key':_0x963e('0x14'),'keyType':_0x963e('0x7'),'keyContent':'','variableName':_0x963e('0x22')},{'type':_0x963e('0x1'),'content':_0x963e('0x19')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x23'),'keyType':_0x963e('0x7'),'keyContent':'','variableName':_0x963e('0x24')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x25'),'keyType':'variable','keyContent':'','variableName':_0x963e('0x26')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x27'),'keyType':_0x963e('0x7'),'keyContent':'','variableName':_0x963e('0x28')},{'type':_0x963e('0xe'),'content':'','key':_0x963e('0x29'),'keyType':_0x963e('0x7'),'keyContent':'','variableName':_0x963e('0x2a')}];break;}}return _0x378977;}; \ No newline at end of file +var _0xcf3c=['string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','calleridnum','Outbound\x20Call','variable','destcalleridnum','getDescriptions','keyValue','Caller\x20Name','Call\x20To','Queue','queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects'];(function(_0x31446b,_0x45e235){var _0x1ec2a5=function(_0x288b8c){while(--_0x288b8c){_0x31446b['push'](_0x31446b['shift']());}};_0x1ec2a5(++_0x45e235);}(_0xcf3c,0xdb));var _0xccf3=function(_0x482c56,_0xd039d1){_0x482c56=_0x482c56-0x0;var _0x1a6e32=_0xcf3c[_0x482c56];return _0x1a6e32;};'use strict';exports[_0xccf3('0x0')]=function(_0x2f369d,_0x55ae2a){var _0x15dde0=[{'type':_0xccf3('0x1'),'content':_0xccf3('0x2'),'variableName':null}];switch(_0x2f369d[_0xccf3('0x3')]()){case _0xccf3('0x4'):switch(_0x55ae2a[_0xccf3('0x3')]()){case _0xccf3('0x5'):_0x15dde0[_0xccf3('0x6')]({'type':'variable','content':'','variableName':'queue'});_0x15dde0[_0xccf3('0x6')]({'type':'variable','content':'','variableName':_0xccf3('0x7')});break;case'outbound':_0x15dde0['push']({'type':_0xccf3('0x1'),'content':_0xccf3('0x8'),'variableName':null});_0x15dde0[_0xccf3('0x6')]({'type':_0xccf3('0x9'),'content':'','variableName':_0xccf3('0xa')});break;}}return _0x15dde0;};exports[_0xccf3('0xb')]=function(_0x4128fa,_0x32c152){var _0x8d2c13=[];switch(_0x4128fa[_0xccf3('0x3')]()){case'voice':switch(_0x32c152[_0xccf3('0x3')]()){case _0xccf3('0x5'):_0x8d2c13=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xccf3('0xc'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0xccf3('0x7')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0xd'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0xccf3('0xe'),'keyType':_0xccf3('0x9'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xccf3('0xf'),'keyType':'variable','variableName':_0xccf3('0x10')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x11'),'keyType':_0xccf3('0x9'),'variableName':'uniqueid'},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x12'),'keyType':'variable','variableName':_0xccf3('0x13')},{'type':_0xccf3('0x1'),'content':_0xccf3('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x15'),'keyType':_0xccf3('0x9'),'variableName':_0xccf3('0x16')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x17'),'keyType':'variable','variableName':_0xccf3('0xa')},{'type':_0xccf3('0x1'),'content':_0xccf3('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xccf3('0xc'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xccf3('0x13')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x19'),'keyType':'variable','variableName':_0xccf3('0x1a')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x1b'),'keyType':_0xccf3('0x9'),'variableName':'agentcompleteAt'},{'type':_0xccf3('0xc'),'content':'','key':'Hold\x20Time','keyType':_0xccf3('0x9'),'variableName':_0xccf3('0x1c')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x1d'),'keyType':'variable','variableName':_0xccf3('0x1e')}];break;case _0xccf3('0x1f'):_0x8d2c13=[{'type':_0xccf3('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x20'),'keyType':'variable','keyContent':'','variableName':_0xccf3('0xa')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x21'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x22')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x11'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x23')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x12'),'keyType':'variable','keyContent':'','variableName':_0xccf3('0x24')},{'type':_0xccf3('0x1'),'content':_0xccf3('0x18')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x25'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x26')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x27'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x28')},{'type':_0xccf3('0xc'),'content':'','key':_0xccf3('0x29'),'keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x2a')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0xccf3('0x9'),'keyContent':'','variableName':_0xccf3('0x2b')}];break;}}return _0x8d2c13;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index d2e16c1..2adfb2c 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x726c=['skipInteractionsQuery','getInteractionsQuery','resolve','then','search','parseQueryParameters','body','where','contact','default','fields','filter','user','having','read','checkAccountsRestrictions','i.id','tag','countFilteredInteractions','length','count','clause','order','DESC','closed','getClosedOrderClause','getFilteredInteractions','rows','tracked','clone','omit','html','phone','fax','lodash','./sql-utils','./utils','findAll'];(function(_0x41b133,_0x114320){var _0x844201=function(_0x328f1a){while(--_0x328f1a){_0x41b133['push'](_0x41b133['shift']());}};_0x844201(++_0x114320);}(_0x726c,0x1c4));var _0xc726=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x726c[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xc726('0x0'));var sqlUtils=require(_0xc726('0x1'));var utils=require(_0xc726('0x2'));exports[_0xc726('0x3')]=function(_0x2ae848,_0x47ce9d,_0x9601ba,_0x7b5808,_0x27aba9){var _0x3373b2={'count':0x0,'rows':[]};var _0x923841=sqlUtils[_0xc726('0x4')](_0x2ae848,_0x9601ba,_0x47ce9d);if(_0x923841){return Promise['resolve'](_0x3373b2);}var _0x418def=sqlUtils[_0xc726('0x5')](_0x2ae848);var _0x1173b2={};return Promise[_0xc726('0x6')]()[_0xc726('0x7')](function(){if(_0x47ce9d[_0xc726('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x47ce9d[_0xc726('0x8')],_0x27aba9);}else{return sqlUtils[_0xc726('0x9')](_0x2ae848,_0x47ce9d,_0x27aba9);}})['then'](function(_0x263dab){_0x418def['where'](_0x263dab[_0xc726('0xa')]);_0x418def[_0xc726('0xb')](_0x263dab[_0xc726('0xc')]);_0x418def[_0xc726('0xb')](_0x263dab[_0xc726('0xd')]);_0x418def[_0xc726('0xb')](_0x263dab[_0xc726('0xe')]);_0x418def['where'](_0x263dab[_0xc726('0xf')]);_0x418def[_0xc726('0xb')](_0x263dab[_0xc726('0x10')]);_0x418def[_0xc726('0x11')](_0x263dab[_0xc726('0x12')]);_0x1173b2=_0x263dab['tags'];return sqlUtils[_0xc726('0x13')](_0x2ae848,_0x9601ba,_0x47ce9d);})[_0xc726('0x7')](function(_0x1192e0){_0x418def[_0xc726('0xb')](_0x1192e0);_0x418def['group'](_0xc726('0x14'));var _0x5b52bc=_0x47ce9d['search']?_0x1173b2['ids']:_0x47ce9d[_0xc726('0x15')];return sqlUtils[_0xc726('0x16')](_0x418def,_0x5b52bc);})[_0xc726('0x7')](function(_0xf78405){_0x3373b2['count']=_0xf78405[_0xc726('0x17')];if(_0x3373b2[_0xc726('0x18')]===0x0){return[];}_0x418def['having'](_0x1173b2[_0xc726('0x19')]);if(_0x7b5808[_0xc726('0x1a')]){_0x7b5808['order']['forEach'](function(_0x1be4e9){var _0x24537d=_0x1be4e9[0x0]==='contactName'?_0x1be4e9[0x0]:'i.'+_0x1be4e9[0x0];_0x418def[_0xc726('0x1a')](_0x24537d,_0x1be4e9[0x1]===_0xc726('0x1b')?![]:!![]);if(_0x1be4e9[0x0]===_0xc726('0x1c')){var _0x3408b6=sqlUtils[_0xc726('0x1d')](_0x2ae848,_0x47ce9d);_0x418def[_0xc726('0x1a')](_0x3408b6,_0x1be4e9[0x1]===_0xc726('0x1b')?![]:!![]);}});}return sqlUtils[_0xc726('0x1e')](_0x2ae848,_0x418def,_0x47ce9d,_0x7b5808);})[_0xc726('0x7')](function(_0x2a4d64){_0x3373b2[_0xc726('0x1f')]=_0x2a4d64;return _0x3373b2;})['catch'](function(_0xc5263b){throw _0xc5263b;});};exports[_0xc726('0x20')]=function(_0x42b752,_0x149018){return function(_0x1d2579,_0x4e72e5,_0x1ff0f8){var _0xe61634=_0x1d2579['user'];var _0x348ae8={};var _0x48832a=_0x1d2579['query'];if(_0x348ae8){_0x348ae8=_[_0xc726('0x21')](_0x1d2579['body']);_0x348ae8=_[_0xc726('0x22')](_0x348ae8,[_0xc726('0xa'),_0xc726('0x23'),_0xc726('0x24'),_0xc726('0x25'),'mobile']);}utils['updateUser'](_0xe61634,_0x348ae8,_0x48832a,_0x42b752,_0x149018);_0x1ff0f8(null);};}; \ No newline at end of file +var _0x8999=['resolve','getInteractionsQuery','then','search','parseQueryParameters','where','contact','default','fields','filter','user','having','read','tags','checkAccountsRestrictions','group','ids','length','count','clause','order','DESC','getClosedOrderClause','rows','catch','tracked','query','clone','body','omit','html','phone','fax','mobile','updateUser','./sql-utils','./utils','findAll','skipInteractionsQuery'];(function(_0x50c154,_0x4e08a2){var _0x23aad4=function(_0xb549c1){while(--_0xb549c1){_0x50c154['push'](_0x50c154['shift']());}};_0x23aad4(++_0x4e08a2);}(_0x8999,0x10d));var _0x9899=function(_0x1a6c7f,_0x5aee3f){_0x1a6c7f=_0x1a6c7f-0x0;var _0x1d378d=_0x8999[_0x1a6c7f];return _0x1d378d;};'use strict';var _=require('lodash');var sqlUtils=require(_0x9899('0x0'));var utils=require(_0x9899('0x1'));exports[_0x9899('0x2')]=function(_0x3bd4f8,_0x4887fb,_0x2e4592,_0x1440d5,_0x1aea69){var _0x5a5c19={'count':0x0,'rows':[]};var _0x1735a3=sqlUtils[_0x9899('0x3')](_0x3bd4f8,_0x2e4592,_0x4887fb);if(_0x1735a3){return Promise[_0x9899('0x4')](_0x5a5c19);}var _0x376792=sqlUtils[_0x9899('0x5')](_0x3bd4f8);var _0x50f916={};return Promise['resolve']()[_0x9899('0x6')](function(){if(_0x4887fb[_0x9899('0x7')]){return sqlUtils['parseAdvancedSearchFilter'](_0x4887fb[_0x9899('0x7')],_0x1aea69);}else{return sqlUtils[_0x9899('0x8')](_0x3bd4f8,_0x4887fb,_0x1aea69);}})[_0x9899('0x6')](function(_0x4e69db){_0x376792[_0x9899('0x9')](_0x4e69db['body']);_0x376792['where'](_0x4e69db[_0x9899('0xa')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xb')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xc')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xd')]);_0x376792[_0x9899('0x9')](_0x4e69db[_0x9899('0xe')]);_0x376792[_0x9899('0xf')](_0x4e69db[_0x9899('0x10')]);_0x50f916=_0x4e69db[_0x9899('0x11')];return sqlUtils[_0x9899('0x12')](_0x3bd4f8,_0x2e4592,_0x4887fb);})[_0x9899('0x6')](function(_0x2123ba){_0x376792[_0x9899('0x9')](_0x2123ba);_0x376792[_0x9899('0x13')]('i.id');var _0x23e3d0=_0x4887fb[_0x9899('0x7')]?_0x50f916[_0x9899('0x14')]:_0x4887fb['tag'];return sqlUtils['countFilteredInteractions'](_0x376792,_0x23e3d0);})[_0x9899('0x6')](function(_0x5ca047){_0x5a5c19['count']=_0x5ca047[_0x9899('0x15')];if(_0x5a5c19[_0x9899('0x16')]===0x0){return[];}_0x376792['having'](_0x50f916[_0x9899('0x17')]);if(_0x1440d5[_0x9899('0x18')]){_0x1440d5[_0x9899('0x18')]['forEach'](function(_0x4782a4){var _0xb59629=_0x4782a4[0x0]==='contactName'?_0x4782a4[0x0]:'i.'+_0x4782a4[0x0];_0x376792[_0x9899('0x18')](_0xb59629,_0x4782a4[0x1]===_0x9899('0x19')?![]:!![]);if(_0x4782a4[0x0]==='closed'){var _0x5361df=sqlUtils[_0x9899('0x1a')](_0x3bd4f8,_0x4887fb);_0x376792[_0x9899('0x18')](_0x5361df,_0x4782a4[0x1]===_0x9899('0x19')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x3bd4f8,_0x376792,_0x4887fb,_0x1440d5);})[_0x9899('0x6')](function(_0x1831eb){_0x5a5c19[_0x9899('0x1b')]=_0x1831eb;return _0x5a5c19;})[_0x9899('0x1c')](function(_0x1a78d0){throw _0x1a78d0;});};exports[_0x9899('0x1d')]=function(_0x365b22,_0x290eaf){return function(_0x438db1,_0x2aa54c,_0x49b482){var _0x2a41ce=_0x438db1[_0x9899('0xe')];var _0x4e9f75={};var _0x31c217=_0x438db1[_0x9899('0x1e')];if(_0x4e9f75){_0x4e9f75=_[_0x9899('0x1f')](_0x438db1[_0x9899('0x20')]);_0x4e9f75=_[_0x9899('0x21')](_0x4e9f75,[_0x9899('0x20'),_0x9899('0x22'),_0x9899('0x23'),_0x9899('0x24'),_0x9899('0x25')]);}utils[_0x9899('0x26')](_0x2a41ce,_0x4e9f75,_0x31c217,_0x365b22,_0x290eaf);_0x49b482(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 9fc295f..da86b82 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f5a=['where','ui.','\x20IN\x20?','map','getInteractionsTables','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','\x20=\x20i.id','interactionsTags','it.','tools_tags','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','whatsapp','includes','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','conditions','find','type','default','text','value','start','unreadMessages','read','and','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','end','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','plainBody','body','keys','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','filter','get','capitalize','Accounts','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','closed','i.substatus','CONCAT_WS(\x27\x27,\x20','Interaction','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','fields','a.key','a.mandatoryDisposition','Account.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.updatedAt','i.closed','i.attach','i.lastMsgAt','i.ContactId','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','c.firstName','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','Sequelize','squel','../parsers/qs','./update-interaction','updateInteraction','getAccountFK','role','agent','search','select','field','name','color','getInteractionFK','user_has_','_interactions','u.id','from','left_join','users','u.id\x20=\x20ui.UserId','length'];(function(_0x58903c,_0x436521){var _0x11f24a=function(_0x2c4654){while(--_0x2c4654){_0x58903c['push'](_0x58903c['shift']());}};_0x11f24a(++_0x436521);}(_0x7f5a,0x12d));var _0xa7f5=function(_0x337a10,_0x5191c7){_0x337a10=_0x337a10-0x0;var _0x575f98=_0x7f5a[_0x337a10];return _0x575f98;};'use strict';var _=require('lodash');var squel=require(_0xa7f5('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0xa7f5('0x1'));var updateInteraction=require(_0xa7f5('0x2'))[_0xa7f5('0x3')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5d88c1,_0x991743,_0x1edda9){var _0x151825=![];var _0x2d411e=utils[_0xa7f5('0x4')](_0x5d88c1);if(_0x991743[_0xa7f5('0x5')]===_0xa7f5('0x6')&&!_0x1edda9[_0xa7f5('0x7')]&&!_0x1edda9[_0x2d411e]){_0x151825=!![];}return _0x151825;}function getTagsQuery(){return squel[_0xa7f5('0x8')]()[_0xa7f5('0x9')]('id')[_0xa7f5('0x9')](_0xa7f5('0xa'))['field'](_0xa7f5('0xb'))['from']('tools_tags');}function getUsersQuery(_0x4392b3,_0x3bbecb){var _0x42d9eb=utils[_0xa7f5('0xc')](_0x4392b3);var _0x8e09ae=_0xa7f5('0xd')+_0x4392b3+_0xa7f5('0xe');var _0x4bb0bd=squel[_0xa7f5('0x8')]()[_0xa7f5('0x9')](_0xa7f5('0xf'))['field']('u.fullname')['field']('ui.'+_0x42d9eb)[_0xa7f5('0x10')](_0x8e09ae,'ui')[_0xa7f5('0x11')](_0xa7f5('0x12'),'u',_0xa7f5('0x13'));if(_0x3bbecb[_0xa7f5('0x14')]>0x0){_0x4bb0bd[_0xa7f5('0x15')](_0xa7f5('0x16')+_0x42d9eb+_0xa7f5('0x17'),_[_0xa7f5('0x18')](_0x3bbecb,'id'));}return _0x4bb0bd;}function getInteractionsQuery(_0x375c6e){var _0x409fc3=utils[_0xa7f5('0x19')](_0x375c6e);var _0x3867d8=utils[_0xa7f5('0x4')](_0x375c6e);var _0x495fe5=utils[_0xa7f5('0xc')](_0x375c6e);return squel[_0xa7f5('0x8')]()[_0xa7f5('0x10')](_0x409fc3['interactions'],'i')[_0xa7f5('0x11')](_0xa7f5('0x1a'),'c',_0xa7f5('0x1b'))[_0xa7f5('0x11')](_0xa7f5('0x12'),'o',_0xa7f5('0x1c'))[_0xa7f5('0x11')](_0x409fc3[_0xa7f5('0x1d')],'a',_0xa7f5('0x1e')+_0x3867d8)[_0xa7f5('0x11')](_0x409fc3['messages'],'me','me.'+_0x495fe5+_0xa7f5('0x1f'))[_0xa7f5('0x11')](_0x409fc3[_0xa7f5('0x20')],'it',_0xa7f5('0x21')+_0x495fe5+'\x20=\x20i.id')['left_join'](_0xa7f5('0x22'),'t',_0xa7f5('0x23'));}function getSqlClauses(){var _0x249713={'body':squel[_0xa7f5('0x24')](),'contact':squel['expr'](),'default':squel[_0xa7f5('0x24')](),'fields':squel[_0xa7f5('0x24')](),'filter':squel[_0xa7f5('0x24')](),'read':squel[_0xa7f5('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xa7f5('0x24')]()};return _0x249713;}function parseTagParameter(_0x392cba){var _0x58d388=squel[_0xa7f5('0x24')]();if(_0x392cba){var _0x5ba7b4=utils[_0xa7f5('0x25')](_0x392cba);_0x5ba7b4[_0xa7f5('0x26')](function(_0x820fe0){_0x58d388['or'](_0xa7f5('0x27'),'%,'+_0x820fe0+',%');});}return _0x58d388;}function parseReadParameter(_0x1e7d28){var _0x1127dd='';if(_0x1e7d28){_0x1127dd=_0xa7f5('0x28');if(_0x1e7d28==='1'){_0x1127dd=_0x1127dd[_0xa7f5('0x29')](_0xa7f5('0x2a'),'=');}else{_0x1127dd=_0x1127dd['replace'](_0xa7f5('0x2a'),'>');}}return _0x1127dd;}function parseSearchFilter(_0x2c66e6,_0x410091){var _0x6ebab7=squel[_0xa7f5('0x24')]();if(_0x410091){var _0x479d28=_0x410091[_0xa7f5('0x29')]('\x5c','\x5c\x5c')[_0xa7f5('0x29')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x479d28)){_0x6ebab7['or'](_0xa7f5('0x2b'),_0x479d28+'%');if(['sms',_0xa7f5('0x2c')][_0xa7f5('0x2d')](_0x2c66e6)){_0x6ebab7['or']('i.phone\x20LIKE\x20?',_0x479d28+'%');}else if(_0x2c66e6==='fax'){_0x6ebab7['or'](_0xa7f5('0x2e'),_0x479d28+'%');}else if(_0x2c66e6===_0xa7f5('0x2f')){_0x6ebab7['or'](_0xa7f5('0x30'),_0x479d28+'%');}}else if(_0x2c66e6===_0xa7f5('0x31')&&qs[_0xa7f5('0x32')](_0x479d28)){_0x6ebab7['or'](_0xa7f5('0x33'),_0x479d28+'%');}else{if(_0x2c66e6===_0xa7f5('0x31')){_0x6ebab7['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa7f5('0x34')](_0x479d28,!![]))['or'](_0xa7f5('0x35'),qs[_0xa7f5('0x34')](_0x479d28));}else if(_0x2c66e6!==_0xa7f5('0x36')){_0x6ebab7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa7f5('0x34')](_0x479d28));}_0x6ebab7['or'](_0xa7f5('0x37'),qs[_0xa7f5('0x34')](_0x479d28,!![]),null);}}return _0x6ebab7;}function parseAdvancedSearchFilter(_0x419e5f,_0x561863){var _0x2989f0=getSqlClauses();var _0x4bf56e=as[_0xa7f5('0x38')](_0x419e5f);var _0x32f362=_0x4bf56e['sqlOperator'];for(var _0x3708e2=0x0;_0x3708e2<_0x4bf56e[_0xa7f5('0x39')][_0xa7f5('0x14')];_0x3708e2++){var _0x534d03=_0x4bf56e[_0xa7f5('0x39')][_0x3708e2];var _0x1d2f72='i';var _0x484787=_[_0xa7f5('0x3a')](_0x561863,[_0xa7f5('0xa'),_0x534d03['field']]);if(_0x484787){var _0x51ac4e=as['buildExpression'](_0x1d2f72,_0x484787[_0xa7f5('0x3b')],_0x534d03);_0x2989f0[_0xa7f5('0x3c')][_0x32f362](_0x51ac4e[_0xa7f5('0x3d')],_0x51ac4e[_0xa7f5('0x3e')][_0xa7f5('0x3f')],_0x51ac4e['value']['end']);}else{switch(_0x534d03[_0xa7f5('0x9')]){case _0xa7f5('0x40'):var _0x2dc9fc=parseReadParameter(_0x534d03['value']);_0x2989f0[_0xa7f5('0x41')][_0xa7f5('0x42')](_0x2dc9fc);break;case _0xa7f5('0x43'):if(_0x534d03[_0xa7f5('0x44')]===_0xa7f5('0x45')){if(_0x534d03[_0xa7f5('0x3e')][_0xa7f5('0x46')]('\x20')[_0xa7f5('0x14')]>0x1){_0x2989f0[_0xa7f5('0x47')][_0x32f362]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa7f5('0x34')](_0x534d03[_0xa7f5('0x3e')],!![]),null);}else{var _0x2063cf='%'+_0x534d03['value']+'%';_0x2989f0[_0xa7f5('0x47')][_0x32f362](_0xa7f5('0x48'),_0x2063cf,_0x2063cf,_0x2063cf);}}else{_0x484787=_[_0xa7f5('0x3a')](_0x561863,[_0xa7f5('0xa'),_0xa7f5('0x49')]);_0x534d03[_0xa7f5('0x9')]=_0xa7f5('0x49');_0x51ac4e=as['buildExpression'](_0x1d2f72,_0x484787[_0xa7f5('0x3b')],_0x534d03);_0x2989f0[_0xa7f5('0x47')][_0x32f362](_0x51ac4e['text'],_0x51ac4e['value']['start'],_0x51ac4e['value'][_0xa7f5('0x4a')]);}break;case _0xa7f5('0x4b'):var _0x8fecd4=_0x534d03[_0xa7f5('0x3e')]['split'](',')[_0xa7f5('0x18')](function(_0x535d38){return Number(_0x535d38);});var _0x1fcfa5=parseTagParameter(_0x8fecd4);_0x2989f0[_0xa7f5('0x4c')][_0xa7f5('0x4d')][_0xa7f5('0x42')](_0x1fcfa5);_0x2989f0[_0xa7f5('0x4c')][_0xa7f5('0x4e')]=_0x8fecd4;break;case _0xa7f5('0x4f'):if(_0x534d03['operator']==='$substring'){_0x2989f0[_0xa7f5('0x50')][_0x32f362](_0xa7f5('0x51'),'%'+_0x534d03[_0xa7f5('0x3e')]+'%',null);}else{_0x484787=_[_0xa7f5('0x3a')](_0x561863,[_0xa7f5('0xa'),_0xa7f5('0x52')]);_0x534d03[_0xa7f5('0x9')]='UserId';_0x51ac4e=as[_0xa7f5('0x53')](_0x1d2f72,_0x484787[_0xa7f5('0x3b')],_0x534d03);_0x2989f0[_0xa7f5('0x50')][_0x32f362](_0x51ac4e[_0xa7f5('0x3d')],_0x51ac4e[_0xa7f5('0x3e')]['start'],_0x51ac4e[_0xa7f5('0x3e')][_0xa7f5('0x4a')]);}break;case'body':case _0xa7f5('0x54'):_0x51ac4e=as[_0xa7f5('0x53')]('me',null,_0x534d03);_0x2989f0[_0xa7f5('0x55')][_0x32f362](_0x51ac4e[_0xa7f5('0x3d')],_0x51ac4e['value'][_0xa7f5('0x3f')],_0x51ac4e['value']['end']);break;}}}return _0x2989f0;}function parseModelFields(_0x5f0016,_0x193da5,_0x4084ba){var _0x72f58a=utils['getAccountFK'](_0x5f0016);var _0x5921f2=squel['expr']();var _0x3b652e=_(_0x193da5)[_0xa7f5('0x56')]()[_0xa7f5('0x18')](function(_0x5ba954){return _['some'](_0x4084ba,[_0xa7f5('0xa'),_0x5ba954])?_0x5ba954:undefined;})[_0xa7f5('0x57')]()[_0xa7f5('0x3e')]();if(_0x3b652e[_0xa7f5('0x14')]>0x0){_0x3b652e[_0xa7f5('0x26')](function(_0x2648be){if(_0x2648be===_0x72f58a){_0x5921f2[_0xa7f5('0x42')]('i.'+_0x72f58a+_0xa7f5('0x17'),[][_0xa7f5('0x58')](_0x193da5[_0x2648be]));}else if(_0x2648be===_0xa7f5('0x59')){var _0x1792fa=JSON[_0xa7f5('0x5a')](_0x193da5[_0x2648be])[_0xa7f5('0x5b')];var _0x4dd121=JSON[_0xa7f5('0x5a')](_0x193da5[_0x2648be])[_0xa7f5('0x5c')];_0x5921f2['and'](_0xa7f5('0x5d'),_0x1792fa,_0x4dd121);}else{if(_0x193da5[_0x2648be]===_0xa7f5('0x5e')){_0x5921f2[_0xa7f5('0x42')]('i.'+_0x2648be+_0xa7f5('0x5f'));}else{_0x5921f2[_0xa7f5('0x42')]('i.'+_0x2648be+_0xa7f5('0x60'),_0x193da5[_0x2648be]);}}});}return _0x5921f2;}function parseQueryParameters(_0x3e3029,_0x4dc8c0,_0x1bf9ff){var _0x135b38=getSqlClauses();return Promise[_0xa7f5('0x61')]()[_0xa7f5('0x62')](function(){return parseModelFields(_0x3e3029,_0x4dc8c0,_0x1bf9ff);})[_0xa7f5('0x62')](function(_0x105f35){_0x135b38['fields'][_0xa7f5('0x42')](_0x105f35);return parseReadParameter(_0x4dc8c0['read']);})[_0xa7f5('0x62')](function(_0x51e91c){_0x135b38[_0xa7f5('0x41')]['and'](_0x51e91c);return parseTagParameter(_0x4dc8c0[_0xa7f5('0x63')]);})[_0xa7f5('0x62')](function(_0x4dc710){_0x135b38['tags'][_0xa7f5('0x4d')][_0xa7f5('0x42')](_0x4dc710);return parseSearchFilter(_0x3e3029,_0x4dc8c0[_0xa7f5('0x64')]);})['then'](function(_0x40200a){_0x135b38[_0xa7f5('0x64')]=_0x40200a;return _0x135b38;});}function checkAccountsRestrictions(_0x35dbf3,_0x24ba82,_0x2a0a80){var _0x75abd1=utils[_0xa7f5('0x4')](_0x35dbf3);var _0x244073=_0xa7f5('0x65')+_[_0xa7f5('0x66')](_0x35dbf3)+(_0x35dbf3==='chat'?'Websites':_0xa7f5('0x67'));var _0x1bc067=squel['expr']();return Promise[_0xa7f5('0x61')]()[_0xa7f5('0x62')](function(){if(_0x2a0a80['search']&&_0x24ba82[_0xa7f5('0x5')]===_0xa7f5('0x6')){return _0x24ba82[_0x244073]({'attributes':['id'],'raw':!![]});}})[_0xa7f5('0x62')](function(_0x2c7cd9){if(_0x2c7cd9){if(_0x2c7cd9['length']===0x0){_0x1bc067[_0xa7f5('0x42')]('i.'+_0x75abd1+'\x20IS\x20NULL');}else{_0x1bc067[_0xa7f5('0x42')]('i.'+_0x75abd1+_0xa7f5('0x17'),_['map'](_0x2c7cd9,'id'));}}else if(!_0x2a0a80[_0x75abd1]){_0x1bc067['and']('i.'+_0x75abd1+_0xa7f5('0x68'));}})[_0xa7f5('0x62')](function(){return _0x1bc067;});}function getClosedOrderClause(_0x4b46b1,_0x27c13f){var _0x171067='';var _0x583652=['i.thirdDisposition',_0xa7f5('0x69'),_0xa7f5('0x6a')];if(_0x4b46b1==='mail'){_0x583652[_0xa7f5('0x6b')]('i.substatus');}if(_0x27c13f[_0xa7f5('0x6c')]==='0'&&_0x4b46b1==='mail'){_0x171067=_0xa7f5('0x6d');}else{if(_0x27c13f[_0xa7f5('0x6c')]==='1'){_0x583652['shift']();}_0x171067=_0xa7f5('0x6e')+_0x583652['join'](',\x20')+')';}return _0x171067;}function getFilteredInteractions(_0x2a22ac,_0x5c7545,_0x1e078d,_0xd30b13){var _0x5aa16e=utils[_0xa7f5('0xc')](_0x2a22ac);var _0x3ffc06=_[_0xa7f5('0x66')](_0x2a22ac)+_0xa7f5('0x6f');var _0x4de47f=[];var _0x4d51f5=getTagsQuery();var _0x939302={'type':db['Sequelize'][_0xa7f5('0x70')][_0xa7f5('0x71')],'raw':!![]};var _0x396550=[];var _0x470e55=[];return db[_0xa7f5('0x72')][_0xa7f5('0x73')](_0x4d51f5[_0xa7f5('0x74')](),_0x939302)[_0xa7f5('0x62')](function(_0x19e039){_0x4de47f=_[_0xa7f5('0x75')](_0x19e039,'id');_0x939302=_[_0xa7f5('0x76')](_0x939302,{'model':db[_0x3ffc06],'mapToModel':!![],'nest':!![]});if(_0x1e078d[_0xa7f5('0x77')]){_0xd30b13['attributes'][_0xa7f5('0x26')](function(_0x40da31){_0x5c7545['field']('i.'+_0x40da31);});}else{_0x5c7545['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa7f5('0x40'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x78'),'Account.key');_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x79'),_0xa7f5('0x7a'));if(_0x2a22ac==='mail'){_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x7b'),_0xa7f5('0x7c'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x7d'),_0xa7f5('0x7e'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x7f'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x80'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x81'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x82'));_0x5c7545['field']('i.closedAt');_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x83'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x84'));_0x5c7545[_0xa7f5('0x9')]('i.lastMsgDirection');_0x5c7545[_0xa7f5('0x9')]('i.subject');_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x6a'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x69'));_0x5c7545[_0xa7f5('0x9')]('i.thirdDisposition');_0x5c7545[_0xa7f5('0x9')]('i.substatus');_0x5c7545['field']('i.to');_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x85'));_0x5c7545[_0xa7f5('0x9')]('i.MailAccountId');_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x86'));}else if(_0x2a22ac===_0xa7f5('0x2f')){_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x87'),'contactName');}else{_0x5c7545['field'](_0xa7f5('0x88'),'contactName');}if(_0x2a22ac!==_0xa7f5('0x31')){_0x5c7545[_0xa7f5('0x9')]('i.*');}_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x89'),_0xa7f5('0x8a'));_0x5c7545[_0xa7f5('0x9')]('c.lastName',_0xa7f5('0x8b'));_0x5c7545['field']('c.email',_0xa7f5('0x8c'));_0x5c7545[_0xa7f5('0x9')]('c.phone',_0xa7f5('0x8d'));_0x5c7545['field'](_0xa7f5('0x8e'),_0xa7f5('0x8f'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x90'),_0xa7f5('0x91'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x92'),_0xa7f5('0x93'));_0x5c7545[_0xa7f5('0x9')](_0xa7f5('0x94'),_0xa7f5('0x95'));_0x5c7545[_0xa7f5('0x9')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa7f5('0x96'));}if(_0xd30b13[_0xa7f5('0x97')]){_0x5c7545[_0xa7f5('0x97')](_0xd30b13[_0xa7f5('0x97')]);}if(_0xd30b13[_0xa7f5('0x98')]){_0x5c7545[_0xa7f5('0x98')](_0xd30b13[_0xa7f5('0x98')]);}return db[_0xa7f5('0x72')][_0xa7f5('0x73')](_0x5c7545[_0xa7f5('0x74')](),_0x939302);})[_0xa7f5('0x62')](function(_0x17540d){_0x396550=_0x17540d;var _0x13ca0e=getUsersQuery(_0x2a22ac,_0x396550);return db['sequelize'][_0xa7f5('0x73')](_0x13ca0e[_0xa7f5('0x74')](),_0x939302);})[_0xa7f5('0x62')](function(_0x112c2c){_0x470e55=_[_0xa7f5('0x99')](_0x112c2c,_0x5aa16e);if(_0x2a22ac===_0xa7f5('0x31')){return db[_0xa7f5('0x9a')]['findOne']({'attributes':[_0xa7f5('0x9b')],'raw':!![]});}})[_0xa7f5('0x62')](function(_0x512311){var _0xd9b89=_0x512311?_0x512311[_0xa7f5('0x9b')]:undefined;var _0x45c09f=_0x396550['map'](function(_0x2e39cf){return updateInteraction(_0x2e39cf,_0x4de47f,_0x470e55,_0xd9b89);});return Promise['all'](_0x45c09f);});}function countFilteredInteractions(_0x55d191,_0x53da0c){var _0x2ab678=_0x55d191[_0xa7f5('0x9c')]();_0x2ab678[_0xa7f5('0x9')](_0xa7f5('0x9d'));_0x2ab678['field'](_0xa7f5('0x9e'),'unreadMessages');var _0x55b0a2=utils['getSelectedTags'](_0x53da0c);if(!_[_0xa7f5('0x9f')](_0x55b0a2)){_0x2ab678[_0xa7f5('0x15')]('t.id\x20IN\x20?',_0x55b0a2);}var _0x9cea7d={'type':db[_0xa7f5('0xa0')]['QueryTypes'][_0xa7f5('0x71')],'raw':!![]};return db['sequelize'][_0xa7f5('0x73')](_0x2ab678[_0xa7f5('0x74')](),_0x9cea7d);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x8bd8=['whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','value','start','end','and','operator','$substring','split','contact','ContactId','tags','clause','ids','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','plainBody','keys','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','unshift','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.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.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.substatus','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','toString','groupBy','Setting','enableEmailPreview','all','clone','isEmpty','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','accounts','a.id\x20=\x20i.','messages','me.','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','sms'];(function(_0x2eddea,_0x5711d0){var _0x5827d6=function(_0x47e621){while(--_0x47e621){_0x2eddea['push'](_0x2eddea['shift']());}};_0x5827d6(++_0x5711d0);}(_0x8bd8,0x6d));var _0x88bd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8bd8[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x88bd('0x0'));var squel=require(_0x88bd('0x1'));var as=require(_0x88bd('0x2'));var qs=require(_0x88bd('0x3'));var updateInteraction=require(_0x88bd('0x4'))['updateInteraction'];var utils=require(_0x88bd('0x5'));var db=require(_0x88bd('0x6'))['db'];function skipInteractionsQuery(_0x13a704,_0x31f016,_0x3f638e){var _0x3be59d=![];var _0x24f3d0=utils[_0x88bd('0x7')](_0x13a704);if(_0x31f016[_0x88bd('0x8')]===_0x88bd('0x9')&&!_0x3f638e[_0x88bd('0xa')]&&!_0x3f638e[_0x24f3d0]){_0x3be59d=!![];}return _0x3be59d;}function getTagsQuery(){return squel[_0x88bd('0xb')]()['field']('id')[_0x88bd('0xc')](_0x88bd('0xd'))[_0x88bd('0xc')](_0x88bd('0xe'))[_0x88bd('0xf')](_0x88bd('0x10'));}function getUsersQuery(_0x5e4431,_0x4fda0e){var _0x469f8e=utils[_0x88bd('0x11')](_0x5e4431);var _0x55c3d6='user_has_'+_0x5e4431+_0x88bd('0x12');var _0x50b021=squel[_0x88bd('0xb')]()['field'](_0x88bd('0x13'))[_0x88bd('0xc')](_0x88bd('0x14'))[_0x88bd('0xc')](_0x88bd('0x15')+_0x469f8e)[_0x88bd('0xf')](_0x55c3d6,'ui')[_0x88bd('0x16')](_0x88bd('0x17'),'u',_0x88bd('0x18'));if(_0x4fda0e[_0x88bd('0x19')]>0x0){_0x50b021[_0x88bd('0x1a')](_0x88bd('0x15')+_0x469f8e+_0x88bd('0x1b'),_[_0x88bd('0x1c')](_0x4fda0e,'id'));}return _0x50b021;}function getInteractionsQuery(_0x81af2a){var _0x230f50=utils[_0x88bd('0x1d')](_0x81af2a);var _0xbecee8=utils[_0x88bd('0x7')](_0x81af2a);var _0x56f5d8=utils[_0x88bd('0x11')](_0x81af2a);return squel['select']()[_0x88bd('0xf')](_0x230f50[_0x88bd('0x1e')],'i')[_0x88bd('0x16')](_0x88bd('0x1f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x88bd('0x17'),'o','o.id\x20=\x20i.UserId')[_0x88bd('0x16')](_0x230f50[_0x88bd('0x20')],'a',_0x88bd('0x21')+_0xbecee8)[_0x88bd('0x16')](_0x230f50[_0x88bd('0x22')],'me',_0x88bd('0x23')+_0x56f5d8+'\x20=\x20i.id')[_0x88bd('0x16')](_0x230f50['interactionsTags'],'it',_0x88bd('0x24')+_0x56f5d8+'\x20=\x20i.id')[_0x88bd('0x16')]('tools_tags','t',_0x88bd('0x25'));}function getSqlClauses(){var _0x102655={'body':squel[_0x88bd('0x26')](),'contact':squel['expr'](),'default':squel[_0x88bd('0x26')](),'fields':squel[_0x88bd('0x26')](),'filter':squel[_0x88bd('0x26')](),'read':squel[_0x88bd('0x26')](),'tags':{'clause':squel[_0x88bd('0x26')](),'ids':null},'user':squel['expr']()};return _0x102655;}function parseTagParameter(_0x3489ec){var _0x14f004=squel[_0x88bd('0x26')]();if(_0x3489ec){var _0x3a2e15=utils[_0x88bd('0x27')](_0x3489ec);_0x3a2e15[_0x88bd('0x28')](function(_0x11d0cc){_0x14f004['or'](_0x88bd('0x29'),'%,'+_0x11d0cc+',%');});}return _0x14f004;}function parseReadParameter(_0x59dbcd){var _0x13fe7d='';if(_0x59dbcd){_0x13fe7d='unreadMessages\x20{OPERATOR}\x200';if(_0x59dbcd==='1'){_0x13fe7d=_0x13fe7d[_0x88bd('0x2a')](_0x88bd('0x2b'),'=');}else{_0x13fe7d=_0x13fe7d[_0x88bd('0x2a')](_0x88bd('0x2b'),'>');}}return _0x13fe7d;}function parseSearchFilter(_0x33a636,_0x45d492){var _0x34fd38=squel[_0x88bd('0x26')]();if(_0x45d492){var _0x10cfa0=_0x45d492[_0x88bd('0x2a')]('\x5c','\x5c\x5c')[_0x88bd('0x2a')](/'/g,'\x27\x27');if(qs[_0x88bd('0x2c')](_0x10cfa0)){_0x34fd38['or']('i.id\x20LIKE\x20?',_0x10cfa0+'%');if([_0x88bd('0x2d'),_0x88bd('0x2e')]['includes'](_0x33a636)){_0x34fd38['or'](_0x88bd('0x2f'),_0x10cfa0+'%');}else if(_0x33a636===_0x88bd('0x30')){_0x34fd38['or'](_0x88bd('0x31'),_0x10cfa0+'%');}else if(_0x33a636==='openchannel'){_0x34fd38['or'](_0x88bd('0x32'),_0x10cfa0+'%');}}else if(_0x33a636===_0x88bd('0x33')&&qs[_0x88bd('0x34')](_0x10cfa0)){_0x34fd38['or']('c.email\x20LIKE\x20?',_0x10cfa0+'%');}else{if(_0x33a636===_0x88bd('0x33')){_0x34fd38['or'](_0x88bd('0x35'),qs[_0x88bd('0x36')](_0x10cfa0,!![]))['or'](_0x88bd('0x37'),qs['getFullTextValue'](_0x10cfa0));}else if(_0x33a636!==_0x88bd('0x30')){_0x34fd38['or'](_0x88bd('0x38'),qs[_0x88bd('0x36')](_0x10cfa0));}_0x34fd38['or'](_0x88bd('0x39'),qs[_0x88bd('0x36')](_0x10cfa0,!![]),null);}}return _0x34fd38;}function parseAdvancedSearchFilter(_0x2e0507,_0xb37532){var _0x2bcd41=getSqlClauses();var _0x2d77bd=as[_0x88bd('0x3a')](_0x2e0507);var _0x435149=_0x2d77bd[_0x88bd('0x3b')];for(var _0x10931d=0x0;_0x10931d<_0x2d77bd[_0x88bd('0x3c')][_0x88bd('0x19')];_0x10931d++){var _0x461521=_0x2d77bd['conditions'][_0x10931d];var _0x59b68d='i';var _0x1596cd=_[_0x88bd('0x3d')](_0xb37532,[_0x88bd('0xd'),_0x461521[_0x88bd('0xc')]]);if(_0x1596cd){var _0x458c8c=as[_0x88bd('0x3e')](_0x59b68d,_0x1596cd[_0x88bd('0x3f')],_0x461521);_0x2bcd41[_0x88bd('0x40')][_0x435149](_0x458c8c[_0x88bd('0x41')],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x43')],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x44')]);}else{switch(_0x461521[_0x88bd('0xc')]){case'unreadMessages':var _0x272eb1=parseReadParameter(_0x461521[_0x88bd('0x42')]);_0x2bcd41['read'][_0x88bd('0x45')](_0x272eb1);break;case'Contact':if(_0x461521[_0x88bd('0x46')]===_0x88bd('0x47')){if(_0x461521[_0x88bd('0x42')][_0x88bd('0x48')]('\x20')[_0x88bd('0x19')]>0x1){_0x2bcd41[_0x88bd('0x49')][_0x435149](_0x88bd('0x39'),qs[_0x88bd('0x36')](_0x461521['value'],!![]),null);}else{var _0x2a1e9e='%'+_0x461521[_0x88bd('0x42')]+'%';_0x2bcd41['contact'][_0x435149]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2a1e9e,_0x2a1e9e,_0x2a1e9e);}}else{_0x1596cd=_['find'](_0xb37532,[_0x88bd('0xd'),_0x88bd('0x4a')]);_0x461521[_0x88bd('0xc')]=_0x88bd('0x4a');_0x458c8c=as[_0x88bd('0x3e')](_0x59b68d,_0x1596cd[_0x88bd('0x3f')],_0x461521);_0x2bcd41[_0x88bd('0x49')][_0x435149](_0x458c8c[_0x88bd('0x41')],_0x458c8c[_0x88bd('0x42')]['start'],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x44')]);}break;case'Tag':var _0x59a7d0=_0x461521[_0x88bd('0x42')]['split'](',')['map'](function(_0x19e3fe){return Number(_0x19e3fe);});var _0x507b4c=parseTagParameter(_0x59a7d0);_0x2bcd41[_0x88bd('0x4b')][_0x88bd('0x4c')][_0x88bd('0x45')](_0x507b4c);_0x2bcd41[_0x88bd('0x4b')][_0x88bd('0x4d')]=_0x59a7d0;break;case'User':if(_0x461521[_0x88bd('0x46')]===_0x88bd('0x47')){_0x2bcd41['user'][_0x435149](_0x88bd('0x4e'),'%'+_0x461521[_0x88bd('0x42')]+'%',null);}else{_0x1596cd=_[_0x88bd('0x3d')](_0xb37532,['name',_0x88bd('0x4f')]);_0x461521['field']=_0x88bd('0x4f');_0x458c8c=as[_0x88bd('0x3e')](_0x59b68d,_0x1596cd['type'],_0x461521);_0x2bcd41[_0x88bd('0x50')][_0x435149](_0x458c8c[_0x88bd('0x41')],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x43')],_0x458c8c[_0x88bd('0x42')]['end']);}break;case _0x88bd('0x51'):case _0x88bd('0x52'):_0x458c8c=as[_0x88bd('0x3e')]('me',null,_0x461521);_0x2bcd41[_0x88bd('0x51')][_0x435149](_0x458c8c['text'],_0x458c8c[_0x88bd('0x42')]['start'],_0x458c8c[_0x88bd('0x42')][_0x88bd('0x44')]);break;}}}return _0x2bcd41;}function parseModelFields(_0x4e3fc9,_0x999175,_0x1b6cd7){var _0x51a56c=utils[_0x88bd('0x7')](_0x4e3fc9);var _0x352b40=squel[_0x88bd('0x26')]();var _0x116647=_(_0x999175)[_0x88bd('0x53')]()[_0x88bd('0x1c')](function(_0x48b576){return _['some'](_0x1b6cd7,['name',_0x48b576])?_0x48b576:undefined;})['compact']()[_0x88bd('0x42')]();if(_0x116647['length']>0x0){_0x116647[_0x88bd('0x28')](function(_0xc0aeda){if(_0xc0aeda===_0x51a56c){_0x352b40[_0x88bd('0x45')]('i.'+_0x51a56c+_0x88bd('0x1b'),[]['concat'](_0x999175[_0xc0aeda]));}else if(_0xc0aeda==='createdAt'){var _0x49456d=JSON[_0x88bd('0x54')](_0x999175[_0xc0aeda])[_0x88bd('0x55')];var _0x3fdc6b=JSON[_0x88bd('0x54')](_0x999175[_0xc0aeda])[_0x88bd('0x56')];_0x352b40[_0x88bd('0x45')](_0x88bd('0x57'),_0x49456d,_0x3fdc6b);}else{if(_0x999175[_0xc0aeda]===_0x88bd('0x58')){_0x352b40[_0x88bd('0x45')]('i.'+_0xc0aeda+_0x88bd('0x59'));}else{_0x352b40['and']('i.'+_0xc0aeda+_0x88bd('0x5a'),_0x999175[_0xc0aeda]);}}});}return _0x352b40;}function parseQueryParameters(_0x2f26ea,_0x3202e3,_0x4e7f08){var _0x1e80aa=getSqlClauses();return Promise[_0x88bd('0x5b')]()[_0x88bd('0x5c')](function(){return parseModelFields(_0x2f26ea,_0x3202e3,_0x4e7f08);})[_0x88bd('0x5c')](function(_0xa546a8){_0x1e80aa[_0x88bd('0x5d')][_0x88bd('0x45')](_0xa546a8);return parseReadParameter(_0x3202e3[_0x88bd('0x5e')]);})[_0x88bd('0x5c')](function(_0xc25e38){_0x1e80aa[_0x88bd('0x5e')]['and'](_0xc25e38);return parseTagParameter(_0x3202e3['tag']);})[_0x88bd('0x5c')](function(_0x24bb33){_0x1e80aa[_0x88bd('0x4b')][_0x88bd('0x4c')][_0x88bd('0x45')](_0x24bb33);return parseSearchFilter(_0x2f26ea,_0x3202e3['filter']);})[_0x88bd('0x5c')](function(_0x51e67e){_0x1e80aa['filter']=_0x51e67e;return _0x1e80aa;});}function checkAccountsRestrictions(_0xbf6406,_0x10b872,_0x4d682b){var _0x704b76=utils['getAccountFK'](_0xbf6406);var _0xa17eb9=_0x88bd('0x5f')+_[_0x88bd('0x60')](_0xbf6406)+(_0xbf6406===_0x88bd('0x61')?_0x88bd('0x62'):_0x88bd('0x63'));var _0x5f23ba=squel[_0x88bd('0x26')]();return Promise['resolve']()[_0x88bd('0x5c')](function(){if(_0x4d682b[_0x88bd('0xa')]&&_0x10b872[_0x88bd('0x8')]===_0x88bd('0x9')){return _0x10b872[_0xa17eb9]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x5a4182){if(_0x5a4182){if(_0x5a4182[_0x88bd('0x19')]===0x0){_0x5f23ba[_0x88bd('0x45')]('i.'+_0x704b76+_0x88bd('0x59'));}else{_0x5f23ba['and']('i.'+_0x704b76+_0x88bd('0x1b'),_[_0x88bd('0x1c')](_0x5a4182,'id'));}}else if(!_0x4d682b[_0x704b76]){_0x5f23ba[_0x88bd('0x45')]('i.'+_0x704b76+_0x88bd('0x64'));}})['then'](function(){return _0x5f23ba;});}function getClosedOrderClause(_0x45560b,_0x4677af){var _0x5abb44='';var _0x3681cb=['i.thirdDisposition','i.secondDisposition','i.disposition'];if(_0x45560b===_0x88bd('0x33')){_0x3681cb[_0x88bd('0x65')]('i.substatus');}if(_0x4677af['closed']==='0'&&_0x45560b===_0x88bd('0x33')){_0x5abb44='i.substatus';}else{if(_0x4677af[_0x88bd('0x66')]==='1'){_0x3681cb['shift']();}_0x5abb44=_0x88bd('0x67')+_0x3681cb[_0x88bd('0x68')](',\x20')+')';}return _0x5abb44;}function getFilteredInteractions(_0x1d0003,_0x1275e6,_0xd90c1c,_0x1a327a){var _0x17d1ef=utils[_0x88bd('0x11')](_0x1d0003);var _0x10cf60=_[_0x88bd('0x60')](_0x1d0003)+_0x88bd('0x69');var _0xf6ad1=[];var _0x424dd0=getTagsQuery();var _0x25e30f={'type':db[_0x88bd('0x6a')][_0x88bd('0x6b')][_0x88bd('0x6c')],'raw':!![]};var _0x3d9475=[];var _0x136d4f=[];return db[_0x88bd('0x6d')]['query'](_0x424dd0['toString'](),_0x25e30f)[_0x88bd('0x5c')](function(_0x269d35){_0xf6ad1=_['keyBy'](_0x269d35,'id');_0x25e30f=_[_0x88bd('0x6e')](_0x25e30f,{'model':db[_0x10cf60],'mapToModel':!![],'nest':!![]});if(_0xd90c1c['fields']){_0x1a327a['attributes'][_0x88bd('0x28')](function(_0x4c02aa){_0x1275e6[_0x88bd('0xc')]('i.'+_0x4c02aa);});}else{_0x1275e6[_0x88bd('0xc')](_0x88bd('0x6f'),_0x88bd('0x70'));_0x1275e6[_0x88bd('0xc')]('a.key','Account.key');_0x1275e6['field']('a.mandatoryDisposition',_0x88bd('0x71'));if(_0x1d0003===_0x88bd('0x33')){_0x1275e6[_0x88bd('0xc')](_0x88bd('0x72'),_0x88bd('0x73'));_0x1275e6['field'](_0x88bd('0x74'),_0x88bd('0x75'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x76'));_0x1275e6[_0x88bd('0xc')]('i.createdAt');_0x1275e6[_0x88bd('0xc')](_0x88bd('0x77'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x78'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x79'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7a'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7b'));_0x1275e6['field']('i.lastMsgDirection');_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7c'));_0x1275e6['field']('i.disposition');_0x1275e6['field']('i.secondDisposition');_0x1275e6[_0x88bd('0xc')]('i.thirdDisposition');_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7d'));_0x1275e6[_0x88bd('0xc')]('i.to');_0x1275e6[_0x88bd('0xc')]('i.ContactId');_0x1275e6['field'](_0x88bd('0x7e'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x7f'));}else if(_0x1d0003===_0x88bd('0x80')){_0x1275e6['field'](_0x88bd('0x81'),_0x88bd('0x75'));}else{_0x1275e6['field'](_0x88bd('0x82'),_0x88bd('0x75'));}if(_0x1d0003!==_0x88bd('0x33')){_0x1275e6[_0x88bd('0xc')](_0x88bd('0x83'));}_0x1275e6[_0x88bd('0xc')](_0x88bd('0x84'),_0x88bd('0x85'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x86'),_0x88bd('0x87'));_0x1275e6['field'](_0x88bd('0x88'),'Contact.email');_0x1275e6['field'](_0x88bd('0x89'),_0x88bd('0x8a'));_0x1275e6[_0x88bd('0xc')]('c.mobile',_0x88bd('0x8b'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x8c'),'Contact.fax');_0x1275e6[_0x88bd('0xc')]('o.fullname','Owner.fullname');_0x1275e6[_0x88bd('0xc')]('o.internal',_0x88bd('0x8d'));_0x1275e6[_0x88bd('0xc')](_0x88bd('0x8e'),_0x88bd('0x8f'));}if(_0x1a327a['limit']){_0x1275e6[_0x88bd('0x90')](_0x1a327a[_0x88bd('0x90')]);}if(_0x1a327a[_0x88bd('0x91')]){_0x1275e6['offset'](_0x1a327a[_0x88bd('0x91')]);}return db['sequelize'][_0x88bd('0x92')](_0x1275e6[_0x88bd('0x93')](),_0x25e30f);})[_0x88bd('0x5c')](function(_0x13a816){_0x3d9475=_0x13a816;var _0x406216=getUsersQuery(_0x1d0003,_0x3d9475);return db[_0x88bd('0x6d')][_0x88bd('0x92')](_0x406216[_0x88bd('0x93')](),_0x25e30f);})['then'](function(_0x1ffe90){_0x136d4f=_[_0x88bd('0x94')](_0x1ffe90,_0x17d1ef);if(_0x1d0003==='mail'){return db[_0x88bd('0x95')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x88bd('0x5c')](function(_0x1aae94){var _0x142af5=_0x1aae94?_0x1aae94[_0x88bd('0x96')]:undefined;var _0x342c8b=_0x3d9475[_0x88bd('0x1c')](function(_0x1f7735){return updateInteraction(_0x1f7735,_0xf6ad1,_0x136d4f,_0x142af5);});return Promise[_0x88bd('0x97')](_0x342c8b);});}function countFilteredInteractions(_0x479baf,_0x54f0db){var _0x55a200=_0x479baf[_0x88bd('0x98')]();_0x55a200['field']('COUNT(*)');_0x55a200[_0x88bd('0xc')](_0x88bd('0x6f'),'unreadMessages');var _0x1d05a0=utils[_0x88bd('0x27')](_0x54f0db);if(!_[_0x88bd('0x99')](_0x1d05a0)){_0x55a200[_0x88bd('0x1a')](_0x88bd('0x9a'),_0x1d05a0);}var _0x40c670={'type':db[_0x88bd('0x6a')][_0x88bd('0x6b')][_0x88bd('0x6c')],'raw':!![]};return db['sequelize'][_0x88bd('0x92')](_0x55a200[_0x88bd('0x93')](),_0x40c670);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index fc42e15..2c4ed4c 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 _0xe3f2=['waiting','talking','answered','abandoned','disposition','UserId','unmanaged','total','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','updateInteraction','then','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe3f2,0x96));var _0x2e3f=function(_0x3de050,_0x251c28){_0x3de050=_0x3de050-0x0;var _0x3c5cc2=_0xe3f2[_0x3de050];return _0x3c5cc2;};'use strict';var _=require(_0x2e3f('0x0'));var db=require(_0x2e3f('0x1'))['db'];function getInteractionUsers(_0x4b5d24,_0x83df66){return new Promise(function(_0x381dfb,_0x10f4ec){try{var _0x5d3327=[];if(_0x83df66[_0x4b5d24]){_0x5d3327=_0x83df66[_0x4b5d24][_0x2e3f('0x2')](function(_0x2cbeda){return{'id':_0x2cbeda['id'],'fullname':_0x2cbeda[_0x2e3f('0x3')]};});}return _0x381dfb(_0x5d3327);}catch(_0x3c93f8){_0x10f4ec(_0x3c93f8);}});}function getInteractionTags(_0x3a1901,_0x5d684f){var _0x4c75e1=[];if(_0x3a1901){_0x3a1901[_0x2e3f('0x4')](',')[_0x2e3f('0x5')](function(_0x50ede0){_0x4c75e1['push'](_0x5d684f[_0x50ede0]);});}return _0x4c75e1;}function updateWaitingCounter(_0x3b3d36){if(_0x3b3d36[_0x2e3f('0x6')]){_0x3b3d36[_0x2e3f('0x6')]-=0x1;}}function updateInteractionCounters(_0x345f77){_0x345f77[_0x2e3f('0x6')]=0x0;_0x345f77[_0x2e3f('0x7')]=0x0;_0x345f77[_0x2e3f('0x8')]=0x0;_0x345f77['unmanaged']=0x0;_0x345f77[_0x2e3f('0x9')]=0x0;_0x345f77['total']=0x0;if(_0x345f77['closed']){if(_0x345f77[_0x2e3f('0xa')]==='abandoned'){_0x345f77[_0x2e3f('0x9')]+=0x1;updateWaitingCounter(_0x345f77);}if(_0x345f77[_0x2e3f('0xb')]){_0x345f77['answered']+=0x1;if(_0x345f77[_0x2e3f('0x7')]){_0x345f77[_0x2e3f('0x7')]-=0x1;}}else{if(_0x345f77[_0x2e3f('0xa')]){_0x345f77[_0x2e3f('0xc')]+=0x1;updateWaitingCounter(_0x345f77);}}}else{if(!_0x345f77[_0x2e3f('0xb')]){_0x345f77[_0x2e3f('0x6')]+=0x1;}if(_0x345f77[_0x2e3f('0xb')]){_0x345f77[_0x2e3f('0x7')]+=0x1;updateWaitingCounter(_0x345f77);}}_0x345f77[_0x2e3f('0xd')]+=0x1;return _0x345f77;}function getLastMessageText(_0x5b1c14){return db[_0x2e3f('0xe')][_0x2e3f('0xf')]({'where':{'$and':[{'MailInteractionId':_0x5b1c14['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x2e3f('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2e3f('0x11')],'order':'-id','raw':!![]})['then'](function(_0x2f225d){if(_0x2f225d&&_0x2f225d[_0x2e3f('0x11')]){_0x5b1c14[_0x2e3f('0x12')]=_[_0x2e3f('0x13')](_0x2f225d['plainBody']);}return _0x5b1c14;})[_0x2e3f('0x14')](function(_0x3a4c30){throw _0x3a4c30;});}exports[_0x2e3f('0x15')]=function(_0x2e6ca8,_0x4619b9,_0x222d9c,_0xbf3023){return new Promise(function(_0xc5070b,_0x2b50d8){return getInteractionUsers(_0x2e6ca8['id'],_0x222d9c)[_0x2e3f('0x16')](function(_0x16d891){_0x2e6ca8[_0x2e3f('0x17')]=_0x16d891;return getInteractionTags(_0x2e6ca8[_0x2e3f('0x18')],_0x4619b9);})['then'](function(_0x54d6d6){_0x2e6ca8[_0x2e3f('0x19')]=_0x54d6d6;delete _0x2e6ca8[_0x2e3f('0x18')];return updateInteractionCounters(_0x2e6ca8);})[_0x2e3f('0x16')](function(_0x26c45d){if(_0xbf3023){return getLastMessageText(_0x26c45d);}else{return _0x26c45d;}})[_0x2e3f('0x16')](function(_0x462ca8){_0xc5070b(_0x462ca8);})[_0x2e3f('0x14')](function(_0x5f43ca){_0x2b50d8(_0x5f43ca);});});}; \ No newline at end of file +var _0xa809=['talking','unmanaged','total','disposition','abandoned','UserId','findOne','out','plainBody','lastMsgText','updateInteraction','then','Tags','lodash','../../mysqldb','fullname','split','forEach','waiting'];(function(_0x5cbbeb,_0x142ebc){var _0x4cf278=function(_0x1087e8){while(--_0x1087e8){_0x5cbbeb['push'](_0x5cbbeb['shift']());}};_0x4cf278(++_0x142ebc);}(_0xa809,0x1c2));var _0x9a80=function(_0x3ada0a,_0x5e94e9){_0x3ada0a=_0x3ada0a-0x0;var _0x41ffc0=_0xa809[_0x3ada0a];return _0x41ffc0;};'use strict';var _=require(_0x9a80('0x0'));var db=require(_0x9a80('0x1'))['db'];function getInteractionUsers(_0x26319d,_0x305642){return new Promise(function(_0x4068f3,_0xe1ec99){try{var _0x3f9c15=[];if(_0x305642[_0x26319d]){_0x3f9c15=_0x305642[_0x26319d]['map'](function(_0x21666b){return{'id':_0x21666b['id'],'fullname':_0x21666b[_0x9a80('0x2')]};});}return _0x4068f3(_0x3f9c15);}catch(_0x1a2c02){_0xe1ec99(_0x1a2c02);}});}function getInteractionTags(_0x533541,_0x299feb){var _0x12f5e8=[];if(_0x533541){_0x533541[_0x9a80('0x3')](',')[_0x9a80('0x4')](function(_0x1132a9){_0x12f5e8['push'](_0x299feb[_0x1132a9]);});}return _0x12f5e8;}function updateWaitingCounter(_0x85cecb){if(_0x85cecb[_0x9a80('0x5')]){_0x85cecb['waiting']-=0x1;}}function updateInteractionCounters(_0x1497b4){_0x1497b4['waiting']=0x0;_0x1497b4[_0x9a80('0x6')]=0x0;_0x1497b4['answered']=0x0;_0x1497b4[_0x9a80('0x7')]=0x0;_0x1497b4['abandoned']=0x0;_0x1497b4[_0x9a80('0x8')]=0x0;if(_0x1497b4['closed']){if(_0x1497b4[_0x9a80('0x9')]===_0x9a80('0xa')){_0x1497b4[_0x9a80('0xa')]+=0x1;updateWaitingCounter(_0x1497b4);}if(_0x1497b4[_0x9a80('0xb')]){_0x1497b4['answered']+=0x1;if(_0x1497b4[_0x9a80('0x6')]){_0x1497b4[_0x9a80('0x6')]-=0x1;}}else{if(_0x1497b4[_0x9a80('0x9')]){_0x1497b4[_0x9a80('0x7')]+=0x1;updateWaitingCounter(_0x1497b4);}}}else{if(!_0x1497b4[_0x9a80('0xb')]){_0x1497b4[_0x9a80('0x5')]+=0x1;}if(_0x1497b4['UserId']){_0x1497b4[_0x9a80('0x6')]+=0x1;updateWaitingCounter(_0x1497b4);}}_0x1497b4[_0x9a80('0x8')]+=0x1;return _0x1497b4;}function getLastMessageText(_0x543d32){return db['MailMessage'][_0x9a80('0xc')]({'where':{'$and':[{'MailInteractionId':_0x543d32['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9a80('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9a80('0xe')],'order':'-id','raw':!![]})['then'](function(_0x4101fd){if(_0x4101fd&&_0x4101fd[_0x9a80('0xe')]){_0x543d32[_0x9a80('0xf')]=_['trimStart'](_0x4101fd[_0x9a80('0xe')]);}return _0x543d32;})['catch'](function(_0x51a5dc){throw _0x51a5dc;});}exports[_0x9a80('0x10')]=function(_0x1637c2,_0x1e358a,_0xae6c68,_0x5add85){return new Promise(function(_0x5cd4da,_0x3ca0be){return getInteractionUsers(_0x1637c2['id'],_0xae6c68)[_0x9a80('0x11')](function(_0x4f21fd){_0x1637c2['Users']=_0x4f21fd;return getInteractionTags(_0x1637c2['TagIds'],_0x1e358a);})['then'](function(_0x5c97fc){_0x1637c2[_0x9a80('0x12')]=_0x5c97fc;delete _0x1637c2['TagIds'];return updateInteractionCounters(_0x1637c2);})[_0x9a80('0x11')](function(_0x20bc9e){if(_0x5add85){return getLastMessageText(_0x20bc9e);}else{return _0x20bc9e;}})[_0x9a80('0x11')](function(_0x13e608){_0x5cd4da(_0x13e608);})['catch'](function(_0x5d0ff4){_0x3ca0be(_0x5d0ff4);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index e921bd3..b0dc905 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 _0x9bb3=['openchannel-interactions','mail-interactions','../../config/logger','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Website','Account','upperFirst','InteractionId','unknown','chat','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','lodash','../../mysqldb'];(function(_0x128dbf,_0x1065b3){var _0x4f8af3=function(_0xe514f5){while(--_0xe514f5){_0x128dbf['push'](_0x128dbf['shift']());}};_0x4f8af3(++_0x1065b3);}(_0x9bb3,0xad));var _0x39bb=function(_0x44450c,_0x29b113){_0x44450c=_0x44450c-0x0;var _0x2371fd=_0x9bb3[_0x44450c];return _0x2371fd;};'use strict';var _=require(_0x39bb('0x0'));var db=require(_0x39bb('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x39bb('0x2')),'mail':require('../../config/logger')(_0x39bb('0x3')),'fax':require(_0x39bb('0x4'))('fax-interactions'),'sms':require(_0x39bb('0x4'))(_0x39bb('0x5')),'chat':require('../../config/logger')(_0x39bb('0x6')),'whatsapp':require(_0x39bb('0x4'))(_0x39bb('0x7'))};function getAccountFK(_0x1f8f39){return _[_0x39bb('0x8')](_0x1f8f39)+(_0x1f8f39==='chat'?_0x39bb('0x9'):_0x39bb('0xa'))+'Id';}function getInteractionFK(_0x41b6b3){return _['capitalize'](_0x41b6b3)+'InteractionId';}function getInteractionId(_0xa308b7,_0x2c27e9,_0xcacd3a){if(_0xa308b7&&_0xa308b7[_[_0x39bb('0xb')](_0xcacd3a)+_0x39bb('0xc')]){return _0xa308b7[_['upperFirst'](_0xcacd3a)+_0x39bb('0xc')];}else if(_0xa308b7&&_0xa308b7['id']){return _0xa308b7['id'];}else if(_0x2c27e9&&_0x2c27e9['id']){return _0x2c27e9['id'];}else{return _0x39bb('0xd');}}function getInteractionsTables(_0x1459e2){return{'accounts':_0x1459e2+'_'+(_0x1459e2===_0x39bb('0xe')?_0x39bb('0xf'):_0x39bb('0x10')),'interactions':_0x1459e2+_0x39bb('0x11'),'interactionsTags':_0x1459e2+_0x39bb('0x12'),'messages':_0x1459e2+_0x39bb('0x13'),'userInteractions':_0x39bb('0x14')+_0x1459e2+_0x39bb('0x11')};}function getSelectedTags(_0x4651a9){var _0x40bec7=[];if(_0x4651a9){_0x40bec7=Array[_0x39bb('0x15')](_0x4651a9)?_0x4651a9:[_0x4651a9];}return _0x40bec7;}function log(_0x56feca,_0x3bba9d,_0x1fb769,_0x8ae561,_0x2a1e34,_0x53bafc){loggers[_0x2a1e34['toLowerCase']()][_0x56feca](_0x39bb('0x16'),_0x53bafc[_0x39bb('0x17')](),_0x3bba9d?_0x3bba9d['id']:null,_0x3bba9d?_0x3bba9d[_0x39bb('0x18')]:null,_0x3bba9d?_0x3bba9d[_0x39bb('0x19')]:null,getInteractionId(_0x1fb769,_0x8ae561,_0x2a1e34),_0x1fb769?JSON[_0x39bb('0x1a')](_0x1fb769):_0x39bb('0x1b'));}function updateUser(_0x228f32,_0x4159b9,_0x4a6e8e,_0x3d4cd1,_0x270637){db[_[_0x39bb('0xb')](_0x3d4cd1)+_0x39bb('0x1c')][_0x39bb('0x1d')]({'where':{'id':getInteractionId(_0x4159b9,_0x4a6e8e,_0x3d4cd1)}})[_0x39bb('0x1e')](function(_0x5f0a78){if(_0x5f0a78){return _0x5f0a78[_0x39bb('0x1f')]({'UserId':_0x228f32?_0x228f32['id']:null});}})[_0x39bb('0x1e')](function(_0x3f6222){if(_0x3f6222){log(_0x39bb('0x20'),_0x228f32,_0x4159b9,_0x4a6e8e,_0x3d4cd1,_0x270637);}})[_0x39bb('0x21')](function(){log(_0x39bb('0x22'),_0x228f32,_0x4159b9,_0x4a6e8e,_0x3d4cd1,_0x270637);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xbe2e=['_interaction_has_tags','_messages','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','accounts','_interactions'];(function(_0x3f656e,_0x34900b){var _0x2463da=function(_0x19251a){while(--_0x19251a){_0x3f656e['push'](_0x3f656e['shift']());}};_0x2463da(++_0x34900b);}(_0xbe2e,0x121));var _0xebe2=function(_0x5d8404,_0x1a75dd){_0x5d8404=_0x5d8404-0x0;var _0x103479=_0xbe2e[_0x5d8404];return _0x103479;};'use strict';var _=require(_0xebe2('0x0'));var db=require(_0xebe2('0x1'))['db'];var loggers={'openchannel':require(_0xebe2('0x2'))('openchannel-interactions'),'mail':require(_0xebe2('0x2'))(_0xebe2('0x3')),'fax':require(_0xebe2('0x2'))(_0xebe2('0x4')),'sms':require(_0xebe2('0x2'))(_0xebe2('0x5')),'chat':require(_0xebe2('0x2'))(_0xebe2('0x6')),'whatsapp':require(_0xebe2('0x2'))(_0xebe2('0x7'))};function getAccountFK(_0x194e92){return _[_0xebe2('0x8')](_0x194e92)+(_0x194e92===_0xebe2('0x9')?_0xebe2('0xa'):_0xebe2('0xb'))+'Id';}function getInteractionFK(_0x5121dc){return _['capitalize'](_0x5121dc)+_0xebe2('0xc');}function getInteractionId(_0x3b4507,_0x1dfcfa,_0x111b11){if(_0x3b4507&&_0x3b4507[_[_0xebe2('0xd')](_0x111b11)+_0xebe2('0xc')]){return _0x3b4507[_['upperFirst'](_0x111b11)+'InteractionId'];}else if(_0x3b4507&&_0x3b4507['id']){return _0x3b4507['id'];}else if(_0x1dfcfa&&_0x1dfcfa['id']){return _0x1dfcfa['id'];}else{return _0xebe2('0xe');}}function getInteractionsTables(_0x55fc7a){return{'accounts':_0x55fc7a+'_'+(_0x55fc7a===_0xebe2('0x9')?'websites':_0xebe2('0xf')),'interactions':_0x55fc7a+_0xebe2('0x10'),'interactionsTags':_0x55fc7a+_0xebe2('0x11'),'messages':_0x55fc7a+_0xebe2('0x12'),'userInteractions':_0xebe2('0x13')+_0x55fc7a+'_interactions'};}function getSelectedTags(_0x186c2d){var _0x2e6867=[];if(_0x186c2d){_0x2e6867=Array['isArray'](_0x186c2d)?_0x186c2d:[_0x186c2d];}return _0x2e6867;}function log(_0x461457,_0x53ef00,_0xa1b116,_0x12ad62,_0x30bf96,_0x33a79e){loggers[_0x30bf96[_0xebe2('0x14')]()][_0x461457](_0xebe2('0x15'),_0x33a79e[_0xebe2('0x16')](),_0x53ef00?_0x53ef00['id']:null,_0x53ef00?_0x53ef00[_0xebe2('0x17')]:null,_0x53ef00?_0x53ef00[_0xebe2('0x18')]:null,getInteractionId(_0xa1b116,_0x12ad62,_0x30bf96),_0xa1b116?JSON[_0xebe2('0x19')](_0xa1b116):'null');}function updateUser(_0x257736,_0x21b19e,_0x53d0b5,_0x4b1480,_0x4e6462){db[_[_0xebe2('0xd')](_0x4b1480)+_0xebe2('0x1a')][_0xebe2('0x1b')]({'where':{'id':getInteractionId(_0x21b19e,_0x53d0b5,_0x4b1480)}})[_0xebe2('0x1c')](function(_0x216892){if(_0x216892){return _0x216892[_0xebe2('0x1d')]({'UserId':_0x257736?_0x257736['id']:null});}})['then'](function(_0x47d120){if(_0x47d120){log(_0xebe2('0x1e'),_0x257736,_0x21b19e,_0x53d0b5,_0x4b1480,_0x4e6462);}})[_0xebe2('0x1f')](function(){log(_0xebe2('0x20'),_0x257736,_0x21b19e,_0x53d0b5,_0x4b1480,_0x4e6462);});}module[_0xebe2('0x21')]={'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 c2c4f65..7ca6010 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 _0x0f54=['update','utf8','final','hasOwnProperty','use','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','crypto','util','license','data1','split','createDecipher','aes-256-ctr'];(function(_0x47d0c0,_0x5902c7){var _0x2cf339=function(_0x45122b){while(--_0x45122b){_0x47d0c0['push'](_0x47d0c0['shift']());}};_0x2cf339(++_0x5902c7);}(_0x0f54,0x119));var _0x40f5=function(_0x2dfcea,_0x14909b){_0x2dfcea=_0x2dfcea-0x0;var _0x565b8e=_0x0f54[_0x2dfcea];return _0x565b8e;};'use strict';var crypto=require(_0x40f5('0x0'));var util=require(_0x40f5('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x587eac,_0x41df04){if(_0x587eac&&_0x41df04){if(_0x41df04['data1']&&_0x41df04[_0x40f5('0x2')]){var _0x24792d=_0x41df04[_0x40f5('0x3')];var _0x5ac583=_0x41df04[_0x40f5('0x2')];var _0x811a41=_0x24792d[_0x40f5('0x4')]('-')[0x4];var _0x2626da=_0x24792d['split']('-')[0x0];var _0x246035=crypto[_0x40f5('0x5')](_0x40f5('0x6'),util['format']('%s:%s:%s',_0x811a41,_0x24792d,_0x2626da));var _0x22f28c=_0x246035[_0x40f5('0x7')](_0x5ac583,'base64',_0x40f5('0x8'));_0x22f28c+=_0x246035[_0x40f5('0x9')]('utf8');var _0x3df40c=JSON['parse'](_0x22f28c);return _0x3df40c[_0x40f5('0xa')](_0x587eac)?_0x3df40c[_0x587eac]:null;}}return null;}function isLimit(_0xd33fad,_0x429f75,_0x42bcc9,_0x48f396){var _0xf38dc8=_0x429f75;return compose()[_0x40f5('0xb')](function(_0x39bd8d,_0x3ac6c8,_0x35a0d9){return db['License'][_0x40f5('0xc')]({'where':{'id':0x1},'raw':!![]})[_0x40f5('0xd')](function(_0x21b483){var _0x92b24c=getValueFromLicense(_0xd33fad,_0x21b483);return _0x92b24c?_0x92b24c:_0xf38dc8;})['then'](function(_0x4e9509){_0xf38dc8=_0x4e9509;return _0x42bcc9[_0x40f5('0xe')](_0x48f396);})['then'](function(_0xa8deb8){if(_0xa8deb8>=_0xf38dc8){return _0x3ac6c8[_0x40f5('0xf')](0x193)[_0x40f5('0x10')]({'message':util[_0x40f5('0x11')](_0x40f5('0x12'),_0xd33fad)});}_0x35a0d9();})[_0x40f5('0x13')](function(_0x19af4f){_0x35a0d9(_0x19af4f);});});}function isUserLimit(){return isLimit(_0x40f5('0x14'),0x1,db[_0x40f5('0x15')],{'where':{'$or':[{'role':_0x40f5('0x16')},{'role':'user'}]}});}exports[_0x40f5('0x17')]=isUserLimit; \ No newline at end of file +var _0x2ae0=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','update','base64','utf8','final','use','License','findOne','count','status'];(function(_0x48c547,_0x2a17af){var _0x200c3d=function(_0x45d344){while(--_0x45d344){_0x48c547['push'](_0x48c547['shift']());}};_0x200c3d(++_0x2a17af);}(_0x2ae0,0xbd));var _0x02ae=function(_0x1aae64,_0x48ca82){_0x1aae64=_0x1aae64-0x0;var _0x388767=_0x2ae0[_0x1aae64];return _0x388767;};'use strict';var crypto=require(_0x02ae('0x0'));var util=require(_0x02ae('0x1'));var compose=require(_0x02ae('0x2'));var db=require(_0x02ae('0x3'))['db'];var config=require(_0x02ae('0x4'));function getValueFromLicense(_0x1719c6,_0x3ed9ff){if(_0x1719c6&&_0x3ed9ff){if(_0x3ed9ff['data1']&&_0x3ed9ff['license']){var _0x4fffc3=_0x3ed9ff[_0x02ae('0x5')];var _0x414548=_0x3ed9ff[_0x02ae('0x6')];var _0x31a819=_0x4fffc3['split']('-')[0x4];var _0x1f6183=_0x4fffc3['split']('-')[0x0];var _0x2f5055=crypto['createDecipher'](_0x02ae('0x7'),util[_0x02ae('0x8')]('%s:%s:%s',_0x31a819,_0x4fffc3,_0x1f6183));var _0x542671=_0x2f5055[_0x02ae('0x9')](_0x414548,_0x02ae('0xa'),_0x02ae('0xb'));_0x542671+=_0x2f5055[_0x02ae('0xc')]('utf8');var _0x4c05b1=JSON['parse'](_0x542671);return _0x4c05b1['hasOwnProperty'](_0x1719c6)?_0x4c05b1[_0x1719c6]:null;}}return null;}function isLimit(_0x564a34,_0x1b0c14,_0x5b6ddc,_0x361e31){var _0x345bda=_0x1b0c14;return compose()[_0x02ae('0xd')](function(_0x43d271,_0x3986e5,_0x1c2643){return db[_0x02ae('0xe')][_0x02ae('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x266397){var _0x31aa42=getValueFromLicense(_0x564a34,_0x266397);return _0x31aa42?_0x31aa42:_0x345bda;})['then'](function(_0x1c38f7){_0x345bda=_0x1c38f7;return _0x5b6ddc[_0x02ae('0x10')](_0x361e31);})['then'](function(_0x22d9ec){if(_0x22d9ec>=_0x345bda){return _0x3986e5[_0x02ae('0x11')](0x193)['json']({'message':util[_0x02ae('0x8')](_0x02ae('0x12'),_0x564a34)});}_0x1c2643();})[_0x02ae('0x13')](function(_0x3c3780){_0x1c2643(_0x3c3780);});});}function isUserLimit(){return isLimit(_0x02ae('0x14'),0x1,db[_0x02ae('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x02ae('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 506516d..317e9f6 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 _0x40d3=['castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$endsWith','LIKE\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','shift','utcOffset','format','add','hours','seconds','startsWith','[$or]','and','[$and]','replace','split','length','slice','forEach','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','$lte','days','YYYY-MM-DD'];(function(_0x5bc44e,_0x2f6822){var _0x3fd690=function(_0x2c4d9d){while(--_0x2c4d9d){_0x5bc44e['push'](_0x5bc44e['shift']());}};_0x3fd690(++_0x2f6822);}(_0x40d3,0xba));var _0x340d=function(_0x4d5f89,_0x47c4ee){_0x4d5f89=_0x4d5f89-0x0;var _0x509b6e=_0x40d3[_0x4d5f89];return _0x509b6e;};'use strict';var _=require('lodash');var moment=require('moment');exports['parseSearch']=function(_0x759e72){var _0x335900={'conditions':[]};_0x335900['sqlOperator']=_[_0x340d('0x0')](_0x759e72,_0x340d('0x1'))?'or':_0x340d('0x2');var _0x3d25e9=_0x759e72['replace'](_0x340d('0x3'),'')[_0x340d('0x4')](_0x340d('0x1'),'')[_0x340d('0x5')]('||');for(var _0x91b72c=0x0;_0x91b72c<_0x3d25e9[_0x340d('0x6')];_0x91b72c++){var _0x1792f3=_0x3d25e9[_0x91b72c][_0x340d('0x5')](':=');var _0x466a63=_0x1792f3[0x0];var _0x28a466=_0x1792f3[_0x340d('0x7')](0x1);_0x28a466[_0x340d('0x8')](function(_0x350b8b){var _0x4075b7=_0x350b8b['split']('[')['shift']();var _0x337050=_0x350b8b[_0x340d('0x9')](/\[(.*?)\]/g);_0x337050[_0x340d('0x8')](function(_0x239a79){var _0x36e841=_0x239a79[_0x340d('0x5')]('[')[_0x340d('0xa')](function(_0x52208f){return _0x52208f[_0x340d('0xb')](']')>-0x1;})[_0x340d('0xc')](function(_0x58e161){return _0x58e161[_0x340d('0x5')](']')[0x0];})[0x0];_0x335900[_0x340d('0xd')][_0x340d('0xe')]({'field':_0x466a63,'operator':_0x4075b7,'value':_0x36e841});});});}return _0x335900;};exports[_0x340d('0xf')]=function(_0x24f722,_0x243c3e,_0x390dc3){var _0x1d1845={};if(_0x243c3e===_0x340d('0x10')){if(_0x390dc3[_0x340d('0x11')]===_0x340d('0x12')){_0x390dc3[_0x340d('0x11')]=_0x340d('0x13');_0x390dc3[_0x340d('0x14')]+=','+_0x390dc3[_0x340d('0x14')];}else if(_[_0x340d('0x15')]([_0x340d('0x16'),_0x340d('0x17')],_0x390dc3[_0x340d('0x11')])){_0x390dc3['value']=moment(_0x390dc3[_0x340d('0x14')])['add'](0x1,_0x340d('0x18'))['format'](_0x340d('0x19'));}}if(_0x390dc3[_0x340d('0x1a')]){_0x243c3e=_0x390dc3['castTo'];_0x1d1845[_0x340d('0x1b')]=_0x340d('0x1c')+_0x24f722+'.'+_0x390dc3[_0x340d('0x1d')]+_0x340d('0x1e')+_0x390dc3['castTo']+')\x20'+parseOperator(_0x390dc3['operator']);}else{_0x1d1845[_0x340d('0x1b')]=_0x24f722+'.'+_0x390dc3['field']+'\x20'+parseOperator(_0x390dc3[_0x340d('0x11')]);}if(_[_0x340d('0x15')](['$ne',_0x340d('0x1f')],_0x390dc3['operator']))_0x1d1845[_0x340d('0x1b')]='('+_0x1d1845[_0x340d('0x1b')]+'\x20OR\x20'+_0x24f722+'.'+_0x390dc3['field']+_0x340d('0x20');_0x1d1845['value']=parseValue(_0x243c3e,_0x390dc3[_0x340d('0x11')],_0x390dc3[_0x340d('0x14')]);return _0x1d1845;};function parseOperator(_0x2749a4){var _0x953d3f;switch(_0x2749a4){case _0x340d('0x21'):_0x953d3f=_0x340d('0x22');break;case _0x340d('0x1f'):_0x953d3f=_0x340d('0x23');break;case _0x340d('0x12'):_0x953d3f=_0x340d('0x24');break;case _0x340d('0x25'):_0x953d3f=_0x340d('0x26');break;case _0x340d('0x27'):case'$startsWith':case _0x340d('0x28'):_0x953d3f=_0x340d('0x29');break;case'$lt':_0x953d3f='<\x20?';break;case _0x340d('0x16'):_0x953d3f='>\x20?';break;case _0x340d('0x17'):_0x953d3f='<=\x20?';break;case _0x340d('0x2a'):_0x953d3f=_0x340d('0x2b');break;case'$between':_0x953d3f=_0x340d('0x2c');break;}return _0x953d3f;}function parseValue(_0x18e41e,_0x436e35,_0xa523ad){var _0x184086={'start':undefined,'end':undefined};switch(_0x436e35){case _0x340d('0x21'):case _0x340d('0x1f'):_0x184086[_0x340d('0x2d')]=_0xa523ad[_0x340d('0x5')](',');break;case _0x340d('0x27'):_0x184086[_0x340d('0x2d')]='%'+_0xa523ad+'%';break;case _0x340d('0x2e'):_0x184086[_0x340d('0x2d')]=_0xa523ad+'%';break;case _0x340d('0x28'):_0x184086[_0x340d('0x2d')]='%'+_0xa523ad;break;case _0x340d('0x13'):var _0x2aaa4d=_0xa523ad[_0x340d('0x5')](',');var _0xa523ad=_0x2aaa4d[_0x340d('0x2f')]();var _0x317cdb=_0x2aaa4d['pop']();if(_0x18e41e===_0x340d('0x10')){_0xa523ad=moment(_0xa523ad)[_0x340d('0x30')](0x0,!![])[_0x340d('0x31')]();_0x317cdb=moment(_0x317cdb)['utcOffset'](0x0,!![])[_0x340d('0x32')](0x17,_0x340d('0x33'))['add'](0x3b,'minutes')[_0x340d('0x32')](0x3b,_0x340d('0x34'))[_0x340d('0x31')]();}_0x184086={'start':_0xa523ad,'end':_0x317cdb};break;default:_0x184086[_0x340d('0x2d')]=_0xa523ad;break;}return _0x184086;} \ No newline at end of file +var _0xb766=['$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$gte','>=\x20?','$in','start','$startsWith','shift','utcOffset','hours','seconds','moment','sqlOperator','[$or]','and','replace','[$and]','split','slice','match','forEach','filter','indexOf','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb766,0x114));var _0x6b76=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xb766[_0x113a6c];return _0x1ac632;};'use strict';var _=require('lodash');var moment=require(_0x6b76('0x0'));exports['parseSearch']=function(_0x2a6b7d){var _0x53a4d0={'conditions':[]};_0x53a4d0[_0x6b76('0x1')]=_['startsWith'](_0x2a6b7d,_0x6b76('0x2'))?'or':_0x6b76('0x3');var _0x3b85ea=_0x2a6b7d[_0x6b76('0x4')](_0x6b76('0x5'),'')[_0x6b76('0x4')](_0x6b76('0x2'),'')[_0x6b76('0x6')]('||');for(var _0x1c2af1=0x0;_0x1c2af1<_0x3b85ea['length'];_0x1c2af1++){var _0x16539d=_0x3b85ea[_0x1c2af1][_0x6b76('0x6')](':=');var _0x352785=_0x16539d[0x0];var _0x3df5fc=_0x16539d[_0x6b76('0x7')](0x1);_0x3df5fc['forEach'](function(_0x5cf336){var _0x2b7c99=_0x5cf336[_0x6b76('0x6')]('[')['shift']();var _0x55c5f4=_0x5cf336[_0x6b76('0x8')](/\[(.*?)\]/g);_0x55c5f4[_0x6b76('0x9')](function(_0x234f0c){var _0x55f556=_0x234f0c[_0x6b76('0x6')]('[')[_0x6b76('0xa')](function(_0x520ef8){return _0x520ef8[_0x6b76('0xb')](']')>-0x1;})['map'](function(_0x5dc103){return _0x5dc103['split'](']')[0x0];})[0x0];_0x53a4d0['conditions'][_0x6b76('0xc')]({'field':_0x352785,'operator':_0x2b7c99,'value':_0x55f556});});});}return _0x53a4d0;};exports[_0x6b76('0xd')]=function(_0xca414c,_0x1b9bab,_0x197dae){var _0x1e5fcb={};if(_0x1b9bab===_0x6b76('0xe')){if(_0x197dae[_0x6b76('0xf')]==='$eq'){_0x197dae['operator']=_0x6b76('0x10');_0x197dae[_0x6b76('0x11')]+=','+_0x197dae['value'];}else if(_['includes']([_0x6b76('0x12'),_0x6b76('0x13')],_0x197dae[_0x6b76('0xf')])){_0x197dae[_0x6b76('0x11')]=moment(_0x197dae['value'])[_0x6b76('0x14')](0x1,_0x6b76('0x15'))[_0x6b76('0x16')](_0x6b76('0x17'));}}if(_0x197dae[_0x6b76('0x18')]){_0x1b9bab=_0x197dae[_0x6b76('0x18')];_0x1e5fcb[_0x6b76('0x19')]=_0x6b76('0x1a')+_0xca414c+'.'+_0x197dae[_0x6b76('0x1b')]+_0x6b76('0x1c')+_0x197dae[_0x6b76('0x18')]+')\x20'+parseOperator(_0x197dae[_0x6b76('0xf')]);}else{_0x1e5fcb['text']=_0xca414c+'.'+_0x197dae['field']+'\x20'+parseOperator(_0x197dae[_0x6b76('0xf')]);}if(_['includes']([_0x6b76('0x1d'),_0x6b76('0x1e')],_0x197dae['operator']))_0x1e5fcb[_0x6b76('0x19')]='('+_0x1e5fcb[_0x6b76('0x19')]+_0x6b76('0x1f')+_0xca414c+'.'+_0x197dae['field']+'\x20IS\x20NULL)';_0x1e5fcb[_0x6b76('0x11')]=parseValue(_0x1b9bab,_0x197dae['operator'],_0x197dae['value']);return _0x1e5fcb;};function parseOperator(_0x27e7e1){var _0x51cf8d;switch(_0x27e7e1){case'$in':_0x51cf8d=_0x6b76('0x20');break;case _0x6b76('0x1e'):_0x51cf8d=_0x6b76('0x21');break;case _0x6b76('0x22'):_0x51cf8d=_0x6b76('0x23');break;case _0x6b76('0x1d'):_0x51cf8d=_0x6b76('0x24');break;case _0x6b76('0x25'):case'$startsWith':case _0x6b76('0x26'):_0x51cf8d=_0x6b76('0x27');break;case'$lt':_0x51cf8d=_0x6b76('0x28');break;case _0x6b76('0x12'):_0x51cf8d=_0x6b76('0x29');break;case _0x6b76('0x13'):_0x51cf8d='<=\x20?';break;case _0x6b76('0x2a'):_0x51cf8d=_0x6b76('0x2b');break;case _0x6b76('0x10'):_0x51cf8d='BETWEEN\x20?\x20AND\x20?';break;}return _0x51cf8d;}function parseValue(_0xb7b4fa,_0x20a08e,_0x110642){var _0xeb1fe={'start':undefined,'end':undefined};switch(_0x20a08e){case _0x6b76('0x2c'):case _0x6b76('0x1e'):_0xeb1fe['start']=_0x110642['split'](',');break;case'$substring':_0xeb1fe[_0x6b76('0x2d')]='%'+_0x110642+'%';break;case _0x6b76('0x2e'):_0xeb1fe[_0x6b76('0x2d')]=_0x110642+'%';break;case'$endsWith':_0xeb1fe[_0x6b76('0x2d')]='%'+_0x110642;break;case'$between':var _0x1ae698=_0x110642[_0x6b76('0x6')](',');var _0x110642=_0x1ae698[_0x6b76('0x2f')]();var _0x16615a=_0x1ae698['pop']();if(_0xb7b4fa===_0x6b76('0xe')){_0x110642=moment(_0x110642)[_0x6b76('0x30')](0x0,!![])[_0x6b76('0x16')]();_0x16615a=moment(_0x16615a)[_0x6b76('0x30')](0x0,!![])[_0x6b76('0x14')](0x17,_0x6b76('0x31'))[_0x6b76('0x14')](0x3b,'minutes')['add'](0x3b,_0x6b76('0x32'))[_0x6b76('0x16')]();}_0xeb1fe={'start':_0x110642,'end':_0x16615a};break;default:_0xeb1fe[_0x6b76('0x2d')]=_0x110642;break;}return _0xeb1fe;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index e9388f0..17176c8 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 _0x4784=['isString','hasOwnProperty','match','isEmail','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','map','name','intersection','model','attributes','nolimit','limit','where','filters','pick','filter','object','columns','value','merge','VIRTUAL','lower','lodash','sequelize','moment','keys','includes','parse','fields','split','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','uniqueid','isArray','offset','sort','cast','col','substr','DESC','priority','unsigned','ASC','omit','isEmpty','length','isObject'];(function(_0x4a423e,_0x59ba7b){var _0x4ad91f=function(_0x55e261){while(--_0x55e261){_0x4a423e['push'](_0x4a423e['shift']());}};_0x4ad91f(++_0x59ba7b);}(_0x4784,0x14f));var _0x4478=function(_0x3f109a,_0x249aa9){_0x3f109a=_0x3f109a-0x0;var _0x2fc2cf=_0x4784[_0x3f109a];return _0x2fc2cf;};'use strict';var _=require(_0x4478('0x0'));var sequelize=require(_0x4478('0x1'));var moment=require(_0x4478('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x580266){var _0xc6ca8=['ne'];try{var _0x3bba38=JSON['parse'](_0x580266);var _0x5405f6=Object[_0x4478('0x3')](_0x3bba38)[0x0];return _0xc6ca8[_0x4478('0x4')](_0x5405f6);}catch(_0x1dba2e){return![];}}function getOperatorValue(_0x4efcbf){var _0x5757a8=JSON[_0x4478('0x5')](_0x4efcbf);var _0x7181c4=Object['keys'](_0x5757a8)[0x0];var _0x1fcfb5=_0x5757a8[_0x7181c4];return{['$'+_0x7181c4]:_0x1fcfb5};}exports[_0x4478('0x6')]=function(_0xbd6318){var _0x46664d=null;if(_0xbd6318){_0x46664d=_0xbd6318[_0x4478('0x7')](',');}return _0x46664d;};exports['filters']=function(_0x163613,_0x35a50f){var _0x8a9d3c={};if(!_['isEmpty'](_0x163613)){_[_0x4478('0x8')](_0x163613,function(_0x43c132,_0x435168){try{if(_0x35a50f){var _0x47ae92=_[_0x4478('0x9')](_0x35a50f,{'name':_0x435168})||{};if(hasSequelizeOperator(_0x43c132)){_0x8a9d3c[_0x435168]=getOperatorValue(_0x43c132);}else if(_0x47ae92[_0x4478('0xa')]==='DATE'&&_[_0x4478('0xb')](_0x43c132)){var _0x587e6d=JSON[_0x4478('0x5')](_0x43c132);var _0x2b5922={'$gte':moment(moment(_0x587e6d[_0x4478('0xc')])[_0x4478('0xd')](_0x4478('0xe')))[_0x4478('0xf')]()[_0x4478('0xd')](),'$lte':moment(moment(_0x587e6d['$lte'])[_0x4478('0xd')](_0x4478('0xe')))[_0x4478('0xf')]()['subtract'](0x1,'s')[_0x4478('0xd')]()};_0x8a9d3c[_0x435168]=_0x2b5922;}else if(_0x47ae92['name']===_0x4478('0x10')){_0x8a9d3c[_0x435168]=_0x43c132;}else{_0x8a9d3c[_0x435168]=_['isArray'](_0x43c132)?_0x43c132:JSON[_0x4478('0x5')](_0x43c132);}}else{_0x8a9d3c[_0x435168]=_[_0x4478('0x11')](_0x43c132)?_0x43c132:JSON[_0x4478('0x5')](_0x43c132);}}catch(_0x2b1701){_0x8a9d3c[_0x435168]=_0x43c132['split'](',');}});}return _0x8a9d3c;};exports['limit']=function(_0x5ec358){_0x5ec358=parseInt(_0x5ec358,0xa);if(!_0x5ec358||_0x5ec358<0x0){_0x5ec358=LIMIT_VALUE;}return _0x5ec358;};exports[_0x4478('0x12')]=function(_0xdfb751){_0xdfb751=parseInt(_0xdfb751,0xa);if(!_0xdfb751||_0xdfb751<0x0){_0xdfb751=0x0;}return _0xdfb751;};exports[_0x4478('0x13')]=function(_0x570309){var _0x1b2bd3,_0x187c2c=null;if(_0x570309){_0x1b2bd3=_0x570309[_0x4478('0x7')](',');_0x187c2c=_['map'](_0x1b2bd3,function(_0x1b5a36){if(_0x1b5a36['indexOf']('-')===0x0){return[_0x1b5a36==='priority'?sequelize[_0x4478('0x14')](sequelize[_0x4478('0x15')]('priority'),'unsigned'):_0x1b5a36[_0x4478('0x16')](0x1),_0x4478('0x17')];}else{return[_0x1b5a36===_0x4478('0x18')?sequelize[_0x4478('0x14')](sequelize[_0x4478('0x15')]('priority'),_0x4478('0x19')):_0x1b5a36,_0x4478('0x1a')];}});}return _0x187c2c;};exports[_0x4478('0x1b')]=function(_0x17fc8,_0x1898e5){if(_[_0x4478('0x1c')](_0x17fc8)){return _0x17fc8;}if(_[_0x4478('0x11')](_0x17fc8)){for(var _0x4840f0=0x0;_0x4840f0<_0x17fc8[_0x4478('0x1d')];_0x4840f0+=0x1){_0x17fc8[_0x4840f0]=this[_0x4478('0x1b')](_0x17fc8[_0x4840f0],_0x1898e5);}return _0x17fc8;}if(!_[_0x4478('0x1e')](_0x17fc8)){return _0x17fc8;}if(_[_0x4478('0x1f')](_0x1898e5)){_0x1898e5=[_0x1898e5];}if(!_['isArray'](_0x1898e5)){return _0x17fc8;}for(var _0xce0ccd=0x0;_0xce0ccd<_0x1898e5[_0x4478('0x1d')];_0xce0ccd+=0x1){_['unset'](_0x17fc8,_0x1898e5[_0xce0ccd]);}for(var _0x397a0f in _0x17fc8){if(_0x17fc8[_0x4478('0x20')](_0x397a0f)){_0x17fc8[_0x397a0f]=this['omit'](_0x17fc8[_0x397a0f],_0x1898e5);}}return _0x17fc8;};exports['isNumeric']=function(_0x5d1196){return _0x5d1196[_0x4478('0x21')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x4478('0x22')]=function(_0x25dcc0){return _0x25dcc0[_0x4478('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x1bbfb3,_0x2acbe6){var _0x27de64=[];var _0x162523=/[ `!@#$%^&*()_\-?~]/;var _0x380105=_0x2acbe6?_0x4478('0x23'):_0x4478('0x24');_0x1bbfb3[_0x4478('0x7')](/[ ,]+/)[_0x4478('0x25')](function(_0x394eca){_0x394eca=_0x394eca[_0x4478('0x26')](/([^:]")"+/g,'$1');_0x394eca='+'+_0x394eca+'*';var _0x355e0e=_0x394eca[_0x4478('0x21')](_0x162523);if(_0x355e0e){_0x394eca='\x22'+_0x394eca+'\x22';}_0x27de64[_0x4478('0x27')](_0x394eca);});_0x380105=_0x380105[_0x4478('0x26')](_0x4478('0x24'),_0x27de64[_0x4478('0x28')]('\x20'));return _0x380105;};exports[_0x4478('0x29')]=function(_0x1ac6d9,_0x481a0d,_0x16f8a9){var _0x57a03b={},_0x256368={};if(_0x481a0d[_0x4478('0x2a')][_0x4478('0x2b')]){_0x481a0d[_0x4478('0x2a')]['id']=_0x481a0d[_0x4478('0x2a')][_0x4478('0x2b')];delete _0x481a0d[_0x4478('0x2a')]['$id'];}_0x57a03b['model']=_[_0x4478('0x2c')](_0x1ac6d9,_0x4478('0x2d'));_0x57a03b[_0x4478('0x2a')]=_[_0x4478('0x3')](_0x481a0d['query']);_0x57a03b['filters']=_[_0x4478('0x2e')](_0x57a03b[_0x4478('0x2f')],_0x57a03b[_0x4478('0x2a')]);_0x256368['attributes']=_[_0x4478('0x2e')](_0x57a03b[_0x4478('0x2f')],this['fields'](_0x481a0d[_0x4478('0x2a')][_0x4478('0x6')]));_0x256368[_0x4478('0x30')]=_0x256368[_0x4478('0x30')][_0x4478('0x1d')]?_0x256368[_0x4478('0x30')]:_0x57a03b[_0x4478('0x2f')];if(!_0x481a0d[_0x4478('0x2a')][_0x4478('0x20')](_0x4478('0x31'))){_0x256368['limit']=this[_0x4478('0x32')](_0x481a0d[_0x4478('0x2a')][_0x4478('0x32')]);_0x256368[_0x4478('0x12')]=this[_0x4478('0x12')](_0x481a0d['query'][_0x4478('0x12')]);}_0x256368['order']=this[_0x4478('0x13')](_0x481a0d['query'][_0x4478('0x13')]);_0x256368[_0x4478('0x33')]=this[_0x4478('0x34')](_[_0x4478('0x35')](_0x481a0d[_0x4478('0x2a')],_0x57a03b[_0x4478('0x34')]),_0x1ac6d9);if(_0x481a0d[_0x4478('0x2a')][_0x4478('0x36')]){var _0x4daf06=_0x1ac6d9;var _0x4ffb7b=_0x481a0d[_0x4478('0x2a')]['filter'];if(typeof _0x4ffb7b===_0x4478('0x37')){_0x4daf06=_[_0x4478('0x36')](_0x1ac6d9,function(_0x3bf140){return _[_0x4478('0x4')](_0x4ffb7b[_0x4478('0x38')],_0x3bf140['name']);});_0x4ffb7b=_0x4ffb7b[_0x4478('0x39')];}_0x256368[_0x4478('0x33')]=_[_0x4478('0x3a')](_0x256368[_0x4478('0x33')],{'$or':_['map'](_0x4daf06,function(_0x4b596d){if(_0x4b596d['type']!==_0x4478('0x3b')){if(_0x16f8a9){return sequelize[_0x4478('0x33')](sequelize['fn'](_0x4478('0x3c'),sequelize[_0x4478('0x15')](_0x4b596d['name'])),{'$like':sequelize['fn']('lower','%'+_0x481a0d['query'][_0x4478('0x36')]+'%')});}else{var _0x6fb0f4={};_0x6fb0f4[_0x4b596d['name']]={'$like':'%'+_0x481a0d['query'][_0x4478('0x36')]+'%'};return _0x6fb0f4;}}})});}_0x256368=_[_0x4478('0x3a')]({},_0x256368,_0x481a0d['options']);return _0x256368;}; \ No newline at end of file +var _0x0000=['sequelize','parse','keys','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','cast','DESC','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','\x22{EXPR}\x22','forEach','replace','push','{EXPR}','join','getOptions','query','$id','model','intersection','attributes','fields','order','where','pick','filter','object','includes','columns','value','merge','VIRTUAL','lower','lodash'];(function(_0x34eeca,_0x341ab3){var _0x3ecb26=function(_0xece073){while(--_0xece073){_0x34eeca['push'](_0x34eeca['shift']());}};_0x3ecb26(++_0x341ab3);}(_0x0000,0x130));var _0x0000=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0000[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0000('0x0'));var sequelize=require(_0x0000('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f1f59){var _0xb98eed=['ne'];try{var _0x176bbb=JSON['parse'](_0x1f1f59);var _0x33ba37=Object['keys'](_0x176bbb)[0x0];return _0xb98eed['includes'](_0x33ba37);}catch(_0x3fc37b){return![];}}function getOperatorValue(_0x498b0e){var _0x143957=JSON[_0x0000('0x2')](_0x498b0e);var _0x113fef=Object[_0x0000('0x3')](_0x143957)[0x0];var _0x20b235=_0x143957[_0x113fef];return{['$'+_0x113fef]:_0x20b235};}exports['fields']=function(_0x17d832){var _0x420e8b=null;if(_0x17d832){_0x420e8b=_0x17d832[_0x0000('0x4')](',');}return _0x420e8b;};exports[_0x0000('0x5')]=function(_0x4f707e,_0x46c859){var _0x4f08ac={};if(!_[_0x0000('0x6')](_0x4f707e)){_[_0x0000('0x7')](_0x4f707e,function(_0x92adc0,_0x2e6c17){try{if(_0x46c859){var _0x2bfe3d=_[_0x0000('0x8')](_0x46c859,{'name':_0x2e6c17})||{};if(hasSequelizeOperator(_0x92adc0)){_0x4f08ac[_0x2e6c17]=getOperatorValue(_0x92adc0);}else if(_0x2bfe3d[_0x0000('0x9')]===_0x0000('0xa')&&_['isPlainObject'](_0x92adc0)){var _0x1512f7=JSON[_0x0000('0x2')](_0x92adc0);var _0x35e9c2={'$gte':moment(moment(_0x1512f7[_0x0000('0xb')])[_0x0000('0xc')](_0x0000('0xd')))[_0x0000('0xe')]()[_0x0000('0xc')](),'$lte':moment(moment(_0x1512f7['$lte'])[_0x0000('0xc')]('YYYY-MM-DD'))[_0x0000('0xe')]()[_0x0000('0xf')](0x1,'s')[_0x0000('0xc')]()};_0x4f08ac[_0x2e6c17]=_0x35e9c2;}else if(_0x2bfe3d[_0x0000('0x10')]===_0x0000('0x11')){_0x4f08ac[_0x2e6c17]=_0x92adc0;}else{_0x4f08ac[_0x2e6c17]=_['isArray'](_0x92adc0)?_0x92adc0:JSON[_0x0000('0x2')](_0x92adc0);}}else{_0x4f08ac[_0x2e6c17]=_[_0x0000('0x12')](_0x92adc0)?_0x92adc0:JSON[_0x0000('0x2')](_0x92adc0);}}catch(_0x4f0c11){_0x4f08ac[_0x2e6c17]=_0x92adc0[_0x0000('0x4')](',');}});}return _0x4f08ac;};exports[_0x0000('0x13')]=function(_0x868c16){_0x868c16=parseInt(_0x868c16,0xa);if(!_0x868c16||_0x868c16<0x0){_0x868c16=LIMIT_VALUE;}return _0x868c16;};exports[_0x0000('0x14')]=function(_0x2ff88a){_0x2ff88a=parseInt(_0x2ff88a,0xa);if(!_0x2ff88a||_0x2ff88a<0x0){_0x2ff88a=0x0;}return _0x2ff88a;};exports[_0x0000('0x15')]=function(_0x409206){var _0x4af023,_0x449d2c=null;if(_0x409206){_0x4af023=_0x409206['split'](',');_0x449d2c=_[_0x0000('0x16')](_0x4af023,function(_0x5e56cb){if(_0x5e56cb['indexOf']('-')===0x0){return[_0x5e56cb===_0x0000('0x17')?sequelize[_0x0000('0x18')](sequelize['col']('priority'),'unsigned'):_0x5e56cb['substr'](0x1),_0x0000('0x19')];}else{return[_0x5e56cb===_0x0000('0x17')?sequelize[_0x0000('0x18')](sequelize[_0x0000('0x1a')](_0x0000('0x17')),'unsigned'):_0x5e56cb,_0x0000('0x1b')];}});}return _0x449d2c;};exports[_0x0000('0x1c')]=function(_0x5ee02e,_0x5afbb0){if(_[_0x0000('0x6')](_0x5ee02e)){return _0x5ee02e;}if(_[_0x0000('0x12')](_0x5ee02e)){for(var _0x21aa48=0x0;_0x21aa48<_0x5ee02e[_0x0000('0x1d')];_0x21aa48+=0x1){_0x5ee02e[_0x21aa48]=this[_0x0000('0x1c')](_0x5ee02e[_0x21aa48],_0x5afbb0);}return _0x5ee02e;}if(!_[_0x0000('0x1e')](_0x5ee02e)){return _0x5ee02e;}if(_[_0x0000('0x1f')](_0x5afbb0)){_0x5afbb0=[_0x5afbb0];}if(!_[_0x0000('0x12')](_0x5afbb0)){return _0x5ee02e;}for(var _0x19b639=0x0;_0x19b639<_0x5afbb0['length'];_0x19b639+=0x1){_[_0x0000('0x20')](_0x5ee02e,_0x5afbb0[_0x19b639]);}for(var _0x4618cb in _0x5ee02e){if(_0x5ee02e[_0x0000('0x21')](_0x4618cb)){_0x5ee02e[_0x4618cb]=this[_0x0000('0x1c')](_0x5ee02e[_0x4618cb],_0x5afbb0);}}return _0x5ee02e;};exports[_0x0000('0x22')]=function(_0x240cbf){return _0x240cbf[_0x0000('0x23')](RegExp(_0x0000('0x24')))?!![]:![];};exports['isEmail']=function(_0x450c77){return _0x450c77['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x593005,_0x364419){var _0x48d872=[];var _0x1b4b30=/[ `!@#$%^&*()_\-?~]/;var _0x4ebaf5=_0x364419?_0x0000('0x25'):'{EXPR}';_0x593005[_0x0000('0x4')](/[ ,]+/)[_0x0000('0x26')](function(_0x65f6bc){_0x65f6bc=_0x65f6bc[_0x0000('0x27')](/([^:]")"+/g,'$1');_0x65f6bc='+'+_0x65f6bc+'*';var _0x5eca69=_0x65f6bc[_0x0000('0x23')](_0x1b4b30);if(_0x5eca69){_0x65f6bc='\x22'+_0x65f6bc+'\x22';}_0x48d872[_0x0000('0x28')](_0x65f6bc);});_0x4ebaf5=_0x4ebaf5[_0x0000('0x27')](_0x0000('0x29'),_0x48d872[_0x0000('0x2a')]('\x20'));return _0x4ebaf5;};exports[_0x0000('0x2b')]=function(_0x134547,_0x539f4f,_0x519c44){var _0x127a70={},_0x5100de={};if(_0x539f4f[_0x0000('0x2c')]['$id']){_0x539f4f[_0x0000('0x2c')]['id']=_0x539f4f[_0x0000('0x2c')]['$id'];delete _0x539f4f[_0x0000('0x2c')][_0x0000('0x2d')];}_0x127a70[_0x0000('0x2e')]=_[_0x0000('0x16')](_0x134547,_0x0000('0x10'));_0x127a70[_0x0000('0x2c')]=_[_0x0000('0x3')](_0x539f4f['query']);_0x127a70[_0x0000('0x5')]=_[_0x0000('0x2f')](_0x127a70[_0x0000('0x2e')],_0x127a70[_0x0000('0x2c')]);_0x5100de[_0x0000('0x30')]=_[_0x0000('0x2f')](_0x127a70[_0x0000('0x2e')],this[_0x0000('0x31')](_0x539f4f[_0x0000('0x2c')][_0x0000('0x31')]));_0x5100de[_0x0000('0x30')]=_0x5100de[_0x0000('0x30')]['length']?_0x5100de[_0x0000('0x30')]:_0x127a70['model'];if(!_0x539f4f[_0x0000('0x2c')][_0x0000('0x21')]('nolimit')){_0x5100de[_0x0000('0x13')]=this[_0x0000('0x13')](_0x539f4f[_0x0000('0x2c')][_0x0000('0x13')]);_0x5100de[_0x0000('0x14')]=this[_0x0000('0x14')](_0x539f4f[_0x0000('0x2c')][_0x0000('0x14')]);}_0x5100de[_0x0000('0x32')]=this[_0x0000('0x15')](_0x539f4f[_0x0000('0x2c')]['sort']);_0x5100de[_0x0000('0x33')]=this[_0x0000('0x5')](_[_0x0000('0x34')](_0x539f4f[_0x0000('0x2c')],_0x127a70[_0x0000('0x5')]),_0x134547);if(_0x539f4f['query'][_0x0000('0x35')]){var _0x5be2d9=_0x134547;var _0x156247=_0x539f4f['query']['filter'];if(typeof _0x156247===_0x0000('0x36')){_0x5be2d9=_['filter'](_0x134547,function(_0x482b83){return _[_0x0000('0x37')](_0x156247[_0x0000('0x38')],_0x482b83[_0x0000('0x10')]);});_0x156247=_0x156247[_0x0000('0x39')];}_0x5100de[_0x0000('0x33')]=_[_0x0000('0x3a')](_0x5100de[_0x0000('0x33')],{'$or':_[_0x0000('0x16')](_0x5be2d9,function(_0x11b011){if(_0x11b011[_0x0000('0x9')]!==_0x0000('0x3b')){if(_0x519c44){return sequelize[_0x0000('0x33')](sequelize['fn'](_0x0000('0x3c'),sequelize[_0x0000('0x1a')](_0x11b011[_0x0000('0x10')])),{'$like':sequelize['fn'](_0x0000('0x3c'),'%'+_0x539f4f[_0x0000('0x2c')]['filter']+'%')});}else{var _0x55c097={};_0x55c097[_0x11b011[_0x0000('0x10')]]={'$like':'%'+_0x539f4f[_0x0000('0x2c')]['filter']+'%'};return _0x55c097;}}})});}_0x5100de=_[_0x0000('0x3a')]({},_0x5100de,_0x539f4f['options']);return _0x5100de;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index f2d3370..3ad58af 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 _0xef4c=['find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','ASC','getUpdatedSortOptions','fullname','internal','substring','indexOf','DESC','pauseType','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','openchannelPause','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','smsStatus','chatStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','filterAgentAttributes','jayson/promise','client','http','chatPause','faxPause','mailPause','voicePause','whatsappPause','every','filter','length','idle','unknown','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','busy','getAgentStatus','Queue','map','findOne','getAgents','uniq','value','getAgentIdsByQueues','includes','User','findAll','name','smsPause'];(function(_0x368041,_0x317246){var _0x3c6acb=function(_0x2e589d){while(--_0x2e589d){_0x368041['push'](_0x368041['shift']());}};_0x3c6acb(++_0x317246);}(_0xef4c,0x1ee));var _0xcef4=function(_0x312dbd,_0xbb68ca){_0x312dbd=_0x312dbd-0x0;var _0x1d338e=_0xef4c[_0x312dbd];return _0x1d338e;};'use strict';var _=require('lodash');var jayson=require(_0xcef4('0x0'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xcef4('0x1')][_0xcef4('0x2')]({'port':0x232a});var routingClient=jayson[_0xcef4('0x1')][_0xcef4('0x2')]({'port':0x232c});function isAgentPaused(_0x26a6df,_0x515352){var _0x14a833=[_0x26a6df[_0xcef4('0x3')],_0x26a6df[_0xcef4('0x4')],_0x26a6df[_0xcef4('0x5')],_0x26a6df['openchannelPause'],_0x26a6df['smsPause'],_0x26a6df[_0xcef4('0x6')],_0x26a6df[_0xcef4('0x7')]];if(!_0x515352)return _[_0xcef4('0x8')](_0x14a833);var _0x3c356f=_[_0xcef4('0x9')](_0x14a833);return _0x3c356f[_0xcef4('0xa')]>0x0&&_0x3c356f[_0xcef4('0xa')]<_0x14a833[_0xcef4('0xa')]?!![]:![];}function isIdle(_0x235e9b){return _0x235e9b===_0xcef4('0xb')||_0x235e9b===_0xcef4('0xc')||_0x235e9b==='unavailable'||_0x235e9b===_0xcef4('0xd')||_[_0xcef4('0xe')](_0x235e9b);}function isAgentIdle(_0x5c560b){if(_0x5c560b[_0xcef4('0xf')]!==_0xcef4('0xb')&&_0x5c560b[_0xcef4('0x6')]){_0x5c560b[_0xcef4('0xf')]=_0xcef4('0x10');return![];}return _[_0xcef4('0x8')]([_0x5c560b[_0xcef4('0x11')],_0x5c560b[_0xcef4('0x12')],_0x5c560b[_0xcef4('0x13')],_0x5c560b[_0xcef4('0x14')],_0x5c560b['smsStatus'],_0x5c560b[_0xcef4('0xf')],_0x5c560b[_0xcef4('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xcef4('0x16')]('Agents',{})[_0xcef4('0x17')](function(_0xa1ad76){if(_0xa1ad76[_0xcef4('0x18')]){throw new Error(_0xcef4('0x19'));}var _0x3beea6=_0xa1ad76['result'];return routingClient['request'](_0xcef4('0x1a'),{})[_0xcef4('0x17')](function(_0x79516d){if(_0x79516d['error']){throw new Error(_0xcef4('0x1b'));}var _0x51b08d=_0x79516d[_0xcef4('0x1c')];return _[_0xcef4('0x1d')]({},_0x3beea6,_0x51b08d);});})[_0xcef4('0x1e')](function(_0x23b7b0){throw _0x23b7b0;});}exports[_0xcef4('0x1f')]=getRealtimeAgents;function getAgentStatus(_0x22ca0a){var _0x87fde2=_0xcef4('0xc');if(isAgentPaused(_0x22ca0a))_0x87fde2=_0xcef4('0x10');else if(isAgentPaused(_0x22ca0a,!![]))_0x87fde2='*pause';else if(isAgentIdle(_0x22ca0a))_0x87fde2=_0xcef4('0xb');else _0x87fde2=_0xcef4('0x20');return _0x87fde2;}exports[_0xcef4('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x524512,_0x3017e5){var _0x1d6918=_['isArray'](_0x524512)?_0x524512:[_0x524512];var _0x36f7d4=_['startCase'](_0x3017e5)+_0xcef4('0x22');var _0x5842d8=_[_0xcef4('0x23')](_0x1d6918,function(_0x591eaa){return db[_0x36f7d4][_0xcef4('0x24')]({'where':{'id':_0x591eaa}})[_0xcef4('0x17')](function(_0x45f589){if(!_0x45f589)return[];return _0x45f589[_0xcef4('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x5842d8)[_0xcef4('0x17')](function(_0x153733){var _0x1514f6=_(_0x153733)['flatten']()[_0xcef4('0x23')]('id')[_0xcef4('0x26')]()[_0xcef4('0x27')]();return _0x1514f6;});}exports[_0xcef4('0x28')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x575a7c,_0x360043,_0x5b3159){try{if(_0x360043[_0xcef4('0xa')]>0x0){_0x575a7c=_0x575a7c['filter'](function(_0x4b6fb9){return _0x360043[_0xcef4('0x29')](_0x4b6fb9['id']);});}var _0x2e5c5c=_0x575a7c[_0xcef4('0x9')](function(_0x9f550){var _0x177070=_0xcef4('0x20');if(isAgentIdle(_0x9f550)){_0x177070=_0xcef4('0xb');}return _0x177070===_0x5b3159;});return _[_0xcef4('0x23')](_0x2e5c5c,'id');}catch(_0x28f7ed){throw _0x28f7ed;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x2310b7,_0x41fc8e,_0x28691b){return Promise['resolve']()[_0xcef4('0x17')](function(){if(_0x41fc8e[_0xcef4('0xa')]>0x0){_0x2310b7=_0x2310b7[_0xcef4('0x9')](function(_0x10ff91){return _0x41fc8e[_0xcef4('0x29')](_0x10ff91['id']);});}return _0x2310b7;})[_0xcef4('0x17')](function(){return db[_0xcef4('0x2a')][_0xcef4('0x2b')]({'attributes':['id',_0xcef4('0x2c'),'fullname','chatPause',_0xcef4('0x4'),_0xcef4('0x5'),'openchannelPause',_0xcef4('0x2d'),_0xcef4('0x6'),'whatsappPause','pauseType'],'where':{'id':{'$in':_['map'](_0x2310b7,'id')}},'raw':!![]});})['then'](function(_0x2aabf4){return _0x2aabf4[_0xcef4('0x23')](function(_0x193e86){var _0x181517=_[_0xcef4('0x2e')](_0x2310b7,['id',_0x193e86['id']]);var _0x2727fc=filterAgentAttributes(_0x181517);_['merge'](_0x193e86,_0x2727fc);_0x193e86[_0xcef4('0x2f')]=getAgentStatus(_0x193e86);return _0x193e86;});})['then'](function(_0xe322b1){var _0x59e10f=sortAgentsByStatus(_0xe322b1,_0x28691b);return _[_0xcef4('0x23')](_0x59e10f,'id');})[_0xcef4('0x1e')](function(_0x7c4456){throw _0x7c4456;});}exports[_0xcef4('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x244e0a){var _0x1f05f5={'fields':[],'order':null};var _0x43d190=_0x244e0a[_0xcef4('0x31')](',');_0x1f05f5[_0xcef4('0x32')]=_['filter'](_0x43d190,function(_0x1debd5){if(!_0x1debd5['includes'](_0xcef4('0x2f'))){return!![];}_0x1f05f5[_0xcef4('0x33')]=_[_0xcef4('0x34')](_0x1debd5,'-')?'DESC':_0xcef4('0x35');return![];});return _0x1f05f5;}exports[_0xcef4('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x5407ba){if(_0x5407ba[_0xcef4('0x29')](_0xcef4('0x37'))&&!_0x5407ba[_0xcef4('0x29')](_0xcef4('0x38'))){var _0x2d6b74=_0x5407ba[_0xcef4('0x39')](0x0,_0x5407ba[_0xcef4('0x3a')](_0xcef4('0x37')));_0x5407ba+=','+_0x2d6b74+'internal';}return _0x5407ba;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x2fd8c6,_0x45e29f){var _0x511d8e=_0x2fd8c6['sort'](function(_0x594aa1,_0x4d6c18){if(_0x594aa1[_0xcef4('0x2f')]===_0x4d6c18[_0xcef4('0x2f')]){if(_0x594aa1['globalStatus']===_0xcef4('0x10')){if(_0x45e29f===_0xcef4('0x3b')){return(_0x594aa1[_0xcef4('0x3c')]||'')<(_0x4d6c18['pauseType']||'')||_0x594aa1[_0xcef4('0x37')][_0xcef4('0x3d')]()>_0x4d6c18[_0xcef4('0x37')][_0xcef4('0x3d')]()?0x1:-0x1;}else{return(_0x594aa1[_0xcef4('0x3c')]||'')<(_0x4d6c18[_0xcef4('0x3c')]||'')||_0x594aa1[_0xcef4('0x37')][_0xcef4('0x3d')]()>_0x4d6c18[_0xcef4('0x37')][_0xcef4('0x3d')]()?-0x1:0x1;}}else{if(_0x45e29f==='DESC'){return _0x594aa1[_0xcef4('0x37')][_0xcef4('0x3d')]()<_0x4d6c18[_0xcef4('0x37')][_0xcef4('0x3d')]()?0x1:-0x1;}else{return _0x594aa1['fullname'][_0xcef4('0x3d')]()<_0x4d6c18['fullname'][_0xcef4('0x3d')]()?-0x1:0x1;}}}else{if(_0x45e29f===_0xcef4('0x3b')){return _0x594aa1[_0xcef4('0x2f')]<_0x4d6c18[_0xcef4('0x2f')]?0x1:-0x1;}else{return _0x594aa1[_0xcef4('0x2f')]<_0x4d6c18['globalStatus']?-0x1:0x1;}}});return _0x511d8e;}exports[_0xcef4('0x3e')]=sortAgentsByStatus;function filterAgentAttributes(_0x4d2d7b){var _0x19fbb8=[_0xcef4('0x3f'),'online',_0xcef4('0x40'),_0xcef4('0x41'),_0xcef4('0x3c'),_0xcef4('0x41'),'internal',_0xcef4('0x42'),_0xcef4('0x3'),_0xcef4('0x43'),'mailPause',_0xcef4('0x2d'),'whatsappPause',_0xcef4('0x4'),'voicePause',_0xcef4('0x44'),'openchannelCapacity',_0xcef4('0x45'),_0xcef4('0x46'),_0xcef4('0x47'),_0xcef4('0x48'),_0xcef4('0x49'),_0xcef4('0x4a'),_0xcef4('0x4b'),_0xcef4('0x4c'),'whatsappCurrentCapacity','faxCurrentCapacity',_0xcef4('0x11'),_0xcef4('0x14'),_0xcef4('0x13'),_0xcef4('0x4d'),_0xcef4('0x15'),_0xcef4('0x12'),_0xcef4('0xf'),_0xcef4('0x4e'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0xcef4('0x4f'),_0xcef4('0x50'),'queue',_0xcef4('0x51'),_0xcef4('0x52'),_0xcef4('0x53'),_0xcef4('0x54'),_0xcef4('0x55')];var _0x349889=[_0xcef4('0x3'),_0xcef4('0x43'),_0xcef4('0x5'),'smsPause',_0xcef4('0x7'),_0xcef4('0x4'),_0xcef4('0x6'),_0xcef4('0x56')];var _0x50c007=_(_0x4d2d7b)[_0xcef4('0x57')](_0x349889)[_0xcef4('0x58')](_0x19fbb8)[_0xcef4('0x27')]();return _0x50c007;}exports[_0xcef4('0x59')]=filterAgentAttributes; \ No newline at end of file +var _0x4021=['resolve','User','findAll','name','fullname','map','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','internal','validateSortParameter','sort','pauseType','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','value','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','isNil','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','busy','getAgentStatus','startCase','Queue','findOne','getAgents','getAgentIdsByQueues','includes','getAgentIdsByStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4021,0x14b));var _0x1402=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x4021[_0x4fc80b];return _0x119dba;};'use strict';var _=require(_0x1402('0x0'));var jayson=require(_0x1402('0x1'));var db=require(_0x1402('0x2'))['db'];var amiClient=jayson[_0x1402('0x3')][_0x1402('0x4')]({'port':0x232a});var routingClient=jayson[_0x1402('0x3')][_0x1402('0x4')]({'port':0x232c});function isAgentPaused(_0x1a6396,_0x54ff7f){var _0x225001=[_0x1a6396[_0x1402('0x5')],_0x1a6396[_0x1402('0x6')],_0x1a6396[_0x1402('0x7')],_0x1a6396[_0x1402('0x8')],_0x1a6396[_0x1402('0x9')],_0x1a6396[_0x1402('0xa')],_0x1a6396[_0x1402('0xb')]];if(!_0x54ff7f)return _['every'](_0x225001);var _0x1fd6f8=_[_0x1402('0xc')](_0x225001);return _0x1fd6f8[_0x1402('0xd')]>0x0&&_0x1fd6f8[_0x1402('0xd')]<_0x225001[_0x1402('0xd')]?!![]:![];}function isIdle(_0x4477d5){return _0x4477d5===_0x1402('0xe')||_0x4477d5===_0x1402('0xf')||_0x4477d5===_0x1402('0x10')||_0x4477d5==='ringing'||_[_0x1402('0x11')](_0x4477d5);}function isAgentIdle(_0x3a061b){if(_0x3a061b[_0x1402('0x12')]!=='idle'&&_0x3a061b['voicePause']){_0x3a061b[_0x1402('0x12')]='pause';return![];}return _[_0x1402('0x13')]([_0x3a061b[_0x1402('0x14')],_0x3a061b[_0x1402('0x15')],_0x3a061b[_0x1402('0x16')],_0x3a061b[_0x1402('0x17')],_0x3a061b['smsStatus'],_0x3a061b[_0x1402('0x12')],_0x3a061b[_0x1402('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x1402('0x19')](_0x1402('0x1a'),{})[_0x1402('0x1b')](function(_0x22a4c7){if(_0x22a4c7[_0x1402('0x1c')]){throw new Error(_0x1402('0x1d'));}var _0x1aa805=_0x22a4c7[_0x1402('0x1e')];return routingClient[_0x1402('0x19')](_0x1402('0x1a'),{})[_0x1402('0x1b')](function(_0x2dc7ba){if(_0x2dc7ba['error']){throw new Error(_0x1402('0x1f'));}var _0x5cb9e7=_0x2dc7ba[_0x1402('0x1e')];return _[_0x1402('0x20')]({},_0x1aa805,_0x5cb9e7);});})[_0x1402('0x21')](function(_0x19ddc3){throw _0x19ddc3;});}exports[_0x1402('0x22')]=getRealtimeAgents;function getAgentStatus(_0x105ab8){var _0x56611e=_0x1402('0xf');if(isAgentPaused(_0x105ab8))_0x56611e=_0x1402('0x23');else if(isAgentPaused(_0x105ab8,!![]))_0x56611e='*pause';else if(isAgentIdle(_0x105ab8))_0x56611e=_0x1402('0xe');else _0x56611e=_0x1402('0x24');return _0x56611e;}exports[_0x1402('0x25')]=getAgentStatus;function getAgentIdsByQueues(_0x1a638c,_0x51dcee){var _0x1bca13=_['isArray'](_0x1a638c)?_0x1a638c:[_0x1a638c];var _0x376634=_[_0x1402('0x26')](_0x51dcee)+_0x1402('0x27');var _0x487dc2=_['map'](_0x1bca13,function(_0x4a58fb){return db[_0x376634][_0x1402('0x28')]({'where':{'id':_0x4a58fb}})[_0x1402('0x1b')](function(_0x16b727){if(!_0x16b727)return[];return _0x16b727[_0x1402('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x487dc2)[_0x1402('0x1b')](function(_0x58a329){var _0xad78ad=_(_0x58a329)['flatten']()['map']('id')['uniq']()['value']();return _0xad78ad;});}exports[_0x1402('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57f39e,_0x19647c,_0x5d8ad4){try{if(_0x19647c[_0x1402('0xd')]>0x0){_0x57f39e=_0x57f39e[_0x1402('0xc')](function(_0x429e6c){return _0x19647c[_0x1402('0x2b')](_0x429e6c['id']);});}var _0xc6cc00=_0x57f39e[_0x1402('0xc')](function(_0x23b2d6){var _0x597886='busy';if(isAgentIdle(_0x23b2d6)){_0x597886=_0x1402('0xe');}return _0x597886===_0x5d8ad4;});return _['map'](_0xc6cc00,'id');}catch(_0x40cda9){throw _0x40cda9;}}exports[_0x1402('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1f34dd,_0x91b11d,_0x27bcd8){return Promise[_0x1402('0x2d')]()['then'](function(){if(_0x91b11d['length']>0x0){_0x1f34dd=_0x1f34dd['filter'](function(_0x202150){return _0x91b11d[_0x1402('0x2b')](_0x202150['id']);});}return _0x1f34dd;})['then'](function(){return db[_0x1402('0x2e')][_0x1402('0x2f')]({'attributes':['id',_0x1402('0x30'),_0x1402('0x31'),'chatPause',_0x1402('0x6'),'mailPause','openchannelPause',_0x1402('0x9'),_0x1402('0xa'),_0x1402('0xb'),'pauseType'],'where':{'id':{'$in':_[_0x1402('0x32')](_0x1f34dd,'id')}},'raw':!![]});})[_0x1402('0x1b')](function(_0x2593a9){return _0x2593a9['map'](function(_0x2562cd){var _0x589b97=_[_0x1402('0x33')](_0x1f34dd,['id',_0x2562cd['id']]);var _0x52b2ad=filterAgentAttributes(_0x589b97);_[_0x1402('0x20')](_0x2562cd,_0x52b2ad);_0x2562cd[_0x1402('0x34')]=getAgentStatus(_0x2562cd);return _0x2562cd;});})[_0x1402('0x1b')](function(_0x38c2fb){var _0x3a8724=sortAgentsByStatus(_0x38c2fb,_0x27bcd8);return _[_0x1402('0x32')](_0x3a8724,'id');})[_0x1402('0x21')](function(_0x2060b1){throw _0x2060b1;});}exports[_0x1402('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x53c8a8){var _0x2ca53e={'fields':[],'order':null};var _0x197531=_0x53c8a8[_0x1402('0x36')](',');_0x2ca53e[_0x1402('0x37')]=_[_0x1402('0xc')](_0x197531,function(_0x358a42){if(!_0x358a42[_0x1402('0x2b')](_0x1402('0x34'))){return!![];}_0x2ca53e[_0x1402('0x38')]=_[_0x1402('0x39')](_0x358a42,'-')?_0x1402('0x3a'):_0x1402('0x3b');return![];});return _0x2ca53e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0xfbae30){if(_0xfbae30['includes'](_0x1402('0x31'))&&!_0xfbae30[_0x1402('0x2b')](_0x1402('0x3c'))){var _0x4d2795=_0xfbae30['substring'](0x0,_0xfbae30['indexOf']('fullname'));_0xfbae30+=','+_0x4d2795+'internal';}return _0xfbae30;}exports[_0x1402('0x3d')]=validateSortParameter;function sortAgentsByStatus(_0x1743d1,_0x4e3a26){var _0x48bff1=_0x1743d1[_0x1402('0x3e')](function(_0xd19348,_0x6ea3ef){if(_0xd19348[_0x1402('0x34')]===_0x6ea3ef['globalStatus']){if(_0xd19348[_0x1402('0x34')]===_0x1402('0x23')){if(_0x4e3a26===_0x1402('0x3a')){return(_0xd19348[_0x1402('0x3f')]||'')<(_0x6ea3ef[_0x1402('0x3f')]||'')||_0xd19348[_0x1402('0x31')][_0x1402('0x40')]()>_0x6ea3ef['fullname'][_0x1402('0x40')]()?0x1:-0x1;}else{return(_0xd19348[_0x1402('0x3f')]||'')<(_0x6ea3ef['pauseType']||'')||_0xd19348[_0x1402('0x31')][_0x1402('0x40')]()>_0x6ea3ef['fullname'][_0x1402('0x40')]()?-0x1:0x1;}}else{if(_0x4e3a26==='DESC'){return _0xd19348[_0x1402('0x31')][_0x1402('0x40')]()<_0x6ea3ef[_0x1402('0x31')][_0x1402('0x40')]()?0x1:-0x1;}else{return _0xd19348[_0x1402('0x31')][_0x1402('0x40')]()<_0x6ea3ef[_0x1402('0x31')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x4e3a26===_0x1402('0x3a')){return _0xd19348[_0x1402('0x34')]<_0x6ea3ef[_0x1402('0x34')]?0x1:-0x1;}else{return _0xd19348['globalStatus']<_0x6ea3ef['globalStatus']?-0x1:0x1;}}});return _0x48bff1;}exports[_0x1402('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0xe66bf7){var _0xbe3ba6=[_0x1402('0x42'),_0x1402('0x43'),_0x1402('0x44'),'lastPauseAt',_0x1402('0x3f'),_0x1402('0x45'),_0x1402('0x3c'),_0x1402('0x46'),'chatPause','openchannelPause',_0x1402('0x7'),'smsPause','whatsappPause',_0x1402('0x6'),'voicePause',_0x1402('0x47'),'openchannelCapacity',_0x1402('0x48'),_0x1402('0x49'),_0x1402('0x4a'),_0x1402('0x4b'),_0x1402('0x4c'),_0x1402('0x4d'),'mailCurrentCapacity',_0x1402('0x4e'),'whatsappCurrentCapacity',_0x1402('0x4f'),_0x1402('0x14'),_0x1402('0x17'),_0x1402('0x16'),'smsStatus',_0x1402('0x18'),_0x1402('0x15'),_0x1402('0x12'),_0x1402('0x50'),_0x1402('0x51'),'mailStatusTime',_0x1402('0x52'),_0x1402('0x53'),_0x1402('0x54'),_0x1402('0x55'),'queue','destconnectedlinenum',_0x1402('0x56'),_0x1402('0x57'),_0x1402('0x58'),_0x1402('0x59')];var _0x1eaf0f=[_0x1402('0x5'),_0x1402('0x8'),_0x1402('0x7'),_0x1402('0x9'),_0x1402('0xb'),_0x1402('0x6'),_0x1402('0xa'),_0x1402('0x43')];var _0x43c112=_(_0xe66bf7)[_0x1402('0x5a')](_0x1eaf0f)[_0x1402('0x5b')](_0xbe3ba6)[_0x1402('0x5c')]();return _0x43c112;}exports[_0x1402('0x5d')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index e902823..03adf6a 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 _0xfce6=['merge','pick','lodash','jayson/promise','util','client','http','waiting','inUse','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','map','get','paused','busy','outbound','find'];(function(_0x113734,_0x23af59){var _0x3eab32=function(_0x479783){while(--_0x479783){_0x113734['push'](_0x113734['shift']());}};_0x3eab32(++_0x23af59);}(_0xfce6,0x64));var _0x6fce=function(_0x59a542,_0x412c68){_0x59a542=_0x59a542-0x0;var _0x656aa3=_0xfce6[_0x59a542];return _0x656aa3;};'use strict';var _=require(_0x6fce('0x0'));var jayson=require(_0x6fce('0x1'));var util=require(_0x6fce('0x2'));var amiClient=jayson[_0x6fce('0x3')][_0x6fce('0x4')]({'port':0x232a});var routingClient=jayson[_0x6fce('0x3')][_0x6fce('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn','paused',_0x6fce('0x5')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x6fce('0x6'),'invalid',_0x6fce('0x7'),_0x6fce('0x8'),_0x6fce('0x9'),_0x6fce('0xa'),_0x6fce('0xb'),'talking',_0x6fce('0xc'),_0x6fce('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6fce('0xe'),_0x6fce('0xf'),'message','statusMessage','dialActive',_0x6fce('0x10'),_0x6fce('0x11'),_0x6fce('0x12'),'startProgressive',_0x6fce('0x13'),_0x6fce('0x14'),'erlangAbandonmentRate',_0x6fce('0x15'),_0x6fce('0x16'),'dialPredictiveIntervalMaxThreshold',_0x6fce('0x17'),_0x6fce('0x18'),'predictiveIntervalTotalCalls',_0x6fce('0x19'),_0x6fce('0x1a'),_0x6fce('0x1b'),_0x6fce('0x1c'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x26a994,_0x5bc9eb){var _0x5aba92=_0x5bc9eb===_0x6fce('0x1d')?amiClient:routingClient;return _0x5aba92['request'](_[_0x6fce('0x1e')](_0x5bc9eb)+_0x6fce('0x1f'),_0x26a994)[_0x6fce('0x20')](function(_0x321074){if(_0x321074[_0x6fce('0x21')])throw new Error(util[_0x6fce('0x22')](_0x6fce('0x23'),_0x5bc9eb));return _0x321074[_0x6fce('0x24')];})[_0x6fce('0x25')](function(_0x45bc0a){throw _0x45bc0a;});}exports[_0x6fce('0x26')]=getRealtimeQueues;function initializeQueues(_0x383236,_0x43c577,_0x1e39a5,_0x9c08d9){var _0x5b89a7=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1e39a5===_0x6fce('0x1d')){if(_0x9c08d9===_0x6fce('0x27')){_0x5b89a7=_0x5b89a7['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x9c08d9==='outbound'){_0x5b89a7=_0x5b89a7[_0x6fce('0x28')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x383236[_0x6fce('0x29')](function(_0x585589){var _0x3369b3=_0x585589[_0x6fce('0x2a')]({'plain':!![]});_0x3369b3[_0x6fce('0x2b')]=0x0;_0x3369b3[_0x6fce('0x7')]=0x0;_0x3369b3['loggedIn']=0x0;_0x3369b3['available']=0x0;_0x3369b3[_0x6fce('0x5')]=0x0;if(_0x1e39a5===_0x6fce('0x1d')){_0x3369b3['talking']=0x0;_0x3369b3[_0x6fce('0x2c')]=0x0;if(_0x9c08d9===_0x6fce('0x2d')){_0x3369b3[_0x6fce('0xe')]=0x0;_0x3369b3[_0x6fce('0xf')]=0x0;}}var _0x4b41a7=_[_0x6fce('0x2e')](_0x43c577,['id',_0x3369b3['id']]);if(_0x4b41a7){_[_0x6fce('0x2f')](_0x3369b3,_[_0x6fce('0x30')](_0x4b41a7,_0x5b89a7));}return _0x3369b3;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0x30bd=['get','waiting','voice','find','merge','pick','lodash','jayson/promise','util','client','http','available','loggedIn','paused','busy','invalid','loggedInDb','onHold','ringing','ringInUse','unavailable','unknown','originated','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','outbound','concat','map'];(function(_0x873932,_0x2df78e){var _0x531f67=function(_0x134b67){while(--_0x134b67){_0x873932['push'](_0x873932['shift']());}};_0x531f67(++_0x2df78e);}(_0x30bd,0xd2));var _0xd30b=function(_0x1b6047,_0x37d791){_0x1b6047=_0x1b6047-0x0;var _0x488395=_0x30bd[_0x1b6047];return _0x488395;};'use strict';var _=require(_0xd30b('0x0'));var jayson=require(_0xd30b('0x1'));var util=require(_0xd30b('0x2'));var amiClient=jayson[_0xd30b('0x3')][_0xd30b('0x4')]({'port':0x232a});var routingClient=jayson[_0xd30b('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd30b('0x5'),_0xd30b('0x6'),_0xd30b('0x7'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xd30b('0x8'),'inUse',_0xd30b('0x9'),_0xd30b('0xa'),'notInUse',_0xd30b('0xb'),_0xd30b('0xc'),_0xd30b('0xd'),'talking',_0xd30b('0xe'),_0xd30b('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xd30b('0x10'),'message','statusMessage',_0xd30b('0x11'),_0xd30b('0x12'),_0xd30b('0x13'),_0xd30b('0x14'),_0xd30b('0x15'),_0xd30b('0x16'),_0xd30b('0x17'),_0xd30b('0x18'),'erlangBusyFactor',_0xd30b('0x19'),'dialPredictiveIntervalMaxThreshold',_0xd30b('0x1a'),_0xd30b('0x1b'),_0xd30b('0x1c'),'predictiveIntervalAnsweredCalls',_0xd30b('0x1d'),'predictiveIntervalDroppedCallsCallersExit',_0xd30b('0x1e'),_0xd30b('0x1f')];function getRealtimeQueues(_0x431849,_0x220b26){var _0x22865e=_0x220b26==='voice'?amiClient:routingClient;return _0x22865e[_0xd30b('0x20')](_[_0xd30b('0x21')](_0x220b26)+_0xd30b('0x22'),_0x431849)[_0xd30b('0x23')](function(_0x4762d0){if(_0x4762d0[_0xd30b('0x24')])throw new Error(util[_0xd30b('0x25')](_0xd30b('0x26'),_0x220b26));return _0x4762d0[_0xd30b('0x27')];})['catch'](function(_0xad2ad3){throw _0xad2ad3;});}exports[_0xd30b('0x28')]=getRealtimeQueues;function initializeQueues(_0x239f67,_0x3dbdbd,_0x5a85b7,_0x46f89e){var _0x36b518=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5a85b7==='voice'){if(_0x46f89e===_0xd30b('0x29')){_0x36b518=_0x36b518['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x46f89e===_0xd30b('0x2a')){_0x36b518=_0x36b518[_0xd30b('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x239f67[_0xd30b('0x2c')](function(_0x10dce4){var _0x5a1e5b=_0x10dce4[_0xd30b('0x2d')]({'plain':!![]});_0x5a1e5b['paused']=0x0;_0x5a1e5b[_0xd30b('0xa')]=0x0;_0x5a1e5b[_0xd30b('0x6')]=0x0;_0x5a1e5b[_0xd30b('0x5')]=0x0;_0x5a1e5b[_0xd30b('0x2e')]=0x0;if(_0x5a85b7===_0xd30b('0x2f')){_0x5a1e5b['talking']=0x0;_0x5a1e5b[_0xd30b('0x8')]=0x0;if(_0x46f89e==='outbound'){_0x5a1e5b['pTalking']=0x0;_0x5a1e5b[_0xd30b('0x10')]=0x0;}}var _0x1efd9d=_[_0xd30b('0x30')](_0x3dbdbd,['id',_0x5a1e5b['id']]);if(_0x1efd9d){_[_0xd30b('0x31')](_0x5a1e5b,_[_0xd30b('0x32')](_0x1efd9d,_0x36b518));}return _0x5a1e5b;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c4ec067..a131403 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _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(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 99a0c7f..7d7843e 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 _0xb7c9=['head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','createHash','update','hex','getUuid','licenseToken','utf8','replace','macAddress','digest','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','filter','family','IPv4','internal'];(function(_0x4ebb51,_0xd8d50){var _0xe34e75=function(_0x418a20){while(--_0x418a20){_0x4ebb51['push'](_0x4ebb51['shift']());}};_0xe34e75(++_0xd8d50);}(_0xb7c9,0x87));var _0x9b7c=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb7c9[_0x1fc122];return _0xa2cb13;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x9b7c('0x0'));var machine=require(_0x9b7c('0x1'));var exec=require(_0x9b7c('0x2'))['execSync'];var config=require(_0x9b7c('0x3'));function getInterfaces(){var _0x2b9413=[];var _0x3805f6=os[_0x9b7c('0x4')]();var _0x9be0d1=_[_0x9b7c('0x5')](_['keys'](_0x3805f6));for(var _0x28fded=0x0;_0x28fded<_0x9be0d1['length'];_0x28fded++){var _0x70f6e2=_0x3805f6[_0x9be0d1[_0x28fded]][_0x9b7c('0x6')](function(_0x53db33){return _0x53db33[_0x9b7c('0x7')]===_0x9b7c('0x8')&&_0x53db33[_0x9b7c('0x9')]===![];});_0x2b9413=_0x2b9413['concat'](_0x70f6e2);}return _0x2b9413;}function getFirstInterface(){var _0x4a1a77=_[_0x9b7c('0xa')](getInterfaces());return{'macAddress':_0x4a1a77&&_0x4a1a77[_0x9b7c('0xb')]?_0x4a1a77[_0x9b7c('0xb')]:_0x9b7c('0xc'),'ipAddress':_0x4a1a77&&_0x4a1a77[_0x9b7c('0xd')]?_0x4a1a77[_0x9b7c('0xd')]:_0x9b7c('0xe')};}exports[_0x9b7c('0xf')]=getFirstInterface;function getCPUhash(){var _0x6646d7=_['orderBy'](os['cpus']()[_0x9b7c('0x10')](function(_0x1a04b6){return _0x1a04b6[_0x9b7c('0x11')];}))[_0x9b7c('0x12')](':');return crypto[_0x9b7c('0x13')]('md5')[_0x9b7c('0x14')](_0x6646d7)['digest'](_0x9b7c('0x15'));}exports[_0x9b7c('0x16')]=function(){var _0xcb136c=os['platform']();var _0x5e8288=/[0-9a-f-]{36}/;if(config[_0x9b7c('0x17')]&&_0x5e8288['test'](config['licenseToken'])){return config[_0x9b7c('0x17')];}else if(_0xcb136c==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x9b7c('0x18')})[_0x9b7c('0x19')]('\x0d\x0a','');}else{var _0x571801=getFirstInterface();var _0x23073e=getCPUhash();var _0x56315c=_0x23073e+'|'+os['hostname']()+'|'+_0x571801[_0x9b7c('0x1a')]+'|'+_0x571801['ipAddress'];var _0x4b2103=crypto[_0x9b7c('0x13')]('md5')[_0x9b7c('0x14')](_0x56315c)[_0x9b7c('0x1b')](_0x9b7c('0x15'));return _0x4b2103['substring'](0x0,0x8)+'-'+_0x4b2103[_0x9b7c('0x1c')](0x8,0xc)+'-'+_0x4b2103[_0x9b7c('0x1c')](0xc,0x10)+'-'+_0x4b2103[_0x9b7c('0x1c')](0x10,0x14)+'-'+_0x4b2103[_0x9b7c('0x1c')](0x14);}}; \ No newline at end of file +var _0x84df=['model','join','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','createHash','substring','crypto','child_process','execSync','../environment','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy','cpus','map'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x84df,0xd6));var _0xf84d=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0x84df[_0x515e9f];return _0x19cbf0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf84d('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0xf84d('0x1'))[_0xf84d('0x2')];var config=require(_0xf84d('0x3'));function getInterfaces(){var _0x1e1122=[];var _0x521e48=os['networkInterfaces']();var _0x297373=_['orderBy'](_[_0xf84d('0x4')](_0x521e48));for(var _0xf616a5=0x0;_0xf616a5<_0x297373['length'];_0xf616a5++){var _0x1a609d=_0x521e48[_0x297373[_0xf616a5]][_0xf84d('0x5')](function(_0x35b9c9){return _0x35b9c9[_0xf84d('0x6')]==='IPv4'&&_0x35b9c9[_0xf84d('0x7')]===![];});_0x1e1122=_0x1e1122[_0xf84d('0x8')](_0x1a609d);}return _0x1e1122;}function getFirstInterface(){var _0x1e086a=_[_0xf84d('0x9')](getInterfaces());return{'macAddress':_0x1e086a&&_0x1e086a[_0xf84d('0xa')]?_0x1e086a[_0xf84d('0xa')]:_0xf84d('0xb'),'ipAddress':_0x1e086a&&_0x1e086a['address']?_0x1e086a[_0xf84d('0xc')]:_0xf84d('0xd')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x222d22=_[_0xf84d('0xe')](os[_0xf84d('0xf')]()[_0xf84d('0x10')](function(_0x5c200a){return _0x5c200a[_0xf84d('0x11')];}))[_0xf84d('0x12')](':');return crypto['createHash'](_0xf84d('0x13'))[_0xf84d('0x14')](_0x222d22)[_0xf84d('0x15')](_0xf84d('0x16'));}exports[_0xf84d('0x17')]=function(){var _0x2bde2f=os['platform']();var _0xefa8a2=/[0-9a-f-]{36}/;if(config[_0xf84d('0x18')]&&_0xefa8a2[_0xf84d('0x19')](config['licenseToken'])){return config['licenseToken'];}else if(_0x2bde2f===_0xf84d('0x1a')){return exec(_0xf84d('0x1b'),{'encoding':_0xf84d('0x1c')})['replace']('\x0d\x0a','');}else{var _0x13e20d=getFirstInterface();var _0x1a0dfa=getCPUhash();var _0x34f9f5=_0x1a0dfa+'|'+os[_0xf84d('0x1d')]()+'|'+_0x13e20d[_0xf84d('0x1e')]+'|'+_0x13e20d['ipAddress'];var _0x5dc03d=crypto[_0xf84d('0x1f')](_0xf84d('0x13'))[_0xf84d('0x14')](_0x34f9f5)[_0xf84d('0x15')](_0xf84d('0x16'));return _0x5dc03d[_0xf84d('0x20')](0x0,0x8)+'-'+_0x5dc03d[_0xf84d('0x20')](0x8,0xc)+'-'+_0x5dc03d[_0xf84d('0x20')](0xc,0x10)+'-'+_0x5dc03d[_0xf84d('0x20')](0x10,0x14)+'-'+_0x5dc03d[_0xf84d('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 2997843..77df186 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 _0x2303=['toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s'];(function(_0x451219,_0x150e28){var _0x42b087=function(_0x51c567){while(--_0x51c567){_0x451219['push'](_0x451219['shift']());}};_0x42b087(++_0x150e28);}(_0x2303,0x13d));var _0x3230=function(_0x24fa80,_0x5d9fb1){_0x24fa80=_0x24fa80-0x0;var _0x27fcd3=_0x2303[_0x24fa80];return _0x27fcd3;};'use strict';var util=require(_0x3230('0x0'));var moment=require(_0x3230('0x1'));var rp=require(_0x3230('0x2'));var BPromise=require(_0x3230('0x3'));var pkginfo=require('pkginfo')(module,_0x3230('0x4'));var db=require(_0x3230('0x5'))['db'];var encryptor=require(_0x3230('0x6'));var hardware=require(_0x3230('0x7'));var logger=require(_0x3230('0x8'))(_0x3230('0x9'));var HOST=_0x3230('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x59d3ae){return new BPromise(function(_0x630549,_0x5eeb25){var _0x32820d=util[_0x3230('0xb')](_0x3230('0xc'),HOST,_0x59d3ae,module[_0x3230('0xd')]['version']);if(oldToken){_0x32820d=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x59d3ae,module[_0x3230('0xd')]['version'],oldToken);}var _0x34fa78={'uri':_0x32820d,'method':_0x3230('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x34fa78)[_0x3230('0xf')](function(_0x2c806c){_0x630549(_0x2c806c);})['catch'](function(_0xc44bdd){_0x5eeb25(_0xc44bdd);});});}function manageLicense(_0xb3ce,_0x1ab76e){var _0x280943=_0x1ab76e[_0x3230('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x280943[_0x3230('0x11')]!==_0xb3ce&&!_0x280943[_0x3230('0x12')]){oldToken=_0x280943[_0x3230('0x11')];}httpRequest(_0xb3ce)[_0x3230('0xf')](function(_0x504987){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x504987[_0x3230('0x13')]){isOldTokenSent=![];if(!_0x280943[_0x3230('0x9')]&&_0x280943[_0x3230('0x9')]!=_0x504987[_0x3230('0x9')]||_0x280943['license']&&_0x280943['data2']){logger[_0x3230('0x14')](_0x3230('0x15'));}if(_0x280943[_0x3230('0x9')]&&!_0x280943[_0x3230('0x12')]&&_0x280943[_0x3230('0x9')]!=_0x504987[_0x3230('0x9')]){logger[_0x3230('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x280943['license']&&!_0x280943[_0x3230('0x12')]&&_0x280943[_0x3230('0x9')]==_0x504987['license']){return _0x1ab76e;}return _0x1ab76e[_0x3230('0x16')]({'data1':_0xb3ce,'data2':null,'license':_0x504987[_0x3230('0x9')]});}else{if(_0x504987['license']||_0x280943[_0x3230('0x9')]){if(!_0x280943[_0x3230('0x12')]){if(_0x280943[_0x3230('0x11')]==_0xb3ce){GRAY_PERIOD_REASON=_0x3230('0x17');logger['info'](_0x3230('0x18'));}else{GRAY_PERIOD_REASON=_0x3230('0x19');logger[_0x3230('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x280943[_0x3230('0x11')],_0xb3ce);}logger[_0x3230('0x14')](_0x3230('0x1a'),GRAY_PERIOD_REASON[_0x3230('0x1b')](),moment()[_0x3230('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x1ab76e['update']({'data2':encryptor['encryptString'](moment()[_0x3230('0xb')](_0x3230('0x1c')))});}else{if(moment()[_0x3230('0x1d')](encryptor[_0x3230('0x1e')](_0x280943[_0x3230('0x12')]),_0x3230('0x1f'))>DAYS){logger['info'](_0x3230('0x20'),moment()[_0x3230('0xb')](_0x3230('0x1c')));isOldTokenSent=![];return _0x1ab76e[_0x3230('0x16')]({'data1':_0xb3ce,'data2':null,'license':null});}}}else{if(_0x280943['data1']!=_0xb3ce){logger[_0x3230('0x14')](_0x3230('0x21'),_0x280943[_0x3230('0x11')],_0xb3ce);return _0x1ab76e[_0x3230('0x16')]({'data1':_0xb3ce,'data2':null,'license':null});}}}return _0x1ab76e;})[_0x3230('0xf')](function(_0x19987e){_0x1ab76e=_0x19987e;})[_0x3230('0x22')](function(_0x2f1fb9){logger[_0x3230('0x23')](_0x2f1fb9[_0x3230('0x24')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x1ab76e);},TIME);});}function defaultLicense(){var _0x36d5f7=hardware[_0x3230('0x25')]();if(_0x36d5f7){return db[_0x3230('0x26')][_0x3230('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x36d5f7}})[_0x3230('0x28')](function(_0x2faba2,_0xf99631){logger[_0x3230('0x14')](_0x3230('0x29'),_0x36d5f7);manageLicense(_0x36d5f7,_0x2faba2);})[_0x3230('0x22')](function(_0x488fc1){logger[_0x3230('0x23')](_0x488fc1[_0x3230('0x24')]);});}}exports[_0x3230('0x2a')]=defaultLicense; \ No newline at end of file +var _0xfa4d=['format','%s/api/servers/%s/check?version=%s','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString','diff','decryptString','days','YYYY-MM-DD\x20HH:mm','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','moment','request-promise','bluebird','version','../../components/encryptor','../logger','license'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0xfa4d,0x14e));var _0xdfa4=function(_0xff5c1f,_0x1432c5){_0xff5c1f=_0xff5c1f-0x0;var _0x416808=_0xfa4d[_0xff5c1f];return _0x416808;};'use strict';var util=require(_0xdfa4('0x0'));var moment=require(_0xdfa4('0x1'));var rp=require(_0xdfa4('0x2'));var BPromise=require(_0xdfa4('0x3'));var pkginfo=require('pkginfo')(module,_0xdfa4('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0xdfa4('0x5'));var hardware=require('./hardware');var logger=require(_0xdfa4('0x6'))(_0xdfa4('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x332ed5){return new BPromise(function(_0x2a7bd6,_0x52f269){var _0x359655=util[_0xdfa4('0x8')](_0xdfa4('0x9'),HOST,_0x332ed5,module['exports'][_0xdfa4('0x4')]);if(oldToken){_0x359655=util[_0xdfa4('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x332ed5,module['exports'][_0xdfa4('0x4')],oldToken);}var _0x56d195={'uri':_0x359655,'method':_0xdfa4('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x56d195)[_0xdfa4('0xb')](function(_0x3f1828){_0x2a7bd6(_0x3f1828);})['catch'](function(_0x5a2a56){_0x52f269(_0x5a2a56);});});}function manageLicense(_0x26b382,_0x32812c){var _0x6a5272=_0x32812c[_0xdfa4('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x6a5272[_0xdfa4('0xd')]!==_0x26b382&&!_0x6a5272[_0xdfa4('0xe')]){oldToken=_0x6a5272[_0xdfa4('0xd')];}httpRequest(_0x26b382)[_0xdfa4('0xb')](function(_0x2577b4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2577b4['active']){isOldTokenSent=![];if(!_0x6a5272['license']&&_0x6a5272['license']!=_0x2577b4['license']||_0x6a5272[_0xdfa4('0x7')]&&_0x6a5272[_0xdfa4('0xe')]){logger[_0xdfa4('0xf')](_0xdfa4('0x10'));}if(_0x6a5272['license']&&!_0x6a5272[_0xdfa4('0xe')]&&_0x6a5272[_0xdfa4('0x7')]!=_0x2577b4['license']){logger[_0xdfa4('0xf')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x6a5272[_0xdfa4('0x7')]&&!_0x6a5272[_0xdfa4('0xe')]&&_0x6a5272[_0xdfa4('0x7')]==_0x2577b4['license']){return _0x32812c;}return _0x32812c['update']({'data1':_0x26b382,'data2':null,'license':_0x2577b4[_0xdfa4('0x7')]});}else{if(_0x2577b4[_0xdfa4('0x7')]||_0x6a5272[_0xdfa4('0x7')]){if(!_0x6a5272[_0xdfa4('0xe')]){if(_0x6a5272[_0xdfa4('0xd')]==_0x26b382){GRAY_PERIOD_REASON='Disabled';logger[_0xdfa4('0xf')](_0xdfa4('0x11'));}else{GRAY_PERIOD_REASON=_0xdfa4('0x12');logger[_0xdfa4('0xf')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x6a5272[_0xdfa4('0xd')],_0x26b382);}logger[_0xdfa4('0xf')](_0xdfa4('0x13'),GRAY_PERIOD_REASON[_0xdfa4('0x14')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x32812c[_0xdfa4('0x15')]({'data2':encryptor[_0xdfa4('0x16')](moment()[_0xdfa4('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xdfa4('0x17')](encryptor[_0xdfa4('0x18')](_0x6a5272['data2']),_0xdfa4('0x19'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xdfa4('0x8')](_0xdfa4('0x1a')));isOldTokenSent=![];return _0x32812c[_0xdfa4('0x15')]({'data1':_0x26b382,'data2':null,'license':null});}}}else{if(_0x6a5272[_0xdfa4('0xd')]!=_0x26b382){logger[_0xdfa4('0xf')](_0xdfa4('0x1b'),_0x6a5272[_0xdfa4('0xd')],_0x26b382);return _0x32812c[_0xdfa4('0x15')]({'data1':_0x26b382,'data2':null,'license':null});}}}return _0x32812c;})[_0xdfa4('0xb')](function(_0x5ea129){_0x32812c=_0x5ea129;})[_0xdfa4('0x1c')](function(_0x258d43){logger['error'](_0x258d43['message']);})[_0xdfa4('0x1d')](function(){setTimeout(function(){manageLicense(hardware[_0xdfa4('0x1e')](),_0x32812c);},TIME);});}function defaultLicense(){var _0x3d0446=hardware['getUuid']();if(_0x3d0446){return db[_0xdfa4('0x1f')][_0xdfa4('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x3d0446}})[_0xdfa4('0x21')](function(_0x43b59b,_0x49585e){logger['info'](_0xdfa4('0x22'),_0x3d0446);manageLicense(_0x3d0446,_0x43b59b);})[_0xdfa4('0x1c')](function(_0xa54826){logger[_0xdfa4('0x23')](_0xa54826[_0xdfa4('0x24')]);});}}exports[_0xdfa4('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 97f7fc4..e3fa539 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 _0x7234=['lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','data2','split','decryptString','%s:%s:%s','uuid','machineUuid','gray','deadline','add','days','format','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col','count','admin','telephones','pick','countBy','telephone','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0x5a3631,_0x3567a0){var _0x1cdb8e=function(_0x52344c){while(--_0x52344c){_0x5a3631['push'](_0x5a3631['shift']());}};_0x1cdb8e(++_0x3567a0);}(_0x7234,0x1b0));var _0x4723=function(_0xe83feb,_0x310b88){_0xe83feb=_0xe83feb-0x0;var _0x451e09=_0x7234[_0xe83feb];return _0x451e09;};'use strict';var util=require('util');var _=require(_0x4723('0x0'));var moment=require(_0x4723('0x1'));var BPromise=require(_0x4723('0x2'));var hardware=require(_0x4723('0x3'));var encryptor=require(_0x4723('0x4'));var db=require(_0x4723('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4723('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4723('0x7'),'machineUuid':hardware[_0x4723('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4723('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4723('0x9'),'machineUuid':hardware[_0x4723('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2ad538){return new BPromise(function(_0x585940,_0x23dedb){return db[_0x4723('0xa')][_0x4723('0xb')](_[_0x4723('0xc')](_0x2ad538,{'raw':!![],'where':{'id':0x1}}))[_0x4723('0xd')](function(_0x41fba5){return checkLicense(_0x41fba5,null);})['then'](function(_0xfff9eb){_0x585940(_0xfff9eb);return;})[_0x4723('0xe')](function(_0x22ed1c){_0x23dedb(_0x22ed1c);});});}function checkLicense(_0x29885f,_0x417e8c){if(!_0x29885f){demoLicense['uuid']=_0x29885f[_0x4723('0xf')];return demoLicense;}try{var _0x3c8a60=_0x417e8c||_0x29885f[_0x4723('0x10')];if(_[_0x4723('0x11')](_0x3c8a60)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2a1949=_0x29885f[_0x4723('0xf')];var _0x1719b7=_0x29885f[_0x4723('0x12')];var _0x4a5494=_0x2a1949[_0x4723('0x13')]('-')[0x4];var _0x64f57b=_0x2a1949[_0x4723('0x13')]('-')[0x0];var _0xaa5b75=encryptor[_0x4723('0x14')](_0x3c8a60,util['format'](_0x4723('0x15'),_0x4a5494,_0x2a1949,_0x64f57b));var _0x1a819b=JSON['parse'](_0xaa5b75);_0x1a819b['demo']=![];_0x1a819b[_0x4723('0x16')]=_0x2a1949;_0x1a819b[_0x4723('0x17')]=hardware[_0x4723('0x8')]();if(_0x1719b7){var _0x2fa4e4=encryptor[_0x4723('0x14')](_0x1719b7);_0x1a819b[_0x4723('0x18')]=_0x2fa4e4;_0x1a819b[_0x4723('0x19')]=moment(_0x2fa4e4)[_0x4723('0x1a')](0x7,_0x4723('0x1b'))[_0x4723('0x1c')]();_0x1a819b[_0x4723('0x1d')]=_0x1a819b['uuid']!=_0x1a819b[_0x4723('0x17')]?_0x4723('0x1e'):_0x4723('0x1f');}return _0x1a819b;}catch(_0x3f019b){breakingLicense[_0x4723('0x16')]=_0x29885f['data1'];breakingLicense['message']=_0x3f019b[_0x4723('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x28fee0,_0xf3bfca){getLicense()[_0x4723('0xd')](function(_0x31e846){return db[_0x4723('0x21')][_0x4723('0x22')]({'attributes':[_0x4723('0x23'),[db[_0x4723('0x24')]['fn'](_0x4723('0x25'),db[_0x4723('0x24')][_0x4723('0x26')](_0x4723('0x23'))),_0x4723('0x27')]],'group':_0x4723('0x23'),'where':{'role':{'$or':[_0x4723('0x28'),'user','telephone']}},'raw':!![]})[_0x4723('0xd')](function(_0x1eee10){var _0x5ed02c={'user':_0x31e846['users']||0x0,'telephone':_0x31e846[_0x4723('0x29')]||0x0};_0x1eee10['forEach'](function(_0x342f50){var _0x5cc1d3=_0x342f50[_0x4723('0x23')]==='admin'?'user':_0x342f50['role'];_0x5ed02c[_0x5cc1d3]-=_0x342f50[_0x4723('0x27')];if(_0x5ed02c[_0x5cc1d3]<0x0)_0x5ed02c[_0x5cc1d3]=0x0;});_0x28fee0(_0x5ed02c);return;});})[_0x4723('0xe')](function(_0x1bdf38){_0xf3bfca(_0x1bdf38);});});}function checkUserLimits(_0x1f50cf){return new BPromise(function(_0x1f0060,_0x565f2a){getLimits()[_0x4723('0xd')](function(_0x5038dd){var _0x429665=_[_0x4723('0x2a')](_[_0x4723('0x2b')](_0x1f50cf,_0x4723('0x23')),['admin','user',_0x4723('0x2c')]);var _0x1af5f8=(_0x429665[_0x4723('0x28')]||0x0)+(_0x429665[_0x4723('0x2d')]||0x0);var _0x178eb3=_0x429665[_0x4723('0x2c')]||0x0;if(_0x1af5f8>_0x5038dd[_0x4723('0x2d')])return _0x565f2a(_0x4723('0x2e'));if(_0x178eb3>_0x5038dd[_0x4723('0x2c')])return _0x565f2a(_0x4723('0x2f'));return _0x1f0060();})[_0x4723('0xe')](function(_0x573b9c){_0x565f2a(_0x573b9c);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x2bc4=['2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','days','grayReason','changed','disabled','findAll','sequelize','COUNT','col','role','count','user','telephone','forEach','admin','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','../../components/encryptor','../../mysqldb'];(function(_0x134005,_0xf81813){var _0x454a20=function(_0x42a9e8){while(--_0x42a9e8){_0x134005['push'](_0x134005['shift']());}};_0x454a20(++_0xf81813);}(_0x2bc4,0xdc));var _0x42bc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2bc4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x42bc('0x0'));var moment=require(_0x42bc('0x1'));var BPromise=require(_0x42bc('0x2'));var hardware=require('./hardware');var encryptor=require(_0x42bc('0x3'));var db=require(_0x42bc('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x42bc('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x42bc('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3ff495){return new BPromise(function(_0x3095e7,_0x1d14e5){return db[_0x42bc('0x7')][_0x42bc('0x8')](_[_0x42bc('0x9')](_0x3ff495,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x18c990){return checkLicense(_0x18c990,null);})[_0x42bc('0xa')](function(_0x29af3a){_0x3095e7(_0x29af3a);return;})['catch'](function(_0x1ed390){_0x1d14e5(_0x1ed390);});});}function checkLicense(_0x24ea82,_0x2adb50){if(!_0x24ea82){demoLicense['uuid']=_0x24ea82['data1'];return demoLicense;}try{var _0x11ee1f=_0x2adb50||_0x24ea82['license'];if(_[_0x42bc('0xb')](_0x11ee1f)){throw new Error(_0x42bc('0xc'));}var _0x53ccc9=_0x24ea82[_0x42bc('0xd')];var _0x2f5ad0=_0x24ea82[_0x42bc('0xe')];var _0x20883e=_0x53ccc9[_0x42bc('0xf')]('-')[0x4];var _0x178f59=_0x53ccc9['split']('-')[0x0];var _0x38d49b=encryptor[_0x42bc('0x10')](_0x11ee1f,util[_0x42bc('0x11')](_0x42bc('0x12'),_0x20883e,_0x53ccc9,_0x178f59));var _0x35a10c=JSON[_0x42bc('0x13')](_0x38d49b);_0x35a10c[_0x42bc('0x14')]=![];_0x35a10c[_0x42bc('0x15')]=_0x53ccc9;_0x35a10c[_0x42bc('0x16')]=hardware['getUuid']();if(_0x2f5ad0){var _0x4dd23f=encryptor[_0x42bc('0x10')](_0x2f5ad0);_0x35a10c[_0x42bc('0x17')]=_0x4dd23f;_0x35a10c[_0x42bc('0x18')]=moment(_0x4dd23f)['add'](0x7,_0x42bc('0x19'))['format']();_0x35a10c[_0x42bc('0x1a')]=_0x35a10c[_0x42bc('0x15')]!=_0x35a10c[_0x42bc('0x16')]?_0x42bc('0x1b'):_0x42bc('0x1c');}return _0x35a10c;}catch(_0x2d4e22){breakingLicense[_0x42bc('0x15')]=_0x24ea82[_0x42bc('0xd')];breakingLicense['message']=_0x2d4e22['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5d3f05,_0x4a3e3e){getLicense()[_0x42bc('0xa')](function(_0x23e464){return db['User'][_0x42bc('0x1d')]({'attributes':['role',[db[_0x42bc('0x1e')]['fn'](_0x42bc('0x1f'),db['sequelize'][_0x42bc('0x20')](_0x42bc('0x21'))),_0x42bc('0x22')]],'group':_0x42bc('0x21'),'where':{'role':{'$or':['admin',_0x42bc('0x23'),_0x42bc('0x24')]}},'raw':!![]})['then'](function(_0x206026){var _0x248273={'user':_0x23e464['users']||0x0,'telephone':_0x23e464['telephones']||0x0};_0x206026[_0x42bc('0x25')](function(_0x24e8cb){var _0x48daa4=_0x24e8cb['role']===_0x42bc('0x26')?_0x42bc('0x23'):_0x24e8cb[_0x42bc('0x21')];_0x248273[_0x48daa4]-=_0x24e8cb['count'];if(_0x248273[_0x48daa4]<0x0)_0x248273[_0x48daa4]=0x0;});_0x5d3f05(_0x248273);return;});})[_0x42bc('0x27')](function(_0xecc8a2){_0x4a3e3e(_0xecc8a2);});});}function checkUserLimits(_0x198abf){return new BPromise(function(_0x2a3d70,_0x4774b8){getLimits()[_0x42bc('0xa')](function(_0x4d49e7){var _0x4b56ea=_[_0x42bc('0x28')](_[_0x42bc('0x29')](_0x198abf,_0x42bc('0x21')),['admin',_0x42bc('0x23'),_0x42bc('0x24')]);var _0x21a292=(_0x4b56ea['admin']||0x0)+(_0x4b56ea[_0x42bc('0x23')]||0x0);var _0x5bc1bc=_0x4b56ea[_0x42bc('0x24')]||0x0;if(_0x21a292>_0x4d49e7[_0x42bc('0x23')])return _0x4774b8(_0x42bc('0x2a'));if(_0x5bc1bc>_0x4d49e7['telephone'])return _0x4774b8(_0x42bc('0x2b'));return _0x2a3d70();})[_0x42bc('0x27')](function(_0x564c67){_0x4774b8(_0x564c67);});});}module[_0x42bc('0x2c')]={'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 e52c5dc..fc1e397 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 _0xb574=['app-id','secret','exports','http://localhost:9000'];(function(_0xf08b04,_0x3fda06){var _0x3ac8a8=function(_0x2f1194){while(--_0x2f1194){_0xf08b04['push'](_0xf08b04['shift']());}};_0x3ac8a8(++_0x3fda06);}(_0xb574,0x106));var _0x4b57=function(_0x26d298,_0x355662){_0x26d298=_0x26d298-0x0;var _0x224ae5=_0xb574[_0x26d298];return _0x224ae5;};'use strict';module[_0x4b57('0x0')]={'DOMAIN':_0x4b57('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4b57('0x2'),'GOOGLE_SECRET':_0x4b57('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x77e6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x332fb5,_0x42ea2f){var _0x5a1f0a=function(_0x3adb05){while(--_0x3adb05){_0x332fb5['push'](_0x332fb5['shift']());}};_0x5a1f0a(++_0x42ea2f);}(_0x77e6,0x1a6));var _0x677e=function(_0x104a5b,_0x1e9635){_0x104a5b=_0x104a5b-0x0;var _0x430356=_0x77e6[_0x104a5b];return _0x430356;};'use strict';module[_0x677e('0x0')]={'DOMAIN':_0x677e('0x1'),'SESSION_SECRET':_0x677e('0x2'),'GOOGLE_ID':_0x677e('0x3'),'GOOGLE_SECRET':_0x677e('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index fb54f2c..9919a1f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf9ba=['exports','../utils/loggers'];(function(_0x608633,_0xbcb478){var _0x1ad251=function(_0x31fc9d){while(--_0x31fc9d){_0x608633['push'](_0x608633['shift']());}};_0x1ad251(++_0xbcb478);}(_0xf9ba,0xd3));var _0xaf9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9ba[_0x3dd15e];return _0x231fd0;};'use strict';var fileLogger=require(_0xaf9b('0x0'))['fileLogger'];module[_0xaf9b('0x1')]=fileLogger; \ No newline at end of file +var _0xea3b=['fileLogger','exports'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xea3b,0xd6));var _0xbea3=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0xea3b[_0x3653c7];return _0x58a021;};'use strict';var fileLogger=require('../utils/loggers')[_0xbea3('0x0')];module[_0xbea3('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 2afb3ef..582bbe7 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 _0xdf5f=['exports','../../config/environment','resolve','join','root','../../services/express/index.js','ami','../../services/ami/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js'];(function(_0x2da765,_0x4ff68a){var _0x4ba661=function(_0x202217){while(--_0x202217){_0x2da765['push'](_0x2da765['shift']());}};_0x4ba661(++_0x4ff68a);}(_0xdf5f,0x69));var _0xfdf5=function(_0x19de97,_0x39949e){_0x19de97=_0x19de97-0x0;var _0x29dce4=_0xdf5f[_0x19de97];return _0x29dce4;};'use strict';var path=require('path');var cfg=require(_0xfdf5('0x0'));var env={'NODE_PATH':path[_0xfdf5('0x1')](path[_0xfdf5('0x2')](cfg[_0xfdf5('0x3')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path['join'](__dirname,_0xfdf5('0x4')),'env':env},{'name':_0xfdf5('0x5'),'script':path[_0xfdf5('0x2')](__dirname,_0xfdf5('0x6')),'env':env},{'name':'agi','script':path[_0xfdf5('0x2')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0xfdf5('0x7'),'script':path['join'](__dirname,_0xfdf5('0x8')),'env':env},{'name':_0xfdf5('0x9'),'script':path[_0xfdf5('0x2')](__dirname,_0xfdf5('0xa')),'env':env},{'name':'xdr','script':path[_0xfdf5('0x2')](__dirname,_0xfdf5('0xb')),'env':env}]};module[_0xfdf5('0xc')]=pm2config; \ No newline at end of file +var _0xf2c0=['join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf2c0,0x176));var _0x0f2c=function(_0x5d3a42,_0x72e14){_0x5d3a42=_0x5d3a42-0x0;var _0x1dd612=_0xf2c0[_0x5d3a42];return _0x1dd612;};'use strict';var path=require(_0x0f2c('0x0'));var cfg=require('../../config/environment');var env={'NODE_PATH':path['resolve'](path[_0x0f2c('0x1')](cfg[_0x0f2c('0x2')],_0x0f2c('0x3')))};var pm2config={'apps':[{'name':_0x0f2c('0x4'),'script':path[_0x0f2c('0x1')](__dirname,_0x0f2c('0x5')),'env':env},{'name':_0x0f2c('0x6'),'script':path['join'](__dirname,_0x0f2c('0x7')),'env':env},{'name':_0x0f2c('0x8'),'script':path[_0x0f2c('0x1')](__dirname,_0x0f2c('0x9')),'env':env},{'name':_0x0f2c('0xa'),'script':path[_0x0f2c('0x1')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x0f2c('0xb'),'script':path['join'](__dirname,_0x0f2c('0xc')),'env':env},{'name':'xdr','script':path[_0x0f2c('0x1')](__dirname,_0x0f2c('0xd')),'env':env}]};module[_0x0f2c('0xe')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 5d36740..ef33c7d 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 _0x6838=['stop','then','restart','list','describe','delete','dump','saved','bluebird','connect','connected','start','disconnect'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x6838,0x174));var _0x8683=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0x6838[_0x5e6cb8];return _0x3faeb3;};'use strict';var pm2=require('pm2');var BPromise=require(_0x8683('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x495cf0,_0x2094ed){return pm2[_0x8683('0x1')](function(_0x12d8ff){if(_0x12d8ff){return _0x2094ed(_0x12d8ff);}return _0x495cf0(_0x8683('0x2'));});});};exports[_0x8683('0x3')]=function(_0x318b24){return connect()['then'](function(){return new BPromise(function(_0x4d29ac,_0x39b0c1){return pm2[_0x8683('0x3')](_0x318b24,function(_0x3b0ced,_0x165100){if(_0x3b0ced){return _0x39b0c1(_0x3b0ced);}pm2[_0x8683('0x4')]();return _0x4d29ac(_0x165100);});});});};exports[_0x8683('0x5')]=function(_0xc075bf){return connect()[_0x8683('0x6')](function(){return new BPromise(function(_0x1da565,_0x2b776a){return pm2[_0x8683('0x5')](_0xc075bf,function(_0x583225,_0xa0cb8e){if(_0x583225){return _0x2b776a(_0x583225);}pm2['disconnect']();return _0x1da565(_0xa0cb8e);});});});};exports[_0x8683('0x7')]=function(_0x3559b2){return connect()[_0x8683('0x6')](function(){return new BPromise(function(_0x541e2f,_0x9213fa){return pm2[_0x8683('0x7')](_0x3559b2,function(_0x57af26,_0x582664){if(_0x57af26){return _0x9213fa(_0x57af26);}pm2[_0x8683('0x4')]();return _0x541e2f(_0x582664);});});});};exports[_0x8683('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x221a11,_0x11d0c4){return pm2[_0x8683('0x8')](function(_0x22f89d,_0x9410c){if(_0x22f89d){return _0x11d0c4(_0x22f89d);}pm2[_0x8683('0x4')]();return _0x221a11(_0x9410c);});});});};exports[_0x8683('0x9')]=function(_0x45ffac){return connect()[_0x8683('0x6')](function(){return new BPromise(function(_0x39b474,_0xdd188a){return pm2[_0x8683('0x9')](_0x45ffac,function(_0x41bdc3,_0xeba556){if(_0x41bdc3){return _0xdd188a(_0x41bdc3);}pm2[_0x8683('0x4')]();return _0x39b474(_0xeba556);});});});};exports[_0x8683('0xa')]=function(_0x1f02a0){return connect()['then'](function(){return new BPromise(function(_0x102d62,_0x4ffad6){return pm2[_0x8683('0xa')](_0x1f02a0,function(_0x20a215,_0x491995){if(_0x20a215){return _0x4ffad6(_0x20a215);}pm2[_0x8683('0x4')]();return _0x102d62(_0x491995);});});});};exports[_0x8683('0xb')]=function(){return connect()[_0x8683('0x6')](function(){return new BPromise(function(_0x36f715,_0x27eaf7){return pm2['dump'](function(_0xa485d7){if(_0xa485d7){return _0x27eaf7(_0xa485d7);}return _0x36f715(_0x8683('0xc'));});});});}; \ No newline at end of file +var _0xa31b=['then','stop','restart','list','delete','dump','bluebird','connect','connected','disconnect'];(function(_0x4a48b2,_0x5b51fc){var _0x452e59=function(_0x551540){while(--_0x551540){_0x4a48b2['push'](_0x4a48b2['shift']());}};_0x452e59(++_0x5b51fc);}(_0xa31b,0x114));var _0xba31=function(_0x4289eb,_0x3860ce){_0x4289eb=_0x4289eb-0x0;var _0x1bea5d=_0xa31b[_0x4289eb];return _0x1bea5d;};'use strict';var pm2=require('pm2');var BPromise=require(_0xba31('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x15857a,_0x347d7d){return pm2[_0xba31('0x1')](function(_0x369678){if(_0x369678){return _0x347d7d(_0x369678);}return _0x15857a(_0xba31('0x2'));});});};exports['start']=function(_0x47cd39){return connect()['then'](function(){return new BPromise(function(_0x148cc9,_0x3c299c){return pm2['start'](_0x47cd39,function(_0x2f821f,_0x62246e){if(_0x2f821f){return _0x3c299c(_0x2f821f);}pm2[_0xba31('0x3')]();return _0x148cc9(_0x62246e);});});});};exports['stop']=function(_0x246cd2){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x3de460,_0x165762){return pm2[_0xba31('0x5')](_0x246cd2,function(_0x366ae4,_0x1be068){if(_0x366ae4){return _0x165762(_0x366ae4);}pm2['disconnect']();return _0x3de460(_0x1be068);});});});};exports['restart']=function(_0x17ec59){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x3436e9,_0x4d41ec){return pm2[_0xba31('0x6')](_0x17ec59,function(_0x3d8dc8,_0x19b85a){if(_0x3d8dc8){return _0x4d41ec(_0x3d8dc8);}pm2[_0xba31('0x3')]();return _0x3436e9(_0x19b85a);});});});};exports[_0xba31('0x7')]=function(){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x15890a,_0x439bee){return pm2[_0xba31('0x7')](function(_0x238f96,_0x1b022c){if(_0x238f96){return _0x439bee(_0x238f96);}pm2[_0xba31('0x3')]();return _0x15890a(_0x1b022c);});});});};exports['describe']=function(_0x15b2b6){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x3e744b,_0x407de6){return pm2['describe'](_0x15b2b6,function(_0x4b32d7,_0x2de2dd){if(_0x4b32d7){return _0x407de6(_0x4b32d7);}pm2['disconnect']();return _0x3e744b(_0x2de2dd);});});});};exports[_0xba31('0x8')]=function(_0x1ee270){return connect()['then'](function(){return new BPromise(function(_0x52d02b,_0x25bb92){return pm2[_0xba31('0x8')](_0x1ee270,function(_0x337054,_0x54fada){if(_0x337054){return _0x25bb92(_0x337054);}pm2[_0xba31('0x3')]();return _0x52d02b(_0x54fada);});});});};exports[_0xba31('0x9')]=function(){return connect()[_0xba31('0x4')](function(){return new BPromise(function(_0x22bd4e,_0x395b3d){return pm2[_0xba31('0x9')](function(_0xf52dae){if(_0xf52dae){return _0x395b3d(_0xf52dae);}return _0x22bd4e('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 39d4f58..da55fa2 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 _0xd560=['redis','localhost','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','length','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults'];(function(_0x3f2eb4,_0x387667){var _0x183caa=function(_0xdb98d2){while(--_0xdb98d2){_0x3f2eb4['push'](_0x3f2eb4['shift']());}};_0x183caa(++_0x387667);}(_0xd560,0x1e2));var _0x0d56=function(_0x51330a,_0x38e928){_0x51330a=_0x51330a-0x0;var _0x25d0bf=_0xd560[_0x51330a];return _0x25d0bf;};'use strict';var _=require(_0x0d56('0x0'));var moment=require('moment');var Redis=require(_0x0d56('0x1'));var util=require(_0x0d56('0x2'));var config=require(_0x0d56('0x3'));var db=require(_0x0d56('0x4'))['db'];var logger=require(_0x0d56('0x5'))(_0x0d56('0x6'));config['redis']=_[_0x0d56('0x7')](config[_0x0d56('0x8')],{'host':_0x0d56('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x25f8de=0x0;var _0x1a2ef4=[];return db[_0x0d56('0xa')][_0x0d56('0xb')]({'raw':!![],'attributes':['id',_0x0d56('0xc')],'where':{'id':0x1}})[_0x0d56('0xd')](function(_0x472831){_0x25f8de=_0x472831['chatTimeout'];if(_0x25f8de){return db['ChatInteraction'][_0x0d56('0xe')]({'raw':!![],'attributes':['id',_0x0d56('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0d56('0x10')](_0x472831[_0x0d56('0xc')],'minutes')}}});}else{return[];}})[_0x0d56('0xd')](function(_0x3e4abe){if(_0x3e4abe&&_0x3e4abe[_0x0d56('0x11')]){_0x1a2ef4=_['map'](_0x3e4abe||[],'id');logger['info'](_0x0d56('0x12'),_0x1a2ef4[_0x0d56('0x13')]());return db[_0x0d56('0x14')][_0x0d56('0x15')]({'closeReason':_0x0d56('0x16'),'disposition':_0x0d56('0x17'),'closed':!![],'closedAt':moment()[_0x0d56('0x18')](_0x0d56('0x19'))},{'where':{'id':_0x1a2ef4}});}})[_0x0d56('0xd')](function(){if(_0x1a2ef4&&_0x1a2ef4[_0x0d56('0x11')]){logger[_0x0d56('0x1a')](_0x0d56('0x1b'),_0x1a2ef4['join']());for(var _0x1a858b=0x0;_0x1a858b<_0x1a2ef4[_0x0d56('0x11')];_0x1a858b++){io[_0x0d56('0x1c')](_0x0d56('0x1d'),{'id':_0x1a2ef4[_0x1a858b],'closed':!![]});}}})[_0x0d56('0x1e')](function(_0x587b70){logger[_0x0d56('0x1f')](_0x0d56('0x20'),_0x587b70?util[_0x0d56('0x21')](_0x587b70,{'showHidden':![],'depth':null}):'');});}exports[_0x0d56('0x22')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcaab=['emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','localhost','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x249514,_0x289a22){var _0x3f1f18=function(_0x5a1070){while(--_0x5a1070){_0x249514['push'](_0x249514['shift']());}};_0x3f1f18(++_0x289a22);}(_0xcaab,0x15b));var _0xbcaa=function(_0x54cedc,_0x573701){_0x54cedc=_0x54cedc-0x0;var _0x302703=_0xcaab[_0x54cedc];return _0x302703;};'use strict';var _=require(_0xbcaa('0x0'));var moment=require(_0xbcaa('0x1'));var Redis=require(_0xbcaa('0x2'));var util=require(_0xbcaa('0x3'));var config=require(_0xbcaa('0x4'));var db=require(_0xbcaa('0x5'))['db'];var logger=require(_0xbcaa('0x6'))(_0xbcaa('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xbcaa('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbcaa('0x9')]));function closeInteractions(){var _0x1d33d1=0x0;var _0x5810f5=[];return db[_0xbcaa('0xa')][_0xbcaa('0xb')]({'raw':!![],'attributes':['id',_0xbcaa('0xc')],'where':{'id':0x1}})[_0xbcaa('0xd')](function(_0x4551ae){_0x1d33d1=_0x4551ae['chatTimeout'];if(_0x1d33d1){return db[_0xbcaa('0xe')][_0xbcaa('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xbcaa('0x10')](_0x4551ae[_0xbcaa('0xc')],_0xbcaa('0x11'))}}});}else{return[];}})[_0xbcaa('0xd')](function(_0x2ce8ac){if(_0x2ce8ac&&_0x2ce8ac[_0xbcaa('0x12')]){_0x5810f5=_[_0xbcaa('0x13')](_0x2ce8ac||[],'id');logger[_0xbcaa('0x14')](_0xbcaa('0x15'),_0x5810f5[_0xbcaa('0x16')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xbcaa('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x5810f5}});}})['then'](function(){if(_0x5810f5&&_0x5810f5[_0xbcaa('0x12')]){logger[_0xbcaa('0x14')](_0xbcaa('0x18'),_0x5810f5[_0xbcaa('0x16')]());for(var _0x21c204=0x0;_0x21c204<_0x5810f5['length'];_0x21c204++){io[_0xbcaa('0x19')]('chatInteraction:update',{'id':_0x5810f5[_0x21c204],'closed':!![]});}}})[_0xbcaa('0x1a')](function(_0x4edade){logger[_0xbcaa('0x1b')](_0xbcaa('0x1c'),_0x4edade?util[_0xbcaa('0x1d')](_0x4edade,{'showHidden':![],'depth':null}):'');});}exports[_0xbcaa('0x1e')]=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 74b5299..619cf15 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 _0xf09c=['../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x23fd4d,_0x2e0d0e){var _0xe22987=function(_0x34153b){while(--_0x34153b){_0x23fd4d['push'](_0x23fd4d['shift']());}};_0xe22987(++_0x2e0d0e);}(_0xf09c,0x111));var _0xcf09=function(_0x49187b,_0x2749f6){_0x49187b=_0x49187b-0x0;var _0x38c007=_0xf09c[_0x49187b];return _0x38c007;};'use strict';function start(){var _0x248345=require(_0xcf09('0x0'));return _0x248345['startAllRefreshIntervals']();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0x1570=['startAllRefreshIntervals'];(function(_0x185bff,_0x1a4ad7){var _0x9978b9=function(_0x20b3cc){while(--_0x20b3cc){_0x185bff['push'](_0x185bff['shift']());}};_0x9978b9(++_0x1a4ad7);}(_0x1570,0x16c));var _0x0157=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x1570[_0xf50820];return _0x2a9b10;};'use strict';function start(){var _0x1f425f=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1f425f[_0x0157('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 63fccc4..3999393 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 _0x39a7=['MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error\x20mail','stringify','email\x20sent','catch','error','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','CloudProvider','jobs','toString','keyBy','difference','exists','stop','delete\x20cron','length','index','my\x20id','resolve','cron','active','isBetween','endAt','add','start','add\x20cron','stop\x20cron','startAt','update','update\x20cron','deleteJob','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','format','\x22%s\x22\x20<%s>'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39a7,0x150));var _0x739a=function(_0x52ece1,_0x425dc5){_0x52ece1=_0x52ece1-0x0;var _0x329205=_0x39a7[_0x52ece1];return _0x329205;};'use strict';var fs=require('fs');var util=require(_0x739a('0x0'));var path=require(_0x739a('0x1'));var _=require(_0x739a('0x2'));var moment=require(_0x739a('0x3'));var CronJobManager=require(_0x739a('0x4'));var jayson=require(_0x739a('0x5'));var BPromise=require(_0x739a('0x6'));var logger=require(_0x739a('0x7'))(_0x739a('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x739a('0x9'));var client=jayson[_0x739a('0xa')][_0x739a('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1098b6,_0x1f4fbf){return function(){logger[_0x739a('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x1098b6[_0x739a('0xd')]);var _0xc74404=!![];var _0x10ba99=_0x1098b6['MailAccount']['getSmtpOptions']();var _0xd79c3f={'account':_0x10ba99,'message':{'from':util[_0x739a('0xe')](_0x739a('0xf'),_0x1098b6[_0x739a('0x10')][_0x739a('0x11')],_0x1098b6['MailAccount'][_0x739a('0xd')]||_0x1098b6['MailAccount'][_0x739a('0x12')][_0x739a('0x13')]),'to':_0x1098b6[_0x739a('0xd')],'cc':_0x1098b6['cc'],'bcc':_0x1098b6[_0x739a('0x14')],'subject':util['format'](_0x739a('0x15'),_0x1f4fbf[_0x739a('0x11')],_0x1098b6[_0x739a('0x16')],_0x1098b6[_0x739a('0x17')])}};var _0x505b1e=path[_0x739a('0x18')](__dirname,_0x739a('0x19'));var _0x31ca62=_0x1f4fbf[_0x739a('0x1a')];var _0x361bfa=util[_0x739a('0xe')]('%s.%s',path[_0x739a('0x1b')](_0x1f4fbf['savename'],path[_0x739a('0x1c')](_0x1f4fbf['savename'])),_0x739a('0x1d'));var _0x3efe3c=path[_0x739a('0x18')](_0x505b1e,_0x31ca62);var _0x578918=path[_0x739a('0x18')](_0x505b1e,_0x361bfa);if(fs[_0x739a('0x1e')](_0x3efe3c)){_0x1f4fbf[_0x739a('0x1f')]=_0x739a('0x20');_0xd79c3f['message'][_0x739a('0x21')]=[{'filename':_0x31ca62,'path':_0x3efe3c}];_0xd79c3f[_0x739a('0x22')][_0x739a('0x23')]=util[_0x739a('0xe')](_0x739a('0x24'),JSON['stringify'](_0x1f4fbf,null,0x2));}else if(fs[_0x739a('0x1e')](_0x578918)){_0x1f4fbf[_0x739a('0x1f')]=_0x739a('0x20');_0xd79c3f[_0x739a('0x22')][_0x739a('0x21')]=[{'filename':_0x361bfa,'path':_0x578918}];}else{_0xd79c3f[_0x739a('0x22')][_0x739a('0x23')]=_0x739a('0x25');if(!_0x1098b6[_0x739a('0x26')]){_0xc74404=![];logger[_0x739a('0xc')](_0x739a('0x27'));}}if(_0xc74404){return client[_0x739a('0x28')](_0x739a('0x29'),_0xd79c3f)[_0x739a('0x2a')](function(_0x16b393){if(_0x16b393['error']){return logger['error'](_0x739a('0x2b'),JSON[_0x739a('0x2c')](_0x16b393));}return logger[_0x739a('0xc')](_0x739a('0x2d'));})[_0x739a('0x2e')](function(_0x2600ff){return logger[_0x739a('0x2f')](_0x739a('0x2b'),JSON[_0x739a('0x2c')](_0x2600ff));});}};}function handleError(){return function(_0x34bbd1){return logger['error'](JSON[_0x739a('0x2c')](_0x34bbd1));};}function handleResult(_0x13e95f){return function(_0x574448){logger[_0x739a('0xc')](_0x739a('0x30'),JSON[_0x739a('0x2c')](_0x574448));if(_0x13e95f[_0x739a('0x10')]&&_0x13e95f[_0x739a('0x10')][_0x739a('0x12')]&&!_[_0x739a('0x31')](_0x13e95f[_0x739a('0xd')])){setTimeout(handleSendEmail(_0x13e95f,_0x574448),0x3c*0x3e8);}};}function handleJob(_0x5bd139){return function(){try{if(_['isNil'](_0x5bd139[_0x739a('0x16')])){return logger[_0x739a('0xc')](_0x739a('0x32'));}if(_[_0x739a('0x31')](_0x5bd139[_0x739a('0x17')])){return logger['info'](_0x739a('0x33'));}var _0x118e5f={'startDate':moment()[_0x739a('0x34')](_0x5bd139['subtractNumber'],_0x5bd139[_0x739a('0x17')])['format'](_0x739a('0x35')),'endDate':moment()[_0x739a('0xe')](_0x739a('0x35')),'type':_0x739a('0x36'),'output':_0x5bd139[_0x739a('0x37')],'name':_0x5bd139['name']};if(!_[_0x739a('0x31')](_0x5bd139[_0x739a('0x38')])){logger['info'](_0x739a('0x39'),_0x5bd139[_0x739a('0x38')]);return analyticDefaultReportController[_0x739a('0x3a')]({'id':_0x5bd139[_0x739a('0x38')]},_0x118e5f)[_0x739a('0x2a')](handleResult(_0x5bd139))[_0x739a('0x2e')](handleError());}if(!_[_0x739a('0x31')](_0x5bd139[_0x739a('0x3b')])){logger[_0x739a('0xc')](_0x739a('0x3c'),_0x5bd139[_0x739a('0x3b')]);return analyticCustomReportController[_0x739a('0x3a')]({'id':_0x5bd139['CustomReportId']},_0x118e5f)['then'](handleResult(_0x5bd139))[_0x739a('0x2e')](handleError());}}catch(_0x4a0ac7){logger['error'](JSON[_0x739a('0x2c')](_0x4a0ac7));}return logger[_0x739a('0xc')](_0x739a('0x3d'));};}function getJobs(_0x519493){var _0x38d8c6={};if(_0x519493){_0x38d8c6['id']=_0x519493;}return db[_0x739a('0x3e')]['findAll']({'where':_0x38d8c6,'include':[{'model':db[_0x739a('0x10')],'attributes':['id','name',_0x739a('0xd')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x739a('0x3f')],'as':_0x739a('0x3f')}]}]}]})['then'](function(_0x527459){var _0x23718e=_['keys'](manager[_0x739a('0x40')]);var _0xd112bf=_['map'](_0x527459,function(_0x40c206){return _0x40c206['id'][_0x739a('0x41')]();});var _0x468793=_[_0x739a('0x42')](_0x527459,function(_0x170557){return _0x170557['id'][_0x739a('0x41')]();});var _0x36ecff=_0x519493?_0xd112bf:_['difference'](_0xd112bf,_0x23718e);var _0x32e539=_['intersection'](_0xd112bf,_0x23718e);var _0x32f5e9=_[_0x739a('0x43')](_0x23718e,_0xd112bf);var _0x2108f1;var _0x36efb0;for(_0x2108f1=0x0;_0x2108f1<_0x32f5e9['length']&&!_0x519493;_0x2108f1+=0x1){_0x36efb0=_0x32f5e9[_0x2108f1][_0x739a('0x41')]();if(manager[_0x739a('0x44')](_0x36efb0)){manager[_0x739a('0x45')](_0x36efb0);manager['deleteJob'](_0x36efb0);logger['info'](_0x739a('0x46'),_0x36efb0);}}logger[_0x739a('0xc')]('toRun',JSON[_0x739a('0x2c')](_0x36ecff));for(_0x2108f1=0x0;_0x2108f1<_0x36ecff[_0x739a('0x47')];_0x2108f1+=0x1){_0x36efb0=_0x36ecff[_0x2108f1][_0x739a('0x41')]();logger[_0x739a('0xc')](_0x739a('0x48'),_0x36efb0);if(_0x519493){logger[_0x739a('0xc')](_0x739a('0x49'),_0x519493);logger[_0x739a('0xc')](JSON[_0x739a('0x2c')](_0x468793[_0x36efb0]));BPromise[_0x739a('0x4a')]()[_0x739a('0x2a')](handleJob(_0x468793[_0x36efb0]));logger[_0x739a('0xc')]('run\x20job',_0x468793[_0x36efb0][_0x739a('0x11')],_0x468793[_0x36efb0][_0x739a('0x4b')]);}else if(_0x468793[_0x36efb0]['cron']&&_0x468793[_0x36efb0][_0x739a('0x4c')]&&moment()[_0x739a('0x4d')](_0x468793[_0x36efb0]['startAt'],_0x468793[_0x36efb0][_0x739a('0x4e')])){manager[_0x739a('0x4f')](_0x36efb0,_0x468793[_0x36efb0][_0x739a('0x4b')],handleJob(_0x468793[_0x36efb0]));manager[_0x739a('0x50')](_0x36efb0);logger['info'](_0x739a('0x51'),_0x468793[_0x36efb0][_0x739a('0x11')],_0x468793[_0x36efb0]['cron']);}else if(manager[_0x739a('0x44')](_0x36efb0)){manager[_0x739a('0x45')](_0x36efb0);manager['deleteJob'](_0x36efb0);logger['info'](_0x739a('0x52'),_0x468793[_0x36efb0][_0x739a('0x11')],_0x468793[_0x36efb0][_0x739a('0x4b')]);}}for(_0x2108f1=0x0,_0x36efb0;_0x2108f1<_0x32e539[_0x739a('0x47')]&&!_0x519493;_0x2108f1+=0x1){_0x36efb0=_0x32e539[_0x2108f1]['toString']();if(manager[_0x739a('0x44')](_0x36efb0)){if(_0x468793[_0x36efb0]['cron']&&_0x468793[_0x36efb0][_0x739a('0x4c')]&&moment()[_0x739a('0x4d')](_0x468793[_0x36efb0][_0x739a('0x53')],_0x468793[_0x36efb0][_0x739a('0x4e')])){manager[_0x739a('0x54')](_0x36efb0,_0x468793[_0x36efb0][_0x739a('0x4b')],handleJob(_0x468793[_0x36efb0]));logger[_0x739a('0xc')](_0x739a('0x55'),_0x468793[_0x36efb0][_0x739a('0x11')],_0x468793[_0x36efb0][_0x739a('0x4b')]);}else{manager[_0x739a('0x45')](_0x36efb0);manager[_0x739a('0x56')](_0x36efb0);logger[_0x739a('0xc')](_0x739a('0x52'),_0x468793[_0x36efb0][_0x739a('0x11')],_0x468793[_0x36efb0][_0x739a('0x4b')]);}}}})[_0x739a('0x2e')](function(_0x2d8c3d){logger[_0x739a('0x2f')](JSON[_0x739a('0x2c')](_0x2d8c3d));});}exports[_0x739a('0x57')]=function(_0x4895cb){return getJobs(_0x4895cb);};exports[_0x739a('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xf048=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','stringify','isNil','subtractNumber\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','start','stop\x20cron','endAt','update','update\x20cron','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x4201f9,_0x5196ac){var _0x1e2848=function(_0x58923d){while(--_0x58923d){_0x4201f9['push'](_0x4201f9['shift']());}};_0x1e2848(++_0x5196ac);}(_0xf048,0x182));var _0x8f04=function(_0x16730f,_0xcee12e){_0x16730f=_0x16730f-0x0;var _0x1998a9=_0xf048[_0x16730f];return _0x1998a9;};'use strict';var fs=require('fs');var util=require(_0x8f04('0x0'));var path=require(_0x8f04('0x1'));var _=require(_0x8f04('0x2'));var moment=require(_0x8f04('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x8f04('0x4'));var BPromise=require(_0x8f04('0x5'));var logger=require(_0x8f04('0x6'))(_0x8f04('0x7'));var db=require(_0x8f04('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8f04('0x9'));var client=jayson[_0x8f04('0xa')][_0x8f04('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2e5cf3,_0x261d82){return function(){logger[_0x8f04('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2e5cf3[_0x8f04('0xd')]);var _0x38d2a5=!![];var _0x56c8fc=_0x2e5cf3['MailAccount'][_0x8f04('0xe')]();var _0x37801c={'account':_0x56c8fc,'message':{'from':util[_0x8f04('0xf')](_0x8f04('0x10'),_0x2e5cf3[_0x8f04('0x11')][_0x8f04('0x12')],_0x2e5cf3['MailAccount'][_0x8f04('0xd')]||_0x2e5cf3['MailAccount'][_0x8f04('0x13')][_0x8f04('0x14')]),'to':_0x2e5cf3[_0x8f04('0xd')],'cc':_0x2e5cf3['cc'],'bcc':_0x2e5cf3[_0x8f04('0x15')],'subject':util[_0x8f04('0xf')](_0x8f04('0x16'),_0x261d82[_0x8f04('0x12')],_0x2e5cf3[_0x8f04('0x17')],_0x2e5cf3[_0x8f04('0x18')])}};var _0x3efe75=path['join'](__dirname,_0x8f04('0x19'));var _0x3c275a=_0x261d82[_0x8f04('0x1a')];var _0x1b05b4=util['format'](_0x8f04('0x1b'),path[_0x8f04('0x1c')](_0x261d82[_0x8f04('0x1a')],path['extname'](_0x261d82[_0x8f04('0x1a')])),_0x8f04('0x1d'));var _0x338022=path[_0x8f04('0x1e')](_0x3efe75,_0x3c275a);var _0x24c442=path[_0x8f04('0x1e')](_0x3efe75,_0x1b05b4);if(fs[_0x8f04('0x1f')](_0x338022)){_0x261d82[_0x8f04('0x20')]=_0x8f04('0x21');_0x37801c[_0x8f04('0x22')][_0x8f04('0x23')]=[{'filename':_0x3c275a,'path':_0x338022}];_0x37801c[_0x8f04('0x22')][_0x8f04('0x24')]=util[_0x8f04('0xf')](_0x8f04('0x25'),JSON['stringify'](_0x261d82,null,0x2));}else if(fs[_0x8f04('0x1f')](_0x24c442)){_0x261d82[_0x8f04('0x20')]=_0x8f04('0x21');_0x37801c['message'][_0x8f04('0x23')]=[{'filename':_0x1b05b4,'path':_0x24c442}];}else{_0x37801c[_0x8f04('0x22')][_0x8f04('0x24')]=_0x8f04('0x26');if(!_0x2e5cf3[_0x8f04('0x27')]){_0x38d2a5=![];logger[_0x8f04('0xc')](_0x8f04('0x28'));}}if(_0x38d2a5){return client[_0x8f04('0x29')]('SendMail',_0x37801c)[_0x8f04('0x2a')](function(_0x2797d5){if(_0x2797d5[_0x8f04('0x2b')]){return logger[_0x8f04('0x2b')](_0x8f04('0x2c'),JSON['stringify'](_0x2797d5));}return logger[_0x8f04('0xc')](_0x8f04('0x2d'));})[_0x8f04('0x2e')](function(_0x2818ca){return logger[_0x8f04('0x2b')]('error\x20mail',JSON['stringify'](_0x2818ca));});}};}function handleError(){return function(_0x1f931c){return logger['error'](JSON['stringify'](_0x1f931c));};}function handleResult(_0x292840){return function(_0xdd7e17){logger[_0x8f04('0xc')](_0x8f04('0x2f'),JSON[_0x8f04('0x30')](_0xdd7e17));if(_0x292840[_0x8f04('0x11')]&&_0x292840[_0x8f04('0x11')][_0x8f04('0x13')]&&!_[_0x8f04('0x31')](_0x292840[_0x8f04('0xd')])){setTimeout(handleSendEmail(_0x292840,_0xdd7e17),0x3c*0x3e8);}};}function handleJob(_0x4148de){return function(){try{if(_[_0x8f04('0x31')](_0x4148de['subtractNumber'])){return logger[_0x8f04('0xc')](_0x8f04('0x32'));}if(_[_0x8f04('0x31')](_0x4148de[_0x8f04('0x18')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x305a52={'startDate':moment()['subtract'](_0x4148de[_0x8f04('0x17')],_0x4148de[_0x8f04('0x18')])[_0x8f04('0xf')](_0x8f04('0x33')),'endDate':moment()[_0x8f04('0xf')](_0x8f04('0x33')),'type':'scheduled','output':_0x4148de['output'],'name':_0x4148de[_0x8f04('0x12')]};if(!_[_0x8f04('0x31')](_0x4148de[_0x8f04('0x34')])){logger[_0x8f04('0xc')](_0x8f04('0x35'),_0x4148de[_0x8f04('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x4148de[_0x8f04('0x34')]},_0x305a52)[_0x8f04('0x2a')](handleResult(_0x4148de))[_0x8f04('0x2e')](handleError());}if(!_[_0x8f04('0x31')](_0x4148de[_0x8f04('0x36')])){logger['info'](_0x8f04('0x37'),_0x4148de[_0x8f04('0x36')]);return analyticCustomReportController[_0x8f04('0x38')]({'id':_0x4148de[_0x8f04('0x36')]},_0x305a52)[_0x8f04('0x2a')](handleResult(_0x4148de))[_0x8f04('0x2e')](handleError());}}catch(_0x323e4f){logger[_0x8f04('0x2b')](JSON['stringify'](_0x323e4f));}return logger[_0x8f04('0xc')](_0x8f04('0x39'));};}function getJobs(_0x3a1a53){var _0x3ee573={};if(_0x3a1a53){_0x3ee573['id']=_0x3a1a53;}return db['Schedule'][_0x8f04('0x3a')]({'where':_0x3ee573,'include':[{'model':db[_0x8f04('0x11')],'attributes':['id',_0x8f04('0x12'),_0x8f04('0xd')],'include':[{'model':db[_0x8f04('0x3b')],'as':_0x8f04('0x13'),'include':[{'model':db[_0x8f04('0x3c')],'as':_0x8f04('0x3c')}]}]}]})[_0x8f04('0x2a')](function(_0x1b38ed){var _0x59ff88=_[_0x8f04('0x3d')](manager['jobs']);var _0x39c6dc=_[_0x8f04('0x3e')](_0x1b38ed,function(_0x33ed83){return _0x33ed83['id'][_0x8f04('0x3f')]();});var _0x1dbf53=_[_0x8f04('0x40')](_0x1b38ed,function(_0x5c6897){return _0x5c6897['id'][_0x8f04('0x3f')]();});var _0x2f7f28=_0x3a1a53?_0x39c6dc:_[_0x8f04('0x41')](_0x39c6dc,_0x59ff88);var _0x4bf8ff=_['intersection'](_0x39c6dc,_0x59ff88);var _0x413f3a=_[_0x8f04('0x41')](_0x59ff88,_0x39c6dc);var _0x5843b1;var _0x1efd83;for(_0x5843b1=0x0;_0x5843b1<_0x413f3a['length']&&!_0x3a1a53;_0x5843b1+=0x1){_0x1efd83=_0x413f3a[_0x5843b1][_0x8f04('0x3f')]();if(manager[_0x8f04('0x42')](_0x1efd83)){manager[_0x8f04('0x43')](_0x1efd83);manager[_0x8f04('0x44')](_0x1efd83);logger[_0x8f04('0xc')](_0x8f04('0x45'),_0x1efd83);}}logger['info'](_0x8f04('0x46'),JSON[_0x8f04('0x30')](_0x2f7f28));for(_0x5843b1=0x0;_0x5843b1<_0x2f7f28[_0x8f04('0x47')];_0x5843b1+=0x1){_0x1efd83=_0x2f7f28[_0x5843b1]['toString']();logger[_0x8f04('0xc')](_0x8f04('0x48'),_0x1efd83);if(_0x3a1a53){logger[_0x8f04('0xc')](_0x8f04('0x49'),_0x3a1a53);logger[_0x8f04('0xc')](JSON['stringify'](_0x1dbf53[_0x1efd83]));BPromise[_0x8f04('0x4a')]()[_0x8f04('0x2a')](handleJob(_0x1dbf53[_0x1efd83]));logger[_0x8f04('0xc')](_0x8f04('0x4b'),_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}else if(_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]&&_0x1dbf53[_0x1efd83]['active']&&moment()[_0x8f04('0x4d')](_0x1dbf53[_0x1efd83][_0x8f04('0x4e')],_0x1dbf53[_0x1efd83]['endAt'])){manager[_0x8f04('0x4f')](_0x1efd83,_0x1dbf53[_0x1efd83][_0x8f04('0x4c')],handleJob(_0x1dbf53[_0x1efd83]));manager[_0x8f04('0x50')](_0x1efd83);logger[_0x8f04('0xc')]('add\x20cron',_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}else if(manager['exists'](_0x1efd83)){manager[_0x8f04('0x43')](_0x1efd83);manager[_0x8f04('0x44')](_0x1efd83);logger[_0x8f04('0xc')](_0x8f04('0x51'),_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}}for(_0x5843b1=0x0,_0x1efd83;_0x5843b1<_0x4bf8ff[_0x8f04('0x47')]&&!_0x3a1a53;_0x5843b1+=0x1){_0x1efd83=_0x4bf8ff[_0x5843b1][_0x8f04('0x3f')]();if(manager[_0x8f04('0x42')](_0x1efd83)){if(_0x1dbf53[_0x1efd83]['cron']&&_0x1dbf53[_0x1efd83]['active']&&moment()['isBetween'](_0x1dbf53[_0x1efd83]['startAt'],_0x1dbf53[_0x1efd83][_0x8f04('0x52')])){manager[_0x8f04('0x53')](_0x1efd83,_0x1dbf53[_0x1efd83][_0x8f04('0x4c')],handleJob(_0x1dbf53[_0x1efd83]));logger[_0x8f04('0xc')](_0x8f04('0x54'),_0x1dbf53[_0x1efd83][_0x8f04('0x12')],_0x1dbf53[_0x1efd83][_0x8f04('0x4c')]);}else{manager[_0x8f04('0x43')](_0x1efd83);manager[_0x8f04('0x44')](_0x1efd83);logger[_0x8f04('0xc')](_0x8f04('0x51'),_0x1dbf53[_0x1efd83]['name'],_0x1dbf53[_0x1efd83]['cron']);}}}})[_0x8f04('0x2e')](function(_0x396fb1){logger[_0x8f04('0x2b')](JSON[_0x8f04('0x30')](_0x396fb1));});}exports['run']=function(_0x299e41){return getJobs(_0x299e41);};exports[_0x8f04('0x50')]=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 6009d0f..e448cbd 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 _0xe1e3=['tempSentiment','ValidationError','sentiment','sentimentAccountId','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','then','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','data2','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Positive','Neutral','catch','name','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','findOne','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','push','lodash','aws-sdk','util','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated'];(function(_0x472516,_0x507cad){var _0x3819c0=function(_0x6482e5){while(--_0x6482e5){_0x472516['push'](_0x472516['shift']());}};_0x3819c0(++_0x507cad);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x442958,_0x3025f1){_0x442958=_0x442958-0x0;var _0x171591=_0xe1e3[_0x442958];return _0x171591;};var _=require(_0x3e1e('0x0'));var AWS=require(_0x3e1e('0x1'));var rp=require('request-promise');var util=require(_0x3e1e('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x3e1e('0x3'))('transcribe');function getTranscriptionJob(_0x3bacc,_0x5a11ef,_0x1abd25,_0x397376){return new Promise(function(_0x40d6d8,_0x25701f){var _0x55cfba=new AWS[(_0x3e1e('0x4'))]({'accessKeyId':_0x5a11ef,'secretAccessKey':_0x3bacc,'region':_0x1abd25});_0x55cfba[_0x3e1e('0x5')]({'TranscriptionJobName':_0x397376},function(_0x2f0e12,_0xa67e35){if(_0x2f0e12){return _0x25701f(_0x2f0e12);}else{return _0x40d6d8(_0xa67e35);}});});}function sentiment(_0x3f085b,_0x1e5173,_0x5e7d1f,_0x5c4c25,_0x5060e8){return new Promise(function(_0x31d205,_0x5b0df8){var _0x349460=new AWS[(_0x3e1e('0x6'))]({'accessKeyId':_0x1e5173,'secretAccessKey':_0x3f085b,'region':_0x5e7d1f});_0x349460[_0x3e1e('0x7')]({'Text':_0x5c4c25,'LanguageCode':_0x5060e8['substring'](0x0,0x2)},function(_0x4bf92d,_0x4e6eee){if(_0x4bf92d){return _0x5b0df8(_0x4bf92d);}else{return _0x31d205(_0x4e6eee);}});});}function checkTranscribeJob(_0x4fcd4f,_0x4e47b9,_0x536129){var _0x5c09a2;return new BPromise(function(_0x14ad58,_0x595660){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x9'),_0x4fcd4f['id'],_0x4fcd4f[_0x3e1e('0xa')]));return getTranscriptionJob(_0x536129['data1'],_0x536129['data2'],_0x4e47b9[_0x3e1e('0xb')],_0x4fcd4f[_0x3e1e('0xa')])['then'](function(_0x26cb35){logger[_0x3e1e('0xc')](util['format'](_0x3e1e('0xd'),_0x4fcd4f['id'],_0x4fcd4f['transcribeName'],_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0xf')]));if(!_0x4fcd4f[_0x3e1e('0x10')]){switch(_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0xf')]){case _0x3e1e('0x11'):var _0x569f49={'transcribeStatus':_0x26cb35['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x12')][_0x3e1e('0x13')]};logger['info'](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x4fcd4f['id']));return rp({'uri':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x12')][_0x3e1e('0x13')],'json':!![]})['then'](function(_0x53e051){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4fcd4f['id']));if(_0x53e051&&_0x53e051['results']&&_0x53e051[_0x3e1e('0x14')][_0x3e1e('0x15')]&&_0x53e051['results'][_0x3e1e('0x15')][_0x3e1e('0x16')]){_0x569f49[_0x3e1e('0x10')]='';for(var _0x33bf0f=0x0;_0x33bf0f<_0x53e051[_0x3e1e('0x14')][_0x3e1e('0x15')][_0x3e1e('0x16')];_0x33bf0f++){_0x569f49[_0x3e1e('0x10')]+=_0x53e051['results']['transcripts'][_0x33bf0f][_0x3e1e('0x17')]+'';}}return _0x4fcd4f[_0x3e1e('0x18')](_0x569f49);})['then'](function(){logger['info'](util['format'](_0x3e1e('0x19'),_0x4fcd4f['id']));if(!_0x4fcd4f[_0x3e1e('0x1a')]){throw new db['Sequelize'][(_0x3e1e('0x1b'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4e47b9[_0x3e1e('0x1c')]||!_0x4e47b9[_0x3e1e('0x1d')]||!_0x4e47b9['sentimentRegion']||!_0x4e47b9[_0x3e1e('0x1e')]||!_0x4e47b9[_0x3e1e('0x1f')]){throw new db[(_0x3e1e('0x20'))]['ValidationError'](_0x3e1e('0x21'));}if(!_0x569f49['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x4e47b9['sentimentAccountId']===_0x536129['id']){return _0x536129;}else{return db[_0x3e1e('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3e1e('0x23')](function(_0x468336){if(!_0x468336){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x24'));}if(!_0x468336['data1']||!_0x468336['data2']){throw new db['Sequelize']['ValidationError'](_0x3e1e('0x25'));}_0x5c09a2=_0x468336;logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x26'),_0x4fcd4f['id']));return sentiment(_0x5c09a2[_0x3e1e('0x27')],_0x5c09a2[_0x3e1e('0x28')],_0x4e47b9[_0x3e1e('0x29')],_0x569f49[_0x3e1e('0x10')],_0x4e47b9['language']);})[_0x3e1e('0x23')](function(_0x348ef5){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x2a'),_0x4fcd4f['id']));return _0x4fcd4f[_0x3e1e('0x18')]({'sentiment':_0x348ef5[_0x3e1e('0x2b')],'sPositive':_0x348ef5['SentimentScore']['Positive'],'sNegative':_0x348ef5[_0x3e1e('0x2c')][_0x3e1e('0x2d')],'sMixed':_0x348ef5['SentimentScore'][_0x3e1e('0x2e')],'sNeutral':_0x348ef5[_0x3e1e('0x2c')]['Neutral']});})[_0x3e1e('0x23')](function(){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});case _0x3e1e('0x2f'):return _0x4fcd4f['update']({'transcribeStatus':_0x3e1e('0x2f'),'failureReason':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x30')]})[_0x3e1e('0x23')](function(){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});default:logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x31'),_0x4fcd4f['id']));break;}}else{return BPromise[_0x3e1e('0x32')]()[_0x3e1e('0x23')](function(){if(!_0x4fcd4f['tempSentiment']){throw new db[(_0x3e1e('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4e47b9[_0x3e1e('0x1c')]||!_0x4e47b9[_0x3e1e('0x1d')]||!_0x4e47b9[_0x3e1e('0x29')]||!_0x4e47b9['language']||!_0x4e47b9[_0x3e1e('0x1f')]){throw new db[(_0x3e1e('0x20'))]['ValidationError'](_0x3e1e('0x21'));}if(!_0x4fcd4f[_0x3e1e('0x10')]){throw new Error('Transcript\x20not\x20available');}if(_0x4e47b9['sentimentAccountId']===_0x536129['id']){return _0x536129;}else{return db[_0x3e1e('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3e1e('0x23')](function(_0x3d4a8d){if(!_0x3d4a8d){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x24'));}if(!_0x3d4a8d['data1']||!_0x3d4a8d['data2']){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x25'));}_0x5c09a2=_0x3d4a8d;logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x26'),_0x4fcd4f['id']));return sentiment(_0x5c09a2[_0x3e1e('0x27')],_0x5c09a2['data2'],_0x4e47b9[_0x3e1e('0x29')],_0x4fcd4f['fileText'],_0x4e47b9['language']);})[_0x3e1e('0x23')](function(_0x9053cd){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4fcd4f['id']));return _0x4fcd4f['update']({'sentiment':_0x9053cd['Sentiment'],'sPositive':_0x9053cd['SentimentScore'][_0x3e1e('0x33')],'sNegative':_0x9053cd[_0x3e1e('0x2c')]['Negative'],'sMixed':_0x9053cd['SentimentScore'][_0x3e1e('0x2e')],'sNeutral':_0x9053cd[_0x3e1e('0x2c')][_0x3e1e('0x34')],'transcribeStatus':'COMPLETED'});})[_0x3e1e('0x23')](function(){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});}})[_0x3e1e('0x35')](function(_0xb03215){if(_0xb03215){if(!_0xb03215[_0x3e1e('0x36')]||_0xb03215[_0x3e1e('0x36')]!=='SequelizeValidationError'){logger[_0x3e1e('0x37')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4fcd4f['id']),util[_0x3e1e('0x38')](_0xb03215,{'showHidden':![],'depth':null}));}}_0x14ad58();});});}function checkTranscribe(){var _0x24d320;var _0x551573;var _0x1cc820;return db[_0x3e1e('0x39')][_0x3e1e('0x3a')]({'where':{'transcribeStatus':_0x3e1e('0x3b')}})['then'](function(_0x108b79){if(!_0x108b79||!_0x108b79[_0x3e1e('0x16')]){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))]('No\x20transcribe\x20job\x20to\x20check');}_0x24d320=_0x108b79;return db[_0x3e1e('0x3c')][_0x3e1e('0x3d')]({'where':{'id':0x1}});})[_0x3e1e('0x23')](function(_0x25ddf7){if(!_0x25ddf7){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x3e'));}_0x551573=_0x25ddf7;if(!_0x551573[_0x3e1e('0x3f')]||!_0x551573['transcribeAccountId']||!_0x551573[_0x3e1e('0xb')]||!_0x551573['language']||!_0x551573['bucket']){throw new db['Sequelize'][(_0x3e1e('0x1b'))](_0x3e1e('0x40'));}return db['CloudProvider'][_0x3e1e('0x3d')]({'where':{'id':_0x551573['transcribeAccountId']}});})['then'](function(_0x3eaf76){if(!_0x3eaf76){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3eaf76[_0x3e1e('0x27')]||!_0x3eaf76[_0x3e1e('0x28')]){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x25'));}_0x1cc820=_0x3eaf76;var _0xe18f8a=[];_0x24d320[_0x3e1e('0x41')](function(_0x5b71a6){_0xe18f8a[_0x3e1e('0x42')](checkTranscribeJob(_0x5b71a6,_0x551573,_0x1cc820));});return BPromise['all'](_0xe18f8a);})[_0x3e1e('0x35')](function(_0x286fef){if(_0x286fef){if(!_0x286fef[_0x3e1e('0x36')]||_0x286fef['name']!=='SequelizeValidationError'){logger[_0x3e1e('0x37')](util[_0x3e1e('0x38')](_0x286fef,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xeb74=['transcribe','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20available','forEach','push','error','inspect','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','getTranscriptionJob','Comprehend','substring','format','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available'];(function(_0x10d58c,_0x39bf44){var _0x505ab7=function(_0x5b9b58){while(--_0x5b9b58){_0x10d58c['push'](_0x10d58c['shift']());}};_0x505ab7(++_0x39bf44);}(_0xeb74,0xe3));var _0x4eb7=function(_0x42a18a,_0x555aaf){_0x42a18a=_0x42a18a-0x0;var _0x2dbd68=_0xeb74[_0x42a18a];return _0x2dbd68;};var _=require(_0x4eb7('0x0'));var AWS=require(_0x4eb7('0x1'));var rp=require(_0x4eb7('0x2'));var util=require(_0x4eb7('0x3'));var BPromise=require(_0x4eb7('0x4'));var db=require(_0x4eb7('0x5'))['db'];var logger=require(_0x4eb7('0x6'))('transcribe');function getTranscriptionJob(_0x35c7ca,_0x1dc8d0,_0x29b666,_0x176f0b){return new Promise(function(_0xa6e086,_0x563d6e){var _0x3986cd=new AWS['TranscribeService']({'accessKeyId':_0x1dc8d0,'secretAccessKey':_0x35c7ca,'region':_0x29b666});_0x3986cd[_0x4eb7('0x7')]({'TranscriptionJobName':_0x176f0b},function(_0x2cffe7,_0x588a1c){if(_0x2cffe7){return _0x563d6e(_0x2cffe7);}else{return _0xa6e086(_0x588a1c);}});});}function sentiment(_0x47a89b,_0xe07330,_0x2f8296,_0x4b3add,_0xa72e98){return new Promise(function(_0x4ff98e,_0x3326cd){var _0x462392=new AWS[(_0x4eb7('0x8'))]({'accessKeyId':_0xe07330,'secretAccessKey':_0x47a89b,'region':_0x2f8296});_0x462392['detectSentiment']({'Text':_0x4b3add,'LanguageCode':_0xa72e98[_0x4eb7('0x9')](0x0,0x2)},function(_0x35b880,_0x3c0e15){if(_0x35b880){return _0x3326cd(_0x35b880);}else{return _0x4ff98e(_0x3c0e15);}});});}function checkTranscribeJob(_0x3273b1,_0x35fa89,_0x4194e1){var _0x3c9f45;return new BPromise(function(_0x4c27a4,_0x4c33a9){logger['info'](util[_0x4eb7('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3273b1['id'],_0x3273b1[_0x4eb7('0xb')]));return getTranscriptionJob(_0x4194e1[_0x4eb7('0xc')],_0x4194e1[_0x4eb7('0xd')],_0x35fa89[_0x4eb7('0xe')],_0x3273b1[_0x4eb7('0xb')])[_0x4eb7('0xf')](function(_0x11674f){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x11'),_0x3273b1['id'],_0x3273b1['transcribeName'],_0x11674f[_0x4eb7('0x12')][_0x4eb7('0x13')]));if(!_0x3273b1[_0x4eb7('0x14')]){switch(_0x11674f[_0x4eb7('0x12')][_0x4eb7('0x13')]){case _0x4eb7('0x15'):var _0x2d0ea7={'transcribeStatus':_0x11674f[_0x4eb7('0x12')]['TranscriptionJobStatus'],'fileUri':_0x11674f[_0x4eb7('0x12')][_0x4eb7('0x16')][_0x4eb7('0x17')]};logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x18'),_0x3273b1['id']));return rp({'uri':_0x11674f[_0x4eb7('0x12')]['Transcript'][_0x4eb7('0x17')],'json':!![]})[_0x4eb7('0xf')](function(_0x4783b1){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x19'),_0x3273b1['id']));if(_0x4783b1&&_0x4783b1[_0x4eb7('0x1a')]&&_0x4783b1[_0x4eb7('0x1a')][_0x4eb7('0x1b')]&&_0x4783b1[_0x4eb7('0x1a')]['transcripts'][_0x4eb7('0x1c')]){_0x2d0ea7[_0x4eb7('0x14')]='';for(var _0x2e8de8=0x0;_0x2e8de8<_0x4783b1[_0x4eb7('0x1a')][_0x4eb7('0x1b')][_0x4eb7('0x1c')];_0x2e8de8++){_0x2d0ea7[_0x4eb7('0x14')]+=_0x4783b1[_0x4eb7('0x1a')][_0x4eb7('0x1b')][_0x2e8de8][_0x4eb7('0x1d')]+'';}}return _0x3273b1[_0x4eb7('0x1e')](_0x2d0ea7);})[_0x4eb7('0xf')](function(){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));if(!_0x3273b1[_0x4eb7('0x20')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x23'));}if(!_0x35fa89[_0x4eb7('0x24')]||!_0x35fa89[_0x4eb7('0x25')]||!_0x35fa89[_0x4eb7('0x26')]||!_0x35fa89[_0x4eb7('0x27')]||!_0x35fa89['bucket']){throw new db[(_0x4eb7('0x21'))]['ValidationError'](_0x4eb7('0x28'));}if(!_0x2d0ea7[_0x4eb7('0x14')]){throw new Error(_0x4eb7('0x29'));}if(_0x35fa89[_0x4eb7('0x25')]===_0x4194e1['id']){return _0x4194e1;}else{return db[_0x4eb7('0x2a')][_0x4eb7('0x2b')]({'where':{'id':_settings[_0x4eb7('0x25')]}});}})[_0x4eb7('0xf')](function(_0x264c0b){if(!_0x264c0b){throw new db['Sequelize'][(_0x4eb7('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x264c0b[_0x4eb7('0xc')]||!_0x264c0b[_0x4eb7('0xd')]){throw new db['Sequelize']['ValidationError'](_0x4eb7('0x2c'));}_0x3c9f45=_0x264c0b;logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x2d'),_0x3273b1['id']));return sentiment(_0x3c9f45['data1'],_0x3c9f45[_0x4eb7('0xd')],_0x35fa89[_0x4eb7('0x26')],_0x2d0ea7[_0x4eb7('0x14')],_0x35fa89[_0x4eb7('0x27')]);})[_0x4eb7('0xf')](function(_0x5ab58d){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x2e'),_0x3273b1['id']));return _0x3273b1['update']({'sentiment':_0x5ab58d[_0x4eb7('0x2f')],'sPositive':_0x5ab58d[_0x4eb7('0x30')][_0x4eb7('0x31')],'sNegative':_0x5ab58d['SentimentScore'][_0x4eb7('0x32')],'sMixed':_0x5ab58d['SentimentScore'][_0x4eb7('0x33')],'sNeutral':_0x5ab58d[_0x4eb7('0x30')][_0x4eb7('0x34')]});})[_0x4eb7('0xf')](function(){logger['info'](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));_0x4c27a4();});case _0x4eb7('0x35'):return _0x3273b1[_0x4eb7('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x11674f['TranscriptionJob']['FailureReason']})[_0x4eb7('0xf')](function(){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));_0x4c27a4();});default:logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x36'),_0x3273b1['id']));break;}}else{return BPromise[_0x4eb7('0x37')]()[_0x4eb7('0xf')](function(){if(!_0x3273b1[_0x4eb7('0x20')]){throw new db['Sequelize'][(_0x4eb7('0x22'))](_0x4eb7('0x23'));}if(!_0x35fa89[_0x4eb7('0x24')]||!_0x35fa89[_0x4eb7('0x25')]||!_0x35fa89[_0x4eb7('0x26')]||!_0x35fa89[_0x4eb7('0x27')]||!_0x35fa89[_0x4eb7('0x38')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x28'));}if(!_0x3273b1[_0x4eb7('0x14')]){throw new Error(_0x4eb7('0x29'));}if(_0x35fa89[_0x4eb7('0x25')]===_0x4194e1['id']){return _0x4194e1;}else{return db[_0x4eb7('0x2a')][_0x4eb7('0x2b')]({'where':{'id':_settings[_0x4eb7('0x25')]}});}})[_0x4eb7('0xf')](function(_0xc302ac){if(!_0xc302ac){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0xc302ac[_0x4eb7('0xc')]||!_0xc302ac[_0x4eb7('0xd')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x2c'));}_0x3c9f45=_0xc302ac;logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x2d'),_0x3273b1['id']));return sentiment(_0x3c9f45[_0x4eb7('0xc')],_0x3c9f45['data2'],_0x35fa89[_0x4eb7('0x26')],_0x3273b1['fileText'],_0x35fa89[_0x4eb7('0x27')]);})[_0x4eb7('0xf')](function(_0x146647){logger['info'](util[_0x4eb7('0xa')](_0x4eb7('0x2e'),_0x3273b1['id']));return _0x3273b1[_0x4eb7('0x1e')]({'sentiment':_0x146647[_0x4eb7('0x2f')],'sPositive':_0x146647['SentimentScore'][_0x4eb7('0x31')],'sNegative':_0x146647['SentimentScore'][_0x4eb7('0x32')],'sMixed':_0x146647[_0x4eb7('0x30')][_0x4eb7('0x33')],'sNeutral':_0x146647[_0x4eb7('0x30')][_0x4eb7('0x34')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x4eb7('0x10')](util[_0x4eb7('0xa')](_0x4eb7('0x1f'),_0x3273b1['id']));_0x4c27a4();});}})[_0x4eb7('0x39')](function(_0x6f634d){if(_0x6f634d){if(!_0x6f634d['name']||_0x6f634d[_0x4eb7('0x3a')]!==_0x4eb7('0x3b')){logger['error'](util[_0x4eb7('0xa')](_0x4eb7('0x3c'),_0x3273b1['id']),util['inspect'](_0x6f634d,{'showHidden':![],'depth':null}));}}_0x4c27a4();});});}function checkTranscribe(){var _0x30f19c;var _0x9db987;var _0x3c8049;return db['VoiceRecording'][_0x4eb7('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x28320b){if(!_0x28320b||!_0x28320b[_0x4eb7('0x1c')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x3e'));}_0x30f19c=_0x28320b;return db[_0x4eb7('0x3f')][_0x4eb7('0x2b')]({'where':{'id':0x1}});})[_0x4eb7('0xf')](function(_0x2913c5){if(!_0x2913c5){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x40'));}_0x9db987=_0x2913c5;if(!_0x9db987[_0x4eb7('0x41')]||!_0x9db987[_0x4eb7('0x42')]||!_0x9db987[_0x4eb7('0xe')]||!_0x9db987[_0x4eb7('0x27')]||!_0x9db987[_0x4eb7('0x38')]){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x43'));}return db['CloudProvider'][_0x4eb7('0x2b')]({'where':{'id':_0x9db987['transcribeAccountId']}});})['then'](function(_0x3f3a5f){if(!_0x3f3a5f){throw new db[(_0x4eb7('0x21'))][(_0x4eb7('0x22'))](_0x4eb7('0x44'));}if(!_0x3f3a5f[_0x4eb7('0xc')]||!_0x3f3a5f['data2']){throw new db['Sequelize'][(_0x4eb7('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x3c8049=_0x3f3a5f;var _0x2f68a8=[];_0x30f19c[_0x4eb7('0x45')](function(_0x1e2098){_0x2f68a8[_0x4eb7('0x46')](checkTranscribeJob(_0x1e2098,_0x9db987,_0x3c8049));});return BPromise['all'](_0x2f68a8);})[_0x4eb7('0x39')](function(_0x29eccb){if(_0x29eccb){if(!_0x29eccb[_0x4eb7('0x3a')]||_0x29eccb[_0x4eb7('0x3a')]!=='SequelizeValidationError'){logger[_0x4eb7('0x47')](util[_0x4eb7('0x48')](_0x29eccb,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 27150cc..e588dcd 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 _0xa2df=['timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','inspect','start','lodash','moment','ioredis','util','../logger','redis','defaults','localhost','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update'];(function(_0x11b6ff,_0x35df5e){var _0x487416=function(_0x3deb3b){while(--_0x3deb3b){_0x11b6ff['push'](_0x11b6ff['shift']());}};_0x487416(++_0x35df5e);}(_0xa2df,0xf1));var _0xfa2d=function(_0x3b02de,_0x1a3a5e){_0x3b02de=_0x3b02de-0x0;var _0x58d955=_0xa2df[_0x3b02de];return _0x58d955;};'use strict';var _=require(_0xfa2d('0x0'));var moment=require(_0xfa2d('0x1'));var Redis=require(_0xfa2d('0x2'));var util=require(_0xfa2d('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xfa2d('0x4'))('schedule');config[_0xfa2d('0x5')]=_[_0xfa2d('0x6')](config[_0xfa2d('0x5')],{'host':_0xfa2d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfa2d('0x5')]));function closeInteractions(){var _0x18d204=[];return db[_0xfa2d('0x8')]['findAll']({'raw':!![],'attributes':['id',_0xfa2d('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfa2d('0xa')](0x18,_0xfa2d('0xb'))}}})[_0xfa2d('0xc')](function(_0xfbd0b4){if(_0xfbd0b4&&_0xfbd0b4[_0xfa2d('0xd')]){_0x18d204=_[_0xfa2d('0xe')](_0xfbd0b4||[],'id');logger[_0xfa2d('0xf')](_0xfa2d('0x10'),_0x18d204[_0xfa2d('0x11')]());return db[_0xfa2d('0x8')][_0xfa2d('0x12')]({'closeReason':'system','disposition':_0xfa2d('0x13'),'closed':!![],'closedAt':moment()['format'](_0xfa2d('0x14'))},{'where':{'id':_0x18d204}});}})[_0xfa2d('0xc')](function(){if(_0x18d204&&_0x18d204[_0xfa2d('0xd')]){logger[_0xfa2d('0xf')](_0xfa2d('0x15'),_0x18d204[_0xfa2d('0x11')]());for(var _0x16c48f=0x0;_0x16c48f<_0x18d204[_0xfa2d('0xd')];_0x16c48f++){io[_0xfa2d('0x16')](_0xfa2d('0x17'),{'id':_0x18d204[_0x16c48f],'closed':!![]});}}})['catch'](function(_0x43b4ab){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x43b4ab?util[_0xfa2d('0x18')](_0x43b4ab,{'showHidden':![],'depth':null}):'');});}exports[_0xfa2d('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0741=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0741,0x1bc));var _0x1074=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x0741[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0x1074('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x1074('0x1'));var config=require(_0x1074('0x2'));var db=require(_0x1074('0x3'))['db'];var logger=require('../logger')(_0x1074('0x4'));config[_0x1074('0x5')]=_['defaults'](config[_0x1074('0x5')],{'host':_0x1074('0x6'),'port':0x18eb});var io=require(_0x1074('0x7'))(new Redis(config[_0x1074('0x5')]));function closeInteractions(){var _0x554976=[];return db[_0x1074('0x8')][_0x1074('0x9')]({'raw':!![],'attributes':['id',_0x1074('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1074('0xb')](0x18,'hours')}}})[_0x1074('0xc')](function(_0x33fe77){if(_0x33fe77&&_0x33fe77[_0x1074('0xd')]){_0x554976=_[_0x1074('0xe')](_0x33fe77||[],'id');logger[_0x1074('0xf')](_0x1074('0x10'),_0x554976['join']());return db['WhatsappInteraction'][_0x1074('0x11')]({'closeReason':_0x1074('0x12'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x1074('0x13'))},{'where':{'id':_0x554976}});}})[_0x1074('0xc')](function(){if(_0x554976&&_0x554976[_0x1074('0xd')]){logger[_0x1074('0xf')](_0x1074('0x14'),_0x554976['join']());for(var _0x3859bd=0x0;_0x3859bd<_0x554976[_0x1074('0xd')];_0x3859bd++){io[_0x1074('0x15')]('whatsappInteraction:update',{'id':_0x554976[_0x3859bd],'closed':!![]});}}})[_0x1074('0x16')](function(_0x413a85){logger[_0x1074('0x17')](_0x1074('0x18'),_0x413a85?util[_0x1074('0x19')](_0x413a85,{'showHidden':![],'depth':null}):'');});}exports[_0x1074('0x1a')]=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 a8f3b8e..18c079c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54aa=['hopper1','CmContact','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper'];(function(_0x32b34a,_0x3cd108){var _0x107732=function(_0x449e68){while(--_0x449e68){_0x32b34a['push'](_0x32b34a['shift']());}};_0x107732(++_0x3cd108);}(_0x54aa,0x193));var _0xa54a=function(_0x573a97,_0x525306){_0x573a97=_0x573a97-0x0;var _0x1e9173=_0x54aa[_0x573a97];return _0x1e9173;};'use strict';var util=require(_0xa54a('0x0'));var db=require(_0xa54a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa54a('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xa54a('0x3')+i,'phone':0xf879fb460+i,'email':_0xa54a('0x4')+i+_0xa54a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa54a('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa54a('0x6')](),'updatedAt':Date[_0xa54a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa54a('0x2')]({'id':i,'firstName':_0xa54a('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xa54a('0x4')+i+_0xa54a('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xa54a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa54a('0x6')](),'updatedAt':Date[_0xa54a('0x6')]()});}db['CmContact'][_0xa54a('0x8')]({'where':{}})[_0xa54a('0x9')](function(){return db['CmContact'][_0xa54a('0xa')](contacts);})[_0xa54a('0x9')](function(){console[_0xa54a('0xb')](_0xa54a('0xc'),_0xa54a('0xd'));return db['CmHopper'][_0xa54a('0x8')]({'where':{}});})[_0xa54a('0x9')](function(){return db[_0xa54a('0xe')]['bulkCreate'](hopper);})['then'](function(){console[_0xa54a('0xb')](_0xa54a('0xc'),_0xa54a('0xf'));return db[_0xa54a('0x10')][_0xa54a('0xa')](contacts2);})[_0xa54a('0x9')](function(){console[_0xa54a('0xb')](_0xa54a('0xc'),_0xa54a('0x11'));return db[_0xa54a('0xe')][_0xa54a('0xa')](hopper2);})['then'](function(){console[_0xa54a('0xb')](_0xa54a('0xc'),_0xa54a('0x12'));})['catch'](function(_0x5223be){console[_0xa54a('0xb')](_0x5223be);}); \ No newline at end of file +var _0xb2e7=['catch','Innocenzo','Biondo','@xcally.com','push','now','innocenzo.biondo','destroy','then','CmContact','log','finished\x20populating','CmHopper','hopper1','bulkCreate','contacts2','hopper2'];(function(_0xbb345,_0x33f5d0){var _0x3362f8=function(_0x3df4cd){while(--_0x3df4cd){_0xbb345['push'](_0xbb345['shift']());}};_0x3362f8(++_0x33f5d0);}(_0xb2e7,0x122));var _0x7b2e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb2e7[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x7b2e('0x0')+i,'lastName':_0x7b2e('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x7b2e('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7b2e('0x3')]({'id':i,'active':![],'scheduledat':Date[_0x7b2e('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7b2e('0x3')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x7b2e('0x1')+i,'phone':0xf879fb460+i,'email':_0x7b2e('0x5')+i+_0x7b2e('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7b2e('0x3')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7b2e('0x4')](),'updatedAt':Date['now']()});}db['CmContact'][_0x7b2e('0x6')]({'where':{}})[_0x7b2e('0x7')](function(){return db[_0x7b2e('0x8')]['bulkCreate'](contacts);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')](_0x7b2e('0xa'),'contacts1');return db['CmHopper'][_0x7b2e('0x6')]({'where':{}});})[_0x7b2e('0x7')](function(){return db[_0x7b2e('0xb')]['bulkCreate'](hopper);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')](_0x7b2e('0xa'),_0x7b2e('0xc'));return db[_0x7b2e('0x8')][_0x7b2e('0xd')](contacts2);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')](_0x7b2e('0xa'),_0x7b2e('0xe'));return db['CmHopper'][_0x7b2e('0xd')](hopper2);})[_0x7b2e('0x7')](function(){console[_0x7b2e('0x9')]('finished\x20populating',_0x7b2e('0xf'));})[_0x7b2e('0x10')](function(_0x2813cc){console['log'](_0x2813cc);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index bee7e85..708ef2d 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77d7=['format','%s%s@xcally.com','password','friend','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','log','util','push','%s%s','agent'];(function(_0x3f859b,_0x244c7e){var _0xd1469a=function(_0x40103c){while(--_0x40103c){_0x3f859b['push'](_0x3f859b['shift']());}};_0xd1469a(++_0x244c7e);}(_0x77d7,0x104));var _0x777d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x77d7[_0x432682];return _0x463d05;};'use strict';var util=require(_0x777d('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x777d('0x1')]({'name':util['format'](_0x777d('0x2'),_0x777d('0x3'),i),'fullname':util[_0x777d('0x4')](_0x777d('0x2'),_0x777d('0x3'),i),'email':util[_0x777d('0x4')](_0x777d('0x5'),'agent',i),'role':'agent','password':_0x777d('0x6'),'internal':0xfa0+i,'type':_0x777d('0x7'),'transport':['udp','ws',_0x777d('0x8')],'disallow':[_0x777d('0x9')],'allow':[_0x777d('0xa')],'defaultuser':util[_0x777d('0x4')](_0x777d('0x2'),'agent',i),'encryption':_0x777d('0xb'),'avpf':_0x777d('0xb'),'force_avp':_0x777d('0xb'),'icesupport':'yes','dtlsenable':_0x777d('0xb'),'dtlsverify':'no','dtlscertfile':_0x777d('0xc'),'dtlsprivatekey':_0x777d('0xd'),'dtlssetup':_0x777d('0xe'),'callerid':util['format'](_0x777d('0xf'),util[_0x777d('0x4')](_0x777d('0x2'),_0x777d('0x3'),i),0xfa0+i)});}db[_0x777d('0x10')][_0x777d('0x11')](users)[_0x777d('0x12')](function(){console['log'](_0x777d('0x13'));})[_0x777d('0x14')](function(_0xda96f){console[_0x777d('0x15')](_0xda96f);}); \ No newline at end of file +var _0x7f9c=['log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x7f9c,0x7b));var _0xc7f9=function(_0x321bdf,_0x524ae5){_0x321bdf=_0x321bdf-0x0;var _0x271a7b=_0x7f9c[_0x321bdf];return _0x271a7b;};'use strict';var util=require(_0xc7f9('0x0'));var db=require(_0xc7f9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc7f9('0x2')]({'name':util['format'](_0xc7f9('0x3'),_0xc7f9('0x4'),i),'fullname':util[_0xc7f9('0x5')](_0xc7f9('0x3'),_0xc7f9('0x4'),i),'email':util[_0xc7f9('0x5')](_0xc7f9('0x6'),_0xc7f9('0x4'),i),'role':_0xc7f9('0x4'),'password':_0xc7f9('0x7'),'internal':0xfa0+i,'type':_0xc7f9('0x8'),'transport':[_0xc7f9('0x9'),'ws',_0xc7f9('0xa')],'disallow':['all'],'allow':[_0xc7f9('0xb')],'defaultuser':util[_0xc7f9('0x5')](_0xc7f9('0x3'),_0xc7f9('0x4'),i),'encryption':_0xc7f9('0xc'),'avpf':'yes','force_avp':_0xc7f9('0xc'),'icesupport':_0xc7f9('0xc'),'dtlsenable':_0xc7f9('0xc'),'dtlsverify':'no','dtlscertfile':_0xc7f9('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xc7f9('0xe'),'callerid':util[_0xc7f9('0x5')](_0xc7f9('0xf'),util['format'](_0xc7f9('0x3'),'agent',i),0xfa0+i)});}db[_0xc7f9('0x10')]['bulkCreate'](users)['then'](function(){console[_0xc7f9('0x11')](_0xc7f9('0x12'));})[_0xc7f9('0x13')](function(_0x3e7d86){console[_0xc7f9('0x11')](_0x3e7d86);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 14b7a9c..634f6f0 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc022=['user:%s','userProfileId','handshake','query','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','user','VoiceQueues','VoiceQueue','ChatQueues','SmsQueue','MailQueues','WhatsappQueue','Trunk','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','User','where','role','Campaign','format','length'];(function(_0x17de72,_0x3981ec){var _0x3ecb59=function(_0x25c146){while(--_0x25c146){_0x17de72['push'](_0x17de72['shift']());}};_0x3ecb59(++_0x3981ec);}(_0xc022,0x173));var _0x2c02=function(_0x3e4566,_0x1e02e2){_0x3e4566=_0x3e4566-0x0;var _0x2eb60f=_0xc022[_0x3e4566];return _0x2eb60f;};'use strict';var _=require('lodash');var util=require(_0x2c02('0x0'));var BPromise=require(_0x2c02('0x1'));var db=require(_0x2c02('0x2'))['db'];var config=require(_0x2c02('0x3'));var queryQueues={'attributes':['id',_0x2c02('0x4')],'include':[{'as':_0x2c02('0x5'),'model':db['User'],'attributes':['id',_0x2c02('0x4'),'role'],'raw':!![],'where':{'role':_0x2c02('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x2c02('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2c02('0x4'),_0x2c02('0x7')],'where':{'type':_0x2c02('0x8')}};function getAssociatedResources(_0x284007,_0x5e5077,_0x82145e){return db[_0x2c02('0x9')][_0x2c02('0xa')]({'where':{'name':_0x284007,'userProfileId':_0x5e5077},'raw':!![]})[_0x2c02('0xb')](function(_0x514f6a){if(_0x514f6a){if(_0x514f6a[_0x2c02('0xc')]){switch(_0x284007){case'VoiceQueues':case'ChatQueues':case _0x2c02('0xd'):case _0x2c02('0xe'):case'MailQueues':case _0x2c02('0xf'):case _0x2c02('0x10'):return db[_0x82145e][_0x2c02('0x11')](queryQueues);case _0x2c02('0x12'):return db[_0x82145e][_0x2c02('0x11')](queryTelephones);case _0x2c02('0x13'):return db[_0x82145e][_0x2c02('0x11')](queryTrunks);case'IvrCampaigns':return db[_0x82145e][_0x2c02('0x11')](queryCampaigns);}}else{return db[_0x2c02('0x14')][_0x2c02('0x11')]({'attributes':[_0x2c02('0x15')],'where':{'sectionId':_0x514f6a['id']},'raw':!![]})[_0x2c02('0xb')](function(_0x57854f){if(_0x57854f){var _0x9e8ae6={'where':{'id':_[_0x2c02('0x16')](_0x57854f,_0x2c02('0x15'))},'raw':!![]};switch(_0x82145e){case _0x2c02('0x17'):_0x9e8ae6[_0x2c02('0x18')][_0x2c02('0x19')]='telephone';break;case _0x2c02('0x1a'):_0x9e8ae6['where'][_0x2c02('0x7')]=_0x2c02('0x8');break;}return db[_0x82145e]['findAll'](_0x9e8ae6);}else{return[];}});}}else{return[];}})[_0x2c02('0xb')](function(_0x326bf6){return _0x326bf6;});}function joinOrLeaveQueues(_0x41dcec,_0x168aae,_0x253034,_0x4f2f50){_0x41dcec[_0x168aae](util[_0x2c02('0x1b')]('%s:queue:%s',_0x253034,_0x4f2f50[_0x2c02('0x4')]));if(_0x4f2f50[_0x2c02('0x5')]){for(var _0x4ebff=0x0;_0x4ebff<_0x4f2f50[_0x2c02('0x5')][_0x2c02('0x1c')];_0x4ebff+=0x1){_0x41dcec[_0x168aae](util['format'](_0x2c02('0x1d'),_0x4f2f50[_0x2c02('0x5')][_0x4ebff][_0x2c02('0x4')]));}}}function joinOrLeave(_0x45ff30,_0x5c3b9e,_0x4eb454){var _0x4f265f;if(_0x45ff30['handshake']['query']['id']){db[_0x2c02('0x17')]['find']({'attributes':['id',_0x2c02('0x4'),_0x2c02('0x19'),_0x2c02('0x1e')],'where':{'id':_0x45ff30[_0x2c02('0x1f')][_0x2c02('0x20')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x2c02('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x2c02('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x2c02('0x23')],'as':_0x2c02('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x2c02('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x2c02('0x26'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x2c02('0x27'),'attributes':['id'],'raw':!![]}]})[_0x2c02('0xb')](function(_0x54b8c9){if(_0x54b8c9){_0x4f265f=_0x54b8c9;_0x45ff30[_0x5c3b9e](util[_0x2c02('0x1b')](_0x2c02('0x1d'),_0x54b8c9[_0x2c02('0x4')]));var _0x45d2da=[];switch(_0x54b8c9[_0x2c02('0x19')]){case _0x2c02('0x28'):_0x45ff30[_0x5c3b9e](_0x2c02('0x29'));_0x45ff30[_0x5c3b9e](_0x2c02('0x2a'));if(queryQueues[_0x2c02('0x2b')](_0x2c02('0x2c'))){delete queryQueues['include'];}_0x45d2da[_0x2c02('0x2d')](db['VoiceQueue'][_0x2c02('0x11')](queryQueues));_0x45d2da[_0x2c02('0x2d')](db[_0x2c02('0x2e')][_0x2c02('0x11')](queryQueues));_0x45d2da[_0x2c02('0x2d')](db[_0x2c02('0x2f')][_0x2c02('0x11')](queryQueues));_0x45d2da['push'](db['SmsQueue'][_0x2c02('0x11')](queryQueues));_0x45d2da[_0x2c02('0x2d')](db[_0x2c02('0x30')][_0x2c02('0x11')](queryQueues));_0x45d2da[_0x2c02('0x2d')](db[_0x2c02('0x31')]['findAll'](queryQueues));_0x45d2da[_0x2c02('0x2d')](db['WhatsappQueue'][_0x2c02('0x11')](queryQueues));_0x45d2da[_0x2c02('0x2d')](db['User'][_0x2c02('0x11')](queryTelephones));_0x45d2da[_0x2c02('0x2d')](db['Trunk'][_0x2c02('0x11')](queryTrunks));_0x45d2da['push'](db[_0x2c02('0x1a')][_0x2c02('0x11')](queryCampaigns));_0x45d2da[_0x2c02('0x2d')](db[_0x2c02('0x17')][_0x2c02('0x11')](queryAgents));break;case _0x2c02('0x32'):_0x45ff30[_0x5c3b9e](_0x2c02('0x29'));_0x45ff30[_0x5c3b9e]('voice:outbound');_0x45d2da[_0x2c02('0x2d')](getAssociatedResources(_0x2c02('0x33'),_0x54b8c9['userProfileId'],_0x2c02('0x34')));_0x45d2da['push'](getAssociatedResources(_0x2c02('0x35'),_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x2e')));_0x45d2da['push'](getAssociatedResources(_0x2c02('0xd'),_0x54b8c9['userProfileId'],_0x2c02('0x2f')));_0x45d2da[_0x2c02('0x2d')](getAssociatedResources('SmsQueues',_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x36')));_0x45d2da[_0x2c02('0x2d')](getAssociatedResources(_0x2c02('0x37'),_0x54b8c9['userProfileId'],_0x2c02('0x30')));_0x45d2da[_0x2c02('0x2d')](getAssociatedResources(_0x2c02('0xf'),_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x31')));_0x45d2da['push'](getAssociatedResources(_0x2c02('0x10'),_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x38')));_0x45d2da['push'](getAssociatedResources(_0x2c02('0x12'),_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x17')));_0x45d2da['push'](getAssociatedResources(_0x2c02('0x13'),_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x39')));_0x45d2da[_0x2c02('0x2d')](getAssociatedResources(_0x2c02('0x3a'),_0x54b8c9[_0x2c02('0x1e')],_0x2c02('0x1a')));_0x45d2da[_0x2c02('0x2d')](db['User']['findAll'](queryAgents));break;case'agent':_0x45ff30[_0x5c3b9e]('voice:inbound');_0x45ff30[_0x5c3b9e](_0x2c02('0x2a'));_0x45d2da[_0x2c02('0x2d')](_0x54b8c9[_0x2c02('0x3b')]({'attributes':['id',_0x2c02('0x4')]}));_0x45d2da['push'](_0x54b8c9[_0x2c02('0x3c')]({'attributes':['id',_0x2c02('0x4')]}));_0x45d2da['push'](_0x54b8c9[_0x2c02('0x3d')]({'attributes':['id',_0x2c02('0x4')]}));_0x45d2da[_0x2c02('0x2d')](_0x54b8c9[_0x2c02('0x3e')]({'attributes':['id','name']}));_0x45d2da[_0x2c02('0x2d')](_0x54b8c9[_0x2c02('0x3f')]({'attributes':['id','name']}));_0x45d2da[_0x2c02('0x2d')](_0x54b8c9[_0x2c02('0x40')]({'attributes':['id','name']}));_0x45d2da[_0x2c02('0x2d')](_0x54b8c9['getWhatsappQueues']({'attributes':['id',_0x2c02('0x4')]}));break;}return BPromise[_0x2c02('0x41')](_0x45d2da);}})[_0x2c02('0xb')](function(_0x35b953){if(_0x35b953&&_0x35b953[_0x2c02('0x1c')]){for(var _0x27753e=0x0;_0x27753e<_0x35b953[_0x2c02('0x1c')];_0x27753e+=0x1){for(var _0x568207=0x0;_0x568207<_0x35b953[_0x27753e]['length'];_0x568207+=0x1){switch(_0x27753e){case 0x0:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,_0x2c02('0x42'),_0x35b953[_0x27753e][_0x568207]);break;case 0x1:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,_0x2c02('0x43'),_0x35b953[_0x27753e][_0x568207]);break;case 0x2:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,_0x2c02('0x44'),_0x35b953[_0x27753e][_0x568207]);break;case 0x3:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,_0x2c02('0x45'),_0x35b953[_0x27753e][_0x568207]);break;case 0x4:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,'mail',_0x35b953[_0x27753e][_0x568207]);break;case 0x5:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,_0x2c02('0x46'),_0x35b953[_0x27753e][_0x568207]);break;case 0x6:joinOrLeaveQueues(_0x45ff30,_0x5c3b9e,'whatsapp',_0x35b953[_0x27753e][_0x568207]);break;case 0x7:if(_0x4f265f[_0x2c02('0x19')]!=='agent')_0x45ff30[_0x5c3b9e](util[_0x2c02('0x1b')](_0x2c02('0x47'),_0x35b953[_0x27753e][_0x568207]['name']));break;case 0x8:if(_0x4f265f[_0x2c02('0x19')]!=='agent')_0x45ff30[_0x5c3b9e](util[_0x2c02('0x1b')](_0x2c02('0x48'),_0x35b953[_0x27753e][_0x568207][_0x2c02('0x4')]));break;case 0x9:if(_0x4f265f[_0x2c02('0x19')]!==_0x2c02('0x6'))_0x45ff30[_0x5c3b9e](util[_0x2c02('0x1b')](_0x2c02('0x49'),_0x35b953[_0x27753e][_0x568207][_0x2c02('0x7')],_0x35b953[_0x27753e][_0x568207][_0x2c02('0x4')]));break;case 0xa:_0x45ff30[_0x5c3b9e](util['format'](_0x2c02('0x1d'),_0x35b953[_0x27753e][_0x568207]['name']));break;}}}}})[_0x2c02('0xb')](function(){if(_0x5c3b9e===_0x2c02('0x4a')){var _0x3d0f14=_['map'](_0x4f265f[_0x2c02('0x21')],'id');return _0x4f265f[_0x2c02('0x4b')](_0x3d0f14)[_0x2c02('0xb')](function(){for(var _0x392fd9=0x0;_0x392fd9<_0x3d0f14[_0x2c02('0x1c')];_0x392fd9+=0x1){_0x4eb454['emit'](_0x2c02('0x4c'),{'ChatInteractionId':Number(_0x3d0f14[_0x392fd9]),'UserId':Number(_0x4f265f['id'])});}});}})[_0x2c02('0xb')](function(){if(_0x5c3b9e===_0x2c02('0x4a')){var _0x2ffccc=_['map'](_0x4f265f[_0x2c02('0x22')],'id');return _0x4f265f[_0x2c02('0x4d')](_0x2ffccc)[_0x2c02('0xb')](function(){for(var _0x431405=0x0;_0x431405<_0x2ffccc[_0x2c02('0x1c')];_0x431405+=0x1){_0x4eb454[_0x2c02('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2ffccc[_0x431405]),'UserId':Number(_0x4f265f['id'])});}});}})[_0x2c02('0xb')](function(){if(_0x5c3b9e===_0x2c02('0x4a')){var _0x53457f=_[_0x2c02('0x16')](_0x4f265f[_0x2c02('0x24')],'id');return _0x4f265f['removeFaxInteractions'](_0x53457f)[_0x2c02('0xb')](function(){for(var _0x3b973f=0x0;_0x3b973f<_0x53457f[_0x2c02('0x1c')];_0x3b973f+=0x1){_0x4eb454['emit'](_0x2c02('0x4f'),{'FaxInteractionId':Number(_0x53457f[_0x3b973f]),'UserId':Number(_0x4f265f['id'])});}});}})[_0x2c02('0xb')](function(){if(_0x5c3b9e==='leave'){var _0x15a1c7=_[_0x2c02('0x16')](_0x4f265f[_0x2c02('0x25')],'id');return _0x4f265f[_0x2c02('0x50')](_0x15a1c7)[_0x2c02('0xb')](function(){for(var _0xb11a4=0x0;_0xb11a4<_0x15a1c7['length'];_0xb11a4+=0x1){_0x4eb454[_0x2c02('0x4e')](_0x2c02('0x51'),{'SmsInteractionId':Number(_0x15a1c7[_0xb11a4]),'UserId':Number(_0x4f265f['id'])});}});}})['then'](function(){if(_0x5c3b9e===_0x2c02('0x4a')){var _0x3866b3=_['map'](_0x4f265f['OpenchannelInteractions'],'id');return _0x4f265f[_0x2c02('0x52')](_0x3866b3)[_0x2c02('0xb')](function(){for(var _0x5a7f20=0x0;_0x5a7f20<_0x3866b3[_0x2c02('0x1c')];_0x5a7f20+=0x1){_0x4eb454[_0x2c02('0x4e')](_0x2c02('0x53'),{'OpenchannelInteractionId':Number(_0x3866b3[_0x5a7f20]),'UserId':Number(_0x4f265f['id'])});}});}})[_0x2c02('0xb')](function(){if(_0x5c3b9e===_0x2c02('0x4a')){var _0x57c962=_[_0x2c02('0x16')](_0x4f265f[_0x2c02('0x27')],'id');return _0x4f265f[_0x2c02('0x54')](_0x57c962)[_0x2c02('0xb')](function(){for(var _0x3ef1dc=0x0;_0x3ef1dc<_0x57c962[_0x2c02('0x1c')];_0x3ef1dc+=0x1){_0x4eb454[_0x2c02('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x57c962[_0x3ef1dc]),'UserId':Number(_0x4f265f['id'])});}});}})[_0x2c02('0x55')](function(_0xfb87c5){_0x45ff30[_0x2c02('0x56')](_0xfb87c5);});}}function onDisconnect(_0x499522,_0x13ab80){joinOrLeave(_0x499522,_0x2c02('0x4a'),_0x13ab80);}function onConnect(_0x2bcd66){joinOrLeave(_0x2bcd66,_0x2c02('0x57'));}exports[_0x2c02('0x58')]=function(_0x18384d){_0x18384d['on']('connection',function(_0x423ba4){_0x423ba4[_0x2c02('0x59')](0x0);_0x423ba4[_0x2c02('0x5a')]=_0x423ba4[_0x2c02('0x5b')][_0x2c02('0x5c')][_0x2c02('0x5d')]+':'+_0x423ba4['request'][_0x2c02('0x5c')][_0x2c02('0x5e')];_0x423ba4[_0x2c02('0x5f')]=new Date();_0x423ba4[_0x2c02('0x56')]=function(_0x5c04b5){console[_0x2c02('0x56')](_0x2c02('0x60')+_0x423ba4[_0x2c02('0x61')][_0x2c02('0x4')]+'['+_0x423ba4['address']+']',_0x5c04b5);};_0x423ba4['on']('disconnect',function(){onDisconnect(_0x423ba4,_0x18384d);_0x423ba4[_0x2c02('0x56')](_0x2c02('0x62'));});onConnect(_0x423ba4);_0x423ba4['log'](_0x2c02('0x63'));});}; \ No newline at end of file +var _0xda34=['chat','fax','sms','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','CONNECTED','bluebird','../mysqldb','name','Agents','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','format','%s:queue:%s','length','handshake','query','User','find','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','userProfileId','FaxQueues','FaxQueue','SmsQueues','MailQueues','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xda34,0x14e));var _0x4da3=function(_0x36bc9a,_0x352b6f){_0x36bc9a=_0x36bc9a-0x0;var _0x4f508=_0xda34[_0x36bc9a];return _0x4f508;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x4da3('0x0'));var db=require(_0x4da3('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x4da3('0x2')],'include':[{'as':_0x4da3('0x3'),'model':db['User'],'attributes':['id','name',_0x4da3('0x4')],'raw':!![],'where':{'role':_0x4da3('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4da3('0x2')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4da3('0x2'),_0x4da3('0x6')],'where':{'type':_0x4da3('0x7')}};function getAssociatedResources(_0x4d3f20,_0x2af5ec,_0x563d8e){return db[_0x4da3('0x8')][_0x4da3('0x9')]({'where':{'name':_0x4d3f20,'userProfileId':_0x2af5ec},'raw':!![]})[_0x4da3('0xa')](function(_0x4e5799){if(_0x4e5799){if(_0x4e5799[_0x4da3('0xb')]){switch(_0x4d3f20){case _0x4da3('0xc'):case _0x4da3('0xd'):case'FaxQueues':case'SmsQueues':case'MailQueues':case _0x4da3('0xe'):case _0x4da3('0xf'):return db[_0x563d8e][_0x4da3('0x10')](queryQueues);case _0x4da3('0x11'):return db[_0x563d8e][_0x4da3('0x10')](queryTelephones);case _0x4da3('0x12'):return db[_0x563d8e][_0x4da3('0x10')](queryTrunks);case _0x4da3('0x13'):return db[_0x563d8e][_0x4da3('0x10')](queryCampaigns);}}else{return db[_0x4da3('0x14')][_0x4da3('0x10')]({'attributes':['resourceId'],'where':{'sectionId':_0x4e5799['id']},'raw':!![]})['then'](function(_0x7503ba){if(_0x7503ba){var _0x330f62={'where':{'id':_[_0x4da3('0x15')](_0x7503ba,_0x4da3('0x16'))},'raw':!![]};switch(_0x563d8e){case'User':_0x330f62[_0x4da3('0x17')][_0x4da3('0x4')]='telephone';break;case'Campaign':_0x330f62[_0x4da3('0x17')][_0x4da3('0x6')]=_0x4da3('0x7');break;}return db[_0x563d8e]['findAll'](_0x330f62);}else{return[];}});}}else{return[];}})[_0x4da3('0xa')](function(_0x30e615){return _0x30e615;});}function joinOrLeaveQueues(_0x439744,_0x27a6dc,_0x158714,_0x4d7ae0){_0x439744[_0x27a6dc](util[_0x4da3('0x18')](_0x4da3('0x19'),_0x158714,_0x4d7ae0['name']));if(_0x4d7ae0['Agents']){for(var _0x2bf45e=0x0;_0x2bf45e<_0x4d7ae0[_0x4da3('0x3')][_0x4da3('0x1a')];_0x2bf45e+=0x1){_0x439744[_0x27a6dc](util[_0x4da3('0x18')]('user:%s',_0x4d7ae0['Agents'][_0x2bf45e]['name']));}}}function joinOrLeave(_0x4a23e2,_0x1699ef,_0xfeff22){var _0x1d7638;if(_0x4a23e2[_0x4da3('0x1b')][_0x4da3('0x1c')]['id']){db[_0x4da3('0x1d')][_0x4da3('0x1e')]({'attributes':['id',_0x4da3('0x2'),'role','userProfileId'],'where':{'id':_0x4a23e2[_0x4da3('0x1b')]['query']['id']},'include':[{'model':db[_0x4da3('0x1f')],'as':_0x4da3('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x22')],'as':_0x4da3('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x24')],'as':_0x4da3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4da3('0x26')],'as':_0x4da3('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x4da3('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xd779f4){if(_0xd779f4){_0x1d7638=_0xd779f4;_0x4a23e2[_0x1699ef](util['format']('user:%s',_0xd779f4[_0x4da3('0x2')]));var _0x1d7643=[];switch(_0xd779f4[_0x4da3('0x4')]){case _0x4da3('0x29'):_0x4a23e2[_0x1699ef]('voice:inbound');_0x4a23e2[_0x1699ef]('voice:outbound');if(queryQueues[_0x4da3('0x2a')](_0x4da3('0x2b'))){delete queryQueues[_0x4da3('0x2b')];}_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x2d')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x2e')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db['FaxQueue'][_0x4da3('0x10')](queryQueues));_0x1d7643['push'](db[_0x4da3('0x2f')]['findAll'](queryQueues));_0x1d7643['push'](db[_0x4da3('0x30')][_0x4da3('0x10')](queryQueues));_0x1d7643['push'](db[_0x4da3('0x31')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x32')][_0x4da3('0x10')](queryQueues));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x1d')][_0x4da3('0x10')](queryTelephones));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x33')]['findAll'](queryTrunks));_0x1d7643['push'](db[_0x4da3('0x34')][_0x4da3('0x10')](queryCampaigns));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x1d')][_0x4da3('0x10')](queryAgents));break;case _0x4da3('0x35'):_0x4a23e2[_0x1699ef]('voice:inbound');_0x4a23e2[_0x1699ef](_0x4da3('0x36'));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources('VoiceQueues',_0xd779f4[_0x4da3('0x37')],_0x4da3('0x2d')));_0x1d7643['push'](getAssociatedResources(_0x4da3('0xd'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x2e')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x38'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x39')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x3a'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x2f')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x3b'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x30')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0xe'),_0xd779f4['userProfileId'],_0x4da3('0x31')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0xf'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x32')));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x11'),_0xd779f4[_0x4da3('0x37')],'User'));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x12'),_0xd779f4[_0x4da3('0x37')],'Trunk'));_0x1d7643[_0x4da3('0x2c')](getAssociatedResources(_0x4da3('0x13'),_0xd779f4[_0x4da3('0x37')],_0x4da3('0x34')));_0x1d7643[_0x4da3('0x2c')](db[_0x4da3('0x1d')]['findAll'](queryAgents));break;case _0x4da3('0x5'):_0x4a23e2[_0x1699ef]('voice:inbound');_0x4a23e2[_0x1699ef](_0x4da3('0x36'));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3c')]({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4['getChatQueues']({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3d')]({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3e')]({'attributes':['id','name']}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x3f')]({'attributes':['id',_0x4da3('0x2')]}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x40')]({'attributes':['id','name']}));_0x1d7643[_0x4da3('0x2c')](_0xd779f4[_0x4da3('0x41')]({'attributes':['id',_0x4da3('0x2')]}));break;}return BPromise['all'](_0x1d7643);}})[_0x4da3('0xa')](function(_0x39454e){if(_0x39454e&&_0x39454e[_0x4da3('0x1a')]){for(var _0x54968e=0x0;_0x54968e<_0x39454e[_0x4da3('0x1a')];_0x54968e+=0x1){for(var _0x7603cf=0x0;_0x7603cf<_0x39454e[_0x54968e][_0x4da3('0x1a')];_0x7603cf+=0x1){switch(_0x54968e){case 0x0:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,'voice',_0x39454e[_0x54968e][_0x7603cf]);break;case 0x1:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x42'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x2:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x43'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x3:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x44'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x4:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,'mail',_0x39454e[_0x54968e][_0x7603cf]);break;case 0x5:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,'openchannel',_0x39454e[_0x54968e][_0x7603cf]);break;case 0x6:joinOrLeaveQueues(_0x4a23e2,_0x1699ef,_0x4da3('0x45'),_0x39454e[_0x54968e][_0x7603cf]);break;case 0x7:if(_0x1d7638['role']!==_0x4da3('0x5'))_0x4a23e2[_0x1699ef](util[_0x4da3('0x18')](_0x4da3('0x46'),_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;case 0x8:if(_0x1d7638['role']!==_0x4da3('0x5'))_0x4a23e2[_0x1699ef](util[_0x4da3('0x18')](_0x4da3('0x47'),_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;case 0x9:if(_0x1d7638[_0x4da3('0x4')]!=='agent')_0x4a23e2[_0x1699ef](util[_0x4da3('0x18')](_0x4da3('0x48'),_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x6')],_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;case 0xa:_0x4a23e2[_0x1699ef](util['format']('user:%s',_0x39454e[_0x54968e][_0x7603cf][_0x4da3('0x2')]));break;}}}}})['then'](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x26359c=_['map'](_0x1d7638[_0x4da3('0x20')],'id');return _0x1d7638[_0x4da3('0x4a')](_0x26359c)['then'](function(){for(var _0x5ca90f=0x0;_0x5ca90f<_0x26359c[_0x4da3('0x1a')];_0x5ca90f+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x4c'),{'ChatInteractionId':Number(_0x26359c[_0x5ca90f]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x2894b5=_['map'](_0x1d7638[_0x4da3('0x4d')],'id');return _0x1d7638[_0x4da3('0x4e')](_0x2894b5)['then'](function(){for(var _0x42c057=0x0;_0x42c057<_0x2894b5[_0x4da3('0x1a')];_0x42c057+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x4f'),{'MailInteractionId':Number(_0x2894b5[_0x42c057]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x4d57c8=_['map'](_0x1d7638['FaxInteractions'],'id');return _0x1d7638['removeFaxInteractions'](_0x4d57c8)[_0x4da3('0xa')](function(){for(var _0x1eb834=0x0;_0x1eb834<_0x4d57c8['length'];_0x1eb834+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x50'),{'FaxInteractionId':Number(_0x4d57c8[_0x1eb834]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x152d11=_[_0x4da3('0x15')](_0x1d7638[_0x4da3('0x25')],'id');return _0x1d7638['removeSmsInteractions'](_0x152d11)[_0x4da3('0xa')](function(){for(var _0x4ea714=0x0;_0x4ea714<_0x152d11[_0x4da3('0x1a')];_0x4ea714+=0x1){_0xfeff22['emit'](_0x4da3('0x51'),{'SmsInteractionId':Number(_0x152d11[_0x4ea714]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0xa')](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x1066a8=_[_0x4da3('0x15')](_0x1d7638[_0x4da3('0x27')],'id');return _0x1d7638[_0x4da3('0x52')](_0x1066a8)[_0x4da3('0xa')](function(){for(var _0xc12d49=0x0;_0xc12d49<_0x1066a8[_0x4da3('0x1a')];_0xc12d49+=0x1){_0xfeff22['emit'](_0x4da3('0x53'),{'OpenchannelInteractionId':Number(_0x1066a8[_0xc12d49]),'UserId':Number(_0x1d7638['id'])});}});}})['then'](function(){if(_0x1699ef===_0x4da3('0x49')){var _0x40e00e=_['map'](_0x1d7638['WhatsappInteractions'],'id');return _0x1d7638[_0x4da3('0x54')](_0x40e00e)[_0x4da3('0xa')](function(){for(var _0x4a7bd4=0x0;_0x4a7bd4<_0x40e00e[_0x4da3('0x1a')];_0x4a7bd4+=0x1){_0xfeff22[_0x4da3('0x4b')](_0x4da3('0x55'),{'WhatsappInteractionId':Number(_0x40e00e[_0x4a7bd4]),'UserId':Number(_0x1d7638['id'])});}});}})[_0x4da3('0x56')](function(_0x5e6173){_0x4a23e2['log'](_0x5e6173);});}}function onDisconnect(_0x5c9463,_0x5afa92){joinOrLeave(_0x5c9463,_0x4da3('0x49'),_0x5afa92);}function onConnect(_0x5c5c62){joinOrLeave(_0x5c5c62,_0x4da3('0x57'));}exports[_0x4da3('0x58')]=function(_0x3e707d){_0x3e707d['on'](_0x4da3('0x59'),function(_0x4a6b76){_0x4a6b76[_0x4da3('0x5a')](0x0);_0x4a6b76[_0x4da3('0x5b')]=_0x4a6b76[_0x4da3('0x5c')][_0x4da3('0x59')][_0x4da3('0x5d')]+':'+_0x4a6b76[_0x4da3('0x5c')][_0x4da3('0x59')][_0x4da3('0x5e')];_0x4a6b76[_0x4da3('0x5f')]=new Date();_0x4a6b76['log']=function(_0x1c9d1c){console[_0x4da3('0x60')](_0x4da3('0x61')+_0x4a6b76[_0x4da3('0x62')][_0x4da3('0x2')]+'['+_0x4a6b76['address']+']',_0x1c9d1c);};_0x4a6b76['on']('disconnect',function(){onDisconnect(_0x4a6b76,_0x3e707d);_0x4a6b76[_0x4da3('0x60')]('DISCONNECTED');});onConnect(_0x4a6b76);_0x4a6b76['log'](_0x4da3('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 439abc1..8fd5273 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 _0xd1d8=['offlineMessage','channel','opened','Sequelize','SELECT','format','changed','closed','substatus','User','find','email','internal','length','hasOwnProperty','hook','callback','condition','util','../../mysqldb','jayson/promise','triggers','client','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','motionChannel','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','QueryTypes','contact','UserId','interface','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','event'];(function(_0x5e62aa,_0x48b6c4){var _0x48724d=function(_0xb2062c){while(--_0xb2062c){_0x5e62aa['push'](_0x5e62aa['shift']());}};_0x48724d(++_0x48b6c4);}(_0xd1d8,0xa4));var _0x8d1d=function(_0x3fd275,_0xf0cd7){_0x3fd275=_0x3fd275-0x0;var _0xe4f14f=_0xd1d8[_0x3fd275];return _0xe4f14f;};'use strict';var util=require(_0x8d1d('0x0'));var db=require(_0x8d1d('0x1'))['db'];var jayson=require(_0x8d1d('0x2'));var logger=require('../logger')(_0x8d1d('0x3'));var client=jayson[_0x8d1d('0x4')][_0x8d1d('0x5')]({'port':0x232a});var triggers=[{'channel':_0x8d1d('0x6'),'model':'ChatInteraction','event':_0x8d1d('0x7'),'condition':_0x8d1d('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0x8d1d('0x9'),'event':_0x8d1d('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Chat','model':_0x8d1d('0xb'),'event':'afterCreate','condition':_0x8d1d('0xc'),'callback':afterCreateMessage},{'channel':_0x8d1d('0x6'),'model':_0x8d1d('0xd'),'event':'afterCreate','condition':_0x8d1d('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x8d1d('0xe'),'model':_0x8d1d('0xf'),'event':_0x8d1d('0x7'),'condition':_0x8d1d('0x8'),'callback':afterCreate},{'channel':_0x8d1d('0xe'),'model':_0x8d1d('0xf'),'event':_0x8d1d('0xa'),'condition':_0x8d1d('0x10'),'callback':afterUpdate},{'channel':_0x8d1d('0xe'),'model':_0x8d1d('0x11'),'event':'afterCreate','condition':_0x8d1d('0xc'),'callback':afterCreateMessage},{'channel':_0x8d1d('0x12'),'model':_0x8d1d('0x13'),'event':_0x8d1d('0x7'),'condition':_0x8d1d('0x8'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x8d1d('0x13'),'event':_0x8d1d('0xa'),'condition':_0x8d1d('0x10'),'callback':afterUpdate},{'channel':_0x8d1d('0x12'),'model':_0x8d1d('0x14'),'event':'afterCreate','condition':_0x8d1d('0xc'),'callback':afterCreateMessage},{'channel':_0x8d1d('0x15'),'model':'FaxInteraction','event':'afterCreate','condition':_0x8d1d('0x8'),'callback':afterCreate},{'channel':_0x8d1d('0x15'),'model':_0x8d1d('0x16'),'event':_0x8d1d('0xa'),'condition':_0x8d1d('0x10'),'callback':afterUpdate},{'channel':_0x8d1d('0x15'),'model':_0x8d1d('0x17'),'event':'afterCreate','condition':_0x8d1d('0xc'),'callback':afterCreateMessage},{'channel':_0x8d1d('0x18'),'model':_0x8d1d('0x19'),'event':_0x8d1d('0x7'),'condition':_0x8d1d('0x8'),'callback':afterCreate},{'channel':_0x8d1d('0x18'),'model':_0x8d1d('0x19'),'event':_0x8d1d('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x8d1d('0x18'),'model':'MailMessage','event':_0x8d1d('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x8d1d('0x1a'),'model':_0x8d1d('0x1b'),'event':_0x8d1d('0x7'),'condition':_0x8d1d('0x8'),'callback':afterCreate},{'channel':_0x8d1d('0x1a'),'model':_0x8d1d('0x1b'),'event':'afterUpdate','condition':_0x8d1d('0x10'),'callback':afterUpdate},{'channel':_0x8d1d('0x1a'),'model':'OpenchannelMessage','event':_0x8d1d('0x7'),'condition':_0x8d1d('0xc'),'callback':afterCreateMessage}];function request(_0x676b46){return client[_0x8d1d('0x1c')](_0x8d1d('0x1d'),_0x676b46)[_0x8d1d('0x1e')](function(_0x811d51){logger[_0x8d1d('0x1f')](_0x8d1d('0x20'),_0x8d1d('0x1d'),_0x811d51);if(_0x811d51[_0x8d1d('0x21')]){if(_0x811d51[_0x8d1d('0x21')][_0x8d1d('0x22')]===0x1f4){logger[_0x8d1d('0x21')](_0x8d1d('0x20'),_0x8d1d('0x1d'),_0x811d51[_0x8d1d('0x21')]);}}})[_0x8d1d('0x23')](function(_0x2128f6){logger[_0x8d1d('0x21')](_0x8d1d('0x20'),_0x8d1d('0x1d'),_0x2128f6);});}function afterCreateMessage(_0xcab909){return function(_0xf5760b){_0xf5760b=_0xf5760b[_0x8d1d('0x24')]({'plain':!![]});_0xf5760b['channel']=_0xcab909;_0xf5760b[_0x8d1d('0x25')]=_0xcab909;_0xf5760b['event']=_0xf5760b['direction'];Promise[_0x8d1d('0x26')]()[_0x8d1d('0x1e')](function(){if(typeof _0xf5760b[_0x8d1d('0x27')]===_0x8d1d('0x28'))return null;var _0x366984=_0x8d1d('0x29')+_0xf5760b['ContactId'];return db[_0x8d1d('0x2a')][_0x8d1d('0x2b')](_0x366984,{'type':db['Sequelize'][_0x8d1d('0x2c')]['SELECT'],'raw':!![]});})[_0x8d1d('0x1e')](function(_0x54a61b){if(_0x54a61b){_0xf5760b[_0x8d1d('0x2d')]=_0x54a61b[0x0];}if(typeof _0xf5760b[_0x8d1d('0x2e')]==='undefined')return;return getAgent(_0xf5760b[_0x8d1d('0x2e')]);})['then'](function(_0x31cc67){if(_0x31cc67){_0xf5760b[_0x8d1d('0x2f')]=util['format'](_0x8d1d('0x30'),_0x31cc67[_0x8d1d('0x31')]);_0xf5760b[_0x8d1d('0x32')]=_0x31cc67;_0xf5760b['channel']=_0xcab909;return request({'event':_0x8d1d('0x33'),'message':_0xf5760b});}else{return request({'event':_0x8d1d('0x34'),'message':_0xf5760b});}})[_0x8d1d('0x23')](function(_0x3f8a26){logger[_0x8d1d('0x21')](_0x8d1d('0x20'),_0x8d1d('0x35'),_0x3f8a26);});};}function afterCreateOfflineMessage(_0x36cbd7){return function(_0x5a67ab){_0x5a67ab=_0x5a67ab['get']({'plain':!![]});_0x5a67ab['channel']=_0x36cbd7;_0x5a67ab[_0x8d1d('0x25')]=_0x36cbd7;_0x5a67ab[_0x8d1d('0x36')]=_0x8d1d('0x37');return request({'event':_0x5a67ab[_0x8d1d('0x36')],'message':_0x5a67ab});};}function afterCreate(_0x30c64d,_0x213bce){return function(_0x633982){_0x633982=_0x633982[_0x8d1d('0x24')]({'plain':!![]});_0x633982[_0x8d1d('0x38')]=_0x30c64d;_0x633982['motionChannel']=_0x30c64d;_0x633982[_0x8d1d('0x36')]=_0x8d1d('0x39');Promise['resolve']()[_0x8d1d('0x1e')](function(){var _0x1274fc=_0x8d1d('0x29')+_0x633982[_0x8d1d('0x27')];return db[_0x8d1d('0x2a')]['query'](_0x1274fc,{'type':db[_0x8d1d('0x3a')][_0x8d1d('0x2c')][_0x8d1d('0x3b')],'raw':!![]});})[_0x8d1d('0x1e')](function(_0x4f7cc9){if(_0x4f7cc9){_0x633982[_0x8d1d('0x2d')]=_0x4f7cc9[0x0];}if(typeof _0x633982[_0x8d1d('0x2e')]===_0x8d1d('0x28'))return;return getAgent(_0x633982['UserId']);})[_0x8d1d('0x1e')](function(_0x49beb5){if(_0x49beb5){_0x633982[_0x8d1d('0x2f')]=util[_0x8d1d('0x3c')](_0x8d1d('0x30'),_0x49beb5['name']);_0x633982[_0x8d1d('0x32')]=_0x49beb5;}return request({'event':_0x213bce,'message':_0x633982});})[_0x8d1d('0x23')](function(_0x4cc9fd){logger['error'](_0x8d1d('0x20'),'AfterCreate',_0x4cc9fd);});};}function afterUpdate(_0x26ab65){return function(_0x3adec6){var _0x5d6588=_0x3adec6[_0x8d1d('0x3d')](_0x8d1d('0x3e'))&&_0x3adec6['closed'];var _0x4cdf9d=_0x3adec6[_0x8d1d('0x3d')]('substatus');if(_0x5d6588||_0x4cdf9d){var _0x31f32d=_0x5d6588?_0x8d1d('0x10'):_0x8d1d('0x3f');var _0x4b8e6b=_0x3adec6[_0x8d1d('0x24')]({'plain':!![]});_0x4b8e6b[_0x8d1d('0x38')]=_0x26ab65;_0x4b8e6b[_0x8d1d('0x25')]=_0x26ab65;_0x4b8e6b[_0x8d1d('0x36')]=_0x5d6588?'closed':_0x8d1d('0x3f');var _0x2a5ed9=_0x8d1d('0x29')+_0x4b8e6b[_0x8d1d('0x27')];return db[_0x8d1d('0x2a')]['query'](_0x2a5ed9,{'type':db[_0x8d1d('0x3a')][_0x8d1d('0x2c')][_0x8d1d('0x3b')],'raw':!![]})[_0x8d1d('0x1e')](function(_0x3063d8){if(_0x3063d8){_0x4b8e6b[_0x8d1d('0x2d')]=_0x3063d8[0x0];}if(typeof _0x4b8e6b['UserId']==='undefined')return;return getAgent(_0x4b8e6b[_0x8d1d('0x2e')]);})[_0x8d1d('0x1e')](function(_0x257e49){if(_0x257e49){_0x4b8e6b[_0x8d1d('0x2f')]=util['format'](_0x8d1d('0x30'),_0x257e49[_0x8d1d('0x31')]);_0x4b8e6b[_0x8d1d('0x32')]=_0x257e49;}return request({'event':_0x31f32d,'message':_0x4b8e6b});})[_0x8d1d('0x23')](function(_0xa6170c){logger[_0x8d1d('0x21')](_0x8d1d('0x20'),'AfterUpdate',_0xa6170c);});}};}function getAgent(_0x301eaf){return db[_0x8d1d('0x40')][_0x8d1d('0x41')]({'where':{'id':_0x301eaf},'attributes':['id','name','fullname',_0x8d1d('0x42'),_0x8d1d('0x43')],'raw':!![]})[_0x8d1d('0x1e')](function(_0x521762){return _0x521762;});}exports['default']=function(){for(var _0x52e8f0=0x0;_0x52e8f0=_0xd19e8a['agents']){throw Error(_0x710c('0x16'));}_0x562ce3(_0x259d46);})[_0x710c('0x17')](function(_0x1d568f){_0xdf371d(_0x1d568f);});});}; \ No newline at end of file +var _0xaf65=['updateAttributes','getLicense','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','includes','clearBlockUser','isUndefined','blockedAt'];(function(_0xd1bfa1,_0x3725f1){var _0x309326=function(_0x41c69d){while(--_0x41c69d){_0xd1bfa1['push'](_0xd1bfa1['shift']());}};_0x309326(++_0x3725f1);}(_0xaf65,0x7b));var _0x5af6=function(_0x323b78,_0xa190b){_0x323b78=_0x323b78-0x0;var _0x1ac447=_0xaf65[_0x323b78];return _0x1ac447;};'use strict';var _=require(_0x5af6('0x0'));var BPromise=require(_0x5af6('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x5af6('0x2'));var channels=[_0x5af6('0x3'),_0x5af6('0x4'),_0x5af6('0x5'),_0x5af6('0x6'),_0x5af6('0x7'),_0x5af6('0x8'),_0x5af6('0x9')];exports[_0x5af6('0xa')]=function(){return channels;};exports['isValidChannel']=function(_0x2c3380){_0x2c3380=_0x2c3380['toLowerCase']();return _[_0x5af6('0xb')](channels,_0x2c3380);};exports[_0x5af6('0xc')]=function(_0x277741,_0x12ffa6,_0x9c42e3,_0x236f28){var _0x4e3f63={'loginAttempts':_0x12ffa6,'blocked':_0x9c42e3};if(!_[_0x5af6('0xd')](_0x236f28)){_0x4e3f63[_0x5af6('0xe')]=_0x236f28;}return _0x277741[_0x5af6('0xf')](_0x4e3f63);};exports[_0x5af6('0x10')]=function(_0x1c8713){return new BPromise(function(_0x1c0a3f,_0x505079){var _0xc58427=0x0;if(_0x1c8713['role']!=='agent'){_0x1c0a3f(_0x1c8713);}db[_0x5af6('0x11')][_0x5af6('0x12')]({'where':{'role':_0x5af6('0x13'),'online':!![],'id':{'$ne':_0x1c8713['id']}}})['then'](function(_0x3895ae){_0xc58427=_0x3895ae;return util[_0x5af6('0x10')]();})[_0x5af6('0x14')](function(_0x4a1cd5){if(_0x4a1cd5&&_0x4a1cd5[_0x5af6('0x15')]&&_0xc58427>=_0x4a1cd5[_0x5af6('0x15')]){throw Error(_0x5af6('0x16'));}_0x1c0a3f(_0x1c8713);})['catch'](function(_0x28b208){_0x505079(_0x28b208);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 1dd229b..45dd88a 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval','stack','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','name','Error'];(function(_0x3a7db0,_0xe93c50){var _0x17cbba=function(_0x577f4c){while(--_0x577f4c){_0x3a7db0['push'](_0x3a7db0['shift']());}};_0x17cbba(++_0xe93c50);}(_0xe706,0xa3));var _0x6e70=function(_0x4618da,_0x27c024){_0x4618da=_0x4618da-0x0;var _0xede04a=_0xe706[_0x4618da];return _0xede04a;};'use strict';var util=require(_0x6e70('0x0'));var logger=require(_0x6e70('0x1'))(_0x6e70('0x2'));var APIError=function(_0x5e8446,_0x2cae77){this[_0x6e70('0x3')]=_0x5e8446||_0x6e70('0x4');this[_0x6e70('0x5')]=_0x2cae77||_0x6e70('0x6');util[_0x6e70('0x7')](APIError,Error);};var APIBadRequestError=function(_0x376a8d){this[_0x6e70('0x3')]=_0x376a8d||_0x6e70('0x8');this[_0x6e70('0x5')]=_0x6e70('0x8');util[_0x6e70('0x7')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x45a2d4){this[_0x6e70('0x3')]=_0x45a2d4||_0x6e70('0x9');this[_0x6e70('0x5')]=_0x6e70('0xa');util[_0x6e70('0x7')](APINotFoundError,APIError);};function getStatusCode(_0x100eb7){switch(_0x100eb7){case _0x6e70('0x8'):return 0x190;case _0x6e70('0xb'),_0x6e70('0xc'):return 0x193;case _0x6e70('0xa'):return 0x194;default:return 0x1f4;}}function handleError(_0x4600f9){return function(_0x5b3d07){logger['error'](_0x5b3d07[_0x6e70('0xd')]);var _0x15a1a5=getStatusCode(_0x5b3d07[_0x6e70('0x5')]);if(_0x5b3d07[_0x6e70('0x5')])delete _0x5b3d07[_0x6e70('0x5')];return _0x4600f9[_0x6e70('0xe')](_0x15a1a5)[_0x6e70('0xf')](_0x5b3d07);};}module[_0x6e70('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x0bb5=['message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Not\x20Found','OutOfInterval','error','stack','status','send','exports','util','../config/logger'];(function(_0x21de95,_0x71ff49){var _0x8689ea=function(_0x3cfb56){while(--_0x3cfb56){_0x21de95['push'](_0x21de95['shift']());}};_0x8689ea(++_0x71ff49);}(_0x0bb5,0x148));var _0x50bb=function(_0x2ff4cc,_0x18274a){_0x2ff4cc=_0x2ff4cc-0x0;var _0x5b76e5=_0x0bb5[_0x2ff4cc];return _0x5b76e5;};'use strict';var util=require(_0x50bb('0x0'));var logger=require(_0x50bb('0x1'))('api');var APIError=function(_0x5a12b6,_0x348380){this[_0x50bb('0x2')]=_0x5a12b6||_0x50bb('0x3');this[_0x50bb('0x4')]=_0x348380||_0x50bb('0x5');util[_0x50bb('0x6')](APIError,Error);};var APIBadRequestError=function(_0x451b4c){this[_0x50bb('0x2')]=_0x451b4c||'Bad\x20Request';this['name']=_0x50bb('0x7');util[_0x50bb('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2e5463){this[_0x50bb('0x2')]=_0x2e5463||'Entity\x20not\x20found';this['name']=_0x50bb('0x8');util[_0x50bb('0x6')](APINotFoundError,APIError);};function getStatusCode(_0x3ae598){switch(_0x3ae598){case _0x50bb('0x7'):return 0x190;case'Forbidden',_0x50bb('0x9'):return 0x193;case _0x50bb('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x184d06){return function(_0x41055d){logger[_0x50bb('0xa')](_0x41055d[_0x50bb('0xb')]);var _0x38d3b6=getStatusCode(_0x41055d['name']);if(_0x41055d[_0x50bb('0x4')])delete _0x41055d['name'];return _0x184d06[_0x50bb('0xc')](_0x38d3b6)[_0x50bb('0xd')](_0x41055d);};}module[_0x50bb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index da9b564..7c66d2b 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec0c=['exports','404','status','json'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xec0c,0xa4));var _0xcec0=function(_0x332279,_0x29e591){_0x332279=_0x332279-0x0;var _0x2d2364=_0xec0c[_0x332279];return _0x2d2364;};'use strict';module[_0xcec0('0x0')][0x194]=function pageNotFound(_0x6d497d,_0x909100){var _0x47fb57=_0xcec0('0x1');var _0x4eb127=0x194;var _0x3b68b9={'status':_0x4eb127};_0x909100['status'](_0x3b68b9[_0xcec0('0x2')]);_0x909100['render'](_0x47fb57,{},function(_0x4f2b78,_0x4a761e){if(_0x4f2b78){return _0x909100[_0xcec0('0x2')](_0x3b68b9['status'])[_0xcec0('0x3')](_0x3b68b9);}_0x909100['send'](_0x4a761e);});}; \ No newline at end of file +var _0x0490=['status','render','json'];(function(_0x4d183d,_0x123de0){var _0x431236=function(_0x35642b){while(--_0x35642b){_0x4d183d['push'](_0x4d183d['shift']());}};_0x431236(++_0x123de0);}(_0x0490,0x147));var _0x0049=function(_0x398382,_0x3d252f){_0x398382=_0x398382-0x0;var _0x2d8dce=_0x0490[_0x398382];return _0x2d8dce;};'use strict';module['exports'][0x194]=function pageNotFound(_0x34765b,_0x5f5313){var _0x555b7c='404';var _0x5b6bc9=0x194;var _0x2803f6={'status':_0x5b6bc9};_0x5f5313[_0x0049('0x0')](_0x2803f6[_0x0049('0x0')]);_0x5f5313[_0x0049('0x1')](_0x555b7c,{},function(_0x2872ec,_0x4a59b9){if(_0x2872ec){return _0x5f5313[_0x0049('0x0')](_0x2803f6[_0x0049('0x0')])[_0x0049('0x2')](_0x2803f6);}_0x5f5313['send'](_0x4a59b9);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 624f1db..9d968c5 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x903b=['../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','belongsTo','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','ChatQueue','ChatQueues','FaxQueues','UserFaxQueue','OpenchannelQueues','CmList','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','VoiceExtension','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','CmHopper','Hoppers','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','ListId','Template','user_has_mail_accounts','team_has_mail_queues','Teams','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','ChatWebsite','TagId','FaxAccountId','Interactions','Exntensions','List','Owner','fax_interaction_has_tags','FaxMessage','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','chat_group_has_users','CompanyId','Phones','CmContactId','HopperHistories','Company','CmHopperAdditionalPhone','AdditionalPhones','CampaignId','OwnerId','All','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','CustomReportId','Mohs','cm_contact_has_tags','whatsapp_interaction_has_tags','ItemType','CmHopperId','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','Subject','Description','Field','FieldId','VariableId','SugarcrmAccount','SugarcrmField','DeskAccount','Subjects','int_desk_configuration_has_tags','ZohoAccount','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','Dynamics365Field','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','JscriptyAnswerReport','MailQueues','team_has_chat_queues','WhatsappQueue','team_has_whatsapp_queues','VoicePrefixes','TrunkId','SquareProject','SquareProjectId','campaigns_has_cm_blacklists','ChatOfflineMessageId','MailTransferReport','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','FromAccount','ToUserId','ToAgent','ToChatQueueId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','UserProfileSections','userProfileId','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','user','exports','../config/environment','lodash','jstz','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','database','sequelize','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../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','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model'];(function(_0x2e031a,_0x5d945d){var _0x5e687a=function(_0x3df8de){while(--_0x3df8de){_0x2e031a['push'](_0x2e031a['shift']());}};_0x5e687a(++_0x5d945d);}(_0x903b,0x136));var _0xb903=function(_0x5c4aef,_0x2a04e6){_0x5c4aef=_0x5c4aef-0x0;var _0x253aad=_0x903b[_0x5c4aef];return _0x253aad;};'use strict';var config=require(_0xb903('0x0'));var Sequelize=require('sequelize');var _=require(_0xb903('0x1'));var jstz=require(_0xb903('0x2'));var timezone=jstz['determine']();config['sequelize']=_[_0xb903('0x3')](config['sequelize'],{'database':'motion2','username':'xcall','password':_0xb903('0x4'),'options':{'host':_0xb903('0x5'),'port':0xcea,'dialect':_0xb903('0x6'),'dialectOptions':{'charset':_0xb903('0x7')},'logging':![],'timezone':timezone[_0xb903('0x8')](),'define':{'charset':_0xb903('0x9'),'collate':_0xb903('0xa')}}});config[_0xb903('0xb')]=_[_0xb903('0x3')](config[_0xb903('0xb')],{'database':_0xb903('0xc'),'username':_0xb903('0xd'),'password':_0xb903('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xb903('0x6'),'dialectOptions':{'charset':_0xb903('0x7')},'logging':![],'timezone':timezone[_0xb903('0x8')](),'define':{'charset':'utf8','collate':_0xb903('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xb903('0xe')],config[_0xb903('0xf')][_0xb903('0x10')],config[_0xb903('0xf')][_0xb903('0x11')],config[_0xb903('0xf')][_0xb903('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb903('0xb')]['database'],config[_0xb903('0xb')][_0xb903('0x10')],config['sequelizeHistory'][_0xb903('0x11')],config[_0xb903('0xb')][_0xb903('0x12')])};db[_0xb903('0x13')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x15'));db[_0xb903('0x16')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x17'));db[_0xb903('0x18')]=db[_0xb903('0xf')]['import'](_0xb903('0x19'));db['VoiceExtension']=db[_0xb903('0xf')]['import'](_0xb903('0x1a'));db[_0xb903('0x1b')]=db[_0xb903('0xf')]['import'](_0xb903('0x1c'));db[_0xb903('0x1d')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db['sequelize'][_0xb903('0x14')](_0xb903('0x1e'));db[_0xb903('0x1f')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x20'));db[_0xb903('0x21')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x22'));db[_0xb903('0x23')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x24'));db[_0xb903('0x25')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x26'));db[_0xb903('0x27')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x28'));db[_0xb903('0x29')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x2a'));db[_0xb903('0x2b')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x2c'));db[_0xb903('0x2d')]=db[_0xb903('0xf')]['import'](_0xb903('0x2e'));db['VoiceTransferReport']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x2f'));db['UserVoiceQueueRt']=db['sequelize'][_0xb903('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xb903('0x30')]=db[_0xb903('0xf')]['import'](_0xb903('0x31'));db[_0xb903('0x32')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x33'));db[_0xb903('0x34')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x35'));db['UserFaxQueue']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x36'));db[_0xb903('0x37')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x38'));db[_0xb903('0x39')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x3a'));db[_0xb903('0x3b')]=db[_0xb903('0xf')]['import'](_0xb903('0x3c'));db[_0xb903('0x3d')]=db['sequelize'][_0xb903('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0xb903('0x3e')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x3f'));db[_0xb903('0x40')]=db[_0xb903('0xf')]['import'](_0xb903('0x41'));db[_0xb903('0x42')]=db['sequelize'][_0xb903('0x14')]('../api/mailQueue/mailQueue.model');db[_0xb903('0x43')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x44'));db[_0xb903('0x45')]=db[_0xb903('0xf')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xb903('0x46')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x47'));db[_0xb903('0x48')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x49'));db[_0xb903('0x4a')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/mailQueueReport/mailQueueReport.model');db[_0xb903('0x4b')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x4c'));db[_0xb903('0x4d')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x4e'));db['FaxAccount']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/faxAccount/faxAccount.model');db[_0xb903('0x4f')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x50'));db['FaxInteraction']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x51'));db[_0xb903('0x52')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x53'));db['FaxQueueReport']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x54'));db[_0xb903('0x55')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x56'));db[_0xb903('0x57')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x58'));db[_0xb903('0x59')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x5a'));db[_0xb903('0x5b')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x5c'));db[_0xb903('0x5d')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x5e'));db[_0xb903('0x5f')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x60'));db[_0xb903('0x61')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0xb903('0x62')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x63'));db[_0xb903('0x64')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x65'));db[_0xb903('0x66')]=db[_0xb903('0xf')]['import'](_0xb903('0x67'));db['ChatWebsite']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x68'));db['OpenchannelQueueReport']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x69'));db[_0xb903('0x6a')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x6b'));db[_0xb903('0x6c')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x6d'));db[_0xb903('0x6e')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x6f'));db[_0xb903('0x70')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x71'));db['ChatQueue']=db['sequelize'][_0xb903('0x14')](_0xb903('0x72'));db[_0xb903('0x73')]=db[_0xb903('0xf')]['import'](_0xb903('0x74'));db['ChatProactiveAction']=db['sequelize'][_0xb903('0x14')](_0xb903('0x75'));db[_0xb903('0x76')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x77'));db[_0xb903('0x78')]=db[_0xb903('0xf')]['import']('../api/cmContact/cmContact.model');db['CmHopper']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x79'));db[_0xb903('0x7a')]=db[_0xb903('0xf')]['import'](_0xb903('0x7b'));db[_0xb903('0x7c')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x7d'));db[_0xb903('0x7e')]=db[_0xb903('0xf')]['import'](_0xb903('0x7f'));db[_0xb903('0x80')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x81'));db['CmCustomField']=db[_0xb903('0xf')]['import'](_0xb903('0x82'));db[_0xb903('0x83')]=db[_0xb903('0xf')]['import'](_0xb903('0x84'));db[_0xb903('0x85')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x86'));db[_0xb903('0x87')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x88'));db[_0xb903('0x89')]=db[_0xb903('0xf')]['import'](_0xb903('0x8a'));db[_0xb903('0x8b')]=db['sequelize'][_0xb903('0x14')]('../api/condition/condition.model');db[_0xb903('0x8c')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x8d'));db[_0xb903('0x8e')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x8f'));db[_0xb903('0x90')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x91'));db['VoiceQueuesLog']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x92'));db[_0xb903('0x93')]=db[_0xb903('0xf')]['import']('../api/schedule/schedule.model');db['Sound']=db['sequelize'][_0xb903('0x14')](_0xb903('0x94'));db[_0xb903('0x95')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x96'));db[_0xb903('0x97')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x98'));db[_0xb903('0x99')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x9a'));db['CmHopperAdditionalPhone']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x9b'));db['Template']=db['sequelize']['import'](_0xb903('0x9c'));db[_0xb903('0x9d')]=db[_0xb903('0xf')]['import'](_0xb903('0x9e'));db[_0xb903('0x9f')]=db[_0xb903('0xf')]['import'](_0xb903('0xa0'));db[_0xb903('0xa1')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xa2'));db['IntegrationReport']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/integrationReport/integrationReport.model');db[_0xb903('0xa3')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xa4'));db['AnalyticDefaultReport']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xa5'));db[_0xb903('0xa6')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xa7'));db[_0xb903('0xa8')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0xb903('0xa9')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xaa'));db['AnalyticTreeReport']=db[_0xb903('0xf')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xb903('0xab')]=db['sequelize']['import'](_0xb903('0xac'));db['SalesforceConfiguration']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xad'));db[_0xb903('0xae')]=db[_0xb903('0xf')]['import'](_0xb903('0xaf'));db['SugarcrmAccount']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xb0'));db[_0xb903('0xb1')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xb2'));db['SugarcrmField']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xb3'));db['DeskAccount']=db[_0xb903('0xf')]['import']('../api/intDeskAccount/intDeskAccount.model');db[_0xb903('0xb4')]=db[_0xb903('0xf')]['import'](_0xb903('0xb5'));db[_0xb903('0xb6')]=db['sequelize']['import']('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/intZohoAccount/intZohoAccount.model');db[_0xb903('0xb7')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xb8'));db['ZohoField']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xb9'));db['ZendeskAccount']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xba'));db[_0xb903('0xbb')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xb903('0xbc')]=db['sequelize'][_0xb903('0x14')](_0xb903('0xbd'));db[_0xb903('0xbe')]=db[_0xb903('0xf')]['import'](_0xb903('0xbf'));db['FreshdeskConfiguration']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xc0'));db[_0xb903('0xc1')]=db['sequelize'][_0xb903('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xc2'));db[_0xb903('0xc3')]=db[_0xb903('0xf')]['import'](_0xb903('0xc4'));db[_0xb903('0xc5')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xc6'));db[_0xb903('0xc7')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xc8'));db[_0xb903('0xc9')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xca'));db['ServicenowField']=db['sequelize'][_0xb903('0x14')](_0xb903('0xcb'));db[_0xb903('0xcc')]=db[_0xb903('0xf')]['import'](_0xb903('0xcd'));db[_0xb903('0xce')]=db[_0xb903('0xf')]['import'](_0xb903('0xcf'));db['Dynamics365Field']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xd0'));db['FreshsalesAccount']=db[_0xb903('0xf')]['import'](_0xb903('0xd1'));db[_0xb903('0xd2')]=db['sequelize']['import'](_0xb903('0xd3'));db[_0xb903('0xd4')]=db['sequelize'][_0xb903('0x14')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xb903('0xa1')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/integration/integration.model');db[_0xb903('0xd5')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xd6'));db[_0xb903('0xd7')]=db['sequelize'][_0xb903('0x14')](_0xb903('0xd8'));db[_0xb903('0xd9')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xda'));db['JscriptyAnswerReport']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xb903('0xdb')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xb903('0xdc')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xdd'));db[_0xb903('0xde')]=db['sequelize'][_0xb903('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0xb903('0xdf')]=db['sequelize'][_0xb903('0x14')](_0xb903('0xe0'));db['SquareDetailsReport']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xe1'));db[_0xb903('0xe2')]=db['sequelize']['import'](_0xb903('0xe3'));db[_0xb903('0xe4')]=db['sequelize'][_0xb903('0x14')]('../api/setting/setting.model');db['SquareOdbc']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xe5'));db['SquareProject']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/squareProject/squareProject.model');db[_0xb903('0xe6')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xe7'));db[_0xb903('0xe8')]=db[_0xb903('0xf')]['import'](_0xb903('0xe9'));db[_0xb903('0xea')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xeb'));db[_0xb903('0xec')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xed'));db[_0xb903('0xee')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/campaign/campaign.model');db['Migration']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xef'));db[_0xb903('0xf0')]=db['sequelize'][_0xb903('0x14')]('../api/attachment/attachment.model');db[_0xb903('0xf1')]=db['sequelize'][_0xb903('0x14')](_0xb903('0xf2'));db['MailTransferReport']=db[_0xb903('0xf')][_0xb903('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xb903('0xf3')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0xb903('0xf4')]=db[_0xb903('0xf')]['import'](_0xb903('0xf5'));db[_0xb903('0xf6')]=db['sequelize'][_0xb903('0x14')](_0xb903('0xf7'));db[_0xb903('0xf8')]=db['sequelize'][_0xb903('0x14')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db['sequelize'][_0xb903('0x14')](_0xb903('0xf9'));db[_0xb903('0xfa')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xfb'));db[_0xb903('0xfc')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0xfd'));db[_0xb903('0xfe')]=db['sequelize']['import'](_0xb903('0xff'));db[_0xb903('0x100')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xb903('0x101')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x102'));db[_0xb903('0x103')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x104'));db[_0xb903('0x105')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x106'));db['WhatsappInteraction']=db[_0xb903('0xf')]['import'](_0xb903('0x107'));db[_0xb903('0x108')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x109'));db[_0xb903('0x10a')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x10b'));db[_0xb903('0x10c')]=db['sequelize'][_0xb903('0x14')](_0xb903('0x10d'));db['WhatsappQueue']=db['sequelize']['import'](_0xb903('0x10e'));db['CloudProvider']=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x10f'));db[_0xb903('0x110')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x111'));db[_0xb903('0x112')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x113'));db[_0xb903('0x114')]=db[_0xb903('0xf')][_0xb903('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xb903('0x115')]=db[_0xb903('0xf')][_0xb903('0x14')](_0xb903('0x116'));db[_0xb903('0x13')][_0xb903('0x117')](db[_0xb903('0x1f')],{'as':_0xb903('0x1f'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x119')});db['User'][_0xb903('0x117')](db['UserSetting'],{'as':'userSetting','onDelete':_0xb903('0x118'),'foreignKey':'UserId'});db[_0xb903('0x13')][_0xb903('0x11a')](db[_0xb903('0x11b')],{'as':_0xb903('0x11c'),'foreignKey':_0xb903('0x119')});db['User'][_0xb903('0x11a')](db['UserVoiceQueueRt'],{'as':_0xb903('0x11d'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x13')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0xb903('0x13')][_0xb903('0x11a')](db[_0xb903('0x7c')],{'as':_0xb903('0x11e'),'foreignKey':_0xb903('0x119')});db['User']['hasMany'](db[_0xb903('0x7e')],{'as':_0xb903('0x11f'),'foreignKey':'UserId'});db['User'][_0xb903('0x11a')](db[_0xb903('0x80')],{'as':_0xb903('0x80'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x13')][_0xb903('0x11a')](db[_0xb903('0x62')],{'as':_0xb903('0x120'),'foreignKey':_0xb903('0x119')});db['User'][_0xb903('0x11a')](db[_0xb903('0x6c')],{'as':_0xb903('0x121'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x13')][_0xb903('0x11a')](db['SmsInteraction'],{'as':_0xb903('0x122'),'foreignKey':_0xb903('0x119')});db['User'][_0xb903('0x11a')](db[_0xb903('0x123')],{'as':_0xb903('0x124'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x13')][_0xb903('0x11a')](db[_0xb903('0x45')],{'as':_0xb903('0x125'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x13')][_0xb903('0x11a')](db[_0xb903('0x126')],{'as':_0xb903('0x127'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xb903('0x101')],{'as':'UserNotifications','foreignKey':_0xb903('0x128')});db[_0xb903('0x13')][_0xb903('0x129')](db['UserProfile'],{'as':_0xb903('0xfc'),'foreignKey':'userProfileId'});db[_0xb903('0x13')][_0xb903('0x12a')](db['ChatGroup'],{'as':_0xb903('0x12b'),'through':'chat_group_has_users'});db[_0xb903('0x13')]['belongsToMany'](db[_0xb903('0x78')],{'as':_0xb903('0x12c'),'through':_0xb903('0x12d')});db[_0xb903('0x13')][_0xb903('0x12a')](db['CmList'],{'as':_0xb903('0x12e'),'through':_0xb903('0x12f')});db[_0xb903('0x13')][_0xb903('0x12a')](db['Team'],{'through':_0xb903('0x130')});db['User']['belongsToMany'](db[_0xb903('0x45')],{'as':_0xb903('0x125'),'through':'user_has_mail_interactions'});db['User'][_0xb903('0x12a')](db['ChatInteraction'],{'as':_0xb903('0x121'),'through':'user_has_chat_interactions'});db[_0xb903('0x13')][_0xb903('0x12a')](db['FaxInteraction'],{'as':'FaxInteractions','through':_0xb903('0x131')});db[_0xb903('0x13')]['belongsToMany'](db[_0xb903('0x59')],{'as':_0xb903('0x122'),'through':_0xb903('0x132')});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0x62')],{'as':_0xb903('0x120'),'through':'user_has_openchannel_interactions'});db[_0xb903('0x13')][_0xb903('0x12a')](db['WhatsappInteraction'],{'as':_0xb903('0x127'),'through':_0xb903('0x133')});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0x1d')],{'as':_0xb903('0x134'),'through':_0xb903('0x30'),'required':![]});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0xfa')],{'as':'VoicePrefixes','through':_0xb903('0x114'),'required':![]});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0x42')],{'as':'MailQueues','through':_0xb903('0x34'),'required':![]});db[_0xb903('0x13')]['belongsToMany'](db[_0xb903('0x135')],{'as':_0xb903('0x136'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xb903('0x12a')](db[_0xb903('0x52')],{'as':_0xb903('0x137'),'through':_0xb903('0x138'),'required':![]});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0x5d')],{'as':'SmsQueues','through':_0xb903('0x37'),'required':![]});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0x66')],{'as':_0xb903('0x139'),'through':_0xb903('0x39'),'required':![]});db[_0xb903('0x13')][_0xb903('0x12a')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0xb903('0x3b'),'required':![]});db['User'][_0xb903('0x12a')](db[_0xb903('0x13a')],{'through':_0xb903('0x12f')});db[_0xb903('0x13')][_0xb903('0x12a')](db['ChatWebsite'],{'as':_0xb903('0x13b'),'through':_0xb903('0x13c')});db[_0xb903('0x13')][_0xb903('0x12a')](db[_0xb903('0x13d')],{'as':_0xb903('0x13e'),'through':'user_has_fax_accounts'});db['User'][_0xb903('0x12a')](db[_0xb903('0x40')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db['User']['belongsToMany'](db[_0xb903('0x5f')],{'as':_0xb903('0x13f'),'through':_0xb903('0x140')});db[_0xb903('0x13')]['belongsToMany'](db[_0xb903('0x55')],{'as':_0xb903('0x141'),'through':_0xb903('0x142')});db['User']['belongsToMany'](db[_0xb903('0x103')],{'as':_0xb903('0x143'),'through':_0xb903('0x144')});db[_0xb903('0x16')][_0xb903('0x11a')](db[_0xb903('0x145')],{'as':_0xb903('0x146'),'onDelete':'cascade','foreignKey':_0xb903('0x147')});db['VoiceContext']['hasMany'](db[_0xb903('0x145')],{'onDelete':'cascade'});db[_0xb903('0x145')]['hasMany'](db[_0xb903('0x145')],{'as':_0xb903('0x148'),'onDelete':_0xb903('0x118')});db[_0xb903('0x1b')]['belongsToMany'](db[_0xb903('0x149')],{'as':_0xb903('0x14a'),'through':_0xb903('0x14b')});db[_0xb903('0x1d')][_0xb903('0x11a')](db[_0xb903('0x14c')],{'as':_0xb903('0x14d'),'foreignKey':_0xb903('0x14e')});db[_0xb903('0x1d')]['hasMany'](db[_0xb903('0x14f')],{'as':_0xb903('0x150'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xb903('0x7c')],{'as':_0xb903('0x11e'),'foreignKey':'VoiceQueueId'});db[_0xb903('0x1d')][_0xb903('0x11a')](db[_0xb903('0x7e')],{'as':'HopperHistories','foreignKey':_0xb903('0x14e')});db[_0xb903('0x1d')][_0xb903('0x11a')](db[_0xb903('0x80')],{'as':_0xb903('0x80'),'foreignKey':_0xb903('0x14e')});db[_0xb903('0x1d')][_0xb903('0x11a')](db[_0xb903('0x7a')],{'as':_0xb903('0x151'),'foreignKey':'VoiceQueueId'});db[_0xb903('0x1d')][_0xb903('0x11a')](db[_0xb903('0xdc')],{'as':_0xb903('0x152'),'foreignKey':_0xb903('0x14e')});db['VoiceQueue']['belongsTo'](db[_0xb903('0x2d')],{'as':_0xb903('0x2d'),'foreignKey':'TrunkId'});db[_0xb903('0x1d')][_0xb903('0x129')](db[_0xb903('0x2d')],{'as':_0xb903('0x153'),'foreignKey':_0xb903('0x154')});db[_0xb903('0x1d')]['belongsTo'](db['Interval'],{'as':_0xb903('0x8c'),'foreignKey':_0xb903('0x155')});db[_0xb903('0x1d')]['belongsTo'](db[_0xb903('0x8e')],{'as':_0xb903('0x156'),'foreignKey':_0xb903('0x157')});db[_0xb903('0x1d')][_0xb903('0x12a')](db['CmList'],{'as':_0xb903('0x12e'),'through':_0xb903('0x158')});db[_0xb903('0x1d')][_0xb903('0x12a')](db['User'],{'as':_0xb903('0x159'),'through':'UserVoiceQueue'});db[_0xb903('0x1d')][_0xb903('0x12a')](db[_0xb903('0xea')],{'as':'Teams','through':_0xb903('0x110')});db[_0xb903('0x1d')][_0xb903('0x12a')](db[_0xb903('0x13a')],{'as':_0xb903('0x15a'),'through':_0xb903('0x15b')});db[_0xb903('0x11b')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':'User','foreignKey':_0xb903('0x119')});db[_0xb903('0x15c')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x13'),'foreignKey':_0xb903('0x119')});db['VoiceMail'][_0xb903('0x11a')](db[_0xb903('0x21')],{'as':_0xb903('0x15d'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x15e'),'sourceKey':_0xb903('0x15f')});db[_0xb903('0x21')][_0xb903('0x129')](db['VoiceMail'],{'foreignKey':_0xb903('0x15e'),'targetKey':_0xb903('0x15f')});db[_0xb903('0x23')]['hasMany'](db['VoiceQueueReport'],{'as':_0xb903('0x160'),'foreignKey':_0xb903('0x161'),'constraints':![]});db[_0xb903('0x23')][_0xb903('0x11a')](db[_0xb903('0x27')],{'as':_0xb903('0x162'),'foreignKey':_0xb903('0x161'),'constraints':![]});db[_0xb903('0x23')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x13'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x23')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x3d')][_0xb903('0x129')](db[_0xb903('0x40')],{'as':_0xb903('0x40'),'foreignKey':_0xb903('0x165')});db['MailServerIn'][_0xb903('0x129')](db[_0xb903('0x166')],{'as':_0xb903('0x166'),'foreignKey':_0xb903('0x167'),'onDelete':_0xb903('0x168')});db[_0xb903('0x3e')][_0xb903('0x129')](db[_0xb903('0x40')],{'as':_0xb903('0x40'),'foreignKey':_0xb903('0x165')});db[_0xb903('0x3e')][_0xb903('0x129')](db['CloudProvider'],{'as':'CloudProvider','foreignKey':_0xb903('0x167'),'onDelete':'restrict'});db[_0xb903('0x40')][_0xb903('0x117')](db[_0xb903('0x3d')],{'as':_0xb903('0x169'),'onDelete':_0xb903('0x118')});db[_0xb903('0x40')]['hasOne'](db[_0xb903('0x3e')],{'as':_0xb903('0x16a'),'onDelete':_0xb903('0x118')});db[_0xb903('0x40')]['hasMany'](db[_0xb903('0x89')],{'as':_0xb903('0x16b'),'foreignKey':_0xb903('0x165'),'onDelete':_0xb903('0x118')});db[_0xb903('0x40')][_0xb903('0x11a')](db['CannedAnswer'],{'as':_0xb903('0x16c'),'foreignKey':'MailAccountId'});db[_0xb903('0x40')][_0xb903('0x11a')](db[_0xb903('0x46')],{'as':_0xb903('0x15d'),'foreignKey':'MailAccountId'});db[_0xb903('0x40')][_0xb903('0x11a')](db['MailInteraction'],{'as':'Interactions'});db[_0xb903('0x40')][_0xb903('0x11a')](db['MailApplication'],{'as':_0xb903('0x148')});db[_0xb903('0x40')][_0xb903('0x129')](db[_0xb903('0x13a')],{'as':'List','foreignKey':_0xb903('0x16d')});db['MailAccount']['belongsTo'](db[_0xb903('0x16e')],{'as':_0xb903('0x16e'),'foreignKey':'TemplateId'});db[_0xb903('0x40')][_0xb903('0x129')](db[_0xb903('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xb903('0x40')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':_0xb903('0x16f')});db[_0xb903('0x42')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':_0xb903('0x34')});db['MailQueue'][_0xb903('0x12a')](db[_0xb903('0xea')],{'through':_0xb903('0x170'),'as':_0xb903('0x171')});db[_0xb903('0x45')]['hasMany'](db[_0xb903('0x46')],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0xb903('0x45')][_0xb903('0x129')](db[_0xb903('0x40')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x165')});db[_0xb903('0x45')][_0xb903('0x129')](db['CmContact'],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x45')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':'Owner','foreignKey':_0xb903('0x119')});db[_0xb903('0x45')][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x173'),'as':_0xb903('0x174')});db[_0xb903('0x45')][_0xb903('0x12a')](db['Tag'],{'through':_0xb903('0x173'),'as':_0xb903('0x175')});db[_0xb903('0x45')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x176'),'through':_0xb903('0x177'),'foreignKey':_0xb903('0x178')});db[_0xb903('0x46')][_0xb903('0x11a')](db[_0xb903('0xf0')],{'as':_0xb903('0x179'),'onDelete':_0xb903('0x118')});db[_0xb903('0x46')][_0xb903('0x129')](db['User'],{'as':_0xb903('0x13')});db[_0xb903('0x46')][_0xb903('0x129')](db['CmContact'],{'onDelete':'cascade','as':_0xb903('0x163')});db[_0xb903('0x46')][_0xb903('0x129')](db[_0xb903('0x45')],{'as':'Interaction','foreignKey':'MailInteractionId'});db[_0xb903('0x46')][_0xb903('0x129')](db[_0xb903('0x40')],{'as':'Account','foreignKey':_0xb903('0x165')});db[_0xb903('0x46')]['belongsTo'](db[_0xb903('0x17a')],{'as':_0xb903('0x17a'),'foreignKey':'ChatWebsiteId'});db[_0xb903('0x46')][_0xb903('0x129')](db[_0xb903('0x70')],{'as':_0xb903('0x70'),'foreignKey':'ChatOfflineMessageId'});db[_0xb903('0x48')][_0xb903('0x129')](db['User'],{'onDelete':'restrict'});db[_0xb903('0x48')]['belongsTo'](db[_0xb903('0x42')],{'onDelete':_0xb903('0x168')});db['MailApplication'][_0xb903('0x129')](db[_0xb903('0x40')],{'onDelete':'restrict'});db[_0xb903('0x48')][_0xb903('0x129')](db[_0xb903('0x8c')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x155')});db[_0xb903('0x48')][_0xb903('0x129')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xb903('0x17b')});db[_0xb903('0x4a')][_0xb903('0x129')](db[_0xb903('0x40')],{});db[_0xb903('0x4a')][_0xb903('0x129')](db[_0xb903('0x13a')],{'as':'List','foreignKey':_0xb903('0x16d')});db['MailQueueReport'][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x4a')]['belongsTo'](db[_0xb903('0x45')],{});db['MailQueueReport'][_0xb903('0x129')](db[_0xb903('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xb903('0x13')],{});db[_0xb903('0x4a')]['belongsTo'](db[_0xb903('0x42')],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':_0xb903('0x118')});db[_0xb903('0x13d')][_0xb903('0x11a')](db['Disposition'],{'as':_0xb903('0x16b'),'foreignKey':_0xb903('0x17c'),'onDelete':_0xb903('0x118')});db[_0xb903('0x13d')][_0xb903('0x11a')](db[_0xb903('0x87')],{'as':_0xb903('0x16c'),'foreignKey':_0xb903('0x17c')});db[_0xb903('0x13d')][_0xb903('0x11a')](db[_0xb903('0x123')],{'as':_0xb903('0x17d')});db[_0xb903('0x13d')][_0xb903('0x11a')](db[_0xb903('0x4f')],{'as':_0xb903('0x148')});db['FaxAccount'][_0xb903('0x11a')](db['VoiceExtension'],{'as':_0xb903('0x17e'),'onDelete':_0xb903('0x118')});db[_0xb903('0x13d')][_0xb903('0x11a')](db['FaxMessage'],{'as':_0xb903('0x15d')});db[_0xb903('0x13d')][_0xb903('0x129')](db[_0xb903('0x2d')],{'as':_0xb903('0x2d')});db[_0xb903('0x13d')][_0xb903('0x129')](db[_0xb903('0x13a')],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0x13d')]['belongsTo'](db[_0xb903('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0xb903('0x157')});db[_0xb903('0x13d')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':'user_has_fax_accounts'});db[_0xb903('0x4f')][_0xb903('0x129')](db[_0xb903('0x13')],{'onDelete':'restrict'});db[_0xb903('0x4f')]['belongsTo'](db[_0xb903('0x52')],{'onDelete':_0xb903('0x168')});db[_0xb903('0x4f')]['belongsTo'](db[_0xb903('0x13d')],{'onDelete':_0xb903('0x168')});db[_0xb903('0x4f')][_0xb903('0x129')](db[_0xb903('0x95')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x17b')});db[_0xb903('0x123')][_0xb903('0x11a')](db['FaxMessage'],{'as':_0xb903('0x15d'),'onDelete':'cascade','foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0xb903('0x129')](db['FaxAccount'],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x17c')});db[_0xb903('0x123')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db['FaxInteraction'][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x180'),'foreignKey':_0xb903('0x119')});db[_0xb903('0x123')][_0xb903('0x12a')](db['Tag'],{'through':_0xb903('0x181'),'as':_0xb903('0x174')});db['FaxInteraction'][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x181'),'as':'ThroughTags'});db[_0xb903('0x123')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x176'),'through':_0xb903('0x131'),'foreignKey':'FaxInteractionId'});db[_0xb903('0x182')]['belongsTo'](db[_0xb903('0x13')],{'onDelete':'cascade','as':_0xb903('0x13')});db[_0xb903('0x182')]['belongsTo'](db[_0xb903('0x123')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0xb903('0x182')][_0xb903('0x129')](db['CmContact'],{'onDelete':'cascade','as':_0xb903('0x163')});db['FaxMessage'][_0xb903('0x129')](db['Attachment'],{'as':_0xb903('0xf0'),'foreignKey':_0xb903('0x183')});db[_0xb903('0x182')]['belongsTo'](db[_0xb903('0x13d')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x17c')});db['FaxQueue'][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':_0xb903('0x138')});db['FaxQueue'][_0xb903('0x12a')](db[_0xb903('0xea')],{'through':_0xb903('0x184'),'as':_0xb903('0x171')});db[_0xb903('0x185')][_0xb903('0x129')](db[_0xb903('0x13d')],{});db['FaxQueueReport'][_0xb903('0x129')](db['CmList'],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0x185')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x185')][_0xb903('0x129')](db[_0xb903('0x123')],{});db[_0xb903('0x185')][_0xb903('0x129')](db[_0xb903('0x182')],{});db[_0xb903('0x185')][_0xb903('0x129')](db[_0xb903('0x13')],{});db[_0xb903('0x185')][_0xb903('0x129')](db[_0xb903('0x52')],{});db[_0xb903('0x55')][_0xb903('0x11a')](db[_0xb903('0x89')],{'as':_0xb903('0x16b'),'foreignKey':_0xb903('0x186'),'onDelete':_0xb903('0x118')});db[_0xb903('0x55')][_0xb903('0x11a')](db[_0xb903('0x87')],{'as':_0xb903('0x16c'),'foreignKey':'SmsAccountId'});db[_0xb903('0x55')][_0xb903('0x11a')](db[_0xb903('0x5b')],{'as':_0xb903('0x15d'),'foreignKey':_0xb903('0x186')});db[_0xb903('0x55')]['hasMany'](db[_0xb903('0x59')],{'as':'Interactions'});db[_0xb903('0x55')][_0xb903('0x11a')](db[_0xb903('0x57')],{'as':_0xb903('0x148')});db['SmsAccount']['belongsTo'](db[_0xb903('0x13a')],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0x55')][_0xb903('0x129')](db[_0xb903('0x8e')],{'as':_0xb903('0x156'),'foreignKey':_0xb903('0x157')});db[_0xb903('0x55')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':_0xb903('0x142')});db[_0xb903('0x57')][_0xb903('0x129')](db[_0xb903('0x13')],{'onDelete':_0xb903('0x168')});db['SmsApplication'][_0xb903('0x129')](db[_0xb903('0x5d')],{'onDelete':_0xb903('0x168')});db['SmsApplication'][_0xb903('0x129')](db[_0xb903('0x55')],{'onDelete':_0xb903('0x168')});db[_0xb903('0x57')][_0xb903('0x129')](db[_0xb903('0x8c')],{'onDelete':_0xb903('0x168'),'foreignKey':'IntervalId'});db[_0xb903('0x57')][_0xb903('0x129')](db[_0xb903('0x95')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x17b')});db[_0xb903('0x59')][_0xb903('0x11a')](db[_0xb903('0x5b')],{'as':_0xb903('0x15d'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x187')});db[_0xb903('0x59')]['belongsTo'](db['SmsAccount'],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x186')});db['SmsInteraction'][_0xb903('0x129')](db[_0xb903('0x78')],{'as':'Contact','foreignKey':'ContactId'});db['SmsInteraction'][_0xb903('0x129')](db[_0xb903('0x13')],{'as':'Owner','foreignKey':_0xb903('0x119')});db[_0xb903('0x59')][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x188'),'as':'Tags'});db[_0xb903('0x59')][_0xb903('0x12a')](db['Tag'],{'through':_0xb903('0x188'),'as':_0xb903('0x175')});db['SmsInteraction'][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':'Users','through':_0xb903('0x132'),'foreignKey':_0xb903('0x187')});db['SmsMessage'][_0xb903('0x129')](db['User'],{'as':_0xb903('0x13')});db[_0xb903('0x5b')][_0xb903('0x129')](db[_0xb903('0x78')],{'onDelete':_0xb903('0x118'),'as':'Contact'});db[_0xb903('0x5b')][_0xb903('0x129')](db[_0xb903('0x59')],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x189'),'foreignKey':_0xb903('0x187')});db[_0xb903('0x5b')][_0xb903('0x129')](db[_0xb903('0x55')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x186')});db[_0xb903('0x5d')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':'UserSmsQueue','foreignKey':_0xb903('0x18a')});db['SmsQueue'][_0xb903('0x12a')](db[_0xb903('0xea')],{'through':_0xb903('0x18b'),'as':_0xb903('0x171')});db[_0xb903('0x5f')][_0xb903('0x11a')](db[_0xb903('0x89')],{'as':'Dispositions','foreignKey':_0xb903('0x18c'),'onDelete':_0xb903('0x118')});db[_0xb903('0x5f')]['hasMany'](db[_0xb903('0x87')],{'as':_0xb903('0x16c'),'foreignKey':_0xb903('0x18c')});db[_0xb903('0x5f')]['hasMany'](db[_0xb903('0x62')],{'as':_0xb903('0x17d'),'foreignKey':'OpenchannelAccountId'});db[_0xb903('0x5f')][_0xb903('0x11a')](db[_0xb903('0x64')],{'as':_0xb903('0x15d'),'foreignKey':_0xb903('0x18c')});db['OpenchannelAccount'][_0xb903('0x11a')](db[_0xb903('0x61')],{'as':_0xb903('0x148'),'foreignKey':_0xb903('0x18c')});db['OpenchannelAccount'][_0xb903('0x129')](db['CmList'],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0x5f')][_0xb903('0x129')](db['Pause'],{'as':_0xb903('0x156'),'foreignKey':_0xb903('0x157')});db['OpenchannelAccount'][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':_0xb903('0x140')});db[_0xb903('0x61')][_0xb903('0x129')](db[_0xb903('0x13')],{'onDelete':_0xb903('0x168')});db[_0xb903('0x61')][_0xb903('0x129')](db[_0xb903('0x66')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x18d')});db['OpenchannelApplication'][_0xb903('0x129')](db[_0xb903('0x5f')],{'onDelete':'restrict','foreignKey':_0xb903('0x18c')});db[_0xb903('0x61')][_0xb903('0x129')](db[_0xb903('0x8c')],{'onDelete':'restrict','foreignKey':_0xb903('0x155')});db['OpenchannelApplication']['belongsTo'](db[_0xb903('0x95')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x17b')});db['OpenchannelInteraction'][_0xb903('0x11a')](db[_0xb903('0x64')],{'as':'Messages','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x18e')});db[_0xb903('0x62')][_0xb903('0x129')](db['OpenchannelAccount'],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x18c')});db['OpenchannelInteraction'][_0xb903('0x129')](db['CmContact'],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x62')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x180'),'foreignKey':_0xb903('0x119')});db['OpenchannelInteraction'][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x18f'),'as':_0xb903('0x174')});db[_0xb903('0x62')][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x18f'),'as':_0xb903('0x175')});db[_0xb903('0x62')][_0xb903('0x12a')](db['User'],{'as':_0xb903('0x176'),'through':_0xb903('0x190'),'foreignKey':_0xb903('0x18e')});db[_0xb903('0x64')][_0xb903('0x129')](db[_0xb903('0x13')],{'onDelete':_0xb903('0x118'),'as':'User'});db[_0xb903('0x64')][_0xb903('0x129')](db[_0xb903('0x78')],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x163')});db['OpenchannelMessage'][_0xb903('0x129')](db[_0xb903('0x62')],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x189'),'foreignKey':_0xb903('0x18e')});db['OpenchannelMessage']['belongsTo'](db[_0xb903('0xf0')],{'as':_0xb903('0xf0'),'foreignKey':_0xb903('0x183')});db[_0xb903('0x64')]['belongsTo'](db[_0xb903('0x5f')],{'as':'Account','foreignKey':_0xb903('0x18c')});db[_0xb903('0x66')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':'Agents','through':_0xb903('0x39'),'foreignKey':'OpenchannelQueueId'});db[_0xb903('0x66')][_0xb903('0x12a')](db[_0xb903('0xea')],{'through':_0xb903('0x191'),'as':_0xb903('0x171')});db['ChatWebsite']['hasMany'](db[_0xb903('0x89')],{'as':_0xb903('0x16b'),'foreignKey':_0xb903('0x192'),'onDelete':_0xb903('0x118')});db[_0xb903('0x17a')]['hasMany'](db[_0xb903('0x87')],{'as':_0xb903('0x16c'),'foreignKey':'ChatWebsiteId'});db[_0xb903('0x17a')][_0xb903('0x11a')](db[_0xb903('0x193')],{'as':_0xb903('0x194')});db[_0xb903('0x17a')][_0xb903('0x11a')](db[_0xb903('0x6c')],{'as':'Interactions'});db[_0xb903('0x17a')][_0xb903('0x11a')](db[_0xb903('0x6a')],{'as':_0xb903('0x148')});db['ChatWebsite'][_0xb903('0x11a')](db[_0xb903('0x6e')],{'as':_0xb903('0x15d')});db[_0xb903('0x17a')][_0xb903('0x129')](db['CmList'],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d')});db['ChatWebsite']['belongsTo'](db['Interval'],{'as':_0xb903('0x8c'),'foreignKey':_0xb903('0x155')});db['ChatWebsite'][_0xb903('0x129')](db['MailAccount'],{'as':_0xb903('0x40'),'foreignKey':'MailAccountId'});db[_0xb903('0x17a')][_0xb903('0x129')](db['Pause'],{'as':_0xb903('0x156'),'foreignKey':_0xb903('0x157')});db[_0xb903('0x17a')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':'Agents','through':_0xb903('0x13c')});db[_0xb903('0x195')][_0xb903('0x129')](db[_0xb903('0x5f')],{});db[_0xb903('0x195')][_0xb903('0x129')](db['CmList'],{'as':'List','foreignKey':_0xb903('0x16d')});db[_0xb903('0x195')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x195')][_0xb903('0x129')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xb903('0x129')](db[_0xb903('0x64')],{});db[_0xb903('0x195')][_0xb903('0x129')](db[_0xb903('0x13')],{});db[_0xb903('0x195')][_0xb903('0x129')](db[_0xb903('0x66')],{});db['ChatApplication'][_0xb903('0x129')](db['User'],{'as':_0xb903('0x196'),'foreignKey':'UserId','onDelete':_0xb903('0x168')});db[_0xb903('0x6a')][_0xb903('0x129')](db[_0xb903('0x135')],{'as':_0xb903('0x197'),'foreignKey':'ChatQueueId','onDelete':_0xb903('0x168')});db['ChatApplication'][_0xb903('0x129')](db[_0xb903('0x17a')],{'as':_0xb903('0x198'),'foreignKey':'ChatWebsiteId','onDelete':_0xb903('0x168')});db['ChatApplication']['belongsTo'](db[_0xb903('0x95')],{'onDelete':'restrict','foreignKey':_0xb903('0x17b')});db[_0xb903('0x6c')][_0xb903('0x11a')](db[_0xb903('0x6e')],{'as':_0xb903('0x15d'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x199')});db[_0xb903('0x6c')][_0xb903('0x129')](db[_0xb903('0x17a')],{'as':_0xb903('0x172'),'foreignKey':'ChatWebsiteId'});db[_0xb903('0x6c')][_0xb903('0x129')](db['CmContact'],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db['ChatInteraction'][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x180'),'foreignKey':'UserId'});db['ChatInteraction'][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x19a'),'as':_0xb903('0x174')});db[_0xb903('0x6c')]['belongsToMany'](db[_0xb903('0x95')],{'through':_0xb903('0x19a'),'as':_0xb903('0x175')});db[_0xb903('0x6c')][_0xb903('0x12a')](db['User'],{'as':_0xb903('0x176'),'through':_0xb903('0x19b'),'foreignKey':_0xb903('0x199')});db[_0xb903('0x6e')]['belongsTo'](db['User'],{'onDelete':_0xb903('0x118'),'as':'User'});db[_0xb903('0x6e')][_0xb903('0x129')](db[_0xb903('0x78')],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db['ChatMessage'][_0xb903('0x129')](db[_0xb903('0x6c')],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x189'),'foreignKey':_0xb903('0x199')});db[_0xb903('0x6e')][_0xb903('0x129')](db[_0xb903('0xf0')],{'as':_0xb903('0xf0'),'foreignKey':_0xb903('0x183')});db['ChatMessage']['belongsTo'](db[_0xb903('0x17a')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x192')});db[_0xb903('0x70')][_0xb903('0x11a')](db[_0xb903('0xf0')],{'as':_0xb903('0x179'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0xb903('0x70')]['belongsTo'](db[_0xb903('0x78')],{'onDelete':_0xb903('0x118'),'as':'Contact','foreignKey':_0xb903('0x164')});db['ChatOfflineMessage']['belongsTo'](db[_0xb903('0x17a')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x192')});db['ChatQueue'][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x159'),'through':_0xb903('0x32'),'hooks':!![]});db[_0xb903('0x135')][_0xb903('0x12a')](db[_0xb903('0xea')],{'through':'team_has_chat_queues','as':_0xb903('0x171')});db[_0xb903('0x73')][_0xb903('0x11a')](db[_0xb903('0xd9')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xb903('0x118')});db[_0xb903('0x73')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x14d'),'through':_0xb903('0x19c')});db['ChatProactiveAction'][_0xb903('0x129')](db[_0xb903('0x17a')],{'as':_0xb903('0x198'),'foreignKey':_0xb903('0x192')});db[_0xb903('0x76')][_0xb903('0x11a')](db['CmContact'],{'as':_0xb903('0x12c'),'foreignKey':_0xb903('0x19d')});db[_0xb903('0x78')]['hasMany'](db[_0xb903('0x99')],{'as':_0xb903('0x19e'),'foreignKey':_0xb903('0x19f')});db[_0xb903('0x78')][_0xb903('0x11a')](db[_0xb903('0x14f')],{'as':_0xb903('0x150'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x78')][_0xb903('0x11a')](db[_0xb903('0x7c')],{'as':_0xb903('0x11e'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x78')][_0xb903('0x11a')](db['CmHopperHistory'],{'as':_0xb903('0x1a0'),'foreignKey':'ContactId'});db[_0xb903('0x78')]['hasMany'](db[_0xb903('0x80')],{'as':'ReportAgentPreview','foreignKey':_0xb903('0x164')});db[_0xb903('0x78')][_0xb903('0x11a')](db[_0xb903('0xdc')],{'as':_0xb903('0x152'),'foreignKey':_0xb903('0x164')});db['CmContact']['hasMany'](db[_0xb903('0x62')],{'as':_0xb903('0x120'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db['ChatInteraction'],{'as':_0xb903('0x121'),'foreignKey':_0xb903('0x164'),'onDelete':_0xb903('0x168')});db[_0xb903('0x78')][_0xb903('0x11a')](db[_0xb903('0x59')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0xb903('0x168')});db[_0xb903('0x78')][_0xb903('0x11a')](db[_0xb903('0x123')],{'as':'FaxInteractions','foreignKey':_0xb903('0x164'),'onDelete':_0xb903('0x168')});db[_0xb903('0x78')][_0xb903('0x11a')](db[_0xb903('0x45')],{'as':_0xb903('0x125'),'foreignKey':_0xb903('0x164'),'onDelete':'restrict'});db['CmContact']['belongsTo'](db[_0xb903('0x76')],{'as':_0xb903('0x1a1'),'foreignKey':_0xb903('0x19d')});db['CmContact'][_0xb903('0x129')](db['CmList'],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d'),'onDelete':_0xb903('0x118')});db[_0xb903('0x78')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':_0xb903('0x176'),'through':_0xb903('0x12d')});db['CmContact'][_0xb903('0x12a')](db[_0xb903('0x95')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xb903('0x78')][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xb903('0x14f')]['hasMany'](db[_0xb903('0x1a2')],{'as':_0xb903('0x1a3'),'foreignKey':'CmHopperId'});db[_0xb903('0x14f')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':'ContactId','onDelete':_0xb903('0x118')});db[_0xb903('0x14f')][_0xb903('0x129')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0xb903('0x118')});db[_0xb903('0x14f')]['belongsTo'](db[_0xb903('0x13')],{'as':_0xb903('0x196'),'foreignKey':'UserId'});db[_0xb903('0x14f')][_0xb903('0x129')](db[_0xb903('0x1d')],{'as':_0xb903('0x197'),'foreignKey':_0xb903('0x14e'),'onDelete':_0xb903('0x118')});db[_0xb903('0x14f')][_0xb903('0x129')](db[_0xb903('0xee')],{'as':_0xb903('0xee'),'foreignKey':_0xb903('0x1a4'),'onDelete':_0xb903('0x118')});db[_0xb903('0x14f')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x180'),'foreignKey':_0xb903('0x1a5')});db['CmHopperBlack'][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164'),'onDelete':_0xb903('0x118')});db[_0xb903('0x7a')][_0xb903('0x129')](db[_0xb903('0x13a')],{'as':'List','foreignKey':_0xb903('0x16d'),'onDelete':'cascade'});db[_0xb903('0x7a')][_0xb903('0x129')](db[_0xb903('0x1d')],{'as':_0xb903('0x197'),'foreignKey':_0xb903('0x14e'),'onDelete':'cascade'});db[_0xb903('0x7a')][_0xb903('0x129')](db['Campaign'],{'as':_0xb903('0xee'),'foreignKey':'CampaignId','onDelete':_0xb903('0x118')});db[_0xb903('0x85')][_0xb903('0x11a')](db['Condition'],{'as':{'plural':_0xb903('0x1a6'),'singular':'OneAll'},'foreignKey':_0xb903('0x1a7'),'onDelete':_0xb903('0x118'),'hooks':!![]});db[_0xb903('0x85')]['hasMany'](db[_0xb903('0x8b')],{'as':{'plural':'Any','singular':_0xb903('0x1a8')},'foreignKey':_0xb903('0x1a9'),'onDelete':_0xb903('0x118'),'hooks':!![]});db['Automation'][_0xb903('0x11a')](db[_0xb903('0x83')],{'as':_0xb903('0x1aa'),'foreignKey':_0xb903('0x1ab'),'onDelete':_0xb903('0x118'),'hooks':!![]});db[_0xb903('0x89')][_0xb903('0x11a')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xb903('0x1ac'),'onDelete':_0xb903('0x118')});db['Interval'][_0xb903('0x11a')](db[_0xb903('0x8c')],{'as':_0xb903('0x1ad'),'foreignKey':_0xb903('0x155'),'onDelete':_0xb903('0x118'),'hooks':!![],'required':![]});db[_0xb903('0x8c')][_0xb903('0x11a')](db[_0xb903('0x145')],{'as':_0xb903('0x1ae'),'foreignKey':'IntervalId','onDelete':_0xb903('0x168')});db[_0xb903('0x8c')][_0xb903('0x11a')](db[_0xb903('0x48')],{'as':_0xb903('0x1af'),'foreignKey':_0xb903('0x155')});db['Interval'][_0xb903('0x11a')](db[_0xb903('0x6a')],{'as':_0xb903('0x1b0'),'foreignKey':_0xb903('0x155')});db[_0xb903('0x8c')]['hasMany'](db[_0xb903('0x4f')],{'as':_0xb903('0x1b1'),'foreignKey':'IntervalId'});db[_0xb903('0x8c')][_0xb903('0x11a')](db[_0xb903('0x57')],{'as':_0xb903('0x1b2'),'foreignKey':_0xb903('0x155')});db[_0xb903('0x93')][_0xb903('0x129')](db[_0xb903('0x40')],{});db['Schedule']['belongsTo'](db[_0xb903('0x1b3')],{'foreignKey':'DefaultReportId'});db[_0xb903('0x93')][_0xb903('0x129')](db[_0xb903('0xa3')],{'foreignKey':_0xb903('0x1b4')});db[_0xb903('0x149')][_0xb903('0x12a')](db[_0xb903('0x1b')],{'as':_0xb903('0x1b5'),'through':_0xb903('0x14b'),'onDelete':_0xb903('0x168')});db[_0xb903('0x95')]['belongsToMany'](db[_0xb903('0x78')],{'through':_0xb903('0x1b6')});db[_0xb903('0x95')][_0xb903('0x12a')](db['ChatInteraction'],{'through':_0xb903('0x19a')});db[_0xb903('0x95')]['belongsToMany'](db[_0xb903('0x45')],{'through':_0xb903('0x173')});db[_0xb903('0x95')][_0xb903('0x12a')](db[_0xb903('0x59')],{'through':_0xb903('0x188')});db['Tag']['belongsToMany'](db[_0xb903('0x123')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xb903('0x12a')](db[_0xb903('0x62')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0xb903('0x12a')](db[_0xb903('0x126')],{'through':_0xb903('0x1b7')});db[_0xb903('0x99')][_0xb903('0x129')](db[_0xb903('0x97')],{'as':_0xb903('0x1b8'),'foreignKey':'ItemTypeId'});db['CmHopperAdditionalPhone'][_0xb903('0x129')](db[_0xb903('0x14f')],{'as':'Hopper','foreignKey':_0xb903('0x1b9')});db[_0xb903('0x99')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':'CmContactId'});db[_0xb903('0x9d')]['hasMany'](db[_0xb903('0x8b')],{'as':{'plural':_0xb903('0x1ba'),'singular':_0xb903('0x1bb')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xb903('0x9d')][_0xb903('0x11a')](db[_0xb903('0x8b')],{'as':{'plural':_0xb903('0x1bc'),'singular':_0xb903('0x1bd')},'foreignKey':_0xb903('0x1be'),'onDelete':_0xb903('0x118'),'hooks':!![]});db[_0xb903('0x9d')]['hasMany'](db[_0xb903('0x83')],{'as':_0xb903('0x1aa'),'foreignKey':_0xb903('0x1bf'),'onDelete':_0xb903('0x118'),'hooks':!![]});db[_0xb903('0xa3')]['hasMany'](db[_0xb903('0xa9')],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1b4'),'hooks':!![]});db[_0xb903('0x1b3')][_0xb903('0x11a')](db['AnalyticFieldReport'],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':'DefaultReportId'});db[_0xb903('0xa8')][_0xb903('0x11a')](db[_0xb903('0xa9')],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c1')});db['AnalyticFieldReport']['belongsTo'](db[_0xb903('0xa8')],{'foreignKey':'MetricId'});db[_0xb903('0xab')][_0xb903('0x11a')](db[_0xb903('0x1c2')],{'as':_0xb903('0x1c3'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0x1c2')]['hasMany'](db[_0xb903('0xae')],{'as':'Subjects','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0x1c2')][_0xb903('0x11a')](db[_0xb903('0xae')],{'as':_0xb903('0x1c6'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0x1c2')][_0xb903('0x11a')](db[_0xb903('0xae')],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xb903('0x129')](db[_0xb903('0xab')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0xae')][_0xb903('0x11a')](db['SalesforceField'],{'as':_0xb903('0x1c8'),'foreignKey':_0xb903('0x1c5')});db['SalesforceField']['hasMany'](db[_0xb903('0xae')],{'as':_0xb903('0x1c9'),'foreignKey':'DescriptionId'});db[_0xb903('0xae')][_0xb903('0x11a')](db[_0xb903('0xae')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xae')][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':_0xb903('0x9f'),'foreignKey':_0xb903('0x1cc')});db[_0xb903('0x1cd')][_0xb903('0x11a')](db[_0xb903('0xb1')],{'as':_0xb903('0x1c3'),'onDelete':_0xb903('0x118'),'foreignKey':'AccountId'});db[_0xb903('0xb1')][_0xb903('0x11a')](db[_0xb903('0x1ce')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0xb903('0xb1')]['hasMany'](db[_0xb903('0x1ce')],{'as':_0xb903('0x1c6'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c7')});db['SugarcrmConfiguration'][_0xb903('0x11a')](db['SugarcrmField'],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1cb')});db['SugarcrmConfiguration'][_0xb903('0x129')](db['SugarcrmAccount'],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0x1ce')][_0xb903('0x11a')](db[_0xb903('0x1ce')],{'as':_0xb903('0x1c8'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0x1ce')]['hasMany'](db[_0xb903('0x1ce')],{'as':'Description','foreignKey':_0xb903('0x1c7')});db[_0xb903('0x1ce')][_0xb903('0x11a')](db[_0xb903('0x1ce')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db['SugarcrmField'][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':_0xb903('0x9f'),'foreignKey':_0xb903('0x1cc')});db[_0xb903('0x1cf')][_0xb903('0x11a')](db[_0xb903('0xb4')],{'as':'Configurations','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0xb4')][_0xb903('0x11a')](db['DeskField'],{'as':_0xb903('0x1d0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xb4')][_0xb903('0x11a')](db['DeskField'],{'as':_0xb903('0x1c6'),'onDelete':_0xb903('0x118'),'foreignKey':'DescriptionId'});db[_0xb903('0xb4')][_0xb903('0x11a')](db['DeskField'],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xb4')][_0xb903('0x129')](db[_0xb903('0x1cf')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x1c4')});db['DeskConfiguration'][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x1d1')});db[_0xb903('0xb6')][_0xb903('0x11a')](db[_0xb903('0xb6')],{'as':_0xb903('0x1c8'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xb6')][_0xb903('0x11a')](db['DeskField'],{'as':_0xb903('0x1c9'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0xb6')]['hasMany'](db[_0xb903('0xb6')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xb6')][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':_0xb903('0x9f'),'foreignKey':_0xb903('0x1cc')});db[_0xb903('0x1d2')]['hasMany'](db[_0xb903('0xb7')],{'as':_0xb903('0x1c3'),'onDelete':'cascade','foreignKey':_0xb903('0x1c4')});db[_0xb903('0xb7')][_0xb903('0x11a')](db['ZohoField'],{'as':_0xb903('0x1d0'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xb903('0xb7')]['hasMany'](db[_0xb903('0x1d3')],{'as':_0xb903('0x1c6'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c7')});db['ZohoConfiguration'][_0xb903('0x11a')](db[_0xb903('0x1d3')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xb903('0xb7')]['belongsTo'](db['ZohoAccount'],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0x1d3')][_0xb903('0x11a')](db[_0xb903('0x1d3')],{'as':'Subject','foreignKey':_0xb903('0x1c5')});db['ZohoField']['hasMany'](db[_0xb903('0x1d3')],{'as':_0xb903('0x1c9'),'foreignKey':'DescriptionId'});db[_0xb903('0x1d3')][_0xb903('0x11a')](db[_0xb903('0x1d3')],{'as':'Field','foreignKey':_0xb903('0x1cb')});db[_0xb903('0x1d3')][_0xb903('0x129')](db['Variable'],{'as':'Variable','foreignKey':_0xb903('0x1cc')});db[_0xb903('0x1d4')][_0xb903('0x11a')](db[_0xb903('0xbb')],{'as':_0xb903('0x1c3'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0xbb')][_0xb903('0x11a')](db[_0xb903('0xbc')],{'as':_0xb903('0x1d0'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xbb')]['hasMany'](db[_0xb903('0xbc')],{'as':_0xb903('0x1c6'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0xbb')][_0xb903('0x11a')](db['ZendeskField'],{'as':_0xb903('0x1c0'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xbb')][_0xb903('0x129')](db['ZendeskAccount'],{'as':_0xb903('0x172'),'foreignKey':'AccountId'});db[_0xb903('0xbb')]['belongsToMany'](db[_0xb903('0x95')],{'through':_0xb903('0x1d5')});db[_0xb903('0xbc')]['hasMany'](db[_0xb903('0xbc')],{'as':_0xb903('0x1c8'),'foreignKey':'SubjectId'});db[_0xb903('0xbc')]['hasMany'](db[_0xb903('0xbc')],{'as':'Description','foreignKey':_0xb903('0x1c7')});db['ZendeskField'][_0xb903('0x11a')](db['ZendeskField'],{'as':'Field','foreignKey':_0xb903('0x1cb')});db[_0xb903('0xbc')][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':_0xb903('0x9f'),'foreignKey':'VariableId'});db[_0xb903('0xbe')][_0xb903('0x11a')](db[_0xb903('0x1d6')],{'as':'Configurations','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c4')});db['FreshdeskConfiguration'][_0xb903('0x11a')](db[_0xb903('0xc1')],{'as':'Subjects','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0x1d6')][_0xb903('0x11a')](db['FreshdeskField'],{'as':_0xb903('0x1c6'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xb903('0x1d6')]['hasMany'](db['FreshdeskField'],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0x1d6')]['belongsTo'](db[_0xb903('0xbe')],{'as':'Account','foreignKey':_0xb903('0x1c4')});db[_0xb903('0x1d6')][_0xb903('0x12a')](db['Tag'],{'through':_0xb903('0x1d7')});db[_0xb903('0xc1')][_0xb903('0x11a')](db[_0xb903('0xc1')],{'as':_0xb903('0x1c8'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xc1')][_0xb903('0x11a')](db[_0xb903('0xc1')],{'as':_0xb903('0x1c9'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0xc1')][_0xb903('0x11a')](db[_0xb903('0xc1')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db['FreshdeskField'][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':_0xb903('0x9f'),'foreignKey':_0xb903('0x1cc')});db[_0xb903('0x1d8')][_0xb903('0x11a')](db[_0xb903('0xc3')],{'as':_0xb903('0x1c3'),'onDelete':_0xb903('0x118'),'foreignKey':'AccountId'});db[_0xb903('0xc3')][_0xb903('0x11a')](db[_0xb903('0xc5')],{'as':_0xb903('0x1d0'),'foreignKey':'SubjectId'});db[_0xb903('0xc3')][_0xb903('0x11a')](db[_0xb903('0xc5')],{'as':_0xb903('0x1c6'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0xc3')][_0xb903('0x11a')](db[_0xb903('0xc5')],{'as':_0xb903('0x1c0'),'foreignKey':_0xb903('0x1cb')});db['VtigerConfiguration']['belongsTo'](db[_0xb903('0x1d8')],{'as':_0xb903('0x172'),'foreignKey':'AccountId'});db[_0xb903('0xc5')][_0xb903('0x11a')](db['VtigerField'],{'as':_0xb903('0x1c8'),'foreignKey':_0xb903('0x1c5')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xc5')][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':'Variable','foreignKey':'VariableId'});db[_0xb903('0xc7')][_0xb903('0x11a')](db[_0xb903('0xc9')],{'as':'Configurations','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0xc9')][_0xb903('0x11a')](db['ServicenowField'],{'as':_0xb903('0x1d0'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xc9')][_0xb903('0x11a')](db[_0xb903('0x1d9')],{'as':_0xb903('0x1c6'),'foreignKey':'DescriptionId'});db[_0xb903('0xc9')]['hasMany'](db[_0xb903('0x1d9')],{'as':_0xb903('0x1c0'),'foreignKey':'FieldId'});db[_0xb903('0xc9')][_0xb903('0x129')](db[_0xb903('0xc7')],{'as':_0xb903('0x172'),'foreignKey':'AccountId'});db[_0xb903('0x1d9')][_0xb903('0x11a')](db[_0xb903('0x1d9')],{'as':_0xb903('0x1c8'),'foreignKey':'SubjectId'});db['ServicenowField'][_0xb903('0x11a')](db['ServicenowField'],{'as':_0xb903('0x1c9'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0x1d9')][_0xb903('0x11a')](db[_0xb903('0x1d9')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db['ServicenowField'][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account']['hasMany'](db[_0xb903('0xce')],{'as':_0xb903('0x1c3'),'onDelete':'cascade','foreignKey':_0xb903('0x1c4')});db[_0xb903('0xcc')][_0xb903('0x129')](db[_0xb903('0x166')],{'as':_0xb903('0x166'),'foreignKey':_0xb903('0x167')});db[_0xb903('0xce')][_0xb903('0x11a')](db[_0xb903('0x1da')],{'as':_0xb903('0x1d0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xce')][_0xb903('0x11a')](db[_0xb903('0x1da')],{'as':_0xb903('0x1c6'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c7')});db[_0xb903('0xce')][_0xb903('0x11a')](db[_0xb903('0x1da')],{'as':_0xb903('0x1c0'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xce')][_0xb903('0x129')](db[_0xb903('0xcc')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x1c4')});db[_0xb903('0x1da')][_0xb903('0x11a')](db[_0xb903('0x1da')],{'as':_0xb903('0x1c8'),'foreignKey':'SubjectId'});db[_0xb903('0x1da')][_0xb903('0x11a')](db[_0xb903('0x1da')],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xb903('0x11a')](db[_0xb903('0x1da')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0x1da')][_0xb903('0x129')](db[_0xb903('0x9f')],{'as':'Variable','foreignKey':_0xb903('0x1cc')});db[_0xb903('0x1db')][_0xb903('0x11a')](db[_0xb903('0xd2')],{'as':_0xb903('0x1c3'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1c4')});db['FreshsalesConfiguration']['hasMany'](db[_0xb903('0xd4')],{'as':_0xb903('0x1d0'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xd2')][_0xb903('0x11a')](db['FreshsalesField'],{'as':_0xb903('0x1c6'),'foreignKey':'DescriptionId'});db[_0xb903('0xd2')]['hasMany'](db[_0xb903('0xd4')],{'as':_0xb903('0x1c0'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xd2')][_0xb903('0x129')](db[_0xb903('0x1db')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x1c4')});db['FreshsalesField']['hasMany'](db[_0xb903('0xd4')],{'as':_0xb903('0x1c8'),'foreignKey':_0xb903('0x1c5')});db[_0xb903('0xd4')][_0xb903('0x11a')](db[_0xb903('0xd4')],{'as':_0xb903('0x1c9'),'foreignKey':_0xb903('0x1c7')});db['FreshsalesField'][_0xb903('0x11a')](db[_0xb903('0xd4')],{'as':_0xb903('0x1ca'),'foreignKey':_0xb903('0x1cb')});db[_0xb903('0xd4')]['belongsTo'](db[_0xb903('0x9f')],{'as':_0xb903('0x9f'),'foreignKey':_0xb903('0x1cc')});db['ChatQueueReport'][_0xb903('0x129')](db[_0xb903('0x17a')],{});db['ChatQueueReport']['belongsTo'](db[_0xb903('0x13a')],{'as':'List','foreignKey':_0xb903('0x16d')});db[_0xb903('0xd7')]['belongsTo'](db[_0xb903('0x78')],{'as':'Contact','foreignKey':_0xb903('0x164')});db[_0xb903('0xd7')][_0xb903('0x129')](db[_0xb903('0x6c')],{});db['ChatQueueReport'][_0xb903('0x129')](db[_0xb903('0x6e')],{});db['ChatQueueReport']['belongsTo'](db[_0xb903('0x13')],{});db[_0xb903('0xd7')][_0xb903('0x129')](db[_0xb903('0x135')],{});db['ChatInternalMessage'][_0xb903('0x129')](db[_0xb903('0x13')],{'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1dc')});db[_0xb903('0xd9')]['belongsTo'](db[_0xb903('0x13')],{'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x1dd')});db[_0xb903('0xdc')][_0xb903('0x11a')](db[_0xb903('0xdb')],{'foreignKey':_0xb903('0x1de'),'onDelete':_0xb903('0x118')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0xb903('0x1de'),'onDelete':_0xb903('0x118')});db[_0xb903('0xde')]['belongsTo'](db[_0xb903('0x55')],{});db[_0xb903('0xde')]['belongsTo'](db[_0xb903('0x13a')],{'as':_0xb903('0x17f'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0xde')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0xde')][_0xb903('0x129')](db['SmsInteraction'],{});db[_0xb903('0xde')][_0xb903('0x129')](db[_0xb903('0x5b')],{});db[_0xb903('0xde')][_0xb903('0x129')](db['User'],{});db[_0xb903('0xde')][_0xb903('0x129')](db[_0xb903('0x5d')],{});db[_0xb903('0xe2')]['hasMany'](db[_0xb903('0xdc')],{'foreignKey':_0xb903('0x1df')});db[_0xb903('0xe2')][_0xb903('0x11a')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xb903('0xe2')]['hasMany'](db[_0xb903('0x1e0')],{'foreignKey':_0xb903('0x1df')});db['Team'][_0xb903('0x12a')](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0xb903('0xea')][_0xb903('0x12a')](db['VoiceQueue'],{'through':_0xb903('0x110'),'as':_0xb903('0x134')});db[_0xb903('0xea')][_0xb903('0x12a')](db[_0xb903('0x42')],{'through':_0xb903('0x170'),'as':_0xb903('0x1e1')});db[_0xb903('0xea')][_0xb903('0x12a')](db['ChatQueue'],{'through':_0xb903('0x1e2'),'as':'ChatQueues'});db[_0xb903('0xea')]['belongsToMany'](db[_0xb903('0x52')],{'through':_0xb903('0x184'),'as':_0xb903('0x137')});db[_0xb903('0xea')][_0xb903('0x12a')](db[_0xb903('0x5d')],{'through':_0xb903('0x18b'),'as':'SmsQueues'});db[_0xb903('0xea')][_0xb903('0x12a')](db[_0xb903('0x66')],{'through':_0xb903('0x191'),'as':_0xb903('0x139')});db[_0xb903('0xea')][_0xb903('0x12a')](db[_0xb903('0x1e3')],{'through':_0xb903('0x1e4'),'as':'WhatsappQueues'});db['Team'][_0xb903('0x12a')](db[_0xb903('0xfa')],{'through':'TeamVoicePrefix','as':_0xb903('0x1e5')});db['Campaign'][_0xb903('0x11a')](db[_0xb903('0x14f')],{'as':_0xb903('0x150'),'foreignKey':_0xb903('0x1a4')});db[_0xb903('0xee')][_0xb903('0x11a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xb903('0x1a4')});db[_0xb903('0xee')][_0xb903('0x11a')](db[_0xb903('0x7e')],{'as':_0xb903('0x1a0'),'foreignKey':_0xb903('0x1a4')});db[_0xb903('0xee')][_0xb903('0x11a')](db[_0xb903('0x7a')],{'as':_0xb903('0x151'),'foreignKey':_0xb903('0x1a4')});db[_0xb903('0xee')][_0xb903('0x129')](db[_0xb903('0x2d')],{'as':'Trunk','foreignKey':_0xb903('0x1e6')});db[_0xb903('0xee')]['belongsTo'](db['Trunk'],{'as':_0xb903('0x153'),'foreignKey':'TrunkBackupId'});db[_0xb903('0xee')][_0xb903('0x129')](db[_0xb903('0x8c')],{'as':'Interval','foreignKey':_0xb903('0x155')});db[_0xb903('0xee')][_0xb903('0x129')](db[_0xb903('0x1e7')],{'as':'SquareProject','foreignKey':_0xb903('0x1e8')});db[_0xb903('0xee')]['belongsToMany'](db[_0xb903('0x13a')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xb903('0xee')][_0xb903('0x12a')](db['CmList'],{'as':_0xb903('0x15a'),'through':_0xb903('0x1e9')});db['Attachment'][_0xb903('0x129')](db[_0xb903('0x70')],{'as':'ChatOfflineMessage','foreignKey':_0xb903('0x1ea')});db['MailTransferReport'][_0xb903('0x129')](db[_0xb903('0x46')],{});db[_0xb903('0x1eb')]['belongsTo'](db[_0xb903('0x45')],{});db[_0xb903('0x1eb')][_0xb903('0x129')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0xb903('0x1eb')][_0xb903('0x129')](db[_0xb903('0x13')],{'foreignKey':_0xb903('0x1ec'),'as':_0xb903('0x1ed')});db[_0xb903('0x1eb')][_0xb903('0x129')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xb903('0x1eb')]['belongsTo'](db[_0xb903('0x42')],{'foreignKey':_0xb903('0x1ee'),'as':_0xb903('0x1ef')});db['MailTransferReport'][_0xb903('0x129')](db[_0xb903('0x40')],{'foreignKey':'ToMailAccountId','as':_0xb903('0x1f0')});db[_0xb903('0xf3')][_0xb903('0x129')](db[_0xb903('0x6e')],{});db[_0xb903('0xf3')][_0xb903('0x129')](db[_0xb903('0x6c')],{});db[_0xb903('0xf3')]['belongsTo'](db[_0xb903('0x17a')],{'foreignKey':_0xb903('0x1f1'),'as':_0xb903('0x1f2')});db[_0xb903('0xf3')][_0xb903('0x129')](db['User'],{'foreignKey':_0xb903('0x1ec'),'as':_0xb903('0x1ed')});db[_0xb903('0xf3')]['belongsTo'](db['User'],{'foreignKey':_0xb903('0x1f3'),'as':_0xb903('0x1f4')});db['ChatTransferReport']['belongsTo'](db['ChatQueue'],{'foreignKey':_0xb903('0x1f5'),'as':_0xb903('0x1ef')});db['ChatTransferReport'][_0xb903('0x129')](db[_0xb903('0x17a')],{'foreignKey':'ToChatWebsiteId','as':_0xb903('0x1f0')});db[_0xb903('0xf4')]['belongsTo'](db[_0xb903('0x182')],{});db[_0xb903('0xf4')][_0xb903('0x129')](db['FaxInteraction'],{});db[_0xb903('0xf4')][_0xb903('0x129')](db[_0xb903('0x13d')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0xb903('0x13')],{'foreignKey':'FromUserId','as':_0xb903('0x1ed')});db[_0xb903('0xf4')][_0xb903('0x129')](db[_0xb903('0x13')],{'foreignKey':_0xb903('0x1f3'),'as':_0xb903('0x1f4')});db[_0xb903('0xf4')][_0xb903('0x129')](db[_0xb903('0x52')],{'foreignKey':_0xb903('0x1f6'),'as':'ToQueue'});db['FaxTransferReport'][_0xb903('0x129')](db['FaxAccount'],{'foreignKey':_0xb903('0x1f7'),'as':_0xb903('0x1f0')});db[_0xb903('0xf6')]['belongsTo'](db[_0xb903('0x64')],{});db['OpenchannelTransferReport'][_0xb903('0x129')](db[_0xb903('0x62')],{});db[_0xb903('0xf6')]['belongsTo'](db[_0xb903('0x5f')],{'foreignKey':'FromOpenchannelAccountId','as':_0xb903('0x1f2')});db[_0xb903('0xf6')][_0xb903('0x129')](db[_0xb903('0x13')],{'foreignKey':_0xb903('0x1ec'),'as':_0xb903('0x1ed')});db[_0xb903('0xf6')][_0xb903('0x129')](db[_0xb903('0x13')],{'foreignKey':_0xb903('0x1f3'),'as':_0xb903('0x1f4')});db[_0xb903('0xf6')][_0xb903('0x129')](db[_0xb903('0x66')],{'foreignKey':_0xb903('0x1f8'),'as':_0xb903('0x1ef')});db[_0xb903('0xf6')]['belongsTo'](db[_0xb903('0x5f')],{'foreignKey':'ToOpenchannelAccountId','as':_0xb903('0x1f0')});db['SmsTransferReport'][_0xb903('0x129')](db['SmsMessage'],{});db[_0xb903('0xf8')][_0xb903('0x129')](db['SmsInteraction'],{});db['SmsTransferReport'][_0xb903('0x129')](db[_0xb903('0x55')],{'foreignKey':_0xb903('0x1f9'),'as':'FromAccount'});db[_0xb903('0xf8')][_0xb903('0x129')](db[_0xb903('0x13')],{'foreignKey':_0xb903('0x1ec'),'as':_0xb903('0x1ed')});db[_0xb903('0xf8')][_0xb903('0x129')](db['User'],{'foreignKey':_0xb903('0x1f3'),'as':_0xb903('0x1f4')});db[_0xb903('0xf8')]['belongsTo'](db[_0xb903('0x5d')],{'foreignKey':_0xb903('0x1fa'),'as':_0xb903('0x1ef')});db['SmsTransferReport']['belongsTo'](db[_0xb903('0x55')],{'foreignKey':_0xb903('0x1fb'),'as':'ToAccount'});db[_0xb903('0x13a')][_0xb903('0x11a')](db['Disposition'],{'as':_0xb903('0x16b'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xb903('0x13a')][_0xb903('0x11a')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xb903('0x16d')});db[_0xb903('0x13a')]['hasMany'](db[_0xb903('0x78')],{'as':'Contacts','onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x16d')});db['CmList']['hasMany'](db[_0xb903('0x7c')],{'as':_0xb903('0x11e'),'foreignKey':'ListId'});db['CmList'][_0xb903('0x11a')](db['CmHopperHistory'],{'as':_0xb903('0x11f'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0x13a')][_0xb903('0x11a')](db[_0xb903('0x80')],{'as':_0xb903('0x80'),'foreignKey':_0xb903('0x16d')});db[_0xb903('0x13a')][_0xb903('0x12a')](db[_0xb903('0x1d')],{'as':_0xb903('0x1fc'),'through':_0xb903('0x158')});db['CmList'][_0xb903('0x12a')](db['User'],{'as':_0xb903('0x159'),'through':_0xb903('0x12f')});db[_0xb903('0xfa')][_0xb903('0x11a')](db[_0xb903('0x145')],{'as':_0xb903('0x1ae'),'onDelete':_0xb903('0x118')});db[_0xb903('0xfa')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':'Agents','through':_0xb903('0x114')});db[_0xb903('0xfa')][_0xb903('0x12a')](db['Team'],{'through':_0xb903('0x112'),'as':_0xb903('0x171')});db['UserProfile']['hasMany'](db[_0xb903('0x13')],{'as':'Users','foreignKey':'userProfileId'});db[_0xb903('0xfc')][_0xb903('0x11a')](db[_0xb903('0xfe')],{'as':_0xb903('0x1fd'),'foreignKey':_0xb903('0x1fe'),'onDelete':_0xb903('0x118')});db[_0xb903('0xfe')][_0xb903('0x11a')](db[_0xb903('0x100')],{'as':'Resources','foreignKey':_0xb903('0x1ff'),'onDelete':_0xb903('0x118')});db[_0xb903('0x103')][_0xb903('0x11a')](db[_0xb903('0x89')],{'as':_0xb903('0x16b'),'foreignKey':_0xb903('0x200'),'onDelete':_0xb903('0x118')});db[_0xb903('0x103')][_0xb903('0x11a')](db['CannedAnswer'],{'as':_0xb903('0x16c'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0xb903('0x11a')](db[_0xb903('0x108')],{'as':_0xb903('0x15d'),'foreignKey':_0xb903('0x200')});db['WhatsappAccount'][_0xb903('0x11a')](db['WhatsappInteraction'],{'as':_0xb903('0x17d')});db['WhatsappAccount']['hasMany'](db[_0xb903('0x105')],{'as':_0xb903('0x148')});db[_0xb903('0x103')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xb903('0x16d')});db[_0xb903('0x103')][_0xb903('0x129')](db[_0xb903('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0xb903('0x157')});db[_0xb903('0x103')][_0xb903('0x12a')](db[_0xb903('0x13')],{'as':'Agents','through':_0xb903('0x144')});db[_0xb903('0x105')][_0xb903('0x129')](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xb903('0x129')](db[_0xb903('0x1e3')],{'onDelete':_0xb903('0x168')});db['WhatsappApplication'][_0xb903('0x129')](db[_0xb903('0x103')],{'onDelete':_0xb903('0x168')});db[_0xb903('0x105')][_0xb903('0x129')](db[_0xb903('0x8c')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x155')});db[_0xb903('0x105')][_0xb903('0x129')](db[_0xb903('0x95')],{'onDelete':_0xb903('0x168'),'foreignKey':_0xb903('0x17b')});db[_0xb903('0x126')][_0xb903('0x11a')](db[_0xb903('0x108')],{'as':_0xb903('0x15d'),'onDelete':_0xb903('0x118'),'foreignKey':_0xb903('0x201')});db[_0xb903('0x126')][_0xb903('0x129')](db[_0xb903('0x103')],{'as':_0xb903('0x172'),'foreignKey':'WhatsappAccountId'});db[_0xb903('0x126')]['belongsTo'](db[_0xb903('0x78')],{'as':'Contact','foreignKey':'ContactId'});db['WhatsappInteraction'][_0xb903('0x129')](db['User'],{'as':_0xb903('0x180'),'foreignKey':'UserId'});db[_0xb903('0x126')]['belongsToMany'](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0xb903('0x174')});db[_0xb903('0x126')][_0xb903('0x12a')](db[_0xb903('0x95')],{'through':_0xb903('0x1b7'),'as':_0xb903('0x175')});db[_0xb903('0x126')]['belongsToMany'](db[_0xb903('0x13')],{'as':_0xb903('0x176'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0xb903('0x108')][_0xb903('0x129')](db[_0xb903('0x13')],{'as':_0xb903('0x13')});db[_0xb903('0x108')][_0xb903('0x129')](db['CmContact'],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x163')});db[_0xb903('0x108')][_0xb903('0x129')](db[_0xb903('0x126')],{'onDelete':_0xb903('0x118'),'as':_0xb903('0x189'),'foreignKey':_0xb903('0x201')});db[_0xb903('0x108')][_0xb903('0x129')](db[_0xb903('0x103')],{'as':_0xb903('0x172'),'foreignKey':_0xb903('0x200')});db[_0xb903('0x10a')][_0xb903('0x129')](db[_0xb903('0x103')],{});db['WhatsappQueueReport'][_0xb903('0x129')](db['CmList'],{'as':'List','foreignKey':_0xb903('0x16d')});db[_0xb903('0x10a')][_0xb903('0x129')](db[_0xb903('0x78')],{'as':_0xb903('0x163'),'foreignKey':_0xb903('0x164')});db[_0xb903('0x10a')][_0xb903('0x129')](db['WhatsappInteraction'],{});db[_0xb903('0x10a')]['belongsTo'](db[_0xb903('0x1e3')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xb903('0x108')],{});db['WhatsappQueueReport'][_0xb903('0x129')](db[_0xb903('0x13')],{});db[_0xb903('0x10c')][_0xb903('0x129')](db['WhatsappMessage'],{});db[_0xb903('0x10c')][_0xb903('0x129')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0xb903('0x129')](db[_0xb903('0x103')],{'foreignKey':_0xb903('0x202'),'as':_0xb903('0x1f2')});db[_0xb903('0x10c')][_0xb903('0x129')](db[_0xb903('0x103')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0xb903('0x10c')][_0xb903('0x129')](db[_0xb903('0x1e3')],{'foreignKey':_0xb903('0x203'),'as':_0xb903('0x1ef')});db[_0xb903('0x10c')][_0xb903('0x129')](db['User'],{'foreignKey':_0xb903('0x1ec'),'as':_0xb903('0x1ed')});db[_0xb903('0x10c')][_0xb903('0x129')](db[_0xb903('0x13')],{'foreignKey':_0xb903('0x1f3'),'as':_0xb903('0x1f4')});db[_0xb903('0x1e3')][_0xb903('0x12a')](db['User'],{'as':'Agents','through':_0xb903('0x3b'),'foreignKey':'WhatsappQueueId'});db[_0xb903('0x1e3')][_0xb903('0x12a')](db[_0xb903('0xea')],{'through':_0xb903('0x1e4'),'as':_0xb903('0x171')});db['UserSetting']['belongsTo'](db[_0xb903('0x13')],{'as':_0xb903('0x204'),'foreignKey':_0xb903('0x119'),'onDelete':_0xb903('0x118'),'hooks':!![]});db[_0xb903('0x166')][_0xb903('0x117')](db[_0xb903('0xcc')],{'as':_0xb903('0xcc'),'onDelete':'restrict'});db[_0xb903('0x166')]['hasOne'](db[_0xb903('0x3d')],{'as':'Imap','onDelete':_0xb903('0x168')});db['CloudProvider'][_0xb903('0x117')](db['MailServerOut'],{'as':_0xb903('0x16a'),'onDelete':_0xb903('0x168')});module[_0xb903('0x205')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x6ede=['user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','IntervalId','Pause','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceQueueReport','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','Agents','MailQueue','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','TagId','Dashboard','Items','FaxAccountId','Exntensions','FaxInteractionId','Account','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelInteraction','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatWebsiteId','UserChatQueue','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Contacts','CmContactId','HopperHistories','CompanyId','cm_user_has_contacts','cm_contact_has_tags','CmHopperId','CampaignId','OwnerId','Condition','All','OneAll','OneAny','AutomationAnyId','Action','Actions','ParentId','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','TriggerAllId','Trigger','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','DeskAccount','Subjects','int_desk_configuration_has_tags','Configurations','ZohoAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','VoicePrefixes','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','ToAgent','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','Queues','voice_queues_has_cm_lists','UserProfileSection','UserProfileSections','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','username','password','options','database','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../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','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../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','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','VoiceMail','UserId','hasOne','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteraction','SmsInteractions'];(function(_0x260720,_0x44220b){var _0x21a52b=function(_0x1ab506){while(--_0x1ab506){_0x260720['push'](_0x260720['shift']());}};_0x21a52b(++_0x44220b);}(_0x6ede,0xd6));var _0xe6ed=function(_0x432169,_0x7ffbe9){_0x432169=_0x432169-0x0;var _0x28e745=_0x6ede[_0x432169];return _0x28e745;};'use strict';var config=require(_0xe6ed('0x0'));var Sequelize=require(_0xe6ed('0x1'));var _=require(_0xe6ed('0x2'));var jstz=require(_0xe6ed('0x3'));var timezone=jstz[_0xe6ed('0x4')]();config[_0xe6ed('0x1')]=_[_0xe6ed('0x5')](config[_0xe6ed('0x1')],{'database':_0xe6ed('0x6'),'username':'xcall','password':_0xe6ed('0x7'),'options':{'host':_0xe6ed('0x8'),'port':0xcea,'dialect':_0xe6ed('0x9'),'dialectOptions':{'charset':_0xe6ed('0xa')},'logging':![],'timezone':timezone[_0xe6ed('0xb')](),'define':{'charset':_0xe6ed('0xc'),'collate':_0xe6ed('0xd')}}});config[_0xe6ed('0xe')]=_[_0xe6ed('0x5')](config[_0xe6ed('0xe')],{'database':_0xe6ed('0x6'),'username':'xcall','password':_0xe6ed('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe6ed('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe6ed('0xb')](),'define':{'charset':_0xe6ed('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe6ed('0x1')]['database'],config['sequelize'][_0xe6ed('0xf')],config[_0xe6ed('0x1')][_0xe6ed('0x10')],config[_0xe6ed('0x1')][_0xe6ed('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe6ed('0xe')][_0xe6ed('0x12')],config[_0xe6ed('0xe')][_0xe6ed('0xf')],config['sequelizeHistory'][_0xe6ed('0x10')],config[_0xe6ed('0xe')]['options'])};db['User']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x13'));db[_0xe6ed('0x14')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x16'));db[_0xe6ed('0x17')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x18'));db[_0xe6ed('0x19')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x1a'));db[_0xe6ed('0x1b')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x1c'));db[_0xe6ed('0x1d')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x1e'));db[_0xe6ed('0x1f')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x20'));db['VoiceMail']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x21'));db[_0xe6ed('0x22')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x23'));db[_0xe6ed('0x24')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x25'));db[_0xe6ed('0x26')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x27'));db['VoiceAgentReport']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x28'));db['VoiceQueueReport']=db['sequelize'][_0xe6ed('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xe6ed('0x29')]=db['sequelize']['import'](_0xe6ed('0x2a'));db[_0xe6ed('0x2b')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db['sequelize']['import'](_0xe6ed('0x2c'));db['UserVoiceQueueRt']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x2d'));db[_0xe6ed('0x2e')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x2f'));db['UserChatQueue']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x30'));db[_0xe6ed('0x31')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x32'));db['UserFaxQueue']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x33'));db[_0xe6ed('0x34')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x35'));db[_0xe6ed('0x36')]=db[_0xe6ed('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xe6ed('0x37')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xe6ed('0x38')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x39'));db[_0xe6ed('0x3a')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x3b'));db[_0xe6ed('0x3c')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x3d'));db['MailQueue']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/mailQueue/mailQueue.model');db[_0xe6ed('0x3e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x3f'));db[_0xe6ed('0x40')]=db['sequelize'][_0xe6ed('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0xe6ed('0x41')]=db['sequelize']['import']('../api/mailMessage/mailMessage.model');db[_0xe6ed('0x42')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x43'));db[_0xe6ed('0x44')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x45'));db['Dashboard']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x46'));db[_0xe6ed('0x47')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x48'));db[_0xe6ed('0x49')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x4a'));db[_0xe6ed('0x4b')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x4c'));db[_0xe6ed('0x4d')]=db[_0xe6ed('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0xe6ed('0x4e')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x4f'));db[_0xe6ed('0x50')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x51'));db['FaxQueueReport']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x52'));db[_0xe6ed('0x53')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x54'));db['SmsApplication']=db['sequelize']['import'](_0xe6ed('0x55'));db['SmsInteraction']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x56'));db['SmsMessage']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x57'));db[_0xe6ed('0x58')]=db['sequelize'][_0xe6ed('0x15')]('../api/smsQueue/smsQueue.model');db[_0xe6ed('0x59')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5a'));db[_0xe6ed('0x5b')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5c'));db['OpenchannelInteraction']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5d'));db[_0xe6ed('0x5e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x5f'));db['OpenchannelQueue']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x60'));db[_0xe6ed('0x61')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0xe6ed('0x62')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x63'));db[_0xe6ed('0x64')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x65'));db['ChatInteraction']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x66'));db[_0xe6ed('0x67')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x68'));db['ChatOfflineMessage']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x69'));db[_0xe6ed('0x6a')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x6b'));db[_0xe6ed('0x6c')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/chatGroup/chatGroup.model');db[_0xe6ed('0x6d')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x6e'));db[_0xe6ed('0x6f')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x70'));db[_0xe6ed('0x71')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x72'));db[_0xe6ed('0x73')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0x74'));db[_0xe6ed('0x75')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xe6ed('0x76')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x77'));db[_0xe6ed('0x78')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xe6ed('0x79')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x7a'));db[_0xe6ed('0x7b')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x7c'));db['Action']=db['sequelize']['import'](_0xe6ed('0x7d'));db[_0xe6ed('0x7e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x7f'));db[_0xe6ed('0x80')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x81'));db[_0xe6ed('0x82')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/disposition/disposition.model');db['Condition']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x83'));db[_0xe6ed('0x84')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x85'));db['Pause']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x86'));db[_0xe6ed('0x87')]=db['sequelize']['import'](_0xe6ed('0x88'));db[_0xe6ed('0x89')]=db['sequelize']['import'](_0xe6ed('0x8a'));db[_0xe6ed('0x8b')]=db[_0xe6ed('0x1')]['import']('../api/schedule/schedule.model');db[_0xe6ed('0x8c')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/sound/sound.model');db['Tag']=db[_0xe6ed('0x1')]['import']('../api/tag/tag.model');db[_0xe6ed('0x8d')]=db['sequelize'][_0xe6ed('0x15')]('../api/contactItemType/contactItemType.model');db[_0xe6ed('0x8e')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x8f'));db[_0xe6ed('0x90')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x91'));db[_0xe6ed('0x92')]=db['sequelize'][_0xe6ed('0x15')]('../api/template/template.model');db['Trigger']=db['sequelize']['import'](_0xe6ed('0x93'));db['Variable']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x94'));db['Integration']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x95'));db[_0xe6ed('0x96')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/integrationReport/integrationReport.model');db[_0xe6ed('0x97')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x98'));db[_0xe6ed('0x99')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x9a'));db[_0xe6ed('0x9b')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x9c'));db[_0xe6ed('0x9d')]=db['sequelize']['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xe6ed('0x9e')]=db['sequelize']['import'](_0xe6ed('0x9f'));db[_0xe6ed('0xa0')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xa1'));db[_0xe6ed('0xa2')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xa3'));db[_0xe6ed('0xa4')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xe6ed('0xa5')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xa6'));db[_0xe6ed('0xa7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xa8'));db[_0xe6ed('0xa9')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xaa'));db['DeskAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/intDeskAccount/intDeskAccount.model');db[_0xe6ed('0xab')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xe6ed('0xac')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xad'));db['ZohoAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xae'));db[_0xe6ed('0xaf')]=db['sequelize'][_0xe6ed('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xe6ed('0xb0')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xb1'));db[_0xe6ed('0xb2')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xb3'));db['ZendeskConfiguration']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xb4'));db['ZendeskField']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xb5'));db[_0xe6ed('0xb6')]=db['sequelize'][_0xe6ed('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xe6ed('0xb7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xb8'));db['FreshdeskField']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xb9'));db['VtigerAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xba'));db[_0xe6ed('0xbb')]=db['sequelize'][_0xe6ed('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xe6ed('0xbc')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xbd'));db[_0xe6ed('0xbe')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xbf'));db[_0xe6ed('0xc0')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xc1'));db[_0xe6ed('0xc2')]=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xc3'));db[_0xe6ed('0xc4')]=db[_0xe6ed('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0xe6ed('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xe6ed('0xc5')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xc6'));db[_0xe6ed('0xc7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xc8'));db[_0xe6ed('0xc9')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xca'));db[_0xe6ed('0xcb')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xcc'));db['Integration']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x95'));db[_0xe6ed('0xcd')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xce'));db[_0xe6ed('0xcf')]=db['sequelize']['import'](_0xe6ed('0xd0'));db['ChatInternalMessage']=db[_0xe6ed('0x1')]['import'](_0xe6ed('0xd1'));db[_0xe6ed('0xd2')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xd3'));db[_0xe6ed('0xd4')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xd5'));db[_0xe6ed('0xd6')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xe6ed('0xd7')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xd8'));db['SquareReport']=db['sequelize']['import'](_0xe6ed('0xd9'));db[_0xe6ed('0xda')]=db['sequelize'][_0xe6ed('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xe6ed('0xdb')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/jscriptyProject/jscriptyProject.model');db[_0xe6ed('0xdc')]=db['sequelize']['import'](_0xe6ed('0xdd'));db[_0xe6ed('0xde')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xdf'));db['SquareRecording']=db['sequelize'][_0xe6ed('0x15')]('../api/squareRecording/squareRecording.model');db[_0xe6ed('0xe0')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe1'));db['Team']=db['sequelize'][_0xe6ed('0x15')]('../api/team/team.model');db[_0xe6ed('0xe2')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe3'));db[_0xe6ed('0xe4')]=db['sequelize'][_0xe6ed('0x15')]('../api/campaign/campaign.model');db[_0xe6ed('0xe5')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe6'));db[_0xe6ed('0xe7')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xe8'));db['Plugin']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/plugin/plugin.model');db[_0xe6ed('0xe9')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xea'));db[_0xe6ed('0xeb')]=db['sequelize']['import'](_0xe6ed('0xec'));db[_0xe6ed('0xed')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xe6ed('0xee')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xef'));db[_0xe6ed('0xf0')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf1'));db[_0xe6ed('0xf2')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xf3'));db[_0xe6ed('0xf4')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf5'));db[_0xe6ed('0xf6')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf7'));db['UserProfileSection']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0xe6ed('0xf8')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0xe6ed('0x1')]['import']('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xf9'));db['WhatsappInteraction']=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0xfa'));db[_0xe6ed('0xfb')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xfc'));db['WhatsappQueueReport']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xe6ed('0xfd')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0xfe'));db[_0xe6ed('0xff')]=db['sequelize']['import'](_0xe6ed('0x100'));db['CloudProvider']=db[_0xe6ed('0x1')][_0xe6ed('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0xe6ed('0x101')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x102'));db[_0xe6ed('0x103')]=db['sequelize'][_0xe6ed('0x15')](_0xe6ed('0x104'));db['UserVoicePrefix']=db['sequelize']['import'](_0xe6ed('0x105'));db[_0xe6ed('0x106')]=db[_0xe6ed('0x1')][_0xe6ed('0x15')](_0xe6ed('0x107'));db[_0xe6ed('0x108')]['hasOne'](db[_0xe6ed('0x109')],{'as':_0xe6ed('0x109'),'onDelete':'cascade','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10b')](db[_0xe6ed('0x106')],{'as':'userSetting','onDelete':'cascade','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x1d')],{'as':'Recordings','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x10d')],{'as':_0xe6ed('0x10e'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')]['hasMany'](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x10f'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db['User'][_0xe6ed('0x10c')](db[_0xe6ed('0x76')],{'as':_0xe6ed('0x111'),'foreignKey':'UserId'});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x112'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x79')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db['OpenchannelInteraction'],{'as':_0xe6ed('0x113'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x114')],{'as':_0xe6ed('0x115'),'foreignKey':'UserId'});db['User'][_0xe6ed('0x10c')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xe6ed('0x108')]['hasMany'](db['FaxInteraction'],{'as':_0xe6ed('0x116'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x117'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x118')],{'as':_0xe6ed('0x119'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x108')][_0xe6ed('0x10c')](db[_0xe6ed('0x11a')],{'as':_0xe6ed('0x11b'),'foreignKey':'SenderId'});db[_0xe6ed('0x108')][_0xe6ed('0x11c')](db[_0xe6ed('0xf6')],{'as':_0xe6ed('0xf6'),'foreignKey':_0xe6ed('0x11d')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x6c')],{'as':'Groups','through':_0xe6ed('0x11f')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x71')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xe6ed('0x108')]['belongsToMany'](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x120'),'through':'cm_user_has_lists'});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x122')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x117'),'through':_0xe6ed('0x123')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['ChatInteraction'],{'as':_0xe6ed('0x115'),'through':'user_has_chat_interactions'});db['User'][_0xe6ed('0x11e')](db['FaxInteraction'],{'as':_0xe6ed('0x116'),'through':_0xe6ed('0x124')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x125')],{'as':_0xe6ed('0x126'),'through':_0xe6ed('0x127')});db[_0xe6ed('0x108')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xe6ed('0x113'),'through':_0xe6ed('0x128')});db['User'][_0xe6ed('0x11e')](db[_0xe6ed('0x118')],{'as':_0xe6ed('0x119'),'through':_0xe6ed('0x129')});db[_0xe6ed('0x108')]['belongsToMany'](db['VoiceQueue'],{'as':_0xe6ed('0x12a'),'through':_0xe6ed('0x2e'),'required':![]});db[_0xe6ed('0x108')]['belongsToMany'](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xe6ed('0x12b'),'required':![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['MailQueue'],{'as':_0xe6ed('0x12c'),'through':'UserMailQueue','required':![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['ChatQueue'],{'as':_0xe6ed('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x50')],{'as':_0xe6ed('0x12e'),'through':_0xe6ed('0x12f'),'required':![]});db[_0xe6ed('0x108')]['belongsToMany'](db[_0xe6ed('0x58')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db['User'][_0xe6ed('0x11e')](db[_0xe6ed('0x130')],{'as':_0xe6ed('0x131'),'through':_0xe6ed('0x36'),'required':![]});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0xff')],{'as':_0xe6ed('0x132'),'through':_0xe6ed('0x37'),'required':![]});db['User'][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'through':_0xe6ed('0x133')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['ChatWebsite'],{'as':_0xe6ed('0x134'),'through':_0xe6ed('0x135')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x49')],{'as':_0xe6ed('0x136'),'through':_0xe6ed('0x137')});db['User']['belongsToMany'](db[_0xe6ed('0x3c')],{'as':_0xe6ed('0x138'),'through':_0xe6ed('0x139')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db[_0xe6ed('0x59')],{'as':_0xe6ed('0x13a'),'through':_0xe6ed('0x13b')});db[_0xe6ed('0x108')][_0xe6ed('0x11e')](db['SmsAccount'],{'as':_0xe6ed('0x13c'),'through':'user_has_sms_accounts'});db[_0xe6ed('0x108')]['belongsToMany'](db['WhatsappAccount'],{'as':_0xe6ed('0x13d'),'through':_0xe6ed('0x13e')});db[_0xe6ed('0x14')]['hasMany'](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x13f'),'onDelete':'cascade','foreignKey':_0xe6ed('0x140')});db['VoiceContext']['hasMany'](db[_0xe6ed('0x19')],{'onDelete':'cascade'});db[_0xe6ed('0x19')][_0xe6ed('0x10c')](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x141'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x142')]['belongsToMany'](db[_0xe6ed('0x8c')],{'as':_0xe6ed('0x143'),'through':_0xe6ed('0x144')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db[_0xe6ed('0x10d')],{'as':_0xe6ed('0x145'),'foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db['CmHopper'],{'as':_0xe6ed('0x147'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe6ed('0x10c')](db['CmHopperFinal'],{'as':_0xe6ed('0x111'),'foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')]['hasMany'](db[_0xe6ed('0x75')],{'as':_0xe6ed('0x148'),'foreignKey':_0xe6ed('0x146')});db[_0xe6ed('0x1b')][_0xe6ed('0x10c')](db[_0xe6ed('0xd6')],{'as':_0xe6ed('0x149'),'foreignKey':_0xe6ed('0x146')});db['VoiceQueue'][_0xe6ed('0x11c')](db['Trunk'],{'as':'Trunk','foreignKey':_0xe6ed('0x14a')});db[_0xe6ed('0x1b')][_0xe6ed('0x11c')](db['Trunk'],{'as':_0xe6ed('0x14b'),'foreignKey':'TrunkBackupId'});db[_0xe6ed('0x1b')][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'as':'Interval','foreignKey':_0xe6ed('0x14c')});db['VoiceQueue'][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':'mandatoryDispositionPause','foreignKey':_0xe6ed('0x14e')});db[_0xe6ed('0x1b')][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x120'),'through':'voice_queues_has_cm_lists'});db[_0xe6ed('0x1b')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x2e')});db[_0xe6ed('0x1b')]['belongsToMany'](db[_0xe6ed('0x121')],{'as':_0xe6ed('0x14f'),'through':'TeamVoiceQueue'});db[_0xe6ed('0x1b')][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x150'),'through':_0xe6ed('0x151')});db[_0xe6ed('0x1d')]['belongsTo'](db['User'],{'as':'User','foreignKey':'UserId'});db[_0xe6ed('0x1f')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x108'),'foreignKey':'UserId'});db['VoiceMail'][_0xe6ed('0x10c')](db[_0xe6ed('0x22')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':'mailboxuser','sourceKey':_0xe6ed('0x153')});db['VoiceMailMessage'][_0xe6ed('0x11c')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xe6ed('0x153')});db[_0xe6ed('0x24')][_0xe6ed('0x10c')](db[_0xe6ed('0x154')],{'as':'QueueCalls','foreignKey':_0xe6ed('0x155'),'constraints':![]});db[_0xe6ed('0x24')][_0xe6ed('0x10c')](db[_0xe6ed('0x156')],{'as':'AgentReports','foreignKey':_0xe6ed('0x155'),'constraints':![]});db[_0xe6ed('0x24')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x108'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x24')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db['MailServerIn'][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{'as':_0xe6ed('0x3c'),'foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x38')][_0xe6ed('0x11c')](db[_0xe6ed('0x15a')],{'as':'CloudProvider','foreignKey':_0xe6ed('0x15b'),'onDelete':'restrict'});db['MailServerOut'][_0xe6ed('0x11c')](db['MailAccount'],{'as':_0xe6ed('0x3c'),'foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x3a')][_0xe6ed('0x11c')](db[_0xe6ed('0x15a')],{'as':_0xe6ed('0x15a'),'foreignKey':_0xe6ed('0x15b'),'onDelete':_0xe6ed('0x15c')});db['MailAccount']['hasOne'](db[_0xe6ed('0x38')],{'as':_0xe6ed('0x15d'),'onDelete':'cascade'});db[_0xe6ed('0x3c')][_0xe6ed('0x10b')](db[_0xe6ed('0x3a')],{'as':_0xe6ed('0x15e'),'onDelete':'cascade'});db[_0xe6ed('0x3c')][_0xe6ed('0x10c')](db['Disposition'],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x159'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x3c')][_0xe6ed('0x10c')](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':_0xe6ed('0x159')});db['MailAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x41')],{'as':_0xe6ed('0x152'),'foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x3c')]['hasMany'](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x3c')]['hasMany'](db[_0xe6ed('0x42')],{'as':_0xe6ed('0x141')});db['MailAccount'][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db['MailAccount'][_0xe6ed('0x11c')](db[_0xe6ed('0x92')],{'as':'Template','foreignKey':_0xe6ed('0x164')});db['MailAccount'][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':_0xe6ed('0x165'),'foreignKey':_0xe6ed('0x14e')});db[_0xe6ed('0x3c')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x139')});db['MailQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':'UserMailQueue'});db[_0xe6ed('0x167')][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x168'),'as':_0xe6ed('0x14f')});db[_0xe6ed('0x40')][_0xe6ed('0x10c')](db[_0xe6ed('0x41')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x169')});db[_0xe6ed('0x40')][_0xe6ed('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0xe6ed('0x159')});db[_0xe6ed('0x40')][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x40')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db['MailInteraction'][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x16c'),'as':_0xe6ed('0x16d')});db[_0xe6ed('0x40')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x16c'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x40')][_0xe6ed('0x11e')](db['User'],{'as':'Users','through':_0xe6ed('0x123'),'foreignKey':_0xe6ed('0x169')});db[_0xe6ed('0x41')][_0xe6ed('0x10c')](db[_0xe6ed('0xe7')],{'as':_0xe6ed('0x16f'),'onDelete':'cascade'});db[_0xe6ed('0x41')][_0xe6ed('0x11c')](db['User'],{'as':_0xe6ed('0x108')});db[_0xe6ed('0x41')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157')});db['MailMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x40')],{'as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x169')});db['MailMessage'][_0xe6ed('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0xe6ed('0x159')});db['MailMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':_0xe6ed('0x61'),'foreignKey':'ChatWebsiteId'});db[_0xe6ed('0x41')][_0xe6ed('0x11c')](db[_0xe6ed('0x171')],{'as':'ChatOfflineMessage','foreignKey':_0xe6ed('0x172')});db[_0xe6ed('0x42')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x15c')});db['MailApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x167')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x42')][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{'onDelete':_0xe6ed('0x15c')});db['MailApplication']['belongsTo'](db[_0xe6ed('0x84')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x42')][_0xe6ed('0x11c')](db['Tag'],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db['MailQueueReport'][_0xe6ed('0x11c')](db['MailAccount'],{});db[_0xe6ed('0x44')][_0xe6ed('0x11c')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['MailQueueReport'][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db['MailQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0xe6ed('0x41')],{});db['MailQueueReport']['belongsTo'](db[_0xe6ed('0x108')],{});db[_0xe6ed('0x44')]['belongsTo'](db['MailQueue'],{});db[_0xe6ed('0x174')][_0xe6ed('0x10c')](db['DashboardItem'],{'as':_0xe6ed('0x175'),'onDelete':_0xe6ed('0x110')});db['FaxAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x176'),'onDelete':_0xe6ed('0x110')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe6ed('0x176')});db[_0xe6ed('0x49')]['hasMany'](db[_0xe6ed('0x4d')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x49')][_0xe6ed('0x10c')](db[_0xe6ed('0x4b')],{'as':_0xe6ed('0x141')});db['FaxAccount']['hasMany'](db[_0xe6ed('0x19')],{'as':_0xe6ed('0x177'),'onDelete':'cascade'});db[_0xe6ed('0x49')][_0xe6ed('0x10c')](db[_0xe6ed('0x4e')],{'as':_0xe6ed('0x152')});db[_0xe6ed('0x49')]['belongsTo'](db['Trunk'],{'as':_0xe6ed('0x2b')});db[_0xe6ed('0x49')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x49')]['belongsTo'](db['Pause'],{'as':_0xe6ed('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe6ed('0x49')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x137')});db['FaxApplication']['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xe6ed('0x50')],{'onDelete':'restrict'});db[_0xe6ed('0x4b')][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x4b')]['belongsTo'](db[_0xe6ed('0x16b')],{'onDelete':'restrict','foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x4d')]['hasMany'](db['FaxMessage'],{'as':'Messages','onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x178')});db[_0xe6ed('0x4d')][_0xe6ed('0x11c')](db['FaxAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x176')});db[_0xe6ed('0x4d')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x4d')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x4d')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x17a'),'as':'Tags'});db[_0xe6ed('0x4d')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x17a'),'as':'ThroughTags'});db[_0xe6ed('0x4d')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':_0xe6ed('0x124'),'foreignKey':_0xe6ed('0x178')});db['FaxMessage'][_0xe6ed('0x11c')](db['User'],{'onDelete':'cascade','as':_0xe6ed('0x108')});db[_0xe6ed('0x4e')][_0xe6ed('0x11c')](db[_0xe6ed('0x4d')],{'as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x178')});db[_0xe6ed('0x4e')]['belongsTo'](db['CmContact'],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157')});db[_0xe6ed('0x4e')][_0xe6ed('0x11c')](db[_0xe6ed('0xe7')],{'as':'Attachment','foreignKey':_0xe6ed('0x17c')});db[_0xe6ed('0x4e')][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{'as':_0xe6ed('0x179'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x12f')});db[_0xe6ed('0x50')][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x17d'),'as':'Teams'});db['FaxQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['CmList'],{'as':'List','foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':'Contact','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['FaxInteraction'],{});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['FaxMessage'],{});db[_0xe6ed('0x17e')]['belongsTo'](db['User'],{});db[_0xe6ed('0x17e')][_0xe6ed('0x11c')](db['FaxQueue'],{});db[_0xe6ed('0x53')]['hasMany'](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x17f'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x53')][_0xe6ed('0x10c')](db[_0xe6ed('0x80')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x180')],{'as':'Messages','foreignKey':_0xe6ed('0x17f')});db[_0xe6ed('0x53')][_0xe6ed('0x10c')](db[_0xe6ed('0x125')],{'as':'Interactions'});db[_0xe6ed('0x53')][_0xe6ed('0x10c')](db['SmsApplication'],{'as':_0xe6ed('0x141')});db[_0xe6ed('0x53')][_0xe6ed('0x11c')](db['CmList'],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db['SmsAccount']['belongsTo'](db['Pause'],{'as':_0xe6ed('0x165'),'foreignKey':_0xe6ed('0x14e')});db['SmsAccount'][_0xe6ed('0x11e')](db['User'],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x181')});db['SmsApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x182')][_0xe6ed('0x11c')](db[_0xe6ed('0x58')],{'onDelete':_0xe6ed('0x15c')});db['SmsApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'onDelete':'restrict'});db[_0xe6ed('0x182')][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'onDelete':'restrict','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x182')][_0xe6ed('0x11c')](db['Tag'],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x125')][_0xe6ed('0x10c')](db[_0xe6ed('0x180')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':'SmsInteractionId'});db[_0xe6ed('0x125')]['belongsTo'](db['SmsAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x17f')});db['SmsInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x125')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':'Owner','foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x125')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x183'),'as':'Tags'});db[_0xe6ed('0x125')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x183'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x125')][_0xe6ed('0x11e')](db['User'],{'as':'Users','through':_0xe6ed('0x127'),'foreignKey':_0xe6ed('0x184')});db['SmsMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':'User'});db[_0xe6ed('0x180')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157')});db['SmsMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x125')],{'onDelete':'cascade','as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x184')});db[_0xe6ed('0x180')][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'as':'Account','foreignKey':_0xe6ed('0x17f')});db['SmsQueue']['belongsToMany'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x34'),'foreignKey':_0xe6ed('0x185')});db['SmsQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':'team_has_sms_queues','as':_0xe6ed('0x14f')});db['OpenchannelAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x186'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x59')]['hasMany'](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':_0xe6ed('0x186')});db['OpenchannelAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x187')],{'as':'Interactions','foreignKey':_0xe6ed('0x186')});db[_0xe6ed('0x59')][_0xe6ed('0x10c')](db['OpenchannelMessage'],{'as':_0xe6ed('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0xe6ed('0x59')][_0xe6ed('0x10c')](db[_0xe6ed('0x5b')],{'as':_0xe6ed('0x141'),'foreignKey':_0xe6ed('0x186')});db[_0xe6ed('0x59')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x59')][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':_0xe6ed('0x165'),'foreignKey':_0xe6ed('0x14e')});db[_0xe6ed('0x59')]['belongsToMany'](db['User'],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x13b')});db[_0xe6ed('0x5b')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x5b')]['belongsTo'](db[_0xe6ed('0x130')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x188')});db['OpenchannelApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x186')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x5b')][_0xe6ed('0x11c')](db[_0xe6ed('0x16b')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x187')]['hasMany'](db[_0xe6ed('0x5e')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x189')});db[_0xe6ed('0x187')][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{'as':_0xe6ed('0x179'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x187')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x187')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':'openchannel_interaction_has_tags','as':_0xe6ed('0x16d')});db[_0xe6ed('0x187')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xe6ed('0x187')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0xe6ed('0x5e')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x108')});db[_0xe6ed('0x5e')][_0xe6ed('0x11c')](db['CmContact'],{'onDelete':_0xe6ed('0x110'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0xe6ed('0x187')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x189')});db[_0xe6ed('0x5e')]['belongsTo'](db[_0xe6ed('0xe7')],{'as':_0xe6ed('0xe7'),'foreignKey':_0xe6ed('0x17c')});db[_0xe6ed('0x5e')]['belongsTo'](db[_0xe6ed('0x59')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x186')});db['OpenchannelQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x36'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xe6ed('0x11e')](db['Team'],{'through':_0xe6ed('0x18a'),'as':_0xe6ed('0x14f')});db['ChatWebsite'][_0xe6ed('0x10c')](db['Disposition'],{'as':_0xe6ed('0x15f'),'foreignKey':'ChatWebsiteId','onDelete':_0xe6ed('0x110')});db['ChatWebsite']['hasMany'](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':'ChatWebsiteId'});db[_0xe6ed('0x61')][_0xe6ed('0x10c')](db['ChatProactiveAction'],{'as':_0xe6ed('0x18b')});db['ChatWebsite'][_0xe6ed('0x10c')](db[_0xe6ed('0x114')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x61')][_0xe6ed('0x10c')](db[_0xe6ed('0x64')],{'as':_0xe6ed('0x141')});db[_0xe6ed('0x61')][_0xe6ed('0x10c')](db['ChatMessage'],{'as':'Messages'});db['ChatWebsite']['belongsTo'](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x61')]['belongsTo'](db[_0xe6ed('0x84')],{'as':'Interval','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x61')][_0xe6ed('0x11c')](db['MailAccount'],{'as':_0xe6ed('0x3c'),'foreignKey':'MailAccountId'});db[_0xe6ed('0x61')][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x135')});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':'List','foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x62')]['belongsTo'](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db['OpenchannelQueueReport'][_0xe6ed('0x11c')](db['OpenchannelInteraction'],{});db[_0xe6ed('0x62')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db['User'],{});db[_0xe6ed('0x62')][_0xe6ed('0x11c')](db['OpenchannelQueue'],{});db[_0xe6ed('0x64')]['belongsTo'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x18c'),'foreignKey':_0xe6ed('0x10a'),'onDelete':'restrict'});db['ChatApplication'][_0xe6ed('0x11c')](db['ChatQueue'],{'as':_0xe6ed('0x18d'),'foreignKey':_0xe6ed('0x18e'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x64')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0xe6ed('0x15c')});db['ChatApplication']['belongsTo'](db[_0xe6ed('0x16b')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':_0xe6ed('0x173')});db[_0xe6ed('0x114')][_0xe6ed('0x10c')](db[_0xe6ed('0x67')],{'as':_0xe6ed('0x152'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x18f')});db[_0xe6ed('0x114')]['belongsTo'](db[_0xe6ed('0x61')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xe6ed('0x114')][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x114')][_0xe6ed('0x11c')](db['User'],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x114')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x190'),'as':_0xe6ed('0x16d')});db[_0xe6ed('0x114')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x190'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x114')]['belongsToMany'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':_0xe6ed('0x191'),'foreignKey':_0xe6ed('0x18f')});db[_0xe6ed('0x67')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x110'),'as':'User'});db[_0xe6ed('0x67')]['belongsTo'](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':'Contact','foreignKey':_0xe6ed('0x158')});db['ChatMessage'][_0xe6ed('0x11c')](db[_0xe6ed('0x114')],{'onDelete':_0xe6ed('0x110'),'as':'Interaction','foreignKey':_0xe6ed('0x18f')});db[_0xe6ed('0x67')][_0xe6ed('0x11c')](db['Attachment'],{'as':_0xe6ed('0xe7'),'foreignKey':_0xe6ed('0x17c')});db[_0xe6ed('0x67')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x192')});db[_0xe6ed('0x171')][_0xe6ed('0x10c')](db[_0xe6ed('0xe7')],{'as':'Attachments','foreignKey':_0xe6ed('0x172'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xe6ed('0x71')],{'onDelete':_0xe6ed('0x110'),'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x171')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x192')});db[_0xe6ed('0x6a')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x193'),'hooks':!![]});db['ChatQueue'][_0xe6ed('0x11e')](db[_0xe6ed('0x121')],{'through':_0xe6ed('0x194'),'as':'Teams'});db[_0xe6ed('0x6c')]['hasMany'](db[_0xe6ed('0x195')],{'as':'Messages','foreignKey':_0xe6ed('0x196'),'onDelete':'cascade'});db[_0xe6ed('0x6c')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x145'),'through':_0xe6ed('0x11f')});db[_0xe6ed('0x6d')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0xe6ed('0x192')});db[_0xe6ed('0x6f')][_0xe6ed('0x10c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x197'),'foreignKey':'CompanyId'});db[_0xe6ed('0x71')]['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0xe6ed('0x198')});db[_0xe6ed('0x71')]['hasMany'](db[_0xe6ed('0x73')],{'as':'Hoppers','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')]['hasMany'](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x199'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x79')],{'as':'ReportAgentPreview','foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db['JscriptySessionReport'],{'as':_0xe6ed('0x149'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x187')],{'as':_0xe6ed('0x113'),'foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')]['hasMany'](db['ChatInteraction'],{'as':_0xe6ed('0x115'),'foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x125')],{'as':_0xe6ed('0x126'),'foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db['CmContact'][_0xe6ed('0x10c')](db['FaxInteraction'],{'as':_0xe6ed('0x116'),'foreignKey':'ContactId','onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')][_0xe6ed('0x10c')](db[_0xe6ed('0x40')],{'as':'MailInteractions','foreignKey':_0xe6ed('0x158'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x71')]['belongsTo'](db['CmCompany'],{'as':'Company','foreignKey':_0xe6ed('0x19a')});db[_0xe6ed('0x71')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x71')]['belongsToMany'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':_0xe6ed('0x19b')});db[_0xe6ed('0x71')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'as':_0xe6ed('0x16d'),'through':_0xe6ed('0x19c')});db[_0xe6ed('0x71')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x19c'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x73')][_0xe6ed('0x10c')](db[_0xe6ed('0x90')],{'as':'AdditionalPhones','foreignKey':_0xe6ed('0x19d')});db[_0xe6ed('0x73')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x73')]['belongsTo'](db['CmList'],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163'),'onDelete':'cascade'});db['CmHopper'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x18c'),'foreignKey':_0xe6ed('0x10a')});db['CmHopper'][_0xe6ed('0x11c')](db['VoiceQueue'],{'as':_0xe6ed('0x18d'),'foreignKey':_0xe6ed('0x146'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x73')][_0xe6ed('0x11c')](db[_0xe6ed('0xe4')],{'as':_0xe6ed('0xe4'),'foreignKey':_0xe6ed('0x19e'),'onDelete':'cascade'});db[_0xe6ed('0x73')]['belongsTo'](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x19f')});db[_0xe6ed('0x75')]['belongsTo'](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x75')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':'List','foreignKey':'ListId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x75')][_0xe6ed('0x11c')](db[_0xe6ed('0x1b')],{'as':_0xe6ed('0x18d'),'foreignKey':_0xe6ed('0x146'),'onDelete':_0xe6ed('0x110')});db['CmHopperBlack'][_0xe6ed('0x11c')](db[_0xe6ed('0xe4')],{'as':_0xe6ed('0xe4'),'foreignKey':_0xe6ed('0x19e'),'onDelete':'cascade'});db[_0xe6ed('0x7e')][_0xe6ed('0x10c')](db[_0xe6ed('0x1a0')],{'as':{'plural':_0xe6ed('0x1a1'),'singular':_0xe6ed('0x1a2')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xe6ed('0x7e')]['hasMany'](db[_0xe6ed('0x1a0')],{'as':{'plural':'Any','singular':_0xe6ed('0x1a3')},'foreignKey':_0xe6ed('0x1a4'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x7e')]['hasMany'](db[_0xe6ed('0x1a5')],{'as':_0xe6ed('0x1a6'),'foreignKey':'AutomationId','onDelete':_0xe6ed('0x110'),'hooks':!![]});db['Disposition']['hasMany'](db[_0xe6ed('0x82')],{'as':_0xe6ed('0x15f'),'foreignKey':_0xe6ed('0x1a7'),'onDelete':_0xe6ed('0x110')});db['Interval'][_0xe6ed('0x10c')](db[_0xe6ed('0x84')],{'as':'Intervals','foreignKey':_0xe6ed('0x14c'),'onDelete':_0xe6ed('0x110'),'hooks':!![],'required':![]});db['Interval'][_0xe6ed('0x10c')](db[_0xe6ed('0x19')],{'as':'Extensions','foreignKey':_0xe6ed('0x14c'),'onDelete':'restrict'});db['Interval']['hasMany'](db[_0xe6ed('0x42')],{'as':'MailApplications','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x84')][_0xe6ed('0x10c')](db[_0xe6ed('0x64')],{'as':'ChatApplications','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0x84')][_0xe6ed('0x10c')](db[_0xe6ed('0x4b')],{'as':'FaxApplications','foreignKey':_0xe6ed('0x14c')});db['Interval'][_0xe6ed('0x10c')](db[_0xe6ed('0x182')],{'as':_0xe6ed('0x1a8'),'foreignKey':'IntervalId'});db['Schedule'][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{});db[_0xe6ed('0x8b')][_0xe6ed('0x11c')](db[_0xe6ed('0x1a9')],{'foreignKey':_0xe6ed('0x1aa')});db[_0xe6ed('0x8b')][_0xe6ed('0x11c')](db['AnalyticCustomReport'],{'foreignKey':_0xe6ed('0x1ab')});db[_0xe6ed('0x8c')]['belongsToMany'](db[_0xe6ed('0x142')],{'as':_0xe6ed('0x1ac'),'through':_0xe6ed('0x144'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db['CmContact'],{'through':_0xe6ed('0x19c')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db['ChatInteraction'],{'through':_0xe6ed('0x190')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db[_0xe6ed('0x40')],{'through':'mail_interaction_has_tags'});db[_0xe6ed('0x16b')]['belongsToMany'](db[_0xe6ed('0x125')],{'through':_0xe6ed('0x183')});db[_0xe6ed('0x16b')][_0xe6ed('0x11e')](db['FaxInteraction'],{'through':_0xe6ed('0x17a')});db['Tag'][_0xe6ed('0x11e')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xe6ed('0x16b')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xe6ed('0x1ad')});db['CmContactHasItem'][_0xe6ed('0x11c')](db[_0xe6ed('0x8d')],{'as':_0xe6ed('0x1ae'),'foreignKey':_0xe6ed('0x1af')});db[_0xe6ed('0x90')][_0xe6ed('0x11c')](db[_0xe6ed('0x73')],{'as':_0xe6ed('0x1b0'),'foreignKey':_0xe6ed('0x19d')});db[_0xe6ed('0x8e')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x198')});db['Trigger']['hasMany'](db[_0xe6ed('0x1a0')],{'as':{'plural':_0xe6ed('0x1b1'),'singular':'AllCondition'},'foreignKey':_0xe6ed('0x1b2'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x1b3')][_0xe6ed('0x10c')](db['Condition'],{'as':{'plural':_0xe6ed('0x1b4'),'singular':'AnyCondition'},'foreignKey':_0xe6ed('0x1b5'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x1b3')][_0xe6ed('0x10c')](db[_0xe6ed('0x1a5')],{'as':_0xe6ed('0x1a6'),'foreignKey':_0xe6ed('0x1b6'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x97')][_0xe6ed('0x10c')](db[_0xe6ed('0x9d')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xe6ed('0x1a9')][_0xe6ed('0x10c')](db[_0xe6ed('0x9d')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1aa')});db[_0xe6ed('0x9b')][_0xe6ed('0x10c')](db['AnalyticFieldReport'],{'as':_0xe6ed('0x1b7'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1b8')});db[_0xe6ed('0x9d')]['belongsTo'](db[_0xe6ed('0x9b')],{'foreignKey':'MetricId'});db[_0xe6ed('0xa0')]['hasMany'](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xa2')][_0xe6ed('0x10c')](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xa2')][_0xe6ed('0x10c')](db[_0xe6ed('0xa4')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xa2')][_0xe6ed('0x10c')](db['SalesforceField'],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xa2')][_0xe6ed('0x11c')](db[_0xe6ed('0xa0')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xa4')][_0xe6ed('0x10c')](db['SalesforceField'],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xa4')]['hasMany'](db[_0xe6ed('0xa4')],{'as':_0xe6ed('0x1bf'),'foreignKey':'DescriptionId'});db[_0xe6ed('0xa4')]['hasMany'](db[_0xe6ed('0xa4')],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xa4')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xa5')]['hasMany'](db[_0xe6ed('0xa7')],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':'AccountId'});db[_0xe6ed('0xa7')]['hasMany'](db[_0xe6ed('0xa9')],{'as':'Subjects','onDelete':_0xe6ed('0x110'),'foreignKey':'SubjectId'});db[_0xe6ed('0xa7')]['hasMany'](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db['SugarcrmConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db['SugarcrmConfiguration'][_0xe6ed('0x11c')](db[_0xe6ed('0xa5')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xa9')][_0xe6ed('0x10c')](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xa9')][_0xe6ed('0x10c')](db['SugarcrmField'],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db['SugarcrmField']['hasMany'](db[_0xe6ed('0xa9')],{'as':_0xe6ed('0x1c0'),'foreignKey':'FieldId'});db[_0xe6ed('0xa9')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0x1c3')][_0xe6ed('0x10c')](db[_0xe6ed('0xab')],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xab')]['hasMany'](db[_0xe6ed('0xac')],{'as':_0xe6ed('0x1c4'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xab')]['hasMany'](db['DeskField'],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xab')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xe6ed('0x1bd')});db['DeskConfiguration'][_0xe6ed('0x11c')](db[_0xe6ed('0x1c3')],{'as':'Account','foreignKey':_0xe6ed('0x1b9')});db['DeskConfiguration'][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1c5')});db[_0xe6ed('0xac')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xac')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xac')][_0xe6ed('0x10c')](db[_0xe6ed('0xac')],{'as':'Field','foreignKey':'FieldId'});db[_0xe6ed('0xac')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':'VariableId'});db['ZohoAccount'][_0xe6ed('0x10c')](db['ZohoConfiguration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xaf')][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1c4'),'onDelete':_0xe6ed('0x110'),'foreignKey':'SubjectId'});db[_0xe6ed('0xaf')][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bc')});db['ZohoConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db['ZohoConfiguration'][_0xe6ed('0x11c')](db[_0xe6ed('0x1c7')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xb0')][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0xe6ed('0x10c')](db[_0xe6ed('0xb0')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xb0')]['hasMany'](db['ZohoField'],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xb0')][_0xe6ed('0x11c')](db['Variable'],{'as':'Variable','foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xb2')][_0xe6ed('0x10c')](db[_0xe6ed('0x1c8')],{'as':_0xe6ed('0x1c6'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0x1c8')][_0xe6ed('0x10c')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0x1c8')][_0xe6ed('0x10c')](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0x1c8')]['hasMany'](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1b7'),'foreignKey':'FieldId'});db[_0xe6ed('0x1c8')][_0xe6ed('0x11c')](db[_0xe6ed('0xb2')],{'as':'Account','foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0x1c8')]['belongsToMany'](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1ca')});db[_0xe6ed('0x1c9')][_0xe6ed('0x10c')](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db['ZendeskField'][_0xe6ed('0x10c')](db[_0xe6ed('0x1c9')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0x1c9')][_0xe6ed('0x10c')](db['ZendeskField'],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db['ZendeskField'][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xb6')][_0xe6ed('0x10c')](db['FreshdeskConfiguration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xb7')]['hasMany'](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1c4'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1ba')});db['FreshdeskConfiguration']['hasMany'](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1b7'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1bd')});db['FreshdeskConfiguration']['belongsTo'](db['FreshdeskAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['FreshdeskConfiguration'][_0xe6ed('0x11e')](db['Tag'],{'through':_0xe6ed('0x1cc')});db[_0xe6ed('0x1cb')]['hasMany'](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0x1cb')][_0xe6ed('0x10c')](db['FreshdeskField'],{'as':_0xe6ed('0x1bf'),'foreignKey':'DescriptionId'});db[_0xe6ed('0x1cb')][_0xe6ed('0x10c')](db[_0xe6ed('0x1cb')],{'as':_0xe6ed('0x1c0'),'foreignKey':'FieldId'});db[_0xe6ed('0x1cb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db['VtigerAccount'][_0xe6ed('0x10c')](db['VtigerConfiguration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xbb')][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1c4'),'foreignKey':_0xe6ed('0x1ba')});db['VtigerConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db['VtigerConfiguration'][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1b7'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xbb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1cd')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['VtigerField'][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1be'),'foreignKey':'SubjectId'});db[_0xe6ed('0xbc')][_0xe6ed('0x10c')](db[_0xe6ed('0xbc')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xbc')][_0xe6ed('0x10c')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0xe6ed('0xbc')]['belongsTo'](db['Variable'],{'as':_0xe6ed('0x1c1'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0xc0')],{'as':_0xe6ed('0x1c6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xe6ed('0xc0')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1c4'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc0')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xc0')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':'Fields','foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xc0')]['belongsTo'](db['ServicenowAccount'],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['ServicenowField'][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc2')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1bf'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xc2')][_0xe6ed('0x10c')](db[_0xe6ed('0xc2')],{'as':_0xe6ed('0x1c0'),'foreignKey':'FieldId'});db[_0xe6ed('0xc2')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':'Variable','foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xc4')][_0xe6ed('0x10c')](db['Dynamics365Configuration'],{'as':_0xe6ed('0x1c6'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xc4')][_0xe6ed('0x11c')](db[_0xe6ed('0x15a')],{'as':'CloudProvider','foreignKey':_0xe6ed('0x15b')});db[_0xe6ed('0x1ce')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1c4'),'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1ba')});db['Dynamics365Configuration'][_0xe6ed('0x10c')](db['Dynamics365Field'],{'as':_0xe6ed('0x1bb'),'onDelete':_0xe6ed('0x110'),'foreignKey':'DescriptionId'});db[_0xe6ed('0x1ce')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1b7'),'onDelete':'cascade','foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0x1ce')][_0xe6ed('0x11c')](db[_0xe6ed('0xc4')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db[_0xe6ed('0xc5')]['hasMany'](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1be'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc5')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1bf'),'foreignKey':'DescriptionId'});db[_0xe6ed('0xc5')][_0xe6ed('0x10c')](db[_0xe6ed('0xc5')],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xc5')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':'Variable','foreignKey':'VariableId'});db[_0xe6ed('0xc7')][_0xe6ed('0x10c')](db[_0xe6ed('0xc9')],{'as':'Configurations','onDelete':_0xe6ed('0x110'),'foreignKey':'AccountId'});db[_0xe6ed('0xc9')]['hasMany'](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1c4'),'foreignKey':_0xe6ed('0x1ba')});db[_0xe6ed('0xc9')][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1bb'),'foreignKey':_0xe6ed('0x1bc')});db[_0xe6ed('0xc9')][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1b7'),'foreignKey':'FieldId'});db[_0xe6ed('0xc9')][_0xe6ed('0x11c')](db[_0xe6ed('0xc7')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1b9')});db['FreshsalesField'][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':'Subject','foreignKey':_0xe6ed('0x1ba')});db['FreshsalesField'][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':'Description','foreignKey':'DescriptionId'});db['FreshsalesField'][_0xe6ed('0x10c')](db[_0xe6ed('0xcb')],{'as':_0xe6ed('0x1c0'),'foreignKey':_0xe6ed('0x1bd')});db[_0xe6ed('0xcb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1c1')],{'as':_0xe6ed('0x1c1'),'foreignKey':_0xe6ed('0x1c2')});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db['CmList'],{'as':_0xe6ed('0x162'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db['CmContact'],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x114')],{});db[_0xe6ed('0xcf')]['belongsTo'](db[_0xe6ed('0x67')],{});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{});db[_0xe6ed('0xcf')][_0xe6ed('0x11c')](db[_0xe6ed('0x6a')],{});db[_0xe6ed('0x195')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':'cascade','foreignKey':_0xe6ed('0x1cf')});db[_0xe6ed('0x195')]['belongsTo'](db[_0xe6ed('0x108')],{'onDelete':_0xe6ed('0x110'),'foreignKey':_0xe6ed('0x1d0')});db[_0xe6ed('0xd6')][_0xe6ed('0x10c')](db[_0xe6ed('0xd4')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xe6ed('0xd6')][_0xe6ed('0x10c')](db[_0xe6ed('0xd2')],{'foreignKey':_0xe6ed('0x1d1'),'onDelete':_0xe6ed('0x110')});db['SmsQueueReport'][_0xe6ed('0x11c')](db['SmsAccount'],{});db['SmsQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':'ListId'});db[_0xe6ed('0xd7')]['belongsTo'](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x125')],{});db[_0xe6ed('0xd7')][_0xe6ed('0x11c')](db[_0xe6ed('0x180')],{});db[_0xe6ed('0xd7')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{});db['SmsQueueReport']['belongsTo'](db[_0xe6ed('0x58')],{});db[_0xe6ed('0xdb')][_0xe6ed('0x10c')](db[_0xe6ed('0xd6')],{'foreignKey':'ProjectId'});db[_0xe6ed('0xdb')][_0xe6ed('0x10c')](db[_0xe6ed('0xd4')],{'foreignKey':_0xe6ed('0x1d2')});db['JscriptyProject'][_0xe6ed('0x10c')](db[_0xe6ed('0xd2')],{'foreignKey':_0xe6ed('0x1d2')});db['Team'][_0xe6ed('0x11e')](db['User'],{'as':_0xe6ed('0x166'),'through':'user_has_teams'});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db[_0xe6ed('0x1b')],{'through':'TeamVoiceQueue','as':_0xe6ed('0x12a')});db['Team'][_0xe6ed('0x11e')](db[_0xe6ed('0x167')],{'through':_0xe6ed('0x168'),'as':'MailQueues'});db['Team'][_0xe6ed('0x11e')](db[_0xe6ed('0x6a')],{'through':_0xe6ed('0x194'),'as':_0xe6ed('0x12d')});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xe6ed('0x12e')});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db['SmsQueue'],{'through':_0xe6ed('0x1d3'),'as':_0xe6ed('0x1d4')});db['Team'][_0xe6ed('0x11e')](db['OpenchannelQueue'],{'through':_0xe6ed('0x18a'),'as':_0xe6ed('0x131')});db[_0xe6ed('0x121')][_0xe6ed('0x11e')](db[_0xe6ed('0xff')],{'through':_0xe6ed('0x1d5'),'as':_0xe6ed('0x132')});db[_0xe6ed('0x121')]['belongsToMany'](db[_0xe6ed('0xf4')],{'through':'TeamVoicePrefix','as':_0xe6ed('0x1d6')});db['Campaign'][_0xe6ed('0x10c')](db[_0xe6ed('0x73')],{'as':_0xe6ed('0x147'),'foreignKey':'CampaignId'});db[_0xe6ed('0xe4')]['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe6ed('0x19e')});db[_0xe6ed('0xe4')][_0xe6ed('0x10c')](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x199'),'foreignKey':_0xe6ed('0x19e')});db[_0xe6ed('0xe4')]['hasMany'](db[_0xe6ed('0x75')],{'as':_0xe6ed('0x148'),'foreignKey':_0xe6ed('0x19e')});db[_0xe6ed('0xe4')][_0xe6ed('0x11c')](db['Trunk'],{'as':'Trunk','foreignKey':_0xe6ed('0x14a')});db['Campaign'][_0xe6ed('0x11c')](db[_0xe6ed('0x2b')],{'as':_0xe6ed('0x14b'),'foreignKey':'TrunkBackupId'});db[_0xe6ed('0xe4')][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'as':'Interval','foreignKey':_0xe6ed('0x14c')});db[_0xe6ed('0xe4')][_0xe6ed('0x11c')](db[_0xe6ed('0x1d7')],{'as':_0xe6ed('0x1d7'),'foreignKey':_0xe6ed('0x1d8')});db[_0xe6ed('0xe4')][_0xe6ed('0x11e')](db[_0xe6ed('0xf2')],{'as':'Lists','through':_0xe6ed('0x1d9')});db[_0xe6ed('0xe4')]['belongsToMany'](db[_0xe6ed('0xf2')],{'as':'BlackLists','through':_0xe6ed('0x1da')});db['Attachment'][_0xe6ed('0x11c')](db[_0xe6ed('0x171')],{'as':_0xe6ed('0x171'),'foreignKey':_0xe6ed('0x172')});db['MailTransferReport'][_0xe6ed('0x11c')](db['MailMessage'],{});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db[_0xe6ed('0x40')],{});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1db'),'as':_0xe6ed('0x1dc')});db[_0xe6ed('0xe9')]['belongsTo'](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1dd'),'as':'ToAgent'});db[_0xe6ed('0xe9')][_0xe6ed('0x11c')](db[_0xe6ed('0x167')],{'foreignKey':_0xe6ed('0x1de'),'as':_0xe6ed('0x1df')});db['MailTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x3c')],{'foreignKey':_0xe6ed('0x1e0'),'as':_0xe6ed('0x1e1')});db[_0xe6ed('0xeb')]['belongsTo'](db[_0xe6ed('0x67')],{});db[_0xe6ed('0xeb')][_0xe6ed('0x11c')](db[_0xe6ed('0x114')],{});db[_0xe6ed('0xeb')][_0xe6ed('0x11c')](db[_0xe6ed('0x61')],{'foreignKey':_0xe6ed('0x1e2'),'as':_0xe6ed('0x1e3')});db['ChatTransferReport'][_0xe6ed('0x11c')](db['User'],{'foreignKey':_0xe6ed('0x1db'),'as':_0xe6ed('0x1dc')});db[_0xe6ed('0xeb')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0xe6ed('0x1e4')});db[_0xe6ed('0xeb')][_0xe6ed('0x11c')](db[_0xe6ed('0x6a')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db['ChatTransferReport'][_0xe6ed('0x11c')](db['ChatWebsite'],{'foreignKey':_0xe6ed('0x1e5'),'as':_0xe6ed('0x1e1')});db['FaxTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x4e')],{});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db[_0xe6ed('0x4d')],{});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db[_0xe6ed('0x49')],{'foreignKey':_0xe6ed('0x1e6'),'as':_0xe6ed('0x1e3')});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db['User'],{'foreignKey':_0xe6ed('0x1dd'),'as':_0xe6ed('0x1e4')});db[_0xe6ed('0xed')][_0xe6ed('0x11c')](db['FaxQueue'],{'foreignKey':_0xe6ed('0x1e7'),'as':_0xe6ed('0x1df')});db[_0xe6ed('0xed')]['belongsTo'](db[_0xe6ed('0x49')],{'foreignKey':_0xe6ed('0x1e8'),'as':_0xe6ed('0x1e1')});db['OpenchannelTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x5e')],{});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db[_0xe6ed('0x187')],{});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db[_0xe6ed('0x59')],{'foreignKey':_0xe6ed('0x1e9'),'as':_0xe6ed('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe6ed('0x108')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1dd'),'as':'ToAgent'});db[_0xe6ed('0xee')][_0xe6ed('0x11c')](db['OpenchannelQueue'],{'foreignKey':_0xe6ed('0x1ea'),'as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db[_0xe6ed('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db['SmsMessage'],{});db[_0xe6ed('0xf0')]['belongsTo'](db[_0xe6ed('0x125')],{});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'foreignKey':_0xe6ed('0x1eb'),'as':_0xe6ed('0x1e3')});db['SmsTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1db'),'as':_0xe6ed('0x1dc')});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'foreignKey':'ToUserId','as':_0xe6ed('0x1e4')});db[_0xe6ed('0xf0')]['belongsTo'](db[_0xe6ed('0x58')],{'foreignKey':'ToSmsQueueId','as':_0xe6ed('0x1df')});db[_0xe6ed('0xf0')][_0xe6ed('0x11c')](db[_0xe6ed('0x53')],{'foreignKey':_0xe6ed('0x1ec'),'as':_0xe6ed('0x1e1')});db[_0xe6ed('0xf2')]['hasMany'](db[_0xe6ed('0x82')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0xf2')][_0xe6ed('0x10c')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0xe6ed('0x163')});db['CmList'][_0xe6ed('0x10c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x197'),'onDelete':_0xe6ed('0x110'),'foreignKey':'ListId'});db[_0xe6ed('0xf2')][_0xe6ed('0x10c')](db[_0xe6ed('0x76')],{'as':_0xe6ed('0x111'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xf2')]['hasMany'](db[_0xe6ed('0x78')],{'as':_0xe6ed('0x112'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xf2')][_0xe6ed('0x10c')](db[_0xe6ed('0x79')],{'as':_0xe6ed('0x79'),'foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0xf2')][_0xe6ed('0x11e')](db[_0xe6ed('0x1b')],{'as':_0xe6ed('0x1ed'),'through':_0xe6ed('0x1ee')});db[_0xe6ed('0xf2')][_0xe6ed('0x11e')](db['User'],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x133')});db[_0xe6ed('0xf4')][_0xe6ed('0x10c')](db[_0xe6ed('0x19')],{'as':'Extensions','onDelete':_0xe6ed('0x110')});db[_0xe6ed('0xf4')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':'Agents','through':_0xe6ed('0x12b')});db['VoicePrefix'][_0xe6ed('0x11e')](db['Team'],{'through':_0xe6ed('0x103'),'as':_0xe6ed('0x14f')});db['UserProfile'][_0xe6ed('0x10c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'foreignKey':_0xe6ed('0x11d')});db['UserProfile'][_0xe6ed('0x10c')](db[_0xe6ed('0x1ef')],{'as':_0xe6ed('0x1f0'),'foreignKey':_0xe6ed('0x11d'),'onDelete':'cascade'});db['UserProfileSection'][_0xe6ed('0x10c')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xe6ed('0x1f1'),'onDelete':_0xe6ed('0x110')});db[_0xe6ed('0x1f2')][_0xe6ed('0x10c')](db[_0xe6ed('0x82')],{'as':'Dispositions','foreignKey':_0xe6ed('0x1f3'),'onDelete':_0xe6ed('0x110')});db['WhatsappAccount'][_0xe6ed('0x10c')](db[_0xe6ed('0x80')],{'as':_0xe6ed('0x160'),'foreignKey':_0xe6ed('0x1f3')});db[_0xe6ed('0x1f2')][_0xe6ed('0x10c')](db[_0xe6ed('0xfb')],{'as':_0xe6ed('0x152'),'foreignKey':_0xe6ed('0x1f3')});db[_0xe6ed('0x1f2')]['hasMany'](db[_0xe6ed('0x118')],{'as':_0xe6ed('0x161')});db[_0xe6ed('0x1f2')]['hasMany'](db['WhatsappApplication'],{'as':_0xe6ed('0x141')});db[_0xe6ed('0x1f2')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':'List','foreignKey':_0xe6ed('0x163')});db[_0xe6ed('0x1f2')][_0xe6ed('0x11c')](db[_0xe6ed('0x14d')],{'as':_0xe6ed('0x165'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x166'),'through':_0xe6ed('0x13e')});db['WhatsappApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xe6ed('0x11c')](db['WhatsappQueue'],{'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x1f4')]['belongsTo'](db[_0xe6ed('0x1f2')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x84')],{'onDelete':'restrict','foreignKey':_0xe6ed('0x14c')});db['WhatsappApplication'][_0xe6ed('0x11c')](db[_0xe6ed('0x16b')],{'onDelete':_0xe6ed('0x15c'),'foreignKey':'TagId'});db['WhatsappInteraction'][_0xe6ed('0x10c')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xe6ed('0x1f5')});db['WhatsappInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'as':_0xe6ed('0x179'),'foreignKey':_0xe6ed('0x1f3')});db['WhatsappInteraction'][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':'ContactId'});db[_0xe6ed('0x118')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x16a'),'foreignKey':_0xe6ed('0x10a')});db[_0xe6ed('0x118')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1ad'),'as':_0xe6ed('0x16d')});db[_0xe6ed('0x118')][_0xe6ed('0x11e')](db[_0xe6ed('0x16b')],{'through':_0xe6ed('0x1ad'),'as':_0xe6ed('0x16e')});db[_0xe6ed('0x118')][_0xe6ed('0x11e')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x17b'),'through':'user_has_whatsapp_interactions','foreignKey':_0xe6ed('0x1f5')});db['WhatsappMessage']['belongsTo'](db[_0xe6ed('0x108')],{'as':'User'});db['WhatsappMessage'][_0xe6ed('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0xe6ed('0x157')});db[_0xe6ed('0xfb')][_0xe6ed('0x11c')](db[_0xe6ed('0x118')],{'onDelete':'cascade','as':_0xe6ed('0x170'),'foreignKey':_0xe6ed('0x1f5')});db[_0xe6ed('0xfb')][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'as':'Account','foreignKey':_0xe6ed('0x1f3')});db[_0xe6ed('0x1f6')]['belongsTo'](db[_0xe6ed('0x1f2')],{});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0xf2')],{'as':_0xe6ed('0x162'),'foreignKey':'ListId'});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0x71')],{'as':_0xe6ed('0x157'),'foreignKey':_0xe6ed('0x158')});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0x118')],{});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0xff')],{});db[_0xe6ed('0x1f6')][_0xe6ed('0x11c')](db[_0xe6ed('0xfb')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xe6ed('0x108')],{});db[_0xe6ed('0xfd')]['belongsTo'](db[_0xe6ed('0xfb')],{});db[_0xe6ed('0xfd')][_0xe6ed('0x11c')](db[_0xe6ed('0x118')],{});db['WhatsappTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'foreignKey':_0xe6ed('0x1f7'),'as':_0xe6ed('0x1e3')});db['WhatsappTransferReport'][_0xe6ed('0x11c')](db[_0xe6ed('0x1f2')],{'foreignKey':_0xe6ed('0x1f8'),'as':_0xe6ed('0x1e1')});db[_0xe6ed('0xfd')]['belongsTo'](db[_0xe6ed('0xff')],{'foreignKey':_0xe6ed('0x1f9'),'as':_0xe6ed('0x1df')});db[_0xe6ed('0xfd')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xe6ed('0x1dc')});db[_0xe6ed('0xfd')]['belongsTo'](db[_0xe6ed('0x108')],{'foreignKey':_0xe6ed('0x1dd'),'as':_0xe6ed('0x1e4')});db['WhatsappQueue']['belongsToMany'](db['User'],{'as':_0xe6ed('0x166'),'through':'UserWhatsappQueue','foreignKey':_0xe6ed('0x1fa')});db[_0xe6ed('0xff')][_0xe6ed('0x11e')](db['Team'],{'through':_0xe6ed('0x1d5'),'as':_0xe6ed('0x14f')});db[_0xe6ed('0x106')][_0xe6ed('0x11c')](db[_0xe6ed('0x108')],{'as':_0xe6ed('0x1fb'),'foreignKey':_0xe6ed('0x10a'),'onDelete':_0xe6ed('0x110'),'hooks':!![]});db[_0xe6ed('0x15a')][_0xe6ed('0x10b')](db['Dynamics365Account'],{'as':_0xe6ed('0xc4'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x15a')]['hasOne'](db[_0xe6ed('0x38')],{'as':_0xe6ed('0x15d'),'onDelete':_0xe6ed('0x15c')});db[_0xe6ed('0x15a')][_0xe6ed('0x10b')](db['MailServerOut'],{'as':_0xe6ed('0x15e'),'onDelete':_0xe6ed('0x15c')});module[_0xe6ed('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 93eaad9..5c16af2 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeda5=['/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','/api/pauses','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/campaigns','/api/migrations','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/system','./api/system','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.1.0','/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items'];(function(_0x25c797,_0x3eef5d){var _0x1f1ed3=function(_0x35213c){while(--_0x35213c){_0x25c797['push'](_0x25c797['shift']());}};_0x1f1ed3(++_0x3eef5d);}(_0xeda5,0x1ed));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x5eda('0x0'));var express=require(_0x5eda('0x1'));var errors=require(_0x5eda('0x2'));var config=require(_0x5eda('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x5eda('0x4')];var clientSideLogs=require(_0x5eda('0x5'));exports[_0x5eda('0x6')]=function(_0x5b27e6){return setupLoggers(_0x5b27e6)[_0x5eda('0x7')](function(){_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x9'),require(_0x5eda('0xa')));_0x5b27e6[_0x5eda('0x8')]('/api/voice/chanspy',require(_0x5eda('0xb')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xc'),require(_0x5eda('0xd')));_0x5b27e6[_0x5eda('0x8')]('/api/voice/extensions',require(_0x5eda('0xe')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xf'),require('./api/voiceMusicOnHold'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x10'),require(_0x5eda('0x11')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x12'),require(_0x5eda('0x13')));_0x5b27e6['use'](_0x5eda('0x14'),require(_0x5eda('0x15')));_0x5b27e6[_0x5eda('0x8')]('/api/voice/mails',require('./api/voiceMail'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x16'),require(_0x5eda('0x17')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x18'),require('./api/voiceCallReport'));_0x5b27e6['use']('/api/voice/dials/reports',require(_0x5eda('0x19')));_0x5b27e6[_0x5eda('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x1a'),require(_0x5eda('0x1b')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x1c'),require(_0x5eda('0x1d')));_0x5b27e6[_0x5eda('0x8')]('/api/trunks',require(_0x5eda('0x1e')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x1f'),require('./api/voiceTransferReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x20'),require('./api/mailServerOut'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x21'),require('./api/mailAccount'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x22'),require('./api/mailQueue'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x23'),require(_0x5eda('0x24')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x25'),require(_0x5eda('0x26')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x27'),require(_0x5eda('0x28')));_0x5b27e6['use'](_0x5eda('0x29'),require(_0x5eda('0x2a')));_0x5b27e6['use'](_0x5eda('0x2b'),require(_0x5eda('0x2c')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x2d'),require('./api/dashboard'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x2e'),require('./api/dashboardItem'));_0x5b27e6['use'](_0x5eda('0x2f'),require('./api/faxAccount'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x30'),require(_0x5eda('0x31')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x32'),require('./api/faxInteraction'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x33'),require(_0x5eda('0x34')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x35'),require(_0x5eda('0x36')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x37'),require(_0x5eda('0x38')));_0x5b27e6['use'](_0x5eda('0x39'),require(_0x5eda('0x3a')));_0x5b27e6[_0x5eda('0x8')]('/api/sms/applications',require(_0x5eda('0x3b')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x3c'),require('./api/smsInteraction'));_0x5b27e6['use'](_0x5eda('0x3d'),require('./api/smsMessage'));_0x5b27e6['use']('/api/sms/queues',require('./api/smsQueue'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x3e'),require(_0x5eda('0x3f')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x40'),require('./api/openchannelApplication'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x41'),require('./api/openchannelInteraction'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x42'),require('./api/openchannelMessage'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x43'),require(_0x5eda('0x44')));_0x5b27e6[_0x5eda('0x8')]('/api/chat/websites',require('./api/chatWebsite'));_0x5b27e6[_0x5eda('0x8')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x45'),require(_0x5eda('0x46')));_0x5b27e6[_0x5eda('0x8')]('/api/chat/interactions',require(_0x5eda('0x47')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x48'),require(_0x5eda('0x49')));_0x5b27e6['use'](_0x5eda('0x4a'),require(_0x5eda('0x4b')));_0x5b27e6['use'](_0x5eda('0x4c'),require('./api/chatQueue'));_0x5b27e6[_0x5eda('0x8')]('/api/chat/groups',require(_0x5eda('0x4d')));_0x5b27e6[_0x5eda('0x8')]('/api/chat/proactive_actions',require(_0x5eda('0x4e')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x4f'),require(_0x5eda('0x50')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x51'),require(_0x5eda('0x52')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x53'),require(_0x5eda('0x54')));_0x5b27e6[_0x5eda('0x8')]('/api/cm/hopper_black',require(_0x5eda('0x55')));_0x5b27e6[_0x5eda('0x8')]('/api/cm/hopper_final',require(_0x5eda('0x56')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x57'),require(_0x5eda('0x58')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x59'),require(_0x5eda('0x5a')));_0x5b27e6[_0x5eda('0x8')]('/api/actions',require(_0x5eda('0x5b')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x5c'),require(_0x5eda('0x5d')));_0x5b27e6[_0x5eda('0x8')]('/api/canned_answers',require(_0x5eda('0x5e')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x5f'),require(_0x5eda('0x60')));_0x5b27e6[_0x5eda('0x8')]('/api/conditions',require(_0x5eda('0x61')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x62'),require('./api/interval'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x63'),require('./api/pause'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x64'),require('./api/cdr'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x65'),require('./api/voiceQueuesLog'));_0x5b27e6['use'](_0x5eda('0x66'),require(_0x5eda('0x67')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x68'),require(_0x5eda('0x69')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x6a'),require(_0x5eda('0x6b')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x6c'),require(_0x5eda('0x6d')));_0x5b27e6[_0x5eda('0x8')]('/api/cm_contact_has_items',require('./api/cmContactHasItem'));_0x5b27e6[_0x5eda('0x8')]('/api/cm_hopper_additional_phones',require(_0x5eda('0x6e')));_0x5b27e6['use'](_0x5eda('0x6f'),require(_0x5eda('0x70')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x71'),require('./api/trigger'));_0x5b27e6['use'](_0x5eda('0x72'),require(_0x5eda('0x73')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x74'),require(_0x5eda('0x75')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x76'),require(_0x5eda('0x77')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x78'),require('./api/analyticCustomReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x79'),require(_0x5eda('0x7a')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x7b'),require('./api/analyticExtractedReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x7c'),require(_0x5eda('0x7d')));_0x5b27e6[_0x5eda('0x8')]('/api/analytics/field_reports',require(_0x5eda('0x7e')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x7f'),require(_0x5eda('0x80')));_0x5b27e6['use'](_0x5eda('0x81'),require(_0x5eda('0x82')));_0x5b27e6['use'](_0x5eda('0x83'),require(_0x5eda('0x84')));_0x5b27e6['use'](_0x5eda('0x85'),require('./api/intSalesforceField'));_0x5b27e6[_0x5eda('0x8')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x86'),require(_0x5eda('0x87')));_0x5b27e6['use'](_0x5eda('0x88'),require('./api/intSugarcrmField'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x89'),require(_0x5eda('0x8a')));_0x5b27e6[_0x5eda('0x8')]('/api/integrations/desk/configurations',require(_0x5eda('0x8b')));_0x5b27e6['use'](_0x5eda('0x8c'),require(_0x5eda('0x8d')));_0x5b27e6['use'](_0x5eda('0x8e'),require(_0x5eda('0x8f')));_0x5b27e6['use'](_0x5eda('0x90'),require(_0x5eda('0x91')));_0x5b27e6['use'](_0x5eda('0x92'),require(_0x5eda('0x93')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x94'),require(_0x5eda('0x95')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x96'),require(_0x5eda('0x97')));_0x5b27e6['use'](_0x5eda('0x98'),require(_0x5eda('0x99')));_0x5b27e6['use'](_0x5eda('0x9a'),require(_0x5eda('0x9b')));_0x5b27e6['use']('/api/integrations/freshdesk/configurations',require(_0x5eda('0x9c')));_0x5b27e6[_0x5eda('0x8')]('/api/integrations/freshdesk/fields',require(_0x5eda('0x9d')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x9e'),require(_0x5eda('0x9f')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xa0'),require(_0x5eda('0xa1')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xa2'),require(_0x5eda('0xa3')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xa4'),require(_0x5eda('0xa5')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xa6'),require(_0x5eda('0xa7')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xa8'),require(_0x5eda('0xa9')));_0x5b27e6['use'](_0x5eda('0xaa'),require(_0x5eda('0xab')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xac'),require(_0x5eda('0xad')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xae'),require(_0x5eda('0xaf')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb0'),require('./api/intFreshsalesAccount'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb1'),require(_0x5eda('0xb2')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb3'),require('./api/intFreshsalesField'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb4'),require(_0x5eda('0xb5')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb6'),require('./api/chatQueueReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb7'),require(_0x5eda('0xb8')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xb9'),require(_0x5eda('0xba')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xbb'),require('./api/jscriptyQuestionReport'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xbc'),require(_0x5eda('0xbd')));_0x5b27e6[_0x5eda('0x8')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x5b27e6['use'](_0x5eda('0xbe'),require(_0x5eda('0xbf')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xc0'),require('./api/squareReportDetail'));_0x5b27e6[_0x5eda('0x8')]('/api/jscripty/projects',require(_0x5eda('0xc1')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xc2'),require('./api/setting'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xc3'),require(_0x5eda('0xc4')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xc5'),require(_0x5eda('0xc6')));_0x5b27e6[_0x5eda('0x8')]('/api/square/recordings',require(_0x5eda('0xc7')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xc8'),require(_0x5eda('0xc9')));_0x5b27e6[_0x5eda('0x8')]('/api/teams',require(_0x5eda('0xca')));_0x5b27e6[_0x5eda('0x8')]('/api/license',require(_0x5eda('0xcb')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xcc'),require('./api/campaign'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xcd'),require('./api/migration'));_0x5b27e6['use'](_0x5eda('0xce'),require('./api/attachment'));_0x5b27e6['use']('/api/plugins',require(_0x5eda('0xcf')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xd0'),require(_0x5eda('0xd1')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xd2'),require(_0x5eda('0xd3')));_0x5b27e6['use'](_0x5eda('0xd4'),require(_0x5eda('0xd5')));_0x5b27e6['use'](_0x5eda('0xd6'),require(_0x5eda('0xd7')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xd8'),require(_0x5eda('0xd9')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xda'),require('./api/cmList'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xdb'),require(_0x5eda('0xdc')));_0x5b27e6['use']('/api/userProfiles',require(_0x5eda('0xdd')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xde'),require('./api/userProfileSection'));_0x5b27e6[_0x5eda('0x8')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xdf'),require(_0x5eda('0xe0')));_0x5b27e6['use'](_0x5eda('0xe1'),require('./api/whatsappAccount'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xe2'),require(_0x5eda('0xe3')));_0x5b27e6[_0x5eda('0x8')]('/api/whatsapp/interactions',require(_0x5eda('0xe4')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xe5'),require(_0x5eda('0xe6')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xe7'),require(_0x5eda('0xe8')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xe9'),require(_0x5eda('0xea')));_0x5b27e6['use'](_0x5eda('0xeb'),require('./api/whatsappQueue'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xec'),require(_0x5eda('0xed')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xee'),require(_0x5eda('0xef')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xf0'),require('./api/user-setting'));_0x5b27e6['use'](_0x5eda('0xf1'),require('./api/authLocal'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xf2'),require(_0x5eda('0xf3')));_0x5b27e6['use'](_0x5eda('0xf4'),require(_0x5eda('0xf5')));_0x5b27e6[_0x5eda('0x8')]('/api/jira',require(_0x5eda('0xf6')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xf7'),require(_0x5eda('0xf8')));_0x5b27e6[_0x5eda('0x8')]('/api/version',require('./api/version'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xf9'),require(_0x5eda('0xfa')));_0x5b27e6['use']('/api/pm2',require('./api/pm2'));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xfb'),require(_0x5eda('0xfc')));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xfd'),clientSideLogs);_0x5b27e6[_0x5eda('0x8')](_0x5eda('0xfe'),express[_0x5eda('0xff')](path[_0x5eda('0x100')](config[_0x5eda('0x101')],_0x5eda('0xfe'))));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x102'),express[_0x5eda('0xff')](path[_0x5eda('0x100')](config[_0x5eda('0x101')],_0x5eda('0x102'))));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x103'),express[_0x5eda('0xff')](path[_0x5eda('0x100')](config[_0x5eda('0x101')],'/demo')));_0x5b27e6['use'](_0x5eda('0x104'),express['static'](path[_0x5eda('0x100')](config['root'],_0x5eda('0x105'),_0x5eda('0x106'))));_0x5b27e6[_0x5eda('0x8')](_0x5eda('0x107'),express[_0x5eda('0xff')](path[_0x5eda('0x100')](config[_0x5eda('0x101')],'/server/files/plugins')));_0x5b27e6[_0x5eda('0x108')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x5eda('0x109')](errors[0x194]);_0x5b27e6[_0x5eda('0x108')]('/*')[_0x5eda('0x109')](function(_0x374098,_0x2a373d){_0x2a373d[_0x5eda('0x10a')](path[_0x5eda('0x10b')](_0x5b27e6['get'](_0x5eda('0x10c'))+_0x5eda('0x10d')));});return _0x5b27e6;});}; \ No newline at end of file +var _0x4383=['./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.1.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/webbar'];(function(_0xaa2d94,_0x5dbc72){var _0xa52e81=function(_0x1b1adc){while(--_0x1b1adc){_0xaa2d94['push'](_0xaa2d94['shift']());}};_0xa52e81(++_0x5dbc72);}(_0x4383,0x122));var _0x3438=function(_0x1369a7,_0x252150){_0x1369a7=_0x1369a7-0x0;var _0x52322d=_0x4383[_0x1369a7];return _0x52322d;};'use strict';var path=require('path');var express=require(_0x3438('0x0'));var errors=require(_0x3438('0x1'));var config=require(_0x3438('0x2'));var setupLoggers=require('./utils/client-side-logger')[_0x3438('0x3')];var clientSideLogs=require(_0x3438('0x4'));exports[_0x3438('0x5')]=function(_0x438481){return setupLoggers(_0x438481)[_0x3438('0x6')](function(){_0x438481['use'](_0x3438('0x7'),require(_0x3438('0x8')));_0x438481[_0x3438('0x9')](_0x3438('0xa'),require(_0x3438('0xb')));_0x438481[_0x3438('0x9')](_0x3438('0xc'),require('./api/voiceContext'));_0x438481[_0x3438('0x9')]('/api/voice/extensions',require('./api/voiceExtension'));_0x438481['use'](_0x3438('0xd'),require(_0x3438('0xe')));_0x438481['use']('/api/voice/queues',require(_0x3438('0xf')));_0x438481['use'](_0x3438('0x10'),require(_0x3438('0x11')));_0x438481[_0x3438('0x9')](_0x3438('0x12'),require(_0x3438('0x13')));_0x438481[_0x3438('0x9')](_0x3438('0x14'),require(_0x3438('0x15')));_0x438481[_0x3438('0x9')]('/api/voice/mails/messages',require(_0x3438('0x16')));_0x438481[_0x3438('0x9')](_0x3438('0x17'),require(_0x3438('0x18')));_0x438481['use'](_0x3438('0x19'),require(_0x3438('0x1a')));_0x438481['use'](_0x3438('0x1b'),require('./api/voiceAgentReport'));_0x438481[_0x3438('0x9')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x438481[_0x3438('0x9')](_0x3438('0x1c'),require(_0x3438('0x1d')));_0x438481['use']('/api/trunks',require(_0x3438('0x1e')));_0x438481[_0x3438('0x9')](_0x3438('0x1f'),require(_0x3438('0x20')));_0x438481[_0x3438('0x9')]('/api/mail/out_servers',require(_0x3438('0x21')));_0x438481[_0x3438('0x9')](_0x3438('0x22'),require(_0x3438('0x23')));_0x438481['use'](_0x3438('0x24'),require(_0x3438('0x25')));_0x438481[_0x3438('0x9')](_0x3438('0x26'),require(_0x3438('0x27')));_0x438481[_0x3438('0x9')](_0x3438('0x28'),require(_0x3438('0x29')));_0x438481[_0x3438('0x9')](_0x3438('0x2a'),require(_0x3438('0x2b')));_0x438481['use']('/api/mail/applications',require(_0x3438('0x2c')));_0x438481[_0x3438('0x9')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x438481[_0x3438('0x9')](_0x3438('0x2d'),require(_0x3438('0x2e')));_0x438481[_0x3438('0x9')]('/api/dashboards/items',require(_0x3438('0x2f')));_0x438481[_0x3438('0x9')](_0x3438('0x30'),require(_0x3438('0x31')));_0x438481['use'](_0x3438('0x32'),require('./api/faxApplication'));_0x438481[_0x3438('0x9')](_0x3438('0x33'),require(_0x3438('0x34')));_0x438481[_0x3438('0x9')](_0x3438('0x35'),require(_0x3438('0x36')));_0x438481[_0x3438('0x9')](_0x3438('0x37'),require(_0x3438('0x38')));_0x438481[_0x3438('0x9')](_0x3438('0x39'),require(_0x3438('0x3a')));_0x438481[_0x3438('0x9')](_0x3438('0x3b'),require(_0x3438('0x3c')));_0x438481[_0x3438('0x9')](_0x3438('0x3d'),require(_0x3438('0x3e')));_0x438481[_0x3438('0x9')](_0x3438('0x3f'),require(_0x3438('0x40')));_0x438481[_0x3438('0x9')]('/api/sms/messages',require(_0x3438('0x41')));_0x438481[_0x3438('0x9')](_0x3438('0x42'),require(_0x3438('0x43')));_0x438481['use'](_0x3438('0x44'),require(_0x3438('0x45')));_0x438481[_0x3438('0x9')](_0x3438('0x46'),require(_0x3438('0x47')));_0x438481[_0x3438('0x9')](_0x3438('0x48'),require(_0x3438('0x49')));_0x438481[_0x3438('0x9')]('/api/openchannel/messages',require(_0x3438('0x4a')));_0x438481['use'](_0x3438('0x4b'),require(_0x3438('0x4c')));_0x438481[_0x3438('0x9')](_0x3438('0x4d'),require(_0x3438('0x4e')));_0x438481[_0x3438('0x9')](_0x3438('0x4f'),require(_0x3438('0x50')));_0x438481[_0x3438('0x9')](_0x3438('0x51'),require('./api/chatApplication'));_0x438481['use'](_0x3438('0x52'),require(_0x3438('0x53')));_0x438481['use']('/api/chat/messages',require(_0x3438('0x54')));_0x438481[_0x3438('0x9')](_0x3438('0x55'),require('./api/chatOfflineMessage'));_0x438481[_0x3438('0x9')](_0x3438('0x56'),require('./api/chatQueue'));_0x438481[_0x3438('0x9')](_0x3438('0x57'),require(_0x3438('0x58')));_0x438481[_0x3438('0x9')](_0x3438('0x59'),require(_0x3438('0x5a')));_0x438481[_0x3438('0x9')](_0x3438('0x5b'),require(_0x3438('0x5c')));_0x438481[_0x3438('0x9')](_0x3438('0x5d'),require(_0x3438('0x5e')));_0x438481[_0x3438('0x9')](_0x3438('0x5f'),require('./api/cmHopper'));_0x438481['use'](_0x3438('0x60'),require('./api/cmHopperBlack'));_0x438481[_0x3438('0x9')](_0x3438('0x61'),require(_0x3438('0x62')));_0x438481[_0x3438('0x9')]('/api/cm/hopper_history',require(_0x3438('0x63')));_0x438481[_0x3438('0x9')](_0x3438('0x64'),require(_0x3438('0x65')));_0x438481[_0x3438('0x9')]('/api/actions',require('./api/action'));_0x438481[_0x3438('0x9')](_0x3438('0x66'),require(_0x3438('0x67')));_0x438481[_0x3438('0x9')]('/api/canned_answers',require(_0x3438('0x68')));_0x438481[_0x3438('0x9')](_0x3438('0x69'),require(_0x3438('0x6a')));_0x438481['use'](_0x3438('0x6b'),require('./api/condition'));_0x438481[_0x3438('0x9')](_0x3438('0x6c'),require(_0x3438('0x6d')));_0x438481[_0x3438('0x9')](_0x3438('0x6e'),require(_0x3438('0x6f')));_0x438481[_0x3438('0x9')](_0x3438('0x70'),require('./api/cdr'));_0x438481[_0x3438('0x9')](_0x3438('0x71'),require('./api/voiceQueuesLog'));_0x438481[_0x3438('0x9')](_0x3438('0x72'),require(_0x3438('0x73')));_0x438481[_0x3438('0x9')]('/api/sounds',require(_0x3438('0x74')));_0x438481[_0x3438('0x9')]('/api/tags',require('./api/tag'));_0x438481[_0x3438('0x9')](_0x3438('0x75'),require('./api/contactItemType'));_0x438481['use'](_0x3438('0x76'),require(_0x3438('0x77')));_0x438481[_0x3438('0x9')](_0x3438('0x78'),require(_0x3438('0x79')));_0x438481[_0x3438('0x9')](_0x3438('0x7a'),require('./api/template'));_0x438481['use']('/api/triggers',require(_0x3438('0x7b')));_0x438481[_0x3438('0x9')](_0x3438('0x7c'),require(_0x3438('0x7d')));_0x438481['use'](_0x3438('0x7e'),require(_0x3438('0x7f')));_0x438481[_0x3438('0x9')](_0x3438('0x80'),require(_0x3438('0x81')));_0x438481['use'](_0x3438('0x82'),require('./api/analyticCustomReport'));_0x438481[_0x3438('0x9')](_0x3438('0x83'),require(_0x3438('0x84')));_0x438481[_0x3438('0x9')]('/api/analytics/extracted_reports',require(_0x3438('0x85')));_0x438481[_0x3438('0x9')]('/api/analytics/metrics',require(_0x3438('0x86')));_0x438481[_0x3438('0x9')](_0x3438('0x87'),require('./api/analyticFieldReport'));_0x438481['use']('/api/analytics/tree_reports',require(_0x3438('0x88')));_0x438481[_0x3438('0x9')]('/api/integrations/salesforce/accounts',require(_0x3438('0x89')));_0x438481['use']('/api/integrations/salesforce/configurations',require(_0x3438('0x8a')));_0x438481[_0x3438('0x9')](_0x3438('0x8b'),require(_0x3438('0x8c')));_0x438481[_0x3438('0x9')](_0x3438('0x8d'),require(_0x3438('0x8e')));_0x438481[_0x3438('0x9')](_0x3438('0x8f'),require(_0x3438('0x90')));_0x438481[_0x3438('0x9')]('/api/integrations/sugarcrm/fields',require(_0x3438('0x91')));_0x438481[_0x3438('0x9')]('/api/integrations/desk/accounts',require(_0x3438('0x92')));_0x438481[_0x3438('0x9')](_0x3438('0x93'),require(_0x3438('0x94')));_0x438481['use'](_0x3438('0x95'),require(_0x3438('0x96')));_0x438481[_0x3438('0x9')]('/api/integrations/zoho/accounts',require(_0x3438('0x97')));_0x438481[_0x3438('0x9')](_0x3438('0x98'),require(_0x3438('0x99')));_0x438481['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x438481[_0x3438('0x9')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x438481['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x438481['use'](_0x3438('0x9a'),require('./api/intZendeskField'));_0x438481[_0x3438('0x9')](_0x3438('0x9b'),require(_0x3438('0x9c')));_0x438481[_0x3438('0x9')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x438481[_0x3438('0x9')](_0x3438('0x9d'),require(_0x3438('0x9e')));_0x438481[_0x3438('0x9')](_0x3438('0x9f'),require(_0x3438('0xa0')));_0x438481[_0x3438('0x9')](_0x3438('0xa1'),require(_0x3438('0xa2')));_0x438481[_0x3438('0x9')]('/api/integrations/vtiger/fields',require(_0x3438('0xa3')));_0x438481['use'](_0x3438('0xa4'),require(_0x3438('0xa5')));_0x438481[_0x3438('0x9')](_0x3438('0xa6'),require(_0x3438('0xa7')));_0x438481[_0x3438('0x9')](_0x3438('0xa8'),require('./api/intServicenowField'));_0x438481[_0x3438('0x9')](_0x3438('0xa9'),require('./api/intDynamics365Account'));_0x438481[_0x3438('0x9')](_0x3438('0xaa'),require('./api/intDynamics365Configuration'));_0x438481['use'](_0x3438('0xab'),require(_0x3438('0xac')));_0x438481[_0x3438('0x9')](_0x3438('0xad'),require(_0x3438('0xae')));_0x438481[_0x3438('0x9')]('/api/integrations/freshsales/configurations',require(_0x3438('0xaf')));_0x438481[_0x3438('0x9')](_0x3438('0xb0'),require(_0x3438('0xb1')));_0x438481[_0x3438('0x9')](_0x3438('0xb2'),require(_0x3438('0xb3')));_0x438481[_0x3438('0x9')](_0x3438('0xb4'),require('./api/chatQueueReport'));_0x438481[_0x3438('0x9')](_0x3438('0xb5'),require(_0x3438('0xb6')));_0x438481[_0x3438('0x9')](_0x3438('0xb7'),require(_0x3438('0xb8')));_0x438481['use'](_0x3438('0xb9'),require(_0x3438('0xba')));_0x438481['use'](_0x3438('0xbb'),require('./api/jscriptySessionReport'));_0x438481[_0x3438('0x9')](_0x3438('0xbc'),require(_0x3438('0xbd')));_0x438481[_0x3438('0x9')](_0x3438('0xbe'),require(_0x3438('0xbf')));_0x438481[_0x3438('0x9')](_0x3438('0xc0'),require('./api/squareReportDetail'));_0x438481[_0x3438('0x9')](_0x3438('0xc1'),require(_0x3438('0xc2')));_0x438481[_0x3438('0x9')](_0x3438('0xc3'),require(_0x3438('0xc4')));_0x438481[_0x3438('0x9')](_0x3438('0xc5'),require(_0x3438('0xc6')));_0x438481[_0x3438('0x9')](_0x3438('0xc7'),require(_0x3438('0xc8')));_0x438481['use'](_0x3438('0xc9'),require(_0x3438('0xca')));_0x438481[_0x3438('0x9')](_0x3438('0xcb'),require(_0x3438('0xcc')));_0x438481[_0x3438('0x9')]('/api/teams',require(_0x3438('0xcd')));_0x438481[_0x3438('0x9')](_0x3438('0xce'),require(_0x3438('0xcf')));_0x438481[_0x3438('0x9')]('/api/campaigns',require(_0x3438('0xd0')));_0x438481[_0x3438('0x9')]('/api/migrations',require(_0x3438('0xd1')));_0x438481[_0x3438('0x9')](_0x3438('0xd2'),require(_0x3438('0xd3')));_0x438481[_0x3438('0x9')](_0x3438('0xd4'),require(_0x3438('0xd5')));_0x438481[_0x3438('0x9')]('/api/mail/reports/transfer',require(_0x3438('0xd6')));_0x438481[_0x3438('0x9')]('/api/chat/reports/transfer',require(_0x3438('0xd7')));_0x438481[_0x3438('0x9')]('/api/fax/reports/transfer',require(_0x3438('0xd8')));_0x438481[_0x3438('0x9')]('/api/openchannel/reports/transfer',require(_0x3438('0xd9')));_0x438481[_0x3438('0x9')](_0x3438('0xda'),require(_0x3438('0xdb')));_0x438481[_0x3438('0x9')](_0x3438('0xdc'),require(_0x3438('0xdd')));_0x438481[_0x3438('0x9')](_0x3438('0xde'),require(_0x3438('0xdf')));_0x438481[_0x3438('0x9')]('/api/userProfiles',require(_0x3438('0xe0')));_0x438481[_0x3438('0x9')]('/api/userProfile/sections',require(_0x3438('0xe1')));_0x438481['use']('/api/userProfile/resources',require('./api/userProfileResource'));_0x438481[_0x3438('0x9')]('/api/userNotifications',require(_0x3438('0xe2')));_0x438481[_0x3438('0x9')](_0x3438('0xe3'),require('./api/whatsappAccount'));_0x438481[_0x3438('0x9')](_0x3438('0xe4'),require('./api/whatsappApplication'));_0x438481[_0x3438('0x9')]('/api/whatsapp/interactions',require(_0x3438('0xe5')));_0x438481[_0x3438('0x9')](_0x3438('0xe6'),require(_0x3438('0xe7')));_0x438481['use'](_0x3438('0xe8'),require(_0x3438('0xe9')));_0x438481[_0x3438('0x9')](_0x3438('0xea'),require(_0x3438('0xeb')));_0x438481['use'](_0x3438('0xec'),require('./api/whatsappQueue'));_0x438481['use'](_0x3438('0xed'),require(_0x3438('0xee')));_0x438481['use'](_0x3438('0xef'),require('./api/realtime'));_0x438481['use'](_0x3438('0xf0'),require(_0x3438('0xf1')));_0x438481['use']('/api/auth/local',require(_0x3438('0xf2')));_0x438481[_0x3438('0x9')](_0x3438('0xf3'),require(_0x3438('0xf4')));_0x438481[_0x3438('0x9')]('/api/auth/activedirectory',require(_0x3438('0xf5')));_0x438481['use'](_0x3438('0xf6'),require('./api/jira'));_0x438481['use'](_0x3438('0xf7'),require(_0x3438('0xf8')));_0x438481['use'](_0x3438('0xf9'),require(_0x3438('0xfa')));_0x438481['use'](_0x3438('0xfb'),require(_0x3438('0xfc')));_0x438481[_0x3438('0x9')]('/api/pm2',require('./api/pm2'));_0x438481[_0x3438('0x9')](_0x3438('0xfd'),require(_0x3438('0xfe')));_0x438481['use'](_0x3438('0xff'),clientSideLogs);_0x438481[_0x3438('0x9')](_0x3438('0x100'),express[_0x3438('0x101')](path[_0x3438('0x102')](config[_0x3438('0x103')],_0x3438('0x100'))));_0x438481['use'](_0x3438('0x104'),express['static'](path[_0x3438('0x102')](config[_0x3438('0x103')],_0x3438('0x104'))));_0x438481[_0x3438('0x9')]('/demo',express[_0x3438('0x101')](path[_0x3438('0x102')](config['root'],_0x3438('0x105'))));_0x438481[_0x3438('0x9')](_0x3438('0x106'),express[_0x3438('0x101')](path[_0x3438('0x102')](config[_0x3438('0x103')],'snippet',_0x3438('0x107'))));_0x438481[_0x3438('0x9')](_0x3438('0x108'),express[_0x3438('0x101')](path[_0x3438('0x102')](config['root'],'/server/files/plugins')));_0x438481[_0x3438('0x109')](_0x3438('0x10a'))[_0x3438('0x10b')](errors[0x194]);_0x438481[_0x3438('0x109')]('/*')['get'](function(_0x1c5e6b,_0x7a724c){_0x7a724c[_0x3438('0x10c')](path[_0x3438('0x10d')](_0x438481[_0x3438('0x10b')](_0x3438('0x10e'))+_0x3438('0x10f')));});return _0x438481;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b39637a..5928473 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd409=['../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../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/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','lodash','../config/environment','listen','merge'];(function(_0x489e07,_0x54d64d){var _0x40e3ff=function(_0x29b0dc){while(--_0x29b0dc){_0x489e07['push'](_0x489e07['shift']());}};_0x40e3ff(++_0x54d64d);}(_0xd409,0x15f));var _0x9d40=function(_0x455555,_0x2147fd){_0x455555=_0x455555-0x0;var _0x3cb183=_0xd409[_0x455555];return _0x3cb183;};'use strict';var jayson=require('jayson/promise');var _=require(_0x9d40('0x0'));var config=require(_0x9d40('0x1'));exports[_0x9d40('0x2')]=function(){return new Promise(function(_0x2ba497,_0x195aa3){var _0x284a37={};_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/user/user.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/voiceExtension/voiceExtension.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x4')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x5')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x6')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x7')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x284a37=_['merge'](_0x284a37,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x8')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x9')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0xa')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0xb')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0xc')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0xd')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0xe')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0xf')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x10')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/mailApplication/mailApplication.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x11')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x12')));_0x284a37=_['merge'](_0x284a37,require('../api/faxApplication/faxApplication.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x13')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x14')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x15')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x16')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x17')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x18')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x19')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x1a')));_0x284a37=_['merge'](_0x284a37,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x1b')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x1c')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x1d')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x1e')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x1f')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x20')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x21')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x22')));_0x284a37=_['merge'](_0x284a37,require('../api/cmHopper/cmHopper.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x23')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x24')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x25')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x26')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x27')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x28')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x29')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x2a')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x2b')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/trigger/trigger.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x2c')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x2d')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x2e')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x2f')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x30')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x31')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x32')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x33')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x34')));_0x284a37=_['merge'](_0x284a37,require(_0x9d40('0x35')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x36')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x37')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x38')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/squareOdbc/squareOdbc.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x39')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/squareRecording/squareRecording.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x3a')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x3b')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x3c')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x3d')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x284a37=_['merge'](_0x284a37,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x3e')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require(_0x9d40('0x3f')));_0x284a37=_[_0x9d40('0x3')](_0x284a37,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3e33ed=jayson[_0x9d40('0x40')](_0x284a37)['http']();var _0x1a4e46=config[_0x9d40('0x41')][_0x9d40('0x42')]||config[_0x9d40('0x42')]+0x1;var _0x2780df=config['rpc']['ip']||_0x9d40('0x43');_0x3e33ed['on'](_0x9d40('0x44'),function(_0x1b9c3f){return _0x195aa3(_0x1b9c3f);});_0x3e33ed[_0x9d40('0x2')](_0x1a4e46,_0x2780df,function(){console['log'](_0x9d40('0x45'),_0x2780df,_0x1a4e46);require(_0x9d40('0x46'))['default']();return _0x2ba497('RPC\x20listening\x20on\x20'+_0x2780df+':'+_0x1a4e46);});});}; \ No newline at end of file +var _0x293a=['../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','port','rpc','localhost','error','listen','log','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc'];(function(_0x1af92c,_0x1e6f9d){var _0x387bc5=function(_0x184431){while(--_0x184431){_0x1af92c['push'](_0x1af92c['shift']());}};_0x387bc5(++_0x1e6f9d);}(_0x293a,0xa6));var _0xa293=function(_0x58d3c5,_0x5865c6){_0x58d3c5=_0x58d3c5-0x0;var _0x4722f8=_0x293a[_0x58d3c5];return _0x4722f8;};'use strict';var jayson=require(_0xa293('0x0'));var _=require(_0xa293('0x1'));var config=require(_0xa293('0x2'));exports['listen']=function(){return new Promise(function(_0x574568,_0x11535e){var _0x2b7402={};_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x4')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x5')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceQueue/voiceQueue.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceRecording/voiceRecording.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x6')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x7')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x8')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x9')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0xa')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0xb')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0xc')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/mailAccount/mailAccount.rpc'));_0x2b7402=_['merge'](_0x2b7402,require('../api/mailQueue/mailQueue.rpc'));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0xd')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0xe')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0xf')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x10')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x11')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x12')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/faxMessage/faxMessage.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x13')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x14')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x15')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/smsInteraction/smsInteraction.rpc'));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x16')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x17')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x18')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x19')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1a')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x1b')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1c')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/chatInteraction/chatInteraction.rpc'));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x1d')));_0x2b7402=_['merge'](_0x2b7402,require('../api/chatQueue/chatQueue.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1e')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/cmHopper/cmHopper.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x1f')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x20')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x21')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/interval/interval.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x22')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x23')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x24')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x25')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x26')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/variable/variable.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x27')));_0x2b7402=_['merge'](_0x2b7402,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x28')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x29')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2a')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2b')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2c')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x2d')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2e')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x2f')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x30')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require('../api/squareReport/squareReport.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x31')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x32')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x33')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x34')));_0x2b7402=_['merge'](_0x2b7402,require('../api/squareRecording/squareRecording.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x35')));_0x2b7402=_['merge'](_0x2b7402,require(_0xa293('0x36')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x37')));_0x2b7402=_['merge'](_0x2b7402,require('../api/plugin/plugin.rpc'));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x38')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x39')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x3a')));_0x2b7402=_[_0xa293('0x3')](_0x2b7402,require(_0xa293('0x3b')));_0x2b7402=_['merge'](_0x2b7402,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x4a280e=jayson[_0xa293('0x3c')](_0x2b7402)['http']();var _0x3cd247=config['rpc'][_0xa293('0x3d')]||config[_0xa293('0x3d')]+0x1;var _0x34489d=config[_0xa293('0x3e')]['ip']||_0xa293('0x3f');_0x4a280e['on'](_0xa293('0x40'),function(_0x1d2e1a){return _0x11535e(_0x1d2e1a);});_0x4a280e[_0xa293('0x41')](_0x3cd247,_0x34489d,function(){console[_0xa293('0x42')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x34489d,_0x3cd247);require('../config/triggers')['default']();return _0x574568(_0xa293('0x43')+_0x34489d+':'+_0x3cd247);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index a5ebbc3..c8adc7d 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 _0x4c9d=['command','write','inherits','prototype','sync','answer','ANSWER','getData','beep','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','hangup','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','headers','ready','line','520-Invalid','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe'];(function(_0x4a5712,_0x56bd07){var _0x12a5f1=function(_0x3f2174){while(--_0x3f2174){_0x4a5712['push'](_0x4a5712['shift']());}};_0x12a5f1(++_0x56bd07);}(_0x4c9d,0x7c));var _0xd4c9=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4c9d[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0xd4c9('0x0'));var _=require(_0xd4c9('0x1'));var EventEmitter=require(_0xd4c9('0x2'))['EventEmitter'];var AGIReply=require(_0xd4c9('0x3'));var AGIError=require(_0xd4c9('0x4'));function AGIChannel(_0x173031){var _0x25a55d=this,_0x102345=new AGIReply(),_0x2b30d0=![],_0xbbed9a={};EventEmitter[_0xd4c9('0x5')](_0x25a55d);_0x173031[_0xd4c9('0x6')]('utf8');_0x173031['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x102345[_0xd4c9('0x6')](_0xd4c9('0x7'));_0x102345['on'](_0xd4c9('0x8'),function(_0x8ecc5a){for(var _0x324e78 in _0x8ecc5a){_0x25a55d[_0x324e78]=_0x8ecc5a[_0x324e78];}_0x25a55d['emit'](_0xd4c9('0x9'));});_0x102345['on'](_0xd4c9('0xa'),function(_0x429338){if(_0x429338['toLowerCase']()=='hangup'){_0x25a55d['emit']('hangup');return;}if(_0x429338['substring'](0x0,0xb)==_0xd4c9('0xb')){_0x2b30d0=!![];}if(_0x2b30d0){_0xbbed9a['rx']+=_0x429338+'\x0a';if(_0x429338['search'](_0xd4c9('0xc'))!=-0x1){_0x2b30d0=![];}}else{_0xbbed9a['rx']=_0x429338;}if(_0x2b30d0){return;}if(typeof _0xbbed9a['cb']==_0xd4c9('0xd')){var _0x460c59=_0xbbed9a['rx'][_0xd4c9('0xe')](0x0,0x3),_0x576c3a=null,_0x2419be=null;_0x460c59=parseInt(_0x460c59);if(isNaN(_0x460c59)){_0xbbed9a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xd4c9('0xf')});return;}if(_0x460c59!=0xc8){_0xbbed9a['cb'](null,{'code':_0x460c59,'result':-0x1,'extra':'KO'});return;}_0x576c3a=_0xbbed9a['rx'][_0xd4c9('0xe')](0x4)[_0xd4c9('0x10')](_0xd4c9('0x11'),'');if(_0x576c3a[_0xd4c9('0x12')]('\x20')!=-0x1){_0x576c3a=_0x576c3a[_0xd4c9('0x13')](0x0,_0x576c3a[_0xd4c9('0x12')]('\x20'));}if(_[_0xd4c9('0x14')](_0x576c3a,'-1')){_0x576c3a=parseInt(_0x576c3a);}_0x2419be=_0xbbed9a['rx'][_0xd4c9('0x15')]('\x20');if(_0x2419be['length']==0x3){_0x2419be=_0x2419be[0x2][_0xd4c9('0xe')](0x1,_0x2419be[0x2][_0xd4c9('0x16')]-0x1);}else if(_0x2419be['length']>0x3){var _0x5cec88=/\((.+)\)/;var _0x458fc4=_0xbbed9a['rx']['match'](_0x5cec88);if(_0x458fc4){_0x2419be=_0x458fc4[0x1];}else{_0x2419be=null;}}else{_0x2419be=null;}_0xbbed9a['cb'](null,{'code':_0x460c59,'result':_0x576c3a,'extra':_0x2419be});}});_0x173031['on'](_0xd4c9('0x17'),function(_0x42fd51){_0x25a55d[_0xd4c9('0x18')](_0xd4c9('0x17'),new AGIError(_0xd4c9('0x19'),_0x42fd51[_0xd4c9('0x1a')]));});_0x173031['on'](_0xd4c9('0x1b'),function(){_0x25a55d[_0xd4c9('0x18')](_0xd4c9('0x1b'),new AGIError(_0xd4c9('0x1c')));});_0x173031['on'](_0xd4c9('0x1d'),function(){_0x25a55d['emit']('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x173031[_0xd4c9('0x1e')]();});_0x173031[_0xd4c9('0x1f')](_0x102345);this[_0xd4c9('0x20')]=function(_0x338a63,_0x382c86){var _0x338a63=_0x338a63||'',_0x382c86=typeof _0x382c86==_0xd4c9('0xd')?_0x382c86:new Function();_0xbbed9a={'tx':_0x338a63,'rx':'','cb':_0x382c86};_0x173031[_0xd4c9('0x21')](_0x338a63+'\x0a');},this[_0xd4c9('0x1b')]=function(){_0x173031[_0xd4c9('0x1e')]();};}util[_0xd4c9('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xd4c9('0x23')]['sendRequest']=function(_0x572d99){return this[_0xd4c9('0x20')][_0xd4c9('0x24')](this,_0x572d99);};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x25')]=function(){return this['sendRequest'](_0xd4c9('0x26'));};AGIChannel['prototype'][_0xd4c9('0x27')]=function(_0x2eedc9,_0x5d54d8,_0x2ded54){_0x2eedc9=_0x2eedc9===undefined?_0xd4c9('0x28'):_0x2eedc9;_0x5d54d8=_0x5d54d8===undefined?'5':_0x5d54d8;_0x2ded54=_0x2ded54===undefined?'1':_0x2ded54;return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')](_0xd4c9('0x2b'),_0x2eedc9,_0x5d54d8*0x3e8,_0x2ded54));};AGIChannel[_0xd4c9('0x23')]['noop']=function(_0x28b733){_0x28b733=_0x28b733||_0xd4c9('0x2c');return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')](_0xd4c9('0x2d'),_0x28b733));};AGIChannel['prototype'][_0xd4c9('0x2e')]=function(_0x4bf1ca,_0x1da5d7){if(_['isArray'](_0x1da5d7)){return this[_0xd4c9('0x29')](util['format'](_0xd4c9('0x2f'),_0x4bf1ca,_0x1da5d7[_0xd4c9('0x30')](',')));}return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')]('EXEC\x20%s\x20%s',_0x4bf1ca,_0x1da5d7));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x31')]=function(_0x430322){return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')](_0xd4c9('0x32'),_0x430322));};AGIChannel['prototype']['setExtension']=function(_0xc22ee4){return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')](_0xd4c9('0x33'),_0xc22ee4));};AGIChannel['prototype'][_0xd4c9('0x34')]=function(_0x141e6c){return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')](_0xd4c9('0x35'),_0x141e6c));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x36')]=function(){return this[_0xd4c9('0x29')](_0xd4c9('0x37'));};AGIChannel[_0xd4c9('0x23')]['setVariable']=function(_0x9738c2,_0x3cbff9){var _0x372515=_[_0xd4c9('0x38')](_0x3cbff9)||_[_0xd4c9('0x39')](_0x3cbff9)?_0x3cbff9['toString']():_0x3cbff9;return this['sendRequest'](util[_0xd4c9('0x2a')](_0xd4c9('0x3a'),_0x9738c2,_0x372515?_0x372515[_0xd4c9('0x3b')]()[_0xd4c9('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd4c9('0x23')]['sayNumber']=function(_0xbc1213,_0x4dcccd){return this['sendRequest'](util[_0xd4c9('0x2a')](_0xd4c9('0x3c'),_0xbc1213,_0x4dcccd));};AGIChannel[_0xd4c9('0x23')]['sayDigits']=function(_0x58919b,_0x16d198){return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x58919b,_0x16d198));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x3d')]=function(_0x171528,_0x3e97e0){return this['sendRequest'](util[_0xd4c9('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x171528,_0x3e97e0));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x3e')]=function(_0x174033,_0x15f6c1,_0x20d873){_0x15f6c1=_0x15f6c1||this[_0xd4c9('0x3f')];_0x20d873=_0x20d873||0x1;this['setContext'](_0x174033);this[_0xd4c9('0x40')](_0x15f6c1);this[_0xd4c9('0x34')](_0x20d873);return this['noop'](util['format'](_0xd4c9('0x41'),_0x174033,_0x15f6c1,_0x20d873));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x42')]=function(_0x6f2b38){return this[_0xd4c9('0x29')](util[_0xd4c9('0x2a')](_0xd4c9('0x43'),_0x6f2b38));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x44')]=function(_0x3dd5d5,_0x6e4ad0,_0x42771c,_0x67abdf,_0x5c6af0,_0x411984){_0x6e4ad0=_0x6e4ad0||_0xd4c9('0x45');_0x42771c=_0x42771c||'';_0x67abdf=_0x67abdf===undefined?-0x1:_0x67abdf==='-1'?-0x1:_0x67abdf*0x3e8;_0x5c6af0=_0x5c6af0===undefined?'':'s='+_0x5c6af0;_0x411984=_0x411984?_0xd4c9('0x46'):'';return this[_0xd4c9('0x29')](util['format'](_0xd4c9('0x47'),_0x3dd5d5,_0x6e4ad0,_0x42771c,_0x67abdf,_0x411984,_0x5c6af0));};AGIChannel['prototype'][_0xd4c9('0x48')]=function(_0xb8fb98,_0x13aa81){_0x13aa81=_0x13aa81||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xb8fb98,_0x13aa81));};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x49')]=function(_0x32a717){return this[_0xd4c9('0x2e')]('AGI',_0x32a717);};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x4a')]=function(_0x430036){return this['exec']('WAIT',_0x430036);};AGIChannel[_0xd4c9('0x23')][_0xd4c9('0x17')]=function(_0x50a172,_0x209bed){this['noop'](util[_0xd4c9('0x2a')](_0xd4c9('0x4b'),_0x50a172['id'],_0x50a172[_0xd4c9('0x4c')],_0x209bed));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xd4c9('0x4d')]=AGIChannel; \ No newline at end of file +var _0xb8bd=['SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','toLowerCase','hangup','emit','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setVariable','isBoolean','isNumber'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb8bd,0x100));var _0xdb8b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xb8bd[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0xdb8b('0x0'));var _=require(_0xdb8b('0x1'));var EventEmitter=require(_0xdb8b('0x2'))[_0xdb8b('0x3')];var AGIReply=require(_0xdb8b('0x4'));var AGIError=require(_0xdb8b('0x5'));function AGIChannel(_0x55dc66){var _0x896e16=this,_0x555ee5=new AGIReply(),_0x4b6c92=![],_0x4b183a={};EventEmitter['call'](_0x896e16);_0x55dc66[_0xdb8b('0x6')](_0xdb8b('0x7'));_0x55dc66[_0xdb8b('0x8')](0x8*0x3c*0x3c*0x3e8);_0x555ee5[_0xdb8b('0x6')](_0xdb8b('0x7'));_0x555ee5['on'](_0xdb8b('0x9'),function(_0x663eb6){for(var _0x2514c6 in _0x663eb6){_0x896e16[_0x2514c6]=_0x663eb6[_0x2514c6];}_0x896e16['emit']('ready');});_0x555ee5['on']('line',function(_0x1da0f3){if(_0x1da0f3[_0xdb8b('0xa')]()==_0xdb8b('0xb')){_0x896e16[_0xdb8b('0xc')]('hangup');return;}if(_0x1da0f3[_0xdb8b('0xd')](0x0,0xb)==_0xdb8b('0xe')){_0x4b6c92=!![];}if(_0x4b6c92){_0x4b183a['rx']+=_0x1da0f3+'\x0a';if(_0x1da0f3[_0xdb8b('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x4b6c92=![];}}else{_0x4b183a['rx']=_0x1da0f3;}if(_0x4b6c92){return;}if(typeof _0x4b183a['cb']==_0xdb8b('0x10')){var _0x36b6ce=_0x4b183a['rx'][_0xdb8b('0xd')](0x0,0x3),_0x1af6ec=null,_0x31f914=null;_0x36b6ce=parseInt(_0x36b6ce);if(isNaN(_0x36b6ce)){_0x4b183a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xdb8b('0x11')});return;}if(_0x36b6ce!=0xc8){_0x4b183a['cb'](null,{'code':_0x36b6ce,'result':-0x1,'extra':'KO'});return;}_0x1af6ec=_0x4b183a['rx'][_0xdb8b('0xd')](0x4)[_0xdb8b('0x12')](_0xdb8b('0x13'),'');if(_0x1af6ec[_0xdb8b('0x14')]('\x20')!=-0x1){_0x1af6ec=_0x1af6ec[_0xdb8b('0x15')](0x0,_0x1af6ec[_0xdb8b('0x14')]('\x20'));}if(_[_0xdb8b('0x16')](_0x1af6ec,'-1')){_0x1af6ec=parseInt(_0x1af6ec);}_0x31f914=_0x4b183a['rx']['split']('\x20');if(_0x31f914[_0xdb8b('0x17')]==0x3){_0x31f914=_0x31f914[0x2][_0xdb8b('0xd')](0x1,_0x31f914[0x2]['length']-0x1);}else if(_0x31f914[_0xdb8b('0x17')]>0x3){var _0x44a0bd=/\((.+)\)/;var _0x87d278=_0x4b183a['rx'][_0xdb8b('0x18')](_0x44a0bd);if(_0x87d278){_0x31f914=_0x87d278[0x1];}else{_0x31f914=null;}}else{_0x31f914=null;}_0x4b183a['cb'](null,{'code':_0x36b6ce,'result':_0x1af6ec,'extra':_0x31f914});}});_0x55dc66['on'](_0xdb8b('0x19'),function(_0x37617e){_0x896e16[_0xdb8b('0xc')](_0xdb8b('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x37617e[_0xdb8b('0x1a')]));});_0x55dc66['on'](_0xdb8b('0x1b'),function(){_0x896e16[_0xdb8b('0xc')](_0xdb8b('0x1b'),new AGIError(_0xdb8b('0x1c')));});_0x55dc66['on'](_0xdb8b('0x1d'),function(){_0x896e16[_0xdb8b('0xc')]('timeout',new AGIError(_0xdb8b('0x1e')));_0x55dc66[_0xdb8b('0x1f')]();});_0x55dc66[_0xdb8b('0x20')](_0x555ee5);this[_0xdb8b('0x21')]=function(_0x4368cd,_0x2af7f5){var _0x4368cd=_0x4368cd||'',_0x2af7f5=typeof _0x2af7f5==_0xdb8b('0x10')?_0x2af7f5:new Function();_0x4b183a={'tx':_0x4368cd,'rx':'','cb':_0x2af7f5};_0x55dc66[_0xdb8b('0x22')](_0x4368cd+'\x0a');},this[_0xdb8b('0x1b')]=function(){_0x55dc66[_0xdb8b('0x1f')]();};}util[_0xdb8b('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5db78f){return this[_0xdb8b('0x21')]['sync'](this,_0x5db78f);};AGIChannel[_0xdb8b('0x24')]['answer']=function(){return this[_0xdb8b('0x25')](_0xdb8b('0x26'));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x27')]=function(_0x2c5506,_0x1e27b7,_0x3526e6){_0x2c5506=_0x2c5506===undefined?_0xdb8b('0x28'):_0x2c5506;_0x1e27b7=_0x1e27b7===undefined?'5':_0x1e27b7;_0x3526e6=_0x3526e6===undefined?'1':_0x3526e6;return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x2a'),_0x2c5506,_0x1e27b7*0x3e8,_0x3526e6));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x2b')]=function(_0x40a754){_0x40a754=_0x40a754||'NO\x20MESSAGE';return this[_0xdb8b('0x25')](util['format'](_0xdb8b('0x2c'),_0x40a754));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x2d')]=function(_0x1b7607,_0x573d31){if(_[_0xdb8b('0x2e')](_0x573d31)){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x2f'),_0x1b7607,_0x573d31[_0xdb8b('0x30')](',')));}return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x2f'),_0x1b7607,_0x573d31));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x31')]=function(_0x300829){return this['sendRequest'](util['format'](_0xdb8b('0x32'),_0x300829));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x33')]=function(_0x4079ea){return this['sendRequest'](util[_0xdb8b('0x29')](_0xdb8b('0x34'),_0x4079ea));};AGIChannel['prototype']['setPriority']=function(_0x58d1aa){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')]('SET\x20PRIORITY\x20%s',_0x58d1aa));};AGIChannel[_0xdb8b('0x24')]['hangup']=function(){return this[_0xdb8b('0x25')]('HANGUP');};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x35')]=function(_0x578fb2,_0x429959){var _0x3ba70d=_[_0xdb8b('0x36')](_0x429959)||_[_0xdb8b('0x37')](_0x429959)?_0x429959['toString']():_0x429959;return this[_0xdb8b('0x25')](util['format'](_0xdb8b('0x38'),_0x578fb2,_0x3ba70d?_0x3ba70d['toString']()[_0xdb8b('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x39')]=function(_0x40ad3a,_0x4309d3){return this['sendRequest'](util['format'](_0xdb8b('0x3a'),_0x40ad3a,_0x4309d3));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x3b')]=function(_0xf9bae8,_0x5098fc){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x3c'),_0xf9bae8,_0x5098fc));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x3d')]=function(_0xf23bf3,_0x10e4ea){return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xf23bf3,_0x10e4ea));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x3e')]=function(_0x46dbd7,_0x34becf,_0x1b1145){_0x34becf=_0x34becf||this[_0xdb8b('0x3f')];_0x1b1145=_0x1b1145||0x1;this[_0xdb8b('0x31')](_0x46dbd7);this['setExtension'](_0x34becf);this[_0xdb8b('0x40')](_0x1b1145);return this[_0xdb8b('0x2b')](util[_0xdb8b('0x29')](_0xdb8b('0x41'),_0x46dbd7,_0x34becf,_0x1b1145));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x42')]=function(_0x5e84f7){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x5e84f7));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x43')]=function(_0x2512d7,_0x923f80,_0x4794c3,_0x507609,_0x1cb3d9,_0x211820){_0x923f80=_0x923f80||_0xdb8b('0x44');_0x4794c3=_0x4794c3||'';_0x507609=_0x507609===undefined?-0x1:_0x507609==='-1'?-0x1:_0x507609*0x3e8;_0x1cb3d9=_0x1cb3d9===undefined?'':'s='+_0x1cb3d9;_0x211820=_0x211820?'BEEP':'';return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x45'),_0x2512d7,_0x923f80,_0x4794c3,_0x507609,_0x211820,_0x1cb3d9));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x46')]=function(_0x4c8a8f,_0x1d1106){_0x1d1106=_0x1d1106||'';return this[_0xdb8b('0x25')](util[_0xdb8b('0x29')](_0xdb8b('0x47'),_0x4c8a8f,_0x1d1106));};AGIChannel[_0xdb8b('0x24')][_0xdb8b('0x48')]=function(_0x5a5c24){return this[_0xdb8b('0x2d')](_0xdb8b('0x49'),_0x5a5c24);};AGIChannel['prototype']['wait']=function(_0x58254d){return this[_0xdb8b('0x2d')](_0xdb8b('0x4a'),_0x58254d);};AGIChannel['prototype']['error']=function(_0x1a6038,_0x3864f4){this[_0xdb8b('0x2b')](util[_0xdb8b('0x29')](_0xdb8b('0x4b'),_0x1a6038['id'],_0x1a6038[_0xdb8b('0x4c')],_0x3864f4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xdb8b('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 26e702e..e53d450 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 _0x7946=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x1c3a5d,_0x512567){var _0x66113d=function(_0x9e20a8){while(--_0x9e20a8){_0x1c3a5d['push'](_0x1c3a5d['shift']());}};_0x66113d(++_0x512567);}(_0x7946,0x11b));var _0x6794=function(_0x583e2c,_0x5cff8c){_0x583e2c=_0x583e2c-0x0;var _0x29a313=_0x7946[_0x583e2c];return _0x29a313;};'use strict';var util=require(_0x6794('0x0'));var error={'E_AGI_UNDEFINED':_0x6794('0x1'),'E_AGI_ARGUMENT_PORT':_0x6794('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x6794('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x6794('0x4'),'E_AGI_SOCKET_ERROR':_0x6794('0x5'),'E_AGI_SOCKET_CLOSE':_0x6794('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x6794('0x7'),'E_AGI_COMMAND_EMPTY':_0x6794('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6794('0x9'),'E_AGI_IVR_ENTRY':_0x6794('0xa')};function AGIError(_0x52b1f8){var _0x52b1f8=_0x52b1f8||null,_0x3dc501=_0x3dc501||[],_0x25e8b1=0x1,_0x2f464d='';if(!error[_0x52b1f8]){_0x52b1f8=_0x6794('0xb');}_0x3dc501[_0x6794('0xc')](error[_0x52b1f8]);while(arguments[_0x25e8b1]){_0x3dc501[_0x6794('0xc')](arguments[_0x25e8b1]);_0x25e8b1++;}_0x2f464d=util[_0x6794('0xd')]['apply'](util,_0x3dc501);this[_0x6794('0xe')]=_0x2f464d;this[_0x6794('0xf')]=_0x52b1f8;}module[_0x6794('0x10')]=AGIError; \ No newline at end of file +var _0xf39e=['E_AGI_UNDEFINED','push','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x18cc54,_0x41be23){var _0x99075=function(_0x4f370b){while(--_0x4f370b){_0x18cc54['push'](_0x18cc54['shift']());}};_0x99075(++_0x41be23);}(_0xf39e,0xa5));var _0xef39=function(_0xb6fd98,_0x1e3992){_0xb6fd98=_0xb6fd98-0x0;var _0x5d613d=_0xf39e[_0xb6fd98];return _0x5d613d;};'use strict';var util=require(_0xef39('0x0'));var error={'E_AGI_UNDEFINED':_0xef39('0x1'),'E_AGI_ARGUMENT_PORT':_0xef39('0x2'),'E_AGI_SERVER_ERROR':_0xef39('0x3'),'E_AGI_SERVER_CLOSE':_0xef39('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xef39('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xef39('0x6'),'E_AGI_SOCKET_CLOSE':_0xef39('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xef39('0x8'),'E_AGI_COMMAND_EMPTY':_0xef39('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xef39('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x38f9a7){var _0x38f9a7=_0x38f9a7||null,_0x34f5ab=_0x34f5ab||[],_0x4f0f80=0x1,_0x3ba2b3='';if(!error[_0x38f9a7]){_0x38f9a7=_0xef39('0xb');}_0x34f5ab[_0xef39('0xc')](error[_0x38f9a7]);while(arguments[_0x4f0f80]){_0x34f5ab[_0xef39('0xc')](arguments[_0x4f0f80]);_0x4f0f80++;}_0x3ba2b3=util['format'][_0xef39('0xd')](util,_0x34f5ab);this['message']=_0x3ba2b3;this[_0xef39('0xe')]=_0x38f9a7;}module[_0xef39('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 22f8278..ce74fc4 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 _0xa1fb=['exports','lodash','events','EventEmitter','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate'];(function(_0x5ce54a,_0x4100ef){var _0x3635ae=function(_0x2c0b83){while(--_0x2c0b83){_0x5ce54a['push'](_0x5ce54a['shift']());}};_0x3635ae(++_0x4100ef);}(_0xa1fb,0xb1));var _0xba1f=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xa1fb[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xba1f('0x0'));var EventEmitter=require(_0xba1f('0x1'))[_0xba1f('0x2')];var Redis=require('ioredis');var AGIError=require(_0xba1f('0x3'));var config=require(_0xba1f('0x4'));config[_0xba1f('0x5')]=_[_0xba1f('0x6')](config['redis'],{'host':_0xba1f('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xba1f('0x5')]);sub[_0xba1f('0x8')](_0xba1f('0x9'),function(_0x598e46){if(_0x598e46)return eventEmitter[_0xba1f('0xa')]('error',new AGIError(_0xba1f('0xb'),_0x598e46));});sub['on'](_0xba1f('0xc'),function(_0x111ae5,_0x4f5b02){if(_0x111ae5!=='agi')return;try{var _0x56a361=JSON[_0xba1f('0xd')](_0x4f5b02);eventEmitter[_0xba1f('0xa')](_0xba1f('0xe'),_0x56a361);}catch(_0x57ee3a){eventEmitter['emit']('error',new AGIError(_0xba1f('0xb'),_0x57ee3a));}});module[_0xba1f('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x38eb=['E_AGI_SERVER_ERROR','agi','parse','exports','events','EventEmitter','ioredis','./error','../../config/environment','redis','subscribe','emit','error'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x38eb,0x6c));var _0xb38e=function(_0x287dc3,_0x1fcd7a){_0x287dc3=_0x287dc3-0x0;var _0x46f3e5=_0x38eb[_0x287dc3];return _0x46f3e5;};'use strict';var _=require('lodash');var EventEmitter=require(_0xb38e('0x0'))[_0xb38e('0x1')];var Redis=require(_0xb38e('0x2'));var AGIError=require(_0xb38e('0x3'));var config=require(_0xb38e('0x4'));config[_0xb38e('0x5')]=_['defaults'](config[_0xb38e('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb38e('0x5')]);sub[_0xb38e('0x6')]('agi',function(_0x49827b){if(_0x49827b)return eventEmitter[_0xb38e('0x7')](_0xb38e('0x8'),new AGIError(_0xb38e('0x9'),_0x49827b));});sub['on']('message',function(_0x10cddd,_0x3ec3b4){if(_0x10cddd!==_0xb38e('0xa'))return;try{var _0xc48417=JSON[_0xb38e('0xb')](_0x3ec3b4);eventEmitter[_0xb38e('0x7')]('projectUpdate',_0xc48417);}catch(_0x5e8296){eventEmitter[_0xb38e('0x7')](_0xb38e('0x8'),new AGIError(_0xb38e('0x9'),_0x5e8296));}});module[_0xb38e('0xc')]={'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 0913576..d3eb009 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 _0x86d0=['default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','getsecretdigits','vertices','edges','prototype','addVertex','addEdge','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','agicommand','menu','invalid'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x86d0,0x10a));var _0x086d=function(_0x3f1076,_0x23b6c1){_0x3f1076=_0x3f1076-0x0;var _0x21d34f=_0x86d0[_0x3f1076];return _0x21d34f;};'use strict';var _=require('lodash');var logger=require(_0x086d('0x0'))(_0x086d('0x1'));var verticesWithRetry=['menu','getdigits',_0x086d('0x2')];var Graph=function(){this[_0x086d('0x3')]={};this[_0x086d('0x4')]={};this['numberOfEdges']=0x0;};Graph[_0x086d('0x5')][_0x086d('0x6')]=function(_0x352d46){this[_0x086d('0x3')][_0x352d46['id']]=_0x352d46;this[_0x086d('0x4')][_0x352d46['id']]=[];};Graph['prototype'][_0x086d('0x7')]=function(_0x34a458,_0x344f20,_0x3915c7){this[_0x086d('0x4')][_0x34a458]['push']({'target':_0x344f20,'condition':_0x3915c7});this[_0x086d('0x8')]+=0x1;};Graph[_0x086d('0x5')][_0x086d('0x9')]=function(){return _[_0x086d('0x9')](this[_0x086d('0x3')]);};Graph[_0x086d('0x5')][_0x086d('0xa')]=function(){return this['numberOfEdges'];};Graph[_0x086d('0x5')][_0x086d('0xb')]=function(_0x2a908f){return this['vertices'][_0x2a908f];};Graph[_0x086d('0x5')][_0x086d('0xc')]=function(_0x5192e9,_0x211eec){if(!this['vertices'][_0x5192e9]){return logger[_0x086d('0xd')](_0x086d('0xe'));}var _0x126a0e=_0x211eec(this[_0x086d('0x3')][_0x5192e9]);if(!_0x126a0e){return logger[_0x086d('0xd')](_0x086d('0xf'));}if(this['edges'][_0x5192e9][_0x086d('0x10')]===0x0){return logger['info'](_0x086d('0x11'));}for(var _0x500e37=0x0,_0x5046bb=[],_0x3bab6d=![];_0x500e37\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','hangup','find','handleNotFound'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x747f,0x1a4));var _0xf747=function(_0x5832a2,_0x35ae7a){_0x5832a2=_0x5832a2-0x0;var _0x1e4c7f=_0x747f[_0x5832a2];return _0x1e4c7f;};'use strict';var _=require(_0xf747('0x0'));var syncho=require('syncho');var util=require(_0xf747('0x1'));var config=require(_0xf747('0x2'));var logger=require(_0xf747('0x3'))(_0xf747('0x4'));var utilLicense=require(_0xf747('0x5'));var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0xf747('0x4')]=_[_0xf747('0x6')](config[_0xf747('0x4')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0xf747('0x7'),projectUpdateHandler);function connectionHandler(_0x16dacd){process[_0xf747('0x8')](function(){syncho(function(){try{setChannelVariables(_0x16dacd);agiHandler(_0x16dacd);}catch(_0xd3bf15){logger['error'](_0xd3bf15[_0xf747('0x9')]);}});});}function projectUpdateHandler(_0x21aa78){try{var _0x5ab26e=_[_0xf747('0xa')](projects,['id',_0x21aa78['id']]);if(_0x5ab26e>-0x1){if(_0x21aa78[_0xf747('0xb')]===!![]){projects[_0xf747('0xc')](_0x5ab26e,0x1);}else{projects[_0x5ab26e]=_0x21aa78;}}else{projects[_0xf747('0xd')](_0x21aa78);}}catch(_0x377857){logger[_0xf747('0xe')](_0x377857[_0xf747('0x9')]);}}function listeningHandler(){console[_0xf747('0xf')](_0xf747('0x10'),config[_0xf747('0x4')]['port']);logger[_0xf747('0x11')](util[_0xf747('0x12')](_0xf747('0x13'),config['agi']['ip'],config[_0xf747('0x4')][_0xf747('0x14')]));}function errorHandler(_0xa63250){if(_0xa63250&&_0xa63250['name']&&_0xa63250[_0xf747('0x15')]){logger[_0xf747('0xe')](util[_0xf747('0x12')]('[%s]\x20%s',_0xa63250[_0xf747('0x16')],_0xa63250['message']));}else{logger[_0xf747('0xe')](util[_0xf747('0x12')](_0xf747('0x17'),_0xa63250[_0xf747('0x9')]));}}function closeHandler(){logger['info'](util[_0xf747('0x12')](_0xf747('0x18'),this[_0xf747('0x19')],this[_0xf747('0x1a')],this[_0xf747('0x1b')],this[_0xf747('0x1c')],this[_0xf747('0x1d')]));try{createSquareReport(this);}catch(_0x6ae87f){logger[_0xf747('0xe')](_0x6ae87f[_0xf747('0x9')]);}}function timeoutHandler(){logger[_0xf747('0x11')](util[_0xf747('0x12')](_0xf747('0x1e'),this[_0xf747('0x19')],this['calleridname'],this[_0xf747('0x1b')],this[_0xf747('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0xf747('0x11')](util['format'](_0xf747('0x1f'),this['arg_1'],this[_0xf747('0x1a')],this['callerid'],this[_0xf747('0x1c')],this[_0xf747('0x1d')]));this['evtHangup']=!![];}function createSquareReport(_0x19f3c2,_0x5d68c4){rpc[_0xf747('0x20')](_0x19f3c2)[_0xf747('0x21')](function(_0x5ef182){if(_0x5d68c4){_0x5d68c4(null,_0x5ef182);}})[_0xf747('0x22')](function(_0x4aaa11){if(_0x5d68c4){_0x5d68c4(null,_0x4aaa11);}});}function setChannelVariables(_0x3208b4){for(var _0x6c5027 in _0x3208b4){if(_0x3208b4[_0xf747('0x23')](_0x6c5027)){if(_0x6c5027[_0xf747('0x24')]('agi_')===0x0){_0x3208b4[_0x6c5027['substring'](0x4)]=_0x3208b4[_0x6c5027];delete _0x3208b4[_0x6c5027];}}}}function agiHandler(_0x520e1d){logger['debug'](_0xf747('0x25'),JSON[_0xf747('0x26')](_0x520e1d,null,0x2));logger[_0xf747('0x11')](util[_0xf747('0x12')](_0xf747('0x27'),_0x520e1d['arg_1'],_0x520e1d[_0xf747('0x1a')],_0x520e1d[_0xf747('0x1b')],_0x520e1d['dnid'],_0x520e1d[_0xf747('0x1d')]));_0x520e1d['on'](_0xf747('0xe'),errorHandler);_0x520e1d['on']('close',closeHandler);_0x520e1d['on']('timeout',timeoutHandler);_0x520e1d[_0xf747('0x28')]=![];_0x520e1d['on'](_0xf747('0x29'),hangupHandler);var _0x3d4043=_[_0xf747('0x2a')](projects,['name',_0x520e1d[_0xf747('0x19')]]);if(!_0x3d4043)return Project[_0xf747('0x2b')](_0x520e1d);if(!_0x3d4043['production'])return Project[_0xf747('0x2c')](_0x520e1d);return Project['initialize'](_0x3d4043,_0x520e1d);}function main(){var _0x15b901;return utilLicense[_0xf747('0x2d')]()[_0xf747('0x21')](function(_0x42c706){if(!_0x42c706)return;if(_0x42c706[_0xf747('0x2e')]){if(_0x42c706[_0xf747('0x2f')]&&_0x42c706[_0xf747('0x2f')]>0x0){logger[_0xf747('0x11')](util[_0xf747('0x12')](_0xf747('0x30'),_0x42c706['callysquare']));_0x15b901=_0x42c706[_0xf747('0x2f')];}else{logger[_0xf747('0x11')](_0xf747('0x31'));}}else{logger['info'](_0xf747('0x32'));_0x15b901=-0x1;}})[_0xf747('0x21')](function(){return Project[_0xf747('0x33')]();})[_0xf747('0x21')](function(_0x223938){projects=_0x223938;return;})[_0xf747('0x22')](function(_0x48c7ad){logger[_0xf747('0xe')](_0xf747('0x34'),_0x48c7ad[_0xf747('0x9')]);})[_0xf747('0x35')](function(){var _0x366715=require(_0xf747('0x36'))(config[_0xf747('0x4')]['port'],config[_0xf747('0x4')]['ip'],_0x15b901);_0x366715['on']('error',errorHandler);_0x366715['on'](_0xf747('0x37'),listeningHandler);_0x366715['on'](_0xf747('0x38'),connectionHandler);_0x366715['on'](_0xf747('0x39'),closeHandler);});}main(); \ No newline at end of file +var _0x1640=['uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','evtHangup','createSquareReport','catch','agi_','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','./server','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','log','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid'];(function(_0x31c496,_0x4549dc){var _0x34072f=function(_0x3497e9){while(--_0x3497e9){_0x31c496['push'](_0x31c496['shift']());}};_0x34072f(++_0x4549dc);}(_0x1640,0x88));var _0x0164=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x1640[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x0164('0x0'));var syncho=require(_0x0164('0x1'));var util=require(_0x0164('0x2'));var config=require(_0x0164('0x3'));var logger=require(_0x0164('0x4'))(_0x0164('0x5'));var utilLicense=require(_0x0164('0x6'));var rpc=require(_0x0164('0x7'));var Project=require('./project');var AGIEmitter=require(_0x0164('0x8'))[_0x0164('0x9')];var projects=[];config[_0x0164('0x5')]=_[_0x0164('0xa')](config[_0x0164('0x5')],{'ip':_0x0164('0xb'),'port':0x11dd});AGIEmitter['on'](_0x0164('0xc'),projectUpdateHandler);function connectionHandler(_0x51dbe0){process[_0x0164('0xd')](function(){syncho(function(){try{setChannelVariables(_0x51dbe0);agiHandler(_0x51dbe0);}catch(_0x239205){logger[_0x0164('0xe')](_0x239205[_0x0164('0xf')]);}});});}function projectUpdateHandler(_0x26ff8c){try{var _0x5bf2c5=_[_0x0164('0x10')](projects,['id',_0x26ff8c['id']]);if(_0x5bf2c5>-0x1){if(_0x26ff8c[_0x0164('0x11')]===!![]){projects['splice'](_0x5bf2c5,0x1);}else{projects[_0x5bf2c5]=_0x26ff8c;}}else{projects['push'](_0x26ff8c);}}catch(_0x26de83){logger[_0x0164('0xe')](_0x26de83['stack']);}}function listeningHandler(){console[_0x0164('0x12')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x0164('0x5')][_0x0164('0x13')]);logger['info'](util[_0x0164('0x14')](_0x0164('0x15'),config[_0x0164('0x5')]['ip'],config[_0x0164('0x5')]['port']));}function errorHandler(_0x3c2f0a){if(_0x3c2f0a&&_0x3c2f0a[_0x0164('0x16')]&&_0x3c2f0a[_0x0164('0x17')]){logger[_0x0164('0xe')](util['format']('[%s]\x20%s',_0x3c2f0a[_0x0164('0x16')],_0x3c2f0a[_0x0164('0x17')]));}else{logger['error'](util[_0x0164('0x14')](_0x0164('0x18'),_0x3c2f0a['stack']));}}function closeHandler(){logger[_0x0164('0x19')](util[_0x0164('0x14')](_0x0164('0x1a'),this[_0x0164('0x1b')],this['calleridname'],this['callerid'],this[_0x0164('0x1c')],this[_0x0164('0x1d')]));try{createSquareReport(this);}catch(_0x5cc9f1){logger['error'](_0x5cc9f1[_0x0164('0xf')]);}}function timeoutHandler(){logger[_0x0164('0x19')](util[_0x0164('0x14')](_0x0164('0x1e'),this['arg_1'],this[_0x0164('0x1f')],this[_0x0164('0x20')],this['dnid'],this[_0x0164('0x1d')]));}function hangupHandler(){logger[_0x0164('0x19')](util[_0x0164('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0164('0x1b')],this[_0x0164('0x1f')],this['callerid'],this[_0x0164('0x1c')],this['uniqueid']));this[_0x0164('0x21')]=!![];}function createSquareReport(_0x2510f4,_0x7def6a){rpc[_0x0164('0x22')](_0x2510f4)['then'](function(_0x3d8243){if(_0x7def6a){_0x7def6a(null,_0x3d8243);}})[_0x0164('0x23')](function(_0x263ef4){if(_0x7def6a){_0x7def6a(null,_0x263ef4);}});}function setChannelVariables(_0x1e51ee){for(var _0x3f0aeb in _0x1e51ee){if(_0x1e51ee['hasOwnProperty'](_0x3f0aeb)){if(_0x3f0aeb['indexOf'](_0x0164('0x24'))===0x0){_0x1e51ee[_0x3f0aeb['substring'](0x4)]=_0x1e51ee[_0x3f0aeb];delete _0x1e51ee[_0x3f0aeb];}}}}function agiHandler(_0x7adc9d){logger[_0x0164('0x25')](_0x0164('0x26'),JSON['stringify'](_0x7adc9d,null,0x2));logger[_0x0164('0x19')](util[_0x0164('0x14')](_0x0164('0x27'),_0x7adc9d[_0x0164('0x1b')],_0x7adc9d['calleridname'],_0x7adc9d['callerid'],_0x7adc9d['dnid'],_0x7adc9d['uniqueid']));_0x7adc9d['on'](_0x0164('0xe'),errorHandler);_0x7adc9d['on']('close',closeHandler);_0x7adc9d['on'](_0x0164('0x28'),timeoutHandler);_0x7adc9d[_0x0164('0x21')]=![];_0x7adc9d['on'](_0x0164('0x29'),hangupHandler);var _0x1eca8b=_[_0x0164('0x2a')](projects,[_0x0164('0x16'),_0x7adc9d[_0x0164('0x1b')]]);if(!_0x1eca8b)return Project[_0x0164('0x2b')](_0x7adc9d);if(!_0x1eca8b['production'])return Project[_0x0164('0x2c')](_0x7adc9d);return Project[_0x0164('0x2d')](_0x1eca8b,_0x7adc9d);}function main(){var _0x4adacf;return utilLicense[_0x0164('0x2e')]()[_0x0164('0x2f')](function(_0x155011){if(!_0x155011)return;if(_0x155011[_0x0164('0x30')]){if(_0x155011[_0x0164('0x31')]&&_0x155011['callysquare']>0x0){logger[_0x0164('0x19')](util['format'](_0x0164('0x32'),_0x155011[_0x0164('0x31')]));_0x4adacf=_0x155011[_0x0164('0x31')];}else{logger[_0x0164('0x19')](_0x0164('0x33'));}}else{logger[_0x0164('0x19')](_0x0164('0x34'));_0x4adacf=-0x1;}})[_0x0164('0x2f')](function(){return Project[_0x0164('0x35')]();})[_0x0164('0x2f')](function(_0x1997e0){projects=_0x1997e0;return;})['catch'](function(_0x46ede8){logger['error']('[LICENSE]',_0x46ede8[_0x0164('0xf')]);})['finally'](function(){var _0x3bc183=require(_0x0164('0x36'))(config[_0x0164('0x5')][_0x0164('0x13')],config[_0x0164('0x5')]['ip'],_0x4adacf);_0x3bc183['on'](_0x0164('0xe'),errorHandler);_0x3bc183['on']('listening',listeningHandler);_0x3bc183['on']('connection',connectionHandler);_0x3bc183['on']('close',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 d991fd3..9b0bd35 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 _0xa102=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','result'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xa102,0xa4));var _0x2a10=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xa102[_0x386c3e];return _0x4b8e13;};'use strict';var BPromise=require(_0x2a10('0x0'));var jayson=require(_0x2a10('0x1'));var client=jayson[_0x2a10('0x2')][_0x2a10('0x3')]({'port':0x232b});function request(_0x35e8c1,_0x5aa08d){return new BPromise(function(_0x56cbae,_0x24a359){return client[_0x2a10('0x4')](_0x35e8c1,_0x5aa08d)['then'](function(_0x3b9ce0){if(_0x3b9ce0['error']){return _0x24a359(_0x3b9ce0[_0x2a10('0x5')]['message']);}else{return _0x56cbae(_0x3b9ce0[_0x2a10('0x6')]);}})['catch'](function(_0x2afda1){return _0x24a359(_0x2afda1);});});}exports[_0x2a10('0x7')]=function(_0x57fe0f,_0xded96){return request(_0x2a10('0x8'),{'account':_0x57fe0f,'message':_0xded96});}; \ No newline at end of file +var _0xec77=['SendMail','bluebird','jayson/promise','client','http','request','error','result','catch','sendMailMessage'];(function(_0x4b1c96,_0x271d77){var _0x5cca89=function(_0x5e3c28){while(--_0x5e3c28){_0x4b1c96['push'](_0x4b1c96['shift']());}};_0x5cca89(++_0x271d77);}(_0xec77,0xf1));var _0x7ec7=function(_0x557ff2,_0x5d76c7){_0x557ff2=_0x557ff2-0x0;var _0x578d53=_0xec77[_0x557ff2];return _0x578d53;};'use strict';var BPromise=require(_0x7ec7('0x0'));var jayson=require(_0x7ec7('0x1'));var client=jayson[_0x7ec7('0x2')][_0x7ec7('0x3')]({'port':0x232b});function request(_0x77f7da,_0x147578){return new BPromise(function(_0x16b9ce,_0x501c45){return client[_0x7ec7('0x4')](_0x77f7da,_0x147578)['then'](function(_0x3aaee6){if(_0x3aaee6['error']){return _0x501c45(_0x3aaee6[_0x7ec7('0x5')]['message']);}else{return _0x16b9ce(_0x3aaee6[_0x7ec7('0x6')]);}})[_0x7ec7('0x7')](function(_0x5da11e){return _0x501c45(_0x5da11e);});});}exports[_0x7ec7('0x8')]=function(_0x32830f,_0x233a72){return request(_0x7ec7('0x9'),{'account':_0x32830f,'message':_0x233a72});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index e8557ff..e8bcf31 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 _0xc4a2=['error','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','response','stack','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','close','Project\x20%s\x20not\x20published','lodash','moment','xml2json','../../config/logger','agi','./mailRpc','./vertices','getSquareProjects','catch','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','arg_1','calleridname','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','context','priority','agicommand','code','result','evtHangup','isUndefined','toString'];(function(_0x31abda,_0x130f31){var _0x257bda=function(_0x164904){while(--_0x164904){_0x31abda['push'](_0x31abda['shift']());}};_0x257bda(++_0x130f31);}(_0xc4a2,0xfc));var _0x2c4a=function(_0x4c58d6,_0x1b2145){_0x4c58d6=_0x4c58d6-0x0;var _0x5e933a=_0xc4a2[_0x4c58d6];return _0x5e933a;};'use strict';var _=require(_0x2c4a('0x0'));var moment=require(_0x2c4a('0x1'));var parser=require(_0x2c4a('0x2'));var util=require('util');var logger=require(_0x2c4a('0x3'))(_0x2c4a('0x4'));var rpc=require('./rpc');var mailRpc=require(_0x2c4a('0x5'));var Graph=require('./graph');var Vertices=require(_0x2c4a('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x2c4a('0x7')]()[_0x2c4a('0x8')](function(_0x11d687){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x11d687['stack']);return[];});}function addVertex(_0x2ddc2d,_0x2d6486,_0x3e4ae4){_0x2d6486['agicommand']=_0x3e4ae4;if(_0x2d6486[_0x2c4a('0x9')](_0x2c4a('0xa'))){_0x2d6486[_0x2c4a('0xb')]=parseInt(_0x2d6486[_0x2c4a('0xa')],0xa);}_0x2ddc2d[_0x2c4a('0xc')](_[_0x2c4a('0xd')](_0x2d6486,'mxCell'));}function initGraph(_0x1838d1,_0x4acfbc){var _0x2631b4=new Graph();for(var _0x32bebd in _0x1838d1){if(_0x1838d1[_0x2c4a('0x9')](_0x32bebd)){if(_[_0x2c4a('0xe')](_0x1838d1[_0x32bebd])){for(var _0x2c8b67=0x0;_0x2c8b67<_0x1838d1[_0x32bebd][_0x2c4a('0xf')];_0x2c8b67+=0x1){addVertex(_0x2631b4,_0x1838d1[_0x32bebd][_0x2c8b67],_0x32bebd);}}else{addVertex(_0x2631b4,_0x1838d1[_0x32bebd],_0x32bebd);}}}for(var _0x5ae92f=0x0;_0x5ae92f<_0x4acfbc[_0x2c4a('0xf')];_0x5ae92f+=0x1){if(_0x4acfbc[_0x5ae92f]['source']&&_0x4acfbc[_0x5ae92f][_0x2c4a('0x10')]){_0x2631b4[_0x2c4a('0x11')](_0x4acfbc[_0x5ae92f][_0x2c4a('0x12')],_0x4acfbc[_0x5ae92f][_0x2c4a('0x10')],_0x4acfbc[_0x5ae92f][_0x2c4a('0x13')]);}}return _0x2631b4;}function getRoot(_0x12b107){return parser[_0x2c4a('0x14')](_0x12b107,{'object':!![]})[_0x2c4a('0x15')][_0x2c4a('0x16')];}function inspect(_0x55059a){return util['inspect'](_0x55059a,{'showHidden':![],'depth':null});}function initialize(_0x3ed99d,_0x33e5c7){var _0x2414da=getRoot(_0x3ed99d[_0x2c4a('0x17')]);if(!_0x2414da||!_0x2414da[_0x2c4a('0x18')])return;var _0x32b284,_0x249205,_0x2f87bc;logger[_0x2c4a('0x19')](_0x2c4a('0x16'),JSON[_0x2c4a('0x1a')](_0x2414da,null,0x2));_0x33e5c7[_0x2c4a('0x1b')]=moment()[_0x2c4a('0x1c')](_0x2c4a('0x1d'));_0x32b284=initGraph(_[_0x2c4a('0xd')](_0x2414da,_0x2c4a('0x1e')),_0x2414da[_0x2c4a('0x1e')]);_0x249205=new Vertices(_0x33e5c7,rpc,mailRpc);logger[_0x2c4a('0x1f')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x33e5c7[_0x2c4a('0x20')],_0x33e5c7[_0x2c4a('0x21')],_0x33e5c7['callerid'],_0x33e5c7[_0x2c4a('0x22')],_0x33e5c7[_0x2c4a('0x23')]));_0x32b284[_0x2c4a('0x24')](_0x2414da[_0x2c4a('0x18')]['id'],function(_0x4b0b69){try{_0x4b0b69=_0x249205[_0x2c4a('0x25')](_0x4b0b69);logger[_0x2c4a('0x19')](_0x2c4a('0x26'),JSON[_0x2c4a('0x1a')](_0x4b0b69,null,0x2));if(_0x4b0b69['agicommand']===_0x2c4a('0x27')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x33e5c7[_0x2c4a('0x28')]=_0x4b0b69[_0x2c4a('0x28')]||_0x33e5c7[_0x2c4a('0x28')];_0x33e5c7['extension']=_0x4b0b69['extension'];_0x33e5c7[_0x2c4a('0x29')]=_0x4b0b69['priority']?_0x4b0b69['priority']-0x1:0x1;return null;}else if(_0x4b0b69&&_0x249205[_0x4b0b69['agicommand']]){_0x2f87bc=_0x249205[_0x4b0b69[_0x2c4a('0x2a')]](_0x4b0b69);logger[_0x2c4a('0x1f')]('response',JSON[_0x2c4a('0x1a')](_0x2f87bc,null,0x2));if(_0x2f87bc&&_0x2f87bc[_0x2c4a('0x2b')]===AGI_CODE_SUCCESS&&_0x2f87bc[_0x2c4a('0x2c')]!==AGI_RESULT_ERROR&&!_0x33e5c7[_0x2c4a('0x2d')]){logger[_0x2c4a('0x19')]('response',inspect(_0x2f87bc));return _[_0x2c4a('0x2e')](_0x2f87bc[_0x2c4a('0x2c')])?null:_0x2f87bc['result'][_0x2c4a('0x2f')]();}else{logger[_0x2c4a('0x30')]('response',inspect(_0x2f87bc));return null;}}else{logger[_0x2c4a('0x30')](_0x2c4a('0x31'));return null;}}catch(_0x1d91f1){logger[_0x2c4a('0x30')](_0x1d91f1['stack']);return null;}});if(_0x2414da[_0x2c4a('0x32')]){logger[_0x2c4a('0x1f')](util[_0x2c4a('0x1c')](_0x2c4a('0x33'),_0x33e5c7[_0x2c4a('0x20')],_0x33e5c7[_0x2c4a('0x21')],_0x33e5c7[_0x2c4a('0x34')],_0x33e5c7['dnid'],_0x33e5c7[_0x2c4a('0x23')]));_0x32b284[_0x2c4a('0x24')](_0x2414da[_0x2c4a('0x32')]['id'],function(_0xc87af2){try{_0xc87af2=_0x249205[_0x2c4a('0x25')](_0xc87af2);logger[_0x2c4a('0x19')]('vertex',JSON[_0x2c4a('0x1a')](_0xc87af2,null,0x2));if(_0xc87af2&&_0x249205[_0xc87af2[_0x2c4a('0x2a')]]){_0x2f87bc=_0x249205[_0xc87af2[_0x2c4a('0x2a')]](_0xc87af2);if(_0x2f87bc){logger['debug'](_0x2c4a('0x35'),inspect(_0x2f87bc));return _['isUndefined'](_0x2f87bc[_0x2c4a('0x2c')])?null:_0x2f87bc[_0x2c4a('0x2c')]['toString']();}else{logger['error'](_0x2c4a('0x35'),inspect(_0x2f87bc));return null;}}else{logger[_0x2c4a('0x30')](_0x2c4a('0x31'));return null;}}catch(_0x33143a){logger[_0x2c4a('0x30')](_0x33143a[_0x2c4a('0x36')]);return null;}});}logger[_0x2c4a('0x1f')](util[_0x2c4a('0x1c')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x33e5c7['arg_1'],_0x33e5c7[_0x2c4a('0x21')],_0x33e5c7['callerid'],_0x33e5c7['dnid'],_0x33e5c7[_0x2c4a('0x23')]));logger[_0x2c4a('0x1f')](util[_0x2c4a('0x1c')](_0x2c4a('0x37'),_0x33e5c7[_0x2c4a('0x28')],_0x33e5c7[_0x2c4a('0x38')],parseInt(_0x33e5c7[_0x2c4a('0x29')],0xa)+0x1));_0x33e5c7[_0x2c4a('0x39')](_0x33e5c7[_0x2c4a('0x28')],_0x33e5c7['extension'],parseInt(_0x33e5c7[_0x2c4a('0x29')],0xa)+0x1);_0x33e5c7[_0x2c4a('0x3a')]();}function handleNotFound(_0x347437){logger[_0x2c4a('0x30')](util[_0x2c4a('0x1c')]('Project\x20%s\x20not\x20found',_0x347437['arg_1']));_0x347437[_0x2c4a('0x39')](_0x347437[_0x2c4a('0x28')],_0x347437[_0x2c4a('0x38')],parseInt(_0x347437[_0x2c4a('0x29')],0xa)+0x1);_0x347437[_0x2c4a('0x3a')]();}function handleUnpublished(_0x258167){logger[_0x2c4a('0x30')](util[_0x2c4a('0x1c')](_0x2c4a('0x3b'),_0x258167[_0x2c4a('0x20')]));_0x258167[_0x2c4a('0x39')](_0x258167[_0x2c4a('0x28')],_0x258167[_0x2c4a('0x38')],parseInt(_0x258167[_0x2c4a('0x29')],0xa)+0x1);_0x258167['close']();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xc61c=['finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','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','continueAt','close','Project\x20%s\x20not\x20published','exports','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','value','inspect','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','start','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','result','toString'];(function(_0x1c7a40,_0x5b0b1b){var _0x53b785=function(_0x1c9eb4){while(--_0x1c9eb4){_0x1c7a40['push'](_0x1c7a40['shift']());}};_0x53b785(++_0x5b0b1b);}(_0xc61c,0x1ea));var _0xcc61=function(_0xad921d,_0x4e852b){_0xad921d=_0xad921d-0x0;var _0x50a737=_0xc61c[_0xad921d];return _0x50a737;};'use strict';var _=require('lodash');var moment=require(_0xcc61('0x0'));var parser=require('xml2json');var util=require(_0xcc61('0x1'));var logger=require(_0xcc61('0x2'))(_0xcc61('0x3'));var rpc=require(_0xcc61('0x4'));var mailRpc=require(_0xcc61('0x5'));var Graph=require(_0xcc61('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xcc61('0x7')]()[_0xcc61('0x8')](function(_0x4caa76){logger[_0xcc61('0x9')](_0xcc61('0xa'),_0x4caa76[_0xcc61('0xb')]);return[];});}function addVertex(_0x3624f4,_0x3d5920,_0x2cd3b8){_0x3d5920[_0xcc61('0xc')]=_0x2cd3b8;if(_0x3d5920[_0xcc61('0xd')](_0xcc61('0xe'))){_0x3d5920[_0xcc61('0xf')]=parseInt(_0x3d5920[_0xcc61('0xe')],0xa);}_0x3624f4[_0xcc61('0x10')](_[_0xcc61('0x11')](_0x3d5920,_0xcc61('0x12')));}function initGraph(_0x4ba621,_0x4d6426){var _0x5c32bb=new Graph();for(var _0x438025 in _0x4ba621){if(_0x4ba621['hasOwnProperty'](_0x438025)){if(_['isArray'](_0x4ba621[_0x438025])){for(var _0x580a8b=0x0;_0x580a8b<_0x4ba621[_0x438025][_0xcc61('0x13')];_0x580a8b+=0x1){addVertex(_0x5c32bb,_0x4ba621[_0x438025][_0x580a8b],_0x438025);}}else{addVertex(_0x5c32bb,_0x4ba621[_0x438025],_0x438025);}}}for(var _0x105ae3=0x0;_0x105ae3<_0x4d6426[_0xcc61('0x13')];_0x105ae3+=0x1){if(_0x4d6426[_0x105ae3][_0xcc61('0x14')]&&_0x4d6426[_0x105ae3][_0xcc61('0x15')]){_0x5c32bb[_0xcc61('0x16')](_0x4d6426[_0x105ae3][_0xcc61('0x14')],_0x4d6426[_0x105ae3][_0xcc61('0x15')],_0x4d6426[_0x105ae3][_0xcc61('0x17')]);}}return _0x5c32bb;}function getRoot(_0x18cdb3){return parser['toJson'](_0x18cdb3,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x2fd706){return util[_0xcc61('0x18')](_0x2fd706,{'showHidden':![],'depth':null});}function initialize(_0x3c7e64,_0x5f3a34){var _0x16e3f1=getRoot(_0x3c7e64['production']);if(!_0x16e3f1||!_0x16e3f1['start'])return;var _0x4d5431,_0x4137ea,_0x4829ef;logger[_0xcc61('0x19')](_0xcc61('0x1a'),JSON[_0xcc61('0x1b')](_0x16e3f1,null,0x2));_0x5f3a34[_0xcc61('0x1c')]=moment()[_0xcc61('0x1d')](_0xcc61('0x1e'));_0x4d5431=initGraph(_['omit'](_0x16e3f1,_0xcc61('0x12')),_0x16e3f1[_0xcc61('0x12')]);_0x4137ea=new Vertices(_0x5f3a34,rpc,mailRpc);logger[_0xcc61('0x1f')](util['format'](_0xcc61('0x20'),_0x5f3a34[_0xcc61('0x21')],_0x5f3a34[_0xcc61('0x22')],_0x5f3a34[_0xcc61('0x23')],_0x5f3a34['dnid'],_0x5f3a34[_0xcc61('0x24')]));_0x4d5431[_0xcc61('0x25')](_0x16e3f1[_0xcc61('0x26')]['id'],function(_0x3f90fa){try{_0x3f90fa=_0x4137ea[_0xcc61('0x27')](_0x3f90fa);logger[_0xcc61('0x19')]('vertex',JSON[_0xcc61('0x1b')](_0x3f90fa,null,0x2));if(_0x3f90fa[_0xcc61('0xc')]===_0xcc61('0x28')){logger[_0xcc61('0x1f')](_0xcc61('0x29'));_0x5f3a34[_0xcc61('0x2a')]=_0x3f90fa['context']||_0x5f3a34[_0xcc61('0x2a')];_0x5f3a34[_0xcc61('0x2b')]=_0x3f90fa[_0xcc61('0x2b')];_0x5f3a34['priority']=_0x3f90fa[_0xcc61('0x2c')]?_0x3f90fa[_0xcc61('0x2c')]-0x1:0x1;return null;}else if(_0x3f90fa&&_0x4137ea[_0x3f90fa[_0xcc61('0xc')]]){_0x4829ef=_0x4137ea[_0x3f90fa['agicommand']](_0x3f90fa);logger[_0xcc61('0x1f')](_0xcc61('0x2d'),JSON[_0xcc61('0x1b')](_0x4829ef,null,0x2));if(_0x4829ef&&_0x4829ef[_0xcc61('0x2e')]===AGI_CODE_SUCCESS&&_0x4829ef['result']!==AGI_RESULT_ERROR&&!_0x5f3a34[_0xcc61('0x2f')]){logger[_0xcc61('0x19')](_0xcc61('0x2d'),inspect(_0x4829ef));return _['isUndefined'](_0x4829ef[_0xcc61('0x30')])?null:_0x4829ef[_0xcc61('0x30')][_0xcc61('0x31')]();}else{logger[_0xcc61('0x9')](_0xcc61('0x2d'),inspect(_0x4829ef));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3cb20b){logger['error'](_0x3cb20b[_0xcc61('0xb')]);return null;}});if(_0x16e3f1[_0xcc61('0x32')]){logger[_0xcc61('0x1f')](util[_0xcc61('0x1d')](_0xcc61('0x33'),_0x5f3a34[_0xcc61('0x21')],_0x5f3a34[_0xcc61('0x22')],_0x5f3a34[_0xcc61('0x23')],_0x5f3a34['dnid'],_0x5f3a34[_0xcc61('0x24')]));_0x4d5431[_0xcc61('0x25')](_0x16e3f1['finally']['id'],function(_0x1953d4){try{_0x1953d4=_0x4137ea[_0xcc61('0x27')](_0x1953d4);logger[_0xcc61('0x19')](_0xcc61('0x34'),JSON[_0xcc61('0x1b')](_0x1953d4,null,0x2));if(_0x1953d4&&_0x4137ea[_0x1953d4['agicommand']]){_0x4829ef=_0x4137ea[_0x1953d4[_0xcc61('0xc')]](_0x1953d4);if(_0x4829ef){logger[_0xcc61('0x19')]('response',inspect(_0x4829ef));return _[_0xcc61('0x35')](_0x4829ef['result'])?null:_0x4829ef[_0xcc61('0x30')][_0xcc61('0x31')]();}else{logger['error'](_0xcc61('0x2d'),inspect(_0x4829ef));return null;}}else{logger[_0xcc61('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x4a2714){logger[_0xcc61('0x9')](_0x4a2714[_0xcc61('0xb')]);return null;}});}logger[_0xcc61('0x1f')](util[_0xcc61('0x1d')](_0xcc61('0x36'),_0x5f3a34[_0xcc61('0x21')],_0x5f3a34[_0xcc61('0x22')],_0x5f3a34[_0xcc61('0x23')],_0x5f3a34['dnid'],_0x5f3a34['uniqueid']));logger[_0xcc61('0x1f')](util[_0xcc61('0x1d')](_0xcc61('0x37'),_0x5f3a34[_0xcc61('0x2a')],_0x5f3a34[_0xcc61('0x2b')],parseInt(_0x5f3a34['priority'],0xa)+0x1));_0x5f3a34[_0xcc61('0x38')](_0x5f3a34[_0xcc61('0x2a')],_0x5f3a34[_0xcc61('0x2b')],parseInt(_0x5f3a34[_0xcc61('0x2c')],0xa)+0x1);_0x5f3a34[_0xcc61('0x39')]();}function handleNotFound(_0x16e829){logger[_0xcc61('0x9')](util[_0xcc61('0x1d')]('Project\x20%s\x20not\x20found',_0x16e829[_0xcc61('0x21')]));_0x16e829['continueAt'](_0x16e829[_0xcc61('0x2a')],_0x16e829['extension'],parseInt(_0x16e829[_0xcc61('0x2c')],0xa)+0x1);_0x16e829['close']();}function handleUnpublished(_0x43852c){logger[_0xcc61('0x9')](util['format'](_0xcc61('0x3a'),_0x43852c[_0xcc61('0x21')]));_0x43852c[_0xcc61('0x38')](_0x43852c[_0xcc61('0x2a')],_0x43852c[_0xcc61('0x2b')],parseInt(_0x43852c[_0xcc61('0x2c')],0xa)+0x1);_0x43852c[_0xcc61('0x39')]();}module[_0xcc61('0x3b')]={'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 d6a54c2..cfb0cc9 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 _0x6691=['line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','_transform','indexOf','substring','length','split','slice','trim','emit'];(function(_0x23fed8,_0x52d046){var _0x201ead=function(_0xf72fe6){while(--_0xf72fe6){_0x23fed8['push'](_0x23fed8['shift']());}};_0x201ead(++_0x52d046);}(_0x6691,0x134));var _0x1669=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6691[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x1669('0x0'));var Transform=require(_0x1669('0x1'))[_0x1669('0x2')];function AGIReply(_0x287a8a){Transform[_0x1669('0x3')](this,_0x287a8a);this[_0x1669('0x4')]='';this[_0x1669('0x5')]=![];}util[_0x1669('0x6')](AGIReply,Transform);AGIReply['prototype'][_0x1669('0x7')]=function(_0x17d45d,_0x185d5f,_0x2e2764){var _0x467e24='\x0a',_0x1810e5=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x1e3038=-0x1,_0x40a41b=-0x1,_0x5c8145='',_0x28a69e=0x0,_0x3542f1='',_0x337377='';this[_0x1669('0x4')]+=_0x17d45d['toString']();_0x3542f1=this['_localBuffer'];if(!this['_inBody']){_0x28a69e=0x0;while(_0x1810e5[_0x28a69e]){while((_0x40a41b=_0x3542f1[_0x1669('0x8')](_0x1810e5[_0x28a69e]))!=-0x1){_0x5c8145=_0x1810e5[_0x28a69e];_0x337377=_0x3542f1[_0x1669('0x9')](0x0,_0x40a41b);_0x3542f1=_0x3542f1[_0x1669('0x9')](_0x40a41b+_0x5c8145[_0x1669('0xa')]);var _0x3bd44d=_0x337377[_0x1669('0xb')](_0x467e24),_0x3f8d45=0x0,_0x32e1e9={},_0x53e1a5='',_0x18f658='',_0x590d48=-0x1;while(_0x3bd44d[_0x3f8d45]){_0x590d48=_0x3bd44d[_0x3f8d45][_0x1669('0x8')](':');if(_0x590d48!=-0x1){_0x53e1a5=_0x3bd44d[_0x3f8d45][_0x1669('0xc')](0x0,_0x590d48)['trim']();_0x18f658=_0x3bd44d[_0x3f8d45]['slice'](_0x590d48+0x1)[_0x1669('0xd')]();if(_0x53e1a5[_0x1669('0xa')]>0x0){_0x32e1e9[_0x53e1a5]=_0x18f658;}}else{}_0x3f8d45++;}this[_0x1669('0xe')]('headers',_0x32e1e9);this['_inBody']=!![];}_0x28a69e++;}this['_localBuffer']=_0x3542f1;}else{while((_0x1e3038=_0x3542f1[_0x1669('0x8')](_0x467e24))!=-0x1){_0x337377=_0x3542f1[_0x1669('0x9')](0x0,_0x1e3038);this[_0x1669('0xe')](_0x1669('0xf'),_0x337377);_0x3542f1=_0x3542f1[_0x1669('0x9')](_0x1e3038+_0x467e24['length']);}this['_localBuffer']=_0x3542f1;}_0x2e2764();};module[_0x1669('0x10')]=AGIReply; \ No newline at end of file +var _0x6417=['_inBody','indexOf','substring','length','trim','slice','emit','headers','line','exports','stream','Transform','call','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString'];(function(_0x28f652,_0xf24d4a){var _0x5445e6=function(_0x8b37ca){while(--_0x8b37ca){_0x28f652['push'](_0x28f652['shift']());}};_0x5445e6(++_0xf24d4a);}(_0x6417,0x8f));var _0x7641=function(_0x11956b,_0x4b730c){_0x11956b=_0x11956b-0x0;var _0x2cccb2=_0x6417[_0x11956b];return _0x2cccb2;};'use strict';var util=require('util');var Transform=require(_0x7641('0x0'))[_0x7641('0x1')];function AGIReply(_0x5deeb8){Transform[_0x7641('0x2')](this,_0x5deeb8);this['_localBuffer']='';this['_inBody']=![];}util[_0x7641('0x3')](AGIReply,Transform);AGIReply[_0x7641('0x4')][_0x7641('0x5')]=function(_0x1c7502,_0x235635,_0x42f75f){var _0x419fdf='\x0a',_0x2f5396=['\x0a\x0a',_0x7641('0x6')],_0x105db4=-0x1,_0x747b81=-0x1,_0x146ca6='',_0x134d87=0x0,_0x4ba05b='',_0x29c7dd='';this[_0x7641('0x7')]+=_0x1c7502[_0x7641('0x8')]();_0x4ba05b=this['_localBuffer'];if(!this[_0x7641('0x9')]){_0x134d87=0x0;while(_0x2f5396[_0x134d87]){while((_0x747b81=_0x4ba05b[_0x7641('0xa')](_0x2f5396[_0x134d87]))!=-0x1){_0x146ca6=_0x2f5396[_0x134d87];_0x29c7dd=_0x4ba05b[_0x7641('0xb')](0x0,_0x747b81);_0x4ba05b=_0x4ba05b['substring'](_0x747b81+_0x146ca6[_0x7641('0xc')]);var _0x153ec2=_0x29c7dd['split'](_0x419fdf),_0x5ded6b=0x0,_0x207599={},_0x517eb6='',_0x536365='',_0x405f5f=-0x1;while(_0x153ec2[_0x5ded6b]){_0x405f5f=_0x153ec2[_0x5ded6b][_0x7641('0xa')](':');if(_0x405f5f!=-0x1){_0x517eb6=_0x153ec2[_0x5ded6b]['slice'](0x0,_0x405f5f)[_0x7641('0xd')]();_0x536365=_0x153ec2[_0x5ded6b][_0x7641('0xe')](_0x405f5f+0x1)['trim']();if(_0x517eb6[_0x7641('0xc')]>0x0){_0x207599[_0x517eb6]=_0x536365;}}else{}_0x5ded6b++;}this[_0x7641('0xf')](_0x7641('0x10'),_0x207599);this[_0x7641('0x9')]=!![];}_0x134d87++;}this['_localBuffer']=_0x4ba05b;}else{while((_0x105db4=_0x4ba05b[_0x7641('0xa')](_0x419fdf))!=-0x1){_0x29c7dd=_0x4ba05b[_0x7641('0xb')](0x0,_0x105db4);this[_0x7641('0xf')](_0x7641('0x11'),_0x29c7dd);_0x4ba05b=_0x4ba05b[_0x7641('0xb')](_0x105db4+_0x419fdf[_0x7641('0xc')]);}this[_0x7641('0x7')]=_0x4ba05b;}_0x42f75f();};module[_0x7641('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 0a75b7f..e89cb2a 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 _0xa8eb=['save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','lodash','jayson/promise','http','request','error','result','catch','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound'];(function(_0x98fd7c,_0x488a10){var _0x3ae559=function(_0x3f588b){while(--_0x3f588b){_0x98fd7c['push'](_0x98fd7c['shift']());}};_0x3ae559(++_0x488a10);}(_0xa8eb,0x179));var _0xba8e=function(_0x2922aa,_0x2abe91){_0x2922aa=_0x2922aa-0x0;var _0x237880=_0xa8eb[_0x2922aa];return _0x237880;};'use strict';var _=require(_0xba8e('0x0'));var moment=require('moment');var jayson=require(_0xba8e('0x1'));var client=jayson['client'][_0xba8e('0x2')]({'port':0x2329});function request(_0x35f485,_0x3b8fee){return new Promise(function(_0x5c94e6,_0x353df2){return client[_0xba8e('0x3')](_0x35f485,_0x3b8fee)['then'](function(_0x18a4d0){if(_0x18a4d0['error']){return _0x353df2(_0x18a4d0[_0xba8e('0x4')]['message']);}else{return _0x5c94e6(_0x18a4d0[_0xba8e('0x5')]);}})[_0xba8e('0x6')](function(_0x4b1bd6){return _0x353df2(_0x4b1bd6);});});}exports['getSquareProjects']=function(){return request(_0xba8e('0x7'),{'options':{'raw':![],'attributes':['id',_0xba8e('0x8'),_0xba8e('0x9')]}});};exports[_0xba8e('0xa')]=function(_0x441bc3){return request(_0xba8e('0xb'),{'options':{'raw':![],'where':{'name':_0x441bc3},'attributes':[_0xba8e('0x9')]}});};exports[_0xba8e('0xc')]=function(_0x472556){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x472556},'include':[{'model':_0xba8e('0xd'),'as':_0xba8e('0xe'),'include':[{'model':_0xba8e('0xf'),'as':_0xba8e('0xf')}]}],'attributes':['id',_0xba8e('0x8'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x1b0b0d){return request(_0xba8e('0xb'),{'options':{'where':{'id':_0x1b0b0d},'attributes':[_0xba8e('0x8')]}});};exports[_0xba8e('0x10')]=function(_0xec4952){return request(_0xba8e('0x11'),{'options':{'where':{'id':_0xec4952},'attributes':[_0xba8e('0x8')]}});};exports[_0xba8e('0x12')]=function(_0x362973){return request(_0xba8e('0x13'),{'options':{'where':{'id':_0x362973},'attributes':[_0xba8e('0x8')]}});};exports['getSquareOdbcById']=function(_0x76810d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x76810d},'attributes':[_0xba8e('0x14')]}});};exports[_0xba8e('0x15')]=function(_0x476fcf){return request('ShowUser',{'options':{'where':{'id':_0x476fcf},'attributes':[_0xba8e('0x8')]}});};exports[_0xba8e('0x16')]=function(_0x1627c7){return request(_0xba8e('0x17'),{'options':{'where':{'phone':_0x1627c7[_0xba8e('0x18')]},'attributes':['id']}});};exports[_0xba8e('0x19')]=function(_0x1d6f2a){return request(_0xba8e('0x1a'),{'options':{'where':{'id':_0x1d6f2a},'attributes':[_0xba8e('0x8')]}});};exports[_0xba8e('0x1b')]=function(_0x469f21){return request(_0xba8e('0x1c'),{'options':{'where':{'id':_0x469f21},'attributes':[_0xba8e('0x1d')]}});};exports[_0xba8e('0x1e')]=function(_0x7592ce){return request(_0xba8e('0x1f'),{'options':{'raw':![],'where':{'id':_0x7592ce},'include':[{'model':_0xba8e('0x20'),'as':_0xba8e('0x21')}]}});};exports[_0xba8e('0x22')]=function(_0x49323a){return request('ShowSmsAccount',{'options':{'where':{'id':_0x49323a},'attributes':['id','name']}});};exports[_0xba8e('0x23')]=function(_0x7d4ca){return request('CreateSmsMessage',{'body':_0x7d4ca});};exports[_0xba8e('0x24')]=function(_0x55ca98){return request(_0xba8e('0x25'),{'body':_0x55ca98});};exports['createSquareReport']=function(_0x3d0e39){return request(_0xba8e('0x26'),{'body':_[_0xba8e('0x27')](_0x3d0e39,{'project_name':_0x3d0e39['arg_1'],'prev_project_name':_0x3d0e39[_0xba8e('0x28')]||'','is_subproject':_0x3d0e39[_0xba8e('0x28')]?!![]:![],'leaveAt':moment()['format'](_0xba8e('0x29'))})});};exports[_0xba8e('0x2a')]=function(_0x330346){return request(_0xba8e('0x2b'),{'body':_0x330346});};exports[_0xba8e('0x2c')]=function(_0x2c3aa1){return request(_0xba8e('0x2d'),{'body':_0x2c3aa1});};exports[_0xba8e('0x2e')]=function(_0x264520){return request(_0xba8e('0x2f'),{'options':{'raw':![],'where':{'phone':_0x264520[_0xba8e('0x18')],'ListId':_0x264520[_0xba8e('0x30')]}}})[_0xba8e('0x31')](function(_0x5c0434){if(_0x5c0434){return _0x5c0434;}return request(_0xba8e('0x32'),{'body':_0x264520});});};exports['getPauseById']=function(_0x4f7b19){return request(_0xba8e('0x33'),{'options':{'where':{'id':_0x4f7b19},'attributes':[_0xba8e('0x8')]}});};exports[_0xba8e('0x34')]=function(_0x5a0e20,_0x778c74){return request(_0xba8e('0x35'),{'body':{'interface':_0x778c74},'options':{'where':_0x5a0e20}});};exports[_0xba8e('0x36')]=function(_0x19f475,_0x254ca6,_0x1b6be5){return request(_0xba8e('0x37'),{'body':{'type':_0x254ca6,'uniqueid':_0x1b6be5},'options':{'where':_0x19f475}});};exports[_0xba8e('0x38')]=function(_0x55ae4b){return request('UnpauseUser',{'body':{},'options':{'where':_0x55ae4b}});};exports[_0xba8e('0x39')]=function(_0x4315b6){return request('LogoutUser',{'body':{},'options':{'where':_0x4315b6}});}; \ No newline at end of file +var _0x8b7c=['Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','name','getSquareProject','ShowSquareProject','production','getMailAccountById','Smtp','CloudProvider','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name'];(function(_0x5a67ea,_0x42eb27){var _0x5899d9=function(_0x532301){while(--_0x532301){_0x5a67ea['push'](_0x5a67ea['shift']());}};_0x5899d9(++_0x42eb27);}(_0x8b7c,0x119));var _0xc8b7=function(_0x55c979,_0x36c5f0){_0x55c979=_0x55c979-0x0;var _0x690107=_0x8b7c[_0x55c979];return _0x690107;};'use strict';var _=require(_0xc8b7('0x0'));var moment=require(_0xc8b7('0x1'));var jayson=require(_0xc8b7('0x2'));var client=jayson[_0xc8b7('0x3')][_0xc8b7('0x4')]({'port':0x2329});function request(_0x47766d,_0x47089d){return new Promise(function(_0x201c49,_0x4f66ab){return client[_0xc8b7('0x5')](_0x47766d,_0x47089d)[_0xc8b7('0x6')](function(_0x3899cd){if(_0x3899cd['error']){return _0x4f66ab(_0x3899cd[_0xc8b7('0x7')][_0xc8b7('0x8')]);}else{return _0x201c49(_0x3899cd[_0xc8b7('0x9')]);}})[_0xc8b7('0xa')](function(_0x9e4763){return _0x4f66ab(_0x9e4763);});});}exports[_0xc8b7('0xb')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xc8b7('0xc'),'production']}});};exports[_0xc8b7('0xd')]=function(_0xf69f1f){return request(_0xc8b7('0xe'),{'options':{'raw':![],'where':{'name':_0xf69f1f},'attributes':[_0xc8b7('0xf')]}});};exports[_0xc8b7('0x10')]=function(_0x4f4587){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4f4587},'include':[{'model':'MailServerOut','as':_0xc8b7('0x11'),'include':[{'model':_0xc8b7('0x12'),'as':_0xc8b7('0x12')}]}],'attributes':['id',_0xc8b7('0xc'),'email'],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x4d4269){return request(_0xc8b7('0xe'),{'options':{'where':{'id':_0x4d4269},'attributes':[_0xc8b7('0xc')]}});};exports[_0xc8b7('0x13')]=function(_0x5c6e5b){return request(_0xc8b7('0x14'),{'options':{'where':{'id':_0x5c6e5b},'attributes':[_0xc8b7('0xc')]}});};exports[_0xc8b7('0x15')]=function(_0x1b7dc0){return request(_0xc8b7('0x16'),{'options':{'where':{'id':_0x1b7dc0},'attributes':['name']}});};exports[_0xc8b7('0x17')]=function(_0x26d70a){return request(_0xc8b7('0x18'),{'options':{'where':{'id':_0x26d70a},'attributes':[_0xc8b7('0x19')]}});};exports[_0xc8b7('0x1a')]=function(_0x186dbd){return request(_0xc8b7('0x1b'),{'options':{'where':{'id':_0x186dbd},'attributes':['name']}});};exports['getContactByPhone']=function(_0x1cf47c){return request(_0xc8b7('0x1c'),{'options':{'where':{'phone':_0x1cf47c[_0xc8b7('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x5df9f7){return request(_0xc8b7('0x1e'),{'options':{'where':{'id':_0x5df9f7},'attributes':['name']}});};exports[_0xc8b7('0x1f')]=function(_0x566c4d){return request(_0xc8b7('0x20'),{'options':{'where':{'id':_0x566c4d},'attributes':[_0xc8b7('0x21')]}});};exports['getIntervalById']=function(_0x298e69){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x298e69},'include':[{'model':_0xc8b7('0x22'),'as':_0xc8b7('0x23')}]}});};exports[_0xc8b7('0x24')]=function(_0x5e11cd){return request(_0xc8b7('0x25'),{'options':{'where':{'id':_0x5e11cd},'attributes':['id',_0xc8b7('0xc')]}});};exports[_0xc8b7('0x26')]=function(_0x5b28ad){return request(_0xc8b7('0x27'),{'body':_0x5b28ad});};exports[_0xc8b7('0x28')]=function(_0x908acb){return request(_0xc8b7('0x29'),{'body':_0x908acb});};exports[_0xc8b7('0x2a')]=function(_0x3d6a2b){return request(_0xc8b7('0x2b'),{'body':_[_0xc8b7('0x2c')](_0x3d6a2b,{'project_name':_0x3d6a2b[_0xc8b7('0x2d')],'prev_project_name':_0x3d6a2b[_0xc8b7('0x2e')]||'','is_subproject':_0x3d6a2b[_0xc8b7('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0xc8b7('0x2f'))})});};exports[_0xc8b7('0x30')]=function(_0x3a9ce2){return request(_0xc8b7('0x31'),{'body':_0x3a9ce2});};exports[_0xc8b7('0x32')]=function(_0x311047){return request('CreateSquareMessage',{'body':_0x311047});};exports['createCmContact']=function(_0x16cc83){return request(_0xc8b7('0x33'),{'options':{'raw':![],'where':{'phone':_0x16cc83[_0xc8b7('0x1d')],'ListId':_0x16cc83[_0xc8b7('0x34')]}}})[_0xc8b7('0x6')](function(_0x17cae3){if(_0x17cae3){return _0x17cae3;}return request(_0xc8b7('0x35'),{'body':_0x16cc83});});};exports['getPauseById']=function(_0x3a9658){return request(_0xc8b7('0x36'),{'options':{'where':{'id':_0x3a9658},'attributes':[_0xc8b7('0xc')]}});};exports[_0xc8b7('0x37')]=function(_0x27f4b7,_0x340af1){return request(_0xc8b7('0x38'),{'body':{'interface':_0x340af1},'options':{'where':_0x27f4b7}});};exports[_0xc8b7('0x39')]=function(_0x4fe3e4,_0x247388,_0x3c5db5){return request(_0xc8b7('0x3a'),{'body':{'type':_0x247388,'uniqueid':_0x3c5db5},'options':{'where':_0x4fe3e4}});};exports[_0xc8b7('0x3b')]=function(_0x2d6e6b){return request(_0xc8b7('0x3c'),{'body':{},'options':{'where':_0x2d6e6b}});};exports[_0xc8b7('0x3d')]=function(_0x34c7d6){return request(_0xc8b7('0x3e'),{'body':{},'options':{'where':_0x34c7d6}});}; \ 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 0b89bb0..a44aeb8 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 _0xa93e=['exports'];(function(_0x491bff,_0x1fbd23){var _0x539c84=function(_0x5e9c12){while(--_0x5e9c12){_0x491bff['push'](_0x491bff['shift']());}};_0x539c84(++_0x1fbd23);}(_0xa93e,0x1df));var _0xea93=function(_0x374d31,_0x1829b){_0x374d31=_0x374d31-0x0;var _0x4accfc=_0xa93e[_0x374d31];return _0x4accfc;};var polly=require('./polly');var lex=require('./lex');module[_0xea93('0x0')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x03db=['./polly','./lex','exports'];(function(_0x49caf4,_0x33d5b4){var _0x355943=function(_0x27bdae){while(--_0x27bdae){_0x49caf4['push'](_0x49caf4['shift']());}};_0x355943(++_0x33d5b4);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};var polly=require(_0xb03d('0x0'));var lex=require(_0xb03d('0x1'));module[_0xb03d('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 6de1478..e0107b7 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 _0x0bb5=['./lib/api','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0bb5,0x148));var _0x50bb=function(_0x1e2ce2,_0x261f09){_0x1e2ce2=_0x1e2ce2-0x0;var _0x33ece4=_0x0bb5[_0x1e2ce2];return _0x33ece4;};'use strict';var lex=require(_0x50bb('0x0'));module[_0x50bb('0x1')]=function(_0x5e61cf,_0x5a12b6,_0x348380,_0x1aaa37,_0x6b7575,_0x117e36){return lex(_0x5e61cf,_0x5a12b6,_0x348380,_0x1aaa37,_0x6b7575,_0x117e36);}; \ No newline at end of file +var _0x70e0=['exports','./lib/api'];(function(_0x223a3e,_0x2da798){var _0x582005=function(_0x4adba8){while(--_0x4adba8){_0x223a3e['push'](_0x223a3e['shift']());}};_0x582005(++_0x2da798);}(_0x70e0,0x17b));var _0x070e=function(_0x57b94f,_0x37a250){_0x57b94f=_0x57b94f-0x0;var _0x96df9f=_0x70e0[_0x57b94f];return _0x96df9f;};'use strict';var lex=require(_0x070e('0x0'));module[_0x070e('0x1')]=function(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32){return lex(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32);}; \ 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 2b24e39..25957fe 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(_0x128890,_0x20f798){var _0x1a3aa8=function(_0x358644){while(--_0x358644){_0x128890['push'](_0x128890['shift']());}};_0x1a3aa8(++_0x20f798);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x4d5f86,_0x4ba228){var _0x286790=function(_0x380bee){while(--_0x380bee){_0x4d5f86['push'](_0x4d5f86['shift']());}};_0x286790(++_0x4ba228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 bf4667f..16fdf9f 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 _0xfc81=['./lib/api','exports'];(function(_0x5bd2e5,_0x3104b1){var _0x415087=function(_0x330c40){while(--_0x330c40){_0x5bd2e5['push'](_0x5bd2e5['shift']());}};_0x415087(++_0x3104b1);}(_0xfc81,0xb0));var _0x1fc8=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0xfc81[_0x2a5b3b];return _0xae665a;};'use strict';var polly=require(_0x1fc8('0x0'));module[_0x1fc8('0x1')]=function(_0x35edd8,_0x53f1c3,_0x269cde,_0x13382b,_0x20c0f2,_0x4fbbd2,_0x14b8b0){return polly(_0x35edd8,_0x53f1c3,_0x269cde,_0x13382b,_0x20c0f2,_0x4fbbd2,_0x14b8b0);}; \ No newline at end of file +var _0x8bd6=['exports','./lib/api'];(function(_0x2b5d9c,_0x4cf3cd){var _0x184937=function(_0x198c57){while(--_0x198c57){_0x2b5d9c['push'](_0x2b5d9c['shift']());}};_0x184937(++_0x4cf3cd);}(_0x8bd6,0x9b));var _0x68bd=function(_0x140115,_0x4555dd){_0x140115=_0x140115-0x0;var _0x5e88ed=_0x8bd6[_0x140115];return _0x5e88ed;};'use strict';var polly=require(_0x68bd('0x0'));module[_0x68bd('0x1')]=function(_0x50cf65,_0x45b039,_0x3b410f,_0x55e2a3,_0x164766,_0x4f6f61,_0x7282ae){return polly(_0x50cf65,_0x45b039,_0x3b410f,_0x55e2a3,_0x164766,_0x4f6f61,_0x7282ae);}; \ 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 96e7d30..0ad3138 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 _0x3f71=['exports','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x425a95,_0x2743b6){var _0x270c10=function(_0x5a18ed){while(--_0x5a18ed){_0x425a95['push'](_0x425a95['shift']());}};_0x270c10(++_0x2743b6);}(_0x3f71,0x14d));var _0x13f7=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x3f71[_0x257642];return _0x3d813b;};'use strict';var fs=require('fs');var path=require(_0x13f7('0x0'));var BPromise=require(_0x13f7('0x1'));var rs=require('randomstring');var AWS=require(_0x13f7('0x2'));function pollyResult(_0x26779e,_0x221020,_0x4394ca){return new BPromise(function(_0x5bfd7c,_0x402fba){_0x26779e[_0x13f7('0x3')](_0x221020,function(_0x317a81,_0x2a6303){if(_0x317a81){_0x402fba(_0x317a81);}else if(_0x2a6303){if(_0x2a6303[_0x13f7('0x4')]instanceof Buffer){fs[_0x13f7('0x5')](_0x4394ca,_0x2a6303[_0x13f7('0x4')],function(_0x545b65){if(_0x545b65){_0x402fba(_0x545b65);}else{_0x5bfd7c();}});}else{_0x402fba(new Error(_0x13f7('0x6')));}}else{_0x402fba(new Error(_0x13f7('0x7')));}});});}module[_0x13f7('0x8')]=function(_0x105651,_0x5274a3,_0x34aef2,_0x5daa05,_0x53e9f0,_0x1942cc,_0x1f6a82){var _0x30d674=new AWS['Polly']({'accessKeyId':_0x105651,'secretAccessKey':_0x5274a3,'region':_0x34aef2});var _0x540d0f={'Text':_0x53e9f0,'TextType':_0x1942cc||_0x13f7('0x9'),'OutputFormat':_0x13f7('0xa'),'VoiceId':_0x5daa05};return pollyResult(_0x30d674,_0x540d0f,_0x1f6a82);}; \ No newline at end of file +var _0x881b=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile'];(function(_0x1a680b,_0x3df1ae){var _0x19c9ec=function(_0x45a199){while(--_0x45a199){_0x1a680b['push'](_0x1a680b['shift']());}};_0x19c9ec(++_0x3df1ae);}(_0x881b,0x13e));var _0xb881=function(_0x1535be,_0x4335a5){_0x1535be=_0x1535be-0x0;var _0x307aa0=_0x881b[_0x1535be];return _0x307aa0;};'use strict';var fs=require('fs');var path=require(_0xb881('0x0'));var BPromise=require(_0xb881('0x1'));var rs=require(_0xb881('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x319f3e,_0x2b8d35,_0x33abae){return new BPromise(function(_0x3ccf4e,_0x4a2db3){_0x319f3e[_0xb881('0x3')](_0x2b8d35,function(_0x5848ed,_0x41d578){if(_0x5848ed){_0x4a2db3(_0x5848ed);}else if(_0x41d578){if(_0x41d578[_0xb881('0x4')]instanceof Buffer){fs[_0xb881('0x5')](_0x33abae,_0x41d578[_0xb881('0x4')],function(_0x584efd){if(_0x584efd){_0x4a2db3(_0x584efd);}else{_0x3ccf4e();}});}else{_0x4a2db3(new Error(_0xb881('0x6')));}}else{_0x4a2db3(new Error(_0xb881('0x7')));}});});}module[_0xb881('0x8')]=function(_0x2bd308,_0x567ca8,_0x4bbe59,_0x5f2256,_0x5b482a,_0x258916,_0x28e6fe){var _0x1ea6e8=new AWS[(_0xb881('0x9'))]({'accessKeyId':_0x2bd308,'secretAccessKey':_0x567ca8,'region':_0x4bbe59});var _0x3b6f6d={'Text':_0x5b482a,'TextType':_0x258916||_0xb881('0xa'),'OutputFormat':_0xb881('0xb'),'VoiceId':_0x5f2256};return pollyResult(_0x1ea6e8,_0x3b6f6d,_0x28e6fe);}; \ 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 6ccf0b1..90ef469 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 _0xf810=['./lib/api','exports'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xf810,0x1c2));var _0x0f81=function(_0x52cbe0,_0x16e777){_0x52cbe0=_0x52cbe0-0x0;var _0x19c748=_0xf810[_0x52cbe0];return _0x19c748;};'use strict';var asr=require(_0x0f81('0x0'));module[_0x0f81('0x1')]=function(_0x1d4c0d,_0x4f4a84,_0x80700c,_0x4b85b3){return asr(_0x1d4c0d,_0x4f4a84,_0x80700c);}; \ No newline at end of file +var _0x08ae=['./lib/api'];(function(_0xb13e8b,_0x327dc9){var _0x459143=function(_0x65db7d){while(--_0x65db7d){_0xb13e8b['push'](_0xb13e8b['shift']());}};_0x459143(++_0x327dc9);}(_0x08ae,0xed));var _0xe08a=function(_0x44efc3,_0xe3381c){_0x44efc3=_0x44efc3-0x0;var _0x15dfc0=_0x08ae[_0x44efc3];return _0x15dfc0;};'use strict';var asr=require(_0xe08a('0x0'));module['exports']=function(_0x13a8c5,_0x1a247e,_0x4e0bfa,_0x481fdd){return asr(_0x13a8c5,_0x1a247e,_0x4e0bfa);}; \ 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 cd78927..6d0ee14 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 _0xa75b=['toString','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string'];(function(_0x151321,_0x437d1a){var _0x152cb6=function(_0x1fd885){while(--_0x1fd885){_0x151321['push'](_0x151321['shift']());}};_0x152cb6(++_0x437d1a);}(_0xa75b,0x170));var _0xba75=function(_0x420a2e,_0x23a5e0){_0x420a2e=_0x420a2e-0x0;var _0x3b4f98=_0xa75b[_0x420a2e];return _0x3b4f98;};'use strict';var url=require(_0xba75('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xba75('0x1')]=function(_0x39dc19,_0x17b666,_0x3cde96){return new BPromise(function(_0x1760c0,_0x336606){var _0x152269;if(typeof _0x39dc19!==_0xba75('0x2')||_0x39dc19[_0xba75('0x3')]===0x0){return _0x336606(_0xba75('0x4'));}if(typeof _0x17b666!==_0xba75('0x2')||_0x17b666[_0xba75('0x3')]===0x0){return _0x336606(_0xba75('0x5'));}if(typeof _0x3cde96!=='undefined'&&(typeof _0x3cde96!=='string'||_0x3cde96[_0xba75('0x3')]===0x0)){return _0x336606('lang\x20should\x20be\x20a\x20string');}try{_0x152269=fs['readFileSync'](_0x39dc19)[_0xba75('0x6')]('base64');}catch(_0x2e8905){return _0x336606(_0x2e8905);}return _0x1760c0({'method':_0xba75('0x7'),'uri':host+_0xba75('0x8')+_0x17b666,'body':{'config':{'encoding':_0xba75('0x9'),'sampleRateHertz':_0xba75('0xa'),'languageCode':_0x3cde96},'audio':{'content':_0x152269}},'json':!![]});});}; \ No newline at end of file +var _0xfc1e=['8000','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xfc1e[_0x618414];return _0x21c19a;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0xefc1('0x0')]=function(_0x22ce4b,_0x2a6255,_0x913595){return new BPromise(function(_0xbe8efc,_0x4960a1){var _0xd502e9;if(typeof _0x22ce4b!==_0xefc1('0x1')||_0x22ce4b['length']===0x0){return _0x4960a1('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a6255!==_0xefc1('0x1')||_0x2a6255[_0xefc1('0x2')]===0x0){return _0x4960a1(_0xefc1('0x3'));}if(typeof _0x913595!==_0xefc1('0x4')&&(typeof _0x913595!==_0xefc1('0x1')||_0x913595[_0xefc1('0x2')]===0x0)){return _0x4960a1(_0xefc1('0x5'));}try{_0xd502e9=fs[_0xefc1('0x6')](_0x22ce4b)[_0xefc1('0x7')](_0xefc1('0x8'));}catch(_0x1d10bc){return _0x4960a1(_0x1d10bc);}return _0xbe8efc({'method':'POST','uri':host+_0xefc1('0x9')+_0x2a6255,'body':{'config':{'encoding':_0xefc1('0xa'),'sampleRateHertz':_0xefc1('0xb'),'languageCode':_0x913595},'audio':{'content':_0xd502e9}},'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 757c3cc..3c1e27f 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 _0x9a29=['exports'];(function(_0x3873ff,_0x506cf5){var _0x14385d=function(_0x1bc3ef){while(--_0x1bc3ef){_0x3873ff['push'](_0x3873ff['shift']());}};_0x14385d(++_0x506cf5);}(_0x9a29,0x1b4));var _0x99a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a29[_0x2641f9];return _0x585741;};var asr=require('./asr');module[_0x99a2('0x0')]={'asr':asr}; \ No newline at end of file +var _0xb796=['./asr'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb796,0xbf));var _0x6b79=function(_0x4401d1,_0x5844ef){_0x4401d1=_0x4401d1-0x0;var _0x13cef1=_0xb796[_0x4401d1];return _0x13cef1;};var asr=require(_0x6b79('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 716e7e7..e4bd524 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 _0xf0de=['confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','textRequest','result','source','resolvedQuery','action','fulfillment','score','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','name','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','path','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','download\x20error','pipe','end','data','transcode','wav','error\x20convert','start','resolve','writeFileSync','base64','then','unlink','chmodSync','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','generate','.wav','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','tmp','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join'];(function(_0x49a3e2,_0x419808){var _0x287ac2=function(_0x2c51d6){while(--_0x2c51d6){_0x49a3e2['push'](_0x49a3e2['shift']());}};_0x287ac2(++_0x419808);}(_0xf0de,0x1d9));var _0xef0d=function(_0x55ad62,_0x5d1eb8){_0x55ad62=_0x55ad62-0x0;var _0x2f995d=_0xf0de[_0x55ad62];return _0x2f995d;};'use strict';var apiai=require(_0xef0d('0x0'));var BPromise=require(_0xef0d('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xef0d('0x2'));var https=require('https');var md5=require('md5');var path=require('path');var querystring=require(_0xef0d('0x3'));var rp=require('request-promise');var rs=require(_0xef0d('0x4'));var sox=require(_0xef0d('0x5'));var tts=require(_0xef0d('0x6'));var urlParse=require(_0xef0d('0x7'))[_0xef0d('0x8')];var util=require(_0xef0d('0x9'));var aws=require(_0xef0d('0xa'));var google=require('./google');var sestek=require(_0xef0d('0xb'));var tilde=require(_0xef0d('0xc'));var logger=require(_0xef0d('0xd'))(_0xef0d('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x4291a9,_0x2956cd){return new BPromise(function(_0x5393d1,_0x56c349){var _0x5808b0=urlParse(_0x4291a9);var _0x2e1ae2=_0x5808b0[_0xef0d('0xf')]===_0xef0d('0x10')?https:http;var _0x860644={'host':_0x5808b0[_0xef0d('0x11')],'path':_0x5808b0[_0xef0d('0x12')],'headers':{'user-agent':_0xef0d('0x13')}};_0x2e1ae2[_0xef0d('0x14')](_0x860644,function(_0x31e995){if(_0x31e995['statusCode']!==0xc8){logger[_0xef0d('0x15')](_0xef0d('0x16')+_0x4291a9+_0xef0d('0x17')+_0x31e995[_0xef0d('0x18')]+'\x20('+_0x31e995['statusMessage']+')');_0x56c349(new Error(_0xef0d('0x16')+_0x4291a9+_0xef0d('0x17')+_0x31e995[_0xef0d('0x18')]+'\x20('+_0x31e995[_0xef0d('0x19')]+')'));return;}var _0x127060=fs[_0xef0d('0x1a')](_0x2956cd);_0x127060['on'](_0xef0d('0x1b'),function(){logger[_0xef0d('0x1c')](_0xef0d('0x1d'));_0x127060['close'](_0x5393d1);});_0x127060['on'](_0xef0d('0x15'),function(_0x547895){fs['unlink'](_0x2956cd);logger[_0xef0d('0x15')](_0xef0d('0x1e'),_0x547895);_0x56c349(_0x547895);});_0x31e995[_0xef0d('0x1f')](_0x127060);})['on'](_0xef0d('0x15'),function(_0x3fc521){logger[_0xef0d('0x15')](_0x3fc521);_0x56c349(_0x3fc521);})[_0xef0d('0x20')]();});}function uploadFile(_0x1da026){return new BPromise(function(_0x21d6d1,_0xef2018){var _0x10f9b4=urlParse(_0x1da026);var _0x3e0777=_0x10f9b4[_0xef0d('0xf')]===_0xef0d('0x10')?https:http;var _0xed2564={'host':_0x10f9b4[_0xef0d('0x11')],'path':_0x10f9b4[_0xef0d('0x12')],'headers':{'user-agent':'WHAT_EVER'}};_0x3e0777[_0xef0d('0x14')](_0xed2564,function(_0x4b080a){if(_0x4b080a[_0xef0d('0x18')]!==0xc8){_0xef2018(new Error(_0xef0d('0x16')+_0x1da026+_0xef0d('0x17')+_0x4b080a['statusCode']+'\x20('+_0x4b080a['statusMessage']+')'));return;}var _0x443bf0='';_0x4b080a['on'](_0xef0d('0x21'),function(_0x4602a7){_0x443bf0+=_0x4602a7;});_0x4b080a['on']('end',function(){_0x21d6d1(_0x443bf0);});})['on'](_0xef0d('0x15'),function(_0x3c79cb){_0xef2018(_0x3c79cb);})['end']();});}function convertFile(_0x537962,_0x5b50c9){return new BPromise(function(_0x52bfcd,_0x4d69a9){var _0x15d1ef=sox[_0xef0d('0x22')](_0x537962,_0x5b50c9,{'sampleRate':0x1f40,'format':_0xef0d('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x15d1ef['on'](_0xef0d('0x15'),function(_0x25d261){logger[_0xef0d('0x15')](_0xef0d('0x24'),_0x25d261);_0x4d69a9(_0x25d261);});_0x15d1ef['on']('end',function(){logger['info']('finish\x20to\x20convert');_0x52bfcd();});_0x15d1ef[_0xef0d('0x25')]();});}function base64Decode(_0x4adc6e,_0x30393c){var _0x3f5ec7=path[_0xef0d('0x26')](__dirname,'tmp',rs['generate'](0x4)+'.wav');fs[_0xef0d('0x27')](_0x3f5ec7,_0x4adc6e,_0xef0d('0x28'));return convertFile(_0x3f5ec7,_0x30393c)[_0xef0d('0x29')](function(){try{fs[_0xef0d('0x2a')](_0x3f5ec7);fs[_0xef0d('0x2b')](_0x30393c,'777');}catch(_0x2c6a21){logger[_0xef0d('0x15')](_0x2c6a21);}return _0x30393c[_0xef0d('0x2c')]('.')[0x0];});}function base64Encode(_0x4607b7){var _0x4043a4=fs[_0xef0d('0x2d')](_0x4607b7);return new Buffer(_0x4043a4)[_0xef0d('0x2e')](_0xef0d('0x28'));}exports['googleCloudTTS']=function(_0x13b69d,_0x27a481,_0x25228c,_0x50ba2e,_0x37fc45,_0xe483c7){var _0x135b34,_0x3e933b;var _0x29364b=_0xef0d('0x2f');var _0x739d60=_0xef0d('0x30')+_0x13b69d;var _0xb95cb7={};if(_0x27a481===_0xef0d('0x31')){_0xb95cb7[_0xef0d('0x32')]={'ssml':_0x25228c};}else{_0xb95cb7[_0xef0d('0x32')]={'text':_0x25228c};};_0xb95cb7[_0xef0d('0x33')]={'languageCode':_0x50ba2e,'ssmlGender':_0x37fc45};_0xb95cb7[_0xef0d('0x34')]={'audioEncoding':_0xef0d('0x35'),'sampleRateHertz':0x1f40};var _0x33b53c={'url':_0x29364b+_0xef0d('0x36')+_0x739d60,'method':_0xef0d('0x37'),'json':!![],'body':_0xb95cb7};return rp(_0x33b53c)[_0xef0d('0x29')](function(_0x236dad){return new BPromise(function(_0x17ab6f,_0x105a99){_0x135b34=path[_0xef0d('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xef0d('0x38'));var _0x1688b9=Buffer[_0xef0d('0x39')](_0x236dad[_0xef0d('0x3a')],_0xef0d('0x28'));return fs[_0xef0d('0x3b')](_0x135b34,_0x1688b9,function(_0x1abfe5){_0x105a99(_0x1abfe5);},function(_0x225b9e){fs[_0xef0d('0x2b')](_0x135b34,_0xef0d('0x3c'));_0x17ab6f(_0x225b9e);});});})[_0xef0d('0x29')](function(_0x16247c){_0x3e933b=path['resolve'](__dirname,'tmp',rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x3e'));return convertFile(_0x135b34,_0x3e933b);})[_0xef0d('0x29')](function(){try{fs[_0xef0d('0x2a')](_0x135b34);fs['chmodSync'](_0x3e933b,_0xef0d('0x3c'));}catch(_0x3e27ab){logger['error'](_0x3e27ab);}logger[_0xef0d('0x1c')](_0xef0d('0x3f'),_0x3e933b['split']('.')[0x0]);return _0x3e933b[_0xef0d('0x2c')]('.')[0x0];});};exports[_0xef0d('0x40')]=function(_0x313fe0,_0xaa9131){var _0x4b2dab=_0xef0d('0x41');var _0x17cf36,_0x421d3c;var _0x44bbf0;var _0x2e6796={'encoding':_0xef0d('0x42'),'method':_0xef0d('0x37'),'timeout':0x2710,'url':_0x4b2dab,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xef0d('0x43')+encodeURIComponent(JSON[_0xef0d('0x44')]([[[_0xef0d('0x45'),JSON[_0xef0d('0x44')]([_0x313fe0,_0xaa9131||'en',![],_0xef0d('0x46')]),null,_0xef0d('0x47')]]]))};return rp(_0x2e6796)[_0xef0d('0x29')](function(_0x216363){try{_0x44bbf0=eval(_0x216363[_0xef0d('0x48')](0x5))[0x0][0x2];}catch(_0x1c9999){throw new Error('parse\x20response\x20failed:\x0a'+_0x216363['data']);}if(!_0x44bbf0){if(_0x313fe0[_0xef0d('0x49')]>0xc8){throw new Error(_0xef0d('0x4a'));}else{throw new Error(_0xef0d('0x4b')+_0xaa9131+_0xef0d('0x4c'));}}try{_0x44bbf0=eval(_0x44bbf0)[0x0];}catch(_0x55f1c9){throw new Error(_0xef0d('0x4d')+res[_0xef0d('0x21')]);}const _0x11c06f=_0x44bbf0;_0x17cf36=path[_0xef0d('0x26')](__dirname,_0xef0d('0x4e'),rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x38'));fs['writeFileSync'](_0x17cf36,_0x44bbf0,{'encoding':'base64'});_0x421d3c=path['resolve'](__dirname,_0xef0d('0x4e'),rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x3e'));return convertFile(_0x17cf36,_0x421d3c);})[_0xef0d('0x29')](function(){try{fs[_0xef0d('0x2a')](_0x17cf36);fs[_0xef0d('0x2b')](_0x421d3c,'777');}catch(_0x488930){logger['error'](_0x488930);}logger[_0xef0d('0x1c')](_0xef0d('0x4f'),_0x421d3c[_0xef0d('0x2c')]('.')[0x0]);return _0x421d3c['split']('.')[0x0];});};exports[_0xef0d('0x50')]=function(_0x206628,_0x1fe115,_0x1f84f5){return google[_0xef0d('0x51')](_0x206628,_0x1fe115,_0x1f84f5)['then'](function(_0x5d300f){logger[_0xef0d('0x1c')](_0x5d300f[_0xef0d('0x52')]);return rp(_0x5d300f);})[_0xef0d('0x29')](function(_0x29e285){var _0x4e4940='';var _0x3d1efe=0x0;try{fs[_0xef0d('0x2a')](_0x206628);}catch(_0x671731){logger[_0xef0d('0x15')](_0x671731);}if(_0x29e285&&_0x29e285[_0xef0d('0x53')]){_0x4e4940=_0x29e285[_0xef0d('0x53')]['map'](function(_0x343b1b){return _0x343b1b&&_0x343b1b['alternatives'][0x0]&&_0x343b1b[_0xef0d('0x54')][0x0][_0xef0d('0x55')]?_0x343b1b[_0xef0d('0x54')][0x0][_0xef0d('0x55')]:'';})[_0xef0d('0x56')]('\x0a');_0x3d1efe=_0x29e285[_0xef0d('0x53')]['map'](function(_0x116674){return _0x116674&&_0x116674[_0xef0d('0x54')][0x0]&&_0x116674[_0xef0d('0x54')][0x0][_0xef0d('0x57')]?_0x116674[_0xef0d('0x54')][0x0][_0xef0d('0x57')]:0x0;})[_0xef0d('0x56')]('\x0a');}logger[_0xef0d('0x1c')](_0xef0d('0x58'),_0x4e4940);logger['info'](_0xef0d('0x59'),_0x3d1efe);return{'transcript':_0x4e4940,'confidence':_0x3d1efe};})['catch'](function(_0x520c99){logger[_0xef0d('0x15')](_0xef0d('0x5a'),_0x520c99[_0xef0d('0x18')],_0x520c99['name'],_0x520c99['message']);});};exports['googleDialogflow']=function(_0x5d6db7,_0x3691e1,_0x344c18,_0xea9bb4){var _0x361f84=apiai(_0x3691e1,{'language':_0xea9bb4||'en'});return _0x361f84[_0xef0d('0x5b')](_0x344c18,{'sessionId':md5(_0x5d6db7)})[_0xef0d('0x29')](function(_0x286e8a){logger[_0xef0d('0x1c')](JSON[_0xef0d('0x44')](_0x286e8a));return{'source':_0x286e8a[_0xef0d('0x5c')][_0xef0d('0x5d')],'resolvedQuery':_0x286e8a[_0xef0d('0x5c')][_0xef0d('0x5e')],'action':_0x286e8a[_0xef0d('0x5c')][_0xef0d('0x5f')],'actionIncomplete':_0x286e8a[_0xef0d('0x5c')]['actionIncomplete'],'speech':_0x286e8a['result'][_0xef0d('0x60')]['speech'],'score':_0x286e8a[_0xef0d('0x5c')][_0xef0d('0x61')],'statusCode':_0x286e8a['status'][_0xef0d('0x62')],'endConversation':_0x286e8a[_0xef0d('0x5c')]['metadata'][_0xef0d('0x63')]||![],'isFallbackIntent':_0x286e8a['result'][_0xef0d('0x64')][_0xef0d('0x65')]};});};exports[_0xef0d('0x66')]=function(_0x55aaa9,_0x246c5b,_0x579cab,_0x52507a,_0x22769b,_0x55210d){var _0x108fea=_0x52507a[_0xef0d('0x67')](/\\n/g,'\x0a');var _0x37b89a={'credentials':{'private_key':_0x108fea,'client_email':_0x579cab}};var _0x2b512d=new dialogflow[(_0xef0d('0x68'))](_0x37b89a);var _0x449433=_0x2b512d[_0xef0d('0x69')](_0x246c5b,md5(_0x55aaa9));var _0x376ae5={'session':_0x449433,'queryInput':{'text':{'text':_0x22769b,'languageCode':_0x55210d}}};return _0x2b512d[_0xef0d('0x6a')](_0x376ae5)[_0xef0d('0x29')](function(_0x38b2fc){if(_0x38b2fc&&_0x38b2fc[_0xef0d('0x49')]){logger[_0xef0d('0x1c')](_0xef0d('0x6b'),JSON['stringify'](_0x38b2fc));var _0x550f53=_0x38b2fc[0x0];if(_0x550f53){var _0x1bc8be={'action':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x5f')],'allRequiredParamsPresent':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x6d')],'endConversation':_0x550f53['queryResult']['diagnosticInfo']&&_0x550f53[_0xef0d('0x6c')][_0xef0d('0x6e')][_0xef0d('0x6f')]?_0x550f53[_0xef0d('0x6c')][_0xef0d('0x6e')][_0xef0d('0x6f')]['end_conversation'][_0xef0d('0x70')]:![],'fulfillmentText':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x71')],'intentName':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x72')][_0xef0d('0x73')],'intentDisplayName':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x72')]['displayName'],'isFallbackIntent':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x72')][_0xef0d('0x74')],'languageCode':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x75')],'queryText':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x76')],'responseId':_0x550f53[_0xef0d('0x77')],'score':_0x550f53[_0xef0d('0x6c')][_0xef0d('0x78')],'speech':_0x550f53['queryResult']['fulfillmentText'],'providerResponse':JSON['stringify'](_0x38b2fc)};return _0x1bc8be;}}});};exports['tildeASR']=function(_0x1c9956,_0x38ab35,_0x376ba8,_0x470295){return tilde[_0xef0d('0x51')](_0x1c9956,_0x38ab35,_0x376ba8,_0x470295)[_0xef0d('0x29')](function(_0x25d316){try{fs['unlink'](_0x1c9956);}catch(_0x57762a){logger[_0xef0d('0x15')](_0x57762a);}logger['info'](_0xef0d('0x79'),_0x25d316['transcript']);logger['info']('Tilde\x20ASR\x20confidence',_0x25d316['confidence']);return _0x25d316;});};exports[_0xef0d('0x7a')]=function(_0x3f3ad8,_0x494d77,_0x404ead,_0x1f7de1,_0x13667d,_0x5e4a19){var _0x8043fc=path[_0xef0d('0x26')](__dirname,'tmp',rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x38'));var _0x1e4e2c;return aws[_0xef0d('0x7b')](_0x3f3ad8,_0x494d77,_0x404ead,_0x1f7de1,_0x13667d,_0x5e4a19,_0x8043fc)['then'](function(){_0x1e4e2c=path[_0xef0d('0x26')](__dirname,_0xef0d('0x4e'),rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x3e'));return convertFile(_0x8043fc,_0x1e4e2c);})[_0xef0d('0x29')](function(){try{fs[_0xef0d('0x2a')](_0x8043fc);fs[_0xef0d('0x2b')](_0x1e4e2c,_0xef0d('0x3c'));}catch(_0x53b920){logger['error'](_0x53b920);}return _0x1e4e2c[_0xef0d('0x2c')]('.')[0x0];});};exports[_0xef0d('0x7c')]=function(_0x1bb013,_0x4c452c,_0x34183a,_0x25e9e2,_0x17e747,_0x53ce10){return aws[_0xef0d('0x7d')](_0x1bb013,_0x4c452c,_0x34183a,_0x25e9e2,_0x17e747,_0x53ce10)['then'](function(_0x562c96){logger[_0xef0d('0x1c')](JSON[_0xef0d('0x44')](_0x562c96));return _0x562c96;});};exports[_0xef0d('0x7e')]=function(_0x28b87d,_0x339b24,_0x15779a,_0x52b1a1){var _0x3d4172=util[_0xef0d('0x7f')](_0xef0d('0x80'),ISPEECH_API,_0x28b87d,encodeURIComponent(_0x339b24),_0x15779a,_0x52b1a1);var _0xe4bd2c=path[_0xef0d('0x26')](__dirname,_0xef0d('0x4e'),rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x38'));var _0xe5efc8;return downloadFile(_0x3d4172,_0xe4bd2c)[_0xef0d('0x29')](function(){_0xe5efc8=path[_0xef0d('0x26')](__dirname,_0xef0d('0x4e'),rs['generate'](0x4)+_0xef0d('0x3e'));return convertFile(_0xe4bd2c,_0xe5efc8);})['then'](function(){try{fs['unlink'](_0xe4bd2c);fs[_0xef0d('0x2b')](_0xe5efc8,_0xef0d('0x3c'));}catch(_0x414e96){logger[_0xef0d('0x15')](_0x414e96);}return _0xe5efc8[_0xef0d('0x2c')]('.')[0x0];});};exports[_0xef0d('0x81')]=function(_0x2561cf,_0x344f53,_0x4b5f23,_0x5f02aa){var _0x11d0ba=util[_0xef0d('0x7f')](_0xef0d('0x82'),ISPEECH_API,_0x344f53,_0x4b5f23,base64Encode(_0x2561cf),_0x5f02aa?util[_0xef0d('0x7f')](_0xef0d('0x83'),encodeURIComponent(_0x5f02aa)):'freeform=3');return uploadFile(_0x11d0ba)['then'](function(_0x4a6c11){return querystring[_0xef0d('0x8')](_0x4a6c11);});};exports[_0xef0d('0x84')]=function(_0xe710a0,_0x33c2d0){return sestek['nda'](_0xe710a0,_0x33c2d0)[_0xef0d('0x29')](function(_0x2041c9){logger[_0xef0d('0x1c')](JSON[_0xef0d('0x44')](_0x2041c9));var _0x1e84d9={'speech':_0x2041c9['text'],'action':_0x2041c9[_0xef0d('0x85')]?_0x2041c9[_0xef0d('0x85')][_0xef0d('0x86')]:undefined,'actiondata':_0x2041c9[_0xef0d('0x85')]?_0x2041c9['channelData'][_0xef0d('0x87')]:undefined};if(_0x2041c9['channelData']&&_0x2041c9[_0xef0d('0x85')][_0xef0d('0x88')]){return base64Decode(_0x2041c9['channelData'][_0xef0d('0x88')][_0xef0d('0x89')],path['resolve'](__dirname,_0xef0d('0x4e'),rs[_0xef0d('0x3d')](0x4)+_0xef0d('0x3e')))[_0xef0d('0x29')](function(_0x5b1279){_0x1e84d9[_0xef0d('0x8a')]=_0x5b1279;return _0x1e84d9;});}return _0x1e84d9;});};exports[_0xef0d('0x8b')]=function(){return __dirname;}; \ No newline at end of file +var _0xc941=['google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish\x20download\x20file','close','unlink','download\x20error','end','WHAT_EVER','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','then','chmodSync','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','generate','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','code','metadata','endConversation','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','confidence','awsPolly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','channelData','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','dialogflow','https','md5','querystring','randomstring','sox'];(function(_0x5f392b,_0x38c3d4){var _0x5fe20b=function(_0x45a2b5){while(--_0x45a2b5){_0x5f392b['push'](_0x5f392b['shift']());}};_0x5fe20b(++_0x38c3d4);}(_0xc941,0x10b));var _0x1c94=function(_0xe60792,_0x70bcf5){_0xe60792=_0xe60792-0x0;var _0x566013=_0xc941[_0xe60792];return _0x566013;};'use strict';var apiai=require(_0x1c94('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x1c94('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x1c94('0x2'));var md5=require(_0x1c94('0x3'));var path=require('path');var querystring=require(_0x1c94('0x4'));var rp=require('request-promise');var rs=require(_0x1c94('0x5'));var sox=require(_0x1c94('0x6'));var tts=require(_0x1c94('0x7'));var urlParse=require(_0x1c94('0x8'))[_0x1c94('0x9')];var util=require(_0x1c94('0xa'));var aws=require(_0x1c94('0xb'));var google=require(_0x1c94('0xc'));var sestek=require(_0x1c94('0xd'));var tilde=require(_0x1c94('0xe'));var logger=require(_0x1c94('0xf'))(_0x1c94('0x10'));var ISPEECH_API=_0x1c94('0x11');function downloadFile(_0x156192,_0x2ed437){return new BPromise(function(_0x3c304f,_0x1dcc8d){var _0x24c5f6=urlParse(_0x156192);var _0x4271d2=_0x24c5f6[_0x1c94('0x12')]===_0x1c94('0x13')?https:http;var _0x4fef89={'host':_0x24c5f6[_0x1c94('0x14')],'path':_0x24c5f6[_0x1c94('0x15')],'headers':{'user-agent':'WHAT_EVER'}};_0x4271d2[_0x1c94('0x16')](_0x4fef89,function(_0x1d53f3){if(_0x1d53f3[_0x1c94('0x17')]!==0xc8){logger[_0x1c94('0x18')](_0x1c94('0x19')+_0x156192+_0x1c94('0x1a')+_0x1d53f3[_0x1c94('0x17')]+'\x20('+_0x1d53f3[_0x1c94('0x1b')]+')');_0x1dcc8d(new Error(_0x1c94('0x19')+_0x156192+_0x1c94('0x1a')+_0x1d53f3[_0x1c94('0x17')]+'\x20('+_0x1d53f3[_0x1c94('0x1b')]+')'));return;}var _0x165958=fs['createWriteStream'](_0x2ed437);_0x165958['on']('finish',function(){logger['info'](_0x1c94('0x1c'));_0x165958[_0x1c94('0x1d')](_0x3c304f);});_0x165958['on'](_0x1c94('0x18'),function(_0x178ca0){fs[_0x1c94('0x1e')](_0x2ed437);logger[_0x1c94('0x18')](_0x1c94('0x1f'),_0x178ca0);_0x1dcc8d(_0x178ca0);});_0x1d53f3['pipe'](_0x165958);})['on'](_0x1c94('0x18'),function(_0x36567c){logger[_0x1c94('0x18')](_0x36567c);_0x1dcc8d(_0x36567c);})[_0x1c94('0x20')]();});}function uploadFile(_0x5c465e){return new BPromise(function(_0x1f2b0d,_0x305398){var _0xca004f=urlParse(_0x5c465e);var _0x399177=_0xca004f[_0x1c94('0x12')]==='https:'?https:http;var _0x495e27={'host':_0xca004f[_0x1c94('0x14')],'path':_0xca004f[_0x1c94('0x15')],'headers':{'user-agent':_0x1c94('0x21')}};_0x399177[_0x1c94('0x16')](_0x495e27,function(_0xb9a5b3){if(_0xb9a5b3[_0x1c94('0x17')]!==0xc8){_0x305398(new Error(_0x1c94('0x19')+_0x5c465e+_0x1c94('0x1a')+_0xb9a5b3[_0x1c94('0x17')]+'\x20('+_0xb9a5b3[_0x1c94('0x1b')]+')'));return;}var _0x13a675='';_0xb9a5b3['on']('data',function(_0x79fc5a){_0x13a675+=_0x79fc5a;});_0xb9a5b3['on'](_0x1c94('0x20'),function(){_0x1f2b0d(_0x13a675);});})['on']('error',function(_0x4bb468){_0x305398(_0x4bb468);})['end']();});}function convertFile(_0x18d946,_0x554034){return new BPromise(function(_0x183698,_0x385c2a){var _0x403b10=sox[_0x1c94('0x22')](_0x18d946,_0x554034,{'sampleRate':0x1f40,'format':_0x1c94('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x403b10['on'](_0x1c94('0x18'),function(_0x3de060){logger[_0x1c94('0x18')](_0x1c94('0x24'),_0x3de060);_0x385c2a(_0x3de060);});_0x403b10['on'](_0x1c94('0x20'),function(){logger[_0x1c94('0x25')](_0x1c94('0x26'));_0x183698();});_0x403b10[_0x1c94('0x27')]();});}function base64Decode(_0x4d1144,_0x61bf17){var _0x58f640=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x58f640,_0x4d1144,'base64');return convertFile(_0x58f640,_0x61bf17)[_0x1c94('0x2a')](function(){try{fs[_0x1c94('0x1e')](_0x58f640);fs[_0x1c94('0x2b')](_0x61bf17,'777');}catch(_0x3e7e58){logger[_0x1c94('0x18')](_0x3e7e58);}return _0x61bf17['split']('.')[0x0];});}function base64Encode(_0x513260){var _0x480deb=fs[_0x1c94('0x2c')](_0x513260);return new Buffer(_0x480deb)[_0x1c94('0x2d')](_0x1c94('0x2e'));}exports[_0x1c94('0x2f')]=function(_0x2a4c5f,_0x782597,_0x1c46d0,_0x2b534d,_0x467063,_0x2e8f21){var _0x50a8f6,_0x13116e;var _0x1728ff=_0x1c94('0x30');var _0xa6bf9f='?key='+_0x2a4c5f;var _0xa760b6={};if(_0x782597===_0x1c94('0x31')){_0xa760b6[_0x1c94('0x32')]={'ssml':_0x1c46d0};}else{_0xa760b6[_0x1c94('0x32')]={'text':_0x1c46d0};};_0xa760b6[_0x1c94('0x33')]={'languageCode':_0x2b534d,'ssmlGender':_0x467063};_0xa760b6[_0x1c94('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x55f031={'url':_0x1728ff+_0x1c94('0x35')+_0xa6bf9f,'method':_0x1c94('0x36'),'json':!![],'body':_0xa760b6};return rp(_0x55f031)['then'](function(_0x78bcbc){return new BPromise(function(_0x4c20d3,_0xe6553c){_0x50a8f6=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+_0x1c94('0x37'));var _0x49f39e=Buffer[_0x1c94('0x38')](_0x78bcbc[_0x1c94('0x39')],_0x1c94('0x2e'));return fs[_0x1c94('0x3a')](_0x50a8f6,_0x49f39e,function(_0xca8774){_0xe6553c(_0xca8774);},function(_0x175429){fs[_0x1c94('0x2b')](_0x50a8f6,_0x1c94('0x3b'));_0x4c20d3(_0x175429);});});})['then'](function(_0x1a20fc){_0x13116e=path['resolve'](__dirname,'tmp',rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d'));return convertFile(_0x50a8f6,_0x13116e);})[_0x1c94('0x2a')](function(){try{fs[_0x1c94('0x1e')](_0x50a8f6);fs['chmodSync'](_0x13116e,_0x1c94('0x3b'));}catch(_0x1ceb19){logger[_0x1c94('0x18')](_0x1ceb19);}logger[_0x1c94('0x25')](_0x1c94('0x3e'),_0x13116e[_0x1c94('0x3f')]('.')[0x0]);return _0x13116e[_0x1c94('0x3f')]('.')[0x0];});};exports[_0x1c94('0x40')]=function(_0x13200a,_0x4243c1){var _0x41572f=_0x1c94('0x41');var _0x1bdac9,_0x1b06b4;var _0x850981;var _0xc92ff7={'encoding':_0x1c94('0x42'),'method':'POST','timeout':0x2710,'url':_0x41572f,'headers':{'Content-Type':_0x1c94('0x43')},'body':_0x1c94('0x44')+encodeURIComponent(JSON[_0x1c94('0x45')]([[[_0x1c94('0x46'),JSON[_0x1c94('0x45')]([_0x13200a,_0x4243c1||'en',![],_0x1c94('0x47')]),null,_0x1c94('0x48')]]]))};return rp(_0xc92ff7)[_0x1c94('0x2a')](function(_0x395f8f){try{_0x850981=eval(_0x395f8f[_0x1c94('0x49')](0x5))[0x0][0x2];}catch(_0x20aef0){throw new Error(_0x1c94('0x4a')+_0x395f8f[_0x1c94('0x4b')]);}if(!_0x850981){if(_0x13200a[_0x1c94('0x4c')]>0xc8){throw new Error(_0x1c94('0x4d'));}else{throw new Error(_0x1c94('0x4e')+_0x4243c1+'\x22\x20might\x20not\x20exist');}}try{_0x850981=eval(_0x850981)[0x0];}catch(_0x3f7845){throw new Error(_0x1c94('0x4a')+res[_0x1c94('0x4b')]);}const _0x2ec596=_0x850981;_0x1bdac9=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+_0x1c94('0x37'));fs[_0x1c94('0x4f')](_0x1bdac9,_0x850981,{'encoding':_0x1c94('0x2e')});_0x1b06b4=path['resolve'](__dirname,_0x1c94('0x29'),rs['generate'](0x4)+_0x1c94('0x3d'));return convertFile(_0x1bdac9,_0x1b06b4);})[_0x1c94('0x2a')](function(){try{fs['unlink'](_0x1bdac9);fs[_0x1c94('0x2b')](_0x1b06b4,_0x1c94('0x3b'));}catch(_0x57541a){logger[_0x1c94('0x18')](_0x57541a);}logger['info'](_0x1c94('0x50'),_0x1b06b4[_0x1c94('0x3f')]('.')[0x0]);return _0x1b06b4['split']('.')[0x0];});};exports[_0x1c94('0x51')]=function(_0xf5501d,_0x2552d8,_0x6596b6){return google[_0x1c94('0x52')](_0xf5501d,_0x2552d8,_0x6596b6)[_0x1c94('0x2a')](function(_0x2e2494){logger['info'](_0x2e2494['uri']);return rp(_0x2e2494);})[_0x1c94('0x2a')](function(_0x5bc125){var _0x1fccaa='';var _0x25494a=0x0;try{fs[_0x1c94('0x1e')](_0xf5501d);}catch(_0x330a46){logger[_0x1c94('0x18')](_0x330a46);}if(_0x5bc125&&_0x5bc125[_0x1c94('0x53')]){_0x1fccaa=_0x5bc125[_0x1c94('0x53')][_0x1c94('0x54')](function(_0x3fe043){return _0x3fe043&&_0x3fe043[_0x1c94('0x55')][0x0]&&_0x3fe043['alternatives'][0x0][_0x1c94('0x56')]?_0x3fe043[_0x1c94('0x55')][0x0][_0x1c94('0x56')]:'';})[_0x1c94('0x57')]('\x0a');_0x25494a=_0x5bc125['results']['map'](function(_0x4024a0){return _0x4024a0&&_0x4024a0[_0x1c94('0x55')][0x0]&&_0x4024a0[_0x1c94('0x55')][0x0]['confidence']?_0x4024a0[_0x1c94('0x55')][0x0]['confidence']:0x0;})[_0x1c94('0x57')]('\x0a');}logger[_0x1c94('0x25')](_0x1c94('0x58'),_0x1fccaa);logger[_0x1c94('0x25')](_0x1c94('0x59'),_0x25494a);return{'transcript':_0x1fccaa,'confidence':_0x25494a};})['catch'](function(_0x35262d){logger[_0x1c94('0x18')](_0x1c94('0x5a'),_0x35262d['statusCode'],_0x35262d[_0x1c94('0x5b')],_0x35262d[_0x1c94('0x5c')]);});};exports[_0x1c94('0x5d')]=function(_0x588bc7,_0x43c75c,_0x38d8ae,_0x256000){var _0x936daa=apiai(_0x43c75c,{'language':_0x256000||'en'});return _0x936daa[_0x1c94('0x5e')](_0x38d8ae,{'sessionId':md5(_0x588bc7)})[_0x1c94('0x2a')](function(_0x44a1b6){logger[_0x1c94('0x25')](JSON[_0x1c94('0x45')](_0x44a1b6));return{'source':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x60')],'resolvedQuery':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x61')],'action':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x62')],'actionIncomplete':_0x44a1b6[_0x1c94('0x5f')]['actionIncomplete'],'speech':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x63')][_0x1c94('0x64')],'score':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x65')],'statusCode':_0x44a1b6['status'][_0x1c94('0x66')],'endConversation':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x67')][_0x1c94('0x68')]||![],'isFallbackIntent':_0x44a1b6[_0x1c94('0x5f')][_0x1c94('0x67')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x109991,_0x154186,_0x50ca2c,_0x171176,_0x2065dc,_0x447bd4){var _0x44d785=_0x171176[_0x1c94('0x69')](/\\n/g,'\x0a');var _0x2dd6c9={'credentials':{'private_key':_0x44d785,'client_email':_0x50ca2c}};var _0x34e7ec=new dialogflow[(_0x1c94('0x6a'))](_0x2dd6c9);var _0xd30133=_0x34e7ec[_0x1c94('0x6b')](_0x154186,md5(_0x109991));var _0x2645a8={'session':_0xd30133,'queryInput':{'text':{'text':_0x2065dc,'languageCode':_0x447bd4}}};return _0x34e7ec['detectIntent'](_0x2645a8)[_0x1c94('0x2a')](function(_0x4ca58e){if(_0x4ca58e&&_0x4ca58e[_0x1c94('0x4c')]){logger[_0x1c94('0x25')](_0x1c94('0x6c'),JSON['stringify'](_0x4ca58e));var _0x50a81b=_0x4ca58e[0x0];if(_0x50a81b){var _0x19957d={'action':_0x50a81b[_0x1c94('0x6d')]['action'],'allRequiredParamsPresent':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x6e')],'endConversation':_0x50a81b['queryResult'][_0x1c94('0x6f')]&&_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x6f')][_0x1c94('0x70')]?_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x6f')][_0x1c94('0x70')][_0x1c94('0x71')]['boolValue']:![],'fulfillmentText':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x72')],'intentName':_0x50a81b['queryResult'][_0x1c94('0x73')][_0x1c94('0x5b')],'intentDisplayName':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x73')]['displayName'],'isFallbackIntent':_0x50a81b[_0x1c94('0x6d')]['intent'][_0x1c94('0x74')],'languageCode':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x75')],'queryText':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x76')],'responseId':_0x50a81b['responseId'],'score':_0x50a81b['queryResult'][_0x1c94('0x77')],'speech':_0x50a81b[_0x1c94('0x6d')][_0x1c94('0x72')],'providerResponse':JSON['stringify'](_0x4ca58e)};return _0x19957d;}}});};exports[_0x1c94('0x78')]=function(_0x2dfc5e,_0x42ad12,_0x5c64d0,_0x27d9d9){return tilde['asr'](_0x2dfc5e,_0x42ad12,_0x5c64d0,_0x27d9d9)[_0x1c94('0x2a')](function(_0x46c808){try{fs[_0x1c94('0x1e')](_0x2dfc5e);}catch(_0x54785d){logger[_0x1c94('0x18')](_0x54785d);}logger[_0x1c94('0x25')](_0x1c94('0x79'),_0x46c808[_0x1c94('0x56')]);logger['info']('Tilde\x20ASR\x20confidence',_0x46c808[_0x1c94('0x7a')]);return _0x46c808;});};exports[_0x1c94('0x7b')]=function(_0x29ba8d,_0x5ef5c8,_0x433e49,_0x42c33e,_0x3f21e4,_0x3ee072){var _0xb0c160=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x37'));var _0xa1d2d3;return aws['polly'](_0x29ba8d,_0x5ef5c8,_0x433e49,_0x42c33e,_0x3f21e4,_0x3ee072,_0xb0c160)[_0x1c94('0x2a')](function(){_0xa1d2d3=path[_0x1c94('0x28')](__dirname,'tmp',rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d'));return convertFile(_0xb0c160,_0xa1d2d3);})['then'](function(){try{fs[_0x1c94('0x1e')](_0xb0c160);fs[_0x1c94('0x2b')](_0xa1d2d3,_0x1c94('0x3b'));}catch(_0x581a96){logger[_0x1c94('0x18')](_0x581a96);}return _0xa1d2d3[_0x1c94('0x3f')]('.')[0x0];});};exports[_0x1c94('0x7c')]=function(_0x78026c,_0x5201e0,_0x42828e,_0x36241c,_0x244d85,_0x44331f){return aws[_0x1c94('0x7d')](_0x78026c,_0x5201e0,_0x42828e,_0x36241c,_0x244d85,_0x44331f)[_0x1c94('0x2a')](function(_0xddf7b5){logger['info'](JSON[_0x1c94('0x45')](_0xddf7b5));return _0xddf7b5;});};exports[_0x1c94('0x7e')]=function(_0x288c18,_0xd3dff2,_0x18e745,_0x493d55){var _0x5d1959=util['format'](_0x1c94('0x7f'),ISPEECH_API,_0x288c18,encodeURIComponent(_0xd3dff2),_0x18e745,_0x493d55);var _0x3dc730=path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+'.mp3');var _0xf4dfce;return downloadFile(_0x5d1959,_0x3dc730)[_0x1c94('0x2a')](function(){_0xf4dfce=path['resolve'](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d'));return convertFile(_0x3dc730,_0xf4dfce);})[_0x1c94('0x2a')](function(){try{fs[_0x1c94('0x1e')](_0x3dc730);fs['chmodSync'](_0xf4dfce,_0x1c94('0x3b'));}catch(_0x26bc79){logger[_0x1c94('0x18')](_0x26bc79);}return _0xf4dfce[_0x1c94('0x3f')]('.')[0x0];});};exports['ispeechASR']=function(_0x16cf8f,_0x3d79c0,_0x335a70,_0x21832e){var _0x12160e=util[_0x1c94('0x80')](_0x1c94('0x81'),ISPEECH_API,_0x3d79c0,_0x335a70,base64Encode(_0x16cf8f),_0x21832e?util[_0x1c94('0x80')](_0x1c94('0x82'),encodeURIComponent(_0x21832e)):'freeform=3');return uploadFile(_0x12160e)[_0x1c94('0x2a')](function(_0x1c22b4){return querystring[_0x1c94('0x9')](_0x1c22b4);});};exports[_0x1c94('0x83')]=function(_0x4ebc1e,_0x1ca77a){return sestek['nda'](_0x4ebc1e,_0x1ca77a)[_0x1c94('0x2a')](function(_0x3674ea){logger['info'](JSON['stringify'](_0x3674ea));var _0x27ce8e={'speech':_0x3674ea['text'],'action':_0x3674ea[_0x1c94('0x84')]?_0x3674ea[_0x1c94('0x84')]['CustomAction']:undefined,'actiondata':_0x3674ea[_0x1c94('0x84')]?_0x3674ea[_0x1c94('0x84')][_0x1c94('0x85')]:undefined};if(_0x3674ea[_0x1c94('0x84')]&&_0x3674ea['channelData']['AudioFromTts']){return base64Decode(_0x3674ea['channelData'][_0x1c94('0x86')][_0x1c94('0x87')],path[_0x1c94('0x28')](__dirname,_0x1c94('0x29'),rs[_0x1c94('0x3c')](0x4)+_0x1c94('0x3d')))[_0x1c94('0x2a')](function(_0x42ca92){_0x27ce8e[_0x1c94('0x88')]=_0x42ca92;return _0x27ce8e;});}return _0x27ce8e;});};exports['dirName']=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 bc800f2..69c16da 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 _0xf8be=['./nda'];(function(_0x241b7c,_0x2adb55){var _0x34a587=function(_0x5a4114){while(--_0x5a4114){_0x241b7c['push'](_0x241b7c['shift']());}};_0x34a587(++_0x2adb55);}(_0xf8be,0x19c));var _0xef8b=function(_0x5df36e,_0x27b6ed){_0x5df36e=_0x5df36e-0x0;var _0x27dcaa=_0xf8be[_0x5df36e];return _0x27dcaa;};var nda=require(_0xef8b('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x3c09=['./nda','exports'];(function(_0x23fb2a,_0x172f30){var _0x7c867c=function(_0x5505dd){while(--_0x5505dd){_0x23fb2a['push'](_0x23fb2a['shift']());}};_0x7c867c(++_0x172f30);}(_0x3c09,0xaa));var _0x93c0=function(_0xfd5c71,_0x8bd14d){_0xfd5c71=_0xfd5c71-0x0;var _0x1ebb7a=_0x3c09[_0xfd5c71];return _0x1ebb7a;};var nda=require(_0x93c0('0x0'));module[_0x93c0('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 9b0956d..96413a9 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 _0x3360=['audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','url','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','AudioOutputSettings'];(function(_0x19d48b,_0xf68c66){var _0x2d3f1e=function(_0x156b57){while(--_0x156b57){_0x19d48b['push'](_0x19d48b['shift']());}};_0x2d3f1e(++_0xf68c66);}(_0x3360,0x1d7));var _0x0336=function(_0x1ea36d,_0x18b90c){_0x1ea36d=_0x1ea36d-0x0;var _0x55ec5a=_0x3360[_0x1ea36d];return _0x55ec5a;};'use strict';var rp=require(_0x0336('0x0'));var url=require(_0x0336('0x1'));var logger=require('../../../../../config/logger')('agi');module['exports']=function(_0x12fd21,_0x56bf8b){var _0x55df8b={'method':_0x0336('0x2'),'uri':url[_0x0336('0x3')](_0x56bf8b[_0x0336('0x4')],_0x0336('0x5')),'form':{'grant_type':_0x0336('0x6'),'username':_0x56bf8b['username'],'password':_0x56bf8b['password']},'json':!![]};return rp(_0x55df8b)[_0x0336('0x7')](function(_0x36a973){var _0x310327={'method':_0x0336('0x2'),'uri':url[_0x0336('0x3')](_0x56bf8b['ndassistant_url'],_0x0336('0x8')),'body':{'type':_0x56bf8b[_0x0336('0x9')]||_0x0336('0xa'),'channelId':'Nda','conversation':{'id':_0x12fd21[_0x0336('0xb')]},'from':{'id':_0x12fd21['callerid'],'name':_0x12fd21[_0x0336('0xc')]},'recipient':{'id':_0x12fd21[_0x0336('0xd')],'name':_0x12fd21[_0x0336('0xe')]},'text':_0x56bf8b[_0x0336('0xf')],'channelData':{}},'headers':{'Authorization':_0x0336('0x10')+_0x36a973['access_token']},'json':!![]};if(_0x56bf8b[_0x0336('0x11')]){_0x310327[_0x0336('0x12')][_0x0336('0x13')][_0x0336('0x14')]=_0x56bf8b[_0x0336('0x11')];}if(_0x56bf8b['ndagenerate_audio']=='1'){_0x310327[_0x0336('0x12')][_0x0336('0x13')][_0x0336('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0336('0x16')};}if(_0x56bf8b['custom_action']){_0x310327[_0x0336('0x12')]['channelData'][_0x0336('0x17')]=_0x56bf8b[_0x0336('0x18')];if(_0x56bf8b['custom_action_data']){_0x310327['body']['channelData'][_0x0336('0x19')]=_0x56bf8b[_0x0336('0x1a')];}}logger[_0x0336('0x1b')](JSON[_0x0336('0x1c')](_0x310327));return rp(_0x310327);});}; \ No newline at end of file +var _0x2e21=['ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','dnid','text','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2e21,0xba));var _0x12e2=function(_0x4c3c8b,_0x561dac){_0x4c3c8b=_0x4c3c8b-0x0;var _0x116208=_0x2e21[_0x4c3c8b];return _0x116208;};'use strict';var rp=require(_0x12e2('0x0'));var url=require(_0x12e2('0x1'));var logger=require(_0x12e2('0x2'))('agi');module[_0x12e2('0x3')]=function(_0x56d4f3,_0x261954){var _0x3bc460={'method':_0x12e2('0x4'),'uri':url[_0x12e2('0x5')](_0x261954[_0x12e2('0x6')],_0x12e2('0x7')),'form':{'grant_type':_0x12e2('0x8'),'username':_0x261954[_0x12e2('0x9')],'password':_0x261954[_0x12e2('0x8')]},'json':!![]};return rp(_0x3bc460)[_0x12e2('0xa')](function(_0x321e79){var _0x372494={'method':'POST','uri':url[_0x12e2('0x5')](_0x261954['ndassistant_url'],_0x12e2('0xb')),'body':{'type':_0x261954['ndaactivity_type']||_0x12e2('0xc'),'channelId':_0x12e2('0xd'),'conversation':{'id':_0x56d4f3[_0x12e2('0xe')]},'from':{'id':_0x56d4f3['callerid'],'name':_0x56d4f3[_0x12e2('0xf')]},'recipient':{'id':_0x56d4f3[_0x12e2('0x10')],'name':_0x56d4f3['extension']},'text':_0x261954[_0x12e2('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x321e79[_0x12e2('0x12')]},'json':!![]};if(_0x261954['project']){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x15')]=_0x261954[_0x12e2('0x16')];}if(_0x261954[_0x12e2('0x17')]=='1'){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x12e2('0x19')};}if(_0x261954['custom_action']){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x1a')]=_0x261954[_0x12e2('0x1b')];if(_0x261954[_0x12e2('0x1c')]){_0x372494[_0x12e2('0x13')][_0x12e2('0x14')][_0x12e2('0x1d')]=_0x261954[_0x12e2('0x1c')];}}logger[_0x12e2('0x1e')](JSON[_0x12e2('0x1f')](_0x372494));return rp(_0x372494);});}; \ 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 e4114f6..31099f0 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 _0x5fdb=['exports','./lib/api'];(function(_0x22b10b,_0xa2960f){var _0x10553b=function(_0x4510f6){while(--_0x4510f6){_0x22b10b['push'](_0x22b10b['shift']());}};_0x10553b(++_0xa2960f);}(_0x5fdb,0x1af));var _0xb5fd=function(_0xf59ed,_0x2a8386){_0xf59ed=_0xf59ed-0x0;var _0x1a5e75=_0x5fdb[_0xf59ed];return _0x1a5e75;};'use strict';var asr=require(_0xb5fd('0x0'));module[_0xb5fd('0x1')]=function(_0x5f3a70,_0x4e778d,_0x307b6d,_0x439f42){return asr(_0x5f3a70,_0x4e778d,_0x307b6d,_0x439f42);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x2a6a9a,_0x26237d,_0x9de0e4,_0x621492){return asr(_0x2a6a9a,_0x26237d,_0x9de0e4,_0x621492);}; \ 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 48191b9..d2048a9 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 _0x0203=['result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','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','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','digest','hex','unix','stringify','createReadStream','data','send','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status'];(function(_0x2020ea,_0x26fc4f){var _0x3657fe=function(_0x4cc17f){while(--_0x4cc17f){_0x2020ea['push'](_0x2020ea['shift']());}};_0x3657fe(++_0x26fc4f);}(_0x0203,0xcf));var _0x3020=function(_0x4d24ea,_0x91deb7){_0x4d24ea=_0x4d24ea-0x0;var _0x5de2fb=_0x0203[_0x4d24ea];return _0x5de2fb;};'use strict';var BPromise=require(_0x3020('0x0'));var _=require(_0x3020('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3020('0x2'));var crypto=require(_0x3020('0x3'));var logger=require('../../../../../../config/logger')(_0x3020('0x4'));module['exports']=function(_0x3a4bb5,_0xfe4434,_0x2d6a82,_0x1e9558){return new BPromise(function(_0x547d37,_0x2cc76c){logger[_0x3020('0x5')]('Tilde\x20URI',_0x1e9558||_0x3020('0x6'));var _0x5012f7=new WebSocket(_0x1e9558||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x38d42a='';var _0x322bf8='0';var _0x332aab='1';var _0xc21124=_0x3020('0x7');function _0x493210(_0x12eae5){var _0x3684ea=crypto['createHash']('sha1');_0x3684ea['update'](_0x12eae5);return _0x3684ea[_0x3020('0x8')](_0x3020('0x9'));}function _0x37037a(){try{logger[_0x3020('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x39da25=moment()[_0x3020('0xa')]();var _0xa17f11=_0x493210(_0x39da25+_0xfe4434+_0x2d6a82);_0x5012f7['send'](JSON[_0x3020('0xb')]({'appID':_0xfe4434,'timestamp':_0x39da25,'appKey':_0xa17f11}));var _0x2d0eb9=fs[_0x3020('0xc')](_0x3a4bb5);_0x2d0eb9['on'](_0x3020('0xd'),function(_0x185c47){_0x5012f7[_0x3020('0xe')](_0x185c47);});_0x2d0eb9['on'](_0x3020('0xf'),function(){_0x5012f7[_0x3020('0xe')](_0x3020('0x10'));});}catch(_0xad670){logger['error'](_0x3020('0x11'),JSON['stringify'](_0xad670));_0x5012f7[_0x3020('0x12')]();}}function _0x6d2b13(_0x4ecf31){try{if(_0x4ecf31){var _0x51f6ca=JSON[_0x3020('0x13')](_0x4ecf31);switch(_0x51f6ca[_0x3020('0x14')]){case 0x0:if(_0x51f6ca['result']){if(_0x51f6ca[_0x3020('0x15')][_0x3020('0x16')]){logger[_0x3020('0x5')](_0x3020('0x17'),JSON[_0x3020('0xb')](_0x51f6ca['result'][_0x3020('0x18')]));_0x38d42a=_0x51f6ca[_0x3020('0x15')][_0x3020('0x18')][0x0][_0x3020('0x19')];_0x322bf8=_0x51f6ca[_0x3020('0x15')][_0x3020('0x18')][0x0][_0x3020('0x1a')];_0x332aab='0';_0xc21124='Success.';_0x5012f7['terminate']();}}break;case 0x1:logger[_0x3020('0x5')](_0x3020('0x7'));_0x332aab='1';_0xc21124=_0x3020('0x7');break;case 0x2:logger[_0x3020('0x5')](_0x3020('0x1b'));_0x332aab='2';_0xc21124='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x3020('0x5')](_0x3020('0x1c'));_0x332aab='9';_0xc21124=_0x3020('0x1c');break;case 0xa:logger[_0x3020('0x5')](_0x3020('0x1d'));_0x332aab='10';_0xc21124=_0x3020('0x1d');break;case 0xb:logger[_0x3020('0x5')](_0x3020('0x1e'));_0x332aab='11';_0xc21124='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x425bee){logger[_0x3020('0x1f')](_0x3020('0x20'),JSON[_0x3020('0xb')](_0x425bee));_0x5012f7[_0x3020('0x12')]();}}function _0xacb384(){logger['info'](_0x3020('0x21'));_0x547d37({'transcript':_0x38d42a,'confidence':_0x322bf8,'status':_0x332aab,'status_message':_0xc21124});}function _0x4528b0(_0x537ab2){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3020('0x22')](_0x537ab2)){logger['error'](_[_0x3020('0x23')](_0x537ab2)?JSON[_0x3020('0xb')](_0x537ab2):_0x537ab2);}}_0x5012f7['on'](_0x3020('0x24'),_0x37037a);_0x5012f7['on'](_0x3020('0x25'),_0x6d2b13);_0x5012f7['on'](_0x3020('0xf'),_0xacb384);_0x5012f7['on'](_0x3020('0x1f'),_0x4528b0);});}; \ No newline at end of file +var _0x7c1c=['transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','close','../../../../../../config/logger','exports','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','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0x7c1c,0x180));var _0xc7c1=function(_0x435686,_0x105683){_0x435686=_0x435686-0x0;var _0x14e285=_0x7c1c[_0x435686];return _0x14e285;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xc7c1('0x0'))('agi');module[_0xc7c1('0x1')]=function(_0x2716f1,_0x3a183d,_0x573d3e,_0x1d8893){return new BPromise(function(_0x45bad7,_0x39d9f0){logger['info']('Tilde\x20URI',_0x1d8893||_0xc7c1('0x2'));var _0x40f678=new WebSocket(_0x1d8893||_0xc7c1('0x2'),{'perMessageDeflate':![]});var _0x4f3cfb='';var _0x157eae='0';var _0x34a91f='1';var _0x2e8691=_0xc7c1('0x3');function _0x4f1ace(_0x1bc1fa){var _0x404954=crypto['createHash']('sha1');_0x404954['update'](_0x1bc1fa);return _0x404954['digest']('hex');}function _0x4619ae(){try{logger[_0xc7c1('0x4')](_0xc7c1('0x5'));var _0x183804=moment()[_0xc7c1('0x6')]();var _0x175e04=_0x4f1ace(_0x183804+_0x3a183d+_0x573d3e);_0x40f678[_0xc7c1('0x7')](JSON[_0xc7c1('0x8')]({'appID':_0x3a183d,'timestamp':_0x183804,'appKey':_0x175e04}));var _0x10a29a=fs[_0xc7c1('0x9')](_0x2716f1);_0x10a29a['on'](_0xc7c1('0xa'),function(_0x2bd6b3){_0x40f678[_0xc7c1('0x7')](_0x2bd6b3);});_0x10a29a['on']('close',function(){_0x40f678[_0xc7c1('0x7')]('EOS');});}catch(_0x39ce12){logger[_0xc7c1('0xb')](_0xc7c1('0xc'),JSON['stringify'](_0x39ce12));_0x40f678[_0xc7c1('0xd')]();}}function _0x9a945e(_0x54f855){try{if(_0x54f855){var _0x344eda=JSON['parse'](_0x54f855);switch(_0x344eda[_0xc7c1('0xe')]){case 0x0:if(_0x344eda[_0xc7c1('0xf')]){if(_0x344eda[_0xc7c1('0xf')][_0xc7c1('0x10')]){logger[_0xc7c1('0x4')](_0xc7c1('0x11'),JSON[_0xc7c1('0x8')](_0x344eda[_0xc7c1('0xf')][_0xc7c1('0x12')]));_0x4f3cfb=_0x344eda[_0xc7c1('0xf')]['hypotheses'][0x0][_0xc7c1('0x13')];_0x157eae=_0x344eda['result'][_0xc7c1('0x12')][0x0]['likelihood'];_0x34a91f='0';_0x2e8691=_0xc7c1('0x14');_0x40f678['terminate']();}}break;case 0x1:logger[_0xc7c1('0x4')](_0xc7c1('0x3'));_0x34a91f='1';_0x2e8691=_0xc7c1('0x3');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x34a91f='2';_0x2e8691=_0xc7c1('0x15');break;case 0x9:logger[_0xc7c1('0x4')](_0xc7c1('0x16'));_0x34a91f='9';_0x2e8691=_0xc7c1('0x16');break;case 0xa:logger[_0xc7c1('0x4')](_0xc7c1('0x17'));_0x34a91f='10';_0x2e8691=_0xc7c1('0x17');break;case 0xb:logger[_0xc7c1('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x34a91f='11';_0x2e8691=_0xc7c1('0x18');}}}catch(_0x4226c9){logger[_0xc7c1('0xb')](_0xc7c1('0x19'),JSON[_0xc7c1('0x8')](_0x4226c9));_0x40f678['terminate']();}}function _0x1ff6f9(){logger['info'](_0xc7c1('0x1a'));_0x45bad7({'transcript':_0x4f3cfb,'confidence':_0x157eae,'status':_0x34a91f,'status_message':_0x2e8691});}function _0x4d97e3(_0xfd7d73){logger[_0xc7c1('0xb')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xc7c1('0x1b')](_0xfd7d73)){logger[_0xc7c1('0xb')](_['isObject'](_0xfd7d73)?JSON[_0xc7c1('0x8')](_0xfd7d73):_0xfd7d73);}}_0x40f678['on'](_0xc7c1('0x1c'),_0x4619ae);_0x40f678['on'](_0xc7c1('0x1d'),_0x9a945e);_0x40f678['on'](_0xc7c1('0x1e'),_0x1ff6f9);_0x40f678['on'](_0xc7c1('0xb'),_0x4d97e3);});}; \ 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 4bc92da..7fd69e9 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 _0x32df=['exports'];(function(_0x3278c5,_0x1b8a21){var _0x615b67=function(_0x32e07c){while(--_0x32e07c){_0x3278c5['push'](_0x3278c5['shift']());}};_0x615b67(++_0x1b8a21);}(_0x32df,0x195));var _0xf32d=function(_0x56de9d,_0x413b89){_0x56de9d=_0x56de9d-0x0;var _0x5b63fd=_0x32df[_0x56de9d];return _0x5b63fd;};var asr=require('./asr');module[_0xf32d('0x0')]={'asr':asr}; \ No newline at end of file +var _0x8aae=['exports','./asr'];(function(_0x369e42,_0x525644){var _0x51cc7f=function(_0x3a5a32){while(--_0x3a5a32){_0x369e42['push'](_0x369e42['shift']());}};_0x51cc7f(++_0x525644);}(_0x8aae,0x161));var _0xe8aa=function(_0x294568,_0xf2e70d){_0x294568=_0x294568-0x0;var _0x56c58d=_0x8aae[_0x294568];return _0x56c58d;};var asr=require(_0xe8aa('0x0'));module[_0xe8aa('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 2879300..0dbfca9 100644 --- a/server/services/agi/server.js +++ b/server/services/agi/server.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _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(_0x412165,_0x1a76e2){var _0x27c5c5=function(_0x390314){while(--_0x390314){_0x412165['push'](_0x412165['shift']());}};_0x27c5c5(++_0x1a76e2);}(_0x34e8,0x12c));var _0x834e=function(_0x2cf552,_0xb29256){_0x2cf552=_0x2cf552-0x0;var _0x526cb8=_0x34e8[_0x2cf552];return _0x526cb8;};'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 diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index de3e848..52521e0 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 _0x2c54=['aws_text_type','aws_lex_region','googleASR','tildeASR','appid','appsecret','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','split','replaceAll','extra','getAndSetVariable','result','setVariable','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','createSquareMessage','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','dialogflowV2_language','no\x20anguage\x20configured','bot','providerResponse','out','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','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','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','output','pause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','toLowerCase','macro','gosub','QUEUE','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','replace','sayNumber','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','getSquareProject','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','join','util','lodash','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','interval','map','format','getQueryOdbc','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','priority','dnid','file','uniqueid','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agent','error','agentUnpause','agentLogout','%s/%s@from-sip/n','shellCommand','exec','trim','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','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','headers','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c54,0x136));var _0x42c5=function(_0x4beb91,_0x583876){_0x4beb91=_0x4beb91-0x0;var _0x16d47e=_0x2c54[_0x4beb91];return _0x16d47e;};'use strict';var fs=require('fs');var util=require(_0x42c5('0x0'));var _=require(_0x42c5('0x1'));var sh=require(_0x42c5('0x2'));var odbc=require('odbc')();var rs=require(_0x42c5('0x3'));var moment=require(_0x42c5('0x4'));var Mustache=require(_0x42c5('0x5'));var rp=require(_0x42c5('0x6'));var logger=require(_0x42c5('0x7'))(_0x42c5('0x8'));var config=require('../../config/environment');var shared=require(_0x42c5('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x42c5('0xa'),_0x42c5('0xb')];var verticesWithRetry=[_0x42c5('0xc'),_0x42c5('0xd'),_0x42c5('0xe')];var AGIVertices=function(_0x4ce554,_0x21d563,_0x3ca4de){this[_0x42c5('0xf')]=_0x4ce554;this[_0x42c5('0x10')]=_0x21d563;this[_0x42c5('0x11')]=_0x3ca4de;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x13')]=function(_0x2390c7,_0x2b0167){this[_0x42c5('0x10')][_0x42c5('0x14')](_0x2390c7)[_0x42c5('0x15')](function(_0xb5c314){_0x2b0167(null,_0xb5c314?_0xb5c314[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x391716){_0x2b0167(_0x391716);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x1b1db5,_0xc17623){this[_0x42c5('0x10')][_0x42c5('0x18')](_0x1b1db5)['then'](function(_0x374218){_0xc17623(null,_0x374218?_0x374218[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x4efb1a){_0xc17623(_0x4efb1a);});};AGIVertices[_0x42c5('0x12')]['getSquareProject']=function(_0x48d227,_0x466b47){this['rpc']['getSquareProjectById'](_0x48d227)[_0x42c5('0x15')](function(_0x3a2115){_0x466b47(null,_0x3a2115?_0x3a2115[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x431f4e){_0x466b47(_0x431f4e);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x19')]=function(_0x34f31b,_0x29ca68){this[_0x42c5('0x10')][_0x42c5('0x1a')](_0x34f31b)[_0x42c5('0x15')](function(_0x11c6e8){_0x29ca68(null,_0x11c6e8?_0x11c6e8[_0x42c5('0x1b')]:![]);})['catch'](function(_0x102294){_0x29ca68(_0x102294);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1c')]=function(_0x56fc64,_0x245e72){this[_0x42c5('0x10')]['getUserById'](_0x56fc64)[_0x42c5('0x15')](function(_0xd577c8){_0x245e72(null,_0xd577c8?_0xd577c8[_0x42c5('0x16')]:![]);})[_0x42c5('0x17')](function(_0x119580){_0x245e72(_0x119580);});};AGIVertices[_0x42c5('0x12')]['getTrunk']=function(_0x2d319d,_0x5b61e4){this[_0x42c5('0x10')][_0x42c5('0x1d')](_0x2d319d)['then'](function(_0x44040a){_0x5b61e4(null,_0x44040a?_0x44040a['name']:![]);})[_0x42c5('0x17')](function(_0x45e9bf){_0x5b61e4(_0x45e9bf);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1e')]=function(_0x2cb126,_0x4431ff){var _0x4d852b=this;this[_0x42c5('0x10')]['getSoundById'](_0x2cb126)[_0x42c5('0x15')](function(_0x2daef6){_0x4431ff(null,_0x2daef6?_0x4d852b[_0x42c5('0x1f')](_0x2daef6[_0x42c5('0x20')]):![]);})['catch'](function(_0x5a3cd8){_0x4431ff(_0x5a3cd8);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x21')]=function(_0x55e7dd,_0x13daf0){this['rpc'][_0x42c5('0x22')](_0x55e7dd)['then'](function(_0x246575){_0x13daf0(null,_0x246575?_0x246575:![]);})[_0x42c5('0x17')](function(_0x8ca711){_0x13daf0(_0x8ca711);});};AGIVertices['prototype']['sendMailMessage']=function(_0x35ab1b,_0x449b36,_0x393321){this[_0x42c5('0x11')]['sendMailMessage'](_0x35ab1b,_0x449b36)['then'](function(){_0x393321(null);})[_0x42c5('0x17')](function(_0x389b1b){_0x393321(_0x389b1b);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x23')]=function(_0x401e62,_0x5b8e8e){this[_0x42c5('0x10')][_0x42c5('0x24')](_0x401e62)['then'](function(_0x3c1b0b){if(_0x3c1b0b){if(_0x3c1b0b['IntervalId']){_0x5b8e8e(null,[_0x3c1b0b[_0x42c5('0x25')]]);}else{_0x5b8e8e(null,_[_0x42c5('0x26')](_0x3c1b0b['Intervals'],'interval'));}}else{_0x5b8e8e(null,![]);}})['catch'](function(_0x541291){_0x5b8e8e(_0x541291);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1f')]=function(_0x10006e){return util[_0x42c5('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x10006e);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x28')]=function(_0x416198,_0x3d0146,_0x481202){odbc['open'](_0x416198,function(_0x2c4c8d){if(_0x2c4c8d){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2c4c8d);_0x481202(_0x2c4c8d);}else{logger['info'](_0x42c5('0x29'));odbc[_0x42c5('0x2a')](_0x3d0146,function(_0x35e1e7,_0xd81e49){if(_0x35e1e7){logger[_0x42c5('0x2b')](_0x42c5('0x2c'),_0x3d0146);_0x481202(_0x35e1e7);}else{logger[_0x42c5('0x2b')](_0x42c5('0x2d'),_0x3d0146);odbc[_0x42c5('0x2e')](function(_0x43ebce){if(_0x43ebce){logger['error'](_0x42c5('0x2f'),_0x43ebce);}_0x481202(null,_0xd81e49);});}});}});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x30')]=function(_0x1a6d9b,_0x355e4a){this['rpc'][_0x42c5('0x31')](_0x1a6d9b)['then'](function(_0x9692f1){_0x355e4a(null,_0x9692f1?_0x9692f1:![]);})[_0x42c5('0x17')](function(_0x116cbf){_0x355e4a(_0x116cbf);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x32')]=function(_0x462409,_0x356835){this[_0x42c5('0x10')][_0x42c5('0x32')](_0x462409)[_0x42c5('0x15')](function(_0x41c586){_0x356835(null,_0x41c586);})[_0x42c5('0x17')](function(_0x1b5079){_0x356835(_0x1b5079);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x33')]=function(_0x341aee,_0x166f2b,_0x187437){this[_0x42c5('0x10')][_0x42c5('0x33')]({'uniqueid':this[_0x42c5('0xf')]['uniqueid'],'node':_0x341aee[_0x42c5('0x34')],'application':_0x341aee[_0x42c5('0x35')],'data':_0x166f2b||null,'project_name':this['channel'][_0x42c5('0x36')],'callerid':this[_0x42c5('0xf')]['callerid']})[_0x42c5('0x15')](function(_0x4298d8){if(_0x187437){_0x187437(null,_0x4298d8);}})[_0x42c5('0x17')](function(_0x2e7e89){if(_0x187437){_0x187437(_0x2e7e89);}});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x37')]=function(_0x548a2a,_0x575a7e,_0x548f85,_0x45c6ed){this[_0x42c5('0x10')][_0x42c5('0x37')]({'uniqueid':this[_0x42c5('0xf')]['uniqueid'],'callerid':this['channel'][_0x42c5('0x38')],'calleridname':this[_0x42c5('0xf')][_0x42c5('0x39')],'context':this[_0x42c5('0xf')][_0x42c5('0x3a')],'extension':this['channel'][_0x42c5('0x3b')],'priority':this[_0x42c5('0xf')][_0x42c5('0x3c')],'accountcode':this[_0x42c5('0xf')]['accountcode'],'dnid':this[_0x42c5('0xf')][_0x42c5('0x3d')],'projectName':this[_0x42c5('0xf')][_0x42c5('0x36')],'saveName':_0x575a7e,'filename':_0x548a2a[_0x42c5('0x3e')]||_0x575a7e,'savePath':_0x548f85})[_0x42c5('0x15')](function(_0x4079a8){_0x45c6ed(null,_0x4079a8);})[_0x42c5('0x17')](function(_0x40496c){_0x45c6ed(_0x40496c);});};AGIVertices[_0x42c5('0x12')]['createSquareMessage']=function(_0x1b9e51,_0x473723,_0x175323,_0x5176d7,_0x2fd384){this[_0x42c5('0x10')]['createSquareMessage']({'uniqueid':this[_0x42c5('0xf')][_0x42c5('0x3f')],'body':_0x1b9e51,'direction':_0x473723,'providerName':_0x175323,'providerResponse':_0x5176d7})[_0x42c5('0x15')](function(_0x447922){if(_0x2fd384){_0x2fd384(null,_0x447922);}})['catch'](function(_0x41752f){if(_0x2fd384){_0x2fd384(_0x41752f);}});};AGIVertices[_0x42c5('0x12')]['createCmContact']=function(_0x4d676a,_0x30faa5){this[_0x42c5('0x10')]['createCmContact']({'firstName':_['isEmpty'](_0x4d676a['name'])||_[_0x42c5('0x40')](_0x4d676a['name'])?_0x42c5('0x41')+Math[_0x42c5('0x42')]():_0x4d676a[_0x42c5('0x16')],'lastName':_[_0x42c5('0x43')](_0x4d676a[_0x42c5('0x44')])||_[_0x42c5('0x40')](_0x4d676a[_0x42c5('0x44')])?null:_0x4d676a[_0x42c5('0x44')],'phone':_0x4d676a[_0x42c5('0x45')],'ListId':_0x4d676a[_0x42c5('0x46')],'scheduledat':_0x4d676a[_0x42c5('0x47')],'callbackUniqueid':this[_0x42c5('0xf')][_0x42c5('0x3f')],'tags':_0x42c5('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x4d676a[_0x42c5('0x47')][_0x42c5('0x49')](),'priority':_0x4d676a[_0x42c5('0x4a')]})[_0x42c5('0x15')](function(_0x21f4e1){_0x30faa5(null,_0x21f4e1);})[_0x42c5('0x17')](function(_0x3b00ee){_0x30faa5(_0x3b00ee);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x4b')]=function(_0x5206b3,_0x35b179){this[_0x42c5('0x10')][_0x42c5('0x4c')](_0x5206b3)[_0x42c5('0x15')](function(_0x476281){_0x35b179(null,_0x476281?_0x476281['name']:![]);})[_0x42c5('0x17')](function(_0x3a7a3f){_0x35b179(_0x3a7a3f);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x4d')]=function(_0x477f30,_0x1ca3f0,_0x19fa8b){var _0x43167b={'role':_0x42c5('0x4e')};_0x43167b[_0x477f30]=this['channel'][_0x42c5('0x38')];this['rpc'][_0x42c5('0x4d')](_0x43167b,_0x1ca3f0,this['channel']['uniqueid'])[_0x42c5('0x15')](function(_0x5e0647){_0x19fa8b(null,_[_0x42c5('0x40')](_0x5e0647)?![]:!![]);})['catch'](function(_0x41a33e){logger[_0x42c5('0x4f')](_0x41a33e);_0x19fa8b(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x21173c,_0xed290){var _0x17e0c0={'role':_0x42c5('0x4e')};_0x17e0c0[_0x21173c]=this[_0x42c5('0xf')][_0x42c5('0x38')];this[_0x42c5('0x10')][_0x42c5('0x50')](_0x17e0c0)[_0x42c5('0x15')](function(_0x15d325){_0xed290(null,_['isNil'](_0x15d325)?![]:!![]);})[_0x42c5('0x17')](function(_0x19bb6f){logger[_0x42c5('0x4f')](_0x19bb6f);_0xed290(null,![]);});};AGIVertices[_0x42c5('0x12')]['agentLogout']=function(_0x2ce9ae,_0x3b6b6f){var _0x27dd64={'role':_0x42c5('0x4e')};_0x27dd64[_0x2ce9ae]=this[_0x42c5('0xf')][_0x42c5('0x38')];this[_0x42c5('0x10')][_0x42c5('0x51')](_0x27dd64)[_0x42c5('0x15')](function(_0xd17953){_0x3b6b6f(null,_[_0x42c5('0x40')](_0xd17953)?![]:!![]);})[_0x42c5('0x17')](function(_0x17a0d9){logger[_0x42c5('0x4f')](_0x17a0d9);_0x3b6b6f(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x41dc2d,_0x217db6){var _0x3973d7={'role':'agent'};_0x3973d7[_0x41dc2d]=this[_0x42c5('0xf')][_0x42c5('0x38')];var _0x23f7e2=_0x41dc2d!='internal'?util[_0x42c5('0x27')](_0x42c5('0x52'),'LOCAL',this[_0x42c5('0xf')]['callerid']):undefined;this[_0x42c5('0x10')]['agentLogin'](_0x3973d7,_0x23f7e2)[_0x42c5('0x15')](function(_0x25caa5){_0x217db6(null,_['isNil'](_0x25caa5)?![]:!![]);})['catch'](function(_0x1f2122){logger[_0x42c5('0x4f')](_0x1f2122);_0x217db6(null,![]);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x53')]=function(_0x38429e,_0x5df2c3){sh[_0x42c5('0x54')](_[_0x42c5('0x55')](_0x38429e),function(_0x19e20b,_0x370f0b){var _0x3877da=_0x370f0b['replace'](/(\r\n|\n|\r)/gm,'');_0x5df2c3(null,_0x3877da);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x4f3cc8,_0x322542){scripts[_0x42c5('0x56')](_0x4f3cc8[_0x42c5('0x57')],_0x4f3cc8[_0x42c5('0x58')]||_0x42c5('0x59'),_0x4f3cc8[_0x42c5('0x59')],_0x4f3cc8[_0x42c5('0x5a')]||_0x42c5('0x5b'),_0x4f3cc8['ssmlGender']||_0x42c5('0x5c'),_0x4f3cc8[_0x42c5('0x5d')]||_0x42c5('0x5e'))[_0x42c5('0x15')](function(_0x4c83ec){_0x322542(null,_0x4c83ec);})[_0x42c5('0x17')](function(_0x33a2d1){_0x322542(_0x33a2d1);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x5f')]=function(_0x340e7,_0x4b23a5){scripts[_0x42c5('0x5f')](_0x340e7['text'],_0x340e7[_0x42c5('0x60')]||'en',0x1)[_0x42c5('0x15')](function(_0x1406a5){_0x4b23a5(null,_0x1406a5);})[_0x42c5('0x17')](function(_0x4da8d8){_0x4b23a5(_0x4da8d8);});};AGIVertices['prototype'][_0x42c5('0x61')]=function(_0x540ff6,_0x515d05){var _0x5279c1={'uri':_0x540ff6[_0x42c5('0x62')],'method':_0x540ff6[_0x42c5('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x540ff6[_0x42c5('0x64')])===_0x42c5('0x65')&&parseInt(_0x540ff6[_0x42c5('0x64')])>=0x1?parseInt(_0x540ff6['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x42c5('0x66')]([_0x42c5('0x67'),_0x42c5('0x68')],_0x5279c1[_0x42c5('0x63')][_0x42c5('0x69')]())){try{_0x5279c1[_0x42c5('0x6a')]=_0x540ff6[_0x42c5('0xb')]?JSON['parse'](_0x540ff6[_0x42c5('0xb')]):{};}catch(_0x31ad28){logger[_0x42c5('0x4f')](_0x42c5('0x6b'),_0x31ad28);}}try{_0x5279c1['headers']=_0x540ff6['rawHeaders']?JSON['parse'](_0x540ff6[_0x42c5('0xa')]):{};}catch(_0x22cc8c){logger['error'](_0x42c5('0x6c'),_0x22cc8c);}if(_0x540ff6['computedVariables']){try{var _0x409225=require(_0x540ff6['computedVariables'])[_0x42c5('0x6d')](this,_0x5279c1);_0x5279c1[_0x42c5('0x6e')]=Mustache[_0x42c5('0x6f')](_0x540ff6[_0x42c5('0x62')],_0x409225,{},['$$','$$']);if(_0x5279c1['headers']){_0x5279c1[_0x42c5('0x70')]=JSON[_0x42c5('0x71')](Mustache[_0x42c5('0x6f')](JSON[_0x42c5('0x72')](_0x5279c1['headers']),_0x409225,{},['$$','$$']));}if(_0x5279c1[_0x42c5('0x6a')]){_0x5279c1['body']=JSON['parse'](Mustache[_0x42c5('0x6f')](JSON['stringify'](_0x5279c1[_0x42c5('0x6a')]),_0x409225,{},['$$','$$']));}}catch(_0xc9ff20){logger[_0x42c5('0x4f')](_0x42c5('0x73'),_0xc9ff20);}}rp(_0x5279c1)['then'](function(_0x221fc9){var _0x1fa9e4={'statusCode':_0x221fc9[_0x42c5('0x74')]||0xc8,'statusMessage':_0x221fc9[_0x42c5('0x75')]||'OK','headers':_0x221fc9['headers']||{},'body':_0x221fc9['body']||{}};_0x515d05(null,_0x1fa9e4);})[_0x42c5('0x17')](function(_0x1336ff){var _0xa18694={'statusCode':_0x1336ff[_0x42c5('0x74')]||0x1f4,'statusMessage':_0x1336ff[_0x42c5('0x76')]||_0x42c5('0x77'),'headers':_0x1336ff[_0x42c5('0x78')]['headers']||{},'body':_0x1336ff[_0x42c5('0x78')]['body']||{}};_0x515d05(null,_0xa18694);});};AGIVertices[_0x42c5('0x12')]['googleDialogflow']=function(_0x1afe8e,_0x31ca80){scripts[_0x42c5('0x79')](this[_0x42c5('0xf')]['uniqueid'],_0x1afe8e['key'],_0x1afe8e[_0x42c5('0x59')],_0x1afe8e[_0x42c5('0x7a')]||'en')[_0x42c5('0x15')](function(_0x510df7){_0x31ca80(null,_0x510df7);})[_0x42c5('0x17')](function(_0x476ef4){_0x31ca80(_0x476ef4);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x2c3b6e,_0x3cc7e4){scripts[_0x42c5('0x7b')](this[_0x42c5('0xf')]['uniqueid'],_0x2c3b6e[_0x42c5('0x7c')],_0x2c3b6e[_0x42c5('0x7d')],_0x2c3b6e[_0x42c5('0x7e')],_0x2c3b6e[_0x42c5('0x59')],_0x2c3b6e['dialogflowV2_language']||'en')[_0x42c5('0x15')](function(_0x82d849){_0x3cc7e4(null,_0x82d849);})['catch'](function(_0x5a9a09){_0x3cc7e4(_0x5a9a09);});};AGIVertices[_0x42c5('0x12')]['sestekNDA']=function(_0x59bbeb,_0x21427c){scripts[_0x42c5('0x7f')](this[_0x42c5('0xf')],_0x59bbeb)[_0x42c5('0x15')](function(_0x3b85ee){_0x21427c(null,_0x3b85ee);})['catch'](function(_0xdf607d){_0x21427c(_0xdf607d);});};AGIVertices[_0x42c5('0x12')]['ispeechTTS']=function(_0x42a340,_0x2551b5){scripts[_0x42c5('0x80')](_0x42a340['key'],_0x42a340[_0x42c5('0x59')],_0x42a340[_0x42c5('0x81')]||_0x42c5('0x5b'),_0x42a340['speed'])['then'](function(_0x200bdc){_0x2551b5(null,_0x200bdc);})[_0x42c5('0x17')](function(_0x4e704c){_0x2551b5(_0x4e704c);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x82')]=function(_0x11fcdc,_0x56f840,_0x5ea013){scripts['ispeechASR'](_0x56f840,_0x11fcdc[_0x42c5('0x83')],_0x11fcdc['ispeech_asr_language']||_0x42c5('0x5b'),this[_0x42c5('0x84')](_0x11fcdc[_0x42c5('0x85')])?_0x11fcdc[_0x42c5('0x85')]:undefined)['then'](function(_0x31ed24){_0x5ea013(null,_0x31ed24);})[_0x42c5('0x17')](function(_0x10fe57){_0x5ea013(_0x10fe57);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x86')]=function(_0x5899a8,_0x2cd563){scripts[_0x42c5('0x86')](_0x5899a8[_0x42c5('0x87')],_0x5899a8[_0x42c5('0x88')],_0x5899a8[_0x42c5('0x89')],_0x5899a8['aws_polly_voice']||_0x42c5('0x8a'),_0x5899a8[_0x42c5('0x59')],_0x5899a8[_0x42c5('0x8b')]||_0x42c5('0x59'))['then'](function(_0x1ab396){_0x2cd563(null,_0x1ab396);})['catch'](function(_0x36c762){_0x2cd563(_0x36c762);});};AGIVertices['prototype']['awsLex']=function(_0x4c7e88,_0x48176e){scripts['awsLex'](this[_0x42c5('0xf')]['uniqueid'],_0x4c7e88[_0x42c5('0x87')],_0x4c7e88[_0x42c5('0x88')],_0x4c7e88[_0x42c5('0x8c')],_0x4c7e88[_0x42c5('0x59')],_0x4c7e88['aws_bot_name'])[_0x42c5('0x15')](function(_0x4fef84){_0x48176e(null,_0x4fef84);})[_0x42c5('0x17')](function(_0x370744){_0x48176e(_0x370744);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x8d')]=function(_0x54ff6b,_0x300de7,_0x37767f){scripts['googleASR'](_0x300de7,_0x54ff6b[_0x42c5('0x83')],_0x54ff6b['google_asr_language']||_0x42c5('0x5b'))[_0x42c5('0x15')](function(_0x303969){_0x37767f(null,_0x303969);})[_0x42c5('0x17')](function(_0x36b7fb){_0x37767f(_0x36b7fb);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x8e')]=function(_0x409299,_0x1a88fb,_0x1c3478){scripts[_0x42c5('0x8e')](_0x1a88fb,_0x409299[_0x42c5('0x8f')],_0x409299[_0x42c5('0x90')],_0x409299[_0x42c5('0x6e')])[_0x42c5('0x15')](function(_0x427ca7){_0x1c3478(null,_0x427ca7);})[_0x42c5('0x17')](function(_0xef2dfd){_0x1c3478(_0xef2dfd);});};AGIVertices[_0x42c5('0x12')][_0x42c5('0x91')]=function(_0x4fda3e){var _0x81e997=_[_0x42c5('0x66')](verticesWithRetry,_0x4fda3e[_0x42c5('0x35')])?_0x4fda3e:_['clone'](_0x4fda3e);for(var _0x1349ae in _0x81e997){if(_0x81e997[_0x42c5('0x92')](_0x1349ae)){if(_0x81e997[_0x1349ae]&&_[_0x42c5('0x93')](_0x81e997[_0x1349ae])){if(_['includes'](recursiveMapAttributes,_0x1349ae)){_0x81e997[_0x1349ae]=this[_0x42c5('0x94')](_0x81e997[_0x1349ae]);}else{_0x81e997[_0x1349ae]=this[_0x42c5('0x95')](_0x81e997[_0x1349ae]);}}}}return _0x81e997;};AGIVertices[_0x42c5('0x12')]['recursiveNodeIndex']=function(_0x15e565){for(var _0x541e09 in _0x15e565){if(_0x15e565[_0x42c5('0x92')](_0x541e09)){if(_[_0x42c5('0x96')](_0x15e565[_0x541e09])){this[_0x42c5('0x97')](_0x15e565[_0x541e09]);}else if(_['isArray'](_0x15e565[_0x541e09])){for(var _0x5e7c81=0x0;_0x5e7c81<_0x15e565[_0x541e09][_0x42c5('0x98')];_0x5e7c81++){this[_0x42c5('0x97')](_0x15e565[_0x541e09][_0x5e7c81]);}}else if(_[_0x42c5('0x93')](_0x15e565[_0x541e09])){_0x15e565[_0x541e09]=this[_0x42c5('0x95')](_0x15e565[_0x541e09]);}}}};AGIVertices[_0x42c5('0x12')]['saveRestApiResult']=function(_0x3dce9e,_0x388c4a){for(var _0x1b128b in _0x3dce9e){if(_0x3dce9e[_0x42c5('0x92')](_0x1b128b)){if(_[_0x42c5('0x96')](_0x3dce9e[_0x1b128b])){if(!_[_0x42c5('0x43')](_0x3dce9e[_0x1b128b])){this[_0x42c5('0x99')](_0x3dce9e[_0x1b128b],util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x388c4a,_0x1b128b));}}else if(_[_0x42c5('0x9b')](_0x3dce9e[_0x1b128b])){for(var _0x3cda12=0x0;_0x3cda12<_0x3dce9e[_0x1b128b][_0x42c5('0x98')];_0x3cda12++){this['saveRestApiResult'](_0x3dce9e[_0x1b128b][_0x3cda12],util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x388c4a,_0x1b128b+'['+_0x3cda12+']'));}}else{if(!_[_0x42c5('0x40')](_0x3dce9e[_0x1b128b])){this[_0x42c5('0xf')]['setVariable'](util['format'](_0x42c5('0x9a'),_0x388c4a,_0x1b128b),_0x3dce9e[_0x1b128b]);}}}}};AGIVertices['prototype'][_0x42c5('0x94')]=function(_0x5dbe70){try{var _0x7951f1=JSON[_0x42c5('0x71')](_0x5dbe70);this['recursiveNodeIndex'](_0x7951f1);return JSON[_0x42c5('0x72')](_0x7951f1);}catch(_0x3b2835){return this[_0x42c5('0x95')](_0x5dbe70);}};AGIVertices[_0x42c5('0x12')][_0x42c5('0x95')]=function(_0x1a920d){var _0x1dcd1f=_0x1a920d[_0x42c5('0x9c')]('{');for(var _0xaf385e=0x1;_0xaf385e<_0x1dcd1f[_0x42c5('0x98')];_0xaf385e+=0x1){var _0x6a5d6e=_0x1dcd1f[_0xaf385e]['split']('}');if(_0x6a5d6e[_0x42c5('0x98')]>0x1){_0x1a920d=_0x1a920d[_0x42c5('0x9d')]('{'+_0x6a5d6e[0x0]+'}',this[_0x42c5('0xf')][_0x42c5('0x13')](_0x6a5d6e[0x0])[_0x42c5('0x9e')]||_0x6a5d6e[0x0]);}}if(_0x1dcd1f[_0x42c5('0x98')]===0x1){return _0x1a920d[_0x42c5('0x49')]();}return this[_0x42c5('0x95')](_0x1a920d);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x9f')]=function(_0x5c9d6c,_0x41e4b7){var _0x2e85bb=this[_0x42c5('0xf')][_0x42c5('0x13')](_0x5c9d6c);if(_0x2e85bb[_0x42c5('0xa0')]===-0x1){return _0x2e85bb;}logger[_0x42c5('0x2b')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x41e4b7,_0x2e85bb[_0x42c5('0x9e')]));return this['channel'][_0x42c5('0xa1')](_0x41e4b7,_0x2e85bb[_0x42c5('0x9e')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x84')]=function(_0x301664){return _0x301664&&_0x301664!=='0'&&_0x301664!=='-1'&&_0x301664!=='';};AGIVertices[_0x42c5('0x12')][_0x42c5('0xa2')]=function(_0x64d616){this['createSquareDetailsReport'][_0x42c5('0x6d')](this,_0x64d616,'-');_0x64d616[_0x42c5('0xa3')]=_0x64d616[_0x42c5('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x42c5('0xa4')]=function(_0x47fa36){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xa5'),_0x47fa36[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x47fa36[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xa7'));}var _0x11c4e2='\x22'+_0x47fa36[_0x42c5('0x59')]+'\x22';if(this[_0x42c5('0x84')](_0x47fa36[_0x42c5('0x78')])){_0x11c4e2+=','+_0x47fa36[_0x42c5('0x78')];}var _0x1fa71e=this[_0x42c5('0xf')][_0x42c5('0x54')]('MRCPSynth',_0x11c4e2);if(_0x1fa71e['result']===-0x1){return _0x1fa71e;}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x11c4e2));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xa8')]=function(_0x4b4df2){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xa9'),_0x4b4df2[_0x42c5('0x34')]));if(!this['isConfigured'](_0x4b4df2['grammar'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xaa'));}var _0x46bf1b=_0x4b4df2[_0x42c5('0xab')];if(this[_0x42c5('0x84')](_0x4b4df2[_0x42c5('0x78')])){_0x46bf1b+=','+_0x4b4df2[_0x42c5('0x78')];}var _0x55ecd7=this['channel'][_0x42c5('0x54')](_0x42c5('0xac'),_0x46bf1b);if(_0x55ecd7[_0x42c5('0xa0')]===-0x1){return _0x55ecd7;}var _0x10a2c2=this[_0x42c5('0x9f')](_0x42c5('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x10a2c2[_0x42c5('0xa0')]===-0x1){return _0x10a2c2;}var _0x3aa679=this[_0x42c5('0x9f')](_0x42c5('0xae'),_0x42c5('0xaf'));if(_0x3aa679[_0x42c5('0xa0')]===-0x1){return _0x3aa679;}var _0x3aab6d=this[_0x42c5('0x9f')]('RECOG_INSTANCE()',_0x42c5('0xb0'));if(_0x3aab6d['result']===-0x1){return _0x3aab6d;}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0xb1'),_0x46bf1b));};AGIVertices['prototype']['agi']=function(_0x10bdb5){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xb2'),_0x10bdb5['label']));return this[_0x42c5('0xf')]['agi']([_0x10bdb5['command'],_0x10bdb5[_0x42c5('0xb3')]]);};AGIVertices[_0x42c5('0x12')]['answer']=function(_0x2f22fa){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2f22fa[_0x42c5('0x34')]));if(this[_0x42c5('0x84')](_0x2f22fa['timeout'])){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xb4'),_0x2f22fa[_0x42c5('0x64')]));var _0x3a9b85=this['channel'][_0x42c5('0xb5')](_0x2f22fa[_0x42c5('0x64')]);if(_0x3a9b85[_0x42c5('0xa0')]===-0x1){return _0x3a9b85;}}return this[_0x42c5('0xf')][_0x42c5('0xb6')]();};AGIVertices[_0x42c5('0x12')]['callback']=function(_0x3086f8){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xb7'),_0x3086f8['label']));if(!this[_0x42c5('0x84')](_0x3086f8[_0x42c5('0x46')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3086f8,'no\x20list\x20selected');}_0x3086f8[_0x42c5('0x47')]=moment();if(this[_0x42c5('0x84')](_0x3086f8[_0x42c5('0xb8')])){_0x3086f8[_0x42c5('0x47')]=moment()['add'](_0x3086f8['delay'],_0x42c5('0xb9'));}if(!this[_0x42c5('0x84')](_0x3086f8[_0x42c5('0x4a')])){_0x3086f8['callback_priority']=0x2;}this[_0x42c5('0xba')][_0x42c5('0x6d')](this,_0x3086f8);return this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbb'),_0x3086f8[_0x42c5('0x45')],_0x3086f8[_0x42c5('0x46')],_0x3086f8[_0x42c5('0x47')]));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xbc')]=function(_0x65fe4c){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xbd'),_0x65fe4c[_0x42c5('0x34')]));var _0x3fcd58=this[_0x42c5('0xf')]['exec'](_0x65fe4c['application'],_0x65fe4c['options']);if(_0x3fcd58[_0x42c5('0xa0')]===-0x1){return _0x3fcd58;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),_0x65fe4c[_0x42c5('0xbf')],_0x65fe4c[_0x42c5('0x78')]));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xc0')]=function(_0x21f894){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xc1'),_0x21f894[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x21f894[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xa7'));}var _0x4f849f='\x22'+_0x21f894[_0x42c5('0x59')]+'\x22';if(this[_0x42c5('0x84')](_0x21f894['options'])){_0x4f849f+=','+_0x21f894['options'];}var _0x1237dc=this[_0x42c5('0xf')][_0x42c5('0x54')](_0x42c5('0xc2'),_0x4f849f);if(_0x1237dc[_0x42c5('0xa0')]===-0x1){return _0x1237dc;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xc3'),_0x4f849f));};AGIVertices[_0x42c5('0x12')]['sestektts']=function(_0x15e577){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x15e577[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x15e577[_0x42c5('0x59')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}var _0x284b3e='\x22'+_0x15e577[_0x42c5('0x59')]+'\x22';if(this['isConfigured'](_0x15e577[_0x42c5('0x78')])){_0x284b3e+=','+_0x15e577[_0x42c5('0x78')];}var _0x1d6b63=this[_0x42c5('0xf')][_0x42c5('0x54')](_0x42c5('0xc2'),_0x284b3e);if(_0x1d6b63[_0x42c5('0xa0')]===-0x1){return _0x1d6b63;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x284b3e));};AGIVertices['prototype']['lumenvoxasr']=function(_0x29f479){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xc4'),_0x29f479[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x29f479[_0x42c5('0xab')])){return this[_0x42c5('0xf')]['noop'](_0x42c5('0xaa'));}var _0xb09743=_0x29f479[_0x42c5('0xab')];if(this[_0x42c5('0x84')](_0x29f479[_0x42c5('0x78')])){_0xb09743+=','+_0x29f479[_0x42c5('0x78')];}var _0x5aab70=this[_0x42c5('0xf')]['exec'](_0x42c5('0xac'),_0xb09743);if(_0x5aab70[_0x42c5('0xa0')]===-0x1){return _0x5aab70;}var _0x3e365a=this[_0x42c5('0x9f')]('RECOG_CONFIDENCE()',_0x42c5('0xc5'));if(_0x3e365a['result']===-0x1){return _0x3e365a;}var _0x5a043f=this[_0x42c5('0x9f')](_0x42c5('0xae'),_0x42c5('0xc6'));if(_0x5a043f[_0x42c5('0xa0')]===-0x1){return _0x5a043f;}var _0x2e202a=this[_0x42c5('0x9f')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x2e202a[_0x42c5('0xa0')]===-0x1){return _0x2e202a;}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0xb1'),_0xb09743));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xc7')]=function(_0x493029){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xc8'),_0x493029['label']));if(!this[_0x42c5('0x84')](_0x493029[_0x42c5('0xab')])){return this['channel']['noop'](_0x42c5('0xaa'));}var _0x3f8195=_0x493029[_0x42c5('0xab')];if(this[_0x42c5('0x84')](_0x493029['options'])){_0x3f8195+=','+_0x493029[_0x42c5('0x78')];}var _0x150b1e=this[_0x42c5('0xf')][_0x42c5('0x54')]('MRCPRecog',_0x3f8195);if(_0x150b1e[_0x42c5('0xa0')]===-0x1){return _0x150b1e;}var _0x1b79b0=this[_0x42c5('0x9f')]('RECOG_CONFIDENCE()',_0x42c5('0xc9'));if(_0x1b79b0[_0x42c5('0xa0')]===-0x1){return _0x1b79b0;}var _0x5430f0=this[_0x42c5('0x9f')](_0x42c5('0xae'),_0x42c5('0xca'));if(_0x5430f0['result']===-0x1){return _0x5430f0;}var _0x243fab=this[_0x42c5('0x9f')](_0x42c5('0xcb'),_0x42c5('0xcc'));if(_0x243fab[_0x42c5('0xa0')]===-0x1){return _0x243fab;}return this['channel']['noop'](util[_0x42c5('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3f8195));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xcd')]=function(_0x1e077d){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xce'),_0x1e077d[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x1e077d[_0x42c5('0xcf')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1e077d,_0x42c5('0xd0'));}var _0x15710b=this[_0x42c5('0x19')][_0x42c5('0x6d')](this,_0x1e077d[_0x42c5('0xcf')]);if(!_0x15710b){return this[_0x42c5('0xf')]['error'](_0x1e077d,_0x42c5('0xd1'));}if(!this[_0x42c5('0x84')](_0x1e077d[_0x42c5('0x2a')])){return this['channel'][_0x42c5('0x4f')](_0x1e077d,_0x42c5('0xd2'));}var _0xeacbb3=_0x1e077d[_0x42c5('0x2a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('query:\x20%s',_0xeacbb3));var _0x563a47=this[_0x42c5('0x28')][_0x42c5('0x6d')](this,_0x15710b,_0xeacbb3);this['createSquareDetailsReport'][_0x42c5('0x6d')](this,_0x1e077d,_0xeacbb3);if(!this[_0x42c5('0x84')](_0x1e077d[_0x42c5('0xd3')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xd4'));}var _0x3f5639=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x1e077d[_0x42c5('0xd3')]);if(!_0x3f5639){return this['channel'][_0x42c5('0x4f')](_0x1e077d,_0x42c5('0xd5'));}var _0x21b396=this;_0x563a47[_0x42c5('0xd6')](function(_0x2c7a2f,_0x4e21a6){Object['keys'](_0x2c7a2f)['forEach'](function(_0x1f29b8){_0x21b396[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')]('%s[%s][%s]',_0x3f5639,_0x4e21a6,_0x1f29b8),_0x2c7a2f[_0x1f29b8]);});});this[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0xd7'),_0x3f5639),_0x563a47[_0x42c5('0x98')]);return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xd8'),_0x3f5639));};AGIVertices['prototype'][_0x42c5('0xd9')]=function(_0x3a92c8){logger['debug'](util[_0x42c5('0x27')](_0x42c5('0xda'),_0x3a92c8[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x3a92c8[_0x42c5('0xdb')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3a92c8,'no\x20user\x20selected');}var _0x394de2=this[_0x42c5('0x1c')][_0x42c5('0x6d')](this,_0x3a92c8['sip_id']);if(!_0x394de2){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3a92c8,_0x42c5('0xdc'));}var _0x584c8a=this['channel'][_0x42c5('0x54')]('DIAL',[util[_0x42c5('0x27')](_0x42c5('0xdd'),_0x394de2),_0x3a92c8[_0x42c5('0x64')],_0x3a92c8[_0x42c5('0xde')],_0x3a92c8[_0x42c5('0x62')]]);if(_0x584c8a[_0x42c5('0xa0')]===-0x1){return _0x584c8a;}return this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0xdf'),_0x42c5('0xe0')));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xe1')]=function(_0x5af68e){logger['info'](util[_0x42c5('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5af68e['label']));if(!this['isConfigured'](_0x5af68e['key'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20key\x20configured');}if(!this[_0x42c5('0x84')](_0x5af68e[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20text\x20configured');}this['channel']['bot']=!![];this[_0x42c5('0x33')](_0x5af68e);this[_0x42c5('0xe2')](_0x5af68e[_0x42c5('0x59')],'in','','');this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xe3'),_0x5af68e['text']));var _0x3aa43c=this[_0x42c5('0x79')][_0x42c5('0x6d')](this,_0x5af68e);if(_0x3aa43c){for(var _0x2d6a61 in _0x3aa43c){if(_0x3aa43c['hasOwnProperty'](_0x2d6a61)){this['channel'][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0xe4'),_0x2d6a61[_0x42c5('0x69')]()),_0x3aa43c[_0x2d6a61]);}}this[_0x42c5('0xe2')](_0x3aa43c['speech'],'out','dialogflow','');return this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0xe5'),_0x3aa43c[_0x42c5('0xe6')]));}return this['channel'][_0x42c5('0x4f')](_0x5af68e,_0x42c5('0xe7'));};AGIVertices['prototype'][_0x42c5('0xe8')]=function(_0x993cee){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0xe9'),_0x993cee[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x993cee[_0x42c5('0x7c')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x993cee[_0x42c5('0x7d')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xea'));}if(!this[_0x42c5('0x84')](_0x993cee[_0x42c5('0x7e')])){return this[_0x42c5('0xf')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x993cee[_0x42c5('0xeb')])){return this[_0x42c5('0xf')]['noop'](_0x42c5('0xec'));}if(!this[_0x42c5('0x84')](_0x993cee['text'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')][_0x42c5('0xed')]=!![];this[_0x42c5('0x33')](_0x993cee);this[_0x42c5('0xe2')](_0x993cee['text'],'in','','');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Trying\x20DialogflowV2:\x20%s',_0x993cee[_0x42c5('0x59')]));var _0xff0a6b=this[_0x42c5('0x7b')]['sync'](this,_0x993cee);if(_0xff0a6b){for(var _0x4b854a in _0xff0a6b){if(_0xff0a6b[_0x42c5('0x92')](_0x4b854a)){if(_0x4b854a!==_0x42c5('0xee')){this[_0x42c5('0xf')]['setVariable'](util[_0x42c5('0x27')]('DIALOGFLOW_%s',_0x4b854a[_0x42c5('0x69')]()),_0xff0a6b[_0x4b854a]);}}}this[_0x42c5('0xe2')](_0xff0a6b['speech'],_0x42c5('0xef'),_0x42c5('0xe8'),_0xff0a6b['providerResponse']);return this['channel'][_0x42c5('0xa6')](util['format']('DialogflowV2\x20Result\x20%s',_0xff0a6b['speech']));}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x993cee,_0x42c5('0xf0'));};AGIVertices['prototype'][_0x42c5('0xf1')]=function(_0x4181b2){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xf2'),_0x4181b2[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x4181b2['ndauth_url'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xf3'));}if(!this[_0x42c5('0x84')](_0x4181b2['username'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xf4'));}if(!this[_0x42c5('0x84')](_0x4181b2['password'])){return this[_0x42c5('0xf')]['noop']('no\x20password\x20configured');}if(!this[_0x42c5('0x84')](_0x4181b2[_0x42c5('0xf5')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')]['bot']=!![];this['createSquareDetailsReport'](_0x4181b2);this[_0x42c5('0xe2')](_0x4181b2[_0x42c5('0x59')],'in','','');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xf6'),_0x4181b2['text']));var _0xbdccd0=this['sestekNDA'][_0x42c5('0x6d')](this,_0x4181b2);if(_0xbdccd0){for(var _0x281bd8 in _0xbdccd0){if(_0xbdccd0[_0x42c5('0x92')](_0x281bd8)){this[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0xf7'),_0x281bd8[_0x42c5('0x69')]()),_0xbdccd0[_0x281bd8]);}}this[_0x42c5('0xe2')](_0xbdccd0[_0x42c5('0xe6')],_0x42c5('0xef'),_0x42c5('0xf1'),'');if(_0xbdccd0[_0x42c5('0xf8')]){this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Sestek\x20NDA\x20%s\x20file\x20created',_0xbdccd0[_0x42c5('0xf8')]));var _0x294f75=this[_0x42c5('0xf')][_0x42c5('0xf9')](_0xbdccd0['audiofile']);try{fs[_0x42c5('0xfa')](_0xbdccd0[_0x42c5('0xf8')]+_0x42c5('0xfb'));}catch(_0x1a35aa){logger[_0x42c5('0x4f')](_0x1a35aa);}return _0x294f75;}else{return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0xfc'),_0xbdccd0[_0x42c5('0xe6')]));}}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x4181b2,_0x42c5('0xfd'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xfe')]=function(_0x200317){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0xff'),_0x200317['label']));return this['channel'][_0x42c5('0xa6')](_0x42c5('0xfe'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x100')]=function(_0x400d14){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x101'),_0x400d14[_0x42c5('0x34')]));var _0x479b72='';if(_0x400d14[_0x42c5('0x102')]){if(!this[_0x42c5('0x84')](_0x400d14[_0x42c5('0x102')])){return this['channel'][_0x42c5('0x4f')](_0x400d14,_0x42c5('0x103'));}else{var _0x17c5f6=parseInt(_0x400d14[_0x42c5('0x102')],0xa);if(isNaN(_0x17c5f6)){_0x479b72=_0x400d14[_0x42c5('0x102')];}else{_0x479b72=this[_0x42c5('0x104')][_0x42c5('0x6d')](this,_0x400d14[_0x42c5('0x102')]);if(!_0x479b72){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x400d14,_0x42c5('0x105'));}}}}else if(_0x400d14[_0x42c5('0x106')]){_0x479b72=_0x400d14[_0x42c5('0x106')];}else{return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x400d14,_0x42c5('0x103'));}var _0x3fe881=this['channel'][_0x42c5('0x54')](_0x42c5('0xe0'),[util[_0x42c5('0x27')](_0x42c5('0x107'),_0x479b72,_0x400d14['phone']),_0x400d14['timeout'],_0x400d14[_0x42c5('0xde')],_0x400d14['url']]);if(_0x3fe881[_0x42c5('0xa0')]===-0x1){return _0x3fe881;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xdf'),_0x42c5('0xe0')));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x108')]=function(_0x200983){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x109'),_0x200983['label']));return this['channel']['noop'](_0x42c5('0x108'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0xd')]=function(_0x11d4f1){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x11d4f1['label']));if(_0x11d4f1['retry']===0x0){return this['maxRetry'](_0x11d4f1);}_0x11d4f1[_0x42c5('0xa3')]-=0x1;if(!this[_0x42c5('0x84')](_0x11d4f1[_0x42c5('0x10a')])){return this['channel'][_0x42c5('0x4f')](_0x11d4f1,_0x42c5('0x10b'));}var _0x8d0db0=this['getSound'][_0x42c5('0x6d')](this,_0x11d4f1[_0x42c5('0x10a')]);if(!_0x8d0db0){return this['channel'][_0x42c5('0x4f')](_0x11d4f1,_0x42c5('0x10c'));}if(!this['isConfigured'](_0x11d4f1[_0x42c5('0xd3')])){return this[_0x42c5('0xf')]['error'](_0x42c5('0xd4'));}var _0x22f4d7=this[_0x42c5('0xf')][_0x42c5('0x10d')](_0x8d0db0,_0x11d4f1['response'],_0x11d4f1[_0x42c5('0x10e')]);var _0x2d8b43=_0x22f4d7[_0x42c5('0xa0')]?_0x22f4d7[_0x42c5('0xa0')][_0x42c5('0x49')]():'';logger[_0x42c5('0x2b')](_0x42c5('0x10f'),JSON[_0x42c5('0x72')](_0x22f4d7));if(_0x22f4d7[_0x42c5('0xa0')]===-0x1){this[_0x42c5('0x33')]['sync'](this,_0x11d4f1,_0x2d8b43);return _0x22f4d7;}else if(_0x22f4d7[_0x42c5('0x9e')]==='timeout'){_0x22f4d7[_0x42c5('0xa0')]=_0x2d8b43[_0x42c5('0x98')]>=parseInt(_0x11d4f1[_0x42c5('0x110')])?'x':'i';}else{_0x22f4d7[_0x42c5('0xa0')]=_0x2d8b43[_0x42c5('0x98')]>=parseInt(_0x11d4f1[_0x42c5('0x110')])&&_0x2d8b43[_0x42c5('0x98')]<=parseInt(_0x11d4f1[_0x42c5('0x10e')])?'x':'i';}var _0x33dee6=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x11d4f1[_0x42c5('0xd3')]);if(!_0x33dee6){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x11d4f1,_0x42c5('0xd5'));}this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x33dee6,_0x2d8b43);if(this[_0x42c5('0x84')](_0x11d4f1[_0x42c5('0x111')])){var _0x36a335=parseInt(_0x11d4f1[_0x42c5('0x111')],0xa);var _0x108c62=rs[_0x42c5('0x112')]({'charset':'*','length':_0x36a335});var _0x1fa87d=_0x2d8b43['length'];if(_0x1fa87d>0x0){if(_0x1fa87d>_0x36a335){this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x11d4f1,_0x11d4f1[_0x42c5('0x113')]===_0x42c5('0x114')?_0x108c62+_0x2d8b43[_0x42c5('0x115')](_0x36a335):_0x2d8b43[_0x42c5('0x115')](0x0,_0x1fa87d-_0x36a335)+_0x108c62);}else{this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x11d4f1,rs[_0x42c5('0x112')]({'charset':'*','length':_0x1fa87d}));}}else{this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x11d4f1,'');}}else{this['createSquareDetailsReport'][_0x42c5('0x6d')](this,_0x11d4f1,_0x2d8b43);}return _0x22f4d7;};AGIVertices[_0x42c5('0x12')][_0x42c5('0xe')]=function(_0x255345){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x255345['label']));return this[_0x42c5('0xd')](_0x255345);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x116')]=function(_0x4cf756){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x117'),_0x4cf756[_0x42c5('0x34')]));this[_0x42c5('0x33')]['sync'](this,_0x4cf756,_0x4cf756[_0x42c5('0x118')]);return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x119'),_0x4cf756[_0x42c5('0x118')]));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x11a')]=function(_0x5bf7bb){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x11b'),_0x5bf7bb[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x5bf7bb[_0x42c5('0x87')])||!this[_0x42c5('0x84')](_0x5bf7bb['aws_secret_access_key'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x11c'));}if(!this[_0x42c5('0x84')](_0x5bf7bb[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')]('no\x20text\x20configured');}this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x11d'),_0x5bf7bb[_0x42c5('0x59')]));var _0x44ac59=this[_0x42c5('0x86')][_0x42c5('0x6d')](this,_0x5bf7bb);if(_0x44ac59){this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x11e'),_0x44ac59));var _0x3ea9a0=this[_0x42c5('0xf')][_0x42c5('0xf9')](_0x44ac59);try{fs[_0x42c5('0xfa')](_0x44ac59+_0x42c5('0xfb'));}catch(_0x363693){logger['error'](_0x363693);}return _0x3ea9a0;}return this[_0x42c5('0xf')]['error'](_0x5bf7bb,_0x42c5('0x11f'));};AGIVertices['prototype'][_0x42c5('0x120')]=function(_0x4afd24){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x4afd24[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x4afd24[_0x42c5('0x87')])||!this[_0x42c5('0x84')](_0x4afd24['aws_secret_access_key'])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x42c5('0x84')](_0x4afd24[_0x42c5('0x121')])){return this['channel'][_0x42c5('0xa6')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x4afd24['text'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this['channel'][_0x42c5('0xed')]=!![];this[_0x42c5('0x33')](_0x4afd24);this[_0x42c5('0xe2')](_0x4afd24[_0x42c5('0x59')],'in','','');this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x122'),_0x4afd24['text']));var _0x500a78=this[_0x42c5('0x123')][_0x42c5('0x6d')](this,_0x4afd24);if(_0x500a78){for(var _0x816c76 in _0x500a78){if(_0x500a78['hasOwnProperty'](_0x816c76)&&_['isString'](_0x500a78[_0x816c76])){this[_0x42c5('0xf')][_0x42c5('0xa1')](util[_0x42c5('0x27')](_0x42c5('0x124'),_0x816c76[_0x42c5('0x69')]()),_0x500a78[_0x816c76]);}}if(_[_0x42c5('0x40')](_0x500a78['message'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x125'));}else{this[_0x42c5('0xe2')](_0x500a78[_0x42c5('0x76')],_0x42c5('0xef'),'amazonlex','');return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x126'),_0x500a78['message']));}}return this['channel'][_0x42c5('0x4f')](_0x4afd24,_0x42c5('0x127'));};AGIVertices['prototype'][_0x42c5('0x128')]=function(_0xc9c530){logger['info'](util['format'](_0x42c5('0x129'),_0xc9c530['label'],_0xc9c530[_0x42c5('0x64')]));if(!this[_0x42c5('0x84')](_0xc9c530['key'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x12a'));}var _0x2cb800=_0x42c5('0x12b');var _0x1de79=util[_0x42c5('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x42c5('0x112')](0x4));var _0xf53f5a=util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x1de79,_0x2cb800);var _0x46753e=!![];if(_0xc9c530[_0x42c5('0x12c')]===_0x42c5('0x12d')){_0x46753e=![];}var _0x437c2f=this[_0x42c5('0xf')][_0x42c5('0x12e')](_0x1de79,_0x2cb800,_0xc9c530[_0x42c5('0x12f')],_0xc9c530[_0x42c5('0x64')],undefined,_0x46753e);if(_0x437c2f[_0x42c5('0xa0')]!==-0x1){this['channel']['noop'](util[_0x42c5('0x27')](_0x42c5('0x130'),_0xf53f5a));var _0x5a465b=this[_0x42c5('0x8d')]['sync'](this,_0xc9c530,_0xf53f5a);if(_0x5a465b){for(var _0x5cf4cc in _0x5a465b){if(_0x5a465b[_0x42c5('0x92')](_0x5cf4cc)){this[_0x42c5('0xf')][_0x42c5('0xa1')](util['format'](_0x42c5('0x131'),_0x5cf4cc[_0x42c5('0x69')]()),_0x5a465b[_0x5cf4cc]);}}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0x42c5('0x72')](_0x5a465b)));}}return _0x437c2f;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x132')]=function(_0x45e313){logger['info'](util['format'](_0x42c5('0x133'),_0x45e313[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x45e313[_0x42c5('0x8f')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x134'));}if(!this[_0x42c5('0x84')](_0x45e313[_0x42c5('0x90')])){return this['channel'][_0x42c5('0xa6')]('no\x20appsecret\x20configured');}var _0x11c7ee=_0x42c5('0x12b');var _0x220f40=util[_0x42c5('0x27')](_0x42c5('0x135'),FILES_PATH,rs[_0x42c5('0x112')](0x4));var _0x84fc4b=util[_0x42c5('0x27')]('%s.%s',_0x220f40,_0x11c7ee);var _0x3f20f6=!![];if(_0x45e313['beep']==='NOBEEP'){_0x3f20f6=![];}var _0x55065b=this['channel'][_0x42c5('0x12e')](_0x220f40,_0x11c7ee,_0x45e313[_0x42c5('0x12f')],_0x45e313[_0x42c5('0x64')],undefined,_0x3f20f6);if(_0x55065b[_0x42c5('0xa0')]!==-0x1){this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')]('tilde\x20%s\x20file\x20created',_0x84fc4b));var _0x1a0dc9=this[_0x42c5('0x8e')]['sync'](this,_0x45e313,_0x84fc4b);if(_0x1a0dc9){for(var _0x483fbb in _0x1a0dc9){if(_0x1a0dc9[_0x42c5('0x92')](_0x483fbb)){this['channel'][_0x42c5('0xa1')](util[_0x42c5('0x27')]('TILDE_ASR_%s',_0x483fbb[_0x42c5('0x69')]()),_0x1a0dc9[_0x483fbb]);}}return this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x136'),JSON[_0x42c5('0x72')](_0x1a0dc9)));}}return _0x55065b;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x137')]=function(_0x183860){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x138'),_0x183860[_0x42c5('0x34')]));return this[_0x42c5('0xf')][_0x42c5('0x139')](_0x183860['context'],_0x183860[_0x42c5('0x3b')],_0x183860[_0x42c5('0x3c')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x13a')]=function(_0xddbdec){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x13b'),_0xddbdec[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0xddbdec[_0x42c5('0x13c')])){return this['channel']['error'](_0xddbdec,'no\x20condition\x20configured');}try{var _0x59ca96=eval(_0xddbdec[_0x42c5('0x13c')])?_0x42c5('0x13d'):_0x42c5('0x13e');this[_0x42c5('0xf')]['noop'](util['format'](_0x42c5('0x13f'),_0xddbdec[_0x42c5('0x13c')],_0x59ca96));return{'code':0xc8,'result':_0x59ca96};}catch(_0x176ced){return{'code':0xc8,'result':_0x42c5('0x13e')};}};AGIVertices[_0x42c5('0x12')][_0x42c5('0x140')]=function(_0x717a4d){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x141'),_0x717a4d['label']));if(!this[_0x42c5('0x84')](_0x717a4d[_0x42c5('0x142')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x717a4d,_0x42c5('0x143'));}var _0x568637=this[_0x42c5('0x23')]['sync'](this,_0x717a4d['interval_id']);if(!_0x568637){return this[_0x42c5('0xf')]['error'](_0x717a4d,_0x42c5('0x144'));}for(var _0x3a6b1e=0x0;_0x3a6b1e<_0x568637['length'];_0x3a6b1e+=0x1){var _0x510ebd=this['channel'][_0x42c5('0x13')](util[_0x42c5('0x27')](_0x42c5('0x145'),_0x568637[_0x3a6b1e]));if(_0x510ebd[_0x42c5('0xa0')]===-0x1){return _0x510ebd;}logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],_0x510ebd[_0x42c5('0x9e')]));if(_0x510ebd[_0x42c5('0x9e')]==='true'){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],_0x42c5('0x13d')));this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],_0x42c5('0x13d')));return{'code':0xc8,'result':_0x42c5('0x13d')};}else{logger['info'](util[_0x42c5('0x27')]('IFTIME\x20%s\x20%s',_0x568637[_0x3a6b1e],_0x42c5('0x13e')));this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0x146'),_0x568637[_0x3a6b1e],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x42c5('0x12')][_0x42c5('0x147')]=function(_0x4134fc){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x148'),_0x4134fc[_0x42c5('0x34')]));return this[_0x42c5('0xf')][_0x42c5('0x147')]();};AGIVertices[_0x42c5('0x12')][_0x42c5('0x149')]=function(_0x3ae26f){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3ae26f['label']));if(!this[_0x42c5('0x84')](_0x3ae26f[_0x42c5('0x83')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x12a'));}var _0x52ce39=_0x42c5('0x12b');var _0x3777d8=util[_0x42c5('0x27')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x2ef8c0=util[_0x42c5('0x27')](_0x42c5('0x9a'),_0x3777d8,_0x52ce39);var _0x322135=!![];if(_0x3ae26f[_0x42c5('0x12c')]===_0x42c5('0x12d')){_0x322135=![];}var _0x2918e5=this['channel'][_0x42c5('0x12e')](_0x3777d8,_0x52ce39,_0x3ae26f[_0x42c5('0x12f')],_0x3ae26f[_0x42c5('0x64')],undefined,_0x322135);if(_0x2918e5[_0x42c5('0xa0')]!==-0x1){this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x14a'),_0x2ef8c0));var _0x3823c8=this[_0x42c5('0x82')][_0x42c5('0x6d')](this,_0x3ae26f,_0x2ef8c0);if(_0x3823c8){for(var _0x181b34 in _0x3823c8){if(_0x3823c8[_0x42c5('0x92')](_0x181b34)){this[_0x42c5('0xf')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x181b34['toUpperCase']()),_0x3823c8[_0x181b34]);}}return this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x14b'),JSON[_0x42c5('0x72')](_0x3823c8)));}}return _0x2918e5;};AGIVertices[_0x42c5('0x12')][_0x42c5('0x14c')]=function(_0x2a5eda){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2a5eda[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x2a5eda[_0x42c5('0x83')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x12a'));}if(!this['isConfigured'](_0x2a5eda[_0x42c5('0x59')])){return this['channel'][_0x42c5('0xa6')]('no\x20text\x20configured');}this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x2a5eda['text']));var _0x29f352=this[_0x42c5('0x80')]['sync'](this,_0x2a5eda);if(_0x29f352){this[_0x42c5('0xf')]['noop'](util['format'](_0x42c5('0x14a'),_0x29f352));var _0x220d7f=this['channel'][_0x42c5('0xf9')](_0x29f352,_0x2a5eda[_0x42c5('0x12f')]);try{fs['unlink'](_0x29f352+_0x42c5('0xfb'));}catch(_0x34684c){logger['error'](_0x34684c);}return _0x220d7f;}return this['channel'][_0x42c5('0x4f')](_0x2a5eda,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x42c5('0x14d')]=function(_0x229b60){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x14e'),_0x229b60[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x229b60[_0x42c5('0x14f')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x229b60,_0x42c5('0x150'));}logger['info'](util['format'](_0x42c5('0x151'),this['channel'][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));var _0x4db901=this['agentLogin'][_0x42c5('0x6d')](this,_0x229b60[_0x42c5('0x14f')]);if(_0x4db901){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));this[_0x42c5('0xf')]['noop'](util['format'](_0x42c5('0x152'),this['channel'][_0x42c5('0x38')],_0x229b60['findBy']));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x154'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x229b60[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x155')};}};AGIVertices[_0x42c5('0x12')]['logout']=function(_0x3e0cf1){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x156'),_0x3e0cf1[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x3e0cf1[_0x42c5('0x14f')])){return this['channel'][_0x42c5('0x4f')](_0x3e0cf1,_0x42c5('0x150'));}logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x151'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1['findBy']));var _0x44033b=this[_0x42c5('0x51')][_0x42c5('0x6d')](this,_0x3e0cf1[_0x42c5('0x14f')]);if(_0x44033b){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42c5('0x38')],_0x3e0cf1[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x154'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x3e0cf1['findBy']));return{'code':0xc8,'result':_0x42c5('0x155')};}};AGIVertices['prototype'][_0x42c5('0x157')]=function(_0x3e2f04){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3e2f04[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x3e2f04[_0x42c5('0x158')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3e2f04,_0x42c5('0x159'));}this['channel']['noop'](util['format'](_0x42c5('0x15a'),_0x3e2f04[_0x42c5('0x158')]));var _0x36ad0e=eval(_0x3e2f04[_0x42c5('0x158')]);if(!this[_0x42c5('0x84')](_0x3e2f04[_0x42c5('0xd3')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xd4'));}var _0x5aed38=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x3e2f04[_0x42c5('0xd3')]);if(!_0x5aed38){return this['channel'][_0x42c5('0x4f')](_0x3e2f04,'no\x20variable\x20found');}if(_['isArray'](_0x36ad0e)){var _0x44e507=this;_0x36ad0e[_0x42c5('0xd6')](function(_0xd307ca,_0x58368a){_0x44e507[_0x42c5('0xf')]['setVariable'](util[_0x42c5('0x27')](_0x42c5('0x15b'),_0x5aed38,_0x58368a),_0xd307ca);});return this['channel'][_0x42c5('0xa6')](util['format'](_0x42c5('0x15c'),_0x5aed38));}else{return this['channel'][_0x42c5('0xa1')](_0x5aed38,_0x36ad0e);}};AGIVertices[_0x42c5('0x12')]['menu']=function(_0x1e92ac){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x15d'),_0x1e92ac['label']));if(_0x1e92ac[_0x42c5('0xa3')]===0x0){return this['maxRetry'](_0x1e92ac);}_0x1e92ac[_0x42c5('0xa3')]-=0x1;if(!this[_0x42c5('0x84')](_0x1e92ac[_0x42c5('0x10a')])){return this[_0x42c5('0xf')]['error'](_0x1e92ac,_0x42c5('0x10b'));}var _0xabc27c=this[_0x42c5('0x1e')][_0x42c5('0x6d')](this,_0x1e92ac[_0x42c5('0x10a')]);if(!_0xabc27c){return this[_0x42c5('0xf')]['error'](_0x1e92ac,_0x42c5('0x10c'));}var _0x4ac56f=this[_0x42c5('0xf')][_0x42c5('0x10d')](_0xabc27c,_0x1e92ac[_0x42c5('0x15e')],_0x1e92ac[_0x42c5('0x15f')]);var _0x4a3ad3=_0x4ac56f[_0x42c5('0xa0')];if(_0x4ac56f[_0x42c5('0xa0')]===-0x1){this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x1e92ac,'-1');return _0x4ac56f;}else if(_0x4ac56f[_0x42c5('0x9e')]===_0x42c5('0x64')){_0x4ac56f['result']=_0x4ac56f[_0x42c5('0xa0')][_0x42c5('0x98')]>0x0?_0x4ac56f[_0x42c5('0xa0')]:'t';}else if(_[_0x42c5('0x43')](_0x4ac56f['result'])){_0x4ac56f['result']='#';_0x4a3ad3='#';}if(!this[_0x42c5('0x84')](_0x1e92ac['variable_id'])){this['channel'][_0x42c5('0xa6')](_0x42c5('0xd4'));}else{var _0x2b3236=this['getVariable'][_0x42c5('0x6d')](this,_0x1e92ac[_0x42c5('0xd3')]);if(!_0x2b3236){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1e92ac,_0x42c5('0xd5'));}this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x2b3236,_0x4a3ad3);}this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x1e92ac,_0x4a3ad3);return _0x4ac56f;};AGIVertices[_0x42c5('0x12')][_0x42c5('0xa6')]=function(_0x57c123){logger['info'](util[_0x42c5('0x27')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x57c123['label']));return this['channel'][_0x42c5('0xa6')](_0x57c123[_0x42c5('0x160')]||_0x57c123[_0x42c5('0x34')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x161')]=function(_0x5570f4){logger['info'](util[_0x42c5('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x5570f4[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x5570f4['findBy'])){return this['channel'][_0x42c5('0x4f')](_0x5570f4,'no\x20find\x20by\x20configured');}logger[_0x42c5('0x2b')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4[_0x42c5('0x14f')]));var _0x3bc564=this['getPause']['sync'](this,_0x5570f4[_0x42c5('0x162')]);var _0xc56e51=this['agentPause'][_0x42c5('0x6d')](this,_0x5570f4[_0x42c5('0x14f')],_0x3bc564);if(_0xc56e51){logger['info'](util[_0x42c5('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4['findBy']));this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x154'),this[_0x42c5('0xf')]['callerid'],_0x5570f4['findBy']));this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0x5570f4[_0x42c5('0x14f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x42c5('0x12')]['playback']=function(_0x262ff3){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x163'),_0x262ff3[_0x42c5('0x34')]));if(!this['isConfigured'](_0x262ff3[_0x42c5('0x10a')])){return this['channel'][_0x42c5('0x4f')](_0x262ff3,'no\x20file\x20audio\x20selected');}var _0xfd648e=this['getSound'][_0x42c5('0x6d')](this,_0x262ff3[_0x42c5('0x10a')]);if(!_0xfd648e){return this['channel'][_0x42c5('0x4f')](_0x262ff3,_0x42c5('0x10c'));}var _0x37ce76=this['channel'][_0x42c5('0x54')](_0x42c5('0x164'),[_0xfd648e,_0x262ff3[_0x42c5('0xde')]]);if(_0x37ce76[_0x42c5('0xa0')]===-0x1){return _0x37ce76;}return this['channel'][_0x42c5('0xa6')](util['format']('Executed\x20command\x20%s\x20%s',_0x42c5('0x164'),_0xfd648e));};AGIVertices[_0x42c5('0x12')]['queue']=function(_0x4e5844){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x165'),_0x4e5844[_0x42c5('0x34')]));if(!this['isConfigured'](_0x4e5844[_0x42c5('0x166')])){return this[_0x42c5('0xf')]['error'](_0x4e5844,_0x42c5('0x167'));}var _0x1f5ef3='';var _0x4bc593=parseInt(_0x4e5844['queue_id'],0xa);if(isNaN(_0x4bc593)){_0x1f5ef3=_0x4e5844[_0x42c5('0x166')];}else{_0x1f5ef3=this[_0x42c5('0x168')]['sync'](this,_0x4e5844[_0x42c5('0x166')]);if(!_0x1f5ef3){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x4e5844,_0x42c5('0x169'));}}var _0x4f68c1='';if(this['isConfigured'](_0x4e5844[_0x42c5('0x10a')])){var _0x23548d=this[_0x42c5('0x1e')][_0x42c5('0x6d')](this,_0x4e5844[_0x42c5('0x10a')]);if(_0x23548d){_0x4f68c1=_0x23548d;}}this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x4e5844,_0x1f5ef3);if(_0x4e5844[_0x42c5('0xde')][_0x42c5('0x16a')]('x')<0x0){_0x4e5844[_0x42c5('0xde')]+='x';}if(_0x4e5844[_0x42c5('0xde')][_0x42c5('0x16a')]('X')<0x0){_0x4e5844[_0x42c5('0xde')]+='X';}this[_0x42c5('0xf')]['setVariable']('XMCS-QUEUE',_0x1f5ef3?_0x1f5ef3[_0x42c5('0x16b')]():'');var _0x4bc06b=this[_0x42c5('0xf')][_0x42c5('0x54')]('QUEUE',[_0x1f5ef3,_0x4e5844[_0x42c5('0xde')],_0x4e5844['url'],_0x4f68c1,_0x4e5844[_0x42c5('0x64')],_0x4e5844['agi'],_0x4e5844[_0x42c5('0x16c')],_0x4e5844[_0x42c5('0x16d')],'',_0x4e5844['position']]);if(_0x4bc06b['result']===-0x1){return _0x4bc06b;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),_0x42c5('0x16e'),_0x1f5ef3));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x16f')]=function(_0x45439b){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x45439b[_0x42c5('0x34')]));var _0x24bf19=_0x45439b[_0x42c5('0x170')]||'wav';var _0x5bcbea=util['format'](_0x42c5('0x171'),this[_0x42c5('0xf')][_0x42c5('0x3f')],rs['generate'](0x5));var _0x30eae0=util[_0x42c5('0x27')](_0x42c5('0x172'),FILES_PATH,_0x5bcbea,_0x24bf19);var _0x565924=util['format'](_0x42c5('0x135'),FILES_PATH,_0x5bcbea);this[_0x42c5('0x37')][_0x42c5('0x6d')](this,_0x45439b,_0x5bcbea,_0x30eae0);this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x42c5('0x173'),_0x5bcbea);logger[_0x42c5('0x2b')](_0x42c5('0x174'),_0x565924,_0x24bf19,_0x45439b[_0x42c5('0x175')],_0x45439b[_0x42c5('0x64')]);return this[_0x42c5('0xf')][_0x42c5('0x12e')](_0x565924,_0x24bf19,_0x45439b[_0x42c5('0x175')],_0x45439b[_0x42c5('0x64')],undefined,!![]);};AGIVertices[_0x42c5('0x12')]['restapi']=function(_0x3e14f9){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x176'),_0x3e14f9['label']));if(!this['isConfigured'](_0x3e14f9[_0x42c5('0x62')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x177'));}var _0x30b392=this[_0x42c5('0x61')][_0x42c5('0x6d')](this,_0x3e14f9);logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x178'),util[_0x42c5('0x179')](_0x30b392,{'showHidden':![],'depth':null})));if(!this[_0x42c5('0x84')](_0x3e14f9['variable_id'])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x17a'));}var _0x280b05=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x3e14f9[_0x42c5('0xd3')]);if(!_0x280b05){return this['channel'][_0x42c5('0x4f')](_0x3e14f9,'no\x20variable\x20found');}this[_0x42c5('0xf')]['setVariable'](util[_0x42c5('0x27')](_0x42c5('0x17b'),_0x280b05),_0x30b392['statusCode']?_0x30b392['statusCode']:_0x42c5('0x17c'));this[_0x42c5('0xf')][_0x42c5('0xa1')](util['format'](_0x42c5('0x17d'),_0x280b05),_0x30b392[_0x42c5('0x75')]?_0x30b392['statusMessage']:'OK');if(_0x30b392[_0x42c5('0x6a')]){try{this[_0x42c5('0x99')](_0x30b392[_0x42c5('0x6a')],_0x280b05);}catch(_0x5d9cf7){logger[_0x42c5('0x4f')](util[_0x42c5('0x27')](_0x42c5('0x17e'),_0x280b05));}}return this['channel']['noop'](util['format'](_0x42c5('0xd8'),_0x280b05));};AGIVertices['prototype'][_0x42c5('0x17f')]=function(_0x19737e){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x180'),_0x19737e[_0x42c5('0x34')]));return this[_0x42c5('0xf')][_0x42c5('0x181')](_0x19737e['digits'][_0x42c5('0x182')](/\s+/g,''),_0x19737e['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x2ea01e){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2ea01e['label']));return this['channel'][_0x42c5('0x183')](_0x2ea01e[_0x42c5('0x65')][_0x42c5('0x182')](/\s+/g,''),_0x2ea01e[_0x42c5('0x175')]);};AGIVertices[_0x42c5('0x12')]['sayphonetic']=function(_0x5a7de0){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5a7de0['label']));return this[_0x42c5('0xf')][_0x42c5('0x184')](_0x5a7de0[_0x42c5('0x59')],_0x5a7de0[_0x42c5('0x175')]);};AGIVertices[_0x42c5('0x12')][_0x42c5('0x185')]=function(_0x23c50c){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x186'),_0x23c50c[_0x42c5('0x34')]));if(!this['isConfigured'](_0x23c50c[_0x42c5('0x187')])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x188'));}var _0x347fbd=this[_0x42c5('0x21')]['sync'](this,_0x23c50c[_0x42c5('0x187')]);if(!_0x347fbd||!_0x347fbd[_0x42c5('0x189')]){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x23c50c,_0x42c5('0x18a'));}var _0x1fa38e={'from':util[_0x42c5('0x27')](_0x42c5('0x18b'),_0x347fbd[_0x42c5('0x16')],_0x347fbd['email']||_0x347fbd[_0x42c5('0x189')][_0x42c5('0x18c')]),'to':_0x23c50c['to']||'','cc':_0x23c50c['cc']||'','bcc':_0x23c50c[_0x42c5('0x18d')]||'','subject':_0x23c50c[_0x42c5('0x18e')],'html':_0x23c50c[_0x42c5('0x59')],'text':_0x23c50c[_0x42c5('0x59')]};if(this[_0x42c5('0x84')](_0x23c50c['template_id'])){}logger[_0x42c5('0x18f')](_0x42c5('0x190'),JSON['stringify'](_0x1fa38e));this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x23c50c,_0x23c50c[_0x42c5('0x187')]);this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x191'),_0x347fbd[_0x42c5('0x16')]));this[_0x42c5('0x192')][_0x42c5('0x6d')](this,_0x347fbd['smtpOptions'],_0x1fa38e);return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x193'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x194')]=function(_0x652972){logger['info'](util['format'](_0x42c5('0x195'),_0x652972[_0x42c5('0x34')]));return this[_0x42c5('0xf')]['noop'](_0x42c5('0x196'));};AGIVertices['prototype']['sendSMS']=function(_0x3fb7ed){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x197'),_0x3fb7ed[_0x42c5('0x34')]));if(!this['isConfigured'](_0x3fb7ed['sms_account_id'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x198'));}var _0x57a717=this[_0x42c5('0x30')]['sync'](this,_0x3fb7ed[_0x42c5('0x199')]);if(!_0x57a717){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3fb7ed,'no\x20sms\x20account\x20found');}var _0x2a1ffa={'body':_0x3fb7ed[_0x42c5('0x19a')],'phone':_0x3fb7ed['to']||'','SmsAccountId':_0x57a717['id']};logger[_0x42c5('0x18f')](_0x42c5('0x19b'),JSON[_0x42c5('0x72')](_0x2a1ffa));this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x3fb7ed,_0x3fb7ed[_0x42c5('0x199')]);this[_0x42c5('0xf')]['noop'](util[_0x42c5('0x27')](_0x42c5('0x19c'),_0x57a717[_0x42c5('0x16')]));this[_0x42c5('0x32')][_0x42c5('0x6d')](this,_0x2a1ffa);return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x19d'));};AGIVertices[_0x42c5('0x12')]['set']=function(_0x3a2778){logger[_0x42c5('0x2b')](util['format'](_0x42c5('0x19e'),_0x3a2778[_0x42c5('0x34')]));if(!this['isConfigured'](_0x3a2778['variable_id'])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x3a2778,'no\x20variable\x20selected');}var _0x552d26=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x3a2778[_0x42c5('0xd3')]);if(!_0x552d26){return this['channel'][_0x42c5('0x4f')](_0x3a2778,'no\x20variable\x20found');}return this['channel'][_0x42c5('0xa1')](_0x552d26,_0x3a2778[_0x42c5('0x19f')]);};AGIVertices['prototype'][_0x42c5('0x1a0')]=function(_0x169c32){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x1a1'),_0x169c32[_0x42c5('0x34')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x1a2'));if(_0x169c32['answer']===_0x42c5('0x1a3')){this['channel'][_0x42c5('0xa6')]('Answer');return this['channel'][_0x42c5('0xb6')]();}return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0x1a4'));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1a5')]=function(_0x1a995b){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1a995b[_0x42c5('0x34')]));if(!this['isConfigured'](_0x1a995b[_0x42c5('0x1a6')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1a995b,_0x42c5('0x1a7'));}var _0x452ff8=this[_0x42c5('0x1a8')][_0x42c5('0x6d')](this,_0x1a995b[_0x42c5('0x1a6')]);if(!this[_0x42c5('0x84')](_0x452ff8)){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1a995b,util[_0x42c5('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1a995b[_0x42c5('0x1a6')]));}if(_0x452ff8===this[_0x42c5('0xf')][_0x42c5('0x36')]){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x1a995b,_0x42c5('0x1a9'));}this[_0x42c5('0x33')][_0x42c5('0x6d')](this,_0x1a995b,_0x452ff8);var _0x30a9d5=this[_0x42c5('0xf')]['exec']('AGI',util[_0x42c5('0x27')](_0x42c5('0x1aa'),config['agi'][_0x42c5('0x1ab')]||_0x42c5('0x1ac'),_0x452ff8,this['channel'][_0x42c5('0x36')]));if(_0x30a9d5[_0x42c5('0xa0')]===-0x1){return _0x30a9d5;}return this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),_0x42c5('0x1ad'),_0x452ff8));};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1ae')]=function(_0x31c590){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x1af'),_0x31c590[_0x42c5('0x34')]));var _0x1f4529=this[_0x42c5('0x53')]['sync'](this,_0x31c590[_0x42c5('0x1b0')]);this[_0x42c5('0x33')]['sync'](this,_0x31c590,_0x31c590[_0x42c5('0x1b0')]);if(this['isConfigured'](_0x31c590[_0x42c5('0xd3')])){var _0x908d=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x31c590['variable_id']);if(_0x908d){this[_0x42c5('0xf')][_0x42c5('0xa1')](_0x908d,_0x1f4529);return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x1b1'),_0x31c590['command'],_0x908d));}}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x31c590['command']));};AGIVertices['prototype'][_0x42c5('0x1b2')]=function(_0x543589){logger['info'](util['format'](_0x42c5('0x1b3'),_0x543589[_0x42c5('0x34')]));_0x543589['text']=_0x543589[_0x42c5('0x59')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x42c5('0x84')](_0x543589['apiKey'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0x1b4'));}if(!this['isConfigured'](_0x543589['text'])){return this['channel'][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0x1b5'),_0x543589[_0x42c5('0x59')]));var _0xd3ef3b=this['googleCloudTTS'][_0x42c5('0x6d')](this,_0x543589);if(_0xd3ef3b){this['channel'][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x1b6'),_0xd3ef3b));var _0x4c3db7=this[_0x42c5('0xf')]['streamFile'](_0xd3ef3b);try{fs[_0x42c5('0xfa')](_0xd3ef3b+_0x42c5('0xfb'));}catch(_0x53c2c9){logger[_0x42c5('0x4f')](_0x53c2c9);}return _0x4c3db7;}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x543589,_0x42c5('0x1b7'));};AGIVertices['prototype'][_0x42c5('0x1b8')]=function(_0x274151){logger[_0x42c5('0x2b')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x274151[_0x42c5('0x34')]));_0x274151[_0x42c5('0x59')]=_0x274151[_0x42c5('0x59')][_0x42c5('0x182')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x274151[_0x42c5('0x59')])){return this[_0x42c5('0xf')][_0x42c5('0xa6')](_0x42c5('0xa7'));}this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0x1b9'),_0x274151[_0x42c5('0x59')]));var _0x3300e8=this[_0x42c5('0x5f')][_0x42c5('0x6d')](this,_0x274151);if(_0x3300e8){this[_0x42c5('0xf')][_0x42c5('0xa6')](util['format'](_0x42c5('0x1ba'),_0x3300e8));var _0x428b9b=this[_0x42c5('0xf')][_0x42c5('0xf9')](_0x3300e8);try{fs['unlink'](_0x3300e8+_0x42c5('0xfb'));}catch(_0x9e6f62){logger['error'](_0x9e6f62);}return _0x428b9b;}return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x274151,_0x42c5('0x1bb'));};AGIVertices[_0x42c5('0x12')]['unpause']=function(_0xbf86ba){logger['info'](util[_0x42c5('0x27')](_0x42c5('0x1bc'),_0xbf86ba[_0x42c5('0x34')]));if(!this['isConfigured'](_0xbf86ba[_0x42c5('0x14f')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0xbf86ba,'no\x20find\x20by\x20configured');}logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x151'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0xbf86ba[_0x42c5('0x14f')]));var _0x101d8e=this[_0x42c5('0x50')]['sync'](this,_0xbf86ba[_0x42c5('0x14f')]);if(_0x101d8e){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')]['callerid'],_0xbf86ba[_0x42c5('0x14f')]));this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0x152'),this[_0x42c5('0xf')][_0x42c5('0x38')],_0xbf86ba[_0x42c5('0x14f')]));return{'code':0xc8,'result':_0x42c5('0x153')};}else{logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x42c5('0x38')],_0xbf86ba['findBy']));this['channel'][_0x42c5('0xa6')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x42c5('0xf')][_0x42c5('0x38')],_0xbf86ba['findBy']));return{'code':0xc8,'result':_0x42c5('0x155')};}};AGIVertices[_0x42c5('0x12')][_0x42c5('0x1bd')]=function(_0x194adf){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')](_0x42c5('0x1be'),_0x194adf[_0x42c5('0x34')]));var _0x5ba4cb=this[_0x42c5('0xf')][_0x42c5('0x54')]('VOICEMAIL',[_0x194adf[_0x42c5('0x1bf')],_0x194adf[_0x42c5('0x78')]]);if(_0x5ba4cb[_0x42c5('0xa0')]===-0x1){return _0x5ba4cb;}return this[_0x42c5('0xf')][_0x42c5('0xa6')](util[_0x42c5('0x27')](_0x42c5('0xbe'),'VOICEMAIL',_0x194adf[_0x42c5('0x1bf')]));};AGIVertices[_0x42c5('0x12')]['vswitch']=function(_0x16d59d){logger[_0x42c5('0x2b')](util[_0x42c5('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x16d59d[_0x42c5('0x34')]));if(!this[_0x42c5('0x84')](_0x16d59d[_0x42c5('0xd3')])){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x16d59d,'no\x20variable\x20selected');}var _0x5141a0=this[_0x42c5('0x13')][_0x42c5('0x6d')](this,_0x16d59d['variable_id']);if(!_0x5141a0){return this[_0x42c5('0xf')][_0x42c5('0x4f')](_0x16d59d,_0x42c5('0xd5'));}var _0x280e72=this[_0x42c5('0xf')]['getVariable'](_0x5141a0);return{'code':0xc8,'result':_0x280e72[_0x42c5('0x9e')]?_0x280e72[_0x42c5('0x9e')]:'-'};};String[_0x42c5('0x12')]['replaceAll']=function(_0x4e77e2,_0x38b9b8){return this['split'](_0x4e77e2)[_0x42c5('0x1c0')](_0x38b9b8);};module['exports']=AGIVertices; \ No newline at end of file +var _0x60a5=['IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','no\x20find\x20by\x20configured','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','getVoiceQueue','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','user','debug','sendMailMessage','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','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','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','odbc','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','getdigits','getsecretdigits','rpc','prototype','getVariable','getVariableById','then','name','catch','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','url','method','number','timeout','includes','POST','PUT','body','rawBody','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','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_secret_access_key','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','length','isString','replaceAllVariables','%s.%s','saveRestApiResult','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','exec','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sestekNDA','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','streamFile','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found'];(function(_0x10577a,_0x317fc2){var _0x32e013=function(_0x3ca861){while(--_0x3ca861){_0x10577a['push'](_0x10577a['shift']());}};_0x32e013(++_0x317fc2);}(_0x60a5,0x83));var _0x560a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x60a5[_0x618414];return _0x21c19a;};'use strict';var fs=require('fs');var util=require(_0x560a('0x0'));var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x560a('0x1'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x560a('0x2'));var rp=require(_0x560a('0x3'));var logger=require(_0x560a('0x4'))('agi');var config=require(_0x560a('0x5'));var shared=require(_0x560a('0x6'));var scripts=require(_0x560a('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu',_0x560a('0x8'),_0x560a('0x9')];var AGIVertices=function(_0x33ddbd,_0x281350,_0x52c52e){this['channel']=_0x33ddbd;this[_0x560a('0xa')]=_0x281350;this['mailRpc']=_0x52c52e;};AGIVertices[_0x560a('0xb')][_0x560a('0xc')]=function(_0x4f7df3,_0x12e51e){this[_0x560a('0xa')][_0x560a('0xd')](_0x4f7df3)[_0x560a('0xe')](function(_0x33a153){_0x12e51e(null,_0x33a153?_0x33a153[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x276796){_0x12e51e(_0x276796);});};AGIVertices[_0x560a('0xb')]['getVoiceQueue']=function(_0x232dd8,_0x102074){this[_0x560a('0xa')]['getVoiceQueueById'](_0x232dd8)[_0x560a('0xe')](function(_0x43430){_0x102074(null,_0x43430?_0x43430[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x54a445){_0x102074(_0x54a445);});};AGIVertices[_0x560a('0xb')][_0x560a('0x11')]=function(_0x14f430,_0x3f9f15){this['rpc']['getSquareProjectById'](_0x14f430)[_0x560a('0xe')](function(_0x251a08){_0x3f9f15(null,_0x251a08?_0x251a08[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x481d56){_0x3f9f15(_0x481d56);});};AGIVertices[_0x560a('0xb')][_0x560a('0x12')]=function(_0xb24d7a,_0x2b484f){this[_0x560a('0xa')]['getSquareOdbcById'](_0xb24d7a)[_0x560a('0xe')](function(_0x155c2b){_0x2b484f(null,_0x155c2b?_0x155c2b[_0x560a('0x13')]:![]);})[_0x560a('0x10')](function(_0x23bfd6){_0x2b484f(_0x23bfd6);});};AGIVertices[_0x560a('0xb')][_0x560a('0x14')]=function(_0x4f33a8,_0x292a5a){this[_0x560a('0xa')][_0x560a('0x15')](_0x4f33a8)[_0x560a('0xe')](function(_0x29167f){_0x292a5a(null,_0x29167f?_0x29167f[_0x560a('0xf')]:![]);})[_0x560a('0x10')](function(_0x423822){_0x292a5a(_0x423822);});};AGIVertices['prototype']['getTrunk']=function(_0x535737,_0x306510){this[_0x560a('0xa')]['getTrunkById'](_0x535737)['then'](function(_0x3ff302){_0x306510(null,_0x3ff302?_0x3ff302['name']:![]);})[_0x560a('0x10')](function(_0xc94611){_0x306510(_0xc94611);});};AGIVertices['prototype'][_0x560a('0x16')]=function(_0x4430e8,_0x56557a){var _0x1ddcf6=this;this[_0x560a('0xa')][_0x560a('0x17')](_0x4430e8)[_0x560a('0xe')](function(_0x40a668){_0x56557a(null,_0x40a668?_0x1ddcf6['getSoundPath'](_0x40a668[_0x560a('0x18')]):![]);})[_0x560a('0x10')](function(_0x571eb6){_0x56557a(_0x571eb6);});};AGIVertices[_0x560a('0xb')][_0x560a('0x19')]=function(_0xf4a166,_0x6434c2){this[_0x560a('0xa')][_0x560a('0x1a')](_0xf4a166)[_0x560a('0xe')](function(_0x54817a){_0x6434c2(null,_0x54817a?_0x54817a:![]);})[_0x560a('0x10')](function(_0x339dc6){_0x6434c2(_0x339dc6);});};AGIVertices['prototype']['sendMailMessage']=function(_0x16bccd,_0x465418,_0x155e3e){this[_0x560a('0x1b')]['sendMailMessage'](_0x16bccd,_0x465418)['then'](function(){_0x155e3e(null);})['catch'](function(_0x8dbc4a){_0x155e3e(_0x8dbc4a);});};AGIVertices[_0x560a('0xb')][_0x560a('0x1c')]=function(_0x45632b,_0x32a9cc){this[_0x560a('0xa')][_0x560a('0x1d')](_0x45632b)[_0x560a('0xe')](function(_0x198883){if(_0x198883){if(_0x198883[_0x560a('0x1e')]){_0x32a9cc(null,[_0x198883['interval']]);}else{_0x32a9cc(null,_[_0x560a('0x1f')](_0x198883[_0x560a('0x20')],_0x560a('0x21')));}}else{_0x32a9cc(null,![]);}})[_0x560a('0x10')](function(_0x155428){_0x32a9cc(_0x155428);});};AGIVertices['prototype']['getSoundPath']=function(_0x2eda65){return util[_0x560a('0x22')](_0x560a('0x23'),FILES_PATH,_0x2eda65);};AGIVertices[_0x560a('0xb')][_0x560a('0x24')]=function(_0x49ad54,_0x13cfcf,_0x44d39d){odbc['open'](_0x49ad54,function(_0x3b5e48){if(_0x3b5e48){logger[_0x560a('0x25')](_0x560a('0x26'),_0x3b5e48);_0x44d39d(_0x3b5e48);}else{logger[_0x560a('0x27')](_0x560a('0x28'));odbc[_0x560a('0x29')](_0x13cfcf,function(_0x4e7396,_0x12bcf4){if(_0x4e7396){logger[_0x560a('0x27')](_0x560a('0x2a'),_0x13cfcf);_0x44d39d(_0x4e7396);}else{logger[_0x560a('0x27')]('Query\x20executed\x20correctly\x20%s',_0x13cfcf);odbc[_0x560a('0x2b')](function(_0x513e00){if(_0x513e00){logger[_0x560a('0x25')](_0x560a('0x2c'),_0x513e00);}_0x44d39d(null,_0x12bcf4);});}});}});};AGIVertices[_0x560a('0xb')][_0x560a('0x2d')]=function(_0x329f01,_0x8f8f84){this[_0x560a('0xa')][_0x560a('0x2e')](_0x329f01)[_0x560a('0xe')](function(_0x45db8b){_0x8f8f84(null,_0x45db8b?_0x45db8b:![]);})[_0x560a('0x10')](function(_0x1fd711){_0x8f8f84(_0x1fd711);});};AGIVertices[_0x560a('0xb')]['createSmsMessage']=function(_0x97467a,_0x126886){this[_0x560a('0xa')][_0x560a('0x2f')](_0x97467a)['then'](function(_0x1c3956){_0x126886(null,_0x1c3956);})['catch'](function(_0x52623f){_0x126886(_0x52623f);});};AGIVertices[_0x560a('0xb')][_0x560a('0x30')]=function(_0x11c8bd,_0x462d62,_0x1a1d3a){this[_0x560a('0xa')]['createSquareDetailsReport']({'uniqueid':this[_0x560a('0x31')][_0x560a('0x32')],'node':_0x11c8bd['label'],'application':_0x11c8bd['agicommand'],'data':_0x462d62||null,'project_name':this['channel'][_0x560a('0x33')],'callerid':this[_0x560a('0x31')][_0x560a('0x34')]})['then'](function(_0x5de491){if(_0x1a1d3a){_0x1a1d3a(null,_0x5de491);}})[_0x560a('0x10')](function(_0x4e52c3){if(_0x1a1d3a){_0x1a1d3a(_0x4e52c3);}});};AGIVertices[_0x560a('0xb')][_0x560a('0x35')]=function(_0x107340,_0x4a968f,_0x3ff955,_0x1991e4){this[_0x560a('0xa')]['createSquareRecording']({'uniqueid':this[_0x560a('0x31')][_0x560a('0x32')],'callerid':this[_0x560a('0x31')]['callerid'],'calleridname':this['channel'][_0x560a('0x36')],'context':this['channel'][_0x560a('0x37')],'extension':this['channel'][_0x560a('0x38')],'priority':this[_0x560a('0x31')][_0x560a('0x39')],'accountcode':this[_0x560a('0x31')][_0x560a('0x3a')],'dnid':this[_0x560a('0x31')][_0x560a('0x3b')],'projectName':this[_0x560a('0x31')]['arg_1'],'saveName':_0x4a968f,'filename':_0x107340[_0x560a('0x3c')]||_0x4a968f,'savePath':_0x3ff955})['then'](function(_0x580999){_0x1991e4(null,_0x580999);})[_0x560a('0x10')](function(_0xdf1613){_0x1991e4(_0xdf1613);});};AGIVertices[_0x560a('0xb')][_0x560a('0x3d')]=function(_0x4d68e9,_0x563f94,_0x211111,_0x5ab3f0,_0x3f8a48){this[_0x560a('0xa')]['createSquareMessage']({'uniqueid':this[_0x560a('0x31')][_0x560a('0x32')],'body':_0x4d68e9,'direction':_0x563f94,'providerName':_0x211111,'providerResponse':_0x5ab3f0})[_0x560a('0xe')](function(_0x13463f){if(_0x3f8a48){_0x3f8a48(null,_0x13463f);}})['catch'](function(_0x38dae1){if(_0x3f8a48){_0x3f8a48(_0x38dae1);}});};AGIVertices[_0x560a('0xb')][_0x560a('0x3e')]=function(_0x34be8b,_0x5b6740){this[_0x560a('0xa')][_0x560a('0x3e')]({'firstName':_[_0x560a('0x3f')](_0x34be8b[_0x560a('0xf')])||_[_0x560a('0x40')](_0x34be8b[_0x560a('0xf')])?_0x560a('0x41')+Math[_0x560a('0x42')]():_0x34be8b['name'],'lastName':_[_0x560a('0x3f')](_0x34be8b[_0x560a('0x43')])||_[_0x560a('0x40')](_0x34be8b[_0x560a('0x43')])?null:_0x34be8b['lastName'],'phone':_0x34be8b[_0x560a('0x44')],'ListId':_0x34be8b['list_id'],'scheduledat':_0x34be8b[_0x560a('0x45')],'callbackUniqueid':this['channel'][_0x560a('0x32')],'tags':'callback','description':_0x560a('0x46')+_0x34be8b[_0x560a('0x45')][_0x560a('0x47')](),'priority':_0x34be8b[_0x560a('0x48')]})[_0x560a('0xe')](function(_0x1a4b33){_0x5b6740(null,_0x1a4b33);})['catch'](function(_0x59c3d1){_0x5b6740(_0x59c3d1);});};AGIVertices[_0x560a('0xb')][_0x560a('0x49')]=function(_0x2d5c9c,_0x3f4eca){this[_0x560a('0xa')][_0x560a('0x4a')](_0x2d5c9c)[_0x560a('0xe')](function(_0x178f7a){_0x3f4eca(null,_0x178f7a?_0x178f7a[_0x560a('0xf')]:![]);})['catch'](function(_0x331800){_0x3f4eca(_0x331800);});};AGIVertices[_0x560a('0xb')]['agentPause']=function(_0x131744,_0x1e6b3f,_0x31552a){var _0x564c8a={'role':_0x560a('0x4b')};_0x564c8a[_0x131744]=this['channel'][_0x560a('0x34')];this[_0x560a('0xa')][_0x560a('0x4c')](_0x564c8a,_0x1e6b3f,this['channel'][_0x560a('0x32')])[_0x560a('0xe')](function(_0x166859){_0x31552a(null,_[_0x560a('0x40')](_0x166859)?![]:!![]);})['catch'](function(_0x174409){logger[_0x560a('0x25')](_0x174409);_0x31552a(null,![]);});};AGIVertices[_0x560a('0xb')]['agentUnpause']=function(_0x23fdd4,_0x4daef4){var _0x56df20={'role':'agent'};_0x56df20[_0x23fdd4]=this[_0x560a('0x31')][_0x560a('0x34')];this[_0x560a('0xa')][_0x560a('0x4d')](_0x56df20)[_0x560a('0xe')](function(_0x147f12){_0x4daef4(null,_[_0x560a('0x40')](_0x147f12)?![]:!![]);})['catch'](function(_0x27384b){logger[_0x560a('0x25')](_0x27384b);_0x4daef4(null,![]);});};AGIVertices[_0x560a('0xb')][_0x560a('0x4e')]=function(_0x50c05c,_0x3e0314){var _0x3e8800={'role':_0x560a('0x4b')};_0x3e8800[_0x50c05c]=this[_0x560a('0x31')][_0x560a('0x34')];this[_0x560a('0xa')][_0x560a('0x4e')](_0x3e8800)['then'](function(_0x8ca81a){_0x3e0314(null,_['isNil'](_0x8ca81a)?![]:!![]);})[_0x560a('0x10')](function(_0x4b0bcc){logger[_0x560a('0x25')](_0x4b0bcc);_0x3e0314(null,![]);});};AGIVertices[_0x560a('0xb')][_0x560a('0x4f')]=function(_0x590cd5,_0x18bb91){var _0x2fa8b7={'role':_0x560a('0x4b')};_0x2fa8b7[_0x590cd5]=this[_0x560a('0x31')]['callerid'];var _0x745abe=_0x590cd5!=_0x560a('0x50')?util[_0x560a('0x22')](_0x560a('0x51'),_0x560a('0x52'),this['channel'][_0x560a('0x34')]):undefined;this['rpc'][_0x560a('0x4f')](_0x2fa8b7,_0x745abe)[_0x560a('0xe')](function(_0x1e2818){_0x18bb91(null,_['isNil'](_0x1e2818)?![]:!![]);})[_0x560a('0x10')](function(_0x15a58d){logger[_0x560a('0x25')](_0x15a58d);_0x18bb91(null,![]);});};AGIVertices[_0x560a('0xb')]['shellCommand']=function(_0x5f305a,_0x52facf){sh['exec'](_[_0x560a('0x53')](_0x5f305a),function(_0x38feb5,_0x8c479f){var _0x5075b0=_0x8c479f[_0x560a('0x54')](/(\r\n|\n|\r)/gm,'');_0x52facf(null,_0x5075b0);});};AGIVertices[_0x560a('0xb')][_0x560a('0x55')]=function(_0x1ac52d,_0x2b4027){scripts[_0x560a('0x55')](_0x1ac52d[_0x560a('0x56')],_0x1ac52d[_0x560a('0x57')]||_0x560a('0x58'),_0x1ac52d[_0x560a('0x58')],_0x1ac52d['languageCode']||_0x560a('0x59'),_0x1ac52d[_0x560a('0x5a')]||_0x560a('0x5b'),_0x1ac52d[_0x560a('0x5c')]||_0x560a('0x5d'))[_0x560a('0xe')](function(_0x58d14e){_0x2b4027(null,_0x58d14e);})['catch'](function(_0x10ef85){_0x2b4027(_0x10ef85);});};AGIVertices[_0x560a('0xb')]['googleTTS']=function(_0x1622a3,_0x3234b1){scripts[_0x560a('0x5e')](_0x1622a3[_0x560a('0x58')],_0x1622a3['google_tts_language']||'en',0x1)[_0x560a('0xe')](function(_0x464d2e){_0x3234b1(null,_0x464d2e);})[_0x560a('0x10')](function(_0x316017){_0x3234b1(_0x316017);});};AGIVertices[_0x560a('0xb')]['restAPI']=function(_0x1258db,_0x538f3){var _0x4103d3={'uri':_0x1258db[_0x560a('0x5f')],'method':_0x1258db[_0x560a('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1258db['timeout'])===_0x560a('0x61')&&parseInt(_0x1258db[_0x560a('0x62')])>=0x1?parseInt(_0x1258db[_0x560a('0x62')])*0x3e8:0x5*0x3e8};if(_[_0x560a('0x63')]([_0x560a('0x64'),_0x560a('0x65')],_0x4103d3['method']['toUpperCase']())){try{_0x4103d3[_0x560a('0x66')]=_0x1258db[_0x560a('0x67')]?JSON[_0x560a('0x68')](_0x1258db[_0x560a('0x67')]):{};}catch(_0x465317){logger[_0x560a('0x25')](_0x560a('0x69'),_0x465317);}}try{_0x4103d3[_0x560a('0x6a')]=_0x1258db[_0x560a('0x6b')]?JSON['parse'](_0x1258db['rawHeaders']):{};}catch(_0x402606){logger[_0x560a('0x25')](_0x560a('0x6c'),_0x402606);}if(_0x1258db['computedVariables']){try{var _0xbda73e=require(_0x1258db['computedVariables'])[_0x560a('0x6d')](this,_0x4103d3);_0x4103d3[_0x560a('0x6e')]=Mustache[_0x560a('0x6f')](_0x1258db[_0x560a('0x5f')],_0xbda73e,{},['$$','$$']);if(_0x4103d3[_0x560a('0x6a')]){_0x4103d3[_0x560a('0x6a')]=JSON[_0x560a('0x68')](Mustache[_0x560a('0x6f')](JSON[_0x560a('0x70')](_0x4103d3[_0x560a('0x6a')]),_0xbda73e,{},['$$','$$']));}if(_0x4103d3['body']){_0x4103d3['body']=JSON['parse'](Mustache[_0x560a('0x6f')](JSON['stringify'](_0x4103d3['body']),_0xbda73e,{},['$$','$$']));}}catch(_0x437c52){logger[_0x560a('0x25')](_0x560a('0x71'),_0x437c52);}}rp(_0x4103d3)[_0x560a('0xe')](function(_0x59b376){var _0x41c2ee={'statusCode':_0x59b376[_0x560a('0x72')]||0xc8,'statusMessage':_0x59b376[_0x560a('0x73')]||'OK','headers':_0x59b376[_0x560a('0x6a')]||{},'body':_0x59b376[_0x560a('0x66')]||{}};_0x538f3(null,_0x41c2ee);})['catch'](function(_0x48d38e){var _0x35082c={'statusCode':_0x48d38e[_0x560a('0x72')]||0x1f4,'statusMessage':_0x48d38e['message']||_0x560a('0x74'),'headers':_0x48d38e['options'][_0x560a('0x6a')]||{},'body':_0x48d38e[_0x560a('0x75')][_0x560a('0x66')]||{}};_0x538f3(null,_0x35082c);});};AGIVertices[_0x560a('0xb')][_0x560a('0x76')]=function(_0x11909a,_0x1c1da7){scripts[_0x560a('0x76')](this['channel'][_0x560a('0x32')],_0x11909a[_0x560a('0x77')],_0x11909a[_0x560a('0x58')],_0x11909a['dialogflow_language']||'en')['then'](function(_0x340611){_0x1c1da7(null,_0x340611);})[_0x560a('0x10')](function(_0x5e443f){_0x1c1da7(_0x5e443f);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x1009da,_0x183bb0){scripts[_0x560a('0x78')](this[_0x560a('0x31')][_0x560a('0x32')],_0x1009da[_0x560a('0x79')],_0x1009da[_0x560a('0x7a')],_0x1009da[_0x560a('0x7b')],_0x1009da['text'],_0x1009da[_0x560a('0x7c')]||'en')[_0x560a('0xe')](function(_0x44dc90){_0x183bb0(null,_0x44dc90);})[_0x560a('0x10')](function(_0x27718a){_0x183bb0(_0x27718a);});};AGIVertices[_0x560a('0xb')]['sestekNDA']=function(_0x233421,_0x30b9dc){scripts['sestekNDA'](this[_0x560a('0x31')],_0x233421)['then'](function(_0x44587e){_0x30b9dc(null,_0x44587e);})[_0x560a('0x10')](function(_0x45a00c){_0x30b9dc(_0x45a00c);});};AGIVertices['prototype'][_0x560a('0x7d')]=function(_0x4678c5,_0x17d53){scripts[_0x560a('0x7d')](_0x4678c5[_0x560a('0x77')],_0x4678c5[_0x560a('0x58')],_0x4678c5[_0x560a('0x7e')]||_0x560a('0x59'),_0x4678c5[_0x560a('0x7f')])[_0x560a('0xe')](function(_0x1b2e5a){_0x17d53(null,_0x1b2e5a);})[_0x560a('0x10')](function(_0x522032){_0x17d53(_0x522032);});};AGIVertices[_0x560a('0xb')][_0x560a('0x80')]=function(_0x584a24,_0x16ba9c,_0x39b45f){scripts[_0x560a('0x80')](_0x16ba9c,_0x584a24[_0x560a('0x77')],_0x584a24[_0x560a('0x81')]||'en-US',this[_0x560a('0x82')](_0x584a24['model'])?_0x584a24['model']:undefined)[_0x560a('0xe')](function(_0x10047b){_0x39b45f(null,_0x10047b);})[_0x560a('0x10')](function(_0x29bfd4){_0x39b45f(_0x29bfd4);});};AGIVertices[_0x560a('0xb')][_0x560a('0x83')]=function(_0x1f4a1d,_0x5826c9){scripts[_0x560a('0x83')](_0x1f4a1d[_0x560a('0x84')],_0x1f4a1d['aws_secret_access_key'],_0x1f4a1d[_0x560a('0x85')],_0x1f4a1d[_0x560a('0x86')]||_0x560a('0x87'),_0x1f4a1d[_0x560a('0x58')],_0x1f4a1d['aws_text_type']||'text')[_0x560a('0xe')](function(_0x1c1fad){_0x5826c9(null,_0x1c1fad);})[_0x560a('0x10')](function(_0x3eed19){_0x5826c9(_0x3eed19);});};AGIVertices[_0x560a('0xb')][_0x560a('0x88')]=function(_0x48e172,_0x32f741){scripts['awsLex'](this[_0x560a('0x31')][_0x560a('0x32')],_0x48e172[_0x560a('0x84')],_0x48e172[_0x560a('0x89')],_0x48e172['aws_lex_region'],_0x48e172['text'],_0x48e172['aws_bot_name'])[_0x560a('0xe')](function(_0x1b60fd){_0x32f741(null,_0x1b60fd);})[_0x560a('0x10')](function(_0x2303bf){_0x32f741(_0x2303bf);});};AGIVertices[_0x560a('0xb')]['googleASR']=function(_0x340a43,_0x20d8ca,_0x3e39f6){scripts[_0x560a('0x8a')](_0x20d8ca,_0x340a43[_0x560a('0x77')],_0x340a43[_0x560a('0x8b')]||_0x560a('0x59'))[_0x560a('0xe')](function(_0x23e13f){_0x3e39f6(null,_0x23e13f);})[_0x560a('0x10')](function(_0x277310){_0x3e39f6(_0x277310);});};AGIVertices[_0x560a('0xb')][_0x560a('0x8c')]=function(_0x218553,_0x4792b9,_0xb8c0f3){scripts[_0x560a('0x8c')](_0x4792b9,_0x218553[_0x560a('0x8d')],_0x218553[_0x560a('0x8e')],_0x218553[_0x560a('0x6e')])['then'](function(_0x561542){_0xb8c0f3(null,_0x561542);})[_0x560a('0x10')](function(_0x1d2df7){_0xb8c0f3(_0x1d2df7);});};AGIVertices[_0x560a('0xb')][_0x560a('0x8f')]=function(_0x4fc2b0){var _0x28fd0f=_[_0x560a('0x63')](verticesWithRetry,_0x4fc2b0['agicommand'])?_0x4fc2b0:_['clone'](_0x4fc2b0);for(var _0x210bc8 in _0x28fd0f){if(_0x28fd0f['hasOwnProperty'](_0x210bc8)){if(_0x28fd0f[_0x210bc8]&&_['isString'](_0x28fd0f[_0x210bc8])){if(_['includes'](recursiveMapAttributes,_0x210bc8)){_0x28fd0f[_0x210bc8]=this[_0x560a('0x90')](_0x28fd0f[_0x210bc8]);}else{_0x28fd0f[_0x210bc8]=this['replaceAllVariables'](_0x28fd0f[_0x210bc8]);}}}}return _0x28fd0f;};AGIVertices[_0x560a('0xb')]['recursiveNodeIndex']=function(_0x4faec7){for(var _0x14003f in _0x4faec7){if(_0x4faec7[_0x560a('0x91')](_0x14003f)){if(_[_0x560a('0x92')](_0x4faec7[_0x14003f])){this[_0x560a('0x93')](_0x4faec7[_0x14003f]);}else if(_['isArray'](_0x4faec7[_0x14003f])){for(var _0x38e045=0x0;_0x38e045<_0x4faec7[_0x14003f][_0x560a('0x94')];_0x38e045++){this[_0x560a('0x93')](_0x4faec7[_0x14003f][_0x38e045]);}}else if(_[_0x560a('0x95')](_0x4faec7[_0x14003f])){_0x4faec7[_0x14003f]=this[_0x560a('0x96')](_0x4faec7[_0x14003f]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x5e155d,_0x56d839){for(var _0x6915a3 in _0x5e155d){if(_0x5e155d['hasOwnProperty'](_0x6915a3)){if(_[_0x560a('0x92')](_0x5e155d[_0x6915a3])){if(!_[_0x560a('0x3f')](_0x5e155d[_0x6915a3])){this['saveRestApiResult'](_0x5e155d[_0x6915a3],util[_0x560a('0x22')](_0x560a('0x97'),_0x56d839,_0x6915a3));}}else if(_['isArray'](_0x5e155d[_0x6915a3])){for(var _0x4b4a4a=0x0;_0x4b4a4a<_0x5e155d[_0x6915a3]['length'];_0x4b4a4a++){this[_0x560a('0x98')](_0x5e155d[_0x6915a3][_0x4b4a4a],util[_0x560a('0x22')]('%s.%s',_0x56d839,_0x6915a3+'['+_0x4b4a4a+']'));}}else{if(!_['isNil'](_0x5e155d[_0x6915a3])){this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x97'),_0x56d839,_0x6915a3),_0x5e155d[_0x6915a3]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x955b17){try{var _0x4cf886=JSON[_0x560a('0x68')](_0x955b17);this['recursiveNodeIndex'](_0x4cf886);return JSON[_0x560a('0x70')](_0x4cf886);}catch(_0x3fe651){return this[_0x560a('0x96')](_0x955b17);}};AGIVertices[_0x560a('0xb')][_0x560a('0x96')]=function(_0x34a864){var _0x2b1def=_0x34a864[_0x560a('0x9a')]('{');for(var _0x5a5019=0x1;_0x5a5019<_0x2b1def['length'];_0x5a5019+=0x1){var _0x3cf5ba=_0x2b1def[_0x5a5019][_0x560a('0x9a')]('}');if(_0x3cf5ba[_0x560a('0x94')]>0x1){_0x34a864=_0x34a864[_0x560a('0x9b')]('{'+_0x3cf5ba[0x0]+'}',this[_0x560a('0x31')][_0x560a('0xc')](_0x3cf5ba[0x0])[_0x560a('0x9c')]||_0x3cf5ba[0x0]);}}if(_0x2b1def['length']===0x1){return _0x34a864[_0x560a('0x47')]();}return this[_0x560a('0x96')](_0x34a864);};AGIVertices[_0x560a('0xb')][_0x560a('0x9d')]=function(_0x32eb1c,_0x2fafe6){var _0xc8aecb=this[_0x560a('0x31')]['getVariable'](_0x32eb1c);if(_0xc8aecb[_0x560a('0x9e')]===-0x1){return _0xc8aecb;}logger['info'](util[_0x560a('0x22')](_0x560a('0x9f'),_0x2fafe6,_0xc8aecb['extra']));return this['channel'][_0x560a('0x99')](_0x2fafe6,_0xc8aecb[_0x560a('0x9c')]);};AGIVertices[_0x560a('0xb')][_0x560a('0x82')]=function(_0x24c672){return _0x24c672&&_0x24c672!=='0'&&_0x24c672!=='-1'&&_0x24c672!=='';};AGIVertices['prototype'][_0x560a('0xa0')]=function(_0x21e306){this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x21e306,'-');_0x21e306[_0x560a('0xa1')]=_0x21e306[_0x560a('0xa0')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x560a('0xb')][_0x560a('0xa2')]=function(_0x190d64){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xa3'),_0x190d64[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x190d64[_0x560a('0x58')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xa5'));}var _0x38dcdc='\x22'+_0x190d64[_0x560a('0x58')]+'\x22';if(this['isConfigured'](_0x190d64[_0x560a('0x75')])){_0x38dcdc+=','+_0x190d64[_0x560a('0x75')];}var _0x3fc7a7=this[_0x560a('0x31')][_0x560a('0xa6')]('MRCPSynth',_0x38dcdc);if(_0x3fc7a7[_0x560a('0x9e')]===-0x1){return _0x3fc7a7;}return this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xa8'),_0x38dcdc));};AGIVertices['prototype']['mrcprecog']=function(_0x274037){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xa9'),_0x274037[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x274037[_0x560a('0xaa')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xab'));}var _0x54c348=_0x274037[_0x560a('0xaa')];if(this[_0x560a('0x82')](_0x274037[_0x560a('0x75')])){_0x54c348+=','+_0x274037[_0x560a('0x75')];}var _0x618db3=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xac'),_0x54c348);if(_0x618db3['result']===-0x1){return _0x618db3;}var _0x37196f=this[_0x560a('0x9d')](_0x560a('0xad'),'MRCP_RECOG_CONFIDENCE');if(_0x37196f[_0x560a('0x9e')]===-0x1){return _0x37196f;}var _0x1b6e56=this['getAndSetVariable'](_0x560a('0xae'),_0x560a('0xaf'));if(_0x1b6e56[_0x560a('0x9e')]===-0x1){return _0x1b6e56;}var _0xf7e7ae=this[_0x560a('0x9d')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0xf7e7ae['result']===-0x1){return _0xf7e7ae;}return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0xb0'),_0x54c348));};AGIVertices[_0x560a('0xb')][_0x560a('0xb1')]=function(_0x4dcfc2){logger['info'](util[_0x560a('0x22')](_0x560a('0xb2'),_0x4dcfc2['label']));return this[_0x560a('0x31')]['agi']([_0x4dcfc2[_0x560a('0xb3')],_0x4dcfc2['args']]);};AGIVertices[_0x560a('0xb')][_0x560a('0xb4')]=function(_0x19dda5){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xb5'),_0x19dda5['label']));if(this[_0x560a('0x82')](_0x19dda5[_0x560a('0x62')])){logger[_0x560a('0x27')](util['format'](_0x560a('0xb6'),_0x19dda5[_0x560a('0x62')]));var _0x2338c3=this[_0x560a('0x31')]['wait'](_0x19dda5[_0x560a('0x62')]);if(_0x2338c3[_0x560a('0x9e')]===-0x1){return _0x2338c3;}}return this[_0x560a('0x31')]['answer']();};AGIVertices[_0x560a('0xb')]['callback']=function(_0x1a08da){logger['info'](util[_0x560a('0x22')](_0x560a('0xb7'),_0x1a08da[_0x560a('0xa4')]));if(!this['isConfigured'](_0x1a08da[_0x560a('0xb8')])){return this['channel'][_0x560a('0x25')](_0x1a08da,'no\x20list\x20selected');}_0x1a08da[_0x560a('0x45')]=moment();if(this[_0x560a('0x82')](_0x1a08da[_0x560a('0xb9')])){_0x1a08da[_0x560a('0x45')]=moment()['add'](_0x1a08da[_0x560a('0xb9')],_0x560a('0xba'));}if(!this[_0x560a('0x82')](_0x1a08da['callback_priority'])){_0x1a08da[_0x560a('0x48')]=0x2;}this['createCmContact']['sync'](this,_0x1a08da);return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0xbb'),_0x1a08da[_0x560a('0x44')],_0x1a08da[_0x560a('0xb8')],_0x1a08da[_0x560a('0x45')]));};AGIVertices[_0x560a('0xb')][_0x560a('0xbc')]=function(_0x2a2f07){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a2f07[_0x560a('0xa4')]));var _0x38d059=this[_0x560a('0x31')][_0x560a('0xa6')](_0x2a2f07[_0x560a('0xbd')],_0x2a2f07['options']);if(_0x38d059[_0x560a('0x9e')]===-0x1){return _0x38d059;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x2a2f07[_0x560a('0xbd')],_0x2a2f07['options']));};AGIVertices[_0x560a('0xb')][_0x560a('0xbf')]=function(_0x4f759f){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xc0'),_0x4f759f[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x4f759f['text'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xa5'));}var _0x165e3c='\x22'+_0x4f759f[_0x560a('0x58')]+'\x22';if(this[_0x560a('0x82')](_0x4f759f[_0x560a('0x75')])){_0x165e3c+=','+_0x4f759f['options'];}var _0x27fd65=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xc1'),_0x165e3c);if(_0x27fd65[_0x560a('0x9e')]===-0x1){return _0x27fd65;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xa8'),_0x165e3c));};AGIVertices[_0x560a('0xb')][_0x560a('0xc2')]=function(_0x454d5c){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x454d5c[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x454d5c[_0x560a('0x58')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xa5'));}var _0x18189c='\x22'+_0x454d5c['text']+'\x22';if(this[_0x560a('0x82')](_0x454d5c['options'])){_0x18189c+=','+_0x454d5c[_0x560a('0x75')];}var _0x193d39=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xc1'),_0x18189c);if(_0x193d39[_0x560a('0x9e')]===-0x1){return _0x193d39;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xa8'),_0x18189c));};AGIVertices[_0x560a('0xb')][_0x560a('0xc3')]=function(_0x4f2aa0){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xc4'),_0x4f2aa0[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x4f2aa0['grammar'])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20grammar\x20configured');}var _0x47a2f2=_0x4f2aa0['grammar'];if(this[_0x560a('0x82')](_0x4f2aa0[_0x560a('0x75')])){_0x47a2f2+=','+_0x4f2aa0[_0x560a('0x75')];}var _0x23e5d7=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xac'),_0x47a2f2);if(_0x23e5d7['result']===-0x1){return _0x23e5d7;}var _0x2e5948=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x2e5948[_0x560a('0x9e')]===-0x1){return _0x2e5948;}var _0x535467=this[_0x560a('0x9d')](_0x560a('0xae'),_0x560a('0xc5'));if(_0x535467[_0x560a('0x9e')]===-0x1){return _0x535467;}var _0x165396=this[_0x560a('0x9d')](_0x560a('0xc6'),_0x560a('0xc7'));if(_0x165396['result']===-0x1){return _0x165396;}return this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')]('Executed\x20command\x20MRCPRecog\x20%s',_0x47a2f2));};AGIVertices[_0x560a('0xb')][_0x560a('0xc8')]=function(_0x249732){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xc9'),_0x249732[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x249732[_0x560a('0xaa')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20grammar\x20configured');}var _0x563c04=_0x249732[_0x560a('0xaa')];if(this['isConfigured'](_0x249732['options'])){_0x563c04+=','+_0x249732[_0x560a('0x75')];}var _0x572dd2=this[_0x560a('0x31')][_0x560a('0xa6')]('MRCPRecog',_0x563c04);if(_0x572dd2[_0x560a('0x9e')]===-0x1){return _0x572dd2;}var _0x3a3459=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x560a('0xca'));if(_0x3a3459['result']===-0x1){return _0x3a3459;}var _0x4a970f=this[_0x560a('0x9d')](_0x560a('0xae'),_0x560a('0xcb'));if(_0x4a970f[_0x560a('0x9e')]===-0x1){return _0x4a970f;}var _0x396749=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x396749[_0x560a('0x9e')]===-0x1){return _0x396749;}return this['channel'][_0x560a('0xa7')](util['format'](_0x560a('0xb0'),_0x563c04));};AGIVertices['prototype'][_0x560a('0xcc')]=function(_0x1fcdd4){logger[_0x560a('0x27')](util['format'](_0x560a('0xcd'),_0x1fcdd4[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x1fcdd4[_0x560a('0xce')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1fcdd4,_0x560a('0xcf'));}var _0x161434=this[_0x560a('0x12')][_0x560a('0x6d')](this,_0x1fcdd4[_0x560a('0xce')]);if(!_0x161434){return this['channel'][_0x560a('0x25')](_0x1fcdd4,_0x560a('0xd0'));}if(!this[_0x560a('0x82')](_0x1fcdd4[_0x560a('0x29')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1fcdd4,_0x560a('0xd1'));}var _0x2cb870=_0x1fcdd4['query'][_0x560a('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xd2'),_0x2cb870));var _0x449d29=this[_0x560a('0x24')][_0x560a('0x6d')](this,_0x161434,_0x2cb870);this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x1fcdd4,_0x2cb870);if(!this[_0x560a('0x82')](_0x1fcdd4[_0x560a('0xd3')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xd4'));}var _0x2637e9=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x1fcdd4[_0x560a('0xd3')]);if(!_0x2637e9){return this[_0x560a('0x31')]['error'](_0x1fcdd4,'no\x20variable\x20found');}var _0x35967f=this;_0x449d29[_0x560a('0xd5')](function(_0x584244,_0x5eb348){Object[_0x560a('0xd6')](_0x584244)['forEach'](function(_0xd9e4dc){_0x35967f['channel'][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xd7'),_0x2637e9,_0x5eb348,_0xd9e4dc),_0x584244[_0xd9e4dc]);});});this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xd8'),_0x2637e9),_0x449d29['length']);return this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xd9'),_0x2637e9));};AGIVertices[_0x560a('0xb')][_0x560a('0xda')]=function(_0x519a26){logger['debug'](util[_0x560a('0x22')](_0x560a('0xdb'),_0x519a26[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x519a26[_0x560a('0xdc')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x519a26,_0x560a('0xdd'));}var _0x3ac212=this[_0x560a('0x14')][_0x560a('0x6d')](this,_0x519a26[_0x560a('0xdc')]);if(!_0x3ac212){return this[_0x560a('0x31')][_0x560a('0x25')](_0x519a26,'no\x20user\x20found');}var _0x34978a=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xde'),[util[_0x560a('0x22')](_0x560a('0xdf'),_0x3ac212),_0x519a26['timeout'],_0x519a26[_0x560a('0xe0')],_0x519a26[_0x560a('0x5f')]]);if(_0x34978a['result']===-0x1){return _0x34978a;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x560a('0xb')]['dialogflow']=function(_0x21ada7){logger[_0x560a('0x27')](util['format'](_0x560a('0xe1'),_0x21ada7[_0x560a('0xa4')]));if(!this['isConfigured'](_0x21ada7[_0x560a('0x77')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xe2'));}if(!this[_0x560a('0x82')](_0x21ada7[_0x560a('0x58')])){return this[_0x560a('0x31')]['noop']('no\x20text\x20configured');}this['channel'][_0x560a('0xe3')]=!![];this[_0x560a('0x30')](_0x21ada7);this[_0x560a('0x3d')](_0x21ada7[_0x560a('0x58')],'in','','');this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xe4'),_0x21ada7[_0x560a('0x58')]));var _0x6bebd=this['googleDialogflow']['sync'](this,_0x21ada7);if(_0x6bebd){for(var _0x8f891b in _0x6bebd){if(_0x6bebd['hasOwnProperty'](_0x8f891b)){this[_0x560a('0x31')]['setVariable'](util[_0x560a('0x22')](_0x560a('0xe5'),_0x8f891b[_0x560a('0xe6')]()),_0x6bebd[_0x8f891b]);}}this[_0x560a('0x3d')](_0x6bebd[_0x560a('0xe7')],_0x560a('0xe8'),'dialogflow','');return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Dialogflow\x20Result\x20%s',_0x6bebd['speech']));}return this[_0x560a('0x31')][_0x560a('0x25')](_0x21ada7,_0x560a('0xe9'));};AGIVertices[_0x560a('0xb')][_0x560a('0xea')]=function(_0x455df8){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0xeb'),_0x455df8[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x79')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xec'));}if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x7a')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xed'));}if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x7b')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x455df8[_0x560a('0x7c')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xee'));}if(!this[_0x560a('0x82')](_0x455df8[_0x560a('0x58')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xe3')]=!![];this['createSquareDetailsReport'](_0x455df8);this[_0x560a('0x3d')](_0x455df8['text'],'in','','');this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xef'),_0x455df8['text']));var _0x1e6025=this[_0x560a('0x78')]['sync'](this,_0x455df8);if(_0x1e6025){for(var _0x37befb in _0x1e6025){if(_0x1e6025[_0x560a('0x91')](_0x37befb)){if(_0x37befb!==_0x560a('0xf0')){this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xe5'),_0x37befb[_0x560a('0xe6')]()),_0x1e6025[_0x37befb]);}}}this[_0x560a('0x3d')](_0x1e6025[_0x560a('0xe7')],_0x560a('0xe8'),_0x560a('0xea'),_0x1e6025['providerResponse']);return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xf1'),_0x1e6025[_0x560a('0xe7')]));}return this[_0x560a('0x31')][_0x560a('0x25')](_0x455df8,_0x560a('0xf2'));};AGIVertices[_0x560a('0xb')][_0x560a('0xf3')]=function(_0x57c024){logger['info'](util[_0x560a('0x22')](_0x560a('0xf4'),_0x57c024[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x57c024[_0x560a('0xf5')])){return this['channel']['noop'](_0x560a('0xf6'));}if(!this[_0x560a('0x82')](_0x57c024[_0x560a('0xf7')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xf8'));}if(!this[_0x560a('0x82')](_0x57c024[_0x560a('0xf9')])){return this[_0x560a('0x31')]['noop'](_0x560a('0xfa'));}if(!this['isConfigured'](_0x57c024[_0x560a('0xfb')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xa5'));}this['channel'][_0x560a('0xe3')]=!![];this[_0x560a('0x30')](_0x57c024);this['createSquareMessage'](_0x57c024['text'],'in','','');this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xfc'),_0x57c024[_0x560a('0x58')]));var _0x230586=this[_0x560a('0xfd')][_0x560a('0x6d')](this,_0x57c024);if(_0x230586){for(var _0x32fe31 in _0x230586){if(_0x230586[_0x560a('0x91')](_0x32fe31)){this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0xfe'),_0x32fe31[_0x560a('0xe6')]()),_0x230586[_0x32fe31]);}}this['createSquareMessage'](_0x230586[_0x560a('0xe7')],_0x560a('0xe8'),_0x560a('0xf3'),'');if(_0x230586[_0x560a('0xff')]){this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x100'),_0x230586[_0x560a('0xff')]));var _0x225362=this[_0x560a('0x31')]['streamFile'](_0x230586[_0x560a('0xff')]);try{fs[_0x560a('0x101')](_0x230586[_0x560a('0xff')]+'.wav');}catch(_0x30f497){logger[_0x560a('0x25')](_0x30f497);}return _0x225362;}else{return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')]('SestekNDA\x20Result\x20%s',_0x230586[_0x560a('0xe7')]));}}return this['channel']['error'](_0x57c024,_0x560a('0x102'));};AGIVertices['prototype'][_0x560a('0x103')]=function(_0x243881){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x104'),_0x243881[_0x560a('0xa4')]));return this[_0x560a('0x31')]['noop']('end');};AGIVertices['prototype'][_0x560a('0x105')]=function(_0xeaa26c){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x106'),_0xeaa26c['label']));var _0x4750d1='';if(_0xeaa26c[_0x560a('0x107')]){if(!this[_0x560a('0x82')](_0xeaa26c[_0x560a('0x107')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0xeaa26c,_0x560a('0x108'));}else{var _0x198dca=parseInt(_0xeaa26c[_0x560a('0x107')],0xa);if(isNaN(_0x198dca)){_0x4750d1=_0xeaa26c['trunk_id'];}else{_0x4750d1=this[_0x560a('0x109')][_0x560a('0x6d')](this,_0xeaa26c['trunk_id']);if(!_0x4750d1){return this[_0x560a('0x31')][_0x560a('0x25')](_0xeaa26c,_0x560a('0x10a'));}}}}else if(_0xeaa26c[_0x560a('0x10b')]){_0x4750d1=_0xeaa26c[_0x560a('0x10b')];}else{return this[_0x560a('0x31')][_0x560a('0x25')](_0xeaa26c,_0x560a('0x108'));}var _0x188997=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0xde'),[util[_0x560a('0x22')](_0x560a('0x10c'),_0x4750d1,_0xeaa26c[_0x560a('0x44')]),_0xeaa26c[_0x560a('0x62')],_0xeaa26c[_0x560a('0xe0')],_0xeaa26c['url']]);if(_0x188997[_0x560a('0x9e')]===-0x1){return _0x188997;}return this['channel'][_0x560a('0xa7')](util['format'](_0x560a('0x10d'),'DIAL'));};AGIVertices['prototype'][_0x560a('0x10e')]=function(_0x247226){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x247226[_0x560a('0xa4')]));return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x10e'));};AGIVertices[_0x560a('0xb')][_0x560a('0x8')]=function(_0x24acdd){logger['info'](util[_0x560a('0x22')](_0x560a('0x10f'),_0x24acdd[_0x560a('0xa4')]));if(_0x24acdd[_0x560a('0xa1')]===0x0){return this[_0x560a('0xa0')](_0x24acdd);}_0x24acdd[_0x560a('0xa1')]-=0x1;if(!this[_0x560a('0x82')](_0x24acdd[_0x560a('0x110')])){return this['channel'][_0x560a('0x25')](_0x24acdd,_0x560a('0x111'));}var _0x15a6c0=this[_0x560a('0x16')][_0x560a('0x6d')](this,_0x24acdd[_0x560a('0x110')]);if(!_0x15a6c0){return this[_0x560a('0x31')][_0x560a('0x25')](_0x24acdd,_0x560a('0x112'));}if(!this[_0x560a('0x82')](_0x24acdd[_0x560a('0xd3')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x560a('0xd4'));}var _0x5f3776=this[_0x560a('0x31')][_0x560a('0x113')](_0x15a6c0,_0x24acdd[_0x560a('0x114')],_0x24acdd[_0x560a('0x115')]);var _0x548802=_0x5f3776[_0x560a('0x9e')]?_0x5f3776[_0x560a('0x9e')][_0x560a('0x47')]():'';logger[_0x560a('0x27')](_0x560a('0x116'),JSON[_0x560a('0x70')](_0x5f3776));if(_0x5f3776[_0x560a('0x9e')]===-0x1){this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x24acdd,_0x548802);return _0x5f3776;}else if(_0x5f3776['extra']===_0x560a('0x62')){_0x5f3776['result']=_0x548802[_0x560a('0x94')]>=parseInt(_0x24acdd[_0x560a('0x117')])?'x':'i';}else{_0x5f3776['result']=_0x548802[_0x560a('0x94')]>=parseInt(_0x24acdd[_0x560a('0x117')])&&_0x548802['length']<=parseInt(_0x24acdd[_0x560a('0x115')])?'x':'i';}var _0x5cba05=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x24acdd[_0x560a('0xd3')]);if(!_0x5cba05){return this['channel'][_0x560a('0x25')](_0x24acdd,_0x560a('0x118'));}this['channel']['setVariable'](_0x5cba05,_0x548802);if(this['isConfigured'](_0x24acdd[_0x560a('0x119')])){var _0x4f0e54=parseInt(_0x24acdd[_0x560a('0x119')],0xa);var _0x32f6a2=rs[_0x560a('0x11a')]({'charset':'*','length':_0x4f0e54});var _0x457352=_0x548802[_0x560a('0x94')];if(_0x457352>0x0){if(_0x457352>_0x4f0e54){this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x24acdd,_0x24acdd[_0x560a('0x11b')]===_0x560a('0x11c')?_0x32f6a2+_0x548802[_0x560a('0x11d')](_0x4f0e54):_0x548802[_0x560a('0x11d')](0x0,_0x457352-_0x4f0e54)+_0x32f6a2);}else{this[_0x560a('0x30')]['sync'](this,_0x24acdd,rs[_0x560a('0x11a')]({'charset':'*','length':_0x457352}));}}else{this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x24acdd,'');}}else{this['createSquareDetailsReport'][_0x560a('0x6d')](this,_0x24acdd,_0x548802);}return _0x5f3776;};AGIVertices[_0x560a('0xb')][_0x560a('0x9')]=function(_0x14c8bf){logger[_0x560a('0x27')](util['format'](_0x560a('0x11e'),_0x14c8bf['label']));return this[_0x560a('0x8')](_0x14c8bf);};AGIVertices['prototype']['goal']=function(_0x355895){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x11f'),_0x355895[_0x560a('0xa4')]));this['createSquareDetailsReport'][_0x560a('0x6d')](this,_0x355895,_0x355895[_0x560a('0x120')]);return this[_0x560a('0x31')][_0x560a('0xa7')](util['format']('GOAL\x20%s',_0x355895[_0x560a('0x120')]));};AGIVertices[_0x560a('0xb')][_0x560a('0x121')]=function(_0x2e8acb){logger[_0x560a('0x27')](util['format'](_0x560a('0x122'),_0x2e8acb['label']));if(!this[_0x560a('0x82')](_0x2e8acb[_0x560a('0x84')])||!this['isConfigured'](_0x2e8acb[_0x560a('0x89')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x560a('0x82')](_0x2e8acb[_0x560a('0x58')])){return this['channel']['noop'](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x123'),_0x2e8acb[_0x560a('0x58')]));var _0xc2501b=this[_0x560a('0x83')][_0x560a('0x6d')](this,_0x2e8acb);if(_0xc2501b){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('aws\x20Polly\x20%s\x20file\x20created',_0xc2501b));var _0xad6a03=this[_0x560a('0x31')][_0x560a('0x124')](_0xc2501b);try{fs[_0x560a('0x101')](_0xc2501b+_0x560a('0x125'));}catch(_0x25a95c){logger['error'](_0x25a95c);}return _0xad6a03;}return this[_0x560a('0x31')][_0x560a('0x25')](_0x2e8acb,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x560a('0xb')]['awslex']=function(_0x258ef3){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x126'),_0x258ef3[_0x560a('0xa4')]));if(!this['isConfigured'](_0x258ef3[_0x560a('0x84')])||!this[_0x560a('0x82')](_0x258ef3[_0x560a('0x89')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x127'));}if(!this[_0x560a('0x82')](_0x258ef3[_0x560a('0x128')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x129'));}if(!this[_0x560a('0x82')](_0x258ef3[_0x560a('0x58')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xe3')]=!![];this[_0x560a('0x30')](_0x258ef3);this[_0x560a('0x3d')](_0x258ef3[_0x560a('0x58')],'in','','');this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x12a'),_0x258ef3[_0x560a('0x58')]));var _0x1b40aa=this['awsLex'][_0x560a('0x6d')](this,_0x258ef3);if(_0x1b40aa){for(var _0x24954d in _0x1b40aa){if(_0x1b40aa[_0x560a('0x91')](_0x24954d)&&_['isString'](_0x1b40aa[_0x24954d])){this[_0x560a('0x31')][_0x560a('0x99')](util['format'](_0x560a('0x12b'),_0x24954d[_0x560a('0xe6')]()),_0x1b40aa[_0x24954d]);}}if(_[_0x560a('0x40')](_0x1b40aa[_0x560a('0x12c')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x560a('0x3d')](_0x1b40aa[_0x560a('0x12c')],_0x560a('0xe8'),_0x560a('0x12d'),'');return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Amazon\x20Lex\x20Result\x20%s',_0x1b40aa[_0x560a('0x12c')]));}}return this['channel'][_0x560a('0x25')](_0x258ef3,_0x560a('0x12e'));};AGIVertices[_0x560a('0xb')][_0x560a('0x12f')]=function(_0x590bd5){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x130'),_0x590bd5[_0x560a('0xa4')],_0x590bd5[_0x560a('0x62')]));if(!this[_0x560a('0x82')](_0x590bd5['key'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xe2'));}var _0x19b6f0='wav';var _0xeff610=util['format'](_0x560a('0x131'),FILES_PATH,rs[_0x560a('0x11a')](0x4));var _0x37b115=util['format'](_0x560a('0x97'),_0xeff610,_0x19b6f0);var _0x447b30=!![];if(_0x590bd5[_0x560a('0x132')]===_0x560a('0x133')){_0x447b30=![];}var _0x37c9e9=this['channel'][_0x560a('0x134')](_0xeff610,_0x19b6f0,_0x590bd5[_0x560a('0x135')],_0x590bd5[_0x560a('0x62')],undefined,_0x447b30);if(_0x37c9e9[_0x560a('0x9e')]!==-0x1){this['channel']['noop'](util[_0x560a('0x22')](_0x560a('0x136'),_0x37b115));var _0x9e67c1=this[_0x560a('0x8a')]['sync'](this,_0x590bd5,_0x37b115);if(_0x9e67c1){for(var _0x1dd675 in _0x9e67c1){if(_0x9e67c1[_0x560a('0x91')](_0x1dd675)){this['channel'][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x137'),_0x1dd675['toUpperCase']()),_0x9e67c1[_0x1dd675]);}}return this['channel']['noop'](util[_0x560a('0x22')](_0x560a('0x138'),JSON['stringify'](_0x9e67c1)));}}return _0x37c9e9;};AGIVertices[_0x560a('0xb')][_0x560a('0x139')]=function(_0x85add2){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x13a'),_0x85add2[_0x560a('0xa4')]));if(!this['isConfigured'](_0x85add2[_0x560a('0x8d')])){return this[_0x560a('0x31')]['noop']('no\x20appid\x20configured');}if(!this[_0x560a('0x82')](_0x85add2['appsecret'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x13b'));}var _0x176d02='wav';var _0x560d88=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x560a('0x11a')](0x4));var _0x31a7ca=util['format'](_0x560a('0x97'),_0x560d88,_0x176d02);var _0x42401a=!![];if(_0x85add2[_0x560a('0x132')]===_0x560a('0x133')){_0x42401a=![];}var _0x669de8=this[_0x560a('0x31')]['recordFile'](_0x560d88,_0x176d02,_0x85add2[_0x560a('0x135')],_0x85add2[_0x560a('0x62')],undefined,_0x42401a);if(_0x669de8[_0x560a('0x9e')]!==-0x1){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x13c'),_0x31a7ca));var _0x152687=this[_0x560a('0x8c')][_0x560a('0x6d')](this,_0x85add2,_0x31a7ca);if(_0x152687){for(var _0x333bf6 in _0x152687){if(_0x152687[_0x560a('0x91')](_0x333bf6)){this[_0x560a('0x31')][_0x560a('0x99')](util['format'](_0x560a('0x13d'),_0x333bf6[_0x560a('0xe6')]()),_0x152687[_0x333bf6]);}}return this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0x13e'),JSON[_0x560a('0x70')](_0x152687)));}}return _0x669de8;};AGIVertices[_0x560a('0xb')]['gotoc']=function(_0x1b442e){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1b442e['label']));return this[_0x560a('0x31')]['continueAt'](_0x1b442e[_0x560a('0x37')],_0x1b442e[_0x560a('0x38')],_0x1b442e[_0x560a('0x39')]);};AGIVertices['prototype'][_0x560a('0x13f')]=function(_0x4f63e2){logger['info'](util[_0x560a('0x22')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x4f63e2[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x4f63e2[_0x560a('0x140')])){return this['channel'][_0x560a('0x25')](_0x4f63e2,_0x560a('0x141'));}try{var _0x4e44fa=eval(_0x4f63e2[_0x560a('0x140')])?_0x560a('0x142'):_0x560a('0x143');this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x144'),_0x4f63e2[_0x560a('0x140')],_0x4e44fa));return{'code':0xc8,'result':_0x4e44fa};}catch(_0x3468f0){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x560a('0xb')]['gotoiftime']=function(_0x118c07){logger[_0x560a('0x27')](util['format'](_0x560a('0x145'),_0x118c07['label']));if(!this['isConfigured'](_0x118c07['interval_id'])){return this[_0x560a('0x31')]['error'](_0x118c07,_0x560a('0x146'));}var _0x510a9e=this['getIntervals'][_0x560a('0x6d')](this,_0x118c07[_0x560a('0x147')]);if(!_0x510a9e){return this[_0x560a('0x31')][_0x560a('0x25')](_0x118c07,_0x560a('0x148'));}for(var _0x2ff6a8=0x0;_0x2ff6a8<_0x510a9e[_0x560a('0x94')];_0x2ff6a8+=0x1){var _0x36785b=this[_0x560a('0x31')][_0x560a('0xc')](util[_0x560a('0x22')](_0x560a('0x149'),_0x510a9e[_0x2ff6a8]));if(_0x36785b[_0x560a('0x9e')]===-0x1){return _0x36785b;}logger[_0x560a('0x27')](util['format'](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],_0x36785b[_0x560a('0x9c')]));if(_0x36785b[_0x560a('0x9c')]===_0x560a('0x142')){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],'true'));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],_0x560a('0x142')));return{'code':0xc8,'result':_0x560a('0x142')};}else{logger[_0x560a('0x27')](util['format']('IFTIME\x20%s\x20%s',_0x510a9e[_0x2ff6a8],_0x560a('0x143')));this[_0x560a('0x31')]['noop'](util['format'](_0x560a('0x14a'),_0x510a9e[_0x2ff6a8],_0x560a('0x143')));}}return{'code':0xc8,'result':_0x560a('0x143')};};AGIVertices[_0x560a('0xb')][_0x560a('0x14b')]=function(_0x4855aa){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x14c'),_0x4855aa[_0x560a('0xa4')]));return this[_0x560a('0x31')][_0x560a('0x14b')]();};AGIVertices[_0x560a('0xb')][_0x560a('0x14d')]=function(_0x5832d5){logger[_0x560a('0x27')](util['format'](_0x560a('0x14e'),_0x5832d5[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x5832d5['key'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xe2'));}var _0xbaab0e=_0x560a('0x14f');var _0x20c343=util[_0x560a('0x22')](_0x560a('0x131'),FILES_PATH,rs[_0x560a('0x11a')](0x4));var _0x5a586b=util['format'](_0x560a('0x97'),_0x20c343,_0xbaab0e);var _0x2d8c1a=!![];if(_0x5832d5['beep']===_0x560a('0x133')){_0x2d8c1a=![];}var _0x45da00=this[_0x560a('0x31')]['recordFile'](_0x20c343,_0xbaab0e,_0x5832d5['intKey'],_0x5832d5[_0x560a('0x62')],undefined,_0x2d8c1a);if(_0x45da00[_0x560a('0x9e')]!==-0x1){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x150'),_0x5a586b));var _0x619bd5=this[_0x560a('0x80')]['sync'](this,_0x5832d5,_0x5a586b);if(_0x619bd5){for(var _0x3168c2 in _0x619bd5){if(_0x619bd5['hasOwnProperty'](_0x3168c2)){this[_0x560a('0x31')][_0x560a('0x99')](util['format'](_0x560a('0x151'),_0x3168c2[_0x560a('0xe6')]()),_0x619bd5[_0x3168c2]);}}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x152'),JSON[_0x560a('0x70')](_0x619bd5)));}}return _0x45da00;};AGIVertices[_0x560a('0xb')][_0x560a('0x153')]=function(_0x35b2cd){logger[_0x560a('0x27')](util['format'](_0x560a('0x154'),_0x35b2cd[_0x560a('0xa4')]));if(!this['isConfigured'](_0x35b2cd[_0x560a('0x77')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x35b2cd[_0x560a('0x58')])){return this[_0x560a('0x31')][_0x560a('0xa7')]('no\x20text\x20configured');}this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')]('Trying\x20ispeech\x20TTS\x20%s',_0x35b2cd[_0x560a('0x58')]));var _0x4ddab9=this[_0x560a('0x7d')]['sync'](this,_0x35b2cd);if(_0x4ddab9){this['channel'][_0x560a('0xa7')](util['format'](_0x560a('0x150'),_0x4ddab9));var _0x16f54a=this[_0x560a('0x31')][_0x560a('0x124')](_0x4ddab9,_0x35b2cd[_0x560a('0x135')]);try{fs[_0x560a('0x101')](_0x4ddab9+'.wav');}catch(_0x350136){logger[_0x560a('0x25')](_0x350136);}return _0x16f54a;}return this['channel'][_0x560a('0x25')](_0x35b2cd,_0x560a('0x155'));};AGIVertices['prototype']['login']=function(_0x56de22){logger[_0x560a('0x27')](util['format'](_0x560a('0x156'),_0x56de22[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x56de22[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x56de22,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x560a('0x158'),this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));var _0x12e8e8=this['agentLogin'][_0x560a('0x6d')](this,_0x56de22[_0x560a('0x157')]);if(_0x12e8e8){logger[_0x560a('0x27')](util[_0x560a('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0x560a('0x27')](util['format'](_0x560a('0x15a'),this['channel'][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x56de22[_0x560a('0x157')]));return{'code':0xc8,'result':_0x560a('0x15b')};}};AGIVertices['prototype'][_0x560a('0x15c')]=function(_0x557550){logger[_0x560a('0x27')](util['format'](_0x560a('0x15d'),_0x557550[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x557550[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x557550,'no\x20find\x20by\x20configured');}logger['info'](util[_0x560a('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x560a('0x31')][_0x560a('0x34')],_0x557550['findBy']));var _0xc24308=this[_0x560a('0x4e')][_0x560a('0x6d')](this,_0x557550[_0x560a('0x157')]);if(_0xc24308){logger['info'](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')]['callerid'],_0x557550['findBy']));this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x560a('0x31')][_0x560a('0x34')],_0x557550[_0x560a('0x157')]));return{'code':0xc8,'result':_0x560a('0x15e')};}else{logger[_0x560a('0x27')](util[_0x560a('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x557550[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util['format'](_0x560a('0x15a'),this[_0x560a('0x31')]['callerid'],_0x557550[_0x560a('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x560a('0xb')][_0x560a('0x15f')]=function(_0x899f4){logger[_0x560a('0x27')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x899f4['label']));if(!this[_0x560a('0x82')](_0x899f4[_0x560a('0x160')])){return this[_0x560a('0x31')]['error'](_0x899f4,_0x560a('0x161'));}this['channel'][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x162'),_0x899f4[_0x560a('0x160')]));var _0x154713=eval(_0x899f4['operation']);if(!this[_0x560a('0x82')](_0x899f4['variable_id'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xd4'));}var _0x7516a5=this['getVariable'][_0x560a('0x6d')](this,_0x899f4[_0x560a('0xd3')]);if(!_0x7516a5){return this[_0x560a('0x31')][_0x560a('0x25')](_0x899f4,_0x560a('0x118'));}if(_[_0x560a('0x163')](_0x154713)){var _0x6f84a3=this;_0x154713[_0x560a('0xd5')](function(_0x232f80,_0x1d73b0){_0x6f84a3['channel'][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x164'),_0x7516a5,_0x1d73b0),_0x232f80);});return this[_0x560a('0x31')][_0x560a('0xa7')](util['format']('variable\x20%s[key]\x20set',_0x7516a5));}else{return this[_0x560a('0x31')][_0x560a('0x99')](_0x7516a5,_0x154713);}};AGIVertices[_0x560a('0xb')]['menu']=function(_0x51fb37){logger['info'](util['format'](_0x560a('0x165'),_0x51fb37[_0x560a('0xa4')]));if(_0x51fb37[_0x560a('0xa1')]===0x0){return this[_0x560a('0xa0')](_0x51fb37);}_0x51fb37[_0x560a('0xa1')]-=0x1;if(!this[_0x560a('0x82')](_0x51fb37['file_id'])){return this['channel'][_0x560a('0x25')](_0x51fb37,_0x560a('0x111'));}var _0xba2c6b=this['getSound'][_0x560a('0x6d')](this,_0x51fb37['file_id']);if(!_0xba2c6b){return this[_0x560a('0x31')][_0x560a('0x25')](_0x51fb37,_0x560a('0x112'));}var _0xc6e4a=this[_0x560a('0x31')][_0x560a('0x113')](_0xba2c6b,_0x51fb37[_0x560a('0x114')],_0x51fb37[_0x560a('0x166')]);var _0x45d976=_0xc6e4a[_0x560a('0x9e')];if(_0xc6e4a[_0x560a('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x51fb37,'-1');return _0xc6e4a;}else if(_0xc6e4a['extra']===_0x560a('0x62')){_0xc6e4a['result']=_0xc6e4a[_0x560a('0x9e')][_0x560a('0x94')]>0x0?_0xc6e4a[_0x560a('0x9e')]:'t';}else if(_['isEmpty'](_0xc6e4a[_0x560a('0x9e')])){_0xc6e4a[_0x560a('0x9e')]='#';_0x45d976='#';}if(!this[_0x560a('0x82')](_0x51fb37['variable_id'])){this['channel'][_0x560a('0xa7')](_0x560a('0xd4'));}else{var _0x56348c=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x51fb37[_0x560a('0xd3')]);if(!_0x56348c){return this[_0x560a('0x31')][_0x560a('0x25')](_0x51fb37,_0x560a('0x118'));}this[_0x560a('0x31')][_0x560a('0x99')](_0x56348c,_0x45d976);}this[_0x560a('0x30')]['sync'](this,_0x51fb37,_0x45d976);return _0xc6e4a;};AGIVertices[_0x560a('0xb')]['noop']=function(_0xc8e2ba){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x167'),_0xc8e2ba['label']));return this[_0x560a('0x31')]['noop'](_0xc8e2ba[_0x560a('0x168')]||_0xc8e2ba['label']);};AGIVertices[_0x560a('0xb')][_0x560a('0x169')]=function(_0x3b4c47){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3b4c47[_0x560a('0xa4')]));if(!this['isConfigured'](_0x3b4c47[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3b4c47,_0x560a('0x16a'));}logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x158'),this[_0x560a('0x31')][_0x560a('0x34')],_0x3b4c47[_0x560a('0x157')]));var _0x1c94ad=this['getPause'][_0x560a('0x6d')](this,_0x3b4c47[_0x560a('0x16b')]);var _0x15d0be=this[_0x560a('0x4c')][_0x560a('0x6d')](this,_0x3b4c47[_0x560a('0x157')],_0x1c94ad);if(_0x15d0be){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')]['callerid'],_0x3b4c47[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')]['callerid'],_0x3b4c47[_0x560a('0x157')]));return{'code':0xc8,'result':'success'};}else{logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x3b4c47['findBy']));this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')][_0x560a('0x34')],_0x3b4c47[_0x560a('0x157')]));return{'code':0xc8,'result':_0x560a('0x15b')};}};AGIVertices[_0x560a('0xb')]['playback']=function(_0x2aedee){logger[_0x560a('0x27')](util['format'](_0x560a('0x16c'),_0x2aedee[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x2aedee[_0x560a('0x110')])){return this['channel']['error'](_0x2aedee,'no\x20file\x20audio\x20selected');}var _0x1c9474=this['getSound']['sync'](this,_0x2aedee[_0x560a('0x110')]);if(!_0x1c9474){return this[_0x560a('0x31')][_0x560a('0x25')](_0x2aedee,_0x560a('0x112'));}var _0x5513c9=this['channel'][_0x560a('0xa6')](_0x560a('0x16d'),[_0x1c9474,_0x2aedee[_0x560a('0xe0')]]);if(_0x5513c9[_0x560a('0x9e')]===-0x1){return _0x5513c9;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x16d'),_0x1c9474));};AGIVertices[_0x560a('0xb')][_0x560a('0x16e')]=function(_0x3202b4){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3202b4[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x3202b4[_0x560a('0x16f')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3202b4,'no\x20queue\x20selected');}var _0x28cb5d='';var _0x2fb1d1=parseInt(_0x3202b4[_0x560a('0x16f')],0xa);if(isNaN(_0x2fb1d1)){_0x28cb5d=_0x3202b4['queue_id'];}else{_0x28cb5d=this[_0x560a('0x170')][_0x560a('0x6d')](this,_0x3202b4['queue_id']);if(!_0x28cb5d){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3202b4,'no\x20queue\x20found');}}var _0x27450d='';if(this['isConfigured'](_0x3202b4[_0x560a('0x110')])){var _0x303a0b=this[_0x560a('0x16')][_0x560a('0x6d')](this,_0x3202b4['file_id']);if(_0x303a0b){_0x27450d=_0x303a0b;}}this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x3202b4,_0x28cb5d);if(_0x3202b4[_0x560a('0xe0')][_0x560a('0x171')]('x')<0x0){_0x3202b4[_0x560a('0xe0')]+='x';}if(_0x3202b4[_0x560a('0xe0')][_0x560a('0x171')]('X')<0x0){_0x3202b4[_0x560a('0xe0')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x28cb5d?_0x28cb5d[_0x560a('0x172')]():'');var _0x29a508=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0x173'),[_0x28cb5d,_0x3202b4[_0x560a('0xe0')],_0x3202b4['url'],_0x27450d,_0x3202b4['timeout'],_0x3202b4[_0x560a('0xb1')],_0x3202b4[_0x560a('0x174')],_0x3202b4[_0x560a('0x175')],'',_0x3202b4[_0x560a('0x176')]]);if(_0x29a508['result']===-0x1){return _0x29a508;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x173'),_0x28cb5d));};AGIVertices[_0x560a('0xb')][_0x560a('0x177')]=function(_0x4d66b1){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x178'),_0x4d66b1[_0x560a('0xa4')]));var _0x581bf6=_0x4d66b1[_0x560a('0x179')]||_0x560a('0x14f');var _0x21fc8f=util[_0x560a('0x22')](_0x560a('0x17a'),this['channel'][_0x560a('0x32')],rs['generate'](0x5));var _0x33a914=util[_0x560a('0x22')](_0x560a('0x17b'),FILES_PATH,_0x21fc8f,_0x581bf6);var _0xe993c9=util[_0x560a('0x22')](_0x560a('0x131'),FILES_PATH,_0x21fc8f);this['createSquareRecording'][_0x560a('0x6d')](this,_0x4d66b1,_0x21fc8f,_0x33a914);this['channel'][_0x560a('0x99')]('RECORDING_SAVENAME',_0x21fc8f);logger['info'](_0x560a('0x17c'),_0xe993c9,_0x581bf6,_0x4d66b1[_0x560a('0x17d')],_0x4d66b1[_0x560a('0x62')]);return this['channel'][_0x560a('0x134')](_0xe993c9,_0x581bf6,_0x4d66b1['escape_digits'],_0x4d66b1[_0x560a('0x62')],undefined,!![]);};AGIVertices[_0x560a('0xb')][_0x560a('0x17e')]=function(_0x3b05e5){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x17f'),_0x3b05e5[_0x560a('0xa4')]));if(!this['isConfigured'](_0x3b05e5['url'])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x180'));}var _0x12f93b=this[_0x560a('0x181')]['sync'](this,_0x3b05e5);logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x182'),util[_0x560a('0x183')](_0x12f93b,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3b05e5[_0x560a('0xd3')])){return this['channel'][_0x560a('0xa7')](_0x560a('0x184'));}var _0x114baa=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x3b05e5[_0x560a('0xd3')]);if(!_0x114baa){return this[_0x560a('0x31')][_0x560a('0x25')](_0x3b05e5,_0x560a('0x118'));}this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')](_0x560a('0x185'),_0x114baa),_0x12f93b[_0x560a('0x72')]?_0x12f93b[_0x560a('0x72')]:_0x560a('0x186'));this[_0x560a('0x31')][_0x560a('0x99')](util[_0x560a('0x22')]('%s_STATUS_MESSAGE',_0x114baa),_0x12f93b[_0x560a('0x73')]?_0x12f93b[_0x560a('0x73')]:'OK');if(_0x12f93b[_0x560a('0x66')]){try{this['saveRestApiResult'](_0x12f93b[_0x560a('0x66')],_0x114baa);}catch(_0x3c5ab0){logger[_0x560a('0x25')](util[_0x560a('0x22')](_0x560a('0x187'),_0x114baa));}}return this['channel']['noop'](util[_0x560a('0x22')](_0x560a('0xd9'),_0x114baa));};AGIVertices[_0x560a('0xb')][_0x560a('0x188')]=function(_0x4263df){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x189'),_0x4263df['label']));return this[_0x560a('0x31')][_0x560a('0x18a')](_0x4263df[_0x560a('0x18b')][_0x560a('0x54')](/\s+/g,''),_0x4263df[_0x560a('0x17d')]);};AGIVertices[_0x560a('0xb')][_0x560a('0x18c')]=function(_0x529b8d){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x529b8d['label']));return this[_0x560a('0x31')][_0x560a('0x18d')](_0x529b8d[_0x560a('0x61')]['replace'](/\s+/g,''),_0x529b8d['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x160f1f){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x18e'),_0x160f1f['label']));return this['channel'][_0x560a('0x18f')](_0x160f1f[_0x560a('0x58')],_0x160f1f[_0x560a('0x17d')]);};AGIVertices[_0x560a('0xb')]['sendMail']=function(_0x435bee){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x190'),_0x435bee['label']));if(!this['isConfigured'](_0x435bee[_0x560a('0x191')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x192'));}var _0x58719e=this['getMailAccount'][_0x560a('0x6d')](this,_0x435bee['account_id']);if(!_0x58719e||!_0x58719e['Smtp']){return this[_0x560a('0x31')]['error'](_0x435bee,'no\x20mail\x20account\x20found');}var _0x19db31={'from':util[_0x560a('0x22')](_0x560a('0x193'),_0x58719e[_0x560a('0xf')],_0x58719e[_0x560a('0x194')]||_0x58719e[_0x560a('0x195')][_0x560a('0x196')]),'to':_0x435bee['to']||'','cc':_0x435bee['cc']||'','bcc':_0x435bee['bcc']||'','subject':_0x435bee['subject'],'html':_0x435bee[_0x560a('0x58')],'text':_0x435bee[_0x560a('0x58')]};if(this['isConfigured'](_0x435bee['template_id'])){}logger[_0x560a('0x197')]('sendMail\x20message',JSON[_0x560a('0x70')](_0x19db31));this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x435bee,_0x435bee[_0x560a('0x191')]);this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x58719e[_0x560a('0xf')]));this[_0x560a('0x198')]['sync'](this,_0x58719e[_0x560a('0x199')],_0x19db31);return this[_0x560a('0x31')][_0x560a('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x560a('0xb')][_0x560a('0x19a')]=function(_0x37121a){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x19b'),_0x37121a[_0x560a('0xa4')]));return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x19c'));};AGIVertices[_0x560a('0xb')][_0x560a('0x19d')]=function(_0x32a15d){logger[_0x560a('0x27')](util['format'](_0x560a('0x19e'),_0x32a15d['label']));if(!this[_0x560a('0x82')](_0x32a15d[_0x560a('0x19f')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1a0'));}var _0x5d311a=this[_0x560a('0x2d')][_0x560a('0x6d')](this,_0x32a15d['sms_account_id']);if(!_0x5d311a){return this[_0x560a('0x31')]['error'](_0x32a15d,_0x560a('0x1a1'));}var _0x2c79c3={'body':_0x32a15d[_0x560a('0x1a2')],'phone':_0x32a15d['to']||'','SmsAccountId':_0x5d311a['id']};logger['debug'](_0x560a('0x1a3'),JSON['stringify'](_0x2c79c3));this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x32a15d,_0x32a15d[_0x560a('0x19f')]);this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1a4'),_0x5d311a[_0x560a('0xf')]));this[_0x560a('0x2f')]['sync'](this,_0x2c79c3);return this['channel']['noop'](_0x560a('0x1a5'));};AGIVertices[_0x560a('0xb')][_0x560a('0x1a6')]=function(_0x556382){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x1a7'),_0x556382[_0x560a('0xa4')]));if(!this['isConfigured'](_0x556382[_0x560a('0xd3')])){return this[_0x560a('0x31')]['error'](_0x556382,_0x560a('0x1a8'));}var _0x939b16=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x556382[_0x560a('0xd3')]);if(!_0x939b16){return this[_0x560a('0x31')][_0x560a('0x25')](_0x556382,_0x560a('0x118'));}return this[_0x560a('0x31')][_0x560a('0x99')](_0x939b16,_0x556382[_0x560a('0x1a9')]);};AGIVertices[_0x560a('0xb')][_0x560a('0x1aa')]=function(_0x18aa8a){logger['info'](util[_0x560a('0x22')]('Enter\x20in\x20START\x20(%s)\x20block',_0x18aa8a[_0x560a('0xa4')]));this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1ab'));if(_0x18aa8a[_0x560a('0xb4')]===_0x560a('0x1ac')){this[_0x560a('0x31')][_0x560a('0xa7')]('Answer');return this[_0x560a('0x31')][_0x560a('0xb4')]();}return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1ad'));};AGIVertices[_0x560a('0xb')][_0x560a('0x1ae')]=function(_0x1e918b){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x1af'),_0x1e918b['label']));if(!this[_0x560a('0x82')](_0x1e918b[_0x560a('0x1b0')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1e918b,_0x560a('0x1b1'));}var _0x590357=this['getSquareProject']['sync'](this,_0x1e918b[_0x560a('0x1b0')]);if(!this['isConfigured'](_0x590357)){return this[_0x560a('0x31')]['error'](_0x1e918b,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x1e918b[_0x560a('0x1b0')]));}if(_0x590357===this['channel'][_0x560a('0x33')]){return this[_0x560a('0x31')][_0x560a('0x25')](_0x1e918b,_0x560a('0x1b2'));}this['createSquareDetailsReport'][_0x560a('0x6d')](this,_0x1e918b,_0x590357);var _0x273a5a=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0x1b3'),util[_0x560a('0x22')](_0x560a('0x1b4'),config[_0x560a('0xb1')][_0x560a('0x1b5')]||_0x560a('0x1b6'),_0x590357,this[_0x560a('0x31')][_0x560a('0x33')]));if(_0x273a5a['result']===-0x1){return _0x273a5a;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x1b3'),_0x590357));};AGIVertices[_0x560a('0xb')][_0x560a('0x1b7')]=function(_0x570f99){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x1b8'),_0x570f99[_0x560a('0xa4')]));var _0x150358=this[_0x560a('0x1b9')]['sync'](this,_0x570f99[_0x560a('0xb3')]);this[_0x560a('0x30')][_0x560a('0x6d')](this,_0x570f99,_0x570f99[_0x560a('0xb3')]);if(this['isConfigured'](_0x570f99[_0x560a('0xd3')])){var _0x1928d1=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x570f99[_0x560a('0xd3')]);if(_0x1928d1){this['channel'][_0x560a('0x99')](_0x1928d1,_0x150358);return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1ba'),_0x570f99[_0x560a('0xb3')],_0x1928d1));}}return this[_0x560a('0x31')][_0x560a('0xa7')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x570f99[_0x560a('0xb3')]));};AGIVertices[_0x560a('0xb')][_0x560a('0x1bb')]=function(_0x3f0db0){logger[_0x560a('0x27')](util['format'](_0x560a('0x1bc'),_0x3f0db0[_0x560a('0xa4')]));_0x3f0db0[_0x560a('0x58')]=_0x3f0db0[_0x560a('0x58')][_0x560a('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3f0db0[_0x560a('0x56')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0x1bd'));}if(!this[_0x560a('0x82')](_0x3f0db0[_0x560a('0x58')])){return this[_0x560a('0x31')][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1be'),_0x3f0db0['text']));var _0x173d99=this[_0x560a('0x55')][_0x560a('0x6d')](this,_0x3f0db0);if(_0x173d99){this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x1bf'),_0x173d99));var _0x3e9d2b=this[_0x560a('0x31')][_0x560a('0x124')](_0x173d99);try{fs[_0x560a('0x101')](_0x173d99+_0x560a('0x125'));}catch(_0x5f3a38){logger['error'](_0x5f3a38);}return _0x3e9d2b;}return this['channel']['error'](_0x3f0db0,_0x560a('0x1c0'));};AGIVertices[_0x560a('0xb')]['tts']=function(_0x272b52){logger['info'](util[_0x560a('0x22')](_0x560a('0x1c1'),_0x272b52[_0x560a('0xa4')]));_0x272b52[_0x560a('0x58')]=_0x272b52[_0x560a('0x58')][_0x560a('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x272b52[_0x560a('0x58')])){return this['channel'][_0x560a('0xa7')](_0x560a('0xa5'));}this[_0x560a('0x31')]['noop'](util['format']('Trying\x20Google\x20TTS\x20%s',_0x272b52[_0x560a('0x58')]));var _0x1fa111=this[_0x560a('0x5e')][_0x560a('0x6d')](this,_0x272b52);if(_0x1fa111){this[_0x560a('0x31')]['noop'](util[_0x560a('0x22')]('Google\x20TTS\x20%s\x20file\x20created',_0x1fa111));var _0x16d232=this[_0x560a('0x31')]['streamFile'](_0x1fa111);try{fs[_0x560a('0x101')](_0x1fa111+'.wav');}catch(_0x26e07b){logger[_0x560a('0x25')](_0x26e07b);}return _0x16d232;}return this[_0x560a('0x31')][_0x560a('0x25')](_0x272b52,_0x560a('0x1c2'));};AGIVertices[_0x560a('0xb')][_0x560a('0x1c3')]=function(_0x446066){logger['info'](util[_0x560a('0x22')](_0x560a('0x1c4'),_0x446066[_0x560a('0xa4')]));if(!this[_0x560a('0x82')](_0x446066[_0x560a('0x157')])){return this[_0x560a('0x31')][_0x560a('0x25')](_0x446066,_0x560a('0x16a'));}logger['info'](util[_0x560a('0x22')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x560a('0x31')][_0x560a('0x34')],_0x446066['findBy']));var _0x2b66c1=this['agentUnpause'][_0x560a('0x6d')](this,_0x446066[_0x560a('0x157')]);if(_0x2b66c1){logger[_0x560a('0x27')](util[_0x560a('0x22')](_0x560a('0x159'),this[_0x560a('0x31')][_0x560a('0x34')],_0x446066[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x159'),this['channel'][_0x560a('0x34')],_0x446066['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x446066[_0x560a('0x157')]));this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0x15a'),this[_0x560a('0x31')][_0x560a('0x34')],_0x446066['findBy']));return{'code':0xc8,'result':_0x560a('0x15b')};}};AGIVertices['prototype'][_0x560a('0x1c5')]=function(_0x411b22){logger['info'](util[_0x560a('0x22')](_0x560a('0x1c6'),_0x411b22[_0x560a('0xa4')]));var _0x162524=this[_0x560a('0x31')][_0x560a('0xa6')](_0x560a('0x1c7'),[_0x411b22['mailbox'],_0x411b22[_0x560a('0x75')]]);if(_0x162524[_0x560a('0x9e')]===-0x1){return _0x162524;}return this[_0x560a('0x31')][_0x560a('0xa7')](util[_0x560a('0x22')](_0x560a('0xbe'),_0x560a('0x1c7'),_0x411b22[_0x560a('0x1c8')]));};AGIVertices[_0x560a('0xb')][_0x560a('0x1c9')]=function(_0x13d783){logger[_0x560a('0x27')](util[_0x560a('0x22')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x13d783['label']));if(!this[_0x560a('0x82')](_0x13d783[_0x560a('0xd3')])){return this['channel'][_0x560a('0x25')](_0x13d783,_0x560a('0x1a8'));}var _0x366e92=this[_0x560a('0xc')][_0x560a('0x6d')](this,_0x13d783[_0x560a('0xd3')]);if(!_0x366e92){return this[_0x560a('0x31')]['error'](_0x13d783,_0x560a('0x118'));}var _0x2f2d9a=this[_0x560a('0x31')][_0x560a('0xc')](_0x366e92);return{'code':0xc8,'result':_0x2f2d9a['extra']?_0x2f2d9a[_0x560a('0x9c')]:'-'};};String[_0x560a('0xb')][_0x560a('0x9b')]=function(_0x1b6091,_0x3136d0){return this[_0x560a('0x9a')](_0x1b6091)[_0x560a('0x1ca')](_0x3136d0);};module[_0x560a('0x1cb')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 6f1b245..e8971ed 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 _0x5750=['lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','message','uniqueid','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','attended','linkedid','isUndefined','[ACW][syncHangupRequest]\x20%s','syncHangup','[%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','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw'];(function(_0x41a804,_0xcde371){var _0x26870d=function(_0x46fb2a){while(--_0x46fb2a){_0x41a804['push'](_0x41a804['shift']());}};_0x26870d(++_0xcde371);}(_0x5750,0x170));var _0x0575=function(_0x2e877e,_0x2f2ebf){_0x2e877e=_0x2e877e-0x0;var _0x41b326=_0x5750[_0x2e877e];return _0x41b326;};'use strict';var _=require(_0x0575('0x0'));var moment=require(_0x0575('0x1'));var ami=require(_0x0575('0x2'));var logger=require('../../../config/logger')(_0x0575('0x3'));var RpcUser=require(_0x0575('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0xc5f7ac){this[_0x0575('0x5')]=_0xc5f7ac[_0x0575('0x5')];this['agents']=_0xc5f7ac[_0x0575('0x6')];this['timers']=_0xc5f7ac[_0x0575('0x7')];this[_0x0575('0x8')]={};ami['on'](_0x0575('0x9'),this[_0x0575('0xa')][_0x0575('0xb')](this));ami['on'](_0x0575('0xc'),this[_0x0575('0xd')][_0x0575('0xb')](this));ami['on'](_0x0575('0xe'),this['syncHangup'][_0x0575('0xb')](this));ami['on'](_0x0575('0xf'),this[_0x0575('0x10')]['bind'](this));ami['on'](_0x0575('0x11'),this[_0x0575('0x12')]['bind'](this));ami['on'](_0x0575('0x13'),this[_0x0575('0x14')][_0x0575('0xb')](this));ami['on'](_0x0575('0x15'),this[_0x0575('0x16')]['bind'](this));}function getDiff(_0x38ef21){var _0x4bc162=moment()[_0x0575('0x17')](0x0);var _0x59fc52=moment(_0x38ef21)[_0x0575('0x17')](0x0);return _0x4bc162['diff'](_0x59fc52,_0x0575('0x18'));}Acw[_0x0575('0x19')][_0x0575('0x1a')]=function(_0x5ddbf4){try{var _0x4fa60a=this;var _0x19bbbc=this[_0x0575('0x8')][_0x5ddbf4][_0x0575('0x1b')];var _0x4c4285=this[_0x0575('0x8')][_0x5ddbf4][_0x0575('0x1c')];var _0x27d33d=this['voiceQueues'][_0x4c4285];var _0x255523=![];var _0xfce718='ACW';if(_0x27d33d[_0x0575('0x1d')]){if(_0x27d33d[_0x0575('0x1e')][_0x0575('0x1f')]){_0x255523=!![];_0xfce718=_0x27d33d[_0x0575('0x1e')]['name'];}}return ami['Action']({'action':_0x0575('0x20'),'interface':_0x19bbbc,'paused':!![],'reason':_0xfce718})[_0x0575('0x21')](function(){if(_0x4fa60a[_0x0575('0x6')][_0x19bbbc]){return RpcUser[_0x0575('0x22')](_0x4fa60a[_0x0575('0x6')][_0x19bbbc]['id'])[_0x0575('0x21')](function(_0x5a0411){if(_0x5a0411&&!_0x5a0411[_0x0575('0x23')]){logger[_0x0575('0x24')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5ddbf4,_0x19bbbc,_0x4c4285);var _0x1defda=_0x4fa60a['channels'][_0x5ddbf4]['attended']&&_0x4fa60a['channels'][_0x5ddbf4][_0x0575('0x25')]?_0x4fa60a[_0x0575('0x8')][_0x5ddbf4][_0x0575('0x25')]:_0x5ddbf4;return RpcUser[_0x0575('0x26')](_0x4fa60a['agents'][_0x19bbbc],_0xfce718,_0x1defda)[_0x0575('0x21')](function(){if(!_0x255523){_0x4fa60a['timers'][_0x19bbbc]={};logger['info'](_0x0575('0x27'),_0x5ddbf4,_0x4fa60a['voiceQueues'][_0x4c4285]['acwTimeout'],_0x19bbbc,_0x4c4285);_0x4fa60a[_0x0575('0x7')][_0x19bbbc][_0x0575('0x28')]=setTimeout(_0x4fa60a[_0x0575('0x29')][_0x0575('0xb')](_0x4fa60a,_0x19bbbc),_0x4fa60a['voiceQueues'][_0x4c4285]['acwTimeout']*0x3e8);_0x4fa60a['timers'][_0x19bbbc][_0x0575('0x2a')]=moment()[_0x0575('0x2b')](_0x0575('0x2c'));_0x4fa60a['timers'][_0x19bbbc]['uniqueid']=_0x5ddbf4;_0x4fa60a[_0x0575('0x7')][_0x19bbbc][_0x0575('0x1c')]=_0x4c4285;_0x4fa60a[_0x0575('0x7')][_0x19bbbc][_0x0575('0x2d')]=function(){var _0x1b6338=getDiff(_0x4fa60a[_0x0575('0x7')][_0x19bbbc][_0x0575('0x2a')]);clearTimeout(_0x4fa60a['timers'][_0x19bbbc]['timer']);_0x4fa60a[_0x0575('0x7')][_0x19bbbc][_0x0575('0x28')]=![];RpcVoiceAgentReport[_0x0575('0x2e')]({'acwtime':_0x1b6338},_0x4fa60a[_0x0575('0x7')][_0x19bbbc]['uniqueid'],_0x19bbbc)[_0x0575('0x21')](function(_0x414fb6){logger['info'](_0x0575('0x2f'),_0x5ddbf4,_0x1b6338,_0x414fb6);})[_0x0575('0x30')](function(_0x2d2605){logger[_0x0575('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x5ddbf4,_0x2d2605);});delete _0x4fa60a[_0x0575('0x7')][_0x19bbbc];};}});}else{logger[_0x0575('0x24')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5ddbf4,_0x19bbbc,_0x4c4285);}});}})[_0x0575('0x30')](function(){logger[_0x0575('0x31')](_0x0575('0x27'),_0x5ddbf4,_0x4fa60a[_0x0575('0x5')][_0x4c4285]['acwTimeout'],_0x19bbbc,_0x4c4285);})['finally'](function(){delete _0x4fa60a[_0x0575('0x8')][_0x5ddbf4];});}catch(_0x421030){logger[_0x0575('0x31')]('[ACW][START]\x20%s',_0x421030[_0x0575('0x32')]);}};Acw['prototype']['stopAcw']=function(_0x59e701){try{var _0x50cab7=this;if(_0x50cab7['timers'][_0x59e701]){_0x50cab7[_0x0575('0x7')][_0x59e701][_0x0575('0x28')]=![];var _0x172ba9=_0x50cab7[_0x0575('0x7')][_0x59e701][_0x0575('0x33')];var _0x340779=_0x50cab7[_0x0575('0x7')][_0x59e701][_0x0575('0x1c')];var _0x43cfa4=_0x50cab7[_0x0575('0x5')][_0x340779]['acwTimeout'];logger[_0x0575('0x24')]('[%s][TIMER][STOP][AGENT:%s]',_0x172ba9,_0x59e701);RpcUser[_0x0575('0x34')](this[_0x0575('0x6')][_0x59e701]);RpcVoiceAgentReport['update']({'acwtime':_0x43cfa4,'agentacw':!![]},_0x172ba9,_0x59e701)[_0x0575('0x21')](function(_0xabda02){logger[_0x0575('0x24')](_0x0575('0x2f'),_0x172ba9,_0x43cfa4,_0xabda02);})[_0x0575('0x30')](function(_0x4b285c){logger[_0x0575('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x172ba9,_0x4b285c);});}else{logger['error'](_0x0575('0x35'),_0x59e701);if(_0x50cab7[_0x0575('0x7')]){logger[_0x0575('0x24')](_0x0575('0x36'),JSON[_0x0575('0x37')](_0x50cab7['timers']));}}}catch(_0x48662b){logger[_0x0575('0x31')](_0x0575('0x38'),_0x48662b[_0x0575('0x32')]);}};Acw['prototype'][_0x0575('0xa')]=function(_0x40b17d){try{if(this[_0x0575('0x5')][_0x40b17d[_0x0575('0x1c')]]&&(this['voiceQueues'][_0x40b17d['queue']][_0x0575('0x3')]||this[_0x0575('0x5')][_0x40b17d[_0x0575('0x1c')]]['mandatoryDisposition'])){if(this[_0x0575('0x6')][_0x40b17d[_0x0575('0x1b')]]){this[_0x0575('0x8')][_0x40b17d['uniqueid']]={'queue':_0x40b17d[_0x0575('0x1c')],'interface':_0x40b17d[_0x0575('0x1b')],'destlinkedid':_0x40b17d[_0x0575('0x25')]};}}}catch(_0x316258){logger[_0x0575('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x316258[_0x0575('0x32')]);}};Acw[_0x0575('0x19')][_0x0575('0x16')]=function(_0x46b578){try{if(this[_0x0575('0x5')][_0x46b578[_0x0575('0x1c')]]&&(this['voiceQueues'][_0x46b578[_0x0575('0x1c')]]['acw']||this[_0x0575('0x5')][_0x46b578['queue']][_0x0575('0x1d')])){if(this[_0x0575('0x6')][_0x46b578[_0x0575('0x1b')]]){this[_0x0575('0x8')][_0x46b578['uniqueid']]={'queue':_0x46b578[_0x0575('0x1c')],'interface':_0x46b578[_0x0575('0x1b')]};}}}catch(_0x365ea0){logger[_0x0575('0x31')](_0x0575('0x39'),_0x365ea0[_0x0575('0x32')]);}};Acw['prototype'][_0x0575('0xd')]=function(_0x5bb6b4){try{if(this['channels'][_0x5bb6b4['uniqueid']]&&_['isUndefined'](this[_0x0575('0x8')][_0x5bb6b4[_0x0575('0x33')]][_0x0575('0x3a')])){logger[_0x0575('0x24')]('[%s][HANGUP:UNIQUEID]',_0x5bb6b4['uniqueid']);this[_0x0575('0x1a')](_0x5bb6b4[_0x0575('0x33')]);}else if(this[_0x0575('0x8')][_0x5bb6b4[_0x0575('0x3b')]]&&_[_0x0575('0x3c')](this[_0x0575('0x8')][_0x5bb6b4[_0x0575('0x3b')]]['attended'])){logger[_0x0575('0x24')]('[%s][HANGUP:LINKEDID]',_0x5bb6b4['linkedid']);this[_0x0575('0x1a')](_0x5bb6b4[_0x0575('0x3b')]);}}catch(_0x2911d9){logger[_0x0575('0x31')](_0x0575('0x3d'),_0x2911d9[_0x0575('0x32')]);}};Acw[_0x0575('0x19')][_0x0575('0x3e')]=function(_0x521386){try{if(this['channels'][_0x521386['uniqueid']]&&this['channels'][_0x521386[_0x0575('0x33')]][_0x0575('0x3a')]){logger['info'](_0x0575('0x3f'),_0x521386['uniqueid']);this['startAcw'](_0x521386[_0x0575('0x33')]);}else if(this['channels'][_0x521386[_0x0575('0x3b')]]&&this[_0x0575('0x8')][_0x521386[_0x0575('0x3b')]][_0x0575('0x3a')]){logger['info'](_0x0575('0x40'),_0x521386[_0x0575('0x3b')]);this[_0x0575('0x1a')](_0x521386['linkedid']);}}catch(_0x75bfa5){logger[_0x0575('0x31')](_0x0575('0x41'),_0x75bfa5['message']);}};Acw[_0x0575('0x19')]['syncAttendedTransfer']=function(_0x10ff30){try{if(!_[_0x0575('0x42')](this[_0x0575('0x8')][_0x10ff30[_0x0575('0x43')]])){this['startAcw'](_0x10ff30['transfereeuniqueid']);if(this[_0x0575('0x8')][_0x10ff30[_0x0575('0x44')]]){this[_0x0575('0x8')][_0x10ff30[_0x0575('0x44')]][_0x0575('0x3a')]=!![];this[_0x0575('0x8')][_0x10ff30[_0x0575('0x45')]]=this['channels'][_0x10ff30['secondtransfereruniqueid']];delete this[_0x0575('0x8')][_0x10ff30['secondtransfereruniqueid']];}}else if(!_[_0x0575('0x42')](this[_0x0575('0x8')][_0x10ff30[_0x0575('0x45')]])){this[_0x0575('0x1a')](_0x10ff30['transfertargetuniqueid']);if(this[_0x0575('0x8')][_0x10ff30[_0x0575('0x46')]]){this[_0x0575('0x8')][_0x10ff30['origtransfereruniqueid']][_0x0575('0x3a')]=!![];this[_0x0575('0x8')][_0x10ff30['transfereeuniqueid']]=this[_0x0575('0x8')][_0x10ff30[_0x0575('0x46')]];delete this[_0x0575('0x8')][_0x10ff30[_0x0575('0x46')]];}}}catch(_0x17acd4){logger['error'](_0x0575('0x47'),_0x17acd4['message']);}};Acw['prototype']['syncBlindTransfer']=function(_0x16c2b7){try{if(this[_0x0575('0x8')][_0x16c2b7[_0x0575('0x48')]]){logger['info'](_0x0575('0x49'),JSON[_0x0575('0x37')](_0x16c2b7['transfereruniqueid']));this[_0x0575('0x1a')](_0x16c2b7[_0x0575('0x48')]);}else if(this[_0x0575('0x8')][_0x16c2b7[_0x0575('0x4a')]]){logger[_0x0575('0x24')](_0x0575('0x4b'),JSON[_0x0575('0x37')](_0x16c2b7['transfererlinkedid']));this[_0x0575('0x1a')](_0x16c2b7[_0x0575('0x4a')]);}}catch(_0x561d83){logger[_0x0575('0x31')](_0x0575('0x4c'),_0x561d83[_0x0575('0x32')]);}};Acw[_0x0575('0x19')]['syncAgentRingNoAnswer']=function(_0xa1cc8a){try{if(this[_0x0575('0x5')][_0xa1cc8a[_0x0575('0x1c')]]&&this[_0x0575('0x5')][_0xa1cc8a['queue']]['autopause']===_0x0575('0x4d')){if(this['agents'][_0xa1cc8a[_0x0575('0x1b')]]){logger[_0x0575('0x24')](_0x0575('0x4e'),_0xa1cc8a[_0x0575('0x33')],_0xa1cc8a[_0x0575('0x1b')],_0xa1cc8a[_0x0575('0x1c')]);return RpcUser[_0x0575('0x26')](this[_0x0575('0x6')][_0xa1cc8a[_0x0575('0x1b')]],_0x0575('0x4f'),_0xa1cc8a[_0x0575('0x33')]);}}}catch(_0x4171fc){logger[_0x0575('0x31')](_0x0575('0x50'),_0x4171fc[_0x0575('0x32')]);}};module[_0x0575('0x51')]=Acw; \ No newline at end of file +var _0x226c=['../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','seconds','startAcw','queue','ACW','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','prototype','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','acw','../rpc/user'];(function(_0x757536,_0x24797c){var _0x55753d=function(_0x17f11c){while(--_0x17f11c){_0x757536['push'](_0x757536['shift']());}};_0x55753d(++_0x24797c);}(_0x226c,0x19f));var _0xc226=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x226c[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xc226('0x0'));var moment=require(_0xc226('0x1'));var ami=require(_0xc226('0x2'));var logger=require('../../../config/logger')(_0xc226('0x3'));var RpcUser=require(_0xc226('0x4'));var RpcVoiceAgentReport=require(_0xc226('0x5'));function Acw(_0x3fa4ab){this[_0xc226('0x6')]=_0x3fa4ab[_0xc226('0x6')];this['agents']=_0x3fa4ab[_0xc226('0x7')];this[_0xc226('0x8')]=_0x3fa4ab[_0xc226('0x8')];this[_0xc226('0x9')]={};ami['on'](_0xc226('0xa'),this['syncAgentConnect'][_0xc226('0xb')](this));ami['on'](_0xc226('0xc'),this[_0xc226('0xd')][_0xc226('0xb')](this));ami['on'](_0xc226('0xe'),this[_0xc226('0xf')]['bind'](this));ami['on'](_0xc226('0x10'),this['syncAgentRingNoAnswer'][_0xc226('0xb')](this));ami['on']('attendedtransfer',this[_0xc226('0x11')][_0xc226('0xb')](this));ami['on'](_0xc226('0x12'),this['syncBlindTransfer'][_0xc226('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0xc226('0x13')]['bind'](this));}function getDiff(_0x5aebe9){var _0x262619=moment()[_0xc226('0x14')](0x0);var _0x51f57e=moment(_0x5aebe9)[_0xc226('0x14')](0x0);return _0x262619['diff'](_0x51f57e,_0xc226('0x15'));}Acw['prototype'][_0xc226('0x16')]=function(_0x2a3662){try{var _0x51482e=this;var _0x36c376=this['channels'][_0x2a3662]['interface'];var _0x168dcb=this['channels'][_0x2a3662][_0xc226('0x17')];var _0x596e7a=this['voiceQueues'][_0x168dcb];var _0x465b7f=![];var _0x5a8a96=_0xc226('0x18');if(_0x596e7a['mandatoryDisposition']){if(_0x596e7a['mandatoryDispositionPause'][_0xc226('0x19')]){_0x465b7f=!![];_0x5a8a96=_0x596e7a[_0xc226('0x1a')][_0xc226('0x19')];}}return ami[_0xc226('0x1b')]({'action':_0xc226('0x1c'),'interface':_0x36c376,'paused':!![],'reason':_0x5a8a96})[_0xc226('0x1d')](function(){if(_0x51482e[_0xc226('0x7')][_0x36c376]){return RpcUser[_0xc226('0x1e')](_0x51482e[_0xc226('0x7')][_0x36c376]['id'])[_0xc226('0x1d')](function(_0x1f11de){if(_0x1f11de&&!_0x1f11de[_0xc226('0x1f')]){logger[_0xc226('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2a3662,_0x36c376,_0x168dcb);var _0x17c202=_0x51482e[_0xc226('0x9')][_0x2a3662][_0xc226('0x21')]&&_0x51482e['channels'][_0x2a3662]['destlinkedid']?_0x51482e[_0xc226('0x9')][_0x2a3662][_0xc226('0x22')]:_0x2a3662;return RpcUser['savePause'](_0x51482e[_0xc226('0x7')][_0x36c376],_0x5a8a96,_0x17c202)[_0xc226('0x1d')](function(){if(!_0x465b7f){_0x51482e[_0xc226('0x8')][_0x36c376]={};logger[_0xc226('0x20')](_0xc226('0x23'),_0x2a3662,_0x51482e[_0xc226('0x6')][_0x168dcb]['acwTimeout'],_0x36c376,_0x168dcb);_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x24')]=setTimeout(_0x51482e[_0xc226('0x25')]['bind'](_0x51482e,_0x36c376),_0x51482e[_0xc226('0x6')][_0x168dcb]['acwTimeout']*0x3e8);_0x51482e[_0xc226('0x8')][_0x36c376]['lastPauseAt']=moment()['format'](_0xc226('0x26'));_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x27')]=_0x2a3662;_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x17')]=_0x168dcb;_0x51482e['timers'][_0x36c376][_0xc226('0x28')]=function(){var _0x2abea9=getDiff(_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x29')]);clearTimeout(_0x51482e[_0xc226('0x8')][_0x36c376][_0xc226('0x24')]);_0x51482e['timers'][_0x36c376]['timer']=![];RpcVoiceAgentReport[_0xc226('0x2a')]({'acwtime':_0x2abea9},_0x51482e['timers'][_0x36c376][_0xc226('0x27')],_0x36c376)[_0xc226('0x1d')](function(_0x2a1398){logger[_0xc226('0x20')](_0xc226('0x2b'),_0x2a3662,_0x2abea9,_0x2a1398);})[_0xc226('0x2c')](function(_0x205275){logger[_0xc226('0x2d')]('[%s][UPDATE][ERRORS:%s]',_0x2a3662,_0x205275);});delete _0x51482e[_0xc226('0x8')][_0x36c376];};}});}else{logger[_0xc226('0x20')](_0xc226('0x2e'),_0x2a3662,_0x36c376,_0x168dcb);}});}})[_0xc226('0x2c')](function(){logger[_0xc226('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2a3662,_0x51482e[_0xc226('0x6')][_0x168dcb][_0xc226('0x2f')],_0x36c376,_0x168dcb);})['finally'](function(){delete _0x51482e['channels'][_0x2a3662];});}catch(_0x44499e){logger[_0xc226('0x2d')]('[ACW][START]\x20%s',_0x44499e[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x25')]=function(_0x3544a3){try{var _0x3d468e=this;if(_0x3d468e[_0xc226('0x8')][_0x3544a3]){_0x3d468e[_0xc226('0x8')][_0x3544a3][_0xc226('0x24')]=![];var _0x2be7a0=_0x3d468e[_0xc226('0x8')][_0x3544a3][_0xc226('0x27')];var _0x58b5f0=_0x3d468e[_0xc226('0x8')][_0x3544a3][_0xc226('0x17')];var _0x8b962c=_0x3d468e[_0xc226('0x6')][_0x58b5f0]['acwTimeout'];logger['info'](_0xc226('0x31'),_0x2be7a0,_0x3544a3);RpcUser[_0xc226('0x32')](this[_0xc226('0x7')][_0x3544a3]);RpcVoiceAgentReport[_0xc226('0x2a')]({'acwtime':_0x8b962c,'agentacw':!![]},_0x2be7a0,_0x3544a3)['then'](function(_0x5462fc){logger[_0xc226('0x20')](_0xc226('0x2b'),_0x2be7a0,_0x8b962c,_0x5462fc);})['catch'](function(_0x318ef1){logger[_0xc226('0x2d')](_0xc226('0x33'),_0x2be7a0,_0x318ef1);});}else{logger[_0xc226('0x2d')](_0xc226('0x34'),_0x3544a3);if(_0x3d468e['timers']){logger[_0xc226('0x20')](_0xc226('0x35'),JSON['stringify'](_0x3d468e[_0xc226('0x8')]));}}}catch(_0x4547ab){logger[_0xc226('0x2d')](_0xc226('0x36'),_0x4547ab[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x37')]=function(_0x3b3d39){try{if(this[_0xc226('0x6')][_0x3b3d39['queue']]&&(this[_0xc226('0x6')][_0x3b3d39[_0xc226('0x17')]][_0xc226('0x3')]||this[_0xc226('0x6')][_0x3b3d39[_0xc226('0x17')]][_0xc226('0x38')])){if(this[_0xc226('0x7')][_0x3b3d39['interface']]){this[_0xc226('0x9')][_0x3b3d39[_0xc226('0x27')]]={'queue':_0x3b3d39[_0xc226('0x17')],'interface':_0x3b3d39[_0xc226('0x39')],'destlinkedid':_0x3b3d39[_0xc226('0x22')]};}}}catch(_0x41b0b2){logger[_0xc226('0x2d')](_0xc226('0x3a'),_0x41b0b2['message']);}};Acw['prototype'][_0xc226('0x13')]=function(_0x5d9c07){try{if(this['voiceQueues'][_0x5d9c07[_0xc226('0x17')]]&&(this[_0xc226('0x6')][_0x5d9c07[_0xc226('0x17')]][_0xc226('0x3')]||this['voiceQueues'][_0x5d9c07['queue']][_0xc226('0x38')])){if(this[_0xc226('0x7')][_0x5d9c07[_0xc226('0x39')]]){this[_0xc226('0x9')][_0x5d9c07['uniqueid']]={'queue':_0x5d9c07[_0xc226('0x17')],'interface':_0x5d9c07[_0xc226('0x39')]};}}}catch(_0x3313e3){logger['error'](_0xc226('0x3b'),_0x3313e3[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0xd')]=function(_0x5a7925){try{if(this[_0xc226('0x9')][_0x5a7925[_0xc226('0x27')]]&&_['isUndefined'](this[_0xc226('0x9')][_0x5a7925[_0xc226('0x27')]][_0xc226('0x21')])){logger[_0xc226('0x20')]('[%s][HANGUP:UNIQUEID]',_0x5a7925['uniqueid']);this['startAcw'](_0x5a7925['uniqueid']);}else if(this['channels'][_0x5a7925[_0xc226('0x3c')]]&&_[_0xc226('0x3d')](this['channels'][_0x5a7925[_0xc226('0x3c')]][_0xc226('0x21')])){logger[_0xc226('0x20')](_0xc226('0x3e'),_0x5a7925[_0xc226('0x3c')]);this[_0xc226('0x16')](_0x5a7925['linkedid']);}}catch(_0x3732ea){logger[_0xc226('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x3732ea[_0xc226('0x30')]);}};Acw['prototype']['syncHangup']=function(_0x1b1cd3){try{if(this[_0xc226('0x9')][_0x1b1cd3[_0xc226('0x27')]]&&this[_0xc226('0x9')][_0x1b1cd3[_0xc226('0x27')]][_0xc226('0x21')]){logger[_0xc226('0x20')](_0xc226('0x3f'),_0x1b1cd3[_0xc226('0x27')]);this['startAcw'](_0x1b1cd3[_0xc226('0x27')]);}else if(this[_0xc226('0x9')][_0x1b1cd3[_0xc226('0x3c')]]&&this['channels'][_0x1b1cd3[_0xc226('0x3c')]][_0xc226('0x21')]){logger[_0xc226('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1b1cd3[_0xc226('0x3c')]);this[_0xc226('0x16')](_0x1b1cd3[_0xc226('0x3c')]);}}catch(_0x494c44){logger[_0xc226('0x2d')](_0xc226('0x40'),_0x494c44[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x11')]=function(_0x1954f7){try{if(!_[_0xc226('0x41')](this[_0xc226('0x9')][_0x1954f7[_0xc226('0x42')]])){this[_0xc226('0x16')](_0x1954f7[_0xc226('0x42')]);if(this['channels'][_0x1954f7[_0xc226('0x43')]]){this[_0xc226('0x9')][_0x1954f7[_0xc226('0x43')]][_0xc226('0x21')]=!![];this[_0xc226('0x9')][_0x1954f7['transfertargetuniqueid']]=this[_0xc226('0x9')][_0x1954f7[_0xc226('0x43')]];delete this[_0xc226('0x9')][_0x1954f7[_0xc226('0x43')]];}}else if(!_[_0xc226('0x41')](this['channels'][_0x1954f7[_0xc226('0x44')]])){this['startAcw'](_0x1954f7[_0xc226('0x44')]);if(this[_0xc226('0x9')][_0x1954f7[_0xc226('0x45')]]){this[_0xc226('0x9')][_0x1954f7['origtransfereruniqueid']][_0xc226('0x21')]=!![];this[_0xc226('0x9')][_0x1954f7['transfereeuniqueid']]=this[_0xc226('0x9')][_0x1954f7[_0xc226('0x45')]];delete this[_0xc226('0x9')][_0x1954f7[_0xc226('0x45')]];}}}catch(_0x24172b){logger[_0xc226('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x24172b[_0xc226('0x30')]);}};Acw['prototype'][_0xc226('0x46')]=function(_0x55bf85){try{if(this['channels'][_0x55bf85[_0xc226('0x47')]]){logger['info'](_0xc226('0x48'),JSON[_0xc226('0x49')](_0x55bf85[_0xc226('0x47')]));this[_0xc226('0x16')](_0x55bf85[_0xc226('0x47')]);}else if(this[_0xc226('0x9')][_0x55bf85['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xc226('0x49')](_0x55bf85['transfererlinkedid']));this[_0xc226('0x16')](_0x55bf85[_0xc226('0x4a')]);}}catch(_0x1b5b5b){logger['error'](_0xc226('0x4b'),_0x1b5b5b[_0xc226('0x30')]);}};Acw[_0xc226('0x4c')]['syncAgentRingNoAnswer']=function(_0x23efd0){try{if(this[_0xc226('0x6')][_0x23efd0[_0xc226('0x17')]]&&this[_0xc226('0x6')][_0x23efd0[_0xc226('0x17')]][_0xc226('0x4d')]===_0xc226('0x4e')){if(this[_0xc226('0x7')][_0x23efd0[_0xc226('0x39')]]){logger[_0xc226('0x20')](_0xc226('0x4f'),_0x23efd0[_0xc226('0x27')],_0x23efd0[_0xc226('0x39')],_0x23efd0[_0xc226('0x17')]);return RpcUser[_0xc226('0x50')](this['agents'][_0x23efd0[_0xc226('0x39')]],_0xc226('0x51'),_0x23efd0[_0xc226('0x27')]);}}}catch(_0x39cae5){logger[_0xc226('0x2d')](_0xc226('0x52'),_0x39cae5['message']);}};module[_0xc226('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 602e860..10589e8 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 _0x5d23=['bluebird','util','../../config/logger','ami','../../config/environment','asterisk','username','Action','promisify','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','format','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','[ami.js][fullybooted]','inspect'];(function(_0x1b98f1,_0x250d11){var _0x5ea105=function(_0x5105bc){while(--_0x5105bc){_0x1b98f1['push'](_0x1b98f1['shift']());}};_0x5ea105(++_0x250d11);}(_0x5d23,0x94));var _0x35d2=function(_0x101ebc,_0x1856bd){_0x101ebc=_0x101ebc-0x0;var _0x5527a2=_0x5d23[_0x101ebc];return _0x5527a2;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x35d2('0x0'));var util=require(_0x35d2('0x1'));var logger=require(_0x35d2('0x2'))(_0x35d2('0x3'));var config=require(_0x35d2('0x4'));var ami=new Manager(config[_0x35d2('0x5')]['port'],config[_0x35d2('0x5')]['ip'],config[_0x35d2('0x5')][_0x35d2('0x6')],config[_0x35d2('0x5')]['password'],!![]);ami['keepConnected']();ami[_0x35d2('0x7')]=BPromise[_0x35d2('0x8')](ami[_0x35d2('0x9')]);function error(_0x4b8726){logger['error'](util['format'](_0x35d2('0xa'),config[_0x35d2('0x5')][_0x35d2('0x6')],config[_0x35d2('0x5')]['ip'],config[_0x35d2('0x5')][_0x35d2('0xb')],util['inspect'](_0x4b8726,![],null)));}function close(){logger[_0x35d2('0xc')](util['format'](_0x35d2('0xd'),config[_0x35d2('0x5')][_0x35d2('0x6')],config['asterisk']['ip'],config[_0x35d2('0x5')][_0x35d2('0xb')]));}ami[_0x35d2('0xe')]=function(){return function(){return ami[_0x35d2('0x7')]({'action':_0x35d2('0xf')});};};ami[_0x35d2('0x10')]=function(){return function(){return ami[_0x35d2('0x7')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x35d2('0x7')]({'action':_0x35d2('0x11')});};};ami[_0x35d2('0x12')]=function(){return function(){return ami[_0x35d2('0x7')]({'action':'queuesummary'});};};ami[_0x35d2('0x13')]=function(){return function(){return ami['Action']({'action':_0x35d2('0x14')});};};function connect(){logger[_0x35d2('0x15')](util['format'](_0x35d2('0x16'),config[_0x35d2('0x5')][_0x35d2('0x6')],config[_0x35d2('0x5')]['ip'],config[_0x35d2('0x5')][_0x35d2('0xb')]));ami[_0x35d2('0x17')](_0x35d2('0xc'),error);ami[_0x35d2('0x17')](_0x35d2('0x18'),close);}ami['on'](_0x35d2('0x19'),connect);ami['on'](_0x35d2('0x1a'),function(_0x50f1e9){logger[_0x35d2('0x15')](util[_0x35d2('0x1b')](_0x35d2('0x1c'),config[_0x35d2('0x5')]['username'],config[_0x35d2('0x5')]['ip'],config[_0x35d2('0x5')]['port'],util['inspect'](_0x50f1e9,![],null)));});ami['on'](_0x35d2('0x1d'),function(){logger[_0x35d2('0x15')](util['format'](_0x35d2('0x1e'),config[_0x35d2('0x5')]['username'],config[_0x35d2('0x5')]['ip'],config[_0x35d2('0x5')][_0x35d2('0xb')]));return Promise[_0x35d2('0x1f')]()[_0x35d2('0x20')](ami['actionSipShowRegistry']())[_0x35d2('0x20')](ami[_0x35d2('0x10')]())['then'](ami[_0x35d2('0x21')]())['then'](ami[_0x35d2('0x12')]())[_0x35d2('0x20')](ami[_0x35d2('0x13')]())[_0x35d2('0x22')](function(_0x352f28){logger[_0x35d2('0xc')](_0x35d2('0x23'),util[_0x35d2('0x24')](_0x352f28,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami[_0x35d2('0x17')](_0x35d2('0x18'),close);module['exports']=ami; \ No newline at end of file +var _0x757e=['Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionSipPeerStatus','actionCoreShowChannels','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','action','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','queuesummary','info','once','close','connect','shutdown'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x757e,0x1b8));var _0xe757=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x757e[_0x14add3];return _0x4a174f;};'use strict';var Manager=require(_0xe757('0x0'));var BPromise=require(_0xe757('0x1'));var util=require(_0xe757('0x2'));var logger=require(_0xe757('0x3'))(_0xe757('0x4'));var config=require(_0xe757('0x5'));var ami=new Manager(config[_0xe757('0x6')][_0xe757('0x7')],config[_0xe757('0x6')]['ip'],config['asterisk'][_0xe757('0x8')],config['asterisk'][_0xe757('0x9')],!![]);ami[_0xe757('0xa')]();ami[_0xe757('0xb')]=BPromise['promisify'](ami[_0xe757('0xc')]);function error(_0x5f0ada){logger[_0xe757('0xd')](util[_0xe757('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config['asterisk'][_0xe757('0x7')],util[_0xe757('0xf')](_0x5f0ada,![],null)));}function close(){logger['error'](util[_0xe757('0xe')](_0xe757('0x10'),config[_0xe757('0x6')][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config[_0xe757('0x6')][_0xe757('0x7')]));}ami[_0xe757('0x11')]=function(){return function(){return ami[_0xe757('0xb')]({'action':_0xe757('0x12')});};};ami[_0xe757('0x13')]=function(){return function(){return ami[_0xe757('0xb')]({'action':_0xe757('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xe757('0x15')]=function(){return function(){return ami[_0xe757('0xb')]({'action':_0xe757('0x16')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xe757('0xb')]({'action':'coreshowchannels'});};};function connect(){logger[_0xe757('0x17')](util[_0xe757('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xe757('0x6')][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config[_0xe757('0x6')][_0xe757('0x7')]));ami[_0xe757('0x18')](_0xe757('0xd'),error);ami[_0xe757('0x18')](_0xe757('0x19'),close);}ami['on'](_0xe757('0x1a'),connect);ami['on'](_0xe757('0x1b'),function(_0x388668){logger['info'](util['format'](_0xe757('0x1c'),config['asterisk'][_0xe757('0x8')],config[_0xe757('0x6')]['ip'],config[_0xe757('0x6')][_0xe757('0x7')],util['inspect'](_0x388668,![],null)));});ami['on'](_0xe757('0x1d'),function(){logger['info'](util[_0xe757('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xe757('0x6')]['username'],config[_0xe757('0x6')]['ip'],config['asterisk'][_0xe757('0x7')]));return Promise['resolve']()[_0xe757('0x1e')](ami[_0xe757('0x11')]())[_0xe757('0x1e')](ami['actionDeviceStateList']())[_0xe757('0x1e')](ami[_0xe757('0x1f')]())[_0xe757('0x1e')](ami[_0xe757('0x15')]())[_0xe757('0x1e')](ami[_0xe757('0x20')]())[_0xe757('0x21')](function(_0xdd85e){logger[_0xe757('0xd')](_0xe757('0x22'),util[_0xe757('0xf')](_0xdd85e,{'showHidden':![],'depth':null}));});});ami[_0xe757('0x18')]('error',error);ami['once']('close',close);module[_0xe757('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d2cac3e..c50a717 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 _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xda3f,0xec));var _0xfda3=function(_0x365fb9,_0x147829){_0x365fb9=_0x365fb9-0x0;var _0x334ddb=_0xda3f[_0x365fb9];return _0x334ddb;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index c82f2cd..955419c 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 _0x1fa8=['isUndefined','type','outbound','debug','format','name','voice_queue:save','isEmpty','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','erlangAbandonmentRate','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','inspect','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','status','reachable','SIP/%s','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','push','command','iftime\x20%s,%s','interval','content','indexOf','true','Action','timezones','catch','all','some','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','sendMessageOneNotActive','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','dialMethod','power','booked','handlePower','Queue','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','ivr','queue','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','dialQueueTimeout','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','dialAbandonedRetryFrequency','verifyAdditionalPhones','dialAbandonedMaxRetry','additional','countabandonedretry','VoiceQueueId','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','value','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','countmachineretry','emit','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','running','isPreviewCampaign','statusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','Agent','actionOriginate','originate','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerId','dialOriginateCallerIdName','originatecalleridname','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countnoanswerretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','dialNoSuchNumberMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','loggedIn','[getDataPredictive]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','getContactDialer','checkContactEmpty','countReScheduled','[countReScheduled]\x20','RUNNING','tryOriginatePredictive','dialOrderByScheduledAt','checkIsBlackList','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','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','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','interval\x20=\x20','exports','lodash','moment','ioredis','../preview/util/util','dialer','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fa8,0x1d8));var _0x81fa=function(_0xedd7b,_0x16c5c3){_0xedd7b=_0xedd7b-0x0;var _0x277d77=_0x1fa8[_0xedd7b];return _0x277d77;};'use strict';var util=require('util');var _=require(_0x81fa('0x0'));var uuid=require('uuid');var moment=require(_0x81fa('0x1'));var rr=require('rr');var Redis=require(_0x81fa('0x2'));var utils=require('./utils');var hopperUtils=require('./utils/hopper');var ut=require(_0x81fa('0x3'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x81fa('0x4'));var loggerBooked=require(_0x81fa('0x5'))('booked');var loggerPredictive=require(_0x81fa('0x5'))(_0x81fa('0x6'));var loggerPredictiveCalls=require(_0x81fa('0x5'))(_0x81fa('0x7'));var loggerSyncQueueSummary=require(_0x81fa('0x5'))(_0x81fa('0x8'));var ami=require(_0x81fa('0x9'));config[_0x81fa('0xa')]=_['defaults'](config[_0x81fa('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x81fa('0xa')]));var cmHopper=require(_0x81fa('0xb'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x81fa('0xc'));var Interval=require(_0x81fa('0xd'));var Action=require(_0x81fa('0xe'));var History=require('./models/history');var Final=require(_0x81fa('0xf'));var AgentComplete=require(_0x81fa('0x10'));var QueueCallerAbandon=require(_0x81fa('0x11'));var Hangup=require(_0x81fa('0x12'));var ipAgi=process['env'][_0x81fa('0x13')]||_0x81fa('0x14');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x81fa('0x15')]['enqueue']=function(_0x32d62b){this[_0x81fa('0x16')]=this[_0x81fa('0x16')]?this['tail']['finally'](_0x32d62b):_0x32d62b();};function Dialer(_0x56212b,_0x267799){this[_0x81fa('0x17')]=new Sequence();this[_0x81fa('0x18')]=_0x267799;this[_0x81fa('0x19')]=_0x56212b[_0x81fa('0x19')];this['campaigns']=_0x56212b[_0x81fa('0x1a')];this[_0x81fa('0x1b')]=_0x56212b[_0x81fa('0x1b')];this[_0x81fa('0x1c')]=_0x56212b['trunks'];this[_0x81fa('0x1d')]=config[_0x81fa('0x1d')]||0x2;this[_0x81fa('0x1e')]={};this[_0x81fa('0x1f')]={};this[_0x81fa('0x20')]={};this[_0x81fa('0x21')]={};this[_0x81fa('0x22')]={};this[_0x81fa('0x23')]={};this[_0x81fa('0x24')]={};this[_0x81fa('0x25')]={};this[_0x81fa('0x26')]={};this[_0x81fa('0x27')]={};this[_0x81fa('0x28')]={};ami['on'](_0x81fa('0x29'),this[_0x81fa('0x2a')][_0x81fa('0x2b')](this));ami['on']('queuecallerabandon',this[_0x81fa('0x2c')][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x2d'),this[_0x81fa('0x2e')][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x2f'),this[_0x81fa('0x30')]['bind'](this));ami['on'](_0x81fa('0x31'),this[_0x81fa('0x8')][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x32'),this[_0x81fa('0x33')][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x34'),this[_0x81fa('0x35')]['bind'](this));ami['on'](_0x81fa('0x36'),this['syncNewExten'][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x37'),this[_0x81fa('0x38')][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x39'),this[_0x81fa('0x3a')][_0x81fa('0x2b')](this));ami['on'](_0x81fa('0x3b'),this[_0x81fa('0x3c')]['bind'](this));this[_0x81fa('0x3d')]();this[_0x81fa('0x3e')]();RpcSetting[_0x81fa('0x3f')]()[_0x81fa('0x40')](function(_0x51b69d){previewRecallmeReminderInterval=_0x51b69d[_0x81fa('0x41')];});}function isNotNull(_0x5b93aa){return _0x5b93aa!==null&&!_[_0x81fa('0x42')](_0x5b93aa);}function msgResponse(_0x2cf2a0,_0x50cd7e,_0x36c2de){return{'action':_0x2cf2a0,'response':_0x50cd7e,'message':_0x36c2de,'stack':_0x36c2de};}function emit(_0x1ab3eb,_0x361516,_0x48bc82){io['to'](_0x1ab3eb)['emit'](_0x361516,_0x48bc82);}function emitOutboundVoiceQueueSummary(_0x3a9a03){if(_0x3a9a03[_0x81fa('0x43')]===_0x81fa('0x44')){logger[_0x81fa('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x3a9a03,{'showHidden':![],'depth':null}));emit(util[_0x81fa('0x46')]('voice:queue:%s',_0x3a9a03[_0x81fa('0x47')]),_0x81fa('0x48'),_0x3a9a03);}}function checkGetDataPredictive(_0x1a1587){if(isNotNull(_0x1a1587)&&!_[_0x81fa('0x49')](_0x1a1587)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x81fa('0x4a')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a1587[_0x81fa('0x4b')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x4c'),_0x1a1587['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x4d'),_0x1a1587[_0x81fa('0x4e')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x4f'),_0x1a1587['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x81fa('0x4a')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1a1587[_0x81fa('0x50')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x51'),_0x1a1587[_0x81fa('0x52')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x53'));if(_0x1a1587[_0x81fa('0x4b')]>0x0){if(!_[_0x81fa('0x42')](_0x1a1587[_0x81fa('0x52')])&&_0x1a1587[_0x81fa('0x52')]>0x0){return!![];}loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x54'));if(!_[_0x81fa('0x42')](_0x1a1587[_0x81fa('0x50')])&&_0x1a1587['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x81fa('0x4a')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x81fa('0x4a')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x55'));}return![];}function mergeDataErlangB(_0x4cef86){return function(_0xf9dfe9){loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x56'));loggerPredictive[_0x81fa('0x4a')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf9dfe9[_0x81fa('0x57')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x58'),_0xf9dfe9[_0x81fa('0x59')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x5a'),_0xf9dfe9['erlangAbandonmentRate']);loggerPredictive['info'](_0x81fa('0x5b'),_0xf9dfe9[_0x81fa('0x5c')]);loggerPredictive[_0x81fa('0x4a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xf9dfe9[_0x81fa('0x5d')]);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x53'));_[_0x81fa('0x5e')](_0x4cef86,_0xf9dfe9);};}function ifInterval(_0x4bda4b,_0x5da2e9){if(_[_0x81fa('0x42')](_0x5da2e9)){return![];}return utils[_0x81fa('0x5f')](undefined,_0x5da2e9)<_0x4bda4b*0x3c;}function clearPredictiveAttributes(_0x2a740e){if(_0x2a740e['startProgressive']){_0x2a740e[_0x81fa('0x24')]=undefined;loggerPredictive['debug'](_0x2a740e['name'],_0x81fa('0x60'));}if(_0x2a740e[_0x81fa('0x23')]){_0x2a740e['startPredictive']=undefined;loggerPredictive[_0x81fa('0x45')](_0x2a740e[_0x81fa('0x47')],_0x81fa('0x61'));}if(_0x2a740e[_0x81fa('0x62')]){clearInterval(_0x2a740e['handlePredictive']);_0x2a740e[_0x81fa('0x62')]=undefined;loggerPredictive[_0x81fa('0x45')](_0x2a740e['name'],_0x81fa('0x63'));}}function loggerCatchPredictive(_0xf3b715,_0x5e1382){return function(_0x3736ba){loggerPredictive[_0x81fa('0x64')](_0x5e1382['name'],_0xf3b715);loggerPredictive[_0x81fa('0x64')](_0x3736ba[_0x81fa('0x65')]);clearPredictiveAttributes(_0x5e1382);};}function loggerCatch(_0x4a2b34){return function(_0x300dd4){logger[_0x81fa('0x64')](_0x4a2b34,util['inspect'](_0x300dd4,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x405bda,_0x1d50ca,_0x1db57c){return function(_0x5932bb){utils[_0x81fa('0x66')](_0x1d50ca,_0x1db57c,0x0);logger['error'](_0x405bda,util[_0x81fa('0x67')](_0x5932bb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4eb44c){return function(_0x404c7c){if(isNotNull(_0x404c7c)&&isNotNull(_0x404c7c[0x0])){if(_0x404c7c[0x0][_0x81fa('0x68')]>0x0){_0x4eb44c[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x6b')];logger[_0x81fa('0x4a')]('[getContactDialer2][ReScheduled]'+_0x4eb44c[_0x81fa('0x47')],_0x404c7c[0x0][_0x81fa('0x68')],_0x81fa('0x6c'));}else{_0x4eb44c[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x6d')];logger['info'](_0x81fa('0x6e')+_0x4eb44c[_0x81fa('0x47')]);}}};}function createObjHistory(_0x4da85e,_0xf8d74a,_0x5a9675,_0x246b02,_0x51264c){_0x4da85e[_0x81fa('0x69')]=_0x5a9675;var _0x2a5935=new Action(_0x4da85e,_0xf8d74a);var _0x4cecae=new History(_0x2a5935);_0x4cecae[_0x81fa('0x6f')]=_0x246b02;_0x4cecae['statedesc']=_0x51264c;_0x4cecae[_0x81fa('0x70')]=_0x2a5935[_0x81fa('0x71')];return _0x4cecae;}function unlockQueueStatus(_0x419a55,_0x2fd4d5){setTimeout(function(){if(_[_0x81fa('0x42')](_0x419a55[_0x81fa('0x72')])){loggerBooked[_0x81fa('0x64')]('[unlockQueueStatus][undefined]',_0x2fd4d5);}_0x419a55[_0x81fa('0x72')]=!![];loggerBooked[_0x81fa('0x4a')](_0x81fa('0x73'),_0x2fd4d5,JSON[_0x81fa('0x74')](_[_0x81fa('0x75')](_0x419a55,[_0x81fa('0x47'),_0x81fa('0x72')])));},0x1f3);}function checkInterval(_0xc37e0c){return function(){if(!isNotNull(_0xc37e0c[_0x81fa('0x76')])){_0xc37e0c[_0x81fa('0x69')]=utils['CAMPAIGN_STATUS'][_0x81fa('0x77')];throw _0xc37e0c['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xc37e0c[_0x81fa('0x76')][_0x81fa('0x78')])){_0xc37e0c[_0x81fa('0x69')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0xc37e0c[_0x81fa('0x47')]+_0x81fa('0x79');}if(!isNotNull(_[_0x81fa('0x49')](_0xc37e0c[_0x81fa('0x76')]['Intervals']))){_0xc37e0c[_0x81fa('0x69')]=utils[_0x81fa('0x6a')]['NULL_INTERVAL'];throw _0xc37e0c[_0x81fa('0x47')]+_0x81fa('0x79');}};}function checkIsIVRCampaignActive(_0xe48659){return function(){if(!utils[_0x81fa('0x7a')](_0xe48659)){_0xe48659[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x7b')];throw _0xe48659[_0x81fa('0x47')]+_0x81fa('0x7c');}};}function emitCampaignSummary(_0x3ebf4f){if(utils[_0x81fa('0x7d')](_0x3ebf4f)){emit(util[_0x81fa('0x46')]('campaign:ivr:%s',_0x3ebf4f[_0x81fa('0x47')]),'campaign:save',_0x3ebf4f);}}function loggerCatchQueueSummary(_0x4d555d,_0x5e114c){return function(_0x423a66){clearPredictiveAttributes(_0x5e114c);emitCampaignSummary(_0x5e114c);loggerSyncQueueSummary[_0x81fa('0x45')](_0x4d555d,util[_0x81fa('0x67')](_0x423a66,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3367b6){if(_0x3367b6['sendMessageOneNotActive']){if(_0x3367b6[_0x81fa('0x7e')]===0x0){_0x3367b6['sendMessageOneNotActive']=![];_0x3367b6['message']=utils[_0x81fa('0x6a')][_0x81fa('0x7b')];loggerSyncQueueSummary[_0x81fa('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3367b6[_0x81fa('0x47')],_0x81fa('0x7f'));}else{_0x3367b6['message']=utils['CAMPAIGN_STATUS'][_0x81fa('0x80')];loggerSyncQueueSummary[_0x81fa('0x45')](_0x81fa('0x81'),_0x3367b6[_0x81fa('0x47')],_0x81fa('0x82'));}emitCampaignSummary(_0x3367b6);}}function myreject(_0x13de1e){return function(_0x4a209b){return _0x13de1e(msgResponse(_0x81fa('0x83'),'Error',JSON[_0x81fa('0x74')](_0x4a209b)));};}Dialer[_0x81fa('0x15')][_0x81fa('0x84')]=function(_0x513946){return!_[_0x81fa('0x42')](_0x513946)&&_0x513946&&!_['isUndefined'](_0x513946[_0x81fa('0x47')])&&!_[_0x81fa('0x42')](_0x513946[_0x81fa('0x85')])&&_0x513946['active']&&(this[_0x81fa('0x1c')][util['format']('SIP/%s',_0x513946[_0x81fa('0x47')])][_0x81fa('0x86')]===_0x81fa('0x87')||this[_0x81fa('0x1c')][util[_0x81fa('0x46')](_0x81fa('0x88'),_0x513946['name'])][_0x81fa('0x86')]==='unmonitored');};Dialer[_0x81fa('0x15')][_0x81fa('0x89')]=function(_0x5ea824){var _0x5f37d9=this;return function(){if(!_0x5f37d9['isTrunkReachable'](_0x5ea824[_0x81fa('0x8a')])){if(!_0x5f37d9[_0x81fa('0x84')](_0x5ea824[_0x81fa('0x8b')])){_0x5ea824[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x8c')];throw _0x5ea824[_0x81fa('0x47')]+_0x81fa('0x8d');}}};};Dialer['prototype'][_0x81fa('0x8e')]=function(_0x7cef43,_0x260417,_0x46ccd6,_0x55e6b5){var _0x2cd56=this;return function(){var _0x116a19=!![];return _0x2cd56['ifTimeIvr'](_0x7cef43,_0x260417,_0x46ccd6,_0x55e6b5,_0x116a19);};};Dialer[_0x81fa('0x15')][_0x81fa('0x8f')]=function(_0x27c1cd,_0x29bb1f,_0x5c0252,_0xc4e690){var _0x5c8134=this;return function(){var _0x21f4fb=![];return _0x5c8134[_0x81fa('0x90')](_0x27c1cd['Intervals'],_0x29bb1f,_0x5c0252,_0xc4e690,_0x21f4fb);};};Dialer[_0x81fa('0x15')][_0x81fa('0x90')]=function(_0x174c9a,_0x14bd12,_0x1a2015,_0x739107,_0x59a15b){var _0x2d5171=[];return new Promise(function(_0xe48865,_0x13be28){if(!isNotNull(_0x174c9a)){_0x739107[_0x81fa('0x69')]=utils[_0x81fa('0x6a')]['NULL_INTERVAL'];return _0x13be28(msgResponse(_0x81fa('0x91'),_0x81fa('0x92'),_0x1a2015+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x174c9a)){_0x739107[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x93')];return _0x13be28(msgResponse('ifTime',_0x81fa('0x92'),_0x1a2015+'\x20Intervals\x20is\x20empty\x20'));}if(_0x14bd12&&_[_0x81fa('0x42')](config['timezones'][_0x14bd12])){_0x739107[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x94')];return _0x13be28(msgResponse(_0x81fa('0x91'),_0x81fa('0x92'),_0x1a2015+_0x81fa('0x95')+_0x14bd12));}if(_['isArray'](_0x174c9a)){for(var _0x474d09=0x0;_0x474d09<_0x174c9a[_0x81fa('0x96')];_0x474d09+=0x1){_0x2d5171[_0x81fa('0x97')](ami['Action']({'action':_0x81fa('0x98'),'command':util[_0x81fa('0x46')](_0x81fa('0x99'),_0x174c9a[_0x474d09][_0x81fa('0x9a')],!_[_0x81fa('0x42')](config['timezones'][_0x14bd12])?_0x14bd12:'')})[_0x81fa('0x40')](function(_0x16bea5){return _0x16bea5[_0x81fa('0x9b')][_0x81fa('0x9c')](_0x81fa('0x9d'))>=0x0;})['catch'](myreject(_0x13be28)));}}else{_0x2d5171[_0x81fa('0x97')](ami[_0x81fa('0x9e')]({'action':_0x81fa('0x98'),'command':util[_0x81fa('0x46')]('iftime\x20%s,%s',_0x174c9a,!_[_0x81fa('0x42')](config[_0x81fa('0x9f')][_0x14bd12])?_0x14bd12:'')})[_0x81fa('0x40')](function(_0x125ceb){return _0x125ceb[_0x81fa('0x9b')][_0x81fa('0x9c')](_0x81fa('0x9d'))>=0x0;})[_0x81fa('0xa0')](myreject(_0x13be28)));}Promise[_0x81fa('0xa1')](_0x2d5171)[_0x81fa('0x40')](function(_0xe5a6c7){var _0x5f50f8=_[_0x81fa('0xa2')](_0xe5a6c7);if(_0x5f50f8){return _0xe48865(_0x5f50f8);}else{_0x739107['message']=_0x59a15b?utils[_0x81fa('0x6a')][_0x81fa('0xa3')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x13be28(msgResponse(_0x81fa('0xa4'),_0x81fa('0x92'),'Global:\x20'+_0x59a15b+'\x20'+_0x1a2015+_0x81fa('0xa5')+util['inspect'](_0x174c9a,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x14bd12));}})[_0x81fa('0xa0')](function(_0x272f32){return _0x13be28(msgResponse(_0x81fa('0x91'),_0x81fa('0x92'),JSON[_0x81fa('0x74')](_0x272f32)));});});};Dialer['prototype']['loopCampaigns']=function(){var _0x10427f=this;return cmHopper[_0x81fa('0xa6')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x10427f['syncCampaigns']();},0x3e8);});};Dialer['prototype'][_0x81fa('0xa7')]=function(){var _0x5b7ed2=this;var _0x127618;for(var _0x5aed0d in this[_0x81fa('0x1a')]){if(typeof this[_0x81fa('0x1a')][_0x5aed0d]!==_0x81fa('0xa8')){_0x127618=this[_0x81fa('0x1a')][_0x5aed0d];if(utils[_0x81fa('0x7d')](_0x127618)&&utils[_0x81fa('0x7a')](_0x127618)){_0x127618[_0x81fa('0xa9')]=!![];Promise[_0x81fa('0xaa')]()['then'](checkIsIVRCampaignActive(_0x127618))[_0x81fa('0x40')](checkInterval(_0x127618))['then'](_0x5b7ed2[_0x81fa('0x89')](_0x127618))[_0x81fa('0x40')](_0x5b7ed2[_0x81fa('0x8e')](_0x127618[_0x81fa('0xab')],_0x127618[_0x81fa('0xac')],_0x127618[_0x81fa('0x47')],_0x127618))['then'](_0x5b7ed2[_0x81fa('0x8f')](_0x127618['Interval'],_0x127618[_0x81fa('0xac')],_0x127618[_0x81fa('0x47')],_0x127618))[_0x81fa('0x40')](_0x5b7ed2[_0x81fa('0xad')](_0x127618))[_0x81fa('0xa0')](loggerCatchQueueSummary(_0x81fa('0xae'),_0x127618));}else{notSendMessagesCampaign(_0x127618);}}}};Dialer['prototype']['checkDialMethod']=function(_0x199fc9){if(_0x199fc9['dialMethod']!==_0x81fa('0x6')){clearPredictiveAttributes(_0x199fc9);}switch(_0x199fc9[_0x81fa('0xaf')]){case'progressive':this['handlePower'](_0x199fc9,0x1);break;case _0x81fa('0xb0'):this['handlePower'](_0x199fc9,_0x199fc9['dialPowerLevel']);break;case _0x81fa('0x6'):this['predictive'](_0x199fc9);break;case _0x81fa('0xb1'):this[_0x81fa('0xb2')](_0x199fc9,0x1);break;default:logger[_0x81fa('0x64')](_0x81fa('0xb3'),_0x199fc9['name'],'method\x20not\x20recognized');}};Dialer['prototype'][_0x81fa('0x91')]=function(_0xd0e084,_0x2af166){var _0x1fb6b5=_0xd0e084[_0x81fa('0xac')];var _0x439fb1=_0x2af166?_0xd0e084[_0x81fa('0xab')]:_0xd0e084[_0x81fa('0x76')][_0x81fa('0x78')];logger[_0x81fa('0xb4')]('Dialer::ifTime()',_0x439fb1,_0x1fb6b5,_0xd0e084[_0x81fa('0x47')],util[_0x81fa('0x46')](_0x81fa('0xb5'),_0xd0e084[_0x81fa('0x47')],_0xd0e084['id']));var _0x3b99c5=null;return Interval[_0x81fa('0xb6')](_0x439fb1,_0x1fb6b5)[_0x81fa('0x40')](function(_0x400c47){if(_0x400c47===!![]){return _0x400c47;}else{_0xd0e084[_0x81fa('0x69')]=_0x2af166?utils['CAMPAIGN_STATUS'][_0x81fa('0xa3')]:utils['CAMPAIGN_STATUS'][_0x81fa('0xb7')];_0x3b99c5=msgResponse(_0x81fa('0xa4'),_0x81fa('0x92'),_0x81fa('0xb8')+_0x2af166+'\x20'+_0xd0e084[_0x81fa('0x47')]+_0x81fa('0xa5')+util[_0x81fa('0x67')](_0x439fb1,{'showHidden':![],'depth':null})+_0x81fa('0xb9')+_0x1fb6b5);}if(_0x3b99c5!==null){logger[_0x81fa('0xb4')](_0x81fa('0xba'),_0x3b99c5);_0x3b99c5[_0x81fa('0xbb')]=_0x2af166;throw _0x3b99c5;}})[_0x81fa('0xa0')](function(_0x4c69b8){logger[_0x81fa('0x64')](_0x81fa('0xbc'),_0x4c69b8);throw msgResponse(_0x81fa('0x83'),_0x81fa('0xbd'),util[_0x81fa('0x67')](_0x4c69b8,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x81fa('0x2a')]=function(_0x990b25){if(this[_0x81fa('0x19')][_0x990b25['queue']]){if(this[_0x81fa('0x21')][_0x990b25['uniqueid']]&&this[_0x81fa('0x21')][_0x990b25['uniqueid']]['type']!==_0x81fa('0xbe')){this['updateOriginated'](this[_0x81fa('0x19')][_0x990b25[_0x81fa('0xbf')]]);this[_0x81fa('0x21')][_0x990b25[_0x81fa('0xc0')]][_0x81fa('0xc1')]=moment()[_0x81fa('0x46')](_0x81fa('0xc2'));}}};Dialer[_0x81fa('0x15')][_0x81fa('0x30')]=function(_0x46c1d9){var _0x364459=this[_0x81fa('0x21')][_0x46c1d9[_0x81fa('0xc0')]];if(this[_0x81fa('0x19')][_0x46c1d9['queue']]){if(_0x364459&&_0x364459['type']!==_0x81fa('0xbe')){delete this[_0x81fa('0x21')][_0x46c1d9[_0x81fa('0xc0')]];this[_0x81fa('0x19')][_0x46c1d9[_0x81fa('0xbf')]][_0x81fa('0xc3')]+=0x1;var _0x3dfe8a=new AgentComplete(_0x364459,_0x46c1d9);if(_0x46c1d9[_0x81fa('0xc4')]===_0x81fa('0xc5')){_0x3dfe8a[_0x81fa('0xc6')]=this['voiceQueues'][_0x46c1d9['queue']][_0x81fa('0xc7')]&&this[_0x81fa('0x19')][_0x46c1d9[_0x81fa('0xbf')]][_0x81fa('0xc8')]?moment()[_0x81fa('0x46')](_0x81fa('0xc2')):undefined;}hopperUtils[_0x81fa('0xc9')](_0x3dfe8a)['catch'](loggerCatch(_0x81fa('0xca')));hopperUtils[_0x81fa('0xcb')](_0x3dfe8a)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xcc')));}}};Dialer[_0x81fa('0x15')][_0x81fa('0x2c')]=function(_0x1019a1){var _0x464713=this[_0x81fa('0x21')][_0x1019a1[_0x81fa('0xc0')]];var _0x17f87b=this;var _0x4f1940=![];var _0x392f61;var _0x85b411;if(this['voiceQueues'][_0x1019a1[_0x81fa('0xbf')]]){if(_0x464713&&_0x464713[_0x81fa('0x43')]!=='ivr'){delete this['uniqueId'][_0x1019a1['uniqueid']];this[_0x81fa('0xcd')](this[_0x81fa('0x19')][_0x1019a1[_0x81fa('0xbf')]]);_0x464713[_0x81fa('0xce')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3ad8fa=new QueueCallerAbandon(_0x464713,_0x1019a1);if(utils['getSeconds'](_0x464713[_0x81fa('0xce')],_0x464713[_0x81fa('0xcf')])>=_0x464713[_0x81fa('0xd0')]){this[_0x81fa('0x19')][_0x1019a1['queue']][_0x81fa('0x4e')]+=0x1;this[_0x81fa('0x19')][_0x1019a1['queue']]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x1019a1['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x3ad8fa[_0x81fa('0x6f')]=0xa;_0x3ad8fa[_0x81fa('0xd1')]=_0x81fa('0xd2');_0x3ad8fa[_0x81fa('0xd3')]=_0x81fa('0xd4');_0x3ad8fa[_0x81fa('0xc6')]=this[_0x81fa('0x19')][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xc7')]?moment()[_0x81fa('0x46')](_0x81fa('0xc2')):undefined;_0x3ad8fa[_0x81fa('0xd5')]+=0x1;_0x3ad8fa[_0x81fa('0xd6')]+=0x1;_0x392f61=this['voiceQueues'][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xd7')];_0x85b411=this[_0x81fa('0x19')][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xd8')];hopperUtils['verifyAdditionalPhones'](_0x3ad8fa,_0x3ad8fa['state'],_0x464713[_0x81fa('0xd9')])[_0x81fa('0x40')](function(_0x234ba2){_0x4f1940=_0x234ba2['additional']==0x1;if(_0x3ad8fa[_0x81fa('0xd5')]>=_0x17f87b[_0x81fa('0x19')][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xda')]){_0x17f87b[_0x81fa('0xdb')](_0x3ad8fa,_0x234ba2['additional']);}else{hopperUtils[_0x81fa('0xdc')]({'active':![],'countdropretry':_0x3ad8fa['countdropretry'],'scheduledat':moment()[_0x81fa('0xdd')](_0x17f87b[_0x81fa('0x19')][_0x1019a1['queue']][_0x81fa('0xd7')],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x464713[_0x81fa('0xdf')],'ListId':_0x464713[_0x81fa('0xe0')],'VoiceQueueId':_0x464713['VoiceQueueId']||undefined,'CampaignId':_0x464713[_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xe2')));var _0x409904=new History(_0x3ad8fa);_0x409904[_0x81fa('0x6f')]=0xa;_0x409904['statedesc']=_0x81fa('0xd2');_0x409904[_0x81fa('0x71')]=moment()[_0x81fa('0x46')](_0x81fa('0xc2'));_0x409904[_0x81fa('0x70')]=_0x409904[_0x81fa('0x71')];_0x409904['calleridname']=_0x3ad8fa['calleridname'];_0x409904['calleridnum']=_0x3ad8fa[_0x81fa('0xe3')];hopperUtils[_0x81fa('0xc9')](_0x409904)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xe4')));}})[_0x81fa('0x40')](function(){if(_0x4f1940)hopperUtils[_0x81fa('0xe5')](_0x3ad8fa,_0x392f61,_0x85b411)[_0x81fa('0x40')](function(){return 0x1;});});}else{this[_0x81fa('0x19')][_0x1019a1['queue']][_0x81fa('0xe6')]+=0x1;this[_0x81fa('0x19')][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xe7')]+=0x1;_0x3ad8fa[_0x81fa('0x6f')]=0xb;_0x3ad8fa[_0x81fa('0xd1')]=_0x81fa('0xe8');_0x3ad8fa['dropreason']='CALLEREXIT';_0x3ad8fa['countabandonedretry']+=0x1;_0x3ad8fa[_0x81fa('0xd6')]+=0x1;_0x392f61=this['voiceQueues'][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xe9')];_0x85b411=this[_0x81fa('0x19')][_0x1019a1[_0x81fa('0xbf')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x81fa('0xea')](_0x3ad8fa,_0x3ad8fa[_0x81fa('0x6f')],_0x464713[_0x81fa('0xd9')])['then'](function(_0x535c63){if(_0x3ad8fa['countabandonedretry']>=_0x17f87b['voiceQueues'][_0x1019a1[_0x81fa('0xbf')]][_0x81fa('0xeb')]){_0x17f87b[_0x81fa('0xdb')](_0x3ad8fa,_0x535c63[_0x81fa('0xec')]);}else{hopperUtils[_0x81fa('0xdc')]({'active':![],'countabandonedretry':_0x3ad8fa[_0x81fa('0xed')],'scheduledat':moment()[_0x81fa('0xdd')](_0x17f87b[_0x81fa('0x19')][_0x1019a1['queue']][_0x81fa('0xe9')],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x464713['ContactId'],'ListId':_0x464713[_0x81fa('0xe0')],'VoiceQueueId':_0x464713[_0x81fa('0xee')]||undefined,'CampaignId':_0x464713['CampaignId']||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xef')));var _0x4b44f3=new History(_0x3ad8fa);_0x4b44f3[_0x81fa('0x6f')]=0xb;_0x4b44f3[_0x81fa('0xd1')]=_0x81fa('0xe8');_0x4b44f3[_0x81fa('0x71')]=moment()[_0x81fa('0x46')](_0x81fa('0xc2'));_0x4b44f3[_0x81fa('0x70')]=_0x4b44f3[_0x81fa('0x71')];_0x4b44f3[_0x81fa('0xf0')]=_0x3ad8fa[_0x81fa('0xf0')];_0x4b44f3[_0x81fa('0xe3')]=_0x3ad8fa[_0x81fa('0xe3')];hopperUtils['createHistory'](_0x4b44f3)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xf1')));}})[_0x81fa('0x40')](function(){if(_0x4f1940)hopperUtils[_0x81fa('0xe5')](_0x3ad8fa,_0x392f61,_0x85b411)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0x81fa('0xf2')]=function(_0x11e931){if(this[_0x81fa('0x1f')][_0x11e931['uniqueid']]){this[_0x81fa('0x1f')][_0x11e931['uniqueid']][_0x81fa('0xf3')]=_0x11e931[_0x81fa('0xf3')];}if(this[_0x81fa('0x21')][_0x11e931['uniqueid']]){this[_0x81fa('0x21')][_0x11e931[_0x81fa('0xc0')]][_0x81fa('0xf3')]=_0x11e931['channel'];}};Dialer[_0x81fa('0x15')][_0x81fa('0x3a')]=function(_0x423e0a){if(!this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]]){return;}var _0xf7e1f6=this[_0x81fa('0x19')][this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]][_0x81fa('0xbf')]][_0x81fa('0xf5')]||_0x81fa('0xf6');if(_0xf7e1f6===_0x81fa('0xf7')){if(this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]]&&_[_0x81fa('0xf8')](this[_0x81fa('0x1f')][_0x423e0a['actionid']][_0x81fa('0xf9')])&&_0x423e0a[_0x81fa('0x86')]==='1'&&_0x423e0a[_0x81fa('0xfa')]==='0'){if(this[_0x81fa('0x1b')][_0x423e0a['stateinterface']]){if(!this[_0x81fa('0x1b')][_0x423e0a['stateinterface']]['locked']){this[_0x81fa('0x1b')][_0x423e0a[_0x81fa('0xfb')]][_0x81fa('0xf9')]=!![];this[_0x81fa('0x1f')][_0x423e0a['actionid']][_0x81fa('0xf9')]=!![];this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]][_0x81fa('0xfb')]=_0x423e0a[_0x81fa('0xfb')];}}}}else if(_0xf7e1f6===_0x81fa('0xf6')){if(this['actions'][_0x423e0a[_0x81fa('0xf4')]]){if(this[_0x81fa('0x1b')][_0x423e0a[_0x81fa('0xfb')]]){this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]][_0x81fa('0xfb')]=_0x423e0a['stateinterface'];if(_[_0x81fa('0xf8')](this['queueBooked'][this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]][_0x81fa('0xbf')]])){this[_0x81fa('0x26')][this['actions'][_0x423e0a[_0x81fa('0xf4')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x423e0a[_0x81fa('0xf4')]][_0x81fa('0xbf')]][_0x81fa('0x97')](_['merge'](_[_0x81fa('0x75')](this[_0x81fa('0x1f')][_0x423e0a[_0x81fa('0xf4')]],[_0x81fa('0xfc'),_0x81fa('0xfb')]),{'status':_0x423e0a[_0x81fa('0x86')],'paused':_0x423e0a[_0x81fa('0xfa')]}));}}}};Dialer['prototype'][_0x81fa('0x3c')]=function(_0x4ba970){if(!this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]){return;}var _0x15d304=this;var _0x3c8056=this[_0x81fa('0x19')][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]['queue']];var _0x4a7c33=_0x3c8056[_0x81fa('0xf5')]||_0x81fa('0xf6');if(_0x4a7c33===_0x81fa('0xf7')){if(this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]&&this['actions'][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xfb')]){this[_0x81fa('0x18')]['run'](this[_0x81fa('0x1f')][_0x4ba970['actionid']][_0x81fa('0xfc')],this['actions'][_0x4ba970[_0x81fa('0xf4')]]['stateinterface'])[_0x81fa('0xa0')](function(_0x57b322){logger[_0x81fa('0x64')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x57b322,{'showHidden':![],'depth':null}));})[_0x81fa('0xfd')](function(){_0x15d304['updateOriginated'](_0x15d304[_0x81fa('0x19')][_0x15d304[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xbf')]]);_0x15d304[_0x81fa('0x1b')][_0x15d304['actions'][_0x4ba970[_0x81fa('0xf4')]]['stateinterface']][_0x81fa('0xf9')]=![];delete _0x15d304[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]];unlockQueueStatus(_0x3c8056);});}else{this['updateOriginated'](this[_0x81fa('0x19')][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xbf')]]);hopperUtils[_0x81fa('0xdc')]({'active':![],'ContactId':this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xdf')],'ListId':this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xe0')],'VoiceQueueId':this[_0x81fa('0x1f')][_0x4ba970['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xfe')));delete this['actions'][_0x4ba970[_0x81fa('0xf4')]];unlockQueueStatus(_0x3c8056);}}else if(_0x4a7c33==='rrmemory'){var _0x368025;if(this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]&&!_['isEmpty'](this[_0x81fa('0x26')][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]['queue']])){if(this[_0x81fa('0x27')][_0x15d304['actions'][_0x4ba970[_0x81fa('0xf4')]]['queue']]){this[_0x81fa('0x27')][_0x15d304['actions'][_0x4ba970['actionid']][_0x81fa('0xbf')]]=this[_0x81fa('0x27')][this[_0x81fa('0x1f')][_0x4ba970['actionid']][_0x81fa('0xbf')]]?this[_0x81fa('0x27')][this[_0x81fa('0x1f')][_0x4ba970['actionid']]['queue']]:this[_0x81fa('0x26')][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]][_0x81fa('0xbf')]]?this[_0x81fa('0x26')][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]['queue']]['_rr']||0x0:0x0;}this['queueBooked'][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]['queue']][_0x81fa('0xff')]=this['queueBookedRR'][this[_0x81fa('0x1f')][_0x4ba970[_0x81fa('0xf4')]]['queue']];for(var _0x21c3fd=0x0;_0x21c3fd=_0x5da8a3[_0x81fa('0x122')]){_0x3d036a['stateGlobal'](_0x3e1ed7,_0x58db25,_0x4513e4,_0x81fa('0x123'));}else{if(_0x3e1ed7['countmachineretry']>=_0x5da8a3[_0x81fa('0x124')]){_0x3d036a[_0x81fa('0x125')](_0x3e1ed7,_0x58db25,_0x4513e4,_0x81fa('0x126'));}else{hopperUtils[_0x81fa('0xdc')]({'active':![],'countmachineretry':_0x3e1ed7[_0x81fa('0x11b')],'scheduledat':moment()[_0x81fa('0xdd')](_0x5da8a3[_0x81fa('0x127')],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x3e1ed7[_0x81fa('0xdf')],'ListId':_0x3e1ed7['ListId'],'VoiceQueueId':_0x3e1ed7[_0x81fa('0xee')]||undefined,'CampaignId':_0x3e1ed7[_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x128')));_0x58db25({'reschedule':0x1});}}});}if(_0x2eeda2[_0x81fa('0x43')]===_0x81fa('0xbe')&&this['campaigns'][_0x2eeda2[_0x81fa('0xbf')]][_0x81fa('0x10f')]&&_0x26471a[_0x81fa('0x110')]==='HANGUP'){delete this[_0x81fa('0x21')][_0x26471a[_0x81fa('0xc0')]];this[_0x81fa('0xcd')](this[_0x81fa('0x1a')][_0x2eeda2[_0x81fa('0xbf')]]);_0x142ca0=new Hangup(_0x2eeda2,_0x26471a);_0x142ca0[_0x81fa('0x6f')]=0x12;_0x142ca0[_0x81fa('0xd1')]=_0x81fa('0x112');_0x142ca0['membername']='AMD';ami['emit']('custom:amd',ut[_0x81fa('0x116')](_0x142ca0,_0x81fa('0x117')));this[_0x81fa('0x118')](_0x142ca0,_0x81fa('0x129'),'[syncHangupInAMDIvr]');}if(_0x2eeda2[_0x81fa('0x43')]===_0x81fa('0xbe')&&this[_0x81fa('0x1a')][_0x2eeda2[_0x81fa('0xbf')]][_0x81fa('0x10f')]&&_0x26471a['value']===_0x81fa('0x11a')){return new Promise(function(_0x168808,_0x20aa10){delete _0x3d036a['uniqueId'][_0x26471a[_0x81fa('0xc0')]];_0x3d036a[_0x81fa('0xcd')](_0x3d036a[_0x81fa('0x1a')][_0x2eeda2[_0x81fa('0xbf')]]);_0x3d036a[_0x81fa('0x1a')][_0x2eeda2[_0x81fa('0xbf')]][_0x81fa('0xc3')]+=0x1;_0x3d036a[_0x81fa('0x1a')][_0x2eeda2[_0x81fa('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2fdae0=_0x3d036a[_0x81fa('0x1a')][_0x2eeda2['queue']];var _0x450689=new Hangup(_0x2eeda2,_0x26471a);_0x450689['state']=0x13;_0x450689[_0x81fa('0xd1')]='Machine';_0x450689[_0x81fa('0x113')]='AMD';_0x450689[_0x81fa('0x11b')]+=0x1;_0x450689[_0x81fa('0xd6')]+=0x1;_0x450689['amd']=!![];ami[_0x81fa('0x11c')](_0x81fa('0x115'),ut[_0x81fa('0x116')](_0x450689,_0x81fa('0x117')));hopperUtils[_0x81fa('0xc9')](_0x450689)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x11d')));if(_0x450689['countbusyretry']+_0x450689['countcongestionretry']+_0x450689['countnoanswerretry']+_0x450689['countnosuchnumberretry']+_0x450689[_0x81fa('0xd5')]+_0x450689[_0x81fa('0xed')]+_0x450689['countmachineretry']+_0x450689[_0x81fa('0x121')]>=_0x2fdae0['dialGlobalMaxRetry']){_0x3d036a['stateGlobal'](_0x450689,_0x168808,_0x20aa10,_0x81fa('0x123'));}else{if(_0x450689[_0x81fa('0x11b')]>=_0x2fdae0[_0x81fa('0x124')]){_0x3d036a[_0x81fa('0x125')](_0x450689,_0x168808,_0x20aa10,_0x81fa('0x126'));}else{hopperUtils[_0x81fa('0xdc')]({'active':![],'countmachineretry':_0x450689['countmachineretry'],'scheduledat':moment()[_0x81fa('0xdd')](_0x2fdae0['dialMachineRetryFrequency'],'minutes')[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x450689['ContactId'],'ListId':_0x450689[_0x81fa('0xe0')],'VoiceQueueId':_0x450689[_0x81fa('0xee')]||undefined,'CampaignId':_0x450689[_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch('[rescheduleContact][Machine]'));_0x168808({'reschedule':0x1});}}});}}};Dialer[_0x81fa('0x15')][_0x81fa('0x35')]=function(_0x11d144){var _0xa5dfa=this[_0x81fa('0x21')][_0x11d144['uniqueid']];var _0x52e680;if(_0xa5dfa&&_0xa5dfa[_0x81fa('0x43')]==='ivr'){delete this[_0x81fa('0x21')][_0x11d144[_0x81fa('0xc0')]];this[_0x81fa('0xcd')](this[_0x81fa('0x1a')][_0xa5dfa[_0x81fa('0xbf')]]);this[_0x81fa('0x1a')][_0xa5dfa[_0x81fa('0xbf')]][_0x81fa('0x12a')]+=0x1;_0x52e680=new Hangup(_0xa5dfa,_0x11d144);hopperUtils[_0x81fa('0xc9')](_0x52e680)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x12b')));hopperUtils['moveContactManagedDialer'](_0x52e680)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0xa5dfa&&_0xa5dfa['type']!==_0x81fa('0xbe')&&isNotNull(this[_0x81fa('0x19')][_0xa5dfa['queue']][_0x81fa('0x12c')])){delete this[_0x81fa('0x21')][_0x11d144[_0x81fa('0xc0')]];this[_0x81fa('0xcd')](this[_0x81fa('0x19')][_0xa5dfa[_0x81fa('0xbf')]]);this[_0x81fa('0x19')][_0xa5dfa['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0xa5dfa[_0x81fa('0xbf')]][_0x81fa('0x111')]+=0x1;_0x52e680=new Hangup(_0xa5dfa,_0x11d144);_0x52e680['state']=0x10;_0x52e680[_0x81fa('0xd1')]=_0x81fa('0x12d');_0x52e680[_0x81fa('0x113')]=_0x81fa('0x12e');hopperUtils[_0x81fa('0xc9')](_0x52e680)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x12b')));hopperUtils[_0x81fa('0xcb')](_0x52e680)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x12f')));}if(_0xa5dfa&&_0xa5dfa[_0x81fa('0x43')]!==_0x81fa('0xbe')&&!isNotNull(this['voiceQueues'][_0xa5dfa[_0x81fa('0xbf')]]['dialQueueProject'])){delete this[_0x81fa('0x21')][_0x11d144[_0x81fa('0xc0')]];this[_0x81fa('0xcd')](this[_0x81fa('0x19')][_0xa5dfa[_0x81fa('0xbf')]]);this[_0x81fa('0x19')][_0xa5dfa['queue']]['outboundUnknownCallsDay']+=0x1;_0x52e680=new Hangup(_0xa5dfa,_0x11d144);_0x52e680[_0x81fa('0x6f')]=0xc;_0x52e680[_0x81fa('0xd1')]=_0x11d144[_0x81fa('0x130')];_0x52e680[_0x81fa('0x113')]='Unknow';hopperUtils[_0x81fa('0xc9')](_0x52e680)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x12b')));hopperUtils[_0x81fa('0xcb')](_0x52e680)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x12f')));}};Dialer[_0x81fa('0x15')][_0x81fa('0x8')]=function(_0x167d36){var _0x5c2629=this;if(!_0x5c2629['queuesSummary'][_0x167d36[_0x81fa('0x47')]]){_0x5c2629[_0x81fa('0x28')][_0x167d36[_0x81fa('0x47')]]={'running':![]};}else if(_0x5c2629[_0x81fa('0x28')][_0x167d36[_0x81fa('0x47')]][_0x81fa('0x131')]===!![]){return;}else if(_0x5c2629[_0x81fa('0x28')][_0x167d36[_0x81fa('0x47')]][_0x81fa('0x131')]===![]){_0x5c2629[_0x81fa('0x28')][_0x167d36[_0x81fa('0x47')]][_0x81fa('0x131')]=!![];}var _0x32d29a=_0x5c2629['voiceQueues'][_0x167d36['name']];var _0x774aaa=_0x32d29a['message']!==utils[_0x81fa('0x6a')][_0x81fa('0x7b')];var _0x3ebe70=utils[_0x81fa('0x132')](_0x32d29a);_0x32d29a[_0x81fa('0x133')]=utils['getQueueCampaignStatusMessage'](_0x32d29a,_0x5c2629[_0x81fa('0x1c')]);Promise[_0x81fa('0xaa')]()['then'](function(){if(_0x32d29a[_0x81fa('0x133')]===utils[_0x81fa('0x6a')][_0x81fa('0x7b')]){if(_0x774aaa){clearPredictiveAttributes(_0x32d29a);_0x167d36[_0x81fa('0x23')]=undefined;_0x167d36[_0x81fa('0x24')]=undefined;}if(_0x32d29a[_0x81fa('0x133')]===utils['CAMPAIGN_STATUS'][_0x81fa('0x7b')]){_0x167d36[_0x81fa('0x134')]=0x0;_0x167d36['paused']=0x0;_0x167d36[_0x81fa('0x135')]=0x0;_0x167d36[_0x81fa('0x136')]=0x0;_0x167d36[_0x81fa('0x137')]=0x0;}}else if(_0x32d29a[_0x81fa('0x133')]===utils[_0x81fa('0x6a')][_0x81fa('0x138')]&&!_0x3ebe70){return _0x5c2629['ifTime'](_0x32d29a,!![])[_0x81fa('0x40')](function(){return _0x5c2629['ifTime'](_0x32d29a,![]);})[_0x81fa('0x40')](function(){return _0x5c2629['checkDialMethod'](_0x32d29a);})[_0x81fa('0xa0')](function(_0x4dd29f){loggerSyncQueueSummary[_0x81fa('0x45')](_0x81fa('0x139'),util['inspect'](_0x4dd29f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x32d29a);});}else{clearPredictiveAttributes(_0x32d29a);}})[_0x81fa('0x40')](function(){var _0x3e2b63=_0x167d36[_0x81fa('0x13a')](_0x32d29a);if(_0x3e2b63||_0x32d29a[_0x81fa('0x13b')]){_0x32d29a[_0x81fa('0x13b')]=![];_0x167d36[_0x81fa('0x13c')](_0x32d29a);Object[_0x81fa('0x13d')](_0x32d29a,_0x167d36);emitOutboundVoiceQueueSummary(_0x167d36);}_0x5c2629[_0x81fa('0x28')][_0x32d29a[_0x81fa('0x47')]][_0x81fa('0x131')]=![];})[_0x81fa('0xa0')](function(_0x3effcf){logger[_0x81fa('0x64')]('[syncQueueSummary]',util[_0x81fa('0x67')](_0x3effcf,{'showHidden':![],'depth':null}));_0x5c2629[_0x81fa('0x28')][_0x32d29a[_0x81fa('0x47')]]['running']=![];});};Dialer[_0x81fa('0x15')][_0x81fa('0x33')]=_[_0x81fa('0x13e')](function(){var _0x2d2898=_['filter'](this['voiceQueues'],function(_0x5d38e2){return _0x5d38e2[_0x81fa('0x13f')];});var _0x2f686b=_['filter'](this[_0x81fa('0x1b')],function(_0x216598){return _0x216598[_0x81fa('0x140')]&&_0x216598[_0x81fa('0x86')]===_0x81fa('0x87');});if(_0x2d2898[_0x81fa('0x96')]>0x0&&_0x2f686b[_0x81fa('0x96')]>0x0){return Promise[_0x81fa('0xaa')]()[_0x81fa('0x40')](cmHopper[_0x81fa('0x141')](_[_0x81fa('0x142')](_0x2d2898,'id'),previewRecallmeReminderInterval,_[_0x81fa('0x142')](_0x2f686b,'id')))[_0x81fa('0x40')](function(_0x3fed65){for(var _0x1997f3=0x0;_0x1997f3<_0x3fed65[_0x81fa('0x96')];_0x1997f3++){var _0x2a7600=_0x3fed65[_0x1997f3]['Agent']['name'];if(_0x2a7600)io['to'](util[_0x81fa('0x46')](_0x81fa('0x143'),_0x2a7600))[_0x81fa('0x11c')](_0x81fa('0x144'),{'hopper':_0x3fed65[_0x1997f3]});}})['catch'](function(_0x5af85d){logger['error'](_0x81fa('0x145'),_0x5af85d);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x81fa('0x15')][_0x81fa('0x3e')]=function(){var _0x8a3c22=this;setInterval(function(){_0x8a3c22[_0x81fa('0x146')](_0x8a3c22[_0x81fa('0x21')],'[uniqueid]');_0x8a3c22['clearZombieChannels'](_0x8a3c22[_0x81fa('0x1f')],_0x81fa('0x147'));},0x32c8);};Dialer['prototype'][_0x81fa('0x146')]=function(_0x194a23,_0x42d463){var _0x4dae33=this;for(var _0x19ff68 in _0x194a23){if(typeof _0x194a23[_0x19ff68]!=='undefined'){this[_0x81fa('0x17')][_0x81fa('0x148')](function(){if(!_[_0x81fa('0xf8')](_0x194a23[_0x19ff68])){return ami['Action']({'action':_0x81fa('0x86'),'channel':_0x194a23[_0x19ff68][_0x81fa('0xf3')]})[_0x81fa('0xa0')](function(_0x118343){if(_0x118343[_0x81fa('0x69')]===_0x81fa('0x149')){setTimeout(function(){if(_0x194a23[_0x19ff68]&&_0x194a23[_0x19ff68]['type']!==_0x81fa('0xbe')){_0x4dae33[_0x81fa('0xcd')](_0x4dae33[_0x81fa('0x19')][_0x194a23[_0x19ff68]['queue']]);logger['error'](_0x81fa('0x14a'),_0x42d463,_0x19ff68,_0x194a23[_0x19ff68][_0x81fa('0xbf')]);delete _0x194a23[_0x19ff68];}if(_0x194a23[_0x19ff68]&&_0x194a23[_0x19ff68][_0x81fa('0x43')]===_0x81fa('0xbe')){_0x4dae33[_0x81fa('0xcd')](_0x4dae33[_0x81fa('0x1a')][_0x194a23[_0x19ff68][_0x81fa('0xbf')]]);logger[_0x81fa('0x64')](_0x81fa('0x14b'),_0x42d463,_0x19ff68,_0x194a23[_0x19ff68]['queue']);delete _0x194a23[_0x19ff68];}},0x2328);}});}});}}};Dialer[_0x81fa('0x15')][_0x81fa('0x14c')]=function(_0x4db37d){return Promise[_0x81fa('0xaa')]()[_0x81fa('0x40')](voiceQueueRt[_0x81fa('0x14c')](_0x4db37d))[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x14d')));};Dialer[_0x81fa('0x15')][_0x81fa('0xcd')]=function(_0x3cf8d4){if(!_[_0x81fa('0x42')](_0x3cf8d4)&&_0x3cf8d4!==null){if(typeof _0x3cf8d4[_0x81fa('0x7e')]!==_0x81fa('0xa8')){if(_0x3cf8d4[_0x81fa('0x7e')]>0x0){_0x3cf8d4[_0x81fa('0x7e')]-=0x1;}else{logger[_0x81fa('0x64')](_0x81fa('0x14e'));}}}else{logger[_0x81fa('0x64')](_0x81fa('0x14f'));}};Dialer[_0x81fa('0x15')][_0x81fa('0x150')]=function(_0x2d9899,_0x30faf5){var _0x19fc9f=this;return function(_0xca02b){_0x19fc9f[_0x81fa('0xcd')](_0x30faf5);logger[_0x81fa('0x64')](_0x2d9899,util[_0x81fa('0x67')](_0xca02b,{'showHidden':![],'depth':null}));};};Dialer[_0x81fa('0x15')][_0x81fa('0x151')]=function(_0x458841,_0x453d10,_0x5b71be){var _0x38e31e={'state':0x19,'statedesc':_0x81fa('0x152')};this['updateOriginated'](_0x453d10);this[_0x81fa('0x118')](_[_0x81fa('0x5e')](_0x38e31e,_['pick'](_0x5b71be,['ContactId','ListId','UserId','VoiceQueueId',_0x81fa('0xe1')])),_0x81fa('0x153'),'[emptyContact]');logger['error'](_0x458841);};Dialer[_0x81fa('0x15')][_0x81fa('0x118')]=function(_0x6c239c,_0x83d5e7,_0x5c523f){hopperUtils[_0x81fa('0xc9')](_0x6c239c)[_0x81fa('0xa0')](loggerCatch(_0x83d5e7));hopperUtils['moveContactManagedDialer'](_0x6c239c)[_0x81fa('0xa0')](loggerCatch(_0x5c523f));};Dialer[_0x81fa('0x15')]['queueCallerAbandonCreateState']=function(_0x4be05d,_0x3a3d74){hopperUtils[_0x81fa('0xc9')](_0x4be05d)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xca')));if(_0x3a3d74==0x0){hopperUtils[_0x81fa('0xcb')](_0x4be05d)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x154')));}};Dialer['prototype']['checkPreviewRecallReminder']=function(_0x32a24c){return Promise[_0x81fa('0xaa')]()[_0x81fa('0x40')](cmHopper[_0x81fa('0x141')](_0x32a24c['id'],previewRecallmeReminderInterval))['then'](function(_0x3981eb){for(var _0x6473e4=0x0;_0x6473e4<_0x3981eb[_0x81fa('0x96')];_0x6473e4++){var _0x553791=_0x3981eb[_0x6473e4][_0x81fa('0x155')][_0x81fa('0x47')];if(_0x553791)io['to'](util['format'](_0x81fa('0x143'),_0x553791))[_0x81fa('0x11c')](_0x81fa('0x144'),{'hopper':_0x3981eb[_0x6473e4]});}})[_0x81fa('0xa0')](function(){});};Dialer[_0x81fa('0x15')][_0x81fa('0xad')]=function(_0x40c522){var _0x1d4955=this;return function(){_0x1d4955['handleIvr'](_0x40c522);};};Dialer[_0x81fa('0x15')][_0x81fa('0x156')]=function(_0x774697,_0x3dec3e){var _0x22507a=this;var _0x3aef2a=uuid['v4']();this[_0x81fa('0x1f')][_0x3aef2a]=new Action(_0x774697,_0x3dec3e,_0x3aef2a);return new Promise(function(_0x86dd2e,_0x1eec82){if(_[_0x81fa('0x42')](_0x774697)&&typeof _0x774697!=='object'){return _0x1eec82(msgResponse(_0x81fa('0x157'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x81fa('0x42')](_0x3dec3e[_0x81fa('0x158')])||_0x3dec3e[_0x81fa('0x158')]===null){return _0x1eec82(msgResponse('originate',_0x81fa('0x92'),'contact\x20is\x20undefine'));}var _0x3e19e9={'XMD-CALLERID':_0x22507a[_0x81fa('0x1f')][_0x3aef2a][_0x81fa('0x159')](),'XMD-AGI':_0x774697[_0x81fa('0x12c')]?util[_0x81fa('0x46')](_0x81fa('0x15a'),ipAgi,_0x774697[_0x81fa('0x12c')]):_0x81fa('0x15b'),'XMD-AGIAFTER':_0x774697['dialQueueProject2']?util['format'](_0x81fa('0x15a'),ipAgi,_0x774697[_0x81fa('0xc7')]):_0x81fa('0x15b'),'XMD-QUEUE':utils[_0x81fa('0x15c')](_0x774697)?util[_0x81fa('0x46')]('\x22%s,%s%s,,,%s\x22',_0x774697[_0x81fa('0x47')],_0x774697['dialQueueOptions']||'',_0x774697['dialAgiAfterHangupAgent']?'c':'',_0x774697[_0x81fa('0xd0')]||0x3):_0x81fa('0x15b'),'XMD-CONTACTID':_0x3dec3e[_0x81fa('0xdf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x22507a[_0x81fa('0x1f')][_0x3aef2a][_0x81fa('0x159')](),'XMD-AMD':_0x774697[_0x81fa('0x10f')]?_0x81fa('0x138'):'NONE','XMD-DESTINATION':_0x81fa('0x15d')};if(_0x774697['dialAMDActive']){_0x3e19e9[_0x81fa('0x15e')]=_0x774697[_0x81fa('0x15f')]||0x9c4;_0x3e19e9[_0x81fa('0x160')]=_0x774697[_0x81fa('0x161')]||0x5dc;_0x3e19e9['XMD-AMDAFTERGREETINGSILENCE']=_0x774697[_0x81fa('0x162')]||0x320;_0x3e19e9[_0x81fa('0x163')]=_0x774697[_0x81fa('0x164')]||0x1388;_0x3e19e9[_0x81fa('0x165')]=_0x774697[_0x81fa('0x166')]||0x64;_0x3e19e9[_0x81fa('0x167')]=_0x774697['dialAMDBetweenWordsSilence']||0x32;_0x3e19e9[_0x81fa('0x168')]=_0x774697[_0x81fa('0x169')]||0x3;_0x3e19e9['XMD-AMDSILENCETHRESHOLD']=_0x774697[_0x81fa('0x16a')]||0x100;_0x3e19e9['XMD-AMDMAXIMUMWORDLENGTH']=_0x774697[_0x81fa('0x16b')]||0x1388;}if(utils['isOutboundQueue'](_0x774697)){_0x3e19e9[_0x81fa('0x16c')]=_0x3dec3e[_0x81fa('0xee')];}else{_0x3e19e9[_0x81fa('0x16d')]=_0x3dec3e[_0x81fa('0xe1')];}for(var _0x25aa1b in _0x3dec3e['Contact']){if(typeof _0x3dec3e[_0x81fa('0x16e')][_0x25aa1b]!==_0x81fa('0xa8')){if(isNotNull(_0x3dec3e[_0x81fa('0x16e')][_0x25aa1b])&&_0x25aa1b!=='id'&&_0x25aa1b!==_0x81fa('0x16f')&&_0x25aa1b!==_0x81fa('0x170')&&_0x25aa1b!==_0x81fa('0x171')){_0x3e19e9[util[_0x81fa('0x46')](_0x81fa('0x172'),_0x81fa('0x173'),_['toUpper'](_0x25aa1b))]=_0x3dec3e['Contact'][_0x25aa1b];}}}var _0x9f7c8c=_0x22507a[_0x81fa('0x84')](_0x774697[_0x81fa('0x8a')])?utils['getCallerId'](_0x774697[_0x81fa('0x8a')][_0x81fa('0x174')],_0x774697['dialOriginateCallerIdName'],_0x774697['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x774697[_0x81fa('0x175')],_0x774697[_0x81fa('0x176')]):_0x774697['dialOriginateCallerIdNumber']):utils[_0x81fa('0x177')](_[_0x81fa('0xf8')](_0x774697[_0x81fa('0x8b')])?_0x774697[_0x81fa('0x8a')]['callerid']:_0x774697['TrunkBackup']['callerid'],_0x774697[_0x81fa('0x178')],_0x774697[_0x81fa('0x176')]>0x0?utils['getCallerIdRandom'](_0x774697[_0x81fa('0x175')],_0x774697[_0x81fa('0x176')]):_0x774697['dialOriginateCallerIdNumber']);if(_0x9f7c8c){_0x3e19e9['XMD-ORIGINATECALLERIDNAME']=_0x22507a[_0x81fa('0x1f')][_0x3aef2a][_0x81fa('0x179')]=utils['extractCalleridName'](_0x9f7c8c);_0x3e19e9['XMD-ORIGINATECALLERIDNUM']=_0x3dec3e[_0x81fa('0x158')];}_0x774697['variables']=_0x3e19e9;return ami[_0x81fa('0x9e')]({'actionid':_0x3aef2a,'action':_0x81fa('0x157'),'channel':_0x22507a['isTrunkReachable'](_0x774697[_0x81fa('0x8a')])?util[_0x81fa('0x46')](_0x81fa('0x17a'),_0x774697[_0x81fa('0x8a')][_0x81fa('0x47')],isNotNull(_0x774697[_0x81fa('0x17b')])?_0x774697[_0x81fa('0x17b')][_0x81fa('0x17c')]()||'':'',_0x774697[_0x81fa('0x17d')]>0x0?_0x3dec3e[_0x81fa('0x158')][_0x81fa('0x17e')](_0x774697[_0x81fa('0x17d')]):_0x3dec3e['phone']):util[_0x81fa('0x46')]('SIP/%s/%s%s',_[_0x81fa('0xf8')](_0x774697[_0x81fa('0x8b')])?_0x774697['Trunk'][_0x81fa('0x47')]:_0x774697[_0x81fa('0x8b')][_0x81fa('0x47')],isNotNull(_0x774697[_0x81fa('0x17b')])?_0x774697['dialPrefix'][_0x81fa('0x17c')]()||'':'',_0x774697['dialCutDigit']>0x0?_0x3dec3e[_0x81fa('0x158')]['substring'](_0x774697[_0x81fa('0x17d')]):_0x3dec3e[_0x81fa('0x158')]),'callerid':_0x9f7c8c,'Exten':_0x81fa('0x15d'),'Context':_0x81fa('0x17f'),'Priority':'1','variable':_0x3e19e9,'timeout':(_0x774697['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3aef2a})[_0x81fa('0x40')](function(_0x1b9240){return _0x86dd2e(_0x1b9240);})[_0x81fa('0xa0')](function(_0x4e917f){_0x774697[_0x81fa('0x180')]+=0x1;var _0x49eff2=new History(_0x22507a[_0x81fa('0x1f')][_0x3aef2a]);logger[_0x81fa('0x64')](util[_0x81fa('0x46')](_0x81fa('0x181'),JSON[_0x81fa('0x74')](_0x4e917f)));_0x49eff2[_0x81fa('0x6f')]=0xe;_0x49eff2['statedesc']='OriginateError';_0x49eff2['starttime']=moment()['format'](_0x81fa('0xc2'));_0x49eff2[_0x81fa('0x70')]=_0x49eff2['starttime'];hopperUtils['createHistory'](_0x49eff2)['catch'](loggerCatch('[originate][error]'));_0x22507a['moveContactManagedDialer'](_0x49eff2)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x182')))['finally'](function(){delete _0x22507a[_0x81fa('0x1f')][_0x3aef2a];return _0x1eec82(msgResponse(_0x81fa('0x157'),_0x81fa('0xbd'),_0x81fa('0x183')));});});});};Dialer['prototype'][_0x81fa('0x184')]=function(_0x5cd45f,_0x43ae7f,_0x320095){var _0x452a18=new History(_0x43ae7f);if(_0x452a18['countbusyretry']+_0x452a18['countcongestionretry']+_0x452a18[_0x81fa('0x185')]+_0x452a18[_0x81fa('0x120')]+_0x452a18[_0x81fa('0xd5')]+_0x452a18['countabandonedretry']+_0x452a18[_0x81fa('0x11b')]+_0x452a18[_0x81fa('0x121')]>=_0x320095[_0x81fa('0x122')]-0x1){return!![];}switch(_0x5cd45f){case 0x3:if(_0x452a18[_0x81fa('0x185')]>=_0x320095['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x81fa('0xdc')]({'active':![],'countnoanswerretry':_0x452a18[_0x81fa('0x185')]+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095[_0x81fa('0x186')],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x452a18['ContactId'],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18['CampaignId']||undefined})['catch'](loggerCatch(_0x81fa('0x187')));break;case 0x5:if(_0x452a18[_0x81fa('0x11e')]>=_0x320095[_0x81fa('0x188')]-0x1){return!![];}hopperUtils[_0x81fa('0xdc')]({'active':![],'countbusyretry':_0x452a18[_0x81fa('0x11e')]+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095['dialBusyRetryFrequency'],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x452a18[_0x81fa('0xdf')],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18['VoiceQueueId']||undefined,'CampaignId':_0x452a18['CampaignId']||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x189')));break;case 0x8:if(_0x452a18['countcongestionretry']>=_0x320095[_0x81fa('0x18a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x452a18['countcongestionretry']+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095[_0x81fa('0x18b')],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x452a18[_0x81fa('0xdf')],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18['CampaignId']||undefined})[_0x81fa('0xa0')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x452a18['countnosuchnumberretry']>=_0x320095['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x81fa('0xdc')]({'active':![],'countnosuchnumberretry':_0x452a18[_0x81fa('0x120')]+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095['dialNoSuchNumberRetryFrequency'],_0x81fa('0xde'))[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x452a18['ContactId'],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18[_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x18c')));}break;case 0xa:if(_0x452a18[_0x81fa('0xd5')]>=_0x320095['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x81fa('0xdc')]({'active':![],'countdropretry':_0x452a18[_0x81fa('0xd5')]+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095[_0x81fa('0xd7')],'minutes')[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x452a18[_0x81fa('0xdf')],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18['CampaignId']||undefined})[_0x81fa('0xa0')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x452a18['countabandonedretry']>=_0x320095[_0x81fa('0xeb')]-0x1){return!![];}hopperUtils[_0x81fa('0xdc')]({'active':![],'countabandonedretry':_0x452a18[_0x81fa('0xed')]+=0x1,'scheduledat':moment()['add'](_0x320095['dialAbandonedRetryFrequency'],_0x81fa('0xde'))[_0x81fa('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x452a18['ContactId'],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18[_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xef')));break;case 0x13:if(_0x452a18[_0x81fa('0x11b')]>=_0x320095[_0x81fa('0x124')]-0x1){return!![];}hopperUtils[_0x81fa('0xdc')]({'active':![],'countmachineretry':_0x452a18[_0x81fa('0x11b')]+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095[_0x81fa('0x127')],_0x81fa('0xde'))[_0x81fa('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x452a18[_0x81fa('0xdf')],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18['CampaignId']||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x128')));break;case 0x14:if(_0x452a18[_0x81fa('0x121')]>=_0x320095['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x81fa('0xdc')]({'active':![],'countagentrejectretry':_0x452a18[_0x81fa('0x121')]+=0x1,'scheduledat':moment()[_0x81fa('0xdd')](_0x320095[_0x81fa('0x18d')],'minutes')[_0x81fa('0x46')](_0x81fa('0xc2')),'ContactId':_0x452a18[_0x81fa('0xdf')],'ListId':_0x452a18[_0x81fa('0xe0')],'VoiceQueueId':_0x452a18[_0x81fa('0xee')]||undefined,'CampaignId':_0x452a18[_0x81fa('0xe1')]||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x18e')));break;default:return!![];}};Dialer[_0x81fa('0x15')][_0x81fa('0x10b')]=function(_0x38729e,_0x3d5cc6,_0x444b17){var _0xcdb159=this;var _0x1d8285=new History(_0x38729e);var _0x27f22c=![];var _0x17a6c4;var _0xae443e;return new Promise(function(_0x130d8c,_0x113882){if(_[_0x81fa('0x42')](_0x3d5cc6)&&typeof _0x3d5cc6!=='object'){return _0x113882(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0x81fa('0x42')](_0x444b17)&&typeof _0x444b17!==_0x81fa('0x18f')){return _0x113882(msgResponse(_0x81fa('0x190'),'Failure','evt\x20is\x20undefine'));}hopperUtils[_0x81fa('0xea')](_0x1d8285,_0x444b17[_0x81fa('0xc4')],_0x3d5cc6)[_0x81fa('0x40')](function(_0x4c5a9c){if(_0x4c5a9c[_0x81fa('0xec')]==0x1)_0x27f22c=!![];switch(_0x444b17[_0x81fa('0xc4')]){case'0':_0x3d5cc6[_0x81fa('0x191')]+=0x1;_0x1d8285['state']=0x0;_0x1d8285['statedesc']=_0x81fa('0x192');_0x1d8285[_0x81fa('0x120')]+=0x1;_0x1d8285[_0x81fa('0xd6')]+=0x1;ami[_0x81fa('0x11c')](_0x81fa('0x193'),ut[_0x81fa('0x116')](_0x38729e,_0x81fa('0x194')));_0x17a6c4=_0x3d5cc6[_0x81fa('0x195')];_0xae443e=_0x3d5cc6[_0x81fa('0xd8')];hopperUtils[_0x81fa('0xc9')](_0x1d8285)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x11d')));if(_0xcdb159[_0x81fa('0x184')](0x0,_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285['countnosuchnumberretry']>=_0x3d5cc6[_0x81fa('0x196')]){_0xcdb159[_0x81fa('0x125')](_0x1d8285,_0x130d8c,_0x113882,'reason\x200\x20no\x20such\x20number....');}else{_0xcdb159[_0x81fa('0x197')](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x198'));}}break;case'3':_0x3d5cc6[_0x81fa('0x199')]+=0x1;_0x1d8285[_0x81fa('0x6f')]=0x3;_0x1d8285[_0x81fa('0xd1')]=_0x81fa('0x19a');_0x1d8285[_0x81fa('0x185')]+=0x1;_0x1d8285[_0x81fa('0xd6')]+=0x1;var _0xeea6e0=ut[_0x81fa('0x19b')](_0x38729e,_0x3d5cc6);ami[_0x81fa('0x11c')](_0x81fa('0x19c'),_0xeea6e0);_0x17a6c4=_0x3d5cc6[_0x81fa('0x186')];_0xae443e=_0x3d5cc6['callAdditionalPhoneAfterMin'];hopperUtils[_0x81fa('0xc9')](_0x1d8285)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x19d')));if(_0xcdb159[_0x81fa('0x184')](0x3,_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285[_0x81fa('0x185')]>=_0x3d5cc6['dialNoAnswerMaxRetry']){_0xcdb159['createStateFinal'](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x19e'));}else{_0xcdb159[_0x81fa('0x197')](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x19e'));}}break;case'5':_0x3d5cc6[_0x81fa('0x19f')]+=0x1;_0x1d8285[_0x81fa('0x6f')]=0x5;_0x1d8285['statedesc']=_0x81fa('0x1a0');_0x1d8285['countbusyretry']+=0x1;_0x1d8285['countglobal']+=0x1;ami[_0x81fa('0x11c')](_0x81fa('0x1a1'),ut['buildObj'](_0x38729e,'busy'));_0x17a6c4=_0x3d5cc6[_0x81fa('0x1a2')];_0xae443e=_0x3d5cc6[_0x81fa('0xd8')];hopperUtils['createHistory'](_0x1d8285)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x1a3')));if(_0xcdb159[_0x81fa('0x184')](0x5,_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285[_0x81fa('0x11e')]>=_0x3d5cc6[_0x81fa('0x188')]){_0xcdb159[_0x81fa('0x125')](_0x1d8285,_0x130d8c,_0x113882,'reason\x205\x20busy');}else{_0xcdb159['stateGlobal'](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x1a4'));}}break;case'8':_0x3d5cc6[_0x81fa('0x1a5')]+=0x1;_0x1d8285['state']=0x8;_0x1d8285[_0x81fa('0xd1')]=_0x81fa('0x1a6');_0x1d8285[_0x81fa('0x11f')]+=0x1;_0x1d8285[_0x81fa('0xd6')]+=0x1;_0x17a6c4=_0x3d5cc6[_0x81fa('0x18b')];_0xae443e=_0x3d5cc6[_0x81fa('0xd8')];ami[_0x81fa('0x11c')]('custom:agentcongestion',ut[_0x81fa('0x116')](_0x38729e,_0x81fa('0x1a7')));hopperUtils['createHistory'](_0x1d8285)['catch'](loggerCatch(_0x81fa('0x1a8')));if(_0xcdb159[_0x81fa('0x184')](0x8,_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285['countcongestionretry']>=_0x3d5cc6[_0x81fa('0x18a')]){_0xcdb159[_0x81fa('0x125')](_0x1d8285,_0x130d8c,_0x113882,'reason\x208\x20congestion');}else{_0xcdb159[_0x81fa('0x197')](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x1a9'));}}break;case'11':_0x3d5cc6[_0x81fa('0x1aa')]+=0x1;_0x1d8285[_0x81fa('0x6f')]=0xb;_0x1d8285[_0x81fa('0xd1')]=_0x81fa('0xe8');_0x1d8285[_0x81fa('0xed')]+=0x1;_0x1d8285[_0x81fa('0xd6')]+=0x1;_0x17a6c4=_0x3d5cc6['dialAbandonedRetryFrequency'];_0xae443e=_0x3d5cc6['callAdditionalPhoneAfterMin'];hopperUtils[_0x81fa('0xc9')](_0x1d8285)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0xf1')));if(_0xcdb159['checkRetriveMax'](0xb,_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285[_0x81fa('0xed')]>=_0x3d5cc6['dialAbandonedMaxRetry']){_0xcdb159[_0x81fa('0x125')](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x1ab'));}else{_0xcdb159[_0x81fa('0x197')](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x1ab'));}}break;case'20':_0x3d5cc6[_0x81fa('0x1ac')]+=0x1;_0x1d8285[_0x81fa('0x6f')]=0x14;_0x1d8285['statedesc']=_0x81fa('0x1ad');_0x1d8285[_0x81fa('0x121')]+=0x1;_0x1d8285[_0x81fa('0xd6')]+=0x1;_0x17a6c4=_0x3d5cc6['dialAgentRejectRetryFrequency'];_0xae443e=_0x3d5cc6[_0x81fa('0xd8')];ami[_0x81fa('0x11c')](_0x81fa('0x1ae'),ut[_0x81fa('0x116')](_0x38729e,_0x81fa('0x1af')));hopperUtils[_0x81fa('0xc9')](_0x1d8285)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x1b0')));if(_0xcdb159[_0x81fa('0x184')](0x14,_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285[_0x81fa('0x121')]>=_0x3d5cc6[_0x81fa('0x1b1')]){_0xcdb159[_0x81fa('0x125')](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x1b2'));}else{_0xcdb159['stateGlobal'](_0x1d8285,_0x130d8c,_0x113882,_0x81fa('0x1b2'));}}break;default:_0x3d5cc6[_0x81fa('0x1b3')]+=0x1;_0x1d8285[_0x81fa('0x6f')]=0xc;_0x1d8285['statedesc']=_0x444b17[_0x81fa('0xc4')];_0x17a6c4=_0x3d5cc6['dialAgentRejectRetryFrequency'];_0xae443e=_0x3d5cc6[_0x81fa('0xd8')];hopperUtils[_0x81fa('0xc9')](_0x1d8285)[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x1b4')));if(_0xcdb159[_0x81fa('0x184')](_0x444b17[_0x81fa('0xc4')],_0x38729e,_0x3d5cc6)&&!_0x27f22c){if(_0x1d8285['countbusyretry']+_0x1d8285['countcongestionretry']+_0x1d8285[_0x81fa('0x185')]+_0x1d8285['countnosuchnumberretry']+_0x1d8285['countdropretry']+_0x1d8285[_0x81fa('0xed')]+_0x1d8285[_0x81fa('0x11b')]+_0x1d8285[_0x81fa('0x121')]>=_0x3d5cc6[_0x81fa('0x122')]){_0xcdb159[_0x81fa('0x197')](_0x1d8285,_0x130d8c,_0x113882,_0x444b17[_0x81fa('0xc4')]);}else{_0xcdb159['createStateFinal'](_0x1d8285,_0x130d8c,_0x113882,_0x444b17['reason']);}}}})[_0x81fa('0x40')](function(){if(_0x27f22c){hopperUtils['swapAdditionalPhones'](_0x1d8285,_0x17a6c4,_0xae443e)[_0x81fa('0x40')](function(){return _0x130d8c(0x1);});}});});};Dialer['prototype'][_0x81fa('0x197')]=function(_0x103170,_0x32299b,_0x20b7ae,_0x6a4eca){var _0x551bb8=new Final(_0x103170);_0x551bb8[_0x81fa('0x6f')]=0xf;_0x551bb8[_0x81fa('0xd1')]='Global';this[_0x81fa('0x125')](_0x551bb8,_0x32299b,_0x20b7ae,_0x6a4eca);};Dialer[_0x81fa('0x15')][_0x81fa('0x125')]=function(_0x3be0f8,_0x450abf,_0x2d72cd,_0x394a44){hopperUtils['moveContactManagedDialer'](_0x3be0f8)[_0x81fa('0x40')](function(){return _0x450abf(msgResponse(_0x81fa('0x190'),_0x81fa('0x10a'),_0x394a44));})[_0x81fa('0xa0')](function(){return _0x2d72cd(msgResponse('[moveContactManagedDialer][0]',_0x81fa('0x92'),_0x81fa('0x1b5')));});};Dialer[_0x81fa('0x15')]['predictive']=function(_0x138536){var _0x4830bb=_0x138536[_0x81fa('0x1b6')]/0x64;var _0xbb3934=_0x138536[_0x81fa('0x1b7')]/(_0x138536[_0x81fa('0x1b7')]+_0x138536[_0x81fa('0xc3')]);var _0x3d37a4=Math[_0x81fa('0x1b8')](_0x138536['predictiveIntervalAvailable']*(_0x138536[_0x81fa('0x1b9')]/0x64));var _0x1c55e3=Math['round'](_0x138536[_0x81fa('0x1ba')]*(_0x138536['predictiveIntervalMinThreshold']/0x64));var _0x2de1e0=_0x138536[_0x81fa('0x134')]+_0x138536[_0x81fa('0x136')];var _0x20b102=Math[_0x81fa('0x1bb')](_0x138536['erlangCalls']*_0x138536[_0x81fa('0x5d')]*_0x138536[_0x81fa('0x1bc')]*_0x138536['predictiveIntervalMultiplicativeFactor']);if(_[_0x81fa('0x42')](_0x138536[_0x81fa('0x24')])){if(!_['isUndefined'](_0x138536[_0x81fa('0x23')])){_0x138536['startPredictive']=undefined;loggerPredictive[_0x81fa('0x64')](_0x81fa('0x1bd'),_0x81fa('0x1be'));}if(!_[_0x81fa('0x42')](_0x138536[_0x81fa('0x62')])){loggerPredictive[_0x81fa('0x64')]('[startMethodPredictive][StartProgressive]',_0x81fa('0x1bf'));clearInterval(_0x138536['handlePredictive']);_0x138536['handlePredictive']=undefined;}_0x138536['startProgressive']=moment()['format'](_0x81fa('0xc2'));loggerPredictive[_0x81fa('0x4a')](_0x138536[_0x81fa('0x47')],'collection\x20data\x20in\x20progressive\x20at',_0x138536[_0x81fa('0x24')]);this[_0x81fa('0xb2')](_0x138536,0x1);}else if(ifInterval(_0x138536['dialPredictiveInterval'],_0x138536[_0x81fa('0x24')])){this[_0x81fa('0xb2')](_0x138536,0x1);loggerPredictiveCalls[_0x81fa('0x4a')](_0x81fa('0x1c0'),_0x138536[_0x81fa('0x24')],_0x138536['name']);_0x138536[_0x81fa('0x57')]=0x0;_0x138536[_0x81fa('0x1c1')]=0x0;}else if(_0x4830bb<_0xbb3934&&_0x138536[_0x81fa('0x1c2')]===_0x81fa('0x1c3')){clearPredictiveAttributes(_0x138536);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x1c4'),'Dropped\x20calls\x20day',_0xbb3934,_0x81fa('0x24'),_0x138536[_0x81fa('0x47')]);}else if(_0x20b102<_0x138536['predictiveIntervalErlangCallsDroppedCalls']&&_0x138536['dialPredictiveOptimization']===_0x81fa('0x1c3')){clearPredictiveAttributes(_0x138536);loggerPredictive[_0x81fa('0x4a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x81fa('0x1c5'),_0x20b102,_0x81fa('0x1c6'),_0x138536[_0x81fa('0x1c1')],_0x81fa('0x24'),_0x138536['name']);}else if(!ifInterval(_0x138536[_0x81fa('0x1c7')],_0x138536[_0x81fa('0x24')])&&_[_0x81fa('0x42')](_0x138536[_0x81fa('0x23')])&&!_[_0x81fa('0x42')](_0x138536['startProgressive'])){_0x138536[_0x81fa('0x23')]=moment()[_0x81fa('0x46')](_0x81fa('0xc2'));loggerPredictive[_0x81fa('0x4a')](_0x138536[_0x81fa('0x47')],'started\x20in\x20predictive\x20at',_0x138536[_0x81fa('0x23')]);hopperUtils[_0x81fa('0x1c8')](_0x138536[_0x81fa('0x1c7')])['then'](this[_0x81fa('0x1c9')](_0x138536))['then'](mergeDataErlangB(_0x138536))['then'](this[_0x81fa('0x1ca')](_0x138536))[_0x81fa('0xa0')](loggerCatchPredictive(_0x81fa('0x1cb'),_0x138536));}else if(!ifInterval(_0x138536['dialPredictiveInterval'],_0x138536[_0x81fa('0x23')])){_0x138536[_0x81fa('0x1c1')]=0x0;_0x138536[_0x81fa('0x23')]=moment()[_0x81fa('0x46')](_0x81fa('0xc2'));loggerPredictive[_0x81fa('0x4a')](_0x138536[_0x81fa('0x47')],_0x81fa('0x1cc'),_0x138536[_0x81fa('0x23')]);clearInterval(_0x138536[_0x81fa('0x62')]);_0x138536[_0x81fa('0x62')]=undefined;hopperUtils['avgHandleTime'](_0x138536['dialPredictiveInterval'])[_0x81fa('0x40')](this['getDataPredictive'](_0x138536))[_0x81fa('0x40')](mergeDataErlangB(_0x138536))['then'](this['startMethodPredictive'](_0x138536))['catch'](loggerCatchPredictive(_0x81fa('0x1cd'),_0x138536));}else if(_0x138536['predictiveIntervalAvailable']&&_0x2de1e0<_0x138536[_0x81fa('0x1ba')]-_0x1c55e3){clearPredictiveAttributes(_0x138536);loggerPredictive[_0x81fa('0x4a')](_0x138536[_0x81fa('0x47')],_0x81fa('0x1ce'),_0x2de1e0,')\x20are\x20less\x20than\x20threshold\x20(',_0x138536['predictiveIntervalAvailable'],'-',_0x1c55e3,'=',_0x138536['predictiveIntervalAvailable']-_0x1c55e3,')');}else if(_0x138536[_0x81fa('0x1ba')]&&_0x2de1e0>_0x138536[_0x81fa('0x1ba')]+_0x3d37a4){clearPredictiveAttributes(_0x138536);loggerPredictive[_0x81fa('0x4a')](_0x138536[_0x81fa('0x47')],_0x81fa('0x1ce'),_0x2de1e0,_0x81fa('0x1cf'),_0x138536['predictiveIntervalAvailable'],'+',_0x3d37a4,'=',_0x138536[_0x81fa('0x1ba')]+_0x3d37a4,')');}};Dialer['prototype'][_0x81fa('0x1c9')]=function(_0x219e69){var _0x4c4787=this;return function(_0xa0f7cf){return new Promise(function(_0x3bbe26,_0x51142d){_['merge'](_0x219e69,_0xa0f7cf[0x0]);if(checkGetDataPredictive(_0xa0f7cf[0x0])){var _0x390da1=_0x219e69['predictiveIntervalAvailable']=_0x219e69[_0x81fa('0x136')]+_0x219e69['available'];var _0x3b9538=_0x219e69[_0x81fa('0x1c7')]*0x3c;var _0x58c04b=_0xa0f7cf[0x0][_0x81fa('0x52')]+_0xa0f7cf[0x0][_0x81fa('0x50')];var _0x13e906=(_0xa0f7cf[0x0]['predictiveIntervalAnsweredCalls']+_0xa0f7cf[0x0][_0x81fa('0x4e')]+_0xa0f7cf[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xa0f7cf[0x0][_0x81fa('0x4b')];_0x219e69['predictiveIntervalHitRate']=_0x13e906>0x0?_0x13e906:0x1;switch(_0x219e69['dialPredictiveOptimization']){case _0x81fa('0x1c3'):var _0x1d5d7d=_0x219e69[_0x81fa('0x1b6')]/0x64;return _0x4c4787['abandonmentRate'](_0x390da1,_0x3b9538,_0x58c04b,_0x13e906,_0x1d5d7d)['then'](function(_0x5bacea){return _0x3bbe26(_0x5bacea);});case _0x81fa('0x1d0'):var _0x563956=_0x219e69[_0x81fa('0x1b6')]/0x64;return _0x4c4787[_0x81fa('0x1d1')](_0x390da1,_0x3b9538,_0x58c04b,_0x13e906,_0x563956)[_0x81fa('0x40')](function(_0x171fe6){return _0x3bbe26(_0x171fe6);});default:return _0x51142d(msgResponse('[getDataPredictive]','Failure',_0x81fa('0x1d2')));}}else{return _0x51142d(msgResponse('[getDataPredictive]',_0x81fa('0x92'),_0x81fa('0x1d3')));}});};};Dialer[_0x81fa('0x15')][_0x81fa('0x1d4')]=function(_0x15261f){var _0x2b9249=this;return function(_0x65a122){return new Promise(function(_0x25b2be,_0x271788){_['merge'](_0x15261f,_0x65a122[0x0]);if(checkGetDataPredictive(_0x65a122[0x0])){loggerPredictive[_0x81fa('0x4a')](JSON[_0x81fa('0x74')](_0x65a122[0x0]));if(_0x15261f['dialPredictiveOptimization']===_0x81fa('0x1c3')){return _0x2b9249[_0x81fa('0x14c')](_0x15261f['id'])[_0x81fa('0x40')](function(_0x494115){var _0x32d016=_0x15261f['loggedIn']-_0x494115[0x0]['outboundQueuePauses'];var _0x4f9c79=_0x15261f[_0x81fa('0x1c7')]*0x3c;var _0x278342=_0x65a122[0x0][_0x81fa('0x52')]+_0x65a122[0x0][_0x81fa('0x50')];var _0x33aab1=(_0x65a122[0x0][_0x81fa('0x1d5')]+_0x65a122[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x65a122[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x65a122[0x0][_0x81fa('0x4b')];var _0x204816=_0x15261f['dialPredictiveOptimizationPercentage']/0x64;_0x15261f[_0x81fa('0x1d6')]=_0x494115[0x0][_0x81fa('0x1d7')]||0x0;_0x15261f[_0x81fa('0x1bc')]=_0x33aab1>0x0?_0x33aab1:0x1;return _0x2b9249[_0x81fa('0x1d8')](_0x32d016,_0x4f9c79,_0x278342,_0x33aab1,_0x204816);})[_0x81fa('0x40')](function(_0x5cc737){return _0x25b2be(_0x5cc737);})[_0x81fa('0xa0')](function(_0x16e0c3){return _0x271788(msgResponse(_0x81fa('0x1d9'),_0x81fa('0x92'),JSON[_0x81fa('0x74')](_0x16e0c3)));});}if(_0x15261f['dialPredictiveOptimization']===_0x81fa('0x1d0')){return _0x2b9249[_0x81fa('0x14c')](_0x15261f['id'])[_0x81fa('0x40')](function(_0x60b4e){var _0x4b814c=_0x15261f[_0x81fa('0x1da')]-_0x60b4e[0x0][_0x81fa('0x1d7')];var _0x5b5190=_0x15261f[_0x81fa('0x1c7')]*0x3c;var _0x2f8cda=_0x65a122[0x0][_0x81fa('0x52')]+_0x65a122[0x0][_0x81fa('0x50')];var _0x2c8ba6=(_0x65a122[0x0][_0x81fa('0x1d5')]+_0x65a122[0x0][_0x81fa('0x4e')]+_0x65a122[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x65a122[0x0][_0x81fa('0x4b')];var _0x4c05c4=_0x15261f[_0x81fa('0x1b6')]/0x64;_0x15261f[_0x81fa('0x1d6')]=_0x60b4e[0x0][_0x81fa('0x1d7')]||0x0;_0x15261f[_0x81fa('0x1bc')]=_0x2c8ba6>0x0?_0x2c8ba6:0x1;return _0x2b9249[_0x81fa('0x1d1')](_0x4b814c,_0x5b5190,_0x2f8cda,_0x2c8ba6,_0x4c05c4);})['then'](function(_0x11d7f1){return _0x25b2be(_0x11d7f1);})[_0x81fa('0xa0')](function(_0x3e96ce){return _0x271788(msgResponse('[CatchErlangB]',_0x81fa('0x92'),JSON['stringify'](_0x3e96ce)));});}}else{return _0x271788(msgResponse(_0x81fa('0x1db'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0x81fa('0x1ca')]=function(_0xdc7ff4){var _0x34ef0c=this;return function(){var _0x3c6882=0x0;var _0x12d044=Math[_0x81fa('0x1bb')](_0xdc7ff4[_0x81fa('0x59')]*0x3e8);if(_0x12d044>0x0){_0x12d044=_0x12d044<0x64?0x64:_0x12d044;loggerPredictive[_0x81fa('0x4a')](_0xdc7ff4[_0x81fa('0x47')],_0x81fa('0x1dc'),_0x12d044,_0x81fa('0x1dd'));_0xdc7ff4[_0x81fa('0x62')]=setInterval(function(){_0x34ef0c[_0x81fa('0x62')](_0xdc7ff4);loggerPredictiveCalls['info'](_0x81fa('0x1de'),_0x3c6882+=0x1);},_0x12d044);}else{loggerPredictive['info'](_0xdc7ff4[_0x81fa('0x47')],_0x81fa('0x1df'));}};};Dialer['prototype'][_0x81fa('0x1e0')]=function(_0x2e9845,_0x19779c){var _0x4b3ba2=this;return function(_0x985a3){if(_[_0x81fa('0x49')](_0x985a3)){if(_['isNil'](_0x19779c[_0x81fa('0x1e1')])||!_0x19779c[_0x81fa('0x1e2')]){if(_0x2e9845['dialMethod']===_0x81fa('0xb1')){_0x2e9845[_0x81fa('0x72')]=_[_0x81fa('0x42')](_0x2e9845[_0x81fa('0x72')])?!![]:_0x2e9845[_0x81fa('0x72')];var _0x181ef5=uuid['v4']();_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5]=new Action(_0x2e9845,_0x19779c,_0x181ef5);loggerBooked[_0x81fa('0x4a')](_0x81fa('0x1e3'),_0x181ef5,'queueStatusComplete:\x20',JSON[_0x81fa('0x74')](_0x2e9845[_0x81fa('0x72')]),_0x81fa('0x1e4'),_0x2e9845[_0x81fa('0x47')]);if(_0x2e9845[_0x81fa('0x72')]){_0x2e9845['queueStatusComplete']=![];_0x4b3ba2[_0x81fa('0x26')][_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5][_0x81fa('0xbf')]]=[];ami[_0x81fa('0x9e')]({'actionid':_0x181ef5,'action':_0x81fa('0x1e5'),'queue':_0x2e9845[_0x81fa('0x47')]})[_0x81fa('0xa0')](function(){_0x4b3ba2[_0x81fa('0xcd')](_0x2e9845);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5][_0x81fa('0xdf')],'ListId':_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5]['ListId'],'VoiceQueueId':_0x4b3ba2['actions'][_0x181ef5][_0x81fa('0xee')]||undefined,'CampaignId':_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5][_0x81fa('0xe1')]||undefined})['catch'](loggerCatch(_0x81fa('0x1e6')));delete _0x4b3ba2[_0x81fa('0x1f')][_0x181ef5];});}else{loggerBooked[_0x81fa('0x4a')](_0x81fa('0x1e7'),JSON[_0x81fa('0x74')](_0x2e9845[_0x81fa('0x72')]),_0x81fa('0x1e4'),_0x2e9845['name']);_0x4b3ba2[_0x81fa('0xcd')](_0x2e9845);hopperUtils[_0x81fa('0xdc')]({'active':![],'ContactId':_0x4b3ba2['actions'][_0x181ef5][_0x81fa('0xdf')],'ListId':_0x4b3ba2['actions'][_0x181ef5]['ListId'],'VoiceQueueId':_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5][_0x81fa('0xee')]||undefined,'CampaignId':_0x4b3ba2[_0x81fa('0x1f')][_0x181ef5]['CampaignId']||undefined})[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x1e6')));delete _0x4b3ba2[_0x81fa('0x1f')][_0x181ef5];}}else{return _0x4b3ba2[_0x81fa('0x156')](_0x2e9845,_0x19779c);}}else{if(utils['getSeconds'](undefined,_0x19779c[_0x81fa('0x1e8')])<_0x2e9845[_0x81fa('0x1e9')]*0x3c){if(_0x19779c[_0x81fa('0x155')]&&!_0x19779c[_0x81fa('0x155')][_0x81fa('0x1ea')]){_0x4b3ba2['preview'][_0x81fa('0x104')](_0x19779c['id'])[_0x81fa('0xfd')](function(){_0x4b3ba2['updateOriginated'](_0x2e9845);});}else{hopperUtils[_0x81fa('0x1eb')]({'active':![]},_0x19779c['id'],0x1)['finally'](function(){_0x4b3ba2[_0x81fa('0xcd')](_0x2e9845);});}}else{_0x2e9845[_0x81fa('0x1ec')]+=0x1;_0x4b3ba2['updateOriginated'](_0x2e9845);if(_0x2e9845[_0x81fa('0x1ed')]){hopperUtils[_0x81fa('0xdc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x19779c[_0x81fa('0xdf')],'ListId':_0x19779c['ListId'],'VoiceQueueId':_0x19779c[_0x81fa('0xee')]||undefined,'CampaignId':_0x19779c[_0x81fa('0xe1')]||undefined})['catch'](loggerCatch(_0x81fa('0x1ee')));hopperUtils['createHistory'](createObjHistory(_0x2e9845,_0x19779c,utils[_0x81fa('0x6a')][_0x81fa('0x1ef')],0x17,_0x81fa('0x1f0')))[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x1f1')));}else{_0x4b3ba2[_0x81fa('0x118')](createObjHistory(_0x2e9845,_0x19779c,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,_0x81fa('0x1f2')),'[Originate][HistoryRecallClose][historyCatch]',_0x81fa('0x1f3'));}}}}else{_0x2e9845[_0x81fa('0x1f4')]+=0x1;_0x4b3ba2[_0x81fa('0x118')](createObjHistory(_0x2e9845,_0x19779c,utils['CAMPAIGN_STATUS'][_0x81fa('0x1f5')],0xd,_0x81fa('0x1f6')),'[Originate][historyBlacklist]',_0x81fa('0x1f7'));throw _0x81fa('0x1f8');}};};Dialer[_0x81fa('0x15')]['handleIvr']=function(_0x275356){var _0x4f1d43=this;var _0x36ea42=_0x275356[_0x81fa('0x1f9')]-_0x275356[_0x81fa('0x7e')]-_0x275356[_0x81fa('0x1fa')];emitCampaignSummary(_0x275356);if(_0x36ea42>0x0){if(_0x36ea42>this[_0x81fa('0x1d')]){_0x36ea42=this['maxNumberOriginate'];}_0x275356[_0x81fa('0x1fa')]+=_0x36ea42;hopperUtils[_0x81fa('0x1fb')](_0x275356['id'],_0x36ea42,_0x275356['dialOrderByScheduledAt'],_0x275356)[_0x81fa('0x40')](function(_0x160ced){_0x275356[_0x81fa('0x1fa')]-=_0x36ea42;_0x275356[_0x81fa('0x1fa')]=_0x275356[_0x81fa('0x1fa')]>0x0?_0x275356['temp']:0x0;if(!utils['checkContactEmpty'](_0x160ced)){_0x275356[_0x81fa('0x69')]=utils[_0x81fa('0x6a')][_0x81fa('0x6d')];logger[_0x81fa('0x4a')](_0x81fa('0x1fc')+_0x275356[_0x81fa('0x47')]);}else{_0x275356[_0x81fa('0x7e')]+=_0x160ced[_0x81fa('0x96')];_0x275356['message']=utils[_0x81fa('0x6a')]['RUNNING'];for(var _0x36bead=0x0;_0x36bead<_0x160ced['length'];_0x36bead+=0x1){_0x275356[_0x81fa('0x1fd')]+=0x1;if(_['isNil'](_0x160ced[_0x36bead])||_[_0x81fa('0xf8')](_0x160ced[_0x36bead]['Contact'])||_[_0x81fa('0xf8')](_0x160ced[_0x36bead]['phone'])){_0x4f1d43[_0x81fa('0x151')](_0x81fa('0x1fe'),_0x275356,_0x160ced[_0x36bead]);}else{hopperUtils[_0x81fa('0x1ff')](_[_0x81fa('0x75')](_0x160ced[_0x36bead],[_0x81fa('0xe1'),_0x81fa('0x158')]))[_0x81fa('0x40')](_0x4f1d43[_0x81fa('0x1e0')](_0x275356,_0x160ced[_0x36bead]))[_0x81fa('0xa0')](_0x4f1d43[_0x81fa('0x150')](_0x81fa('0x200'),_0x275356));}}}})[_0x81fa('0xa0')](loggerGetContactDialer('[getContactCampaign2]',_0x275356,_0x36ea42));}};Dialer[_0x81fa('0x15')][_0x81fa('0xb2')]=function(_0x117a63,_0x2b363e){var _0x63db0d=this;var _0x3053a2=[];if(_0x2b363e<0x1||_0x117a63[_0x81fa('0xaf')]==='booked'){_0x2b363e=0x1;}var _0x468bec=Math['floor'](_0x117a63[_0x81fa('0x134')]*_0x2b363e)-_0x117a63[_0x81fa('0x7e')]-_0x117a63['temp'];if(_0x117a63[_0x81fa('0x201')]>0x0){var _0x2ce8ca=_0x117a63[_0x81fa('0x201')]-_0x117a63[_0x81fa('0x7e')]-_0x117a63[_0x81fa('0x136')]-_0x117a63[_0x81fa('0x1fa')]-_0x117a63[_0x81fa('0x137')];if(_0x468bec>_0x2ce8ca){_0x468bec=_0x2ce8ca;}}if(_0x468bec>0x0){if(_0x117a63[_0x81fa('0xaf')]===_0x81fa('0xb1')){_0x468bec=0x1;}if(_0x468bec>this[_0x81fa('0x1d')]){_0x468bec=this[_0x81fa('0x1d')];}_0x117a63['temp']+=_0x468bec;for(var _0x1d51ca in this[_0x81fa('0x1b')]){if(typeof this[_0x81fa('0x1b')][_0x1d51ca]!=='undefined'){if(this['agents'][_0x1d51ca][_0x81fa('0x6f')]==='not_inuse'&&this[_0x81fa('0x1b')][_0x1d51ca][_0x81fa('0x86')]===_0x81fa('0x87')){_0x3053a2[_0x81fa('0x97')](this[_0x81fa('0x1b')][_0x1d51ca]['id']);}}}hopperUtils[_0x81fa('0x202')](_0x117a63,_0x3053a2,_0x468bec)['then'](function(_0x4e66b7){_0x117a63[_0x81fa('0x1fa')]-=_0x468bec;_0x117a63[_0x81fa('0x1fa')]=_0x117a63['temp']>0x0?_0x117a63[_0x81fa('0x1fa')]:0x0;if(!utils[_0x81fa('0x203')](_0x4e66b7)){hopperUtils[_0x81fa('0x204')](_0x117a63)[_0x81fa('0x40')](sendMessageReschedule(_0x117a63))[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x205')));}else{_0x117a63[_0x81fa('0x7e')]+=_0x4e66b7[_0x81fa('0x96')];_0x117a63['message']=_0x117a63[_0x81fa('0xaf')]===_0x81fa('0xb1')?utils[_0x81fa('0x6a')]['ACTIVE']:utils[_0x81fa('0x6a')][_0x81fa('0x206')];for(var _0x57a256=0x0;_0x57a256<_0x4e66b7['length'];_0x57a256+=0x1){if(_[_0x81fa('0xf8')](_0x4e66b7[_0x57a256])||_['isNil'](_0x4e66b7[_0x57a256][_0x81fa('0x16e')])||_[_0x81fa('0xf8')](_0x4e66b7[_0x57a256][_0x81fa('0x158')])){_0x63db0d['emptyContact'](_0x81fa('0x1fe'),_0x117a63,_0x4e66b7[_0x57a256]);}else{hopperUtils['checkIsBlackList'](_[_0x81fa('0x75')](_0x4e66b7[_0x57a256],['VoiceQueueId',_0x81fa('0x158')]))[_0x81fa('0x40')](_0x63db0d[_0x81fa('0x1e0')](_0x117a63,_0x4e66b7[_0x57a256]))[_0x81fa('0xa0')](_0x63db0d['loggerHandler'](_0x81fa('0x1fe'),_0x117a63));}}}})[_0x81fa('0xa0')](loggerGetContactDialer('[getContactDialer2]',_0x117a63,_0x468bec));}};Dialer[_0x81fa('0x15')][_0x81fa('0x62')]=function(_0x5b7e6f){if(_0x5b7e6f[_0x81fa('0x201')]>0x0){var _0xc61d86=_0x5b7e6f[_0x81fa('0x201')]-_0x5b7e6f['originated']-_0x5b7e6f['talking'];if(_0xc61d86>0x0){this[_0x81fa('0x207')](_0x5b7e6f);}else{loggerPredictiveCalls[_0x81fa('0x4a')]('[handlePredictive][limitChannel]');}}else{this[_0x81fa('0x207')](_0x5b7e6f);}};Dialer[_0x81fa('0x15')]['tryOriginatePredictive']=function(_0x517f35){var _0x3429b4=this;var _0x1360df=[];_0x517f35[_0x81fa('0x7e')]+=0x1;for(var _0x53cc82 in this[_0x81fa('0x1b')]){if(typeof this[_0x81fa('0x1b')][_0x53cc82]!==_0x81fa('0xa8')){if(this[_0x81fa('0x1b')][_0x53cc82]['state']==='not_inuse'&&this[_0x81fa('0x1b')][_0x53cc82][_0x81fa('0x86')]===_0x81fa('0x87')){_0x1360df[_0x81fa('0x97')](this[_0x81fa('0x1b')][_0x53cc82]['id']);}}}return this[_0x81fa('0x202')](_0x517f35['id'],_0x1360df,0x1,_0x517f35[_0x81fa('0x208')],_0x517f35)['then'](function(_0x314d85){if(!utils[_0x81fa('0x203')](_0x314d85)){utils[_0x81fa('0x66')](_0x517f35,0x1,0x0);return hopperUtils['countReScheduled'](_0x517f35)['then'](sendMessageReschedule(_0x517f35))[_0x81fa('0xa0')](loggerCatch(_0x81fa('0x205')));}else{_0x517f35[_0x81fa('0x69')]=utils[_0x81fa('0x6a')]['RUNNING'];if(_[_0x81fa('0xf8')](_0x314d85[0x0])||_[_0x81fa('0xf8')](_0x314d85[0x0][_0x81fa('0x16e')])||_[_0x81fa('0xf8')](_0x314d85[0x0][_0x81fa('0x158')])){_0x3429b4[_0x81fa('0x151')](_0x81fa('0x1fe'),_0x517f35,_0x314d85[0x0]);}else{return hopperUtils[_0x81fa('0x209')](_[_0x81fa('0x75')](_0x314d85[0x0],[_0x81fa('0xee'),_0x81fa('0x158')]))[_0x81fa('0x40')](_0x3429b4['checkContactBlack'](_0x517f35,_0x314d85[0x0]))[_0x81fa('0xa0')](_0x3429b4[_0x81fa('0x150')](_0x81fa('0x20a'),_0x517f35));}}})[_0x81fa('0xa0')](loggerGetContactDialer('[getContactDialerPredictive]',_0x517f35,0x1));};Dialer[_0x81fa('0x15')]['abandonmentRate']=function(_0x503aea,_0x5c0374,_0x4bfc9a,_0x564f77,_0x21f434,_0x35c1b7){loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x20b'));loggerPredictive[_0x81fa('0x4a')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x503aea);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x20c'),_0x5c0374);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',_0x4bfc9a);loggerPredictive[_0x81fa('0x4a')]('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',_0x564f77);loggerPredictive[_0x81fa('0x4a')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x21f434);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x53'));return new Promise(function(_0x5b350b,_0x1c6232){if(_0x503aea<=0x0||isNaN(_0x503aea)){return _0x1c6232(msgResponse('[abandonmentRate]',_0x81fa('0xbd'),_0x81fa('0x20d')+_0x503aea));}if(_0x4bfc9a<=0x0||isNaN(_0x4bfc9a)){return _0x1c6232(msgResponse(_0x81fa('0x20e'),_0x81fa('0xbd'),_0x81fa('0x20f')+_0x4bfc9a));}if(_0x564f77<=0x0||isNaN(_0x564f77)){return _0x1c6232(msgResponse(_0x81fa('0x20e'),_0x81fa('0xbd'),'p\x20=\x20'+_0x564f77));}if(_0x5c0374<=0x0||isNaN(_0x5c0374)){return _0x1c6232(msgResponse('[abandonmentRate]','Error','interval\x20=\x20'+_0x5c0374));}if(_0x21f434<=0x0||isNaN(_0x21f434)){return _0x1c6232(msgResponse('[abandonmentRate]',_0x81fa('0xbd'),_0x81fa('0x210')+_0x21f434));}_0x35c1b7=_0x35c1b7||0x0;var _0x148f5e=0x1/_0x4bfc9a;var _0x4236b8=0x0;var _0x13a573=0x0;var _0x543ba2=0x0;var _0x3f1860=0x0;for(var _0x2bcc69=0x0;_0x543ba2<_0x21f434;_0x2bcc69+=0x1){_0x13a573=_0x2bcc69/_0x5c0374;_0x4236b8=(_0x564f77*_0x13a573+_0x35c1b7)/_0x148f5e;_0x543ba2=utils[_0x81fa('0x211')](_0x4236b8,_0x503aea);_0x3f1860=_0x4236b8/_0x503aea*(0x1-utils[_0x81fa('0x211')](_0x4236b8,_0x503aea));}return _0x5b350b({'erlangCalls':_0x2bcc69,'erlangCallToSecond':_0x5c0374/_0x2bcc69,'erlangAbandonmentRate':_0x543ba2,'erlangBusyFactor':_0x3f1860});});};Dialer[_0x81fa('0x15')][_0x81fa('0x1d1')]=function(_0x8623b2,_0x109552,_0x245459,_0x3b00bc,_0x1e1eb8,_0x4e11fa){loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x212'));loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x213'),_0x8623b2);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x20c'),_0x109552);loggerPredictive[_0x81fa('0x4a')]('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',_0x245459);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x214'),_0x3b00bc);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x215'),_0x1e1eb8);loggerPredictive[_0x81fa('0x4a')](_0x81fa('0x53'));return new Promise(function(_0x1575e7,_0x420ec7){if(_0x8623b2<=0x0||isNaN(_0x8623b2)){return _0x420ec7(msgResponse(_0x81fa('0x216'),_0x81fa('0xbd'),_0x81fa('0x20d')+_0x8623b2));}if(_0x245459<=0x0||isNaN(_0x245459)){return _0x420ec7(msgResponse(_0x81fa('0x216'),_0x81fa('0xbd'),_0x81fa('0x20f')+_0x245459));}if(_0x3b00bc<=0x0||isNaN(_0x3b00bc)){return _0x420ec7(msgResponse(_0x81fa('0x216'),_0x81fa('0xbd'),_0x81fa('0x217')+_0x3b00bc));}if(_0x109552<=0x0||isNaN(_0x109552)){return _0x420ec7(msgResponse(_0x81fa('0x216'),_0x81fa('0xbd'),_0x81fa('0x218')+_0x109552));}if(_0x1e1eb8<=0x0||isNaN(_0x1e1eb8)){return _0x420ec7(msgResponse(_0x81fa('0x216'),_0x81fa('0xbd'),'Umin\x20=\x20'+_0x1e1eb8));}_0x4e11fa=_0x4e11fa||0x0;var _0x37d185=0x1/_0x245459;var _0x3f1c2f=0x0;var _0x10f81a=0x0;var _0x5da50a=0x0;var _0x10cb67=0x0;for(var _0x1805a0=0x0;_0x10cb67<_0x1e1eb8;_0x1805a0+=0x1){_0x10f81a=_0x1805a0/_0x109552;_0x3f1c2f=(_0x3b00bc*_0x10f81a+_0x4e11fa)/_0x37d185;_0x5da50a=utils[_0x81fa('0x211')](_0x3f1c2f,_0x8623b2);_0x10cb67=_0x3f1c2f/_0x8623b2*(0x1-utils[_0x81fa('0x211')](_0x3f1c2f,_0x8623b2));}return _0x1575e7({'erlangCalls':_0x1805a0,'erlangCallToSecond':_0x109552/_0x1805a0,'erlangAbandonmentRate':_0x5da50a,'erlangBusyFactor':_0x10cb67});});};module[_0x81fa('0x219')]=Dialer; \ No newline at end of file +var _0xa268=['dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','variables','trim','dialCutDigit','substring','SIP/%s/%s%s','dialPrefix','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialDropMaxRetry','[rescheduleContact][Abandoned]','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','reason','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','loggedIn','predictiveIntervalPauses','busyFactor','erlangCallToSecond','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','scheduledat','voicePause','preview','unlockContact','outboundReCallsDay','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','getContactDialer','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','erlangb','util','lodash','uuid','moment','ioredis','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','socket.io-emitter','redis','../rpc/cmHopper','../rpc/interval','./models/final','./models/hangup','env','XCALLY_IP_AGI','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','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','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','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaign','format','campaign:ivr:%s','sendMessageOneNotActive','originated','INACTIVE','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','ifTime','Failure','\x20Timezone\x20unknow\x20','length','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','push','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','syncCampaigns','undefined','isIVRCampaignActive','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Global:\x20','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','uniqueid','type','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','ivr','outboundAnswerCallsDay','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countglobal','dialDropRetryFrequency','voiceQueue','additional','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialAbandonedMaxRetry','Abandoned','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','pick','idHopper','strategy','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','run','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','amdstatus','exten','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','saveInDb','dialAMDActive','MACHINE','Machine','countmachineretry','emit','custom:amd','[syncAgentComplete][createHistory][0]','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countbusyretry','countcongestionretry','[rescheduleContact][Machine]','syncHangup','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','resolve','statusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','clearZombieChannels','[uniqueid]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','xcally-motion-dialer'];(function(_0x38224c,_0x1ff97b){var _0xba7c3d=function(_0x5c40e9){while(--_0x5c40e9){_0x38224c['push'](_0x38224c['shift']());}};_0xba7c3d(++_0x1ff97b);}(_0xa268,0xba));var _0x8a26=function(_0x59ae52,_0x3fc3e0){_0x59ae52=_0x59ae52-0x0;var _0x47daac=_0xa268[_0x59ae52];return _0x47daac;};'use strict';var util=require(_0x8a26('0x0'));var _=require(_0x8a26('0x1'));var uuid=require(_0x8a26('0x2'));var moment=require(_0x8a26('0x3'));var rr=require('rr');var Redis=require(_0x8a26('0x4'));var utils=require(_0x8a26('0x5'));var hopperUtils=require('./utils/hopper');var ut=require(_0x8a26('0x6'));var config=require(_0x8a26('0x7'));var logger=require(_0x8a26('0x8'))(_0x8a26('0x9'));var loggerBooked=require(_0x8a26('0x8'))(_0x8a26('0xa'));var loggerPredictive=require(_0x8a26('0x8'))(_0x8a26('0xb'));var loggerPredictiveCalls=require(_0x8a26('0x8'))(_0x8a26('0xc'));var loggerSyncQueueSummary=require(_0x8a26('0x8'))('syncQueueSummary');var ami=require(_0x8a26('0xd'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8a26('0xe'))(new Redis(config[_0x8a26('0xf')]));var cmHopper=require(_0x8a26('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Interval=require(_0x8a26('0x11'));var Action=require('./models/action');var History=require('./models/history');var Final=require(_0x8a26('0x12'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x8a26('0x13'));var ipAgi=process[_0x8a26('0x14')][_0x8a26('0x15')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x8a26('0x16')]['enqueue']=function(_0x2a2ae8){this[_0x8a26('0x17')]=this[_0x8a26('0x17')]?this[_0x8a26('0x17')][_0x8a26('0x18')](_0x2a2ae8):_0x2a2ae8();};function Dialer(_0xfa7cb2,_0x37f3a1){this[_0x8a26('0x19')]=new Sequence();this['preview']=_0x37f3a1;this[_0x8a26('0x1a')]=_0xfa7cb2['voiceQueues'];this[_0x8a26('0x1b')]=_0xfa7cb2[_0x8a26('0x1b')];this[_0x8a26('0x1c')]=_0xfa7cb2['agents'];this[_0x8a26('0x1d')]=_0xfa7cb2['trunks'];this['maxNumberOriginate']=config[_0x8a26('0x1e')]||0x2;this[_0x8a26('0x1f')]={};this[_0x8a26('0x20')]={};this['contactsId']={};this[_0x8a26('0x21')]={};this[_0x8a26('0x22')]={};this[_0x8a26('0x23')]={};this['startProgressive']={};this[_0x8a26('0x24')]={};this[_0x8a26('0x25')]={};this[_0x8a26('0x26')]={};this[_0x8a26('0x27')]={};ami['on'](_0x8a26('0x28'),this['syncAgentConnect'][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x2a'),this['syncQueueCallerAbandon'][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x2b'),this[_0x8a26('0x2c')]['bind'](this));ami['on'](_0x8a26('0x2d'),this[_0x8a26('0x2e')][_0x8a26('0x29')](this));ami['on']('custom:queuesummary',this[_0x8a26('0x2f')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x30'),this[_0x8a26('0x31')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x32'),this['syncHangup'][_0x8a26('0x29')](this));ami['on']('newexten',this[_0x8a26('0x33')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x34'),this[_0x8a26('0x35')][_0x8a26('0x29')](this));ami['on'](_0x8a26('0x36'),this[_0x8a26('0x37')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x8a26('0x38')]['bind'](this));this['loopCampaigns']();this[_0x8a26('0x39')]();RpcSetting['getSettings']()[_0x8a26('0x3a')](function(_0xf208f4){previewRecallmeReminderInterval=_0xf208f4[_0x8a26('0x3b')];});}function isNotNull(_0x5f33a3){return _0x5f33a3!==null&&!_[_0x8a26('0x3c')](_0x5f33a3);}function msgResponse(_0xc2426a,_0xad4894,_0x29091a){return{'action':_0xc2426a,'response':_0xad4894,'message':_0x29091a,'stack':_0x29091a};}function emit(_0x3a4d4d,_0x18f5a0,_0x3a9075){io['to'](_0x3a4d4d)['emit'](_0x18f5a0,_0x3a9075);}function emitOutboundVoiceQueueSummary(_0x5e081a){if(_0x5e081a['type']==='outbound'){logger[_0x8a26('0x3d')](_0x8a26('0x3e'),util[_0x8a26('0x3f')](_0x5e081a,{'showHidden':![],'depth':null}));emit(util['format'](_0x8a26('0x40'),_0x5e081a[_0x8a26('0x41')]),_0x8a26('0x42'),_0x5e081a);}}function checkGetDataPredictive(_0x2612e0){if(isNotNull(_0x2612e0)&&!_[_0x8a26('0x43')](_0x2612e0)){loggerPredictive['info'](_0x8a26('0x44'));loggerPredictive[_0x8a26('0x45')](_0x8a26('0x46'),_0x2612e0[_0x8a26('0x47')]);loggerPredictive[_0x8a26('0x45')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2612e0[_0x8a26('0x48')]);loggerPredictive[_0x8a26('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2612e0[_0x8a26('0x49')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4a'),_0x2612e0[_0x8a26('0x4b')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4c'),_0x2612e0[_0x8a26('0x4d')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2612e0[_0x8a26('0x4e')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4f'));if(_0x2612e0['predictiveIntervalTotalCalls']>0x0){if(!_[_0x8a26('0x3c')](_0x2612e0[_0x8a26('0x4e')])&&_0x2612e0['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x8a26('0x45')](_0x8a26('0x50'));if(!_['isUndefined'](_0x2612e0[_0x8a26('0x4d')])&&_0x2612e0[_0x8a26('0x4d')]>0x0){return!![];}loggerPredictive[_0x8a26('0x45')](_0x8a26('0x51'));}else{loggerPredictive[_0x8a26('0x45')](_0x8a26('0x52'));}}else{loggerPredictive[_0x8a26('0x45')](_0x8a26('0x53'));}return![];}function mergeDataErlangB(_0x4f765c){return function(_0x22a1f5){loggerPredictive[_0x8a26('0x45')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x8a26('0x45')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a1f5[_0x8a26('0x54')]);loggerPredictive[_0x8a26('0x45')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a1f5['erlangCallToSecond']);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x55'),_0x22a1f5[_0x8a26('0x56')]);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x57'),_0x22a1f5[_0x8a26('0x58')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a1f5['erlangAbandonmentRate']);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4f'));_[_0x8a26('0x59')](_0x4f765c,_0x22a1f5);};}function ifInterval(_0x3963cb,_0x4de069){if(_[_0x8a26('0x3c')](_0x4de069)){return![];}return utils[_0x8a26('0x5a')](undefined,_0x4de069)<_0x3963cb*0x3c;}function clearPredictiveAttributes(_0x4f3d2b){if(_0x4f3d2b[_0x8a26('0x5b')]){_0x4f3d2b[_0x8a26('0x5b')]=undefined;loggerPredictive[_0x8a26('0x3d')](_0x4f3d2b['name'],_0x8a26('0x5c'));}if(_0x4f3d2b[_0x8a26('0x23')]){_0x4f3d2b[_0x8a26('0x23')]=undefined;loggerPredictive[_0x8a26('0x3d')](_0x4f3d2b[_0x8a26('0x41')],'startPredictive\x20value\x20cleared');}if(_0x4f3d2b[_0x8a26('0x5d')]){clearInterval(_0x4f3d2b[_0x8a26('0x5d')]);_0x4f3d2b[_0x8a26('0x5d')]=undefined;loggerPredictive[_0x8a26('0x3d')](_0x4f3d2b[_0x8a26('0x41')],_0x8a26('0x5e'));}}function loggerCatchPredictive(_0xa57ba9,_0xa76319){return function(_0x29253c){loggerPredictive[_0x8a26('0x5f')](_0xa76319[_0x8a26('0x41')],_0xa57ba9);loggerPredictive[_0x8a26('0x5f')](_0x29253c[_0x8a26('0x60')]);clearPredictiveAttributes(_0xa76319);};}function loggerCatch(_0x430753){return function(_0x343715){logger[_0x8a26('0x5f')](_0x430753,util['inspect'](_0x343715,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x555c0f,_0x2c660f,_0x571cbf){return function(_0x45f5f0){utils[_0x8a26('0x61')](_0x2c660f,_0x571cbf,0x0);logger['error'](_0x555c0f,util[_0x8a26('0x3f')](_0x45f5f0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1234c8){return function(_0x16da99){if(isNotNull(_0x16da99)&&isNotNull(_0x16da99[0x0])){if(_0x16da99[0x0][_0x8a26('0x62')]>0x0){_0x1234c8['message']=utils[_0x8a26('0x63')][_0x8a26('0x64')];logger[_0x8a26('0x45')]('[getContactDialer2][ReScheduled]'+_0x1234c8[_0x8a26('0x41')],_0x16da99[0x0][_0x8a26('0x62')],_0x8a26('0x65'));}else{_0x1234c8[_0x8a26('0x66')]=utils['CAMPAIGN_STATUS'][_0x8a26('0x67')];logger[_0x8a26('0x45')](_0x8a26('0x68')+_0x1234c8[_0x8a26('0x41')]);}}};}function createObjHistory(_0x2a14f2,_0x1145c0,_0x30b235,_0x2240f5,_0x57e20e){_0x2a14f2[_0x8a26('0x66')]=_0x30b235;var _0x17a837=new Action(_0x2a14f2,_0x1145c0);var _0x103ab3=new History(_0x17a837);_0x103ab3[_0x8a26('0x69')]=_0x2240f5;_0x103ab3['statedesc']=_0x57e20e;_0x103ab3[_0x8a26('0x6a')]=_0x17a837[_0x8a26('0x6b')];return _0x103ab3;}function unlockQueueStatus(_0x13626c,_0x9cdbf8){setTimeout(function(){if(_[_0x8a26('0x3c')](_0x13626c[_0x8a26('0x6c')])){loggerBooked['error'](_0x8a26('0x6d'),_0x9cdbf8);}_0x13626c[_0x8a26('0x6c')]=!![];loggerBooked[_0x8a26('0x45')](_0x8a26('0x6e'),_0x9cdbf8,JSON[_0x8a26('0x6f')](_['pick'](_0x13626c,[_0x8a26('0x41'),_0x8a26('0x6c')])));},0x1f3);}function checkInterval(_0x4b5ce3){return function(){if(!isNotNull(_0x4b5ce3[_0x8a26('0x70')])){_0x4b5ce3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];throw _0x4b5ce3[_0x8a26('0x41')]+_0x8a26('0x72');}if(!isNotNull(_0x4b5ce3['Interval'][_0x8a26('0x73')])){_0x4b5ce3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];throw _0x4b5ce3[_0x8a26('0x41')]+_0x8a26('0x72');}if(!isNotNull(_[_0x8a26('0x43')](_0x4b5ce3[_0x8a26('0x70')]['Intervals']))){_0x4b5ce3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];throw _0x4b5ce3[_0x8a26('0x41')]+_0x8a26('0x72');}};}function checkIsIVRCampaignActive(_0x23871a){return function(){if(!utils['isIVRCampaignActive'](_0x23871a)){_0x23871a[_0x8a26('0x66')]=utils[_0x8a26('0x63')]['INACTIVE'];throw _0x23871a['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x275176){if(utils[_0x8a26('0x74')](_0x275176)){emit(util[_0x8a26('0x75')](_0x8a26('0x76'),_0x275176['name']),'campaign:save',_0x275176);}}function loggerCatchQueueSummary(_0x58d5b2,_0x3168c0){return function(_0x5c1715){clearPredictiveAttributes(_0x3168c0);emitCampaignSummary(_0x3168c0);loggerSyncQueueSummary[_0x8a26('0x3d')](_0x58d5b2,util['inspect'](_0x5c1715,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0xdb669b){if(_0xdb669b[_0x8a26('0x77')]){if(_0xdb669b[_0x8a26('0x78')]===0x0){_0xdb669b['sendMessageOneNotActive']=![];_0xdb669b['message']=utils['CAMPAIGN_STATUS'][_0x8a26('0x79')];loggerSyncQueueSummary[_0x8a26('0x3d')](_0x8a26('0x7a'),_0xdb669b['name'],'is\x20not\x20active');}else{_0xdb669b['message']=utils['CAMPAIGN_STATUS']['DISACTIVED'];loggerSyncQueueSummary[_0x8a26('0x3d')](_0x8a26('0x7a'),_0xdb669b['name'],_0x8a26('0x7b'));}emitCampaignSummary(_0xdb669b);}}function myreject(_0x4cb408){return function(_0x5252e7){return _0x4cb408(msgResponse(_0x8a26('0x7c'),_0x8a26('0x7d'),JSON['stringify'](_0x5252e7)));};}Dialer[_0x8a26('0x16')][_0x8a26('0x7e')]=function(_0x447e49){return!_[_0x8a26('0x3c')](_0x447e49)&&_0x447e49&&!_[_0x8a26('0x3c')](_0x447e49[_0x8a26('0x41')])&&!_[_0x8a26('0x3c')](_0x447e49[_0x8a26('0x7f')])&&_0x447e49[_0x8a26('0x7f')]&&(this[_0x8a26('0x1d')][util['format'](_0x8a26('0x80'),_0x447e49[_0x8a26('0x41')])][_0x8a26('0x81')]===_0x8a26('0x82')||this[_0x8a26('0x1d')][util[_0x8a26('0x75')](_0x8a26('0x80'),_0x447e49['name'])][_0x8a26('0x81')]===_0x8a26('0x83'));};Dialer[_0x8a26('0x16')][_0x8a26('0x84')]=function(_0xd22ea3){var _0xa24ed9=this;return function(){if(!_0xa24ed9['isTrunkReachable'](_0xd22ea3[_0x8a26('0x85')])){if(!_0xa24ed9['isTrunkReachable'](_0xd22ea3[_0x8a26('0x86')])){_0xd22ea3[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x87')];throw _0xd22ea3[_0x8a26('0x41')]+_0x8a26('0x88');}}};};Dialer[_0x8a26('0x16')][_0x8a26('0x89')]=function(_0x3443ee,_0x231802,_0x2a2391,_0x23f6d8){var _0xcc3d57=this;return function(){var _0x1dff1d=!![];return _0xcc3d57[_0x8a26('0x8a')](_0x3443ee,_0x231802,_0x2a2391,_0x23f6d8,_0x1dff1d);};};Dialer[_0x8a26('0x16')]['checkIfTimeIntervals']=function(_0x2f95b4,_0x1c56a0,_0x2d34ec,_0x288c04){var _0x400e16=this;return function(){var _0xf68247=![];return _0x400e16[_0x8a26('0x8a')](_0x2f95b4[_0x8a26('0x73')],_0x1c56a0,_0x2d34ec,_0x288c04,_0xf68247);};};Dialer[_0x8a26('0x16')][_0x8a26('0x8a')]=function(_0x22f611,_0x3095e8,_0x15c599,_0x5b91bc,_0x19d636){var _0x79eb23=[];return new Promise(function(_0x28044f,_0x1ad1b2){if(!isNotNull(_0x22f611)){_0x5b91bc[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x71')];return _0x1ad1b2(msgResponse('ifTime','Failure',_0x15c599+_0x8a26('0x8b')));}if(_[_0x8a26('0x43')](_0x22f611)){_0x5b91bc['message']=utils[_0x8a26('0x63')][_0x8a26('0x8c')];return _0x1ad1b2(msgResponse('ifTime','Failure',_0x15c599+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3095e8&&_[_0x8a26('0x3c')](config[_0x8a26('0x8d')][_0x3095e8])){_0x5b91bc['message']=utils[_0x8a26('0x63')][_0x8a26('0x8e')];return _0x1ad1b2(msgResponse(_0x8a26('0x8f'),_0x8a26('0x90'),_0x15c599+_0x8a26('0x91')+_0x3095e8));}if(_['isArray'](_0x22f611)){for(var _0x2fd6f0=0x0;_0x2fd6f0<_0x22f611[_0x8a26('0x92')];_0x2fd6f0+=0x1){_0x79eb23['push'](ami[_0x8a26('0x93')]({'action':_0x8a26('0x94'),'command':util[_0x8a26('0x75')](_0x8a26('0x95'),_0x22f611[_0x2fd6f0][_0x8a26('0x96')],!_[_0x8a26('0x3c')](config['timezones'][_0x3095e8])?_0x3095e8:'')})[_0x8a26('0x3a')](function(_0x3c73ca){return _0x3c73ca[_0x8a26('0x97')][_0x8a26('0x98')](_0x8a26('0x99'))>=0x0;})[_0x8a26('0x9a')](myreject(_0x1ad1b2)));}}else{_0x79eb23[_0x8a26('0x9b')](ami[_0x8a26('0x93')]({'action':_0x8a26('0x94'),'command':util[_0x8a26('0x75')]('iftime\x20%s,%s',_0x22f611,!_[_0x8a26('0x3c')](config[_0x8a26('0x8d')][_0x3095e8])?_0x3095e8:'')})[_0x8a26('0x3a')](function(_0x5085ad){return _0x5085ad[_0x8a26('0x97')]['indexOf']('true')>=0x0;})[_0x8a26('0x9a')](myreject(_0x1ad1b2)));}Promise[_0x8a26('0x9c')](_0x79eb23)[_0x8a26('0x3a')](function(_0x26a343){var _0x449d44=_[_0x8a26('0x9d')](_0x26a343);if(_0x449d44){return _0x28044f(_0x449d44);}else{_0x5b91bc['message']=_0x19d636?utils[_0x8a26('0x63')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x8a26('0x63')][_0x8a26('0x9e')];return _0x1ad1b2(msgResponse(_0x8a26('0x9f'),_0x8a26('0x90'),'Global:\x20'+_0x19d636+'\x20'+_0x15c599+_0x8a26('0xa0')+util['inspect'](_0x22f611,{'showHidden':![],'depth':null})+_0x8a26('0xa1')+_0x3095e8));}})[_0x8a26('0x9a')](function(_0x3caddb){return _0x1ad1b2(msgResponse(_0x8a26('0x8f'),'Failure',JSON[_0x8a26('0x6f')](_0x3caddb)));});});};Dialer['prototype'][_0x8a26('0xa2')]=function(){var _0x31ddcd=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x8a26('0x3a')](function(){setInterval(function(){_0x31ddcd[_0x8a26('0xa3')]();},0x3e8);});};Dialer[_0x8a26('0x16')][_0x8a26('0xa3')]=function(){var _0x538cb0=this;var _0xb52674;for(var _0xccb9bc in this[_0x8a26('0x1b')]){if(typeof this['campaigns'][_0xccb9bc]!==_0x8a26('0xa4')){_0xb52674=this['campaigns'][_0xccb9bc];if(utils['isIVRCampaign'](_0xb52674)&&utils[_0x8a26('0xa5')](_0xb52674)){_0xb52674['sendMessageOneNotActive']=!![];Promise['resolve']()[_0x8a26('0x3a')](checkIsIVRCampaignActive(_0xb52674))[_0x8a26('0x3a')](checkInterval(_0xb52674))['then'](_0x538cb0['checkIsTrunkReachable'](_0xb52674))[_0x8a26('0x3a')](_0x538cb0[_0x8a26('0x89')](_0xb52674[_0x8a26('0xa6')],_0xb52674[_0x8a26('0xa7')],_0xb52674[_0x8a26('0x41')],_0xb52674))[_0x8a26('0x3a')](_0x538cb0[_0x8a26('0xa8')](_0xb52674[_0x8a26('0x70')],_0xb52674[_0x8a26('0xa7')],_0xb52674[_0x8a26('0x41')],_0xb52674))[_0x8a26('0x3a')](_0x538cb0[_0x8a26('0xa9')](_0xb52674))[_0x8a26('0x9a')](loggerCatchQueueSummary('[syncCampaigns]',_0xb52674));}else{notSendMessagesCampaign(_0xb52674);}}}};Dialer['prototype'][_0x8a26('0xaa')]=function(_0x2464ec){if(_0x2464ec['dialMethod']!==_0x8a26('0xb')){clearPredictiveAttributes(_0x2464ec);}switch(_0x2464ec[_0x8a26('0xab')]){case'progressive':this[_0x8a26('0xac')](_0x2464ec,0x1);break;case _0x8a26('0xad'):this['handlePower'](_0x2464ec,_0x2464ec[_0x8a26('0xae')]);break;case _0x8a26('0xb'):this['predictive'](_0x2464ec);break;case _0x8a26('0xa'):this[_0x8a26('0xac')](_0x2464ec,0x1);break;default:logger['error']('Queue',_0x2464ec[_0x8a26('0x41')],_0x8a26('0xaf'));}};Dialer[_0x8a26('0x16')][_0x8a26('0x8f')]=function(_0x2687ec,_0x373472){var _0x2d9d30=_0x2687ec[_0x8a26('0xa7')];var _0x212f76=_0x373472?_0x2687ec[_0x8a26('0xa6')]:_0x2687ec['Interval']['Intervals'];logger[_0x8a26('0xb0')]('Dialer::ifTime()',_0x212f76,_0x2d9d30,_0x2687ec[_0x8a26('0x41')],util[_0x8a26('0x75')](_0x8a26('0xb1'),_0x2687ec[_0x8a26('0x41')],_0x2687ec['id']));var _0x22c2fc=null;return Interval[_0x8a26('0xb2')](_0x212f76,_0x2d9d30)[_0x8a26('0x3a')](function(_0x5a1859){if(_0x5a1859===!![]){return _0x5a1859;}else{_0x2687ec[_0x8a26('0x66')]=_0x373472?utils[_0x8a26('0x63')][_0x8a26('0xb3')]:utils[_0x8a26('0x63')][_0x8a26('0x9e')];_0x22c2fc=msgResponse(_0x8a26('0x9f'),_0x8a26('0x90'),_0x8a26('0xb4')+_0x373472+'\x20'+_0x2687ec['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x8a26('0x3f')](_0x212f76,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2d9d30);}if(_0x22c2fc!==null){logger[_0x8a26('0xb0')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x22c2fc);_0x22c2fc[_0x8a26('0xb5')]=_0x373472;throw _0x22c2fc;}})[_0x8a26('0x9a')](function(_0x278e1e){logger['error'](_0x8a26('0xb6'),_0x278e1e);throw msgResponse(_0x8a26('0x7c'),_0x8a26('0x7d'),util[_0x8a26('0x3f')](_0x278e1e,{'showHidden':![],'depth':null}));});};Dialer[_0x8a26('0x16')][_0x8a26('0xb7')]=function(_0x20c134){if(this[_0x8a26('0x1a')][_0x20c134[_0x8a26('0xb8')]]){if(this[_0x8a26('0x21')][_0x20c134[_0x8a26('0xb9')]]&&this[_0x8a26('0x21')][_0x20c134['uniqueid']][_0x8a26('0xba')]!=='ivr'){this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x20c134[_0x8a26('0xb8')]]);this['uniqueId'][_0x20c134[_0x8a26('0xb9')]][_0x8a26('0xbc')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));}}};Dialer[_0x8a26('0x16')][_0x8a26('0x2e')]=function(_0x2a030e){var _0x308041=this[_0x8a26('0x21')][_0x2a030e['uniqueid']];if(this[_0x8a26('0x1a')][_0x2a030e[_0x8a26('0xb8')]]){if(_0x308041&&_0x308041['type']!==_0x8a26('0xbe')){delete this[_0x8a26('0x21')][_0x2a030e[_0x8a26('0xb9')]];this[_0x8a26('0x1a')][_0x2a030e[_0x8a26('0xb8')]][_0x8a26('0xbf')]+=0x1;var _0x536db9=new AgentComplete(_0x308041,_0x2a030e);if(_0x2a030e['reason']==='agent'){_0x536db9[_0x8a26('0xc0')]=this['voiceQueues'][_0x2a030e[_0x8a26('0xb8')]][_0x8a26('0xc1')]&&this[_0x8a26('0x1a')][_0x2a030e[_0x8a26('0xb8')]][_0x8a26('0xc2')]?moment()[_0x8a26('0x75')](_0x8a26('0xbd')):undefined;}hopperUtils[_0x8a26('0xc3')](_0x536db9)['catch'](loggerCatch(_0x8a26('0xc4')));hopperUtils[_0x8a26('0xc5')](_0x536db9)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0xc6')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x2bc9a3){var _0x4096e3=this[_0x8a26('0x21')][_0x2bc9a3[_0x8a26('0xb9')]];var _0x591158=this;var _0x46e887=![];var _0x15c29f;var _0x5281b0;if(this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]){if(_0x4096e3&&_0x4096e3[_0x8a26('0xba')]!==_0x8a26('0xbe')){delete this[_0x8a26('0x21')][_0x2bc9a3[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]);_0x4096e3[_0x8a26('0xc7')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));var _0x123cb2=new QueueCallerAbandon(_0x4096e3,_0x2bc9a3);if(utils[_0x8a26('0x5a')](_0x4096e3[_0x8a26('0xc7')],_0x4096e3[_0x8a26('0xc8')])>=_0x4096e3[_0x8a26('0xc9')]){this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0x49')]+=0x1;this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xca')]+=0x1;this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xcb')]+=0x1;_0x123cb2[_0x8a26('0x69')]=0xa;_0x123cb2[_0x8a26('0xcc')]=_0x8a26('0xcd');_0x123cb2[_0x8a26('0xce')]=_0x8a26('0xcf');_0x123cb2[_0x8a26('0xc0')]=this['voiceQueues'][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xc1')]?moment()[_0x8a26('0x75')](_0x8a26('0xbd')):undefined;_0x123cb2['countdropretry']+=0x1;_0x123cb2[_0x8a26('0xd0')]+=0x1;_0x15c29f=this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xd1')];_0x5281b0=this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0x123cb2,_0x123cb2[_0x8a26('0x69')],_0x4096e3[_0x8a26('0xd2')])['then'](function(_0x13a08d){_0x46e887=_0x13a08d[_0x8a26('0xd3')]==0x1;if(_0x123cb2['countdropretry']>=_0x591158[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]]['dialDropMaxRetry']){_0x591158[_0x8a26('0xd4')](_0x123cb2,_0x13a08d[_0x8a26('0xd3')]);}else{hopperUtils[_0x8a26('0xd5')]({'active':![],'countdropretry':_0x123cb2['countdropretry'],'scheduledat':moment()[_0x8a26('0xd6')](_0x591158['voiceQueues'][_0x2bc9a3['queue']][_0x8a26('0xd1')],_0x8a26('0xd7'))['format'](_0x8a26('0xbd')),'ContactId':_0x4096e3[_0x8a26('0xd8')],'ListId':_0x4096e3[_0x8a26('0xd9')],'VoiceQueueId':_0x4096e3[_0x8a26('0xda')]||undefined,'CampaignId':_0x4096e3[_0x8a26('0xdb')]||undefined})['catch'](loggerCatch(_0x8a26('0xdc')));var _0x4d7097=new History(_0x123cb2);_0x4d7097[_0x8a26('0x69')]=0xa;_0x4d7097['statedesc']='Drop';_0x4d7097[_0x8a26('0x6b')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));_0x4d7097['endtime']=_0x4d7097[_0x8a26('0x6b')];_0x4d7097[_0x8a26('0xdd')]=_0x123cb2[_0x8a26('0xdd')];_0x4d7097[_0x8a26('0xde')]=_0x123cb2['calleridnum'];hopperUtils[_0x8a26('0xc3')](_0x4d7097)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0xdf')));}})[_0x8a26('0x3a')](function(){if(_0x46e887)hopperUtils[_0x8a26('0xe0')](_0x123cb2,_0x15c29f,_0x5281b0)[_0x8a26('0x3a')](function(){return 0x1;});});}else{this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0x4b')]+=0x1;this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe1')]+=0x1;_0x123cb2[_0x8a26('0x69')]=0xb;_0x123cb2[_0x8a26('0xcc')]='Abandoned';_0x123cb2[_0x8a26('0xce')]=_0x8a26('0xe2');_0x123cb2[_0x8a26('0xe3')]+=0x1;_0x123cb2[_0x8a26('0xd0')]+=0x1;_0x15c29f=this[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe4')];_0x5281b0=this['voiceQueues'][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe5')];hopperUtils[_0x8a26('0xe6')](_0x123cb2,_0x123cb2['state'],_0x4096e3['voiceQueue'])[_0x8a26('0x3a')](function(_0x3f60fc){if(_0x123cb2['countabandonedretry']>=_0x591158[_0x8a26('0x1a')][_0x2bc9a3[_0x8a26('0xb8')]][_0x8a26('0xe7')]){_0x591158['queueCallerAbandonCreateState'](_0x123cb2,_0x3f60fc[_0x8a26('0xd3')]);}else{hopperUtils[_0x8a26('0xd5')]({'active':![],'countabandonedretry':_0x123cb2[_0x8a26('0xe3')],'scheduledat':moment()[_0x8a26('0xd6')](_0x591158[_0x8a26('0x1a')][_0x2bc9a3['queue']][_0x8a26('0xe4')],'minutes')[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x4096e3[_0x8a26('0xd8')],'ListId':_0x4096e3['ListId'],'VoiceQueueId':_0x4096e3['VoiceQueueId']||undefined,'CampaignId':_0x4096e3[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x329caf=new History(_0x123cb2);_0x329caf[_0x8a26('0x69')]=0xb;_0x329caf[_0x8a26('0xcc')]=_0x8a26('0xe8');_0x329caf[_0x8a26('0x6b')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));_0x329caf[_0x8a26('0x6a')]=_0x329caf[_0x8a26('0x6b')];_0x329caf[_0x8a26('0xdd')]=_0x123cb2[_0x8a26('0xdd')];_0x329caf['calleridnum']=_0x123cb2[_0x8a26('0xde')];hopperUtils[_0x8a26('0xc3')](_0x329caf)[_0x8a26('0x9a')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x8a26('0x3a')](function(){if(_0x46e887)hopperUtils[_0x8a26('0xe0')](_0x123cb2,_0x15c29f,_0x5281b0)['then'](function(){return 0x1;});});}}}};Dialer[_0x8a26('0x16')]['syncNewExten']=function(_0x16a2c0){if(this[_0x8a26('0x20')][_0x16a2c0[_0x8a26('0xb9')]]){this[_0x8a26('0x20')][_0x16a2c0[_0x8a26('0xb9')]][_0x8a26('0xe9')]=_0x16a2c0[_0x8a26('0xe9')];}if(this[_0x8a26('0x21')][_0x16a2c0['uniqueid']]){this['uniqueId'][_0x16a2c0[_0x8a26('0xb9')]][_0x8a26('0xe9')]=_0x16a2c0[_0x8a26('0xe9')];}};Dialer[_0x8a26('0x16')][_0x8a26('0x37')]=function(_0x5eee40){if(!this['actions'][_0x5eee40[_0x8a26('0xea')]]){return;}var _0x44aa27=this[_0x8a26('0x1a')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xb8')]]['strategy']||_0x8a26('0xeb');if(_0x44aa27===_0x8a26('0xec')){if(this['actions'][_0x5eee40[_0x8a26('0xea')]]&&_[_0x8a26('0xed')](this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xee')])&&_0x5eee40[_0x8a26('0x81')]==='1'&&_0x5eee40[_0x8a26('0xef')]==='0'){if(this[_0x8a26('0x1c')][_0x5eee40[_0x8a26('0xf0')]]){if(!this[_0x8a26('0x1c')][_0x5eee40[_0x8a26('0xf0')]][_0x8a26('0xee')]){this['agents'][_0x5eee40['stateinterface']]['locked']=!![];this[_0x8a26('0x20')][_0x5eee40['actionid']][_0x8a26('0xee')]=!![];this[_0x8a26('0x20')][_0x5eee40['actionid']][_0x8a26('0xf0')]=_0x5eee40['stateinterface'];}}}}else if(_0x44aa27==='rrmemory'){if(this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]]){if(this[_0x8a26('0x1c')][_0x5eee40['stateinterface']]){this[_0x8a26('0x20')][_0x5eee40['actionid']][_0x8a26('0xf0')]=_0x5eee40[_0x8a26('0xf0')];if(_[_0x8a26('0xed')](this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]]['queue']])){this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xb8')]]=[];}this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]][_0x8a26('0xb8')]][_0x8a26('0x9b')](_[_0x8a26('0x59')](_[_0x8a26('0xf1')](this[_0x8a26('0x20')][_0x5eee40[_0x8a26('0xea')]],[_0x8a26('0xf2'),_0x8a26('0xf0')]),{'status':_0x5eee40[_0x8a26('0x81')],'paused':_0x5eee40[_0x8a26('0xef')]}));}}}};Dialer[_0x8a26('0x16')][_0x8a26('0x38')]=function(_0x30f7a2){if(!this[_0x8a26('0x20')][_0x30f7a2['actionid']]){return;}var _0x1b87ab=this;var _0x1734af=this['voiceQueues'][this[_0x8a26('0x20')][_0x30f7a2['actionid']][_0x8a26('0xb8')]];var _0x46a231=_0x1734af[_0x8a26('0xf3')]||_0x8a26('0xeb');if(_0x46a231===_0x8a26('0xec')){if(this[_0x8a26('0x20')][_0x30f7a2['actionid']]&&this[_0x8a26('0x20')][_0x30f7a2['actionid']]['stateinterface']){this['preview']['run'](this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['idHopper'],this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xf0')])[_0x8a26('0x9a')](function(_0x2ee8c4){logger[_0x8a26('0x5f')](_0x8a26('0xf4'),util['inspect'](_0x2ee8c4,{'showHidden':![],'depth':null}));})[_0x8a26('0x18')](function(){_0x1b87ab[_0x8a26('0xbb')](_0x1b87ab['voiceQueues'][_0x1b87ab['actions'][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]);_0x1b87ab['agents'][_0x1b87ab[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xf0')]][_0x8a26('0xee')]=![];delete _0x1b87ab[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]];unlockQueueStatus(_0x1734af);});}else{this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]);hopperUtils[_0x8a26('0xd5')]({'active':![],'ContactId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['ContactId'],'ListId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xd9')],'VoiceQueueId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xda')]||undefined,'CampaignId':this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]];unlockQueueStatus(_0x1734af);}}else if(_0x46a231==='rrmemory'){var _0x43e812;if(this['actions'][_0x30f7a2[_0x8a26('0xea')]]&&!_['isEmpty'](this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x30f7a2['actionid']][_0x8a26('0xb8')]])){if(this[_0x8a26('0x26')][_0x1b87ab['actions'][_0x30f7a2['actionid']][_0x8a26('0xb8')]]){this['queueBookedRR'][_0x1b87ab[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['queue']]=this['queueBookedRR'][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]?this[_0x8a26('0x26')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['queue']]:this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]]?this[_0x8a26('0x25')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]]['queue']][_0x8a26('0xf5')]||0x0:0x0;}this['queueBooked'][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]][_0x8a26('0xf5')]=this[_0x8a26('0x26')][this[_0x8a26('0x20')][_0x30f7a2[_0x8a26('0xea')]][_0x8a26('0xb8')]];for(var _0x87b325=0x0;_0x87b325=_0x592fa2[_0x8a26('0x11b')]){_0x2b6c21[_0x8a26('0x11c')](_0x3ac77f,_0x5a1966,_0x14c684,_0x8a26('0x11d'));}else{if(_0x3ac77f[_0x8a26('0x113')]>=_0x592fa2[_0x8a26('0x11e')]){_0x2b6c21[_0x8a26('0x11f')](_0x3ac77f,_0x5a1966,_0x14c684,_0x8a26('0x120'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3ac77f[_0x8a26('0x113')],'scheduledat':moment()[_0x8a26('0xd6')](_0x592fa2[_0x8a26('0x121')],_0x8a26('0xd7'))[_0x8a26('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ac77f[_0x8a26('0xd8')],'ListId':_0x3ac77f['ListId'],'VoiceQueueId':_0x3ac77f[_0x8a26('0xda')]||undefined,'CampaignId':_0x3ac77f[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Machine]'));_0x5a1966({'reschedule':0x1});}}});}if(_0x58039f[_0x8a26('0xba')]===_0x8a26('0xbe')&&this[_0x8a26('0x1b')][_0x58039f['queue']][_0x8a26('0x110')]&&_0x467d3c['value']===_0x8a26('0x108')){delete this[_0x8a26('0x21')][_0x467d3c[_0x8a26('0xb9')]];this['updateOriginated'](this[_0x8a26('0x1b')][_0x58039f[_0x8a26('0xb8')]]);_0x5a5e05=new Hangup(_0x58039f,_0x467d3c);_0x5a5e05[_0x8a26('0x69')]=0x12;_0x5a5e05['statedesc']=_0x8a26('0x10a');_0x5a5e05['membername']=_0x8a26('0x10c');ami[_0x8a26('0x114')](_0x8a26('0x115'),ut[_0x8a26('0x10d')](_0x5a5e05,_0x8a26('0x10e')));this['saveInDb'](_0x5a5e05,_0x8a26('0x122'),_0x8a26('0x123'));}if(_0x58039f[_0x8a26('0xba')]===_0x8a26('0xbe')&&this['campaigns'][_0x58039f[_0x8a26('0xb8')]][_0x8a26('0x110')]&&_0x467d3c[_0x8a26('0x107')]===_0x8a26('0x111')){return new Promise(function(_0x17080e,_0x26615e){delete _0x2b6c21[_0x8a26('0x21')][_0x467d3c[_0x8a26('0xb9')]];_0x2b6c21[_0x8a26('0xbb')](_0x2b6c21['campaigns'][_0x58039f[_0x8a26('0xb8')]]);_0x2b6c21[_0x8a26('0x1b')][_0x58039f[_0x8a26('0xb8')]][_0x8a26('0xbf')]+=0x1;_0x2b6c21['campaigns'][_0x58039f['queue']][_0x8a26('0x109')]+=0x1;var _0x28fbe2=_0x2b6c21[_0x8a26('0x1b')][_0x58039f[_0x8a26('0xb8')]];var _0x3871a1=new Hangup(_0x58039f,_0x467d3c);_0x3871a1['state']=0x13;_0x3871a1['statedesc']=_0x8a26('0x112');_0x3871a1['membername']='AMD';_0x3871a1[_0x8a26('0x113')]+=0x1;_0x3871a1[_0x8a26('0xd0')]+=0x1;_0x3871a1[_0x8a26('0x10e')]=!![];ami[_0x8a26('0x114')](_0x8a26('0x115'),ut[_0x8a26('0x10d')](_0x3871a1,_0x8a26('0x10e')));hopperUtils[_0x8a26('0xc3')](_0x3871a1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3871a1[_0x8a26('0x124')]+_0x3871a1[_0x8a26('0x125')]+_0x3871a1[_0x8a26('0x117')]+_0x3871a1[_0x8a26('0x118')]+_0x3871a1[_0x8a26('0x119')]+_0x3871a1['countabandonedretry']+_0x3871a1['countmachineretry']+_0x3871a1[_0x8a26('0x11a')]>=_0x28fbe2[_0x8a26('0x11b')]){_0x2b6c21[_0x8a26('0x11c')](_0x3871a1,_0x17080e,_0x26615e,_0x8a26('0x11d'));}else{if(_0x3871a1[_0x8a26('0x113')]>=_0x28fbe2['dialMachineMaxRetry']){_0x2b6c21[_0x8a26('0x11f')](_0x3871a1,_0x17080e,_0x26615e,_0x8a26('0x120'));}else{hopperUtils[_0x8a26('0xd5')]({'active':![],'countmachineretry':_0x3871a1[_0x8a26('0x113')],'scheduledat':moment()[_0x8a26('0xd6')](_0x28fbe2['dialMachineRetryFrequency'],_0x8a26('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3871a1['ContactId'],'ListId':_0x3871a1[_0x8a26('0xd9')],'VoiceQueueId':_0x3871a1[_0x8a26('0xda')]||undefined,'CampaignId':_0x3871a1['CampaignId']||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x126')));_0x17080e({'reschedule':0x1});}}});}}};Dialer[_0x8a26('0x16')][_0x8a26('0x127')]=function(_0x5b6393){var _0x2adffe=this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];var _0x5a635c;if(_0x2adffe&&_0x2adffe['type']==='ivr'){delete this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1b')][_0x2adffe[_0x8a26('0xb8')]]);this[_0x8a26('0x1b')][_0x2adffe[_0x8a26('0xb8')]]['ivrAnswerCallsDay']+=0x1;_0x5a635c=new Hangup(_0x2adffe,_0x5b6393);hopperUtils['createHistory'](_0x5a635c)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x128')));}if(_0x2adffe&&_0x2adffe['type']!==_0x8a26('0xbe')&&isNotNull(this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]['dialQueueProject'])){delete this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]);this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]][_0x8a26('0xbf')]+=0x1;this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]][_0x8a26('0x109')]+=0x1;_0x5a635c=new Hangup(_0x2adffe,_0x5b6393);_0x5a635c[_0x8a26('0x69')]=0x10;_0x5a635c[_0x8a26('0xcc')]=_0x8a26('0x129');_0x5a635c[_0x8a26('0x10b')]=_0x8a26('0x12a');hopperUtils['createHistory'](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x12b')));hopperUtils[_0x8a26('0xc5')](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x128')));}if(_0x2adffe&&_0x2adffe['type']!=='ivr'&&!isNotNull(this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]][_0x8a26('0x12c')])){delete this[_0x8a26('0x21')][_0x5b6393[_0x8a26('0xb9')]];this[_0x8a26('0xbb')](this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]);this[_0x8a26('0x1a')][_0x2adffe[_0x8a26('0xb8')]]['outboundUnknownCallsDay']+=0x1;_0x5a635c=new Hangup(_0x2adffe,_0x5b6393);_0x5a635c['state']=0xc;_0x5a635c[_0x8a26('0xcc')]=_0x5b6393[_0x8a26('0x12d')];_0x5a635c[_0x8a26('0x10b')]=_0x8a26('0x12e');hopperUtils[_0x8a26('0xc3')](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x12b')));hopperUtils[_0x8a26('0xc5')](_0x5a635c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x128')));}};Dialer[_0x8a26('0x16')][_0x8a26('0x2f')]=function(_0x55c65d){var _0x4d17ce=this;if(!_0x4d17ce[_0x8a26('0x27')][_0x55c65d['name']]){_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]]={'running':![]};}else if(_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]][_0x8a26('0x12f')]===!![]){return;}else if(_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]][_0x8a26('0x12f')]===![]){_0x4d17ce[_0x8a26('0x27')][_0x55c65d[_0x8a26('0x41')]][_0x8a26('0x12f')]=!![];}var _0x278404=_0x4d17ce[_0x8a26('0x1a')][_0x55c65d[_0x8a26('0x41')]];var _0x3b9264=_0x278404[_0x8a26('0x66')]!==utils[_0x8a26('0x63')]['INACTIVE'];var _0x1d1e99=utils[_0x8a26('0x130')](_0x278404);_0x278404['statusMessage']=utils[_0x8a26('0x131')](_0x278404,_0x4d17ce['trunks']);Promise[_0x8a26('0x132')]()['then'](function(){if(_0x278404[_0x8a26('0x133')]===utils[_0x8a26('0x63')][_0x8a26('0x79')]){if(_0x3b9264){clearPredictiveAttributes(_0x278404);_0x55c65d['startPredictive']=undefined;_0x55c65d['startProgressive']=undefined;}if(_0x278404[_0x8a26('0x133')]===utils['CAMPAIGN_STATUS']['INACTIVE']){_0x55c65d[_0x8a26('0x134')]=0x0;_0x55c65d['paused']=0x0;_0x55c65d[_0x8a26('0x135')]=0x0;_0x55c65d[_0x8a26('0x136')]=0x0;_0x55c65d[_0x8a26('0x137')]=0x0;}}else if(_0x278404['statusMessage']===utils[_0x8a26('0x63')][_0x8a26('0x138')]&&!_0x1d1e99){return _0x4d17ce[_0x8a26('0x8f')](_0x278404,!![])['then'](function(){return _0x4d17ce[_0x8a26('0x8f')](_0x278404,![]);})[_0x8a26('0x3a')](function(){return _0x4d17ce[_0x8a26('0xaa')](_0x278404);})['catch'](function(_0x2b22d9){loggerSyncQueueSummary[_0x8a26('0x3d')](_0x8a26('0x139'),util['inspect'](_0x2b22d9,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x278404);});}else{clearPredictiveAttributes(_0x278404);}})['then'](function(){var _0x3d6489=_0x55c65d[_0x8a26('0x13a')](_0x278404);if(_0x3d6489||_0x278404[_0x8a26('0x13b')]){_0x278404[_0x8a26('0x13b')]=![];_0x55c65d[_0x8a26('0x13c')](_0x278404);Object[_0x8a26('0x13d')](_0x278404,_0x55c65d);emitOutboundVoiceQueueSummary(_0x55c65d);}_0x4d17ce['queuesSummary'][_0x278404[_0x8a26('0x41')]][_0x8a26('0x12f')]=![];})[_0x8a26('0x9a')](function(_0x13a66d){logger[_0x8a26('0x5f')](_0x8a26('0x139'),util['inspect'](_0x13a66d,{'showHidden':![],'depth':null}));_0x4d17ce[_0x8a26('0x27')][_0x278404['name']][_0x8a26('0x12f')]=![];});};Dialer['prototype'][_0x8a26('0x31')]=_[_0x8a26('0x13e')](function(){var _0x20e1bc=_[_0x8a26('0x13f')](this['voiceQueues'],function(_0x1f83ea){return _0x1f83ea[_0x8a26('0x140')];});var _0x322396=_['filter'](this['agents'],function(_0x46a900){return _0x46a900[_0x8a26('0x141')]&&_0x46a900['status']===_0x8a26('0x82');});if(_0x20e1bc[_0x8a26('0x92')]>0x0&&_0x322396[_0x8a26('0x92')]>0x0){return Promise[_0x8a26('0x132')]()[_0x8a26('0x3a')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x20e1bc,'id'),previewRecallmeReminderInterval,_[_0x8a26('0x142')](_0x322396,'id')))[_0x8a26('0x3a')](function(_0x38c4c7){for(var _0xaccddd=0x0;_0xaccddd<_0x38c4c7['length'];_0xaccddd++){var _0x357615=_0x38c4c7[_0xaccddd][_0x8a26('0x143')][_0x8a26('0x41')];if(_0x357615)io['to'](util[_0x8a26('0x75')](_0x8a26('0x144'),_0x357615))[_0x8a26('0x114')]('user:dialPreviewRecallReminder',{'hopper':_0x38c4c7[_0xaccddd]});}})['catch'](function(_0x21f46d){logger['error']('checkPreviewRecallReminder',_0x21f46d);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x8a26('0x16')]['loopClearZombieChannels']=function(){var _0x18f4b9=this;setInterval(function(){_0x18f4b9[_0x8a26('0x145')](_0x18f4b9[_0x8a26('0x21')],_0x8a26('0x146'));_0x18f4b9['clearZombieChannels'](_0x18f4b9[_0x8a26('0x20')],'[actions]');},0x32c8);};Dialer[_0x8a26('0x16')]['clearZombieChannels']=function(_0x4675d7,_0x30d53c){var _0x199904=this;for(var _0x8658b in _0x4675d7){if(typeof _0x4675d7[_0x8658b]!==_0x8a26('0xa4')){this['sequence'][_0x8a26('0x147')](function(){if(!_[_0x8a26('0xed')](_0x4675d7[_0x8658b])){return ami[_0x8a26('0x93')]({'action':_0x8a26('0x81'),'channel':_0x4675d7[_0x8658b][_0x8a26('0xe9')]})[_0x8a26('0x9a')](function(_0x1f54b3){if(_0x1f54b3['message']===_0x8a26('0x148')){setTimeout(function(){if(_0x4675d7[_0x8658b]&&_0x4675d7[_0x8658b][_0x8a26('0xba')]!==_0x8a26('0xbe')){_0x199904[_0x8a26('0xbb')](_0x199904['voiceQueues'][_0x4675d7[_0x8658b]['queue']]);logger[_0x8a26('0x5f')](_0x8a26('0x149'),_0x30d53c,_0x8658b,_0x4675d7[_0x8658b][_0x8a26('0xb8')]);delete _0x4675d7[_0x8658b];}if(_0x4675d7[_0x8658b]&&_0x4675d7[_0x8658b][_0x8a26('0xba')]===_0x8a26('0xbe')){_0x199904[_0x8a26('0xbb')](_0x199904['campaigns'][_0x4675d7[_0x8658b]['queue']]);logger[_0x8a26('0x5f')](_0x8a26('0x14a'),_0x30d53c,_0x8658b,_0x4675d7[_0x8658b]['queue']);delete _0x4675d7[_0x8658b];}},0x2328);}});}});}}};Dialer[_0x8a26('0x16')][_0x8a26('0x14b')]=function(_0x396479){return Promise[_0x8a26('0x132')]()[_0x8a26('0x3a')](voiceQueueRt[_0x8a26('0x14b')](_0x396479))[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x14c')));};Dialer['prototype'][_0x8a26('0xbb')]=function(_0x4f5299){if(!_[_0x8a26('0x3c')](_0x4f5299)&&_0x4f5299!==null){if(typeof _0x4f5299[_0x8a26('0x78')]!==_0x8a26('0xa4')){if(_0x4f5299[_0x8a26('0x78')]>0x0){_0x4f5299[_0x8a26('0x78')]-=0x1;}else{logger[_0x8a26('0x5f')](_0x8a26('0x14d'));}}}else{logger['error'](_0x8a26('0x14e'));}};Dialer[_0x8a26('0x16')]['loggerHandler']=function(_0x3fcf0d,_0x32b6ea){var _0x2eb788=this;return function(_0x78450e){_0x2eb788[_0x8a26('0xbb')](_0x32b6ea);logger[_0x8a26('0x5f')](_0x3fcf0d,util[_0x8a26('0x3f')](_0x78450e,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x8a26('0x14f')]=function(_0x2a489,_0x431ca4,_0x5155ef){var _0x2913ff={'state':0x19,'statedesc':_0x8a26('0x150')};this[_0x8a26('0xbb')](_0x431ca4);this['saveInDb'](_['merge'](_0x2913ff,_['pick'](_0x5155ef,[_0x8a26('0xd8'),_0x8a26('0xd9'),_0x8a26('0x151'),_0x8a26('0xda'),_0x8a26('0xdb')])),_0x8a26('0x152'),_0x8a26('0x153'));logger[_0x8a26('0x5f')](_0x2a489);};Dialer['prototype'][_0x8a26('0x10f')]=function(_0x313e70,_0x5316c8,_0x12291a){hopperUtils[_0x8a26('0xc3')](_0x313e70)['catch'](loggerCatch(_0x5316c8));hopperUtils['moveContactManagedDialer'](_0x313e70)['catch'](loggerCatch(_0x12291a));};Dialer[_0x8a26('0x16')][_0x8a26('0xd4')]=function(_0x2fce6c,_0x27f966){hopperUtils['createHistory'](_0x2fce6c)[_0x8a26('0x9a')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x27f966==0x0){hopperUtils[_0x8a26('0xc5')](_0x2fce6c)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x154')));}};Dialer[_0x8a26('0x16')][_0x8a26('0x155')]=function(_0x523f17){return Promise[_0x8a26('0x132')]()[_0x8a26('0x3a')](cmHopper['handlePreviewRecallNotifications'](_0x523f17['id'],previewRecallmeReminderInterval))[_0x8a26('0x3a')](function(_0x13079c){for(var _0x109885=0x0;_0x109885<_0x13079c[_0x8a26('0x92')];_0x109885++){var _0x2a9696=_0x13079c[_0x109885]['Agent']['name'];if(_0x2a9696)io['to'](util[_0x8a26('0x75')]('user:%s',_0x2a9696))[_0x8a26('0x114')](_0x8a26('0x156'),{'hopper':_0x13079c[_0x109885]});}})[_0x8a26('0x9a')](function(){});};Dialer[_0x8a26('0x16')]['launchHandleIvr']=function(_0x1a094a){var _0xc8772b=this;return function(){_0xc8772b[_0x8a26('0x157')](_0x1a094a);};};Dialer[_0x8a26('0x16')][_0x8a26('0x158')]=function(_0x2c2054,_0x384d81){var _0x1f8de0=this;var _0x2bebdb=uuid['v4']();this[_0x8a26('0x20')][_0x2bebdb]=new Action(_0x2c2054,_0x384d81,_0x2bebdb);return new Promise(function(_0x4482c8,_0x298f70){if(_[_0x8a26('0x3c')](_0x2c2054)&&typeof _0x2c2054!==_0x8a26('0x159')){return _0x298f70(msgResponse(_0x8a26('0x15a'),'Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x384d81[_0x8a26('0x15b')])||_0x384d81[_0x8a26('0x15b')]===null){return _0x298f70(msgResponse(_0x8a26('0x15a'),'Failure',_0x8a26('0x15c')));}var _0x29a17f={'XMD-CALLERID':_0x1f8de0[_0x8a26('0x20')][_0x2bebdb][_0x8a26('0x15d')](),'XMD-AGI':_0x2c2054['dialQueueProject']?util['format'](_0x8a26('0x15e'),ipAgi,_0x2c2054[_0x8a26('0x12c')]):_0x8a26('0x15f'),'XMD-AGIAFTER':_0x2c2054[_0x8a26('0xc1')]?util[_0x8a26('0x75')](_0x8a26('0x15e'),ipAgi,_0x2c2054['dialQueueProject2']):_0x8a26('0x15f'),'XMD-QUEUE':utils[_0x8a26('0x160')](_0x2c2054)?util[_0x8a26('0x75')]('\x22%s,%s%s,,,%s\x22',_0x2c2054[_0x8a26('0x41')],_0x2c2054[_0x8a26('0x161')]||'',_0x2c2054[_0x8a26('0xc2')]?'c':'',_0x2c2054['dialQueueTimeout']||0x3):_0x8a26('0x15f'),'XMD-CONTACTID':_0x384d81[_0x8a26('0xd8')],'XMD-CDRTYPE':_0x8a26('0x9'),'CALLERID(all)':_0x1f8de0[_0x8a26('0x20')][_0x2bebdb][_0x8a26('0x15d')](),'XMD-AMD':_0x2c2054[_0x8a26('0x110')]?_0x8a26('0x138'):_0x8a26('0x15f'),'XMD-DESTINATION':_0x8a26('0x162')};if(_0x2c2054[_0x8a26('0x110')]){_0x29a17f['XMD-AMDINITIALSILENCE']=_0x2c2054[_0x8a26('0x163')]||0x9c4;_0x29a17f[_0x8a26('0x164')]=_0x2c2054[_0x8a26('0x165')]||0x5dc;_0x29a17f[_0x8a26('0x166')]=_0x2c2054[_0x8a26('0x167')]||0x320;_0x29a17f[_0x8a26('0x168')]=_0x2c2054[_0x8a26('0x169')]||0x1388;_0x29a17f[_0x8a26('0x16a')]=_0x2c2054['dialAMDMinWordLength']||0x64;_0x29a17f['XMD-AMDBETWEENWORDSSILENCE']=_0x2c2054[_0x8a26('0x16b')]||0x32;_0x29a17f[_0x8a26('0x16c')]=_0x2c2054[_0x8a26('0x16d')]||0x3;_0x29a17f[_0x8a26('0x16e')]=_0x2c2054[_0x8a26('0x16f')]||0x100;_0x29a17f[_0x8a26('0x170')]=_0x2c2054[_0x8a26('0x171')]||0x1388;}if(utils[_0x8a26('0x160')](_0x2c2054)){_0x29a17f['XMD-VOICEQUEUEID']=_0x384d81['VoiceQueueId'];}else{_0x29a17f[_0x8a26('0x172')]=_0x384d81[_0x8a26('0xdb')];}for(var _0x3fefcc in _0x384d81[_0x8a26('0x173')]){if(typeof _0x384d81[_0x8a26('0x173')][_0x3fefcc]!==_0x8a26('0xa4')){if(isNotNull(_0x384d81[_0x8a26('0x173')][_0x3fefcc])&&_0x3fefcc!=='id'&&_0x3fefcc!==_0x8a26('0x174')&&_0x3fefcc!==_0x8a26('0x175')&&_0x3fefcc!==_0x8a26('0x176')){_0x29a17f[util[_0x8a26('0x75')](_0x8a26('0x177'),_0x8a26('0x178'),_[_0x8a26('0x179')](_0x3fefcc))]=_0x384d81[_0x8a26('0x173')][_0x3fefcc];}}}var _0x337a89=_0x1f8de0[_0x8a26('0x7e')](_0x2c2054[_0x8a26('0x85')])?utils[_0x8a26('0x17a')](_0x2c2054['Trunk'][_0x8a26('0x17b')],_0x2c2054['dialOriginateCallerIdName'],_0x2c2054[_0x8a26('0x17c')]>0x0?utils[_0x8a26('0x17d')](_0x2c2054[_0x8a26('0x17e')],_0x2c2054[_0x8a26('0x17c')]):_0x2c2054['dialOriginateCallerIdNumber']):utils[_0x8a26('0x17a')](_[_0x8a26('0xed')](_0x2c2054[_0x8a26('0x86')])?_0x2c2054['Trunk'][_0x8a26('0x17b')]:_0x2c2054[_0x8a26('0x86')]['callerid'],_0x2c2054[_0x8a26('0x17f')],_0x2c2054[_0x8a26('0x17c')]>0x0?utils[_0x8a26('0x17d')](_0x2c2054[_0x8a26('0x17e')],_0x2c2054[_0x8a26('0x17c')]):_0x2c2054[_0x8a26('0x17e')]);if(_0x337a89){_0x29a17f['XMD-ORIGINATECALLERIDNAME']=_0x1f8de0[_0x8a26('0x20')][_0x2bebdb][_0x8a26('0x180')]=utils['extractCalleridName'](_0x337a89);_0x29a17f['XMD-ORIGINATECALLERIDNUM']=_0x384d81[_0x8a26('0x15b')];}_0x2c2054[_0x8a26('0x181')]=_0x29a17f;return ami[_0x8a26('0x93')]({'actionid':_0x2bebdb,'action':_0x8a26('0x15a'),'channel':_0x1f8de0[_0x8a26('0x7e')](_0x2c2054[_0x8a26('0x85')])?util[_0x8a26('0x75')]('SIP/%s/%s%s',_0x2c2054[_0x8a26('0x85')][_0x8a26('0x41')],isNotNull(_0x2c2054['dialPrefix'])?_0x2c2054['dialPrefix'][_0x8a26('0x182')]()||'':'',_0x2c2054[_0x8a26('0x183')]>0x0?_0x384d81[_0x8a26('0x15b')][_0x8a26('0x184')](_0x2c2054[_0x8a26('0x183')]):_0x384d81[_0x8a26('0x15b')]):util[_0x8a26('0x75')](_0x8a26('0x185'),_[_0x8a26('0xed')](_0x2c2054[_0x8a26('0x86')])?_0x2c2054['Trunk']['name']:_0x2c2054[_0x8a26('0x86')]['name'],isNotNull(_0x2c2054[_0x8a26('0x186')])?_0x2c2054[_0x8a26('0x186')][_0x8a26('0x182')]()||'':'',_0x2c2054[_0x8a26('0x183')]>0x0?_0x384d81[_0x8a26('0x15b')]['substring'](_0x2c2054[_0x8a26('0x183')]):_0x384d81[_0x8a26('0x15b')]),'callerid':_0x337a89,'Exten':_0x8a26('0x162'),'Context':_0x8a26('0x187'),'Priority':'1','variable':_0x29a17f,'timeout':(_0x2c2054[_0x8a26('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2bebdb})[_0x8a26('0x3a')](function(_0xcbdf77){return _0x4482c8(_0xcbdf77);})['catch'](function(_0xac2563){_0x2c2054[_0x8a26('0x189')]+=0x1;var _0x29f7c3=new History(_0x1f8de0[_0x8a26('0x20')][_0x2bebdb]);logger['error'](util[_0x8a26('0x75')]('[originateError]:\x20%s',JSON[_0x8a26('0x6f')](_0xac2563)));_0x29f7c3[_0x8a26('0x69')]=0xe;_0x29f7c3[_0x8a26('0xcc')]=_0x8a26('0x18a');_0x29f7c3['starttime']=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));_0x29f7c3[_0x8a26('0x6a')]=_0x29f7c3['starttime'];hopperUtils[_0x8a26('0xc3')](_0x29f7c3)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x18b')));_0x1f8de0['moveContactManagedDialer'](_0x29f7c3)['catch'](loggerCatch('[originate][error]'))[_0x8a26('0x18')](function(){delete _0x1f8de0[_0x8a26('0x20')][_0x2bebdb];return _0x298f70(msgResponse(_0x8a26('0x15a'),_0x8a26('0x7d'),_0x8a26('0x18c')));});});});};Dialer[_0x8a26('0x16')]['checkRetriveMax']=function(_0x13504c,_0x3aa85b,_0x1a242e){var _0x38bc3c=new History(_0x3aa85b);if(_0x38bc3c[_0x8a26('0x124')]+_0x38bc3c[_0x8a26('0x125')]+_0x38bc3c[_0x8a26('0x117')]+_0x38bc3c['countnosuchnumberretry']+_0x38bc3c[_0x8a26('0x119')]+_0x38bc3c[_0x8a26('0xe3')]+_0x38bc3c[_0x8a26('0x113')]+_0x38bc3c[_0x8a26('0x11a')]>=_0x1a242e['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x13504c){case 0x3:if(_0x38bc3c[_0x8a26('0x117')]>=_0x1a242e[_0x8a26('0x18d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x38bc3c[_0x8a26('0x117')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e[_0x8a26('0x18e')],_0x8a26('0xd7'))[_0x8a26('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x38bc3c[_0x8a26('0x124')]>=_0x1a242e[_0x8a26('0x18f')]-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countbusyretry':_0x38bc3c[_0x8a26('0x124')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialBusyRetryFrequency'],'minutes')[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x38bc3c['ContactId'],'ListId':_0x38bc3c['ListId'],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x190')));break;case 0x8:if(_0x38bc3c[_0x8a26('0x125')]>=_0x1a242e[_0x8a26('0x191')]-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countcongestionretry':_0x38bc3c['countcongestionretry']+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e[_0x8a26('0x192')],_0x8a26('0xd7'))[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x193')));break;case 0x0:if(_0x38bc3c[_0x8a26('0x118')]>=_0x1a242e[_0x8a26('0x194')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x38bc3c[_0x8a26('0x118')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialNoSuchNumberRetryFrequency'],_0x8a26('0xd7'))[_0x8a26('0x75')](_0x8a26('0xbd')),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x38bc3c[_0x8a26('0x119')]>=_0x1a242e[_0x8a26('0x195')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x38bc3c['countdropretry']+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e[_0x8a26('0xd1')],_0x8a26('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x38bc3c[_0x8a26('0xe3')]>=_0x1a242e['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x38bc3c[_0x8a26('0xe3')]+=0x1,'scheduledat':moment()['add'](_0x1a242e[_0x8a26('0xe4')],'minutes')['format'](_0x8a26('0xbd')),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c['ListId'],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x196')));break;case 0x13:if(_0x38bc3c[_0x8a26('0x113')]>=_0x1a242e[_0x8a26('0x11e')]-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countmachineretry':_0x38bc3c['countmachineretry']+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialMachineRetryFrequency'],_0x8a26('0xd7'))['format'](_0x8a26('0xbd')),'ContactId':_0x38bc3c['ContactId'],'ListId':_0x38bc3c[_0x8a26('0xd9')],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x38bc3c[_0x8a26('0x11a')]>=_0x1a242e['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x8a26('0xd5')]({'active':![],'countagentrejectretry':_0x38bc3c[_0x8a26('0x11a')]+=0x1,'scheduledat':moment()[_0x8a26('0xd6')](_0x1a242e['dialAgentRejectRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38bc3c[_0x8a26('0xd8')],'ListId':_0x38bc3c['ListId'],'VoiceQueueId':_0x38bc3c[_0x8a26('0xda')]||undefined,'CampaignId':_0x38bc3c[_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x197')));break;default:return!![];}};Dialer[_0x8a26('0x16')]['callProgressDetecting']=function(_0xf870cb,_0x5f0716,_0x2443fd){var _0x117920=this;var _0x408541=new History(_0xf870cb);var _0x28b09b=![];var _0x33efbf;var _0x52d5b8;return new Promise(function(_0x4f5479,_0x266bfd){if(_[_0x8a26('0x3c')](_0x5f0716)&&typeof _0x5f0716!=='object'){return _0x266bfd(msgResponse(_0x8a26('0x198'),'Failure',_0x8a26('0x199')));}if(_[_0x8a26('0x3c')](_0x2443fd)&&typeof _0x2443fd!==_0x8a26('0x159')){return _0x266bfd(msgResponse(_0x8a26('0x198'),'Failure',_0x8a26('0x19a')));}hopperUtils[_0x8a26('0xe6')](_0x408541,_0x2443fd['reason'],_0x5f0716)['then'](function(_0x375384){if(_0x375384[_0x8a26('0xd3')]==0x1)_0x28b09b=!![];switch(_0x2443fd['reason']){case'0':_0x5f0716[_0x8a26('0x19b')]+=0x1;_0x408541[_0x8a26('0x69')]=0x0;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x19c');_0x408541[_0x8a26('0x118')]+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;ami['emit'](_0x8a26('0x19d'),ut[_0x8a26('0x10d')](_0xf870cb,_0x8a26('0x19e')));_0x33efbf=_0x5f0716[_0x8a26('0x19f')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils[_0x8a26('0xc3')](_0x408541)['catch'](loggerCatch(_0x8a26('0x116')));if(_0x117920[_0x8a26('0x1a0')](0x0,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countnosuchnumberretry']>=_0x5f0716[_0x8a26('0x194')]){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1a1'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1a1'));}}break;case'3':_0x5f0716[_0x8a26('0x1a2')]+=0x1;_0x408541[_0x8a26('0x69')]=0x3;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x1a3');_0x408541['countnoanswerretry']+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;var _0x259259=ut[_0x8a26('0x1a4')](_0xf870cb,_0x5f0716);ami[_0x8a26('0x114')](_0x8a26('0x1a5'),_0x259259);_0x33efbf=_0x5f0716[_0x8a26('0x18e')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils[_0x8a26('0xc3')](_0x408541)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x117920[_0x8a26('0x1a0')](0x3,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countnoanswerretry']>=_0x5f0716['dialNoAnswerMaxRetry']){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1a6'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5f0716[_0x8a26('0x1a7')]+=0x1;_0x408541[_0x8a26('0x69')]=0x5;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x1a8');_0x408541[_0x8a26('0x124')]+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;ami[_0x8a26('0x114')](_0x8a26('0x1a9'),ut[_0x8a26('0x10d')](_0xf870cb,_0x8a26('0x1aa')));_0x33efbf=_0x5f0716[_0x8a26('0x1ab')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils['createHistory'](_0x408541)[_0x8a26('0x9a')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x117920['checkRetriveMax'](0x5,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541[_0x8a26('0x124')]>=_0x5f0716[_0x8a26('0x18f')]){_0x117920['createStateFinal'](_0x408541,_0x4f5479,_0x266bfd,'reason\x205\x20busy');}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1ac'));}}break;case'8':_0x5f0716[_0x8a26('0x1ad')]+=0x1;_0x408541[_0x8a26('0x69')]=0x8;_0x408541[_0x8a26('0xcc')]='Congestion';_0x408541['countcongestionretry']+=0x1;_0x408541['countglobal']+=0x1;_0x33efbf=_0x5f0716[_0x8a26('0x192')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];ami[_0x8a26('0x114')](_0x8a26('0x1ae'),ut[_0x8a26('0x10d')](_0xf870cb,'congestion'));hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1af')));if(_0x117920[_0x8a26('0x1a0')](0x8,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countcongestionretry']>=_0x5f0716[_0x8a26('0x191')]){_0x117920['createStateFinal'](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b0'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b0'));}}break;case'11':_0x5f0716[_0x8a26('0x1b1')]+=0x1;_0x408541['state']=0xb;_0x408541[_0x8a26('0xcc')]='Abandoned';_0x408541['countabandonedretry']+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;_0x33efbf=_0x5f0716[_0x8a26('0xe4')];_0x52d5b8=_0x5f0716['callAdditionalPhoneAfterMin'];hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1b2')));if(_0x117920['checkRetriveMax'](0xb,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541[_0x8a26('0xe3')]>=_0x5f0716['dialAbandonedMaxRetry']){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b3'));}else{_0x117920['stateGlobal'](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1b3'));}}break;case'20':_0x5f0716[_0x8a26('0x1b4')]+=0x1;_0x408541[_0x8a26('0x69')]=0x14;_0x408541[_0x8a26('0xcc')]=_0x8a26('0x1b5');_0x408541['countagentrejectretry']+=0x1;_0x408541[_0x8a26('0xd0')]+=0x1;_0x33efbf=_0x5f0716[_0x8a26('0x1b6')];_0x52d5b8=_0x5f0716['callAdditionalPhoneAfterMin'];ami[_0x8a26('0x114')](_0x8a26('0x1b7'),ut['buildObj'](_0xf870cb,_0x8a26('0x1b8')));hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1b9')));if(_0x117920[_0x8a26('0x1a0')](0x14,_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541['countagentrejectretry']>=_0x5f0716['dialAgentRejectMaxRetry']){_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x8a26('0x1ba'));}else{_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,'reason\x2020\x20agentreject');}}break;default:_0x5f0716[_0x8a26('0x1bb')]+=0x1;_0x408541[_0x8a26('0x69')]=0xc;_0x408541['statedesc']=_0x2443fd[_0x8a26('0x1bc')];_0x33efbf=_0x5f0716[_0x8a26('0x1b6')];_0x52d5b8=_0x5f0716[_0x8a26('0xe5')];hopperUtils[_0x8a26('0xc3')](_0x408541)[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x1bd')));if(_0x117920[_0x8a26('0x1a0')](_0x2443fd[_0x8a26('0x1bc')],_0xf870cb,_0x5f0716)&&!_0x28b09b){if(_0x408541[_0x8a26('0x124')]+_0x408541[_0x8a26('0x125')]+_0x408541['countnoanswerretry']+_0x408541[_0x8a26('0x118')]+_0x408541['countdropretry']+_0x408541[_0x8a26('0xe3')]+_0x408541[_0x8a26('0x113')]+_0x408541['countagentrejectretry']>=_0x5f0716[_0x8a26('0x11b')]){_0x117920[_0x8a26('0x11c')](_0x408541,_0x4f5479,_0x266bfd,_0x2443fd[_0x8a26('0x1bc')]);}else{_0x117920[_0x8a26('0x11f')](_0x408541,_0x4f5479,_0x266bfd,_0x2443fd[_0x8a26('0x1bc')]);}}}})['then'](function(){if(_0x28b09b){hopperUtils[_0x8a26('0xe0')](_0x408541,_0x33efbf,_0x52d5b8)[_0x8a26('0x3a')](function(){return _0x4f5479(0x1);});}});});};Dialer[_0x8a26('0x16')][_0x8a26('0x11c')]=function(_0x5ffaa,_0x1b3095,_0x1796bd,_0x4de352){var _0x999cf0=new Final(_0x5ffaa);_0x999cf0['state']=0xf;_0x999cf0[_0x8a26('0xcc')]='Global';this['createStateFinal'](_0x999cf0,_0x1b3095,_0x1796bd,_0x4de352);};Dialer[_0x8a26('0x16')][_0x8a26('0x11f')]=function(_0x1de57b,_0x18ca36,_0x3fbe72,_0x36e339){hopperUtils[_0x8a26('0xc5')](_0x1de57b)[_0x8a26('0x3a')](function(){return _0x18ca36(msgResponse(_0x8a26('0x198'),_0x8a26('0x102'),_0x36e339));})[_0x8a26('0x9a')](function(){return _0x3fbe72(msgResponse(_0x8a26('0x1be'),_0x8a26('0x90'),_0x8a26('0x1bf')));});};Dialer[_0x8a26('0x16')][_0x8a26('0xb')]=function(_0x57326b){var _0x17fdd9=_0x57326b[_0x8a26('0x1c0')]/0x64;var _0x253aae=_0x57326b[_0x8a26('0xca')]/(_0x57326b[_0x8a26('0xca')]+_0x57326b[_0x8a26('0xbf')]);var _0x45a4f3=Math['round'](_0x57326b[_0x8a26('0x1c1')]*(_0x57326b[_0x8a26('0x1c2')]/0x64));var _0x300366=Math[_0x8a26('0x1c3')](_0x57326b[_0x8a26('0x1c1')]*(_0x57326b[_0x8a26('0x1c4')]/0x64));var _0x145705=_0x57326b[_0x8a26('0x134')]+_0x57326b[_0x8a26('0x136')];var _0x455619=Math[_0x8a26('0x1c5')](_0x57326b[_0x8a26('0x54')]*_0x57326b[_0x8a26('0x56')]*_0x57326b[_0x8a26('0x1c6')]*_0x57326b[_0x8a26('0x1c7')]);if(_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x5b')])){if(!_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x23')])){_0x57326b['startPredictive']=undefined;loggerPredictive['error'](_0x8a26('0x1c8'),_0x8a26('0x1c9'));}if(!_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x5d')])){loggerPredictive[_0x8a26('0x5f')](_0x8a26('0x1c8'),_0x8a26('0x1ca'));clearInterval(_0x57326b[_0x8a26('0x5d')]);_0x57326b[_0x8a26('0x5d')]=undefined;}_0x57326b[_0x8a26('0x5b')]=moment()['format'](_0x8a26('0xbd'));loggerPredictive[_0x8a26('0x45')](_0x57326b[_0x8a26('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x57326b[_0x8a26('0x5b')]);this[_0x8a26('0xac')](_0x57326b,0x1);}else if(ifInterval(_0x57326b[_0x8a26('0x1cb')],_0x57326b['startProgressive'])){this[_0x8a26('0xac')](_0x57326b,0x1);loggerPredictiveCalls[_0x8a26('0x45')]('[startMethodPredictive][StartProgressive][Loop]',_0x57326b[_0x8a26('0x5b')],_0x57326b[_0x8a26('0x41')]);_0x57326b[_0x8a26('0x54')]=0x0;_0x57326b['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x17fdd9<_0x253aae&&_0x57326b[_0x8a26('0x1cc')]===_0x8a26('0x1cd')){clearPredictiveAttributes(_0x57326b);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x8a26('0x1ce'),_0x253aae,_0x8a26('0x5b'),_0x57326b[_0x8a26('0x41')]);}else if(_0x455619<_0x57326b['predictiveIntervalErlangCallsDroppedCalls']&&_0x57326b[_0x8a26('0x1cc')]===_0x8a26('0x1cd')){clearPredictiveAttributes(_0x57326b);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x8a26('0x1cf'),_0x455619,_0x8a26('0x1d0'),_0x57326b[_0x8a26('0xcb')],'startProgressive',_0x57326b[_0x8a26('0x41')]);}else if(!ifInterval(_0x57326b[_0x8a26('0x1cb')],_0x57326b[_0x8a26('0x5b')])&&_[_0x8a26('0x3c')](_0x57326b[_0x8a26('0x23')])&&!_[_0x8a26('0x3c')](_0x57326b['startProgressive'])){_0x57326b[_0x8a26('0x23')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));loggerPredictive[_0x8a26('0x45')](_0x57326b['name'],_0x8a26('0x1d1'),_0x57326b[_0x8a26('0x23')]);hopperUtils['avgHandleTime'](_0x57326b[_0x8a26('0x1cb')])[_0x8a26('0x3a')](this[_0x8a26('0x1d2')](_0x57326b))[_0x8a26('0x3a')](mergeDataErlangB(_0x57326b))[_0x8a26('0x3a')](this[_0x8a26('0x1d3')](_0x57326b))[_0x8a26('0x9a')](loggerCatchPredictive(_0x8a26('0x1d4'),_0x57326b));}else if(!ifInterval(_0x57326b['dialPredictiveInterval'],_0x57326b[_0x8a26('0x23')])){_0x57326b[_0x8a26('0xcb')]=0x0;_0x57326b[_0x8a26('0x23')]=moment()[_0x8a26('0x75')](_0x8a26('0xbd'));loggerPredictive['info'](_0x57326b[_0x8a26('0x41')],_0x8a26('0x1d5'),_0x57326b[_0x8a26('0x23')]);clearInterval(_0x57326b[_0x8a26('0x5d')]);_0x57326b[_0x8a26('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x57326b[_0x8a26('0x1cb')])[_0x8a26('0x3a')](this['getDataPredictive'](_0x57326b))[_0x8a26('0x3a')](mergeDataErlangB(_0x57326b))['then'](this[_0x8a26('0x1d3')](_0x57326b))[_0x8a26('0x9a')](loggerCatchPredictive(_0x8a26('0x1d6'),_0x57326b));}else if(_0x57326b[_0x8a26('0x1c1')]&&_0x145705<_0x57326b[_0x8a26('0x1c1')]-_0x300366){clearPredictiveAttributes(_0x57326b);loggerPredictive[_0x8a26('0x45')](_0x57326b[_0x8a26('0x41')],_0x8a26('0x1d7'),_0x145705,_0x8a26('0x1d8'),_0x57326b[_0x8a26('0x1c1')],'-',_0x300366,'=',_0x57326b[_0x8a26('0x1c1')]-_0x300366,')');}else if(_0x57326b[_0x8a26('0x1c1')]&&_0x145705>_0x57326b[_0x8a26('0x1c1')]+_0x45a4f3){clearPredictiveAttributes(_0x57326b);loggerPredictive[_0x8a26('0x45')](_0x57326b['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x145705,_0x8a26('0x1d9'),_0x57326b[_0x8a26('0x1c1')],'+',_0x45a4f3,'=',_0x57326b[_0x8a26('0x1c1')]+_0x45a4f3,')');}};Dialer[_0x8a26('0x16')]['getDataPredictive']=function(_0x4d0f45){var _0x2ba410=this;return function(_0x4b9a84){return new Promise(function(_0x49f237,_0x1435de){_[_0x8a26('0x59')](_0x4d0f45,_0x4b9a84[0x0]);if(checkGetDataPredictive(_0x4b9a84[0x0])){var _0x5bef45=_0x4d0f45['predictiveIntervalAvailable']=_0x4d0f45[_0x8a26('0x136')]+_0x4d0f45[_0x8a26('0x134')];var _0x1e79c7=_0x4d0f45[_0x8a26('0x1cb')]*0x3c;var _0x297658=_0x4b9a84[0x0][_0x8a26('0x4e')]+_0x4b9a84[0x0][_0x8a26('0x4d')];var _0x4ce371=(_0x4b9a84[0x0][_0x8a26('0x48')]+_0x4b9a84[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b9a84[0x0][_0x8a26('0x4b')])/_0x4b9a84[0x0][_0x8a26('0x47')];_0x4d0f45[_0x8a26('0x1c6')]=_0x4ce371>0x0?_0x4ce371:0x1;switch(_0x4d0f45['dialPredictiveOptimization']){case _0x8a26('0x1cd'):var _0x2bc1f2=_0x4d0f45[_0x8a26('0x1c0')]/0x64;return _0x2ba410[_0x8a26('0x1da')](_0x5bef45,_0x1e79c7,_0x297658,_0x4ce371,_0x2bc1f2)[_0x8a26('0x3a')](function(_0x8415e3){return _0x49f237(_0x8415e3);});case _0x8a26('0x1db'):var _0x58dc4c=_0x4d0f45[_0x8a26('0x1c0')]/0x64;return _0x2ba410['busyFactor'](_0x5bef45,_0x1e79c7,_0x297658,_0x4ce371,_0x58dc4c)['then'](function(_0x4afb87){return _0x49f237(_0x4afb87);});default:return _0x1435de(msgResponse('[getDataPredictive]',_0x8a26('0x90'),_0x8a26('0x1dc')));}}else{return _0x1435de(msgResponse(_0x8a26('0x1dd'),_0x8a26('0x90'),_0x8a26('0x1de')));}});};};Dialer[_0x8a26('0x16')][_0x8a26('0x1df')]=function(_0x25a241){var _0x450af1=this;return function(_0x5f21e5){return new Promise(function(_0xcdfb93,_0x5e99ce){_[_0x8a26('0x59')](_0x25a241,_0x5f21e5[0x0]);if(checkGetDataPredictive(_0x5f21e5[0x0])){loggerPredictive[_0x8a26('0x45')](JSON['stringify'](_0x5f21e5[0x0]));if(_0x25a241['dialPredictiveOptimization']===_0x8a26('0x1cd')){return _0x450af1[_0x8a26('0x14b')](_0x25a241['id'])[_0x8a26('0x3a')](function(_0x222647){var _0x497ea9=_0x25a241['loggedIn']-_0x222647[0x0][_0x8a26('0x1e0')];var _0x1e7d52=_0x25a241[_0x8a26('0x1cb')]*0x3c;var _0x3dec4b=_0x5f21e5[0x0][_0x8a26('0x4e')]+_0x5f21e5[0x0][_0x8a26('0x4d')];var _0x1b0c96=(_0x5f21e5[0x0][_0x8a26('0x48')]+_0x5f21e5[0x0][_0x8a26('0x49')]+_0x5f21e5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5f21e5[0x0][_0x8a26('0x47')];var _0x18506e=_0x25a241['dialPredictiveOptimizationPercentage']/0x64;_0x25a241['predictiveIntervalPauses']=_0x222647[0x0][_0x8a26('0x1e0')]||0x0;_0x25a241[_0x8a26('0x1c6')]=_0x1b0c96>0x0?_0x1b0c96:0x1;return _0x450af1[_0x8a26('0x1da')](_0x497ea9,_0x1e7d52,_0x3dec4b,_0x1b0c96,_0x18506e);})[_0x8a26('0x3a')](function(_0x3d3c63){return _0xcdfb93(_0x3d3c63);})[_0x8a26('0x9a')](function(_0x5d2b12){return _0x5e99ce(msgResponse(_0x8a26('0x1e1'),'Failure',JSON['stringify'](_0x5d2b12)));});}if(_0x25a241['dialPredictiveOptimization']==='agentBusyFactor'){return _0x450af1[_0x8a26('0x14b')](_0x25a241['id'])[_0x8a26('0x3a')](function(_0x3a9b86){var _0x50545e=_0x25a241[_0x8a26('0x1e2')]-_0x3a9b86[0x0][_0x8a26('0x1e0')];var _0x4f34d0=_0x25a241[_0x8a26('0x1cb')]*0x3c;var _0x345c56=_0x5f21e5[0x0][_0x8a26('0x4e')]+_0x5f21e5[0x0][_0x8a26('0x4d')];var _0x2a27f5=(_0x5f21e5[0x0][_0x8a26('0x48')]+_0x5f21e5[0x0][_0x8a26('0x49')]+_0x5f21e5[0x0][_0x8a26('0x4b')])/_0x5f21e5[0x0]['predictiveIntervalTotalCalls'];var _0x426c8c=_0x25a241[_0x8a26('0x1c0')]/0x64;_0x25a241[_0x8a26('0x1e3')]=_0x3a9b86[0x0]['outboundQueuePauses']||0x0;_0x25a241[_0x8a26('0x1c6')]=_0x2a27f5>0x0?_0x2a27f5:0x1;return _0x450af1[_0x8a26('0x1e4')](_0x50545e,_0x4f34d0,_0x345c56,_0x2a27f5,_0x426c8c);})[_0x8a26('0x3a')](function(_0x1d45f3){return _0xcdfb93(_0x1d45f3);})['catch'](function(_0x59b9cd){return _0x5e99ce(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x59b9cd)));});}}else{return _0x5e99ce(msgResponse('[getDataPredictive]',_0x8a26('0x90'),'check\x20failure'));}});};};Dialer[_0x8a26('0x16')][_0x8a26('0x1d3')]=function(_0x1a3fe3){var _0x1d1715=this;return function(){var _0x5ab156=0x0;var _0x1596a3=Math[_0x8a26('0x1c5')](_0x1a3fe3[_0x8a26('0x1e5')]*0x3e8);if(_0x1596a3>0x0){_0x1596a3=_0x1596a3<0x64?0x64:_0x1596a3;loggerPredictive[_0x8a26('0x45')](_0x1a3fe3[_0x8a26('0x41')],'one\x20call\x20every:',_0x1596a3,'milliseconds');_0x1a3fe3[_0x8a26('0x5d')]=setInterval(function(){_0x1d1715['handlePredictive'](_0x1a3fe3);loggerPredictiveCalls['info']('[handlePredictive]',_0x5ab156+=0x1);},_0x1596a3);}else{loggerPredictive[_0x8a26('0x45')](_0x1a3fe3['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x8a26('0x16')][_0x8a26('0x1e6')]=function(_0x1d888d,_0x24f89a){var _0x338824=this;return function(_0x5adf0a){if(_[_0x8a26('0x43')](_0x5adf0a)){if(_[_0x8a26('0xed')](_0x24f89a[_0x8a26('0x151')])||!_0x24f89a[_0x8a26('0x1e7')]){if(_0x1d888d[_0x8a26('0xab')]===_0x8a26('0xa')){_0x1d888d['queueStatusComplete']=_[_0x8a26('0x3c')](_0x1d888d[_0x8a26('0x6c')])?!![]:_0x1d888d[_0x8a26('0x6c')];var _0x33aaa1=uuid['v4']();_0x338824['actions'][_0x33aaa1]=new Action(_0x1d888d,_0x24f89a,_0x33aaa1);loggerBooked[_0x8a26('0x45')](_0x8a26('0x1e8'),_0x33aaa1,'queueStatusComplete:\x20',JSON['stringify'](_0x1d888d['queueStatusComplete']),_0x8a26('0x1e9'),_0x1d888d[_0x8a26('0x41')]);if(_0x1d888d['queueStatusComplete']){_0x1d888d[_0x8a26('0x6c')]=![];_0x338824[_0x8a26('0x25')][_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xb8')]]=[];ami[_0x8a26('0x93')]({'actionid':_0x33aaa1,'action':_0x8a26('0x1ea'),'queue':_0x1d888d[_0x8a26('0x41')]})[_0x8a26('0x9a')](function(){_0x338824[_0x8a26('0xbb')](_0x1d888d);hopperUtils[_0x8a26('0xd5')]({'active':![],'ContactId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xd8')],'ListId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xd9')],'VoiceQueueId':_0x338824[_0x8a26('0x20')][_0x33aaa1]['VoiceQueueId']||undefined,'CampaignId':_0x338824['actions'][_0x33aaa1]['CampaignId']||undefined})[_0x8a26('0x9a')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x338824[_0x8a26('0x20')][_0x33aaa1];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x8a26('0x6f')](_0x1d888d['queueStatusComplete']),_0x8a26('0x1e9'),_0x1d888d[_0x8a26('0x41')]);_0x338824['updateOriginated'](_0x1d888d);hopperUtils[_0x8a26('0xd5')]({'active':![],'ContactId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xd8')],'ListId':_0x338824['actions'][_0x33aaa1][_0x8a26('0xd9')],'VoiceQueueId':_0x338824[_0x8a26('0x20')][_0x33aaa1][_0x8a26('0xda')]||undefined,'CampaignId':_0x338824['actions'][_0x33aaa1][_0x8a26('0xdb')]||undefined})[_0x8a26('0x9a')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x338824['actions'][_0x33aaa1];}}else{return _0x338824[_0x8a26('0x158')](_0x1d888d,_0x24f89a);}}else{if(utils[_0x8a26('0x5a')](undefined,_0x24f89a[_0x8a26('0x1eb')])<_0x1d888d['dialRecallMeTimeout']*0x3c){if(_0x24f89a[_0x8a26('0x143')]&&!_0x24f89a[_0x8a26('0x143')][_0x8a26('0x1ec')]){_0x338824[_0x8a26('0x1ed')]['run'](_0x24f89a['id'])[_0x8a26('0x18')](function(){_0x338824[_0x8a26('0xbb')](_0x1d888d);});}else{hopperUtils[_0x8a26('0x1ee')]({'active':![]},_0x24f89a['id'],0x1)[_0x8a26('0x18')](function(){_0x338824[_0x8a26('0xbb')](_0x1d888d);});}}else{_0x1d888d[_0x8a26('0x1ef')]+=0x1;_0x338824[_0x8a26('0xbb')](_0x1d888d);if(_0x1d888d['dialRecallInQueue']){hopperUtils[_0x8a26('0xd5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x24f89a[_0x8a26('0xd8')],'ListId':_0x24f89a[_0x8a26('0xd9')],'VoiceQueueId':_0x24f89a[_0x8a26('0xda')]||undefined,'CampaignId':_0x24f89a[_0x8a26('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x8a26('0xc3')](createObjHistory(_0x1d888d,_0x24f89a,utils['CAMPAIGN_STATUS']['QUEUE_RECALL'],0x17,_0x8a26('0x1f0')))['catch'](loggerCatch(_0x8a26('0x1f1')));}else{_0x338824['saveInDb'](createObjHistory(_0x1d888d,_0x24f89a,utils[_0x8a26('0x63')][_0x8a26('0x1f2')],0x16,_0x8a26('0x1f3')),_0x8a26('0x1f4'),_0x8a26('0x1f5'));}}}}else{_0x1d888d['outboundBlacklistCallsDay']+=0x1;_0x338824[_0x8a26('0x10f')](createObjHistory(_0x1d888d,_0x24f89a,utils[_0x8a26('0x63')][_0x8a26('0x1f6')],0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x8a26('0x1f7');}};};Dialer[_0x8a26('0x16')][_0x8a26('0x157')]=function(_0x477073){var _0x3c0cc2=this;var _0x143031=_0x477073[_0x8a26('0x1f8')]-_0x477073[_0x8a26('0x78')]-_0x477073[_0x8a26('0x1f9')];emitCampaignSummary(_0x477073);if(_0x143031>0x0){if(_0x143031>this[_0x8a26('0x1e')]){_0x143031=this[_0x8a26('0x1e')];}_0x477073[_0x8a26('0x1f9')]+=_0x143031;hopperUtils[_0x8a26('0x1fa')](_0x477073['id'],_0x143031,_0x477073[_0x8a26('0x1fb')],_0x477073)[_0x8a26('0x3a')](function(_0x5a8bf7){_0x477073[_0x8a26('0x1f9')]-=_0x143031;_0x477073[_0x8a26('0x1f9')]=_0x477073[_0x8a26('0x1f9')]>0x0?_0x477073[_0x8a26('0x1f9')]:0x0;if(!utils[_0x8a26('0x1fc')](_0x5a8bf7)){_0x477073[_0x8a26('0x66')]=utils['CAMPAIGN_STATUS'][_0x8a26('0x67')];logger['info'](_0x8a26('0x1fd')+_0x477073[_0x8a26('0x41')]);}else{_0x477073[_0x8a26('0x78')]+=_0x5a8bf7[_0x8a26('0x92')];_0x477073[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x1fe')];for(var _0x385820=0x0;_0x385820<_0x5a8bf7[_0x8a26('0x92')];_0x385820+=0x1){_0x477073['ivrTotalCallsDays']+=0x1;if(_[_0x8a26('0xed')](_0x5a8bf7[_0x385820])||_[_0x8a26('0xed')](_0x5a8bf7[_0x385820][_0x8a26('0x173')])||_[_0x8a26('0xed')](_0x5a8bf7[_0x385820]['phone'])){_0x3c0cc2[_0x8a26('0x14f')](_0x8a26('0x1ff'),_0x477073,_0x5a8bf7[_0x385820]);}else{hopperUtils[_0x8a26('0x200')](_[_0x8a26('0xf1')](_0x5a8bf7[_0x385820],[_0x8a26('0xdb'),_0x8a26('0x15b')]))['then'](_0x3c0cc2[_0x8a26('0x1e6')](_0x477073,_0x5a8bf7[_0x385820]))['catch'](_0x3c0cc2[_0x8a26('0x201')](_0x8a26('0x202'),_0x477073));}}}})[_0x8a26('0x9a')](loggerGetContactDialer(_0x8a26('0x203'),_0x477073,_0x143031));}};Dialer[_0x8a26('0x16')][_0x8a26('0xac')]=function(_0x4c5275,_0x4eb310){var _0x54eb81=this;var _0x24f132=[];if(_0x4eb310<0x1||_0x4c5275[_0x8a26('0xab')]==='booked'){_0x4eb310=0x1;}var _0x268bf6=Math[_0x8a26('0x1c5')](_0x4c5275[_0x8a26('0x134')]*_0x4eb310)-_0x4c5275[_0x8a26('0x78')]-_0x4c5275[_0x8a26('0x1f9')];if(_0x4c5275['dialLimitQueue']>0x0){var _0x534e99=_0x4c5275['dialLimitQueue']-_0x4c5275['originated']-_0x4c5275[_0x8a26('0x136')]-_0x4c5275[_0x8a26('0x1f9')]-_0x4c5275['pTalking'];if(_0x268bf6>_0x534e99){_0x268bf6=_0x534e99;}}if(_0x268bf6>0x0){if(_0x4c5275[_0x8a26('0xab')]===_0x8a26('0xa')){_0x268bf6=0x1;}if(_0x268bf6>this[_0x8a26('0x1e')]){_0x268bf6=this[_0x8a26('0x1e')];}_0x4c5275[_0x8a26('0x1f9')]+=_0x268bf6;for(var _0x7c116d in this[_0x8a26('0x1c')]){if(typeof this['agents'][_0x7c116d]!==_0x8a26('0xa4')){if(this['agents'][_0x7c116d]['state']===_0x8a26('0x204')&&this[_0x8a26('0x1c')][_0x7c116d]['status']===_0x8a26('0x82')){_0x24f132[_0x8a26('0x9b')](this[_0x8a26('0x1c')][_0x7c116d]['id']);}}}hopperUtils['getContactDialer'](_0x4c5275,_0x24f132,_0x268bf6)[_0x8a26('0x3a')](function(_0x4172a4){_0x4c5275[_0x8a26('0x1f9')]-=_0x268bf6;_0x4c5275[_0x8a26('0x1f9')]=_0x4c5275[_0x8a26('0x1f9')]>0x0?_0x4c5275['temp']:0x0;if(!utils[_0x8a26('0x1fc')](_0x4172a4)){hopperUtils[_0x8a26('0x205')](_0x4c5275)[_0x8a26('0x3a')](sendMessageReschedule(_0x4c5275))[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x206')));}else{_0x4c5275['originated']+=_0x4172a4[_0x8a26('0x92')];_0x4c5275[_0x8a26('0x66')]=_0x4c5275[_0x8a26('0xab')]===_0x8a26('0xa')?utils[_0x8a26('0x63')][_0x8a26('0x138')]:utils[_0x8a26('0x63')][_0x8a26('0x1fe')];for(var _0x24b425=0x0;_0x24b425<_0x4172a4[_0x8a26('0x92')];_0x24b425+=0x1){if(_['isNil'](_0x4172a4[_0x24b425])||_[_0x8a26('0xed')](_0x4172a4[_0x24b425][_0x8a26('0x173')])||_[_0x8a26('0xed')](_0x4172a4[_0x24b425][_0x8a26('0x15b')])){_0x54eb81[_0x8a26('0x14f')]('[actionOriginate]\x20',_0x4c5275,_0x4172a4[_0x24b425]);}else{hopperUtils[_0x8a26('0x207')](_[_0x8a26('0xf1')](_0x4172a4[_0x24b425],[_0x8a26('0xda'),_0x8a26('0x15b')]))[_0x8a26('0x3a')](_0x54eb81[_0x8a26('0x1e6')](_0x4c5275,_0x4172a4[_0x24b425]))[_0x8a26('0x9a')](_0x54eb81[_0x8a26('0x201')](_0x8a26('0x1ff'),_0x4c5275));}}}})[_0x8a26('0x9a')](loggerGetContactDialer(_0x8a26('0x208'),_0x4c5275,_0x268bf6));}};Dialer[_0x8a26('0x16')][_0x8a26('0x5d')]=function(_0x31488d){if(_0x31488d[_0x8a26('0x209')]>0x0){var _0x3e04df=_0x31488d[_0x8a26('0x209')]-_0x31488d[_0x8a26('0x78')]-_0x31488d[_0x8a26('0x136')];if(_0x3e04df>0x0){this[_0x8a26('0x20a')](_0x31488d);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x8a26('0x20a')](_0x31488d);}};Dialer[_0x8a26('0x16')][_0x8a26('0x20a')]=function(_0x199b42){var _0x126396=this;var _0x2cc688=[];_0x199b42[_0x8a26('0x78')]+=0x1;for(var _0x21edca in this['agents']){if(typeof this[_0x8a26('0x1c')][_0x21edca]!==_0x8a26('0xa4')){if(this[_0x8a26('0x1c')][_0x21edca][_0x8a26('0x69')]===_0x8a26('0x204')&&this[_0x8a26('0x1c')][_0x21edca][_0x8a26('0x81')]===_0x8a26('0x82')){_0x2cc688[_0x8a26('0x9b')](this[_0x8a26('0x1c')][_0x21edca]['id']);}}}return this[_0x8a26('0x20b')](_0x199b42['id'],_0x2cc688,0x1,_0x199b42[_0x8a26('0x1fb')],_0x199b42)[_0x8a26('0x3a')](function(_0x2db54f){if(!utils['checkContactEmpty'](_0x2db54f)){utils[_0x8a26('0x61')](_0x199b42,0x1,0x0);return hopperUtils['countReScheduled'](_0x199b42)[_0x8a26('0x3a')](sendMessageReschedule(_0x199b42))[_0x8a26('0x9a')](loggerCatch(_0x8a26('0x206')));}else{_0x199b42[_0x8a26('0x66')]=utils[_0x8a26('0x63')][_0x8a26('0x1fe')];if(_[_0x8a26('0xed')](_0x2db54f[0x0])||_[_0x8a26('0xed')](_0x2db54f[0x0][_0x8a26('0x173')])||_[_0x8a26('0xed')](_0x2db54f[0x0][_0x8a26('0x15b')])){_0x126396[_0x8a26('0x14f')]('[actionOriginate]\x20',_0x199b42,_0x2db54f[0x0]);}else{return hopperUtils[_0x8a26('0x207')](_[_0x8a26('0xf1')](_0x2db54f[0x0],[_0x8a26('0xda'),'phone']))['then'](_0x126396[_0x8a26('0x1e6')](_0x199b42,_0x2db54f[0x0]))[_0x8a26('0x9a')](_0x126396['loggerHandler'](_0x8a26('0x20c'),_0x199b42));}}})[_0x8a26('0x9a')](loggerGetContactDialer(_0x8a26('0x20d'),_0x199b42,0x1));};Dialer[_0x8a26('0x16')][_0x8a26('0x1da')]=function(_0x3b974e,_0x3bd734,_0x110515,_0x335a81,_0x2afcdc,_0x465da2){loggerPredictive[_0x8a26('0x45')](_0x8a26('0x20e'));loggerPredictive['info'](_0x8a26('0x20f'),_0x3b974e);loggerPredictive[_0x8a26('0x45')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3bd734);loggerPredictive[_0x8a26('0x45')]('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',_0x110515);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x210'),_0x335a81);loggerPredictive[_0x8a26('0x45')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2afcdc);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x4f'));return new Promise(function(_0x527107,_0x42918f){if(_0x3b974e<=0x0||isNaN(_0x3b974e)){return _0x42918f(msgResponse(_0x8a26('0x211'),_0x8a26('0x7d'),_0x8a26('0x212')+_0x3b974e));}if(_0x110515<=0x0||isNaN(_0x110515)){return _0x42918f(msgResponse('[abandonmentRate]',_0x8a26('0x7d'),_0x8a26('0x213')+_0x110515));}if(_0x335a81<=0x0||isNaN(_0x335a81)){return _0x42918f(msgResponse(_0x8a26('0x211'),_0x8a26('0x7d'),_0x8a26('0x214')+_0x335a81));}if(_0x3bd734<=0x0||isNaN(_0x3bd734)){return _0x42918f(msgResponse('[abandonmentRate]',_0x8a26('0x7d'),'interval\x20=\x20'+_0x3bd734));}if(_0x2afcdc<=0x0||isNaN(_0x2afcdc)){return _0x42918f(msgResponse(_0x8a26('0x211'),_0x8a26('0x7d'),'Amax\x20=\x20'+_0x2afcdc));}_0x465da2=_0x465da2||0x0;var _0x33acde=0x1/_0x110515;var _0x3b6320=0x0;var _0x4038be=0x0;var _0x5973df=0x0;var _0x4d7d52=0x0;for(var _0xca5084=0x0;_0x5973df<_0x2afcdc;_0xca5084+=0x1){_0x4038be=_0xca5084/_0x3bd734;_0x3b6320=(_0x335a81*_0x4038be+_0x465da2)/_0x33acde;_0x5973df=utils['erlangb'](_0x3b6320,_0x3b974e);_0x4d7d52=_0x3b6320/_0x3b974e*(0x1-utils['erlangb'](_0x3b6320,_0x3b974e));}return _0x527107({'erlangCalls':_0xca5084,'erlangCallToSecond':_0x3bd734/_0xca5084,'erlangAbandonmentRate':_0x5973df,'erlangBusyFactor':_0x4d7d52});});};Dialer[_0x8a26('0x16')][_0x8a26('0x1e4')]=function(_0x1c676c,_0xb2959a,_0x273eef,_0x7397b9,_0x25eede,_0x524223){loggerPredictive[_0x8a26('0x45')](_0x8a26('0x215'));loggerPredictive[_0x8a26('0x45')](_0x8a26('0x20f'),_0x1c676c);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x216'),_0xb2959a);loggerPredictive['info'](_0x8a26('0x217'),_0x273eef);loggerPredictive[_0x8a26('0x45')](_0x8a26('0x210'),_0x7397b9);loggerPredictive['info'](_0x8a26('0x218'),_0x25eede);loggerPredictive['info'](_0x8a26('0x4f'));return new Promise(function(_0x31f65e,_0x264f03){if(_0x1c676c<=0x0||isNaN(_0x1c676c)){return _0x264f03(msgResponse(_0x8a26('0x219'),_0x8a26('0x7d'),_0x8a26('0x212')+_0x1c676c));}if(_0x273eef<=0x0||isNaN(_0x273eef)){return _0x264f03(msgResponse('[busyFactor]',_0x8a26('0x7d'),'Ts\x20=\x20'+_0x273eef));}if(_0x7397b9<=0x0||isNaN(_0x7397b9)){return _0x264f03(msgResponse(_0x8a26('0x219'),_0x8a26('0x7d'),'p\x20=\x20'+_0x7397b9));}if(_0xb2959a<=0x0||isNaN(_0xb2959a)){return _0x264f03(msgResponse('[busyFactor]',_0x8a26('0x7d'),_0x8a26('0x21a')+_0xb2959a));}if(_0x25eede<=0x0||isNaN(_0x25eede)){return _0x264f03(msgResponse(_0x8a26('0x219'),_0x8a26('0x7d'),_0x8a26('0x21b')+_0x25eede));}_0x524223=_0x524223||0x0;var _0x49fc93=0x1/_0x273eef;var _0x487162=0x0;var _0x497f26=0x0;var _0x19e45b=0x0;var _0x1f32e5=0x0;for(var _0x150789=0x0;_0x1f32e5<_0x25eede;_0x150789+=0x1){_0x497f26=_0x150789/_0xb2959a;_0x487162=(_0x7397b9*_0x497f26+_0x524223)/_0x49fc93;_0x19e45b=utils[_0x8a26('0x21c')](_0x487162,_0x1c676c);_0x1f32e5=_0x487162/_0x1c676c*(0x1-utils[_0x8a26('0x21c')](_0x487162,_0x1c676c));}return _0x31f65e({'erlangCalls':_0x150789,'erlangCallToSecond':_0xb2959a/_0x150789,'erlangAbandonmentRate':_0x19e45b,'erlangBusyFactor':_0x1f32e5});});};module['exports']=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 dbb583f..7e07608 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 _0x2dc7=['queue','exports','util','lodash','string','voiceQueue','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue'];(function(_0x41ac61,_0x3c267d){var _0x4efecc=function(_0x2c4391){while(--_0x2c4391){_0x41ac61['push'](_0x41ac61['shift']());}};_0x4efecc(++_0x3c267d);}(_0x2dc7,0xf2));var _0x72dc=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x2dc7[_0x2e913b];return _0x173899;};'use strict';var util=require(_0x72dc('0x0'));var _=require(_0x72dc('0x1'));var moment=require('moment');function checkNameSurname(_0x5bdc96,_0x4d1110,_0x2f445b){var _0x54ea8e='';if(!_['isNil'](_0x4d1110)&&_0x72dc('0x2')===typeof _0x4d1110){_0x54ea8e+=_0x4d1110;}if(!_['isNil'](_0x2f445b)&&_0x72dc('0x2')===typeof _0x2f445b){_0x54ea8e+='\x20'+_0x2f445b;}if(_0x54ea8e!==''){return _0x54ea8e;}return _0x5bdc96;}function Action(_0x451b5b,_0x281d36,_0xbe8803){this[_0x72dc('0x3')]=_0x451b5b;this['uniqueid']=_0xbe8803||undefined;this[_0x72dc('0x4')]=checkNameSurname(_0x281d36[_0x72dc('0x5')][_0x72dc('0x6')],_0x281d36[_0x72dc('0x5')][_0x72dc('0x7')],_0x281d36['Contact'][_0x72dc('0x8')]);this[_0x72dc('0x9')]=_0x281d36[_0x72dc('0x6')];this['queue']=_0x451b5b[_0x72dc('0x4')];this['active']=_0x281d36[_0x72dc('0xa')]||![];this[_0x72dc('0xb')]=_0x451b5b[_0x72dc('0xb')];this[_0x72dc('0xc')]=_0x451b5b[_0x72dc('0xc')]||0x3;this[_0x72dc('0xd')]=_0x281d36[_0x72dc('0xd')];this[_0x72dc('0xe')]=_0x281d36[_0x72dc('0xe')];this['countcongestionretry']=_0x281d36['countcongestionretry'];this[_0x72dc('0xf')]=_0x281d36[_0x72dc('0xf')];this[_0x72dc('0x10')]=_0x281d36[_0x72dc('0x10')];this[_0x72dc('0x11')]=_0x281d36['countdropretry'];this[_0x72dc('0x12')]=_0x281d36['countabandonedretry'];this['countmachineretry']=_0x281d36['countmachineretry'];this[_0x72dc('0x13')]=_0x281d36[_0x72dc('0x13')];this['ContactId']=_0x281d36[_0x72dc('0x14')];this[_0x72dc('0x15')]=_0x281d36['ListId'];this[_0x72dc('0x16')]=_0x281d36[_0x72dc('0x16')];this['VoiceQueueId']=_0x281d36[_0x72dc('0x17')];this['CampaignId']=_0x281d36[_0x72dc('0x18')];this[_0x72dc('0x19')]=_0x281d36['id'];this[_0x72dc('0x1a')]=_0x281d36[_0x72dc('0x5')][_0x72dc('0x7')]||'';this['starttime']=moment()[_0x72dc('0x1b')](_0x72dc('0x1c'));this[_0x72dc('0x1d')]=_0x281d36[_0x72dc('0x1d')];this[_0x72dc('0x1e')]=_0x281d36['callbackuniqueid'];this['callbackat']=_0x281d36['callbackat'];this[_0x72dc('0x1f')]=_0x281d36['recallme'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x72dc('0x20')][_0x72dc('0x21')]=function(){return util[_0x72dc('0x1b')](_0x72dc('0x22'),this[_0x72dc('0x4')],this['voiceQueue'][_0x72dc('0x23')]>0x0?this[_0x72dc('0x9')][_0x72dc('0x24')](this[_0x72dc('0x3')]['dialCutDigit']):this[_0x72dc('0x9')]);};Action['prototype'][_0x72dc('0x25')]=function(){return this[_0x72dc('0x26')];};module[_0x72dc('0x27')]=Action; \ No newline at end of file +var _0x73e0=['Contact','firstName','lastName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','lodash','moment','string','name'];(function(_0x3aff8a,_0x41febc){var _0x2686bc=function(_0x59e959){while(--_0x59e959){_0x3aff8a['push'](_0x3aff8a['shift']());}};_0x2686bc(++_0x41febc);}(_0x73e0,0x1a0));var _0x073e=function(_0x2122d7,_0xca3d55){_0x2122d7=_0x2122d7-0x0;var _0x546bd8=_0x73e0[_0x2122d7];return _0x546bd8;};'use strict';var util=require('util');var _=require(_0x073e('0x0'));var moment=require(_0x073e('0x1'));function checkNameSurname(_0x5bcb52,_0x54babc,_0x564c38){var _0x3ae0c6='';if(!_['isNil'](_0x54babc)&&_0x073e('0x2')===typeof _0x54babc){_0x3ae0c6+=_0x54babc;}if(!_['isNil'](_0x564c38)&&_0x073e('0x2')===typeof _0x564c38){_0x3ae0c6+='\x20'+_0x564c38;}if(_0x3ae0c6!==''){return _0x3ae0c6;}return _0x5bcb52;}function Action(_0x4b50c5,_0x5d7166,_0x368928){this['voiceQueue']=_0x4b50c5;this['uniqueid']=_0x368928||undefined;this[_0x073e('0x3')]=checkNameSurname(_0x5d7166[_0x073e('0x4')]['phone'],_0x5d7166[_0x073e('0x4')][_0x073e('0x5')],_0x5d7166[_0x073e('0x4')][_0x073e('0x6')]);this[_0x073e('0x7')]=_0x5d7166[_0x073e('0x8')];this['queue']=_0x4b50c5[_0x073e('0x3')];this[_0x073e('0x9')]=_0x5d7166[_0x073e('0x9')]||![];this[_0x073e('0xa')]=_0x4b50c5[_0x073e('0xa')];this['dialQueueTimeout']=_0x4b50c5[_0x073e('0xb')]||0x3;this[_0x073e('0xc')]=_0x5d7166['scheduledat'];this[_0x073e('0xd')]=_0x5d7166[_0x073e('0xd')];this[_0x073e('0xe')]=_0x5d7166[_0x073e('0xe')];this[_0x073e('0xf')]=_0x5d7166[_0x073e('0xf')];this[_0x073e('0x10')]=_0x5d7166[_0x073e('0x10')];this[_0x073e('0x11')]=_0x5d7166['countdropretry'];this[_0x073e('0x12')]=_0x5d7166[_0x073e('0x12')];this['countmachineretry']=_0x5d7166['countmachineretry'];this['countagentrejectretry']=_0x5d7166['countagentrejectretry'];this['ContactId']=_0x5d7166[_0x073e('0x13')];this[_0x073e('0x14')]=_0x5d7166['ListId'];this[_0x073e('0x15')]=_0x5d7166[_0x073e('0x15')];this[_0x073e('0x16')]=_0x5d7166[_0x073e('0x16')];this[_0x073e('0x17')]=_0x5d7166[_0x073e('0x17')];this[_0x073e('0x18')]=_0x5d7166['id'];this[_0x073e('0x19')]=_0x5d7166[_0x073e('0x4')][_0x073e('0x5')]||'';this[_0x073e('0x1a')]=moment()['format'](_0x073e('0x1b'));this[_0x073e('0x1c')]=_0x5d7166[_0x073e('0x1c')];this[_0x073e('0x1d')]=_0x5d7166[_0x073e('0x1d')];this[_0x073e('0x1e')]=_0x5d7166[_0x073e('0x1e')];this[_0x073e('0x1f')]=_0x5d7166[_0x073e('0x1f')];this['originatecalleridnum']='';this[_0x073e('0x20')]='';}Action[_0x073e('0x21')][_0x073e('0x22')]=function(){return util[_0x073e('0x23')](_0x073e('0x24'),this[_0x073e('0x3')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0x073e('0x25')](this['voiceQueue'][_0x073e('0x26')]):this[_0x073e('0x7')]);};Action['prototype'][_0x073e('0x27')]=function(){return this[_0x073e('0x28')];};module[_0x073e('0x29')]=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 a76f928..00241d1 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 _0x9eb6=['type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','statedesc','Answer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9eb6,0x7b));var _0x69eb=function(_0x304b67,_0x31cb39){_0x304b67=_0x304b67-0x0;var _0x493afb=_0x9eb6[_0x304b67];return _0x493afb;};'use strict';var moment=require('moment');var utils=require(_0x69eb('0x0'));function AgentComplete(_0x5f2e24,_0x4d71c8){this['state']=0x4;this[_0x69eb('0x1')]=_0x69eb('0x2');this['scheduledat']=_0x5f2e24['scheduledat'];this[_0x69eb('0x3')]=_0x5f2e24['type'];this[_0x69eb('0x4')]=_0x5f2e24[_0x69eb('0x3')]===_0x69eb('0x5')?_0x69eb('0x6'):_0x5f2e24['type'];this['countbusyretry']=_0x5f2e24['countbusyretry'];this['countcongestionretry']=_0x5f2e24[_0x69eb('0x7')];this[_0x69eb('0x8')]=_0x5f2e24[_0x69eb('0x8')];this[_0x69eb('0x9')]=_0x5f2e24['countbusyretry']+_0x5f2e24[_0x69eb('0x7')]+_0x5f2e24[_0x69eb('0x8')]+_0x5f2e24[_0x69eb('0xa')]+_0x5f2e24[_0x69eb('0xb')]+_0x5f2e24['countabandonedretry']+_0x5f2e24[_0x69eb('0xc')]+_0x5f2e24[_0x69eb('0xd')];this['countnosuchnumberretry']=_0x5f2e24[_0x69eb('0xa')];this[_0x69eb('0xb')]=_0x5f2e24[_0x69eb('0xb')];this['countabandonedretry']=_0x5f2e24[_0x69eb('0xe')];this[_0x69eb('0xc')]=_0x5f2e24['countmachineretry'];this[_0x69eb('0xd')]=_0x5f2e24[_0x69eb('0xd')];this[_0x69eb('0xf')]=_0x4d71c8[_0x69eb('0xf')];this[_0x69eb('0x10')]=_0x5f2e24[_0x69eb('0x11')];this[_0x69eb('0x12')]=_0x5f2e24[_0x69eb('0x13')];this[_0x69eb('0x14')]=_0x5f2e24[_0x69eb('0x14')];this[_0x69eb('0x15')]=_0x5f2e24[_0x69eb('0x15')];this[_0x69eb('0x16')]=_0x5f2e24[_0x69eb('0x16')];this[_0x69eb('0x17')]=moment()['format'](_0x69eb('0x18'));this['ringtime']=utils[_0x69eb('0x19')](_0x5f2e24[_0x69eb('0x15')],_0x5f2e24[_0x69eb('0x14')]);this[_0x69eb('0x1a')]=utils[_0x69eb('0x19')](_0x5f2e24[_0x69eb('0x16')],_0x5f2e24[_0x69eb('0x15')]);this[_0x69eb('0x1b')]=utils['getSeconds'](this[_0x69eb('0x17')],_0x5f2e24[_0x69eb('0x16')]);this['queue']=_0x4d71c8[_0x69eb('0x6')];this[_0x69eb('0x1c')]=_0x4d71c8[_0x69eb('0x1c')];this[_0x69eb('0x1d')]=_0x4d71c8[_0x69eb('0x1d')];this[_0x69eb('0x1e')]=_0x5f2e24[_0x69eb('0x1e')];this[_0x69eb('0x1f')]=_0x5f2e24[_0x69eb('0x1f')];this['callbackat']=_0x5f2e24['callbackat'];this[_0x69eb('0x20')]=_0x5f2e24[_0x69eb('0x20')];this[_0x69eb('0x21')]=_0x5f2e24[_0x69eb('0x21')];this[_0x69eb('0x22')]=_0x5f2e24[_0x69eb('0x22')];this['UserId']=_0x5f2e24[_0x69eb('0x23')];this[_0x69eb('0x24')]=_0x5f2e24[_0x69eb('0x24')];this['CampaignId']=_0x5f2e24[_0x69eb('0x25')];this[_0x69eb('0x26')]=_0x5f2e24[_0x69eb('0x26')]||'';this[_0x69eb('0x27')]=_0x5f2e24[_0x69eb('0x27')]||'';this[_0x69eb('0x28')]=_0x5f2e24[_0x69eb('0x28')];}module[_0x69eb('0x29')]=AgentComplete; \ No newline at end of file +var _0x3914=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','Answer','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x3914,0x10d));var _0x4391=function(_0x528497,_0x147e87){_0x528497=_0x528497-0x0;var _0x392d59=_0x3914[_0x528497];return _0x392d59;};'use strict';var moment=require(_0x4391('0x0'));var utils=require(_0x4391('0x1'));function AgentComplete(_0x7d7b1e,_0xde1823){this['state']=0x4;this[_0x4391('0x2')]=_0x4391('0x3');this['scheduledat']=_0x7d7b1e['scheduledat'];this[_0x4391('0x4')]=_0x7d7b1e[_0x4391('0x4')];this['campaigntype']=_0x7d7b1e['type']===_0x4391('0x5')?_0x4391('0x6'):_0x7d7b1e['type'];this[_0x4391('0x7')]=_0x7d7b1e[_0x4391('0x7')];this[_0x4391('0x8')]=_0x7d7b1e[_0x4391('0x8')];this[_0x4391('0x9')]=_0x7d7b1e[_0x4391('0x9')];this['countglobal']=_0x7d7b1e[_0x4391('0x7')]+_0x7d7b1e['countcongestionretry']+_0x7d7b1e[_0x4391('0x9')]+_0x7d7b1e[_0x4391('0xa')]+_0x7d7b1e[_0x4391('0xb')]+_0x7d7b1e[_0x4391('0xc')]+_0x7d7b1e[_0x4391('0xd')]+_0x7d7b1e[_0x4391('0xe')];this['countnosuchnumberretry']=_0x7d7b1e[_0x4391('0xa')];this[_0x4391('0xb')]=_0x7d7b1e['countdropretry'];this[_0x4391('0xc')]=_0x7d7b1e[_0x4391('0xc')];this['countmachineretry']=_0x7d7b1e[_0x4391('0xd')];this['countagentrejectretry']=_0x7d7b1e[_0x4391('0xe')];this[_0x4391('0xf')]=_0xde1823[_0x4391('0xf')];this[_0x4391('0x10')]=_0x7d7b1e['name'];this[_0x4391('0x11')]=_0x7d7b1e[_0x4391('0x12')];this[_0x4391('0x13')]=_0x7d7b1e[_0x4391('0x13')];this['responsetime']=_0x7d7b1e[_0x4391('0x14')];this[_0x4391('0x15')]=_0x7d7b1e['answertime'];this[_0x4391('0x16')]=moment()[_0x4391('0x17')](_0x4391('0x18'));this['ringtime']=utils[_0x4391('0x19')](_0x7d7b1e[_0x4391('0x14')],_0x7d7b1e['starttime']);this[_0x4391('0x1a')]=utils[_0x4391('0x19')](_0x7d7b1e[_0x4391('0x15')],_0x7d7b1e[_0x4391('0x14')]);this[_0x4391('0x1b')]=utils[_0x4391('0x19')](this[_0x4391('0x16')],_0x7d7b1e['answertime']);this[_0x4391('0x6')]=_0xde1823[_0x4391('0x6')];this[_0x4391('0x1c')]=_0xde1823[_0x4391('0x1c')];this[_0x4391('0x1d')]=_0xde1823[_0x4391('0x1d')];this['callback']=_0x7d7b1e[_0x4391('0x1e')];this[_0x4391('0x1f')]=_0x7d7b1e['callbackuniqueid'];this[_0x4391('0x20')]=_0x7d7b1e['callbackat'];this[_0x4391('0x21')]=_0x7d7b1e[_0x4391('0x21')];this[_0x4391('0x22')]=_0x7d7b1e[_0x4391('0x22')];this[_0x4391('0x23')]=_0x7d7b1e[_0x4391('0x23')];this[_0x4391('0x24')]=_0x7d7b1e[_0x4391('0x24')];this[_0x4391('0x25')]=_0x7d7b1e[_0x4391('0x25')];this[_0x4391('0x26')]=_0x7d7b1e[_0x4391('0x26')];this[_0x4391('0x27')]=_0x7d7b1e['originatecalleridnum']||'';this[_0x4391('0x28')]=_0x7d7b1e['originatecalleridname']||'';this[_0x4391('0x29')]=_0x7d7b1e[_0x4391('0x29')];}module[_0x4391('0x2a')]=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 b977c16..5958871 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 _0x8b08=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x368b13,_0x414275){var _0x38bbd4=function(_0x4c283f){while(--_0x4c283f){_0x368b13['push'](_0x368b13['shift']());}};_0x38bbd4(++_0x414275);}(_0x8b08,0x1dc));var _0x88b0=function(_0x2e4c83,_0x359f26){_0x2e4c83=_0x2e4c83-0x0;var _0x125bd2=_0x8b08[_0x2e4c83];return _0x125bd2;};'use strict';function Final(_0x2fbc31){this[_0x88b0('0x0')]=_0x2fbc31[_0x88b0('0x0')];this[_0x88b0('0x1')]=_0x2fbc31[_0x88b0('0x1')];this[_0x88b0('0x2')]=_0x2fbc31[_0x88b0('0x2')];this['campaigntype']=_0x2fbc31['type']===_0x88b0('0x3')?_0x88b0('0x4'):_0x2fbc31[_0x88b0('0x2')];this['countbusyretry']=_0x2fbc31[_0x88b0('0x5')];this[_0x88b0('0x6')]=_0x2fbc31[_0x88b0('0x6')];this['countnoanswerretry']=_0x2fbc31[_0x88b0('0x7')];this[_0x88b0('0x8')]=_0x2fbc31[_0x88b0('0x5')]+_0x2fbc31['countcongestionretry']+_0x2fbc31[_0x88b0('0x7')]+_0x2fbc31[_0x88b0('0x9')]+_0x2fbc31[_0x88b0('0xa')]+_0x2fbc31[_0x88b0('0xb')]+_0x2fbc31[_0x88b0('0xc')]+_0x2fbc31[_0x88b0('0xd')];this[_0x88b0('0x9')]=_0x2fbc31[_0x88b0('0x9')];this[_0x88b0('0xa')]=_0x2fbc31[_0x88b0('0xa')];this['countabandonedretry']=_0x2fbc31[_0x88b0('0xb')];this[_0x88b0('0xc')]=_0x2fbc31['countmachineretry'];this[_0x88b0('0xd')]=_0x2fbc31[_0x88b0('0xd')];this[_0x88b0('0x4')]=_0x2fbc31[_0x88b0('0x4')];this['calleridname']=_0x2fbc31[_0x88b0('0xe')];this[_0x88b0('0xf')]=_0x2fbc31[_0x88b0('0xf')];this[_0x88b0('0x10')]=_0x2fbc31['starttime'];this[_0x88b0('0x11')]=_0x2fbc31['responsetime'];this[_0x88b0('0x12')]=_0x2fbc31[_0x88b0('0x11')];this['ringtime']=_0x2fbc31[_0x88b0('0x13')]||0x0;this[_0x88b0('0x14')]=_0x2fbc31[_0x88b0('0x14')]||0x0;this['talktime']=_0x2fbc31[_0x88b0('0x15')]||0x0;this['callback']=_0x2fbc31[_0x88b0('0x16')];this['callbackuniqueid']=_0x2fbc31[_0x88b0('0x17')];this[_0x88b0('0x18')]=_0x2fbc31[_0x88b0('0x18')];this[_0x88b0('0x19')]=_0x2fbc31['recallme'];this[_0x88b0('0x1a')]=_0x2fbc31[_0x88b0('0x1a')];this['ListId']=_0x2fbc31[_0x88b0('0x1b')];this[_0x88b0('0x1c')]=_0x2fbc31[_0x88b0('0x1c')];this[_0x88b0('0x1d')]=_0x2fbc31[_0x88b0('0x1d')];this['CampaignId']=_0x2fbc31[_0x88b0('0x1e')];this['originatecalleridnum']=_0x2fbc31[_0x88b0('0x1f')]||'';this[_0x88b0('0x20')]=_0x2fbc31['originatecalleridname']||'';this['state']=_0x2fbc31[_0x88b0('0x21')];this[_0x88b0('0x22')]=_0x2fbc31[_0x88b0('0x22')];}module[_0x88b0('0x23')]=Final; \ No newline at end of file +var _0x4e6e=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','exports'];(function(_0x36e1c6,_0x77575f){var _0x5d014d=function(_0x13b598){while(--_0x13b598){_0x36e1c6['push'](_0x36e1c6['shift']());}};_0x5d014d(++_0x77575f);}(_0x4e6e,0x80));var _0xe4e6=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x4e6e[_0x46d0c9];return _0x174506;};'use strict';function Final(_0x411fa7){this['uniqueid']=_0x411fa7['uniqueid'];this[_0xe4e6('0x0')]=_0x411fa7[_0xe4e6('0x0')];this[_0xe4e6('0x1')]=_0x411fa7['type'];this[_0xe4e6('0x2')]=_0x411fa7['type']===_0xe4e6('0x3')?_0xe4e6('0x4'):_0x411fa7[_0xe4e6('0x1')];this[_0xe4e6('0x5')]=_0x411fa7[_0xe4e6('0x5')];this['countcongestionretry']=_0x411fa7['countcongestionretry'];this['countnoanswerretry']=_0x411fa7[_0xe4e6('0x6')];this[_0xe4e6('0x7')]=_0x411fa7[_0xe4e6('0x5')]+_0x411fa7['countcongestionretry']+_0x411fa7[_0xe4e6('0x6')]+_0x411fa7[_0xe4e6('0x8')]+_0x411fa7[_0xe4e6('0x9')]+_0x411fa7['countabandonedretry']+_0x411fa7[_0xe4e6('0xa')]+_0x411fa7[_0xe4e6('0xb')];this[_0xe4e6('0x8')]=_0x411fa7[_0xe4e6('0x8')];this[_0xe4e6('0x9')]=_0x411fa7[_0xe4e6('0x9')];this[_0xe4e6('0xc')]=_0x411fa7[_0xe4e6('0xc')];this[_0xe4e6('0xa')]=_0x411fa7[_0xe4e6('0xa')];this[_0xe4e6('0xb')]=_0x411fa7[_0xe4e6('0xb')];this[_0xe4e6('0x4')]=_0x411fa7[_0xe4e6('0x4')];this[_0xe4e6('0xd')]=_0x411fa7[_0xe4e6('0xd')];this['calleridnum']=_0x411fa7[_0xe4e6('0xe')];this[_0xe4e6('0xf')]=_0x411fa7['starttime'];this[_0xe4e6('0x10')]=_0x411fa7[_0xe4e6('0x10')];this[_0xe4e6('0x11')]=_0x411fa7['responsetime'];this[_0xe4e6('0x12')]=_0x411fa7[_0xe4e6('0x12')]||0x0;this[_0xe4e6('0x13')]=_0x411fa7[_0xe4e6('0x13')]||0x0;this['talktime']=_0x411fa7[_0xe4e6('0x14')]||0x0;this['callback']=_0x411fa7['callback'];this[_0xe4e6('0x15')]=_0x411fa7[_0xe4e6('0x15')];this[_0xe4e6('0x16')]=_0x411fa7[_0xe4e6('0x16')];this[_0xe4e6('0x17')]=_0x411fa7[_0xe4e6('0x17')];this['ContactId']=_0x411fa7[_0xe4e6('0x18')];this[_0xe4e6('0x19')]=_0x411fa7[_0xe4e6('0x19')];this[_0xe4e6('0x1a')]=_0x411fa7[_0xe4e6('0x1a')];this['VoiceQueueId']=_0x411fa7['VoiceQueueId'];this[_0xe4e6('0x1b')]=_0x411fa7['CampaignId'];this['originatecalleridnum']=_0x411fa7[_0xe4e6('0x1c')]||'';this[_0xe4e6('0x1d')]=_0x411fa7[_0xe4e6('0x1d')]||'';this[_0xe4e6('0x1e')]=_0x411fa7[_0xe4e6('0x1e')];this['statedesc']=_0x411fa7['statedesc'];}module[_0xe4e6('0x1f')]=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 6a4d636..41af247 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 _0x59ba=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','responsetime','holdtime','talktime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum'];(function(_0x31fa77,_0x46c87d){var _0x2a44d7=function(_0x291cbf){while(--_0x291cbf){_0x31fa77['push'](_0x31fa77['shift']());}};_0x2a44d7(++_0x46c87d);}(_0x59ba,0x6f));var _0xa59b=function(_0x80f553,_0x4c4a6c){_0x80f553=_0x80f553-0x0;var _0x5dacd2=_0x59ba[_0x80f553];return _0x5dacd2;};'use strict';var moment=require(_0xa59b('0x0'));var utils=require(_0xa59b('0x1'));function Hangup(_0x3f9fac,_0xb73125){this[_0xa59b('0x2')]=0x4;this['statedesc']='Answer';this[_0xa59b('0x3')]=_0x3f9fac['scheduledat'];this[_0xa59b('0x4')]=_0x3f9fac[_0xa59b('0x4')];this[_0xa59b('0x5')]=_0x3f9fac[_0xa59b('0x4')]===_0xa59b('0x6')?'queue':_0x3f9fac[_0xa59b('0x4')];this[_0xa59b('0x7')]=_0x3f9fac[_0xa59b('0x7')]||![];this[_0xa59b('0x8')]=_0x3f9fac[_0xa59b('0x8')];this[_0xa59b('0x9')]=_0x3f9fac[_0xa59b('0x9')];this[_0xa59b('0xa')]=_0x3f9fac[_0xa59b('0xa')];this[_0xa59b('0xb')]=_0x3f9fac['countbusyretry']+_0x3f9fac[_0xa59b('0x9')]+_0x3f9fac[_0xa59b('0xa')]+_0x3f9fac[_0xa59b('0xc')]+_0x3f9fac[_0xa59b('0xd')]+_0x3f9fac[_0xa59b('0xe')]+_0x3f9fac[_0xa59b('0xf')]+_0x3f9fac[_0xa59b('0x10')];this[_0xa59b('0xc')]=_0x3f9fac[_0xa59b('0xc')];this[_0xa59b('0xd')]=_0x3f9fac[_0xa59b('0xd')];this[_0xa59b('0xe')]=_0x3f9fac['countabandonedretry'];this['countmachineretry']=_0x3f9fac[_0xa59b('0xf')];this[_0xa59b('0x10')]=_0x3f9fac[_0xa59b('0x10')];this[_0xa59b('0x11')]=_0xb73125[_0xa59b('0x11')];this[_0xa59b('0x12')]=_0x3f9fac[_0xa59b('0x13')];this[_0xa59b('0x14')]=_0x3f9fac['number'];this[_0xa59b('0x15')]=_0x3f9fac[_0xa59b('0x15')];this['responsetime']=_0x3f9fac['responsetime'];this[_0xa59b('0x16')]=moment()[_0xa59b('0x17')](_0xa59b('0x18'));this[_0xa59b('0x19')]=utils[_0xa59b('0x1a')](_0x3f9fac[_0xa59b('0x1b')],_0x3f9fac[_0xa59b('0x15')]);this[_0xa59b('0x1c')]=0x0;this[_0xa59b('0x1d')]=utils[_0xa59b('0x1a')](this[_0xa59b('0x16')],_0x3f9fac[_0xa59b('0x1b')]);this[_0xa59b('0x1e')]=_0x3f9fac['queue'];this[_0xa59b('0x1f')]='IVR';this[_0xa59b('0x20')]=_0xb73125[_0xa59b('0x21')];this['callback']=_0x3f9fac[_0xa59b('0x22')];this[_0xa59b('0x23')]=_0x3f9fac[_0xa59b('0x23')];this[_0xa59b('0x24')]=_0x3f9fac[_0xa59b('0x24')];this[_0xa59b('0x25')]=_0x3f9fac[_0xa59b('0x25')];this[_0xa59b('0x26')]=_0x3f9fac['ContactId'];this['ListId']=_0x3f9fac[_0xa59b('0x27')];this[_0xa59b('0x28')]=_0x3f9fac[_0xa59b('0x28')];this[_0xa59b('0x29')]=_0x3f9fac['VoiceQueueId'];this[_0xa59b('0x2a')]=_0x3f9fac[_0xa59b('0x2a')];}module[_0xa59b('0x2b')]=Hangup; \ No newline at end of file +var _0xa35d=['responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa35d,0x15c));var _0xda35=function(_0x1dd6e7,_0x1cda2b){_0x1dd6e7=_0x1dd6e7-0x0;var _0xb53aa4=_0xa35d[_0x1dd6e7];return _0xb53aa4;};'use strict';var moment=require(_0xda35('0x0'));var utils=require(_0xda35('0x1'));function Hangup(_0x366f98,_0xaf8559){this[_0xda35('0x2')]=0x4;this[_0xda35('0x3')]='Answer';this[_0xda35('0x4')]=_0x366f98[_0xda35('0x4')];this[_0xda35('0x5')]=_0x366f98[_0xda35('0x5')];this['campaigntype']=_0x366f98[_0xda35('0x5')]===_0xda35('0x6')?'queue':_0x366f98[_0xda35('0x5')];this[_0xda35('0x7')]=_0x366f98[_0xda35('0x7')]||![];this[_0xda35('0x8')]=_0x366f98[_0xda35('0x8')];this['countcongestionretry']=_0x366f98['countcongestionretry'];this['countnoanswerretry']=_0x366f98[_0xda35('0x9')];this[_0xda35('0xa')]=_0x366f98['countbusyretry']+_0x366f98[_0xda35('0xb')]+_0x366f98[_0xda35('0x9')]+_0x366f98['countnosuchnumberretry']+_0x366f98[_0xda35('0xc')]+_0x366f98[_0xda35('0xd')]+_0x366f98[_0xda35('0xe')]+_0x366f98[_0xda35('0xf')];this['countnosuchnumberretry']=_0x366f98['countnosuchnumberretry'];this[_0xda35('0xc')]=_0x366f98[_0xda35('0xc')];this[_0xda35('0xd')]=_0x366f98[_0xda35('0xd')];this[_0xda35('0xe')]=_0x366f98[_0xda35('0xe')];this[_0xda35('0xf')]=_0x366f98['countagentrejectretry'];this[_0xda35('0x10')]=_0xaf8559[_0xda35('0x10')];this[_0xda35('0x11')]=_0x366f98[_0xda35('0x12')];this[_0xda35('0x13')]=_0x366f98['number'];this[_0xda35('0x14')]=_0x366f98['starttime'];this[_0xda35('0x15')]=_0x366f98['responsetime'];this[_0xda35('0x16')]=moment()['format'](_0xda35('0x17'));this['ringtime']=utils[_0xda35('0x18')](_0x366f98[_0xda35('0x15')],_0x366f98[_0xda35('0x14')]);this[_0xda35('0x19')]=0x0;this['talktime']=utils[_0xda35('0x18')](this['endtime'],_0x366f98[_0xda35('0x15')]);this['queue']=_0x366f98[_0xda35('0x1a')];this[_0xda35('0x1b')]=_0xda35('0x1c');this[_0xda35('0x1d')]=_0xaf8559[_0xda35('0x1e')];this[_0xda35('0x1f')]=_0x366f98[_0xda35('0x1f')];this[_0xda35('0x20')]=_0x366f98[_0xda35('0x20')];this['callbackat']=_0x366f98[_0xda35('0x21')];this['recallme']=_0x366f98[_0xda35('0x22')];this[_0xda35('0x23')]=_0x366f98[_0xda35('0x23')];this[_0xda35('0x24')]=_0x366f98[_0xda35('0x24')];this[_0xda35('0x25')]=_0x366f98['UserId'];this[_0xda35('0x26')]=_0x366f98[_0xda35('0x26')];this['CampaignId']=_0x366f98[_0xda35('0x27')];}module[_0xda35('0x28')]=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 b5689bf..bc0c718 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 _0xb208=['originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0xb208,0x76));var _0x8b20=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb208[_0x3e5086];return _0xfeb102;};'use strict';var utils=require(_0x8b20('0x0'));function History(_0xd7ce2){this[_0x8b20('0x1')]=_0xd7ce2[_0x8b20('0x1')];this[_0x8b20('0x2')]=_0xd7ce2[_0x8b20('0x2')]||undefined;this[_0x8b20('0x3')]=_0xd7ce2[_0x8b20('0x3')];this[_0x8b20('0x4')]=_0xd7ce2[_0x8b20('0x3')]===_0x8b20('0x5')?_0x8b20('0x6'):_0xd7ce2[_0x8b20('0x3')];this[_0x8b20('0x7')]=_0xd7ce2['countbusyretry'];this[_0x8b20('0x8')]=_0xd7ce2[_0x8b20('0x8')];this[_0x8b20('0x9')]=_0xd7ce2[_0x8b20('0x9')];this[_0x8b20('0xa')]=_0xd7ce2[_0x8b20('0x7')]+_0xd7ce2[_0x8b20('0x8')]+_0xd7ce2[_0x8b20('0x9')]+_0xd7ce2['countnosuchnumberretry']+_0xd7ce2[_0x8b20('0xb')]+_0xd7ce2[_0x8b20('0xc')]+_0xd7ce2[_0x8b20('0xd')]+_0xd7ce2[_0x8b20('0xe')];this['countnosuchnumberretry']=_0xd7ce2[_0x8b20('0xf')];this['countdropretry']=_0xd7ce2['countdropretry'];this[_0x8b20('0xc')]=_0xd7ce2[_0x8b20('0xc')];this['countmachineretry']=_0xd7ce2[_0x8b20('0xd')];this['countagentrejectretry']=_0xd7ce2[_0x8b20('0xe')];this['queue']=_0xd7ce2[_0x8b20('0x6')];this['calleridname']=_0xd7ce2[_0x8b20('0x10')];this[_0x8b20('0x11')]=_0xd7ce2[_0x8b20('0x12')];this['starttime']=_0xd7ce2[_0x8b20('0x13')];this[_0x8b20('0x14')]=_0xd7ce2[_0x8b20('0x14')];this[_0x8b20('0x15')]=_0xd7ce2[_0x8b20('0x14')];this[_0x8b20('0x16')]=utils[_0x8b20('0x17')](_0xd7ce2[_0x8b20('0x14')],_0xd7ce2[_0x8b20('0x13')]);this[_0x8b20('0x18')]=0x0;this[_0x8b20('0x19')]=0x0;this['callback']=_0xd7ce2['callback'];this['callbackuniqueid']=_0xd7ce2[_0x8b20('0x1a')];this[_0x8b20('0x1b')]=_0xd7ce2[_0x8b20('0x1b')];this[_0x8b20('0x1c')]=_0xd7ce2[_0x8b20('0x1c')];this[_0x8b20('0x1d')]=_0xd7ce2[_0x8b20('0x1d')];this[_0x8b20('0x1e')]=_0xd7ce2[_0x8b20('0x1e')];this[_0x8b20('0x1f')]=_0xd7ce2[_0x8b20('0x1f')];this[_0x8b20('0x20')]=_0xd7ce2['VoiceQueueId'];this[_0x8b20('0x21')]=_0xd7ce2[_0x8b20('0x21')];this['originatecalleridnum']=_0xd7ce2[_0x8b20('0x22')]||'';this[_0x8b20('0x23')]=_0xd7ce2[_0x8b20('0x23')]||'';this[_0x8b20('0x24')]=_0xd7ce2[_0x8b20('0x24')];this[_0x8b20('0x25')]=_0xd7ce2['statedesc'];}module['exports']=History; \ No newline at end of file +var _0x858f=['originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','number','responsetime','ringtime','getSeconds','starttime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x290d66,_0x1f9d6d){var _0x5393e8=function(_0x27b5a7){while(--_0x27b5a7){_0x290d66['push'](_0x290d66['shift']());}};_0x5393e8(++_0x1f9d6d);}(_0x858f,0x1c0));var _0xf858=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x858f[_0x26b5ff];return _0x58603e;};'use strict';var utils=require(_0xf858('0x0'));function History(_0x179bbc){this['uniqueid']=_0x179bbc[_0xf858('0x1')];this[_0xf858('0x2')]=_0x179bbc['scheduledat']||undefined;this[_0xf858('0x3')]=_0x179bbc['type'];this[_0xf858('0x4')]=_0x179bbc['type']==='outbound'?_0xf858('0x5'):_0x179bbc['type'];this[_0xf858('0x6')]=_0x179bbc['countbusyretry'];this['countcongestionretry']=_0x179bbc[_0xf858('0x7')];this[_0xf858('0x8')]=_0x179bbc['countnoanswerretry'];this[_0xf858('0x9')]=_0x179bbc[_0xf858('0x6')]+_0x179bbc['countcongestionretry']+_0x179bbc[_0xf858('0x8')]+_0x179bbc[_0xf858('0xa')]+_0x179bbc['countdropretry']+_0x179bbc[_0xf858('0xb')]+_0x179bbc[_0xf858('0xc')]+_0x179bbc[_0xf858('0xd')];this[_0xf858('0xa')]=_0x179bbc[_0xf858('0xa')];this[_0xf858('0xe')]=_0x179bbc['countdropretry'];this[_0xf858('0xb')]=_0x179bbc[_0xf858('0xb')];this[_0xf858('0xc')]=_0x179bbc[_0xf858('0xc')];this[_0xf858('0xd')]=_0x179bbc['countagentrejectretry'];this[_0xf858('0x5')]=_0x179bbc[_0xf858('0x5')];this[_0xf858('0xf')]=_0x179bbc[_0xf858('0x10')];this['calleridnum']=_0x179bbc[_0xf858('0x11')];this['starttime']=_0x179bbc['starttime'];this[_0xf858('0x12')]=_0x179bbc[_0xf858('0x12')];this['endtime']=_0x179bbc[_0xf858('0x12')];this[_0xf858('0x13')]=utils[_0xf858('0x14')](_0x179bbc[_0xf858('0x12')],_0x179bbc[_0xf858('0x15')]);this['holdtime']=0x0;this[_0xf858('0x16')]=0x0;this[_0xf858('0x17')]=_0x179bbc[_0xf858('0x17')];this[_0xf858('0x18')]=_0x179bbc[_0xf858('0x18')];this[_0xf858('0x19')]=_0x179bbc[_0xf858('0x19')];this[_0xf858('0x1a')]=_0x179bbc[_0xf858('0x1a')];this[_0xf858('0x1b')]=_0x179bbc['ContactId'];this[_0xf858('0x1c')]=_0x179bbc[_0xf858('0x1c')];this[_0xf858('0x1d')]=_0x179bbc[_0xf858('0x1d')];this[_0xf858('0x1e')]=_0x179bbc[_0xf858('0x1e')];this['CampaignId']=_0x179bbc[_0xf858('0x1f')];this[_0xf858('0x20')]=_0x179bbc[_0xf858('0x20')]||'';this[_0xf858('0x21')]=_0x179bbc[_0xf858('0x21')]||'';this[_0xf858('0x22')]=_0x179bbc[_0xf858('0x22')];this[_0xf858('0x23')]=_0x179bbc['statedesc'];}module[_0xf858('0x24')]=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 02b190e..ff9eae6 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 _0x6b55=['droptime','dropreason','endtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','agiafterat','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x24cfd0,_0x31a4f9){var _0x4f7a69=function(_0x2dd2ea){while(--_0x2dd2ea){_0x24cfd0['push'](_0x24cfd0['shift']());}};_0x4f7a69(++_0x31a4f9);}(_0x6b55,0x1ae));var _0x56b5=function(_0x3c42c8,_0x5a414b){_0x3c42c8=_0x3c42c8-0x0;var _0x1422a2=_0x6b55[_0x3c42c8];return _0x1422a2;};'use strict';var utils=require(_0x56b5('0x0'));function QueueCallerAbandon(_0x3e235d,_0x1912d3){this[_0x56b5('0x1')]=_0x3e235d[_0x56b5('0x1')];this[_0x56b5('0x2')]=_0x3e235d[_0x56b5('0x2')];this[_0x56b5('0x3')]=_0x3e235d[_0x56b5('0x2')]===_0x56b5('0x4')?_0x56b5('0x5'):_0x3e235d['type'];this[_0x56b5('0x6')]=_0x3e235d['countbusyretry'];this[_0x56b5('0x7')]=_0x3e235d[_0x56b5('0x7')];this[_0x56b5('0x8')]=_0x3e235d[_0x56b5('0x8')];this['countglobal']=_0x3e235d['countbusyretry']+_0x3e235d[_0x56b5('0x7')]+_0x3e235d[_0x56b5('0x8')]+_0x3e235d[_0x56b5('0x9')]+_0x3e235d[_0x56b5('0xa')]+_0x3e235d['countabandonedretry']+_0x3e235d[_0x56b5('0xb')]+_0x3e235d[_0x56b5('0xc')];this[_0x56b5('0x9')]=_0x3e235d[_0x56b5('0x9')];this[_0x56b5('0xa')]=_0x3e235d[_0x56b5('0xa')];this[_0x56b5('0xd')]=_0x3e235d['countabandonedretry'];this['countmachineretry']=_0x3e235d[_0x56b5('0xb')];this['countagentrejectretry']=_0x3e235d[_0x56b5('0xc')];this['uniqueid']=_0x1912d3[_0x56b5('0xe')];this[_0x56b5('0xf')]=_0x3e235d[_0x56b5('0x10')];this[_0x56b5('0x11')]=_0x3e235d[_0x56b5('0x12')];this[_0x56b5('0x13')]=_0x3e235d[_0x56b5('0x13')];this[_0x56b5('0x14')]=_0x3e235d[_0x56b5('0x14')];this[_0x56b5('0x15')]=_0x3e235d[_0x56b5('0x15')];this['dropreason']=_0x3e235d[_0x56b5('0x16')];this[_0x56b5('0x17')]=this[_0x56b5('0x15')];this['ringtime']=utils[_0x56b5('0x18')](_0x3e235d[_0x56b5('0x14')],_0x3e235d['starttime']);this[_0x56b5('0x19')]=utils['getSeconds'](this[_0x56b5('0x15')],_0x3e235d[_0x56b5('0x14')]);this[_0x56b5('0x1a')]=0x0;this['queue']=_0x1912d3[_0x56b5('0x5')];this[_0x56b5('0x1b')]=_0x1912d3[_0x56b5('0x1c')];this[_0x56b5('0x1d')]=_0x1912d3[_0x56b5('0x1d')];this[_0x56b5('0x1e')]=_0x3e235d[_0x56b5('0x1e')];this[_0x56b5('0x1f')]=_0x3e235d[_0x56b5('0x1f')];this[_0x56b5('0x20')]=_0x3e235d['callbackat'];this['recallme']=_0x3e235d['recallme'];this[_0x56b5('0x21')]=_0x3e235d[_0x56b5('0x21')];this[_0x56b5('0x22')]=_0x3e235d[_0x56b5('0x22')];this[_0x56b5('0x23')]=_0x3e235d[_0x56b5('0x23')];this[_0x56b5('0x24')]=_0x3e235d[_0x56b5('0x24')];this[_0x56b5('0x25')]=_0x3e235d['CampaignId'];this['originatecalleridnum']=_0x3e235d['originatecalleridnum']||'';this[_0x56b5('0x26')]=_0x3e235d[_0x56b5('0x26')]||'';this[_0x56b5('0x27')]=_0x3e235d[_0x56b5('0x27')];this['state']=_0x3e235d['state'];this['statedesc']=_0x3e235d['statedesc'];}module[_0x56b5('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xa9c1=['../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','getSeconds','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc'];(function(_0x4b1d30,_0x5965d5){var _0x5d7ae1=function(_0x337e64){while(--_0x337e64){_0x4b1d30['push'](_0x4b1d30['shift']());}};_0x5d7ae1(++_0x5965d5);}(_0xa9c1,0x1e0));var _0x1a9c=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xa9c1[_0x273c39];return _0x46d6b5;};'use strict';var utils=require(_0x1a9c('0x0'));function QueueCallerAbandon(_0xf58d9f,_0xb4bf1a){this[_0x1a9c('0x1')]=_0xf58d9f['scheduledat'];this[_0x1a9c('0x2')]=_0xf58d9f['type'];this[_0x1a9c('0x3')]=_0xf58d9f[_0x1a9c('0x2')]===_0x1a9c('0x4')?_0x1a9c('0x5'):_0xf58d9f[_0x1a9c('0x2')];this[_0x1a9c('0x6')]=_0xf58d9f[_0x1a9c('0x6')];this['countcongestionretry']=_0xf58d9f[_0x1a9c('0x7')];this[_0x1a9c('0x8')]=_0xf58d9f[_0x1a9c('0x8')];this[_0x1a9c('0x9')]=_0xf58d9f[_0x1a9c('0x6')]+_0xf58d9f[_0x1a9c('0x7')]+_0xf58d9f['countnoanswerretry']+_0xf58d9f['countnosuchnumberretry']+_0xf58d9f[_0x1a9c('0xa')]+_0xf58d9f['countabandonedretry']+_0xf58d9f[_0x1a9c('0xb')]+_0xf58d9f[_0x1a9c('0xc')];this[_0x1a9c('0xd')]=_0xf58d9f[_0x1a9c('0xd')];this[_0x1a9c('0xa')]=_0xf58d9f[_0x1a9c('0xa')];this[_0x1a9c('0xe')]=_0xf58d9f[_0x1a9c('0xe')];this[_0x1a9c('0xb')]=_0xf58d9f['countmachineretry'];this[_0x1a9c('0xc')]=_0xf58d9f[_0x1a9c('0xc')];this['uniqueid']=_0xb4bf1a['uniqueid'];this['calleridname']=_0xf58d9f['name'];this[_0x1a9c('0xf')]=_0xf58d9f[_0x1a9c('0x10')];this[_0x1a9c('0x11')]=_0xf58d9f[_0x1a9c('0x11')];this[_0x1a9c('0x12')]=_0xf58d9f[_0x1a9c('0x12')];this['droptime']=_0xf58d9f[_0x1a9c('0x13')];this['dropreason']=_0xf58d9f['dropreason'];this[_0x1a9c('0x14')]=this[_0x1a9c('0x13')];this[_0x1a9c('0x15')]=utils[_0x1a9c('0x16')](_0xf58d9f[_0x1a9c('0x12')],_0xf58d9f['starttime']);this['holdtime']=utils[_0x1a9c('0x16')](this[_0x1a9c('0x13')],_0xf58d9f['responsetime']);this['talktime']=0x0;this[_0x1a9c('0x5')]=_0xb4bf1a[_0x1a9c('0x5')];this[_0x1a9c('0x17')]=_0xb4bf1a[_0x1a9c('0x18')];this['reason']=_0xb4bf1a[_0x1a9c('0x19')];this[_0x1a9c('0x1a')]=_0xf58d9f[_0x1a9c('0x1a')];this[_0x1a9c('0x1b')]=_0xf58d9f[_0x1a9c('0x1b')];this['callbackat']=_0xf58d9f[_0x1a9c('0x1c')];this[_0x1a9c('0x1d')]=_0xf58d9f['recallme'];this[_0x1a9c('0x1e')]=_0xf58d9f[_0x1a9c('0x1e')];this['ListId']=_0xf58d9f[_0x1a9c('0x1f')];this[_0x1a9c('0x20')]=_0xf58d9f[_0x1a9c('0x20')];this[_0x1a9c('0x21')]=_0xf58d9f['VoiceQueueId'];this[_0x1a9c('0x22')]=_0xf58d9f[_0x1a9c('0x22')];this['originatecalleridnum']=_0xf58d9f[_0x1a9c('0x23')]||'';this[_0x1a9c('0x24')]=_0xf58d9f['originatecalleridname']||'';this['agiafterat']=_0xf58d9f[_0x1a9c('0x25')];this[_0x1a9c('0x26')]=_0xf58d9f['state'];this[_0x1a9c('0x27')]=_0xf58d9f['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 15ede58..f3c7a24 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 _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x4dade1,_0x37c457){var _0x2e91c3=function(_0x29bbe3){while(--_0x29bbe3){_0x4dade1['push'](_0x4dade1['shift']());}};_0x2e91c3(++_0x37c457);}(_0xb10b,0x12a));var _0xbb10=function(_0x3634d8,_0xbfa70b){_0x3634d8=_0x3634d8-0x0;var _0x2c1369=_0xb10b[_0x3634d8];return _0x2c1369;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x572018,_0x179543){var _0x46b508=function(_0x5cdd59){while(--_0x5cdd59){_0x572018['push'](_0x572018['shift']());}};_0x46b508(++_0x179543);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 42ae397..f71c96c 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 _0x4e39=['moment','util','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','type','ivr','isIVRCampaign','outbound','isOutboundQueue','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','lodash'];(function(_0x347487,_0x21861e){var _0x2627d0=function(_0x5a0f6d){while(--_0x5a0f6d){_0x347487['push'](_0x347487['shift']());}};_0x2627d0(++_0x21861e);}(_0x4e39,0xa5));var _0x94e3=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x4e39[_0x513f27];return _0xa316b7;};'use strict';var _=require(_0x94e3('0x0'));var moment=require(_0x94e3('0x1'));var util=require(_0x94e3('0x2'));var logger=require('../../../../config/logger')('dialer');var timezones=require(_0x94e3('0x3'))[_0x94e3('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x94e3('0x5'),'BLACKLIST':_0x94e3('0x6'),'CONTACTS_RESCHEDULED':_0x94e3('0x7'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x94e3('0x8'),'EMPTY_INTERVAL':_0x94e3('0x9'),'INACTIVE':_0x94e3('0xa'),'NO_AGENTS_LOGGED':_0x94e3('0xb'),'NO_AVAILABLE_CONTACTS':_0x94e3('0xc'),'NULL_INTERVAL':_0x94e3('0xd'),'OVERTIME_INTERVAL':_0x94e3('0xe'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x94e3('0xf'),'RECALL_TIMEOUT':_0x94e3('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x94e3('0x11'),'UNREACHABLE_TRUNK':_0x94e3('0x12')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1b1b1a){return _0x1b1b1a[_0x94e3('0x13')]===_0x94e3('0x14');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x2c275a){return _0x2c275a[_0x94e3('0x15')]===_0x94e3('0x16');}exports[_0x94e3('0x17')]=isIVRCampaign;function isOutboundQueue(_0x2b5598){return _0x2b5598[_0x94e3('0x15')]===_0x94e3('0x18');}exports[_0x94e3('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x44eb3d){return _0x44eb3d['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x402b46){return _0x402b46['active'];}exports[_0x94e3('0x1a')]=isIVRCampaignActive;function getSeconds(_0x4c5643,_0x13c857){var _0x5a535f=moment(_0x4c5643)[_0x94e3('0x1b')](0x0);var _0x4f45b9=moment(_0x13c857)[_0x94e3('0x1b')](0x0);return _0x5a535f[_0x94e3('0x1c')](_0x4f45b9,_0x94e3('0x1d'));}exports[_0x94e3('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x1b8911,_0x4f3ca8){var _0x341f33=![];var _0x3664cb=_0x1b8911['dialMethod']!==_0x4f3ca8[_0x94e3('0x13')]||_0x1b8911[_0x94e3('0x1f')]!==_0x4f3ca8[_0x94e3('0x1f')]||_0x1b8911[_0x94e3('0x20')]!==_0x4f3ca8['message'];var _0x492bd2=_0x1b8911[_0x94e3('0x21')]!==_0x4f3ca8[_0x94e3('0x21')]||_0x1b8911[_0x94e3('0x22')]!==_0x4f3ca8[_0x94e3('0x22')]||_0x1b8911['loggedInDb']!==_0x4f3ca8['loggedInDb']||_0x1b8911[_0x94e3('0x23')]!==_0x4f3ca8[_0x94e3('0x23')]||_0x1b8911[_0x94e3('0x24')]!==_0x4f3ca8['talking']||_0x1b8911[_0x94e3('0x25')]!==_0x4f3ca8[_0x94e3('0x25')]||_0x1b8911[_0x94e3('0x26')]!==_0x4f3ca8[_0x94e3('0x26')]||_0x1b8911[_0x94e3('0x27')]!==_0x4f3ca8[_0x94e3('0x27')]||_0x1b8911[_0x94e3('0x28')]!==_0x4f3ca8[_0x94e3('0x28')];if(_0x1b8911[_0x94e3('0x29')]&&_0x4f3ca8['Trunk']){_0x341f33=_0x1b8911[_0x94e3('0x29')]['name']!==_0x4f3ca8[_0x94e3('0x29')][_0x94e3('0x2a')]||_0x1b8911[_0x94e3('0x29')]['active']!==_0x4f3ca8[_0x94e3('0x29')][_0x94e3('0x2b')];}return _0x3664cb||_0x492bd2||_0x341f33;}exports[_0x94e3('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x277353){var _0x2426dd=null;var _0x5d2bad=_0x277353[_0x94e3('0x2d')];if(_[_0x94e3('0x2e')](_0x277353['dialGlobalInterval'])||_[_0x94e3('0x2e')](_0x277353['Interval'])||_[_0x94e3('0x2e')](_0x277353[_0x94e3('0x2f')][_0x94e3('0x30')])){_0x2426dd=CAMPAIGN_STATUS[_0x94e3('0x31')];}else if(_[_0x94e3('0x32')](_0x277353[_0x94e3('0x33')])||_[_0x94e3('0x32')](_0x277353[_0x94e3('0x2f')]['Intervals'])){_0x2426dd=CAMPAIGN_STATUS[_0x94e3('0x34')];}else if(_0x5d2bad&&!timezones[_0x5d2bad]){_0x2426dd=CAMPAIGN_STATUS[_0x94e3('0x35')];}return _0x2426dd;}function checkAnyValidTrunk(_0x3b48dc,_0x4f305c){var _0x2c9f7e=null;var _0x3f4d18=_0x94e3('0x36');var _0x499f70=[_0x94e3('0x37'),'unmonitored'];var _0x534058=!![];if(_0x3b48dc[_0x94e3('0x29')]&&_0x3b48dc[_0x94e3('0x29')][_0x94e3('0x2b')]){_0x3f4d18+=_0x3b48dc['Trunk'][_0x94e3('0x2a')];_0x2c9f7e=_0x4f305c[_0x3f4d18];_0x534058=_0x499f70[_0x94e3('0x38')](_0x2c9f7e[_0x94e3('0x39')]);}else if(_0x3b48dc['TrunkBackup']&&_0x3b48dc[_0x94e3('0x3a')][_0x94e3('0x2b')]){_0x3f4d18+=_0x3b48dc[_0x94e3('0x3a')]['name'];_0x2c9f7e=_0x4f305c[_0x3f4d18];_0x534058=_0x499f70[_0x94e3('0x38')](_0x2c9f7e[_0x94e3('0x39')]);}return _0x534058;}function getQueueCampaignStatusMessage(_0x171952,_0x2b74fc){var _0x5cd082=CAMPAIGN_STATUS['ACTIVE'];var _0x1e59d3=isPreviewCampaign(_0x171952);if(!isQueueCampaignActive(_0x171952)){if(_0x1e59d3){_0x5cd082=CAMPAIGN_STATUS[_0x94e3('0x3b')];}else{if(_0x171952[_0x94e3('0x28')]===0x0&&_0x171952[_0x94e3('0x24')]===0x0&&_0x171952[_0x94e3('0x26')]===0x0&&(_0x171952[_0x94e3('0x25')]||0x0)===0x0){_0x5cd082=CAMPAIGN_STATUS[_0x94e3('0x3b')];}else{_0x5cd082=CAMPAIGN_STATUS[_0x94e3('0x3c')];}}}else if(_0x171952[_0x94e3('0x22')]===0x0){_0x5cd082=CAMPAIGN_STATUS[_0x94e3('0x3d')];}else if(!checkAnyValidTrunk(_0x171952,_0x2b74fc)){_0x5cd082=CAMPAIGN_STATUS[_0x94e3('0x3e')];}else if(!isPreviewCampaign(_0x171952)){var _0x101e3a=checkAnyValidQueueCampaignInterval(_0x171952);if(_0x101e3a){_0x5cd082=_0x101e3a;}}return _0x5cd082;}exports[_0x94e3('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x373a47){var _0x4119f0=CAMPAIGN_STATUS[_0x94e3('0x3c')];if(_0x373a47['originated']===0x0&&_0x373a47[_0x94e3('0x24')]===0x0&&_0x373a47['waiting']===0x0&&(_0x373a47['pTalking']||0x0)===0x0){_0x4119f0=CAMPAIGN_STATUS[_0x94e3('0x3b')];}return _0x4119f0;}exports[_0x94e3('0x40')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x424fe3){var _0xe93272=_0x424fe3[_0x94e3('0x41')](/"(.*?)"/);return _0xe93272?_0xe93272[0x1]:_0x424fe3;}exports[_0x94e3('0x42')]=extractCalleridName;function getCallerId(_0x27101d,_0x1927d1,_0x36c730){if(!_[_0x94e3('0x43')](_0x36c730)&&typeof _0x36c730===_0x94e3('0x44')&&!_[_0x94e3('0x32')](_0x36c730)){if(!_[_0x94e3('0x43')](_0x1927d1)&&typeof _0x1927d1==='string'&&!_[_0x94e3('0x32')](_0x1927d1)){return util[_0x94e3('0x45')](_0x94e3('0x46'),_0x1927d1,_0x36c730);}return util[_0x94e3('0x45')](_0x94e3('0x46'),_0x36c730,_0x36c730);}if(!_['isUndefined'](_0x27101d)&&typeof _0x27101d==='string'&&!_[_0x94e3('0x32')](_0x27101d)){return _0x27101d;}return _0x94e3('0x47');}exports[_0x94e3('0x48')]=getCallerId;function getCallerIdRandom(_0x64fc5a,_0x34a281){var _0x5e2adc;var _0x3d7009;var _0x3f63ce;if(_0x34a281<=0x0){_0x34a281=0x1;}_0x5e2adc=new RegExp(_0x94e3('0x49')+_0x34a281+'}$');_0x3d7009=Math['pow'](0xa,_0x34a281-0x1);_0x3f63ce=Math[_0x94e3('0x4a')](0xa,_0x34a281)-0x1;return util['format']('%s',_[_0x94e3('0x4b')](_0x64fc5a,_0x5e2adc,_['random'](_0x3d7009,_0x3f63ce)[_0x94e3('0x4c')]()));}exports[_0x94e3('0x4d')]=getCallerIdRandom;function decrementOriginate(_0x549b04){if(_0x549b04['originated']&&_0x549b04['originated']>0x0){_0x549b04['originated']-=0x1;}else{logger['error'](_0x94e3('0x4e'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x2d0a61){return _0x2d0a61&&_0x2d0a61[_0x94e3('0x4f')]>0x0;}exports[_0x94e3('0x50')]=checkContactEmpty;function erlangb(_0x5e92cf,_0x48f772){if(_0x48f772===0x0){return 0x0;}var _0x5845be=0x1;for(var _0x5e7168=0x1;_0x5e7168<=_0x48f772;_0x5e7168+=0x1){_0x5845be=0x1+_0x5845be*_0x5e7168/_0x5e92cf;}return 0x1/_0x5845be;}exports[_0x94e3('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x1e884f,_0x43f409,_0x112a83){if(_0x43f409>_0x112a83){for(var _0x36cfd8=0x0;_0x36cfd8<_0x43f409-_0x112a83;_0x36cfd8+=0x1){decrementOriginate(_0x1e884f);}}}exports[_0x94e3('0x52')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0x312e=['Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','TrunkBackup','includes','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','toString','error','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','lodash','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','preview','isPreviewCampaign','type','ivr','isIVRCampaign','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','seconds','getSeconds','dialMethod','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval'];(function(_0x11d5d4,_0x25e7bb){var _0x49f3f8=function(_0x3d28ca){while(--_0x3d28ca){_0x11d5d4['push'](_0x11d5d4['shift']());}};_0x49f3f8(++_0x25e7bb);}(_0x312e,0xb3));var _0xe312=function(_0x3a1fd7,_0x482ff9){_0x3a1fd7=_0x3a1fd7-0x0;var _0x74d81f=_0x312e[_0x3a1fd7];return _0x74d81f;};'use strict';var _=require(_0xe312('0x0'));var moment=require('moment');var util=require(_0xe312('0x1'));var logger=require('../../../../config/logger')(_0xe312('0x2'));var timezones=require(_0xe312('0x3'))[_0xe312('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xe312('0x5'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0xe312('0x6'),'DEACTIVATED':_0xe312('0x7'),'DISACTIVED':_0xe312('0x8'),'EMPTY_INTERVAL':_0xe312('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0xe312('0xa'),'NO_AVAILABLE_CONTACTS':_0xe312('0xb'),'NULL_INTERVAL':_0xe312('0xc'),'OVERTIME_INTERVAL':_0xe312('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xe312('0xe'),'QUEUE_RECALL':_0xe312('0xf'),'RECALL_TIMEOUT':_0xe312('0x10'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xe312('0x11'),'UNREACHABLE_TRUNK':_0xe312('0x12')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x499d5a){return _0x499d5a['dialMethod']===_0xe312('0x13');}exports[_0xe312('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x115522){return _0x115522[_0xe312('0x15')]===_0xe312('0x16');}exports[_0xe312('0x17')]=isIVRCampaign;function isOutboundQueue(_0x51c4d9){return _0x51c4d9[_0xe312('0x15')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x210efb){return _0x210efb['dialActive'];}exports[_0xe312('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x11ca6e){return _0x11ca6e[_0xe312('0x19')];}exports[_0xe312('0x1a')]=isIVRCampaignActive;function getSeconds(_0x37aeec,_0x5818cd){var _0x34bd95=moment(_0x37aeec)[_0xe312('0x1b')](0x0);var _0x27592f=moment(_0x5818cd)[_0xe312('0x1b')](0x0);return _0x34bd95['diff'](_0x27592f,_0xe312('0x1c'));}exports[_0xe312('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x16907f,_0x4e1320){var _0x2eb258=![];var _0x458c66=_0x16907f[_0xe312('0x1e')]!==_0x4e1320[_0xe312('0x1e')]||_0x16907f[_0xe312('0x1f')]!==_0x4e1320[_0xe312('0x1f')]||_0x16907f[_0xe312('0x20')]!==_0x4e1320[_0xe312('0x20')];var _0xeb8caa=_0x16907f[_0xe312('0x21')]!==_0x4e1320[_0xe312('0x21')]||_0x16907f[_0xe312('0x22')]!==_0x4e1320[_0xe312('0x22')]||_0x16907f[_0xe312('0x23')]!==_0x4e1320['loggedInDb']||_0x16907f[_0xe312('0x24')]!==_0x4e1320[_0xe312('0x24')]||_0x16907f[_0xe312('0x25')]!==_0x4e1320['talking']||_0x16907f[_0xe312('0x26')]!==_0x4e1320[_0xe312('0x26')]||_0x16907f['waiting']!==_0x4e1320[_0xe312('0x27')]||_0x16907f[_0xe312('0x28')]!==_0x4e1320['inUse']||_0x16907f[_0xe312('0x29')]!==_0x4e1320[_0xe312('0x29')];if(_0x16907f['Trunk']&&_0x4e1320[_0xe312('0x2a')]){_0x2eb258=_0x16907f['Trunk']['name']!==_0x4e1320[_0xe312('0x2a')][_0xe312('0x2b')]||_0x16907f[_0xe312('0x2a')][_0xe312('0x19')]!==_0x4e1320['Trunk'][_0xe312('0x19')];}return _0x458c66||_0xeb8caa||_0x2eb258;}exports[_0xe312('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5283e2){var _0x19c1fa=null;var _0x1a8709=_0x5283e2[_0xe312('0x2d')];if(_[_0xe312('0x2e')](_0x5283e2[_0xe312('0x2f')])||_[_0xe312('0x2e')](_0x5283e2[_0xe312('0x30')])||_[_0xe312('0x2e')](_0x5283e2[_0xe312('0x30')][_0xe312('0x31')])){_0x19c1fa=CAMPAIGN_STATUS[_0xe312('0x32')];}else if(_[_0xe312('0x33')](_0x5283e2[_0xe312('0x2f')])||_[_0xe312('0x33')](_0x5283e2[_0xe312('0x30')]['Intervals'])){_0x19c1fa=CAMPAIGN_STATUS[_0xe312('0x34')];}else if(_0x1a8709&&!timezones[_0x1a8709]){_0x19c1fa=CAMPAIGN_STATUS[_0xe312('0x35')];}return _0x19c1fa;}function checkAnyValidTrunk(_0x11086b,_0x5b9c3c){var _0x2fb4d0=null;var _0x12866c=_0xe312('0x36');var _0x4a92a4=[_0xe312('0x37'),'unmonitored'];var _0x23da1a=!![];if(_0x11086b['Trunk']&&_0x11086b[_0xe312('0x2a')]['active']){_0x12866c+=_0x11086b['Trunk'][_0xe312('0x2b')];_0x2fb4d0=_0x5b9c3c[_0x12866c];_0x23da1a=_0x4a92a4['includes'](_0x2fb4d0['status']);}else if(_0x11086b[_0xe312('0x38')]&&_0x11086b['TrunkBackup'][_0xe312('0x19')]){_0x12866c+=_0x11086b['TrunkBackup'][_0xe312('0x2b')];_0x2fb4d0=_0x5b9c3c[_0x12866c];_0x23da1a=_0x4a92a4[_0xe312('0x39')](_0x2fb4d0['status']);}return _0x23da1a;}function getQueueCampaignStatusMessage(_0x248011,_0x53df4f){var _0x4da0f5=CAMPAIGN_STATUS[_0xe312('0x5')];var _0x547bf7=isPreviewCampaign(_0x248011);if(!isQueueCampaignActive(_0x248011)){if(_0x547bf7){_0x4da0f5=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x248011[_0xe312('0x29')]===0x0&&_0x248011[_0xe312('0x25')]===0x0&&_0x248011[_0xe312('0x27')]===0x0&&(_0x248011[_0xe312('0x26')]||0x0)===0x0){_0x4da0f5=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4da0f5=CAMPAIGN_STATUS[_0xe312('0x3a')];}}}else if(_0x248011['loggedIn']===0x0){_0x4da0f5=CAMPAIGN_STATUS[_0xe312('0x3b')];}else if(!checkAnyValidTrunk(_0x248011,_0x53df4f)){_0x4da0f5=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x248011)){var _0x436747=checkAnyValidQueueCampaignInterval(_0x248011);if(_0x436747){_0x4da0f5=_0x436747;}}return _0x4da0f5;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3902ef){var _0x451d27=CAMPAIGN_STATUS[_0xe312('0x3a')];if(_0x3902ef[_0xe312('0x29')]===0x0&&_0x3902ef[_0xe312('0x25')]===0x0&&_0x3902ef[_0xe312('0x27')]===0x0&&(_0x3902ef[_0xe312('0x26')]||0x0)===0x0){_0x451d27=CAMPAIGN_STATUS['INACTIVE'];}return _0x451d27;}exports[_0xe312('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4f94ea){var _0x5f2d7e=_0x4f94ea[_0xe312('0x3d')](/"(.*?)"/);return _0x5f2d7e?_0x5f2d7e[0x1]:_0x4f94ea;}exports[_0xe312('0x3e')]=extractCalleridName;function getCallerId(_0x4b41cb,_0x3c1748,_0x160085){if(!_[_0xe312('0x3f')](_0x160085)&&typeof _0x160085===_0xe312('0x40')&&!_[_0xe312('0x33')](_0x160085)){if(!_[_0xe312('0x3f')](_0x3c1748)&&typeof _0x3c1748===_0xe312('0x40')&&!_[_0xe312('0x33')](_0x3c1748)){return util[_0xe312('0x41')](_0xe312('0x42'),_0x3c1748,_0x160085);}return util[_0xe312('0x41')](_0xe312('0x42'),_0x160085,_0x160085);}if(!_[_0xe312('0x3f')](_0x4b41cb)&&typeof _0x4b41cb==='string'&&!_[_0xe312('0x33')](_0x4b41cb)){return _0x4b41cb;}return _0xe312('0x43');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x10e089,_0x5e9886){var _0x10c6be;var _0x162709;var _0x4e6488;if(_0x5e9886<=0x0){_0x5e9886=0x1;}_0x10c6be=new RegExp(_0xe312('0x44')+_0x5e9886+'}$');_0x162709=Math[_0xe312('0x45')](0xa,_0x5e9886-0x1);_0x4e6488=Math['pow'](0xa,_0x5e9886)-0x1;return util[_0xe312('0x41')]('%s',_['replace'](_0x10e089,_0x10c6be,_['random'](_0x162709,_0x4e6488)[_0xe312('0x46')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x2b7892){if(_0x2b7892[_0xe312('0x29')]&&_0x2b7892[_0xe312('0x29')]>0x0){_0x2b7892['originated']-=0x1;}else{logger[_0xe312('0x47')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xe312('0x48')]=decrementOriginate;function checkContactEmpty(_0x4fe94f){return _0x4fe94f&&_0x4fe94f[_0xe312('0x49')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x3fa242,_0x4baaad){if(_0x4baaad===0x0){return 0x0;}var _0x5b359d=0x1;for(var _0x5c5ccc=0x1;_0x5c5ccc<=_0x4baaad;_0x5c5ccc+=0x1){_0x5b359d=0x1+_0x5b359d*_0x5c5ccc/_0x3fa242;}return 0x1/_0x5b359d;}exports[_0xe312('0x4a')]=erlangb;function checkContactLowerLimitOriginate(_0x4a141d,_0x1c3cf0,_0x15d379){if(_0x1c3cf0>_0x15d379){for(var _0x37d431=0x0;_0x37d431<_0x1c3cf0-_0x15d379;_0x37d431+=0x1){decrementOriginate(_0x4a141d);}}}exports[_0xe312('0x4b')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ceab47a..3f709a2 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(_0x1b7219,_0x526de0){var _0x4cd8c0=function(_0x500abc){while(--_0x500abc){_0x1b7219['push'](_0x1b7219['shift']());}};_0x4cd8c0(++_0x526de0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x36d285,_0x1c3aaf){var _0x60719a=function(_0x3a3049){while(--_0x3a3049){_0x36d285['push'](_0x36d285['shift']());}};_0x60719a(++_0x1c3aaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 9c6480f..5d0e59d 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 _0xcd92=['pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','fax','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','exten','channels','uniqueid','channel','\x20syncNewchannel\x20','info','prototype','syncVarSet','variable','hasOwnProperty','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','application/pdf','then','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge'];(function(_0x3a4237,_0x3c9547){var _0x1936f3=function(_0x54cf96){while(--_0x54cf96){_0x3a4237['push'](_0x3a4237['shift']());}};_0x1936f3(++_0x3c9547);}(_0xcd92,0xb3));var _0x2cd9=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xcd92[_0x1deb03];return _0x189fe7;};'use strict';var util=require(_0x2cd9('0x0'));var _=require(_0x2cd9('0x1'));var BPromise=require(_0x2cd9('0x2'));var uuid=require(_0x2cd9('0x3'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x2cd9('0x4'));var gs=require(_0x2cd9('0x5'));var logger=require(_0x2cd9('0x6'))('fax');var ami=require('../ami');var rpcDb=require(_0x2cd9('0x7'));var Channel=require('./channel');var ut=require(_0x2cd9('0x8'));var Action=require(_0x2cd9('0x9'));var faxAccount=require(_0x2cd9('0xa'));var attachment=require(_0x2cd9('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2b76ec){this['channels']={};this[_0x2cd9('0xc')]=_0x2b76ec[_0x2cd9('0xc')];this['trunks']=_0x2b76ec[_0x2cd9('0xd')];this[_0x2cd9('0xe')]={};ami['on'](_0x2cd9('0xf'),this[_0x2cd9('0x10')][_0x2cd9('0x11')](this));ami['on'](_0x2cd9('0x12'),this['syncVarSet'][_0x2cd9('0x11')](this));ami['on'](_0x2cd9('0x13'),this[_0x2cd9('0x14')][_0x2cd9('0x11')](this));ami['on'](_0x2cd9('0x15'),this[_0x2cd9('0x16')][_0x2cd9('0x11')](this));ami['on'](_0x2cd9('0x17'),this[_0x2cd9('0x18')]['bind'](this));ami['on'](_0x2cd9('0x19'),this['syncReceiveFax'][_0x2cd9('0x11')](this));ami['on'](_0x2cd9('0x1a'),this[_0x2cd9('0x1b')][_0x2cd9('0x11')](this));ami['on'](_0x2cd9('0x1c'),this[_0x2cd9('0x1d')]['bind'](this));}Fax['prototype'][_0x2cd9('0x10')]=function(_0x4024aa){if(_0x4024aa['context']===_0x2cd9('0x1e')){for(var _0x41657e in this[_0x2cd9('0xc')]){if(this[_0x2cd9('0xc')]['hasOwnProperty'](_0x41657e)){if(_0x4024aa[_0x2cd9('0x1f')]===this[_0x2cd9('0xc')][_0x41657e]['localstationid']){this[_0x2cd9('0x20')][_0x4024aa[_0x2cd9('0x21')]]={};this[_0x2cd9('0x20')][_0x4024aa[_0x2cd9('0x21')]][_0x2cd9('0x22')]=_0x4024aa[_0x2cd9('0x22')];this[_0x2cd9('0x20')][_0x4024aa[_0x2cd9('0x21')]]['id']=this['faxAccounts'][_0x41657e]['id'];this[_0x2cd9('0x20')][_0x4024aa['uniqueid']]['name']=this['faxAccounts'][_0x41657e]['name'];logger['info'](_0x4024aa[_0x2cd9('0x21')],_0x2cd9('0x23'));}}}}if(this['actions'][_0x4024aa[_0x2cd9('0x21')]]){this[_0x2cd9('0x20')][_0x4024aa[_0x2cd9('0x21')]]={};this[_0x2cd9('0x20')][_0x4024aa[_0x2cd9('0x21')]][_0x2cd9('0x22')]=_0x4024aa[_0x2cd9('0x22')];logger[_0x2cd9('0x24')](_0x4024aa[_0x2cd9('0x21')],_0x2cd9('0x23'));}};Fax[_0x2cd9('0x25')][_0x2cd9('0x26')]=function(_0x33fbe1){if(this['channels'][_0x33fbe1['uniqueid']]){for(var _0x28b4c7 in _0x33fbe1['variable']){if(_0x33fbe1[_0x2cd9('0x27')][_0x2cd9('0x28')](_0x28b4c7)){this['channels'][_0x33fbe1['uniqueid']][_0x28b4c7]=_0x33fbe1['value'];}}}};Fax['prototype']['syncNewState']=function(_0x5c9d47){if(this['channels'][_0x5c9d47[_0x2cd9('0x21')]]){this['channels'][_0x5c9d47[_0x2cd9('0x21')]][_0x2cd9('0x29')]=_0x5c9d47[_0x2cd9('0x29')];this[_0x2cd9('0x20')][_0x5c9d47['uniqueid']]['channelstatedesc']=_0x5c9d47[_0x2cd9('0x2a')];}};Fax[_0x2cd9('0x25')][_0x2cd9('0x16')]=function(_0x4b5f51){if(this[_0x2cd9('0x20')][_0x4b5f51[_0x2cd9('0x21')]]){for(var _0x55f4c6 in _0x4b5f51['variable']){if(_0x4b5f51['variable'][_0x2cd9('0x28')](_0x55f4c6)){this[_0x2cd9('0x20')][_0x4b5f51['uniqueid']][_0x55f4c6]=_0x4b5f51[_0x2cd9('0x2b')];}}}};Fax[_0x2cd9('0x25')]['syncFaxStatus']=function(_0x9cd9b){if(this[_0x2cd9('0x20')][_0x9cd9b[_0x2cd9('0x21')]]){this[_0x2cd9('0x20')][_0x9cd9b['uniqueid']][_0x2cd9('0x2c')]=_0x9cd9b[_0x2cd9('0x2c')];this[_0x2cd9('0x20')][_0x9cd9b[_0x2cd9('0x21')]][_0x2cd9('0x2d')]=_0x9cd9b[_0x2cd9('0x2d')];this[_0x2cd9('0x20')][_0x9cd9b['uniqueid']][_0x2cd9('0x2e')]=_0x9cd9b[_0x2cd9('0x2e')];this[_0x2cd9('0x20')][_0x9cd9b[_0x2cd9('0x21')]][_0x2cd9('0x2f')]=_0x9cd9b[_0x2cd9('0x2f')];logger[_0x2cd9('0x24')](_0x9cd9b[_0x2cd9('0x21')],_0x2cd9('0x30'));}};Fax[_0x2cd9('0x25')][_0x2cd9('0x31')]=function(_0x6e9d3d){var _0x312234=this;if(this['channels'][_0x6e9d3d[_0x2cd9('0x21')]]){var _0x15643b=this[_0x2cd9('0x20')][_0x6e9d3d[_0x2cd9('0x21')]]['id'];this['channels'][_0x6e9d3d[_0x2cd9('0x21')]]['remotestationid']=_0x6e9d3d[_0x2cd9('0x32')];this[_0x2cd9('0x20')][_0x6e9d3d[_0x2cd9('0x21')]][_0x2cd9('0x33')]=_0x6e9d3d[_0x2cd9('0x33')];this[_0x2cd9('0x20')][_0x6e9d3d[_0x2cd9('0x21')]]['localstationid']=_0x6e9d3d['localstationid'];this[_0x2cd9('0x20')][_0x6e9d3d['uniqueid']][_0x2cd9('0x34')]=_0x6e9d3d['resolution'];this[_0x2cd9('0x20')][_0x6e9d3d[_0x2cd9('0x21')]]['transferrate']=_0x6e9d3d[_0x2cd9('0x35')];this[_0x2cd9('0x20')][_0x6e9d3d[_0x2cd9('0x21')]][_0x2cd9('0x2f')]=_0x6e9d3d[_0x2cd9('0x2f')];this['channels'][_0x6e9d3d['uniqueid']][_0x2cd9('0x36')]=_0x6e9d3d[_0x2cd9('0x36')];if(this[_0x2cd9('0x20')][_0x6e9d3d[_0x2cd9('0x21')]][_0x2cd9('0x33')]>0x0){tiff2pdf(_0x6e9d3d[_0x2cd9('0x2f')],_0x2cd9('0x37'),function(_0x1fede4){logger[_0x2cd9('0x24')](_0x6e9d3d[_0x2cd9('0x21')],_0x2cd9('0x38'),_0x1fede4[_0x2cd9('0x39')]);attachment[_0x2cd9('0x3a')]({'name':path[_0x2cd9('0x3b')](_0x6e9d3d[_0x2cd9('0x2f')])[_0x2cd9('0x3c')],'basename':path[_0x2cd9('0x3b')](_0x6e9d3d[_0x2cd9('0x2f')])['name']+_0x2cd9('0x3d'),'type':_0x2cd9('0x3e')})[_0x2cd9('0x3f')](function(_0x13be37){faxAccount['notify'](_0x15643b,{'from':_0x6e9d3d[_0x2cd9('0x36')],'mapKey':'fax','body':path[_0x2cd9('0x3b')](_0x6e9d3d['filename'])[_0x2cd9('0x3c')]+'.pdf','AttachmentId':_0x13be37['id']})['catch'](function(_0x48782b){logger[_0x2cd9('0x40')](_0x6e9d3d[_0x2cd9('0x21')],_0x2cd9('0x41'),JSON['stringify'](_0x48782b));});})['catch'](function(_0x1b70a9){logger[_0x2cd9('0x40')](_0x6e9d3d[_0x2cd9('0x21')],_0x2cd9('0x42'),JSON[_0x2cd9('0x43')](_0x1b70a9));});});}logger[_0x2cd9('0x24')](_0x6e9d3d[_0x2cd9('0x21')],_0x2cd9('0x42'));}};Fax['prototype']['syncOriginateResponse']=function(_0x25b51d){if(this[_0x2cd9('0xe')][_0x25b51d[_0x2cd9('0x21')]]){_[_0x2cd9('0x44')](this[_0x2cd9('0x20')][_0x25b51d[_0x2cd9('0x21')]],_[_0x2cd9('0x45')](_0x25b51d,[_0x2cd9('0x46'),_0x2cd9('0x47')]));}};function updateStatus(_0x161dfa){if(_0x161dfa['AttachmentId']){faxMessage[_0x2cd9('0x48')](_0x161dfa[_0x2cd9('0x49')],{'failMessage':_0x2cd9('0x4a')})[_0x2cd9('0x3f')](function(_0x1e30e2){ut[_0x2cd9('0x4b')](_0x2cd9('0x4c'),_0x1e30e2);})[_0x2cd9('0x4d')](function(_0x129e5a){ut[_0x2cd9('0x4b')](_0x2cd9('0x4e'),_0x129e5a);});}else{ut[_0x2cd9('0x4b')](_0x2cd9('0x4f'));}}Fax[_0x2cd9('0x25')][_0x2cd9('0x50')]=function(_0x22b65a,_0x459a8c,_0x723b1a){var _0x3923b9=this;var _0x1a278e={};if(_0x459a8c){_0x1a278e={'read':_0x459a8c};}else{_0x1a278e={'failMessage':_0x723b1a};}if(this[_0x2cd9('0xe')][_0x22b65a][_0x2cd9('0x49')]){faxMessage[_0x2cd9('0x48')](this[_0x2cd9('0xe')][_0x22b65a][_0x2cd9('0x49')],_0x1a278e)[_0x2cd9('0x3f')](function(_0x467ce8){ut[_0x2cd9('0x4b')](_0x2cd9('0x51'),_0x467ce8);})[_0x2cd9('0x4d')](function(_0x173582){ut[_0x2cd9('0x4b')](_0x2cd9('0x52'),_0x173582);})[_0x2cd9('0x53')](function(){delete _0x3923b9['channels'][_0x22b65a];delete _0x3923b9[_0x2cd9('0xe')][_0x22b65a];});}else{ut[_0x2cd9('0x4b')](_0x2cd9('0x54'));delete this[_0x2cd9('0x20')][_0x22b65a];delete this['actions'][_0x22b65a];}};Fax[_0x2cd9('0x25')][_0x2cd9('0x1b')]=function(_0x3c2715){var _0x2a127a=this;if(this['channels'][_0x3c2715[_0x2cd9('0x21')]]){if(this[_0x2cd9('0xe')][_0x3c2715[_0x2cd9('0x21')]]){this['channels'][_0x3c2715['uniqueid']]['id']=this[_0x2cd9('0xe')][_0x3c2715['uniqueid']]['id'];this[_0x2cd9('0x20')][_0x3c2715[_0x2cd9('0x21')]][_0x2cd9('0x3c')]=this[_0x2cd9('0xe')][_0x3c2715[_0x2cd9('0x21')]]['name'];}logger[_0x2cd9('0x24')](_0x3c2715['uniqueid'],this[_0x2cd9('0xe')][_0x3c2715[_0x2cd9('0x21')]]?_0x2cd9('0x55'):_0x2cd9('0x56'),JSON['stringify'](this[_0x2cd9('0x20')][_0x3c2715[_0x2cd9('0x21')]]));if(this['actions'][_0x3c2715[_0x2cd9('0x21')]]){if(this[_0x2cd9('0x20')][_0x3c2715[_0x2cd9('0x21')]][_0x2cd9('0x57')]>0x0&&this[_0x2cd9('0x20')][_0x3c2715['uniqueid']][_0x2cd9('0x17')]===_0x2cd9('0x58')){this['updateStatus'](_0x3c2715[_0x2cd9('0x21')],!![]);}else{this[_0x2cd9('0x50')](_0x3c2715[_0x2cd9('0x21')],![],this[_0x2cd9('0x20')][_0x3c2715[_0x2cd9('0x21')]][_0x2cd9('0x59')]?_0x2cd9('0x5a')+this['channels'][_0x3c2715[_0x2cd9('0x21')]][_0x2cd9('0x59')]:_0x2cd9('0x5b'));}}}};Fax[_0x2cd9('0x25')][_0x2cd9('0x5c')]=function(_0x46583f){var _0x9a9240=this;return new BPromise(function(_0x2cf6a5,_0x520930){_0x9a9240['execOriginate'](_0x46583f,_0x9a9240[_0x2cd9('0xc')][_0x46583f[_0x2cd9('0x5d')]])['then'](function(_0x53b1de){ut['logger'](_0x2cd9('0x5e'),_0x53b1de);_0x2cf6a5(ut[_0x2cd9('0x39')](_0x2cd9('0x5f')));})[_0x2cd9('0x4d')](function(_0x168864){ut[_0x2cd9('0x4b')]('[Fax][execOriginate][failure]',_0x168864);updateStatus(_0x46583f);_0x520930(ut[_0x2cd9('0x39')](_0x2cd9('0x60')));});});};Fax[_0x2cd9('0x25')]['checkAfterSend']=function(_0x4fa3ba){var _0x4bb555=this;return new BPromise(function(_0x2b4a58,_0x4fa9d4){var _0x1ed234=_0x4bb555['checkTrunk'](_0x4bb555[_0x2cd9('0xc')][_0x4fa3ba[_0x2cd9('0x5d')]][_0x2cd9('0x61')],_0x4fa3ba);if(_0x1ed234['isValid']){_0x2b4a58(ut[_0x2cd9('0x39')]('Trunk\x20Reachable'));}else{_0x4fa9d4(ut[_0x2cd9('0x39')](_0x1ed234[_0x2cd9('0x39')]));}});};function originate(_0x4b0422,_0x1f0250,_0x4c033b){return new BPromise(function(_0x408e16,_0x1625cc){if(_0x4c033b){var _0x1ed3e8=util[_0x2cd9('0x62')](_0x2cd9('0x63'),path[_0x2cd9('0x3b')](_0x4b0422[_0x2cd9('0x64')])[_0x2cd9('0x3c')],_0x4b0422[_0x2cd9('0x64')]);gs['execute'](_0x1ed3e8)[_0x2cd9('0x3f')](function(){_0x4b0422['path']=util[_0x2cd9('0x62')](_0x2cd9('0x65'),path[_0x2cd9('0x3b')](_0x4b0422[_0x2cd9('0x64')])[_0x2cd9('0x66')],path[_0x2cd9('0x3b')](_0x4b0422[_0x2cd9('0x64')])['name']);_0x1f0250[_0x2cd9('0x67')]=_0x4b0422[_0x2cd9('0x64')];ut[_0x2cd9('0x4b')]('Convert\x20pdf\x20to\x20tif','');ami[_0x2cd9('0x68')](ut[_0x2cd9('0x69')](_0x4b0422,_0x1f0250))[_0x2cd9('0x3f')](function(_0x21b30){_0x408e16(_0x21b30);})['catch'](function(_0x1cd166){_0x1625cc(_0x1cd166);});})[_0x2cd9('0x4d')](function(_0x49154d){_0x1625cc(_0x49154d);});}else{ami[_0x2cd9('0x68')](ut[_0x2cd9('0x69')](_0x4b0422,_0x1f0250))[_0x2cd9('0x3f')](function(_0x5e152b){_0x408e16(_0x5e152b);})[_0x2cd9('0x4d')](function(_0x50a62e){_0x1625cc(_0x50a62e);});}});}Fax['prototype'][_0x2cd9('0x6a')]=function(_0x4c5782,_0x3cef52){var _0x2907b6=this;return new BPromise(function(_0x21afd6,_0x5dd918){var _0x1bbdee=uuid['v4']();var _0x31c760=ut[_0x2cd9('0x6b')](_0x4c5782,_0x3cef52);_0x2907b6[_0x2cd9('0xe')][_0x1bbdee]=new Action(_0x1bbdee,_0x3cef52,_0x4c5782);var _0x29cdf0=_0x2907b6[_0x2cd9('0xe')][_0x1bbdee];if(path[_0x2cd9('0x3b')](_0x4c5782['path'])[_0x2cd9('0x6c')]===_0x2cd9('0x3d')){originate(_0x29cdf0,_0x31c760,!![])['then'](function(_0x393ffe){_0x21afd6(_0x393ffe);})['catch'](function(_0x39f517){_0x5dd918(_0x39f517);});}else{originate(_0x29cdf0,_0x31c760,![])['then'](function(_0x2480c5){_0x21afd6(_0x2480c5);})[_0x2cd9('0x4d')](function(_0x2ab102){_0x5dd918(_0x2ab102);});}});};Fax[_0x2cd9('0x25')][_0x2cd9('0x6d')]=function(_0x1b11d0){return!_[_0x2cd9('0x6e')](_0x1b11d0)&&!_[_0x2cd9('0x6e')](_0x1b11d0[_0x2cd9('0x3c')])&&!_[_0x2cd9('0x6e')](_0x1b11d0[_0x2cd9('0x6f')])&&_0x1b11d0['active']&&!_[_0x2cd9('0x6e')](this[_0x2cd9('0xd')][util[_0x2cd9('0x62')](_0x2cd9('0x70'),_0x1b11d0[_0x2cd9('0x3c')])])&&!_[_0x2cd9('0x6e')](this[_0x2cd9('0xd')][util['format']('SIP/%s',_0x1b11d0['name'])][_0x2cd9('0x2d')])&&(this['trunks'][util[_0x2cd9('0x62')](_0x2cd9('0x70'),_0x1b11d0[_0x2cd9('0x3c')])][_0x2cd9('0x2d')]===_0x2cd9('0x71')||this['trunks'][util[_0x2cd9('0x62')](_0x2cd9('0x70'),_0x1b11d0[_0x2cd9('0x3c')])]['status']===_0x2cd9('0x72'));};Fax[_0x2cd9('0x25')]['checkTrunk']=function(_0x34d8a8,_0x1d85d8){if(!this[_0x2cd9('0x6d')](_0x34d8a8)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_['isNil'](_0x34d8a8)?'':_0x34d8a8['name']+_0x2cd9('0x73'));return{'isValid':![],'message':_0x2cd9('0x74')};}if(_['isNil'](_0x1d85d8[_0x2cd9('0x75')])){ut[_0x2cd9('0x4b')](_0x2cd9('0x76'),JSON[_0x2cd9('0x43')](_0x1d85d8));return{'isValid':![],'message':_0x2cd9('0x77')};}if(_['isNil'](_0x1d85d8[_0x2cd9('0x64')])){ut[_0x2cd9('0x4b')](_0x2cd9('0x78'),JSON[_0x2cd9('0x43')](_0x1d85d8));return{'isValid':![],'message':_0x2cd9('0x79')};}return{'isValid':!![],'message':_0x2cd9('0x7a')};};module[_0x2cd9('0x7b')]=Fax; \ No newline at end of file +var _0xb44b=['[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','format','SIP/%s','reachable','unmonitored','checkTrunk','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','channelstate','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb44b,0x118));var _0xbb44=function(_0x35027c,_0x4af623){_0x35027c=_0x35027c-0x0;var _0x4bba7d=_0xb44b[_0x35027c];return _0x4bba7d;};'use strict';var util=require(_0xbb44('0x0'));var _=require(_0xbb44('0x1'));var BPromise=require('bluebird');var uuid=require(_0xbb44('0x2'));var moment=require(_0xbb44('0x3'));var path=require(_0xbb44('0x4'));var tiff2pdf=require(_0xbb44('0x5'));var gs=require(_0xbb44('0x6'));var logger=require(_0xbb44('0x7'))(_0xbb44('0x8'));var ami=require(_0xbb44('0x9'));var rpcDb=require(_0xbb44('0xa'));var Channel=require('./channel');var ut=require(_0xbb44('0xb'));var Action=require(_0xbb44('0xc'));var faxAccount=require(_0xbb44('0xd'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xbb44('0xe'));function Fax(_0x1262b9){this[_0xbb44('0xf')]={};this[_0xbb44('0x10')]=_0x1262b9[_0xbb44('0x10')];this[_0xbb44('0x11')]=_0x1262b9['trunks'];this[_0xbb44('0x12')]={};ami['on'](_0xbb44('0x13'),this[_0xbb44('0x14')][_0xbb44('0x15')](this));ami['on']('varset',this[_0xbb44('0x16')]['bind'](this));ami['on'](_0xbb44('0x17'),this[_0xbb44('0x18')]['bind'](this));ami['on'](_0xbb44('0x19'),this[_0xbb44('0x1a')]['bind'](this));ami['on'](_0xbb44('0x1b'),this[_0xbb44('0x1c')]['bind'](this));ami['on'](_0xbb44('0x1d'),this[_0xbb44('0x1e')]['bind'](this));ami['on'](_0xbb44('0x1f'),this['syncHangup'][_0xbb44('0x15')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xbb44('0x15')](this));}Fax[_0xbb44('0x20')]['syncNewchannel']=function(_0x774b47){if(_0x774b47['context']===_0xbb44('0x21')){for(var _0x18556d in this[_0xbb44('0x10')]){if(this[_0xbb44('0x10')][_0xbb44('0x22')](_0x18556d)){if(_0x774b47['exten']===this['faxAccounts'][_0x18556d][_0xbb44('0x23')]){this[_0xbb44('0xf')][_0x774b47[_0xbb44('0x24')]]={};this[_0xbb44('0xf')][_0x774b47[_0xbb44('0x24')]][_0xbb44('0x25')]=_0x774b47[_0xbb44('0x25')];this[_0xbb44('0xf')][_0x774b47[_0xbb44('0x24')]]['id']=this[_0xbb44('0x10')][_0x18556d]['id'];this[_0xbb44('0xf')][_0x774b47['uniqueid']][_0xbb44('0x26')]=this[_0xbb44('0x10')][_0x18556d][_0xbb44('0x26')];logger['info'](_0x774b47[_0xbb44('0x24')],_0xbb44('0x27'));}}}}if(this[_0xbb44('0x12')][_0x774b47[_0xbb44('0x24')]]){this[_0xbb44('0xf')][_0x774b47['uniqueid']]={};this['channels'][_0x774b47['uniqueid']][_0xbb44('0x25')]=_0x774b47[_0xbb44('0x25')];logger[_0xbb44('0x28')](_0x774b47[_0xbb44('0x24')],'\x20syncNewchannel\x20');}};Fax[_0xbb44('0x20')]['syncVarSet']=function(_0x4bd942){if(this['channels'][_0x4bd942['uniqueid']]){for(var _0x5147a8 in _0x4bd942[_0xbb44('0x29')]){if(_0x4bd942[_0xbb44('0x29')][_0xbb44('0x22')](_0x5147a8)){this[_0xbb44('0xf')][_0x4bd942[_0xbb44('0x24')]][_0x5147a8]=_0x4bd942['value'];}}}};Fax[_0xbb44('0x20')][_0xbb44('0x18')]=function(_0x1a2a33){if(this[_0xbb44('0xf')][_0x1a2a33['uniqueid']]){this[_0xbb44('0xf')][_0x1a2a33[_0xbb44('0x24')]][_0xbb44('0x2a')]=_0x1a2a33[_0xbb44('0x2a')];this[_0xbb44('0xf')][_0x1a2a33['uniqueid']]['channelstatedesc']=_0x1a2a33['channelstatedesc'];}};Fax[_0xbb44('0x20')][_0xbb44('0x1a')]=function(_0x20066b){if(this[_0xbb44('0xf')][_0x20066b[_0xbb44('0x24')]]){for(var _0x44f22e in _0x20066b['variable']){if(_0x20066b[_0xbb44('0x29')][_0xbb44('0x22')](_0x44f22e)){this['channels'][_0x20066b['uniqueid']][_0x44f22e]=_0x20066b[_0xbb44('0x2b')];}}}};Fax[_0xbb44('0x20')][_0xbb44('0x1c')]=function(_0x566554){if(this['channels'][_0x566554[_0xbb44('0x24')]]){this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]][_0xbb44('0x2c')]=_0x566554['operation'];this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]][_0xbb44('0x2d')]=_0x566554[_0xbb44('0x2d')];this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]]['localstationid']=_0x566554[_0xbb44('0x23')];this[_0xbb44('0xf')][_0x566554[_0xbb44('0x24')]][_0xbb44('0x2e')]=_0x566554[_0xbb44('0x2e')];logger['info'](_0x566554[_0xbb44('0x24')],'\x20syncFaxStatus\x20');}};Fax[_0xbb44('0x20')][_0xbb44('0x1e')]=function(_0x208b1f){var _0x464054=this;if(this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]]){var _0x5439e7=this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]]['id'];this[_0xbb44('0xf')][_0x208b1f['uniqueid']][_0xbb44('0x2f')]=_0x208b1f[_0xbb44('0x2f')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x30')]=_0x208b1f[_0xbb44('0x30')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x23')]=_0x208b1f['localstationid'];this[_0xbb44('0xf')][_0x208b1f['uniqueid']][_0xbb44('0x31')]=_0x208b1f[_0xbb44('0x31')];this[_0xbb44('0xf')][_0x208b1f['uniqueid']][_0xbb44('0x32')]=_0x208b1f[_0xbb44('0x32')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x2e')]=_0x208b1f[_0xbb44('0x2e')];this[_0xbb44('0xf')][_0x208b1f[_0xbb44('0x24')]][_0xbb44('0x33')]=_0x208b1f[_0xbb44('0x33')];if(this['channels'][_0x208b1f['uniqueid']][_0xbb44('0x30')]>0x0){tiff2pdf(_0x208b1f[_0xbb44('0x2e')],_0xbb44('0x34'),function(_0x1d4622){logger[_0xbb44('0x28')](_0x208b1f[_0xbb44('0x24')],_0xbb44('0x35'),_0x1d4622['message']);attachment[_0xbb44('0x36')]({'name':path['parse'](_0x208b1f[_0xbb44('0x2e')])['name'],'basename':path[_0xbb44('0x37')](_0x208b1f[_0xbb44('0x2e')])[_0xbb44('0x26')]+'.pdf','type':_0xbb44('0x38')})[_0xbb44('0x39')](function(_0x3c6ef9){faxAccount[_0xbb44('0x3a')](_0x5439e7,{'from':_0x208b1f[_0xbb44('0x33')],'mapKey':'fax','body':path[_0xbb44('0x37')](_0x208b1f[_0xbb44('0x2e')])[_0xbb44('0x26')]+_0xbb44('0x3b'),'AttachmentId':_0x3c6ef9['id']})[_0xbb44('0x3c')](function(_0x12ac9f){logger[_0xbb44('0x3d')](_0x208b1f[_0xbb44('0x24')],_0xbb44('0x3e'),JSON[_0xbb44('0x3f')](_0x12ac9f));});})[_0xbb44('0x3c')](function(_0x1bc8f1){logger[_0xbb44('0x3d')](_0x208b1f[_0xbb44('0x24')],_0xbb44('0x40'),JSON['stringify'](_0x1bc8f1));});});}logger['info'](_0x208b1f['uniqueid'],'\x20receiveFax\x20');}};Fax[_0xbb44('0x20')][_0xbb44('0x41')]=function(_0x43b29d){if(this[_0xbb44('0x12')][_0x43b29d[_0xbb44('0x24')]]){_[_0xbb44('0x42')](this['channels'][_0x43b29d[_0xbb44('0x24')]],_['pick'](_0x43b29d,[_0xbb44('0x43'),_0xbb44('0x44')]));}};function updateStatus(_0xbd46b3){if(_0xbd46b3[_0xbb44('0x45')]){faxMessage[_0xbb44('0x46')](_0xbd46b3[_0xbb44('0x45')],{'failMessage':_0xbb44('0x47')})[_0xbb44('0x39')](function(_0x35f91c){ut[_0xbb44('0x48')](_0xbb44('0x49'),_0x35f91c);})[_0xbb44('0x3c')](function(_0x4367d8){ut[_0xbb44('0x48')](_0xbb44('0x4a'),_0x4367d8);});}else{ut[_0xbb44('0x48')](_0xbb44('0x4b'));}}Fax['prototype'][_0xbb44('0x4c')]=function(_0x3de710,_0x1b2b39,_0x720198){var _0x5e0c7e=this;var _0x5a0822={};if(_0x1b2b39){_0x5a0822={'read':_0x1b2b39};}else{_0x5a0822={'failMessage':_0x720198};}if(this[_0xbb44('0x12')][_0x3de710][_0xbb44('0x45')]){faxMessage[_0xbb44('0x46')](this['actions'][_0x3de710]['AttachmentId'],_0x5a0822)[_0xbb44('0x39')](function(_0x23f868){ut[_0xbb44('0x48')]('[Fax][Message][Updated]',_0x23f868);})[_0xbb44('0x3c')](function(_0x3994c6){ut['logger'](_0xbb44('0x4d'),_0x3994c6);})[_0xbb44('0x4e')](function(){delete _0x5e0c7e[_0xbb44('0xf')][_0x3de710];delete _0x5e0c7e[_0xbb44('0x12')][_0x3de710];});}else{ut[_0xbb44('0x48')](_0xbb44('0x4f'));delete this[_0xbb44('0xf')][_0x3de710];delete this['actions'][_0x3de710];}};Fax[_0xbb44('0x20')][_0xbb44('0x50')]=function(_0x2df9e6){var _0x11c557=this;if(this['channels'][_0x2df9e6[_0xbb44('0x24')]]){if(this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]]){this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]]['id']=this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]]['id'];this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x26')]=this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x26')];}logger[_0xbb44('0x28')](_0x2df9e6[_0xbb44('0x24')],this[_0xbb44('0x12')][_0x2df9e6['uniqueid']]?'\x20hangup\x20sendFile\x20':_0xbb44('0x51'),JSON['stringify'](this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]]));if(this[_0xbb44('0x12')][_0x2df9e6[_0xbb44('0x24')]]){if(this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]]['faxpages']>0x0&&this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x1b')]===_0xbb44('0x52')){this['updateStatus'](_0x2df9e6[_0xbb44('0x24')],!![]);}else{this[_0xbb44('0x4c')](_0x2df9e6[_0xbb44('0x24')],![],this[_0xbb44('0xf')][_0x2df9e6[_0xbb44('0x24')]][_0xbb44('0x53')]?_0xbb44('0x54')+this[_0xbb44('0xf')][_0x2df9e6['uniqueid']][_0xbb44('0x53')]:_0xbb44('0x55'));}}}};Fax[_0xbb44('0x20')][_0xbb44('0x56')]=function(_0x2dc6fa){var _0x5e4b83=this;return new BPromise(function(_0x106be8,_0x345146){_0x5e4b83[_0xbb44('0x57')](_0x2dc6fa,_0x5e4b83[_0xbb44('0x10')][_0x2dc6fa[_0xbb44('0x58')]])[_0xbb44('0x39')](function(_0x2e265f){ut[_0xbb44('0x48')]('[Fax][execOriginate][success]',_0x2e265f);_0x106be8(ut[_0xbb44('0x59')](_0xbb44('0x5a')));})[_0xbb44('0x3c')](function(_0x360ac6){ut[_0xbb44('0x48')](_0xbb44('0x5b'),_0x360ac6);updateStatus(_0x2dc6fa);_0x345146(ut[_0xbb44('0x59')](_0xbb44('0x5c')));});});};Fax['prototype'][_0xbb44('0x5d')]=function(_0x23f313){var _0x2d1997=this;return new BPromise(function(_0x47940d,_0x359840){var _0x3f378d=_0x2d1997['checkTrunk'](_0x2d1997[_0xbb44('0x10')][_0x23f313[_0xbb44('0x58')]][_0xbb44('0x5e')],_0x23f313);if(_0x3f378d['isValid']){_0x47940d(ut[_0xbb44('0x59')](_0xbb44('0x5f')));}else{_0x359840(ut[_0xbb44('0x59')](_0x3f378d['message']));}});};function originate(_0x38787f,_0x5c7b63,_0x4d429f){return new BPromise(function(_0x3f13de,_0x403e64){if(_0x4d429f){var _0x4a0bbe=util['format'](_0xbb44('0x60'),path[_0xbb44('0x37')](_0x38787f[_0xbb44('0x4')])['name'],_0x38787f['path']);gs[_0xbb44('0x61')](_0x4a0bbe)['then'](function(){_0x38787f[_0xbb44('0x4')]=util['format'](_0xbb44('0x62'),path[_0xbb44('0x37')](_0x38787f['path'])[_0xbb44('0x63')],path[_0xbb44('0x37')](_0x38787f[_0xbb44('0x4')])[_0xbb44('0x26')]);_0x5c7b63[_0xbb44('0x64')]=_0x38787f[_0xbb44('0x4')];ut['logger'](_0xbb44('0x65'),'');ami[_0xbb44('0x66')](ut['variablesAction'](_0x38787f,_0x5c7b63))[_0xbb44('0x39')](function(_0x341e82){_0x3f13de(_0x341e82);})[_0xbb44('0x3c')](function(_0x46e1b0){_0x403e64(_0x46e1b0);});})[_0xbb44('0x3c')](function(_0x589780){_0x403e64(_0x589780);});}else{ami[_0xbb44('0x66')](ut[_0xbb44('0x67')](_0x38787f,_0x5c7b63))[_0xbb44('0x39')](function(_0xb55a8d){_0x3f13de(_0xb55a8d);})[_0xbb44('0x3c')](function(_0x1f3e91){_0x403e64(_0x1f3e91);});}});}Fax[_0xbb44('0x20')][_0xbb44('0x57')]=function(_0x282f7e,_0xe1c05a){var _0x2fceea=this;return new BPromise(function(_0x2988b9,_0x3f204f){var _0x1b6e6c=uuid['v4']();var _0x4cba78=ut['addVariables'](_0x282f7e,_0xe1c05a);_0x2fceea[_0xbb44('0x12')][_0x1b6e6c]=new Action(_0x1b6e6c,_0xe1c05a,_0x282f7e);var _0x4fe0c0=_0x2fceea[_0xbb44('0x12')][_0x1b6e6c];if(path[_0xbb44('0x37')](_0x282f7e[_0xbb44('0x4')])['ext']===_0xbb44('0x3b')){originate(_0x4fe0c0,_0x4cba78,!![])['then'](function(_0x311910){_0x2988b9(_0x311910);})[_0xbb44('0x3c')](function(_0x2755e9){_0x3f204f(_0x2755e9);});}else{originate(_0x4fe0c0,_0x4cba78,![])['then'](function(_0xc905b9){_0x2988b9(_0xc905b9);})[_0xbb44('0x3c')](function(_0xf980d4){_0x3f204f(_0xf980d4);});}});};Fax[_0xbb44('0x20')][_0xbb44('0x68')]=function(_0x5ae9a3){return!_[_0xbb44('0x69')](_0x5ae9a3)&&!_[_0xbb44('0x69')](_0x5ae9a3[_0xbb44('0x26')])&&!_[_0xbb44('0x69')](_0x5ae9a3[_0xbb44('0x6a')])&&_0x5ae9a3[_0xbb44('0x6a')]&&!_[_0xbb44('0x69')](this[_0xbb44('0x11')][util['format']('SIP/%s',_0x5ae9a3['name'])])&&!_[_0xbb44('0x69')](this[_0xbb44('0x11')][util[_0xbb44('0x6b')]('SIP/%s',_0x5ae9a3[_0xbb44('0x26')])][_0xbb44('0x2d')])&&(this[_0xbb44('0x11')][util[_0xbb44('0x6b')](_0xbb44('0x6c'),_0x5ae9a3[_0xbb44('0x26')])]['status']===_0xbb44('0x6d')||this[_0xbb44('0x11')][util[_0xbb44('0x6b')](_0xbb44('0x6c'),_0x5ae9a3['name'])][_0xbb44('0x2d')]===_0xbb44('0x6e'));};Fax[_0xbb44('0x20')][_0xbb44('0x6f')]=function(_0xaff32c,_0x564964){if(!this[_0xbb44('0x68')](_0xaff32c)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xbb44('0x69')](_0xaff32c)?'':_0xaff32c[_0xbb44('0x26')]+_0xbb44('0x70'));return{'isValid':![],'message':_0xbb44('0x71')};}if(_[_0xbb44('0x69')](_0x564964['fax'])){ut[_0xbb44('0x48')](_0xbb44('0x72'),JSON[_0xbb44('0x3f')](_0x564964));return{'isValid':![],'message':_0xbb44('0x73')};}if(_[_0xbb44('0x69')](_0x564964[_0xbb44('0x4')])){ut[_0xbb44('0x48')](_0xbb44('0x74'),JSON[_0xbb44('0x3f')](_0x564964));return{'isValid':![],'message':_0xbb44('0x75')};}return{'isValid':!![],'message':_0xbb44('0x76')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 956d37d..04e1e60 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 _0x2b7d=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect','notify','resolve','then','[Notify]\x20','util'];(function(_0xd55444,_0xaa2ca7){var _0x3fa817=function(_0x7da453){while(--_0x7da453){_0xd55444['push'](_0xd55444['shift']());}};_0x3fa817(++_0xaa2ca7);}(_0x2b7d,0x1b7));var _0xd2b7=function(_0x5bd362,_0xbd0fed){_0x5bd362=_0x5bd362-0x0;var _0x4acc9a=_0x2b7d[_0x5bd362];return _0x4acc9a;};'use strict';var util=require(_0xd2b7('0x0'));var BPromise=require(_0xd2b7('0x1'));var logger=require(_0xd2b7('0x2'))(_0xd2b7('0x3'));var _=require(_0xd2b7('0x4'));var faxAccount=require(_0xd2b7('0x5'));function loggerCatch(_0x533d01){return function(_0x31e2a1){logger['error'](_0x533d01,util[_0xd2b7('0x6')](_0x31e2a1,{'showHidden':![],'depth':null}));};}exports[_0xd2b7('0x7')]=function(_0x109f5e,_0x17c2b5){return BPromise[_0xd2b7('0x8')]()[_0xd2b7('0x9')](faxAccount[_0xd2b7('0x7')](_0x109f5e,_0x17c2b5))['catch'](loggerCatch(_0xd2b7('0xa')));}; \ No newline at end of file +var _0x399a=['preview','../rpc/faxAccount','error','inspect','notify','resolve','catch','util','bluebird'];(function(_0xec1092,_0xde00ff){var _0x534e33=function(_0x1f31f6){while(--_0x1f31f6){_0xec1092['push'](_0xec1092['shift']());}};_0x534e33(++_0xde00ff);}(_0x399a,0xa9));var _0xa399=function(_0x165cc3,_0x1b2d7d){_0x165cc3=_0x165cc3-0x0;var _0x2d5eea=_0x399a[_0x165cc3];return _0x2d5eea;};'use strict';var util=require(_0xa399('0x0'));var BPromise=require(_0xa399('0x1'));var logger=require('../../../config/logger')(_0xa399('0x2'));var _=require('lodash');var faxAccount=require(_0xa399('0x3'));function loggerCatch(_0x238cb2){return function(_0x3c6adf){logger[_0xa399('0x4')](_0x238cb2,util[_0xa399('0x5')](_0x3c6adf,{'showHidden':![],'depth':null}));};}exports[_0xa399('0x6')]=function(_0x36f164,_0x2e3a33){return BPromise[_0xa399('0x7')]()['then'](faxAccount[_0xa399('0x6')](_0x36f164,_0x2e3a33))[_0xa399('0x8')](loggerCatch('[Notify]\x20'));}; \ 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 da82ca8..5ce875b 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 _0xa02b=['info','\x20Error\x20:','inspect','util','../../../../config/logger','child_process','exec','execute','Exec\x20gs'];(function(_0x5ed43b,_0x4198d8){var _0x487422=function(_0x10a4bf){while(--_0x10a4bf){_0x5ed43b['push'](_0x5ed43b['shift']());}};_0x487422(++_0x4198d8);}(_0xa02b,0xdb));var _0xba02=function(_0x4f4b40,_0x1c30c0){_0x4f4b40=_0x4f4b40-0x0;var _0x5be11c=_0xa02b[_0x4f4b40];return _0x5be11c;};'use strict';var util=require(_0xba02('0x0'));var logger=require(_0xba02('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0xba02('0x2'))[_0xba02('0x3')];exports[_0xba02('0x4')]=function(_0x572d90){return new BPromise(function(_0x959ce,_0x14a5db){exec(_0x572d90,function(_0x5f3c73,_0x29df21,_0x5d977b){logger['info'](_0xba02('0x5'),_0x29df21);if(_0x5f3c73){logger[_0xba02('0x6')](_0xba02('0x5'),_0xba02('0x7'),util[_0xba02('0x8')](_0x5f3c73,{'showHidden':![],'depth':null}),_0x29df21,_0x5d977b);_0x14a5db(_0x5f3c73);}_0x959ce(_0x29df21);});});}; \ No newline at end of file +var _0xd81d=['fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger'];(function(_0x36837c,_0xb785a1){var _0x314cca=function(_0x47564c){while(--_0x47564c){_0x36837c['push'](_0x36837c['shift']());}};_0x314cca(++_0xb785a1);}(_0xd81d,0xf0));var _0xdd81=function(_0x4750b8,_0xd4b867){_0x4750b8=_0x4750b8-0x0;var _0x4cc810=_0xd81d[_0x4750b8];return _0x4cc810;};'use strict';var util=require(_0xdd81('0x0'));var logger=require(_0xdd81('0x1'))(_0xdd81('0x2'));var BPromise=require(_0xdd81('0x3'));var exec=require(_0xdd81('0x4'))[_0xdd81('0x5')];exports[_0xdd81('0x6')]=function(_0x8da13a){return new BPromise(function(_0x4a2736,_0x2e5766){exec(_0x8da13a,function(_0x37c5c9,_0x4d84c9,_0xa141e1){logger[_0xdd81('0x7')]('Exec\x20gs',_0x4d84c9);if(_0x37c5c9){logger[_0xdd81('0x7')](_0xdd81('0x8'),_0xdd81('0x9'),util[_0xdd81('0xa')](_0x37c5c9,{'showHidden':![],'depth':null}),_0x4d84c9,_0xa141e1);_0x2e5766(_0x37c5c9);}_0x4a2736(_0x4d84c9);});});}; \ 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 6e706b4..f5bae51 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 _0xff39=['minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0xff39,0xb1));var _0x9ff3=function(_0x162f05,_0x328e0f){_0x162f05=_0x162f05-0x0;var _0x54f59a=_0xff39[_0x162f05];return _0x54f59a;};'use strict';var util=require(_0x9ff3('0x0'));var _=require(_0x9ff3('0x1'));var moment=require(_0x9ff3('0x2'));var logger=require(_0x9ff3('0x3'))(_0x9ff3('0x4'));exports[_0x9ff3('0x5')]=function(_0x2e9b7a){return{'message':_0x2e9b7a};};exports[_0x9ff3('0x6')]=function(_0x24c735,_0x13140d){logger[_0x9ff3('0x7')](_0x24c735,util[_0x9ff3('0x8')](_0x13140d,{'showHidden':![],'depth':null}));};exports[_0x9ff3('0x9')]=function(_0x3bc144,_0x5323a9){var _0x2c8a93={'XMF-ECM':_0x5323a9[_0x9ff3('0xa')],'XMF-HEADERINFO':_0x5323a9[_0x9ff3('0xb')],'XMF-MINRATE':_0x5323a9[_0x9ff3('0xc')],'XMF-MAXRATE':_0x5323a9[_0x9ff3('0xd')],'XMF-MODEM':util[_0x9ff3('0xe')](_0x9ff3('0xf'),_0x5323a9['modem']),'XMF-GATEWAY':_0x5323a9[_0x9ff3('0x10')],'XMF-FAXDETECT':_0x5323a9[_0x9ff3('0x11')],'XMF-T38TIMEOUT':_0x5323a9[_0x9ff3('0x12')],'XMF-LOCALSTATIONID':_0x5323a9['localstationid'],'XMF-PATH':_0x3bc144[_0x9ff3('0x13')]};return _0x2c8a93;};exports[_0x9ff3('0x14')]=function(_0x348361,_0x12241f){return{'actionid':_0x348361[_0x9ff3('0x15')],'action':_0x9ff3('0x16'),'channel':_0x348361[_0x9ff3('0x17')],'Exten':_0x9ff3('0x18'),'Context':_0x9ff3('0x19'),'Priority':'1','callerid':util[_0x9ff3('0xe')](_0x9ff3('0x1a'),_0x348361[_0x9ff3('0xb')]?_0x348361[_0x9ff3('0xb')]:'',_0x348361['localstationid']),'variable':_0x12241f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x348361[_0x9ff3('0x15')]};}; \ No newline at end of file +var _0x9ade=['lodash','fax','logger','info','inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util'];(function(_0x26222d,_0x1d2de1){var _0x16bf9f=function(_0x43892a){while(--_0x43892a){_0x26222d['push'](_0x26222d['shift']());}};_0x16bf9f(++_0x1d2de1);}(_0x9ade,0x107));var _0xe9ad=function(_0xeb7891,_0x4771f7){_0xeb7891=_0xeb7891-0x0;var _0x11cc19=_0x9ade[_0xeb7891];return _0x11cc19;};'use strict';var util=require(_0xe9ad('0x0'));var _=require(_0xe9ad('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0xe9ad('0x2'));exports['message']=function(_0xeb076b){return{'message':_0xeb076b};};exports[_0xe9ad('0x3')]=function(_0x4d4ee0,_0x52984f){logger[_0xe9ad('0x4')](_0x4d4ee0,util[_0xe9ad('0x5')](_0x52984f,{'showHidden':![],'depth':null}));};exports[_0xe9ad('0x6')]=function(_0x3e4092,_0x308564){var _0x6ede7f={'XMF-ECM':_0x308564[_0xe9ad('0x7')],'XMF-HEADERINFO':_0x308564[_0xe9ad('0x8')],'XMF-MINRATE':_0x308564['minrate'],'XMF-MAXRATE':_0x308564[_0xe9ad('0x9')],'XMF-MODEM':util[_0xe9ad('0xa')](_0xe9ad('0xb'),_0x308564[_0xe9ad('0xc')]),'XMF-GATEWAY':_0x308564[_0xe9ad('0xd')],'XMF-FAXDETECT':_0x308564[_0xe9ad('0xe')],'XMF-T38TIMEOUT':_0x308564[_0xe9ad('0xf')],'XMF-LOCALSTATIONID':_0x308564[_0xe9ad('0x10')],'XMF-PATH':_0x3e4092[_0xe9ad('0x11')]};return _0x6ede7f;};exports[_0xe9ad('0x12')]=function(_0x1aec2b,_0x1f7bc){return{'actionid':_0x1aec2b['uniqueid'],'action':_0xe9ad('0x13'),'channel':_0x1aec2b[_0xe9ad('0x14')],'Exten':_0xe9ad('0x15'),'Context':_0xe9ad('0x16'),'Priority':'1','callerid':util['format'](_0xe9ad('0x17'),_0x1aec2b[_0xe9ad('0x8')]?_0x1aec2b[_0xe9ad('0x8')]:'',_0x1aec2b[_0xe9ad('0x10')]),'variable':_0x1f7bc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1aec2b['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9a6e064..0092d45 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 _0x87b2=['ami','get','hour','resolve','getAgents','then','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','[index.js][initParams]','inspect','listen','sync','catch','[index.js][main]','util','moment','./server','./report','./acw','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger'];(function(_0x41a2ba,_0x3971e3){var _0x1fe2eb=function(_0x3a207a){while(--_0x3a207a){_0x41a2ba['push'](_0x41a2ba['shift']());}};_0x1fe2eb(++_0x3971e3);}(_0x87b2,0x18b));var _0x287b=function(_0x467f92,_0x3f4bfc){_0x467f92=_0x467f92-0x0;var _0x5b4f17=_0x87b2[_0x467f92];return _0x5b4f17;};'use strict';var util=require(_0x287b('0x0'));var moment=require(_0x287b('0x1'));var server=require(_0x287b('0x2'));var Realtime=require('./realtime');var Report=require(_0x287b('0x3'));var Acw=require(_0x287b('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x287b('0x5'));var Fax=require('./fax');var user=require(_0x287b('0x6'));var voiceQueue=require(_0x287b('0x7'));var voiceQueueReport=require(_0x287b('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x287b('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x287b('0xa'));var cmHopperHistory=require(_0x287b('0xb'));var campaign=require(_0x287b('0xc'));var voiceExtension=require(_0x287b('0xd'));var faxAccount=require(_0x287b('0xe'));var zendesk=require(_0x287b('0xf'));var salesforce=require(_0x287b('0x10'));var sugarcrm=require(_0x287b('0x11'));var freshdesk=require(_0x287b('0x12'));var desk=require(_0x287b('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x287b('0x14'));var freshsales=require(_0x287b('0x15'));var servicenow=require(_0x287b('0x16'));var dynamics365=require(_0x287b('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(_0x287b('0x18'))(_0x287b('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x287b('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x287b('0x1a')](_0x287b('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x287b('0x1c')]()['then'](user[_0x287b('0x1d')]())[_0x287b('0x1e')](realtime['initAgents']())['then'](user[_0x287b('0x1f')]())[_0x287b('0x1e')](realtime[_0x287b('0x20')]())[_0x287b('0x1e')](trunk[_0x287b('0x21')]())['then'](realtime[_0x287b('0x22')]())[_0x287b('0x1e')](voiceQueue['getVoiceQueues']())[_0x287b('0x1e')](realtime[_0x287b('0x23')]())[_0x287b('0x1e')](trigger['getTriggers']())[_0x287b('0x1e')](realtime[_0x287b('0x24')]())[_0x287b('0x1e')](template[_0x287b('0x25')]())['then'](realtime[_0x287b('0x26')]())['then'](zendesk[_0x287b('0x27')]())[_0x287b('0x1e')](realtime['initZendeskAccounts']())[_0x287b('0x1e')](salesforce[_0x287b('0x28')]())[_0x287b('0x1e')](realtime[_0x287b('0x29')]())[_0x287b('0x1e')](sugarcrm[_0x287b('0x2a')]())[_0x287b('0x1e')](realtime[_0x287b('0x2b')]())['then'](freshdesk[_0x287b('0x2c')]())[_0x287b('0x1e')](realtime['initFreshdeskAccounts']())[_0x287b('0x1e')](desk[_0x287b('0x2d')]())[_0x287b('0x1e')](realtime[_0x287b('0x2e')]())[_0x287b('0x1e')](zoho[_0x287b('0x2f')]())[_0x287b('0x1e')](realtime[_0x287b('0x30')]())[_0x287b('0x1e')](vtiger['getVtigerAccounts']())[_0x287b('0x1e')](realtime[_0x287b('0x31')]())['then'](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x287b('0x32')]())[_0x287b('0x1e')](servicenow['getServicenowAccounts']())[_0x287b('0x1e')](realtime['initServicenowAccounts']())[_0x287b('0x1e')](dynamics365[_0x287b('0x33')]())[_0x287b('0x1e')](realtime['initDynamics365Accounts']())[_0x287b('0x1e')](campaign[_0x287b('0x34')]())['then'](realtime[_0x287b('0x35')]())[_0x287b('0x1e')](voiceExtension[_0x287b('0x36')]())[_0x287b('0x1e')](realtime[_0x287b('0x37')]())[_0x287b('0x1e')](faxAccount[_0x287b('0x38')]())[_0x287b('0x1e')](realtime[_0x287b('0x39')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x287b('0x1c')]()[_0x287b('0x1e')](voiceQueueReport['getVoiceQueueReports']())[_0x287b('0x1e')](realtime[_0x287b('0x3a')]())[_0x287b('0x1e')](cmHopperHistory[_0x287b('0x3b')]())[_0x287b('0x1e')](realtime[_0x287b('0x3c')]())[_0x287b('0x1e')](cmHopperHistory[_0x287b('0x3d')]())['then'](realtime[_0x287b('0x3e')]())[_0x287b('0x1e')](voiceCallReport[_0x287b('0x3f')]())['then'](realtime['initVoiceCallReports']())['catch'](function(_0x50c4df){logger['error'](_0x287b('0x40'),util[_0x287b('0x41')](_0x50c4df,{'showHidden':![],'depth':null}));});}function main(){return server[_0x287b('0x42')](realtime,preview,fax)[_0x287b('0x1e')](function(){return initRealtime();})[_0x287b('0x1e')](function(){return initParams();})[_0x287b('0x1e')](function(){report[_0x287b('0x43')]();setInterval(initRealtime,0x1388);})[_0x287b('0x44')](function(_0x1ac981){logger['error'](_0x287b('0x45'),util['inspect'](_0x1ac981,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xfffc=['./fax','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','resolve','then','getAgents','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','sync','[index.js][main]','moment','./server','./realtime','./report','./acw','./preview'];(function(_0x3326c3,_0x14382c){var _0x14eb8a=function(_0x2f2cb3){while(--_0x2f2cb3){_0x3326c3['push'](_0x3326c3['shift']());}};_0x14eb8a(++_0x14382c);}(_0xfffc,0x84));var _0xcfff=function(_0x4ade92,_0x4d333f){_0x4ade92=_0x4ade92-0x0;var _0x58eff3=_0xfffc[_0x4ade92];return _0x58eff3;};'use strict';var util=require('util');var moment=require(_0xcfff('0x0'));var server=require(_0xcfff('0x1'));var Realtime=require(_0xcfff('0x2'));var Report=require(_0xcfff('0x3'));var Acw=require(_0xcfff('0x4'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0xcfff('0x5'));var Fax=require(_0xcfff('0x6'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xcfff('0x7'));var voiceCallReport=require(_0xcfff('0x8'));var trunk=require('./rpc/trunk');var trigger=require(_0xcfff('0x9'));var template=require(_0xcfff('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xcfff('0xb'));var zendesk=require(_0xcfff('0xc'));var salesforce=require(_0xcfff('0xd'));var sugarcrm=require(_0xcfff('0xe'));var freshdesk=require(_0xcfff('0xf'));var desk=require(_0xcfff('0x10'));var zoho=require(_0xcfff('0x11'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xcfff('0x12'));var servicenow=require(_0xcfff('0x13'));var dynamics365=require(_0xcfff('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xcfff('0x15'))(_0xcfff('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xcfff('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xcfff('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xcfff('0x18')]()[_0xcfff('0x19')](user[_0xcfff('0x1a')]())[_0xcfff('0x19')](realtime[_0xcfff('0x1b')]())[_0xcfff('0x19')](user['getTelephones']())[_0xcfff('0x19')](realtime['initTelephones']())[_0xcfff('0x19')](trunk[_0xcfff('0x1c')]())[_0xcfff('0x19')](realtime[_0xcfff('0x1d')]())[_0xcfff('0x19')](voiceQueue[_0xcfff('0x1e')]())[_0xcfff('0x19')](realtime[_0xcfff('0x1f')]())[_0xcfff('0x19')](trigger[_0xcfff('0x20')]())[_0xcfff('0x19')](realtime[_0xcfff('0x21')]())[_0xcfff('0x19')](template['getTemplates']())[_0xcfff('0x19')](realtime[_0xcfff('0x22')]())['then'](zendesk[_0xcfff('0x23')]())[_0xcfff('0x19')](realtime[_0xcfff('0x24')]())[_0xcfff('0x19')](salesforce[_0xcfff('0x25')]())[_0xcfff('0x19')](realtime[_0xcfff('0x26')]())[_0xcfff('0x19')](sugarcrm['getSugarcrmAccounts']())['then'](realtime[_0xcfff('0x27')]())['then'](freshdesk[_0xcfff('0x28')]())[_0xcfff('0x19')](realtime[_0xcfff('0x29')]())[_0xcfff('0x19')](desk[_0xcfff('0x2a')]())[_0xcfff('0x19')](realtime[_0xcfff('0x2b')]())[_0xcfff('0x19')](zoho[_0xcfff('0x2c')]())[_0xcfff('0x19')](realtime[_0xcfff('0x2d')]())['then'](vtiger['getVtigerAccounts']())[_0xcfff('0x19')](realtime[_0xcfff('0x2e')]())[_0xcfff('0x19')](freshsales[_0xcfff('0x2f')]())[_0xcfff('0x19')](realtime['initFreshsalesAccounts']())[_0xcfff('0x19')](servicenow[_0xcfff('0x30')]())[_0xcfff('0x19')](realtime[_0xcfff('0x31')]())[_0xcfff('0x19')](dynamics365[_0xcfff('0x32')]())[_0xcfff('0x19')](realtime[_0xcfff('0x33')]())[_0xcfff('0x19')](campaign[_0xcfff('0x34')]())[_0xcfff('0x19')](realtime[_0xcfff('0x35')]())[_0xcfff('0x19')](voiceExtension[_0xcfff('0x36')]())[_0xcfff('0x19')](realtime[_0xcfff('0x37')]())[_0xcfff('0x19')](faxAccount['getFaxAccounts']())['then'](realtime[_0xcfff('0x38')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xcfff('0x18')]()['then'](voiceQueueReport[_0xcfff('0x39')]())[_0xcfff('0x19')](realtime[_0xcfff('0x3a')]())[_0xcfff('0x19')](cmHopperHistory[_0xcfff('0x3b')]())['then'](realtime[_0xcfff('0x3c')]())['then'](cmHopperHistory[_0xcfff('0x3d')]())[_0xcfff('0x19')](realtime[_0xcfff('0x3e')]())[_0xcfff('0x19')](voiceCallReport['getVoiceCallReports']())[_0xcfff('0x19')](realtime[_0xcfff('0x3f')]())[_0xcfff('0x40')](function(_0x7c18e1){logger[_0xcfff('0x41')]('[index.js][initParams]',util[_0xcfff('0x42')](_0x7c18e1,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xcfff('0x19')](function(){return initRealtime();})[_0xcfff('0x19')](function(){return initParams();})[_0xcfff('0x19')](function(){report[_0xcfff('0x43')]();setInterval(initRealtime,0x1388);})[_0xcfff('0x40')](function(_0x22a82b){logger[_0xcfff('0x41')](_0xcfff('0x44'),util[_0xcfff('0x42')](_0x22a82b,{'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 7be4dde..3961245 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 _0x0a71=['user:save','user:presence','exports','lodash','util','moment','md5','ioredis','redis','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','stringify','format','user:%s','emit'];(function(_0x11a1a6,_0x3bb701){var _0x38f91e=function(_0x2b4d74){while(--_0x2b4d74){_0x11a1a6['push'](_0x11a1a6['shift']());}};_0x38f91e(++_0x3bb701);}(_0x0a71,0x122));var _0x10a7=function(_0x171e9b,_0x5ee67d){_0x171e9b=_0x171e9b-0x0;var _0x4e930a=_0x0a71[_0x171e9b];return _0x4e930a;};'use strict';var _=require(_0x10a7('0x0'));var util=require(_0x10a7('0x1'));var moment=require(_0x10a7('0x2'));var md5=require(_0x10a7('0x3'));var Redis=require(_0x10a7('0x4'));var config=require('../../../config/environment');config[_0x10a7('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x10a7('0x6'))(new Redis(config[_0x10a7('0x5')]));function Agent(_0x54bc5e){this['id']=_0x54bc5e['id']||0x0;this[_0x10a7('0x7')]=_0x54bc5e[_0x10a7('0x7')]||'';this[_0x10a7('0x8')]=_0x54bc5e[_0x10a7('0x8')]||'';this[_0x10a7('0x9')]=_0x54bc5e[_0x10a7('0x9')]||'';this[_0x10a7('0xa')]=_0x54bc5e[_0x10a7('0xa')]||'';this[_0x10a7('0xb')]=_0x10a7('0xc');this[_0x10a7('0xd')]=0x0;this[_0x10a7('0xe')]=_0x10a7('0xc');this[_0x10a7('0xf')]='';this[_0x10a7('0x10')]='';this[_0x10a7('0x11')]='';this[_0x10a7('0x12')]='';this[_0x10a7('0x13')]=_0x54bc5e['online']||![];this[_0x10a7('0x14')]=_0x10a7('0xc');this[_0x10a7('0x15')]=0x0;this[_0x10a7('0x16')]='';this[_0x10a7('0x17')]='';this[_0x10a7('0x18')]=![];this[_0x10a7('0x19')]=![];this[_0x10a7('0x3')]='';}Agent[_0x10a7('0x1a')][_0x10a7('0x1b')]=function(_0x6e401a){var _0x58e0f8;if(_0x6e401a&&_0x6e401a[_0x10a7('0xb')]){_0x58e0f8=_0x6e401a[_0x10a7('0xb')][_0x10a7('0x1c')]();switch(_0x58e0f8){case _0x10a7('0x1d'):_0x58e0f8=_0x10a7('0x1e');break;case'inuse':_0x58e0f8=_0x10a7('0x1f');break;}}if(_0x58e0f8&&this[_0x10a7('0x14')]!==_0x58e0f8||_0x6e401a[_0x10a7('0x20')]){this[_0x10a7('0x15')]=_[_0x10a7('0x21')](moment()['format']('x'));}if(_0x58e0f8){this[_0x10a7('0x14')]=_0x58e0f8;}var _0x3d0dcb={'id':this['id'],'name':this[_0x10a7('0x7')],'email':this[_0x10a7('0x8')],'accountcode':this[_0x10a7('0x9')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x10a7('0xd')],'status':this[_0x10a7('0xe')],'address':this[_0x10a7('0xf')],'online':this[_0x10a7('0x13')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x10a7('0x15')],'voiceStatusCallerIdNumber':this[_0x10a7('0x16')],'voiceStatusQueue':this[_0x10a7('0x17')],'interface':this[_0x10a7('0x12')],'onhold':this[_0x10a7('0x18')]};var _0x204a27=md5(JSON[_0x10a7('0x22')](_0x3d0dcb));if(this['md5']!==_0x204a27){this[_0x10a7('0x3')]=_0x204a27;io['to'](util[_0x10a7('0x23')](_0x10a7('0x24'),_0x3d0dcb[_0x10a7('0x7')]))[_0x10a7('0x25')](_0x10a7('0x26'),_0x3d0dcb);io['emit'](_0x10a7('0x27'),_0x3d0dcb);}};module[_0x10a7('0x28')]=Agent; \ No newline at end of file +var _0x39fd=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','mobile','interface','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','voiceStatusTime','toNumber','format','status','online','user:%s','user:save','user:presence','exports','lodash','util','moment'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x39fd,0x1d6));var _0xd39f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x39fd[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd39f('0x0'));var util=require(_0xd39f('0x1'));var moment=require(_0xd39f('0x2'));var md5=require('md5');var Redis=require(_0xd39f('0x3'));var config=require(_0xd39f('0x4'));config[_0xd39f('0x5')]=_[_0xd39f('0x6')](config[_0xd39f('0x5')],{'host':_0xd39f('0x7'),'port':0x18eb});var io=require(_0xd39f('0x8'))(new Redis(config[_0xd39f('0x5')]));function Agent(_0x7252de){this['id']=_0x7252de['id']||0x0;this['name']=_0x7252de[_0xd39f('0x9')]||'';this['email']=_0x7252de[_0xd39f('0xa')]||'';this[_0xd39f('0xb')]=_0x7252de[_0xd39f('0xb')]||'';this['fullname']=_0x7252de[_0xd39f('0xc')]||'';this[_0xd39f('0xd')]=_0xd39f('0xe');this[_0xd39f('0xf')]=0x0;this['status']='unknown';this[_0xd39f('0x10')]='';this[_0xd39f('0x11')]='';this[_0xd39f('0x12')]='';this[_0xd39f('0x13')]='';this['online']=_0x7252de['online']||![];this[_0xd39f('0x14')]=_0xd39f('0xe');this['voiceStatusTime']=0x0;this[_0xd39f('0x15')]='';this[_0xd39f('0x16')]='';this[_0xd39f('0x17')]=![];this[_0xd39f('0x18')]=![];this[_0xd39f('0x19')]='';}Agent[_0xd39f('0x1a')][_0xd39f('0x1b')]=function(_0x480232){var _0x2ce4ae;if(_0x480232&&_0x480232[_0xd39f('0xd')]){_0x2ce4ae=_0x480232['state'][_0xd39f('0x1c')]();switch(_0x2ce4ae){case _0xd39f('0x1d'):_0x2ce4ae=_0xd39f('0x1e');break;case _0xd39f('0x1f'):_0x2ce4ae=_0xd39f('0x20');break;}}if(_0x2ce4ae&&this['voiceStatus']!==_0x2ce4ae||_0x480232[_0xd39f('0x21')]){this[_0xd39f('0x22')]=_[_0xd39f('0x23')](moment()[_0xd39f('0x24')]('x'));}if(_0x2ce4ae){this[_0xd39f('0x14')]=_0x2ce4ae;}var _0x4bee20={'id':this['id'],'name':this[_0xd39f('0x9')],'email':this[_0xd39f('0xa')],'accountcode':this[_0xd39f('0xb')],'fullname':this[_0xd39f('0xc')],'state':this[_0xd39f('0xd')],'stateTime':this[_0xd39f('0xf')],'status':this[_0xd39f('0x25')],'address':this[_0xd39f('0x10')],'online':this[_0xd39f('0x26')],'voiceStatus':this[_0xd39f('0x14')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xd39f('0x15')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xd39f('0x13')],'onhold':this[_0xd39f('0x17')]};var _0x5db858=md5(JSON['stringify'](_0x4bee20));if(this[_0xd39f('0x19')]!==_0x5db858){this[_0xd39f('0x19')]=_0x5db858;io['to'](util[_0xd39f('0x24')](_0xd39f('0x27'),_0x4bee20[_0xd39f('0x9')]))['emit'](_0xd39f('0x28'),_0x4bee20);io['emit'](_0xd39f('0x29'),_0x4bee20);}};module[_0xd39f('0x2a')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index e96ab8e..fefd91d 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 _0xec4a=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x5f48b6,_0x4a86){var _0x100a8c=function(_0x5084c1){while(--_0x5084c1){_0x5f48b6['push'](_0x5f48b6['shift']());}};_0x100a8c(++_0x4a86);}(_0xec4a,0x13f));var _0xaec4=function(_0x88668c,_0x316118){_0x88668c=_0x88668c-0x0;var _0x2024c8=_0xec4a[_0x88668c];return _0x2024c8;};'use strict';function Campaign(_0x58ddac){this['id']=_0x58ddac['id']||0x0;this[_0xaec4('0x0')]=_0x58ddac[_0xaec4('0x0')]||'';this[_0xaec4('0x1')]=_0x58ddac[_0xaec4('0x1')]||_0xaec4('0x2');this['originated']=0x0;this[_0xaec4('0x3')]=0x0;this[_0xaec4('0x4')]=0x0;this[_0xaec4('0x5')]=0x0;this[_0xaec4('0x6')]='';this[_0xaec4('0x7')]=!![];this[_0xaec4('0x8')]=_0x58ddac[_0xaec4('0x8')];this[_0xaec4('0x9')]=_0x58ddac[_0xaec4('0x9')];this[_0xaec4('0xa')]=_0x58ddac[_0xaec4('0xa')]||null;this['dialGlobalInterval']=_0x58ddac[_0xaec4('0xb')]?_0x58ddac[_0xaec4('0xb')]:null;this[_0xaec4('0xc')]=_0x58ddac[_0xaec4('0xc')];this['dialOriginateCallerIdNumber']=_0x58ddac[_0xaec4('0xd')];this['dialOriginateTimeout']=_0x58ddac[_0xaec4('0xe')]||0x1e;this[_0xaec4('0xf')]=_0x58ddac['dialCongestionMaxRetry'];this[_0xaec4('0x10')]=_0x58ddac[_0xaec4('0x10')];this['dialBusyMaxRetry']=_0x58ddac[_0xaec4('0x11')];this[_0xaec4('0x12')]=_0x58ddac[_0xaec4('0x12')];this[_0xaec4('0x13')]=_0x58ddac['dialNoAnswerMaxRetry'];this[_0xaec4('0x14')]=_0x58ddac['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x58ddac['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x58ddac['dialNoSuchNumberMaxRetry']||0x3;this[_0xaec4('0x15')]=_0x58ddac[_0xaec4('0x15')]||0x96;this[_0xaec4('0x16')]=_0x58ddac[_0xaec4('0x16')]||0x3;this[_0xaec4('0x17')]=_0x58ddac[_0xaec4('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x58ddac[_0xaec4('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x58ddac[_0xaec4('0x19')]||0x96;this[_0xaec4('0x1a')]=_0x58ddac[_0xaec4('0x1a')]||0x3;this[_0xaec4('0x1b')]=_0x58ddac[_0xaec4('0x1b')]||0x96;this[_0xaec4('0x1c')]=_0x58ddac['dialAgentRejectMaxRetry']||0x3;this[_0xaec4('0x1d')]=_0x58ddac[_0xaec4('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x58ddac[_0xaec4('0x1e')]||'DESC';this[_0xaec4('0x1f')]=_0x58ddac[_0xaec4('0x1f')]||undefined;this[_0xaec4('0x20')]=_0x58ddac[_0xaec4('0x20')]||undefined;this[_0xaec4('0x21')]=_0x58ddac[_0xaec4('0x21')]||undefined;this[_0xaec4('0x22')]=_0x58ddac['TrunkBackup']?_0x58ddac['TrunkBackup']:undefined;this[_0xaec4('0x23')]=_0x58ddac[_0xaec4('0x23')]?_0x58ddac[_0xaec4('0x23')]:undefined;this[_0xaec4('0x24')]=_0x58ddac['Interval']?_0x58ddac[_0xaec4('0x24')]:undefined;this[_0xaec4('0x25')]=_0x58ddac['SquareProject']?_0x58ddac['SquareProject']:undefined;this[_0xaec4('0x26')]=_0x58ddac[_0xaec4('0x25')]?_0x58ddac[_0xaec4('0x25')][_0xaec4('0x0')]:undefined;this[_0xaec4('0x27')]=_0x58ddac['dialAMDActive']||![];this[_0xaec4('0x28')]=_0x58ddac['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x58ddac[_0xaec4('0x29')];this['dialAMDAfterGreetingSilence']=_0x58ddac[_0xaec4('0x2a')];this[_0xaec4('0x2b')]=_0x58ddac[_0xaec4('0x2b')];this[_0xaec4('0x2c')]=_0x58ddac[_0xaec4('0x2c')];this[_0xaec4('0x2d')]=_0x58ddac[_0xaec4('0x2d')];this[_0xaec4('0x2e')]=_0x58ddac['dialAMDMaximumNumberOfWords'];this[_0xaec4('0x2f')]=_0x58ddac[_0xaec4('0x2f')];this['dialAMDMaximumWordLength']=_0x58ddac['dialAMDMaximumWordLength'];}module[_0xaec4('0x30')]=Campaign; \ No newline at end of file +var _0xe132=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x5d76cc,_0x195736){var _0x4acce4=function(_0x3b889d){while(--_0x3b889d){_0x5d76cc['push'](_0x5d76cc['shift']());}};_0x4acce4(++_0x195736);}(_0xe132,0x173));var _0x2e13=function(_0x253a87,_0x35c6d9){_0x253a87=_0x253a87-0x0;var _0x42d5f4=_0xe132[_0x253a87];return _0x42d5f4;};'use strict';function Campaign(_0xaec839){this['id']=_0xaec839['id']||0x0;this[_0x2e13('0x0')]=_0xaec839[_0x2e13('0x0')]||'';this['type']=_0xaec839[_0x2e13('0x1')]||_0x2e13('0x2');this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x2e13('0x3')]=0x0;this[_0x2e13('0x4')]='';this[_0x2e13('0x5')]=!![];this['active']=_0xaec839[_0x2e13('0x6')];this[_0x2e13('0x7')]=_0xaec839['limitCalls'];this[_0x2e13('0x8')]=_0xaec839[_0x2e13('0x8')]||null;this['dialGlobalInterval']=_0xaec839[_0x2e13('0x9')]?_0xaec839['dialGlobalInterval']:null;this[_0x2e13('0xa')]=_0xaec839[_0x2e13('0xa')];this[_0x2e13('0xb')]=_0xaec839[_0x2e13('0xb')];this[_0x2e13('0xc')]=_0xaec839[_0x2e13('0xc')]||0x1e;this[_0x2e13('0xd')]=_0xaec839[_0x2e13('0xd')];this[_0x2e13('0xe')]=_0xaec839[_0x2e13('0xe')];this[_0x2e13('0xf')]=_0xaec839[_0x2e13('0xf')];this[_0x2e13('0x10')]=_0xaec839[_0x2e13('0x10')];this[_0x2e13('0x11')]=_0xaec839[_0x2e13('0x11')];this['dialNoAnswerRetryFrequency']=_0xaec839[_0x2e13('0x12')];this[_0x2e13('0x13')]=_0xaec839[_0x2e13('0x13')];this[_0x2e13('0x14')]=_0xaec839['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0xaec839[_0x2e13('0x15')]||0x96;this[_0x2e13('0x16')]=_0xaec839[_0x2e13('0x16')]||0x3;this[_0x2e13('0x17')]=_0xaec839['dialDropRetryFrequency']||0x96;this[_0x2e13('0x18')]=_0xaec839[_0x2e13('0x18')]||0x3;this[_0x2e13('0x19')]=_0xaec839[_0x2e13('0x19')]||0x96;this[_0x2e13('0x1a')]=_0xaec839['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0xaec839[_0x2e13('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0xaec839['dialAgentRejectMaxRetry']||0x3;this[_0x2e13('0x1c')]=_0xaec839[_0x2e13('0x1c')]||0x96;this[_0x2e13('0x1d')]=_0xaec839[_0x2e13('0x1d')]||_0x2e13('0x1e');this[_0x2e13('0x1f')]=_0xaec839[_0x2e13('0x1f')]||undefined;this[_0x2e13('0x20')]=_0xaec839[_0x2e13('0x20')]||undefined;this[_0x2e13('0x21')]=_0xaec839[_0x2e13('0x21')]||undefined;this['TrunkBackup']=_0xaec839[_0x2e13('0x22')]?_0xaec839[_0x2e13('0x22')]:undefined;this['Trunk']=_0xaec839[_0x2e13('0x23')]?_0xaec839['Trunk']:undefined;this['Interval']=_0xaec839[_0x2e13('0x24')]?_0xaec839['Interval']:undefined;this[_0x2e13('0x25')]=_0xaec839[_0x2e13('0x25')]?_0xaec839[_0x2e13('0x25')]:undefined;this[_0x2e13('0x26')]=_0xaec839[_0x2e13('0x25')]?_0xaec839[_0x2e13('0x25')][_0x2e13('0x0')]:undefined;this[_0x2e13('0x27')]=_0xaec839[_0x2e13('0x27')]||![];this['dialAMDInitialSilence']=_0xaec839[_0x2e13('0x28')];this[_0x2e13('0x29')]=_0xaec839['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0xaec839[_0x2e13('0x2a')];this['dialAMDTotalAnalysisTime']=_0xaec839['dialAMDTotalAnalysisTime'];this[_0x2e13('0x2b')]=_0xaec839['dialAMDMinWordLength'];this[_0x2e13('0x2c')]=_0xaec839[_0x2e13('0x2c')];this['dialAMDMaximumNumberOfWords']=_0xaec839[_0x2e13('0x2d')];this[_0x2e13('0x2e')]=_0xaec839[_0x2e13('0x2e')];this[_0x2e13('0x2f')]=_0xaec839[_0x2e13('0x2f')];}module[_0x2e13('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 015c651..3354ac2 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 _0xc0d7=['mohtime','exports','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','tag','disposition','queue','monitors','transferconnectedlinenum','transferType'];(function(_0x57de35,_0x2ef99a){var _0x2a94eb=function(_0x2719e4){while(--_0x2719e4){_0x57de35['push'](_0x57de35['shift']());}};_0x2a94eb(++_0x2ef99a);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x24454d,_0x4be466){_0x24454d=_0x24454d-0x0;var _0x2393f6=_0xc0d7[_0x24454d];return _0x2393f6;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this['destinationchannel']='';this[_0x7c0d('0x0')]=0x0;this[_0x7c0d('0x1')]='';this[_0x7c0d('0x2')]=undefined;this[_0x7c0d('0x3')]=undefined;this[_0x7c0d('0x4')]=0x0;this[_0x7c0d('0x5')]='';this[_0x7c0d('0x6')]=0x0;this[_0x7c0d('0x7')]=0x0;this[_0x7c0d('0x8')]=0x0;this['answered']=![];this[_0x7c0d('0x9')]=null;this[_0x7c0d('0xa')]=null;this[_0x7c0d('0xb')]=![];this[_0x7c0d('0xc')]=![];this['lastapplication']='';this[_0x7c0d('0xd')]='';this[_0x7c0d('0xe')]=0x0;this[_0x7c0d('0xf')]=0x0;this[_0x7c0d('0x10')]=0x0;this['type']=null;this[_0x7c0d('0x11')]=null;this[_0x7c0d('0x12')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x7c0d('0x13')]=null;this[_0x7c0d('0x14')]=[];this['transfercalleridnum']=undefined;this[_0x7c0d('0x15')]=undefined;this[_0x7c0d('0x16')]=undefined;this[_0x7c0d('0x17')]=0x0;}module[_0x7c0d('0x18')]=Channel; \ No newline at end of file +var _0xed03=['duration','billableseconds','holdtime','type','tag','monitor','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridnum','connectedlinename','context','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata'];(function(_0x339230,_0x1b4205){var _0x641284=function(_0x4a9349){while(--_0x4a9349){_0x339230['push'](_0x339230['shift']());}};_0x641284(++_0x1b4205);}(_0xed03,0xdc));var _0x3ed0=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xed03[_0x21549c];return _0x426cbd;};'use strict';function Channel(){this[_0x3ed0('0x0')]=null;this[_0x3ed0('0x1')]='';this['destinationchannel']='';this[_0x3ed0('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x3ed0('0x3')]=undefined;this['accountcode']=0x0;this[_0x3ed0('0x4')]='';this['uniqueid']=0x0;this[_0x3ed0('0x5')]=0x0;this[_0x3ed0('0x6')]=0x0;this[_0x3ed0('0x7')]=![];this[_0x3ed0('0x8')]=null;this[_0x3ed0('0x9')]=null;this[_0x3ed0('0xa')]=![];this[_0x3ed0('0xb')]=![];this[_0x3ed0('0xc')]='';this[_0x3ed0('0xd')]='';this[_0x3ed0('0xe')]=0x0;this[_0x3ed0('0xf')]=0x0;this[_0x3ed0('0x10')]=0x0;this[_0x3ed0('0x11')]=null;this[_0x3ed0('0x12')]=null;this['disposition']=null;this[_0x3ed0('0x13')]=![];this['monitorFilename']=null;this[_0x3ed0('0x14')]=null;this[_0x3ed0('0x15')]=[];this[_0x3ed0('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x3ed0('0x17')]=undefined;this[_0x3ed0('0x18')]=0x0;}module[_0x3ed0('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 5f1130b..0f8b8b3 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 _0xf8e4=['type','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0xf8e4,0x18f));var _0x4f8e=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xf8e4[_0x3861f7];return _0x50879f;};'use strict';function DeskAccount(_0x430dcf){this['id']=_0x430dcf['id']||0x0;this[_0x4f8e('0x0')]=_0x430dcf[_0x4f8e('0x0')]||'';this[_0x4f8e('0x1')]=_0x430dcf[_0x4f8e('0x1')]||'';this[_0x4f8e('0x2')]=_0x430dcf['remoteUri']||'';this[_0x4f8e('0x3')]=_0x430dcf[_0x4f8e('0x3')]||'';this[_0x4f8e('0x4')]=_0x430dcf[_0x4f8e('0x4')]||'';this['consumerKey']=_0x430dcf[_0x4f8e('0x5')]||'';this['consumerSecret']=_0x430dcf[_0x4f8e('0x6')]||'';this[_0x4f8e('0x7')]=_0x430dcf[_0x4f8e('0x7')]||'';this[_0x4f8e('0x8')]=_0x430dcf[_0x4f8e('0x8')]||'';this[_0x4f8e('0x9')]=_0x430dcf[_0x4f8e('0x9')]||'';this['serverUrl']=_0x430dcf['serverUrl']||'';this['Configurations']=_0x430dcf[_0x4f8e('0xa')]||{};}module[_0x4f8e('0xb')]=DeskAccount; \ No newline at end of file +var _0xc511=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x2b5d95,_0x546f4a){var _0x40cb15=function(_0x35174f){while(--_0x35174f){_0x2b5d95['push'](_0x2b5d95['shift']());}};_0x40cb15(++_0x546f4a);}(_0xc511,0x8a));var _0x1c51=function(_0x543242,_0xeac9fd){_0x543242=_0x543242-0x0;var _0x4c99b6=_0xc511[_0x543242];return _0x4c99b6;};'use strict';function DeskAccount(_0x25c18a){this['id']=_0x25c18a['id']||0x0;this['name']=_0x25c18a[_0x1c51('0x0')]||'';this['username']=_0x25c18a[_0x1c51('0x1')]||'';this[_0x1c51('0x2')]=_0x25c18a[_0x1c51('0x2')]||'';this[_0x1c51('0x3')]=_0x25c18a[_0x1c51('0x3')]||'';this[_0x1c51('0x4')]=_0x25c18a[_0x1c51('0x4')]||'';this['consumerKey']=_0x25c18a[_0x1c51('0x5')]||'';this[_0x1c51('0x6')]=_0x25c18a['consumerSecret']||'';this[_0x1c51('0x7')]=_0x25c18a[_0x1c51('0x7')]||'';this[_0x1c51('0x8')]=_0x25c18a[_0x1c51('0x8')]||'';this[_0x1c51('0x9')]=_0x25c18a[_0x1c51('0x9')]||'';this[_0x1c51('0xa')]=_0x25c18a[_0x1c51('0xa')]||'';this[_0x1c51('0xb')]=_0x25c18a[_0x1c51('0xb')]||{};}module[_0x1c51('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 3147a96..0e1442b 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 _0xaa8f=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username'];(function(_0x5df33e,_0x527719){var _0x545a87=function(_0x3f8a80){while(--_0x3f8a80){_0x5df33e['push'](_0x5df33e['shift']());}};_0x545a87(++_0x527719);}(_0xaa8f,0x6c));var _0xfaa8=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0xaa8f[_0x179c4a];return _0x5d1879;};'use strict';function Dynamics365Account(_0x5ebbcc){this['id']=_0x5ebbcc['id']||0x0;this['name']=_0x5ebbcc[_0xfaa8('0x0')]||'';this[_0xfaa8('0x1')]=_0x5ebbcc['username']||'';this[_0xfaa8('0x2')]=_0x5ebbcc[_0xfaa8('0x2')]||'';this[_0xfaa8('0x3')]=_0x5ebbcc['remoteUri']||'';this[_0xfaa8('0x4')]=_0x5ebbcc['tenantId']||'';this[_0xfaa8('0x5')]=_0x5ebbcc[_0xfaa8('0x5')]||'';this[_0xfaa8('0x6')]=_0x5ebbcc[_0xfaa8('0x6')]||{};this[_0xfaa8('0x7')]=_0x5ebbcc['serverUrl']||'';this[_0xfaa8('0x8')]=_0x5ebbcc[_0xfaa8('0x8')]||![];this[_0xfaa8('0x9')]=_0x5ebbcc[_0xfaa8('0x9')]||{};this[_0xfaa8('0xa')]=_0x5ebbcc[_0xfaa8('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x5974=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId'];(function(_0x35e62c,_0x56dc75){var _0xf8754f=function(_0x37c6c2){while(--_0x37c6c2){_0x35e62c['push'](_0x35e62c['shift']());}};_0xf8754f(++_0x56dc75);}(_0x5974,0x1be));var _0x4597=function(_0xd3c939,_0x356e38){_0xd3c939=_0xd3c939-0x0;var _0x2cb033=_0x5974[_0xd3c939];return _0x2cb033;};'use strict';function Dynamics365Account(_0x5680ba){this['id']=_0x5680ba['id']||0x0;this[_0x4597('0x0')]=_0x5680ba['name']||'';this[_0x4597('0x1')]=_0x5680ba['username']||'';this[_0x4597('0x2')]=_0x5680ba[_0x4597('0x2')]||'';this['remoteUri']=_0x5680ba[_0x4597('0x3')]||'';this[_0x4597('0x4')]=_0x5680ba[_0x4597('0x4')]||'';this[_0x4597('0x5')]=_0x5680ba[_0x4597('0x5')]||'';this[_0x4597('0x6')]=_0x5680ba[_0x4597('0x6')]||{};this[_0x4597('0x7')]=_0x5680ba[_0x4597('0x7')]||'';this[_0x4597('0x8')]=_0x5680ba[_0x4597('0x8')]||![];this[_0x4597('0x9')]=_0x5680ba[_0x4597('0x9')]||{};this[_0x4597('0xa')]=_0x5680ba['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 39015d8..d2bfed6 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 _0xd862=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect'];(function(_0x16cf21,_0x3029b3){var _0x3f6c88=function(_0x3f9bec){while(--_0x3f9bec){_0x16cf21['push'](_0x16cf21['shift']());}};_0x3f6c88(++_0x3029b3);}(_0xd862,0x139));var _0x2d86=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xd862[_0x4e9d3c];return _0x2d0825;};'use strict';function FaxAccount(_0x2e5f69){this['id']=_0x2e5f69['id']||0x0;this[_0x2d86('0x0')]=_0x2e5f69['name']||'';this[_0x2d86('0x1')]=_0x2e5f69[_0x2d86('0x1')];this[_0x2d86('0x2')]=_0x2e5f69[_0x2d86('0x2')];this[_0x2d86('0x3')]=_0x2e5f69[_0x2d86('0x3')];this[_0x2d86('0x4')]=_0x2e5f69[_0x2d86('0x4')];this['minrate']=_0x2e5f69[_0x2d86('0x5')]||0x960;this[_0x2d86('0x6')]=_0x2e5f69[_0x2d86('0x6')]||0x3840;this[_0x2d86('0x7')]=_0x2e5f69['modem']||'v17,v27,v29';this[_0x2d86('0x8')]=_0x2e5f69[_0x2d86('0x8')]||'no';this[_0x2d86('0x9')]=_0x2e5f69[_0x2d86('0x9')]||'no';this['t38timeout']=_0x2e5f69[_0x2d86('0xa')]||0x1388;this[_0x2d86('0xb')]=_0x2e5f69[_0x2d86('0xb')]||_0x2d86('0xc');this[_0x2d86('0xd')]=_0x2e5f69[_0x2d86('0xd')]?_0x2e5f69['Trunk']:undefined;this[_0x2d86('0xe')]=_0x2e5f69[_0x2d86('0xe')];this[_0x2d86('0xf')]=_0x2e5f69[_0x2d86('0xf')];}module[_0x2d86('0x10')]=FaxAccount; \ No newline at end of file +var _0x2ec5=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','description','ecm','headerinfo','minrate','maxrate'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x2ec5,0x6b));var _0x52ec=function(_0x263ac9,_0x18aa58){_0x263ac9=_0x263ac9-0x0;var _0x1cc2af=_0x2ec5[_0x263ac9];return _0x1cc2af;};'use strict';function FaxAccount(_0x268a4e){this['id']=_0x268a4e['id']||0x0;this['name']=_0x268a4e['name']||'';this[_0x52ec('0x0')]=_0x268a4e[_0x52ec('0x0')];this[_0x52ec('0x1')]=_0x268a4e[_0x52ec('0x1')];this[_0x52ec('0x2')]=_0x268a4e[_0x52ec('0x2')];this['localstationid']=_0x268a4e['localstationid'];this[_0x52ec('0x3')]=_0x268a4e[_0x52ec('0x3')]||0x960;this[_0x52ec('0x4')]=_0x268a4e['maxrate']||0x3840;this[_0x52ec('0x5')]=_0x268a4e[_0x52ec('0x5')]||_0x52ec('0x6');this[_0x52ec('0x7')]=_0x268a4e[_0x52ec('0x7')]||'no';this[_0x52ec('0x8')]=_0x268a4e[_0x52ec('0x8')]||'no';this[_0x52ec('0x9')]=_0x268a4e[_0x52ec('0x9')]||0x1388;this[_0x52ec('0xa')]=_0x268a4e['tech']||'SIP';this[_0x52ec('0xb')]=_0x268a4e[_0x52ec('0xb')]?_0x268a4e[_0x52ec('0xb')]:undefined;this[_0x52ec('0xc')]=_0x268a4e[_0x52ec('0xc')];this[_0x52ec('0xd')]=_0x268a4e[_0x52ec('0xd')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 62f0cae..095f14c 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 _0x10a8=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x5bb6da,_0x943d6e){var _0x8564fd=function(_0x124ed1){while(--_0x124ed1){_0x5bb6da['push'](_0x5bb6da['shift']());}};_0x8564fd(++_0x943d6e);}(_0x10a8,0x12a));var _0x810a=function(_0x289df3,_0x4db68d){_0x289df3=_0x289df3-0x0;var _0x144021=_0x10a8[_0x289df3];return _0x144021;};'use strict';function FreshdeskAccount(_0x4e0335){this['id']=_0x4e0335['id']||0x0;this[_0x810a('0x0')]=_0x4e0335[_0x810a('0x0')]||'';this[_0x810a('0x1')]=_0x4e0335[_0x810a('0x1')]||'';this[_0x810a('0x2')]=_0x4e0335['token']||'';this[_0x810a('0x3')]=_0x4e0335[_0x810a('0x3')]||'';this[_0x810a('0x4')]=_0x4e0335[_0x810a('0x4')]||'';this[_0x810a('0x5')]=_0x4e0335[_0x810a('0x5')]||{};}module[_0x810a('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xe7c4=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x35a4a1,_0xcce320){var _0x1a5746=function(_0x39bd1c){while(--_0x39bd1c){_0x35a4a1['push'](_0x35a4a1['shift']());}};_0x1a5746(++_0xcce320);}(_0xe7c4,0x100));var _0x4e7c=function(_0xeb1b4b,_0x6507e1){_0xeb1b4b=_0xeb1b4b-0x0;var _0x285ff=_0xe7c4[_0xeb1b4b];return _0x285ff;};'use strict';function FreshdeskAccount(_0x28b0b5){this['id']=_0x28b0b5['id']||0x0;this[_0x4e7c('0x0')]=_0x28b0b5[_0x4e7c('0x0')]||'';this[_0x4e7c('0x1')]=_0x28b0b5[_0x4e7c('0x1')]||'';this['apiKey']=_0x28b0b5['token']||'';this[_0x4e7c('0x2')]=_0x28b0b5[_0x4e7c('0x2')]||'';this[_0x4e7c('0x3')]=_0x28b0b5[_0x4e7c('0x3')]||'';this[_0x4e7c('0x4')]=_0x28b0b5[_0x4e7c('0x4')]||{};}module[_0x4e7c('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 3a15416..76703f6 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 _0x23f4=['token','remoteUri','serverUrl','Configurations','name','username','apiKey'];(function(_0x247635,_0x2d1f82){var _0x2c8bcc=function(_0xb1eb7c){while(--_0xb1eb7c){_0x247635['push'](_0x247635['shift']());}};_0x2c8bcc(++_0x2d1f82);}(_0x23f4,0x1ee));var _0x423f=function(_0x2e718b,_0x2d6ebc){_0x2e718b=_0x2e718b-0x0;var _0x41cad1=_0x23f4[_0x2e718b];return _0x41cad1;};'use strict';function FreshsalesAccount(_0xdab65f){this['id']=_0xdab65f['id']||0x0;this[_0x423f('0x0')]=_0xdab65f['name']||'';this['username']=_0xdab65f[_0x423f('0x1')]||'';this[_0x423f('0x2')]=_0xdab65f[_0x423f('0x3')]||'';this[_0x423f('0x4')]=_0xdab65f[_0x423f('0x4')]||'';this[_0x423f('0x5')]=_0xdab65f[_0x423f('0x5')]||'';this[_0x423f('0x6')]=_0xdab65f[_0x423f('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x7923=['remoteUri','Configurations','exports','name','username','apiKey','token'];(function(_0x4f549f,_0x195899){var _0x4f3740=function(_0x3adbfc){while(--_0x3adbfc){_0x4f549f['push'](_0x4f549f['shift']());}};_0x4f3740(++_0x195899);}(_0x7923,0x8f));var _0x3792=function(_0x5f7814,_0x44e884){_0x5f7814=_0x5f7814-0x0;var _0x5e3fef=_0x7923[_0x5f7814];return _0x5e3fef;};'use strict';function FreshsalesAccount(_0x1980d4){this['id']=_0x1980d4['id']||0x0;this[_0x3792('0x0')]=_0x1980d4[_0x3792('0x0')]||'';this[_0x3792('0x1')]=_0x1980d4[_0x3792('0x1')]||'';this[_0x3792('0x2')]=_0x1980d4[_0x3792('0x3')]||'';this['remoteUri']=_0x1980d4[_0x3792('0x4')]||'';this['serverUrl']=_0x1980d4['serverUrl']||'';this[_0x3792('0x5')]=_0x1980d4['Configurations']||{};}module[_0x3792('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 5dcbf88..83ba90e 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 _0x323a=['queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','calleridname','queuecallerjoinAt','queuecallerleaveAt','count'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x323a,0x7c));var _0xa323=function(_0x393868,_0x491e3c){_0x393868=_0x393868-0x0;var _0x42bc61=_0x323a[_0x393868];return _0x42bc61;};'use strict';function QueueReport(){this[_0xa323('0x0')]=_0xa323('0x1');this['uniqueid']='';this['calleridnum']='';this[_0xa323('0x2')]='';this['queue']='';this[_0xa323('0x3')]=null;this[_0xa323('0x4')]=null;this['position']=0x1;this[_0xa323('0x5')]=0x1;this[_0xa323('0x6')]=![];this['queuecallerabandonAt']=null;this[_0xa323('0x7')]=![];this[_0xa323('0x8')]=null;this[_0xa323('0x9')]=![];this[_0xa323('0xa')]=null;this[_0xa323('0xb')]=0x1;this[_0xa323('0xc')]='';this[_0xa323('0xd')]='';this[_0xa323('0xe')]='';this[_0xa323('0xf')]='';this[_0xa323('0x10')]='';this[_0xa323('0x11')]='';this[_0xa323('0x12')]='';this[_0xa323('0x13')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xa323('0x14')]=_0xa323('0x15');this[_0xa323('0x16')]=null;this[_0xa323('0x17')]=0x0;this[_0xa323('0x18')]={};}module[_0xa323('0x19')]=QueueReport; \ No newline at end of file +var _0x3456=['priority','holdtime','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','connectedlinename','accountcode'];(function(_0x45c7c1,_0x272c94){var _0xdba959=function(_0x54184a){while(--_0x54184a){_0x45c7c1['push'](_0x45c7c1['shift']());}};_0xdba959(++_0x272c94);}(_0x3456,0x151));var _0x6345=function(_0x85d5a8,_0x1977be){_0x85d5a8=_0x85d5a8-0x0;var _0x20479b=_0x3456[_0x85d5a8];return _0x20479b;};'use strict';function QueueReport(){this[_0x6345('0x0')]=_0x6345('0x1');this[_0x6345('0x2')]='';this[_0x6345('0x3')]='';this[_0x6345('0x4')]='';this[_0x6345('0x5')]='';this['queuecallerjoinAt']=null;this[_0x6345('0x6')]=null;this['position']=0x1;this['count']=0x1;this[_0x6345('0x7')]=![];this['queuecallerabandonAt']=null;this[_0x6345('0x8')]=![];this[_0x6345('0x9')]=null;this[_0x6345('0xa')]=![];this[_0x6345('0xb')]=null;this['originalposition']=0x1;this['channel']='';this[_0x6345('0xc')]='';this[_0x6345('0xd')]='';this[_0x6345('0xe')]='';this['context']='';this['exten']='';this[_0x6345('0xf')]='';this[_0x6345('0x10')]=0x0;this['assigned']=![];this[_0x6345('0x11')]='';this['motionChannel']=_0x6345('0x12');this['routealias']=null;this[_0x6345('0x13')]=0x0;this[_0x6345('0x14')]={};}module[_0x6345('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index f613cf4..aa3fc08 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 _0x9192=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x56c13c,_0x7ebde8){var _0x141d30=function(_0x54c734){while(--_0x54c734){_0x56c13c['push'](_0x56c13c['shift']());}};_0x141d30(++_0x7ebde8);}(_0x9192,0x1a7));var _0x2919=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0x9192[_0x53f964];return _0x17be6c;};'use strict';function SalesforceAccount(_0x353334){this['id']=_0x353334['id']||0x0;this[_0x2919('0x0')]=_0x353334[_0x2919('0x0')]||'';this[_0x2919('0x1')]=_0x353334[_0x2919('0x1')]||'';this[_0x2919('0x2')]=_0x353334[_0x2919('0x2')]||'';this[_0x2919('0x3')]=_0x353334['password']||'';this[_0x2919('0x4')]=_0x353334['clientId']||'';this[_0x2919('0x5')]=_0x353334[_0x2919('0x5')]||'';this['securityToken']=_0x353334[_0x2919('0x6')]||'';this[_0x2919('0x7')]=_0x353334[_0x2919('0x7')]||_0x2919('0x8');this[_0x2919('0x9')]=_0x353334[_0x2919('0x9')]||'';this['Configurations']=_0x353334[_0x2919('0xa')]||{};}module[_0x2919('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x4a56=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x5d22f1,_0x2428c8){var _0x4819e2=function(_0x4109ec){while(--_0x4109ec){_0x5d22f1['push'](_0x5d22f1['shift']());}};_0x4819e2(++_0x2428c8);}(_0x4a56,0x17c));var _0x64a5=function(_0x900f48,_0x2ef7d8){_0x900f48=_0x900f48-0x0;var _0x50f00b=_0x4a56[_0x900f48];return _0x50f00b;};'use strict';function SalesforceAccount(_0x508e82){this['id']=_0x508e82['id']||0x0;this[_0x64a5('0x0')]=_0x508e82['name']||'';this[_0x64a5('0x1')]=_0x508e82[_0x64a5('0x1')]||'';this[_0x64a5('0x2')]=_0x508e82[_0x64a5('0x2')]||'';this['password']=_0x508e82[_0x64a5('0x3')]||'';this[_0x64a5('0x4')]=_0x508e82[_0x64a5('0x4')]||'';this[_0x64a5('0x5')]=_0x508e82['clientSecret']||'';this[_0x64a5('0x6')]=_0x508e82['securityToken']||'';this[_0x64a5('0x7')]=_0x508e82[_0x64a5('0x7')]||_0x64a5('0x8');this['serverUrl']=_0x508e82[_0x64a5('0x9')]||'';this[_0x64a5('0xa')]=_0x508e82[_0x64a5('0xa')]||{};}module[_0x64a5('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 82677fd..2d49537 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 _0xe396=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xe396,0x1be));var _0x6e39=function(_0x235df9,_0x36658a){_0x235df9=_0x235df9-0x0;var _0x2a5e41=_0xe396[_0x235df9];return _0x2a5e41;};'use strict';function ServicenowAccount(_0x39e4c9){this['id']=_0x39e4c9['id']||0x0;this[_0x6e39('0x0')]=_0x39e4c9['name']||'';this[_0x6e39('0x1')]=_0x39e4c9[_0x6e39('0x1')]||'';this[_0x6e39('0x2')]=_0x39e4c9[_0x6e39('0x2')]||'';this[_0x6e39('0x3')]=_0x39e4c9[_0x6e39('0x3')]||'';this[_0x6e39('0x4')]=_0x39e4c9[_0x6e39('0x4')]||'';this[_0x6e39('0x5')]=_0x39e4c9[_0x6e39('0x5')]||{};}module[_0x6e39('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x6dde=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x41b313,_0x216343){var _0x145ab9=function(_0x3a3ca1){while(--_0x3a3ca1){_0x41b313['push'](_0x41b313['shift']());}};_0x145ab9(++_0x216343);}(_0x6dde,0x161));var _0xe6dd=function(_0x1c5b1e,_0x49c839){_0x1c5b1e=_0x1c5b1e-0x0;var _0x4835e0=_0x6dde[_0x1c5b1e];return _0x4835e0;};'use strict';function ServicenowAccount(_0x596c86){this['id']=_0x596c86['id']||0x0;this[_0xe6dd('0x0')]=_0x596c86['name']||'';this[_0xe6dd('0x1')]=_0x596c86[_0xe6dd('0x1')]||'';this[_0xe6dd('0x2')]=_0x596c86[_0xe6dd('0x2')]||'';this[_0xe6dd('0x3')]=_0x596c86[_0xe6dd('0x3')]||'';this[_0xe6dd('0x4')]=_0x596c86[_0xe6dd('0x4')]||'';this[_0xe6dd('0x5')]=_0x596c86['Configurations']||{};}module[_0xe6dd('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index f8b0051..5d8853c 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 _0x8ab7=['remoteUri','serverUrl','Configurations','exports','name','password'];(function(_0x81dae,_0x4437c9){var _0x2cab87=function(_0x1f1088){while(--_0x1f1088){_0x81dae['push'](_0x81dae['shift']());}};_0x2cab87(++_0x4437c9);}(_0x8ab7,0x1ba));var _0x78ab=function(_0x50259f,_0x533101){_0x50259f=_0x50259f-0x0;var _0xfcab55=_0x8ab7[_0x50259f];return _0xfcab55;};'use strict';function SugarcrmAccount(_0xd24262){this['id']=_0xd24262['id']||0x0;this[_0x78ab('0x0')]=_0xd24262[_0x78ab('0x0')]||'';this['username']=_0xd24262['username']||'';this[_0x78ab('0x1')]=_0xd24262[_0x78ab('0x1')]||'';this[_0x78ab('0x2')]=_0xd24262[_0x78ab('0x2')]||'';this[_0x78ab('0x3')]=_0xd24262[_0x78ab('0x3')]||'';this[_0x78ab('0x4')]=_0xd24262[_0x78ab('0x4')]||{};}module[_0x78ab('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xeee1=['remoteUri','serverUrl','name','password'];(function(_0x2a5e68,_0x17aa40){var _0x59e90c=function(_0x476ef2){while(--_0x476ef2){_0x2a5e68['push'](_0x2a5e68['shift']());}};_0x59e90c(++_0x17aa40);}(_0xeee1,0x19e));var _0x1eee=function(_0x947d15,_0x5c4988){_0x947d15=_0x947d15-0x0;var _0x4c3a67=_0xeee1[_0x947d15];return _0x4c3a67;};'use strict';function SugarcrmAccount(_0x5dc707){this['id']=_0x5dc707['id']||0x0;this['name']=_0x5dc707[_0x1eee('0x0')]||'';this['username']=_0x5dc707['username']||'';this['password']=_0x5dc707[_0x1eee('0x1')]||'';this[_0x1eee('0x2')]=_0x5dc707[_0x1eee('0x2')]||'';this[_0x1eee('0x3')]=_0x5dc707['serverUrl']||'';this['Configurations']=_0x5dc707['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 4aa42e4..f0b2866 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 _0x92a3=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x770039,_0x4faac8){var _0x5a9fdc=function(_0x5a6097){while(--_0x5a6097){_0x770039['push'](_0x770039['shift']());}};_0x5a9fdc(++_0x4faac8);}(_0x92a3,0x140));var _0x392a=function(_0x5292fc,_0x1bd395){_0x5292fc=_0x5292fc-0x0;var _0x1c48ad=_0x92a3[_0x5292fc];return _0x1c48ad;};'use strict';function Telephone(_0x5cbc84){this['id']=_0x5cbc84['id']||0x0;this[_0x392a('0x0')]=_0x5cbc84[_0x392a('0x0')]||'';this[_0x392a('0x1')]=_0x5cbc84['accountcode']||'';this[_0x392a('0x2')]=_0x392a('0x3');this[_0x392a('0x4')]=0x0;this[_0x392a('0x5')]=_0x392a('0x3');this[_0x392a('0x6')]='';}module[_0x392a('0x7')]=Telephone; \ No newline at end of file +var _0x8533=['stateTime','unknown','exports','name','accountcode','state'];(function(_0x275896,_0x518a08){var _0x11b763=function(_0x39fa05){while(--_0x39fa05){_0x275896['push'](_0x275896['shift']());}};_0x11b763(++_0x518a08);}(_0x8533,0x141));var _0x3853=function(_0x34ba71,_0xa71b46){_0x34ba71=_0x34ba71-0x0;var _0x5d6948=_0x8533[_0x34ba71];return _0x5d6948;};'use strict';function Telephone(_0x4b8f88){this['id']=_0x4b8f88['id']||0x0;this[_0x3853('0x0')]=_0x4b8f88[_0x3853('0x0')]||'';this['accountcode']=_0x4b8f88[_0x3853('0x1')]||'';this[_0x3853('0x2')]='unknown';this[_0x3853('0x3')]=0x0;this['status']=_0x3853('0x4');this['address']='';}module[_0x3853('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 7b7b22f..55998f0 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(_0x188fb1,_0x5a9cdf){var _0x1a847f=function(_0x5f3663){while(--_0x5f3663){_0x188fb1['push'](_0x188fb1['shift']());}};_0x1a847f(++_0x5a9cdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x863e15,_0x3ba42e){var _0x1a7666=function(_0x4e7025){while(--_0x4e7025){_0x863e15['push'](_0x863e15['shift']());}};_0x1a7666(++_0x3ba42e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 5775b5e..59e273b 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x4430c8,_0x45b38c){var _0x58bebe=function(_0x5e7d96){while(--_0x5e7d96){_0x4430c8['push'](_0x4430c8['shift']());}};_0x58bebe(++_0x45b38c);}(_0x4fc2,0x111));var _0x24fc=function(_0x717b8c,_0xf08d2c){_0x717b8c=_0x717b8c-0x0;var _0x672b94=_0x4fc2[_0x717b8c];return _0x672b94;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x416b43,_0x277b8e){var _0xa2ec71=function(_0x156a7f){while(--_0x156a7f){_0x416b43['push'](_0x416b43['shift']());}};_0xa2ec71(++_0x277b8e);}(_0x2032,0xd9));var _0x2203=function(_0x4041e1,_0x112532){_0x4041e1=_0x4041e1-0x0;var _0x1c9357=_0x2032[_0x4041e1];return _0x1c9357;};'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 9d4e11b..8e5d385 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 _0x16c5=['refresh','registrationtime','defaultuser','active','unknown','stateTime','registry','indexOf','split','port','domain','domainport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16c5,0x9f));var _0x516c=function(_0x24b16d,_0x5a2b97){_0x24b16d=_0x24b16d-0x0;var _0x1e2b2c=_0x16c5[_0x24b16d];return _0x1e2b2c;};'use strict';function Trunk(_0x3b641f){this['id']=_0x3b641f['id']||0x0;this[_0x516c('0x0')]=_0x3b641f['active']||![];this['name']=_0x3b641f['name']||'';this['state']=_0x516c('0x1');this[_0x516c('0x2')]=0x0;this['status']=_0x516c('0x1');this[_0x516c('0x3')]=_0x3b641f[_0x516c('0x3')]&&_0x3b641f[_0x516c('0x3')][_0x516c('0x4')](':')?_0x3b641f['registry'][_0x516c('0x5')](':')[0x0]:'';this['host']='';this[_0x516c('0x6')]='';this[_0x516c('0x7')]='';this[_0x516c('0x8')]='';this[_0x516c('0x9')]='';this['stateRegistry']=_0x516c('0x1');this[_0x516c('0xa')]='';this['address']='';this[_0x516c('0xb')]=_0x3b641f[_0x516c('0xb')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x2542=['split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf'];(function(_0x534da7,_0xb73f79){var _0x373dab=function(_0x42fa6b){while(--_0x42fa6b){_0x534da7['push'](_0x534da7['shift']());}};_0x373dab(++_0xb73f79);}(_0x2542,0x81));var _0x2254=function(_0x5ec4b5,_0x83767d){_0x5ec4b5=_0x5ec4b5-0x0;var _0x1d32ad=_0x2542[_0x5ec4b5];return _0x1d32ad;};'use strict';function Trunk(_0x265733){this['id']=_0x265733['id']||0x0;this[_0x2254('0x0')]=_0x265733[_0x2254('0x0')]||![];this[_0x2254('0x1')]=_0x265733[_0x2254('0x1')]||'';this['state']=_0x2254('0x2');this[_0x2254('0x3')]=0x0;this[_0x2254('0x4')]=_0x2254('0x2');this['registry']=_0x265733[_0x2254('0x5')]&&_0x265733['registry'][_0x2254('0x6')](':')?_0x265733[_0x2254('0x5')][_0x2254('0x7')](':')[0x0]:'';this[_0x2254('0x8')]='';this[_0x2254('0x9')]='';this[_0x2254('0xa')]='';this[_0x2254('0xb')]='';this['refresh']='';this[_0x2254('0xc')]='unknown';this[_0x2254('0xd')]='';this[_0x2254('0xe')]='';this[_0x2254('0xf')]=_0x265733[_0x2254('0xf')]||'';}module[_0x2254('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 6dceb4f..462914d 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 _0x467e=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x467e,0x136));var _0xe467=function(_0x5aa6a9,_0x3ae14c){_0x5aa6a9=_0x5aa6a9-0x0;var _0x119ce5=_0x467e[_0x5aa6a9];return _0x119ce5;};'use strict';function voiceExtension(_0x525803){this['id']=_0x525803['id']||0x0;this['exten']=_0x525803[_0xe467('0x0')]||'';this[_0xe467('0x1')]=_0x525803[_0xe467('0x1')]||'none';this[_0xe467('0x2')]=_0x525803[_0xe467('0x2')]||![];}module[_0xe467('0x3')]=voiceExtension; \ No newline at end of file +var _0x555b=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x555b,0x106));var _0xb555=function(_0x4123e4,_0x4e2013){_0x4123e4=_0x4123e4-0x0;var _0x59c4ea=_0x555b[_0x4123e4];return _0x59c4ea;};'use strict';function voiceExtension(_0x3f2637){this['id']=_0x3f2637['id']||0x0;this['exten']=_0x3f2637[_0xb555('0x0')]||'';this[_0xb555('0x1')]=_0x3f2637[_0xb555('0x1')]||'none';this['mandatoryDisposition']=_0x3f2637[_0xb555('0x2')]||![];}module[_0xb555('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 5180eac..413fd91 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 _0x8357=['unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','fewestcalls','linear','random','roundrobin','rrordered','wrandom','name','monitor_format','type','waiting','total','answered','sumDuration','sumHoldTime','available','busy','invalid','loggedIn','notInUse','onHold','paused','ringing','talking'];(function(_0x2b305c,_0x5ae303){var _0x5d8c85=function(_0x33129f){while(--_0x33129f){_0x2b305c['push'](_0x2b305c['shift']());}};_0x5d8c85(++_0x5ae303);}(_0x8357,0x1b8));var _0x7835=function(_0x3ab734,_0x579a8e){_0x3ab734=_0x3ab734-0x0;var _0x484b66=_0x8357[_0x3ab734];return _0x484b66;};'use strict';var monitorFormat={'wav':_0x7835('0x0'),'wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0x7835('0x1'),'leastrecent':'leastrecent','linear':_0x7835('0x2'),'random':_0x7835('0x3'),'ringall':'ringall','rr':_0x7835('0x4'),'rrmemory':'rrmemory','rrordered':_0x7835('0x5'),'wrandom':_0x7835('0x6')};function VoiceQueue(_0x5a1436){this['id']=_0x5a1436['id']||0x0;this[_0x7835('0x7')]=_0x5a1436[_0x7835('0x7')]||'';this['monitor_format']=_0x5a1436[_0x7835('0x8')]||'';this[_0x7835('0x9')]=_0x5a1436[_0x7835('0x9')]||'inbound';this[_0x7835('0xa')]=0x0;this[_0x7835('0xb')]=0x0;this[_0x7835('0xc')]=0x0;this[_0x7835('0xd')]=0x0;this[_0x7835('0xe')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x7835('0xf')]=0x0;this[_0x7835('0x10')]=0x0;this['inUse']=0x0;this[_0x7835('0x11')]=0x0;this[_0x7835('0x12')]=0x0;this[_0x7835('0x13')]=0x0;this[_0x7835('0x14')]=0x0;this[_0x7835('0x15')]=0x0;this[_0x7835('0x16')]=0x0;this['ringInUse']=0x0;this[_0x7835('0x17')]=0x0;this['unavailable']=0x0;this[_0x7835('0x18')]=0x0;this[_0x7835('0x19')]=_0x5a1436[_0x7835('0x19')]||![];this['acwTimeout']=_0x5a1436[_0x7835('0x1a')]||0xa;this[_0x7835('0x1b')]=_0x5a1436[_0x7835('0x1b')]||'no';this[_0x7835('0x1c')]=!![];this[_0x7835('0x1d')]='';this[_0x7835('0x1e')]='';this[_0x7835('0x1f')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x5a1436[_0x7835('0x20')]||null;this[_0x7835('0x21')]=_0x5a1436[_0x7835('0x21')]?_0x5a1436[_0x7835('0x21')]:null;this['dialActive']=_0x5a1436['dialActive'];this['dialMethod']=_0x5a1436[_0x7835('0x22')]||_0x7835('0x23');this[_0x7835('0x24')]=_0x5a1436[_0x7835('0x24')]||0x0;this['dialLimitQueue']=_0x5a1436[_0x7835('0x25')]||0x0;this[_0x7835('0x26')]=_0x5a1436[_0x7835('0x26')]||0x1;this['dialPredictiveOptimization']=_0x5a1436[_0x7835('0x27')]||_0x7835('0x28');this['dialPredictiveOptimizationPercentage']=_0x5a1436[_0x7835('0x29')]||0.03;this[_0x7835('0x2a')]=_0x5a1436[_0x7835('0x2a')]||0x258;this[_0x7835('0x2b')]=_0x5a1436[_0x7835('0x2b')]||_0x7835('0x2c');this['dialOriginateCallerIdNumber']=_0x5a1436['dialOriginateCallerIdNumber']||_0x7835('0x2c');this['dialOriginateTimeout']=_0x5a1436['dialOriginateTimeout']||0x1e;this[_0x7835('0x2d')]=_0x5a1436['dialQueueOptions']||_0x7835('0x2e');this['dialQueueTimeout']=_0x5a1436[_0x7835('0x2f')]||0x3;this[_0x7835('0x30')]=_0x5a1436[_0x7835('0x30')]||undefined;this[_0x7835('0x31')]=_0x5a1436[_0x7835('0x31')]||0x3;this[_0x7835('0x32')]=_0x5a1436[_0x7835('0x32')]||0x96;this['dialBusyMaxRetry']=_0x5a1436['dialBusyMaxRetry']||0x3;this[_0x7835('0x33')]=_0x5a1436[_0x7835('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x5a1436['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x5a1436['dialNoAnswerRetryFrequency']||0x96;this[_0x7835('0x34')]=_0x5a1436[_0x7835('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5a1436[_0x7835('0x35')]||0x96;this['dialDropMaxRetry']=_0x5a1436[_0x7835('0x36')]||0x3;this['dialDropRetryFrequency']=_0x5a1436[_0x7835('0x37')]||0x96;this[_0x7835('0x38')]=_0x5a1436[_0x7835('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x5a1436['dialAbandonedRetryFrequency']||0x96;this[_0x7835('0x39')]=_0x5a1436[_0x7835('0x39')]||0x3;this[_0x7835('0x3a')]=_0x5a1436[_0x7835('0x3a')]||0x96;this[_0x7835('0x3b')]=_0x5a1436[_0x7835('0x3b')]||0x3;this[_0x7835('0x3c')]=_0x5a1436[_0x7835('0x3c')]||0x96;this[_0x7835('0x3d')]=_0x5a1436[_0x7835('0x3d')]||0x3;this[_0x7835('0x3e')]=_0x5a1436[_0x7835('0x3e')]||0x4;this[_0x7835('0x3f')]=_0x5a1436[_0x7835('0x3f')]?_0x5a1436['Trunk']:undefined;this[_0x7835('0x40')]=_0x5a1436[_0x7835('0x40')]?_0x5a1436[_0x7835('0x40')]:undefined;this[_0x7835('0x41')]=_0x5a1436[_0x7835('0x41')]||undefined;this['Interval']=_0x5a1436[_0x7835('0x42')]?_0x5a1436[_0x7835('0x42')]:undefined;this['dialOrderByScheduledAt']=_0x5a1436['dialOrderByScheduledAt']||'DESC';this[_0x7835('0x43')]=_0x5a1436[_0x7835('0x43')]||undefined;this['dialCutDigit']=_0x5a1436['dialCutDigit']||undefined;this[_0x7835('0x44')]=strategy[_0x5a1436['strategy']];this[_0x7835('0x45')]=!![];this[_0x7835('0x46')]=_0x5a1436['dialAMDActive']||![];this[_0x7835('0x47')]=_0x5a1436[_0x7835('0x47')];this[_0x7835('0x48')]=_0x5a1436['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x5a1436[_0x7835('0x49')];this[_0x7835('0x4a')]=_0x5a1436[_0x7835('0x4a')];this[_0x7835('0x4b')]=_0x5a1436[_0x7835('0x4b')];this['dialAMDBetweenWordsSilence']=_0x5a1436[_0x7835('0x4c')];this[_0x7835('0x4d')]=_0x5a1436[_0x7835('0x4d')];this['dialAMDSilenceThreshold']=_0x5a1436['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x5a1436[_0x7835('0x4e')];this['outboundRejectCallsDay']=0x0;this[_0x7835('0x4f')]=0x0;this[_0x7835('0x50')]=_0x5a1436[_0x7835('0x50')];this[_0x7835('0x51')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x7835('0x52')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x7835('0x53')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x7835('0x54')]=0x0;this[_0x7835('0x55')]=0x0;this[_0x7835('0x56')]=0x0;this[_0x7835('0x57')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x7835('0x58')]=0x0;this[_0x7835('0x59')]=undefined;this[_0x7835('0x5a')]=undefined;this['handlePredictive']=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x7835('0x5b')]=0x0;this[_0x7835('0x5c')]=0x0;this[_0x7835('0x5d')]=0x0;this[_0x7835('0x5e')]=0x0;this[_0x7835('0x5f')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x7835('0x60')]=0x0;this[_0x7835('0x61')]=0x0;this[_0x7835('0x62')]=_0x5a1436[_0x7835('0x63')]||0x14;this['predictiveIntervalMinThreshold']=_0x5a1436[_0x7835('0x63')]||0xa;this[_0x7835('0x64')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x7835('0x65')]=0x1;this[_0x7835('0x66')]=0x0;this['erlangCallToSecond']=0x0;this[_0x7835('0x67')]=0x0;this[_0x7835('0x68')]=0x0;this[_0x7835('0x69')]=_0x5a1436['dialRecallMeTimeout']||0x1e;this[_0x7835('0x6a')]=_0x5a1436['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x5a1436[_0x7835('0x6b')]||![];this[_0x7835('0x6c')]=!!_0x5a1436[_0x7835('0x6c')]||![];this[_0x7835('0x6d')]=_0x5a1436[_0x7835('0x6d')]||undefined;this[_0x7835('0x6e')]=_0x5a1436[_0x7835('0x6e')]||![];this['dialAgiAfterHangupAgent']=_0x5a1436[_0x7835('0x6f')]||![];this[_0x7835('0x8')]=monitorFormat[_0x5a1436['monitor_format']]?monitorFormat[_0x5a1436['monitor_format']]:undefined;this[_0x7835('0x70')]=_0x5a1436[_0x7835('0x70')]||![];this['mandatoryDispositionPause']=_0x5a1436['mandatoryDispositionPause']?_0x5a1436[_0x7835('0x71')]:undefined;this[_0x7835('0x72')]=![];}module[_0x7835('0x73')]=VoiceQueue; \ No newline at end of file +var _0x29fb=['erlangCallToSecond','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','rrordered','wrandom','name','monitor_format','type','inbound','waiting','sumDuration','sumHoldTime','available','loggedIn','notInUse','paused','ringing','ringInUse','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls'];(function(_0x355eef,_0x351eca){var _0x309900=function(_0x58b7d4){while(--_0x58b7d4){_0x355eef['push'](_0x355eef['shift']());}};_0x309900(++_0x351eca);}(_0x29fb,0x1ee));var _0xb29f=function(_0x1675a5,_0x580068){_0x1675a5=_0x1675a5-0x0;var _0xde996a=_0x29fb[_0x1675a5];return _0xde996a;};'use strict';var monitorFormat={'wav':_0xb29f('0x0'),'wav49':_0xb29f('0x1'),'gsm':_0xb29f('0x2')};var strategy={'fewestcalls':_0xb29f('0x3'),'leastrecent':_0xb29f('0x4'),'linear':_0xb29f('0x5'),'random':_0xb29f('0x6'),'ringall':_0xb29f('0x7'),'rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0xb29f('0x8'),'wrandom':_0xb29f('0x9')};function VoiceQueue(_0x4db46e){this['id']=_0x4db46e['id']||0x0;this[_0xb29f('0xa')]=_0x4db46e[_0xb29f('0xa')]||'';this[_0xb29f('0xb')]=_0x4db46e[_0xb29f('0xb')]||'';this[_0xb29f('0xc')]=_0x4db46e[_0xb29f('0xc')]||_0xb29f('0xd');this[_0xb29f('0xe')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0xb29f('0xf')]=0x0;this[_0xb29f('0x10')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xb29f('0x11')]=0x0;this['busy']=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0xb29f('0x12')]=0x0;this[_0xb29f('0x13')]=0x0;this['onHold']=0x0;this[_0xb29f('0x14')]=0x0;this[_0xb29f('0x15')]=0x0;this[_0xb29f('0x16')]=0x0;this['talking']=0x0;this[_0xb29f('0x17')]=0x0;this[_0xb29f('0x18')]=0x0;this[_0xb29f('0x19')]=_0x4db46e[_0xb29f('0x19')]||![];this[_0xb29f('0x1a')]=_0x4db46e[_0xb29f('0x1a')]||0xa;this[_0xb29f('0x1b')]=_0x4db46e[_0xb29f('0x1b')]||'no';this[_0xb29f('0x1c')]=!![];this[_0xb29f('0x1d')]='';this['statusMessage']='';this[_0xb29f('0x1e')]=0x0;this['temp']=0x0;this['dialTimezone']=_0x4db46e[_0xb29f('0x1f')]||null;this[_0xb29f('0x20')]=_0x4db46e[_0xb29f('0x20')]?_0x4db46e[_0xb29f('0x20')]:null;this[_0xb29f('0x21')]=_0x4db46e[_0xb29f('0x21')];this[_0xb29f('0x22')]=_0x4db46e[_0xb29f('0x22')]||_0xb29f('0x23');this[_0xb29f('0x24')]=_0x4db46e[_0xb29f('0x24')]||0x0;this['dialLimitQueue']=_0x4db46e[_0xb29f('0x25')]||0x0;this[_0xb29f('0x26')]=_0x4db46e[_0xb29f('0x26')]||0x1;this['dialPredictiveOptimization']=_0x4db46e[_0xb29f('0x27')]||_0xb29f('0x28');this[_0xb29f('0x29')]=_0x4db46e[_0xb29f('0x29')]||0.03;this[_0xb29f('0x2a')]=_0x4db46e['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x4db46e[_0xb29f('0x2b')]||_0xb29f('0x2c');this['dialOriginateCallerIdNumber']=_0x4db46e['dialOriginateCallerIdNumber']||_0xb29f('0x2c');this['dialOriginateTimeout']=_0x4db46e[_0xb29f('0x2d')]||0x1e;this[_0xb29f('0x2e')]=_0x4db46e[_0xb29f('0x2e')]||_0xb29f('0x2f');this[_0xb29f('0x30')]=_0x4db46e[_0xb29f('0x30')]||0x3;this[_0xb29f('0x31')]=_0x4db46e[_0xb29f('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x4db46e[_0xb29f('0x32')]||0x3;this[_0xb29f('0x33')]=_0x4db46e[_0xb29f('0x33')]||0x96;this[_0xb29f('0x34')]=_0x4db46e['dialBusyMaxRetry']||0x3;this[_0xb29f('0x35')]=_0x4db46e[_0xb29f('0x35')]||0x96;this[_0xb29f('0x36')]=_0x4db46e[_0xb29f('0x36')]||0x3;this[_0xb29f('0x37')]=_0x4db46e[_0xb29f('0x37')]||0x96;this[_0xb29f('0x38')]=_0x4db46e['dialNoSuchNumberMaxRetry']||0x3;this[_0xb29f('0x39')]=_0x4db46e[_0xb29f('0x39')]||0x96;this[_0xb29f('0x3a')]=_0x4db46e[_0xb29f('0x3a')]||0x3;this[_0xb29f('0x3b')]=_0x4db46e[_0xb29f('0x3b')]||0x96;this[_0xb29f('0x3c')]=_0x4db46e['dialAbandonedMaxRetry']||0x3;this[_0xb29f('0x3d')]=_0x4db46e[_0xb29f('0x3d')]||0x96;this[_0xb29f('0x3e')]=_0x4db46e['dialMachineMaxRetry']||0x3;this[_0xb29f('0x3f')]=_0x4db46e[_0xb29f('0x3f')]||0x96;this[_0xb29f('0x40')]=_0x4db46e['dialAgentRejectMaxRetry']||0x3;this[_0xb29f('0x41')]=_0x4db46e['dialAgentRejectRetryFrequency']||0x96;this[_0xb29f('0x42')]=_0x4db46e['callAdditionalPhoneAfterMin']||0x3;this[_0xb29f('0x43')]=_0x4db46e[_0xb29f('0x43')]||0x4;this['Trunk']=_0x4db46e[_0xb29f('0x44')]?_0x4db46e['Trunk']:undefined;this[_0xb29f('0x45')]=_0x4db46e[_0xb29f('0x45')]?_0x4db46e[_0xb29f('0x45')]:undefined;this[_0xb29f('0x46')]=_0x4db46e['dialPrefix']||undefined;this[_0xb29f('0x47')]=_0x4db46e[_0xb29f('0x47')]?_0x4db46e[_0xb29f('0x47')]:undefined;this[_0xb29f('0x48')]=_0x4db46e[_0xb29f('0x48')]||_0xb29f('0x49');this[_0xb29f('0x4a')]=_0x4db46e[_0xb29f('0x4a')]||undefined;this[_0xb29f('0x4b')]=_0x4db46e[_0xb29f('0x4b')]||undefined;this[_0xb29f('0x4c')]=strategy[_0x4db46e[_0xb29f('0x4c')]];this[_0xb29f('0x4d')]=!![];this['dialAMDActive']=_0x4db46e[_0xb29f('0x4e')]||![];this['dialAMDInitialSilence']=_0x4db46e[_0xb29f('0x4f')];this['dialAMDGreeting']=_0x4db46e[_0xb29f('0x50')];this['dialAMDAfterGreetingSilence']=_0x4db46e['dialAMDAfterGreetingSilence'];this[_0xb29f('0x51')]=_0x4db46e[_0xb29f('0x51')];this[_0xb29f('0x52')]=_0x4db46e[_0xb29f('0x52')];this[_0xb29f('0x53')]=_0x4db46e[_0xb29f('0x53')];this[_0xb29f('0x54')]=_0x4db46e[_0xb29f('0x54')];this[_0xb29f('0x55')]=_0x4db46e[_0xb29f('0x55')];this[_0xb29f('0x56')]=_0x4db46e['dialAMDMaximumWordLength'];this[_0xb29f('0x57')]=0x0;this[_0xb29f('0x58')]=0x0;this[_0xb29f('0x59')]=_0x4db46e[_0xb29f('0x59')];this['outboundAnswerCallsDay']=0x0;this[_0xb29f('0x5a')]=0x0;this[_0xb29f('0x5b')]=0x0;this[_0xb29f('0x5c')]=0x0;this[_0xb29f('0x5d')]=0x0;this[_0xb29f('0x5e')]=0x0;this[_0xb29f('0x5f')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb29f('0x60')]=0x0;this[_0xb29f('0x61')]=0x0;this[_0xb29f('0x62')]=0x0;this[_0xb29f('0x63')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xb29f('0x64')]=undefined;this[_0xb29f('0x65')]=1.05;this[_0xb29f('0x66')]=0x0;this[_0xb29f('0x67')]=0x0;this[_0xb29f('0x68')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb29f('0x69')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xb29f('0x6a')]=_0x4db46e[_0xb29f('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x4db46e['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb29f('0x6c')]=0x0;this[_0xb29f('0x6d')]=0x1;this[_0xb29f('0x6e')]=0x0;this[_0xb29f('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x4db46e['dialRecallMeTimeout']||0x1e;this[_0xb29f('0x70')]=_0x4db46e[_0xb29f('0x70')]||![];this[_0xb29f('0x71')]=!!_0x4db46e[_0xb29f('0x71')]||![];this[_0xb29f('0x72')]=!!_0x4db46e[_0xb29f('0x72')]||![];this[_0xb29f('0x73')]=_0x4db46e[_0xb29f('0x73')]||undefined;this[_0xb29f('0x74')]=_0x4db46e[_0xb29f('0x74')]||![];this[_0xb29f('0x75')]=_0x4db46e['dialAgiAfterHangupAgent']||![];this[_0xb29f('0xb')]=monitorFormat[_0x4db46e[_0xb29f('0xb')]]?monitorFormat[_0x4db46e[_0xb29f('0xb')]]:undefined;this['mandatoryDisposition']=_0x4db46e[_0xb29f('0x76')]||![];this[_0xb29f('0x77')]=_0x4db46e[_0xb29f('0x77')]?_0x4db46e['mandatoryDispositionPause']:undefined;this[_0xb29f('0x78')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 4ba1c90..4810d33 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 _0x254a=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','notInUse','loggedin','callers','length','SIP/','online','incall','status','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','available','loggedIn','loggedInDb','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','onHold','paused','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName'];(function(_0x4570d2,_0x520703){var _0x1cd2da=function(_0x15fa57){while(--_0x15fa57){_0x4570d2['push'](_0x4570d2['shift']());}};_0x1cd2da(++_0x520703);}(_0x254a,0x138));var _0xa254=function(_0x2e0d2a,_0x8d568){_0x2e0d2a=_0x2e0d2a-0x0;var _0x4014f0=_0x254a[_0x2e0d2a];return _0x4014f0;};'use strict';var INBOUND_COUNTERS=[_0xa254('0x0'),_0xa254('0x1'),_0xa254('0x2'),'paused',_0xa254('0x3'),_0xa254('0x4'),_0xa254('0x5')];var OUTBOUND_COUNTERS=[_0xa254('0x0'),'answered',_0xa254('0x6'),'loggedIn',_0xa254('0x2'),_0xa254('0x7'),_0xa254('0x8'),'outboundAnswerCallsDay','outboundBlacklistCallsDay',_0xa254('0x9'),_0xa254('0xa'),'outboundNoAnswerCallsDay',_0xa254('0xb'),'outboundReCallsDay',_0xa254('0xc'),_0xa254('0xd'),'paused','pTalking',_0xa254('0x4'),_0xa254('0xe'),_0xa254('0xf'),_0xa254('0x10'),_0xa254('0x5')];function VoiceQueueSummary(_0x533881){this['id']=_0x533881['id'];this[_0xa254('0x11')]=_0x533881['name'];this['strategy']=_0x533881[_0xa254('0x12')];this[_0xa254('0x13')]=_0x533881['abandoned']||0x0;this[_0xa254('0x14')]=_0x533881[_0xa254('0x14')]||0x0;this[_0xa254('0x0')]=_0x533881[_0xa254('0x0')]||0x0;this[_0xa254('0x15')]=_0x533881['busy']||0x0;this[_0xa254('0x6')]=_0x533881[_0xa254('0x6')]||0x0;this[_0xa254('0x16')]=_0x533881[_0xa254('0x16')]||0x0;this[_0xa254('0x1')]=_0x533881[_0xa254('0x1')]||0x0;this[_0xa254('0x2')]=_0x533881[_0xa254('0x2')]||0x0;this[_0xa254('0x17')]=_0x533881['onHold']||0x0;this['notInUse']=_0x533881['notInUse']||0x0;this[_0xa254('0x18')]=_0x533881[_0xa254('0x18')]||0x0;this[_0xa254('0x3')]=_0x533881[_0xa254('0x3')]||0x0;this[_0xa254('0x19')]=_0x533881[_0xa254('0x19')];this[_0xa254('0xe')]=_0x533881['sumBillable'];this[_0xa254('0xf')]=_0x533881['sumDuration'];this[_0xa254('0x1a')]=_0x533881[_0xa254('0x1a')]||0x0;this['talking']=_0x533881[_0xa254('0x4')]||0x0;this[_0xa254('0x10')]=_0x533881['total']||0x0;this['type']=_0x533881[_0xa254('0x1b')];this[_0xa254('0x1c')]=_0x533881[_0xa254('0x1c')]||0x0;this['unknown']=_0x533881[_0xa254('0x1d')]||0x0;this[_0xa254('0x1e')]=_0x533881[_0xa254('0x1e')]||0x0;this['waiting']=_0x533881['waiting']||0x0;if(_0x533881[_0xa254('0x1b')]===_0xa254('0x1f')){this[_0xa254('0x20')]=_0x533881[_0xa254('0x20')]||0x0;this['dialActive']=_0x533881[_0xa254('0x21')];this[_0xa254('0x22')]=_0x533881[_0xa254('0x22')];this[_0xa254('0x23')]=_0x533881[_0xa254('0x23')];this[_0xa254('0x24')]=_0x533881[_0xa254('0x24')];this[_0xa254('0x25')]=_0x533881[_0xa254('0x25')];this['dialPrefix']=_0x533881[_0xa254('0x26')];this[_0xa254('0x27')]=_0x533881[_0xa254('0x27')];this[_0xa254('0x28')]=_0x533881[_0xa254('0x28')];this['outboundAnswerCallsDay']=_0x533881[_0xa254('0x29')];this[_0xa254('0x2a')]=_0x533881[_0xa254('0x2a')];this[_0xa254('0x9')]=_0x533881['outboundBusyCallsDay'];this[_0xa254('0xa')]=_0x533881[_0xa254('0xa')];this[_0xa254('0x2b')]=_0x533881[_0xa254('0x2b')];this[_0xa254('0x2c')]=_0x533881[_0xa254('0x2c')];this[_0xa254('0x2d')]=_0x533881[_0xa254('0x2d')];this['outboundNoAnswerCallsDay']=_0x533881[_0xa254('0x2e')];this[_0xa254('0xb')]=_0x533881[_0xa254('0xb')];this[_0xa254('0x2f')]=_0x533881['outboundOriginateFailureCallsDay'];this[_0xa254('0x30')]=_0x533881[_0xa254('0x30')];this[_0xa254('0xc')]=_0x533881['outboundRejectCallsDay'];this[_0xa254('0xd')]=_0x533881[_0xa254('0xd')];this[_0xa254('0x31')]=_0x533881['predictiveIntervalAnsweredCalls'];this[_0xa254('0x32')]=_0x533881[_0xa254('0x32')];this[_0xa254('0x33')]=_0x533881[_0xa254('0x33')];this[_0xa254('0x34')]=_0x533881[_0xa254('0x34')];this[_0xa254('0x35')]=_0x533881[_0xa254('0x35')];this[_0xa254('0x36')]=_0x533881['predictiveIntervalErlangCalls'];this['predictiveIntervalErlangCallsDroppedCalls']=_0x533881[_0xa254('0x37')];this[_0xa254('0x38')]=_0x533881['predictiveIntervalHitRate'];this[_0xa254('0x39')]=_0x533881['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x533881[_0xa254('0x3a')];this[_0xa254('0x3b')]=_0x533881[_0xa254('0x3b')];this[_0xa254('0x3c')]=_0x533881['predictiveIntervalTotalCalls'];this[_0xa254('0x7')]=_0x533881[_0xa254('0x7')];this[_0xa254('0x3d')]=_0x533881[_0xa254('0x3d')];this[_0xa254('0x3e')]=_0x533881[_0xa254('0x3e')];this[_0xa254('0x3f')]=_0x533881[_0xa254('0x3f')];this[_0xa254('0x40')]=_0x533881[_0xa254('0x40')];this[_0xa254('0x41')]=_0x533881[_0xa254('0x41')];this[_0xa254('0x42')]=_0x533881['startProgressive'];this['message']=_0x533881[_0xa254('0x43')];this[_0xa254('0x44')]=_0x533881['statusMessage'];}if(_0x533881['Trunk']){this[_0xa254('0x45')]={'id':_0x533881[_0xa254('0x45')]['id'],'name':_0x533881[_0xa254('0x45')][_0xa254('0x11')],'active':_0x533881[_0xa254('0x45')][_0xa254('0x46')],'callerid':_0x533881[_0xa254('0x45')]['callerid']};}}VoiceQueueSummary[_0xa254('0x47')][_0xa254('0x48')]=function(_0x34994d,_0xf1ee69,_0x226209,_0x22414a){this['loggedInDb']=0x0;this[_0xa254('0x4')]=0x0;this[_0xa254('0x18')]=0x0;this[_0xa254('0x1d')]=0x0;this[_0xa254('0x49')]=0x0;this[_0xa254('0x6')]=0x0;this[_0xa254('0x15')]=0x0;this[_0xa254('0x16')]=0x0;this[_0xa254('0x1c')]=0x0;this[_0xa254('0x3')]=0x0;this[_0xa254('0x19')]=0x0;this[_0xa254('0x17')]=0x0;if(_0x226209){if(_0x226209['available']){this['available']=Number(_0x226209[_0xa254('0x0')]);}if(_0x226209[_0xa254('0x4a')]){this[_0xa254('0x1')]=Number(_0x226209['loggedin']);}if(_0x226209[_0xa254('0x4b')]){this['waiting']=Number(_0x226209[_0xa254('0x4b')]);}}for(var _0x1ef195=0x0;_0x1ef195<_0x34994d[_0xa254('0x4c')];_0x1ef195++){var _0x49837e=_0xf1ee69[_0xa254('0x4d')+_0x34994d[_0x1ef195]['name']];if(_0x49837e&&_0x49837e[_0xa254('0x4e')]){this[_0xa254('0x2')]+=0x1;}if(_0x34994d[_0x1ef195][_0xa254('0x4f')]==='1'){this[_0xa254('0x4')]+=0x1;}if(_0x34994d[_0x1ef195][_0xa254('0x18')]==='1'&&!['2','7','8']['includes'](_0x34994d[_0x1ef195][_0xa254('0x50')])){this['paused']+=0x1;}switch(_0x34994d[_0x1ef195][_0xa254('0x50')]){case'0':this[_0xa254('0x1d')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xa254('0x6')]+=0x1;break;case'3':this[_0xa254('0x15')]+=0x1;break;case'4':this[_0xa254('0x16')]+=0x1;break;case'5':this[_0xa254('0x1c')]+=0x1;break;case'6':this[_0xa254('0x3')]+=0x1;break;case'7':this[_0xa254('0x19')]+=0x1;break;case'8':this[_0xa254('0x17')]+=0x1;break;}}if(this[_0xa254('0x22')]==='booked'){var _0x4ed4ec=Object['keys'](_0x22414a);for(var _0xee48bc=0x0;_0xee48bc<_0x4ed4ec['length'];_0xee48bc++){var _0x3591c2=_0x4ed4ec[_0xee48bc];var _0x857a54=_0x22414a[_0x3591c2];if(_0x857a54['queue']===this[_0xa254('0x11')]&&_0x857a54['type']===_0xa254('0x51')&&_0x857a54[_0xa254('0x52')]===_0xa254('0x53')){this[_0xa254('0x4')]+=0x1;}}if(this[_0xa254('0x4')]>this[_0xa254('0x6')]){this[_0xa254('0x4')]=this[_0xa254('0x6')];}this[_0xa254('0x20')]=0x0;}return this;};VoiceQueueSummary[_0xa254('0x47')][_0xa254('0x54')]=function(_0x4e5920){var _0x1d58a5=![];if(_0x4e5920){_0x1d58a5=INBOUND_COUNTERS[_0xa254('0x55')](function(_0x4056e6){return this[_0x4056e6]!==_0x4e5920[_0x4056e6];},this);}return _0x1d58a5;};VoiceQueueSummary[_0xa254('0x47')][_0xa254('0x56')]=function(_0x26deb3){var _0x5765c1=![];var _0x205c16=![];var _0x578233=![];if(_0x26deb3){_0x5765c1=this['dialMethod']!==_0x26deb3[_0xa254('0x22')]||this[_0xa254('0x21')]!==_0x26deb3[_0xa254('0x21')]||this['message']!==_0x26deb3[_0xa254('0x43')]||this['statusMessage']!==_0x26deb3[_0xa254('0x44')];_0x205c16=OUTBOUND_COUNTERS[_0xa254('0x55')](function(_0x3a0bdb){return this[_0x3a0bdb]!==_0x26deb3[_0x3a0bdb];},this);if(this[_0xa254('0x45')]&&_0x26deb3[_0xa254('0x45')]){_0x578233=this['Trunk'][_0xa254('0x11')]!==_0x26deb3[_0xa254('0x45')][_0xa254('0x11')]||this[_0xa254('0x45')][_0xa254('0x46')]!==_0x26deb3[_0xa254('0x45')][_0xa254('0x46')];}}return _0x5765c1||_0x205c16||_0x578233;};VoiceQueueSummary[_0xa254('0x47')]['updateReportFromOutboundQueue']=function(_0x9df09){this[_0xa254('0x14')]=_0x9df09['answered'];this[_0xa254('0x43')]=_0x9df09[_0xa254('0x43')];this[_0xa254('0x44')]=_0x9df09['statusMessage'];this['originated']=_0x9df09[_0xa254('0x7')];this[_0xa254('0x8')]=_0x9df09[_0xa254('0x8')];this[_0xa254('0x29')]=_0x9df09['outboundAnswerCallsDay'];this[_0xa254('0x2a')]=_0x9df09[_0xa254('0x2a')];this[_0xa254('0x9')]=_0x9df09[_0xa254('0x9')];this['outboundCongestionCallsDay']=_0x9df09[_0xa254('0xa')];this[_0xa254('0x2e')]=_0x9df09[_0xa254('0x2e')];this['outboundNoSuchCallsDay']=_0x9df09[_0xa254('0xb')];this[_0xa254('0x30')]=_0x9df09[_0xa254('0x30')];this['outboundRejectCallsDay']=_0x9df09[_0xa254('0xc')];this[_0xa254('0xd')]=_0x9df09[_0xa254('0xd')];this[_0xa254('0xe')]=_0x9df09[_0xa254('0xe')];this['sumDuration']=_0x9df09['sumDuration'];this[_0xa254('0x10')]=_0x9df09[_0xa254('0x10')];if(this[_0xa254('0x22')]==='preview'){this[_0xa254('0x20')]=_0x9df09[_0xa254('0x20')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file +var _0xeec6=['message','active','updateReportFromOutboundQueue','outboundNoSuchCallsDay','exports','available','loggedIn','loggedInDb','paused','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','statusMessage','Trunk','callerid','prototype','createReport','loggedin','callers','length','incall','includes','status','keys','queue','dialer','exten','compareToInboundQueue','some'];(function(_0x33616f,_0x3855c6){var _0x47221f=function(_0xe32c3a){while(--_0xe32c3a){_0x33616f['push'](_0x33616f['shift']());}};_0x47221f(++_0x3855c6);}(_0xeec6,0x1c2));var _0x6eec=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xeec6[_0x25662e];return _0x59b7bc;};'use strict';var INBOUND_COUNTERS=[_0x6eec('0x0'),_0x6eec('0x1'),_0x6eec('0x2'),_0x6eec('0x3'),'ringing',_0x6eec('0x4'),_0x6eec('0x5')];var OUTBOUND_COUNTERS=[_0x6eec('0x0'),_0x6eec('0x6'),_0x6eec('0x7'),_0x6eec('0x1'),'loggedInDb',_0x6eec('0x8'),_0x6eec('0x9'),'outboundAnswerCallsDay',_0x6eec('0xa'),_0x6eec('0xb'),_0x6eec('0xc'),_0x6eec('0xd'),'outboundNoSuchCallsDay',_0x6eec('0xe'),_0x6eec('0xf'),_0x6eec('0x10'),'paused','pTalking','talking',_0x6eec('0x11'),_0x6eec('0x12'),'total','waiting'];function VoiceQueueSummary(_0x1cc8d3){this['id']=_0x1cc8d3['id'];this['name']=_0x1cc8d3[_0x6eec('0x13')];this[_0x6eec('0x14')]=_0x1cc8d3[_0x6eec('0x14')];this[_0x6eec('0x15')]=_0x1cc8d3[_0x6eec('0x15')]||0x0;this['answered']=_0x1cc8d3[_0x6eec('0x6')]||0x0;this[_0x6eec('0x0')]=_0x1cc8d3[_0x6eec('0x0')]||0x0;this[_0x6eec('0x16')]=_0x1cc8d3[_0x6eec('0x16')]||0x0;this[_0x6eec('0x7')]=_0x1cc8d3[_0x6eec('0x7')]||0x0;this[_0x6eec('0x17')]=_0x1cc8d3[_0x6eec('0x17')]||0x0;this[_0x6eec('0x1')]=_0x1cc8d3['loggedIn']||0x0;this[_0x6eec('0x2')]=_0x1cc8d3['loggedInDb']||0x0;this[_0x6eec('0x18')]=_0x1cc8d3[_0x6eec('0x18')]||0x0;this['notInUse']=_0x1cc8d3[_0x6eec('0x19')]||0x0;this[_0x6eec('0x3')]=_0x1cc8d3[_0x6eec('0x3')]||0x0;this['ringing']=_0x1cc8d3[_0x6eec('0x1a')]||0x0;this[_0x6eec('0x1b')]=_0x1cc8d3[_0x6eec('0x1b')];this[_0x6eec('0x11')]=_0x1cc8d3[_0x6eec('0x11')];this[_0x6eec('0x12')]=_0x1cc8d3['sumDuration'];this[_0x6eec('0x1c')]=_0x1cc8d3[_0x6eec('0x1c')]||0x0;this[_0x6eec('0x4')]=_0x1cc8d3[_0x6eec('0x4')]||0x0;this[_0x6eec('0x1d')]=_0x1cc8d3[_0x6eec('0x1d')]||0x0;this['type']=_0x1cc8d3[_0x6eec('0x1e')];this[_0x6eec('0x1f')]=_0x1cc8d3[_0x6eec('0x1f')]||0x0;this[_0x6eec('0x20')]=_0x1cc8d3[_0x6eec('0x20')]||0x0;this[_0x6eec('0x21')]=_0x1cc8d3['unmanaged']||0x0;this[_0x6eec('0x5')]=_0x1cc8d3[_0x6eec('0x5')]||0x0;if(_0x1cc8d3[_0x6eec('0x1e')]===_0x6eec('0x22')){this[_0x6eec('0x23')]=_0x1cc8d3[_0x6eec('0x23')]||0x0;this[_0x6eec('0x24')]=_0x1cc8d3[_0x6eec('0x24')];this[_0x6eec('0x25')]=_0x1cc8d3['dialMethod'];this[_0x6eec('0x26')]=_0x1cc8d3[_0x6eec('0x26')];this[_0x6eec('0x27')]=_0x1cc8d3[_0x6eec('0x27')];this['dialOriginateTimeout']=_0x1cc8d3[_0x6eec('0x28')];this[_0x6eec('0x29')]=_0x1cc8d3['dialPrefix'];this['temp']=_0x1cc8d3[_0x6eec('0x2a')];this['outboundAnswerAgiCallsDay']=_0x1cc8d3[_0x6eec('0x2b')];this[_0x6eec('0x2c')]=_0x1cc8d3[_0x6eec('0x2c')];this[_0x6eec('0xa')]=_0x1cc8d3[_0x6eec('0xa')];this[_0x6eec('0xb')]=_0x1cc8d3[_0x6eec('0xb')];this[_0x6eec('0xc')]=_0x1cc8d3[_0x6eec('0xc')];this[_0x6eec('0x2d')]=_0x1cc8d3['outboundDropCallsDayACS'];this[_0x6eec('0x2e')]=_0x1cc8d3['outboundDropCallsDayCallersExit'];this[_0x6eec('0x2f')]=_0x1cc8d3[_0x6eec('0x2f')];this[_0x6eec('0xd')]=_0x1cc8d3['outboundNoAnswerCallsDay'];this['outboundNoSuchCallsDay']=_0x1cc8d3['outboundNoSuchCallsDay'];this[_0x6eec('0x30')]=_0x1cc8d3[_0x6eec('0x30')];this[_0x6eec('0xe')]=_0x1cc8d3[_0x6eec('0xe')];this[_0x6eec('0xf')]=_0x1cc8d3[_0x6eec('0xf')];this[_0x6eec('0x10')]=_0x1cc8d3[_0x6eec('0x10')];this[_0x6eec('0x31')]=_0x1cc8d3[_0x6eec('0x31')];this[_0x6eec('0x32')]=_0x1cc8d3[_0x6eec('0x32')];this['predictiveIntervalAvgTalktime']=_0x1cc8d3[_0x6eec('0x33')];this[_0x6eec('0x34')]=_0x1cc8d3[_0x6eec('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x1cc8d3[_0x6eec('0x35')];this[_0x6eec('0x36')]=_0x1cc8d3[_0x6eec('0x36')];this[_0x6eec('0x37')]=_0x1cc8d3[_0x6eec('0x37')];this[_0x6eec('0x38')]=_0x1cc8d3['predictiveIntervalHitRate'];this[_0x6eec('0x39')]=_0x1cc8d3[_0x6eec('0x39')];this[_0x6eec('0x3a')]=_0x1cc8d3['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x1cc8d3[_0x6eec('0x3b')];this[_0x6eec('0x3c')]=_0x1cc8d3[_0x6eec('0x3c')];this[_0x6eec('0x8')]=_0x1cc8d3[_0x6eec('0x8')];this['erlangCalls']=_0x1cc8d3[_0x6eec('0x3d')];this[_0x6eec('0x3e')]=_0x1cc8d3[_0x6eec('0x3e')];this[_0x6eec('0x3f')]=_0x1cc8d3[_0x6eec('0x3f')];this[_0x6eec('0x40')]=_0x1cc8d3[_0x6eec('0x40')];this[_0x6eec('0x41')]=_0x1cc8d3['startPredictive'];this[_0x6eec('0x42')]=_0x1cc8d3[_0x6eec('0x42')];this['message']=_0x1cc8d3['message'];this[_0x6eec('0x43')]=_0x1cc8d3[_0x6eec('0x43')];}if(_0x1cc8d3[_0x6eec('0x44')]){this[_0x6eec('0x44')]={'id':_0x1cc8d3['Trunk']['id'],'name':_0x1cc8d3['Trunk'][_0x6eec('0x13')],'active':_0x1cc8d3['Trunk']['active'],'callerid':_0x1cc8d3[_0x6eec('0x44')][_0x6eec('0x45')]};}}VoiceQueueSummary[_0x6eec('0x46')][_0x6eec('0x47')]=function(_0x25d3f3,_0x58dfe7,_0x931bcf,_0x3a4d25){this['loggedInDb']=0x0;this[_0x6eec('0x4')]=0x0;this[_0x6eec('0x3')]=0x0;this['unknown']=0x0;this[_0x6eec('0x19')]=0x0;this[_0x6eec('0x7')]=0x0;this['busy']=0x0;this[_0x6eec('0x17')]=0x0;this[_0x6eec('0x1f')]=0x0;this[_0x6eec('0x1a')]=0x0;this[_0x6eec('0x1b')]=0x0;this['onHold']=0x0;if(_0x931bcf){if(_0x931bcf[_0x6eec('0x0')]){this[_0x6eec('0x0')]=Number(_0x931bcf[_0x6eec('0x0')]);}if(_0x931bcf[_0x6eec('0x48')]){this[_0x6eec('0x1')]=Number(_0x931bcf['loggedin']);}if(_0x931bcf['callers']){this[_0x6eec('0x5')]=Number(_0x931bcf[_0x6eec('0x49')]);}}for(var _0x3703b5=0x0;_0x3703b5<_0x25d3f3[_0x6eec('0x4a')];_0x3703b5++){var _0x44c7b8=_0x58dfe7['SIP/'+_0x25d3f3[_0x3703b5][_0x6eec('0x13')]];if(_0x44c7b8&&_0x44c7b8['online']){this[_0x6eec('0x2')]+=0x1;}if(_0x25d3f3[_0x3703b5][_0x6eec('0x4b')]==='1'){this[_0x6eec('0x4')]+=0x1;}if(_0x25d3f3[_0x3703b5]['paused']==='1'&&!['2','7','8'][_0x6eec('0x4c')](_0x25d3f3[_0x3703b5][_0x6eec('0x4d')])){this[_0x6eec('0x3')]+=0x1;}switch(_0x25d3f3[_0x3703b5][_0x6eec('0x4d')]){case'0':this[_0x6eec('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x6eec('0x7')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x6eec('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x6eec('0x1b')]+=0x1;break;case'8':this[_0x6eec('0x18')]+=0x1;break;}}if(this[_0x6eec('0x25')]==='booked'){var _0x4b4223=Object[_0x6eec('0x4e')](_0x3a4d25);for(var _0x142914=0x0;_0x142914<_0x4b4223[_0x6eec('0x4a')];_0x142914++){var _0x2d0fc0=_0x4b4223[_0x142914];var _0x188359=_0x3a4d25[_0x2d0fc0];if(_0x188359[_0x6eec('0x4f')]===this[_0x6eec('0x13')]&&_0x188359[_0x6eec('0x1e')]===_0x6eec('0x50')&&_0x188359[_0x6eec('0x51')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0x6eec('0x4')]>this[_0x6eec('0x7')]){this[_0x6eec('0x4')]=this['inUse'];}this[_0x6eec('0x23')]=0x0;}return this;};VoiceQueueSummary[_0x6eec('0x46')][_0x6eec('0x52')]=function(_0x149bb2){var _0x386632=![];if(_0x149bb2){_0x386632=INBOUND_COUNTERS[_0x6eec('0x53')](function(_0x10c10a){return this[_0x10c10a]!==_0x149bb2[_0x10c10a];},this);}return _0x386632;};VoiceQueueSummary[_0x6eec('0x46')]['compareToOutboundQueue']=function(_0xdf888d){var _0x37f48e=![];var _0x3374ef=![];var _0x3e77f3=![];if(_0xdf888d){_0x37f48e=this['dialMethod']!==_0xdf888d['dialMethod']||this['dialActive']!==_0xdf888d[_0x6eec('0x24')]||this[_0x6eec('0x54')]!==_0xdf888d[_0x6eec('0x54')]||this[_0x6eec('0x43')]!==_0xdf888d['statusMessage'];_0x3374ef=OUTBOUND_COUNTERS['some'](function(_0x10a173){return this[_0x10a173]!==_0xdf888d[_0x10a173];},this);if(this[_0x6eec('0x44')]&&_0xdf888d[_0x6eec('0x44')]){_0x3e77f3=this['Trunk'][_0x6eec('0x13')]!==_0xdf888d[_0x6eec('0x44')][_0x6eec('0x13')]||this[_0x6eec('0x44')][_0x6eec('0x55')]!==_0xdf888d[_0x6eec('0x44')][_0x6eec('0x55')];}}return _0x37f48e||_0x3374ef||_0x3e77f3;};VoiceQueueSummary[_0x6eec('0x46')][_0x6eec('0x56')]=function(_0x4e921a){this[_0x6eec('0x6')]=_0x4e921a['answered'];this[_0x6eec('0x54')]=_0x4e921a[_0x6eec('0x54')];this[_0x6eec('0x43')]=_0x4e921a[_0x6eec('0x43')];this[_0x6eec('0x8')]=_0x4e921a[_0x6eec('0x8')];this[_0x6eec('0x9')]=_0x4e921a['outboundAbandonedCallsDay'];this[_0x6eec('0x2c')]=_0x4e921a['outboundAnswerCallsDay'];this[_0x6eec('0xa')]=_0x4e921a['outboundBlacklistCallsDay'];this[_0x6eec('0xb')]=_0x4e921a[_0x6eec('0xb')];this[_0x6eec('0xc')]=_0x4e921a[_0x6eec('0xc')];this[_0x6eec('0xd')]=_0x4e921a[_0x6eec('0xd')];this[_0x6eec('0x57')]=_0x4e921a[_0x6eec('0x57')];this[_0x6eec('0xe')]=_0x4e921a[_0x6eec('0xe')];this['outboundRejectCallsDay']=_0x4e921a['outboundRejectCallsDay'];this[_0x6eec('0x10')]=_0x4e921a[_0x6eec('0x10')];this[_0x6eec('0x11')]=_0x4e921a[_0x6eec('0x11')];this[_0x6eec('0x12')]=_0x4e921a['sumDuration'];this[_0x6eec('0x1d')]=_0x4e921a[_0x6eec('0x1d')];if(this['dialMethod']==='preview'){this['pTalking']=_0x4e921a[_0x6eec('0x23')];}};module[_0x6eec('0x58')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index a295fa7..f108cde 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 _0x22ce=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x2ea886,_0x386867){var _0x1d449a=function(_0xec1489){while(--_0xec1489){_0x2ea886['push'](_0x2ea886['shift']());}};_0x1d449a(++_0x386867);}(_0x22ce,0xce));var _0xe22c=function(_0x3a21e5,_0x28ad82){_0x3a21e5=_0x3a21e5-0x0;var _0x2847fa=_0x22ce[_0x3a21e5];return _0x2847fa;};'use strict';function VtigerAccount(_0x592e41){this['id']=_0x592e41['id']||0x0;this[_0xe22c('0x0')]=_0x592e41[_0xe22c('0x0')]||'';this['username']=_0x592e41[_0xe22c('0x1')]||'';this['accessKey']=_0x592e41['accessKey']||'';this[_0xe22c('0x2')]=_0x592e41[_0xe22c('0x2')]||'';this[_0xe22c('0x3')]=_0x592e41[_0xe22c('0x3')]||'';this[_0xe22c('0x4')]=_0x592e41['Configurations']||{};}module[_0xe22c('0x5')]=VtigerAccount; \ No newline at end of file +var _0xe7b3=['name','username','remoteUri','serverUrl','exports'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xe7b3,0xd2));var _0x3e7b=function(_0x3d639c,_0x44b7c3){_0x3d639c=_0x3d639c-0x0;var _0x1f2517=_0xe7b3[_0x3d639c];return _0x1f2517;};'use strict';function VtigerAccount(_0x1c4342){this['id']=_0x1c4342['id']||0x0;this['name']=_0x1c4342[_0x3e7b('0x0')]||'';this[_0x3e7b('0x1')]=_0x1c4342[_0x3e7b('0x1')]||'';this['accessKey']=_0x1c4342['accessKey']||'';this[_0x3e7b('0x2')]=_0x1c4342[_0x3e7b('0x2')]||'';this[_0x3e7b('0x3')]=_0x1c4342[_0x3e7b('0x3')]||'';this['Configurations']=_0x1c4342['Configurations']||{};}module[_0x3e7b('0x4')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 0aa7122..d8b99e2 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 _0x87e6=['password','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x36f24e,_0x59ff00){var _0x438ee9=function(_0xa86429){while(--_0xa86429){_0x36f24e['push'](_0x36f24e['shift']());}};_0x438ee9(++_0x59ff00);}(_0x87e6,0x12e));var _0x687e=function(_0x769261,_0x4c683d){_0x769261=_0x769261-0x0;var _0x5578c3=_0x87e6[_0x769261];return _0x5578c3;};'use strict';function ZendeskAccount(_0x21044d){this['id']=_0x21044d['id']||0x0;this[_0x687e('0x0')]=_0x21044d[_0x687e('0x0')]||'';this['username']=_0x21044d[_0x687e('0x1')]||'';this[_0x687e('0x2')]=_0x21044d['password']||'';this['token']=_0x21044d[_0x687e('0x3')]||'';this[_0x687e('0x4')]=_0x21044d[_0x687e('0x4')]||'';this['authType']=_0x21044d['authType']||'';this['type']=_0x21044d['type']||'integrationTab';this[_0x687e('0x5')]=_0x21044d['serverUrl']||'';this[_0x687e('0x6')]=_0x21044d[_0x687e('0x6')]||{};}module[_0x687e('0x7')]=ZendeskAccount; \ No newline at end of file +var _0xee1c=['username','password','token','remoteUri','authType','type','integrationTab','Configurations'];(function(_0x3a7acc,_0x248e3e){var _0x25eb0b=function(_0x4efd67){while(--_0x4efd67){_0x3a7acc['push'](_0x3a7acc['shift']());}};_0x25eb0b(++_0x248e3e);}(_0xee1c,0x1e8));var _0xcee1=function(_0x47a491,_0x45e171){_0x47a491=_0x47a491-0x0;var _0x3b176b=_0xee1c[_0x47a491];return _0x3b176b;};'use strict';function ZendeskAccount(_0x43e690){this['id']=_0x43e690['id']||0x0;this['name']=_0x43e690['name']||'';this[_0xcee1('0x0')]=_0x43e690['username']||'';this[_0xcee1('0x1')]=_0x43e690[_0xcee1('0x1')]||'';this[_0xcee1('0x2')]=_0x43e690[_0xcee1('0x2')]||'';this[_0xcee1('0x3')]=_0x43e690[_0xcee1('0x3')]||'';this[_0xcee1('0x4')]=_0x43e690['authType']||'';this[_0xcee1('0x5')]=_0x43e690['type']||_0xcee1('0x6');this['serverUrl']=_0x43e690['serverUrl']||'';this['Configurations']=_0x43e690[_0xcee1('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index a596a76..ebf3409 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 _0x763a=['exports','name','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x246568,_0x57af04){var _0x19b302=function(_0x4ae034){while(--_0x4ae034){_0x246568['push'](_0x246568['shift']());}};_0x19b302(++_0x57af04);}(_0x763a,0x97));var _0xa763=function(_0x5c0297,_0x186e96){_0x5c0297=_0x5c0297-0x0;var _0x580590=_0x763a[_0x5c0297];return _0x580590;};'use strict';function ZohoAccount(_0x2812c4){this['id']=_0x2812c4['id']||0x0;this[_0xa763('0x0')]=_0x2812c4[_0xa763('0x0')]||'';this['description']=_0x2812c4['description']||'';this['host']=_0x2812c4[_0xa763('0x1')]||'';this[_0xa763('0x2')]=_0x2812c4['zone']||'';this[_0xa763('0x3')]=_0x2812c4[_0xa763('0x3')]||'';this[_0xa763('0x4')]=_0x2812c4[_0xa763('0x4')]||'';this[_0xa763('0x5')]=_0x2812c4[_0xa763('0x5')]||'';this[_0xa763('0x6')]=_0x2812c4['code']||'';this[_0xa763('0x7')]=_0x2812c4[_0xa763('0x7')]||'';this[_0xa763('0x8')]=_0x2812c4[_0xa763('0x8')]||{};}module[_0xa763('0x9')]=ZohoAccount; \ No newline at end of file +var _0x3905=['host','zone','clientId','serverUrl','code','refreshToken','Configurations','name','description'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x3905,0x19c));var _0x5390=function(_0x4dbc5d,_0x2d0a51){_0x4dbc5d=_0x4dbc5d-0x0;var _0x45b461=_0x3905[_0x4dbc5d];return _0x45b461;};'use strict';function ZohoAccount(_0x21ce18){this['id']=_0x21ce18['id']||0x0;this['name']=_0x21ce18[_0x5390('0x0')]||'';this[_0x5390('0x1')]=_0x21ce18[_0x5390('0x1')]||'';this[_0x5390('0x2')]=_0x21ce18[_0x5390('0x2')]||'';this['zone']=_0x21ce18[_0x5390('0x3')]||'';this[_0x5390('0x4')]=_0x21ce18['clientId']||'';this['clientSecret']=_0x21ce18['clientSecret']||'';this[_0x5390('0x5')]=_0x21ce18[_0x5390('0x5')]||'';this['code']=_0x21ce18[_0x5390('0x6')]||'';this[_0x5390('0x7')]=_0x21ce18[_0x5390('0x7')]||'';this[_0x5390('0x8')]=_0x21ce18[_0x5390('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index e59416c..2c989f7 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 _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x263631,_0x1c9c9e){var _0x1cc685=function(_0x4cef2f){while(--_0x4cef2f){_0x263631['push'](_0x263631['shift']());}};_0x1cc685(++_0x1c9c9e);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0x1eba[_0x867b0a];return _0x137438;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action; \ No newline at end of file +var _0x1eba=['channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','name'];(function(_0x31e59a,_0x4f1968){var _0x363cb8=function(_0x4c45b8){while(--_0x4c45b8){_0x31e59a['push'](_0x31e59a['shift']());}};_0x363cb8(++_0x4f1968);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0x1eba[_0x4f2c3a];return _0x17d91c;};'use strict';var util=require(_0xa1eb('0x0'));var _=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));function checkNameSurname(_0x2158d5,_0x3ef7ee,_0x5865fc){var _0x56c5f2='';if(!_[_0xa1eb('0x3')](_0x3ef7ee)&&_0xa1eb('0x4')===typeof _0x3ef7ee){_0x56c5f2+=_0x3ef7ee;}if(!_[_0xa1eb('0x3')](_0x5865fc)&&_0xa1eb('0x4')===typeof _0x5865fc){_0x56c5f2+='\x20'+_0x5865fc;}if(_0x56c5f2!==''){return _0x56c5f2;}return _0x2158d5;}function Action(_0x138789,_0x2933d0,_0x1d0d67,_0x2bfbb0,_0x39a5a3){this[_0xa1eb('0x5')]=_0x1d0d67||undefined;this[_0xa1eb('0x6')]=_0x138789['id'];this[_0xa1eb('0x7')]=_0x2933d0['name'];this[_0xa1eb('0x8')]=_0x2933d0['type'];this[_0xa1eb('0x9')]='queue';this[_0xa1eb('0xa')]=![];this['membername']=_[_0xa1eb('0x3')](_0x138789['Agent'])?undefined:_0x138789[_0xa1eb('0xb')][_0xa1eb('0xc')];this[_0xa1eb('0xd')]=this['membername']?util[_0xa1eb('0xe')](_0xa1eb('0xf'),this['membername']):_0x2bfbb0||undefined;this[_0xa1eb('0x10')]=checkNameSurname(_0x138789['Contact']['phone'],_0x138789[_0xa1eb('0x11')]['firstName'],_0x138789[_0xa1eb('0x11')][_0xa1eb('0x12')]);this[_0xa1eb('0x13')]=_0x138789[_0xa1eb('0x13')]||![];this[_0xa1eb('0x14')]=_0x138789[_0xa1eb('0x15')];this[_0xa1eb('0x16')]=_0x138789[_0xa1eb('0x16')];this[_0xa1eb('0x17')]=_0x138789['countbusyretry']||0x0;this[_0xa1eb('0x18')]=_0x138789['countcongestionretry']||0x0;this[_0xa1eb('0x19')]=_0x138789[_0xa1eb('0x19')]||0x0;this[_0xa1eb('0x1a')]=(_0x138789[_0xa1eb('0x17')]||0x0)+(_0x138789['countcongestionretry']||0x0)+(_0x138789[_0xa1eb('0x19')]||0x0)+(_0x138789[_0xa1eb('0x1b')]||0x0)+(_0x138789[_0xa1eb('0x1c')]||0x0)+(_0x138789[_0xa1eb('0x1d')]||0x0)+(_0x138789[_0xa1eb('0x1e')]||0x0)+(_0x138789[_0xa1eb('0x1f')]||0x0);this[_0xa1eb('0x1b')]=_0x138789[_0xa1eb('0x1b')]||0x0;this['countdropretry']=_0x138789[_0xa1eb('0x1c')]||0x0;this['countabandonedretry']=_0x138789[_0xa1eb('0x1d')]||0x0;this[_0xa1eb('0x1e')]=_0x138789[_0xa1eb('0x1e')]||0x0;this[_0xa1eb('0x1f')]=_0x138789['countagentrejectretry']||0x0;this['callback']=_0x138789[_0xa1eb('0x20')];this[_0xa1eb('0x21')]=_0x138789['callbackuniqueid'];this[_0xa1eb('0x22')]=_0x138789[_0xa1eb('0x22')];this[_0xa1eb('0x23')]=_0x138789[_0xa1eb('0x23')];this[_0xa1eb('0x24')]=_0x138789[_0xa1eb('0x24')];this[_0xa1eb('0x25')]=_0x138789[_0xa1eb('0x25')];this[_0xa1eb('0x26')]=_[_0xa1eb('0x3')](_0x138789[_0xa1eb('0xb')])?_0x138789[_0xa1eb('0x26')]:_0x138789['Agent']['id'];this[_0xa1eb('0x27')]=_0x138789[_0xa1eb('0x27')];this['originatecalleridnum']='';this[_0xa1eb('0x28')]='';}Action['prototype'][_0xa1eb('0x29')]=function(){return util[_0xa1eb('0xe')]('\x22%s\x22\x20<%s>',this[_0xa1eb('0x10')],this[_0xa1eb('0x2a')]);};module[_0xa1eb('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6794e94..6a3f2ea 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 _0x34e8=['localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','stringify','dialAnswer','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','agentReadyId','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','outboundNoAnswerCallsDay','countnoanswerretry','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','pick','execRun','recallme','isValid','checkIsBlackList','logger','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variables','[originated][increment]','OriginateError','syncNewExten','syncOriginateResponse','lookAgent','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','statedesc','isUndefined','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','filterKey','keys','addVariable','variable','value','error','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','../dialer/utils','redis','defaults'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0x34e8,0x12c));var _0x834e=function(_0x4f8285,_0x31ea74){_0x4f8285=_0x4f8285-0x0;var _0x4e0525=_0x34e8[_0x4f8285];return _0x4e0525;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var uuid=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));var logger=require(_0x834e('0x5'))(_0x834e('0x6'));var loggerAction=require(_0x834e('0x5'))(_0x834e('0x7'));var ami=require(_0x834e('0x8'));var rpcDb=require(_0x834e('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x834e('0xa'));var ut=require('./util/util');var utils=require(_0x834e('0xb'));config[_0x834e('0xc')]=_[_0x834e('0xd')](config[_0x834e('0xc')],{'host':_0x834e('0xe'),'port':0x18eb});var io=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xc')]));var Sequence=function(){};Sequence[_0x834e('0x10')][_0x834e('0x11')]=function(_0x186b3b){this[_0x834e('0x12')]=this[_0x834e('0x12')]?this[_0x834e('0x12')][_0x834e('0x13')](_0x186b3b):_0x186b3b();};function Preview(_0x293514){this[_0x834e('0x14')]=new Sequence();this[_0x834e('0x15')]=_0x293514['voiceQueues'];this[_0x834e('0x16')]=_0x293514[_0x834e('0x16')];this['actions']={};this[_0x834e('0x17')]=_0x293514[_0x834e('0x17')];this[_0x834e('0x18')]=0x0;ami['on'](_0x834e('0x19'),this['syncOriginateResponse'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1b'),this['syncHangup'][_0x834e('0x1a')](this));ami['on']('hanguprequest',this[_0x834e('0x1c')][_0x834e('0x1a')](this));ami['on']('dialend',this[_0x834e('0x1d')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1e'),this['syncNewExten'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1f'),this[_0x834e('0x20')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x21'),this[_0x834e('0x22')][_0x834e('0x1a')](this));ami['on']('blindtransfer',this[_0x834e('0x23')][_0x834e('0x1a')](this));this[_0x834e('0x24')](this[_0x834e('0x15')]);}function emit(_0x4ab05d,_0x45a630,_0x62f8f1){io['to'](_0x4ab05d)['emit'](_0x45a630,_0x62f8f1);}function emitVoiceQueueChannelRemove(_0x1b4bdf){logger[_0x834e('0x25')](_0x834e('0x26'),JSON['stringify'](_0x1b4bdf));emit(util['format'](_0x834e('0x27'),_0x1b4bdf[_0x834e('0x28')]),'voice_queue_channel:remove',_0x1b4bdf);io[_0x834e('0x29')](_0x834e('0x2a'),_0x1b4bdf);}function notSendMessagesQueue(_0x58f4fd){if(_0x58f4fd[_0x834e('0x2b')]){if(_0x58f4fd[_0x834e('0x2c')]===0x0&&_0x58f4fd[_0x834e('0x2d')]===0x0){_0x58f4fd['sendMessageOneNotActive']=![];_0x58f4fd[_0x834e('0x2e')]=0x0;_0x58f4fd[_0x834e('0x2f')]=0x0;_0x58f4fd['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];ut['logger'](_0x834e('0x31'),_0x58f4fd[_0x834e('0x28')]+_0x834e('0x32'));}else{_0x58f4fd[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x35')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x58f4fd['name']+'\x20is\x20deactivated');}}}Preview[_0x834e('0x10')][_0x834e('0x24')]=function(){var _0x106d6a=this;setInterval(function(){_0x106d6a['syncCampaigns']();},0x7cf);};Preview[_0x834e('0x10')][_0x834e('0x36')]=function(){var _0x1f3671=this[_0x834e('0x15')];this[_0x834e('0x18')]+=0x1;for(var _0x390119 in _0x1f3671){if(_0x1f3671[_0x834e('0x37')](_0x390119)&&(_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')||_0x1f3671[_0x390119]['dialMethod']===_0x834e('0x39'))&&_0x1f3671[_0x390119]['type']===_0x834e('0x3a')){if(this[_0x834e('0x18')]>0x7){this[_0x834e('0x18')]=0x0;this[_0x834e('0x3b')]();}}if(_0x1f3671[_0x834e('0x37')](_0x390119)&&_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')&&_0x1f3671[_0x390119][_0x834e('0x3c')]===_0x834e('0x3a')){if(_0x1f3671[_0x390119][_0x834e('0x3d')]){this['setMessage'](_0x1f3671[_0x390119]);if(_0x1f3671[_0x390119][_0x834e('0x3e')])this[_0x834e('0x3f')](_0x1f3671[_0x390119]);}else{notSendMessagesQueue(_0x1f3671[_0x390119]);}}}};Preview[_0x834e('0x10')][_0x834e('0x40')]=function(_0x595cc0){var _0x3f88ad=this;this[_0x834e('0x14')]['enqueue'](function(){if(!_['isNil'](_0x3f88ad['actions'][_0x595cc0])){loggerAction[_0x834e('0x25')](_0x834e('0x41'),_0x595cc0,_0x834e('0x42'),_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')],_0x834e('0x45'),JSON['stringify'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]][_0x834e('0x2c')]),'pTalking:\x20',JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0]['queue']][_0x834e('0x2d')]),JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x47')]),JSON[_0x834e('0x46')](_['pick'](_0x3f88ad[_0x834e('0x43')][_0x595cc0],['contactId','UserId',_0x834e('0x48'),'ListId'])));return ami[_0x834e('0x49')]({'action':_0x834e('0x4a'),'channel':_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x4b')]})[_0x834e('0x4c')](function(_0x574ea8){if(_0x574ea8[_0x834e('0x33')]===_0x834e('0x4d')){setTimeout(function(){if(_0x3f88ad[_0x834e('0x43')][_0x595cc0]){ut['updateOriginated'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']],_0x834e('0x4e'));if(_0x3f88ad['actions'][_0x595cc0][_0x834e('0x47')]===!![]){ut[_0x834e('0x4f')](_0x3f88ad['campaignsPreview'][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]],_0x834e('0x4e'));ut[_0x834e('0x50')](_0x834e('0x51')+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')]);}ut[_0x834e('0x50')]('[Dialer][checkChannel][Preview]'+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']);delete _0x3f88ad[_0x834e('0x43')][_0x595cc0];}},0x2328);}});}});};Preview['prototype'][_0x834e('0x3b')]=function(){var _0x5a5807=this;loggerAction[_0x834e('0x25')](_0x834e('0x52'),_['size'](this[_0x834e('0x43')]));for(var _0x3f2321 in this[_0x834e('0x43')]){if(_0x5a5807[_0x834e('0x43')][_0x834e('0x37')](_0x3f2321)){_0x5a5807[_0x834e('0x40')](_0x3f2321);}}};Preview[_0x834e('0x10')][_0x834e('0x3f')]=function(_0x5dc63b){var _0x279ea1=this;rpcDb['getContactRecallMe'](_0x5dc63b['id'],ut[_0x834e('0x53')](this[_0x834e('0x17')]))['then'](function(_0x112306){if(!_[_0x834e('0x54')](_0x112306)){for(var _0x25b035=0x0;_0x25b035<_0x112306[_0x834e('0x55')];_0x25b035+=0x1){if(ut[_0x834e('0x56')](_0x112306[_0x25b035][_0x834e('0x57')])<_0x5dc63b['dialRecallMeTimeout']*0x3c){if(_0x112306[_0x25b035]['Agent']&&!_0x112306[_0x25b035][_0x834e('0x58')][_0x834e('0x59')]){_0x279ea1[_0x834e('0x5a')](_0x112306[_0x25b035]['id'])[_0x834e('0x5b')](ut[_0x834e('0x5c')](_0x834e('0x5d')))[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x5d')));}else{rpcDb[_0x834e('0x5e')](_0x112306[_0x25b035]['id']);}}else{var _0xf02f0d=new Action(_0x112306[_0x25b035],_0x5dc63b);_0xf02f0d[_0x834e('0x5f')]=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x5dc63b[_0x834e('0x62')]+=0x1;ut[_0x834e('0x63')](_0xf02f0d,0x17,_0x834e('0x64'));if(_0x5dc63b[_0x834e('0x65')]){rpcDb[_0x834e('0x66')](ut[_0x834e('0x67')](_0x112306[_0x25b035]));rpcDb['createCustomerHistory'](_0xf02f0d,_0x834e('0x68'));}else{ut[_0x834e('0x63')](_0xf02f0d,0x16,'RecallFailedTimeout');rpcDb[_0x834e('0x69')](_0xf02f0d,_0x834e('0x6a'));rpcDb['createCustomerFinal'](_0xf02f0d,_0x834e('0x6a'));}}}}})[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x6b')));};Preview[_0x834e('0x10')][_0x834e('0x6c')]=function(_0x4549ba){_0x4549ba['sendMessageOneNotActive']=!![];if(ut[_0x834e('0x6d')](_0x4549ba[_0x834e('0x6e')])){_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x6f')];}else if(!ut[_0x834e('0x70')](_0x4549ba[_0x834e('0x3d')])){_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];}else if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x71')])){if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x72')])){_0x4549ba['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x73')];}else{_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];}};Preview[_0x834e('0x10')][_0x834e('0x75')]=function(_0x315858,_0x3d3f2b,_0x4273f1){var _0x528e66=this;var _0x142334=this[_0x834e('0x43')][_0x3d3f2b];var _0x5d5ac2=this[_0x834e('0x15')][_0x142334['queue']];var _0x3e58ef;var _0x45eceb=![];var _0x5160c4=0x2;var _0x41ef86=0x3;if(_0x5d5ac2){switch(_0x4273f1){case'1':_0x5d5ac2[_0x834e('0x76')]+=0x1;_0x142334[_0x834e('0x77')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x0,_0x834e('0x79'));ami[_0x834e('0x29')]('custom:agentnosuchnumber',ut[_0x834e('0x7a')](_0x142334,_0x834e('0x7b')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x7c'));_0x528e66[_0x834e('0x7d')](_0x142334,'0',_0x5d5ac2)[_0x834e('0x5b')](function(_0x3a1426){_0x45eceb=_0x3a1426[_0x834e('0x7e')]==0x1;_0x5160c4=_0x5d5ac2[_0x834e('0x7f')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0x86'));}else{if(_0x142334[_0x834e('0x77')]>=_0x5d5ac2[_0x834e('0x87')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x86'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnosuchnumberretry',_0x5d5ac2[_0x834e('0x7f')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x142334[_0x834e('0x77')]++;logger['info']('actioncountonusuch',_0x142334[_0x834e('0x77')]);logger[_0x834e('0x25')]('id',_0x142334[_0x834e('0x8c')]);_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnosuchnumberretry':_0x142334[_0x834e('0x77')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case _0x834e('0x8f'):var _0x5a99e6=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x142334['responsetime']=_0x5a99e6;_0x142334['answertime']=_0x5a99e6;_0x142334[_0x834e('0x47')]=!![];_0x5d5ac2[_0x834e('0x2d')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x90'),_0x142334[_0x834e('0x91')],'\x20Queue',_0x5d5ac2[_0x834e('0x28')],_0x834e('0x92'),_0x5d5ac2[_0x834e('0x2d')]);ami[_0x834e('0x29')](_0x834e('0x93'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0x94'),this[_0x834e('0x15')][_0x142334[_0x834e('0x44')]]));if(_0x5d5ac2[_0x834e('0x95')]){ami['emit'](_0x834e('0x96'),ut[_0x834e('0x97')](_0x142334));}break;case'16':ami[_0x834e('0x29')](_0x834e('0x98'),ut['buildObj'](_0x142334,_0x834e('0x99'),this['campaignsPreview'][_0x142334['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x142334,_0x834e('0x99')));_0x5d5ac2[_0x834e('0x9a')]+=0x1;_0x5d5ac2['total']+=0x1;_0x5d5ac2[_0x834e('0x9b')]+=0x1;ut[_0x834e('0x4f')](_0x5d5ac2,'[16]');_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x4,'Answer');rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x9c'));rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x9d'));rpcDb[_0x834e('0x9e')](_0x142334);_0x5d5ac2['sumDuration']+=_0x142334[_0x834e('0x9f')];_0x5d5ac2['sumBillable']+=_0x142334[_0x834e('0x9f')];logger[_0x834e('0x25')](_0x834e('0xa0'),_0x142334['uniqueid'],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],'pTalking:\x20',_0x5d5ac2[_0x834e('0x2d')]);delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'BUSY':_0x5d5ac2[_0x834e('0xa3')]+=0x1;_0x142334[_0x834e('0xa4')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x5,_0x834e('0xa5'));_0x5160c4=_0x5d5ac2[_0x834e('0xa6')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami[_0x834e('0x29')](_0x834e('0xa7'),ut['buildObj'](_0x142334,'busy'));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xa8'));_0x528e66[_0x834e('0x7d')](_0x142334,'5',_0x5d5ac2)[_0x834e('0x5b')](function(_0x37fa2c){_0x45eceb=_0x37fa2c[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xa9'));}else{if(_0x142334[_0x834e('0xa4')]>=_0x5d5ac2['dialBusyMaxRetry']){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xa8'));}else{rpcDb[_0x834e('0x88')](ut['scheduledAt'](_0x142334,_0x834e('0xa4'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xa4')]++;_0x528e66['incrementPreviewCounters']({'id':_0x142334['idContact'],'field':{'countbusyretry':_0x142334[_0x834e('0xa4')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'NOANSWER':_0x5d5ac2[_0x834e('0xaa')]+=0x1;_0x142334[_0x834e('0xab')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x3,'NoAnswer');_0x5160c4=_0x5d5ac2['dialNoAnswerRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];var _0x6735e6=ut[_0x834e('0xac')](_0x142334,_0x5d5ac2);ami[_0x834e('0x29')](_0x834e('0xad'),_0x6735e6);rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xae'));_0x528e66[_0x834e('0x7d')](_0x142334,'3',_0x5d5ac2)[_0x834e('0x5b')](function(_0x17e61a){_0x45eceb=_0x17e61a['additional']==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xaf'));}else{if(_0x142334[_0x834e('0xab')]>=_0x5d5ac2[_0x834e('0xb0')]){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnoanswerretry',_0x5d5ac2[_0x834e('0xb1')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'CONGESTION':_0x5d5ac2[_0x834e('0xb2')]+=0x1;_0x142334[_0x834e('0xb3')]+=0x1;_0x142334['countglobal']=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x8,'Congestion');_0x5160c4=_0x5d5ac2[_0x834e('0xb4')];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];ami['emit'](_0x834e('0xb5'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xb6')));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logCongestion]');_0x528e66[_0x834e('0x7d')](_0x142334,'8',_0x5d5ac2)[_0x834e('0x5b')](function(_0x260934){_0x45eceb=_0x260934[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xb7'));}else{if(_0x142334[_0x834e('0xb3')]>=_0x5d5ac2[_0x834e('0xb8')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xb9'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,_0x834e('0xb3'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xb3')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countcongestionretry':_0x142334[_0x834e('0xb3')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case _0x834e('0xba'):_0x5d5ac2[_0x834e('0xbb')]+=0x1;_0x142334[_0x834e('0xbc')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x14,'AgentReject');_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami['emit'](_0x834e('0xbd'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xbe')));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xbf'));_0x528e66[_0x834e('0x7d')](_0x142334,'20',_0x5d5ac2)[_0x834e('0x5b')](function(_0x1594ef){_0x45eceb=_0x1594ef[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0x14,_0x834e('0xc0'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc1'));}else{if(_0x142334[_0x834e('0xbc')]>=_0x5d5ac2['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x834e('0x89')](_0x142334,_0x834e('0xbc'),_0x5d5ac2['dialAgentRejectRetryFrequency']),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334['countnoanswerretry']++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'ABANDONED':_0x5d5ac2['outboundAbandonedCallsDay']+=0x1;_0x142334[_0x834e('0xc2')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0xb,_0x834e('0xc3'));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logAbandoned]');_0x528e66[_0x834e('0x7d')](_0x142334,'11',_0x5d5ac2)[_0x834e('0x5b')](function(_0x216d1f){_0x45eceb=_0x216d1f[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0xf,'Global');rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc4'));}else{if(_0x142334[_0x834e('0xc5')]>=_0x5d5ac2[_0x834e('0xc6')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xc4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x142334,_0x834e('0xc2'),_0x5d5ac2[_0x834e('0xc7')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'18':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0xc9')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x12,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xce'));_0x528e66[_0x834e('0x7d')](_0x142334,'18',_0x5d5ac2)['then'](function(_0x5f1e3b){_0x45eceb=_0x5f1e3b[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0x12,_0x834e('0x84'));rpcDb['createCustomerFinal'](_0x3e58ef,_0x834e('0xce'));}else{rpcDb['createCustomerFinal'](_0x142334,_0x834e('0xce'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'19':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x13,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xcf'));_0x528e66['verifyAdditionalPhones'](_0x142334,'18',_0x5d5ac2)['then'](function(_0x2df814){_0x45eceb=_0x2df814[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xcf'));}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xcf'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})['then'](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858['linkedid']];break;default:if(_0x142334[_0x834e('0x47')]){ut[_0x834e('0x4f')](_0x5d5ac2,'[default]');ut['loggerError'](_0x834e('0xd0')+_0x5d5ac2[_0x834e('0x28')],_0x315858);}_0x5d5ac2['outboundUnknownCallsDay']+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0xc,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logUnknown]');_0x528e66['verifyAdditionalPhones'](_0x142334,'20',_0x5d5ac2)['then'](function(_0xac9d00){_0x45eceb=_0xac9d00[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xd1'));}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});}});}if(!(_0x142334[_0x834e('0x47')]&&_0x4273f1==='16')){ut['updateOriginated'](_0x5d5ac2,_0x834e('0xd2'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingCustomer]',_0x142334[_0x834e('0x91')],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],_0x834e('0x45'),_0x5d5ac2[_0x834e('0x2c')]);}if(_0x4273f1!==_0x834e('0x8f')){delete this['actions'][_0x315858[_0x834e('0xa2')]];delete this[_0x834e('0x43')][_0x315858[_0x834e('0xd3')]];}_0x5d5ac2[_0x834e('0xd4')]=!![];}};Preview[_0x834e('0x10')][_0x834e('0xd5')]=function(_0x5d3c6d,_0x448420,_0x490a57){if(_['isUndefined'](_0x448420)&&_0x834e('0xd6')!==typeof _0x448420){return;}if(_['isUndefined'](_0x490a57)&&'object'!==typeof _0x490a57){return;}switch(_0x490a57[_0x834e('0xd7')]){case'0':ut[_0x834e('0xd8')](_0x5d3c6d,0x0,_0x834e('0x79'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xda'));break;case'3':ut[_0x834e('0xd8')](_0x5d3c6d,0x3,_0x834e('0xdb'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdc'));break;case'5':ut[_0x834e('0xd8')](_0x5d3c6d,0x5,_0x834e('0xa5'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdd'));break;case'8':ut[_0x834e('0xd8')](_0x5d3c6d,0x8,'Congestion');rpcDb[_0x834e('0xd9')](_0x5d3c6d,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x834e('0xd8')](_0x5d3c6d,0x16,_0x834e('0xde'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdf'));break;default:ut['logAgent'](_0x5d3c6d,0xc,_0x490a57['reason']);rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xe0'));}ut['updateOriginated'](_0x448420,_0x834e('0xe1'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingAgent]',_0x5d3c6d[_0x834e('0x91')],_0x834e('0xa1'),_0x448420[_0x834e('0x28')],_0x834e('0x45'),_0x448420['originated']);delete this['actions'][_0x5d3c6d['uniqueid']];};Preview['prototype'][_0x834e('0x7d')]=function(_0x3c4847,_0x47891e,_0x41ba0c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3c4847,_0x47891e,_0x41ba0c)[_0x834e('0x4c')](logger[_0x834e('0x25')](_0x834e('0xe2')));};Preview[_0x834e('0x10')][_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return cmHopperAdditionalPhone[_0x834e('0x8e')](_0xfa6cdb,_0x3c775f,_0x4fc61d)[_0x834e('0x4c')](logger['info'](_0x834e('0xe3')));};Preview[_0x834e('0x10')]['incrementPreviewCounters']=function(_0x486c18){return Promise['resolve']()[_0x834e('0x5b')](cmHopperAdditionalPhone[_0x834e('0x8d')](_0x486c18))[_0x834e('0x4c')](logger['info'](_0x834e('0xe4')));};Preview[_0x834e('0x10')][_0x834e('0xe5')]=function(_0x17e729,_0x4b4f7c,_0xad7b72,_0x19cb0b,_0x13af70){var _0x8804a8=this;return new Promise(function(_0x102640,_0x48b6c4){if(_['isNil'](_0x4b4f7c)||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe6')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe7')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0x48')])){_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xe8'),_0x19cb0b,_0x13af70));return;}var _0x38151c=uuid['v4']();var _0x97a4b2=_0x8804a8[_0x834e('0x15')][_0x4b4f7c[_0x834e('0x42')][_0x834e('0x28')]];var _0x4b12cd=_0xad7b72?_0x8804a8[_0x834e('0x17')][_0xad7b72]['id']:undefined;_0x8804a8[_0x834e('0x43')][_0x38151c]=new Action(_0x4b4f7c,_0x97a4b2,_0x38151c,_0xad7b72,_0x4b12cd);var _0x3f5b2e=_0x8804a8[_0x834e('0x43')][_0x38151c];_0x3f5b2e['unlockAgent']=_0x19cb0b;_0x3f5b2e['activeContact']=_0x13af70;_0x3f5b2e['lookAgent']=_0xad7b72;if(_[_0x834e('0xe9')](_0x17e729)){_0x8804a8[_0x834e('0xea')](_0x3f5b2e,_0x97a4b2,_0x4b4f7c,_0xad7b72)[_0x834e('0x5b')](function(_0x23d7e6){logger[_0x834e('0x25')](_0x834e('0xeb'),_0x834e('0xec')+_0x3f5b2e[_0x834e('0x44')]+'\x20IdHopper:\x20'+_0x3f5b2e['idContact'],JSON['stringify'](_0x23d7e6));ami['emit'](_0x834e('0xed'),ut[_0x834e('0x7a')](_0x3f5b2e,_0x834e('0xee'),_0x8804a8[_0x834e('0x15')][_0x3f5b2e[_0x834e('0x44')]]));_0x102640(ut[_0x834e('0x33')](_0x834e('0xef')));})[_0x834e('0x4c')](function(_0x33757d){ut['logger']('[Preview][execCall][failure]',_0x33757d);_0x48b6c4(ut['message']('Call\x20failed',_0x19cb0b,_0x13af70));});}else{_0x97a4b2[_0x834e('0xf0')]+=0x1;ut[_0x834e('0xf1')](_0x3f5b2e);rpcDb[_0x834e('0xf2')](_0x3f5b2e,_0x834e('0xf3'));delete _0x8804a8[_0x834e('0x43')][_0x38151c];_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xf4'),_0x19cb0b,_0x13af70));}});};Preview[_0x834e('0x10')][_0x834e('0xf5')]=function(_0xcd64c2){return!_[_0x834e('0x54')](_0xcd64c2)&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0x28')])&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0xf6')])&&_0xcd64c2[_0x834e('0xf6')]&&!_['isNil'](this[_0x834e('0x16')][util['format'](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])])&&!_[_0x834e('0x54')](this['trunks'][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2['name'])]['status'])&&(this[_0x834e('0x16')][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf8')||this[_0x834e('0x16')][util[_0x834e('0x60')]('SIP/%s',_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf9'));};Preview[_0x834e('0x10')][_0x834e('0x5a')]=function(_0x614e15,_0x17aaae){return this['execRun'](_0x614e15,_0x17aaae)[_0x834e('0x5b')](function(_0x59e298){return _['pick'](_0x59e298,[_0x834e('0x33')]);})[_0x834e('0x4c')](function(_0x4b16fa){if(_0x4b16fa[_0x834e('0xfa')]){rpcDb[_0x834e('0xfb')](_0x614e15);}if(_0x4b16fa['active']){rpcDb[_0x834e('0x5e')](_0x614e15);}throw _[_0x834e('0xfc')](_0x4b16fa,['message']);});};Preview['prototype'][_0x834e('0xfd')]=function(_0x2ec9f1,_0x4e6525){var _0x58a935=this;var _0x269ff6,_0xa496aa;return rpcDb['getContactPreview'](_0x2ec9f1)['then'](function(_0x495352){if(!_['isNil'](_0x495352[0x0])){_0xa496aa=_0x495352[0x0][_0x834e('0xfe')]?![]:!![];_0x269ff6=_0x495352[0x0]['recallme']?!![]:![];_0x269ff6=_0x4e6525?!![]:_0x269ff6;}var _0x3be4c3=_0x58a935['validateContact'](_0x495352);if(_0x3be4c3[_0x834e('0xff')]){rpcDb[_0x834e('0x100')](_[_0x834e('0xfc')](_0x495352[0x0],[_0x834e('0x48'),'phone']))[_0x834e('0x5b')](function(_0x446d89){_0x58a935[_0x834e('0xe5')](_0x446d89,_0x495352[0x0],_0x4e6525,_0xa496aa,_0x269ff6)[_0x834e('0x5b')](function(_0x3a3a6c){return _0x3a3a6c;})[_0x834e('0x4c')](function(_0x3d8abb){throw _0x3d8abb;});})[_0x834e('0x4c')](function(_0x464ae6){ut[_0x834e('0x101')]('[Preview][checkIsBlackList]',_0x464ae6);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',_0xa496aa,_0x269ff6);});}else{throw ut[_0x834e('0x33')](_0x3be4c3[_0x834e('0x33')],_0xa496aa,_0x269ff6);}})[_0x834e('0x4c')](function(_0x31a7ae){ut[_0x834e('0x101')]('[Preview][getContactPreview]',_0x31a7ae);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype'][_0x834e('0x102')]=function(_0x30ecb9){if(_[_0x834e('0x54')](_0x30ecb9)||_['isEmpty'](_0x30ecb9)||!_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')])&&_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')][_0x834e('0x28')])){ut[_0x834e('0x101')](_0x834e('0x103'),_0x30ecb9);return{'isValid':![],'message':_0x834e('0x104')};}var _0x125787=this[_0x834e('0x15')][_0x30ecb9[0x0][_0x834e('0x42')]['name']];_0x125787[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];if(_[_0x834e('0x54')](_0x125787)){ut[_0x834e('0x101')](_0x834e('0x105'),_0x125787);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x71')])){ut[_0x834e('0x101')](_0x834e('0x106'),_0x834e('0x107')+_0x125787[_0x834e('0x28')]+_0x834e('0x108'));if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x72')])){ut[_0x834e('0x101')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x125787['name']+_0x834e('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x834e('0x70')](_0x125787[_0x834e('0x3d')])){ut[_0x834e('0x101')](_0x834e('0x10a'),_0x125787[_0x834e('0x28')]+_0x834e('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x125787[_0x834e('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x834e('0xea')]=function(_0x3b9429,_0x52cdd5,_0x5cb379,_0x494e08){var _0x2515f6=this;return new Promise(function(_0x45c8e6,_0x3512d8){var _0x5e0bfe=_0x3b9429[_0x834e('0x91')];var _0x21cb1d=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?util[_0x834e('0x60')](_0x834e('0x10c'),_0x52cdd5['Trunk']['name'],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379[_0x834e('0xe7')][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]):util[_0x834e('0x60')](_0x834e('0x10c'),_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x28')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x28')],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379['phone'][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]);var _0x431f18=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?ut[_0x834e('0x111')](_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')],_0x52cdd5['dialOriginateCallerIdName'],_0x52cdd5[_0x834e('0x113')]>0x0?ut[_0x834e('0x114')](_0x52cdd5[_0x834e('0x115')],_0x52cdd5[_0x834e('0x113')]):_0x52cdd5['dialOriginateCallerIdNumber']):ut[_0x834e('0x111')](_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x112')],_0x52cdd5[_0x834e('0x116')],_0x52cdd5[_0x834e('0x113')]>0x0?ut['getCallerIdRandom'](_0x52cdd5[_0x834e('0x115')],_0x52cdd5['dialRandomLastDigitCallerIdNumber']):_0x52cdd5[_0x834e('0x115')]);if(_0x431f18){_0x3b9429['originatecalleridname']=ut[_0x834e('0x117')](_0x431f18);_0x3b9429[_0x834e('0x118')]=ut[_0x834e('0x119')](_0x431f18);}var _0x2d2268=ut[_0x834e('0x11a')](_0x52cdd5,_0x5cb379,_0x21cb1d,_0x431f18,_0x5e0bfe,_0x3b9429);_['merge'](_0x3b9429,ut[_0x834e('0x11b')](_0x2d2268));_0x3b9429[_0x834e('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x52cdd5[_0x834e('0x11c')]=_0x2d2268;var _0x4db3c5=ut['variablesAction'](_0x3b9429,_0x52cdd5,_0x2d2268,_0x3b9429['activeContact'],_0x494e08);return ami[_0x834e('0x49')](_0x4db3c5)[_0x834e('0x5b')](function(_0xbd9400){_0x52cdd5[_0x834e('0x2c')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x11d'),_0x5e0bfe,_0x834e('0xa1'),_0x52cdd5['name'],_0x834e('0x45'),_0x52cdd5[_0x834e('0x2c')]);_0x45c8e6(_0xbd9400);})['catch'](function(_0x5df60f){ut[_0x834e('0xd8')](_0x3b9429,0xe,_0x834e('0x11e'));rpcDb['createAgentHistory'](_0x3b9429,'[originateFailure][logOriginateFailure]');_0x3512d8(_0x5df60f);});});};Preview[_0x834e('0x10')][_0x834e('0x11f')]=function(_0x42305c){if(this['actions'][_0x42305c[_0x834e('0xa2')]]){this[_0x834e('0x43')][_0x42305c[_0x834e('0xa2')]]['channel']=_0x42305c[_0x834e('0x4b')];}};Preview['prototype'][_0x834e('0x120')]=function(_0x1debf7){var _0x3a1328=this;var _0x10971d=this[_0x834e('0x43')][_0x1debf7['actionid']];if(_0x10971d){if(_0x10971d[_0x834e('0x121')]&&this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]){ut[_0x834e('0x122')](_0x10971d,this[_0x834e('0x17')][_0x10971d['lookAgent']]['name'],this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]['id']);}var _0x13d670=_['clone'](_0x10971d);_0x13d670[_0x834e('0x123')]=moment()[_0x834e('0x60')](_0x834e('0x61'));var _0x386b73=_0x3a1328['campaignsPreview'][_0x10971d[_0x834e('0x44')]];if(ut[_0x834e('0x124')](_0x1debf7['response'])){if(_0x10971d[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x10971d[_0x834e('0x8c')]);}if(_0x10971d[_0x834e('0x8b')]){rpcDb['disableContact'](_0x10971d[_0x834e('0x8c')]);}ami['emit'](_0x834e('0x125'),ut[_0x834e('0x7a')](_0x10971d,_0x834e('0x126'),this[_0x834e('0x15')][_0x10971d[_0x834e('0x44')]]));this[_0x834e('0xd5')](_0x13d670,_0x386b73,_0x1debf7);}else{_0x10971d['starttime']=moment()['format'](_0x834e('0x61'));ut[_0x834e('0xd8')](_0x13d670,0x4,'Answer');rpcDb[_0x834e('0xd9')](_0x13d670,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x834e('0x10')][_0x834e('0x127')]=function(_0x319d6c){var _0x151b58=this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]];var _0x36836f;if(_0x151b58){_0x36836f=this['campaignsPreview'][_0x151b58[_0x834e('0x44')]];logger[_0x834e('0x25')](_0x834e('0x128'),_0x319d6c[_0x834e('0xa2')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);}if(this[_0x834e('0x43')][_0x319d6c['linkedid']]&&_0x319d6c['linkedid']!==_0x319d6c['uniqueid']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')]('[syncHangup][talking][cause]',_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c['cause']);}}else if(_0x151b58&&_[_0x834e('0x54')](_0x151b58[_0x834e('0x12a')])&&_0x36836f['dialQueueProject']&&_0x319d6c[_0x834e('0xa2')]===_0x319d6c[_0x834e('0x91')]&&_[_0x834e('0x54')](_0x319d6c[_0x834e('0xd7')])&&_0x319d6c['cause']==='16'&&_0x319d6c['channelstate']==='6'&&_[_0x834e('0x12b')](_0x151b58['transfer'])){if(_0x151b58[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x151b58[_0x834e('0x8c')]);}if(_0x151b58[_0x834e('0x8b')]){rpcDb[_0x834e('0x5e')](_0x151b58['idContact']);}_0x319d6c[_0x834e('0xd7')]='22';this['callProgressDetectingAgent'](_0x151b58,_0x36836f,_0x319d6c);}else if(_0x151b58&&_0x151b58['transfer']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12c'),_0x319d6c['linkedid'],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this['actions'][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12d'),_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}}};Preview[_0x834e('0x10')][_0x834e('0x1d')]=function(_0x371767){if(this[_0x834e('0x43')][_0x371767[_0x834e('0xd3')]]&&_0x371767[_0x834e('0xd3')]!==_0x371767[_0x834e('0x12e')]){this[_0x834e('0x75')](_0x371767,_0x371767[_0x834e('0xd3')],_0x371767[_0x834e('0xcb')]);}};Preview['prototype'][_0x834e('0x1c')]=function(_0x1cd122){if(this['actions'][_0x1cd122['linkedid']]&&_0x1cd122['linkedid']!==_0x1cd122[_0x834e('0x91')]&&!this[_0x834e('0x43')][_0x1cd122[_0x834e('0xa2')]][_0x834e('0x47')]){if(_0x1cd122[_0x834e('0x129')]==='1'){this[_0x834e('0x75')](_0x1cd122,_0x1cd122[_0x834e('0xa2')],_0x1cd122['cause']);}}};Preview['prototype']['addVariable']=function(_0x47947b,_0x684a97,_0x3c8fc2){if(this[_0x834e('0x43')][_0x47947b]){if(_['isNil'](this['actions'][_0x47947b]['variables'])){this[_0x834e('0x43')][_0x47947b]['variables']={};}this['actions'][_0x47947b][_0x834e('0x11c')][_0x684a97]=_0x3c8fc2;}};Preview[_0x834e('0x10')][_0x834e('0x20')]=function(_0x1acdbd){try{if(!_[_0x834e('0x54')](_0x1acdbd)){if(ut[_0x834e('0x12f')](_[_0x834e('0x130')](_0x1acdbd['variable'])[0x0])){this[_0x834e('0x131')](_0x1acdbd[_0x834e('0x91')],_[_0x834e('0x130')](_0x1acdbd[_0x834e('0x132')])[0x0],_0x1acdbd[_0x834e('0x133')]);}}}catch(_0x488f82){logger[_0x834e('0x134')]('[syncVarSet][Preview]',util[_0x834e('0x135')](_0x488f82,{'showHidden':![],'depth':null}));}};Preview[_0x834e('0x10')][_0x834e('0x22')]=function(_0x57714a){if(_0x57714a){if(this['actions'][_0x57714a['transfertargetlinkedid']]){this['actions'][_0x57714a[_0x834e('0x136')]][_0x834e('0x137')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x20d61c){if(_0x20d61c){if(this[_0x834e('0x43')][_0x20d61c[_0x834e('0x138')]]){this['actions'][_0x20d61c[_0x834e('0x138')]][_0x834e('0x137')]=!![];}}};module[_0x834e('0x139')]=Preview; \ No newline at end of file +var _0x70e0=['[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','callProgressDetectingAgent','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','../../../config/environment','../../../config/logger','preview','../ami','../rpc/cmHopperAdditionalPhone','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','clockClearZombieChannels','hangup','syncHangup','syncHangupRequest','bind','dialend','syncDialEnd','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','info','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','paused','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','CAMPAIGN_STATUS','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','type','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','[clearZombieChannels][talking]','Queue','queue','pick','UserId','VoiceQueueId','ListId','status','catch','message','No\x20such\x20channel','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','clearZombieChannels','[action]','recallMe','agentReadyId','agents','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','dialActive','isTrunkReachable','Trunk','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','dialGlobalMaxRetry','dialBusyMaxRetry','rescheduleContact','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','callAdditionalPhoneAfterMin','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','queueSummaryCountersUpdated','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','Contact','lookAgent','isEmpty','execCall','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlockContact','getContactPreview','recallme','phone','checkInBlack'];(function(_0x524756,_0xaae98a){var _0x1a3286=function(_0x53d335){while(--_0x53d335){_0x524756['push'](_0x524756['shift']());}};_0x1a3286(++_0xaae98a);}(_0x70e0,0x17b));var _0x070e=function(_0x5b78f3,_0x1e2229){_0x5b78f3=_0x5b78f3-0x0;var _0x26d00b=_0x70e0[_0x5b78f3];return _0x26d00b;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var uuid=require(_0x070e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x070e('0x3'));var logger=require(_0x070e('0x4'))(_0x070e('0x5'));var loggerAction=require(_0x070e('0x4'))('actionPreview');var ami=require(_0x070e('0x6'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x070e('0x7'));var Action=require('./action');var ut=require('./util/util');var utils=require('../dialer/utils');config[_0x070e('0x8')]=_[_0x070e('0x9')](config[_0x070e('0x8')],{'host':_0x070e('0xa'),'port':0x18eb});var io=require(_0x070e('0xb'))(new Redis(config[_0x070e('0x8')]));var Sequence=function(){};Sequence[_0x070e('0xc')]['enqueue']=function(_0x49b2fb){this[_0x070e('0xd')]=this[_0x070e('0xd')]?this[_0x070e('0xd')][_0x070e('0xe')](_0x49b2fb):_0x49b2fb();};function Preview(_0xa927a2){this[_0x070e('0xf')]=new Sequence();this[_0x070e('0x10')]=_0xa927a2[_0x070e('0x11')];this[_0x070e('0x12')]=_0xa927a2[_0x070e('0x12')];this[_0x070e('0x13')]={};this['agents']=_0xa927a2['agents'];this[_0x070e('0x14')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0x070e('0x15'),this[_0x070e('0x16')]['bind'](this));ami['on']('hanguprequest',this[_0x070e('0x17')][_0x070e('0x18')](this));ami['on'](_0x070e('0x19'),this[_0x070e('0x1a')]['bind'](this));ami['on']('newexten',this[_0x070e('0x1b')][_0x070e('0x18')](this));ami['on'](_0x070e('0x1c'),this[_0x070e('0x1d')][_0x070e('0x18')](this));ami['on']('attendedtransfer',this[_0x070e('0x1e')][_0x070e('0x18')](this));ami['on'](_0x070e('0x1f'),this[_0x070e('0x20')][_0x070e('0x18')](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x4e958f,_0x9907cf,_0x3004f0){io['to'](_0x4e958f)[_0x070e('0x21')](_0x9907cf,_0x3004f0);}function emitVoiceQueueChannelRemove(_0x4be0d7){logger[_0x070e('0x22')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x070e('0x23')](_0x4be0d7));emit(util[_0x070e('0x24')](_0x070e('0x25'),_0x4be0d7[_0x070e('0x26')]),_0x070e('0x27'),_0x4be0d7);io[_0x070e('0x21')](_0x070e('0x28'),_0x4be0d7);}function notSendMessagesQueue(_0x164cdf){if(_0x164cdf['sendMessageOneNotActive']){if(_0x164cdf[_0x070e('0x29')]===0x0&&_0x164cdf[_0x070e('0x2a')]===0x0){_0x164cdf[_0x070e('0x2b')]=![];_0x164cdf['available']=0x0;_0x164cdf[_0x070e('0x2c')]=0x0;_0x164cdf['message']=utils['CAMPAIGN_STATUS'][_0x070e('0x2d')];ut[_0x070e('0x2e')](_0x070e('0x2f'),_0x164cdf[_0x070e('0x26')]+_0x070e('0x30'));}else{_0x164cdf['message']=utils[_0x070e('0x31')][_0x070e('0x32')];ut[_0x070e('0x2e')](_0x070e('0x2f'),_0x164cdf[_0x070e('0x26')]+_0x070e('0x33'));}}}Preview[_0x070e('0xc')][_0x070e('0x34')]=function(){var _0x5e8326=this;setInterval(function(){_0x5e8326[_0x070e('0x35')]();},0x7cf);};Preview[_0x070e('0xc')][_0x070e('0x35')]=function(){var _0x56fc12=this['campaignsPreview'];this[_0x070e('0x14')]+=0x1;for(var _0x46065c in _0x56fc12){if(_0x56fc12[_0x070e('0x36')](_0x46065c)&&(_0x56fc12[_0x46065c]['dialMethod']===_0x070e('0x5')||_0x56fc12[_0x46065c][_0x070e('0x37')]===_0x070e('0x38'))&&_0x56fc12[_0x46065c][_0x070e('0x39')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x56fc12[_0x070e('0x36')](_0x46065c)&&_0x56fc12[_0x46065c]['dialMethod']===_0x070e('0x5')&&_0x56fc12[_0x46065c][_0x070e('0x39')]==='outbound'){if(_0x56fc12[_0x46065c]['dialActive']){this[_0x070e('0x3a')](_0x56fc12[_0x46065c]);if(_0x56fc12[_0x46065c][_0x070e('0x3b')])this['recallMe'](_0x56fc12[_0x46065c]);}else{notSendMessagesQueue(_0x56fc12[_0x46065c]);}}}};Preview['prototype'][_0x070e('0x3c')]=function(_0x27dd1f){var _0x444d02=this;this[_0x070e('0xf')][_0x070e('0x3d')](function(){if(!_['isNil'](_0x444d02['actions'][_0x27dd1f])){loggerAction[_0x070e('0x22')](_0x070e('0x3e'),_0x27dd1f,_0x070e('0x3f'),_0x444d02[_0x070e('0x13')][_0x27dd1f][_0x070e('0x40')],'originated:\x20',JSON[_0x070e('0x23')](_0x444d02[_0x070e('0x10')][_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]][_0x070e('0x29')]),'pTalking:\x20',JSON['stringify'](_0x444d02['campaignsPreview'][_0x444d02[_0x070e('0x13')][_0x27dd1f][_0x070e('0x40')]][_0x070e('0x2a')]),JSON[_0x070e('0x23')](_0x444d02[_0x070e('0x13')][_0x27dd1f]['dialAnswer']),JSON[_0x070e('0x23')](_[_0x070e('0x41')](_0x444d02[_0x070e('0x13')][_0x27dd1f],['contactId',_0x070e('0x42'),_0x070e('0x43'),_0x070e('0x44')])));return ami['Action']({'action':_0x070e('0x45'),'channel':_0x444d02[_0x070e('0x13')][_0x27dd1f]['channel']})[_0x070e('0x46')](function(_0x5d689b){if(_0x5d689b[_0x070e('0x47')]===_0x070e('0x48')){setTimeout(function(){if(_0x444d02[_0x070e('0x13')][_0x27dd1f]){ut[_0x070e('0x49')](_0x444d02[_0x070e('0x10')][_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]],'[clearZombieChannel]');if(_0x444d02['actions'][_0x27dd1f][_0x070e('0x4a')]===!![]){ut[_0x070e('0x4b')](_0x444d02[_0x070e('0x10')][_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]],_0x070e('0x4c'));ut[_0x070e('0x4d')](_0x070e('0x4e')+_0x27dd1f,_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x27dd1f,_0x444d02['actions'][_0x27dd1f][_0x070e('0x40')]);delete _0x444d02[_0x070e('0x13')][_0x27dd1f];}},0x2328);}});}});};Preview[_0x070e('0xc')][_0x070e('0x4f')]=function(){var _0x34f23e=this;loggerAction['info'](_0x070e('0x50'),_['size'](this[_0x070e('0x13')]));for(var _0x42245d in this[_0x070e('0x13')]){if(_0x34f23e['actions']['hasOwnProperty'](_0x42245d)){_0x34f23e[_0x070e('0x3c')](_0x42245d);}}};Preview['prototype'][_0x070e('0x51')]=function(_0x3fdb75){var _0x139820=this;rpcDb['getContactRecallMe'](_0x3fdb75['id'],ut[_0x070e('0x52')](this[_0x070e('0x53')]))['then'](function(_0x589b97){if(!_[_0x070e('0x54')](_0x589b97)){for(var _0x945901=0x0;_0x945901<_0x589b97[_0x070e('0x55')];_0x945901+=0x1){if(ut[_0x070e('0x56')](_0x589b97[_0x945901][_0x070e('0x57')])<_0x3fdb75['dialRecallMeTimeout']*0x3c){if(_0x589b97[_0x945901][_0x070e('0x58')]&&!_0x589b97[_0x945901][_0x070e('0x58')][_0x070e('0x59')]){_0x139820[_0x070e('0x5a')](_0x589b97[_0x945901]['id'])[_0x070e('0x5b')](ut[_0x070e('0x5c')](_0x070e('0x5d')))[_0x070e('0x46')](ut[_0x070e('0x5c')](_0x070e('0x5d')));}else{rpcDb[_0x070e('0x5e')](_0x589b97[_0x945901]['id']);}}else{var _0x3be553=new Action(_0x589b97[_0x945901],_0x3fdb75);_0x3be553[_0x070e('0x5f')]=moment()[_0x070e('0x24')](_0x070e('0x60'));_0x3fdb75['outboundReCallsDay']+=0x1;ut[_0x070e('0x61')](_0x3be553,0x17,_0x070e('0x62'));if(_0x3fdb75[_0x070e('0x63')]){rpcDb[_0x070e('0x64')](ut[_0x070e('0x65')](_0x589b97[_0x945901]));rpcDb[_0x070e('0x66')](_0x3be553,_0x070e('0x67'));}else{ut[_0x070e('0x61')](_0x3be553,0x16,_0x070e('0x68'));rpcDb['createCustomerHistory'](_0x3be553,_0x070e('0x69'));rpcDb['createCustomerFinal'](_0x3be553,_0x070e('0x69'));}}}}})[_0x070e('0x46')](ut['logger2'](_0x070e('0x6a')));};Preview[_0x070e('0xc')][_0x070e('0x3a')]=function(_0xa74805){_0xa74805[_0x070e('0x2b')]=!![];if(ut[_0x070e('0x6b')](_0xa74805[_0x070e('0x6c')])){_0xa74805['message']=utils[_0x070e('0x31')]['NO_AGENTS_LOGGED'];}else if(!ut['isActive'](_0xa74805[_0x070e('0x6d')])){_0xa74805[_0x070e('0x47')]=utils[_0x070e('0x31')][_0x070e('0x2d')];}else if(!this[_0x070e('0x6e')](_0xa74805[_0x070e('0x6f')])){if(!this[_0x070e('0x6e')](_0xa74805[_0x070e('0x70')])){_0xa74805['message']=utils[_0x070e('0x31')]['UNREACHABLE_TRUNK'];}else{_0xa74805['message']=utils[_0x070e('0x31')][_0x070e('0x71')];}}else{_0xa74805['message']=utils[_0x070e('0x31')][_0x070e('0x71')];}};Preview[_0x070e('0xc')][_0x070e('0x72')]=function(_0x1aacfc,_0x382ce3,_0x1b36cd){var _0x4ef647=this;var _0x5874cd=this['actions'][_0x382ce3];var _0x3087e5=this[_0x070e('0x10')][_0x5874cd[_0x070e('0x40')]];var _0x2f8fcb;var _0x5ac0b5=![];var _0x25f34c=0x2;var _0x5d3c3a=0x3;if(_0x3087e5){switch(_0x1b36cd){case'1':_0x3087e5[_0x070e('0x73')]+=0x1;_0x5874cd[_0x070e('0x74')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x0,_0x070e('0x77'));ami['emit'](_0x070e('0x78'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0x7a')));rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0x7b'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'0',_0x3087e5)['then'](function(_0x1f1df5){_0x5ac0b5=_0x1f1df5['additional']==0x1;_0x25f34c=_0x3087e5[_0x070e('0x7d')];_0x5d3c3a=_0x3087e5['callAdditionalPhoneAfterMin'];if(!_0x5ac0b5){if(ut['totalGlobal'](_0x5874cd)>=_0x3087e5['dialGlobalMaxRetry']){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0x81'));}else{if(_0x5874cd[_0x070e('0x74')]>=_0x3087e5[_0x070e('0x82')]){rpcDb['createCustomerFinal'](_0x5874cd,_0x070e('0x81'));}else{rpcDb['rescheduleContact'](ut[_0x070e('0x83')](_0x5874cd,'countnosuchnumberretry',_0x3087e5[_0x070e('0x7d')]),_0x5874cd[_0x070e('0x84')],_0x5874cd['activeContact']);}}delete this[_0x070e('0x13')][_0x1aacfc['linkedid']];}else{_0x5874cd[_0x070e('0x74')]++;logger[_0x070e('0x22')](_0x070e('0x85'),_0x5874cd[_0x070e('0x74')]);logger[_0x070e('0x22')]('id',_0x5874cd[_0x070e('0x86')]);_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnosuchnumberretry':_0x5874cd[_0x070e('0x74')]}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0x89'):var _0x20bcf3=moment()['format'](_0x070e('0x60'));_0x5874cd[_0x070e('0x8a')]=_0x20bcf3;_0x5874cd[_0x070e('0x8b')]=_0x20bcf3;_0x5874cd[_0x070e('0x4a')]=!![];_0x3087e5['pTalking']+=0x1;logger[_0x070e('0x22')](_0x070e('0x8c'),_0x5874cd[_0x070e('0x8d')],_0x070e('0x8e'),_0x3087e5[_0x070e('0x26')],_0x070e('0x8f'),_0x3087e5['pTalking']);ami[_0x070e('0x21')](_0x070e('0x90'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0x91'),this['campaignsPreview'][_0x5874cd[_0x070e('0x40')]]));if(_0x3087e5['acw']){ami[_0x070e('0x21')](_0x070e('0x92'),ut[_0x070e('0x93')](_0x5874cd));}break;case'16':ami[_0x070e('0x21')](_0x070e('0x94'),ut['buildObj'](_0x5874cd,_0x070e('0x95'),this[_0x070e('0x10')][_0x5874cd[_0x070e('0x40')]]));emitVoiceQueueChannelRemove(ut[_0x070e('0x79')](_0x5874cd,'complete'));_0x3087e5[_0x070e('0x96')]+=0x1;_0x3087e5['total']+=0x1;_0x3087e5[_0x070e('0x97')]+=0x1;ut[_0x070e('0x4b')](_0x3087e5,_0x070e('0x98'));_0x5874cd['countglobal']=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x4,_0x070e('0x99'));rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0x9a'));rpcDb[_0x070e('0x80')](_0x5874cd,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x070e('0x9b')](_0x5874cd);_0x3087e5['sumDuration']+=_0x5874cd[_0x070e('0x9c')];_0x3087e5[_0x070e('0x9d')]+=_0x5874cd['talktime'];logger['info'](_0x070e('0x9e'),_0x5874cd[_0x070e('0x8d')],_0x070e('0x8e'),_0x3087e5[_0x070e('0x26')],_0x070e('0x8f'),_0x3087e5[_0x070e('0x2a')]);delete this[_0x070e('0x13')][_0x1aacfc[_0x070e('0x9f')]];break;case _0x070e('0xa0'):_0x3087e5[_0x070e('0xa1')]+=0x1;_0x5874cd[_0x070e('0xa2')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x5,_0x070e('0xa3'));_0x25f34c=_0x3087e5[_0x070e('0xa4')];_0x5d3c3a=_0x3087e5['callAdditionalPhoneAfterMin'];ami['emit'](_0x070e('0xa5'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0xa6')));rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xa7'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'5',_0x3087e5)[_0x070e('0x5b')](function(_0x110813){_0x5ac0b5=_0x110813[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb['createCustomerFinal'](_0x2f8fcb,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x5874cd['countbusyretry']>=_0x3087e5[_0x070e('0xaa')]){rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xa7'));}else{rpcDb[_0x070e('0xab')](ut['scheduledAt'](_0x5874cd,_0x070e('0xa2'),_0x3087e5[_0x070e('0xa4')]),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xa2')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd['idContact'],'field':{'countbusyretry':_0x5874cd[_0x070e('0xa2')]}})['then'](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0xad'):_0x3087e5[_0x070e('0xae')]+=0x1;_0x5874cd[_0x070e('0xaf')]+=0x1;_0x5874cd['countglobal']=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x3,'NoAnswer');_0x25f34c=_0x3087e5[_0x070e('0xb0')];_0x5d3c3a=_0x3087e5[_0x070e('0xb1')];var _0x553ea1=ut[_0x070e('0xb2')](_0x5874cd,_0x3087e5);ami[_0x070e('0x21')](_0x070e('0xb3'),_0x553ea1);rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0xb4'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'3',_0x3087e5)[_0x070e('0x5b')](function(_0x1ad0bf){_0x5ac0b5=_0x1ad0bf[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xb5'));}else{if(_0x5874cd[_0x070e('0xaf')]>=_0x3087e5[_0x070e('0xb6')]){rpcDb['createCustomerFinal'](_0x5874cd,_0x070e('0xb4'));}else{rpcDb[_0x070e('0xab')](ut[_0x070e('0x83')](_0x5874cd,_0x070e('0xaf'),_0x3087e5[_0x070e('0xb0')]),_0x5874cd[_0x070e('0x84')],_0x5874cd['activeContact']);}}}else{_0x5874cd['countnoanswerretry']++;_0x4ef647['incrementPreviewCounters']({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd[_0x070e('0xaf')]}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)['then'](function(){});});}});break;case _0x070e('0xb7'):_0x3087e5[_0x070e('0xb8')]+=0x1;_0x5874cd[_0x070e('0xb9')]+=0x1;_0x5874cd['countglobal']=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x8,_0x070e('0xba'));_0x25f34c=_0x3087e5[_0x070e('0xbb')];_0x5d3c3a=_0x3087e5['callAdditionalPhoneAfterMin'];ami['emit'](_0x070e('0xbc'),ut[_0x070e('0x79')](_0x5874cd,'congestion'));rpcDb[_0x070e('0x66')](_0x5874cd,'[callProgressDetectingCustomer][logCongestion]');_0x4ef647['verifyAdditionalPhones'](_0x5874cd,'8',_0x3087e5)['then'](function(_0x15480c){_0x5ac0b5=_0x15480c[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xbd'));}else{if(_0x5874cd[_0x070e('0xb9')]>=_0x3087e5[_0x070e('0xbe')]){rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xbf'));}else{rpcDb[_0x070e('0xab')](ut[_0x070e('0x83')](_0x5874cd,_0x070e('0xb9'),_0x3087e5[_0x070e('0xa4')]),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xb9')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countcongestionretry':_0x5874cd[_0x070e('0xb9')]}})['then'](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0xc0'):_0x3087e5[_0x070e('0xc1')]+=0x1;_0x5874cd['countagentrejectretry']+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x14,_0x070e('0xc2'));_0x25f34c=_0x3087e5[_0x070e('0xc3')];_0x5d3c3a=_0x3087e5[_0x070e('0xb1')];ami['emit']('custom:agentreject',ut['buildObj'](_0x5874cd,_0x070e('0xc4')));rpcDb['createCustomerHistory'](_0x5874cd,_0x070e('0xc5'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'20',_0x3087e5)['then'](function(_0x912f24){_0x5ac0b5=_0x912f24[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut['totalGlobal'](_0x5874cd)>=_0x3087e5['dialGlobalMaxRetry']){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0x14,_0x070e('0xc2'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xc6'));}else{if(_0x5874cd[_0x070e('0xc7')]>=_0x3087e5['dialAgentRejectMaxRetry']){rpcDb[_0x070e('0x80')](_0x5874cd,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x070e('0xab')](ut[_0x070e('0x83')](_0x5874cd,'countagentrejectretry',_0x3087e5[_0x070e('0xc3')]),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd['countnoanswerretry']}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case _0x070e('0xc8'):_0x3087e5[_0x070e('0xc9')]+=0x1;_0x5874cd['countabandonedretry']+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0xb,_0x070e('0xca'));rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xcb'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'11',_0x3087e5)[_0x070e('0x5b')](function(_0x1fb1e6){_0x5ac0b5=_0x1fb1e6[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xcb'));}else{if(_0x5874cd['countabandonedetry']>=_0x3087e5['dialAbandonedMaxRety']){rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xcb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x5874cd,'countabandonedretry',_0x3087e5['dialAbandonedRetryFrequency']),_0x5874cd[_0x070e('0x84')],_0x5874cd[_0x070e('0xac')]);}}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd[_0x070e('0xaf')]}})[_0x070e('0x5b')](function(){_0x4ef647[_0x070e('0x88')](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});break;case'18':_0x3087e5[_0x070e('0xcc')]+=0x1;_0x5874cd['countmachineretry']+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut['logCustomer'](_0x5874cd,0x12,_0x1aacfc[_0x070e('0xcd')]||_0x1aacfc[_0x070e('0xce')]);ami[_0x070e('0x21')](_0x070e('0xcf'),ut['buildObj'](_0x5874cd,_0x070e('0xd0')));rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xd1'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'18',_0x3087e5)['then'](function(_0x4096ae){_0x5ac0b5=_0x4096ae[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0x12,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xd1'));}else{rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xd1'));}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647['incrementPreviewCounters']({'id':_0x5874cd[_0x070e('0x86')],'field':{'countnoanswerretry':_0x5874cd[_0x070e('0xaf')]}})['then'](function(){_0x4ef647['swapAdditionalPhones'](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});delete this['actions'][_0x1aacfc[_0x070e('0x9f')]];break;case'19':_0x3087e5[_0x070e('0xcc')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut[_0x070e('0x76')](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0x13,_0x1aacfc[_0x070e('0xcd')]||_0x1aacfc[_0x070e('0xce')]);ami['emit'](_0x070e('0xcf'),ut[_0x070e('0x79')](_0x5874cd,_0x070e('0xd0')));rpcDb[_0x070e('0x66')](_0x5874cd,'[callProgressDetectingCustomer][machine]');_0x4ef647['verifyAdditionalPhones'](_0x5874cd,'18',_0x3087e5)[_0x070e('0x5b')](function(_0x205305){_0x5ac0b5=_0x205305[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut['totalGlobal'](_0x5874cd)>=_0x3087e5[_0x070e('0xa9')]){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,'Global');rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xd2'));}else{rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xd2'));}}else{_0x5874cd[_0x070e('0xaf')]++;_0x4ef647[_0x070e('0x87')]({'id':_0x5874cd['idContact'],'field':{'countnoanswerretry':_0x5874cd['countnoanswerretry']}})[_0x070e('0x5b')](function(){_0x4ef647['swapAdditionalPhones'](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});});}});delete this[_0x070e('0x13')][_0x1aacfc['linkedid']];break;default:if(_0x5874cd[_0x070e('0x4a')]){ut['decrementTalkink'](_0x3087e5,_0x070e('0xd3'));ut[_0x070e('0x4d')](_0x070e('0xd4')+_0x3087e5[_0x070e('0x26')],_0x1aacfc);}_0x3087e5[_0x070e('0xcc')]+=0x1;_0x5874cd[_0x070e('0x75')]=ut['totalGlobal'](_0x5874cd);ut[_0x070e('0x61')](_0x5874cd,0xc,_0x1aacfc[_0x070e('0xcd')]||_0x1aacfc['dialstatus']);_0x25f34c=_0x3087e5['dialAgentRejectRetryFrequency'];_0x5d3c3a=_0x3087e5[_0x070e('0xb1')];rpcDb[_0x070e('0x66')](_0x5874cd,_0x070e('0xd5'));_0x4ef647[_0x070e('0x7c')](_0x5874cd,'20',_0x3087e5)[_0x070e('0x5b')](function(_0x3e2c30){_0x5ac0b5=_0x3e2c30[_0x070e('0xa8')]==0x1;if(!_0x5ac0b5){if(ut[_0x070e('0x76')](_0x5874cd)>=_0x3087e5['dialGlobalMaxRetry']){_0x2f8fcb=ut[_0x070e('0x7e')](_0x5874cd,0xf,_0x070e('0x7f'));rpcDb[_0x070e('0x80')](_0x2f8fcb,_0x070e('0xd6'));}else{rpcDb[_0x070e('0x80')](_0x5874cd,_0x070e('0xd6'));}delete this[_0x070e('0x13')][_0x1aacfc[_0x070e('0x9f')]];}else{_0x4ef647['swapAdditionalPhones'](_0x5874cd,_0x25f34c,_0x5d3c3a)[_0x070e('0x5b')](function(){});}});}if(!(_0x5874cd[_0x070e('0x4a')]&&_0x1b36cd==='16')){ut[_0x070e('0x49')](_0x3087e5,_0x070e('0xd7'));logger[_0x070e('0x22')](_0x070e('0xd8'),_0x5874cd[_0x070e('0x8d')],_0x070e('0x8e'),_0x3087e5[_0x070e('0x26')],_0x070e('0xd9'),_0x3087e5['originated']);}if(_0x1b36cd!=='ANSWER'){delete this[_0x070e('0x13')][_0x1aacfc[_0x070e('0x9f')]];delete this[_0x070e('0x13')][_0x1aacfc['destlinkedid']];}_0x3087e5[_0x070e('0xda')]=!![];}};Preview[_0x070e('0xc')]['callProgressDetectingAgent']=function(_0x26901c,_0x2b6909,_0x2f34b9){if(_[_0x070e('0xdb')](_0x2b6909)&&_0x070e('0xdc')!==typeof _0x2b6909){return;}if(_[_0x070e('0xdb')](_0x2f34b9)&&'object'!==typeof _0x2f34b9){return;}switch(_0x2f34b9['reason']){case'0':ut[_0x070e('0xdd')](_0x26901c,0x0,_0x070e('0x77'));rpcDb['createAgentHistory'](_0x26901c,_0x070e('0xde'));break;case'3':ut[_0x070e('0xdd')](_0x26901c,0x3,_0x070e('0xdf'));rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe1'));break;case'5':ut[_0x070e('0xdd')](_0x26901c,0x5,'Busy');rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe2'));break;case'8':ut['logAgent'](_0x26901c,0x8,_0x070e('0xba'));rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe3'));break;case'22':ut[_0x070e('0xdd')](_0x26901c,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x26901c,_0x070e('0xe4'));break;default:ut[_0x070e('0xdd')](_0x26901c,0xc,_0x2f34b9[_0x070e('0xe5')]);rpcDb[_0x070e('0xe0')](_0x26901c,_0x070e('0xe3'));}ut[_0x070e('0x49')](_0x2b6909,_0x070e('0xe6'));logger[_0x070e('0x22')](_0x070e('0xe7'),_0x26901c[_0x070e('0x8d')],'\x20Queue',_0x2b6909[_0x070e('0x26')],_0x070e('0xd9'),_0x2b6909[_0x070e('0x29')]);delete this[_0x070e('0x13')][_0x26901c['uniqueid']];};Preview[_0x070e('0xc')][_0x070e('0x7c')]=function(_0x510bce,_0x4b559b,_0x27c346){return cmHopperAdditionalPhone[_0x070e('0x7c')](_0x510bce,_0x4b559b,_0x27c346)[_0x070e('0x46')](logger['info'](_0x070e('0xe8')));};Preview[_0x070e('0xc')][_0x070e('0x88')]=function(_0x2e21cf,_0x34b5ae,_0x5605da){return cmHopperAdditionalPhone[_0x070e('0x88')](_0x2e21cf,_0x34b5ae,_0x5605da)[_0x070e('0x46')](logger['info'](_0x070e('0xe9')));};Preview['prototype']['incrementPreviewCounters']=function(_0x48b0aa){return Promise[_0x070e('0xea')]()[_0x070e('0x5b')](cmHopperAdditionalPhone[_0x070e('0x87')](_0x48b0aa))[_0x070e('0x46')](logger['info'](_0x070e('0xeb')));};Preview[_0x070e('0xc')]['checkInBlack']=function(_0x3c6a6e,_0xa9694a,_0x24448e,_0x41afe5,_0x4ea0a6){var _0x445182=this;return new Promise(function(_0x50fbb4,_0x40ff1b){if(_['isNil'](_0xa9694a)||_[_0x070e('0x54')](_0xa9694a[_0x070e('0xec')])||_[_0x070e('0x54')](_0xa9694a['phone'])||_[_0x070e('0x54')](_0xa9694a[_0x070e('0x43')])){_0x40ff1b(ut[_0x070e('0x47')]('Contact\x20is\x20undefined',_0x41afe5,_0x4ea0a6));return;}var _0xbaed32=uuid['v4']();var _0x3a5086=_0x445182['campaignsPreview'][_0xa9694a[_0x070e('0x3f')][_0x070e('0x26')]];var _0x478e5b=_0x24448e?_0x445182['agents'][_0x24448e]['id']:undefined;_0x445182['actions'][_0xbaed32]=new Action(_0xa9694a,_0x3a5086,_0xbaed32,_0x24448e,_0x478e5b);var _0x5e1fee=_0x445182[_0x070e('0x13')][_0xbaed32];_0x5e1fee[_0x070e('0x84')]=_0x41afe5;_0x5e1fee[_0x070e('0xac')]=_0x4ea0a6;_0x5e1fee[_0x070e('0xed')]=_0x24448e;if(_[_0x070e('0xee')](_0x3c6a6e)){_0x445182[_0x070e('0xef')](_0x5e1fee,_0x3a5086,_0xa9694a,_0x24448e)[_0x070e('0x5b')](function(_0x472fc9){logger['info']('[Preview][execCall][success]','Queue:\x20'+_0x5e1fee['queue']+_0x070e('0xf0')+_0x5e1fee[_0x070e('0x86')],JSON[_0x070e('0x23')](_0x472fc9));ami[_0x070e('0x21')](_0x070e('0xf1'),ut['buildObj'](_0x5e1fee,'called',_0x445182[_0x070e('0x10')][_0x5e1fee[_0x070e('0x40')]]));_0x50fbb4(ut['message'](_0x070e('0xf2')));})[_0x070e('0x46')](function(_0x239385){ut[_0x070e('0x2e')](_0x070e('0xf3'),_0x239385);_0x40ff1b(ut[_0x070e('0x47')]('Call\x20failed',_0x41afe5,_0x4ea0a6));});}else{_0x3a5086[_0x070e('0xf4')]+=0x1;ut[_0x070e('0xf5')](_0x5e1fee);rpcDb[_0x070e('0xf6')](_0x5e1fee,'[Blacklist][error]');delete _0x445182[_0x070e('0x13')][_0xbaed32];_0x40ff1b(ut[_0x070e('0x47')](_0x070e('0xf7'),_0x41afe5,_0x4ea0a6));}});};Preview[_0x070e('0xc')]['isTrunkReachable']=function(_0x4175b9){return!_[_0x070e('0x54')](_0x4175b9)&&!_['isNil'](_0x4175b9[_0x070e('0x26')])&&!_[_0x070e('0x54')](_0x4175b9['active'])&&_0x4175b9[_0x070e('0xf8')]&&!_['isNil'](this[_0x070e('0x12')][util['format'](_0x070e('0xf9'),_0x4175b9['name'])])&&!_['isNil'](this[_0x070e('0x12')][util['format']('SIP/%s',_0x4175b9[_0x070e('0x26')])][_0x070e('0x45')])&&(this[_0x070e('0x12')][util[_0x070e('0x24')](_0x070e('0xf9'),_0x4175b9['name'])][_0x070e('0x45')]===_0x070e('0xfa')||this[_0x070e('0x12')][util[_0x070e('0x24')](_0x070e('0xf9'),_0x4175b9[_0x070e('0x26')])]['status']===_0x070e('0xfb'));};Preview[_0x070e('0xc')][_0x070e('0x5a')]=function(_0x44c780,_0x5817a0){return this['execRun'](_0x44c780,_0x5817a0)[_0x070e('0x5b')](function(_0x324641){return _[_0x070e('0x41')](_0x324641,[_0x070e('0x47')]);})[_0x070e('0x46')](function(_0x150ff2){if(_0x150ff2['unlock']){rpcDb[_0x070e('0xfc')](_0x44c780);}if(_0x150ff2[_0x070e('0xf8')]){rpcDb[_0x070e('0x5e')](_0x44c780);}throw _[_0x070e('0x41')](_0x150ff2,[_0x070e('0x47')]);});};Preview[_0x070e('0xc')]['execRun']=function(_0x4aabc3,_0x9b1fb1){var _0x43e514=this;var _0x193c72,_0x150bfb;return rpcDb[_0x070e('0xfd')](_0x4aabc3)[_0x070e('0x5b')](function(_0x257569){if(!_['isNil'](_0x257569[0x0])){_0x150bfb=_0x257569[0x0][_0x070e('0xfe')]?![]:!![];_0x193c72=_0x257569[0x0]['recallme']?!![]:![];_0x193c72=_0x9b1fb1?!![]:_0x193c72;}var _0xfe12a6=_0x43e514['validateContact'](_0x257569);if(_0xfe12a6['isValid']){rpcDb['checkIsBlackList'](_[_0x070e('0x41')](_0x257569[0x0],[_0x070e('0x43'),_0x070e('0xff')]))[_0x070e('0x5b')](function(_0xec8bee){_0x43e514[_0x070e('0x100')](_0xec8bee,_0x257569[0x0],_0x9b1fb1,_0x150bfb,_0x193c72)[_0x070e('0x5b')](function(_0x37285d){return _0x37285d;})[_0x070e('0x46')](function(_0x538bd4){throw _0x538bd4;});})[_0x070e('0x46')](function(_0x170efa){ut[_0x070e('0x2e')](_0x070e('0x101'),_0x170efa);throw ut[_0x070e('0x47')](_0x070e('0x102'),_0x150bfb,_0x193c72);});}else{throw ut[_0x070e('0x47')](_0xfe12a6[_0x070e('0x47')],_0x150bfb,_0x193c72);}})[_0x070e('0x46')](function(_0x4ad025){ut['logger'](_0x070e('0x103'),_0x4ad025);throw ut[_0x070e('0x47')]('Call\x20unsuccessful',![],!![]);});};Preview[_0x070e('0xc')]['validateContact']=function(_0x48d26c){if(_[_0x070e('0x54')](_0x48d26c)||_[_0x070e('0xee')](_0x48d26c)||!_['isNil'](_0x48d26c[0x0][_0x070e('0x58')])&&_[_0x070e('0x54')](_0x48d26c[0x0][_0x070e('0x58')]['name'])){ut['logger'](_0x070e('0x104'),_0x48d26c);return{'isValid':![],'message':_0x070e('0x105')};}var _0x21d392=this['campaignsPreview'][_0x48d26c[0x0][_0x070e('0x3f')][_0x070e('0x26')]];_0x21d392['message']=utils[_0x070e('0x31')][_0x070e('0x71')];if(_[_0x070e('0x54')](_0x21d392)){ut[_0x070e('0x2e')](_0x070e('0x106'),_0x21d392);return{'isValid':![],'message':_0x070e('0x107')};}if(!this[_0x070e('0x6e')](_0x21d392[_0x070e('0x6f')])){ut[_0x070e('0x2e')](_0x070e('0x108'),_0x070e('0x109')+_0x21d392[_0x070e('0x26')]+_0x070e('0x10a'));if(!this[_0x070e('0x6e')](_0x21d392[_0x070e('0x70')])){ut[_0x070e('0x2e')](_0x070e('0x108'),_0x21d392['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut['isActive'](_0x21d392[_0x070e('0x6d')])){ut[_0x070e('0x2e')](_0x070e('0x10b'),_0x21d392['name']+_0x070e('0x10c'));return{'isValid':![],'message':_0x070e('0x109')+_0x21d392[_0x070e('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x070e('0x10d')};};Preview[_0x070e('0xc')][_0x070e('0xef')]=function(_0x3ef1b3,_0x526afc,_0x7f803a,_0x3967bd){var _0x4717de=this;return new Promise(function(_0x4fde12,_0xcd40c1){var _0x417350=_0x3ef1b3[_0x070e('0x8d')];var _0x220cc9=_0x4717de[_0x070e('0x6e')](_0x526afc[_0x070e('0x6f')])?util[_0x070e('0x24')](_0x070e('0x10e'),_0x526afc[_0x070e('0x6f')]['name'],_['isNil'](_0x526afc[_0x070e('0x10f')])?'':_0x526afc['dialPrefix']['trim']()||'',_0x526afc[_0x070e('0x110')]>0x0?_0x7f803a[_0x070e('0xff')][_0x070e('0x111')](_0x526afc[_0x070e('0x110')]):_0x7f803a[_0x070e('0xff')]):util[_0x070e('0x24')]('SIP/%s/%s%s',_[_0x070e('0x54')](_0x526afc[_0x070e('0x70')])?_0x526afc[_0x070e('0x6f')][_0x070e('0x26')]:_0x526afc['TrunkBackup'][_0x070e('0x26')],_['isNil'](_0x526afc[_0x070e('0x10f')])?'':_0x526afc[_0x070e('0x10f')][_0x070e('0x112')]()||'',_0x526afc[_0x070e('0x110')]>0x0?_0x7f803a[_0x070e('0xff')][_0x070e('0x111')](_0x526afc[_0x070e('0x110')]):_0x7f803a[_0x070e('0xff')]);var _0x2b4e74=_0x4717de['isTrunkReachable'](_0x526afc[_0x070e('0x6f')])?ut[_0x070e('0x113')](_0x526afc[_0x070e('0x6f')][_0x070e('0x114')],_0x526afc[_0x070e('0x115')],_0x526afc[_0x070e('0x116')]>0x0?ut[_0x070e('0x117')](_0x526afc[_0x070e('0x118')],_0x526afc['dialRandomLastDigitCallerIdNumber']):_0x526afc[_0x070e('0x118')]):ut[_0x070e('0x113')](_['isNil'](_0x526afc['TrunkBackup'])?_0x526afc[_0x070e('0x6f')][_0x070e('0x114')]:_0x526afc[_0x070e('0x70')][_0x070e('0x114')],_0x526afc[_0x070e('0x115')],_0x526afc[_0x070e('0x116')]>0x0?ut['getCallerIdRandom'](_0x526afc['dialOriginateCallerIdNumber'],_0x526afc[_0x070e('0x116')]):_0x526afc[_0x070e('0x118')]);if(_0x2b4e74){_0x3ef1b3['originatecalleridname']=ut[_0x070e('0x119')](_0x2b4e74);_0x3ef1b3['originatecalleridnum']=ut[_0x070e('0x11a')](_0x2b4e74);}var _0xa2c957=ut['addVariables'](_0x526afc,_0x7f803a,_0x220cc9,_0x2b4e74,_0x417350,_0x3ef1b3);_[_0x070e('0x11b')](_0x3ef1b3,ut[_0x070e('0x11c')](_0xa2c957));_0x3ef1b3['starttime']=moment()['format'](_0x070e('0x60'));_0x526afc['variables']=_0xa2c957;var _0x1ebec9=ut[_0x070e('0x11d')](_0x3ef1b3,_0x526afc,_0xa2c957,_0x3ef1b3[_0x070e('0xac')],_0x3967bd);return ami['Action'](_0x1ebec9)[_0x070e('0x5b')](function(_0x17adf3){_0x526afc['originated']+=0x1;logger[_0x070e('0x22')](_0x070e('0x11e'),_0x417350,_0x070e('0x8e'),_0x526afc[_0x070e('0x26')],_0x070e('0xd9'),_0x526afc[_0x070e('0x29')]);_0x4fde12(_0x17adf3);})[_0x070e('0x46')](function(_0x358e1b){ut[_0x070e('0xdd')](_0x3ef1b3,0xe,_0x070e('0x11f'));rpcDb['createAgentHistory'](_0x3ef1b3,_0x070e('0x120'));_0xcd40c1(_0x358e1b);});});};Preview[_0x070e('0xc')][_0x070e('0x1b')]=function(_0x52d89d){if(this['actions'][_0x52d89d[_0x070e('0x9f')]]){this[_0x070e('0x13')][_0x52d89d[_0x070e('0x9f')]][_0x070e('0x121')]=_0x52d89d['channel'];}};Preview[_0x070e('0xc')]['syncOriginateResponse']=function(_0x5044e8){var _0x1a1851=this;var _0x52ca6c=this[_0x070e('0x13')][_0x5044e8[_0x070e('0x122')]];if(_0x52ca6c){if(_0x52ca6c[_0x070e('0xed')]&&this[_0x070e('0x53')][_0x52ca6c['lookAgent']]){ut[_0x070e('0x123')](_0x52ca6c,this['agents'][_0x52ca6c[_0x070e('0xed')]][_0x070e('0x26')],this[_0x070e('0x53')][_0x52ca6c[_0x070e('0xed')]]['id']);}var _0x475774=_[_0x070e('0x124')](_0x52ca6c);_0x475774[_0x070e('0x8a')]=moment()[_0x070e('0x24')](_0x070e('0x60'));var _0xf8cfd=_0x1a1851[_0x070e('0x10')][_0x52ca6c[_0x070e('0x40')]];if(ut[_0x070e('0x125')](_0x5044e8[_0x070e('0x126')])){if(_0x52ca6c[_0x070e('0x84')]){rpcDb[_0x070e('0xfc')](_0x52ca6c['idContact']);}if(_0x52ca6c['activeContact']){rpcDb[_0x070e('0x5e')](_0x52ca6c[_0x070e('0x86')]);}ami['emit'](_0x070e('0x127'),ut[_0x070e('0x79')](_0x52ca6c,'rejected',this[_0x070e('0x10')][_0x52ca6c[_0x070e('0x40')]]));this['callProgressDetectingAgent'](_0x475774,_0xf8cfd,_0x5044e8);}else{_0x52ca6c[_0x070e('0x5f')]=moment()[_0x070e('0x24')](_0x070e('0x60'));ut[_0x070e('0xdd')](_0x475774,0x4,_0x070e('0x99'));rpcDb[_0x070e('0xe0')](_0x475774,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x070e('0xc')][_0x070e('0x16')]=function(_0x275767){var _0x4f33d8=this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]];var _0xe50bad;if(_0x4f33d8){_0xe50bad=this[_0x070e('0x10')][_0x4f33d8['queue']];logger['info'](_0x070e('0x128'),_0x275767[_0x070e('0x9f')],_0x070e('0x8e'),_0xe50bad[_0x070e('0x26')],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);}if(this[_0x070e('0x13')][_0x275767['linkedid']]&&_0x275767[_0x070e('0x9f')]!==_0x275767[_0x070e('0x8d')]){if(_0x275767[_0x070e('0x129')]==='16'&&this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){this[_0x070e('0x72')](_0x275767,_0x275767[_0x070e('0x9f')],_0x275767[_0x070e('0x129')]);}else if(this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){logger[_0x070e('0x22')](_0x070e('0x12a'),_0x275767[_0x070e('0x9f')],_0x275767['cause'],_0x070e('0x8e'),_0xe50bad[_0x070e('0x26')],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);this[_0x070e('0x72')](_0x275767,_0x275767[_0x070e('0x9f')],_0x275767[_0x070e('0x129')]);}}else if(_0x4f33d8&&_['isNil'](_0x4f33d8[_0x070e('0x12b')])&&_0xe50bad[_0x070e('0x12c')]&&_0x275767[_0x070e('0x9f')]===_0x275767[_0x070e('0x8d')]&&_[_0x070e('0x54')](_0x275767[_0x070e('0xe5')])&&_0x275767[_0x070e('0x129')]==='16'&&_0x275767[_0x070e('0x12d')]==='6'&&_[_0x070e('0xdb')](_0x4f33d8['transfer'])){if(_0x4f33d8[_0x070e('0x84')]){rpcDb[_0x070e('0xfc')](_0x4f33d8[_0x070e('0x86')]);}if(_0x4f33d8[_0x070e('0xac')]){rpcDb[_0x070e('0x5e')](_0x4f33d8[_0x070e('0x86')]);}_0x275767[_0x070e('0xe5')]='22';this[_0x070e('0x12e')](_0x4f33d8,_0xe50bad,_0x275767);}else if(_0x4f33d8&&_0x4f33d8[_0x070e('0x12f')]){if(_0x275767[_0x070e('0x129')]==='16'&&this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){logger[_0x070e('0x22')](_0x070e('0x130'),_0x275767[_0x070e('0x9f')],_0x275767[_0x070e('0x129')],_0x070e('0x8e'),_0xe50bad[_0x070e('0x26')],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);this[_0x070e('0x72')](_0x275767,_0x275767['linkedid'],_0x275767[_0x070e('0x129')]);}else if(this[_0x070e('0x13')][_0x275767[_0x070e('0x9f')]][_0x070e('0x4a')]){logger['info'](_0x070e('0x12a'),_0x275767['linkedid'],_0x275767[_0x070e('0x129')],'\x20Queue',_0xe50bad['name'],_0x070e('0x8f'),_0xe50bad[_0x070e('0x2a')]);this[_0x070e('0x72')](_0x275767,_0x275767['linkedid'],_0x275767[_0x070e('0x129')]);}}};Preview['prototype'][_0x070e('0x1a')]=function(_0x1e0e55){if(this['actions'][_0x1e0e55[_0x070e('0x131')]]&&_0x1e0e55['destlinkedid']!==_0x1e0e55[_0x070e('0x132')]){this[_0x070e('0x72')](_0x1e0e55,_0x1e0e55[_0x070e('0x131')],_0x1e0e55['dialstatus']);}};Preview['prototype'][_0x070e('0x17')]=function(_0x4bed29){if(this[_0x070e('0x13')][_0x4bed29[_0x070e('0x9f')]]&&_0x4bed29[_0x070e('0x9f')]!==_0x4bed29[_0x070e('0x8d')]&&!this[_0x070e('0x13')][_0x4bed29[_0x070e('0x9f')]]['dialAnswer']){if(_0x4bed29['cause']==='1'){this[_0x070e('0x72')](_0x4bed29,_0x4bed29['linkedid'],_0x4bed29['cause']);}}};Preview[_0x070e('0xc')][_0x070e('0x133')]=function(_0x3c8b7d,_0x5ddf05,_0x241d86){if(this[_0x070e('0x13')][_0x3c8b7d]){if(_[_0x070e('0x54')](this['actions'][_0x3c8b7d]['variables'])){this[_0x070e('0x13')][_0x3c8b7d][_0x070e('0x134')]={};}this[_0x070e('0x13')][_0x3c8b7d]['variables'][_0x5ddf05]=_0x241d86;}};Preview[_0x070e('0xc')]['syncVarSet']=function(_0x2e9263){try{if(!_['isNil'](_0x2e9263)){if(ut[_0x070e('0x135')](_[_0x070e('0x136')](_0x2e9263['variable'])[0x0])){this[_0x070e('0x133')](_0x2e9263[_0x070e('0x8d')],_[_0x070e('0x136')](_0x2e9263[_0x070e('0x137')])[0x0],_0x2e9263[_0x070e('0x138')]);}}}catch(_0xd6529a){logger[_0x070e('0x139')](_0x070e('0x13a'),util[_0x070e('0x13b')](_0xd6529a,{'showHidden':![],'depth':null}));}};Preview[_0x070e('0xc')][_0x070e('0x1e')]=function(_0x10b168){if(_0x10b168){if(this[_0x070e('0x13')][_0x10b168['transfertargetlinkedid']]){this[_0x070e('0x13')][_0x10b168[_0x070e('0x13c')]][_0x070e('0x12f')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x38afa3){if(_0x38afa3){if(this[_0x070e('0x13')][_0x38afa3['transfererlinkedid']]){this[_0x070e('0x13')][_0x38afa3[_0x070e('0x13d')]][_0x070e('0x12f')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 38502f7..c8c2322 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 _0x24bd=['[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','xcally-motion-preview','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then'];(function(_0x13c59c,_0x40c296){var _0x3699b6=function(_0x45173f){while(--_0x45173f){_0x13c59c['push'](_0x13c59c['shift']());}};_0x3699b6(++_0x40c296);}(_0x24bd,0x1a0));var _0xd24b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x24bd[_0x6131cd];return _0x47e916;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xd24b('0x0'))(_0xd24b('0x1'));var cmHopper=require(_0xd24b('0x2'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xd24b('0x3'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xd24b('0x4'));function loggerCatch(_0xf5ea30){return function(_0x5e91d6){logger[_0xd24b('0x5')](_0xf5ea30,util[_0xd24b('0x6')](_0x5e91d6,{'showHidden':![],'depth':null}));};}function create(_0x1510e6){return cmHopperHistory[_0xd24b('0x7')](_0x1510e6)[_0xd24b('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x38b3cc){return BPromise[_0xd24b('0x9')]()['then'](agentReportPreview[_0xd24b('0x7')](_0x38b3cc))[_0xd24b('0x8')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x26c8a5){return cmHopper[_0xd24b('0xa')](_0x26c8a5,!![])['catch'](loggerCatch(_0xd24b('0xb')));}exports[_0xd24b('0xc')]=function(_0x218bd4){return cmHopperBlack[_0xd24b('0xc')](_0x218bd4)[_0xd24b('0x8')](loggerCatch(_0xd24b('0xd')));};exports[_0xd24b('0xe')]=function(_0x4e6662){return BPromise['resolve']()[_0xd24b('0xf')](cmHopper['getContactPreview'](_0x4e6662))[_0xd24b('0x8')](loggerCatch(_0xd24b('0x10')));};exports[_0xd24b('0x7')]=function(_0x463497,_0x3238ef){create(_0x463497)[_0xd24b('0x8')](loggerCatch(_0x3238ef));moveContact(_0x463497)[_0xd24b('0x8')](loggerCatch(_0x3238ef));};exports[_0xd24b('0x11')]=function(_0x22842b,_0x315731){createAgent(_0x22842b)[_0xd24b('0x8')](loggerCatch(_0x315731));};exports[_0xd24b('0x12')]=function(_0x2ab28b,_0x463b83){create(_0x2ab28b)['catch'](loggerCatch(_0x463b83));};exports[_0xd24b('0x13')]=function(_0x56067f,_0xf36272){moveContact(_0x56067f)[_0xd24b('0x8')](loggerCatch(_0xf36272));};exports[_0xd24b('0x14')]=function(_0x407a24,_0x1fa2a7,_0xfdab4f){if(_0x1fa2a7){_0x407a24[_0xd24b('0x15')]=null;}if(_0xfdab4f){_0x407a24[_0xd24b('0x16')]=![];}return cmHopper[_0xd24b('0x14')](_0x407a24)['catch'](loggerCatch(_0xd24b('0x17')));};exports[_0xd24b('0x18')]=function(_0x44eb3a){return cmHopper[_0xd24b('0x18')](_0x44eb3a)[_0xd24b('0x8')](loggerCatch(_0xd24b('0x19')));};exports[_0xd24b('0x1a')]=function(_0x4ecf76){return cmHopper[_0xd24b('0x1a')]({'UserId':null},_0x4ecf76,0x1)[_0xd24b('0x8')](loggerCatch(_0xd24b('0x1b')));};exports['disableContact']=function(_0x3943fb){return cmHopper['unlockContact']({'active':![]},_0x3943fb,0x1)[_0xd24b('0x8')](loggerCatch(_0xd24b('0x1c')));};exports['crateCustomerReportQueue']=function(_0x558a14){var _0x2faccd={};_0x2faccd[_0xd24b('0x1d')]=_0x558a14['type'];_0x2faccd['uniqueid']=_0x558a14[_0xd24b('0x1e')];_0x2faccd[_0xd24b('0x1f')]=_0x558a14[_0xd24b('0x1f')];_0x2faccd[_0xd24b('0x20')]=_0x558a14[_0xd24b('0x20')];_0x2faccd[_0xd24b('0x21')]=_0x558a14[_0xd24b('0x21')];_0x2faccd[_0xd24b('0x22')]=_0x558a14[_0xd24b('0x23')];_0x2faccd[_0xd24b('0x24')]=_0x558a14['answertime'];_0x2faccd[_0xd24b('0x25')]=0x1;_0x2faccd[_0xd24b('0x26')]=_0x558a14[_0xd24b('0x27')];_0x2faccd[_0xd24b('0x28')]=_0x558a14['membername'];_0x2faccd['context']=_0xd24b('0x29');_0x2faccd[_0xd24b('0x2a')]=_0xd24b('0x2b');_0x2faccd['holdtime']=0x0;_0x2faccd['assigned']=0x1;_0x2faccd[_0xd24b('0x2c')]=_0x558a14[_0xd24b('0x2d')];_0x2faccd[_0xd24b('0x2e')]=_0xd24b('0x2f');return BPromise[_0xd24b('0x9')]()['then'](voiceQueueReport[_0xd24b('0x30')](_0x2faccd))['catch'](loggerCatch(_0xd24b('0x31')));};exports['getContactRecallMe']=function(_0x4f4eef,_0x50bbf7){return BPromise[_0xd24b('0x9')]()['then'](cmHopper[_0xd24b('0x32')](_0x4f4eef,_0x50bbf7))['catch'](loggerCatch(_0xd24b('0x33')));};exports[_0xd24b('0x34')]=function(_0x5d382a){return cmHopper[_0xd24b('0x14')](_0x5d382a,!![],!![])['catch'](loggerCatch(_0xd24b('0x35')));}; \ No newline at end of file +var _0x740c=['error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueReport'];(function(_0x4c009b,_0x1380f8){var _0x192c77=function(_0x6a4228){while(--_0x6a4228){_0x4c009b['push'](_0x4c009b['shift']());}};_0x192c77(++_0x1380f8);}(_0x740c,0x96));var _0xc740=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x740c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc740('0x0'));var BPromise=require(_0xc740('0x1'));var logger=require(_0xc740('0x2'))('preview');var cmHopper=require(_0xc740('0x3'));var cmHopperHistory=require(_0xc740('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xc740('0x5'));function loggerCatch(_0x4a6fbf){return function(_0x1027f5){logger[_0xc740('0x6')](_0x4a6fbf,util[_0xc740('0x7')](_0x1027f5,{'showHidden':![],'depth':null}));};}function create(_0x5b9645){return cmHopperHistory[_0xc740('0x8')](_0x5b9645)['catch'](loggerCatch(_0xc740('0x9')));}function createAgent(_0x9b3263){return BPromise[_0xc740('0xa')]()[_0xc740('0xb')](agentReportPreview[_0xc740('0x8')](_0x9b3263))[_0xc740('0xc')](loggerCatch(_0xc740('0x9')));}function moveContact(_0x3bfbc7){return cmHopper[_0xc740('0xd')](_0x3bfbc7,!![])['catch'](loggerCatch(_0xc740('0xe')));}exports[_0xc740('0xf')]=function(_0x13cff3){return cmHopperBlack[_0xc740('0xf')](_0x13cff3)[_0xc740('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xc740('0x10')]=function(_0x1906e5){return BPromise[_0xc740('0xa')]()[_0xc740('0xb')](cmHopper[_0xc740('0x10')](_0x1906e5))[_0xc740('0xc')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x35f0,_0x5151e6){create(_0x35f0)[_0xc740('0xc')](loggerCatch(_0x5151e6));moveContact(_0x35f0)['catch'](loggerCatch(_0x5151e6));};exports[_0xc740('0x11')]=function(_0x390906,_0x5e526c){createAgent(_0x390906)[_0xc740('0xc')](loggerCatch(_0x5e526c));};exports['createCustomerHistory']=function(_0x33fdc4,_0x59d62b){create(_0x33fdc4)[_0xc740('0xc')](loggerCatch(_0x59d62b));};exports[_0xc740('0x12')]=function(_0x56c746,_0xd94806){moveContact(_0x56c746)[_0xc740('0xc')](loggerCatch(_0xd94806));};exports[_0xc740('0x13')]=function(_0x4ebb83,_0x4fb4dd,_0x49ef0a){if(_0x4fb4dd){_0x4ebb83['UserId']=null;}if(_0x49ef0a){_0x4ebb83[_0xc740('0x14')]=![];}return cmHopper['rescheduleContact'](_0x4ebb83)[_0xc740('0xc')](loggerCatch(_0xc740('0x15')));};exports[_0xc740('0x16')]=function(_0x471547){return cmHopper['countReScheduled'](_0x471547)[_0xc740('0xc')](loggerCatch(_0xc740('0x17')));};exports[_0xc740('0x18')]=function(_0x19dea8){return cmHopper['unlockContact']({'UserId':null},_0x19dea8,0x1)['catch'](loggerCatch(_0xc740('0x19')));};exports[_0xc740('0x1a')]=function(_0x4e8428){return cmHopper[_0xc740('0x18')]({'active':![]},_0x4e8428,0x1)[_0xc740('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xc740('0x1b')]=function(_0x1b3a78){var _0x3abbe8={};_0x3abbe8[_0xc740('0x1c')]=_0x1b3a78[_0xc740('0x1c')];_0x3abbe8[_0xc740('0x1d')]=_0x1b3a78['uniqueid'];_0x3abbe8[_0xc740('0x1e')]=_0x1b3a78['calleridnum'];_0x3abbe8['calleridname']=_0x1b3a78[_0xc740('0x1f')];_0x3abbe8[_0xc740('0x20')]=_0x1b3a78['queue'];_0x3abbe8['queuecallerjoinAt']=_0x1b3a78[_0xc740('0x21')];_0x3abbe8[_0xc740('0x22')]=_0x1b3a78[_0xc740('0x21')];_0x3abbe8[_0xc740('0x23')]=0x1;_0x3abbe8[_0xc740('0x24')]=_0x1b3a78['endtime'];_0x3abbe8[_0xc740('0x25')]=_0x1b3a78[_0xc740('0x26')];_0x3abbe8[_0xc740('0x27')]=_0xc740('0x28');_0x3abbe8[_0xc740('0x29')]='xcally-motion-preview';_0x3abbe8[_0xc740('0x2a')]=0x0;_0x3abbe8['assigned']=0x1;_0x3abbe8[_0xc740('0x2b')]=_0x1b3a78['membername'];_0x3abbe8[_0xc740('0x2c')]=_0xc740('0x2d');return BPromise[_0xc740('0xa')]()['then'](voiceQueueReport[_0xc740('0x2e')](_0x3abbe8))['catch'](loggerCatch(_0xc740('0x2f')));};exports[_0xc740('0x30')]=function(_0x4e446a,_0x22a9d2){return BPromise[_0xc740('0xa')]()[_0xc740('0xb')](cmHopper[_0xc740('0x30')](_0x4e446a,_0x22a9d2))[_0xc740('0xc')](loggerCatch(_0xc740('0x31')));};exports[_0xc740('0x32')]=function(_0x3fb80b){return cmHopper[_0xc740('0x13')](_0x3fb80b,!![],!![])[_0xc740('0xc')](loggerCatch(_0xc740('0x33')));}; \ 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 b5184ab..62b959b 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 _0xf98a=['Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','ringtime','logLookAgent','membername','UserId','logCustomer','getSeconds','talktime','answertime','Failure','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','scheduledat','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','idContact','type','dialAnswer','active','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables'];(function(_0x1fcf0b,_0x167319){var _0x46c805=function(_0x47c78a){while(--_0x47c78a){_0x1fcf0b['push'](_0x1fcf0b['shift']());}};_0x46c805(++_0x167319);}(_0xf98a,0x10f));var _0xaf98=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0xf98a[_0x2212d1];return _0x15eec5;};'use strict';var util=require(_0xaf98('0x0'));var _=require('lodash');var moment=require(_0xaf98('0x1'));var logger=require(_0xaf98('0x2'))(_0xaf98('0x3'));var ipAgi=process[_0xaf98('0x4')][_0xaf98('0x5')]||_0xaf98('0x6');var utils=require(_0xaf98('0x7'));exports['loggerCatch']=function(_0x270013){return function(_0x23936e){logger[_0xaf98('0x8')](_0x270013,util[_0xaf98('0x9')](_0x23936e,{'showHidden':![],'depth':null}));};};exports[_0xaf98('0xa')]=function(_0x13a9ab,_0x454e23){logger[_0xaf98('0xb')](_0x13a9ab,util[_0xaf98('0x9')](_0x454e23,{'showHidden':![],'depth':null}));};exports[_0xaf98('0xc')]=function(_0x422605,_0x3c5c12){logger[_0xaf98('0x8')](_0x422605,util['inspect'](_0x3c5c12,{'showHidden':![],'depth':null}));};exports[_0xaf98('0xd')]=function(_0x418e27){return function(_0x33bdd8){logger[_0xaf98('0xb')](_0x418e27,util[_0xaf98('0x9')](_0x33bdd8,{'showHidden':![],'depth':null}));};};exports[_0xaf98('0xe')]=function(_0x3cf0ae,_0xd1e790,_0x51c8aa){return{'message':_0x3cf0ae,'unlock':_0xd1e790,'active':_0x51c8aa};};exports['getCallerId']=function(_0x414506,_0x5946e6,_0x548ea9){if(!_['isUndefined'](_0x548ea9)&&'string'===typeof _0x548ea9&&!_['isEmpty'](_0x548ea9)){if(!_[_0xaf98('0xf')](_0x5946e6)&&_0xaf98('0x10')===typeof _0x5946e6&&!_[_0xaf98('0x11')](_0x5946e6)){return util[_0xaf98('0x12')](_0xaf98('0x13'),_0x5946e6,_0x548ea9);}return util[_0xaf98('0x12')](_0xaf98('0x13'),_0x548ea9,_0x548ea9);}if(!_[_0xaf98('0xf')](_0x414506)&&_0xaf98('0x10')===typeof _0x414506&&!_['isEmpty'](_0x414506)){return _0x414506;}return'\x22\x22\x20<>';};exports[_0xaf98('0x14')]=function(_0x1ddbb9){if(_[_0xaf98('0x15')](_0x1ddbb9)){return![];}return _0x1ddbb9;};exports[_0xaf98('0x16')]=function(_0x4aeb06,_0x25f196,_0x49d005,_0x4775fb,_0x5dcb4e,_0x496452){var _0x58c9d3={'XMD-QUEUE':_0x25f196[_0xaf98('0x17')]?_0x25f196[_0xaf98('0x17')][_0xaf98('0x18')]:'','XMD-CALLERID':_0x4775fb,'XMD-CALLERID-PREVIEW':_0x496452?util[_0xaf98('0x12')](_0xaf98('0x13'),_0x496452['calleridname'],_0x496452[_0xaf98('0x19')]):_0x4775fb,'XMD-DIALID':_0x5dcb4e,'XMD-CONTACTID':_0x25f196[_0xaf98('0x1a')],'XMD-CDRTYPE':_0xaf98('0x1b'),'CALLERID(all)':_0x4775fb,'XMD-VOICEQUEUEID':_0x25f196[_0xaf98('0x1c')],'XMD-DIALCHANNEL':_0x49d005,'XMD-DIALTIMEOUT':_0x4aeb06[_0xaf98('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xaf98('0x12')](_0xaf98('0x1e'),_0x4aeb06['dialQueueProject2']?'g':'',_[_0xaf98('0x11')](_0x4aeb06[_0xaf98('0x1f')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x4aeb06[_0xaf98('0x20')]||'','XMD-AGI':_0x4aeb06[_0xaf98('0x21')]?util[_0xaf98('0x12')](_0xaf98('0x22'),ipAgi,_0x4aeb06[_0xaf98('0x21')]):_0xaf98('0x23'),'XMD-AGIAFTER':_0x4aeb06[_0xaf98('0x24')]?util['format'](_0xaf98('0x22'),ipAgi,_0x4aeb06[_0xaf98('0x24')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x496452?_0x496452[_0xaf98('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x496452?_0x496452[_0xaf98('0x26')]:'','XMD-DESTINATION':_0xaf98('0x27'),'SIPADDHEADER':_0xaf98('0x28')};if(!_[_0xaf98('0x11')](_0x4aeb06['monitor_format'])){_0x58c9d3[util[_0xaf98('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4aeb06[_0xaf98('0x1f')];_0x58c9d3[util['format']('%s',_0xaf98('0x29'))]=_0x5dcb4e;}if(_0x25f196&&_0x25f196['Contact']){for(var _0x259f68 in _0x25f196[_0xaf98('0x2a')]){if(_0x25f196[_0xaf98('0x2a')][_0xaf98('0x2b')](_0x259f68)){if(!_[_0xaf98('0x15')](_0x25f196[_0xaf98('0x2a')][_0x259f68])&&_0x259f68!=='id'&&_0x259f68!==_0xaf98('0x2c')&&_0x259f68!==_0xaf98('0x2d')&&_0x259f68!=='updatedAt'){_0x58c9d3[util[_0xaf98('0x12')]('%s%s',_0xaf98('0x2e'),_[_0xaf98('0x2f')](_0x259f68))]=_0x25f196[_0xaf98('0x2a')][_0x259f68];}}}}return _0x58c9d3;};exports[_0xaf98('0x30')]=function(_0x293bd4){var _0x47120a={};for(var _0x4bb2d3 in _0x293bd4){if(_0x293bd4[_0xaf98('0x2b')](_0x4bb2d3)){_0x47120a[util[_0xaf98('0x12')]('%s',_['toLower'](_0x4bb2d3))]=_0x293bd4[_0x4bb2d3];}}return{'variables':_0x47120a};};exports[_0xaf98('0x31')]=function(_0x48b41a,_0x42f053){if(!_['isNil'](_0x48b41a)){if(_0x48b41a['hasOwnProperty']('originated')){if(_0x48b41a[_0xaf98('0x32')]>0x0){_0x48b41a[_0xaf98('0x32')]-=0x1;}else{logger[_0xaf98('0x8')](_0xaf98('0x33'),_0x42f053);}}}else{logger[_0xaf98('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x42f053);}};exports[_0xaf98('0x34')]=function(_0x3d8310){var _0x24b7b8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d8310['state']=0xd;_0x3d8310[_0xaf98('0x35')]=_0xaf98('0x36');_0x3d8310[_0xaf98('0x37')]=_0x24b7b8;_0x3d8310[_0xaf98('0x38')]=_0x24b7b8;_0x3d8310[_0xaf98('0x39')]=_0x24b7b8;};exports[_0xaf98('0x3a')]=function(_0x3749f8,_0x4761f0,_0x496d66){var _0x469360=moment()[_0xaf98('0x12')](_0xaf98('0x3b'));_0x3749f8[_0xaf98('0x3c')]=_0x4761f0;_0x3749f8[_0xaf98('0x35')]=_0x496d66;_0x3749f8[_0xaf98('0x38')]=_0x469360;_0x3749f8[_0xaf98('0x3d')]=utils['getSeconds'](_0x3749f8[_0xaf98('0x38')],_0x3749f8[_0xaf98('0x37')]);};exports[_0xaf98('0x3e')]=function(_0x1d7462,_0x2c056f,_0x2ada5f){_0x1d7462[_0xaf98('0x3f')]=_0x2c056f;_0x1d7462[_0xaf98('0x40')]=_0x2ada5f;};exports[_0xaf98('0x41')]=function(_0x22f23f,_0x34214d,_0x21c40b){var _0x420977=moment()[_0xaf98('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x22f23f[_0xaf98('0x3c')]=_0x34214d;_0x22f23f[_0xaf98('0x35')]=_0x21c40b;_0x22f23f[_0xaf98('0x38')]=_0x22f23f[_0xaf98('0x38')]?_0x22f23f[_0xaf98('0x38')]:_0x420977;_0x22f23f[_0xaf98('0x39')]=_0x22f23f['endtime']?_0x22f23f['endtime']:_0x420977;_0x22f23f[_0xaf98('0x3d')]=utils[_0xaf98('0x42')](_0x22f23f[_0xaf98('0x38')]||0x0,_0x22f23f['starttime']||0x0);_0x22f23f[_0xaf98('0x43')]=_0x22f23f[_0xaf98('0x44')]?utils[_0xaf98('0x42')](_0x22f23f['endtime'],_0x22f23f[_0xaf98('0x44')]):0x0;};exports['isFailure']=function(_0x50196c){return _0x50196c===_0xaf98('0x45');};exports['variablesAction']=function(_0x38a4c8,_0x53d067,_0x1b7432,_0x2d9409,_0x5aff44){var _0x11e423=_0x2d9409?'RECALL':_0x38a4c8[_0xaf98('0x46')];_0x11e423=_0x5aff44?_0xaf98('0x47'):_0x11e423;return{'actionid':_0x38a4c8[_0xaf98('0x48')],'action':_0xaf98('0x49'),'channel':_0x38a4c8[_0xaf98('0x4a')],'callerid':util['format'](_0xaf98('0x13'),_0x11e423,_0x38a4c8['calleridnum']),'Exten':_0xaf98('0x27'),'Context':_0xaf98('0x4b'),'Priority':'1','variable':_0x1b7432,'timeout':(_0x53d067['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x38a4c8[_0xaf98('0x48')]};};exports[_0xaf98('0x4c')]=function(_0x1d007b){return _0x1d007b[_0xaf98('0x4d')]+_0x1d007b[_0xaf98('0x4e')]+_0x1d007b[_0xaf98('0x4f')]+_0x1d007b['countagentrejectretry']+_0x1d007b['countnosuchnumberretry'];};exports[_0xaf98('0x50')]=function(_0x228953){var _0xc3babe=_['clone'](_0x228953);_0xc3babe[_0xaf98('0x3c')]=0xf;_0xc3babe[_0xaf98('0x35')]=_0xaf98('0x51');return _0xc3babe;};exports[_0xaf98('0x52')]=function(_0x73f9aa,_0xd6c0e2,_0x172f93){var _0x4a36b8={};_0x4a36b8[_0xd6c0e2]=_0x73f9aa[_0xd6c0e2];_0x4a36b8['active']=![];_0x4a36b8[_0xaf98('0x53')]=moment()['add'](_0x172f93,'minutes')[_0xaf98('0x12')](_0xaf98('0x3b'));_0x4a36b8[_0xaf98('0x1a')]=_0x73f9aa[_0xaf98('0x1a')];_0x4a36b8[_0xaf98('0x54')]=_0x73f9aa[_0xaf98('0x54')];_0x4a36b8['VoiceQueueId']=_0x73f9aa[_0xaf98('0x1c')]||undefined;return _0x4a36b8;};exports[_0xaf98('0x55')]=function(_0x346dc,_0x4706d8){if(!_[_0xaf98('0x15')](_0x346dc)){if(_0x346dc[_0xaf98('0x56')]>0x0){_0x346dc[_0xaf98('0x56')]-=0x1;}else{logger[_0xaf98('0x8')](_0x4706d8,_0xaf98('0x57'));}}else{logger[_0xaf98('0x8')](_0x4706d8,_0xaf98('0x58'));}};exports['IsNotLoggedIn']=function(_0x49acd9){if(_0x49acd9<=0x0){return!![];}return![];};function buildObj(_0x56d2ca,_0x1cddbd,_0xb7fccc){_0x56d2ca[_0xaf98('0x59')]=_0x1cddbd;_0x56d2ca[_0xaf98('0x18')]=_0x56d2ca['queue'];_0x56d2ca[_0xaf98('0x5a')]=_0x56d2ca[_0xaf98('0x4a')];_0x56d2ca[_0xaf98('0x5b')]=_0xaf98('0x5c');if(_0xb7fccc){_0x56d2ca['mandatoryDisposition']=_0xb7fccc[_0xaf98('0x5d')];}return _0x56d2ca;}exports['buildObj']=buildObj;exports[_0xaf98('0x5e')]=function(_0x2ec4e1){var _0x482798={};_0x482798[_0xaf98('0x5f')]=_0x2ec4e1[_0xaf98('0x5f')];_0x482798['interface']=_0x2ec4e1[_0xaf98('0x4a')];_0x482798['uniqueid']=_0x2ec4e1[_0xaf98('0x48')];return _0x482798;};exports[_0xaf98('0x60')]=function(_0x4e036a){var _0x3cc77b=[];for(var _0x1db68b in _0x4e036a){if(_0x4e036a['hasOwnProperty'](_0x1db68b)){if(!_['isNil'](_0x4e036a[_0x1db68b])&&_0x4e036a[_0x1db68b][_0xaf98('0x3c')]==='not_inuse'&&_0x4e036a[_0x1db68b][_0xaf98('0x61')]===_0xaf98('0x62')){_0x3cc77b[_0xaf98('0x63')](_0x4e036a[_0x1db68b]['id']);}}}return _0x3cc77b;};exports[_0xaf98('0x64')]=function(_0x500dc7){var _0xfdd85=moment()['milliseconds'](0x0);var _0x2206ab=moment(_0x500dc7)[_0xaf98('0x65')](0x0);return _0xfdd85[_0xaf98('0x66')](_0x2206ab,_0xaf98('0x67'));};exports[_0xaf98('0x68')]=function(_0x12f8f0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x12f8f0[_0xaf98('0x1a')],'ListId':_0x12f8f0[_0xaf98('0x54')],'VoiceQueueId':_0x12f8f0[_0xaf98('0x1c')]||undefined,'CampaignId':_0x12f8f0[_0xaf98('0x69')]||undefined};};exports['filterKey']=function(_0x277172){if(_0x277172===_0xaf98('0x48')||_0x277172===_0xaf98('0x6a')||_0x277172==='queue'||_0x277172===_0xaf98('0x6b')||_0x277172==='campaigntype'||_0x277172===_0xaf98('0x6c')||_0x277172===_0xaf98('0x3f')||_0x277172===_0xaf98('0x4a')||_0x277172===_0xaf98('0x46')||_0x277172===_0xaf98('0x6d')||_0x277172==='calleridnum'||_0x277172==='scheduledat'||_0x277172===_0xaf98('0x4d')||_0x277172===_0xaf98('0x4e')||_0x277172===_0xaf98('0x4f')||_0x277172==='countglobal'||_0x277172===_0xaf98('0x6e')||_0x277172==='callbackuniqueid'||_0x277172===_0xaf98('0x6f')||_0x277172===_0xaf98('0x70')||_0x277172===_0xaf98('0x1a')||_0x277172===_0xaf98('0x54')||_0x277172==='UserId'||_0x277172===_0xaf98('0x1c')||_0x277172===_0xaf98('0x71')||_0x277172===_0xaf98('0x72')||_0x277172==='xmd-queue'||_0x277172===_0xaf98('0x73')||_0x277172==='xmd-listid'||_0x277172===_0xaf98('0x74')||_0x277172===_0xaf98('0x75')||_0x277172===_0xaf98('0x76')||_0x277172===_0xaf98('0x77')||_0x277172===_0xaf98('0x78')||_0x277172===_0xaf98('0x79')||_0x277172===_0xaf98('0x7a')||_0x277172===_0xaf98('0x7b')||_0x277172===_0xaf98('0x7c')||_0x277172==='xmd-agi'||_0x277172===_0xaf98('0x7d')||_0x277172===_0xaf98('0x7e')||_0x277172===_0xaf98('0x7f')||_0x277172===_0xaf98('0x80')||_0x277172===_0xaf98('0x81')||_0x277172==='rtpaudioqoslossbridged'||_0x277172==='rtpaudioqosrtt'||_0x277172===_0xaf98('0x82')||_0x277172===_0xaf98('0x7d')||_0x277172===_0xaf98('0x7e')||_0x277172===_0xaf98('0x7f')||_0x277172==='rtpaudioqosjitterbridged'||_0x277172===_0xaf98('0x81')||_0x277172===_0xaf98('0x83')||_0x277172===_0xaf98('0x84')||_0x277172==='rtpaudioqosrttbridged'||_0x277172===_0xaf98('0x85')||_0x277172==='bridgepvtcallid'||_0x277172===_0xaf98('0x3c')||_0x277172===_0xaf98('0x35')){return![];}return!![];};exports[_0xaf98('0x86')]=function(_0x48ba46,_0x193d51){var _0x2e7a71,_0x4df2c3,_0x4fd388;if(_0x193d51<=0x0){_0x193d51=0x1;}_0x2e7a71=new RegExp(_0xaf98('0x87')+_0x193d51+'}$');_0x4df2c3=Math[_0xaf98('0x88')](0xa,_0x193d51-0x1);_0x4fd388=Math[_0xaf98('0x88')](0xa,_0x193d51)-0x1;return util['format']('%s',_[_0xaf98('0x89')](_0x48ba46,_0x2e7a71,_[_0xaf98('0x8a')](_0x4df2c3,_0x4fd388)));};exports[_0xaf98('0x8b')]=function(_0x224a9e){var _0x3d2192=_0x224a9e[_0xaf98('0x8c')](/"(.*?)"/);return _0x3d2192?_0x3d2192[0x1]:_0x224a9e;};exports[_0xaf98('0x8d')]=function(_0x5aaa89){var _0x3aadd1=_0x5aaa89[_0xaf98('0x8c')](/<(.*?)>/);return _0x3aadd1?_0x3aadd1[0x1]:_0x5aaa89;};function buildNoAnswerEventPayload(_0x22dcfd,_0x35e228){var _0xd50252=buildObj(_0x22dcfd,_0xaf98('0x8e'));if(!_[_0xaf98('0x11')](_0x35e228[_0xaf98('0x8f')])){Object[_0xaf98('0x90')](_0x35e228[_0xaf98('0x8f')])['forEach'](function(_0x1e96de){_0xd50252[_0x1e96de[_0xaf98('0x91')]()]=_0x35e228['variables'][_0x1e96de];});}return _0xd50252;}exports[_0xaf98('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x683d=['\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','membername','UserId','talktime','answertime','isFailure','variablesAction','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','not_inuse','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','calleridname','calleridnum','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>'];(function(_0x546781,_0x151a58){var _0x366373=function(_0x11c52c){while(--_0x11c52c){_0x546781['push'](_0x546781['shift']());}};_0x366373(++_0x151a58);}(_0x683d,0x7b));var _0xd683=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x683d[_0x2d61b2];return _0x12df89;};'use strict';var util=require('util');var _=require(_0xd683('0x0'));var moment=require(_0xd683('0x1'));var logger=require('../../../../config/logger')(_0xd683('0x2'));var ipAgi=process[_0xd683('0x3')][_0xd683('0x4')]||_0xd683('0x5');var utils=require('../../dialer/utils');exports['loggerCatch']=function(_0x17e1d0){return function(_0x5dfe51){logger[_0xd683('0x6')](_0x17e1d0,util[_0xd683('0x7')](_0x5dfe51,{'showHidden':![],'depth':null}));};};exports[_0xd683('0x8')]=function(_0x3097d7,_0xa588d8){logger[_0xd683('0x9')](_0x3097d7,util[_0xd683('0x7')](_0xa588d8,{'showHidden':![],'depth':null}));};exports[_0xd683('0xa')]=function(_0x3b1572,_0x41aced){logger[_0xd683('0x6')](_0x3b1572,util[_0xd683('0x7')](_0x41aced,{'showHidden':![],'depth':null}));};exports[_0xd683('0xb')]=function(_0x2a5d6d){return function(_0x5b03cf){logger[_0xd683('0x9')](_0x2a5d6d,util['inspect'](_0x5b03cf,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x57b435,_0x4b8c61,_0x1b33c1){return{'message':_0x57b435,'unlock':_0x4b8c61,'active':_0x1b33c1};};exports[_0xd683('0xc')]=function(_0x5d7cd1,_0x5520e7,_0x5136a0){if(!_[_0xd683('0xd')](_0x5136a0)&&_0xd683('0xe')===typeof _0x5136a0&&!_['isEmpty'](_0x5136a0)){if(!_[_0xd683('0xd')](_0x5520e7)&&'string'===typeof _0x5520e7&&!_[_0xd683('0xf')](_0x5520e7)){return util[_0xd683('0x10')](_0xd683('0x11'),_0x5520e7,_0x5136a0);}return util[_0xd683('0x10')](_0xd683('0x11'),_0x5136a0,_0x5136a0);}if(!_[_0xd683('0xd')](_0x5d7cd1)&&_0xd683('0xe')===typeof _0x5d7cd1&&!_[_0xd683('0xf')](_0x5d7cd1)){return _0x5d7cd1;}return _0xd683('0x12');};exports[_0xd683('0x13')]=function(_0x59f648){if(_[_0xd683('0x14')](_0x59f648)){return![];}return _0x59f648;};exports[_0xd683('0x15')]=function(_0x634076,_0x5bf9c0,_0x109e95,_0x2ace2a,_0x4ecec8,_0x2d1b0d){var _0x3a81e3={'XMD-QUEUE':_0x5bf9c0[_0xd683('0x16')]?_0x5bf9c0[_0xd683('0x16')][_0xd683('0x17')]:'','XMD-CALLERID':_0x2ace2a,'XMD-CALLERID-PREVIEW':_0x2d1b0d?util['format']('\x22%s\x22\x20<%s>',_0x2d1b0d['calleridname'],_0x2d1b0d['calleridnum']):_0x2ace2a,'XMD-DIALID':_0x4ecec8,'XMD-CONTACTID':_0x5bf9c0[_0xd683('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2ace2a,'XMD-VOICEQUEUEID':_0x5bf9c0[_0xd683('0x19')],'XMD-DIALCHANNEL':_0x109e95,'XMD-DIALTIMEOUT':_0x634076[_0xd683('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x634076[_0xd683('0x1b')]?'g':'',_[_0xd683('0xf')](_0x634076['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x634076[_0xd683('0x1c')]||'','XMD-AGI':_0x634076['dialQueueProject']?util[_0xd683('0x10')](_0xd683('0x1d'),ipAgi,_0x634076['dialQueueProject']):_0xd683('0x1e'),'XMD-AGIAFTER':_0x634076[_0xd683('0x1b')]?util['format'](_0xd683('0x1d'),ipAgi,_0x634076[_0xd683('0x1b')]):_0xd683('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x2d1b0d?_0x2d1b0d[_0xd683('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x2d1b0d?_0x2d1b0d[_0xd683('0x20')]:'','XMD-DESTINATION':_0xd683('0x21'),'SIPADDHEADER':_0xd683('0x22')};if(!_[_0xd683('0xf')](_0x634076['monitor_format'])){_0x3a81e3[util[_0xd683('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x634076['monitor_format'];_0x3a81e3[util['format']('%s',_0xd683('0x23'))]=_0x4ecec8;}if(_0x5bf9c0&&_0x5bf9c0[_0xd683('0x24')]){for(var _0x1ee679 in _0x5bf9c0[_0xd683('0x24')]){if(_0x5bf9c0[_0xd683('0x24')][_0xd683('0x25')](_0x1ee679)){if(!_[_0xd683('0x14')](_0x5bf9c0[_0xd683('0x24')][_0x1ee679])&&_0x1ee679!=='id'&&_0x1ee679!==_0xd683('0x26')&&_0x1ee679!==_0xd683('0x27')&&_0x1ee679!=='updatedAt'){_0x3a81e3[util[_0xd683('0x10')](_0xd683('0x28'),_0xd683('0x29'),_['toUpper'](_0x1ee679))]=_0x5bf9c0[_0xd683('0x24')][_0x1ee679];}}}}return _0x3a81e3;};exports[_0xd683('0x2a')]=function(_0xdd5363){var _0x2fee80={};for(var _0x49b457 in _0xdd5363){if(_0xdd5363[_0xd683('0x25')](_0x49b457)){_0x2fee80[util[_0xd683('0x10')]('%s',_['toLower'](_0x49b457))]=_0xdd5363[_0x49b457];}}return{'variables':_0x2fee80};};exports['updateOriginated']=function(_0x4535bb,_0x46620e){if(!_['isNil'](_0x4535bb)){if(_0x4535bb[_0xd683('0x25')](_0xd683('0x2b'))){if(_0x4535bb[_0xd683('0x2b')]>0x0){_0x4535bb[_0xd683('0x2b')]-=0x1;}else{logger['error'](_0xd683('0x2c'),_0x46620e);}}}else{logger[_0xd683('0x6')](_0xd683('0x2d'),_0x46620e);}};exports[_0xd683('0x2e')]=function(_0x43a1ae){var _0x52a0f8=moment()[_0xd683('0x10')](_0xd683('0x2f'));_0x43a1ae[_0xd683('0x30')]=0xd;_0x43a1ae[_0xd683('0x31')]=_0xd683('0x32');_0x43a1ae[_0xd683('0x33')]=_0x52a0f8;_0x43a1ae[_0xd683('0x34')]=_0x52a0f8;_0x43a1ae[_0xd683('0x35')]=_0x52a0f8;};exports[_0xd683('0x36')]=function(_0xad5800,_0x533e45,_0x53b933){var _0x3feab0=moment()['format'](_0xd683('0x2f'));_0xad5800['state']=_0x533e45;_0xad5800[_0xd683('0x31')]=_0x53b933;_0xad5800[_0xd683('0x34')]=_0x3feab0;_0xad5800[_0xd683('0x37')]=utils[_0xd683('0x38')](_0xad5800['responsetime'],_0xad5800['starttime']);};exports['logLookAgent']=function(_0x2c4264,_0xc0c4ca,_0x46a94d){_0x2c4264[_0xd683('0x39')]=_0xc0c4ca;_0x2c4264[_0xd683('0x3a')]=_0x46a94d;};exports['logCustomer']=function(_0x3ecaa1,_0x304534,_0x1c8d0b){var _0x28773c=moment()['format'](_0xd683('0x2f'));_0x3ecaa1[_0xd683('0x30')]=_0x304534;_0x3ecaa1[_0xd683('0x31')]=_0x1c8d0b;_0x3ecaa1['responsetime']=_0x3ecaa1[_0xd683('0x34')]?_0x3ecaa1['responsetime']:_0x28773c;_0x3ecaa1[_0xd683('0x35')]=_0x3ecaa1['endtime']?_0x3ecaa1[_0xd683('0x35')]:_0x28773c;_0x3ecaa1['ringtime']=utils['getSeconds'](_0x3ecaa1[_0xd683('0x34')]||0x0,_0x3ecaa1['starttime']||0x0);_0x3ecaa1[_0xd683('0x3b')]=_0x3ecaa1[_0xd683('0x3c')]?utils[_0xd683('0x38')](_0x3ecaa1['endtime'],_0x3ecaa1[_0xd683('0x3c')]):0x0;};exports[_0xd683('0x3d')]=function(_0x122639){return _0x122639==='Failure';};exports[_0xd683('0x3e')]=function(_0x4d05d1,_0x23d78d,_0x3b724c,_0xd03994,_0x1c3b04){var _0x318970=_0xd03994?'RECALL':_0x4d05d1['calleridname'];_0x318970=_0x1c3b04?_0xd683('0x3f'):_0x318970;return{'actionid':_0x4d05d1[_0xd683('0x40')],'action':_0xd683('0x41'),'channel':_0x4d05d1[_0xd683('0x42')],'callerid':util[_0xd683('0x10')](_0xd683('0x11'),_0x318970,_0x4d05d1['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x3b724c,'timeout':(_0x23d78d[_0xd683('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d05d1[_0xd683('0x40')]};};exports[_0xd683('0x44')]=function(_0xec4971){return _0xec4971[_0xd683('0x45')]+_0xec4971[_0xd683('0x46')]+_0xec4971[_0xd683('0x47')]+_0xec4971[_0xd683('0x48')]+_0xec4971[_0xd683('0x49')];};exports['cloneAction']=function(_0x36b595){var _0x29f393=_['clone'](_0x36b595);_0x29f393[_0xd683('0x30')]=0xf;_0x29f393[_0xd683('0x31')]=_0xd683('0x4a');return _0x29f393;};exports[_0xd683('0x4b')]=function(_0x100cea,_0x32720f,_0x383905){var _0x276e6d={};_0x276e6d[_0x32720f]=_0x100cea[_0x32720f];_0x276e6d[_0xd683('0x4c')]=![];_0x276e6d['scheduledat']=moment()[_0xd683('0x4d')](_0x383905,_0xd683('0x4e'))[_0xd683('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x276e6d[_0xd683('0x18')]=_0x100cea[_0xd683('0x18')];_0x276e6d[_0xd683('0x4f')]=_0x100cea[_0xd683('0x4f')];_0x276e6d[_0xd683('0x19')]=_0x100cea['VoiceQueueId']||undefined;return _0x276e6d;};exports['decrementTalkink']=function(_0x34247d,_0x45dca8){if(!_[_0xd683('0x14')](_0x34247d)){if(_0x34247d[_0xd683('0x50')]>0x0){_0x34247d[_0xd683('0x50')]-=0x1;}else{logger[_0xd683('0x6')](_0x45dca8,_0xd683('0x51'));}}else{logger['error'](_0x45dca8,_0xd683('0x52'));}};exports[_0xd683('0x53')]=function(_0xfa7824){if(_0xfa7824<=0x0){return!![];}return![];};function buildObj(_0x1f2430,_0x48025c,_0x2e7f33){_0x1f2430[_0xd683('0x54')]=_0x48025c;_0x1f2430[_0xd683('0x17')]=_0x1f2430[_0xd683('0x55')];_0x1f2430[_0xd683('0x56')]=_0x1f2430['channelAgent'];_0x1f2430[_0xd683('0x57')]=_0xd683('0x58');if(_0x2e7f33){_0x1f2430[_0xd683('0x59')]=_0x2e7f33[_0xd683('0x59')];}return _0x1f2430;}exports['buildObj']=buildObj;exports['buildAcw']=function(_0x5f0340){var _0x38f3f1={};_0x38f3f1[_0xd683('0x55')]=_0x5f0340[_0xd683('0x55')];_0x38f3f1[_0xd683('0x56')]=_0x5f0340[_0xd683('0x42')];_0x38f3f1['uniqueid']=_0x5f0340[_0xd683('0x40')];return _0x38f3f1;};exports['agentReadyId']=function(_0x56c901){var _0x541ab3=[];for(var _0x169c57 in _0x56c901){if(_0x56c901['hasOwnProperty'](_0x169c57)){if(!_[_0xd683('0x14')](_0x56c901[_0x169c57])&&_0x56c901[_0x169c57]['state']===_0xd683('0x5a')&&_0x56c901[_0x169c57]['status']===_0xd683('0x5b')){_0x541ab3[_0xd683('0x5c')](_0x56c901[_0x169c57]['id']);}}}return _0x541ab3;};exports[_0xd683('0x5d')]=function(_0x501cb6){var _0x52ebdc=moment()[_0xd683('0x5e')](0x0);var _0x12aba9=moment(_0x501cb6)[_0xd683('0x5e')](0x0);return _0x52ebdc[_0xd683('0x5f')](_0x12aba9,_0xd683('0x60'));};exports[_0xd683('0x61')]=function(_0xaa2c7e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xaa2c7e[_0xd683('0x18')],'ListId':_0xaa2c7e[_0xd683('0x4f')],'VoiceQueueId':_0xaa2c7e[_0xd683('0x19')]||undefined,'CampaignId':_0xaa2c7e[_0xd683('0x62')]||undefined};};exports['filterKey']=function(_0xae7e6b){if(_0xae7e6b===_0xd683('0x40')||_0xae7e6b===_0xd683('0x63')||_0xae7e6b===_0xd683('0x55')||_0xae7e6b===_0xd683('0x64')||_0xae7e6b===_0xd683('0x65')||_0xae7e6b===_0xd683('0x66')||_0xae7e6b===_0xd683('0x39')||_0xae7e6b===_0xd683('0x42')||_0xae7e6b===_0xd683('0x67')||_0xae7e6b===_0xd683('0x4c')||_0xae7e6b===_0xd683('0x68')||_0xae7e6b===_0xd683('0x69')||_0xae7e6b===_0xd683('0x45')||_0xae7e6b==='countcongestionretry'||_0xae7e6b===_0xd683('0x47')||_0xae7e6b===_0xd683('0x6a')||_0xae7e6b===_0xd683('0x6b')||_0xae7e6b===_0xd683('0x6c')||_0xae7e6b===_0xd683('0x6d')||_0xae7e6b===_0xd683('0x6e')||_0xae7e6b==='ContactId'||_0xae7e6b===_0xd683('0x4f')||_0xae7e6b===_0xd683('0x3a')||_0xae7e6b===_0xd683('0x19')||_0xae7e6b==='sipcallid'||_0xae7e6b===_0xd683('0x6f')||_0xae7e6b===_0xd683('0x70')||_0xae7e6b===_0xd683('0x71')||_0xae7e6b==='xmd-listid'||_0xae7e6b==='xmd-dialurl'||_0xae7e6b===_0xd683('0x72')||_0xae7e6b===_0xd683('0x73')||_0xae7e6b==='xmd-dialid'||_0xae7e6b===_0xd683('0x74')||_0xae7e6b===_0xd683('0x75')||_0xae7e6b===_0xd683('0x76')||_0xae7e6b===_0xd683('0x77')||_0xae7e6b==='xmd-agiafter'||_0xae7e6b===_0xd683('0x78')||_0xae7e6b===_0xd683('0x79')||_0xae7e6b===_0xd683('0x7a')||_0xae7e6b===_0xd683('0x7b')||_0xae7e6b===_0xd683('0x7c')||_0xae7e6b==='rtpaudioqosloss'||_0xae7e6b===_0xd683('0x7d')||_0xae7e6b===_0xd683('0x7e')||_0xae7e6b===_0xd683('0x7f')||_0xae7e6b===_0xd683('0x79')||_0xae7e6b===_0xd683('0x7a')||_0xae7e6b===_0xd683('0x7b')||_0xae7e6b===_0xd683('0x7c')||_0xae7e6b==='rtpaudioqosloss'||_0xae7e6b==='rtpaudioqoslossbridged'||_0xae7e6b===_0xd683('0x7e')||_0xae7e6b===_0xd683('0x7f')||_0xae7e6b===_0xd683('0x80')||_0xae7e6b===_0xd683('0x81')||_0xae7e6b===_0xd683('0x30')||_0xae7e6b==='statedesc'){return![];}return!![];};exports[_0xd683('0x82')]=function(_0x2b6e95,_0x32ef16){var _0x48510f,_0x2fb4b4,_0x15b250;if(_0x32ef16<=0x0){_0x32ef16=0x1;}_0x48510f=new RegExp(_0xd683('0x83')+_0x32ef16+'}$');_0x2fb4b4=Math[_0xd683('0x84')](0xa,_0x32ef16-0x1);_0x15b250=Math[_0xd683('0x84')](0xa,_0x32ef16)-0x1;return util[_0xd683('0x10')]('%s',_[_0xd683('0x85')](_0x2b6e95,_0x48510f,_[_0xd683('0x86')](_0x2fb4b4,_0x15b250)));};exports['extractCalleridName']=function(_0x5835d0){var _0x25ac96=_0x5835d0[_0xd683('0x87')](/"(.*?)"/);return _0x25ac96?_0x25ac96[0x1]:_0x5835d0;};exports['extractCalleridNumber']=function(_0x55427c){var _0xf5a625=_0x55427c[_0xd683('0x87')](/<(.*?)>/);return _0xf5a625?_0xf5a625[0x1]:_0x55427c;};function buildNoAnswerEventPayload(_0x138823,_0x49c7c1){var _0x3f65a7=buildObj(_0x138823,_0xd683('0x88'));if(!_[_0xd683('0xf')](_0x49c7c1[_0xd683('0x89')])){Object['keys'](_0x49c7c1['variables'])[_0xd683('0x8a')](function(_0x7a9152){_0x3f65a7[_0x7a9152[_0xd683('0x8b')]()]=_0x49c7c1[_0xd683('0x89')][_0x7a9152];});}return _0x3f65a7;}exports[_0xd683('0x8c')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 40a78e4..eb3e31a 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 _0xcdc0=['voicequeuechannelhangup','queueadd','string','boolean','queuepause','reload','voicechannel'];(function(_0x42676f,_0x4c3299){var _0x2b884e=function(_0x478f3f){while(--_0x478f3f){_0x42676f['push'](_0x42676f['shift']());}};_0x2b884e(++_0x4c3299);}(_0xcdc0,0x13c));var _0x0cdc=function(_0x121719,_0x553e6c){_0x121719=_0x121719-0x0;var _0xde68f5=_0xcdc0[_0x121719];return _0xde68f5;};'use strict';exports[_0x0cdc('0x0')]={'queue':{'type':_0x0cdc('0x1'),'required':!![]},'interface':{'type':_0x0cdc('0x1'),'required':!![]},'membername':{'type':_0x0cdc('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x0cdc('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x0cdc('0x1'),'required':!![]},'interface':{'type':_0x0cdc('0x1'),'required':!![]}};exports[_0x0cdc('0x3')]={'interface':{'type':_0x0cdc('0x1'),'required':!![]},'paused':{'type':_0x0cdc('0x2')},'reason':{'type':_0x0cdc('0x1'),'required':![]}};exports[_0x0cdc('0x4')]={'module':{'type':_0x0cdc('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x0cdc('0x1'),'required':!![]}};exports[_0x0cdc('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x0cdc('0x1')},'format':{'type':_0x0cdc('0x1')},'mixmonitorid':{'type':_0x0cdc('0x1')}};exports[_0x0cdc('0x6')]={'uniqueid':{'type':_0x0cdc('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x0cdc('0x1'),'required':!![]},'context':{'type':_0x0cdc('0x1')}}; \ No newline at end of file +var _0x530b=['voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x530b,0xa2));var _0xb530=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x530b[_0x1e4a8e];return _0x5408f9;};'use strict';exports['queueadd']={'queue':{'type':_0xb530('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xb530('0x0'),'required':!![]},'penalty':{'type':_0xb530('0x1'),'required':![]},'paused':{'type':_0xb530('0x2'),'required':![]}};exports[_0xb530('0x3')]={'queue':{'type':_0xb530('0x0'),'required':!![]},'interface':{'type':_0xb530('0x0'),'required':!![]}};exports[_0xb530('0x4')]={'interface':{'type':_0xb530('0x0'),'required':!![]},'paused':{'type':_0xb530('0x2')},'reason':{'type':_0xb530('0x0'),'required':![]}};exports[_0xb530('0x5')]={'module':{'type':_0xb530('0x0'),'required':![]}};exports[_0xb530('0x6')]={'uniqueid':{'type':_0xb530('0x0'),'required':!![]}};exports[_0xb530('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xb530('0x0')},'format':{'type':_0xb530('0x0')},'mixmonitorid':{'type':'string'}};exports[_0xb530('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xb530('0x9')]={'uniqueid':{'type':_0xb530('0x0'),'required':!![]},'exten':{'type':_0xb530('0x0'),'required':!![]},'context':{'type':_0xb530('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7b3bde9..93f3a93 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x23815c,_0x4f0308){var _0x34c1d6=function(_0x27661f){while(--_0x27661f){_0x23815c['push'](_0x23815c['shift']());}};_0x34c1d6(++_0x4f0308);}(_0xadb5,0xad));var _0x5adb=function(_0x143ff4,_0x449ef2){_0x143ff4=_0x143ff4-0x0;var _0x3381c6=_0xadb5[_0x143ff4];return _0x3381c6;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x1221fe,_0x35d7d6){var _0x2b7ceb=function(_0x351a5e){while(--_0x351a5e){_0x1221fe['push'](_0x1221fe['shift']());}};_0x2b7ceb(++_0x35d7d6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f4033,_0x2378b9){_0x4f4033=_0x4f4033-0x0;var _0x2051ec=_0x5f2f[_0x4f4033];return _0x2051ec;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 16fb787..fc47517 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 _0x84d8=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x84d8,0xeb));var _0x884d=function(_0x35aa0c,_0x5a67eb){_0x35aa0c=_0x35aa0c-0x0;var _0x51cf0c=_0x84d8[_0x35aa0c];return _0x51cf0c;};'use strict';function mergeDBDataToRealtime(_0x156680,_0x151255){var _0x1656fb=Object[_0x884d('0x0')]({},_0x156680);for(var _0x37657d in _0x151255){if(_0x1656fb[_0x884d('0x1')](_0x37657d)){_0x1656fb[_0x37657d]=_0x151255[_0x37657d];}}return _0x1656fb;}exports[_0x884d('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x0c3a=['assign','mergeDBDataToRealtime'];(function(_0x2f3f10,_0x34820a){var _0x56f729=function(_0x2d0e07){while(--_0x2d0e07){_0x2f3f10['push'](_0x2f3f10['shift']());}};_0x56f729(++_0x34820a);}(_0x0c3a,0x192));var _0xa0c3=function(_0x4a73dd,_0x58e46c){_0x4a73dd=_0x4a73dd-0x0;var _0x279e6b=_0x0c3a[_0x4a73dd];return _0x279e6b;};'use strict';function mergeDBDataToRealtime(_0x34b957,_0x1c7c39){var _0x338657=Object[_0xa0c3('0x0')]({},_0x34b957);for(var _0x37fd63 in _0x1c7c39){if(_0x338657['hasOwnProperty'](_0x37fd63)){_0x338657[_0x37fd63]=_0x1c7c39[_0x37fd63];}}return _0x338657;}exports[_0xa0c3('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 13b277b..23f6f7a 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 _0x0fd3=['telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','voiceQueueReport','length','connectedlinenum','assigned','lastAssignedTo','interface','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','internal','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','split','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','voiceAgentReport','forEach','voiceDialReport','startsWith','Local','substring','indexOf','phone','exports','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents'];(function(_0x3590f8,_0x3da7da){var _0x2b744c=function(_0x2ef026){while(--_0x2ef026){_0x3590f8['push'](_0x3590f8['shift']());}};_0x2b744c(++_0x3da7da);}(_0x0fd3,0xae));var _0x30fd=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0fd3[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var moment=require(_0x30fd('0x0'));var util=require(_0x30fd('0x1'));var config=require(_0x30fd('0x2'));var ami=require(_0x30fd('0x3'));var RpcVoiceAgentReport=require(_0x30fd('0x4'));var RpcVoiceCallReport=require(_0x30fd('0x5'));var RpcVoiceDialReport=require(_0x30fd('0x6'));var RpcMemberReport=require(_0x30fd('0x7'));var RpcVoiceQueueReport=require(_0x30fd('0x8'));var RpcVoiceRecording=require(_0x30fd('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x30fd('0xa'));var VoiceAgentReport=require(_0x30fd('0xb'));var VoiceDialReport=require(_0x30fd('0xc'));var UserReport=require(_0x30fd('0xd'));function Report(_0x3aebb7){this[_0x30fd('0xe')]=_0x3aebb7;this[_0x30fd('0xf')]=_0x3aebb7['agents'];this[_0x30fd('0x10')]=_0x3aebb7[_0x30fd('0x10')];}Report[_0x30fd('0x11')][_0x30fd('0x12')]=function(_0x265345){var _0x1a7a60=new VoiceQueueReport(this['realtime']);var _0xa0378b=new VoiceAgentReport(this[_0x30fd('0xe')]);var _0x47ef58=new VoiceDialReport(this[_0x30fd('0xe')]);var _0x9de94e=new VoiceCallReport(this[_0x30fd('0xe')]);var _0x7d35df=new UserReport(this[_0x30fd('0xe')]);if(config[_0x30fd('0x13')]&&config[_0x30fd('0x13')][_0x30fd('0x14')]){ami['on'](_0x30fd('0x15'),this['voiceQueueReport']['bind'](this));ami['on']('custom:voiceCallReport',this[_0x30fd('0x16')][_0x30fd('0x17')](this));ami['on'](_0x30fd('0x18'),this['voiceAgentReport'][_0x30fd('0x17')](this));ami['on'](_0x30fd('0x19'),this['voiceDialReport'][_0x30fd('0x17')](this));ami['on'](_0x30fd('0x1a'),this[_0x30fd('0x1b')][_0x30fd('0x17')](this));ami['on'](_0x30fd('0x1c'),this[_0x30fd('0x1d')][_0x30fd('0x17')](this));}};Report[_0x30fd('0x11')][_0x30fd('0x1e')]=function(_0x1f513d){var _0x5f1a4a;_0x5f1a4a=_[_0x30fd('0x1f')](this[_0x30fd('0xf')],function(_0x595fe3){return _0x595fe3[_0x30fd('0x20')]==_0x1f513d||_0x595fe3[_0x30fd('0x21')]==_0x1f513d;});if(_[_0x30fd('0x22')](_0x5f1a4a)){var _0x3ce30d=_[_0x30fd('0x1f')](this['telephones'],function(_0x27995b){return _0x27995b[_0x30fd('0x20')]==_0x1f513d||_0x27995b[_0x30fd('0x21')]==_0x1f513d;});if(_0x3ce30d){_0x5f1a4a=_[_0x30fd('0x1f')](this[_0x30fd('0xf')],function(_0x5cd5ee){return _0x5cd5ee['interface']==util[_0x30fd('0x23')]('SIP/%s',_0x3ce30d[_0x30fd('0x21')]);});}}return _0x5f1a4a;};Report[_0x30fd('0x11')][_0x30fd('0x24')]=function(_0x24df75){for(var _0x65d7d3=0x0;_0x65d7d3<_0x24df75[_0x30fd('0x25')];_0x65d7d3+=0x1){var _0x2b35ed=this[_0x30fd('0x1e')](_0x24df75[_0x65d7d3][_0x30fd('0x26')]);if(_0x2b35ed){_0x24df75[_0x65d7d3][_0x30fd('0x20')]=_0x2b35ed[_0x30fd('0x20')];_0x24df75[_0x65d7d3][_0x30fd('0x27')]=!![];_0x24df75[_0x65d7d3][_0x30fd('0x28')]=_0x2b35ed[_0x30fd('0x21')];_0x24df75[_0x65d7d3][_0x30fd('0x29')]=_[_0x30fd('0x22')](_0x2b35ed[_0x30fd('0x29')])?util['format'](_0x30fd('0x2a'),_0x2b35ed['name']):_0x2b35ed[_0x30fd('0x29')];if(_0x24df75[_0x65d7d3][_0x30fd('0x2b')]){_0x24df75[_0x65d7d3][_0x30fd('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x24df75[_0x65d7d3][_0x30fd('0x2d')]){_0x24df75[_0x65d7d3][_0x30fd('0x2e')]=moment()[_0x30fd('0x23')](_0x30fd('0x2f'));}RpcMemberReport['voiceQueueReport'](_0x24df75[_0x65d7d3]);}RpcVoiceQueueReport[_0x30fd('0x30')](_0x24df75[_0x65d7d3]);}};function extractCalleridNumber(_0x19b0fe){var _0x1a2bc2=_0x19b0fe['match'](/<(.*?)>/);return _0x1a2bc2?_0x1a2bc2[0x1]:_0x19b0fe;}Report[_0x30fd('0x11')][_0x30fd('0x31')]=function(_0x518971){for(var _0x425d5a=0x0;_0x425d5a','linkedid','transfers','transfereelinkedid','uniqueid'];(function(_0xc3b989,_0x53a2cb){var _0x268609=function(_0x3623e2){while(--_0x3623e2){_0xc3b989['push'](_0xc3b989['shift']());}};_0x268609(++_0x53a2cb);}(_0x1b72,0x76));var _0x21b7=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x1b72[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x21b7('0x0'));var moment=require(_0x21b7('0x1'));var util=require('util');var config=require(_0x21b7('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x21b7('0x3'));var RpcVoiceCallReport=require(_0x21b7('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x21b7('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x21b7('0x6'));var RpcVoiceTransferReport=require(_0x21b7('0x7'));var VoiceQueueReport=require(_0x21b7('0x8'));var VoiceCallReport=require(_0x21b7('0x9'));var VoiceAgentReport=require(_0x21b7('0xa'));var VoiceDialReport=require(_0x21b7('0xb'));var UserReport=require('./userReport');function Report(_0x549de2){this[_0x21b7('0xc')]=_0x549de2;this[_0x21b7('0xd')]=_0x549de2[_0x21b7('0xd')];this[_0x21b7('0xe')]=_0x549de2[_0x21b7('0xe')];}Report[_0x21b7('0xf')][_0x21b7('0x10')]=function(_0x9fc31d){var _0x1c25cb=new VoiceQueueReport(this[_0x21b7('0xc')]);var _0x5a0804=new VoiceAgentReport(this[_0x21b7('0xc')]);var _0x288d57=new VoiceDialReport(this[_0x21b7('0xc')]);var _0x13746f=new VoiceCallReport(this[_0x21b7('0xc')]);var _0x60406f=new UserReport(this[_0x21b7('0xc')]);if(config[_0x21b7('0x11')]&&config[_0x21b7('0x11')][_0x21b7('0x12')]){ami['on'](_0x21b7('0x13'),this['voiceQueueReport'][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x15'),this[_0x21b7('0x16')][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x17'),this[_0x21b7('0x18')][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x19'),this['voiceDialReport'][_0x21b7('0x14')](this));ami['on'](_0x21b7('0x1a'),this[_0x21b7('0x1b')]['bind'](this));ami['on'](_0x21b7('0x1c'),this[_0x21b7('0x1d')][_0x21b7('0x14')](this));}};Report['prototype'][_0x21b7('0x1e')]=function(_0x4d5fcd){var _0x47c3eb;_0x47c3eb=_[_0x21b7('0x1f')](this['agents'],function(_0x46a984){return _0x46a984[_0x21b7('0x20')]==_0x4d5fcd||_0x46a984['name']==_0x4d5fcd;});if(_[_0x21b7('0x21')](_0x47c3eb)){var _0x579b8b=_[_0x21b7('0x1f')](this[_0x21b7('0xe')],function(_0x4e239a){return _0x4e239a[_0x21b7('0x20')]==_0x4d5fcd||_0x4e239a[_0x21b7('0x22')]==_0x4d5fcd;});if(_0x579b8b){_0x47c3eb=_[_0x21b7('0x1f')](this[_0x21b7('0xd')],function(_0x3904db){return _0x3904db[_0x21b7('0x23')]==util[_0x21b7('0x24')](_0x21b7('0x25'),_0x579b8b[_0x21b7('0x22')]);});}}return _0x47c3eb;};Report[_0x21b7('0xf')][_0x21b7('0x26')]=function(_0x45a80a){for(var _0x200842=0x0;_0x200842<_0x45a80a[_0x21b7('0x27')];_0x200842+=0x1){var _0x56109f=this['findAgent'](_0x45a80a[_0x200842][_0x21b7('0x28')]);if(_0x56109f){_0x45a80a[_0x200842][_0x21b7('0x20')]=_0x56109f[_0x21b7('0x20')];_0x45a80a[_0x200842][_0x21b7('0x29')]=!![];_0x45a80a[_0x200842]['lastAssignedTo']=_0x56109f[_0x21b7('0x22')];_0x45a80a[_0x200842][_0x21b7('0x23')]=_['isNil'](_0x56109f[_0x21b7('0x23')])?util[_0x21b7('0x24')](_0x21b7('0x25'),_0x56109f[_0x21b7('0x22')]):_0x56109f['interface'];if(_0x45a80a[_0x200842][_0x21b7('0x2a')]){_0x45a80a[_0x200842][_0x21b7('0x2b')]=moment()[_0x21b7('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x45a80a[_0x200842][_0x21b7('0x2c')]){_0x45a80a[_0x200842][_0x21b7('0x2d')]=moment()[_0x21b7('0x24')](_0x21b7('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x45a80a[_0x200842]);}RpcVoiceQueueReport[_0x21b7('0x2f')](_0x45a80a[_0x200842]);}};function extractCalleridNumber(_0x2e12b8){var _0x563fcd=_0x2e12b8['match'](/<(.*?)>/);return _0x563fcd?_0x563fcd[0x1]:_0x2e12b8;}Report[_0x21b7('0xf')][_0x21b7('0x30')]=function(_0x73bda9){for(var _0x5f3c30=0x0;_0x5f3c300x0?!![]:![];if(!_0x3c8d42){return this[_0xbb36('0x19')](this[_0xbb36('0x63')][_0xbb36('0x70')]);}};VoiceQueueReport[_0xbb36('0xb')][_0xbb36('0x1b')]=function(_0x281659){var _0x302ce6=this[_0xbb36('0x63')]['id'];if(this[_0xbb36('0x63')][_0xbb36('0x71')][_0x302ce6]&&this['summary']['queuestatus'][_0x302ce6][_0x281659[_0xbb36('0x65')]]){this[_0xbb36('0x63')][_0xbb36('0x71')][_0x302ce6][_0x281659[_0xbb36('0x65')]][_0xbb36('0x10')]['push'](_0x281659);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x2271f7){var _0x408207=this;try{if(this[_0xbb36('0x5f')](_0x2271f7)&&this[_0xbb36('0x5f')](_0x2271f7[_0xbb36('0x6c')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x2271f7,{'showHidden':![],'depth':null}));var _0x6187e8=this[_0xbb36('0x12')][_0x2271f7[_0xbb36('0x6c')]];if(_0x6187e8){logger[_0xbb36('0x72')](_0xbb36('0x73'),_0x6187e8[_0xbb36('0x5e')]);this['summary']['queues'][_0x6187e8[_0xbb36('0x5e')]]={'summaryEvent':_0x2271f7};this['summary']['statusRequests']+=0x1;return ami[_0xbb36('0x41')]({'action':_0xbb36('0x71'),'queue':_0x6187e8['name']})['then'](function(_0x2bf326){if(!_0x408207[_0xbb36('0x63')][_0xbb36('0x71')][_0x2271f7['actionid']]){_0x408207[_0xbb36('0x63')][_0xbb36('0x71')][_0x2271f7[_0xbb36('0x65')]]={};}_0x408207['summary']['queuestatus'][_0x2271f7['actionid']][_0x2bf326[_0xbb36('0x65')]]={'queue':_0x6187e8['name'],'agents':[]};})[_0xbb36('0x43')](function(_0x5b8317){throw _0x5b8317;});}}}catch(_0x1c27e5){logger[_0xbb36('0x46')](_0xbb36('0x66'),util[_0xbb36('0x48')](_0x1c27e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbb36('0x19')]=function(_0x3a46a0){if(this['summary'][_0xbb36('0x6f')]>0x0){this['summary'][_0xbb36('0x70')]=_0x3a46a0;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xbb36('0x48')](_0x3a46a0,{'showHidden':![],'depth':null}));this[_0xbb36('0x63')]=initializeSummary();ami[_0xbb36('0x4c')](_0xbb36('0x74'),{});};VoiceQueueReport['prototype'][_0xbb36('0x1f')]=function(_0x48e056){try{if(this[_0xbb36('0x5f')](_0x48e056)){logger[_0xbb36('0x4e')](_0xbb36('0x75'),_0x48e056['uniqueid'],util[_0xbb36('0x48')](_0x48e056,{'showHidden':![],'depth':null}));if(_[_0xbb36('0x60')](this[_0xbb36('0xf')][_0x48e056[_0xbb36('0x56')]])){this['queueReports'][_0x48e056['uniqueid']]=[];}if(_[_0xbb36('0x60')](this[_0xbb36('0x3e')][_0x48e056[_0xbb36('0x56')]])){this[_0xbb36('0x3e')][_0x48e056[_0xbb36('0x56')]]={};}var _0x325b7b=new QueueReport();_0x325b7b[_0xbb36('0x6c')]=_0x48e056[_0xbb36('0x6c')];_0x325b7b[_0xbb36('0x5c')]=this[_0xbb36('0x12')][_0x325b7b[_0xbb36('0x6c')]]&&this[_0xbb36('0x12')][_0x325b7b['queue']]['type']?this[_0xbb36('0x12')][_0x325b7b[_0xbb36('0x6c')]][_0xbb36('0x5c')]||_0xbb36('0x5d'):'inbound';_0x325b7b[_0xbb36('0x76')]=moment()[_0xbb36('0x50')](_0xbb36('0x77'));_0x325b7b[_0xbb36('0x78')]=_0x48e056['position'];_0x325b7b['count']=_0x48e056[_0xbb36('0x79')];_0x325b7b['uniqueid']=_0x48e056[_0xbb36('0x56')];_0x325b7b[_0xbb36('0x7a')]=this[_0xbb36('0x3e')][_0x48e056[_0xbb36('0x56')]][_0xbb36('0x7a')];logger[_0xbb36('0x72')](_0xbb36('0x7b'),_0x325b7b[_0xbb36('0x6c')],_0x325b7b[_0xbb36('0x5c')]);_[_0xbb36('0x7c')](_0x325b7b,_[_0xbb36('0x7d')](_0x48e056,_[_0xbb36('0x7e')](_0x325b7b)));this[_0xbb36('0xf')][_0x48e056[_0xbb36('0x56')]][_0xbb36('0x7f')](_0x325b7b);this['channels'][_0x48e056[_0xbb36('0x56')]]=_0x325b7b;this[_0xbb36('0x4d')](_0x325b7b,_0xbb36('0x1e'));}}catch(_0xf68d06){logger['error'](_0xbb36('0x75'),_0x48e056[_0xbb36('0x56')],util[_0xbb36('0x48')](_0xf68d06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbb36('0xb')]['syncQueueCallerAbandon']=function(_0x549fff){try{if(this[_0xbb36('0x5f')](_0x549fff)){logger[_0xbb36('0x4e')](_0xbb36('0x80'),_0x549fff['uniqueid'],util[_0xbb36('0x48')](_0x549fff,{'showHidden':![],'depth':null}));if(this[_0xbb36('0xf')][_0x549fff[_0xbb36('0x56')]]){var _0x1c6c9b=_[_0xbb36('0x81')](this[_0xbb36('0xf')][_0x549fff[_0xbb36('0x56')]]);_0x1c6c9b[_0xbb36('0x82')]=![];_0x1c6c9b[_0xbb36('0x83')]=null;_0x1c6c9b[_0xbb36('0x84')]=_0x549fff[_0xbb36('0x84')];_0x1c6c9b[_0xbb36('0x85')]=_0x549fff[_0xbb36('0x85')];_0x1c6c9b[_0xbb36('0x20')]=!![];_0x1c6c9b[_0xbb36('0x86')]=moment()['format'](_0xbb36('0x77'));_0x1c6c9b[_0xbb36('0x57')]=_0xbb36('0x87');_0x1c6c9b[_0xbb36('0x88')]=null;logger[_0xbb36('0x72')](_0xbb36('0x89'),_0x1c6c9b[_0xbb36('0x6c')],_0x1c6c9b[_0xbb36('0x5c')]);this[_0xbb36('0x3e')][_0x549fff[_0xbb36('0x56')]]=_0x1c6c9b;this[_0xbb36('0x53')](_0x1c6c9b,_0xbb36('0x20'));}}}catch(_0x1471b0){logger['error'](_0xbb36('0x80'),_0x549fff[_0xbb36('0x56')],util['inspect'](_0x1471b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbb36('0xb')][_0xbb36('0x22')]=function(_0x37bf5e){try{if(this[_0xbb36('0x5f')](_0x37bf5e)){logger[_0xbb36('0x4e')](_0xbb36('0x8a'),_0x37bf5e['uniqueid'],util['inspect'](_0x37bf5e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x37bf5e[_0xbb36('0x56')]]){var _0x505f86=_[_0xbb36('0x81')](this[_0xbb36('0xf')][_0x37bf5e['uniqueid']]);_0x505f86[_0xbb36('0x8b')]=moment()[_0xbb36('0x50')](_0xbb36('0x77'));_0x505f86[_0xbb36('0x8c')]=_0x37bf5e[_0xbb36('0x8c')];_0x505f86[_0xbb36('0x8d')]=_0x37bf5e[_0xbb36('0x8d')];logger[_0xbb36('0x72')](_0xbb36('0x8e'),_0x505f86[_0xbb36('0x6c')],_0x505f86['type'],_0x37bf5e[_0xbb36('0x8c')],_0x37bf5e[_0xbb36('0x8d')]);this['channels'][_0x37bf5e[_0xbb36('0x56')]]=_0x505f86;this['emitVoiceQueueChannelSave'](_0x505f86,_0xbb36('0x8f'));}}}catch(_0x299741){logger[_0xbb36('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x37bf5e[_0xbb36('0x56')],util[_0xbb36('0x48')](_0x299741,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbb36('0xb')][_0xbb36('0x90')]=function(_0x295c80){try{if(this[_0xbb36('0x5f')](_0x295c80)){logger[_0xbb36('0x4e')]('[%s][voiceQueueReport][agentconnect]',_0x295c80[_0xbb36('0x56')],util[_0xbb36('0x48')](_0x295c80,{'showHidden':![],'depth':null}));if(this[_0xbb36('0xf')][_0x295c80[_0xbb36('0x56')]]){var _0x54076a=_[_0xbb36('0x81')](this[_0xbb36('0xf')][_0x295c80[_0xbb36('0x56')]]);_0x54076a[_0xbb36('0x82')]=!![];_0x54076a[_0xbb36('0x57')]='COMPLETEDBYAGENT';logger[_0xbb36('0x72')](_0xbb36('0x91'),_0x54076a[_0xbb36('0x6c')],_0x54076a['type']);}}}catch(_0x4c4f41){logger[_0xbb36('0x46')](_0xbb36('0x92'),_0x295c80[_0xbb36('0x56')],util[_0xbb36('0x48')](_0x4c4f41,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xbb36('0x24')]=function(_0x1eba6d){try{if(this[_0xbb36('0x5f')](_0x1eba6d)){logger['debug'](_0xbb36('0x93'),_0x1eba6d['uniqueid'],util[_0xbb36('0x48')](_0x1eba6d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1eba6d['uniqueid']]){var _0x204a81=_['last'](this[_0xbb36('0xf')][_0x1eba6d[_0xbb36('0x56')]]);_0x204a81[_0xbb36('0x20')]=![];_0x204a81['queuecallerabandonAt']=null;_0x204a81[_0xbb36('0x94')]=!![];_0x204a81[_0xbb36('0x88')]=_0x1eba6d['membername'];_0x204a81[_0xbb36('0x84')]=_0x1eba6d[_0xbb36('0x84')];_0x204a81[_0xbb36('0x82')]=!![];_0x204a81[_0xbb36('0x95')]=![];_0x204a81[_0xbb36('0x96')]=null;if(!_0x204a81[_0xbb36('0x97')]){if(_0x1eba6d[_0xbb36('0x98')]=='transfer'){_0x204a81[_0xbb36('0x57')]='COMPLETED';logger[_0xbb36('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x204a81[_0xbb36('0x6c')],_0x204a81['type']);}else{if(_[_0xbb36('0x99')](_0x1eba6d[_0xbb36('0x9a')]['toLowerCase'](),_0xbb36('0x9b'))){if(this[_0xbb36('0xf')][_0x1eba6d[_0xbb36('0x9c')]]){var _0x4d23c3=_[_0xbb36('0x81')](this['queueReports'][_0x1eba6d['linkedid']]);_0x4d23c3['queuecallercomplete']=![];_0x4d23c3[_0xbb36('0x95')]=!![];_0x4d23c3[_0xbb36('0x96')]=moment(_0x204a81[_0xbb36('0x76')])[_0xbb36('0x9d')](_0x1eba6d['holdtime'],_0xbb36('0x9e'))[_0xbb36('0x50')](_0xbb36('0x77'));_0x4d23c3[_0xbb36('0x57')]=_0xbb36('0x9f');_0x4d23c3['transfer']=!![];_0x4d23c3[_0xbb36('0xa0')]=_0xbb36('0xa1');_0x4d23c3[_0xbb36('0xa2')]=_0x1eba6d['destexten'];_0x4d23c3[_0xbb36('0xa3')]=_0x1eba6d[_0xbb36('0x56')];logger[_0xbb36('0x72')](_0xbb36('0xa4'),_0x4d23c3[_0xbb36('0x6c')],_0x4d23c3[_0xbb36('0x5c')]);var _0x5df2eb=this['queueReports'][_0x1eba6d[_0xbb36('0x9c')]];this[_0xbb36('0xf')][_0x1eba6d[_0xbb36('0x9c')]]=this[_0xbb36('0xf')][_0x1eba6d['uniqueid']];this[_0xbb36('0xf')][_0x1eba6d['uniqueid']]=_0x5df2eb;}}else{_0x204a81[_0xbb36('0x57')]='COMPLETEDBY'+_0x1eba6d['reason'][_0xbb36('0xa5')]();logger[_0xbb36('0x72')](_0xbb36('0xa6'),_0x204a81[_0xbb36('0x6c')],_0x204a81[_0xbb36('0x5c')],_0x204a81[_0xbb36('0x57')]);}}}this[_0xbb36('0x3e')][_0x1eba6d[_0xbb36('0x56')]]=_0x204a81;}}}catch(_0x4f34a4){logger[_0xbb36('0x46')](_0xbb36('0x93'),_0x1eba6d[_0xbb36('0x56')],util[_0xbb36('0x48')](_0x4f34a4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbb36('0xb')]['syncVarSet']=function(_0x22a27b){try{if(this[_0xbb36('0x5f')](_0x22a27b)){logger[_0xbb36('0x4e')](_0xbb36('0xa7'),_0x22a27b[_0xbb36('0x56')],util[_0xbb36('0x48')](_0x22a27b,{'showHidden':![],'depth':null}));this[_0xbb36('0xa8')](_0x22a27b[_0xbb36('0x56')],_[_0xbb36('0x7e')](_0x22a27b['variable'])[0x0],_0x22a27b[_0xbb36('0xa9')]);if(this[_0xbb36('0xf')][_0x22a27b[_0xbb36('0x56')]]){var _0x1cb97d=_[_0xbb36('0x81')](this[_0xbb36('0xf')][_0x22a27b[_0xbb36('0x56')]]);if(_0x1cb97d){if(this[_0xbb36('0x5f')](_0x22a27b['variable'])&&this['isNotNull'](_0x22a27b[_0xbb36('0xaa')][_0xbb36('0x71')])){switch(_0x22a27b[_0xbb36('0xa9')]){case _0xbb36('0xab'):_0x1cb97d['queuecallerexit']=![];_0x1cb97d['queuecallerexitAt']=null;break;case _0xbb36('0xac'):_0x1cb97d[_0xbb36('0xad')]=_0xbb36('0xae');_0x1cb97d[_0xbb36('0x95')]=!![];_0x1cb97d[_0xbb36('0x96')]=moment()['format'](_0xbb36('0x77'));_0x1cb97d[_0xbb36('0x8b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xbb36('0x4e')](_0xbb36('0xaf'),_0x22a27b[_0xbb36('0x56')],util['inspect'](_0x1cb97d,{'showHidden':![],'depth':null}));ami[_0xbb36('0x4c')]('custom:timeout',_0x1cb97d);break;default:_0x1cb97d[_0xbb36('0x95')]=!![];_0x1cb97d[_0xbb36('0x96')]=moment()['format'](_0xbb36('0x77'));_0x1cb97d[_0xbb36('0x8b')]=moment()['format'](_0xbb36('0x77'));}_0x1cb97d['queuecallerabandon']=![];_0x1cb97d[_0xbb36('0x86')]=null;_0x1cb97d[_0xbb36('0x57')]=_0x22a27b[_0xbb36('0xa9')];this['channels'][_0x22a27b[_0xbb36('0x56')]]=_0x1cb97d;this['emitVoiceQueueChannelRemove'](_0x1cb97d,'varset');}else if(this['isNotNull'](_0x22a27b[_0xbb36('0xaa')])&&this['isNotNull'](_0x22a27b[_0xbb36('0xaa')][_0xbb36('0xb0')])){if(!_0x1cb97d[_0xbb36('0x20')]){_0x1cb97d[_0xbb36('0x95')]=!![];_0x1cb97d[_0xbb36('0x96')]=moment()[_0xbb36('0x50')](_0xbb36('0x77'));_0x1cb97d[_0xbb36('0x57')]=_0xbb36('0xb1');_0x1cb97d[_0xbb36('0x8b')]=moment()['format'](_0xbb36('0x77'));this['channels'][_0x22a27b[_0xbb36('0x56')]]=_0x1cb97d;}}logger['info'](_0xbb36('0xb2'),_0x22a27b[_0xbb36('0x56')],_0x1cb97d[_0xbb36('0x6c')],_0x1cb97d[_0xbb36('0x5c')],_[_0xbb36('0x7e')](_0x22a27b['variable'])[0x0],_0x22a27b['value']);_0x1cb97d[_0xbb36('0x14')]=this[_0xbb36('0x14')][_0x22a27b[_0xbb36('0x56')]];}}}}catch(_0xafaee){logger[_0xbb36('0x46')](_0xbb36('0xa7'),_0x22a27b[_0xbb36('0x56')],util[_0xbb36('0x48')](_0xafaee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xbb36('0xb')][_0xbb36('0xa8')]=function(_0x53db9c,_0x2e6af0,_0x745323){var _0xbfb938=['rtpaudioqos','rtpaudioqosbridged',_0xbb36('0xb3'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0xbb36('0xb4'),_0xbb36('0xb5'),'sipcallid',_0xbb36('0xb6'),_0xbb36('0xb7'),'bridgepvtcallid',_0xbb36('0xb8'),_0xbb36('0xb9'),'memberinterface','memberlastcall',_0xbb36('0xba'),_0xbb36('0xbb'),_0xbb36('0xbc')];if(!_[_0xbb36('0x40')](_0x2e6af0)&&!_[_0xbb36('0xbd')](_0xbfb938,_0x2e6af0)){if(_['isUndefined'](this['variables'][_0x53db9c])){this['variables'][_0x53db9c]={};}this['variables'][_0x53db9c][_0x2e6af0]=_0x745323;}};VoiceQueueReport[_0xbb36('0xb')][_0xbb36('0xbe')]=function(_0x1e259f,_0x494108,_0x1e9c7f){var _0x3c4178={};for(var _0x157717=0x0;_0x1577170x0?!![]:![];if(!_0x2fff80){return this['syncQueueSummaryComplete'](this[_0x2cfd('0x4a')][_0x2cfd('0x70')]);}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x1e')]=function(_0x5e57fb){var _0x23fe9b=this['summary']['id'];if(this['summary'][_0x2cfd('0x6a')][_0x23fe9b]&&this[_0x2cfd('0x4a')][_0x2cfd('0x6a')][_0x23fe9b][_0x5e57fb[_0x2cfd('0x6b')]]){this[_0x2cfd('0x4a')][_0x2cfd('0x6a')][_0x23fe9b][_0x5e57fb[_0x2cfd('0x6b')]][_0x2cfd('0x14')][_0x2cfd('0x71')](_0x5e57fb);}};VoiceQueueReport[_0x2cfd('0xe')]['syncQueueSummary']=function(_0x480fe3){var _0x1a264b=this;try{if(this['isNotNull'](_0x480fe3)&&this['isNotNull'](_0x480fe3[_0x2cfd('0x51')])){logger[_0x2cfd('0x4c')](_0x2cfd('0x72'),util[_0x2cfd('0x46')](_0x480fe3,{'showHidden':![],'depth':null}));var _0x9619ab=this[_0x2cfd('0x17')][_0x480fe3[_0x2cfd('0x51')]];if(_0x9619ab){logger[_0x2cfd('0x73')](_0x2cfd('0x74'),_0x9619ab['name']);this['summary']['queues'][_0x9619ab[_0x2cfd('0x5b')]]={'summaryEvent':_0x480fe3};this[_0x2cfd('0x4a')][_0x2cfd('0x6f')]+=0x1;return ami['Action']({'action':_0x2cfd('0x6a'),'queue':_0x9619ab[_0x2cfd('0x5b')]})[_0x2cfd('0x62')](function(_0x21d76a){if(!_0x1a264b[_0x2cfd('0x4a')]['queuestatus'][_0x480fe3[_0x2cfd('0x6b')]]){_0x1a264b['summary'][_0x2cfd('0x6a')][_0x480fe3[_0x2cfd('0x6b')]]={};}_0x1a264b[_0x2cfd('0x4a')][_0x2cfd('0x6a')][_0x480fe3[_0x2cfd('0x6b')]][_0x21d76a['actionid']]={'queue':_0x9619ab[_0x2cfd('0x5b')],'agents':[]};})[_0x2cfd('0x5f')](function(_0x9fbbce){throw _0x9fbbce;});}}}catch(_0xb493c7){logger[_0x2cfd('0x44')](_0x2cfd('0x75'),util[_0x2cfd('0x46')](_0xb493c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x1d')]=function(_0xaa0046){if(this[_0x2cfd('0x4a')]['statusRequests']>0x0){this[_0x2cfd('0x4a')][_0x2cfd('0x70')]=_0xaa0046;return;}logger[_0x2cfd('0x4c')](_0x2cfd('0x76'),util[_0x2cfd('0x46')](_0xaa0046,{'showHidden':![],'depth':null}));this[_0x2cfd('0x4a')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x21')]=function(_0x4c060f){try{if(this['isNotNull'](_0x4c060f)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x4c060f[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x4c060f,{'showHidden':![],'depth':null}));if(_[_0x2cfd('0x5d')](this[_0x2cfd('0x12')][_0x4c060f[_0x2cfd('0x4f')]])){this[_0x2cfd('0x12')][_0x4c060f[_0x2cfd('0x4f')]]=[];}if(_['isUndefined'](this[_0x2cfd('0x15')][_0x4c060f[_0x2cfd('0x4f')]])){this['channels'][_0x4c060f[_0x2cfd('0x4f')]]={};}var _0x392059=new QueueReport();_0x392059[_0x2cfd('0x51')]=_0x4c060f[_0x2cfd('0x51')];_0x392059[_0x2cfd('0x59')]=this['voiceQueues'][_0x392059[_0x2cfd('0x51')]]&&this[_0x2cfd('0x17')][_0x392059[_0x2cfd('0x51')]]['type']?this[_0x2cfd('0x17')][_0x392059[_0x2cfd('0x51')]]['type']||_0x2cfd('0x6c'):_0x2cfd('0x6c');_0x392059['queuecallerjoinAt']=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x392059[_0x2cfd('0x78')]=_0x4c060f[_0x2cfd('0x78')];_0x392059['count']=_0x4c060f[_0x2cfd('0x79')];_0x392059['uniqueid']=_0x4c060f[_0x2cfd('0x4f')];_0x392059[_0x2cfd('0x7a')]=this[_0x2cfd('0x15')][_0x4c060f[_0x2cfd('0x4f')]][_0x2cfd('0x7a')];logger[_0x2cfd('0x73')](_0x2cfd('0x7b'),_0x392059[_0x2cfd('0x51')],_0x392059[_0x2cfd('0x59')]);_[_0x2cfd('0x7c')](_0x392059,_[_0x2cfd('0x7d')](_0x4c060f,_[_0x2cfd('0x7e')](_0x392059)));this[_0x2cfd('0x12')][_0x4c060f[_0x2cfd('0x4f')]][_0x2cfd('0x71')](_0x392059);this[_0x2cfd('0x15')][_0x4c060f[_0x2cfd('0x4f')]]=_0x392059;this[_0x2cfd('0x7f')](_0x392059,_0x2cfd('0x20'));}}catch(_0x5d737d){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x4c060f[_0x2cfd('0x4f')],util['inspect'](_0x5d737d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2cfd('0x23')]=function(_0x55a9d7){try{if(this[_0x2cfd('0x80')](_0x55a9d7)){logger[_0x2cfd('0x4c')](_0x2cfd('0x81'),_0x55a9d7[_0x2cfd('0x4f')],util['inspect'](_0x55a9d7,{'showHidden':![],'depth':null}));if(this[_0x2cfd('0x12')][_0x55a9d7[_0x2cfd('0x4f')]]){var _0x55d1fb=_['last'](this[_0x2cfd('0x12')][_0x55a9d7['uniqueid']]);_0x55d1fb[_0x2cfd('0x82')]=![];_0x55d1fb[_0x2cfd('0x83')]=null;_0x55d1fb[_0x2cfd('0x84')]=_0x55a9d7[_0x2cfd('0x84')];_0x55d1fb[_0x2cfd('0x85')]=_0x55a9d7['originalposition'];_0x55d1fb['queuecallerabandon']=!![];_0x55d1fb[_0x2cfd('0x86')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x55d1fb[_0x2cfd('0x54')]=_0x2cfd('0x87');_0x55d1fb[_0x2cfd('0x88')]=null;logger['info'](_0x2cfd('0x89'),_0x55d1fb[_0x2cfd('0x51')],_0x55d1fb['type']);this[_0x2cfd('0x15')][_0x55a9d7[_0x2cfd('0x4f')]]=_0x55d1fb;this['emitVoiceQueueChannelRemove'](_0x55d1fb,_0x2cfd('0x22'));}}}catch(_0x195a64){logger[_0x2cfd('0x44')](_0x2cfd('0x81'),_0x55a9d7[_0x2cfd('0x4f')],util['inspect'](_0x195a64,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2cfd('0x25')]=function(_0x23a319){try{if(this[_0x2cfd('0x80')](_0x23a319)){logger[_0x2cfd('0x4c')](_0x2cfd('0x8a'),_0x23a319['uniqueid'],util[_0x2cfd('0x46')](_0x23a319,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x23a319[_0x2cfd('0x4f')]]){var _0x3cbbe7=_[_0x2cfd('0x8b')](this[_0x2cfd('0x12')][_0x23a319[_0x2cfd('0x4f')]]);_0x3cbbe7[_0x2cfd('0x8c')]=moment()[_0x2cfd('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cbbe7[_0x2cfd('0x8d')]=_0x23a319['connectedlinenum'];_0x3cbbe7[_0x2cfd('0x8e')]=_0x23a319[_0x2cfd('0x8e')];logger[_0x2cfd('0x73')](_0x2cfd('0x8f'),_0x3cbbe7[_0x2cfd('0x51')],_0x3cbbe7['type'],_0x23a319[_0x2cfd('0x8d')],_0x23a319[_0x2cfd('0x8e')]);this['channels'][_0x23a319[_0x2cfd('0x4f')]]=_0x3cbbe7;this[_0x2cfd('0x7f')](_0x3cbbe7,_0x2cfd('0x24'));}}}catch(_0x293cb1){logger['error'](_0x2cfd('0x8a'),_0x23a319[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x293cb1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x28')]=function(_0x49ec14){try{if(this[_0x2cfd('0x80')](_0x49ec14)){logger[_0x2cfd('0x4c')](_0x2cfd('0x90'),_0x49ec14[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x49ec14,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x49ec14[_0x2cfd('0x4f')]]){var _0x15a89d=_['last'](this[_0x2cfd('0x12')][_0x49ec14[_0x2cfd('0x4f')]]);_0x15a89d[_0x2cfd('0x82')]=!![];_0x15a89d[_0x2cfd('0x54')]='COMPLETEDBYAGENT';logger[_0x2cfd('0x73')](_0x2cfd('0x91'),_0x15a89d['queue'],_0x15a89d[_0x2cfd('0x59')]);}}}catch(_0x31113e){logger['error'](_0x2cfd('0x90'),_0x49ec14[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x31113e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')]['syncAgentComplete']=function(_0x5dadf9){try{if(this[_0x2cfd('0x80')](_0x5dadf9)){logger['debug'](_0x2cfd('0x92'),_0x5dadf9[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x5dadf9,{'showHidden':![],'depth':null}));if(this[_0x2cfd('0x12')][_0x5dadf9['uniqueid']]){var _0x29d3c0=_[_0x2cfd('0x8b')](this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x4f')]]);_0x29d3c0[_0x2cfd('0x22')]=![];_0x29d3c0[_0x2cfd('0x86')]=null;_0x29d3c0['assigned']=!![];_0x29d3c0[_0x2cfd('0x88')]=_0x5dadf9[_0x2cfd('0x93')];_0x29d3c0['holdtime']=_0x5dadf9[_0x2cfd('0x84')];_0x29d3c0[_0x2cfd('0x82')]=!![];_0x29d3c0['queuecallerexit']=![];_0x29d3c0[_0x2cfd('0x94')]=null;if(!_0x29d3c0[_0x2cfd('0x95')]){if(_0x5dadf9['reason']=='transfer'){_0x29d3c0['queuecallerexitreason']=_0x2cfd('0x96');logger[_0x2cfd('0x73')](_0x2cfd('0x97'),_0x29d3c0[_0x2cfd('0x51')],_0x29d3c0['type']);}else{if(_['startsWith'](_0x5dadf9[_0x2cfd('0x41')][_0x2cfd('0x98')](),_0x2cfd('0x99'))){if(this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x9a')]]){var _0x4f1bc4=_[_0x2cfd('0x8b')](this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x9a')]]);_0x4f1bc4[_0x2cfd('0x82')]=![];_0x4f1bc4[_0x2cfd('0x9b')]=!![];_0x4f1bc4[_0x2cfd('0x94')]=moment(_0x29d3c0[_0x2cfd('0x9c')])[_0x2cfd('0x9d')](_0x5dadf9[_0x2cfd('0x84')],'seconds')[_0x2cfd('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f1bc4[_0x2cfd('0x54')]=_0x2cfd('0x9e');_0x4f1bc4['transfer']=!![];_0x4f1bc4[_0x2cfd('0x9f')]=_0x2cfd('0xa0');_0x4f1bc4['transferexten']=_0x5dadf9[_0x2cfd('0xa1')];_0x4f1bc4[_0x2cfd('0xa2')]=_0x5dadf9[_0x2cfd('0x4f')];logger[_0x2cfd('0x73')](_0x2cfd('0xa3'),_0x4f1bc4[_0x2cfd('0x51')],_0x4f1bc4['type']);var _0x5fd6c9=this[_0x2cfd('0x12')][_0x5dadf9['linkedid']];this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x9a')]]=this[_0x2cfd('0x12')][_0x5dadf9[_0x2cfd('0x4f')]];this[_0x2cfd('0x12')][_0x5dadf9['uniqueid']]=_0x5fd6c9;}}else{_0x29d3c0['queuecallerexitreason']=_0x2cfd('0xa4')+_0x5dadf9[_0x2cfd('0xa5')][_0x2cfd('0xa6')]();logger['info'](_0x2cfd('0xa7'),_0x29d3c0[_0x2cfd('0x51')],_0x29d3c0[_0x2cfd('0x59')],_0x29d3c0[_0x2cfd('0x54')]);}}}this[_0x2cfd('0x15')][_0x5dadf9[_0x2cfd('0x4f')]]=_0x29d3c0;}}}catch(_0x1bb210){logger[_0x2cfd('0x44')](_0x2cfd('0x92'),_0x5dadf9[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x1bb210,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0x2a')]=function(_0x123f58){try{if(this[_0x2cfd('0x80')](_0x123f58)){logger[_0x2cfd('0x4c')](_0x2cfd('0xa8'),_0x123f58['uniqueid'],util['inspect'](_0x123f58,{'showHidden':![],'depth':null}));this['addVariable'](_0x123f58[_0x2cfd('0x4f')],_[_0x2cfd('0x7e')](_0x123f58[_0x2cfd('0xa9')])[0x0],_0x123f58[_0x2cfd('0xaa')]);if(this[_0x2cfd('0x12')][_0x123f58[_0x2cfd('0x4f')]]){var _0x322465=_['last'](this[_0x2cfd('0x12')][_0x123f58[_0x2cfd('0x4f')]]);if(_0x322465){if(this['isNotNull'](_0x123f58['variable'])&&this['isNotNull'](_0x123f58[_0x2cfd('0xa9')][_0x2cfd('0x6a')])){switch(_0x123f58['value']){case _0x2cfd('0xab'):_0x322465['queuecallerexit']=![];_0x322465[_0x2cfd('0x94')]=null;break;case _0x2cfd('0xac'):_0x322465[_0x2cfd('0xad')]='timeout';_0x322465[_0x2cfd('0x9b')]=!![];_0x322465[_0x2cfd('0x94')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x322465[_0x2cfd('0x8c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x2cfd('0xae'),_0x123f58[_0x2cfd('0x4f')],util['inspect'](_0x322465,{'showHidden':![],'depth':null}));ami[_0x2cfd('0x4b')](_0x2cfd('0xaf'),_0x322465);break;default:_0x322465[_0x2cfd('0x9b')]=!![];_0x322465[_0x2cfd('0x94')]=moment()['format'](_0x2cfd('0x77'));_0x322465['queuecallerleaveAt']=moment()['format'](_0x2cfd('0x77'));}_0x322465[_0x2cfd('0x22')]=![];_0x322465[_0x2cfd('0x86')]=null;_0x322465[_0x2cfd('0x54')]=_0x123f58[_0x2cfd('0xaa')];this[_0x2cfd('0x15')][_0x123f58[_0x2cfd('0x4f')]]=_0x322465;this[_0x2cfd('0xb0')](_0x322465,'varset');}else if(this[_0x2cfd('0x80')](_0x123f58[_0x2cfd('0xa9')])&&this[_0x2cfd('0x80')](_0x123f58[_0x2cfd('0xa9')][_0x2cfd('0xb1')])){if(!_0x322465['queuecallerabandon']){_0x322465['queuecallerexit']=!![];_0x322465[_0x2cfd('0x94')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));_0x322465[_0x2cfd('0x54')]=_0x2cfd('0xb2');_0x322465[_0x2cfd('0x8c')]=moment()[_0x2cfd('0x50')](_0x2cfd('0x77'));this[_0x2cfd('0x15')][_0x123f58[_0x2cfd('0x4f')]]=_0x322465;}}logger[_0x2cfd('0x73')](_0x2cfd('0xb3'),_0x123f58[_0x2cfd('0x4f')],_0x322465[_0x2cfd('0x51')],_0x322465[_0x2cfd('0x59')],_[_0x2cfd('0x7e')](_0x123f58[_0x2cfd('0xa9')])[0x0],_0x123f58[_0x2cfd('0xaa')]);_0x322465[_0x2cfd('0x19')]=this[_0x2cfd('0x19')][_0x123f58[_0x2cfd('0x4f')]];}}}}catch(_0x5c1a5a){logger[_0x2cfd('0x44')](_0x2cfd('0xa8'),_0x123f58[_0x2cfd('0x4f')],util[_0x2cfd('0x46')](_0x5c1a5a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0xb4')]=function(_0x5754fa,_0x202d8a,_0x27f42d){var _0x3c9964=[_0x2cfd('0xb5'),'rtpaudioqosbridged',_0x2cfd('0xb6'),_0x2cfd('0xb7'),_0x2cfd('0xb8'),_0x2cfd('0xb9'),_0x2cfd('0xba'),'rtpaudioqosrttbridged',_0x2cfd('0xbb'),'sipuri',_0x2cfd('0xbc'),_0x2cfd('0xbd'),_0x2cfd('0xbe'),_0x2cfd('0xbf'),'memberinterface','memberlastcall','membername',_0x2cfd('0xc0'),_0x2cfd('0xc1')];if(!_[_0x2cfd('0x3f')](_0x202d8a)&&!_[_0x2cfd('0xc2')](_0x3c9964,_0x202d8a)){if(_['isUndefined'](this[_0x2cfd('0x19')][_0x5754fa])){this['variables'][_0x5754fa]={};}this[_0x2cfd('0x19')][_0x5754fa][_0x202d8a]=_0x27f42d;}};VoiceQueueReport[_0x2cfd('0xe')][_0x2cfd('0xc3')]=function(_0x57c5a8,_0x1edb8e,_0x18a7f4){var _0x5978f5={};for(var _0x1237de=0x0;_0x1237de=0x0?moment(_0x53e1af[_0xf0d4('0x17')])[_0xf0d4('0xd')](_0x53e1af[_0xf0d4('0x16')],'seconds'):null,'data1':_0xf0d4('0x19'),'data2':_0x53e1af['accountcode'],'data3':_0x53e1af[_0xf0d4('0x1a')],'data4':_0x53e1af['dialstring']||null,'role':_0xf0d4('0x10'),'internal':_0x53e1af[_0xf0d4('0x12')]?_[_0xf0d4('0x11')](_0x53e1af[_0xf0d4('0x12')]):undefined,'uniqueid':_0x53e1af[_0xf0d4('0x1b')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x303e=['exten','agent','accountcode','toNumber','uniqueid','voiceDialReport','Request','voice','starttime','endtime','diff','outbound','dialstring','moment','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','isNil','interface','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum'];(function(_0x2e2fad,_0x180434){var _0x947779=function(_0x3ee1ef){while(--_0x3ee1ef){_0x2e2fad['push'](_0x2e2fad['shift']());}};_0x947779(++_0x180434);}(_0x303e,0x195));var _0xe303=function(_0x349260,_0x1f3563){_0x349260=_0x349260-0x0;var _0x55cd96=_0x303e[_0x349260];return _0x55cd96;};'use strict';var moment=require(_0xe303('0x0'));var _=require('lodash');var util=require(_0xe303('0x1'));var client=require('../client');exports[_0xe303('0x2')]=function(_0x4431f2){var _0x4393c7=_0x4431f2[_0xe303('0x3')]||_0x4431f2[_0xe303('0x4')];return client['Request'](_0xe303('0x5'),{'body':{'channel':'voice','membername':_0x4431f2['lastAssignedTo'],'interface':_[_0xe303('0x6')](_0x4431f2[_0xe303('0x7')])?util['format'](_0xe303('0x8'),_0x4431f2[_0xe303('0x9')]):_0x4431f2['interface'],'type':_0xe303('0xa'),'enterAt':_0x4431f2[_0xe303('0xb')],'exitAt':_0x4393c7,'duration':moment(_0x4393c7)['diff'](_0x4431f2['queuecallerleaveAt'],_0xe303('0xc')),'data1':_0xe303('0xd'),'data2':_0x4431f2[_0xe303('0xe')],'data3':_0x4431f2[_0xe303('0xf')],'data4':null,'data5':_0x4431f2['queue'],'role':_0xe303('0x10'),'internal':_0x4431f2[_0xe303('0x11')]?_[_0xe303('0x12')](_0x4431f2[_0xe303('0x11')]):undefined,'uniqueid':_0x4431f2[_0xe303('0x13')]},'log':_0xe303('0x5')});};exports[_0xe303('0x14')]=function(_0x2a97ef){return client[_0xe303('0x15')](_0xe303('0x5'),{'body':{'channel':_0xe303('0x16'),'membername':_0x2a97ef['membername'],'interface':_0x2a97ef[_0xe303('0x7')],'type':_0xe303('0xa'),'enterAt':_0x2a97ef[_0xe303('0x17')],'exitAt':_0x2a97ef[_0xe303('0x18')],'duration':moment(_0x2a97ef[_0xe303('0x18')])['diff'](_0x2a97ef[_0xe303('0x17')],_0xe303('0xc'))>=0x0?moment(_0x2a97ef['endtime'])[_0xe303('0x19')](_0x2a97ef[_0xe303('0x17')],_0xe303('0xc')):null,'data1':_0xe303('0x1a'),'data2':_0x2a97ef['accountcode'],'data3':_0x2a97ef[_0xe303('0xf')],'data4':_0x2a97ef[_0xe303('0x1b')]||null,'role':'agent','internal':_0x2a97ef[_0xe303('0x11')]?_[_0xe303('0x12')](_0x2a97ef['accountcode']):undefined,'uniqueid':_0x2a97ef[_0xe303('0x13')]},'log':_0xe303('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 32b38b4..8523480 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 _0x9348=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9348,0x10d));var _0x8934=function(_0x54eaff,_0x317a23){_0x54eaff=_0x54eaff-0x0;var _0x3a653c=_0x9348[_0x54eaff];return _0x3a653c;};'use strict';var client=require(_0x8934('0x0'));exports[_0x8934('0x1')]=function(){return client[_0x8934('0x2')](_0x8934('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x8934('0x4'),'previewRecallmeReminderInterval']},'log':_0x8934('0x5')});}; \ No newline at end of file +var _0xf8ff=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','Request'];(function(_0x12eb9e,_0x163858){var _0x480c7d=function(_0x449437){while(--_0x449437){_0x12eb9e['push'](_0x12eb9e['shift']());}};_0x480c7d(++_0x163858);}(_0xf8ff,0x127));var _0xff8f=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xf8ff[_0x102e37];return _0x35a07c;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0xff8f('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xff8f('0x1'),_0xff8f('0x2')]},'log':_0xff8f('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 94af2f9..47e8971 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 _0x5fcc=['Request','name','html','../client','getTemplates'];(function(_0x362e9d,_0x5a151b){var _0x4717d5=function(_0x5ba5a2){while(--_0x5ba5a2){_0x362e9d['push'](_0x362e9d['shift']());}};_0x4717d5(++_0x5a151b);}(_0x5fcc,0x161));var _0xc5fc=function(_0x1c28b3,_0xa4f19c){_0x1c28b3=_0x1c28b3-0x0;var _0x5cfe46=_0x5fcc[_0x1c28b3];return _0x5cfe46;};'use strict';var client=require(_0xc5fc('0x0'));exports[_0xc5fc('0x1')]=function(_0x14a2be){return function(_0x23e3f){return client[_0xc5fc('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xc5fc('0x3'),_0xc5fc('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x307f=['getTemplates','GetTemplate','html','../client'];(function(_0xc0d9bc,_0x2bd6be){var _0x32ff73=function(_0x28c592){while(--_0x28c592){_0xc0d9bc['push'](_0xc0d9bc['shift']());}};_0x32ff73(++_0x2bd6be);}(_0x307f,0x1af));var _0xf307=function(_0x2d22ea,_0x376287){_0x2d22ea=_0x2d22ea-0x0;var _0xbc87bd=_0x307f[_0x2d22ea];return _0xbc87bd;};'use strict';var client=require(_0xf307('0x0'));exports[_0xf307('0x1')]=function(_0x42d7ac){return function(_0x303b9d){return client['Request'](_0xf307('0x2'),{'options':{'raw':!![],'attributes':['id','name',_0xf307('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index adaa7ea..4da538b 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 _0x555f=['value','AnyConditions','field','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','operator'];(function(_0x268461,_0x28b843){var _0x348dae=function(_0x5f527b){while(--_0x5f527b){_0x268461['push'](_0x268461['shift']());}};_0x348dae(++_0x28b843);}(_0x555f,0x1ba));var _0xf555=function(_0x13a5a8,_0x186495){_0x13a5a8=_0x13a5a8-0x0;var _0x397582=_0x555f[_0x13a5a8];return _0x397582;};'use strict';var client=require(_0xf555('0x0'));exports[_0xf555('0x1')]=function(_0x5c956d){return function(_0x131b08){return client['Request'](_0xf555('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf555('0x3'),_0xf555('0x4')],'include':[{'model':_0xf555('0x5'),'as':_0xf555('0x6'),'attributes':['id','field',_0xf555('0x7'),_0xf555('0x8')]},{'model':_0xf555('0x5'),'as':_0xf555('0x9'),'attributes':['id',_0xf555('0xa'),_0xf555('0x7'),_0xf555('0x8')]},{'model':'Action','as':'Actions','attributes':['id','action',_0xf555('0xb'),_0xf555('0xc'),_0xf555('0xd'),_0xf555('0xe'),_0xf555('0xf'),_0xf555('0x10'),_0xf555('0x11')]}]},'log':_0xf555('0x2')});};}; \ No newline at end of file +var _0x0df9=['status','Condition','AllConditions','AnyConditions','field','operator','value','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','GetTrigger','name'];(function(_0x4a6b68,_0x1ae822){var _0x31b265=function(_0x3e4a0e){while(--_0x3e4a0e){_0x4a6b68['push'](_0x4a6b68['shift']());}};_0x31b265(++_0x1ae822);}(_0x0df9,0x74));var _0x90df=function(_0x1678f1,_0x5c0ab8){_0x1678f1=_0x1678f1-0x0;var _0x228a67=_0x0df9[_0x1678f1];return _0x228a67;};'use strict';var client=require(_0x90df('0x0'));exports[_0x90df('0x1')]=function(_0x1665e6){return function(_0x2865ba){return client['Request'](_0x90df('0x2'),{'options':{'raw':![],'attributes':['id',_0x90df('0x3'),'channel',_0x90df('0x4')],'include':[{'model':_0x90df('0x5'),'as':_0x90df('0x6'),'attributes':['id','field','operator','value']},{'model':_0x90df('0x5'),'as':_0x90df('0x7'),'attributes':['id',_0x90df('0x8'),_0x90df('0x9'),_0x90df('0xa')]},{'model':'Action','as':_0x90df('0xb'),'attributes':['id',_0x90df('0xc'),_0x90df('0xd'),_0x90df('0xe'),_0x90df('0xf'),_0x90df('0x10'),_0x90df('0x11'),_0x90df('0x12'),_0x90df('0x13')]}]},'log':_0x90df('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7a117d8..68bddaa 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 _0x30be=['GetTrunk','registry','defaultuser','../client','getTrunks','Request'];(function(_0x43bd62,_0x107420){var _0x22321c=function(_0x5ed92c){while(--_0x5ed92c){_0x43bd62['push'](_0x43bd62['shift']());}};_0x22321c(++_0x107420);}(_0x30be,0xe1));var _0xe30b=function(_0x4cdcdc,_0x34eac7){_0x4cdcdc=_0x4cdcdc-0x0;var _0x4704ce=_0x30be[_0x4cdcdc];return _0x4704ce;};'use strict';var client=require(_0xe30b('0x0'));exports[_0xe30b('0x1')]=function(_0x168a0f){return function(_0x59bf3d){return client[_0xe30b('0x2')](_0xe30b('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xe30b('0x4'),_0xe30b('0x5')]},'log':_0xe30b('0x3')});};}; \ No newline at end of file +var _0x093d=['registry','defaultuser','../client','getTrunks','Request','GetTrunk','name'];(function(_0x4ef395,_0x45faed){var _0x155d7d=function(_0x562ca0){while(--_0x562ca0){_0x4ef395['push'](_0x4ef395['shift']());}};_0x155d7d(++_0x45faed);}(_0x093d,0x1c9));var _0xd093=function(_0x9dd37c,_0x3e255e){_0x9dd37c=_0x9dd37c-0x0;var _0x2a522c=_0x093d[_0x9dd37c];return _0x2a522c;};'use strict';var client=require(_0xd093('0x0'));exports[_0xd093('0x1')]=function(_0x359249){return function(_0x30d894){return client[_0xd093('0x2')](_0xd093('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd093('0x4'),_0xd093('0x5'),_0xd093('0x6')]},'log':_0xd093('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index c796cd8..667883c 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f5244c6..f6e4ba9 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 _0x98b1=['update','UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport'];(function(_0x51fe86,_0x422b66){var _0x3557d4=function(_0x524a6a){while(--_0x524a6a){_0x51fe86['push'](_0x51fe86['shift']());}};_0x3557d4(++_0x422b66);}(_0x98b1,0x17e));var _0x198b=function(_0x346b9e,_0x212837){_0x346b9e=_0x346b9e-0x0;var _0x330b9f=_0x98b1[_0x346b9e];return _0x330b9f;};'use strict';var client=require('../client');exports[_0x198b('0x0')]=function(_0x394136){return client[_0x198b('0x1')](_0x198b('0x2'),{'body':_0x394136,'log':_0x198b('0x2')});};exports[_0x198b('0x3')]=function(_0x152d7d,_0x2b05fc,_0x4d14e5){return client[_0x198b('0x1')](_0x198b('0x4'),{'body':_0x152d7d,'options':{'where':{'uniqueid':_0x2b05fc,'interface':_0x4d14e5,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x91f3=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x31e444,_0x3346d4){var _0x39e47d=function(_0x188b66){while(--_0x188b66){_0x31e444['push'](_0x31e444['shift']());}};_0x39e47d(++_0x3346d4);}(_0x91f3,0x1ac));var _0x391f=function(_0x510606,_0x1597eb){_0x510606=_0x510606-0x0;var _0xf6c0ae=_0x91f3[_0x510606];return _0xf6c0ae;};'use strict';var client=require(_0x391f('0x0'));exports[_0x391f('0x1')]=function(_0x3dd784){return client[_0x391f('0x2')]('CreateVoiceAgentReport',{'body':_0x3dd784,'log':_0x391f('0x3')});};exports[_0x391f('0x4')]=function(_0x4c5cc8,_0xd699bb,_0x417bb8){return client[_0x391f('0x2')]('UpdateVoiceAgentReport',{'body':_0x4c5cc8,'options':{'where':{'uniqueid':_0xd699bb,'interface':_0x417bb8,'agentcomplete':!![]}},'log':_0x391f('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index d23e602..48bbf18 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 _0x8661=['context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','endOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','Request','calleridnum'];(function(_0x2118de,_0x29e3e4){var _0x53b5d4=function(_0x1b9b1b){while(--_0x1b9b1b){_0x2118de['push'](_0x2118de['shift']());}};_0x53b5d4(++_0x29e3e4);}(_0x8661,0x135));var _0x1866=function(_0x9b99b,_0x2add07){_0x9b99b=_0x9b99b-0x0;var _0x3247f5=_0x8661[_0x9b99b];return _0x3247f5;};'use strict';var moment=require(_0x1866('0x0'));var util=require(_0x1866('0x1'));var _=require(_0x1866('0x2'));var client=require(_0x1866('0x3'));exports['create']=function(_0x2dc537){return client[_0x1866('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x2dc537,{'source':_0x2dc537[_0x1866('0x5')],'destinationcontext':_0x2dc537[_0x1866('0x6')],'callerid':_0x2dc537[_0x1866('0x7')],'amaflags':_0x1866('0x8')}),'log':_0x1866('0x9')});};exports[_0x1866('0xa')]=function(){return function(){return client[_0x1866('0x4')](_0x1866('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf']('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x1866('0xc')](_0x1866('0xd'))[_0x1866('0xe')](_0x1866('0xf'))]}},'attributes':[_0x1866('0x10'),_0x1866('0x11'),_0x1866('0x12'),_0x1866('0x13')]},'log':_0x1866('0x14')});};}; \ No newline at end of file +var _0x16c3=['callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','create','CreateVoiceCallReport','merge','calleridnum','context'];(function(_0x4bae66,_0x1935c5){var _0x31d9ae=function(_0x5f5ad5){while(--_0x5f5ad5){_0x4bae66['push'](_0x4bae66['shift']());}};_0x31d9ae(++_0x1935c5);}(_0x16c3,0x111));var _0x316c=function(_0x8259dc,_0x50029d){_0x8259dc=_0x8259dc-0x0;var _0x113a1b=_0x16c3[_0x8259dc];return _0x113a1b;};'use strict';var moment=require(_0x316c('0x0'));var util=require(_0x316c('0x1'));var _=require('lodash');var client=require('../client');exports[_0x316c('0x2')]=function(_0x368d27){return client['Request'](_0x316c('0x3'),{'body':_[_0x316c('0x4')](_0x368d27,{'source':_0x368d27[_0x316c('0x5')],'destinationcontext':_0x368d27[_0x316c('0x6')],'callerid':_0x368d27[_0x316c('0x7')],'amaflags':_0x316c('0x8')}),'log':_0x316c('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x316c('0x9'),{'options':{'where':{'type':[_0x316c('0xa')],'createdAt':{'$between':[moment()[_0x316c('0xb')](_0x316c('0xc'))[_0x316c('0xd')](_0x316c('0xe')),moment()[_0x316c('0xf')](_0x316c('0xc'))[_0x316c('0xd')](_0x316c('0xe'))]}},'attributes':[_0x316c('0x10'),_0x316c('0x11'),_0x316c('0x12'),'billableseconds']},'log':_0x316c('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 3b43d41..f134ce2 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 _0x3839=['CreateVoiceDialReport','create','Request'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x3839,0x17e));var _0x9383=function(_0x1ae0c5,_0x6b0d85){_0x1ae0c5=_0x1ae0c5-0x0;var _0x1386c0=_0x3839[_0x1ae0c5];return _0x1386c0;};'use strict';var client=require('../client');exports[_0x9383('0x0')]=function(_0xf7e033){return client[_0x9383('0x1')]('CreateVoiceDialReport',{'body':_0xf7e033,'log':_0x9383('0x2')});}; \ No newline at end of file +var _0xadeb=['../client','create','Request','CreateVoiceDialReport'];(function(_0x538b6a,_0x5352ee){var _0x22fb3e=function(_0x59a62f){while(--_0x59a62f){_0x538b6a['push'](_0x538b6a['shift']());}};_0x22fb3e(++_0x5352ee);}(_0xadeb,0x128));var _0xbade=function(_0x4b370f,_0x49dd45){_0x4b370f=_0x4b370f-0x0;var _0x4613ea=_0xadeb[_0x4b370f];return _0x4613ea;};'use strict';var client=require(_0xbade('0x0'));exports[_0xbade('0x1')]=function(_0x5ad1e0){return client[_0xbade('0x2')](_0xbade('0x3'),{'body':_0x5ad1e0,'log':_0xbade('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f478d52..ecfa86f 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 _0x0506=['../client','getVoiceExtensions','Request'];(function(_0x15071f,_0x14c853){var _0x4cb767=function(_0x41f7ec){while(--_0x41f7ec){_0x15071f['push'](_0x15071f['shift']());}};_0x4cb767(++_0x14c853);}(_0x0506,0x1d1));var _0x6050=function(_0x5a2d5a,_0x284c47){_0x5a2d5a=_0x5a2d5a-0x0;var _0x351d54=_0x0506[_0x5a2d5a];return _0x351d54;};'use strict';var client=require(_0x6050('0x0'));exports[_0x6050('0x1')]=function(){return function(){return client[_0x6050('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xe630=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x48047b,_0xe294db){var _0x23d1c3=function(_0x37fbe7){while(--_0x37fbe7){_0x48047b['push'](_0x48047b['shift']());}};_0x23d1c3(++_0xe294db);}(_0xe630,0x149));var _0x0e63=function(_0x1bfec9,_0x2a863a){_0x1bfec9=_0x1bfec9-0x0;var _0x35cb18=_0xe630[_0x1bfec9];return _0x35cb18;};'use strict';var client=require(_0x0e63('0x0'));exports[_0x0e63('0x1')]=function(){return function(){return client['Request'](_0x0e63('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0e63('0x3'),_0x0e63('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 811747b..1457ec9 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 _0x2acc=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','active','Pause','mandatoryDispositionPause','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x1b6fbf,_0x3ee31f){var _0x1f19fb=function(_0x48894c){while(--_0x48894c){_0x1b6fbf['push'](_0x1b6fbf['shift']());}};_0x1f19fb(++_0x3ee31f);}(_0x2acc,0x199));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xc2ac('0x0'));exports[_0xc2ac('0x1')]=function(){return function(){return client[_0xc2ac('0x2')](_0xc2ac('0x3'),{'options':{'raw':![],'attributes':['id',_0xc2ac('0x4'),_0xc2ac('0x5'),_0xc2ac('0x6'),'autopause',_0xc2ac('0x7'),_0xc2ac('0x8'),_0xc2ac('0x9'),_0xc2ac('0xa'),'dialLimitChannel',_0xc2ac('0xb'),_0xc2ac('0xc'),_0xc2ac('0xd'),'dialPredictiveOptimizationPercentage',_0xc2ac('0xe'),_0xc2ac('0xf'),'dialOriginateCallerIdNumber',_0xc2ac('0x10'),_0xc2ac('0x11'),'dialQueueTimeout',_0xc2ac('0x12'),'dialCongestionMaxRetry',_0xc2ac('0x13'),'dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0xc2ac('0x14'),_0xc2ac('0x15'),_0xc2ac('0x16'),_0xc2ac('0x17'),_0xc2ac('0x18'),_0xc2ac('0x19'),'dialAMDActive',_0xc2ac('0x1a'),_0xc2ac('0x1b'),_0xc2ac('0x1c'),_0xc2ac('0x1d'),'dialAMDMinWordLength',_0xc2ac('0x1e'),_0xc2ac('0x1f'),_0xc2ac('0x20'),_0xc2ac('0x21'),_0xc2ac('0x22'),_0xc2ac('0x23'),'dialRecallInQueue',_0xc2ac('0x24'),_0xc2ac('0x25'),_0xc2ac('0x26'),_0xc2ac('0x27'),_0xc2ac('0x7'),_0xc2ac('0x28'),_0xc2ac('0x29'),_0xc2ac('0x2a'),_0xc2ac('0x2b'),'dialNoSuchNumberRetryFrequency',_0xc2ac('0x2c'),_0xc2ac('0x2d'),_0xc2ac('0x2e'),_0xc2ac('0x2f'),_0xc2ac('0x30'),_0xc2ac('0x31'),_0xc2ac('0x32'),_0xc2ac('0x33'),_0xc2ac('0x34'),'dialPredictiveIntervalMaxThreshold',_0xc2ac('0x35'),'dialPreviewAutoRecallMe',_0xc2ac('0x36')],'include':[{'model':_0xc2ac('0x37'),'as':'Trunk','attributes':['id',_0xc2ac('0x4'),'callerid',_0xc2ac('0x38')]},{'model':_0xc2ac('0x39'),'as':_0xc2ac('0x3a'),'attributes':['id',_0xc2ac('0x4')]},{'model':_0xc2ac('0x37'),'as':'TrunkBackup','attributes':['id','name',_0xc2ac('0x3b'),_0xc2ac('0x38')]},{'model':_0xc2ac('0x3c'),'as':'Interval','attributes':['id',_0xc2ac('0x4')],'include':[{'model':'Interval','as':_0xc2ac('0x3d'),'attributes':['id',_0xc2ac('0x4'),_0xc2ac('0x3e')]}]}]},'log':_0xc2ac('0x1')});};}; \ No newline at end of file +var _0x36eb=['Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','getVoiceQueues','../client'];(function(_0x4568a2,_0x3f1312){var _0x462231=function(_0x626433){while(--_0x626433){_0x4568a2['push'](_0x4568a2['shift']());}};_0x462231(++_0x3f1312);}(_0x36eb,0x187));var _0xb36e=function(_0x90289,_0x511f6b){_0x90289=_0x90289-0x0;var _0x51fccf=_0x36eb[_0x90289];return _0x51fccf;};'use strict';var client=require(_0xb36e('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xb36e('0x1')](_0xb36e('0x2'),{'options':{'raw':![],'attributes':['id',_0xb36e('0x3'),_0xb36e('0x4'),_0xb36e('0x5'),_0xb36e('0x6'),_0xb36e('0x7'),_0xb36e('0x8'),_0xb36e('0x9'),_0xb36e('0xa'),_0xb36e('0xb'),'dialLimitQueue',_0xb36e('0xc'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0xb36e('0xd'),_0xb36e('0xe'),_0xb36e('0xf'),_0xb36e('0x10'),'dialQueueOptions',_0xb36e('0x11'),'dialQueueProject',_0xb36e('0x12'),_0xb36e('0x13'),_0xb36e('0x14'),'dialBusyRetryFrequency',_0xb36e('0x15'),'dialNoAnswerRetryFrequency',_0xb36e('0x16'),'dialTimezone','dialGlobalInterval',_0xb36e('0x17'),'dialCheckDuplicateType',_0xb36e('0x18'),_0xb36e('0x19'),_0xb36e('0x1a'),'dialAMDAfterGreetingSilence',_0xb36e('0x1b'),_0xb36e('0x1c'),_0xb36e('0x1d'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout',_0xb36e('0x1e'),_0xb36e('0x1f'),_0xb36e('0x20'),_0xb36e('0x21'),_0xb36e('0x22'),_0xb36e('0x7'),_0xb36e('0x23'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xb36e('0x24'),_0xb36e('0x25'),_0xb36e('0x26'),_0xb36e('0x27'),_0xb36e('0x28'),'dialAbandonedRetryFrequency',_0xb36e('0x29'),_0xb36e('0x2a'),_0xb36e('0x2b'),'dialAgentRejectRetryFrequency',_0xb36e('0x2c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xb36e('0x2d'),_0xb36e('0x2e')],'include':[{'model':_0xb36e('0x2f'),'as':_0xb36e('0x2f'),'attributes':['id',_0xb36e('0x3'),_0xb36e('0x30'),_0xb36e('0x31')]},{'model':_0xb36e('0x32'),'as':_0xb36e('0x33'),'attributes':['id','name']},{'model':_0xb36e('0x2f'),'as':_0xb36e('0x34'),'attributes':['id',_0xb36e('0x3'),_0xb36e('0x30'),_0xb36e('0x31')]},{'model':_0xb36e('0x35'),'as':_0xb36e('0x35'),'attributes':['id',_0xb36e('0x3')],'include':[{'model':_0xb36e('0x35'),'as':'Intervals','attributes':['id',_0xb36e('0x3'),_0xb36e('0x36')]}]}]},'log':_0xb36e('0x37')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 1317cef..a792c39 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(_0x13d270,_0x422da5){var _0x1438c1=function(_0x1710d7){while(--_0x1710d7){_0x13d270['push'](_0x13d270['shift']());}};_0x1438c1(++_0x422da5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x1c0ec9,_0x3e7f1f){var _0x1e7da3=function(_0x34803d){while(--_0x34803d){_0x1c0ec9['push'](_0x1c0ec9['shift']());}};_0x1e7da3(++_0x3e7f1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 d164f20..2ef2d65 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 _0xd2d0=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x39f58a,_0x5ac003){var _0x2acaaf=function(_0xde0cd3){while(--_0xde0cd3){_0x39f58a['push'](_0x39f58a['shift']());}};_0x2acaaf(++_0x5ac003);}(_0xd2d0,0x1de));var _0x0d2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2d0[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0d2d('0x0'));exports[_0x0d2d('0x1')]=function(_0x173667){return function(){return client[_0x0d2d('0x2')](_0x0d2d('0x3'),{'options':{'where':{'VoiceQueueId':_0x173667,'paused':!![]},'raw':!![]},'log':_0x0d2d('0x1')});};}; \ No newline at end of file +var _0x2269=['../client','getVoiceQueueRtPauses'];(function(_0x2eec28,_0x192594){var _0x56da81=function(_0x4d26b2){while(--_0x4d26b2){_0x2eec28['push'](_0x2eec28['shift']());}};_0x56da81(++_0x192594);}(_0x2269,0x158));var _0x9226=function(_0x10225c,_0x472d44){_0x10225c=_0x10225c-0x0;var _0x5c1682=_0x2269[_0x10225c];return _0x5c1682;};'use strict';var client=require(_0x9226('0x0'));exports[_0x9226('0x1')]=function(_0x9724c1){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x9724c1,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0171af9..a06fed1 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(_0x337713,_0x26038a){var _0x569e22=function(_0x2fb2b8){while(--_0x2fb2b8){_0x337713['push'](_0x337713['shift']());}};_0x569e22(++_0x26038a);}(_0x7a54,0x106));var _0x47a5=function(_0x48e82c,_0x489b7a){_0x48e82c=_0x48e82c-0x0;var _0x38a102=_0x7a54[_0x48e82c];return _0x38a102;};'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(_0x2ecfa3,_0x53f8e7){var _0x1329ff=function(_0x30b0b5){while(--_0x30b0b5){_0x2ecfa3['push'](_0x2ecfa3['shift']());}};_0x1329ff(++_0x53f8e7);}(_0x7a54,0x106));var _0x47a5=function(_0x4405ea,_0x3a79b0){_0x4405ea=_0x4405ea-0x0;var _0x43bac5=_0x7a54[_0x4405ea];return _0x43bac5;};'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 821a639..283763f 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 _0xedab=['transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x362225,_0x353663){var _0x42c250=function(_0x2eb641){while(--_0x2eb641){_0x362225['push'](_0x362225['shift']());}};_0x42c250(++_0x353663);}(_0xedab,0x10c));var _0xbeda=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xedab[_0x4bb145];return _0x4db596;};'use strict';var client=require(_0xbeda('0x0'));exports[_0xbeda('0x1')]={};exports[_0xbeda('0x2')]=function(_0x284644){return client['Request'](_0xbeda('0x3'),{'body':{'result':_0x284644['result'],'transfererchannel':_0x284644[_0xbeda('0x4')],'transferercalleridnum':_0x284644[_0xbeda('0x5')],'transferercalleridname':_0x284644[_0xbeda('0x6')],'transfererconnectedlinenum':_0x284644[_0xbeda('0x7')],'transfererconnectedlinename':_0x284644['transfererconnectedlinename'],'transfereraccountcode':_0x284644[_0xbeda('0x8')],'transferercontext':_0x284644[_0xbeda('0x9')],'transfererexten':_0x284644[_0xbeda('0xa')],'transfererlinkedid':_0x284644[_0xbeda('0xb')],'transfereechannel':_0x284644[_0xbeda('0xc')],'transfereecalleridnum':_0x284644[_0xbeda('0xd')],'transfereecalleridname':_0x284644['transfereecalleridname'],'transfereeconnectedlinenum':_0x284644[_0xbeda('0xe')],'transfereeconnectedlinename':_0x284644['transfereeconnectedlinename'],'transfereeaccountcode':_0x284644[_0xbeda('0xf')],'transfereecontext':_0x284644[_0xbeda('0x10')],'transfereeexten':_0x284644[_0xbeda('0x11')],'transfereelinkedid':_0x284644[_0xbeda('0x12')],'isexternal':_0x284644['isexternal'],'context':_0x284644[_0xbeda('0x13')],'extension':_0x284644[_0xbeda('0x14')],'type':'blind'},'log':_0xbeda('0x3')});};exports[_0xbeda('0x15')]=function(_0x5644df){return client[_0xbeda('0x16')](_0xbeda('0x3'),{'body':{'result':_0x5644df[_0xbeda('0x17')],'transfererchannel':_0x5644df[_0xbeda('0x18')],'transferercalleridnum':_0x5644df[_0xbeda('0x19')],'transferercalleridname':_0x5644df[_0xbeda('0x1a')],'transfererconnectedlinenum':_0x5644df[_0xbeda('0x1b')],'transfererconnectedlinename':_0x5644df[_0xbeda('0x1c')],'transfereraccountcode':_0x5644df[_0xbeda('0x1d')],'transferercontext':_0x5644df[_0xbeda('0x1e')],'transfererexten':_0x5644df[_0xbeda('0x1f')],'transfererlinkedid':_0x5644df[_0xbeda('0x20')],'transfereechannel':_0x5644df[_0xbeda('0x21')],'transfereecalleridnum':_0x5644df[_0xbeda('0x22')],'transfereecalleridname':_0x5644df[_0xbeda('0x23')],'transfereeconnectedlinenum':_0x5644df[_0xbeda('0x24')],'transfereeconnectedlinename':_0x5644df[_0xbeda('0x25')],'transfereeaccountcode':_0x5644df[_0xbeda('0x26')],'transfereecontext':_0x5644df[_0xbeda('0x27')],'transfereeexten':_0x5644df[_0xbeda('0x28')],'transfereelinkedid':_0x5644df['transfertargetlinkedid'],'isexternal':_0x5644df[_0xbeda('0x29')],'context':_0x5644df['origtransferercontext'],'extension':_0x5644df[_0xbeda('0x2a')],'type':'attended'},'log':_0xbeda('0x3')});}; \ No newline at end of file +var _0xcb6d=['origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel'];(function(_0x5063fd,_0x56747a){var _0x1b7851=function(_0x41f7cb){while(--_0x41f7cb){_0x5063fd['push'](_0x5063fd['shift']());}};_0x1b7851(++_0x56747a);}(_0xcb6d,0x134));var _0xdcb6=function(_0x342778,_0x569680){_0x342778=_0x342778-0x0;var _0x292996=_0xcb6d[_0x342778];return _0x292996;};'use strict';var client=require('../client');exports[_0xdcb6('0x0')]={};exports[_0xdcb6('0x1')]=function(_0x164b1d){return client[_0xdcb6('0x2')](_0xdcb6('0x3'),{'body':{'result':_0x164b1d['result'],'transfererchannel':_0x164b1d['transfererchannel'],'transferercalleridnum':_0x164b1d[_0xdcb6('0x4')],'transferercalleridname':_0x164b1d[_0xdcb6('0x5')],'transfererconnectedlinenum':_0x164b1d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x164b1d[_0xdcb6('0x6')],'transfereraccountcode':_0x164b1d[_0xdcb6('0x7')],'transferercontext':_0x164b1d[_0xdcb6('0x8')],'transfererexten':_0x164b1d[_0xdcb6('0x9')],'transfererlinkedid':_0x164b1d['transfererlinkedid'],'transfereechannel':_0x164b1d[_0xdcb6('0xa')],'transfereecalleridnum':_0x164b1d['transfereecalleridnum'],'transfereecalleridname':_0x164b1d[_0xdcb6('0xb')],'transfereeconnectedlinenum':_0x164b1d['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x164b1d[_0xdcb6('0xc')],'transfereeaccountcode':_0x164b1d['transfereeaccountcode'],'transfereecontext':_0x164b1d[_0xdcb6('0xd')],'transfereeexten':_0x164b1d[_0xdcb6('0xe')],'transfereelinkedid':_0x164b1d['transfereelinkedid'],'isexternal':_0x164b1d[_0xdcb6('0xf')],'context':_0x164b1d[_0xdcb6('0x10')],'extension':_0x164b1d[_0xdcb6('0x11')],'type':_0xdcb6('0x12')},'log':'CreateVoiceTransferReport'});};exports[_0xdcb6('0x13')]=function(_0x3fa368){return client[_0xdcb6('0x2')](_0xdcb6('0x3'),{'body':{'result':_0x3fa368[_0xdcb6('0x14')],'transfererchannel':_0x3fa368[_0xdcb6('0x15')],'transferercalleridnum':_0x3fa368[_0xdcb6('0x16')],'transferercalleridname':_0x3fa368['origtransferercalleridname'],'transfererconnectedlinenum':_0x3fa368[_0xdcb6('0x17')],'transfererconnectedlinename':_0x3fa368['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3fa368['origtransfereraccountcode'],'transferercontext':_0x3fa368['secondtransferercontext'],'transfererexten':_0x3fa368['secondtransfererexten'],'transfererlinkedid':_0x3fa368[_0xdcb6('0x18')],'transfereechannel':_0x3fa368[_0xdcb6('0x19')],'transfereecalleridnum':_0x3fa368[_0xdcb6('0x1a')],'transfereecalleridname':_0x3fa368[_0xdcb6('0x1b')],'transfereeconnectedlinenum':_0x3fa368[_0xdcb6('0x1c')],'transfereeconnectedlinename':_0x3fa368[_0xdcb6('0x1d')],'transfereeaccountcode':_0x3fa368[_0xdcb6('0x1e')],'transfereecontext':_0x3fa368[_0xdcb6('0x1f')],'transfereeexten':_0x3fa368[_0xdcb6('0x20')],'transfereelinkedid':_0x3fa368['transfertargetlinkedid'],'isexternal':_0x3fa368[_0xdcb6('0xf')],'context':_0x3fa368['origtransferercontext'],'extension':_0x3fa368['origtransfererexten'],'type':'attended'},'log':_0xdcb6('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b690ca1..533a294 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 _0x8958=['push','find','omit','undefined','channels','length','voicechannel','map','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','validate','StopMixMonitor','destinationchannel','toLowerCase','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','inbound','outbound','includes','type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','values','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','../properties','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','ami\x20disconnected','join','pick','keys','reload','action','Reload','Action','then','message','catch','error','username','command','content','voiceQueues','hasOwnProperty'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x8958,0x93));var _0x8895=function(_0x334e54,_0x1860ea){_0x334e54=_0x334e54-0x0;var _0xa47169=_0x8958[_0x334e54];return _0xa47169;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x8895('0x1'));var ami=require('../ami');var VoiceQueueSummary=require(_0x8895('0x2'));exports[_0x8895('0x3')]=function(_0x26d8e3,_0x59e641,_0x22fa52){return new Promise(function(_0x2f03ad,_0x124e1e){var _0x40cec6={'QueuePause':function(_0x33013a){return new Promise(function(_0x51376b){var _0xe018b8=util[_0x8895('0x4')](_0x8895('0x5'),_0x8895('0x6'),_0x33013a[_0x8895('0x7')]);if(_0x26d8e3[_0x8895('0x8')]&&_0x26d8e3[_0x8895('0x8')][_0xe018b8]&&_0x26d8e3[_0x8895('0x8')][_0xe018b8][_0x8895('0x9')]){_0x26d8e3[_0x8895('0x8')][_0xe018b8]['updateAcw']();}if(_0x26d8e3[_0x8895('0xa')][_0xe018b8]){_0x26d8e3[_0x8895('0xa')][_0xe018b8][_0x8895('0xb')]({'statePause':_0x33013a[_0x8895('0xc')]?!![]:![]});}_0x51376b({'code':0xc8,'message':_0x8895('0xd')});});},'Reload':function(_0xaf93bc){var _0x5af0ef=this;return new Promise(function(_0x24c53d,_0x34e856){if(ami[_0x8895('0xe')]()==![]){return _0x34e856(_0x5af0ef['error'](0x1f4,[config['asterisk']['ip'],config[_0x8895('0xf')]['username'],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}_0xaf93bc=_[_0x8895('0x12')](_0xaf93bc,_[_0x8895('0x13')](properties[_0x8895('0x14')]['module']));_0xaf93bc[_0x8895('0x15')]=_0x8895('0x16');return ami[_0x8895('0x17')](_0xaf93bc)[_0x8895('0x18')](function(_0x2848b7){_0x24c53d({'code':0xc8,'message':_0x2848b7[_0x8895('0x19')]});})[_0x8895('0x1a')](function(_0x26cee0){_0x34e856(_0x5af0ef[_0x8895('0x1b')](0x1f5,_0x26cee0[_0x8895('0x19')]));});});},'Command':function(_0x24fef0){var _0x6b8a16=this;return new Promise(function(_0x2df795,_0x54e6d4){if(ami['isConnected']()==![]){return _0x54e6d4(_0x6b8a16['error'](0x1f4,[config[_0x8895('0xf')]['ip'],config[_0x8895('0xf')][_0x8895('0x1c')],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}_0x24fef0=_[_0x8895('0x12')](_0x24fef0,_0x8895('0x1d'));_0x24fef0[_0x8895('0x15')]='Command';return ami[_0x8895('0x17')](_0x24fef0)[_0x8895('0x18')](function(_0x2a403){_0x2df795({'code':0xc8,'message':_0x2a403[_0x8895('0x1e')]});})[_0x8895('0x1a')](function(_0x4d092d){_0x54e6d4(_0x6b8a16['error'](0x1f5,_0x4d092d[_0x8895('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x398382){var _0x38f7ad=[];for(var _0x24a376 in _0x26d8e3['voiceQueues']){if(_0x26d8e3[_0x8895('0x1f')][_0x8895('0x20')](_0x24a376)){var _0x187a15=_0x26d8e3['voiceQueues'][_0x24a376];var _0x4aee03=new VoiceQueueSummary(_0x187a15);_0x38f7ad[_0x8895('0x21')](_0x4aee03);}}_0x398382({'count':_0x38f7ad['length'],'rows':_0x38f7ad});});},'UpdateVoiceQueue':function(_0x3d51b0){return new Promise(function(_0x3e3b48,_0x10b48f){var _0xf5fb66=_[_0x8895('0x22')](_0x26d8e3['voiceQueues'],{'id':parseInt(_0x3d51b0['id'])});var _0x4d567a=_[_0x8895('0x23')](_0x3d51b0,['id']);if(_0xf5fb66){for(var _0x37ac3a in _0x4d567a){if(typeof _0x4d567a[_0x37ac3a]!==_0x8895('0x24')&&typeof _0xf5fb66[_0x37ac3a]!==_0x8895('0x24')){_0xf5fb66[_0x37ac3a]=_0x4d567a[_0x37ac3a];}}_0x3e3b48(_0xf5fb66);}else{_0x10b48f();}});},'VoiceChannels':function(){return new Promise(function(_0x19b6dd){var _0x560b93=_['values'](_0x26d8e3[_0x8895('0x25')]);_0x19b6dd({'count':_0x560b93[_0x8895('0x26')],'rows':_0x560b93});});},'VoiceChannelMixMonitor':function(_0x1c16f6){var _0x29f565=this;return new Promise(function(_0x1eabb6,_0x52f2ac){if(ami[_0x8895('0xe')]()==![]){return _0x52f2ac(_0x29f565['error'](0x1f4,[config[_0x8895('0xf')]['ip'],config['asterisk'][_0x8895('0x1c')],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}var _0x3e71fa=schema(properties[_0x8895('0x27')])['validate'](_0x1c16f6);if(_0x3e71fa[_0x8895('0x26')]>0x0){return _0x52f2ac(_0x29f565[_0x8895('0x1b')](0x1f4,_[_0x8895('0x28')](_0x3e71fa,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x574f0e=_[_0x8895('0x22')](_0x26d8e3['channels'],{'uniqueid':_0x1c16f6[_0x8895('0x29')]});if(_0x574f0e&&_0x574f0e['channel']){var _0x21c22b=util[_0x8895('0x4')](_0x8895('0x2a'),_0x1c16f6[_0x8895('0x2b')]||_0x1c16f6[_0x8895('0x29')],_0x1c16f6['format']||_0x8895('0x2c'));return ami['Action']({'action':_0x8895('0x2d'),'channel':_0x574f0e[_0x8895('0x2e')],'file':_0x21c22b,'options':_0x8895('0x2f')})[_0x8895('0x18')](function(_0x25fa39){var _0x16e110=_['find'](_0x574f0e[_0x8895('0x30')],{'filename':_0x8895('0x31')+_0x21c22b['toLowerCase']()});if(_[_0x8895('0x32')](_0x16e110)){_0x574f0e['monitors'][_0x8895('0x21')]({'filename':_0x8895('0x31')+_0x21c22b['toLowerCase'](),'createdAt':moment()[_0x8895('0x4')](_0x8895('0x33')),'mixmonitorid':_0x25fa39['mixmonitorid'],'status':'rec'});}else{_0x16e110[_0x8895('0x34')]=_0x25fa39[_0x8895('0x34')];_0x16e110[_0x8895('0x35')]=_0x8895('0x36');}_0x1eabb6({'code':0xc8,'message':[_0x1c16f6[_0x8895('0x29')],'MixMonitor\x20Success',_0x25fa39[_0x8895('0x34')]][_0x8895('0x11')]('\x20'),'mixmonitorid':_0x25fa39[_0x8895('0x34')]});})[_0x8895('0x1a')](function(_0x1d9e26){_0x52f2ac(_0x29f565[_0x8895('0x1b')](0x1f5,[_0x1c16f6['uniqueid'],_0x1d9e26[_0x8895('0x19')]['toLowerCase']()][_0x8895('0x11')]('\x20')));});}else{return _0x52f2ac(_0x29f565[_0x8895('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x1ca234){var _0x4e8fbc=this;return new Promise(function(_0x1e6395,_0x5e6413){if(ami['isConnected']()==![]){return _0x5e6413(_0x4e8fbc['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x8895('0x10')][_0x8895('0x11')]('\x20')));}var _0x596531=schema(properties['voicechannel'])[_0x8895('0x37')](_0x1ca234);if(_0x596531[_0x8895('0x26')]>0x0){return _0x5e6413(_0x4e8fbc['error'](0x1f4,_[_0x8895('0x28')](_0x596531,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x3b873b=_[_0x8895('0x22')](_0x26d8e3['channels'],{'uniqueid':_0x1ca234['uniqueid']});if(_0x3b873b){return Promise['resolve']()[_0x8895('0x18')](function(){if(_0x3b873b['channel']){return ami[_0x8895('0x17')]({'action':_0x8895('0x38'),'channel':_0x3b873b[_0x8895('0x2e')],'mixmonitorid':_0x1ca234[_0x8895('0x34')]})['catch'](function(){});}})[_0x8895('0x18')](function(){if(_0x3b873b[_0x8895('0x39')]){return ami[_0x8895('0x17')]({'action':_0x8895('0x38'),'channel':_0x3b873b[_0x8895('0x39')],'mixmonitorid':_0x1ca234[_0x8895('0x34')]})[_0x8895('0x1a')](function(){});}})[_0x8895('0x18')](function(){var _0x55fb78=_[_0x8895('0x22')](_0x3b873b[_0x8895('0x30')],{'mixmonitorid':_0x1ca234['mixmonitorid']});if(_0x55fb78){_0x55fb78[_0x8895('0x35')]='stop';}})['then'](function(){var _0x13546d=util[_0x8895('0x4')](_0x8895('0x2a'),_0x1ca234['filename']||_0x1ca234[_0x8895('0x29')],_0x1ca234['format']||_0x8895('0x2c'));var _0x152197=_[_0x8895('0x22')](_0x3b873b[_0x8895('0x30')],{'filename':_0x8895('0x31')+_0x13546d[_0x8895('0x3a')]()});if(_0x152197){_0x152197[_0x8895('0x35')]='stop';}})['then'](function(){_0x1e6395({'code':0xc8,'message':[_0x1ca234[_0x8895('0x29')],_0x8895('0x3b')]['join']('\x20')});})[_0x8895('0x1a')](function(_0x580a07){_0x5e6413(_0x4e8fbc['error'](0x1f5,[_0x1ca234[_0x8895('0x29')],_0x580a07['message'][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')));});}else{return _0x5e6413(_0x4e8fbc[_0x8895('0x1b')](0x1f5,_0x8895('0x3c')));}});},'VoiceQueuesChannels':function(_0x2714d3){var _0x39a1d9=this;return new Promise(function(_0x306481){var _0x38d6ae=_['values'](_0x26d8e3[_0x8895('0x3d')]);var _0x3e25e7={'count':_0x38d6ae[_0x8895('0x26')],'rows':_0x38d6ae};if(_0x2714d3&&_0x2714d3['type']){if(![_0x8895('0x3e'),_0x8895('0x3f')][_0x8895('0x40')](_0x2714d3[_0x8895('0x41')])){return _0x124e1e(_0x39a1d9[_0x8895('0x1b')](0x190,_0x8895('0x42')));}var _0x434ab8=_[_0x8895('0x43')](_0x38d6ae,function(_0x13488f){return _0x13488f[_0x8895('0x41')]===_0x2714d3['type'];});_0x3e25e7[_0x8895('0x44')]=_0x434ab8[_0x8895('0x26')];_0x3e25e7[_0x8895('0x45')]=_0x434ab8;}_0x306481(_0x3e25e7);});},'VoiceQueuesChannel':function(_0x10560a){var _0x3c8a97=this;return new Promise(function(_0x4dfa4b,_0x1b3c99){var _0x38c88f=schema(properties[_0x8895('0x46')])[_0x8895('0x37')](_0x10560a);if(_0x38c88f[_0x8895('0x26')]>0x0){return _0x1b3c99(_0x3c8a97['error'](0x1f4,_[_0x8895('0x28')](_0x38c88f,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x59e725=_[_0x8895('0x22')](_0x26d8e3[_0x8895('0x3d')],{'uniqueid':_0x10560a[_0x8895('0x29')]});if(_0x59e725){_0x4dfa4b(_0x59e725);}else{return _0x1b3c99(_0x3c8a97['error'](0x1f5,_0x8895('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x207548){var _0x564284=this;return new Promise(function(_0x2b6ceb,_0x26f68c){if(ami['isConnected']()==![]){return _0x26f68c(_0x564284[_0x8895('0x1b')](0x1f4,[config[_0x8895('0xf')]['ip'],config[_0x8895('0xf')][_0x8895('0x1c')],'ami\x20disconnected']['join']('\x20')));}var _0x4f8902=schema(properties[_0x8895('0x47')])[_0x8895('0x37')](_0x207548);if(_0x4f8902['length']>0x0){return _0x26f68c(_0x564284[_0x8895('0x1b')](0x1f4,_[_0x8895('0x28')](_0x4f8902,'message')[_0x8895('0x11')](',\x20')));}var _0x4ef5b9=_[_0x8895('0x22')](_0x26d8e3[_0x8895('0x3d')],{'uniqueid':_0x207548[_0x8895('0x29')]});if(_0x4ef5b9&&_0x4ef5b9[_0x8895('0x2e')]){return ami[_0x8895('0x17')]({'action':'Hangup','channel':_0x4ef5b9['channel']})[_0x8895('0x18')](function(_0x216abb){_0x2b6ceb({'code':0xc8,'message':[_0x207548['uniqueid'],_0x216abb[_0x8895('0x19')][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')});})[_0x8895('0x1a')](function(_0x4e4e57){_0x26f68c(_0x564284[_0x8895('0x1b')](0x1f5,[_0x207548[_0x8895('0x29')],_0x4e4e57[_0x8895('0x19')][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')));});}else{return _0x26f68c(_0x564284[_0x8895('0x1b')](0x1f5,_0x8895('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x129af3){var _0x2bffd7=this;return new Promise(function(_0x21c7bb,_0xb903d8){if(ami[_0x8895('0xe')]()==![]){return _0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f4,[config[_0x8895('0xf')]['ip'],config[_0x8895('0xf')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x13b143=schema(properties[_0x8895('0x48')])[_0x8895('0x37')](_0x129af3);if(_0x13b143[_0x8895('0x26')]>0x0){return _0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f4,_['map'](_0x13b143,_0x8895('0x19'))[_0x8895('0x11')](',\x20')));}var _0x59a910=_[_0x8895('0x22')](_0x26d8e3[_0x8895('0x3d')],{'uniqueid':_0x129af3[_0x8895('0x29')]});if(_0x59a910&&_0x59a910[_0x8895('0x2e')]){return ami[_0x8895('0x17')]({'action':'Redirect','channel':_0x59a910[_0x8895('0x2e')],'exten':_0x129af3[_0x8895('0x49')],'context':_0x129af3[_0x8895('0x4a')]||_0x59a910[_0x8895('0x4a')],'priority':0x1})[_0x8895('0x18')](function(_0x7a312c){_0x21c7bb({'code':0xc8,'message':[_0x129af3[_0x8895('0x29')],_0x7a312c['message'][_0x8895('0x3a')]()][_0x8895('0x11')]('\x20')});})['catch'](function(_0x1ffefd){_0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f5,[_0x129af3[_0x8895('0x29')],_0x1ffefd[_0x8895('0x19')][_0x8895('0x3a')]()]['join']('\x20')));});}else{return _0xb903d8(_0x2bffd7[_0x8895('0x1b')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0xe6bef9){return new Promise(function(_0x2440cb){var _0x5d2fb0=_[_0x8895('0x4b')](_0x26d8e3[_0x8895('0xa')]);if(_0xe6bef9&&_0xe6bef9['id']){var _0x140b2a=_[_0x8895('0x22')](_0x5d2fb0,function(_0x57e429){return _0x57e429['id']===_0xe6bef9['id'];});_0x2440cb(_0x140b2a);}else{_0x2440cb({'count':_0x5d2fb0[_0x8895('0x26')],'rows':_0x5d2fb0});}});},'Telephones':function(){return new Promise(function(_0x495a99){var _0x48f11a=_[_0x8895('0x4b')](_0x26d8e3[_0x8895('0x4c')]);_0x495a99({'count':_0x48f11a[_0x8895('0x26')],'rows':_0x48f11a});});},'Trunks':function(){return new Promise(function(_0x561f93){var _0x23c936=_['values'](_0x26d8e3[_0x8895('0x4d')]);_0x561f93({'count':_0x23c936[_0x8895('0x26')],'rows':_0x23c936});});},'OutboundChannels':function(){return new Promise(function(_0x3893fb){var _0x42d342=_[_0x8895('0x4b')](_0x26d8e3['outboundChannels']);_0x3893fb({'count':_0x42d342['length'],'rows':_0x42d342});});},'Outbound':function(){return new Promise(function(_0x270fef){_0x270fef(_0x26d8e3['outbound']);});},'Campaigns':function(){return new Promise(function(_0x3707a6){var _0x2b5fb2=_['values'](_0x26d8e3[_0x8895('0x4e')]);_0x3707a6({'count':_0x2b5fb2[_0x8895('0x26')],'rows':_0x2b5fb2});});},'VoiceQueuesPreview':function(_0x3ace6f){var _0xc4c8dc=this;return new Promise(function(_0x166e9a,_0x4f80a3){_0x59e641[_0x8895('0x4f')](_0x3ace6f['id'])['then'](function(_0x4e1733){_0x166e9a({'code':0xc8,'message':_0x4e1733[_0x8895('0x19')]});})['catch'](function(_0x39a9f7){_0x4f80a3(_0xc4c8dc[_0x8895('0x1b')](0x1f4,_0x39a9f7[_0x8895('0x19')]));});});},'EventManager':function(_0x39f5e5){var _0x53591d=this;return new Promise(function(_0x4d802e,_0x571731){if(!_0x39f5e5[_0x8895('0x50')]){return _0x571731(_0x53591d[_0x8895('0x1b')](0x1f4,_0x8895('0x51')));}ami[_0x8895('0x52')](_0x8895('0x53')+_0x39f5e5[_0x8895('0x50')],_0x39f5e5['message']);_0x4d802e({'code':0xc8,'message':_0x39f5e5});});},'FaxAccounts':function(){return new Promise(function(_0xeed6da){var _0x102b48=_[_0x8895('0x4b')](_0x26d8e3['faxAccounts']);_0xeed6da({'count':_0x102b48[_0x8895('0x26')],'rows':_0x102b48});});},'SendFax':function(_0x565bb8){var _0x10f104=this;return new Promise(function(_0x4bfd9b,_0x291bec){_0x22fa52[_0x8895('0x54')](_0x565bb8)['then'](function(_0x3fd5f0){_0x4bfd9b({'code':0xc8,'message':_0x3fd5f0[_0x8895('0x19')]});})['catch'](function(_0x2c12e3){_0x291bec(_0x10f104[_0x8895('0x1b')](0x1f4,_0x2c12e3[_0x8895('0x19')]));});});},'CheckAfterSend':function(_0xef59db){var _0x214730=this;return new Promise(function(_0x17c993,_0x18413b){_0x22fa52['checkAfterSend'](_0xef59db)[_0x8895('0x18')](function(_0x5ada19){_0x17c993({'code':0xc8,'message':_0x5ada19[_0x8895('0x19')]});})[_0x8895('0x1a')](function(_0x32d52c){_0x18413b(_0x214730[_0x8895('0x1b')](0x1f4,_0x32d52c['message']));});});}};var _0x3be1e4=jayson[_0x8895('0x55')](_0x40cec6)[_0x8895('0x56')]();_0x3be1e4['on'](_0x8895('0x1b'),function(_0x2d803b){return _0x124e1e(_0x2d803b);});_0x3be1e4[_0x8895('0x3')](0x232a,_0x8895('0x57'),function(){console[_0x8895('0x58')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x2f03ad(_0x8895('0x59')+0x232a);});});}; \ No newline at end of file +var _0xdbf5=['outbound','includes','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','exten','context','agents','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','%s/%s','SIP','name','timers','updateAcw','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','pick','keys','reload','module','action','then','message','catch','isConnected','error','command','Command','Action','content','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','username','voicechannel','validate','map','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','stop','StopMixMonitor\x20Success','queueChannels','type','inbound'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2c2052,_0x3da4f6){_0x2c2052=_0x2c2052-0x0;var _0x13474d=_0xdbf5[_0x2c2052];return _0x13474d;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x5dbf('0x1'));var config=require(_0x5dbf('0x2'));var properties=require(_0x5dbf('0x3'));var ami=require(_0x5dbf('0x4'));var VoiceQueueSummary=require(_0x5dbf('0x5'));exports[_0x5dbf('0x6')]=function(_0x776036,_0x1decd2,_0x3f8628){return new Promise(function(_0x3f8222,_0x209b7d){var _0x88128e={'QueuePause':function(_0x93e657){return new Promise(function(_0x52b039){var _0x134810=util['format'](_0x5dbf('0x7'),_0x5dbf('0x8'),_0x93e657[_0x5dbf('0x9')]);if(_0x776036[_0x5dbf('0xa')]&&_0x776036['timers'][_0x134810]&&_0x776036[_0x5dbf('0xa')][_0x134810]['timer']){_0x776036['timers'][_0x134810][_0x5dbf('0xb')]();}if(_0x776036['agents'][_0x134810]){_0x776036['agents'][_0x134810][_0x5dbf('0xc')]({'statePause':_0x93e657['pause']?!![]:![]});}_0x52b039({'code':0xc8,'message':_0x5dbf('0xd')});});},'Reload':function(_0x2bb7ed){var _0x1453a9=this;return new Promise(function(_0x7cb848,_0x14493a){if(ami['isConnected']()==![]){return _0x14493a(_0x1453a9['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}_0x2bb7ed=_[_0x5dbf('0x11')](_0x2bb7ed,_[_0x5dbf('0x12')](properties[_0x5dbf('0x13')][_0x5dbf('0x14')]));_0x2bb7ed[_0x5dbf('0x15')]='Reload';return ami['Action'](_0x2bb7ed)[_0x5dbf('0x16')](function(_0xc4cb1c){_0x7cb848({'code':0xc8,'message':_0xc4cb1c[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x20c2b0){_0x14493a(_0x1453a9['error'](0x1f5,_0x20c2b0[_0x5dbf('0x17')]));});});},'Command':function(_0x4dd03c){var _0x565efa=this;return new Promise(function(_0x577ca2,_0x23d1e7){if(ami[_0x5dbf('0x19')]()==![]){return _0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')]['join']('\x20')));}_0x4dd03c=_[_0x5dbf('0x11')](_0x4dd03c,_0x5dbf('0x1b'));_0x4dd03c[_0x5dbf('0x15')]=_0x5dbf('0x1c');return ami[_0x5dbf('0x1d')](_0x4dd03c)[_0x5dbf('0x16')](function(_0x58085e){_0x577ca2({'code':0xc8,'message':_0x58085e[_0x5dbf('0x1e')]});})[_0x5dbf('0x18')](function(_0x2d3e1b){_0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f5,_0x2d3e1b[_0x5dbf('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x226b93){var _0x290456=[];for(var _0x20ab1b in _0x776036[_0x5dbf('0x1f')]){if(_0x776036[_0x5dbf('0x1f')][_0x5dbf('0x20')](_0x20ab1b)){var _0x232c77=_0x776036[_0x5dbf('0x1f')][_0x20ab1b];var _0x407741=new VoiceQueueSummary(_0x232c77);_0x290456[_0x5dbf('0x21')](_0x407741);}}_0x226b93({'count':_0x290456[_0x5dbf('0x22')],'rows':_0x290456});});},'UpdateVoiceQueue':function(_0x466985){return new Promise(function(_0x3f8341,_0x159e61){var _0x22ec42=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x1f')],{'id':parseInt(_0x466985['id'])});var _0x21cd00=_['omit'](_0x466985,['id']);if(_0x22ec42){for(var _0x2f71eb in _0x21cd00){if(typeof _0x21cd00[_0x2f71eb]!==_0x5dbf('0x24')&&typeof _0x22ec42[_0x2f71eb]!==_0x5dbf('0x24')){_0x22ec42[_0x2f71eb]=_0x21cd00[_0x2f71eb];}}_0x3f8341(_0x22ec42);}else{_0x159e61();}});},'VoiceChannels':function(){return new Promise(function(_0x1fb9a7){var _0x38825a=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x26')]);_0x1fb9a7({'count':_0x38825a[_0x5dbf('0x22')],'rows':_0x38825a});});},'VoiceChannelMixMonitor':function(_0x406ce6){var _0x273b63=this;return new Promise(function(_0x294dd7,_0x50a307){if(ami['isConnected']()==![]){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')]['join']('\x20')));}var _0x5cc3f1=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x406ce6);if(_0x5cc3f1['length']>0x0){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5cc3f1,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x27e058=_['find'](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x406ce6[_0x5dbf('0x2b')]});if(_0x27e058&&_0x27e058[_0x5dbf('0x2c')]){var _0x273577=util[_0x5dbf('0x2d')]('%s.%s',_0x406ce6[_0x5dbf('0x2e')]||_0x406ce6[_0x5dbf('0x2b')],_0x406ce6[_0x5dbf('0x2d')]||_0x5dbf('0x2f'));return ami['Action']({'action':_0x5dbf('0x30'),'channel':_0x27e058[_0x5dbf('0x2c')],'file':_0x273577,'options':_0x5dbf('0x31')})[_0x5dbf('0x16')](function(_0x3e309a){var _0x843d9a=_[_0x5dbf('0x23')](_0x27e058[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')]()});if(_[_0x5dbf('0x35')](_0x843d9a)){_0x27e058['monitors'][_0x5dbf('0x21')]({'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')](),'createdAt':moment()['format'](_0x5dbf('0x36')),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')],'status':_0x5dbf('0x38')});}else{_0x843d9a['mixmonitorid']=_0x3e309a[_0x5dbf('0x37')];_0x843d9a[_0x5dbf('0x39')]=_0x5dbf('0x38');}_0x294dd7({'code':0xc8,'message':[_0x406ce6['uniqueid'],_0x5dbf('0x3a'),_0x3e309a[_0x5dbf('0x37')]][_0x5dbf('0x10')]('\x20'),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')]});})[_0x5dbf('0x18')](function(_0x6ebcc6){_0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f5,[_0x406ce6[_0x5dbf('0x2b')],_0x6ebcc6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x50a307(_0x273b63['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x21122d){var _0x54e5e7=this;return new Promise(function(_0x3ef0eb,_0x229abf){if(ami['isConnected']()==![]){return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2745df=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x21122d);if(_0x2745df[_0x5dbf('0x22')]>0x0){return _0x229abf(_0x54e5e7['error'](0x1f4,_[_0x5dbf('0x2a')](_0x2745df,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x50880d=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x21122d[_0x5dbf('0x2b')]});if(_0x50880d){return Promise[_0x5dbf('0x3c')]()['then'](function(){if(_0x50880d[_0x5dbf('0x2c')]){return ami['Action']({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x2c')],'mixmonitorid':_0x21122d[_0x5dbf('0x37')]})[_0x5dbf('0x18')](function(){});}})['then'](function(){if(_0x50880d['destinationchannel']){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x3e')],'mixmonitorid':_0x21122d['mixmonitorid']})[_0x5dbf('0x18')](function(){});}})['then'](function(){var _0x4d8df1=_['find'](_0x50880d['monitors'],{'mixmonitorid':_0x21122d[_0x5dbf('0x37')]});if(_0x4d8df1){_0x4d8df1[_0x5dbf('0x39')]='stop';}})[_0x5dbf('0x16')](function(){var _0x3ba5cb=util['format'](_0x5dbf('0x3f'),_0x21122d[_0x5dbf('0x2e')]||_0x21122d['uniqueid'],_0x21122d[_0x5dbf('0x2d')]||'wav');var _0x5ab862=_[_0x5dbf('0x23')](_0x50880d[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x3ba5cb['toLowerCase']()});if(_0x5ab862){_0x5ab862['status']=_0x5dbf('0x40');}})[_0x5dbf('0x16')](function(){_0x3ef0eb({'code':0xc8,'message':[_0x21122d[_0x5dbf('0x2b')],_0x5dbf('0x41')][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x3b49c6){_0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,[_0x21122d['uniqueid'],_0x3b49c6[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannels':function(_0x3cc286){var _0x328dc5=this;return new Promise(function(_0x59f825){var _0x1b0b13=_['values'](_0x776036[_0x5dbf('0x42')]);var _0x1a5d82={'count':_0x1b0b13[_0x5dbf('0x22')],'rows':_0x1b0b13};if(_0x3cc286&&_0x3cc286[_0x5dbf('0x43')]){if(![_0x5dbf('0x44'),_0x5dbf('0x45')][_0x5dbf('0x46')](_0x3cc286['type'])){return _0x209b7d(_0x328dc5['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x1e1876=_[_0x5dbf('0x47')](_0x1b0b13,function(_0x36a787){return _0x36a787['type']===_0x3cc286['type'];});_0x1a5d82[_0x5dbf('0x48')]=_0x1e1876[_0x5dbf('0x22')];_0x1a5d82[_0x5dbf('0x49')]=_0x1e1876;}_0x59f825(_0x1a5d82);});},'VoiceQueuesChannel':function(_0x5d70cc){var _0x2c9876=this;return new Promise(function(_0x56633d,_0x3ce224){var _0x37f16f=schema(properties[_0x5dbf('0x4a')])['validate'](_0x5d70cc);if(_0x37f16f['length']>0x0){return _0x3ce224(_0x2c9876[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x37f16f,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x4c034f=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5d70cc['uniqueid']});if(_0x4c034f){_0x56633d(_0x4c034f);}else{return _0x3ce224(_0x2c9876['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x14bdb1){var _0x197e8c=this;return new Promise(function(_0x20ee69,_0x3e13cb){if(ami[_0x5dbf('0x19')]()==![]){return _0x3e13cb(_0x197e8c['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x5dbf('0x10')]('\x20')));}var _0x5f2005=schema(properties[_0x5dbf('0x4b')])[_0x5dbf('0x29')](_0x14bdb1);if(_0x5f2005[_0x5dbf('0x22')]>0x0){return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5f2005,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x100d83=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x14bdb1[_0x5dbf('0x2b')]});if(_0x100d83&&_0x100d83[_0x5dbf('0x2c')]){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x4c'),'channel':_0x100d83[_0x5dbf('0x2c')]})['then'](function(_0x3fbc3d){_0x20ee69({'code':0xc8,'message':[_0x14bdb1['uniqueid'],_0x3fbc3d[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5a975a){_0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,[_0x14bdb1[_0x5dbf('0x2b')],_0x5a975a[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5ccda4){var _0x3e5a96=this;return new Promise(function(_0x3b0465,_0x18bc53){if(ami[_0x5dbf('0x19')]()==![]){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2997a8=schema(properties['voicequeuechannelredirect'])['validate'](_0x5ccda4);if(_0x2997a8[_0x5dbf('0x22')]>0x0){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x2997a8,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x377d52=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5ccda4[_0x5dbf('0x2b')]});if(_0x377d52&&_0x377d52['channel']){return ami['Action']({'action':'Redirect','channel':_0x377d52['channel'],'exten':_0x5ccda4[_0x5dbf('0x4d')],'context':_0x5ccda4[_0x5dbf('0x4e')]||_0x377d52[_0x5dbf('0x4e')],'priority':0x1})[_0x5dbf('0x16')](function(_0x29c4d9){_0x3b0465({'code':0xc8,'message':[_0x5ccda4[_0x5dbf('0x2b')],_0x29c4d9['message']['toLowerCase']()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5e84ab){_0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,[_0x5ccda4[_0x5dbf('0x2b')],_0x5e84ab[_0x5dbf('0x17')][_0x5dbf('0x34')]()]['join']('\x20')));});}else{return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'Agents':function(_0x131100){return new Promise(function(_0x1afaff){var _0x2aed16=_['values'](_0x776036[_0x5dbf('0x4f')]);if(_0x131100&&_0x131100['id']){var _0x3fce29=_[_0x5dbf('0x23')](_0x2aed16,function(_0x242e02){return _0x242e02['id']===_0x131100['id'];});_0x1afaff(_0x3fce29);}else{_0x1afaff({'count':_0x2aed16['length'],'rows':_0x2aed16});}});},'Telephones':function(){return new Promise(function(_0x11db7e){var _0x5b75a2=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x50')]);_0x11db7e({'count':_0x5b75a2[_0x5dbf('0x22')],'rows':_0x5b75a2});});},'Trunks':function(){return new Promise(function(_0x5f2d67){var _0x46db8d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x51')]);_0x5f2d67({'count':_0x46db8d[_0x5dbf('0x22')],'rows':_0x46db8d});});},'OutboundChannels':function(){return new Promise(function(_0x50db0b){var _0x1f9d2d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x52')]);_0x50db0b({'count':_0x1f9d2d[_0x5dbf('0x22')],'rows':_0x1f9d2d});});},'Outbound':function(){return new Promise(function(_0x392a9b){_0x392a9b(_0x776036[_0x5dbf('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x560d62){var _0x1efc21=_[_0x5dbf('0x25')](_0x776036['campaigns']);_0x560d62({'count':_0x1efc21[_0x5dbf('0x22')],'rows':_0x1efc21});});},'VoiceQueuesPreview':function(_0x2754bb){var _0x1a71fe=this;return new Promise(function(_0x3457de,_0x252be1){_0x1decd2[_0x5dbf('0x53')](_0x2754bb['id'])[_0x5dbf('0x16')](function(_0xdc4439){_0x3457de({'code':0xc8,'message':_0xdc4439[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x1fa250){_0x252be1(_0x1a71fe[_0x5dbf('0x1a')](0x1f4,_0x1fa250[_0x5dbf('0x17')]));});});},'EventManager':function(_0x248c1d){var _0x19f5ab=this;return new Promise(function(_0x37c1a3,_0x542667){if(!_0x248c1d[_0x5dbf('0x54')]){return _0x542667(_0x19f5ab[_0x5dbf('0x1a')](0x1f4,_0x5dbf('0x55')));}ami[_0x5dbf('0x56')]('custom:'+_0x248c1d[_0x5dbf('0x54')],_0x248c1d[_0x5dbf('0x17')]);_0x37c1a3({'code':0xc8,'message':_0x248c1d});});},'FaxAccounts':function(){return new Promise(function(_0x29a71a){var _0x42df4d=_[_0x5dbf('0x25')](_0x776036['faxAccounts']);_0x29a71a({'count':_0x42df4d[_0x5dbf('0x22')],'rows':_0x42df4d});});},'SendFax':function(_0x1ba14c){var _0x4e0117=this;return new Promise(function(_0x5d02f7,_0x3dac55){_0x3f8628[_0x5dbf('0x57')](_0x1ba14c)[_0x5dbf('0x16')](function(_0x8ca7de){_0x5d02f7({'code':0xc8,'message':_0x8ca7de[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x22339b){_0x3dac55(_0x4e0117['error'](0x1f4,_0x22339b[_0x5dbf('0x17')]));});});},'CheckAfterSend':function(_0x3b01c0){var _0x25c831=this;return new Promise(function(_0x1dd5b4,_0x39e600){_0x3f8628[_0x5dbf('0x58')](_0x3b01c0)['then'](function(_0x625875){_0x1dd5b4({'code':0xc8,'message':_0x625875[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x2c5a6e){_0x39e600(_0x25c831[_0x5dbf('0x1a')](0x1f4,_0x2c5a6e['message']));});});}};var _0x2ef784=jayson['server'](_0x88128e)['http']();_0x2ef784['on']('error',function(_0x496306){return _0x209b7d(_0x496306);});_0x2ef784[_0x5dbf('0x6')](0x232a,_0x5dbf('0x59'),function(){console[_0x5dbf('0x5a')](_0x5dbf('0x5b'),0x232a);return _0x3f8222(_0x5dbf('0x5c')+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 031d763..d1975e4 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 _0x327b=['firstName','phone','mobile','fax','createdAt','scheduledAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','name','trigger:%s','action','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','split','$or','destcalleridnum','calleridnum','routeId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x327b,0xfb));var _0xb327=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x327b[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xb327('0x0'));var BPromise=require(_0xb327('0x1'));var Redis=require(_0xb327('0x2'));var util=require('util');var config=require(_0xb327('0x3'));var logger=require(_0xb327('0x4'))(_0xb327('0x5'));var cmContactRpc=require(_0xb327('0x6'));config[_0xb327('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb327('0x7')]));function emit(_0x4e8ee2,_0x3c308a,_0x10f1da,_0x43756e,_0x110668){logger[_0xb327('0x8')](_0xb327('0x9'),_0x4e8ee2,_0x3c308a['id'],_0x10f1da,_0x43756e,JSON[_0xb327('0xa')](_0x110668));io['to'](_0x10f1da)[_0xb327('0xb')](_0x43756e,_0x110668);}exports[_0xb327('0xc')]=function(_0x243c70,_0x306191,_0xc27a2b,_0x5f0808){var _0x1f6192,_0x20636f;var _0x9c05e3={};var _0x345246;var _0x695071=Number(_0xc27a2b[_0xb327('0xd')]);var _0x10635a=_0xc27a2b[_0xb327('0xe')]?Boolean(Number(_0xc27a2b[_0xb327('0xe')])):![];var _0x4ac5e1;var _0x20bbea=![];if(!_['isNil'](_0xc27a2b[_0xb327('0xf')])){if(_0xc27a2b[_0xb327('0xf')]=='1')_0x20bbea=!![];}if(!_0x20bbea){if(_0x5f0808[_0xb327('0x10')]){_0x9c05e3['id']=_0x5f0808['xmd-contactid'];}}if(!_0x9c05e3['id']){_0x9c05e3[_0xb327('0x11')]=_0x695071;_0x4ac5e1=_0xc27a2b['data3']&&_0xc27a2b[_0xb327('0x12')]!=='0'?_0xc27a2b['data3'][_0xb327('0x13')](','):['phone'];_0x9c05e3[_0xb327('0x14')]=_['map'](_0x4ac5e1,function(_0x5c6adb){var _0x270419={};_0x270419[_0x5c6adb]=_0x5f0808['routeId']?_0x5f0808[_0xb327('0x15')]:_0x5f0808[_0xb327('0x16')];return _0x270419;});_0x345246=_0x5f0808[_0xb327('0x17')]?_0x5f0808[_0xb327('0x15')]:_0x5f0808[_0xb327('0x16')];}var _0x3b1bab=['id',_0xb327('0x18'),'lastName',_0xb327('0x19'),_0xb327('0x1a'),_0xb327('0x1b'),'ListId',_0xb327('0x1c'),_0xb327('0x1d'),'updatedAt'];var _0x1a587a=_[_0xb327('0x1e')](_0x3b1bab,_0x4ac5e1);BPromise[_0xb327('0x1f')]()[_0xb327('0x20')](cmContactRpc[_0xb327('0x21')]({'attributes':_0x1a587a,'where':_0x9c05e3,'phone':_0x345246}))[_0xb327('0x20')](function(_0x3bd4fa){_0x20636f=_0x3bd4fa;if(!_[_0xb327('0x22')](_0x20636f)){if(_0x20636f[_0xb327('0x23')]===0x1){_0x1f6192=_0x20636f[0x0];logger[_0xb327('0x8')](_0xb327('0x24'),_0x5f0808[_0xb327('0x25')],_0x306191['id'],_0x1f6192['id']);}else{logger[_0xb327('0x8')](_0xb327('0x26'),_0x5f0808[_0xb327('0x25')],_0x306191['id'],_['map'](_0x20636f,'id')['join'](','));}return;}else{logger['info'](_0xb327('0x27'),_0x5f0808[_0xb327('0x25')],_0x306191['id']);var _0x241a6a={'ListId':_0x695071};var _0x4cbc17=_0xc27a2b[_0xb327('0x28')]&&_0xc27a2b[_0xb327('0x28')]!=='0'?_0xc27a2b[_0xb327('0x28')]:'phone';if(_0x10635a){logger[_0xb327('0x8')](_0xb327('0x29'),_0x5f0808[_0xb327('0x25')],_0x306191['id']);_0x241a6a[_0x4cbc17]=_[_0xb327('0x2a')](_0x5f0808[_0xb327('0x17')])?_0x5f0808[_0xb327('0x16')]:_0x5f0808['destcalleridnum'];if(_[_0xb327('0x2a')](_0x5f0808[_0xb327('0x17')])){_0x241a6a['firstName']=_0x5f0808[_0xb327('0x2b')]&&_0x5f0808[_0xb327('0x2b')]!==_0xb327('0x2c')?_0x5f0808[_0xb327('0x2b')]:_0xb327('0x2d');}else{_0x241a6a[_0xb327('0x18')]=_0x5f0808[_0xb327('0x2e')]&&_0x5f0808[_0xb327('0x2e')]!==_0xb327('0x2c')?_0x5f0808[_0xb327('0x2e')]:_0xb327('0x2d');}return BPromise[_0xb327('0x1f')]()[_0xb327('0x20')](cmContactRpc[_0xb327('0x2f')](_0x241a6a))['then'](function(_0x228b4e){_0x1f6192=_0x228b4e;_0x20636f['push'](_0x228b4e);if(_0x1f6192){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x5f0808[_0xb327('0x25')],_0x306191['id'],_0x1f6192['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5f0808[_0xb327('0x25')],_0x306191['id']);_0x241a6a[_0x4cbc17]=_[_0xb327('0x2a')](_0x5f0808[_0xb327('0x17')])?_0x5f0808[_0xb327('0x16')]:_0x5f0808[_0xb327('0x15')];if(_[_0xb327('0x2a')](_0x5f0808[_0xb327('0x17')])){_0x241a6a['firstName']=_0x5f0808[_0xb327('0x2b')]&&_0x5f0808[_0xb327('0x2b')]!==''?_0x5f0808[_0xb327('0x2b')]:_0xb327('0x2d');}else{_0x241a6a[_0xb327('0x18')]=_0x5f0808[_0xb327('0x2e')]&&_0x5f0808['destcalleridname']!==_0xb327('0x2c')?_0x5f0808[_0xb327('0x2e')]:_0xb327('0x2d');}_0x1f6192=_0x241a6a;_0x20636f[_0xb327('0x30')](_0x241a6a);return;}}})[_0xb327('0x20')](function(){if(_0x243c70){emit(_0x5f0808['uniqueid'],_0x306191,util[_0xb327('0x31')](_0xb327('0x32'),_0x243c70[_0xb327('0x33')]),util[_0xb327('0x31')](_0xb327('0x34'),_0xc27a2b[_0xb327('0x35')]['toLowerCase']()),{'evt':_[_0xb327('0x36')](_0x5f0808,{'autoCreate':_0x10635a}),'contact':_0x1f6192===undefined?{}:_0x1f6192,'contacts':_0x20636f['length']===0x0?undefined:_0x20636f});}});}; \ No newline at end of file +var _0x2d20=['uniqueid','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','routeId','destcalleridnum','calleridnum','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]'];(function(_0x117994,_0x46bbbb){var _0x40814a=function(_0x5e88ca){while(--_0x5e88ca){_0x117994['push'](_0x117994['shift']());}};_0x40814a(++_0x46bbbb);}(_0x2d20,0x1d1));var _0x02d2=function(_0x555ef8,_0x1a0f73){_0x555ef8=_0x555ef8-0x0;var _0x4878b6=_0x2d20[_0x555ef8];return _0x4878b6;};'use strict';var _=require(_0x02d2('0x0'));var BPromise=require(_0x02d2('0x1'));var Redis=require(_0x02d2('0x2'));var util=require('util');var config=require(_0x02d2('0x3'));var logger=require(_0x02d2('0x4'))(_0x02d2('0x5'));var cmContactRpc=require(_0x02d2('0x6'));config[_0x02d2('0x7')]=_[_0x02d2('0x8')](config[_0x02d2('0x7')],{'host':_0x02d2('0x9'),'port':0x18eb});var io=require(_0x02d2('0xa'))(new Redis(config[_0x02d2('0x7')]));function emit(_0x2e9660,_0x1c6af3,_0x5f30e0,_0x5368bc,_0x40c0bf){logger['info']('[CM][%s][%s]',_0x2e9660,_0x1c6af3['id'],_0x5f30e0,_0x5368bc,JSON[_0x02d2('0xb')](_0x40c0bf));io['to'](_0x5f30e0)[_0x02d2('0xc')](_0x5368bc,_0x40c0bf);}exports[_0x02d2('0xd')]=function(_0x4b5ea3,_0x287e38,_0x244a3f,_0x1cfb49){var _0x3fe9a0,_0xc6b2f4;var _0x45186a={};var _0x188cfe;var _0x28ad11=Number(_0x244a3f[_0x02d2('0xe')]);var _0x54df74=_0x244a3f[_0x02d2('0xf')]?Boolean(Number(_0x244a3f[_0x02d2('0xf')])):![];var _0x3d537b;var _0x34f9ac=![];if(!_[_0x02d2('0x10')](_0x244a3f[_0x02d2('0x11')])){if(_0x244a3f[_0x02d2('0x11')]=='1')_0x34f9ac=!![];}if(!_0x34f9ac){if(_0x1cfb49[_0x02d2('0x12')]){_0x45186a['id']=_0x1cfb49[_0x02d2('0x12')];}}if(!_0x45186a['id']){_0x45186a['ListId']=_0x28ad11;_0x3d537b=_0x244a3f[_0x02d2('0x13')]&&_0x244a3f['data3']!=='0'?_0x244a3f['data3'][_0x02d2('0x14')](','):['phone'];_0x45186a['$or']=_['map'](_0x3d537b,function(_0x30c733){var _0x1fb040={};_0x1fb040[_0x30c733]=_0x1cfb49[_0x02d2('0x15')]?_0x1cfb49[_0x02d2('0x16')]:_0x1cfb49[_0x02d2('0x17')];return _0x1fb040;});_0x188cfe=_0x1cfb49[_0x02d2('0x15')]?_0x1cfb49[_0x02d2('0x16')]:_0x1cfb49['calleridnum'];}var _0x61cc89=['id','firstName',_0x02d2('0x18'),_0x02d2('0x19'),_0x02d2('0x1a'),_0x02d2('0x1b'),'ListId',_0x02d2('0x1c'),_0x02d2('0x1d'),_0x02d2('0x1e')];var _0x59a1c1=_[_0x02d2('0x1f')](_0x61cc89,_0x3d537b);BPromise[_0x02d2('0x20')]()[_0x02d2('0x21')](cmContactRpc[_0x02d2('0x22')]({'attributes':_0x59a1c1,'where':_0x45186a,'phone':_0x188cfe}))[_0x02d2('0x21')](function(_0x3e82ba){_0xc6b2f4=_0x3e82ba;if(!_[_0x02d2('0x23')](_0xc6b2f4)){if(_0xc6b2f4[_0x02d2('0x24')]===0x1){_0x3fe9a0=_0xc6b2f4[0x0];logger[_0x02d2('0x25')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1cfb49['uniqueid'],_0x287e38['id'],_0x3fe9a0['id']);}else{logger[_0x02d2('0x25')](_0x02d2('0x26'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id'],_[_0x02d2('0x28')](_0xc6b2f4,'id')['join'](','));}return;}else{logger['info'](_0x02d2('0x29'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id']);var _0x2b7bbb={'ListId':_0x28ad11};var _0x396c38=_0x244a3f[_0x02d2('0x2a')]&&_0x244a3f['data4']!=='0'?_0x244a3f[_0x02d2('0x2a')]:_0x02d2('0x19');if(_0x54df74){logger[_0x02d2('0x25')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1cfb49[_0x02d2('0x27')],_0x287e38['id']);_0x2b7bbb[_0x396c38]=_[_0x02d2('0x10')](_0x1cfb49[_0x02d2('0x15')])?_0x1cfb49[_0x02d2('0x17')]:_0x1cfb49[_0x02d2('0x16')];if(_['isNil'](_0x1cfb49['routeId'])){_0x2b7bbb[_0x02d2('0x2b')]=_0x1cfb49[_0x02d2('0x2c')]&&_0x1cfb49[_0x02d2('0x2c')]!==''?_0x1cfb49[_0x02d2('0x2c')]:'Unknown';}else{_0x2b7bbb['firstName']=_0x1cfb49[_0x02d2('0x2d')]&&_0x1cfb49['destcalleridname']!==''?_0x1cfb49[_0x02d2('0x2d')]:'Unknown';}return BPromise[_0x02d2('0x20')]()['then'](cmContactRpc[_0x02d2('0x2e')](_0x2b7bbb))[_0x02d2('0x21')](function(_0x1d1cd2){_0x3fe9a0=_0x1d1cd2;_0xc6b2f4[_0x02d2('0x2f')](_0x1d1cd2);if(_0x3fe9a0){logger['info'](_0x02d2('0x30'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id'],_0x3fe9a0['id']);}return;});}else{logger[_0x02d2('0x25')](_0x02d2('0x31'),_0x1cfb49[_0x02d2('0x27')],_0x287e38['id']);_0x2b7bbb[_0x396c38]=_[_0x02d2('0x10')](_0x1cfb49[_0x02d2('0x15')])?_0x1cfb49[_0x02d2('0x17')]:_0x1cfb49[_0x02d2('0x16')];if(_[_0x02d2('0x10')](_0x1cfb49[_0x02d2('0x15')])){_0x2b7bbb['firstName']=_0x1cfb49[_0x02d2('0x2c')]&&_0x1cfb49[_0x02d2('0x2c')]!==''?_0x1cfb49[_0x02d2('0x2c')]:_0x02d2('0x32');}else{_0x2b7bbb['firstName']=_0x1cfb49['destcalleridname']&&_0x1cfb49['destcalleridname']!==''?_0x1cfb49[_0x02d2('0x2d')]:_0x02d2('0x32');}_0x3fe9a0=_0x2b7bbb;_0xc6b2f4[_0x02d2('0x2f')](_0x2b7bbb);return;}}})['then'](function(){if(_0x4b5ea3){emit(_0x1cfb49[_0x02d2('0x27')],_0x287e38,util[_0x02d2('0x33')](_0x02d2('0x34'),_0x4b5ea3['name']),util[_0x02d2('0x33')](_0x02d2('0x35'),_0x244a3f['action'][_0x02d2('0x36')]()),{'evt':_[_0x02d2('0x37')](_0x1cfb49,{'autoCreate':_0x54df74}),'contact':_0x3fe9a0===undefined?{}:_0x3fe9a0,'contacts':_0xc6b2f4[_0x02d2('0x24')]===0x0?undefined:_0xc6b2f4});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index fbd727b..2f9d20a 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 _0x3c6a=['custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','checkTriggers','interface','hasOwnProperty','merge','length','action','contactmanager','motionbar','browser','data1','data2','render','uri','buildUri','isNil','data3','data4','location','uriLocation','800','data5','600','data6','winApplication','format','user:%s','name','trigger:%s:%s','toLowerCase','jscripty','trigger:%s','exec','integration','routeId','urlforward','script','query','replace','checkTrigger','channel','AllConditions','every','checkConditions','AnyConditions','some','account','chat','ChatWebsiteId','value','upperFirst','AccountId','interaction','message','event','operator','queue','agent','membername','lastevent','mailSubstatus','null','undefined','substatus','created','equals','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject'];(function(_0x34e26c,_0x79c6bb){var _0x17adae=function(_0x2193b0){while(--_0x2193b0){_0x34e26c['push'](_0x34e26c['shift']());}};_0x17adae(++_0x79c6bb);}(_0x3c6a,0xd1));var _0xa3c6=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0x3c6a[_0x1dbaf7];return _0x593f05;};'use strict';var util=require('util');var _=require(_0xa3c6('0x0'));var url=require(_0xa3c6('0x1'));var Mustache=require(_0xa3c6('0x2'));var Redis=require(_0xa3c6('0x3'));var urlforward=require(_0xa3c6('0x4'));var integration=require(_0xa3c6('0x5'));var cmContact=require(_0xa3c6('0x6'));var script=require(_0xa3c6('0x7'));var config=require(_0xa3c6('0x8'));var logger=require(_0xa3c6('0x9'))(_0xa3c6('0xa'));var ami=require('../ami');config[_0xa3c6('0xb')]=_[_0xa3c6('0xc')](config[_0xa3c6('0xb')],{'host':_0xa3c6('0xd'),'port':0x18eb});var io=require(_0xa3c6('0xe'))(new Redis(config[_0xa3c6('0xb')]));var operators={'equals':function(_0x3eb474,_0x24a3e8){return _0x3eb474==_0x24a3e8;},'not_equals':function(_0x24c520,_0x12f414){return _0x24c520!=_0x12f414;}};var barAndWebActions=[_0xa3c6('0xf'),'url',_0xa3c6('0x10')];function Trigger(_0x4a4527){this[_0xa3c6('0x11')]=_0x4a4527[_0xa3c6('0x11')];this[_0xa3c6('0x12')]=_0x4a4527['agents'];this['voiceQueues']=_0x4a4527['voiceQueues'];this[_0xa3c6('0x13')]=_0x4a4527['templates'];this[_0xa3c6('0x14')]=_0x4a4527[_0xa3c6('0x14')];this[_0xa3c6('0x15')]=_0x4a4527[_0xa3c6('0x15')];this[_0xa3c6('0x16')]=_0x4a4527[_0xa3c6('0x16')];this[_0xa3c6('0x17')]=_0x4a4527['salesforceAccounts'];this[_0xa3c6('0x18')]=_0x4a4527[_0xa3c6('0x18')];this[_0xa3c6('0x19')]=_0x4a4527['zohoAccounts'];this[_0xa3c6('0x1a')]=_0x4a4527['deskAccounts'];this[_0xa3c6('0x1b')]=_0x4a4527['vtigerAccounts'];this[_0xa3c6('0x1c')]=_0x4a4527[_0xa3c6('0x1c')];this[_0xa3c6('0x1d')]=_0x4a4527[_0xa3c6('0x1d')];this[_0xa3c6('0x1e')]=_0x4a4527[_0xa3c6('0x1e')];this[_0xa3c6('0x1f')]={'zendesk':this[_0xa3c6('0x15')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xa3c6('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xa3c6('0x19')],'desk':this[_0xa3c6('0x1a')],'vtiger':this[_0xa3c6('0x1b')],'dynamics365':this[_0xa3c6('0x1d')],'freshsales':this[_0xa3c6('0x1e')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0xa3c6('0x20')]['bind'](this));ami['on'](_0xa3c6('0x21'),this['syncCustomEvent'][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x23'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x24'),this[_0xa3c6('0x20')]['bind'](this));ami['on'](_0xa3c6('0x25'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x26'),this[_0xa3c6('0x20')]['bind'](this));ami['on']('custom:agentbusy',this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa3c6('0x28'),this['syncCustomEvent'][_0xa3c6('0x22')](this));ami['on']('custom:amd',this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x29'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x2a'),this['syncCustomEvent'][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x2b'),this[_0xa3c6('0x2c')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x2d'),this[_0xa3c6('0x2c')]['bind'](this));ami['on'](_0xa3c6('0x2e'),this['syncAgentDial']['bind'](this));ami['on']('custom:newinteraction',this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x2f'),this['syncCustomEvent'][_0xa3c6('0x22')](this));ami['on']('custom:substatus',this[_0xa3c6('0x20')]['bind'](this));ami['on'](_0xa3c6('0x30'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x31'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa3c6('0x33'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));ami['on'](_0xa3c6('0x34'),this[_0xa3c6('0x20')][_0xa3c6('0x22')](this));}Trigger[_0xa3c6('0x35')][_0xa3c6('0x36')]=function(_0xd098b6,_0x2fea57,_0x451f90){logger[_0xa3c6('0x37')](_0xd098b6,_0x2fea57,JSON[_0xa3c6('0x38')](_0x451f90));io['to'](_0xd098b6)[_0xa3c6('0x36')](_0x2fea57,_0x451f90);};Trigger[_0xa3c6('0x35')][_0xa3c6('0x20')]=function(_0x27c665){var _0x4f36fa=_[_0xa3c6('0x39')](_0x27c665);if(typeof _0x4f36fa['motionChannel']==='undefined'){_0x4f36fa[_0xa3c6('0x3a')]='voice';}this[_0xa3c6('0x3b')](_0x4f36fa);};Trigger['prototype'][_0xa3c6('0x2c')]=function(_0x2a730e){if(this['agents'][_0x2a730e[_0xa3c6('0x3c')]]){this[_0xa3c6('0x20')](_0x2a730e);}};Trigger[_0xa3c6('0x35')][_0xa3c6('0x3b')]=function(_0x2174d1){var _0x18139c;for(var _0x536756 in this['triggers']){if(this[_0xa3c6('0x11')][_0xa3c6('0x3d')](_0x536756)){if(this[_0xa3c6('0x11')][_0x536756]['status']){_0x18139c=this['checkTrigger'](this[_0xa3c6('0x11')][_0x536756],_0x2174d1);if(_0x18139c){_[_0xa3c6('0x3e')](_0x2174d1,_0x2174d1['variables']);for(var _0x1a9c9a=0x0,_0x5c6a37,_0x142240,_0x5749f6;_0x1a9c9a0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x97d16,_0x35b8e6){var _0x2151e1=function(_0x1ef883){while(--_0x1ef883){_0x97d16['push'](_0x97d16['shift']());}};_0x2151e1(++_0x35b8e6);}(_0x55ca,0x126));var _0xa55c=function(_0x28db4a,_0x6d6d5a){_0x28db4a=_0x28db4a-0x0;var _0x3bf87e=_0x55ca[_0x28db4a];return _0x3bf87e;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 8294b6c..bc942e4 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 _0x957d=['contacts?$select=','&$filter=','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','callDirection','queue','phonecalls','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','data7','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','error','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data2','resolve','data5','POST','clientId','username','password','clientSecret','access_token','catch','toUpperCase','then','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid','message','toLowerCase','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','outbound','destcalleridnum'];(function(_0x173079,_0x3d7cce){var _0x31027f=function(_0x510c33){while(--_0x510c33){_0x173079['push'](_0x173079['shift']());}};_0x31027f(++_0x3d7cce);}(_0x957d,0xa6));var _0xd957=function(_0x2cb5e1,_0x249efd){_0x2cb5e1=_0x2cb5e1-0x0;var _0x326843=_0x957d[_0x2cb5e1];return _0x326843;};'use strict';var _=require(_0xd957('0x0'));var rp=require(_0xd957('0x1'));var util=require(_0xd957('0x2'));var intUtil=require(_0xd957('0x3'));var md5=require(_0xd957('0x4'));var Redis=require('ioredis');var logger=require(_0xd957('0x5'))(_0xd957('0x6'));var config=require(_0xd957('0x7'));config['redis']=_['defaults'](config[_0xd957('0x8')],{'host':_0xd957('0x9'),'port':0x18eb});var io=require(_0xd957('0xa'))(new Redis(config[_0xd957('0x8')]));function getAuthToken(_0x5530ba,_0x133a36,_0x2e03f7){if(_0x5530ba[_0xd957('0xb')]){_0x5530ba[_0xd957('0xc')]=_0x5530ba[_0xd957('0xd')]['data7'];_0x5530ba['tenantId']=_0x5530ba[_0xd957('0xd')][_0xd957('0xe')];return Promise[_0xd957('0xf')](_0x5530ba[_0xd957('0xd')][_0xd957('0x10')]);}var _0x54ca83={'method':_0xd957('0x11'),'uri':_0x133a36,'form':{'client_id':_0x5530ba[_0xd957('0x12')],'resource':_0x5530ba['remoteUri'],'username':_0x5530ba[_0xd957('0x13')],'password':_0x5530ba[_0xd957('0x14')],'grant_type':_0xd957('0x14'),'client_secret':_0x5530ba[_0xd957('0x15')]},'json':!![]};return rp(_0x54ca83)['then'](function(_0x176f05){return _0x176f05[_0xd957('0x16')];})[_0xd957('0x17')](function(_0x29b8bb){logger['error']('['+[_0x2e03f7[_0xd957('0x18')]()]+']\x20Wrong\x20credentials!');return _0x29b8bb['message'];});}function getUser(_0x289951,_0x9c053b,_0x4de8d5,_0x26a41f,_0x56dfb2,_0x207831){return new Promise(function(_0x453bef,_0x3b6d2f){return getAuthToken(_0x9c053b,_0x26a41f,_0x207831)[_0xd957('0x19')](function(_0x2e2230){var _0x5b6bc5={'method':_0xd957('0x1a'),'uri':_0x56dfb2+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xd957('0x1b')+_0x2e2230,'OData-Version':_0xd957('0x1c')},'json':!![]};return rp(_0x5b6bc5);})[_0xd957('0x19')](function(_0x226b7f){var _0x260116=_0x226b7f[_0xd957('0x1d')];var _0x18e6ab=![];var _0x3384c4=null;if(!_[_0xd957('0x1e')](_0x4de8d5)){if(intUtil[_0xd957('0x1f')](_0x4de8d5[_0xd957('0x20')])){_0x289951[_0xd957('0x21')]=_0x4de8d5['email'];for(_0x3384c4=0x0;_0x3384c4<_0x260116[_0xd957('0x22')];_0x3384c4++){if(_0x260116[_0x3384c4][_0xd957('0x23')]===_0x4de8d5[_0xd957('0x20')]&&!_0x260116[_0x3384c4][_0xd957('0x24')]){_0x18e6ab=!![];logger[_0xd957('0x25')]('['+[_0x207831[_0xd957('0x18')]()]+_0xd957('0x26')+_0x260116[_0x3384c4]['systemuserid']+'!');_0x289951[_0xd957('0x27')]=_0x260116[_0x3384c4][_0xd957('0x28')];}}}}if(!_0x18e6ab){logger[_0xd957('0x25')]('['+[_0x207831[_0xd957('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x289951['userEmail']=_0x9c053b[_0xd957('0x13')];for(_0x3384c4=0x0;_0x3384c4<_0x260116[_0xd957('0x22')];_0x3384c4++){if(_0x260116[_0x3384c4][_0xd957('0x23')]===_0x9c053b[_0xd957('0x13')]){_0x289951[_0xd957('0x27')]=_0x260116[_0x3384c4]['systemuserid'];}}}_0x453bef(_0x289951);})[_0xd957('0x17')](function(_0x18a4da){_0x3b6d2f(_0x18a4da[_0xd957('0x29')]);});});}function createEndUser(_0x4164e1,_0x5e5446,_0x30fa3c,_0x5c8eeb,_0x3ec96a,_0x2ade0b,_0x167179){return new Promise(function(_0x2e2d6f,_0x2bc382){return getAuthToken(_0x5e5446,_0x30fa3c,_0x2ade0b)['then'](function(_0x4f0668){var _0x271dcf=_0x2ade0b[_0xd957('0x2a')]()==='outbound'?_0x3ec96a['destcalleridnum']:_0x3ec96a[_0xd957('0x2b')];var _0x3ad97f={'method':_0xd957('0x11'),'uri':_0x5c8eeb+_0xd957('0x2c'),'body':{'fullname':_0x271dcf,'firstname':_0x271dcf,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd957('0x2d')+_0x4164e1[_0xd957('0x27')]+')'},'headers':{'Authorization':_0xd957('0x1b')+_0x4f0668,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x3ad97f[_0xd957('0x2e')][_0x167179]=_0x271dcf;return rp(_0x3ad97f);})[_0xd957('0x19')](function(_0x38e8f1){var _0x11c539=_0x38e8f1[_0xd957('0x2f')][_0xd957('0x30')];var _0x266a34=_0x11c539[_0xd957('0x31')](_0x11c539['lastIndexOf']('(')+0x1,_0x11c539[_0xd957('0x32')](')'));_0x4164e1[_0xd957('0x33')]=_0x266a34;_0x2e2d6f(_0x4164e1);})['catch'](function(_0x479dbe){_0x2bc382(_0x479dbe[_0xd957('0x29')]);});});}function getEndUser(_0x527633,_0x6770a3,_0x54be9c,_0x491ca6,_0x1b90e9,_0x51b547,_0x27e51c,_0x18f8c3){var _0x4e2ad8=_0x51b547[_0xd957('0x2a')]()===_0xd957('0x34')?_0x1b90e9[_0xd957('0x35')]:_0x1b90e9[_0xd957('0x2b')];return getAuthToken(_0x6770a3,_0x54be9c,_0x51b547)[_0xd957('0x19')](function(_0x104605){_0x18f8c3=_0x18f8c3?_0x18f8c3:'telephone1';var _0x52f71b={'method':_0xd957('0x1a'),'uri':_0x491ca6+_0xd957('0x36')+_0x18f8c3+_0xd957('0x37')+_0x18f8c3+'\x20eq\x20\x27'+_0x4e2ad8['replace']('+',_0xd957('0x38'))+'\x27','headers':{'Authorization':_0xd957('0x1b')+_0x104605,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x52f71b);})['then'](function(_0x591e55){var _0x277d12=![];if(!_0x591e55)return _0x277d12;var _0x442545=_0x591e55[_0xd957('0x1d')];for(var _0x5381e0=0x0;_0x5381e0<_0x442545[_0xd957('0x22')];_0x5381e0++){if(_0x442545[_0x5381e0][_0x18f8c3]===_0x4e2ad8){_0x277d12=!![];_0x527633['enduserId']=_0x442545[_0x5381e0][_0xd957('0x39')];}}return _0x277d12;})[_0xd957('0x19')](function(_0x40cb07){if(_0x40cb07)return _0x527633;if(_0x27e51c===_0xd957('0x3a')){logger[_0xd957('0x25')]('['+[_0x51b547[_0xd957('0x18')]()]+_0xd957('0x3b'));return _0x527633;}return createEndUser(_0x527633,_0x6770a3,_0x54be9c,_0x491ca6,_0x1b90e9,_0x51b547,_0x18f8c3)[_0xd957('0x19')](function(_0x5cceea){logger['info']('['+[_0x51b547[_0xd957('0x18')]()]+']\x20Enduser\x20created!',_0x5cceea[_0xd957('0x33')]);return _0x5cceea;});});}function getCustomFields(_0x29a01c,_0x1e59a0,_0x329f79){var _0x436660={};if(_0x29a01c[_0xd957('0x22')]>0x0){_[_0xd957('0x3c')](_0x29a01c,function(_0x4f1e38){if(_[_0xd957('0x3d')]([_0xd957('0x3e'),'picklist'],_0x4f1e38['type'])&&_0x4f1e38[_0xd957('0x3f')]&&!_0x4f1e38[_0xd957('0x40')]){var _0x380539=_0x4f1e38[_0xd957('0x41')][_0xd957('0x2a')]();var _0x2593d9=_0x380539[_0xd957('0x31')](0x0,_0x380539[_0xd957('0x42')]('_'));var _0x5214e3=_0x380539['substring'](_0x380539[_0xd957('0x42')]('_')+0x1);if(_0x2593d9===_0x329f79){_0x436660[_0x5214e3]=_0x4f1e38[_0xd957('0x43')];}}});}return _0x436660;}function getTicket(_0x95f40f,_0x6049d7,_0x5d3263,_0xcea9da,_0x240842,_0x532e79,_0x3a6176){return new Promise(function(_0x1c1110,_0x2df3af){var _0x6cebac;return getAuthToken(_0x6049d7,_0x5d3263,_0x3a6176)['then'](function(_0x76ebe9){if(_0x532e79[_0xd957('0x44')]===_0xd957('0x45')){_0x6cebac={'method':_0xd957('0x11'),'uri':_0xcea9da+_0xd957('0x46'),'body':Object[_0xd957('0x47')]({},{'title':intUtil[_0xd957('0x48')](_0x532e79[_0xd957('0x49')],_0x240842,'\x20'),'description':intUtil[_0xd957('0x48')](_0x532e79[_0xd957('0x4a')],_0x240842,'\x0a'),'customerid_contact@odata.bind':_0x95f40f['enduserId']?_0xd957('0x4b')+_0x95f40f['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x95f40f['userId']+')','caseorigincode':'1'},getCustomFields(_0x532e79['Fields'],_0x240842,_0x532e79[_0xd957('0x44')])),'headers':{'Authorization':_0xd957('0x1b')+_0x76ebe9,'OData-Version':_0xd957('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x532e79[_0xd957('0x44')]==='phonecall'){var _0x1a6fac=_0x95f40f[_0xd957('0x33')]?[{'partyid_systemuser@odata.bind':_0xd957('0x2d')+_0x95f40f[_0xd957('0x27')]+')','participationtypemask':_0x95f40f[_0xd957('0x4c')]===_0xd957('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0xd957('0x4b')+_0x95f40f['enduserId']+')','participationtypemask':_0x95f40f[_0xd957('0x4c')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd957('0x2d')+_0x95f40f[_0xd957('0x27')]+')','participationtypemask':_0x95f40f['callDirection']===_0xd957('0x4d')?0x2:0x1}];_0x6cebac={'method':_0xd957('0x11'),'uri':_0xcea9da+_0xd957('0x4e'),'body':Object[_0xd957('0x47')]({},{'subject':intUtil[_0xd957('0x48')](_0x532e79[_0xd957('0x49')],_0x240842,'\x20'),'phonenumber':String(_0x240842['calleridnum']),'description':intUtil[_0xd957('0x48')](_0x532e79[_0xd957('0x4a')],_0x240842,'\x0a'),'regardingobjectid_contact@odata.bind':_0x95f40f[_0xd957('0x33')]?'/contacts('+_0x95f40f[_0xd957('0x33')]+')':undefined,'ownerid@odata.bind':_0xd957('0x2d')+_0x95f40f[_0xd957('0x27')]+')','directioncode':_0x95f40f[_0xd957('0x4c')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1a6fac},getCustomFields(_0x532e79['Fields'],_0x240842,_0x532e79[_0xd957('0x44')])),'headers':{'Authorization':_0xd957('0x1b')+_0x76ebe9,'OData-Version':_0xd957('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x6cebac);})[_0xd957('0x19')](function(_0x30cc32){var _0x3948f1=_0x30cc32[_0xd957('0x2f')][_0xd957('0x30')];var _0x4c5027=_0x3948f1[_0xd957('0x31')](_0x3948f1['lastIndexOf']('(')+0x1,_0x3948f1[_0xd957('0x32')](')'));_0x95f40f[_0xd957('0x4f')]=_0x4c5027;_0x1c1110(_0x95f40f);})[_0xd957('0x17')](function(_0x32f042){_0x2df3af(_0x32f042[_0xd957('0x29')]);});});}function emit(_0x5e25d1,_0x1026f8,_0x54dfbe,_0x2b50ae){var _0x4d3bd1={'uri':util['format'](_0xd957('0x50'),_0x5e25d1,_0x54dfbe,_0x2b50ae)};io['to'](util[_0xd957('0x51')](_0xd957('0x52'),_0x1026f8))[_0xd957('0x53')](_0xd957('0x54'),_0x4d3bd1);}exports['cs']=function(_0x3bba13,_0x1eff52,_0x44d363,_0x82c6c,_0x3aeab3,_0x7ceca3,_0x54c454,_0x572c71){var _0x2f482a={};_0x7ceca3[_0xd957('0xc')]=_0x7ceca3[_0xd957('0xb')]?intUtil[_0xd957('0x55')](_0x7ceca3['CloudProvider']['data7']):intUtil[_0xd957('0x55')](_0x7ceca3[_0xd957('0xc')]);_0x7ceca3['serverUrl']=intUtil[_0xd957('0x55')](_0x7ceca3['serverUrl']);_0x2f482a[_0xd957('0x4c')]=_0x572c71===_0xd957('0x4d')||_0x572c71===_0xd957('0x56')?_0xd957('0x4d'):_0xd957('0x34');var _0x331eb4=_0x7ceca3['modernAuthentication']?util[_0xd957('0x51')](_0xd957('0x57'),_0x7ceca3[_0xd957('0xd')][_0xd957('0x58')]):util[_0xd957('0x51')]('%s/api/data/v9.0/',_0x7ceca3['remoteUri']);var _0x507499=util['format'](_0xd957('0x59'),_0x7ceca3[_0xd957('0x5a')]);var _0x1829d4=util['format'](_0xd957('0x5b'),_0x7ceca3[_0xd957('0x5c')],_0x1eff52[_0xd957('0x5d')],md5(_0x1eff52[_0xd957('0x5d')]));if(_0x3aeab3&&_0x3aeab3['monitor_format']){logger[_0xd957('0x25')](_0xd957('0x5e'),'Recording\x20is\x20enabled!');_0x1eff52[_0xd957('0x5f')]=_0x1829d4;}else if(_0x54c454&&_0x54c454[_0xd957('0x60')]&&_0x54c454['recordingFormat']!=='none'){logger[_0xd957('0x25')](_0xd957('0x61'),_0xd957('0x62'));_0x1eff52['recordingURL']=_0x1829d4;}else{_0x1eff52[_0xd957('0x5f')]='';}return getUser(_0x2f482a,_0x7ceca3,_0x82c6c,_0x507499,_0x331eb4,_0x572c71)[_0xd957('0x19')](function(_0x2a6093){logger[_0xd957('0x25')]('['+_0x572c71['toUpperCase']()+_0xd957('0x63'),_0x2a6093['userId']);logger['info']('['+_0x572c71[_0xd957('0x18')]()+_0xd957('0x64'),_0x2a6093[_0xd957('0x21')]);return getEndUser(_0x2a6093,_0x7ceca3,_0x507499,_0x331eb4,_0x1eff52,_0x572c71,_0x44d363[_0xd957('0x65')],_0x44d363[_0xd957('0x66')]);})[_0xd957('0x19')](function(_0x1d90d8){logger[_0xd957('0x25')]('['+_0x572c71[_0xd957('0x18')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x1d90d8[_0xd957('0x33')]);logger['info']('['+_0x572c71['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x1eff52[_0xd957('0x2b')]);return getTicket(_0x1d90d8,_0x7ceca3,_0x507499,_0x331eb4,_0x1eff52,_0x44d363,_0x572c71);})[_0xd957('0x19')](function(_0x2be62e){logger['info'](util[_0xd957('0x51')]('['+_0x572c71[_0xd957('0x18')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x44d363[_0xd957('0x44')],_0x2be62e[_0xd957('0x4f')]));logger[_0xd957('0x25')](util['format']('['+_0x572c71[_0xd957('0x18')]()+_0xd957('0x67'),_0x572c71));if(_0x572c71!==_0xd957('0x56')&&_0x44d363[_0xd957('0x68')]){logger[_0xd957('0x25')]('['+_0x572c71[_0xd957('0x18')]()+']',_0xd957('0x69'));emit(_0x7ceca3[_0xd957('0xc')],_0x82c6c[_0xd957('0x6a')],_0x44d363[_0xd957('0x44')],_0x2be62e[_0xd957('0x4f')]);}})[_0xd957('0x17')](function(_0x1317bf){logger['error']('['+_0x572c71[_0xd957('0x18')]()+_0xd957('0x6b'),_0x1317bf[_0xd957('0x29')]);console[_0xd957('0x6c')](_0xd957('0x6d'),_0x1317bf);});}; \ No newline at end of file +var _0xacbf=['forEach','includes','string','type','customField','idField','substring','indexOf','content','incident','incidents','assign','Subjects','getString','Descriptions','ticketType','phonecall','callDirection','queue','/contacts(','phonecalls','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','resolve','data5','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','lastIndexOf','enduserId','contacts?$select=','\x20eq\x20\x27','replace','%2b','4.0','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!'];(function(_0x270cbe,_0x4d9ef1){var _0x382eea=function(_0x9d0c0a){while(--_0x9d0c0a){_0x270cbe['push'](_0x270cbe['shift']());}};_0x382eea(++_0x4d9ef1);}(_0xacbf,0x106));var _0xfacb=function(_0x3d20a3,_0x416806){_0x3d20a3=_0x3d20a3-0x0;var _0x44feb5=_0xacbf[_0x3d20a3];return _0x44feb5;};'use strict';var _=require(_0xfacb('0x0'));var rp=require('request-promise');var util=require(_0xfacb('0x1'));var intUtil=require(_0xfacb('0x2'));var md5=require(_0xfacb('0x3'));var Redis=require(_0xfacb('0x4'));var logger=require(_0xfacb('0x5'))(_0xfacb('0x6'));var config=require(_0xfacb('0x7'));config[_0xfacb('0x8')]=_[_0xfacb('0x9')](config[_0xfacb('0x8')],{'host':_0xfacb('0xa'),'port':0x18eb});var io=require(_0xfacb('0xb'))(new Redis(config[_0xfacb('0x8')]));function getAuthToken(_0x285acd,_0x3bd670,_0x326f64){if(_0x285acd[_0xfacb('0xc')]){_0x285acd['remoteUri']=_0x285acd[_0xfacb('0xd')]['data7'];_0x285acd[_0xfacb('0xe')]=_0x285acd['CloudProvider']['data2'];return Promise[_0xfacb('0xf')](_0x285acd[_0xfacb('0xd')][_0xfacb('0x10')]);}var _0x222534={'method':_0xfacb('0x11'),'uri':_0x3bd670,'form':{'client_id':_0x285acd[_0xfacb('0x12')],'resource':_0x285acd[_0xfacb('0x13')],'username':_0x285acd[_0xfacb('0x14')],'password':_0x285acd[_0xfacb('0x15')],'grant_type':'password','client_secret':_0x285acd[_0xfacb('0x16')]},'json':!![]};return rp(_0x222534)[_0xfacb('0x17')](function(_0x308903){return _0x308903[_0xfacb('0x18')];})[_0xfacb('0x19')](function(_0x58d299){logger[_0xfacb('0x1a')]('['+[_0x326f64[_0xfacb('0x1b')]()]+_0xfacb('0x1c'));return _0x58d299[_0xfacb('0x1d')];});}function getUser(_0x13d6f6,_0x5b4f5e,_0x37f3e3,_0x259c63,_0x38513f,_0xaadf25){return new Promise(function(_0x4e0b7d,_0x593eac){return getAuthToken(_0x5b4f5e,_0x259c63,_0xaadf25)['then'](function(_0x373776){var _0x5d2bf3={'method':_0xfacb('0x1e'),'uri':_0x38513f+_0xfacb('0x1f'),'headers':{'Authorization':_0xfacb('0x20')+_0x373776,'OData-Version':'4.0'},'json':!![]};return rp(_0x5d2bf3);})['then'](function(_0x237403){var _0x4ee9fa=_0x237403[_0xfacb('0x21')];var _0x24b2c8=![];var _0xf4cd11=null;if(!_[_0xfacb('0x22')](_0x37f3e3)){if(intUtil[_0xfacb('0x23')](_0x37f3e3[_0xfacb('0x24')])){_0x13d6f6[_0xfacb('0x25')]=_0x37f3e3[_0xfacb('0x24')];for(_0xf4cd11=0x0;_0xf4cd11<_0x4ee9fa[_0xfacb('0x26')];_0xf4cd11++){if(_0x4ee9fa[_0xf4cd11][_0xfacb('0x27')]===_0x37f3e3[_0xfacb('0x24')]&&!_0x4ee9fa[_0xf4cd11][_0xfacb('0x28')]){_0x24b2c8=!![];logger[_0xfacb('0x29')]('['+[_0xaadf25[_0xfacb('0x1b')]()]+_0xfacb('0x2a')+_0x4ee9fa[_0xf4cd11][_0xfacb('0x2b')]+'!');_0x13d6f6[_0xfacb('0x2c')]=_0x4ee9fa[_0xf4cd11][_0xfacb('0x2b')];}}}}if(!_0x24b2c8){logger[_0xfacb('0x29')]('['+[_0xaadf25[_0xfacb('0x1b')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x13d6f6[_0xfacb('0x25')]=_0x5b4f5e[_0xfacb('0x14')];for(_0xf4cd11=0x0;_0xf4cd11<_0x4ee9fa[_0xfacb('0x26')];_0xf4cd11++){if(_0x4ee9fa[_0xf4cd11][_0xfacb('0x27')]===_0x5b4f5e['username']){_0x13d6f6[_0xfacb('0x2c')]=_0x4ee9fa[_0xf4cd11][_0xfacb('0x2b')];}}}_0x4e0b7d(_0x13d6f6);})['catch'](function(_0x23fc66){_0x593eac(_0x23fc66['message']);});});}function createEndUser(_0x2a46fe,_0xb3be3e,_0xf1325a,_0x296dd8,_0x1ac831,_0x393be9,_0x2124e1){return new Promise(function(_0x3b54e3,_0x104906){return getAuthToken(_0xb3be3e,_0xf1325a,_0x393be9)[_0xfacb('0x17')](function(_0x3f5a29){var _0x147a2d=_0x393be9[_0xfacb('0x2d')]()===_0xfacb('0x2e')?_0x1ac831[_0xfacb('0x2f')]:_0x1ac831[_0xfacb('0x30')];var _0x5f0f1d={'method':_0xfacb('0x11'),'uri':_0x296dd8+_0xfacb('0x31'),'body':{'fullname':_0x147a2d,'firstname':_0x147a2d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfacb('0x32')+_0x2a46fe[_0xfacb('0x2c')]+')'},'headers':{'Authorization':_0xfacb('0x20')+_0x3f5a29,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x5f0f1d[_0xfacb('0x33')][_0x2124e1]=_0x147a2d;return rp(_0x5f0f1d);})[_0xfacb('0x17')](function(_0x128e91){var _0x23499b=_0x128e91[_0xfacb('0x34')][_0xfacb('0x35')];var _0x562e6c=_0x23499b['substring'](_0x23499b[_0xfacb('0x36')]('(')+0x1,_0x23499b[_0xfacb('0x36')](')'));_0x2a46fe[_0xfacb('0x37')]=_0x562e6c;_0x3b54e3(_0x2a46fe);})[_0xfacb('0x19')](function(_0x18bc15){_0x104906(_0x18bc15[_0xfacb('0x1d')]);});});}function getEndUser(_0x15bf81,_0x55e56d,_0x47dd5f,_0x54cba9,_0x279007,_0x5de365,_0x2fd5c9,_0x45bd4d){var _0x56e196=_0x5de365['toLowerCase']()===_0xfacb('0x2e')?_0x279007[_0xfacb('0x2f')]:_0x279007['calleridnum'];return getAuthToken(_0x55e56d,_0x47dd5f,_0x5de365)[_0xfacb('0x17')](function(_0x36f9a2){_0x45bd4d=_0x45bd4d?_0x45bd4d:'telephone1';var _0x2bfd8f={'method':_0xfacb('0x1e'),'uri':_0x54cba9+_0xfacb('0x38')+_0x45bd4d+'&$filter='+_0x45bd4d+_0xfacb('0x39')+_0x56e196[_0xfacb('0x3a')]('+',_0xfacb('0x3b'))+'\x27','headers':{'Authorization':_0xfacb('0x20')+_0x36f9a2,'If-None-Match':null,'OData-Version':_0xfacb('0x3c')},'json':!![]};return rp(_0x2bfd8f);})[_0xfacb('0x17')](function(_0x18edf1){var _0x578453=![];if(!_0x18edf1)return _0x578453;var _0x3df6b2=_0x18edf1[_0xfacb('0x21')];for(var _0x2862f2=0x0;_0x2862f2<_0x3df6b2[_0xfacb('0x26')];_0x2862f2++){if(_0x3df6b2[_0x2862f2][_0x45bd4d]===_0x56e196){_0x578453=!![];_0x15bf81[_0xfacb('0x37')]=_0x3df6b2[_0x2862f2][_0xfacb('0x3d')];}}return _0x578453;})[_0xfacb('0x17')](function(_0x1aa124){if(_0x1aa124)return _0x15bf81;if(_0x2fd5c9===_0xfacb('0x3e')){logger[_0xfacb('0x29')]('['+[_0x5de365[_0xfacb('0x1b')]()]+_0xfacb('0x3f'));return _0x15bf81;}return createEndUser(_0x15bf81,_0x55e56d,_0x47dd5f,_0x54cba9,_0x279007,_0x5de365,_0x45bd4d)[_0xfacb('0x17')](function(_0x2b410f){logger[_0xfacb('0x29')]('['+[_0x5de365[_0xfacb('0x1b')]()]+_0xfacb('0x40'),_0x2b410f[_0xfacb('0x37')]);return _0x2b410f;});});}function getCustomFields(_0x32c0a1,_0x1dcc19,_0x1769e0){var _0x9baa44={};if(_0x32c0a1[_0xfacb('0x26')]>0x0){_[_0xfacb('0x41')](_0x32c0a1,function(_0x3d1464){if(_[_0xfacb('0x42')]([_0xfacb('0x43'),'picklist'],_0x3d1464[_0xfacb('0x44')])&&_0x3d1464['nameField']&&!_0x3d1464[_0xfacb('0x45')]){var _0x1d9a05=_0x3d1464[_0xfacb('0x46')][_0xfacb('0x2d')]();var _0x1157b8=_0x1d9a05[_0xfacb('0x47')](0x0,_0x1d9a05[_0xfacb('0x48')]('_'));var _0x45ad73=_0x1d9a05[_0xfacb('0x47')](_0x1d9a05['indexOf']('_')+0x1);if(_0x1157b8===_0x1769e0){_0x9baa44[_0x45ad73]=_0x3d1464[_0xfacb('0x49')];}}});}return _0x9baa44;}function getTicket(_0x4945d6,_0x1a0587,_0x36da4e,_0x461225,_0x175153,_0xb43d4f,_0x3e1605){return new Promise(function(_0x29b070,_0x423c9a){var _0x4cd405;return getAuthToken(_0x1a0587,_0x36da4e,_0x3e1605)[_0xfacb('0x17')](function(_0x49e55d){if(_0xb43d4f['ticketType']===_0xfacb('0x4a')){_0x4cd405={'method':_0xfacb('0x11'),'uri':_0x461225+_0xfacb('0x4b'),'body':Object[_0xfacb('0x4c')]({},{'title':intUtil['getString'](_0xb43d4f[_0xfacb('0x4d')],_0x175153,'\x20'),'description':intUtil[_0xfacb('0x4e')](_0xb43d4f[_0xfacb('0x4f')],_0x175153,'\x0a'),'customerid_contact@odata.bind':_0x4945d6['enduserId']?'/contacts('+_0x4945d6[_0xfacb('0x37')]+')':undefined,'ownerid@odata.bind':_0xfacb('0x32')+_0x4945d6[_0xfacb('0x2c')]+')','caseorigincode':'1'},getCustomFields(_0xb43d4f['Fields'],_0x175153,_0xb43d4f[_0xfacb('0x50')])),'headers':{'Authorization':_0xfacb('0x20')+_0x49e55d,'OData-Version':_0xfacb('0x3c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xb43d4f[_0xfacb('0x50')]===_0xfacb('0x51')){var _0x1488a5=_0x4945d6[_0xfacb('0x37')]?[{'partyid_systemuser@odata.bind':_0xfacb('0x32')+_0x4945d6[_0xfacb('0x2c')]+')','participationtypemask':_0x4945d6[_0xfacb('0x52')]===_0xfacb('0x53')?0x2:0x1},{'partyid_contact@odata.bind':_0xfacb('0x54')+_0x4945d6[_0xfacb('0x37')]+')','participationtypemask':_0x4945d6[_0xfacb('0x52')]===_0xfacb('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfacb('0x32')+_0x4945d6[_0xfacb('0x2c')]+')','participationtypemask':_0x4945d6[_0xfacb('0x52')]===_0xfacb('0x53')?0x2:0x1}];_0x4cd405={'method':_0xfacb('0x11'),'uri':_0x461225+_0xfacb('0x55'),'body':Object[_0xfacb('0x4c')]({},{'subject':intUtil[_0xfacb('0x4e')](_0xb43d4f[_0xfacb('0x4d')],_0x175153,'\x20'),'phonenumber':String(_0x175153[_0xfacb('0x30')]),'description':intUtil[_0xfacb('0x4e')](_0xb43d4f[_0xfacb('0x4f')],_0x175153,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4945d6[_0xfacb('0x37')]?'/contacts('+_0x4945d6['enduserId']+')':undefined,'ownerid@odata.bind':_0xfacb('0x32')+_0x4945d6['userId']+')','directioncode':_0x4945d6[_0xfacb('0x52')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1488a5},getCustomFields(_0xb43d4f[_0xfacb('0x56')],_0x175153,_0xb43d4f[_0xfacb('0x50')])),'headers':{'Authorization':_0xfacb('0x20')+_0x49e55d,'OData-Version':_0xfacb('0x3c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4cd405);})[_0xfacb('0x17')](function(_0xa54ed0){var _0x47ba54=_0xa54ed0['headers'][_0xfacb('0x35')];var _0x5b3bdf=_0x47ba54[_0xfacb('0x47')](_0x47ba54['lastIndexOf']('(')+0x1,_0x47ba54[_0xfacb('0x36')](')'));_0x4945d6[_0xfacb('0x57')]=_0x5b3bdf;_0x29b070(_0x4945d6);})[_0xfacb('0x19')](function(_0x4801a1){_0x423c9a(_0x4801a1[_0xfacb('0x1d')]);});});}function emit(_0x5f5adf,_0x530099,_0x218ef8,_0x48aba8){var _0x4b2ea6={'uri':util[_0xfacb('0x58')](_0xfacb('0x59'),_0x5f5adf,_0x218ef8,_0x48aba8)};io['to'](util[_0xfacb('0x58')]('user:%s',_0x530099))[_0xfacb('0x5a')](_0xfacb('0x5b'),_0x4b2ea6);}exports['cs']=function(_0x51644d,_0x4736bf,_0x4447d9,_0x25cd69,_0x39d512,_0x417031,_0x599568,_0xb47544){var _0x46f8bb={};_0x417031[_0xfacb('0x13')]=_0x417031[_0xfacb('0xc')]?intUtil[_0xfacb('0x5c')](_0x417031[_0xfacb('0xd')][_0xfacb('0x5d')]):intUtil[_0xfacb('0x5c')](_0x417031[_0xfacb('0x13')]);_0x417031['serverUrl']=intUtil[_0xfacb('0x5c')](_0x417031[_0xfacb('0x5e')]);_0x46f8bb['callDirection']=_0xb47544==='queue'||_0xb47544===_0xfacb('0x5f')?_0xfacb('0x53'):_0xfacb('0x2e');var _0xee5112=_0x417031['modernAuthentication']?util['format'](_0xfacb('0x60'),_0x417031['CloudProvider'][_0xfacb('0x5d')]):util[_0xfacb('0x58')]('%s/api/data/v9.0/',_0x417031[_0xfacb('0x13')]);var _0x14befc=util[_0xfacb('0x58')]('https://login.microsoftonline.com/%s/oauth2/token',_0x417031[_0xfacb('0xe')]);var _0x461ff6=util[_0xfacb('0x58')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x417031[_0xfacb('0x5e')],_0x4736bf[_0xfacb('0x61')],md5(_0x4736bf['uniqueid']));if(_0x39d512&&_0x39d512['monitor_format']){logger['info']('[QUEUE]',_0xfacb('0x62'));_0x4736bf['recordingURL']=_0x461ff6;}else if(_0x599568&&_0x599568['recordingFormat']&&_0x599568['recordingFormat']!==_0xfacb('0x63')){logger[_0xfacb('0x29')](_0xfacb('0x64'),_0xfacb('0x62'));_0x4736bf[_0xfacb('0x65')]=_0x461ff6;}else{_0x4736bf[_0xfacb('0x65')]='';}return getUser(_0x46f8bb,_0x417031,_0x25cd69,_0x14befc,_0xee5112,_0xb47544)['then'](function(_0x2d6160){logger[_0xfacb('0x29')]('['+_0xb47544[_0xfacb('0x1b')]()+_0xfacb('0x66'),_0x2d6160[_0xfacb('0x2c')]);logger[_0xfacb('0x29')]('['+_0xb47544[_0xfacb('0x1b')]()+']\x20The\x20User\x20email\x20is:',_0x2d6160['userEmail']);return getEndUser(_0x2d6160,_0x417031,_0x14befc,_0xee5112,_0x4736bf,_0xb47544,_0x4447d9[_0xfacb('0x67')],_0x4447d9[_0xfacb('0x68')]);})[_0xfacb('0x17')](function(_0x25e942){logger['info']('['+_0xb47544[_0xfacb('0x1b')]()+_0xfacb('0x69'),_0x25e942['enduserId']);logger['info']('['+_0xb47544[_0xfacb('0x1b')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x4736bf[_0xfacb('0x30')]);return getTicket(_0x25e942,_0x417031,_0x14befc,_0xee5112,_0x4736bf,_0x4447d9,_0xb47544);})['then'](function(_0x294004){logger[_0xfacb('0x29')](util[_0xfacb('0x58')]('['+_0xb47544[_0xfacb('0x1b')]()+_0xfacb('0x6a'),_0x4447d9[_0xfacb('0x50')],_0x294004['ticketId']));logger[_0xfacb('0x29')](util['format']('['+_0xb47544['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0xb47544));if(_0xb47544!==_0xfacb('0x5f')&&_0x4447d9[_0xfacb('0x6b')]){logger[_0xfacb('0x29')]('['+_0xb47544['toUpperCase']()+']',_0xfacb('0x6c'));emit(_0x417031[_0xfacb('0x13')],_0x25cd69['name'],_0x4447d9['ticketType'],_0x294004[_0xfacb('0x57')]);}})[_0xfacb('0x19')](function(_0x52f344){logger[_0xfacb('0x1a')]('['+_0xb47544[_0xfacb('0x1b')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x52f344[_0xfacb('0x1d')]);console[_0xfacb('0x1a')]('Error\x20running\x20Dynamics365\x20integration',_0x52f344);});}; \ 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 cb8b9bd..327fa90 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 _0x307e=['variable','variableName','push','customVariable','Variable','name','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','error','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','
','Tags','Fields','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','toString','base64','debug','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','idField','customField','type'];(function(_0x176f03,_0x346f65){var _0x4ed9dd=function(_0x574bfd){while(--_0x574bfd){_0x176f03['push'](_0x176f03['shift']());}};_0x4ed9dd(++_0x346f65);}(_0x307e,0xd5));var _0xe307=function(_0x32248d,_0x3f4063){_0x32248d=_0x32248d-0x0;var _0x27f284=_0x307e[_0x32248d];return _0x27f284;};'use strict';var _=require(_0xe307('0x0'));var rp=require(_0xe307('0x1'));var md5=require(_0xe307('0x2'));var util=require('util');var Redis=require(_0xe307('0x3'));var intUtil=require(_0xe307('0x4'));var config=require('../../../../config/environment');var logger=require(_0xe307('0x5'))(_0xe307('0x6'));config[_0xe307('0x7')]=_[_0xe307('0x8')](config[_0xe307('0x7')],{'host':_0xe307('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe307('0x7')]));var headers={'Content-Type':_0xe307('0xa'),'Accept':_0xe307('0xa')};function emit(_0x34af4e,_0x24dc32,_0x8ee681){io['to'](_0x34af4e)[_0xe307('0xb')](_0x24dc32,_0x8ee681);}function getTicket(_0x230b0a,_0x2122a4,_0x20dc7e,_0xfa0d8c,_0x2cf725){logger['info'](_0xe307('0xc'));var _0x25c505=_['merge']({'responder_id':_0x2122a4['id'],'requester_id':_0x20dc7e['id'],'name':util[_0xe307('0xd')](_0xe307('0xe'),_0x2cf725['calleridname']),'phone':_0x2cf725[_0xe307('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe307('0x10')](_0xfa0d8c[_0xe307('0x11')],_0x2cf725,'\x20'),'description':intUtil['getString'](_0xfa0d8c['Descriptions'],_0x2cf725,_0xe307('0x12')),'tags':getTags(_0xfa0d8c[_0xe307('0x13')],'name')},getCustomFields(_0xfa0d8c[_0xe307('0x14')],_0x2cf725));_0x25c505[_0xe307('0x15')]=_['mapValues'](_['keyBy'](_0x25c505[_0xe307('0x15')],'id'),_0xe307('0x16'));return request({'uri':util['format'](_0xe307('0x17'),_0x230b0a[_0xe307('0x18')]),'method':_0xe307('0x19'),'body':_0x25c505})['then'](function(_0x535d91){logger[_0xe307('0x1a')](_0xe307('0x1b'));return _0x535d91;});}function getUser(_0x15cf8a,_0x24033b){if(intUtil[_0xe307('0x1c')](_0x24033b)){return request({'uri':util[_0xe307('0xd')](_0xe307('0x1d'),_0x15cf8a['remoteUri']),'qs':{'email':_0x24033b}})[_0xe307('0x1e')](function(_0x1de9ee){if(_0x1de9ee[_0xe307('0x1f')]){logger[_0xe307('0x1a')]('Agent\x20found!');return _[_0xe307('0x20')](_0x1de9ee,function(_0x130f1a){return _0x130f1a[_0xe307('0x21')][_0xe307('0x22')]===_0x24033b;});}else{logger[_0xe307('0x1a')](_0xe307('0x23'));return request({'uri':util[_0xe307('0xd')](_0xe307('0x24'),_0x15cf8a[_0xe307('0x18')])})['then'](function(_0x5756fa){logger[_0xe307('0x1a')]('Admin\x20account\x20selected.');return _0x5756fa;});}});}else{logger[_0xe307('0x1a')](_0xe307('0x25'));return request({'uri':util[_0xe307('0xd')](_0xe307('0x24'),_0x15cf8a[_0xe307('0x18')])})[_0xe307('0x1e')](function(_0x2aad75){logger[_0xe307('0x1a')](_0xe307('0x26'));return _0x2aad75;});}}function getEndUser(_0x2d6934,_0x1f9655,_0x17ac56){logger[_0xe307('0x1a')](_0xe307('0x27'),_0x17ac56);return request({'uri':util[_0xe307('0xd')](_0xe307('0x28'),_0x2d6934[_0xe307('0x18')]),'qs':{'phone':_0x17ac56}})[_0xe307('0x1e')](function(_0x2ba989){if(_0x2ba989[_0xe307('0x1f')]){logger[_0xe307('0x1a')](_0xe307('0x29'));return _[_0xe307('0x20')](_0x2ba989,{'phone':_0x17ac56});}else{logger[_0xe307('0x1a')](_0xe307('0x2a'));return request({'uri':util[_0xe307('0xd')](_0xe307('0x28'),_0x2d6934[_0xe307('0x18')]),'method':'POST','body':{'name':_0x1f9655,'phone':_0x17ac56}})['then'](function(_0x43bdf6){logger[_0xe307('0x1a')]('Enduser\x20created.');return _0x43bdf6;});}});}function getAuth(_0x10b2bc){return util[_0xe307('0xd')](_0xe307('0x2b'),new Buffer(_0x10b2bc['apiKey']+':X')[_0xe307('0x2c')](_0xe307('0x2d')));}function request(_0x5f300c){logger[_0xe307('0x2e')]('[HTTP]',JSON[_0xe307('0x2f')](_0x5f300c));return rp(_[_0xe307('0x8')](_0x5f300c,{'method':_0xe307('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x3fac72,_0x20b68f){var _0x160f5c=[];if(_0x3fac72&&_0x3fac72[_0xe307('0x1f')]>0x0){_0x160f5c=_[_0xe307('0x31')](_0x3fac72,_0x20b68f);}return _0x160f5c;}function getCustomFields(_0x2cff10,_0x38a7ba){var _0xf15a7c=[];var _0x6dda7a={'custom_fields':[]};if(_0x2cff10['length']>0x0){_[_0xe307('0x32')](_0x2cff10,function(_0x38513f){if(_[_0xe307('0x33')]([_0xe307('0x34'),_0xe307('0x35')],_0x38513f['type'])&&_0x38513f[_0xe307('0x36')]&&!_0x38513f['customField']){_0x6dda7a[_0x38513f[_0xe307('0x36')][_0xe307('0x37')]()]=_0x38513f[_0xe307('0x38')][_0xe307('0x2c')]();}else if(_['includes']([_0xe307('0x34'),_0xe307('0x35')],_0x38513f['type'])&&_0x38513f[_0xe307('0x39')]&&_0x38513f[_0xe307('0x3a')]){_0x6dda7a[_0xe307('0x15')]['push']({'id':_0x38513f[_0xe307('0x39')],'value':_0x38513f[_0xe307('0x38')][_0xe307('0x2c')]()});}else if(_0x38513f[_0xe307('0x3b')]===_0xe307('0x3c')&&_0x38513f[_0xe307('0x3d')]&&_0x38513f[_0xe307('0x39')]&&_0x38513f['customField']){_0x38a7ba[_0x38513f[_0xe307('0x3d')]]&&_0x6dda7a['custom_fields'][_0xe307('0x3e')]({'id':_0x38513f['idField'],'value':_0x38a7ba[_0x38513f[_0xe307('0x3d')]][_0xe307('0x2c')]()});}else if(_0x38513f[_0xe307('0x3b')]===_0xe307('0x3f')&&_0x38513f['Variable']&&_0x38513f[_0xe307('0x40')][_0xe307('0x41')]&&_0x38513f['idField']&&_0x38513f[_0xe307('0x3a')]){_0x38a7ba[_0x38513f[_0xe307('0x40')][_0xe307('0x41')][_0xe307('0x37')]()]&&_0x6dda7a[_0xe307('0x15')][_0xe307('0x3e')]({'id':_0x38513f[_0xe307('0x39')],'value':_0x38a7ba[_0x38513f['Variable']['name'][_0xe307('0x37')]()]['toString']()});}});}return _0x6dda7a;}exports[_0xe307('0x42')]=function(_0x59f6a7,_0xf1ad69,_0x1fd984,_0x247333,_0xcd72e9,_0x2f52d6){var _0x5746d5,_0x554517;_0x2f52d6['remoteUri']=intUtil['stripTrailingSlash'](_0x2f52d6[_0xe307('0x18')]);_0x2f52d6[_0xe307('0x43')]=intUtil[_0xe307('0x44')](_0x2f52d6[_0xe307('0x43')]);if(_0xcd72e9&&_0xcd72e9[_0xe307('0x45')]){logger[_0xe307('0x1a')](_0xe307('0x46'),'Recording\x20is\x20enabled!');_0xf1ad69[_0xe307('0x47')]=util[_0xe307('0xd')](_0xe307('0x48'),_0x2f52d6['serverUrl'],_0xf1ad69['uniqueid'],md5(_0xf1ad69[_0xe307('0x49')]));}else{_0xf1ad69[_0xe307('0x47')]='';}headers[_0xe307('0x4a')]=getAuth(_0x2f52d6);return getUser(_0x2f52d6,_0x247333[_0xe307('0x22')])[_0xe307('0x1e')](function(_0x295fb9){_0x5746d5=_0x295fb9;logger[_0xe307('0x1a')](_0xe307('0x4b'),_0x5746d5['id']);return getEndUser(_0x2f52d6,_0xf1ad69[_0xe307('0x4c')],_0xf1ad69['calleridnum']);})[_0xe307('0x1e')](function(_0x401535){_0x554517=_0x401535;logger['info'](_0xe307('0x4d'),_0x554517['id']);return getTicket(_0x2f52d6,_0x5746d5,_0x554517,_0x1fd984,_0xf1ad69);})[_0xe307('0x1e')](function(_0x814f15){if(_0x814f15&&_0x814f15['id']){logger[_0xe307('0x1a')](_0xe307('0x1b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x814f15['id']);logger[_0xe307('0x1a')](_0xe307('0x46'),_0xe307('0x4e'));emit(util[_0xe307('0xd')](_0xe307('0x4f'),_0x247333['name']),_0xe307('0x50'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x2f52d6['remoteUri'],_0x814f15['id'])});}})[_0xe307('0x51')](function(_0x5741e7){logger['error'](_0xe307('0x46'),JSON['stringify'](_0x5741e7));});};exports['outbound']=function(_0x42791e,_0x9e4de1,_0x4328db,_0x27c7c1,_0x165cfc,_0x36c515,_0x4842d7){var _0x2f511,_0x46ffc9;_0x36c515[_0xe307('0x18')]=intUtil[_0xe307('0x44')](_0x36c515['remoteUri']);_0x36c515[_0xe307('0x43')]=intUtil[_0xe307('0x44')](_0x36c515[_0xe307('0x43')]);if(_0x4842d7&&_0x4842d7[_0xe307('0x52')]&&_0x4842d7[_0xe307('0x52')]!=='none'){logger[_0xe307('0x1a')](_0xe307('0x53'),_0xe307('0x54'));_0x9e4de1[_0xe307('0x47')]=util[_0xe307('0xd')](_0xe307('0x48'),_0x36c515[_0xe307('0x43')],_0x9e4de1['uniqueid'],md5(_0x9e4de1[_0xe307('0x49')]));}headers[_0xe307('0x4a')]=getAuth(_0x36c515);return getUser(_0x36c515,_0x27c7c1[_0xe307('0x22')])[_0xe307('0x1e')](function(_0x5ed490){_0x2f511=_0x5ed490;logger[_0xe307('0x1a')](_0xe307('0x4b'),_0x2f511['id']);return getEndUser(_0x36c515,_0x9e4de1['destcalleridname'],_0x9e4de1['destcalleridnum']);})[_0xe307('0x1e')](function(_0x2a6655){_0x46ffc9=_0x2a6655;logger['info']('The\x20Enduser\x20ID\x20is:',_0x46ffc9['id']);return getTicket(_0x36c515,_0x2f511,_0x46ffc9,_0x4328db,_0x9e4de1);})[_0xe307('0x1e')](function(_0x403627){if(_0x403627&&_0x403627['id']){logger[_0xe307('0x1a')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x403627['id']);logger['info'](_0xe307('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe307('0xd')]('user:%s',_0x27c7c1[_0xe307('0x41')]),_0xe307('0x50'),{'uri':util[_0xe307('0xd')](_0xe307('0x55'),_0x36c515[_0xe307('0x18')],_0x403627['id'])});}})[_0xe307('0x51')](function(_0x425f22){logger['error'](_0xe307('0x53'),JSON[_0xe307('0x2f')](_0x425f22));});};exports[_0xe307('0x56')]=function(_0x4655a6,_0x4742fc,_0x45d355,_0x2ee22d,_0xdde9b0,_0x193c63){var _0x4575c9,_0xd05932;_0x193c63[_0xe307('0x18')]=intUtil[_0xe307('0x44')](_0x193c63[_0xe307('0x18')]);_0x193c63[_0xe307('0x43')]=intUtil[_0xe307('0x44')](_0x193c63[_0xe307('0x43')]);if(_0xdde9b0&&_0xdde9b0['monitor_format']){logger[_0xe307('0x1a')]('['+_0x4742fc[_0xe307('0x57')][_0xe307('0x58')]()+']','Recording\x20is\x20enabled!');_0x4742fc[_0xe307('0x47')]=util[_0xe307('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x193c63['serverUrl'],_0x4742fc[_0xe307('0x49')],md5(_0x4742fc[_0xe307('0x49')]));}else{_0x4742fc[_0xe307('0x47')]='';}headers['Authorization']=getAuth(_0x193c63);return getUser(_0x193c63,'')[_0xe307('0x1e')](function(_0x4d7092){_0x4575c9=_0x4d7092;logger['info'](_0xe307('0x4b'),_0x4575c9['id']);return getEndUser(_0x193c63,_0x4742fc[_0xe307('0x4c')],_0x4742fc[_0xe307('0xf')]);})[_0xe307('0x1e')](function(_0x42dcbb){_0xd05932=_0x42dcbb;logger[_0xe307('0x1a')](_0xe307('0x4d'),_0xd05932['id']);return getTicket(_0x193c63,_0x4575c9,_0xd05932,_0x45d355,_0x4742fc);})['then'](function(_0x133da5){if(_0x133da5){logger[_0xe307('0x1a')](_0xe307('0x1b'));logger['info'](_0xe307('0x59'),_0x133da5['id']);}})[_0xe307('0x51')](function(_0x3e2b13){logger[_0xe307('0x5a')]('['+_0x4742fc['lastevent'][_0xe307('0x58')]()+']',JSON['stringify'](_0x3e2b13));});}; \ No newline at end of file +var _0x140b=['nameField','customField','toLowerCase','content','includes','string','type','idField','variableName','push','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','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','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridnum','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','length','Agent\x20found!','find','contact','email','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','picklist'];(function(_0x2bc3f4,_0x470b26){var _0x14ac53=function(_0x5121bd){while(--_0x5121bd){_0x2bc3f4['push'](_0x2bc3f4['shift']());}};_0x14ac53(++_0x470b26);}(_0x140b,0x143));var _0xb140=function(_0x1c6bf6,_0x4fbe52){_0x1c6bf6=_0x1c6bf6-0x0;var _0xcde1b5=_0x140b[_0x1c6bf6];return _0xcde1b5;};'use strict';var _=require(_0xb140('0x0'));var rp=require(_0xb140('0x1'));var md5=require(_0xb140('0x2'));var util=require(_0xb140('0x3'));var Redis=require(_0xb140('0x4'));var intUtil=require(_0xb140('0x5'));var config=require(_0xb140('0x6'));var logger=require('../../../../config/logger')(_0xb140('0x7'));config[_0xb140('0x8')]=_[_0xb140('0x9')](config[_0xb140('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb140('0xa'))(new Redis(config[_0xb140('0x8')]));var headers={'Content-Type':_0xb140('0xb'),'Accept':_0xb140('0xb')};function emit(_0x13e021,_0x491296,_0x1fb08c){io['to'](_0x13e021)['emit'](_0x491296,_0x1fb08c);}function getTicket(_0x38c51d,_0xd9b41c,_0x2b5000,_0x533b35,_0x21dc2b){logger['info'](_0xb140('0xc'));var _0x27b2ae=_[_0xb140('0xd')]({'responder_id':_0xd9b41c['id'],'requester_id':_0x2b5000['id'],'name':util[_0xb140('0xe')](_0xb140('0xf'),_0x21dc2b[_0xb140('0x10')]),'phone':_0x21dc2b[_0xb140('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x533b35[_0xb140('0x12')],_0x21dc2b,'\x20'),'description':intUtil[_0xb140('0x13')](_0x533b35[_0xb140('0x14')],_0x21dc2b,_0xb140('0x15')),'tags':getTags(_0x533b35[_0xb140('0x16')],_0xb140('0x17'))},getCustomFields(_0x533b35[_0xb140('0x18')],_0x21dc2b));_0x27b2ae[_0xb140('0x19')]=_[_0xb140('0x1a')](_[_0xb140('0x1b')](_0x27b2ae[_0xb140('0x19')],'id'),_0xb140('0x1c'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x1d'),_0x38c51d[_0xb140('0x1e')]),'method':'POST','body':_0x27b2ae})[_0xb140('0x1f')](function(_0xc897d7){logger['info'](_0xb140('0x20'));return _0xc897d7;});}function getUser(_0x2e69b3,_0x3cc06a){if(intUtil['validateEmail'](_0x3cc06a)){return request({'uri':util[_0xb140('0xe')]('%s/api/v2/agents',_0x2e69b3[_0xb140('0x1e')]),'qs':{'email':_0x3cc06a}})[_0xb140('0x1f')](function(_0x899ca0){if(_0x899ca0[_0xb140('0x21')]){logger['info'](_0xb140('0x22'));return _[_0xb140('0x23')](_0x899ca0,function(_0x3d3325){return _0x3d3325[_0xb140('0x24')][_0xb140('0x25')]===_0x3cc06a;});}else{logger[_0xb140('0x26')](_0xb140('0x27'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x28'),_0x2e69b3[_0xb140('0x1e')])})['then'](function(_0x358d9d){logger['info'](_0xb140('0x29'));return _0x358d9d;});}});}else{logger[_0xb140('0x26')](_0xb140('0x2a'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x28'),_0x2e69b3[_0xb140('0x1e')])})[_0xb140('0x1f')](function(_0x51128a){logger['info'](_0xb140('0x29'));return _0x51128a;});}}function getEndUser(_0x345d9b,_0x94b3ef,_0x442ea3){logger[_0xb140('0x26')]('Searching\x20enduser\x20with\x20phone',_0x442ea3);return request({'uri':util['format'](_0xb140('0x2b'),_0x345d9b[_0xb140('0x1e')]),'qs':{'phone':_0x442ea3}})[_0xb140('0x1f')](function(_0x26a774){if(_0x26a774[_0xb140('0x21')]){logger[_0xb140('0x26')](_0xb140('0x2c'));return _[_0xb140('0x23')](_0x26a774,{'phone':_0x442ea3});}else{logger['info'](_0xb140('0x2d'));return request({'uri':util[_0xb140('0xe')](_0xb140('0x2b'),_0x345d9b['remoteUri']),'method':_0xb140('0x2e'),'body':{'name':_0x94b3ef,'phone':_0x442ea3}})['then'](function(_0x2d1f04){logger[_0xb140('0x26')]('Enduser\x20created.');return _0x2d1f04;});}});}function getAuth(_0x289a15){return util[_0xb140('0xe')](_0xb140('0x2f'),new Buffer(_0x289a15[_0xb140('0x30')]+':X')[_0xb140('0x31')]('base64'));}function request(_0x142233){logger[_0xb140('0x32')](_0xb140('0x33'),JSON[_0xb140('0x34')](_0x142233));return rp(_[_0xb140('0x9')](_0x142233,{'method':_0xb140('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x33d53d,_0x3d4fb3){var _0x226b33=[];if(_0x33d53d&&_0x33d53d['length']>0x0){_0x226b33=_[_0xb140('0x36')](_0x33d53d,_0x3d4fb3);}return _0x226b33;}function getCustomFields(_0x785d6a,_0x22fd3e){var _0x1dc95c=[];var _0xa8d5b3={'custom_fields':[]};if(_0x785d6a[_0xb140('0x21')]>0x0){_[_0xb140('0x37')](_0x785d6a,function(_0x1ceb2b){if(_['includes'](['string',_0xb140('0x38')],_0x1ceb2b['type'])&&_0x1ceb2b[_0xb140('0x39')]&&!_0x1ceb2b[_0xb140('0x3a')]){_0xa8d5b3[_0x1ceb2b[_0xb140('0x39')][_0xb140('0x3b')]()]=_0x1ceb2b[_0xb140('0x3c')][_0xb140('0x31')]();}else if(_[_0xb140('0x3d')]([_0xb140('0x3e'),_0xb140('0x38')],_0x1ceb2b[_0xb140('0x3f')])&&_0x1ceb2b[_0xb140('0x40')]&&_0x1ceb2b['customField']){_0xa8d5b3['custom_fields']['push']({'id':_0x1ceb2b['idField'],'value':_0x1ceb2b[_0xb140('0x3c')][_0xb140('0x31')]()});}else if(_0x1ceb2b[_0xb140('0x3f')]==='variable'&&_0x1ceb2b[_0xb140('0x41')]&&_0x1ceb2b[_0xb140('0x40')]&&_0x1ceb2b[_0xb140('0x3a')]){_0x22fd3e[_0x1ceb2b[_0xb140('0x41')]]&&_0xa8d5b3['custom_fields'][_0xb140('0x42')]({'id':_0x1ceb2b['idField'],'value':_0x22fd3e[_0x1ceb2b['variableName']][_0xb140('0x31')]()});}else if(_0x1ceb2b[_0xb140('0x3f')]==='customVariable'&&_0x1ceb2b['Variable']&&_0x1ceb2b['Variable'][_0xb140('0x17')]&&_0x1ceb2b['idField']&&_0x1ceb2b['customField']){_0x22fd3e[_0x1ceb2b[_0xb140('0x43')][_0xb140('0x17')][_0xb140('0x3b')]()]&&_0xa8d5b3[_0xb140('0x19')]['push']({'id':_0x1ceb2b[_0xb140('0x40')],'value':_0x22fd3e[_0x1ceb2b[_0xb140('0x43')][_0xb140('0x17')]['toLowerCase']()][_0xb140('0x31')]()});}});}return _0xa8d5b3;}exports[_0xb140('0x44')]=function(_0x54b431,_0x48f74e,_0x28385c,_0x2bec06,_0x59dea5,_0x269df4){var _0x56d58d,_0x1c6a50;_0x269df4[_0xb140('0x1e')]=intUtil[_0xb140('0x45')](_0x269df4[_0xb140('0x1e')]);_0x269df4['serverUrl']=intUtil['stripTrailingSlash'](_0x269df4[_0xb140('0x46')]);if(_0x59dea5&&_0x59dea5[_0xb140('0x47')]){logger[_0xb140('0x26')](_0xb140('0x48'),_0xb140('0x49'));_0x48f74e[_0xb140('0x4a')]=util['format'](_0xb140('0x4b'),_0x269df4[_0xb140('0x46')],_0x48f74e['uniqueid'],md5(_0x48f74e['uniqueid']));}else{_0x48f74e[_0xb140('0x4a')]='';}headers[_0xb140('0x4c')]=getAuth(_0x269df4);return getUser(_0x269df4,_0x2bec06[_0xb140('0x25')])[_0xb140('0x1f')](function(_0x5c5fd6){_0x56d58d=_0x5c5fd6;logger[_0xb140('0x26')](_0xb140('0x4d'),_0x56d58d['id']);return getEndUser(_0x269df4,_0x48f74e[_0xb140('0x10')],_0x48f74e['calleridnum']);})[_0xb140('0x1f')](function(_0x2dad08){_0x1c6a50=_0x2dad08;logger[_0xb140('0x26')](_0xb140('0x4e'),_0x1c6a50['id']);return getTicket(_0x269df4,_0x56d58d,_0x1c6a50,_0x28385c,_0x48f74e);})[_0xb140('0x1f')](function(_0x1aeb19){if(_0x1aeb19&&_0x1aeb19['id']){logger[_0xb140('0x26')](_0xb140('0x20'));logger['info'](_0xb140('0x4f'),_0x1aeb19['id']);logger['info'](_0xb140('0x48'),_0xb140('0x50'));emit(util[_0xb140('0xe')](_0xb140('0x51'),_0x2bec06[_0xb140('0x17')]),_0xb140('0x52'),{'uri':util[_0xb140('0xe')](_0xb140('0x53'),_0x269df4['remoteUri'],_0x1aeb19['id'])});}})[_0xb140('0x54')](function(_0x132c5e){logger[_0xb140('0x55')](_0xb140('0x48'),JSON[_0xb140('0x34')](_0x132c5e));});};exports[_0xb140('0x56')]=function(_0x1f9656,_0x2133d6,_0x1ec04b,_0x310f8c,_0x228118,_0x21e9c4,_0x220ee5){var _0x45c383,_0x6e97eb;_0x21e9c4[_0xb140('0x1e')]=intUtil[_0xb140('0x45')](_0x21e9c4[_0xb140('0x1e')]);_0x21e9c4['serverUrl']=intUtil['stripTrailingSlash'](_0x21e9c4[_0xb140('0x46')]);if(_0x220ee5&&_0x220ee5[_0xb140('0x57')]&&_0x220ee5[_0xb140('0x57')]!==_0xb140('0x58')){logger[_0xb140('0x26')](_0xb140('0x59'),_0xb140('0x49'));_0x2133d6[_0xb140('0x4a')]=util[_0xb140('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21e9c4[_0xb140('0x46')],_0x2133d6['uniqueid'],md5(_0x2133d6[_0xb140('0x5a')]));}headers[_0xb140('0x4c')]=getAuth(_0x21e9c4);return getUser(_0x21e9c4,_0x310f8c[_0xb140('0x25')])['then'](function(_0x280414){_0x45c383=_0x280414;logger['info'](_0xb140('0x4d'),_0x45c383['id']);return getEndUser(_0x21e9c4,_0x2133d6['destcalleridname'],_0x2133d6[_0xb140('0x5b')]);})['then'](function(_0x25b69a){_0x6e97eb=_0x25b69a;logger[_0xb140('0x26')](_0xb140('0x4e'),_0x6e97eb['id']);return getTicket(_0x21e9c4,_0x45c383,_0x6e97eb,_0x1ec04b,_0x2133d6);})[_0xb140('0x1f')](function(_0x1d9e29){if(_0x1d9e29&&_0x1d9e29['id']){logger['info'](_0xb140('0x20'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1d9e29['id']);logger[_0xb140('0x26')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb140('0xe')](_0xb140('0x51'),_0x310f8c[_0xb140('0x17')]),_0xb140('0x52'),{'uri':util[_0xb140('0xe')]('%s/helpdesk/tickets/%d',_0x21e9c4[_0xb140('0x1e')],_0x1d9e29['id'])});}})['catch'](function(_0x1e4d33){logger['error']('[OUTBOUND]',JSON[_0xb140('0x34')](_0x1e4d33));});};exports[_0xb140('0x5c')]=function(_0x4cefc5,_0xcf562e,_0x5e5998,_0x3029b0,_0x5e3156,_0x447c1f){var _0xc137f3,_0x513cde;_0x447c1f['remoteUri']=intUtil['stripTrailingSlash'](_0x447c1f['remoteUri']);_0x447c1f['serverUrl']=intUtil[_0xb140('0x45')](_0x447c1f[_0xb140('0x46')]);if(_0x5e3156&&_0x5e3156[_0xb140('0x47')]){logger[_0xb140('0x26')]('['+_0xcf562e['lastevent'][_0xb140('0x5d')]()+']',_0xb140('0x49'));_0xcf562e[_0xb140('0x4a')]=util['format'](_0xb140('0x4b'),_0x447c1f['serverUrl'],_0xcf562e[_0xb140('0x5a')],md5(_0xcf562e[_0xb140('0x5a')]));}else{_0xcf562e[_0xb140('0x4a')]='';}headers[_0xb140('0x4c')]=getAuth(_0x447c1f);return getUser(_0x447c1f,'')[_0xb140('0x1f')](function(_0x17b163){_0xc137f3=_0x17b163;logger[_0xb140('0x26')]('The\x20User\x20ID\x20is:',_0xc137f3['id']);return getEndUser(_0x447c1f,_0xcf562e['calleridname'],_0xcf562e[_0xb140('0x11')]);})['then'](function(_0xe8528c){_0x513cde=_0xe8528c;logger['info'](_0xb140('0x4e'),_0x513cde['id']);return getTicket(_0x447c1f,_0xc137f3,_0x513cde,_0x5e5998,_0xcf562e);})[_0xb140('0x1f')](function(_0x9f1fc){if(_0x9f1fc){logger[_0xb140('0x26')]('Ticket\x20created!');logger[_0xb140('0x26')]('The\x20Ticket\x20ID\x20is:',_0x9f1fc['id']);}})[_0xb140('0x54')](function(_0x45e04b){logger['error']('['+_0xcf562e[_0xb140('0x5e')][_0xb140('0x5d')]()+']',JSON[_0xb140('0x34')](_0x45e04b));});}; \ 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 2add6fd..f408575 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 _0xad0c=['defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Admin\x20found:','catch','error','toUpperCase','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','Requested\x20Resource\x20not\x20Found','message','/api/lookup?q=','&f=','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','username','destcalleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis'];(function(_0x581736,_0xcf2a07){var _0x25a328=function(_0x3f6376){while(--_0x3f6376){_0x581736['push'](_0x581736['shift']());}};_0x25a328(++_0xcf2a07);}(_0xad0c,0x14d));var _0xcad0=function(_0x267027,_0x1925a3){_0x267027=_0x267027-0x0;var _0x2c766f=_0xad0c[_0x267027];return _0x2c766f;};'use strict';var _=require(_0xcad0('0x0'));var rp=require(_0xcad0('0x1'));var md5=require(_0xcad0('0x2'));var util=require(_0xcad0('0x3'));var moment=require(_0xcad0('0x4'));var Promise=require('bluebird');var Redis=require(_0xcad0('0x5'));var intUtil=require(_0xcad0('0x6'));var config=require(_0xcad0('0x7'));var logger=require(_0xcad0('0x8'))(_0xcad0('0x9'));config[_0xcad0('0xa')]=_[_0xcad0('0xb')](config['redis'],{'host':_0xcad0('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcad0('0xa')]));function getAdminId(_0x367a00,_0x11b6c6,_0x51f8d5,_0x2d4ea9){return new Promise(function(_0x25e5af,_0x1d58ff){var _0x4b99ad=![];var _0x58bc2a={'method':_0xcad0('0xd'),'uri':_0x2d4ea9+_0xcad0('0xe'),'json':!![]};_0x58bc2a[_0xcad0('0xf')]=_0x51f8d5;logger[_0xcad0('0x10')](_0xcad0('0x11'));return rp(_0x58bc2a)['then'](function(_0x2c8174){if(_0x2c8174){var _0x49b240=_0x2c8174[_0xcad0('0x12')];var _0x1e05c0=null;for(_0x1e05c0=0x0;_0x1e05c0<_0x49b240[_0xcad0('0x13')];_0x1e05c0++){if(_0x49b240[_0x1e05c0][_0xcad0('0x14')]===_0x367a00[_0xcad0('0x15')]){_0x367a00[_0xcad0('0x16')]=_0x49b240[_0x1e05c0]['id'];_0x4b99ad=!![];}}if(_0x4b99ad){logger[_0xcad0('0x10')](_0xcad0('0x17'),_0x367a00[_0xcad0('0x16')]);_0x25e5af(_0x367a00);}else{_0x1d58ff({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1d58ff({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xcad0('0x18')](function(_0x7df2bb){logger[_0xcad0('0x19')]('['+[_0x11b6c6[_0xcad0('0x1a')]()]+']',_0x7df2bb['message']);_0x1d58ff(_0x7df2bb);});});}function getUser(_0x2b8770,_0x539686,_0x3fb4d7){return function(_0x595db6){return new Promise(function(_0x4ab4ca,_0x592e35){var _0x4d05ef={'method':'GET','uri':_0x3fb4d7+_0xcad0('0xe'),'json':!![]};_0x4d05ef[_0xcad0('0xf')]=_0x539686;logger[_0xcad0('0x10')](_0xcad0('0x1b'));return rp(_0x4d05ef)[_0xcad0('0x1c')](function(_0x5baf1b){if(_0x5baf1b){var _0x243c35=_0x5baf1b[_0xcad0('0x12')];var _0x46bc43=![];var _0x37197d=null;if(_0x595db6[_0xcad0('0x1d')]!==null){logger[_0xcad0('0x10')](_0xcad0('0x1e'),_0x595db6[_0xcad0('0x1d')]);_0x595db6[_0xcad0('0x1f')]=_0x595db6[_0xcad0('0x1d')];for(_0x37197d=0x0;_0x37197d<_0x243c35[_0xcad0('0x13')];_0x37197d++){if(_0x243c35[_0x37197d][_0xcad0('0x14')]===_0x595db6[_0xcad0('0x1d')]){_0x46bc43=!![];_0x595db6[_0xcad0('0x20')]=_0x243c35[_0x37197d]['id'];logger['info'](_0xcad0('0x21'),_0x595db6[_0xcad0('0x20')]);}}}if(!_0x46bc43){logger[_0xcad0('0x10')](_0xcad0('0x22'));_0x595db6[_0xcad0('0x1f')]=_0x595db6['adminEmail'];_0x595db6[_0xcad0('0x20')]=_0x595db6['adminId'];_0x46bc43=!![];}if(_0x46bc43){_0x4ab4ca(_0x595db6);}else{_0x592e35({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x592e35({'statusCode':0x194,'message':_0xcad0('0x23')});}})[_0xcad0('0x18')](function(_0x461963){logger[_0xcad0('0x19')]('['+[_0x2b8770['toUpperCase']()]+']',_0x461963[_0xcad0('0x24')]);_0x592e35(_0x461963);});});};}function searchContact(_0x1dd888,_0x2c1f1c,_0x46e456,_0xc0d49d){return new Promise(function(_0x16fbaa,_0x3e8d13){var _0x19ce2b={'method':_0xcad0('0xd'),'headers':_0x2c1f1c,'uri':_0x1dd888+_0xcad0('0x25')+_0xc0d49d+_0xcad0('0x26')+_0x46e456+_0xcad0('0x27'),'json':!![]};rp(_0x19ce2b)['then'](function(_0x2c76eb){var _0x774a8=_['find'](_0x2c76eb[_0xcad0('0x28')][_0xcad0('0x28')],[_0x46e456,_0xc0d49d]);_0x16fbaa(_0x774a8);})['catch'](function(_0x102d29){_0x3e8d13(_0x102d29);});});}function getEndUser(_0xf3efb1,_0x4e6f6e,_0x3978cf){return function(_0x18bbf5){return new Promise(function(_0xe3d768,_0x109086){logger[_0xcad0('0x10')](util[_0xcad0('0x29')]('Searching\x20contact\x20with\x20phone\x20%s',_0x18bbf5[_0xcad0('0x2a')]));searchContact(_0x3978cf,_0x4e6f6e,_0xcad0('0x2b'),_0x18bbf5[_0xcad0('0x2a')])[_0xcad0('0x1c')](function(_0x13e740){if(_0x13e740){_0x18bbf5[_0xcad0('0x2c')]=_0x13e740['id'];logger[_0xcad0('0x10')](_0xcad0('0x2d'),_0x18bbf5[_0xcad0('0x2c')]);return _0xe3d768(_0x18bbf5);}searchContact(_0x3978cf,_0x4e6f6e,_0xcad0('0x2e'),_0x18bbf5[_0xcad0('0x2a')])[_0xcad0('0x1c')](function(_0xc36180){if(_0xc36180){_0x18bbf5[_0xcad0('0x2c')]=_0xc36180['id'];logger['info']('Contact\x20found\x20work_number:',_0x18bbf5[_0xcad0('0x2c')]);return _0xe3d768(_0x18bbf5);}createEndUser(_0x18bbf5,_0xf3efb1,_0x4e6f6e,_0x3978cf)['then'](function(_0x15e926){logger[_0xcad0('0x10')]('Contact\x20created:',_0x15e926[_0xcad0('0x2c')]);return _0xe3d768(_0x15e926);});});})[_0xcad0('0x18')](function(_0x55b5f1){_0x109086(_0x55b5f1);});});};}function createEndUser(_0x519c7e,_0x116022,_0x35aa86,_0x5f2235){return new Promise(function(_0x7d2bf8,_0x2fef8b){var _0x5be379=moment();var _0x35a0b6={'method':_0xcad0('0x2f'),'uri':_0x5f2235+_0xcad0('0x30'),'body':{'contact':{'last_name':_0x519c7e['contactNumber'],'work_number':_0x519c7e[_0xcad0('0x2a')],'mobile_number':_0x519c7e['contactNumber'],'owner_id':_0x519c7e[_0xcad0('0x20')],'created_at':_0x5be379['format'](_0xcad0('0x31'))}},'json':!![]};_0x35a0b6[_0xcad0('0xf')]=_0x35aa86;logger[_0xcad0('0x10')](_0xcad0('0x32'));return rp(_0x35a0b6)[_0xcad0('0x1c')](function(_0x4252e4){_0x519c7e[_0xcad0('0x2c')]=_0x4252e4[_0xcad0('0x33')]['id'];_0x7d2bf8(_0x519c7e);})[_0xcad0('0x18')](function(_0x400761){logger['error']('['+[_0x116022[_0xcad0('0x1a')]()]+']',_0x400761[_0xcad0('0x24')]);_0x2fef8b(_0x400761[_0xcad0('0x24')]);});});}function getTicket(_0x570de2,_0x1b7ee3,_0x427eae,_0x15645f,_0x24d475){return function(_0x4005a5){logger[_0xcad0('0x10')](_0xcad0('0x34'));return new Promise(function(_0x3b5c5b,_0x1dfa60){var _0x4392e8=moment();var _0x112e5c={'method':_0xcad0('0x2f'),'uri':_0x427eae+_0xcad0('0x35'),'body':{'title':intUtil[_0xcad0('0x36')](_0x15645f[_0xcad0('0x37')],_0x24d475,'\x20'),'description':intUtil['getString'](_0x15645f[_0xcad0('0x38')],_0x24d475,'\x0a'),'owner_id':_0x4005a5[_0xcad0('0x20')],'creater_id':_0x4005a5[_0xcad0('0x16')],'targetable_id':_0x4005a5[_0xcad0('0x2c')],'targetable_type':_0xcad0('0x39'),'created_at':_0x4392e8[_0xcad0('0x29')](_0xcad0('0x31')),'due_date':_0x4392e8['add'](0x1e,'m')[_0xcad0('0x29')](_0xcad0('0x31'))},'json':!![]};_0x112e5c[_0xcad0('0xf')]=_0x1b7ee3;return rp(_0x112e5c)[_0xcad0('0x1c')](function(_0x19d6bd){_0x4005a5[_0xcad0('0x3a')]=_0x19d6bd[_0xcad0('0x3b')]['id'];logger[_0xcad0('0x10')](_0xcad0('0x3c'),_0x4005a5['ticketId']);_0x3b5c5b(_0x4005a5);})[_0xcad0('0x18')](function(_0x4f17e7){logger['error']('['+[_0x570de2['toUpperCase']()]+']',_0x4f17e7[_0xcad0('0x24')]);_0x1dfa60(_0x4f17e7[_0xcad0('0x24')]);});});};}function emit(_0x4e03f4,_0x560a34,_0xf9e20c){var _0x39e649={'uri':_0x4e03f4+_0xcad0('0x3d')+_0xf9e20c};io['to'](util[_0xcad0('0x29')](_0xcad0('0x3e'),_0x560a34))[_0xcad0('0x3f')](_0xcad0('0x40'),_0x39e649);}exports['cs']=function(_0x2e9b82,_0x1baccc,_0x303272,_0x89087b,_0x34b3d3,_0x37392c,_0x37d00b,_0x48e2fc){var _0x53f91b={};var _0x5a11e5={'Authorization':_0xcad0('0x41')+_0x37392c['apiKey']};_0x37392c[_0xcad0('0x42')]=intUtil[_0xcad0('0x43')](_0x37392c[_0xcad0('0x42')]);_0x37392c[_0xcad0('0x44')]=intUtil[_0xcad0('0x43')](_0x37392c[_0xcad0('0x44')]);var _0x3217fd=_0x37392c['remoteUri'];_0x53f91b[_0xcad0('0x15')]=_0x37392c[_0xcad0('0x45')];_0x53f91b['contactNumber']=_0x48e2fc['toLowerCase']()==='outbound'?_0x1baccc[_0xcad0('0x46')]:_0x1baccc['calleridnum'];_0x53f91b['callDirection']=_0x48e2fc===_0xcad0('0x47')||_0x48e2fc==='unmanaged'?_0xcad0('0x47'):_0xcad0('0x48');if(_0x89087b){_0x53f91b[_0xcad0('0x1d')]=_0x89087b['email'];}var _0x516167=util['format'](_0xcad0('0x49'),_0x37392c[_0xcad0('0x44')],_0x1baccc[_0xcad0('0x4a')],md5(_0x1baccc[_0xcad0('0x4a')]));if(_0x34b3d3&&_0x34b3d3[_0xcad0('0x4b')]){logger[_0xcad0('0x10')](_0xcad0('0x4c'),_0xcad0('0x4d'));_0x1baccc[_0xcad0('0x4e')]=_0x516167;}else if(_0x37d00b&&_0x37d00b[_0xcad0('0x4f')]&&_0x37d00b[_0xcad0('0x4f')]!==_0xcad0('0x50')){logger[_0xcad0('0x10')](_0xcad0('0x51'),_0xcad0('0x4d'));_0x1baccc[_0xcad0('0x4e')]=_0x516167;}else{_0x1baccc[_0xcad0('0x4e')]='';}return getAdminId(_0x53f91b,_0x48e2fc,_0x5a11e5,_0x3217fd)[_0xcad0('0x1c')](getUser(_0x48e2fc,_0x5a11e5,_0x3217fd))['then'](getEndUser(_0x48e2fc,_0x5a11e5,_0x3217fd))['then'](getTicket(_0x48e2fc,_0x5a11e5,_0x3217fd,_0x303272,_0x1baccc))['then'](function(_0x3b8601){logger[_0xcad0('0x10')](util['format'](_0xcad0('0x52'),_0x3b8601[_0xcad0('0x3a')]));if(_0x48e2fc!==_0xcad0('0x53')){logger[_0xcad0('0x10')]('['+[_0x48e2fc[_0xcad0('0x1a')]()]+']',_0xcad0('0x54'));emit(_0x3217fd,_0x89087b['name'],_0x3b8601[_0xcad0('0x2c')]);}})[_0xcad0('0x18')](function(_0x1088f2){logger[_0xcad0('0x19')]('['+[_0x48e2fc[_0xcad0('0x1a')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xcad0('0x55')](_0x1088f2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x64c7=['/api/lookup?q=','&f=','&entities=contact','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','info','Getting\x20admin\x20information','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','message','then','users','Getting\x20user\x20with\x20email','agentEmail','userId','User\x20found:','Admin\x20selected','userEmail','catch','toUpperCase'];(function(_0x57f0fc,_0x5319b9){var _0x9fbccc=function(_0x3dba98){while(--_0x3dba98){_0x57f0fc['push'](_0x57f0fc['shift']());}};_0x9fbccc(++_0x5319b9);}(_0x64c7,0x193));var _0x764c=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x64c7[_0x2fee96];return _0x2e6ad1;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x764c('0x0'));var moment=require(_0x764c('0x1'));var Promise=require(_0x764c('0x2'));var Redis=require(_0x764c('0x3'));var intUtil=require(_0x764c('0x4'));var config=require(_0x764c('0x5'));var logger=require(_0x764c('0x6'))(_0x764c('0x7'));config[_0x764c('0x8')]=_[_0x764c('0x9')](config[_0x764c('0x8')],{'host':_0x764c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x764c('0x8')]));function getAdminId(_0x4941fe,_0x24f23d,_0x4c88fe,_0x2f09ff){return new Promise(function(_0x404fd9,_0x792d49){var _0x3553b7=![];var _0x23cb78={'method':_0x764c('0xb'),'uri':_0x2f09ff+_0x764c('0xc'),'json':!![]};_0x23cb78['headers']=_0x4c88fe;logger[_0x764c('0xd')](_0x764c('0xe'));return rp(_0x23cb78)['then'](function(_0x5b77f7){if(_0x5b77f7){var _0x457ad4=_0x5b77f7['users'];var _0x1c0dbc=null;for(_0x1c0dbc=0x0;_0x1c0dbc<_0x457ad4[_0x764c('0xf')];_0x1c0dbc++){if(_0x457ad4[_0x1c0dbc][_0x764c('0x10')]===_0x4941fe[_0x764c('0x11')]){_0x4941fe[_0x764c('0x12')]=_0x457ad4[_0x1c0dbc]['id'];_0x3553b7=!![];}}if(_0x3553b7){logger[_0x764c('0xd')]('Admin\x20found:',_0x4941fe[_0x764c('0x12')]);_0x404fd9(_0x4941fe);}else{_0x792d49({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x792d49({'statusCode':0x194,'message':_0x764c('0x13')});}})['catch'](function(_0x234c0b){logger[_0x764c('0x14')]('['+[_0x24f23d['toUpperCase']()]+']',_0x234c0b[_0x764c('0x15')]);_0x792d49(_0x234c0b);});});}function getUser(_0x188e4c,_0x10dd66,_0x1a0673){return function(_0x4dc36f){return new Promise(function(_0x55858b,_0x14356e){var _0x71aa4f={'method':_0x764c('0xb'),'uri':_0x1a0673+_0x764c('0xc'),'json':!![]};_0x71aa4f['headers']=_0x10dd66;logger[_0x764c('0xd')]('Getting\x20user\x20list');return rp(_0x71aa4f)[_0x764c('0x16')](function(_0x13451e){if(_0x13451e){var _0x52a127=_0x13451e[_0x764c('0x17')];var _0x48e776=![];var _0x161e91=null;if(_0x4dc36f['agentEmail']!==null){logger[_0x764c('0xd')](_0x764c('0x18'),_0x4dc36f[_0x764c('0x19')]);_0x4dc36f['userEmail']=_0x4dc36f['agentEmail'];for(_0x161e91=0x0;_0x161e91<_0x52a127[_0x764c('0xf')];_0x161e91++){if(_0x52a127[_0x161e91]['email']===_0x4dc36f['agentEmail']){_0x48e776=!![];_0x4dc36f[_0x764c('0x1a')]=_0x52a127[_0x161e91]['id'];logger[_0x764c('0xd')](_0x764c('0x1b'),_0x4dc36f[_0x764c('0x1a')]);}}}if(!_0x48e776){logger[_0x764c('0xd')](_0x764c('0x1c'));_0x4dc36f[_0x764c('0x1d')]=_0x4dc36f[_0x764c('0x11')];_0x4dc36f[_0x764c('0x1a')]=_0x4dc36f[_0x764c('0x12')];_0x48e776=!![];}if(_0x48e776){_0x55858b(_0x4dc36f);}else{_0x14356e({'statusCode':0x194,'message':_0x764c('0x13')});}}else{_0x14356e({'statusCode':0x194,'message':_0x764c('0x13')});}})[_0x764c('0x1e')](function(_0x4bc13e){logger[_0x764c('0x14')]('['+[_0x188e4c[_0x764c('0x1f')]()]+']',_0x4bc13e[_0x764c('0x15')]);_0x14356e(_0x4bc13e);});});};}function searchContact(_0x54d92f,_0x14abf9,_0x2ab535,_0x1a5cdc){return new Promise(function(_0x228eb1,_0x2f7ebc){var _0x41e01d={'method':_0x764c('0xb'),'headers':_0x14abf9,'uri':_0x54d92f+_0x764c('0x20')+_0x1a5cdc+_0x764c('0x21')+_0x2ab535+_0x764c('0x22'),'json':!![]};rp(_0x41e01d)[_0x764c('0x16')](function(_0x2fb58b){var _0x23e9fa=_['find'](_0x2fb58b['contacts'][_0x764c('0x23')],[_0x2ab535,_0x1a5cdc]);_0x228eb1(_0x23e9fa);})[_0x764c('0x1e')](function(_0x375258){_0x2f7ebc(_0x375258);});});}function getEndUser(_0x5daaf8,_0x2dfb6d,_0x59f657){return function(_0x6b8f03){return new Promise(function(_0x4291cf,_0x2ed660){logger['info'](util[_0x764c('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x6b8f03[_0x764c('0x25')]));searchContact(_0x59f657,_0x2dfb6d,_0x764c('0x26'),_0x6b8f03[_0x764c('0x25')])[_0x764c('0x16')](function(_0xbaebc0){if(_0xbaebc0){_0x6b8f03[_0x764c('0x27')]=_0xbaebc0['id'];logger[_0x764c('0xd')](_0x764c('0x28'),_0x6b8f03['endUserId']);return _0x4291cf(_0x6b8f03);}searchContact(_0x59f657,_0x2dfb6d,_0x764c('0x29'),_0x6b8f03[_0x764c('0x25')])[_0x764c('0x16')](function(_0x262a1e){if(_0x262a1e){_0x6b8f03[_0x764c('0x27')]=_0x262a1e['id'];logger[_0x764c('0xd')]('Contact\x20found\x20work_number:',_0x6b8f03['endUserId']);return _0x4291cf(_0x6b8f03);}createEndUser(_0x6b8f03,_0x5daaf8,_0x2dfb6d,_0x59f657)[_0x764c('0x16')](function(_0x2a17ff){logger[_0x764c('0xd')](_0x764c('0x2a'),_0x2a17ff[_0x764c('0x27')]);return _0x4291cf(_0x2a17ff);});});})['catch'](function(_0x350c11){_0x2ed660(_0x350c11);});});};}function createEndUser(_0x137c52,_0x43849e,_0x2eb2de,_0x3419cc){return new Promise(function(_0x1345b7,_0x534503){var _0x138966=moment();var _0x370345={'method':_0x764c('0x2b'),'uri':_0x3419cc+_0x764c('0x2c'),'body':{'contact':{'last_name':_0x137c52['contactNumber'],'work_number':_0x137c52[_0x764c('0x25')],'mobile_number':_0x137c52[_0x764c('0x25')],'owner_id':_0x137c52[_0x764c('0x1a')],'created_at':_0x138966[_0x764c('0x24')](_0x764c('0x2d'))}},'json':!![]};_0x370345[_0x764c('0x2e')]=_0x2eb2de;logger[_0x764c('0xd')](_0x764c('0x2f'));return rp(_0x370345)[_0x764c('0x16')](function(_0x198f8f){_0x137c52[_0x764c('0x27')]=_0x198f8f[_0x764c('0x30')]['id'];_0x1345b7(_0x137c52);})[_0x764c('0x1e')](function(_0x22fc92){logger[_0x764c('0x14')]('['+[_0x43849e[_0x764c('0x1f')]()]+']',_0x22fc92['message']);_0x534503(_0x22fc92[_0x764c('0x15')]);});});}function getTicket(_0x5b95a7,_0x2ee74a,_0x56faf3,_0x36720b,_0x4c7b85){return function(_0x5c85cf){logger['info'](_0x764c('0x31'));return new Promise(function(_0x492c2e,_0x156fb4){var _0xe22455=moment();var _0x56f7b1={'method':_0x764c('0x2b'),'uri':_0x56faf3+_0x764c('0x32'),'body':{'title':intUtil['getString'](_0x36720b['Subjects'],_0x4c7b85,'\x20'),'description':intUtil[_0x764c('0x33')](_0x36720b[_0x764c('0x34')],_0x4c7b85,'\x0a'),'owner_id':_0x5c85cf[_0x764c('0x1a')],'creater_id':_0x5c85cf[_0x764c('0x12')],'targetable_id':_0x5c85cf[_0x764c('0x27')],'targetable_type':'Contact','created_at':_0xe22455[_0x764c('0x24')](_0x764c('0x2d')),'due_date':_0xe22455[_0x764c('0x35')](0x1e,'m')[_0x764c('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x56f7b1[_0x764c('0x2e')]=_0x2ee74a;return rp(_0x56f7b1)[_0x764c('0x16')](function(_0x190922){_0x5c85cf[_0x764c('0x36')]=_0x190922[_0x764c('0x37')]['id'];logger['info'](_0x764c('0x38'),_0x5c85cf[_0x764c('0x36')]);_0x492c2e(_0x5c85cf);})['catch'](function(_0xf6f725){logger['error']('['+[_0x5b95a7['toUpperCase']()]+']',_0xf6f725[_0x764c('0x15')]);_0x156fb4(_0xf6f725[_0x764c('0x15')]);});});};}function emit(_0x45757c,_0x223166,_0x39d077){var _0x26bcc4={'uri':_0x45757c+_0x764c('0x39')+_0x39d077};io['to'](util[_0x764c('0x24')](_0x764c('0x3a'),_0x223166))[_0x764c('0x3b')](_0x764c('0x3c'),_0x26bcc4);}exports['cs']=function(_0x515475,_0x17415f,_0xaf0d73,_0x118c28,_0xabf5ff,_0x1c374c,_0x9846e8,_0x2a17c9){var _0x194f13={};var _0x35adcb={'Authorization':_0x764c('0x3d')+_0x1c374c[_0x764c('0x3e')]};_0x1c374c[_0x764c('0x3f')]=intUtil[_0x764c('0x40')](_0x1c374c[_0x764c('0x3f')]);_0x1c374c[_0x764c('0x41')]=intUtil[_0x764c('0x40')](_0x1c374c[_0x764c('0x41')]);var _0xdb9186=_0x1c374c['remoteUri'];_0x194f13['adminEmail']=_0x1c374c[_0x764c('0x42')];_0x194f13[_0x764c('0x25')]=_0x2a17c9[_0x764c('0x43')]()===_0x764c('0x44')?_0x17415f[_0x764c('0x45')]:_0x17415f[_0x764c('0x46')];_0x194f13[_0x764c('0x47')]=_0x2a17c9===_0x764c('0x48')||_0x2a17c9==='unmanaged'?'queue':_0x764c('0x44');if(_0x118c28){_0x194f13[_0x764c('0x19')]=_0x118c28['email'];}var _0x9ffab4=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c374c[_0x764c('0x41')],_0x17415f['uniqueid'],md5(_0x17415f[_0x764c('0x49')]));if(_0xabf5ff&&_0xabf5ff[_0x764c('0x4a')]){logger['info'](_0x764c('0x4b'),_0x764c('0x4c'));_0x17415f[_0x764c('0x4d')]=_0x9ffab4;}else if(_0x9846e8&&_0x9846e8['recordingFormat']&&_0x9846e8[_0x764c('0x4e')]!==_0x764c('0x4f')){logger[_0x764c('0xd')](_0x764c('0x50'),_0x764c('0x4c'));_0x17415f[_0x764c('0x4d')]=_0x9ffab4;}else{_0x17415f['recordingURL']='';}return getAdminId(_0x194f13,_0x2a17c9,_0x35adcb,_0xdb9186)['then'](getUser(_0x2a17c9,_0x35adcb,_0xdb9186))[_0x764c('0x16')](getEndUser(_0x2a17c9,_0x35adcb,_0xdb9186))['then'](getTicket(_0x2a17c9,_0x35adcb,_0xdb9186,_0xaf0d73,_0x17415f))[_0x764c('0x16')](function(_0x473ec1){logger[_0x764c('0xd')](util['format'](_0x764c('0x51'),_0x473ec1[_0x764c('0x36')]));if(_0x2a17c9!==_0x764c('0x52')){logger[_0x764c('0xd')]('['+[_0x2a17c9['toUpperCase']()]+']',_0x764c('0x53'));emit(_0xdb9186,_0x118c28[_0x764c('0x54')],_0x473ec1[_0x764c('0x27')]);}})['catch'](function(_0x458df8){logger[_0x764c('0x14')]('['+[_0x2a17c9['toUpperCase']()]+_0x764c('0x55'),util[_0x764c('0x56')](_0x458df8,{'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 fb1357d..d13f033 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 _0x641f=['data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','freshsales','exec','data1','toLowerCase'];(function(_0x173477,_0x33e604){var _0x52a008=function(_0x4452f4){while(--_0x4452f4){_0x173477['push'](_0x173477['shift']());}};_0x52a008(++_0x33e604);}(_0x641f,0x83));var _0xf641=function(_0x1e4638,_0x98fe2d){_0x1e4638=_0x1e4638-0x0;var _0x2c5a34=_0x641f[_0x1e4638];return _0x2c5a34;};'use strict';var _=require(_0xf641('0x0'));var util=require(_0xf641('0x1'));var zendesk=require(_0xf641('0x2'));var salesforce=require(_0xf641('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xf641('0x4'));var zoho=require(_0xf641('0x5'));var desk=require(_0xf641('0x6'));var vtiger=require(_0xf641('0x7'));var servicenow=require(_0xf641('0x8'));var dynamics365=require(_0xf641('0x9'));var freshsales=require(_0xf641('0xa'));var integrations=[_0xf641('0xb'),_0xf641('0xc'),_0xf641('0xd'),_0xf641('0xe'),_0xf641('0xf'),_0xf641('0x10'),'vtiger','dynamics365',_0xf641('0x11'),'servicenow'];exports[_0xf641('0x12')]=function(_0x40f7d3,_0x481da8,_0x34b556,_0x3ebb71,_0x5948fa,_0x27fba9){if(_0x34b556){if(_['includes'](integrations,_0x40f7d3[_0xf641('0x13')][_0xf641('0x14')]())){try{var _0x5392a0=null;var _0x13fca8='';var _0x4c84ec=_0x34b556[_0x40f7d3[_0xf641('0x13')][_0xf641('0x14')]()];if(_0x4c84ec){var _0x1067c6=_0x4c84ec[_0x40f7d3[_0xf641('0x15')]];if(_0x1067c6){var _0x3abd76=_[_0xf641('0x16')](_0x1067c6['Configurations'],{'id':parseInt(_0x40f7d3[_0xf641('0x17')],0xa)});if(_0x3abd76){if(_0x3ebb71){if(_0x5948fa&&_0x481da8[_0xf641('0x18')]){_0x13fca8=_0xf641('0x18');}else if(_0x481da8['routeId']){_0x13fca8=_0xf641('0x19');}else{console[_0xf641('0x1a')](_0xf641('0x1b'),_0x481da8);}}else{_0x13fca8=_0xf641('0x1c');}switch(_0x40f7d3[_0xf641('0x13')][_0xf641('0x14')]()){case'zendesk':zendesk[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case _0xf641('0xc'):salesforce[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case'sugarcrm':sugarcrm[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case _0xf641('0xe'):freshdesk[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case _0xf641('0xf'):zoho[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case _0xf641('0x10'):desk[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case'vtiger':vtiger[_0x13fca8](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9);break;case'freshsales':freshsales['cs'](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9,_0x13fca8);break;case _0xf641('0x1d'):servicenow['cs'](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9,_0x13fca8);break;case _0xf641('0x1e'):dynamics365['cs'](_0x40f7d3,_0x481da8,_0x3abd76,_0x3ebb71,_0x5948fa,_0x1067c6,_0x27fba9,_0x13fca8);break;default:console[_0xf641('0x1a')](_0xf641('0x1f'));}}else{_0x5392a0=require(_0xf641('0x20'))(_0x40f7d3[_0xf641('0x13')][_0xf641('0x14')]());_0x5392a0[_0xf641('0x21')]('[EXEC]',util['format'](_0xf641('0x22'),_0x40f7d3['data1'][_0xf641('0x14')](),_0x40f7d3[_0xf641('0x17')]));}}else{_0x5392a0=require('../../../../config/logger')(_0x40f7d3['data1']['toLowerCase']());_0x5392a0[_0xf641('0x21')](_0xf641('0x23'),util[_0xf641('0x24')](_0xf641('0x25'),_0x40f7d3['data1']['toLowerCase'](),_0x40f7d3[_0xf641('0x15')]));}}else{}}catch(_0x395b3a){console['error'](_0x395b3a);}}}}; \ No newline at end of file +var _0x7a7c=['./salesforce','./sugarcrm','./freshdesk','./desk','./vtiger','./freshsales','zendesk','salesforce','freshdesk','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','zoho','unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','lodash','util','./zendesk'];(function(_0x45fc9c,_0x70f2cb){var _0x984946=function(_0x432b38){while(--_0x432b38){_0x45fc9c['push'](_0x45fc9c['shift']());}};_0x984946(++_0x70f2cb);}(_0x7a7c,0xb6));var _0xc7a7=function(_0x98677a,_0x1d6b7c){_0x98677a=_0x98677a-0x0;var _0x5c93d4=_0x7a7c[_0x98677a];return _0x5c93d4;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var zendesk=require(_0xc7a7('0x2'));var salesforce=require(_0xc7a7('0x3'));var sugarcrm=require(_0xc7a7('0x4'));var freshdesk=require(_0xc7a7('0x5'));var zoho=require('./zoho');var desk=require(_0xc7a7('0x6'));var vtiger=require(_0xc7a7('0x7'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xc7a7('0x8'));var integrations=[_0xc7a7('0x9'),_0xc7a7('0xa'),'sugarcrm',_0xc7a7('0xb'),'zoho',_0xc7a7('0xc'),_0xc7a7('0xd'),'dynamics365',_0xc7a7('0xe'),_0xc7a7('0xf')];exports[_0xc7a7('0x10')]=function(_0x365f11,_0x3ed960,_0x276c39,_0x552aa7,_0x5ee86c,_0x4fef81){if(_0x276c39){if(_[_0xc7a7('0x11')](integrations,_0x365f11[_0xc7a7('0x12')][_0xc7a7('0x13')]())){try{var _0xe74b4b=null;var _0x4a8be0='';var _0x1f332d=_0x276c39[_0x365f11['data1']['toLowerCase']()];if(_0x1f332d){var _0xaa89f2=_0x1f332d[_0x365f11[_0xc7a7('0x14')]];if(_0xaa89f2){var _0x24ac56=_['find'](_0xaa89f2[_0xc7a7('0x15')],{'id':parseInt(_0x365f11[_0xc7a7('0x16')],0xa)});if(_0x24ac56){if(_0x552aa7){if(_0x5ee86c&&_0x3ed960[_0xc7a7('0x17')]){_0x4a8be0=_0xc7a7('0x17');}else if(_0x3ed960[_0xc7a7('0x18')]){_0x4a8be0=_0xc7a7('0x19');}else{console[_0xc7a7('0x1a')](_0xc7a7('0x1b'),_0x3ed960);}}else{_0x4a8be0=_0xc7a7('0x1c');}switch(_0x365f11[_0xc7a7('0x12')]['toLowerCase']()){case'zendesk':zendesk[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case'salesforce':salesforce[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0x1d'):sugarcrm[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xb'):freshdesk[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0x1e'):zoho[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xc'):desk[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xd'):vtiger[_0x4a8be0](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81);break;case _0xc7a7('0xe'):freshsales['cs'](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81,_0x4a8be0);break;case _0xc7a7('0xf'):servicenow['cs'](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81,_0x4a8be0);break;case'dynamics365':dynamics365['cs'](_0x365f11,_0x3ed960,_0x24ac56,_0x552aa7,_0x5ee86c,_0xaa89f2,_0x4fef81,_0x4a8be0);break;default:console[_0xc7a7('0x1a')](_0xc7a7('0x1f'));}}else{_0xe74b4b=require('../../../../config/logger')(_0x365f11['data1'][_0xc7a7('0x13')]());_0xe74b4b[_0xc7a7('0x20')](_0xc7a7('0x21'),util[_0xc7a7('0x22')](_0xc7a7('0x23'),_0x365f11[_0xc7a7('0x12')]['toLowerCase'](),_0x365f11[_0xc7a7('0x16')]));}}else{_0xe74b4b=require(_0xc7a7('0x24'))(_0x365f11[_0xc7a7('0x12')]['toLowerCase']());_0xe74b4b['error'](_0xc7a7('0x21'),util[_0xc7a7('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x365f11[_0xc7a7('0x12')]['toLowerCase'](),_0x365f11['data2']));}}else{}}catch(_0x571f86){console[_0xc7a7('0x20')](_0x571f86);}}}}; \ 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 744263f..e3b6d20 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 _0x7c50=['Subjects','Descriptions','ticketType','ActivityDate','utc','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','User','find','then','length','Name','identity','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','$or','Account','execute','first','Phone','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Company','No\x20Company','create','forEach','includes','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','calleridname','calleridnum','Fields','type','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','unmanaged','lastevent','isNil','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','util','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7c50,0x171));var _0x07c5=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x7c50[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x07c5('0x0'));var rp=require('request-promise');var moment=require(_0x07c5('0x1'));var BPromise=require(_0x07c5('0x2'));var md5=require(_0x07c5('0x3'));var jsforce=require('jsforce');var util=require(_0x07c5('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x07c5('0x5'));config[_0x07c5('0x6')]=_[_0x07c5('0x7')](config['redis'],{'host':_0x07c5('0x8'),'port':0x18eb});var io=require(_0x07c5('0x9'))(new Redis(config['redis']));function emit(_0xd6a47f,_0x1005c3,_0x527ddf){io['to'](_0xd6a47f)[_0x07c5('0xa')](_0x1005c3,_0x527ddf);}function getTicket(_0x2b1c56,_0x1c5564,_0x53fef4,_0x1ec690,_0x3caf92,_0x13367c,_0x3a660a,_0x29652d){var _0x494b95=Object['assign']({},{'OwnerId':_0x1c5564['id'],'Subject':intUtil[_0x07c5('0xb')](_0x1ec690[_0x07c5('0xc')],_0x3caf92,'\x20'),'Description':intUtil[_0x07c5('0xb')](_0x1ec690[_0x07c5('0xd')],_0x3caf92,'\x0a')},getCustomFields(_0x13367c,_0x3caf92));if(_0x53fef4){if(_0x1ec690[_0x07c5('0xe')]==='Task'){_0x494b95[_0x07c5('0xf')]=moment[_0x07c5('0x10')]();_0x494b95['IsReminderSet']=![];_0x494b95['IsRecurrence']=![];if(_0x53fef4[_0x07c5('0x11')]===_0x07c5('0x12')||_0x53fef4[_0x07c5('0x11')]===_0x07c5('0x13')){_0x494b95[_0x07c5('0x14')]=_0x53fef4['id'];}else if(_0x53fef4[_0x07c5('0x11')]===_0x07c5('0x15')){_0x494b95['WhatId']=_0x53fef4['id'];}}else if(_0x1ec690[_0x07c5('0xe')]===_0x07c5('0x16')){if(_0x53fef4['endUserType']===_0x07c5('0x12')){_0x494b95[_0x07c5('0x17')]=_0x53fef4['id'];}else if(_0x53fef4[_0x07c5('0x11')]===_0x07c5('0x15')){_0x494b95[_0x07c5('0x18')]=_0x53fef4['id'];}else if(_0x53fef4[_0x07c5('0x11')]===_0x07c5('0x13')&&_0x1ec690[_0x07c5('0x19')]){_0x494b95[_0x1ec690['leadId']]=_0x53fef4['id'];}else{logger[_0x07c5('0x1a')](_0x07c5('0x1b'));}}}return _0x3a660a[_0x07c5('0x1c')](_0x1ec690[_0x07c5('0xe')])['create'](_0x494b95);}function getUser(_0x397d06,_0x19f898,_0x4bdbfd){if(!_['isNil'](_0x19f898)&&intUtil[_0x07c5('0x1d')](_0x19f898)){var _0x388368={'Email':_0x19f898};var _0x9dd8ce={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4bdbfd['sobject'](_0x07c5('0x1e'))[_0x07c5('0x1f')](_0x388368,_0x9dd8ce)['execute']()[_0x07c5('0x20')](function(_0x44e12e){if(_0x44e12e[_0x07c5('0x21')]){var _0x19b5a3=_[_0x07c5('0x1f')](_0x44e12e,function(_0xeb4297){return _0xeb4297['Email']===_0x19f898;});if(_0x19b5a3){logger[_0x07c5('0x1a')]('Agent\x20%s\x20found.',_0x19f898);return BPromise['resolve']({'id':_0x19b5a3['Id'],'name':_0x19b5a3[_0x07c5('0x22')]});}}else{logger[_0x07c5('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x19f898);return _0x4bdbfd[_0x07c5('0x23')]()[_0x07c5('0x20')](function(_0x1f64a2){return BPromise[_0x07c5('0x24')]({'id':_0x1f64a2[_0x07c5('0x25')],'name':_0x1f64a2[_0x07c5('0x26')]});});}});}else{logger[_0x07c5('0x1a')](_0x07c5('0x27'),_0x19f898);return _0x4bdbfd[_0x07c5('0x23')]()[_0x07c5('0x20')](function(_0x56ca40){return BPromise[_0x07c5('0x24')]({'id':_0x56ca40['user_id'],'name':_0x56ca40[_0x07c5('0x26')]});});}}function getEndUser(_0x20ea3d,_0x5e72dd,_0x37d78b,_0x42e221,_0x483302){var _0x4edac7={'$or':{'Phone':_0x42e221}};var _0x1cbfb5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x07c5('0x20')](function(){logger['info'](_0x07c5('0x28'),_0x42e221,_0x5e72dd[_0x07c5('0x29')]);switch(_0x5e72dd['moduleSearch']){case _0x07c5('0x2a'):var _0x53a768=_[_0x07c5('0x2b')](_0x4edac7);if(_0x5e72dd[_0x07c5('0x2c')]){var _0x11d14d={};_0x11d14d[_0x5e72dd[_0x07c5('0x2c')]]=_0x42e221;_['merge'](_0x53a768['$or'],_0x11d14d);}return _0x483302[_0x07c5('0x1c')](_0x07c5('0x2d'))['find'](_0x53a768,_0x1cbfb5)['execute']()[_0x07c5('0x20')](function(_0x2c700a){if(_0x2c700a&&_0x2c700a['length']){return _0x2c700a;}else{var _0x13f206=_[_0x07c5('0x2b')](_0x4edac7);if(_0x5e72dd[_0x07c5('0x2e')]){var _0x17fc7a={};_0x17fc7a[_0x5e72dd[_0x07c5('0x2e')]]=_0x42e221;_[_0x07c5('0x2f')](_0x13f206['$or'],_0x17fc7a);}return _0x483302['sobject'](_0x07c5('0x30'))[_0x07c5('0x1f')](_0x13f206,_0x1cbfb5);}});case _0x07c5('0x31'):var _0x48e895=_[_0x07c5('0x2b')](_0x4edac7);if(_0x5e72dd[_0x07c5('0x32')]){var _0x11d14d={};_0x11d14d[_0x5e72dd[_0x07c5('0x32')]]=_0x42e221;_[_0x07c5('0x2f')](_0x48e895[_0x07c5('0x33')],_0x11d14d);}return _0x483302[_0x07c5('0x1c')](_0x07c5('0x34'))[_0x07c5('0x1f')](_0x48e895,_0x1cbfb5)['execute']()[_0x07c5('0x20')](function(_0x542ace){if(_0x542ace&&_0x542ace['length']){return _0x542ace;}else{var _0x37aba5=_[_0x07c5('0x2b')](_0x4edac7);if(_0x5e72dd['additionalSearchContact']){var _0x6aedc0={};_0x6aedc0[_0x5e72dd[_0x07c5('0x2c')]]=_0x42e221;_[_0x07c5('0x2f')](_0x37aba5['$or'],_0x6aedc0);}return _0x483302[_0x07c5('0x1c')](_0x07c5('0x2d'))['find'](_0x37aba5,_0x1cbfb5)['then'](function(_0x5d1964){if(_0x5d1964&&_0x5d1964[_0x07c5('0x21')]){return _0x5d1964;}else{var _0x1d6b11=_['cloneDeep'](_0x4edac7);if(_0x5e72dd[_0x07c5('0x2e')]){var _0x1b5cd6={};_0x1b5cd6[_0x5e72dd['additionalSearchLead']]=_0x42e221;_['merge'](_0x1d6b11['$or'],_0x1b5cd6);}return _0x483302[_0x07c5('0x1c')]('Lead')[_0x07c5('0x1f')](_0x1d6b11,_0x1cbfb5);}});}});case _0x07c5('0x12'):var _0x53a768=_['cloneDeep'](_0x4edac7);if(_0x5e72dd['additionalSearchContact']){var _0x11d14d={};_0x11d14d[_0x5e72dd['additionalSearchContact']]=_0x42e221;_[_0x07c5('0x2f')](_0x53a768[_0x07c5('0x33')],_0x11d14d);}return _0x483302[_0x07c5('0x1c')](_0x07c5('0x2d'))[_0x07c5('0x1f')](_0x53a768,_0x1cbfb5)[_0x07c5('0x35')]();case'lead':var _0x13e3c2=_[_0x07c5('0x2b')](_0x4edac7);if(_0x5e72dd[_0x07c5('0x2e')]){var _0x11d14d={};_0x11d14d[_0x5e72dd[_0x07c5('0x2e')]]=_0x42e221;_[_0x07c5('0x2f')](_0x13e3c2['$or'],_0x11d14d);}return _0x483302[_0x07c5('0x1c')](_0x07c5('0x30'))[_0x07c5('0x1f')](_0x13e3c2,_0x1cbfb5);case _0x07c5('0x15'):var _0x48e895=_[_0x07c5('0x2b')](_0x4edac7);if(_0x5e72dd[_0x07c5('0x32')]){var _0x11d14d={};_0x11d14d[_0x5e72dd[_0x07c5('0x32')]]=_0x42e221;_['merge'](_0x48e895[_0x07c5('0x33')],_0x11d14d);}return _0x483302[_0x07c5('0x1c')](_0x07c5('0x34'))[_0x07c5('0x1f')](_0x48e895,_0x1cbfb5);default:return null;}})[_0x07c5('0x20')](function(_0x38bb4b){if(_0x38bb4b&&_0x38bb4b[_0x07c5('0x21')]){var _0x3e9e66=_[_0x07c5('0x36')](_0x38bb4b);if(_0x3e9e66){return BPromise[_0x07c5('0x24')]({'id':_0x3e9e66['Id'],'name':_0x3e9e66[_0x07c5('0x22')],'phone':_0x3e9e66[_0x07c5('0x37')],'endUserType':_0x3e9e66[_0x07c5('0x38')]['type']['toLowerCase']()});}}})['then'](function(_0x166f5f){if(_0x166f5f){logger[_0x07c5('0x1a')](_0x07c5('0x39'),_0x166f5f[_0x07c5('0x11')],_0x42e221);return BPromise[_0x07c5('0x24')](_0x166f5f);}else{logger[_0x07c5('0x1a')](_0x07c5('0x3a'),_0x42e221);var _0x13cbb2={'Phone':_0x42e221};if(_0x5e72dd[_0x07c5('0x3b')]){if(_0x5e72dd[_0x07c5('0x3b')]===_0x07c5('0x12')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x42e221,_0x5e72dd['moduleCreate']);_0x13cbb2['LastName']=_0x37d78b!==_0x07c5('0x3c')?_0x37d78b:util[_0x07c5('0x3d')](_0x07c5('0x3e'),_0x42e221);}else if(_0x5e72dd['moduleCreate']==='lead'){logger[_0x07c5('0x1a')](_0x07c5('0x3f'),_0x42e221,_0x5e72dd[_0x07c5('0x3b')]);_0x13cbb2[_0x07c5('0x40')]=_0x37d78b!==''?_0x37d78b:util['format'](_0x07c5('0x3e'),_0x42e221);_0x13cbb2[_0x07c5('0x41')]=_0x07c5('0x42');}else if(_0x5e72dd[_0x07c5('0x3b')]===_0x07c5('0x15')){logger[_0x07c5('0x1a')](_0x07c5('0x3f'),_0x42e221,_0x5e72dd[_0x07c5('0x3b')]);_0x13cbb2[_0x07c5('0x22')]=_0x37d78b!==_0x07c5('0x3c')?_0x37d78b:util[_0x07c5('0x3d')](_0x07c5('0x3e'),_0x42e221);}else{return null;}}return _0x483302[_0x07c5('0x1c')](_['upperFirst'](_0x5e72dd['moduleCreate']))[_0x07c5('0x43')](_0x13cbb2)[_0x07c5('0x20')](function(_0x32e45b){return BPromise[_0x07c5('0x24')]({'id':_0x32e45b['id'],'endUserType':_0x5e72dd[_0x07c5('0x3b')]});});}});}function getCustomFields(_0x2ff602,_0x526b45){var _0x10d615={};if(_0x2ff602[_0x07c5('0x21')]>0x0){_[_0x07c5('0x44')](_0x2ff602,function(_0x4da9eb){if(_[_0x07c5('0x45')]([_0x07c5('0x46'),_0x07c5('0x47')],_0x4da9eb['type'])&&_0x4da9eb['idField']){_0x10d615[_0x4da9eb[_0x07c5('0x48')]]=_0x4da9eb[_0x07c5('0x49')]['toString']();}else if(_0x4da9eb['type']==='variable'&&_0x4da9eb['variableName']&&_0x4da9eb[_0x07c5('0x48')]){_0x526b45[_0x4da9eb[_0x07c5('0x4a')]]&&(_0x10d615[_0x4da9eb[_0x07c5('0x48')]]=_0x526b45[_0x4da9eb['variableName']][_0x07c5('0x4b')]());}else if(_0x4da9eb['type']===_0x07c5('0x4c')&&_0x4da9eb[_0x07c5('0x4d')]&&_0x4da9eb[_0x07c5('0x4d')][_0x07c5('0x4e')]&&_0x4da9eb[_0x07c5('0x48')]){_0x526b45[_0x4da9eb[_0x07c5('0x4d')][_0x07c5('0x4e')]['toLowerCase']()]&&(_0x10d615[_0x4da9eb[_0x07c5('0x48')]]=_0x526b45[_0x4da9eb[_0x07c5('0x4d')]['name'][_0x07c5('0x4f')]()][_0x07c5('0x4b')]());}});}return _0x10d615;}function getConnection(_0x177280){var _0x1af0a1=_0x177280[_0x07c5('0x50')][_0x07c5('0x51')](_0x177280[_0x07c5('0x52')]);var _0x2ec1ba=new jsforce['Connection']({'oauth2':{'loginUrl':_0x177280['remoteUri']||_0x07c5('0x53'),'clientId':_0x177280[_0x07c5('0x54')],'clientSecret':_0x177280[_0x07c5('0x55')]}});return _0x2ec1ba[_0x07c5('0x56')](_0x177280[_0x07c5('0x57')],_0x1af0a1)[_0x07c5('0x20')](function(){logger[_0x07c5('0x1a')](_0x07c5('0x58'));return _0x2ec1ba;});}exports[_0x07c5('0x59')]=function(_0x1e82d8,_0x1f924c,_0x157493,_0xaeb850,_0x3aed72,_0x4b7516){var _0x5ed720,_0x94d5f0,_0x14aea7,_0x4dc77a;_0x4b7516['serverUrl']=intUtil[_0x07c5('0x5a')](_0x4b7516['serverUrl']);_0x4b7516[_0x07c5('0x5b')]=intUtil['stripTrailingSlash'](_0x4b7516[_0x07c5('0x5b')]);if(_0x3aed72&&_0x3aed72[_0x07c5('0x5c')]){logger[_0x07c5('0x1a')](_0x07c5('0x5d'),_0x07c5('0x5e'));_0x1f924c[_0x07c5('0x5f')]=util[_0x07c5('0x3d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4b7516[_0x07c5('0x60')],_0x1f924c[_0x07c5('0x61')],md5(_0x1f924c[_0x07c5('0x61')]));}else{_0x1f924c[_0x07c5('0x5f')]='';}return getConnection(_0x4b7516)[_0x07c5('0x20')](function(_0x19e156){_0x4dc77a=_0x19e156;return getUser(_0x4b7516,_0xaeb850[_0x07c5('0x62')],_0x4dc77a);})['then'](function(_0x459c1c){_0x5ed720=_0x459c1c;return getEndUser(_0x4b7516,_0x157493,_0x1f924c[_0x07c5('0x63')],_0x1f924c[_0x07c5('0x64')],_0x4dc77a);})[_0x07c5('0x20')](function(_0x1d6f46){_0x94d5f0=_0x1d6f46;return getTicket(_0x4b7516,_0x5ed720,_0x94d5f0,_0x157493,_0x1f924c,_0x157493[_0x07c5('0x65')],_0x4dc77a,_0x07c5('0x59'));})['then'](function(_0x5b51d4){_0x14aea7=_0x5b51d4;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x14aea7['id']);logger[_0x07c5('0x1a')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x14aea7['id'],_0xaeb850[_0x07c5('0x4e')],_0x4b7516['type']);switch(_0x4b7516[_0x07c5('0x66')]){case _0x07c5('0x67'):emit(util[_0x07c5('0x3d')](_0x07c5('0x68'),_0xaeb850[_0x07c5('0x4e')]),_0x07c5('0x69'),{'recordId':_0x14aea7['id']});break;case'newTab':emit(util[_0x07c5('0x3d')](_0x07c5('0x68'),_0xaeb850[_0x07c5('0x4e')]),_0x07c5('0x6a'),{'uri':util['format'](_0x07c5('0x6b'),_0x4dc77a[_0x07c5('0x6c')],_0x14aea7['id'])});break;default:logger[_0x07c5('0x6d')](_0x07c5('0x6e'));}})[_0x07c5('0x6f')](function(_0x426fcd){logger[_0x07c5('0x6d')]('[QUEUE]',_0x426fcd);});};exports[_0x07c5('0x70')]=function(_0x36ac6,_0x57c142,_0x1cc1d4,_0x58d56f,_0xe0b629,_0x1c1c30,_0x34547c){var _0x2d47c4,_0x1fff47,_0xf6e6ad,_0xb3c22c;_0x1c1c30[_0x07c5('0x60')]=intUtil[_0x07c5('0x5a')](_0x1c1c30['serverUrl']);_0x1c1c30[_0x07c5('0x5b')]=intUtil[_0x07c5('0x5a')](_0x1c1c30[_0x07c5('0x5b')]);if(_0x34547c&&_0x34547c['recordingFormat']&&_0x34547c['recordingFormat']!==_0x07c5('0x71')){logger[_0x07c5('0x1a')](_0x07c5('0x72'),_0x07c5('0x5e'));_0x57c142['recordingURL']=util[_0x07c5('0x3d')](_0x07c5('0x73'),_0x1c1c30[_0x07c5('0x60')],_0x57c142['uniqueid'],md5(_0x57c142[_0x07c5('0x61')]));}return getConnection(_0x1c1c30)[_0x07c5('0x20')](function(_0xc4ef56){_0xb3c22c=_0xc4ef56;return getUser(_0x1c1c30,_0x58d56f[_0x07c5('0x62')],_0xb3c22c);})['then'](function(_0x383cfb){_0x2d47c4=_0x383cfb;return getEndUser(_0x1c1c30,_0x1cc1d4,_0x57c142[_0x07c5('0x74')],_0x57c142[_0x07c5('0x75')],_0xb3c22c);})[_0x07c5('0x20')](function(_0x199aa3){_0x1fff47=_0x199aa3;return getTicket(_0x1c1c30,_0x2d47c4,_0x1fff47,_0x1cc1d4,_0x57c142,_0x1cc1d4['Fields'],_0xb3c22c,_0x07c5('0x70'));})[_0x07c5('0x20')](function(_0x404622){_0xf6e6ad=_0x404622;logger[_0x07c5('0x1a')](_0x07c5('0x76'),_0xf6e6ad['id']);logger['info'](_0x07c5('0x77'),_0xf6e6ad['id'],_0x58d56f[_0x07c5('0x4e')],_0x1c1c30[_0x07c5('0x66')]);switch(_0x1c1c30['type']){case _0x07c5('0x67'):emit(util['format'](_0x07c5('0x68'),_0x58d56f[_0x07c5('0x4e')]),_0x07c5('0x69'),{'recordId':_0xf6e6ad['id']});break;case _0x07c5('0x78'):emit(util['format']('user:%s',_0x58d56f[_0x07c5('0x4e')]),_0x07c5('0x6a'),{'uri':util[_0x07c5('0x3d')](_0x07c5('0x6b'),_0xb3c22c['instanceUrl'],_0xf6e6ad['id'])});break;default:logger[_0x07c5('0x6d')](_0x07c5('0x72'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x07c5('0x6f')](function(_0x6e3f09){logger[_0x07c5('0x6d')](_0x07c5('0x72'),_0x6e3f09);});};exports[_0x07c5('0x79')]=function(_0x3d635f,_0x5e96e5,_0x3c83d7,_0x30f266,_0x329ab1,_0x225b7f){var _0x47098c,_0x222a0c,_0x585adf,_0x246ab1;_0x225b7f[_0x07c5('0x60')]=intUtil['stripTrailingSlash'](_0x225b7f[_0x07c5('0x60')]);_0x225b7f['remoteUri']=intUtil[_0x07c5('0x5a')](_0x225b7f[_0x07c5('0x5b')]);if(_0x329ab1&&_0x329ab1[_0x07c5('0x5c')]){logger['info']('['+_0x5e96e5[_0x07c5('0x7a')]['toUpperCase']()+']',_0x07c5('0x5e'));_0x5e96e5[_0x07c5('0x5f')]=util['format'](_0x07c5('0x73'),_0x225b7f[_0x07c5('0x60')],_0x5e96e5[_0x07c5('0x61')],md5(_0x5e96e5[_0x07c5('0x61')]));}else{_0x5e96e5['recordingURL']='';}return getConnection(_0x225b7f)['then'](function(_0x216cb0){_0x246ab1=_0x216cb0;if(!_[_0x07c5('0x7b')](_0x30f266)){return getUser(_0x225b7f,_0x30f266[_0x07c5('0x4e')],_0x246ab1);}else{return getUser(_0x225b7f,null,_0x246ab1);}})[_0x07c5('0x20')](function(_0x5f3347){_0x47098c=_0x5f3347;return getEndUser(_0x225b7f,_0x3c83d7,_0x5e96e5[_0x07c5('0x63')],_0x5e96e5[_0x07c5('0x64')],_0x246ab1);})[_0x07c5('0x20')](function(_0x47992b){_0x222a0c=_0x47992b;return getTicket(_0x225b7f,_0x47098c,_0x222a0c,_0x3c83d7,_0x5e96e5,_0x3c83d7[_0x07c5('0x65')],_0x246ab1);})['then'](function(_0xf8a602){_0x585adf=_0xf8a602;logger[_0x07c5('0x1a')]('['+_0x5e96e5[_0x07c5('0x7a')][_0x07c5('0x7c')]()+_0x07c5('0x7d'),_0x585adf['id']);logger['info']('['+_0x5e96e5['lastevent']['toUpperCase']()+_0x07c5('0x7e'),_0x225b7f[_0x07c5('0x66')]);})[_0x07c5('0x6f')](function(_0x14ac12){logger[_0x07c5('0x6d')]('['+_0x5e96e5[_0x07c5('0x7a')][_0x07c5('0x7c')]()+']',_0x14ac12);});}; \ No newline at end of file +var _0x066e=['isNil','validateEmail','User','find','execute','then','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','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','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','idField','toString','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','lastevent','toUpperCase','calleridnum',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','assign','getString','Subjects','Descriptions','ticketType','ActivityDate','utc','IsRecurrence','contact','endUserType','WhoId','account','Case','ContactId','lead','leadId','sobject'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x066e,0x1d7));var _0xe066=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x066e[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0xe066('0x0'));var rp=require(_0xe066('0x1'));var moment=require('moment');var BPromise=require(_0xe066('0x2'));var md5=require('md5');var jsforce=require(_0xe066('0x3'));var util=require(_0xe066('0x4'));var Redis=require(_0xe066('0x5'));var intUtil=require(_0xe066('0x6'));var config=require(_0xe066('0x7'));var logger=require('../../../../config/logger')(_0xe066('0x8'));config[_0xe066('0x9')]=_[_0xe066('0xa')](config[_0xe066('0x9')],{'host':_0xe066('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe066('0x9')]));function emit(_0x322fdf,_0x3714dc,_0x1dc242){io['to'](_0x322fdf)['emit'](_0x3714dc,_0x1dc242);}function getTicket(_0x324d8e,_0x51ae4f,_0x46f18b,_0x4b361e,_0x231e53,_0x43c179,_0x2cb9bc,_0x1077cc){var _0x104b34=Object[_0xe066('0xc')]({},{'OwnerId':_0x51ae4f['id'],'Subject':intUtil[_0xe066('0xd')](_0x4b361e[_0xe066('0xe')],_0x231e53,'\x20'),'Description':intUtil[_0xe066('0xd')](_0x4b361e[_0xe066('0xf')],_0x231e53,'\x0a')},getCustomFields(_0x43c179,_0x231e53));if(_0x46f18b){if(_0x4b361e[_0xe066('0x10')]==='Task'){_0x104b34[_0xe066('0x11')]=moment[_0xe066('0x12')]();_0x104b34['IsReminderSet']=![];_0x104b34[_0xe066('0x13')]=![];if(_0x46f18b['endUserType']===_0xe066('0x14')||_0x46f18b[_0xe066('0x15')]==='lead'){_0x104b34[_0xe066('0x16')]=_0x46f18b['id'];}else if(_0x46f18b['endUserType']===_0xe066('0x17')){_0x104b34['WhatId']=_0x46f18b['id'];}}else if(_0x4b361e[_0xe066('0x10')]===_0xe066('0x18')){if(_0x46f18b['endUserType']==='contact'){_0x104b34[_0xe066('0x19')]=_0x46f18b['id'];}else if(_0x46f18b[_0xe066('0x15')]===_0xe066('0x17')){_0x104b34['AccountId']=_0x46f18b['id'];}else if(_0x46f18b[_0xe066('0x15')]===_0xe066('0x1a')&&_0x4b361e[_0xe066('0x1b')]){_0x104b34[_0x4b361e[_0xe066('0x1b')]]=_0x46f18b['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x2cb9bc[_0xe066('0x1c')](_0x4b361e['ticketType'])['create'](_0x104b34);}function getUser(_0x3056ed,_0x21deb6,_0x4f6d47){if(!_[_0xe066('0x1d')](_0x21deb6)&&intUtil[_0xe066('0x1e')](_0x21deb6)){var _0x21c01d={'Email':_0x21deb6};var _0x2e88e5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4f6d47['sobject'](_0xe066('0x1f'))[_0xe066('0x20')](_0x21c01d,_0x2e88e5)[_0xe066('0x21')]()[_0xe066('0x22')](function(_0x2e6aec){if(_0x2e6aec['length']){var _0x2be0aa=_[_0xe066('0x20')](_0x2e6aec,function(_0x3cd483){return _0x3cd483[_0xe066('0x23')]===_0x21deb6;});if(_0x2be0aa){logger['info']('Agent\x20%s\x20found.',_0x21deb6);return BPromise[_0xe066('0x24')]({'id':_0x2be0aa['Id'],'name':_0x2be0aa[_0xe066('0x25')]});}}else{logger[_0xe066('0x26')](_0xe066('0x27'),_0x21deb6);return _0x4f6d47['identity']()[_0xe066('0x22')](function(_0x56059a){return BPromise[_0xe066('0x24')]({'id':_0x56059a[_0xe066('0x28')],'name':_0x56059a[_0xe066('0x29')]});});}});}else{logger[_0xe066('0x26')](_0xe066('0x27'),_0x21deb6);return _0x4f6d47['identity']()['then'](function(_0x2b3ba3){return BPromise[_0xe066('0x24')]({'id':_0x2b3ba3[_0xe066('0x28')],'name':_0x2b3ba3[_0xe066('0x29')]});});}}function getEndUser(_0x16df98,_0x483b29,_0x387c8b,_0x3667d5,_0xe94c1){var _0xed1e14={'$or':{'Phone':_0x3667d5}};var _0x50528a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger[_0xe066('0x26')](_0xe066('0x2a'),_0x3667d5,_0x483b29[_0xe066('0x2b')]);switch(_0x483b29[_0xe066('0x2b')]){case _0xe066('0x2c'):var _0x49f1af=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29['additionalSearchContact']){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x2e')]]=_0x3667d5;_[_0xe066('0x2f')](_0x49f1af[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x31'))[_0xe066('0x20')](_0x49f1af,_0x50528a)[_0xe066('0x21')]()[_0xe066('0x22')](function(_0x43385c){if(_0x43385c&&_0x43385c[_0xe066('0x32')]){return _0x43385c;}else{var _0x29faa1=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x33')]){var _0x501ca1={};_0x501ca1[_0x483b29[_0xe066('0x33')]]=_0x3667d5;_[_0xe066('0x2f')](_0x29faa1[_0xe066('0x30')],_0x501ca1);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x34'))[_0xe066('0x20')](_0x29faa1,_0x50528a);}});case _0xe066('0x35'):var _0xd1b4fa=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x36')]){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x36')]]=_0x3667d5;_[_0xe066('0x2f')](_0xd1b4fa[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x37'))[_0xe066('0x20')](_0xd1b4fa,_0x50528a)[_0xe066('0x21')]()[_0xe066('0x22')](function(_0x5a5090){if(_0x5a5090&&_0x5a5090[_0xe066('0x32')]){return _0x5a5090;}else{var _0x56afb3=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x2e')]){var _0x4e21d0={};_0x4e21d0[_0x483b29[_0xe066('0x2e')]]=_0x3667d5;_[_0xe066('0x2f')](_0x56afb3['$or'],_0x4e21d0);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x31'))[_0xe066('0x20')](_0x56afb3,_0x50528a)['then'](function(_0x2f3424){if(_0x2f3424&&_0x2f3424[_0xe066('0x32')]){return _0x2f3424;}else{var _0x305f98=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29['additionalSearchLead']){var _0x4a9cc4={};_0x4a9cc4[_0x483b29[_0xe066('0x33')]]=_0x3667d5;_[_0xe066('0x2f')](_0x305f98[_0xe066('0x30')],_0x4a9cc4);}return _0xe94c1[_0xe066('0x1c')](_0xe066('0x34'))[_0xe066('0x20')](_0x305f98,_0x50528a);}});}});case'contact':var _0x49f1af=_['cloneDeep'](_0xed1e14);if(_0x483b29[_0xe066('0x2e')]){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x2e')]]=_0x3667d5;_[_0xe066('0x2f')](_0x49f1af[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x31'))[_0xe066('0x20')](_0x49f1af,_0x50528a)['execute']();case _0xe066('0x1a'):var _0x389fd7=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x33')]){var _0x54ddc8={};_0x54ddc8[_0x483b29[_0xe066('0x33')]]=_0x3667d5;_[_0xe066('0x2f')](_0x389fd7[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x34'))['find'](_0x389fd7,_0x50528a);case _0xe066('0x17'):var _0xd1b4fa=_[_0xe066('0x2d')](_0xed1e14);if(_0x483b29[_0xe066('0x36')]){var _0x54ddc8={};_0x54ddc8[_0x483b29['additionalSearchAccount']]=_0x3667d5;_[_0xe066('0x2f')](_0xd1b4fa[_0xe066('0x30')],_0x54ddc8);}return _0xe94c1['sobject'](_0xe066('0x37'))[_0xe066('0x20')](_0xd1b4fa,_0x50528a);default:return null;}})[_0xe066('0x22')](function(_0x30ca7f){if(_0x30ca7f&&_0x30ca7f[_0xe066('0x32')]){var _0x3ee8ff=_[_0xe066('0x38')](_0x30ca7f);if(_0x3ee8ff){return BPromise['resolve']({'id':_0x3ee8ff['Id'],'name':_0x3ee8ff[_0xe066('0x25')],'phone':_0x3ee8ff['Phone'],'endUserType':_0x3ee8ff[_0xe066('0x39')][_0xe066('0x3a')][_0xe066('0x3b')]()});}}})[_0xe066('0x22')](function(_0x50ded2){if(_0x50ded2){logger[_0xe066('0x26')](_0xe066('0x3c'),_0x50ded2['endUserType'],_0x3667d5);return BPromise[_0xe066('0x24')](_0x50ded2);}else{logger[_0xe066('0x26')](_0xe066('0x3d'),_0x3667d5);var _0x4f03e9={'Phone':_0x3667d5};if(_0x483b29[_0xe066('0x3e')]){if(_0x483b29['moduleCreate']===_0xe066('0x14')){logger['info'](_0xe066('0x3f'),_0x3667d5,_0x483b29['moduleCreate']);_0x4f03e9[_0xe066('0x40')]=_0x387c8b!==_0xe066('0x41')?_0x387c8b:util[_0xe066('0x42')](_0xe066('0x43'),_0x3667d5);}else if(_0x483b29[_0xe066('0x3e')]===_0xe066('0x1a')){logger[_0xe066('0x26')](_0xe066('0x3f'),_0x3667d5,_0x483b29['moduleCreate']);_0x4f03e9[_0xe066('0x40')]=_0x387c8b!==_0xe066('0x41')?_0x387c8b:util[_0xe066('0x42')]('Caller\x20-\x20%s',_0x3667d5);_0x4f03e9[_0xe066('0x44')]=_0xe066('0x45');}else if(_0x483b29['moduleCreate']===_0xe066('0x17')){logger[_0xe066('0x26')](_0xe066('0x3f'),_0x3667d5,_0x483b29[_0xe066('0x3e')]);_0x4f03e9[_0xe066('0x25')]=_0x387c8b!==_0xe066('0x41')?_0x387c8b:util[_0xe066('0x42')]('Caller\x20-\x20%s',_0x3667d5);}else{return null;}}return _0xe94c1[_0xe066('0x1c')](_[_0xe066('0x46')](_0x483b29[_0xe066('0x3e')]))[_0xe066('0x47')](_0x4f03e9)[_0xe066('0x22')](function(_0x537670){return BPromise['resolve']({'id':_0x537670['id'],'endUserType':_0x483b29[_0xe066('0x3e')]});});}});}function getCustomFields(_0x2f5e0c,_0x4a1485){var _0x185b03={};if(_0x2f5e0c[_0xe066('0x32')]>0x0){_[_0xe066('0x48')](_0x2f5e0c,function(_0x3c895d){if(_[_0xe066('0x49')](['string','picklist'],_0x3c895d[_0xe066('0x3a')])&&_0x3c895d[_0xe066('0x4a')]){_0x185b03[_0x3c895d['idField']]=_0x3c895d['content'][_0xe066('0x4b')]();}else if(_0x3c895d[_0xe066('0x3a')]==='variable'&&_0x3c895d[_0xe066('0x4c')]&&_0x3c895d['idField']){_0x4a1485[_0x3c895d[_0xe066('0x4c')]]&&(_0x185b03[_0x3c895d[_0xe066('0x4a')]]=_0x4a1485[_0x3c895d[_0xe066('0x4c')]]['toString']());}else if(_0x3c895d[_0xe066('0x3a')]===_0xe066('0x4d')&&_0x3c895d[_0xe066('0x4e')]&&_0x3c895d['Variable']['name']&&_0x3c895d[_0xe066('0x4a')]){_0x4a1485[_0x3c895d[_0xe066('0x4e')][_0xe066('0x4f')]['toLowerCase']()]&&(_0x185b03[_0x3c895d['idField']]=_0x4a1485[_0x3c895d[_0xe066('0x4e')][_0xe066('0x4f')][_0xe066('0x3b')]()][_0xe066('0x4b')]());}});}return _0x185b03;}function getConnection(_0xf7c68d){var _0x420bf3=_0xf7c68d[_0xe066('0x50')][_0xe066('0x51')](_0xf7c68d[_0xe066('0x52')]);var _0x5e3ef1=new jsforce[(_0xe066('0x53'))]({'oauth2':{'loginUrl':_0xf7c68d[_0xe066('0x54')]||'https://login.salesforce.com','clientId':_0xf7c68d[_0xe066('0x55')],'clientSecret':_0xf7c68d[_0xe066('0x56')]}});return _0x5e3ef1['login'](_0xf7c68d[_0xe066('0x57')],_0x420bf3)[_0xe066('0x22')](function(){logger['info'](_0xe066('0x58'));return _0x5e3ef1;});}exports[_0xe066('0x59')]=function(_0x309c87,_0x5a4c09,_0x5809c3,_0x471ab6,_0x537453,_0x4340cd){var _0x2ce67d,_0x7dd67a,_0x382a2f,_0x318340;_0x4340cd['serverUrl']=intUtil[_0xe066('0x5a')](_0x4340cd['serverUrl']);_0x4340cd[_0xe066('0x54')]=intUtil[_0xe066('0x5a')](_0x4340cd[_0xe066('0x54')]);if(_0x537453&&_0x537453['monitor_format']){logger[_0xe066('0x26')](_0xe066('0x5b'),'Recording\x20is\x20enabled!');_0x5a4c09[_0xe066('0x5c')]=util[_0xe066('0x42')](_0xe066('0x5d'),_0x4340cd[_0xe066('0x5e')],_0x5a4c09['uniqueid'],md5(_0x5a4c09[_0xe066('0x5f')]));}else{_0x5a4c09[_0xe066('0x5c')]='';}return getConnection(_0x4340cd)['then'](function(_0x5918e9){_0x318340=_0x5918e9;return getUser(_0x4340cd,_0x471ab6[_0xe066('0x60')],_0x318340);})['then'](function(_0x2e836f){_0x2ce67d=_0x2e836f;return getEndUser(_0x4340cd,_0x5809c3,_0x5a4c09[_0xe066('0x61')],_0x5a4c09['calleridnum'],_0x318340);})['then'](function(_0x45bbeb){_0x7dd67a=_0x45bbeb;return getTicket(_0x4340cd,_0x2ce67d,_0x7dd67a,_0x5809c3,_0x5a4c09,_0x5809c3['Fields'],_0x318340,_0xe066('0x59'));})[_0xe066('0x22')](function(_0x151b06){_0x382a2f=_0x151b06;logger['info'](_0xe066('0x62'),_0x382a2f['id']);logger[_0xe066('0x26')](_0xe066('0x63'),_0x382a2f['id'],_0x471ab6[_0xe066('0x4f')],_0x4340cd[_0xe066('0x3a')]);switch(_0x4340cd[_0xe066('0x3a')]){case _0xe066('0x64'):emit(util['format'](_0xe066('0x65'),_0x471ab6[_0xe066('0x4f')]),_0xe066('0x66'),{'recordId':_0x382a2f['id']});break;case _0xe066('0x67'):emit(util[_0xe066('0x42')](_0xe066('0x65'),_0x471ab6[_0xe066('0x4f')]),_0xe066('0x68'),{'uri':util['format']('%s/%s/e',_0x318340[_0xe066('0x69')],_0x382a2f['id'])});break;default:logger['error'](_0xe066('0x6a'));}})[_0xe066('0x6b')](function(_0x17258f){logger[_0xe066('0x6c')](_0xe066('0x5b'),_0x17258f);});};exports[_0xe066('0x6d')]=function(_0x2cd770,_0x407e79,_0x3811ba,_0x286878,_0x122fcc,_0x1f80bc,_0x3bb42c){var _0x11f6c6,_0x2b7f76,_0x16441f,_0x3af394;_0x1f80bc['serverUrl']=intUtil[_0xe066('0x5a')](_0x1f80bc['serverUrl']);_0x1f80bc[_0xe066('0x54')]=intUtil[_0xe066('0x5a')](_0x1f80bc[_0xe066('0x54')]);if(_0x3bb42c&&_0x3bb42c[_0xe066('0x6e')]&&_0x3bb42c[_0xe066('0x6e')]!=='none'){logger[_0xe066('0x26')](_0xe066('0x6f'),_0xe066('0x70'));_0x407e79[_0xe066('0x5c')]=util[_0xe066('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f80bc[_0xe066('0x5e')],_0x407e79['uniqueid'],md5(_0x407e79['uniqueid']));}return getConnection(_0x1f80bc)[_0xe066('0x22')](function(_0x402425){_0x3af394=_0x402425;return getUser(_0x1f80bc,_0x286878[_0xe066('0x60')],_0x3af394);})[_0xe066('0x22')](function(_0x2a2c8f){_0x11f6c6=_0x2a2c8f;return getEndUser(_0x1f80bc,_0x3811ba,_0x407e79[_0xe066('0x71')],_0x407e79[_0xe066('0x72')],_0x3af394);})['then'](function(_0x437bf2){_0x2b7f76=_0x437bf2;return getTicket(_0x1f80bc,_0x11f6c6,_0x2b7f76,_0x3811ba,_0x407e79,_0x3811ba[_0xe066('0x73')],_0x3af394,_0xe066('0x6d'));})[_0xe066('0x22')](function(_0x12e301){_0x16441f=_0x12e301;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x16441f['id']);logger[_0xe066('0x26')](_0xe066('0x74'),_0x16441f['id'],_0x286878[_0xe066('0x4f')],_0x1f80bc[_0xe066('0x3a')]);switch(_0x1f80bc['type']){case _0xe066('0x64'):emit(util[_0xe066('0x42')]('user:%s',_0x286878[_0xe066('0x4f')]),_0xe066('0x66'),{'recordId':_0x16441f['id']});break;case'newTab':emit(util[_0xe066('0x42')](_0xe066('0x65'),_0x286878[_0xe066('0x4f')]),_0xe066('0x68'),{'uri':util[_0xe066('0x42')](_0xe066('0x75'),_0x3af394[_0xe066('0x69')],_0x16441f['id'])});break;default:logger[_0xe066('0x6c')](_0xe066('0x6f'),_0xe066('0x76'));}})[_0xe066('0x6b')](function(_0x1b2bde){logger[_0xe066('0x6c')](_0xe066('0x6f'),_0x1b2bde);});};exports['unmanaged']=function(_0x253d99,_0x4ae8a7,_0x164061,_0x509457,_0x4d31ec,_0x25f9f8){var _0x4ecef0,_0x4b0e3f,_0x5b93ee,_0x9e56fb;_0x25f9f8[_0xe066('0x5e')]=intUtil['stripTrailingSlash'](_0x25f9f8[_0xe066('0x5e')]);_0x25f9f8[_0xe066('0x54')]=intUtil[_0xe066('0x5a')](_0x25f9f8[_0xe066('0x54')]);if(_0x4d31ec&&_0x4d31ec[_0xe066('0x77')]){logger[_0xe066('0x26')]('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+']',_0xe066('0x70'));_0x4ae8a7['recordingURL']=util['format'](_0xe066('0x5d'),_0x25f9f8['serverUrl'],_0x4ae8a7['uniqueid'],md5(_0x4ae8a7['uniqueid']));}else{_0x4ae8a7[_0xe066('0x5c')]='';}return getConnection(_0x25f9f8)['then'](function(_0x25ab95){_0x9e56fb=_0x25ab95;if(!_[_0xe066('0x1d')](_0x509457)){return getUser(_0x25f9f8,_0x509457[_0xe066('0x4f')],_0x9e56fb);}else{return getUser(_0x25f9f8,null,_0x9e56fb);}})['then'](function(_0x14e4c6){_0x4ecef0=_0x14e4c6;return getEndUser(_0x25f9f8,_0x164061,_0x4ae8a7[_0xe066('0x61')],_0x4ae8a7[_0xe066('0x7a')],_0x9e56fb);})[_0xe066('0x22')](function(_0x150f7a){_0x4b0e3f=_0x150f7a;return getTicket(_0x25f9f8,_0x4ecef0,_0x4b0e3f,_0x164061,_0x4ae8a7,_0x164061[_0xe066('0x73')],_0x9e56fb);})[_0xe066('0x22')](function(_0x811301){_0x5b93ee=_0x811301;logger['info']('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+_0xe066('0x7b'),_0x5b93ee['id']);logger['info']('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+_0xe066('0x7c'),_0x25f9f8['type']);})[_0xe066('0x6b')](function(_0x1a4e83){logger[_0xe066('0x6c')]('['+_0x4ae8a7[_0xe066('0x78')][_0xe066('0x79')]()+']',_0x1a4e83);});}; \ 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 c7347b2..3600356 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 _0x430c=['map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','true','userId','adminEmail','error','POST','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','includes','string','picklist','type','customField','content','toString','idField','variableName','Variable','name','toLowerCase',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','forEach','Tags'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x430c,0x156));var _0xc430=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x430c[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0xc430('0x0'));var Promise=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var util=require('util');var md5=require(_0xc430('0x3'));var Redis=require(_0xc430('0x4'));var intUtil=require(_0xc430('0x5'));var config=require(_0xc430('0x6'));var logger=require('../../../../config/logger')('servicenow');config[_0xc430('0x7')]=_[_0xc430('0x8')](config['redis'],{'host':_0xc430('0x9'),'port':0x18eb});var io=require(_0xc430('0xa'))(new Redis(config[_0xc430('0x7')]));function getAdminUser(_0x1cdbca,_0x90f451,_0x28d59c,_0x401d2d,_0x542a8d,_0x32b16a){return new Promise(function(_0x5415b9,_0x5aa1f7){var _0x180c30={'method':_0xc430('0xb'),'uri':_0x401d2d+_0xc430('0xc')+'&'+_0x542a8d+'&'+_0x32b16a,'auth':_0x90f451,'json':!![]};return rp(_0x180c30)[_0xc430('0xd')](function(_0x537d6d){if(_0x537d6d[_0xc430('0xe')][_0xc430('0xf')]>0x0){_0x28d59c[_0xc430('0x10')]=_0x537d6d[_0xc430('0xe')][0x0][_0xc430('0x11')];}logger['info']('['+[_0x1cdbca[_0xc430('0x12')]()]+_0xc430('0x13'),_0x28d59c);_0x5415b9(_0x28d59c);})[_0xc430('0x14')](function(_0x5831f2){logger['error']('['+[_0x1cdbca[_0xc430('0x12')]()]+']',_0x5831f2[_0xc430('0x15')]);_0x5aa1f7(_0x5831f2[_0xc430('0x15')]);});});}function getUser(_0x573df2,_0x5d4766,_0x503ca5,_0x325325,_0x32b48c){return function(_0x1fcc9f){logger[_0xc430('0x16')]('['+[_0x573df2[_0xc430('0x12')]()]+_0xc430('0x17'),_0x1fcc9f);return new Promise(function(_0x35f29c,_0x4ab1fd){if(intUtil['validateEmail'](_0x1fcc9f['userEmail'])){var _0x485e72={'method':'GET','uri':_0x503ca5+_0xc430('0x18')+_0x1fcc9f[_0xc430('0x19')]+'&'+_0x325325+'&'+_0x32b48c,'auth':_0x5d4766,'json':!![]};logger[_0xc430('0x16')]('['+[_0x573df2[_0xc430('0x12')]()]+_0xc430('0x1a'),_0x485e72);return rp(_0x485e72)[_0xc430('0xd')](function(_0x160bb2){logger[_0xc430('0x16')]('['+[_0x573df2[_0xc430('0x12')]()]+'],\x20getUser\x20entity',_0x160bb2);if(_0x160bb2['result'][_0xc430('0xf')]>0x0&&String(_0x160bb2[_0xc430('0xe')][0x0]['active'])===_0xc430('0x1b')){_0x1fcc9f[_0xc430('0x1c')]=_0x160bb2[_0xc430('0xe')][0x0]['sys_id'];}else{_0x1fcc9f[_0xc430('0x1c')]=_0x1fcc9f[_0xc430('0x10')];_0x1fcc9f[_0xc430('0x19')]=_0x1fcc9f[_0xc430('0x1d')];}logger[_0xc430('0x16')]('['+[_0x573df2[_0xc430('0x12')]()]+'],\x20getUser\x20crm',_0x1fcc9f);_0x35f29c(_0x1fcc9f);})[_0xc430('0x14')](function(_0x499497){logger[_0xc430('0x1e')]('['+[_0x573df2['toUpperCase']()]+']',_0x499497[_0xc430('0x15')]);_0x4ab1fd(_0x499497['message']);});}else{logger['info']('['+[_0x573df2[_0xc430('0x12')]()]+']\x20using\x20admin\x20profile');_0x1fcc9f[_0xc430('0x1c')]=_0x1fcc9f['adminId'];_0x1fcc9f['userEmail']=_0x1fcc9f[_0xc430('0x1d')];_0x35f29c(_0x1fcc9f);}});};}function createEndUser(_0x381fff,_0x4a4e85,_0xce13f,_0x3e480d,_0x527804){logger[_0xc430('0x16')]('['+[_0x381fff[_0xc430('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0xce13f);return new Promise(function(_0x373170,_0x46170a){var _0x5739ad={'method':_0xc430('0x1f'),'uri':_0x3e480d+'sys_user?'+_0x527804,'body':{'user_name':_0xce13f['endUserNumber'],'roles':'user','first_name':_0xce13f[_0xc430('0x20')],'active':'true','date_format':_0xc430('0x21'),'phone':_0xce13f[_0xc430('0x20')]},'auth':_0x4a4e85,'json':!![]};return rp(_0x5739ad)[_0xc430('0xd')](function(_0x1a3aa8){logger[_0xc430('0x16')]('['+[_0x381fff['toUpperCase']()]+_0xc430('0x22'),_0x1a3aa8[_0xc430('0xe')]);_0xce13f[_0xc430('0x23')]=_0x1a3aa8['result'][_0xc430('0x11')];_0x373170(_0xce13f);})[_0xc430('0x14')](function(_0x4ba212){logger[_0xc430('0x1e')]('['+[_0x381fff[_0xc430('0x12')]()]+']',_0x4ba212[_0xc430('0x15')]);_0x46170a(_0x4ba212[_0xc430('0x15')]);});});}function getEndUser(_0x52bc5f,_0x2586e8,_0x48819e,_0x5dc790,_0xd97906){return function(_0xcc1156){logger[_0xc430('0x16')]('['+[_0x52bc5f['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0xcc1156);return new Promise(function(_0x5105e3,_0x13faa4){var _0xd5b507={'method':'GET','uri':_0x48819e+_0xc430('0x24')+_0xcc1156[_0xc430('0x20')]+'&'+_0x5dc790+'&'+_0xd97906,'auth':_0x2586e8,'json':!![]};return rp(_0xd5b507)['then'](function(_0x4c28d5){if(_0x4c28d5[_0xc430('0xe')][_0xc430('0xf')]>0x0){_0xcc1156[_0xc430('0x23')]=_0x4c28d5[_0xc430('0xe')][0x0]['sys_id'];logger[_0xc430('0x16')]('['+[_0x52bc5f[_0xc430('0x12')]()]+_0xc430('0x25'),_0xcc1156);_0x5105e3(_0xcc1156);}else{return createEndUser(_0x52bc5f,_0x2586e8,_0xcc1156,_0x48819e,_0x5dc790)[_0xc430('0xd')](function(_0x120a90){logger['info']('['+[_0x52bc5f[_0xc430('0x12')]()]+'],\x20createEndUser\x20crm',_0x120a90);_0x5105e3(_0x120a90);});}})[_0xc430('0x14')](function(_0x162db8){logger['error']('['+[_0x52bc5f[_0xc430('0x12')]()]+']',_0x162db8[_0xc430('0x15')]);_0x13faa4(_0x162db8[_0xc430('0x15')]);});});};}function getCustomFields(_0x97002b,_0x3ed33f){var _0x336461={};if(_0x97002b['length']>0x0){_['forEach'](_0x97002b,function(_0x12ac99){if(_[_0xc430('0x26')]([_0xc430('0x27'),_0xc430('0x28')],_0x12ac99[_0xc430('0x29')])&&_0x12ac99['nameField']&&!_0x12ac99[_0xc430('0x2a')]){_0x336461[_0x12ac99['nameField']['toLowerCase']()]=_0x12ac99[_0xc430('0x2b')][_0xc430('0x2c')]();}else if(_[_0xc430('0x26')]([_0xc430('0x27'),_0xc430('0x28')],_0x12ac99['type'])&&_0x12ac99['idField']&&_0x12ac99['customField']){_0x336461[_0x12ac99[_0xc430('0x2d')]['toLowerCase']()]=_0x12ac99[_0xc430('0x2b')][_0xc430('0x2c')]();}else if(_0x12ac99[_0xc430('0x29')]==='variable'&&_0x12ac99[_0xc430('0x2e')]&&_0x12ac99['idField']&&_0x12ac99['customField']){_0x336461[_0x12ac99[_0xc430('0x2d')]['toLowerCase']()]=_0x3ed33f[_0x12ac99[_0xc430('0x2e')]][_0xc430('0x2c')]();}else if(_0x12ac99['type']==='customVariable'&&_0x12ac99[_0xc430('0x2f')]&&_0x12ac99['Variable'][_0xc430('0x30')]&&_0x12ac99['idField']&&_0x12ac99[_0xc430('0x2a')]){_0x336461[_0x12ac99[_0xc430('0x2d')][_0xc430('0x31')]()]=_0x3ed33f[_0x12ac99[_0xc430('0x2f')]['name'][_0xc430('0x31')]()]['toString']();}});}return _0x336461;}function getTicket(_0x268951,_0x54e9b6,_0x175410,_0x532acb,_0x2e17b5,_0x30f378){return function(_0x54f7bc){logger[_0xc430('0x16')]('['+[_0x268951[_0xc430('0x12')]()]+_0xc430('0x32'),_0x54f7bc);return new Promise(function(_0x24c6e2,_0x14c3c9){var _0x5a6e21=_0x268951['toLowerCase']()===_0xc430('0x33')?_0x54f7bc[_0xc430('0x1c')]:_0x54f7bc[_0xc430('0x23')];var _0xccfdff={'method':_0xc430('0x1f'),'uri':_0x175410+_0xc430('0x34')+'?'+_0x30f378,'body':Object['assign']({},{'active':_0xc430('0x1b'),'caller_id':_0x5a6e21,'assigned_to':_0x54f7bc[_0xc430('0x1c')],'short_description':intUtil[_0xc430('0x35')](_0x532acb[_0xc430('0x36')],_0x2e17b5,'\x20'),'description':intUtil[_0xc430('0x35')](_0x532acb[_0xc430('0x37')],_0x2e17b5,'\x0a')},getCustomFields(_0x532acb[_0xc430('0x38')],_0x2e17b5)),'auth':_0x54e9b6,'json':!![]};return rp(_0xccfdff)[_0xc430('0xd')](function(_0x4f744e){logger[_0xc430('0x16')]('['+[_0x268951[_0xc430('0x12')]()]+_0xc430('0x39'),_0x4f744e[_0xc430('0xe')]);_0x54f7bc[_0xc430('0x3a')]=_0x4f744e['result'][_0xc430('0x11')];_0x54f7bc[_0xc430('0x3b')]=_0x4f744e[_0xc430('0xe')][_0xc430('0x3c')];logger[_0xc430('0x16')]('['+[_0x268951[_0xc430('0x12')]()]+']\x20getTicket\x20crm',_0x54f7bc);_0x24c6e2(_0x54f7bc);})[_0xc430('0x14')](function(_0x3e60d5){logger[_0xc430('0x1e')]('['+[_0x268951[_0xc430('0x12')]()]+']',_0x3e60d5[_0xc430('0x15')]);_0x14c3c9(_0x3e60d5['message']);});});};}function createRemoteTag(_0x2197fb,_0x530a6b,_0x7f3974,_0x517a91){return new Promise(function(_0x2e2730,_0x1f86a3){var _0x3d31a5={'method':_0xc430('0x1f'),'uri':_0x7f3974+_0xc430('0x3d')+'?'+_0x517a91,'body':{'short_description':_0x2197fb,'global':!![],'active':!![],'name':_0x2197fb},'auth':_0x530a6b,'json':!![]};return rp(_0x3d31a5)['then'](function(_0x3a7840){var _0x10ac9c=_0x3a7840['result'][_0xc430('0x11')];_0x2e2730(_0x10ac9c);});});}function getRemoteTag(_0x1565a0,_0x34ae21,_0xd53420,_0x850d9b,_0x39648f){return new Promise(function(_0x2a0f88,_0x5662db){var _0x50d970={'method':'GET','uri':_0xd53420+'label'+_0xc430('0x3e')+_0x1565a0+'&'+_0x850d9b,'auth':_0x34ae21,'json':!![]};return rp(_0x50d970)[_0xc430('0xd')](function(_0x162262){if(_0x162262['result']['length']>0x0){var _0x4c57c0=_0x162262['result'][0x0][_0xc430('0x11')];_0x2a0f88(_0x4c57c0);}else{return createRemoteTag(_0x1565a0,_0x34ae21,_0xd53420,_0x850d9b)['then'](function(_0x1b569e){_0x2a0f88(_0x1b569e);});}});});}function assignTagToIncident(_0x3506ed,_0x26f7e8,_0x570765,_0x463a67,_0xe8e001){return new Promise(function(_0x18c83e,_0x35d261){var _0x2bab0f={'method':'POST','uri':_0x570765+_0xc430('0x3f')+'?'+_0xe8e001,'body':{'label':_0x3506ed,'table':'incident','id_type':_0xc430('0x40'),'table_key':_0x463a67[_0xc430('0x3a')],'title':_0xc430('0x41')+_0x463a67[_0xc430('0x3b')],'id_display':_0x463a67[_0xc430('0x3b')]},'auth':_0x26f7e8,'json':!![]};return rp(_0x2bab0f)['then'](function(_0x323e52){_0x18c83e();})['catch'](function(){_0x18c83e();});});}function manageTags(_0x45529c,_0x356349,_0x5a5e5c,_0x4b2cac,_0x2b2545,_0x6fdbe3,_0x15a3cc){return new Promise(function(_0x416ce0,_0xbc7d8d){var _0x19b130=[];_0x356349['forEach'](function(_0x512dff){_0x19b130[_0xc430('0x42')](getRemoteTag(_0x512dff,_0x5a5e5c,_0x4b2cac,_0x6fdbe3,_0x15a3cc));});return Promise[_0xc430('0x43')](_0x19b130)[_0xc430('0xd')](function(_0x568d72){if(_0x568d72[_0xc430('0xf')]){logger[_0xc430('0x16')]('['+[_0x45529c[_0xc430('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x568d72);var _0x7c4154=[];_0x568d72[_0xc430('0x44')](function(_0x2ac541){_0x7c4154['push'](assignTagToIncident(_0x2ac541,_0x5a5e5c,_0x4b2cac,_0x2b2545,_0x6fdbe3));});return Promise[_0xc430('0x43')](_0x7c4154)[_0xc430('0xd')](function(){_0x416ce0();})[_0xc430('0x14')](function(){_0x416ce0();});}else{_0x416ce0();}});});}function getTags(_0x94c4dd,_0x18aae6,_0x4bda39,_0x2c50b7,_0x3ef671,_0x245a45){return function(_0x4ae1ac){return new Promise(function(_0x47e5d8,_0x4f074c){var _0x37d271=[];var _0x51266c=_0x2c50b7[_0xc430('0x45')];if(_0x51266c&&_0x51266c[_0xc430('0xf')]>0x0){_0x37d271=_[_0xc430('0x46')](_0x51266c,'name');}if(_0x37d271[_0xc430('0xf')]>0x0){return manageTags(_0x94c4dd,_0x37d271,_0x18aae6,_0x4bda39,_0x4ae1ac,_0x3ef671,_0x245a45)[_0xc430('0xd')](function(){_0x47e5d8(_0x4ae1ac);});}else{_0x47e5d8(_0x4ae1ac);}});};}function emit(_0x50886c,_0x253ab7,_0x342746){var _0x5b873f=_0xc430('0x47')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xc430('0x48');var _0x3cd462={'uri':_0x50886c+_0xc430('0x49')+_0x342746+_0x5b873f};io['to'](util[_0xc430('0x4a')]('user:%s',_0x253ab7))[_0xc430('0x4b')](_0xc430('0x4c'),_0x3cd462);}exports['cs']=function(_0x203199,_0x3e4981,_0x3a9890,_0x172468,_0x465532,_0x4af454,_0x3a0816,_0x11b3ee){var _0x1518a9={};var _0x1b08e7={'user':_0x4af454[_0xc430('0x4d')],'pass':_0x4af454[_0xc430('0x4e')]};var _0x1b261e=_0xc430('0x4f');var _0x48d1e3='sysparm_display_value=true';_0x4af454['remoteUri']=intUtil[_0xc430('0x50')](_0x4af454[_0xc430('0x51')]);_0x4af454['serverUrl']=intUtil[_0xc430('0x50')](_0x4af454[_0xc430('0x52')]);var _0x2db275=util['format'](_0xc430('0x53'),_0x4af454[_0xc430('0x51')]);_0x1518a9[_0xc430('0x19')]=!_[_0xc430('0x54')](_0x172468)?_0x172468[_0xc430('0x55')]:null;_0x1518a9[_0xc430('0x1d')]=_0x4af454['email'];_0x1518a9[_0xc430('0x20')]=_0x11b3ee[_0xc430('0x31')]()==='outbound'?_0x3e4981['destcalleridnum']:_0x3e4981[_0xc430('0x56')];_0x1518a9[_0xc430('0x57')]=_0x11b3ee==='queue'||_0x11b3ee===_0xc430('0x58')?_0xc430('0x59'):'outbound';var _0x20be35=util[_0xc430('0x4a')](_0xc430('0x5a'),_0x4af454[_0xc430('0x52')],_0x3e4981[_0xc430('0x5b')],md5(_0x3e4981[_0xc430('0x5b')]));if(_0x465532&&_0x465532[_0xc430('0x5c')]){logger[_0xc430('0x16')](_0xc430('0x5d'),_0xc430('0x5e'));_0x3e4981[_0xc430('0x5f')]=_0x20be35;}else if(_0x3a0816&&_0x3a0816[_0xc430('0x60')]&&_0x3a0816['recordingFormat']!==_0xc430('0x61')){logger[_0xc430('0x16')](_0xc430('0x62'),'Recording\x20is\x20enabled!');_0x3e4981[_0xc430('0x5f')]=_0x20be35;}else{_0x3e4981[_0xc430('0x5f')]='';}return getAdminUser(_0x11b3ee,_0x1b08e7,_0x1518a9,_0x2db275,_0x48d1e3,_0x1b261e)[_0xc430('0xd')](getUser(_0x11b3ee,_0x1b08e7,_0x2db275,_0x48d1e3,_0x1b261e))['then'](getEndUser(_0x11b3ee,_0x1b08e7,_0x2db275,_0x48d1e3,_0x1b261e))['then'](getTicket(_0x11b3ee,_0x1b08e7,_0x2db275,_0x3a9890,_0x3e4981,_0x48d1e3))[_0xc430('0xd')](function(_0x436cf0){logger['info'](util['format'](_0xc430('0x63'),_0x436cf0[_0xc430('0x3a')]));logger['info'](util[_0xc430('0x4a')](_0xc430('0x64'),_0x11b3ee));if(_0x11b3ee!==_0xc430('0x58')){logger['info']('['+[_0x11b3ee['toUpperCase']()]+']',_0xc430('0x65'));emit(_0x4af454[_0xc430('0x51')],_0x172468[_0xc430('0x30')],_0x436cf0[_0xc430('0x3a')]);}})[_0xc430('0x14')](function(_0x5da638){logger[_0xc430('0x1e')]('['+[_0x11b3ee['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xc430('0x66')](_0x5da638,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5be9=[']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','format','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','error','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','string','type','customField','toLowerCase','includes','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number'];(function(_0x33d317,_0xfdea83){var _0xd573ec=function(_0x8ea285){while(--_0x8ea285){_0x33d317['push'](_0x33d317['shift']());}};_0xd573ec(++_0xfdea83);}(_0x5be9,0xfd));var _0x95be=function(_0x316ec4,_0x9eaedb){_0x316ec4=_0x316ec4-0x0;var _0x11915b=_0x5be9[_0x316ec4];return _0x11915b;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x95be('0x0'));var util=require(_0x95be('0x1'));var md5=require(_0x95be('0x2'));var Redis=require(_0x95be('0x3'));var intUtil=require('./util');var config=require(_0x95be('0x4'));var logger=require(_0x95be('0x5'))(_0x95be('0x6'));config['redis']=_['defaults'](config[_0x95be('0x7')],{'host':_0x95be('0x8'),'port':0x18eb});var io=require(_0x95be('0x9'))(new Redis(config[_0x95be('0x7')]));function getAdminUser(_0x347ad4,_0x47de1c,_0x2c7ae0,_0xd427f7,_0x35e215,_0x2d9240){return new Promise(function(_0x701dc,_0x22ce20){var _0x1ef9c7={'method':_0x95be('0xa'),'uri':_0xd427f7+_0x95be('0xb')+'&'+_0x35e215+'&'+_0x2d9240,'auth':_0x47de1c,'json':!![]};return rp(_0x1ef9c7)[_0x95be('0xc')](function(_0x58cf9b){if(_0x58cf9b[_0x95be('0xd')][_0x95be('0xe')]>0x0){_0x2c7ae0[_0x95be('0xf')]=_0x58cf9b[_0x95be('0xd')][0x0][_0x95be('0x10')];}logger['info']('['+[_0x347ad4[_0x95be('0x11')]()]+_0x95be('0x12'),_0x2c7ae0);_0x701dc(_0x2c7ae0);})[_0x95be('0x13')](function(_0x21b517){logger['error']('['+[_0x347ad4[_0x95be('0x11')]()]+']',_0x21b517[_0x95be('0x14')]);_0x22ce20(_0x21b517[_0x95be('0x14')]);});});}function getUser(_0x131f24,_0x394e7d,_0x51d03f,_0x504dce,_0x3e6e18){return function(_0x3d6323){logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x16'),_0x3d6323);return new Promise(function(_0x569792,_0x313272){if(intUtil[_0x95be('0x17')](_0x3d6323['userEmail'])){var _0x902e8e={'method':_0x95be('0xa'),'uri':_0x51d03f+_0x95be('0x18')+_0x3d6323[_0x95be('0x19')]+'&'+_0x504dce+'&'+_0x3e6e18,'auth':_0x394e7d,'json':!![]};logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x1a'),_0x902e8e);return rp(_0x902e8e)[_0x95be('0xc')](function(_0xdec38e){logger['info']('['+[_0x131f24['toUpperCase']()]+_0x95be('0x1b'),_0xdec38e);if(_0xdec38e[_0x95be('0xd')][_0x95be('0xe')]>0x0&&String(_0xdec38e[_0x95be('0xd')][0x0]['active'])===_0x95be('0x1c')){_0x3d6323[_0x95be('0x1d')]=_0xdec38e['result'][0x0][_0x95be('0x10')];}else{_0x3d6323[_0x95be('0x1d')]=_0x3d6323[_0x95be('0xf')];_0x3d6323[_0x95be('0x19')]=_0x3d6323[_0x95be('0x1e')];}logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x1f'),_0x3d6323);_0x569792(_0x3d6323);})[_0x95be('0x13')](function(_0x4f2d61){logger['error']('['+[_0x131f24[_0x95be('0x11')]()]+']',_0x4f2d61[_0x95be('0x14')]);_0x313272(_0x4f2d61[_0x95be('0x14')]);});}else{logger[_0x95be('0x15')]('['+[_0x131f24[_0x95be('0x11')]()]+_0x95be('0x20'));_0x3d6323[_0x95be('0x1d')]=_0x3d6323[_0x95be('0xf')];_0x3d6323[_0x95be('0x19')]=_0x3d6323[_0x95be('0x1e')];_0x569792(_0x3d6323);}});};}function createEndUser(_0x4bd30d,_0x135ba0,_0x4bba1b,_0x11c825,_0x512ec5){logger[_0x95be('0x15')]('['+[_0x4bd30d[_0x95be('0x11')]()]+_0x95be('0x21'),_0x4bba1b);return new Promise(function(_0x5f2659,_0x496319){var _0x1da3e5={'method':_0x95be('0x22'),'uri':_0x11c825+_0x95be('0x23')+_0x512ec5,'body':{'user_name':_0x4bba1b[_0x95be('0x24')],'roles':'user','first_name':_0x4bba1b['endUserNumber'],'active':_0x95be('0x1c'),'date_format':_0x95be('0x25'),'phone':_0x4bba1b[_0x95be('0x24')]},'auth':_0x135ba0,'json':!![]};return rp(_0x1da3e5)[_0x95be('0xc')](function(_0x49f8b5){logger[_0x95be('0x15')]('['+[_0x4bd30d[_0x95be('0x11')]()]+_0x95be('0x26'),_0x49f8b5['result']);_0x4bba1b[_0x95be('0x27')]=_0x49f8b5[_0x95be('0xd')][_0x95be('0x10')];_0x5f2659(_0x4bba1b);})[_0x95be('0x13')](function(_0x5e1a81){logger[_0x95be('0x28')]('['+[_0x4bd30d[_0x95be('0x11')]()]+']',_0x5e1a81[_0x95be('0x14')]);_0x496319(_0x5e1a81[_0x95be('0x14')]);});});}function getEndUser(_0x192c53,_0x47df2d,_0x2b83ea,_0x33a4f0,_0x4123a5){return function(_0x5a3f7e){logger[_0x95be('0x15')]('['+[_0x192c53[_0x95be('0x11')]()]+_0x95be('0x29'),_0x5a3f7e);return new Promise(function(_0x104168,_0xdc229d){var _0xa6fdf4={'method':_0x95be('0xa'),'uri':_0x2b83ea+_0x95be('0x2a')+_0x5a3f7e['endUserNumber']+'&'+_0x33a4f0+'&'+_0x4123a5,'auth':_0x47df2d,'json':!![]};return rp(_0xa6fdf4)['then'](function(_0x2ede52){if(_0x2ede52[_0x95be('0xd')][_0x95be('0xe')]>0x0){_0x5a3f7e['endUserId']=_0x2ede52[_0x95be('0xd')][0x0][_0x95be('0x10')];logger[_0x95be('0x15')]('['+[_0x192c53[_0x95be('0x11')]()]+'],\x20getEndUser\x20crm',_0x5a3f7e);_0x104168(_0x5a3f7e);}else{return createEndUser(_0x192c53,_0x47df2d,_0x5a3f7e,_0x2b83ea,_0x33a4f0)[_0x95be('0xc')](function(_0x527c19){logger[_0x95be('0x15')]('['+[_0x192c53['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x527c19);_0x104168(_0x527c19);});}})[_0x95be('0x13')](function(_0x5938aa){logger[_0x95be('0x28')]('['+[_0x192c53[_0x95be('0x11')]()]+']',_0x5938aa[_0x95be('0x14')]);_0xdc229d(_0x5938aa[_0x95be('0x14')]);});});};}function getCustomFields(_0x186416,_0x4db845){var _0x4a28af={};if(_0x186416[_0x95be('0xe')]>0x0){_['forEach'](_0x186416,function(_0x5ee897){if(_['includes']([_0x95be('0x2b'),'picklist'],_0x5ee897[_0x95be('0x2c')])&&_0x5ee897['nameField']&&!_0x5ee897[_0x95be('0x2d')]){_0x4a28af[_0x5ee897['nameField'][_0x95be('0x2e')]()]=_0x5ee897['content']['toString']();}else if(_[_0x95be('0x2f')](['string',_0x95be('0x30')],_0x5ee897[_0x95be('0x2c')])&&_0x5ee897[_0x95be('0x31')]&&_0x5ee897[_0x95be('0x2d')]){_0x4a28af[_0x5ee897[_0x95be('0x31')][_0x95be('0x2e')]()]=_0x5ee897[_0x95be('0x32')][_0x95be('0x33')]();}else if(_0x5ee897[_0x95be('0x2c')]===_0x95be('0x34')&&_0x5ee897[_0x95be('0x35')]&&_0x5ee897['idField']&&_0x5ee897['customField']){_0x4a28af[_0x5ee897[_0x95be('0x31')][_0x95be('0x2e')]()]=_0x4db845[_0x5ee897[_0x95be('0x35')]][_0x95be('0x33')]();}else if(_0x5ee897[_0x95be('0x2c')]===_0x95be('0x36')&&_0x5ee897[_0x95be('0x37')]&&_0x5ee897[_0x95be('0x37')][_0x95be('0x38')]&&_0x5ee897[_0x95be('0x31')]&&_0x5ee897[_0x95be('0x2d')]){_0x4a28af[_0x5ee897[_0x95be('0x31')][_0x95be('0x2e')]()]=_0x4db845[_0x5ee897['Variable'][_0x95be('0x38')]['toLowerCase']()][_0x95be('0x33')]();}});}return _0x4a28af;}function getTicket(_0x5929d5,_0x54b6b9,_0x21ec48,_0x1045d6,_0x52aca8,_0x2331da){return function(_0x4896e4){logger['info']('['+[_0x5929d5['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x4896e4);return new Promise(function(_0x386aef,_0x558f21){var _0x3ad50f=_0x5929d5[_0x95be('0x2e')]()===_0x95be('0x39')?_0x4896e4[_0x95be('0x1d')]:_0x4896e4[_0x95be('0x27')];var _0x35a604={'method':'POST','uri':_0x21ec48+_0x95be('0x3a')+'?'+_0x2331da,'body':Object[_0x95be('0x3b')]({},{'active':_0x95be('0x1c'),'caller_id':_0x3ad50f,'assigned_to':_0x4896e4[_0x95be('0x1d')],'short_description':intUtil[_0x95be('0x3c')](_0x1045d6[_0x95be('0x3d')],_0x52aca8,'\x20'),'description':intUtil[_0x95be('0x3c')](_0x1045d6[_0x95be('0x3e')],_0x52aca8,'\x0a')},getCustomFields(_0x1045d6[_0x95be('0x3f')],_0x52aca8)),'auth':_0x54b6b9,'json':!![]};return rp(_0x35a604)['then'](function(_0x33ca78){logger[_0x95be('0x15')]('['+[_0x5929d5[_0x95be('0x11')]()]+_0x95be('0x40'),_0x33ca78[_0x95be('0xd')]);_0x4896e4[_0x95be('0x41')]=_0x33ca78[_0x95be('0xd')][_0x95be('0x10')];_0x4896e4[_0x95be('0x42')]=_0x33ca78[_0x95be('0xd')][_0x95be('0x43')];logger[_0x95be('0x15')]('['+[_0x5929d5[_0x95be('0x11')]()]+_0x95be('0x44'),_0x4896e4);_0x386aef(_0x4896e4);})[_0x95be('0x13')](function(_0x7f71ac){logger[_0x95be('0x28')]('['+[_0x5929d5[_0x95be('0x11')]()]+']',_0x7f71ac[_0x95be('0x14')]);_0x558f21(_0x7f71ac['message']);});});};}function createRemoteTag(_0x4fd5b7,_0x1fd509,_0x5e980b,_0xfd7f8e){return new Promise(function(_0x1ed19d,_0x21dfb7){var _0x1d4f5c={'method':_0x95be('0x22'),'uri':_0x5e980b+'label'+'?'+_0xfd7f8e,'body':{'short_description':_0x4fd5b7,'global':!![],'active':!![],'name':_0x4fd5b7},'auth':_0x1fd509,'json':!![]};return rp(_0x1d4f5c)[_0x95be('0xc')](function(_0x2cccd9){var _0xc199b8=_0x2cccd9[_0x95be('0xd')]['sys_id'];_0x1ed19d(_0xc199b8);});});}function getRemoteTag(_0x5e46b1,_0x2b08af,_0x15aec1,_0xc778f3,_0x1110aa){return new Promise(function(_0x48ec0c,_0x14c2f2){var _0x5acf30={'method':'GET','uri':_0x15aec1+_0x95be('0x45')+_0x95be('0x46')+_0x5e46b1+'&'+_0xc778f3,'auth':_0x2b08af,'json':!![]};return rp(_0x5acf30)['then'](function(_0x281ef1){if(_0x281ef1['result']['length']>0x0){var _0x5081a8=_0x281ef1['result'][0x0]['sys_id'];_0x48ec0c(_0x5081a8);}else{return createRemoteTag(_0x5e46b1,_0x2b08af,_0x15aec1,_0xc778f3)[_0x95be('0xc')](function(_0x3fb3a2){_0x48ec0c(_0x3fb3a2);});}});});}function assignTagToIncident(_0x12c504,_0x2a1822,_0x5b4edc,_0x370423,_0x1b32cc){return new Promise(function(_0x2a7cc5,_0x3317eb){var _0x227f86={'method':_0x95be('0x22'),'uri':_0x5b4edc+'label_entry'+'?'+_0x1b32cc,'body':{'label':_0x12c504,'table':_0x95be('0x3a'),'id_type':_0x95be('0x47'),'table_key':_0x370423['ticketId'],'title':'Incident\x20-\x20'+_0x370423['ticketNumber'],'id_display':_0x370423[_0x95be('0x42')]},'auth':_0x2a1822,'json':!![]};return rp(_0x227f86)[_0x95be('0xc')](function(_0x1ec558){_0x2a7cc5();})[_0x95be('0x13')](function(){_0x2a7cc5();});});}function manageTags(_0x1482a6,_0x3f7d11,_0x574d02,_0x3ae97a,_0x1e9688,_0x28f4ef,_0x53926d){return new Promise(function(_0x39df47,_0x100f56){var _0x62ebc1=[];_0x3f7d11[_0x95be('0x48')](function(_0x1eacca){_0x62ebc1[_0x95be('0x49')](getRemoteTag(_0x1eacca,_0x574d02,_0x3ae97a,_0x28f4ef,_0x53926d));});return Promise[_0x95be('0x4a')](_0x62ebc1)[_0x95be('0xc')](function(_0x3860fa){if(_0x3860fa[_0x95be('0xe')]){logger['info']('['+[_0x1482a6['toUpperCase']()]+_0x95be('0x4b'),_0x3860fa);var _0x53e750=[];_0x3860fa[_0x95be('0x48')](function(_0x39b978){_0x53e750[_0x95be('0x49')](assignTagToIncident(_0x39b978,_0x574d02,_0x3ae97a,_0x1e9688,_0x28f4ef));});return Promise['all'](_0x53e750)['then'](function(){_0x39df47();})['catch'](function(){_0x39df47();});}else{_0x39df47();}});});}function getTags(_0x2aeb9f,_0x51891e,_0x3ba458,_0x85a34d,_0x382b9a,_0x32e711){return function(_0x163379){return new Promise(function(_0x37968d,_0x23b877){var _0x5e31b7=[];var _0x56da32=_0x85a34d['Tags'];if(_0x56da32&&_0x56da32[_0x95be('0xe')]>0x0){_0x5e31b7=_['map'](_0x56da32,_0x95be('0x38'));}if(_0x5e31b7[_0x95be('0xe')]>0x0){return manageTags(_0x2aeb9f,_0x5e31b7,_0x51891e,_0x3ba458,_0x163379,_0x382b9a,_0x32e711)[_0x95be('0xc')](function(){_0x37968d(_0x163379);});}else{_0x37968d(_0x163379);}});};}function emit(_0x4decbb,_0x1dce29,_0x1c850e){var _0x23e591=_0x95be('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x95be('0x4d')+'%255EORDERBYDESCnumber';var _0x2a3e0d={'uri':_0x4decbb+_0x95be('0x4e')+_0x1c850e+_0x23e591};io['to'](util['format']('user:%s',_0x1dce29))[_0x95be('0x4f')]('trigger:browser:url',_0x2a3e0d);}exports['cs']=function(_0x2e2c9c,_0x5daac8,_0x5a31e2,_0x175ca4,_0x5e09be,_0x136d6f,_0x27778c,_0x346db3){var _0x12daf0={};var _0x23f260={'user':_0x136d6f[_0x95be('0x50')],'pass':_0x136d6f[_0x95be('0x51')]};var _0x19d9fe=_0x95be('0x52');var _0x1ce849=_0x95be('0x53');_0x136d6f['remoteUri']=intUtil[_0x95be('0x54')](_0x136d6f[_0x95be('0x55')]);_0x136d6f[_0x95be('0x56')]=intUtil['stripTrailingSlash'](_0x136d6f[_0x95be('0x56')]);var _0x3f0b41=util['format'](_0x95be('0x57'),_0x136d6f[_0x95be('0x55')]);_0x12daf0[_0x95be('0x19')]=!_['isNil'](_0x175ca4)?_0x175ca4[_0x95be('0x58')]:null;_0x12daf0[_0x95be('0x1e')]=_0x136d6f[_0x95be('0x58')];_0x12daf0[_0x95be('0x24')]=_0x346db3[_0x95be('0x2e')]()===_0x95be('0x39')?_0x5daac8[_0x95be('0x59')]:_0x5daac8[_0x95be('0x5a')];_0x12daf0['callDirection']=_0x346db3===_0x95be('0x5b')||_0x346db3===_0x95be('0x5c')?_0x95be('0x5b'):_0x95be('0x39');var _0x377837=util['format'](_0x95be('0x5d'),_0x136d6f['serverUrl'],_0x5daac8[_0x95be('0x5e')],md5(_0x5daac8[_0x95be('0x5e')]));if(_0x5e09be&&_0x5e09be[_0x95be('0x5f')]){logger[_0x95be('0x15')]('[QUEUE]',_0x95be('0x60'));_0x5daac8['recordingURL']=_0x377837;}else if(_0x27778c&&_0x27778c[_0x95be('0x61')]&&_0x27778c[_0x95be('0x61')]!==_0x95be('0x62')){logger[_0x95be('0x15')](_0x95be('0x63'),_0x95be('0x60'));_0x5daac8[_0x95be('0x64')]=_0x377837;}else{_0x5daac8[_0x95be('0x64')]='';}return getAdminUser(_0x346db3,_0x23f260,_0x12daf0,_0x3f0b41,_0x1ce849,_0x19d9fe)['then'](getUser(_0x346db3,_0x23f260,_0x3f0b41,_0x1ce849,_0x19d9fe))[_0x95be('0xc')](getEndUser(_0x346db3,_0x23f260,_0x3f0b41,_0x1ce849,_0x19d9fe))[_0x95be('0xc')](getTicket(_0x346db3,_0x23f260,_0x3f0b41,_0x5a31e2,_0x5daac8,_0x1ce849))[_0x95be('0xc')](function(_0x5e8a49){logger['info'](util[_0x95be('0x65')](_0x95be('0x66'),_0x5e8a49['ticketId']));logger[_0x95be('0x15')](util[_0x95be('0x65')](_0x95be('0x67'),_0x346db3));if(_0x346db3!==_0x95be('0x5c')){logger[_0x95be('0x15')]('['+[_0x346db3[_0x95be('0x11')]()]+']',_0x95be('0x68'));emit(_0x136d6f[_0x95be('0x55')],_0x175ca4[_0x95be('0x38')],_0x5e8a49['ticketId']);}})[_0x95be('0x13')](function(_0x1e065f){logger[_0x95be('0x28')]('['+[_0x346db3[_0x95be('0x11')]()]+_0x95be('0x69'),util[_0x95be('0x6a')](_0x1e065f,{'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 f652264..93c041c 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 _0x5bf5=['Basic\x20%s','apiKey','toString','get_server_info','isNil','Employees','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','forEach','type','string','nameField','toLowerCase','content','idField','customField','custom_fields','variable','customVariable','Variable','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','unmanaged','toUpperCase','The\x20Enduser\x20ID\x20is:','users','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_name','length','variableName','push','set_entry','JSON','stringify','Calls','format'];(function(_0x126b37,_0x4784f7){var _0x12b4bc=function(_0x3c6416){while(--_0x3c6416){_0x126b37['push'](_0x126b37['shift']());}};_0x12b4bc(++_0x4784f7);}(_0x5bf5,0xd7));var _0x55bf=function(_0xce2415,_0x3e6e87){_0xce2415=_0xce2415-0x0;var _0x127805=_0x5bf5[_0xce2415];return _0x127805;};'use strict';var _=require(_0x55bf('0x0'));var rp=require(_0x55bf('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x55bf('0x2'));var Redis=require(_0x55bf('0x3'));var intUtil=require(_0x55bf('0x4'));var config=require(_0x55bf('0x5'));var logger=require(_0x55bf('0x6'))(_0x55bf('0x7'));config[_0x55bf('0x8')]=_['defaults'](config[_0x55bf('0x8')],{'host':_0x55bf('0x9'),'port':0x18eb});var io=require(_0x55bf('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x430fc0,_0x348c66,_0x29ca6c){io['to'](_0x430fc0)[_0x55bf('0xb')](_0x348c66,_0x29ca6c);}function getTicket(_0x2e61c3,_0xb9acf5,_0x3427eb,_0xe8370,_0x285234,_0x2e1f95,_0x52d590,_0x550e3b){logger[_0x55bf('0xc')](_0x55bf('0xd'));var _0x190c96=new Date();var _0x482bb2=[{'name':_0x55bf('0xe'),'value':intUtil[_0x55bf('0xf')](_0xe8370['Subjects'],_0x285234,'\x20')},{'name':_0x55bf('0x10'),'value':_0xb9acf5['id']},{'name':_0x55bf('0x11'),'value':_0xb9acf5['id']},{'name':_0x55bf('0x12'),'value':intUtil[_0x55bf('0xf')](_0xe8370[_0x55bf('0x13')],_0x285234,'\x0a')},{'name':'date_start','value':_0x190c96[_0x55bf('0x14')]()[_0x55bf('0x15')](0x0,0x13)[_0x55bf('0x16')]('T','\x20')},{'name':_0x55bf('0x17'),'value':'0'},{'name':_0x55bf('0x18'),'value':'15'},{'name':_0x55bf('0x19'),'value':_0x3427eb['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x55bf('0x1a'),'value':_0x3427eb[_0x55bf('0xe')]},{'name':'direction','value':_0x550e3b}];if(_0x2e1f95[_0x55bf('0x1b')]){_['forEach'](_0x2e1f95,function(_0x12d377){if(_0x285234[_0x12d377[_0x55bf('0x1c')]]){_0x482bb2[_0x55bf('0x1d')]({'name':_0x12d377['idField'],'value':_0x285234[_0x12d377[_0x55bf('0x1c')]]});}});}return request({'form':{'method':_0x55bf('0x1e'),'input_type':_0x55bf('0x1f'),'response_type':_0x55bf('0x1f'),'rest_data':JSON[_0x55bf('0x20')]({'session':_0x52d590['id'],'module_name':_0x55bf('0x21'),'name_value_list':_0x482bb2})}});}function getAuth(_0x414070){return util[_0x55bf('0x22')](_0x55bf('0x23'),new Buffer(_0x414070[_0x55bf('0x24')]+':X')[_0x55bf('0x25')]('base64'));}function getServerInfo(_0x3d8c2b){return request({'form':{'method':_0x55bf('0x26'),'input_type':_0x55bf('0x1f'),'response_type':_0x55bf('0x1f'),'rest_data':JSON[_0x55bf('0x20')]({'session':_0x3d8c2b['id']})}});}function getUser(_0x3c067c,_0x143c10,_0x205f47){if(!_[_0x55bf('0x27')](_0x143c10)){logger[_0x55bf('0xc')]('Getting\x20agent\x20with\x20name',_0x143c10);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x55bf('0x1f'),'rest_data':JSON[_0x55bf('0x20')]({'session':_0x205f47['id'],'module_name':_0x55bf('0x28'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x143c10),'order_by':'','offset':'0','select_fields':['id',_0x55bf('0xe'),_0x55bf('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4ef826){if(_0x4ef826[_0x55bf('0x2a')]['length']){var _0x745948=_[_0x55bf('0x2b')](_0x4ef826['entry_list'],function(_0x38bfcc){return _0x38bfcc[_0x55bf('0x2c')][_0x55bf('0x29')][_0x55bf('0x2d')]===_0x143c10;});if(_0x745948){logger['info'](_0x55bf('0x2e'));return BPromise[_0x55bf('0x2f')]({'id':_0x745948[_0x55bf('0x2c')]['id'][_0x55bf('0x2d')],'name':_0x745948[_0x55bf('0x2c')][_0x55bf('0xe')][_0x55bf('0x2d')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x55bf('0x2f')]({'id':_0x205f47[_0x55bf('0x2c')][_0x55bf('0x30')][_0x55bf('0x2d')],'name':_0x205f47[_0x55bf('0x2c')][_0x55bf('0x29')][_0x55bf('0x2d')]});});}else{logger['info'](_0x55bf('0x31'));return BPromise[_0x55bf('0x2f')]({'id':_0x205f47[_0x55bf('0x2c')]['user_id']['value'],'name':_0x205f47[_0x55bf('0x2c')][_0x55bf('0x29')][_0x55bf('0x2d')]});}}function getEndUser(_0x1710c3,_0x2795b7,_0x2dfe84,_0x1f3a04){logger[_0x55bf('0xc')](_0x55bf('0x32'),_0x2dfe84);return request({'form':{'method':'get_entry_list','input_type':_0x55bf('0x1f'),'response_type':_0x55bf('0x1f'),'rest_data':JSON[_0x55bf('0x20')]({'session':_0x1f3a04['id'],'module_name':_0x55bf('0x33'),'query':util['format'](_0x55bf('0x34'),_0x2dfe84),'order_by':'','offset':'0','select_fields':['id',_0x55bf('0xe'),_0x55bf('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x55bf('0x36')](function(_0x2eed3a){if(_0x2eed3a[_0x55bf('0x2a')][_0x55bf('0x1b')]){var _0x397cc0=_[_0x55bf('0x2b')](_0x2eed3a[_0x55bf('0x2a')],function(_0x553678){return _0x553678[_0x55bf('0x2c')][_0x55bf('0x35')][_0x55bf('0x2d')]===_0x2dfe84;});if(_0x397cc0){logger[_0x55bf('0xc')](_0x55bf('0x37'));return BPromise[_0x55bf('0x2f')]({'id':_0x397cc0[_0x55bf('0x2c')]['id'][_0x55bf('0x2d')],'name':_0x397cc0[_0x55bf('0x2c')][_0x55bf('0xe')][_0x55bf('0x2d')],'phone':_0x397cc0[_0x55bf('0x2c')]['phone_home'][_0x55bf('0x2d')]});}}else{logger[_0x55bf('0xc')](_0x55bf('0x38'));return request({'form':{'method':_0x55bf('0x1e'),'input_type':_0x55bf('0x1f'),'response_type':_0x55bf('0x1f'),'rest_data':JSON[_0x55bf('0x20')]({'session':_0x1f3a04['id'],'module_name':_0x55bf('0x33'),'name_value_list':[{'name':'first_name','value':_0x2795b7!==_0x55bf('0x39')?_0x2795b7:util[_0x55bf('0x22')](_0x55bf('0x3a'),_0x2dfe84)},{'name':'phone_home','value':_0x2dfe84}]})}})[_0x55bf('0x36')](function(_0x18ab8d){logger[_0x55bf('0xc')](_0x55bf('0x3b'));return BPromise['resolve']({'id':_0x18ab8d['id'],'name':_0x18ab8d[_0x55bf('0x2a')][_0x55bf('0x3c')][_0x55bf('0x2d')],'phone':_0x18ab8d[_0x55bf('0x2a')][_0x55bf('0x35')][_0x55bf('0x2d')]});});}});}function request(_0x101356){logger[_0x55bf('0x3d')](_0x55bf('0x3e'),JSON[_0x55bf('0x20')](_0x101356));return rp(_[_0x55bf('0x3f')](def,_0x101356));}function getTags(_0x237026,_0x3a23f7){var _0x3b77fc=[];if(_0x237026&&_0x237026[_0x55bf('0x1b')]>0x0){_0x3b77fc=_[_0x55bf('0x40')](_0x237026,_0x3a23f7);}return _0x3b77fc;}function getCustomFields(_0x3fe122,_0x3d2b68){var _0x2a8b3a=[];var _0x4cc938={'custom_fields':[]};if(_0x3fe122[_0x55bf('0x1b')]>0x0){_[_0x55bf('0x41')](_0x3fe122,function(_0x256d51){if(_0x256d51[_0x55bf('0x42')]===_0x55bf('0x43')&&_0x256d51[_0x55bf('0x44')]&&!_0x256d51['customField']){_0x4cc938[_0x256d51[_0x55bf('0x44')][_0x55bf('0x45')]()]=_0x256d51[_0x55bf('0x46')][_0x55bf('0x25')]();}else if(_0x256d51[_0x55bf('0x42')]==='string'&&_0x256d51[_0x55bf('0x47')]&&_0x256d51[_0x55bf('0x48')]){_0x4cc938[_0x55bf('0x49')][_0x55bf('0x1d')]({'id':_0x256d51[_0x55bf('0x47')],'value':_0x256d51['content']['toString']()});}else if(_0x256d51[_0x55bf('0x42')]===_0x55bf('0x4a')&&_0x256d51[_0x55bf('0x1c')]&&_0x256d51[_0x55bf('0x47')]&&_0x256d51[_0x55bf('0x48')]){_0x3d2b68[_0x256d51[_0x55bf('0x1c')]]&&_0x4cc938['custom_fields'][_0x55bf('0x1d')]({'id':_0x256d51[_0x55bf('0x47')],'value':_0x3d2b68[_0x256d51['variableName']][_0x55bf('0x25')]()});}else if(_0x256d51[_0x55bf('0x42')]===_0x55bf('0x4b')&&_0x256d51[_0x55bf('0x4c')]&&_0x256d51[_0x55bf('0x4c')][_0x55bf('0xe')]&&_0x256d51[_0x55bf('0x47')]&&_0x256d51[_0x55bf('0x48')]){_0x3d2b68[_0x256d51['Variable'][_0x55bf('0xe')][_0x55bf('0x45')]()]&&_0x4cc938['custom_fields'][_0x55bf('0x1d')]({'id':_0x256d51[_0x55bf('0x47')],'value':_0x3d2b68[_0x256d51['Variable'][_0x55bf('0xe')][_0x55bf('0x45')]()][_0x55bf('0x25')]()});}});}return _0x4cc938;}function getConnection(_0x24c192){return request({'method':_0x55bf('0x4d'),'form':{'method':_0x55bf('0x4e'),'input_type':'JSON','response_type':_0x55bf('0x1f'),'rest_data':JSON[_0x55bf('0x20')]({'user_auth':{'user_name':_0x24c192[_0x55bf('0x4f')],'password':_0x24c192[_0x55bf('0x50')],'encryption':_0x55bf('0x51')},'application':_0x55bf('0x52')})}})[_0x55bf('0x36')](function(_0x2e3a88){var _0x2121ed=_0x2e3a88;if(_0x2121ed['id']){def[_0x55bf('0x53')]=_0x2121ed['id'];return BPromise['resolve'](_0x2121ed);}else{throw new Error(util[_0x55bf('0x22')](_0x55bf('0x54'),_0x24c192['id']));}});}function setRelationship(_0x4c8f8c,_0xda4639,_0x534f01,_0xea49ca){return request({'form':{'method':_0x55bf('0x55'),'input_type':_0x55bf('0x1f'),'response_type':'JSON','rest_data':JSON[_0x55bf('0x20')]({'session':_0x4c8f8c['id'],'module_name':_0x55bf('0x21'),'module_id':_0x534f01['id'],'link_field_name':_0xea49ca,'related_ids':[_0xda4639['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x55bf('0x56')]=function(_0x16e7e3,_0x2d9ed5,_0x15fecd,_0x460b13,_0x4fc9bf,_0x3485c8){var _0x24f4cd,_0xceb8e1,_0xc586c3,_0x8e6ac5;_0x3485c8[_0x55bf('0x57')]=intUtil[_0x55bf('0x58')](_0x3485c8[_0x55bf('0x57')]);_0x3485c8[_0x55bf('0x59')]=intUtil['stripTrailingSlash'](_0x3485c8[_0x55bf('0x59')]);def[_0x55bf('0x5a')]=util[_0x55bf('0x22')](_0x55bf('0x5b'),_0x3485c8[_0x55bf('0x57')]);if(_0x4fc9bf&&_0x4fc9bf['monitor_format']){logger[_0x55bf('0xc')](_0x55bf('0x5c'),_0x55bf('0x5d'));_0x2d9ed5[_0x55bf('0x5e')]=util[_0x55bf('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3485c8['serverUrl'],_0x2d9ed5[_0x55bf('0x5f')],md5(_0x2d9ed5[_0x55bf('0x5f')]));}else{_0x2d9ed5[_0x55bf('0x5e')]='';}return getConnection(_0x3485c8)[_0x55bf('0x36')](function(_0x5631ff){_0x8e6ac5=_0x5631ff;return getUser(_0x3485c8,_0x460b13[_0x55bf('0xe')],_0x8e6ac5);})['then'](function(_0x1d3eac){_0x24f4cd=_0x1d3eac;logger[_0x55bf('0xc')]('The\x20User\x20ID\x20is:',_0x24f4cd['id']);return getEndUser(_0x3485c8,_0x2d9ed5[_0x55bf('0x60')],_0x2d9ed5[_0x55bf('0x61')],_0x8e6ac5);})[_0x55bf('0x36')](function(_0x17ea66){_0xceb8e1=_0x17ea66;logger[_0x55bf('0xc')]('The\x20Enduser\x20ID\x20is:',_0xceb8e1['id']);return getTicket(_0x3485c8,_0x24f4cd,_0xceb8e1,_0x15fecd,_0x2d9ed5,_0x15fecd[_0x55bf('0x62')],_0x8e6ac5,_0x55bf('0x63'));})[_0x55bf('0x36')](function(_0x308fa2){_0xc586c3=_0x308fa2;logger[_0x55bf('0xc')](_0x55bf('0x64'));logger['info'](_0x55bf('0x65'),_0xc586c3['id']);return setRelationship(_0x8e6ac5,_0x24f4cd,_0xc586c3,'users');})[_0x55bf('0x36')](function(){return setRelationship(_0x8e6ac5,_0xceb8e1,_0xc586c3,_0x55bf('0x66'));})[_0x55bf('0x36')](function(){return getServerInfo(_0x8e6ac5);})[_0x55bf('0x36')](function(_0x36af78){var _0x156ade=parseInt(_0x36af78[_0x55bf('0x67')][_0x55bf('0x68')](0x0));var _0x2b5f01=util[_0x55bf('0x22')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3485c8[_0x55bf('0x57')],_0xc586c3['id']);if(_0x156ade>0x6){_0x2b5f01=util[_0x55bf('0x22')](_0x55bf('0x69'),_0x3485c8[_0x55bf('0x57')],_0xc586c3['id']);}logger[_0x55bf('0xc')](_0x55bf('0x5c'),_0x55bf('0x6a'));emit(util[_0x55bf('0x22')](_0x55bf('0x6b'),_0x460b13['name']),_0x55bf('0x6c'),{'uri':_0x2b5f01});})[_0x55bf('0x6d')](function(_0x28dd6a){logger[_0x55bf('0x6e')](_0x55bf('0x5c'),JSON['stringify'](_0x28dd6a));});};exports[_0x55bf('0x6f')]=function(_0x5b3739,_0x1284b4,_0x35cc82,_0x148c69,_0x1c4dae,_0x203f74,_0x2ad950){var _0x386767,_0x5cc709,_0x8c37ff,_0x7e5785;_0x203f74['remoteUri']=intUtil['stripTrailingSlash'](_0x203f74[_0x55bf('0x57')]);_0x203f74[_0x55bf('0x59')]=intUtil[_0x55bf('0x58')](_0x203f74[_0x55bf('0x59')]);def[_0x55bf('0x5a')]=util[_0x55bf('0x22')](_0x55bf('0x5b'),_0x203f74[_0x55bf('0x57')]);if(_0x2ad950&&_0x2ad950[_0x55bf('0x70')]&&_0x2ad950['recordingFormat']!==_0x55bf('0x71')){logger['info']('[OUTBOUND]',_0x55bf('0x5d'));_0x1284b4[_0x55bf('0x5e')]=util[_0x55bf('0x22')](_0x55bf('0x72'),_0x203f74[_0x55bf('0x59')],_0x1284b4[_0x55bf('0x5f')],md5(_0x1284b4['uniqueid']));}return getConnection(_0x203f74)[_0x55bf('0x36')](function(_0x5ad940){_0x7e5785=_0x5ad940;return getUser(_0x203f74,_0x148c69[_0x55bf('0xe')],_0x7e5785);})['then'](function(_0x10d26b){_0x386767=_0x10d26b;logger[_0x55bf('0xc')](_0x55bf('0x73'),_0x386767['id']);return getEndUser(_0x203f74,_0x1284b4[_0x55bf('0x74')],_0x1284b4[_0x55bf('0x75')],_0x7e5785);})[_0x55bf('0x36')](function(_0x2a6560){_0x5cc709=_0x2a6560;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5cc709['id']);return getTicket(_0x203f74,_0x386767,_0x5cc709,_0x35cc82,_0x1284b4,_0x35cc82[_0x55bf('0x62')],_0x7e5785,_0x55bf('0x76'));})[_0x55bf('0x36')](function(_0x2c6402){_0x8c37ff=_0x2c6402;logger[_0x55bf('0xc')](_0x55bf('0x64'));logger[_0x55bf('0xc')](_0x55bf('0x65'),_0x8c37ff['id']);return setRelationship(_0x7e5785,_0x386767,_0x8c37ff,'users');})[_0x55bf('0x36')](function(){return setRelationship(_0x7e5785,_0x5cc709,_0x8c37ff,'contacts');})[_0x55bf('0x36')](function(){return getServerInfo(_0x7e5785);})[_0x55bf('0x36')](function(_0x4429d3){var _0x3e9115=parseInt(_0x4429d3['version']['charAt'](0x0));var _0x13db28=util[_0x55bf('0x22')](_0x55bf('0x77'),_0x203f74[_0x55bf('0x57')],_0x8c37ff['id']);if(_0x3e9115>0x6){_0x13db28=util[_0x55bf('0x22')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x203f74['remoteUri'],_0x8c37ff['id']);}logger['info'](_0x55bf('0x78'),_0x55bf('0x6a'));emit(util['format'](_0x55bf('0x6b'),_0x148c69[_0x55bf('0xe')]),_0x55bf('0x6c'),{'uri':_0x13db28});})[_0x55bf('0x6d')](function(_0x5d6e3a){logger['error'](_0x55bf('0x78'),JSON[_0x55bf('0x20')](_0x5d6e3a));});};exports[_0x55bf('0x79')]=function(_0x1cf4cf,_0x15cb99,_0x133812,_0x138218,_0x5514b9,_0x2e0de6){var _0x2cf112,_0x48f3e5,_0x4e4ad7,_0x1eaddb;_0x2e0de6['remoteUri']=intUtil['stripTrailingSlash'](_0x2e0de6['remoteUri']);_0x2e0de6[_0x55bf('0x59')]=intUtil[_0x55bf('0x58')](_0x2e0de6[_0x55bf('0x59')]);def[_0x55bf('0x5a')]=util[_0x55bf('0x22')](_0x55bf('0x5b'),_0x2e0de6[_0x55bf('0x57')]);if(_0x5514b9&&_0x5514b9['monitor_format']){logger[_0x55bf('0xc')]('['+_0x15cb99['lastevent'][_0x55bf('0x7a')]()+']',_0x55bf('0x5d'));_0x15cb99[_0x55bf('0x5e')]=util[_0x55bf('0x22')](_0x55bf('0x72'),_0x2e0de6[_0x55bf('0x59')],_0x15cb99[_0x55bf('0x5f')],md5(_0x15cb99['uniqueid']));}else{_0x15cb99['recordingURL']='';}return getConnection(_0x2e0de6)[_0x55bf('0x36')](function(_0x1316b0){_0x1eaddb=_0x1316b0;if(!_[_0x55bf('0x27')](_0x138218)){return getUser(_0x2e0de6,_0x138218[_0x55bf('0xe')],_0x1eaddb);}else{return getUser(_0x2e0de6,null,_0x1eaddb);}})[_0x55bf('0x36')](function(_0x98a8d1){_0x2cf112=_0x98a8d1;logger[_0x55bf('0xc')](_0x55bf('0x73'),_0x2cf112['id']);return getEndUser(_0x2e0de6,_0x15cb99[_0x55bf('0x60')],_0x15cb99[_0x55bf('0x61')],_0x1eaddb);})[_0x55bf('0x36')](function(_0x518042){_0x48f3e5=_0x518042;logger[_0x55bf('0xc')](_0x55bf('0x7b'),_0x48f3e5['id']);return getTicket(_0x2e0de6,_0x2cf112,_0x48f3e5,_0x133812,_0x15cb99,_0x133812[_0x55bf('0x62')],_0x1eaddb,_0x55bf('0x63'));})[_0x55bf('0x36')](function(_0x531b1c){_0x4e4ad7=_0x531b1c;logger[_0x55bf('0xc')](_0x55bf('0x64'));logger[_0x55bf('0xc')](_0x55bf('0x65'),_0x4e4ad7['id']);return setRelationship(_0x1eaddb,_0x2cf112,_0x4e4ad7,_0x55bf('0x7c'));})[_0x55bf('0x36')](function(){return setRelationship(_0x1eaddb,_0x48f3e5,_0x4e4ad7,_0x55bf('0x66'));})[_0x55bf('0x36')](function(){return getServerInfo(_0x1eaddb);})[_0x55bf('0x6d')](function(_0x284eac){logger[_0x55bf('0x6e')]('['+_0x15cb99['lastevent'][_0x55bf('0x7a')]()+']',JSON[_0x55bf('0x20')](_0x284eac));});}; \ No newline at end of file +var _0x901f=['variable','custom_fields','type','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','%s/service/v4_1/rest.php','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Ticket\x20created!','error','lodash','bluebird','md5','util','ioredis','./util','sugarcrm','defaults','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','set_entry','JSON','Calls','format','apiKey','toString','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','nameField','customField','toLowerCase','content','string','idField'];(function(_0x4d4ea4,_0x5ed1a6){var _0x17d839=function(_0x32f743){while(--_0x32f743){_0x4d4ea4['push'](_0x4d4ea4['shift']());}};_0x17d839(++_0x5ed1a6);}(_0x901f,0x1ae));var _0xf901=function(_0x56011a,_0x391365){_0x56011a=_0x56011a-0x0;var _0x55be12=_0x901f[_0x56011a];return _0x55be12;};'use strict';var _=require(_0xf901('0x0'));var rp=require('request-promise');var BPromise=require(_0xf901('0x1'));var md5=require(_0xf901('0x2'));var util=require(_0xf901('0x3'));var Redis=require(_0xf901('0x4'));var intUtil=require(_0xf901('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xf901('0x6'));config['redis']=_[_0xf901('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf901('0x8'))(new Redis(config[_0xf901('0x9')]));var def={'method':_0xf901('0xa'),'json':!![]};function emit(_0x785e77,_0x1f04fc,_0x2a1432){io['to'](_0x785e77)[_0xf901('0xb')](_0x1f04fc,_0x2a1432);}function getTicket(_0x2902ea,_0x3807e4,_0x101a16,_0x4bb454,_0x19e0c6,_0xec2ef9,_0x107fc7,_0x312cc7){logger[_0xf901('0xc')](_0xf901('0xd'));var _0x4e94db=new Date();var _0x20f130=[{'name':_0xf901('0xe'),'value':intUtil[_0xf901('0xf')](_0x4bb454[_0xf901('0x10')],_0x19e0c6,'\x20')},{'name':_0xf901('0x11'),'value':_0x3807e4['id']},{'name':_0xf901('0x12'),'value':_0x3807e4['id']},{'name':_0xf901('0x13'),'value':intUtil[_0xf901('0xf')](_0x4bb454[_0xf901('0x14')],_0x19e0c6,'\x0a')},{'name':'date_start','value':_0x4e94db[_0xf901('0x15')]()['slice'](0x0,0x13)[_0xf901('0x16')]('T','\x20')},{'name':_0xf901('0x17'),'value':'0'},{'name':_0xf901('0x18'),'value':'15'},{'name':_0xf901('0x19'),'value':_0x101a16['id']},{'name':_0xf901('0x1a'),'value':'Contacts'},{'name':_0xf901('0x1b'),'value':_0x101a16[_0xf901('0xe')]},{'name':_0xf901('0x1c'),'value':_0x312cc7}];if(_0xec2ef9[_0xf901('0x1d')]){_[_0xf901('0x1e')](_0xec2ef9,function(_0x5d8d49){if(_0x19e0c6[_0x5d8d49[_0xf901('0x1f')]]){_0x20f130[_0xf901('0x20')]({'name':_0x5d8d49['idField'],'value':_0x19e0c6[_0x5d8d49[_0xf901('0x1f')]]});}});}return request({'form':{'method':_0xf901('0x21'),'input_type':'JSON','response_type':_0xf901('0x22'),'rest_data':JSON['stringify']({'session':_0x107fc7['id'],'module_name':_0xf901('0x23'),'name_value_list':_0x20f130})}});}function getAuth(_0x40ff57){return util[_0xf901('0x24')]('Basic\x20%s',new Buffer(_0x40ff57[_0xf901('0x25')]+':X')[_0xf901('0x26')]('base64'));}function getServerInfo(_0x98cf26){return request({'form':{'method':'get_server_info','input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x98cf26['id']})}});}function getUser(_0x4acf02,_0x25ea9e,_0x3d0359){if(!_[_0xf901('0x28')](_0x25ea9e)){logger[_0xf901('0xc')](_0xf901('0x29'),_0x25ea9e);return request({'form':{'method':_0xf901('0x2a'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x3d0359['id'],'module_name':_0xf901('0x2b'),'query':util[_0xf901('0x24')](_0xf901('0x2c'),_0x25ea9e),'order_by':'','offset':'0','select_fields':['id',_0xf901('0xe'),_0xf901('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5addb7){if(_0x5addb7[_0xf901('0x2e')][_0xf901('0x1d')]){var _0x29d71e=_[_0xf901('0x2f')](_0x5addb7[_0xf901('0x2e')],function(_0x28ae6d){return _0x28ae6d[_0xf901('0x30')][_0xf901('0x2d')][_0xf901('0x31')]===_0x25ea9e;});if(_0x29d71e){logger[_0xf901('0xc')](_0xf901('0x32'));return BPromise['resolve']({'id':_0x29d71e[_0xf901('0x30')]['id'][_0xf901('0x31')],'name':_0x29d71e[_0xf901('0x30')][_0xf901('0xe')][_0xf901('0x31')]});}}logger[_0xf901('0xc')](_0xf901('0x33'));return BPromise['resolve']({'id':_0x3d0359[_0xf901('0x30')]['user_id'][_0xf901('0x31')],'name':_0x3d0359[_0xf901('0x30')][_0xf901('0x2d')][_0xf901('0x31')]});});}else{logger[_0xf901('0xc')](_0xf901('0x34'));return BPromise[_0xf901('0x35')]({'id':_0x3d0359[_0xf901('0x30')]['user_id'][_0xf901('0x31')],'name':_0x3d0359[_0xf901('0x30')]['user_name'][_0xf901('0x31')]});}}function getEndUser(_0x508d73,_0x4220ac,_0x80cdcb,_0x16ed6){logger[_0xf901('0xc')]('Searching\x20enduser\x20with\x20phone',_0x80cdcb);return request({'form':{'method':'get_entry_list','input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x16ed6['id'],'module_name':_0xf901('0x36'),'query':util[_0xf901('0x24')](_0xf901('0x37'),_0x80cdcb),'order_by':'','offset':'0','select_fields':['id',_0xf901('0xe'),_0xf901('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x36a598){if(_0x36a598['entry_list']['length']){var _0x2e209e=_[_0xf901('0x2f')](_0x36a598[_0xf901('0x2e')],function(_0x2bdd0f){return _0x2bdd0f[_0xf901('0x30')][_0xf901('0x38')]['value']===_0x80cdcb;});if(_0x2e209e){logger['info'](_0xf901('0x39'));return BPromise[_0xf901('0x35')]({'id':_0x2e209e['name_value_list']['id'][_0xf901('0x31')],'name':_0x2e209e[_0xf901('0x30')][_0xf901('0xe')]['value'],'phone':_0x2e209e[_0xf901('0x30')]['phone_home'][_0xf901('0x31')]});}}else{logger[_0xf901('0xc')](_0xf901('0x3a'));return request({'form':{'method':_0xf901('0x21'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON['stringify']({'session':_0x16ed6['id'],'module_name':_0xf901('0x36'),'name_value_list':[{'name':_0xf901('0x3b'),'value':_0x4220ac!==_0xf901('0x3c')?_0x4220ac:util[_0xf901('0x24')](_0xf901('0x3d'),_0x80cdcb)},{'name':_0xf901('0x38'),'value':_0x80cdcb}]})}})[_0xf901('0x3e')](function(_0xf5aeb8){logger[_0xf901('0xc')](_0xf901('0x3f'));return BPromise[_0xf901('0x35')]({'id':_0xf5aeb8['id'],'name':_0xf5aeb8['entry_list'][_0xf901('0x3b')][_0xf901('0x31')],'phone':_0xf5aeb8['entry_list'][_0xf901('0x38')][_0xf901('0x31')]});});}});}function request(_0x2ce4b1){logger[_0xf901('0x40')](_0xf901('0x41'),JSON[_0xf901('0x27')](_0x2ce4b1));return rp(_[_0xf901('0x42')](def,_0x2ce4b1));}function getTags(_0x3a708a,_0x22285c){var _0x6ee4ec=[];if(_0x3a708a&&_0x3a708a[_0xf901('0x1d')]>0x0){_0x6ee4ec=_[_0xf901('0x43')](_0x3a708a,_0x22285c);}return _0x6ee4ec;}function getCustomFields(_0x30c19d,_0x1db2ed){var _0x3dae5e=[];var _0x203fd3={'custom_fields':[]};if(_0x30c19d['length']>0x0){_[_0xf901('0x1e')](_0x30c19d,function(_0x44a746){if(_0x44a746['type']==='string'&&_0x44a746[_0xf901('0x44')]&&!_0x44a746[_0xf901('0x45')]){_0x203fd3[_0x44a746[_0xf901('0x44')][_0xf901('0x46')]()]=_0x44a746[_0xf901('0x47')][_0xf901('0x26')]();}else if(_0x44a746['type']===_0xf901('0x48')&&_0x44a746[_0xf901('0x49')]&&_0x44a746['customField']){_0x203fd3['custom_fields'][_0xf901('0x20')]({'id':_0x44a746['idField'],'value':_0x44a746['content'][_0xf901('0x26')]()});}else if(_0x44a746['type']===_0xf901('0x4a')&&_0x44a746[_0xf901('0x1f')]&&_0x44a746['idField']&&_0x44a746[_0xf901('0x45')]){_0x1db2ed[_0x44a746['variableName']]&&_0x203fd3[_0xf901('0x4b')][_0xf901('0x20')]({'id':_0x44a746[_0xf901('0x49')],'value':_0x1db2ed[_0x44a746[_0xf901('0x1f')]]['toString']()});}else if(_0x44a746[_0xf901('0x4c')]===_0xf901('0x4d')&&_0x44a746['Variable']&&_0x44a746[_0xf901('0x4e')][_0xf901('0xe')]&&_0x44a746[_0xf901('0x49')]&&_0x44a746[_0xf901('0x45')]){_0x1db2ed[_0x44a746['Variable'][_0xf901('0xe')][_0xf901('0x46')]()]&&_0x203fd3['custom_fields'][_0xf901('0x20')]({'id':_0x44a746[_0xf901('0x49')],'value':_0x1db2ed[_0x44a746[_0xf901('0x4e')][_0xf901('0xe')]['toLowerCase']()]['toString']()});}});}return _0x203fd3;}function getConnection(_0x300f18){return request({'method':'POST','form':{'method':_0xf901('0x4f'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'user_auth':{'user_name':_0x300f18[_0xf901('0x50')],'password':_0x300f18['password'],'encryption':_0xf901('0x51')},'application':_0xf901('0x52')})}})[_0xf901('0x3e')](function(_0x3470f1){var _0x109971=_0x3470f1;if(_0x109971['id']){def['sessionID']=_0x109971['id'];return BPromise['resolve'](_0x109971);}else{throw new Error(util[_0xf901('0x24')](_0xf901('0x53'),_0x300f18['id']));}});}function setRelationship(_0x3f0721,_0x364212,_0x35f5f0,_0x132f42){return request({'form':{'method':_0xf901('0x54'),'input_type':_0xf901('0x22'),'response_type':_0xf901('0x22'),'rest_data':JSON[_0xf901('0x27')]({'session':_0x3f0721['id'],'module_name':_0xf901('0x23'),'module_id':_0x35f5f0['id'],'link_field_name':_0x132f42,'related_ids':[_0x364212['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf901('0x55')]=function(_0x237b1a,_0x8450af,_0x1e2095,_0x53bfdf,_0x16a186,_0xca21ca){var _0x1ed923,_0x14fbf7,_0x5d21fe,_0x24374f;_0xca21ca[_0xf901('0x56')]=intUtil[_0xf901('0x57')](_0xca21ca['remoteUri']);_0xca21ca[_0xf901('0x58')]=intUtil['stripTrailingSlash'](_0xca21ca['serverUrl']);def[_0xf901('0x59')]=util['format']('%s/service/v4_1/rest.php',_0xca21ca[_0xf901('0x56')]);if(_0x16a186&&_0x16a186[_0xf901('0x5a')]){logger['info'](_0xf901('0x5b'),_0xf901('0x5c'));_0x8450af[_0xf901('0x5d')]=util['format'](_0xf901('0x5e'),_0xca21ca['serverUrl'],_0x8450af[_0xf901('0x5f')],md5(_0x8450af['uniqueid']));}else{_0x8450af[_0xf901('0x5d')]='';}return getConnection(_0xca21ca)['then'](function(_0x248ff1){_0x24374f=_0x248ff1;return getUser(_0xca21ca,_0x53bfdf[_0xf901('0xe')],_0x24374f);})['then'](function(_0x9df7a7){_0x1ed923=_0x9df7a7;logger['info']('The\x20User\x20ID\x20is:',_0x1ed923['id']);return getEndUser(_0xca21ca,_0x8450af[_0xf901('0x60')],_0x8450af[_0xf901('0x61')],_0x24374f);})[_0xf901('0x3e')](function(_0x5c2e8a){_0x14fbf7=_0x5c2e8a;logger[_0xf901('0xc')](_0xf901('0x62'),_0x14fbf7['id']);return getTicket(_0xca21ca,_0x1ed923,_0x14fbf7,_0x1e2095,_0x8450af,_0x1e2095[_0xf901('0x63')],_0x24374f,_0xf901('0x64'));})[_0xf901('0x3e')](function(_0x1a587e){_0x5d21fe=_0x1a587e;logger[_0xf901('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5d21fe['id']);return setRelationship(_0x24374f,_0x1ed923,_0x5d21fe,_0xf901('0x65'));})[_0xf901('0x3e')](function(){return setRelationship(_0x24374f,_0x14fbf7,_0x5d21fe,_0xf901('0x66'));})[_0xf901('0x3e')](function(){return getServerInfo(_0x24374f);})[_0xf901('0x3e')](function(_0x88e4b3){var _0x3d88a4=parseInt(_0x88e4b3[_0xf901('0x67')][_0xf901('0x68')](0x0));var _0x51e761=util['format'](_0xf901('0x69'),_0xca21ca['remoteUri'],_0x5d21fe['id']);if(_0x3d88a4>0x6){_0x51e761=util[_0xf901('0x24')](_0xf901('0x6a'),_0xca21ca[_0xf901('0x56')],_0x5d21fe['id']);}logger[_0xf901('0xc')](_0xf901('0x5b'),_0xf901('0x6b'));emit(util['format'](_0xf901('0x6c'),_0x53bfdf[_0xf901('0xe')]),_0xf901('0x6d'),{'uri':_0x51e761});})[_0xf901('0x6e')](function(_0x16dc66){logger['error'](_0xf901('0x5b'),JSON[_0xf901('0x27')](_0x16dc66));});};exports[_0xf901('0x6f')]=function(_0x2de000,_0x2e79ea,_0x18754c,_0x4818e2,_0x178cd3,_0x5a1bd5,_0xc253c){var _0x148bfb,_0x201e16,_0x1feae0,_0x3f5d0f;_0x5a1bd5['remoteUri']=intUtil['stripTrailingSlash'](_0x5a1bd5[_0xf901('0x56')]);_0x5a1bd5['serverUrl']=intUtil[_0xf901('0x57')](_0x5a1bd5[_0xf901('0x58')]);def[_0xf901('0x59')]=util[_0xf901('0x24')](_0xf901('0x70'),_0x5a1bd5[_0xf901('0x56')]);if(_0xc253c&&_0xc253c[_0xf901('0x71')]&&_0xc253c[_0xf901('0x71')]!==_0xf901('0x72')){logger[_0xf901('0xc')]('[OUTBOUND]',_0xf901('0x5c'));_0x2e79ea[_0xf901('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a1bd5[_0xf901('0x58')],_0x2e79ea[_0xf901('0x5f')],md5(_0x2e79ea[_0xf901('0x5f')]));}return getConnection(_0x5a1bd5)[_0xf901('0x3e')](function(_0x1a8af4){_0x3f5d0f=_0x1a8af4;return getUser(_0x5a1bd5,_0x4818e2[_0xf901('0xe')],_0x3f5d0f);})[_0xf901('0x3e')](function(_0x14e7b7){_0x148bfb=_0x14e7b7;logger[_0xf901('0xc')](_0xf901('0x73'),_0x148bfb['id']);return getEndUser(_0x5a1bd5,_0x2e79ea[_0xf901('0x74')],_0x2e79ea[_0xf901('0x75')],_0x3f5d0f);})[_0xf901('0x3e')](function(_0x5ace93){_0x201e16=_0x5ace93;logger[_0xf901('0xc')](_0xf901('0x62'),_0x201e16['id']);return getTicket(_0x5a1bd5,_0x148bfb,_0x201e16,_0x18754c,_0x2e79ea,_0x18754c['Fields'],_0x3f5d0f,_0xf901('0x76'));})[_0xf901('0x3e')](function(_0x2f5966){_0x1feae0=_0x2f5966;logger[_0xf901('0xc')]('Ticket\x20created!');logger[_0xf901('0xc')](_0xf901('0x77'),_0x1feae0['id']);return setRelationship(_0x3f5d0f,_0x148bfb,_0x1feae0,_0xf901('0x65'));})[_0xf901('0x3e')](function(){return setRelationship(_0x3f5d0f,_0x201e16,_0x1feae0,_0xf901('0x66'));})[_0xf901('0x3e')](function(){return getServerInfo(_0x3f5d0f);})[_0xf901('0x3e')](function(_0x2e0f88){var _0x1ecb8f=parseInt(_0x2e0f88[_0xf901('0x67')][_0xf901('0x68')](0x0));var _0x43eae3=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5a1bd5['remoteUri'],_0x1feae0['id']);if(_0x1ecb8f>0x6){_0x43eae3=util[_0xf901('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x5a1bd5[_0xf901('0x56')],_0x1feae0['id']);}logger['info'](_0xf901('0x78'),_0xf901('0x6b'));emit(util[_0xf901('0x24')](_0xf901('0x6c'),_0x4818e2[_0xf901('0xe')]),'trigger:browser:url',{'uri':_0x43eae3});})[_0xf901('0x6e')](function(_0x11a8e0){logger['error']('[OUTBOUND]',JSON[_0xf901('0x27')](_0x11a8e0));});};exports[_0xf901('0x79')]=function(_0x3dc61e,_0x54938b,_0x19727b,_0x5bcac5,_0x40ae44,_0x192cd9){var _0x446890,_0x18ee9f,_0x1c3298,_0x4633bf;_0x192cd9[_0xf901('0x56')]=intUtil[_0xf901('0x57')](_0x192cd9[_0xf901('0x56')]);_0x192cd9[_0xf901('0x58')]=intUtil[_0xf901('0x57')](_0x192cd9['serverUrl']);def[_0xf901('0x59')]=util[_0xf901('0x24')](_0xf901('0x70'),_0x192cd9['remoteUri']);if(_0x40ae44&&_0x40ae44['monitor_format']){logger['info']('['+_0x54938b[_0xf901('0x7a')][_0xf901('0x7b')]()+']','Recording\x20is\x20enabled!');_0x54938b['recordingURL']=util[_0xf901('0x24')](_0xf901('0x5e'),_0x192cd9[_0xf901('0x58')],_0x54938b[_0xf901('0x5f')],md5(_0x54938b[_0xf901('0x5f')]));}else{_0x54938b[_0xf901('0x5d')]='';}return getConnection(_0x192cd9)[_0xf901('0x3e')](function(_0x4684d6){_0x4633bf=_0x4684d6;if(!_[_0xf901('0x28')](_0x5bcac5)){return getUser(_0x192cd9,_0x5bcac5[_0xf901('0xe')],_0x4633bf);}else{return getUser(_0x192cd9,null,_0x4633bf);}})['then'](function(_0x35e509){_0x446890=_0x35e509;logger[_0xf901('0xc')](_0xf901('0x73'),_0x446890['id']);return getEndUser(_0x192cd9,_0x54938b[_0xf901('0x60')],_0x54938b[_0xf901('0x61')],_0x4633bf);})[_0xf901('0x3e')](function(_0x3b4f4b){_0x18ee9f=_0x3b4f4b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x18ee9f['id']);return getTicket(_0x192cd9,_0x446890,_0x18ee9f,_0x19727b,_0x54938b,_0x19727b[_0xf901('0x63')],_0x4633bf,_0xf901('0x64'));})['then'](function(_0xe164d5){_0x1c3298=_0xe164d5;logger[_0xf901('0xc')](_0xf901('0x7c'));logger[_0xf901('0xc')](_0xf901('0x77'),_0x1c3298['id']);return setRelationship(_0x4633bf,_0x446890,_0x1c3298,_0xf901('0x65'));})[_0xf901('0x3e')](function(){return setRelationship(_0x4633bf,_0x18ee9f,_0x1c3298,'contacts');})['then'](function(){return getServerInfo(_0x4633bf);})[_0xf901('0x6e')](function(_0x5020bb){logger[_0xf901('0x7d')]('['+_0x54938b[_0xf901('0x7a')][_0xf901('0x7b')]()+']',JSON[_0xf901('0x27')](_0x5020bb));});}; \ 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 8ba1aba..e40398a 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 _0xd36f=['length','sortBy','type','string','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','push','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','validateEmail','isNil','lodash','util'];(function(_0x11c6eb,_0x33873b){var _0x5b81e4=function(_0x2d8455){while(--_0x2d8455){_0x11c6eb['push'](_0x11c6eb['shift']());}};_0x5b81e4(++_0x33873b);}(_0xd36f,0x80));var _0xfd36=function(_0x4d24d0,_0xad44a4){_0x4d24d0=_0x4d24d0-0x0;var _0x5a6b19=_0xd36f[_0x4d24d0];return _0x5a6b19;};'use strict';var _=require(_0xfd36('0x0'));var util=require(_0xfd36('0x1'));exports['getString']=function(_0x2a1202,_0x373dee,_0x1646ba){var _0x428bf5=[];if(_0x2a1202[_0xfd36('0x2')]>0x0){var _0x2539a4=_[_0xfd36('0x3')](_0x2a1202,['id']);for(var _0x682c62=0x0;_0x682c62<_0x2539a4[_0xfd36('0x2')];_0x682c62++){var _0x2f56d5=_0x2539a4[_0x682c62];if(_0x2f56d5[_0xfd36('0x4')]===_0xfd36('0x5')){_0x428bf5['push'](_0x2f56d5[_0xfd36('0x6')]);}else if(_0x2f56d5[_0xfd36('0x4')]===_0xfd36('0x7')&&_0x2f56d5[_0xfd36('0x8')]){_0x373dee[_0x2f56d5[_0xfd36('0x8')]]&&_0x428bf5['push'](_0x373dee[_0x2f56d5[_0xfd36('0x8')]][_0xfd36('0x9')]());}else if(_0x2f56d5[_0xfd36('0x4')]===_0xfd36('0xa')&&_0x2f56d5[_0xfd36('0xb')]&&_0x2f56d5[_0xfd36('0xb')][_0xfd36('0xc')]){_0x373dee[_0x2f56d5[_0xfd36('0xb')][_0xfd36('0xc')]['toLowerCase']()]&&_0x428bf5['push'](_0x373dee[_0x2f56d5[_0xfd36('0xb')][_0xfd36('0xc')][_0xfd36('0xd')]()][_0xfd36('0x9')]());}else if(_0x2f56d5[_0xfd36('0x4')]===_0xfd36('0xe')){if(_0x2f56d5['keyType']==='string'&&_0x2f56d5[_0xfd36('0xf')]){_0x428bf5[_0xfd36('0x10')](util[_0xfd36('0x11')](_0xfd36('0x12'),_0x2f56d5[_0xfd36('0xf')],_0x2f56d5[_0xfd36('0x13')]));}else if(_0x2f56d5['keyType']===_0xfd36('0x7')&&_0x2f56d5[_0xfd36('0x8')]&&_0x2f56d5[_0xfd36('0xf')]){_0x373dee[_0x2f56d5[_0xfd36('0x8')]]&&_0x428bf5[_0xfd36('0x10')](util[_0xfd36('0x11')](_0xfd36('0x12'),_0x2f56d5['key'],_0x373dee[_0x2f56d5[_0xfd36('0x8')]]));}else if(_0x2f56d5[_0xfd36('0x14')]===_0xfd36('0xa')&&_0x2f56d5['Variable']&&_0x2f56d5[_0xfd36('0xb')]['name']&&_0x2f56d5[_0xfd36('0xf')]){_0x373dee[_0x2f56d5[_0xfd36('0xb')][_0xfd36('0xc')]['toLowerCase']()]&&_0x428bf5[_0xfd36('0x10')](util[_0xfd36('0x11')](_0xfd36('0x12'),_0x2f56d5[_0xfd36('0xf')],_0x373dee[_0x2f56d5[_0xfd36('0xb')][_0xfd36('0xc')]['toLowerCase']()]));}}}}return _0x428bf5[_0xfd36('0x15')](_0x1646ba);};exports[_0xfd36('0x16')]=function(_0x39726c){var _0x5823dc=_0x39726c[_0xfd36('0x17')](-0x1);if(_0x5823dc==='/'){_0x39726c=_0x39726c['substring'](0x0,_0x39726c['lastIndexOf'](_0x5823dc));}return _0x39726c;};exports[_0xfd36('0x18')]=function(_0x180784){if(!_[_0xfd36('0x19')](_0x180784)&&_0x180784!==''){var _0x49cc43=/^(([^<>()\[\]\\.,;:\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 _0x49cc43['test'](String(_0x180784)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x87bd=['lodash','getString','length','sortBy','string','content','type','variable','push','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','test'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x87bd,0xd0));var _0xd87b=function(_0x3f80d3,_0x1df024){_0x3f80d3=_0x3f80d3-0x0;var _0x1d13b1=_0x87bd[_0x3f80d3];return _0x1d13b1;};'use strict';var _=require(_0xd87b('0x0'));var util=require('util');exports[_0xd87b('0x1')]=function(_0x43d920,_0x52eeb1,_0x55bd82){var _0x3432b9=[];if(_0x43d920[_0xd87b('0x2')]>0x0){var _0x391e98=_[_0xd87b('0x3')](_0x43d920,['id']);for(var _0x38a841=0x0;_0x38a841<_0x391e98[_0xd87b('0x2')];_0x38a841++){var _0x3a9b5c=_0x391e98[_0x38a841];if(_0x3a9b5c['type']===_0xd87b('0x4')){_0x3432b9['push'](_0x3a9b5c[_0xd87b('0x5')]);}else if(_0x3a9b5c[_0xd87b('0x6')]===_0xd87b('0x7')&&_0x3a9b5c['variableName']){_0x52eeb1[_0x3a9b5c['variableName']]&&_0x3432b9[_0xd87b('0x8')](_0x52eeb1[_0x3a9b5c[_0xd87b('0x9')]][_0xd87b('0xa')]());}else if(_0x3a9b5c[_0xd87b('0x6')]===_0xd87b('0xb')&&_0x3a9b5c[_0xd87b('0xc')]&&_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')]){_0x52eeb1[_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')][_0xd87b('0xe')]()]&&_0x3432b9['push'](_0x52eeb1[_0x3a9b5c['Variable'][_0xd87b('0xd')]['toLowerCase']()][_0xd87b('0xa')]());}else if(_0x3a9b5c[_0xd87b('0x6')]===_0xd87b('0xf')){if(_0x3a9b5c[_0xd87b('0x10')]==='string'&&_0x3a9b5c[_0xd87b('0x11')]){_0x3432b9['push'](util[_0xd87b('0x12')](_0xd87b('0x13'),_0x3a9b5c[_0xd87b('0x11')],_0x3a9b5c['keyContent']));}else if(_0x3a9b5c[_0xd87b('0x10')]===_0xd87b('0x7')&&_0x3a9b5c[_0xd87b('0x9')]&&_0x3a9b5c[_0xd87b('0x11')]){_0x52eeb1[_0x3a9b5c['variableName']]&&_0x3432b9[_0xd87b('0x8')](util['format'](_0xd87b('0x13'),_0x3a9b5c[_0xd87b('0x11')],_0x52eeb1[_0x3a9b5c['variableName']]));}else if(_0x3a9b5c[_0xd87b('0x10')]===_0xd87b('0xb')&&_0x3a9b5c[_0xd87b('0xc')]&&_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')]&&_0x3a9b5c[_0xd87b('0x11')]){_0x52eeb1[_0x3a9b5c['Variable'][_0xd87b('0xd')]['toLowerCase']()]&&_0x3432b9['push'](util['format']('%s:\x20%s',_0x3a9b5c[_0xd87b('0x11')],_0x52eeb1[_0x3a9b5c[_0xd87b('0xc')][_0xd87b('0xd')][_0xd87b('0xe')]()]));}}}}return _0x3432b9[_0xd87b('0x14')](_0x55bd82);};exports[_0xd87b('0x15')]=function(_0x1af403){var _0x1aa900=_0x1af403[_0xd87b('0x16')](-0x1);if(_0x1aa900==='/'){_0x1af403=_0x1af403[_0xd87b('0x17')](0x0,_0x1af403[_0xd87b('0x18')](_0x1aa900));}return _0x1af403;};exports['validateEmail']=function(_0x361989){if(!_['isNil'](_0x361989)&&_0x361989!==''){var _0x4971bf=/^(([^<>()\[\]\\.,;:\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 _0x4971bf[_0xd87b('0x19')](String(_0x361989)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 4c8bee9..0281076 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(_0x1ef0c5,_0x1220cc){var _0x1b5b4a=function(_0x404f68){while(--_0x404f68){_0x1ef0c5['push'](_0x1ef0c5['shift']());}};_0x1b5b4a(++_0x1220cc);}(_0xe706,0xa3));var _0x6e70=function(_0x12fe24,_0x4061cd){_0x12fe24=_0x12fe24-0x0;var _0x309501=_0xe706[_0x12fe24];return _0x309501;};'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 _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(_0x3b7fb7,_0x30abbb){var _0x34da82=function(_0x1177ae){while(--_0x1177ae){_0x3b7fb7['push'](_0x3b7fb7['shift']());}};_0x34da82(++_0x30abbb);}(_0xe706,0xa3));var _0x6e70=function(_0x429003,_0x3508da){_0x429003=_0x429003-0x0;var _0x3cc0d9=_0xe706[_0x429003];return _0x3cc0d9;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 1d713aa..db856a6 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 _0x8c9f=['format','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','toLowerCase','content','idField','toString','variable','variableName','customField','push','customVariable','Variable','custom_fields','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','stripTrailingSlash','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','integrationTab','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','merge','Tags','name','Descriptions','getString','Fields','then','ticket','validateEmail','remoteUri','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x2a1b64,_0x4914d2){var _0x44fed4=function(_0x24d876){while(--_0x24d876){_0x2a1b64['push'](_0x2a1b64['shift']());}};_0x44fed4(++_0x4914d2);}(_0x8c9f,0x118));var _0xf8c9=function(_0x5090cb,_0x2cf15d){_0x5090cb=_0x5090cb-0x0;var _0x3e567c=_0x8c9f[_0x5090cb];return _0x3e567c;};'use strict';var _=require(_0xf8c9('0x0'));var rp=require(_0xf8c9('0x1'));var md5=require(_0xf8c9('0x2'));var util=require('util');var Redis=require(_0xf8c9('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf8c9('0x4'))(_0xf8c9('0x5'));config[_0xf8c9('0x6')]=_[_0xf8c9('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf8c9('0x8'))(new Redis(config[_0xf8c9('0x6')]));function emit(_0x1cfdca,_0x35c433,_0x3e3694){io['to'](_0x1cfdca)[_0xf8c9('0x9')](_0x35c433,_0x3e3694);}var headers={'Content-Type':_0xf8c9('0xa'),'Accept':'application/json'};function getTicket(_0x1a4eb7,_0x10e9fa,_0x39b9e7,_0x235f71,_0x2f6586){logger[_0xf8c9('0xb')](_0xf8c9('0xc'));return request({'uri':util['format'](_0xf8c9('0xd'),_0x1a4eb7['remoteUri']),'method':_0xf8c9('0xe'),'body':{'ticket':_[_0xf8c9('0xf')]({'requester_id':_0x39b9e7['id'],'submitter_id':_0x10e9fa?_0x10e9fa['id']:undefined,'assignee_id':_0x10e9fa?_0x10e9fa['id']:undefined,'tags':getTags(_0x235f71[_0xf8c9('0x10')],_0xf8c9('0x11')),'subject':intUtil['getString'](_0x235f71['Subjects'],_0x2f6586,'\x20'),'description':intUtil['getString'](_0x235f71[_0xf8c9('0x12')],_0x2f6586,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf8c9('0x13')](_0x235f71['Descriptions'],_0x2f6586,'\x0a')}},getCustomFields(_0x235f71[_0xf8c9('0x14')],_0x2f6586))}})[_0xf8c9('0x15')](function(_0x4439b1){logger[_0xf8c9('0xb')]('Ticket\x20created!');return _0x4439b1[_0xf8c9('0x16')];});}function getUser(_0x161564,_0x1d3375){if(intUtil[_0xf8c9('0x17')](_0x1d3375)){logger[_0xf8c9('0xb')]('Getting\x20agent\x20with\x20email',_0x1d3375);return request({'uri':util['format']('%s/search.json',_0x161564[_0xf8c9('0x18')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x1d3375)}})[_0xf8c9('0x15')](function(_0x261552){if(_0x261552[_0xf8c9('0x19')]){logger[_0xf8c9('0xb')]('Agent\x20found!');return _[_0xf8c9('0x1a')](_0x261552['results'],{'email':_0x1d3375,'role':_0xf8c9('0x1b')});}else{logger['info'](_0xf8c9('0x1c'));return request({'uri':util[_0xf8c9('0x1d')]('%s/users/me.json',_0x161564[_0xf8c9('0x18')])})[_0xf8c9('0x15')](function(_0x4acd6b){logger[_0xf8c9('0xb')](_0xf8c9('0x1e'));return _0x4acd6b[_0xf8c9('0x1f')];});}});}else{logger[_0xf8c9('0xb')](_0xf8c9('0x1c'));return request({'uri':util[_0xf8c9('0x1d')](_0xf8c9('0x20'),_0x161564[_0xf8c9('0x18')])})[_0xf8c9('0x15')](function(_0x4cd48c){logger[_0xf8c9('0xb')]('Admin\x20account\x20selected.');return _0x4cd48c['user'];});}}function getEndUser(_0x1a282f,_0x3dc2c6,_0x5fd065){logger[_0xf8c9('0xb')](_0xf8c9('0x21'),_0x5fd065);return request({'uri':util[_0xf8c9('0x1d')]('%s/search.json',_0x1a282f[_0xf8c9('0x18')]),'qs':{'query':util['format'](_0xf8c9('0x22'),_0x5fd065)}})[_0xf8c9('0x15')](function(_0x9e6de2){var _0x1b9543;if(_0x9e6de2[_0xf8c9('0x23')][_0xf8c9('0x24')]){_0x9e6de2[_0xf8c9('0x23')]=_['filter'](_0x9e6de2[_0xf8c9('0x23')],{'suspended':![],'role':_0xf8c9('0x25')});if(_0x9e6de2[_0xf8c9('0x23')][_0xf8c9('0x24')]){_0x1b9543=_[_0xf8c9('0x26')](_0x9e6de2['results']);}}if(_0x1b9543){logger[_0xf8c9('0xb')](_0xf8c9('0x27'));return _0x1b9543;}else{logger[_0xf8c9('0xb')](_0xf8c9('0x28'));return request({'uri':util[_0xf8c9('0x1d')](_0xf8c9('0x29'),_0x1a282f[_0xf8c9('0x18')]),'method':_0xf8c9('0xe'),'body':{'user':{'role':'end-user','name':util[_0xf8c9('0x1d')](_0xf8c9('0x2a'),_0x3dc2c6||_0x5fd065),'phone':_0x5fd065}}})[_0xf8c9('0x15')](function(_0x351b32){logger['info']('Enduser\x20created.');return _0x351b32['user'];});}});}function getAuth(_0x5d330b){var _0xaaba2f;if(_0x5d330b[_0xf8c9('0x2b')]==='password'){_0xaaba2f=util['format'](_0xf8c9('0x2c'),_0x5d330b[_0xf8c9('0x2d')],_0x5d330b[_0xf8c9('0x2e')]);}else if(_0x5d330b[_0xf8c9('0x2b')]===_0xf8c9('0x2f')){_0xaaba2f=util[_0xf8c9('0x1d')](_0xf8c9('0x30'),_0x5d330b[_0xf8c9('0x2d')],_0x5d330b[_0xf8c9('0x2f')]);}return util[_0xf8c9('0x1d')](_0xf8c9('0x31'),new Buffer(_0xaaba2f)['toString'](_0xf8c9('0x32')));}function request(_0x487f88){logger[_0xf8c9('0x33')](_0xf8c9('0x34'),JSON[_0xf8c9('0x35')](_0x487f88));return rp(_[_0xf8c9('0x7')](_0x487f88,{'method':_0xf8c9('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x562e38,_0x1529b6){var _0x4be60e=[];if(_0x562e38&&_0x562e38[_0xf8c9('0x24')]>0x0){_0x4be60e=_[_0xf8c9('0x37')](_0x562e38,_0x1529b6);}return _0x4be60e;}function getCustomFields(_0xdf56c8,_0x3d031a){var _0x292ef6=[];var _0x5e10fa={'custom_fields':[]};if(_0xdf56c8['length']>0x0){_[_0xf8c9('0x38')](_0xdf56c8,function(_0x14ac28){if(_['includes']([_0xf8c9('0x39'),_0xf8c9('0x3a')],_0x14ac28[_0xf8c9('0x3b')])&&_0x14ac28[_0xf8c9('0x3c')]&&!_0x14ac28['customField']){_0x5e10fa[_0x14ac28[_0xf8c9('0x3c')][_0xf8c9('0x3d')]()]=_0x14ac28[_0xf8c9('0x3e')]['toString']();}else if(_['includes'](['string',_0xf8c9('0x3a')],_0x14ac28[_0xf8c9('0x3b')])&&_0x14ac28[_0xf8c9('0x3f')]&&_0x14ac28['customField']){_0x5e10fa['custom_fields']['push']({'id':_0x14ac28['idField'],'value':_0x14ac28[_0xf8c9('0x3e')][_0xf8c9('0x40')]()});}else if(_0x14ac28[_0xf8c9('0x3b')]===_0xf8c9('0x41')&&_0x14ac28[_0xf8c9('0x42')]&&_0x14ac28[_0xf8c9('0x3f')]&&_0x14ac28[_0xf8c9('0x43')]){_0x3d031a[_0x14ac28[_0xf8c9('0x42')]]&&_0x5e10fa['custom_fields'][_0xf8c9('0x44')]({'id':_0x14ac28[_0xf8c9('0x3f')],'value':_0x3d031a[_0x14ac28[_0xf8c9('0x42')]][_0xf8c9('0x40')]()});}else if(_0x14ac28[_0xf8c9('0x3b')]===_0xf8c9('0x45')&&_0x14ac28[_0xf8c9('0x46')]&&_0x14ac28[_0xf8c9('0x46')][_0xf8c9('0x11')]&&_0x14ac28[_0xf8c9('0x3f')]&&_0x14ac28[_0xf8c9('0x43')]){_0x3d031a[_0x14ac28[_0xf8c9('0x46')]['name'][_0xf8c9('0x3d')]()]&&_0x5e10fa[_0xf8c9('0x47')][_0xf8c9('0x44')]({'id':_0x14ac28[_0xf8c9('0x3f')],'value':_0x3d031a[_0x14ac28[_0xf8c9('0x46')][_0xf8c9('0x11')][_0xf8c9('0x3d')]()][_0xf8c9('0x40')]()});}});}return _0x5e10fa;}exports['queue']=function(_0x2cdf29,_0x523d3d,_0x3e1193,_0x1b2536,_0x257e85,_0x3f1e57){var _0x59883f,_0x30277b;_0x3f1e57['remoteUri']=intUtil['stripTrailingSlash'](_0x3f1e57[_0xf8c9('0x18')]);_0x3f1e57['serverUrl']=intUtil['stripTrailingSlash'](_0x3f1e57['serverUrl']);if(_0x257e85&&_0x257e85['monitor_format']){logger['info'](_0xf8c9('0x48'),_0xf8c9('0x49'));_0x523d3d[_0xf8c9('0x4a')]=util['format'](_0xf8c9('0x4b'),_0x3f1e57[_0xf8c9('0x4c')],_0x523d3d[_0xf8c9('0x4d')],md5(_0x523d3d[_0xf8c9('0x4d')]));}else{_0x523d3d['recordingURL']='';}headers[_0xf8c9('0x4e')]=getAuth(_0x3f1e57);return getUser(_0x3f1e57,_0x1b2536['email'])[_0xf8c9('0x15')](function(_0x3541e2){_0x59883f=_0x3541e2;logger[_0xf8c9('0xb')]('The\x20User\x20ID\x20is:',_0x59883f['id']);return getEndUser(_0x3f1e57,_0x523d3d[_0xf8c9('0x4f')],_0x523d3d[_0xf8c9('0x50')]);})[_0xf8c9('0x15')](function(_0x62a73a){_0x30277b=_0x62a73a;logger['info'](_0xf8c9('0x51'),_0x30277b['id']);return getTicket(_0x3f1e57,_0x59883f,_0x30277b,_0x3e1193,_0x523d3d);})[_0xf8c9('0x15')](function(_0x367b6c){if(_0x367b6c){logger[_0xf8c9('0xb')]('The\x20Ticket\x20ID\x20is:',_0x367b6c['id']);switch(_0x3f1e57[_0xf8c9('0x3b')]){case'integrationTab':logger[_0xf8c9('0xb')](_0xf8c9('0x48'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf8c9('0x1d')](_0xf8c9('0x52'),_0x3f1e57[_0xf8c9('0x18')],_0x59883f['id'],_0x367b6c['id']),'method':'POST'});case'newTab':logger[_0xf8c9('0xb')]('[QUEUE]',_0xf8c9('0x53'));emit(util[_0xf8c9('0x1d')]('user:%s',_0x1b2536[_0xf8c9('0x11')]),_0xf8c9('0x54'),{'uri':util[_0xf8c9('0x1d')](_0xf8c9('0x55'),_0x3f1e57['remoteUri']['replace'](_0xf8c9('0x56'),''),_0x367b6c['id'])});break;default:logger[_0xf8c9('0x57')](_0xf8c9('0x48'),_0xf8c9('0x58'));}}})[_0xf8c9('0x59')](function(_0x355b10){logger[_0xf8c9('0x57')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x355b10,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x507add,_0x4d9bf8,_0x363f09,_0x3cd5d6,_0x315913,_0x9cfcec,_0x2ed7f8){var _0x5ac3fa,_0x1cc2f6;_0x9cfcec[_0xf8c9('0x18')]=intUtil[_0xf8c9('0x5a')](_0x9cfcec[_0xf8c9('0x18')]);_0x9cfcec[_0xf8c9('0x4c')]=intUtil['stripTrailingSlash'](_0x9cfcec[_0xf8c9('0x4c')]);if(_0x2ed7f8&&_0x2ed7f8['recordingFormat']&&_0x2ed7f8[_0xf8c9('0x5b')]!=='none'){logger[_0xf8c9('0xb')](_0xf8c9('0x5c'),_0xf8c9('0x49'));_0x4d9bf8[_0xf8c9('0x4a')]=util['format'](_0xf8c9('0x4b'),_0x9cfcec[_0xf8c9('0x4c')],_0x4d9bf8[_0xf8c9('0x4d')],md5(_0x4d9bf8['uniqueid']));}headers[_0xf8c9('0x4e')]=getAuth(_0x9cfcec);return getUser(_0x9cfcec,_0x3cd5d6['email'])[_0xf8c9('0x15')](function(_0x57eaa3){_0x5ac3fa=_0x57eaa3;logger[_0xf8c9('0xb')](_0xf8c9('0x5d'),_0x5ac3fa['id']);return getEndUser(_0x9cfcec,_0x4d9bf8['destcalleridname'],_0x4d9bf8[_0xf8c9('0x5e')]);})[_0xf8c9('0x15')](function(_0x1ea5de){_0x1cc2f6=_0x1ea5de;logger[_0xf8c9('0xb')](_0xf8c9('0x51'),_0x1cc2f6['id']);return getTicket(_0x9cfcec,_0x5ac3fa,_0x1cc2f6,_0x363f09,_0x4d9bf8);})[_0xf8c9('0x15')](function(_0x1593c3){if(_0x1593c3){logger[_0xf8c9('0xb')]('The\x20Ticket\x20ID\x20is:',_0x1593c3['id']);switch(_0x9cfcec[_0xf8c9('0x3b')]){case _0xf8c9('0x5f'):logger[_0xf8c9('0xb')](_0xf8c9('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf8c9('0x1d')](_0xf8c9('0x52'),_0x9cfcec[_0xf8c9('0x18')],_0x5ac3fa['id'],_0x1593c3['id']),'method':_0xf8c9('0xe')});case'newTab':logger[_0xf8c9('0xb')](_0xf8c9('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf8c9('0x60'),_0x3cd5d6[_0xf8c9('0x11')]),_0xf8c9('0x54'),{'uri':util[_0xf8c9('0x1d')]('%s/agent/tickets/%s',_0x9cfcec[_0xf8c9('0x18')]['replace']('/api/v2',''),_0x1593c3['id'])});break;default:logger[_0xf8c9('0x57')]('[OUTBOUND]',_0xf8c9('0x58'));}}})['catch'](function(_0x4f909e){logger[_0xf8c9('0x57')](_0xf8c9('0x61'),util[_0xf8c9('0x62')](_0x4f909e,{'showHidden':!![],'depth':null}));});};exports[_0xf8c9('0x63')]=function(_0x43f54a,_0x1e1293,_0xe31075,_0x357b23,_0x3f5636,_0x49f0f1){var _0x2e10c0,_0x1b3179;_0x49f0f1[_0xf8c9('0x18')]=intUtil[_0xf8c9('0x5a')](_0x49f0f1[_0xf8c9('0x18')]);_0x49f0f1[_0xf8c9('0x4c')]=intUtil[_0xf8c9('0x5a')](_0x49f0f1['serverUrl']);if(_0x3f5636&&_0x3f5636[_0xf8c9('0x64')]){logger[_0xf8c9('0xb')]('['+_0x1e1293[_0xf8c9('0x65')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1e1293[_0xf8c9('0x4a')]=util[_0xf8c9('0x1d')](_0xf8c9('0x4b'),_0x49f0f1[_0xf8c9('0x4c')],_0x1e1293[_0xf8c9('0x4d')],md5(_0x1e1293['uniqueid']));}else{_0x1e1293[_0xf8c9('0x4a')]='';}headers[_0xf8c9('0x4e')]=getAuth(_0x49f0f1);return getUser(_0x49f0f1)[_0xf8c9('0x15')](function(_0x206507){_0x2e10c0=_0x206507;logger[_0xf8c9('0xb')](_0xf8c9('0x5d'),_0x2e10c0['id']);return getEndUser(_0x49f0f1,_0x1e1293['calleridname'],_0x1e1293[_0xf8c9('0x50')]);})[_0xf8c9('0x15')](function(_0x4d7eea){_0x1b3179=_0x4d7eea;logger[_0xf8c9('0xb')](_0xf8c9('0x51'),_0x1b3179['id']);return getTicket(_0x49f0f1,_0x2e10c0,_0x1b3179,_0xe31075,_0x1e1293);})['then'](function(_0x470e38){if(_0x470e38){logger[_0xf8c9('0xb')]('The\x20Ticket\x20ID\x20is:',_0x470e38['id']);}})['catch'](function(_0x47245c){logger[_0xf8c9('0x57')]('['+_0x1e1293[_0xf8c9('0x65')][_0xf8c9('0x66')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x47245c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x607f=['filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','base64','debug','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','customField','content','string','custom_fields','push','idField','toString','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\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...','trigger:browser:url','replace','/api/v2','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','inspect','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Descriptions','Fields','info','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length'];(function(_0x9e5ae7,_0x2499e5){var _0x149e4b=function(_0x47f1f2){while(--_0x47f1f2){_0x9e5ae7['push'](_0x9e5ae7['shift']());}};_0x149e4b(++_0x2499e5);}(_0x607f,0x199));var _0xf607=function(_0x1c7dd7,_0x4e5e2a){_0x1c7dd7=_0x1c7dd7-0x0;var _0x3ab480=_0x607f[_0x1c7dd7];return _0x3ab480;};'use strict';var _=require('lodash');var rp=require(_0xf607('0x0'));var md5=require('md5');var util=require(_0xf607('0x1'));var Redis=require(_0xf607('0x2'));var intUtil=require(_0xf607('0x3'));var config=require('../../../../config/environment');var logger=require(_0xf607('0x4'))(_0xf607('0x5'));config[_0xf607('0x6')]=_[_0xf607('0x7')](config[_0xf607('0x6')],{'host':_0xf607('0x8'),'port':0x18eb});var io=require(_0xf607('0x9'))(new Redis(config[_0xf607('0x6')]));function emit(_0x5de6bf,_0x249a58,_0x305ef9){io['to'](_0x5de6bf)[_0xf607('0xa')](_0x249a58,_0x305ef9);}var headers={'Content-Type':'application/json','Accept':_0xf607('0xb')};function getTicket(_0x5230df,_0x5d1c51,_0x420384,_0x4745a8,_0x36a5a0){logger['info'](_0xf607('0xc'));return request({'uri':util[_0xf607('0xd')](_0xf607('0xe'),_0x5230df[_0xf607('0xf')]),'method':'POST','body':{'ticket':_[_0xf607('0x10')]({'requester_id':_0x420384['id'],'submitter_id':_0x5d1c51?_0x5d1c51['id']:undefined,'assignee_id':_0x5d1c51?_0x5d1c51['id']:undefined,'tags':getTags(_0x4745a8[_0xf607('0x11')],_0xf607('0x12')),'subject':intUtil[_0xf607('0x13')](_0x4745a8['Subjects'],_0x36a5a0,'\x20'),'description':intUtil[_0xf607('0x13')](_0x4745a8['Descriptions'],_0x36a5a0,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4745a8[_0xf607('0x14')],_0x36a5a0,'\x0a')}},getCustomFields(_0x4745a8[_0xf607('0x15')],_0x36a5a0))}})['then'](function(_0x414925){logger[_0xf607('0x16')]('Ticket\x20created!');return _0x414925[_0xf607('0x17')];});}function getUser(_0x483e53,_0x1906aa){if(intUtil[_0xf607('0x18')](_0x1906aa)){logger[_0xf607('0x16')](_0xf607('0x19'),_0x1906aa);return request({'uri':util[_0xf607('0xd')](_0xf607('0x1a'),_0x483e53[_0xf607('0xf')]),'qs':{'query':util['format'](_0xf607('0x1b'),_0x1906aa)}})[_0xf607('0x1c')](function(_0x1432d7){if(_0x1432d7[_0xf607('0x1d')]){logger[_0xf607('0x16')]('Agent\x20found!');return _[_0xf607('0x1e')](_0x1432d7[_0xf607('0x1f')],{'email':_0x1906aa,'role':_0xf607('0x20')});}else{logger[_0xf607('0x16')](_0xf607('0x21'));return request({'uri':util[_0xf607('0xd')](_0xf607('0x22'),_0x483e53[_0xf607('0xf')])})[_0xf607('0x1c')](function(_0xb2714){logger[_0xf607('0x16')](_0xf607('0x23'));return _0xb2714[_0xf607('0x24')];});}});}else{logger[_0xf607('0x16')](_0xf607('0x21'));return request({'uri':util[_0xf607('0xd')](_0xf607('0x22'),_0x483e53[_0xf607('0xf')])})['then'](function(_0x433e28){logger[_0xf607('0x16')]('Admin\x20account\x20selected.');return _0x433e28[_0xf607('0x24')];});}}function getEndUser(_0x574920,_0x2f9b5c,_0x194d79){logger[_0xf607('0x16')](_0xf607('0x25'),_0x194d79);return request({'uri':util[_0xf607('0xd')](_0xf607('0x1a'),_0x574920['remoteUri']),'qs':{'query':util[_0xf607('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x194d79)}})[_0xf607('0x1c')](function(_0x5ef823){var _0x5e54da;if(_0x5ef823['results'][_0xf607('0x26')]){_0x5ef823['results']=_[_0xf607('0x27')](_0x5ef823[_0xf607('0x1f')],{'suspended':![],'role':_0xf607('0x28')});if(_0x5ef823[_0xf607('0x1f')][_0xf607('0x26')]){_0x5e54da=_[_0xf607('0x29')](_0x5ef823[_0xf607('0x1f')]);}}if(_0x5e54da){logger[_0xf607('0x16')]('Enduser\x20found!');return _0x5e54da;}else{logger[_0xf607('0x16')](_0xf607('0x2a'));return request({'uri':util['format'](_0xf607('0x2b'),_0x574920[_0xf607('0xf')]),'method':_0xf607('0x2c'),'body':{'user':{'role':_0xf607('0x28'),'name':util[_0xf607('0xd')](_0xf607('0x2d'),_0x2f9b5c||_0x194d79),'phone':_0x194d79}}})[_0xf607('0x1c')](function(_0x511a7a){logger[_0xf607('0x16')](_0xf607('0x2e'));return _0x511a7a['user'];});}});}function getAuth(_0x542fcf){var _0x5a21ec;if(_0x542fcf[_0xf607('0x2f')]===_0xf607('0x30')){_0x5a21ec=util[_0xf607('0xd')]('%s:%s',_0x542fcf[_0xf607('0x31')],_0x542fcf['password']);}else if(_0x542fcf[_0xf607('0x2f')]===_0xf607('0x32')){_0x5a21ec=util[_0xf607('0xd')]('%s/token:%s',_0x542fcf[_0xf607('0x31')],_0x542fcf[_0xf607('0x32')]);}return util[_0xf607('0xd')]('Basic\x20%s',new Buffer(_0x5a21ec)['toString'](_0xf607('0x33')));}function request(_0x5822fe){logger[_0xf607('0x34')](_0xf607('0x35'),JSON[_0xf607('0x36')](_0x5822fe));return rp(_[_0xf607('0x7')](_0x5822fe,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x40a40f,_0x50bb13){var _0x46a6ef=[];if(_0x40a40f&&_0x40a40f[_0xf607('0x26')]>0x0){_0x46a6ef=_[_0xf607('0x37')](_0x40a40f,_0x50bb13);}return _0x46a6ef;}function getCustomFields(_0x5d8c9c,_0x17f027){var _0x2448d5=[];var _0x3f122a={'custom_fields':[]};if(_0x5d8c9c[_0xf607('0x26')]>0x0){_[_0xf607('0x38')](_0x5d8c9c,function(_0x54a44f){if(_[_0xf607('0x39')](['string',_0xf607('0x3a')],_0x54a44f[_0xf607('0x3b')])&&_0x54a44f[_0xf607('0x3c')]&&!_0x54a44f[_0xf607('0x3d')]){_0x3f122a[_0x54a44f[_0xf607('0x3c')]['toLowerCase']()]=_0x54a44f[_0xf607('0x3e')]['toString']();}else if(_[_0xf607('0x39')]([_0xf607('0x3f'),'picklist'],_0x54a44f[_0xf607('0x3b')])&&_0x54a44f['idField']&&_0x54a44f[_0xf607('0x3d')]){_0x3f122a[_0xf607('0x40')][_0xf607('0x41')]({'id':_0x54a44f[_0xf607('0x42')],'value':_0x54a44f['content'][_0xf607('0x43')]()});}else if(_0x54a44f[_0xf607('0x3b')]===_0xf607('0x44')&&_0x54a44f[_0xf607('0x45')]&&_0x54a44f[_0xf607('0x42')]&&_0x54a44f[_0xf607('0x3d')]){_0x17f027[_0x54a44f['variableName']]&&_0x3f122a[_0xf607('0x40')][_0xf607('0x41')]({'id':_0x54a44f[_0xf607('0x42')],'value':_0x17f027[_0x54a44f[_0xf607('0x45')]][_0xf607('0x43')]()});}else if(_0x54a44f['type']===_0xf607('0x46')&&_0x54a44f[_0xf607('0x47')]&&_0x54a44f[_0xf607('0x47')][_0xf607('0x12')]&&_0x54a44f[_0xf607('0x42')]&&_0x54a44f['customField']){_0x17f027[_0x54a44f[_0xf607('0x47')][_0xf607('0x12')][_0xf607('0x48')]()]&&_0x3f122a['custom_fields']['push']({'id':_0x54a44f['idField'],'value':_0x17f027[_0x54a44f[_0xf607('0x47')][_0xf607('0x12')][_0xf607('0x48')]()][_0xf607('0x43')]()});}});}return _0x3f122a;}exports[_0xf607('0x49')]=function(_0x4f6339,_0x5da551,_0x221244,_0x3a8468,_0x25dc04,_0x5cd47b){var _0x5d987e,_0x49970d;_0x5cd47b[_0xf607('0xf')]=intUtil['stripTrailingSlash'](_0x5cd47b['remoteUri']);_0x5cd47b[_0xf607('0x4a')]=intUtil[_0xf607('0x4b')](_0x5cd47b[_0xf607('0x4a')]);if(_0x25dc04&&_0x25dc04[_0xf607('0x4c')]){logger[_0xf607('0x16')](_0xf607('0x4d'),_0xf607('0x4e'));_0x5da551[_0xf607('0x4f')]=util['format'](_0xf607('0x50'),_0x5cd47b[_0xf607('0x4a')],_0x5da551['uniqueid'],md5(_0x5da551[_0xf607('0x51')]));}else{_0x5da551[_0xf607('0x4f')]='';}headers['Authorization']=getAuth(_0x5cd47b);return getUser(_0x5cd47b,_0x3a8468[_0xf607('0x52')])[_0xf607('0x1c')](function(_0x2e940c){_0x5d987e=_0x2e940c;logger[_0xf607('0x16')](_0xf607('0x53'),_0x5d987e['id']);return getEndUser(_0x5cd47b,_0x5da551['calleridname'],_0x5da551['calleridnum']);})[_0xf607('0x1c')](function(_0x526e99){_0x49970d=_0x526e99;logger[_0xf607('0x16')]('The\x20Enduser\x20ID\x20is:',_0x49970d['id']);return getTicket(_0x5cd47b,_0x5d987e,_0x49970d,_0x221244,_0x5da551);})['then'](function(_0x21b4a2){if(_0x21b4a2){logger[_0xf607('0x16')](_0xf607('0x54'),_0x21b4a2['id']);switch(_0x5cd47b['type']){case _0xf607('0x55'):logger[_0xf607('0x16')](_0xf607('0x4d'),_0xf607('0x56'));return request({'uri':util['format'](_0xf607('0x57'),_0x5cd47b[_0xf607('0xf')],_0x5d987e['id'],_0x21b4a2['id']),'method':_0xf607('0x2c')});case _0xf607('0x58'):logger[_0xf607('0x16')](_0xf607('0x4d'),_0xf607('0x59'));emit(util[_0xf607('0xd')]('user:%s',_0x3a8468[_0xf607('0x12')]),_0xf607('0x5a'),{'uri':util[_0xf607('0xd')]('%s/agent/tickets/%s',_0x5cd47b['remoteUri'][_0xf607('0x5b')](_0xf607('0x5c'),''),_0x21b4a2['id'])});break;default:logger['error'](_0xf607('0x4d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf607('0x5d')](function(_0x2d9ce6){logger[_0xf607('0x5e')](_0xf607('0x5f'),util['inspect'](_0x2d9ce6,{'showHidden':!![],'depth':null}));});};exports[_0xf607('0x60')]=function(_0x22411e,_0x41ac91,_0x30cbbc,_0x3d0be0,_0xf372cf,_0x2ddc46,_0x3737d4){var _0x2eb9d3,_0xac2bbd;_0x2ddc46['remoteUri']=intUtil[_0xf607('0x4b')](_0x2ddc46[_0xf607('0xf')]);_0x2ddc46[_0xf607('0x4a')]=intUtil[_0xf607('0x4b')](_0x2ddc46[_0xf607('0x4a')]);if(_0x3737d4&&_0x3737d4['recordingFormat']&&_0x3737d4[_0xf607('0x61')]!==_0xf607('0x62')){logger[_0xf607('0x16')](_0xf607('0x63'),_0xf607('0x4e'));_0x41ac91['recordingURL']=util[_0xf607('0xd')](_0xf607('0x50'),_0x2ddc46[_0xf607('0x4a')],_0x41ac91['uniqueid'],md5(_0x41ac91[_0xf607('0x51')]));}headers[_0xf607('0x64')]=getAuth(_0x2ddc46);return getUser(_0x2ddc46,_0x3d0be0[_0xf607('0x52')])[_0xf607('0x1c')](function(_0x594055){_0x2eb9d3=_0x594055;logger[_0xf607('0x16')](_0xf607('0x53'),_0x2eb9d3['id']);return getEndUser(_0x2ddc46,_0x41ac91[_0xf607('0x65')],_0x41ac91[_0xf607('0x66')]);})['then'](function(_0x84a966){_0xac2bbd=_0x84a966;logger[_0xf607('0x16')](_0xf607('0x67'),_0xac2bbd['id']);return getTicket(_0x2ddc46,_0x2eb9d3,_0xac2bbd,_0x30cbbc,_0x41ac91);})[_0xf607('0x1c')](function(_0x466ac4){if(_0x466ac4){logger[_0xf607('0x16')]('The\x20Ticket\x20ID\x20is:',_0x466ac4['id']);switch(_0x2ddc46[_0xf607('0x3b')]){case _0xf607('0x55'):logger[_0xf607('0x16')](_0xf607('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf607('0xd')](_0xf607('0x57'),_0x2ddc46[_0xf607('0xf')],_0x2eb9d3['id'],_0x466ac4['id']),'method':_0xf607('0x2c')});case _0xf607('0x58'):logger['info'](_0xf607('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf607('0x68'),_0x3d0be0[_0xf607('0x12')]),_0xf607('0x5a'),{'uri':util[_0xf607('0xd')](_0xf607('0x69'),_0x2ddc46[_0xf607('0xf')][_0xf607('0x5b')](_0xf607('0x5c'),''),_0x466ac4['id'])});break;default:logger[_0xf607('0x5e')](_0xf607('0x63'),_0xf607('0x6a'));}}})['catch'](function(_0x1f4a3d){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf607('0x6b')](_0x1f4a3d,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x298260,_0x1581e9,_0x5dfc20,_0x22f5a2,_0x51c830,_0x1a323d){var _0x59b478,_0x16a011;_0x1a323d[_0xf607('0xf')]=intUtil[_0xf607('0x4b')](_0x1a323d[_0xf607('0xf')]);_0x1a323d[_0xf607('0x4a')]=intUtil[_0xf607('0x4b')](_0x1a323d[_0xf607('0x4a')]);if(_0x51c830&&_0x51c830[_0xf607('0x4c')]){logger['info']('['+_0x1581e9[_0xf607('0x6c')][_0xf607('0x6d')]()+']',_0xf607('0x4e'));_0x1581e9['recordingURL']=util[_0xf607('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a323d[_0xf607('0x4a')],_0x1581e9[_0xf607('0x51')],md5(_0x1581e9[_0xf607('0x51')]));}else{_0x1581e9[_0xf607('0x4f')]='';}headers['Authorization']=getAuth(_0x1a323d);return getUser(_0x1a323d)['then'](function(_0x3361f7){_0x59b478=_0x3361f7;logger[_0xf607('0x16')](_0xf607('0x53'),_0x59b478['id']);return getEndUser(_0x1a323d,_0x1581e9['calleridname'],_0x1581e9[_0xf607('0x6e')]);})[_0xf607('0x1c')](function(_0x5e1094){_0x16a011=_0x5e1094;logger[_0xf607('0x16')](_0xf607('0x67'),_0x16a011['id']);return getTicket(_0x1a323d,_0x59b478,_0x16a011,_0x5dfc20,_0x1581e9);})[_0xf607('0x1c')](function(_0x32be56){if(_0x32be56){logger[_0xf607('0x16')](_0xf607('0x54'),_0x32be56['id']);}})['catch'](function(_0x1d2251){logger[_0xf607('0x5e')]('['+_0x1581e9[_0xf607('0x6c')]['toUpperCase']()+']'+_0xf607('0x6f'),util[_0xf607('0x6b')](_0x1d2251,{'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 20ad6b0..1b76b92 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 _0x7b70=['rejected','Call_Result','Abandoned','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','POST','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','serverUrl','recordingFormat','none','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','toUpperCase','lodash','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','defaults','redis','localhost','socket.io-emitter','debug','stringify','length','forEach','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','indexOf','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','profile','Administrator','Using\x20the\x20admin\x20account!','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','format','mm:ss','answertime','endtime','Call_Duration','utc','diff','YYYY-MM-DDTHH:mm:ss','lastevent','called','Called','Answered'];(function(_0x584919,_0x442aeb){var _0x497531=function(_0x1737b9){while(--_0x1737b9){_0x584919['push'](_0x584919['shift']());}};_0x497531(++_0x442aeb);}(_0x7b70,0xc4));var _0x07b7=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x7b70[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0x07b7('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x07b7('0x1'));var intUtil=require(_0x07b7('0x2'));var moment=require(_0x07b7('0x3'));var Redis=require(_0x07b7('0x4'));var BPromise=require(_0x07b7('0x5'));var config=require(_0x07b7('0x6'));var logger=require('../../../../config/logger')(_0x07b7('0x7'));config['redis']=_[_0x07b7('0x8')](config[_0x07b7('0x9')],{'host':_0x07b7('0xa'),'port':0x18eb});var io=require(_0x07b7('0xb'))(new Redis(config['redis']));function emit(_0x36033d,_0x58d1e6,_0x28e656){io['to'](_0x36033d)['emit'](_0x58d1e6,_0x28e656);}function request(_0x555d78){logger[_0x07b7('0xc')]('[HTTP]',JSON[_0x07b7('0xd')](_0x555d78));return rp(_0x555d78);}function getCustomFields(_0x789e2d,_0x4a41fc){var _0x53bbdc={};if(_0x789e2d[_0x07b7('0xe')]>0x0){_[_0x07b7('0xf')](_0x789e2d,function(_0x41a8a8){if(_['includes'](['string',_0x07b7('0x10')],_0x41a8a8[_0x07b7('0x11')])&&_0x41a8a8['idField']){_0x53bbdc[_0x41a8a8[_0x07b7('0x12')]]=_0x41a8a8[_0x07b7('0x13')][_0x07b7('0x14')]();}else if(_0x41a8a8[_0x07b7('0x11')]===_0x07b7('0x15')&&_0x41a8a8[_0x07b7('0x16')]&&_0x41a8a8[_0x07b7('0x12')]&&_0x4a41fc[_0x41a8a8['variableName']]){_0x53bbdc[_0x41a8a8[_0x07b7('0x12')]]=_0x4a41fc[_0x41a8a8['variableName']][_0x07b7('0x14')]();}else if(_0x41a8a8[_0x07b7('0x11')]===_0x07b7('0x17')&&_0x41a8a8[_0x07b7('0x18')]&&_0x41a8a8[_0x07b7('0x18')]['name']&&_0x41a8a8[_0x07b7('0x12')]&&_0x4a41fc[_0x41a8a8[_0x07b7('0x18')][_0x07b7('0x19')]['toLowerCase']()]){_0x53bbdc[_0x41a8a8[_0x07b7('0x12')]]=_0x4a41fc[_0x41a8a8[_0x07b7('0x18')][_0x07b7('0x19')]['toLowerCase']()][_0x07b7('0x14')]();}});}return _0x53bbdc;}function getName(_0x1d3296){if(_0x1d3296[_0x07b7('0x1a')]('\x20')>0x0){var _0x2980e8=_0x1d3296['split'](/ (.+)/);if(_0x2980e8[0x1]){return _0x2980e8;}}return[_0x1d3296,_0x1d3296];}var accountsTokens={};function getAccessToken(_0x3a1675){return new Promise(function(_0x52a4ce,_0xaf6f13){if(!_[_0x07b7('0x1b')](accountsTokens[_0x3a1675['id']])&&!_['isNil'](accountsTokens[_0x3a1675['id']][_0x07b7('0x1c')])){if(moment()[_0x07b7('0x1d')](accountsTokens[_0x3a1675['id']][_0x07b7('0x1e')])){_0x52a4ce(accountsTokens[_0x3a1675['id']][_0x07b7('0x1c')]);}}var _0x599ba8;switch(_0x3a1675['zone']){case'US':_0x599ba8='https://accounts.zoho.com';break;case'AU':_0x599ba8=_0x07b7('0x1f');break;case'EU':_0x599ba8=_0x07b7('0x20');break;case'IN':_0x599ba8=_0x07b7('0x21');break;case'CN':_0x599ba8=_0x07b7('0x22');break;default:_0x599ba8=_0x07b7('0x20');break;}var _0x30c0f8={'method':'POST','uri':_0x599ba8+_0x07b7('0x23'),'qs':{'refresh_token':_0x3a1675[_0x07b7('0x24')],'client_id':_0x3a1675[_0x07b7('0x25')],'client_secret':_0x3a1675[_0x07b7('0x26')],'grant_type':_0x07b7('0x27')},'json':!![]};return rp(_0x30c0f8)[_0x07b7('0x28')](function(_0x182c11){accountsTokens[_0x3a1675['id']]={'access_token':_0x182c11[_0x07b7('0x1c')],'expires_in':moment()[_0x07b7('0x29')](_0x182c11[_0x07b7('0x1e')],_0x07b7('0x2a'))};_0x52a4ce(_0x182c11[_0x07b7('0x1c')]);})[_0x07b7('0x2b')](function(_0x35528e){logger['error'](_0x07b7('0x2c'),_0x35528e[_0x07b7('0x2d')]);_0xaf6f13(_0x35528e);});});}function getUser(_0x1b4ad6,_0x4b3c3f,_0x5be487,_0x4889f7){logger[_0x07b7('0x2e')](_0x07b7('0x2f'));return request({'method':_0x07b7('0x30'),'uri':util['format'](_0x07b7('0x31'),_0x4b3c3f),'qs':{'type':_0x07b7('0x32')},'headers':{'Authorization':_0x07b7('0x33')+_0x1b4ad6},'json':!![]})['then'](function(_0x464802){if(_0x464802[_0x07b7('0x34')]){var _0x2068e3=-0x1;if(_[_0x07b7('0x35')](_0x464802[_0x07b7('0x34')])){if(!_['isNil'](_0x4889f7)){_0x2068e3=_[_0x07b7('0x36')](_0x464802[_0x07b7('0x34')],function(_0x81ab35){return _0x81ab35[_0x07b7('0x37')]===_0x4889f7;});}if(_0x2068e3>=0x0){logger[_0x07b7('0x2e')]('Agent\x20found!');}else{logger[_0x07b7('0x2e')]('Using\x20the\x20admin\x20account!');_0x2068e3=_[_0x07b7('0x36')](_0x464802[_0x07b7('0x34')],function(_0x4a297c){return _0x4a297c[_0x07b7('0x38')][_0x07b7('0x19')]===_0x07b7('0x39');});}return _0x464802[_0x07b7('0x34')][_0x2068e3];}else{if(_0x464802['user'][_0x07b7('0x38')][_0x07b7('0x19')]===_0x07b7('0x39')){logger[_0x07b7('0x2e')](_0x07b7('0x3a'));user=_0x464802[_0x07b7('0x3b')];return user;}else{logger[_0x07b7('0x3c')](_0x07b7('0x3d'),JSON[_0x07b7('0xd')](_0x464802));throw new Error(_0x07b7('0x3e')+JSON['stringify'](_0x464802));}}}else{logger[_0x07b7('0x3c')]('The\x20failing\x20result\x20is',JSON[_0x07b7('0xd')](_0x464802));throw new Error(_0x07b7('0x3e')+JSON['stringify'](_0x464802));}})[_0x07b7('0x2b')](function(_0x3ac577){console[_0x07b7('0x3c')](_0x3ac577);});}function getZohoUser(_0x44a7ea,_0x3917c1){return new BPromise(function(_0x56c64b,_0xdf5d80){request(_0x44a7ea)[_0x07b7('0x28')](function(_0x3f7b34){var _0x7693c1=null;if(_0x3f7b34){_0x7693c1=_0x3f7b34[_0x07b7('0x3f')][0x0];_0x7693c1[_0x07b7('0x40')]=_0x3917c1;}_0x56c64b(_0x7693c1);})[_0x07b7('0x2b')](function(_0x3a1bd5){_0xdf5d80(_0x3a1bd5);});});}function createEndUser(_0x2e3b75,_0x5f143a,_0x95379,_0x2c62e0,_0x18c58b,_0x2b2ec3){var _0x95379=getName(_0x95379);return request({'method':'POST','uri':_0x07b7('0x41')+_0x5f143a+_0x07b7('0x42')+_[_0x07b7('0x43')](_0x2b2ec3[_0x07b7('0x44')])+'s','body':{'data':[{'Last_Name':_0x95379[0x1],'First_Name':_0x95379[0x0],'Phone':_0x2c62e0,'Owner':{'name':!_[_0x07b7('0x1b')](_0x18c58b['role'][_0x07b7('0x19')])?_0x18c58b[_0x07b7('0x45')]['name']:!_['isNil'](_0x18c58b[_0x07b7('0x46')])?_0x18c58b[_0x07b7('0x46')]+'\x20'+_0x18c58b[_0x07b7('0x47')]:_0x18c58b[_0x07b7('0x47')],'id':_0x18c58b['id']}}]},'headers':{'Authorization':_0x07b7('0x33')+_0x2e3b75},'json':!![]})['then'](function(_0x7a55ce){if(_0x7a55ce&&_0x7a55ce[_0x07b7('0x3f')][0x0][_0x07b7('0x48')]===_0x07b7('0x49')){var _0x22b346=_0x7a55ce[_0x07b7('0x3f')][0x0][_0x07b7('0x4a')];_0x22b346[_0x07b7('0x40')]=_['startCase'](_0x2b2ec3['moduleCreate'])+'s';return _0x22b346;}logger[_0x07b7('0x3c')]('The\x20failing\x20result\x20is',JSON[_0x07b7('0xd')](data));throw new Error(_0x07b7('0x4b')+JSON['stringify'](data));})[_0x07b7('0x2b')](function(_0x32e6d6){console[_0x07b7('0x4c')]('CREATE\x20ERROR',_0x32e6d6);});}function getEndUser(_0x992271,_0x55a444,_0x139756,_0x49e11c,_0x415df4,_0x14566d,_0x294ea1){var _0x283abc={'method':_0x07b7('0x30'),'uri':'','headers':{'Authorization':_0x07b7('0x33')+_0x992271},'json':!![]};switch(_0x294ea1[_0x07b7('0x4d')]){case _0x07b7('0x4e'):_0x283abc[_0x07b7('0x4f')]=_0x07b7('0x41')+_0x55a444+_0x07b7('0x50')+_0x415df4+'))';return getZohoUser(_0x283abc,_0x07b7('0x51'))[_0x07b7('0x28')](function(_0x2d493b){if(_0x2d493b)return _0x2d493b;_0x283abc[_0x07b7('0x4f')]=_0x07b7('0x41')+_0x55a444+_0x07b7('0x52')+_0x415df4+'))';return getZohoUser(_0x283abc,'Leads')[_0x07b7('0x28')](function(_0x485bd8){if(_0x485bd8)return _0x485bd8;if(_0x294ea1[_0x07b7('0x44')]!=_0x07b7('0x53')){return createEndUser(_0x992271,_0x55a444,_0x49e11c,_0x415df4,_0x14566d,_0x294ea1);}else{return{};}});});break;case'contact':_0x283abc[_0x07b7('0x4f')]='https://www.zohoapis.'+_0x55a444+_0x07b7('0x50')+_0x415df4+'))';return getZohoUser(_0x283abc,_0x07b7('0x51'))[_0x07b7('0x28')](function(_0x5740d8){if(_0x5740d8)return _0x5740d8;if(_0x294ea1['moduleCreate']!=_0x07b7('0x53')){return createEndUser(_0x992271,_0x55a444,_0x49e11c,_0x415df4,_0x14566d,_0x294ea1);}else{return{};}});break;case _0x07b7('0x54'):_0x283abc[_0x07b7('0x4f')]='https://www.zohoapis.'+_0x55a444+_0x07b7('0x52')+_0x415df4+'))';return getZohoUser(_0x283abc,_0x07b7('0x55'))[_0x07b7('0x28')](function(_0x490e6f){if(_0x490e6f)return _0x490e6f;if(_0x294ea1[_0x07b7('0x44')]!='nothing'){return createEndUser(_0x992271,_0x55a444,_0x49e11c,_0x415df4,_0x14566d,_0x294ea1);}else{return{};}});break;}}function getCall(_0x3f99c7,_0xb96e3a,_0x4c2685,_0x4c2e7f,_0x342524,_0x9eec41,_0x475ce3,_0x2f8f69){logger[_0x07b7('0x2e')]('Creating\x20new\x20call...');var _0x1c550e={};_0x1c550e['Owner']={'name':!_[_0x07b7('0x1b')](_0x4c2e7f[_0x07b7('0x45')]['name'])&&!_['isNil'](_0x4c2e7f[_0x07b7('0x38')][_0x07b7('0x19')])&&_0x4c2e7f[_0x07b7('0x38')][_0x07b7('0x19')]==='administrator'?_0x4c2e7f[_0x07b7('0x45')][_0x07b7('0x19')]:!_[_0x07b7('0x1b')](_0x4c2e7f['first_name'])?_0x4c2e7f[_0x07b7('0x46')]+'\x20'+_0x4c2e7f[_0x07b7('0x47')]:_0x4c2e7f[_0x07b7('0x47')],'id':_0x4c2e7f['id']};_0x1c550e[_0x07b7('0x56')]=intUtil[_0x07b7('0x57')](_0x9eec41[_0x07b7('0x58')],_0x475ce3,'\x20');_0x1c550e[_0x07b7('0x59')]=intUtil[_0x07b7('0x57')](_0x9eec41[_0x07b7('0x5a')],_0x475ce3,'\x0a');if(_0x342524[_0x07b7('0x40')]===_0x07b7('0x51')){_0x1c550e[_0x07b7('0x5b')]={'name':!_[_0x07b7('0x1b')](_0x342524['Full_Name'])?_0x342524[_0x07b7('0x5c')]:!_[_0x07b7('0x1b')](_0x342524[_0x07b7('0x5d')])?_0x342524['First_Name']+'\x20'+_0x342524['Last_Name']:_0x342524[_0x07b7('0x5e')],'id':_0x342524['id']};}if(_0x342524[_0x07b7('0x40')]===_0x07b7('0x55')){_0x1c550e[_0x07b7('0x5f')]={'name':!_[_0x07b7('0x1b')](_0x342524['Full_Name'])?_0x342524[_0x07b7('0x5c')]:!_[_0x07b7('0x1b')](_0x342524[_0x07b7('0x5d')])?_0x342524[_0x07b7('0x5d')]+'\x20'+_0x342524[_0x07b7('0x5e')]:_0x342524[_0x07b7('0x5e')],'id':_0x342524['id']};_0x1c550e[_0x07b7('0x60')]=_['startCase'](_0x342524[_0x07b7('0x40')]);}if(_0x475ce3[_0x07b7('0x61')]){_0x1c550e['Call_Duration']=moment['utc'](parseInt(_0x475ce3[_0x07b7('0x61')])*0x3e8)[_0x07b7('0x62')](_0x07b7('0x63'));}else if(_0x475ce3[_0x07b7('0x64')]&&_0x475ce3[_0x07b7('0x65')]){_0x1c550e[_0x07b7('0x66')]=moment[_0x07b7('0x67')](moment(_0x475ce3[_0x07b7('0x65')],'YYYY-MM-DDTHH:mm:ss')[_0x07b7('0x68')](moment(_0x475ce3['starttime'],_0x07b7('0x69'))))[_0x07b7('0x62')](_0x07b7('0x63'));}switch(_0x475ce3[_0x07b7('0x6a')]){case _0x07b7('0x6b'):_0x1c550e['Call_Result']=_0x07b7('0x6c');break;case'complete':case'connect':_0x1c550e['Call_Result']=_0x07b7('0x6d');break;case _0x07b7('0x6e'):_0x1c550e[_0x07b7('0x6f')]='Rejected';break;case'abandoned':_0x1c550e[_0x07b7('0x6f')]=_0x07b7('0x70');break;case'timeout':_0x1c550e[_0x07b7('0x6f')]=_0x07b7('0x71');default:}_0x1c550e[_0x07b7('0x72')]=(_0x2f8f69===_0x07b7('0x73')?moment(_0x475ce3[_0x07b7('0x74')])[_0x07b7('0x62')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x475ce3[_0x07b7('0x75')])[_0x07b7('0x62')](_0x07b7('0x69')))||moment()['format'](_0x07b7('0x69'));_0x1c550e[_0x07b7('0x76')]=_0x2f8f69||_0x07b7('0x77');_0x1c550e=_[_0x07b7('0x78')](_0x1c550e,getCustomFields(_0x9eec41[_0x07b7('0x79')],_0x475ce3));return request({'method':_0x07b7('0x7a'),'uri':_0x07b7('0x41')+_0xb96e3a+_0x07b7('0x7b'),'headers':{'Authorization':_0x07b7('0x33')+_0x3f99c7},'body':{'data':[_0x1c550e]},'json':!![]})[_0x07b7('0x28')](function(_0x54cea2){if(_0x54cea2&&_0x54cea2[_0x07b7('0x3f')][0x0][_0x07b7('0x48')]===_0x07b7('0x49')){logger[_0x07b7('0x2e')](_0x07b7('0x7c'));return{'id':_0x54cea2[_0x07b7('0x3f')][0x0][_0x07b7('0x4a')]['id']};}})[_0x07b7('0x2b')](function(_0x4b30b9){logger[_0x07b7('0x2e')](_0x07b7('0x7d'),_0x4b30b9[_0x07b7('0x2d')]);console[_0x07b7('0x4c')](_0x07b7('0x7d'),_0x4b30b9);});}exports['queue']=function(_0x2c6713,_0x11a4da,_0x469fa0,_0x457a76,_0x2fa2a0,_0x48c204){var _0x23e0bd,_0x3f556f,_0x5e6b87;_0x48c204[_0x07b7('0x7e')]=intUtil['stripTrailingSlash'](_0x48c204[_0x07b7('0x7e')]);_0x48c204['serverUrl']=intUtil[_0x07b7('0x7f')](_0x48c204['serverUrl']);if(_0x2fa2a0&&_0x2fa2a0[_0x07b7('0x80')]){logger[_0x07b7('0x2e')](_0x07b7('0x81'),_0x07b7('0x82'));_0x11a4da['recordingURL']=_0x48c204['serverUrl']+'/api/voice/recordings/'+_0x11a4da[_0x07b7('0x83')]+_0x07b7('0x84')+md5(_0x11a4da[_0x07b7('0x83')]);}else{_0x11a4da[_0x07b7('0x85')]='';}var _0x11c7f0=_0x48c204[_0x07b7('0x7e')]===_0x07b7('0x86')?'eu':_0x07b7('0x87');return getAccessToken(_0x48c204)['then'](function(_0x43f94a){_0x5e6b87=_0x43f94a;return getUser(_0x5e6b87,_0x11c7f0,_0x48c204,_0x457a76[_0x07b7('0x37')]);})[_0x07b7('0x28')](function(_0x480836){_0x23e0bd=_0x480836;logger[_0x07b7('0x2e')](_0x07b7('0x88'),_0x23e0bd['id']);return getEndUser(_0x5e6b87,_0x11c7f0,_0x48c204,_0x11a4da[_0x07b7('0x89')],_0x11a4da[_0x07b7('0x8a')],_0x23e0bd,_0x469fa0);})[_0x07b7('0x28')](function(_0x5222fe){_0x3f556f=_0x5222fe;return getCall(_0x5e6b87,_0x11c7f0,_0x48c204,_0x23e0bd,_0x3f556f,_0x469fa0,_0x11a4da,_0x07b7('0x77'));})['then'](function(_0x40c44e){if(_0x40c44e){logger[_0x07b7('0x2e')]('The\x20Call\x20ID\x20is:',_0x40c44e['id']);logger['info'](_0x07b7('0x81'),_0x07b7('0x8b'));emit(util[_0x07b7('0x62')](_0x07b7('0x8c'),_0x457a76[_0x07b7('0x19')]),_0x07b7('0x8d'),{'uri':_0x07b7('0x8e')+_0x48c204[_0x07b7('0x7e')]+_0x07b7('0x8f')+_0x40c44e['id']});}})['catch'](function(_0x1ac44f){logger[_0x07b7('0x3c')](_0x07b7('0x81'),JSON[_0x07b7('0xd')](_0x1ac44f));});};exports[_0x07b7('0x73')]=function(_0x22b555,_0x4e90ba,_0x3b342f,_0x5226e9,_0x2db0e0,_0x2edbe9,_0x842ea8){var _0x5d3d04,_0x291723,_0x131b9b;_0x2edbe9[_0x07b7('0x7e')]=intUtil[_0x07b7('0x7f')](_0x2edbe9[_0x07b7('0x7e')]);_0x2edbe9[_0x07b7('0x90')]=intUtil[_0x07b7('0x7f')](_0x2edbe9['serverUrl']);if(_0x842ea8&&_0x842ea8[_0x07b7('0x91')]&&_0x842ea8[_0x07b7('0x91')]!==_0x07b7('0x92')){logger[_0x07b7('0x2e')]('[OUTBOUND]',_0x07b7('0x82'));_0x4e90ba[_0x07b7('0x85')]=_0x2edbe9[_0x07b7('0x90')]+_0x07b7('0x93')+_0x4e90ba[_0x07b7('0x83')]+_0x07b7('0x84')+md5(_0x4e90ba[_0x07b7('0x83')]);}var _0x5e190a=_0x2edbe9[_0x07b7('0x7e')]===_0x07b7('0x86')?'eu':_0x07b7('0x87');return getAccessToken(_0x2edbe9)['then'](function(_0x552969){_0x131b9b=_0x552969;return getUser(_0x131b9b,_0x5e190a,_0x2edbe9,_0x5226e9[_0x07b7('0x37')]);})[_0x07b7('0x28')](function(_0x5032eb){_0x5d3d04=_0x5032eb;logger['info'](_0x07b7('0x88'),_0x5d3d04['id']);return getEndUser(_0x131b9b,_0x5e190a,_0x2edbe9,_0x4e90ba[_0x07b7('0x94')],_0x4e90ba[_0x07b7('0x95')],_0x5d3d04,_0x3b342f);})['then'](function(_0x5721cb){_0x291723=_0x5721cb;return getCall(_0x131b9b,_0x5e190a,_0x2edbe9,_0x5d3d04,_0x291723,_0x3b342f,_0x4e90ba,_0x07b7('0x96'));})[_0x07b7('0x28')](function(_0x51ded4){if(_0x51ded4){logger['info']('The\x20Call\x20ID\x20is:',_0x51ded4['id']);logger[_0x07b7('0x2e')](_0x07b7('0x97'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x07b7('0x62')](_0x07b7('0x8c'),_0x5226e9[_0x07b7('0x19')]),_0x07b7('0x8d'),{'uri':'https://crm.'+_0x2edbe9['host']+_0x07b7('0x8f')+_0x51ded4['id']});}})['catch'](function(_0x4bb894){logger[_0x07b7('0x3c')]('[OUTBOUND]',JSON['stringify'](_0x4bb894));});};exports['unmanaged']=function(_0x58b57c,_0x4a13ef,_0x34b72c,_0x1bf029,_0x2f2359,_0x14b905){var _0x32007f,_0xe6b769,_0x1ec130;_0x14b905[_0x07b7('0x7e')]=intUtil[_0x07b7('0x7f')](_0x14b905[_0x07b7('0x7e')]);_0x14b905['serverUrl']=intUtil['stripTrailingSlash'](_0x14b905[_0x07b7('0x90')]);if(_0x2f2359&&_0x2f2359['monitor_format']){logger[_0x07b7('0x2e')]('['+_0x4a13ef[_0x07b7('0x6a')][_0x07b7('0x98')]()+']',_0x07b7('0x82'));_0x4a13ef[_0x07b7('0x85')]=_0x14b905[_0x07b7('0x90')]+'/api/voice/recordings/'+_0x4a13ef[_0x07b7('0x83')]+_0x07b7('0x84')+md5(_0x4a13ef['uniqueid']);}else{_0x4a13ef[_0x07b7('0x85')]='';}var _0x173832=_0x14b905[_0x07b7('0x7e')]===_0x07b7('0x86')?'eu':_0x07b7('0x87');return getAccessToken(_0x14b905)['then'](function(_0x49fb47){_0x1ec130=_0x49fb47;return getUser(_0x1ec130,_0x173832,_0x14b905);})['then'](function(_0xf3fce3){_0x32007f=_0xf3fce3;logger[_0x07b7('0x2e')](_0x07b7('0x88'),_0x32007f['id']);return getEndUser(_0x1ec130,_0x173832,_0x14b905,_0x4a13ef['calleridname'],_0x4a13ef[_0x07b7('0x8a')],_0x32007f,_0x34b72c);})[_0x07b7('0x28')](function(_0xd6005e){_0xe6b769=_0xd6005e;return getCall(_0x1ec130,_0x173832,_0x14b905,_0x32007f,_0xe6b769,_0x34b72c,_0x4a13ef,_0x07b7('0x77'));})[_0x07b7('0x28')](function(_0x552c4b){if(_0x552c4b){logger[_0x07b7('0x2e')]('The\x20Call\x20ID\x20is:',_0x552c4b['id']);}})[_0x07b7('0x2b')](function(_0x4c6666){logger[_0x07b7('0x3c')]('['+_0x4a13ef[_0x07b7('0x6a')][_0x07b7('0x98')]()+']',JSON[_0x07b7('0xd')](_0x4c6666));});}; \ No newline at end of file +var _0x5be0=['Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','destcalleridname','Outbound','[OUTBOUND]','https://crm.','unmanaged','toUpperCase','zoho.eu','lodash','request-promise','md5','util','./util','ioredis','bluebird','zoho','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','idField','content','toString','type','variableName','Variable','name','toLowerCase','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','email','info','Using\x20the\x20admin\x20account!','findIndex','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','Error:\x20','contact_lead','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','Leads','What_Id','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','complete','connect','Answered','rejected','Abandoned','Timeout','Call_Start_Time','starttime','agentcalledAt'];(function(_0x41bb97,_0x5edc27){var _0x551f03=function(_0x2531ff){while(--_0x2531ff){_0x41bb97['push'](_0x41bb97['shift']());}};_0x551f03(++_0x5edc27);}(_0x5be0,0x154));var _0x05be=function(_0x4ab98e,_0x1c9ce1){_0x4ab98e=_0x4ab98e-0x0;var _0x17945b=_0x5be0[_0x4ab98e];return _0x17945b;};'use strict';var _=require(_0x05be('0x0'));var rp=require(_0x05be('0x1'));var md5=require(_0x05be('0x2'));var util=require(_0x05be('0x3'));var intUtil=require(_0x05be('0x4'));var moment=require('moment');var Redis=require(_0x05be('0x5'));var BPromise=require(_0x05be('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x05be('0x7'));config['redis']=_[_0x05be('0x8')](config['redis'],{'host':_0x05be('0x9'),'port':0x18eb});var io=require(_0x05be('0xa'))(new Redis(config['redis']));function emit(_0x202529,_0x228ed4,_0x425b2b){io['to'](_0x202529)[_0x05be('0xb')](_0x228ed4,_0x425b2b);}function request(_0x167aa2){logger[_0x05be('0xc')](_0x05be('0xd'),JSON[_0x05be('0xe')](_0x167aa2));return rp(_0x167aa2);}function getCustomFields(_0x4929fa,_0x428db2){var _0x1aa4df={};if(_0x4929fa[_0x05be('0xf')]>0x0){_[_0x05be('0x10')](_0x4929fa,function(_0x3fd7e4){if(_['includes']([_0x05be('0x11'),'picklist'],_0x3fd7e4['type'])&&_0x3fd7e4[_0x05be('0x12')]){_0x1aa4df[_0x3fd7e4[_0x05be('0x12')]]=_0x3fd7e4[_0x05be('0x13')][_0x05be('0x14')]();}else if(_0x3fd7e4[_0x05be('0x15')]==='variable'&&_0x3fd7e4[_0x05be('0x16')]&&_0x3fd7e4[_0x05be('0x12')]&&_0x428db2[_0x3fd7e4[_0x05be('0x16')]]){_0x1aa4df[_0x3fd7e4['idField']]=_0x428db2[_0x3fd7e4[_0x05be('0x16')]][_0x05be('0x14')]();}else if(_0x3fd7e4[_0x05be('0x15')]==='customVariable'&&_0x3fd7e4[_0x05be('0x17')]&&_0x3fd7e4[_0x05be('0x17')]['name']&&_0x3fd7e4[_0x05be('0x12')]&&_0x428db2[_0x3fd7e4['Variable'][_0x05be('0x18')][_0x05be('0x19')]()]){_0x1aa4df[_0x3fd7e4['idField']]=_0x428db2[_0x3fd7e4[_0x05be('0x17')][_0x05be('0x18')][_0x05be('0x19')]()]['toString']();}});}return _0x1aa4df;}function getName(_0x12d102){if(_0x12d102['indexOf']('\x20')>0x0){var _0x4ac091=_0x12d102[_0x05be('0x1a')](/ (.+)/);if(_0x4ac091[0x1]){return _0x4ac091;}}return[_0x12d102,_0x12d102];}var accountsTokens={};function getAccessToken(_0x83765f){return new Promise(function(_0x49f3a7,_0x58e5b5){if(!_[_0x05be('0x1b')](accountsTokens[_0x83765f['id']])&&!_['isNil'](accountsTokens[_0x83765f['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x83765f['id']][_0x05be('0x1c')])){_0x49f3a7(accountsTokens[_0x83765f['id']][_0x05be('0x1d')]);}}var _0x1e6d3e;switch(_0x83765f[_0x05be('0x1e')]){case'US':_0x1e6d3e='https://accounts.zoho.com';break;case'AU':_0x1e6d3e=_0x05be('0x1f');break;case'EU':_0x1e6d3e='https://accounts.zoho.eu';break;case'IN':_0x1e6d3e=_0x05be('0x20');break;case'CN':_0x1e6d3e=_0x05be('0x21');break;default:_0x1e6d3e='https://accounts.zoho.eu';break;}var _0x29296b={'method':_0x05be('0x22'),'uri':_0x1e6d3e+_0x05be('0x23'),'qs':{'refresh_token':_0x83765f[_0x05be('0x24')],'client_id':_0x83765f[_0x05be('0x25')],'client_secret':_0x83765f[_0x05be('0x26')],'grant_type':_0x05be('0x27')},'json':!![]};return rp(_0x29296b)[_0x05be('0x28')](function(_0x467d40){accountsTokens[_0x83765f['id']]={'access_token':_0x467d40[_0x05be('0x1d')],'expires_in':moment()[_0x05be('0x29')](_0x467d40[_0x05be('0x1c')],_0x05be('0x2a'))};_0x49f3a7(_0x467d40[_0x05be('0x1d')]);})[_0x05be('0x2b')](function(_0x18edeb){logger[_0x05be('0x2c')](_0x05be('0x2d'),_0x18edeb[_0x05be('0x2e')]);_0x58e5b5(_0x18edeb);});});}function getUser(_0x10ecbf,_0x281c3e,_0x315d51,_0x43f2fa){logger['info'](_0x05be('0x2f'));return request({'method':'GET','uri':util[_0x05be('0x30')](_0x05be('0x31'),_0x281c3e),'qs':{'type':_0x05be('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x10ecbf},'json':!![]})[_0x05be('0x28')](function(_0x6e4f87){if(_0x6e4f87[_0x05be('0x33')]){var _0x489905=-0x1;if(_[_0x05be('0x34')](_0x6e4f87[_0x05be('0x33')])){if(!_[_0x05be('0x1b')](_0x43f2fa)){_0x489905=_['findIndex'](_0x6e4f87['users'],function(_0xcf34a5){return _0xcf34a5[_0x05be('0x35')]===_0x43f2fa;});}if(_0x489905>=0x0){logger[_0x05be('0x36')]('Agent\x20found!');}else{logger[_0x05be('0x36')](_0x05be('0x37'));_0x489905=_[_0x05be('0x38')](_0x6e4f87[_0x05be('0x33')],function(_0x5ed261){return _0x5ed261[_0x05be('0x39')]['name']==='Administrator';});}return _0x6e4f87[_0x05be('0x33')][_0x489905];}else{if(_0x6e4f87[_0x05be('0x3a')]['profile'][_0x05be('0x18')]==='Administrator'){logger[_0x05be('0x36')](_0x05be('0x37'));user=_0x6e4f87['user'];return user;}else{logger[_0x05be('0x2c')](_0x05be('0x3b'),JSON[_0x05be('0xe')](_0x6e4f87));throw new Error(_0x05be('0x3c')+JSON[_0x05be('0xe')](_0x6e4f87));}}}else{logger[_0x05be('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x05be('0xe')](_0x6e4f87));throw new Error(_0x05be('0x3c')+JSON[_0x05be('0xe')](_0x6e4f87));}})['catch'](function(_0x23b232){console[_0x05be('0x2c')](_0x23b232);});}function getZohoUser(_0x3035c6,_0x47f5c4){return new BPromise(function(_0x503887,_0xd4fc86){request(_0x3035c6)['then'](function(_0x39462d){var _0x334176=null;if(_0x39462d){_0x334176=_0x39462d[_0x05be('0x3d')][0x0];_0x334176[_0x05be('0x3e')]=_0x47f5c4;}_0x503887(_0x334176);})[_0x05be('0x2b')](function(_0x2a58db){_0xd4fc86(_0x2a58db);});});}function createEndUser(_0xd33c70,_0xc3ce8f,_0x23c102,_0x5506dc,_0x1f246e,_0x216bef){var _0x23c102=getName(_0x23c102);return request({'method':_0x05be('0x22'),'uri':_0x05be('0x3f')+_0xc3ce8f+_0x05be('0x40')+_[_0x05be('0x41')](_0x216bef[_0x05be('0x42')])+'s','body':{'data':[{'Last_Name':_0x23c102[0x1],'First_Name':_0x23c102[0x0],'Phone':_0x5506dc,'Owner':{'name':!_[_0x05be('0x1b')](_0x1f246e[_0x05be('0x43')][_0x05be('0x18')])?_0x1f246e[_0x05be('0x43')][_0x05be('0x18')]:!_[_0x05be('0x1b')](_0x1f246e[_0x05be('0x44')])?_0x1f246e['first_name']+'\x20'+_0x1f246e[_0x05be('0x45')]:_0x1f246e['last_name'],'id':_0x1f246e['id']}}]},'headers':{'Authorization':_0x05be('0x46')+_0xd33c70},'json':!![]})['then'](function(_0x341d68){if(_0x341d68&&_0x341d68[_0x05be('0x3d')][0x0][_0x05be('0x47')]===_0x05be('0x48')){var _0x42898c=_0x341d68['data'][0x0][_0x05be('0x49')];_0x42898c[_0x05be('0x3e')]=_[_0x05be('0x41')](_0x216bef['moduleCreate'])+'s';return _0x42898c;}logger['error'](_0x05be('0x3b'),JSON[_0x05be('0xe')](data));throw new Error(_0x05be('0x4a')+JSON['stringify'](data));})['catch'](function(_0x572fed){console['log']('CREATE\x20ERROR',_0x572fed);});}function getEndUser(_0x52f925,_0x3b3dd2,_0x50ba3d,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79){var _0x1d17b5={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x52f925},'json':!![]};switch(_0x58ac79['moduleSearch']){case _0x05be('0x4b'):_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,_0x05be('0x4d'))[_0x05be('0x28')](function(_0x534ced){if(_0x534ced)return _0x534ced;_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+_0x05be('0x4e')+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,'Leads')[_0x05be('0x28')](function(_0x419311){if(_0x419311)return _0x419311;if(_0x58ac79[_0x05be('0x42')]!=_0x05be('0x4f')){return createEndUser(_0x52f925,_0x3b3dd2,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79);}else{return{};}});});break;case'contact':_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,_0x05be('0x4d'))[_0x05be('0x28')](function(_0x1e2add){if(_0x1e2add)return _0x1e2add;if(_0x58ac79['moduleCreate']!=_0x05be('0x4f')){return createEndUser(_0x52f925,_0x3b3dd2,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79);}else{return{};}});break;case _0x05be('0x50'):_0x1d17b5[_0x05be('0x4c')]=_0x05be('0x3f')+_0x3b3dd2+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xe7dfc1+'))';return getZohoUser(_0x1d17b5,'Leads')['then'](function(_0x372720){if(_0x372720)return _0x372720;if(_0x58ac79['moduleCreate']!='nothing'){return createEndUser(_0x52f925,_0x3b3dd2,_0x3b060d,_0xe7dfc1,_0x2b3728,_0x58ac79);}else{return{};}});break;}}function getCall(_0x2caf66,_0x11ebc1,_0x15dfa9,_0x35503a,_0x444fe2,_0x3a2fbb,_0x27be62,_0x180ec9){logger['info']('Creating\x20new\x20call...');var _0x383313={};_0x383313['Owner']={'name':!_[_0x05be('0x1b')](_0x35503a[_0x05be('0x43')]['name'])&&!_[_0x05be('0x1b')](_0x35503a[_0x05be('0x39')]['name'])&&_0x35503a[_0x05be('0x39')][_0x05be('0x18')]==='administrator'?_0x35503a['role'][_0x05be('0x18')]:!_['isNil'](_0x35503a[_0x05be('0x44')])?_0x35503a[_0x05be('0x44')]+'\x20'+_0x35503a[_0x05be('0x45')]:_0x35503a['last_name'],'id':_0x35503a['id']};_0x383313[_0x05be('0x51')]=intUtil['getString'](_0x3a2fbb[_0x05be('0x52')],_0x27be62,'\x20');_0x383313[_0x05be('0x53')]=intUtil[_0x05be('0x54')](_0x3a2fbb[_0x05be('0x55')],_0x27be62,'\x0a');if(_0x444fe2[_0x05be('0x3e')]===_0x05be('0x4d')){_0x383313[_0x05be('0x56')]={'name':!_['isNil'](_0x444fe2[_0x05be('0x57')])?_0x444fe2[_0x05be('0x57')]:!_[_0x05be('0x1b')](_0x444fe2['First_Name'])?_0x444fe2['First_Name']+'\x20'+_0x444fe2['Last_Name']:_0x444fe2['Last_Name'],'id':_0x444fe2['id']};}if(_0x444fe2['enduserType']===_0x05be('0x58')){_0x383313[_0x05be('0x59')]={'name':!_[_0x05be('0x1b')](_0x444fe2[_0x05be('0x57')])?_0x444fe2['Full_Name']:!_['isNil'](_0x444fe2['First_Name'])?_0x444fe2[_0x05be('0x5a')]+'\x20'+_0x444fe2[_0x05be('0x5b')]:_0x444fe2[_0x05be('0x5b')],'id':_0x444fe2['id']};_0x383313[_0x05be('0x5c')]=_[_0x05be('0x41')](_0x444fe2[_0x05be('0x3e')]);}if(_0x27be62[_0x05be('0x5d')]){_0x383313[_0x05be('0x5e')]=moment[_0x05be('0x5f')](parseInt(_0x27be62[_0x05be('0x5d')])*0x3e8)[_0x05be('0x30')](_0x05be('0x60'));}else if(_0x27be62[_0x05be('0x61')]&&_0x27be62[_0x05be('0x62')]){_0x383313['Call_Duration']=moment[_0x05be('0x5f')](moment(_0x27be62[_0x05be('0x62')],_0x05be('0x63'))[_0x05be('0x64')](moment(_0x27be62['starttime'],_0x05be('0x63'))))[_0x05be('0x30')](_0x05be('0x60'));}switch(_0x27be62[_0x05be('0x65')]){case _0x05be('0x66'):_0x383313[_0x05be('0x67')]='Called';break;case _0x05be('0x68'):case _0x05be('0x69'):_0x383313[_0x05be('0x67')]=_0x05be('0x6a');break;case _0x05be('0x6b'):_0x383313[_0x05be('0x67')]='Rejected';break;case'abandoned':_0x383313[_0x05be('0x67')]=_0x05be('0x6c');break;case'timeout':_0x383313[_0x05be('0x67')]=_0x05be('0x6d');default:}_0x383313[_0x05be('0x6e')]=(_0x180ec9==='outbound'?moment(_0x27be62[_0x05be('0x6f')])[_0x05be('0x30')](_0x05be('0x63')):moment(_0x27be62[_0x05be('0x70')])['format'](_0x05be('0x63')))||moment()[_0x05be('0x30')]('YYYY-MM-DDTHH:mm:ss');_0x383313[_0x05be('0x71')]=_0x180ec9||_0x05be('0x72');_0x383313=_[_0x05be('0x73')](_0x383313,getCustomFields(_0x3a2fbb[_0x05be('0x74')],_0x27be62));return request({'method':'POST','uri':_0x05be('0x3f')+_0x11ebc1+_0x05be('0x75'),'headers':{'Authorization':_0x05be('0x46')+_0x2caf66},'body':{'data':[_0x383313]},'json':!![]})['then'](function(_0x40c132){if(_0x40c132&&_0x40c132[_0x05be('0x3d')][0x0][_0x05be('0x47')]===_0x05be('0x48')){logger[_0x05be('0x36')](_0x05be('0x76'));return{'id':_0x40c132['data'][0x0]['details']['id']};}})[_0x05be('0x2b')](function(_0x2a2a86){logger['info'](_0x05be('0x77'),_0x2a2a86[_0x05be('0x2e')]);console[_0x05be('0x78')](_0x05be('0x77'),_0x2a2a86);});}exports[_0x05be('0x79')]=function(_0x10d101,_0x49f344,_0x22ca73,_0x328786,_0x59fdb4,_0x2f2aa4){var _0x2f3252,_0x29a937,_0x445085;_0x2f2aa4[_0x05be('0x7a')]=intUtil[_0x05be('0x7b')](_0x2f2aa4[_0x05be('0x7a')]);_0x2f2aa4[_0x05be('0x7c')]=intUtil['stripTrailingSlash'](_0x2f2aa4[_0x05be('0x7c')]);if(_0x59fdb4&&_0x59fdb4[_0x05be('0x7d')]){logger[_0x05be('0x36')](_0x05be('0x7e'),_0x05be('0x7f'));_0x49f344[_0x05be('0x80')]=_0x2f2aa4[_0x05be('0x7c')]+_0x05be('0x81')+_0x49f344[_0x05be('0x82')]+_0x05be('0x83')+md5(_0x49f344['uniqueid']);}else{_0x49f344[_0x05be('0x80')]='';}var _0xd4933c=_0x2f2aa4['host']==='zoho.eu'?'eu':_0x05be('0x84');return getAccessToken(_0x2f2aa4)[_0x05be('0x28')](function(_0x520482){_0x445085=_0x520482;return getUser(_0x445085,_0xd4933c,_0x2f2aa4,_0x328786['email']);})[_0x05be('0x28')](function(_0x4c64e0){_0x2f3252=_0x4c64e0;logger[_0x05be('0x36')](_0x05be('0x85'),_0x2f3252['id']);return getEndUser(_0x445085,_0xd4933c,_0x2f2aa4,_0x49f344[_0x05be('0x86')],_0x49f344[_0x05be('0x87')],_0x2f3252,_0x22ca73);})['then'](function(_0x445620){_0x29a937=_0x445620;return getCall(_0x445085,_0xd4933c,_0x2f2aa4,_0x2f3252,_0x29a937,_0x22ca73,_0x49f344,_0x05be('0x72'));})[_0x05be('0x28')](function(_0x118614){if(_0x118614){logger[_0x05be('0x36')](_0x05be('0x88'),_0x118614['id']);logger[_0x05be('0x36')]('[QUEUE]',_0x05be('0x89'));emit(util['format'](_0x05be('0x8a'),_0x328786['name']),_0x05be('0x8b'),{'uri':'https://crm.'+_0x2f2aa4['host']+_0x05be('0x8c')+_0x118614['id']});}})[_0x05be('0x2b')](function(_0x3c60ff){logger[_0x05be('0x2c')](_0x05be('0x7e'),JSON[_0x05be('0xe')](_0x3c60ff));});};exports[_0x05be('0x8d')]=function(_0x4848d9,_0x8e4cfd,_0x19a8b2,_0x4e2330,_0xfb1c69,_0xd40440,_0x12db15){var _0x564a04,_0x5adc5f,_0x22e210;_0xd40440['host']=intUtil[_0x05be('0x7b')](_0xd40440['host']);_0xd40440[_0x05be('0x7c')]=intUtil[_0x05be('0x7b')](_0xd40440[_0x05be('0x7c')]);if(_0x12db15&&_0x12db15['recordingFormat']&&_0x12db15[_0x05be('0x8e')]!==_0x05be('0x8f')){logger[_0x05be('0x36')]('[OUTBOUND]',_0x05be('0x7f'));_0x8e4cfd['recordingURL']=_0xd40440[_0x05be('0x7c')]+_0x05be('0x81')+_0x8e4cfd[_0x05be('0x82')]+_0x05be('0x83')+md5(_0x8e4cfd[_0x05be('0x82')]);}var _0x80c306=_0xd40440[_0x05be('0x7a')]==='zoho.eu'?'eu':_0x05be('0x84');return getAccessToken(_0xd40440)['then'](function(_0x3798fd){_0x22e210=_0x3798fd;return getUser(_0x22e210,_0x80c306,_0xd40440,_0x4e2330['email']);})[_0x05be('0x28')](function(_0x3fda72){_0x564a04=_0x3fda72;logger[_0x05be('0x36')](_0x05be('0x85'),_0x564a04['id']);return getEndUser(_0x22e210,_0x80c306,_0xd40440,_0x8e4cfd[_0x05be('0x90')],_0x8e4cfd['destcalleridnum'],_0x564a04,_0x19a8b2);})['then'](function(_0x4567af){_0x5adc5f=_0x4567af;return getCall(_0x22e210,_0x80c306,_0xd40440,_0x564a04,_0x5adc5f,_0x19a8b2,_0x8e4cfd,_0x05be('0x91'));})[_0x05be('0x28')](function(_0xd42ebd){if(_0xd42ebd){logger[_0x05be('0x36')](_0x05be('0x88'),_0xd42ebd['id']);logger['info'](_0x05be('0x92'),_0x05be('0x89'));emit(util[_0x05be('0x30')](_0x05be('0x8a'),_0x4e2330[_0x05be('0x18')]),_0x05be('0x8b'),{'uri':_0x05be('0x93')+_0xd40440['host']+_0x05be('0x8c')+_0xd42ebd['id']});}})[_0x05be('0x2b')](function(_0x26a33d){logger[_0x05be('0x2c')](_0x05be('0x92'),JSON[_0x05be('0xe')](_0x26a33d));});};exports[_0x05be('0x94')]=function(_0x23f19e,_0x1212f9,_0x26c735,_0x224155,_0x130ccd,_0x4cc391){var _0x122fa1,_0xe7d8b1,_0x28c81b;_0x4cc391[_0x05be('0x7a')]=intUtil[_0x05be('0x7b')](_0x4cc391[_0x05be('0x7a')]);_0x4cc391[_0x05be('0x7c')]=intUtil['stripTrailingSlash'](_0x4cc391[_0x05be('0x7c')]);if(_0x130ccd&&_0x130ccd['monitor_format']){logger[_0x05be('0x36')]('['+_0x1212f9['lastevent'][_0x05be('0x95')]()+']',_0x05be('0x7f'));_0x1212f9[_0x05be('0x80')]=_0x4cc391['serverUrl']+_0x05be('0x81')+_0x1212f9['uniqueid']+_0x05be('0x83')+md5(_0x1212f9['uniqueid']);}else{_0x1212f9[_0x05be('0x80')]='';}var _0x1155ac=_0x4cc391[_0x05be('0x7a')]===_0x05be('0x96')?'eu':_0x05be('0x84');return getAccessToken(_0x4cc391)['then'](function(_0x49123c){_0x28c81b=_0x49123c;return getUser(_0x28c81b,_0x1155ac,_0x4cc391);})[_0x05be('0x28')](function(_0x576aa4){_0x122fa1=_0x576aa4;logger[_0x05be('0x36')](_0x05be('0x85'),_0x122fa1['id']);return getEndUser(_0x28c81b,_0x1155ac,_0x4cc391,_0x1212f9['calleridname'],_0x1212f9['calleridnum'],_0x122fa1,_0x26c735);})['then'](function(_0x12bf6a){_0xe7d8b1=_0x12bf6a;return getCall(_0x28c81b,_0x1155ac,_0x4cc391,_0x122fa1,_0xe7d8b1,_0x26c735,_0x1212f9,'Inbound');})[_0x05be('0x28')](function(_0x178ca0){if(_0x178ca0){logger['info'](_0x05be('0x88'),_0x178ca0['id']);}})[_0x05be('0x2b')](function(_0x237c91){logger[_0x05be('0x2c')]('['+_0x1212f9[_0x05be('0x65')]['toUpperCase']()+']',JSON['stringify'](_0x237c91));});}; \ 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 74c6ced..194e254 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 _0x0a8a=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','data2','Script','exec','error','format'];(function(_0x1d7d75,_0x1a4377){var _0xbc1a0a=function(_0x31a068){while(--_0x31a068){_0x1d7d75['push'](_0x1d7d75['shift']());}};_0xbc1a0a(++_0x1a4377);}(_0x0a8a,0x147));var _0xa0a8=function(_0x17e070,_0x23fad8){_0x17e070=_0x17e070-0x0;var _0x176c1b=_0x0a8a[_0x17e070];return _0x176c1b;};'use strict';var util=require(_0xa0a8('0x0'));var sh=require(_0xa0a8('0x1'));var Mustache=require(_0xa0a8('0x2'));var logger=require(_0xa0a8('0x3'))('trigger');exports['exec']=function(_0x1a82b3,_0x5261d5){var _0x3f9e0b=_0x1a82b3[_0xa0a8('0x4')]?_0x1a82b3[_0xa0a8('0x4')]:_0xa0a8('0x5');var _0x29d771=_0x1a82b3['data3']?Mustache['render'](_0x1a82b3['data3'],_0x5261d5):_0x5261d5;sh[_0xa0a8('0x6')](_0x29d771,function(_0x28b1dd,_0x33ee99,_0x4387ad){if(_0x28b1dd!==0x0){logger[_0xa0a8('0x7')](util[_0xa0a8('0x8')](_0xa0a8('0x9'),_0x3f9e0b,_0x29d771,_0x28b1dd,_0x4387ad));}else{logger[_0xa0a8('0xa')](util['format'](_0xa0a8('0xb'),_0x3f9e0b,_0x29d771,_0x33ee99));}});}; \ No newline at end of file +var _0x600f=['format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','data2','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x5efacc,_0x2aa396){var _0x293342=function(_0x333457){while(--_0x333457){_0x5efacc['push'](_0x5efacc['shift']());}};_0x293342(++_0x2aa396);}(_0x600f,0x1c5));var _0xf600=function(_0x3145af,_0x53a1d5){_0x3145af=_0x3145af-0x0;var _0x37758a=_0x600f[_0x3145af];return _0x37758a;};'use strict';var util=require('util');var sh=require(_0xf600('0x0'));var Mustache=require(_0xf600('0x1'));var logger=require(_0xf600('0x2'))('trigger');exports['exec']=function(_0x40208,_0x48fb4e){var _0x2e95f4=_0x40208[_0xf600('0x3')]?_0x40208[_0xf600('0x3')]:_0xf600('0x4');var _0x86ed87=_0x40208[_0xf600('0x5')]?Mustache[_0xf600('0x6')](_0x40208[_0xf600('0x5')],_0x48fb4e):_0x48fb4e;sh['exec'](_0x86ed87,function(_0x4ef2b8,_0x29283d,_0x4d305e){if(_0x4ef2b8!==0x0){logger['error'](util['format'](_0xf600('0x7'),_0x2e95f4,_0x86ed87,_0x4ef2b8,_0x4d305e));}else{logger[_0xf600('0x8')](util[_0xf600('0x9')](_0xf600('0xa'),_0x2e95f4,_0x86ed87,_0x29283d));}});}; \ 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 40b2dde..26a4802 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 _0xb2d5=['error','stack','GET','DELETE','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','trigger','exec','data1','toUpperCase','render','data5','number','parse'];(function(_0x11bc40,_0x537bbc){var _0x2b7a99=function(_0x50135b){while(--_0x50135b){_0x11bc40['push'](_0x11bc40['shift']());}};_0x2b7a99(++_0x537bbc);}(_0xb2d5,0x1a9));var _0x5b2d=function(_0x5e75af,_0x568362){_0x5e75af=_0x5e75af-0x0;var _0x3ec941=_0xb2d5[_0x5e75af];return _0x3ec941;};'use strict';var rp=require(_0x5b2d('0x0'));var util=require('util');var _=require(_0x5b2d('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x5b2d('0x2'));exports[_0x5b2d('0x3')]=function(_0x3a67d2,_0x10d981){var _0x59b90d,_0x4fb06f;var _0x154847={'method':_0x3a67d2[_0x5b2d('0x4')][_0x5b2d('0x5')](),'uri':Mustache[_0x5b2d('0x6')](_0x3a67d2['data2'],_0x10d981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3a67d2[_0x5b2d('0x7')])===_0x5b2d('0x8')&&parseInt(_0x3a67d2[_0x5b2d('0x7')])>=0x1&&parseInt(_0x3a67d2[_0x5b2d('0x7')])<=0xa?parseInt(_0x3a67d2['data5'])*0x3e8:0x5*0x3e8};try{_0x154847['headers']=_0x3a67d2['data6']?JSON[_0x5b2d('0x9')](Mustache[_0x5b2d('0x6')](_0x3a67d2['data6'],_0x10d981)):{};}catch(_0x20add2){logger[_0x5b2d('0xa')](_0x20add2[_0x5b2d('0xb')]);}switch(_0x3a67d2[_0x5b2d('0x4')][_0x5b2d('0x5')]()){case _0x5b2d('0xc'):case _0x5b2d('0xd'):_0x59b90d=null;_0x154847['qs']=_0x10d981;break;case'POST':case _0x5b2d('0xe'):if(_0x3a67d2['data7']){try{_0x59b90d=JSON[_0x5b2d('0x9')](Mustache[_0x5b2d('0x6')](_0x3a67d2[_0x5b2d('0xf')],_0x10d981));_0x154847[_0x5b2d('0x10')]=_0x59b90d;}catch(_0x2ab74b){logger['error'](_0x2ab74b['stack']);logger[_0x5b2d('0xa')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x59b90d=_0x10d981;_0x154847[_0x5b2d('0x10')]=_0x59b90d;}break;}logger[_0x5b2d('0x11')](util[_0x5b2d('0x12')](_0x5b2d('0x13'),_0x3a67d2[_0x5b2d('0x4')],_0x3a67d2[_0x5b2d('0x14')],JSON[_0x5b2d('0x15')](_0x154847)));rp(_0x154847)[_0x5b2d('0x16')](function(_0x5048ff){_0x59b90d=!_[_0x5b2d('0x17')](_0x59b90d)?',\x20request\x20body:\x20'+_0x59b90d:'';_0x4fb06f=typeof _0x5048ff[_0x5b2d('0x10')]===_0x5b2d('0x18')?JSON[_0x5b2d('0x15')](_0x5048ff[_0x5b2d('0x10')]):_0x5048ff['body'];logger['info'](util[_0x5b2d('0x12')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x3a67d2['data1'],_0x3a67d2[_0x5b2d('0x14')],_0x5048ff[_0x5b2d('0x19')],_0x4fb06f));})[_0x5b2d('0x1a')](function(_0x97d29){logger['error'](util[_0x5b2d('0x12')](_0x5b2d('0x1b'),_0x3a67d2[_0x5b2d('0x4')],_0x3a67d2['data2'],_0x97d29[_0x5b2d('0x19')],_0x97d29[_0x5b2d('0x1c')],_0x97d29['message']));});}; \ No newline at end of file +var _0x91bb=['toUpperCase','render','data5','data6','parse','error','stack','data1','GET','DELETE','POST','PUT','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','then','isNil',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec'];(function(_0x2301de,_0x24321d){var _0x567d75=function(_0x35a1c1){while(--_0x35a1c1){_0x2301de['push'](_0x2301de['shift']());}};_0x567d75(++_0x24321d);}(_0x91bb,0x65));var _0xb91b=function(_0x338f03,_0x28941b){_0x338f03=_0x338f03-0x0;var _0x514d7e=_0x91bb[_0x338f03];return _0x514d7e;};'use strict';var rp=require(_0xb91b('0x0'));var util=require(_0xb91b('0x1'));var _=require(_0xb91b('0x2'));var Mustache=require(_0xb91b('0x3'));var logger=require(_0xb91b('0x4'))(_0xb91b('0x5'));exports[_0xb91b('0x6')]=function(_0x25a7ba,_0xffbc2b){var _0x424282,_0x4d80c1;var _0x294acc={'method':_0x25a7ba['data1'][_0xb91b('0x7')](),'uri':Mustache[_0xb91b('0x8')](_0x25a7ba['data2'],_0xffbc2b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x25a7ba[_0xb91b('0x9')])==='number'&&parseInt(_0x25a7ba[_0xb91b('0x9')])>=0x1&&parseInt(_0x25a7ba[_0xb91b('0x9')])<=0xa?parseInt(_0x25a7ba[_0xb91b('0x9')])*0x3e8:0x5*0x3e8};try{_0x294acc['headers']=_0x25a7ba[_0xb91b('0xa')]?JSON[_0xb91b('0xb')](Mustache[_0xb91b('0x8')](_0x25a7ba['data6'],_0xffbc2b)):{};}catch(_0x5b0428){logger[_0xb91b('0xc')](_0x5b0428[_0xb91b('0xd')]);}switch(_0x25a7ba[_0xb91b('0xe')][_0xb91b('0x7')]()){case _0xb91b('0xf'):case _0xb91b('0x10'):_0x424282=null;_0x294acc['qs']=_0xffbc2b;break;case _0xb91b('0x11'):case _0xb91b('0x12'):if(_0x25a7ba['data7']){try{_0x424282=JSON[_0xb91b('0xb')](Mustache['render'](_0x25a7ba['data7'],_0xffbc2b));_0x294acc['body']=_0x424282;}catch(_0x2d41f3){logger[_0xb91b('0xc')](_0x2d41f3[_0xb91b('0xd')]);logger[_0xb91b('0xc')](_0xb91b('0x13'));}}else{_0x424282=_0xffbc2b;_0x294acc[_0xb91b('0x14')]=_0x424282;}break;}logger[_0xb91b('0x15')](util[_0xb91b('0x16')](_0xb91b('0x17'),_0x25a7ba[_0xb91b('0xe')],_0x25a7ba[_0xb91b('0x18')],JSON['stringify'](_0x294acc)));rp(_0x294acc)[_0xb91b('0x19')](function(_0x21c3e1){_0x424282=!_[_0xb91b('0x1a')](_0x424282)?_0xb91b('0x1b')+_0x424282:'';_0x4d80c1=typeof _0x21c3e1[_0xb91b('0x14')]===_0xb91b('0x1c')?JSON[_0xb91b('0x1d')](_0x21c3e1['body']):_0x21c3e1['body'];logger[_0xb91b('0x15')](util[_0xb91b('0x16')](_0xb91b('0x1e'),_0x25a7ba[_0xb91b('0xe')],_0x25a7ba[_0xb91b('0x18')],_0x21c3e1['statusCode'],_0x4d80c1));})[_0xb91b('0x1f')](function(_0x323acd){logger[_0xb91b('0xc')](util['format'](_0xb91b('0x20'),_0x25a7ba[_0xb91b('0xe')],_0x25a7ba['data2'],_0x323acd[_0xb91b('0x21')],_0x323acd[_0xb91b('0x22')],_0x323acd[_0xb91b('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index f07ed31..908b7c9 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 _0x0c66=['debug','rpc','error','message','result','catch','exports','bluebird','../../config/logger','routing','client','http','then'];(function(_0x48025b,_0x431977){var _0xf45533=function(_0x97e535){while(--_0x97e535){_0x48025b['push'](_0x48025b['shift']());}};_0xf45533(++_0x431977);}(_0x0c66,0x173));var _0x60c6=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x0c66[_0x1ccdf7];return _0x52a0ae;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x60c6('0x0'));var logger=require(_0x60c6('0x1'))(_0x60c6('0x2'));var client=jayson[_0x60c6('0x3')][_0x60c6('0x4')]({'port':0x2329});client['Request']=function(_0x1abea5,_0x3b1513){return new BPromise(function(_0x3d38c6,_0x498d90){return client['request'](_0x1abea5,_0x3b1513)[_0x60c6('0x5')](function(_0x2d8b6e){logger[_0x60c6('0x6')](_0x60c6('0x7'),_0x60c6('0x2'),_0x1abea5,_0x3b1513,_0x2d8b6e);if(_0x2d8b6e['error']){logger[_0x60c6('0x8')](_0x60c6('0x7'),_0x60c6('0x2'),_0x1abea5,_0x2d8b6e[_0x60c6('0x8')][_0x60c6('0x9')],_0x3b1513);return _0x498d90(_0x2d8b6e['error'][_0x60c6('0x9')]);}else{return _0x3d38c6(_0x2d8b6e[_0x60c6('0xa')]);}})[_0x60c6('0xb')](function(_0x55f2b0){logger[_0x60c6('0x8')](_0x60c6('0x7'),'routing',_0x1abea5,_0x55f2b0,_0x3b1513);return _0x498d90(_0x55f2b0);});});};module[_0x60c6('0xc')]=client; \ No newline at end of file +var _0xfcdc=['then','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','Request','request'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0xfcdc,0x1e7));var _0xcfcd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcdc[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0xcfcd('0x0'));var BPromise=require(_0xcfcd('0x1'));var logger=require(_0xcfcd('0x2'))(_0xcfcd('0x3'));var client=jayson[_0xcfcd('0x4')]['http']({'port':0x2329});client[_0xcfcd('0x5')]=function(_0x4b547b,_0x521087){return new BPromise(function(_0x4f8b04,_0x3b76a7){return client[_0xcfcd('0x6')](_0x4b547b,_0x521087)[_0xcfcd('0x7')](function(_0x3f2b02){logger['debug'](_0xcfcd('0x8'),'routing',_0x4b547b,_0x521087,_0x3f2b02);if(_0x3f2b02[_0xcfcd('0x9')]){logger['error'](_0xcfcd('0x8'),'routing',_0x4b547b,_0x3f2b02[_0xcfcd('0x9')][_0xcfcd('0xa')],_0x521087);return _0x3b76a7(_0x3f2b02[_0xcfcd('0x9')][_0xcfcd('0xa')]);}else{return _0x4f8b04(_0x3f2b02[_0xcfcd('0xb')]);}})[_0xcfcd('0xc')](function(_0x1764a3){logger[_0xcfcd('0x9')](_0xcfcd('0x8'),_0xcfcd('0x3'),_0x4b547b,_0x1764a3,_0x521087);return _0x3b76a7(_0x1764a3);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 33a3d8f..a0a47f7 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 _0x70b5=['./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','error','./server','./rpc/mailAccount'];(function(_0x18c112,_0x232958){var _0x4be2c1=function(_0x31fd5f){while(--_0x31fd5f){_0x18c112['push'](_0x18c112['shift']());}};_0x4be2c1(++_0x232958);}(_0x70b5,0x1da));var _0x570b=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x70b5[_0x1057a3];return _0x131cdb;};'use strict';var server=require(_0x570b('0x0'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x570b('0x1'));var setting=require(_0x570b('0x2'));var logger=require(_0x570b('0x3'))(_0x570b('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x570b('0x5')]()[_0x570b('0x6')](mailAccount['getMailAccounts']())[_0x570b('0x6')](realtime[_0x570b('0x7')]())['then'](function(){email[_0x570b('0x8')](realtime[_0x570b('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x570b('0x6')](function(){return initRealtime();})[_0x570b('0x6')](function(){return setting[_0x570b('0xa')]();})[_0x570b('0x6')](function(_0x175321){return setInterval(initRealtime,_0x175321[_0x570b('0xb')]*0x3e8);})[_0x570b('0xc')](function(_0x51982f){logger[_0x570b('0xd')]('Email\x20service\x20initialization',_0x51982f);});}main(); \ No newline at end of file +var _0xe01e=['./realtime','./lib/email','./rpc/mailAccount','email','resolve','then','getMailAccounts','initMailAccounts','refresh','getSettings','loginMailFrequency','error','./server'];(function(_0x46d43f,_0x16ec5e){var _0x21d4c0=function(_0x5620f6){while(--_0x5620f6){_0x46d43f['push'](_0x46d43f['shift']());}};_0x21d4c0(++_0x16ec5e);}(_0xe01e,0xdc));var _0xee01=function(_0x70e445,_0x1d2f34){_0x70e445=_0x70e445-0x0;var _0x4abbce=_0xe01e[_0x70e445];return _0x4abbce;};'use strict';var server=require(_0xee01('0x0'));var Realtime=require(_0xee01('0x1'));var EmailChannel=require(_0xee01('0x2'));var mailAccount=require(_0xee01('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')(_0xee01('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xee01('0x5')]()[_0xee01('0x6')](mailAccount[_0xee01('0x7')]())[_0xee01('0x6')](realtime[_0xee01('0x8')]())[_0xee01('0x6')](function(){email[_0xee01('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xee01('0x6')](function(){return initRealtime();})[_0xee01('0x6')](function(){return setting[_0xee01('0xa')]();})['then'](function(_0x18bd26){return setInterval(initRealtime,_0x18bd26[_0xee01('0xb')]*0x3e8);})['catch'](function(_0x545fd4){logger[_0xee01('0xc')]('Email\x20service\x20initialization',_0x545fd4);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f3ec664..e40b4fb 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 _0x520e=['catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','smtp','prototype','emit','active','Imap','status','messageStatus','isNil','mailAccount:update','provider','custom','service','hasOwnProperty','imapAccounts','box','handleImapBox','handleImapEmail','bind','handleImapEnd','error','handleImapError','mailAccounts','disabled','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','Mail\x20accepted\x20from\x20routing'];(function(_0x499352,_0x406143){var _0x3236e4=function(_0x1912e9){while(--_0x1912e9){_0x499352['push'](_0x499352['shift']());}};_0x3236e4(++_0x406143);}(_0x520e,0x1cb));var _0xe520=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0x520e[_0x24cc72];return _0xd49f1e;};'use strict';var _=require(_0xe520('0x0'));var moment=require(_0xe520('0x1'));var BPromise=require(_0xe520('0x2'));var md5=require(_0xe520('0x3'));var Redis=require(_0xe520('0x4'));var config=require('../../../config/environment');var logger=require(_0xe520('0x5'))(_0xe520('0x6'));config[_0xe520('0x7')]=_['defaults'](config[_0xe520('0x7')],{'host':_0xe520('0x8'),'port':0x18eb});var io=require(_0xe520('0x9'))(new Redis(config[_0xe520('0x7')]));var EmailImap=require(_0xe520('0xa'));var EmailSmtp=require(_0xe520('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2062b5){logger[_0xe520('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x2062b5['mailAccounts'];this['imapAccounts']={};this[_0xe520('0xd')]=new EmailSmtp();}EmailChannel[_0xe520('0xe')][_0xe520('0xf')]=function(_0x17c3dc){var _0x5d9576=this['mailAccounts'][_0x17c3dc];var _0x5841d8={'id':_0x5d9576['id'],'name':_0x5d9576['name'],'key':_0x5d9576['key'],'active':_0x5d9576[_0xe520('0x10')],'Imap':{'status':_0x5d9576[_0xe520('0x11')][_0xe520('0x12')],'messageStatus':_0x5d9576[_0xe520('0x11')][_0xe520('0x13')],'total':_0x5d9576[_0xe520('0x11')]['total']}};if(_[_0xe520('0x14')](md5Accounts[_0x17c3dc])){md5Accounts[_0x17c3dc]={};}var _0x1b5630=md5(JSON['stringify'](_0x5841d8));if(md5Accounts[_0x17c3dc][_0xe520('0x3')]!==_0x1b5630){md5Accounts[_0x17c3dc][_0xe520('0x3')]=_0x1b5630;io[_0xe520('0xf')](_0xe520('0x15'),_0x5841d8);}};EmailChannel[_0xe520('0xe')]['refresh']=function(_0x724aaa){for(var _0x31ba25 in _0x724aaa){if(_0x724aaa['hasOwnProperty'](_0x31ba25)){if(_0x724aaa[_0x31ba25]['Imap']&&_0x724aaa[_0x31ba25][_0xe520('0x10')]){var _0x563b9f=_0x724aaa[_0x31ba25][_0xe520('0x11')];if(!_0x563b9f['service']&&_0x724aaa[_0x31ba25][_0xe520('0x16')]!==_0xe520('0x17'))_0x563b9f[_0xe520('0x18')]=_0x724aaa[_0x31ba25][_0xe520('0x16')];if(!this['imapAccounts'][_0xe520('0x19')](_0x563b9f['id'])){this[_0xe520('0x1a')][_0x563b9f['id']]=new EmailImap(_0x563b9f,_0x724aaa[_0x31ba25][_0xe520('0x6')]);this['imapAccounts'][_0x563b9f['id']]['on'](_0xe520('0x1b'),this[_0xe520('0x1c')]['bind'](this,_0x31ba25));this[_0xe520('0x1a')][_0x563b9f['id']]['on']('email',this[_0xe520('0x1d')][_0xe520('0x1e')](this,_0x31ba25));this[_0xe520('0x1a')][_0x563b9f['id']]['on']('end',this[_0xe520('0x1f')][_0xe520('0x1e')](this,_0x31ba25));this[_0xe520('0x1a')][_0x563b9f['id']]['on'](_0xe520('0x20'),this[_0xe520('0x21')]['bind'](this,_0x31ba25));}}else{if(_['isNil'](this[_0xe520('0x22')][_0x31ba25][_0xe520('0x11')])){this['mailAccounts'][_0x31ba25]['Imap']={};}this[_0xe520('0x22')][_0x31ba25]['Imap']['status']=_0xe520('0x23');this[_0xe520('0x22')][_0x31ba25][_0xe520('0x11')][_0xe520('0x13')]='';this[_0xe520('0xf')](_0x31ba25);}}}};EmailChannel[_0xe520('0xe')][_0xe520('0x1c')]=function(_0x4119e5,_0x71a08d){if(this[_0xe520('0x22')][_0x4119e5]){this[_0xe520('0x22')][_0x4119e5][_0xe520('0x11')][_0xe520('0x12')]=_0xe520('0x24');this[_0xe520('0x22')][_0x4119e5][_0xe520('0x11')][_0xe520('0x13')]=_0x71a08d[_0xe520('0x25')];if(_0x71a08d[_0xe520('0x26')]){this[_0xe520('0x22')][_0x4119e5][_0xe520('0x11')][_0xe520('0x27')]=_0x71a08d['messages'][_0xe520('0x27')];}return this[_0xe520('0xf')](_0x4119e5);}};EmailChannel[_0xe520('0xe')][_0xe520('0x1d')]=function(_0x2ee67f,_0x2c0271){logger[_0xe520('0xc')](_0xe520('0x28'),_0x2c0271[_0xe520('0x29')],_0x2c0271['lastName'],_0x2c0271[_0xe520('0x2a')],_0x2ee67f);if(this[_0xe520('0x22')][_0x2ee67f]){return mailAccount['notify'](_0x2ee67f,_0x2c0271)[_0xe520('0x2b')](function(_0x26fb55){if(_0x26fb55){logger['info'](_0xe520('0x2c'));}})[_0xe520('0x2d')](function(_0x58c072){logger['error'](_0xe520('0x2e'),JSON[_0xe520('0x2f')](_0x58c072));});}};EmailChannel['prototype'][_0xe520('0x1f')]=function(_0xa4b738){if(this[_0xe520('0x22')][_0xa4b738]&&this[_0xe520('0x22')][_0xa4b738]['Imap']){if(this[_0xe520('0x1a')][this[_0xe520('0x22')][_0xa4b738]['Imap']['id']]){delete this[_0xe520('0x1a')][this[_0xe520('0x22')][_0xa4b738]['Imap']['id']];}this[_0xe520('0x22')][_0xa4b738][_0xe520('0x11')][_0xe520('0x30')]=moment();this[_0xe520('0xf')](_0xa4b738);}};EmailChannel[_0xe520('0xe')][_0xe520('0x21')]=function(_0x3661fd,_0x2e5128){if(this['mailAccounts'][_0x3661fd]){this[_0xe520('0x22')][_0x3661fd][_0xe520('0x11')][_0xe520('0x12')]='error';this[_0xe520('0x22')][_0x3661fd][_0xe520('0x11')][_0xe520('0x13')]=_0x2e5128;return this['emit'](_0x3661fd);}};EmailChannel[_0xe520('0xe')][_0xe520('0x31')]=function(_0x829b7f,_0x2134a2){return this['smtp'][_0xe520('0x32')](_0x829b7f,_0x2134a2);};EmailChannel[_0xe520('0xe')][_0xe520('0x33')]=function(_0x2d60b6){var _0x1f4f26=this;if(this['mailAccounts'][_0x2d60b6['id']]){if(_[_0xe520('0x14')](this[_0xe520('0x22')][_0x2d60b6['id']][_0xe520('0x34')])){this[_0xe520('0x22')][_0x2d60b6['id']][_0xe520('0x34')]={};}this['mailAccounts'][_0x2d60b6['id']][_0xe520('0x34')]['lastSync']=moment();return new BPromise(function(_0x56c6ca,_0x11b462){return _0x1f4f26[_0xe520('0xd')][_0xe520('0x35')](_0x2d60b6)[_0xe520('0x2b')](function(_0x1bee91){_0x1f4f26[_0xe520('0x22')][_0x2d60b6['id']][_0xe520('0x34')][_0xe520('0x12')]=_0xe520('0x36');_0x1f4f26['mailAccounts'][_0x2d60b6['id']][_0xe520('0x34')][_0xe520('0x13')]='';_0x1f4f26[_0xe520('0xf')](_0x2d60b6['id']);_0x56c6ca(_0x1bee91);})[_0xe520('0x2d')](function(_0x14a8ee){_0x1f4f26[_0xe520('0x22')][_0x2d60b6['id']][_0xe520('0x34')][_0xe520('0x12')]=_0xe520('0x20');_0x1f4f26[_0xe520('0x22')][_0x2d60b6['id']][_0xe520('0x34')][_0xe520('0x13')]=_0x14a8ee;_0x1f4f26[_0xe520('0xf')](_0x2d60b6['id']);_0x11b462(_0x14a8ee);});});}return this[_0xe520('0xd')][_0xe520('0x35')](_0x2d60b6);};module[_0xe520('0x37')]=EmailChannel; \ No newline at end of file +var _0x6d33=['email','redis','defaults','localhost','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','status','Imap','messageStatus','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','active','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','Smtp','verified','verify','exports','lodash','bluebird','md5','ioredis'];(function(_0x1e4e55,_0x537fd5){var _0x23ff83=function(_0x7dbb6c){while(--_0x7dbb6c){_0x1e4e55['push'](_0x1e4e55['shift']());}};_0x23ff83(++_0x537fd5);}(_0x6d33,0xa1));var _0x36d3=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x6d33[_0x20845e];return _0x28cf2b;};'use strict';var _=require(_0x36d3('0x0'));var moment=require('moment');var BPromise=require(_0x36d3('0x1'));var md5=require(_0x36d3('0x2'));var Redis=require(_0x36d3('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x36d3('0x4'));config[_0x36d3('0x5')]=_[_0x36d3('0x6')](config[_0x36d3('0x5')],{'host':_0x36d3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x36d3('0x8'));var EmailSmtp=require(_0x36d3('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4957ef){logger[_0x36d3('0xa')](_0x36d3('0xb'));this['mailAccounts']=_0x4957ef[_0x36d3('0xc')];this[_0x36d3('0xd')]={};this[_0x36d3('0xe')]=new EmailSmtp();}EmailChannel[_0x36d3('0xf')][_0x36d3('0x10')]=function(_0x38bfcb){var _0x1d80ab=this['mailAccounts'][_0x38bfcb];var _0x2d7bb2={'id':_0x1d80ab['id'],'name':_0x1d80ab[_0x36d3('0x11')],'key':_0x1d80ab[_0x36d3('0x12')],'active':_0x1d80ab['active'],'Imap':{'status':_0x1d80ab['Imap'][_0x36d3('0x13')],'messageStatus':_0x1d80ab[_0x36d3('0x14')][_0x36d3('0x15')],'total':_0x1d80ab[_0x36d3('0x14')]['total']}};if(_[_0x36d3('0x16')](md5Accounts[_0x38bfcb])){md5Accounts[_0x38bfcb]={};}var _0x3761cf=md5(JSON[_0x36d3('0x17')](_0x2d7bb2));if(md5Accounts[_0x38bfcb][_0x36d3('0x2')]!==_0x3761cf){md5Accounts[_0x38bfcb]['md5']=_0x3761cf;io['emit'](_0x36d3('0x18'),_0x2d7bb2);}};EmailChannel[_0x36d3('0xf')][_0x36d3('0x19')]=function(_0x272a31){for(var _0x2ad8ee in _0x272a31){if(_0x272a31[_0x36d3('0x1a')](_0x2ad8ee)){if(_0x272a31[_0x2ad8ee][_0x36d3('0x14')]&&_0x272a31[_0x2ad8ee][_0x36d3('0x1b')]){var _0x510478=_0x272a31[_0x2ad8ee][_0x36d3('0x14')];if(!_0x510478[_0x36d3('0x1c')]&&_0x272a31[_0x2ad8ee][_0x36d3('0x1d')]!==_0x36d3('0x1e'))_0x510478[_0x36d3('0x1c')]=_0x272a31[_0x2ad8ee][_0x36d3('0x1d')];if(!this[_0x36d3('0xd')][_0x36d3('0x1a')](_0x510478['id'])){this[_0x36d3('0xd')][_0x510478['id']]=new EmailImap(_0x510478,_0x272a31[_0x2ad8ee]['email']);this[_0x36d3('0xd')][_0x510478['id']]['on'](_0x36d3('0x1f'),this[_0x36d3('0x20')][_0x36d3('0x21')](this,_0x2ad8ee));this['imapAccounts'][_0x510478['id']]['on'](_0x36d3('0x4'),this[_0x36d3('0x22')][_0x36d3('0x21')](this,_0x2ad8ee));this[_0x36d3('0xd')][_0x510478['id']]['on'](_0x36d3('0x23'),this[_0x36d3('0x24')]['bind'](this,_0x2ad8ee));this['imapAccounts'][_0x510478['id']]['on']('error',this[_0x36d3('0x25')]['bind'](this,_0x2ad8ee));}}else{if(_[_0x36d3('0x16')](this[_0x36d3('0xc')][_0x2ad8ee][_0x36d3('0x14')])){this[_0x36d3('0xc')][_0x2ad8ee][_0x36d3('0x14')]={};}this['mailAccounts'][_0x2ad8ee][_0x36d3('0x14')][_0x36d3('0x13')]=_0x36d3('0x26');this['mailAccounts'][_0x2ad8ee]['Imap']['messageStatus']='';this['emit'](_0x2ad8ee);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x23be42,_0x44646b){if(this[_0x36d3('0xc')][_0x23be42]){this[_0x36d3('0xc')][_0x23be42]['Imap']['status']='connected';this[_0x36d3('0xc')][_0x23be42][_0x36d3('0x14')][_0x36d3('0x15')]=_0x44646b[_0x36d3('0x11')];if(_0x44646b[_0x36d3('0x27')]){this[_0x36d3('0xc')][_0x23be42][_0x36d3('0x14')][_0x36d3('0x28')]=_0x44646b['messages'][_0x36d3('0x28')];}return this['emit'](_0x23be42);}};EmailChannel[_0x36d3('0xf')][_0x36d3('0x22')]=function(_0x1677cb,_0x86e459){logger[_0x36d3('0xa')](_0x36d3('0x29'),_0x86e459['firstName'],_0x86e459[_0x36d3('0x2a')],_0x86e459[_0x36d3('0x2b')],_0x1677cb);if(this[_0x36d3('0xc')][_0x1677cb]){return mailAccount['notify'](_0x1677cb,_0x86e459)[_0x36d3('0x2c')](function(_0x4c1d8f){if(_0x4c1d8f){logger['info'](_0x36d3('0x2d'));}})[_0x36d3('0x2e')](function(_0x565447){logger[_0x36d3('0x2f')](_0x36d3('0x30'),JSON[_0x36d3('0x17')](_0x565447));});}};EmailChannel[_0x36d3('0xf')][_0x36d3('0x24')]=function(_0x23d270){if(this[_0x36d3('0xc')][_0x23d270]&&this[_0x36d3('0xc')][_0x23d270][_0x36d3('0x14')]){if(this['imapAccounts'][this[_0x36d3('0xc')][_0x23d270][_0x36d3('0x14')]['id']]){delete this[_0x36d3('0xd')][this[_0x36d3('0xc')][_0x23d270][_0x36d3('0x14')]['id']];}this['mailAccounts'][_0x23d270][_0x36d3('0x14')][_0x36d3('0x31')]=moment();this[_0x36d3('0x10')](_0x23d270);}};EmailChannel['prototype']['handleImapError']=function(_0x524992,_0x44ce00){if(this[_0x36d3('0xc')][_0x524992]){this[_0x36d3('0xc')][_0x524992][_0x36d3('0x14')][_0x36d3('0x13')]=_0x36d3('0x2f');this[_0x36d3('0xc')][_0x524992][_0x36d3('0x14')]['messageStatus']=_0x44ce00;return this[_0x36d3('0x10')](_0x524992);}};EmailChannel[_0x36d3('0xf')]['sendMail']=function(_0x557881,_0x12e097){return this['smtp'][_0x36d3('0x32')](_0x557881,_0x12e097);};EmailChannel[_0x36d3('0xf')]['verifySmtp']=function(_0x69914f){var _0x3ad460=this;if(this['mailAccounts'][_0x69914f['id']]){if(_['isNil'](this[_0x36d3('0xc')][_0x69914f['id']][_0x36d3('0x33')])){this[_0x36d3('0xc')][_0x69914f['id']][_0x36d3('0x33')]={};}this[_0x36d3('0xc')][_0x69914f['id']]['Smtp'][_0x36d3('0x31')]=moment();return new BPromise(function(_0x47dd89,_0x74a61f){return _0x3ad460['smtp']['verify'](_0x69914f)[_0x36d3('0x2c')](function(_0x2f8d6a){_0x3ad460[_0x36d3('0xc')][_0x69914f['id']][_0x36d3('0x33')]['status']=_0x36d3('0x34');_0x3ad460['mailAccounts'][_0x69914f['id']][_0x36d3('0x33')][_0x36d3('0x15')]='';_0x3ad460['emit'](_0x69914f['id']);_0x47dd89(_0x2f8d6a);})[_0x36d3('0x2e')](function(_0x1fa5a9){_0x3ad460['mailAccounts'][_0x69914f['id']]['Smtp'][_0x36d3('0x13')]='error';_0x3ad460[_0x36d3('0xc')][_0x69914f['id']]['Smtp'][_0x36d3('0x15')]=_0x1fa5a9;_0x3ad460[_0x36d3('0x10')](_0x69914f['id']);_0x74a61f(_0x1fa5a9);});});}return this[_0x36d3('0xe')][_0x36d3('0x35')](_0x69914f);};module[_0x36d3('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b89a3a4..80b55f3 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 _0x8b41=['UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleFetchError','stringify','textCode','upperFirst','util','mailparser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','user','generateXOAuth2Token','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox'];(function(_0x333683,_0x2e51dc){var _0x570c76=function(_0x2b51a2){while(--_0x2b51a2){_0x333683['push'](_0x333683['shift']());}};_0x570c76(++_0x2e51dc);}(_0x8b41,0x8b));var _0x18b4=function(_0x2e859d,_0x36b6cf){_0x2e859d=_0x2e859d-0x0;var _0x1935ef=_0x8b41[_0x2e859d];return _0x1935ef;};'use strict';var _=require('lodash');var util=require(_0x18b4('0x0'));var Imap=require('imap');var simpleParser=require(_0x18b4('0x1'))['simpleParser'];var Iconv=require('iconv')[_0x18b4('0x2')];var EventEmitter=require(_0x18b4('0x3'))[_0x18b4('0x4')];var utils=require(_0x18b4('0x5'));var logger=require(_0x18b4('0x6'))(_0x18b4('0x7'));function EmailImap(_0x9168ff,_0x200ab0){this[_0x18b4('0x8')]=_0x9168ff[_0x18b4('0x8')];this[_0x18b4('0x9')]=this[_0x18b4('0xa')](_0x9168ff,_0x200ab0);this[_0x18b4('0xb')]=new Imap(this[_0x18b4('0x9')]);this[_0x18b4('0xb')][_0x18b4('0xc')](_0x18b4('0xd'),this[_0x18b4('0xe')][_0x18b4('0xf')](this));this['imap'][_0x18b4('0xc')](_0x18b4('0x10'),this[_0x18b4('0x11')][_0x18b4('0xf')](this));this[_0x18b4('0xb')]['on'](_0x18b4('0x12'),this[_0x18b4('0x13')][_0x18b4('0xf')](this));this['imap']['connect']();}util[_0x18b4('0x14')](EmailImap,EventEmitter);EmailImap[_0x18b4('0x15')][_0x18b4('0xa')]=function(_0x4fb277,_0x1fdcc3){var _0x3a5ed1={'connTimeout':_0x4fb277[_0x18b4('0x16')]?_0x4fb277[_0x18b4('0x16')]*0x3e8:0x2710,'authTimeout':_0x4fb277['authTimeout']?_0x4fb277[_0x18b4('0x17')]*0x3e8:0x1388};if(_0x4fb277['service']){_0x3a5ed1[_0x18b4('0x18')]=_0x4fb277['user'];if(_0x4fb277['modernAuthentication']){_0x3a5ed1['xoauth2']=utils[_0x18b4('0x19')](_0x4fb277['CloudProvider'][_0x18b4('0x1a')],_0x4fb277[_0x18b4('0x18')]);}else{_0x3a5ed1[_0x18b4('0x1b')]=_0x4fb277[_0x18b4('0x1b')];}}else{if(_0x4fb277[_0x18b4('0x1c')]){_0x3a5ed1[_0x18b4('0x18')]=_0x4fb277[_0x18b4('0x18')];_0x3a5ed1[_0x18b4('0x1b')]=_0x4fb277[_0x18b4('0x1b')];}}_0x3a5ed1[_0x18b4('0x7')]=_0x1fdcc3||_0x4fb277['user']||_0x18b4('0x1d');_0x3a5ed1['host']=_0x4fb277[_0x18b4('0x1e')];_0x3a5ed1[_0x18b4('0x1f')]=_0x4fb277[_0x18b4('0x1f')]||0x3e1;if(_0x4fb277[_0x18b4('0x20')]){_0x3a5ed1['tls']=!![];}else{_0x3a5ed1['tls']=![];_0x3a5ed1[_0x18b4('0x21')]=_0x18b4('0x22');}return _0x3a5ed1;};EmailImap[_0x18b4('0x15')][_0x18b4('0xe')]=function(){this['imap'][_0x18b4('0x23')](this['mailbox'],![],this[_0x18b4('0x24')][_0x18b4('0xf')](this));};EmailImap[_0x18b4('0x15')][_0x18b4('0x24')]=function(_0x335a74,_0x1f42dd){if(_0x335a74){this[_0x18b4('0x13')](_0x335a74,!![]);}else{this[_0x18b4('0x25')](_0x18b4('0x26'),_0x1f42dd);this[_0x18b4('0x27')]();}};EmailImap['prototype'][_0x18b4('0x28')]=function(_0x363476){if(_0x363476){this[_0x18b4('0x13')](_0x363476,!![]);}else{this[_0x18b4('0xb')][_0x18b4('0x10')]();}};EmailImap[_0x18b4('0x15')][_0x18b4('0x27')]=function(){this[_0x18b4('0xb')]['search']([_0x18b4('0x29')],this['handleReadUnseen'][_0x18b4('0xf')](this));};EmailImap[_0x18b4('0x15')][_0x18b4('0x2a')]=function(_0x3b87b8,_0x4af459){if(_0x3b87b8){this[_0x18b4('0x13')](_0x3b87b8,!![]);}else{if(_0x4af459[_0x18b4('0x2b')]){try{var _0x27f13e=this[_0x18b4('0xb')][_0x18b4('0x2c')](_0x4af459,{'bodies':'','markSeen':!![]});_0x27f13e['on'](_0x18b4('0x2d'),this[_0x18b4('0x2e')][_0x18b4('0xf')](this));_0x27f13e[_0x18b4('0xc')](_0x18b4('0x12'),this['handleFetchError']['bind'](this));_0x27f13e[_0x18b4('0xc')](_0x18b4('0x10'),this[_0x18b4('0x2f')][_0x18b4('0xf')](this));}catch(_0x116d87){logger[_0x18b4('0x12')](_0x116d87);}}else{this[_0x18b4('0xb')][_0x18b4('0x30')](!![],this[_0x18b4('0x28')][_0x18b4('0xf')](this));}}};EmailImap[_0x18b4('0x15')][_0x18b4('0x2e')]=function(_0x138b57){_0x138b57['on'](_0x18b4('0x31'),this[_0x18b4('0x32')]['bind'](this));_0x138b57[_0x18b4('0xc')](_0x18b4('0x33'),this['handleMessageAttributes']['bind'](this));_0x138b57[_0x18b4('0xc')](_0x18b4('0x10'),this[_0x18b4('0x34')]['bind'](this));};EmailImap[_0x18b4('0x15')][_0x18b4('0x32')]=function(_0x29171c){simpleParser(_0x29171c,{'Iconv':Iconv},this[_0x18b4('0x35')][_0x18b4('0xf')](this));};EmailImap[_0x18b4('0x15')][_0x18b4('0x36')]=function(){};EmailImap[_0x18b4('0x15')][_0x18b4('0x34')]=function(){};EmailImap[_0x18b4('0x15')][_0x18b4('0x35')]=function(_0x291a98,_0x4f7daa){if(_0x291a98){logger[_0x18b4('0x12')](_0x291a98);}else{var _0x5ec88c=this;utils[_0x18b4('0x37')](this[_0x18b4('0x9')],_0x4f7daa,function(_0x334344){_0x5ec88c[_0x18b4('0x25')](_0x18b4('0x7'),_0x334344);});}};EmailImap['prototype'][_0x18b4('0x2f')]=function(){this['imap'][_0x18b4('0x30')](!![],this[_0x18b4('0x28')][_0x18b4('0xf')](this));};EmailImap[_0x18b4('0x15')][_0x18b4('0x38')]=function(_0x43c608){this[_0x18b4('0x13')](_0x43c608);this[_0x18b4('0xb')]['closeBox'](!![],this[_0x18b4('0x28')][_0x18b4('0xf')](this));};EmailImap[_0x18b4('0x15')][_0x18b4('0x11')]=function(){this[_0x18b4('0x25')]('end');};EmailImap[_0x18b4('0x15')][_0x18b4('0x13')]=function(_0x59ece1,_0x141fff){logger[_0x18b4('0x12')](_0x18b4('0x13'),this[_0x18b4('0x9')]['email'],JSON[_0x18b4('0x39')](_0x59ece1));var _0x51a5fd='';if(_0x59ece1){if(_0x59ece1[_0x18b4('0x3a')]){_0x51a5fd=_0x59ece1[_0x18b4('0x3a')];}else{for(var _0x20c9b2 in _0x59ece1){if(_0x59ece1['hasOwnProperty'](_0x20c9b2)){_0x51a5fd+=_[_0x18b4('0x3b')](_0x20c9b2)+':\x20'+_0x59ece1[_0x20c9b2]+'\x0a';}}}}if(_0x141fff){this[_0x18b4('0xb')][_0x18b4('0x10')]();}else{this[_0x18b4('0x25')](_0x18b4('0x12'),_0x51a5fd);this[_0x18b4('0x25')](_0x18b4('0x10'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x8780=['handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','account','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','user','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8780,0x186));var _0x0878=function(_0x2a7b39,_0x457fda){_0x2a7b39=_0x2a7b39-0x0;var _0x482bc3=_0x8780[_0x2a7b39];return _0x482bc3;};'use strict';var _=require(_0x0878('0x0'));var util=require(_0x0878('0x1'));var Imap=require(_0x0878('0x2'));var simpleParser=require('mailparser')[_0x0878('0x3')];var Iconv=require(_0x0878('0x4'))[_0x0878('0x5')];var EventEmitter=require(_0x0878('0x6'))[_0x0878('0x7')];var utils=require(_0x0878('0x8'));var logger=require(_0x0878('0x9'))(_0x0878('0xa'));function EmailImap(_0x4a7e82,_0x3789c4){this['mailbox']=_0x4a7e82['mailbox'];this[_0x0878('0xb')]=this['getAccount'](_0x4a7e82,_0x3789c4);this['imap']=new Imap(this[_0x0878('0xb')]);this[_0x0878('0x2')]['once'](_0x0878('0xc'),this[_0x0878('0xd')][_0x0878('0xe')](this));this[_0x0878('0x2')]['once'](_0x0878('0xf'),this[_0x0878('0x10')][_0x0878('0xe')](this));this[_0x0878('0x2')]['on'](_0x0878('0x11'),this[_0x0878('0x12')][_0x0878('0xe')](this));this[_0x0878('0x2')]['connect']();}util[_0x0878('0x13')](EmailImap,EventEmitter);EmailImap[_0x0878('0x14')]['getAccount']=function(_0x414d9e,_0x3b94e2){var _0x65ad54={'connTimeout':_0x414d9e['connTimeout']?_0x414d9e[_0x0878('0x15')]*0x3e8:0x2710,'authTimeout':_0x414d9e[_0x0878('0x16')]?_0x414d9e[_0x0878('0x16')]*0x3e8:0x1388};if(_0x414d9e[_0x0878('0x17')]){_0x65ad54[_0x0878('0x18')]=_0x414d9e['user'];if(_0x414d9e['modernAuthentication']){_0x65ad54['xoauth2']=utils['generateXOAuth2Token'](_0x414d9e[_0x0878('0x19')][_0x0878('0x1a')],_0x414d9e[_0x0878('0x18')]);}else{_0x65ad54[_0x0878('0x1b')]=_0x414d9e[_0x0878('0x1b')];}}else{if(_0x414d9e[_0x0878('0x1c')]){_0x65ad54[_0x0878('0x18')]=_0x414d9e[_0x0878('0x18')];_0x65ad54['password']=_0x414d9e[_0x0878('0x1b')];}}_0x65ad54[_0x0878('0xa')]=_0x3b94e2||_0x414d9e[_0x0878('0x18')]||_0x0878('0x1d');_0x65ad54[_0x0878('0x1e')]=_0x414d9e[_0x0878('0x1e')];_0x65ad54['port']=_0x414d9e[_0x0878('0x1f')]||0x3e1;if(_0x414d9e['tls']){_0x65ad54[_0x0878('0x20')]=!![];}else{_0x65ad54[_0x0878('0x20')]=![];_0x65ad54[_0x0878('0x21')]=_0x0878('0x22');}return _0x65ad54;};EmailImap[_0x0878('0x14')][_0x0878('0xd')]=function(){this[_0x0878('0x2')][_0x0878('0x23')](this['mailbox'],![],this[_0x0878('0x24')][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x24')]=function(_0x1b976e,_0x2cc2af){if(_0x1b976e){this[_0x0878('0x12')](_0x1b976e,!![]);}else{this[_0x0878('0x25')](_0x0878('0x26'),_0x2cc2af);this[_0x0878('0x27')]();}};EmailImap[_0x0878('0x14')]['handleCloseBox']=function(_0x2ae83e){if(_0x2ae83e){this['handleError'](_0x2ae83e,!![]);}else{this[_0x0878('0x2')][_0x0878('0xf')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x0878('0x2')][_0x0878('0x28')]([_0x0878('0x29')],this[_0x0878('0x2a')][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x2a')]=function(_0x4d5e25,_0x1f2bea){if(_0x4d5e25){this[_0x0878('0x12')](_0x4d5e25,!![]);}else{if(_0x1f2bea[_0x0878('0x2b')]){try{var _0x488b20=this[_0x0878('0x2')][_0x0878('0x2c')](_0x1f2bea,{'bodies':'','markSeen':!![]});_0x488b20['on'](_0x0878('0x2d'),this[_0x0878('0x2e')]['bind'](this));_0x488b20[_0x0878('0x2f')](_0x0878('0x11'),this[_0x0878('0x30')][_0x0878('0xe')](this));_0x488b20[_0x0878('0x2f')](_0x0878('0xf'),this[_0x0878('0x31')]['bind'](this));}catch(_0x1c3faa){logger[_0x0878('0x11')](_0x1c3faa);}}else{this[_0x0878('0x2')][_0x0878('0x32')](!![],this[_0x0878('0x33')]['bind'](this));}}};EmailImap[_0x0878('0x14')][_0x0878('0x2e')]=function(_0x590668){_0x590668['on'](_0x0878('0x34'),this[_0x0878('0x35')][_0x0878('0xe')](this));_0x590668['once'](_0x0878('0x36'),this[_0x0878('0x37')][_0x0878('0xe')](this));_0x590668[_0x0878('0x2f')](_0x0878('0xf'),this['handleMessageEnd'][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x35')]=function(_0x5ed880){simpleParser(_0x5ed880,{'Iconv':Iconv},this[_0x0878('0x38')][_0x0878('0xe')](this));};EmailImap[_0x0878('0x14')][_0x0878('0x37')]=function(){};EmailImap[_0x0878('0x14')][_0x0878('0x39')]=function(){};EmailImap[_0x0878('0x14')][_0x0878('0x38')]=function(_0x4d2876,_0x21ab58){if(_0x4d2876){logger[_0x0878('0x11')](_0x4d2876);}else{var _0x40ba44=this;utils['parser'](this['account'],_0x21ab58,function(_0x25ce85){_0x40ba44[_0x0878('0x25')](_0x0878('0xa'),_0x25ce85);});}};EmailImap[_0x0878('0x14')][_0x0878('0x31')]=function(){this[_0x0878('0x2')]['closeBox'](!![],this[_0x0878('0x33')]['bind'](this));};EmailImap[_0x0878('0x14')]['handleFetchError']=function(_0x341bb1){this[_0x0878('0x12')](_0x341bb1);this[_0x0878('0x2')][_0x0878('0x32')](!![],this[_0x0878('0x33')]['bind'](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0x0878('0xf'));};EmailImap[_0x0878('0x14')]['handleError']=function(_0x35501a,_0x5e1594){logger[_0x0878('0x11')]('handleError',this[_0x0878('0xb')][_0x0878('0xa')],JSON[_0x0878('0x3a')](_0x35501a));var _0x336bc1='';if(_0x35501a){if(_0x35501a[_0x0878('0x3b')]){_0x336bc1=_0x35501a[_0x0878('0x3b')];}else{for(var _0x321532 in _0x35501a){if(_0x35501a[_0x0878('0x3c')](_0x321532)){_0x336bc1+=_[_0x0878('0x3d')](_0x321532)+':\x20'+_0x35501a[_0x321532]+'\x0a';}}}}if(_0x5e1594){this[_0x0878('0x2')]['end']();}else{this[_0x0878('0x25')](_0x0878('0x11'),_0x336bc1);this[_0x0878('0x25')](_0x0878('0xf'));}};module[_0x0878('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 159593f..92af057 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 _0xd8e6=['createTransport','use','sendMail','toString','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x3a83a7,_0x5514cd){var _0x2e76b7=function(_0x2f3f7b){while(--_0x2f3f7b){_0x3a83a7['push'](_0x3a83a7['shift']());}};_0x2e76b7(++_0x5514cd);}(_0xd8e6,0x189));var _0x6d8e=function(_0x46c23d,_0x774957){_0x46c23d=_0x46c23d-0x0;var _0x20dbf4=_0xd8e6[_0x46c23d];return _0x20dbf4;};'use strict';var nodemailer=require(_0x6d8e('0x0'));var inlineBase64=require(_0x6d8e('0x1'));function EmailSmtp(){}EmailSmtp[_0x6d8e('0x2')]['send']=function(_0x538e65,_0x360584){return new Promise(function(_0x1138ef,_0x4066aa){var _0x2346e1=nodemailer[_0x6d8e('0x3')](_0x538e65);_0x2346e1[_0x6d8e('0x4')]('compile',inlineBase64());_0x2346e1[_0x6d8e('0x5')](_0x360584,function(_0x284f45,_0x34e89c){if(_0x284f45){_0x4066aa(_0x284f45[_0x6d8e('0x6')]());}else{_0x1138ef(_0x34e89c);}});});};EmailSmtp[_0x6d8e('0x2')][_0x6d8e('0x7')]=function(_0x20f8cb){return new Promise(function(_0x49693c,_0x4857f2){var _0x2cf7c5=nodemailer[_0x6d8e('0x3')](_0x20f8cb);_0x2cf7c5[_0x6d8e('0x7')](function(_0x2e1f14,_0x55846d){if(_0x2e1f14){_0x4857f2(_0x2e1f14[_0x6d8e('0x6')]());}else{if(_0x55846d){_0x49693c(_0x55846d);}else{_0x4857f2(_0x6d8e('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xcbb5=['Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','verify','toString'];(function(_0x53b6c9,_0x46a2c6){var _0x52cfdd=function(_0x1cdd8c){while(--_0x1cdd8c){_0x53b6c9['push'](_0x53b6c9['shift']());}};_0x52cfdd(++_0x46a2c6);}(_0xcbb5,0x141));var _0x5cbb=function(_0x1a1c0a,_0x4e390e){_0x1a1c0a=_0x1a1c0a-0x0;var _0x496cb2=_0xcbb5[_0x1a1c0a];return _0x496cb2;};'use strict';var nodemailer=require(_0x5cbb('0x0'));var inlineBase64=require(_0x5cbb('0x1'));function EmailSmtp(){}EmailSmtp[_0x5cbb('0x2')]['send']=function(_0x200b80,_0x34ebf2){return new Promise(function(_0xeafac,_0x259ac5){var _0x164d56=nodemailer[_0x5cbb('0x3')](_0x200b80);_0x164d56[_0x5cbb('0x4')](_0x5cbb('0x5'),inlineBase64());_0x164d56[_0x5cbb('0x6')](_0x34ebf2,function(_0x106705,_0x48e0d6){if(_0x106705){_0x259ac5(_0x106705['toString']());}else{_0xeafac(_0x48e0d6);}});});};EmailSmtp[_0x5cbb('0x2')][_0x5cbb('0x7')]=function(_0x19af1b){return new Promise(function(_0x23201f,_0x213563){var _0x274969=nodemailer['createTransport'](_0x19af1b);_0x274969[_0x5cbb('0x7')](function(_0x4c0b05,_0x1306a9){if(_0x4c0b05){_0x213563(_0x4c0b05[_0x5cbb('0x8')]());}else{if(_0x1306a9){_0x23201f(_0x1306a9);}else{_0x213563(_0x5cbb('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index db79397..eaa0786 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 _0xb75c=['join','Anonymous','value','pop','isEmpty','html','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','node-tnef','../../../config/logger','email','head','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice'];(function(_0x5acf41,_0x1a8225){var _0x3da82f=function(_0x51f506){while(--_0x51f506){_0x5acf41['push'](_0x5acf41['shift']());}};_0x3da82f(++_0x1a8225);}(_0xb75c,0x130));var _0xcb75=function(_0x40b0fe,_0x4eb9ff){_0x40b0fe=_0x40b0fe-0x0;var _0x33e9b5=_0xb75c[_0x40b0fe];return _0x33e9b5;};'use strict';var _=require(_0xcb75('0x0'));var moment=require(_0xcb75('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xcb75('0x2'));var util=require('util');var tnef=require(_0xcb75('0x3'));var logger=require(_0xcb75('0x4'))(_0xcb75('0x5'));var config=require('../../../config/environment');function getAddress(_0x2a5662){var _0x2b0055=_[_0xcb75('0x6')](_0x2a5662['value']);return _0x2b0055&&_0x2b0055[_0xcb75('0x7')]?_0x2b0055[_0xcb75('0x7')]:_0xcb75('0x8')+random[_0xcb75('0x9')](0x6)+_0xcb75('0xa');}function getFirstName(_0x320efa){var _0x5c6a1d=_[_0xcb75('0x6')](_0x320efa['value']);if(_0x5c6a1d&&_0x5c6a1d[_0xcb75('0xb')]){if(_0x5c6a1d[_0xcb75('0xb')]==_0x5c6a1d[_0xcb75('0x7')]){return _0x5c6a1d['name'][_0xcb75('0xc')](0x0,_0x5c6a1d[_0xcb75('0xb')][_0xcb75('0xd')]('@'));}var _0x104f49=_0x5c6a1d[_0xcb75('0xb')][_0xcb75('0xe')](/\s+/);return _0x104f49['length']>0x1?_0x104f49[_0xcb75('0xf')](0x0,-0x1)[_0xcb75('0x10')]('\x20'):_0x5c6a1d[_0xcb75('0xb')];}return _0xcb75('0x11');}function getLastName(_0xb5a93d){var _0x4fb5a5=_[_0xcb75('0x6')](_0xb5a93d[_0xcb75('0x12')]);if(_0x4fb5a5&&_0x4fb5a5[_0xcb75('0xb')]){var _0x319570=_0x4fb5a5[_0xcb75('0xb')][_0xcb75('0xe')](/\s+/);return _0x319570['length']>0x1?_0x319570[_0xcb75('0x13')]():'';}return'';}function getMails(_0x289355,_0x32eea6){var _0x579293='';for(var _0x34d60c=0x0;_0x34d60c<_0x32eea6[_0xcb75('0x12')]['length'];_0x34d60c+=0x1){if(_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0x7')]!==_0x289355){if(!_[_0xcb75('0x14')](_0x579293)){_0x579293+=',';}_0x579293+=_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0xb')]||_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0x7')]||'';_0x579293+='\x20<';_0x579293+=_0x32eea6[_0xcb75('0x12')][_0x34d60c][_0xcb75('0x7')]?_0x32eea6['value'][_0x34d60c][_0xcb75('0x7')]:_0xcb75('0x8')+random[_0xcb75('0x9')](0x6)+_0xcb75('0xa');_0x579293+='>';}}return _0x579293;}function parseEmail(_0x4dd120,_0x4c702d,_0x237a53){if(_0x4c702d[_0xcb75('0x15')]){var _0x346457=/)<[^<]*)*<\/script>/gi;while(_0x346457['test'](_0x4c702d[_0xcb75('0x15')])){_0x4c702d['html']=_0x4c702d[_0xcb75('0x15')]['replace'](_0x346457,'');}if(_0x4c702d[_0xcb75('0x15')][_0xcb75('0x16')](_0xcb75('0x17'))){var _0xbfd3a7=[];_0x4c702d[_0xcb75('0x18')][_0xcb75('0x19')](_0x154650=>{_0xbfd3a7['push'](_0x154650['filename']);});var _0x333d25=/]+>/g;var _0x2c40b0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x332d48=_0x4c702d[_0xcb75('0x15')][_0xcb75('0x1a')](_0x2c40b0,_0xcb75('0x1b'));var _0x3f5e67=_0x332d48[_0xcb75('0x1a')](_0x333d25,_0xcb75('0x1c'));for(let _0x44d523=0x0;_0x44d523<_0xbfd3a7[_0xcb75('0x1d')];_0x44d523++){var _0x5c74c5=_0x3f5e67['replace']('_IMG',_0xcb75('0x1e')+_0xbfd3a7[_0x44d523]+_0xcb75('0x1f'));_0x3f5e67=_0x5c74c5;}_0x4c702d[_0xcb75('0x15')]=_0x3f5e67;}_0x237a53[_0xcb75('0x20')]=_0x4c702d[_0xcb75('0x15')];}else{_0x237a53[_0xcb75('0x20')]=_0x4c702d[_0xcb75('0x21')];}if(_0x237a53[_0xcb75('0x20')]){_0x237a53['body']=_0x237a53[_0xcb75('0x20')][_0xcb75('0x1a')](/0x0){var _0xed4c93=[_0xcb75('0x34'),_0xcb75('0x35'),_0xcb75('0x36')];for(var _0x15a79d=0x0;_0x15a79d<_0x4c702d[_0xcb75('0x33')][_0xcb75('0x1d')];_0x15a79d++){var _0x2ded18=_[_0xcb75('0xd')](_0xed4c93,_0x4c702d[_0xcb75('0x33')][_0x15a79d][_0xcb75('0x37')]);if(_0x2ded18>=0x0){_0x237a53[_0xcb75('0x38')]=!![];}}}return _0x237a53;}exports[_0xcb75('0x39')]=function(_0x323e13,_0x4e32e8,_0x2d4c97){var _0x5ea36b={'from':getAddress(_0x4e32e8[_0xcb75('0x3a')]),'firstName':getFirstName(_0x4e32e8[_0xcb75('0x3a')]),'lastName':getLastName(_0x4e32e8[_0xcb75('0x3a')]),'mapKey':'email','message':{'from':getMails(_0x323e13[_0xcb75('0x5')],_0x4e32e8['from']),'to':_0x323e13['email'],'cc':'','subject':_0x4e32e8[_0xcb75('0x3b')]||'','messageId':_0x4e32e8[_0xcb75('0x3c')],'inReplyTo':_0x4e32e8['inReplyTo'],'sentAt':moment(_0x4e32e8[_0xcb75('0x3d')])[_0xcb75('0x3e')](_0xcb75('0x3f')),'attach':![],'attachments':[]}};if(!_0x4e32e8[_0xcb75('0x15')]&&!_0x4e32e8[_0xcb75('0x21')]){var _0x33c547=_[_0xcb75('0x40')](_0x4e32e8[_0xcb75('0x18')],{'contentType':_0xcb75('0x41')});if(_0x33c547[_0xcb75('0x1d')]){logger['info'](util[_0xcb75('0x3e')](_0xcb75('0x42'),_0x4e32e8[_0xcb75('0x3c')]));tnef[_0xcb75('0x43')](_[_0xcb75('0x44')](_0x33c547)[_0xcb75('0x30')],function(_0x1f9f92,_0x2739bf){if(_0x2739bf){_0x4e32e8['html']=_0x2739bf[_0xcb75('0x45')]||_0xcb75('0x46');if(_0x2739bf['Attachments']){for(var _0xb385be=0x0;_0xb385be<_0x2739bf[_0xcb75('0x47')][_0xcb75('0x1d')];_0xb385be++){var _0x13e1dc=_0x2739bf['Attachments'][_0xb385be];_0x5ea36b[_0xcb75('0x23')]['attachments'][_0xcb75('0x31')]({'filename':_0x13e1dc[_0xcb75('0x48')],'content':Buffer[_0xcb75('0x3a')](_0x13e1dc[_0xcb75('0x49')])});}}}_0x2d4c97(parseEmail(_0x323e13,_0x4e32e8,_0x5ea36b));});}else{_0x4e32e8[_0xcb75('0x15')]=_0xcb75('0x46');_0x2d4c97(parseEmail(_0x323e13,_0x4e32e8,_0x5ea36b));}}else{_0x2d4c97(parseEmail(_0x323e13,_0x4e32e8,_0x5ea36b));}};exports[_0xcb75('0x4a')]=function(_0x4d6405,_0x4b920f){var _0x496724=[_0xcb75('0x4b')+(_0x4b920f||''),_0xcb75('0x4c')+_0x4d6405,'',''];return Buffer[_0xcb75('0x3a')](_0x496724['join'](''),_0xcb75('0x4d'))[_0xcb75('0x4e')](_0xcb75('0x4f'));}; \ No newline at end of file +var _0x42aa=['Empty\x20message

','Attachments','Data','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','split','length','join','Anonymous','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body'];(function(_0x45057d,_0x486d28){var _0x2f5bc9=function(_0x7627d1){while(--_0x7627d1){_0x45057d['push'](_0x45057d['shift']());}};_0x2f5bc9(++_0x486d28);}(_0x42aa,0xbb));var _0xa42a=function(_0x284c91,_0x199b02){_0x284c91=_0x284c91-0x0;var _0x4050e1=_0x42aa[_0x284c91];return _0x4050e1;};'use strict';var _=require(_0xa42a('0x0'));var moment=require(_0xa42a('0x1'));var random=require(_0xa42a('0x2'));var fs=require('fs');var path=require(_0xa42a('0x3'));var util=require(_0xa42a('0x4'));var tnef=require('node-tnef');var logger=require(_0xa42a('0x5'))(_0xa42a('0x6'));var config=require('../../../config/environment');function getAddress(_0x1a0927){var _0x579138=_[_0xa42a('0x7')](_0x1a0927[_0xa42a('0x8')]);return _0x579138&&_0x579138[_0xa42a('0x9')]?_0x579138['address']:_0xa42a('0xa')+random[_0xa42a('0xb')](0x6)+_0xa42a('0xc');}function getFirstName(_0x5041f6){var _0x32238f=_[_0xa42a('0x7')](_0x5041f6[_0xa42a('0x8')]);if(_0x32238f&&_0x32238f[_0xa42a('0xd')]){if(_0x32238f[_0xa42a('0xd')]==_0x32238f['address']){return _0x32238f[_0xa42a('0xd')]['substring'](0x0,_0x32238f['name']['indexOf']('@'));}var _0x4b1c3c=_0x32238f['name'][_0xa42a('0xe')](/\s+/);return _0x4b1c3c[_0xa42a('0xf')]>0x1?_0x4b1c3c['slice'](0x0,-0x1)[_0xa42a('0x10')]('\x20'):_0x32238f[_0xa42a('0xd')];}return _0xa42a('0x11');}function getLastName(_0x2ff9d6){var _0x5d6373=_[_0xa42a('0x7')](_0x2ff9d6[_0xa42a('0x8')]);if(_0x5d6373&&_0x5d6373[_0xa42a('0xd')]){var _0x13fc18=_0x5d6373[_0xa42a('0xd')][_0xa42a('0xe')](/\s+/);return _0x13fc18[_0xa42a('0xf')]>0x1?_0x13fc18['pop']():'';}return'';}function getMails(_0x54c562,_0x4f2e05){var _0xa20056='';for(var _0x13db22=0x0;_0x13db22<_0x4f2e05[_0xa42a('0x8')][_0xa42a('0xf')];_0x13db22+=0x1){if(_0x4f2e05[_0xa42a('0x8')][_0x13db22][_0xa42a('0x9')]!==_0x54c562){if(!_[_0xa42a('0x12')](_0xa20056)){_0xa20056+=',';}_0xa20056+=_0x4f2e05['value'][_0x13db22][_0xa42a('0xd')]||_0x4f2e05[_0xa42a('0x8')][_0x13db22]['address']||'';_0xa20056+='\x20<';_0xa20056+=_0x4f2e05[_0xa42a('0x8')][_0x13db22][_0xa42a('0x9')]?_0x4f2e05[_0xa42a('0x8')][_0x13db22]['address']:_0xa42a('0xa')+random[_0xa42a('0xb')](0x6)+_0xa42a('0xc');_0xa20056+='>';}}return _0xa20056;}function parseEmail(_0xe1a333,_0x222ae5,_0x4e3454){if(_0x222ae5[_0xa42a('0x13')]){var _0x21dd00=/)<[^<]*)*<\/script>/gi;while(_0x21dd00[_0xa42a('0x14')](_0x222ae5['html'])){_0x222ae5[_0xa42a('0x13')]=_0x222ae5[_0xa42a('0x13')][_0xa42a('0x15')](_0x21dd00,'');}if(_0x222ae5[_0xa42a('0x13')][_0xa42a('0x16')](_0xa42a('0x17'))){var _0x5f2c2d=[];_0x222ae5['attachments'][_0xa42a('0x18')](_0x229d85=>{_0x5f2c2d[_0xa42a('0x19')](_0x229d85[_0xa42a('0x1a')]);});var _0x946942=/]+>/g;var _0x146ea3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x564e78=_0x222ae5[_0xa42a('0x13')]['replace'](_0x146ea3,_0xa42a('0x1b'));var _0x3bc1f1=_0x564e78[_0xa42a('0x15')](_0x946942,_0xa42a('0x1c'));for(let _0xd8b096=0x0;_0xd8b096<_0x5f2c2d['length'];_0xd8b096++){var _0x433287=_0x3bc1f1[_0xa42a('0x15')](_0xa42a('0x1c'),_0xa42a('0x1d')+_0x5f2c2d[_0xd8b096]+_0xa42a('0x1e'));_0x3bc1f1=_0x433287;}_0x222ae5['html']=_0x3bc1f1;}_0x4e3454[_0xa42a('0x1f')]=_0x222ae5[_0xa42a('0x13')];}else{_0x4e3454[_0xa42a('0x1f')]=_0x222ae5['textAsHtml'];}if(_0x4e3454[_0xa42a('0x1f')]){_0x4e3454[_0xa42a('0x1f')]=_0x4e3454[_0xa42a('0x1f')]['replace'](/0x0){var _0x1ca154=['Auto-Submitted:\x20auto-replied',_0xa42a('0x31'),_0xa42a('0x32')];for(var _0x2d64f4=0x0;_0x2d64f4<_0x222ae5['headerLines'][_0xa42a('0xf')];_0x2d64f4++){var _0x73afe5=_[_0xa42a('0x33')](_0x1ca154,_0x222ae5[_0xa42a('0x30')][_0x2d64f4][_0xa42a('0x34')]);if(_0x73afe5>=0x0){_0x4e3454[_0xa42a('0x35')]=!![];}}}return _0x4e3454;}exports[_0xa42a('0x36')]=function(_0x1b9028,_0xe0d32,_0x3e6129){var _0x4c7a3a={'from':getAddress(_0xe0d32[_0xa42a('0x37')]),'firstName':getFirstName(_0xe0d32[_0xa42a('0x37')]),'lastName':getLastName(_0xe0d32[_0xa42a('0x37')]),'mapKey':_0xa42a('0x6'),'message':{'from':getMails(_0x1b9028[_0xa42a('0x6')],_0xe0d32[_0xa42a('0x37')]),'to':_0x1b9028[_0xa42a('0x6')],'cc':'','subject':_0xe0d32['subject']||'','messageId':_0xe0d32[_0xa42a('0x38')],'inReplyTo':_0xe0d32[_0xa42a('0x39')],'sentAt':moment(_0xe0d32[_0xa42a('0x3a')])[_0xa42a('0x3b')](_0xa42a('0x3c')),'attach':![],'attachments':[]}};if(!_0xe0d32[_0xa42a('0x13')]&&!_0xe0d32[_0xa42a('0x3d')]){var _0x2dbb29=_['filter'](_0xe0d32[_0xa42a('0x25')],{'contentType':_0xa42a('0x3e')});if(_0x2dbb29[_0xa42a('0xf')]){logger['info'](util[_0xa42a('0x3b')](_0xa42a('0x3f'),_0xe0d32[_0xa42a('0x38')]));tnef['parseBuffer'](_[_0xa42a('0x40')](_0x2dbb29)[_0xa42a('0x2f')],function(_0x1c4f6d,_0x4f088a){if(_0x4f088a){_0xe0d32[_0xa42a('0x13')]=_0x4f088a[_0xa42a('0x41')]||_0xa42a('0x42');if(_0x4f088a[_0xa42a('0x43')]){for(var _0x58d267=0x0;_0x58d267<_0x4f088a[_0xa42a('0x43')][_0xa42a('0xf')];_0x58d267++){var _0x52368b=_0x4f088a[_0xa42a('0x43')][_0x58d267];_0x4c7a3a[_0xa42a('0x21')][_0xa42a('0x25')][_0xa42a('0x19')]({'filename':_0x52368b['Title'],'content':Buffer[_0xa42a('0x37')](_0x52368b[_0xa42a('0x44')])});}}}_0x3e6129(parseEmail(_0x1b9028,_0xe0d32,_0x4c7a3a));});}else{_0xe0d32[_0xa42a('0x13')]=_0xa42a('0x42');_0x3e6129(parseEmail(_0x1b9028,_0xe0d32,_0x4c7a3a));}}else{_0x3e6129(parseEmail(_0x1b9028,_0xe0d32,_0x4c7a3a));}};exports['generateXOAuth2Token']=function(_0x39488f,_0x284786){var _0x1ffa76=[_0xa42a('0x45')+(_0x284786||''),'auth=Bearer\x20'+_0x39488f,'',''];return Buffer['from'](_0x1ffa76[_0xa42a('0x10')](''),_0xa42a('0x46'))[_0xa42a('0x47')](_0xa42a('0x48'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 20cd7bc..1c8706f 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 _0x10ff=['Smtp','exports','lodash','name','Service','key','active','Imap'];(function(_0x13cfa3,_0x380416){var _0x16c88b=function(_0xbd587){while(--_0xbd587){_0x13cfa3['push'](_0x13cfa3['shift']());}};_0x16c88b(++_0x380416);}(_0x10ff,0x1ba));var _0xf10f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x10ff[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf10f('0x0'));function MailAccount(_0x452594){this['id']=_0x452594['id']||0x0;this[_0xf10f('0x1')]=_0x452594[_0xf10f('0x1')]||_0xf10f('0x2');this[_0xf10f('0x3')]=_0x452594[_0xf10f('0x3')]||'SERV';this[_0xf10f('0x4')]=_0x452594[_0xf10f('0x4')]||![];this['Imap']=_0x452594[_0xf10f('0x5')]||[];this[_0xf10f('0x6')]=_0x452594[_0xf10f('0x6')]||[];}module[_0xf10f('0x7')]=MailAccount; \ No newline at end of file +var _0x4db5=['Service','key','SERV','active','Imap','Smtp'];(function(_0x60743a,_0x40ab0e){var _0x282ef4=function(_0x473249){while(--_0x473249){_0x60743a['push'](_0x60743a['shift']());}};_0x282ef4(++_0x40ab0e);}(_0x4db5,0x1c8));var _0x54db=function(_0x181c8e,_0x2a0dc9){_0x181c8e=_0x181c8e-0x0;var _0x3ba7cf=_0x4db5[_0x181c8e];return _0x3ba7cf;};'use strict';var _=require('lodash');function MailAccount(_0x191a23){this['id']=_0x191a23['id']||0x0;this['name']=_0x191a23['name']||_0x54db('0x0');this[_0x54db('0x1')]=_0x191a23['key']||_0x54db('0x2');this[_0x54db('0x3')]=_0x191a23['active']||![];this[_0x54db('0x4')]=_0x191a23[_0x54db('0x4')]||[];this[_0x54db('0x5')]=_0x191a23[_0x54db('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 50dfb06..d5bdb62 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 _0x61d0=['isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length'];(function(_0x2e8653,_0x5ec7d1){var _0x2a0498=function(_0x472cc5){while(--_0x472cc5){_0x2e8653['push'](_0x2e8653['shift']());}};_0x2a0498(++_0x5ec7d1);}(_0x61d0,0x1bb));var _0x061d=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x61d0[_0x1795df];return _0x3f13c0;};'use strict';var _=require(_0x061d('0x0'));var MailAccount=require(_0x061d('0x1'));var Realtime=function(){this[_0x061d('0x2')]={};};function freeIsNotKey(_0x15e8ec,_0x6ce878,_0x143606){var _0x4bd5ad=_[_0x061d('0x3')](_0x15e8ec,function(_0x32a267,_0x17d0ef){return _0x32a267[_0x143606];});for(var _0x52c36b in _0x6ce878){if(_0x6ce878[_0x061d('0x4')](_0x52c36b)){if(!_0x4bd5ad[_0x52c36b]){delete _0x6ce878[_0x52c36b];}}}}Realtime[_0x061d('0x5')][_0x061d('0x6')]=function(_0x42654f,_0x3c80d6){for(var _0x4cff6f in _0x3c80d6){if(_0x42654f[_0x061d('0x4')](_0x4cff6f)){_0x42654f[_0x4cff6f]=_0x3c80d6[_0x4cff6f];}}};Realtime[_0x061d('0x5')]['initMailAccounts']=function(){var _0xac945f=this;return function(_0x5d7d6b){if(_0x5d7d6b){freeIsNotKey(_0x5d7d6b,_0xac945f[_0x061d('0x2')],'id');for(var _0x3813ed=0x0,_0x3c56c3={},_0x379407={};_0x3813ed<_0x5d7d6b[_0x061d('0x7')];_0x3813ed+=0x1){_0x3c56c3=_0x5d7d6b[_0x3813ed];if(_[_0x061d('0x8')](_0xac945f[_0x061d('0x2')][_0x3c56c3['id']])){_0xac945f['mailAccounts'][_0x3c56c3['id']]=new MailAccount(_0x3c56c3);}else{_[_0x061d('0x9')](_0xac945f[_0x061d('0x2')][_0x3c56c3['id']],_0x3c56c3);}}}return _0xac945f[_0x061d('0x2')];};};module[_0x061d('0xa')]=Realtime; \ No newline at end of file +var _0xd451=['initMailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x401b86,_0x3eccb6){var _0x3b8c45=function(_0x2a036f){while(--_0x2a036f){_0x401b86['push'](_0x401b86['shift']());}};_0x3b8c45(++_0x3eccb6);}(_0xd451,0xca));var _0x1d45=function(_0x273709,_0x34aa00){_0x273709=_0x273709-0x0;var _0x1421bf=_0xd451[_0x273709];return _0x1421bf;};'use strict';var _=require(_0x1d45('0x0'));var MailAccount=require(_0x1d45('0x1'));var Realtime=function(){this[_0x1d45('0x2')]={};};function freeIsNotKey(_0x1d4cf4,_0x354eb8,_0x395877){var _0x15379a=_[_0x1d45('0x3')](_0x1d4cf4,function(_0x4aa014,_0x36d396){return _0x4aa014[_0x395877];});for(var _0x1032ca in _0x354eb8){if(_0x354eb8[_0x1d45('0x4')](_0x1032ca)){if(!_0x15379a[_0x1032ca]){delete _0x354eb8[_0x1032ca];}}}}Realtime[_0x1d45('0x5')][_0x1d45('0x6')]=function(_0x4ebc26,_0x8b96d2){for(var _0x4c756a in _0x8b96d2){if(_0x4ebc26[_0x1d45('0x4')](_0x4c756a)){_0x4ebc26[_0x4c756a]=_0x8b96d2[_0x4c756a];}}};Realtime[_0x1d45('0x5')][_0x1d45('0x7')]=function(){var _0x4329e1=this;return function(_0x1f56b3){if(_0x1f56b3){freeIsNotKey(_0x1f56b3,_0x4329e1[_0x1d45('0x2')],'id');for(var _0x5bedc6=0x0,_0x2e7202={},_0xa5657d={};_0x5bedc6<_0x1f56b3[_0x1d45('0x8')];_0x5bedc6+=0x1){_0x2e7202=_0x1f56b3[_0x5bedc6];if(_[_0x1d45('0x9')](_0x4329e1['mailAccounts'][_0x2e7202['id']])){_0x4329e1['mailAccounts'][_0x2e7202['id']]=new MailAccount(_0x2e7202);}else{_[_0x1d45('0xa')](_0x4329e1['mailAccounts'][_0x2e7202['id']],_0x2e7202);}}}return _0x4329e1[_0x1d45('0x2')];};};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 95df63f..4179aef 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 _0xbb67=['provider','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','service','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name'];(function(_0x4b5c3d,_0x22bfb4){var _0x294524=function(_0x2eb119){while(--_0x2eb119){_0x4b5c3d['push'](_0x4b5c3d['shift']());}};_0x294524(++_0x22bfb4);}(_0xbb67,0x161));var _0x7bb6=function(_0x15cc38,_0x25615c){_0x15cc38=_0x15cc38-0x0;var _0xd9f2ab=_0xbb67[_0x15cc38];return _0xd9f2ab;};'use strict';var client=require('../client');exports[_0x7bb6('0x0')]=function(){return function(){return client[_0x7bb6('0x1')](_0x7bb6('0x2'),{'options':{'attributes':['id',_0x7bb6('0x3'),_0x7bb6('0x4'),'service',_0x7bb6('0x5'),_0x7bb6('0x6'),_0x7bb6('0x7'),_0x7bb6('0x8'),_0x7bb6('0x9')],'raw':![],'include':[{'model':_0x7bb6('0xa'),'as':_0x7bb6('0xb'),'include':[{'model':_0x7bb6('0xc'),'attributes':['id','name',_0x7bb6('0xd'),_0x7bb6('0xe'),_0x7bb6('0xf')],'as':_0x7bb6('0xc')}]},{'model':_0x7bb6('0x10'),'as':_0x7bb6('0x11'),'include':[{'model':_0x7bb6('0xc'),'attributes':['id',_0x7bb6('0x3'),_0x7bb6('0xd'),'type',_0x7bb6('0xf')],'as':_0x7bb6('0xc')}]}]},'log':_0x7bb6('0x12')});};};exports[_0x7bb6('0x13')]=function(_0x1344fd,_0xde5c63){return client[_0x7bb6('0x1')](_0x7bb6('0x14'),{'account':{'id':_0x1344fd},'body':_0xde5c63,'log':_0x7bb6('0x14')});}; \ No newline at end of file +var _0x0909=['getMailAccounts','name','provider','email','active','key','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','service','getMailAccount','notify','Request','NotifyMailAccount'];(function(_0x3d9df9,_0x5138d4){var _0x1a0953=function(_0xc46d96){while(--_0xc46d96){_0x3d9df9['push'](_0x3d9df9['shift']());}};_0x1a0953(++_0x5138d4);}(_0x0909,0x1e6));var _0x9090=function(_0x3b9bab,_0x3badf3){_0x3b9bab=_0x3b9bab-0x0;var _0x1cbf22=_0x0909[_0x3b9bab];return _0x1cbf22;};'use strict';var client=require('../client');exports[_0x9090('0x0')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x9090('0x1'),_0x9090('0x2'),'service',_0x9090('0x3'),_0x9090('0x4'),_0x9090('0x5'),'ListId',_0x9090('0x6')],'raw':![],'include':[{'model':_0x9090('0x7'),'as':_0x9090('0x8'),'include':[{'model':_0x9090('0x9'),'attributes':['id',_0x9090('0x1'),'service',_0x9090('0xa'),_0x9090('0xb')],'as':'CloudProvider'}]},{'model':'MailServerOut','as':_0x9090('0xc'),'include':[{'model':_0x9090('0x9'),'attributes':['id','name',_0x9090('0xd'),_0x9090('0xa'),'data5'],'as':_0x9090('0x9')}]}]},'log':_0x9090('0xe')});};};exports[_0x9090('0xf')]=function(_0x24eede,_0x18e636){return client[_0x9090('0x10')](_0x9090('0x11'),{'account':{'id':_0x24eede},'body':_0x18e636,'log':_0x9090('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index c1e6869..6173e0b 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 _0xdb0d=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x1346d3,_0x5236f0){var _0x53da35=function(_0x241c6f){while(--_0x241c6f){_0x1346d3['push'](_0x1346d3['shift']());}};_0x53da35(++_0x5236f0);}(_0xdb0d,0xe7));var _0xddb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb0d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xddb0('0x0'));exports[_0xddb0('0x1')]=function(){return client[_0xddb0('0x2')](_0xddb0('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xddb0('0x4')]},'log':_0xddb0('0x5')});}; \ No newline at end of file +var _0x3f9b=['../client','loginMailFrequency','GetSettings'];(function(_0x13c19c,_0x1d4a84){var _0x594ee4=function(_0x326bb8){while(--_0x326bb8){_0x13c19c['push'](_0x13c19c['shift']());}};_0x594ee4(++_0x1d4a84);}(_0x3f9b,0x6f));var _0xb3f9=function(_0x1b2732,_0xaa3ad8){_0x1b2732=_0x1b2732-0x0;var _0x5bcc4f=_0x3f9b[_0x1b2732];return _0x5bcc4f;};'use strict';var client=require(_0xb3f9('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb3f9('0x1')]},'log':_0xb3f9('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index e50876f..c64a5a0 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 6e9985e..4cc9b87 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 _0x9fb3=['../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','socket.io-redis','../../config/triggers','default','../../config/socketio'];(function(_0x43bed9,_0x26adca){var _0x27b03d=function(_0x5c47c9){while(--_0x5c47c9){_0x43bed9['push'](_0x43bed9['shift']());}};_0x27b03d(++_0x26adca);}(_0x9fb3,0x1d1));var _0x39fb=function(_0x5e15b7,_0x2110fa){_0x5e15b7=_0x5e15b7-0x0;var _0x54b21e=_0x9fb3[_0x5e15b7];return _0x54b21e;};'use strict';var _=require(_0x39fb('0x0'));var http=require(_0x39fb('0x1'));var express=require(_0x39fb('0x2'));var sticky=require(_0x39fb('0x3'));var Redis=require(_0x39fb('0x4'));var config=require(_0x39fb('0x5'));var app=express();var server=http[_0x39fb('0x6')](app);server[_0x39fb('0x7')]=0xdbba0;if(sticky[_0x39fb('0x8')](server,config[_0x39fb('0x9')])){var socketio=require(_0x39fb('0xa'))(server,{'transports':[_0x39fb('0xb'),'polling']});config[_0x39fb('0xc')]=_[_0x39fb('0xd')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0x39fb('0xe'))({'pubClient':new Redis(config[_0x39fb('0xc')]),'subClient':new Redis(config['redis'])}));require(_0x39fb('0xf'))[_0x39fb('0x10')]();require(_0x39fb('0x11'))[_0x39fb('0x10')](socketio);require(_0x39fb('0x12'))[_0x39fb('0x10')](app);require('../../routes')['default'](app);}else{server[_0x39fb('0x13')](_0x39fb('0x14'),function(){console[_0x39fb('0x15')](_0x39fb('0x16'),config[_0x39fb('0x9')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x16cb=['defaults','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','express','../../config/environment','createServer','socket.io','websocket','polling','redis'];(function(_0xe1dbb9,_0x10a535){var _0xf5216f=function(_0x3b4f5e){while(--_0x3b4f5e){_0xe1dbb9['push'](_0xe1dbb9['shift']());}};_0xf5216f(++_0x10a535);}(_0x16cb,0x195));var _0xb16c=function(_0x44d9a7,_0x542cfa){_0x44d9a7=_0x44d9a7-0x0;var _0x48bd30=_0x16cb[_0x44d9a7];return _0x48bd30;};'use strict';var _=require(_0xb16c('0x0'));var http=require(_0xb16c('0x1'));var express=require(_0xb16c('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xb16c('0x3'));var app=express();var server=http[_0xb16c('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xb16c('0x5'))(server,{'transports':[_0xb16c('0x6'),_0xb16c('0x7')]});config[_0xb16c('0x8')]=_[_0xb16c('0x9')](config['redis'],{'host':_0xb16c('0xa'),'port':0x18eb});socketio[_0xb16c('0xb')](require(_0xb16c('0xc'))({'pubClient':new Redis(config[_0xb16c('0x8')]),'subClient':new Redis(config[_0xb16c('0x8')])}));require('../../config/triggers')[_0xb16c('0xd')]();require(_0xb16c('0xe'))[_0xb16c('0xd')](socketio);require(_0xb16c('0xf'))[_0xb16c('0xd')](app);require(_0xb16c('0x10'))[_0xb16c('0xd')](app);}else{server[_0xb16c('0x11')](_0xb16c('0x12'),function(){console[_0xb16c('0x13')](_0xb16c('0x14'),config[_0xb16c('0x15')]);});}exports=module[_0xb16c('0x16')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e3bbf0b..83b5a8c 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 _0x873f=['then','debug','rpc','error','message','catch','exports','jayson/promise','routing','http','Request','request'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x873f,0x1cf));var _0xf873=function(_0x19cd40,_0x3466ec){_0x19cd40=_0x19cd40-0x0;var _0x52ad47=_0x873f[_0x19cd40];return _0x52ad47;};'use strict';var jayson=require(_0xf873('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xf873('0x1'));var client=jayson['client'][_0xf873('0x2')]({'port':0x2329});client[_0xf873('0x3')]=function(_0x362c6f,_0x19760e){return new BPromise(function(_0xe7c59d,_0x1b8fa8){return client[_0xf873('0x4')](_0x362c6f,_0x19760e)[_0xf873('0x5')](function(_0x583bd9){logger[_0xf873('0x6')](_0xf873('0x7'),_0xf873('0x1'),_0x362c6f,_0x19760e,_0x583bd9);if(_0x583bd9[_0xf873('0x8')]){logger[_0xf873('0x8')]('rpc',_0xf873('0x1'),_0x362c6f,_0x583bd9[_0xf873('0x8')][_0xf873('0x9')],_0x19760e);return _0x1b8fa8(_0x583bd9[_0xf873('0x8')][_0xf873('0x9')]);}else{return _0xe7c59d(_0x583bd9['result']);}})[_0xf873('0xa')](function(_0x11f8d3){logger[_0xf873('0x8')]('rpc',_0xf873('0x1'),_0x362c6f,_0x11f8d3,_0x19760e);return _0x1b8fa8(_0x11f8d3);});});};module[_0xf873('0xb')]=client; \ No newline at end of file +var _0xf086=['result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','debug','rpc','error','message'];(function(_0x57a268,_0x12d2fe){var _0x398b94=function(_0x396f44){while(--_0x396f44){_0x57a268['push'](_0x57a268['shift']());}};_0x398b94(++_0x12d2fe);}(_0xf086,0x65));var _0x6f08=function(_0x48e7ba,_0x120483){_0x48e7ba=_0x48e7ba-0x0;var _0x50a06c=_0xf086[_0x48e7ba];return _0x50a06c;};'use strict';var jayson=require(_0x6f08('0x0'));var BPromise=require(_0x6f08('0x1'));var logger=require(_0x6f08('0x2'))(_0x6f08('0x3'));var client=jayson[_0x6f08('0x4')][_0x6f08('0x5')]({'port':0x2329});client[_0x6f08('0x6')]=function(_0x152f52,_0x5a9a7d){return new BPromise(function(_0x20cee2,_0x43f1b6){return client['request'](_0x152f52,_0x5a9a7d)['then'](function(_0x141cf7){logger[_0x6f08('0x7')](_0x6f08('0x8'),_0x6f08('0x3'),_0x152f52,_0x5a9a7d,_0x141cf7);if(_0x141cf7[_0x6f08('0x9')]){logger[_0x6f08('0x9')](_0x6f08('0x8'),'routing',_0x152f52,_0x141cf7[_0x6f08('0x9')][_0x6f08('0xa')],_0x5a9a7d);return _0x43f1b6(_0x141cf7[_0x6f08('0x9')][_0x6f08('0xa')]);}else{return _0x20cee2(_0x141cf7[_0x6f08('0xb')]);}})[_0x6f08('0xc')](function(_0x4eb81c){logger['error'](_0x6f08('0x8'),_0x6f08('0x3'),_0x152f52,_0x4eb81c,_0x5a9a7d);return _0x43f1b6(_0x4eb81c);});});};module[_0x6f08('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 51a8b19..50d47e6 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 _0x5d21=['initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','catch','bluebird','./server','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0x348456,_0x117266){var _0x387e0c=function(_0x550af1){while(--_0x550af1){_0x348456['push'](_0x348456['shift']());}};_0x387e0c(++_0x117266);}(_0x5d21,0x10d));var _0x15d2=function(_0x4dd747,_0x2c1d03){_0x4dd747=_0x4dd747-0x0;var _0x36890e=_0x5d21[_0x4dd747];return _0x36890e;};'use strict';var BPromise=require(_0x15d2('0x0'));var server=require(_0x15d2('0x1'));var Realtime=require(_0x15d2('0x2'));var user=require('./rpc/user');var interval=require(_0x15d2('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x15d2('0x4'));var smsQueue=require(_0x15d2('0x5'));var mailQueue=require(_0x15d2('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x15d2('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x15d2('0x8')](user[_0x15d2('0x9')]())[_0x15d2('0x8')](realtime[_0x15d2('0xa')]())[_0x15d2('0x8')](interval[_0x15d2('0xb')]())['then'](realtime[_0x15d2('0xc')]())[_0x15d2('0x8')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x15d2('0xd')]())[_0x15d2('0x8')](chatQueue[_0x15d2('0xe')]())[_0x15d2('0x8')](realtime[_0x15d2('0xf')]())[_0x15d2('0x8')](smsQueue[_0x15d2('0x10')]())[_0x15d2('0x8')](realtime[_0x15d2('0x11')]())[_0x15d2('0x8')](mailQueue[_0x15d2('0x12')]())[_0x15d2('0x8')](realtime[_0x15d2('0x13')]())[_0x15d2('0x8')](faxQueue[_0x15d2('0x14')]())['then'](realtime[_0x15d2('0x15')]())[_0x15d2('0x8')](whatsappQueue[_0x15d2('0x16')]())[_0x15d2('0x8')](realtime['initWhatsappQueues']())[_0x15d2('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x15d2('0x8')](function(_0x907f39){return initRealtime();})[_0x15d2('0x8')](function(_0x8059c6){return setInterval(initRealtime,0x1388);})[_0x15d2('0x17')](function(_0x46816c){console['log'](_0x46816c);});}main(); \ No newline at end of file +var _0x1e2d=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue'];(function(_0x40b666,_0x2bd090){var _0x28f92f=function(_0x494442){while(--_0x494442){_0x40b666['push'](_0x40b666['shift']());}};_0x28f92f(++_0x2bd090);}(_0x1e2d,0xb9));var _0xd1e2=function(_0x35fa2a,_0x2a0b4a){_0x35fa2a=_0x35fa2a-0x0;var _0x1be582=_0x1e2d[_0x35fa2a];return _0x1be582;};'use strict';var BPromise=require('bluebird');var server=require(_0xd1e2('0x0'));var Realtime=require(_0xd1e2('0x1'));var user=require(_0xd1e2('0x2'));var interval=require(_0xd1e2('0x3'));var openchannelQueue=require(_0xd1e2('0x4'));var chatQueue=require(_0xd1e2('0x5'));var smsQueue=require(_0xd1e2('0x6'));var mailQueue=require(_0xd1e2('0x7'));var faxQueue=require(_0xd1e2('0x8'));var whatsappQueue=require(_0xd1e2('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xd1e2('0xa')]()['then'](user[_0xd1e2('0xb')]())[_0xd1e2('0xc')](realtime['initAgents']())[_0xd1e2('0xc')](interval[_0xd1e2('0xd')]())[_0xd1e2('0xc')](realtime[_0xd1e2('0xe')]())[_0xd1e2('0xc')](openchannelQueue[_0xd1e2('0xf')]())[_0xd1e2('0xc')](realtime[_0xd1e2('0x10')]())[_0xd1e2('0xc')](chatQueue['getChatQueues']())['then'](realtime[_0xd1e2('0x11')]())[_0xd1e2('0xc')](smsQueue['getSmsQueues']())[_0xd1e2('0xc')](realtime[_0xd1e2('0x12')]())[_0xd1e2('0xc')](mailQueue['getMailQueues']())[_0xd1e2('0xc')](realtime['initMailQueues']())['then'](faxQueue[_0xd1e2('0x13')]())[_0xd1e2('0xc')](realtime[_0xd1e2('0x14')]())[_0xd1e2('0xc')](whatsappQueue['getWhatsappQueues']())[_0xd1e2('0xc')](realtime[_0xd1e2('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x3b9bce){return initRealtime();})[_0xd1e2('0xc')](function(_0x4b5be3){return setInterval(initRealtime,0x1388);})[_0xd1e2('0x16')](function(_0x3fee96){console[_0xd1e2('0x17')](_0x3fee96);});}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 15c8fcb..b5e3938 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 _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x1ec51b,_0x4aa7ae){var _0x3c116c=function(_0x2d1f9c){while(--_0x2d1f9c){_0x1ec51b['push'](_0x1ec51b['shift']());}};_0x3c116c(++_0x4aa7ae);}(_0x2ef3,0xba));var _0x32ef=function(_0x584393,_0x26e519){_0x584393=_0x584393-0x0;var _0x12db92=_0x2ef3[_0x584393];return _0x12db92;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0xd5ef4d,_0x38ad5d){var _0x67107=function(_0x6f8830){while(--_0x6f8830){_0xd5ef4d['push'](_0xd5ef4d['shift']());}};_0x67107(++_0x38ad5d);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x5fc3[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 31af3e9..909c730 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 _0x24e5=['sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','message','catch'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x24e5,0x8d));var _0x524e=function(_0xe3ac97,_0x32c645){_0xe3ac97=_0xe3ac97-0x0;var _0x3c0591=_0x24e5[_0xe3ac97];return _0x3c0591;};'use strict';var BPromise=require(_0x524e('0x0'));var jayson=require(_0x524e('0x1'));var client=jayson[_0x524e('0x2')][_0x524e('0x3')]({'port':0x232b});function request(_0x48e99a,_0x2d14ba){return new BPromise(function(_0x3271a0,_0x370e9a){return client[_0x524e('0x4')](_0x48e99a,_0x2d14ba)[_0x524e('0x5')](function(_0x767196){if(_0x767196[_0x524e('0x6')]){return _0x370e9a(_0x767196[_0x524e('0x6')][_0x524e('0x7')]);}else{return _0x3271a0(_0x767196['result']);}})[_0x524e('0x8')](function(_0x4b1299){return _0x370e9a(_0x4b1299);});});}exports[_0x524e('0x9')]=function(_0x348fa6,_0x1fa743){return request('SendMail',{'account':_0x348fa6,'message':_0x1fa743});}; \ No newline at end of file +var _0x0d6d=['result','sendMailMessage','jayson/promise','http','request','error','message'];(function(_0x187306,_0x151cf9){var _0x2e5ecf=function(_0x231cc1){while(--_0x231cc1){_0x187306['push'](_0x187306['shift']());}};_0x2e5ecf(++_0x151cf9);}(_0x0d6d,0x167));var _0xd0d6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0d6d[_0x42cae2];return _0x5f256f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xd0d6('0x0'));var client=jayson['client'][_0xd0d6('0x1')]({'port':0x232b});function request(_0x3438d9,_0x1d5f16){return new BPromise(function(_0x933872,_0x46ce94){return client[_0xd0d6('0x2')](_0x3438d9,_0x1d5f16)['then'](function(_0x44176f){if(_0x44176f[_0xd0d6('0x3')]){return _0x46ce94(_0x44176f[_0xd0d6('0x3')][_0xd0d6('0x4')]);}else{return _0x933872(_0x44176f[_0xd0d6('0x5')]);}})['catch'](function(_0x333261){return _0x46ce94(_0x333261);});});}exports[_0xd0d6('0x6')]=function(_0x14a902,_0x2e1ad2){return request('SendMail',{'account':_0x14a902,'message':_0x2e1ad2});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 82d925a..74f7167 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 _0xccc3=['stringify','emit','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','chat','openchannel','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatCurrentCapacity','mailStatus','whatsappStatusTime','openchannelStatus','openchannelCurrentCapacity','busyQueue'];(function(_0x1eb307,_0x2b65de){var _0x170256=function(_0x1223b6){while(--_0x1223b6){_0x1eb307['push'](_0x1eb307['shift']());}};_0x170256(++_0x2b65de);}(_0xccc3,0xce));var _0x3ccc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xccc3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3ccc('0x0'));var moment=require('moment');var md5=require(_0x3ccc('0x1'));var Redis=require(_0x3ccc('0x2'));var config=require(_0x3ccc('0x3'));config[_0x3ccc('0x4')]=_[_0x3ccc('0x5')](config[_0x3ccc('0x4')],{'host':_0x3ccc('0x6'),'port':0x18eb});var io=require(_0x3ccc('0x7'))(new Redis(config['redis']));function Agent(_0x4f3f19){this['id']=_0x4f3f19['id']||0x0;this[_0x3ccc('0x8')]=_0x4f3f19[_0x3ccc('0x8')]||'';this[_0x3ccc('0x9')]=_0x4f3f19['online']||!![];this[_0x3ccc('0xa')]=_0x4f3f19[_0x3ccc('0xa')]||![];this[_0x3ccc('0xb')]=_0x4f3f19[_0x3ccc('0xb')]||![];this[_0x3ccc('0xc')]=_0x4f3f19['mailPause']||![];this[_0x3ccc('0xd')]=_0x4f3f19[_0x3ccc('0xd')]||![];this['smsPause']=_0x4f3f19[_0x3ccc('0xe')]||![];this[_0x3ccc('0xf')]=_0x4f3f19[_0x3ccc('0xf')]||![];this[_0x3ccc('0x10')]=_0x3ccc('0x11');this[_0x3ccc('0x12')]=0x0;this[_0x3ccc('0x13')]=_0x4f3f19[_0x3ccc('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x3ccc('0x11');this[_0x3ccc('0x14')]=0x0;this[_0x3ccc('0x15')]=_0x4f3f19[_0x3ccc('0x15')]||0x0;this[_0x3ccc('0x16')]=0x0;this[_0x3ccc('0x17')]=_0x3ccc('0x11');this[_0x3ccc('0x18')]=0x0;this[_0x3ccc('0x19')]=_0x4f3f19[_0x3ccc('0x19')]||0x0;this[_0x3ccc('0x1a')]=0x0;this[_0x3ccc('0x1b')]=_0x3ccc('0x11');this[_0x3ccc('0x1c')]=0x0;this['smsCapacity']=_0x4f3f19[_0x3ccc('0x1d')]||0x0;this[_0x3ccc('0x1e')]=0x0;this[_0x3ccc('0x1f')]=_0x3ccc('0x11');this['whatsappStatusTime']=0x0;this[_0x3ccc('0x20')]=_0x4f3f19[_0x3ccc('0x20')]||0x0;this[_0x3ccc('0x21')]=0x0;this['openchannelStatus']=_0x3ccc('0x11');this[_0x3ccc('0x22')]=0x0;this[_0x3ccc('0x23')]=_0x4f3f19[_0x3ccc('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3ccc('0x24')]=![];this['busyQueue']=undefined;this[_0x3ccc('0x1')]='';this[_0x3ccc('0x25')]={};this[_0x3ccc('0x26')]={};this[_0x3ccc('0x27')]={};this[_0x3ccc('0x28')]={};this[_0x3ccc('0x29')]={};this[_0x3ccc('0x2a')]={};this[_0x3ccc('0x2b')]();}Agent[_0x3ccc('0x2c')][_0x3ccc('0x2d')]=function(_0x4bba39){if(this[_0x4bba39+_0x3ccc('0x2e')]>0x0){if(this[_0x4bba39+_0x3ccc('0x2f')]>0x0&&this[_0x4bba39+_0x3ccc('0x2e')]>=this[_0x4bba39+_0x3ccc('0x2f')]){return _0x3ccc('0x30');}else{return _0x3ccc('0x31');}}else{return _0x3ccc('0x32');}};Agent[_0x3ccc('0x2c')]['updateRealtime']=function(){var _0x358730=['mail',_0x3ccc('0x33'),_0x3ccc('0x34'),'fax',_0x3ccc('0x35'),_0x3ccc('0x36')];for(var _0x23a7a0=0x0;_0x23a7a0<_0x358730[_0x3ccc('0x37')];_0x23a7a0+=0x1){var _0x533be0=this['getChannelStatus'](_0x358730[_0x23a7a0]);if(this[_0x358730[_0x23a7a0]+_0x3ccc('0x38')]!==_0x533be0){this[_0x358730[_0x23a7a0]+_0x3ccc('0x39')]=_[_0x3ccc('0x3a')](moment()[_0x3ccc('0x3b')]('x'));}this[_0x358730[_0x23a7a0]+_0x3ccc('0x38')]=_0x533be0;}var _0x514a75={'id':this['id'],'name':this[_0x3ccc('0x8')],'online':this[_0x3ccc('0x9')],'voicePause':this[_0x3ccc('0xa')],'chatPause':this[_0x3ccc('0xb')],'mailPause':this[_0x3ccc('0xc')],'smsPause':this[_0x3ccc('0xe')],'faxPause':this[_0x3ccc('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x3ccc('0x12')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x3ccc('0x3c')],'mailStatus':this[_0x3ccc('0x3d')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x3ccc('0x17')],'faxStatusTime':this[_0x3ccc('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x3ccc('0x1a')],'smsStatus':this[_0x3ccc('0x1b')],'smsStatusTime':this[_0x3ccc('0x1c')],'smsCapacity':this[_0x3ccc('0x1d')],'smsCurrentCapacity':this[_0x3ccc('0x1e')],'whatsappStatus':this[_0x3ccc('0x1f')],'whatsappStatusTime':this[_0x3ccc('0x3e')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x3ccc('0x21')],'openchannelStatus':this[_0x3ccc('0x3f')],'openchannelStatusTime':this[_0x3ccc('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x3ccc('0x40')],'busy':this[_0x3ccc('0x24')],'busyQueue':this[_0x3ccc('0x41')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x3ccc('0x26')],'mailWaitingInteractions':this[_0x3ccc('0x27')],'openchannelWaitingInteractions':this[_0x3ccc('0x28')],'smsWaitingInteractions':this[_0x3ccc('0x29')],'whatsappWaitingInteractions':this[_0x3ccc('0x2a')]};var _0x5b2817=md5(JSON[_0x3ccc('0x42')](_0x514a75));if(this['md5']!==_0x5b2817){this[_0x3ccc('0x1')]=_0x5b2817;io[_0x3ccc('0x43')]('user:save',_0x514a75);}};module['exports']=Agent; \ No newline at end of file +var _0x9bb6=['faxStatusTime','smsStatusTime','whatsappStatusTime','openchannelStatus','busy','chatWaitingInteractions','stringify','emit','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','unknown','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','Capacity','working','idle','chat','openchannel','fax','sms','whatsapp','length','Status','openchannelPause','chatStatus','chatStatusTime'];(function(_0x8f8baa,_0x58d8cd){var _0x19fe59=function(_0x41328f){while(--_0x41328f){_0x8f8baa['push'](_0x8f8baa['shift']());}};_0x19fe59(++_0x58d8cd);}(_0x9bb6,0x13a));var _0x69bb=function(_0x4bf17a,_0x24d74c){_0x4bf17a=_0x4bf17a-0x0;var _0xe22657=_0x9bb6[_0x4bf17a];return _0xe22657;};'use strict';var _=require(_0x69bb('0x0'));var moment=require(_0x69bb('0x1'));var md5=require(_0x69bb('0x2'));var Redis=require(_0x69bb('0x3'));var config=require(_0x69bb('0x4'));config[_0x69bb('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x69bb('0x6'))(new Redis(config[_0x69bb('0x5')]));function Agent(_0x15555f){this['id']=_0x15555f['id']||0x0;this[_0x69bb('0x7')]=_0x15555f['name']||'';this[_0x69bb('0x8')]=_0x15555f[_0x69bb('0x8')]||!![];this['voicePause']=_0x15555f[_0x69bb('0x9')]||![];this[_0x69bb('0xa')]=_0x15555f[_0x69bb('0xa')]||![];this['mailPause']=_0x15555f[_0x69bb('0xb')]||![];this[_0x69bb('0xc')]=_0x15555f[_0x69bb('0xc')]||![];this[_0x69bb('0xd')]=_0x15555f['smsPause']||![];this['openchannelPause']=_0x15555f['openchannelPause']||![];this['chatStatus']=_0x69bb('0xe');this['chatStatusTime']=0x0;this[_0x69bb('0xf')]=_0x15555f['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x69bb('0x10')]='unknown';this['mailStatusTime']=0x0;this[_0x69bb('0x11')]=_0x15555f['mailCapacity']||0x0;this[_0x69bb('0x12')]=0x0;this[_0x69bb('0x13')]=_0x69bb('0xe');this['faxStatusTime']=0x0;this[_0x69bb('0x14')]=_0x15555f[_0x69bb('0x14')]||0x0;this[_0x69bb('0x15')]=0x0;this[_0x69bb('0x16')]=_0x69bb('0xe');this['smsStatusTime']=0x0;this[_0x69bb('0x17')]=_0x15555f[_0x69bb('0x17')]||0x0;this[_0x69bb('0x18')]=0x0;this[_0x69bb('0x19')]=_0x69bb('0xe');this['whatsappStatusTime']=0x0;this[_0x69bb('0x1a')]=_0x15555f[_0x69bb('0x1a')]||0x0;this[_0x69bb('0x1b')]=0x0;this['openchannelStatus']=_0x69bb('0xe');this[_0x69bb('0x1c')]=0x0;this[_0x69bb('0x1d')]=_0x15555f[_0x69bb('0x1d')]||0x0;this[_0x69bb('0x1e')]=0x0;this['busy']=![];this[_0x69bb('0x1f')]=undefined;this[_0x69bb('0x2')]='';this['chatWaitingInteractions']={};this[_0x69bb('0x20')]={};this[_0x69bb('0x21')]={};this[_0x69bb('0x22')]={};this[_0x69bb('0x23')]={};this[_0x69bb('0x24')]={};this[_0x69bb('0x25')]();}Agent['prototype'][_0x69bb('0x26')]=function(_0x1571b4){if(this[_0x1571b4+'CurrentCapacity']>0x0){if(this[_0x1571b4+'Capacity']>0x0&&this[_0x1571b4+'CurrentCapacity']>=this[_0x1571b4+_0x69bb('0x27')]){return'maxcapacity';}else{return _0x69bb('0x28');}}else{return _0x69bb('0x29');}};Agent['prototype']['updateRealtime']=function(){var _0x156aed=['mail',_0x69bb('0x2a'),_0x69bb('0x2b'),_0x69bb('0x2c'),_0x69bb('0x2d'),_0x69bb('0x2e')];for(var _0x402ec0=0x0;_0x402ec0<_0x156aed[_0x69bb('0x2f')];_0x402ec0+=0x1){var _0xb7fcb9=this['getChannelStatus'](_0x156aed[_0x402ec0]);if(this[_0x156aed[_0x402ec0]+_0x69bb('0x30')]!==_0xb7fcb9){this[_0x156aed[_0x402ec0]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x156aed[_0x402ec0]+'Status']=_0xb7fcb9;}var _0x31ba73={'id':this['id'],'name':this[_0x69bb('0x7')],'online':this['online'],'voicePause':this[_0x69bb('0x9')],'chatPause':this[_0x69bb('0xa')],'mailPause':this[_0x69bb('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x69bb('0xc')],'openchannelPause':this[_0x69bb('0x31')],'chatStatus':this[_0x69bb('0x32')],'chatStatusTime':this[_0x69bb('0x33')],'chatCapacity':this[_0x69bb('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x69bb('0x10')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x69bb('0x11')],'mailCurrentCapacity':this[_0x69bb('0x12')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x69bb('0x34')],'faxCapacity':this[_0x69bb('0x14')],'faxCurrentCapacity':this[_0x69bb('0x15')],'smsStatus':this[_0x69bb('0x16')],'smsStatusTime':this[_0x69bb('0x35')],'smsCapacity':this[_0x69bb('0x17')],'smsCurrentCapacity':this[_0x69bb('0x18')],'whatsappStatus':this[_0x69bb('0x19')],'whatsappStatusTime':this[_0x69bb('0x36')],'whatsappCapacity':this[_0x69bb('0x1a')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x69bb('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x69bb('0x1d')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x69bb('0x38')],'busyQueue':this[_0x69bb('0x1f')],'chatWaitingInteractions':this[_0x69bb('0x39')],'faxWaitingInteractions':this[_0x69bb('0x20')],'mailWaitingInteractions':this[_0x69bb('0x21')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x69bb('0x23')],'whatsappWaitingInteractions':this[_0x69bb('0x24')]};var _0xec88cd=md5(JSON[_0x69bb('0x3a')](_0x31ba73));if(this['md5']!==_0xec88cd){this['md5']=_0xec88cd;io[_0x69bb('0x3b')]('user:save',_0x31ba73);}};module[_0x69bb('0x3c')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 04ac9e3..478406d 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 _0x9808=['localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','paused','length','online','chatPause','available','loggedIn','stringify','md5','format','chat:queue:%s','chat_queue:save','lodash','util','redis','defaults'];(function(_0x50c16c,_0x43b99e){var _0x24dc5f=function(_0x39b90f){while(--_0x39b90f){_0x50c16c['push'](_0x50c16c['shift']());}};_0x24dc5f(++_0x43b99e);}(_0x9808,0x1ea));var _0x8980=function(_0x55f549,_0x4f90ac){_0x55f549=_0x55f549-0x0;var _0x589a78=_0x9808[_0x55f549];return _0x589a78;};'use strict';var _=require(_0x8980('0x0'));var md5=require('md5');var util=require(_0x8980('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x8980('0x2')]=_[_0x8980('0x3')](config[_0x8980('0x2')],{'host':_0x8980('0x4'),'port':0x18eb});var io=require(_0x8980('0x5'))(new Redis(config[_0x8980('0x2')]));function ChatQueue(_0x1ce97a){this['id']=_0x1ce97a['id']||0x0;this['name']=_0x1ce97a['name']||'';this[_0x8980('0x6')]=_0x1ce97a[_0x8980('0x6')]||0xa;this[_0x8980('0x7')]=_0x1ce97a[_0x8980('0x7')]||'beepall';this[_0x8980('0x8')]=_0x1ce97a['Agents'];this[_0x8980('0x9')]={};this[_0x8980('0xa')]=0x0;this['md5']='';this[_0x8980('0xb')]();this['updateRealtime']();}ChatQueue[_0x8980('0xc')][_0x8980('0xb')]=function(){var _0x1c4fb0=this[_0x8980('0x9')][_0x8980('0xd')];this[_0x8980('0x9')]=_[_0x8980('0xe')](this[_0x8980('0x8')],'id');this[_0x8980('0x9')][_0x8980('0xd')]=_0x1c4fb0;};ChatQueue[_0x8980('0xc')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x8980('0xf')]=0x0;for(var _0x344816=0x0;_0x344816=0x0?this[_0x8980('0x13')]:0x0;var _0x3aa275={'id':this['id'],'available':this[_0x8980('0x13')],'loggedIn':this[_0x8980('0x14')],'name':this['name'],'paused':this[_0x8980('0xf')],'waiting':this[_0x8980('0xa')]};var _0x478594=md5(JSON[_0x8980('0x15')](_0x3aa275));if(this[_0x8980('0x16')]!==_0x478594){this[_0x8980('0x16')]=_0x478594;io['to'](util[_0x8980('0x17')](_0x8980('0x18'),_0x3aa275['name']))['emit'](_0x8980('0x19'),_0x3aa275);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x1158=['emit','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','map','_rr','loggedIn','paused','online','chatPause','available','format'];(function(_0x3e3f82,_0x535fa2){var _0x1e43fc=function(_0x4a52ec){while(--_0x4a52ec){_0x3e3f82['push'](_0x3e3f82['shift']());}};_0x1e43fc(++_0x535fa2);}(_0x1158,0x1b6));var _0x8115=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x1158[_0x2ec461];return _0x28603d;};'use strict';var _=require('lodash');var md5=require(_0x8115('0x0'));var util=require('util');var Redis=require(_0x8115('0x1'));var config=require(_0x8115('0x2'));config[_0x8115('0x3')]=_[_0x8115('0x4')](config[_0x8115('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x8115('0x5'))(new Redis(config[_0x8115('0x3')]));function ChatQueue(_0x279d27){this['id']=_0x279d27['id']||0x0;this[_0x8115('0x6')]=_0x279d27['name']||'';this[_0x8115('0x7')]=_0x279d27[_0x8115('0x7')]||0xa;this['strategy']=_0x279d27[_0x8115('0x8')]||_0x8115('0x9');this[_0x8115('0xa')]=_0x279d27[_0x8115('0xa')];this[_0x8115('0xb')]={};this['waiting']=0x0;this[_0x8115('0x0')]='';this['updateRouting']();this[_0x8115('0xc')]();}ChatQueue[_0x8115('0xd')]['updateRouting']=function(){var _0x7899a6=this[_0x8115('0xb')]['_rr'];this[_0x8115('0xb')]=_[_0x8115('0xe')](this['Agents'],'id');this[_0x8115('0xb')][_0x8115('0xf')]=_0x7899a6;};ChatQueue[_0x8115('0xd')]['updateRealtime']=function(){this[_0x8115('0x10')]=0x0;this[_0x8115('0x11')]=0x0;for(var _0x51ec7f=0x0;_0x51ec7f=0x0?this['available']:0x0;var _0x576c9b={'id':this['id'],'available':this[_0x8115('0x14')],'loggedIn':this[_0x8115('0x10')],'name':this[_0x8115('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x2a5c61=md5(JSON['stringify'](_0x576c9b));if(this[_0x8115('0x0')]!==_0x2a5c61){this[_0x8115('0x0')]=_0x2a5c61;io['to'](util[_0x8115('0x15')]('chat:queue:%s',_0x576c9b[_0x8115('0x6')]))[_0x8115('0x16')]('chat_queue:save',_0x576c9b);}};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 966b5ee..82e5db4 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 _0x7346=['online','faxPause','available','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','length'];(function(_0x29c436,_0x325ca6){var _0x57cec3=function(_0x2a4f94){while(--_0x2a4f94){_0x29c436['push'](_0x29c436['shift']());}};_0x57cec3(++_0x325ca6);}(_0x7346,0xf6));var _0x6734=function(_0x5c1f70,_0x3dc53d){_0x5c1f70=_0x5c1f70-0x0;var _0x49d7c4=_0x7346[_0x5c1f70];return _0x49d7c4;};'use strict';var _=require(_0x6734('0x0'));var md5=require(_0x6734('0x1'));var util=require(_0x6734('0x2'));var Redis=require(_0x6734('0x3'));var config=require(_0x6734('0x4'));config['redis']=_[_0x6734('0x5')](config[_0x6734('0x6')],{'host':_0x6734('0x7'),'port':0x18eb});var io=require(_0x6734('0x8'))(new Redis(config[_0x6734('0x6')]));function FaxQueue(_0x34dad6){this['id']=_0x34dad6['id']||0x0;this[_0x6734('0x9')]=_0x34dad6[_0x6734('0x9')]||'';this[_0x6734('0xa')]=_0x34dad6['timeout']||0xa;this[_0x6734('0xb')]=_0x34dad6[_0x6734('0xb')]||_0x6734('0xc');this[_0x6734('0xd')]=_0x34dad6[_0x6734('0xd')];this[_0x6734('0xe')]={};this[_0x6734('0xf')]=0x0;this[_0x6734('0x1')]='';this['updateRouting']();this[_0x6734('0x10')]();}FaxQueue['prototype'][_0x6734('0x11')]=function(){var _0x1a94ca=this[_0x6734('0xe')][_0x6734('0x12')];this[_0x6734('0xe')]=_[_0x6734('0x13')](this['Agents'],'id');this[_0x6734('0xe')][_0x6734('0x12')]=_0x1a94ca;};FaxQueue[_0x6734('0x14')]['updateRealtime']=function(){this[_0x6734('0x15')]=0x0;this[_0x6734('0x16')]=0x0;for(var _0x2eb2c5=0x0;_0x2eb2c5=0x0?this[_0x6734('0x1a')]:0x0;var _0x33fc3f={'id':this['id'],'available':this[_0x6734('0x1a')],'loggedIn':this[_0x6734('0x15')],'name':this[_0x6734('0x9')],'paused':this[_0x6734('0x16')],'waiting':this['waiting']};var _0x5774fa=md5(JSON['stringify'](_0x33fc3f));if(this[_0x6734('0x1')]!==_0x5774fa){this[_0x6734('0x1')]=_0x5774fa;io['to'](util['format'](_0x6734('0x1b'),_0x33fc3f[_0x6734('0x9')]))[_0x6734('0x1c')]('fax_queue:save',_0x33fc3f);}};module[_0x6734('0x1d')]=FaxQueue; \ No newline at end of file +var _0x31ce=['name','timeout','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x32b56b,_0x2ff149){var _0x856a25=function(_0x23991e){while(--_0x23991e){_0x32b56b['push'](_0x32b56b['shift']());}};_0x856a25(++_0x2ff149);}(_0x31ce,0x121));var _0xe31c=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0x31ce[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0xe31c('0x0'));var md5=require(_0xe31c('0x1'));var util=require(_0xe31c('0x2'));var Redis=require(_0xe31c('0x3'));var config=require(_0xe31c('0x4'));config[_0xe31c('0x5')]=_['defaults'](config[_0xe31c('0x5')],{'host':_0xe31c('0x6'),'port':0x18eb});var io=require(_0xe31c('0x7'))(new Redis(config['redis']));function FaxQueue(_0x235432){this['id']=_0x235432['id']||0x0;this[_0xe31c('0x8')]=_0x235432[_0xe31c('0x8')]||'';this[_0xe31c('0x9')]=_0x235432[_0xe31c('0x9')]||0xa;this['strategy']=_0x235432['strategy']||_0xe31c('0xa');this['Agents']=_0x235432[_0xe31c('0xb')];this[_0xe31c('0xc')]={};this[_0xe31c('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xe31c('0xe')]();}FaxQueue[_0xe31c('0xf')][_0xe31c('0x10')]=function(){var _0x182339=this[_0xe31c('0xc')][_0xe31c('0x11')];this[_0xe31c('0xc')]=_['map'](this[_0xe31c('0xb')],'id');this[_0xe31c('0xc')][_0xe31c('0x11')]=_0x182339;};FaxQueue['prototype']['updateRealtime']=function(){this[_0xe31c('0x12')]=0x0;this[_0xe31c('0x13')]=0x0;for(var _0x5b383d=0x0;_0x5b383d=0x0?this[_0xe31c('0x15')]:0x0;var _0x36f3f6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe31c('0x12')],'name':this[_0xe31c('0x8')],'paused':this[_0xe31c('0x13')],'waiting':this[_0xe31c('0xd')]};var _0x1ed2f1=md5(JSON[_0xe31c('0x16')](_0x36f3f6));if(this[_0xe31c('0x1')]!==_0x1ed2f1){this[_0xe31c('0x1')]=_0x1ed2f1;io['to'](util['format'](_0xe31c('0x17'),_0x36f3f6['name']))[_0xe31c('0x18')](_0xe31c('0x19'),_0x36f3f6);}};module[_0xe31c('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index fc142c5..c0c824a 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 _0x97ae=['Intervals','exports','name'];(function(_0x58850c,_0x510e14){var _0x1e098f=function(_0x146958){while(--_0x146958){_0x58850c['push'](_0x58850c['shift']());}};_0x1e098f(++_0x510e14);}(_0x97ae,0x1f1));var _0xe97a=function(_0x273956,_0x19ae92){_0x273956=_0x273956-0x0;var _0x4daa94=_0x97ae[_0x273956];return _0x4daa94;};'use strict';function Interval(_0x4c7a54){this['id']=_0x4c7a54['id']||0x0;this['name']=_0x4c7a54[_0xe97a('0x0')]||'';this['Intervals']=_0x4c7a54[_0xe97a('0x1')]||{};}module[_0xe97a('0x2')]=Interval; \ No newline at end of file +var _0x0456=['name','Intervals'];(function(_0x2eeceb,_0x164a66){var _0x5e6204=function(_0x1c973c){while(--_0x1c973c){_0x2eeceb['push'](_0x2eeceb['shift']());}};_0x5e6204(++_0x164a66);}(_0x0456,0x116));var _0x6045=function(_0x9ed71d,_0x20ff4f){_0x9ed71d=_0x9ed71d-0x0;var _0x56c83e=_0x0456[_0x9ed71d];return _0x56c83e;};'use strict';function Interval(_0x349e98){this['id']=_0x349e98['id']||0x0;this[_0x6045('0x0')]=_0x349e98[_0x6045('0x0')]||'';this[_0x6045('0x1')]=_0x349e98[_0x6045('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 8e62112..5ab7db5 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 _0xf975=['strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format','mail:queue:%s','exports','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x3870fe,_0x510bd2){var _0x3fff97=function(_0x3d2514){while(--_0x3d2514){_0x3870fe['push'](_0x3870fe['shift']());}};_0x3fff97(++_0x510bd2);}(_0xf975,0x19b));var _0x5f97=function(_0x166953,_0x214d3a){_0x166953=_0x166953-0x0;var _0x4a8baf=_0xf975[_0x166953];return _0x4a8baf;};'use strict';var _=require(_0x5f97('0x0'));var md5=require(_0x5f97('0x1'));var util=require(_0x5f97('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x5f97('0x3')]=_[_0x5f97('0x4')](config['redis'],{'host':_0x5f97('0x5'),'port':0x18eb});var io=require(_0x5f97('0x6'))(new Redis(config[_0x5f97('0x3')]));function MailQueue(_0x12b262){this['id']=_0x12b262['id']||0x0;this[_0x5f97('0x7')]=_0x12b262[_0x5f97('0x7')]||'';this['timeout']=_0x12b262[_0x5f97('0x8')]||0xa;this[_0x5f97('0x9')]=_0x12b262[_0x5f97('0x9')]||_0x5f97('0xa');this['Agents']=_0x12b262[_0x5f97('0xb')];this[_0x5f97('0xc')]={};this['waiting']=0x0;this[_0x5f97('0x1')]='';this[_0x5f97('0xd')]();this[_0x5f97('0xe')]();}MailQueue[_0x5f97('0xf')]['updateRouting']=function(){var _0x18b698=this[_0x5f97('0xc')][_0x5f97('0x10')];this[_0x5f97('0xc')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0x5f97('0x10')]=_0x18b698;};MailQueue['prototype'][_0x5f97('0xe')]=function(){this[_0x5f97('0x11')]=0x0;this[_0x5f97('0x12')]=0x0;for(var _0x2fbd47=0x0;_0x2fbd47=0x0?this[_0x5f97('0x16')]:0x0;var _0x6518e1={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5f97('0x11')],'name':this[_0x5f97('0x7')],'paused':this[_0x5f97('0x12')],'waiting':this[_0x5f97('0x17')]};var _0x15dc0f=md5(JSON[_0x5f97('0x18')](_0x6518e1));if(this[_0x5f97('0x1')]!==_0x15dc0f){this[_0x5f97('0x1')]=_0x15dc0f;io['to'](util[_0x5f97('0x19')](_0x5f97('0x1a'),_0x6518e1[_0x5f97('0x7')]))['emit']('mail_queue:save',_0x6518e1);}};module[_0x5f97('0x1b')]=MailQueue; \ No newline at end of file +var _0x64a0=['emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s'];(function(_0x535bfe,_0x2594fb){var _0x22df6c=function(_0x2385bc){while(--_0x2385bc){_0x535bfe['push'](_0x535bfe['shift']());}};_0x22df6c(++_0x2594fb);}(_0x64a0,0x103));var _0x064a=function(_0xf9b7a3,_0x2a66f4){_0xf9b7a3=_0xf9b7a3-0x0;var _0x25f0a2=_0x64a0[_0xf9b7a3];return _0x25f0a2;};'use strict';var _=require(_0x064a('0x0'));var md5=require(_0x064a('0x1'));var util=require(_0x064a('0x2'));var Redis=require(_0x064a('0x3'));var config=require('../../../config/environment');config[_0x064a('0x4')]=_[_0x064a('0x5')](config[_0x064a('0x4')],{'host':_0x064a('0x6'),'port':0x18eb});var io=require(_0x064a('0x7'))(new Redis(config['redis']));function MailQueue(_0x188a15){this['id']=_0x188a15['id']||0x0;this[_0x064a('0x8')]=_0x188a15[_0x064a('0x8')]||'';this[_0x064a('0x9')]=_0x188a15[_0x064a('0x9')]||0xa;this[_0x064a('0xa')]=_0x188a15[_0x064a('0xa')]||_0x064a('0xb');this['Agents']=_0x188a15[_0x064a('0xc')];this['mapAgentsId']={};this[_0x064a('0xd')]=0x0;this[_0x064a('0x1')]='';this[_0x064a('0xe')]();this[_0x064a('0xf')]();}MailQueue[_0x064a('0x10')][_0x064a('0xe')]=function(){var _0x5ef994=this[_0x064a('0x11')][_0x064a('0x12')];this['mapAgentsId']=_[_0x064a('0x13')](this['Agents'],'id');this[_0x064a('0x11')][_0x064a('0x12')]=_0x5ef994;};MailQueue['prototype'][_0x064a('0xf')]=function(){this[_0x064a('0x14')]=0x0;this['paused']=0x0;for(var _0xd5dd64=0x0;_0xd5dd64=0x0?this['available']:0x0;var _0xaaad9d={'id':this['id'],'available':this[_0x064a('0x19')],'loggedIn':this[_0x064a('0x14')],'name':this[_0x064a('0x8')],'paused':this[_0x064a('0x18')],'waiting':this['waiting']};var _0x3b8b6e=md5(JSON[_0x064a('0x1a')](_0xaaad9d));if(this[_0x064a('0x1')]!==_0x3b8b6e){this['md5']=_0x3b8b6e;io['to'](util[_0x064a('0x1b')](_0x064a('0x1c'),_0xaaad9d['name']))[_0x064a('0x1d')](_0x064a('0x1e'),_0xaaad9d);}};module[_0x064a('0x1f')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2d39cc5..15cd177 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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x273ad4,_0x449aab){var _0x1c8d92=function(_0x237fea){while(--_0x237fea){_0x273ad4['push'](_0x273ad4['shift']());}};_0x1c8d92(++_0x449aab);}(_0x814b,0x1a2));var _0xb814=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x814b[_0x470b0a];return _0x4463f6;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x1261,0x144));var _0x1126=function(_0x29b2a2,_0x4b7224){_0x29b2a2=_0x29b2a2-0x0;var _0x836e8c=_0x1261[_0x29b2a2];return _0x836e8c;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index fa22f9a..6c432f9 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 _0x5044=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x5044,0xc8));var _0x4504=function(_0x2263ea,_0x2530d2){_0x2263ea=_0x2263ea-0x0;var _0x159687=_0x5044[_0x2263ea];return _0x159687;};'use strict';var _=require('lodash');var md5=require(_0x4504('0x0'));var util=require('util');var Redis=require(_0x4504('0x1'));var config=require(_0x4504('0x2'));config[_0x4504('0x3')]=_[_0x4504('0x4')](config[_0x4504('0x3')],{'host':_0x4504('0x5'),'port':0x18eb});var io=require(_0x4504('0x6'))(new Redis(config[_0x4504('0x3')]));function SmsQueue(_0x4d5c5a){this['id']=_0x4d5c5a['id']||0x0;this[_0x4504('0x7')]=_0x4d5c5a[_0x4504('0x7')]||'';this[_0x4504('0x8')]=_0x4d5c5a[_0x4504('0x8')]||0xa;this[_0x4504('0x9')]=_0x4d5c5a[_0x4504('0x9')]||_0x4504('0xa');this[_0x4504('0xb')]=_0x4d5c5a[_0x4504('0xb')];this['mapAgentsId']={};this[_0x4504('0xc')]=0x0;this['md5']='';this[_0x4504('0xd')]();this[_0x4504('0xe')]();}SmsQueue[_0x4504('0xf')][_0x4504('0xd')]=function(){var _0x2498c3=this[_0x4504('0x10')][_0x4504('0x11')];this[_0x4504('0x10')]=_[_0x4504('0x12')](this[_0x4504('0xb')],'id');this[_0x4504('0x10')][_0x4504('0x11')]=_0x2498c3;};SmsQueue[_0x4504('0xf')]['updateRealtime']=function(){this[_0x4504('0x13')]=0x0;this[_0x4504('0x14')]=0x0;for(var _0x564bc5=0x0;_0x564bc5=0x0?this['available']:0x0;var _0x35a355={'id':this['id'],'available':this[_0x4504('0x18')],'loggedIn':this[_0x4504('0x13')],'name':this[_0x4504('0x7')],'paused':this[_0x4504('0x14')],'waiting':this[_0x4504('0xc')]};var _0x5c9164=md5(JSON['stringify'](_0x35a355));if(this['md5']!==_0x5c9164){this[_0x4504('0x0')]=_0x5c9164;io['to'](util[_0x4504('0x19')](_0x4504('0x1a'),_0x35a355[_0x4504('0x7')]))[_0x4504('0x1b')]('sms_queue:save',_0x35a355);}};module[_0x4504('0x1c')]=SmsQueue; \ No newline at end of file +var _0x0a9a=['length','online','smsPause','paused','available','waiting','stringify','sms:queue:%s','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','map','prototype','updateRealtime','loggedIn'];(function(_0x44aa7a,_0x52d204){var _0x4ac51e=function(_0x45d661){while(--_0x45d661){_0x44aa7a['push'](_0x44aa7a['shift']());}};_0x4ac51e(++_0x52d204);}(_0x0a9a,0x183));var _0xa0a9=function(_0x2faee6,_0x3fd854){_0x2faee6=_0x2faee6-0x0;var _0x1a7e23=_0x0a9a[_0x2faee6];return _0x1a7e23;};'use strict';var _=require('lodash');var md5=require(_0xa0a9('0x0'));var util=require('util');var Redis=require(_0xa0a9('0x1'));var config=require(_0xa0a9('0x2'));config[_0xa0a9('0x3')]=_[_0xa0a9('0x4')](config['redis'],{'host':_0xa0a9('0x5'),'port':0x18eb});var io=require(_0xa0a9('0x6'))(new Redis(config['redis']));function SmsQueue(_0x425c3c){this['id']=_0x425c3c['id']||0x0;this[_0xa0a9('0x7')]=_0x425c3c[_0xa0a9('0x7')]||'';this[_0xa0a9('0x8')]=_0x425c3c['timeout']||0xa;this[_0xa0a9('0x9')]=_0x425c3c['strategy']||_0xa0a9('0xa');this[_0xa0a9('0xb')]=_0x425c3c[_0xa0a9('0xb')];this[_0xa0a9('0xc')]={};this['waiting']=0x0;this[_0xa0a9('0x0')]='';this[_0xa0a9('0xd')]();this['updateRealtime']();}SmsQueue['prototype'][_0xa0a9('0xd')]=function(){var _0x33f54f=this['mapAgentsId'][_0xa0a9('0xe')];this['mapAgentsId']=_[_0xa0a9('0xf')](this['Agents'],'id');this[_0xa0a9('0xc')][_0xa0a9('0xe')]=_0x33f54f;};SmsQueue[_0xa0a9('0x10')][_0xa0a9('0x11')]=function(){this[_0xa0a9('0x12')]=0x0;this['paused']=0x0;for(var _0x1f3f23=0x0;_0x1f3f23=0x0?this['available']:0x0;var _0x320735={'id':this['id'],'available':this[_0xa0a9('0x17')],'loggedIn':this[_0xa0a9('0x12')],'name':this[_0xa0a9('0x7')],'paused':this[_0xa0a9('0x16')],'waiting':this[_0xa0a9('0x18')]};var _0x5c82ed=md5(JSON[_0xa0a9('0x19')](_0x320735));if(this[_0xa0a9('0x0')]!==_0x5c82ed){this['md5']=_0x5c82ed;io['to'](util['format'](_0xa0a9('0x1a'),_0x320735[_0xa0a9('0x7')]))[_0xa0a9('0x1b')]('sms_queue:save',_0x320735);}};module[_0xa0a9('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 8f61b36..2d80285 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 _0xd4de=['md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','whatsappPause','available','stringify','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x22bd05,_0x47580e){var _0x434a5e=function(_0x1c7056){while(--_0x1c7056){_0x22bd05['push'](_0x22bd05['shift']());}};_0x434a5e(++_0x47580e);}(_0xd4de,0xda));var _0xed4d=function(_0x52d6b2,_0x1826e6){_0x52d6b2=_0x52d6b2-0x0;var _0x45e017=_0xd4de[_0x52d6b2];return _0x45e017;};'use strict';var _=require(_0xed4d('0x0'));var md5=require('md5');var util=require(_0xed4d('0x1'));var Redis=require(_0xed4d('0x2'));var config=require(_0xed4d('0x3'));config[_0xed4d('0x4')]=_[_0xed4d('0x5')](config['redis'],{'host':_0xed4d('0x6'),'port':0x18eb});var io=require(_0xed4d('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x21f6d0){this['id']=_0x21f6d0['id']||0x0;this[_0xed4d('0x8')]=_0x21f6d0[_0xed4d('0x8')]||'';this[_0xed4d('0x9')]=_0x21f6d0[_0xed4d('0x9')]||0xa;this[_0xed4d('0xa')]=_0x21f6d0[_0xed4d('0xa')]||'beepall';this[_0xed4d('0xb')]=_0x21f6d0[_0xed4d('0xb')];this[_0xed4d('0xc')]={};this[_0xed4d('0xd')]=0x0;this[_0xed4d('0xe')]='';this[_0xed4d('0xf')]();this[_0xed4d('0x10')]();}WhatsappQueue[_0xed4d('0x11')][_0xed4d('0xf')]=function(){var _0x2d7010=this[_0xed4d('0xc')][_0xed4d('0x12')];this[_0xed4d('0xc')]=_[_0xed4d('0x13')](this[_0xed4d('0xb')],'id');this[_0xed4d('0xc')][_0xed4d('0x12')]=_0x2d7010;};WhatsappQueue[_0xed4d('0x11')][_0xed4d('0x10')]=function(){this[_0xed4d('0x14')]=0x0;this[_0xed4d('0x15')]=0x0;for(var _0x5f2927=0x0;_0x5f2927=0x0?this[_0xed4d('0x18')]:0x0;var _0x4ec155={'id':this['id'],'available':this[_0xed4d('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xed4d('0x8')],'paused':this[_0xed4d('0x15')],'waiting':this[_0xed4d('0xd')]};var _0x89dd9d=md5(JSON[_0xed4d('0x19')](_0x4ec155));if(this[_0xed4d('0xe')]!==_0x89dd9d){this[_0xed4d('0xe')]=_0x89dd9d;io['to'](util['format'](_0xed4d('0x1a'),_0x4ec155[_0xed4d('0x8')]))['emit'](_0xed4d('0x1b'),_0x4ec155);}};module[_0xed4d('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x1fa2=['whatsappPause','available','stringify','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','prototype','loggedIn','paused','online'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x1fa2,0x19b));var _0x21fa=function(_0x59a3aa,_0x155b2b){_0x59a3aa=_0x59a3aa-0x0;var _0x3f64f9=_0x1fa2[_0x59a3aa];return _0x3f64f9;};'use strict';var _=require(_0x21fa('0x0'));var md5=require(_0x21fa('0x1'));var util=require('util');var Redis=require(_0x21fa('0x2'));var config=require(_0x21fa('0x3'));config[_0x21fa('0x4')]=_[_0x21fa('0x5')](config[_0x21fa('0x4')],{'host':_0x21fa('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21fa('0x4')]));function WhatsappQueue(_0x51e440){this['id']=_0x51e440['id']||0x0;this['name']=_0x51e440[_0x21fa('0x7')]||'';this[_0x21fa('0x8')]=_0x51e440['timeout']||0xa;this[_0x21fa('0x9')]=_0x51e440[_0x21fa('0x9')]||_0x21fa('0xa');this[_0x21fa('0xb')]=_0x51e440[_0x21fa('0xb')];this[_0x21fa('0xc')]={};this[_0x21fa('0xd')]=0x0;this[_0x21fa('0x1')]='';this['updateRouting']();this[_0x21fa('0xe')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x30bace=this[_0x21fa('0xc')][_0x21fa('0xf')];this[_0x21fa('0xc')]=_[_0x21fa('0x10')](this[_0x21fa('0xb')],'id');this[_0x21fa('0xc')]['_rr']=_0x30bace;};WhatsappQueue[_0x21fa('0x11')][_0x21fa('0xe')]=function(){this[_0x21fa('0x12')]=0x0;this[_0x21fa('0x13')]=0x0;for(var _0x39de29=0x0;_0x39de29=0x0?this[_0x21fa('0x16')]:0x0;var _0x423f94={'id':this['id'],'available':this[_0x21fa('0x16')],'loggedIn':this[_0x21fa('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x21fa('0xd')]};var _0x411eb0=md5(JSON[_0x21fa('0x17')](_0x423f94));if(this[_0x21fa('0x1')]!==_0x411eb0){this[_0x21fa('0x1')]=_0x411eb0;io['to'](util['format']('whatsapp:queue:%s',_0x423f94[_0x21fa('0x7')]))[_0x21fa('0x18')](_0x21fa('0x19'),_0x423f94);}};module[_0x21fa('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 2f1f068..0ec65d6 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x5ce8c7,_0x9afbfa){var _0x41dffd=function(_0x1a5cb8){while(--_0x1a5cb8){_0x5ce8c7['push'](_0x5ce8c7['shift']());}};_0x41dffd(++_0x9afbfa);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c0baa,_0x2e110f){_0x4c0baa=_0x4c0baa-0x0;var _0x4bf459=_0xb10b[_0x4c0baa];return _0x4bf459;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index c93d383..8cce9b5 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 _0x2b3d=['addTags','AddTagsToChatInteraction','../client','Request','updateChatInteraction'];(function(_0x516948,_0x42c256){var _0x129d47=function(_0x1a2495){while(--_0x1a2495){_0x516948['push'](_0x516948['shift']());}};_0x129d47(++_0x42c256);}(_0x2b3d,0x1e2));var _0xd2b3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2b3d[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xd2b3('0x0'));exports['update']=function(_0x3cd174,_0x2d0e90){return client[_0xd2b3('0x1')]('UpdateChatInteraction',{'body':_0x2d0e90,'options':{'where':{'id':_0x3cd174}},'log':_0xd2b3('0x2')});};exports[_0xd2b3('0x3')]=function(_0x27ba47,_0x3e2006){return client[_0xd2b3('0x1')](_0xd2b3('0x4'),{'body':_0x3e2006,'options':{'where':{'id':_0x27ba47}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9b9b=['update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0x9b9b,0xb5));var _0xb9b9=function(_0x34ced0,_0x21907f){_0x34ced0=_0x34ced0-0x0;var _0x3db58d=_0x9b9b[_0x34ced0];return _0x3db58d;};'use strict';var client=require(_0xb9b9('0x0'));exports[_0xb9b9('0x1')]=function(_0x2af584,_0x5e64de){return client[_0xb9b9('0x2')]('UpdateChatInteraction',{'body':_0x5e64de,'options':{'where':{'id':_0x2af584}},'log':_0xb9b9('0x3')});};exports[_0xb9b9('0x4')]=function(_0x3ece9c,_0x5d3e4f){return client['Request'](_0xb9b9('0x5'),{'body':_0x5d3e4f,'options':{'where':{'id':_0x3ece9c}},'log':_0xb9b9('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ed1830e..9ddb114 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 _0x0cf8=['CreateChatMessage','createChatMessage','../client'];(function(_0x29b176,_0x792044){var _0x1c9170=function(_0x27612a){while(--_0x27612a){_0x29b176['push'](_0x29b176['shift']());}};_0x1c9170(++_0x792044);}(_0x0cf8,0x7a));var _0x80cf=function(_0x51be98,_0x124f3a){_0x51be98=_0x51be98-0x0;var _0x45eaeb=_0x0cf8[_0x51be98];return _0x45eaeb;};'use strict';var client=require(_0x80cf('0x0'));exports['create']=function(_0x43e6ed){return client['Request'](_0x80cf('0x1'),{'body':_0x43e6ed,'log':_0x80cf('0x2')});}; \ No newline at end of file +var _0x522c=['../client','Request','CreateChatMessage','createChatMessage'];(function(_0x451989,_0x299f13){var _0x211314=function(_0x4af3b5){while(--_0x4af3b5){_0x451989['push'](_0x451989['shift']());}};_0x211314(++_0x299f13);}(_0x522c,0x1dc));var _0xc522=function(_0x52f912,_0x5eb81f){_0x52f912=_0x52f912-0x0;var _0x1ca423=_0x522c[_0x52f912];return _0x1ca423;};'use strict';var client=require(_0xc522('0x0'));exports['create']=function(_0x1539a5){return client[_0xc522('0x1')](_0xc522('0x2'),{'body':_0x1539a5,'log':_0xc522('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5687647..1bf2811 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 _0xc01b=['GetChatQueue','timeout','strategy','online','chatPause','../client','getChatQueues','Request'];(function(_0x1e898b,_0x17e73f){var _0x4047d2=function(_0x8f3dfe){while(--_0x8f3dfe){_0x1e898b['push'](_0x1e898b['shift']());}};_0x4047d2(++_0x17e73f);}(_0xc01b,0x65));var _0xbc01=function(_0x79ddf5,_0x553e11){_0x79ddf5=_0x79ddf5-0x0;var _0x491bfa=_0xc01b[_0x79ddf5];return _0x491bfa;};'use strict';var client=require(_0xbc01('0x0'));exports[_0xbc01('0x1')]=function(){return function(){return client[_0xbc01('0x2')](_0xbc01('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xbc01('0x4'),_0xbc01('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0xbc01('0x6'),_0xbc01('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x5178=['GetChatQueue','name','timeout','Agents','chatPause','getChatQueues','Request'];(function(_0x54abe0,_0x171919){var _0x403d6b=function(_0x19fc51){while(--_0x19fc51){_0x54abe0['push'](_0x54abe0['shift']());}};_0x403d6b(++_0x171919);}(_0x5178,0x171));var _0x8517=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5178[_0x5ddb1c];return _0x354adc;};'use strict';var client=require('../client');exports[_0x8517('0x0')]=function(){return function(){return client[_0x8517('0x1')](_0x8517('0x2'),{'options':{'raw':![],'attributes':['id',_0x8517('0x3'),_0x8517('0x4'),'strategy'],'include':[{'model':'User','as':_0x8517('0x5'),'attributes':['id',_0x8517('0x3'),'online',_0x8517('0x6')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a4c7bf4..301b540 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 _0x2bd6=['update','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x2bd6[_0x279d37];return _0x530173;};'use strict';var client=require(_0x62bd('0x0'));exports[_0x62bd('0x1')]=function(_0x469dda){return client[_0x62bd('0x2')](_0x62bd('0x3'),{'body':_0x469dda,'log':'CreateChatQueueReport'});};exports[_0x62bd('0x4')]=function(_0x1a8ed2,_0x23ba52){return client['Request'](_0x62bd('0x5'),{'body':_0x23ba52,'options':{'where':{'uniqueid':_0x1a8ed2},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x72b1=['../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x1b77ff,_0x10c351){var _0x7fc697=function(_0x1208b2){while(--_0x1208b2){_0x1b77ff['push'](_0x1b77ff['shift']());}};_0x7fc697(++_0x10c351);}(_0x72b1,0x16e));var _0x172b=function(_0x90187f,_0x15d090){_0x90187f=_0x90187f-0x0;var _0x10eef5=_0x72b1[_0x90187f];return _0x10eef5;};'use strict';var client=require(_0x172b('0x0'));exports['create']=function(_0x368075){return client[_0x172b('0x1')](_0x172b('0x2'),{'body':_0x368075,'log':_0x172b('0x2')});};exports[_0x172b('0x3')]=function(_0x3fa10d,_0x2c1d6e){return client['Request'](_0x172b('0x4'),{'body':_0x2c1d6e,'options':{'where':{'uniqueid':_0x3fa10d},'order':[['id',_0x172b('0x5')]],'limit':0x1},'log':_0x172b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 2494e24..140f1b1 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(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x7a54,0x106));var _0x47a5=function(_0x5bfa36,_0x395b47){_0x5bfa36=_0x5bfa36-0x0;var _0x535bc9=_0x7a54[_0x5bfa36];return _0x535bc9;};'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(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x7a54,0x106));var _0x47a5=function(_0xf2e16a,_0x4087ce){_0xf2e16a=_0xf2e16a-0x0;var _0x553bb6=_0x7a54[_0xf2e16a];return _0x553bb6;};'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 00b6b57..b97f1c8 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 _0xb48f=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x5c4c8f,_0x17c762){var _0x3a9d87=function(_0x3b1f3c){while(--_0x3b1f3c){_0x5c4c8f['push'](_0x5c4c8f['shift']());}};_0x3a9d87(++_0x17c762);}(_0xb48f,0x17d));var _0xfb48=function(_0x1fb6e2,_0x3a22ce){_0x1fb6e2=_0x1fb6e2-0x0;var _0x354690=_0xb48f[_0x1fb6e2];return _0x354690;};'use strict';var client=require(_0xfb48('0x0'));exports[_0xfb48('0x1')]=function(_0x102f68){return client[_0xfb48('0x2')](_0xfb48('0x3'),{'body':_0x102f68,'log':_0xfb48('0x4')});}; \ No newline at end of file +var _0xb113=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x1acf4b,_0x5a750c){var _0x4eca09=function(_0xedef3a){while(--_0xedef3a){_0x1acf4b['push'](_0x1acf4b['shift']());}};_0x4eca09(++_0x5a750c);}(_0xb113,0x86));var _0x3b11=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xb113[_0x4f08dd];return _0x3017ee;};'use strict';var client=require(_0x3b11('0x0'));exports[_0x3b11('0x1')]=function(_0x5929a2){return client[_0x3b11('0x2')](_0x3b11('0x3'),{'body':_0x5929a2,'log':_0x3b11('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 7b6fe58..2f4c394 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 _0x670f=['strategy','User','Agents','online','../client','getFaxQueues','Request','name','timeout'];(function(_0x283cb6,_0x10fda2){var _0x57abb9=function(_0x3a2c4f){while(--_0x3a2c4f){_0x283cb6['push'](_0x283cb6['shift']());}};_0x57abb9(++_0x10fda2);}(_0x670f,0x1ab));var _0xf670=function(_0x5c3f4d,_0x6afd3f){_0x5c3f4d=_0x5c3f4d-0x0;var _0x1ddf7e=_0x670f[_0x5c3f4d];return _0x1ddf7e;};'use strict';var client=require(_0xf670('0x0'));exports[_0xf670('0x1')]=function(){return function(){return client[_0xf670('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xf670('0x3'),_0xf670('0x4'),_0xf670('0x5')],'include':[{'model':_0xf670('0x6'),'as':_0xf670('0x7'),'attributes':['id','name',_0xf670('0x8'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x9f50=['../client','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause'];(function(_0x39da8a,_0x194dc9){var _0x1f234b=function(_0x24ec3e){while(--_0x24ec3e){_0x39da8a['push'](_0x39da8a['shift']());}};_0x1f234b(++_0x194dc9);}(_0x9f50,0x129));var _0x09f5=function(_0x1ec836,_0x1ce2d6){_0x1ec836=_0x1ec836-0x0;var _0x4baf71=_0x9f50[_0x1ec836];return _0x4baf71;};'use strict';var client=require(_0x09f5('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x09f5('0x1')](_0x09f5('0x2'),{'options':{'raw':![],'attributes':['id',_0x09f5('0x3'),'timeout',_0x09f5('0x4')],'include':[{'model':_0x09f5('0x5'),'as':_0x09f5('0x6'),'attributes':['id',_0x09f5('0x3'),_0x09f5('0x7'),_0x09f5('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a691297..a32f521 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 _0x5dbb=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x39be7e,_0x112d05){var _0x39278e=function(_0x2f496a){while(--_0x2f496a){_0x39be7e['push'](_0x39be7e['shift']());}};_0x39278e(++_0x112d05);}(_0x5dbb,0x177));var _0xb5db=function(_0x53a224,_0x1a68eb){_0x53a224=_0x53a224-0x0;var _0x4c8824=_0x5dbb[_0x53a224];return _0x4c8824;};'use strict';var client=require(_0xb5db('0x0'));exports[_0xb5db('0x1')]=function(_0x28bd0b){return client[_0xb5db('0x2')]('CreateFaxQueueReport',{'body':_0x28bd0b,'log':_0xb5db('0x3')});};exports[_0xb5db('0x4')]=function(_0xe9625b,_0x43f375){return client[_0xb5db('0x2')](_0xb5db('0x5'),{'body':_0x43f375,'options':{'where':{'uniqueid':_0xe9625b},'order':[['id',_0xb5db('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x8d30=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x8d30,0x128));var _0x08d3=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x8d30[_0x330723];return _0x60c546;};'use strict';var client=require(_0x08d3('0x0'));exports[_0x08d3('0x1')]=function(_0x347308){return client[_0x08d3('0x2')](_0x08d3('0x3'),{'body':_0x347308,'log':_0x08d3('0x3')});};exports[_0x08d3('0x4')]=function(_0x34a2ee,_0xd7f600){return client[_0x08d3('0x2')](_0x08d3('0x5'),{'body':_0xd7f600,'options':{'where':{'uniqueid':_0x34a2ee},'order':[['id',_0x08d3('0x6')]],'limit':0x1},'log':_0x08d3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a39a9df..081f00b 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 _0x1046=['interval','../client','GetInterval','name','Intervals'];(function(_0x5695b5,_0x5a9cdc){var _0x2e9b6f=function(_0x4b4ff4){while(--_0x4b4ff4){_0x5695b5['push'](_0x5695b5['shift']());}};_0x2e9b6f(++_0x5a9cdc);}(_0x1046,0x92));var _0x6104=function(_0x596b6d,_0x157ac6){_0x596b6d=_0x596b6d-0x0;var _0x8abc3d=_0x1046[_0x596b6d];return _0x8abc3d;};'use strict';var client=require(_0x6104('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x6104('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x6104('0x2')],'include':[{'model':'Interval','as':_0x6104('0x3'),'attributes':['id',_0x6104('0x2'),_0x6104('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x5be8=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5be8,0x196));var _0x85be=function(_0x58554a,_0x52a04b){_0x58554a=_0x58554a-0x0;var _0x563946=_0x5be8[_0x58554a];return _0x563946;};'use strict';var client=require('../client');exports[_0x85be('0x0')]=function(){return function(){return client[_0x85be('0x1')](_0x85be('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x85be('0x3')],'include':[{'model':_0x85be('0x4'),'as':_0x85be('0x5'),'attributes':['id','name',_0x85be('0x6')]}]},'log':_0x85be('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ca86649..4d34c1e 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 _0x28f2=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x208949,_0x18fa61){var _0x425ff3=function(_0x195f0d){while(--_0x195f0d){_0x208949['push'](_0x208949['shift']());}};_0x425ff3(++_0x18fa61);}(_0x28f2,0x193));var _0x228f=function(_0x4d0571,_0x3ae8b5){_0x4d0571=_0x4d0571-0x0;var _0x35b95b=_0x28f2[_0x4d0571];return _0x35b95b;};'use strict';var client=require(_0x228f('0x0'));exports[_0x228f('0x1')]=function(_0x108337,_0x2e5e0b){return client[_0x228f('0x2')]('UpdateMailInteraction',{'body':_0x2e5e0b,'options':{'where':{'id':_0x108337}},'log':_0x228f('0x3')});};exports[_0x228f('0x4')]=function(_0x79ed5f,_0x4303c3){return client[_0x228f('0x2')](_0x228f('0x5'),{'body':_0x4303c3,'options':{'where':{'id':_0x79ed5f}},'log':_0x228f('0x6')});}; \ No newline at end of file +var _0x36ee=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction'];(function(_0x41c737,_0x104568){var _0x1902cb=function(_0x88ab59){while(--_0x88ab59){_0x41c737['push'](_0x41c737['shift']());}};_0x1902cb(++_0x104568);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var client=require('../client');exports['update']=function(_0x34e33c,_0x521ff3){return client[_0xe36e('0x0')](_0xe36e('0x1'),{'body':_0x521ff3,'options':{'where':{'id':_0x34e33c}},'log':_0xe36e('0x2')});};exports[_0xe36e('0x3')]=function(_0x567a84,_0x1118af){return client[_0xe36e('0x0')](_0xe36e('0x4'),{'body':_0x1118af,'options':{'where':{'id':_0x567a84}},'log':_0xe36e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index da31c25..c423709 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 _0xc759=['create','Request','../client'];(function(_0x3eb52b,_0x2d39d8){var _0x178282=function(_0x36468d){while(--_0x36468d){_0x3eb52b['push'](_0x3eb52b['shift']());}};_0x178282(++_0x2d39d8);}(_0xc759,0xc8));var _0x9c75=function(_0x7521d3,_0x25d9c0){_0x7521d3=_0x7521d3-0x0;var _0x125bf3=_0xc759[_0x7521d3];return _0x125bf3;};'use strict';var client=require(_0x9c75('0x0'));exports[_0x9c75('0x1')]=function(_0xf91fc7){return client[_0x9c75('0x2')]('CreateMailMessage',{'body':_0xf91fc7,'log':'createMailMessage'});}; \ No newline at end of file +var _0x0176=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x35ccac,_0x28d874){var _0x217b96=function(_0x28f932){while(--_0x28f932){_0x35ccac['push'](_0x35ccac['shift']());}};_0x217b96(++_0x28d874);}(_0x0176,0x1d0));var _0x6017=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0176[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x6017('0x0'));exports[_0x6017('0x1')]=function(_0x38c6fb){return client[_0x6017('0x2')](_0x6017('0x3'),{'body':_0x38c6fb,'log':_0x6017('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 28e9b9b..5d12434 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 _0xbb25=['Request','GetMailQueue','name','timeout','strategy','User','Agents','online','../client','getMailQueues'];(function(_0x2c7eb4,_0x37591e){var _0xe2dedc=function(_0x2ccac0){while(--_0x2ccac0){_0x2c7eb4['push'](_0x2c7eb4['shift']());}};_0xe2dedc(++_0x37591e);}(_0xbb25,0xc6));var _0x5bb2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb25[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5bb2('0x0'));exports[_0x5bb2('0x1')]=function(){return function(){return client[_0x5bb2('0x2')](_0x5bb2('0x3'),{'options':{'raw':![],'attributes':['id',_0x5bb2('0x4'),_0x5bb2('0x5'),_0x5bb2('0x6')],'include':[{'model':_0x5bb2('0x7'),'as':_0x5bb2('0x8'),'attributes':['id',_0x5bb2('0x4'),_0x5bb2('0x9'),'mailPause']}]},'log':_0x5bb2('0x1')});};}; \ No newline at end of file +var _0x9d30=['getMailQueues','Request','GetMailQueue','timeout','User','online','mailPause','../client'];(function(_0x3e2f2c,_0x3cdf76){var _0x12dbd5=function(_0x360087){while(--_0x360087){_0x3e2f2c['push'](_0x3e2f2c['shift']());}};_0x12dbd5(++_0x3cdf76);}(_0x9d30,0x157));var _0x09d3=function(_0x400d62,_0x582cfe){_0x400d62=_0x400d62-0x0;var _0x2462e7=_0x9d30[_0x400d62];return _0x2462e7;};'use strict';var client=require(_0x09d3('0x0'));exports[_0x09d3('0x1')]=function(){return function(){return client[_0x09d3('0x2')](_0x09d3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x09d3('0x4'),'strategy'],'include':[{'model':_0x09d3('0x5'),'as':'Agents','attributes':['id','name',_0x09d3('0x6'),_0x09d3('0x7')]}]},'log':_0x09d3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 51ec5a9..bab73fa 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 _0xdc9e=['DESC','UpdateMailQueueReport','../client','create','CreateMailQueueReport','update'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xdc9e,0x6e));var _0xedc9=function(_0x4b1891,_0x44270d){_0x4b1891=_0x4b1891-0x0;var _0xd5c98d=_0xdc9e[_0x4b1891];return _0xd5c98d;};'use strict';var client=require(_0xedc9('0x0'));exports[_0xedc9('0x1')]=function(_0x12dc33){return client['Request']('CreateMailQueueReport',{'body':_0x12dc33,'log':_0xedc9('0x2')});};exports[_0xedc9('0x3')]=function(_0x13cffc,_0x212fdc){return client['Request']('UpdateMailQueueReport',{'body':_0x212fdc,'options':{'where':{'uniqueid':_0x13cffc},'order':[['id',_0xedc9('0x4')]],'limit':0x1},'log':_0xedc9('0x5')});}; \ No newline at end of file +var _0x5d0e=['create','Request','update','UpdateMailQueueReport'];(function(_0xf85978,_0x52a3a4){var _0x27376e=function(_0x3ce753){while(--_0x3ce753){_0xf85978['push'](_0xf85978['shift']());}};_0x27376e(++_0x52a3a4);}(_0x5d0e,0xac));var _0xe5d0=function(_0x64b5ec,_0xa1d0cd){_0x64b5ec=_0x64b5ec-0x0;var _0x368213=_0x5d0e[_0x64b5ec];return _0x368213;};'use strict';var client=require('../client');exports[_0xe5d0('0x0')]=function(_0x35cd44){return client[_0xe5d0('0x1')]('CreateMailQueueReport',{'body':_0x35cd44,'log':'CreateMailQueueReport'});};exports[_0xe5d0('0x2')]=function(_0x40301e,_0x11f619){return client['Request'](_0xe5d0('0x3'),{'body':_0x11f619,'options':{'where':{'uniqueid':_0x40301e},'order':[['id','DESC']],'limit':0x1},'log':_0xe5d0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9b3ed60..b675a79 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 _0xdc30=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x471736,_0x2ba536){var _0x5a71aa=function(_0xb193b4){while(--_0xb193b4){_0x471736['push'](_0x471736['shift']());}};_0x5a71aa(++_0x2ba536);}(_0xdc30,0x96));var _0x0dc3=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0xdc30[_0x32f6b9];return _0x267d52;};'use strict';var client=require(_0x0dc3('0x0'));exports[_0x0dc3('0x1')]=function(_0x1344e4,_0x58a04b){return client['Request'](_0x0dc3('0x2'),{'body':_0x58a04b,'options':{'where':{'id':_0x1344e4}},'log':_0x0dc3('0x3')});};exports[_0x0dc3('0x4')]=function(_0x53a017,_0x3b5d34){return client[_0x0dc3('0x5')](_0x0dc3('0x6'),{'body':_0x3b5d34,'options':{'where':{'id':_0x53a017}},'log':_0x0dc3('0x7')});}; \ No newline at end of file +var _0x6480=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x4c0b4f,_0x524a21){var _0x3c676b=function(_0x47d9af){while(--_0x47d9af){_0x4c0b4f['push'](_0x4c0b4f['shift']());}};_0x3c676b(++_0x524a21);}(_0x6480,0xf5));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x0648('0x0'));exports[_0x0648('0x1')]=function(_0xc07a3b,_0x17587b){return client[_0x0648('0x2')](_0x0648('0x3'),{'body':_0x17587b,'options':{'where':{'id':_0xc07a3b}},'log':_0x0648('0x4')});};exports[_0x0648('0x5')]=function(_0xe69b45,_0x234373){return client[_0x0648('0x2')](_0x0648('0x6'),{'body':_0x234373,'options':{'where':{'id':_0xe69b45}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0af079b..e216980 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 _0xab14=['../client','create','Request','CreateOpenchannelMessage'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xab14,0x188));var _0x4ab1=function(_0xf375e5,_0x116909){_0xf375e5=_0xf375e5-0x0;var _0x170b68=_0xab14[_0xf375e5];return _0x170b68;};'use strict';var client=require(_0x4ab1('0x0'));exports[_0x4ab1('0x1')]=function(_0x498ea0){return client[_0x4ab1('0x2')](_0x4ab1('0x3'),{'body':_0x498ea0,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x36c2=['create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x18242b,_0x21c135){var _0x20954b=function(_0x20354e){while(--_0x20354e){_0x18242b['push'](_0x18242b['shift']());}};_0x20954b(++_0x21c135);}(_0x36c2,0x129));var _0x236c=function(_0x3ca8c8,_0x43fef1){_0x3ca8c8=_0x3ca8c8-0x0;var _0x549bf7=_0x36c2[_0x3ca8c8];return _0x549bf7;};'use strict';var client=require('../client');exports[_0x236c('0x0')]=function(_0x261fd2){return client['Request'](_0x236c('0x1'),{'body':_0x261fd2,'log':_0x236c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index dd14179..04b764f 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 _0x8684=['online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','name','strategy','User'];(function(_0x1e3236,_0x4388be){var _0xe059e6=function(_0x1b10eb){while(--_0x1b10eb){_0x1e3236['push'](_0x1e3236['shift']());}};_0xe059e6(++_0x4388be);}(_0x8684,0x182));var _0x4868=function(_0x68cf4a,_0x4307b5){_0x68cf4a=_0x68cf4a-0x0;var _0x6f0a44=_0x8684[_0x68cf4a];return _0x6f0a44;};'use strict';var client=require(_0x4868('0x0'));exports[_0x4868('0x1')]=function(){return function(){return client['Request'](_0x4868('0x2'),{'options':{'raw':![],'attributes':['id',_0x4868('0x3'),'timeout',_0x4868('0x4')],'include':[{'model':_0x4868('0x5'),'as':'Agents','attributes':['id',_0x4868('0x3'),_0x4868('0x6'),_0x4868('0x7')]}]},'log':_0x4868('0x1')});};}; \ No newline at end of file +var _0xa6e2=['GetOpenchannelQueue','name','timeout','Agents','openchannelPause','../client','getOpenchannelQueues'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xa6e2,0x132));var _0x2a6e=function(_0x5c35ef,_0x13f19a){_0x5c35ef=_0x5c35ef-0x0;var _0xb2b68a=_0xa6e2[_0x5c35ef];return _0xb2b68a;};'use strict';var client=require(_0x2a6e('0x0'));exports[_0x2a6e('0x1')]=function(){return function(){return client['Request'](_0x2a6e('0x2'),{'options':{'raw':![],'attributes':['id',_0x2a6e('0x3'),_0x2a6e('0x4'),'strategy'],'include':[{'model':'User','as':_0x2a6e('0x5'),'attributes':['id','name','online',_0x2a6e('0x6')]}]},'log':_0x2a6e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6102c5b..809b7eb 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 _0x8d41=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x3eddc1,_0x2b4888){var _0x148804=function(_0x2c4229){while(--_0x2c4229){_0x3eddc1['push'](_0x3eddc1['shift']());}};_0x148804(++_0x2b4888);}(_0x8d41,0x12c));var _0x18d4=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0x8d41[_0x295a3d];return _0x23a732;};'use strict';var client=require(_0x18d4('0x0'));exports[_0x18d4('0x1')]=function(_0x227724){return client[_0x18d4('0x2')](_0x18d4('0x3'),{'body':_0x227724,'log':_0x18d4('0x3')});};exports[_0x18d4('0x4')]=function(_0x64f09d,_0x20c75){return client[_0x18d4('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x20c75,'options':{'where':{'uniqueid':_0x64f09d},'order':[['id','DESC']],'limit':0x1},'log':_0x18d4('0x5')});}; \ No newline at end of file +var _0xa2c6=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x51584f,_0x3601a8){var _0x4dde0e=function(_0x3dd485){while(--_0x3dd485){_0x51584f['push'](_0x51584f['shift']());}};_0x4dde0e(++_0x3601a8);}(_0xa2c6,0xf2));var _0x6a2c=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xa2c6[_0x2d89ce];return _0x3fad10;};'use strict';var client=require(_0x6a2c('0x0'));exports[_0x6a2c('0x1')]=function(_0x722221){return client[_0x6a2c('0x2')](_0x6a2c('0x3'),{'body':_0x722221,'log':'CreateOpenchannelQueueReport'});};exports[_0x6a2c('0x4')]=function(_0x1fba05,_0xff1717){return client[_0x6a2c('0x2')]('UpdateOpenchannelQueueReport',{'body':_0xff1717,'options':{'where':{'uniqueid':_0x1fba05},'order':[['id',_0x6a2c('0x5')]],'limit':0x1},'log':_0x6a2c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index af50377..945203f 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 _0x49fe=['UpdateSmsInteraction','addTags','Request','addTagsToSmsInteraction','../client','update'];(function(_0x1c38d8,_0x41d501){var _0x87c24d=function(_0x311cbf){while(--_0x311cbf){_0x1c38d8['push'](_0x1c38d8['shift']());}};_0x87c24d(++_0x41d501);}(_0x49fe,0x100));var _0xe49f=function(_0x6b1892,_0x4dc916){_0x6b1892=_0x6b1892-0x0;var _0x3457a9=_0x49fe[_0x6b1892];return _0x3457a9;};'use strict';var client=require(_0xe49f('0x0'));exports[_0xe49f('0x1')]=function(_0x1c1270,_0x56f3e0){return client['Request'](_0xe49f('0x2'),{'body':_0x56f3e0,'options':{'where':{'id':_0x1c1270}},'log':'updateSmsInteraction'});};exports[_0xe49f('0x3')]=function(_0x199a0b,_0xb0e197){return client[_0xe49f('0x4')]('AddTagsToSmsInteraction',{'body':_0xb0e197,'options':{'where':{'id':_0x199a0b}},'log':_0xe49f('0x5')});}; \ No newline at end of file +var _0x8ebf=['Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8ebf,0x15c));var _0xf8eb=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x8ebf[_0xc67528];return _0x38e26d;};'use strict';var client=require(_0xf8eb('0x0'));exports[_0xf8eb('0x1')]=function(_0x226e1d,_0x4e42d0){return client[_0xf8eb('0x2')](_0xf8eb('0x3'),{'body':_0x4e42d0,'options':{'where':{'id':_0x226e1d}},'log':'updateSmsInteraction'});};exports[_0xf8eb('0x4')]=function(_0x59d6a7,_0x41e20b){return client['Request'](_0xf8eb('0x5'),{'body':_0x41e20b,'options':{'where':{'id':_0x59d6a7}},'log':_0xf8eb('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 62efea6..b162b73 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 _0x96d4=['createSmsMessage','../client','CreateSmsMessage'];(function(_0x3628fc,_0x364fb3){var _0x5a75ad=function(_0x281b39){while(--_0x281b39){_0x3628fc['push'](_0x3628fc['shift']());}};_0x5a75ad(++_0x364fb3);}(_0x96d4,0x13c));var _0x496d=function(_0x645adc,_0x23ab56){_0x645adc=_0x645adc-0x0;var _0x253557=_0x96d4[_0x645adc];return _0x253557;};'use strict';var client=require(_0x496d('0x0'));exports['create']=function(_0xd63416){return client['Request'](_0x496d('0x1'),{'body':_0xd63416,'log':_0x496d('0x2')});}; \ No newline at end of file +var _0xad4b=['Request','CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x808de4,_0x1d8a9e){var _0x2a3922=function(_0x24ce97){while(--_0x24ce97){_0x808de4['push'](_0x808de4['shift']());}};_0x2a3922(++_0x1d8a9e);}(_0xad4b,0x189));var _0xbad4=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xad4b[_0x54d4a8];return _0x3b321b;};'use strict';var client=require(_0xbad4('0x0'));exports[_0xbad4('0x1')]=function(_0x3a4c93){return client[_0xbad4('0x2')](_0xbad4('0x3'),{'body':_0x3a4c93,'log':_0xbad4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 18750ca..0ed0c4b 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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x1a3d63,_0x35e6b3){var _0x56c649=function(_0x3a4bbb){while(--_0x3a4bbb){_0x1a3d63['push'](_0x1a3d63['shift']());}};_0x56c649(++_0x35e6b3);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x10197a,_0x5a8a9c){var _0x7f6acc=function(_0x14ec7d){while(--_0x14ec7d){_0x10197a['push'](_0x10197a['shift']());}};_0x7f6acc(++_0x5a8a9c);}(_0x70e0,0x17b));var _0x070e=function(_0x42dcf3,_0x389005){_0x42dcf3=_0x42dcf3-0x0;var _0x5dbd3e=_0x70e0[_0x42dcf3];return _0x5dbd3e;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 3ffe247..494280d 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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x1a6aa2,_0x3ab96d){var _0x29f9ce=function(_0x495d9b){while(--_0x495d9b){_0x1a6aa2['push'](_0x1a6aa2['shift']());}};_0x29f9ce(++_0x3ab96d);}(_0x34e8,0x12c));var _0x834e=function(_0x3bd57e,_0x2899d5){_0x3bd57e=_0x3bd57e-0x0;var _0x2fa50c=_0x34e8[_0x3bd57e];return _0x2fa50c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x426a24,_0xb03c4f){var _0x425bf1=function(_0x43c9c4){while(--_0x43c9c4){_0x426a24['push'](_0x426a24['shift']());}};_0x425bf1(++_0xb03c4f);}(_0x34e8,0x12c));var _0x834e=function(_0x277478,_0x120fd2){_0x277478=_0x277478-0x0;var _0xc7af01=_0x34e8[_0x277478];return _0xc7af01;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2b8a0fa..1ec76fb 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(_0x19fb09,_0x229c68){var _0x5b6b1b=function(_0x5af8e0){while(--_0x5af8e0){_0x19fb09['push'](_0x19fb09['shift']());}};_0x5b6b1b(++_0x229c68);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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(_0x18c1d7,_0x34df55){var _0x3f4964=function(_0x2738a1){while(--_0x2738a1){_0x18c1d7['push'](_0x18c1d7['shift']());}};_0x3f4964(++_0x34df55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 0ca6db0..310b6a5 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 _0xa899=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0xa899,0x155));var _0x9a89=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xa899[_0x35da42];return _0x370035;};'use strict';var client=require(_0x9a89('0x0'));exports[_0x9a89('0x1')]=function(_0x2134fe,_0x4fb381){return client[_0x9a89('0x2')](_0x9a89('0x3'),{'body':_0x4fb381,'options':{'where':{'id':_0x2134fe}},'log':_0x9a89('0x4')});};exports[_0x9a89('0x5')]=function(_0x405c47,_0x15c431){return client[_0x9a89('0x2')](_0x9a89('0x6'),{'body':_0x15c431,'options':{'where':{'id':_0x405c47}},'log':_0x9a89('0x7')});}; \ No newline at end of file +var _0x044a=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x3f1b84,_0x392e82){var _0x251ef2=function(_0x409789){while(--_0x409789){_0x3f1b84['push'](_0x3f1b84['shift']());}};_0x251ef2(++_0x392e82);}(_0x044a,0x173));var _0xa044=function(_0x189e9,_0x53e3f9){_0x189e9=_0x189e9-0x0;var _0x5df4cd=_0x044a[_0x189e9];return _0x5df4cd;};'use strict';var client=require(_0xa044('0x0'));exports[_0xa044('0x1')]=function(_0x2ea3b8,_0x1aafce){return client[_0xa044('0x2')](_0xa044('0x3'),{'body':_0x1aafce,'options':{'where':{'id':_0x2ea3b8}},'log':_0xa044('0x4')});};exports[_0xa044('0x5')]=function(_0x25ed77,_0x116358){return client['Request'](_0xa044('0x6'),{'body':_0x116358,'options':{'where':{'id':_0x25ed77}},'log':_0xa044('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 4a66933..db14480 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 _0x9cd7=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x505751,_0x55493a){var _0x5583bd=function(_0xa78ccf){while(--_0xa78ccf){_0x505751['push'](_0x505751['shift']());}};_0x5583bd(++_0x55493a);}(_0x9cd7,0x1c0));var _0x79cd=function(_0x542149,_0x5df180){_0x542149=_0x542149-0x0;var _0x36df57=_0x9cd7[_0x542149];return _0x36df57;};'use strict';var client=require(_0x79cd('0x0'));exports[_0x79cd('0x1')]=function(_0x533722){return client[_0x79cd('0x2')](_0x79cd('0x3'),{'body':_0x533722,'log':_0x79cd('0x4')});}; \ No newline at end of file +var _0x7b2f=['../client','create','Request','createWhatsappMessage'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x7b2f,0x1c8));var _0xf7b2=function(_0x399f3f,_0x4bd01b){_0x399f3f=_0x399f3f-0x0;var _0xb636e2=_0x7b2f[_0x399f3f];return _0xb636e2;};'use strict';var client=require(_0xf7b2('0x0'));exports[_0xf7b2('0x1')]=function(_0x298842){return client[_0xf7b2('0x2')]('CreateWhatsappMessage',{'body':_0x298842,'log':_0xf7b2('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index c6cbd82..edccceb 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 _0xe7ad=['../client','Request','GetWhatsappQueue','name','strategy','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x2aa52d,_0x37b74e){var _0x10cd5a=function(_0x32b04b){while(--_0x32b04b){_0x2aa52d['push'](_0x2aa52d['shift']());}};_0x10cd5a(++_0x37b74e);}(_0xe7ad,0x120));var _0xde7a=function(_0x1290dd,_0x4dd4b0){_0x1290dd=_0x1290dd-0x0;var _0x288282=_0xe7ad[_0x1290dd];return _0x288282;};'use strict';var client=require(_0xde7a('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xde7a('0x1')](_0xde7a('0x2'),{'options':{'raw':![],'attributes':['id',_0xde7a('0x3'),'timeout',_0xde7a('0x4')],'include':[{'model':'User','as':_0xde7a('0x5'),'attributes':['id',_0xde7a('0x3'),_0xde7a('0x6'),_0xde7a('0x7')]}]},'log':_0xde7a('0x8')});};}; \ No newline at end of file +var _0x1491=['Agents','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','timeout','User'];(function(_0x26031,_0x4fb1b5){var _0x288e2c=function(_0x19188d){while(--_0x19188d){_0x26031['push'](_0x26031['shift']());}};_0x288e2c(++_0x4fb1b5);}(_0x1491,0xbb));var _0x1149=function(_0x186f36,_0x24e2e8){_0x186f36=_0x186f36-0x0;var _0x4f6c44=_0x1491[_0x186f36];return _0x4f6c44;};'use strict';var client=require('../client');exports[_0x1149('0x0')]=function(){return function(){return client[_0x1149('0x1')](_0x1149('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1149('0x3'),'strategy'],'include':[{'model':_0x1149('0x4'),'as':_0x1149('0x5'),'attributes':['id','name',_0x1149('0x6'),_0x1149('0x7')]}]},'log':_0x1149('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 6ce38da..b661a3a 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 _0xade4=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x16e42d,_0x4b61a6){var _0x4d86a6=function(_0x2a5c21){while(--_0x2a5c21){_0x16e42d['push'](_0x16e42d['shift']());}};_0x4d86a6(++_0x4b61a6);}(_0xade4,0xc0));var _0x4ade=function(_0x583456,_0x10f8cc){_0x583456=_0x583456-0x0;var _0x542be5=_0xade4[_0x583456];return _0x542be5;};'use strict';var client=require(_0x4ade('0x0'));exports[_0x4ade('0x1')]=function(_0x502f27){return client[_0x4ade('0x2')]('CreateWhatsappQueueReport',{'body':_0x502f27,'log':_0x4ade('0x3')});};exports[_0x4ade('0x4')]=function(_0x53d79d,_0x3e4d54){return client[_0x4ade('0x2')](_0x4ade('0x5'),{'body':_0x3e4d54,'options':{'where':{'uniqueid':_0x53d79d},'order':[['id',_0x4ade('0x6')]],'limit':0x1},'log':_0x4ade('0x5')});}; \ No newline at end of file +var _0xcc15=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0xae0004,_0x5c06e2){var _0x50de90=function(_0x2925c4){while(--_0x2925c4){_0xae0004['push'](_0xae0004['shift']());}};_0x50de90(++_0x5c06e2);}(_0xcc15,0x1bd));var _0x5cc1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xcc15[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x5cc1('0x0'));exports[_0x5cc1('0x1')]=function(_0x230cc4){return client[_0x5cc1('0x2')]('CreateWhatsappQueueReport',{'body':_0x230cc4,'log':_0x5cc1('0x3')});};exports[_0x5cc1('0x4')]=function(_0x3f3073,_0xba38ce){return client[_0x5cc1('0x2')](_0x5cc1('0x5'),{'body':_0xba38ce,'options':{'where':{'uniqueid':_0x3f3073},'order':[['id',_0x5cc1('0x6')]],'limit':0x1},'log':_0x5cc1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index cd9073d..1bdb9a6 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 _0xe02e=['close','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','lodash','util','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe02e,0x1f0));var _0xee02=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xe02e[_0x2a6809];return _0x11c371;};'use strict';var schema=require('validate');var _=require(_0xee02('0x0'));var util=require(_0xee02('0x1'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0xee02('0x2'));var strategy=require(_0xee02('0x3'));var queue=schema({'name':{'type':_0xee02('0x4'),'required':!![],'message':_0xee02('0x5')},'timeout':{'type':_0xee02('0x6'),'message':_0xee02('0x7')}});function writeLog(_0x402aac,_0x36309a,_0x5e9bf1){return logger[_0xee02('0x8')](util[_0xee02('0x9')](_0xee02('0xa'),_0x402aac,_0x36309a[_0xee02('0xb')],_0x5e9bf1));}function handleFindAgent(_0x406f12){return function(_0x4d7b9c){return _0x4d7b9c[_0xee02('0xb')][_0xee02('0xc')]()===_0x406f12['toLowerCase']();};}exports[_0xee02('0xd')]=function(_0x59b56e,_0x2297bf,_0x1eb312,_0x23833b){return function(_0x225dbb){try{var _0x5ab718={'name':_0x2297bf[0x0],'timeout':_0x2297bf[0x1]};var _0xbfd7f4=queue[_0xee02('0xe')](_0x5ab718,{'typecast':!![]});if(_0xbfd7f4[_0xee02('0xf')]){logger['error']('[%s][AGENT]\x20%s',_0x59b56e,_[_0xee02('0x10')](_0xbfd7f4,_0xee02('0x11'))[_0xee02('0x12')](',\x20'));_0x225dbb[_0xee02('0x13')]();}else{var _0x2de6e0=_[_0xee02('0x14')](_0x1eb312[_0xee02('0x15')],handleFindAgent(_0x5ab718[_0xee02('0xb')]));if(_0x2de6e0){var _0x488c38=(_0x5ab718[_0xee02('0x16')]||0xa)*0x3e8;var _0xfafcde,_0x3b5db9;var _0x3bb150=seqqueue[_0xee02('0x17')](_0x488c38);_0x3bb150['id']=_0x59b56e;_0x3bb150[_0xee02('0x18')]=_0x488c38;_0x3bb150['channel']=_0x23833b[_0xee02('0x19')];writeLog(_0x59b56e,_0x2de6e0,util[_0xee02('0x9')]('START:%s',_0x488c38));_0x1eb312[_0xee02('0x1a')][_0x59b56e]['on'](_0xee02('0x1b'),function(){logger[_0xee02('0x8')](_0xee02('0x1c'),_0x59b56e);clearTimeout(_0x3b5db9);_0x3b5db9=undefined;_0x3bb150[_0xee02('0x1d')]();if(_0x1eb312[_0xee02('0x1a')][_0x59b56e]){delete _0x1eb312[_0xee02('0x1a')][_0x59b56e];}_0x225dbb['stop']();});_0x1eb312[_0xee02('0x1a')][_0x59b56e]['on']('complete',function(){if(_0x1eb312[_0xee02('0x1a')][_0x59b56e]){delete _0x1eb312['rules'][_0x59b56e];}});_0x3b5db9=setTimeout(function(){logger[_0xee02('0x8')](_0xee02('0x1e'),_0x59b56e);clearTimeout(_0x3b5db9);_0x3bb150['close']();_0x225dbb[_0xee02('0x1f')]();},_0x488c38);strategy[_0xee02('0x20')](_0x3bb150,_0x2de6e0,_0x1eb312,_0x23833b);}else{logger['error'](_0xee02('0x21'),_0x59b56e,_0x5ab718[_0xee02('0xb')]);_0x225dbb['stop']();}}}catch(_0x5177ec){console[_0xee02('0x22')](_0x5177ec);logger['error']('[%s][QUEUE]\x20%s',_0x59b56e,_0x5177ec['stack']);_0x225dbb[_0xee02('0x13')]();}};}; \ No newline at end of file +var _0x7061=['length','error','[%s][AGENT]\x20%s','message','join','stop','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','format','name','toLowerCase','consequence'];(function(_0x4a3570,_0x169197){var _0x235ca8=function(_0x4d167b){while(--_0x4d167b){_0x4a3570['push'](_0x4a3570['shift']());}};_0x235ca8(++_0x169197);}(_0x7061,0x12e));var _0x1706=function(_0x1d8544,_0x17daff){_0x1d8544=_0x1d8544-0x0;var _0x249990=_0x7061[_0x1d8544];return _0x249990;};'use strict';var schema=require(_0x1706('0x0'));var _=require(_0x1706('0x1'));var util=require('util');var seqqueue=require(_0x1706('0x2'));var logger=require(_0x1706('0x3'))(_0x1706('0x4'));var strategy=require(_0x1706('0x5'));var queue=schema({'name':{'type':_0x1706('0x6'),'required':!![],'message':_0x1706('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x252f5d,_0x3423e3,_0x1b00ad){return logger[_0x1706('0x8')](util[_0x1706('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x252f5d,_0x3423e3['name'],_0x1b00ad));}function handleFindAgent(_0x2a45c8){return function(_0x1ae141){return _0x1ae141[_0x1706('0xa')][_0x1706('0xb')]()===_0x2a45c8['toLowerCase']();};}exports[_0x1706('0xc')]=function(_0x50f22b,_0x1bd777,_0x32d604,_0x43cc6e){return function(_0x39116d){try{var _0x4c0e2a={'name':_0x1bd777[0x0],'timeout':_0x1bd777[0x1]};var _0x20099e=queue[_0x1706('0x0')](_0x4c0e2a,{'typecast':!![]});if(_0x20099e[_0x1706('0xd')]){logger[_0x1706('0xe')](_0x1706('0xf'),_0x50f22b,_['map'](_0x20099e,_0x1706('0x10'))[_0x1706('0x11')](',\x20'));_0x39116d[_0x1706('0x12')]();}else{var _0x286204=_['find'](_0x32d604[_0x1706('0x13')],handleFindAgent(_0x4c0e2a[_0x1706('0xa')]));if(_0x286204){var _0x359c24=(_0x4c0e2a[_0x1706('0x14')]||0xa)*0x3e8;var _0x4ea3c9,_0x1abedb;var _0x58d980=seqqueue[_0x1706('0x15')](_0x359c24);_0x58d980['id']=_0x50f22b;_0x58d980[_0x1706('0x16')]=_0x359c24;_0x58d980[_0x1706('0x17')]=_0x43cc6e['channel'];writeLog(_0x50f22b,_0x286204,util[_0x1706('0x9')](_0x1706('0x18'),_0x359c24));_0x32d604[_0x1706('0x19')][_0x50f22b]['on'](_0x1706('0x1a'),function(){logger[_0x1706('0x8')](_0x1706('0x1b'),_0x50f22b);clearTimeout(_0x1abedb);_0x1abedb=undefined;_0x58d980[_0x1706('0x1c')]();if(_0x32d604['rules'][_0x50f22b]){delete _0x32d604[_0x1706('0x19')][_0x50f22b];}_0x39116d['stop']();});_0x32d604[_0x1706('0x19')][_0x50f22b]['on'](_0x1706('0x1d'),function(){if(_0x32d604[_0x1706('0x19')][_0x50f22b]){delete _0x32d604['rules'][_0x50f22b];}});_0x1abedb=setTimeout(function(){logger['info'](_0x1706('0x1e'),_0x50f22b);clearTimeout(_0x1abedb);_0x58d980[_0x1706('0x1c')]();_0x39116d['next']();},_0x359c24);strategy[_0x1706('0x1f')](_0x58d980,_0x286204,_0x32d604,_0x43cc6e);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x50f22b,_0x4c0e2a[_0x1706('0xa')]);_0x39116d[_0x1706('0x12')]();}}}catch(_0x44adcf){console[_0x1706('0x20')](_0x44adcf);logger['error'](_0x1706('0x21'),_0x50f22b,_0x44adcf[_0x1706('0x22')]);_0x39116d[_0x1706('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 576bdfb..0cd75cb 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 _0xd04f=['info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','then','body','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','message','amazonlex','providerName','providerResponse','create','dialogState','Failed','next','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId'];(function(_0x493f6b,_0x3e669c){var _0x135c6e=function(_0x29a6ef){while(--_0x29a6ef){_0x493f6b['push'](_0x493f6b['shift']());}};_0x135c6e(++_0x3e669c);}(_0xd04f,0xf6));var _0xfd04=function(_0x1b1092,_0x17dcd6){_0x1b1092=_0x1b1092-0x0;var _0xdf6e43=_0xd04f[_0x1b1092];return _0xdf6e43;};'use strict';var _=require('lodash');var moment=require(_0xfd04('0x0'));var AWS=require(_0xfd04('0x1'));var utils=require(_0xfd04('0x2'));var logger=require('../../../../config/logger')(_0xfd04('0x3'));var rpc={'chatMessage':require(_0xfd04('0x4')),'openchannelMessage':require(_0xfd04('0x5')),'mailMessage':require(_0xfd04('0x6')),'smsMessage':require(_0xfd04('0x7')),'faxMessage':require(_0xfd04('0x8')),'whatsappMessage':require(_0xfd04('0x9'))};exports[_0xfd04('0xa')]=function(_0x2281c9,_0x150df6){return function(_0xd5de08){try{if(!_[_0xfd04('0xb')](this[_0xfd04('0xc')][_0xfd04('0xd')])){logger[_0xfd04('0xe')](_0xfd04('0xf'),_0x2281c9,_0xfd04('0x10'));return _0xd5de08['next']();}var _0x3eac26={'ContactId':this[_0xfd04('0x11')]['id'],'sentAt':moment()['format'](_0xfd04('0x12')),'direction':_0xfd04('0x13')};if(this[_0xfd04('0x14')]===_0xfd04('0x15')||this['channel']===_0xfd04('0x16')){_0x3eac26['phone']=this[_0xfd04('0xc')]['phone'];}var _0x3ce471=this[_0xfd04('0x14')];if(_0x3ce471==='chat'){_0x3eac26[_0xfd04('0x17')]=this[_0xfd04('0x18')]['id'];}else{_0x3eac26[_['upperFirst'](_0x3ce471)+_0xfd04('0x19')]=this[_0xfd04('0x18')]['id'];}_0x3eac26[_[_0xfd04('0x1a')](_0x3ce471)+_0xfd04('0x1b')]=this[_0xfd04('0xc')]['id'];if(this['interaction'][_0xfd04('0x1c')]){var _0x33e2fc=_0x150df6[0x4];if(!_[_0xfd04('0x1d')](_0x33e2fc)){_0x3eac26['body']=utils[_0xfd04('0x1e')](_0x33e2fc,this);return rpc[_0x3ce471+_0xfd04('0x1f')]['create'](_0x3eac26)[_0xfd04('0x20')](function(_0x58fe4a){logger[_0xfd04('0xe')](_0xfd04('0xf'),_0x2281c9,_0x3eac26[_0xfd04('0x21')]);})[_0xfd04('0x22')](function(_0x1bcf89){logger[_0xfd04('0x23')](_0xfd04('0xf'),_0x2281c9,JSON[_0xfd04('0x24')](_0x1bcf89));})['finally'](function(){logger[_0xfd04('0xe')](_0xfd04('0x25'),_0x2281c9);_0xd5de08[_0xfd04('0x26')]();});}else{logger[_0xfd04('0xe')](_0xfd04('0x27'),_0x2281c9);_0xd5de08[_0xfd04('0x26')]();}}else{var _0x17ebbc=this;var _0x39ff0f=new AWS[(_0xfd04('0x28'))]({'accessKeyId':_0x150df6[0x0],'secretAccessKey':_0x150df6[0x1],'region':_0x150df6[0x2]});var _0x3869d4={'botAlias':_0xfd04('0x29'),'botName':_0x150df6[0x3],'inputText':this['message'][_0xfd04('0x21')],'userId':this[_0xfd04('0x14')]+':'+this[_0xfd04('0xc')]['id'][_0xfd04('0x2a')]()};_0x39ff0f[_0xfd04('0x2b')](_0x3869d4,function(_0x533725,_0x947328){if(_0x533725){logger[_0xfd04('0x23')](_0xfd04('0xf'),_0x2281c9,_0x533725[_0xfd04('0x2c')]);_0xd5de08['next']();}else if(_0x947328&&_0x947328[_0xfd04('0x2c')]){_0x17ebbc['body'][_0xfd04('0x2d')]=_0x947328;_0x3eac26['body']=_0x947328[_0xfd04('0x2c')];_0x3eac26[_0xfd04('0x2e')]=_0xfd04('0x2d');_0x3eac26[_0xfd04('0x2f')]=JSON[_0xfd04('0x24')](_0x947328);return rpc[_0x3ce471+'Message'][_0xfd04('0x30')](_0x3eac26)[_0xfd04('0x20')](function(_0xfb67fb){logger['info'](_0xfd04('0xf'),_0x2281c9,_0x3eac26[_0xfd04('0x21')]);if(_0x947328[_0xfd04('0x31')]==_0xfd04('0x32')){_0xd5de08['next']();}else{_0xd5de08[_0xfd04('0x26')]();}})[_0xfd04('0x22')](function(_0x29bbdf){logger[_0xfd04('0x23')]('[%s][AMAZONLEX]\x20%s',_0x2281c9,JSON[_0xfd04('0x24')](_0x29bbdf));_0xd5de08[_0xfd04('0x33')]();});}else{_0xd5de08['next']();}});}}catch(_0x57cfd1){logger[_0xfd04('0x23')](_0xfd04('0xf'),_0x2281c9,JSON['stringify'](_0x57cfd1));_0xd5de08['stop']();}};}; \ No newline at end of file +var _0x1241=['whatsapp','phone','chat','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','catch','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','next','amazonlex','providerName','providerResponse','then','dialogState','Failed','error','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x1241,0x174));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1124('0x0'));var moment=require(_0x1124('0x1'));var AWS=require(_0x1124('0x2'));var utils=require('./utils');var logger=require(_0x1124('0x3'))(_0x1124('0x4'));var rpc={'chatMessage':require(_0x1124('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1124('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1124('0x7')),'whatsappMessage':require(_0x1124('0x8'))};exports[_0x1124('0x9')]=function(_0x43133d,_0x49ebac){return function(_0x7e7d89){try{if(!_[_0x1124('0xa')](this[_0x1124('0xb')]['UserId'])){logger[_0x1124('0xc')](_0x1124('0xd'),_0x43133d,_0x1124('0xe'));return _0x7e7d89['next']();}var _0x34713e={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1124('0xf')](_0x1124('0x10')),'direction':_0x1124('0x11')};if(this[_0x1124('0x12')]===_0x1124('0x13')||this[_0x1124('0x12')]===_0x1124('0x14')){_0x34713e[_0x1124('0x15')]=this[_0x1124('0xb')]['phone'];}var _0x1e8048=this[_0x1124('0x12')];if(_0x1e8048===_0x1124('0x16')){_0x34713e['ChatWebsiteId']=this[_0x1124('0x17')]['id'];}else{_0x34713e[_[_0x1124('0x18')](_0x1e8048)+'AccountId']=this[_0x1124('0x17')]['id'];}_0x34713e[_[_0x1124('0x18')](_0x1e8048)+_0x1124('0x19')]=this['interaction']['id'];if(this['interaction'][_0x1124('0x1a')]){var _0x23dcf0=_0x49ebac[0x4];if(!_['isEmpty'](_0x23dcf0)){_0x34713e[_0x1124('0x1b')]=utils[_0x1124('0x1c')](_0x23dcf0,this);return rpc[_0x1e8048+_0x1124('0x1d')]['create'](_0x34713e)['then'](function(_0x50c411){logger[_0x1124('0xc')]('[%s][AMAZONLEX]\x20%s',_0x43133d,_0x34713e[_0x1124('0x1b')]);})[_0x1124('0x1e')](function(_0xfddd8a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x43133d,JSON[_0x1124('0x1f')](_0xfddd8a));})[_0x1124('0x20')](function(){logger[_0x1124('0xc')](_0x1124('0x21'),_0x43133d);_0x7e7d89[_0x1124('0x22')]();});}else{logger[_0x1124('0xc')](_0x1124('0x23'),_0x43133d);_0x7e7d89[_0x1124('0x22')]();}}else{var _0x17c20c=this;var _0x19e89a=new AWS[(_0x1124('0x24'))]({'accessKeyId':_0x49ebac[0x0],'secretAccessKey':_0x49ebac[0x1],'region':_0x49ebac[0x2]});var _0x3ae331={'botAlias':_0x1124('0x25'),'botName':_0x49ebac[0x3],'inputText':this[_0x1124('0x26')][_0x1124('0x1b')],'userId':this['channel']+':'+this[_0x1124('0xb')]['id'][_0x1124('0x27')]()};_0x19e89a[_0x1124('0x28')](_0x3ae331,function(_0x2f67f0,_0x4da2aa){if(_0x2f67f0){logger['error'](_0x1124('0xd'),_0x43133d,_0x2f67f0[_0x1124('0x26')]);_0x7e7d89[_0x1124('0x29')]();}else if(_0x4da2aa&&_0x4da2aa[_0x1124('0x26')]){_0x17c20c['body'][_0x1124('0x2a')]=_0x4da2aa;_0x34713e[_0x1124('0x1b')]=_0x4da2aa[_0x1124('0x26')];_0x34713e[_0x1124('0x2b')]=_0x1124('0x2a');_0x34713e[_0x1124('0x2c')]=JSON[_0x1124('0x1f')](_0x4da2aa);return rpc[_0x1e8048+_0x1124('0x1d')]['create'](_0x34713e)[_0x1124('0x2d')](function(_0x2bde20){logger[_0x1124('0xc')](_0x1124('0xd'),_0x43133d,_0x34713e['body']);if(_0x4da2aa[_0x1124('0x2e')]==_0x1124('0x2f')){_0x7e7d89[_0x1124('0x29')]();}else{_0x7e7d89[_0x1124('0x22')]();}})[_0x1124('0x1e')](function(_0x10f880){logger[_0x1124('0x30')](_0x1124('0xd'),_0x43133d,JSON[_0x1124('0x1f')](_0x10f880));_0x7e7d89[_0x1124('0x29')]();});}else{_0x7e7d89[_0x1124('0x29')]();}});}}catch(_0x53ac7d){logger[_0x1124('0x30')](_0x1124('0xd'),_0x43133d,JSON[_0x1124('0x1f')](_0x53ac7d));_0x7e7d89[_0x1124('0x22')]();}};}; \ 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 a236f04..0441ae8 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 _0x6f0f=['../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','mail','body','info','[%s][AUTOREPLY]\x20%s','next','isNil','interaction','created','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','message','from','channel','phone','read','subject','startsWith','Re:','Re:\x20','chat','upperFirst','InteractionId','html','','replace','','headers','All','auto_reply','account','smtpOptions','then','messageId','Message','create','stringify','catch','error','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x57aef9,_0x291385){var _0x1bc180=function(_0x3c4800){while(--_0x3c4800){_0x57aef9['push'](_0x57aef9['shift']());}};_0x1bc180(++_0x291385);}(_0x6f0f,0x1b1));var _0xf6f0=function(_0xc01d2,_0x29f146){_0xc01d2=_0xc01d2-0x0;var _0x17f297=_0x6f0f[_0xc01d2];return _0x17f297;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0xf6f0('0x0'));var logger=require(_0xf6f0('0x1'))(_0xf6f0('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf6f0('0x3')),'mailMessage':require(_0xf6f0('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf6f0('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xf6f0('0x6')),'openchannelInteraction':require(_0xf6f0('0x7')),'mailInteraction':require(_0xf6f0('0x8')),'smsInteraction':require(_0xf6f0('0x9')),'faxInteraction':require(_0xf6f0('0xa')),'whatsappInteraction':require(_0xf6f0('0xb'))};var mailRpc=require('../../mailRpc');exports[_0xf6f0('0xc')]=function(_0xc044c3,_0x1b6bce,_0x533b69,_0x50d038){return function(_0x392269){try{var _0x24a9ef=this['channel'];if(_0x24a9ef===_0xf6f0('0xd')&&_0x50d038[_0xf6f0('0xe')]['isAutoreply']){logger[_0xf6f0('0xf')](_0xf6f0('0x10'),_0xc044c3,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x392269[_0xf6f0('0x11')]();}if(_0x1b6bce[0x0]==='1'&&(_[_0xf6f0('0x12')](this[_0xf6f0('0x13')][_0xf6f0('0x14')])||!this['interaction']['created'])){logger[_0xf6f0('0xf')]('[%s][AUTOREPLY]\x20%s',_0xc044c3,'Autoreply\x20already\x20sent');return _0x392269[_0xf6f0('0x11')]();}if(_0x1b6bce[0x0]==='2'&&this[_0xf6f0('0x13')]['autoreplyExecuted']){logger[_0xf6f0('0xf')](_0xf6f0('0x15'),_0xc044c3,_0xf6f0('0x16'));return _0x392269[_0xf6f0('0x11')]();}var _0x544209={'ContactId':this[_0xf6f0('0x17')]['id'],'sentAt':moment()[_0xf6f0('0x18')](_0xf6f0('0x19')),'direction':'out'};if(this['channel']===_0xf6f0('0xd')){_0x544209[_0xf6f0('0xe')]=utils['getMustacheRender'](_0x1b6bce[0x2],this);}else{_0x544209['body']=utils['getMustacheRender'](_0x1b6bce[0x1],this);}if(this[_0xf6f0('0x1a')]){_0x544209['to']=this[_0xf6f0('0x1a')][_0xf6f0('0x1b')]||'';if(this[_0xf6f0('0x1c')]==='mail'&&_0x1b6bce[0x1]==='1'){_0x544209['cc']=this[_0xf6f0('0x1a')]['cc']||'';}_0x544209[_0xf6f0('0x1b')]=this['message']['to']||'';_0x544209[_0xf6f0('0x1d')]=this[_0xf6f0('0x1a')][_0xf6f0('0x1d')]||'';_0x544209[_0xf6f0('0x1e')]=!![];if(this[_0xf6f0('0x1a')]['subject']){_0x544209['subject']='';_0x544209[_0xf6f0('0x1f')]+=_[_0xf6f0('0x20')](this[_0xf6f0('0x1a')]['subject'],_0xf6f0('0x21'))?'':_0xf6f0('0x22');_0x544209[_0xf6f0('0x1f')]+=this[_0xf6f0('0x1a')]['subject'];}}if(this['channel']===_0xf6f0('0x23')){_0x544209['ChatWebsiteId']=this['account']['id'];}else{_0x544209[_[_0xf6f0('0x24')](this[_0xf6f0('0x1c')])+'AccountId']=this['account']['id'];}_0x544209[_[_0xf6f0('0x24')](this['channel'])+_0xf6f0('0x25')]=this[_0xf6f0('0x13')]['id'];var _0xcb71fc=this['interaction'];if(rpc[this[_0xf6f0('0x1c')]+'Message']){if(this[_0xf6f0('0x1c')]==='mail'){_0x544209['inReplyTo']=this[_0xf6f0('0x1a')]['messageId'];_0x544209[_0xf6f0('0x26')]=_0xf6f0('0x27')+_[_0xf6f0('0x28')](_0x544209[_0xf6f0('0xe')],_0xf6f0('0x29'),_0xf6f0('0x2a'))+_0xf6f0('0x2b');_0x544209[_0xf6f0('0x2c')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xf6f0('0x2d'),'Precedence':_0xf6f0('0x2e')};return mailRpc['sendMailMessage'](this[_0xf6f0('0x2f')][_0xf6f0('0x30')],_0x544209)[_0xf6f0('0x31')](function(_0x2c3402){logger[_0xf6f0('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0xc044c3);_0x544209['messageId']=_0x2c3402[_0xf6f0('0x1a')][_0xf6f0('0x32')];return rpc[_0x24a9ef+_0xf6f0('0x33')][_0xf6f0('0x34')](_0x544209);})[_0xf6f0('0x31')](function(_0x281fae){logger['info'](_0xf6f0('0x10'),_0xc044c3,JSON[_0xf6f0('0x35')](_0x281fae));})[_0xf6f0('0x36')](function(_0x3ef106){logger[_0xf6f0('0x37')]('[RPC][%s][AUTOREPLY]\x20%s',_0xc044c3,JSON[_0xf6f0('0x35')](_0x3ef106));})[_0xf6f0('0x38')](function(){Promise[_0xf6f0('0x39')]()[_0xf6f0('0x31')](function(){if(_0x1b6bce[0x0]!=='2'||_0xcb71fc[_0xf6f0('0x3a')])return;return rpc[_0x24a9ef+_0xf6f0('0x3b')][_0xf6f0('0x3c')](_0xcb71fc['id'],{'autoreplyExecuted':!![]})[_0xf6f0('0x31')](function(_0x2115c5){logger[_0xf6f0('0xf')](_0xf6f0('0x15'),_0xc044c3,JSON[_0xf6f0('0x35')](_0x2115c5));})[_0xf6f0('0x36')](function(_0x5ef76f){logger[_0xf6f0('0x37')](_0xf6f0('0x3d'),_0xc044c3,JSON[_0xf6f0('0x35')](_0x5ef76f));});})[_0xf6f0('0x31')](function(){_0x392269[_0xf6f0('0x11')]();});});}else{return rpc[this[_0xf6f0('0x1c')]+_0xf6f0('0x33')][_0xf6f0('0x34')](_0x544209)[_0xf6f0('0x31')](function(){logger[_0xf6f0('0xf')](_0xf6f0('0x10'),_0xc044c3,_0x544209[_0xf6f0('0xe')]);})[_0xf6f0('0x36')](function(_0x2d9c45){logger['error']('[%s][AUTOREPLY]\x20%s',_0xc044c3,JSON[_0xf6f0('0x35')](_0x2d9c45));})['finally'](function(){Promise[_0xf6f0('0x39')]()[_0xf6f0('0x31')](function(){if(_0x1b6bce[0x0]!=='2'||_0xcb71fc[_0xf6f0('0x3a')])return;return rpc[_0x24a9ef+_0xf6f0('0x3b')][_0xf6f0('0x3c')](_0xcb71fc['id'],{'autoreplyExecuted':!![]})[_0xf6f0('0x31')](function(_0x932e30){logger[_0xf6f0('0xf')](_0xf6f0('0x15'),_0xc044c3,JSON['stringify'](_0x932e30));})[_0xf6f0('0x36')](function(_0x236fdd){logger[_0xf6f0('0x37')](_0xf6f0('0x3d'),_0xc044c3,JSON['stringify'](_0x236fdd));});})[_0xf6f0('0x31')](function(){_0x392269['next']();});});}}}catch(_0x46ee5e){logger[_0xf6f0('0x37')](_0xf6f0('0x10'),_0xc044c3,JSON[_0xf6f0('0x35')](_0x46ee5e));_0x392269[_0xf6f0('0x3e')]();}};}; \ No newline at end of file +var _0x3531=['sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','then','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','','headers','auto-replied','All','auto_reply'];(function(_0x55d3b8,_0x2e026e){var _0x1d9710=function(_0x22dfe8){while(--_0x22dfe8){_0x55d3b8['push'](_0x55d3b8['shift']());}};_0x1d9710(++_0x2e026e);}(_0x3531,0x1c6));var _0x1353=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3531[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x1353('0x0'));var moment=require(_0x1353('0x1'));var utils=require(_0x1353('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x1353('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1353('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1353('0x5')),'whatsappMessage':require(_0x1353('0x6')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1353('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x1353('0x8')),'faxInteraction':require(_0x1353('0x9')),'whatsappInteraction':require(_0x1353('0xa'))};var mailRpc=require('../../mailRpc');exports[_0x1353('0xb')]=function(_0x4c7d08,_0x118293,_0x34e31c,_0x13c308){return function(_0x52c24e){try{var _0x48248c=this[_0x1353('0xc')];if(_0x48248c==='mail'&&_0x13c308[_0x1353('0xd')][_0x1353('0xe')]){logger[_0x1353('0xf')]('[%s][AUTOREPLY]\x20%s',_0x4c7d08,_0x1353('0x10'));return _0x52c24e['next']();}if(_0x118293[0x0]==='1'&&(_['isNil'](this[_0x1353('0x11')][_0x1353('0x12')])||!this[_0x1353('0x11')]['created'])){logger[_0x1353('0xf')](_0x1353('0x13'),_0x4c7d08,_0x1353('0x14'));return _0x52c24e['next']();}if(_0x118293[0x0]==='2'&&this[_0x1353('0x11')][_0x1353('0x15')]){logger[_0x1353('0xf')](_0x1353('0x16'),_0x4c7d08,_0x1353('0x17'));return _0x52c24e[_0x1353('0x18')]();}var _0x21240d={'ContactId':this['contact']['id'],'sentAt':moment()[_0x1353('0x19')](_0x1353('0x1a')),'direction':_0x1353('0x1b')};if(this[_0x1353('0xc')]===_0x1353('0x1c')){_0x21240d[_0x1353('0xd')]=utils[_0x1353('0x1d')](_0x118293[0x2],this);}else{_0x21240d[_0x1353('0xd')]=utils['getMustacheRender'](_0x118293[0x1],this);}if(this[_0x1353('0x1e')]){_0x21240d['to']=this['message'][_0x1353('0x1f')]||'';if(this[_0x1353('0xc')]===_0x1353('0x1c')&&_0x118293[0x1]==='1'){_0x21240d['cc']=this[_0x1353('0x1e')]['cc']||'';}_0x21240d[_0x1353('0x1f')]=this['message']['to']||'';_0x21240d[_0x1353('0x20')]=this[_0x1353('0x1e')][_0x1353('0x20')]||'';_0x21240d[_0x1353('0x21')]=!![];if(this[_0x1353('0x1e')][_0x1353('0x22')]){_0x21240d[_0x1353('0x22')]='';_0x21240d['subject']+=_['startsWith'](this[_0x1353('0x1e')][_0x1353('0x22')],_0x1353('0x23'))?'':_0x1353('0x24');_0x21240d[_0x1353('0x22')]+=this['message']['subject'];}}if(this['channel']==='chat'){_0x21240d[_0x1353('0x25')]=this[_0x1353('0x26')]['id'];}else{_0x21240d[_[_0x1353('0x27')](this['channel'])+_0x1353('0x28')]=this[_0x1353('0x26')]['id'];}_0x21240d[_[_0x1353('0x27')](this[_0x1353('0xc')])+_0x1353('0x29')]=this[_0x1353('0x11')]['id'];var _0x51b88c=this[_0x1353('0x11')];if(rpc[this[_0x1353('0xc')]+_0x1353('0x2a')]){if(this[_0x1353('0xc')]===_0x1353('0x1c')){_0x21240d[_0x1353('0x2b')]=this[_0x1353('0x1e')]['messageId'];_0x21240d[_0x1353('0x2c')]=_0x1353('0x2d')+_['replace'](_0x21240d[_0x1353('0xd')],'';_0x21240d[_0x1353('0x2e')]={'Auto-Submitted':_0x1353('0x2f'),'X-Auto-Response-Suppress':_0x1353('0x30'),'Precedence':_0x1353('0x31')};return mailRpc[_0x1353('0x32')](this[_0x1353('0x26')][_0x1353('0x33')],_0x21240d)['then'](function(_0x68903c){logger['info'](_0x1353('0x34'),_0x4c7d08);_0x21240d['messageId']=_0x68903c[_0x1353('0x1e')]['messageId'];return rpc[_0x48248c+_0x1353('0x2a')]['create'](_0x21240d);})[_0x1353('0x35')](function(_0x7d9aac){logger[_0x1353('0xf')](_0x1353('0x13'),_0x4c7d08,JSON['stringify'](_0x7d9aac));})['catch'](function(_0x2474c4){logger[_0x1353('0x36')](_0x1353('0x37'),_0x4c7d08,JSON[_0x1353('0x38')](_0x2474c4));})[_0x1353('0x39')](function(){Promise[_0x1353('0x3a')]()[_0x1353('0x35')](function(){if(_0x118293[0x0]!=='2'||_0x51b88c[_0x1353('0x15')])return;return rpc[_0x48248c+_0x1353('0x3b')][_0x1353('0x3c')](_0x51b88c['id'],{'autoreplyExecuted':!![]})[_0x1353('0x35')](function(_0x12b38f){logger['info'](_0x1353('0x16'),_0x4c7d08,JSON['stringify'](_0x12b38f));})['catch'](function(_0x14853d){logger[_0x1353('0x36')](_0x1353('0x3d'),_0x4c7d08,JSON[_0x1353('0x38')](_0x14853d));});})[_0x1353('0x35')](function(){_0x52c24e[_0x1353('0x18')]();});});}else{return rpc[this['channel']+_0x1353('0x2a')]['create'](_0x21240d)['then'](function(){logger['info'](_0x1353('0x13'),_0x4c7d08,_0x21240d['body']);})[_0x1353('0x3e')](function(_0x575ccd){logger[_0x1353('0x36')](_0x1353('0x13'),_0x4c7d08,JSON[_0x1353('0x38')](_0x575ccd));})[_0x1353('0x39')](function(){Promise[_0x1353('0x3a')]()[_0x1353('0x35')](function(){if(_0x118293[0x0]!=='2'||_0x51b88c[_0x1353('0x15')])return;return rpc[_0x48248c+'Interaction'][_0x1353('0x3c')](_0x51b88c['id'],{'autoreplyExecuted':!![]})[_0x1353('0x35')](function(_0x37159d){logger[_0x1353('0xf')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4c7d08,JSON['stringify'](_0x37159d));})[_0x1353('0x3e')](function(_0x106dee){logger[_0x1353('0x36')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4c7d08,JSON[_0x1353('0x38')](_0x106dee));});})[_0x1353('0x35')](function(){_0x52c24e[_0x1353('0x18')]();});});}}}catch(_0x1684e6){logger['error'](_0x1353('0x13'),_0x4c7d08,JSON['stringify'](_0x1684e6));_0x52c24e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 3456213..8dedcff 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd30c=['info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','then','interaction','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction'];(function(_0x2a0ac2,_0x5dbd53){var _0x374316=function(_0x1bf39f){while(--_0x1bf39f){_0x2a0ac2['push'](_0x2a0ac2['shift']());}};_0x374316(++_0x5dbd53);}(_0xd30c,0x67));var _0xcd30=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd30c[_0x27af45];return _0x18df21;};'use strict';var moment=require('moment');var logger=require(_0xcd30('0x0'))('routing');var rpc={'chatInteraction':require(_0xcd30('0x1')),'openchannelInteraction':require(_0xcd30('0x2')),'smsInteraction':require(_0xcd30('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xcd30('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x5a191d,_0xeb8d09,_0x3b2d85,_0x30faed){return function(_0x3d1cdd){try{logger[_0xcd30('0x5')](_0xcd30('0x6'),_0x5a191d,_0xeb8d09[0x0]);var _0x419798={'closed':0x1,'closedAt':moment()[_0xcd30('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xcd30('0x8'),'disposition':_0xeb8d09[0x0]};if(rpc[_0x30faed[_0xcd30('0x9')]+_0xcd30('0xa')]){rpc[_0x30faed['channel']+_0xcd30('0xa')]['update'](_0x30faed['interaction']['id'],_0x419798)[_0xcd30('0xb')](function(_0x491e27){logger[_0xcd30('0x5')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5a191d,_0x30faed[_0xcd30('0xc')]['id']);})['catch'](function(_0x17d101){logger[_0xcd30('0xd')](_0xcd30('0xe'),_0x5a191d,JSON[_0xcd30('0xf')](_0x17d101));})[_0xcd30('0x10')](function(){_0x3d1cdd[_0xcd30('0x11')]();});}}catch(_0xe0f54e){logger[_0xcd30('0xd')](_0xcd30('0xe'),_0x5a191d,JSON[_0xcd30('0xf')](_0xe0f54e));_0x3d1cdd[_0xcd30('0x11')]();}};}; \ No newline at end of file +var _0x31c2=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel'];(function(_0x11fe8a,_0x173612){var _0x54bfe5=function(_0x44a1a3){while(--_0x44a1a3){_0x11fe8a['push'](_0x11fe8a['shift']());}};_0x54bfe5(++_0x173612);}(_0x31c2,0x17f));var _0x231c=function(_0x36554d,_0x9de0ad){_0x36554d=_0x36554d-0x0;var _0x23a72e=_0x31c2[_0x36554d];return _0x23a72e;};'use strict';var moment=require(_0x231c('0x0'));var logger=require('../../../../config/logger')(_0x231c('0x1'));var rpc={'chatInteraction':require(_0x231c('0x2')),'openchannelInteraction':require(_0x231c('0x3')),'smsInteraction':require(_0x231c('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x231c('0x5'))};exports[_0x231c('0x6')]=function(_0x84181,_0x27c409,_0x43dc8d,_0x3323b1){return function(_0x2c1394){try{logger[_0x231c('0x7')](_0x231c('0x8'),_0x84181,_0x27c409[0x0]);var _0x10af99={'closed':0x1,'closedAt':moment()[_0x231c('0x9')](_0x231c('0xa')),'closeReason':_0x231c('0xb'),'disposition':_0x27c409[0x0]};if(rpc[_0x3323b1[_0x231c('0xc')]+'Interaction']){rpc[_0x3323b1[_0x231c('0xc')]+'Interaction'][_0x231c('0xd')](_0x3323b1[_0x231c('0xe')]['id'],_0x10af99)[_0x231c('0xf')](function(_0x4e9358){logger[_0x231c('0x7')](_0x231c('0x10'),_0x84181,_0x3323b1['interaction']['id']);})['catch'](function(_0x2c01c4){logger[_0x231c('0x11')](_0x231c('0x12'),_0x84181,JSON[_0x231c('0x13')](_0x2c01c4));})[_0x231c('0x14')](function(){_0x2c1394[_0x231c('0x15')]();});}}catch(_0x4a6dfa){logger[_0x231c('0x11')](_0x231c('0x12'),_0x84181,JSON[_0x231c('0x13')](_0x4a6dfa));_0x2c1394[_0x231c('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index af171d2..ea097ef 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c75=['speech','providerName','providerResponse','metadata','endConversation','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','format','out','channel','sms','phone','chat','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','info','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','dialogflow','result','fulfillment'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x1c75,0xce));var _0x51c7=function(_0x2cf7dd,_0x26172a){_0x2cf7dd=_0x2cf7dd-0x0;var _0x20450a=_0x1c75[_0x2cf7dd];return _0x20450a;};'use strict';var _=require(_0x51c7('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0x51c7('0x1'));var logger=require(_0x51c7('0x2'))(_0x51c7('0x3'));var rpc={'chatMessage':require(_0x51c7('0x4')),'openchannelMessage':require(_0x51c7('0x5')),'mailMessage':require(_0x51c7('0x6')),'smsMessage':require(_0x51c7('0x7')),'faxMessage':require(_0x51c7('0x8')),'whatsappMessage':require(_0x51c7('0x9'))};exports[_0x51c7('0xa')]=function(_0x283d6b,_0x56b9a0){return function(_0x1feb9a){try{if(!_[_0x51c7('0xb')](this[_0x51c7('0xc')][_0x51c7('0xd')])){logger['info'](_0x51c7('0xe'),_0x283d6b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1feb9a[_0x51c7('0xf')]();}var _0x5692a7={'ContactId':this[_0x51c7('0x10')]['id'],'sentAt':moment()[_0x51c7('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x51c7('0x12')};if(this[_0x51c7('0x13')]===_0x51c7('0x14')||this['channel']==='whatsapp'){_0x5692a7['phone']=this[_0x51c7('0xc')][_0x51c7('0x15')];}var _0x224052=this['channel'];if(_0x224052===_0x51c7('0x16')){_0x5692a7['ChatWebsiteId']=this[_0x51c7('0x17')]['id'];}else{_0x5692a7[_['upperFirst'](_0x224052)+_0x51c7('0x18')]=this['account']['id'];}_0x5692a7[_[_0x51c7('0x19')](_0x224052)+_0x51c7('0x1a')]=this[_0x51c7('0xc')]['id'];if(this[_0x51c7('0xc')]['created']){var _0x177e14=_0x56b9a0[0x2];if(!_[_0x51c7('0x1b')](_0x177e14)){_0x5692a7[_0x51c7('0x1c')]=utils[_0x51c7('0x1d')](_0x177e14,this);return rpc[_0x224052+_0x51c7('0x1e')][_0x51c7('0x1f')](_0x5692a7)['then'](function(_0xe4cf49){logger[_0x51c7('0x20')](_0x51c7('0xe'),_0x283d6b,_0x5692a7['body']);})[_0x51c7('0x21')](function(_0x3ea444){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x283d6b,JSON[_0x51c7('0x22')](_0x3ea444));})[_0x51c7('0x23')](function(){logger[_0x51c7('0x20')](_0x51c7('0x24'),_0x283d6b);_0x1feb9a[_0x51c7('0x25')]();});}else{logger[_0x51c7('0x20')](_0x51c7('0x26'),_0x283d6b);_0x1feb9a['stop']();}}else{var _0x3dbfbc=this;var _0x11c83d=apiai(_0x56b9a0[0x0],{'language':_0x56b9a0[0x1]||'en'});return _0x11c83d['textRequest'](this[_0x51c7('0x27')]['body'],{'sessionId':md5(this[_0x51c7('0xc')]['id'])})[_0x51c7('0x28')](function(_0x414de0){_0x3dbfbc['body'][_0x51c7('0x29')]=_0x414de0;_0x5692a7[_0x51c7('0x1c')]=_0x414de0[_0x51c7('0x2a')][_0x51c7('0x2b')][_0x51c7('0x2c')];_0x5692a7[_0x51c7('0x2d')]='dialogflow';_0x5692a7[_0x51c7('0x2e')]=JSON['stringify'](_0x414de0);return rpc[_0x224052+_0x51c7('0x1e')][_0x51c7('0x1f')](_0x5692a7)[_0x51c7('0x28')](function(_0x1c29fb){logger[_0x51c7('0x20')](_0x51c7('0xe'),_0x283d6b,_0x5692a7[_0x51c7('0x1c')]);if(_0x414de0[_0x51c7('0x2a')][_0x51c7('0x2f')][_0x51c7('0x30')]){_0x1feb9a[_0x51c7('0xf')]();}else{_0x1feb9a[_0x51c7('0x25')]();}})['catch'](function(_0xc1688f){logger[_0x51c7('0x31')](_0x51c7('0xe'),_0x283d6b,JSON[_0x51c7('0x22')](_0xc1688f));_0x1feb9a['next']();});})[_0x51c7('0x21')](function(_0x5e90bc){logger[_0x51c7('0x31')](_0x51c7('0xe'),_0x283d6b,_0x5e90bc[_0x51c7('0x27')]);_0x1feb9a['next']();});}}catch(_0xa7ff09){logger['error'](_0x51c7('0xe'),_0x283d6b,JSON[_0x51c7('0x22')](_0xa7ff09));_0x1feb9a[_0x51c7('0x25')]();}};}; \ No newline at end of file +var _0x297f=['stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','Message','create','endConversation','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','ChatWebsiteId','upperFirst','AccountId','created','body','getMustacheRender','then','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x4ed60b,_0x7d0852){var _0x53a2d2=function(_0x57019e){while(--_0x57019e){_0x4ed60b['push'](_0x4ed60b['shift']());}};_0x53a2d2(++_0x7d0852);}(_0x297f,0x1f0));var _0xf297=function(_0x58235b,_0xb2ad23){_0x58235b=_0x58235b-0x0;var _0x390dde=_0x297f[_0x58235b];return _0x390dde;};'use strict';var _=require(_0xf297('0x0'));var moment=require(_0xf297('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xf297('0x2'));var logger=require(_0xf297('0x3'))(_0xf297('0x4'));var rpc={'chatMessage':require(_0xf297('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf297('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf297('0x7')),'whatsappMessage':require(_0xf297('0x8'))};exports[_0xf297('0x9')]=function(_0x4bb956,_0x4a3862){return function(_0x302320){try{if(!_[_0xf297('0xa')](this[_0xf297('0xb')]['UserId'])){logger[_0xf297('0xc')](_0xf297('0xd'),_0x4bb956,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x302320[_0xf297('0xe')]();}var _0x481d0d={'ContactId':this[_0xf297('0xf')]['id'],'sentAt':moment()[_0xf297('0x10')](_0xf297('0x11')),'direction':'out'};if(this[_0xf297('0x12')]==='sms'||this[_0xf297('0x12')]==='whatsapp'){_0x481d0d['phone']=this[_0xf297('0xb')][_0xf297('0x13')];}var _0x1f0459=this[_0xf297('0x12')];if(_0x1f0459===_0xf297('0x14')){_0x481d0d[_0xf297('0x15')]=this['account']['id'];}else{_0x481d0d[_[_0xf297('0x16')](_0x1f0459)+_0xf297('0x17')]=this['account']['id'];}_0x481d0d[_[_0xf297('0x16')](_0x1f0459)+'InteractionId']=this[_0xf297('0xb')]['id'];if(this[_0xf297('0xb')][_0xf297('0x18')]){var _0x4cc9a4=_0x4a3862[0x2];if(!_['isEmpty'](_0x4cc9a4)){_0x481d0d[_0xf297('0x19')]=utils[_0xf297('0x1a')](_0x4cc9a4,this);return rpc[_0x1f0459+'Message']['create'](_0x481d0d)[_0xf297('0x1b')](function(_0x1932df){logger['info'](_0xf297('0xd'),_0x4bb956,_0x481d0d[_0xf297('0x19')]);})[_0xf297('0x1c')](function(_0x480c10){logger[_0xf297('0x1d')](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x480c10));})['finally'](function(){logger[_0xf297('0xc')](_0xf297('0x1f'),_0x4bb956);_0x302320[_0xf297('0x20')]();});}else{logger['info'](_0xf297('0x21'),_0x4bb956);_0x302320[_0xf297('0x20')]();}}else{var _0x4023a3=this;var _0x4cf7f7=apiai(_0x4a3862[0x0],{'language':_0x4a3862[0x1]||'en'});return _0x4cf7f7[_0xf297('0x22')](this[_0xf297('0x23')][_0xf297('0x19')],{'sessionId':md5(this[_0xf297('0xb')]['id'])})['then'](function(_0x27265c){_0x4023a3['body'][_0xf297('0x24')]=_0x27265c;_0x481d0d[_0xf297('0x19')]=_0x27265c[_0xf297('0x25')][_0xf297('0x26')][_0xf297('0x27')];_0x481d0d['providerName']='dialogflow';_0x481d0d[_0xf297('0x28')]=JSON[_0xf297('0x1e')](_0x27265c);return rpc[_0x1f0459+_0xf297('0x29')][_0xf297('0x2a')](_0x481d0d)[_0xf297('0x1b')](function(_0x456573){logger['info'](_0xf297('0xd'),_0x4bb956,_0x481d0d['body']);if(_0x27265c['result']['metadata'][_0xf297('0x2b')]){_0x302320[_0xf297('0xe')]();}else{_0x302320[_0xf297('0x20')]();}})[_0xf297('0x1c')](function(_0x2cdfc6){logger['error'](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x2cdfc6));_0x302320['next']();});})[_0xf297('0x1c')](function(_0x38a4f6){logger[_0xf297('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x4bb956,_0x38a4f6[_0xf297('0x23')]);_0x302320[_0xf297('0xe')]();});}}catch(_0x2be167){logger['error'](_0xf297('0xd'),_0x4bb956,JSON[_0xf297('0x1e')](_0x2be167));_0x302320['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 2a5e936..634ee36 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1618=['routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','[%s][DIALOGFLOWV2]\x20%s','catch','error','consequence','isNil','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','create','info','stringify','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','then','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','length','fulfillmentText','push','all','stack','lodash','dialogflow','moment','bluebird'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1618,0x178));var _0x8161=function(_0x395ab5,_0x154d73){_0x395ab5=_0x395ab5-0x0;var _0x12553a=_0x1618[_0x395ab5];return _0x12553a;};'use strict';var _=require(_0x8161('0x0'));var dialogflow=require(_0x8161('0x1'));var md5=require('md5');var moment=require(_0x8161('0x2'));var Promise=require(_0x8161('0x3'));var logger=require('../../../../config/logger')(_0x8161('0x4'));var utils=require(_0x8161('0x5'));var rpc={'chatMessage':require(_0x8161('0x6')),'openchannelMessage':require(_0x8161('0x7')),'mailMessage':require(_0x8161('0x8')),'smsMessage':require(_0x8161('0x9')),'faxMessage':require(_0x8161('0xa')),'whatsappMessage':require(_0x8161('0xb'))};function createMessage(_0x10a67a,_0x3b1947,_0xed7bc4,_0x181012){return new Promise(function(_0xc2351a,_0x3f015d){var _0x33b57b=_['clone'](_0xed7bc4);_0x33b57b[_0x8161('0xc')]=_0x181012;return rpc[_0x3b1947+_0x8161('0xd')]['create'](_0x33b57b)['then'](function(){logger['info'](_0x8161('0xe'),_0x10a67a,_0x33b57b['body']);_0xc2351a();})[_0x8161('0xf')](function(_0x197a9e){logger[_0x8161('0x10')](_0x8161('0xe'),_0x10a67a,JSON['stringify'](_0x197a9e));_0x3f015d(_0x197a9e);});});}exports[_0x8161('0x11')]=function(_0xe31075,_0x3785cd){return function(_0x4b0581){try{if(!_[_0x8161('0x12')](this['interaction'][_0x8161('0x13')])){logger['info'](_0x8161('0xe'),_0xe31075,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4b0581[_0x8161('0x14')]();}var _0x101764={'ContactId':this[_0x8161('0x15')]['id'],'sentAt':moment()[_0x8161('0x16')](_0x8161('0x17')),'direction':_0x8161('0x18')};if(this[_0x8161('0x19')]===_0x8161('0x1a')||this[_0x8161('0x19')]===_0x8161('0x1b')){_0x101764[_0x8161('0x1c')]=this[_0x8161('0x1d')]['phone'];}var _0x1fa34e=this['channel'];if(_0x1fa34e===_0x8161('0x1e')){_0x101764[_0x8161('0x1f')]=this[_0x8161('0x20')]['id'];}else{_0x101764[_[_0x8161('0x21')](_0x1fa34e)+_0x8161('0x22')]=this['account']['id'];}_0x101764[_[_0x8161('0x21')](_0x1fa34e)+_0x8161('0x23')]=this[_0x8161('0x1d')]['id'];if(this['interaction']['created']){var _0x2ee34f=_0x3785cd[0x4];if(!_[_0x8161('0x24')](_0x2ee34f)){_0x101764['body']=utils['getMustacheRender'](_0x2ee34f,this);return rpc[_0x1fa34e+'Message'][_0x8161('0x25')](_0x101764)['then'](function(_0x38add1){logger[_0x8161('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0xe31075,_0x101764[_0x8161('0xc')]);})[_0x8161('0xf')](function(_0x302023){logger[_0x8161('0x10')](_0x8161('0xe'),_0xe31075,JSON[_0x8161('0x27')](_0x302023));})['finally'](function(){logger['info'](_0x8161('0x28'),_0xe31075);_0x4b0581[_0x8161('0x29')]();});}else{logger[_0x8161('0x26')](_0x8161('0x2a'),_0xe31075);_0x4b0581[_0x8161('0x29')]();}}else{var _0x1137bc=this;var _0x43449f=_0x3785cd[0x2][_0x8161('0x2b')](/\\n/g,'\x0a');var _0xc04aa2={'credentials':{'private_key':_0x43449f,'client_email':_0x3785cd[0x1]}};var _0x3fbe5d=new dialogflow[(_0x8161('0x2c'))](_0xc04aa2);var _0x491eaa=_0x3fbe5d[_0x8161('0x2d')](_0x3785cd[0x0],md5(_0x1137bc[_0x8161('0x1d')]['id']));var _0x319e0e={'session':_0x491eaa,'queryInput':{'text':{'text':_0x1137bc[_0x8161('0x2e')][_0x8161('0xc')],'languageCode':_0x3785cd[0x3]||'en'}}};return _0x3fbe5d[_0x8161('0x2f')](_0x319e0e)[_0x8161('0x30')](function(_0x2503ae){if(_0x2503ae&&_0x2503ae['length']){_0x1137bc['body']['dialogflowV2']=_0x2503ae;var _0x14f565=_0x2503ae[0x0];var _0x21cfe9=_0x14f565['queryResult']['diagnosticInfo']&&_0x14f565[_0x8161('0x31')][_0x8161('0x32')]['fields']?_0x14f565[_0x8161('0x31')][_0x8161('0x32')][_0x8161('0x33')][_0x8161('0x34')][_0x8161('0x35')]:![];_0x1137bc[_0x8161('0xc')]['DIALOGFLOWV2_ACTION']=_0x14f565[_0x8161('0x31')]['action'];_0x1137bc[_0x8161('0xc')][_0x8161('0x36')]=_0x14f565[_0x8161('0x31')][_0x8161('0x37')];_0x1137bc[_0x8161('0xc')][_0x8161('0x38')]=_0x14f565[_0x8161('0x31')]['diagnosticInfo']&&_0x14f565['queryResult'][_0x8161('0x32')][_0x8161('0x33')]?_0x14f565['queryResult']['diagnosticInfo'][_0x8161('0x33')][_0x8161('0x34')][_0x8161('0x35')]:![];_0x1137bc[_0x8161('0xc')][_0x8161('0x39')]=_0x14f565[_0x8161('0x31')][_0x8161('0x3a')][_0x8161('0x3b')];_0x1137bc[_0x8161('0xc')][_0x8161('0x3c')]=_0x14f565[_0x8161('0x31')][_0x8161('0x3a')]['displayName'];_0x1137bc[_0x8161('0xc')][_0x8161('0x3d')]=_0x14f565[_0x8161('0x31')]['intent'][_0x8161('0x3e')];_0x1137bc[_0x8161('0xc')][_0x8161('0x3f')]=_0x14f565[_0x8161('0x31')][_0x8161('0x40')];_0x1137bc[_0x8161('0xc')]['DIALOGFLOWV2_QUERYTEXT']=_0x14f565[_0x8161('0x31')][_0x8161('0x41')];_0x1137bc['body'][_0x8161('0x42')]=_0x14f565['queryResult'][_0x8161('0x43')];_0x101764[_0x8161('0x44')]=_0x8161('0x45');_0x101764[_0x8161('0x46')]=JSON[_0x8161('0x27')](_0x2503ae);var _0x5ccbd7=[];for(var _0x3399b1=0x0;_0x3399b1<_0x2503ae[_0x8161('0x47')];_0x3399b1++){var _0x2fb70f=_0x2503ae[_0x3399b1];if(_0x2fb70f&&_0x2fb70f['queryResult']&&_0x2fb70f[_0x8161('0x31')][_0x8161('0x48')]){_0x5ccbd7[_0x8161('0x49')](createMessage(_0xe31075,_0x1fa34e,_0x101764,_0x2fb70f[_0x8161('0x31')][_0x8161('0x48')]));}}return Promise[_0x8161('0x4a')](_0x5ccbd7)[_0x8161('0x30')](function(){if(_0x21cfe9){_0x4b0581[_0x8161('0x14')]();}else{_0x4b0581[_0x8161('0x29')]();}})[_0x8161('0xf')](function(_0x50aa52){logger[_0x8161('0x10')](_0x8161('0xe'),_0xe31075,JSON[_0x8161('0x27')](_0x50aa52));_0x4b0581[_0x8161('0x14')]();});}})[_0x8161('0xf')](function(_0x492457){logger[_0x8161('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0xe31075,_0x492457[_0x8161('0x2e')],_0x492457[_0x8161('0x4b')]);_0x4b0581[_0x8161('0x14')]();});}}catch(_0x269b30){logger[_0x8161('0x10')](_0x8161('0xe'),_0xe31075,JSON[_0x8161('0x27')](_0x269b30));_0x4b0581['stop']();}};}; \ No newline at end of file +var _0xdd78=['format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','upperFirst','AccountId','account','created','stringify','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','length','push','fulfillmentText','all','error','message','stack','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x3e1bac,_0x1b9b0b){var _0x3d4708=function(_0x11144b){while(--_0x11144b){_0x3e1bac['push'](_0x3e1bac['shift']());}};_0x3d4708(++_0x1b9b0b);}(_0xdd78,0x103));var _0x8dd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd78[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd7('0x0'));var dialogflow=require(_0x8dd7('0x1'));var md5=require(_0x8dd7('0x2'));var moment=require('moment');var Promise=require(_0x8dd7('0x3'));var logger=require(_0x8dd7('0x4'))(_0x8dd7('0x5'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8dd7('0x6')),'mailMessage':require(_0x8dd7('0x7')),'smsMessage':require(_0x8dd7('0x8')),'faxMessage':require(_0x8dd7('0x9')),'whatsappMessage':require(_0x8dd7('0xa'))};function createMessage(_0x5b47b6,_0x15e53e,_0x23da3e,_0x537a64){return new Promise(function(_0x472098,_0x4520d4){var _0x26582b=_[_0x8dd7('0xb')](_0x23da3e);_0x26582b['body']=_0x537a64;return rpc[_0x15e53e+'Message'][_0x8dd7('0xc')](_0x26582b)[_0x8dd7('0xd')](function(){logger[_0x8dd7('0xe')](_0x8dd7('0xf'),_0x5b47b6,_0x26582b[_0x8dd7('0x10')]);_0x472098();})[_0x8dd7('0x11')](function(_0x4bc1a1){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x5b47b6,JSON['stringify'](_0x4bc1a1));_0x4520d4(_0x4bc1a1);});});}exports[_0x8dd7('0x12')]=function(_0x8f349c,_0x5b4d6b){return function(_0x5b7025){try{if(!_[_0x8dd7('0x13')](this[_0x8dd7('0x14')][_0x8dd7('0x15')])){logger[_0x8dd7('0xe')](_0x8dd7('0xf'),_0x8f349c,_0x8dd7('0x16'));return _0x5b7025[_0x8dd7('0x17')]();}var _0x1998ea={'ContactId':this[_0x8dd7('0x18')]['id'],'sentAt':moment()[_0x8dd7('0x19')](_0x8dd7('0x1a')),'direction':_0x8dd7('0x1b')};if(this[_0x8dd7('0x1c')]==='sms'||this[_0x8dd7('0x1c')]===_0x8dd7('0x1d')){_0x1998ea[_0x8dd7('0x1e')]=this[_0x8dd7('0x14')][_0x8dd7('0x1e')];}var _0x5b2199=this['channel'];if(_0x5b2199===_0x8dd7('0x1f')){_0x1998ea['ChatWebsiteId']=this['account']['id'];}else{_0x1998ea[_[_0x8dd7('0x20')](_0x5b2199)+_0x8dd7('0x21')]=this[_0x8dd7('0x22')]['id'];}_0x1998ea[_[_0x8dd7('0x20')](_0x5b2199)+'InteractionId']=this[_0x8dd7('0x14')]['id'];if(this[_0x8dd7('0x14')][_0x8dd7('0x23')]){var _0xfa2ecf=_0x5b4d6b[0x4];if(!_['isEmpty'](_0xfa2ecf)){_0x1998ea[_0x8dd7('0x10')]=utils['getMustacheRender'](_0xfa2ecf,this);return rpc[_0x5b2199+'Message'][_0x8dd7('0xc')](_0x1998ea)['then'](function(_0x59216c){logger[_0x8dd7('0xe')](_0x8dd7('0xf'),_0x8f349c,_0x1998ea[_0x8dd7('0x10')]);})[_0x8dd7('0x11')](function(_0x53c567){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x8f349c,JSON[_0x8dd7('0x24')](_0x53c567));})['finally'](function(){logger[_0x8dd7('0xe')](_0x8dd7('0x25'),_0x8f349c);_0x5b7025[_0x8dd7('0x26')]();});}else{logger[_0x8dd7('0xe')](_0x8dd7('0x27'),_0x8f349c);_0x5b7025[_0x8dd7('0x26')]();}}else{var _0x49a69e=this;var _0x31e93f=_0x5b4d6b[0x2][_0x8dd7('0x28')](/\\n/g,'\x0a');var _0x10bb4d={'credentials':{'private_key':_0x31e93f,'client_email':_0x5b4d6b[0x1]}};var _0x38e1d4=new dialogflow[(_0x8dd7('0x29'))](_0x10bb4d);var _0x257fec=_0x38e1d4['sessionPath'](_0x5b4d6b[0x0],md5(_0x49a69e[_0x8dd7('0x14')]['id']));var _0x2995b3={'session':_0x257fec,'queryInput':{'text':{'text':_0x49a69e['message']['body'],'languageCode':_0x5b4d6b[0x3]||'en'}}};return _0x38e1d4[_0x8dd7('0x2a')](_0x2995b3)['then'](function(_0x406f35){if(_0x406f35&&_0x406f35['length']){_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x2b')]=_0x406f35;var _0x4b4497=_0x406f35[0x0];var _0x2fbb79=_0x4b4497[_0x8dd7('0x2c')]['diagnosticInfo']&&_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x2d')][_0x8dd7('0x2e')]?_0x4b4497[_0x8dd7('0x2c')]['diagnosticInfo'][_0x8dd7('0x2e')][_0x8dd7('0x2f')][_0x8dd7('0x30')]:![];_0x49a69e['body'][_0x8dd7('0x31')]=_0x4b4497[_0x8dd7('0x2c')]['action'];_0x49a69e['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x32')];_0x49a69e['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x4b4497['queryResult'][_0x8dd7('0x2d')]&&_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x2d')][_0x8dd7('0x2e')]?_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x2d')][_0x8dd7('0x2e')][_0x8dd7('0x2f')][_0x8dd7('0x30')]:![];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x33')]=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x34')][_0x8dd7('0x35')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x36')]=_0x4b4497[_0x8dd7('0x2c')]['intent'][_0x8dd7('0x37')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x38')]=_0x4b4497[_0x8dd7('0x2c')]['intent'][_0x8dd7('0x39')];_0x49a69e[_0x8dd7('0x10')]['DIALOGFLOWV2_LANGUAGECODE']=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x3a')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x3b')]=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x3c')];_0x49a69e[_0x8dd7('0x10')][_0x8dd7('0x3d')]=_0x4b4497[_0x8dd7('0x2c')][_0x8dd7('0x3e')];_0x1998ea['providerName']=_0x8dd7('0x2b');_0x1998ea[_0x8dd7('0x3f')]=JSON['stringify'](_0x406f35);var _0x3791a1=[];for(var _0x2f7716=0x0;_0x2f7716<_0x406f35[_0x8dd7('0x40')];_0x2f7716++){var _0x5db704=_0x406f35[_0x2f7716];if(_0x5db704&&_0x5db704['queryResult']&&_0x5db704[_0x8dd7('0x2c')]['fulfillmentText']){_0x3791a1[_0x8dd7('0x41')](createMessage(_0x8f349c,_0x5b2199,_0x1998ea,_0x5db704[_0x8dd7('0x2c')][_0x8dd7('0x42')]));}}return Promise[_0x8dd7('0x43')](_0x3791a1)[_0x8dd7('0xd')](function(){if(_0x2fbb79){_0x5b7025['next']();}else{_0x5b7025[_0x8dd7('0x26')]();}})[_0x8dd7('0x11')](function(_0x126285){logger['error'](_0x8dd7('0xf'),_0x8f349c,JSON[_0x8dd7('0x24')](_0x126285));_0x5b7025[_0x8dd7('0x17')]();});}})[_0x8dd7('0x11')](function(_0x2f962c){logger[_0x8dd7('0x44')](_0x8dd7('0xf'),_0x8f349c,_0x2f962c[_0x8dd7('0x45')],_0x2f962c[_0x8dd7('0x46')]);_0x5b7025['next']();});}}catch(_0x2152f3){logger[_0x8dd7('0x44')](_0x8dd7('0xf'),_0x8f349c,JSON[_0x8dd7('0x24')](_0x2152f3));_0x5b7025[_0x8dd7('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 700722e..65bc034 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59e5=['stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join'];(function(_0x29ebe1,_0x1d717f){var _0x57ebce=function(_0x3acea4){while(--_0x3acea4){_0x29ebe1['push'](_0x29ebe1['shift']());}};_0x57ebce(++_0x1d717f);}(_0x59e5,0x7f));var _0x559e=function(_0x1ed85a,_0x919457){_0x1ed85a=_0x1ed85a-0x0;var _0x67ca12=_0x59e5[_0x1ed85a];return _0x67ca12;};'use strict';var schema=require(_0x559e('0x0'));var _=require(_0x559e('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0x559e('0x2'))(_0x559e('0x3'));var gotoif=schema({'condition':{'type':_0x559e('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x559e('0x5'),'message':_0x559e('0x6')},'priorityFalse':{'type':_0x559e('0x5'),'message':_0x559e('0x7')}});exports[_0x559e('0x8')]=function(_0x3cae24,_0x2caab4){return function(_0x48d347){try{var _0x5b082f={'condition':htmlToText[_0x559e('0x9')](utils[_0x559e('0xa')](_0x2caab4[0x0],this),{'wordwrap':![]})[_0x559e('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2caab4[0x1],'priorityFalse':_0x2caab4[0x2]};var _0x52416b=gotoif[_0x559e('0x0')](_0x5b082f,{'typecast':!![]});if(_0x52416b[_0x559e('0xc')]){logger[_0x559e('0xd')](_0x559e('0xe'),_0x3cae24,_[_0x559e('0xf')](_0x52416b,_0x559e('0x10'))[_0x559e('0x11')](',\x20'));_0x48d347[_0x559e('0x12')]();}else{try{var _0x41cf6c=eval('('+_0x5b082f[_0x559e('0x13')]+')');var _0x65b59e=_0x41cf6c?_0x5b082f[_0x559e('0x14')]:_0x5b082f[_0x559e('0x15')];logger[_0x559e('0x16')](_0x559e('0x17'),_0x3cae24,_0x5b082f['condition'],_0x41cf6c,_0x65b59e||'next');if(_0x65b59e){var _0x2d6163=_[_0x559e('0x18')](_0x48d347[_0x559e('0x19')](),{'p':_0x65b59e});if(_0x2d6163>=0x0){logger[_0x559e('0x16')](_0x559e('0x1a'),_0x3cae24,_0x65b59e||_0x559e('0x1b'),_0x2d6163);_0x48d347[_0x559e('0x1b')](_0x2d6163);}else{logger[_0x559e('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3cae24,_0x65b59e||_0x559e('0x1b'));_0x48d347['stop']();}}else{_0x48d347[_0x559e('0x1b')]();}}catch(_0x1e0d76){logger[_0x559e('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3cae24,_0x1e0d76[_0x559e('0x10')]);_0x48d347[_0x559e('0x12')]();}}}catch(_0x4f53e9){logger['error'](_0x559e('0xe'),_0x3cae24,JSON[_0x559e('0x1c')](_0x4f53e9));_0x48d347[_0x559e('0x12')]();}};}; \ No newline at end of file +var _0xb2c6=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','priorityFalse'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0xb2c6,0xf1));var _0x6b2c=function(_0x1b178a,_0x1ed6ac){_0x1b178a=_0x1b178a-0x0;var _0x3d7a5a=_0xb2c6[_0x1b178a];return _0x3d7a5a;};'use strict';var schema=require(_0x6b2c('0x0'));var _=require(_0x6b2c('0x1'));var htmlToText=require(_0x6b2c('0x2'));var utils=require(_0x6b2c('0x3'));var logger=require(_0x6b2c('0x4'))(_0x6b2c('0x5'));var gotoif=schema({'condition':{'type':_0x6b2c('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x6b2c('0x7'),'message':_0x6b2c('0x8')},'priorityFalse':{'type':_0x6b2c('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x6b2c('0x9')]=function(_0x56346a,_0x1ff762){return function(_0x29bf97){try{var _0x7149bc={'condition':htmlToText[_0x6b2c('0xa')](utils['getMustacheRender'](_0x1ff762[0x0],this),{'wordwrap':![]})[_0x6b2c('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ff762[0x1],'priorityFalse':_0x1ff762[0x2]};var _0x49601c=gotoif['validate'](_0x7149bc,{'typecast':!![]});if(_0x49601c[_0x6b2c('0xc')]){logger[_0x6b2c('0xd')](_0x6b2c('0xe'),_0x56346a,_[_0x6b2c('0xf')](_0x49601c,_0x6b2c('0x10'))[_0x6b2c('0x11')](',\x20'));_0x29bf97[_0x6b2c('0x12')]();}else{try{var _0x29ea8f=eval('('+_0x7149bc['condition']+')');var _0x2be51e=_0x29ea8f?_0x7149bc['priorityTrue']:_0x7149bc[_0x6b2c('0x13')];logger[_0x6b2c('0x14')](_0x6b2c('0x15'),_0x56346a,_0x7149bc[_0x6b2c('0x16')],_0x29ea8f,_0x2be51e||_0x6b2c('0x17'));if(_0x2be51e){var _0x22e090=_['findIndex'](_0x29bf97[_0x6b2c('0x18')](),{'p':_0x2be51e});if(_0x22e090>=0x0){logger[_0x6b2c('0x14')](_0x6b2c('0x19'),_0x56346a,_0x2be51e||_0x6b2c('0x17'),_0x22e090);_0x29bf97[_0x6b2c('0x17')](_0x22e090);}else{logger[_0x6b2c('0x14')](_0x6b2c('0x1a'),_0x56346a,_0x2be51e||_0x6b2c('0x17'));_0x29bf97['stop']();}}else{_0x29bf97['next']();}}catch(_0x48e115){logger['error'](_0x6b2c('0x1b'),_0x56346a,_0x48e115[_0x6b2c('0x10')]);_0x29bf97['stop']();}}}catch(_0x1544f7){logger[_0x6b2c('0xd')](_0x6b2c('0xe'),_0x56346a,JSON[_0x6b2c('0x1c')](_0x1544f7));_0x29bf97[_0x6b2c('0x12')]();}};}; \ 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 7b49bbf..7cac62d 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 _0x5c3e=['message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','number','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x5ea674,_0x1446e9){var _0x3e82f0=function(_0x62c9b1){while(--_0x62c9b1){_0x5ea674['push'](_0x5ea674['shift']());}};_0x3e82f0(++_0x1446e9);}(_0x5c3e,0x14e));var _0xe5c3=function(_0x3224f5,_0x2829df){_0x3224f5=_0x3224f5-0x0;var _0x2661a5=_0x5c3e[_0x3224f5];return _0x2661a5;};'use strict';var schema=require(_0xe5c3('0x0'));var _=require(_0xe5c3('0x1'));var logger=require('../../../../config/logger')(_0xe5c3('0x2'));var gotop=schema({'priority':{'type':_0xe5c3('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xe5c3('0x4')]=function(_0x3f7247,_0x1f6eb3){return function(_0x183db7){try{var _0x29d4d3={'priority':_0x1f6eb3[0x0]};var _0x566f5f=gotop[_0xe5c3('0x0')](_0x29d4d3,{'typecast':!![]});if(_0x566f5f[_0xe5c3('0x5')]){logger[_0xe5c3('0x6')](_0xe5c3('0x7'),_0x3f7247,_['map'](_0x566f5f,_0xe5c3('0x8'))['join'](',\x20'));_0x183db7[_0xe5c3('0x9')]();}else{logger[_0xe5c3('0xa')](_0xe5c3('0xb'),_0x3f7247,_0x29d4d3[_0xe5c3('0xc')]);if(_0x29d4d3[_0xe5c3('0xc')]){var _0x2f312d=_[_0xe5c3('0xd')](_0x183db7[_0xe5c3('0xe')](),{'p':_0x29d4d3['priority']});if(_0x2f312d>=0x0){logger[_0xe5c3('0xa')](_0xe5c3('0xf'),_0x3f7247,_0x29d4d3[_0xe5c3('0xc')]||_0xe5c3('0x10'),_0x2f312d);_0x183db7[_0xe5c3('0x10')](_0x2f312d);}else{logger[_0xe5c3('0xa')](_0xe5c3('0x11'),_0x3f7247,_0x29d4d3[_0xe5c3('0xc')]||'next');_0x183db7[_0xe5c3('0x9')]();}}else{_0x183db7[_0xe5c3('0x10')]();}}}catch(_0x182507){logger[_0xe5c3('0x6')](_0xe5c3('0x7'),_0x3f7247,JSON[_0xe5c3('0x12')](_0x182507));_0x183db7['stop']();}};}; \ No newline at end of file +var _0x70b2=['error','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x47d8da,_0x4c6f3b){var _0x1eb3b7=function(_0x7f0178){while(--_0x7f0178){_0x47d8da['push'](_0x47d8da['shift']());}};_0x1eb3b7(++_0x4c6f3b);}(_0x70b2,0x1b6));var _0x270b=function(_0x3fdcb9,_0x4013d9){_0x3fdcb9=_0x3fdcb9-0x0;var _0x269d5b=_0x70b2[_0x3fdcb9];return _0x269d5b;};'use strict';var schema=require(_0x270b('0x0'));var _=require(_0x270b('0x1'));var logger=require('../../../../config/logger')(_0x270b('0x2'));var gotop=schema({'priority':{'type':_0x270b('0x3'),'required':!![],'message':_0x270b('0x4')}});exports[_0x270b('0x5')]=function(_0x39b51a,_0x486a8e){return function(_0x239cb4){try{var _0x491c9e={'priority':_0x486a8e[0x0]};var _0x24cc9f=gotop[_0x270b('0x0')](_0x491c9e,{'typecast':!![]});if(_0x24cc9f['length']){logger['error'](_0x270b('0x6'),_0x39b51a,_[_0x270b('0x7')](_0x24cc9f,_0x270b('0x8'))[_0x270b('0x9')](',\x20'));_0x239cb4[_0x270b('0xa')]();}else{logger['info'](_0x270b('0xb'),_0x39b51a,_0x491c9e['priority']);if(_0x491c9e[_0x270b('0xc')]){var _0x325733=_['findIndex'](_0x239cb4[_0x270b('0xd')](),{'p':_0x491c9e['priority']});if(_0x325733>=0x0){logger[_0x270b('0xe')](_0x270b('0xf'),_0x39b51a,_0x491c9e['priority']||_0x270b('0x10'),_0x325733);_0x239cb4[_0x270b('0x10')](_0x325733);}else{logger[_0x270b('0xe')](_0x270b('0x11'),_0x39b51a,_0x491c9e[_0x270b('0xc')]||_0x270b('0x10'));_0x239cb4['stop']();}}else{_0x239cb4[_0x270b('0x10')]();}}}catch(_0x2a400d){logger[_0x270b('0x12')](_0x270b('0x6'),_0x39b51a,JSON['stringify'](_0x2a400d));_0x239cb4[_0x270b('0xa')]();}};}; \ 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 82b290c..f4cb182 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 _0x88c3=['upperFirst','InteractionId','interaction','Message','create','then','next','catch','error','[%s][MESSAGE]\x20%s','stop','lodash','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account'];(function(_0x5ef7cc,_0x5f4f54){var _0x4e662a=function(_0xa546a8){while(--_0xa546a8){_0x5ef7cc['push'](_0x5ef7cc['shift']());}};_0x4e662a(++_0x5f4f54);}(_0x88c3,0x1ee));var _0x388c=function(_0x4f98e2,_0x4a9e75){_0x4f98e2=_0x4f98e2-0x0;var _0x45b344=_0x88c3[_0x4f98e2];return _0x45b344;};'use strict';var _=require(_0x388c('0x0'));var utils=require('./utils');var logger=require(_0x388c('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x388c('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x388c('0x3')),'whatsappMessage':require(_0x388c('0x4'))};exports[_0x388c('0x5')]=function(_0x33c1dc,_0x28ed4d){return function(_0x23199c){try{var _0x5a1c0d={'body':utils[_0x388c('0x6')](_0x28ed4d[0x0],this),'ContactId':this[_0x388c('0x7')]['id']};if(this[_0x388c('0x8')]===_0x388c('0x9')){_0x5a1c0d[_0x388c('0xa')]=this[_0x388c('0xb')]['id'];}else{_0x5a1c0d[_[_0x388c('0xc')](this[_0x388c('0x8')])+'AccountId']=this[_0x388c('0xb')]['id'];}_0x5a1c0d[_['upperFirst'](this['channel'])+_0x388c('0xd')]=this[_0x388c('0xe')]['id'];if(rpc[this[_0x388c('0x8')]+_0x388c('0xf')]){return rpc[this[_0x388c('0x8')]+_0x388c('0xf')][_0x388c('0x10')](_0x5a1c0d)[_0x388c('0x11')](function(_0x262ed1){logger['info']('[%s][MESSAGE]\x20%s',_0x33c1dc,_0x5a1c0d['body']);_0x23199c[_0x388c('0x12')]();})[_0x388c('0x13')](function(_0x50e78e){logger[_0x388c('0x14')](_0x388c('0x15'),_0x33c1dc,JSON['stringify'](_0x50e78e));_0x23199c['stop']();});}}catch(_0x76001f){logger[_0x388c('0x14')](_0x388c('0x15'),_0x33c1dc,JSON['stringify'](_0x76001f));_0x23199c[_0x388c('0x16')]();}};}; \ No newline at end of file +var _0xf5fe=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','stringify','stop','error','lodash'];(function(_0x1ba4d1,_0x54fd0e){var _0x29a4a5=function(_0x15c9b8){while(--_0x15c9b8){_0x1ba4d1['push'](_0x1ba4d1['shift']());}};_0x29a4a5(++_0x54fd0e);}(_0xf5fe,0x1da));var _0xef5f=function(_0x252db9,_0x583db9){_0x252db9=_0x252db9-0x0;var _0x47fd16=_0xf5fe[_0x252db9];return _0x47fd16;};'use strict';var _=require(_0xef5f('0x0'));var utils=require(_0xef5f('0x1'));var logger=require(_0xef5f('0x2'))(_0xef5f('0x3'));var rpc={'chatMessage':require(_0xef5f('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xef5f('0x5')),'smsMessage':require(_0xef5f('0x6')),'faxMessage':require(_0xef5f('0x7')),'whatsappMessage':require(_0xef5f('0x8'))};exports['consequence']=function(_0x3f74ca,_0x254970){return function(_0x4bf0e6){try{var _0x3e09e5={'body':utils['getMustacheRender'](_0x254970[0x0],this),'ContactId':this['contact']['id']};if(this[_0xef5f('0x9')]===_0xef5f('0xa')){_0x3e09e5[_0xef5f('0xb')]=this[_0xef5f('0xc')]['id'];}else{_0x3e09e5[_[_0xef5f('0xd')](this[_0xef5f('0x9')])+_0xef5f('0xe')]=this[_0xef5f('0xc')]['id'];}_0x3e09e5[_[_0xef5f('0xd')](this[_0xef5f('0x9')])+_0xef5f('0xf')]=this[_0xef5f('0x10')]['id'];if(rpc[this[_0xef5f('0x9')]+_0xef5f('0x11')]){return rpc[this['channel']+_0xef5f('0x11')][_0xef5f('0x12')](_0x3e09e5)[_0xef5f('0x13')](function(_0xc7cac1){logger['info'](_0xef5f('0x14'),_0x3f74ca,_0x3e09e5['body']);_0x4bf0e6[_0xef5f('0x15')]();})['catch'](function(_0x4d5716){logger['error']('[%s][MESSAGE]\x20%s',_0x3f74ca,JSON[_0xef5f('0x16')](_0x4d5716));_0x4bf0e6[_0xef5f('0x17')]();});}}catch(_0x3ab4f9){logger[_0xef5f('0x18')]('[%s][MESSAGE]\x20%s',_0x3f74ca,JSON[_0xef5f('0x16')](_0x3ab4f9));_0x4bf0e6[_0xef5f('0x17')]();}};}; \ 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 454a727..cd46fe5 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 _0x17d3=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x11a447,_0x46aed5){var _0x1bdd16=function(_0x8d181f){while(--_0x8d181f){_0x11a447['push'](_0x11a447['shift']());}};_0x1bdd16(++_0x46aed5);}(_0x17d3,0x8c));var _0x317d=function(_0x3537d4,_0x1aec5f){_0x3537d4=_0x3537d4-0x0;var _0x1b77ea=_0x17d3[_0x3537d4];return _0x1b77ea;};'use strict';var utils=require(_0x317d('0x0'));var logger=require(_0x317d('0x1'))(_0x317d('0x2'));exports[_0x317d('0x3')]=function(_0xacd7ad,_0x50f672){return function(_0x325b1a){try{logger[_0x317d('0x4')](_0x317d('0x5'),_0xacd7ad,utils[_0x317d('0x6')](_0x50f672[0x0],this));_0x325b1a[_0x317d('0x7')]();}catch(_0x2767b9){logger[_0x317d('0x8')]('[%s][NOOP]\x20%s',_0xacd7ad,JSON[_0x317d('0x9')](_0x2767b9));_0x325b1a['stop']();}};}; \ No newline at end of file +var _0x434c=['error','stringify','stop','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x207140,_0x4c6556){var _0x39e8cf=function(_0x16b730){while(--_0x16b730){_0x207140['push'](_0x207140['shift']());}};_0x39e8cf(++_0x4c6556);}(_0x434c,0x174));var _0xc434=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x434c[_0x3947c9];return _0x2e7871;};'use strict';var utils=require('./utils');var logger=require(_0xc434('0x0'))(_0xc434('0x1'));exports[_0xc434('0x2')]=function(_0x434653,_0x35af86){return function(_0x2fb842){try{logger['info'](_0xc434('0x3'),_0x434653,utils[_0xc434('0x4')](_0x35af86[0x0],this));_0x2fb842[_0xc434('0x5')]();}catch(_0xd2feaf){logger[_0xc434('0x6')](_0xc434('0x3'),_0x434653,JSON[_0xc434('0x7')](_0xd2feaf));_0x2fb842[_0xc434('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index f97345a..46fbd53 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 _0x6c5d=['close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','localhost','socket.io-emitter','queue_id','account','from','emit','clone','queue','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','InteractionId','interaction','upperFirst','MessageId','message','AccountId','WebsiteId','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','info','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x6c5d,0x180));var _0xd6c5=function(_0x8cc6b,_0x3fdfc4){_0x8cc6b=_0x8cc6b-0x0;var _0x329643=_0x6c5d[_0x8cc6b];return _0x329643;};'use strict';var schema=require(_0xd6c5('0x0'));var _=require(_0xd6c5('0x1'));var util=require(_0xd6c5('0x2'));var seqqueue=require(_0xd6c5('0x3'));var moment=require(_0xd6c5('0x4'));var Redis=require('ioredis');var config=require(_0xd6c5('0x5'));var logger=require(_0xd6c5('0x6'))(_0xd6c5('0x7'));var strategy=require('./strategy');config[_0xd6c5('0x8')]=_['defaults'](config[_0xd6c5('0x8')],{'host':_0xd6c5('0x9'),'port':0x18eb});var io=require(_0xd6c5('0xa'))(new Redis(config[_0xd6c5('0x8')]));var attributes=['id',_0xd6c5('0xb'),_0xd6c5('0xc'),'queue',_0xd6c5('0xd'),'joinAt'];function emit(_0x5e3212,_0x4d8e2d,_0xab1945){io['to'](_0x5e3212)[_0xd6c5('0xe')](_0x4d8e2d,_0xab1945);}function emitChannelQueueInteraction(_0xdf8f38,_0x46eddd,_0x4c7249,_0x4047da,_0x573413,_0x1add3a,_0x38af6e,_0x105c98){var _0x51c779=_[_0xd6c5('0xf')](_0x4c7249);_0x51c779[_0xd6c5('0xb')]=_0x105c98;_0x51c779[_0xd6c5('0x10')]=_0x46eddd;_0x51c779[_0xd6c5('0xc')]=_0x4047da;_0x51c779['id']=_0x573413;if(_0x1add3a){attributes['push'](_['capitalize'](_0xdf8f38)+'InteractionId');_0x38af6e[util[_0xd6c5('0x11')]('%sQueuesWaitingInteractions',_0xdf8f38)][_0x573413]=_[_0xd6c5('0x12')](_0x51c779,attributes);}else{delete _0x38af6e[util[_0xd6c5('0x11')](_0xd6c5('0x13'),_0xdf8f38)][_0x573413];}emit(util['format']('%s:queue:%s',_0xdf8f38,_0x46eddd),util[_0xd6c5('0x11')](_0xd6c5('0x14'),_0xdf8f38,_0x1add3a?_0xd6c5('0x15'):_0xd6c5('0x16')),_[_0xd6c5('0x12')](_0x51c779,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xd6c5('0x17')),'chatQueueReport':require(_0xd6c5('0x18')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xd6c5('0x19'))};var queue=schema({'name':{'type':_0xd6c5('0x1a'),'required':!![],'message':_0xd6c5('0x1b')},'timeout':{'type':_0xd6c5('0x1c'),'message':_0xd6c5('0x1d')}});function startRouting(_0x36688f,_0x2da490,_0x4e2380,_0x28ce84){if(_0x36688f&&_0x2da490&&_0x4e2380){_0x2da490['waiting']+=0x1;var _0x3a57fa={'uniqueid':_0x36688f,'from':_0x4e2380[_0xd6c5('0x1e')]?_0x4e2380[_0xd6c5('0x1e')]['from']:'','joinAt':moment()[_0xd6c5('0x11')](_0xd6c5('0x1f')),'ContactId':_0x4e2380[_0xd6c5('0x20')]?_0x4e2380['contact']['id']:null,'ListId':_0x4e2380[_0xd6c5('0x21')]?_0x4e2380[_0xd6c5('0x21')]['id']:null};_0x3a57fa[_['upperFirst'](_0x4e2380[_0xd6c5('0x22')])+'QueueId']=_0x2da490['id']||null;_0x3a57fa[_['upperFirst'](_0x4e2380[_0xd6c5('0x22')])+_0xd6c5('0x23')]=_0x4e2380[_0xd6c5('0x24')]?_0x4e2380[_0xd6c5('0x24')]['id']:null;_0x3a57fa[_[_0xd6c5('0x25')](_0x4e2380[_0xd6c5('0x22')])+_0xd6c5('0x26')]=_0x4e2380['message']?_0x4e2380[_0xd6c5('0x27')]['id']:null;_0x3a57fa[_[_0xd6c5('0x25')](_0x4e2380[_0xd6c5('0x22')])+(_0x4e2380['channel']!=='chat'?_0xd6c5('0x28'):_0xd6c5('0x29'))]=_0x4e2380[_0xd6c5('0xc')]?_0x4e2380[_0xd6c5('0xc')]['id']:null;logger['info'](util[_0xd6c5('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x36688f,_0x2da490['name']));emitChannelQueueInteraction(_0x4e2380[_0xd6c5('0x22')],_0x2da490['name'],_0x3a57fa,_0x4e2380[_0xd6c5('0xc')][_0xd6c5('0x2a')],_0x4e2380[_0xd6c5('0x27')]['id'],!![],_0x28ce84,_0x2da490['id']);if(rpc[_0x4e2380[_0xd6c5('0x22')]+_0xd6c5('0x2b')]){return rpc[_0x4e2380[_0xd6c5('0x22')]+_0xd6c5('0x2b')][_0xd6c5('0x2c')](_0x3a57fa)[_0xd6c5('0x2d')](function(_0xd24d06){logger[_0xd6c5('0x2e')](_0xd6c5('0x2f'));});}}}function stopRouting(_0x33749d,_0x2103e5,_0x5a9350,_0x1683a6){if(_0x33749d&&_0x2103e5){_0x2103e5[_0xd6c5('0x30')]-=0x1;var _0x401657={'leaveAt':moment()[_0xd6c5('0x11')](_0xd6c5('0x1f')),'acceptAt':moment()[_0xd6c5('0x11')](_0xd6c5('0x1f')),'reason':'accepted'};logger[_0xd6c5('0x31')](util[_0xd6c5('0x11')](_0xd6c5('0x32'),_0x33749d,_0x2103e5[_0xd6c5('0x2a')]));emitChannelQueueInteraction(_0x5a9350[_0xd6c5('0x22')],_0x2103e5[_0xd6c5('0x2a')],_0x5a9350[_0xd6c5('0x1e')],_0x5a9350['account'][_0xd6c5('0x2a')],_0x5a9350[_0xd6c5('0x27')]['id'],![],_0x1683a6,_0x2103e5['id']);if(rpc[_0x5a9350[_0xd6c5('0x22')]+_0xd6c5('0x2b')]){return rpc[_0x5a9350['channel']+_0xd6c5('0x2b')][_0xd6c5('0x33')](_0x33749d,_0x401657)[_0xd6c5('0x2d')](function(_0x621d10){logger[_0xd6c5('0x2e')]('update\x20queue\x20report');});}}}function endRouting(_0x28a512,_0x555513,_0x2bc64e,_0x1ae494){if(_0x28a512&&_0x555513){_0x555513[_0xd6c5('0x30')]-=0x1;var _0x19b41d={'leaveAt':moment()['format'](_0xd6c5('0x1f')),'exitAt':moment()[_0xd6c5('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xd6c5('0x34')};logger[_0xd6c5('0x31')](util[_0xd6c5('0x11')](_0xd6c5('0x35'),_0x28a512,_0x555513['name']));emitChannelQueueInteraction(_0x2bc64e[_0xd6c5('0x22')],_0x555513['name'],_0x2bc64e[_0xd6c5('0x1e')],_0x2bc64e['account'][_0xd6c5('0x2a')],_0x2bc64e[_0xd6c5('0x27')]['id'],![],_0x1ae494);if(rpc[_0x2bc64e[_0xd6c5('0x22')]+_0xd6c5('0x2b')]){return rpc[_0x2bc64e[_0xd6c5('0x22')]+_0xd6c5('0x2b')][_0xd6c5('0x33')](_0x28a512,_0x19b41d)[_0xd6c5('0x2d')](function(_0x331e9c){logger['error'](_0xd6c5('0x36'));});}}}function handleFindQueue(_0x6eab67){return function(_0x1b7082){return _0x1b7082[_0xd6c5('0x2a')][_0xd6c5('0x37')]()===_0x6eab67[_0xd6c5('0x37')]();};}exports[_0xd6c5('0x38')]=function(_0x385be5,_0x652b50,_0xe73cc2,_0x2a72c2){return function(_0x2e4171){try{var _0x5d8a2d={'name':_0x652b50[0x0],'timeout':_0x652b50[0x1]};var _0x76785=queue['validate'](_0x5d8a2d,{'typecast':!![]});if(_0x76785[_0xd6c5('0x39')]){logger[_0xd6c5('0x2e')](_0xd6c5('0x3a'),_0x385be5,_['map'](_0x76785,'message')[_0xd6c5('0x3b')](',\x20'));_0x2e4171[_0xd6c5('0x3c')]();}else{var _0x47726e=_[_0xd6c5('0x3d')](_0xe73cc2[_0x2a72c2[_0xd6c5('0x22')]+_0xd6c5('0x3e')],handleFindQueue(_0x5d8a2d['name']));if(_0x47726e){startRouting(_0x385be5,_0x47726e,_0x2a72c2,_0xe73cc2);var _0x1eaf95=(_0x47726e[_0xd6c5('0x34')]||0xa)*0x3e8;var _0x262c0c=(_0x5d8a2d[_0xd6c5('0x34')]||0x14)*0x3e8;var _0x340ed1;if(_0x1eaf95>_0x262c0c){_0x262c0c=_0x1eaf95;}var _0x51938f=seqqueue['createQueue'](_0x1eaf95);_0x51938f['id']=_0x385be5;_0x51938f['atimeout']=_0x1eaf95;_0x51938f[_0xd6c5('0x3f')]=_0x262c0c;_0x51938f['channel']=_0x2a72c2[_0xd6c5('0x22')];_0xe73cc2['rules'][_0x385be5]['on'](_0xd6c5('0x40'),function(){logger[_0xd6c5('0x31')](_0xd6c5('0x41'),_0x385be5);stopRouting(_0x385be5,_0x47726e,_0x2a72c2,_0xe73cc2);clearTimeout(_0x340ed1);_0x340ed1=undefined;_0x51938f[_0xd6c5('0x42')](!![]);if(_0xe73cc2[_0xd6c5('0x43')][_0x385be5]){delete _0xe73cc2[_0xd6c5('0x43')][_0x385be5];}_0x2e4171[_0xd6c5('0x3c')]();});_0xe73cc2[_0xd6c5('0x43')][_0x385be5]['on'](_0xd6c5('0x44'),function(){if(_0xe73cc2[_0xd6c5('0x43')][_0x385be5]){delete _0xe73cc2[_0xd6c5('0x43')][_0x385be5];}});_0x340ed1=setTimeout(function(){logger[_0xd6c5('0x31')](_0xd6c5('0x45'),_0x385be5);endRouting(_0x385be5,_0x47726e,_0x2a72c2,_0xe73cc2);clearTimeout(_0x340ed1);_0x51938f[_0xd6c5('0x42')](!![]);_0x2e4171[_0xd6c5('0x46')]();},_0x262c0c);switch(_0x47726e[_0xd6c5('0x47')]){case _0xd6c5('0x48'):strategy[_0xd6c5('0x48')](_0x51938f,_0x47726e,_0xe73cc2,_0x2a72c2);break;default:strategy['beepall'](_0x51938f,_0x47726e,_0xe73cc2,_0x2a72c2);}}else{logger[_0xd6c5('0x2e')](_0xd6c5('0x49'),_0x385be5,_0x5d8a2d[_0xd6c5('0x2a')]);_0x2e4171[_0xd6c5('0x3c')]();}}}catch(_0x1e6962){console[_0xd6c5('0x4a')](_0x1e6962);logger['error'](_0xd6c5('0x3a'),_0x385be5,_0x1e6962['stack']);_0x2e4171[_0xd6c5('0x3c')]();}};}; \ No newline at end of file +var _0x1e42=['validate','lodash','util','moment','ioredis','../../../../config/logger','routing','redis','defaults','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/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','log','stack'];(function(_0x56b555,_0x5b272d){var _0x44f17a=function(_0xc2b19a){while(--_0xc2b19a){_0x56b555['push'](_0x56b555['shift']());}};_0x44f17a(++_0x5b272d);}(_0x1e42,0xa2));var _0x21e4=function(_0x25bb19,_0x5cafa2){_0x25bb19=_0x25bb19-0x0;var _0x5d4ebd=_0x1e42[_0x25bb19];return _0x5d4ebd;};'use strict';var schema=require(_0x21e4('0x0'));var _=require(_0x21e4('0x1'));var util=require(_0x21e4('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x21e4('0x3'));var Redis=require(_0x21e4('0x4'));var config=require('../../../../config/environment');var logger=require(_0x21e4('0x5'))(_0x21e4('0x6'));var strategy=require('./strategy');config[_0x21e4('0x7')]=_[_0x21e4('0x8')](config[_0x21e4('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x21e4('0x9'),_0x21e4('0xa'),_0x21e4('0xb'),_0x21e4('0xc'),_0x21e4('0xd')];function emit(_0x499fe9,_0x4ae1fd,_0x1e587e){io['to'](_0x499fe9)[_0x21e4('0xe')](_0x4ae1fd,_0x1e587e);}function emitChannelQueueInteraction(_0x2d73be,_0x63449b,_0x11790c,_0x2707e2,_0x4a94bf,_0x6ea0e8,_0x59c3f1,_0x487d7c){var _0x3203bc=_[_0x21e4('0xf')](_0x11790c);_0x3203bc[_0x21e4('0x9')]=_0x487d7c;_0x3203bc[_0x21e4('0xb')]=_0x63449b;_0x3203bc['account']=_0x2707e2;_0x3203bc['id']=_0x4a94bf;if(_0x6ea0e8){attributes[_0x21e4('0x10')](_[_0x21e4('0x11')](_0x2d73be)+_0x21e4('0x12'));_0x59c3f1[util[_0x21e4('0x13')](_0x21e4('0x14'),_0x2d73be)][_0x4a94bf]=_[_0x21e4('0x15')](_0x3203bc,attributes);}else{delete _0x59c3f1[util[_0x21e4('0x13')](_0x21e4('0x14'),_0x2d73be)][_0x4a94bf];}emit(util['format'](_0x21e4('0x16'),_0x2d73be,_0x63449b),util[_0x21e4('0x13')](_0x21e4('0x17'),_0x2d73be,_0x6ea0e8?_0x21e4('0x18'):_0x21e4('0x19')),_[_0x21e4('0x15')](_0x3203bc,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x21e4('0x1a')),'chatQueueReport':require(_0x21e4('0x1b')),'smsQueueReport':require(_0x21e4('0x1c')),'faxQueueReport':require(_0x21e4('0x1d')),'whatsappQueueReport':require(_0x21e4('0x1e'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x21e4('0x1f')},'timeout':{'type':_0x21e4('0x20'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x310bbb,_0x5a55a8,_0x4b3433,_0x23c3ac){if(_0x310bbb&&_0x5a55a8&&_0x4b3433){_0x5a55a8[_0x21e4('0x21')]+=0x1;var _0x10b572={'uniqueid':_0x310bbb,'from':_0x4b3433[_0x21e4('0x22')]?_0x4b3433['body']['from']:'','joinAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'ContactId':_0x4b3433['contact']?_0x4b3433[_0x21e4('0x24')]['id']:null,'ListId':_0x4b3433[_0x21e4('0x25')]?_0x4b3433[_0x21e4('0x25')]['id']:null};_0x10b572[_[_0x21e4('0x26')](_0x4b3433[_0x21e4('0x27')])+_0x21e4('0x28')]=_0x5a55a8['id']||null;_0x10b572[_['upperFirst'](_0x4b3433[_0x21e4('0x27')])+'InteractionId']=_0x4b3433[_0x21e4('0x29')]?_0x4b3433[_0x21e4('0x29')]['id']:null;_0x10b572[_[_0x21e4('0x26')](_0x4b3433['channel'])+_0x21e4('0x2a')]=_0x4b3433['message']?_0x4b3433[_0x21e4('0x2b')]['id']:null;_0x10b572[_[_0x21e4('0x26')](_0x4b3433[_0x21e4('0x27')])+(_0x4b3433[_0x21e4('0x27')]!==_0x21e4('0x2c')?_0x21e4('0x2d'):_0x21e4('0x2e'))]=_0x4b3433[_0x21e4('0xa')]?_0x4b3433[_0x21e4('0xa')]['id']:null;logger[_0x21e4('0x2f')](util['format'](_0x21e4('0x30'),_0x310bbb,_0x5a55a8['name']));emitChannelQueueInteraction(_0x4b3433[_0x21e4('0x27')],_0x5a55a8[_0x21e4('0x31')],_0x10b572,_0x4b3433[_0x21e4('0xa')]['name'],_0x4b3433['message']['id'],!![],_0x23c3ac,_0x5a55a8['id']);if(rpc[_0x4b3433[_0x21e4('0x27')]+_0x21e4('0x32')]){return rpc[_0x4b3433[_0x21e4('0x27')]+_0x21e4('0x32')][_0x21e4('0x33')](_0x10b572)[_0x21e4('0x34')](function(_0x1e1d62){logger[_0x21e4('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0x40abde,_0x48c32e,_0x209a4f,_0x1b9f34){if(_0x40abde&&_0x48c32e){_0x48c32e[_0x21e4('0x21')]-=0x1;var _0x562b47={'leaveAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'acceptAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'reason':_0x21e4('0x36')};logger[_0x21e4('0x2f')](util[_0x21e4('0x13')](_0x21e4('0x37'),_0x40abde,_0x48c32e[_0x21e4('0x31')]));emitChannelQueueInteraction(_0x209a4f[_0x21e4('0x27')],_0x48c32e[_0x21e4('0x31')],_0x209a4f[_0x21e4('0x22')],_0x209a4f['account'][_0x21e4('0x31')],_0x209a4f[_0x21e4('0x2b')]['id'],![],_0x1b9f34,_0x48c32e['id']);if(rpc[_0x209a4f[_0x21e4('0x27')]+'QueueReport']){return rpc[_0x209a4f[_0x21e4('0x27')]+_0x21e4('0x32')][_0x21e4('0x38')](_0x40abde,_0x562b47)[_0x21e4('0x34')](function(_0x47394a){logger[_0x21e4('0x35')](_0x21e4('0x39'));});}}}function endRouting(_0x4a8d29,_0x4ed209,_0x4687f8,_0x53c6b1){if(_0x4a8d29&&_0x4ed209){_0x4ed209[_0x21e4('0x21')]-=0x1;var _0x1ed711={'leaveAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'exitAt':moment()[_0x21e4('0x13')](_0x21e4('0x23')),'reason':'timeout'};logger['info'](util[_0x21e4('0x13')](_0x21e4('0x3a'),_0x4a8d29,_0x4ed209[_0x21e4('0x31')]));emitChannelQueueInteraction(_0x4687f8[_0x21e4('0x27')],_0x4ed209[_0x21e4('0x31')],_0x4687f8[_0x21e4('0x22')],_0x4687f8[_0x21e4('0xa')][_0x21e4('0x31')],_0x4687f8['message']['id'],![],_0x53c6b1);if(rpc[_0x4687f8[_0x21e4('0x27')]+_0x21e4('0x32')]){return rpc[_0x4687f8[_0x21e4('0x27')]+_0x21e4('0x32')][_0x21e4('0x38')](_0x4a8d29,_0x1ed711)[_0x21e4('0x34')](function(_0x507111){logger[_0x21e4('0x35')](_0x21e4('0x39'));});}}}function handleFindQueue(_0x298392){return function(_0x4b291a){return _0x4b291a[_0x21e4('0x31')][_0x21e4('0x3b')]()===_0x298392[_0x21e4('0x3b')]();};}exports[_0x21e4('0x3c')]=function(_0x4bd99c,_0x13a7ee,_0x3cdb4f,_0x19cf8d){return function(_0x1ded87){try{var _0xc4d36a={'name':_0x13a7ee[0x0],'timeout':_0x13a7ee[0x1]};var _0x54395e=queue['validate'](_0xc4d36a,{'typecast':!![]});if(_0x54395e[_0x21e4('0x3d')]){logger['error'](_0x21e4('0x3e'),_0x4bd99c,_['map'](_0x54395e,'message')[_0x21e4('0x3f')](',\x20'));_0x1ded87[_0x21e4('0x40')]();}else{var _0x17c834=_[_0x21e4('0x41')](_0x3cdb4f[_0x19cf8d['channel']+_0x21e4('0x42')],handleFindQueue(_0xc4d36a['name']));if(_0x17c834){startRouting(_0x4bd99c,_0x17c834,_0x19cf8d,_0x3cdb4f);var _0x49fa4c=(_0x17c834[_0x21e4('0x43')]||0xa)*0x3e8;var _0x3eedba=(_0xc4d36a['timeout']||0x14)*0x3e8;var _0x32360a;if(_0x49fa4c>_0x3eedba){_0x3eedba=_0x49fa4c;}var _0x8f2e51=seqqueue[_0x21e4('0x44')](_0x49fa4c);_0x8f2e51['id']=_0x4bd99c;_0x8f2e51[_0x21e4('0x45')]=_0x49fa4c;_0x8f2e51[_0x21e4('0x46')]=_0x3eedba;_0x8f2e51['channel']=_0x19cf8d[_0x21e4('0x27')];_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]['on'](_0x21e4('0x48'),function(){logger[_0x21e4('0x2f')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x4bd99c);stopRouting(_0x4bd99c,_0x17c834,_0x19cf8d,_0x3cdb4f);clearTimeout(_0x32360a);_0x32360a=undefined;_0x8f2e51[_0x21e4('0x49')](!![]);if(_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]){delete _0x3cdb4f[_0x21e4('0x47')][_0x4bd99c];}_0x1ded87[_0x21e4('0x40')]();});_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]['on'](_0x21e4('0x4a'),function(){if(_0x3cdb4f[_0x21e4('0x47')][_0x4bd99c]){delete _0x3cdb4f[_0x21e4('0x47')][_0x4bd99c];}});_0x32360a=setTimeout(function(){logger['info'](_0x21e4('0x4b'),_0x4bd99c);endRouting(_0x4bd99c,_0x17c834,_0x19cf8d,_0x3cdb4f);clearTimeout(_0x32360a);_0x8f2e51['close'](!![]);_0x1ded87[_0x21e4('0x4c')]();},_0x3eedba);switch(_0x17c834[_0x21e4('0x4d')]){case _0x21e4('0x4e'):strategy[_0x21e4('0x4e')](_0x8f2e51,_0x17c834,_0x3cdb4f,_0x19cf8d);break;default:strategy['beepall'](_0x8f2e51,_0x17c834,_0x3cdb4f,_0x19cf8d);}}else{logger[_0x21e4('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4bd99c,_0xc4d36a[_0x21e4('0x31')]);_0x1ded87[_0x21e4('0x40')]();}}}catch(_0x79e538){console[_0x21e4('0x4f')](_0x79e538);logger[_0x21e4('0x35')](_0x21e4('0x3e'),_0x4bd99c,_0x79e538[_0x21e4('0x50')]);_0x1ded87[_0x21e4('0x40')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 41d8f7b..95e304b 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 _0xd67b=['handleRun','bind','handleTimeout','timeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push'];(function(_0x3e7335,_0x4a3bbf){var _0x3c3427=function(_0x4756f0){while(--_0x4756f0){_0x3e7335['push'](_0x3e7335['shift']());}};_0x3c3427(++_0x4a3bbf);}(_0xd67b,0x133));var _0xbd67=function(_0x223d93,_0x106ec2){_0x223d93=_0x223d93-0x0;var _0x45603b=_0xd67b[_0x223d93];return _0x45603b;};'use strict';var _=require('lodash');var uuid=require(_0xbd67('0x0'));var util=require('./util');var logger=require(_0xbd67('0x1'))(_0xbd67('0x2'));var Agent=function(_0x317e33,_0x5e967b,_0x40e384,_0x50da5a){this[_0xbd67('0x3')]=uuid['v4']();this['squeue']=_0x317e33;this[_0xbd67('0x4')]=_0x5e967b;this[_0xbd67('0x5')]=_0x40e384;this[_0xbd67('0x2')]=_0x50da5a;this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this[_0xbd67('0x6')]['on'](_0xbd67('0xb'),this[_0xbd67('0xa')][_0xbd67('0x9')](this));this['squeue']['on']('drained',this[_0xbd67('0xc')]['bind'](this));};Agent[_0xbd67('0xd')][_0xbd67('0x7')]=function(){this[_0xbd67('0x6')][_0xbd67('0x7')](this[_0xbd67('0x8')][_0xbd67('0x9')](this),this[_0xbd67('0xa')][_0xbd67('0x9')](this));};Agent[_0xbd67('0xd')][_0xbd67('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0xbd67('0xd')][_0xbd67('0x8')]=function(){logger[_0xbd67('0xe')](_0xbd67('0xf'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this[_0xbd67('0x7')]['bind'](this),0x3e8);}else{if(this[_0xbd67('0x2')][_0xbd67('0x12')]||util[_0xbd67('0x13')](this['squeue']['id'],this[_0xbd67('0x5')]['agents'][this[_0xbd67('0x4')]['id']],this[_0xbd67('0x6')][_0xbd67('0x14')],![])){this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=!![];this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']]['busyQueue']=undefined;util[_0xbd67('0x16')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this[_0xbd67('0x6')][_0xbd67('0x14')]);util[_0xbd67('0x17')](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this[_0xbd67('0x2')]);util['writeLog'](this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],_0xbd67('0x18')+(this[_0xbd67('0x2')]['forcedOwnership']?_0xbd67('0x19'):''));}else{logger[_0xbd67('0xe')](_0xbd67('0x1a'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xbd67('0xd')][_0xbd67('0xa')]=function(_0x4675ac){if(_[_0xbd67('0x10')](this[_0xbd67('0x5')][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']])){return logger[_0xbd67('0xe')](_0xbd67('0x1b'),this[_0xbd67('0x6')]['id'],this['agent']['id']);}else{logger['debug'](_0xbd67('0x1c'),this[_0xbd67('0x6')]['id'],this[_0xbd67('0x4')]['id']);util['hideNotification'](this[_0xbd67('0x3')],this[_0xbd67('0x6')]['id'],this[_0xbd67('0x5')][_0xbd67('0x11')][this['agent']['id']],null,this['routing']);this['realtime'][_0xbd67('0x11')][this[_0xbd67('0x4')]['id']][_0xbd67('0x15')]=![];this['realtime']['agents'][this[_0xbd67('0x4')]['id']][_0xbd67('0x1d')]=undefined;util[_0xbd67('0x1e')](this[_0xbd67('0x5')],this[_0xbd67('0x2')],this[_0xbd67('0x4')],this['squeue'][_0xbd67('0x14')]);util[_0xbd67('0x1f')](this[_0xbd67('0x6')]['id'],this['realtime'][_0xbd67('0x11')][this['agent']['id']],_0x4675ac?_0xbd67('0x20'):_0xbd67('0x21'));}if(!_0x4675ac){setTimeout(this['push'][_0xbd67('0x9')](this),0x3e8);}};function agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777){return new Agent(_0x126514,_0x20eb75,_0x31f689,_0x1b2777);}module[_0xbd67('0x22')]=agent; \ No newline at end of file +var _0x98a8=['prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','push','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','handleTimeout','bind','timeout','drained','handleDrained'];(function(_0x35e88f,_0x424ea0){var _0x4f9934=function(_0x1b5dd3){while(--_0x1b5dd3){_0x35e88f['push'](_0x35e88f['shift']());}};_0x4f9934(++_0x424ea0);}(_0x98a8,0x12c));var _0x898a=function(_0x4320bd,_0x12d8a4){_0x4320bd=_0x4320bd-0x0;var _0x364179=_0x98a8[_0x4320bd];return _0x364179;};'use strict';var _=require(_0x898a('0x0'));var uuid=require(_0x898a('0x1'));var util=require(_0x898a('0x2'));var logger=require(_0x898a('0x3'))(_0x898a('0x4'));var Agent=function(_0x226db7,_0x69c61f,_0x4a0836,_0x2bb3e2){this[_0x898a('0x5')]=uuid['v4']();this[_0x898a('0x6')]=_0x226db7;this[_0x898a('0x7')]=_0x69c61f;this[_0x898a('0x8')]=_0x4a0836;this['routing']=_0x2bb3e2;this[_0x898a('0x6')]['push'](this[_0x898a('0x9')]['bind'](this),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xc'),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xd'),this[_0x898a('0xe')]['bind'](this));};Agent[_0x898a('0xf')]['push']=function(){this[_0x898a('0x6')]['push'](this[_0x898a('0x9')][_0x898a('0xb')](this),this[_0x898a('0xa')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x898a('0xa')](!![]);};Agent[_0x898a('0xf')][_0x898a('0x9')]=function(){logger[_0x898a('0x10')](_0x898a('0x11'),this[_0x898a('0x6')]['id'],this['agent']['id']);if(_[_0x898a('0x12')](this['realtime'][_0x898a('0x13')][this['agent']['id']])){logger[_0x898a('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x898a('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x898a('0x14')][_0x898a('0xb')](this),0x3e8);}else{if(this[_0x898a('0x4')]['forcedOwnership']||util[_0x898a('0x15')](this['squeue']['id'],this['realtime'][_0x898a('0x13')][this[_0x898a('0x7')]['id']],this['squeue']['channel'],![])){this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x16')]=!![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busyQueue']=undefined;util[_0x898a('0x17')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this[_0x898a('0x6')][_0x898a('0x18')]);util['showNotification'](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']],null,this[_0x898a('0x4')]);util['writeLog'](this[_0x898a('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],_0x898a('0x19')+(this[_0x898a('0x4')][_0x898a('0x1a')]?_0x898a('0x1b'):''));}else{logger[_0x898a('0x10')](_0x898a('0x1c'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);setTimeout(this[_0x898a('0x14')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0xe9c33d){if(_[_0x898a('0x12')](this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']])){return logger[_0x898a('0x10')](_0x898a('0x1d'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);}else{logger[_0x898a('0x10')](_0x898a('0x1e'),this[_0x898a('0x6')]['id'],this['agent']['id']);util[_0x898a('0x1f')](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this['agent']['id']],null,this['routing']);this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busy']=![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x20')]=undefined;util[_0x898a('0x21')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this['squeue'][_0x898a('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x898a('0x8')]['agents'][this[_0x898a('0x7')]['id']],_0xe9c33d?'STOP':_0x898a('0x22'));}if(!_0xe9c33d){setTimeout(this['push'][_0x898a('0xb')](this),0x3e8);}};function agent(_0x354703,_0x101182,_0x50c0e4,_0x554897){return new Agent(_0x354703,_0x101182,_0x50c0e4,_0x554897);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 0cfac80..b45105f 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 _0x232c=['push','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','debug','[%s][QUEUE]\x20EMPTY','hideNotification','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype'];(function(_0x22b70f,_0x4c853f){var _0x100985=function(_0x18628e){while(--_0x18628e){_0x22b70f['push'](_0x22b70f['shift']());}};_0x100985(++_0x4c853f);}(_0x232c,0xa4));var _0xc232=function(_0x366e33,_0x444a37){_0x366e33=_0x366e33-0x0;var _0x46909a=_0x232c[_0x366e33];return _0x46909a;};'use strict';var _=require(_0xc232('0x0'));var uuid=require(_0xc232('0x1'));var util=require(_0xc232('0x2'));var logger=require(_0xc232('0x3'))(_0xc232('0x4'));var Beepall=function(_0x397b0b,_0x7422d3,_0x5ad582,_0xd6d4fd){this[_0xc232('0x5')]=uuid['v4']();this['squeue']=_0x397b0b;this[_0xc232('0x6')]=_0x7422d3;this[_0xc232('0x7')]=_0x5ad582;this[_0xc232('0x4')]=_0xd6d4fd;this[_0xc232('0x8')]['push'](this[_0xc232('0x9')][_0xc232('0xa')](this),this[_0xc232('0xb')]['bind'](this));this['squeue']['on'](_0xc232('0xc'),this[_0xc232('0xb')]['bind'](this));this['squeue']['on'](_0xc232('0xd'),this[_0xc232('0xe')][_0xc232('0xa')](this));};Beepall[_0xc232('0xf')][_0xc232('0x10')]=function(){this[_0xc232('0x8')][_0xc232('0x10')](this[_0xc232('0x9')][_0xc232('0xa')](this),this['handleTimeout'][_0xc232('0xa')](this));};Beepall[_0xc232('0xf')]['handleDrained']=function(){this['handleTimeout'](!![]);};Beepall[_0xc232('0xf')][_0xc232('0x9')]=function(){var _0x57bc4f=!![];if(!_[_0xc232('0x11')](this['queue'])&&!_['isNil'](this[_0xc232('0x6')][_0xc232('0x12')])&&this['queue'][_0xc232('0x12')]['length']>0x0){for(var _0x2b37b6=0x0,_0x3c31d4;_0x2b37b60x0){for(var _0x5ca876=0x0,_0x4052f2;_0x5ca8760x0&&_0x466721[_0xb4849d+_0xf4fd('0x20')]>=_0x466721[_0xb4849d+'Capacity']){writeLog(_0x6bcca6,_0x466721,_0xb4849d[_0xf4fd('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xf4fd('0x22')]=function(_0x644993,_0x2cd60d,_0x1f3e05,_0x39f767,_0xb63f79){return sendNotification(!![],_0x644993,_0x2cd60d,_0x1f3e05,_0x39f767,_0xb63f79);};exports[_0xf4fd('0x23')]=function(_0x28baac,_0x126c85,_0x4cfcec,_0x546629,_0x5e8167){return sendNotification(![],_0x28baac,_0x126c85,_0x4cfcec,_0x546629,_0x5e8167);};exports['checkWaitingNotifications']=function(_0xf782e8,_0x207306,_0x2f63ad){var _0x39ac8b=_0x207306[_0xf4fd('0x24')][_0xf4fd('0x25')];if(!_0x39ac8b&&_0x2f63ad){_0x39ac8b=_0x2f63ad['id'];}var _0x5bbf5a=_[_0xf4fd('0x26')](_0xf782e8[_0x207306['channel']+'QueuesWaitingInteractions'],function(_0x458b55){var _0x4c79d9=_['capitalize'](_0x207306['channel'])+_0xf4fd('0x27');return _0x458b55[_0x4c79d9]===_0x207306[_0xf4fd('0x24')]['id'];});if(!_0x5bbf5a&&_0x39ac8b){_0x5bbf5a=_[_0xf4fd('0x26')](_0xf782e8[_0xf4fd('0x28')][_0x39ac8b][_0x207306[_0xf4fd('0x29')]+_0xf4fd('0x2a')],function(_0x17ab0a){return _0x17ab0a['id']===_0x207306[_0xf4fd('0x24')]['id'];});}return _0x5bbf5a;};exports['saveWaitingNotification']=function(_0x1728d4,_0x59ad08,_0x4a9795,_0x30772e){_0x1728d4['agents'][_0x4a9795['id']][_0x30772e+_0xf4fd('0x2a')][_0x59ad08[_0xf4fd('0x15')]['id']]={'id':_0x59ad08[_0xf4fd('0x24')]['id']};};exports[_0xf4fd('0x2b')]=function(_0x1532bc,_0x5bfad5,_0x50c9c8,_0x508a71){delete _0x1532bc[_0xf4fd('0x28')][_0x50c9c8['id']][_0x508a71+_0xf4fd('0x2a')][_0x5bfad5[_0xf4fd('0x15')]['id']];};exports[_0xf4fd('0x2c')]=writeLog; \ No newline at end of file +var _0xb3ab=['../../../../../config/environment','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','emit','user:save','split','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','some','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','writeLog','lodash','util','../utils'];(function(_0x2f3b31,_0xf0d4a9){var _0x1a3f46=function(_0x861975){while(--_0x861975){_0x2f3b31['push'](_0x2f3b31['shift']());}};_0x1a3f46(++_0xf0d4a9);}(_0xb3ab,0x10b));var _0xbb3a=function(_0x14476b,_0xd1a7a4){_0x14476b=_0x14476b-0x0;var _0x24e2e8=_0xb3ab[_0x14476b];return _0x24e2e8;};'use strict';var _=require(_0xbb3a('0x0'));var util=require(_0xbb3a('0x1'));var utils=require(_0xbb3a('0x2'));var Redis=require('ioredis');var config=require(_0xbb3a('0x3'));var logger=require('../../../../../config/logger')(_0xbb3a('0x4'));config[_0xbb3a('0x5')]=_[_0xbb3a('0x6')](config[_0xbb3a('0x5')],{'host':_0xbb3a('0x7'),'port':0x18eb});var io=require(_0xbb3a('0x8'))(new Redis(config[_0xbb3a('0x5')]));function sendNotification(_0x5cf3fb,_0x58b283,_0x534f64,_0x4bbfbf,_0x4ed973,_0x527640){io['to'](util[_0xbb3a('0x9')](_0xbb3a('0xa'),_0x4bbfbf['name']))[_0xbb3a('0xb')](_0xbb3a('0xc'),_0x4bbfbf);var _0x4aae04=_0x527640||{};var _0x140947=_0x534f64[_0xbb3a('0xd')]('.');var _0x219e24={'uniqueid':_0x58b283,'channel':_0x140947[0x0],'id':_0x140947[0x1],'title':_0x140947[0x0]+'\x20interaction','interactionId':_0x140947[0x2],'queue':_0x4ed973?_0x4ed973[_0xbb3a('0xe')]:null,'sound':_0x4aae04[_0xbb3a('0xf')][_0xbb3a('0x10')],'shake':_0x4aae04[_0xbb3a('0xf')][_0xbb3a('0x11')]};try{if(!_0x4aae04[_0xbb3a('0x12')]){_0x4aae04[_0xbb3a('0x12')]={};}if(_0x4ed973){_0x4aae04['body'][_0xbb3a('0x13')]=_0x4ed973;}else if(_0x4aae04[_0xbb3a('0x12')]['queue']){delete _0x4aae04[_0xbb3a('0x12')][_0xbb3a('0x13')];}_0x219e24[_0xbb3a('0x14')]=utils[_0xbb3a('0x15')](_0x4aae04[_0xbb3a('0xf')][_0xbb3a('0x16')],_0x4aae04);}catch(_0x4718ce){_0x219e24[_0xbb3a('0x14')]=_0xbb3a('0x17');logger['error'](util[_0xbb3a('0x9')](_0xbb3a('0x18'),_0x58b283,_0x4718ce[_0xbb3a('0x19')]));}io['to'](util[_0xbb3a('0x9')](_0xbb3a('0xa'),_0x4bbfbf[_0xbb3a('0xe')]))[_0xbb3a('0xb')](util[_0xbb3a('0x9')](_0xbb3a('0x1a'),_0x5cf3fb?_0xbb3a('0x1b'):'remove'),_0x219e24);}function writeLog(_0x51d6c2,_0x5540ab,_0x299db2){return logger['debug'](util[_0xbb3a('0x9')](_0xbb3a('0x1c'),_0x51d6c2,_0x5540ab[_0xbb3a('0xe')],_0x299db2));}exports[_0xbb3a('0x1d')]=function(_0x3cf6dc,_0x4f272e,_0x20281e,_0xd15bd6){if(_0x4f272e[_0xbb3a('0x1e')]){writeLog(_0x3cf6dc,_0x4f272e,_0xbb3a('0x1f'));return![];}if(!_0x4f272e[_0xbb3a('0x20')]){writeLog(_0x3cf6dc,_0x4f272e,'OFFLINE');return![];}if(_0x4f272e[_0x20281e+_0xbb3a('0x21')]){writeLog(_0x3cf6dc,_0x4f272e,_0xbb3a('0x22'));return![];}if(_0xd15bd6&&_0x4f272e[_0xbb3a('0x23')](_0x20281e+_0xbb3a('0x24'))&&_0x4f272e[_0xbb3a('0x23')](_0x20281e+_0xbb3a('0x25'))){if(_0x4f272e[_0x20281e+_0xbb3a('0x24')]>0x0&&_0x4f272e[_0x20281e+_0xbb3a('0x25')]>=_0x4f272e[_0x20281e+_0xbb3a('0x24')]){writeLog(_0x3cf6dc,_0x4f272e,_0x20281e[_0xbb3a('0x26')]()+_0xbb3a('0x27'));return![];}}return!![];};exports[_0xbb3a('0x28')]=function(_0x467cb1,_0x57190f,_0xe0b72c,_0x9736ac,_0x3f86f3){return sendNotification(!![],_0x467cb1,_0x57190f,_0xe0b72c,_0x9736ac,_0x3f86f3);};exports[_0xbb3a('0x29')]=function(_0x40bec5,_0x26c93f,_0x1be95a,_0x180660,_0x44dd3e){return sendNotification(![],_0x40bec5,_0x26c93f,_0x1be95a,_0x180660,_0x44dd3e);};exports[_0xbb3a('0x2a')]=function(_0x13c554,_0x249d33,_0x22d51c){var _0x2479bd=_0x249d33[_0xbb3a('0x2b')][_0xbb3a('0x2c')];if(!_0x2479bd&&_0x22d51c){_0x2479bd=_0x22d51c['id'];}var _0x258b18=_[_0xbb3a('0x2d')](_0x13c554[_0x249d33[_0xbb3a('0x2e')]+_0xbb3a('0x2f')],function(_0x175ebb){var _0x5ecc1e=_[_0xbb3a('0x30')](_0x249d33[_0xbb3a('0x2e')])+_0xbb3a('0x31');return _0x175ebb[_0x5ecc1e]===_0x249d33[_0xbb3a('0x2b')]['id'];});if(!_0x258b18&&_0x2479bd){_0x258b18=_[_0xbb3a('0x2d')](_0x13c554[_0xbb3a('0x32')][_0x2479bd][_0x249d33[_0xbb3a('0x2e')]+_0xbb3a('0x33')],function(_0xd01ace){return _0xd01ace['id']===_0x249d33[_0xbb3a('0x2b')]['id'];});}return _0x258b18;};exports[_0xbb3a('0x34')]=function(_0x10e324,_0x5bf878,_0x37fefe,_0x37a426){_0x10e324[_0xbb3a('0x32')][_0x37fefe['id']][_0x37a426+'WaitingInteractions'][_0x5bf878[_0xbb3a('0x19')]['id']]={'id':_0x5bf878[_0xbb3a('0x2b')]['id']};};exports['removeWaitingNotification']=function(_0x20cc84,_0x35709b,_0x17ff6d,_0x1da012){delete _0x20cc84['agents'][_0x17ff6d['id']][_0x1da012+'WaitingInteractions'][_0x35709b[_0xbb3a('0x19')]['id']];};exports[_0xbb3a('0x35')]=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 8e31156..9619362 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 _0x8fe0=['isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s'];(function(_0x309e57,_0xe1c277){var _0x313c98=function(_0x2e6cd6){while(--_0x2e6cd6){_0x309e57['push'](_0x309e57['shift']());}};_0x313c98(++_0xe1c277);}(_0x8fe0,0x1ab));var _0x08fe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8fe0[_0x17d9e3];return _0x14192d;};'use strict';var schema=require(_0x08fe('0x0'));var sh=require(_0x08fe('0x1'));var _=require(_0x08fe('0x2'));var utils=require(_0x08fe('0x3'));var logger=require(_0x08fe('0x4'))(_0x08fe('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x08fe('0x6')}});exports[_0x08fe('0x7')]=function(_0x4a1d36,_0x522f31){return function(_0x2c9c33){try{var _0x2fccb5={'command':_0x522f31[0x0]};var _0x492d9b=system[_0x08fe('0x0')](_0x2fccb5,{'typecast':!![]});if(_0x492d9b[_0x08fe('0x8')]){logger[_0x08fe('0x9')]('[%s][SYSTEM]\x20%s',_0x4a1d36,_['map'](_0x492d9b,'message')['join'](',\x20'));logger[_0x08fe('0xa')](_0x08fe('0xb'),_0x4a1d36);_0x2c9c33[_0x08fe('0xc')]();}else{var _0x1a7f22=this;var _0x3f31d6=utils[_0x08fe('0xd')](_0x522f31[0x0],this);logger['info'](_0x08fe('0xe'),_0x4a1d36,_0x3f31d6);sh[_0x08fe('0xf')](_[_0x08fe('0x10')](_0x3f31d6),function(_0x343bc2,_0x2f2b1e){logger[_0x08fe('0xa')](_0x08fe('0x11'),_0x4a1d36,_0x343bc2);if(_0x343bc2==0x0){var _0x5094fc=_0x2f2b1e[_0x08fe('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x522f31[0x1])||_[_0x08fe('0x13')](_0x522f31[0x1])){logger[_0x08fe('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x4a1d36);_0x1a7f22[_0x08fe('0x14')][_0x522f31[0x1]]=_0x5094fc;}else{logger[_0x08fe('0xa')](_0x08fe('0x15'),_0x4a1d36,_0x522f31[0x1],_0x5094fc);_0x1a7f22['body'][_0x522f31[0x1]]=_0x5094fc;}}_0x2c9c33[_0x08fe('0xc')]();});}}catch(_0x24fc60){logger['error'](_0x08fe('0x16'),_0x4a1d36,_[_0x08fe('0x17')](_0x24fc60)?JSON[_0x08fe('0x18')](_0x24fc60):_0x24fc60);logger[_0x08fe('0xa')](_0x08fe('0xb'),_0x4a1d36);_0x2c9c33[_0x08fe('0xc')]();}};}; \ No newline at end of file +var _0xecc5=['message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xecc5,0x96));var _0x5ecc=function(_0x104c14,_0x4586ee){_0x104c14=_0x104c14-0x0;var _0x391ab4=_0xecc5[_0x104c14];return _0x391ab4;};'use strict';var schema=require(_0x5ecc('0x0'));var sh=require('shelljs');var _=require(_0x5ecc('0x1'));var utils=require(_0x5ecc('0x2'));var logger=require(_0x5ecc('0x3'))(_0x5ecc('0x4'));var system=schema({'command':{'type':_0x5ecc('0x5'),'required':!![],'message':_0x5ecc('0x6')}});exports[_0x5ecc('0x7')]=function(_0xbb7b14,_0x17e2fe){return function(_0x17f466){try{var _0xb516eb={'command':_0x17e2fe[0x0]};var _0x47ae8f=system[_0x5ecc('0x0')](_0xb516eb,{'typecast':!![]});if(_0x47ae8f[_0x5ecc('0x8')]){logger[_0x5ecc('0x9')](_0x5ecc('0xa'),_0xbb7b14,_[_0x5ecc('0xb')](_0x47ae8f,_0x5ecc('0xc'))['join'](',\x20'));logger[_0x5ecc('0xd')](_0x5ecc('0xe'),_0xbb7b14);_0x17f466['next']();}else{var _0x4d57bb=this;var _0x4447aa=utils[_0x5ecc('0xf')](_0x17e2fe[0x0],this);logger[_0x5ecc('0xd')](_0x5ecc('0x10'),_0xbb7b14,_0x4447aa);sh[_0x5ecc('0x11')](_[_0x5ecc('0x12')](_0x4447aa),function(_0x2f8ad3,_0x4ffe2d){logger[_0x5ecc('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xbb7b14,_0x2f8ad3);if(_0x2f8ad3==0x0){var _0x2c4340=_0x4ffe2d[_0x5ecc('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x5ecc('0x14')](_0x17e2fe[0x1])||_[_0x5ecc('0x15')](_0x17e2fe[0x1])){logger[_0x5ecc('0xd')](_0x5ecc('0x16'),_0xbb7b14);_0x4d57bb['body'][_0x17e2fe[0x1]]=_0x2c4340;}else{logger[_0x5ecc('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0xbb7b14,_0x17e2fe[0x1],_0x2c4340);_0x4d57bb[_0x5ecc('0x17')][_0x17e2fe[0x1]]=_0x2c4340;}}_0x17f466[_0x5ecc('0x18')]();});}}catch(_0x3dec16){logger[_0x5ecc('0x9')](_0x5ecc('0xa'),_0xbb7b14,_[_0x5ecc('0x19')](_0x3dec16)?JSON[_0x5ecc('0x1a')](_0x3dec16):_0x3dec16);logger['info'](_0x5ecc('0xe'),_0xbb7b14);_0x17f466[_0x5ecc('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index bba1685..36880df 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 _0x3626=['isObject','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','finally'];(function(_0x5a8968,_0x5826bc){var _0x2a1ea8=function(_0x3c7585){while(--_0x3c7585){_0x5a8968['push'](_0x5a8968['shift']());}};_0x2a1ea8(++_0x5826bc);}(_0x3626,0xd1));var _0x6362=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3626[_0x501510];return _0x1e6ee5;};'use strict';var schema=require('validate');var _=require(_0x6362('0x0'));var rpc={'chatInteraction':require(_0x6362('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x6362('0x2')),'faxInteraction':require(_0x6362('0x3')),'whatsappInteraction':require(_0x6362('0x4'))};var logger=require(_0x6362('0x5'))('routing');var tag=schema({'tag':{'type':_0x6362('0x6'),'required':!![],'message':_0x6362('0x7')}});exports[_0x6362('0x8')]=function(_0x34dd0d,_0x2c2a56,_0x163cff,_0x18dcb4){return function(_0x2ebe5d){try{var _0x3168a4={'tag':_0x2c2a56[0x0]};var _0x1ac64d=tag['validate'](_0x3168a4,{'typecast':!![]});if(_0x1ac64d['length']){logger[_0x6362('0x9')]('[%s][TAG]\x20%s',_0x34dd0d,_[_0x6362('0xa')](_0x1ac64d,'message')[_0x6362('0xb')](',\x20'));logger[_0x6362('0xc')](_0x6362('0xd'),_0x34dd0d);_0x2ebe5d[_0x6362('0xe')]();}else{var _0x362944={'ids':[_0x2c2a56[0x0]]};if(rpc[_0x18dcb4[_0x6362('0xf')]+_0x6362('0x10')]){rpc[_0x18dcb4['channel']+'Interaction'][_0x6362('0x11')](_0x18dcb4['interaction']['id'],_0x362944)[_0x6362('0x12')](function(_0x4d2111){logger[_0x6362('0xc')](_0x6362('0x13'),_0x34dd0d,_0x2c2a56[0x1],_0x18dcb4[_0x6362('0xf')],_0x18dcb4[_0x6362('0x14')]['id']);})[_0x6362('0x15')](function(_0x46bea1){logger[_0x6362('0x9')](_0x6362('0x16'),_0x34dd0d,JSON[_0x6362('0x17')](_0x46bea1));logger[_0x6362('0xc')](_0x6362('0xd'),_0x34dd0d);})[_0x6362('0x18')](function(){_0x2ebe5d['next']();});}}}catch(_0x55f59c){logger['error'](_0x6362('0x16'),_0x34dd0d,_[_0x6362('0x19')](_0x55f59c)?JSON['stringify'](_0x55f59c):_0x55f59c);logger[_0x6362('0xc')](_0x6362('0xd'),_0x34dd0d);_0x2ebe5d['next']();}};}; \ No newline at end of file +var _0x0ef2=['length','[%s][TAG]\x20%s','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x29640a,_0x2b04a9){var _0x485fc0=function(_0x22ee35){while(--_0x22ee35){_0x29640a['push'](_0x29640a['shift']());}};_0x485fc0(++_0x2b04a9);}(_0x0ef2,0xe8));var _0x20ef=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0x0ef2[_0x5bf2b3];return _0x5e8a9b;};'use strict';var schema=require(_0x20ef('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x20ef('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x20ef('0x2')),'mailInteraction':require(_0x20ef('0x3')),'faxInteraction':require(_0x20ef('0x4')),'whatsappInteraction':require(_0x20ef('0x5'))};var logger=require(_0x20ef('0x6'))(_0x20ef('0x7'));var tag=schema({'tag':{'type':_0x20ef('0x8'),'required':!![],'message':_0x20ef('0x9')}});exports[_0x20ef('0xa')]=function(_0x4dcb55,_0x35f5bd,_0x4a5d0,_0x2df81d){return function(_0x5511eb){try{var _0xe0f04c={'tag':_0x35f5bd[0x0]};var _0x37bf37=tag['validate'](_0xe0f04c,{'typecast':!![]});if(_0x37bf37[_0x20ef('0xb')]){logger['error'](_0x20ef('0xc'),_0x4dcb55,_[_0x20ef('0xd')](_0x37bf37,_0x20ef('0xe'))['join'](',\x20'));logger['info'](_0x20ef('0xf'),_0x4dcb55);_0x5511eb[_0x20ef('0x10')]();}else{var _0x4a1b35={'ids':[_0x35f5bd[0x0]]};if(rpc[_0x2df81d[_0x20ef('0x11')]+_0x20ef('0x12')]){rpc[_0x2df81d['channel']+_0x20ef('0x12')]['addTags'](_0x2df81d[_0x20ef('0x13')]['id'],_0x4a1b35)[_0x20ef('0x14')](function(_0x5eed1a){logger[_0x20ef('0x15')](_0x20ef('0x16'),_0x4dcb55,_0x35f5bd[0x1],_0x2df81d['channel'],_0x2df81d['interaction']['id']);})[_0x20ef('0x17')](function(_0x2b4a52){logger[_0x20ef('0x18')]('[%s][TAG]\x20%s',_0x4dcb55,JSON[_0x20ef('0x19')](_0x2b4a52));logger[_0x20ef('0x15')](_0x20ef('0xf'),_0x4dcb55);})[_0x20ef('0x1a')](function(){_0x5511eb[_0x20ef('0x10')]();});}}}catch(_0x51c888){logger[_0x20ef('0x18')](_0x20ef('0xc'),_0x4dcb55,_['isObject'](_0x51c888)?JSON['stringify'](_0x51c888):_0x51c888);logger[_0x20ef('0x15')](_0x20ef('0xf'),_0x4dcb55);_0x5511eb[_0x20ef('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 1fe9068..5824f4d 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 _0x4b3a=['POST','then','parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','lodash','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','method','login','params','stringify','utf8'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0x4b3a,0x190));var _0xa4b3=function(_0x2a9e27,_0x1494d9){_0x2a9e27=_0x2a9e27-0x0;var _0x4f1599=_0x4b3a[_0x2a9e27];return _0x4f1599;};'use strict';var rp=require(_0xa4b3('0x0'));var logger=require(_0xa4b3('0x1'))(_0xa4b3('0x2'));var _=require(_0xa4b3('0x3'));var arr=[];exports['consequence']=function(_0x3b5554,_0x15c01b){return function(_0x17135d){var _0x4564b1=_0x15c01b[0xa];var _0x20d769=_0x15c01b[0xb];var _0x1a3e86=_0x15c01b[0xc];var _0x170056=_0x15c01b[0xd];var _0x4dfc16=_0x15c01b[0xe];var _0x49c8e8=_0x15c01b[0xf][_0xa4b3('0x4')](/\n/g,_0xa4b3('0x5'));var _0x34512a=_0x15c01b[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x20d769)){arr[_0xa4b3('0x6')](_0x20d769);var _0x46dec7=_0x15c01b[0x3];var _0x50e012=_0x15c01b[0x4];var _0x454228=_0x15c01b[0x1];var _0x333a36=_0x15c01b[0x0];var _0x10a68a={};_0x10a68a[_0xa4b3('0x7')]=_0x15c01b[0x8]+_0xa4b3('0x8')+_0x1a3e86+'|'+_0x4564b1+'|'+_0x170056+'|'+_0x20d769+'|'+_0x4dfc16;_0x10a68a[_0xa4b3('0x9')]=_0x15c01b[0x7]+_0xa4b3('0x8')+_0x1a3e86+'|'+_0x4564b1+'|'+_0x170056+'|'+_0x20d769+'|'+_0x4dfc16+'|'+_0x49c8e8+'|'+_0x34512a;_0x10a68a[_0xa4b3('0xa')]=_0x15c01b[0x9];var _0x3a28d5={};_0x3a28d5['jsonrpc']='2.0';_0x3a28d5[_0xa4b3('0xb')]=_0xa4b3('0xc');var _0x1b945f=[];_0x1b945f[_0xa4b3('0x6')](_0x15c01b[0x2]);_0x1b945f[_0xa4b3('0x6')](_0x15c01b[0x5]);_0x1b945f['push'](_0x15c01b[0x6]);_0x3a28d5[_0xa4b3('0xd')]=_0x1b945f;_0x3a28d5['id']=0x1;var _0x1b67e8=JSON[_0xa4b3('0xe')](_0x3a28d5);var _0x548774={'encoding':_0xa4b3('0xf'),'method':_0xa4b3('0x10'),'timeout':0x2710,'url':_0x46dec7,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1b67e8};return rp(_0x548774)[_0xa4b3('0x11')](function(_0x11d5c4){const _0x55ce28=JSON[_0xa4b3('0x12')](_0x11d5c4);if(!_0x55ce28['result'][_0xa4b3('0x13')]){throw new Error(_0xa4b3('0x14'));}var _0x140f7e=_0x20d769;var _0x4ee5c6=_0xa4b3('0x15')+_0x454228+_0xa4b3('0x16')+_0x333a36+_0xa4b3('0x17')+_0x140f7e+_0xa4b3('0x18')+JSON[_0xa4b3('0xe')](_0x10a68a);var _0xffe881=_0x50e012+'?'+_0x4ee5c6;return rp(_0xffe881);})[_0xa4b3('0x11')](function(_0x3fc07d){logger['info'](_0xa4b3('0x19'),_0x3b5554,_0x3fc07d);_0x17135d[_0xa4b3('0x1a')]();})[_0xa4b3('0x1b')](function(_0x5d1998){logger[_0xa4b3('0x1c')](_0xa4b3('0x1d'),_0x3b5554,_[_0xa4b3('0x1e')](_0x5d1998)?JSON['stringify'](_0x5d1998):_0x5d1998);_0x17135d[_0xa4b3('0x1a')]();});}else{logger['info'](_0xa4b3('0x1f'),_0x3b5554);_0x17135d['next']();}};}; \ No newline at end of file +var _0xfacf=['channelId=','&serviceId=','&sessionId=','info','stop','catch','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','2.0','method','params','stringify','utf8','application/json-rpc','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application'];(function(_0x545aad,_0x53365d){var _0x49d312=function(_0x3b13d4){while(--_0x3b13d4){_0x545aad['push'](_0x545aad['shift']());}};_0x49d312(++_0x53365d);}(_0xfacf,0x165));var _0xffac=function(_0x2d8ec6,_0x8cdec7){_0x2d8ec6=_0x2d8ec6-0x0;var _0xcd7bb3=_0xfacf[_0x2d8ec6];return _0xcd7bb3;};'use strict';var rp=require('request-promise');var logger=require(_0xffac('0x0'))('routing');var _=require(_0xffac('0x1'));var arr=[];exports[_0xffac('0x2')]=function(_0x2ac92c,_0x16936c){return function(_0x25183f){var _0x8514e1=_0x16936c[0xa];var _0x48719a=_0x16936c[0xb];var _0x1af160=_0x16936c[0xc];var _0x4f860f=_0x16936c[0xd];var _0xc9e71b=_0x16936c[0xe];var _0x5c1c6b=_0x16936c[0xf][_0xffac('0x3')](/\n/g,'\x20-\x20');var _0x1f8a07=_0x16936c[0x10][_0xffac('0x3')](/\n/g,'\x20');if(!arr[_0xffac('0x4')](_0x48719a)){arr[_0xffac('0x5')](_0x48719a);var _0x26c800=_0x16936c[0x3];var _0x3a4dfc=_0x16936c[0x4];var _0x4c35a7=_0x16936c[0x1];var _0x34c393=_0x16936c[0x0];var _0x5cf224={};_0x5cf224[_0xffac('0x6')]=_0x16936c[0x8]+_0xffac('0x7')+_0x1af160+'|'+_0x8514e1+'|'+_0x4f860f+'|'+_0x48719a+'|'+_0xc9e71b;_0x5cf224[_0xffac('0x8')]=_0x16936c[0x7]+_0xffac('0x7')+_0x1af160+'|'+_0x8514e1+'|'+_0x4f860f+'|'+_0x48719a+'|'+_0xc9e71b+'|'+_0x5c1c6b+'|'+_0x1f8a07;_0x5cf224[_0xffac('0x9')]=_0x16936c[0x9];var _0x5f50a2={};_0x5f50a2['jsonrpc']=_0xffac('0xa');_0x5f50a2[_0xffac('0xb')]='login';var _0xa68936=[];_0xa68936['push'](_0x16936c[0x2]);_0xa68936['push'](_0x16936c[0x5]);_0xa68936[_0xffac('0x5')](_0x16936c[0x6]);_0x5f50a2[_0xffac('0xc')]=_0xa68936;_0x5f50a2['id']=0x1;var _0x37d565=JSON[_0xffac('0xd')](_0x5f50a2);var _0x1a2b64={'encoding':_0xffac('0xe'),'method':'POST','timeout':0x2710,'url':_0x26c800,'headers':{'Content-Type':_0xffac('0xf')},'body':_0x37d565};return rp(_0x1a2b64)[_0xffac('0x10')](function(_0x426515){const _0x7012d=JSON['parse'](_0x426515);if(!_0x7012d[_0xffac('0x11')][_0xffac('0x12')]){throw new Error(_0xffac('0x13'));}var _0x158d09=_0x48719a;var _0x20217b=_0xffac('0x14')+_0x4c35a7+_0xffac('0x15')+_0x34c393+_0xffac('0x16')+_0x158d09+'&data='+JSON[_0xffac('0xd')](_0x5cf224);var _0x3e9933=_0x3a4dfc+'?'+_0x20217b;return rp(_0x3e9933);})[_0xffac('0x10')](function(_0x236f02){logger[_0xffac('0x17')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2ac92c,_0x236f02);_0x25183f[_0xffac('0x18')]();})[_0xffac('0x19')](function(_0x567825){logger[_0xffac('0x1a')](_0xffac('0x1b'),_0x2ac92c,_['isObject'](_0x567825)?JSON[_0xffac('0xd')](_0x567825):_0x567825);_0x25183f['stop']();});}else{logger[_0xffac('0x17')](_0xffac('0x1c'),_0x2ac92c);_0x25183f['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 f2db7cb..7342d8b 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1903c5,_0xe806e5){var _0xe52a82=function(_0x383fd9){while(--_0x383fd9){_0x1903c5['push'](_0x1903c5['shift']());}};_0xe52a82(++_0xe806e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1b04ab,_0x277fbd){var _0x58990d=function(_0xc6bca){while(--_0xc6bca){_0x1b04ab['push'](_0x1b04ab['shift']());}};_0x58990d(++_0x277fbd);}(_0xe706,0xa3));var _0x6e70=function(_0x52195d,_0x52e4fd){_0x52195d=_0x52195d-0x0;var _0x522e83=_0xe706[_0x52195d];return _0x522e83;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 7bfaeb1..31c1836 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 _0x1dc4=['execute','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','error','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','catch','error\x20update\x20queue\x20report','busyQueue','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','values','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','channel','message','interaction','checkWaitingNotifications','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','dialogflow','dialogflowv2','slice','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','%s:%s:%s','./interval','condition','consequence','priority','info','Push\x20new\x20rule','intervals','\x20|\x20','rules'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1dc4,0x97));var _0x41dc=function(_0x321b11,_0x5177da){_0x321b11=_0x321b11-0x0;var _0x107803=_0x1dc4[_0x321b11];return _0x107803;};'use strict';var _=require(_0x41dc('0x0'));var util=require(_0x41dc('0x1'));var path=require(_0x41dc('0x2'));var fs=require('fs');var jayson=require(_0x41dc('0x3'));var BPromise=require('bluebird');var utils=require(_0x41dc('0x4'));var sUtils=require(_0x41dc('0x5'));var logger=require(_0x41dc('0x6'))(_0x41dc('0x7'));var rpc={'openchannelQueueReport':require(_0x41dc('0x8')),'mailQueueReport':require(_0x41dc('0x9')),'chatQueueReport':require(_0x41dc('0xa')),'smsQueueReport':require(_0x41dc('0xb')),'faxQueueReport':require(_0x41dc('0xc')),'whatsappQueueReport':require(_0x41dc('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4129ba,_0x47d014,_0x4bfc96){return util[_0x41dc('0xe')](_0x41dc('0xf'),_0x4129ba,_0x47d014||0x0,_0x4bfc96||0x0);}function getIntervals(_0x42ebd4,_0x1ac4b8){var _0x33336e=[];if(!_[_0x41dc('0x10')](_0x1ac4b8['IntervalId'])&&!_[_0x41dc('0x10')](_0x42ebd4[_0x1ac4b8['IntervalId']])&&!_[_0x41dc('0x10')](_0x42ebd4[_0x1ac4b8[_0x41dc('0x11')]][_0x41dc('0x12')])){_0x33336e=_[_0x41dc('0x13')](_0x42ebd4[_0x1ac4b8['IntervalId']][_0x41dc('0x12')],'interval');}else if(!_[_0x41dc('0x10')](_0x1ac4b8[_0x41dc('0x14')])){_0x33336e=[_0x1ac4b8[_0x41dc('0x14')]];}return _0x33336e;}exports['listen']=function(_0x219dd0){_0x219dd0['rules']={};return new BPromise(function(_0x30ac40,_0x375e1f){var _0x5d15ee={'Start':function(_0xa8c73e){var _0x31b880=this;return new Promise(function(_0x229703,_0x112de5){if(_0xa8c73e){try{var _0x40f150=[];var _0x1129f1=getId(_0xa8c73e[_0x41dc('0x15')],_0xa8c73e[_0x41dc('0x16')]?_0xa8c73e['message']['id']:0x0,_0xa8c73e[_0x41dc('0x17')]?_0xa8c73e[_0x41dc('0x17')]['id']:0x0);var _0x1feddb=sUtils[_0x41dc('0x18')](_0x219dd0,_0xa8c73e);if(!_0x1feddb&&_0xa8c73e[_0x41dc('0x19')]&&_[_0x41dc('0x1a')](_0xa8c73e[_0x41dc('0x19')])&&_0xa8c73e[_0x41dc('0x19')][_0x41dc('0x1b')]){for(var _0x3d944d=0x0;_0x3d944d<_0xa8c73e['applications'][_0x41dc('0x1b')];_0x3d944d+=0x1){var _0x3d715f=_0xa8c73e[_0x41dc('0x19')][_0x3d944d];if(fs[_0x41dc('0x1c')](path[_0x41dc('0x1d')](__dirname,_0x41dc('0x19'),_0x3d715f[_0x41dc('0x1e')]+_0x41dc('0x1f')))){var _0x48f165=[];switch(_0x3d715f[_0x41dc('0x1e')][_0x41dc('0x20')]()){case _0x41dc('0x21'):var _0x3726a0=_0x3d715f[_0x41dc('0x22')][_0x41dc('0x23')](',');if(_0xa8c73e[_0x41dc('0x15')]==='mail'){_0x48f165[_0x41dc('0x24')](_0x3726a0[0x0]);_0x48f165['push'](_0x3726a0[0x1]);_0x48f165[_0x41dc('0x24')](_0x3726a0['slice'](0x2,_0x3726a0[_0x41dc('0x1b')])[_0x41dc('0x1d')](','));}else{_0x48f165['push'](_0x3726a0[0x0]);_0x48f165['push'](_0x3726a0['slice'](0x1,_0x3726a0[_0x41dc('0x1b')])[_0x41dc('0x1d')](','));}break;case _0x41dc('0x25'):var _0xde6a1f=_0x3d715f[_0x41dc('0x22')][_0x41dc('0x23')](',');_0x48f165[_0x41dc('0x24')](_0xde6a1f[0x0]);_0x48f165[_0x41dc('0x24')](_0xde6a1f[0x1]);_0x48f165['push'](_0xde6a1f['slice'](0x2,_0xde6a1f[_0x41dc('0x1b')])[_0x41dc('0x1d')](','));break;case _0x41dc('0x26'):var _0x26ca94=_0x3d715f[_0x41dc('0x22')][_0x41dc('0x23')](',');_0x48f165[_0x41dc('0x24')](_0x26ca94[0x0]);_0x48f165['push'](_0x26ca94[0x1]);_0x48f165[_0x41dc('0x24')](_0x26ca94[0x2]);_0x48f165['push'](_0x26ca94[0x3]);_0x48f165['push'](_0x26ca94[_0x41dc('0x27')](0x4,_0x26ca94['length'])[_0x41dc('0x1d')](','));break;case _0x41dc('0x28'):var _0x44c96d=_0x3d715f[_0x41dc('0x22')][_0x41dc('0x23')](',');_0x48f165[_0x41dc('0x24')](_0x44c96d[0x0]);_0x48f165[_0x41dc('0x24')](_0x44c96d[0x1]);_0x48f165[_0x41dc('0x24')](_0x44c96d[0x2]);_0x48f165[_0x41dc('0x24')](_0x44c96d[0x3]);_0x48f165[_0x41dc('0x24')](_0x44c96d[_0x41dc('0x27')](0x4,_0x44c96d[_0x41dc('0x1b')])[_0x41dc('0x1d')](','));break;case _0x41dc('0x16'):_0x48f165[_0x41dc('0x24')](_0x3d715f[_0x41dc('0x22')]);break;case _0x41dc('0x29'):_0x48f165[_0x41dc('0x24')](_0x3d715f[_0x41dc('0x2a')]);_0x48f165[_0x41dc('0x24')](_0x3d715f['appdata']);break;case _0x41dc('0x2b'):var _0x281368=utils[_0x41dc('0x2c')](_0xa8c73e[_0x41dc('0x2d')][_0x41dc('0x2e')],_0xa8c73e);var _0x2f4d84=_0x3d715f['appdata'][_0x41dc('0x23')](',');_0x48f165['push'](_0x2f4d84[0x0]);_0x48f165['push'](_0x2f4d84[0x1]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x2]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x3]);_0x48f165['push'](_0x2f4d84[0x4]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x5]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x6]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x7]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x8]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0x9]);_0x48f165[_0x41dc('0x24')](_0x2f4d84[0xa]);_0x48f165[_0x41dc('0x24')](_0xa8c73e['interaction']['id']);_0x48f165[_0x41dc('0x24')](_0xa8c73e[_0x41dc('0x16')]['id']);_0x48f165['push'](_0x3d715f[_0x41dc('0x2f')]);_0x48f165[_0x41dc('0x24')](_0xa8c73e[_0x41dc('0x17')][_0x41dc('0x30')]);_0x48f165['push'](_0xa8c73e['body']['body']);_0x48f165['push'](_0x281368);break;default:_0x48f165=_['isNil'](_0x3d715f['appdata'])?[]:_0x3d715f[_0x41dc('0x22')][_0x41dc('0x23')](',');}var _0x489bf9={'id':util[_0x41dc('0xe')](_0x41dc('0x31'),_0x1129f1,_0x3d715f['id'],_0x3d715f[_0x41dc('0x1e')]),'condition':require(_0x41dc('0x32'))[_0x41dc('0x33')](_0x1129f1,getIntervals(_0x219dd0['intervals'],_0x3d715f),_0x219dd0),'consequence':require('./applications/'+_0x3d715f[_0x41dc('0x1e')])[_0x41dc('0x34')](_0x1129f1,_0x48f165,_0x219dd0,_0xa8c73e),'p':_0x3d715f[_0x41dc('0x35')]||0x0};logger[_0x41dc('0x36')](_0x41dc('0x37'),_0x489bf9['id'],'on\x20interval',getIntervals(_0x219dd0[_0x41dc('0x38')],_0x3d715f)['join'](_0x41dc('0x39')));_0x40f150[_0x41dc('0x24')](_0x489bf9);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x41dc('0x1d')](__dirname,_0x41dc('0x19'),_0x3d715f[_0x41dc('0x1e')]+_0x41dc('0x1f')));}}_0x219dd0[_0x41dc('0x3a')][_0x1129f1]=new RuleEngine(_0x40f150);_0x219dd0[_0x41dc('0x3a')][_0x1129f1][_0x41dc('0x3b')](_0xa8c73e,function(_0x5e983b){logger[_0x41dc('0x36')](_0x41dc('0x3c'),JSON['stringify'](_0x5e983b[_0x41dc('0x3d')]));if(_0x219dd0['rules'][_0x1129f1]){_0x219dd0[_0x41dc('0x3a')][_0x1129f1][_0x41dc('0x3e')](_0x41dc('0x3f'));}});return _0x229703({'code':0xc8,'message':_0xa8c73e});}else{if(_0x1feddb){logger[_0x41dc('0x36')](util[_0x41dc('0xe')](_0x41dc('0x40'),_0x1129f1));}else{logger[_0x41dc('0x36')]('No\x20applications\x20to\x20execute');}return _0x229703({'code':0xc8,'message':_0xa8c73e});}}catch(_0x423b8d){logger['error'](_0x423b8d[_0x41dc('0x41')]);return _0x112de5(_0x31b880[_0x41dc('0x42')](0x1f4,_0x423b8d));}}return _0x112de5(_0x41dc('0x43'));});},'AcceptMessage':function(_0x4d53e8){var _0xa6fa29=this;return new Promise(function(_0x32591f,_0x31220b){if(_0x4d53e8[_0x41dc('0x44')]&&_0x4d53e8[_0x41dc('0x44')]['id']){if(_0x219dd0['agents'][_0x4d53e8[_0x41dc('0x44')]['id']]){_0x219dd0[_0x41dc('0x45')][_0x4d53e8[_0x41dc('0x44')]['id']][_0x41dc('0x46')]=![];_0x219dd0[_0x41dc('0x45')][_0x4d53e8['agent']['id']]['busyQueue']=undefined;}}if(_0x4d53e8[_0x41dc('0x16')]&&_0x4d53e8['message']['id']){try{var _0x499542=getId(_0x4d53e8[_0x41dc('0x15')],_0x4d53e8[_0x41dc('0x16')]?_0x4d53e8['message']['id']:0x0,_0x4d53e8[_0x41dc('0x17')]?_0x4d53e8[_0x41dc('0x17')]['id']:0x0);if(_0x219dd0[_0x41dc('0x3a')][_0x499542]){_0x219dd0[_0x41dc('0x3a')][_0x499542]['emit'](_0x41dc('0x47'));if(rpc[_0x4d53e8[_0x41dc('0x15')]+'QueueReport']){rpc[_0x4d53e8[_0x41dc('0x15')]+_0x41dc('0x48')]['update'](_0x499542,{'UserId':_0x4d53e8['message']['UserId']})[_0x41dc('0x49')](function(){logger['error'](_0x41dc('0x4a'));});}}return _0x32591f({'code':0xc8,'message':_0x4d53e8});}catch(_0x20bab5){logger[_0x41dc('0x42')](_0x20bab5[_0x41dc('0x41')]);return _0x31220b(_0xa6fa29[_0x41dc('0x42')](0x1f4,_0x20bab5));}}logger[_0x41dc('0x42')]('message\x20is\x20empty');return _0x31220b(_0xa6fa29['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x5e5f53){var _0x5504e7=this;return new Promise(function(_0x2a28e2,_0x1c9fd2){if(_0x5e5f53[_0x41dc('0x44')]&&_0x5e5f53['agent']['id']){try{if(_0x219dd0[_0x41dc('0x45')][_0x5e5f53[_0x41dc('0x44')]['id']]){_0x219dd0[_0x41dc('0x45')][_0x5e5f53[_0x41dc('0x44')]['id']]['busy']=![];_0x219dd0[_0x41dc('0x45')][_0x5e5f53[_0x41dc('0x44')]['id']][_0x41dc('0x4b')]=undefined;}return _0x2a28e2({'code':0xc8,'message':_0x5e5f53});}catch(_0x3bb9e2){logger[_0x41dc('0x42')](_0x3bb9e2[_0x41dc('0x41')]);return _0x1c9fd2(_0x5504e7['error'](0x1f4,_0x3bb9e2));}}logger[_0x41dc('0x42')]('message\x20is\x20empty');return _0x1c9fd2(_0x5504e7[_0x41dc('0x42')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5de4fc){var _0x1648bd=this;return new Promise(function(_0x2ebd8b,_0x35ac92){if(_0x5de4fc[_0x41dc('0x15')]&&_0x5de4fc[_0x41dc('0x17')]&&_0x5de4fc[_0x41dc('0x17')]['id']){try{var _0x3f9284=getId(_0x5de4fc[_0x41dc('0x15')],_0x5de4fc[_0x41dc('0x16')]?_0x5de4fc[_0x41dc('0x16')]['id']:0x0,_0x5de4fc[_0x41dc('0x17')]?_0x5de4fc[_0x41dc('0x17')]['id']:0x0);if(_0x219dd0['rules'][_0x3f9284]){_0x219dd0[_0x41dc('0x3a')][_0x3f9284][_0x41dc('0x3e')](_0x41dc('0x47'));}return _0x2ebd8b({'code':0xc8,'message':_0x5de4fc});}catch(_0x47ac1c){logger[_0x41dc('0x42')](_0x47ac1c[_0x41dc('0x41')]);return _0x35ac92(_0x1648bd[_0x41dc('0x42')](0x1f4,_0x47ac1c));}}logger[_0x41dc('0x42')](_0x41dc('0x4c'));return _0x35ac92(_0x1648bd[_0x41dc('0x42')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5b7edb){var _0x296614=this;return new Promise(function(_0x58a893,_0x523d0b){if(_0x219dd0['agents'][_0x41dc('0x4d')](_0x5b7edb['id'])){for(var _0x238078 in _0x5b7edb['capacity']){if(_0x5b7edb[_0x41dc('0x4e')][_0x41dc('0x4d')](_0x238078)){if(_0x219dd0[_0x41dc('0x45')][_0x5b7edb['id']][_0x41dc('0x4d')](_0x238078+_0x41dc('0x4f'))){_0x219dd0[_0x41dc('0x45')][_0x5b7edb['id']][_0x238078+_0x41dc('0x4f')]=parseInt(_0x5b7edb[_0x41dc('0x4e')][_0x238078],0xa);}}}_0x219dd0['agents'][_0x5b7edb['id']][_0x41dc('0x50')]();return _0x58a893({'code':0xc8,'message':_0x219dd0[_0x41dc('0x45')][_0x5b7edb['id']]});}else{return _0x523d0b(_0x296614[_0x41dc('0x42')](0x1f4,_0x41dc('0x51')));}});},'Agents':function(_0x255fe4){return new Promise(function(_0x5a62e5){var _0x6557ae=_['values'](_0x219dd0[_0x41dc('0x45')]);if(_0x255fe4&&_0x255fe4['id']){var _0x47f75c=_[_0x41dc('0x52')](_0x6557ae,function(_0x79f2cb){return _0x79f2cb['id']===_0x255fe4['id'];});_0x5a62e5(_0x47f75c);}else{_0x5a62e5({'count':_0x6557ae[_0x41dc('0x1b')],'rows':_0x6557ae});}});},'ChatQueues':function(){return new Promise(function(_0x5ec76b){var _0x59926e=[];for(var _0x4d5367 in _0x219dd0[_0x41dc('0x53')]){if(_0x219dd0['chatQueues']['hasOwnProperty'](_0x4d5367)){var _0x3194e8=_0x219dd0[_0x41dc('0x53')][_0x4d5367];var _0x116a77={'id':_0x3194e8['id'],'available':_0x3194e8[_0x41dc('0x54')],'loggedIn':_0x3194e8[_0x41dc('0x55')],'name':_0x3194e8[_0x41dc('0x56')],'paused':_0x3194e8[_0x41dc('0x57')],'waiting':_0x3194e8[_0x41dc('0x58')]};_0x59926e['push'](_0x116a77);}}_0x5ec76b({'count':_0x59926e['length'],'rows':_0x59926e});});},'MailQueues':function(){return new Promise(function(_0x3ef6af){var _0x346bc9=[];for(var _0x4a7bc1 in _0x219dd0[_0x41dc('0x59')]){if(_0x219dd0[_0x41dc('0x59')][_0x41dc('0x4d')](_0x4a7bc1)){var _0xe4ff4d=_0x219dd0[_0x41dc('0x59')][_0x4a7bc1];var _0x52838c={'id':_0xe4ff4d['id'],'available':_0xe4ff4d[_0x41dc('0x54')],'loggedIn':_0xe4ff4d[_0x41dc('0x55')],'name':_0xe4ff4d[_0x41dc('0x56')],'paused':_0xe4ff4d['paused'],'waiting':_0xe4ff4d[_0x41dc('0x58')]};_0x346bc9[_0x41dc('0x24')](_0x52838c);}}_0x3ef6af({'count':_0x346bc9[_0x41dc('0x1b')],'rows':_0x346bc9});});},'OpenchannelQueues':function(){return new Promise(function(_0x592185){var _0x46d946=[];for(var _0x65c21e in _0x219dd0[_0x41dc('0x5a')]){if(_0x219dd0[_0x41dc('0x5a')][_0x41dc('0x4d')](_0x65c21e)){var _0x1cf6f7=_0x219dd0[_0x41dc('0x5a')][_0x65c21e];var _0x1f80df={'id':_0x1cf6f7['id'],'available':_0x1cf6f7[_0x41dc('0x54')],'loggedIn':_0x1cf6f7[_0x41dc('0x55')],'name':_0x1cf6f7[_0x41dc('0x56')],'paused':_0x1cf6f7['paused'],'waiting':_0x1cf6f7[_0x41dc('0x58')]};_0x46d946[_0x41dc('0x24')](_0x1f80df);}}_0x592185({'count':_0x46d946[_0x41dc('0x1b')],'rows':_0x46d946});});},'SmsQueues':function(){return new Promise(function(_0xf05d73){var _0x1ac210=[];for(var _0x5b3a7f in _0x219dd0[_0x41dc('0x5b')]){if(_0x219dd0[_0x41dc('0x5b')]['hasOwnProperty'](_0x5b3a7f)){var _0x4c3f54=_0x219dd0[_0x41dc('0x5b')][_0x5b3a7f];var _0x23cd3c={'id':_0x4c3f54['id'],'available':_0x4c3f54[_0x41dc('0x54')],'loggedIn':_0x4c3f54[_0x41dc('0x55')],'name':_0x4c3f54['name'],'paused':_0x4c3f54[_0x41dc('0x57')],'waiting':_0x4c3f54[_0x41dc('0x58')]};_0x1ac210['push'](_0x23cd3c);}}_0xf05d73({'count':_0x1ac210[_0x41dc('0x1b')],'rows':_0x1ac210});});},'FaxQueues':function(){return new Promise(function(_0x106060){var _0x4b39b6=[];for(var _0x13b022 in _0x219dd0[_0x41dc('0x5c')]){if(_0x219dd0[_0x41dc('0x5c')][_0x41dc('0x4d')](_0x13b022)){var _0x3098ff=_0x219dd0[_0x41dc('0x5c')][_0x13b022];var _0x49fa8b={'id':_0x3098ff['id'],'available':_0x3098ff[_0x41dc('0x54')],'loggedIn':_0x3098ff[_0x41dc('0x55')],'name':_0x3098ff[_0x41dc('0x56')],'paused':_0x3098ff['paused'],'waiting':_0x3098ff['waiting']};_0x4b39b6[_0x41dc('0x24')](_0x49fa8b);}}_0x106060({'count':_0x4b39b6['length'],'rows':_0x4b39b6});});},'WhatsappQueues':function(){return new Promise(function(_0x5c23c2){var _0x48a3f5=[];for(var _0x446838 in _0x219dd0[_0x41dc('0x5d')]){if(_0x219dd0[_0x41dc('0x5d')]['hasOwnProperty'](_0x446838)){var _0x39256d=_0x219dd0[_0x41dc('0x5d')][_0x446838];var _0x40b5ff={'id':_0x39256d['id'],'available':_0x39256d['available'],'loggedIn':_0x39256d[_0x41dc('0x55')],'name':_0x39256d[_0x41dc('0x56')],'paused':_0x39256d[_0x41dc('0x57')],'waiting':_0x39256d[_0x41dc('0x58')]};_0x48a3f5['push'](_0x40b5ff);}}_0x5c23c2({'count':_0x48a3f5['length'],'rows':_0x48a3f5});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x240066){var _0x21d665=_['values'](_0x219dd0[_0x41dc('0x5e')]);_0x240066({'count':_0x21d665[_0x41dc('0x1b')],'rows':_0x21d665});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x29873b){var _0x3d2097=_[_0x41dc('0x5f')](_0x219dd0['mailQueuesWaitingInteractions']);_0x29873b({'count':_0x3d2097[_0x41dc('0x1b')],'rows':_0x3d2097});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x407413){var _0x1de51c=_[_0x41dc('0x5f')](_0x219dd0['openchannelQueuesWaitingInteractions']);_0x407413({'count':_0x1de51c[_0x41dc('0x1b')],'rows':_0x1de51c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x49a7b9){var _0x4bdd3c=_['values'](_0x219dd0[_0x41dc('0x60')]);_0x49a7b9({'count':_0x4bdd3c[_0x41dc('0x1b')],'rows':_0x4bdd3c});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x158dc0){var _0x44c03a=_[_0x41dc('0x5f')](_0x219dd0[_0x41dc('0x61')]);_0x158dc0({'count':_0x44c03a[_0x41dc('0x1b')],'rows':_0x44c03a});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x3d6519){var _0x3ecfa5=_['values'](_0x219dd0[_0x41dc('0x62')]);_0x3d6519({'count':_0x3ecfa5[_0x41dc('0x1b')],'rows':_0x3ecfa5});});}};var _0x2915d5=jayson[_0x41dc('0x63')](_0x5d15ee)[_0x41dc('0x64')]();_0x2915d5['on'](_0x41dc('0x42'),function(_0x262f2d){logger[_0x41dc('0x42')](JSON[_0x41dc('0x65')](_0x262f2d));return _0x375e1f(_0x262f2d);});_0x2915d5[_0x41dc('0x66')](0x232c,'127.0.0.1',function(){console['log'](_0x41dc('0x67'),0x232c);return _0x30ac40(_0x41dc('0x68')+0x232c);});});}; \ No newline at end of file +var _0x16eb=['lodash','util','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','appdata','split','mail','push','slice','dialogflowv2','amazonlex','TagId','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','info','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','name','waiting','mailQueues','paused','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:'];(function(_0x3f2057,_0x1906be){var _0x374f77=function(_0x379dd5){while(--_0x379dd5){_0x3f2057['push'](_0x3f2057['shift']());}};_0x374f77(++_0x1906be);}(_0x16eb,0x18c));var _0xb16e=function(_0x5b1486,_0x17be9c){_0x5b1486=_0x5b1486-0x0;var _0x5cd4fc=_0x16eb[_0x5b1486];return _0x5cd4fc;};'use strict';var _=require(_0xb16e('0x0'));var util=require(_0xb16e('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xb16e('0x2'));var BPromise=require('bluebird');var utils=require(_0xb16e('0x3'));var sUtils=require(_0xb16e('0x4'));var logger=require(_0xb16e('0x5'))(_0xb16e('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb16e('0x7')),'chatQueueReport':require(_0xb16e('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x25543d,_0x26b25d,_0x1ae491){return util[_0xb16e('0x9')](_0xb16e('0xa'),_0x25543d,_0x26b25d||0x0,_0x1ae491||0x0);}function getIntervals(_0x2de3b9,_0x24c290){var _0xb95406=[];if(!_[_0xb16e('0xb')](_0x24c290[_0xb16e('0xc')])&&!_['isNil'](_0x2de3b9[_0x24c290['IntervalId']])&&!_[_0xb16e('0xb')](_0x2de3b9[_0x24c290[_0xb16e('0xc')]]['Intervals'])){_0xb95406=_[_0xb16e('0xd')](_0x2de3b9[_0x24c290[_0xb16e('0xc')]][_0xb16e('0xe')],_0xb16e('0xf'));}else if(!_[_0xb16e('0xb')](_0x24c290[_0xb16e('0xf')])){_0xb95406=[_0x24c290[_0xb16e('0xf')]];}return _0xb95406;}exports[_0xb16e('0x10')]=function(_0x28cc1b){_0x28cc1b[_0xb16e('0x11')]={};return new BPromise(function(_0x473745,_0x517c7a){var _0x38f75d={'Start':function(_0x215774){var _0x288f81=this;return new Promise(function(_0x27ae2c,_0x568bbd){if(_0x215774){try{var _0x27f248=[];var _0x3ea308=getId(_0x215774[_0xb16e('0x12')],_0x215774['message']?_0x215774[_0xb16e('0x13')]['id']:0x0,_0x215774[_0xb16e('0x14')]?_0x215774[_0xb16e('0x14')]['id']:0x0);var _0x1a45a3=sUtils['checkWaitingNotifications'](_0x28cc1b,_0x215774);if(!_0x1a45a3&&_0x215774[_0xb16e('0x15')]&&_[_0xb16e('0x16')](_0x215774['applications'])&&_0x215774[_0xb16e('0x15')]['length']){for(var _0x38e8c1=0x0;_0x38e8c1<_0x215774[_0xb16e('0x15')][_0xb16e('0x17')];_0x38e8c1+=0x1){var _0x1556e9=_0x215774[_0xb16e('0x15')][_0x38e8c1];if(fs[_0xb16e('0x18')](path[_0xb16e('0x19')](__dirname,_0xb16e('0x15'),_0x1556e9[_0xb16e('0x1a')]+'.js'))){var _0x5df7d3=[];switch(_0x1556e9['app'][_0xb16e('0x1b')]()){case'autoreply':var _0x33dc7a=_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');if(_0x215774[_0xb16e('0x12')]===_0xb16e('0x1e')){_0x5df7d3[_0xb16e('0x1f')](_0x33dc7a[0x0]);_0x5df7d3['push'](_0x33dc7a[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x33dc7a[_0xb16e('0x20')](0x2,_0x33dc7a[_0xb16e('0x17')])[_0xb16e('0x19')](','));}else{_0x5df7d3[_0xb16e('0x1f')](_0x33dc7a[0x0]);_0x5df7d3['push'](_0x33dc7a[_0xb16e('0x20')](0x1,_0x33dc7a[_0xb16e('0x17')])[_0xb16e('0x19')](','));}break;case'dialogflow':var _0x58650f=_0x1556e9[_0xb16e('0x1c')]['split'](',');_0x5df7d3[_0xb16e('0x1f')](_0x58650f[0x0]);_0x5df7d3['push'](_0x58650f[0x1]);_0x5df7d3['push'](_0x58650f[_0xb16e('0x20')](0x2,_0x58650f['length'])[_0xb16e('0x19')](','));break;case _0xb16e('0x21'):var _0x525069=_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x0]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x2]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[0x3]);_0x5df7d3[_0xb16e('0x1f')](_0x525069[_0xb16e('0x20')](0x4,_0x525069[_0xb16e('0x17')])['join'](','));break;case _0xb16e('0x22'):var _0x43e9d3=_0x1556e9['appdata'][_0xb16e('0x1d')](',');_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x0]);_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x2]);_0x5df7d3[_0xb16e('0x1f')](_0x43e9d3[0x3]);_0x5df7d3['push'](_0x43e9d3['slice'](0x4,_0x43e9d3['length'])['join'](','));break;case _0xb16e('0x13'):_0x5df7d3['push'](_0x1556e9['appdata']);break;case'tag':_0x5df7d3['push'](_0x1556e9[_0xb16e('0x23')]);_0x5df7d3[_0xb16e('0x1f')](_0x1556e9['appdata']);break;case'tvox':var _0x4317ce=utils['getMustacheRender'](_0x215774[_0xb16e('0x24')][_0xb16e('0x25')],_0x215774);var _0x453a43=_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x0]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x1]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x2]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x3]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x4]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x5]);_0x5df7d3['push'](_0x453a43[0x6]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x7]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x8]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0x9]);_0x5df7d3[_0xb16e('0x1f')](_0x453a43[0xa]);_0x5df7d3[_0xb16e('0x1f')](_0x215774['interaction']['id']);_0x5df7d3['push'](_0x215774[_0xb16e('0x13')]['id']);_0x5df7d3[_0xb16e('0x1f')](_0x1556e9[_0xb16e('0x26')]);_0x5df7d3[_0xb16e('0x1f')](_0x215774[_0xb16e('0x14')][_0xb16e('0x27')]);_0x5df7d3[_0xb16e('0x1f')](_0x215774['body'][_0xb16e('0x28')]);_0x5df7d3[_0xb16e('0x1f')](_0x4317ce);break;default:_0x5df7d3=_['isNil'](_0x1556e9[_0xb16e('0x1c')])?[]:_0x1556e9[_0xb16e('0x1c')][_0xb16e('0x1d')](',');}var _0x18b52a={'id':util['format'](_0xb16e('0x29'),_0x3ea308,_0x1556e9['id'],_0x1556e9['app']),'condition':require(_0xb16e('0x2a'))['condition'](_0x3ea308,getIntervals(_0x28cc1b[_0xb16e('0x2b')],_0x1556e9),_0x28cc1b),'consequence':require(_0xb16e('0x2c')+_0x1556e9[_0xb16e('0x1a')])[_0xb16e('0x2d')](_0x3ea308,_0x5df7d3,_0x28cc1b,_0x215774),'p':_0x1556e9[_0xb16e('0x2e')]||0x0};logger['info'](_0xb16e('0x2f'),_0x18b52a['id'],_0xb16e('0x30'),getIntervals(_0x28cc1b[_0xb16e('0x2b')],_0x1556e9)['join'](_0xb16e('0x31')));_0x27f248[_0xb16e('0x1f')](_0x18b52a);}else{logger['error'](_0xb16e('0x32'),path[_0xb16e('0x19')](__dirname,'applications',_0x1556e9[_0xb16e('0x1a')]+'.js'));}}_0x28cc1b[_0xb16e('0x11')][_0x3ea308]=new RuleEngine(_0x27f248);_0x28cc1b['rules'][_0x3ea308][_0xb16e('0x33')](_0x215774,function(_0x4fe8cd){logger[_0xb16e('0x34')]('Applications\x20executed',JSON['stringify'](_0x4fe8cd[_0xb16e('0x35')]));if(_0x28cc1b[_0xb16e('0x11')][_0x3ea308]){_0x28cc1b[_0xb16e('0x11')][_0x3ea308][_0xb16e('0x36')](_0xb16e('0x37'));}});return _0x27ae2c({'code':0xc8,'message':_0x215774});}else{if(_0x1a45a3){logger[_0xb16e('0x34')](util[_0xb16e('0x9')](_0xb16e('0x38'),_0x3ea308));}else{logger[_0xb16e('0x34')](_0xb16e('0x39'));}return _0x27ae2c({'code':0xc8,'message':_0x215774});}}catch(_0x9c2e05){logger[_0xb16e('0x3a')](_0x9c2e05[_0xb16e('0x3b')]);return _0x568bbd(_0x288f81[_0xb16e('0x3a')](0x1f4,_0x9c2e05));}}return _0x568bbd(_0xb16e('0x3c'));});},'AcceptMessage':function(_0x10f4bb){var _0x48becf=this;return new Promise(function(_0x40b9cd,_0x4e9134){if(_0x10f4bb[_0xb16e('0x3d')]&&_0x10f4bb[_0xb16e('0x3d')]['id']){if(_0x28cc1b['agents'][_0x10f4bb['agent']['id']]){_0x28cc1b[_0xb16e('0x3e')][_0x10f4bb[_0xb16e('0x3d')]['id']][_0xb16e('0x3f')]=![];_0x28cc1b['agents'][_0x10f4bb[_0xb16e('0x3d')]['id']][_0xb16e('0x40')]=undefined;}}if(_0x10f4bb[_0xb16e('0x13')]&&_0x10f4bb[_0xb16e('0x13')]['id']){try{var _0x3a215c=getId(_0x10f4bb[_0xb16e('0x12')],_0x10f4bb[_0xb16e('0x13')]?_0x10f4bb[_0xb16e('0x13')]['id']:0x0,_0x10f4bb[_0xb16e('0x14')]?_0x10f4bb[_0xb16e('0x14')]['id']:0x0);if(_0x28cc1b[_0xb16e('0x11')][_0x3a215c]){_0x28cc1b[_0xb16e('0x11')][_0x3a215c][_0xb16e('0x36')](_0xb16e('0x41'));if(rpc[_0x10f4bb['channel']+'QueueReport']){rpc[_0x10f4bb[_0xb16e('0x12')]+_0xb16e('0x42')][_0xb16e('0x43')](_0x3a215c,{'UserId':_0x10f4bb[_0xb16e('0x13')][_0xb16e('0x44')]})[_0xb16e('0x45')](function(){logger[_0xb16e('0x3a')](_0xb16e('0x46'));});}}return _0x40b9cd({'code':0xc8,'message':_0x10f4bb});}catch(_0x509960){logger[_0xb16e('0x3a')](_0x509960[_0xb16e('0x3b')]);return _0x4e9134(_0x48becf[_0xb16e('0x3a')](0x1f4,_0x509960));}}logger[_0xb16e('0x3a')](_0xb16e('0x47'));return _0x4e9134(_0x48becf['error'](0x1f4,_0xb16e('0x47')));});},'RejectMessage':function(_0x480af0){var _0x13e30f=this;return new Promise(function(_0x47fe10,_0x18aa36){if(_0x480af0[_0xb16e('0x3d')]&&_0x480af0['agent']['id']){try{if(_0x28cc1b[_0xb16e('0x3e')][_0x480af0[_0xb16e('0x3d')]['id']]){_0x28cc1b[_0xb16e('0x3e')][_0x480af0[_0xb16e('0x3d')]['id']][_0xb16e('0x3f')]=![];_0x28cc1b[_0xb16e('0x3e')][_0x480af0[_0xb16e('0x3d')]['id']][_0xb16e('0x40')]=undefined;}return _0x47fe10({'code':0xc8,'message':_0x480af0});}catch(_0x5b7daf){logger['error'](_0x5b7daf['stack']);return _0x18aa36(_0x13e30f[_0xb16e('0x3a')](0x1f4,_0x5b7daf));}}logger['error'](_0xb16e('0x47'));return _0x18aa36(_0x13e30f[_0xb16e('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2a2e21){var _0x346dcb=this;return new Promise(function(_0x2008fc,_0x5b0bed){if(_0x2a2e21[_0xb16e('0x12')]&&_0x2a2e21[_0xb16e('0x14')]&&_0x2a2e21[_0xb16e('0x14')]['id']){try{var _0x891f11=getId(_0x2a2e21[_0xb16e('0x12')],_0x2a2e21['message']?_0x2a2e21[_0xb16e('0x13')]['id']:0x0,_0x2a2e21['interaction']?_0x2a2e21[_0xb16e('0x14')]['id']:0x0);if(_0x28cc1b[_0xb16e('0x11')][_0x891f11]){_0x28cc1b[_0xb16e('0x11')][_0x891f11][_0xb16e('0x36')](_0xb16e('0x41'));}return _0x2008fc({'code':0xc8,'message':_0x2a2e21});}catch(_0x498ea0){logger[_0xb16e('0x3a')](_0x498ea0[_0xb16e('0x3b')]);return _0x5b0bed(_0x346dcb[_0xb16e('0x3a')](0x1f4,_0x498ea0));}}logger[_0xb16e('0x3a')](_0xb16e('0x47'));return _0x5b0bed(_0x346dcb[_0xb16e('0x3a')](0x1f4,_0xb16e('0x47')));});},'AgentCapacity':function(_0x2dc4d2){var _0x4b34c6=this;return new Promise(function(_0x5bb2a5,_0x11d23e){if(_0x28cc1b[_0xb16e('0x3e')]['hasOwnProperty'](_0x2dc4d2['id'])){for(var _0x18a3c7 in _0x2dc4d2[_0xb16e('0x48')]){if(_0x2dc4d2[_0xb16e('0x48')][_0xb16e('0x49')](_0x18a3c7)){if(_0x28cc1b[_0xb16e('0x3e')][_0x2dc4d2['id']][_0xb16e('0x49')](_0x18a3c7+_0xb16e('0x4a'))){_0x28cc1b['agents'][_0x2dc4d2['id']][_0x18a3c7+_0xb16e('0x4a')]=parseInt(_0x2dc4d2[_0xb16e('0x48')][_0x18a3c7],0xa);}}}_0x28cc1b[_0xb16e('0x3e')][_0x2dc4d2['id']][_0xb16e('0x4b')]();return _0x5bb2a5({'code':0xc8,'message':_0x28cc1b[_0xb16e('0x3e')][_0x2dc4d2['id']]});}else{return _0x11d23e(_0x4b34c6['error'](0x1f4,_0xb16e('0x4c')));}});},'Agents':function(_0x21b346){return new Promise(function(_0x7b131d){var _0x5613db=_['values'](_0x28cc1b[_0xb16e('0x3e')]);if(_0x21b346&&_0x21b346['id']){var _0x3cf4f8=_[_0xb16e('0x4d')](_0x5613db,function(_0xf1b9a2){return _0xf1b9a2['id']===_0x21b346['id'];});_0x7b131d(_0x3cf4f8);}else{_0x7b131d({'count':_0x5613db[_0xb16e('0x17')],'rows':_0x5613db});}});},'ChatQueues':function(){return new Promise(function(_0x59f017){var _0xba58b4=[];for(var _0x43e7ba in _0x28cc1b[_0xb16e('0x4e')]){if(_0x28cc1b['chatQueues'][_0xb16e('0x49')](_0x43e7ba)){var _0x56576c=_0x28cc1b['chatQueues'][_0x43e7ba];var _0x54224b={'id':_0x56576c['id'],'available':_0x56576c[_0xb16e('0x4f')],'loggedIn':_0x56576c['loggedIn'],'name':_0x56576c[_0xb16e('0x50')],'paused':_0x56576c['paused'],'waiting':_0x56576c[_0xb16e('0x51')]};_0xba58b4[_0xb16e('0x1f')](_0x54224b);}}_0x59f017({'count':_0xba58b4[_0xb16e('0x17')],'rows':_0xba58b4});});},'MailQueues':function(){return new Promise(function(_0x4e0eb9){var _0x274881=[];for(var _0x35c8f3 in _0x28cc1b['mailQueues']){if(_0x28cc1b[_0xb16e('0x52')]['hasOwnProperty'](_0x35c8f3)){var _0x45f19d=_0x28cc1b['mailQueues'][_0x35c8f3];var _0x12e45d={'id':_0x45f19d['id'],'available':_0x45f19d['available'],'loggedIn':_0x45f19d['loggedIn'],'name':_0x45f19d[_0xb16e('0x50')],'paused':_0x45f19d[_0xb16e('0x53')],'waiting':_0x45f19d[_0xb16e('0x51')]};_0x274881[_0xb16e('0x1f')](_0x12e45d);}}_0x4e0eb9({'count':_0x274881[_0xb16e('0x17')],'rows':_0x274881});});},'OpenchannelQueues':function(){return new Promise(function(_0x1510b4){var _0x57a431=[];for(var _0x58f5bb in _0x28cc1b[_0xb16e('0x54')]){if(_0x28cc1b[_0xb16e('0x54')][_0xb16e('0x49')](_0x58f5bb)){var _0x56e5d8=_0x28cc1b[_0xb16e('0x54')][_0x58f5bb];var _0x22437e={'id':_0x56e5d8['id'],'available':_0x56e5d8['available'],'loggedIn':_0x56e5d8[_0xb16e('0x55')],'name':_0x56e5d8[_0xb16e('0x50')],'paused':_0x56e5d8[_0xb16e('0x53')],'waiting':_0x56e5d8[_0xb16e('0x51')]};_0x57a431['push'](_0x22437e);}}_0x1510b4({'count':_0x57a431[_0xb16e('0x17')],'rows':_0x57a431});});},'SmsQueues':function(){return new Promise(function(_0x53e89c){var _0x5f161b=[];for(var _0x4b39d6 in _0x28cc1b[_0xb16e('0x56')]){if(_0x28cc1b[_0xb16e('0x56')][_0xb16e('0x49')](_0x4b39d6)){var _0x4fa6d6=_0x28cc1b['smsQueues'][_0x4b39d6];var _0x4b67e0={'id':_0x4fa6d6['id'],'available':_0x4fa6d6['available'],'loggedIn':_0x4fa6d6[_0xb16e('0x55')],'name':_0x4fa6d6[_0xb16e('0x50')],'paused':_0x4fa6d6[_0xb16e('0x53')],'waiting':_0x4fa6d6[_0xb16e('0x51')]};_0x5f161b[_0xb16e('0x1f')](_0x4b67e0);}}_0x53e89c({'count':_0x5f161b[_0xb16e('0x17')],'rows':_0x5f161b});});},'FaxQueues':function(){return new Promise(function(_0x5262b7){var _0x14ca38=[];for(var _0x973f6d in _0x28cc1b[_0xb16e('0x57')]){if(_0x28cc1b[_0xb16e('0x57')][_0xb16e('0x49')](_0x973f6d)){var _0x1e3bd9=_0x28cc1b[_0xb16e('0x57')][_0x973f6d];var _0x4652b3={'id':_0x1e3bd9['id'],'available':_0x1e3bd9[_0xb16e('0x4f')],'loggedIn':_0x1e3bd9[_0xb16e('0x55')],'name':_0x1e3bd9[_0xb16e('0x50')],'paused':_0x1e3bd9[_0xb16e('0x53')],'waiting':_0x1e3bd9[_0xb16e('0x51')]};_0x14ca38['push'](_0x4652b3);}}_0x5262b7({'count':_0x14ca38[_0xb16e('0x17')],'rows':_0x14ca38});});},'WhatsappQueues':function(){return new Promise(function(_0x4c2c6b){var _0x4720bc=[];for(var _0x518f68 in _0x28cc1b[_0xb16e('0x58')]){if(_0x28cc1b[_0xb16e('0x58')][_0xb16e('0x49')](_0x518f68)){var _0x1e00f4=_0x28cc1b[_0xb16e('0x58')][_0x518f68];var _0x373bac={'id':_0x1e00f4['id'],'available':_0x1e00f4[_0xb16e('0x4f')],'loggedIn':_0x1e00f4[_0xb16e('0x55')],'name':_0x1e00f4[_0xb16e('0x50')],'paused':_0x1e00f4[_0xb16e('0x53')],'waiting':_0x1e00f4[_0xb16e('0x51')]};_0x4720bc['push'](_0x373bac);}}_0x4c2c6b({'count':_0x4720bc[_0xb16e('0x17')],'rows':_0x4720bc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x88fc42){var _0x46aad1=_[_0xb16e('0x59')](_0x28cc1b['chatQueuesWaitingInteractions']);_0x88fc42({'count':_0x46aad1[_0xb16e('0x17')],'rows':_0x46aad1});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x13fc3c){var _0x5da6ec=_[_0xb16e('0x59')](_0x28cc1b[_0xb16e('0x5a')]);_0x13fc3c({'count':_0x5da6ec[_0xb16e('0x17')],'rows':_0x5da6ec});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1fa215){var _0x2a3711=_['values'](_0x28cc1b['openchannelQueuesWaitingInteractions']);_0x1fa215({'count':_0x2a3711[_0xb16e('0x17')],'rows':_0x2a3711});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x540ce4){var _0x382fac=_['values'](_0x28cc1b[_0xb16e('0x5b')]);_0x540ce4({'count':_0x382fac['length'],'rows':_0x382fac});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x46919d){var _0x54fdc5=_[_0xb16e('0x59')](_0x28cc1b[_0xb16e('0x5c')]);_0x46919d({'count':_0x54fdc5[_0xb16e('0x17')],'rows':_0x54fdc5});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x413581){var _0x6be912=_[_0xb16e('0x59')](_0x28cc1b[_0xb16e('0x5d')]);_0x413581({'count':_0x6be912[_0xb16e('0x17')],'rows':_0x6be912});});}};var _0x37c183=jayson['server'](_0x38f75d)[_0xb16e('0x5e')]();_0x37c183['on'](_0xb16e('0x3a'),function(_0x5c8517){logger[_0xb16e('0x3a')](JSON[_0xb16e('0x5f')](_0x5c8517));return _0x517c7a(_0x5c8517);});_0x37c183[_0xb16e('0x10')](0x232c,'127.0.0.1',function(){console[_0xb16e('0x60')](_0xb16e('0x61'),0x232c);return _0x473745(_0xb16e('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 57a303b..301f85b 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 _0xc9d8=['http','request','then','error','message','result','catch','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','lodash','../../../config/logger','client'];(function(_0x3d33c2,_0x5739c5){var _0x575e5f=function(_0x39a4c1){while(--_0x39a4c1){_0x3d33c2['push'](_0x3d33c2['shift']());}};_0x575e5f(++_0x5739c5);}(_0xc9d8,0x146));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var BPromise=require(_0x8c9d('0x0'));var jayson=require('jayson/promise');var _=require(_0x8c9d('0x1'));var logger=require(_0x8c9d('0x2'))('routing');var client=jayson[_0x8c9d('0x3')][_0x8c9d('0x4')]({'port':0x232a});function request(_0x24b2ee,_0x51df1e){return new BPromise(function(_0x505cd3,_0x4ac113){return client[_0x8c9d('0x5')](_0x24b2ee,_0x51df1e)[_0x8c9d('0x6')](function(_0x431b19){if(_0x431b19['error']){return _0x4ac113(_0x431b19[_0x8c9d('0x7')][_0x8c9d('0x8')]);}else{return _0x505cd3(_0x431b19[_0x8c9d('0x9')]);}})[_0x8c9d('0xa')](function(_0x558e4c){return _0x4ac113(_0x558e4c);});});}exports[_0x8c9d('0xb')]=function(_0x393595,_0x2bd08d,_0x420cb1){return function(_0x439a39){if(_0x420cb1[_0x8c9d('0xc')]&&!_0x420cb1[_0x8c9d('0xc')][_0x393595]){logger[_0x8c9d('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x393595);return _0x439a39[_0x8c9d('0xe')]();}var _0x28955c=[];for(var _0x250084=0x0;_0x250084<_0x2bd08d[_0x8c9d('0xf')];_0x250084+=0x1){_0x28955c[_0x8c9d('0x10')](request(_0x8c9d('0x11'),{'command':util['format'](_0x8c9d('0x12'),_0x2bd08d[_0x250084])})[_0x8c9d('0x6')](function(_0x316054){return _0x316054&&_0x316054[_0x8c9d('0x8')]&&_0x316054[_0x8c9d('0x8')][_0x8c9d('0x13')](_0x8c9d('0x14'))>=0x0?!![]:![];})[_0x8c9d('0xa')](function(_0x3c72e7){logger[_0x8c9d('0x7')](_0x8c9d('0x15'),_0x393595,_0x2bd08d[_0x250084]);}));}BPromise[_0x8c9d('0x16')](_0x28955c)['then'](function(_0x24621d){var _0x1565f4=_[_0x8c9d('0x17')](_0x24621d);logger[_0x8c9d('0xd')](_0x8c9d('0x18'),_0x393595,_0x2bd08d[_0x8c9d('0x19')](_0x8c9d('0x1a')),_0x1565f4);_0x439a39[_0x8c9d('0x1b')](_0x1565f4);})[_0x8c9d('0xa')](function(_0x1614e9){console[_0x8c9d('0x1c')](_0x1614e9);logger[_0x8c9d('0x7')](_0x8c9d('0x18'),_0x393595,_0x2bd08d[_0x8c9d('0x19')](_0x8c9d('0x1a')),_0x1614e9[_0x8c9d('0x1d')]);_0x439a39[_0x8c9d('0xe')]();});};}; \ No newline at end of file +var _0xaac1=['\x20|\x20','log','stack','util','../../../config/logger','routing','client','http','request','then','error','message','catch','condition','rules','info','stop','push','Command','format','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x5491d3,_0xe8807e){var _0x4d7521=function(_0xbb41a2){while(--_0xbb41a2){_0x5491d3['push'](_0x5491d3['shift']());}};_0x4d7521(++_0xe8807e);}(_0xaac1,0x9f));var _0x1aac=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0xaac1[_0x343dfb];return _0x297fe2;};'use strict';var util=require(_0x1aac('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x1aac('0x1'))(_0x1aac('0x2'));var client=jayson[_0x1aac('0x3')][_0x1aac('0x4')]({'port':0x232a});function request(_0x130b8e,_0x4de08e){return new BPromise(function(_0xb7b3bd,_0x27dd80){return client[_0x1aac('0x5')](_0x130b8e,_0x4de08e)[_0x1aac('0x6')](function(_0x55b1ba){if(_0x55b1ba[_0x1aac('0x7')]){return _0x27dd80(_0x55b1ba['error'][_0x1aac('0x8')]);}else{return _0xb7b3bd(_0x55b1ba['result']);}})[_0x1aac('0x9')](function(_0x45ba1f){return _0x27dd80(_0x45ba1f);});});}exports[_0x1aac('0xa')]=function(_0x9c9fad,_0x278c99,_0x41fe0e){return function(_0x3926c6){if(_0x41fe0e[_0x1aac('0xb')]&&!_0x41fe0e[_0x1aac('0xb')][_0x9c9fad]){logger[_0x1aac('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x9c9fad);return _0x3926c6[_0x1aac('0xd')]();}var _0xbe1229=[];for(var _0x10c86f=0x0;_0x10c86f<_0x278c99['length'];_0x10c86f+=0x1){_0xbe1229[_0x1aac('0xe')](request(_0x1aac('0xf'),{'command':util[_0x1aac('0x10')]('iftime\x20%s',_0x278c99[_0x10c86f])})[_0x1aac('0x6')](function(_0x20c638){return _0x20c638&&_0x20c638[_0x1aac('0x8')]&&_0x20c638[_0x1aac('0x8')]['indexOf'](_0x1aac('0x11'))>=0x0?!![]:![];})[_0x1aac('0x9')](function(_0x1c1eba){logger[_0x1aac('0x7')](_0x1aac('0x12'),_0x9c9fad,_0x278c99[_0x10c86f]);}));}BPromise[_0x1aac('0x13')](_0xbe1229)[_0x1aac('0x6')](function(_0x2e524d){var _0xf6f6eb=_[_0x1aac('0x14')](_0x2e524d);logger[_0x1aac('0xc')](_0x1aac('0x15'),_0x9c9fad,_0x278c99[_0x1aac('0x16')](_0x1aac('0x17')),_0xf6f6eb);_0x3926c6['when'](_0xf6f6eb);})[_0x1aac('0x9')](function(_0xda8b5){console[_0x1aac('0x18')](_0xda8b5);logger[_0x1aac('0x7')](_0x1aac('0x15'),_0x9c9fad,_0x278c99[_0x1aac('0x16')]('\x20|\x20'),_0xda8b5[_0x1aac('0x19')]);_0x3926c6[_0x1aac('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 3495923..2238d20 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','agententerreason'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa571,0x107));var _0x1a57=function(_0x29c1cc,_0x40a819){_0x29c1cc=_0x29c1cc-0x0;var _0x4caeb7=_0xa571[_0x29c1cc];return _0x4caeb7;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var utils=require(_0x1a57('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1067d9,_0x48485e){utils[_0x1a57('0x3')](util[_0x1a57('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1067d9['uniqueid'],_0x1067d9[_0x1a57('0x5')],_0x1067d9['queue'],_0x1067d9[_0x1a57('0x6')],_0x1067d9[_0x1a57('0x7')],_0x1067d9[_0x1a57('0x8')],_0x1067d9[_0x1a57('0x9')],_0x1067d9[_0x1a57('0xa')]));if(_0x1067d9[_0x1a57('0xb')]){utils['getVoiceQueueByName'](_0x1067d9[_0x1a57('0xb')])[_0x1a57('0xc')](function(_0x3631d6){if(_0x3631d6){_0x1067d9['type']=_0x3631d6[_0x1a57('0xd')];_0x1067d9[_0x1a57('0xe')]=_0x1067d9[_0x1a57('0xf')]?_0x3631d6[_0x1a57('0x10')]:![];_0x1067d9[_0x1a57('0x11')]=_0x1067d9[_0x1a57('0xe')]?_0x3631d6[_0x1a57('0x12')]:0x0;}utils[_0x1a57('0x13')]('CreateVoiceAgentReport',_0x1067d9);});}else{utils['request'](_0x1a57('0x14'),_0x1067d9);}if(_0x48485e){delete transfers[_0x1067d9[_0x1a57('0x15')]];}else{delete agents[_0x1067d9[_0x1a57('0x16')]];}}exports['agentcalled']=function(_0x3de36a){try{utils[_0x1a57('0x17')](util['format'](_0x1a57('0x18'),_0x3de36a['uniqueid']),_0x3de36a);agents[_0x3de36a[_0x1a57('0x16')]]=_0x3de36a;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();agents[_0x3de36a['destuniqueid']][_0x1a57('0xa')]='called';agents[_0x3de36a['destuniqueid']][_0x1a57('0x9')]=null;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x1b')]=null;utils['info'](util[_0x1a57('0x4')](_0x1a57('0x1c'),_0x3de36a[_0x1a57('0x15')],agents[_0x3de36a['destuniqueid']][_0x1a57('0x6')],_0x3de36a[_0x1a57('0x16')]));}catch(_0x451b34){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentcalled]',_0x3de36a['uniqueid']),_0x451b34);}};exports[_0x1a57('0x1e')]=function(_0x21e811){try{if(!_[_0x1a57('0x1f')](agents[_0x21e811['destuniqueid']])){utils['debug'](util['format'](_0x1a57('0x20'),_0x21e811[_0x1a57('0x15')]),_0x21e811);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x21'),_0x21e811[_0x1a57('0x15')],agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x6')],_0x21e811[_0x1a57('0x16')]));agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x1e')]=!![];agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x22')]=utils[_0x1a57('0x1a')]();agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x24')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x25')]=_0x21e811['ringtime']?parseInt(_0x21e811['ringtime'])/0x3e8:0x0;agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x26')]=0x0;unanswered['push'](_0x21e811[_0x1a57('0x16')]);}}catch(_0x54f6a5){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentringnoanswer]',_0x21e811[_0x1a57('0x15')]),_0x54f6a5);}};exports[_0x1a57('0x27')]=function(_0x30527c){try{_[_0x1a57('0x28')](agents,function(_0x492b90,_0x366d5f){if(_0x492b90[_0x1a57('0x15')]==_0x30527c[_0x1a57('0x15')]&&!_[_0x1a57('0x29')](unanswered,_0x492b90['destuniqueid'])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0x30527c);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x2b'),_0x30527c[_0x1a57('0x15')],_0x492b90[_0x1a57('0x6')],_0x492b90['destuniqueid']));_0x492b90[_0x1a57('0x1e')]=!![];_0x492b90[_0x1a57('0x22')]=utils['now']();_0x492b90['lastevent']=_0x1a57('0x2c');_0x492b90[_0x1a57('0x24')]=_0x1a57('0x2c');_0x492b90[_0x1a57('0x25')]=_0x30527c[_0x1a57('0x25')];_0x492b90[_0x1a57('0x26')]=0x0;writeDB(_0x492b90);}});}catch(_0xe80d94){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0xe80d94);}};exports[_0x1a57('0x2d')]=function(_0x12f3a7){try{if(agents[_0x12f3a7[_0x1a57('0x16')]]){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x12f3a7);utils['info'](util[_0x1a57('0x4')](_0x1a57('0x2f'),_0x12f3a7[_0x1a57('0x15')],agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x6')],_0x12f3a7[_0x1a57('0x16')]));agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();agents[_0x12f3a7['destuniqueid']]['connectedlinenum']=_0x12f3a7['connectedlinenum'];agents[_0x12f3a7['destuniqueid']][_0x1a57('0x1b')]=_0x12f3a7[_0x1a57('0x1b')];agents[_0x12f3a7[_0x1a57('0x16')]]['holdtime']=_0x12f3a7[_0x1a57('0x31')];agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x32');_['forIn'](agents,function(_0x1be254,_0x5e79f0){if(_0x1be254[_0x1a57('0x16')]!=_0x12f3a7[_0x1a57('0x16')]&&_0x1be254[_0x1a57('0x15')]==_0x12f3a7['uniqueid']){_0x1be254[_0x1a57('0x26')]=0x0;_0x1be254[_0x1a57('0x25')]=_0x12f3a7[_0x1a57('0x31')];_0x1be254[_0x1a57('0x1e')]=!![];_0x1be254[_0x1a57('0x22')]=utils['now']();_0x1be254[_0x1a57('0xa')]='answered_elsewhere';_0x1be254['reason']=_0x1a57('0x33');_0x1be254['answeredelsewheredestinationuniqueid']=_0x12f3a7[_0x1a57('0x16')];_0x1be254[_0x1a57('0x34')]=_0x12f3a7[_0x1a57('0x6')];writeDB(_0x1be254);}});}}catch(_0x59abb1){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x59abb1);}};exports['agentcomplete']=function(_0xc7bab4){try{if(!_[_0x1a57('0x1f')](agents[_0xc7bab4['destuniqueid']])){utils[_0x1a57('0x17')](util['format']('[%s][agents][agentcomplete]',_0xc7bab4[_0x1a57('0x15')]),_0xc7bab4);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x35'),_0xc7bab4['uniqueid'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x6')],_0xc7bab4[_0x1a57('0x16')]));agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xf')]=!![];agents[_0xc7bab4['destuniqueid']][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x26')]=utils['diffTime'](agents[_0xc7bab4[_0x1a57('0x16')]]['agentcompleteAt'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x30')]);agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x24')]=_0xc7bab4[_0x1a57('0x24')];agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x37');writeDB(agents[_0xc7bab4[_0x1a57('0x16')]]);}}catch(_0x424065){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x38'),_0xc7bab4['uniqueid']),_0x424065);}};exports[_0x1a57('0x39')]=function(_0x480aff){try{if(!_[_0x1a57('0x1f')](agents[_0x480aff[_0x1a57('0x3a')]])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x480aff);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x3c'),_0x480aff['uniqueid'],agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x6')],agents[_0x480aff['transfereruniqueid']][_0x1a57('0x15')]));agents[_0x480aff[_0x1a57('0x3a')]]['transfer']=!![];agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x3d')]='blind';agents[_0x480aff['transfereruniqueid']]['transferexten']=_0x480aff[_0x1a57('0x3e')];agents[_0x480aff[_0x1a57('0x3a')]]['transferuniqueid']=agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x15')];}}catch(_0x572202){utils['error'](util['format'](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x572202);}};exports[_0x1a57('0x3f')]=function(_0x31be00){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x31be00);if(_0x31be00['origtransfereruniqueid']==_0x31be00['origtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00['secondtransfereruniqueid']])){utils['info'](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x6')]));agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x44')]=!![];agents[_0x31be00[_0x1a57('0x43')]]['transfertype']='ATTENDED';agents[_0x31be00['secondtransfereruniqueid']][_0x1a57('0x45')]=_0x31be00['origtransfererexten'];agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x41')];}if(_0x31be00[_0x1a57('0x47')]&&agents[_0x31be00[_0x1a57('0x47')]]){agents[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x48')]=0x1;transfers[_0x31be00['transfereeuniqueid']]=_['clone'](agents[_0x31be00['transfereeuniqueid']]);transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x49')]=agents[_0x31be00[_0x1a57('0x43')]]['calleridname'];transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]]['holdtime']=0x0;transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x48')]=0x2;}}else if(_0x31be00[_0x1a57('0x43')]==_0x31be00['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00[_0x1a57('0x41')]])){utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x6')]));agents[_0x31be00['origtransfereruniqueid']]['transfer']=!![];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x3d')]=_0x1a57('0x4a');agents[_0x31be00[_0x1a57('0x41')]]['transferexten']=_0x31be00[_0x1a57('0x4b')];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x43')];}if(_0x31be00[_0x1a57('0x4c')]&&agents[_0x31be00['transfertargetuniqueid']]){agents[_0x31be00['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x31be00[_0x1a57('0x4c')]]=_[_0x1a57('0x4d')](agents[_0x31be00[_0x1a57('0x4c')]]);transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x4c')]]['calleridname']=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x49')];transfers[_0x31be00['transfertargetuniqueid']]['agentcalledAt']=utils[_0x1a57('0x1a')]();transfers[_0x31be00['transfertargetuniqueid']][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x25')]=0x0;transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x48')]=0x2;}}}catch(_0x213576){utils[_0x1a57('0x1d')](util['format'](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x213576);}};exports['hangup']=function(_0x24b56c){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')]('[%s][agents][hangup]',_0x24b56c['uniqueid']),_0x24b56c);if(agents[_0x24b56c[_0x1a57('0x15')]]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]===_0x1a57('0x23')){if(_0x24b56c['cause']==='21'){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]=_0x1a57('0x4e');agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]='rejected';}utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x6')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);var _0x48a10e=unanswered[_0x1a57('0x50')](_0x24b56c[_0x1a57('0x15')]);if(_0x48a10e>-0x1){unanswered['splice'](_0x48a10e,0x1);}}if(transfers[_0x24b56c[_0x1a57('0x15')]]){transfers[_0x24b56c[_0x1a57('0x15')]]['agentcomplete']=!![];transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x26')]=utils[_0x1a57('0x51')](transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],transfers[_0x24b56c['uniqueid']][_0x1a57('0x30')]);transfers[_0x24b56c[_0x1a57('0x15')]]['reason']=_0x1a57('0x52');transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]=_0x1a57('0x37');utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],transfers[_0x24b56c[_0x1a57('0x15')]]['membername'],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(transfers[_0x24b56c[_0x1a57('0x15')]],!![]);}if(agents[_0x24b56c['uniqueid']]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x30')]){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xf')]=!![];agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0x24b56c[_0x1a57('0x15')]]['talktime']=utils[_0x1a57('0x51')](agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],agents[_0x24b56c[_0x1a57('0x15')]]['agentconnectAt']);agents[_0x24b56c['uniqueid']]['reason']=agents[_0x24b56c['uniqueid']]['transfer']?_0x1a57('0x44'):_0x1a57('0x52');agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]=_0x1a57('0x37');utils['info'](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]]['membername'],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);}}catch(_0x42d41e){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x53'),_0x24b56c[_0x1a57('0x15')]),_0x42d41e);}}; \ No newline at end of file +var _0x2547=['transfertargetuniqueid','clone','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','then','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','holdtime','ringtime','push','queuecallerabandon','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','secondtransfererexten'];(function(_0x7af451,_0x1bfa95){var _0x30083a=function(_0x1a7b34){while(--_0x1a7b34){_0x7af451['push'](_0x7af451['shift']());}};_0x30083a(++_0x1bfa95);}(_0x2547,0x1cd));var _0x7254=function(_0x190394,_0x54939e){_0x190394=_0x190394-0x0;var _0x347e45=_0x2547[_0x190394];return _0x347e45;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var utils=require(_0x7254('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44b692,_0x3ea6e6){utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x4'),_0x44b692[_0x7254('0x5')],_0x44b692['channel'],_0x44b692[_0x7254('0x6')],_0x44b692[_0x7254('0x7')],_0x44b692[_0x7254('0x8')],_0x44b692[_0x7254('0x9')],_0x44b692['connectedlinenum'],_0x44b692[_0x7254('0xa')]));if(_0x44b692[_0x7254('0x6')]){utils[_0x7254('0xb')](_0x44b692['queue'])[_0x7254('0xc')](function(_0x555b2e){if(_0x555b2e){_0x44b692['type']=_0x555b2e['type'];_0x44b692[_0x7254('0xd')]=_0x44b692[_0x7254('0xe')]?_0x555b2e[_0x7254('0xf')]:![];_0x44b692[_0x7254('0x10')]=_0x44b692[_0x7254('0xd')]?_0x555b2e[_0x7254('0x11')]:0x0;}utils['request'](_0x7254('0x12'),_0x44b692);});}else{utils['request'](_0x7254('0x12'),_0x44b692);}if(_0x3ea6e6){delete transfers[_0x44b692['uniqueid']];}else{delete agents[_0x44b692[_0x7254('0x13')]];}}exports[_0x7254('0x14')]=function(_0x348d4e){try{utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x348d4e);agents[_0x348d4e[_0x7254('0x13')]]=_0x348d4e;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0xa')]='called';agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x19')]=null;agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x1a')]=null;utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x1b'),_0x348d4e['uniqueid'],agents[_0x348d4e[_0x7254('0x13')]][_0x7254('0x7')],_0x348d4e[_0x7254('0x13')]));}catch(_0x45aa93){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x16'),_0x348d4e[_0x7254('0x5')]),_0x45aa93);}};exports[_0x7254('0x1d')]=function(_0x3b6cb6){try{if(!_[_0x7254('0x1e')](agents[_0x3b6cb6[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x3b6cb6);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x20'),_0x3b6cb6[_0x7254('0x5')],agents[_0x3b6cb6[_0x7254('0x13')]]['membername'],_0x3b6cb6['destuniqueid']));agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x1d')]=!![];agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x21')]=utils[_0x7254('0x18')]();agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0xa')]='timeout';agents[_0x3b6cb6[_0x7254('0x13')]][_0x7254('0x22')]=_0x7254('0x23');agents[_0x3b6cb6['destuniqueid']][_0x7254('0x24')]=_0x3b6cb6['ringtime']?parseInt(_0x3b6cb6[_0x7254('0x25')])/0x3e8:0x0;agents[_0x3b6cb6[_0x7254('0x13')]]['talktime']=0x0;unanswered[_0x7254('0x26')](_0x3b6cb6[_0x7254('0x13')]);}}catch(_0x4f684c){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x1f'),_0x3b6cb6[_0x7254('0x5')]),_0x4f684c);}};exports[_0x7254('0x27')]=function(_0xfe02ea){try{_['forIn'](agents,function(_0x146028,_0x2dba3f){if(_0x146028['uniqueid']==_0xfe02ea[_0x7254('0x5')]&&!_[_0x7254('0x28')](unanswered,_0x146028[_0x7254('0x13')])){utils['debug'](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0xfe02ea);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x2a'),_0xfe02ea[_0x7254('0x5')],_0x146028['membername'],_0x146028[_0x7254('0x13')]));_0x146028['agentringnoanswer']=!![];_0x146028['agentringnoanswerAt']=utils[_0x7254('0x18')]();_0x146028[_0x7254('0xa')]=_0x7254('0x2b');_0x146028[_0x7254('0x22')]=_0x7254('0x2b');_0x146028[_0x7254('0x24')]=_0xfe02ea[_0x7254('0x24')];_0x146028[_0x7254('0x2c')]=0x0;writeDB(_0x146028);}});}catch(_0x447515){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x29'),_0xfe02ea[_0x7254('0x5')]),_0x447515);}};exports[_0x7254('0x2d')]=function(_0x57a7d4){try{if(agents[_0x57a7d4[_0x7254('0x13')]]){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x57a7d4);utils['info'](util[_0x7254('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57a7d4[_0x7254('0x5')],agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x7')],_0x57a7d4[_0x7254('0x13')]));agents[_0x57a7d4[_0x7254('0x13')]]['agentconnectAt']=utils[_0x7254('0x18')]();agents[_0x57a7d4['destuniqueid']][_0x7254('0x19')]=_0x57a7d4[_0x7254('0x19')];agents[_0x57a7d4['destuniqueid']][_0x7254('0x1a')]=_0x57a7d4[_0x7254('0x1a')];agents[_0x57a7d4[_0x7254('0x13')]][_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];agents[_0x57a7d4[_0x7254('0x13')]]['lastevent']=_0x7254('0x2f');_[_0x7254('0x30')](agents,function(_0x105b8c,_0x4eca7a){if(_0x105b8c[_0x7254('0x13')]!=_0x57a7d4[_0x7254('0x13')]&&_0x105b8c[_0x7254('0x5')]==_0x57a7d4['uniqueid']){_0x105b8c[_0x7254('0x2c')]=0x0;_0x105b8c[_0x7254('0x24')]=_0x57a7d4[_0x7254('0x25')];_0x105b8c[_0x7254('0x1d')]=!![];_0x105b8c[_0x7254('0x21')]=utils['now']();_0x105b8c['lastevent']=_0x7254('0x31');_0x105b8c[_0x7254('0x22')]=_0x7254('0x31');_0x105b8c[_0x7254('0x32')]=_0x57a7d4['destuniqueid'];_0x105b8c['answeredelsewheremembername']=_0x57a7d4[_0x7254('0x7')];writeDB(_0x105b8c);}});}}catch(_0x565cd8){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x2e'),_0x57a7d4[_0x7254('0x5')]),_0x565cd8);}};exports['agentcomplete']=function(_0x4adf34){try{if(!_[_0x7254('0x1e')](agents[_0x4adf34[_0x7254('0x13')]])){utils[_0x7254('0x15')](util[_0x7254('0x3')](_0x7254('0x33'),_0x4adf34['uniqueid']),_0x4adf34);utils['info'](util[_0x7254('0x3')](_0x7254('0x34'),_0x4adf34[_0x7254('0x5')],agents[_0x4adf34['destuniqueid']][_0x7254('0x7')],_0x4adf34[_0x7254('0x13')]));agents[_0x4adf34['destuniqueid']][_0x7254('0xe')]=!![];agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x35')]=utils[_0x7254('0x18')]();agents[_0x4adf34['destuniqueid']][_0x7254('0x2c')]=utils[_0x7254('0x36')](agents[_0x4adf34['destuniqueid']][_0x7254('0x35')],agents[_0x4adf34[_0x7254('0x13')]][_0x7254('0x37')]);agents[_0x4adf34['destuniqueid']][_0x7254('0x22')]=_0x4adf34[_0x7254('0x22')];agents[_0x4adf34['destuniqueid']]['lastevent']=_0x7254('0x38');writeDB(agents[_0x4adf34['destuniqueid']]);}}catch(_0x2e437c){utils[_0x7254('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x4adf34[_0x7254('0x5')]),_0x2e437c);}};exports[_0x7254('0x39')]=function(_0x38bcd5){try{if(!_[_0x7254('0x1e')](agents[_0x38bcd5[_0x7254('0x3a')]])){utils[_0x7254('0x15')](util['format'](_0x7254('0x3b'),_0x38bcd5['uniqueid']),_0x38bcd5);utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x3c'),_0x38bcd5['uniqueid'],agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x7')],agents[_0x38bcd5[_0x7254('0x3a')]]['uniqueid']));agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3d')]=!![];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x3e')]=_0x7254('0x3f');agents[_0x38bcd5['transfereruniqueid']]['transferexten']=_0x38bcd5[_0x7254('0x40')];agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x41')]=agents[_0x38bcd5[_0x7254('0x3a')]][_0x7254('0x5')];}}catch(_0x4c6838){utils['error'](util[_0x7254('0x3')](_0x7254('0x3b'),_0x38bcd5[_0x7254('0x5')]),_0x4c6838);}};exports[_0x7254('0x42')]=function(_0x5061be){try{utils[_0x7254('0x15')](util[_0x7254('0x3')]('[%s][agents][attendedtransfer]',_0x5061be[_0x7254('0x43')]),_0x5061be);if(_0x5061be['origtransfereruniqueid']==_0x5061be[_0x7254('0x44')]){if(!_['isNil'](agents[_0x5061be[_0x7254('0x45')]])){utils['info'](util['format'](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x7')]));agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be['secondtransfereruniqueid']][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x49')];agents[_0x5061be[_0x7254('0x45')]]['transferuniqueid']=_0x5061be[_0x7254('0x43')];}if(_0x5061be[_0x7254('0x4a')]&&agents[_0x5061be[_0x7254('0x4a')]]){agents[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4b')]=0x1;transfers[_0x5061be[_0x7254('0x4a')]]=_['clone'](agents[_0x5061be[_0x7254('0x4a')]]);transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x45')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x4c')]=agents[_0x5061be['secondtransfereruniqueid']]['calleridname'];transfers[_0x5061be[_0x7254('0x4a')]]['agentcalledAt']=utils['now']();transfers[_0x5061be[_0x7254('0x4a')]][_0x7254('0x37')]=utils[_0x7254('0x18')]();transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfereeuniqueid']][_0x7254('0x4b')]=0x2;}}else if(_0x5061be[_0x7254('0x45')]==_0x5061be[_0x7254('0x4d')]){if(!_[_0x7254('0x1e')](agents[_0x5061be[_0x7254('0x43')]])){utils['info'](util[_0x7254('0x3')](_0x7254('0x46'),_0x5061be[_0x7254('0x43')],agents[_0x5061be[_0x7254('0x43')]]['membername']));agents[_0x5061be['origtransfereruniqueid']][_0x7254('0x3d')]=!![];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x3e')]=_0x7254('0x47');agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x48')]=_0x5061be[_0x7254('0x4e')];agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x41')]=_0x5061be[_0x7254('0x45')];}if(_0x5061be[_0x7254('0x4f')]&&agents[_0x5061be[_0x7254('0x4f')]]){agents[_0x5061be[_0x7254('0x4f')]]['agententerreason']=0x1;transfers[_0x5061be[_0x7254('0x4f')]]=_[_0x7254('0x50')](agents[_0x5061be[_0x7254('0x4f')]]);transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x9')]=agents[_0x5061be[_0x7254('0x43')]][_0x7254('0x9')];transfers[_0x5061be[_0x7254('0x4f')]]['calleridname']=agents[_0x5061be[_0x7254('0x43')]]['calleridname'];transfers[_0x5061be[_0x7254('0x4f')]][_0x7254('0x17')]=utils[_0x7254('0x18')]();transfers[_0x5061be[_0x7254('0x4f')]]['agentconnectAt']=utils[_0x7254('0x18')]();transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x24')]=0x0;transfers[_0x5061be['transfertargetuniqueid']][_0x7254('0x4b')]=0x2;}}}catch(_0x42dc64){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x51'),_0x5061be[_0x7254('0x43')]),_0x42dc64);}};exports[_0x7254('0x52')]=function(_0x23b89a){try{utils['debug'](util[_0x7254('0x3')]('[%s][agents][hangup]',_0x23b89a[_0x7254('0x5')]),_0x23b89a);if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]===_0x7254('0x23')){if(_0x23b89a[_0x7254('0x53')]==='21'){agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='rejected';agents[_0x23b89a[_0x7254('0x5')]]['lastevent']=_0x7254('0x54');}utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x7')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);var _0x3f7be7=unanswered[_0x7254('0x56')](_0x23b89a[_0x7254('0x5')]);if(_0x3f7be7>-0x1){unanswered[_0x7254('0x57')](_0x3f7be7,0x1);}}if(transfers[_0x23b89a[_0x7254('0x5')]]){transfers[_0x23b89a['uniqueid']]['agentcomplete']=!![];transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')]=utils['now']();transfers[_0x23b89a['uniqueid']]['talktime']=utils[_0x7254('0x36')](transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],transfers[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')]='agent';transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils['info'](util['format'](_0x7254('0x55'),_0x23b89a[_0x7254('0x5')],transfers[_0x23b89a['uniqueid']][_0x7254('0x7')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0x22')],transfers[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(transfers[_0x23b89a['uniqueid']],!![]);}if(agents[_0x23b89a[_0x7254('0x5')]]&&agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x37')]){agents[_0x23b89a['uniqueid']][_0x7254('0xe')]=!![];agents[_0x23b89a['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x23b89a[_0x7254('0x5')]]['talktime']=utils['diffTime'](agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x35')],agents[_0x23b89a[_0x7254('0x5')]]['agentconnectAt']);agents[_0x23b89a[_0x7254('0x5')]]['reason']=agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0x3d')]?'transfer':_0x7254('0x58');agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]=_0x7254('0x38');utils[_0x7254('0x2')](util[_0x7254('0x3')](_0x7254('0x55'),_0x23b89a['uniqueid'],agents[_0x23b89a[_0x7254('0x5')]]['membername'],agents[_0x23b89a['uniqueid']][_0x7254('0x22')],agents[_0x23b89a[_0x7254('0x5')]][_0x7254('0xa')]));writeDB(agents[_0x23b89a[_0x7254('0x5')]]);}}catch(_0x54c7d5){utils[_0x7254('0x1c')](util[_0x7254('0x3')](_0x7254('0x59'),_0x23b89a[_0x7254('0x5')]),_0x54c7d5);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 2e7aa87..af0d117 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 _0xff6f=['answertime','disposition','toNumber','hangup','[%s][calls][hangup]','calleridname','callerid','duration','diffTime','starttime','billableseconds','error','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','substring','lastIndexOf','includes','noop','gotoif','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','now','DOCUMENTATION','[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel'];(function(_0x5da897,_0x534461){var _0x1c6024=function(_0xcac13a){while(--_0xcac13a){_0x5da897['push'](_0x5da897['shift']());}};_0x1c6024(++_0x534461);}(_0xff6f,0x11e));var _0xfff6=function(_0x57f71a,_0xdfc86b){_0x57f71a=_0x57f71a-0x0;var _0x485203=_0xff6f[_0x57f71a];return _0x485203;};'use strict';var _=require(_0xfff6('0x0'));var util=require(_0xfff6('0x1'));var utils=require(_0xfff6('0x2'));var transfers=require(_0xfff6('0x3'));var dispositions=[_0xfff6('0x4'),_0xfff6('0x5'),'FAILED',_0xfff6('0x4'),_0xfff6('0x4'),_0xfff6('0x4'),'ANSWERED',_0xfff6('0x6'),'FAILED',_0xfff6('0x5'),_0xfff6('0x5')];var channels={};function writeDB(_0x3972e5){var _0x19d334;if(transfers[_0xfff6('0x7')][_0x3972e5[_0xfff6('0x8')]]){_0x19d334=_0x3972e5[_0xfff6('0x8')];_0x3972e5[_0xfff6('0x8')]=transfers[_0xfff6('0x7')][_0x3972e5[_0xfff6('0x8')]]['transfereeuniqueid'];}utils[_0xfff6('0x9')](util[_0xfff6('0xa')](_0xfff6('0xb'),_0x3972e5[_0xfff6('0x8')],_0x3972e5[_0xfff6('0xc')],_0x3972e5[_0xfff6('0xd')],_0x3972e5[_0xfff6('0xe')],_0x3972e5[_0xfff6('0xf')],_0x3972e5['calleridnum'],_0x3972e5[_0xfff6('0x10')],_0x3972e5[_0xfff6('0x11')]));if(_0x3972e5[_0xfff6('0x12')]){utils['getUserByInternal'](_0x3972e5[_0xfff6('0x12')])['then'](function(_0x47ee6b){if(_0x47ee6b){_0x3972e5[_0xfff6('0x13')]=_0x47ee6b['id'];}utils[_0xfff6('0x14')](_0xfff6('0x15'),_0x3972e5);});}else{utils[_0xfff6('0x14')](_0xfff6('0x15'),_0x3972e5);}if(channels[_0x3972e5[_0xfff6('0x8')]]){delete channels[_0x3972e5[_0xfff6('0x8')]];}else if(_0x19d334&&channels[_0x19d334]){if(!transfers[_0xfff6('0x7')][_0x19d334][_0xfff6('0x16')])delete transfers[_0xfff6('0x7')][_0x19d334];delete channels[_0x19d334];}}exports[_0xfff6('0x17')]=function(_0x1a53b4){try{utils[_0xfff6('0x18')](util[_0xfff6('0xa')]('[%s][calls][newchannel]',_0x1a53b4[_0xfff6('0x8')]),_0x1a53b4);if(_0x1a53b4['uniqueid']==_0x1a53b4['linkedid']&&_0x1a53b4[_0xfff6('0xc')]!=_0xfff6('0x19')){utils[_0xfff6('0x9')](util['format'](_0xfff6('0x1a'),_0x1a53b4['uniqueid'],_0x1a53b4[_0xfff6('0x1b')],_0x1a53b4['exten']));channels[_0x1a53b4[_0xfff6('0x8')]]={'uniqueid':_0x1a53b4[_0xfff6('0x8')],'accountcode':_0x1a53b4['accountcode'],'source':_0x1a53b4[_0xfff6('0x1c')],'destination':_0x1a53b4[_0xfff6('0x1d')],'destinationcontext':_0x1a53b4['context'],'channel':_0x1a53b4[_0xfff6('0xc')],'starttime':utils[_0xfff6('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xfff6('0x4'),'amaflags':_0xfff6('0x1f')};}}catch(_0x208e25){utils['error'](util['format'](_0xfff6('0x20'),_0x1a53b4[_0xfff6('0x8')]),_0x208e25);}};exports['newstate']=function(_0x528bff){try{utils[_0xfff6('0x18')](util[_0xfff6('0xa')](_0xfff6('0x21'),_0x528bff[_0xfff6('0x8')]),_0x528bff);if(!_[_0xfff6('0x22')](channels[_0x528bff[_0xfff6('0x8')]])&&_0x528bff[_0xfff6('0x23')]==0x6){utils[_0xfff6('0x9')](util[_0xfff6('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x528bff['uniqueid'],_0x528bff['context'],_0x528bff[_0xfff6('0xc')]));if(_['isNil'](channels[_0x528bff[_0xfff6('0x8')]][_0xfff6('0x24')])){channels[_0x528bff[_0xfff6('0x8')]][_0xfff6('0x24')]=utils[_0xfff6('0x1e')]();}}else if(!_['isNil'](channels[_0x528bff[_0xfff6('0x25')]])&&_0x528bff[_0xfff6('0x23')]==0x6&&_0x528bff[_0xfff6('0x1b')]!=_0xfff6('0x26')){utils[_0xfff6('0x9')](util['format'](_0xfff6('0x27'),_0x528bff[_0xfff6('0x8')],_0x528bff[_0xfff6('0x25')],_0x528bff['context'],_0x528bff[_0xfff6('0xc')]));channels[_0x528bff[_0xfff6('0x25')]]['accountcode']=_0x528bff[_0xfff6('0x12')];channels[_0x528bff[_0xfff6('0x25')]][_0xfff6('0x28')]=_0x528bff[_0xfff6('0xc')];if(_[_0xfff6('0x22')](channels[_0x528bff[_0xfff6('0x25')]][_0xfff6('0x29')])){channels[_0x528bff[_0xfff6('0x25')]]['answertime']=utils[_0xfff6('0x1e')]();}channels[_0x528bff[_0xfff6('0x25')]][_0xfff6('0x2a')]=dispositions[_[_0xfff6('0x2b')](_0x528bff[_0xfff6('0x23')])]||'ANSWERED';}}catch(_0x38c89e){utils['error'](util['format'](_0xfff6('0x21'),_0x528bff[_0xfff6('0x8')]),_0x38c89e);}};exports[_0xfff6('0x2c')]=function(_0x30378d){try{if(!_[_0xfff6('0x22')](channels[_0x30378d['uniqueid']])){utils['debug'](util[_0xfff6('0xa')](_0xfff6('0x2d'),_0x30378d[_0xfff6('0x8')]),_0x30378d);if(_[_0xfff6('0x22')](channels[_0x30378d[_0xfff6('0x8')]]['callerid'])){channels[_0x30378d[_0xfff6('0x8')]]['callerid']=_0x30378d[_0xfff6('0x2e')]+'\x20<'+_0x30378d['calleridnum']+'>';}utils[_0xfff6('0x9')](util[_0xfff6('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x30378d[_0xfff6('0x8')],channels[_0x30378d['uniqueid']][_0xfff6('0x2f')],_0x30378d['cause-txt']));channels[_0x30378d[_0xfff6('0x8')]]['endtime']=utils['now']();channels[_0x30378d[_0xfff6('0x8')]][_0xfff6('0x30')]=utils[_0xfff6('0x31')](channels[_0x30378d[_0xfff6('0x8')]]['endtime'],channels[_0x30378d['uniqueid']][_0xfff6('0x32')]);channels[_0x30378d[_0xfff6('0x8')]][_0xfff6('0x33')]=channels[_0x30378d[_0xfff6('0x8')]]['answertime']?utils[_0xfff6('0x31')](channels[_0x30378d[_0xfff6('0x8')]]['endtime'],channels[_0x30378d[_0xfff6('0x8')]][_0xfff6('0x29')]):0x0;writeDB(channels[_0x30378d[_0xfff6('0x8')]]);}}catch(_0x8a63e6){utils[_0xfff6('0x34')](util['format'](_0xfff6('0x2d'),_0x30378d['uniqueid']),_0x8a63e6);}};exports['attendedtransfer']=function(_0x117e4a){try{if(!_['isNil'](channels[_0x117e4a['localtwolinkedid']])){utils['debug'](util[_0xfff6('0xa')](_0xfff6('0x35'),_0x117e4a[_0xfff6('0x36')]),_0x117e4a);if(channels[_0x117e4a[_0xfff6('0x37')]]['channel']==_0x117e4a[_0xfff6('0x38')]){utils[_0xfff6('0x9')](util[_0xfff6('0xa')](_0xfff6('0x39'),_0x117e4a[_0xfff6('0x36')],_0x117e4a['localtwolinkedid'],_0x117e4a[_0xfff6('0x3a')]));channels[_0x117e4a[_0xfff6('0x37')]][_0xfff6('0x28')]=_0x117e4a[_0xfff6('0x3a')];channels[_0x117e4a[_0xfff6('0x37')]]['userfield']=_0xfff6('0x3b');}else if(channels[_0x117e4a[_0xfff6('0x37')]][_0xfff6('0xc')]=_0x117e4a[_0xfff6('0x3c')]){utils[_0xfff6('0x9')](util['format'](_0xfff6('0x39'),_0x117e4a[_0xfff6('0x36')],_0x117e4a[_0xfff6('0x37')],_0x117e4a[_0xfff6('0x3d')]));channels[_0x117e4a[_0xfff6('0x37')]][_0xfff6('0x28')]=_0x117e4a[_0xfff6('0x3d')];channels[_0x117e4a['localtwolinkedid']][_0xfff6('0x3e')]='_attended';}}}catch(_0x50b4a0){utils[_0xfff6('0x34')](util[_0xfff6('0xa')](_0xfff6('0x35'),_0x117e4a['origtransfereruniqueid']),_0x50b4a0);}};exports[_0xfff6('0x3f')]=function(_0x2cf37f){try{if(!_[_0xfff6('0x22')](channels[_0x2cf37f[_0xfff6('0x8')]])){utils[_0xfff6('0x18')](util[_0xfff6('0xa')](_0xfff6('0x40'),_0x2cf37f[_0xfff6('0x8')]),_0x2cf37f);channels[_0x2cf37f[_0xfff6('0x8')]][_0xfff6('0x41')]=utils[_0xfff6('0x1e')]();utils['info'](util[_0xfff6('0xa')](_0xfff6('0x42'),_0x2cf37f[_0xfff6('0x8')],channels[_0x2cf37f['uniqueid']][_0xfff6('0x41')]));}}catch(_0x15ea43){utils['error'](util[_0xfff6('0xa')](_0xfff6('0x40'),_0x2cf37f[_0xfff6('0x8')]),_0x15ea43);}};exports[_0xfff6('0x43')]=function(_0x31ef49){try{if(!_[_0xfff6('0x22')](channels[_0x31ef49[_0xfff6('0x8')]])){utils[_0xfff6('0x18')](util[_0xfff6('0xa')]('[%s][calls][musiconholdstop]',_0x31ef49[_0xfff6('0x8')]),_0x31ef49);if(!_[_0xfff6('0x22')](channels[_0x31ef49['uniqueid']][_0xfff6('0x41')])){channels[_0x31ef49[_0xfff6('0x8')]][_0xfff6('0x44')]+=utils[_0xfff6('0x31')](utils[_0xfff6('0x1e')](),channels[_0x31ef49['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0xfff6('0xa')](_0xfff6('0x45'),_0x31ef49[_0xfff6('0x8')],channels[_0x31ef49['uniqueid']]['mohtime']));delete channels[_0x31ef49[_0xfff6('0x8')]][_0xfff6('0x41')];}}}catch(_0x60b018){utils['error'](util[_0xfff6('0xa')](_0xfff6('0x46'),_0x31ef49['uniqueid']),_0x60b018);}};exports[_0xfff6('0x47')]=function(_0x107eda){try{if(!_[_0xfff6('0x22')](channels[_0x107eda[_0xfff6('0x8')]])){utils[_0xfff6('0x18')](util['format'](_0xfff6('0x48'),_0x107eda[_0xfff6('0x8')]),_0x107eda);if(!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')][_0xfff6('0x4a')])){utils['info'](util[_0xfff6('0xa')](_0xfff6('0x4b'),_0x107eda[_0xfff6('0x8')],_0x107eda[_0xfff6('0x4c')]));channels[_0x107eda['uniqueid']][_0xfff6('0x4d')]=_0x107eda[_0xfff6('0x4c')];}if(!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')]['xmd-phone'])){utils[_0xfff6('0x9')](util[_0xfff6('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x107eda['uniqueid'],_0x107eda[_0xfff6('0x4c')]));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x4e')]=_0x107eda[_0xfff6('0x4c')];channels[_0x107eda['uniqueid']][_0xfff6('0x2f')]='\x22'+_0x107eda['value']+'\x22\x20<'+_0x107eda['value']+'>';}if(!_['isNil'](_0x107eda[_0xfff6('0x49')][_0xfff6('0x4f')])||!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')][_0xfff6('0x50')])){utils['info'](util['format'](_0xfff6('0x51'),_0x107eda['uniqueid'],!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')]['xmd-callerid-preview'])?_0xfff6('0x4f'):_0xfff6('0x50'),_0x107eda['value']));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x2f')]=_0x107eda[_0xfff6('0x4c')];}if(!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')][_0xfff6('0x52')])||!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')]['xmcs-queue'])){utils['info'](util['format'](_0xfff6('0x51'),_0x107eda[_0xfff6('0x8')],!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')][_0xfff6('0x52')])?_0xfff6('0x52'):_0xfff6('0x53'),_0x107eda[_0xfff6('0x4c')]));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x54')]=_0xfff6('0x55');channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x56')]=_0x107eda['value'];channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0xd')]=!![];}if(!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')]['xmd-contactid'])){utils['info'](util[_0xfff6('0xa')](_0xfff6('0x57'),_0x107eda[_0xfff6('0x8')],_0x107eda[_0xfff6('0x4c')]));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x58')]=_0x107eda[_0xfff6('0x4c')];}if(!_[_0xfff6('0x22')](_0x107eda[_0xfff6('0x49')][_0xfff6('0x59')])){utils[_0xfff6('0x9')](util[_0xfff6('0xa')](_0xfff6('0x5a'),_0x107eda[_0xfff6('0x8')],_0x107eda['value']));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x5b')]=_0x107eda[_0xfff6('0x4c')];}if(!_[_0xfff6('0x22')](_0x107eda['variable'][_0xfff6('0x5c')])){utils['info'](util['format'](_0xfff6('0x5d'),_0x107eda[_0xfff6('0x8')],_0x107eda[_0xfff6('0x4c')]));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x5e')]=_0x107eda['value'];}if(!_['isNil'](_0x107eda[_0xfff6('0x49')][_0xfff6('0x5f')])){utils[_0xfff6('0x9')](util[_0xfff6('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x107eda[_0xfff6('0x8')],_0x107eda[_0xfff6('0x4c')]));channels[_0x107eda[_0xfff6('0x8')]][_0xfff6('0x5f')]=_0x107eda[_0xfff6('0x4c')];}}}catch(_0x1490c3){utils[_0xfff6('0x34')](util['format'](_0xfff6('0x48'),_0x107eda[_0xfff6('0x8')]),_0x1490c3);}};exports[_0xfff6('0x60')]=function(_0x206329){try{if(!_[_0xfff6('0x22')](channels[_0x206329[_0xfff6('0x8')]])){utils[_0xfff6('0x18')](util[_0xfff6('0xa')]('[%s][calls][newexten]',_0x206329[_0xfff6('0x8')]),_0x206329);utils['info'](util['format'](_0xfff6('0x61'),_0x206329[_0xfff6('0x8')],_0x206329[_0xfff6('0x62')],_0x206329['appdata']));if(_0x206329[_0xfff6('0x62')][_0xfff6('0x63')]()==_0xfff6('0x64')&&_['startsWith'](_0x206329[_0xfff6('0x65')][_0xfff6('0x63')](),_0xfff6('0x66'))){var _0x9ccc3b=_0x206329[_0xfff6('0x65')]['split']('=');var _0x48f6cd=_0x9ccc3b[0x0][_0xfff6('0x67')](_0x9ccc3b[0x0][_0xfff6('0x68')]('(')+0x1,_0x9ccc3b[0x0][_0xfff6('0x68')](')'));var _0x121192=_0x9ccc3b[0x1];channels[_0x206329[_0xfff6('0x8')]][_0x48f6cd]=_0x121192;}if(!_[_0xfff6('0x69')]([_0xfff6('0x2c'),_0xfff6('0x6a'),'execif','set',_0xfff6('0x6b')],_0x206329[_0xfff6('0x62')][_0xfff6('0x63')]())){channels[_0x206329['uniqueid']][_0xfff6('0x54')]=_0x206329[_0xfff6('0x62')];channels[_0x206329[_0xfff6('0x8')]][_0xfff6('0x56')]=_0x206329[_0xfff6('0x65')];}}}catch(_0x43f544){utils[_0xfff6('0x34')](util['format'](_0xfff6('0x6c'),_0x206329[_0xfff6('0x8')]),_0x43f544);}}; \ No newline at end of file +var _0xfc65=['error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','destinationchannel','answertime','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','xmd-callerid-preview','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','lastIndexOf','includes','hangup','noop','execif','set','gotoif','lastdata','lodash','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION'];(function(_0x2c65f4,_0x57811e){var _0x1f836f=function(_0x377506){while(--_0x377506){_0x2c65f4['push'](_0x2c65f4['shift']());}};_0x1f836f(++_0x57811e);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x4d7978,_0x2353d2){_0x4d7978=_0x4d7978-0x0;var _0x3d4179=_0xfc65[_0x4d7978];return _0x3d4179;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x5fc6('0x1'));var dispositions=[_0x5fc6('0x2'),_0x5fc6('0x3'),_0x5fc6('0x3'),_0x5fc6('0x2'),_0x5fc6('0x2'),_0x5fc6('0x2'),_0x5fc6('0x4'),_0x5fc6('0x5'),_0x5fc6('0x3'),_0x5fc6('0x3'),_0x5fc6('0x3')];var channels={};function writeDB(_0x1a9600){var _0x572941;if(transfers[_0x5fc6('0x6')][_0x1a9600[_0x5fc6('0x7')]]){_0x572941=_0x1a9600[_0x5fc6('0x7')];_0x1a9600[_0x5fc6('0x7')]=transfers[_0x5fc6('0x6')][_0x1a9600[_0x5fc6('0x7')]][_0x5fc6('0x8')];}utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0xb'),_0x1a9600['uniqueid'],_0x1a9600[_0x5fc6('0xc')],_0x1a9600['queue'],_0x1a9600[_0x5fc6('0xd')],_0x1a9600[_0x5fc6('0xe')],_0x1a9600[_0x5fc6('0xf')],_0x1a9600[_0x5fc6('0x10')],_0x1a9600['lastevent']));if(_0x1a9600[_0x5fc6('0x11')]){utils[_0x5fc6('0x12')](_0x1a9600[_0x5fc6('0x11')])[_0x5fc6('0x13')](function(_0x436a0c){if(_0x436a0c){_0x1a9600[_0x5fc6('0x14')]=_0x436a0c['id'];}utils[_0x5fc6('0x15')](_0x5fc6('0x16'),_0x1a9600);});}else{utils[_0x5fc6('0x15')](_0x5fc6('0x16'),_0x1a9600);}if(channels[_0x1a9600['uniqueid']]){delete channels[_0x1a9600['uniqueid']];}else if(_0x572941&&channels[_0x572941]){if(!transfers[_0x5fc6('0x6')][_0x572941][_0x5fc6('0x17')])delete transfers['blinds'][_0x572941];delete channels[_0x572941];}}exports[_0x5fc6('0x18')]=function(_0x168119){try{utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x1a'),_0x168119[_0x5fc6('0x7')]),_0x168119);if(_0x168119['uniqueid']==_0x168119[_0x5fc6('0x1b')]&&_0x168119[_0x5fc6('0xc')]!=_0x5fc6('0x1c')){utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x1d'),_0x168119[_0x5fc6('0x7')],_0x168119[_0x5fc6('0x1e')],_0x168119[_0x5fc6('0x1f')]));channels[_0x168119[_0x5fc6('0x7')]]={'uniqueid':_0x168119[_0x5fc6('0x7')],'accountcode':_0x168119[_0x5fc6('0x11')],'source':_0x168119[_0x5fc6('0xf')],'destination':_0x168119[_0x5fc6('0x1f')],'destinationcontext':_0x168119[_0x5fc6('0x1e')],'channel':_0x168119['channel'],'starttime':utils[_0x5fc6('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5fc6('0x2'),'amaflags':_0x5fc6('0x21')};}}catch(_0x2342f4){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x1a'),_0x168119[_0x5fc6('0x7')]),_0x2342f4);}};exports['newstate']=function(_0x122890){try{utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x23'),_0x122890[_0x5fc6('0x7')]),_0x122890);if(!_[_0x5fc6('0x24')](channels[_0x122890['uniqueid']])&&_0x122890[_0x5fc6('0x25')]==0x6){utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x26'),_0x122890[_0x5fc6('0x7')],_0x122890[_0x5fc6('0x1e')],_0x122890[_0x5fc6('0xc')]));if(_[_0x5fc6('0x24')](channels[_0x122890['uniqueid']][_0x5fc6('0x27')])){channels[_0x122890[_0x5fc6('0x7')]][_0x5fc6('0x27')]=utils[_0x5fc6('0x20')]();}}else if(!_[_0x5fc6('0x24')](channels[_0x122890[_0x5fc6('0x1b')]])&&_0x122890[_0x5fc6('0x25')]==0x6&&_0x122890[_0x5fc6('0x1e')]!=_0x5fc6('0x28')){utils['info'](util[_0x5fc6('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x122890[_0x5fc6('0x7')],_0x122890[_0x5fc6('0x1b')],_0x122890[_0x5fc6('0x1e')],_0x122890[_0x5fc6('0xc')]));channels[_0x122890[_0x5fc6('0x1b')]]['accountcode']=_0x122890[_0x5fc6('0x11')];channels[_0x122890[_0x5fc6('0x1b')]][_0x5fc6('0x29')]=_0x122890[_0x5fc6('0xc')];if(_[_0x5fc6('0x24')](channels[_0x122890[_0x5fc6('0x1b')]][_0x5fc6('0x2a')])){channels[_0x122890[_0x5fc6('0x1b')]]['answertime']=utils[_0x5fc6('0x20')]();}channels[_0x122890[_0x5fc6('0x1b')]]['disposition']=dispositions[_['toNumber'](_0x122890[_0x5fc6('0x25')])]||_0x5fc6('0x4');}}catch(_0x554876){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x23'),_0x122890[_0x5fc6('0x7')]),_0x554876);}};exports['hangup']=function(_0x52e98b){try{if(!_[_0x5fc6('0x24')](channels[_0x52e98b[_0x5fc6('0x7')]])){utils['debug'](util['format'](_0x5fc6('0x2b'),_0x52e98b[_0x5fc6('0x7')]),_0x52e98b);if(_['isNil'](channels[_0x52e98b[_0x5fc6('0x7')]]['callerid'])){channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2c')]=_0x52e98b[_0x5fc6('0x2d')]+'\x20<'+_0x52e98b[_0x5fc6('0xf')]+'>';}utils['info'](util[_0x5fc6('0xa')](_0x5fc6('0x2e'),_0x52e98b[_0x5fc6('0x7')],channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2c')],_0x52e98b[_0x5fc6('0x2f')]));channels[_0x52e98b['uniqueid']][_0x5fc6('0x30')]=utils['now']();channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x31')]=utils['diffTime'](channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x30')],channels[_0x52e98b['uniqueid']]['starttime']);channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x32')]=channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2a')]?utils[_0x5fc6('0x33')](channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x30')],channels[_0x52e98b[_0x5fc6('0x7')]][_0x5fc6('0x2a')]):0x0;writeDB(channels[_0x52e98b[_0x5fc6('0x7')]]);}}catch(_0x326956){utils['error'](util[_0x5fc6('0xa')](_0x5fc6('0x2b'),_0x52e98b[_0x5fc6('0x7')]),_0x326956);}};exports[_0x5fc6('0x34')]=function(_0x141d04){try{if(!_['isNil'](channels[_0x141d04['localtwolinkedid']])){utils['debug'](util[_0x5fc6('0xa')](_0x5fc6('0x35'),_0x141d04[_0x5fc6('0x36')]),_0x141d04);if(channels[_0x141d04[_0x5fc6('0x37')]]['channel']==_0x141d04[_0x5fc6('0x38')]){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0x39'),_0x141d04[_0x5fc6('0x36')],_0x141d04[_0x5fc6('0x37')],_0x141d04['secondtransfererchannel']));channels[_0x141d04[_0x5fc6('0x37')]]['destinationchannel']=_0x141d04['secondtransfererchannel'];channels[_0x141d04['localtwolinkedid']][_0x5fc6('0x3a')]='_attended';}else if(channels[_0x141d04[_0x5fc6('0x37')]][_0x5fc6('0xc')]=_0x141d04[_0x5fc6('0x3b')]){utils['info'](util[_0x5fc6('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x141d04[_0x5fc6('0x36')],_0x141d04[_0x5fc6('0x37')],_0x141d04['origtransfererchannel']));channels[_0x141d04[_0x5fc6('0x37')]]['destinationchannel']=_0x141d04[_0x5fc6('0x3c')];channels[_0x141d04[_0x5fc6('0x37')]][_0x5fc6('0x3a')]=_0x5fc6('0x3d');}}}catch(_0x4f8431){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x35'),_0x141d04[_0x5fc6('0x36')]),_0x4f8431);}};exports['musiconholdstart']=function(_0x4540dd){try{if(!_[_0x5fc6('0x24')](channels[_0x4540dd[_0x5fc6('0x7')]])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x3e'),_0x4540dd[_0x5fc6('0x7')]),_0x4540dd);channels[_0x4540dd['uniqueid']][_0x5fc6('0x3f')]=utils[_0x5fc6('0x20')]();utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x40'),_0x4540dd[_0x5fc6('0x7')],channels[_0x4540dd[_0x5fc6('0x7')]][_0x5fc6('0x3f')]));}}catch(_0x46dbfd){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')](_0x5fc6('0x3e'),_0x4540dd[_0x5fc6('0x7')]),_0x46dbfd);}};exports['musiconholdstop']=function(_0x30614c){try{if(!_[_0x5fc6('0x24')](channels[_0x30614c[_0x5fc6('0x7')]])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')]('[%s][calls][musiconholdstop]',_0x30614c[_0x5fc6('0x7')]),_0x30614c);if(!_[_0x5fc6('0x24')](channels[_0x30614c['uniqueid']][_0x5fc6('0x3f')])){channels[_0x30614c[_0x5fc6('0x7')]][_0x5fc6('0x41')]+=utils[_0x5fc6('0x33')](utils[_0x5fc6('0x20')](),channels[_0x30614c[_0x5fc6('0x7')]][_0x5fc6('0x3f')]);utils['info'](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x30614c[_0x5fc6('0x7')],channels[_0x30614c[_0x5fc6('0x7')]][_0x5fc6('0x41')]));delete channels[_0x30614c['uniqueid']][_0x5fc6('0x3f')];}}}catch(_0x220684){utils['error'](util[_0x5fc6('0xa')](_0x5fc6('0x42'),_0x30614c[_0x5fc6('0x7')]),_0x220684);}};exports['varset']=function(_0x2acc84){try{if(!_[_0x5fc6('0x24')](channels[_0x2acc84['uniqueid']])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x43'),_0x2acc84[_0x5fc6('0x7')]),_0x2acc84);if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x45')])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2acc84['uniqueid'],_0x2acc84['value']));channels[_0x2acc84[_0x5fc6('0x7')]]['source']=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['xmd-phone'])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0x47'),_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84['uniqueid']]['destination']=_0x2acc84['value'];channels[_0x2acc84['uniqueid']][_0x5fc6('0x2c')]='\x22'+_0x2acc84[_0x5fc6('0x46')]+'\x22\x20<'+_0x2acc84[_0x5fc6('0x46')]+'>';}if(!_['isNil'](_0x2acc84['variable']['xmd-callerid-preview'])||!_[_0x5fc6('0x24')](_0x2acc84['variable'][_0x5fc6('0x48')])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2acc84[_0x5fc6('0x7')],!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['xmd-callerid-preview'])?_0x5fc6('0x49'):_0x5fc6('0x48'),_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x2c')]=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x4a')])||!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x4b')])){utils[_0x5fc6('0x9')](util['format'](_0x5fc6('0x4c'),_0x2acc84[_0x5fc6('0x7')],!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x4a')])?_0x5fc6('0x4a'):'xmcs-queue',_0x2acc84['value']));channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x4d')]=_0x5fc6('0x4e');channels[_0x2acc84[_0x5fc6('0x7')]]['lastdata']=_0x2acc84[_0x5fc6('0x46')];channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x4f')]=!![];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x50')])){utils['info'](util[_0x5fc6('0xa')](_0x5fc6('0x51'),_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]]['ContactId']=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['xmd-cdrtype'])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84['uniqueid']][_0x5fc6('0x52')]=_0x2acc84[_0x5fc6('0x46')];}if(!_['isNil'](_0x2acc84[_0x5fc6('0x44')][_0x5fc6('0x53')])){utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]][_0x5fc6('0x54')]=_0x2acc84[_0x5fc6('0x46')];}if(!_[_0x5fc6('0x24')](_0x2acc84[_0x5fc6('0x44')]['sipcallid'])){utils['info'](util[_0x5fc6('0xa')](_0x5fc6('0x55'),_0x2acc84[_0x5fc6('0x7')],_0x2acc84[_0x5fc6('0x46')]));channels[_0x2acc84[_0x5fc6('0x7')]]['sipcallid']=_0x2acc84[_0x5fc6('0x46')];}}}catch(_0x4d1348){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')]('[%s][calls][varset]',_0x2acc84[_0x5fc6('0x7')]),_0x4d1348);}};exports[_0x5fc6('0x56')]=function(_0x2713bb){try{if(!_['isNil'](channels[_0x2713bb[_0x5fc6('0x7')]])){utils[_0x5fc6('0x19')](util[_0x5fc6('0xa')](_0x5fc6('0x57'),_0x2713bb[_0x5fc6('0x7')]),_0x2713bb);utils[_0x5fc6('0x9')](util[_0x5fc6('0xa')](_0x5fc6('0x58'),_0x2713bb[_0x5fc6('0x7')],_0x2713bb[_0x5fc6('0x59')],_0x2713bb[_0x5fc6('0x5a')]));if(_0x2713bb['application'][_0x5fc6('0x5b')]()=='set'&&_[_0x5fc6('0x5c')](_0x2713bb[_0x5fc6('0x5a')][_0x5fc6('0x5b')](),_0x5fc6('0x5d'))){var _0x44ec64=_0x2713bb[_0x5fc6('0x5a')][_0x5fc6('0x5e')]('=');var _0x32f586=_0x44ec64[0x0]['substring'](_0x44ec64[0x0][_0x5fc6('0x5f')]('(')+0x1,_0x44ec64[0x0]['lastIndexOf'](')'));var _0x47c554=_0x44ec64[0x1];channels[_0x2713bb['uniqueid']][_0x32f586]=_0x47c554;}if(!_[_0x5fc6('0x60')]([_0x5fc6('0x61'),_0x5fc6('0x62'),_0x5fc6('0x63'),_0x5fc6('0x64'),_0x5fc6('0x65')],_0x2713bb[_0x5fc6('0x59')]['toLowerCase']())){channels[_0x2713bb[_0x5fc6('0x7')]][_0x5fc6('0x4d')]=_0x2713bb[_0x5fc6('0x59')];channels[_0x2713bb[_0x5fc6('0x7')]][_0x5fc6('0x66')]=_0x2713bb['appdata'];}}}catch(_0x5dfab6){utils[_0x5fc6('0x22')](util[_0x5fc6('0xa')]('[%s][calls][newexten]',_0x2713bb['uniqueid']),_0x5dfab6);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b09aeb4..8e520c6 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 _0x7638=['fullybooted','[core]\x20fullybooted','[core]\x20error','close','./utils','connect','[core]\x20connected','shutdown','info','[core]\x20shutdown'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0x7638,0x11c));var _0x8763=function(_0x4d67b1,_0x41f97e){_0x4d67b1=_0x4d67b1-0x0;var _0x492a40=_0x7638[_0x4d67b1];return _0x492a40;};'use strict';var utils=require(_0x8763('0x0'));exports[_0x8763('0x1')]=function(){utils['info'](_0x8763('0x2'));};exports[_0x8763('0x3')]=function(){utils[_0x8763('0x4')](_0x8763('0x5'));};exports[_0x8763('0x6')]=function(){utils[_0x8763('0x4')](_0x8763('0x7'));};exports['error']=function(_0x1d51c2){utils['error'](_0x8763('0x8'),_0x1d51c2);};exports[_0x8763('0x9')]=function(){utils[_0x8763('0x4')]('[core]\x20close');};exports['managerevent']=function(_0x5b3d9c){}; \ No newline at end of file +var _0x4718=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x2a6297,_0xdf8f8f){var _0x2bb76a=function(_0x202a95){while(--_0x202a95){_0x2a6297['push'](_0x2a6297['shift']());}};_0x2bb76a(++_0xdf8f8f);}(_0x4718,0x18d));var _0x8471=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4718[_0x4b055c];return _0x4b62bb;};'use strict';var utils=require(_0x8471('0x0'));exports[_0x8471('0x1')]=function(){utils[_0x8471('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x8471('0x2')](_0x8471('0x3'));};exports[_0x8471('0x4')]=function(){utils[_0x8471('0x2')](_0x8471('0x5'));};exports[_0x8471('0x6')]=function(_0x323831){utils[_0x8471('0x6')](_0x8471('0x7'),_0x323831);};exports['close']=function(){utils[_0x8471('0x2')](_0x8471('0x8'));};exports[_0x8471('0x9')]=function(_0x15979f){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b7e6358..11b6ac1 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 _0x57b8=['dialstring','connectedlinenum','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','set','startsWith','cdr(routeid)','appdata','split','error','varset','[%s][dials][varset]','isNil','variable','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','complete','endtime','holdtime','billableseconds','diffTime','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel'];(function(_0x441db3,_0x10f359){var _0x16c05d=function(_0x4c0d4e){while(--_0x4c0d4e){_0x441db3['push'](_0x441db3['shift']());}};_0x16c05d(++_0x10f359);}(_0x57b8,0x1bd));var _0x857b=function(_0x491089,_0x4fd87a){_0x491089=_0x491089-0x0;var _0x47696f=_0x57b8[_0x491089];return _0x47696f;};'use strict';var _=require('lodash');var util=require(_0x857b('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x5932a3){utils[_0x857b('0x1')](util[_0x857b('0x2')](_0x857b('0x3'),_0x5932a3['uniqueid'],_0x5932a3[_0x857b('0x4')],_0x5932a3[_0x857b('0x5')],_0x5932a3['calleridnum'],_0x5932a3[_0x857b('0x6')],_0x5932a3['dialstatus']));utils[_0x857b('0x7')](_0x857b('0x8'),_0x5932a3);delete dials[_0x5932a3[_0x857b('0x9')]];}exports[_0x857b('0xa')]=function(_0x4fbff2){try{utils[_0x857b('0xb')](util[_0x857b('0x2')]('[%s][dials][newexten]',_0x4fbff2['uniqueid']),_0x4fbff2);utils[_0x857b('0x1')](util[_0x857b('0x2')](_0x857b('0xc'),_0x4fbff2['uniqueid'],_0x4fbff2['application'],_0x4fbff2['appdata']));if(_0x4fbff2['application']['toLowerCase']()==_0x857b('0xd')&&_[_0x857b('0xe')](_0x4fbff2['appdata']['toLowerCase'](),_0x857b('0xf'))){var _0x42a14a=_0x4fbff2[_0x857b('0x10')][_0x857b('0x11')]('=');dials[_0x4fbff2['uniqueid']]={'routeId':_0x42a14a[0x1]};}}catch(_0x25cf66){utils[_0x857b('0x12')](util['format']('[%s][dials][newexten]',_0x4fbff2['uniqueid']),_0x25cf66);}};exports[_0x857b('0x13')]=function(_0x583b30){try{utils[_0x857b('0xb')](util[_0x857b('0x2')](_0x857b('0x14'),_0x583b30[_0x857b('0x9')]),_0x583b30);if(!_[_0x857b('0x15')](_0x583b30[_0x857b('0x16')]['outboundrouteid'])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x583b30[_0x857b('0x9')],_0x583b30[_0x857b('0x17')]));dials[_0x583b30['uniqueid']]={'routeId':_0x583b30[_0x857b('0x17')]};}}catch(_0x242c8a){utils['error'](util[_0x857b('0x2')]('[%s][dials][varset]',_0x583b30['uniqueid']),_0x242c8a);}};exports['dialbegin']=function(_0x1facc5){try{if(!_['isNil'](dials[_0x1facc5['uniqueid']])){utils[_0x857b('0xb')](util[_0x857b('0x2')](_0x857b('0x18'),_0x1facc5[_0x857b('0x9')]),_0x1facc5);dials[_0x1facc5[_0x857b('0x9')]]=_[_0x857b('0x19')](dials[_0x1facc5[_0x857b('0x9')]],_0x1facc5);dials[_0x1facc5['uniqueid']][_0x857b('0x1a')]=utils[_0x857b('0x1b')]();dials[_0x1facc5[_0x857b('0x9')]][_0x857b('0x1c')]=_0x857b('0x1d');utils[_0x857b('0x1')](util[_0x857b('0x2')](_0x857b('0x1e'),_0x1facc5[_0x857b('0x9')],dials[_0x1facc5[_0x857b('0x9')]][_0x857b('0x1a')]));}}catch(_0x21fea7){utils[_0x857b('0x12')](util['format'](_0x857b('0x18'),_0x1facc5[_0x857b('0x9')]),_0x21fea7);}};exports[_0x857b('0x1f')]=function(_0x346ed1){try{if(!_[_0x857b('0x15')](dials[_0x346ed1[_0x857b('0x9')]])){utils['debug'](util[_0x857b('0x2')]('[%s][dials][dialend]',_0x346ed1[_0x857b('0x9')]),_0x346ed1);dials[_0x346ed1['uniqueid']][_0x857b('0x20')]=_0x346ed1[_0x857b('0x20')];if(_0x346ed1[_0x857b('0x20')]==_0x857b('0x21')){dials[_0x346ed1['uniqueid']]=_['assign'](dials[_0x346ed1[_0x857b('0x9')]],_0x346ed1);dials[_0x346ed1['uniqueid']][_0x857b('0x22')]=utils['now']();dials[_0x346ed1[_0x857b('0x9')]]['lastevent']='connect';utils[_0x857b('0x1')](util[_0x857b('0x2')](_0x857b('0x23'),_0x346ed1[_0x857b('0x9')],_0x346ed1[_0x857b('0x20')],dials[_0x346ed1[_0x857b('0x9')]][_0x857b('0x22')]));}else{utils[_0x857b('0x1')](util[_0x857b('0x2')]('[%s][dials][dialend]\x20dialstatus:%s',_0x346ed1[_0x857b('0x9')],_0x346ed1[_0x857b('0x20')]));}}}catch(_0x28abb5){utils[_0x857b('0x12')](util[_0x857b('0x2')](_0x857b('0x24'),_0x346ed1['uniqueid']),_0x28abb5);}};exports['hangup']=function(_0x2d8b76){try{if(!_['isNil'](dials[_0x2d8b76['uniqueid']])){utils[_0x857b('0xb')](util[_0x857b('0x2')](_0x857b('0x25'),_0x2d8b76[_0x857b('0x9')]),_0x2d8b76);utils[_0x857b('0x1')](util['format'](_0x857b('0x26'),_0x2d8b76[_0x857b('0x9')],_0x2d8b76[_0x857b('0x27')],_0x2d8b76['calleridname'],_0x2d8b76['cause-txt']));dials[_0x2d8b76['uniqueid']]=_['assign'](dials[_0x2d8b76[_0x857b('0x9')]],{'endtime':utils[_0x857b('0x1b')](),'lastevent':_0x857b('0x28')});dials[_0x2d8b76['uniqueid']]['duration']=utils['diffTime'](dials[_0x2d8b76['uniqueid']][_0x857b('0x29')],dials[_0x2d8b76['uniqueid']][_0x857b('0x1a')]);dials[_0x2d8b76[_0x857b('0x9')]][_0x857b('0x2a')]=utils['diffTime'](dials[_0x2d8b76[_0x857b('0x9')]]['answertime']||dials[_0x2d8b76[_0x857b('0x9')]]['endtime'],dials[_0x2d8b76['uniqueid']]['starttime']);dials[_0x2d8b76[_0x857b('0x9')]][_0x857b('0x2b')]=dials[_0x2d8b76[_0x857b('0x9')]]['answertime']?utils[_0x857b('0x2c')](dials[_0x2d8b76[_0x857b('0x9')]][_0x857b('0x29')],dials[_0x2d8b76[_0x857b('0x9')]][_0x857b('0x22')]):0x0;writeDB(dials[_0x2d8b76[_0x857b('0x9')]]);}}catch(_0x3b9cbc){utils[_0x857b('0x12')](util[_0x857b('0x2')](_0x857b('0x25'),_0x2d8b76[_0x857b('0x9')]),_0x3b9cbc);}}; \ No newline at end of file +var _0x4153=['request','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','debug','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','billableseconds','lodash','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x4153,0x90));var _0x3415=function(_0x59cfce,_0x3dbbc9){_0x59cfce=_0x59cfce-0x0;var _0x1cf483=_0x4153[_0x59cfce];return _0x1cf483;};'use strict';var _=require(_0x3415('0x0'));var util=require(_0x3415('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x20a703){utils[_0x3415('0x2')](util['format'](_0x3415('0x3'),_0x20a703[_0x3415('0x4')],_0x20a703[_0x3415('0x5')],_0x20a703[_0x3415('0x6')],_0x20a703[_0x3415('0x7')],_0x20a703['connectedlinenum'],_0x20a703[_0x3415('0x8')]));utils[_0x3415('0x9')]('CreateVoiceDialReport',_0x20a703);delete dials[_0x20a703[_0x3415('0x4')]];}exports['newexten']=function(_0x533658){try{utils['debug'](util[_0x3415('0xa')](_0x3415('0xb'),_0x533658[_0x3415('0x4')]),_0x533658);utils[_0x3415('0x2')](util['format'](_0x3415('0xc'),_0x533658[_0x3415('0x4')],_0x533658[_0x3415('0xd')],_0x533658[_0x3415('0xe')]));if(_0x533658[_0x3415('0xd')][_0x3415('0xf')]()==_0x3415('0x10')&&_[_0x3415('0x11')](_0x533658[_0x3415('0xe')][_0x3415('0xf')](),_0x3415('0x12'))){var _0x579f84=_0x533658[_0x3415('0xe')][_0x3415('0x13')]('=');dials[_0x533658[_0x3415('0x4')]]={'routeId':_0x579f84[0x1]};}}catch(_0x17792f){utils['error'](util['format'](_0x3415('0xb'),_0x533658[_0x3415('0x4')]),_0x17792f);}};exports[_0x3415('0x14')]=function(_0x1a4b6c){try{utils['debug'](util[_0x3415('0xa')](_0x3415('0x15'),_0x1a4b6c[_0x3415('0x4')]),_0x1a4b6c);if(!_['isNil'](_0x1a4b6c[_0x3415('0x16')][_0x3415('0x17')])){utils[_0x3415('0x2')](util['format'](_0x3415('0x18'),_0x1a4b6c[_0x3415('0x4')],_0x1a4b6c['value']));dials[_0x1a4b6c[_0x3415('0x4')]]={'routeId':_0x1a4b6c[_0x3415('0x19')]};}}catch(_0x7346b0){utils[_0x3415('0x1a')](util[_0x3415('0xa')](_0x3415('0x15'),_0x1a4b6c[_0x3415('0x4')]),_0x7346b0);}};exports[_0x3415('0x1b')]=function(_0xc26d5c){try{if(!_[_0x3415('0x1c')](dials[_0xc26d5c['uniqueid']])){utils[_0x3415('0x1d')](util[_0x3415('0xa')]('[%s][dials][dialbegin]',_0xc26d5c[_0x3415('0x4')]),_0xc26d5c);dials[_0xc26d5c[_0x3415('0x4')]]=_['assign'](dials[_0xc26d5c['uniqueid']],_0xc26d5c);dials[_0xc26d5c['uniqueid']][_0x3415('0x1e')]=utils[_0x3415('0x1f')]();dials[_0xc26d5c[_0x3415('0x4')]][_0x3415('0x20')]=_0x3415('0x21');utils[_0x3415('0x2')](util['format'](_0x3415('0x22'),_0xc26d5c[_0x3415('0x4')],dials[_0xc26d5c[_0x3415('0x4')]][_0x3415('0x1e')]));}}catch(_0x2bb093){utils[_0x3415('0x1a')](util['format'](_0x3415('0x23'),_0xc26d5c['uniqueid']),_0x2bb093);}};exports[_0x3415('0x24')]=function(_0x386998){try{if(!_[_0x3415('0x1c')](dials[_0x386998[_0x3415('0x4')]])){utils[_0x3415('0x1d')](util[_0x3415('0xa')](_0x3415('0x25'),_0x386998[_0x3415('0x4')]),_0x386998);dials[_0x386998['uniqueid']][_0x3415('0x8')]=_0x386998[_0x3415('0x8')];if(_0x386998['dialstatus']==_0x3415('0x26')){dials[_0x386998[_0x3415('0x4')]]=_[_0x3415('0x27')](dials[_0x386998[_0x3415('0x4')]],_0x386998);dials[_0x386998[_0x3415('0x4')]][_0x3415('0x28')]=utils[_0x3415('0x1f')]();dials[_0x386998['uniqueid']][_0x3415('0x20')]=_0x3415('0x29');utils[_0x3415('0x2')](util[_0x3415('0xa')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x386998[_0x3415('0x4')],_0x386998[_0x3415('0x8')],dials[_0x386998[_0x3415('0x4')]]['answertime']));}else{utils[_0x3415('0x2')](util[_0x3415('0xa')]('[%s][dials][dialend]\x20dialstatus:%s',_0x386998[_0x3415('0x4')],_0x386998[_0x3415('0x8')]));}}}catch(_0x3a83b8){utils[_0x3415('0x1a')](util['format']('[%s][dials][dialend]',_0x386998[_0x3415('0x4')]),_0x3a83b8);}};exports[_0x3415('0x2a')]=function(_0x54e762){try{if(!_['isNil'](dials[_0x54e762['uniqueid']])){utils['debug'](util[_0x3415('0xa')]('[%s][dials][hangup]',_0x54e762[_0x3415('0x4')]),_0x54e762);utils[_0x3415('0x2')](util[_0x3415('0xa')](_0x3415('0x2b'),_0x54e762[_0x3415('0x4')],_0x54e762[_0x3415('0x7')],_0x54e762[_0x3415('0x2c')],_0x54e762[_0x3415('0x2d')]));dials[_0x54e762[_0x3415('0x4')]]=_[_0x3415('0x27')](dials[_0x54e762[_0x3415('0x4')]],{'endtime':utils[_0x3415('0x1f')](),'lastevent':_0x3415('0x2e')});dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x2f')]=utils[_0x3415('0x30')](dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x31')],dials[_0x54e762['uniqueid']]['starttime']);dials[_0x54e762['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x28')]||dials[_0x54e762['uniqueid']]['endtime'],dials[_0x54e762[_0x3415('0x4')]]['starttime']);dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x32')]=dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x28')]?utils[_0x3415('0x30')](dials[_0x54e762[_0x3415('0x4')]][_0x3415('0x31')],dials[_0x54e762['uniqueid']]['answertime']):0x0;writeDB(dials[_0x54e762[_0x3415('0x4')]]);}}catch(_0x473ab1){utils[_0x3415('0x1a')](util[_0x3415('0xa')]('[%s][dials][hangup]',_0x54e762[_0x3415('0x4')]),_0x473ab1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 911d3d2..dc8bf65 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 _0x44a0=['agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','../../config/environment','./utils','util','xdr','disabled','env','local','port','asterisk','username','keepConnected','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]'];(function(_0x274bac,_0x155569){var _0x511907=function(_0x1c7816){while(--_0x1c7816){_0x274bac['push'](_0x274bac['shift']());}};_0x511907(++_0x155569);}(_0x44a0,0x1c0));var _0x044a=function(_0x317ed4,_0x18f69c){_0x317ed4=_0x317ed4-0x0;var _0x5321ff=_0x44a0[_0x317ed4];return _0x5321ff;};var AsteriskManager=require('asterisk-manager');var config=require(_0x044a('0x0'));var utils=require(_0x044a('0x1'));var util=require(_0x044a('0x2'));var isXDREnabled=config[_0x044a('0x3')]&&config[_0x044a('0x3')]['disabled']?!config['xdr'][_0x044a('0x4')]:!![];var isProduction=config[_0x044a('0x5')]==='production'||![];var isLocalAsterisk=config[_0x044a('0x3')]&&config['xdr'][_0x044a('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x044a('0x7')],config[_0x044a('0x8')]['ip'],config[_0x044a('0x8')][_0x044a('0x9')],config[_0x044a('0x8')]['password'],!![]);ami[_0x044a('0xa')]();if(!isXDREnabled){utils['info'](_0x044a('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x044a('0xc'));var calls=require(_0x044a('0xd'));var queues=require(_0x044a('0xe'));var recordings=require(_0x044a('0xf'));var members=require(_0x044a('0x10'));var dials=require('./dials.controller');var transfers=require(_0x044a('0x11'));var core=require(_0x044a('0x12'));ami['on'](_0x044a('0x13'),core[_0x044a('0x13')]);ami['on'](_0x044a('0x14'),core[_0x044a('0x14')]);ami['on'](_0x044a('0x15'),core[_0x044a('0x15')]);ami['on'](_0x044a('0x16'),core[_0x044a('0x16')]);ami['on'](_0x044a('0x17'),core[_0x044a('0x17')]);ami['on']('managerevent',core[_0x044a('0x18')]);ami['on'](_0x044a('0x19'),function(_0x21d624){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x1c'),_0x21d624[_0x044a('0x1d')]),_0x21d624);members[_0x044a('0x19')](_0x21d624);}catch(_0xda7cd0){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x1c'),_0x21d624['device']),_0xda7cd0);}});ami['on'](_0x044a('0x1e'),function(_0x1a042f){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x1f'),_0x1a042f[_0x044a('0x20')]),_0x1a042f);agents['agentcalled'](_0x1a042f);}catch(_0x26b267){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x1f'),_0x1a042f[_0x044a('0x20')]),_0x26b267);}});ami['on'](_0x044a('0x21'),function(_0x37ec86){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x22'),_0x37ec86[_0x044a('0x20')]),_0x37ec86);agents['agentringnoanswer'](_0x37ec86);}catch(_0x9893e7){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x22'),_0x37ec86[_0x044a('0x20')]),_0x9893e7);}});ami['on'](_0x044a('0x23'),function(_0x243c5d){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x24'),_0x243c5d[_0x044a('0x20')]),_0x243c5d);agents[_0x044a('0x23')](_0x243c5d);queues[_0x044a('0x23')](_0x243c5d);}catch(_0x1f96a7){utils[_0x044a('0x16')](util['format'](_0x044a('0x24'),_0x243c5d[_0x044a('0x20')]),_0x1f96a7);}});ami['on'](_0x044a('0x25'),function(_0x4331be){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x26'),_0x4331be['uniqueid']),_0x4331be);agents[_0x044a('0x25')](_0x4331be);queues['agentcomplete'](_0x4331be);members[_0x044a('0x25')](_0x4331be);}catch(_0x5b7038){utils[_0x044a('0x16')](util['format'](_0x044a('0x26'),_0x4331be['uniqueid']),_0x5b7038);}});ami['on'](_0x044a('0x27'),function(_0x1f1520){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x28'),_0x1f1520[_0x044a('0x20')]),_0x1f1520);agents[_0x044a('0x27')](_0x1f1520);queues[_0x044a('0x27')](_0x1f1520);}catch(_0x41897d){utils[_0x044a('0x16')](util['format'](_0x044a('0x28'),_0x1f1520['uniqueid']),_0x41897d);}});ami['on']('queuecallerjoin',function(_0x47e951){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x29'),_0x47e951[_0x044a('0x20')]),_0x47e951);queues[_0x044a('0x2a')](_0x47e951);recordings[_0x044a('0x2a')](_0x47e951);}catch(_0x3d6d08){utils['error'](util[_0x044a('0x1b')](_0x044a('0x29'),_0x47e951[_0x044a('0x20')]),_0x3d6d08);}});ami['on'](_0x044a('0x2b'),function(_0x29a453){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x2c'),_0x29a453[_0x044a('0x20')]),_0x29a453);queues[_0x044a('0x2b')](_0x29a453);}catch(_0x1e0ae0){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x2c'),_0x29a453[_0x044a('0x20')]),_0x1e0ae0);}});ami['on'](_0x044a('0x2d'),function(_0x40027){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x2e'),_0x40027[_0x044a('0x20')]),_0x40027);queues['musiconholdstart'](_0x40027);calls[_0x044a('0x2d')](_0x40027);}catch(_0x1be458){utils['error'](util[_0x044a('0x1b')]('[%s][index][musiconholdstart]',_0x40027[_0x044a('0x20')]),_0x1be458);}});ami['on']('musiconholdstop',function(_0x4f6573){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x2f'),_0x4f6573[_0x044a('0x20')]),_0x4f6573);queues[_0x044a('0x30')](_0x4f6573);calls[_0x044a('0x30')](_0x4f6573);}catch(_0x41ac3b){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x2f'),_0x4f6573[_0x044a('0x20')]),_0x41ac3b);}});ami['on'](_0x044a('0x31'),function(_0x151f06){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x32'),_0x151f06[_0x044a('0x20')]),_0x151f06);calls['newstate'](_0x151f06);recordings[_0x044a('0x31')](_0x151f06);}catch(_0x2cb371){utils['error'](util[_0x044a('0x1b')](_0x044a('0x32'),_0x151f06[_0x044a('0x20')]),_0x2cb371);}});ami['on'](_0x044a('0x33'),function(_0x1578c5){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x34'),_0x1578c5[_0x044a('0x20')]),_0x1578c5);calls[_0x044a('0x33')](_0x1578c5);recordings[_0x044a('0x33')](_0x1578c5);dials[_0x044a('0x33')](_0x1578c5);agents[_0x044a('0x33')](_0x1578c5);queues[_0x044a('0x33')](_0x1578c5);}catch(_0x387289){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x34'),_0x1578c5['uniqueid']),_0x387289);}});ami['on'](_0x044a('0x35'),function(_0x4aa271){try{utils['debug'](util['format'](_0x044a('0x36'),_0x4aa271[_0x044a('0x20')]),_0x4aa271);members[_0x044a('0x35')](_0x4aa271);}catch(_0x2c7e70){utils['error'](util[_0x044a('0x1b')]('[%s][index][cdr]',_0x4aa271[_0x044a('0x20')]),_0x2c7e70);}});ami['on']('blindtransfer',function(_0x49024f){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x37'),_0x49024f[_0x044a('0x20')]),_0x49024f);queues[_0x044a('0x38')](_0x49024f);agents[_0x044a('0x38')](_0x49024f);transfers['blindtransfer'](_0x49024f);recordings[_0x044a('0x38')](_0x49024f);}catch(_0x1e142c){utils[_0x044a('0x16')](util['format']('[%s][index][blindtransfer]',_0x49024f['uniqueid']),_0x1e142c);}});ami['on'](_0x044a('0x39'),function(_0x5d95dd){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x3a'),_0x5d95dd['origtransfereruniqueid']),_0x5d95dd);queues[_0x044a('0x39')](_0x5d95dd);transfers['attendedtransfer'](_0x5d95dd);agents['attendedtransfer'](_0x5d95dd);calls['attendedtransfer'](_0x5d95dd);}catch(_0x2cb656){utils['error'](util[_0x044a('0x1b')]('[%s][index][attendedtransfer]',_0x5d95dd['origtransfereruniqueid']),_0x2cb656);}});ami['on'](_0x044a('0x3b'),function(_0x3294b8){try{utils[_0x044a('0x1a')](util['format'](_0x044a('0x3c'),_0x3294b8[_0x044a('0x20')]),_0x3294b8);queues[_0x044a('0x3b')](_0x3294b8);recordings['varset'](_0x3294b8);calls[_0x044a('0x3b')](_0x3294b8);dials[_0x044a('0x3b')](_0x3294b8);}catch(_0x59b6e8){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x3c'),_0x3294b8[_0x044a('0x20')]),_0x59b6e8);}});ami['on']('newexten',function(_0x33a0f7){try{utils['debug'](util['format'](_0x044a('0x3d'),_0x33a0f7[_0x044a('0x20')]),_0x33a0f7);calls[_0x044a('0x3e')](_0x33a0f7);recordings['newexten'](_0x33a0f7);dials[_0x044a('0x3e')](_0x33a0f7);}catch(_0x5b5473){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x3d'),_0x33a0f7['uniqueid']),_0x5b5473);}});ami['on'](_0x044a('0x3f'),function(_0x166a7c){try{utils[_0x044a('0x1a')](util['format']('[%s][index][newchannel]',_0x166a7c[_0x044a('0x20')]),_0x166a7c);calls[_0x044a('0x3f')](_0x166a7c);recordings[_0x044a('0x3f')](_0x166a7c);}catch(_0x138ea9){utils[_0x044a('0x16')](util[_0x044a('0x1b')](_0x044a('0x40'),_0x166a7c[_0x044a('0x20')]),_0x138ea9);}});ami['on'](_0x044a('0x41'),function(_0x5da11d){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')]('[%s][index][dialbegin]',_0x5da11d[_0x044a('0x20')]),_0x5da11d);dials[_0x044a('0x41')](_0x5da11d);}catch(_0x57354d){utils['error'](util[_0x044a('0x1b')](_0x044a('0x42'),_0x5da11d[_0x044a('0x20')]),_0x57354d);}});ami['on']('dialend',function(_0x2539b1){try{utils[_0x044a('0x1a')](util[_0x044a('0x1b')](_0x044a('0x43'),_0x2539b1[_0x044a('0x20')]),_0x2539b1);dials[_0x044a('0x44')](_0x2539b1);}catch(_0xbb92ea){utils[_0x044a('0x16')](util['format'](_0x044a('0x43'),_0x2539b1[_0x044a('0x20')]),_0xbb92ea);}});} \ No newline at end of file +var _0xa329=['asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','port','password','keepConnected','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','device','devicestatechange','[%s][index][devicestatechange]','agentcalled','format','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x2230c2,_0x41909e){var _0x2085a8=function(_0x2b5241){while(--_0x2b5241){_0x2230c2['push'](_0x2230c2['shift']());}};_0x2085a8(++_0x41909e);}(_0xa329,0xcf));var _0x9a32=function(_0x37f362,_0x33d31f){_0x37f362=_0x37f362-0x0;var _0x5ddf9d=_0xa329[_0x37f362];return _0x5ddf9d;};var AsteriskManager=require(_0x9a32('0x0'));var config=require(_0x9a32('0x1'));var utils=require(_0x9a32('0x2'));var util=require(_0x9a32('0x3'));var isXDREnabled=config[_0x9a32('0x4')]&&config['xdr']['disabled']?!config[_0x9a32('0x4')][_0x9a32('0x5')]:!![];var isProduction=config['env']===_0x9a32('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x9a32('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x9a32('0x7')][_0x9a32('0x8')],config[_0x9a32('0x7')]['ip'],config[_0x9a32('0x7')]['username'],config[_0x9a32('0x7')][_0x9a32('0x9')],!![]);ami[_0x9a32('0xa')]();if(!isXDREnabled){utils[_0x9a32('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x9a32('0xb')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x9a32('0xc'));var calls=require(_0x9a32('0xd'));var queues=require(_0x9a32('0xe'));var recordings=require(_0x9a32('0xf'));var members=require(_0x9a32('0x10'));var dials=require(_0x9a32('0x11'));var transfers=require(_0x9a32('0x12'));var core=require(_0x9a32('0x13'));ami['on']('connect',core[_0x9a32('0x14')]);ami['on'](_0x9a32('0x15'),core[_0x9a32('0x15')]);ami['on'](_0x9a32('0x16'),core['fullybooted']);ami['on']('error',core[_0x9a32('0x17')]);ami['on'](_0x9a32('0x18'),core[_0x9a32('0x18')]);ami['on']('managerevent',core[_0x9a32('0x19')]);ami['on']('devicestatechange',function(_0x4b41d4){try{utils[_0x9a32('0x1a')](util['format']('[%s][index][devicestatechange]',_0x4b41d4[_0x9a32('0x1b')]),_0x4b41d4);members[_0x9a32('0x1c')](_0x4b41d4);}catch(_0x334a4f){utils[_0x9a32('0x17')](util['format'](_0x9a32('0x1d'),_0x4b41d4[_0x9a32('0x1b')]),_0x334a4f);}});ami['on'](_0x9a32('0x1e'),function(_0x148f96){try{utils[_0x9a32('0x1a')](util['format']('[%s][index][agentcalled]',_0x148f96['uniqueid']),_0x148f96);agents[_0x9a32('0x1e')](_0x148f96);}catch(_0x5866b6){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')]('[%s][index][agentcalled]',_0x148f96[_0x9a32('0x20')]),_0x5866b6);}});ami['on'](_0x9a32('0x21'),function(_0x2b15cf){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x22'),_0x2b15cf[_0x9a32('0x20')]),_0x2b15cf);agents[_0x9a32('0x21')](_0x2b15cf);}catch(_0x5e7bd6){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x22'),_0x2b15cf[_0x9a32('0x20')]),_0x5e7bd6);}});ami['on'](_0x9a32('0x23'),function(_0x2c29e9){try{utils[_0x9a32('0x1a')](util['format'](_0x9a32('0x24'),_0x2c29e9[_0x9a32('0x20')]),_0x2c29e9);agents[_0x9a32('0x23')](_0x2c29e9);queues[_0x9a32('0x23')](_0x2c29e9);}catch(_0x49427d){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x24'),_0x2c29e9[_0x9a32('0x20')]),_0x49427d);}});ami['on']('agentcomplete',function(_0x301e22){try{utils[_0x9a32('0x1a')](util['format'](_0x9a32('0x25'),_0x301e22[_0x9a32('0x20')]),_0x301e22);agents[_0x9a32('0x26')](_0x301e22);queues[_0x9a32('0x26')](_0x301e22);members[_0x9a32('0x26')](_0x301e22);}catch(_0x3edc97){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x25'),_0x301e22[_0x9a32('0x20')]),_0x3edc97);}});ami['on'](_0x9a32('0x27'),function(_0x3c0ee2){try{utils['debug'](util['format'](_0x9a32('0x28'),_0x3c0ee2[_0x9a32('0x20')]),_0x3c0ee2);agents[_0x9a32('0x27')](_0x3c0ee2);queues['queuecallerabandon'](_0x3c0ee2);}catch(_0x1511fd){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')]('[%s][index][queuecallerabandon]',_0x3c0ee2['uniqueid']),_0x1511fd);}});ami['on']('queuecallerjoin',function(_0x1a25ad){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x29'),_0x1a25ad[_0x9a32('0x20')]),_0x1a25ad);queues[_0x9a32('0x2a')](_0x1a25ad);recordings[_0x9a32('0x2a')](_0x1a25ad);}catch(_0x5282ea){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x29'),_0x1a25ad[_0x9a32('0x20')]),_0x5282ea);}});ami['on'](_0x9a32('0x2b'),function(_0x16d2f8){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x2c'),_0x16d2f8[_0x9a32('0x20')]),_0x16d2f8);queues[_0x9a32('0x2b')](_0x16d2f8);}catch(_0x5b786f){utils['error'](util[_0x9a32('0x1f')](_0x9a32('0x2c'),_0x16d2f8[_0x9a32('0x20')]),_0x5b786f);}});ami['on'](_0x9a32('0x2d'),function(_0x4d06e3){try{utils['debug'](util[_0x9a32('0x1f')]('[%s][index][musiconholdstart]',_0x4d06e3[_0x9a32('0x20')]),_0x4d06e3);queues[_0x9a32('0x2d')](_0x4d06e3);calls[_0x9a32('0x2d')](_0x4d06e3);}catch(_0x19d7da){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')]('[%s][index][musiconholdstart]',_0x4d06e3[_0x9a32('0x20')]),_0x19d7da);}});ami['on'](_0x9a32('0x2e'),function(_0x3008b0){try{utils['debug'](util['format'](_0x9a32('0x2f'),_0x3008b0['uniqueid']),_0x3008b0);queues['musiconholdstop'](_0x3008b0);calls[_0x9a32('0x2e')](_0x3008b0);}catch(_0x1f5695){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x2f'),_0x3008b0['uniqueid']),_0x1f5695);}});ami['on'](_0x9a32('0x30'),function(_0x519362){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')]('[%s][index][newstate]',_0x519362['uniqueid']),_0x519362);calls[_0x9a32('0x30')](_0x519362);recordings[_0x9a32('0x30')](_0x519362);}catch(_0xe78e82){utils[_0x9a32('0x17')](util['format']('[%s][index][newstate]',_0x519362['uniqueid']),_0xe78e82);}});ami['on'](_0x9a32('0x31'),function(_0x314773){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x32'),_0x314773[_0x9a32('0x20')]),_0x314773);calls[_0x9a32('0x31')](_0x314773);recordings[_0x9a32('0x31')](_0x314773);dials[_0x9a32('0x31')](_0x314773);agents[_0x9a32('0x31')](_0x314773);queues['hangup'](_0x314773);}catch(_0x40738d){utils[_0x9a32('0x17')](util['format']('[%s][index][hangup]',_0x314773[_0x9a32('0x20')]),_0x40738d);}});ami['on'](_0x9a32('0x33'),function(_0x240566){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x34'),_0x240566[_0x9a32('0x20')]),_0x240566);members['cdr'](_0x240566);}catch(_0x17ba50){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x34'),_0x240566[_0x9a32('0x20')]),_0x17ba50);}});ami['on']('blindtransfer',function(_0x5c8e40){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')]('[%s][index][blindtransfer]',_0x5c8e40[_0x9a32('0x20')]),_0x5c8e40);queues['blindtransfer'](_0x5c8e40);agents[_0x9a32('0x35')](_0x5c8e40);transfers[_0x9a32('0x35')](_0x5c8e40);recordings[_0x9a32('0x35')](_0x5c8e40);}catch(_0x1d88be){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x36'),_0x5c8e40[_0x9a32('0x20')]),_0x1d88be);}});ami['on'](_0x9a32('0x37'),function(_0x46f581){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x38'),_0x46f581[_0x9a32('0x39')]),_0x46f581);queues['attendedtransfer'](_0x46f581);transfers[_0x9a32('0x37')](_0x46f581);agents[_0x9a32('0x37')](_0x46f581);calls[_0x9a32('0x37')](_0x46f581);}catch(_0x3a976f){utils['error'](util['format']('[%s][index][attendedtransfer]',_0x46f581[_0x9a32('0x39')]),_0x3a976f);}});ami['on'](_0x9a32('0x3a'),function(_0x3df246){try{utils[_0x9a32('0x1a')](util['format']('[%s][index][varset]',_0x3df246[_0x9a32('0x20')]),_0x3df246);queues[_0x9a32('0x3a')](_0x3df246);recordings[_0x9a32('0x3a')](_0x3df246);calls['varset'](_0x3df246);dials['varset'](_0x3df246);}catch(_0x229f0e){utils[_0x9a32('0x17')](util['format'](_0x9a32('0x3b'),_0x3df246[_0x9a32('0x20')]),_0x229f0e);}});ami['on'](_0x9a32('0x3c'),function(_0x2c0018){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x3d'),_0x2c0018['uniqueid']),_0x2c0018);calls[_0x9a32('0x3c')](_0x2c0018);recordings[_0x9a32('0x3c')](_0x2c0018);dials[_0x9a32('0x3c')](_0x2c0018);}catch(_0x51a1b0){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x3d'),_0x2c0018[_0x9a32('0x20')]),_0x51a1b0);}});ami['on']('newchannel',function(_0x420396){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x3e'),_0x420396[_0x9a32('0x20')]),_0x420396);calls[_0x9a32('0x3f')](_0x420396);recordings[_0x9a32('0x3f')](_0x420396);}catch(_0x2e411f){utils[_0x9a32('0x17')](util[_0x9a32('0x1f')](_0x9a32('0x3e'),_0x420396[_0x9a32('0x20')]),_0x2e411f);}});ami['on']('dialbegin',function(_0x26b8a3){try{utils[_0x9a32('0x1a')](util[_0x9a32('0x1f')](_0x9a32('0x40'),_0x26b8a3[_0x9a32('0x20')]),_0x26b8a3);dials[_0x9a32('0x41')](_0x26b8a3);}catch(_0xf490c6){utils['error'](util['format'](_0x9a32('0x42'),_0x26b8a3['uniqueid']),_0xf490c6);}});ami['on'](_0x9a32('0x43'),function(_0x4d8b87){try{utils['debug'](util[_0x9a32('0x1f')](_0x9a32('0x44'),_0x4d8b87['uniqueid']),_0x4d8b87);dials[_0x9a32('0x43')](_0x4d8b87);}catch(_0xddb00){utils['error'](util[_0x9a32('0x1f')](_0x9a32('0x44'),_0x4d8b87[_0x9a32('0x20')]),_0xddb00);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index be97c59..67b9290 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 _0x39d6=['catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','agent','NOT_INUSE','exitAt','now','duration','diffTime','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','split','data1','type','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','interface','then','membername','name','internal','request','CreateMemberReport'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x39d6,0x8a));var _0x639d=function(_0x32bff9,_0x3f27d5){_0x32bff9=_0x32bff9-0x0;var _0xbab93=_0x39d6[_0x32bff9];return _0xbab93;};'use strict';var _=require(_0x639d('0x0'));var util=require(_0x639d('0x1'));var utils=require(_0x639d('0x2'));var members={};var exclude=[_0x639d('0x3'),_0x639d('0x4')];function writeDB(_0x2abf85){utils[_0x639d('0x5')](util[_0x639d('0x6')](_0x639d('0x7'),_0x2abf85[_0x639d('0x8')],_0x2abf85['interface'],_0x2abf85[_0x639d('0x9')],_0x2abf85[_0x639d('0xa')],_0x2abf85['membername'],_0x2abf85['type']));if(_0x2abf85[_0x639d('0xb')]){utils['getUserByInterface'](_0x2abf85[_0x639d('0xb')])[_0x639d('0xc')](function(_0x127015){if(_0x127015){_0x2abf85[_0x639d('0xd')]=_0x127015[_0x639d('0xe')];_0x2abf85['internal']=_0x127015[_0x639d('0xf')];utils[_0x639d('0x10')](_0x639d('0x11'),_0x2abf85);}else{utils['getUserByName'](_0x2abf85[_0x639d('0xb')]['split']('/')[0x1])[_0x639d('0xc')](function(_0x415e8e){if(_0x415e8e){_0x2abf85[_0x639d('0xd')]=_0x415e8e[_0x639d('0xe')];_0x2abf85[_0x639d('0xf')]=_0x415e8e[_0x639d('0xf')];utils['request'](_0x639d('0x11'),_0x2abf85);}});}})[_0x639d('0x12')](function(_0x2f64bb){utils[_0x639d('0x13')](util['format'](_0x639d('0x14'),_0x2abf85[_0x639d('0x8')]),_0x2f64bb);});}delete members[_0x2abf85[_0x639d('0xb')]];}function startsWith(_0x302511,_0x2fafc1){return _[_0x639d('0x15')](_0x302511,function(_0x2fea80){return _[_0x639d('0x16')](_0x2fafc1,_0x2fea80);});}exports[_0x639d('0x17')]=function(_0x452dad){try{utils[_0x639d('0x18')](util['format'](_0x639d('0x19'),members[_0x452dad[_0x639d('0x1a')]]?members[_0x452dad[_0x639d('0x1a')]]['uniqueid']:_0x452dad[_0x639d('0x1a')]),_0x452dad);utils['info'](util[_0x639d('0x6')](_0x639d('0x1b'),members[_0x452dad[_0x639d('0x1a')]]?members[_0x452dad[_0x639d('0x1a')]]['uniqueid']:_0x452dad[_0x639d('0x1a')],_0x452dad['state'],_0x452dad[_0x639d('0x1a')]));switch(_0x452dad[_0x639d('0x1c')]){case _0x639d('0x1d'):case _0x639d('0x1e'):if(!startsWith(exclude,_0x452dad['device'])){members[_0x452dad['device']]={'channel':_0x639d('0x1f'),'interface':_0x452dad[_0x639d('0x1a')],'type':'TALKING','enterAt':utils['now'](),'role':_0x639d('0x20')};}break;case _0x639d('0x21'):if(!_['isNil'](members[_0x452dad[_0x639d('0x1a')]])){members[_0x452dad[_0x639d('0x1a')]][_0x639d('0x22')]=utils[_0x639d('0x23')]();members[_0x452dad[_0x639d('0x1a')]][_0x639d('0x24')]=utils[_0x639d('0x25')](members[_0x452dad['device']][_0x639d('0x22')],members[_0x452dad[_0x639d('0x1a')]]['enterAt']);if(members[_0x452dad[_0x639d('0x1a')]][_0x639d('0x8')]){writeDB(members[_0x452dad[_0x639d('0x1a')]]);}}break;default:break;}}catch(_0x59f6f9){utils[_0x639d('0x13')](util['format'](_0x639d('0x19'),members[_0x452dad[_0x639d('0x1a')]]?members[_0x452dad[_0x639d('0x1a')]][_0x639d('0x8')]:_0x452dad[_0x639d('0x1a')]),_0x59f6f9);}};exports['agentcomplete']=function(_0xf25931){try{if(!_[_0x639d('0x26')](members[_0xf25931[_0x639d('0xb')]])){utils[_0x639d('0x18')](util[_0x639d('0x6')](_0x639d('0x27'),_0xf25931[_0x639d('0x8')]),_0xf25931);utils[_0x639d('0x5')](util['format'](_0x639d('0x28'),_0xf25931[_0x639d('0x8')],_0xf25931['interface'],_0xf25931[_0x639d('0x29')]));members[_0xf25931[_0x639d('0xb')]]=_[_0x639d('0x2a')](members[_0xf25931[_0x639d('0xb')]],{'data4':_0xf25931[_0x639d('0x29')],'uniqueid':_0xf25931[_0x639d('0x8')]});}}catch(_0x2a7612){utils['error'](util[_0x639d('0x6')]('[%s][members][agentcomplete]',_0xf25931[_0x639d('0x8')]),_0x2a7612);}};exports['cdr']=function(_0x506b09){try{utils[_0x639d('0x18')](util[_0x639d('0x6')](_0x639d('0x2b'),_0x506b09[_0x639d('0x8')]),_0x506b09);if(_0x506b09[_0x639d('0x9')]){var _0x297330=_0x506b09['channel'][_0x639d('0x2c')]('-')[0x0];if(!_[_0x639d('0x26')](members[_0x297330])){members[_0x297330]=_[_0x639d('0x2a')](members[_0x297330],{'data1':members[_0x297330][_0x639d('0x2d')]||_0x506b09[_0x639d('0x2e')],'data2':members[_0x297330][_0x639d('0xa')]||_0x506b09['source'],'data3':members[_0x297330][_0x639d('0x2f')]||_0x506b09[_0x639d('0x30')],'uniqueid':members[_0x297330][_0x639d('0x8')]||_0x506b09['uniqueid']});utils[_0x639d('0x5')](util[_0x639d('0x6')](_0x639d('0x31'),_0x506b09[_0x639d('0x8')],members[_0x297330][_0x639d('0x2d')],members[_0x297330][_0x639d('0xa')],members[_0x297330][_0x639d('0x2f')]));if(members[_0x297330][_0x639d('0x22')]){writeDB(members[_0x297330]);}}}if(_0x506b09[_0x639d('0x32')]){var _0x5a9801=_0x506b09[_0x639d('0x32')][_0x639d('0x2c')]('-')[0x0];if(!_[_0x639d('0x26')](members[_0x5a9801])){members[_0x5a9801]=_[_0x639d('0x2a')](members[_0x5a9801],{'data1':members[_0x5a9801][_0x639d('0x2d')]||_0x506b09[_0x639d('0x2e')],'data2':members[_0x5a9801][_0x639d('0xa')]||_0x506b09[_0x639d('0x33')],'data3':members[_0x5a9801][_0x639d('0x2f')]||_0x506b09['destination'],'uniqueid':members[_0x5a9801][_0x639d('0x8')]||_0x506b09[_0x639d('0x8')]});utils[_0x639d('0x5')](util[_0x639d('0x6')](_0x639d('0x31'),_0x506b09['uniqueid'],members[_0x5a9801][_0x639d('0x2d')],members[_0x5a9801][_0x639d('0xa')],members[_0x5a9801][_0x639d('0x2f')]));if(members[_0x5a9801]['exitAt']){writeDB(members[_0x5a9801]);}}}}catch(_0x5544d0){utils[_0x639d('0x13')](util[_0x639d('0x6')](_0x639d('0x2b'),_0x506b09[_0x639d('0x8')]),_0x5544d0);}}; \ No newline at end of file +var _0xe3c5=['membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','error','startsWith','devicestatechange','debug','device','state','INUSE','BUSY','voice','NOT_INUSE','isNil','exitAt','now','duration','diffTime','[%s][members][devicestatechange]','[%s][members][agentcomplete]','info','queue','assign','cdr','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0xe3c5[_0x1af0e5];return _0x3c444a;};'use strict';var _=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var utils=require(_0x5e3c('0x2'));var members={};var exclude=[_0x5e3c('0x3'),_0x5e3c('0x4')];function writeDB(_0x383d11){utils['info'](util[_0x5e3c('0x5')](_0x5e3c('0x6'),_0x383d11[_0x5e3c('0x7')],_0x383d11[_0x5e3c('0x8')],_0x383d11[_0x5e3c('0x9')],_0x383d11[_0x5e3c('0xa')],_0x383d11[_0x5e3c('0xb')],_0x383d11[_0x5e3c('0xc')]));if(_0x383d11[_0x5e3c('0x8')]){utils[_0x5e3c('0xd')](_0x383d11[_0x5e3c('0x8')])[_0x5e3c('0xe')](function(_0x4995a3){if(_0x4995a3){_0x383d11['membername']=_0x4995a3[_0x5e3c('0xf')];_0x383d11[_0x5e3c('0x10')]=_0x4995a3[_0x5e3c('0x10')];utils[_0x5e3c('0x11')](_0x5e3c('0x12'),_0x383d11);}else{utils['getUserByName'](_0x383d11[_0x5e3c('0x8')][_0x5e3c('0x13')]('/')[0x1])['then'](function(_0x465e5d){if(_0x465e5d){_0x383d11['membername']=_0x465e5d['name'];_0x383d11[_0x5e3c('0x10')]=_0x465e5d[_0x5e3c('0x10')];utils[_0x5e3c('0x11')](_0x5e3c('0x12'),_0x383d11);}});}})[_0x5e3c('0x14')](function(_0x30bc22){utils[_0x5e3c('0x15')](util[_0x5e3c('0x5')]('[%s][members][writeDB]',_0x383d11['uniqueid']),_0x30bc22);});}delete members[_0x383d11[_0x5e3c('0x8')]];}function startsWith(_0x2183ba,_0xa7f61d){return _['some'](_0x2183ba,function(_0x4f7318){return _[_0x5e3c('0x16')](_0xa7f61d,_0x4f7318);});}exports[_0x5e3c('0x17')]=function(_0x321487){try{utils[_0x5e3c('0x18')](util['format']('[%s][members][devicestatechange]',members[_0x321487[_0x5e3c('0x19')]]?members[_0x321487['device']]['uniqueid']:_0x321487[_0x5e3c('0x19')]),_0x321487);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x321487[_0x5e3c('0x19')]]?members[_0x321487[_0x5e3c('0x19')]]['uniqueid']:_0x321487[_0x5e3c('0x19')],_0x321487['state'],_0x321487[_0x5e3c('0x19')]));switch(_0x321487[_0x5e3c('0x1a')]){case _0x5e3c('0x1b'):case _0x5e3c('0x1c'):if(!startsWith(exclude,_0x321487[_0x5e3c('0x19')])){members[_0x321487[_0x5e3c('0x19')]]={'channel':_0x5e3c('0x1d'),'interface':_0x321487['device'],'type':'TALKING','enterAt':utils['now'](),'role':'agent'};}break;case _0x5e3c('0x1e'):if(!_[_0x5e3c('0x1f')](members[_0x321487[_0x5e3c('0x19')]])){members[_0x321487[_0x5e3c('0x19')]][_0x5e3c('0x20')]=utils[_0x5e3c('0x21')]();members[_0x321487['device']][_0x5e3c('0x22')]=utils[_0x5e3c('0x23')](members[_0x321487[_0x5e3c('0x19')]][_0x5e3c('0x20')],members[_0x321487['device']]['enterAt']);if(members[_0x321487[_0x5e3c('0x19')]][_0x5e3c('0x7')]){writeDB(members[_0x321487['device']]);}}break;default:break;}}catch(_0x1048a0){utils[_0x5e3c('0x15')](util[_0x5e3c('0x5')](_0x5e3c('0x24'),members[_0x321487[_0x5e3c('0x19')]]?members[_0x321487['device']][_0x5e3c('0x7')]:_0x321487['device']),_0x1048a0);}};exports['agentcomplete']=function(_0x40e5c0){try{if(!_[_0x5e3c('0x1f')](members[_0x40e5c0[_0x5e3c('0x8')]])){utils[_0x5e3c('0x18')](util['format'](_0x5e3c('0x25'),_0x40e5c0[_0x5e3c('0x7')]),_0x40e5c0);utils[_0x5e3c('0x26')](util[_0x5e3c('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x40e5c0['uniqueid'],_0x40e5c0[_0x5e3c('0x8')],_0x40e5c0[_0x5e3c('0x27')]));members[_0x40e5c0[_0x5e3c('0x8')]]=_[_0x5e3c('0x28')](members[_0x40e5c0['interface']],{'data4':_0x40e5c0[_0x5e3c('0x27')],'uniqueid':_0x40e5c0[_0x5e3c('0x7')]});}}catch(_0x2d5a08){utils['error'](util[_0x5e3c('0x5')]('[%s][members][agentcomplete]',_0x40e5c0[_0x5e3c('0x7')]),_0x2d5a08);}};exports[_0x5e3c('0x29')]=function(_0x2ec1a7){try{utils['debug'](util[_0x5e3c('0x5')]('[%s][members][cdr]',_0x2ec1a7[_0x5e3c('0x7')]),_0x2ec1a7);if(_0x2ec1a7[_0x5e3c('0x9')]){var _0x198883=_0x2ec1a7[_0x5e3c('0x9')]['split']('-')[0x0];if(!_[_0x5e3c('0x1f')](members[_0x198883])){members[_0x198883]=_[_0x5e3c('0x28')](members[_0x198883],{'data1':members[_0x198883][_0x5e3c('0x2a')]||_0x2ec1a7[_0x5e3c('0xc')],'data2':members[_0x198883][_0x5e3c('0xa')]||_0x2ec1a7[_0x5e3c('0x2b')],'data3':members[_0x198883][_0x5e3c('0x2c')]||_0x2ec1a7[_0x5e3c('0x2d')],'uniqueid':members[_0x198883]['uniqueid']||_0x2ec1a7[_0x5e3c('0x7')]});utils[_0x5e3c('0x26')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2ec1a7[_0x5e3c('0x7')],members[_0x198883]['data1'],members[_0x198883][_0x5e3c('0xa')],members[_0x198883][_0x5e3c('0x2c')]));if(members[_0x198883][_0x5e3c('0x20')]){writeDB(members[_0x198883]);}}}if(_0x2ec1a7[_0x5e3c('0x2e')]){var _0x758016=_0x2ec1a7['destinationchannel'][_0x5e3c('0x13')]('-')[0x0];if(!_['isNil'](members[_0x758016])){members[_0x758016]=_[_0x5e3c('0x28')](members[_0x758016],{'data1':members[_0x758016][_0x5e3c('0x2a')]||_0x2ec1a7[_0x5e3c('0xc')],'data2':members[_0x758016][_0x5e3c('0xa')]||_0x2ec1a7[_0x5e3c('0x2b')],'data3':members[_0x758016][_0x5e3c('0x2c')]||_0x2ec1a7[_0x5e3c('0x2d')],'uniqueid':members[_0x758016][_0x5e3c('0x7')]||_0x2ec1a7[_0x5e3c('0x7')]});utils[_0x5e3c('0x26')](util[_0x5e3c('0x5')](_0x5e3c('0x2f'),_0x2ec1a7[_0x5e3c('0x7')],members[_0x758016][_0x5e3c('0x2a')],members[_0x758016][_0x5e3c('0xa')],members[_0x758016]['data3']));if(members[_0x758016]['exitAt']){writeDB(members[_0x758016]);}}}}catch(_0x410687){utils[_0x5e3c('0x15')](util['format'](_0x5e3c('0x30'),_0x2ec1a7[_0x5e3c('0x7')]),_0x410687);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index b54f4b2..2f1dc72 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 _0xbbea=['queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','[%s][queues][queuecallerjoin]','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','error','[%s][queues][hangup]','value','toUpperCase','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','membername','destaccountcode','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid'];(function(_0x478af2,_0x5d9917){var _0x16b139=function(_0x14b807){while(--_0x14b807){_0x478af2['push'](_0x478af2['shift']());}};_0x16b139(++_0x5d9917);}(_0xbbea,0x1dc));var _0xabbe=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbbea[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xabbe('0x0'));var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x394b3e){utils[_0xabbe('0x1')](util[_0xabbe('0x2')](_0xabbe('0x3'),_0x394b3e[_0xabbe('0x4')],_0x394b3e['channel'],_0x394b3e['queue'],_0x394b3e[_0xabbe('0x5')],_0x394b3e[_0xabbe('0x6')],_0x394b3e[_0xabbe('0x7')],_0x394b3e[_0xabbe('0x8')]));if(_0x394b3e[_0xabbe('0x9')]){utils['getVoiceQueueByName'](_0x394b3e[_0xabbe('0x9')])[_0xabbe('0xa')](function(_0x530b06){if(_0x530b06){_0x394b3e[_0xabbe('0xb')]=_0x530b06[_0xabbe('0xb')];}utils[_0xabbe('0xc')]('CreateVoiceQueueReport',_0x394b3e);});}else{utils[_0xabbe('0xc')](_0xabbe('0xd'),_0x394b3e);}if(_0x394b3e['transfereduniqueid']){delete queues[_0x394b3e[_0xabbe('0xe')]];}else{delete queues[_0x394b3e[_0xabbe('0x4')]];}}exports[_0xabbe('0xf')]=function(_0xed538d){try{utils[_0xabbe('0x10')](util[_0xabbe('0x2')]('[%s][queues][queuecallerjoin]',_0xed538d['uniqueid']),_0xed538d);utils[_0xabbe('0x1')](util[_0xabbe('0x2')](_0xabbe('0x11'),_0xed538d['uniqueid'],_0xed538d[_0xabbe('0x9')],_0xed538d[_0xabbe('0x12')]));queues[_0xed538d[_0xabbe('0x4')]]=_[_0xabbe('0x13')](_0xed538d,{'originalposition':_0xed538d[_0xabbe('0x12')],'queuecallerjoinAt':utils[_0xabbe('0x14')](),'mohtime':0x0});}catch(_0x1c35c1){utils['error'](util[_0xabbe('0x2')](_0xabbe('0x15'),_0xed538d[_0xabbe('0x4')]),_0x1c35c1);}};exports[_0xabbe('0x16')]=function(_0x4c431d){try{if(!_[_0xabbe('0x17')](queues[_0x4c431d['uniqueid']])){utils[_0xabbe('0x10')](util[_0xabbe('0x2')]('[%s][queues][hangup]',_0x4c431d['uniqueid']),_0x4c431d);if(queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0x18')]){if(!queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0x19')]&&!queues[_0x4c431d[_0xabbe('0x4')]]['queuecallerexit']){queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0x1a')]=!![];queues[_0x4c431d['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x4c431d['uniqueid']][_0xabbe('0x8')]=_0xabbe('0x1b');}utils['info'](util[_0xabbe('0x2')](_0xabbe('0x1c'),_0x4c431d[_0xabbe('0x4')],queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0x1d')],queues[_0x4c431d['uniqueid']][_0xabbe('0x8')]));writeDB(queues[_0x4c431d[_0xabbe('0x4')]]);}else if(queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0xe')]){utils['info'](util[_0xabbe('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4c431d[_0xabbe('0x4')],queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0x1d')],queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0xe')]));queues[queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0xe')]]=queues[_0x4c431d[_0xabbe('0x4')]];queues[queues[_0x4c431d[_0xabbe('0x4')]][_0xabbe('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x4c431d['uniqueid']];}}}catch(_0x210d27){utils[_0xabbe('0x1e')](util[_0xabbe('0x2')](_0xabbe('0x1f'),_0x4c431d['uniqueid']),_0x210d27);}};exports['varset']=function(_0x5bde4c){try{utils[_0xabbe('0x10')](util[_0xabbe('0x2')]('[%s][queues][varset]',_0x5bde4c[_0xabbe('0x4')]),_0x5bde4c);if(!_[_0xabbe('0x17')](_0x5bde4c['variable']['queuestatus'])&&_0x5bde4c[_0xabbe('0x20')][_0xabbe('0x21')]()!=='CONTINUE'){if(!_[_0xabbe('0x17')](queues[_0x5bde4c[_0xabbe('0x4')]])){queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x19')]=![];queues[_0x5bde4c['uniqueid']][_0xabbe('0x22')]=null;queues[_0x5bde4c['uniqueid']][_0xabbe('0x23')]=!![];queues[_0x5bde4c['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x5bde4c['uniqueid']]['queuecallerexitreason']=_0x5bde4c[_0xabbe('0x20')]['toUpperCase']();utils[_0xabbe('0x1')](util[_0xabbe('0x2')](_0xabbe('0x24'),_0x5bde4c['uniqueid'],queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x1d')],_0x5bde4c[_0xabbe('0x20')],queues[_0x5bde4c['uniqueid']][_0xabbe('0x8')]));writeDB(queues[_0x5bde4c[_0xabbe('0x4')]]);}}else if(!_['isNil'](_0x5bde4c[_0xabbe('0x25')][_0xabbe('0x26')])){if(!_['isNil'](queues[_0x5bde4c[_0xabbe('0x4')]])&&!queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x19')]){queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x19')]=![];queues[_0x5bde4c['uniqueid']][_0xabbe('0x22')]=null;queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x23')]=!![];queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x27')]=utils[_0xabbe('0x14')]();queues[_0x5bde4c['uniqueid']][_0xabbe('0x8')]='EXITWITHKEY';utils[_0xabbe('0x1')](util[_0xabbe('0x2')](_0xabbe('0x28'),_0x5bde4c['uniqueid'],queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x1d')],_0x5bde4c['value'],queues[_0x5bde4c[_0xabbe('0x4')]][_0xabbe('0x8')]));}}}catch(_0x1a4135){utils[_0xabbe('0x1e')](util['format'](_0xabbe('0x29'),_0x5bde4c['uniqueid']),_0x1a4135);}};exports[_0xabbe('0x19')]=function(_0x491c43){try{if(!_[_0xabbe('0x17')](queues[_0x491c43[_0xabbe('0x4')]])){utils[_0xabbe('0x10')](util['format']('[%s][queues][queuecallerabandon]',_0x491c43[_0xabbe('0x4')]),_0x491c43);queues[_0x491c43[_0xabbe('0x4')]]['queuecallerexit']=![];queues[_0x491c43[_0xabbe('0x4')]][_0xabbe('0x27')]=null;queues[_0x491c43[_0xabbe('0x4')]][_0xabbe('0x19')]=!![];queues[_0x491c43['uniqueid']][_0xabbe('0x22')]=utils['now']();queues[_0x491c43[_0xabbe('0x4')]][_0xabbe('0x8')]=_0xabbe('0x2a');utils[_0xabbe('0x1')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x491c43['uniqueid'],queues[_0x491c43[_0xabbe('0x4')]][_0xabbe('0x1d')],queues[_0x491c43[_0xabbe('0x4')]][_0xabbe('0x8')]));}}catch(_0x3ff229){utils[_0xabbe('0x1e')](util['format'](_0xabbe('0x2b'),_0x491c43['uniqueid']),_0x3ff229);}};exports['queuecallerleave']=function(_0x44ce1c){try{if(!_['isNil'](queues[_0x44ce1c['uniqueid']])){utils['debug'](util[_0xabbe('0x2')](_0xabbe('0x2c'),_0x44ce1c['uniqueid']),_0x44ce1c);utils['info'](util[_0xabbe('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x44ce1c[_0xabbe('0x4')],queues[_0x44ce1c[_0xabbe('0x4')]][_0xabbe('0x1d')],_0x44ce1c[_0xabbe('0x2d')],_0x44ce1c[_0xabbe('0x2e')]));queues[_0x44ce1c[_0xabbe('0x4')]][_0xabbe('0x2f')]=!![];queues[_0x44ce1c['uniqueid']][_0xabbe('0x18')]=utils[_0xabbe('0x14')]();queues[_0x44ce1c['uniqueid']][_0xabbe('0x30')]=utils[_0xabbe('0x31')](queues[_0x44ce1c['uniqueid']][_0xabbe('0x18')],queues[_0x44ce1c['uniqueid']][_0xabbe('0x32')]);queues[_0x44ce1c['uniqueid']][_0xabbe('0x12')]=_0x44ce1c['position'];queues[_0x44ce1c[_0xabbe('0x4')]][_0xabbe('0x33')]=_0x44ce1c[_0xabbe('0x33')];queues[_0x44ce1c[_0xabbe('0x4')]]['connectedlinenum']=_0x44ce1c[_0xabbe('0x2d')];queues[_0x44ce1c[_0xabbe('0x4')]][_0xabbe('0x2e')]=_0x44ce1c[_0xabbe('0x2e')];}}catch(_0x39dca9){utils['error'](util['format'](_0xabbe('0x2c'),_0x44ce1c[_0xabbe('0x4')]),_0x39dca9);}};exports[_0xabbe('0x34')]=function(_0x45f0ef){try{if(!_['isNil'](queues[_0x45f0ef[_0xabbe('0x4')]])){utils[_0xabbe('0x10')](util[_0xabbe('0x2')]('[%s][queues][agentconnect]',_0x45f0ef[_0xabbe('0x4')]),_0x45f0ef);utils[_0xabbe('0x1')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x45f0ef[_0xabbe('0x4')],queues[_0x45f0ef['uniqueid']][_0xabbe('0x1d')],_0x45f0ef[_0xabbe('0x35')],_0x45f0ef[_0xabbe('0x36')]));queues[_0x45f0ef[_0xabbe('0x4')]][_0xabbe('0x19')]=![];queues[_0x45f0ef[_0xabbe('0x4')]][_0xabbe('0x19')]=![];queues[_0x45f0ef[_0xabbe('0x4')]]['queuecallerabandonAt']=null;queues[_0x45f0ef[_0xabbe('0x4')]][_0xabbe('0x23')]=![];queues[_0x45f0ef['uniqueid']][_0xabbe('0x8')]=null;queues[_0x45f0ef[_0xabbe('0x4')]]['queuecallerexitAt']=null;queues[_0x45f0ef['uniqueid']]['assigned']=!![];queues[_0x45f0ef['uniqueid']]['accountcode']=_0x45f0ef[_0xabbe('0x36')];queues[_0x45f0ef[_0xabbe('0x4')]][_0xabbe('0x5')]=_0x45f0ef['membername'];}}catch(_0x957ec9){utils[_0xabbe('0x1e')](util['format']('[%s][queues][agentconnect]',_0x45f0ef['uniqueid']),_0x957ec9);}};exports[_0xabbe('0x37')]=function(_0x92799c){try{if(!_[_0xabbe('0x17')](queues[_0x92799c[_0xabbe('0x4')]])){if(queues[_0x92799c[_0xabbe('0x4')]]['queuecallerleaveAt']){utils[_0xabbe('0x10')](util['format']('[%s][queues][agentcomplete]',_0x92799c[_0xabbe('0x4')]),_0x92799c);queues[_0x92799c['uniqueid']][_0xabbe('0x19')]=![];queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x19')]=![];queues[_0x92799c[_0xabbe('0x4')]]['queuecallerabandonAt']=null;queues[_0x92799c[_0xabbe('0x4')]]['queuecallerexit']=![];queues[_0x92799c[_0xabbe('0x4')]]['queuecallerexitAt']=null;queues[_0x92799c['uniqueid']]['assigned']=!![];queues[_0x92799c['uniqueid']][_0xabbe('0x5')]=_0x92799c[_0xabbe('0x35')];queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x1a')]=!![];queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x38')]=utils[_0xabbe('0x14')]();if(_0x92799c[_0xabbe('0x39')]==_0xabbe('0x3a')){if(!queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x3a')]){queues[_0x92799c['uniqueid']][_0xabbe('0x8')]=_0xabbe('0x3b');}}else{queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x8')]=_0xabbe('0x3c')+_0x92799c[_0xabbe('0x39')]['toUpperCase']();}utils[_0xabbe('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x92799c[_0xabbe('0x4')],queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x1d')],_0x92799c['membername'],queues[_0x92799c[_0xabbe('0x4')]][_0xabbe('0x8')]));writeDB(queues[_0x92799c[_0xabbe('0x4')]]);}}}catch(_0x2019a6){utils['error'](util[_0xabbe('0x2')]('[%s][queues][agentcomplete]',_0x92799c[_0xabbe('0x4')]),_0x2019a6);}};exports[_0xabbe('0x3d')]=function(_0x1f262e){try{if(!_[_0xabbe('0x17')](queues[_0x1f262e[_0xabbe('0x3e')]])){utils[_0xabbe('0x10')](util[_0xabbe('0x2')](_0xabbe('0x3f'),_0x1f262e[_0xabbe('0x4')]),_0x1f262e);queues[_0x1f262e[_0xabbe('0x3e')]][_0xabbe('0x3a')]=!![];queues[_0x1f262e[_0xabbe('0x3e')]][_0xabbe('0x40')]='BLIND';queues[_0x1f262e[_0xabbe('0x3e')]][_0xabbe('0x41')]=_0x1f262e['extension'];queues[_0x1f262e[_0xabbe('0x3e')]][_0xabbe('0x42')]=_0x1f262e[_0xabbe('0x3e')];queues[_0x1f262e[_0xabbe('0x3e')]][_0xabbe('0x8')]=_0xabbe('0x43');utils[_0xabbe('0x1')](util[_0xabbe('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1f262e[_0xabbe('0x4')],queues[_0x1f262e['transfereeuniqueid']]['name'],_0x1f262e[_0xabbe('0x3e')],_0x1f262e['extension']));}}catch(_0x446200){utils[_0xabbe('0x1e')](util[_0xabbe('0x2')](_0xabbe('0x3f'),_0x1f262e[_0xabbe('0x4')]),_0x446200);}};exports['attendedtransfer']=function(_0x21a919){try{utils[_0xabbe('0x10')](util[_0xabbe('0x2')]('[%s][queues][attendedtransfer]',_0x21a919[_0xabbe('0x44')]),_0x21a919);if(_0x21a919[_0xabbe('0x44')]==_0x21a919[_0xabbe('0x45')]){if(!_['isNil'](queues[_0x21a919[_0xabbe('0x46')]])){utils['info'](util[_0xabbe('0x2')](_0xabbe('0x47'),_0x21a919[_0xabbe('0x44')],queues[_0x21a919['secondtransfererlinkedid']][_0xabbe('0x1d')],_0x21a919['origtransfererexten']));queues[_0x21a919[_0xabbe('0x46')]][_0xabbe('0x3a')]=!![];queues[_0x21a919['secondtransfererlinkedid']][_0xabbe('0x40')]=_0xabbe('0x48');queues[_0x21a919[_0xabbe('0x46')]][_0xabbe('0x41')]=_0x21a919[_0xabbe('0x49')];queues[_0x21a919[_0xabbe('0x46')]][_0xabbe('0x42')]=_0x21a919[_0xabbe('0x44')];queues[_0x21a919[_0xabbe('0x46')]][_0xabbe('0x8')]=_0xabbe('0x4a');}if(!_[_0xabbe('0x17')](queues[_0x21a919[_0xabbe('0x45')]])){if(_0x21a919[_0xabbe('0x4b')]&&queues[_0x21a919['transfereelinkedid']]){queues[_0x21a919[_0xabbe('0x4b')]][_0xabbe('0x4c')]=0x1;queues[_0x21a919['transfereeuniqueid']]=_[_0xabbe('0x4d')](queues[_0x21a919[_0xabbe('0x4b')]]);queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0xe')]=_0x21a919[_0xabbe('0x4e')];queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x4c')]=0x2;queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x6')]=queues[_0x21a919['secondtransfererlinkedid']][_0xabbe('0x6')];queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x4f')]=queues[_0x21a919[_0xabbe('0x46')]][_0xabbe('0x4f')];queues[_0x21a919['transfereeuniqueid']][_0xabbe('0x32')]=utils[_0xabbe('0x14')]();queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x18')]=utils[_0xabbe('0x14')]();queues[_0x21a919[_0xabbe('0x3e')]]['holdtime']=0x0;queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x50')]=0x0;utils[_0xabbe('0x1')](util[_0xabbe('0x2')](_0xabbe('0x51'),_0x21a919[_0xabbe('0x44')],queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x1d')],queues[_0x21a919[_0xabbe('0x3e')]]['calleridnum'],queues[_0x21a919[_0xabbe('0x3e')]][_0xabbe('0x4f')]));}else{utils[_0xabbe('0x1')](util[_0xabbe('0x2')](_0xabbe('0x52'),_0x21a919[_0xabbe('0x44')],queues[_0x21a919[_0xabbe('0x45')]]['name'],_0x21a919[_0xabbe('0x46')]));queues[_0x21a919[_0xabbe('0x45')]][_0xabbe('0xe')]=_0x21a919[_0xabbe('0x46')];}}}else if(_0x21a919[_0xabbe('0x53')]==_0x21a919[_0xabbe('0x46')]){if(!_[_0xabbe('0x17')](queues[_0x21a919[_0xabbe('0x45')]])){utils[_0xabbe('0x1')](util[_0xabbe('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x21a919[_0xabbe('0x44')],queues[_0x21a919['origtransfererlinkedid']]['name'],_0x21a919[_0xabbe('0x53')],_0x21a919[_0xabbe('0x54')]));queues[_0x21a919['origtransfererlinkedid']][_0xabbe('0x3a')]=!![];queues[_0x21a919['origtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x21a919['origtransfererlinkedid']][_0xabbe('0x41')]=_0x21a919[_0xabbe('0x54')];queues[_0x21a919[_0xabbe('0x45')]]['transferuniqueid']=_0x21a919[_0xabbe('0x53')];queues[_0x21a919[_0xabbe('0x45')]]['queuecallerexitreason']=_0xabbe('0x4a');}if(!_['isNil'](queues[_0x21a919[_0xabbe('0x46')]])){if(_0x21a919['transfertargetlinkedid']&&queues[_0x21a919[_0xabbe('0x55')]]){queues[_0x21a919[_0xabbe('0x55')]]['queuecallerenterreason']=0x1;queues[_0x21a919[_0xabbe('0x4e')]]=_[_0xabbe('0x4d')](queues[_0x21a919['transfertargetlinkedid']]);queues[_0x21a919['transfertargetuniqueid']][_0xabbe('0xe')]=_0x21a919[_0xabbe('0x4e')];queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x4c')]=0x2;queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x6')]=queues[_0x21a919['origtransfererlinkedid']][_0xabbe('0x6')];queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x4f')]=queues[_0x21a919[_0xabbe('0x45')]]['calleridname'];queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x32')]=utils['now']();queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x18')]=utils[_0xabbe('0x14')]();queues[_0x21a919[_0xabbe('0x4e')]]['holdtime']=0x0;queues[_0x21a919[_0xabbe('0x4e')]]['mohtime']=0x0;utils['info'](util[_0xabbe('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x21a919[_0xabbe('0x44')],queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x1d')],queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0xe')],queues[_0x21a919['transfertargetuniqueid']]['calleridnum'],queues[_0x21a919[_0xabbe('0x4e')]][_0xabbe('0x4f')]));}else{utils['info'](util[_0xabbe('0x2')](_0xabbe('0x52'),_0x21a919[_0xabbe('0x44')],queues[_0x21a919[_0xabbe('0x46')]][_0xabbe('0x1d')],_0x21a919['origtransfererlinkedid']));queues[_0x21a919['secondtransfererlinkedid']][_0xabbe('0xe')]=_0x21a919['origtransfererlinkedid'];}}}}catch(_0x57cab4){utils[_0xabbe('0x1e')](util[_0xabbe('0x2')](_0xabbe('0x56'),_0x21a919[_0xabbe('0x44')]),_0x57cab4);}};exports[_0xabbe('0x57')]=function(_0x37f0c5){try{if(!_[_0xabbe('0x17')](queues[_0x37f0c5[_0xabbe('0x4')]])){utils[_0xabbe('0x10')](util[_0xabbe('0x2')](_0xabbe('0x58'),_0x37f0c5[_0xabbe('0x4')]),_0x37f0c5);queues[_0x37f0c5['uniqueid']]['musiconholdstartAt']=utils['now']();utils[_0xabbe('0x1')](util[_0xabbe('0x2')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x37f0c5[_0xabbe('0x4')],queues[_0x37f0c5[_0xabbe('0x4')]][_0xabbe('0x1d')],queues[_0x37f0c5['uniqueid']][_0xabbe('0x59')]));}}catch(_0x4deec5){utils[_0xabbe('0x1e')](util[_0xabbe('0x2')]('[%s][queues][musiconholdstart]',_0x37f0c5[_0xabbe('0x4')]),_0x4deec5);}};exports[_0xabbe('0x5a')]=function(_0x4450d6){try{if(!_[_0xabbe('0x17')](queues[_0x4450d6[_0xabbe('0x4')]])){if(!_[_0xabbe('0x17')](queues[_0x4450d6[_0xabbe('0x4')]][_0xabbe('0x59')])){utils['debug'](util[_0xabbe('0x2')](_0xabbe('0x5b'),_0x4450d6[_0xabbe('0x4')]),_0x4450d6);queues[_0x4450d6[_0xabbe('0x4')]][_0xabbe('0x50')]+=utils[_0xabbe('0x31')](utils[_0xabbe('0x14')](),queues[_0x4450d6[_0xabbe('0x4')]]['musiconholdstartAt']);utils[_0xabbe('0x1')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x4450d6[_0xabbe('0x4')],queues[_0x4450d6[_0xabbe('0x4')]]['name'],queues[_0x4450d6['uniqueid']][_0xabbe('0x50')]));delete queues[_0x4450d6['uniqueid']][_0xabbe('0x59')];}}}catch(_0x281ebd){utils[_0xabbe('0x1e')](util[_0xabbe('0x2')](_0xabbe('0x5b'),_0x4450d6[_0xabbe('0x4')]),_0x281ebd);}}; \ No newline at end of file +var _0xd06a=['now','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','[%s][queues][varset]','variable','value','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','holdtime','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfereelinkedid','queuecallerenterreason','clone','calleridname','queuecallerjoinAt','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','transferuniqueid','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','assign','position'];(function(_0x259706,_0x2937c9){var _0x1524a8=function(_0x29fac1){while(--_0x29fac1){_0x259706['push'](_0x259706['shift']());}};_0x1524a8(++_0x2937c9);}(_0xd06a,0x17b));var _0xad06=function(_0x11c160,_0x111531){_0x11c160=_0x11c160-0x0;var _0x27bbba=_0xd06a[_0x11c160];return _0x27bbba;};'use strict';var _=require(_0xad06('0x0'));var util=require(_0xad06('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2cd6db){utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x4'),_0x2cd6db[_0xad06('0x5')],_0x2cd6db[_0xad06('0x6')],_0x2cd6db['queue'],_0x2cd6db[_0xad06('0x7')],_0x2cd6db[_0xad06('0x8')],_0x2cd6db[_0xad06('0x9')],_0x2cd6db[_0xad06('0xa')]));if(_0x2cd6db['queue']){utils[_0xad06('0xb')](_0x2cd6db[_0xad06('0xc')])['then'](function(_0x5820c4){if(_0x5820c4){_0x2cd6db['type']=_0x5820c4[_0xad06('0xd')];}utils[_0xad06('0xe')]('CreateVoiceQueueReport',_0x2cd6db);});}else{utils[_0xad06('0xe')](_0xad06('0xf'),_0x2cd6db);}if(_0x2cd6db['transfereduniqueid']){delete queues[_0x2cd6db['transfereduniqueid']];}else{delete queues[_0x2cd6db[_0xad06('0x5')]];}}exports[_0xad06('0x10')]=function(_0x289548){try{utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x12'),_0x289548['uniqueid']),_0x289548);utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x289548[_0xad06('0x5')],_0x289548[_0xad06('0xc')],_0x289548['position']));queues[_0x289548[_0xad06('0x5')]]=_[_0xad06('0x13')](_0x289548,{'originalposition':_0x289548[_0xad06('0x14')],'queuecallerjoinAt':utils[_0xad06('0x15')](),'mohtime':0x0});}catch(_0x5bd7f8){utils['error'](util[_0xad06('0x3')]('[%s][queues][queuecallerjoin]',_0x289548[_0xad06('0x5')]),_0x5bd7f8);}};exports[_0xad06('0x16')]=function(_0x58a80b){try{if(!_[_0xad06('0x17')](queues[_0x58a80b['uniqueid']])){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x18'),_0x58a80b[_0xad06('0x5')]),_0x58a80b);if(queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x19')]){if(!queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1a')]&&!queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1b')]){queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1c')]=!![];queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x1d')]=utils[_0xad06('0x15')]();queues[_0x58a80b['uniqueid']][_0xad06('0xa')]=_0xad06('0x1e');}utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x1f'),_0x58a80b[_0xad06('0x5')],queues[_0x58a80b['uniqueid']][_0xad06('0x20')],queues[_0x58a80b[_0xad06('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x58a80b[_0xad06('0x5')]]);}else if(queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x21')]){utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x58a80b[_0xad06('0x5')],queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x20')],queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x21')]));queues[queues[_0x58a80b[_0xad06('0x5')]][_0xad06('0x21')]]=queues[_0x58a80b[_0xad06('0x5')]];queues[queues[_0x58a80b[_0xad06('0x5')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x58a80b[_0xad06('0x5')]];}}}catch(_0xbfb401){utils['error'](util['format']('[%s][queues][hangup]',_0x58a80b[_0xad06('0x5')]),_0xbfb401);}};exports['varset']=function(_0x41bc65){try{utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x22'),_0x41bc65[_0xad06('0x5')]),_0x41bc65);if(!_['isNil'](_0x41bc65[_0xad06('0x23')]['queuestatus'])&&_0x41bc65[_0xad06('0x24')]['toUpperCase']()!==_0xad06('0x25')){if(!_[_0xad06('0x17')](queues[_0x41bc65[_0xad06('0x5')]])){queues[_0x41bc65[_0xad06('0x5')]]['queuecallerabandon']=![];queues[_0x41bc65['uniqueid']]['queuecallerabandonAt']=null;queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1b')]=!![];queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x26')]=utils[_0xad06('0x15')]();queues[_0x41bc65['uniqueid']]['queuecallerexitreason']=_0x41bc65[_0xad06('0x24')]['toUpperCase']();utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x27'),_0x41bc65[_0xad06('0x5')],queues[_0x41bc65['uniqueid']][_0xad06('0x20')],_0x41bc65['value'],queues[_0x41bc65[_0xad06('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x41bc65[_0xad06('0x5')]]);}}else if(!_[_0xad06('0x17')](_0x41bc65[_0xad06('0x23')][_0xad06('0x28')])){if(!_['isNil'](queues[_0x41bc65[_0xad06('0x5')]])&&!queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1a')]){queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1a')]=![];queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x29')]=null;queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x1b')]=!![];queues[_0x41bc65[_0xad06('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x41bc65['uniqueid']]['queuecallerexitreason']='EXITWITHKEY';utils['info'](util['format'](_0xad06('0x2a'),_0x41bc65['uniqueid'],queues[_0x41bc65[_0xad06('0x5')]][_0xad06('0x20')],_0x41bc65[_0xad06('0x24')],queues[_0x41bc65['uniqueid']][_0xad06('0xa')]));}}}catch(_0x5263be){utils[_0xad06('0x2b')](util[_0xad06('0x3')](_0xad06('0x22'),_0x41bc65[_0xad06('0x5')]),_0x5263be);}};exports[_0xad06('0x1a')]=function(_0x1472b0){try{if(!_[_0xad06('0x17')](queues[_0x1472b0[_0xad06('0x5')]])){utils['debug'](util[_0xad06('0x3')]('[%s][queues][queuecallerabandon]',_0x1472b0['uniqueid']),_0x1472b0);queues[_0x1472b0['uniqueid']][_0xad06('0x1b')]=![];queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x26')]=null;queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x1a')]=!![];queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x29')]=utils[_0xad06('0x15')]();queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0xa')]=_0xad06('0x2c');utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x2d'),_0x1472b0[_0xad06('0x5')],queues[_0x1472b0[_0xad06('0x5')]][_0xad06('0x20')],queues[_0x1472b0['uniqueid']][_0xad06('0xa')]));}}catch(_0x7896b2){utils[_0xad06('0x2b')](util[_0xad06('0x3')]('[%s][queues][queuecallerabandon]',_0x1472b0[_0xad06('0x5')]),_0x7896b2);}};exports['queuecallerleave']=function(_0x21ab80){try{if(!_['isNil'](queues[_0x21ab80[_0xad06('0x5')]])){utils['debug'](util[_0xad06('0x3')](_0xad06('0x2e'),_0x21ab80[_0xad06('0x5')]),_0x21ab80);utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x21ab80[_0xad06('0x5')],queues[_0x21ab80['uniqueid']]['name'],_0x21ab80[_0xad06('0x2f')],_0x21ab80[_0xad06('0x30')]));queues[_0x21ab80['uniqueid']][_0xad06('0x31')]=!![];queues[_0x21ab80['uniqueid']][_0xad06('0x19')]=utils[_0xad06('0x15')]();queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x32')]=utils['diffTime'](queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x19')],queues[_0x21ab80[_0xad06('0x5')]]['queuecallerjoinAt']);queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x14')]=_0x21ab80[_0xad06('0x14')];queues[_0x21ab80['uniqueid']][_0xad06('0x33')]=_0x21ab80['count'];queues[_0x21ab80[_0xad06('0x5')]][_0xad06('0x2f')]=_0x21ab80[_0xad06('0x2f')];queues[_0x21ab80['uniqueid']][_0xad06('0x30')]=_0x21ab80[_0xad06('0x30')];}}catch(_0x332e34){utils[_0xad06('0x2b')](util['format']('[%s][queues][queuecallerleave]',_0x21ab80[_0xad06('0x5')]),_0x332e34);}};exports['agentconnect']=function(_0x166907){try{if(!_['isNil'](queues[_0x166907[_0xad06('0x5')]])){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x34'),_0x166907[_0xad06('0x5')]),_0x166907);utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x35'),_0x166907['uniqueid'],queues[_0x166907['uniqueid']][_0xad06('0x20')],_0x166907[_0xad06('0x36')],_0x166907[_0xad06('0x37')]));queues[_0x166907[_0xad06('0x5')]][_0xad06('0x1a')]=![];queues[_0x166907['uniqueid']][_0xad06('0x1a')]=![];queues[_0x166907[_0xad06('0x5')]][_0xad06('0x29')]=null;queues[_0x166907[_0xad06('0x5')]][_0xad06('0x1b')]=![];queues[_0x166907[_0xad06('0x5')]][_0xad06('0xa')]=null;queues[_0x166907['uniqueid']][_0xad06('0x26')]=null;queues[_0x166907[_0xad06('0x5')]][_0xad06('0x38')]=!![];queues[_0x166907[_0xad06('0x5')]][_0xad06('0x9')]=_0x166907[_0xad06('0x37')];queues[_0x166907[_0xad06('0x5')]][_0xad06('0x7')]=_0x166907[_0xad06('0x36')];}}catch(_0x40ecca){utils['error'](util[_0xad06('0x3')](_0xad06('0x34'),_0x166907[_0xad06('0x5')]),_0x40ecca);}};exports[_0xad06('0x39')]=function(_0xb6b70c){try{if(!_[_0xad06('0x17')](queues[_0xb6b70c['uniqueid']])){if(queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x19')]){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x3a'),_0xb6b70c[_0xad06('0x5')]),_0xb6b70c);queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x1a')]=![];queues[_0xb6b70c[_0xad06('0x5')]]['queuecallerabandon']=![];queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x29')]=null;queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x1b')]=![];queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x26')]=null;queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x38')]=!![];queues[_0xb6b70c['uniqueid']][_0xad06('0x7')]=_0xb6b70c[_0xad06('0x36')];queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0x1c')]=!![];queues[_0xb6b70c[_0xad06('0x5')]]['queuecallercompleteAt']=utils['now']();if(_0xb6b70c['reason']==_0xad06('0x3b')){if(!queues[_0xb6b70c['uniqueid']][_0xad06('0x3b')]){queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0xa')]=_0xad06('0x3c');}}else{queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0xa')]=_0xad06('0x3d')+_0xb6b70c['reason'][_0xad06('0x3e')]();}utils['info'](util['format'](_0xad06('0x3f'),_0xb6b70c[_0xad06('0x5')],queues[_0xb6b70c[_0xad06('0x5')]]['name'],_0xb6b70c[_0xad06('0x36')],queues[_0xb6b70c[_0xad06('0x5')]][_0xad06('0xa')]));writeDB(queues[_0xb6b70c[_0xad06('0x5')]]);}}}catch(_0x91c7cc){utils[_0xad06('0x2b')](util[_0xad06('0x3')](_0xad06('0x3a'),_0xb6b70c[_0xad06('0x5')]),_0x91c7cc);}};exports[_0xad06('0x40')]=function(_0x527297){try{if(!_[_0xad06('0x17')](queues[_0x527297[_0xad06('0x41')]])){utils[_0xad06('0x11')](util[_0xad06('0x3')](_0xad06('0x42'),_0x527297[_0xad06('0x5')]),_0x527297);queues[_0x527297['transfereeuniqueid']]['transfer']=!![];queues[_0x527297[_0xad06('0x41')]][_0xad06('0x43')]='BLIND';queues[_0x527297['transfereeuniqueid']][_0xad06('0x44')]=_0x527297['extension'];queues[_0x527297[_0xad06('0x41')]]['transferuniqueid']=_0x527297[_0xad06('0x41')];queues[_0x527297[_0xad06('0x41')]][_0xad06('0xa')]='BLINDTRANSFER';utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x45'),_0x527297[_0xad06('0x5')],queues[_0x527297[_0xad06('0x41')]][_0xad06('0x20')],_0x527297['transfereeuniqueid'],_0x527297[_0xad06('0x46')]));}}catch(_0x5044e8){utils[_0xad06('0x2b')](util['format'](_0xad06('0x42'),_0x527297[_0xad06('0x5')]),_0x5044e8);}};exports[_0xad06('0x47')]=function(_0x1cefc8){try{utils[_0xad06('0x11')](util['format'](_0xad06('0x48'),_0x1cefc8[_0xad06('0x49')]),_0x1cefc8);if(_0x1cefc8[_0xad06('0x49')]==_0x1cefc8[_0xad06('0x4a')]){if(!_['isNil'](queues[_0x1cefc8[_0xad06('0x4b')]])){utils[_0xad06('0x2')](util[_0xad06('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8['secondtransfererlinkedid']]['name'],_0x1cefc8['origtransfererexten']));queues[_0x1cefc8[_0xad06('0x4b')]][_0xad06('0x3b')]=!![];queues[_0x1cefc8[_0xad06('0x4b')]][_0xad06('0x43')]='ATTENDED';queues[_0x1cefc8[_0xad06('0x4b')]]['transferexten']=_0x1cefc8[_0xad06('0x4c')];queues[_0x1cefc8['secondtransfererlinkedid']]['transferuniqueid']=_0x1cefc8[_0xad06('0x49')];queues[_0x1cefc8[_0xad06('0x4b')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1cefc8['origtransfererlinkedid']])){if(_0x1cefc8['transfereelinkedid']&&queues[_0x1cefc8[_0xad06('0x4d')]]){queues[_0x1cefc8[_0xad06('0x4d')]][_0xad06('0x4e')]=0x1;queues[_0x1cefc8[_0xad06('0x41')]]=_[_0xad06('0x4f')](queues[_0x1cefc8[_0xad06('0x4d')]]);queues[_0x1cefc8[_0xad06('0x41')]]['transfereduniqueid']=_0x1cefc8['transfertargetuniqueid'];queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x4e')]=0x2;queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x8')]=queues[_0x1cefc8['secondtransfererlinkedid']][_0xad06('0x8')];queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x50')]=queues[_0x1cefc8[_0xad06('0x4b')]][_0xad06('0x50')];queues[_0x1cefc8['transfereeuniqueid']][_0xad06('0x51')]=utils[_0xad06('0x15')]();queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x19')]=utils[_0xad06('0x15')]();queues[_0x1cefc8[_0xad06('0x41')]]['holdtime']=0x0;queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x52')]=0x0;utils[_0xad06('0x2')](util['format'](_0xad06('0x53'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x20')],queues[_0x1cefc8['transfereeuniqueid']][_0xad06('0x8')],queues[_0x1cefc8[_0xad06('0x41')]][_0xad06('0x50')]));}else{utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x54'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x20')],_0x1cefc8['secondtransfererlinkedid']));queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x21')]=_0x1cefc8[_0xad06('0x4b')];}}}else if(_0x1cefc8[_0xad06('0x55')]==_0x1cefc8[_0xad06('0x4b')]){if(!_['isNil'](queues[_0x1cefc8[_0xad06('0x4a')]])){utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x56'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8[_0xad06('0x4a')]]['name'],_0x1cefc8[_0xad06('0x55')],_0x1cefc8[_0xad06('0x57')]));queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x3b')]=!![];queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x43')]=_0xad06('0x58');queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x44')]=_0x1cefc8['secondtransfererexten'];queues[_0x1cefc8[_0xad06('0x4a')]][_0xad06('0x59')]=_0x1cefc8[_0xad06('0x55')];queues[_0x1cefc8[_0xad06('0x4a')]]['queuecallerexitreason']=_0xad06('0x5a');}if(!_[_0xad06('0x17')](queues[_0x1cefc8[_0xad06('0x4b')]])){if(_0x1cefc8['transfertargetlinkedid']&&queues[_0x1cefc8[_0xad06('0x5b')]]){queues[_0x1cefc8[_0xad06('0x5b')]][_0xad06('0x4e')]=0x1;queues[_0x1cefc8[_0xad06('0x5c')]]=_[_0xad06('0x4f')](queues[_0x1cefc8[_0xad06('0x5b')]]);queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x21')]=_0x1cefc8['transfertargetuniqueid'];queues[_0x1cefc8[_0xad06('0x5c')]]['queuecallerenterreason']=0x2;queues[_0x1cefc8['transfertargetuniqueid']][_0xad06('0x8')]=queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x8')];queues[_0x1cefc8[_0xad06('0x5c')]]['calleridname']=queues[_0x1cefc8['origtransfererlinkedid']][_0xad06('0x50')];queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x51')]=utils[_0xad06('0x15')]();queues[_0x1cefc8[_0xad06('0x5c')]]['queuecallerleaveAt']=utils['now']();queues[_0x1cefc8['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x52')]=0x0;utils['info'](util['format'](_0xad06('0x5d'),_0x1cefc8[_0xad06('0x49')],queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x20')],queues[_0x1cefc8['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x1cefc8['transfertargetuniqueid']][_0xad06('0x8')],queues[_0x1cefc8[_0xad06('0x5c')]][_0xad06('0x50')]));}else{utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x54'),_0x1cefc8['origtransfereruniqueid'],queues[_0x1cefc8['secondtransfererlinkedid']][_0xad06('0x20')],_0x1cefc8[_0xad06('0x4a')]));queues[_0x1cefc8['secondtransfererlinkedid']][_0xad06('0x21')]=_0x1cefc8[_0xad06('0x4a')];}}}}catch(_0x453dbe){utils[_0xad06('0x2b')](util[_0xad06('0x3')]('[%s][queues][attendedtransfer]',_0x1cefc8['origtransfereruniqueid']),_0x453dbe);}};exports['musiconholdstart']=function(_0x412392){try{if(!_[_0xad06('0x17')](queues[_0x412392[_0xad06('0x5')]])){utils['debug'](util[_0xad06('0x3')](_0xad06('0x5e'),_0x412392[_0xad06('0x5')]),_0x412392);queues[_0x412392['uniqueid']][_0xad06('0x5f')]=utils[_0xad06('0x15')]();utils[_0xad06('0x2')](util[_0xad06('0x3')](_0xad06('0x60'),_0x412392[_0xad06('0x5')],queues[_0x412392[_0xad06('0x5')]]['name'],queues[_0x412392[_0xad06('0x5')]]['musiconholdstartAt']));}}catch(_0x4b8ea7){utils[_0xad06('0x2b')](util[_0xad06('0x3')](_0xad06('0x5e'),_0x412392[_0xad06('0x5')]),_0x4b8ea7);}};exports['musiconholdstop']=function(_0x4d1b19){try{if(!_[_0xad06('0x17')](queues[_0x4d1b19[_0xad06('0x5')]])){if(!_[_0xad06('0x17')](queues[_0x4d1b19['uniqueid']][_0xad06('0x5f')])){utils['debug'](util['format'](_0xad06('0x61'),_0x4d1b19[_0xad06('0x5')]),_0x4d1b19);queues[_0x4d1b19['uniqueid']]['mohtime']+=utils[_0xad06('0x62')](utils[_0xad06('0x15')](),queues[_0x4d1b19[_0xad06('0x5')]][_0xad06('0x5f')]);utils['info'](util[_0xad06('0x3')](_0xad06('0x63'),_0x4d1b19[_0xad06('0x5')],queues[_0x4d1b19[_0xad06('0x5')]][_0xad06('0x20')],queues[_0x4d1b19['uniqueid']][_0xad06('0x52')]));delete queues[_0x4d1b19[_0xad06('0x5')]][_0xad06('0x5f')];}}}catch(_0x3e7007){utils[_0xad06('0x2b')](util[_0xad06('0x3')]('[%s][queues][musiconholdstop]',_0x4d1b19[_0xad06('0x5')]),_0x3e7007);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 7ac8678..1a99b26 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 _0x6108=['[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info'];(function(_0x28e919,_0x145939){var _0x692b7e=function(_0x1514ae){while(--_0x1514ae){_0x28e919['push'](_0x28e919['shift']());}};_0x692b7e(++_0x145939);}(_0x6108,0x89));var _0x8610=function(_0x338964,_0x1db0be){_0x338964=_0x338964-0x0;var _0x454a38=_0x6108[_0x338964];return _0x454a38;};'use strict';var _=require(_0x8610('0x0'));var util=require(_0x8610('0x1'));var utils=require(_0x8610('0x2'));var transfers=require(_0x8610('0x3'));var recordings={};function writeDB(_0x49c3fe){var _0x3990b4;utils[_0x8610('0x4')](util['format'](_0x8610('0x5'),_0x49c3fe[_0x8610('0x6')]));if(transfers[_0x8610('0x7')][_0x49c3fe[_0x8610('0x6')]]){_0x3990b4=_0x49c3fe[_0x8610('0x6')];_0x49c3fe['uniqueid']=transfers[_0x8610('0x7')][_0x49c3fe[_0x8610('0x6')]][_0x8610('0x8')];}if(_0x49c3fe[_0x8610('0x9')]){utils[_0x8610('0xa')](_0x49c3fe[_0x8610('0x9')])[_0x8610('0xb')](function(_0x559c18){if(_0x559c18){_0x49c3fe['membername']=_0x559c18['name'];_0x49c3fe['UserId']=_0x559c18['id'];}utils[_0x8610('0xc')](_0x8610('0xd'),_0x49c3fe);});}else{utils['request'](_0x8610('0xd'),_0x49c3fe);}if(_0x3990b4)delete transfers[_0x8610('0x7')][_0x3990b4];}exports[_0x8610('0xe')]=function(_0x253a78){try{utils['debug'](util[_0x8610('0xf')](_0x8610('0x10'),_0x253a78[_0x8610('0x6')]),_0x253a78);if(_0x253a78['uniqueid']==_0x253a78[_0x8610('0x11')]){utils[_0x8610('0x4')](util['format'](_0x8610('0x12'),_0x253a78[_0x8610('0x6')],_0x253a78[_0x8610('0x13')],_0x253a78[_0x8610('0x14')]));recordings[_0x253a78['uniqueid']]={'uniqueid':_0x253a78[_0x8610('0x6')],'accountcode':_0x253a78[_0x8610('0x9')],'exten':_0x253a78[_0x8610('0x14')],'context':_0x253a78[_0x8610('0x13')],'channel':_0x253a78[_0x8610('0x15')],'monitors':[]};}}catch(_0x457cab){utils[_0x8610('0x16')](util[_0x8610('0xf')](_0x8610('0x10'),_0x253a78[_0x8610('0x6')]),_0x457cab);}};exports[_0x8610('0x17')]=function(_0x45d5c8){try{utils[_0x8610('0x18')](util[_0x8610('0xf')]('[%s][recordings][newstate]',_0x45d5c8['uniqueid']),_0x45d5c8);if(!_['isNil'](recordings[_0x45d5c8[_0x8610('0x6')]])&&_0x45d5c8['channelstate']==0x6){utils['info'](util['format'](_0x8610('0x19'),_0x45d5c8[_0x8610('0x6')],_0x45d5c8[_0x8610('0x13')],_0x45d5c8[_0x8610('0x15')]));}else if(!_[_0x8610('0x1a')](recordings[_0x45d5c8[_0x8610('0x11')]])&&_0x45d5c8[_0x8610('0x1b')]==0x6&&_0x45d5c8['context']!=_0x8610('0x1c')){utils[_0x8610('0x4')](util['format'](_0x8610('0x1d'),_0x45d5c8[_0x8610('0x6')],_0x45d5c8[_0x8610('0x11')],_0x45d5c8[_0x8610('0x13')],_0x45d5c8[_0x8610('0x15')]));recordings[_0x45d5c8[_0x8610('0x11')]][_0x8610('0x9')]=_0x45d5c8[_0x8610('0x9')];}}catch(_0x939e28){utils[_0x8610('0x16')](util[_0x8610('0xf')](_0x8610('0x1e'),_0x45d5c8['uniqueid']),_0x939e28);}};exports['varset']=function(_0x1628c0){try{if(!_['isNil'](_0x1628c0['variable'])&&!_[_0x8610('0x1a')](_0x1628c0[_0x8610('0x1f')][_0x8610('0x20')])){utils[_0x8610('0x18')](util['format']('[%s][recordings][varset]',_0x1628c0[_0x8610('0x6')]),_0x1628c0);utils[_0x8610('0x4')](util['format'](_0x8610('0x21'),_0x1628c0[_0x8610('0x6')],_0x1628c0[_0x8610('0x1f')],_0x1628c0[_0x8610('0x22')]));if(_[_0x8610('0x23')](_0x1628c0[_0x8610('0x22')],_0x8610('0x24'))){_0x1628c0[_0x8610('0x22')]=_0x1628c0[_0x8610('0x22')][_0x8610('0x25')](_0x8610('0x24'),_0x8610('0x26'));}if(recordings[_0x1628c0[_0x8610('0x11')]]){var _0x1181c3=_[_0x8610('0x27')](recordings[_0x1628c0[_0x8610('0x11')]][_0x8610('0x28')],{'value':_0x1628c0[_0x8610('0x22')]});if(_['isNil'](_0x1181c3)){recordings[_0x1628c0['linkedid']][_0x8610('0x28')]['push']({'value':_0x1628c0['value']});}}}}catch(_0x4d064a){utils['error'](util[_0x8610('0xf')]('[%s][recordings][varset]',_0x1628c0[_0x8610('0x6')]),_0x4d064a);}};exports[_0x8610('0x29')]=function(_0x58aa0d){try{if(!_[_0x8610('0x1a')](recordings[_0x58aa0d['uniqueid']])){utils[_0x8610('0x18')](util[_0x8610('0xf')](_0x8610('0x2a'),_0x58aa0d['uniqueid']),_0x58aa0d);utils['info'](util[_0x8610('0xf')](_0x8610('0x2b'),_0x58aa0d[_0x8610('0x6')],_0x58aa0d[_0x8610('0x2c')],_0x58aa0d[_0x8610('0x2d')],_0x58aa0d['cause-txt']));recordings[_0x58aa0d[_0x8610('0x6')]][_0x8610('0x2c')]=_0x58aa0d[_0x8610('0x2c')];recordings[_0x58aa0d[_0x8610('0x6')]][_0x8610('0x2d')]=_0x58aa0d[_0x8610('0x2d')];recordings[_0x58aa0d['uniqueid']][_0x8610('0x2e')]=_0x58aa0d[_0x8610('0x2e')];recordings[_0x58aa0d['uniqueid']][_0x8610('0x2f')]=_0x58aa0d['connectedlinename'];if(recordings[_0x58aa0d['uniqueid']][_0x8610('0x30')]==_0x8610('0x31')&&recordings[_0x58aa0d[_0x8610('0x6')]]['accountcode']){recordings[_0x58aa0d[_0x8610('0x6')]][_0x8610('0x2e')]=recordings[_0x58aa0d[_0x8610('0x6')]]['accountcode'];recordings[_0x58aa0d[_0x8610('0x6')]]['connectedlinename']='';}recordings[_0x58aa0d[_0x8610('0x6')]][_0x8610('0x28')][_0x8610('0x32')](function(_0x1542f9){var _0x3209d4=_[_0x8610('0x33')](recordings[_0x58aa0d[_0x8610('0x6')]]);_0x3209d4['value']=_0x1542f9[_0x8610('0x22')];writeDB(_0x3209d4);});delete recordings[_0x58aa0d[_0x8610('0x6')]];}}catch(_0x8e0245){utils['error'](util[_0x8610('0xf')](_0x8610('0x2a'),_0x58aa0d[_0x8610('0x6')]),_0x8e0245);}};exports['newexten']=function(_0x5eb63a){try{if(!_['isNil'](recordings[_0x5eb63a['uniqueid']])){utils[_0x8610('0x18')](util[_0x8610('0xf')](_0x8610('0x34'),_0x5eb63a[_0x8610('0x6')]),_0x5eb63a);utils[_0x8610('0x4')](util['format'](_0x8610('0x35'),_0x5eb63a[_0x8610('0x6')],_0x5eb63a[_0x8610('0x36')],_0x5eb63a['appdata']));if(_0x5eb63a[_0x8610('0x36')][_0x8610('0x37')]()==_0x8610('0x38')&&_['startsWith'](_0x5eb63a['appdata']['toLowerCase'](),'cdr')){var _0x377a2d=_0x5eb63a[_0x8610('0x39')][_0x8610('0x3a')]('=');var _0x121180=_0x377a2d[0x0][_0x8610('0x3b')](_0x377a2d[0x0]['lastIndexOf']('(')+0x1,_0x377a2d[0x0]['lastIndexOf'](')'));var _0x2a9f33=_0x377a2d[0x1];recordings[_0x5eb63a[_0x8610('0x6')]][_0x121180]=_0x2a9f33;}}}catch(_0x4b9510){utils['error'](util[_0x8610('0xf')](_0x8610('0x34'),_0x5eb63a[_0x8610('0x6')]),_0x4b9510);}};exports[_0x8610('0x3c')]=function(_0x132638){try{if(!_[_0x8610('0x1a')](recordings[_0x132638[_0x8610('0x6')]])){utils[_0x8610('0x18')](util[_0x8610('0xf')](_0x8610('0x3d'),_0x132638[_0x8610('0x6')]),_0x132638);utils[_0x8610('0x4')](util['format'](_0x8610('0x3e'),_0x132638[_0x8610('0x6')],_0x132638[_0x8610('0x3f')]));recordings[_0x132638[_0x8610('0x6')]][_0x8610('0x3f')]=_0x132638[_0x8610('0x3f')];}}catch(_0x48e78c){utils['error'](util[_0x8610('0xf')](_0x8610('0x3d'),_0x132638[_0x8610('0x6')]),_0x48e78c);}};exports['blindtransfer']=function(_0x4e6430){try{utils['debug'](util[_0x8610('0xf')](_0x8610('0x40'),_0x4e6430[_0x8610('0x6')]),_0x4e6430);utils['info'](util[_0x8610('0xf')](_0x8610('0x41'),_0x4e6430['uniqueid'],_0x4e6430[_0x8610('0x42')],_0x4e6430[_0x8610('0x43')],_0x4e6430['transfereecalleridnum'],_0x4e6430[_0x8610('0x44')]));if(recordings[_0x4e6430[_0x8610('0x45')]]&&transfers['blinds'][_0x4e6430[_0x8610('0x45')]]){transfers[_0x8610('0x7')][_0x4e6430[_0x8610('0x45')]][_0x8610('0x46')]=!![];}}catch(_0x25a207){utils['error'](util[_0x8610('0xf')](_0x8610('0x40'),_0x4e6430[_0x8610('0x6')]),_0x25a207);}}; \ No newline at end of file +var _0x2f66=['info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','accountcode','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x2f66,0x89));var _0x62f6=function(_0x819ce,_0xf25f51){_0x819ce=_0x819ce-0x0;var _0x1edcf0=_0x2f66[_0x819ce];return _0x1edcf0;};'use strict';var _=require(_0x62f6('0x0'));var util=require(_0x62f6('0x1'));var utils=require(_0x62f6('0x2'));var transfers=require(_0x62f6('0x3'));var recordings={};function writeDB(_0x160060){var _0x377c60;utils['info'](util[_0x62f6('0x4')](_0x62f6('0x5'),_0x160060[_0x62f6('0x6')]));if(transfers['blinds'][_0x160060[_0x62f6('0x6')]]){_0x377c60=_0x160060[_0x62f6('0x6')];_0x160060['uniqueid']=transfers[_0x62f6('0x7')][_0x160060[_0x62f6('0x6')]][_0x62f6('0x8')];}if(_0x160060['accountcode']){utils[_0x62f6('0x9')](_0x160060[_0x62f6('0xa')])['then'](function(_0x1a9422){if(_0x1a9422){_0x160060[_0x62f6('0xb')]=_0x1a9422['name'];_0x160060[_0x62f6('0xc')]=_0x1a9422['id'];}utils[_0x62f6('0xd')](_0x62f6('0xe'),_0x160060);});}else{utils[_0x62f6('0xd')](_0x62f6('0xe'),_0x160060);}if(_0x377c60)delete transfers['blinds'][_0x377c60];}exports[_0x62f6('0xf')]=function(_0x3dde7e){try{utils[_0x62f6('0x10')](util[_0x62f6('0x4')](_0x62f6('0x11'),_0x3dde7e[_0x62f6('0x6')]),_0x3dde7e);if(_0x3dde7e['uniqueid']==_0x3dde7e[_0x62f6('0x12')]){utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x14'),_0x3dde7e[_0x62f6('0x6')],_0x3dde7e[_0x62f6('0x15')],_0x3dde7e[_0x62f6('0x16')]));recordings[_0x3dde7e[_0x62f6('0x6')]]={'uniqueid':_0x3dde7e[_0x62f6('0x6')],'accountcode':_0x3dde7e['accountcode'],'exten':_0x3dde7e[_0x62f6('0x16')],'context':_0x3dde7e[_0x62f6('0x15')],'channel':_0x3dde7e['channel'],'monitors':[]};}}catch(_0x190988){utils[_0x62f6('0x17')](util['format'](_0x62f6('0x11'),_0x3dde7e['uniqueid']),_0x190988);}};exports[_0x62f6('0x18')]=function(_0x30f6fe){try{utils[_0x62f6('0x10')](util['format'](_0x62f6('0x19'),_0x30f6fe[_0x62f6('0x6')]),_0x30f6fe);if(!_[_0x62f6('0x1a')](recordings[_0x30f6fe['uniqueid']])&&_0x30f6fe['channelstate']==0x6){utils['info'](util[_0x62f6('0x4')](_0x62f6('0x1b'),_0x30f6fe['uniqueid'],_0x30f6fe[_0x62f6('0x15')],_0x30f6fe[_0x62f6('0x1c')]));}else if(!_[_0x62f6('0x1a')](recordings[_0x30f6fe[_0x62f6('0x12')]])&&_0x30f6fe['channelstate']==0x6&&_0x30f6fe['context']!=_0x62f6('0x1d')){utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x1e'),_0x30f6fe[_0x62f6('0x6')],_0x30f6fe[_0x62f6('0x12')],_0x30f6fe['context'],_0x30f6fe[_0x62f6('0x1c')]));recordings[_0x30f6fe[_0x62f6('0x12')]][_0x62f6('0xa')]=_0x30f6fe[_0x62f6('0xa')];}}catch(_0x4076e5){utils[_0x62f6('0x17')](util['format'](_0x62f6('0x19'),_0x30f6fe['uniqueid']),_0x4076e5);}};exports[_0x62f6('0x1f')]=function(_0xa208f7){try{if(!_[_0x62f6('0x1a')](_0xa208f7[_0x62f6('0x20')])&&!_['isNil'](_0xa208f7[_0x62f6('0x20')][_0x62f6('0x21')])){utils[_0x62f6('0x10')](util[_0x62f6('0x4')]('[%s][recordings][varset]',_0xa208f7['uniqueid']),_0xa208f7);utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x22'),_0xa208f7['uniqueid'],_0xa208f7[_0x62f6('0x20')],_0xa208f7[_0x62f6('0x23')]));if(_[_0x62f6('0x24')](_0xa208f7[_0x62f6('0x23')],'.wav49')){_0xa208f7[_0x62f6('0x23')]=_0xa208f7[_0x62f6('0x23')][_0x62f6('0x25')](_0x62f6('0x26'),_0x62f6('0x27'));}if(recordings[_0xa208f7[_0x62f6('0x12')]]){var _0x23a95b=_['find'](recordings[_0xa208f7[_0x62f6('0x12')]][_0x62f6('0x28')],{'value':_0xa208f7[_0x62f6('0x23')]});if(_['isNil'](_0x23a95b)){recordings[_0xa208f7[_0x62f6('0x12')]]['monitors'][_0x62f6('0x29')]({'value':_0xa208f7[_0x62f6('0x23')]});}}}}catch(_0xafeff3){utils['error'](util[_0x62f6('0x4')](_0x62f6('0x2a'),_0xa208f7[_0x62f6('0x6')]),_0xafeff3);}};exports[_0x62f6('0x2b')]=function(_0x5378db){try{if(!_[_0x62f6('0x1a')](recordings[_0x5378db[_0x62f6('0x6')]])){utils[_0x62f6('0x10')](util[_0x62f6('0x4')](_0x62f6('0x2c'),_0x5378db['uniqueid']),_0x5378db);utils[_0x62f6('0x13')](util[_0x62f6('0x4')](_0x62f6('0x2d'),_0x5378db[_0x62f6('0x6')],_0x5378db[_0x62f6('0x2e')],_0x5378db[_0x62f6('0x2f')],_0x5378db['cause-txt']));recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x2e')]=_0x5378db[_0x62f6('0x2e')];recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x2f')]=_0x5378db[_0x62f6('0x2f')];recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x30')]=_0x5378db[_0x62f6('0x30')];recordings[_0x5378db[_0x62f6('0x6')]]['connectedlinename']=_0x5378db[_0x62f6('0x31')];if(recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x32')]=='outbound'&&recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0xa')]){recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x30')]=recordings[_0x5378db[_0x62f6('0x6')]]['accountcode'];recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x31')]='';}recordings[_0x5378db[_0x62f6('0x6')]][_0x62f6('0x28')][_0x62f6('0x33')](function(_0x3af775){var _0x212bb5=_[_0x62f6('0x34')](recordings[_0x5378db[_0x62f6('0x6')]]);_0x212bb5[_0x62f6('0x23')]=_0x3af775[_0x62f6('0x23')];writeDB(_0x212bb5);});delete recordings[_0x5378db[_0x62f6('0x6')]];}}catch(_0x296001){utils[_0x62f6('0x17')](util['format']('[%s][recordings][hangup]',_0x5378db[_0x62f6('0x6')]),_0x296001);}};exports[_0x62f6('0x35')]=function(_0x1db7fd){try{if(!_[_0x62f6('0x1a')](recordings[_0x1db7fd[_0x62f6('0x6')]])){utils[_0x62f6('0x10')](util['format']('[%s][recordings][newexten]',_0x1db7fd[_0x62f6('0x6')]),_0x1db7fd);utils['info'](util[_0x62f6('0x4')](_0x62f6('0x36'),_0x1db7fd[_0x62f6('0x6')],_0x1db7fd[_0x62f6('0x37')],_0x1db7fd[_0x62f6('0x38')]));if(_0x1db7fd[_0x62f6('0x37')][_0x62f6('0x39')]()==_0x62f6('0x3a')&&_[_0x62f6('0x3b')](_0x1db7fd[_0x62f6('0x38')][_0x62f6('0x39')](),_0x62f6('0x3c'))){var _0x540848=_0x1db7fd[_0x62f6('0x38')][_0x62f6('0x3d')]('=');var _0x3825a2=_0x540848[0x0][_0x62f6('0x3e')](_0x540848[0x0][_0x62f6('0x3f')]('(')+0x1,_0x540848[0x0][_0x62f6('0x3f')](')'));var _0x5cc669=_0x540848[0x1];recordings[_0x1db7fd[_0x62f6('0x6')]][_0x3825a2]=_0x5cc669;}}}catch(_0x324405){utils[_0x62f6('0x17')](util['format'](_0x62f6('0x40'),_0x1db7fd[_0x62f6('0x6')]),_0x324405);}};exports[_0x62f6('0x41')]=function(_0x29d783){try{if(!_[_0x62f6('0x1a')](recordings[_0x29d783[_0x62f6('0x6')]])){utils[_0x62f6('0x10')](util['format'](_0x62f6('0x42'),_0x29d783[_0x62f6('0x6')]),_0x29d783);utils['info'](util[_0x62f6('0x4')](_0x62f6('0x43'),_0x29d783[_0x62f6('0x6')],_0x29d783[_0x62f6('0x44')]));recordings[_0x29d783[_0x62f6('0x6')]][_0x62f6('0x44')]=_0x29d783[_0x62f6('0x44')];}}catch(_0x28c369){utils[_0x62f6('0x17')](util[_0x62f6('0x4')](_0x62f6('0x42'),_0x29d783[_0x62f6('0x6')]),_0x28c369);}};exports[_0x62f6('0x45')]=function(_0x5133cb){try{utils[_0x62f6('0x10')](util[_0x62f6('0x4')](_0x62f6('0x46'),_0x5133cb[_0x62f6('0x6')]),_0x5133cb);utils['info'](util[_0x62f6('0x4')](_0x62f6('0x47'),_0x5133cb[_0x62f6('0x6')],_0x5133cb[_0x62f6('0x48')],_0x5133cb[_0x62f6('0x49')],_0x5133cb[_0x62f6('0x4a')],_0x5133cb[_0x62f6('0x4b')]));if(recordings[_0x5133cb[_0x62f6('0x4c')]]&&transfers[_0x62f6('0x7')][_0x5133cb[_0x62f6('0x4c')]]){transfers['blinds'][_0x5133cb[_0x62f6('0x4c')]][_0x62f6('0x4d')]=!![];}}catch(_0x375f3c){utils[_0x62f6('0x17')](util[_0x62f6('0x4')](_0x62f6('0x46'),_0x5133cb[_0x62f6('0x6')]),_0x375f3c);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 59873db..ddae5b0 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 _0x7922=['assign','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','[%s][transfers][attendedtransfer]','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel'];(function(_0x32cf0c,_0x55d431){var _0x5a1d31=function(_0x293326){while(--_0x293326){_0x32cf0c['push'](_0x32cf0c['shift']());}};_0x5a1d31(++_0x55d431);}(_0x7922,0x150));var _0x2792=function(_0x6ccabc,_0x2a2a24){_0x6ccabc=_0x6ccabc-0x0;var _0x1ef939=_0x7922[_0x6ccabc];return _0x1ef939;};'use strict';var _=require(_0x2792('0x0'));var util=require(_0x2792('0x1'));var utils=require(_0x2792('0x2'));function writeDB(_0x4306a1){utils['info'](util[_0x2792('0x3')](_0x2792('0x4'),_0x4306a1[_0x2792('0x5')]==='attended'?_0x4306a1[_0x2792('0x6')]:_0x4306a1['uniqueid'],_0x4306a1[_0x2792('0x5')]));utils[_0x2792('0x7')]('CreateVoiceTransferReport',_0x4306a1);}exports[_0x2792('0x8')]={};exports[_0x2792('0x9')]=function(_0x4f90c4){try{utils[_0x2792('0xa')](util[_0x2792('0x3')](_0x2792('0xb'),_0x4f90c4[_0x2792('0xc')]),_0x4f90c4);utils[_0x2792('0xd')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4f90c4[_0x2792('0xc')],_0x4f90c4[_0x2792('0xe')],_0x4f90c4[_0x2792('0xf')],_0x4f90c4[_0x2792('0x10')],_0x4f90c4['transfereecalleridname']));_0x4f90c4[_0x2792('0x5')]=_0x2792('0x11');exports[_0x2792('0x8')][_0x4f90c4['transfereruniqueid']]=_0x4f90c4;writeDB(_0x4f90c4);}catch(_0x242ddf){utils[_0x2792('0x12')](util[_0x2792('0x3')](_0x2792('0xb'),_0x4f90c4[_0x2792('0xc')]),_0x242ddf);}};exports[_0x2792('0x13')]=function(_0x572706){try{utils[_0x2792('0xa')](util[_0x2792('0x3')]('[%s][transfers][attendedtransfer]',_0x572706[_0x2792('0x6')]),_0x572706);utils['info'](util[_0x2792('0x3')](_0x2792('0x14'),_0x572706[_0x2792('0x6')],_0x572706['origtransferercalleridnum'],_0x572706[_0x2792('0x15')],_0x572706[_0x2792('0x16')],_0x572706['transfertargetcalleridname']));_0x572706=_['assign'](_0x572706,{'transfererchannel':_0x572706['origtransfererchannel'],'transferercalleridnum':_0x572706[_0x2792('0x17')],'transferercalleridname':_0x572706[_0x2792('0x15')],'transfererconnectedlinenum':_0x572706[_0x2792('0x18')],'transfererconnectedlinename':_0x572706[_0x2792('0x19')],'transfereraccountcode':_0x572706[_0x2792('0x1a')],'transferercontext':_0x572706['secondtransferercontext'],'transfererexten':_0x572706['secondtransfererexten'],'transfererlinkedid':_0x572706[_0x2792('0x1b')],'context':_0x572706[_0x2792('0x1c')],'extension':_0x572706[_0x2792('0x1d')],'type':_0x2792('0x1e')});if(_[_0x2792('0x1f')](_0x572706[_0x2792('0x20')])){_0x572706=_[_0x2792('0x21')](_0x572706,{'transfereechannel':_0x572706['transfertargetchannel'],'transfereecalleridnum':_0x572706[_0x2792('0x16')],'transfereecalleridname':_0x572706[_0x2792('0x22')],'transfereeconnectedlinenum':_0x572706[_0x2792('0x23')],'transfereeconnectedlinename':_0x572706[_0x2792('0x24')],'transfereeaccountcode':_0x572706[_0x2792('0x25')],'transfereecontext':_0x572706[_0x2792('0x26')],'transfereeexten':_0x572706[_0x2792('0x27')],'transfereelinkedid':_0x572706['transfertargetlinkedid']});}writeDB(_0x572706);}catch(_0x202330){utils[_0x2792('0x12')](util['format'](_0x2792('0x28'),_0x572706['origtransfereruniqueid']),_0x202330);}}; \ No newline at end of file +var _0x1812=['type','request','CreateVoiceTransferReport','[%s][transfers][blindtransfer]','transferercalleridnum','blind','transfereruniqueid','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridnum','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid'];(function(_0x37d374,_0x5b1075){var _0x4dacb7=function(_0x55d21f){while(--_0x55d21f){_0x37d374['push'](_0x37d374['shift']());}};_0x4dacb7(++_0x5b1075);}(_0x1812,0xc6));var _0x2181=function(_0x165bf3,_0x49fcfc){_0x165bf3=_0x165bf3-0x0;var _0xd12540=_0x1812[_0x165bf3];return _0xd12540;};'use strict';var _=require(_0x2181('0x0'));var util=require('util');var utils=require(_0x2181('0x1'));function writeDB(_0x26e028){utils[_0x2181('0x2')](util[_0x2181('0x3')](_0x2181('0x4'),_0x26e028['type']===_0x2181('0x5')?_0x26e028['origtransfereruniqueid']:_0x26e028[_0x2181('0x6')],_0x26e028[_0x2181('0x7')]));utils[_0x2181('0x8')](_0x2181('0x9'),_0x26e028);}exports['blinds']={};exports['blindtransfer']=function(_0xd650f1){try{utils['debug'](util[_0x2181('0x3')](_0x2181('0xa'),_0xd650f1[_0x2181('0x6')]),_0xd650f1);utils[_0x2181('0x2')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xd650f1[_0x2181('0x6')],_0xd650f1[_0x2181('0xb')],_0xd650f1['transferercalleridname'],_0xd650f1['transfereecalleridnum'],_0xd650f1['transfereecalleridname']));_0xd650f1[_0x2181('0x7')]=_0x2181('0xc');exports['blinds'][_0xd650f1[_0x2181('0xd')]]=_0xd650f1;writeDB(_0xd650f1);}catch(_0xf8c591){utils[_0x2181('0xe')](util['format'](_0x2181('0xa'),_0xd650f1[_0x2181('0x6')]),_0xf8c591);}};exports[_0x2181('0xf')]=function(_0x4ed5ff){try{utils[_0x2181('0x10')](util[_0x2181('0x3')](_0x2181('0x11'),_0x4ed5ff[_0x2181('0x12')]),_0x4ed5ff);utils['info'](util[_0x2181('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4ed5ff[_0x2181('0x12')],_0x4ed5ff[_0x2181('0x13')],_0x4ed5ff['origtransferercalleridname'],_0x4ed5ff[_0x2181('0x14')],_0x4ed5ff['transfertargetcalleridname']));_0x4ed5ff=_[_0x2181('0x15')](_0x4ed5ff,{'transfererchannel':_0x4ed5ff[_0x2181('0x16')],'transferercalleridnum':_0x4ed5ff[_0x2181('0x13')],'transferercalleridname':_0x4ed5ff[_0x2181('0x17')],'transfererconnectedlinenum':_0x4ed5ff[_0x2181('0x18')],'transfererconnectedlinename':_0x4ed5ff[_0x2181('0x19')],'transfereraccountcode':_0x4ed5ff[_0x2181('0x1a')],'transferercontext':_0x4ed5ff[_0x2181('0x1b')],'transfererexten':_0x4ed5ff[_0x2181('0x1c')],'transfererlinkedid':_0x4ed5ff[_0x2181('0x1d')],'context':_0x4ed5ff[_0x2181('0x1e')],'extension':_0x4ed5ff[_0x2181('0x1f')],'type':_0x2181('0x5')});if(_[_0x2181('0x20')](_0x4ed5ff[_0x2181('0x21')])){_0x4ed5ff=_['assign'](_0x4ed5ff,{'transfereechannel':_0x4ed5ff[_0x2181('0x22')],'transfereecalleridnum':_0x4ed5ff[_0x2181('0x14')],'transfereecalleridname':_0x4ed5ff[_0x2181('0x23')],'transfereeconnectedlinenum':_0x4ed5ff[_0x2181('0x24')],'transfereeconnectedlinename':_0x4ed5ff[_0x2181('0x25')],'transfereeaccountcode':_0x4ed5ff[_0x2181('0x26')],'transfereecontext':_0x4ed5ff[_0x2181('0x27')],'transfereeexten':_0x4ed5ff['transfertargetexten'],'transfereelinkedid':_0x4ed5ff[_0x2181('0x28')]});}writeDB(_0x4ed5ff);}catch(_0x44fdf7){utils['error'](util[_0x2181('0x3')](_0x2181('0x11'),_0x4ed5ff['origtransfereruniqueid']),_0x44fdf7);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 01830f9..9192abc 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 _0x1f2c=['result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diff','sumTime','now','isAfter','bluebird','jayson/promise','moment','client','http','xdr','info','inspect','debug','error','then','[utils][request]\x20name:%s','catch','request','GetUser','internal','interface','[utils][getUser]\x20where:%s','stringify'];(function(_0x59e21c,_0x4d77b9){var _0x199b4c=function(_0x3034f0){while(--_0x3034f0){_0x59e21c['push'](_0x59e21c['shift']());}};_0x199b4c(++_0x4d77b9);}(_0x1f2c,0x144));var _0xc1f2=function(_0x7b7e1c,_0x10a1f4){_0x7b7e1c=_0x7b7e1c-0x0;var _0x32b201=_0x1f2c[_0x7b7e1c];return _0x32b201;};'use strict';var BPromise=require(_0xc1f2('0x0'));var jayson=require(_0xc1f2('0x1'));var moment=require(_0xc1f2('0x2'));var util=require('util');var client=jayson[_0xc1f2('0x3')][_0xc1f2('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0xc1f2('0x5'));exports[_0xc1f2('0x6')]=function(_0x5f0743,_0x459349){logger['info'](_0x5f0743,_0x459349?util[_0xc1f2('0x7')](_0x459349,{'showHidden':![],'depth':null}):'');};exports[_0xc1f2('0x8')]=function(_0x5dc2ed,_0x2a5733){logger[_0xc1f2('0x8')](_0x5dc2ed,_0x2a5733?util['inspect'](_0x2a5733,{'showHidden':![],'depth':null}):'');};exports[_0xc1f2('0x9')]=function(_0x107285,_0x51def5){logger[_0xc1f2('0x9')](_0x107285,_0x51def5?util[_0xc1f2('0x7')](_0x51def5,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x38e3b4,_0x36d9f7){return client['request'](_0x38e3b4,{'body':_0x36d9f7})[_0xc1f2('0xa')](function(_0x514153){logger['debug'](_0xc1f2('0xb'),_0x38e3b4,_0x514153?util[_0xc1f2('0x7')](_0x514153,{'showHidden':![],'depth':null}):'');})[_0xc1f2('0xc')](function(_0x1a53ff){logger[_0xc1f2('0x9')](_0xc1f2('0xb'),_0x38e3b4,_0x1a53ff?util[_0xc1f2('0x7')](_0x1a53ff,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5200f9){return client[_0xc1f2('0xd')](_0xc1f2('0xe'),{'options':{'raw':!![],'attributes':['id',_0xc1f2('0xf'),'name',_0xc1f2('0x10')],'where':_0x5200f9,'limit':0x1}})[_0xc1f2('0xa')](function(_0x324d41){logger[_0xc1f2('0x8')](_0xc1f2('0x11'),JSON[_0xc1f2('0x12')](_0x5200f9),_0x324d41?util[_0xc1f2('0x7')](_0x324d41,{'showHidden':![],'depth':null}):'');return _0x324d41[_0xc1f2('0x13')]['length']?_0x324d41[_0xc1f2('0x13')][0x0]:null;});}exports[_0xc1f2('0x14')]=function(_0x393a44){return new BPromise(function(_0x46a0a7,_0x3d6293){if(_0x393a44){return getUser({'internal':_0x393a44})[_0xc1f2('0xa')](function(_0x14187d){logger[_0xc1f2('0x6')](_0xc1f2('0x15'),_0x393a44,_0x14187d?_0xc1f2('0x16'):'notfound');return _0x46a0a7(_0x14187d);})['catch'](function(_0xee319b){logger[_0xc1f2('0x9')](_0xc1f2('0x17'),_0xee319b?util[_0xc1f2('0x7')](_0xee319b,{'showHidden':![],'depth':null}):'');return _0x46a0a7(null);});}return _0x46a0a7(null);});};exports[_0xc1f2('0x18')]=function(_0x59079f){return new BPromise(function(_0x302096,_0x46e666){if(_0x59079f){return getUser({'interface':_0x59079f})[_0xc1f2('0xa')](function(_0x27ce23){logger[_0xc1f2('0x6')](_0xc1f2('0x19'),_0x59079f,_0x27ce23?_0xc1f2('0x16'):_0xc1f2('0x1a'));return _0x302096(_0x27ce23);})[_0xc1f2('0xc')](function(_0x5ea3b7){logger['error']('[utils][getUserByInterface]',_0x5ea3b7?util[_0xc1f2('0x7')](_0x5ea3b7,{'showHidden':![],'depth':null}):'');return _0x302096(null);});}return _0x302096(null);});};exports[_0xc1f2('0x1b')]=function(_0x5613c5){return new BPromise(function(_0x116be,_0x4fd099){if(_0x5613c5){return getUser({'name':_0x5613c5})[_0xc1f2('0xa')](function(_0x55f9f8){logger[_0xc1f2('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x5613c5,_0x55f9f8?_0xc1f2('0x16'):_0xc1f2('0x1a'));return _0x116be(_0x55f9f8);})[_0xc1f2('0xc')](function(_0xab9b0a){logger[_0xc1f2('0x9')](_0xc1f2('0x1c'),_0xab9b0a?util[_0xc1f2('0x7')](_0xab9b0a,{'showHidden':![],'depth':null}):'');return _0x116be(null);});}return _0x116be(null);});};exports[_0xc1f2('0x1d')]=function(_0x328886){return new BPromise(function(_0x586d41,_0x3e2187){if(_0x328886){return client['request'](_0xc1f2('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xc1f2('0x1f'),_0xc1f2('0x20'),_0xc1f2('0x21'),_0xc1f2('0x22')],'where':{'name':_0x328886},'limit':0x1}})[_0xc1f2('0xa')](function(_0xbdbcbc){logger[_0xc1f2('0x8')](_0xc1f2('0x23'),_0x328886,_0xbdbcbc?util[_0xc1f2('0x7')](_0xbdbcbc,{'showHidden':![],'depth':null}):'');logger[_0xc1f2('0x6')](_0xc1f2('0x24'),_0x328886,_0xbdbcbc?_0xc1f2('0x16'):_0xc1f2('0x1a'));return _0x586d41(_0xbdbcbc[_0xc1f2('0x13')][_0xc1f2('0x25')]?_0xbdbcbc[_0xc1f2('0x13')][0x0]:null);})[_0xc1f2('0xc')](function(_0x401582){logger[_0xc1f2('0x9')]('[utils][getVoiceQueueByName]',_0x401582?util['inspect'](_0x401582,{'showHidden':![],'depth':null}):'');return _0x586d41(null);});}return _0x586d41(null);});};exports[_0xc1f2('0x26')]=function(_0x24ca29,_0x2df555){return moment(_0x24ca29)[_0xc1f2('0x27')](_0x2df555,'seconds')[_0xc1f2('0x28')](_0xc1f2('0x29'));};exports[_0xc1f2('0x2a')]=function(_0x40fac6,_0x1c5d21){return moment(_0x40fac6)[_0xc1f2('0x2b')](_0x1c5d21,_0xc1f2('0x2c'))[_0xc1f2('0x28')](_0xc1f2('0x29'));};exports['diffTime']=function(_0x366cab,_0x493bc8){return moment(_0x366cab)[_0xc1f2('0x2d')](moment(_0x493bc8),_0xc1f2('0x2c'));};exports[_0xc1f2('0x2e')]=function(_0x41ab09,_0x3c1e09){return parseInt(_0x41ab09,0xa)+parseInt(_0x3c1e09,0xa);};exports[_0xc1f2('0x2f')]=function(){return moment()['format'](_0xc1f2('0x29'));};exports[_0xc1f2('0x30')]=function(_0x2731bc,_0x2a552c){if(_0x2a552c){return moment(_0x2731bc)[_0xc1f2('0x30')](_0x2a552c);}return!![];};exports['isBefore']=function(_0x4fdd3b,_0x461466){if(_0x461466){return moment(_0x4fdd3b)['isBefore'](_0x461466);}else if(_0x4fdd3b){return!![];}return![];}; \ No newline at end of file +var _0x3c9f=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','internal','interface','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','notfound','getUserByInterface','[utils][getUserByInterface]'];(function(_0x30be49,_0x37d3bf){var _0x401c55=function(_0x1a3e10){while(--_0x1a3e10){_0x30be49['push'](_0x30be49['shift']());}};_0x401c55(++_0x37d3bf);}(_0x3c9f,0x148));var _0xf3c9=function(_0xb99ac5,_0x4dd5fb){_0xb99ac5=_0xb99ac5-0x0;var _0x4c8255=_0x3c9f[_0xb99ac5];return _0x4c8255;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf3c9('0x0'));var moment=require(_0xf3c9('0x1'));var util=require(_0xf3c9('0x2'));var client=jayson[_0xf3c9('0x3')][_0xf3c9('0x4')]({'port':0x2329});var logger=require(_0xf3c9('0x5'))(_0xf3c9('0x6'));exports['info']=function(_0x10bc04,_0x1888d1){logger[_0xf3c9('0x7')](_0x10bc04,_0x1888d1?util[_0xf3c9('0x8')](_0x1888d1,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3ab952,_0x4c25c2){logger[_0xf3c9('0x9')](_0x3ab952,_0x4c25c2?util[_0xf3c9('0x8')](_0x4c25c2,{'showHidden':![],'depth':null}):'');};exports[_0xf3c9('0xa')]=function(_0x29b4af,_0x80858f){logger[_0xf3c9('0xa')](_0x29b4af,_0x80858f?util[_0xf3c9('0x8')](_0x80858f,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x513a95,_0xf4a849){return client[_0xf3c9('0xb')](_0x513a95,{'body':_0xf4a849})['then'](function(_0x34e8e6){logger[_0xf3c9('0x9')](_0xf3c9('0xc'),_0x513a95,_0x34e8e6?util['inspect'](_0x34e8e6,{'showHidden':![],'depth':null}):'');})[_0xf3c9('0xd')](function(_0xba0072){logger[_0xf3c9('0xa')](_0xf3c9('0xc'),_0x513a95,_0xba0072?util[_0xf3c9('0x8')](_0xba0072,{'showHidden':![],'depth':null}):'');});};function getUser(_0x17bcc2){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf3c9('0xe'),'name',_0xf3c9('0xf')],'where':_0x17bcc2,'limit':0x1}})[_0xf3c9('0x10')](function(_0x1f26d4){logger['debug'](_0xf3c9('0x11'),JSON['stringify'](_0x17bcc2),_0x1f26d4?util[_0xf3c9('0x8')](_0x1f26d4,{'showHidden':![],'depth':null}):'');return _0x1f26d4[_0xf3c9('0x12')][_0xf3c9('0x13')]?_0x1f26d4[_0xf3c9('0x12')][0x0]:null;});}exports[_0xf3c9('0x14')]=function(_0xc3483d){return new BPromise(function(_0x4ba7e5,_0x871c75){if(_0xc3483d){return getUser({'internal':_0xc3483d})[_0xf3c9('0x10')](function(_0x15921f){logger[_0xf3c9('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xc3483d,_0x15921f?'found':_0xf3c9('0x15'));return _0x4ba7e5(_0x15921f);})[_0xf3c9('0xd')](function(_0x1b9c78){logger[_0xf3c9('0xa')]('[utils][getUserByInternal]',_0x1b9c78?util['inspect'](_0x1b9c78,{'showHidden':![],'depth':null}):'');return _0x4ba7e5(null);});}return _0x4ba7e5(null);});};exports[_0xf3c9('0x16')]=function(_0x3bddd0){return new BPromise(function(_0x1a97bc,_0x4cd4f9){if(_0x3bddd0){return getUser({'interface':_0x3bddd0})[_0xf3c9('0x10')](function(_0x4a706c){logger[_0xf3c9('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3bddd0,_0x4a706c?'found':'notfound');return _0x1a97bc(_0x4a706c);})[_0xf3c9('0xd')](function(_0x16cd3b){logger['error'](_0xf3c9('0x17'),_0x16cd3b?util[_0xf3c9('0x8')](_0x16cd3b,{'showHidden':![],'depth':null}):'');return _0x1a97bc(null);});}return _0x1a97bc(null);});};exports[_0xf3c9('0x18')]=function(_0x3a1eec){return new BPromise(function(_0x3cb474,_0x49f93a){if(_0x3a1eec){return getUser({'name':_0x3a1eec})[_0xf3c9('0x10')](function(_0x542f60){logger[_0xf3c9('0x7')](_0xf3c9('0x19'),_0x3a1eec,_0x542f60?_0xf3c9('0x1a'):_0xf3c9('0x15'));return _0x3cb474(_0x542f60);})[_0xf3c9('0xd')](function(_0xcc4cbd){logger[_0xf3c9('0xa')]('[utils][getUserByName]',_0xcc4cbd?util[_0xf3c9('0x8')](_0xcc4cbd,{'showHidden':![],'depth':null}):'');return _0x3cb474(null);});}return _0x3cb474(null);});};exports[_0xf3c9('0x1b')]=function(_0x498320){return new BPromise(function(_0x4539c0,_0x4b616d){if(_0x498320){return client[_0xf3c9('0xb')](_0xf3c9('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xf3c9('0x1d'),'type',_0xf3c9('0x1e'),_0xf3c9('0x1f')],'where':{'name':_0x498320},'limit':0x1}})[_0xf3c9('0x10')](function(_0x190b28){logger['debug'](_0xf3c9('0x20'),_0x498320,_0x190b28?util[_0xf3c9('0x8')](_0x190b28,{'showHidden':![],'depth':null}):'');logger[_0xf3c9('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x498320,_0x190b28?_0xf3c9('0x1a'):'notfound');return _0x4539c0(_0x190b28['result']['length']?_0x190b28['result'][0x0]:null);})[_0xf3c9('0xd')](function(_0x3d8853){logger[_0xf3c9('0xa')](_0xf3c9('0x21'),_0x3d8853?util[_0xf3c9('0x8')](_0x3d8853,{'showHidden':![],'depth':null}):'');return _0x4539c0(null);});}return _0x4539c0(null);});};exports['addTime']=function(_0x388697,_0x39a6fc){return moment(_0x388697)['add'](_0x39a6fc,'seconds')[_0xf3c9('0x22')](_0xf3c9('0x23'));};exports[_0xf3c9('0x24')]=function(_0x58f764,_0x2397cb){return moment(_0x58f764)[_0xf3c9('0x25')](_0x2397cb,_0xf3c9('0x26'))[_0xf3c9('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf3c9('0x27')]=function(_0x55c887,_0x44cb75){return moment(_0x55c887)['diff'](moment(_0x44cb75),_0xf3c9('0x26'));};exports[_0xf3c9('0x28')]=function(_0x4f56fa,_0x6e272f){return parseInt(_0x4f56fa,0xa)+parseInt(_0x6e272f,0xa);};exports[_0xf3c9('0x29')]=function(){return moment()['format'](_0xf3c9('0x23'));};exports[_0xf3c9('0x2a')]=function(_0x480423,_0x384369){if(_0x384369){return moment(_0x480423)[_0xf3c9('0x2a')](_0x384369);}return!![];};exports[_0xf3c9('0x2b')]=function(_0x58c0ef,_0x270331){if(_0x270331){return moment(_0x58c0ef)[_0xf3c9('0x2b')](_0x270331);}else if(_0x58c0ef){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 ab15908..caa939b 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 _0x8f22=['xcally','client','name','then','catch','log','user','data','error','auth','set','client-side-logger','logger','isEmpty','body','method','headers','x-forwarded-for','remoteAddress','statusCode','responseTime','role','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','connection','url','other','agent_id','agent_name','setupLoggers','express-winston','path','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x8f22,0x182));var _0x28f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f22[_0x42cae2];return _0x5f256f;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x28f2('0x0'));var path=require(_0x28f2('0x1'));var util=require(_0x28f2('0x2'));var fileLogger=require('./loggers')[_0x28f2('0x3')];var safeTemplate=require(_0x28f2('0x4'))[_0x28f2('0x5')];var maskSensitiveData=require(_0x28f2('0x6'))[_0x28f2('0x7')];function ClientSideLogger(){function _0xb34bae(_0x2de6c5){var _0x49340c=path[_0x28f2('0x8')](_0x28f2('0x9'),'log',_0x28f2('0xa'));var _0x5345b3=path[_0x28f2('0x8')](_0x28f2('0xb'),_0x2de6c5['role']+'-'+_0x2de6c5[_0x28f2('0xc')]);return fs['ensureDir'](path[_0x28f2('0x8')](_0x49340c,_0x5345b3))[_0x28f2('0xd')](function(){var _0x283d32=fileLogger(_0x28f2('0xb'),path['join'](_0x49340c,_0x5345b3));return _0x283d32;})[_0x28f2('0xe')](function(_0x4432ef){throw _0x4432ef;});}this[_0x28f2('0xf')]=function(_0x22e6a7,_0x2bd6bc,_0x536354,_0x24466a){return _0xb34bae(_0x22e6a7[_0x28f2('0x10')])[_0x28f2('0xd')](function(_0x36c5a0){var _0x3c879b=_0x36c5a0[_0x2bd6bc];return _0x3c879b;})[_0x28f2('0xd')](function(_0x273cbe){var _0x58c736=_0x22e6a7['user']?_0x22e6a7[_0x28f2('0x10')]['id']:'no-user';var _0x27df8e=_0x24466a[_0x28f2('0x11')];var _0x5763ae=_0x24466a['timestamp'];var _0x320a52=new Date(Number(_0x5763ae));return _0x273cbe(_0x58c736,_0x320a52,_0x536354,_0x27df8e);})['catch'](function(_0x37f023){fileLogger(_0x28f2('0xb'))[_0x28f2('0x12')](_0x37f023);});};}function setupLoggers(_0x194fd9){return new Promise(function(_0x5e55dd){var _0x48d570=new ClientSideLogger();var _0x5c0113=fileLogger('api');var _0x5dbde5=fileLogger(_0x28f2('0x13'));_0x194fd9[_0x28f2('0x14')](_0x28f2('0x15'),_0x48d570);_0x194fd9['use'](ewinston[_0x28f2('0x16')]({'winstonInstance':_0x5c0113,'meta':![],'statusLevels':!![],'msg':function(_0x318d91,_0x2d2e20){var _0x463ea0='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x28f2('0x17')](_0x318d91['body'])){_0x463ea0+='\x20body=%s';var _0x361339=_0x318d91[_0x28f2('0x18')];maskSensitiveData(_0x361339);}return safeTemplate(util['format'](_0x463ea0,_0x318d91[_0x28f2('0x19')],_0x318d91[_0x28f2('0x1a')][_0x28f2('0x1b')]?_0x318d91[_0x28f2('0x1a')][_0x28f2('0x1b')]:_0x318d91['connection'][_0x28f2('0x1c')]||_0x318d91['ip'],_0x318d91['url'],_0x2d2e20[_0x28f2('0x1d')],_0x2d2e20[_0x28f2('0x1e')],_0x318d91[_0x28f2('0x10')]?_0x318d91[_0x28f2('0x10')]['id']:null,_0x318d91[_0x28f2('0x10')]?_0x318d91[_0x28f2('0x10')][_0x28f2('0xc')]:null,_0x318d91[_0x28f2('0x10')]?_0x318d91[_0x28f2('0x10')][_0x28f2('0x1f')]:null,_0x361339?util[_0x28f2('0x20')](_0x361339,![],null):''));}}));_0x194fd9[_0x28f2('0x21')](ewinston[_0x28f2('0x16')]({'winstonInstance':_0x5dbde5,'meta':![],'statusLevels':!![],'msg':function(_0x561f4a,_0x5baabf){var _0x5e2d75=_0x28f2('0x22');if(_0x561f4a[_0x28f2('0x18')]&&_0x561f4a[_0x28f2('0x18')][_0x28f2('0x23')]&&_0x561f4a[_0x28f2('0x18')]['agent_id']){_0x5e2d75=_0x28f2('0x24');}return util[_0x28f2('0x25')](_0x5e2d75,_0x561f4a[_0x28f2('0x19')],_0x561f4a[_0x28f2('0x1a')][_0x28f2('0x1b')]?_0x561f4a[_0x28f2('0x1a')][_0x28f2('0x1b')]:_0x561f4a[_0x28f2('0x26')][_0x28f2('0x1c')]||_0x561f4a['ip'],_0x561f4a[_0x28f2('0x27')],_0x5baabf[_0x28f2('0x1d')],_0x5baabf[_0x28f2('0x1e')],_0x561f4a['user']?_0x561f4a[_0x28f2('0x10')]['id']:null,_0x561f4a[_0x28f2('0x10')]?_0x561f4a[_0x28f2('0x10')][_0x28f2('0xc')]:null,_0x561f4a['user']?_0x561f4a[_0x28f2('0x10')]['role']:null,_0x561f4a['body']&&_0x561f4a['body'][_0x28f2('0x23')]?_0x561f4a[_0x28f2('0x18')][_0x28f2('0x23')]:_0x28f2('0x28'),_0x561f4a[_0x28f2('0x18')]&&_0x561f4a[_0x28f2('0x18')][_0x28f2('0x29')]?_0x561f4a[_0x28f2('0x18')][_0x28f2('0x29')]:'',_0x561f4a[_0x28f2('0x18')]&&_0x561f4a[_0x28f2('0x18')]['agent_name']?_0x561f4a[_0x28f2('0x18')][_0x28f2('0x2a')]:'');},'ignoreRoute':function(_0x5e560b){var _0x1c388f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1c388f['test'](_0x5e560b[_0x28f2('0x27')]);}}));return _0x5e55dd();});}exports[_0x28f2('0x2b')]=setupLoggers; \ No newline at end of file +var _0xdf1a=['then','catch','user','no-user','data','timestamp','auth','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','responseTime','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','agent_name','setupLoggers','fs-extra','lodash','express-winston','path','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','name','ensureDir'];(function(_0x2f0175,_0x250c03){var _0x1d9e63=function(_0x3932c8){while(--_0x3932c8){_0x2f0175['push'](_0x2f0175['shift']());}};_0x1d9e63(++_0x250c03);}(_0xdf1a,0x159));var _0xadf1=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0xdf1a[_0x3794a0];return _0x5bdaba;};var fs=require(_0xadf1('0x0'));var _=require(_0xadf1('0x1'));var ewinston=require(_0xadf1('0x2'));var path=require(_0xadf1('0x3'));var util=require('util');var fileLogger=require('./loggers')[_0xadf1('0x4')];var safeTemplate=require(_0xadf1('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xadf1('0x6'))[_0xadf1('0x7')];function ClientSideLogger(){function _0x1e4318(_0x30527e){var _0x5b0d23=path['join'](_0xadf1('0x8'),_0xadf1('0x9'),_0xadf1('0xa'));var _0x4bdfcd=path[_0xadf1('0xb')](_0xadf1('0xc'),_0x30527e['role']+'-'+_0x30527e[_0xadf1('0xd')]);return fs[_0xadf1('0xe')](path[_0xadf1('0xb')](_0x5b0d23,_0x4bdfcd))[_0xadf1('0xf')](function(){var _0x265e1b=fileLogger(_0xadf1('0xc'),path[_0xadf1('0xb')](_0x5b0d23,_0x4bdfcd));return _0x265e1b;})[_0xadf1('0x10')](function(_0x16fafb){throw _0x16fafb;});}this[_0xadf1('0x9')]=function(_0x50031f,_0xae32df,_0x3d0ff5,_0x3b9bea){return _0x1e4318(_0x50031f[_0xadf1('0x11')])['then'](function(_0x57646f){var _0x3a1e6f=_0x57646f[_0xae32df];return _0x3a1e6f;})[_0xadf1('0xf')](function(_0x465d5b){var _0x297f4e=_0x50031f['user']?_0x50031f[_0xadf1('0x11')]['id']:_0xadf1('0x12');var _0x20295f=_0x3b9bea[_0xadf1('0x13')];var _0x397ded=_0x3b9bea[_0xadf1('0x14')];var _0x9b92bb=new Date(Number(_0x397ded));return _0x465d5b(_0x297f4e,_0x9b92bb,_0x3d0ff5,_0x20295f);})[_0xadf1('0x10')](function(_0x509601){fileLogger('client')['error'](_0x509601);});};}function setupLoggers(_0x46fd9c){return new Promise(function(_0x20ab6d){var _0x3ee137=new ClientSideLogger();var _0x2bf0b9=fileLogger('api');var _0x712a6c=fileLogger(_0xadf1('0x15'));_0x46fd9c[_0xadf1('0x16')]('client-side-logger',_0x3ee137);_0x46fd9c['use'](ewinston[_0xadf1('0x17')]({'winstonInstance':_0x2bf0b9,'meta':![],'statusLevels':!![],'msg':function(_0x5d0b69,_0xc2490a){var _0x2e1ab8=_0xadf1('0x18');if(!_[_0xadf1('0x19')](_0x5d0b69[_0xadf1('0x1a')])){_0x2e1ab8+=_0xadf1('0x1b');var _0x332492=_0x5d0b69[_0xadf1('0x1a')];maskSensitiveData(_0x332492);}return safeTemplate(util[_0xadf1('0x1c')](_0x2e1ab8,_0x5d0b69[_0xadf1('0x1d')],_0x5d0b69[_0xadf1('0x1e')][_0xadf1('0x1f')]?_0x5d0b69[_0xadf1('0x1e')][_0xadf1('0x1f')]:_0x5d0b69[_0xadf1('0x20')][_0xadf1('0x21')]||_0x5d0b69['ip'],_0x5d0b69[_0xadf1('0x22')],_0xc2490a['statusCode'],_0xc2490a[_0xadf1('0x23')],_0x5d0b69[_0xadf1('0x11')]?_0x5d0b69[_0xadf1('0x11')]['id']:null,_0x5d0b69[_0xadf1('0x11')]?_0x5d0b69[_0xadf1('0x11')][_0xadf1('0xd')]:null,_0x5d0b69[_0xadf1('0x11')]?_0x5d0b69['user'][_0xadf1('0x24')]:null,_0x332492?util['inspect'](_0x332492,![],null):''));}}));_0x46fd9c[_0xadf1('0x25')](ewinston[_0xadf1('0x17')]({'winstonInstance':_0x712a6c,'meta':![],'statusLevels':!![],'msg':function(_0x7af315,_0x44fb1d){var _0x28acae=_0xadf1('0x26');if(_0x7af315['body']&&_0x7af315['body'][_0xadf1('0x27')]&&_0x7af315['body'][_0xadf1('0x28')]){_0x28acae=_0xadf1('0x29');}return util[_0xadf1('0x1c')](_0x28acae,_0x7af315[_0xadf1('0x1d')],_0x7af315['headers'][_0xadf1('0x1f')]?_0x7af315['headers'][_0xadf1('0x1f')]:_0x7af315['connection'][_0xadf1('0x21')]||_0x7af315['ip'],_0x7af315[_0xadf1('0x22')],_0x44fb1d[_0xadf1('0x2a')],_0x44fb1d[_0xadf1('0x23')],_0x7af315['user']?_0x7af315[_0xadf1('0x11')]['id']:null,_0x7af315[_0xadf1('0x11')]?_0x7af315[_0xadf1('0x11')][_0xadf1('0xd')]:null,_0x7af315[_0xadf1('0x11')]?_0x7af315['user']['role']:null,_0x7af315[_0xadf1('0x1a')]&&_0x7af315['body'][_0xadf1('0x27')]?_0x7af315[_0xadf1('0x1a')]['device']:'other',_0x7af315[_0xadf1('0x1a')]&&_0x7af315[_0xadf1('0x1a')][_0xadf1('0x28')]?_0x7af315[_0xadf1('0x1a')]['agent_id']:'',_0x7af315[_0xadf1('0x1a')]&&_0x7af315[_0xadf1('0x1a')][_0xadf1('0x2b')]?_0x7af315[_0xadf1('0x1a')][_0xadf1('0x2b')]:'');},'ignoreRoute':function(_0x1d4dd7){var _0x30d97f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x30d97f['test'](_0x1d4dd7[_0xadf1('0x22')]);}}));return _0x20ab6d();});}exports[_0xadf1('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index a41aee0..043eaed 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x344c=['join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','locale','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','circularMonthInterval','clone','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','min','max','domCompare','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x344c,0x1d1));var _0xc344=function(_0x11ef57,_0x4fca84){_0x11ef57=_0x11ef57-0x0;var _0x54bb08=_0x344c[_0x11ef57];return _0x54bb08;};var _=require(_0xc344('0x0'));var moment=require(_0xc344('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][_0xc344('0x2')](function(_0x7a51c3){return _0x7a51c3['source'];})[_0xc344('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xc344('0x4');var EINVALID_DATE=_0xc344('0x5');function throwIfDateNotValid(_0x5730e3){if(!_0x5730e3['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x25e2ef){var _0x101703=_0x25e2ef[_0xc344('0x6')](':')[_0xc344('0x2')](function(_0x35a9a1){return parseInt(_0x35a9a1,0xa);});var _0x1cf4e3=_0x101703[0x0];var _0xc91c2c=_0x101703[0x1];if(_0x1cf4e3<0x0||_0x1cf4e3>0x17||_0xc91c2c<0x0||_0xc91c2c>0x3b){throw new Error(EINVALID_DATE);}return[_0x1cf4e3,_0xc91c2c];}function circularDoWInterval(_0x462725,_0x1017a7){if(_0x462725===_0x1017a7){return[_0x462725];}else{var _0x479371=moment[_0xc344('0x7')]();moment[_0xc344('0x7')]('en');var _0x95db55=moment['weekdaysShort']()[_0xc344('0x2')](function(_0xaa9ca1){return _0xaa9ca1[_0xc344('0x8')]();});moment[_0xc344('0x7')](_0x479371);var _0x347556=_0x95db55['indexOf'](_0x462725);var _0x12fe27=_0x95db55[_0xc344('0x9')](_0x1017a7);if(_0x12fe27>_0x347556){return _0x95db55['slice'](_0x347556,_0x12fe27+0x1);}else{var _0x16d6cb=_0x95db55[_0xc344('0xa')](0x0,_0x12fe27+0x1);var _0x647500=_0x95db55[_0xc344('0xa')](_0x347556);return _0x647500[_0xc344('0xb')](_0x16d6cb);}}}module[_0xc344('0xc')][_0xc344('0xd')]=circularDoWInterval;function circularMonthInterval(_0x34066c,_0x154a20){if(_0x34066c===_0x154a20){return[_0x34066c];}else{var _0xea6871=moment[_0xc344('0x7')]();moment[_0xc344('0x7')]('en');var _0x2c7705=moment['monthsShort']()[_0xc344('0x2')](function(_0x1d6631){return _0x1d6631[_0xc344('0x8')]();});moment[_0xc344('0x7')](_0xea6871);var _0x466e01=_0x2c7705[_0xc344('0x9')](_0x34066c);var _0x363f6a=_0x2c7705[_0xc344('0x9')](_0x154a20);if(_0x363f6a>_0x466e01){return _0x2c7705[_0xc344('0xa')](_0x466e01,_0x363f6a+0x1);}else{var _0x50af1d=_0x2c7705[_0xc344('0xa')](0x0,_0x363f6a+0x1);var _0x240865=_0x2c7705[_0xc344('0xa')](_0x466e01);return _0x240865['concat'](_0x50af1d);}}}module[_0xc344('0xc')][_0xc344('0xe')]=circularMonthInterval;function parseDom(_0x17363d){var _0xbecfde=parseInt(_0x17363d,0xa);if(_0xbecfde<0x1||_0xbecfde>0x1f){throw new Error(EINVALID_DATE);}return _0xbecfde;}function timeCompare(_0x1e5ddb,_0x32f97b,_0x42df15){var _0x1c0509=_0x1e5ddb[_0xc344('0xf')]();var _0x5a70f2=extractTime(_0x32f97b);var _0x3bfc49=_0x5a70f2[0x0];var _0xed6931=_0x5a70f2[0x1];var _0x54d457=_0x1e5ddb[_0xc344('0xf')]()['hours'](_0x3bfc49)['minutes'](_0xed6931);throwIfDateNotValid(_0x54d457);var _0x3df9a3=extractTime(_0x42df15);var _0x506905=_0x3df9a3[0x0];var _0x337d6e=_0x3df9a3[0x1];var _0x468fdd=_0x1e5ddb[_0xc344('0xf')]()['hours'](_0x506905)[_0xc344('0x10')](_0x337d6e);throwIfDateNotValid(_0x468fdd);if(_0x468fdd[_0xc344('0x11')](_0x54d457)){var _0x47a075=_0x1c0509[_0xc344('0xf')]()[_0xc344('0x12')](_0xc344('0x13'));var _0x42f0ba=_0x1c0509[_0xc344('0xf')]()[_0xc344('0x14')](_0xc344('0x13'));return _0x1c0509[_0xc344('0x15')](_0x54d457,_0x42f0ba,undefined,'[]')||_0x1c0509[_0xc344('0x15')](_0x47a075,_0x468fdd,undefined,'[]');}else{return _0x1c0509[_0xc344('0x15')](_0x54d457,_0x468fdd,undefined,'[]');}}module[_0xc344('0xc')][_0xc344('0x16')]=timeCompare;function dowCompare(_0x52a636,_0x502ba7,_0x368d3a){var _0x24be70=_0x52a636[_0xc344('0x7')]('en')[_0xc344('0x17')](_0xc344('0x18'))[_0xc344('0x8')]();return circularDoWInterval(_0x502ba7,_0x368d3a)[_0xc344('0x19')](_0x24be70);}module[_0xc344('0xc')][_0xc344('0x1a')]=dowCompare;function domCompare(_0x5c2004,_0xb09629,_0x5dd40d){var _0x3918eb=_0x5c2004[_0xc344('0x1b')]();if(_0xb09629===_0x5dd40d){return _0x3918eb===_0xb09629;}else{var _0x489669=_0x5c2004[_0xc344('0x1c')]();var _0x5e9600=_0xb09629<_0x5dd40d;let _0x15068a=![];var _0x3874d9=0x0;var _0x3eeb47=0x0;if(_0x5e9600){_0x3874d9=Math['max'](0x1,_0xb09629);_0x3eeb47=Math['min'](_0x5dd40d,_0x489669);_0x15068a=_0x3918eb>=_0x3874d9&&_0x3918eb<=_0x3eeb47;}else{_0x3874d9=Math[_0xc344('0x1d')](_0xb09629,_0x489669);_0x3eeb47=Math[_0xc344('0x1e')](0x1,_0x5dd40d);_0x15068a=_0x3918eb>=_0x3874d9||_0x3918eb<=_0x3eeb47;}return _0x15068a;}}module[_0xc344('0xc')][_0xc344('0x1f')]=domCompare;function monthCompare(_0x59256c,_0x3aedb6,_0xc0b602){var _0x3114a1=_0x59256c[_0xc344('0x7')]('en')[_0xc344('0x17')]('MMM')[_0xc344('0x8')]();return circularMonthInterval(_0x3aedb6,_0xc0b602)[_0xc344('0x19')](_0x3114a1);}module[_0xc344('0xc')][_0xc344('0x20')]=monthCompare;function iftime(_0x3886b9,_0x551afa=moment['tz'][_0xc344('0x21')](),_0x2d1018=moment()){if(!validateRx[_0xc344('0x22')](_0x3886b9)){throw new Error(EINVALID_STRING);}else{var _0x3c2a80=(moment[_0xc344('0x23')](_0x2d1018)?_0x2d1018[_0xc344('0xf')]():moment(_0x2d1018))['tz'](_0x551afa)[_0xc344('0x7')]('en');throwIfDateNotValid(_0x3c2a80);var _0x41c322=_0x3886b9[_0xc344('0x6')](',');var _0x1a3f68=_0x41c322[0x0];var _0x2bf47e=_0x41c322[0x1];var _0x336cf2=_0x41c322[0x2];var _0x4d16de=_0x41c322[0x3];let _0x4c3722=!![];if(_0x1a3f68!=='*'){var _0x5286e6=_0x1a3f68[_0xc344('0x6')]('-');var _0x269409=_[_0xc344('0x24')](_0x5286e6[0x0],0x5,'0');var _0x71fcf3=_0x5286e6['length']===0x2?_[_0xc344('0x24')](_0x5286e6[0x1],0x5,'0'):_0x269409;_0x4c3722=timeCompare(_0x3c2a80,_0x269409,_0x71fcf3);}let _0x3d8445=!![];if(_0x2bf47e!=='*'){var _0x597b1e=_0x2bf47e[_0xc344('0x6')]('-');var _0x2d2276=_0x597b1e[0x0];var _0x18b7b9=_0x597b1e[_0xc344('0x25')]===0x2?_0x597b1e[0x1]:_0x2d2276;_0x3d8445=dowCompare(_0x3c2a80,_0x2d2276,_0x18b7b9);}let _0x3c3fdb=!![];if(_0x336cf2!=='*'){var _0x12f3a8=_0x336cf2['split']('-');var _0x167051=parseDom(_0x12f3a8[0x0]);var _0x59631f=_0x12f3a8['length']===0x2?parseDom(_0x12f3a8[0x1]):_0x167051;_0x3c3fdb=domCompare(_0x3c2a80,_0x167051,_0x59631f);}let _0x422ffa=!![];if(_0x4d16de!=='*'){var _0x2f69fd=_0x4d16de[_0xc344('0x6')]('-');var _0x334d27=_0x2f69fd[0x0];var _0x5e11f9=_0x2f69fd[_0xc344('0x25')]===0x2?_0x2f69fd[0x1]:_0x2f69fd[0x0];_0x422ffa=monthCompare(_0x3c2a80,_0x334d27,_0x5e11f9);}return _0x4c3722&&_0x3d8445&&_0x3c3fdb&&_0x422ffa;}}module['exports'][_0xc344('0x26')]=iftime; \ No newline at end of file +var _0x75c3=['guess','test','isMoment','padStart','length','split','iftime','lodash','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','day','endOf','isBetween','format','ddd','includes','dowCompare','date','daysInMonth','min','max','domCompare','monthCompare'];(function(_0x512ee1,_0x26701e){var _0x167513=function(_0x4ead35){while(--_0x4ead35){_0x512ee1['push'](_0x512ee1['shift']());}};_0x167513(++_0x26701e);}(_0x75c3,0x13f));var _0x375c=function(_0x89123f,_0x5b5342){_0x89123f=_0x89123f-0x0;var _0x487f72=_0x75c3[_0x89123f];return _0x487f72;};var _=require(_0x375c('0x0'));var moment=require(_0x375c('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][_0x375c('0x2')](function(_0x3f06a2){return _0x3f06a2[_0x375c('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x375c('0x4');var EINVALID_DATE=_0x375c('0x5');function throwIfDateNotValid(_0x2745aa){if(!_0x2745aa[_0x375c('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x50a287){var _0x578925=_0x50a287['split'](':')['map'](function(_0x106e3b){return parseInt(_0x106e3b,0xa);});var _0x4a5c46=_0x578925[0x0];var _0x39d9d8=_0x578925[0x1];if(_0x4a5c46<0x0||_0x4a5c46>0x17||_0x39d9d8<0x0||_0x39d9d8>0x3b){throw new Error(EINVALID_DATE);}return[_0x4a5c46,_0x39d9d8];}function circularDoWInterval(_0x5b1d19,_0x418965){if(_0x5b1d19===_0x418965){return[_0x5b1d19];}else{var _0x1d885f=moment[_0x375c('0x7')]();moment[_0x375c('0x7')]('en');var _0x184075=moment['weekdaysShort']()[_0x375c('0x2')](function(_0x649f2f){return _0x649f2f[_0x375c('0x8')]();});moment['locale'](_0x1d885f);var _0x93b54a=_0x184075[_0x375c('0x9')](_0x5b1d19);var _0x14d651=_0x184075[_0x375c('0x9')](_0x418965);if(_0x14d651>_0x93b54a){return _0x184075[_0x375c('0xa')](_0x93b54a,_0x14d651+0x1);}else{var _0x2d5918=_0x184075['slice'](0x0,_0x14d651+0x1);var _0x4def7e=_0x184075[_0x375c('0xa')](_0x93b54a);return _0x4def7e[_0x375c('0xb')](_0x2d5918);}}}module[_0x375c('0xc')][_0x375c('0xd')]=circularDoWInterval;function circularMonthInterval(_0x3727e9,_0x3a2c65){if(_0x3727e9===_0x3a2c65){return[_0x3727e9];}else{var _0x4f4281=moment['locale']();moment[_0x375c('0x7')]('en');var _0x1a2020=moment[_0x375c('0xe')]()[_0x375c('0x2')](function(_0x4eaf09){return _0x4eaf09['toLowerCase']();});moment[_0x375c('0x7')](_0x4f4281);var _0x42f12e=_0x1a2020[_0x375c('0x9')](_0x3727e9);var _0x5a3dfd=_0x1a2020['indexOf'](_0x3a2c65);if(_0x5a3dfd>_0x42f12e){return _0x1a2020[_0x375c('0xa')](_0x42f12e,_0x5a3dfd+0x1);}else{var _0x14675a=_0x1a2020[_0x375c('0xa')](0x0,_0x5a3dfd+0x1);var _0x5589d7=_0x1a2020['slice'](_0x42f12e);return _0x5589d7[_0x375c('0xb')](_0x14675a);}}}module[_0x375c('0xc')][_0x375c('0xf')]=circularMonthInterval;function parseDom(_0x31e6fb){var _0x49f9af=parseInt(_0x31e6fb,0xa);if(_0x49f9af<0x1||_0x49f9af>0x1f){throw new Error(EINVALID_DATE);}return _0x49f9af;}function timeCompare(_0x476514,_0x61ac37,_0x101341){var _0x261b4a=_0x476514[_0x375c('0x10')]();var _0x5c11e7=extractTime(_0x61ac37);var _0x2df06c=_0x5c11e7[0x0];var _0x2aa512=_0x5c11e7[0x1];var _0x419892=_0x476514[_0x375c('0x10')]()[_0x375c('0x11')](_0x2df06c)[_0x375c('0x12')](_0x2aa512);throwIfDateNotValid(_0x419892);var _0x21d034=extractTime(_0x101341);var _0x4fba1a=_0x21d034[0x0];var _0x27f030=_0x21d034[0x1];var _0x5c40f3=_0x476514[_0x375c('0x10')]()[_0x375c('0x11')](_0x4fba1a)[_0x375c('0x12')](_0x27f030);throwIfDateNotValid(_0x5c40f3);if(_0x5c40f3['isBefore'](_0x419892)){var _0x37c70e=_0x261b4a[_0x375c('0x10')]()['startOf'](_0x375c('0x13'));var _0x36eec3=_0x261b4a['clone']()[_0x375c('0x14')](_0x375c('0x13'));return _0x261b4a['isBetween'](_0x419892,_0x36eec3,undefined,'[]')||_0x261b4a['isBetween'](_0x37c70e,_0x5c40f3,undefined,'[]');}else{return _0x261b4a[_0x375c('0x15')](_0x419892,_0x5c40f3,undefined,'[]');}}module[_0x375c('0xc')]['timeCompare']=timeCompare;function dowCompare(_0x16ddb6,_0x189edc,_0x5721ea){var _0xc93f03=_0x16ddb6['locale']('en')[_0x375c('0x16')](_0x375c('0x17'))[_0x375c('0x8')]();return circularDoWInterval(_0x189edc,_0x5721ea)[_0x375c('0x18')](_0xc93f03);}module[_0x375c('0xc')][_0x375c('0x19')]=dowCompare;function domCompare(_0x1959b2,_0x59b536,_0x518b62){var _0x52d351=_0x1959b2[_0x375c('0x1a')]();if(_0x59b536===_0x518b62){return _0x52d351===_0x59b536;}else{var _0x12c88e=_0x1959b2[_0x375c('0x1b')]();var _0x555558=_0x59b536<_0x518b62;let _0x10849d=![];var _0x139993=0x0;var _0x106f88=0x0;if(_0x555558){_0x139993=Math['max'](0x1,_0x59b536);_0x106f88=Math[_0x375c('0x1c')](_0x518b62,_0x12c88e);_0x10849d=_0x52d351>=_0x139993&&_0x52d351<=_0x106f88;}else{_0x139993=Math[_0x375c('0x1c')](_0x59b536,_0x12c88e);_0x106f88=Math[_0x375c('0x1d')](0x1,_0x518b62);_0x10849d=_0x52d351>=_0x139993||_0x52d351<=_0x106f88;}return _0x10849d;}}module[_0x375c('0xc')][_0x375c('0x1e')]=domCompare;function monthCompare(_0x1bc0ce,_0x4fc9b9,_0x179b01){var _0x19ce41=_0x1bc0ce[_0x375c('0x7')]('en')[_0x375c('0x16')]('MMM')[_0x375c('0x8')]();return circularMonthInterval(_0x4fc9b9,_0x179b01)[_0x375c('0x18')](_0x19ce41);}module[_0x375c('0xc')][_0x375c('0x1f')]=monthCompare;function iftime(_0x1b8b10,_0x2d122d=moment['tz'][_0x375c('0x20')](),_0x3b23b9=moment()){if(!validateRx[_0x375c('0x21')](_0x1b8b10)){throw new Error(EINVALID_STRING);}else{var _0x5e03f2=(moment[_0x375c('0x22')](_0x3b23b9)?_0x3b23b9[_0x375c('0x10')]():moment(_0x3b23b9))['tz'](_0x2d122d)[_0x375c('0x7')]('en');throwIfDateNotValid(_0x5e03f2);var _0xe99da4=_0x1b8b10['split'](',');var _0x26513b=_0xe99da4[0x0];var _0x46a7ea=_0xe99da4[0x1];var _0x514b77=_0xe99da4[0x2];var _0x576632=_0xe99da4[0x3];let _0x3961f0=!![];if(_0x26513b!=='*'){var _0x579fd3=_0x26513b['split']('-');var _0x33deec=_[_0x375c('0x23')](_0x579fd3[0x0],0x5,'0');var _0x26cf6c=_0x579fd3[_0x375c('0x24')]===0x2?_[_0x375c('0x23')](_0x579fd3[0x1],0x5,'0'):_0x33deec;_0x3961f0=timeCompare(_0x5e03f2,_0x33deec,_0x26cf6c);}let _0x283b2b=!![];if(_0x46a7ea!=='*'){var _0x43626f=_0x46a7ea['split']('-');var _0xb80418=_0x43626f[0x0];var _0x2a0952=_0x43626f[_0x375c('0x24')]===0x2?_0x43626f[0x1]:_0xb80418;_0x283b2b=dowCompare(_0x5e03f2,_0xb80418,_0x2a0952);}let _0x5028c0=!![];if(_0x514b77!=='*'){var _0x146155=_0x514b77[_0x375c('0x25')]('-');var _0x45bb1d=parseDom(_0x146155[0x0]);var _0x114e57=_0x146155[_0x375c('0x24')]===0x2?parseDom(_0x146155[0x1]):_0x45bb1d;_0x5028c0=domCompare(_0x5e03f2,_0x45bb1d,_0x114e57);}let _0x342a64=!![];if(_0x576632!=='*'){var _0x248c6b=_0x576632[_0x375c('0x25')]('-');var _0x5241f1=_0x248c6b[0x0];var _0x2cba69=_0x248c6b[_0x375c('0x24')]===0x2?_0x248c6b[0x1]:_0x248c6b[0x0];_0x342a64=monthCompare(_0x5e03f2,_0x5241f1,_0x2cba69);}return _0x3961f0&&_0x283b2b&&_0x5028c0&&_0x342a64;}}module[_0x375c('0xc')][_0x375c('0x26')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 837fd3d..a9e7287 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ae7=['fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','%s-%s.log','message','}}}','replace','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','%s-%s','error','File','warn','consoleLogger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1ae7,0xd8));var _0x71ae=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x1ae7[_0x37bd26];return _0xe83dc4;};'use strict';var path=require(_0x71ae('0x0'));var util=require(_0x71ae('0x1'));var moment=require(_0x71ae('0x2'));var winston=require(_0x71ae('0x3'));var config=require(_0x71ae('0x4'));var debugLevel=config[_0x71ae('0x5')]?config['debugLevel'][_0x71ae('0x6')]():_0x71ae('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x71ae('0x8'),'warn':_0x71ae('0x9'),'info':_0x71ae('0xa'),'print':_0x71ae('0xb'),'success':_0x71ae('0xc'),'http':_0x71ae('0xd'),'verbose':_0x71ae('0xe'),'debug':_0x71ae('0xf'),'silly':'bold\x20cyan'};winston[_0x71ae('0x10')](XC_LOG_COLORS);function getLogFileName(_0xa96395,_0x42dede,_0xda560e){var _0x4aa2d2=_0xa96395||_0x71ae('0x11');return path[_0x71ae('0x12')](_0x4aa2d2,util['format'](_0x71ae('0x13'),_0x42dede,_0xda560e));}function formatter(_0x1b23fd,_0x135310){_0x135310[_0x71ae('0x14')]=_0x135310['message']['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0x71ae('0x15'))[_0x71ae('0x16')](/@{/g,'{{')[_0x71ae('0x16')](/}@/g,'}}');return util[_0x71ae('0x17')](_0x71ae('0x18'),moment()[_0x71ae('0x17')](_0x71ae('0x19')),_0x135310[_0x71ae('0x1a')][_0x71ae('0x1b')](),_0x1b23fd,_0x135310['message']);}function fileFormat(_0x5ec1a9,_0x48dedf){_0x48dedf[_0x71ae('0x14')]=_0x48dedf[_0x71ae('0x14')][_0x71ae('0x16')](/@@{/g,_0x71ae('0x1c'))['replace'](/}@@/g,_0x71ae('0x15'))['replace'](/@{/g,'{{')[_0x71ae('0x16')](/}@/g,'}}');var _0x5b9f3c=_0x48dedf['meta']&&Object[_0x71ae('0x1d')](_0x48dedf[_0x71ae('0x1e')])[_0x71ae('0x1f')]?'\x0a\x09'+JSON[_0x71ae('0x20')](_0x48dedf[_0x71ae('0x1e')]):'';return util[_0x71ae('0x17')](_0x71ae('0x21'),moment()[_0x71ae('0x17')](_0x71ae('0x19')),_0x48dedf[_0x71ae('0x1a')][_0x71ae('0x1b')](),_0x5ec1a9,_0x48dedf['message'],_0x5b9f3c);}function consoleLogger(){var _0xe8193d=new winston[(_0x71ae('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x71ae('0x23'))][(_0x71ae('0x24'))]({'level':'warn','json':![],'formatter':function(_0x1442cd){return formatter('',_0x1442cd);}})]});return _0xe8193d;}function fileLogger(_0x5a805a,_0xf08713){var _0x8a707=new winston[(_0x71ae('0x22'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x71ae('0x23'))]['File']({'name':util[_0x71ae('0x17')](_0x71ae('0x25'),_0x5a805a,_0x71ae('0x26')),'filename':getLogFileName(_0xf08713,_0x5a805a,_0x71ae('0x26')),'level':_0x71ae('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f0792){return fileFormat(_0x5a805a,_0x3f0792);}}),new winston['transports'][(_0x71ae('0x27'))]({'name':util['format']('%s-%s',_0x5a805a,debugLevel),'filename':getLogFileName(_0xf08713,_0x5a805a,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ce964){return fileFormat(_0x5a805a,_0x2ce964);}}),new winston[(_0x71ae('0x23'))]['Console']({'level':_0x71ae('0x28'),'json':![],'formatter':function(_0x56be12){return fileFormat(_0x5a805a,_0x56be12);}})]});return _0x8a707;}exports[_0x71ae('0x29')]=consoleLogger;exports[_0x71ae('0x2a')]=fileLogger; \ No newline at end of file +var _0x3ef3=['gray','bold\x20blue','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','Console','warn','transports','File','%s-%s','error','consoleLogger','fileLogger','moment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20green'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x3ef3,0xac));var _0x33ef=function(_0x237f07,_0x2142a9){_0x237f07=_0x237f07-0x0;var _0x22c133=_0x3ef3[_0x237f07];return _0x22c133;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x33ef('0x0'));var winston=require('winston');var config=require('../config/environment');var debugLevel=config[_0x33ef('0x1')]?config[_0x33ef('0x1')][_0x33ef('0x2')]():_0x33ef('0x3');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':_0x33ef('0x4'),'error':'red','warn':_0x33ef('0x5'),'info':_0x33ef('0x6'),'print':'bold\x20white','success':_0x33ef('0x7'),'http':_0x33ef('0x8'),'verbose':'bold\x20magenta','debug':_0x33ef('0x9'),'silly':'bold\x20cyan'};winston[_0x33ef('0xa')](XC_LOG_COLORS);function getLogFileName(_0x2244b3,_0x295bbd,_0x1a8ea5){var _0x48204e=_0x2244b3||_0x33ef('0xb');return path[_0x33ef('0xc')](_0x48204e,util[_0x33ef('0xd')](_0x33ef('0xe'),_0x295bbd,_0x1a8ea5));}function formatter(_0x552d55,_0x3b3f9a){_0x3b3f9a[_0x33ef('0xf')]=_0x3b3f9a[_0x33ef('0xf')][_0x33ef('0x10')](/@@{/g,_0x33ef('0x11'))[_0x33ef('0x10')](/}@@/g,_0x33ef('0x12'))[_0x33ef('0x10')](/@{/g,'{{')[_0x33ef('0x10')](/}@/g,'}}');return util['format'](_0x33ef('0x13'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x3b3f9a[_0x33ef('0x14')][_0x33ef('0x15')](),_0x552d55,_0x3b3f9a[_0x33ef('0xf')]);}function fileFormat(_0x9b3806,_0x14a269){_0x14a269[_0x33ef('0xf')]=_0x14a269[_0x33ef('0xf')][_0x33ef('0x10')](/@@{/g,_0x33ef('0x11'))['replace'](/}@@/g,_0x33ef('0x12'))[_0x33ef('0x10')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x35eb2e=_0x14a269[_0x33ef('0x16')]&&Object['keys'](_0x14a269['meta'])[_0x33ef('0x17')]?'\x0a\x09'+JSON[_0x33ef('0x18')](_0x14a269[_0x33ef('0x16')]):'';return util[_0x33ef('0xd')](_0x33ef('0x19'),moment()[_0x33ef('0xd')](_0x33ef('0x1a')),_0x14a269['level'][_0x33ef('0x15')](),_0x9b3806,_0x14a269[_0x33ef('0xf')],_0x35eb2e);}function consoleLogger(){var _0x32a00a=new winston[(_0x33ef('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x33ef('0x1c'))]({'level':_0x33ef('0x1d'),'json':![],'formatter':function(_0xa810f9){return formatter('',_0xa810f9);}})]});return _0x32a00a;}function fileLogger(_0x3908fe,_0xd9c7d6){var _0x57ca76=new winston[(_0x33ef('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x33ef('0x1e'))][(_0x33ef('0x1f'))]({'name':util[_0x33ef('0xd')](_0x33ef('0x20'),_0x3908fe,_0x33ef('0x21')),'filename':getLogFileName(_0xd9c7d6,_0x3908fe,_0x33ef('0x21')),'level':_0x33ef('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xfc4ca6){return fileFormat(_0x3908fe,_0xfc4ca6);}}),new winston['transports'][(_0x33ef('0x1f'))]({'name':util[_0x33ef('0xd')](_0x33ef('0x20'),_0x3908fe,debugLevel),'filename':getLogFileName(_0xd9c7d6,_0x3908fe,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a4ffc){return fileFormat(_0x3908fe,_0x2a4ffc);}}),new winston[(_0x33ef('0x1e'))][(_0x33ef('0x1c'))]({'level':_0x33ef('0x1d'),'json':![],'formatter':function(_0x32f9c8){return fileFormat(_0x3908fe,_0x32f9c8);}})]});return _0x57ca76;}exports[_0x33ef('0x22')]=consoleLogger;exports[_0x33ef('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 7f025c9..6363e10 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 _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x475eab,_0x15b01d){var _0xc50bc0=function(_0x5c46f7){while(--_0x5c46f7){_0x475eab['push'](_0x475eab['shift']());}};_0xc50bc0(++_0x15b01d);}(_0x66fa,0x117));var _0xa66f=function(_0x36850f,_0x34c50e){_0x36850f=_0x36850f-0x0;var _0x28b9ca=_0x66fa[_0x36850f];return _0x28b9ca;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file +var _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x1967,0x173));var _0x7196=function(_0x58bfbe,_0x28dcb6){_0x58bfbe=_0x58bfbe-0x0;var _0x180a60=_0x1967[_0x58bfbe];return _0x180a60;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index b6fbf30..4d81d18 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 _0xb10b=['safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x5eac44,_0x39b484){var _0x2450f1=function(_0x98ac76){while(--_0x98ac76){_0x5eac44['push'](_0x5eac44['shift']());}};_0x2450f1(++_0x39b484);}(_0xb10b,0x12a));var _0xbb10=function(_0x17d6cd,_0x25e313){_0x17d6cd=_0x17d6cd-0x0;var _0x192c91=_0xb10b[_0x17d6cd];return _0x192c91;};var _=require(_0xbb10('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4bb7bb){return _0x4bb7bb==='{{'?_0xbb10('0x1'):_0xbb10('0x2');}function safeTemplate(_0x1dcb08){var _0x4d688c=_0x1dcb08;if(typeof _0x1dcb08===_0xbb10('0x3')){_0x4d688c=_0x1dcb08[_0xbb10('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xbb10('0x5')](_0x1dcb08)){_0x4d688c=_0x1dcb08[_0xbb10('0x6')](function(_0x49baf4){return safeTemplate(_0x49baf4);});}else if(_[_0xbb10('0x7')](_0x1dcb08)){_0x4d688c=Object['keys'](_0x1dcb08)[_0xbb10('0x8')](function(_0x3cdd53,_0x513741){_0x3cdd53[_0x513741]=safeTemplate(_0x1dcb08[_0x513741]);return _0x3cdd53;},{});}return _0x4d688c;}module[_0xbb10('0x9')][_0xbb10('0xa')]=safeTemplate; \ No newline at end of file +var _0x8f4c=['map','isPlainObject','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','replace','isArray'];(function(_0x7db016,_0x22f7a7){var _0x473c3b=function(_0x232492){while(--_0x232492){_0x7db016['push'](_0x7db016['shift']());}};_0x473c3b(++_0x22f7a7);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1dc484,_0x46350a){_0x1dc484=_0x1dc484-0x0;var _0x5cf305=_0x8f4c[_0x1dc484];return _0x5cf305;};var _=require(_0xc8f4('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x292fb6){return _0x292fb6==='{{'?_0xc8f4('0x1'):_0xc8f4('0x2');}function safeTemplate(_0x19893b){var _0x134d73=_0x19893b;if(typeof _0x19893b==='string'){_0x134d73=_0x19893b[_0xc8f4('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xc8f4('0x4')](_0x19893b)){_0x134d73=_0x19893b[_0xc8f4('0x5')](function(_0x56c9b1){return safeTemplate(_0x56c9b1);});}else if(_[_0xc8f4('0x6')](_0x19893b)){_0x134d73=Object['keys'](_0x19893b)['reduce'](function(_0x520063,_0x373506){_0x520063[_0x373506]=safeTemplate(_0x19893b[_0x373506]);return _0x520063;},{});}return _0x134d73;}module['exports'][_0xc8f4('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 7490b3e..2c3ea32 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 _0x8e99=['apps','name','motion2','env','string','NODE_PATH','pathExists','then','readJSON','updated','info','Updating\x20app.json','exports','path','../config/environment','resolve','server/app.json','legacy-libs','isArray'];(function(_0x2d7d4e,_0x5269ee){var _0x2468dd=function(_0x3c35af){while(--_0x3c35af){_0x2d7d4e['push'](_0x2d7d4e['shift']());}};_0x2468dd(++_0x5269ee);}(_0x8e99,0x92));var _0x98e9=function(_0x49c926,_0x2b5290){_0x49c926=_0x49c926-0x0;var _0x5c97f=_0x8e99[_0x49c926];return _0x5c97f;};var fs=require('fs-extra');var path=require(_0x98e9('0x0'));var config=require(_0x98e9('0x1'));var root=config['root'];var APP_JSON_PATH=path[_0x98e9('0x2')](root,_0x98e9('0x3'));var NODEPATH=path[_0x98e9('0x2')](root,_0x98e9('0x4'));function setLegacyLibsNodeEnvPath(_0x360785){let _0x415ca1=![];if(Array[_0x98e9('0x5')](_0x360785[_0x98e9('0x6')])){var _0x5e7a11=_0x360785[_0x98e9('0x6')]['findIndex'](function(_0x49f3bd){return _0x49f3bd[_0x98e9('0x7')]===_0x98e9('0x8');});if(_0x5e7a11>-0x1){var _0x3f5a3b=_0x360785[_0x98e9('0x6')][_0x5e7a11];if(typeof _0x3f5a3b[_0x98e9('0x9')]['NODE_PATH']!==_0x98e9('0xa')){_0x3f5a3b[_0x98e9('0x9')][_0x98e9('0xb')]=NODEPATH;_0x415ca1=!![];}}return{'appConfig':_0x360785,'updated':_0x415ca1};}}function updateAppConfig(_0x270eb2){return fs[_0x98e9('0xc')](APP_JSON_PATH)[_0x98e9('0xd')](function(_0x257550){if(_0x257550){return fs[_0x98e9('0xe')](APP_JSON_PATH)[_0x98e9('0xd')](function(_0x3dc91f){var _0x189ea6=setLegacyLibsNodeEnvPath(_0x3dc91f);if(_0x189ea6[_0x98e9('0xf')]){_0x270eb2[_0x98e9('0x10')](_0x98e9('0x11'));return fs['writeJSON'](APP_JSON_PATH,_0x3dc91f,{'spaces':0x2});}else{return Promise[_0x98e9('0x2')]();}});}else{return Promise[_0x98e9('0x2')]();}});}module[_0x98e9('0x12')]=updateAppConfig; \ No newline at end of file +var _0xfbb0=['path','../config/environment','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','name','env','NODE_PATH','string','pathExists','then','exports','fs-extra'];(function(_0x3d391b,_0x139db6){var _0x34adb6=function(_0x464b1e){while(--_0x464b1e){_0x3d391b['push'](_0x3d391b['shift']());}};_0x34adb6(++_0x139db6);}(_0xfbb0,0x10f));var _0x0fbb=function(_0x1a2493,_0x1cadae){_0x1a2493=_0x1a2493-0x0;var _0x2d0ec6=_0xfbb0[_0x1a2493];return _0x2d0ec6;};var fs=require(_0x0fbb('0x0'));var path=require(_0x0fbb('0x1'));var config=require(_0x0fbb('0x2'));var root=config['root'];var APP_JSON_PATH=path['resolve'](root,_0x0fbb('0x3'));var NODEPATH=path[_0x0fbb('0x4')](root,_0x0fbb('0x5'));function setLegacyLibsNodeEnvPath(_0x2794ac){let _0x45e1ec=![];if(Array[_0x0fbb('0x6')](_0x2794ac[_0x0fbb('0x7')])){var _0x38f533=_0x2794ac[_0x0fbb('0x7')][_0x0fbb('0x8')](function(_0x4f48d7){return _0x4f48d7[_0x0fbb('0x9')]==='motion2';});if(_0x38f533>-0x1){var _0x38e5c5=_0x2794ac[_0x0fbb('0x7')][_0x38f533];if(typeof _0x38e5c5[_0x0fbb('0xa')][_0x0fbb('0xb')]!==_0x0fbb('0xc')){_0x38e5c5['env'][_0x0fbb('0xb')]=NODEPATH;_0x45e1ec=!![];}}return{'appConfig':_0x2794ac,'updated':_0x45e1ec};}}function updateAppConfig(_0x1e6949){return fs[_0x0fbb('0xd')](APP_JSON_PATH)[_0x0fbb('0xe')](function(_0x53ce42){if(_0x53ce42){return fs['readJSON'](APP_JSON_PATH)[_0x0fbb('0xe')](function(_0x5eadfb){var _0x5cb6fa=setLegacyLibsNodeEnvPath(_0x5eadfb);if(_0x5cb6fa['updated']){_0x1e6949['info']('Updating\x20app.json');return fs['writeJSON'](APP_JSON_PATH,_0x5eadfb,{'spaces':0x2});}else{return Promise[_0x0fbb('0x4')]();}});}else{return Promise['resolve']();}});}module[_0x0fbb('0xf')]=updateAppConfig; \ No newline at end of file